@helpwave/hightide 0.0.9 → 0.0.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/coloring/shading.d.ts +2 -0
- package/dist/coloring/shading.js +40 -0
- package/dist/coloring/types.d.ts +11 -0
- package/dist/coloring/types.js +1 -0
- package/dist/components/Avatar.d.ts +14 -0
- package/dist/components/Avatar.js +35 -0
- package/dist/components/AvatarGroup.d.ts +10 -0
- package/dist/components/AvatarGroup.js +13 -0
- package/dist/components/BreadCrumb.d.ts +16 -0
- package/dist/components/BreadCrumb.js +12 -0
- package/dist/components/Button.d.ts +41 -0
- package/dist/components/Button.js +84 -0
- package/dist/components/ChipList.d.ts +21 -0
- package/dist/components/ChipList.js +38 -0
- package/dist/components/Circle.d.ts +6 -0
- package/dist/components/Circle.js +10 -0
- package/dist/components/ErrorComponent.d.ts +13 -0
- package/dist/components/ErrorComponent.js +19 -0
- package/dist/components/Expandable.d.ts +30 -0
- package/dist/components/Expandable.js +16 -0
- package/dist/components/HelpwaveBadge.d.ts +11 -0
- package/dist/components/HelpwaveBadge.js +14 -0
- package/dist/components/HideableContentSection.d.ts +10 -0
- package/dist/components/HideableContentSection.js +15 -0
- package/dist/components/InputGroup.d.ts +13 -0
- package/dist/components/InputGroup.js +33 -0
- package/dist/components/LoadingAndErrorComponent.d.ts +17 -0
- package/dist/components/LoadingAndErrorComponent.js +25 -0
- package/dist/components/LoadingAnimation.d.ts +13 -0
- package/dist/components/LoadingAnimation.js +19 -0
- package/dist/components/LoadingButton.d.ts +6 -0
- package/dist/components/LoadingButton.js +10 -0
- package/dist/components/MarkdownInterpreter.d.ts +25 -0
- package/dist/components/MarkdownInterpreter.js +190 -0
- package/dist/components/Pagination.d.ts +14 -0
- package/dist/components/Pagination.js +25 -0
- package/dist/components/Profile.d.ts +28 -0
- package/dist/components/Profile.js +45 -0
- package/dist/components/ProgressIndicator.d.ts +21 -0
- package/dist/components/ProgressIndicator.js +24 -0
- package/dist/components/Ring.d.ts +31 -0
- package/dist/components/Ring.js +113 -0
- package/dist/components/SearchableList.d.ts +18 -0
- package/dist/components/SearchableList.js +27 -0
- package/dist/components/SortButton.d.ts +10 -0
- package/dist/components/SortButton.js +9 -0
- package/dist/components/Span.js +1 -0
- package/dist/components/StepperBar.d.ts +23 -0
- package/dist/components/StepperBar.js +47 -0
- package/dist/components/Table.d.ts +87 -0
- package/dist/components/Table.js +187 -0
- package/dist/components/TechRadar.d.ts +36 -0
- package/dist/components/TechRadar.js +191 -0
- package/dist/components/TextImage.d.ts +20 -0
- package/dist/components/TextImage.js +31 -0
- package/dist/components/TimeDisplay.d.ts +30 -0
- package/dist/components/TimeDisplay.js +83 -0
- package/dist/components/Tooltip.d.ts +34 -0
- package/dist/components/Tooltip.js +38 -0
- package/dist/components/VerticalDivider.d.ts +11 -0
- package/dist/components/VerticalDivider.js +7 -0
- package/dist/components/date/DatePicker.d.ts +26 -0
- package/dist/components/date/DatePicker.js +58 -0
- package/dist/components/date/DayPicker.d.ts +16 -0
- package/dist/components/date/DayPicker.js +37 -0
- package/dist/components/date/TimePicker.d.ts +12 -0
- package/dist/components/date/TimePicker.js +79 -0
- package/dist/components/date/YearMonthPicker.d.ts +11 -0
- package/dist/components/date/YearMonthPicker.js +59 -0
- package/dist/components/examples/InputGroupExample.d.ts +6 -0
- package/dist/components/examples/InputGroupExample.js +21 -0
- package/dist/components/examples/MultiSelectExample.d.ts +7 -0
- package/dist/components/examples/MultiSelectExample.js +27 -0
- package/dist/components/examples/SearchableSelectExample.d.ts +6 -0
- package/dist/components/examples/SearchableSelectExample.js +17 -0
- package/dist/components/examples/SelectExample.d.ts +4 -0
- package/dist/components/examples/SelectExample.js +15 -0
- package/dist/components/examples/StackingModals.d.ts +4 -0
- package/dist/components/examples/StackingModals.js +15 -0
- package/dist/components/examples/TableExample.d.ts +9 -0
- package/dist/components/examples/TableExample.js +92 -0
- package/dist/components/examples/TextareaExample.d.ts +6 -0
- package/dist/components/examples/TextareaExample.js +10 -0
- package/dist/components/examples/TileExample.d.ts +9 -0
- package/dist/components/examples/TileExample.js +9 -0
- package/dist/components/examples/Title.js +1 -0
- package/dist/components/examples/date/DateTimePickerExample.d.ts +10 -0
- package/dist/components/examples/date/DateTimePickerExample.js +21 -0
- package/dist/components/examples/properties/CheckboxPropertyExample.d.ts +8 -0
- package/dist/components/examples/properties/CheckboxPropertyExample.js +13 -0
- package/dist/components/examples/properties/DatePropertyExample.d.ts +8 -0
- package/dist/components/examples/properties/DatePropertyExample.js +23 -0
- package/dist/components/examples/properties/MultiSelectPropertyExample.d.ts +8 -0
- package/dist/components/examples/properties/MultiSelectPropertyExample.js +16 -0
- package/dist/components/examples/properties/NumberPropertyExample.d.ts +6 -0
- package/dist/components/examples/properties/NumberPropertyExample.js +13 -0
- package/dist/components/examples/properties/SelectPropertyExample.d.ts +6 -0
- package/dist/components/examples/properties/SelectPropertyExample.js +18 -0
- package/dist/components/examples/properties/TextPropertyExample.d.ts +8 -0
- package/dist/components/examples/properties/TextPropertyExample.js +13 -0
- package/dist/components/icons/Helpwave.d.ts +10 -0
- package/dist/components/icons/Helpwave.js +20 -0
- package/dist/components/icons/Tag.d.ts +10 -0
- package/dist/components/icons/Tag.js +12 -0
- package/dist/components/layout/Carousel.d.ts +22 -0
- package/dist/components/layout/Carousel.js +233 -0
- package/dist/components/layout/DividerInserter.d.ts +11 -0
- package/dist/components/layout/DividerInserter.js +20 -0
- package/dist/components/layout/FAQSection.d.ts +23 -0
- package/dist/components/layout/FAQSection.js +14 -0
- package/dist/components/layout/Tile.d.ts +34 -0
- package/dist/components/layout/Tile.js +18 -0
- package/dist/components/modals/ConfirmDialog.d.ts +34 -0
- package/dist/components/modals/ConfirmDialog.js +31 -0
- package/dist/components/modals/DiscardChangesDialog.d.ts +19 -0
- package/dist/components/modals/DiscardChangesDialog.js +24 -0
- package/dist/components/modals/InputModal.d.ts +9 -0
- package/dist/components/modals/InputModal.js +9 -0
- package/dist/components/modals/LanguageModal.d.ts +17 -0
- package/dist/components/modals/LanguageModal.js +35 -0
- package/dist/components/modals/Modal.d.ts +38 -0
- package/dist/components/modals/Modal.js +57 -0
- package/dist/components/modals/ModalRegister.d.ts +11 -0
- package/dist/components/modals/ModalRegister.js +28 -0
- package/dist/components/properties/CheckboxProperty.d.ts +15 -0
- package/dist/components/properties/CheckboxProperty.js +27 -0
- package/dist/components/properties/DateProperty.d.ts +11 -0
- package/dist/components/properties/DateProperty.js +22 -0
- package/dist/components/properties/MultiSelectProperty.d.ts +12 -0
- package/dist/components/properties/MultiSelectProperty.js +33 -0
- package/dist/components/properties/NumberProperty.d.ts +16 -0
- package/dist/components/properties/NumberProperty.js +42 -0
- package/dist/components/properties/PropertyBase.d.ts +23 -0
- package/dist/components/properties/PropertyBase.js +27 -0
- package/dist/components/properties/SelectProperty.d.ts +12 -0
- package/dist/components/properties/SelectProperty.js +22 -0
- package/dist/components/properties/TextProperty.d.ts +15 -0
- package/dist/components/properties/TextProperty.js +37 -0
- package/dist/components/user-input/Checkbox.d.ts +37 -0
- package/dist/components/user-input/Checkbox.js +63 -0
- package/dist/components/user-input/DateAndTimePicker.d.ts +39 -0
- package/dist/components/user-input/DateAndTimePicker.js +65 -0
- package/dist/components/user-input/Input.d.ts +61 -0
- package/dist/components/user-input/Input.js +61 -0
- package/dist/components/user-input/Label.d.ts +12 -0
- package/dist/components/user-input/Label.js +12 -0
- package/dist/components/user-input/Menu.d.ts +21 -0
- package/dist/components/user-input/Menu.js +26 -0
- package/dist/components/user-input/MultiSelect.d.ts +39 -0
- package/dist/components/user-input/MultiSelect.js +57 -0
- package/dist/components/user-input/ScrollPicker.d.ts +11 -0
- package/dist/components/user-input/ScrollPicker.js +151 -0
- package/dist/components/user-input/SearchableSelect.d.ts +8 -0
- package/dist/components/user-input/SearchableSelect.js +14 -0
- package/dist/components/user-input/Select.d.ts +32 -0
- package/dist/components/user-input/Select.js +48 -0
- package/dist/components/user-input/Textarea.d.ts +20 -0
- package/dist/components/user-input/Textarea.js +33 -0
- package/dist/components/user-input/ToggleableInput.d.ts +32 -0
- package/dist/components/user-input/ToggleableInput.js +40 -0
- package/dist/css/globals.css +2450 -0
- package/dist/hooks/useHoverState.d.ts +40 -0
- package/dist/hooks/useHoverState.js +46 -0
- package/dist/hooks/useLanguage.d.ts +17 -0
- package/dist/hooks/useLanguage.js +51 -0
- package/dist/hooks/useLocalStorage.d.ts +4 -0
- package/dist/hooks/useLocalStorage.js +24 -0
- package/dist/hooks/useOutsideClick.d.ts +2 -0
- package/dist/hooks/useOutsideClick.js +22 -0
- package/dist/hooks/useSaveDelay.d.ts +5 -0
- package/dist/hooks/useSaveDelay.js +41 -0
- package/dist/hooks/useTheme.d.ts +16 -0
- package/dist/hooks/useTheme.js +32 -0
- package/dist/hooks/useTranslation.d.ts +24 -0
- package/dist/hooks/useTranslation.js +11 -0
- package/dist/util/array.d.ts +23 -0
- package/dist/util/array.js +103 -0
- package/{util/builder.ts → dist/util/builder.d.ts} +1 -4
- package/dist/util/builder.js +9 -0
- package/dist/util/date.d.ts +28 -0
- package/dist/util/date.js +133 -0
- package/dist/util/easeFunctions.d.ts +9 -0
- package/dist/util/easeFunctions.js +30 -0
- package/dist/util/emailValidation.d.ts +1 -0
- package/dist/util/emailValidation.js +3 -0
- package/dist/util/loopingArray.d.ts +23 -0
- package/dist/util/loopingArray.js +67 -0
- package/dist/util/math.d.ts +1 -0
- package/dist/util/math.js +3 -0
- package/dist/util/news.d.ts +98 -0
- package/dist/util/news.js +27 -0
- package/dist/util/noop.d.ts +1 -0
- package/dist/util/noop.js +1 -0
- package/{util/simpleSearch.ts → dist/util/simpleSearch.d.ts} +4 -21
- package/dist/util/simpleSearch.js +62 -0
- package/dist/util/storage.d.ts +15 -0
- package/dist/util/storage.js +32 -0
- package/dist/util/types.d.ts +1 -0
- package/dist/util/types.js +1 -0
- package/package.json +7 -8
- package/coloring/shading.ts +0 -46
- package/coloring/types.ts +0 -13
- package/components/Avatar.tsx +0 -58
- package/components/AvatarGroup.tsx +0 -48
- package/components/BreadCrumb.tsx +0 -35
- package/components/Button.tsx +0 -236
- package/components/ChipList.tsx +0 -89
- package/components/Circle.tsx +0 -27
- package/components/ErrorComponent.tsx +0 -40
- package/components/Expandable.tsx +0 -61
- package/components/HelpwaveBadge.tsx +0 -35
- package/components/HideableContentSection.tsx +0 -43
- package/components/InputGroup.tsx +0 -72
- package/components/LoadingAndErrorComponent.tsx +0 -47
- package/components/LoadingAnimation.tsx +0 -40
- package/components/LoadingButton.tsx +0 -27
- package/components/MarkdownInterpreter.tsx +0 -278
- package/components/Pagination.tsx +0 -65
- package/components/Profile.tsx +0 -124
- package/components/ProgressIndicator.tsx +0 -58
- package/components/Ring.tsx +0 -286
- package/components/SearchableList.tsx +0 -69
- package/components/SortButton.tsx +0 -33
- package/components/StepperBar.tsx +0 -124
- package/components/Table.tsx +0 -330
- package/components/TechRadar.tsx +0 -247
- package/components/TextImage.tsx +0 -86
- package/components/TimeDisplay.tsx +0 -121
- package/components/Tooltip.tsx +0 -92
- package/components/VerticalDivider.tsx +0 -51
- package/components/date/DatePicker.tsx +0 -164
- package/components/date/DayPicker.tsx +0 -95
- package/components/date/TimePicker.tsx +0 -167
- package/components/date/YearMonthPicker.tsx +0 -130
- package/components/examples/InputGroupExample.tsx +0 -58
- package/components/examples/MultiSelectExample.tsx +0 -57
- package/components/examples/SearchableSelectExample.tsx +0 -34
- package/components/examples/SelectExample.tsx +0 -28
- package/components/examples/StackingModals.tsx +0 -54
- package/components/examples/TableExample.tsx +0 -159
- package/components/examples/TextareaExample.tsx +0 -23
- package/components/examples/TileExample.tsx +0 -25
- package/components/examples/date/DateTimePickerExample.tsx +0 -53
- package/components/examples/properties/CheckboxPropertyExample.tsx +0 -29
- package/components/examples/properties/DatePropertyExample.tsx +0 -44
- package/components/examples/properties/MultiSelectPropertyExample.tsx +0 -39
- package/components/examples/properties/NumberPropertyExample.tsx +0 -28
- package/components/examples/properties/SelectPropertyExample.tsx +0 -39
- package/components/examples/properties/TextPropertyExample.tsx +0 -30
- package/components/icons/Helpwave.tsx +0 -51
- package/components/icons/Tag.tsx +0 -29
- package/components/layout/Carousel.tsx +0 -396
- package/components/layout/DividerInserter.tsx +0 -37
- package/components/layout/FAQSection.tsx +0 -57
- package/components/layout/Tile.tsx +0 -67
- package/components/modals/ConfirmDialog.tsx +0 -105
- package/components/modals/DiscardChangesDialog.tsx +0 -71
- package/components/modals/InputModal.tsx +0 -26
- package/components/modals/LanguageModal.tsx +0 -76
- package/components/modals/Modal.tsx +0 -149
- package/components/modals/ModalRegister.tsx +0 -45
- package/components/properties/CheckboxProperty.tsx +0 -62
- package/components/properties/DateProperty.tsx +0 -58
- package/components/properties/MultiSelectProperty.tsx +0 -82
- package/components/properties/NumberProperty.tsx +0 -86
- package/components/properties/PropertyBase.tsx +0 -84
- package/components/properties/SelectProperty.tsx +0 -67
- package/components/properties/TextProperty.tsx +0 -81
- package/components/user-input/Checkbox.tsx +0 -139
- package/components/user-input/DateAndTimePicker.tsx +0 -156
- package/components/user-input/Input.tsx +0 -192
- package/components/user-input/Label.tsx +0 -32
- package/components/user-input/Menu.tsx +0 -75
- package/components/user-input/MultiSelect.tsx +0 -158
- package/components/user-input/ScrollPicker.tsx +0 -240
- package/components/user-input/SearchableSelect.tsx +0 -36
- package/components/user-input/Select.tsx +0 -132
- package/components/user-input/Textarea.tsx +0 -86
- package/components/user-input/ToggleableInput.tsx +0 -115
- package/globals.css +0 -488
- package/hooks/useHoverState.ts +0 -88
- package/hooks/useLanguage.tsx +0 -78
- package/hooks/useLocalStorage.tsx +0 -33
- package/hooks/useOutsideClick.ts +0 -25
- package/hooks/useSaveDelay.ts +0 -46
- package/hooks/useTheme.tsx +0 -57
- package/hooks/useTranslation.ts +0 -43
- package/index.ts +0 -0
- package/util/array.ts +0 -115
- package/util/date.ts +0 -180
- package/util/easeFunctions.ts +0 -37
- package/util/emailValidation.ts +0 -3
- package/util/loopingArray.ts +0 -94
- package/util/math.ts +0 -3
- package/util/news.ts +0 -43
- package/util/noop.ts +0 -1
- package/util/storage.ts +0 -37
- package/util/types.ts +0 -4
- /package/{components/Span.tsx → dist/components/Span.d.ts} +0 -0
- /package/{components/examples/Title.tsx → dist/components/examples/Title.d.ts} +0 -0
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { TableProps } from '../Table';
|
|
2
|
+
export type DataType = {
|
|
3
|
+
id: string;
|
|
4
|
+
name: string;
|
|
5
|
+
age: number;
|
|
6
|
+
};
|
|
7
|
+
export declare const exampleData: DataType[];
|
|
8
|
+
declare const TableExample: ({ data: initialData }: Pick<TableProps<DataType>, "data">) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export default TableExample;
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useState } from 'react';
|
|
3
|
+
import { addElementToTable, defaultTableStatePagination, defaultTableStateSelection, removeFromTableSelection, Table } from '../Table';
|
|
4
|
+
import { Input } from '../user-input/Input';
|
|
5
|
+
import { SolidButton, TextButton } from '../Button';
|
|
6
|
+
import { SortButton } from '../SortButton';
|
|
7
|
+
export const exampleData = [
|
|
8
|
+
{ id: 'data1', name: 'Name 1', age: 23 },
|
|
9
|
+
{ id: 'data2', name: 'Name 2', age: 21 },
|
|
10
|
+
{ id: 'data3', name: 'Name 3', age: 32 },
|
|
11
|
+
{ id: 'data4', name: 'Name 4', age: 42 },
|
|
12
|
+
{ id: 'data5', name: 'Name 5', age: 17 },
|
|
13
|
+
{ id: 'data6', name: 'Name 6', age: 26 },
|
|
14
|
+
{ id: 'data7', name: 'Name 7', age: 19 },
|
|
15
|
+
{ id: 'data8', name: 'Name 8', age: 31 }
|
|
16
|
+
];
|
|
17
|
+
const TableExample = ({ data: initialData }) => {
|
|
18
|
+
const [data, setData] = useState(initialData);
|
|
19
|
+
const [tableState, setTableState] = useState({
|
|
20
|
+
pagination: defaultTableStatePagination,
|
|
21
|
+
selection: defaultTableStateSelection
|
|
22
|
+
});
|
|
23
|
+
useEffect(() => {
|
|
24
|
+
setData(initialData);
|
|
25
|
+
}, [initialData]);
|
|
26
|
+
const [sorting, setSorting] = useState();
|
|
27
|
+
const [sortingKey, ascending] = sorting !== null && sorting !== void 0 ? sorting : ['', 'ascending'];
|
|
28
|
+
const idMapping = (data) => data.id;
|
|
29
|
+
const sortingFunctions = {
|
|
30
|
+
id: {
|
|
31
|
+
ascending: (t1, t2) => t1.id.localeCompare(t2.id),
|
|
32
|
+
descending: (t1, t2) => t1.id.localeCompare(t2.id) * -1,
|
|
33
|
+
},
|
|
34
|
+
name: {
|
|
35
|
+
ascending: (t1, t2) => t1.name.localeCompare(t2.name),
|
|
36
|
+
descending: (t1, t2) => t1.name.localeCompare(t2.name) * -1,
|
|
37
|
+
},
|
|
38
|
+
age: {
|
|
39
|
+
ascending: (t1, t2) => t1.age - t2.age,
|
|
40
|
+
descending: (t1, t2) => (t1.age - t2.age) * -1,
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
return (_jsxs("div", { className: "col gap-y-12 items-center", children: [_jsx(Table, { stateManagement: [tableState, (newTableState) => {
|
|
44
|
+
setTableState(newTableState);
|
|
45
|
+
setData(data);
|
|
46
|
+
}], data: data, identifierMapping: idMapping, rowMappingToCells: dataObject => [
|
|
47
|
+
_jsx("span", { className: "textstyle-title-md w-[100px] text-ellipsis overflow-hidden block", children: dataObject.id }, "id"),
|
|
48
|
+
_jsx(Input, { value: dataObject.name, onChange: text => {
|
|
49
|
+
setData(data.map(value => value.id === dataObject.id ? { ...dataObject, name: text } : value));
|
|
50
|
+
setSorting(undefined);
|
|
51
|
+
} }, "name"),
|
|
52
|
+
_jsx(Input, { type: "number", value: dataObject.age.toString(), onChange: text => {
|
|
53
|
+
setData(data.map(value => value.id === dataObject.id ? { ...dataObject, age: parseInt(text) } : value));
|
|
54
|
+
setSorting(undefined);
|
|
55
|
+
} }, "age"),
|
|
56
|
+
_jsx(TextButton, { color: "negative", onClick: () => {
|
|
57
|
+
const newData = data.filter(value => value.id !== dataObject.id);
|
|
58
|
+
setData(newData);
|
|
59
|
+
setTableState(removeFromTableSelection(tableState, [dataObject], data.length, idMapping));
|
|
60
|
+
}, children: "Delete" }, "delete")
|
|
61
|
+
], header: [
|
|
62
|
+
_jsx(SortButton, { ascending: sortingKey === 'id' ? ascending : undefined, onClick: newTableSorting => {
|
|
63
|
+
setSorting(['id', newTableSorting]);
|
|
64
|
+
setData(data.sort(sortingFunctions.id[newTableSorting]));
|
|
65
|
+
}, children: _jsx("span", { className: "textstyle-table-header", children: "Id" }) }, "headerId"),
|
|
66
|
+
_jsx(SortButton, { ascending: sortingKey === 'name' ? ascending : undefined, onClick: newTableSorting => {
|
|
67
|
+
setSorting(['name', newTableSorting]);
|
|
68
|
+
setData(data.sort(sortingFunctions.name[newTableSorting]));
|
|
69
|
+
}, children: _jsx("span", { className: "textstyle-table-header", children: "Name" }) }, "name"),
|
|
70
|
+
_jsx(SortButton, { ascending: sortingKey === 'age' ? ascending : undefined, onClick: newTableSorting => {
|
|
71
|
+
setSorting(['age', newTableSorting]);
|
|
72
|
+
setData(data.sort(sortingFunctions.age[newTableSorting]));
|
|
73
|
+
}, children: _jsx("span", { className: "textstyle-table-header", children: "age" }, "age") }, "name"),
|
|
74
|
+
_jsx(_Fragment, {})
|
|
75
|
+
] }), _jsxs("div", { className: "row gap-x-2", children: [_jsx(SolidButton, { className: "w-auto", onClick: () => {
|
|
76
|
+
const newData = {
|
|
77
|
+
id: Math.random().toString(),
|
|
78
|
+
name: 'Name ' + data.length,
|
|
79
|
+
age: Math.ceil(Math.random() * 100)
|
|
80
|
+
};
|
|
81
|
+
const withNewData = [...data, newData];
|
|
82
|
+
const sorted = sortingKey ? withNewData.sort(sortingFunctions[sortingKey][ascending]) : withNewData;
|
|
83
|
+
setData(sorted);
|
|
84
|
+
setTableState(addElementToTable(tableState, sorted, newData, idMapping));
|
|
85
|
+
}, children: 'Add Data' }), _jsx(TextButton, { className: "w-auto", onClick: () => {
|
|
86
|
+
const selectedData = data.filter((d) => { var _a; return (_a = tableState.selection) === null || _a === void 0 ? void 0 : _a.currentSelection.includes(idMapping(d)); });
|
|
87
|
+
const unselectedData = data.filter((d) => { var _a; return !((_a = tableState.selection) === null || _a === void 0 ? void 0 : _a.currentSelection.includes(idMapping(d))); });
|
|
88
|
+
setData(unselectedData);
|
|
89
|
+
setTableState(removeFromTableSelection(tableState, selectedData, data.length, idMapping));
|
|
90
|
+
}, children: 'Remove all selected' })] })] }));
|
|
91
|
+
};
|
|
92
|
+
export default TableExample;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { TextareaProps } from '../user-input/Textarea';
|
|
2
|
+
export type TextareaExampleProps = Omit<TextareaProps, 'onChange' | 'onEditCompleted'>;
|
|
3
|
+
/**
|
|
4
|
+
* Example for the Textarea component
|
|
5
|
+
*/
|
|
6
|
+
export declare const TextareaExample: ({ value, ...props }: TextareaExampleProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useState } from 'react';
|
|
3
|
+
import { Textarea } from '../user-input/Textarea';
|
|
4
|
+
/**
|
|
5
|
+
* Example for the Textarea component
|
|
6
|
+
*/
|
|
7
|
+
export const TextareaExample = ({ value, ...props }) => {
|
|
8
|
+
const [text, setText] = useState(value);
|
|
9
|
+
return (_jsx(Textarea, { ...props, value: text, onChange: setText, onEditCompleted: setText }));
|
|
10
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { TileProps } from '../layout/Tile';
|
|
2
|
+
export type TileExampleProps = Omit<TileProps, 'prefix' | 'suffix'> & {
|
|
3
|
+
prefix: boolean;
|
|
4
|
+
suffix: boolean;
|
|
5
|
+
};
|
|
6
|
+
/**
|
|
7
|
+
* An Example for using the tile
|
|
8
|
+
*/
|
|
9
|
+
export declare const TileExample: ({ prefix, suffix, ...restProps }: TileExampleProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Info, X } from 'lucide-react';
|
|
3
|
+
import { Tile } from '../layout/Tile';
|
|
4
|
+
/**
|
|
5
|
+
* An Example for using the tile
|
|
6
|
+
*/
|
|
7
|
+
export const TileExample = ({ prefix, suffix, ...restProps }) => {
|
|
8
|
+
return (_jsx(Tile, { ...restProps, prefix: prefix ? _jsx(Info, { size: 20 }) : undefined, suffix: suffix ? _jsx(X, { size: 20 }) : undefined }));
|
|
9
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { DateTimePickerProps } from '../../user-input/DateAndTimePicker';
|
|
2
|
+
import type { DatePickerProps } from '../../date/DatePicker';
|
|
3
|
+
import type { TimePickerProps } from '../../date/TimePicker';
|
|
4
|
+
import type { YearMonthPickerProps } from '../../date/YearMonthPicker';
|
|
5
|
+
import type { DayPickerProps } from '../../date/DayPicker';
|
|
6
|
+
export type DateTimePickerExampleProps = Omit<DateTimePickerProps, 'datePickerProps' | 'timePickerProps'> & Pick<DatePickerProps, 'initialDisplay'> & Pick<TimePickerProps, 'is24HourFormat' | 'minuteIncrement'> & Pick<YearMonthPickerProps, 'showValueOpen'> & Pick<DayPickerProps, 'markToday' | 'weekStart'>;
|
|
7
|
+
/**
|
|
8
|
+
* Example for the DateTimePicker
|
|
9
|
+
*/
|
|
10
|
+
export declare const DateTimePickerExample: ({ value, onChange, onRemove, onFinish, initialDisplay, is24HourFormat, minuteIncrement, showValueOpen, markToday, weekStart, ...props }: DateTimePickerExampleProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useState } from 'react';
|
|
3
|
+
import { DateTimePicker } from '../../user-input/DateAndTimePicker';
|
|
4
|
+
import { noop } from '../../../util/noop';
|
|
5
|
+
/**
|
|
6
|
+
* Example for the DateTimePicker
|
|
7
|
+
*/
|
|
8
|
+
export const DateTimePickerExample = ({ value, onChange = noop, onRemove = noop, onFinish = noop, initialDisplay, is24HourFormat, minuteIncrement, showValueOpen, markToday, weekStart, ...props }) => {
|
|
9
|
+
const [time, setTime] = useState(value);
|
|
10
|
+
useEffect(() => setTime(value), [value]);
|
|
11
|
+
return (_jsx(DateTimePicker, { ...props, value: time, onChange: date => {
|
|
12
|
+
onChange(date);
|
|
13
|
+
setTime(date);
|
|
14
|
+
}, onRemove: () => {
|
|
15
|
+
onRemove();
|
|
16
|
+
setTime(new Date());
|
|
17
|
+
}, onFinish: date => {
|
|
18
|
+
onFinish(date);
|
|
19
|
+
setTime(date);
|
|
20
|
+
}, timePickerProps: { is24HourFormat, minuteIncrement }, datePickerProps: { initialDisplay, dayPickerProps: { markToday, weekStart }, yearMonthPickerProps: { showValueOpen } } }));
|
|
21
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { CheckboxPropertyProps } from '../../properties/CheckboxProperty';
|
|
2
|
+
export type CheckboxPropertyExampleProps = Omit<CheckboxPropertyProps, 'onChange' | 'onRemove'> & {
|
|
3
|
+
readOnly: boolean;
|
|
4
|
+
};
|
|
5
|
+
/**
|
|
6
|
+
* Example for using the CheckboxProperty
|
|
7
|
+
*/
|
|
8
|
+
export declare const CheckboxPropertyExample: ({ value, ...restProps }: CheckboxPropertyExampleProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useState } from 'react';
|
|
3
|
+
import { CheckboxProperty } from '../../properties/CheckboxProperty';
|
|
4
|
+
/**
|
|
5
|
+
* Example for using the CheckboxProperty
|
|
6
|
+
*/
|
|
7
|
+
export const CheckboxPropertyExample = ({ value = false, ...restProps }) => {
|
|
8
|
+
const [usedValue, setUsedValue] = useState(value);
|
|
9
|
+
useEffect(() => {
|
|
10
|
+
setUsedValue(value);
|
|
11
|
+
}, [value]);
|
|
12
|
+
return (_jsx(CheckboxProperty, { ...restProps, onChange: setUsedValue, value: usedValue }));
|
|
13
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { DatePropertyProps } from '../../properties/DateProperty';
|
|
2
|
+
export type DatePropertyExampleProps = DatePropertyProps & {
|
|
3
|
+
readOnly: boolean;
|
|
4
|
+
};
|
|
5
|
+
/**
|
|
6
|
+
* Example for using the DateProperty
|
|
7
|
+
*/
|
|
8
|
+
export declare const DatePropertyExample: ({ value, onChange, onRemove, onEditComplete, ...restProps }: DatePropertyExampleProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useState } from 'react';
|
|
3
|
+
import { DateProperty } from '../../properties/DateProperty';
|
|
4
|
+
import { noop } from '../../../util/noop';
|
|
5
|
+
/**
|
|
6
|
+
* Example for using the DateProperty
|
|
7
|
+
*/
|
|
8
|
+
export const DatePropertyExample = ({ value, onChange = noop, onRemove = noop, onEditComplete = noop, ...restProps }) => {
|
|
9
|
+
const [usedDate, setUsedDate] = useState(value);
|
|
10
|
+
useEffect(() => {
|
|
11
|
+
setUsedDate(value);
|
|
12
|
+
}, [value]);
|
|
13
|
+
return (_jsx(DateProperty, { ...restProps, onChange: date => {
|
|
14
|
+
setUsedDate(date);
|
|
15
|
+
onChange(date);
|
|
16
|
+
}, onEditComplete: date => {
|
|
17
|
+
setUsedDate(date);
|
|
18
|
+
onEditComplete(date);
|
|
19
|
+
}, onRemove: () => {
|
|
20
|
+
setUsedDate(undefined);
|
|
21
|
+
onRemove();
|
|
22
|
+
}, value: usedDate }));
|
|
23
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { MultiSelectPropertyProps } from '../../properties/MultiSelectProperty';
|
|
2
|
+
export type MultiSelectPropertyExample = Omit<MultiSelectPropertyProps<string>, 'onChange' | 'onRemove' | 'search' | 'selectedDisplay'> & {
|
|
3
|
+
enableSearch: boolean;
|
|
4
|
+
};
|
|
5
|
+
/**
|
|
6
|
+
* Example for using the MultiSelectProperty
|
|
7
|
+
*/
|
|
8
|
+
export declare const MultiSelectPropertyExample: ({ options, hintText, enableSearch, ...restProps }: MultiSelectPropertyExample) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useState } from 'react';
|
|
3
|
+
import { MultiSelectProperty } from '../../properties/MultiSelectProperty';
|
|
4
|
+
/**
|
|
5
|
+
* Example for using the MultiSelectProperty
|
|
6
|
+
*/
|
|
7
|
+
export const MultiSelectPropertyExample = ({ options, hintText, enableSearch, ...restProps }) => {
|
|
8
|
+
const [usedOptions, setUsedOptions] = useState(options);
|
|
9
|
+
useEffect(() => {
|
|
10
|
+
setUsedOptions(options);
|
|
11
|
+
}, [options]);
|
|
12
|
+
useEffect(() => {
|
|
13
|
+
setUsedOptions(options.map(value => ({ ...value, selected: false })));
|
|
14
|
+
}, [hintText, options]);
|
|
15
|
+
return (_jsx(MultiSelectProperty, { ...restProps, options: usedOptions, search: enableSearch ? { initialSearch: '', searchMapping: value => [value.label] } : undefined, onChange: setUsedOptions, onRemove: () => setUsedOptions(usedOptions.map(value => ({ ...value, selected: false }))), hintText: hintText }));
|
|
16
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { NumberPropertyProps } from '../../properties/NumberProperty';
|
|
2
|
+
export type NumberPropertyExampleProps = Omit<NumberPropertyProps, 'onChange' | 'onRemove'>;
|
|
3
|
+
/**
|
|
4
|
+
* Example for using the NumberProperty
|
|
5
|
+
*/
|
|
6
|
+
export declare const NumberPropertyExample: ({ value, ...restProps }: NumberPropertyExampleProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useState } from 'react';
|
|
3
|
+
import { NumberProperty } from '../../properties/NumberProperty';
|
|
4
|
+
/**
|
|
5
|
+
* Example for using the NumberProperty
|
|
6
|
+
*/
|
|
7
|
+
export const NumberPropertyExample = ({ value, ...restProps }) => {
|
|
8
|
+
const [usedValue, setUsedValue] = useState(value);
|
|
9
|
+
useEffect(() => {
|
|
10
|
+
setUsedValue(value);
|
|
11
|
+
}, [value]);
|
|
12
|
+
return (_jsx(NumberProperty, { ...restProps, onChange: setUsedValue, onRemove: () => setUsedValue(undefined), value: usedValue }));
|
|
13
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { SingleSelectPropertyProps } from '../../properties/SelectProperty';
|
|
2
|
+
export type SingleSelectPropertyExample = Omit<SingleSelectPropertyProps<string>, 'onChange' | 'onRemove' | 'searchMapping'>;
|
|
3
|
+
/**
|
|
4
|
+
* Example for using the SingleSelectProperty
|
|
5
|
+
*/
|
|
6
|
+
export declare const SingleSelectPropertyExample: ({ value, options, hintText, ...restProps }: SingleSelectPropertyExample) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useState } from 'react';
|
|
3
|
+
import { SingleSelectProperty } from '../../properties/SelectProperty';
|
|
4
|
+
/**
|
|
5
|
+
* Example for using the SingleSelectProperty
|
|
6
|
+
*/
|
|
7
|
+
export const SingleSelectPropertyExample = ({ value, options, hintText, ...restProps }) => {
|
|
8
|
+
const [usedValue, setUsedValue] = useState(value);
|
|
9
|
+
useEffect(() => {
|
|
10
|
+
setUsedValue(undefined);
|
|
11
|
+
}, [hintText]);
|
|
12
|
+
useEffect(() => {
|
|
13
|
+
if (options.find(value1 => value1.value === value)) {
|
|
14
|
+
setUsedValue(value);
|
|
15
|
+
}
|
|
16
|
+
}, [value, options]);
|
|
17
|
+
return (_jsx(SingleSelectProperty, { ...restProps, value: usedValue, options: options, searchMapping: value1 => [value1.value], onChange: setUsedValue, onRemove: () => setUsedValue(undefined), hintText: hintText }));
|
|
18
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { TextPropertyProps } from '../../properties/TextProperty';
|
|
2
|
+
export type TextPropertyExampleProps = Omit<TextPropertyProps, 'onChange' | 'onRemove'> & {
|
|
3
|
+
readOnly: boolean;
|
|
4
|
+
};
|
|
5
|
+
/**
|
|
6
|
+
* Example for using the TextProperty
|
|
7
|
+
*/
|
|
8
|
+
export declare const TextPropertyExample: ({ value, ...restProps }: TextPropertyExampleProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useState } from 'react';
|
|
3
|
+
import { TextProperty } from '../../properties/TextProperty';
|
|
4
|
+
/**
|
|
5
|
+
* Example for using the TextProperty
|
|
6
|
+
*/
|
|
7
|
+
export const TextPropertyExample = ({ value, ...restProps }) => {
|
|
8
|
+
const [usedValue, setUsedValue] = useState(value);
|
|
9
|
+
useEffect(() => {
|
|
10
|
+
setUsedValue(value);
|
|
11
|
+
}, [value]);
|
|
12
|
+
return (_jsx(TextProperty, { ...restProps, onChange: setUsedValue, onRemove: () => setUsedValue(undefined), value: usedValue }));
|
|
13
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { SVGProps } from 'react';
|
|
2
|
+
export type HelpwaveProps = SVGProps<SVGSVGElement> & {
|
|
3
|
+
color?: string;
|
|
4
|
+
animate?: 'none' | 'loading' | 'pulse' | 'bounce';
|
|
5
|
+
size?: number;
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* The helpwave loading spinner based on the svg logo.
|
|
9
|
+
*/
|
|
10
|
+
export declare const Helpwave: ({ color, animate, size, ...props }: HelpwaveProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { clsx } from 'clsx';
|
|
3
|
+
/**
|
|
4
|
+
* The helpwave loading spinner based on the svg logo.
|
|
5
|
+
*/
|
|
6
|
+
export const Helpwave = ({ color = 'currentColor', animate = 'none', size = 64, ...props }) => {
|
|
7
|
+
const isLoadingAnimation = animate === 'loading';
|
|
8
|
+
let svgAnimationKey = '';
|
|
9
|
+
if (animate === 'pulse') {
|
|
10
|
+
svgAnimationKey = 'animate-pulse';
|
|
11
|
+
}
|
|
12
|
+
else if (animate === 'bounce') {
|
|
13
|
+
svgAnimationKey = 'animate-bounce';
|
|
14
|
+
}
|
|
15
|
+
if (size < 0) {
|
|
16
|
+
console.error('size cannot be less than 0');
|
|
17
|
+
size = 64;
|
|
18
|
+
}
|
|
19
|
+
return (_jsx("svg", { width: size, height: size, viewBox: "0 0 888 888", fill: "none", strokeLinecap: "round", strokeWidth: 48, ...props, children: _jsxs("g", { className: clsx(svgAnimationKey), children: [_jsx("path", { className: clsx({ 'animate-wave-big-left-up': isLoadingAnimation }), d: "M144 543.235C144 423.259 232.164 326 340.92 326", stroke: color, strokeDasharray: "1000" }), _jsx("path", { className: clsx({ 'animate-wave-big-right-down': isLoadingAnimation }), d: "M537.84 544.104C429.084 544.104 340.92 446.844 340.92 326.869", stroke: color, strokeDasharray: "1000" }), _jsx("path", { className: clsx({ 'animate-wave-small-left-up': isLoadingAnimation }), d: "M462.223 518.035C462.223 432.133 525.348 362.495 603.217 362.495", stroke: color, strokeDasharray: "1000" }), _jsx("path", { className: clsx({ 'animate-wave-small-right-down': isLoadingAnimation }), d: "M745.001 519.773C666.696 519.773 603.218 450.136 603.218 364.233", stroke: color, strokeDasharray: "1000" })] }) }));
|
|
20
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { ImageProps } from 'next/image';
|
|
2
|
+
export type TagProps = Omit<ImageProps, 'src' | 'alt'>;
|
|
3
|
+
/**
|
|
4
|
+
* Tag icon from flaticon
|
|
5
|
+
*
|
|
6
|
+
* https://www.flaticon.com/free-icon/price-tag_721550?term=label&page=1&position=8&origin=tag&related_id=721550
|
|
7
|
+
*
|
|
8
|
+
* When using it make attribution
|
|
9
|
+
*/
|
|
10
|
+
export declare const TagIcon: ({ className, width, height, ...props }: TagProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import Image from 'next/image';
|
|
3
|
+
/**
|
|
4
|
+
* Tag icon from flaticon
|
|
5
|
+
*
|
|
6
|
+
* https://www.flaticon.com/free-icon/price-tag_721550?term=label&page=1&position=8&origin=tag&related_id=721550
|
|
7
|
+
*
|
|
8
|
+
* When using it make attribution
|
|
9
|
+
*/
|
|
10
|
+
export const TagIcon = ({ className, width = 16, height = 16, ...props }) => {
|
|
11
|
+
return (_jsx(Image, { ...props, width: width, height: height, alt: "", src: "https://cdn.helpwave.de/icons/label.png", className: className }));
|
|
12
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
type CarouselProps = {
|
|
3
|
+
children: ReactNode[];
|
|
4
|
+
animationTime?: number;
|
|
5
|
+
isLooping?: boolean;
|
|
6
|
+
isAutoLooping?: boolean;
|
|
7
|
+
autoLoopingTimeOut?: number;
|
|
8
|
+
autoLoopAnimationTime?: number;
|
|
9
|
+
hintNext?: boolean;
|
|
10
|
+
arrows?: boolean;
|
|
11
|
+
dots?: boolean;
|
|
12
|
+
/**
|
|
13
|
+
* Percentage that is allowed to be scrolled further
|
|
14
|
+
*/
|
|
15
|
+
overScrollThreshold?: number;
|
|
16
|
+
blurColor?: string;
|
|
17
|
+
className?: string;
|
|
18
|
+
heightClassName?: string;
|
|
19
|
+
widthClassName?: string;
|
|
20
|
+
};
|
|
21
|
+
export declare const Carousel: ({ children, animationTime, isLooping, isAutoLooping, autoLoopingTimeOut, autoLoopAnimationTime, hintNext, arrows, dots, overScrollThreshold, blurColor, className, heightClassName, widthClassName, }: CarouselProps) => import("react/jsx-runtime").JSX.Element;
|
|
22
|
+
export {};
|