tycho-components 0.2.0-SNAPSHOT-24 → 0.2.0-SNAPSHOT-26
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/AppModal/AppModal.d.ts +2 -1
- package/dist/AppModal/AppModal.js +2 -2
- package/dist/TreeView/TreeView.js +2 -1
- package/dist/TreeView/style.scss +4 -0
- package/dist/TreeView/types/TreeViewExample.js +1 -0
- package/dist/configs/Localization.d.ts +3 -0
- package/dist/configs/localization/TreeTexts.d.ts +3 -0
- package/dist/configs/localization/TreeTexts.js +3 -0
- package/dist/configs/types/Struct.d.ts +1 -0
- package/package.json +1 -1
|
@@ -18,6 +18,7 @@ type Props = {
|
|
|
18
18
|
title: string;
|
|
19
19
|
action: () => void;
|
|
20
20
|
};
|
|
21
|
+
hideBackdrop?: boolean;
|
|
21
22
|
};
|
|
22
|
-
export default function AppModal({ children, title, subtitle, className, close, confirm, disableConfirm, hideFooter, disableClose, disableCancel, confirmLabel, closeLabel, cancel, onEntered, alternativeButton, }: Props): import("react/jsx-runtime").JSX.Element;
|
|
23
|
+
export default function AppModal({ children, title, subtitle, className, close, confirm, disableConfirm, hideFooter, disableClose, disableCancel, confirmLabel, closeLabel, cancel, onEntered, alternativeButton, hideBackdrop, }: Props): import("react/jsx-runtime").JSX.Element;
|
|
23
24
|
export {};
|
|
@@ -4,10 +4,10 @@ import cx from 'classnames';
|
|
|
4
4
|
import { useTranslation } from 'react-i18next';
|
|
5
5
|
import { Button, Icon } from 'tycho-storybook';
|
|
6
6
|
import './style.scss';
|
|
7
|
-
export default function AppModal({ children, title, subtitle, className, close, confirm, disableConfirm, hideFooter, disableClose, disableCancel, confirmLabel, closeLabel, cancel, onEntered, alternativeButton, }) {
|
|
7
|
+
export default function AppModal({ children, title, subtitle, className, close, confirm, disableConfirm, hideFooter, disableClose, disableCancel, confirmLabel, closeLabel, cancel, onEntered, alternativeButton, hideBackdrop, }) {
|
|
8
8
|
const { t } = useTranslation('common');
|
|
9
9
|
const getClassNames = cx('modal-container', className);
|
|
10
|
-
return (_jsx(Modal, { open: true, disableEnforceFocus: true, disableAutoFocus: true, disableRestoreFocus: true, children: _jsx(Fade, { in: true, onEntered: () => onEntered && onEntered(), children: _jsxs(Box, { className: getClassNames, sx: style, children: [_jsxs("div", { className: "header", children: [_jsxs("div", { className: "titles", children: [_jsx("span", { className: "title", children: title }), subtitle && _jsx("span", { className: "subtitle", children: subtitle })] }), !disableClose && (_jsx(Icon, { name: "close", onClick: close, className: "pointer" }))] }), _jsx("div", { className: "body", children: children }), !hideFooter ? (_jsxs("div", { className: "footer", children: [alternativeButton && (_jsx(Button, { className: "alternative", color: "white", onClick: alternativeButton.action, text: alternativeButton.title })), !disableCancel && (_jsx(Button, { onClick: cancel || close, text: closeLabel || t('button.cancel'), color: "danger" })), confirm && (_jsx(Button, { onClick: confirm, disabled: disableConfirm, text: confirmLabel || t('button.confirm') }))] })) : null] }) }) }));
|
|
10
|
+
return (_jsx(Modal, { open: true, disableEnforceFocus: true, disableAutoFocus: true, disableRestoreFocus: true, hideBackdrop: hideBackdrop, children: _jsx(Fade, { in: true, onEntered: () => onEntered && onEntered(), children: _jsxs(Box, { className: getClassNames, sx: style, children: [_jsxs("div", { className: "header", children: [_jsxs("div", { className: "titles", children: [_jsx("span", { className: "title", children: title }), subtitle && _jsx("span", { className: "subtitle", children: subtitle })] }), !disableClose && (_jsx(Icon, { name: "close", onClick: close, className: "pointer" }))] }), _jsx("div", { className: "body", children: children }), !hideFooter ? (_jsxs("div", { className: "footer", children: [alternativeButton && (_jsx(Button, { className: "alternative", color: "white", onClick: alternativeButton.action, text: alternativeButton.title })), !disableCancel && (_jsx(Button, { onClick: cancel || close, text: closeLabel || t('button.cancel'), color: "danger" })), confirm && (_jsx(Button, { onClick: confirm, disabled: disableConfirm, text: confirmLabel || t('button.confirm') }))] })) : null] }) }) }));
|
|
11
11
|
}
|
|
12
12
|
const style = {
|
|
13
13
|
position: 'absolute',
|
|
@@ -9,6 +9,7 @@ import CytoscapeTreeConverter from './cytoscape/CytoscapeTreeConverter';
|
|
|
9
9
|
import SyntreesCytoscape from './cytoscape/SyntreesCytoscape';
|
|
10
10
|
import './style.scss';
|
|
11
11
|
import AppPlaceholder from '../AppPlaceholder';
|
|
12
|
+
import DateUtils from '../functions/DateUtils';
|
|
12
13
|
export default function TreeView({ struct, expression, onExpand, selector = 'canvas-tree', translations, }) {
|
|
13
14
|
const { t } = useTranslation('tree');
|
|
14
15
|
const [cy, setCy] = useState(null);
|
|
@@ -80,7 +81,7 @@ export default function TreeView({ struct, expression, onExpand, selector = 'can
|
|
|
80
81
|
const right = 12 + i * 44;
|
|
81
82
|
return (_jsx("button", { className: "floating-button", type: "button", title: t(btn.title), onClick: btn.onClick, style: { right: `${right}px` }, children: _jsx(FontAwesomeIcon, { icon: btn.icon, className: btn.extraClass }) }, i));
|
|
82
83
|
}), _jsx("div", { id: selector, className: "canvas-tree" }), showInfo && (_jsxs("div", { className: "info", children: [_jsx("span", { children: SentenceUtils.getAsText(struct) }), translations &&
|
|
83
|
-
Object.entries(translations).map(([k, v]) => (_jsxs("div", { className: "translation", children: [_jsxs("b", { children: [k, ":"] }), _jsx("span", { children: v })] }, k)))] }))] }));
|
|
84
|
+
Object.entries(translations).map(([k, v]) => (_jsxs("div", { className: "translation", children: [_jsxs("b", { children: [k, ":"] }), _jsx("span", { children: v })] }, k))), struct.parsed && (_jsxs("span", { className: "date", children: [t('date.parsed'), ' ', DateUtils.formatDateTime(struct.parsed, 'dd/MM/yyyy HH:mm:ss')] }))] }))] }));
|
|
84
85
|
}
|
|
85
86
|
const getButtons = (generateImage, reset, downloadPsd, displayInfo, onExpand, expression) => [
|
|
86
87
|
{
|
package/dist/TreeView/style.scss
CHANGED
|
@@ -139,6 +139,7 @@ export declare const commonResources: {
|
|
|
139
139
|
'button.download.penn': string;
|
|
140
140
|
'button.info': string;
|
|
141
141
|
'placeholder.sentence.notparsed': string;
|
|
142
|
+
'date.parsed': string;
|
|
142
143
|
};
|
|
143
144
|
upload: {
|
|
144
145
|
'label.dropzone': string;
|
|
@@ -285,6 +286,7 @@ export declare const commonResources: {
|
|
|
285
286
|
'button.download.tree': string;
|
|
286
287
|
'button.download.penn': string;
|
|
287
288
|
'placeholder.sentence.notparsed': string;
|
|
289
|
+
'date.parsed': string;
|
|
288
290
|
};
|
|
289
291
|
upload: {
|
|
290
292
|
'label.dropzone': string;
|
|
@@ -432,6 +434,7 @@ export declare const commonResources: {
|
|
|
432
434
|
'button.recenter.tree': string;
|
|
433
435
|
'button.download.tree': string;
|
|
434
436
|
'button.download.penn': string;
|
|
437
|
+
'date.parsed': string;
|
|
435
438
|
};
|
|
436
439
|
upload: {
|
|
437
440
|
'label.dropzone': string;
|
|
@@ -6,6 +6,7 @@ export declare const TreeTexts: {
|
|
|
6
6
|
'button.download.penn': string;
|
|
7
7
|
'button.info': string;
|
|
8
8
|
'placeholder.sentence.notparsed': string;
|
|
9
|
+
'date.parsed': string;
|
|
9
10
|
};
|
|
10
11
|
'pt-BR': {
|
|
11
12
|
'button.expand.tree': string;
|
|
@@ -13,11 +14,13 @@ export declare const TreeTexts: {
|
|
|
13
14
|
'button.download.tree': string;
|
|
14
15
|
'button.download.penn': string;
|
|
15
16
|
'placeholder.sentence.notparsed': string;
|
|
17
|
+
'date.parsed': string;
|
|
16
18
|
};
|
|
17
19
|
it: {
|
|
18
20
|
'button.expand.tree': string;
|
|
19
21
|
'button.recenter.tree': string;
|
|
20
22
|
'button.download.tree': string;
|
|
21
23
|
'button.download.penn': string;
|
|
24
|
+
'date.parsed': string;
|
|
22
25
|
};
|
|
23
26
|
};
|
|
@@ -6,6 +6,7 @@ export const TreeTexts = {
|
|
|
6
6
|
'button.download.penn': 'Download in Penn Tree format',
|
|
7
7
|
'button.info': 'Display translations and glosses',
|
|
8
8
|
'placeholder.sentence.notparsed': 'This sentence has not been parsed.',
|
|
9
|
+
'date.parsed': 'Parsing executed at:',
|
|
9
10
|
},
|
|
10
11
|
'pt-BR': {
|
|
11
12
|
'button.expand.tree': 'Expandir árvore',
|
|
@@ -13,11 +14,13 @@ export const TreeTexts = {
|
|
|
13
14
|
'button.download.tree': 'Baixar árvore como imagem',
|
|
14
15
|
'button.download.penn': 'Baixar no formato Penn Tree',
|
|
15
16
|
'placeholder.sentence.notparsed': 'O parser não foi realizado nesta sentença.',
|
|
17
|
+
'date.parsed': 'Parser executado às:',
|
|
16
18
|
},
|
|
17
19
|
it: {
|
|
18
20
|
'button.expand.tree': 'Espandi albero',
|
|
19
21
|
'button.recenter.tree': 'Ricentra albero',
|
|
20
22
|
'button.download.tree': 'Scarica albero come immagine',
|
|
21
23
|
'button.download.penn': 'Scarica in formato Penn Tree',
|
|
24
|
+
'date.parsed': 'Parser eseguito alle:',
|
|
22
25
|
},
|
|
23
26
|
};
|