@public-ui/sample-react 2.0.8 → 2.0.10
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/1051.js +2 -0
- package/dist/1278.js +2 -0
- package/dist/1499.js +2 -0
- package/dist/1502.js +2 -0
- package/dist/1517.js +2 -0
- package/dist/1699.js +2 -0
- package/dist/1731.js +2 -0
- package/dist/1848.js +2 -0
- package/dist/1940.js +2 -0
- package/dist/2015.js +2 -0
- package/dist/2156.js +2 -0
- package/dist/2182.js +2 -0
- package/dist/{3384.js → 2186.js} +2 -2
- package/dist/2439.js +2 -0
- package/dist/2563.js +2 -0
- package/dist/2619.js +2 -0
- package/dist/2624.js +2 -0
- package/dist/2671.js +2 -0
- package/dist/2926.js +2 -0
- package/dist/3028.js +2 -0
- package/dist/{2984.js → 3073.js} +2 -2
- package/dist/351.js +2 -0
- package/dist/3625.js +2 -0
- package/dist/4619.js +2 -0
- package/dist/{9340.js → 4627.js} +2 -2
- package/dist/4937.js +2 -0
- package/dist/5172.js +2 -0
- package/dist/528.js +2 -0
- package/dist/5342.js +2 -0
- package/dist/5431.js +2 -0
- package/dist/5784.js +2 -0
- package/dist/5896.js +2 -0
- package/dist/6114.js +2 -0
- package/dist/6329.js +2 -0
- package/dist/6357.js +2 -0
- package/dist/6511.js +2 -0
- package/dist/7086.js +2 -0
- package/dist/710.js +2 -0
- package/dist/7160.js +2 -0
- package/dist/7240.js +2 -0
- package/dist/7435.js +2 -0
- package/dist/7628.js +2 -0
- package/dist/7732.js +2 -0
- package/dist/7748.js +2 -0
- package/dist/7950.js +2 -0
- package/dist/7986.js +2 -0
- package/dist/8240.js +2 -0
- package/dist/8247.js +2 -0
- package/dist/8256.js +2 -0
- package/dist/8494.js +2 -0
- package/dist/8507.js +2 -0
- package/dist/{6476.js → 9014.js} +2 -2
- package/dist/9035.js +2 -0
- package/dist/9094.js +2 -0
- package/dist/9179.js +2 -0
- package/dist/9183.js +2 -0
- package/dist/{9224.js → 9190.js} +2 -2
- package/dist/9237.js +2 -0
- package/dist/9246.js +2 -0
- package/dist/9424.js +1 -1
- package/dist/9456.js +2 -0
- package/dist/9483.js +2 -0
- package/dist/9485.js +2 -0
- package/dist/9528.js +2 -0
- package/dist/9622.js +2 -0
- package/dist/97.js +2 -0
- package/dist/9758.js +2 -0
- package/dist/9758.js.LICENSE.txt +3 -0
- package/dist/9829.js +2 -0
- package/dist/9829.js.LICENSE.txt +3 -0
- package/dist/9918.js +2 -0
- package/dist/9918.js.LICENSE.txt +3 -0
- package/dist/{6112.js → 9993.js} +2 -2
- package/dist/9993.js.LICENSE.txt +3 -0
- package/dist/main.css +1 -1
- package/dist/main.js +1 -17750
- package/dist/main.js.LICENSE.txt +2 -2
- package/package.json +16 -16
- package/src/App.tsx +7 -6
- package/src/components/Sidebar.tsx +1 -1
- package/src/components/abbr/basic.tsx +9 -5
- package/src/components/accordion/basic.tsx +17 -11
- package/src/components/accordion/headlines.tsx +26 -20
- package/src/components/accordion/list.tsx +13 -7
- package/src/components/alert/basic.tsx +16 -9
- package/src/components/alert/html.tsx +26 -21
- package/src/components/avatar/basic.tsx +14 -9
- package/src/components/badge/basic.tsx +13 -7
- package/src/components/badge/button.tsx +19 -10
- package/src/components/breadcrumb/basic.tsx +52 -46
- package/src/components/button/access-key.tsx +22 -17
- package/src/components/button/baselined.tsx +12 -6
- package/src/components/button/basic.tsx +9 -1
- package/src/components/button/hide-label.tsx +24 -15
- package/src/components/button/icons.tsx +25 -19
- package/src/components/button/width.tsx +21 -15
- package/src/components/button-group/basic.tsx +12 -6
- package/src/components/button-link/icons.tsx +36 -30
- package/src/components/button-link/image.tsx +13 -7
- package/src/components/card/basic.tsx +9 -3
- package/src/components/card/confirm.tsx +19 -13
- package/src/components/card/flex.tsx +36 -27
- package/src/components/card/routes.ts +2 -0
- package/src/components/card/selection.tsx +53 -47
- package/src/components/details/basic.tsx +26 -17
- package/src/components/handout/basic.tsx +59 -28
- package/src/components/heading/badged.tsx +38 -32
- package/src/components/heading/basic.tsx +14 -8
- package/src/components/heading/paragraph.tsx +47 -38
- package/src/components/icon/basic.tsx +16 -10
- package/src/components/image/basic.tsx +9 -2
- package/src/components/indented-text/basic.tsx +23 -17
- package/src/components/input-checkbox/basic.tsx +13 -1
- package/src/components/input-checkbox/button.tsx +14 -1
- package/src/components/input-checkbox/partials/cases.tsx +1 -1
- package/src/components/input-checkbox/switch.tsx +16 -3
- package/src/components/input-color/basic.tsx +12 -1
- package/src/components/input-color/partials/cases.tsx +8 -2
- package/src/components/input-date/basic.tsx +14 -1
- package/src/components/input-date/partials/cases.tsx +9 -1
- package/src/components/input-email/basic.tsx +9 -1
- package/src/components/input-email/partials/cases.tsx +2 -2
- package/src/components/input-file/basic.tsx +12 -1
- package/src/components/input-file/partials/cases.tsx +2 -2
- package/src/components/input-number/partials/cases.tsx +1 -1
- package/src/components/input-password/basic.tsx +9 -1
- package/src/components/input-password/partials/cases.tsx +2 -2
- package/src/components/input-password/show-password.tsx +28 -19
- package/src/components/input-radio/basic.tsx +9 -1
- package/src/components/input-radio/objectValue.tsx +37 -0
- package/src/components/input-radio/partials/cases.tsx +2 -2
- package/src/components/input-radio/routes.ts +2 -0
- package/src/components/input-radio/select.tsx +9 -3
- package/src/components/input-range/basic.tsx +9 -1
- package/src/components/input-range/partials/cases.tsx +12 -2
- package/src/components/input-text/basic.tsx +9 -1
- package/src/components/input-text/blur.tsx +17 -12
- package/src/components/input-text/focus.tsx +14 -8
- package/src/components/input-text/hide-errors.tsx +3 -3
- package/src/components/input-text/partials/cases.tsx +4 -4
- package/src/components/link/basic.tsx +25 -19
- package/src/components/link/icons.tsx +40 -34
- package/src/components/link/image.tsx +18 -12
- package/src/components/link/target.tsx +14 -8
- package/src/components/link-button/basic.tsx +14 -8
- package/src/components/link-group/basic.tsx +9 -1
- package/src/components/link-group/horizontal.tsx +9 -1
- package/src/components/logo/basic.tsx +9 -1
- package/src/components/modal/basic.tsx +37 -28
- package/src/components/nav/basic.tsx +7 -1
- package/src/components/nav/horizontal.tsx +12 -3
- package/src/components/nav/links.ts +18 -2
- package/src/components/pagination/basic.tsx +24 -16
- package/src/components/progress/basic.tsx +10 -4
- package/src/components/quote/basic.tsx +7 -1
- package/src/components/quote/block.tsx +15 -6
- package/src/components/select/basic.tsx +12 -1
- package/src/components/select/partials/cases.tsx +10 -2
- package/src/components/spin/basic.tsx +9 -1
- package/src/components/spin/custom.tsx +12 -3
- package/src/components/spin/cycle.tsx +9 -1
- package/src/components/split-button/basic.tsx +18 -9
- package/src/components/table/badge-size.tsx +12 -1
- package/src/components/table/sort-data.tsx +14 -4
- package/src/components/table/with-pagination.tsx +12 -3
- package/src/components/tabs/basic.tsx +18 -12
- package/src/components/tabs/icons-only.tsx +12 -6
- package/src/components/textarea/adjust-height.tsx +14 -8
- package/src/components/textarea/basic.tsx +9 -1
- package/src/components/textarea/counter.tsx +13 -1
- package/src/components/textarea/disabled.tsx +14 -3
- package/src/components/textarea/partials/cases.tsx +1 -1
- package/src/components/textarea/placeholder.tsx +9 -3
- package/src/components/textarea/readonly.tsx +14 -3
- package/src/components/textarea/resize.tsx +13 -7
- package/src/components/textarea/rows.tsx +9 -3
- package/src/components/toast/basic.tsx +18 -12
- package/src/components/version/basic.tsx +9 -2
- package/src/components/version/context.tsx +11 -5
- package/src/react.main.tsx +44 -18
- package/src/scenarios/appointment-form/AvailableAppointmentsForm.tsx +11 -4
- package/src/scenarios/appointment-form/DistrictForm.tsx +9 -2
- package/src/scenarios/appointment-form/PersonalInformationForm.tsx +8 -2
- package/src/scenarios/appointment-form/formUtils.ts +6 -0
- package/src/scenarios/routes.ts +0 -2
- package/src/scenarios/static-form.tsx +15 -0
- package/src/shares/store.ts +5 -5
- package/src/shares/theme.ts +6 -5
- package/src/shares/types.ts +1 -1
- package/webpack.config.js +1 -0
- package/dist/104.js +0 -2
- package/dist/1296.js +0 -2
- package/dist/1461.js +0 -2
- package/dist/1684.js +0 -2
- package/dist/1685.js +0 -2
- package/dist/1888.js +0 -2
- package/dist/2120.js +0 -2
- package/dist/2240.js +0 -2
- package/dist/2364.js +0 -2
- package/dist/2392.js +0 -2
- package/dist/2444.js +0 -2
- package/dist/2628.js +0 -2
- package/dist/2740.js +0 -2
- package/dist/2764.js +0 -2
- package/dist/2782.js +0 -2
- package/dist/2812.js +0 -2
- package/dist/3200.js +0 -2
- package/dist/3204.js +0 -2
- package/dist/352.js +0 -2
- package/dist/3564.js +0 -2
- package/dist/3920.js +0 -2
- package/dist/4064.js +0 -2
- package/dist/4136.js +0 -1
- package/dist/4544.js +0 -2
- package/dist/4728.js +0 -2
- package/dist/4915.js +0 -2
- package/dist/4988.js +0 -2
- package/dist/5376.js +0 -2
- package/dist/5456.js +0 -2
- package/dist/5615.js +0 -2
- package/dist/5628.js +0 -2
- package/dist/5744.js +0 -2
- package/dist/5768.js +0 -2
- package/dist/5839.js +0 -2
- package/dist/5956.js +0 -2
- package/dist/5972.js +0 -2
- package/dist/6040.js +0 -2
- package/dist/7192.js +0 -2
- package/dist/72.js +0 -2
- package/dist/7312.js +0 -2
- package/dist/736.js +0 -2
- package/dist/7496.js +0 -2
- package/dist/7508.js +0 -2
- package/dist/7596.js +0 -2
- package/dist/7712.js +0 -2
- package/dist/7804.js +0 -2
- package/dist/7808.js +0 -2
- package/dist/8188.js +0 -2
- package/dist/8232.js +0 -2
- package/dist/8248.js +0 -2
- package/dist/828.js +0 -2
- package/dist/8476.js +0 -2
- package/dist/8524.js +0 -2
- package/dist/9072.js +0 -2
- package/dist/9088.js +0 -2
- package/dist/9200.js +0 -2
- package/dist/9404.js +0 -2
- package/dist/9680.js +0 -2
- package/dist/9888.js +0 -2
- package/dist/9984.js +0 -2
- package/src/components/abbr/basic.html +0 -6
- package/src/scenarios/complex-form/common/form/component.tsx +0 -25
- package/src/scenarios/complex-form/common/form/types.ts +0 -13
- package/src/scenarios/complex-form/component.tsx +0 -163
- package/src/scenarios/complex-form/kopfdaten/component.tsx +0 -51
- package/src/scenarios/complex-form/location/component.tsx +0 -17
- package/src/scenarios/complex-form/location/location.form.ts +0 -22
- package/src/scenarios/complex-form/schedule/component.tsx +0 -17
- package/src/scenarios/complex-form/schedule/schedule.form.ts +0 -34
- /package/dist/{104.js.LICENSE.txt → 1051.js.LICENSE.txt} +0 -0
- /package/dist/{1296.js.LICENSE.txt → 1278.js.LICENSE.txt} +0 -0
- /package/dist/{1461.js.LICENSE.txt → 1499.js.LICENSE.txt} +0 -0
- /package/dist/{1684.js.LICENSE.txt → 1502.js.LICENSE.txt} +0 -0
- /package/dist/{1685.js.LICENSE.txt → 1517.js.LICENSE.txt} +0 -0
- /package/dist/{1888.js.LICENSE.txt → 1699.js.LICENSE.txt} +0 -0
- /package/dist/{2120.js.LICENSE.txt → 1731.js.LICENSE.txt} +0 -0
- /package/dist/{2240.js.LICENSE.txt → 1848.js.LICENSE.txt} +0 -0
- /package/dist/{2364.js.LICENSE.txt → 1940.js.LICENSE.txt} +0 -0
- /package/dist/{2392.js.LICENSE.txt → 2015.js.LICENSE.txt} +0 -0
- /package/dist/{2444.js.LICENSE.txt → 2156.js.LICENSE.txt} +0 -0
- /package/dist/{2628.js.LICENSE.txt → 2182.js.LICENSE.txt} +0 -0
- /package/dist/{2740.js.LICENSE.txt → 2186.js.LICENSE.txt} +0 -0
- /package/dist/{2764.js.LICENSE.txt → 2439.js.LICENSE.txt} +0 -0
- /package/dist/{2782.js.LICENSE.txt → 2563.js.LICENSE.txt} +0 -0
- /package/dist/{2812.js.LICENSE.txt → 2619.js.LICENSE.txt} +0 -0
- /package/dist/{2984.js.LICENSE.txt → 2624.js.LICENSE.txt} +0 -0
- /package/dist/{3200.js.LICENSE.txt → 2671.js.LICENSE.txt} +0 -0
- /package/dist/{3204.js.LICENSE.txt → 2926.js.LICENSE.txt} +0 -0
- /package/dist/{3384.js.LICENSE.txt → 3028.js.LICENSE.txt} +0 -0
- /package/dist/{352.js.LICENSE.txt → 3073.js.LICENSE.txt} +0 -0
- /package/dist/{3564.js.LICENSE.txt → 351.js.LICENSE.txt} +0 -0
- /package/dist/{3920.js.LICENSE.txt → 3625.js.LICENSE.txt} +0 -0
- /package/dist/{4064.js.LICENSE.txt → 4619.js.LICENSE.txt} +0 -0
- /package/dist/{4544.js.LICENSE.txt → 4627.js.LICENSE.txt} +0 -0
- /package/dist/{4728.js.LICENSE.txt → 4937.js.LICENSE.txt} +0 -0
- /package/dist/{4915.js.LICENSE.txt → 5172.js.LICENSE.txt} +0 -0
- /package/dist/{4988.js.LICENSE.txt → 528.js.LICENSE.txt} +0 -0
- /package/dist/{5376.js.LICENSE.txt → 5342.js.LICENSE.txt} +0 -0
- /package/dist/{5456.js.LICENSE.txt → 5431.js.LICENSE.txt} +0 -0
- /package/dist/{5615.js.LICENSE.txt → 5784.js.LICENSE.txt} +0 -0
- /package/dist/{5628.js.LICENSE.txt → 5896.js.LICENSE.txt} +0 -0
- /package/dist/{5744.js.LICENSE.txt → 6114.js.LICENSE.txt} +0 -0
- /package/dist/{5768.js.LICENSE.txt → 6329.js.LICENSE.txt} +0 -0
- /package/dist/{5839.js.LICENSE.txt → 6357.js.LICENSE.txt} +0 -0
- /package/dist/{5956.js.LICENSE.txt → 6511.js.LICENSE.txt} +0 -0
- /package/dist/{5972.js.LICENSE.txt → 7086.js.LICENSE.txt} +0 -0
- /package/dist/{6040.js.LICENSE.txt → 710.js.LICENSE.txt} +0 -0
- /package/dist/{6112.js.LICENSE.txt → 7160.js.LICENSE.txt} +0 -0
- /package/dist/{6476.js.LICENSE.txt → 7240.js.LICENSE.txt} +0 -0
- /package/dist/{7192.js.LICENSE.txt → 7435.js.LICENSE.txt} +0 -0
- /package/dist/{72.js.LICENSE.txt → 7628.js.LICENSE.txt} +0 -0
- /package/dist/{7312.js.LICENSE.txt → 7732.js.LICENSE.txt} +0 -0
- /package/dist/{736.js.LICENSE.txt → 7748.js.LICENSE.txt} +0 -0
- /package/dist/{7496.js.LICENSE.txt → 7950.js.LICENSE.txt} +0 -0
- /package/dist/{7508.js.LICENSE.txt → 7986.js.LICENSE.txt} +0 -0
- /package/dist/{7596.js.LICENSE.txt → 8240.js.LICENSE.txt} +0 -0
- /package/dist/{7712.js.LICENSE.txt → 8247.js.LICENSE.txt} +0 -0
- /package/dist/{7804.js.LICENSE.txt → 8256.js.LICENSE.txt} +0 -0
- /package/dist/{7808.js.LICENSE.txt → 8494.js.LICENSE.txt} +0 -0
- /package/dist/{8188.js.LICENSE.txt → 8507.js.LICENSE.txt} +0 -0
- /package/dist/{8232.js.LICENSE.txt → 9014.js.LICENSE.txt} +0 -0
- /package/dist/{8248.js.LICENSE.txt → 9035.js.LICENSE.txt} +0 -0
- /package/dist/{828.js.LICENSE.txt → 9094.js.LICENSE.txt} +0 -0
- /package/dist/{8476.js.LICENSE.txt → 9179.js.LICENSE.txt} +0 -0
- /package/dist/{8524.js.LICENSE.txt → 9183.js.LICENSE.txt} +0 -0
- /package/dist/{9072.js.LICENSE.txt → 9190.js.LICENSE.txt} +0 -0
- /package/dist/{9088.js.LICENSE.txt → 9237.js.LICENSE.txt} +0 -0
- /package/dist/{9200.js.LICENSE.txt → 9246.js.LICENSE.txt} +0 -0
- /package/dist/{9224.js.LICENSE.txt → 9456.js.LICENSE.txt} +0 -0
- /package/dist/{9340.js.LICENSE.txt → 9483.js.LICENSE.txt} +0 -0
- /package/dist/{9404.js.LICENSE.txt → 9485.js.LICENSE.txt} +0 -0
- /package/dist/{9680.js.LICENSE.txt → 9528.js.LICENSE.txt} +0 -0
- /package/dist/{9888.js.LICENSE.txt → 9622.js.LICENSE.txt} +0 -0
- /package/dist/{9984.js.LICENSE.txt → 97.js.LICENSE.txt} +0 -0
|
@@ -2,11 +2,12 @@ import React from 'react';
|
|
|
2
2
|
|
|
3
3
|
import { ToasterService } from '@public-ui/components';
|
|
4
4
|
import { KolSplitButton } from '@public-ui/react';
|
|
5
|
+
import { SampleDescription } from '../SampleDescription';
|
|
5
6
|
|
|
6
7
|
import type { FC } from 'react';
|
|
7
|
-
const toaster = ToasterService.getInstance(document);
|
|
8
8
|
|
|
9
9
|
export const SplitButtonBasic: FC = () => {
|
|
10
|
+
const toaster = ToasterService.getInstance(document);
|
|
10
11
|
const handleButtonClick = () => {
|
|
11
12
|
void toaster.enqueue({
|
|
12
13
|
description: 'The Button has been clicked.',
|
|
@@ -16,13 +17,21 @@ export const SplitButtonBasic: FC = () => {
|
|
|
16
17
|
};
|
|
17
18
|
|
|
18
19
|
return (
|
|
19
|
-
|
|
20
|
-
<
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
</
|
|
26
|
-
|
|
20
|
+
<>
|
|
21
|
+
<SampleDescription>
|
|
22
|
+
<p>
|
|
23
|
+
Hier sind zwei Dropdownmenüs. Das obere Beispiel lässt sich nur durch drücken des Pfeils öffnen. Ansonsten erscheint eine Meldung. Beim unteren
|
|
24
|
+
Beispiel kann durch drücken auf das Icon und des Pfeils das Menü geöffnet und geschlossen werden.
|
|
25
|
+
</p>
|
|
26
|
+
</SampleDescription>
|
|
27
|
+
<div className="flex gap-4">
|
|
28
|
+
<KolSplitButton _label="Nur der Pfeil öffnet" _on={{ onClick: handleButtonClick }}>
|
|
29
|
+
Dropdown-Inhalt
|
|
30
|
+
</KolSplitButton>
|
|
31
|
+
<KolSplitButton _label="Schalter ohne sichtbares Label" _hideLabel _icons="codicon codicon-git-pull-request">
|
|
32
|
+
Dropdown-Inhalt
|
|
33
|
+
</KolSplitButton>
|
|
34
|
+
</div>
|
|
35
|
+
</>
|
|
27
36
|
);
|
|
28
37
|
};
|
|
@@ -5,6 +5,7 @@ import { KolBadge, KolTable } from '@public-ui/react';
|
|
|
5
5
|
|
|
6
6
|
import { getRoot } from '../../shares/react-roots';
|
|
7
7
|
import { DATA } from './test-data';
|
|
8
|
+
import { SampleDescription } from '../SampleDescription';
|
|
8
9
|
|
|
9
10
|
import type { KoliBriTableHeaders } from '@public-ui/components';
|
|
10
11
|
import type { Data } from './test-data';
|
|
@@ -51,4 +52,14 @@ const HEADERS: KoliBriTableHeaders = {
|
|
|
51
52
|
],
|
|
52
53
|
};
|
|
53
54
|
|
|
54
|
-
export const TableBadgeSize: FC = () =>
|
|
55
|
+
export const TableBadgeSize: FC = () => (
|
|
56
|
+
<>
|
|
57
|
+
<SampleDescription>
|
|
58
|
+
<p>
|
|
59
|
+
Hier ist eine Tabelle, die durch anklicken des Knopfes sortiert werden kann. Entweder nach der Reihenfolge, nach dem ältesten Datum oder nach dem
|
|
60
|
+
jüngsten Datum.
|
|
61
|
+
</p>
|
|
62
|
+
</SampleDescription>
|
|
63
|
+
<KolTable _label="Sort a date column" _data={DATA} _headers={HEADERS} className="block min-w-75em" />
|
|
64
|
+
</>
|
|
65
|
+
);
|
|
@@ -2,11 +2,11 @@ import type { FC } from 'react';
|
|
|
2
2
|
import React from 'react';
|
|
3
3
|
|
|
4
4
|
import { KolTable } from '@public-ui/react';
|
|
5
|
-
|
|
6
|
-
import { DATA } from './test-data';
|
|
7
|
-
|
|
8
5
|
import type { KoliBriTableHeaders } from '@public-ui/components';
|
|
6
|
+
import { DATA } from './test-data';
|
|
9
7
|
import type { Data } from './test-data';
|
|
8
|
+
import { SampleDescription } from '../SampleDescription';
|
|
9
|
+
|
|
10
10
|
const DATE_FORMATTER = Intl.DateTimeFormat('de-DE', {
|
|
11
11
|
day: '2-digit',
|
|
12
12
|
month: '2-digit',
|
|
@@ -33,4 +33,14 @@ const HEADERS: KoliBriTableHeaders = {
|
|
|
33
33
|
],
|
|
34
34
|
};
|
|
35
35
|
|
|
36
|
-
export const TableSortData: FC = () =>
|
|
36
|
+
export const TableSortData: FC = () => (
|
|
37
|
+
<>
|
|
38
|
+
<SampleDescription>
|
|
39
|
+
<p>
|
|
40
|
+
Hier ist eine Tabelle, die durch anklicken des Knopfes sortiert werden kann. Entweder nach der Reihenfolge, nach dem ältesten Datum oder nach dem
|
|
41
|
+
jüngsten Datum.
|
|
42
|
+
</p>
|
|
43
|
+
</SampleDescription>
|
|
44
|
+
<KolTable _label="Sort a date column" _data={DATA} _headers={HEADERS} className="block" />
|
|
45
|
+
</>
|
|
46
|
+
);
|
|
@@ -4,6 +4,7 @@ import React from 'react';
|
|
|
4
4
|
import { KolTable } from '@public-ui/react';
|
|
5
5
|
|
|
6
6
|
import { DATE_FORMATTER } from './formatter';
|
|
7
|
+
import { SampleDescription } from '../SampleDescription';
|
|
7
8
|
import { DATA } from './test-data';
|
|
8
9
|
|
|
9
10
|
import type { KoliBriTableHeaders, KoliBriTablePaginationProps } from '@public-ui/components';
|
|
@@ -19,7 +20,15 @@ const HEADERS: KoliBriTableHeaders = {
|
|
|
19
20
|
const PAGINATION: KoliBriTablePaginationProps = { _page: 2 };
|
|
20
21
|
|
|
21
22
|
export const TableWithPagination: FC = () => (
|
|
22
|
-
|
|
23
|
-
<
|
|
24
|
-
|
|
23
|
+
<>
|
|
24
|
+
<SampleDescription>
|
|
25
|
+
<p>
|
|
26
|
+
Durch das Navigieren der Seitenzahlen unten kann die Tabelle umgeblättert werden. Stattdessen kann auch die komplette Tabelle mit Änderung der Einträge
|
|
27
|
+
pro Seite angezeigt werden.
|
|
28
|
+
</p>
|
|
29
|
+
</SampleDescription>
|
|
30
|
+
<div>
|
|
31
|
+
<KolTable _label="Tabellenbeschreibung" _data={DATA} _headers={HEADERS} _pagination={PAGINATION}></KolTable>
|
|
32
|
+
</div>
|
|
33
|
+
</>
|
|
25
34
|
);
|
|
@@ -2,6 +2,7 @@ import type { FC } from 'react';
|
|
|
2
2
|
import React from 'react';
|
|
3
3
|
|
|
4
4
|
import { KolTabs } from '@public-ui/react';
|
|
5
|
+
import { SampleDescription } from '../SampleDescription';
|
|
5
6
|
|
|
6
7
|
const tabs = [
|
|
7
8
|
{
|
|
@@ -30,18 +31,23 @@ const tabsWithoutIcons = tabs.map((tab) => ({
|
|
|
30
31
|
|
|
31
32
|
export const TabsBasic: FC = () => (
|
|
32
33
|
<>
|
|
33
|
-
<
|
|
34
|
-
<
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
<
|
|
38
|
-
|
|
34
|
+
<SampleDescription>
|
|
35
|
+
<p>Hier sind verschiedene Varianten von Tabs. Nur der Inhalt eines Tabs wird in jeder Zeile angezeigt.</p>
|
|
36
|
+
</SampleDescription>
|
|
37
|
+
<>
|
|
38
|
+
<KolTabs _tabs={tabsWithoutIcons} _label="Regular tabs">
|
|
39
|
+
<div slot="tab-0">Inhalte von Tab 1</div>
|
|
40
|
+
<div slot="tab-1">Inhalte von Tab 2</div>
|
|
41
|
+
<div slot="tab-2">Inhalte von Tab 3</div>
|
|
42
|
+
<div slot="tab-3">Inhalte von Tab 4</div>
|
|
43
|
+
</KolTabs>
|
|
39
44
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
45
|
+
<KolTabs _tabs={tabs} className="mt-4" _label="Tabs with icons">
|
|
46
|
+
<div slot="tab-0">Inhalte von Tab 1</div>
|
|
47
|
+
<div slot="tab-1">Inhalte von Tab 2</div>
|
|
48
|
+
<div slot="tab-2">Inhalte von Tab 3</div>
|
|
49
|
+
<div slot="tab-3">Inhalte von Tab 4</div>
|
|
50
|
+
</KolTabs>
|
|
51
|
+
</>
|
|
46
52
|
</>
|
|
47
53
|
);
|
|
@@ -2,6 +2,7 @@ import type { FC } from 'react';
|
|
|
2
2
|
import React from 'react';
|
|
3
3
|
|
|
4
4
|
import { KolTabs } from '@public-ui/react';
|
|
5
|
+
import { SampleDescription } from '../SampleDescription';
|
|
5
6
|
|
|
6
7
|
const tabs = [
|
|
7
8
|
{
|
|
@@ -27,10 +28,15 @@ const tabs = [
|
|
|
27
28
|
},
|
|
28
29
|
];
|
|
29
30
|
export const TabsIconsOnly: FC = () => (
|
|
30
|
-
|
|
31
|
-
<
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
<
|
|
35
|
-
|
|
31
|
+
<>
|
|
32
|
+
<SampleDescription>
|
|
33
|
+
<p>Hier sind verschiedene Varianten von Tabs mit Icons. Nur der Inhalt eines Tabs wird gleichzeitig angezeigt.</p>
|
|
34
|
+
</SampleDescription>
|
|
35
|
+
<KolTabs _tabs={tabs}>
|
|
36
|
+
<div slot="tab-0">Inhalte von Tab 1</div>
|
|
37
|
+
<div slot="tab-1">Inhalte von Tab 2</div>
|
|
38
|
+
<div slot="tab-2">Inhalte von Tab 3</div>
|
|
39
|
+
<div slot="tab-3">Inhalte von Tab 4</div>
|
|
40
|
+
</KolTabs>
|
|
41
|
+
</>
|
|
36
42
|
);
|
|
@@ -3,6 +3,7 @@ import React from 'react';
|
|
|
3
3
|
import { KolForm, KolTextarea } from '@public-ui/react';
|
|
4
4
|
|
|
5
5
|
import type { FC } from 'react';
|
|
6
|
+
import { SampleDescription } from '../SampleDescription';
|
|
6
7
|
|
|
7
8
|
const VALUE = `Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore
|
|
8
9
|
magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd
|
|
@@ -12,12 +13,17 @@ et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea t
|
|
|
12
13
|
sit amet.`;
|
|
13
14
|
|
|
14
15
|
export const TextareaAdjustHeight: FC = () => (
|
|
15
|
-
|
|
16
|
-
<
|
|
17
|
-
<
|
|
18
|
-
</
|
|
19
|
-
<
|
|
20
|
-
<
|
|
21
|
-
|
|
22
|
-
|
|
16
|
+
<>
|
|
17
|
+
<SampleDescription>
|
|
18
|
+
<p>Hier sind zwei Freitextfelder. Im oberen kann die Größe des Textfelds angepasst werden, im unteren nicht.</p>
|
|
19
|
+
</SampleDescription>
|
|
20
|
+
<KolForm className="row">
|
|
21
|
+
<div className="col-sm-6">
|
|
22
|
+
<KolTextarea _adjustHeight={true} _resize="vertical" _value={VALUE} _label="Texteingabe (horizontal)" />
|
|
23
|
+
</div>
|
|
24
|
+
<div className="col-sm-6">
|
|
25
|
+
<KolTextarea _adjustHeight={true} _resize="none" _value={VALUE} _label="Texteingabe (none)" />
|
|
26
|
+
</div>
|
|
27
|
+
</KolForm>
|
|
28
|
+
</>
|
|
23
29
|
);
|
|
@@ -3,5 +3,13 @@ import React from 'react';
|
|
|
3
3
|
|
|
4
4
|
import { FormWrap } from '../FormWrap';
|
|
5
5
|
import { TextareaVariants } from './partials/variants';
|
|
6
|
+
import { SampleDescription } from '../SampleDescription';
|
|
6
7
|
|
|
7
|
-
export const TextareaBasic: FC = () =>
|
|
8
|
+
export const TextareaBasic: FC = () => (
|
|
9
|
+
<>
|
|
10
|
+
<SampleDescription>
|
|
11
|
+
<p>Hier sind Freitextfelder die mithilfe des Reglers unten Rechts im jeweiligen Feld in ihrer Größe angepasst werden können.</p>
|
|
12
|
+
</SampleDescription>
|
|
13
|
+
<FormWrap RefComponent={TextareaVariants} />
|
|
14
|
+
</>
|
|
15
|
+
);
|
|
@@ -2,7 +2,19 @@ import type { FC } from 'react';
|
|
|
2
2
|
import React from 'react';
|
|
3
3
|
|
|
4
4
|
import { KolTextarea } from '@public-ui/react';
|
|
5
|
+
import { SampleDescription } from '../SampleDescription';
|
|
5
6
|
|
|
6
7
|
export const TextareaCounter: FC = () => (
|
|
7
|
-
|
|
8
|
+
<>
|
|
9
|
+
<SampleDescription>
|
|
10
|
+
<p>Hier ist ein Beispiel für eine Freitextfeld mit Zeichenzähler.</p>
|
|
11
|
+
</SampleDescription>
|
|
12
|
+
<KolTextarea
|
|
13
|
+
_hasCounter={true}
|
|
14
|
+
_label="Textara mit Counter und Hint und Fehler"
|
|
15
|
+
_msg={{ _type: 'error', _description: 'oh no' }}
|
|
16
|
+
_hint={'Hinweis'}
|
|
17
|
+
_touched
|
|
18
|
+
/>
|
|
19
|
+
</>
|
|
8
20
|
);
|
|
@@ -3,9 +3,20 @@ import React from 'react';
|
|
|
3
3
|
import { KolForm, KolTextarea } from '@public-ui/react';
|
|
4
4
|
|
|
5
5
|
import type { FC } from 'react';
|
|
6
|
+
import { SampleDescription } from '../SampleDescription';
|
|
6
7
|
|
|
7
8
|
export const TextareaDisabled: FC = () => (
|
|
8
|
-
|
|
9
|
-
<
|
|
10
|
-
|
|
9
|
+
<>
|
|
10
|
+
<SampleDescription>
|
|
11
|
+
<p>Hier ist ein Beispiel für ein deaktiviertes Textfeld.</p>
|
|
12
|
+
</SampleDescription>
|
|
13
|
+
<KolForm>
|
|
14
|
+
<KolTextarea
|
|
15
|
+
_disabled
|
|
16
|
+
_msg={{ _type: 'error', _description: 'Es ist ein Fehler aufgetreten' }}
|
|
17
|
+
_value="Kleiner Text im Eingabefeld ..."
|
|
18
|
+
_label="Texteingabe"
|
|
19
|
+
/>
|
|
20
|
+
</KolForm>
|
|
21
|
+
</>
|
|
11
22
|
);
|
|
@@ -8,7 +8,7 @@ import type { Components } from '@public-ui/components';
|
|
|
8
8
|
export const TextareaCases = forwardRef<HTMLKolTextareaElement, Components.KolTextarea>(function TextareaCases(props, ref) {
|
|
9
9
|
return (
|
|
10
10
|
<div className="grid gap-4">
|
|
11
|
-
<KolTextarea {...props}
|
|
11
|
+
<KolTextarea {...props} _msg={{ _type: 'error', _description: ERROR_MSG }} _label="Text" _touched />
|
|
12
12
|
<KolTextarea {...props} ref={ref} _accessKey="T" _label="Text (3 rows)" _rows={3} />
|
|
13
13
|
</div>
|
|
14
14
|
);
|
|
@@ -3,9 +3,15 @@ import React from 'react';
|
|
|
3
3
|
import { KolForm, KolTextarea } from '@public-ui/react';
|
|
4
4
|
|
|
5
5
|
import type { FC } from 'react';
|
|
6
|
+
import { SampleDescription } from '../SampleDescription';
|
|
6
7
|
|
|
7
8
|
export const TextareaPlaceholder: FC = () => (
|
|
8
|
-
|
|
9
|
-
<
|
|
10
|
-
|
|
9
|
+
<>
|
|
10
|
+
<SampleDescription>
|
|
11
|
+
<p>Hier ist ein Beispiel für ein Freitextfeld mit Platzhaltertext.</p>
|
|
12
|
+
</SampleDescription>
|
|
13
|
+
<KolForm>
|
|
14
|
+
<KolTextarea _placeholder="Hier steht ein Platzhaltertext" _label="Texteingabe" />
|
|
15
|
+
</KolForm>
|
|
16
|
+
</>
|
|
11
17
|
);
|
|
@@ -3,9 +3,20 @@ import React from 'react';
|
|
|
3
3
|
import { KolForm, KolTextarea } from '@public-ui/react';
|
|
4
4
|
|
|
5
5
|
import type { FC } from 'react';
|
|
6
|
+
import { SampleDescription } from '../SampleDescription';
|
|
6
7
|
|
|
7
8
|
export const TextareaReadOnly: FC = () => (
|
|
8
|
-
|
|
9
|
-
<
|
|
10
|
-
|
|
9
|
+
<>
|
|
10
|
+
<SampleDescription>
|
|
11
|
+
<p>Hier ist ein Beispiel für ein Textfeld, in das nicht geschrieben werden kann.</p>
|
|
12
|
+
</SampleDescription>
|
|
13
|
+
<KolForm>
|
|
14
|
+
<KolTextarea
|
|
15
|
+
_msg={{ _type: 'error', _description: 'Es ist ein Fehler aufgetreten' }}
|
|
16
|
+
_readOnly
|
|
17
|
+
_value="Kleiner Text im Eingabefeld ..."
|
|
18
|
+
_label="Texteingabe"
|
|
19
|
+
/>
|
|
20
|
+
</KolForm>
|
|
21
|
+
</>
|
|
11
22
|
);
|
|
@@ -3,12 +3,18 @@ import React from 'react';
|
|
|
3
3
|
import { KolForm, KolTextarea } from '@public-ui/react';
|
|
4
4
|
|
|
5
5
|
import type { FC } from 'react';
|
|
6
|
-
|
|
6
|
+
import { SampleDescription } from '../SampleDescription';
|
|
7
|
+
//Umrandung im Reactsample wird nicht angepasst bei Anpassung des Textfelds. Bug?.
|
|
7
8
|
export const TextareaResize: FC = () => (
|
|
8
|
-
|
|
9
|
-
<
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
<
|
|
13
|
-
|
|
9
|
+
<>
|
|
10
|
+
<SampleDescription>
|
|
11
|
+
<p>Diese Freitextfelder können in die beschriebenen Richtungen angepasst werden. Die Umrandung ändert sich dabei nicht.</p>
|
|
12
|
+
</SampleDescription>
|
|
13
|
+
<KolForm className="grid gap-4">
|
|
14
|
+
<KolTextarea _resize="both" _label="Texteingabe (both)" />
|
|
15
|
+
<KolTextarea _resize="vertical" _label="Texteingabe (vertical)" />
|
|
16
|
+
<KolTextarea _resize="horizontal" _label="Texteingabe (horizontal)" />
|
|
17
|
+
<KolTextarea _resize="none" _label="Texteingabe (none)" />
|
|
18
|
+
</KolForm>
|
|
19
|
+
</>
|
|
14
20
|
);
|
|
@@ -3,9 +3,15 @@ import React from 'react';
|
|
|
3
3
|
import { KolForm, KolTextarea } from '@public-ui/react';
|
|
4
4
|
|
|
5
5
|
import type { FC } from 'react';
|
|
6
|
+
import { SampleDescription } from '../SampleDescription';
|
|
6
7
|
|
|
7
8
|
export const TextareaRows: FC = () => (
|
|
8
|
-
|
|
9
|
-
<
|
|
10
|
-
|
|
9
|
+
<>
|
|
10
|
+
<SampleDescription>
|
|
11
|
+
<p>Hier verstehe ich es nicht. Die Rows sind nicht wie erwartet limitiert.</p>
|
|
12
|
+
</SampleDescription>
|
|
13
|
+
<KolForm>
|
|
14
|
+
<KolTextarea _rows={10} _label="Texteingabe" />
|
|
15
|
+
</KolForm>
|
|
16
|
+
</>
|
|
11
17
|
);
|
|
@@ -4,11 +4,12 @@ import { ToasterService } from '@public-ui/components';
|
|
|
4
4
|
import { KolButton } from '@public-ui/react';
|
|
5
5
|
|
|
6
6
|
import { getRoot } from '../../shares/react-roots';
|
|
7
|
+
import { SampleDescription } from '../SampleDescription';
|
|
7
8
|
|
|
8
9
|
import type { FC } from 'react';
|
|
9
|
-
const toaster = ToasterService.getInstance(document);
|
|
10
10
|
|
|
11
11
|
export const ToastBasic: FC = () => {
|
|
12
|
+
const toaster = ToasterService.getInstance(document);
|
|
12
13
|
const handleButtonClickSimple = () => {
|
|
13
14
|
void toaster.enqueue({
|
|
14
15
|
description: 'Toasty',
|
|
@@ -65,16 +66,21 @@ export const ToastBasic: FC = () => {
|
|
|
65
66
|
};
|
|
66
67
|
|
|
67
68
|
return (
|
|
68
|
-
|
|
69
|
-
<
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
<
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
69
|
+
<>
|
|
70
|
+
<SampleDescription>
|
|
71
|
+
<p>Hier ist ein Beispiel für verschiedene Toasts, die beim anklicken verschiedene Popups generieren. Der untere schließt alle geöffneten Toasts.</p>
|
|
72
|
+
</SampleDescription>
|
|
73
|
+
<div>
|
|
74
|
+
<KolButton _label="Show simple toast" _on={{ onClick: handleButtonClickSimple }}></KolButton>{' '}
|
|
75
|
+
<KolButton _label="Show toast with alert variant 'msg'" _on={{ onClick: handleButtonClickVariantMessage }}></KolButton>{' '}
|
|
76
|
+
<KolButton _label="Show complex toast" _on={{ onClick: handleButtonClickComplex }}></KolButton>
|
|
77
|
+
<br />
|
|
78
|
+
<br />
|
|
79
|
+
<KolButton _label="Show toast and close after 2 seconds" _on={{ onClick: () => void handleButtonClickOpenAndClose() }}></KolButton>
|
|
80
|
+
<br />
|
|
81
|
+
<br />
|
|
82
|
+
<KolButton _label="Close all toasts" _on={{ onClick: closeAll }}></KolButton>
|
|
83
|
+
</div>
|
|
84
|
+
</>
|
|
79
85
|
);
|
|
80
86
|
};
|
|
@@ -3,5 +3,12 @@ import React from 'react';
|
|
|
3
3
|
import { KolVersion } from '@public-ui/react';
|
|
4
4
|
|
|
5
5
|
import type { FC } from 'react';
|
|
6
|
-
|
|
7
|
-
export const VersionBasic: FC = () =>
|
|
6
|
+
import { SampleDescription } from '../SampleDescription';
|
|
7
|
+
export const VersionBasic: FC = () => (
|
|
8
|
+
<>
|
|
9
|
+
<SampleDescription>
|
|
10
|
+
<p>Hier ist die Standarddarstellung der Versionsnummer.</p>
|
|
11
|
+
</SampleDescription>
|
|
12
|
+
<KolVersion _label="1.1.1" />
|
|
13
|
+
</>
|
|
14
|
+
);
|
|
@@ -3,11 +3,17 @@ import React from 'react';
|
|
|
3
3
|
import { KolVersion } from '@public-ui/react';
|
|
4
4
|
|
|
5
5
|
import type { FC } from 'react';
|
|
6
|
+
import { SampleDescription } from '../SampleDescription';
|
|
6
7
|
|
|
7
8
|
export const VersionContext: FC = () => (
|
|
8
|
-
|
|
9
|
-
<
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
<>
|
|
10
|
+
<SampleDescription>
|
|
11
|
+
<p>Hier ist die Standardversionsnummer mit Text.</p>
|
|
12
|
+
</SampleDescription>
|
|
13
|
+
<p>
|
|
14
|
+
<KolVersion _label="1.0.0" /> Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna
|
|
15
|
+
aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem
|
|
16
|
+
ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor.
|
|
17
|
+
</p>
|
|
18
|
+
</>
|
|
13
19
|
);
|
package/src/react.main.tsx
CHANGED
|
@@ -1,36 +1,62 @@
|
|
|
1
1
|
import React, { StrictMode } from 'react';
|
|
2
2
|
import { createRoot } from 'react-dom/client';
|
|
3
3
|
import { HashRouter as Router } from 'react-router-dom';
|
|
4
|
+
import { setTagNameTransformer } from '@public-ui/react';
|
|
4
5
|
|
|
5
|
-
import {
|
|
6
|
+
import { bootstrap } from '@public-ui/components';
|
|
6
7
|
import { defineCustomElements } from '@public-ui/components/dist/loader';
|
|
7
8
|
import { BMF, DEFAULT, ECL_EC, ECL_EU, ITZBund } from '@public-ui/themes';
|
|
8
9
|
|
|
9
10
|
import { App } from './App';
|
|
10
11
|
|
|
11
12
|
import type { Generic } from 'adopted-style-sheets';
|
|
13
|
+
|
|
12
14
|
type Theme = Generic.Theming.RegisterPatch<string, string, string>;
|
|
13
15
|
|
|
14
|
-
|
|
16
|
+
const ENABLE_TAG_NAME_TRANSFORMER =
|
|
17
|
+
process.env.ENABLE_TAG_NAME_TRANSFORMER === 'true' || new URL('https://x' + location.hash.substring(1)).searchParams.has('enableTagNameTransformer');
|
|
18
|
+
|
|
19
|
+
const tagNameTransformer = (tagName: string) => `${tagName}-sample`;
|
|
20
|
+
if (ENABLE_TAG_NAME_TRANSFORMER) {
|
|
21
|
+
setTagNameTransformer(tagNameTransformer);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
const getThemes = async () => {
|
|
15
25
|
if (process.env.THEME_MODULE) {
|
|
16
26
|
/* Visual regression testing mode: Themes are overridden with a certain theme module, that should be used instead. */
|
|
17
|
-
const { [(process.env.THEME_EXPORT as string)
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
27
|
+
const { [(process.env.THEME_EXPORT as string) || 'default']: theme } = (await import(process.env.THEME_MODULE)) as Record<string, Theme>;
|
|
28
|
+
return [theme];
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/* List of regular sample app themes */
|
|
32
|
+
return [BMF, DEFAULT, ECL_EC, ECL_EU, ITZBund];
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
void (async () => {
|
|
36
|
+
try {
|
|
37
|
+
await bootstrap(
|
|
38
|
+
await getThemes(),
|
|
39
|
+
() => {
|
|
40
|
+
// @see https://github.com/ionic-team/stencil/issues/2847
|
|
41
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
|
|
42
|
+
defineCustomElements(window, {
|
|
43
|
+
transformTagName: ENABLE_TAG_NAME_TRANSFORMER ? tagNameTransformer : undefined,
|
|
44
|
+
} as any);
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
theme: process.env.THEME_MODULE
|
|
48
|
+
? undefined
|
|
49
|
+
: {
|
|
50
|
+
detect: 'auto',
|
|
51
|
+
},
|
|
52
|
+
translation: {
|
|
53
|
+
name: 'de',
|
|
29
54
|
},
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
55
|
+
transformTagName: ENABLE_TAG_NAME_TRANSFORMER ? tagNameTransformer : undefined,
|
|
56
|
+
},
|
|
57
|
+
);
|
|
58
|
+
} catch (error) {
|
|
59
|
+
console.warn('Theme registration failed:', error);
|
|
34
60
|
}
|
|
35
61
|
|
|
36
62
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Field, useFormikContext } from 'formik';
|
|
2
|
-
import React, { useEffect, useState } from 'react';
|
|
2
|
+
import React, { useEffect, useState, useRef } from 'react';
|
|
3
3
|
|
|
4
4
|
import { KolButton, KolForm, KolHeading, KolInputDate, KolInputRadio, KolSpin } from '@public-ui/react';
|
|
5
5
|
|
|
@@ -8,19 +8,24 @@ import { fetchAvailableTimes } from './appointmentService';
|
|
|
8
8
|
import type { FormValues } from './AppointmentForm';
|
|
9
9
|
import type { FieldProps } from 'formik';
|
|
10
10
|
import type { Option } from '@public-ui/components';
|
|
11
|
-
import { createErrorList } from './formUtils';
|
|
11
|
+
import { createErrorList, focusErrorList } from './formUtils';
|
|
12
12
|
|
|
13
13
|
export function AvailableAppointmentsForm() {
|
|
14
14
|
const form = useFormikContext<FormValues>();
|
|
15
15
|
|
|
16
16
|
const [sectionSubmitted, setSectionSubmitted] = useState(false);
|
|
17
17
|
const [availableTimes, setAvailableTimes] = useState<Option<string>[] | null>(null);
|
|
18
|
-
|
|
18
|
+
const [schouldFocusErrorList, setSchouldFocusErrorList] = useState(true);
|
|
19
19
|
const errorList = createErrorList(form.errors);
|
|
20
|
+
const formikRef = useRef(null);
|
|
20
21
|
|
|
21
22
|
useEffect(() => {
|
|
22
23
|
let ignoreResponse = false;
|
|
23
24
|
setAvailableTimes(null);
|
|
25
|
+
if (schouldFocusErrorList && sectionSubmitted) {
|
|
26
|
+
focusErrorList(errorList, formikRef);
|
|
27
|
+
setSchouldFocusErrorList(false);
|
|
28
|
+
}
|
|
24
29
|
|
|
25
30
|
if (form.values.date) {
|
|
26
31
|
fetchAvailableTimes().then(
|
|
@@ -37,17 +42,19 @@ export function AvailableAppointmentsForm() {
|
|
|
37
42
|
return () => {
|
|
38
43
|
ignoreResponse = true;
|
|
39
44
|
};
|
|
40
|
-
}, [form.values.date]);
|
|
45
|
+
}, [form.values.date, sectionSubmitted]);
|
|
41
46
|
|
|
42
47
|
return (
|
|
43
48
|
<div className="p-2">
|
|
44
49
|
<KolHeading _level={2} _label="Wählen Sie einen Termin aus"></KolHeading>
|
|
45
50
|
<KolForm
|
|
51
|
+
ref={formikRef}
|
|
46
52
|
_errorList={sectionSubmitted ? errorList : []}
|
|
47
53
|
_on={{
|
|
48
54
|
onSubmit: () => {
|
|
49
55
|
setSectionSubmitted(true);
|
|
50
56
|
void form.submitForm();
|
|
57
|
+
focusErrorList(errorList, formikRef);
|
|
51
58
|
},
|
|
52
59
|
}}
|
|
53
60
|
>
|