@public-ui/sample-react 1.7.10 → 1.7.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/dist/104.js +2 -0
- package/dist/{4669.js → 1296.js} +2 -2
- package/dist/{8869.js → 1461.js} +2 -2
- package/dist/{8734.js → 1684.js} +2 -2
- package/dist/{4333.js → 1720.js} +2 -2
- package/dist/1728.js +2 -0
- package/dist/1888.js +2 -0
- package/dist/2120.js +2 -0
- package/dist/{1181.js → 2240.js} +2 -2
- package/dist/{8612.js → 2444.js} +2 -2
- package/dist/2628.js +2 -0
- package/dist/{3388.js → 2740.js} +2 -2
- package/dist/2764.js +2 -0
- package/dist/2782.js +2 -0
- package/dist/2812.js +2 -0
- package/dist/{2164.js → 3180.js} +2 -2
- package/dist/{5324.js → 3200.js} +2 -2
- package/dist/3204.js +2 -0
- package/dist/352.js +2 -0
- package/dist/3564.js +2 -0
- package/dist/3920.js +2 -0
- package/dist/4064.js +2 -0
- package/dist/408.js +2 -0
- package/dist/{8037.js → 4136.js} +1 -1
- package/dist/{9533.js → 4184.js} +2 -2
- package/dist/{4686.js → 4544.js} +2 -2
- package/dist/{9865.js → 4728.js} +2 -2
- package/dist/4915.js +2 -0
- package/dist/{1596.js → 4988.js} +2 -2
- package/dist/{3552.js → 5336.js} +2 -2
- package/dist/5376.js +2 -0
- package/dist/{9912.js → 5456.js} +2 -2
- package/dist/5615.js +1 -1
- package/dist/5628.js +2 -0
- package/dist/5744.js +2 -0
- package/dist/{9317.js → 5768.js} +2 -2
- package/dist/{9330.js → 5839.js} +2 -2
- package/dist/5956.js +2 -0
- package/dist/5972.js +2 -0
- package/dist/6040.js +2 -0
- package/dist/{3600.js → 6112.js} +2 -2
- package/dist/{1767.js → 6272.js} +2 -2
- package/dist/6864.js +2 -0
- package/dist/{4279.js → 7192.js} +2 -2
- package/dist/7312.js +2 -0
- package/dist/{7432.js → 7344.js} +2 -2
- package/dist/736.js +2 -0
- package/dist/{4950.js → 7392.js} +2 -2
- package/dist/7496.js +2 -0
- package/dist/7508.js +2 -0
- package/dist/7596.js +2 -0
- package/dist/7712.js +2 -0
- package/dist/{2643.js → 7808.js} +2 -2
- package/dist/8188.js +2 -0
- package/dist/{7170.js → 8232.js} +2 -2
- package/dist/8248.js +2 -0
- package/dist/828.js +2 -0
- package/dist/{1218.js → 8476.js} +2 -2
- package/dist/{6010.js → 8524.js} +2 -2
- package/dist/{9727.js → 9088.js} +2 -2
- package/dist/9096.js +2 -0
- package/dist/{2079.js → 9224.js} +2 -2
- package/dist/{4463.js → 9404.js} +2 -2
- package/dist/9424.js +2 -0
- package/dist/{8404.js → 9496.js} +2 -2
- package/dist/{9709.js → 9544.js} +2 -2
- package/dist/9680.js +2 -0
- package/dist/9888.js +2 -0
- package/dist/9984.js +1 -1
- package/dist/index.html +1 -1
- package/dist/main.css +1 -1
- package/dist/main.js +1 -2333
- package/dist/main.js.LICENSE.txt +2 -4
- package/package.json +14 -15
- package/public/index.html +1 -1
- package/src/App.tsx +28 -22
- package/src/components/BackPage.tsx +17 -0
- package/src/components/SampleDescription.tsx +23 -0
- package/src/components/alert/html.tsx +2 -2
- package/src/components/breadcrumb/basic.tsx +9 -9
- package/src/components/handout/basic.tsx +50 -32
- package/src/components/input-text/hide-errors.tsx +25 -0
- package/src/components/input-text/routes.ts +2 -0
- package/src/components/link/basic.tsx +7 -6
- package/src/components/link/icons.tsx +5 -1
- package/src/components/link/image.tsx +3 -3
- package/src/components/link/target.tsx +6 -5
- package/src/components/link-button/basic.tsx +1 -3
- package/src/components/link-group/basic.tsx +3 -3
- package/src/components/link-group/horizontal.tsx +3 -3
- package/src/components/nav/active.tsx +3 -3
- package/src/components/nav/aria-current.tsx +2 -2
- package/src/components/nav/basic.tsx +13 -13
- package/src/components/nav/horizontal.tsx +12 -12
- package/src/scenarios/appointment-form/AppointmentForm.tsx +10 -4
- package/src/scenarios/appointment-form/AvailableAppointmentsForm.tsx +4 -9
- package/src/scenarios/appointment-form/DistrictForm.tsx +3 -8
- package/src/scenarios/appointment-form/PersonalInformationForm.tsx +20 -0
- package/src/scenarios/appointment-form/formUtils.ts +8 -0
- package/src/scenarios/routes.ts +3 -1
- package/src/scenarios/static-form.tsx +74 -0
- package/src/shares/HideMenusContext.ts +3 -0
- package/dist/1090.js +0 -2
- package/dist/1338.js +0 -2
- package/dist/1517.js +0 -2
- package/dist/2163.js +0 -2
- package/dist/2415.js +0 -2
- package/dist/2594.js +0 -2
- package/dist/2611.js +0 -2
- package/dist/3099.js +0 -2
- package/dist/3145.js +0 -2
- package/dist/3345.js +0 -2
- package/dist/3466.js +0 -2
- package/dist/3580.js +0 -2
- package/dist/3619.js +0 -2
- package/dist/3776.js +0 -2
- package/dist/4150.js +0 -2
- package/dist/42.js +0 -2
- package/dist/4385.js +0 -2
- package/dist/4531.js +0 -2
- package/dist/4815.js +0 -2
- package/dist/5027.js +0 -2
- package/dist/521.js +0 -2
- package/dist/5373.js +0 -2
- package/dist/5518.js +0 -2
- package/dist/5853.js +0 -2
- package/dist/6308.js +0 -2
- package/dist/755.js +0 -2
- package/dist/7654.js +0 -2
- package/dist/817.js +0 -2
- package/dist/881.js +0 -2
- package/dist/892.js +0 -2
- package/dist/8948.js +0 -2
- package/dist/895.js +0 -2
- package/dist/8951.js +0 -2
- package/dist/9797.js +0 -2
- package/dist/9886.js +0 -2
- package/src/scenarios/appointment-form/ErrorList.tsx +0 -35
- /package/dist/{1090.js.LICENSE.txt → 104.js.LICENSE.txt} +0 -0
- /package/dist/{1181.js.LICENSE.txt → 1296.js.LICENSE.txt} +0 -0
- /package/dist/{1218.js.LICENSE.txt → 1461.js.LICENSE.txt} +0 -0
- /package/dist/{1338.js.LICENSE.txt → 1684.js.LICENSE.txt} +0 -0
- /package/dist/{1517.js.LICENSE.txt → 1720.js.LICENSE.txt} +0 -0
- /package/dist/{1596.js.LICENSE.txt → 1728.js.LICENSE.txt} +0 -0
- /package/dist/{1767.js.LICENSE.txt → 1888.js.LICENSE.txt} +0 -0
- /package/dist/{2079.js.LICENSE.txt → 2120.js.LICENSE.txt} +0 -0
- /package/dist/{2163.js.LICENSE.txt → 2240.js.LICENSE.txt} +0 -0
- /package/dist/{2164.js.LICENSE.txt → 2444.js.LICENSE.txt} +0 -0
- /package/dist/{2415.js.LICENSE.txt → 2628.js.LICENSE.txt} +0 -0
- /package/dist/{2594.js.LICENSE.txt → 2740.js.LICENSE.txt} +0 -0
- /package/dist/{2611.js.LICENSE.txt → 2764.js.LICENSE.txt} +0 -0
- /package/dist/{2643.js.LICENSE.txt → 2782.js.LICENSE.txt} +0 -0
- /package/dist/{3099.js.LICENSE.txt → 2812.js.LICENSE.txt} +0 -0
- /package/dist/{3145.js.LICENSE.txt → 3180.js.LICENSE.txt} +0 -0
- /package/dist/{3345.js.LICENSE.txt → 3200.js.LICENSE.txt} +0 -0
- /package/dist/{3388.js.LICENSE.txt → 3204.js.LICENSE.txt} +0 -0
- /package/dist/{3466.js.LICENSE.txt → 352.js.LICENSE.txt} +0 -0
- /package/dist/{3552.js.LICENSE.txt → 3564.js.LICENSE.txt} +0 -0
- /package/dist/{3580.js.LICENSE.txt → 3920.js.LICENSE.txt} +0 -0
- /package/dist/{3600.js.LICENSE.txt → 4064.js.LICENSE.txt} +0 -0
- /package/dist/{3619.js.LICENSE.txt → 408.js.LICENSE.txt} +0 -0
- /package/dist/{3776.js.LICENSE.txt → 4184.js.LICENSE.txt} +0 -0
- /package/dist/{4150.js.LICENSE.txt → 4544.js.LICENSE.txt} +0 -0
- /package/dist/{42.js.LICENSE.txt → 4728.js.LICENSE.txt} +0 -0
- /package/dist/{4279.js.LICENSE.txt → 4915.js.LICENSE.txt} +0 -0
- /package/dist/{4333.js.LICENSE.txt → 4988.js.LICENSE.txt} +0 -0
- /package/dist/{4385.js.LICENSE.txt → 5336.js.LICENSE.txt} +0 -0
- /package/dist/{4463.js.LICENSE.txt → 5376.js.LICENSE.txt} +0 -0
- /package/dist/{4531.js.LICENSE.txt → 5456.js.LICENSE.txt} +0 -0
- /package/dist/{4669.js.LICENSE.txt → 5628.js.LICENSE.txt} +0 -0
- /package/dist/{4686.js.LICENSE.txt → 5744.js.LICENSE.txt} +0 -0
- /package/dist/{4815.js.LICENSE.txt → 5768.js.LICENSE.txt} +0 -0
- /package/dist/{4950.js.LICENSE.txt → 5839.js.LICENSE.txt} +0 -0
- /package/dist/{5027.js.LICENSE.txt → 5956.js.LICENSE.txt} +0 -0
- /package/dist/{521.js.LICENSE.txt → 5972.js.LICENSE.txt} +0 -0
- /package/dist/{5324.js.LICENSE.txt → 6040.js.LICENSE.txt} +0 -0
- /package/dist/{5373.js.LICENSE.txt → 6112.js.LICENSE.txt} +0 -0
- /package/dist/{5518.js.LICENSE.txt → 6272.js.LICENSE.txt} +0 -0
- /package/dist/{5853.js.LICENSE.txt → 6864.js.LICENSE.txt} +0 -0
- /package/dist/{6010.js.LICENSE.txt → 7192.js.LICENSE.txt} +0 -0
- /package/dist/{6308.js.LICENSE.txt → 7312.js.LICENSE.txt} +0 -0
- /package/dist/{7170.js.LICENSE.txt → 7344.js.LICENSE.txt} +0 -0
- /package/dist/{7432.js.LICENSE.txt → 736.js.LICENSE.txt} +0 -0
- /package/dist/{755.js.LICENSE.txt → 7392.js.LICENSE.txt} +0 -0
- /package/dist/{7654.js.LICENSE.txt → 7496.js.LICENSE.txt} +0 -0
- /package/dist/{817.js.LICENSE.txt → 7508.js.LICENSE.txt} +0 -0
- /package/dist/{8404.js.LICENSE.txt → 7596.js.LICENSE.txt} +0 -0
- /package/dist/{8612.js.LICENSE.txt → 7712.js.LICENSE.txt} +0 -0
- /package/dist/{8734.js.LICENSE.txt → 7808.js.LICENSE.txt} +0 -0
- /package/dist/{881.js.LICENSE.txt → 8188.js.LICENSE.txt} +0 -0
- /package/dist/{8869.js.LICENSE.txt → 8232.js.LICENSE.txt} +0 -0
- /package/dist/{892.js.LICENSE.txt → 8248.js.LICENSE.txt} +0 -0
- /package/dist/{8948.js.LICENSE.txt → 828.js.LICENSE.txt} +0 -0
- /package/dist/{895.js.LICENSE.txt → 8476.js.LICENSE.txt} +0 -0
- /package/dist/{8951.js.LICENSE.txt → 8524.js.LICENSE.txt} +0 -0
- /package/dist/{9317.js.LICENSE.txt → 9088.js.LICENSE.txt} +0 -0
- /package/dist/{9330.js.LICENSE.txt → 9096.js.LICENSE.txt} +0 -0
- /package/dist/{9533.js.LICENSE.txt → 9224.js.LICENSE.txt} +0 -0
- /package/dist/{9709.js.LICENSE.txt → 9404.js.LICENSE.txt} +0 -0
- /package/dist/{9727.js.LICENSE.txt → 9424.js.LICENSE.txt} +0 -0
- /package/dist/{9797.js.LICENSE.txt → 9496.js.LICENSE.txt} +0 -0
- /package/dist/{9865.js.LICENSE.txt → 9544.js.LICENSE.txt} +0 -0
- /package/dist/{9886.js.LICENSE.txt → 9680.js.LICENSE.txt} +0 -0
- /package/dist/{9912.js.LICENSE.txt → 9888.js.LICENSE.txt} +0 -0
|
@@ -52,21 +52,21 @@ export const NavActive: FC = () => {
|
|
|
52
52
|
{
|
|
53
53
|
_active: true,
|
|
54
54
|
_label: 'Abbr',
|
|
55
|
-
_href: '
|
|
55
|
+
_href: '#/back-page',
|
|
56
56
|
_on: {
|
|
57
57
|
onClick: () => handleLinks('/abbr'),
|
|
58
58
|
},
|
|
59
59
|
},
|
|
60
60
|
{
|
|
61
61
|
_label: 'Accordion',
|
|
62
|
-
_href: '
|
|
62
|
+
_href: '#/back-page',
|
|
63
63
|
_on: {
|
|
64
64
|
onClick: () => handleLinks('/accordion'),
|
|
65
65
|
},
|
|
66
66
|
},
|
|
67
67
|
{
|
|
68
68
|
_label: 'Alert',
|
|
69
|
-
_href: '
|
|
69
|
+
_href: '#/back-page',
|
|
70
70
|
},
|
|
71
71
|
{
|
|
72
72
|
_label: 'Badget',
|
|
@@ -10,52 +10,52 @@ export const NavBasic: FC = () => (
|
|
|
10
10
|
{
|
|
11
11
|
_label: 'Homepage',
|
|
12
12
|
_icons: 'codicon codicon-home',
|
|
13
|
-
_href: '#/',
|
|
13
|
+
_href: '#/back-page',
|
|
14
14
|
},
|
|
15
15
|
{
|
|
16
16
|
_label: '2 Navigation point',
|
|
17
|
-
_href: '#/
|
|
17
|
+
_href: '#/back-page',
|
|
18
18
|
},
|
|
19
19
|
{
|
|
20
20
|
_active: true,
|
|
21
21
|
_label: '3 Navigation point',
|
|
22
|
-
_href: '
|
|
22
|
+
_href: '#/back-page',
|
|
23
23
|
_children: [
|
|
24
24
|
{
|
|
25
25
|
_label: '3.1 Navigation point',
|
|
26
|
-
_href: '#/',
|
|
26
|
+
_href: '#/back-page',
|
|
27
27
|
},
|
|
28
28
|
{
|
|
29
29
|
_label: '3.2 Navigation point',
|
|
30
|
-
_href: '
|
|
30
|
+
_href: '#/back-page',
|
|
31
31
|
_target: 'asdasd',
|
|
32
32
|
},
|
|
33
33
|
{
|
|
34
34
|
_active: true,
|
|
35
35
|
_label: '3.3 Navigation point',
|
|
36
|
-
_href: '
|
|
36
|
+
_href: '#/back-page',
|
|
37
37
|
_icons: 'fa-solid fa-cat',
|
|
38
38
|
_children: [
|
|
39
39
|
{
|
|
40
40
|
_active: true,
|
|
41
41
|
_label: '3.3.1 Navigation point (active)',
|
|
42
|
-
_href: '
|
|
42
|
+
_href: '#/back-page',
|
|
43
43
|
},
|
|
44
|
-
{ _label: '3.3.2 Navigation point', _href: '
|
|
44
|
+
{ _label: '3.3.2 Navigation point', _href: '#/back-page' },
|
|
45
45
|
],
|
|
46
46
|
},
|
|
47
47
|
{
|
|
48
48
|
_label: '3.4 Navigation point',
|
|
49
|
-
_href: '
|
|
49
|
+
_href: '#/back-page',
|
|
50
50
|
_children: [
|
|
51
|
-
{ _label: '3.4.1 Navigation point', _href: '
|
|
52
|
-
{ _label: '3.4.2 Navigation point', _href: '
|
|
51
|
+
{ _label: '3.4.1 Navigation point', _href: '#/back-page' },
|
|
52
|
+
{ _label: '3.4.2 Navigation point', _href: '#/back-page' },
|
|
53
53
|
],
|
|
54
54
|
},
|
|
55
|
-
{ _label: '3.5 Navigation point', _href: '
|
|
55
|
+
{ _label: '3.5 Navigation point', _href: '#/back-page' },
|
|
56
56
|
],
|
|
57
57
|
},
|
|
58
|
-
{ _label: '4 Navigation point', _href: '
|
|
58
|
+
{ _label: '4 Navigation point', _href: '#/back-page' },
|
|
59
59
|
]}
|
|
60
60
|
_hasCompactButton
|
|
61
61
|
/>
|
|
@@ -9,50 +9,50 @@ export const NavHorizontal: FC = () => (
|
|
|
9
9
|
_links={[
|
|
10
10
|
{
|
|
11
11
|
_label: 'Homepage',
|
|
12
|
-
_href: '#/
|
|
12
|
+
_href: '#/back-page',
|
|
13
13
|
},
|
|
14
14
|
{
|
|
15
15
|
_label: '2 Navigation point',
|
|
16
|
-
_href: '#/
|
|
16
|
+
_href: '#/back-page',
|
|
17
17
|
},
|
|
18
18
|
{
|
|
19
19
|
_active: true,
|
|
20
20
|
_label: '3 Navigation point',
|
|
21
|
-
_href: '#/
|
|
21
|
+
_href: '#/back-page',
|
|
22
22
|
_children: [
|
|
23
23
|
{
|
|
24
24
|
_label: '3.1 Navigation point',
|
|
25
25
|
},
|
|
26
26
|
{
|
|
27
27
|
_label: '3.2 Navigation point',
|
|
28
|
-
_href: '#/
|
|
28
|
+
_href: '#/back-page',
|
|
29
29
|
_target: 'asdasd',
|
|
30
30
|
},
|
|
31
31
|
{
|
|
32
32
|
_active: true,
|
|
33
33
|
_label: '3.3 Navigation point',
|
|
34
|
-
_href: '#/
|
|
34
|
+
_href: '#/back-page',
|
|
35
35
|
_children: [
|
|
36
36
|
{
|
|
37
37
|
_active: true,
|
|
38
38
|
_label: '3.3.1 Navigation point (active)',
|
|
39
|
-
_href: '
|
|
39
|
+
_href: '#/back-page',
|
|
40
40
|
},
|
|
41
|
-
{ _label: '3.3.2 Navigation point', _href: '
|
|
41
|
+
{ _label: '3.3.2 Navigation point', _href: '#/back-page' },
|
|
42
42
|
],
|
|
43
43
|
},
|
|
44
44
|
{
|
|
45
45
|
_label: '3.4 Navigation point',
|
|
46
|
-
_href: '#/
|
|
46
|
+
_href: '#/back-page',
|
|
47
47
|
_children: [
|
|
48
|
-
{ _label: '3.4.1 Navigation point', _href: '
|
|
49
|
-
{ _label: '3.4.2 Navigation point', _href: '
|
|
48
|
+
{ _label: '3.4.1 Navigation point', _href: '#/back-page' },
|
|
49
|
+
{ _label: '3.4.2 Navigation point', _href: '#/back-page' },
|
|
50
50
|
],
|
|
51
51
|
},
|
|
52
|
-
{ _label: '3.5 Navigation point', _href: '
|
|
52
|
+
{ _label: '3.5 Navigation point', _href: '#/back-page' },
|
|
53
53
|
],
|
|
54
54
|
},
|
|
55
|
-
{ _label: '4 Navigation point', _href: '
|
|
55
|
+
{ _label: '4 Navigation point', _href: '#/back-page' },
|
|
56
56
|
]}
|
|
57
57
|
_orientation="horizontal"
|
|
58
58
|
/>
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import React, { useEffect, useState } from 'react';
|
|
1
|
+
import React, { useEffect, useState, useRef } from 'react';
|
|
2
2
|
import { KolTabs } from '@public-ui/react';
|
|
3
3
|
import { DistrictForm } from './DistrictForm';
|
|
4
4
|
import { Summary } from './Summary';
|
|
5
5
|
import { PersonalInformationForm } from './PersonalInformationForm';
|
|
6
|
-
import { Formik, FormikHelpers } from 'formik';
|
|
6
|
+
import { Formik, FormikHelpers, FormikProps } from 'formik';
|
|
7
7
|
import * as Yup from 'yup';
|
|
8
8
|
import { AvailableAppointmentsForm } from './AvailableAppointmentsForm';
|
|
9
9
|
import { Iso8601 } from '@public-ui/components';
|
|
@@ -64,6 +64,7 @@ const availableAppointmentsSchema = {
|
|
|
64
64
|
export function AppointmentForm() {
|
|
65
65
|
const [activeFormSection, setActiveFormSection] = useState(FormSection.DISTRICT);
|
|
66
66
|
const [selectedTab, setSelectedTab] = useState(activeFormSection);
|
|
67
|
+
const formikRef = useRef<FormikProps<FormValues>>(null);
|
|
67
68
|
|
|
68
69
|
const validationSchema = Yup.object().shape({
|
|
69
70
|
...(activeFormSection === FormSection.DISTRICT ? districtSchema : {}),
|
|
@@ -86,7 +87,7 @@ export function AppointmentForm() {
|
|
|
86
87
|
};
|
|
87
88
|
|
|
88
89
|
return (
|
|
89
|
-
<Formik<FormValues> initialValues={initialValues} validationSchema={validationSchema} onSubmit={handleSubmit}>
|
|
90
|
+
<Formik<FormValues> innerRef={formikRef} initialValues={initialValues} validationSchema={validationSchema} onSubmit={handleSubmit}>
|
|
90
91
|
<KolTabs
|
|
91
92
|
_tabs={[
|
|
92
93
|
{
|
|
@@ -107,7 +108,12 @@ export function AppointmentForm() {
|
|
|
107
108
|
]}
|
|
108
109
|
_label="Formular-Navigation"
|
|
109
110
|
_selected={selectedTab}
|
|
110
|
-
_on={{
|
|
111
|
+
_on={{
|
|
112
|
+
onSelect: (_event, selectedTab) => {
|
|
113
|
+
setActiveFormSection(selectedTab);
|
|
114
|
+
formikRef.current?.setErrors({});
|
|
115
|
+
},
|
|
116
|
+
}}
|
|
111
117
|
>
|
|
112
118
|
<div>
|
|
113
119
|
<DistrictForm />
|
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
import React, { useEffect, useState } from 'react';
|
|
2
2
|
import { KolButton, KolForm, KolHeading, KolInputDate, KolInputRadio, KolSpin } from '@public-ui/react';
|
|
3
3
|
import { FormValues } from './AppointmentForm';
|
|
4
|
-
import { ErrorList } from './ErrorList';
|
|
5
4
|
import { Field, FieldProps, useFormikContext } from 'formik';
|
|
6
5
|
import { fetchAvailableTimes } from './appointmentService';
|
|
7
6
|
import { Option } from '@public-ui/components/src';
|
|
7
|
+
import { createErrorList } from './formUtils';
|
|
8
8
|
|
|
9
9
|
export function AvailableAppointmentsForm() {
|
|
10
10
|
const form = useFormikContext<FormValues>();
|
|
11
11
|
|
|
12
12
|
const [sectionSubmitted, setSectionSubmitted] = useState(false);
|
|
13
13
|
const [availableTimes, setAvailableTimes] = useState<Option<string>[] | null>(null);
|
|
14
|
+
const errorList = createErrorList(form.errors);
|
|
14
15
|
|
|
15
16
|
useEffect(() => {
|
|
16
17
|
let ignoreResponse = false;
|
|
@@ -36,14 +37,8 @@ export function AvailableAppointmentsForm() {
|
|
|
36
37
|
return (
|
|
37
38
|
<div className="p-2">
|
|
38
39
|
<KolHeading _level={2} _label="Wählen Sie einen Termin aus"></KolHeading>
|
|
39
|
-
|
|
40
|
-
{sectionSubmitted && Object.keys(form.errors).length ? (
|
|
41
|
-
<div className="mt-2">
|
|
42
|
-
<ErrorList errors={form.errors} />
|
|
43
|
-
</div>
|
|
44
|
-
) : null}
|
|
45
|
-
|
|
46
40
|
<KolForm
|
|
41
|
+
_errorList={sectionSubmitted ? errorList : []}
|
|
47
42
|
_on={{
|
|
48
43
|
onSubmit: () => {
|
|
49
44
|
void form.submitForm();
|
|
@@ -81,7 +76,7 @@ export function AvailableAppointmentsForm() {
|
|
|
81
76
|
<Field name="time">
|
|
82
77
|
{({ field }: FieldProps<FormValues['time']>) => (
|
|
83
78
|
<KolInputRadio
|
|
84
|
-
id="field-
|
|
79
|
+
id="field-time"
|
|
85
80
|
_label="Zeit"
|
|
86
81
|
_orientation="horizontal"
|
|
87
82
|
_options={availableTimes}
|
|
@@ -2,7 +2,7 @@ import React, { useState } from 'react';
|
|
|
2
2
|
import { KolButton, KolForm, KolHeading, KolSelect } from '@public-ui/react';
|
|
3
3
|
import { Field, FieldProps, useFormikContext } from 'formik';
|
|
4
4
|
import { FormValues } from './AppointmentForm';
|
|
5
|
-
import {
|
|
5
|
+
import { createErrorList } from './formUtils';
|
|
6
6
|
|
|
7
7
|
const LOCATION_OPTIONS = [
|
|
8
8
|
{
|
|
@@ -30,18 +30,13 @@ const LOCATION_OPTIONS = [
|
|
|
30
30
|
export function DistrictForm() {
|
|
31
31
|
const form = useFormikContext<FormValues>();
|
|
32
32
|
const [sectionSubmitted, setSectionSubmitted] = useState(false);
|
|
33
|
+
const errorList = createErrorList(form.errors);
|
|
33
34
|
|
|
34
35
|
return (
|
|
35
36
|
<div className="p-2">
|
|
36
37
|
<KolHeading _level={2} _label="Wählen Sie einen Stadtteil aus"></KolHeading>
|
|
37
|
-
|
|
38
|
-
{sectionSubmitted && Object.keys(form.errors).length ? (
|
|
39
|
-
<div className="mt-2">
|
|
40
|
-
<ErrorList errors={form.errors} />
|
|
41
|
-
</div>
|
|
42
|
-
) : null}
|
|
43
|
-
|
|
44
38
|
<KolForm
|
|
39
|
+
_errorList={sectionSubmitted ? errorList : []}
|
|
45
40
|
_on={{
|
|
46
41
|
onSubmit: () => {
|
|
47
42
|
void form.submitForm();
|
|
@@ -2,6 +2,7 @@ import React, { useState } from 'react';
|
|
|
2
2
|
import { KolButton, KolForm, KolHeading, KolInputEmail, KolInputText, KolSelect } from '@public-ui/react';
|
|
3
3
|
import { Field, FieldProps, useFormikContext } from 'formik';
|
|
4
4
|
import { FormValues } from './AppointmentForm';
|
|
5
|
+
import { createErrorList } from './formUtils';
|
|
5
6
|
|
|
6
7
|
const SALUTATION_OPTIONS = [
|
|
7
8
|
{
|
|
@@ -25,12 +26,14 @@ const SALUTATION_OPTIONS = [
|
|
|
25
26
|
export function PersonalInformationForm() {
|
|
26
27
|
const form = useFormikContext<FormValues>();
|
|
27
28
|
const [sectionSubmitted, setSectionSubmitted] = useState(false);
|
|
29
|
+
const errorList = createErrorList(form.errors);
|
|
28
30
|
|
|
29
31
|
return (
|
|
30
32
|
<div className="p-2">
|
|
31
33
|
<KolHeading _level={2} _label="Geben Sie Ihre Kontaktdaten ein"></KolHeading>
|
|
32
34
|
<ul>{sectionSubmitted && Object.entries(form.errors).map(([field, error]) => <li key={field}>{error}</li>)}</ul>
|
|
33
35
|
<KolForm
|
|
36
|
+
_errorList={sectionSubmitted ? errorList : []}
|
|
34
37
|
_on={{
|
|
35
38
|
onSubmit: () => {
|
|
36
39
|
void form.submitForm();
|
|
@@ -41,6 +44,10 @@ export function PersonalInformationForm() {
|
|
|
41
44
|
<Field name="salutation">
|
|
42
45
|
{({ field }: FieldProps<FormValues['salutation']>) => (
|
|
43
46
|
<KolSelect
|
|
47
|
+
onBlur={() => {
|
|
48
|
+
void form.setFieldTouched('salutation', true);
|
|
49
|
+
}}
|
|
50
|
+
id="field-salutation"
|
|
44
51
|
_label="Anrede"
|
|
45
52
|
_value={[field.value]}
|
|
46
53
|
_error={form.errors.salutation || ''}
|
|
@@ -65,6 +72,10 @@ export function PersonalInformationForm() {
|
|
|
65
72
|
{({ field }: FieldProps<FormValues['company']>) => (
|
|
66
73
|
<div className="block mt-2">
|
|
67
74
|
<KolInputText
|
|
75
|
+
onBlur={() => {
|
|
76
|
+
void form.setFieldTouched('company', true);
|
|
77
|
+
}}
|
|
78
|
+
id="field-company"
|
|
68
79
|
_label="Firma"
|
|
69
80
|
_value={field.value}
|
|
70
81
|
_error={form.errors.company || ''}
|
|
@@ -88,6 +99,10 @@ export function PersonalInformationForm() {
|
|
|
88
99
|
{({ field }: FieldProps<FormValues['name']>) => (
|
|
89
100
|
<div className="block mt-2">
|
|
90
101
|
<KolInputText
|
|
102
|
+
onBlur={() => {
|
|
103
|
+
void form.setFieldTouched('name', true);
|
|
104
|
+
}}
|
|
105
|
+
id="field-name"
|
|
91
106
|
_label="Vor- und Zuname"
|
|
92
107
|
_value={field.value}
|
|
93
108
|
_error={form.errors.name || ''}
|
|
@@ -110,6 +125,10 @@ export function PersonalInformationForm() {
|
|
|
110
125
|
{({ field }: FieldProps<FormValues['email']>) => (
|
|
111
126
|
<div className="block mt-2">
|
|
112
127
|
<KolInputEmail
|
|
128
|
+
onBlur={() => {
|
|
129
|
+
void form.setFieldTouched('email', true);
|
|
130
|
+
}}
|
|
131
|
+
id="field-email"
|
|
113
132
|
_label="E-Mail"
|
|
114
133
|
_value={field.value}
|
|
115
134
|
_error={form.errors.email || ''}
|
|
@@ -132,6 +151,7 @@ export function PersonalInformationForm() {
|
|
|
132
151
|
{({ field }: FieldProps<FormValues['phone']>) => (
|
|
133
152
|
<div className="block mt-2">
|
|
134
153
|
<KolInputText
|
|
154
|
+
id="field-phone"
|
|
135
155
|
_type="tel"
|
|
136
156
|
_label="Telefonnumer"
|
|
137
157
|
_value={field.value}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { ErrorListPropType } from '@public-ui/components';
|
|
2
|
+
|
|
3
|
+
export function createErrorList(formikErrors: Record<string, string>): ErrorListPropType[] {
|
|
4
|
+
return Object.keys(formikErrors).map((fieldName) => ({
|
|
5
|
+
message: formikErrors[fieldName],
|
|
6
|
+
selector: `#field-${fieldName}`,
|
|
7
|
+
}));
|
|
8
|
+
}
|
package/src/scenarios/routes.ts
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import { Routes } from '../shares/types';
|
|
2
|
-
import { TerminComponent } from './complex-form/component';
|
|
3
2
|
import { AppointmentForm } from './appointment-form/AppointmentForm';
|
|
3
|
+
import { TerminComponent } from './complex-form/component';
|
|
4
4
|
import { CustomTooltipWidth } from './custom-tooltip-width';
|
|
5
|
+
import { StaticForm } from './static-form';
|
|
5
6
|
|
|
6
7
|
export const SCENARIO_ROUTES: Routes = {
|
|
7
8
|
scenarios: {
|
|
8
9
|
'complex-form': TerminComponent,
|
|
9
10
|
'appointment-form': AppointmentForm,
|
|
10
11
|
'custom-tooltip-width': CustomTooltipWidth,
|
|
12
|
+
'static-form': StaticForm,
|
|
11
13
|
},
|
|
12
14
|
};
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import {
|
|
2
|
+
KolButton,
|
|
3
|
+
KolInputCheckbox,
|
|
4
|
+
KolInputColor,
|
|
5
|
+
KolInputDate,
|
|
6
|
+
KolInputEmail,
|
|
7
|
+
KolInputFile,
|
|
8
|
+
KolInputNumber,
|
|
9
|
+
KolInputPassword,
|
|
10
|
+
KolInputRadio,
|
|
11
|
+
KolInputRange,
|
|
12
|
+
KolInputText,
|
|
13
|
+
KolSelect,
|
|
14
|
+
KolTextarea,
|
|
15
|
+
} from '@public-ui/react';
|
|
16
|
+
import type { FC } from 'react';
|
|
17
|
+
import React from 'react';
|
|
18
|
+
|
|
19
|
+
export const StaticForm: FC = () => {
|
|
20
|
+
return (
|
|
21
|
+
<>
|
|
22
|
+
<p>This sample shows how you can use KoliBri in static form context, too.</p>
|
|
23
|
+
<ol>
|
|
24
|
+
<li>
|
|
25
|
+
First you have to enable the <code>experimental mode</code>:{' '}
|
|
26
|
+
<code className="bg-gray-200"><meta name="kolibri" content="dev-mode=false;experimental-mode=true;" /></code>
|
|
27
|
+
</li>
|
|
28
|
+
<li>
|
|
29
|
+
Currently you have to use a native <code>form</code> element: <code className="bg-gray-200"><form method="GET">...</form></code>
|
|
30
|
+
</li>
|
|
31
|
+
<li>
|
|
32
|
+
It is important in static usage to give every input a <code>name</code> attribute:{' '}
|
|
33
|
+
<code className="bg-gray-200"><KolInputColor _name="color" _label="Color" /></code>
|
|
34
|
+
</li>
|
|
35
|
+
<li>
|
|
36
|
+
Last of all one button should have the type <code>submit</code>:{' '}
|
|
37
|
+
<code className="bg-gray-200"><KolButton _label="Submit" _type="submit" _variant="primary" /></code>
|
|
38
|
+
</li>
|
|
39
|
+
</ol>
|
|
40
|
+
<form className="grid gap-4" method="get">
|
|
41
|
+
<KolInputCheckbox _name="checkbox" _label="Checkbox" />
|
|
42
|
+
<KolInputColor _name="color" _label="Color" />
|
|
43
|
+
<KolInputDate _name="date" _label="Date" />
|
|
44
|
+
<KolInputEmail _name="email" _label="Email" />
|
|
45
|
+
<KolInputFile _name="file" _label="File" />
|
|
46
|
+
<KolInputNumber _name="number" _label="Number" />
|
|
47
|
+
<KolInputPassword _name="password" _label="Password" />
|
|
48
|
+
<KolInputRadio
|
|
49
|
+
_name="radio"
|
|
50
|
+
_label="Radio"
|
|
51
|
+
_options={[
|
|
52
|
+
{ label: 'Option A', value: 'A' },
|
|
53
|
+
{ label: 'Option B', value: 'B' },
|
|
54
|
+
]}
|
|
55
|
+
/>
|
|
56
|
+
<KolInputRange _name="range" _label="Range" />
|
|
57
|
+
<KolInputText _name="text" _label="Text" />
|
|
58
|
+
<KolSelect
|
|
59
|
+
_name="select"
|
|
60
|
+
_label="Select"
|
|
61
|
+
_options={[
|
|
62
|
+
{ label: 'Option A', value: 'A' },
|
|
63
|
+
{ label: 'Option B', value: 'B' },
|
|
64
|
+
]}
|
|
65
|
+
/>
|
|
66
|
+
<KolTextarea _name="textarea" _label="Textarea" />
|
|
67
|
+
<div className="flex flex-wrap gap-4">
|
|
68
|
+
<KolButton _label="Submit" _type="submit" _variant="primary" />
|
|
69
|
+
<KolButton _label="Reset" _type="reset" />
|
|
70
|
+
</div>
|
|
71
|
+
</form>
|
|
72
|
+
</>
|
|
73
|
+
);
|
|
74
|
+
};
|
package/dist/1090.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
/*! For license information please see 1090.js.LICENSE.txt */
|
|
2
|
-
"use strict";(self.webpackChunk_public_ui_sample_react=self.webpackChunk_public_ui_sample_react||[]).push([[1090],{1090:(e,t,a)=>{a.r(t),a.d(t,{kol_breadcrumb:()=>r});var i=a(1456),n=a(6439),l=a(8225),o=a(9443),s=a(9738);const r=class{constructor(e){(0,i.r)(this,e),this.renderLink=(e,t)=>{const a=this.state._links.length-1,n=e._iconOnly||e._hideLabel;return(0,i.h)("li",{key:t},0!==t&&(0,i.h)("kol-icon",{_label:"",_icons:"codicon codicon-chevron-right"}),t===a?(0,i.h)("span",null,n?(0,i.h)("kol-icon",{_label:e._label,_icons:"string"==typeof e._icon?e._icon:"codicon codicon-symbol-event"}):(0,i.h)(i.F,null,e._label)):(0,i.h)("kol-link",Object.assign({},e)))},this._ariaLabel=void 0,this._label=void 0,this._links=void 0,this.state={_label:"…",_links:[]}}render(){var e;return(0,i.h)(i.H,null,(0,i.h)("nav",{"aria-label":null!==(e=this.state._label)&&void 0!==e?e:""},(0,i.h)("ul",null,0===this.state._links.length&&(0,i.h)("li",null,(0,i.h)("kol-icon",{_label:"",_icons:"codicon codicon-home"}),"…"),this.state._links.map(this.renderLink))))}validateAriaLabel(e){this.validateLabel(e)}validateLabel(e,t,a=!1){a||(0,o.r)(this.state._label),(0,n.v)(this,e,{defaultValue:"…"}),(0,l.b)(e),(0,o.a)(this.state._label)}validateLinks(e){(0,s.w)("KolBreadcrumb",this,e)}componentWillLoad(){this.validateLabel(this._label||this._ariaLabel,void 0,!0),this.validateLinks(this._links)}disconnectedCallback(){(0,o.r)(this.state._label)}static get watchers(){return{_ariaLabel:["validateAriaLabel"],_label:["validateLabel"],_links:["validateLinks"]}}};r.style={default:":host{--a11y-min-size:44px;background-color:white;color:black;font-family:Verdana}*{hyphens:auto;letter-spacing:inherit;word-break:break-word;word-spacing:inherit}[role='button'],button:not([role='link']),kol-input .input{min-height:var(--a11y-min-size);min-width:var(--a11y-min-size)}a,button,h1,h2,h3,h4,h5,h6,input,option,select,textarea{font-family:inherit;font-size:inherit}.visually-hidden{clip:rect(0 0 0 0);clip-path:inset(50%);height:1px;overflow:hidden;position:absolute;white-space:nowrap;width:1px}:is(a,button){background-color:transparent;border:none;margin:0;padding:0;width:100%;}[hidden]{display:none !important}:host{max-width:100%}*{box-sizing:border-box}kol-span-wc{display:grid;place-items:center}kol-span-wc>span{display:flex;place-items:center}a,button{cursor:pointer}.icon-only>kol-span-wc>span>span{display:none}li,ul{margin:0;padding:0;list-style:none;display:flex;gap:0.5em;flex-wrap:wrap;place-items:center}kol-icon::part(separator){font-weight:900;font-size:0.7em}kol-icon::part(separator):before{content:'\\f054';font-family:'Font Awesome 6 Free'}"}},6439:(e,t,a)=>{a.d(t,{a:()=>d,c:()=>r,h:()=>s,v:()=>h});var i=a(8225),n=a(4950);const l=/[a-zA-Z0-9äöüÄÖÜß]/g,o=/^\d+$/;function s(e,t=1){return function(e){var t;return"string"==typeof e&&(null===(t=e.match(l))||void 0===t?void 0:t.length)||0}(e)>=t}function r(e){return o.test(e)}const c=new Set(["string"]),h=(e,t,a={})=>{(0,n.w)(e,"_label",(e=>"string"==typeof e),c,t,function(e){var t;return Object.assign(Object.assign({},e),{hooks:{afterPatch:(t,a,n,l)=>{var o,c;"function"==typeof(null===(o=e.hooks)||void 0===o?void 0:o.afterPatch)&&(null===(c=e.hooks)||void 0===c||c.afterPatch(t,a,n,l)),"string"==typeof t&&!1===s(t,3)&&!1===r(t)&&(0,i.a)(`The heading or label ("${t}") is not accessible. A label should consist of at least three readable characters.`),"string"==typeof t&&t.length>80&&(0,i.u)("A heading or label should not be longer than 80 characters.")},beforePatch:null===(t=e.hooks)||void 0===t?void 0:t.beforePatch}})}(a))},d=h},9443:(e,t,a)=>{a.d(t,{a:()=>n,r:()=>l});const i=new Set;function n(e){i.has(e)?console.error(`There already is a nav element with the label "${e}"`):i.add(e)}function l(e){i.delete(e)}},9738:(e,t,a)=>{a.d(t,{w:()=>l});var i=a(8225),n=a(4950);const l=(e,t,a)=>{(0,n.c)(t,"_links",(e=>"object"==typeof e&&("string"==typeof e._href||"string"==typeof e._label)),a),(0,i.c)(e,t.state._links.length)}}}]);
|
package/dist/1338.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
/*! For license information please see 1338.js.LICENSE.txt */
|
|
2
|
-
"use strict";(self.webpackChunk_public_ui_sample_react=self.webpackChunk_public_ui_sample_react||[]).push([[1338],{6105:(e,i,n)=>{n.d(i,{a:()=>c});var a=n(9702),t=n(8225);const r={error:"Fehler",warning:"Warnung",info:"Hinweis",success:"Erfolg",message:"Nachricht",close:"Schließen","form-description":"Formular-Felder, die mit einem Sternchen (*) gekennzeichnet sind, sind Pflichtangaben.",of:"von",characters:"Zeichen",new:"Neu","no-entries":"Es sind keine Einträge vorhanden.","change-order":"Sortierung von {{colLabel}} ändern","action-running":"Aktion wird ausgeführt...","action-done":"Aktion abgeschlossen",pagination:"Paginierung","page-first":"Direkt zur ersten Seite","page-back":"Eine Seite zurück","page-next":"Eine Seite weiter","page-last":"Direkt zur letzten Seite","entries-per-site":"Einträge pro Seite","page-current":"Seite {{page}}","page-selected":"Seite {{page}} ist ausgewählt","page-per-site":"{{entries}} Einträge pro Seite","nav-maximize":"Navigation maximieren","nav-minimize":"Navigation minimieren","logo-description":"Logo {{orgShort}}. Bundesadler mit Flaggenstab und Schriftzug {{orgLong}}","open-link-in-tab":"Öffnet in neuem Tab.","kolibri-logo":"Logo von KoliBri","table-pagination-label":"Paginierung für die Tabelle {{label}}","avatar-alt":"Avatar von {{name}}","toast-close-all":"Alle schließen",version:"Versionsnummer"},o={error:"Error",warning:"Warning",info:"Note",success:"Success",message:"Message",close:"Close","form-description":"Form fields marked with an asterisk (*) are mandatory.",of:"of",characters:"characters",new:"New","no-entries":"No entries available.","change-order":"Change order of {{colLabel}}","action-running":"Action is running...","action-done":"Action done",pagination:"Pagination","page-first":"Directly to the first page","page-back":"One page back","page-next":"One page further","page-last":"Directly to the last page","entries-per-site":"Entries per page","page-current":"Page {{page}}","page-selected":"Page {{page}} is selected","page-per-site":"{{entries}} entries per page","nav-maximize":"Maximize","nav-minimize":"Minimize","logo-description":"Logo {{orgShort}}. Federal eagle with flag staff and lettering {{orgLong}}","open-link-in-tab":"Opens in new tab.","kolibri-logo":"KoliBri logo","table-pagination-label":"Pagination for table {{label}}","avatar-alt":"Avatar of {{name}}","toast-close-all":"Close all",version:"Version number"},s=e=>Object.keys(e).reduce(((i,n)=>(i[`kol-${n}`]=e[n],i)),{}),l=new Set([e=>e("en",s(o)),e=>e("de",s(r))]),c=(e,i)=>{const n=(0,a.g)();if(void 0===n)return(0,t.d)("[I18n] I18nService not available! Please call the global register function."),e;let r=n.translate(e,i);return r===e&&((0,t.d)("[I18n] Locales not initialized! Initialize default locales automatically."),l.forEach((e=>e(((e,i)=>(n.addResourceBundle(e,i),e))))),r=n.translate(e,i)),r}},1338:(e,i,n)=>{n.r(i),n.d(i,{kol_spin:()=>s});var a=n(1456),t=n(6105),r=n(2075),o=n(4950);const s=class{constructor(e){(0,a.r)(this,e),this.showToggled=!1,this._show=!1,this._variant="dot",this.state={_variant:"dot"}}render(){return(0,a.h)(a.H,null,this.state._show?(0,a.h)("span",{"aria-busy":"true","aria-label":(0,t.a)("kol-action-running"),"aria-live":"polite",class:{spin:!0,[this.state._variant]:!0},role:"alert"},function(e){switch(e){case"cycle":return(0,a.h)("span",{class:"loader"});case"none":return(0,a.h)("slot",{name:"expert"});default:return(0,a.h)(a.F,null,(0,a.h)("span",{class:"bg-spin-1"}),(0,a.h)("span",{class:"bg-spin-2"}),(0,a.h)("span",{class:"bg-spin-3"}),(0,a.h)("span",{class:"bg-neutral"}))}}(this.state._variant)):this.showToggled&&(0,a.h)("span",{"aria-label":(0,t.a)("kol-action-done"),"aria-busy":"false","aria-live":"polite",role:"alert"}))}validateShow(e){this.showToggled=!0===this.state._show&&!1===this._show,(0,r.v)(this,e)}validateVariant(e){((e,i)=>{(0,o.w)(e,"_variant",(e=>"cycle"===e||"dot"===e||"none"===e),new Set(["cycle","dot","none"]),i)})(this,e)}componentWillLoad(){this.validateShow(this._show),this.validateVariant(this._variant)}static get watchers(){return{_show:["validateShow"],_variant:["validateVariant"]}}};s.style={default:":host{--a11y-min-size:44px;background-color:white;color:black;font-family:Verdana}*{hyphens:auto;letter-spacing:inherit;word-break:break-word;word-spacing:inherit}[role='button'],button:not([role='link']),kol-input .input{min-height:var(--a11y-min-size);min-width:var(--a11y-min-size)}a,button,h1,h2,h3,h4,h5,h6,input,option,select,textarea{font-family:inherit;font-size:inherit}.visually-hidden{clip:rect(0 0 0 0);clip-path:inset(50%);height:1px;overflow:hidden;position:absolute;white-space:nowrap;width:1px}:is(a,button){background-color:transparent;border:none;margin:0;padding:0;width:100%;}[hidden]{display:none !important}:host{max-width:100%}*{box-sizing:border-box}kol-span-wc{display:grid;place-items:center}kol-span-wc>span{display:flex;place-items:center}a,button{cursor:pointer}.icon-only>kol-span-wc>span>span{display:none}.spin.cycle{width:3rem;height:3rem}.spin.cycle>.loader{display:block;width:100%;height:100%;border-radius:50%;position:relative;animation:2s linear infinite rotate}.spin.cycle>.loader::before{content:'';box-sizing:border-box;position:absolute;inset:0px;border-radius:50%;border:5px solid #333;animation:3s linear infinite prixClipFix}@keyframes rotate{100%{transform:rotate(360deg)}}@keyframes prixClipFix{0%{border-color:#fff;clip-path:polygon(50% 50%, 0 0, 0 0, 0 0, 0 0, 0 0)}25%{border-color:#666;clip-path:polygon(50% 50%, 0 0, 100% 0, 100% 0, 100% 0, 100% 0)}50%{border-color:#fc0;clip-path:polygon(50% 50%, 0 0, 100% 0, 100% 100%, 100% 100%, 100% 100%)}75%{border-color:red;clip-path:polygon(50% 50%, 0 0, 100% 0, 100% 100%, 0 100%, 0 100%)}100%{border-color:#000;clip-path:polygon(50% 50%, 0 0, 100% 0, 100% 100%, 0 100%, 0 0)}}@media (prefers-reduced-motion){.spin.cycle>.loader{animation-duration:4s}.spin.cycle>.loader::before{animation-duration:6s}}.spin.dot{height:1rem;width:3rem}.spin.dot>span{animation-timing-function:cubic-bezier(0, 1, 1, 0);border-radius:50%;border:0.1rem solid #fff;height:0.8rem;position:absolute;top:0.1rem;width:0.8rem}.spin.dot>span:first-child{background-color:#fc0;z-index:0;animation:1s infinite spin1;left:0.1rem}.spin.dot>span:nth-child(2){background-color:red;z-index:1;animation:1s infinite spin2;left:0.1rem}.spin.dot>span:nth-child(3){background-color:#000;z-index:1;animation:1s infinite spin2;left:1.1rem}.spin.dot>span:nth-child(4){background-color:#666;z-index:0;animation:1s infinite spin3;left:2.1rem}@keyframes spin1{0%{transform:scale(0)}100%{transform:scale(1)}}@keyframes spin2{0%{transform:translate(0, 0)}100%{transform:translate(1rem, 0)}}@keyframes spin3{0%{transform:scale(1)}100%{transform:scale(0)}}@media (prefers-reduced-motion){.spin.dot>span:first-child,.spin.dot>span:nth-child(2),.spin.dot>span:nth-child(3),.spin.dot>span:nth-child(4){animation-duration:2s}}.spin{display:block;padding:0.125rem;position:relative}"}},2075:(e,i,n)=>{n.d(i,{v:()=>t});var a=n(4950);const t=(e,i,n)=>{(0,a.a)(e,"_show",i,n)}}}]);
|
package/dist/1517.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
/*! For license information please see 1517.js.LICENSE.txt */
|
|
2
|
-
"use strict";(self.webpackChunk_public_ui_sample_react=self.webpackChunk_public_ui_sample_react||[]).push([[1517],{7383:(t,e,a)=>{a.d(e,{v:()=>n});var i=a(4950);const s=new Set([...new Set(['"left", "right"']),...new Set(['"bottom", "top"'])]),n=(t,e,a)=>{(0,i.w)(t,e,(t=>"bottom"===t||"left"===t||"right"===t||"top"===t),s,a,{defaultValue:"top"})}},9119:(t,e,a)=>{a.d(e,{a:()=>s,v:()=>n});var i=a(4950);const s=(t,e)=>{(0,i.w)(t,"_variant",(t=>"primary"===t||"secondary"===t||"normal"===t||"danger"===t||"ghost"===t||"custom"===t),new Set(["KoliBriButtonVariant {primary, secondary, normal, danger, ghost, custom}"]),e,{defaultValue:"normal"})},n=(t,e)=>{(0,i.d)(t,"_customClass",e,{defaultValue:void 0})}},6105:(t,e,a)=>{a.d(e,{a:()=>h});var i=a(9702),s=a(8225);const n={error:"Fehler",warning:"Warnung",info:"Hinweis",success:"Erfolg",message:"Nachricht",close:"Schließen","form-description":"Formular-Felder, die mit einem Sternchen (*) gekennzeichnet sind, sind Pflichtangaben.",of:"von",characters:"Zeichen",new:"Neu","no-entries":"Es sind keine Einträge vorhanden.","change-order":"Sortierung von {{colLabel}} ändern","action-running":"Aktion wird ausgeführt...","action-done":"Aktion abgeschlossen",pagination:"Paginierung","page-first":"Direkt zur ersten Seite","page-back":"Eine Seite zurück","page-next":"Eine Seite weiter","page-last":"Direkt zur letzten Seite","entries-per-site":"Einträge pro Seite","page-current":"Seite {{page}}","page-selected":"Seite {{page}} ist ausgewählt","page-per-site":"{{entries}} Einträge pro Seite","nav-maximize":"Navigation maximieren","nav-minimize":"Navigation minimieren","logo-description":"Logo {{orgShort}}. Bundesadler mit Flaggenstab und Schriftzug {{orgLong}}","open-link-in-tab":"Öffnet in neuem Tab.","kolibri-logo":"Logo von KoliBri","table-pagination-label":"Paginierung für die Tabelle {{label}}","avatar-alt":"Avatar von {{name}}","toast-close-all":"Alle schließen",version:"Versionsnummer"},o={error:"Error",warning:"Warning",info:"Note",success:"Success",message:"Message",close:"Close","form-description":"Form fields marked with an asterisk (*) are mandatory.",of:"of",characters:"characters",new:"New","no-entries":"No entries available.","change-order":"Change order of {{colLabel}}","action-running":"Action is running...","action-done":"Action done",pagination:"Pagination","page-first":"Directly to the first page","page-back":"One page back","page-next":"One page further","page-last":"Directly to the last page","entries-per-site":"Entries per page","page-current":"Page {{page}}","page-selected":"Page {{page}} is selected","page-per-site":"{{entries}} entries per page","nav-maximize":"Maximize","nav-minimize":"Minimize","logo-description":"Logo {{orgShort}}. Federal eagle with flag staff and lettering {{orgLong}}","open-link-in-tab":"Opens in new tab.","kolibri-logo":"KoliBri logo","table-pagination-label":"Pagination for table {{label}}","avatar-alt":"Avatar of {{name}}","toast-close-all":"Close all",version:"Version number"},l=t=>Object.keys(t).reduce(((e,a)=>(e[`kol-${a}`]=t[a],e)),{}),r=new Set([t=>t("en",l(o)),t=>t("de",l(n))]),h=(t,e)=>{const a=(0,i.g)();if(void 0===a)return(0,s.d)("[I18n] I18nService not available! Please call the global register function."),t;let n=a.translate(t,e);return n===t&&((0,s.d)("[I18n] Locales not initialized! Initialize default locales automatically."),r.forEach((t=>t(((t,e)=>(a.addResourceBundle(t,e),t))))),n=a.translate(t,e)),n}},1517:(t,e,a)=>{a.r(e),a.d(e,{kol_pagination:()=>b});var i=a(1456),s=a(6105),n=a(9119),o=a(6439),l=a(7818),r=a(5677),h=a(4950),g=a(9443),c=a(8670);const p={left:"codicon codicon-debug-reverse-continue"},u={left:"codicon codicon-chevron-left"},d={right:"codicon codicon-chevron-right"},_={right:"codicon codicon-debug-continue"},b=class{constructor(t){(0,i.r)(this,t),this.nonce=(0,r.n)(),this.calcCount=(t,e=1)=>Math.ceil(t/e),this.getCount=()=>this.calcCount(this.state._max,this.state._pageSize),this.onClick=(t,e)=>{"function"==typeof this.state._on.onClick&&this.state._on.onClick(t,e),this.onChangePage(t,e)},this.onChangePage=(t,e)=>{const a=setTimeout((()=>{clearTimeout(a),"function"==typeof this.state._on.onChangePage&&this.state._on.onChangePage(t,e)}))},this.onChangePageSize=(t,e)=>{if("number"==typeof(e=parseInt(e[0]))&&e>0&&this._pageSize!==e){this._pageSize=e;const a=setTimeout((()=>{clearTimeout(a),"function"==typeof this.state._on.onChangePageSize&&this.state._on.onChangePageSize(t,this._pageSize)}))}},this.onGoToFirst={onClick:t=>{this.onClick(t,1)}},this.onGoToEnd={onClick:t=>{this.onClick(t,this.getCount())}},this.onGoBackward={onClick:t=>{this.onClick(t,this.state._page-1)}},this.onGoForward={onClick:t=>{this.onClick(t,this.state._page+1)}},this.beforePageSize=(t,e)=>{let a=e.has("_pageSize")?e.get("_pageSize"):this.state._pageSize;const i=e.has("_pageSizeOptions")?e.get("_pageSizeOptions"):this.state._pageSizeOptions;if(Array.isArray(i)&&i.length>0){const t=i.find((t=>t.value===a));a=void 0===t?i[0].value:t.value,e.set("_pageSize",a)}const s=e.has("_page")?e.get("_page"):this.state._page,n=e.has("_max")?e.get("_max"):this.state._max;this.syncPage(e,s,e.get("_pageSize"),n)},this.syncPage=(t,e,a,i)=>{if(i>0){const s=this.calcCount(i,a);s>0&&(e>s?(t.set("_page",s),this.onChangePage(c.S,s)):e<1&&(t.set("_page",1),this.onChangePage(c.S,1)))}},this.beforePageSizeOptions=(t,e)=>{const a=[];if(Array.isArray(t))for(const e of t)"number"==typeof e&&a.push({label:(0,s.a)("kol-page-per-site",{placeholders:{entries:`${e}`}}),value:e});e.set("_pageSizeOptions",a),this.beforePageSize(a,e)},this._boundaryCount=1,this._customClass=void 0,this._label=void 0,this._hasButtons=!0,this._page=void 0,this._pageSize=1,this._pageSizeOptions=[],this._on=void 0,this._siblingCount=1,this._tooltipAlign="top",this._total=void 0,this._max=void 0,this._variant="normal",this.state={_boundaryCount:1,_label:(0,s.a)("kol-pagination"),_hasButtons:{first:!0,last:!0,next:!0,previous:!0},_on:{onClick:()=>null},_page:0,_pageSize:1,_pageSizeOptions:[],_siblingCount:1,_max:0,_variant:"normal"}}render(){var t;let e=!1;const a=this.getCount(),n=Array.from(Array(a).keys()).map((t=>t+1)).map((t=>t<=this.state._boundaryCount||t>a-this.state._boundaryCount||t>=this.state._page-this.state._siblingCount&&t<=this.state._page+this.state._siblingCount?(e=!0,this.state._page===t?this.getSelectedPageButton(t):this.getUnselectedPageButton(t)):!0===e?(e=!1,(0,i.h)("li",null,(0,i.h)("span",{class:"separator",key:`${this.nonce}-el-${t}`,"aria-hidden":"true"}))):null));return(0,i.h)(i.H,null,(0,i.h)("nav",{"aria-label":this.state._label},(0,i.h)("ul",{class:"navigation-list"},this.state._hasButtons.first&&(0,i.h)("li",null,(0,i.h)("kol-button",{class:"first",exportparts:"icon",_customClass:this.state._customClass,_disabled:this.state._page<=1,_icon:p,_hideLabel:!0,_label:(0,s.a)("kol-page-first"),_on:this.onGoToFirst,_variant:this.state._variant,_tooltipAlign:this.state._tooltipAlign})),this.state._hasButtons.previous&&(0,i.h)("li",null,(0,i.h)("kol-button",{class:"previous",exportparts:"icon",_customClass:this.state._customClass,_disabled:this.state._page<=1,_icon:u,_hideLabel:!0,_label:(0,s.a)("kol-page-back"),_on:this.onGoBackward,_variant:this.state._variant,_tooltipAlign:this.state._tooltipAlign})),n,this.state._hasButtons.next&&(0,i.h)("li",null,(0,i.h)("kol-button",{class:"next",exportparts:"icon",_customClass:this.state._customClass,_disabled:a<=this.state._page,_icon:d,_hideLabel:!0,_label:(0,s.a)("kol-page-next"),_on:this.onGoForward,_variant:this.state._variant,_tooltipAlign:this.state._tooltipAlign})),this.state._hasButtons.last&&(0,i.h)("li",null,(0,i.h)("kol-button",{class:"last",exportparts:"icon",_customClass:this.state._customClass,_disabled:a<=this.state._page,_icon:_,_hideLabel:!0,_label:(0,s.a)("kol-page-last"),_on:this.onGoToEnd,_variant:this.state._variant,_tooltipAlign:this.state._tooltipAlign})))),(null===(t=this.state._pageSizeOptions)||void 0===t?void 0:t.length)>0&&(0,i.h)("kol-select",{_hideLabel:!0,_id:`pagination-size-${this.nonce}`,_label:(0,s.a)("kol-entries-per-site"),_list:this.state._pageSizeOptions,_on:{onChange:this.onChangePageSize},_value:[this.state._pageSize]}))}getUnselectedPageButton(t){return(0,i.h)("li",null,(0,i.h)("kol-button",{exportparts:"icon",key:`${this.nonce}-${t}`,_customClass:this.state._customClass,_label:`${t}`,_on:{onClick:e=>{this.onClick(e,t)}},_variant:this.state._variant}))}getSelectedPageButton(t){return(0,i.h)("li",null,(0,i.h)("kol-button-wc",{class:"selected",key:`${this.nonce}-selected`,_customClass:this.state._customClass,_disabled:!0,_ariaCurrent:!0,_label:`${t}`,_variant:this.state._variant}))}validateBoundaryCount(t){(0,h.e)(this,"_boundaryCount",Math.max(0,null!=t?t:1))}validateCustomClass(t){(0,n.v)(this,t)}validateLabel(t,e,a=!1){a||(0,g.r)(this.state._label),(0,o.v)(this,t),(0,g.a)(this.state._label)}validateHasButtons(t){(0,h.w)(this,"_hasButtons",(t=>"boolean"==typeof t||"string"==typeof t||"object"==typeof t&&null!==t),new Set(["Boolean","PaginationHasButton"]),t,{hooks:{beforePatch:(t,e)=>{if("boolean"==typeof t)e.set("_hasButtons",{first:t,last:t,next:t,previous:t});else{if("string"==typeof t)try{t=(0,h.p)(t)}catch(t){e.delete("_hasButtons")}"object"==typeof t&&null!==t&&e.set("_hasButtons",Object.assign(Object.assign({},this.state._hasButtons),{first:"boolean"==typeof t.first?!0===t.first:this.state._hasButtons.first,last:"boolean"==typeof t.last?!0===t.last:this.state._hasButtons.last,next:"boolean"==typeof t.next?!0===t.next:this.state._hasButtons.next,previous:"boolean"==typeof t.previous?!0===t.previous:this.state._hasButtons.previous}))}}}})}validateOn(t){"object"==typeof t&&null!==t&&(this.state=Object.assign(Object.assign({},this.state),{_on:t}))}validatePage(t){(0,h.e)(this,"_page",t,{hooks:{beforePatch:(t,e)=>{const a=e.has("_pageSize")?e.get("_pageSize"):this.state._pageSize,i=e.has("_max")?e.get("_max"):this.state._max;this.syncPage(e,t,a,i)}}})}validatePageSize(t){(0,h.e)(this,"_pageSize",t,{hooks:{beforePatch:this.beforePageSize}})}validatePageSizeOptions(t){(0,h.c)(this,"_pageSizeOptions",(t=>"number"==typeof t),t,void 0,{hooks:{beforePatch:this.beforePageSizeOptions}})}validateSiblingCount(t){(0,h.e)(this,"_siblingCount",Math.max(0,null!=t?t:1))}validateTotal(t){this.validateMax(t)}validateMax(t){((t,e,a)=>{(0,h.e)(t,"_max",e,a)})(this,t,{hooks:{beforePatch:(t,e)=>{const a=e.has("_page")?e.get("_page"):this.state._page,i=e.has("_pageSize")?e.get("_pageSize"):this.state._pageSize;this.syncPage(e,a,i,t)}}})}validateTooltipAlign(t){(0,l.v)(this,t)}validateVariant(t){(0,n.a)(this,t)}componentWillLoad(){this.validateBoundaryCount(this._boundaryCount),this.validateCustomClass(this._customClass),this.validateHasButtons(this._hasButtons),this.validateLabel(this._label,void 0,!0),this.validateOn(this._on),this.validatePage(this._page),this.validatePageSize(this._pageSize),this.validatePageSizeOptions(this._pageSizeOptions),this.validateSiblingCount(this._siblingCount),this.validateTooltipAlign(this._tooltipAlign),this.validateMax(this._max||this._total),this.validateVariant(this._variant),this.validatePage(this._page)}disconnectedCallback(){(0,g.r)(this.state._label)}static get watchers(){return{_boundaryCount:["validateBoundaryCount"],_customClass:["validateCustomClass"],_label:["validateLabel"],_hasButtons:["validateHasButtons"],_on:["validateOn"],_page:["validatePage"],_pageSize:["validatePageSize"],_pageSizeOptions:["validatePageSizeOptions"],_siblingCount:["validateSiblingCount"],_total:["validateTotal"],_max:["validateMax"],_tooltipAlign:["validateTooltipAlign"],_variant:["validateVariant"]}}};b.style={default:":host{--a11y-min-size:44px;background-color:white;color:black;font-family:Verdana}*{hyphens:auto;letter-spacing:inherit;word-break:break-word;word-spacing:inherit}[role='button'],button:not([role='link']),kol-input .input{min-height:var(--a11y-min-size);min-width:var(--a11y-min-size)}a,button,h1,h2,h3,h4,h5,h6,input,option,select,textarea{font-family:inherit;font-size:inherit}.visually-hidden{clip:rect(0 0 0 0);clip-path:inset(50%);height:1px;overflow:hidden;position:absolute;white-space:nowrap;width:1px}:is(a,button){background-color:transparent;border:none;margin:0;padding:0;width:100%;}[hidden]{display:none !important}:host{max-width:100%}*{box-sizing:border-box}kol-span-wc{display:grid;place-items:center}kol-span-wc>span{display:flex;place-items:center}a,button{cursor:pointer}.icon-only>kol-span-wc>span>span{display:none}.navigation-list{list-style:none}.separator:before{content:'•••'}"}},6439:(t,e,a)=>{a.d(e,{a:()=>c,c:()=>r,h:()=>l,v:()=>g});var i=a(8225),s=a(4950);const n=/[a-zA-Z0-9äöüÄÖÜß]/g,o=/^\d+$/;function l(t,e=1){return function(t){var e;return"string"==typeof t&&(null===(e=t.match(n))||void 0===e?void 0:e.length)||0}(t)>=e}function r(t){return o.test(t)}const h=new Set(["string"]),g=(t,e,a={})=>{(0,s.w)(t,"_label",(t=>"string"==typeof t),h,e,function(t){var e;return Object.assign(Object.assign({},t),{hooks:{afterPatch:(e,a,s,n)=>{var o,h;"function"==typeof(null===(o=t.hooks)||void 0===o?void 0:o.afterPatch)&&(null===(h=t.hooks)||void 0===h||h.afterPatch(e,a,s,n)),"string"==typeof e&&!1===l(e,3)&&!1===r(e)&&(0,i.a)(`The heading or label ("${e}") is not accessible. A label should consist of at least three readable characters.`),"string"==typeof e&&e.length>80&&(0,i.u)("A heading or label should not be longer than 80 characters.")},beforePatch:null===(e=t.hooks)||void 0===e?void 0:e.beforePatch}})}(a))},c=g},7818:(t,e,a)=>{a.d(e,{v:()=>s});var i=a(7383);const s=(t,e)=>{(0,i.v)(t,"_tooltipAlign",e)}},9443:(t,e,a)=>{a.d(e,{a:()=>s,r:()=>n});const i=new Set;function s(t){i.has(t)?console.error(`There already is a nav element with the label "${t}"`):i.add(t)}function n(t){i.delete(t)}}}]);
|
package/dist/2163.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
/*! For license information please see 2163.js.LICENSE.txt */
|
|
2
|
-
"use strict";(self.webpackChunk_public_ui_sample_react=self.webpackChunk_public_ui_sample_react||[]).push([[2163],{6105:(e,a,i)=>{i.d(a,{a:()=>c});var t=i(9702),n=i(8225);const r={error:"Fehler",warning:"Warnung",info:"Hinweis",success:"Erfolg",message:"Nachricht",close:"Schließen","form-description":"Formular-Felder, die mit einem Sternchen (*) gekennzeichnet sind, sind Pflichtangaben.",of:"von",characters:"Zeichen",new:"Neu","no-entries":"Es sind keine Einträge vorhanden.","change-order":"Sortierung von {{colLabel}} ändern","action-running":"Aktion wird ausgeführt...","action-done":"Aktion abgeschlossen",pagination:"Paginierung","page-first":"Direkt zur ersten Seite","page-back":"Eine Seite zurück","page-next":"Eine Seite weiter","page-last":"Direkt zur letzten Seite","entries-per-site":"Einträge pro Seite","page-current":"Seite {{page}}","page-selected":"Seite {{page}} ist ausgewählt","page-per-site":"{{entries}} Einträge pro Seite","nav-maximize":"Navigation maximieren","nav-minimize":"Navigation minimieren","logo-description":"Logo {{orgShort}}. Bundesadler mit Flaggenstab und Schriftzug {{orgLong}}","open-link-in-tab":"Öffnet in neuem Tab.","kolibri-logo":"Logo von KoliBri","table-pagination-label":"Paginierung für die Tabelle {{label}}","avatar-alt":"Avatar von {{name}}","toast-close-all":"Alle schließen",version:"Versionsnummer"},o={error:"Error",warning:"Warning",info:"Note",success:"Success",message:"Message",close:"Close","form-description":"Form fields marked with an asterisk (*) are mandatory.",of:"of",characters:"characters",new:"New","no-entries":"No entries available.","change-order":"Change order of {{colLabel}}","action-running":"Action is running...","action-done":"Action done",pagination:"Pagination","page-first":"Directly to the first page","page-back":"One page back","page-next":"One page further","page-last":"Directly to the last page","entries-per-site":"Entries per page","page-current":"Page {{page}}","page-selected":"Page {{page}} is selected","page-per-site":"{{entries}} entries per page","nav-maximize":"Maximize","nav-minimize":"Minimize","logo-description":"Logo {{orgShort}}. Federal eagle with flag staff and lettering {{orgLong}}","open-link-in-tab":"Opens in new tab.","kolibri-logo":"KoliBri logo","table-pagination-label":"Pagination for table {{label}}","avatar-alt":"Avatar of {{name}}","toast-close-all":"Close all",version:"Version number"},l=e=>Object.keys(e).reduce(((a,i)=>(a[`kol-${i}`]=e[i],a)),{}),s=new Set([e=>e("en",l(o)),e=>e("de",l(r))]),c=(e,a)=>{const i=(0,t.g)();if(void 0===i)return(0,n.d)("[I18n] I18nService not available! Please call the global register function."),e;let r=i.translate(e,a);return r===e&&((0,n.d)("[I18n] Locales not initialized! Initialize default locales automatically."),s.forEach((e=>e(((e,a)=>(i.addResourceBundle(e,a),e))))),r=i.translate(e,a)),r}},2163:(e,a,i)=>{i.r(a),i.d(a,{kol_symbol:()=>l});var t=i(1456),n=i(6105),r=i(6439),o=i(4950);const l=class{constructor(e){(0,t.r)(this,e),this._ariaLabel=void 0,this._label=void 0,this._symbol=void 0,this.state={_label:(0,n.a)("kol-warning"),_symbol:"…"}}render(){return(0,t.h)(t.H,null,(0,t.h)("span",{"aria-label":this.state._label,role:"term"},this.state._symbol))}validateAriaLabel(e){this.validateLabel(e)}validateLabel(e){(0,r.v)(this,e,{defaultValue:(0,n.a)("kol-warning")})}validateSymbol(e){(0,o.d)(this,"_symbol",e,{required:!0})}componentWillLoad(){this.validateLabel(this._label||this._ariaLabel),this.validateSymbol(this._symbol)}static get watchers(){return{_ariaLabel:["validateAriaLabel"],_label:["validateLabel"],_symbol:["validateSymbol"]}}}},6439:(e,a,i)=>{i.d(a,{a:()=>d,c:()=>s,h:()=>l,v:()=>g});var t=i(8225),n=i(4950);const r=/[a-zA-Z0-9äöüÄÖÜß]/g,o=/^\d+$/;function l(e,a=1){return function(e){var a;return"string"==typeof e&&(null===(a=e.match(r))||void 0===a?void 0:a.length)||0}(e)>=a}function s(e){return o.test(e)}const c=new Set(["string"]),g=(e,a,i={})=>{(0,n.w)(e,"_label",(e=>"string"==typeof e),c,a,function(e){var a;return Object.assign(Object.assign({},e),{hooks:{afterPatch:(a,i,n,r)=>{var o,c;"function"==typeof(null===(o=e.hooks)||void 0===o?void 0:o.afterPatch)&&(null===(c=e.hooks)||void 0===c||c.afterPatch(a,i,n,r)),"string"==typeof a&&!1===l(a,3)&&!1===s(a)&&(0,t.a)(`The heading or label ("${a}") is not accessible. A label should consist of at least three readable characters.`),"string"==typeof a&&a.length>80&&(0,t.u)("A heading or label should not be longer than 80 characters.")},beforePatch:null===(a=e.hooks)||void 0===a?void 0:a.beforePatch}})}(i))},d=g}}]);
|
package/dist/2415.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
/*! For license information please see 2415.js.LICENSE.txt */
|
|
2
|
-
"use strict";(self.webpackChunk_public_ui_sample_react=self.webpackChunk_public_ui_sample_react||[]).push([[2415],{2349:(t,e,i)=>{i.d(e,{I:()=>p,a:()=>c,f:()=>d,v:()=>h});var a=i(4950),o=i(6439),s=i(8225),l=i(8670),n=i(3464);const r=t=>{if("object"==typeof t&&null!==t){if("string"==typeof t.label&&t.label.length>0)return t.disabled=!0===t.disabled,t.label=`${t.label}`.trim(),!1===(0,o.h)(t.label,3)&&!1===(0,o.c)(t.label)&&(0,s.a)(`Ein abweichendes Aria-Label (${t.label}) ist nicht barrierefrei. Ein abweichendes Aria-Label sollte aus mindestens drei lesbaren Zeichen bestehen.`),!Array.isArray(t.options)||void 0===t.options.find((t=>!1===r(t)));if("number"==typeof t.label)return!0}return!1},h=(t,e,i={})=>{(0,a.c)(t,"_options",r,e,void 0,i)},d=(t,e,i="")=>{e.forEach(((e,a)=>{const o=`${i}-${a}`;"object"==typeof e&&null!==e&&"string"==typeof e.label&&e.label.length>0&&(Array.isArray(e.options)?d(t,e.options,o):t.set(o,e))}))};class p extends n.I{constructor(t,e,i){super(t,e,i),this.component=t}validateRequired(t){((t,e)=>{(0,a.a)(t,"_required",e)})(this.component,t)}componentWillLoad(){super.componentWillLoad(),this.validateRequired(this.component._required)}}class c extends p{constructor(t,e,i){super(t,e,i),this.keyOptionMap=new Map,this.getOptionByKey=t=>this.keyOptionMap.get(t),this.isValueInOptions=(t,e)=>void 0!==e.find((e=>e.value===t)),this.beforePatchOptions=(t,e)=>{const i=e.has("_options")?e.get("_options"):this.component.state._options;if(Array.isArray(i)&&i.length>0){this.keyOptionMap.clear(),d(this.keyOptionMap,i);const t=e.has("_value")?e.get("_value"):this.component.state._value;if(!1===this.isValueInOptions(t,i)){const t=i[0].value;e.set("_value",t),this.onStateChange()}}},this.component=t}validateOrientation(t){(0,a.w)(this.component,"_orientation",(t=>"horizontal"===t||"vertical"===t),new Set(["Orientation {horizontal, vertical}"]),t,{defaultValue:"vertical"})}validateOptions(t){((t,e,i={})=>{(0,a.c)(t,"_options",(t=>"object"==typeof t&&null!==t&&"string"==typeof t.label&&t.label.length>0),e,void 0,i)})(this.component,t,{hooks:{beforePatch:this.beforePatchOptions}})}validateValue(t){t=(0,a.m)(t),t=Array.isArray(t)?t[0]:t,(0,a.s)(this.component,"_value",t,{beforePatch:this.beforePatchOptions}),this.setFormAssociatedValue(this.component._value)}componentWillLoad(t){super.componentWillLoad(),this.onStateChange=()=>{if("function"==typeof t){const e=setTimeout((()=>{clearTimeout(e),t(l.S)}))}},this.validateOrientation(this.component._orientation),this.validateOptions(this.component._options||this.component._list),this.validateValue(this.component._value)}}},2415:(t,e,i)=>{i.r(e),i.d(e,{kol_select:()=>v});var a=i(1456),o=i(5677),s=i(4014),l=i(8670),n=i(3464),r=i(2349),h=i(6109),d=i(4950),p=i(4385);class c extends p.I{constructor(t,e,i){super(t,e,i),this.keyOptionMap=new Map,this.getOptionByKey=t=>this.keyOptionMap.get(t),this.isValueInOptions=(t,e)=>void 0!==e.find((e=>"string"==typeof e.value?e.value===t:!!Array.isArray(e.options)&&this.isValueInOptions(t,e.options))),this.filterValuesInOptions=(t,e)=>t.filter((t=>void 0!==this.isValueInOptions(t,e))),this.beforePatchOptions=(t,e)=>{const i=e.has("_options")?e.get("_options"):this.component.state._options;if(Array.isArray(i)&&i.length>0){this.keyOptionMap.clear(),(0,r.f)(this.keyOptionMap,i);const t=e.has("_value")?e.get("_value"):this.component.state._value,a=this.filterValuesInOptions(Array.isArray(t)&&t.length>0?t:[],i);!1===this.component._multiple&&0===a.length?(e.set("_value",[i[0].value]),this.onStateChange()):Array.isArray(t)&&a.length<t.length&&(e.set("_value",a),this.onStateChange())}},this.component=t}validateHeight(t){(0,d.d)(this.component,"_height",t)}validateOptions(t){(0,r.v)(this.component,t,{hooks:{beforePatch:this.beforePatchOptions}})}validateMultiple(t){(0,d.a)(this.component,"_multiple",t,{hooks:{beforePatch:this.beforePatchOptions}})}validateRequired(t){(0,d.a)(this.component,"_required",t)}validateRows(t){(0,h.v)(this.component,t)}validateValue(t){(0,d.c)(this.component,"_value",(()=>!0),t,void 0,{hooks:{beforePatch:this.beforePatchOptions}}),this.setFormAssociatedValue(this.component._value)}componentWillLoad(t){super.componentWillLoad(),this.onStateChange=()=>{if("function"==typeof t){const e=setTimeout((()=>{clearTimeout(e),t(l.S)}))}},this.validateHeight(this.component._height),this.validateOptions(this.component._options||this.component._list),this.validateMultiple(this.component._multiple),this.validateRequired(this.component._required),this.validateRows(this.component._rows||this.component._size),this.validateValue(this.component._value)}}const u=(t,e)=>Array.isArray(t)&&t.includes(e),v=class{renderOptgroup(t,e){var i;return(0,a.h)("optgroup",{disabled:t.disabled,label:t.label},null===(i=t.options)||void 0===i?void 0:i.map(((t,i)=>{const o=`${e}-${i}`;return Array.isArray(t.options)?this.renderOptgroup(t,o):(0,a.h)("option",{disabled:t.disabled,key:o,selected:u(this.state._value,t.value),value:o},t.label)})))}render(){const{ariaDescribedBy:t}=(0,n.g)(this.state),e=(0,l.s)(this.state._label);return(0,a.h)(a.H,{class:{"has-value":this.state._hasValue}},(0,a.h)("kol-input",{class:{"hide-label":!!this.state._hideLabel,select:!0},_disabled:this.state._disabled,_error:this.state._error,_hideError:this.state._hideError,_hideLabel:this.state._hideLabel,_hint:this.state._hint,_icons:this.state._icons,_id:this.state._id,_label:this.state._label,_required:this.state._required,_tooltipAlign:this._tooltipAlign,_touched:this.state._touched,onClick:()=>{var t;return null===(t=this.ref)||void 0===t?void 0:t.focus()},role:"presentation"},(0,a.h)("span",{slot:"label"},e?(0,a.h)("slot",null):this.state._label),(0,a.h)("div",{slot:"input"},(0,a.h)("select",{ref:this.catchRef,title:"",accessKey:this.state._accessKey,"aria-describedby":t.length>0?t.join(" "):void 0,"aria-label":this.state._hideLabel&&"string"==typeof this.state._label?this.state._label:void 0,autoCapitalize:"off",autoCorrect:"off",disabled:this.state._disabled,id:this.state._id,multiple:this.state._multiple,name:this.state._name,required:this.state._required,size:this.state._rows,spellcheck:"false",style:{height:this.state._height},onClick:this.controller.onFacade.onClick,onBlur:this.controller.onFacade.onBlur,onFocus:this.controller.onFacade.onFocus,onChange:this.onChange},this.state._options.map(((t,e)=>{const i=`-${e}`;return Array.isArray(t.options)?this.renderOptgroup(t,i):(0,a.h)("option",{disabled:t.disabled,key:i,selected:u(this.state._value,t.value),value:i},t.label)}))))))}constructor(t){(0,a.r)(this,t),this.catchRef=t=>{this.ref=t,(0,l.a)(this.host,this.ref)},this.onChange=t=>{var e,i;this._value=Array.from((null===(e=this.ref)||void 0===e?void 0:e.options)||[]).filter((t=>!0===t.selected)).map((t=>{var e;return null===(e=this.controller.getOptionByKey(t.value))||void 0===e?void 0:e.value})),(0,s.s)(t),(0,s.t)("change",this.host,this._value),this.controller.setFormAssociatedValue(this._value),"function"==typeof(null===(i=this.state._on)||void 0===i?void 0:i.onChange)&&this.state._on.onChange(t,this._value)},this._accessKey=void 0,this._alert=!0,this._disabled=!1,this._error=void 0,this._height=void 0,this._hideError=!1,this._hideLabel=!1,this._hint="",this._icon=void 0,this._icons=void 0,this._id=void 0,this._label=void 0,this._list=void 0,this._multiple=!1,this._name=void 0,this._on=void 0,this._options=void 0,this._required=!1,this._rows=void 0,this._size=void 0,this._syncValueBySelector=void 0,this._tabIndex=void 0,this._tooltipAlign="top",this._touched=!1,this._value=void 0,this.state={_hasValue:!1,_height:"",_hideError:!1,_id:`id-${(0,o.n)()}`,_label:"…",_multiple:!1,_options:[],_value:[]},this.controller=new c(this,"select",this.host)}validateAccessKey(t){this.controller.validateAccessKey(t)}validateAlert(t){this.controller.validateAlert(t)}validateDisabled(t){this.controller.validateDisabled(t)}validateError(t){this.controller.validateError(t)}validateHeight(t){this.controller.validateHeight(t)}validateHideError(t){this.controller.validateHideError(t)}validateHideLabel(t){this.controller.validateHideLabel(t)}validateHint(t){this.controller.validateHint(t)}validateIcon(t){this.validateIcons(t)}validateIcons(t){this.controller.validateIcons(t)}validateId(t){this.controller.validateId(t)}validateLabel(t){this.controller.validateLabel(t)}validateList(t){this.validateOptions(t)}validateMultiple(t){this.controller.validateMultiple(t)}validateName(t){this.controller.validateName(t)}validateOn(t){this.controller.validateOn(t)}validateOptions(t){this.controller.validateOptions(t)}validateRequired(t){this.controller.validateRequired(t)}validateRows(t){this.controller.validateRows(t)}validateSize(t){this.controller.validateRows(t)}validateSyncValueBySelector(t){this.controller.validateSyncValueBySelector(t)}validateTabIndex(t){this.controller.validateTabIndex(t)}validateTouched(t){this.controller.validateTouched(t)}validateValue(t){this.controller.validateValue(t)}componentWillLoad(){this._alert=!0===this._alert,this._touched=!0===this._touched,this.controller.componentWillLoad(this.onChange),this.state._hasValue=!!this.state._value,this.controller.addValueChangeListener((t=>this.state._hasValue=!!t))}get host(){return(0,a.g)(this)}static get watchers(){return{_accessKey:["validateAccessKey"],_alert:["validateAlert"],_disabled:["validateDisabled"],_error:["validateError"],_height:["validateHeight"],_hideError:["validateHideError"],_hideLabel:["validateHideLabel"],_hint:["validateHint"],_icon:["validateIcon"],_icons:["validateIcons"],_id:["validateId"],_label:["validateLabel"],_list:["validateList"],_multiple:["validateMultiple"],_name:["validateName"],_on:["validateOn"],_options:["validateOptions"],_required:["validateRequired"],_rows:["validateRows"],_size:["validateSize"],_syncValueBySelector:["validateSyncValueBySelector"],_tabIndex:["validateTabIndex"],_touched:["validateTouched"],_value:["validateValue"]}}};v.style={default:":host{--a11y-min-size:44px;background-color:white;color:black;font-family:Verdana}*{hyphens:auto;letter-spacing:inherit;word-break:break-word;word-spacing:inherit}[role='button'],button:not([role='link']),kol-input .input{min-height:var(--a11y-min-size);min-width:var(--a11y-min-size)}a,button,h1,h2,h3,h4,h5,h6,input,option,select,textarea{font-family:inherit;font-size:inherit}.visually-hidden{clip:rect(0 0 0 0);clip-path:inset(50%);height:1px;overflow:hidden;position:absolute;white-space:nowrap;width:1px}:is(a,button){background-color:transparent;border:none;margin:0;padding:0;width:100%;}[hidden]{display:none !important}:host{max-width:100%}*{box-sizing:border-box}kol-span-wc{display:grid;place-items:center}kol-span-wc>span{display:flex;place-items:center}a,button{cursor:pointer}.icon-only>kol-span-wc>span>span{display:none}.required label>span::after,.required legend>span::after{content:'*'}:host{display:block}input,textarea{cursor:text}input[type='checkbox'],input[type='color'],input[type='file'],input[type='radio'],input[type='range'],label,option,select{cursor:pointer}input[type='color'],input[type='date'],input[type='datetime-local'],input[type='email'],input[type='file'],input[type='month'],input[type='number'],input[type='password'],input[type='search'],input[type='tel'],input[type='text'],input[type='time'],input[type='url'],input[type='week'],select,select[multiple] option,textarea{font-size:1rem;width:100%}input[type='file']{padding:calc((var(--a11y-min-size) - 1rem) / 10) 0.5em}select[multiple] option{padding:calc((var(--a11y-min-size) - 1rem) / 2) 0.5em}kol-input.disabled :is(button,input,option,select,textarea,.input-label){cursor:not-allowed;opacity:0.5}kol-input{display:grid}kol-input .input-slot{flex-grow:1}input:not([type='checkbox'],[type='radio']),select:not([multiple],[size]){height:2.75em}input:focus,option:focus,select:focus,textarea:focus{outline:0}.input{display:flex;align-items:center}.input>kol-icon{display:grid;height:var(--a11y-min-size);place-items:center}kol-input.required .input-tooltip .span-label::after{content:'*'}.error.hidden{display:none}"}},6109:(t,e,i)=>{i.d(e,{v:()=>o});var a=i(4950);const o=(t,e)=>{(0,a.e)(t,"_rows",e,{min:1})}}}]);
|