tycho-components 0.6.10 → 0.6.11
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/AppForm/AppFormInfo.d.ts +9 -0
- package/dist/AppForm/AppFormInfo.js +11 -0
- package/dist/AppForm/FormField.d.ts +23 -0
- package/dist/AppForm/FormField.js +1 -0
- package/dist/AppForm/index.d.ts +2 -0
- package/dist/AppForm/index.js +2 -0
- package/dist/AppForm/style.scss +25 -0
- package/dist/configs/Localization.d.ts +3 -0
- package/dist/configs/localization/CommonTexts.d.ts +3 -0
- package/dist/configs/localization/CommonTexts.js +3 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { FormField } from './FormField';
|
|
2
|
+
import './style.scss';
|
|
3
|
+
type Props = {
|
|
4
|
+
fields: FormField[];
|
|
5
|
+
data: Record<string, any>;
|
|
6
|
+
prefix?: string;
|
|
7
|
+
};
|
|
8
|
+
export default function AppFormInfo({ fields, data }: Props): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useTranslation } from 'react-i18next';
|
|
3
|
+
import './style.scss';
|
|
4
|
+
export default function AppFormInfo({ fields, data }) {
|
|
5
|
+
const { t } = useTranslation('common');
|
|
6
|
+
return (_jsx("div", { className: "app-form-info-container", children: fields.map((field, idx) => {
|
|
7
|
+
return (_jsxs("div", { className: "item", children: [_jsxs("span", { className: "label", children: [field.name, ":"] }), _jsx("span", { className: "value", children: field.display
|
|
8
|
+
? field.display(data[field.attr])
|
|
9
|
+
: data[field.attr] || t('label.notavailable') })] }, idx));
|
|
10
|
+
}) }));
|
|
11
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { SelectItem } from 'tycho-storybook';
|
|
2
|
+
export type DisplayFunction = (value: any) => string;
|
|
3
|
+
export type MaskFunction = (value: string, isBlur?: boolean) => string;
|
|
4
|
+
export type FormField = {
|
|
5
|
+
attr: string;
|
|
6
|
+
name: string;
|
|
7
|
+
title?: string;
|
|
8
|
+
type: string;
|
|
9
|
+
required?: boolean;
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
options?: SelectItem[];
|
|
12
|
+
tooltip?: boolean;
|
|
13
|
+
default?: string | boolean | number;
|
|
14
|
+
role?: string;
|
|
15
|
+
fn?: (value: any) => string | number;
|
|
16
|
+
translation?: string;
|
|
17
|
+
mask?: MaskFunction;
|
|
18
|
+
blurMask?: MaskFunction;
|
|
19
|
+
pattern?: string;
|
|
20
|
+
rows?: number;
|
|
21
|
+
size?: 'medium' | 'small';
|
|
22
|
+
display?: DisplayFunction;
|
|
23
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
.app-form-info-container {
|
|
2
|
+
display: flex;
|
|
3
|
+
flex-direction: column;
|
|
4
|
+
gap: 8px;
|
|
5
|
+
|
|
6
|
+
.item {
|
|
7
|
+
display: flex;
|
|
8
|
+
align-items: center;
|
|
9
|
+
gap: 4px;
|
|
10
|
+
|
|
11
|
+
&.full-width {
|
|
12
|
+
grid-column: 1 / -1;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.label {
|
|
16
|
+
@include label-medium-2;
|
|
17
|
+
color: var(--text-primary);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.value {
|
|
21
|
+
@include body-medium-1;
|
|
22
|
+
color: var(--text-secondary);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
@@ -61,6 +61,7 @@ export declare const commonResources: {
|
|
|
61
61
|
'button.filter': string;
|
|
62
62
|
'label.public': string;
|
|
63
63
|
'label.private': string;
|
|
64
|
+
'label.notavailable': string;
|
|
64
65
|
'select.empty': string;
|
|
65
66
|
'pagination.label.showing': string;
|
|
66
67
|
'pagination.label.results': string;
|
|
@@ -318,6 +319,7 @@ export declare const commonResources: {
|
|
|
318
319
|
'button.filter': string;
|
|
319
320
|
'label.public': string;
|
|
320
321
|
'label.private': string;
|
|
322
|
+
'label.notavailable': string;
|
|
321
323
|
'select.empty': string;
|
|
322
324
|
'pagination.label.showing': string;
|
|
323
325
|
'pagination.label.results': string;
|
|
@@ -574,6 +576,7 @@ export declare const commonResources: {
|
|
|
574
576
|
'button.filter': string;
|
|
575
577
|
'label.public': string;
|
|
576
578
|
'label.private': string;
|
|
579
|
+
'label.notavailable': string;
|
|
577
580
|
'select.empty': string;
|
|
578
581
|
'pagination.label.showing': string;
|
|
579
582
|
'pagination.label.results': string;
|
|
@@ -15,6 +15,7 @@ export declare const CommonTexts: {
|
|
|
15
15
|
'button.filter': string;
|
|
16
16
|
'label.public': string;
|
|
17
17
|
'label.private': string;
|
|
18
|
+
'label.notavailable': string;
|
|
18
19
|
'select.empty': string;
|
|
19
20
|
'pagination.label.showing': string;
|
|
20
21
|
'pagination.label.results': string;
|
|
@@ -61,6 +62,7 @@ export declare const CommonTexts: {
|
|
|
61
62
|
'button.filter': string;
|
|
62
63
|
'label.public': string;
|
|
63
64
|
'label.private': string;
|
|
65
|
+
'label.notavailable': string;
|
|
64
66
|
'select.empty': string;
|
|
65
67
|
'pagination.label.showing': string;
|
|
66
68
|
'pagination.label.results': string;
|
|
@@ -107,6 +109,7 @@ export declare const CommonTexts: {
|
|
|
107
109
|
'button.filter': string;
|
|
108
110
|
'label.public': string;
|
|
109
111
|
'label.private': string;
|
|
112
|
+
'label.notavailable': string;
|
|
110
113
|
'select.empty': string;
|
|
111
114
|
'pagination.label.showing': string;
|
|
112
115
|
'pagination.label.results': string;
|
|
@@ -15,6 +15,7 @@ export const CommonTexts = {
|
|
|
15
15
|
'button.filter': 'Filter',
|
|
16
16
|
'label.public': 'Public',
|
|
17
17
|
'label.private': 'Private',
|
|
18
|
+
'label.notavailable': 'N/A',
|
|
18
19
|
'select.empty': 'Select',
|
|
19
20
|
'pagination.label.showing': '',
|
|
20
21
|
'pagination.label.results': 'results per page',
|
|
@@ -61,6 +62,7 @@ export const CommonTexts = {
|
|
|
61
62
|
'button.filter': 'Filtrar',
|
|
62
63
|
'label.public': 'Público',
|
|
63
64
|
'label.private': 'Privado',
|
|
65
|
+
'label.notavailable': 'N/A',
|
|
64
66
|
'select.empty': 'Selecionar',
|
|
65
67
|
'pagination.label.showing': 'Exibindo',
|
|
66
68
|
'pagination.label.results': 'resultados por página',
|
|
@@ -107,6 +109,7 @@ export const CommonTexts = {
|
|
|
107
109
|
'button.filter': 'Filtra',
|
|
108
110
|
'label.public': 'Pubblico',
|
|
109
111
|
'label.private': 'Privato',
|
|
112
|
+
'label.notavailable': 'N/A',
|
|
110
113
|
'select.empty': 'Seleziona',
|
|
111
114
|
'pagination.label.showing': 'Mostrando',
|
|
112
115
|
'pagination.label.results': 'risultati per pagina',
|
package/dist/index.d.ts
CHANGED
|
@@ -7,6 +7,8 @@ export { default as AppEditable } from "./AppEditable";
|
|
|
7
7
|
export type { AppEditableField } from "./AppEditable/AppEditableField";
|
|
8
8
|
export { validateFormField } from "./AppEditable/FormField";
|
|
9
9
|
export type { FieldOperations, FormField } from "./AppEditable/FormField";
|
|
10
|
+
export { default as AppFormInfo } from "./AppForm/AppFormInfo";
|
|
11
|
+
export type { FormField as AppFormFormField } from "./AppForm/FormField";
|
|
10
12
|
export { convertEnum, convertList } from "./AppEditable/FormFieldOption";
|
|
11
13
|
export type { FormFieldOption } from "./AppEditable/FormFieldOption";
|
|
12
14
|
export { default as AppKeyboard } from "./AppKeyboard";
|
package/dist/index.js
CHANGED
|
@@ -4,6 +4,7 @@ export { default as AppColorpicker } from "./AppColorpicker";
|
|
|
4
4
|
export { default as AppDropzone } from "./AppDropzone";
|
|
5
5
|
export { default as AppEditable } from "./AppEditable";
|
|
6
6
|
export { validateFormField } from "./AppEditable/FormField";
|
|
7
|
+
export { default as AppFormInfo } from "./AppForm/AppFormInfo";
|
|
7
8
|
export { convertEnum, convertList } from "./AppEditable/FormFieldOption";
|
|
8
9
|
export { default as AppKeyboard } from "./AppKeyboard";
|
|
9
10
|
export { default as AppLoading } from "./AppLoading";
|