@budibase/frontend-core 2.5.6-alpha.26 → 2.5.6-alpha.27

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.5.6-alpha.26",
3
+ "version": "2.5.6-alpha.27",
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.5.6-alpha.26",
10
- "@budibase/shared-core": "2.5.6-alpha.26",
9
+ "@budibase/bbui": "2.5.6-alpha.27",
10
+ "@budibase/shared-core": "2.5.6-alpha.27",
11
11
  "dayjs": "^1.11.7",
12
12
  "lodash": "^4.17.21",
13
13
  "socket.io-client": "^4.6.1",
14
14
  "svelte": "^3.46.2"
15
15
  },
16
- "gitHead": "7139c7aa40dac208907b99dccbd20d665dc0bfef"
16
+ "gitHead": "ce7dbaa79db46a0e7a73a058a93c9eddf6c8675a"
17
17
  }
@@ -48,8 +48,8 @@
48
48
  }
49
49
 
50
50
  const cellAPI = {
51
- focus: () => api?.focus(),
52
- blur: () => api?.blur(),
51
+ focus: () => api?.focus?.(),
52
+ blur: () => api?.blur?.(),
53
53
  isActive: () => api?.isActive?.() ?? false,
54
54
  onKeyDown: (...params) => api?.onKeyDown(...params),
55
55
  isReadonly: () => readonly,
@@ -113,11 +113,15 @@
113
113
  }
114
114
  .expand {
115
115
  opacity: 0;
116
- pointer-events: none;
117
116
  margin-right: 4px;
118
117
  }
118
+ .expand :global(.spectrum-Icon) {
119
+ pointer-events: none;
120
+ }
119
121
  .expand.visible {
120
122
  opacity: 1;
123
+ }
124
+ .expand.visible :global(.spectrum-Icon) {
121
125
  pointer-events: all;
122
126
  }
123
127
  </style>
@@ -93,6 +93,16 @@
93
93
  columns.actions.changePrimaryDisplay(column.name)
94
94
  open = false
95
95
  }
96
+
97
+ const hideColumn = () => {
98
+ columns.update(state => {
99
+ const index = state.findIndex(col => col.name === column.name)
100
+ state[index].visible = false
101
+ return state.slice()
102
+ })
103
+ columns.actions.saveChanges()
104
+ open = false
105
+ }
96
106
  </script>
97
107
 
98
108
  <div
@@ -184,6 +194,7 @@
184
194
  <MenuItem disabled={!canMoveRight} icon="ChevronRight" on:click={moveRight}>
185
195
  Move right
186
196
  </MenuItem>
197
+ <MenuItem icon="VisibilityOff" on:click={hideColumn}>Hide column</MenuItem>
187
198
  </Menu>
188
199
  </Popover>
189
200
 
@@ -2,7 +2,7 @@
2
2
  import { getContext } from "svelte"
3
3
  import { ActionButton, Popover, Toggle } from "@budibase/bbui"
4
4
 
5
- const { columns } = getContext("grid")
5
+ const { columns, stickyColumn } = getContext("grid")
6
6
 
7
7
  let open = false
8
8
  let anchor
@@ -55,13 +55,17 @@
55
55
  <Popover bind:open {anchor} align="left">
56
56
  <div class="content">
57
57
  <div class="columns">
58
+ {#if $stickyColumn}
59
+ <Toggle disabled size="S" value={true} />
60
+ <span>{$stickyColumn.label}</span>
61
+ {/if}
58
62
  {#each $columns as column}
59
63
  <Toggle
60
64
  size="S"
61
65
  value={column.visible}
62
66
  on:change={e => toggleVisibility(column, e.detail)}
63
67
  />
64
- <span>{column.name}</span>
68
+ <span>{column.label}</span>
65
69
  {/each}
66
70
  </div>
67
71
  <div class="buttons">
@@ -46,6 +46,7 @@
46
46
  }
47
47
  return
48
48
  } else if (e.key === "Tab") {
49
+ e.preventDefault()
49
50
  api?.blur?.()
50
51
  changeFocusedColumn(1)
51
52
  return