@budibase/frontend-core 2.11.14 → 2.11.15-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,17 +1,17 @@
1
1
  {
2
2
  "name": "@budibase/frontend-core",
3
- "version": "2.11.14",
3
+ "version": "2.11.15-alpha.1",
4
4
  "description": "Budibase frontend core libraries used in builder and client",
5
5
  "author": "Budibase",
6
6
  "license": "MPL-2.0",
7
7
  "svelte": "src/index.js",
8
8
  "dependencies": {
9
- "@budibase/bbui": "2.11.14",
10
- "@budibase/shared-core": "2.11.14",
9
+ "@budibase/bbui": "2.11.15-alpha.1",
10
+ "@budibase/shared-core": "2.11.15-alpha.1",
11
11
  "dayjs": "^1.10.8",
12
12
  "lodash": "^4.17.21",
13
13
  "socket.io-client": "^4.6.1",
14
14
  "svelte": "^3.46.2"
15
15
  },
16
- "gitHead": "31ac54e0dd5a32309b21637bb1c762e72a26597a"
16
+ "gitHead": "50a3a76044016551fe83910d282da06e7f401172"
17
17
  }
@@ -17,13 +17,24 @@
17
17
  const { config, dispatch, selectedRows } = getContext("grid")
18
18
  const svelteDispatch = createEventDispatcher()
19
19
 
20
- const select = () => {
20
+ const select = e => {
21
+ e.stopPropagation()
21
22
  svelteDispatch("select")
22
23
  const id = row?._id
23
24
  if (id) {
24
25
  selectedRows.actions.toggleRow(id)
25
26
  }
26
27
  }
28
+
29
+ const bulkDelete = e => {
30
+ e.stopPropagation()
31
+ dispatch("request-bulk-delete")
32
+ }
33
+
34
+ const expand = e => {
35
+ e.stopPropagation()
36
+ svelteDispatch("expand")
37
+ }
27
38
  </script>
28
39
 
29
40
  <GridCell
@@ -56,7 +67,7 @@
56
67
  {/if}
57
68
  {/if}
58
69
  {#if rowSelected && $config.canDeleteRows}
59
- <div class="delete" on:click={() => dispatch("request-bulk-delete")}>
70
+ <div class="delete" on:click={bulkDelete}>
60
71
  <Icon
61
72
  name="Delete"
62
73
  size="S"
@@ -65,12 +76,7 @@
65
76
  </div>
66
77
  {:else}
67
78
  <div class="expand" class:visible={$config.canExpandRows && expandable}>
68
- <Icon
69
- size="S"
70
- name="Maximize"
71
- hoverable
72
- on:click={() => svelteDispatch("expand")}
73
- />
79
+ <Icon size="S" name="Maximize" hoverable on:click={expand} />
74
80
  </div>
75
81
  {/if}
76
82
  </div>
@@ -17,6 +17,7 @@
17
17
  columnHorizontalInversionIndex,
18
18
  contentLines,
19
19
  isDragging,
20
+ dispatch,
20
21
  } = getContext("grid")
21
22
 
22
23
  $: rowSelected = !!$selectedRows[row._id]
@@ -30,6 +31,7 @@
30
31
  on:focus
31
32
  on:mouseenter={$isDragging ? null : () => ($hoveredRowId = row._id)}
32
33
  on:mouseleave={$isDragging ? null : () => ($hoveredRowId = null)}
34
+ on:click={() => dispatch("rowclick", row)}
33
35
  >
34
36
  {#each $renderedColumns as column, columnIdx (column.name)}
35
37
  {@const cellId = `${row._id}-${column.name}`}
@@ -74,6 +74,7 @@
74
74
  class="row"
75
75
  on:mouseenter={$isDragging ? null : () => ($hoveredRowId = row._id)}
76
76
  on:mouseleave={$isDragging ? null : () => ($hoveredRowId = null)}
77
+ on:click={() => dispatch("rowclick", row)}
77
78
  >
78
79
  <GutterCell {row} {rowFocused} {rowHovered} {rowSelected} />
79
80
  {#if $stickyColumn}
@@ -1,4 +1,5 @@
1
1
  import { writable, get } from "svelte/store"
2
+ import { Helpers } from "@budibase/bbui"
2
3
 
3
4
  export const createStores = () => {
4
5
  const copiedCell = writable(null)
@@ -12,7 +13,16 @@ export const createActions = context => {
12
13
  const { copiedCell, focusedCellAPI } = context
13
14
 
14
15
  const copy = () => {
15
- copiedCell.set(get(focusedCellAPI)?.getValue())
16
+ const value = get(focusedCellAPI)?.getValue()
17
+ copiedCell.set(value)
18
+
19
+ // Also copy a stringified version to the clipboard
20
+ let stringified = ""
21
+ if (value != null && value !== "") {
22
+ // Only conditionally stringify to avoid redundant quotes around text
23
+ stringified = typeof value === "object" ? JSON.stringify(value) : value
24
+ }
25
+ Helpers.copyToClipboard(stringified)
16
26
  }
17
27
 
18
28
  const paste = () => {