diff --git a/packages/bbui/package.json b/packages/bbui/package.json index 1b814be96d..99535e6b33 100644 --- a/packages/bbui/package.json +++ b/packages/bbui/package.json @@ -84,7 +84,7 @@ "@spectrum-css/vars": "3.0.1", "dayjs": "^1.10.4", "easymde": "^2.16.1", - "svelte-flatpickr": "^3.3.2", + "svelte-flatpickr": "^3.2.3", "svelte-portal": "^1.0.0" }, "resolutions": { diff --git a/packages/bbui/src/ActionButton/ActionButton.svelte b/packages/bbui/src/ActionButton/ActionButton.svelte index e9eb3b3471..60c8bec80b 100644 --- a/packages/bbui/src/ActionButton/ActionButton.svelte +++ b/packages/bbui/src/ActionButton/ActionButton.svelte @@ -71,7 +71,7 @@ {/if} {#if icon}
+
{#if selectedImage} {#if gallery} diff --git a/packages/bbui/src/Table/ArrayRenderer.svelte b/packages/bbui/src/Table/ArrayRenderer.svelte index 637454dbca..3755850666 100644 --- a/packages/bbui/src/Table/ArrayRenderer.svelte +++ b/packages/bbui/src/Table/ArrayRenderer.svelte @@ -5,9 +5,8 @@ const displayLimit = 5 - $: arrayValue = Array.isArray(value) ? value : [value].filter(x => !!x) - $: badges = arrayValue.slice(0, displayLimit) - $: leftover = arrayValue.length - badges.length + $: badges = Array.isArray(value) ? value.slice(0, displayLimit) : [] + $: leftover = (value?.length ?? 0) - badges.length {#each badges as badge} diff --git a/packages/bbui/src/Table/Table.svelte b/packages/bbui/src/Table/Table.svelte index 5bb4ed4523..19d361c8b1 100644 --- a/packages/bbui/src/Table/Table.svelte +++ b/packages/bbui/src/Table/Table.svelte @@ -143,7 +143,7 @@ } fields?.forEach(field => { const fieldSchema = schema[field] - if (fieldSchema.width && typeof fieldSchema.width === "string") { + if (fieldSchema.width) { style += ` ${fieldSchema.width}` } else { style += " minmax(auto, 1fr)" diff --git a/packages/bbui/src/bbui.css b/packages/bbui/src/bbui.css index 343aa77b27..ef3483d3df 100644 --- a/packages/bbui/src/bbui.css +++ b/packages/bbui/src/bbui.css @@ -97,22 +97,4 @@ a { text-decoration: none; -} - -/* Custom theme additions */ -.spectrum--darkest { - --drop-shadow: rgba(0, 0, 0, 0.6); - --spectrum-global-color-blue-100: rgb(28, 33, 43); -} -.spectrum--dark { - --drop-shadow: rgba(0, 0, 0, 0.3); - --spectrum-global-color-blue-100: rgb(42, 47, 57); -} -.spectrum--light { - --drop-shadow: rgba(0, 0, 0, 0.075); - --spectrum-global-color-blue-100: rgb(240, 245, 255); -} -.spectrum--lightest { - --drop-shadow: rgba(0, 0, 0, 0.05); - --spectrum-global-color-blue-100: rgb(240, 244, 255); -} +} \ No newline at end of file diff --git a/packages/builder/src/components/backend/DataTable/DataTable.svelte b/packages/builder/src/components/backend/DataTable/DataTable.svelte index acb3dacf93..0c5adfc18c 100644 --- a/packages/builder/src/components/backend/DataTable/DataTable.svelte +++ b/packages/builder/src/components/backend/DataTable/DataTable.svelte @@ -1,74 +1,286 @@ -
- + tables.updateTable(e.detail)} + data={$fetch.rows} + bind:hideAutocolumns + loading={!$fetch.loaded} + on:sort={onSort} + allowEditing + disableSorting + on:updatecolumns={onUpdateColumns} + on:updaterows={onUpdateRows} + on:selectionUpdated={e => { + selectedRows = e.detail + }} + customPlaceholder > - - {#if isInternal} - - {/if} - - {#if isUsersTable} - - {/if} - {#if !isInternal} - - {/if} - - - - - - {#if isUsersTable} - - {:else} - - {/if} - - +
+
+ + {#if !isUsersTable} + + {/if} + {#if isInternal} + + {/if} +
+
+ + {#if isUsersTable} + + {/if} + {#if !isInternal} + + {/if} + + + + {#key id} + + {/key} +
+
+
+ + {#if !hasCols} + Let's create some columns + + Start building out your table structure
+ by adding some columns + + {:else} + Now let's add a row + + Add some data to your table
+ by adding some rows + + {/if} +
+
+
+ {#key id} +
+ +
+ {/key}
diff --git a/packages/builder/src/components/backend/DataTable/Table.svelte b/packages/builder/src/components/backend/DataTable/Table.svelte index 4df6e9a306..a0e777c331 100644 --- a/packages/builder/src/components/backend/DataTable/Table.svelte +++ b/packages/builder/src/components/backend/DataTable/Table.svelte @@ -1,10 +1,15 @@ @@ -97,6 +138,16 @@ {/if}
+ {#if !isUsersTable && selectedRows.length > 0} + { + await deleteRows(rows) + resetSelectedRows() + }} + /> + {/if}
{#key tableId} @@ -109,7 +160,13 @@ {rowCount} {disableSorting} {customPlaceholder} + bind:selectedRows + allowSelectRows={allowEditing && !isUsersTable} + allowEditRows={allowEditing} + allowEditColumns={allowEditing} showAutoColumns={!hideAutocolumns} + on:editcolumn={e => editColumn(e.detail)} + on:editrow={e => editRow(e.detail)} on:clickrelationship={e => selectRelationship(e.detail)} on:sort > @@ -119,6 +176,42 @@ {/key} + + { + confirmDelete.show() + }} + row={editableRow} + /> + + + { + if (editableRow) { + await deleteRows([editableRow]) + } + editableRow = undefined + }} + onCancel={async () => { + editRow(editableRow) + }} + title="Confirm Deletion" +> + Are you sure you want to delete this row? + + + + + + diff --git a/packages/builder/src/components/start/AppRow.svelte b/packages/builder/src/components/start/AppRow.svelte index 34d083a096..96c0e2154a 100644 --- a/packages/builder/src/components/start/AppRow.svelte +++ b/packages/builder/src/components/start/AppRow.svelte @@ -59,7 +59,9 @@
- +
diff --git a/packages/builder/src/global.css b/packages/builder/src/global.css index bc1f55d9d3..5e9a35706e 100644 --- a/packages/builder/src/global.css +++ b/packages/builder/src/global.css @@ -70,6 +70,7 @@ a { background: var(--spectrum-alias-background-color-default); } html * { + scrollbar-width: thin; scrollbar-color: var(--spectrum-global-color-gray-400) var(--spectrum-alias-background-color-default); } diff --git a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/components/[componentId]/new/_components/componentStructure.json b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/components/[componentId]/new/_components/componentStructure.json index d35e7cd515..5da16d2b50 100644 --- a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/components/[componentId]/new/_components/componentStructure.json +++ b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/components/[componentId]/new/_components/componentStructure.json @@ -28,7 +28,6 @@ "dataprovider", "repeater", "table", - "spreadsheet", "dynamicfilter", "daterangepicker" ] diff --git a/packages/builder/src/stores/backend/tables.js b/packages/builder/src/stores/backend/tables.js index 75679532f3..3b7ce35dde 100644 --- a/packages/builder/src/stores/backend/tables.js +++ b/packages/builder/src/stores/backend/tables.js @@ -135,24 +135,6 @@ export function createTablesStore() { await save(draft) } - const updateTable = table => { - const index = get(store).list.findIndex(x => x._id === table._id) - if (index === -1) { - return - } - - // This function has to merge state as there discrepancies with the table - // API endpoints. The table list endpoint and get table endpoint use the - // "type" property to mean different things. - store.update(state => { - state.list[index] = { - ...table, - type: state.list[index].type, - } - return state - }) - } - return { subscribe: derivedStore.subscribe, fetch, @@ -163,7 +145,6 @@ export function createTablesStore() { delete: deleteTable, saveField, deleteField, - updateTable, } } diff --git a/packages/client/manifest.json b/packages/client/manifest.json index f27d090617..c4408b9202 100644 --- a/packages/client/manifest.json +++ b/packages/client/manifest.json @@ -5161,36 +5161,5 @@ "type": "schema", "suffix": "repeater" } - }, - "spreadsheet": { - "name": "Spreadsheet", - "icon": "ViewGrid", - "settings": [ - { - "key": "table", - "type": "table", - "label": "Table" - }, - { - "type": "filter", - "label": "Filtering", - "key": "filter" - }, - { - "type": "field/sortable", - "label": "Sort Column", - "key": "sortColumn" - }, - { - "type": "select", - "label": "Sort Order", - "key": "sortOrder", - "options": [ - "Ascending", - "Descending" - ], - "defaultValue": "Ascending" - } - ] } } diff --git a/packages/client/src/components/ClientApp.svelte b/packages/client/src/components/ClientApp.svelte index ce8722bb9b..d69170702c 100644 --- a/packages/client/src/components/ClientApp.svelte +++ b/packages/client/src/components/ClientApp.svelte @@ -95,7 +95,7 @@ {#if $builderStore.usedPlugins?.length} - {#each $builderStore.usedPlugins as plugin (plugin.hash)} + {#each $builderStore.usedPlugins as plugin} {/each} {/if} diff --git a/packages/client/src/sdk.js b/packages/client/src/sdk.js index c9ff1eba36..264cc85626 100644 --- a/packages/client/src/sdk.js +++ b/packages/client/src/sdk.js @@ -12,7 +12,6 @@ import { environmentStore, sidePanelStore, dndIsDragging, - confirmationStore, } from "stores" import { styleable } from "utils/styleable" import { linkable } from "utils/linkable" @@ -36,7 +35,6 @@ export default { sidePanelStore, dndIsDragging, currentRole, - confirmationStore, styleable, linkable, getAction, diff --git a/packages/client/src/utils/domDebounce.js b/packages/client/src/utils/domDebounce.js index b15d2698b4..b7fc017247 100644 --- a/packages/client/src/utils/domDebounce.js +++ b/packages/client/src/utils/domDebounce.js @@ -1,14 +1,12 @@ -export const domDebounce = (callback, extractParams = x => x) => { +export const domDebounce = callback => { let active = false - let lastParams - return (...params) => { - lastParams = extractParams(...params) + return e => { if (!active) { - active = true - requestAnimationFrame(() => { - callback(lastParams) + window.requestAnimationFrame(() => { + callback(e) active = false }) + active = true } } } diff --git a/packages/frontend-core/package.json b/packages/frontend-core/package.json index 48161defb8..4f1cc2930d 100644 --- a/packages/frontend-core/package.json +++ b/packages/frontend-core/package.json @@ -8,9 +8,7 @@ "dependencies": { "@budibase/bbui": "2.5.6-alpha.6", "@budibase/shared-core": "2.5.6-alpha.6", - "dayjs": "^1.11.7", "lodash": "^4.17.21", - "socket.io-client": "^4.6.1", "svelte": "^3.46.2" } } diff --git a/packages/frontend-core/src/components/grid/cells/AttachmentCell.svelte b/packages/frontend-core/src/components/grid/cells/AttachmentCell.svelte deleted file mode 100644 index 2eb191e113..0000000000 --- a/packages/frontend-core/src/components/grid/cells/AttachmentCell.svelte +++ /dev/null @@ -1,153 +0,0 @@ - - -
- {#each value || [] as attachment} - {#if isImage(attachment.extension)} - {attachment.extension} - {:else} -
- {attachment.extension} -
- {/if} - {/each} -
- -{#if isOpen} -
- onChange(e.detail)} - {processFiles} - {deleteAttachments} - {handleFileTooLarge} - /> -
-{/if} - - diff --git a/packages/frontend-core/src/components/grid/cells/BooleanCell.svelte b/packages/frontend-core/src/components/grid/cells/BooleanCell.svelte deleted file mode 100644 index 52aecb07a7..0000000000 --- a/packages/frontend-core/src/components/grid/cells/BooleanCell.svelte +++ /dev/null @@ -1,44 +0,0 @@ - - -
- -
- - diff --git a/packages/frontend-core/src/components/grid/cells/DataCell.svelte b/packages/frontend-core/src/components/grid/cells/DataCell.svelte deleted file mode 100644 index d97edabc01..0000000000 --- a/packages/frontend-core/src/components/grid/cells/DataCell.svelte +++ /dev/null @@ -1,86 +0,0 @@ - - - focusedCellId.set(cellId)} - on:contextmenu={e => menu.actions.open(cellId, e)} - width={column.width} -> - - diff --git a/packages/frontend-core/src/components/grid/cells/DateCell.svelte b/packages/frontend-core/src/components/grid/cells/DateCell.svelte deleted file mode 100644 index 0112bcda15..0000000000 --- a/packages/frontend-core/src/components/grid/cells/DateCell.svelte +++ /dev/null @@ -1,77 +0,0 @@ - - -
-
- {#if value} - {dayjs(timeOnly ? time : value).format(format)} - {/if} -
- {#if editable} - - {/if} -
- -{#if editable} -
- onChange(e.detail)} - appendTo={document.documentElement} - enableTime={!dateOnly} - {timeOnly} - time24hr - ignoreTimezones={schema.ignoreTimezones} - /> -
-{/if} - - diff --git a/packages/frontend-core/src/components/grid/cells/FormulaCell.svelte b/packages/frontend-core/src/components/grid/cells/FormulaCell.svelte deleted file mode 100644 index b4db795e44..0000000000 --- a/packages/frontend-core/src/components/grid/cells/FormulaCell.svelte +++ /dev/null @@ -1,5 +0,0 @@ - - - diff --git a/packages/frontend-core/src/components/grid/cells/GridCell.svelte b/packages/frontend-core/src/components/grid/cells/GridCell.svelte deleted file mode 100644 index 52dbed641c..0000000000 --- a/packages/frontend-core/src/components/grid/cells/GridCell.svelte +++ /dev/null @@ -1,159 +0,0 @@ - - -
- {#if error} -
- {error} -
- {/if} - - {#if selectedUser && !focused} -
- {selectedUser.label} -
- {/if} -
- - diff --git a/packages/frontend-core/src/components/grid/cells/HeaderCell.svelte b/packages/frontend-core/src/components/grid/cells/HeaderCell.svelte deleted file mode 100644 index 890f314e2e..0000000000 --- a/packages/frontend-core/src/components/grid/cells/HeaderCell.svelte +++ /dev/null @@ -1,237 +0,0 @@ - - -
- - -
- {column.label} -
- {#if sortedBy} -
- -
- {/if} -
(open = true)} - > - -
-
-
- - - - - Edit column - - - Use as display column - - - Sort A-Z - - - Sort Z-A - - - Move left - - - Move right - - - - - diff --git a/packages/frontend-core/src/components/grid/cells/JSONCell.svelte b/packages/frontend-core/src/components/grid/cells/JSONCell.svelte deleted file mode 100644 index 30803fd862..0000000000 --- a/packages/frontend-core/src/components/grid/cells/JSONCell.svelte +++ /dev/null @@ -1,36 +0,0 @@ - - - diff --git a/packages/frontend-core/src/components/grid/cells/LongFormCell.svelte b/packages/frontend-core/src/components/grid/cells/LongFormCell.svelte deleted file mode 100644 index f41e206d1d..0000000000 --- a/packages/frontend-core/src/components/grid/cells/LongFormCell.svelte +++ /dev/null @@ -1,117 +0,0 @@ - - -{#if isOpen} -