@public-ui/sample-react 1.7.8 → 1.7.10-rc.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (92) hide show
  1. package/dist/1090.js +1 -1
  2. package/dist/1181.js +1 -1
  3. package/dist/1218.js +1 -1
  4. package/dist/1338.js +1 -1
  5. package/dist/1517.js +1 -1
  6. package/dist/1596.js +1 -1
  7. package/dist/{4890.js → 1622.js} +2 -2
  8. package/dist/1767.js +1 -1
  9. package/dist/2163.js +1 -1
  10. package/dist/2415.js +1 -1
  11. package/dist/2594.js +1 -1
  12. package/dist/2611.js +1 -1
  13. package/dist/2643.js +1 -1
  14. package/dist/3099.js +1 -1
  15. package/dist/3145.js +1 -1
  16. package/dist/3345.js +1 -1
  17. package/dist/3388.js +1 -1
  18. package/dist/3466.js +1 -1
  19. package/dist/3580.js +1 -1
  20. package/dist/3600.js +2 -0
  21. package/dist/3619.js +1 -1
  22. package/dist/3776.js +1 -1
  23. package/dist/4150.js +1 -1
  24. package/dist/42.js +1 -1
  25. package/dist/4279.js +1 -1
  26. package/dist/4333.js +1 -1
  27. package/dist/4463.js +1 -1
  28. package/dist/4669.js +1 -1
  29. package/dist/4686.js +1 -1
  30. package/dist/4701.js +2 -0
  31. package/dist/5027.js +1 -1
  32. package/dist/521.js +1 -1
  33. package/dist/5324.js +1 -1
  34. package/dist/5373.js +1 -1
  35. package/dist/5518.js +1 -1
  36. package/dist/5615.js +1 -1
  37. package/dist/5853.js +1 -1
  38. package/dist/6010.js +1 -1
  39. package/dist/6308.js +1 -1
  40. package/dist/6657.js +2 -0
  41. package/dist/7170.js +1 -1
  42. package/dist/7432.js +1 -1
  43. package/dist/755.js +1 -1
  44. package/dist/7654.js +1 -1
  45. package/dist/8037.js +1 -1
  46. package/dist/817.js +1 -1
  47. package/dist/8404.js +1 -1
  48. package/dist/8612.js +1 -1
  49. package/dist/8734.js +1 -1
  50. package/dist/881.js +1 -1
  51. package/dist/8869.js +1 -1
  52. package/dist/892.js +1 -1
  53. package/dist/8948.js +1 -1
  54. package/dist/895.js +2 -0
  55. package/dist/8951.js +1 -1
  56. package/dist/9317.js +1 -1
  57. package/dist/9330.js +1 -1
  58. package/dist/9533.js +1 -1
  59. package/dist/9547.js +2 -0
  60. package/dist/9547.js.LICENSE.txt +3 -0
  61. package/dist/9709.js +1 -1
  62. package/dist/9727.js +1 -1
  63. package/dist/9797.js +1 -1
  64. package/dist/9865.js +1 -1
  65. package/dist/9886.js +1 -1
  66. package/dist/9912.js +1 -1
  67. package/dist/9984.js +1 -1
  68. package/dist/main.css +1 -1
  69. package/dist/main.js +49 -8662
  70. package/dist/main.js.LICENSE.txt +2 -2
  71. package/package.json +13 -14
  72. package/src/App.tsx +16 -15
  73. package/src/components/alert/basic.tsx +1 -1
  74. package/src/components/badge/button.tsx +16 -12
  75. package/src/components/table/column-alignment.tsx +81 -0
  76. package/src/components/table/formatter.ts +5 -0
  77. package/src/components/table/horizontal-scrollbar.tsx +51 -0
  78. package/src/components/table/render-cell.tsx +77 -26
  79. package/src/components/table/routes.ts +6 -4
  80. package/src/components/table/sort-date.tsx +1 -1
  81. package/src/components/table/test-data.ts +16 -16
  82. package/src/react.main.tsx +2 -3
  83. package/src/shares/theme.ts +12 -28
  84. package/dist/1505.js +0 -2
  85. package/dist/4705.js +0 -2
  86. package/dist/7558.js +0 -2
  87. package/dist/7792.js +0 -2
  88. /package/dist/{1505.js.LICENSE.txt → 1622.js.LICENSE.txt} +0 -0
  89. /package/dist/{4705.js.LICENSE.txt → 3600.js.LICENSE.txt} +0 -0
  90. /package/dist/{4890.js.LICENSE.txt → 4701.js.LICENSE.txt} +0 -0
  91. /package/dist/{7558.js.LICENSE.txt → 6657.js.LICENSE.txt} +0 -0
  92. /package/dist/{7792.js.LICENSE.txt → 895.js.LICENSE.txt} +0 -0
@@ -35,7 +35,7 @@
35
35
  */
36
36
 
37
37
  /**
38
- * @remix-run/router v1.14.0
38
+ * @remix-run/router v1.14.2
39
39
  *
40
40
  * Copyright (c) Remix Software Inc.
41
41
  *
@@ -46,7 +46,7 @@
46
46
  */
47
47
 
48
48
  /**
49
- * React Router v6.21.0
49
+ * React Router v6.21.3
50
50
  *
51
51
  * Copyright (c) Remix Software Inc.
52
52
  *
package/package.json CHANGED
@@ -1,33 +1,32 @@
1
1
  {
2
2
  "name": "@public-ui/sample-react",
3
- "version": "1.7.8",
3
+ "version": "1.7.10-rc.0",
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-oss/kolibri-themes": "0.0.3",
11
- "@public-ui/components": "1.7.8",
12
- "@public-ui/react": "1.7.8",
13
- "@public-ui/themes": "1.7.8",
14
- "@types/node": "20.10.5",
15
- "@types/react": "18.2.45",
10
+ "@public-ui/components": "1.7.10-rc.0",
11
+ "@public-ui/react": "1.7.10-rc.0",
12
+ "@public-ui/themes": "1.7.10-rc.0",
13
+ "@types/node": "20.11.6",
14
+ "@types/react": "18.2.48",
16
15
  "@types/react-dom": "18.2.18",
17
- "@unocss/preset-uno": "0.58.0",
18
- "@unocss/webpack": "0.58.0",
16
+ "@unocss/preset-uno": "0.58.3",
17
+ "@unocss/webpack": "0.58.3",
19
18
  "ajv": "8.12.0",
20
- "chromedriver": "120.0.0",
19
+ "chromedriver": "120.0.2",
21
20
  "cpy-cli": "5.0.0",
22
21
  "eslint-plugin-jsx-a11y": "6.8.0",
23
22
  "eslint-plugin-react": "7.33.2",
24
23
  "formik": "2.4.5",
25
- "nightwatch-axe-verbose": "2.2.2",
24
+ "nightwatch-axe-verbose": "2.3.0",
26
25
  "npm-run-all": "4.1.5",
27
26
  "react": "18.2.0",
28
27
  "react-dom": "18.2.0",
29
- "react-router": "6.21.0",
30
- "react-router-dom": "6.21.0",
28
+ "react-router": "6.21.3",
29
+ "react-router-dom": "6.21.3",
31
30
  "rimraf": "3.0.2",
32
31
  "ts-prune": "0.10.3",
33
32
  "typescript": "5.3.3",
@@ -55,7 +54,7 @@
55
54
  "format": "prettier --check src",
56
55
  "lint": "eslint \"{src,tests}/**/*.{html,js,json,jsx,ts,tsx,gql,graphql}\"",
57
56
  "serve": "cross-env NODE_ENV=development webpack serve --devtool=source-map",
58
- "start": "npm run serve",
57
+ "start": "npm run serve -- --open",
59
58
  "unused": "ts-prune -e src",
60
59
  "postinstall": "npm-run-all postinstall:*",
61
60
  "postinstall:components-assets": "cpy \"node_modules/@public-ui/components/assets/**/*\" public/assets --dot",
package/src/App.tsx CHANGED
@@ -3,9 +3,9 @@ import { Navigate, Route, Routes, useSearchParams } from 'react-router-dom';
3
3
  import { Route as MyRoute, Routes as MyRoutes } from './shares/types';
4
4
 
5
5
  import { Option } from '@public-ui/components';
6
- import { KolAlert } from '@public-ui/react';
6
+ import { KolAlert, KolBadge } from '@public-ui/react';
7
7
  import { ROUTES } from './shares/routes';
8
- import { Theme, THEME_OPTIONS } from './shares/theme';
8
+ import { isDraftTheme, Theme, THEME_OPTIONS } from './shares/theme';
9
9
  import PackageJson from '@public-ui/components/package.json';
10
10
  import { getTheme, getThemeName, setStorage, setTheme } from './shares/store';
11
11
  import { Sidebar } from './components/Sidebar';
@@ -43,19 +43,19 @@ const getRouteTree = (routes: MyRoutes): ReturnType<typeof Route>[] => {
43
43
  path={`${path}/all`}
44
44
  element={
45
45
  <div className="d-grid gap-4">
46
- {THEME_OPTIONS.filter(
47
- (theme) => ['bmf', 'default', 'ecl-ec', 'ecl-eu', 'itzbund', 'mapz', 'zoll-v2'].indexOf((theme as Option<Theme>).value) >= 0,
48
- ).map((theme) => (
49
- <div className="d-grid gap-2" key={(theme as Option<Theme>).value} data-theme={(theme as Option<Theme>).value}>
50
- <div className="mt-4">
51
- <strong>{theme.label}</strong>
46
+ {THEME_OPTIONS.filter((theme) => ['bmf', 'default', 'ecl-ec', 'ecl-eu', 'itzbund'].indexOf((theme as Option<Theme>).value) >= 0).map(
47
+ (theme) => (
48
+ <div className="d-grid gap-2" key={(theme as Option<Theme>).value} data-theme={(theme as Option<Theme>).value}>
49
+ <div className="mt-4">
50
+ <strong>{theme.label}</strong>
51
+ </div>
52
+ <div className="my-2">
53
+ <ThisRoute />
54
+ </div>
55
+ <hr aria-hidden="true" />
52
56
  </div>
53
- <div className="my-2">
54
- <ThisRoute />
55
- </div>
56
- <hr aria-hidden="true" />
57
- </div>
58
- ))}
57
+ ),
58
+ )}
59
59
  </div>
60
60
  }
61
61
  />,
@@ -101,7 +101,7 @@ ROUTE_LIST.forEach((route) => {
101
101
  export const App: FC = () => {
102
102
  const routerLocation = useLocation();
103
103
  const [searchParams, setSearchParams] = useSearchParams();
104
- const theme = searchParams.get('theme') ?? getTheme();
104
+ const theme: Theme = (searchParams.get('theme') as Theme) ?? getTheme();
105
105
  const hideMenus = searchParams.has('hideMenus');
106
106
 
107
107
  setTheme(theme as Theme); // set for `getTheme` usages within the application
@@ -129,6 +129,7 @@ export const App: FC = () => {
129
129
  )}
130
130
 
131
131
  <div className="p-4" id="route-container">
132
+ {!hideMenus && isDraftTheme(theme) && <KolBadge className="mb-3" _label="DRAFT" _color="#db5461" />}
132
133
  <Routes>
133
134
  {ROUTE_TREE}
134
135
  <Route path="*" element={<KolAlert _type="info">This code example has not been migrated yet - it&#39;s coming soon!</KolAlert>} />
@@ -32,7 +32,7 @@ const AlertByType: FC<PropsByType> = ({ level, type, variant }) => (
32
32
  </>
33
33
  );
34
34
 
35
- export const AlertBasic: FC<PropsBasic> = ({ variant }) => (
35
+ export const AlertBasic: FC<PropsBasic> = ({ variant = 'msg' }) => (
36
36
  <div className="grid gap-4">
37
37
  <AlertByType level={1} type="default" variant={variant} />
38
38
  <AlertByType level={2} type="error" variant={variant} />
@@ -1,25 +1,29 @@
1
1
  import React from 'react';
2
- import { KolBadge } from '@public-ui/react';
2
+ import { KolBadge, KolHeading } from '@public-ui/react';
3
3
 
4
4
  import { FC } from 'react';
5
5
 
6
- const PROPS = {
7
- _label: 'Label',
6
+ const createBadgeProps = (label: string) => ({
8
7
  _smartButton: {
9
8
  _icons: 'codicon codicon-close',
10
- _label: 'Entfernen',
9
+ _label: `Entfernen von ${label}`,
11
10
  _on: {
12
11
  onClick: () => alert('clicked'),
13
12
  },
14
13
  },
15
- };
14
+ });
16
15
 
17
16
  export const BadgeButton: FC = () => (
18
- <div className="d-flex gap-2">
19
- <KolBadge {...PROPS}></KolBadge>
20
- <KolBadge _color="#B22222" {...PROPS}></KolBadge>
21
- <KolBadge _color="#4682B4" {...PROPS}></KolBadge>
22
- <KolBadge _color="#228B22" {...PROPS}></KolBadge>
23
- <KolBadge _color="#8B008B" {...PROPS}></KolBadge>
24
- </div>
17
+ <>
18
+ <div className="mb-4">
19
+ <KolHeading _label="Badge" _level={2} />
20
+ </div>
21
+ <div className="flex gap-2">
22
+ <KolBadge _label="schwarz" {...createBadgeProps('schwarz')}></KolBadge>
23
+ <KolBadge _label="türkis" _color="#86ffc6" {...createBadgeProps('türkis')}></KolBadge>
24
+ <KolBadge _label="blau" _color="#06539e" {...createBadgeProps('blau')}></KolBadge>
25
+ <KolBadge _label="rot" _color="#ae0000" {...createBadgeProps('rot')}></KolBadge>
26
+ <KolBadge _label="lila" _color="#8b008b" {...createBadgeProps('lila')}></KolBadge>
27
+ </div>
28
+ </>
25
29
  );
@@ -0,0 +1,81 @@
1
+ import React, { FC } from 'react';
2
+
3
+ import { KolTable, KolHeading } from '@public-ui/react';
4
+
5
+ const DATA = [{ left: 'Left Example', center: 'Center Example', right: 'Right Example' }];
6
+ type Data = (typeof DATA)[0];
7
+ const genericNonSorter = (data: Data[]): Data[] => data;
8
+
9
+ export const TableColumnAlignment: FC = () => (
10
+ <>
11
+ <KolHeading _label="Simple table" _level={3}></KolHeading>
12
+ <KolTable
13
+ _label="Table for demonstration purposes with different text align properties"
14
+ _headers={{
15
+ horizontal: [
16
+ [
17
+ { label: 'left', key: 'left', textAlign: 'left' },
18
+ { label: 'center', key: 'center', textAlign: 'center' },
19
+ { label: 'right', key: 'right', textAlign: 'right' },
20
+ ],
21
+ ],
22
+ }}
23
+ _data={DATA}
24
+ className="block"
25
+ style={{ maxWidth: '600px' }}
26
+ />
27
+
28
+ <KolHeading _label="Table with sortable columns" _level={3} className="block mt-6"></KolHeading>
29
+ <KolTable
30
+ _label="Table for demonstration purposes with sortable columns"
31
+ _headers={{
32
+ horizontal: [
33
+ [
34
+ { label: 'left', key: 'left', textAlign: 'left', sort: genericNonSorter },
35
+ { label: 'center', key: 'center', textAlign: 'center', sort: genericNonSorter },
36
+ { label: 'right', key: 'right', textAlign: 'right', sort: genericNonSorter },
37
+ ],
38
+ ],
39
+ }}
40
+ _data={DATA}
41
+ className="block"
42
+ style={{ maxWidth: '600px' }}
43
+ />
44
+
45
+ <KolHeading _label="Table some sortable columns" _level={3} className="block mt-6"></KolHeading>
46
+ <KolTable
47
+ _label="Table for demonstration purposes with some but not all columns sortable"
48
+ _headers={{
49
+ horizontal: [
50
+ [
51
+ { label: 'left', key: 'left', textAlign: 'left', sort: genericNonSorter },
52
+ { label: 'center', key: 'center', textAlign: 'center', sort: genericNonSorter },
53
+ { label: 'right', key: 'right', textAlign: 'right' },
54
+ ],
55
+ ],
56
+ }}
57
+ _data={DATA}
58
+ className="block"
59
+ style={{ maxWidth: '600px' }}
60
+ />
61
+
62
+ <KolHeading _label="Table with vertical heading" _level={3} className="block mt-6"></KolHeading>
63
+ <KolTable
64
+ _label="Table for demonstration purposes with vertical heading"
65
+ _headers={{
66
+ horizontal: [
67
+ [
68
+ { label: '', asTd: true },
69
+ { label: 'left', key: 'left', textAlign: 'left' },
70
+ { label: 'center', key: 'center', textAlign: 'center' },
71
+ { label: 'right', key: 'right', textAlign: 'right' },
72
+ ],
73
+ ],
74
+ vertical: [[{ label: 'Vertical' }]],
75
+ }}
76
+ _data={DATA}
77
+ className="block"
78
+ style={{ maxWidth: '600px' }}
79
+ />
80
+ </>
81
+ );
@@ -0,0 +1,5 @@
1
+ export const DATE_FORMATTER = Intl.DateTimeFormat('de-DE', {
2
+ day: '2-digit',
3
+ month: '2-digit',
4
+ year: 'numeric',
5
+ });
@@ -0,0 +1,51 @@
1
+ import React, { FC, useState } from 'react';
2
+
3
+ import { KolHeading, KolInputCheckbox, KolTable } from '@public-ui/react';
4
+ import { KoliBriTableHeaders } from '@public-ui/components/src';
5
+
6
+ const DATA = [{ small: 'Small Example', large: 'Larger Example' }];
7
+ const HEADERS: KoliBriTableHeaders = {
8
+ horizontal: [
9
+ [
10
+ { label: 'Large Column', key: 'large', textAlign: 'left', width: '400px' },
11
+ { label: 'Small Column', key: 'small', textAlign: 'left', width: '200px' },
12
+ ],
13
+ ],
14
+ };
15
+
16
+ export const TableHorizontalScrollbar: FC = () => {
17
+ const [hasWidthRestriction, setHasWidthRestriction] = useState(true);
18
+
19
+ return (
20
+ <>
21
+ <KolHeading _label="Table with scrollbar" _level={2} />
22
+
23
+ <KolTable
24
+ _label="Table for demonstration purposes with horizontal scrollbar."
25
+ _minWidth={hasWidthRestriction ? '600px' : 'auto'}
26
+ _headers={HEADERS}
27
+ _data={DATA}
28
+ className="block"
29
+ style={{ width: '400px' }}
30
+ />
31
+
32
+ <KolInputCheckbox
33
+ _checked={hasWidthRestriction}
34
+ _label="Toggle width restriction"
35
+ _variant="switch"
36
+ _on={{
37
+ onChange: (_event, value) => {
38
+ setHasWidthRestriction(Boolean(value));
39
+ },
40
+ }}
41
+ ></KolInputCheckbox>
42
+
43
+ <KolHeading _label="Same table without scrollbar" _level={2} className="block mt-4" />
44
+ <p className="mt-0">
45
+ <i>Scrollbar appears on very small viewport sizes</i>
46
+ </p>
47
+
48
+ <KolTable _label="Table for demonstration purposes without horizontal scrollbar" _minWidth="600px" _headers={HEADERS} _data={DATA} className="block" />
49
+ </>
50
+ );
51
+ };
@@ -4,45 +4,96 @@ import { KolButton, KolInputText, KolTable } from '@public-ui/react';
4
4
 
5
5
  import { getRoot } from '../../shares/react-roots';
6
6
  import { KoliBriTableHeaders } from '@public-ui/components';
7
- import { DATA, Data } from './test-data';
7
+ import { DATE_FORMATTER } from './formatter';
8
8
 
9
- const DATE_FORMATTER = Intl.DateTimeFormat('de-DE', {
10
- day: '2-digit',
11
- month: '2-digit',
12
- year: 'numeric',
13
- });
9
+ type Data = {
10
+ order: number;
11
+ date: Date;
12
+ shipped: boolean;
13
+ };
14
+ const DATA: Data[] = [
15
+ {
16
+ order: 0,
17
+ shipped: false,
18
+ date: new Date('1981-05-26T21:33:43.612Z'),
19
+ },
20
+ {
21
+ order: 1,
22
+ shipped: true,
23
+ date: new Date('1971-04-25T19:44:17.014Z'),
24
+ },
25
+ {
26
+ order: 2,
27
+ shipped: false,
28
+ date: new Date('1986-07-10T11:39:29.539Z'),
29
+ },
30
+ ];
14
31
 
15
32
  const HEADERS: KoliBriTableHeaders = {
16
33
  horizontal: [
17
34
  [
18
- { label: '#', key: 'order', textAlign: 'center' },
19
35
  {
20
- label: 'Datum (string)',
36
+ label: '#',
37
+ key: 'order',
38
+ textAlign: 'center',
39
+ width: '10em',
40
+
41
+ /* Example 1: Use render return value to format data */
42
+ render: (_el, cell) => `Index: ${cell.label}`,
43
+ },
44
+ {
45
+ label: 'Status',
46
+ key: 'shipped',
47
+ textAlign: 'center',
48
+ width: '10em',
49
+
50
+ /* Example 2: Simple render function using textContent */
51
+ render: (el, cell) => {
52
+ if (cell.label) {
53
+ el.textContent = `Order has been dispatched 🚚`;
54
+ } else {
55
+ el.textContent = `Order pending 📦`;
56
+ }
57
+ },
58
+ },
59
+ {
60
+ label: 'Date (string)',
21
61
  key: 'date',
62
+ width: '20em',
22
63
  textAlign: 'center',
23
- render: (el, tupel) => {
24
- el.setAttribute('role', 'presentation');
25
64
 
26
- // https://reactjs.org/docs/portals.html
27
- getRoot(el).render(<strong>{DATE_FORMATTER.format((tupel as Data).date)}</strong>);
65
+ /* Example 3: Render function using innerHTML. ⚠️Make sure to sanitize data to avoid XSS. */
66
+ render: (el, cell) => {
67
+ el.innerHTML = `<strong>${DATE_FORMATTER.format(cell.label as unknown as Date)}</strong>`;
28
68
  },
29
- sort: (data: Data[]) =>
30
- data.sort((data0, data1) => {
31
- if (data0.date < data1.date) return -1;
32
- else if (data1.date < data0.date) return 1;
33
- else return 0;
34
- }),
69
+ sort: (data: Data[]) => data.sort((data0, data1) => data0.date.getTime() - data1.date.getTime()),
35
70
  },
36
71
  {
37
- label: 'Aktion (react)',
72
+ label: 'Action (react)',
38
73
  key: 'order',
74
+ width: '20em',
75
+
76
+ /* Example 4: Render function using React */
39
77
  render: (el) => {
40
- // https://reactjs.org/docs/portals.html
41
- getRoot(el).render(
42
- <>
43
- <KolButton _label={'Speichern'} />
44
- <KolInputText _label="Eingabe" />
45
- </>,
78
+ const renderElement = document.createElement('div');
79
+ renderElement.setAttribute('role', 'presentation');
80
+ el.innerHTML = '';
81
+ el.appendChild(renderElement);
82
+
83
+ /* https://react.dev/reference/react-dom/client/createRoot */
84
+ getRoot(renderElement).render(
85
+ <div
86
+ style={{
87
+ display: `grid`,
88
+ gridAutoFlow: `column`,
89
+ alignItems: `end`,
90
+ gap: `1rem`,
91
+ maxWidth: `400px`,
92
+ }}
93
+ >
94
+ <KolInputText _label="Input" />
95
+ <KolButton _label={'Save'} />
96
+ </div>,
46
97
  );
47
98
  },
48
99
  },
@@ -50,4 +101,4 @@ const HEADERS: KoliBriTableHeaders = {
50
101
  ],
51
102
  };
52
103
 
53
- export const TableRenderCell: FC = () => <KolTable _caption="Sort a date column" _data={DATA} _headers={HEADERS} className="block" />;
104
+ export const TableRenderCell: FC = () => <KolTable _label="Sort by date column" _data={DATA} _headers={HEADERS} className="block min-w-75em" />;
@@ -1,17 +1,19 @@
1
1
  import { Routes } from '../../shares/types';
2
2
 
3
3
  import { TableBadgeSize } from './badge-size';
4
-
5
4
  import { TableRenderCell } from './render-cell';
6
-
7
- import { TableSortTable } from './sort-date';
5
+ import { TableSortData } from './sort-date';
8
6
  import { TableWithPagination } from './with-pagination';
7
+ import { TableColumnAlignment } from './column-alignment';
8
+ import { TableHorizontalScrollbar } from './horizontal-scrollbar';
9
9
 
10
10
  export const TABLE_ROUTES: Routes = {
11
11
  table: {
12
12
  'badge-size': TableBadgeSize,
13
+ 'column-alignment': TableColumnAlignment,
14
+ 'horizontal-scrollbar': TableHorizontalScrollbar,
13
15
  'render-cell': TableRenderCell,
14
- 'sort-data': TableSortTable,
16
+ 'sort-data': TableSortData,
15
17
  'with-pagination': TableWithPagination,
16
18
  },
17
19
  };
@@ -30,4 +30,4 @@ const HEADERS: KoliBriTableHeaders = {
30
30
  ],
31
31
  };
32
32
 
33
- export const TableSortTable: FC = () => <KolTable _caption="Sort a date column" _data={DATA} _headers={HEADERS} className="block" />;
33
+ export const TableSortData: FC = () => <KolTable _caption="Sort a date column" _data={DATA} _headers={HEADERS} className="block" />;
@@ -1,66 +1,66 @@
1
1
  export type Data = {
2
2
  order: number;
3
- date: String;
3
+ date: Date;
4
4
  };
5
5
  export const DATA: Data[] = [
6
6
  {
7
7
  order: 0,
8
- date: new Date('1981-05-26T21:33:43.612Z').toString(),
8
+ date: new Date('1981-05-26T21:33:43.612Z'),
9
9
  },
10
10
  {
11
11
  order: 1,
12
- date: new Date('1971-04-25T19:44:17.014Z').toString(),
12
+ date: new Date('1971-04-25T19:44:17.014Z'),
13
13
  },
14
14
  {
15
15
  order: 2,
16
- date: new Date('1986-07-10T11:39:29.539Z').toString(),
16
+ date: new Date('1986-07-10T11:39:29.539Z'),
17
17
  },
18
18
  {
19
19
  order: 3,
20
- date: new Date('1976-02-02T10:00:36.346Z').toString(),
20
+ date: new Date('1976-02-02T10:00:36.346Z'),
21
21
  },
22
22
  {
23
23
  order: 4,
24
- date: new Date('1998-07-07T12:50:36.016Z').toString(),
24
+ date: new Date('1998-07-07T12:50:36.016Z'),
25
25
  },
26
26
  {
27
27
  order: 5,
28
- date: new Date('1994-09-05T05:10:44.078Z').toString(),
28
+ date: new Date('1994-09-05T05:10:44.078Z'),
29
29
  },
30
30
  {
31
31
  order: 6,
32
- date: new Date('1986-05-23T13:05:01.874Z').toString(),
32
+ date: new Date('1986-05-23T13:05:01.874Z'),
33
33
  },
34
34
  {
35
35
  order: 7,
36
- date: new Date('1975-06-29T21:51:29.359Z').toString(),
36
+ date: new Date('1975-06-29T21:51:29.359Z'),
37
37
  },
38
38
  {
39
39
  order: 8,
40
- date: new Date('1974-05-15T23:47:02.499Z').toString(),
40
+ date: new Date('1974-05-15T23:47:02.499Z'),
41
41
  },
42
42
  {
43
43
  order: 9,
44
- date: new Date('1990-05-27T10:13:19.641Z').toString(),
44
+ date: new Date('1990-05-27T10:13:19.641Z'),
45
45
  },
46
46
  {
47
47
  order: 10,
48
- date: new Date('1993-10-20T03:54:08.739Z').toString(),
48
+ date: new Date('1993-10-20T03:54:08.739Z'),
49
49
  },
50
50
  {
51
51
  order: 11,
52
- date: new Date('2000-02-25T11:55:43.705Z').toString(),
52
+ date: new Date('2000-02-25T11:55:43.705Z'),
53
53
  },
54
54
  {
55
55
  order: 12,
56
- date: new Date('1988-08-27T09:59:12.251Z').toString(),
56
+ date: new Date('1988-08-27T09:59:12.251Z'),
57
57
  },
58
58
  {
59
59
  order: 13,
60
- date: new Date('1980-10-24T10:41:24.897Z').toString(),
60
+ date: new Date('1980-10-24T10:41:24.897Z'),
61
61
  },
62
62
  {
63
63
  order: 14,
64
- date: new Date('1995-01-25T12:31:27.983Z').toString(),
64
+ date: new Date('1995-01-25T12:31:27.983Z'),
65
65
  },
66
66
  ];
@@ -2,10 +2,9 @@ import React, { StrictMode } from 'react';
2
2
  import { createRoot } from 'react-dom/client';
3
3
  import { HashRouter as Router } from 'react-router-dom';
4
4
 
5
- import { TH } from '@public-oss/kolibri-themes';
6
5
  import { register } from '@public-ui/components';
7
6
  import { defineCustomElements } from '@public-ui/components/dist/loader';
8
- import { BAMF, BMF, BZSt, DEFAULT, DESYv1, DESYv2, ECL_EC, ECL_EU, ITZBund, MAPZ, ZOLLv2 } from '@public-ui/themes';
7
+ import { BMF, DEFAULT, ECL_EC, ECL_EU, ITZBund } from '@public-ui/themes';
9
8
  import type { Generic } from 'adopted-style-sheets';
10
9
  import { App } from './App';
11
10
 
@@ -23,7 +22,7 @@ void (async () => {
23
22
  } else {
24
23
  /* Regular mode: Register all known themes. */
25
24
  try {
26
- await register([BAMF, BMF, DEFAULT, BZSt, DESYv1, DESYv2, ECL_EC, ECL_EU, ITZBund, MAPZ, ZOLLv2, TH], defineCustomElements, {
25
+ await register([BMF, DEFAULT, ECL_EC, ECL_EU, ITZBund], defineCustomElements, {
27
26
  theme: {
28
27
  detect: 'auto',
29
28
  },
@@ -1,19 +1,15 @@
1
1
  import { SelectOption } from '@public-ui/components';
2
2
 
3
- export type Theme = 'bmf' | 'default' | 'ecl-ec' | 'ecl-eu' | 'itzbund' | 'mapz' | 'th' | 'unstyled' | 'zoll-v2';
3
+ export type Theme = 'bmf' | 'default' | 'ecl-ec' | 'ecl-eu' | 'itzbund' | 'unstyled';
4
+
5
+ const drafts: Theme[] = ['ecl-ec', 'ecl-eu', 'itzbund'];
6
+
7
+ export const isDraftTheme = (theme: Theme) => drafts.includes(theme);
4
8
 
5
9
  export const isTheme = (value: unknown) => {
6
10
  return (
7
11
  typeof value === 'string' &&
8
- (value === 'unstyled' ||
9
- value === 'bmf' ||
10
- value === 'default' ||
11
- value === 'ecl-ec' ||
12
- value === 'ecl-eu' ||
13
- value === 'itzbund' ||
14
- value === 'mapz' ||
15
- value === 'th' ||
16
- value === 'zoll-v2')
12
+ (value === 'bmf' || value === 'default' || value === 'ecl-ec' || value === 'ecl-eu' || value === 'itzbund' || value === 'unstyled')
17
13
  );
18
14
  };
19
15
 
@@ -24,39 +20,27 @@ export type Store = {
24
20
 
25
21
  export const THEME_OPTIONS: SelectOption<Theme>[] = [
26
22
  {
27
- label: 'Unstyled',
23
+ label: 'Unstyled (Uncolored)',
28
24
  value: 'unstyled',
29
25
  },
30
26
  {
31
- label: 'Bundesministerium der Finanzen',
27
+ label: 'Bundesministerium der Finanzen (Tested)',
32
28
  value: 'bmf',
33
29
  },
34
30
  {
35
- label: 'Default',
31
+ label: 'Default (Tested)',
36
32
  value: 'default',
37
33
  },
38
34
  {
39
- label: 'European Commission (ECL)',
35
+ label: 'European Commission (Draft)',
40
36
  value: 'ecl-ec',
41
37
  },
42
38
  {
43
- label: 'European Union (ECL)',
39
+ label: 'European Union (Draft)',
44
40
  value: 'ecl-eu',
45
41
  },
46
42
  {
47
- label: 'Informationstechnikzentrum Bund',
43
+ label: 'Informationstechnikzentrum Bund (Draft)',
48
44
  value: 'itzbund',
49
45
  },
50
- {
51
- label: '.',
52
- value: 'mapz',
53
- },
54
- {
55
- label: 'Freistaat Thüringen',
56
- value: 'th',
57
- },
58
- {
59
- label: '..',
60
- value: 'zoll-v2',
61
- },
62
46
  ];