- {#if paginationEnabled}
+ {#if paginationEnabled && result.length > (tableOptions.initialState?.pagination?.pageSize ?? 25)}
diff --git a/frontend/src/lib/components/apps/editor/GridEditor.svelte b/frontend/src/lib/components/apps/editor/GridEditor.svelte
index 59dae733c9..5a89e47154 100644
--- a/frontend/src/lib/components/apps/editor/GridEditor.svelte
+++ b/frontend/src/lib/components/apps/editor/GridEditor.svelte
@@ -124,7 +124,7 @@
selectComponent(detail.id)}
diff --git a/frontend/src/lib/components/apps/editor/componentsPanel/ComponentList.svelte b/frontend/src/lib/components/apps/editor/componentsPanel/ComponentList.svelte
index e49f7af63f..7c35cb8dd5 100644
--- a/frontend/src/lib/components/apps/editor/componentsPanel/ComponentList.svelte
+++ b/frontend/src/lib/components/apps/editor/componentsPanel/ComponentList.svelte
@@ -16,14 +16,16 @@
const { app, selectedComponent } = getContext('AppEditorContext')
- function getMinDimensionsByComponent(componentType: AppComponent['type'], column: number): Size {
+ function getRecommendedDimensionsByComponent(
+ componentType: AppComponent['type'],
+ column: number
+ ): Size {
// Dimensions key formula: :-:
const dimensions: Record<`${number}:${number}-${number}:${number}`, AppComponent['type'][]> = {
- '4:1-4:1': ['textcomponent'],
- '2:1-2:1': ['buttoncomponent'],
- '2:2-2:2': ['htmlcomponent'],
- '4:2-4:2': [
- 'checkboxcomponent',
+ '1:1-3:1': ['textcomponent'],
+ '1:1-1:1': ['buttoncomponent', 'checkboxcomponent'],
+ '1:2-1:2': ['htmlcomponent'],
+ '2:1-3:1': [
'textinputcomponent',
'numberinputcomponent',
'selectcomponent',
@@ -31,14 +33,14 @@
'dateinputcomponent'
],
'3:5-6:5': ['formcomponent'],
- '4:12-4:12': [
+ '2:8-6:8': [
'timeseriescomponent',
'barchartcomponent',
'piechartcomponent',
'displaycomponent',
'scatterchartcomponent'
],
- '3:10-6:12': ['tablecomponent']
+ '3:10-6:10': ['tablecomponent']
}
// Finds the key that is associated with the component type and extracts the dimensions from it
const [dimension] = Object.entries(dimensions).find(([_, value]) =>
@@ -49,22 +51,6 @@
return { w: +size[0], h: +size[1] }
}
- function getMaxDimensionsByComponent(componentType: AppComponent['type'], column: number): Size {
- if (
- [
- 'textinputcomponent',
- 'numberinputcomponent',
- 'selectcomponent',
- 'dateinputcomponent',
- 'passwordinputcomponent',
- 'buttoncomponent'
- ].includes(componentType)
- ) {
- return { w: column, h: 2 }
- }
- return { w: column, h: 80 }
- }
-
function addComponent(appComponent: AppComponent) {
$dirtyStore = true
const grid = $app.grid ?? []
@@ -90,12 +76,17 @@
}
gridColumns.forEach((column) => {
- const min = getMinDimensionsByComponent(appComponent.type, column)
- const max = getMaxDimensionsByComponent(appComponent.type, column)
+ const rec = getRecommendedDimensionsByComponent(appComponent.type, column)
- newItem[column] = { ...newComponent, min, max, w: min.w, h: min.h }
+ newItem[column] = {
+ ...newComponent,
+ min: { w: 1, h: 1 },
+ max: { w: column, h: 100 },
+ w: rec.w,
+ h: rec.h
+ }
const position = gridHelp.findSpace(newItem, grid, column) as { x: number; y: number }
- newItem[column] = { ...newItem[column], ...position, min, max }
+ newItem[column] = { ...newItem[column], ...position }
})
$app.grid = [...grid, newItem]
diff --git a/frontend/src/lib/components/apps/editor/componentsPanel/data.ts b/frontend/src/lib/components/apps/editor/componentsPanel/data.ts
index 101f15a29f..04e961f50b 100644
--- a/frontend/src/lib/components/apps/editor/componentsPanel/data.ts
+++ b/frontend/src/lib/components/apps/editor/componentsPanel/data.ts
@@ -5,6 +5,7 @@ const inputs: ComponentSet = {
title: 'Inputs',
components: [
{
+ softWrap: true,
verticalAlignment: 'center',
id: 'textinputcomponent',
type: 'textinputcomponent',
@@ -20,22 +21,39 @@ const inputs: ComponentSet = {
card: false
},
{
+ softWrap: true,
verticalAlignment: 'center',
id: 'passwordinputcomponent',
type: 'passwordinputcomponent',
componentInput: undefined,
- configuration: {},
+ configuration: {
+ placeholder: {
+ type: 'static',
+ value: 'Password',
+ fieldType: 'text',
+ onlyStatic: true,
+ },
+ },
card: false
},
{
+ softWrap: true,
verticalAlignment: 'center',
id: 'numberinputcomponent',
type: 'numberinputcomponent',
componentInput: undefined,
- configuration: {},
+ configuration: {
+ placeholder: {
+ type: 'static',
+ value: 'Type...',
+ fieldType: 'text',
+ onlyStatic: true,
+ },
+ },
card: false
},
{
+ softWrap: true,
verticalAlignment: 'center',
id: 'dateinputcomponent',
type: 'dateinputcomponent',
@@ -53,10 +71,10 @@ const inputs: ComponentSet = {
}
},
card: false,
- softWrap: true
},
{
...defaultAlignement,
+ softWrap: true,
id: 'checkboxcomponent',
type: 'checkboxcomponent',
componentInput: undefined,
@@ -115,9 +133,8 @@ const buttons: ComponentSet = {
configuration: {
label: {
type: 'static',
-
fieldType: 'text',
- value: 'Lorem ipsum'
+ value: 'Press me'
},
color: {
fieldType: 'select',
@@ -238,12 +255,6 @@ const display: ComponentSet = {
onlyStatic: true,
optionValuesKey: 'tableSearchOptions',
value: 'Disabled'
- },
- pagination: {
- type: 'static',
- onlyStatic: true,
- fieldType: 'boolean',
- value: true
}
},
componentInput: {
@@ -253,13 +264,13 @@ const display: ComponentSet = {
value: [
{
id: 1,
- name: 'Lorem ipsum',
+ name: 'A cell with a long name',
age: 42
},
{
id: 2,
- name: 'Lorem ipsum',
- age: 42
+ name: 'A briefer cell',
+ age: 84
}
],
diff --git a/frontend/src/lib/components/apps/editor/settingsPanel/mainInput/RunnableSelector.svelte b/frontend/src/lib/components/apps/editor/settingsPanel/mainInput/RunnableSelector.svelte
index 5b068932e5..56e62a9fed 100644
--- a/frontend/src/lib/components/apps/editor/settingsPanel/mainInput/RunnableSelector.svelte
+++ b/frontend/src/lib/components/apps/editor/settingsPanel/mainInput/RunnableSelector.svelte
@@ -103,7 +103,7 @@
acc.push(componentInput.runnable.name)
}
- if (componentInput.type === 'tablecomponent') {
+ if (componentInput?.type === 'tablecomponent') {
componentInput.actionButtons.forEach((actionButton) => {
if (actionButton.componentInput?.type === 'runnable') {
if (actionButton.componentInput.runnable?.type === 'runnableByName') {
diff --git a/frontend/src/lib/components/apps/editorUtils.ts b/frontend/src/lib/components/apps/editorUtils.ts
index e1be0d2fc9..d91ef56636 100644
--- a/frontend/src/lib/components/apps/editorUtils.ts
+++ b/frontend/src/lib/components/apps/editorUtils.ts
@@ -1,3 +1,11 @@
export function defaultCode(component: string, language: string): string | undefined {
+ if (component === 'tablecomponent' && language === 'deno') {
+ return `export async function main(x: string) {
+ return [
+ { foo: x, bar: 42 },
+ { foo: "static", bar: 84 }]
+}
+`
+ }
return undefined
}
\ No newline at end of file