Skip to content

Commit

Permalink
Fix test scenarios
Browse files Browse the repository at this point in the history
  • Loading branch information
sdvg committed Nov 15, 2023
1 parent f3c81d6 commit 6b8848f
Show file tree
Hide file tree
Showing 9 changed files with 57 additions and 45 deletions.
24 changes: 18 additions & 6 deletions packages/samples/react/src/components/handout/basic.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,9 @@ const TABLE_HEADERS: KoliBriTableHeaders = {
{
key: 'dienstag',
label: 'Dienstag',
render: (el, data) => (el.innerHTML = `<kol-badge _color="#060" _label="${data.label}"></kol-badge>`),
render: (el, data) => {
el.innerHTML = `<kol-badge _color="#060" _label="${data.label}"></kol-badge>`;
},
sort: (data) => {
return data.sort((first, second) => {
if (first.dienstag < second.dienstag) {
Expand All @@ -100,27 +102,37 @@ const TABLE_HEADERS: KoliBriTableHeaders = {
{
key: 'mittwoch',
label: 'Mittwoch',
render: (el, data) => (el.innerHTML = `<kol-badge _color="#006" _label="${data.label}"></kol-badge>`),
render: (el, data) => {
el.innerHTML = `<kol-badge _color="#006" _label="${data.label}"></kol-badge>`;
},
},
{
key: 'donnerstag',
label: 'Donnerstag',
render: (el, data) => (el.innerHTML = `<kol-badge _color="#600" _label="${data.label}"></kol-badge>`),
render: (el, data) => {
el.innerHTML = `<kol-badge _color="#600" _label="${data.label}"></kol-badge>`;
},
},
{
key: 'freitag',
label: 'Freitag',
render: (el, data) => (el.innerHTML = `<kol-badge _color="#303" _label="${data.label}"></kol-badge>`),
render: (el, data) => {
el.innerHTML = `<kol-badge _color="#303" _label="${data.label}"></kol-badge>`;
},
},
{
key: 'samstag',
label: 'Samstag',
render: (el, data) => (el.innerHTML = `<kol-badge _color="#330" _label="${data.label}"></kol-badge>`),
render: (el, data) => {
el.innerHTML = `<kol-badge _color="#330" _label="${data.label}"></kol-badge>`;
},
},
{
key: 'sonntag',
label: 'Sonntag',
render: (el, data) => (el.innerHTML = `<kol-badge _color="#033" _label="${data.label}"></kol-badge>`),
render: (el, data) => {
el.innerHTML = `<kol-badge _color="#033" _label="${data.label}"></kol-badge>`;
},
},
],
],
Expand Down
32 changes: 16 additions & 16 deletions packages/samples/react/src/components/table/test-data.ts
Original file line number Diff line number Diff line change
@@ -1,66 +1,66 @@
export type Data = {
order: number;
date: Date;
date: String;
};
export const DATA: Data[] = [
{
order: 0,
date: new Date('1981-05-26T21:33:43.612Z'),
date: new Date('1981-05-26T21:33:43.612Z').toString(),
},
{
order: 1,
date: new Date('1971-04-25T19:44:17.014Z'),
date: new Date('1971-04-25T19:44:17.014Z').toString(),
},
{
order: 2,
date: new Date('1986-07-10T11:39:29.539Z'),
date: new Date('1986-07-10T11:39:29.539Z').toString(),
},
{
order: 3,
date: new Date('1976-02-02T10:00:36.346Z'),
date: new Date('1976-02-02T10:00:36.346Z').toString(),
},
{
order: 4,
date: new Date('1998-07-07T12:50:36.016Z'),
date: new Date('1998-07-07T12:50:36.016Z').toString(),
},
{
order: 5,
date: new Date('1994-09-05T05:10:44.078Z'),
date: new Date('1994-09-05T05:10:44.078Z').toString(),
},
{
order: 6,
date: new Date('1986-05-23T13:05:01.874Z'),
date: new Date('1986-05-23T13:05:01.874Z').toString(),
},
{
order: 7,
date: new Date('1975-06-29T21:51:29.359Z'),
date: new Date('1975-06-29T21:51:29.359Z').toString(),
},
{
order: 8,
date: new Date('1974-05-15T23:47:02.499Z'),
date: new Date('1974-05-15T23:47:02.499Z').toString(),
},
{
order: 9,
date: new Date('1990-05-27T10:13:19.641Z'),
date: new Date('1990-05-27T10:13:19.641Z').toString(),
},
{
order: 10,
date: new Date('1993-10-20T03:54:08.739Z'),
date: new Date('1993-10-20T03:54:08.739Z').toString(),
},
{
order: 11,
date: new Date('2000-02-25T11:55:43.705Z'),
date: new Date('2000-02-25T11:55:43.705Z').toString(),
},
{
order: 12,
date: new Date('1988-08-27T09:59:12.251Z'),
date: new Date('1988-08-27T09:59:12.251Z').toString(),
},
{
order: 13,
date: new Date('1980-10-24T10:41:24.897Z'),
date: new Date('1980-10-24T10:41:24.897Z').toString(),
},
{
order: 14,
date: new Date('1995-01-25T12:31:27.983Z'),
date: new Date('1995-01-25T12:31:27.983Z').toString(),
},
];
46 changes: 23 additions & 23 deletions packages/samples/react/src/scenarios/complex-form/component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,48 +40,48 @@ export const TerminComponent: FC = () => (
</div>
<div className="grid sm:grid-cols-1 gap-2">
<KolTable
_caption="Öffnungszeiten"
_label="Öffnungszeiten"
_data={
[
{
stadtteil: 'Brackel',
montag: '08:00 - 12:00<br/>14:00 - 16:00',
dienstag: '08:00 - 12:00<br/>14:00 - 15:00',
mittwoch: '08:00 - 12:00<br/>14:00 - 15:00',
donnerstag: '08:00 - 12:00<br/>14:00 - 18:00',
montag: '08:00 - 12:00, 14:00 - 16:00',
dienstag: '08:00 - 12:00, 14:00 - 15:00',
mittwoch: '08:00 - 12:00, 14:00 - 15:00',
donnerstag: '08:00 - 12:00, 14:00 - 18:00',
freitag: '08:00 - 12:00',
},
{
stadtteil: 'Dorstfeld',
montag: '09:00 - 12:00<br/>14:00 - 16:00',
dienstag: '09:00 - 12:00<br/>14:00 - 15:00',
mittwoch: '09:00 - 12:00<br/>14:00 - 15:00',
donnerstag: '09:00 - 12:00<br/>14:00 - 18:00',
montag: '09:00 - 12:00, 14:00 - 16:00',
dienstag: '09:00 - 12:00, 14:00 - 15:00',
mittwoch: '09:00 - 12:00, 14:00 - 15:00',
donnerstag: '09:00 - 12:00, 14:00 - 18:00',
freitag: '09:00 - 12:00',
},
{
stadtteil: 'Aplerbeck',
montag: '08:00 - 12:00<br/>14:00 - 16:00',
dienstag: '08:00 - 12:00<br/>14:00 - 15:00',
mittwoch: '08:00 - 12:00<br/>14:00 - 15:00',
donnerstag: '08:00 - 12:00<br/>14:00 - 18:00',
montag: '08:00 - 12:00, 14:00 - 16:00',
dienstag: '08:00 - 12:00, 14:00 - 15:00',
mittwoch: '08:00 - 12:00, 14:00 - 15:00',
donnerstag: '08:00 - 12:00, 14:00 - 18:00',
freitag: '08:00 - 12:00',
},
{
stadtteil: 'Innenstadt Ost',
montag: '07:00 - 12:00<br/>14:00 - 16:00',
dienstag: '07:00 - 12:00<br/>14:00 - 15:00',
mittwoch: '07:00 - 12:00<br/>14:00 - 15:00',
donnerstag: '07:00 - 12:00<br/>14:00 - 18:00',
freitag: '07:00 - 12:00<br/>13:00 - 16:00',
montag: '07:00 - 12:00, 14:00 - 16:00',
dienstag: '07:00 - 12:00, 14:00 - 15:00',
mittwoch: '07:00 - 12:00, 14:00 - 15:00',
donnerstag: '07:00 - 12:00, 14:00 - 18:00',
freitag: '07:00 - 12:00, 13:00 - 16:00',
},
{
stadtteil: 'Innenstadt West',
montag: '07:00 - 12:00<br/>14:00 - 16:00',
dienstag: '07:00 - 12:00<br/>14:00 - 15:00',
mittwoch: '07:00 - 12:00<br/>14:00 - 15:00',
donnerstag: '07:00 - 12:00<br/>14:00 - 18:00',
freitag: '07:00 - 12:00<br/>13:00 - 16:00',
montag: '07:00 - 12:00, 14:00 - 16:00',
dienstag: '07:00 - 12:00, 14:00 - 15:00',
mittwoch: '07:00 - 12:00, 14:00 - 15:00',
donnerstag: '07:00 - 12:00, 14:00 - 18:00',
freitag: '07:00 - 12:00, 13:00 - 16:00',
/*render: (el, data) => {
el.innerHTML = `<kol-badge _color="#ff0000" _label="NIX"></kol-badge>`;
},*/
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 6b8848f

Please sign in to comment.