Skip to content

Commit

Permalink
Merge pull request #77 from poirazis/develop
Browse files Browse the repository at this point in the history
v2.0.28-alpha
  • Loading branch information
poirazis authored Jul 31, 2024
2 parents 77482b6 + 6b0570d commit 3883d55
Show file tree
Hide file tree
Showing 4 changed files with 150 additions and 81 deletions.
Binary file modified bun.lockb
Binary file not shown.
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "bb-component-SuperTable",
"version": "2.0.27-alpha",
"version": "2.0.28-alpha",
"description": "A Fully Customizable Budibase Table Component",
"author": "Michael Poirazi",
"license": "MIT",
Expand All @@ -18,10 +18,10 @@
"svelte-legos": "^0.2.3"
},
"devDependencies": {
"@budibase/backend-core": "^2.29.25",
"@budibase/bbui": "^2.29.25",
"@budibase/frontend-core": "^2.29.25",
"@budibase/shared-core": "^2.29.25",
"@budibase/backend-core": "^2.29.27",
"@budibase/bbui": "^2.29.27",
"@budibase/frontend-core": "^2.29.27",
"@budibase/shared-core": "^2.29.27",
"@rollup/plugin-commonjs": "^25.0.8",
"@rollup/plugin-image": "^3.0.3",
"@rollup/plugin-json": "^6.1.0",
Expand Down
202 changes: 127 additions & 75 deletions schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,12 @@
"label": "Data Source",
"required": true
},
{
"type": "boolean",
"key": "isTable",
"label": "Is Table",
"hidden": true
},
{
"type": "field",
"key": "idColumn",
Expand Down Expand Up @@ -98,6 +104,13 @@
"key": "limit",
"defaultValue": 50
},
{
"type": "columns",
"key": "columnList",
"resetOn": "datasource",
"label": "Columns",
"nested": "true"
},
{
"type": "boolean",
"key": "fetchOnScroll",
Expand Down Expand Up @@ -133,27 +146,9 @@
},
{
"section": true,
"name": "Column Settings",
"name": "Table Features",
"collapsed": true,
"settings": [
{
"type": "columns",
"key": "columnList",
"resetOn": "datasource",
"label": "Columns",
"nested": "true"
},
{
"type": "boolean",
"key": "autocolumns",
"label": "Auto Columns",
"defaultValue": false
},
{
"type": "boolean",
"key": "jsoncolumns",
"label": "JSON Columns",
"defaultValue": false
},
{
"type": "select",
"key": "superColumnsPos",
Expand All @@ -177,38 +172,6 @@
],
"defaultValue": "first"
},
{
"type": "boolean",
"key": "showHeader",
"label": "Column Headers",
"defaultValue": true
},
{
"type": "boolean",
"key": "showFooter",
"label": "Column Footers",
"defaultValue": false
},
{
"type": "boolean",
"key": "canResize",
"label": "Resize Columns",
"defaultValue": true
},
{
"type": "boolean",
"key": "selectionColumn",
"label": "Selection Column",
"resetOn": "rowSelectMode",
"defaultValue": true
}
]
},
{
"section": true,
"name": "Table Settings",
"collapsed": true,
"settings": [
{
"type": "select",
"key": "rowSelectMode",
Expand Down Expand Up @@ -276,18 +239,59 @@
},
{
"type": "select",
"key": "canInsert",
"label": "Add Row",
"showInBar": true,
"barStyle": "buttons",
"barTitle": "Add Row",
"options": [
{ "label": "Off", "value": false, "barIcon": "Close" },
{
"label": "Insert Inline",
"value": "simple",
"barIcon": "FlashAuto"
},
{
"label": "Insert Custom",
"value": "advanced",
"barIcon": "Events"
}
],
"defaultValue": false
},
{
"type": "select",
"dependsOn": "isTable",
"key": "canEdit",
"label": "Editing",
"label": "Edit Row",
"showInBar": true,
"barStyle": "buttons",
"barTitle": "Editing",
"options": [
{ "label": "Off", "value": false, "barIcon": "Close" },
{ "label": "Simple", "value": "simple", "barIcon": "Edit" },
{ "label": "Simple", "value": "simple", "barIcon": "FlashAuto" },
{
"label": "Advanced",
"value": "advanced",
"barIcon": "Events"
}
],
"defaultValue": false
},
{
"type": "select",
"key": "canDelete",
"label": "Delete Row",
"showInBar": true,
"barStyle": "buttons",
"barTitle": "Delete Row",
"options": [
{ "label": "Off", "value": false, "barIcon": "Close" },
{ "label": "Simple", "value": "simple", "barIcon": "FlashAuto" },
{
"label": "Advanced",
"value": "advanced",
"barIcon": "GearsEdit"
"barIcon": "Events"
}
],
"defaultValue": false
Expand All @@ -305,36 +309,59 @@
],
"defaultValue": "horizontal"
},

{
"type": "boolean",
"key": "canInsert",
"label": "Insert",
"defaultValue": false,
"key": "canSort",
"label": "Sort",
"defaultValue": true,
"showInBar": true,
"barStyle": "buttons",
"barIcon": "Add",
"barTitle": "Add New Row"
"barIcon": "SortOrderDown",
"barTitle": "Sortable"
}
]
},
{
"section": true,
"name": "Column Settings",
"collapsed": true,
"settings": [
{
"type": "boolean",
"key": "autocolumns",
"label": "Auto Columns",
"defaultValue": false
},
{
"type": "boolean",
"key": "canDelete",
"label": "Delete",
"defaultValue": false,
"showInBar": true,
"barStyle": "buttons",
"barIcon": "Delete",
"barTitle": "Delete Rows"
"key": "jsoncolumns",
"label": "JSON Columns",
"defaultValue": false
},
{
"type": "boolean",
"key": "canSort",
"label": "Sort",
"defaultValue": true,
"showInBar": true,
"barStyle": "buttons",
"barIcon": "SortOrderDown",
"barTitle": "Sortable"
"key": "showHeader",
"label": "Column Headers",
"defaultValue": true
},
{
"type": "boolean",
"key": "showFooter",
"label": "Column Footers",
"defaultValue": false
},
{
"type": "boolean",
"key": "canResize",
"label": "Resize Columns",
"defaultValue": true
},
{
"type": "boolean",
"key": "selectionColumn",
"label": "Selection Column",
"resetOn": "rowSelectMode",
"defaultValue": true
}
]
},
Expand Down Expand Up @@ -610,6 +637,11 @@
"type": "event",
"label": "On Row Select",
"key": "onRowSelect",
"dependsOn": {
"setting": "rowSelectMode",
"value": "off",
"invert": true
},
"context": [
{
"label": "Selected Rows",
Expand Down Expand Up @@ -644,6 +676,26 @@
"key": "value"
}
]
},
{
"type": "event",
"key": "onDelete",
"label": "On Delete",
"nested": true,
"dependsOn": "canDelete",
"context": [
{
"label": "RowID",
"key": "rowID"
}
]
},
{
"type": "event",
"key": "onInsert",
"label": "On New Row",
"nested": true,
"dependsOn": "canInsert"
}
]
}
Expand Down
19 changes: 18 additions & 1 deletion src/Component.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@
import { getContext } from "svelte";
import SuperTable from "../../bb_super_components_shared/src/lib/SuperTable/SuperTable.svelte";
const { styleable } = getContext("sdk");
const { styleable, memo, builderStore } = getContext("sdk");
const component = getContext("component");
export let datasource;
export let isTable;
export let idColumn;
export let sortColumn;
export let sortOrder;
Expand All @@ -25,6 +27,7 @@
export let showHeader;
export let size;
export let canInsert, canDelete, canEdit, canSort, canResize, canFilter;
export let deleteIconPosition = "left";
export let showFilterOperators;
export let superColumnsPos;
Expand Down Expand Up @@ -75,6 +78,17 @@
export let onCellChange;
export let onRowClick;
export let onRowDblClick;
export let onInsert;
export let onDelete;
$: localIsTable = datasource?.type == "table" || datasource?.tableId;
$: if (
$builderStore.inBuilder &&
$component.selected &&
isTable != localIsTable
) {
builderStore.actions.updateProp("isTable", localIsTable);
}
</script>
<div use:styleable={$component.styles}>
Expand All @@ -99,6 +113,7 @@
{size}
{canInsert}
{canDelete}
{deleteIconPosition}
{canEdit}
{canSort}
{canResize}
Expand Down Expand Up @@ -148,6 +163,8 @@
{onCellChange}
{onRowClick}
{onRowDblClick}
{onInsert}
{onDelete}
>
<slot />
</SuperTable>
Expand Down

0 comments on commit 3883d55

Please sign in to comment.