@public-ui/sample-react 2.1.7 → 2.1.8-rc.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/1487.js +1 -1
- package/dist/1636.js +1 -1
- package/dist/1792.js +1 -1
- package/dist/1795.js +1 -1
- package/dist/1938.js +2 -0
- package/dist/2017.js +1 -1
- package/dist/2322.js +1 -1
- package/dist/2538.js +1 -1
- package/dist/2567.js +1 -1
- package/dist/263.js +1 -1
- package/dist/2719.js +1 -1
- package/dist/3064.js +1 -1
- package/dist/3077.js +1 -1
- package/dist/3238.js +1 -1
- package/dist/3395.js +1 -1
- package/dist/35.js +1 -1
- package/dist/3521.js +1 -1
- package/dist/356.js +1 -1
- package/dist/3714.js +1 -1
- package/dist/3735.js +1 -1
- package/dist/3766.js +1 -1
- package/dist/3994.js +1 -1
- package/dist/4025.js +1 -1
- package/dist/4118.js +1 -1
- package/dist/4182.js +1 -1
- package/dist/4188.js +1 -1
- package/dist/4332.js +1 -1
- package/dist/4402.js +1 -1
- package/dist/4556.js +2 -0
- package/dist/4818.js +1 -1
- package/dist/4892.js +1 -1
- package/dist/4933.js +1 -1
- package/dist/4943.js +1 -1
- package/dist/495.js +1 -1
- package/dist/5034.js +1 -1
- package/dist/5056.js +1 -1
- package/dist/5138.js +1 -1
- package/dist/5296.js +1 -1
- package/dist/5356.js +1 -1
- package/dist/5551.js +1 -1
- package/dist/5835.js +1 -1
- package/dist/5840.js +1 -1
- package/dist/5889.js +1 -1
- package/dist/5912.js +1 -1
- package/dist/6082.js +1 -1
- package/dist/6099.js +1 -1
- package/dist/6181.js +1 -1
- package/dist/619.js +1 -1
- package/dist/6671.js +1 -1
- package/dist/6775.js +1 -1
- package/dist/6812.js +2 -0
- package/dist/7274.js +1 -1
- package/dist/7795.js +1 -1
- package/dist/7802.js +1 -1
- package/dist/7860.js +1 -1
- package/dist/8092.js +1 -1
- package/dist/8111.js +1 -1
- package/dist/8146.js +1 -1
- package/dist/8427.js +1 -1
- package/dist/8495.js +1 -1
- package/dist/8672.js +1 -1
- package/dist/8737.js +1 -1
- package/dist/8786.js +1 -1
- package/dist/8796.js +1 -1
- package/dist/8853.js +2 -0
- package/dist/8977.js +1 -1
- package/dist/9333.js +1 -1
- package/dist/9389.js +1 -1
- package/dist/9561.js +1 -1
- package/dist/9599.js +1 -1
- package/dist/9612.js +1 -1
- package/dist/9890.js +1 -1
- package/dist/index.html +1 -1
- package/dist/main.css +3 -3
- package/dist/main.js +1 -1
- package/dist/main.js.LICENSE.txt +2 -2
- package/package.json +13 -14
- package/public/index.html +1 -1
- package/src/@shared/_mixins.scss +3 -0
- package/src/App.tsx +1 -1
- package/src/components/FormWrap.tsx +1 -1
- package/src/components/Navigation.tsx +63 -0
- package/src/components/Sidebar.tsx +5 -41
- package/src/components/abbr/basic.tsx +12 -12
- package/src/components/alert/card-msg.tsx +3 -1
- package/src/components/alert/html.tsx +4 -2
- package/src/components/button/baselined.tsx +1 -1
- package/src/components/button/partials/variants.tsx +15 -17
- package/src/components/button/width.tsx +2 -2
- package/src/components/button-link/basic.tsx +3 -3
- package/src/components/button-link/image.tsx +0 -1
- package/src/components/card/basic.tsx +1 -1
- package/src/components/combobox/partials/variants.tsx +1 -1
- package/src/components/details/basic.tsx +2 -2
- package/src/components/form/basic.tsx +1 -1
- package/src/components/form/error-list.tsx +1 -0
- package/src/components/input-checkbox/partials/variants.tsx +22 -10
- package/src/components/input-date/reset.tsx +1 -1
- package/src/components/input-password/show-password.tsx +1 -1
- package/src/components/input-text/partials/cases.tsx +1 -1
- package/src/components/input-text/text-formatter.tsx +45 -43
- package/src/components/link/image.tsx +0 -1
- package/src/components/link/target.tsx +1 -1
- package/src/components/modal/basic.tsx +1 -1
- package/src/components/nav/basic.tsx +23 -12
- package/src/components/nav/horizontal.tsx +12 -3
- package/src/components/nav/links.ts +36 -0
- package/src/components/table/column-alignment.tsx +64 -62
- package/src/components/table/complex-headers.tsx +80 -78
- package/src/components/table/horizontal-scrollbar.tsx +30 -28
- package/src/components/table/interactive-child-elements.tsx +69 -68
- package/src/components/table/pagination-position.tsx +15 -13
- package/src/components/table/render-cell.tsx +1 -1
- package/src/components/table/sort-data.tsx +11 -8
- package/src/components/table/stateful-with-selection.tsx +36 -27
- package/src/components/table/stateful-with-single-selection.tsx +36 -27
- package/src/components/table/stateless-with-selection.tsx +26 -17
- package/src/components/table/stateless-with-single-selection.tsx +26 -17
- package/src/components/table/stateless.tsx +29 -27
- package/src/components/table/with-footer.tsx +1 -0
- package/src/components/table/with-pagination.tsx +1 -1
- package/src/components/tabs/behavior.tsx +61 -0
- package/src/components/tabs/routes.ts +2 -0
- package/src/components/textarea/adjust-height.tsx +1 -1
- package/src/components/textarea/counter.tsx +4 -1
- package/src/components/textarea/resize.tsx +1 -1
- package/src/components/textarea/rows.tsx +1 -1
- package/src/components/toast/basic.tsx +13 -11
- package/src/react.main.tsx +6 -1
- package/src/scenarios/appointment-form/AppointmentForm.tsx +1 -0
- package/src/scenarios/disabled-interactive-elements.tsx +1 -1
- package/src/scenarios/focus-elements.tsx +21 -16
- package/src/scenarios/horizontal-scrollbar-advanced/TableHorizontalScrollbarAdvanced.tsx +1 -1
- package/src/scenarios/horizontal-scrollbar-advanced/layout.scss +19 -0
- package/src/scenarios/input-group-with-error.tsx +41 -0
- package/src/scenarios/inputs-get-value.tsx +121 -119
- package/src/scenarios/routes.ts +4 -2
- package/src/scenarios/static-form.tsx +65 -62
- package/src/style.scss +10 -13
- package/tsconfig.json +1 -2
- package/unocss.config.ts +213 -0
- package/dist/3171.js +0 -2
- package/dist/4262.js +0 -2
- package/dist/479.js +0 -2
- package/dist/8710.js +0 -2
- package/src/scenarios/horizontal-scrollbar-advanced/layout.css +0 -31
- /package/dist/{3171.js.LICENSE.txt → 1938.js.LICENSE.txt} +0 -0
- /package/dist/{4262.js.LICENSE.txt → 4556.js.LICENSE.txt} +0 -0
- /package/dist/{479.js.LICENSE.txt → 6812.js.LICENSE.txt} +0 -0
- /package/dist/{8710.js.LICENSE.txt → 8853.js.LICENSE.txt} +0 -0
|
@@ -1,10 +1,9 @@
|
|
|
1
|
+
import type { ButtonVariantPropType, KoliBriTableCell, KoliBriTableHeaderCell } from '@public-ui/components';
|
|
2
|
+
import { createReactRenderElement, KolButton, KolButtonLink, KolLink, KolLinkButton, KolTableStateless } from '@public-ui/react';
|
|
1
3
|
import type { FC } from 'react';
|
|
2
4
|
import React from 'react';
|
|
3
|
-
import { createReactRenderElement, KolButton, KolButtonLink, KolLink, KolLinkButton, KolTableStateless } from '@public-ui/react';
|
|
4
|
-
import { SampleDescription } from '../SampleDescription';
|
|
5
5
|
import { getRoot } from '../../shares/react-roots';
|
|
6
|
-
import
|
|
7
|
-
import type { KoliBriTableHeaderCell } from '@public-ui/components/src/schema';
|
|
6
|
+
import { SampleDescription } from '../SampleDescription';
|
|
8
7
|
|
|
9
8
|
const getButtonHeaderCell = (variant: ButtonVariantPropType): KoliBriTableHeaderCell => {
|
|
10
9
|
const capitalizedVariant = variant.charAt(0).toUpperCase() + variant.slice(1);
|
|
@@ -33,73 +32,75 @@ export const InteractiveChildElements: FC = () => (
|
|
|
33
32
|
</p>
|
|
34
33
|
</SampleDescription>
|
|
35
34
|
|
|
36
|
-
<
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
[
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
35
|
+
<section className="w-full flex flex-col">
|
|
36
|
+
<KolTableStateless
|
|
37
|
+
_label="Button styles"
|
|
38
|
+
_headerCells={{
|
|
39
|
+
horizontal: [
|
|
40
|
+
[
|
|
41
|
+
{ label: '', asTd: true, width: '20ex' },
|
|
42
|
+
getButtonHeaderCell('primary'),
|
|
43
|
+
getButtonHeaderCell('secondary'),
|
|
44
|
+
getButtonHeaderCell('normal'),
|
|
45
|
+
getButtonHeaderCell('danger'),
|
|
46
|
+
getButtonHeaderCell('ghost'),
|
|
47
|
+
],
|
|
47
48
|
],
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
/>
|
|
49
|
+
vertical: [[{ label: 'Button' }, { label: 'Link-Button' }]],
|
|
50
|
+
}}
|
|
51
|
+
_data={[
|
|
52
|
+
{
|
|
53
|
+
primary: 'button',
|
|
54
|
+
secondary: 'button',
|
|
55
|
+
normal: 'button',
|
|
56
|
+
danger: 'button',
|
|
57
|
+
ghost: 'button',
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
primary: 'link-button',
|
|
61
|
+
secondary: 'link-button',
|
|
62
|
+
normal: 'link-button',
|
|
63
|
+
danger: 'link-button',
|
|
64
|
+
ghost: 'link-button',
|
|
65
|
+
},
|
|
66
|
+
]}
|
|
67
|
+
className="block"
|
|
68
|
+
/>
|
|
69
69
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
70
|
+
<KolTableStateless
|
|
71
|
+
_label="Link styles"
|
|
72
|
+
_headerCells={{
|
|
73
|
+
horizontal: [
|
|
74
|
+
[
|
|
75
|
+
{ label: '', asTd: true, width: '20ex' },
|
|
76
|
+
{
|
|
77
|
+
key: 'regular',
|
|
78
|
+
label: 'Regular',
|
|
79
|
+
textAlign: 'left',
|
|
80
|
+
render: (element: HTMLElement, cell: KoliBriTableCell) => {
|
|
81
|
+
const commonProps = {
|
|
82
|
+
_label: cell.label,
|
|
83
|
+
_icons: { right: 'codicon codicon-squirrel' },
|
|
84
|
+
};
|
|
85
|
+
getRoot(createReactRenderElement(element)).render(
|
|
86
|
+
cell.label === 'button-link' ? <KolButtonLink {...commonProps} /> : <KolLink _href="#/back-page" {...commonProps} />,
|
|
87
|
+
);
|
|
88
|
+
},
|
|
88
89
|
},
|
|
89
|
-
|
|
90
|
+
],
|
|
90
91
|
],
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
92
|
+
vertical: [[{ label: 'Link' }, { label: 'Button-Link' }]],
|
|
93
|
+
}}
|
|
94
|
+
_data={[
|
|
95
|
+
{
|
|
96
|
+
regular: 'link',
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
regular: 'button-link',
|
|
100
|
+
},
|
|
101
|
+
]}
|
|
102
|
+
className="block mt"
|
|
103
|
+
/>
|
|
104
|
+
</section>
|
|
104
105
|
</>
|
|
105
106
|
);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { FC } from 'react';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
|
|
4
|
-
import { KolTable } from '@public-ui/react';
|
|
4
|
+
import { KolHeading, KolTable } from '@public-ui/react';
|
|
5
5
|
|
|
6
6
|
import { SampleDescription } from '../SampleDescription';
|
|
7
7
|
import { DATE_FORMATTER } from './formatter';
|
|
@@ -21,22 +21,24 @@ const HEADERS: KoliBriTableHeaders = {
|
|
|
21
21
|
const PAGINATION: KoliBriTablePaginationProps = { _page: 2 };
|
|
22
22
|
|
|
23
23
|
export const PaginationPosition: FC = () => (
|
|
24
|
-
<div className="grid gap-14">
|
|
24
|
+
<div className="w-full grid gap-14">
|
|
25
25
|
<SampleDescription>
|
|
26
26
|
<p>This sample shows KolTable with different pagination positions.</p>
|
|
27
27
|
</SampleDescription>
|
|
28
28
|
|
|
29
|
-
<section>
|
|
30
|
-
<
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
<
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
<
|
|
39
|
-
|
|
29
|
+
<section className="w-full flex flex-col gap-14">
|
|
30
|
+
<section className="grid gap-4">
|
|
31
|
+
<KolHeading _level={2} _label="Table with pagination at the bottom."></KolHeading>
|
|
32
|
+
<KolTable _label="Tabellenbeschreibung" _data={DATA} _headers={HEADERS} _pagination={PAGINATION} _paginationPosition="bottom"></KolTable>
|
|
33
|
+
</section>
|
|
34
|
+
<section className="grid gap-4">
|
|
35
|
+
<KolHeading _level={2} _label="Table with pagination at the top."></KolHeading>
|
|
36
|
+
<KolTable _label="Tabellenbeschreibung" _data={DATA} _headers={HEADERS} _pagination={PAGINATION} _paginationPosition="top"></KolTable>
|
|
37
|
+
</section>
|
|
38
|
+
<section className="grid gap-4">
|
|
39
|
+
<KolHeading _level={2} _label="Table with pagination at both top and bottom."></KolHeading>
|
|
40
|
+
<KolTable _label="Tabellenbeschreibung" _data={DATA} _headers={HEADERS} _pagination={PAGINATION} _paginationPosition="both"></KolTable>
|
|
41
|
+
</section>
|
|
40
42
|
</section>
|
|
41
43
|
</div>
|
|
42
44
|
);
|
|
@@ -104,6 +104,6 @@ export const TableRenderCell: FC = () => (
|
|
|
104
104
|
<p>This sample shows KolTable using React render functions for the cell contents.</p>
|
|
105
105
|
</SampleDescription>
|
|
106
106
|
|
|
107
|
-
<KolTable _label="Sort by date column" _data={DATA} _headers={HEADERS} className="
|
|
107
|
+
<KolTable _label="Sort by date column" _data={DATA} _headers={HEADERS} className="w-full" />
|
|
108
108
|
</>
|
|
109
109
|
);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { FC } from 'react';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
|
|
4
|
-
import { KolTable } from '@public-ui/react';
|
|
4
|
+
import { KolHeading, KolTable } from '@public-ui/react';
|
|
5
5
|
import type { KoliBriTableHeaders } from '@public-ui/components';
|
|
6
6
|
import type { Data } from './test-data';
|
|
7
7
|
import { DATA } from './test-data';
|
|
@@ -59,12 +59,15 @@ export const TableSortData: FC = () => (
|
|
|
59
59
|
<p>This sample shows KolTable with sortable columns. The sort-order can be changed by clicking the "date" header column.</p>
|
|
60
60
|
</SampleDescription>
|
|
61
61
|
|
|
62
|
-
<
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
62
|
+
<section className="w-full grid gap-4">
|
|
63
|
+
<section className="grid gap-4">
|
|
64
|
+
<KolHeading _level={2} _label="Vertical" />
|
|
65
|
+
<KolTable _label="Sort a date column" _data={DATA.slice(0, 10)} _headers={HEADERS_VERTICAL} className="block" />
|
|
66
|
+
</section>
|
|
67
|
+
<section className="grid gap-4">
|
|
68
|
+
<KolHeading _level={2} _label="Horizontal" />
|
|
69
|
+
<KolTable _label="Sort a date column" _data={DATA} _headers={HEADERS_HORIZONTAL} className="block" />
|
|
70
|
+
</section>
|
|
71
|
+
</section>
|
|
69
72
|
</>
|
|
70
73
|
);
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import type { FC } from 'react';
|
|
2
2
|
import React, { useEffect, useRef, useState } from 'react';
|
|
3
|
-
import { KolButton, KolTableStateful } from '@public-ui/react';
|
|
3
|
+
import { KolButton, KolTableStateful, createReactRenderElement } from '@public-ui/react';
|
|
4
4
|
import { SampleDescription } from '../SampleDescription';
|
|
5
5
|
import type { KoliBriTableDataType, KoliBriTableSelection } from '@public-ui/components';
|
|
6
|
+
import { getRoot } from '../../shares/react-roots';
|
|
7
|
+
import type { KoliBriTableCell } from '@public-ui/components';
|
|
6
8
|
|
|
7
9
|
const DATA = [
|
|
8
10
|
{ id: '1001', name: 'Foo Bar', internalIdentifier: `AAA1001` },
|
|
@@ -43,40 +45,47 @@ export const TableStatefulWithSelection: FC = () => {
|
|
|
43
45
|
};
|
|
44
46
|
}, [kolTableStatefulRef]);
|
|
45
47
|
|
|
48
|
+
const renderButton = (element: HTMLElement, cell: KoliBriTableCell) => {
|
|
49
|
+
getRoot(createReactRenderElement(element)).render(<KolButton _label={`Click ${cell.data?.id}`}></KolButton>);
|
|
50
|
+
};
|
|
51
|
+
|
|
46
52
|
return (
|
|
47
53
|
<>
|
|
48
54
|
<SampleDescription>
|
|
49
55
|
<p>This sample shows KolTableStateful with checkboxes for selection enabled.</p>
|
|
50
56
|
</SampleDescription>
|
|
51
57
|
|
|
52
|
-
<
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
[
|
|
57
|
-
|
|
58
|
-
|
|
58
|
+
<section className="w-full">
|
|
59
|
+
<KolTableStateful
|
|
60
|
+
_label="Table with selection checkboxes"
|
|
61
|
+
_headers={{
|
|
62
|
+
horizontal: [
|
|
63
|
+
[
|
|
64
|
+
{ key: 'id', label: '#ID', textAlign: 'left' },
|
|
65
|
+
{ key: 'name', label: 'Name', textAlign: 'left' },
|
|
66
|
+
{ key: 'action', label: 'Action', textAlign: 'left', render: renderButton },
|
|
67
|
+
],
|
|
59
68
|
],
|
|
60
|
-
],
|
|
61
|
-
}}
|
|
62
|
-
_data={DATA}
|
|
63
|
-
_selection={selection}
|
|
64
|
-
_on={{ onSelectionChange: handleSelectionChangeCallback }}
|
|
65
|
-
className="block"
|
|
66
|
-
style={{ maxWidth: '600px' }}
|
|
67
|
-
ref={kolTableStatefulRef}
|
|
68
|
-
/>
|
|
69
|
-
<div className="grid grid-cols-3 items-end gap-4 mt-4">
|
|
70
|
-
<KolButton
|
|
71
|
-
_label="getSelection()"
|
|
72
|
-
_on={{
|
|
73
|
-
onClick: () => {
|
|
74
|
-
void handleButtonClick();
|
|
75
|
-
},
|
|
76
69
|
}}
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
70
|
+
_data={DATA}
|
|
71
|
+
_selection={selection}
|
|
72
|
+
_on={{ onSelectionChange: handleSelectionChangeCallback }}
|
|
73
|
+
className="block"
|
|
74
|
+
style={{ maxWidth: '600px' }}
|
|
75
|
+
ref={kolTableStatefulRef}
|
|
76
|
+
/>
|
|
77
|
+
<div className="grid grid-cols-3 items-end gap-4 mt-4">
|
|
78
|
+
<KolButton
|
|
79
|
+
_label="getSelection()"
|
|
80
|
+
_on={{
|
|
81
|
+
onClick: () => {
|
|
82
|
+
void handleButtonClick();
|
|
83
|
+
},
|
|
84
|
+
}}
|
|
85
|
+
></KolButton>
|
|
86
|
+
<pre className="text-base">{JSON.stringify(selectedValue, null, 2)}</pre>
|
|
87
|
+
</div>
|
|
88
|
+
</section>
|
|
80
89
|
</>
|
|
81
90
|
);
|
|
82
91
|
};
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import type { FC } from 'react';
|
|
2
2
|
import React, { useEffect, useRef, useState } from 'react';
|
|
3
|
-
import { KolButton, KolTableStateful } from '@public-ui/react';
|
|
3
|
+
import { KolButton, KolTableStateful, createReactRenderElement } from '@public-ui/react';
|
|
4
4
|
import { SampleDescription } from '../SampleDescription';
|
|
5
5
|
import type { KoliBriTableDataType, KoliBriTableSelection } from '@public-ui/components';
|
|
6
|
+
import { getRoot } from '../../shares/react-roots';
|
|
7
|
+
import type { KoliBriTableCell } from '@public-ui/components';
|
|
6
8
|
|
|
7
9
|
const DATA = [
|
|
8
10
|
{ id: '1001', name: 'Foo Bar', internalIdentifier: `AAA1001` },
|
|
@@ -45,40 +47,47 @@ export const TableStatefulWithSingleSelection: FC = () => {
|
|
|
45
47
|
};
|
|
46
48
|
}, [kolTableStatefulRef]);
|
|
47
49
|
|
|
50
|
+
const renderButton = (element: HTMLElement, cell: KoliBriTableCell) => {
|
|
51
|
+
getRoot(createReactRenderElement(element)).render(<KolButton _label={`Click ${cell.data?.id}`}></KolButton>);
|
|
52
|
+
};
|
|
53
|
+
|
|
48
54
|
return (
|
|
49
55
|
<>
|
|
50
56
|
<SampleDescription>
|
|
51
57
|
<p>This sample shows KolTableStateful with radio buttons for selection enabled.</p>
|
|
52
58
|
</SampleDescription>
|
|
53
59
|
|
|
54
|
-
<
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
[
|
|
59
|
-
|
|
60
|
-
|
|
60
|
+
<section className="w-full">
|
|
61
|
+
<KolTableStateful
|
|
62
|
+
_label="Table with selection radio"
|
|
63
|
+
_headers={{
|
|
64
|
+
horizontal: [
|
|
65
|
+
[
|
|
66
|
+
{ key: 'id', label: '#ID', textAlign: 'left' },
|
|
67
|
+
{ key: 'name', label: 'Name', textAlign: 'left' },
|
|
68
|
+
{ key: 'action', label: 'Action', textAlign: 'left', render: renderButton },
|
|
69
|
+
],
|
|
61
70
|
],
|
|
62
|
-
],
|
|
63
|
-
}}
|
|
64
|
-
_data={DATA}
|
|
65
|
-
_selection={selection}
|
|
66
|
-
_on={{ onSelectionChange: handleSelectionChangeCallback }}
|
|
67
|
-
className="block"
|
|
68
|
-
style={{ maxWidth: '600px' }}
|
|
69
|
-
ref={kolTableStatefulRef}
|
|
70
|
-
/>
|
|
71
|
-
<div className="grid grid-cols-3 items-end gap-4 mt-4">
|
|
72
|
-
<KolButton
|
|
73
|
-
_label="getSelection()"
|
|
74
|
-
_on={{
|
|
75
|
-
onClick: () => {
|
|
76
|
-
void handleButtonClick();
|
|
77
|
-
},
|
|
78
71
|
}}
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
72
|
+
_data={DATA}
|
|
73
|
+
_selection={selection}
|
|
74
|
+
_on={{ onSelectionChange: handleSelectionChangeCallback }}
|
|
75
|
+
className="block"
|
|
76
|
+
style={{ maxWidth: '600px' }}
|
|
77
|
+
ref={kolTableStatefulRef}
|
|
78
|
+
/>
|
|
79
|
+
<div className="grid grid-cols-3 items-end gap-4 mt-4">
|
|
80
|
+
<KolButton
|
|
81
|
+
_label="getSelection()"
|
|
82
|
+
_on={{
|
|
83
|
+
onClick: () => {
|
|
84
|
+
void handleButtonClick();
|
|
85
|
+
},
|
|
86
|
+
}}
|
|
87
|
+
></KolButton>
|
|
88
|
+
<pre className="text-base">{JSON.stringify(selectedValue, null, 2)}</pre>
|
|
89
|
+
</div>
|
|
90
|
+
</section>
|
|
82
91
|
</>
|
|
83
92
|
);
|
|
84
93
|
};
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import type { FC } from 'react';
|
|
2
2
|
import React, { useEffect, useState, useRef } from 'react';
|
|
3
|
-
import { KolTableStateless } from '@public-ui/react';
|
|
3
|
+
import { KolButton, KolTableStateless, createReactRenderElement } from '@public-ui/react';
|
|
4
4
|
import { SampleDescription } from '../SampleDescription';
|
|
5
5
|
import type { KoliBriTableSelection } from '@public-ui/components';
|
|
6
|
+
import { getRoot } from '../../shares/react-roots';
|
|
7
|
+
import type { KoliBriTableCell } from '@public-ui/components';
|
|
6
8
|
|
|
7
9
|
const DATA = [
|
|
8
10
|
{ id: '1001', name: 'Foo Bar', internalIdentifier: `AAA1001` },
|
|
@@ -39,29 +41,36 @@ export const TableStatelessWithSelection: FC = () => {
|
|
|
39
41
|
};
|
|
40
42
|
}, [kolTableStatelessRef]);
|
|
41
43
|
|
|
44
|
+
const renderButton = (element: HTMLElement, cell: KoliBriTableCell) => {
|
|
45
|
+
getRoot(createReactRenderElement(element)).render(<KolButton _label={`Click ${cell.data?.id}`}></KolButton>);
|
|
46
|
+
};
|
|
47
|
+
|
|
42
48
|
return (
|
|
43
49
|
<>
|
|
44
50
|
<SampleDescription>
|
|
45
51
|
<p>This sample shows KolTableStateless with checkboxes for selection enabled.</p>
|
|
46
52
|
</SampleDescription>
|
|
47
53
|
|
|
48
|
-
<
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
[
|
|
53
|
-
|
|
54
|
-
|
|
54
|
+
<section className="w-full">
|
|
55
|
+
<KolTableStateless
|
|
56
|
+
_label="Table with selection checkboxes"
|
|
57
|
+
_headerCells={{
|
|
58
|
+
horizontal: [
|
|
59
|
+
[
|
|
60
|
+
{ key: 'id', label: '#ID', textAlign: 'left' },
|
|
61
|
+
{ key: 'name', label: 'Name', textAlign: 'left' },
|
|
62
|
+
{ key: 'action', label: 'Action', textAlign: 'left', render: renderButton },
|
|
63
|
+
],
|
|
55
64
|
],
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
+
}}
|
|
66
|
+
_data={DATA}
|
|
67
|
+
_selection={selection}
|
|
68
|
+
_on={{ onSelectionChange: handleSelectionChangeCallback }}
|
|
69
|
+
className="block"
|
|
70
|
+
style={{ maxWidth: '600px' }}
|
|
71
|
+
ref={kolTableStatelessRef}
|
|
72
|
+
/>
|
|
73
|
+
</section>
|
|
65
74
|
</>
|
|
66
75
|
);
|
|
67
76
|
};
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import type { FC } from 'react';
|
|
2
2
|
import React, { useEffect, useState, useRef } from 'react';
|
|
3
|
-
import { KolTableStateless } from '@public-ui/react';
|
|
3
|
+
import { KolButton, KolTableStateless, createReactRenderElement } from '@public-ui/react';
|
|
4
4
|
import { SampleDescription } from '../SampleDescription';
|
|
5
5
|
import type { KoliBriTableSelection } from '@public-ui/components';
|
|
6
|
+
import { getRoot } from '../../shares/react-roots';
|
|
7
|
+
import type { KoliBriTableCell } from '@public-ui/components';
|
|
6
8
|
|
|
7
9
|
const DATA = [
|
|
8
10
|
{ id: '1001', name: 'Foo Bar', internalIdentifier: `AAA1001` },
|
|
@@ -40,29 +42,36 @@ export const TableStatelessWithSingleSelection: FC = () => {
|
|
|
40
42
|
};
|
|
41
43
|
}, [kolTableStatelessRef]);
|
|
42
44
|
|
|
45
|
+
const renderButton = (element: HTMLElement, cell: KoliBriTableCell) => {
|
|
46
|
+
getRoot(createReactRenderElement(element)).render(<KolButton _label={`Click ${cell.data?.id}`}></KolButton>);
|
|
47
|
+
};
|
|
48
|
+
|
|
43
49
|
return (
|
|
44
50
|
<>
|
|
45
51
|
<SampleDescription>
|
|
46
52
|
<p>This sample shows KolTableStateless with checkboxes for selection enabled.</p>
|
|
47
53
|
</SampleDescription>
|
|
48
54
|
|
|
49
|
-
<
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
[
|
|
54
|
-
|
|
55
|
-
|
|
55
|
+
<section className="w-full">
|
|
56
|
+
<KolTableStateless
|
|
57
|
+
_label="Table with selection checkboxes"
|
|
58
|
+
_headerCells={{
|
|
59
|
+
horizontal: [
|
|
60
|
+
[
|
|
61
|
+
{ key: 'id', label: '#ID', textAlign: 'left' },
|
|
62
|
+
{ key: 'name', label: 'Name', textAlign: 'left' },
|
|
63
|
+
{ key: 'action', label: 'Action', textAlign: 'left', render: renderButton },
|
|
64
|
+
],
|
|
56
65
|
],
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
+
}}
|
|
67
|
+
_data={DATA}
|
|
68
|
+
_selection={selection}
|
|
69
|
+
_on={{ onSelectionChange: handleSelectionChangeCallback }}
|
|
70
|
+
className="block"
|
|
71
|
+
style={{ maxWidth: '600px' }}
|
|
72
|
+
ref={kolTableStatelessRef}
|
|
73
|
+
/>
|
|
74
|
+
</section>
|
|
66
75
|
</>
|
|
67
76
|
);
|
|
68
77
|
};
|
|
@@ -11,34 +11,36 @@ export const TableStateless: FC = () => (
|
|
|
11
11
|
<p>This sample shows how KolTableStateless can be used directly, with the KolTableStateful wrapper.</p>
|
|
12
12
|
</SampleDescription>
|
|
13
13
|
|
|
14
|
-
<
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
[
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
14
|
+
<section className="w-full">
|
|
15
|
+
<KolTableStateless
|
|
16
|
+
_label="Table for demonstration purposes"
|
|
17
|
+
_headerCells={{
|
|
18
|
+
horizontal: [
|
|
19
|
+
[
|
|
20
|
+
{ key: 'left', label: 'left', textAlign: 'left', sortDirection: 'ASC' },
|
|
21
|
+
{ key: 'center', label: 'center', textAlign: 'center', sortDirection: 'DESC' },
|
|
22
|
+
{ key: 'right', label: 'right', textAlign: 'right', sortDirection: 'NOS' },
|
|
23
|
+
{ key: 'nosort', label: 'no sort option' },
|
|
24
|
+
],
|
|
23
25
|
],
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
26
|
+
vertical: [
|
|
27
|
+
[
|
|
28
|
+
{ key: 'vertical-left', label: 'left', textAlign: 'left', sortDirection: 'ASC' },
|
|
29
|
+
{ key: 'vertical-center', label: 'center', textAlign: 'center', sortDirection: 'DESC' },
|
|
30
|
+
{ key: 'vertical-right', label: 'right', textAlign: 'right', sortDirection: 'NOS' },
|
|
31
|
+
{ key: 'vertical-nosort', label: 'no sort option' },
|
|
32
|
+
],
|
|
31
33
|
],
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
|
|
34
|
+
}}
|
|
35
|
+
_data={DATA}
|
|
36
|
+
className="block"
|
|
37
|
+
style={{ maxWidth: '600px' }}
|
|
38
|
+
_on={{
|
|
39
|
+
onSort: (_event, payload) => {
|
|
40
|
+
console.log(payload);
|
|
41
|
+
},
|
|
42
|
+
}}
|
|
43
|
+
/>
|
|
44
|
+
</section>
|
|
43
45
|
</>
|
|
44
46
|
);
|
|
@@ -25,7 +25,7 @@ export const TableWithPagination: FC = () => (
|
|
|
25
25
|
<SampleDescription>
|
|
26
26
|
<p>This sample shows how KolTable can be navigated using a pagination.</p>
|
|
27
27
|
</SampleDescription>
|
|
28
|
-
<div>
|
|
28
|
+
<div className="w-full">
|
|
29
29
|
<KolTable _label="Tabellenbeschreibung" _data={DATA} _headers={HEADERS} _pagination={PAGINATION}></KolTable>
|
|
30
30
|
</div>
|
|
31
31
|
</>
|