@hortiview/shared-components 0.0.4806 → 0.0.4991
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 +72 -2
- package/dist/ListAreaService-8vnw7uAP.js +68 -0
- package/dist/assets/ContextMenu.css +1 -0
- package/dist/assets/InfoGroup.css +1 -0
- package/dist/assets/ListAreaService.css +1 -1
- package/dist/components/BaseView/BaseView.test.js +1 -1
- package/dist/components/BasicHeading/BasicHeading.test.js +1 -1
- package/dist/components/BlockView/BlockView.test.js +1 -1
- package/dist/components/ContextMenu/ContextMenu.d.ts +27 -0
- package/dist/components/ContextMenu/ContextMenu.js +40 -0
- package/dist/components/ContextMenu/ContextMenu.test.d.ts +1 -0
- package/dist/components/ContextMenu/ContextMenu.test.js +22 -0
- package/dist/components/DeleteModal/DeleteModal.test.js +1 -1
- package/dist/components/Disclaimer/Disclaimer.test.js +1 -1
- package/dist/components/EmptyView/EmptyView.test.js +1 -1
- package/dist/components/FormComponents/FormCheckBox/FormCheckBox.test.js +1 -1
- package/dist/components/FormComponents/FormDatePicker/FormDatePicker.d.ts +10 -8
- package/dist/components/FormComponents/FormDatePicker/FormDatePicker.js +53 -60
- package/dist/components/FormComponents/FormDatePicker/FormDatePicker.test.js +16 -16
- package/dist/components/FormComponents/FormRadio/FormRadio.test.js +1 -1
- package/dist/components/FormComponents/FormSelect/FormSelect.d.ts +12 -9
- package/dist/components/FormComponents/FormSelect/FormSelect.js +68 -56
- package/dist/components/FormComponents/FormSelect/FormSelect.test.js +10 -9
- package/dist/components/FormComponents/FormSlider/FormSlider.test.js +1 -1
- package/dist/components/FormComponents/FormText/FormText.test.js +1 -1
- package/dist/components/HashTabView/HashTabView.test.js +1 -1
- package/dist/components/HeaderFilter/HeaderFilter.test.js +1 -1
- package/dist/components/Iconify/Iconify.test.js +1 -1
- package/dist/components/InfoGroup/InfoGroup.d.ts +53 -0
- package/dist/components/InfoGroup/InfoGroup.js +60 -0
- package/dist/components/InfoGroup/InfoGroup.test.d.ts +1 -0
- package/dist/components/InfoGroup/InfoGroup.test.js +40 -0
- package/dist/components/ListArea/ListArea.js +1 -1
- package/dist/components/ListArea/ListArea.test.js +2 -2
- package/dist/components/ListArea/ListAreaService.d.ts +2 -0
- package/dist/components/ListArea/ListAreaService.js +1 -1
- package/dist/components/Scrollbar/scrollbar.test.js +1 -1
- package/dist/components/SearchBar/SearchBar.test.js +1 -1
- package/dist/components/VerticalDivider/VerticalDivider.test.js +1 -1
- package/dist/main.d.ts +4 -1
- package/dist/main.js +45 -41
- package/dist/{react.esm-BeDwcQWb.js → react.esm-C0LtovhP.js} +2 -1
- package/dist/types/ListElement.d.ts +4 -0
- package/package.json +1 -1
- package/dist/ListAreaService-BPp_O2BH.js +0 -67
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import {
|
|
2
|
+
import { SelectProps } from '@element/react-components';
|
|
3
|
+
import { FieldPath, FieldValues, Path, RegisterOptions } from 'react-hook-form';
|
|
3
4
|
/**
|
|
4
5
|
* a generic FormSelector property type. the generic T represents the interface, which is used in the form, like {@link CreateOrganizationDto}
|
|
5
6
|
*/
|
|
6
|
-
type FormSelectProps<T extends FieldValues> = {
|
|
7
|
+
type FormSelectProps<T extends FieldValues> = Omit<SelectProps, 'className' | 'clearable' | 'disabled' | 'helperText' | 'helperTextPersistent' | 'hidden' | 'hoisted' | 'label' | 'menuMaxHeight' | 'multi' | 'multiSelect' | 'noOptionsMessage' | 'onChange' | 'options' | 'searchable' | 'textKey' | 'valid' | 'value' | 'valueKey' | 'variant'> & {
|
|
7
8
|
/** the current character count */
|
|
8
9
|
propertyName: Path<T>;
|
|
9
10
|
/** the label of the select */
|
|
@@ -12,10 +13,6 @@ type FormSelectProps<T extends FieldValues> = {
|
|
|
12
13
|
disabled?: boolean;
|
|
13
14
|
/** if the select should be hidden */
|
|
14
15
|
hidden?: boolean;
|
|
15
|
-
/** if the select is required */
|
|
16
|
-
required?: boolean;
|
|
17
|
-
/** the text which is shown if the select is required and not filled */
|
|
18
|
-
requiredText?: string;
|
|
19
16
|
/** if true the select dropdown is rendered outside of the parent. Useful for when the select needs to render in a parent with "overflow: hidden" and the dropdown will cut on the component border. */
|
|
20
17
|
hoisted?: boolean;
|
|
21
18
|
/** the key of the value attribute of the select, default: value */
|
|
@@ -30,6 +27,13 @@ type FormSelectProps<T extends FieldValues> = {
|
|
|
30
27
|
clearable?: boolean;
|
|
31
28
|
/** a message if no options a present */
|
|
32
29
|
noOptionsMessage?: string;
|
|
30
|
+
/**
|
|
31
|
+
* the rules for the picker
|
|
32
|
+
* @default undefined
|
|
33
|
+
* @example { required: { value: true, message: 'This field is required' } }
|
|
34
|
+
* @example { validate: (value) => value === 'admin' }
|
|
35
|
+
*/
|
|
36
|
+
rules?: Omit<RegisterOptions<T, FieldPath<T>>, 'disabled' | 'valueAsNumber' | 'valueAsDate' | 'setValueAs'> | undefined;
|
|
33
37
|
};
|
|
34
38
|
/**
|
|
35
39
|
* the base option type of the selector, you can also use your own custom objects, by defining the {@link FormSelectProps} valueKey and textKey
|
|
@@ -50,12 +54,11 @@ export type FormSelectOption = {
|
|
|
50
54
|
* @param options the options of the select
|
|
51
55
|
* @param noOptionsMessage a message if no options a present
|
|
52
56
|
* @param propertyName the name of the property in the form
|
|
53
|
-
* @param required if the select is required
|
|
54
|
-
* @param requiredText the text which is shown if the select is required and not filled
|
|
55
57
|
* @param textKey the key of the text attribute of the select, default: text
|
|
56
58
|
* @param valueKey the key of the value attribute of the select, default: value
|
|
59
|
+
* @param rules the rules for the select example _{ required: { value: true, message: 'This field is required' } }_
|
|
57
60
|
*
|
|
58
61
|
* @returns
|
|
59
62
|
*/
|
|
60
|
-
export declare const FormSelect: <T extends FieldValues>({ propertyName, label,
|
|
63
|
+
export declare const FormSelect: <T extends FieldValues>({ propertyName, label, options, multi, disabled, hoisted, hidden, valueKey, textKey, clearable, noOptionsMessage, rules, ...props }: FormSelectProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
61
64
|
export {};
|
|
@@ -1,73 +1,85 @@
|
|
|
1
1
|
import "../../../assets/FormSelect.css";
|
|
2
|
-
import { jsx as
|
|
2
|
+
import { jsx as i, Fragment as I } from "react/jsx-runtime";
|
|
3
3
|
import { Select as P } from "@element/react-components";
|
|
4
|
-
import { g as
|
|
5
|
-
import {
|
|
6
|
-
import { useFormContext as
|
|
7
|
-
const
|
|
8
|
-
invalid:
|
|
9
|
-
formSelect:
|
|
10
|
-
formSelectContainer:
|
|
11
|
-
},
|
|
12
|
-
propertyName:
|
|
13
|
-
label:
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
multi: s = !1,
|
|
18
|
-
disabled: x = !1,
|
|
4
|
+
import { g as V } from "../../../get-Dyz8NMrE.js";
|
|
5
|
+
import { useMemo as m } from "react";
|
|
6
|
+
import { useFormContext as k, Controller as _ } from "react-hook-form";
|
|
7
|
+
const w = "_invalid_1vo1h_1", z = "_formSelect_1vo1h_5", A = "_formSelectContainer_1vo1h_9", d = {
|
|
8
|
+
invalid: w,
|
|
9
|
+
formSelect: z,
|
|
10
|
+
formSelectContainer: A
|
|
11
|
+
}, Q = ({
|
|
12
|
+
propertyName: r,
|
|
13
|
+
label: g,
|
|
14
|
+
options: s,
|
|
15
|
+
multi: l = !1,
|
|
16
|
+
disabled: h = !1,
|
|
19
17
|
hoisted: v = !1,
|
|
20
18
|
hidden: C = !1,
|
|
21
|
-
valueKey:
|
|
22
|
-
textKey:
|
|
23
|
-
clearable:
|
|
24
|
-
noOptionsMessage:
|
|
19
|
+
valueKey: t = "value",
|
|
20
|
+
textKey: q = "text",
|
|
21
|
+
clearable: T = !1,
|
|
22
|
+
noOptionsMessage: F = "",
|
|
23
|
+
rules: n,
|
|
24
|
+
...H
|
|
25
25
|
}) => {
|
|
26
26
|
const {
|
|
27
|
-
control:
|
|
28
|
-
formState: { errors:
|
|
29
|
-
} =
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
27
|
+
control: u,
|
|
28
|
+
formState: { errors: o, isValidating: S }
|
|
29
|
+
} = k(), c = m(
|
|
30
|
+
() => !S && V(o, r) !== void 0,
|
|
31
|
+
[o, r, S]
|
|
32
|
+
), M = m(
|
|
33
|
+
() => n?.required?.value,
|
|
34
|
+
[n]
|
|
35
|
+
), $ = m(
|
|
36
|
+
() => n?.required?.message,
|
|
37
|
+
[n]
|
|
38
|
+
), b = () => {
|
|
39
|
+
if (o && o[r]) {
|
|
40
|
+
const a = o[r]?.message;
|
|
41
|
+
return a || "Invalid input";
|
|
42
|
+
}
|
|
43
|
+
return $;
|
|
44
|
+
};
|
|
45
|
+
return C ? /* @__PURE__ */ i(_, { name: r, control: u, render: () => /* @__PURE__ */ i(I, {}) }) : /* @__PURE__ */ i("div", { className: d.formSelectContainer, children: /* @__PURE__ */ i(
|
|
46
|
+
_,
|
|
34
47
|
{
|
|
35
|
-
name:
|
|
36
|
-
rules:
|
|
37
|
-
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
) : l?.find((e) => e[r] === d);
|
|
44
|
-
return /* @__PURE__ */ o(
|
|
48
|
+
name: r,
|
|
49
|
+
rules: n,
|
|
50
|
+
control: u,
|
|
51
|
+
render: ({ field: { ref: a, onChange: f, value: x, ...j } }) => {
|
|
52
|
+
const p = l ? s?.filter(
|
|
53
|
+
(e) => x?.includes(e[t])
|
|
54
|
+
) : s?.find((e) => e[t] === x);
|
|
55
|
+
return /* @__PURE__ */ i(
|
|
45
56
|
P,
|
|
46
57
|
{
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
58
|
+
...j,
|
|
59
|
+
...H,
|
|
60
|
+
value: p,
|
|
61
|
+
label: g,
|
|
50
62
|
variant: "outlined",
|
|
51
|
-
helperText:
|
|
52
|
-
helperTextPersistent: c,
|
|
53
|
-
options:
|
|
54
|
-
valid:
|
|
55
|
-
multiSelect:
|
|
56
|
-
className: `${
|
|
57
|
-
disabled:
|
|
58
|
-
valueKey:
|
|
59
|
-
textKey:
|
|
63
|
+
helperText: b(),
|
|
64
|
+
helperTextPersistent: M || c,
|
|
65
|
+
options: s,
|
|
66
|
+
valid: !c,
|
|
67
|
+
multiSelect: l,
|
|
68
|
+
className: `${d.formSelect} ${c ? d.invalid : ""}`,
|
|
69
|
+
disabled: h,
|
|
70
|
+
valueKey: t,
|
|
71
|
+
textKey: q,
|
|
60
72
|
onChange: (e) => {
|
|
61
73
|
if (e == null)
|
|
62
|
-
return
|
|
63
|
-
if (
|
|
64
|
-
return
|
|
65
|
-
|
|
74
|
+
return f(e);
|
|
75
|
+
if (l)
|
|
76
|
+
return f(e.map((E) => E[t]));
|
|
77
|
+
f(e[t]);
|
|
66
78
|
},
|
|
67
79
|
hoisted: v,
|
|
68
|
-
noOptionsMessage:
|
|
80
|
+
noOptionsMessage: F,
|
|
69
81
|
searchable: !0,
|
|
70
|
-
clearable:
|
|
82
|
+
clearable: T,
|
|
71
83
|
menuMaxHeight: "15rem"
|
|
72
84
|
}
|
|
73
85
|
);
|
|
@@ -76,5 +88,5 @@ const A = "_invalid_1vo1h_1", B = "_formSelect_1vo1h_5", D = "_formSelectContain
|
|
|
76
88
|
) });
|
|
77
89
|
};
|
|
78
90
|
export {
|
|
79
|
-
|
|
91
|
+
Q as FormSelect
|
|
80
92
|
};
|
|
@@ -1,14 +1,16 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { r as
|
|
1
|
+
import { jsx as s } from "react/jsx-runtime";
|
|
2
|
+
import { r as a, s as r } from "../../../react.esm-C0LtovhP.js";
|
|
3
3
|
import { FormSelect as c } from "./FormSelect.js";
|
|
4
4
|
import { v as e, d as l, t as u, g as t } from "../../../vi.JYQecGiw-BbUbJcT8.js";
|
|
5
|
-
const
|
|
5
|
+
const m = e.fn();
|
|
6
6
|
e.mock("react-hook-form", () => ({
|
|
7
7
|
...e.importActual("react-hook-form"),
|
|
8
|
-
Controller: ({
|
|
8
|
+
Controller: ({
|
|
9
|
+
render: o
|
|
10
|
+
}) => o({
|
|
9
11
|
field: {
|
|
10
12
|
ref: void 0,
|
|
11
|
-
onChange:
|
|
13
|
+
onChange: m,
|
|
12
14
|
value: "3"
|
|
13
15
|
}
|
|
14
16
|
}),
|
|
@@ -45,13 +47,12 @@ l("FormSelect Test", () => {
|
|
|
45
47
|
{ id: "3", value: "Afar", description: "" }
|
|
46
48
|
];
|
|
47
49
|
u("render FormSelect", () => {
|
|
48
|
-
|
|
49
|
-
/* @__PURE__ */
|
|
50
|
+
a(
|
|
51
|
+
/* @__PURE__ */ s(
|
|
50
52
|
c,
|
|
51
53
|
{
|
|
52
54
|
label: "address.country",
|
|
53
|
-
required: !0,
|
|
54
|
-
requiredText: "required",
|
|
55
|
+
rules: { required: { value: !0, message: "required" } },
|
|
55
56
|
propertyName: "countryId",
|
|
56
57
|
options: o,
|
|
57
58
|
valueKey: "id",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as s } from "react/jsx-runtime";
|
|
2
|
-
import { r as a, s as n } from "../../../react.esm-
|
|
2
|
+
import { r as a, s as n } from "../../../react.esm-C0LtovhP.js";
|
|
3
3
|
import { FormSlider as l } from "./FormSlider.js";
|
|
4
4
|
import { v as e, d as m, t as i, g as r } from "../../../vi.JYQecGiw-BbUbJcT8.js";
|
|
5
5
|
const o = e.fn();
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as n } from "react/jsx-runtime";
|
|
2
|
-
import { r as s, s as r, f as d } from "../../../react.esm-
|
|
2
|
+
import { r as s, s as r, f as d } from "../../../react.esm-C0LtovhP.js";
|
|
3
3
|
import { FormText as l } from "./FormText.js";
|
|
4
4
|
import { v as a, d as i, t as o, g as t } from "../../../vi.JYQecGiw-BbUbJcT8.js";
|
|
5
5
|
const m = a.fn();
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as n, Fragment as o } from "react/jsx-runtime";
|
|
2
|
-
import { r as a, s as e, f as r } from "../../react.esm-
|
|
2
|
+
import { r as a, s as e, f as r } from "../../react.esm-C0LtovhP.js";
|
|
3
3
|
import { HashTabView as c } from "./HashTabView.js";
|
|
4
4
|
import { d as h, t as l, g as t } from "../../vi.JYQecGiw-BbUbJcT8.js";
|
|
5
5
|
const m = [
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as n } from "react/jsx-runtime";
|
|
2
|
-
import { r as i, s as t, f as T } from "../../react.esm-
|
|
2
|
+
import { r as i, s as t, f as T } from "../../react.esm-C0LtovhP.js";
|
|
3
3
|
import { HeaderFilter as s } from "./HeaderFilter.js";
|
|
4
4
|
import { d as c, t as o, v as l, g as e } from "../../vi.JYQecGiw-BbUbJcT8.js";
|
|
5
5
|
c("HeaderFilter-Test", () => {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as n } from "react/jsx-runtime";
|
|
2
2
|
import { Iconify as c } from "./Iconify.js";
|
|
3
3
|
import { AvailableCustomIcons as d } from "../../enums/AvailableCustomIcons.js";
|
|
4
|
-
import { r, s as i } from "../../react.esm-
|
|
4
|
+
import { r, s as i } from "../../react.esm-C0LtovhP.js";
|
|
5
5
|
import { d as l, t as s, g as o } from "../../vi.JYQecGiw-BbUbJcT8.js";
|
|
6
6
|
l("Iconify Test", () => {
|
|
7
7
|
const m = Object.keys(d).filter((e) => isNaN(Number(e)));
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import React, { ReactNode } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* FieldItem type that defines the structure of the fields to render in the InfoGroup component
|
|
4
|
+
*/
|
|
5
|
+
export type FieldItem = {
|
|
6
|
+
/**
|
|
7
|
+
* Label for the Textfield
|
|
8
|
+
*/
|
|
9
|
+
label?: string;
|
|
10
|
+
/**
|
|
11
|
+
* Current value of the Textfield
|
|
12
|
+
*/
|
|
13
|
+
value?: string;
|
|
14
|
+
/**
|
|
15
|
+
* ThemeColor for the Textfield (default: none)
|
|
16
|
+
*/
|
|
17
|
+
themeColor?: 'primary' | 'secondary' | 'error' | 'text-primary-on-background' | 'text-secondary-on-background' | 'text-hint-on-background' | 'text-disabled-on-background' | 'text-icon-on-background' | 'text-primary-on-light' | 'text-secondary-on-light' | 'text-hint-on-light' | 'text-disabled-on-light' | 'text-icon-on-light';
|
|
18
|
+
/**
|
|
19
|
+
* Variant of the component (default: default) - embedded will render the component without any padding or border
|
|
20
|
+
*/
|
|
21
|
+
variant?: 'default' | 'embedded';
|
|
22
|
+
/**
|
|
23
|
+
* Optional component to render instead of Textfields
|
|
24
|
+
*/
|
|
25
|
+
component?: ReactNode;
|
|
26
|
+
};
|
|
27
|
+
/**
|
|
28
|
+
* Props for the InfoGroup component that defines the fields to render
|
|
29
|
+
*/
|
|
30
|
+
interface InfoGroupProps {
|
|
31
|
+
/**
|
|
32
|
+
* Array of fields to render in the InfoGroup
|
|
33
|
+
*/
|
|
34
|
+
fields: FieldItem[] | FieldItem[][];
|
|
35
|
+
/**
|
|
36
|
+
* If true, the values will be bold
|
|
37
|
+
*/
|
|
38
|
+
bold?: boolean;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Provides a Text-Info component that displays a set of fields in a grid
|
|
42
|
+
* @prop {FieldItem[]|FieldItem[][]} fields - Array of fields to render in the InfoGroup.
|
|
43
|
+
* If fields is a 2D array, it will render multiple rows of fields in a vertical layout
|
|
44
|
+
* @prop {boolean} bold - If true, the values will be bold
|
|
45
|
+
* @example
|
|
46
|
+
* const fields = [
|
|
47
|
+
* { label: 'organization.create.registration-number', value: '123' },
|
|
48
|
+
* { label: 'myOrganizations.label-primary-contact', value: 'User A' },
|
|
49
|
+
* { label: 'myOrganizations.label-contact', value: 'User B' },
|
|
50
|
+
* ];
|
|
51
|
+
*/
|
|
52
|
+
export declare const InfoGroup: React.FC<InfoGroupProps>;
|
|
53
|
+
export {};
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import "../../assets/InfoGroup.css";
|
|
2
|
+
import { jsxs as m, Fragment as s, jsx as t } from "react/jsx-runtime";
|
|
3
|
+
import { Divider as p, Group as d, TypoCaption as u, TypoSubtitle as v } from "@element/react-components";
|
|
4
|
+
import { a as h } from "../../useBreakpoint-DROHPVxO.js";
|
|
5
|
+
import { VerticalDivider as _ } from "../VerticalDivider/VerticalDivider.js";
|
|
6
|
+
const y = "_container_7ypbj_1", C = "_dividerContainer_7ypbj_10", b = "_mainGroup_7ypbj_16", j = "_row_7ypbj_21", N = "_component_7ypbj_51", g = "_componentContainer_7ypbj_84", w = "_field_7ypbj_92", e = {
|
|
7
|
+
container: y,
|
|
8
|
+
dividerContainer: C,
|
|
9
|
+
mainGroup: b,
|
|
10
|
+
row: j,
|
|
11
|
+
component: N,
|
|
12
|
+
componentContainer: g,
|
|
13
|
+
field: w
|
|
14
|
+
}, S = ({ fields: n, bold: o }) => {
|
|
15
|
+
const a = n.length > 1 && Array.isArray(n.at(0)) ? n.map((c, r) => /* @__PURE__ */ m(s, { children: [
|
|
16
|
+
r != 0 && /* @__PURE__ */ t("div", { "data-testid": "test-divider", className: e.dividerContainer, children: /* @__PURE__ */ t(p, {}) }),
|
|
17
|
+
/* @__PURE__ */ t(l, { fields: c, bold: o }, `row${r}`)
|
|
18
|
+
] })) : /* @__PURE__ */ t(l, { fields: n, bold: o });
|
|
19
|
+
return /* @__PURE__ */ t(d, { direction: "vertical", fullWidth: !0, className: e.mainGroup, children: a });
|
|
20
|
+
}, l = ({ fields: n, bold: o }) => {
|
|
21
|
+
const { isLg: i } = h();
|
|
22
|
+
return /* @__PURE__ */ t(
|
|
23
|
+
d,
|
|
24
|
+
{
|
|
25
|
+
direction: i ? "horizontal" : "vertical",
|
|
26
|
+
className: e.row,
|
|
27
|
+
fullWidth: !0,
|
|
28
|
+
primaryAlign: "center",
|
|
29
|
+
secondaryAlign: "center",
|
|
30
|
+
children: n.map((a, c) => {
|
|
31
|
+
const r = i ? /* @__PURE__ */ t(_, { className: e.divider, height: "3rem" }) : /* @__PURE__ */ t(p, {});
|
|
32
|
+
return /* @__PURE__ */ m(s, { children: [
|
|
33
|
+
c != 0 && r,
|
|
34
|
+
/* @__PURE__ */ t(G, { field: a, bold: o })
|
|
35
|
+
] });
|
|
36
|
+
})
|
|
37
|
+
}
|
|
38
|
+
);
|
|
39
|
+
}, G = ({ field: n, bold: o }) => {
|
|
40
|
+
if (n.variant || (n.variant = "default"), !n.component || n.variant === "embedded")
|
|
41
|
+
return /* @__PURE__ */ m("div", { className: e.field, "data-testid": "infoGroupItem", children: [
|
|
42
|
+
/* @__PURE__ */ t(u, { className: e.label, themeColor: "text-hint-on-light", children: n.label }),
|
|
43
|
+
n.value ? /* @__PURE__ */ t(
|
|
44
|
+
v,
|
|
45
|
+
{
|
|
46
|
+
level: 1,
|
|
47
|
+
"data-testid": "infoGroupValue",
|
|
48
|
+
className: e.value,
|
|
49
|
+
themeColor: n.themeColor,
|
|
50
|
+
bold: o,
|
|
51
|
+
children: n.value
|
|
52
|
+
}
|
|
53
|
+
) : /* @__PURE__ */ t(s, { children: n.component })
|
|
54
|
+
] });
|
|
55
|
+
if (n.component && n.variant === "default")
|
|
56
|
+
return /* @__PURE__ */ t("div", { className: e.componentContainer, children: /* @__PURE__ */ t("div", { className: e.component, children: n.component }) });
|
|
57
|
+
};
|
|
58
|
+
export {
|
|
59
|
+
S as InfoGroup
|
|
60
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { r as l, s as t } from "../../react.esm-C0LtovhP.js";
|
|
3
|
+
import { InfoGroup as r } from "./InfoGroup.js";
|
|
4
|
+
import { d as s, t as i, g as e } from "../../vi.JYQecGiw-BbUbJcT8.js";
|
|
5
|
+
s("InfoGroup Test", () => {
|
|
6
|
+
i("render Single InfoGroup", () => {
|
|
7
|
+
l(/* @__PURE__ */ o(r, { fields: m }));
|
|
8
|
+
const a = t.getAllByTestId("infoGroupItem");
|
|
9
|
+
e(a.length).toBe(3);
|
|
10
|
+
const n = t.getAllByTestId("infoGroupValue");
|
|
11
|
+
e(a.length).toBe(3), e(t.getByText("organization.create.registration-number")).toBeInTheDocument(), e(n[0]).toHaveTextContent("123"), e(t.getByText("myOrganizations.label-primary-contact")).toBeInTheDocument(), e(n[1]).toHaveTextContent("User A"), e(t.getByText("myOrganizations.label-contact")).toBeInTheDocument(), e(n[2]).toHaveTextContent("User B");
|
|
12
|
+
}), i("render Multi InfoGroup", () => {
|
|
13
|
+
l(/* @__PURE__ */ o(r, { fields: [
|
|
14
|
+
[
|
|
15
|
+
{ label: "organization.create.registration-number", value: "123" },
|
|
16
|
+
{ label: "myOrganizations.label-primary-contact", value: "User A" }
|
|
17
|
+
],
|
|
18
|
+
[
|
|
19
|
+
{ label: "myOrganizations.label-contact", value: "User B" },
|
|
20
|
+
{
|
|
21
|
+
label: "organization.something-else",
|
|
22
|
+
value: "some"
|
|
23
|
+
}
|
|
24
|
+
]
|
|
25
|
+
] }));
|
|
26
|
+
const n = t.getAllByTestId("infoGroupValue");
|
|
27
|
+
e(n.length).toBe(4), e(t.getByText("organization.create.registration-number")).toBeInTheDocument(), e(n[0]).toHaveTextContent("123"), e(t.getByText("myOrganizations.label-primary-contact")).toBeInTheDocument(), e(n[1]).toHaveTextContent("User A"), e(t.getByTestId("test-divider")).toBeInTheDocument(), e(t.getByText("myOrganizations.label-contact")).toBeInTheDocument(), e(n[2]).toHaveTextContent("User B"), e(t.getByText("organization.something-else")).toBeInTheDocument(), e(n[3]).toHaveTextContent("some");
|
|
28
|
+
}), i("render Single InfoGroup with component", () => {
|
|
29
|
+
l(/* @__PURE__ */ o(r, { fields: [
|
|
30
|
+
{ label: "labelSouldntBeRendered", component: /* @__PURE__ */ o("div", { children: "Component" }) },
|
|
31
|
+
{ label: "myOrganizations.label-primary-contact", value: "User A" },
|
|
32
|
+
{ label: "componentWithLabel", variant: "embedded", component: /* @__PURE__ */ o("div", { children: "Badge" }) }
|
|
33
|
+
] })), e(t.queryByText("labelSouldntBeRendered")).toBeNull(), e(t.getByText("Component")).toBeInTheDocument(), e(t.getByText("myOrganizations.label-primary-contact")).toBeInTheDocument(), e(t.getByText("User A")).toBeInTheDocument(), e(t.getByText("componentWithLabel")).toBeInTheDocument(), e(t.getByText("Badge")).toBeInTheDocument();
|
|
34
|
+
});
|
|
35
|
+
});
|
|
36
|
+
const m = [
|
|
37
|
+
{ label: "organization.create.registration-number", value: "123" },
|
|
38
|
+
{ label: "myOrganizations.label-primary-contact", value: "User A" },
|
|
39
|
+
{ label: "myOrganizations.label-contact", value: "User B" }
|
|
40
|
+
];
|
|
@@ -4,7 +4,7 @@ import { g as Hr } from "../../_commonjsHelpers-CT_km90n.js";
|
|
|
4
4
|
import { _ as H, a as Tr, b as wr, c as T, d as Nr, e as Wr, i as h, f as N, h as B, j as Xr, k as zr, l as I, m as Yr, n as Zr, o as Jr, p as W, q as Qr, r as Or, s as Pr, t as kr, u as Vr } from "../../get-Dyz8NMrE.js";
|
|
5
5
|
import { useState as re, useMemo as k } from "react";
|
|
6
6
|
import { SearchBar as ee } from "../SearchBar/SearchBar.js";
|
|
7
|
-
import { g as ae, a as te, s as m } from "../../ListAreaService-
|
|
7
|
+
import { g as ae, a as te, s as m } from "../../ListAreaService-8vnw7uAP.js";
|
|
8
8
|
var ne = H;
|
|
9
9
|
function se() {
|
|
10
10
|
this.__data__ = new ne(), this.size = 0;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx as r, Fragment as i } from "react/jsx-runtime";
|
|
2
2
|
import { TypoButton as p } from "@element/react-components";
|
|
3
|
-
import { r as s, s as a, f as u } from "../../react.esm-
|
|
3
|
+
import { r as s, s as a, f as u } from "../../react.esm-C0LtovhP.js";
|
|
4
4
|
import { ListArea as c } from "./ListArea.js";
|
|
5
|
-
import { g as h } from "../../ListAreaService-
|
|
5
|
+
import { g as h } from "../../ListAreaService-8vnw7uAP.js";
|
|
6
6
|
import { d as m, t as n, g as t } from "../../vi.JYQecGiw-BbUbJcT8.js";
|
|
7
7
|
m("ListArea Test", () => {
|
|
8
8
|
const o = [
|
|
@@ -24,6 +24,7 @@ export declare const getListedItems: (items: ListElement[], pathname: string, it
|
|
|
24
24
|
select: boolean;
|
|
25
25
|
primaryText: import("react/jsx-runtime").JSX.Element;
|
|
26
26
|
secondaryText: import("react/jsx-runtime").JSX.Element | undefined;
|
|
27
|
+
overlineText: string | undefined;
|
|
27
28
|
trailingBlock: string | number | boolean | import("react/jsx-runtime").JSX.Element | Iterable<import("react").ReactNode>;
|
|
28
29
|
leadingBlock: string | import("react/jsx-runtime").JSX.Element | undefined;
|
|
29
30
|
nonInteractive: boolean | undefined;
|
|
@@ -49,6 +50,7 @@ export declare const mapListElement: (element: ListElement, pathname: string | u
|
|
|
49
50
|
select: boolean;
|
|
50
51
|
primaryText: import("react/jsx-runtime").JSX.Element;
|
|
51
52
|
secondaryText: import("react/jsx-runtime").JSX.Element | undefined;
|
|
53
|
+
overlineText: string | undefined;
|
|
52
54
|
trailingBlock: string | number | boolean | import("react/jsx-runtime").JSX.Element | Iterable<import("react").ReactNode>;
|
|
53
55
|
leadingBlock: string | import("react/jsx-runtime").JSX.Element | undefined;
|
|
54
56
|
nonInteractive: boolean | undefined;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "react/jsx-runtime";
|
|
2
2
|
import "@element/react-components";
|
|
3
3
|
import "../Iconify/Iconify.js";
|
|
4
|
-
import { g as s, a as i, m as a } from "../../ListAreaService-
|
|
4
|
+
import { g as s, a as i, m as a } from "../../ListAreaService-8vnw7uAP.js";
|
|
5
5
|
import "../../enums/AvailableCustomIcons.js";
|
|
6
6
|
export {
|
|
7
7
|
s as getGroupedItems,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as s } from "react/jsx-runtime";
|
|
2
|
-
import { r as e, s as t } from "../../react.esm-
|
|
2
|
+
import { r as e, s as t } from "../../react.esm-C0LtovhP.js";
|
|
3
3
|
import { ScrollbarY as d, ScrollbarX as l } from "./Scrollbar.js";
|
|
4
4
|
import { d as c, t as a, g as o } from "../../vi.JYQecGiw-BbUbJcT8.js";
|
|
5
5
|
c("Scrollbar", () => {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as a } from "react/jsx-runtime";
|
|
2
|
-
import { r, s as t, f as h, a as l } from "../../react.esm-
|
|
2
|
+
import { r, s as t, f as h, a as l } from "../../react.esm-C0LtovhP.js";
|
|
3
3
|
import { SearchBar as s } from "./SearchBar.js";
|
|
4
4
|
import { d as m, t as o, v as n, g as e } from "../../vi.JYQecGiw-BbUbJcT8.js";
|
|
5
5
|
m("SearchBar Test", () => {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as e } from "react/jsx-runtime";
|
|
2
|
-
import { r } from "../../react.esm-
|
|
2
|
+
import { r } from "../../react.esm-C0LtovhP.js";
|
|
3
3
|
import { VerticalDivider as s } from "./VerticalDivider.js";
|
|
4
4
|
import { d as o, t as l, g as i } from "../../vi.JYQecGiw-BbUbJcT8.js";
|
|
5
5
|
o("VerticalDivider Test", () => {
|
package/dist/main.d.ts
CHANGED
|
@@ -2,12 +2,14 @@ import './styles/main.css';
|
|
|
2
2
|
export { BaseView } from './components/BaseView/BaseView';
|
|
3
3
|
export { BasicHeading } from './components/BasicHeading/BasicHeading';
|
|
4
4
|
export { BlockView } from './components/BlockView/BlockView';
|
|
5
|
+
export { ContextMenu } from './components/ContextMenu/ContextMenu';
|
|
5
6
|
export { DeleteModal } from './components/DeleteModal/DeleteModal';
|
|
6
7
|
export { Disclaimer } from './components/Disclaimer/Disclaimer';
|
|
7
8
|
export { EmptyView } from './components/EmptyView/EmptyView';
|
|
8
9
|
export { HashTabView } from './components/HashTabView/HashTabView';
|
|
9
10
|
export { HeaderFilter } from './components/HeaderFilter/HeaderFilter';
|
|
10
11
|
export { Iconify } from './components/Iconify/Iconify';
|
|
12
|
+
export { InfoGroup } from './components/InfoGroup/InfoGroup';
|
|
11
13
|
export { ListArea } from './components/ListArea/ListArea';
|
|
12
14
|
export { ScrollbarX, ScrollbarY } from './components/Scrollbar/Scrollbar';
|
|
13
15
|
export { SearchBar } from './components/SearchBar/SearchBar';
|
|
@@ -21,5 +23,6 @@ export { FormText } from './components/FormComponents/FormText/FormText';
|
|
|
21
23
|
export { AvailableCustomIcons } from './enums/AvailableCustomIcons';
|
|
22
24
|
export { useBreakpoints } from './hooks/useBreakpoint';
|
|
23
25
|
export { capitalizeFirstLetters } from './services/UtilService';
|
|
24
|
-
export type {
|
|
26
|
+
export type { FieldItem } from './components/InfoGroup/InfoGroup';
|
|
25
27
|
export type { HashTab } from './types/HashTab';
|
|
28
|
+
export type { ListElement, BaseListElement } from './types/ListElement';
|