@public-ui/sample-react 2.0.0-rc.9 → 2.0.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.
- package/README.md +18 -0
- package/dist/1130.js +2 -0
- package/dist/1474.js +1 -1
- 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/{9091.js → 4916.js} +2 -2
- package/dist/{2597.js → 5139.js} +2 -2
- package/dist/5183.js +1 -1
- package/dist/5369.js +1 -1
- 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/5869.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/8316.js +2 -0
- 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/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 +525 -3278
- package/dist/main.js.LICENSE.txt +2 -2
- package/package.json +13 -13
- 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/button.tsx +5 -5
- 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/image/basic.tsx +1 -1
- package/src/components/input-checkbox/partials/cases.tsx +2 -0
- package/src/components/input-radio/partials/cases.tsx +0 -1
- package/src/components/link/basic.tsx +1 -3
- package/src/components/link/image.tsx +2 -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 +2 -2
- 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/{2597.js.LICENSE.txt → 1130.js.LICENSE.txt} +0 -0
- /package/dist/{3961.js.LICENSE.txt → 2738.js.LICENSE.txt} +0 -0
- /package/dist/{4446.js.LICENSE.txt → 4916.js.LICENSE.txt} +0 -0
- /package/dist/{5327.js.LICENSE.txt → 5139.js.LICENSE.txt} +0 -0
- /package/dist/{7052.js.LICENSE.txt → 5860.js.LICENSE.txt} +0 -0
- /package/dist/{8026.js.LICENSE.txt → 5869.js.LICENSE.txt} +0 -0
- /package/dist/{9091.js.LICENSE.txt → 7380.js.LICENSE.txt} +0 -0
- /package/dist/{9598.js.LICENSE.txt → 8316.js.LICENSE.txt} +0 -0
|
@@ -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
|
@@ -5,7 +5,7 @@ import { HashRouter as Router } from 'react-router-dom';
|
|
|
5
5
|
import { defineCustomElements } from '@public-ui/components/dist/loader';
|
|
6
6
|
import type { Generic } from '@a11y-ui/core';
|
|
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
|
},
|
|
@@ -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
|
+
);
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
import React, { createContext, FC, useContext, useEffect, useMemo, useRef, useState } from 'react';
|
|
2
|
+
import { HTMLStencilElement } from '@stencil/core/internal';
|
|
3
|
+
import {
|
|
4
|
+
KolButton,
|
|
5
|
+
KolInputCheckbox,
|
|
6
|
+
KolInputColor,
|
|
7
|
+
KolInputDate,
|
|
8
|
+
KolInputEmail,
|
|
9
|
+
KolInputFile,
|
|
10
|
+
KolInputNumber,
|
|
11
|
+
KolInputPassword,
|
|
12
|
+
KolInputRadio,
|
|
13
|
+
KolInputRange,
|
|
14
|
+
KolInputText,
|
|
15
|
+
KolSelect,
|
|
16
|
+
KolTextarea,
|
|
17
|
+
KolButtonLink,
|
|
18
|
+
} from '@public-ui/react';
|
|
19
|
+
import { SampleDescription } from '../components/SampleDescription';
|
|
20
|
+
|
|
21
|
+
const EventTargetContext = createContext<EventTarget | undefined>(undefined);
|
|
22
|
+
|
|
23
|
+
type Props = {
|
|
24
|
+
InputComponent: React.ComponentType<any>;
|
|
25
|
+
inputProps: { [key: string]: any };
|
|
26
|
+
formatter?: (value: any) => string;
|
|
27
|
+
};
|
|
28
|
+
const Scenario = (props: Props) => {
|
|
29
|
+
const ref = useRef<HTMLStencilElement & { getValue: () => Promise<any> }>();
|
|
30
|
+
const [value, setValue] = useState<unknown>(undefined);
|
|
31
|
+
const formatter = props.formatter || JSON.stringify;
|
|
32
|
+
const eventTarget = useContext(EventTargetContext);
|
|
33
|
+
|
|
34
|
+
const handleButtonClick = async () => {
|
|
35
|
+
setValue(await ref.current?.getValue());
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
useEffect(() => {
|
|
39
|
+
const handleRunAll = () => {
|
|
40
|
+
void handleButtonClick();
|
|
41
|
+
};
|
|
42
|
+
eventTarget?.addEventListener('runAll', handleRunAll);
|
|
43
|
+
|
|
44
|
+
return () => {
|
|
45
|
+
eventTarget?.removeEventListener('runAll', handleRunAll);
|
|
46
|
+
};
|
|
47
|
+
}, [eventTarget]);
|
|
48
|
+
|
|
49
|
+
return (
|
|
50
|
+
<div className="grid grid-cols-3 items-end gap-4">
|
|
51
|
+
<props.InputComponent ref={ref} {...props.inputProps} />
|
|
52
|
+
<KolButton
|
|
53
|
+
_label="getValue()"
|
|
54
|
+
_on={{
|
|
55
|
+
onClick: () => {
|
|
56
|
+
void handleButtonClick();
|
|
57
|
+
},
|
|
58
|
+
}}
|
|
59
|
+
></KolButton>
|
|
60
|
+
<pre>{formatter(value)}</pre>
|
|
61
|
+
</div>
|
|
62
|
+
);
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
export const InputsGetValue: FC = () => {
|
|
66
|
+
const eventTarget = useMemo(() => new EventTarget(), []);
|
|
67
|
+
|
|
68
|
+
return (
|
|
69
|
+
<>
|
|
70
|
+
<EventTargetContext.Provider value={eventTarget}>
|
|
71
|
+
<SampleDescription>
|
|
72
|
+
<p>
|
|
73
|
+
This sample show how the input components <code>getValue()</code> method works. It's called when clicking the &quout;getValue()&quout; button
|
|
74
|
+
and prints the current value right next to itself.
|
|
75
|
+
</p>
|
|
76
|
+
</SampleDescription>
|
|
77
|
+
|
|
78
|
+
<div className="grid gap-4">
|
|
79
|
+
<Scenario InputComponent={KolInputText} inputProps={{ _label: 'InputText' }} />
|
|
80
|
+
<Scenario InputComponent={KolInputCheckbox} inputProps={{ _label: 'KolInputCheckbox' }} />
|
|
81
|
+
<Scenario InputComponent={KolInputColor} inputProps={{ _label: 'KolInputColor' }} />
|
|
82
|
+
<Scenario InputComponent={KolInputDate} inputProps={{ _label: 'KolInputDate' }} />
|
|
83
|
+
<Scenario InputComponent={KolInputEmail} inputProps={{ _label: 'KolInputEmail' }} />
|
|
84
|
+
<Scenario
|
|
85
|
+
InputComponent={KolInputFile}
|
|
86
|
+
inputProps={{ _label: 'KolInputFile' }}
|
|
87
|
+
formatter={(value) =>
|
|
88
|
+
value instanceof FileList
|
|
89
|
+
? `FileList{${Array.from(value)
|
|
90
|
+
.map((file: File) => file.name)
|
|
91
|
+
.join(', ')}}`
|
|
92
|
+
: JSON.stringify(value)
|
|
93
|
+
}
|
|
94
|
+
/>
|
|
95
|
+
<Scenario InputComponent={KolInputNumber} inputProps={{ _label: 'KolInputNumber' }} />
|
|
96
|
+
<Scenario InputComponent={KolInputPassword} inputProps={{ _label: 'KolInputPassword' }} />
|
|
97
|
+
<Scenario InputComponent={KolInputRange} inputProps={{ _label: 'KolInputRange' }} />
|
|
98
|
+
<Scenario
|
|
99
|
+
InputComponent={KolInputRadio}
|
|
100
|
+
inputProps={{
|
|
101
|
+
_label: 'KolInputRadio',
|
|
102
|
+
_orientation: 'horizontal',
|
|
103
|
+
_options: [
|
|
104
|
+
{ label: 'New York', value: 'New York' },
|
|
105
|
+
{ label: 'Rio de Janeiro', value: 'Rio de Janeiro' },
|
|
106
|
+
{ label: 'Rosenheim', value: 'Rosenheim' },
|
|
107
|
+
],
|
|
108
|
+
_value: 'New York',
|
|
109
|
+
}}
|
|
110
|
+
/>
|
|
111
|
+
<Scenario
|
|
112
|
+
InputComponent={KolSelect}
|
|
113
|
+
inputProps={{
|
|
114
|
+
_label: 'KolSelect',
|
|
115
|
+
_options: [
|
|
116
|
+
{ label: 'New York', value: 'New York' },
|
|
117
|
+
{ label: 'Rio de Janeiro', value: 'Rio de Janeiro' },
|
|
118
|
+
{ label: 'Rosenheim', value: 'Rosenheim' },
|
|
119
|
+
],
|
|
120
|
+
}}
|
|
121
|
+
/>
|
|
122
|
+
<Scenario
|
|
123
|
+
InputComponent={KolTextarea}
|
|
124
|
+
inputProps={{
|
|
125
|
+
_label: 'KolTextarea',
|
|
126
|
+
}}
|
|
127
|
+
/>
|
|
128
|
+
<Scenario
|
|
129
|
+
InputComponent={KolButton}
|
|
130
|
+
inputProps={{
|
|
131
|
+
_label: 'KolButton',
|
|
132
|
+
_variant: 'ghost',
|
|
133
|
+
_value: 'KolButton value',
|
|
134
|
+
}}
|
|
135
|
+
/>
|
|
136
|
+
<Scenario
|
|
137
|
+
InputComponent={KolButtonLink}
|
|
138
|
+
inputProps={{
|
|
139
|
+
_label: 'KolButtonLink',
|
|
140
|
+
_value: 'KolButtonLink value',
|
|
141
|
+
}}
|
|
142
|
+
/>
|
|
143
|
+
|
|
144
|
+
<div className="grid grid-cols-3 gap-4">
|
|
145
|
+
<div></div>
|
|
146
|
+
<KolButton
|
|
147
|
+
_label="Run all"
|
|
148
|
+
_variant="primary"
|
|
149
|
+
_on={{
|
|
150
|
+
onClick: () => {
|
|
151
|
+
eventTarget.dispatchEvent(new Event('runAll'));
|
|
152
|
+
},
|
|
153
|
+
}}
|
|
154
|
+
></KolButton>
|
|
155
|
+
</div>
|
|
156
|
+
</div>
|
|
157
|
+
</EventTargetContext.Provider>
|
|
158
|
+
</>
|
|
159
|
+
);
|
|
160
|
+
};
|