@public-ui/sample-react 4.5.0 → 5.0.0-beta.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/package.json +9 -9
- package/src/components/breadcrumb/json-links.tsx +28 -0
- package/src/components/breadcrumb/routes.ts +2 -0
- package/src/components/button/routes.ts +2 -0
- package/src/components/button/tooltip-align.tsx +30 -0
- package/src/components/card/closer-callback.tsx +43 -0
- package/src/components/card/routes.ts +2 -0
- package/src/components/input-radio/option-values.tsx +46 -0
- package/src/components/input-radio/routes.ts +2 -0
- package/src/components/meter/clamped.tsx +27 -0
- package/src/components/meter/routes.ts +2 -0
- package/src/components/popover-button/align.tsx +31 -0
- package/src/components/popover-button/routes.ts +2 -0
- package/src/components/single-select/option-values.tsx +46 -0
- package/src/components/single-select/routes.ts +2 -0
- package/src/components/table/multi-sort.tsx +3 -0
- package/src/components/table/stateful-reset-sort.tsx +10 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@public-ui/sample-react",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "5.0.0-beta.0",
|
|
4
4
|
"description": "This app contains samples for the KoliBri/Public UI",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "EUPL-1.2",
|
|
@@ -9,8 +9,8 @@
|
|
|
9
9
|
"url": "https://github.com/public-ui/kolibri"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"@hookform/resolvers": "5.9.
|
|
13
|
-
"@stencil/core": "4.
|
|
12
|
+
"@hookform/resolvers": "5.9.2",
|
|
13
|
+
"@stencil/core": "4.45.2",
|
|
14
14
|
"@types/node": "26.4.0",
|
|
15
15
|
"@types/papaparse": "5.5.2",
|
|
16
16
|
"papaparse": "5.7.0",
|
|
@@ -19,17 +19,17 @@
|
|
|
19
19
|
"tslib": "2.8.1",
|
|
20
20
|
"typescript": "5.9.3",
|
|
21
21
|
"world_countries_lists": "3.3.0",
|
|
22
|
-
"zod": "4.6.
|
|
23
|
-
"@public-ui/react-hook-form-adapter": "
|
|
24
|
-
"@public-ui/react-v19": "
|
|
22
|
+
"zod": "4.6.7",
|
|
23
|
+
"@public-ui/react-hook-form-adapter": "5.0.0-beta.0",
|
|
24
|
+
"@public-ui/react-v19": "5.0.0-beta.0"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
27
|
"@types/react": "19.2.18",
|
|
28
28
|
"@types/react-dom": "19.2.5",
|
|
29
29
|
"adopted-style-sheets": "1.1.9-rc.25",
|
|
30
30
|
"eslint": "9.39.5",
|
|
31
|
-
"knip": "6.
|
|
32
|
-
"prettier": "3.9.
|
|
31
|
+
"knip": "6.42.1",
|
|
32
|
+
"prettier": "3.9.10",
|
|
33
33
|
"prettier-plugin-organize-imports": "4.3.0",
|
|
34
34
|
"stylelint": "17.16.0"
|
|
35
35
|
},
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"react": "19.2.8",
|
|
38
38
|
"react-dom": "19.2.8",
|
|
39
39
|
"react-router": "8.4.0",
|
|
40
|
-
"@public-ui/components": "
|
|
40
|
+
"@public-ui/components": "5.0.0-beta.0"
|
|
41
41
|
},
|
|
42
42
|
"files": [
|
|
43
43
|
"assets",
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
import { KolBreadcrumb } from '@public-ui/react-v19';
|
|
4
|
+
import { SampleBlock } from '../SampleBlock';
|
|
5
|
+
import { SampleDescription } from '../SampleDescription';
|
|
6
|
+
|
|
7
|
+
import type { FC } from 'react';
|
|
8
|
+
|
|
9
|
+
const LINKS_AS_JSON = JSON.stringify([
|
|
10
|
+
{ _label: 'Homepage', _icons: 'kolicon-house', _hideLabel: true, _href: '#/back-page' },
|
|
11
|
+
{ _label: 'Services', _href: '#/back-page' },
|
|
12
|
+
{ _label: 'Apply for a permit', _href: '#/back-page' },
|
|
13
|
+
]);
|
|
14
|
+
|
|
15
|
+
export const BreadcrumbJsonLinks: FC = () => (
|
|
16
|
+
<>
|
|
17
|
+
<SampleDescription>
|
|
18
|
+
<p>
|
|
19
|
+
The <code>_links</code> of KolBreadcrumb can also be passed as JSON string, e.g. through an HTML attribute; the result is the same as with an array.
|
|
20
|
+
Every entry needs an <code>_href</code>, and an entry with <code>_hideLabel</code> shows only its icon.
|
|
21
|
+
</p>
|
|
22
|
+
</SampleDescription>
|
|
23
|
+
|
|
24
|
+
<SampleBlock id="json-links" narrow>
|
|
25
|
+
<KolBreadcrumb _label="Breadcrumb from a JSON string" _links={LINKS_AS_JSON}></KolBreadcrumb>
|
|
26
|
+
</SampleBlock>
|
|
27
|
+
</>
|
|
28
|
+
);
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import type { Routes } from '../../shares/types';
|
|
2
2
|
import { BreadcrumbBasic } from './basic';
|
|
3
|
+
import { BreadcrumbJsonLinks } from './json-links';
|
|
3
4
|
|
|
4
5
|
export const BREADCRUMB_ROUTES: Routes = {
|
|
5
6
|
breadcrumb: {
|
|
6
7
|
basic: BreadcrumbBasic,
|
|
8
|
+
'json-links': BreadcrumbJsonLinks,
|
|
7
9
|
},
|
|
8
10
|
};
|
|
@@ -13,6 +13,7 @@ import { ButtonPinToggle } from './pin-toggle';
|
|
|
13
13
|
import { ButtonRowReverseTooltip } from './row-reverse-tooltip';
|
|
14
14
|
import { ButtonShortKey } from './short-key';
|
|
15
15
|
import { ButtonSpinner } from './spinner';
|
|
16
|
+
import { ButtonTooltipAlign } from './tooltip-align';
|
|
16
17
|
import { ButtonWidth } from './width';
|
|
17
18
|
|
|
18
19
|
export const BUTTON_ROUTES: Routes = {
|
|
@@ -30,6 +31,7 @@ export const BUTTON_ROUTES: Routes = {
|
|
|
30
31
|
'short-key': ButtonShortKey,
|
|
31
32
|
'expert-slot': ButtonExpertSlot,
|
|
32
33
|
'row-reverse-tooltip': ButtonRowReverseTooltip,
|
|
34
|
+
'tooltip-align': ButtonTooltipAlign,
|
|
33
35
|
'focus-options': ButtonFocusOptions,
|
|
34
36
|
'fixed-grid': ButtonInFixedGrid,
|
|
35
37
|
},
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
import { KolButton, KolLink } from '@public-ui/react-v19';
|
|
4
|
+
import { SampleBlock } from '../SampleBlock';
|
|
5
|
+
import { SampleDescription } from '../SampleDescription';
|
|
6
|
+
|
|
7
|
+
import type { AlignPropType } from '@public-ui/components';
|
|
8
|
+
import type { FC } from 'react';
|
|
9
|
+
|
|
10
|
+
const ALIGNMENTS: AlignPropType[] = ['top', 'right', 'bottom', 'left'];
|
|
11
|
+
|
|
12
|
+
export const ButtonTooltipAlign: FC = () => (
|
|
13
|
+
<>
|
|
14
|
+
<SampleDescription>
|
|
15
|
+
<p>
|
|
16
|
+
With a hidden label, the label is shown as tooltip on hover and focus. <code>_tooltipAlign</code> places it on one of the four sides. A button places it
|
|
17
|
+
on top by default, a link on the right.
|
|
18
|
+
</p>
|
|
19
|
+
<p>Hover or focus the elements to see the tooltips.</p>
|
|
20
|
+
</SampleDescription>
|
|
21
|
+
|
|
22
|
+
<SampleBlock id="tooltip-align" className="grid grid-cols-2 gap-16 p-16 justify-items-center" skipSnapshot>
|
|
23
|
+
{ALIGNMENTS.map((align) => (
|
|
24
|
+
<KolButton key={align} _label={`Tooltip ${align}`} _icons="kolicon-alert-info" _hideLabel _tooltipAlign={align} />
|
|
25
|
+
))}
|
|
26
|
+
<KolButton _label="Button with default (top)" _icons="kolicon-check" _hideLabel />
|
|
27
|
+
<KolLink _label="Link with default (right)" _icons="kolicon-link" _hideLabel _href="#/back-page" />
|
|
28
|
+
</SampleBlock>
|
|
29
|
+
</>
|
|
30
|
+
);
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import React, { useState } from 'react';
|
|
2
|
+
|
|
3
|
+
import { KolButton, KolCard } from '@public-ui/react-v19';
|
|
4
|
+
|
|
5
|
+
import type { FC } from 'react';
|
|
6
|
+
import { SampleBlock } from '../SampleBlock';
|
|
7
|
+
import { SampleDescription } from '../SampleDescription';
|
|
8
|
+
|
|
9
|
+
export const CardCloserCallback: FC = () => {
|
|
10
|
+
const [open, setOpen] = useState(true);
|
|
11
|
+
const [closeCount, setCloseCount] = useState(0);
|
|
12
|
+
|
|
13
|
+
return (
|
|
14
|
+
<>
|
|
15
|
+
<SampleDescription>
|
|
16
|
+
<p>
|
|
17
|
+
The close button of KolCard calls <code>_on.onClose</code>. The card does not hide itself; the application decides what happens. Here the callback
|
|
18
|
+
removes the card, and the button below brings it back.
|
|
19
|
+
</p>
|
|
20
|
+
</SampleDescription>
|
|
21
|
+
|
|
22
|
+
<SampleBlock id="closer-callback" className="grid gap-4" skipSnapshot>
|
|
23
|
+
{open ? (
|
|
24
|
+
<KolCard
|
|
25
|
+
_label="Card that closes itself"
|
|
26
|
+
_hasCloser
|
|
27
|
+
_on={{
|
|
28
|
+
onClose: () => {
|
|
29
|
+
setOpen(false);
|
|
30
|
+
setCloseCount((count) => count + 1);
|
|
31
|
+
},
|
|
32
|
+
}}
|
|
33
|
+
>
|
|
34
|
+
<p>Click the close button to remove the card.</p>
|
|
35
|
+
</KolCard>
|
|
36
|
+
) : (
|
|
37
|
+
<KolButton _label="Show the card again" _on={{ onClick: () => setOpen(true) }} />
|
|
38
|
+
)}
|
|
39
|
+
<p aria-live="polite">Closed {closeCount} time(s).</p>
|
|
40
|
+
</SampleBlock>
|
|
41
|
+
</>
|
|
42
|
+
);
|
|
43
|
+
};
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import type { Routes } from '../../shares/types';
|
|
2
2
|
import { CardBasic } from './basic';
|
|
3
|
+
import { CardCloserCallback } from './closer-callback';
|
|
3
4
|
import { CardHeadlines } from './headlines';
|
|
4
5
|
import { CardLinked } from './linked';
|
|
5
6
|
|
|
6
7
|
export const CARD_ROUTES: Routes = {
|
|
7
8
|
card: {
|
|
8
9
|
basic: CardBasic,
|
|
10
|
+
'closer-callback': CardCloserCallback,
|
|
9
11
|
headlines: CardHeadlines,
|
|
10
12
|
linked: CardLinked,
|
|
11
13
|
},
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import type { FC } from 'react';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
|
|
4
|
+
import { KolInputRadio } from '@public-ui/react-v19';
|
|
5
|
+
|
|
6
|
+
import type { RadioOption, StencilUnknown } from '@public-ui/components';
|
|
7
|
+
import { SampleBlock } from '../SampleBlock';
|
|
8
|
+
import { SampleDescription } from '../SampleDescription';
|
|
9
|
+
|
|
10
|
+
/** Number labels are accepted and shown as text. */
|
|
11
|
+
const NUMBER_LABEL_OPTIONS = [
|
|
12
|
+
{ label: 1, value: 1, hint: 'One person' },
|
|
13
|
+
{ label: 2, value: 2, hint: 'Two persons' },
|
|
14
|
+
{ label: 3, value: 3, hint: 'Three persons' },
|
|
15
|
+
] as unknown as RadioOption<StencilUnknown>[];
|
|
16
|
+
|
|
17
|
+
/** Without a `value`, an option uses its label as value; the JSON string form allows to leave it out. */
|
|
18
|
+
const LABEL_AS_VALUE_OPTIONS = JSON.stringify([{ label: 'Mrs.' }, { label: 'Mr.' }, { label: 'Company', value: 'company' }]);
|
|
19
|
+
|
|
20
|
+
const FALSY_VALUE_OPTIONS: RadioOption<StencilUnknown>[] = [
|
|
21
|
+
{ label: 'No', value: false },
|
|
22
|
+
{ label: 'Yes', value: true },
|
|
23
|
+
];
|
|
24
|
+
|
|
25
|
+
export const InputRadioOptionValues: FC = () => (
|
|
26
|
+
<>
|
|
27
|
+
<SampleDescription>
|
|
28
|
+
<p>
|
|
29
|
+
The options of KolInputRadio accept a number as <code>label</code>, which is shown as text, and an optional <code>hint</code> per option. An option
|
|
30
|
+
without <code>value</code> uses its label as value, and a falsy value such as <code>false</code> is selected like any other value.
|
|
31
|
+
</p>
|
|
32
|
+
</SampleDescription>
|
|
33
|
+
|
|
34
|
+
<div className="grid gap-4">
|
|
35
|
+
<SampleBlock id="number-labels">
|
|
36
|
+
<KolInputRadio _label="Number of persons (number labels with hints)" _options={NUMBER_LABEL_OPTIONS} _value={2} />
|
|
37
|
+
</SampleBlock>
|
|
38
|
+
<SampleBlock id="label-as-value">
|
|
39
|
+
<KolInputRadio _label="Salutation (options without value)" _options={LABEL_AS_VALUE_OPTIONS} _value="Mr." _orientation="horizontal" />
|
|
40
|
+
</SampleBlock>
|
|
41
|
+
<SampleBlock id="falsy-value">
|
|
42
|
+
<KolInputRadio _label="Newsletter (value false selected)" _options={FALSY_VALUE_OPTIONS} _value={false} _orientation="horizontal" />
|
|
43
|
+
</SampleBlock>
|
|
44
|
+
</div>
|
|
45
|
+
</>
|
|
46
|
+
);
|
|
@@ -3,6 +3,7 @@ import { InputRadioBasic } from './basic';
|
|
|
3
3
|
import { InputRadioOnInputOnChange } from './get-value';
|
|
4
4
|
import { InputRadioHorizontal } from './horizontal';
|
|
5
5
|
import { InputRadioObjectValue } from './objectValue';
|
|
6
|
+
import { InputRadioOptionValues } from './option-values';
|
|
6
7
|
|
|
7
8
|
export const INPUT_RADIO_ROUTES: Routes = {
|
|
8
9
|
'input-radio': {
|
|
@@ -10,5 +11,6 @@ export const INPUT_RADIO_ROUTES: Routes = {
|
|
|
10
11
|
'get-value': InputRadioOnInputOnChange,
|
|
11
12
|
horizontal: InputRadioHorizontal,
|
|
12
13
|
object: InputRadioObjectValue,
|
|
14
|
+
'option-values': InputRadioOptionValues,
|
|
13
15
|
},
|
|
14
16
|
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { KolMeter } from '@public-ui/react-v19';
|
|
2
|
+
import type { FC } from 'react';
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import { SampleBlock } from '../SampleBlock';
|
|
5
|
+
import { SampleDescription } from '../SampleDescription';
|
|
6
|
+
|
|
7
|
+
export const MeterClamped: FC = () => (
|
|
8
|
+
<>
|
|
9
|
+
<SampleDescription>
|
|
10
|
+
<p>
|
|
11
|
+
A <code>_value</code> outside the range of <code>_min</code> and <code>_max</code> is clamped into it: a value above <code>_max</code> renders as{' '}
|
|
12
|
+
<code>_max</code>, a value below <code>_min</code> as <code>_min</code>.
|
|
13
|
+
</p>
|
|
14
|
+
</SampleDescription>
|
|
15
|
+
|
|
16
|
+
<div className="grid gap-8">
|
|
17
|
+
<SampleBlock id="clamped" heading="Values outside the range">
|
|
18
|
+
<div className="flex flex-col gap-4">
|
|
19
|
+
<KolMeter _label="Value 140, maximum 100 (shows 100)" _max={100} _value={140} _unit="%" />
|
|
20
|
+
<KolMeter _label="Value 60, range 0 to 100 (unchanged)" _max={100} _value={60} _unit="%" />
|
|
21
|
+
<KolMeter _label="Value -20, minimum 0 (shows 0)" _min={0} _max={100} _value={-20} _unit="%" />
|
|
22
|
+
<KolMeter _label="Value -40 °C, range -20 to 60 °C (shows -20 °C)" _min={-20} _max={60} _value={-40} _unit="°C" />
|
|
23
|
+
</div>
|
|
24
|
+
</SampleBlock>
|
|
25
|
+
</div>
|
|
26
|
+
</>
|
|
27
|
+
);
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { Routes } from '../../shares/types';
|
|
2
2
|
import { MeterBasic } from './basic';
|
|
3
|
+
import { MeterClamped } from './clamped';
|
|
3
4
|
import { MeterDynamic } from './dynamic';
|
|
4
5
|
import { MeterOptimum } from './optimum';
|
|
5
6
|
import { MeterOrientation } from './orientation';
|
|
@@ -7,6 +8,7 @@ import { MeterOrientation } from './orientation';
|
|
|
7
8
|
export const METER_ROUTES: Routes = {
|
|
8
9
|
meter: {
|
|
9
10
|
basic: MeterBasic,
|
|
11
|
+
clamped: MeterClamped,
|
|
10
12
|
dynamic: MeterDynamic,
|
|
11
13
|
optimum: MeterOptimum,
|
|
12
14
|
orientation: MeterOrientation,
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { KolPopoverButton } from '@public-ui/react-v19';
|
|
2
|
+
import type { FC } from 'react';
|
|
3
|
+
import React from 'react';
|
|
4
|
+
|
|
5
|
+
import type { AlignPropType } from '@public-ui/components';
|
|
6
|
+
import { SampleBlock } from '../SampleBlock';
|
|
7
|
+
import { SampleDescription } from '../SampleDescription';
|
|
8
|
+
|
|
9
|
+
const ALIGNMENTS: AlignPropType[] = ['top', 'right', 'bottom', 'left'];
|
|
10
|
+
|
|
11
|
+
export const PopoverButtonAlign: FC = () => (
|
|
12
|
+
<>
|
|
13
|
+
<SampleDescription>
|
|
14
|
+
<p>
|
|
15
|
+
<code>_popoverAlign</code> places the popover on one of the four sides of the button; the default is <code>bottom</code>. If there is not enough space,
|
|
16
|
+
the popover moves to the opposite side.
|
|
17
|
+
</p>
|
|
18
|
+
<p>Open the buttons one after the other to compare the positions.</p>
|
|
19
|
+
</SampleDescription>
|
|
20
|
+
|
|
21
|
+
<SampleBlock id="popover-align" className="grid grid-cols-2 gap-32 p-32 justify-items-center" skipSnapshot>
|
|
22
|
+
{ALIGNMENTS.map((align) => (
|
|
23
|
+
<KolPopoverButton key={align} _label={`Popover ${align}`} _popoverAlign={align}>
|
|
24
|
+
<p className="m-0 p-2 bg-white">
|
|
25
|
+
Popover placed <strong>{align}</strong>.
|
|
26
|
+
</p>
|
|
27
|
+
</KolPopoverButton>
|
|
28
|
+
))}
|
|
29
|
+
</SampleBlock>
|
|
30
|
+
</>
|
|
31
|
+
);
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import type { Routes } from '../../shares/types';
|
|
2
|
+
import { PopoverButtonAlign } from './align';
|
|
2
3
|
import { PopoverButtonBasic } from './basic';
|
|
3
4
|
import { PopoverButtonInline } from './inline';
|
|
4
5
|
|
|
5
6
|
export const POPOVER_BUTTON_ROUTES: Routes = {
|
|
6
7
|
'popover-button': {
|
|
8
|
+
align: PopoverButtonAlign,
|
|
7
9
|
basic: PopoverButtonBasic,
|
|
8
10
|
inline: PopoverButtonInline,
|
|
9
11
|
},
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import type { FC } from 'react';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
|
|
4
|
+
import { KolSingleSelect } from '@public-ui/react-v19';
|
|
5
|
+
|
|
6
|
+
import type { Option, StencilUnknown } from '@public-ui/components';
|
|
7
|
+
import { SampleBlock } from '../SampleBlock';
|
|
8
|
+
import { SampleDescription } from '../SampleDescription';
|
|
9
|
+
|
|
10
|
+
const FALSY_VALUE_OPTIONS: Option<StencilUnknown>[] = [
|
|
11
|
+
{ label: 'Zero', value: 0 },
|
|
12
|
+
{ label: 'No', value: false },
|
|
13
|
+
{ label: 'Empty string', value: '' },
|
|
14
|
+
{ label: 'One', value: 1 },
|
|
15
|
+
{ label: 'Two (disabled)', value: 2, disabled: true },
|
|
16
|
+
];
|
|
17
|
+
|
|
18
|
+
/** Number labels are accepted and shown as text. */
|
|
19
|
+
const NUMBER_LABEL_OPTIONS = [
|
|
20
|
+
{ label: 2024, value: 2024 },
|
|
21
|
+
{ label: 2025, value: 2025 },
|
|
22
|
+
{ label: 2026, value: 2026 },
|
|
23
|
+
] as unknown as Option<StencilUnknown>[];
|
|
24
|
+
|
|
25
|
+
export const SingleSelectOptionValues: FC = () => (
|
|
26
|
+
<>
|
|
27
|
+
<SampleDescription>
|
|
28
|
+
<p>
|
|
29
|
+
The options of KolSingleSelect accept any value, also falsy ones such as <code>0</code>, <code>false</code> or an empty string; the selected option is
|
|
30
|
+
found by its value. A number as <code>label</code> is shown as text. Disabled options stay visible in the list but can not be selected.
|
|
31
|
+
</p>
|
|
32
|
+
</SampleDescription>
|
|
33
|
+
|
|
34
|
+
<div className="grid gap-4">
|
|
35
|
+
<SampleBlock id="falsy-zero">
|
|
36
|
+
<KolSingleSelect _label="Value 0 selected" _options={FALSY_VALUE_OPTIONS} _value={0} />
|
|
37
|
+
</SampleBlock>
|
|
38
|
+
<SampleBlock id="falsy-false">
|
|
39
|
+
<KolSingleSelect _label="Value false selected" _options={FALSY_VALUE_OPTIONS} _value={false} />
|
|
40
|
+
</SampleBlock>
|
|
41
|
+
<SampleBlock id="number-labels">
|
|
42
|
+
<KolSingleSelect _label="Number labels (year)" _options={NUMBER_LABEL_OPTIONS} _value={2025} />
|
|
43
|
+
</SampleBlock>
|
|
44
|
+
</div>
|
|
45
|
+
</>
|
|
46
|
+
);
|
|
@@ -2,11 +2,13 @@ import type { Routes } from '../../shares/types';
|
|
|
2
2
|
import { SingleSelectBasic } from './basic';
|
|
3
3
|
import { SingleSelectOnInputOnChange } from './get-value';
|
|
4
4
|
import { SingleSelectLazyLoaded } from './lazy-loaded';
|
|
5
|
+
import { SingleSelectOptionValues } from './option-values';
|
|
5
6
|
|
|
6
7
|
export const SINGLE_SELECT_ROUTES: Routes = {
|
|
7
8
|
'single-select': {
|
|
8
9
|
basic: SingleSelectBasic,
|
|
9
10
|
'get-value': SingleSelectOnInputOnChange,
|
|
10
11
|
'lazy-loaded': SingleSelectLazyLoaded,
|
|
12
|
+
'option-values': SingleSelectOptionValues,
|
|
11
13
|
},
|
|
12
14
|
};
|
|
@@ -140,6 +140,9 @@ export const MultiSortTable: FC = () => {
|
|
|
140
140
|
_headers={verticallHeader}
|
|
141
141
|
className="block"
|
|
142
142
|
_allowMultiSort={true}
|
|
143
|
+
_on={{
|
|
144
|
+
onSortChange: (_e, payload) => console.log('sort changed', payload),
|
|
145
|
+
}}
|
|
143
146
|
/>
|
|
144
147
|
</SampleBlock>
|
|
145
148
|
<SampleBlock id="horizontal" heading="Horizontal">
|
|
@@ -57,7 +57,16 @@ export const TableStatefulResetSort: FC = () => {
|
|
|
57
57
|
|
|
58
58
|
<section className="w-full grid gap-4">
|
|
59
59
|
<KolButton _label="Reset Sort" _on={{ onClick: handleResetSort }} />
|
|
60
|
-
<KolTableStateful
|
|
60
|
+
<KolTableStateful
|
|
61
|
+
ref={tableRef}
|
|
62
|
+
_label="Table with resettable sort"
|
|
63
|
+
_data={DATA}
|
|
64
|
+
_headers={HEADERS}
|
|
65
|
+
className="block"
|
|
66
|
+
_on={{
|
|
67
|
+
onSortChange: (_e, payload) => console.log('sort changed', payload),
|
|
68
|
+
}}
|
|
69
|
+
/>
|
|
61
70
|
</section>
|
|
62
71
|
</>
|
|
63
72
|
);
|