math-main-components 0.0.99 → 0.0.101
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.
@@ -1,26 +1,22 @@
|
|
1
1
|
import React, { MouseEvent, ReactNode } from 'react';
|
2
|
-
export
|
3
|
-
|
4
|
-
default = 1
|
5
|
-
}
|
6
|
-
export declare class TableItem<DataType> {
|
2
|
+
export type TableActionType = "red" | "default";
|
3
|
+
export type TableItem<DataType> = {
|
7
4
|
title: string;
|
8
5
|
subtitle: string;
|
9
6
|
moreText: string;
|
10
7
|
iconName: string;
|
11
8
|
data: DataType;
|
12
|
-
|
13
|
-
|
14
|
-
export declare class TableItemAction<DataType> {
|
9
|
+
};
|
10
|
+
export type TableItemAction<DataType> = {
|
15
11
|
title: string;
|
16
12
|
iconName: string;
|
17
13
|
onClick: (event: MouseEvent<HTMLDivElement>, item: TableItem<DataType>, index: number) => void;
|
18
14
|
type: TableActionType;
|
19
|
-
|
20
|
-
}
|
21
|
-
export declare function Table<DataType>({ items, title, actions, moreActions, marginTop }: {
|
15
|
+
};
|
16
|
+
export declare function Table<DataType>({ items, title, actions, moreActions, selected, marginTop }: {
|
22
17
|
items: TableItem<DataType>[];
|
23
18
|
title: string;
|
19
|
+
selected?: number;
|
24
20
|
actions?: TableItemAction<DataType>[];
|
25
21
|
moreActions?: ((data: DataType, index: number) => ReactNode)[];
|
26
22
|
marginTop?: number;
|
@@ -1 +1 @@
|
|
1
|
-
export { Table, TableActionType, TableItem, TableItemAction } from './Table';
|
1
|
+
export { Table, type TableActionType, type TableItem, type TableItemAction } from './Table';
|
package/dist/index.cjs.js
CHANGED
@@ -616,45 +616,14 @@ function StepBack({ iconName = "arrow_back", text = "Weitere Möglichkeiten" })
|
|
616
616
|
text)));
|
617
617
|
}
|
618
618
|
|
619
|
-
var css_248z$3 = ".styles-module_container__jNs7m h3 {\n font-weight: 500;\n font-size: 16px;\n color: var(--foreground-1);\n}\n\n.styles-module_item_list__FxHkg.styles-module_has_children__Uu-8D {\n border-top: 1px solid var(--border-1);\n border-bottom: 1px solid var(--border-1);\n}\n\n.styles-module_item_list__FxHkg {\n list-style: none;\n padding: 0;\n margin: 0;\n}\n.styles-module_item_list__FxHkg .styles-module_action__YYTok {\n display: flex;\n flex-direction: row;\n align-items: center;\n gap: 6px;\n cursor: pointer;\n padding: 8px 14px;\n border-radius: 25px;\n transition: 0.2s ease-in-out;\n}\n.styles-module_item_list__FxHkg .styles-module_action__YYTok.styles-module_default__SexGH:hover {\n background: var(--background-2);\n}\n.styles-module_item_list__FxHkg .styles-module_action__YYTok.styles-module_red__KD3qJ:hover {\n background: var(--red-2);\n}\n.styles-module_item_list__FxHkg li.styles-module_item__sgyiV {\n padding: 10px 20px;\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: center;\n gap: 10px;\n color: var(--foreground-1);\n}\n.styles-module_item_list__FxHkg li.styles-module_item__sgyiV .styles-module_moreText__-blXb {\n flex: 1;\n margin-bottom: 4px;\n color: var(--primary-1);\n}\n.styles-module_item_list__FxHkg li.styles-module_item__sgyiV .styles-module_subtitle__DT5OF {\n color: var(--foreground-3);\n}\n.styles-module_item_list__FxHkg li.styles-module_item__sgyiV .styles-module_icon__Jy87z {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n color: var(--foreground-1);\n}\n.styles-module_item_list__FxHkg li.styles-module_item__sgyiV:nth-child(even) {\n background: var(--background-2);\n}\n.styles-module_item_list__FxHkg li.styles-module_item__sgyiV:not(:last-child) {\n border-bottom: 1px solid var(--border-1);\n}";
|
620
|
-
var styles$3 = {"container":"styles-module_container__jNs7m","item_list":"styles-module_item_list__FxHkg","has_children":"styles-module_has_children__Uu-8D","action":"styles-module_action__YYTok","default":"styles-module_default__SexGH","red":"styles-module_red__KD3qJ","item":"styles-module_item__sgyiV","
|
619
|
+
var css_248z$3 = ".styles-module_container__jNs7m h3 {\n font-weight: 500;\n font-size: 16px;\n color: var(--foreground-1);\n}\n\n.styles-module_item_list__FxHkg.styles-module_has_children__Uu-8D {\n border-top: 1px solid var(--border-1);\n border-bottom: 1px solid var(--border-1);\n}\n\n.styles-module_item_list__FxHkg {\n list-style: none;\n padding: 0;\n margin: 0;\n}\n.styles-module_item_list__FxHkg .styles-module_action__YYTok {\n display: flex;\n flex-direction: row;\n align-items: center;\n gap: 6px;\n cursor: pointer;\n padding: 8px 14px;\n border-radius: 25px;\n transition: 0.2s ease-in-out;\n}\n.styles-module_item_list__FxHkg .styles-module_action__YYTok.styles-module_default__SexGH:hover {\n background: var(--background-2);\n}\n.styles-module_item_list__FxHkg .styles-module_action__YYTok.styles-module_red__KD3qJ:hover {\n background: var(--red-2);\n}\n.styles-module_item_list__FxHkg li.styles-module_item__sgyiV.styles-module_selected__iOu39 {\n color: var(--primary-1) !important;\n border-color: var(--primary-1);\n}\n.styles-module_item_list__FxHkg li.styles-module_item__sgyiV.styles-module_selected__iOu39 .styles-module_icon__Jy87z {\n color: var(--primary-1) !important;\n}\n.styles-module_item_list__FxHkg li.styles-module_item__sgyiV {\n padding: 10px 20px;\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: center;\n gap: 10px;\n color: var(--foreground-1);\n}\n.styles-module_item_list__FxHkg li.styles-module_item__sgyiV .styles-module_moreText__-blXb {\n flex: 1;\n margin-bottom: 4px;\n color: var(--primary-1);\n}\n.styles-module_item_list__FxHkg li.styles-module_item__sgyiV .styles-module_subtitle__DT5OF {\n color: var(--foreground-3);\n}\n.styles-module_item_list__FxHkg li.styles-module_item__sgyiV .styles-module_icon__Jy87z {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n color: var(--foreground-1);\n}\n.styles-module_item_list__FxHkg li.styles-module_item__sgyiV:nth-child(even) {\n background: var(--background-2);\n}\n.styles-module_item_list__FxHkg li.styles-module_item__sgyiV:not(:last-child) {\n border-bottom: 1px solid var(--border-1);\n}";
|
620
|
+
var styles$3 = {"container":"styles-module_container__jNs7m","item_list":"styles-module_item_list__FxHkg","has_children":"styles-module_has_children__Uu-8D","action":"styles-module_action__YYTok","default":"styles-module_default__SexGH","red":"styles-module_red__KD3qJ","item":"styles-module_item__sgyiV","selected":"styles-module_selected__iOu39","icon":"styles-module_icon__Jy87z","moreText":"styles-module_moreText__-blXb","subtitle":"styles-module_subtitle__DT5OF"};
|
621
621
|
styleInject(css_248z$3);
|
622
622
|
|
623
|
-
|
624
|
-
(function (TableActionType) {
|
625
|
-
TableActionType[TableActionType["red"] = 0] = "red";
|
626
|
-
TableActionType[TableActionType["default"] = 1] = "default";
|
627
|
-
})(exports.TableActionType || (exports.TableActionType = {}));
|
628
|
-
class TableItem {
|
629
|
-
title;
|
630
|
-
subtitle;
|
631
|
-
moreText;
|
632
|
-
iconName;
|
633
|
-
data;
|
634
|
-
constructor(title, subtitle, moreText, iconName, data) {
|
635
|
-
this.title = title;
|
636
|
-
this.subtitle = subtitle;
|
637
|
-
this.moreText = moreText;
|
638
|
-
this.iconName = iconName;
|
639
|
-
this.data = data;
|
640
|
-
}
|
641
|
-
}
|
642
|
-
class TableItemAction {
|
643
|
-
title;
|
644
|
-
iconName;
|
645
|
-
onClick;
|
646
|
-
type = exports.TableActionType.default;
|
647
|
-
constructor(title, iconName, type, onClick = () => { }) {
|
648
|
-
this.title = title;
|
649
|
-
this.iconName = iconName;
|
650
|
-
this.onClick = onClick;
|
651
|
-
this.type = type;
|
652
|
-
}
|
653
|
-
}
|
654
|
-
function Table({ items, title = "Titel", actions = [], moreActions, marginTop = 30 }) {
|
623
|
+
function Table({ items, title = "Titel", actions = [], moreActions, selected, marginTop = 30 }) {
|
655
624
|
return (React__default["default"].createElement("div", { className: styles$3.container, style: { marginTop: marginTop } },
|
656
625
|
React__default["default"].createElement("h3", null, title),
|
657
|
-
React__default["default"].createElement("ul", { className: `${styles$3.item_list} ${items.length > 0 ? styles$3.has_children : styles$3.no_children}` }, items.map((item, index) => React__default["default"].createElement("li", { key: index, className: styles$3.item },
|
626
|
+
React__default["default"].createElement("ul", { className: `${styles$3.item_list} ${items.length > 0 ? styles$3.has_children : styles$3.no_children}` }, items.map((item, index) => React__default["default"].createElement("li", { key: index, className: [styles$3.item, selected == index ? styles$3.selected : styles$3.not_selected].join(" ") },
|
658
627
|
React__default["default"].createElement("div", { className: styles$3.icon },
|
659
628
|
React__default["default"].createElement(SvgIcon, { iconName: item.iconName })),
|
660
629
|
React__default["default"].createElement("div", { className: styles$3.title }, item.title),
|
@@ -664,8 +633,8 @@ function Table({ items, title = "Titel", actions = [], moreActions, marginTop =
|
|
664
633
|
moreActions.map((moreAction, index) => React__default["default"].createElement("div", { className: styles$3.more_action, key: item.title + index }, moreAction(item.data, index))),
|
665
634
|
actions.length > 0 && actions.map((action, idx) => React__default["default"].createElement("div", { key: idx, className: [
|
666
635
|
styles$3.action,
|
667
|
-
action.type
|
668
|
-
action.type
|
636
|
+
action.type === "red" && styles$3.red,
|
637
|
+
action.type === "default" && styles$3.default,
|
669
638
|
].join(" "), onClick: (event) => action.onClick(event, item, index) },
|
670
639
|
React__default["default"].createElement(SvgIcon, { iconName: action.iconName }),
|
671
640
|
action.title)))))));
|
@@ -1056,7 +1025,7 @@ exports.CourseAnnouncementAssetType = void 0;
|
|
1056
1025
|
(function (CourseAnnouncementAssetType) {
|
1057
1026
|
CourseAnnouncementAssetType["file"] = "file";
|
1058
1027
|
CourseAnnouncementAssetType["calculator"] = "calculator";
|
1059
|
-
CourseAnnouncementAssetType["
|
1028
|
+
CourseAnnouncementAssetType["movie"] = "movie";
|
1060
1029
|
CourseAnnouncementAssetType["material"] = "material";
|
1061
1030
|
CourseAnnouncementAssetType["ebook"] = "ebook";
|
1062
1031
|
CourseAnnouncementAssetType["test"] = "test";
|
@@ -1114,8 +1083,6 @@ exports.SliderCard = SliderCard;
|
|
1114
1083
|
exports.StepBack = StepBack;
|
1115
1084
|
exports.SvgIcon = SvgIcon;
|
1116
1085
|
exports.Table = Table;
|
1117
|
-
exports.TableItem = TableItem;
|
1118
|
-
exports.TableItemAction = TableItemAction;
|
1119
1086
|
exports.Tabs = Tabs;
|
1120
1087
|
exports.TextWithIcon = TextWithIcon;
|
1121
1088
|
exports.UsageCard = UsageCard;
|
package/dist/index.esm.js
CHANGED
@@ -608,45 +608,14 @@ function StepBack({ iconName = "arrow_back", text = "Weitere Möglichkeiten" })
|
|
608
608
|
text)));
|
609
609
|
}
|
610
610
|
|
611
|
-
var css_248z$3 = ".styles-module_container__jNs7m h3 {\n font-weight: 500;\n font-size: 16px;\n color: var(--foreground-1);\n}\n\n.styles-module_item_list__FxHkg.styles-module_has_children__Uu-8D {\n border-top: 1px solid var(--border-1);\n border-bottom: 1px solid var(--border-1);\n}\n\n.styles-module_item_list__FxHkg {\n list-style: none;\n padding: 0;\n margin: 0;\n}\n.styles-module_item_list__FxHkg .styles-module_action__YYTok {\n display: flex;\n flex-direction: row;\n align-items: center;\n gap: 6px;\n cursor: pointer;\n padding: 8px 14px;\n border-radius: 25px;\n transition: 0.2s ease-in-out;\n}\n.styles-module_item_list__FxHkg .styles-module_action__YYTok.styles-module_default__SexGH:hover {\n background: var(--background-2);\n}\n.styles-module_item_list__FxHkg .styles-module_action__YYTok.styles-module_red__KD3qJ:hover {\n background: var(--red-2);\n}\n.styles-module_item_list__FxHkg li.styles-module_item__sgyiV {\n padding: 10px 20px;\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: center;\n gap: 10px;\n color: var(--foreground-1);\n}\n.styles-module_item_list__FxHkg li.styles-module_item__sgyiV .styles-module_moreText__-blXb {\n flex: 1;\n margin-bottom: 4px;\n color: var(--primary-1);\n}\n.styles-module_item_list__FxHkg li.styles-module_item__sgyiV .styles-module_subtitle__DT5OF {\n color: var(--foreground-3);\n}\n.styles-module_item_list__FxHkg li.styles-module_item__sgyiV .styles-module_icon__Jy87z {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n color: var(--foreground-1);\n}\n.styles-module_item_list__FxHkg li.styles-module_item__sgyiV:nth-child(even) {\n background: var(--background-2);\n}\n.styles-module_item_list__FxHkg li.styles-module_item__sgyiV:not(:last-child) {\n border-bottom: 1px solid var(--border-1);\n}";
|
612
|
-
var styles$3 = {"container":"styles-module_container__jNs7m","item_list":"styles-module_item_list__FxHkg","has_children":"styles-module_has_children__Uu-8D","action":"styles-module_action__YYTok","default":"styles-module_default__SexGH","red":"styles-module_red__KD3qJ","item":"styles-module_item__sgyiV","
|
611
|
+
var css_248z$3 = ".styles-module_container__jNs7m h3 {\n font-weight: 500;\n font-size: 16px;\n color: var(--foreground-1);\n}\n\n.styles-module_item_list__FxHkg.styles-module_has_children__Uu-8D {\n border-top: 1px solid var(--border-1);\n border-bottom: 1px solid var(--border-1);\n}\n\n.styles-module_item_list__FxHkg {\n list-style: none;\n padding: 0;\n margin: 0;\n}\n.styles-module_item_list__FxHkg .styles-module_action__YYTok {\n display: flex;\n flex-direction: row;\n align-items: center;\n gap: 6px;\n cursor: pointer;\n padding: 8px 14px;\n border-radius: 25px;\n transition: 0.2s ease-in-out;\n}\n.styles-module_item_list__FxHkg .styles-module_action__YYTok.styles-module_default__SexGH:hover {\n background: var(--background-2);\n}\n.styles-module_item_list__FxHkg .styles-module_action__YYTok.styles-module_red__KD3qJ:hover {\n background: var(--red-2);\n}\n.styles-module_item_list__FxHkg li.styles-module_item__sgyiV.styles-module_selected__iOu39 {\n color: var(--primary-1) !important;\n border-color: var(--primary-1);\n}\n.styles-module_item_list__FxHkg li.styles-module_item__sgyiV.styles-module_selected__iOu39 .styles-module_icon__Jy87z {\n color: var(--primary-1) !important;\n}\n.styles-module_item_list__FxHkg li.styles-module_item__sgyiV {\n padding: 10px 20px;\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: center;\n gap: 10px;\n color: var(--foreground-1);\n}\n.styles-module_item_list__FxHkg li.styles-module_item__sgyiV .styles-module_moreText__-blXb {\n flex: 1;\n margin-bottom: 4px;\n color: var(--primary-1);\n}\n.styles-module_item_list__FxHkg li.styles-module_item__sgyiV .styles-module_subtitle__DT5OF {\n color: var(--foreground-3);\n}\n.styles-module_item_list__FxHkg li.styles-module_item__sgyiV .styles-module_icon__Jy87z {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n color: var(--foreground-1);\n}\n.styles-module_item_list__FxHkg li.styles-module_item__sgyiV:nth-child(even) {\n background: var(--background-2);\n}\n.styles-module_item_list__FxHkg li.styles-module_item__sgyiV:not(:last-child) {\n border-bottom: 1px solid var(--border-1);\n}";
|
612
|
+
var styles$3 = {"container":"styles-module_container__jNs7m","item_list":"styles-module_item_list__FxHkg","has_children":"styles-module_has_children__Uu-8D","action":"styles-module_action__YYTok","default":"styles-module_default__SexGH","red":"styles-module_red__KD3qJ","item":"styles-module_item__sgyiV","selected":"styles-module_selected__iOu39","icon":"styles-module_icon__Jy87z","moreText":"styles-module_moreText__-blXb","subtitle":"styles-module_subtitle__DT5OF"};
|
613
613
|
styleInject(css_248z$3);
|
614
614
|
|
615
|
-
|
616
|
-
(function (TableActionType) {
|
617
|
-
TableActionType[TableActionType["red"] = 0] = "red";
|
618
|
-
TableActionType[TableActionType["default"] = 1] = "default";
|
619
|
-
})(TableActionType || (TableActionType = {}));
|
620
|
-
class TableItem {
|
621
|
-
title;
|
622
|
-
subtitle;
|
623
|
-
moreText;
|
624
|
-
iconName;
|
625
|
-
data;
|
626
|
-
constructor(title, subtitle, moreText, iconName, data) {
|
627
|
-
this.title = title;
|
628
|
-
this.subtitle = subtitle;
|
629
|
-
this.moreText = moreText;
|
630
|
-
this.iconName = iconName;
|
631
|
-
this.data = data;
|
632
|
-
}
|
633
|
-
}
|
634
|
-
class TableItemAction {
|
635
|
-
title;
|
636
|
-
iconName;
|
637
|
-
onClick;
|
638
|
-
type = TableActionType.default;
|
639
|
-
constructor(title, iconName, type, onClick = () => { }) {
|
640
|
-
this.title = title;
|
641
|
-
this.iconName = iconName;
|
642
|
-
this.onClick = onClick;
|
643
|
-
this.type = type;
|
644
|
-
}
|
645
|
-
}
|
646
|
-
function Table({ items, title = "Titel", actions = [], moreActions, marginTop = 30 }) {
|
615
|
+
function Table({ items, title = "Titel", actions = [], moreActions, selected, marginTop = 30 }) {
|
647
616
|
return (React.createElement("div", { className: styles$3.container, style: { marginTop: marginTop } },
|
648
617
|
React.createElement("h3", null, title),
|
649
|
-
React.createElement("ul", { className: `${styles$3.item_list} ${items.length > 0 ? styles$3.has_children : styles$3.no_children}` }, items.map((item, index) => React.createElement("li", { key: index, className: styles$3.item },
|
618
|
+
React.createElement("ul", { className: `${styles$3.item_list} ${items.length > 0 ? styles$3.has_children : styles$3.no_children}` }, items.map((item, index) => React.createElement("li", { key: index, className: [styles$3.item, selected == index ? styles$3.selected : styles$3.not_selected].join(" ") },
|
650
619
|
React.createElement("div", { className: styles$3.icon },
|
651
620
|
React.createElement(SvgIcon, { iconName: item.iconName })),
|
652
621
|
React.createElement("div", { className: styles$3.title }, item.title),
|
@@ -656,8 +625,8 @@ function Table({ items, title = "Titel", actions = [], moreActions, marginTop =
|
|
656
625
|
moreActions.map((moreAction, index) => React.createElement("div", { className: styles$3.more_action, key: item.title + index }, moreAction(item.data, index))),
|
657
626
|
actions.length > 0 && actions.map((action, idx) => React.createElement("div", { key: idx, className: [
|
658
627
|
styles$3.action,
|
659
|
-
action.type
|
660
|
-
action.type
|
628
|
+
action.type === "red" && styles$3.red,
|
629
|
+
action.type === "default" && styles$3.default,
|
661
630
|
].join(" "), onClick: (event) => action.onClick(event, item, index) },
|
662
631
|
React.createElement(SvgIcon, { iconName: action.iconName }),
|
663
632
|
action.title)))))));
|
@@ -1048,7 +1017,7 @@ var CourseAnnouncementAssetType;
|
|
1048
1017
|
(function (CourseAnnouncementAssetType) {
|
1049
1018
|
CourseAnnouncementAssetType["file"] = "file";
|
1050
1019
|
CourseAnnouncementAssetType["calculator"] = "calculator";
|
1051
|
-
CourseAnnouncementAssetType["
|
1020
|
+
CourseAnnouncementAssetType["movie"] = "movie";
|
1052
1021
|
CourseAnnouncementAssetType["material"] = "material";
|
1053
1022
|
CourseAnnouncementAssetType["ebook"] = "ebook";
|
1054
1023
|
CourseAnnouncementAssetType["test"] = "test";
|
@@ -1072,4 +1041,4 @@ var ManagerPermission;
|
|
1072
1041
|
ManagerPermission["file"] = "file";
|
1073
1042
|
})(ManagerPermission || (ManagerPermission = {}));
|
1074
1043
|
|
1075
|
-
export { Accordeon, AuthButton, CardButton, Checkbox, ChooseRole, ChooseRoleItem, CopyCode, CourseAnnouncementAssetType, Dialog, FormButton, FormText, ForwardButton, Gap, InputArea, InputMail, InputNames, InputNumber, InputPassword, InputPin, InputText, ManagerPermission, OptionField, OptionFieldHorizontal, PrimaryButton, ProgressBar, RadioButtons, RadioOption, RedirectButton, S3FileCategory, SearchChip, SearchChips, Searchbar, Slider, SliderCard, StepBack, SvgIcon, Table,
|
1044
|
+
export { Accordeon, AuthButton, CardButton, Checkbox, ChooseRole, ChooseRoleItem, CopyCode, CourseAnnouncementAssetType, Dialog, FormButton, FormText, ForwardButton, Gap, InputArea, InputMail, InputNames, InputNumber, InputPassword, InputPin, InputText, ManagerPermission, OptionField, OptionFieldHorizontal, PrimaryButton, ProgressBar, RadioButtons, RadioOption, RedirectButton, S3FileCategory, SearchChip, SearchChips, Searchbar, Slider, SliderCard, StepBack, SvgIcon, Table, Tabs, TextWithIcon, UsageCard };
|