@public-ui/sample-react 2.0.9 → 2.0.11

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.
Files changed (233) hide show
  1. package/dist/1051.js +2 -0
  2. package/dist/1278.js +2 -0
  3. package/dist/1499.js +2 -0
  4. package/dist/{5027.js → 1502.js} +2 -2
  5. package/dist/1517.js +1 -1
  6. package/dist/{9727.js → 1699.js} +2 -2
  7. package/dist/1848.js +2 -0
  8. package/dist/1940.js +2 -0
  9. package/dist/2015.js +2 -0
  10. package/dist/2156.js +2 -0
  11. package/dist/2182.js +2 -0
  12. package/dist/{3034.js → 2186.js} +2 -2
  13. package/dist/2439.js +2 -0
  14. package/dist/2619.js +2 -0
  15. package/dist/2624.js +2 -0
  16. package/dist/2671.js +2 -0
  17. package/dist/2926.js +2 -0
  18. package/dist/3028.js +2 -0
  19. package/dist/{3845.js → 3073.js} +2 -2
  20. package/dist/{9681.js → 3448.js} +2 -2
  21. package/dist/351.js +2 -0
  22. package/dist/3525.js +2 -0
  23. package/dist/3625.js +2 -0
  24. package/dist/4619.js +2 -0
  25. package/dist/4937.js +2 -0
  26. package/dist/5172.js +2 -0
  27. package/dist/528.js +2 -0
  28. package/dist/5342.js +2 -0
  29. package/dist/5431.js +2 -0
  30. package/dist/5615.js +1 -1
  31. package/dist/{4279.js → 5784.js} +2 -2
  32. package/dist/5896.js +2 -0
  33. package/dist/6114.js +2 -0
  34. package/dist/6329.js +2 -0
  35. package/dist/6357.js +2 -0
  36. package/dist/6511.js +2 -0
  37. package/dist/{8734.js → 7086.js} +2 -2
  38. package/dist/710.js +2 -0
  39. package/dist/7160.js +2 -0
  40. package/dist/{5324.js → 7240.js} +2 -2
  41. package/dist/7435.js +2 -0
  42. package/dist/7628.js +2 -0
  43. package/dist/{3466.js → 7732.js} +2 -2
  44. package/dist/{6826.js → 7748.js} +2 -2
  45. package/dist/7950.js +2 -0
  46. package/dist/7986.js +2 -0
  47. package/dist/8231.js +2 -0
  48. package/dist/8240.js +2 -0
  49. package/dist/8247.js +2 -0
  50. package/dist/8256.js +2 -0
  51. package/dist/8494.js +2 -0
  52. package/dist/8507.js +2 -0
  53. package/dist/9021.js +2 -0
  54. package/dist/{1181.js → 9035.js} +2 -2
  55. package/dist/{1596.js → 9094.js} +2 -2
  56. package/dist/{9865.js → 9179.js} +2 -2
  57. package/dist/9183.js +2 -0
  58. package/dist/{2079.js → 9190.js} +2 -2
  59. package/dist/{2643.js → 9237.js} +2 -2
  60. package/dist/9246.js +2 -0
  61. package/dist/9456.js +2 -0
  62. package/dist/9483.js +2 -0
  63. package/dist/{5373.js → 9485.js} +2 -2
  64. package/dist/{2163.js → 9528.js} +2 -2
  65. package/dist/9622.js +2 -0
  66. package/dist/97.js +2 -0
  67. package/dist/9758.js +2 -0
  68. package/dist/{4463.js → 9829.js} +2 -2
  69. package/dist/9829.js.LICENSE.txt +3 -0
  70. package/dist/9918.js +2 -0
  71. package/dist/9918.js.LICENSE.txt +3 -0
  72. package/dist/{3600.js → 9993.js} +2 -2
  73. package/dist/9993.js.LICENSE.txt +3 -0
  74. package/dist/main.css +1 -1
  75. package/dist/main.js +1 -1
  76. package/package.json +13 -13
  77. package/src/App.tsx +6 -5
  78. package/src/components/handout/basic.tsx +50 -19
  79. package/src/components/input-checkbox/partials/cases.tsx +1 -1
  80. package/src/components/input-color/partials/cases.tsx +8 -2
  81. package/src/components/input-date/partials/cases.tsx +9 -1
  82. package/src/components/input-email/partials/cases.tsx +2 -2
  83. package/src/components/input-file/partials/cases.tsx +2 -2
  84. package/src/components/input-number/partials/cases.tsx +1 -1
  85. package/src/components/input-password/partials/cases.tsx +2 -2
  86. package/src/components/input-radio/objectValue.tsx +37 -0
  87. package/src/components/input-radio/partials/cases.tsx +2 -2
  88. package/src/components/input-radio/routes.ts +2 -0
  89. package/src/components/input-radio/select.tsx +1 -1
  90. package/src/components/input-range/partials/cases.tsx +12 -2
  91. package/src/components/input-text/hide-errors.tsx +3 -3
  92. package/src/components/input-text/partials/cases.tsx +4 -4
  93. package/src/components/nav/links.ts +18 -2
  94. package/src/components/progress/basic.tsx +2 -0
  95. package/src/components/select/partials/cases.tsx +10 -2
  96. package/src/components/spin/custom.tsx +4 -1
  97. package/src/components/split-button/basic.tsx +1 -1
  98. package/src/components/table/render-cell.tsx +2 -8
  99. package/src/components/textarea/counter.tsx +7 -1
  100. package/src/components/textarea/disabled.tsx +6 -1
  101. package/src/components/textarea/partials/cases.tsx +1 -1
  102. package/src/components/textarea/readonly.tsx +6 -1
  103. package/src/components/toast/basic.tsx +1 -1
  104. package/src/react.main.tsx +40 -22
  105. package/src/scenarios/appointment-form/AvailableAppointmentsForm.tsx +11 -4
  106. package/src/scenarios/appointment-form/DistrictForm.tsx +9 -2
  107. package/src/scenarios/appointment-form/PersonalInformationForm.tsx +8 -2
  108. package/src/scenarios/appointment-form/formUtils.ts +6 -0
  109. package/src/scenarios/routes.ts +0 -2
  110. package/src/shares/react-roots.ts +1 -0
  111. package/src/shares/store.ts +5 -5
  112. package/src/shares/theme.ts +6 -5
  113. package/webpack.config.js +1 -0
  114. package/dist/1090.js +0 -2
  115. package/dist/1218.js +0 -2
  116. package/dist/1280.js +0 -2
  117. package/dist/1338.js +0 -2
  118. package/dist/2415.js +0 -2
  119. package/dist/2594.js +0 -2
  120. package/dist/2611.js +0 -2
  121. package/dist/3099.js +0 -2
  122. package/dist/3145.js +0 -2
  123. package/dist/3345.js +0 -2
  124. package/dist/3388.js +0 -2
  125. package/dist/3580.js +0 -2
  126. package/dist/3619.js +0 -2
  127. package/dist/3776.js +0 -2
  128. package/dist/4150.js +0 -2
  129. package/dist/42.js +0 -2
  130. package/dist/4669.js +0 -2
  131. package/dist/4686.js +0 -2
  132. package/dist/4689.js +0 -2
  133. package/dist/4756.js +0 -2
  134. package/dist/521.js +0 -2
  135. package/dist/5518.js +0 -2
  136. package/dist/5853.js +0 -2
  137. package/dist/6010.js +0 -2
  138. package/dist/6308.js +0 -2
  139. package/dist/7170.js +0 -2
  140. package/dist/755.js +0 -2
  141. package/dist/7654.js +0 -2
  142. package/dist/8037.js +0 -2
  143. package/dist/817.js +0 -2
  144. package/dist/8180.js +0 -2
  145. package/dist/8341.js +0 -2
  146. package/dist/8612.js +0 -2
  147. package/dist/881.js +0 -2
  148. package/dist/8869.js +0 -2
  149. package/dist/892.js +0 -2
  150. package/dist/8948.js +0 -2
  151. package/dist/8951.js +0 -2
  152. package/dist/9150.js +0 -2
  153. package/dist/9317.js +0 -2
  154. package/dist/9330.js +0 -2
  155. package/dist/9700.js +0 -2
  156. package/dist/9797.js +0 -2
  157. package/dist/9886.js +0 -2
  158. package/dist/9912.js +0 -2
  159. package/dist/9984.js +0 -2
  160. package/src/components/abbr/basic.html +0 -6
  161. package/src/scenarios/complex-form/common/form/component.tsx +0 -25
  162. package/src/scenarios/complex-form/common/form/types.ts +0 -13
  163. package/src/scenarios/complex-form/component.tsx +0 -164
  164. package/src/scenarios/complex-form/kopfdaten/component.tsx +0 -52
  165. package/src/scenarios/complex-form/location/component.tsx +0 -18
  166. package/src/scenarios/complex-form/location/location.form.ts +0 -22
  167. package/src/scenarios/complex-form/schedule/component.tsx +0 -18
  168. package/src/scenarios/complex-form/schedule/schedule.form.ts +0 -34
  169. /package/dist/{1090.js.LICENSE.txt → 1051.js.LICENSE.txt} +0 -0
  170. /package/dist/{1181.js.LICENSE.txt → 1278.js.LICENSE.txt} +0 -0
  171. /package/dist/{1218.js.LICENSE.txt → 1499.js.LICENSE.txt} +0 -0
  172. /package/dist/{1280.js.LICENSE.txt → 1502.js.LICENSE.txt} +0 -0
  173. /package/dist/{1338.js.LICENSE.txt → 1699.js.LICENSE.txt} +0 -0
  174. /package/dist/{1596.js.LICENSE.txt → 1848.js.LICENSE.txt} +0 -0
  175. /package/dist/{2079.js.LICENSE.txt → 1940.js.LICENSE.txt} +0 -0
  176. /package/dist/{2163.js.LICENSE.txt → 2015.js.LICENSE.txt} +0 -0
  177. /package/dist/{2415.js.LICENSE.txt → 2156.js.LICENSE.txt} +0 -0
  178. /package/dist/{2594.js.LICENSE.txt → 2182.js.LICENSE.txt} +0 -0
  179. /package/dist/{2611.js.LICENSE.txt → 2186.js.LICENSE.txt} +0 -0
  180. /package/dist/{2643.js.LICENSE.txt → 2439.js.LICENSE.txt} +0 -0
  181. /package/dist/{3034.js.LICENSE.txt → 2619.js.LICENSE.txt} +0 -0
  182. /package/dist/{3099.js.LICENSE.txt → 2624.js.LICENSE.txt} +0 -0
  183. /package/dist/{3145.js.LICENSE.txt → 2671.js.LICENSE.txt} +0 -0
  184. /package/dist/{3345.js.LICENSE.txt → 2926.js.LICENSE.txt} +0 -0
  185. /package/dist/{3388.js.LICENSE.txt → 3028.js.LICENSE.txt} +0 -0
  186. /package/dist/{3466.js.LICENSE.txt → 3073.js.LICENSE.txt} +0 -0
  187. /package/dist/{3580.js.LICENSE.txt → 3448.js.LICENSE.txt} +0 -0
  188. /package/dist/{3600.js.LICENSE.txt → 351.js.LICENSE.txt} +0 -0
  189. /package/dist/{3619.js.LICENSE.txt → 3525.js.LICENSE.txt} +0 -0
  190. /package/dist/{3776.js.LICENSE.txt → 3625.js.LICENSE.txt} +0 -0
  191. /package/dist/{3845.js.LICENSE.txt → 4619.js.LICENSE.txt} +0 -0
  192. /package/dist/{4150.js.LICENSE.txt → 4937.js.LICENSE.txt} +0 -0
  193. /package/dist/{42.js.LICENSE.txt → 5172.js.LICENSE.txt} +0 -0
  194. /package/dist/{4279.js.LICENSE.txt → 528.js.LICENSE.txt} +0 -0
  195. /package/dist/{4463.js.LICENSE.txt → 5342.js.LICENSE.txt} +0 -0
  196. /package/dist/{4669.js.LICENSE.txt → 5431.js.LICENSE.txt} +0 -0
  197. /package/dist/{4686.js.LICENSE.txt → 5784.js.LICENSE.txt} +0 -0
  198. /package/dist/{4689.js.LICENSE.txt → 5896.js.LICENSE.txt} +0 -0
  199. /package/dist/{4756.js.LICENSE.txt → 6114.js.LICENSE.txt} +0 -0
  200. /package/dist/{5027.js.LICENSE.txt → 6329.js.LICENSE.txt} +0 -0
  201. /package/dist/{521.js.LICENSE.txt → 6357.js.LICENSE.txt} +0 -0
  202. /package/dist/{5324.js.LICENSE.txt → 6511.js.LICENSE.txt} +0 -0
  203. /package/dist/{5373.js.LICENSE.txt → 7086.js.LICENSE.txt} +0 -0
  204. /package/dist/{5518.js.LICENSE.txt → 710.js.LICENSE.txt} +0 -0
  205. /package/dist/{5853.js.LICENSE.txt → 7160.js.LICENSE.txt} +0 -0
  206. /package/dist/{6010.js.LICENSE.txt → 7240.js.LICENSE.txt} +0 -0
  207. /package/dist/{6308.js.LICENSE.txt → 7435.js.LICENSE.txt} +0 -0
  208. /package/dist/{6826.js.LICENSE.txt → 7628.js.LICENSE.txt} +0 -0
  209. /package/dist/{7170.js.LICENSE.txt → 7732.js.LICENSE.txt} +0 -0
  210. /package/dist/{755.js.LICENSE.txt → 7748.js.LICENSE.txt} +0 -0
  211. /package/dist/{7654.js.LICENSE.txt → 7950.js.LICENSE.txt} +0 -0
  212. /package/dist/{8037.js.LICENSE.txt → 7986.js.LICENSE.txt} +0 -0
  213. /package/dist/{817.js.LICENSE.txt → 8231.js.LICENSE.txt} +0 -0
  214. /package/dist/{8180.js.LICENSE.txt → 8240.js.LICENSE.txt} +0 -0
  215. /package/dist/{8341.js.LICENSE.txt → 8247.js.LICENSE.txt} +0 -0
  216. /package/dist/{8612.js.LICENSE.txt → 8256.js.LICENSE.txt} +0 -0
  217. /package/dist/{8734.js.LICENSE.txt → 8494.js.LICENSE.txt} +0 -0
  218. /package/dist/{881.js.LICENSE.txt → 8507.js.LICENSE.txt} +0 -0
  219. /package/dist/{8869.js.LICENSE.txt → 9021.js.LICENSE.txt} +0 -0
  220. /package/dist/{892.js.LICENSE.txt → 9035.js.LICENSE.txt} +0 -0
  221. /package/dist/{8948.js.LICENSE.txt → 9094.js.LICENSE.txt} +0 -0
  222. /package/dist/{8951.js.LICENSE.txt → 9179.js.LICENSE.txt} +0 -0
  223. /package/dist/{9150.js.LICENSE.txt → 9183.js.LICENSE.txt} +0 -0
  224. /package/dist/{9317.js.LICENSE.txt → 9190.js.LICENSE.txt} +0 -0
  225. /package/dist/{9330.js.LICENSE.txt → 9237.js.LICENSE.txt} +0 -0
  226. /package/dist/{9681.js.LICENSE.txt → 9246.js.LICENSE.txt} +0 -0
  227. /package/dist/{9700.js.LICENSE.txt → 9456.js.LICENSE.txt} +0 -0
  228. /package/dist/{9727.js.LICENSE.txt → 9483.js.LICENSE.txt} +0 -0
  229. /package/dist/{9797.js.LICENSE.txt → 9485.js.LICENSE.txt} +0 -0
  230. /package/dist/{9865.js.LICENSE.txt → 9528.js.LICENSE.txt} +0 -0
  231. /package/dist/{9886.js.LICENSE.txt → 9622.js.LICENSE.txt} +0 -0
  232. /package/dist/{9912.js.LICENSE.txt → 97.js.LICENSE.txt} +0 -0
  233. /package/dist/{9984.js.LICENSE.txt → 9758.js.LICENSE.txt} +0 -0
package/package.json CHANGED
@@ -1,25 +1,25 @@
1
1
  {
2
2
  "name": "@public-ui/sample-react",
3
- "version": "2.0.9",
3
+ "version": "2.0.11",
4
4
  "description": "This app contains samples for the KoliBri/Public UI",
5
5
  "license": "EUPL-1.2",
6
6
  "dependencies": {
7
7
  "@leanup/stack": "1.3.49",
8
8
  "@leanup/stack-react": "1.3.49",
9
9
  "@leanup/stack-webpack": "1.3.49",
10
- "@public-ui/components": "2.0.9",
11
- "@public-ui/react": "2.0.9",
12
- "@public-ui/themes": "2.0.9",
13
- "@types/node": "20.11.25",
14
- "@types/react": "18.2.64",
15
- "@types/react-dom": "18.2.21",
16
- "@unocss/preset-uno": "0.58.5",
17
- "@unocss/webpack": "0.58.5",
10
+ "@public-ui/components": "2.0.11",
11
+ "@public-ui/react": "2.0.11",
12
+ "@public-ui/themes": "2.0.11",
13
+ "@types/node": "ts5.4",
14
+ "@types/react": "18.2.73",
15
+ "@types/react-dom": "18.2.22",
16
+ "@unocss/preset-uno": "0.58.7",
17
+ "@unocss/webpack": "0.58.7",
18
18
  "ajv": "8.12.0",
19
- "chromedriver": "122.0.4",
19
+ "chromedriver": "122.0.6",
20
20
  "cpy-cli": "5.0.0",
21
21
  "eslint-plugin-jsx-a11y": "6.8.0",
22
- "eslint-plugin-react": "7.34.0",
22
+ "eslint-plugin-react": "7.34.1",
23
23
  "formik": "2.4.5",
24
24
  "nightwatch-axe-verbose": "2.3.0",
25
25
  "npm-run-all": "4.1.5",
@@ -27,9 +27,9 @@
27
27
  "react-dom": "18.2.0",
28
28
  "react-router": "6.22.3",
29
29
  "react-router-dom": "6.22.3",
30
- "rimraf": "3.0.2",
30
+ "rimraf": "5.0.5",
31
31
  "ts-prune": "0.10.3",
32
- "typescript": "5.4.2",
32
+ "typescript": "5.4.3",
33
33
  "world_countries_lists": "2.9.0",
34
34
  "yup": "1.4.0"
35
35
  },
package/src/App.tsx CHANGED
@@ -4,7 +4,7 @@ import { useLocation } from 'react-router';
4
4
  import { Navigate, Route, Routes, useSearchParams } from 'react-router-dom';
5
5
 
6
6
  import PackageJson from '@public-ui/components/package.json';
7
- import { KolAlert, KolBadge } from '@public-ui/react';
7
+ import { KolBadge } from '@public-ui/react';
8
8
 
9
9
  import { BackPage } from './components/BackPage';
10
10
  import { Sidebar } from './components/Sidebar';
@@ -17,7 +17,8 @@ import { THEMES, THEME_OPTIONS, isDraftTheme } from './shares/theme';
17
17
  import type { Route as MyRoute, Routes as MyRoutes } from './shares/types';
18
18
 
19
19
  import type { Option } from '@public-ui/components';
20
- import type { Theme } from './shares/theme';
20
+ import type { Theme, ThemeAndUnstyled } from './shares/theme';
21
+
21
22
  setStorage(localStorage);
22
23
 
23
24
  const getRouteList = (routes: MyRoutes, offset = '/'): string[] => {
@@ -51,7 +52,7 @@ const getRouteTree = (routes: MyRoutes): ReturnType<typeof Route>[] => {
51
52
  element={
52
53
  <div className="d-grid gap-4">
53
54
  {THEME_OPTIONS.filter((theme) => THEMES.indexOf((theme as Option<Theme>).value) >= 0).map((theme) => (
54
- <div className="d-grid gap-2" key={(theme as Option<Theme>).value} data-theme={(theme as Option<Theme>).value}>
55
+ <div className="d-grid gap-2" key={(theme as Option<ThemeAndUnstyled>).value} data-theme={(theme as Option<ThemeAndUnstyled>).value}>
55
56
  <div className="mt-4">
56
57
  <strong>{theme.label}</strong>
57
58
  </div>
@@ -106,10 +107,10 @@ ROUTE_LIST.forEach((route) => {
106
107
  export const App: FC = () => {
107
108
  const routerLocation = useLocation();
108
109
  const [searchParams, setSearchParams] = useSearchParams();
109
- const theme: Theme = (searchParams.get('theme') as Theme) ?? getTheme();
110
+ const theme: ThemeAndUnstyled = (searchParams.get('theme') as ThemeAndUnstyled) ?? getTheme();
110
111
  const hideMenus = searchParams.has('hideMenus');
111
112
 
112
- setTheme(theme as Theme); // set for `getTheme` usages within the application
113
+ setTheme(theme); // set for `getTheme` usages within the application
113
114
  useSetCurrentLocation();
114
115
 
115
116
  document.title = `KoliBri-Handout - ${getThemeName(getTheme())} | v${PackageJson.version}`;
@@ -6,6 +6,7 @@ import {
6
6
  KolAbbr,
7
7
  KolAccordion,
8
8
  KolAlert,
9
+ KolBadge,
9
10
  KolBreadcrumb,
10
11
  KolButton,
11
12
  KolButtonLink,
@@ -39,6 +40,7 @@ import {
39
40
  import { getTheme, getThemeName } from '../../shares/store';
40
41
 
41
42
  import type { FC } from 'react';
43
+ import { getRoot } from '../../shares/react-roots';
42
44
  const TABLE_HEADERS: KoliBriTableHeaders = {
43
45
  horizontal: [
44
46
  [
@@ -60,15 +62,12 @@ const TABLE_HEADERS: KoliBriTableHeaders = {
60
62
  {
61
63
  key: 'montag',
62
64
  label: 'Montag',
63
- render: (el, data) => {
64
- const button = document.createElement('kol-button');
65
- button.setAttribute('_label', data.label);
66
- button.setAttribute('data-theme', 'default');
67
- button.setAttribute('style', 'font-size: 75%');
68
- button.setAttribute('exportparts', 'button,normal');
69
- button._on = { onClick: console.log };
65
+ render: (el, cell) => {
66
+ const renderElement = document.createElement('div');
67
+ renderElement.setAttribute('role', 'presentation');
70
68
  el.innerHTML = '';
71
- el.appendChild(button);
69
+ el.appendChild(renderElement);
70
+ getRoot(renderElement).render(<KolButton _label={cell.label} style={{ fontSize: '75%' }} data-theme="default" />);
72
71
  },
73
72
  sort: (data) => {
74
73
  return data.sort((first, second) => {
@@ -87,8 +86,12 @@ const TABLE_HEADERS: KoliBriTableHeaders = {
87
86
  {
88
87
  key: 'dienstag',
89
88
  label: 'Dienstag',
90
- render: (el, data) => {
91
- el.innerHTML = `<kol-badge _color="#060" _label="${data.label}"></kol-badge>`;
89
+ render: (el, cell) => {
90
+ const renderElement = document.createElement('div');
91
+ renderElement.setAttribute('role', 'presentation');
92
+ el.innerHTML = '';
93
+ el.appendChild(renderElement);
94
+ getRoot(renderElement).render(<KolBadge _color="#060" _label={cell.label}></KolBadge>);
92
95
  },
93
96
  sort: (data) => {
94
97
  return data.sort((first, second) => {
@@ -109,33 +112,56 @@ const TABLE_HEADERS: KoliBriTableHeaders = {
109
112
  render: (el, data) => {
110
113
  el.innerHTML = `<kol-badge _color="#006" _label="${data.label}"></kol-badge>`;
111
114
  },
115
+ render: (el, cell) => {
116
+ const renderElement = document.createElement('div');
117
+ renderElement.setAttribute('role', 'presentation');
118
+ el.innerHTML = '';
119
+ el.appendChild(renderElement);
120
+ getRoot(renderElement).render(<KolBadge _color="#006" _label={cell.label}></KolBadge>);
121
+ },
112
122
  },
113
123
  {
114
124
  key: 'donnerstag',
115
125
  label: 'Donnerstag',
116
- render: (el, data) => {
117
- el.innerHTML = `<kol-badge _color="#600" _label="${data.label}"></kol-badge>`;
126
+ render: (el, cell) => {
127
+ const renderElement = document.createElement('div');
128
+ renderElement.setAttribute('role', 'presentation');
129
+ el.innerHTML = '';
130
+ el.appendChild(renderElement);
131
+ getRoot(renderElement).render(<KolBadge _color="#600" _label={cell.label}></KolBadge>);
118
132
  },
119
133
  },
120
134
  {
121
135
  key: 'freitag',
122
136
  label: 'Freitag',
123
- render: (el, data) => {
124
- el.innerHTML = `<kol-badge _color="#303" _label="${data.label}"></kol-badge>`;
137
+ render: (el, cell) => {
138
+ const renderElement = document.createElement('div');
139
+ renderElement.setAttribute('role', 'presentation');
140
+ el.innerHTML = '';
141
+ el.appendChild(renderElement);
142
+ getRoot(renderElement).render(<KolBadge _color="#303" _label={cell.label}></KolBadge>);
125
143
  },
126
144
  },
127
145
  {
128
146
  key: 'samstag',
129
147
  label: 'Samstag',
130
- render: (el, data) => {
131
- el.innerHTML = `<kol-badge _color="#330" _label="${data.label}"></kol-badge>`;
148
+ render: (el, cell) => {
149
+ const renderElement = document.createElement('div');
150
+ renderElement.setAttribute('role', 'presentation');
151
+ el.innerHTML = '';
152
+ el.appendChild(renderElement);
153
+ getRoot(renderElement).render(<KolBadge _color="#330" _label={cell.label}></KolBadge>);
132
154
  },
133
155
  },
134
156
  {
135
157
  key: 'sonntag',
136
158
  label: 'Sonntag',
137
- render: (el, data) => {
138
- el.innerHTML = `<kol-badge _color="#033" _label="${data.label}"></kol-badge>`;
159
+ render: (el, cell) => {
160
+ const renderElement = document.createElement('div');
161
+ renderElement.setAttribute('role', 'presentation');
162
+ el.innerHTML = '';
163
+ el.appendChild(renderElement);
164
+ getRoot(renderElement).render(<KolBadge _color="#033" _label={cell.label}></KolBadge>);
139
165
  },
140
166
  },
141
167
  ],
@@ -982,7 +1008,12 @@ export const HandoutBasic: FC = () => (
982
1008
  <KolInputFile _label={`Datei hochladen`} />
983
1009
  <KolInputNumber _label={`Zahleneingabe`} />
984
1010
  <KolInputDate _type="date" _label={`Datum`} />
985
- <KolInputEmail _icons="{'left': 'codicon codicon-home'}" _error="Test einer Fehlermeldung" _touched _label={`E-Mail-Adresse`} />
1011
+ <KolInputEmail
1012
+ _icons="{'left': 'codicon codicon-home'}"
1013
+ _msg={{ _type: 'error', _description: 'Test einer Fehlermeldung' }}
1014
+ _touched
1015
+ _label={`E-Mail-Adresse`}
1016
+ />
986
1017
  <KolInputText _hint="Ich bin ein Hinweis." _label={`Vorname`} />
987
1018
  <KolInputPassword _label={`Passwort`} />
988
1019
  <KolSelect _options="[{'label':'Herr','value':0},{'label':'Frau','value':1}]" _label={`Stimmung`} />
@@ -52,7 +52,7 @@ export const InputCheckboxCases = forwardRef<HTMLKolInputCheckboxElement, Compon
52
52
  <KolInputCheckbox {...props} _indeterminate _disabled _label="Indeterminate and disabled" />
53
53
  <KolInputCheckbox
54
54
  {...props}
55
- _error={ERROR_MSG}
55
+ _msg={{ _type: 'error', _description: ERROR_MSG }}
56
56
  _icons={{
57
57
  unchecked: 'codicon codicon-close',
58
58
  }}
@@ -10,14 +10,20 @@ export const InputColorCases = forwardRef<HTMLKolInputColorElement, Components.K
10
10
  <div className="grid gap-4">
11
11
  <KolInputColor
12
12
  {...props}
13
- _error={ERROR_MSG}
13
+ _msg={{ _type: 'error', _description: ERROR_MSG }}
14
14
  _icons={{
15
15
  left: 'codicon codicon-symbol-color',
16
16
  }}
17
17
  _label="Color"
18
18
  _value="#f08080"
19
19
  />
20
- <KolInputColor {...props} _error={ERROR_MSG} _label="Color with error" _suggestions="['#000000','#f08080', '#0000ff','#00ff00']" _touched />
20
+ <KolInputColor
21
+ {...props}
22
+ _msg={{ _type: 'error', _description: ERROR_MSG }}
23
+ _label="Color with error"
24
+ _suggestions="['#000000','#f08080', '#0000ff','#00ff00']"
25
+ _touched
26
+ />
21
27
  <KolInputColor {...props} ref={ref} _accessKey="C" _hint="Hint text" _label="Color with hint" _value="#f08080" />
22
28
  <KolInputColor {...props} _disabled _label="Color (Disabled)" _value="#f08080" />
23
29
  </div>
@@ -10,7 +10,15 @@ export const InputDateCases = forwardRef<HTMLKolInputDateElement, Components.Kol
10
10
  <div className="grid gap-4">
11
11
  <KolInputDate {...props} _type="date" _label="Datumseingabe" _required />
12
12
  <KolInputDate {...props} _type="datetime-local" _label="Local-Datetime (Standard)" _required />
13
- <KolInputDate {...props} _step={1} _type="datetime-local" _error={ERROR_MSG} _label="Local-Datetime (mit Sekunden)" _required _touched />
13
+ <KolInputDate
14
+ {...props}
15
+ _step={1}
16
+ _type="datetime-local"
17
+ _msg={{ _type: 'error', _description: ERROR_MSG }}
18
+ _label="Local-Datetime (mit Sekunden)"
19
+ _required
20
+ _touched
21
+ />
14
22
  <KolInputDate {...props} _type="month" _label="Monat" _required />
15
23
  <KolInputDate {...props} ref={ref} _accessKey="W" _type="week" _label="Woche" _required />
16
24
  <KolInputDate {...props} _type="time" _label="Zeit (Standard)" _required />
@@ -8,7 +8,7 @@ import type { Components } from '@public-ui/components';
8
8
  export const InputEmailCases = forwardRef<HTMLKolInputEmailElement, Components.KolInputEmail>(function InputEmailCases(props, ref) {
9
9
  return (
10
10
  <div className="grid gap-4">
11
- <KolInputEmail {...props} _required _value="test@mail.de" _error={ERROR_MSG} _label="E-Mail" />
11
+ <KolInputEmail {...props} _required _value="test@mail.de" _msg={{ _type: 'error', _description: ERROR_MSG }} _label="E-Mail" />
12
12
  <KolInputEmail
13
13
  {...props}
14
14
  ref={ref}
@@ -16,7 +16,7 @@ export const InputEmailCases = forwardRef<HTMLKolInputEmailElement, Components.K
16
16
  _placeholder="elke@mustermann.de"
17
17
  _suggestions="['test1@mail.de', 'test2@mail.de', 'test3@mail.de']"
18
18
  _label="E-Mail (Liste)"
19
- _error={ERROR_MSG}
19
+ _msg={{ _type: 'error', _description: ERROR_MSG }}
20
20
  _touched
21
21
  _icons={{
22
22
  left: {
@@ -11,7 +11,7 @@ export const InputFileCases = forwardRef<HTMLKolInputFileElement, Components.Kol
11
11
  <KolInputFile
12
12
  {...props}
13
13
  _required
14
- _error={ERROR_MSG}
14
+ _msg={{ _type: 'error', _description: ERROR_MSG }}
15
15
  _label="Datei hochladen"
16
16
  _icons={{
17
17
  left: {
@@ -20,7 +20,7 @@ export const InputFileCases = forwardRef<HTMLKolInputFileElement, Components.Kol
20
20
  }}
21
21
  _touched
22
22
  />
23
- <KolInputFile {...props} ref={ref} _accessKey="h" _multiple _error={ERROR_MSG} _label="Datei hochladen (Multiple)" />
23
+ <KolInputFile {...props} ref={ref} _accessKey="h" _multiple _msg={{ _type: 'error', _description: ERROR_MSG }} _label="Datei hochladen (Multiple)" />
24
24
  <KolInputFile {...props} _disabled _label="Datei hochladen (Disabled)" />
25
25
  </div>
26
26
  );
@@ -11,7 +11,7 @@ export const InputNumberCases = forwardRef<HTMLKolInputNumberElement, Components
11
11
  <KolInputNumber
12
12
  {...props}
13
13
  _required
14
- _error={ERROR_MSG}
14
+ _msg={{ _type: 'error', _description: ERROR_MSG }}
15
15
  _touched
16
16
  _placeholder="Mit Icons"
17
17
  _label="Zahleneingabe"
@@ -8,14 +8,14 @@ import type { Components } from '@public-ui/components';
8
8
  export const InputPasswordCases = forwardRef<HTMLKolInputPasswordElement, Components.KolInputPassword>(function InputPasswordCases(props, ref) {
9
9
  return (
10
10
  <div className="grid gap-4">
11
- <KolInputPassword {...props} _disabled _error={ERROR_MSG} _label="Passwort (Disabled)" _touched />
11
+ <KolInputPassword {...props} _disabled _msg={{ _type: 'error', _description: ERROR_MSG }} _label="Passwort (Disabled)" _touched />
12
12
  <KolInputPassword {...props} _readOnly _label="Passwort (Readonly)" />
13
13
  <KolInputPassword
14
14
  {...props}
15
15
  ref={ref}
16
16
  _accessKey="P"
17
17
  _required
18
- _error={ERROR_MSG}
18
+ _msg={{ _type: 'error', _description: ERROR_MSG }}
19
19
  _placeholder="Mit Icons"
20
20
  _label="Passwort"
21
21
  _icons={{
@@ -0,0 +1,37 @@
1
+ import type { FC } from 'react';
2
+ import React from 'react';
3
+
4
+ import { KolForm, KolInputRadio } from '@public-ui/react';
5
+
6
+ import { SampleDescription } from '../SampleDescription';
7
+
8
+ export const InputRadioObjectValue: FC = () => {
9
+ const options = [
10
+ { label: 'Field 1', value: { id: 1, name: 'Option 1' } },
11
+ { label: 'Field 2', value: { id: 2, name: 'Option 2' } },
12
+ ];
13
+
14
+ return (
15
+ <div className="grid gap-4">
16
+ <SampleDescription>
17
+ Examples of implementing the <code>KolInputRadio</code> component with object-based preselected value and undefined value.
18
+ </SampleDescription>
19
+ <p>
20
+ In this example for <code>KolInputRadio</code>, the values of the options are defined as objects.
21
+ </p>
22
+ <KolForm>
23
+ <div className="container my-4 d-grid gap-4">
24
+ <KolInputRadio _value={options[1].value} _options={options} _label="Test(with object value)" />
25
+ </div>
26
+ </KolForm>
27
+ <p>
28
+ In this example for <code>KolInputRadio</code>, no value is set.
29
+ </p>
30
+ <KolForm>
31
+ <div className="container my-4 d-grid gap-4">
32
+ <KolInputRadio _options={options} _label="Test(without value)" />
33
+ </div>
34
+ </KolForm>
35
+ </div>
36
+ );
37
+ };
@@ -16,7 +16,7 @@ export const InputRadioCases = forwardRef<HTMLKolInputRadioElement, Components.K
16
16
  <KolInputRadio
17
17
  {...props}
18
18
  _required
19
- _error={ERROR_MSG}
19
+ _msg={{ _type: 'error', _description: ERROR_MSG }}
20
20
  _touched
21
21
  _value="Firma"
22
22
  _options="[{'label':'Frau','value':'Frau'},{'disabled':true,'label':'Herr (disabled)','value':'Herr'},{'label':'Firma','value':'Firma'}]"
@@ -37,7 +37,7 @@ export const InputRadioCases = forwardRef<HTMLKolInputRadioElement, Components.K
37
37
  _disabled
38
38
  _orientation="horizontal"
39
39
  _required
40
- _error={ERROR_MSG}
40
+ _msg={{ _type: 'error', _description: ERROR_MSG }}
41
41
  _touched
42
42
  _value="Firma"
43
43
  _options="[{'label':'Frau','value':'Frau'},{'disabled':true,'label':'Herr (disabled)'},{'label':'Firma','value':'Firma'}]"
@@ -2,11 +2,13 @@ import { Routes } from '../../shares/types';
2
2
  import { InputRadioBasic } from './basic';
3
3
  import { InputRadioHorizontal } from './horizontal';
4
4
  import { InputRadioSelect } from './select';
5
+ import { InputRadioObjectValue } from './objectValue';
5
6
 
6
7
  export const INPUT_RADIO_ROUTES: Routes = {
7
8
  'input-radio': {
8
9
  basic: InputRadioBasic,
9
10
  horizontal: InputRadioHorizontal,
10
11
  select: InputRadioSelect,
12
+ object: InputRadioObjectValue,
11
13
  },
12
14
  };
@@ -19,7 +19,7 @@ export const InputRadioSelect: FC = () => (
19
19
  <p>Hier ist ein Beispiel Radio-Button. Nur eine gleichzeitige Auswahl ist möglich. </p>
20
20
  </SampleDescription>
21
21
  <KolForm className="grid gap-4">
22
- <KolInputRadio _error={ERROR_MSG} _options={options} _label="Anrede" />
22
+ <KolInputRadio _msg={{ _type: 'error', _description: ERROR_MSG }} _options={options} _label="Anrede" />
23
23
  </KolForm>
24
24
  </>
25
25
  );
@@ -12,7 +12,7 @@ export const InputRangeCases = forwardRef<HTMLKolInputRangeElement, Components.K
12
12
  {...props}
13
13
  _min={0}
14
14
  _max={50}
15
- _error={ERROR_MSG}
15
+ _msg={{ _type: 'error', _description: ERROR_MSG }}
16
16
  _label="Schieberegler"
17
17
  _icons={{
18
18
  left: {
@@ -24,7 +24,17 @@ export const InputRangeCases = forwardRef<HTMLKolInputRangeElement, Components.K
24
24
  }}
25
25
  _touched
26
26
  />
27
- <KolInputRange {...props} ref={ref} _accessKey="F" _min={0} _max={50} _step={10} _error={ERROR_MSG} _label="Schieberegler mit Fehler" _touched />
27
+ <KolInputRange
28
+ {...props}
29
+ ref={ref}
30
+ _accessKey="F"
31
+ _min={0}
32
+ _max={50}
33
+ _step={10}
34
+ _msg={{ _type: 'error', _description: ERROR_MSG }}
35
+ _label="Schieberegler mit Fehler"
36
+ _touched
37
+ />
28
38
  <KolInputRange {...props} _disabled _min={0} _max={50} _label="Schieberegler (disabled)" />
29
39
  </div>
30
40
  );
@@ -9,7 +9,7 @@ export const InputTextHideErrors: FC = () => (
9
9
  This case shows the <code>_hideError</code> feature in the se. You can use the <code>_error</code> prop to show an error message.
10
10
  </SampleDescription>
11
11
  <KolCard _label="Normal input field with error" _level={0}>
12
- <KolInputText _error="Error message" _label="Input with error" _touched />
12
+ <KolInputText _msg={{ _type: 'error', _description: 'Error message' }} _label="Input with error" _touched />
13
13
  </KolCard>
14
14
  <KolCard _label="Input field with hidden error" _level={0}>
15
15
  <fieldset className="grid md:grid-cols-2 gap-4">
@@ -17,8 +17,8 @@ export const InputTextHideErrors: FC = () => (
17
17
  <KolAlert className="col-span-2" _level={0} _type="error">
18
18
  This is a combined error message
19
19
  </KolAlert>
20
- <KolInputText _error="This is a combined error message" _hideError _label="First input" _touched />
21
- <KolInputText _error="This is a combined error message" _hideError _label="Second input with error" _touched />
20
+ <KolInputText _msg={{ _type: 'error', _description: 'This is a combined error message' }} _hideError _label="First input" _touched />
21
+ <KolInputText _msg={{ _type: 'error', _description: 'This is a combined error message' }} _hideError _label="Second input with error" _touched />
22
22
  </fieldset>
23
23
  </KolCard>
24
24
  </div>
@@ -11,7 +11,7 @@ export const InputTextCases = forwardRef<HTMLKolInputTextElement, Components.Kol
11
11
  <KolInputText
12
12
  {...props}
13
13
  _hint={HINT_MSG}
14
- _error={ERROR_MSG}
14
+ _msg={{ _type: 'error', _description: ERROR_MSG }}
15
15
  _placeholder="Mit Icons"
16
16
  _icons={{
17
17
  right: {
@@ -34,9 +34,9 @@ export const InputTextCases = forwardRef<HTMLKolInputTextElement, Components.Kol
34
34
  _accessKey="V"
35
35
  ref={ref}
36
36
  />
37
- <KolInputText {...props} _placeholder="Placeholder" _label="Suche (search)" _type="search" />
38
- <KolInputText {...props} _placeholder="Placeholder" _error={ERROR_MSG} _touched _type="url" _label="URL (url)" />
39
- <KolInputText {...props} _placeholder="Placeholder" _type="tel" _label="Telefon (tel)" />
37
+ <KolInputText {...props} _placeholder="Placeholder" _msg={{ _type: 'info', _description: 'Nur ein Hinweis' }} _label="Suche (search)" _type="search" />
38
+ <KolInputText {...props} _placeholder="Placeholder" _msg={{ _type: 'error', _description: ERROR_MSG }} _touched _type="url" _label="URL (url)" />
39
+ <KolInputText {...props} _placeholder="Placeholder" _type="tel" _label="Telefon (tel)" _msg={{ _type: 'warning', _description: 'Kleine Warnung' }} />
40
40
  <KolInputText {...props} _placeholder="Placeholder" _readOnly _label="Vorname (text, readonly)" />
41
41
  <KolInputText {...props} _value="Value" _readOnly _label="Vorname (text, readonly)" />
42
42
  <KolInputText {...props} _placeholder="Placeholder" _disabled _label="Vorname (text, disabled)" />
@@ -4,11 +4,16 @@ export const LINKS: ButtonOrLinkOrTextWithChildrenProps[] = [
4
4
  {
5
5
  _label: 'Homepage',
6
6
  _icons: 'codicon codicon-home',
7
- _href: '#/back-page',
7
+ _on: {
8
+ onClick: () => console.log('Homepage clicked'),
9
+ },
8
10
  },
9
11
  {
10
12
  _label: '2 Navigation point',
11
13
  _href: '#/back-page',
14
+ _on: {
15
+ onClick: () => console.log('Link clicked'),
16
+ },
12
17
  },
13
18
  {
14
19
  _label: '3 Navigation point',
@@ -54,7 +59,18 @@ export const LINKS: ButtonOrLinkOrTextWithChildrenProps[] = [
54
59
  { _label: '3.5 Navigation point', _href: '#/back-page' },
55
60
  ],
56
61
  },
57
- { _label: '4 Navigation point', _href: '#/back-page' },
62
+ {
63
+ _label: '4 Navigation point with children and onClick',
64
+ _children: [
65
+ {
66
+ _label: '4.1 Nested link',
67
+ _href: '#/back-page',
68
+ },
69
+ ],
70
+ _on: {
71
+ onClick: () => console.log('4.1 Nested link clicked'),
72
+ },
73
+ },
58
74
  {
59
75
  _label: '5 Keine eigene Seite, nur Kategorie',
60
76
  _active: true,
@@ -11,7 +11,9 @@ export const ProgressBasic: FC = () => (
11
11
  <p>Hier ist ein Fortschrittsbalken und Fortschrittskreis. Der Fortschritt verändert sich nicht.</p>
12
12
  </SampleDescription>
13
13
  <div className="grid gap-4">
14
+ <KolProgress _variant="bar" _max={100} _value={0} _label="With label"></KolProgress>
14
15
  <KolProgress _variant="bar" _max={100} _value={33}></KolProgress>
16
+ <KolProgress _variant="bar" _max={100} _value={100}></KolProgress>
15
17
  <KolProgress _variant="cycle" _max={100} _value={33}></KolProgress>
16
18
  </div>
17
19
  </>
@@ -59,9 +59,17 @@ export const SelectCases = forwardRef<HTMLKolSelectElement, Components.KolSelect
59
59
  }}
60
60
  />
61
61
  <KolSelect {...props} _options={SALUTATION_OPTIONS} _label="Disabled" _disabled />
62
- <KolSelect {...props} _options={SALUTATION_OPTIONS} _label="Anrede mit Fehler" _error={ERROR_MSG} _touched />
62
+ <KolSelect {...props} _options={SALUTATION_OPTIONS} _label="Anrede mit Fehler" _msg={{ _type: 'error', _description: ERROR_MSG }} _touched />
63
63
  <KolSelect {...props} _options={COUNTRY_OPTIONS} _label="Mehrfachauswahl" _multiple />
64
- <KolSelect {...props} _options={COUNTRY_OPTIONS} _label="Mehrfachauswahl mit Fehler" _multiple _required _error={ERROR_MSG} _touched />
64
+ <KolSelect
65
+ {...props}
66
+ _options={COUNTRY_OPTIONS}
67
+ _label="Mehrfachauswahl mit Fehler"
68
+ _multiple
69
+ _required
70
+ _msg={{ _type: 'error', _description: ERROR_MSG }}
71
+ _touched
72
+ />
65
73
  </div>
66
74
  );
67
75
  });
@@ -10,7 +10,10 @@ import type { FC } from 'react';
10
10
  export const SpinCustom: FC = () => (
11
11
  <>
12
12
  <SampleDescription>
13
- <p>Hier ist ein Beispiel für eine Custom Animation.</p>
13
+ <p>
14
+ Hier ist ein Beispiel für eine custom Lade-Animation. Mittels des Expert-Slots ist es möglich, eigene Animationen einzufügen. Diese kann nach eigenen
15
+ Vorstellungen angepasst werden und ist nicht zwingend barrierefrei.
16
+ </p>
14
17
  </SampleDescription>
15
18
  <KolSpin _show _variant="none">
16
19
  <span slot="expert" className="loader"></span>
@@ -5,9 +5,9 @@ import { KolSplitButton } from '@public-ui/react';
5
5
  import { SampleDescription } from '../SampleDescription';
6
6
 
7
7
  import type { FC } from 'react';
8
- const toaster = ToasterService.getInstance(document);
9
8
 
10
9
  export const SplitButtonBasic: FC = () => {
10
+ const toaster = ToasterService.getInstance(document);
11
11
  const handleButtonClick = () => {
12
12
  void toaster.enqueue({
13
13
  description: 'The Button has been clicked.',
@@ -1,7 +1,7 @@
1
1
  import type { FC } from 'react';
2
2
  import React from 'react';
3
3
 
4
- import { KolButton, KolInputText, KolTable } from '@public-ui/react';
4
+ import { createReactRenderElement, KolButton, KolInputText, KolTable } from '@public-ui/react';
5
5
 
6
6
  import { getRoot } from '../../shares/react-roots';
7
7
  import { SampleDescription } from '../SampleDescription';
@@ -77,13 +77,7 @@ const HEADERS: KoliBriTableHeaders = {
77
77
 
78
78
  /* Example 4: Render function using React */
79
79
  render: (el) => {
80
- const renderElement = document.createElement('div');
81
- renderElement.setAttribute('role', 'presentation');
82
- el.innerHTML = '';
83
- el.appendChild(renderElement);
84
-
85
- /* https://react.dev/reference/react-dom/client/createRoot */
86
- getRoot(renderElement).render(
80
+ getRoot(createReactRenderElement(el)).render(
87
81
  <div
88
82
  style={{
89
83
  display: `grid`,
@@ -9,6 +9,12 @@ export const TextareaCounter: FC = () => (
9
9
  <SampleDescription>
10
10
  <p>Hier ist ein Beispiel für eine Freitextfeld mit Zeichenzähler.</p>
11
11
  </SampleDescription>
12
- <KolTextarea _hasCounter={true} _label="Textara mit Counter und Hint und Fehler" _error={'oh no'} _hint={'Hinweis'} _touched />
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
+ />
13
19
  </>
14
20
  );
@@ -11,7 +11,12 @@ export const TextareaDisabled: FC = () => (
11
11
  <p>Hier ist ein Beispiel für ein deaktiviertes Textfeld.</p>
12
12
  </SampleDescription>
13
13
  <KolForm>
14
- <KolTextarea _disabled _error="Es ist ein Fehler aufgetreten." _value="Kleiner Text im Eingabefeld ..." _label="Texteingabe" />
14
+ <KolTextarea
15
+ _disabled
16
+ _msg={{ _type: 'error', _description: 'Es ist ein Fehler aufgetreten' }}
17
+ _value="Kleiner Text im Eingabefeld ..."
18
+ _label="Texteingabe"
19
+ />
15
20
  </KolForm>
16
21
  </>
17
22
  );