@public-ui/sample-react 2.0.0-rc.9 → 2.0.1
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/README.md +18 -0
- package/dist/1130.js +2 -0
- package/dist/1474.js +1 -1
- package/dist/{2597.js → 1644.js} +2 -2
- package/dist/183.js +1 -1
- package/dist/2337.js +1 -1
- package/dist/2412.js +1 -1
- package/dist/{5327.js → 2738.js} +2 -2
- package/dist/3303.js +1 -1
- package/dist/3325.js +1 -1
- package/dist/3429.js +1 -1
- package/dist/3459.js +1 -1
- package/dist/3932.js +1 -1
- package/dist/4022.js +1 -1
- package/dist/4164.js +1 -1
- package/dist/4195.js +1 -1
- package/dist/4291.js +1 -1
- package/dist/4323.js +1 -1
- package/dist/4355.js +1 -1
- package/dist/4564.js +1 -1
- package/dist/4891.js +1 -1
- package/dist/5183.js +1 -1
- package/dist/5369.js +1 -1
- package/dist/5382.js +2 -0
- package/dist/5390.js +1 -1
- package/dist/540.js +1 -1
- package/dist/5717.js +1 -1
- package/dist/{8026.js → 5860.js} +2 -2
- package/dist/5862.js +1 -1
- package/dist/5866.js +1 -1
- package/dist/589.js +2 -0
- package/dist/6012.js +1 -1
- package/dist/6068.js +1 -1
- package/dist/6210.js +1 -1
- package/dist/6320.js +1 -1
- package/dist/6558.js +1 -1
- package/dist/6813.js +1 -1
- package/dist/6908.js +1 -1
- package/dist/7029.js +1 -1
- package/dist/7255.js +1 -1
- package/dist/{9598.js → 7380.js} +2 -2
- package/dist/7447.js +1 -1
- package/dist/7535.js +1 -1
- package/dist/7715.js +1 -1
- package/dist/7722.js +1 -1
- package/dist/7734.js +1 -1
- package/dist/7801.js +1 -1
- package/dist/7858.js +1 -1
- package/dist/7955.js +1 -1
- package/dist/7995.js +1 -1
- package/dist/8061.js +1 -1
- package/dist/8065.js +1 -1
- package/dist/8073.js +1 -1
- package/dist/8111.js +1 -1
- package/dist/8255.js +1 -1
- package/dist/8291.js +1 -1
- package/dist/8709.js +1 -1
- package/dist/8761.js +1 -1
- package/dist/9734.js +1 -1
- package/dist/9747.js +1 -1
- package/dist/979.js +2 -0
- package/dist/9792.js +1 -1
- package/dist/9895.js +1 -1
- package/dist/9963.js +1 -1
- package/dist/9972.js +1 -1
- package/dist/main.css +1 -1
- package/dist/main.js +680 -3419
- package/dist/main.js.LICENSE.txt +2 -2
- package/package.json +14 -14
- package/src/App.tsx +3 -1
- package/src/components/FocusInput.tsx +9 -8
- package/src/components/avatar/basic.tsx +3 -1
- package/src/components/badge/basic.tsx +5 -9
- package/src/components/badge/button.tsx +16 -12
- package/src/components/button-link/basic.tsx +3 -0
- package/src/components/button-link/image.tsx +1 -1
- package/src/components/card/flex.tsx +1 -1
- package/src/components/card/selection.tsx +3 -3
- package/src/components/handout/basic.tsx +19 -7
- package/src/components/heading/badged.tsx +5 -5
- package/src/components/image/basic.tsx +1 -1
- package/src/components/input-checkbox/partials/cases.tsx +2 -0
- package/src/components/input-radio/partials/cases.tsx +1 -2
- package/src/components/kolibri/basic.tsx +16 -2
- package/src/components/kolibri/routes.ts +0 -4
- package/src/components/link/basic.tsx +1 -3
- package/src/components/link/image.tsx +2 -2
- package/src/components/nav/aria-current.tsx +25 -15
- package/src/components/nav/basic.tsx +1 -3
- package/src/components/nav/horizontal.tsx +0 -3
- package/src/components/nav/routes.ts +0 -6
- package/src/components/split-button/basic.tsx +13 -2
- package/src/components/table/formatter.ts +5 -0
- package/src/components/table/render-cell.tsx +16 -8
- package/src/components/table/test-data.ts +340 -0
- package/src/components/table/with-pagination.tsx +4 -3
- package/src/components/tabs/basic.tsx +21 -6
- package/src/components/toast/basic.tsx +11 -1
- package/src/hooks/useSetCurrentLocation.ts +7 -0
- package/src/react.main.tsx +13 -7
- package/src/scenarios/appointment-form/ErrorList.tsx +1 -1
- package/src/scenarios/complex-form/component.tsx +23 -23
- package/src/scenarios/custom-tooltip-width.tsx +6 -0
- package/src/scenarios/inputs-get-value.tsx +160 -0
- package/src/scenarios/routes.ts +4 -0
- package/src/shares/theme.ts +4 -4
- package/dist/3961.js +0 -2
- package/dist/4446.js +0 -2
- package/dist/7052.js +0 -2
- package/dist/9091.js +0 -2
- package/src/components/kolibri/animated.tsx +0 -4
- package/src/components/kolibri/no-label.tsx +0 -4
- package/src/components/nav/active.tsx +0 -87
- /package/dist/{2597.js.LICENSE.txt → 1130.js.LICENSE.txt} +0 -0
- /package/dist/{3961.js.LICENSE.txt → 1644.js.LICENSE.txt} +0 -0
- /package/dist/{4446.js.LICENSE.txt → 2738.js.LICENSE.txt} +0 -0
- /package/dist/{5327.js.LICENSE.txt → 5382.js.LICENSE.txt} +0 -0
- /package/dist/{7052.js.LICENSE.txt → 5860.js.LICENSE.txt} +0 -0
- /package/dist/{8026.js.LICENSE.txt → 589.js.LICENSE.txt} +0 -0
- /package/dist/{9091.js.LICENSE.txt → 7380.js.LICENSE.txt} +0 -0
- /package/dist/{9598.js.LICENSE.txt → 979.js.LICENSE.txt} +0 -0
|
@@ -5,12 +5,8 @@ import { KolButton, KolInputText, KolTable } from '@public-ui/react';
|
|
|
5
5
|
import { getRoot } from '../../shares/react-roots';
|
|
6
6
|
import { KoliBriTableHeaders } from '@public-ui/components';
|
|
7
7
|
import { DATA, Data } from './test-data';
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
day: '2-digit',
|
|
11
|
-
month: '2-digit',
|
|
12
|
-
year: 'numeric',
|
|
13
|
-
});
|
|
8
|
+
import { DATE_FORMATTER } from './formatter';
|
|
9
|
+
import { SampleDescription } from '../SampleDescription';
|
|
14
10
|
|
|
15
11
|
const HEADERS: KoliBriTableHeaders = {
|
|
16
12
|
horizontal: [
|
|
@@ -20,7 +16,10 @@ const HEADERS: KoliBriTableHeaders = {
|
|
|
20
16
|
label: 'Datum (string)',
|
|
21
17
|
key: 'date',
|
|
22
18
|
textAlign: 'center',
|
|
23
|
-
render: (
|
|
19
|
+
render: (el, tupel) => {
|
|
20
|
+
// https://reactjs.org/docs/portals.html
|
|
21
|
+
getRoot(el).render(<strong>{DATE_FORMATTER.format(tupel.label as unknown as Date)}</strong>);
|
|
22
|
+
},
|
|
24
23
|
sort: (data: Data[]) =>
|
|
25
24
|
data.sort((data0, data1) => {
|
|
26
25
|
if (data0.date < data1.date) return -1;
|
|
@@ -32,6 +31,8 @@ const HEADERS: KoliBriTableHeaders = {
|
|
|
32
31
|
label: 'Aktion (react)',
|
|
33
32
|
key: 'order',
|
|
34
33
|
render: (el) => {
|
|
34
|
+
el.setAttribute('role', 'presentation');
|
|
35
|
+
|
|
35
36
|
// https://reactjs.org/docs/portals.html
|
|
36
37
|
getRoot(el).render(
|
|
37
38
|
<>
|
|
@@ -45,4 +46,11 @@ const HEADERS: KoliBriTableHeaders = {
|
|
|
45
46
|
],
|
|
46
47
|
};
|
|
47
48
|
|
|
48
|
-
export const TableRenderCell: FC = () =>
|
|
49
|
+
export const TableRenderCell: FC = () => (
|
|
50
|
+
<>
|
|
51
|
+
<SampleDescription>
|
|
52
|
+
<p>This sample simulates the usage of React render functions for the table column contents.</p>
|
|
53
|
+
</SampleDescription>
|
|
54
|
+
<KolTable _label="Sort a date column" _data={DATA} _headers={HEADERS} className="block" />
|
|
55
|
+
</>
|
|
56
|
+
);
|
|
@@ -63,4 +63,344 @@ export const DATA: Data[] = [
|
|
|
63
63
|
order: 14,
|
|
64
64
|
date: new Date('1995-01-25T12:31:27.983Z'),
|
|
65
65
|
},
|
|
66
|
+
{
|
|
67
|
+
order: 15,
|
|
68
|
+
date: new Date('1995-04-15T02:00:39.048Z'),
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
order: 16,
|
|
72
|
+
date: new Date('1994-03-15T19:13:04.564Z'),
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
order: 17,
|
|
76
|
+
date: new Date('1999-03-02T16:53:04.418Z'),
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
order: 18,
|
|
80
|
+
date: new Date('1982-08-23T18:37:38.014Z'),
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
order: 19,
|
|
84
|
+
date: new Date('1995-06-19T12:39:56.321Z'),
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
order: 20,
|
|
88
|
+
date: new Date('1994-09-23T15:03:35.746Z'),
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
order: 21,
|
|
92
|
+
date: new Date('1990-04-15T23:38:02.147Z'),
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
order: 22,
|
|
96
|
+
date: new Date('1983-08-01T10:36:44.006Z'),
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
order: 23,
|
|
100
|
+
date: new Date('1986-06-28T21:27:04.588Z'),
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
order: 24,
|
|
104
|
+
date: new Date('1986-08-14T19:34:40.904Z'),
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
order: 25,
|
|
108
|
+
date: new Date('1998-07-14T15:52:29.010Z'),
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
order: 26,
|
|
112
|
+
date: new Date('1985-02-15T18:56:32.344Z'),
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
order: 27,
|
|
116
|
+
date: new Date('1989-09-06T10:49:30.896Z'),
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
order: 28,
|
|
120
|
+
date: new Date('1994-09-05T14:21:37.211Z'),
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
order: 29,
|
|
124
|
+
date: new Date('1995-12-15T23:12:14.411Z'),
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
order: 30,
|
|
128
|
+
date: new Date('1986-08-14T19:34:40.904Z'),
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
order: 31,
|
|
132
|
+
date: new Date('1985-02-15T18:56:32.344Z'),
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
order: 32,
|
|
136
|
+
date: new Date('1989-09-06T10:49:30.896Z'),
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
order: 33,
|
|
140
|
+
date: new Date('1994-09-05T14:21:37.211Z'),
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
order: 34,
|
|
144
|
+
date: new Date('1995-12-15T23:12:14.411Z'),
|
|
145
|
+
},
|
|
146
|
+
{
|
|
147
|
+
order: 35,
|
|
148
|
+
date: new Date('1986-08-14T19:34:40.904Z'),
|
|
149
|
+
},
|
|
150
|
+
{
|
|
151
|
+
order: 36,
|
|
152
|
+
date: new Date('1985-02-15T18:56:32.344Z'),
|
|
153
|
+
},
|
|
154
|
+
{
|
|
155
|
+
order: 37,
|
|
156
|
+
date: new Date('1989-09-06T10:49:30.896Z'),
|
|
157
|
+
},
|
|
158
|
+
{
|
|
159
|
+
order: 38,
|
|
160
|
+
date: new Date('1994-09-05T14:21:37.211Z'),
|
|
161
|
+
},
|
|
162
|
+
{
|
|
163
|
+
order: 39,
|
|
164
|
+
date: new Date('1995-12-15T23:12:14.411Z'),
|
|
165
|
+
},
|
|
166
|
+
{
|
|
167
|
+
order: 40,
|
|
168
|
+
date: new Date('1986-08-14T19:34:40.904Z'),
|
|
169
|
+
},
|
|
170
|
+
{
|
|
171
|
+
order: 41,
|
|
172
|
+
date: new Date('1985-02-15T18:56:32.344Z'),
|
|
173
|
+
},
|
|
174
|
+
{
|
|
175
|
+
order: 42,
|
|
176
|
+
date: new Date('1989-09-06T10:49:30.896Z'),
|
|
177
|
+
},
|
|
178
|
+
{
|
|
179
|
+
order: 43,
|
|
180
|
+
date: new Date('1994-09-05T14:21:37.211Z'),
|
|
181
|
+
},
|
|
182
|
+
{
|
|
183
|
+
order: 44,
|
|
184
|
+
date: new Date('1995-12-15T23:12:14.411Z'),
|
|
185
|
+
},
|
|
186
|
+
{
|
|
187
|
+
order: 45,
|
|
188
|
+
date: new Date('1986-08-14T19:34:40.904Z'),
|
|
189
|
+
},
|
|
190
|
+
{
|
|
191
|
+
order: 46,
|
|
192
|
+
date: new Date('1985-02-15T18:56:32.344Z'),
|
|
193
|
+
},
|
|
194
|
+
{
|
|
195
|
+
order: 47,
|
|
196
|
+
date: new Date('1989-09-06T10:49:30.896Z'),
|
|
197
|
+
},
|
|
198
|
+
{
|
|
199
|
+
order: 48,
|
|
200
|
+
date: new Date('1994-09-05T14:21:37.211Z'),
|
|
201
|
+
},
|
|
202
|
+
{
|
|
203
|
+
order: 49,
|
|
204
|
+
date: new Date('1995-12-15T23:12:14.411Z'),
|
|
205
|
+
},
|
|
206
|
+
{
|
|
207
|
+
order: 50,
|
|
208
|
+
date: new Date('1986-08-14T19:34:40.904Z'),
|
|
209
|
+
},
|
|
210
|
+
{
|
|
211
|
+
order: 51,
|
|
212
|
+
date: new Date('1985-02-15T18:56:32.344Z'),
|
|
213
|
+
},
|
|
214
|
+
{
|
|
215
|
+
order: 52,
|
|
216
|
+
date: new Date('1989-09-06T10:49:30.896Z'),
|
|
217
|
+
},
|
|
218
|
+
{
|
|
219
|
+
order: 53,
|
|
220
|
+
date: new Date('1994-09-05T14:21:37.211Z'),
|
|
221
|
+
},
|
|
222
|
+
{
|
|
223
|
+
order: 54,
|
|
224
|
+
date: new Date('1995-12-15T23:12:14.411Z'),
|
|
225
|
+
},
|
|
226
|
+
{
|
|
227
|
+
order: 55,
|
|
228
|
+
date: new Date('1986-08-14T19:34:40.904Z'),
|
|
229
|
+
},
|
|
230
|
+
{
|
|
231
|
+
order: 56,
|
|
232
|
+
date: new Date('1985-02-15T18:56:32.344Z'),
|
|
233
|
+
},
|
|
234
|
+
{
|
|
235
|
+
order: 57,
|
|
236
|
+
date: new Date('1989-09-06T10:49:30.896Z'),
|
|
237
|
+
},
|
|
238
|
+
{
|
|
239
|
+
order: 58,
|
|
240
|
+
date: new Date('1994-09-05T14:21:37.211Z'),
|
|
241
|
+
},
|
|
242
|
+
{
|
|
243
|
+
order: 59,
|
|
244
|
+
date: new Date('1995-12-15T23:12:14.411Z'),
|
|
245
|
+
},
|
|
246
|
+
{
|
|
247
|
+
order: 60,
|
|
248
|
+
date: new Date('1986-08-14T19:34:40.904Z'),
|
|
249
|
+
},
|
|
250
|
+
{
|
|
251
|
+
order: 61,
|
|
252
|
+
date: new Date('1985-02-15T18:56:32.344Z'),
|
|
253
|
+
},
|
|
254
|
+
{
|
|
255
|
+
order: 62,
|
|
256
|
+
date: new Date('1989-09-06T10:49:30.896Z'),
|
|
257
|
+
},
|
|
258
|
+
{
|
|
259
|
+
order: 63,
|
|
260
|
+
date: new Date('1994-09-05T14:21:37.211Z'),
|
|
261
|
+
},
|
|
262
|
+
{
|
|
263
|
+
order: 64,
|
|
264
|
+
date: new Date('1995-12-15T23:12:14.411Z'),
|
|
265
|
+
},
|
|
266
|
+
{
|
|
267
|
+
order: 65,
|
|
268
|
+
date: new Date('1986-08-14T19:34:40.904Z'),
|
|
269
|
+
},
|
|
270
|
+
{
|
|
271
|
+
order: 66,
|
|
272
|
+
date: new Date('1985-02-15T18:56:32.344Z'),
|
|
273
|
+
},
|
|
274
|
+
{
|
|
275
|
+
order: 67,
|
|
276
|
+
date: new Date('1989-09-06T10:49:30.896Z'),
|
|
277
|
+
},
|
|
278
|
+
{
|
|
279
|
+
order: 68,
|
|
280
|
+
date: new Date('1994-09-05T14:21:37.211Z'),
|
|
281
|
+
},
|
|
282
|
+
{
|
|
283
|
+
order: 69,
|
|
284
|
+
date: new Date('1995-12-15T23:12:14.411Z'),
|
|
285
|
+
},
|
|
286
|
+
{
|
|
287
|
+
order: 70,
|
|
288
|
+
date: new Date('1986-08-14T19:34:40.904Z'),
|
|
289
|
+
},
|
|
290
|
+
{
|
|
291
|
+
order: 71,
|
|
292
|
+
date: new Date('1985-02-15T18:56:32.344Z'),
|
|
293
|
+
},
|
|
294
|
+
{
|
|
295
|
+
order: 72,
|
|
296
|
+
date: new Date('1989-09-06T10:49:30.896Z'),
|
|
297
|
+
},
|
|
298
|
+
{
|
|
299
|
+
order: 73,
|
|
300
|
+
date: new Date('1994-09-05T14:21:37.211Z'),
|
|
301
|
+
},
|
|
302
|
+
{
|
|
303
|
+
order: 74,
|
|
304
|
+
date: new Date('1995-12-15T23:12:14.411Z'),
|
|
305
|
+
},
|
|
306
|
+
{
|
|
307
|
+
order: 75,
|
|
308
|
+
date: new Date('1986-08-14T19:34:40.904Z'),
|
|
309
|
+
},
|
|
310
|
+
{
|
|
311
|
+
order: 76,
|
|
312
|
+
date: new Date('1985-02-15T18:56:32.344Z'),
|
|
313
|
+
},
|
|
314
|
+
{
|
|
315
|
+
order: 77,
|
|
316
|
+
date: new Date('1989-09-06T10:49:30.896Z'),
|
|
317
|
+
},
|
|
318
|
+
{
|
|
319
|
+
order: 78,
|
|
320
|
+
date: new Date('1994-09-05T14:21:37.211Z'),
|
|
321
|
+
},
|
|
322
|
+
{
|
|
323
|
+
order: 79,
|
|
324
|
+
date: new Date('1995-12-15T23:12:14.411Z'),
|
|
325
|
+
},
|
|
326
|
+
{
|
|
327
|
+
order: 80,
|
|
328
|
+
date: new Date('1986-08-14T19:34:40.904Z'),
|
|
329
|
+
},
|
|
330
|
+
{
|
|
331
|
+
order: 81,
|
|
332
|
+
date: new Date('1985-02-15T18:56:32.344Z'),
|
|
333
|
+
},
|
|
334
|
+
{
|
|
335
|
+
order: 82,
|
|
336
|
+
date: new Date('1989-09-06T10:49:30.896Z'),
|
|
337
|
+
},
|
|
338
|
+
{
|
|
339
|
+
order: 83,
|
|
340
|
+
date: new Date('1994-09-05T14:21:37.211Z'),
|
|
341
|
+
},
|
|
342
|
+
{
|
|
343
|
+
order: 84,
|
|
344
|
+
date: new Date('1995-12-15T23:12:14.411Z'),
|
|
345
|
+
},
|
|
346
|
+
{
|
|
347
|
+
order: 85,
|
|
348
|
+
date: new Date('1986-08-14T19:34:40.904Z'),
|
|
349
|
+
},
|
|
350
|
+
{
|
|
351
|
+
order: 86,
|
|
352
|
+
date: new Date('1985-02-15T18:56:32.344Z'),
|
|
353
|
+
},
|
|
354
|
+
{
|
|
355
|
+
order: 87,
|
|
356
|
+
date: new Date('1989-09-06T10:49:30.896Z'),
|
|
357
|
+
},
|
|
358
|
+
{
|
|
359
|
+
order: 88,
|
|
360
|
+
date: new Date('1994-09-05T14:21:37.211Z'),
|
|
361
|
+
},
|
|
362
|
+
{
|
|
363
|
+
order: 89,
|
|
364
|
+
date: new Date('1995-12-15T23:12:14.411Z'),
|
|
365
|
+
},
|
|
366
|
+
{
|
|
367
|
+
order: 90,
|
|
368
|
+
date: new Date('1986-08-14T19:34:40.904Z'),
|
|
369
|
+
},
|
|
370
|
+
{
|
|
371
|
+
order: 91,
|
|
372
|
+
date: new Date('1985-02-15T18:56:32.344Z'),
|
|
373
|
+
},
|
|
374
|
+
{
|
|
375
|
+
order: 92,
|
|
376
|
+
date: new Date('1989-09-06T10:49:30.896Z'),
|
|
377
|
+
},
|
|
378
|
+
{
|
|
379
|
+
order: 93,
|
|
380
|
+
date: new Date('1994-09-05T14:21:37.211Z'),
|
|
381
|
+
},
|
|
382
|
+
{
|
|
383
|
+
order: 94,
|
|
384
|
+
date: new Date('1995-12-15T23:12:14.411Z'),
|
|
385
|
+
},
|
|
386
|
+
{
|
|
387
|
+
order: 95,
|
|
388
|
+
date: new Date('1986-08-14T19:34:40.904Z'),
|
|
389
|
+
},
|
|
390
|
+
{
|
|
391
|
+
order: 96,
|
|
392
|
+
date: new Date('1985-02-15T18:56:32.344Z'),
|
|
393
|
+
},
|
|
394
|
+
{
|
|
395
|
+
order: 97,
|
|
396
|
+
date: new Date('1989-09-06T10:49:30.896Z'),
|
|
397
|
+
},
|
|
398
|
+
{
|
|
399
|
+
order: 98,
|
|
400
|
+
date: new Date('1994-09-05T14:21:37.211Z'),
|
|
401
|
+
},
|
|
402
|
+
{
|
|
403
|
+
order: 99,
|
|
404
|
+
date: new Date('1995-12-15T23:12:14.411Z'),
|
|
405
|
+
},
|
|
66
406
|
];
|
|
@@ -2,17 +2,18 @@ import React, { FC } from 'react';
|
|
|
2
2
|
|
|
3
3
|
import { KolTable } from '@public-ui/react';
|
|
4
4
|
import { KoliBriTableHeaders, KoliBriTablePaginationProps } from '@public-ui/components';
|
|
5
|
-
import { DATA } from './test-data';
|
|
5
|
+
import { Data, DATA } from './test-data';
|
|
6
|
+
import { DATE_FORMATTER } from './formatter';
|
|
6
7
|
|
|
7
8
|
const HEADERS: KoliBriTableHeaders = {
|
|
8
9
|
horizontal: [
|
|
9
10
|
[
|
|
10
11
|
{ label: 'Order', key: 'order' },
|
|
11
|
-
{ label: 'Date', key: 'date' },
|
|
12
|
+
{ label: 'Date', key: 'date', render: (_el, _cell, tupel) => DATE_FORMATTER.format((tupel as unknown as Data).date) },
|
|
12
13
|
],
|
|
13
14
|
],
|
|
14
15
|
};
|
|
15
|
-
const PAGINATION: KoliBriTablePaginationProps = { _page: 2
|
|
16
|
+
const PAGINATION: KoliBriTablePaginationProps = { _page: 2 };
|
|
16
17
|
|
|
17
18
|
export const TableWithPagination: FC = () => (
|
|
18
19
|
<div>
|
|
@@ -20,11 +20,26 @@ const tabs = [
|
|
|
20
20
|
_label: 'Letzter Tab',
|
|
21
21
|
},
|
|
22
22
|
];
|
|
23
|
+
|
|
24
|
+
const tabsWithoutIcons = tabs.map((tab) => ({
|
|
25
|
+
...tab,
|
|
26
|
+
_icons: undefined,
|
|
27
|
+
}));
|
|
28
|
+
|
|
23
29
|
export const TabsBasic: FC = () => (
|
|
24
|
-
|
|
25
|
-
<
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
+
<>
|
|
31
|
+
<KolTabs _tabs={tabsWithoutIcons} _label="Regular tabs">
|
|
32
|
+
<div slot="tab-0">Inhalte von Tab 1</div>
|
|
33
|
+
<div slot="tab-1">Inhalte von Tab 2</div>
|
|
34
|
+
<div slot="tab-2">Inhalte von Tab 3</div>
|
|
35
|
+
<div slot="tab-3">Inhalte von Tab 4</div>
|
|
36
|
+
</KolTabs>
|
|
37
|
+
|
|
38
|
+
<KolTabs _tabs={tabs} className="mt-4" _label="Tabs with icons">
|
|
39
|
+
<div slot="tab-0">Inhalte von Tab 1</div>
|
|
40
|
+
<div slot="tab-1">Inhalte von Tab 2</div>
|
|
41
|
+
<div slot="tab-2">Inhalte von Tab 3</div>
|
|
42
|
+
<div slot="tab-3">Inhalte von Tab 4</div>
|
|
43
|
+
</KolTabs>
|
|
44
|
+
</>
|
|
30
45
|
);
|
|
@@ -14,6 +14,15 @@ export const ToastBasic: FC = () => {
|
|
|
14
14
|
});
|
|
15
15
|
};
|
|
16
16
|
|
|
17
|
+
const handleButtonClickVariantMessage = () => {
|
|
18
|
+
void toaster.enqueue({
|
|
19
|
+
description: 'Toasty',
|
|
20
|
+
label: `Toast with variant 'msg'`,
|
|
21
|
+
type: 'warning',
|
|
22
|
+
alertVariant: 'msg',
|
|
23
|
+
});
|
|
24
|
+
};
|
|
25
|
+
|
|
17
26
|
const handleButtonClickComplex = () => {
|
|
18
27
|
void toaster.enqueue({
|
|
19
28
|
render: (element: HTMLElement, { close }) => {
|
|
@@ -54,7 +63,8 @@ export const ToastBasic: FC = () => {
|
|
|
54
63
|
|
|
55
64
|
return (
|
|
56
65
|
<div>
|
|
57
|
-
<KolButton _label="Show simple toast" _on={{ onClick: handleButtonClickSimple }}></KolButton>
|
|
66
|
+
<KolButton _label="Show simple toast" _on={{ onClick: handleButtonClickSimple }}></KolButton>{' '}
|
|
67
|
+
<KolButton _label="Show toast with alert variant 'msg'" _on={{ onClick: handleButtonClickVariantMessage }}></KolButton>{' '}
|
|
58
68
|
<KolButton _label="Show complex toast" _on={{ onClick: handleButtonClickComplex }}></KolButton>
|
|
59
69
|
<br />
|
|
60
70
|
<br />
|
package/src/react.main.tsx
CHANGED
|
@@ -3,9 +3,9 @@ import { createRoot } from 'react-dom/client';
|
|
|
3
3
|
import { HashRouter as Router } from 'react-router-dom';
|
|
4
4
|
|
|
5
5
|
import { defineCustomElements } from '@public-ui/components/dist/loader';
|
|
6
|
-
import type { Generic } from '
|
|
6
|
+
import type { Generic } from 'adopted-style-sheets';
|
|
7
7
|
import { register } from '@public-ui/components';
|
|
8
|
-
import { BAMF, BMF,
|
|
8
|
+
import { BAMF, BMF, BZStv1, DEFAULT, DESYv1, DESYv2, ECL_EC, ECL_EU, ITZBund, MAPZ, ZOLLv2, ZOLLv3 } from '@public-ui/themes';
|
|
9
9
|
import { TH } from '@public-oss/kolibri-themes';
|
|
10
10
|
import { App } from './App';
|
|
11
11
|
|
|
@@ -23,7 +23,7 @@ void (async () => {
|
|
|
23
23
|
} else {
|
|
24
24
|
/* Regular mode: Register all known themes. */
|
|
25
25
|
try {
|
|
26
|
-
await register([BAMF, BMF, DEFAULT,
|
|
26
|
+
await register([BAMF, BMF, DEFAULT, BZStv1, DESYv1, DESYv2, ECL_EC, ECL_EU, ITZBund, MAPZ, ZOLLv2, ZOLLv3, TH], defineCustomElements, {
|
|
27
27
|
theme: {
|
|
28
28
|
detect: 'auto',
|
|
29
29
|
},
|
|
@@ -35,12 +35,18 @@ void (async () => {
|
|
|
35
35
|
|
|
36
36
|
/**
|
|
37
37
|
* You should patch the theme after the components and your default theme are registered.
|
|
38
|
-
|
|
38
|
+
**
|
|
39
39
|
* ↓ That is a tiny sample!
|
|
40
40
|
*/
|
|
41
|
-
// KoliBriDevHelper.patchTheme(
|
|
42
|
-
// '
|
|
43
|
-
//
|
|
41
|
+
// KoliBriDevHelper.patchTheme(
|
|
42
|
+
// 'default',
|
|
43
|
+
// {
|
|
44
|
+
// 'KOL-BUTTON': 'button{border:2px solid red;}',
|
|
45
|
+
// },
|
|
46
|
+
// {
|
|
47
|
+
// append: true,
|
|
48
|
+
// },
|
|
49
|
+
// );
|
|
44
50
|
|
|
45
51
|
const htmlDivElement = document.querySelector('div#app');
|
|
46
52
|
if (htmlDivElement instanceof HTMLDivElement) {
|
|
@@ -40,48 +40,48 @@ export const TerminComponent: FC = () => (
|
|
|
40
40
|
</div>
|
|
41
41
|
<div className="grid sm:grid-cols-1 gap-2">
|
|
42
42
|
<KolTable
|
|
43
|
-
|
|
43
|
+
_label="Öffnungszeiten"
|
|
44
44
|
_data={
|
|
45
45
|
[
|
|
46
46
|
{
|
|
47
47
|
stadtteil: 'Brackel',
|
|
48
|
-
montag: '08:00 - 12:00
|
|
49
|
-
dienstag: '08:00 - 12:00
|
|
50
|
-
mittwoch: '08:00 - 12:00
|
|
51
|
-
donnerstag: '08:00 - 12:00
|
|
48
|
+
montag: '08:00 - 12:00, 14:00 - 16:00',
|
|
49
|
+
dienstag: '08:00 - 12:00, 14:00 - 15:00',
|
|
50
|
+
mittwoch: '08:00 - 12:00, 14:00 - 15:00',
|
|
51
|
+
donnerstag: '08:00 - 12:00, 14:00 - 18:00',
|
|
52
52
|
freitag: '08:00 - 12:00',
|
|
53
53
|
},
|
|
54
54
|
{
|
|
55
55
|
stadtteil: 'Dorstfeld',
|
|
56
|
-
montag: '09:00 - 12:00
|
|
57
|
-
dienstag: '09:00 - 12:00
|
|
58
|
-
mittwoch: '09:00 - 12:00
|
|
59
|
-
donnerstag: '09:00 - 12:00
|
|
56
|
+
montag: '09:00 - 12:00, 14:00 - 16:00',
|
|
57
|
+
dienstag: '09:00 - 12:00, 14:00 - 15:00',
|
|
58
|
+
mittwoch: '09:00 - 12:00, 14:00 - 15:00',
|
|
59
|
+
donnerstag: '09:00 - 12:00, 14:00 - 18:00',
|
|
60
60
|
freitag: '09:00 - 12:00',
|
|
61
61
|
},
|
|
62
62
|
{
|
|
63
63
|
stadtteil: 'Aplerbeck',
|
|
64
|
-
montag: '08:00 - 12:00
|
|
65
|
-
dienstag: '08:00 - 12:00
|
|
66
|
-
mittwoch: '08:00 - 12:00
|
|
67
|
-
donnerstag: '08:00 - 12:00
|
|
64
|
+
montag: '08:00 - 12:00, 14:00 - 16:00',
|
|
65
|
+
dienstag: '08:00 - 12:00, 14:00 - 15:00',
|
|
66
|
+
mittwoch: '08:00 - 12:00, 14:00 - 15:00',
|
|
67
|
+
donnerstag: '08:00 - 12:00, 14:00 - 18:00',
|
|
68
68
|
freitag: '08:00 - 12:00',
|
|
69
69
|
},
|
|
70
70
|
{
|
|
71
71
|
stadtteil: 'Innenstadt Ost',
|
|
72
|
-
montag: '07:00 - 12:00
|
|
73
|
-
dienstag: '07:00 - 12:00
|
|
74
|
-
mittwoch: '07:00 - 12:00
|
|
75
|
-
donnerstag: '07:00 - 12:00
|
|
76
|
-
freitag: '07:00 - 12:00
|
|
72
|
+
montag: '07:00 - 12:00, 14:00 - 16:00',
|
|
73
|
+
dienstag: '07:00 - 12:00, 14:00 - 15:00',
|
|
74
|
+
mittwoch: '07:00 - 12:00, 14:00 - 15:00',
|
|
75
|
+
donnerstag: '07:00 - 12:00, 14:00 - 18:00',
|
|
76
|
+
freitag: '07:00 - 12:00, 13:00 - 16:00',
|
|
77
77
|
},
|
|
78
78
|
{
|
|
79
79
|
stadtteil: 'Innenstadt West',
|
|
80
|
-
montag: '07:00 - 12:00
|
|
81
|
-
dienstag: '07:00 - 12:00
|
|
82
|
-
mittwoch: '07:00 - 12:00
|
|
83
|
-
donnerstag: '07:00 - 12:00
|
|
84
|
-
freitag: '07:00 - 12:00
|
|
80
|
+
montag: '07:00 - 12:00, 14:00 - 16:00',
|
|
81
|
+
dienstag: '07:00 - 12:00, 14:00 - 15:00',
|
|
82
|
+
mittwoch: '07:00 - 12:00, 14:00 - 15:00',
|
|
83
|
+
donnerstag: '07:00 - 12:00, 14:00 - 18:00',
|
|
84
|
+
freitag: '07:00 - 12:00, 13:00 - 16:00',
|
|
85
85
|
/*render: (el, data) => {
|
|
86
86
|
el.innerHTML = `<kol-badge _color="#ff0000" _label="NIX"></kol-badge>`;
|
|
87
87
|
},*/
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import React, { FC } from 'react';
|
|
2
|
+
import { KolButton } from '@public-ui/react';
|
|
3
|
+
|
|
4
|
+
export const CustomTooltipWidth: FC = () => (
|
|
5
|
+
<KolButton _label="Tooltip mit fixer Breite" _hideLabel style={{ '--kol-tooltip-width': '400px' }} _icons="codicon codicon-reactions"></KolButton>
|
|
6
|
+
);
|