@public-ui/sample-react 3.0.0-rc.1 → 3.0.0-rc.3
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/dist/1055.js +2 -0
- package/dist/1068.js +2 -0
- package/dist/1219.js +2 -0
- package/dist/136.js +2 -0
- package/dist/1416.js +2 -0
- package/dist/1657.js +2 -0
- package/dist/1676.js +2 -0
- package/dist/{4288.js → 1714.js} +2 -2
- package/dist/1718.js +2 -0
- package/dist/1744.js +2 -0
- package/dist/1791.js +1 -1
- package/dist/2078.js +2 -0
- package/dist/2115.js +2 -0
- package/dist/2195.js +2 -0
- package/dist/3021.js +2 -0
- package/dist/3027.js +2 -0
- package/dist/3186.js +2 -0
- package/dist/364.js +2 -0
- package/dist/{2450.js → 3758.js} +2 -2
- package/dist/3836.js +2 -0
- package/dist/3872.js +2 -0
- package/dist/3879.js +2 -0
- package/dist/3949.js +2 -0
- package/dist/4211.js +2 -0
- package/dist/4350.js +2 -0
- package/dist/4390.js +2 -0
- package/dist/4566.js +2 -0
- package/dist/4662.js +2 -0
- package/dist/4928.js +2 -0
- package/dist/5000.js +2 -0
- package/dist/5151.js +2 -0
- package/dist/5171.js +2 -0
- package/dist/5792.js +2 -0
- package/dist/5876.js +2 -0
- package/dist/597.js +2 -0
- package/dist/6018.js +2 -0
- package/dist/6203.js +2 -0
- package/dist/6420.js +2 -0
- package/dist/6451.js +2 -0
- package/dist/6480.js +2 -0
- package/dist/6577.js +2 -0
- package/dist/6983.js +2 -0
- package/dist/7084.js +2 -0
- package/dist/7225.js +2 -0
- package/dist/7267.js +2 -0
- package/dist/7958.js +2 -0
- package/dist/7997.js +2 -0
- package/dist/8069.js +2 -0
- package/dist/8177.js +1 -1
- package/dist/8212.js +2 -0
- package/dist/8243.js +2 -0
- package/dist/8283.js +2 -0
- package/dist/8478.js +2 -0
- package/dist/851.js +2 -0
- package/dist/8573.js +2 -0
- package/dist/8728.js +2 -0
- package/dist/8808.js +2 -0
- package/dist/8999.js +2 -0
- package/dist/9068.js +2 -0
- package/dist/9130.js +2 -0
- package/dist/9162.js +2 -0
- package/dist/9219.js +2 -0
- package/dist/9423.js +2 -0
- package/dist/9430.js +2 -0
- package/dist/9929.js +2 -0
- package/dist/993.js +2 -0
- package/dist/index.html +0 -1
- package/dist/main.css +1 -1
- package/dist/main.js +1 -1
- package/dist/main.js.LICENSE.txt +2 -2
- package/package.json +19 -19
- package/public/index.html +0 -1
- package/src/App.tsx +1 -3
- package/src/components/drawer/basic.tsx +2 -20
- package/src/components/drawer/controlled.tsx +0 -8
- package/src/components/form/error-list.tsx +38 -24
- package/src/components/handout/basic.tsx +18 -23
- package/src/components/input-color/partials/cases.tsx +4 -2
- package/src/components/input-date/partials/cases.tsx +6 -3
- package/src/components/input-date/partials/minMax.tsx +3 -3
- package/src/components/input-date/partials/variants.tsx +1 -1
- package/src/components/input-date/show-hide-msg.tsx +0 -1
- package/src/components/input-email/partials/cases.tsx +6 -3
- package/src/components/input-file/partials/cases.tsx +6 -3
- package/src/components/input-password/partials/cases.tsx +8 -5
- package/src/components/input-range/partials/cases.tsx +6 -3
- package/src/components/input-text/partials/cases.tsx +1 -1
- package/src/components/input-text/smart-button.tsx +14 -1
- package/src/components/input-text/text-formatter.tsx +1 -2
- package/src/components/link/access-key.tsx +1 -3
- package/src/components/nav/basic.tsx +8 -2
- package/src/components/nav/horizontal.tsx +2 -2
- package/src/components/pagination/basic.tsx +1 -1
- package/src/components/select/partials/cases.tsx +16 -1
- package/src/components/single-select/partials/cases.tsx +5 -4
- package/src/components/single-select/partials/variants.tsx +5 -5
- package/src/components/split-button/basic.tsx +2 -2
- package/src/components/table/column-alignment.tsx +12 -12
- package/src/components/table/complex-headers.tsx +3 -3
- package/src/components/table/horizontal-scrollbar.tsx +12 -6
- package/src/components/table/multi-sort.tsx +4 -4
- package/src/components/table/pagination-position.tsx +23 -5
- package/src/components/table/render-cell.tsx +4 -4
- package/src/components/table/sort-data.tsx +14 -16
- package/src/components/table/stateful-with-selection.tsx +5 -5
- package/src/components/table/stateful-with-single-selection.tsx +5 -5
- package/src/components/table/stateless-with-selection.tsx +6 -6
- package/src/components/table/stateless-with-single-selection.tsx +6 -6
- package/src/components/table/with-footer.tsx +3 -3
- package/src/components/table/with-pagination.tsx +3 -3
- package/src/components/textarea/partials/cases.tsx +9 -4
- package/src/react.main.tsx +4 -9
- package/src/scenarios/appointment-form/PersonalInformationForm.tsx +4 -1
- package/src/scenarios/horizontal-scrollbar-advanced/TableHorizontalScrollbarAdvanced.tsx +2 -2
- package/src/shares/routes.ts +0 -6
- package/src/shares/theme.ts +4 -8
- package/dist/1073.js +0 -2
- package/dist/1325.js +0 -2
- package/dist/1392.js +0 -2
- package/dist/1604.js +0 -2
- package/dist/175.js +0 -2
- package/dist/178.js +0 -2
- package/dist/2220.js +0 -2
- package/dist/2444.js +0 -2
- package/dist/2671.js +0 -2
- package/dist/2986.js +0 -2
- package/dist/3030.js +0 -2
- package/dist/3270.js +0 -2
- package/dist/3340.js +0 -2
- package/dist/3392.js +0 -2
- package/dist/3529.js +0 -2
- package/dist/3756.js +0 -2
- package/dist/3960.js +0 -2
- package/dist/399.js +0 -2
- package/dist/4145.js +0 -2
- package/dist/4539.js +0 -2
- package/dist/4563.js +0 -2
- package/dist/4571.js +0 -2
- package/dist/5260.js +0 -2
- package/dist/5301.js +0 -2
- package/dist/5333.js +0 -2
- package/dist/5523.js +0 -2
- package/dist/5551.js +0 -2
- package/dist/5575.js +0 -2
- package/dist/5665.js +0 -2
- package/dist/572.js +0 -2
- package/dist/5873.js +0 -2
- package/dist/5879.js +0 -2
- package/dist/5964.js +0 -2
- package/dist/6005.js +0 -2
- package/dist/618.js +0 -2
- package/dist/623.js +0 -2
- package/dist/643.js +0 -2
- package/dist/6610.js +0 -2
- package/dist/6618.js +0 -2
- package/dist/6711.js +0 -2
- package/dist/6740.js +0 -2
- package/dist/6786.js +0 -2
- package/dist/685.js +0 -2
- package/dist/6950.js +0 -2
- package/dist/7055.js +0 -2
- package/dist/7106.js +0 -2
- package/dist/7141.js +0 -2
- package/dist/7146.js +0 -2
- package/dist/7287.js +0 -2
- package/dist/7599.js +0 -2
- package/dist/7648.js +0 -2
- package/dist/7668.js +0 -2
- package/dist/7855.js +0 -2
- package/dist/8165.js +0 -2
- package/dist/8306.js +0 -2
- package/dist/8543.js +0 -2
- package/dist/866.js +0 -2
- package/dist/8859.js +0 -2
- package/dist/904.js +0 -2
- package/dist/9148.js +0 -2
- package/dist/9522.js +0 -2
- package/dist/9625.js +0 -2
- package/dist/971.js +0 -2
- package/dist/971.js.LICENSE.txt +0 -3
- package/dist/9712.js +0 -2
- package/dist/9712.js.LICENSE.txt +0 -3
- package/dist/976.js +0 -2
- package/dist/976.js.LICENSE.txt +0 -3
- package/dist/982.js +0 -2
- package/dist/982.js.LICENSE.txt +0 -3
- package/dist/986.js +0 -2
- package/dist/986.js.LICENSE.txt +0 -3
- package/src/components/button-group/basic.tsx +0 -34
- package/src/components/button-group/routes.ts +0 -8
- package/src/components/indented-text/basic.tsx +0 -37
- package/src/components/indented-text/routes.ts +0 -8
- package/src/components/link-group/basic.tsx +0 -23
- package/src/components/link-group/horizontal.tsx +0 -23
- package/src/components/link-group/routes.ts +0 -10
- /package/dist/{1073.js.LICENSE.txt → 1055.js.LICENSE.txt} +0 -0
- /package/dist/{1325.js.LICENSE.txt → 1068.js.LICENSE.txt} +0 -0
- /package/dist/{1392.js.LICENSE.txt → 1219.js.LICENSE.txt} +0 -0
- /package/dist/{1604.js.LICENSE.txt → 136.js.LICENSE.txt} +0 -0
- /package/dist/{175.js.LICENSE.txt → 1416.js.LICENSE.txt} +0 -0
- /package/dist/{178.js.LICENSE.txt → 1657.js.LICENSE.txt} +0 -0
- /package/dist/{2220.js.LICENSE.txt → 1676.js.LICENSE.txt} +0 -0
- /package/dist/{2444.js.LICENSE.txt → 1714.js.LICENSE.txt} +0 -0
- /package/dist/{2450.js.LICENSE.txt → 1718.js.LICENSE.txt} +0 -0
- /package/dist/{2671.js.LICENSE.txt → 1744.js.LICENSE.txt} +0 -0
- /package/dist/{2986.js.LICENSE.txt → 2078.js.LICENSE.txt} +0 -0
- /package/dist/{3030.js.LICENSE.txt → 2115.js.LICENSE.txt} +0 -0
- /package/dist/{3270.js.LICENSE.txt → 2195.js.LICENSE.txt} +0 -0
- /package/dist/{3340.js.LICENSE.txt → 3021.js.LICENSE.txt} +0 -0
- /package/dist/{3392.js.LICENSE.txt → 3027.js.LICENSE.txt} +0 -0
- /package/dist/{3529.js.LICENSE.txt → 3186.js.LICENSE.txt} +0 -0
- /package/dist/{3756.js.LICENSE.txt → 364.js.LICENSE.txt} +0 -0
- /package/dist/{3960.js.LICENSE.txt → 3758.js.LICENSE.txt} +0 -0
- /package/dist/{399.js.LICENSE.txt → 3836.js.LICENSE.txt} +0 -0
- /package/dist/{4145.js.LICENSE.txt → 3872.js.LICENSE.txt} +0 -0
- /package/dist/{4288.js.LICENSE.txt → 3879.js.LICENSE.txt} +0 -0
- /package/dist/{4539.js.LICENSE.txt → 3949.js.LICENSE.txt} +0 -0
- /package/dist/{4563.js.LICENSE.txt → 4211.js.LICENSE.txt} +0 -0
- /package/dist/{4571.js.LICENSE.txt → 4350.js.LICENSE.txt} +0 -0
- /package/dist/{5260.js.LICENSE.txt → 4390.js.LICENSE.txt} +0 -0
- /package/dist/{5301.js.LICENSE.txt → 4566.js.LICENSE.txt} +0 -0
- /package/dist/{5333.js.LICENSE.txt → 4662.js.LICENSE.txt} +0 -0
- /package/dist/{5523.js.LICENSE.txt → 4928.js.LICENSE.txt} +0 -0
- /package/dist/{5551.js.LICENSE.txt → 5000.js.LICENSE.txt} +0 -0
- /package/dist/{5575.js.LICENSE.txt → 5151.js.LICENSE.txt} +0 -0
- /package/dist/{5665.js.LICENSE.txt → 5171.js.LICENSE.txt} +0 -0
- /package/dist/{572.js.LICENSE.txt → 5792.js.LICENSE.txt} +0 -0
- /package/dist/{5873.js.LICENSE.txt → 5876.js.LICENSE.txt} +0 -0
- /package/dist/{5879.js.LICENSE.txt → 597.js.LICENSE.txt} +0 -0
- /package/dist/{5964.js.LICENSE.txt → 6018.js.LICENSE.txt} +0 -0
- /package/dist/{6005.js.LICENSE.txt → 6203.js.LICENSE.txt} +0 -0
- /package/dist/{618.js.LICENSE.txt → 6420.js.LICENSE.txt} +0 -0
- /package/dist/{623.js.LICENSE.txt → 6451.js.LICENSE.txt} +0 -0
- /package/dist/{643.js.LICENSE.txt → 6480.js.LICENSE.txt} +0 -0
- /package/dist/{6610.js.LICENSE.txt → 6577.js.LICENSE.txt} +0 -0
- /package/dist/{6618.js.LICENSE.txt → 6983.js.LICENSE.txt} +0 -0
- /package/dist/{6711.js.LICENSE.txt → 7084.js.LICENSE.txt} +0 -0
- /package/dist/{6740.js.LICENSE.txt → 7225.js.LICENSE.txt} +0 -0
- /package/dist/{6786.js.LICENSE.txt → 7267.js.LICENSE.txt} +0 -0
- /package/dist/{685.js.LICENSE.txt → 7958.js.LICENSE.txt} +0 -0
- /package/dist/{6950.js.LICENSE.txt → 7997.js.LICENSE.txt} +0 -0
- /package/dist/{7055.js.LICENSE.txt → 8069.js.LICENSE.txt} +0 -0
- /package/dist/{7106.js.LICENSE.txt → 8212.js.LICENSE.txt} +0 -0
- /package/dist/{7141.js.LICENSE.txt → 8243.js.LICENSE.txt} +0 -0
- /package/dist/{7146.js.LICENSE.txt → 8283.js.LICENSE.txt} +0 -0
- /package/dist/{7287.js.LICENSE.txt → 8478.js.LICENSE.txt} +0 -0
- /package/dist/{7599.js.LICENSE.txt → 851.js.LICENSE.txt} +0 -0
- /package/dist/{7648.js.LICENSE.txt → 8573.js.LICENSE.txt} +0 -0
- /package/dist/{7668.js.LICENSE.txt → 8728.js.LICENSE.txt} +0 -0
- /package/dist/{7855.js.LICENSE.txt → 8808.js.LICENSE.txt} +0 -0
- /package/dist/{8165.js.LICENSE.txt → 8999.js.LICENSE.txt} +0 -0
- /package/dist/{8306.js.LICENSE.txt → 9068.js.LICENSE.txt} +0 -0
- /package/dist/{8543.js.LICENSE.txt → 9130.js.LICENSE.txt} +0 -0
- /package/dist/{866.js.LICENSE.txt → 9162.js.LICENSE.txt} +0 -0
- /package/dist/{8859.js.LICENSE.txt → 9219.js.LICENSE.txt} +0 -0
- /package/dist/{904.js.LICENSE.txt → 9423.js.LICENSE.txt} +0 -0
- /package/dist/{9148.js.LICENSE.txt → 9430.js.LICENSE.txt} +0 -0
- /package/dist/{9522.js.LICENSE.txt → 9929.js.LICENSE.txt} +0 -0
- /package/dist/{9625.js.LICENSE.txt → 993.js.LICENSE.txt} +0 -0
|
@@ -13,11 +13,11 @@ export const NavHorizontal: FC = () => (
|
|
|
13
13
|
<section className="grid gap-8">
|
|
14
14
|
<section className="grid gap-4">
|
|
15
15
|
<KolHeading _level={2} _label="Navigation without submenu" />
|
|
16
|
-
<KolNav _label="
|
|
16
|
+
<KolNav _label="Navigation without submenu" _links={LINKS_WITHOUT_SUBMENU} _orientation="horizontal" />
|
|
17
17
|
</section>
|
|
18
18
|
<section className="grid gap-4">
|
|
19
19
|
<KolHeading _level={2} _label="Navigation with submenu" />
|
|
20
|
-
<KolNav _label="
|
|
20
|
+
<KolNav _label="Navigation with submenu" _links={LINKS} _orientation="horizontal" />
|
|
21
21
|
</section>
|
|
22
22
|
</section>
|
|
23
23
|
</>
|
|
@@ -4,7 +4,7 @@ import { KolSelect } from '@public-ui/react';
|
|
|
4
4
|
|
|
5
5
|
import { ERROR_MSG } from '../../../shares/constants';
|
|
6
6
|
|
|
7
|
-
import type { Components, SelectOption } from '@public-ui/components';
|
|
7
|
+
import type { Components, Optgroup, SelectOption, StencilUnknown } from '@public-ui/components';
|
|
8
8
|
import { COUNTRY_OPTIONS } from '../../../shares/country';
|
|
9
9
|
|
|
10
10
|
const SALUTATION_OPTIONS: SelectOption<string>[] = [
|
|
@@ -27,6 +27,19 @@ const SALUTATION_OPTIONS: SelectOption<string>[] = [
|
|
|
27
27
|
},
|
|
28
28
|
];
|
|
29
29
|
|
|
30
|
+
type GroupedOptionsType = Record<string, Optgroup<StencilUnknown>>;
|
|
31
|
+
|
|
32
|
+
const groupedOptions: GroupedOptionsType = COUNTRY_OPTIONS.reduce((acc, option) => {
|
|
33
|
+
const firstLetter = (option.label as string).charAt(0).toUpperCase();
|
|
34
|
+
if (!acc[firstLetter]) {
|
|
35
|
+
acc[firstLetter] = { label: firstLetter, options: [] };
|
|
36
|
+
}
|
|
37
|
+
acc[firstLetter].options.push({ label: option.label, value: option.label });
|
|
38
|
+
return acc;
|
|
39
|
+
}, {} as GroupedOptionsType);
|
|
40
|
+
|
|
41
|
+
const groupedOptionsArray = Object.values(groupedOptions);
|
|
42
|
+
|
|
30
43
|
export const SelectCases = forwardRef<HTMLKolSelectElement, Components.KolSelect>(function SelectCases(props, ref) {
|
|
31
44
|
return (
|
|
32
45
|
<div className="grid gap-4">
|
|
@@ -59,6 +72,8 @@ export const SelectCases = forwardRef<HTMLKolSelectElement, Components.KolSelect
|
|
|
59
72
|
/>
|
|
60
73
|
<KolSelect {...props} _options={SALUTATION_OPTIONS} _label="With access key" _accessKey="c" />
|
|
61
74
|
<KolSelect {...props} _options={SALUTATION_OPTIONS} _label="With short key" _shortKey="s" />
|
|
75
|
+
<KolSelect {...props} _options={groupedOptionsArray} _label="With grouped by first letter" _value={['Albanien']} />
|
|
76
|
+
<KolSelect {...props} _options={groupedOptionsArray} _label="With grouped by first letter (multiple)" _multiple _value={['Albanien']} />
|
|
62
77
|
</div>
|
|
63
78
|
);
|
|
64
79
|
});
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import React
|
|
1
|
+
import React from 'react';
|
|
2
2
|
|
|
3
3
|
import { KolSingleSelect } from '@public-ui/react';
|
|
4
4
|
|
|
5
5
|
import { ERROR_MSG, HINT_MSG } from '../../../shares/constants';
|
|
6
6
|
|
|
7
|
-
import type {
|
|
7
|
+
import type { Option, StencilUnknown } from '@public-ui/components';
|
|
8
8
|
import { COUNTRY_OPTIONS } from '../../../shares/country';
|
|
9
|
+
import type { Components } from '@public-ui/components';
|
|
9
10
|
|
|
10
|
-
export const SingleSelectCases =
|
|
11
|
+
export const SingleSelectCases = (props: Components.KolSingleSelect) => {
|
|
11
12
|
return (
|
|
12
13
|
<div className="grid gap-4">
|
|
13
14
|
<KolSingleSelect
|
|
@@ -38,4 +39,4 @@ export const SingleSelectCases = forwardRef<HTMLKolSingleSelectElement, Componen
|
|
|
38
39
|
<KolSingleSelect {...props} _label="With short key" _options={COUNTRY_OPTIONS as Option<StencilUnknown>[]} _value={'de'} _shortKey="s" />
|
|
39
40
|
</div>
|
|
40
41
|
);
|
|
41
|
-
}
|
|
42
|
+
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import React
|
|
1
|
+
import React from 'react';
|
|
2
2
|
|
|
3
3
|
import { SingleSelectCases } from './cases';
|
|
4
|
-
|
|
5
4
|
import type { Components } from '@public-ui/components';
|
|
6
|
-
|
|
5
|
+
|
|
6
|
+
export const SingleSelectVariants = (props: Components.KolSingleSelect) => {
|
|
7
7
|
return (
|
|
8
8
|
<div className="grid md:grid-cols-2 gap-4">
|
|
9
9
|
<fieldset>
|
|
@@ -12,8 +12,8 @@ export const SingleSelectVariants = forwardRef<HTMLKolSingleSelectElement, Compo
|
|
|
12
12
|
</fieldset>
|
|
13
13
|
<fieldset>
|
|
14
14
|
<legend>Text (hideLabel)</legend>
|
|
15
|
-
<SingleSelectCases
|
|
15
|
+
<SingleSelectCases {...props} _hideLabel />
|
|
16
16
|
</fieldset>
|
|
17
17
|
</div>
|
|
18
18
|
);
|
|
19
|
-
}
|
|
19
|
+
};
|
|
@@ -27,10 +27,10 @@ export const SplitButtonBasic: FC = () => {
|
|
|
27
27
|
|
|
28
28
|
<div className="flex gap-4">
|
|
29
29
|
<KolSplitButton _label="Only the arrow opens" _on={{ onClick: handleButtonClick }}>
|
|
30
|
-
Dropdown
|
|
30
|
+
Dropdown contents
|
|
31
31
|
</KolSplitButton>
|
|
32
32
|
<KolSplitButton _label="Button without visible label" _hideLabel _icons="codicon codicon-git-pull-request">
|
|
33
|
-
Dropdown
|
|
33
|
+
Dropdown contents
|
|
34
34
|
</KolSplitButton>
|
|
35
35
|
</div>
|
|
36
36
|
</>
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import type { FC } from 'react';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
|
|
4
|
-
import { KolHeading,
|
|
4
|
+
import { KolHeading, KolTableStateful } from '@public-ui/react';
|
|
5
5
|
|
|
6
6
|
import { SampleDescription } from '../SampleDescription';
|
|
7
7
|
|
|
8
8
|
const DATA = [{ left: 'Left Example', center: 'Center Example', right: 'Right Example' }];
|
|
9
|
-
const genericNonSorter =
|
|
9
|
+
const genericNonSorter = () => 0;
|
|
10
10
|
|
|
11
11
|
export const TableColumnAlignment: FC = () => (
|
|
12
12
|
<>
|
|
13
13
|
<SampleDescription>
|
|
14
|
-
<p>This sample shows
|
|
14
|
+
<p>This sample shows KolTableStateful with columns headers and data in different text alignments.</p>
|
|
15
15
|
</SampleDescription>
|
|
16
16
|
|
|
17
17
|
<section className="w-full flex flex-col">
|
|
18
18
|
<KolHeading _label="Simple table" _level={3}></KolHeading>
|
|
19
|
-
<
|
|
19
|
+
<KolTableStateful
|
|
20
20
|
_label="Table for demonstration purposes with different text align properties"
|
|
21
21
|
_headers={{
|
|
22
22
|
horizontal: [
|
|
@@ -33,14 +33,14 @@ export const TableColumnAlignment: FC = () => (
|
|
|
33
33
|
/>
|
|
34
34
|
|
|
35
35
|
<KolHeading _label="Table with sortable columns" _level={3} className="block mt-6"></KolHeading>
|
|
36
|
-
<
|
|
36
|
+
<KolTableStateful
|
|
37
37
|
_label="Table for demonstration purposes with sortable columns"
|
|
38
38
|
_headers={{
|
|
39
39
|
horizontal: [
|
|
40
40
|
[
|
|
41
|
-
{ label: 'left', key: 'left', textAlign: 'left',
|
|
42
|
-
{ label: 'center', key: 'center', textAlign: 'center',
|
|
43
|
-
{ label: 'right', key: 'right', textAlign: 'right',
|
|
41
|
+
{ label: 'left', key: 'left', textAlign: 'left', compareFn: genericNonSorter },
|
|
42
|
+
{ label: 'center', key: 'center', textAlign: 'center', compareFn: genericNonSorter },
|
|
43
|
+
{ label: 'right', key: 'right', textAlign: 'right', compareFn: genericNonSorter },
|
|
44
44
|
],
|
|
45
45
|
],
|
|
46
46
|
}}
|
|
@@ -50,13 +50,13 @@ export const TableColumnAlignment: FC = () => (
|
|
|
50
50
|
/>
|
|
51
51
|
|
|
52
52
|
<KolHeading _label="Table some sortable columns" _level={3} className="block mt-6"></KolHeading>
|
|
53
|
-
<
|
|
53
|
+
<KolTableStateful
|
|
54
54
|
_label="Table for demonstration purposes with some but not all columns sortable"
|
|
55
55
|
_headers={{
|
|
56
56
|
horizontal: [
|
|
57
57
|
[
|
|
58
|
-
{ label: 'left', key: 'left', textAlign: 'left',
|
|
59
|
-
{ label: 'center', key: 'center', textAlign: 'center',
|
|
58
|
+
{ label: 'left', key: 'left', textAlign: 'left', compareFn: genericNonSorter },
|
|
59
|
+
{ label: 'center', key: 'center', textAlign: 'center', compareFn: genericNonSorter },
|
|
60
60
|
{ label: 'right', key: 'right', textAlign: 'right' },
|
|
61
61
|
],
|
|
62
62
|
],
|
|
@@ -67,7 +67,7 @@ export const TableColumnAlignment: FC = () => (
|
|
|
67
67
|
/>
|
|
68
68
|
|
|
69
69
|
<KolHeading _label="Table with vertical heading" _level={3} className="block mt-6"></KolHeading>
|
|
70
|
-
<
|
|
70
|
+
<KolTableStateful
|
|
71
71
|
_label="Table for demonstration purposes with vertical heading"
|
|
72
72
|
_headers={{
|
|
73
73
|
horizontal: [
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import type { FC } from 'react';
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import {
|
|
3
|
+
import { KolTableStateful } from '@public-ui/react';
|
|
4
4
|
import { SampleDescription } from '../SampleDescription';
|
|
5
5
|
|
|
6
6
|
export const TableComplexHeaders: FC = () => (
|
|
7
7
|
<>
|
|
8
8
|
<SampleDescription>
|
|
9
|
-
<p>This sample shows
|
|
9
|
+
<p>This sample shows KolTableStateful using vertical and horizontal headers, applying colspan and rowspan.</p>
|
|
10
10
|
</SampleDescription>
|
|
11
11
|
|
|
12
12
|
<section className="w-full flex flex-col">
|
|
13
|
-
<
|
|
13
|
+
<KolTableStateful
|
|
14
14
|
_label="Business hours"
|
|
15
15
|
_data={[
|
|
16
16
|
{
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { FC } from 'react';
|
|
2
2
|
import React, { useState } from 'react';
|
|
3
3
|
|
|
4
|
-
import { KolHeading, KolInputCheckbox,
|
|
4
|
+
import { KolHeading, KolInputCheckbox, KolTableStateful } from '@public-ui/react';
|
|
5
5
|
|
|
6
6
|
import { SampleDescription } from '../SampleDescription';
|
|
7
7
|
|
|
@@ -26,15 +26,15 @@ export const TableHorizontalScrollbar: FC = () => {
|
|
|
26
26
|
<>
|
|
27
27
|
<SampleDescription>
|
|
28
28
|
<p>
|
|
29
|
-
This sample shows
|
|
30
|
-
to scroll it using arrow keys.
|
|
29
|
+
This sample shows KolTableStateful with and without horizontal scrollbars. When a scrollbar is present, it should be possible to focus the table
|
|
30
|
+
container and to scroll it using arrow keys.
|
|
31
31
|
</p>
|
|
32
32
|
</SampleDescription>
|
|
33
33
|
|
|
34
34
|
<section className="w-full flex flex-col gap-4">
|
|
35
35
|
<KolHeading _label="Table with scrollbar" _level={2} />
|
|
36
36
|
|
|
37
|
-
<
|
|
37
|
+
<KolTableStateful
|
|
38
38
|
_label="Table for demonstration purposes with horizontal scrollbar."
|
|
39
39
|
_minWidth={hasWidthRestriction ? '600px' : 'auto'}
|
|
40
40
|
_headers={HEADERS}
|
|
@@ -45,7 +45,7 @@ export const TableHorizontalScrollbar: FC = () => {
|
|
|
45
45
|
|
|
46
46
|
<KolHeading _label="Empty Table with scrollbar" _level={3} />
|
|
47
47
|
|
|
48
|
-
<
|
|
48
|
+
<KolTableStateful
|
|
49
49
|
_label="Table for demonstration purposes with horizontal scrollbar with auto minWidth."
|
|
50
50
|
_minWidth={hasWidthRestriction ? '600px' : 'auto'}
|
|
51
51
|
_headers={HEADERS}
|
|
@@ -70,7 +70,13 @@ export const TableHorizontalScrollbar: FC = () => {
|
|
|
70
70
|
<i>Scrollbar appears on very small viewport sizes</i>
|
|
71
71
|
</p>
|
|
72
72
|
|
|
73
|
-
<
|
|
73
|
+
<KolTableStateful
|
|
74
|
+
_label="Table for demonstration purposes without horizontal scrollbar"
|
|
75
|
+
_minWidth="600px"
|
|
76
|
+
_headers={HEADERS}
|
|
77
|
+
_data={DATA}
|
|
78
|
+
className="block"
|
|
79
|
+
/>
|
|
74
80
|
</section>
|
|
75
81
|
</>
|
|
76
82
|
);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { FC } from 'react';
|
|
2
2
|
import React, { useState } from 'react';
|
|
3
3
|
|
|
4
|
-
import { KolHeading, KolInputCheckbox,
|
|
4
|
+
import { KolHeading, KolInputCheckbox, KolTableStateful } from '@public-ui/react';
|
|
5
5
|
import type { KoliBriTableHeaders, KoliBriTableDataType } from '@public-ui/components';
|
|
6
6
|
import type { Data } from './test-data';
|
|
7
7
|
import { DATA } from './test-data';
|
|
@@ -74,7 +74,7 @@ export const MultiSortTable: FC = () => {
|
|
|
74
74
|
return (
|
|
75
75
|
<>
|
|
76
76
|
<SampleDescription>
|
|
77
|
-
<p>This sample shows
|
|
77
|
+
<p>This sample shows KolTableStateful with multi-sort functionality, allowing sorting by both "order" and "date" columns.</p>
|
|
78
78
|
</SampleDescription>
|
|
79
79
|
|
|
80
80
|
<section className="w-full grid gap-4">
|
|
@@ -86,7 +86,7 @@ export const MultiSortTable: FC = () => {
|
|
|
86
86
|
_variant="switch"
|
|
87
87
|
_on={{ onChange: (_, value) => setAllowMultiSortVertical(Boolean(value)) }}
|
|
88
88
|
></KolInputCheckbox>
|
|
89
|
-
<
|
|
89
|
+
<KolTableStateful
|
|
90
90
|
_label="Sort Table with Order and Date"
|
|
91
91
|
_data={DATA.slice(0, 10)}
|
|
92
92
|
_headers={HEADERS_VERTICAL}
|
|
@@ -102,7 +102,7 @@ export const MultiSortTable: FC = () => {
|
|
|
102
102
|
_variant="switch"
|
|
103
103
|
_on={{ onChange: (_, value) => setAllowMultiSortHorizontal(Boolean(value)) }}
|
|
104
104
|
></KolInputCheckbox>
|
|
105
|
-
<
|
|
105
|
+
<KolTableStateful
|
|
106
106
|
_label="Sort Table with Order and Date"
|
|
107
107
|
_data={DATA}
|
|
108
108
|
_headers={HEADERS_HORIZONTAL}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { FC } from 'react';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
|
|
4
|
-
import { KolHeading,
|
|
4
|
+
import { KolHeading, KolTableStateful } from '@public-ui/react';
|
|
5
5
|
|
|
6
6
|
import { SampleDescription } from '../SampleDescription';
|
|
7
7
|
import { DATE_FORMATTER } from './formatter';
|
|
@@ -23,21 +23,39 @@ const PAGINATION: KoliBriTablePaginationProps = { _page: 2 };
|
|
|
23
23
|
export const PaginationPosition: FC = () => (
|
|
24
24
|
<div className="w-full grid gap-14">
|
|
25
25
|
<SampleDescription>
|
|
26
|
-
<p>This sample shows
|
|
26
|
+
<p>This sample shows KolTableStateful with different pagination positions.</p>
|
|
27
27
|
</SampleDescription>
|
|
28
28
|
|
|
29
29
|
<section className="w-full flex flex-col gap-14">
|
|
30
30
|
<section className="grid gap-4">
|
|
31
31
|
<KolHeading _level={2} _label="Table with pagination at the bottom."></KolHeading>
|
|
32
|
-
<
|
|
32
|
+
<KolTableStateful
|
|
33
|
+
_label="Sample table with pagination at the bottom"
|
|
34
|
+
_data={DATA}
|
|
35
|
+
_headers={HEADERS}
|
|
36
|
+
_pagination={PAGINATION}
|
|
37
|
+
_paginationPosition="bottom"
|
|
38
|
+
></KolTableStateful>
|
|
33
39
|
</section>
|
|
34
40
|
<section className="grid gap-4">
|
|
35
41
|
<KolHeading _level={2} _label="Table with pagination at the top."></KolHeading>
|
|
36
|
-
<
|
|
42
|
+
<KolTableStateful
|
|
43
|
+
_label="Sample table with pagination at the top"
|
|
44
|
+
_data={DATA}
|
|
45
|
+
_headers={HEADERS}
|
|
46
|
+
_pagination={PAGINATION}
|
|
47
|
+
_paginationPosition="top"
|
|
48
|
+
></KolTableStateful>
|
|
37
49
|
</section>
|
|
38
50
|
<section className="grid gap-4">
|
|
39
51
|
<KolHeading _level={2} _label="Table with pagination at both top and bottom."></KolHeading>
|
|
40
|
-
<
|
|
52
|
+
<KolTableStateful
|
|
53
|
+
_label="Sample table with pagination at both top and bottom"
|
|
54
|
+
_data={DATA}
|
|
55
|
+
_headers={HEADERS}
|
|
56
|
+
_pagination={PAGINATION}
|
|
57
|
+
_paginationPosition="both"
|
|
58
|
+
></KolTableStateful>
|
|
41
59
|
</section>
|
|
42
60
|
</section>
|
|
43
61
|
</div>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { FC } from 'react';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
|
|
4
|
-
import { createReactRenderElement, KolButton, KolInputText,
|
|
4
|
+
import { createReactRenderElement, KolButton, KolInputText, KolTableStateful } from '@public-ui/react';
|
|
5
5
|
|
|
6
6
|
import { getRoot } from '../../shares/react-roots';
|
|
7
7
|
import { SampleDescription } from '../SampleDescription';
|
|
@@ -80,7 +80,7 @@ const HEADERS: KoliBriTableHeaders = {
|
|
|
80
80
|
render: (el, cell) => {
|
|
81
81
|
el.innerHTML = `<strong>${DATE_FORMATTER.format(cell.label as unknown as Date)}</strong>`;
|
|
82
82
|
},
|
|
83
|
-
|
|
83
|
+
compareFn: (data0, data1) => (data0 as Data).date.getTime() - (data1 as Data).date.getTime(),
|
|
84
84
|
},
|
|
85
85
|
{
|
|
86
86
|
label: 'Action (react)',
|
|
@@ -112,9 +112,9 @@ const HEADERS: KoliBriTableHeaders = {
|
|
|
112
112
|
export const TableRenderCell: FC = () => (
|
|
113
113
|
<>
|
|
114
114
|
<SampleDescription>
|
|
115
|
-
<p>This sample shows
|
|
115
|
+
<p>This sample shows KolTableStateful using React render functions for the cell contents.</p>
|
|
116
116
|
</SampleDescription>
|
|
117
117
|
|
|
118
|
-
<
|
|
118
|
+
<KolTableStateful _label="Sort by date column" _data={DATA} _headers={HEADERS} className="w-full" />
|
|
119
119
|
</>
|
|
120
120
|
);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { FC } from 'react';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
|
|
4
|
-
import { KolHeading,
|
|
4
|
+
import { KolHeading, KolTableStateful } from '@public-ui/react';
|
|
5
5
|
import type { KoliBriTableHeaders } from '@public-ui/components';
|
|
6
6
|
import type { Data } from './test-data';
|
|
7
7
|
import { DATA } from './test-data';
|
|
@@ -22,12 +22,11 @@ const HEADERS_HORIZONTAL: KoliBriTableHeaders = {
|
|
|
22
22
|
key: 'date',
|
|
23
23
|
textAlign: 'center',
|
|
24
24
|
render: (_el, _cell, tupel) => DATE_FORMATTER.format((tupel as Data).date),
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
}),
|
|
25
|
+
compareFn: (data0, data1) => {
|
|
26
|
+
if ((data0 as Data).date < (data1 as Data).date) return -1;
|
|
27
|
+
else if ((data1 as Data).date < (data0 as Data).date) return 1;
|
|
28
|
+
else return 0;
|
|
29
|
+
},
|
|
31
30
|
},
|
|
32
31
|
],
|
|
33
32
|
],
|
|
@@ -42,12 +41,11 @@ const HEADERS_VERTICAL: KoliBriTableHeaders = {
|
|
|
42
41
|
key: 'date',
|
|
43
42
|
textAlign: 'center',
|
|
44
43
|
render: (_el, _cell, tupel) => DATE_FORMATTER.format((tupel as Data).date),
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
}),
|
|
44
|
+
compareFn: (data0, data1) => {
|
|
45
|
+
if ((data0 as Data).date < (data1 as Data).date) return -1;
|
|
46
|
+
else if ((data1 as Data).date < (data0 as Data).date) return 1;
|
|
47
|
+
else return 0;
|
|
48
|
+
},
|
|
51
49
|
},
|
|
52
50
|
],
|
|
53
51
|
],
|
|
@@ -56,17 +54,17 @@ const HEADERS_VERTICAL: KoliBriTableHeaders = {
|
|
|
56
54
|
export const TableSortData: FC = () => (
|
|
57
55
|
<>
|
|
58
56
|
<SampleDescription>
|
|
59
|
-
<p>This sample shows
|
|
57
|
+
<p>This sample shows KolTableStateful with sortable columns. The sort-order can be changed by clicking the "date" header column.</p>
|
|
60
58
|
</SampleDescription>
|
|
61
59
|
|
|
62
60
|
<section className="w-full grid gap-4">
|
|
63
61
|
<section className="grid gap-4">
|
|
64
62
|
<KolHeading _level={2} _label="Vertical" />
|
|
65
|
-
<
|
|
63
|
+
<KolTableStateful _label="Sort a date column" _data={DATA.slice(0, 10)} _headers={HEADERS_VERTICAL} className="block" />
|
|
66
64
|
</section>
|
|
67
65
|
<section className="grid gap-4">
|
|
68
66
|
<KolHeading _level={2} _label="Horizontal" />
|
|
69
|
-
<
|
|
67
|
+
<KolTableStateful _label="Sort a date column" _data={DATA} _headers={HEADERS_HORIZONTAL} className="block" />
|
|
70
68
|
</section>
|
|
71
69
|
</section>
|
|
72
70
|
</>
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type { FC } from 'react';
|
|
2
2
|
import React, { useEffect, useRef, useState } from 'react';
|
|
3
|
-
import { KolButton, KolTableStateful
|
|
3
|
+
import { createReactRenderElement, KolButton, KolTableStateful } from '@public-ui/react';
|
|
4
4
|
import { SampleDescription } from '../SampleDescription';
|
|
5
|
-
import type { KoliBriTableDataType, KoliBriTableSelection } from '@public-ui/components';
|
|
5
|
+
import type { KoliBriTableCell, KoliBriTableDataType, KoliBriTableSelection } from '@public-ui/components';
|
|
6
|
+
import { KolEvent } from '@public-ui/components';
|
|
6
7
|
import { getRoot } from '../../shares/react-roots';
|
|
7
|
-
import type { KoliBriTableCell } from '@public-ui/components';
|
|
8
8
|
import { useToasterService } from '../../hooks/useToasterService';
|
|
9
9
|
|
|
10
10
|
const DATA = [
|
|
@@ -48,11 +48,11 @@ export const TableStatefulWithSelection: FC = () => {
|
|
|
48
48
|
|
|
49
49
|
useEffect(() => {
|
|
50
50
|
// @ts-expect-error https://github.com/Microsoft/TypeScript/issues/28357
|
|
51
|
-
kolTableStatefulRef.current?.addEventListener(
|
|
51
|
+
kolTableStatefulRef.current?.addEventListener(KolEvent.selectionChange, handleSelectionChangeEvent);
|
|
52
52
|
|
|
53
53
|
return () => {
|
|
54
54
|
// @ts-expect-error https://github.com/Microsoft/TypeScript/issues/28357
|
|
55
|
-
kolTableStatefulRef.current?.removeEventListener(
|
|
55
|
+
kolTableStatefulRef.current?.removeEventListener(KolEvent.selectionChange, handleSelectionChangeEvent);
|
|
56
56
|
};
|
|
57
57
|
}, [kolTableStatefulRef]);
|
|
58
58
|
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type { FC } from 'react';
|
|
2
2
|
import React, { useEffect, useRef, useState } from 'react';
|
|
3
|
-
import { KolButton, KolTableStateful
|
|
3
|
+
import { createReactRenderElement, KolButton, KolTableStateful } from '@public-ui/react';
|
|
4
4
|
import { SampleDescription } from '../SampleDescription';
|
|
5
|
-
import type { KoliBriTableDataType, KoliBriTableSelection } from '@public-ui/components';
|
|
5
|
+
import type { KoliBriTableCell, KoliBriTableDataType, KoliBriTableSelection } from '@public-ui/components';
|
|
6
|
+
import { KolEvent } from '@public-ui/components';
|
|
6
7
|
import { getRoot } from '../../shares/react-roots';
|
|
7
|
-
import type { KoliBriTableCell } from '@public-ui/components';
|
|
8
8
|
import { useToasterService } from '../../hooks/useToasterService';
|
|
9
9
|
|
|
10
10
|
const DATA = [
|
|
@@ -50,11 +50,11 @@ export const TableStatefulWithSingleSelection: FC = () => {
|
|
|
50
50
|
|
|
51
51
|
useEffect(() => {
|
|
52
52
|
// @ts-expect-error https://github.com/Microsoft/TypeScript/issues/28357
|
|
53
|
-
kolTableStatefulRef.current?.addEventListener(
|
|
53
|
+
kolTableStatefulRef.current?.addEventListener(KolEvent.selectionChange, handleSelectionChangeEvent);
|
|
54
54
|
|
|
55
55
|
return () => {
|
|
56
56
|
// @ts-expect-error https://github.com/Microsoft/TypeScript/issues/28357
|
|
57
|
-
kolTableStatefulRef.current?.removeEventListener(
|
|
57
|
+
kolTableStatefulRef.current?.removeEventListener(KolEvent.selectionChange, handleSelectionChangeEvent);
|
|
58
58
|
};
|
|
59
59
|
}, [kolTableStatefulRef]);
|
|
60
60
|
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type { FC } from 'react';
|
|
2
|
-
import React, { useEffect,
|
|
3
|
-
import { KolButton, KolTableStateless
|
|
2
|
+
import React, { useEffect, useRef, useState } from 'react';
|
|
3
|
+
import { createReactRenderElement, KolButton, KolTableStateless } from '@public-ui/react';
|
|
4
4
|
import { SampleDescription } from '../SampleDescription';
|
|
5
|
-
import type { KoliBriTableSelection } from '@public-ui/components';
|
|
5
|
+
import type { KoliBriTableCell, KoliBriTableSelection } from '@public-ui/components';
|
|
6
|
+
import { KolEvent } from '@public-ui/components';
|
|
6
7
|
import { getRoot } from '../../shares/react-roots';
|
|
7
|
-
import type { KoliBriTableCell } from '@public-ui/components';
|
|
8
8
|
import { useToasterService } from '../../hooks/useToasterService';
|
|
9
9
|
|
|
10
10
|
const DATA = [
|
|
@@ -44,11 +44,11 @@ export const TableStatelessWithSelection: FC = () => {
|
|
|
44
44
|
|
|
45
45
|
useEffect(() => {
|
|
46
46
|
// @ts-expect-error https://github.com/Microsoft/TypeScript/issues/28357
|
|
47
|
-
kolTableStatelessRef.current?.addEventListener(
|
|
47
|
+
kolTableStatelessRef.current?.addEventListener(KolEvent.selectionChange, handleSelectionChangeEvent);
|
|
48
48
|
|
|
49
49
|
return () => {
|
|
50
50
|
// @ts-expect-error https://github.com/Microsoft/TypeScript/issues/28357
|
|
51
|
-
kolTableStatelessRef.current?.removeEventListener(
|
|
51
|
+
kolTableStatelessRef.current?.removeEventListener(KolEvent.selectionChange, handleSelectionChangeEvent);
|
|
52
52
|
};
|
|
53
53
|
}, [kolTableStatelessRef]);
|
|
54
54
|
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type { FC } from 'react';
|
|
2
|
-
import React, { useEffect,
|
|
3
|
-
import { KolButton, KolTableStateless
|
|
2
|
+
import React, { useEffect, useRef, useState } from 'react';
|
|
3
|
+
import { createReactRenderElement, KolButton, KolTableStateless } from '@public-ui/react';
|
|
4
4
|
import { SampleDescription } from '../SampleDescription';
|
|
5
|
-
import type { KoliBriTableSelection } from '@public-ui/components';
|
|
5
|
+
import type { KoliBriTableCell, KoliBriTableSelection } from '@public-ui/components';
|
|
6
|
+
import { KolEvent } from '@public-ui/components';
|
|
6
7
|
import { getRoot } from '../../shares/react-roots';
|
|
7
|
-
import type { KoliBriTableCell } from '@public-ui/components';
|
|
8
8
|
import { useToasterService } from '../../hooks/useToasterService';
|
|
9
9
|
|
|
10
10
|
const DATA = [
|
|
@@ -45,11 +45,11 @@ export const TableStatelessWithSingleSelection: FC = () => {
|
|
|
45
45
|
|
|
46
46
|
useEffect(() => {
|
|
47
47
|
// @ts-expect-error https://github.com/Microsoft/TypeScript/issues/28357
|
|
48
|
-
kolTableStatelessRef.current?.addEventListener(
|
|
48
|
+
kolTableStatelessRef.current?.addEventListener(KolEvent.selectionChange, handleSelectionChangeEvent);
|
|
49
49
|
|
|
50
50
|
return () => {
|
|
51
51
|
// @ts-expect-error https://github.com/Microsoft/TypeScript/issues/28357
|
|
52
|
-
kolTableStatelessRef.current?.removeEventListener(
|
|
52
|
+
kolTableStatelessRef.current?.removeEventListener(KolEvent.selectionChange, handleSelectionChangeEvent);
|
|
53
53
|
};
|
|
54
54
|
}, [kolTableStatelessRef]);
|
|
55
55
|
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import type { FC } from 'react';
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import {
|
|
3
|
+
import { KolTableStateful } from '@public-ui/react';
|
|
4
4
|
import { SampleDescription } from '../SampleDescription';
|
|
5
5
|
|
|
6
6
|
export const TableWithFooter: FC = () => (
|
|
7
7
|
<>
|
|
8
8
|
<SampleDescription>
|
|
9
|
-
<p>This sample shows
|
|
9
|
+
<p>This sample shows KolTableStateful with footer data.</p>
|
|
10
10
|
</SampleDescription>
|
|
11
11
|
|
|
12
|
-
<
|
|
12
|
+
<KolTableStateful
|
|
13
13
|
className="w-full"
|
|
14
14
|
_label="Business hours"
|
|
15
15
|
_headers={{
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { FC } from 'react';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
|
|
4
|
-
import {
|
|
4
|
+
import { KolTableStateful } from '@public-ui/react';
|
|
5
5
|
|
|
6
6
|
import { DATE_FORMATTER } from './formatter';
|
|
7
7
|
import { SampleDescription } from '../SampleDescription';
|
|
@@ -23,10 +23,10 @@ const PAGINATION: KoliBriTablePaginationProps = { _page: 2 };
|
|
|
23
23
|
export const TableWithPagination: FC = () => (
|
|
24
24
|
<>
|
|
25
25
|
<SampleDescription>
|
|
26
|
-
<p>This sample shows how
|
|
26
|
+
<p>This sample shows how KolTableStateful can be navigated using a pagination.</p>
|
|
27
27
|
</SampleDescription>
|
|
28
28
|
<div className="w-full">
|
|
29
|
-
<
|
|
29
|
+
<KolTableStateful _label="Table description" _data={DATA} _headers={HEADERS} _pagination={PAGINATION}></KolTableStateful>
|
|
30
30
|
</div>
|
|
31
31
|
</>
|
|
32
32
|
);
|
|
@@ -1,14 +1,19 @@
|
|
|
1
1
|
import React, { forwardRef } from 'react';
|
|
2
|
-
|
|
3
2
|
import { KolTextarea } from '@public-ui/react';
|
|
3
|
+
import type { Components } from '@public-ui/components';
|
|
4
4
|
|
|
5
|
-
import { ERROR_MSG } from '../../../shares/constants';
|
|
5
|
+
import { ERROR_MSG, HINT_MSG } from '../../../shares/constants';
|
|
6
6
|
|
|
7
|
-
import type { Components } from '@public-ui/components';
|
|
8
7
|
export const TextareaCases = forwardRef<HTMLKolTextareaElement, Components.KolTextarea>(function TextareaCases(props, ref) {
|
|
9
8
|
return (
|
|
10
9
|
<div className="grid gap-4">
|
|
11
|
-
<
|
|
10
|
+
<div className="black-background">
|
|
11
|
+
<KolTextarea {...props} ref={ref} _placeholder="Placeholder" _label="Text" />
|
|
12
|
+
</div>
|
|
13
|
+
<KolTextarea {...props} _placeholder="Placeholder" _required _msg={{ _type: 'error', _description: ERROR_MSG }} _label="Text" _touched _hint={HINT_MSG} />
|
|
14
|
+
<KolTextarea {...props} _placeholder="Placeholder" _label="Text" _msg={{ _type: 'info', _description: 'Just a hint' }} />
|
|
15
|
+
<KolTextarea {...props} _placeholder="Placeholder" _label="Text" _msg={{ _type: 'warning', _description: 'Small warning' }} />
|
|
16
|
+
<KolTextarea {...props} _placeholder="Placeholder" _label="Text" _msg={{ _type: 'success', _description: 'Success message' }} />
|
|
12
17
|
<KolTextarea {...props} ref={ref} _accessKey="T" _label="Text (3 rows)" _rows={3} />
|
|
13
18
|
<KolTextarea {...props} ref={ref} _label="Text (placeholder)" _rows={3} _placeholder="Placeholder" />
|
|
14
19
|
<KolTextarea {...props} ref={ref} _label="Text (disabled & placeholder)" _rows={3} _placeholder="Placeholder" _disabled />
|