diff --git a/client/packages/lowcoder/src/pages/ComponentDoc/examples/presentationComp/table.tsx b/client/packages/lowcoder/src/pages/ComponentDoc/examples/presentationComp/table.tsx index 2c1c8167f..c6b05a3bf 100644 --- a/client/packages/lowcoder/src/pages/ComponentDoc/examples/presentationComp/table.tsx +++ b/client/packages/lowcoder/src/pages/ComponentDoc/examples/presentationComp/table.tsx @@ -5,6 +5,540 @@ import ExampleGroup from "../../common/ExampleGroup"; const data = JSON.stringify(i18nObjs.table.defaultData); +const data2 = "[\n {\n \"id\": 1,\n \"name\": \"4\",\n \"date\": \"https://api.dicebear.com/7.x/miniavs/svg?seed=1\",\n \"department\": \"true\"\n },\n {\n \"id\": 2,\n \"name\": \"2\",,\n \"date\": \"https://api.dicebear.com/7.x/miniavs/svg?seed=1\",\n \"department\": \"true\"\n },\n {\n \"id\": 3,\n \"name\": \"1\",\n \"date\": \"https://api.dicebear.com/7.x/miniavs/svg?seed=1\",\n \"department\": \"false\"\n },\n {\n \"id\": 4,\n \"name\": \"3\",\n \"date\": \"https://api.dicebear.com/7.x/miniavs/svg?seed=1\",\n },\n {\n \"id\": 5,\n \"name\": \"5\",\n \"date\": \"https://api.dicebear.com/7.x/miniavs/svg?seed=1\",\n \"department\": \"true\"\n },\n {\n \"id\": 6,\n \"name\": \"2\",\n \"date\": \"https://api.dicebear.com/7.x/miniavs/svg?seed=1\",\n \"department\": \"\"\n },\n {\n \"id\": 7,\n \"name\": \"4\",\n \"date\": \"https://api.dicebear.com/7.x/miniavs/svg?seed=1\",\n \"department\": \"true\"\n },\n {\n \"id\": 8,\n \"name\": \"3\",\n \"date\": \"https://api.dicebear.com/7.x/miniavs/svg?seed=1\",\n \"department\": \"true\"\n },\n {\n \"id\": 9,\n \"name\": \"5\",\n \"date\": \"https://api.dicebear.com/7.x/miniavs/svg?seed=1\",\n \"department\": \"true\"\n },\n {\n \"id\": 10,\n \"name\": \"2\",\n \"date\": \"https://api.dicebear.com/7.x/miniavs/svg?seed=1\",\n \"department\": \"false\"\n }\n]"; + +const data3 = "[\n {\n \"id\": 1,\n \"name\": \"Reagen Gilberthorpe\",\n \"date\": \"Completed\",\n \"department\": \"100\"\n },\n {\n \"id\": 2,\n \"name\": \"Haroun Lortzing\",\n \"date\": \"To Do\",\n \"department\": \"0\"\n },\n {\n \"id\": 2,\n \"name\": \"Garret Kilmaster\",\n \"date\": \"In Progress\",\n \"department\": \"45\"\n },\n {\n \"id\": 3,\n \"name\": \"Israel Harrowsmith\",\n \"date\": \"Closed\",\n \"department\": \"100\"\n },\n {\n \"id\": 1,\n \"name\": \"Loren O'Lagen\",\n \"date\": \"Backlog\",\n \"department\": \"0\"\n },\n {\n \"id\": 2,\n \"name\": \"Wallis Hothersall\",\n \"date\": \"Partially Completed\",\n \"department\": \"85\"\n },\n {\n \"id\": 1,\n \"name\": \"Kaia Biskup\",\n \"date\": \"To Do\",\n \"department\": \"0\"\n },\n {\n \"id\": 3,\n \"name\": \"Travers Saterweyte\",\n \"date\": \"Done\",\n \"department\": \"100\"\n },\n {\n \"id\": 3,\n \"name\": \"Mikey Niemetz\",\n \"date\": \"In Progress\",\n \"department\": \"45\"\n },\n {\n \"id\": 1,\n \"name\": \"Mano Meckiff\",\n \"date\": \"Completed\",\n \"department\": \"100\"\n }\n]"; + +const data4 = "[\n {\n \"id\": \"https://www.google.com\",\n \"name\": \"Reagen Gilberthorpe\",\n \"date\": \"7/5/2022\",\n },\n {\n \"id\": \"https://www.linkedin.com\",\n \"name\": \"Haroun Lortzing\",\n \"date\": \"11/6/2022\",\n },\n {\n \"id\": \"http://lowcoder.cloud/\",\n \"name\": \"Garret Kilmaster\",\n \"date\": \"11/14/2021\",\n },\n {\n \"id\": \"https://docs.lowcoder.cloud/\",\n \"name\": \"Israel Harrowsmith\",\n \"date\": \"4/3/2022\",\n },\n {\n \"id\": \"https://app.lowcoder.cloud\",\n \"name\": \"Loren O'Lagen\",\n \"date\": \"9/10/2022\",\n },\n {\n \"id\": \"https://www.espncricinfo.com/\",\n \"name\": \"Wallis Hothersall\",\n \"date\": \"4/18/2022\",\n },\n {\n \"id\": \"https://techcrunch.com/\",\n \"name\": \"Kaia Biskup\",\n \"date\": \"3/4/2022\",\n },\n {\n \"id\": \"https://www.apple.com/\",\n \"name\": \"Travers Saterweyte\",\n \"date\": \"1/9/2022\",\n },\n {\n \"id\": \"https://www.amazon.com/\",\n \"name\": \"Mikey Niemetz\",\n \"date\": \"1/4/2022\",\n },\n {\n \"id\": \"https://www.etsy.com/\",\n \"name\": \"Mano Meckiff\",\n \"date\": \"2/19/2022\",\n }\n]"; + +const columns = [ + { + "title": "ID", + "showTitle": true, + "isCustom": false, + "dataIndex": "id", + "width": "55", + "autoWidth": "fixed", + "render": { + "compType": "text", + "comp": { + "text": "{{currentCell}}" + } + }, + "align": "left", + "fixed": "close", + "editable": true, + "background": "", + "margin": "", + "text": "", + "border": "", + "borderWidth": "", + "radius": "", + "textSize": "", + "textWeight": "normal", + "fontFamily": "sans-serif", + "fontStyle": "normal", + "textOverflow": "ellipsis", + "linkColor": "#3377ff", + "linkHoverColor": "", + "linkActiveColor": "", + "summaryColumns": [ + { + "isCustom": false, + "dataIndex": "", + "render": { + "compType": "text", + "comp": {} + }, + "align": "left", + "background": "", + "margin": "", + "text": "", + "border": "", + "radius": "", + "textSize": "", + "textWeight": "normal", + "fontFamily": "sans-serif", + "fontStyle": "normal", + "textOverflow": "ellipsis", + "linkColor": "#3377ff", + "linkHoverColor": "", + "linkActiveColor": "" + }, + { + "isCustom": false, + "dataIndex": "", + "render": { + "compType": "text", + "comp": {} + }, + "align": "left", + "background": "", + "margin": "", + "text": "", + "border": "", + "radius": "", + "textSize": "", + "textWeight": "normal", + "fontFamily": "sans-serif", + "fontStyle": "normal", + "textOverflow": "ellipsis", + "linkColor": "#3377ff", + "linkHoverColor": "", + "linkActiveColor": "" + }, + { + "isCustom": false, + "dataIndex": "", + "render": { + "compType": "text", + "comp": {} + }, + "align": "left", + "background": "", + "margin": "", + "text": "", + "border": "", + "radius": "", + "textSize": "", + "textWeight": "normal", + "fontFamily": "sans-serif", + "fontStyle": "normal", + "textOverflow": "ellipsis", + "linkColor": "#3377ff", + "linkHoverColor": "", + "linkActiveColor": "" + } + ] + }, + { + "title": "Name", + "showTitle": true, + "isCustom": false, + "dataIndex": "name", + "width": "200", + "autoWidth": "fixed", + "render": { + "compType": "text", + "comp": { + "text": "{{currentCell}}" + } + }, + "align": "left", + "fixed": "close", + "editable": true, + "background": "", + "margin": "", + "text": "", + "border": "", + "borderWidth": "", + "radius": "", + "textSize": "", + "textWeight": "normal", + "fontFamily": "sans-serif", + "fontStyle": "normal", + "textOverflow": "ellipsis", + "linkColor": "#3377ff", + "linkHoverColor": "", + "linkActiveColor": "", + "summaryColumns": [ + { + "isCustom": false, + "dataIndex": "", + "render": { + "compType": "text", + "comp": {} + }, + "align": "left", + "background": "", + "margin": "", + "text": "", + "border": "", + "radius": "", + "textSize": "", + "textWeight": "normal", + "fontFamily": "sans-serif", + "fontStyle": "normal", + "textOverflow": "ellipsis", + "linkColor": "#3377ff", + "linkHoverColor": "", + "linkActiveColor": "" + }, + { + "isCustom": false, + "dataIndex": "", + "render": { + "compType": "text", + "comp": {} + }, + "align": "left", + "background": "", + "margin": "", + "text": "", + "border": "", + "radius": "", + "textSize": "", + "textWeight": "normal", + "fontFamily": "sans-serif", + "fontStyle": "normal", + "textOverflow": "ellipsis", + "linkColor": "#3377ff", + "linkHoverColor": "", + "linkActiveColor": "" + }, + { + "isCustom": false, + "dataIndex": "", + "render": { + "compType": "text", + "comp": {} + }, + "align": "left", + "background": "", + "margin": "", + "text": "", + "border": "", + "radius": "", + "textSize": "", + "textWeight": "normal", + "fontFamily": "sans-serif", + "fontStyle": "normal", + "textOverflow": "ellipsis", + "linkColor": "#3377ff", + "linkHoverColor": "", + "linkActiveColor": "" + } + ] + }, + { + "title": "Date", + "showTitle": true, + "isCustom": false, + "dataIndex": "date", + "width": "110", + "autoWidth": "fixed", + "render": { + "compType": "text", + "comp": { + "text": "{{currentCell}}" + } + }, + "align": "left", + "fixed": "close", + "editable": true, + "background": "", + "margin": "", + "text": "", + "border": "", + "borderWidth": "", + "radius": "", + "textSize": "", + "textWeight": "normal", + "fontFamily": "sans-serif", + "fontStyle": "normal", + "textOverflow": "ellipsis", + "linkColor": "#3377ff", + "linkHoverColor": "", + "linkActiveColor": "", + "summaryColumns": [ + { + "isCustom": false, + "dataIndex": "", + "render": { + "compType": "text", + "comp": {} + }, + "align": "left", + "background": "", + "margin": "", + "text": "", + "border": "", + "radius": "", + "textSize": "", + "textWeight": "normal", + "fontFamily": "sans-serif", + "fontStyle": "normal", + "textOverflow": "ellipsis", + "linkColor": "#3377ff", + "linkHoverColor": "", + "linkActiveColor": "" + }, + { + "isCustom": false, + "dataIndex": "", + "render": { + "compType": "text", + "comp": {} + }, + "align": "left", + "background": "", + "margin": "", + "text": "", + "border": "", + "radius": "", + "textSize": "", + "textWeight": "normal", + "fontFamily": "sans-serif", + "fontStyle": "normal", + "textOverflow": "ellipsis", + "linkColor": "#3377ff", + "linkHoverColor": "", + "linkActiveColor": "" + }, + { + "isCustom": false, + "dataIndex": "", + "render": { + "compType": "text", + "comp": {} + }, + "align": "left", + "background": "", + "margin": "", + "text": "", + "border": "", + "radius": "", + "textSize": "", + "textWeight": "normal", + "fontFamily": "sans-serif", + "fontStyle": "normal", + "textOverflow": "ellipsis", + "linkColor": "#3377ff", + "linkHoverColor": "", + "linkActiveColor": "" + } + ] + }, + { + "title": "Department", + "showTitle": true, + "isCustom": false, + "dataIndex": "department", + "width": "250", + "autoWidth": "fixed", + "render": { + "compType": "tag", + "comp": { + "text": "{{currentCell}}", + "tagColors": { + "optionType": "manual", + "manual": { + "manual": [ + { + "label": "Tag1", + "icon": "/icon:solid/tag", + "color": "#f50" + }, + { + "label": "Tag2", + "icon": "/icon:solid/tag", + "color": "#2db7f5" + } + ] + }, + "mapData": { + "data": "[]", + "mapData": { + "color": "" + } + } + } + } + }, + "align": "left", + "fixed": "close", + "editable": true, + "background": "", + "margin": "", + "text": "", + "border": "", + "borderWidth": "", + "radius": "", + "textSize": "", + "textWeight": "normal", + "fontFamily": "sans-serif", + "fontStyle": "normal", + "textOverflow": "ellipsis", + "linkColor": "#3377ff", + "linkHoverColor": "", + "linkActiveColor": "", + "summaryColumns": [ + { + "isCustom": false, + "dataIndex": "", + "render": { + "compType": "text", + "comp": {} + }, + "align": "left", + "background": "", + "margin": "", + "text": "", + "border": "", + "radius": "", + "textSize": "", + "textWeight": "normal", + "fontFamily": "sans-serif", + "fontStyle": "normal", + "textOverflow": "ellipsis", + "linkColor": "#3377ff", + "linkHoverColor": "", + "linkActiveColor": "" + }, + { + "isCustom": false, + "dataIndex": "", + "render": { + "compType": "text", + "comp": {} + }, + "align": "left", + "background": "", + "margin": "", + "text": "", + "border": "", + "radius": "", + "textSize": "", + "textWeight": "normal", + "fontFamily": "sans-serif", + "fontStyle": "normal", + "textOverflow": "ellipsis", + "linkColor": "#3377ff", + "linkHoverColor": "", + "linkActiveColor": "" + }, + { + "isCustom": false, + "dataIndex": "", + "render": { + "compType": "text", + "comp": {} + }, + "align": "left", + "background": "", + "margin": "", + "text": "", + "border": "", + "radius": "", + "textSize": "", + "textWeight": "normal", + "fontFamily": "sans-serif", + "fontStyle": "normal", + "textOverflow": "ellipsis", + "linkColor": "#3377ff", + "linkHoverColor": "", + "linkActiveColor": "" + } + ] + } +]; +const expansion = { + "expandable": true, + "slot": { + "container": { + "layout": { + "d7274235": { + "i": "d7274235", + "h": 8, + "w": 24, + "x": 0, + "y": 0, + "pos": 0 + } + }, + "items": { + "d7274235": { + "compType": "text", + "comp": { + "text": "### You can configure/add any component inside the Exapandable Table View", + "autoHeight": "auto", + "type": "markdown", + "horizontalAlignment": "center", + "contentScrollBar": true, + "verticalAlignment": "center", + "margin": { + "left": "", + "right": "", + "top": "", + "bottom": "" + }, + "padding": { + "left": "", + "right": "", + "top": "", + "bottom": "" + }, + "showDataLoadingIndicators": false, + "preventStyleOverwriting": false, + "appliedThemeId": "", + "version": "latest" + }, + "name": "text1" + } + } + } + } +}; +const style= { + "margin": "10px", + "padding": "20px", + "borderStyle": "dashed", + "borderWidth": "3px", + "background": "linear-gradient(135deg, #72afd3 0%, #96e6a1 100%)", + "border": "#000", + "radius": "10px" +}; +const headerStyle = { + "margin": "10px", + "fontFamily": "Courier New", + "fontStyle": "italic", + "text": "#222222", + "headerBackground": "#F7A007", + "border": "#E67373", + "borderWidth": "7px", + "textSize": "25px" +}; +const toolbarStyle = { + "margin": "0px", + "background": "#F7A007", + "border": "#E67373", + "toolbarText": "#FFFFFF" +}; +const rowStyle = { + "borderWidth": "10px", + "borderStyle": "dashed", + "background": "linear-gradient(0deg, #fdfbfb 0%, #ebedee 100%)", + "border": "#222222", + "radius": "10px", + "selectedRowBackground": "#3377FF", + "hoverRowBackground": "#FFF6E6", + "alternateBackground": "linear-gradient(0deg, #FFFFFF 0%, rgba(235, 237, 238, 1) 100%)" +}; +const columnStyle = { + "background": "linear-gradient(90deg, RGBA(247, 160, 7, 1) 0%, rgba(254,225,64,1) 100%)", + "border": "#222222", + "margin": "10px", + "radius": "10px", + "text": "#000000", + "textSize": "15px", + "textWeight": "bold", + "fontFamily": "Courier New", + "fontStyle": "italic" +}; +const summaryRowStyle = { + "borderWidth": "5px", + "borderStyle": "dashed", + "background": "#D7D9E0", + "border": "#222222", + "radius": "10px", + "margin": "1px", + "text": "#FFFFFF", + "textSize": "15px", + "textWeight": "bold", + "fontFamily": "Courier New", + "fontStyle": "italic" +}; + export default function TableExample() { const blackListConfig: string[] = ["data", "size"]; const nameMap: Record = { @@ -77,29 +611,54 @@ export default function TableExample() { + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ); }