@topconsultnpm/sdkui-react-beta 6.11.112 → 6.11.113
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/lib/components/choosers/TMDynDataListItemChooser.js +4 -7
- package/lib/components/editors/TMHtmlContentDisplay.d.ts +6 -0
- package/lib/components/editors/TMHtmlContentDisplay.js +14 -0
- package/lib/components/editors/TMHtmlEditor.d.ts +29 -0
- package/lib/components/editors/TMHtmlEditor.js +66 -0
- package/lib/components/editors/TMMetadataEditor.d.ts +1 -1
- package/lib/components/editors/TMMetadataValues.js +38 -38
- package/lib/stories/TMHtmlEditor.stories.d.ts +4 -0
- package/lib/stories/TMHtmlEditor.stories.js +16 -0
- package/package.json +1 -1
@@ -27,8 +27,10 @@ const TMDynDataListItemChooser = ({ tid, md, titleForm, openChooserBySingleClick
|
|
27
27
|
}
|
28
28
|
}
|
29
29
|
setDynDl(d);
|
30
|
-
if (!IsParametricQuery(d?.qd) && !dataSource)
|
30
|
+
if (!IsParametricQuery(d?.qd) && !dataSource) {
|
31
|
+
setDataSource(undefined);
|
31
32
|
loadData().then((result) => { setDataSource(result); });
|
33
|
+
}
|
32
34
|
}, [md]);
|
33
35
|
useEffect(() => {
|
34
36
|
if (!tid)
|
@@ -41,11 +43,6 @@ const TMDynDataListItemChooser = ({ tid, md, titleForm, openChooserBySingleClick
|
|
41
43
|
}
|
42
44
|
loadData().then((result) => {
|
43
45
|
setDataSource(result);
|
44
|
-
if (values && values.length > 0) {
|
45
|
-
let description = result?.dtdResult?.rows?.filter(o => o[dynDl?.selectItemForValue ?? 0] == values?.[0])?.[0]?.[dynDl?.selectItemForDescription ?? 0];
|
46
|
-
if (!description)
|
47
|
-
onValueChanged?.(undefined);
|
48
|
-
}
|
49
46
|
});
|
50
47
|
}, [queryParamsDynDataList, dynDl]);
|
51
48
|
const loadData = async () => {
|
@@ -77,7 +74,7 @@ const TMDynDataListItemChooser = ({ tid, md, titleForm, openChooserBySingleClick
|
|
77
74
|
_jsx(TMTooltip, { content: SDKUI_Localizator.ValueNotPresent, children: _jsx(IconWarning, { color: TMColors.warning }) });
|
78
75
|
};
|
79
76
|
const renderTemplate = () => {
|
80
|
-
return (_jsxs(StyledDivHorizontal, { style: { minWidth: '125px' }, children: [_jsxs(StyledDivHorizontal, { children: [getIcon(), _jsx("p", { style: { marginLeft: '5px' }, children: getDescription() })] }), values && values.length > 1 && _jsx("p", { style: { marginLeft: '10px' }, children: `(+${values.length - 1} ${values.length == 2 ? 'altro' : 'altri'})` })] }));
|
77
|
+
return (_jsxs(StyledDivHorizontal, { style: { minWidth: '125px' }, children: [dataSource && _jsxs(StyledDivHorizontal, { children: [getIcon(), _jsx("p", { style: { marginLeft: '5px' }, children: getDescription() })] }), values && values.length > 1 && _jsx("p", { style: { marginLeft: '10px' }, children: `(+${values.length - 1} ${values.length == 2 ? 'altro' : 'altri'})` })] }));
|
81
78
|
};
|
82
79
|
return (_jsxs(_Fragment, { children: [_jsx(TMSummary, { placeHolder: placeHolder, icon: icon, labelColor: labelColor, backgroundColor: backgroundColor, buttons: buttons, showBorder: showBorder, readOnly: readOnly, hasValue: values && values.length > 0, showClearButton: showClearButton, iconEditButton: _jsx(IconSearch, { fontSize: 16 }), onEditorClick: () => !readOnly && setShowChooser(true), elementStyle: elementStyle, isModifiedWhen: isModifiedWhen, openEditorOnSummaryClick: openChooserBySingleClick, label: label, template: renderTemplate(), onClearClick: showClearButton ? () => { onValueChanged?.([]); } : undefined, validationItems: validationItems }), showChooser &&
|
83
80
|
_jsx(TMDynDataListItemChooserForm, { TID: tid, MID: md?.id, dynDL: dynDl, title: titleForm, allowMultipleSelection: allowMultipleSelection, searchResult: dataSource, selectedIDs: values, onClose: () => setShowChooser(false), onChoose: (IDs) => {
|
@@ -0,0 +1,14 @@
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
2
|
+
import styled from 'styled-components';
|
3
|
+
const Wrapper = styled.div `
|
4
|
+
ul li {
|
5
|
+
list-style-position: inside;
|
6
|
+
}
|
7
|
+
ol li {
|
8
|
+
list-style-position: inside;
|
9
|
+
}
|
10
|
+
`;
|
11
|
+
const TMHtmlContentDisplay = ({ markup }) => {
|
12
|
+
return (_jsx(Wrapper, { children: _jsx("div", { dangerouslySetInnerHTML: { __html: markup } }) }));
|
13
|
+
};
|
14
|
+
export default TMHtmlContentDisplay;
|
@@ -0,0 +1,29 @@
|
|
1
|
+
import { ValidationItem } from '@topconsultnpm/sdk-ts-beta';
|
2
|
+
export interface ITMHtmlEditor {
|
3
|
+
/** Width of the editor (e.g., '100%', '500px') */
|
4
|
+
width?: string;
|
5
|
+
/** Height of the editor (e.g., '300px') */
|
6
|
+
height?: string;
|
7
|
+
/** Initial or current value of the editor content as an HTML string */
|
8
|
+
value?: string;
|
9
|
+
/** Callback function triggered when the content value changes */
|
10
|
+
onValueChanged?: (e: {
|
11
|
+
value: string;
|
12
|
+
}) => void;
|
13
|
+
/** If true, the editor is in read-only mode and content cannot be edited */
|
14
|
+
readOnly?: boolean;
|
15
|
+
/** Configuration for mention functionality (e.g., @mentions) */
|
16
|
+
mentionsConfig?: Array<{
|
17
|
+
dataSource: Array<{
|
18
|
+
text: string;
|
19
|
+
icon?: string;
|
20
|
+
}>;
|
21
|
+
searchExpr: string;
|
22
|
+
displayExpr: string;
|
23
|
+
valueExpr: string;
|
24
|
+
}>;
|
25
|
+
/** List of validation rules or checks to apply to the editor content */
|
26
|
+
validationItems?: Array<ValidationItem>;
|
27
|
+
}
|
28
|
+
declare const TMHtmlEditor: (props: ITMHtmlEditor) => import("react/jsx-runtime").JSX.Element;
|
29
|
+
export default TMHtmlEditor;
|
@@ -0,0 +1,66 @@
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
2
|
+
import { useEffect, useMemo, useRef, useState } from 'react';
|
3
|
+
import HtmlEditor, { Toolbar, Item } from 'devextreme-react/html-editor';
|
4
|
+
import TMVilViewer from '../base/TMVilViewer';
|
5
|
+
import TMTooltip from '../base/TMTooltip';
|
6
|
+
import TMButton from '../base/TMButton';
|
7
|
+
const TMHtmlEditor = (props) => {
|
8
|
+
const { width = "100%", height = "100%", readOnly = false, value = "", mentionsConfig, onValueChanged, validationItems } = props;
|
9
|
+
const editorRef = useRef(null); // Create a ref for the HtmlEditor
|
10
|
+
const [isEditorEnabled, setIsEditorEnabled] = useState(false);
|
11
|
+
const handlePaste = (e) => {
|
12
|
+
const clipboardData = e.clipboardData || window.clipboardData;
|
13
|
+
const pastedText = clipboardData.getData('text/plain'); // Get the plain text
|
14
|
+
e.preventDefault(); // Prevent default paste behavior
|
15
|
+
setMarkup(pastedText); // Set the pasted text as plain text
|
16
|
+
onValueChangeCallback(pastedText); // Call the value change callback
|
17
|
+
};
|
18
|
+
useEffect(() => {
|
19
|
+
const editor = editorRef.current?.instance()?.element();
|
20
|
+
if (editor) {
|
21
|
+
// Attach paste event listener to the editor's root DOM element
|
22
|
+
editor.addEventListener('paste', handlePaste);
|
23
|
+
}
|
24
|
+
// Cleanup the event listener when component unmounts
|
25
|
+
return () => {
|
26
|
+
if (editor) {
|
27
|
+
editor.removeEventListener('paste', handlePaste);
|
28
|
+
}
|
29
|
+
};
|
30
|
+
}, []);
|
31
|
+
const [markup, setMarkup] = useState(value);
|
32
|
+
useEffect(() => {
|
33
|
+
// Initialize markup with the value prop
|
34
|
+
setMarkup(value);
|
35
|
+
}, [value]);
|
36
|
+
useEffect(() => {
|
37
|
+
if (!isEditorEnabled) {
|
38
|
+
// When switching to plain text mode, strip HTML tags
|
39
|
+
const doc = new DOMParser().parseFromString(markup, 'text/html');
|
40
|
+
setMarkup(doc.body.textContent || "");
|
41
|
+
}
|
42
|
+
}, [isEditorEnabled]);
|
43
|
+
const onValueChangeCallback = (text) => {
|
44
|
+
setMarkup(text);
|
45
|
+
if (onValueChanged) {
|
46
|
+
onValueChanged({ value: text });
|
47
|
+
}
|
48
|
+
};
|
49
|
+
const hasValidationErrors = useMemo(() => {
|
50
|
+
return validationItems && validationItems.length > 0;
|
51
|
+
}, [validationItems]);
|
52
|
+
const toggleEditorMode = () => {
|
53
|
+
setIsEditorEnabled((prev) => !prev);
|
54
|
+
};
|
55
|
+
return (_jsxs("div", { children: [_jsx("div", { style: { position: 'absolute', top: '10px', right: '10px', zIndex: 10 }, children: _jsx(TMTooltip, { content: isEditorEnabled ? "Nascondi opzioni di formattazione" : "Mostra opzioni di formattazione", children: _jsx(TMButton, { btnStyle: "toolbar", onClick: toggleEditorMode, icon: isEditorEnabled ? _jsx("i", { className: 'dx-icon-eyeclose' }) : _jsx("i", { className: 'dx-icon-eyeopen' }) }) }) }), _jsx("div", { style: { borderWidth: '1px', borderStyle: 'solid', borderColor: hasValidationErrors ? "red" : "#e0e0e0 #e0e0e0 #616161", }, children: !isEditorEnabled ? (_jsx("textarea", { placeholder: "Digita un messaggio...", value: markup, onChange: (e) => onValueChangeCallback(e.target.value), maxLength: 1000, style: {
|
56
|
+
width,
|
57
|
+
height,
|
58
|
+
border: '1px solid #ddd',
|
59
|
+
boxShadow: '0 2px 8px rgba(0, 0, 0, 0.1)',
|
60
|
+
resize: 'none',
|
61
|
+
padding: '10px',
|
62
|
+
outline: 'none',
|
63
|
+
paddingRight: "40px"
|
64
|
+
} })) : (_jsx(HtmlEditor, { ref: editorRef, width: width, height: height, value: markup, onValueChange: onValueChangeCallback, readOnly: readOnly, mentions: mentionsConfig, style: { overflow: 'hidden', outline: "none" }, children: !readOnly && (_jsxs(Toolbar, { multiline: false, children: [_jsx(Item, { name: "undo" }), _jsx(Item, { name: "redo" }), _jsx(Item, { name: "separator" }), _jsx(Item, { name: "separator" }), _jsx(Item, { name: "bold" }), _jsx(Item, { name: "italic" }), _jsx(Item, { name: "underline" }), _jsx(Item, { name: "separator" }), _jsx(Item, { name: "alignLeft" }), _jsx(Item, { name: "alignCenter" }), _jsx(Item, { name: "alignRight" }), _jsx(Item, { name: "alignJustify" }), _jsx(Item, { name: "separator" }), _jsx(Item, { name: "orderedList" }), _jsx(Item, { name: "bulletList" }), _jsx(Item, { name: "separator" }), _jsx(Item, { name: "color" }), _jsx(Item, { name: "background" }), _jsx(Item, { name: "separator" }), _jsx(Item, { name: "link" })] })) })) }), _jsx(TMVilViewer, { vil: validationItems })] }));
|
65
|
+
};
|
66
|
+
export default TMHtmlEditor;
|
@@ -7,7 +7,7 @@ interface ITMMetadataEditorProps {
|
|
7
7
|
value: string | undefined;
|
8
8
|
queryParamsDynDataList?: string[];
|
9
9
|
autoFocus?: boolean;
|
10
|
-
containerElement
|
10
|
+
containerElement?: Element;
|
11
11
|
disabled?: boolean;
|
12
12
|
validationItems?: ValidationItem[];
|
13
13
|
isLexProt?: number;
|
@@ -2,7 +2,7 @@ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-run
|
|
2
2
|
import { useEffect, useState } from "react";
|
3
3
|
import styled from "styled-components";
|
4
4
|
import { AccessLevels, DcmtTypeListCacheService, LayoutModes, MetadataDataDomains, MetadataDataTypes, MetadataValueDescriptor, SDK_Globals } from '@topconsultnpm/sdk-ts-beta';
|
5
|
-
import { IconUndo, IconPencil, IconFunction, IconMenuVertical, IconDataList, SDKUI_Localizator, IconNull, stringIsNullOrEmpty } from "../../helper";
|
5
|
+
import { IconUndo, IconPencil, IconFunction, IconMenuVertical, IconDataList, SDKUI_Localizator, IconNull, stringIsNullOrEmpty, deepCompare } from "../../helper";
|
6
6
|
import { TMColors } from "../../utils/theme";
|
7
7
|
import TMButton from "../base/TMButton";
|
8
8
|
import TMDropDownMenu from "../base/TMDropDownMenu";
|
@@ -27,10 +27,10 @@ export var AdvancedMenuButtons;
|
|
27
27
|
})(AdvancedMenuButtons || (AdvancedMenuButtons = {}));
|
28
28
|
const TMMetadataValues = ({ showCheckBoxes = ShowCheckBoxesMode.Never, checkPerms = true, showAdvancedMenu = false, customMenuItems = [], showNullValueCheckBoxes, isOpenDistinctValues = false, openChooserBySingleClick, selectedMID, onFocusedItemChanged, layoutMode = LayoutModes.Update, metadataValues = [], metadataValuesOrig = [], TID, onValueChanged, onAdvancedMenuClick, validationItems }) => {
|
29
29
|
const [dynDataListsToBeRefreshed, setDynDataListsToBeRefreshed] = useState([]);
|
30
|
-
const [calcDynDataListsToBeRefreshed, setCalcDynDataListsToBeRefreshed] = useState();
|
31
30
|
const [currentDTD, setCurrentDTD] = useState();
|
32
31
|
const [isEditableList, addOrRemoveEditableList] = useMetadataEditableList();
|
33
32
|
const [selectedItem, setSelectedItem] = useState(undefined);
|
33
|
+
const [prevMetadataValues, setPrevMetadataValues] = useState([]);
|
34
34
|
const onChangeHandler = (newValue, mid) => {
|
35
35
|
let newValues = structuredClone(metadataValues);
|
36
36
|
const item = newValues.find(value => value.mid === mid);
|
@@ -48,8 +48,6 @@ const TMMetadataValues = ({ showCheckBoxes = ShowCheckBoxesMode.Never, checkPerm
|
|
48
48
|
dynDLToBeRefreshed = dynDataListsToBeRefreshed.find(o => o.midStarter === item?.mid);
|
49
49
|
}
|
50
50
|
}
|
51
|
-
let md = currentDTD?.metadata?.find(o => o.id == mid);
|
52
|
-
setCalcDynDataListsToBeRefreshed(md?.dataDomain === MetadataDataDomains.DynamicDataList);
|
53
51
|
onValueChanged?.(newValues);
|
54
52
|
};
|
55
53
|
const editorValidationHandler = (mid) => {
|
@@ -73,29 +71,31 @@ const TMMetadataValues = ({ showCheckBoxes = ShowCheckBoxesMode.Never, checkPerm
|
|
73
71
|
useEffect(() => {
|
74
72
|
DcmtTypeListCacheService.GetAsync(TID, true).then((resultDTD) => {
|
75
73
|
setCurrentDTD(resultDTD);
|
76
|
-
setCalcDynDataListsToBeRefreshed(true);
|
77
74
|
});
|
78
75
|
}, [TID]);
|
79
76
|
useEffect(() => {
|
80
77
|
if (metadataValues.length <= 0)
|
81
78
|
return;
|
82
|
-
if (
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
79
|
+
if (!currentDTD)
|
80
|
+
return;
|
81
|
+
//if no dynamic data list has changed we do not call APIs
|
82
|
+
if (deepCompare(metadataValues.filter(o => o.md?.dataDomain === MetadataDataDomains.DynamicDataList), prevMetadataValues.filter(o => o.md?.dataDomain === MetadataDataDomains.DynamicDataList)))
|
83
|
+
return;
|
84
|
+
setPrevMetadataValues(metadataValues);
|
85
|
+
loadDynDataListToBeRefreshedCascadeAsync(TID, metadataValues).then((result) => {
|
86
|
+
setDynDataListsToBeRefreshed(result);
|
87
|
+
});
|
88
|
+
}, [metadataValues, currentDTD]);
|
89
|
+
const loadDynDataListToBeRefreshedCascadeAsync = async (tid, mvdList) => {
|
90
90
|
if (!tid)
|
91
91
|
return [];
|
92
|
-
if (
|
92
|
+
if (mvdList.length <= 0)
|
93
93
|
return [];
|
94
94
|
let dynDLToBeRefreshed = [];
|
95
|
-
for (const m of
|
95
|
+
for (const m of mvdList) {
|
96
96
|
if (!m.value)
|
97
97
|
continue;
|
98
|
-
let data = await getDataDynDataListsToBeRefreshedAsync(tid, m.mid,
|
98
|
+
let data = await getDataDynDataListsToBeRefreshedAsync(tid, m.mid, m.value, dynDLToBeRefreshed.find(o => o.mid == m.mid)?.queryParams ?? []);
|
99
99
|
if (!data)
|
100
100
|
continue;
|
101
101
|
for (const item of data)
|
@@ -103,11 +103,13 @@ const TMMetadataValues = ({ showCheckBoxes = ShowCheckBoxesMode.Never, checkPerm
|
|
103
103
|
}
|
104
104
|
return dynDLToBeRefreshed;
|
105
105
|
};
|
106
|
-
const getDataDynDataListsToBeRefreshedAsync = async (tid, mid,
|
106
|
+
const getDataDynDataListsToBeRefreshedAsync = async (tid, mid, value, qParams) => {
|
107
107
|
if (!tid)
|
108
108
|
return;
|
109
109
|
if (!mid)
|
110
110
|
return;
|
111
|
+
if (stringIsNullOrEmpty(value))
|
112
|
+
return;
|
111
113
|
let md = currentDTD?.metadata?.find(o => o.id == mid);
|
112
114
|
if (md?.dataDomain !== MetadataDataDomains.DynamicDataList)
|
113
115
|
return;
|
@@ -127,25 +129,23 @@ const TMMetadataValues = ({ showCheckBoxes = ShowCheckBoxesMode.Never, checkPerm
|
|
127
129
|
return;
|
128
130
|
let toBeRefreshed = [];
|
129
131
|
let dynDlDataSource = await SDK_Globals.tmSession?.NewSearchEngine().GetDynDataListValuesAsync(tid, mid, layoutMode, qParams);
|
130
|
-
if (
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
toBeRefreshed.push({ mid: mid, queryParams: queryParams, midStarter: md?.id });
|
148
|
-
}
|
132
|
+
if (!d.onValueChanged_DynDataListsToBeRefreshed)
|
133
|
+
return;
|
134
|
+
let row = dynDlDataSource?.dtdResult?.rows?.filter(o => o[d.selectItemForValue ?? 0] == value);
|
135
|
+
if (!row || row.length <= 0)
|
136
|
+
return;
|
137
|
+
for (const t of d.onValueChanged_DynDataListsToBeRefreshed) {
|
138
|
+
let mid = t.item1;
|
139
|
+
let queryParams = [];
|
140
|
+
if ((t.item2 ?? 0) >= 0)
|
141
|
+
queryParams.push(row[0][t.item2 ?? 0]);
|
142
|
+
if ((t.item3 ?? 0) >= 0)
|
143
|
+
queryParams.push(row[0][t.item3 ?? 0]);
|
144
|
+
if ((t.item4 ?? 0) >= 0)
|
145
|
+
queryParams.push(row[0][t.item4 ?? 0]);
|
146
|
+
if ((t.item5 ?? 0) >= 0)
|
147
|
+
queryParams.push(row[0][t.item5 ?? 0]);
|
148
|
+
toBeRefreshed.push({ mid: mid, queryParams: queryParams, midStarter: md?.id });
|
149
149
|
}
|
150
150
|
return toBeRefreshed;
|
151
151
|
};
|
@@ -180,7 +180,7 @@ const TMMetadataValues = ({ showCheckBoxes = ShowCheckBoxesMode.Never, checkPerm
|
|
180
180
|
if (mvd)
|
181
181
|
mvd.isSelected = newValue;
|
182
182
|
onValueChanged?.(newValues);
|
183
|
-
} }), _jsxs("div", { style: { position: 'relative', height: '100%', width: '100%', opacity: showNullValueCheckBoxes && item.isNull ? 0.4 : 1 }, children: [_jsx(TMMetadataEditor, { tid: TID, mid: item.mid, layoutMode: layoutMode, isLexProt: item.isLexProt, isSelected: isOpenDistinctValues && item.mid === selectedMID, isModifiedWhen: (item
|
183
|
+
} }), _jsxs("div", { style: { position: 'relative', height: '100%', width: '100%', opacity: showNullValueCheckBoxes && item.isNull ? 0.4 : 1 }, children: [_jsx(TMMetadataEditor, { tid: TID, mid: item.mid, layoutMode: layoutMode, isLexProt: item.isLexProt, isSelected: isOpenDistinctValues && item.mid === selectedMID, isModifiedWhen: (item.value ?? '') !== (metadataValuesOrig.find(m => m.mid === item.mid)?.value ?? ''), isReadOnly: showNullValueCheckBoxes ? item.isNull : undefined, isEditable: isEditable(item.mid) || item.isEditable, validationItems: editorValidationHandler(item.mid ?? 0), value: item.value, openChooserBySingleClick: openChooserBySingleClick, onValueChanged: (newValue) => { onChangeHandler(newValue, item.mid ?? 0); }, onValueChange: (newValue) => { onChangeHandler(newValue, item.mid ?? 0); }, queryParamsDynDataList: dynDataListsToBeRefreshed.find(o => o.mid == item.mid)?.queryParams ?? [], onCascadeRefreshDynDataLists: (ddlToBeRefreshed) => {
|
184
184
|
let newDynDataListsToBeRefreshed = [];
|
185
185
|
for (const item of dynDataListsToBeRefreshed) {
|
186
186
|
let index = ddlToBeRefreshed.findIndex(o => o.mid == item.mid || (o.mid == -1 && o.midStarter == item.midStarter));
|
@@ -234,7 +234,7 @@ const StyledMetadataValuesContainer = styled.div `
|
|
234
234
|
display: flex;
|
235
235
|
flex-direction: column;
|
236
236
|
width: 100%;
|
237
|
-
height:
|
237
|
+
height: 100%;
|
238
238
|
overflow: auto;
|
239
239
|
padding: 0 10px 10px 10px;
|
240
240
|
`;
|
@@ -0,0 +1,16 @@
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
2
|
+
import { sortArgTypes } from './TMStoriesUtils';
|
3
|
+
import TMHtmlEditor from '../components/editors/TMHtmlEditor';
|
4
|
+
export default {
|
5
|
+
// The title will determine how the component appears in the sidebar of Storybook
|
6
|
+
title: 'Components/TMHtmlEditor',
|
7
|
+
// Specifies the component that is being documented in this story
|
8
|
+
component: TMHtmlEditor,
|
9
|
+
tags: ['autodocs'],
|
10
|
+
// Tags for categorizing the component within Storybook
|
11
|
+
argTypes: sortArgTypes({}),
|
12
|
+
};
|
13
|
+
/******* 1. Default Template and Default TMHtmlEditor *******/
|
14
|
+
const Template = (args) => _jsx(TMHtmlEditor, { ...args });
|
15
|
+
export const HtmlEditor = Template.bind({});
|
16
|
+
HtmlEditor.args = {};
|