@invopop/popui 0.0.29 → 0.0.31

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.
@@ -64,6 +64,7 @@ function groupData(rows) {
64
64
  function toggleAllSelected(selected) {
65
65
  selectedRows = [];
66
66
  lastSelected = {};
67
+ dispatch("selectAll", selected);
67
68
  if (!selected)
68
69
  return;
69
70
  selectedRows = data;
@@ -106,27 +107,31 @@ function handleKeydown(event) {
106
107
  return;
107
108
  }
108
109
  selectionMode = "keyboard";
109
- event.preventDefault();
110
110
  if (event.key === "Escape" || event.key === "Esc") {
111
+ event.preventDefault();
111
112
  selectedRows = [];
112
113
  lastSelected = {};
113
114
  }
114
115
  if ((event.code === "Space" || event.key === " ") && lastSelectedIndex >= 0) {
116
+ event.preventDefault();
115
117
  toggleRow(lastSelected);
116
118
  }
117
119
  metaKeyPressed = event.metaKey;
118
120
  shiftKeyPressed = event.shiftKey;
119
121
  if (event.key === "Enter") {
120
122
  if (lastSelectedIndex >= 0) {
123
+ event.preventDefault();
121
124
  dispatch("rowClick", lastSelected);
122
125
  }
123
126
  return;
124
127
  }
125
128
  if (event.key === "Shift") {
129
+ event.preventDefault();
126
130
  selectWithArrowPosition = lastSelectedIndex;
127
131
  return;
128
132
  }
129
133
  if (event.key === "ArrowUp") {
134
+ event.preventDefault();
130
135
  const toIndex = lastSelectedIndex - 1;
131
136
  const to = flattedData[toIndex];
132
137
  if (!to)
@@ -146,6 +151,7 @@ function handleKeydown(event) {
146
151
  lastSelected = to;
147
152
  }
148
153
  if (event.key === "ArrowDown") {
154
+ event.preventDefault();
149
155
  if (lastSelectedIndex < 0) {
150
156
  if (shiftKeyPressed) {
151
157
  selectRow(flattedData[0]);
@@ -25,6 +25,7 @@ declare const __propDef: {
25
25
  rowClick: CustomEvent<any>;
26
26
  rowRightClick: CustomEvent<any>;
27
27
  tableEndReached: CustomEvent<any>;
28
+ selectAll: CustomEvent<any>;
28
29
  } & {
29
30
  [evt: string]: CustomEvent<any>;
30
31
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@invopop/popui",
3
3
  "license": "MIT",
4
- "version": "0.0.29",
4
+ "version": "0.0.31",
5
5
  "scripts": {
6
6
  "dev": "vite dev",
7
7
  "build": "vite build && npm run package",
@@ -99,4 +99,4 @@
99
99
  "svelte-viewport-info": "^1.0.2",
100
100
  "twind": "^0.16.19"
101
101
  }
102
- }
102
+ }