From 519b9d0a27b9786df8a9eb7e5abff5e3becf4eea Mon Sep 17 00:00:00 2001 From: 1ilit Date: Tue, 19 Sep 2023 15:48:09 +0300 Subject: [PATCH] add search table functionality --- src/components/editor_panel.jsx | 38 -- src/components/table_overview.jsx | 905 +++++++++++++++++------------- src/index.css | 4 - 3 files changed, 503 insertions(+), 444 deletions(-) diff --git a/src/components/editor_panel.jsx b/src/components/editor_panel.jsx index dfe987f..09fbe9e 100644 --- a/src/components/editor_panel.jsx +++ b/src/components/editor_panel.jsx @@ -105,44 +105,6 @@ export default function EditorPanel(props) { add area
- -
- - - - - - - { - const updatedTables = [...props.tables]; - updatedTables[i] = { - ...updatedTables[i], - fields: updatedTables[i].fields.map( - (field, index) => - index === j - ? { ...field, ...value.values } - : field - ), - }; - props.setTables(updatedTables); - }} - > - - -
- - { - const updatedTables = [...props.tables]; - updatedTables[i].fields = updatedTables[ - i - ].fields.map((field, index) => - index === j - ? { - ...field, - [checkedValues.target.value]: - checkedValues.target.checked, - } - : field - ); - props.setTables(updatedTables); - }} - > -
-
- - { - const updatedTables = [...props.tables]; - updatedTables[i].fields = updatedTables[ - i - ].fields.map((field, index) => - index === j - ? { - ...field, - [checkedValues.target.value]: - checkedValues.target.checked, - } - : field - ); - props.setTables(updatedTables); - }} - > -
- - - - - } - trigger="click" - position="rightTop" - showArrow - > - -
- - - - ))} - {t.indices.length > 0 && ( - + + + + setIndexActiveKeyTable(i)} + > + {props.tables.map((t, i) => ( +
+ + +
+ } + itemKey={`${t.id}`} > - setIndexActiveKey(itemKey)} - > - - {t.indices.map((idx, k) => ( -
- ({ + value: e.name, + label: e.name, + }))} + className="w-full" + defaultValue={idx.fields} + onChange={(value) => { + const updatedTables = [...props.tables]; + const updatedIndices = [...t.indices]; + updatedIndices[k] = { + name: `${value.join("_")}_index`, + fields: [...value], + }; + updatedTables[i] = { + ...t, + indices: [...updatedIndices], + }; + props.setTables(updatedTables); + }} + /> + +
+ + + +
+ } + trigger="click" + position="rightTop" + showArrow + > + + + + ))} +
+
+
+ )} + + + +
{ + const updatedTables = [...props.tables]; + updatedTables[i] = { + ...t, + ...value.values, + }; + props.setTables(updatedTables); + }} + > + { + const updatedTables = [...props.tables]; + updatedTables[i] = { + ...t, + comment: "", + }; + props.setTables(updatedTables); + }} + initValue={t.comment} + autosize + placeholder="Add comment" + rows={1} + /> + +
+
+
+ + + +
+
Theme
+ +
+
+
+
+ {tableThemes + .slice(0, Math.ceil(tableThemes.length / 2)) + .map((c) => ( + + ))} +
+
+ {tableThemes + .slice(Math.ceil(tableThemes.length / 2)) + .map((c) => ( + + ))} +
+
+ + } + trigger="click" + position="bottomLeft" + showArrow + > + +
+ + + - -
-
-
- {tableThemes - .slice(0, Math.ceil(tableThemes.length / 2)) - .map((c) => ( - - ))} -
-
- {tableThemes - .slice(Math.ceil(tableThemes.length / 2)) - .map((c) => ( - - ))} -
-
- - } - trigger="click" - position="bottomLeft" - showArrow - > - - - - - - - - - -
- - ))} - + > + Add index + + + + + + + + + ))} + + ); } diff --git a/src/index.css b/src/index.css index a3dadd2..44afa54 100644 --- a/src/index.css +++ b/src/index.css @@ -6,10 +6,6 @@ outline: none !important; } -body { - overflow: hidden; -} - .bg-blue { background-color: #124559; }