native-document 1.0.146 → 1.0.147

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,6 +1,6 @@
1
1
  {
2
2
  "name": "native-document",
3
- "version": "1.0.146",
3
+ "version": "1.0.147",
4
4
  "main": "index.js",
5
5
  "type": "module",
6
6
  "scripts": {
@@ -183,16 +183,17 @@ export const buildTBody = ($desc, instance, visibleColumns) => {
183
183
  tbody.children[args[0]]?.remove();
184
184
  },
185
185
  swap: (args) => {
186
- const [a, b] = args;
187
- const rows = [...tbody.children];
188
- const elA = rows[a];
189
- const elB = rows[b];
186
+ const [a, b] = args;
187
+ const children = tbody.children;
188
+ const elA = children[a];
189
+ const elB = children[b];
190
190
  if(!elA || !elB) {
191
191
  return;
192
192
  }
193
- const refB = elB.nextSibling;
193
+ const refB = elB.nextSibling;
194
+ console.log(refB)
195
+ tbody.insertBefore(elB, elA);
194
196
  tbody.insertBefore(elA, refB);
195
- tbody.insertBefore(elB, rows[a]);
196
197
  },
197
198
  clear: () => {
198
199
  tbody.innerHTML = '';
@@ -104,15 +104,16 @@ const buildBody = ($desc, instance, visibleColumns) => {
104
104
  },
105
105
  swap: (args) => {
106
106
  const [a, b] = args;
107
- const rows = [...tbody.children];
108
- const elA = rows[a];
109
- const elB = rows[b];
107
+ const children = tbody.children;
108
+ const elA = children[a];
109
+ const elB = children[b];
110
110
  if(!elA || !elB) {
111
111
  return;
112
112
  }
113
113
  const refB = elB.nextSibling;
114
+ console.log(refB)
115
+ tbody.insertBefore(elB, elA);
114
116
  tbody.insertBefore(elA, refB);
115
- tbody.insertBefore(elB, rows[a]);
116
117
  },
117
118
  clear: () => {
118
119
  tbody.innerHTML = '';