@vobs/table 1.2.1 → 1.2.2
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/dist/column-settings.cjs +119 -697
- package/dist/column-settings.cjs.map +1 -1
- package/dist/column-settings.js +70 -655
- package/dist/column-settings.js.map +1 -1
- package/dist/data-table.cjs +205 -1077
- package/dist/data-table.cjs.map +1 -1
- package/dist/data-table.js +126 -1005
- package/dist/data-table.js.map +1 -1
- package/dist/icons.cjs +31 -822
- package/dist/icons.cjs.map +1 -1
- package/dist/icons.js +5 -818
- package/dist/icons.js.map +1 -1
- package/dist/index.cjs +303 -1178
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +224 -1099
- package/dist/index.js.map +1 -1
- package/dist/persistence.cjs +30 -6
- package/dist/persistence.cjs.map +1 -1
- package/dist/persistence.js +5 -3
- package/dist/persistence.js.map +1 -1
- package/dist/types.cjs +18 -2
- package/dist/types.cjs.map +1 -1
- package/dist/types.js +0 -2
- package/dist/types.js.map +1 -1
- package/dist/utils.cjs +64 -388
- package/dist/utils.cjs.map +1 -1
- package/dist/utils.js +25 -365
- package/dist/utils.js.map +1 -1
- package/package.json +5 -5
package/dist/index.cjs
CHANGED
|
@@ -1,705 +1,44 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
var __VOBS_CJS_FILE_URL = require("url").pathToFileURL(__filename).href;
|
|
2
|
+
"use strict";
|
|
3
3
|
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
4
7
|
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
var signalNames = /* @__PURE__ */ new WeakMap();
|
|
9
|
-
function hasDebugHooks() {
|
|
10
|
-
return activeDebugHooks !== null;
|
|
11
|
-
}
|
|
12
|
-
__name(hasDebugHooks, "hasDebugHooks");
|
|
13
|
-
function setSignalDebugName(signal, name) {
|
|
14
|
-
signalNames.set(signal, name);
|
|
15
|
-
invokeDebug("signalNamed", signal, name);
|
|
16
|
-
}
|
|
17
|
-
__name(setSignalDebugName, "setSignalDebugName");
|
|
18
|
-
function invokeDebug(name, ...args) {
|
|
19
|
-
return;
|
|
20
|
-
}
|
|
21
|
-
__name(invokeDebug, "invokeDebug");
|
|
22
|
-
|
|
23
|
-
// packages/reactivity/src/owner.ts
|
|
24
|
-
var currentOwner = null;
|
|
25
|
-
var nextOwnerId = 1;
|
|
26
|
-
var ownerNames = /* @__PURE__ */ new WeakMap();
|
|
27
|
-
function createOwner() {
|
|
28
|
-
const parent = currentOwner;
|
|
29
|
-
let disposed = parent?.disposed ?? false;
|
|
30
|
-
const children = [];
|
|
31
|
-
const cleanups = [];
|
|
32
|
-
const errorHandlers = /* @__PURE__ */ new Set();
|
|
33
|
-
const owner = {
|
|
34
|
-
id: `owner-${nextOwnerId++}`,
|
|
35
|
-
parent,
|
|
36
|
-
children,
|
|
37
|
-
depth: (parent?.depth ?? -1) + 1,
|
|
38
|
-
get disposed() {
|
|
39
|
-
return disposed;
|
|
40
|
-
},
|
|
41
|
-
run(fn) {
|
|
42
|
-
if (disposed) throw new Error("Vobs: \u5DF2\u9500\u6BC1\u7684 Owner \u4E0D\u80FD\u7EE7\u7EED\u8FD0\u884C");
|
|
43
|
-
const previous = currentOwner;
|
|
44
|
-
currentOwner = owner;
|
|
45
|
-
try {
|
|
46
|
-
return fn();
|
|
47
|
-
} finally {
|
|
48
|
-
currentOwner = previous;
|
|
49
|
-
}
|
|
50
|
-
},
|
|
51
|
-
addCleanup(cleanup) {
|
|
52
|
-
if (disposed) {
|
|
53
|
-
cleanup();
|
|
54
|
-
return;
|
|
55
|
-
}
|
|
56
|
-
cleanups.push(cleanup);
|
|
57
|
-
},
|
|
58
|
-
onDispose(cleanup) {
|
|
59
|
-
owner.addCleanup(cleanup);
|
|
60
|
-
},
|
|
61
|
-
onError(handler) {
|
|
62
|
-
errorHandlers.add(handler);
|
|
63
|
-
const remove = /* @__PURE__ */ __name(() => errorHandlers.delete(handler), "remove");
|
|
64
|
-
owner.addCleanup(remove);
|
|
65
|
-
return remove;
|
|
66
|
-
},
|
|
67
|
-
handleError(error) {
|
|
68
|
-
for (const handler of [...errorHandlers].reverse()) {
|
|
69
|
-
try {
|
|
70
|
-
handler(error);
|
|
71
|
-
return true;
|
|
72
|
-
} catch (handlerError) {
|
|
73
|
-
return parent?.handleError(handlerError) ?? false;
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
return parent?.handleError(error) ?? false;
|
|
77
|
-
},
|
|
78
|
-
dispose() {
|
|
79
|
-
if (disposed) return;
|
|
80
|
-
disposed = true;
|
|
81
|
-
for (const child of [...children]) child.dispose();
|
|
82
|
-
children.length = 0;
|
|
83
|
-
let firstError;
|
|
84
|
-
for (let index = cleanups.length - 1; index >= 0; index--) {
|
|
85
|
-
try {
|
|
86
|
-
cleanups[index]();
|
|
87
|
-
} catch (error) {
|
|
88
|
-
firstError ?? (firstError = error);
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
cleanups.length = 0;
|
|
92
|
-
if (parent) {
|
|
93
|
-
const index = parent.children.indexOf(owner);
|
|
94
|
-
if (index >= 0) parent.children.splice(index, 1);
|
|
95
|
-
}
|
|
96
|
-
if (firstError) throw firstError;
|
|
97
|
-
}
|
|
98
|
-
};
|
|
99
|
-
if (parent && !parent.disposed) parent.children.push(owner);
|
|
100
|
-
return owner;
|
|
101
|
-
}
|
|
102
|
-
__name(createOwner, "createOwner");
|
|
103
|
-
function setOwnerDebugName(owner, name) {
|
|
104
|
-
ownerNames.set(owner, name);
|
|
105
|
-
}
|
|
106
|
-
__name(setOwnerDebugName, "setOwnerDebugName");
|
|
107
|
-
function getCurrentOwner() {
|
|
108
|
-
return currentOwner;
|
|
109
|
-
}
|
|
110
|
-
__name(getCurrentOwner, "getCurrentOwner");
|
|
111
|
-
|
|
112
|
-
// packages/reactivity/src/signal.ts
|
|
113
|
-
var currentSubscriber = null;
|
|
114
|
-
function getCurrentSubscriber() {
|
|
115
|
-
return currentSubscriber;
|
|
116
|
-
}
|
|
117
|
-
__name(getCurrentSubscriber, "getCurrentSubscriber");
|
|
118
|
-
function setCurrentSubscriber(subscriber) {
|
|
119
|
-
currentSubscriber = subscriber;
|
|
120
|
-
}
|
|
121
|
-
__name(setCurrentSubscriber, "setCurrentSubscriber");
|
|
122
|
-
function untrack(fn) {
|
|
123
|
-
const previous = currentSubscriber;
|
|
124
|
-
currentSubscriber = null;
|
|
125
|
-
try {
|
|
126
|
-
return fn();
|
|
127
|
-
} finally {
|
|
128
|
-
currentSubscriber = previous;
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
__name(untrack, "untrack");
|
|
132
|
-
function trackDependency(dependency) {
|
|
133
|
-
if (!currentSubscriber || currentSubscriber.disposed) return;
|
|
134
|
-
!currentSubscriber.dependencies.has(dependency);
|
|
135
|
-
currentSubscriber.dependencies.add(dependency);
|
|
136
|
-
}
|
|
137
|
-
__name(trackDependency, "trackDependency");
|
|
138
|
-
function state(initialValue, debugName) {
|
|
139
|
-
let value = initialValue;
|
|
140
|
-
let disposed = false;
|
|
141
|
-
const subscribers = /* @__PURE__ */ new Set();
|
|
142
|
-
const signalInstance = {
|
|
143
|
-
get value() {
|
|
144
|
-
const subscriber = getCurrentSubscriber();
|
|
145
|
-
if (subscriber && !subscriber.disposed) {
|
|
146
|
-
subscribers.add(subscriber);
|
|
147
|
-
trackDependency(signalInstance);
|
|
148
|
-
}
|
|
149
|
-
return value;
|
|
150
|
-
},
|
|
151
|
-
set value(nextValue) {
|
|
152
|
-
if (disposed || Object.is(value, nextValue)) return;
|
|
153
|
-
value = nextValue;
|
|
154
|
-
for (const subscriber of [...subscribers]) subscriber.notify();
|
|
155
|
-
},
|
|
156
|
-
unsubscribe(subscriber) {
|
|
157
|
-
subscribers.delete(subscriber);
|
|
158
|
-
},
|
|
159
|
-
// 与 `.value =` 赋值同一条路径:判等短路、debug hook、notify 全部一致。
|
|
160
|
-
// 以闭包实现,可安全地作为回调直接传递(无 this 绑定问题)。
|
|
161
|
-
set(next) {
|
|
162
|
-
signalInstance.value = next;
|
|
163
|
-
},
|
|
164
|
-
dispose() {
|
|
165
|
-
if (disposed) return;
|
|
166
|
-
disposed = true;
|
|
167
|
-
subscribers.clear();
|
|
168
|
-
}
|
|
169
|
-
};
|
|
170
|
-
const owner = getCurrentOwner();
|
|
171
|
-
owner?.addCleanup(signalInstance.dispose);
|
|
172
|
-
if (debugName?.trim()) setSignalDebugName(signalInstance, debugName.trim());
|
|
173
|
-
return signalInstance;
|
|
174
|
-
}
|
|
175
|
-
__name(state, "state");
|
|
176
|
-
|
|
177
|
-
// packages/reactivity/src/scheduler.ts
|
|
178
|
-
var _Scheduler = class _Scheduler {
|
|
179
|
-
constructor() {
|
|
180
|
-
this.dirtyEffects = /* @__PURE__ */ new Set();
|
|
181
|
-
this.lowPriorityEffects = /* @__PURE__ */ new Set();
|
|
182
|
-
// flush 不可重入(flushing 标志保证),缓冲数组可在轮次间安全复用,避免每轮分配。
|
|
183
|
-
this.normalBuffer = [];
|
|
184
|
-
this.lowBuffer = [];
|
|
185
|
-
this.flushing = false;
|
|
186
|
-
this.scheduled = false;
|
|
187
|
-
this.batchDepth = 0;
|
|
188
|
-
}
|
|
189
|
-
schedule(effect2) {
|
|
190
|
-
if (effect2.disposed) return;
|
|
191
|
-
this.dirtyEffects.add(effect2);
|
|
192
|
-
this.lowPriorityEffects.delete(effect2);
|
|
193
|
-
this.ensureScheduled();
|
|
194
|
-
}
|
|
195
|
-
/** Queue an effect behind normal updates while preserving deterministic order. */
|
|
196
|
-
scheduleLow(effect2) {
|
|
197
|
-
if (effect2.disposed) return;
|
|
198
|
-
if (!this.dirtyEffects.has(effect2)) this.lowPriorityEffects.add(effect2);
|
|
199
|
-
this.ensureScheduled();
|
|
200
|
-
}
|
|
201
|
-
ensureScheduled() {
|
|
202
|
-
if (this.batchDepth === 0 && !this.flushing && !this.scheduled) {
|
|
203
|
-
this.scheduled = true;
|
|
204
|
-
queueMicrotask(() => {
|
|
205
|
-
this.scheduled = false;
|
|
206
|
-
this.flush();
|
|
207
|
-
});
|
|
208
|
-
}
|
|
209
|
-
}
|
|
210
|
-
remove(effect2) {
|
|
211
|
-
this.dirtyEffects.delete(effect2);
|
|
212
|
-
this.lowPriorityEffects.delete(effect2);
|
|
213
|
-
}
|
|
214
|
-
batch(fn) {
|
|
215
|
-
this.batchDepth++;
|
|
216
|
-
try {
|
|
217
|
-
return fn();
|
|
218
|
-
} finally {
|
|
219
|
-
this.batchDepth--;
|
|
220
|
-
if (this.batchDepth === 0) this.flush();
|
|
221
|
-
}
|
|
222
|
-
}
|
|
223
|
-
flush() {
|
|
224
|
-
if (this.flushing || this.batchDepth > 0) return;
|
|
225
|
-
this.flushing = true;
|
|
226
|
-
let rounds = 0;
|
|
227
|
-
let firstError;
|
|
228
|
-
let hasError = false;
|
|
229
|
-
try {
|
|
230
|
-
while (this.dirtyEffects.size > 0 || this.lowPriorityEffects.size > 0) {
|
|
231
|
-
if (++rounds > 100) {
|
|
232
|
-
this.dirtyEffects.clear();
|
|
233
|
-
this.lowPriorityEffects.clear();
|
|
234
|
-
throw new Error("Vobs: \u54CD\u5E94\u5F0F\u66F4\u65B0\u8D85\u8FC7 100 \u8F6E\uFF0C\u53EF\u80FD\u5B58\u5728\u5FAA\u73AF\u4F9D\u8D56");
|
|
235
|
-
}
|
|
236
|
-
this.collectRunnable(this.dirtyEffects, this.normalBuffer);
|
|
237
|
-
this.collectRunnable(this.lowPriorityEffects, this.lowBuffer);
|
|
238
|
-
sortEffects(this.normalBuffer);
|
|
239
|
-
sortEffects(this.lowBuffer);
|
|
240
|
-
for (const effect2 of this.normalBuffer) {
|
|
241
|
-
try {
|
|
242
|
-
effect2.run();
|
|
243
|
-
} catch (error) {
|
|
244
|
-
if (!hasError) {
|
|
245
|
-
firstError = error;
|
|
246
|
-
hasError = true;
|
|
247
|
-
}
|
|
248
|
-
}
|
|
249
|
-
}
|
|
250
|
-
for (const effect2 of this.lowBuffer) {
|
|
251
|
-
try {
|
|
252
|
-
effect2.run();
|
|
253
|
-
} catch (error) {
|
|
254
|
-
if (!hasError) {
|
|
255
|
-
firstError = error;
|
|
256
|
-
hasError = true;
|
|
257
|
-
}
|
|
258
|
-
}
|
|
259
|
-
}
|
|
260
|
-
this.normalBuffer.length = 0;
|
|
261
|
-
this.lowBuffer.length = 0;
|
|
262
|
-
}
|
|
263
|
-
} finally {
|
|
264
|
-
this.normalBuffer.length = 0;
|
|
265
|
-
this.lowBuffer.length = 0;
|
|
266
|
-
this.flushing = false;
|
|
267
|
-
}
|
|
268
|
-
if (hasError) throw firstError;
|
|
269
|
-
}
|
|
270
|
-
/** 收集未 disposed 的 effect 并清空源集合;run() 期间新调度的 effect 留给下一轮。 */
|
|
271
|
-
collectRunnable(source, target) {
|
|
272
|
-
for (const effect2 of source) {
|
|
273
|
-
if (!effect2.disposed) target.push(effect2);
|
|
274
|
-
}
|
|
275
|
-
source.clear();
|
|
276
|
-
}
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
277
11
|
};
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
}
|
|
284
|
-
}
|
|
285
|
-
__name(sortEffects, "sortEffects");
|
|
286
|
-
var scheduler = new Scheduler();
|
|
287
|
-
|
|
288
|
-
// packages/reactivity/src/effect.ts
|
|
289
|
-
var nextEffectOrder = 1;
|
|
290
|
-
function cleanupDependencies(subscriber) {
|
|
291
|
-
for (const dependency of subscriber.dependencies) {
|
|
292
|
-
dependency.unsubscribe(subscriber);
|
|
293
|
-
}
|
|
294
|
-
subscriber.dependencies.clear();
|
|
295
|
-
}
|
|
296
|
-
__name(cleanupDependencies, "cleanupDependencies");
|
|
297
|
-
function effect(callback) {
|
|
298
|
-
const owner = getCurrentOwner();
|
|
299
|
-
let cleanup;
|
|
300
|
-
let dirty = true;
|
|
301
|
-
let disposed = false;
|
|
302
|
-
const eff = {
|
|
303
|
-
order: nextEffectOrder++,
|
|
304
|
-
depth: owner?.depth ?? 0,
|
|
305
|
-
dependencies: /* @__PURE__ */ new Set(),
|
|
306
|
-
get disposed() {
|
|
307
|
-
return disposed;
|
|
308
|
-
},
|
|
309
|
-
notify() {
|
|
310
|
-
if (disposed || dirty) return;
|
|
311
|
-
dirty = true;
|
|
312
|
-
scheduler.schedule(eff);
|
|
313
|
-
},
|
|
314
|
-
run() {
|
|
315
|
-
if (disposed || !dirty) return;
|
|
316
|
-
dirty = false;
|
|
317
|
-
const previousCleanup = cleanup;
|
|
318
|
-
cleanup = void 0;
|
|
319
|
-
let cleanupError;
|
|
320
|
-
if (previousCleanup) {
|
|
321
|
-
try {
|
|
322
|
-
previousCleanup();
|
|
323
|
-
} catch (error) {
|
|
324
|
-
const handled2 = owner?.handleError(error) ?? false;
|
|
325
|
-
if (!handled2) cleanupError = error;
|
|
326
|
-
}
|
|
327
|
-
}
|
|
328
|
-
cleanupDependencies(eff);
|
|
329
|
-
const previous = getCurrentSubscriber();
|
|
330
|
-
setCurrentSubscriber(eff);
|
|
331
|
-
let thrown;
|
|
332
|
-
let handled = false;
|
|
333
|
-
try {
|
|
334
|
-
const result = owner ? owner.run(callback) : callback();
|
|
335
|
-
cleanup = typeof result === "function" ? result : void 0;
|
|
336
|
-
} catch (error) {
|
|
337
|
-
thrown = error;
|
|
338
|
-
handled = owner?.handleError(error) ?? false;
|
|
339
|
-
if (!handled) throw error;
|
|
340
|
-
} finally {
|
|
341
|
-
setCurrentSubscriber(previous);
|
|
342
|
-
}
|
|
343
|
-
if (cleanupError && !thrown) throw cleanupError;
|
|
344
|
-
},
|
|
345
|
-
scheduleLow() {
|
|
346
|
-
if (disposed || dirty) return;
|
|
347
|
-
dirty = true;
|
|
348
|
-
scheduler.scheduleLow(eff);
|
|
349
|
-
},
|
|
350
|
-
dispose() {
|
|
351
|
-
if (disposed) return;
|
|
352
|
-
disposed = true;
|
|
353
|
-
dirty = false;
|
|
354
|
-
scheduler.remove(eff);
|
|
355
|
-
const previousCleanup = cleanup;
|
|
356
|
-
cleanup = void 0;
|
|
357
|
-
let cleanupError;
|
|
358
|
-
if (previousCleanup) {
|
|
359
|
-
try {
|
|
360
|
-
previousCleanup();
|
|
361
|
-
} catch (error) {
|
|
362
|
-
const handled = owner?.handleError(error) ?? false;
|
|
363
|
-
if (!handled) cleanupError = error;
|
|
364
|
-
}
|
|
365
|
-
}
|
|
366
|
-
cleanupDependencies(eff);
|
|
367
|
-
if (cleanupError) throw cleanupError;
|
|
368
|
-
}
|
|
369
|
-
};
|
|
370
|
-
owner?.addCleanup(eff.dispose);
|
|
371
|
-
eff.run();
|
|
372
|
-
return eff;
|
|
373
|
-
}
|
|
374
|
-
__name(effect, "effect");
|
|
375
|
-
|
|
376
|
-
// packages/runtime/src/debug.ts
|
|
377
|
-
var activeRuntimeDebugHooks = null;
|
|
378
|
-
function getRuntimeDebugHooks() {
|
|
379
|
-
return activeRuntimeDebugHooks;
|
|
380
|
-
}
|
|
381
|
-
__name(getRuntimeDebugHooks, "getRuntimeDebugHooks");
|
|
382
|
-
function invokeRuntimeDebug(name, ...args) {
|
|
383
|
-
return;
|
|
384
|
-
}
|
|
385
|
-
__name(invokeRuntimeDebug, "invokeRuntimeDebug");
|
|
386
|
-
function readDebugValue(read) {
|
|
387
|
-
try {
|
|
388
|
-
return read();
|
|
389
|
-
} catch {
|
|
390
|
-
return "[Uninspectable]";
|
|
391
|
-
}
|
|
392
|
-
}
|
|
393
|
-
__name(readDebugValue, "readDebugValue");
|
|
394
|
-
function describeDebugNode(node) {
|
|
395
|
-
if (!node || typeof node !== "object") return "node";
|
|
396
|
-
const value = node;
|
|
397
|
-
const name = typeof value.tagName === "string" ? value.tagName.toLowerCase() : typeof value.nodeName === "string" ? value.nodeName.toLowerCase() : "node";
|
|
398
|
-
const id = typeof value.id === "string" && value.id ? `#${value.id}` : "";
|
|
399
|
-
const className = typeof value.className === "string" && value.className ? `.${value.className.trim().split(/\s+/).filter(Boolean).join(".")}` : "";
|
|
400
|
-
return `${name}${id}${className}`;
|
|
401
|
-
}
|
|
402
|
-
__name(describeDebugNode, "describeDebugNode");
|
|
403
|
-
|
|
404
|
-
// packages/runtime/src/hmr.ts
|
|
405
|
-
var globalTarget = globalThis;
|
|
406
|
-
var hmrGlobal = globalTarget.__VOBS_HMR__ ?? { modules: /* @__PURE__ */ new Map() };
|
|
407
|
-
globalTarget.__VOBS_HMR__ = hmrGlobal;
|
|
408
|
-
function registerHmrInstance(moduleId, instance) {
|
|
409
|
-
const instances = getModule(moduleId).instances;
|
|
410
|
-
instances.add(instance);
|
|
411
|
-
return () => instances.delete(instance);
|
|
412
|
-
}
|
|
413
|
-
__name(registerHmrInstance, "registerHmrInstance");
|
|
414
|
-
function markHmrInstanceMounted(node, parent) {
|
|
415
|
-
const instance = hmrInstances.get(node);
|
|
416
|
-
if (instance) instance.parent = parent;
|
|
417
|
-
}
|
|
418
|
-
__name(markHmrInstanceMounted, "markHmrInstanceMounted");
|
|
419
|
-
function getModule(moduleId) {
|
|
420
|
-
let module = hmrGlobal.modules.get(moduleId);
|
|
421
|
-
if (!module) {
|
|
422
|
-
module = { components: /* @__PURE__ */ new Map(), state: /* @__PURE__ */ new Map(), instances: /* @__PURE__ */ new Set() };
|
|
423
|
-
hmrGlobal.modules.set(moduleId, module);
|
|
424
|
-
}
|
|
425
|
-
return module;
|
|
426
|
-
}
|
|
427
|
-
__name(getModule, "getModule");
|
|
428
|
-
var hmrInstances = /* @__PURE__ */ new WeakMap();
|
|
429
|
-
function associateHmrInstance(node, instance) {
|
|
430
|
-
hmrInstances.set(node, instance);
|
|
431
|
-
}
|
|
432
|
-
__name(associateHmrInstance, "associateHmrInstance");
|
|
433
|
-
var nodeOwners = /* @__PURE__ */ new WeakMap();
|
|
434
|
-
var eventBindings = /* @__PURE__ */ new WeakMap();
|
|
435
|
-
function getRenderer() {
|
|
436
|
-
{
|
|
437
|
-
throw new Error("\u6E32\u67D3\u5668\u672A\u521D\u59CB\u5316");
|
|
438
|
-
}
|
|
439
|
-
}
|
|
440
|
-
__name(getRenderer, "getRenderer");
|
|
441
|
-
function createText(content) {
|
|
442
|
-
return getRenderer().createText(content);
|
|
443
|
-
}
|
|
444
|
-
__name(createText, "createText");
|
|
445
|
-
function createElement(tag) {
|
|
446
|
-
return getRenderer().createElement(tag);
|
|
447
|
-
}
|
|
448
|
-
__name(createElement, "createElement");
|
|
449
|
-
function createComment(content) {
|
|
450
|
-
return getRenderer().createComment(content);
|
|
451
|
-
}
|
|
452
|
-
__name(createComment, "createComment");
|
|
453
|
-
function insertBefore(parent, child, anchor) {
|
|
454
|
-
if (isVobsFragment(child)) {
|
|
455
|
-
child.mount(parent, isVobsFragment(anchor) ? anchor.start : anchor);
|
|
456
|
-
return;
|
|
457
|
-
}
|
|
458
|
-
getRenderer().insertBefore(parent, child, isVobsFragment(anchor) ? anchor.start : anchor);
|
|
459
|
-
markHmrInstanceMounted(child, parent);
|
|
460
|
-
}
|
|
461
|
-
__name(insertBefore, "insertBefore");
|
|
462
|
-
function removeChild(parent, child) {
|
|
463
|
-
disposeNodeOwner(child);
|
|
464
|
-
if (isVobsFragment(child)) {
|
|
465
|
-
child.unmount(parent);
|
|
466
|
-
return;
|
|
467
|
-
}
|
|
468
|
-
getRenderer().removeChild(parent, child);
|
|
469
|
-
}
|
|
470
|
-
__name(removeChild, "removeChild");
|
|
471
|
-
function setTextContent(node, content) {
|
|
472
|
-
getRenderer().setTextContent(node, content);
|
|
473
|
-
}
|
|
474
|
-
__name(setTextContent, "setTextContent");
|
|
475
|
-
function setProperty(node, key, value) {
|
|
476
|
-
getRenderer().setProperty(node, key, value);
|
|
477
|
-
}
|
|
478
|
-
__name(setProperty, "setProperty");
|
|
479
|
-
function setAttribute(node, key, value) {
|
|
480
|
-
getRenderer().setAttribute(node, key, value);
|
|
481
|
-
}
|
|
482
|
-
__name(setAttribute, "setAttribute");
|
|
483
|
-
function addEventListener(node, event, handler) {
|
|
484
|
-
const renderer = getRenderer();
|
|
485
|
-
const owner = getCurrentOwner();
|
|
486
|
-
let bindings = eventBindings.get(node);
|
|
487
|
-
if (!bindings) {
|
|
488
|
-
bindings = /* @__PURE__ */ new Map();
|
|
489
|
-
eventBindings.set(node, bindings);
|
|
490
|
-
}
|
|
491
|
-
const previous = bindings.get(event);
|
|
492
|
-
if (previous && previous.original === handler && previous.owner === owner) return;
|
|
493
|
-
if (previous) renderer.removeEventListener(node, event, previous.handler);
|
|
494
|
-
const listener = owner ? (reason) => {
|
|
495
|
-
try {
|
|
496
|
-
owner.run(() => handler(reason));
|
|
497
|
-
} catch (error) {
|
|
498
|
-
const handled = owner.handleError(error);
|
|
499
|
-
invokeRuntimeDebug("error", {
|
|
500
|
-
error,
|
|
501
|
-
owner,
|
|
502
|
-
phase: "event",
|
|
503
|
-
handled,
|
|
504
|
-
recovery: handled ? "handled" : "propagated"
|
|
505
|
-
});
|
|
506
|
-
if (!handled) throw error;
|
|
507
|
-
}
|
|
508
|
-
} : handler;
|
|
509
|
-
const binding = { handler: listener, owner, original: handler };
|
|
510
|
-
bindings.set(event, binding);
|
|
511
|
-
renderer.addEventListener(node, event, listener);
|
|
512
|
-
owner?.onDispose(() => {
|
|
513
|
-
if (bindings?.get(event) !== binding) return;
|
|
514
|
-
bindings.delete(event);
|
|
515
|
-
renderer.removeEventListener(node, event, listener);
|
|
516
|
-
});
|
|
517
|
-
}
|
|
518
|
-
__name(addEventListener, "addEventListener");
|
|
519
|
-
function createComponent(component, props, source) {
|
|
520
|
-
const owner = createOwner();
|
|
521
|
-
const componentName = component.displayName || component.name || "anonymous";
|
|
522
|
-
setOwnerDebugName(owner, source ? `${componentName} (${source.file}:${source.line}:${source.column})` : componentName);
|
|
523
|
-
owner.onError((reason) => {
|
|
524
|
-
attachSourceLocation(reason, source);
|
|
525
|
-
attachComponentContext(reason, componentName, owner.id);
|
|
526
|
-
throw reason;
|
|
527
|
-
});
|
|
528
|
-
let node;
|
|
529
|
-
try {
|
|
530
|
-
node = owner.run(() => component(props));
|
|
531
|
-
} catch (error) {
|
|
532
|
-
owner.dispose();
|
|
533
|
-
attachSourceLocation(error, source);
|
|
534
|
-
attachComponentContext(error, componentName, owner.id);
|
|
535
|
-
throw error;
|
|
536
|
-
}
|
|
537
|
-
associateNodeOwner(node, owner);
|
|
538
|
-
const hmrKey = component.hmrKey;
|
|
539
|
-
if (hmrKey) {
|
|
540
|
-
const instance = {
|
|
541
|
-
node,
|
|
542
|
-
parent: null,
|
|
543
|
-
refresh() {
|
|
544
|
-
const previous = instance.node;
|
|
545
|
-
const next = owner.run(() => component(props));
|
|
546
|
-
if (instance.parent && !isVobsFragment(previous) && !isVobsFragment(next)) {
|
|
547
|
-
getRenderer().insertBefore(instance.parent, next, previous);
|
|
548
|
-
getRenderer().removeChild(instance.parent, previous);
|
|
549
|
-
}
|
|
550
|
-
nodeOwners.delete(previous);
|
|
551
|
-
nodeOwners.set(next, owner);
|
|
552
|
-
associateHmrInstance(next, instance);
|
|
553
|
-
instance.node = next;
|
|
554
|
-
}
|
|
555
|
-
};
|
|
556
|
-
associateHmrInstance(node, instance);
|
|
557
|
-
const separator = hmrKey.lastIndexOf(":");
|
|
558
|
-
const moduleId = separator < 0 ? hmrKey : hmrKey.slice(0, separator);
|
|
559
|
-
const cleanup = registerHmrInstance(moduleId, instance);
|
|
560
|
-
owner.onDispose(cleanup);
|
|
561
|
-
}
|
|
562
|
-
return node;
|
|
563
|
-
}
|
|
564
|
-
__name(createComponent, "createComponent");
|
|
565
|
-
function attachSourceLocation(reason, source) {
|
|
566
|
-
if (!source || (!reason || typeof reason !== "object" && typeof reason !== "function")) return;
|
|
567
|
-
const error = reason;
|
|
568
|
-
if (error.vobsSource) return;
|
|
569
|
-
try {
|
|
570
|
-
Object.defineProperty(error, "vobsSource", {
|
|
571
|
-
configurable: true,
|
|
572
|
-
enumerable: false,
|
|
573
|
-
value: source,
|
|
574
|
-
writable: false
|
|
575
|
-
});
|
|
576
|
-
} catch {
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
577
17
|
}
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
if (!reason || typeof reason !== "object" && typeof reason !== "function") return;
|
|
582
|
-
const error = reason;
|
|
583
|
-
try {
|
|
584
|
-
if (!error.vobsComponent) Object.defineProperty(error, "vobsComponent", { configurable: true, enumerable: false, value: component, writable: false });
|
|
585
|
-
if (!error.vobsOwnerId) Object.defineProperty(error, "vobsOwnerId", { configurable: true, enumerable: false, value: ownerId, writable: false });
|
|
586
|
-
} catch {
|
|
587
|
-
}
|
|
588
|
-
}
|
|
589
|
-
__name(attachComponentContext, "attachComponentContext");
|
|
590
|
-
function createBlock(factory) {
|
|
591
|
-
const owner = createOwner();
|
|
592
|
-
setOwnerDebugName(owner, "dynamic");
|
|
593
|
-
let node;
|
|
594
|
-
try {
|
|
595
|
-
node = owner.run(factory);
|
|
596
|
-
} catch (error) {
|
|
597
|
-
owner.dispose();
|
|
598
|
-
throw error;
|
|
599
|
-
}
|
|
600
|
-
if (!node) {
|
|
601
|
-
owner.dispose();
|
|
602
|
-
return null;
|
|
603
|
-
}
|
|
604
|
-
associateNodeOwner(node, owner);
|
|
605
|
-
return node;
|
|
606
|
-
}
|
|
607
|
-
__name(createBlock, "createBlock");
|
|
608
|
-
function associateNodeOwner(node, owner) {
|
|
609
|
-
nodeOwners.set(node, owner);
|
|
610
|
-
}
|
|
611
|
-
__name(associateNodeOwner, "associateNodeOwner");
|
|
612
|
-
function disposeNodeOwner(node) {
|
|
613
|
-
const owner = nodeOwners.get(node);
|
|
614
|
-
if (!owner) return;
|
|
615
|
-
nodeOwners.delete(node);
|
|
616
|
-
owner.dispose();
|
|
617
|
-
}
|
|
618
|
-
__name(disposeNodeOwner, "disposeNodeOwner");
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
619
21
|
|
|
620
|
-
// packages/
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
if (parent && parent !== nextParent) {
|
|
633
|
-
throw new Error("Vobs Fragment: \u4E0D\u80FD\u8DE8\u7236\u8282\u70B9\u79FB\u52A8 Fragment");
|
|
634
|
-
}
|
|
635
|
-
if (initialized) {
|
|
636
|
-
moveRange(nextParent, start, end, anchor);
|
|
637
|
-
return;
|
|
638
|
-
}
|
|
639
|
-
const renderer = getRenderer();
|
|
640
|
-
renderer.insertBefore(nextParent, start, anchor);
|
|
641
|
-
renderer.insertBefore(nextParent, end, anchor);
|
|
642
|
-
parent = nextParent;
|
|
643
|
-
initialized = true;
|
|
644
|
-
if (owner) owner.run(() => factory(nextParent, end));
|
|
645
|
-
else factory(nextParent, end);
|
|
646
|
-
},
|
|
647
|
-
unmount(nextParent) {
|
|
648
|
-
if (!initialized || parent !== nextParent) {
|
|
649
|
-
throw new Error("Vobs Fragment: Fragment \u4E0D\u5C5E\u4E8E\u6307\u5B9A\u7236\u8282\u70B9");
|
|
650
|
-
}
|
|
651
|
-
const renderer = getRenderer();
|
|
652
|
-
let current = renderer.nextSibling(start);
|
|
653
|
-
while (current && current !== end) {
|
|
654
|
-
const next = renderer.nextSibling(current);
|
|
655
|
-
renderer.removeChild(nextParent, current);
|
|
656
|
-
current = next;
|
|
657
|
-
}
|
|
658
|
-
renderer.removeChild(nextParent, start);
|
|
659
|
-
renderer.removeChild(nextParent, end);
|
|
660
|
-
parent = null;
|
|
661
|
-
initialized = false;
|
|
662
|
-
}
|
|
663
|
-
};
|
|
664
|
-
return fragment;
|
|
665
|
-
}
|
|
666
|
-
__name(createFragment, "createFragment");
|
|
667
|
-
function isVobsFragment(value) {
|
|
668
|
-
return Boolean(value) && typeof value === "object" && value.kind === "vobs-fragment";
|
|
669
|
-
}
|
|
670
|
-
__name(isVobsFragment, "isVobsFragment");
|
|
671
|
-
function moveRange(parent, start, end, anchor) {
|
|
672
|
-
const renderer = getRenderer();
|
|
673
|
-
const nodes = [start];
|
|
674
|
-
let current = renderer.nextSibling(start);
|
|
675
|
-
while (current) {
|
|
676
|
-
nodes.push(current);
|
|
677
|
-
if (current === end) break;
|
|
678
|
-
current = renderer.nextSibling(current);
|
|
679
|
-
}
|
|
680
|
-
if (nodes[nodes.length - 1] !== end) {
|
|
681
|
-
throw new Error("Vobs Fragment: \u627E\u4E0D\u5230\u7ED3\u675F\u951A\u70B9");
|
|
682
|
-
}
|
|
683
|
-
for (const node of nodes) renderer.insertBefore(parent, node, anchor);
|
|
684
|
-
}
|
|
685
|
-
__name(moveRange, "moveRange");
|
|
22
|
+
// packages/table/src/index.ts
|
|
23
|
+
var src_exports = {};
|
|
24
|
+
__export(src_exports, {
|
|
25
|
+
KitColumnSettings: () => KitColumnSettings,
|
|
26
|
+
KitDataTable: () => KitDataTable,
|
|
27
|
+
createColumnSettingsPersistence: () => createColumnSettingsPersistence,
|
|
28
|
+
createDefaultColumnSettings: () => createDefaultColumnSettings,
|
|
29
|
+
createLocalColumnSettingsPersistence: () => createLocalColumnSettingsPersistence,
|
|
30
|
+
defaultIcons: () => defaultIcons,
|
|
31
|
+
normalizeColumnSettings: () => normalizeColumnSettings
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(src_exports);
|
|
686
34
|
|
|
687
|
-
// packages/
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
insertBefore(parent, marker, anchor);
|
|
691
|
-
let current = null;
|
|
692
|
-
effect(() => {
|
|
693
|
-
const next = createBlock(factory);
|
|
694
|
-
if (next === current) return;
|
|
695
|
-
if (current) removeChild(parent, current);
|
|
696
|
-
current = next;
|
|
697
|
-
if (current) insertBefore(parent, current, marker);
|
|
698
|
-
});
|
|
699
|
-
}
|
|
700
|
-
__name(insertDynamic, "insertDynamic");
|
|
35
|
+
// packages/table/src/data-table.ts
|
|
36
|
+
var import_reactivity2 = require("@vobs/reactivity");
|
|
37
|
+
var import_vobs3 = require("@vobs/vobs");
|
|
701
38
|
|
|
702
39
|
// packages/table/src/utils.ts
|
|
40
|
+
var import_reactivity = require("@vobs/reactivity");
|
|
41
|
+
var import_vobs = require("@vobs/vobs");
|
|
703
42
|
function readProp(props, name, fallback) {
|
|
704
43
|
const value = Reflect.get(props, name);
|
|
705
44
|
return value === void 0 ? fallback : value;
|
|
@@ -710,46 +49,46 @@ function hasProp(props, name) {
|
|
|
710
49
|
}
|
|
711
50
|
__name(hasProp, "hasProp");
|
|
712
51
|
function bindClassList(root, props, classes) {
|
|
713
|
-
effect(() => {
|
|
52
|
+
(0, import_reactivity.effect)(() => {
|
|
714
53
|
const userClasses = [readString(props, "class"), readString(props, "className")];
|
|
715
|
-
setAttribute(root, "class", [...classes(), ...userClasses].filter(Boolean).join(" "));
|
|
54
|
+
(0, import_vobs.setAttribute)(root, "class", [...classes(), ...userClasses].filter(Boolean).join(" "));
|
|
716
55
|
});
|
|
717
56
|
}
|
|
718
57
|
__name(bindClassList, "bindClassList");
|
|
719
58
|
function bindCommonAttributes(root, props, skip) {
|
|
720
59
|
const ignored = /* @__PURE__ */ new Set([...skip, "class", "className", "style", "children"]);
|
|
721
|
-
effect(() => {
|
|
60
|
+
(0, import_reactivity.effect)(() => {
|
|
722
61
|
for (const name of Object.keys(props)) {
|
|
723
62
|
if (ignored.has(name) || name.startsWith("on")) continue;
|
|
724
63
|
if (name !== "id" && name !== "title" && name !== "role" && name !== "tabIndex" && !name.startsWith("aria-") && !name.startsWith("data-")) continue;
|
|
725
64
|
const value = Reflect.get(props, name);
|
|
726
65
|
if (value === void 0 || value === null || value === false) removeAttribute(root, normalizeAttributeName(name));
|
|
727
|
-
else setAttribute(root, normalizeAttributeName(name), String(value));
|
|
66
|
+
else (0, import_vobs.setAttribute)(root, normalizeAttributeName(name), String(value));
|
|
728
67
|
}
|
|
729
68
|
});
|
|
730
69
|
}
|
|
731
70
|
__name(bindCommonAttributes, "bindCommonAttributes");
|
|
732
71
|
function bindStyle(root, props, internal = () => "") {
|
|
733
|
-
effect(() => {
|
|
72
|
+
(0, import_reactivity.effect)(() => {
|
|
734
73
|
const value = [internal(), readString(props, "style")].filter(Boolean).join("; ");
|
|
735
|
-
if (value) setAttribute(root, "style", value);
|
|
74
|
+
if (value) (0, import_vobs.setAttribute)(root, "style", value);
|
|
736
75
|
else removeAttribute(root, "style");
|
|
737
76
|
});
|
|
738
77
|
}
|
|
739
78
|
__name(bindStyle, "bindStyle");
|
|
740
|
-
function
|
|
741
|
-
effect(() => setTextContent(node, String(read() ?? "")));
|
|
79
|
+
function bindText(node, read) {
|
|
80
|
+
(0, import_reactivity.effect)(() => (0, import_vobs.setTextContent)(node, String(read() ?? "")));
|
|
742
81
|
}
|
|
743
|
-
__name(
|
|
82
|
+
__name(bindText, "bindText");
|
|
744
83
|
function resolveSlot(value) {
|
|
745
84
|
const resolved = typeof value === "function" ? value() : value;
|
|
746
85
|
if (resolved === void 0 || resolved === null) return null;
|
|
747
|
-
if (typeof resolved === "string" || typeof resolved === "number") return createText(String(resolved));
|
|
86
|
+
if (typeof resolved === "string" || typeof resolved === "number") return (0, import_vobs.createText)(String(resolved));
|
|
748
87
|
if (Array.isArray(resolved)) {
|
|
749
|
-
return createFragment((parent, anchor) => {
|
|
88
|
+
return (0, import_vobs.createFragment)((parent, anchor) => {
|
|
750
89
|
for (const child of resolved) {
|
|
751
90
|
const node = resolveSlot(child);
|
|
752
|
-
if (node) insertBefore(parent, node, anchor);
|
|
91
|
+
if (node) (0, import_vobs.insertBefore)(parent, node, anchor);
|
|
753
92
|
}
|
|
754
93
|
});
|
|
755
94
|
}
|
|
@@ -758,7 +97,7 @@ function resolveSlot(value) {
|
|
|
758
97
|
__name(resolveSlot, "resolveSlot");
|
|
759
98
|
function setOptionalAttribute(node, name, value) {
|
|
760
99
|
if (value === void 0 || value === null || value === false || value === "") removeAttribute(node, name);
|
|
761
|
-
else setAttribute(node, name, String(value));
|
|
100
|
+
else (0, import_vobs.setAttribute)(node, name, String(value));
|
|
762
101
|
}
|
|
763
102
|
__name(setOptionalAttribute, "setOptionalAttribute");
|
|
764
103
|
function normalizePixels(value) {
|
|
@@ -844,234 +183,16 @@ function removeAttribute(node, name) {
|
|
|
844
183
|
}
|
|
845
184
|
__name(removeAttribute, "removeAttribute");
|
|
846
185
|
|
|
847
|
-
// packages/ui/src/utils.ts
|
|
848
|
-
function readProp2(props, name, fallback) {
|
|
849
|
-
const value = Reflect.get(props, name);
|
|
850
|
-
return value === void 0 ? fallback : value;
|
|
851
|
-
}
|
|
852
|
-
__name(readProp2, "readProp");
|
|
853
|
-
function hasProp2(props, name) {
|
|
854
|
-
return name in props;
|
|
855
|
-
}
|
|
856
|
-
__name(hasProp2, "hasProp");
|
|
857
|
-
function mountSlot(parent, props, propName) {
|
|
858
|
-
insertDynamic(parent, null, () => resolveSlot2(Reflect.get(props, propName)));
|
|
859
|
-
}
|
|
860
|
-
__name(mountSlot, "mountSlot");
|
|
861
|
-
function resolveSlot2(value) {
|
|
862
|
-
const resolved = typeof value === "function" ? value() : value;
|
|
863
|
-
if (resolved === void 0 || resolved === null || resolved === false) return null;
|
|
864
|
-
if (typeof resolved === "string" || typeof resolved === "number") return createText(String(resolved));
|
|
865
|
-
if (Array.isArray(resolved)) {
|
|
866
|
-
const children = resolved;
|
|
867
|
-
return createFragment((parent, anchor) => {
|
|
868
|
-
for (const child of children) {
|
|
869
|
-
const node = resolveSlot2(child);
|
|
870
|
-
if (node) insertBefore(parent, node, anchor);
|
|
871
|
-
}
|
|
872
|
-
});
|
|
873
|
-
}
|
|
874
|
-
return resolved;
|
|
875
|
-
}
|
|
876
|
-
__name(resolveSlot2, "resolveSlot");
|
|
877
|
-
|
|
878
|
-
// packages/icon-core/src/index.ts
|
|
879
|
-
function createSvgIconNode(source, props = {}, options = {}) {
|
|
880
|
-
const root = createElement("span");
|
|
881
|
-
effect(() => {
|
|
882
|
-
updateSvgIconNode(root, typeof source === "function" ? source() : source, props, options);
|
|
883
|
-
});
|
|
884
|
-
return root;
|
|
885
|
-
}
|
|
886
|
-
__name(createSvgIconNode, "createSvgIconNode");
|
|
887
|
-
function updateSvgIconNode(root, definition, props, options) {
|
|
888
|
-
const size = readProp3(props, "size", void 0);
|
|
889
|
-
const width = readProp3(props, "width", size);
|
|
890
|
-
const height = readProp3(props, "height", size);
|
|
891
|
-
const normalizedWidth = normalizeSvgLength(width);
|
|
892
|
-
const normalizedHeight = normalizeSvgLength(height);
|
|
893
|
-
const userClass = [
|
|
894
|
-
readProp3(props, "class", void 0),
|
|
895
|
-
readProp3(props, "className", void 0)
|
|
896
|
-
].filter(hasText).join(" ");
|
|
897
|
-
const className = [options.class, options.className, userClass].filter(hasText).join(" ");
|
|
898
|
-
setAttribute(root, "class", className);
|
|
899
|
-
const internalStyle = size === void 0 ? "" : `width: ${normalizeCssLength(size)}; height: ${normalizeCssLength(size)}`;
|
|
900
|
-
const userStyle = readProp3(props, "style", void 0);
|
|
901
|
-
const style = [internalStyle, userStyle].filter(hasText).join("; ");
|
|
902
|
-
setOptionalAttribute2(root, "style", style || void 0);
|
|
903
|
-
const managedAttributes = /* @__PURE__ */ new Map();
|
|
904
|
-
for (const name of Object.keys(props)) {
|
|
905
|
-
if (name === "class" || name === "className" || name === "style" || name === "children") continue;
|
|
906
|
-
if (!name.startsWith("aria-") && !name.startsWith("data-") && !["id", "title", "role", "tabIndex"].includes(name)) continue;
|
|
907
|
-
const value = Reflect.get(props, name);
|
|
908
|
-
if (value === void 0 || value === null || value === false) continue;
|
|
909
|
-
managedAttributes.set(name === "tabIndex" ? "tabindex" : name, String(value));
|
|
910
|
-
}
|
|
911
|
-
for (const [name, value] of managedAttributes) setAttribute(root, name, value);
|
|
912
|
-
clearStaleAttributes(root, managedAttributes);
|
|
913
|
-
const title = readProp3(props, "title", void 0);
|
|
914
|
-
const ariaLabel = Reflect.get(props, "aria-label");
|
|
915
|
-
const decorative = readProp3(props, "decorative", title === void 0 && ariaLabel === void 0);
|
|
916
|
-
setOptionalAttribute2(root, "aria-hidden", decorative ? "true" : void 0);
|
|
917
|
-
setOptionalAttribute2(root, "aria-label", ariaLabel === void 0 ? title : void 0);
|
|
918
|
-
setOptionalAttribute2(root, "data-icon-name", options.dataIconName ?? definition?.name);
|
|
919
|
-
setOptionalAttribute2(root, "color", readProp3(props, "color", void 0));
|
|
920
|
-
if (!definition) {
|
|
921
|
-
setProperty(root, "innerHTML", "");
|
|
922
|
-
return;
|
|
923
|
-
}
|
|
924
|
-
const svgAttributes = {
|
|
925
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
926
|
-
viewBox: definition.viewBox ?? "0 0 24 24",
|
|
927
|
-
...options.defaultSvgAttributes,
|
|
928
|
-
...definition.attributes,
|
|
929
|
-
...normalizedWidth === void 0 ? {} : { width: normalizedWidth },
|
|
930
|
-
...normalizedHeight === void 0 ? {} : { height: normalizedHeight },
|
|
931
|
-
...readProp3(props, "color", void 0) === void 0 ? {} : { color: readProp3(props, "color", void 0) },
|
|
932
|
-
...readProp3(props, "stroke", void 0) === void 0 ? {} : { stroke: readProp3(props, "stroke", void 0) },
|
|
933
|
-
...readProp3(props, "fill", void 0) === void 0 ? {} : { fill: readProp3(props, "fill", void 0) },
|
|
934
|
-
...readProp3(props, "strokeWidth", void 0) === void 0 ? {} : { "stroke-width": readProp3(props, "strokeWidth", void 0) }
|
|
935
|
-
};
|
|
936
|
-
const markup = Object.entries(svgAttributes).filter(([, value]) => value !== void 0).map(([name, value]) => `${name}="${escapeXml(String(value))}"`).join(" ");
|
|
937
|
-
const titleMarkup = title === void 0 ? "" : `<title>${escapeXml(title)}</title>`;
|
|
938
|
-
setProperty(root, "innerHTML", `<svg ${markup} aria-hidden="true">${titleMarkup}${definition.body}</svg>`);
|
|
939
|
-
}
|
|
940
|
-
__name(updateSvgIconNode, "updateSvgIconNode");
|
|
941
|
-
function readProp3(props, name, fallback) {
|
|
942
|
-
const value = Reflect.get(props, name);
|
|
943
|
-
return value === void 0 ? fallback : value;
|
|
944
|
-
}
|
|
945
|
-
__name(readProp3, "readProp");
|
|
946
|
-
function hasText(value) {
|
|
947
|
-
return value !== void 0 && value.trim() !== "";
|
|
948
|
-
}
|
|
949
|
-
__name(hasText, "hasText");
|
|
950
|
-
function normalizeSvgLength(value) {
|
|
951
|
-
if (value === void 0) return void 0;
|
|
952
|
-
return typeof value === "number" ? String(value) : value;
|
|
953
|
-
}
|
|
954
|
-
__name(normalizeSvgLength, "normalizeSvgLength");
|
|
955
|
-
function normalizeCssLength(value) {
|
|
956
|
-
return typeof value === "number" || /^\d+(?:\.\d+)?$/u.test(value) ? `${value}px` : value;
|
|
957
|
-
}
|
|
958
|
-
__name(normalizeCssLength, "normalizeCssLength");
|
|
959
|
-
function setOptionalAttribute2(node, name, value) {
|
|
960
|
-
if (value === void 0 || value === null || value === false || value === "") {
|
|
961
|
-
node.removeAttribute(name);
|
|
962
|
-
return;
|
|
963
|
-
}
|
|
964
|
-
setAttribute(node, name, String(value));
|
|
965
|
-
}
|
|
966
|
-
__name(setOptionalAttribute2, "setOptionalAttribute");
|
|
967
|
-
function clearStaleAttributes(node, next) {
|
|
968
|
-
const previous = node.__vobsIconAttributes ?? /* @__PURE__ */ new Set();
|
|
969
|
-
for (const name of previous) {
|
|
970
|
-
if (!next.has(name)) node.removeAttribute(name);
|
|
971
|
-
}
|
|
972
|
-
node.__vobsIconAttributes = new Set(next.keys());
|
|
973
|
-
}
|
|
974
|
-
__name(clearStaleAttributes, "clearStaleAttributes");
|
|
975
|
-
function escapeXml(value) {
|
|
976
|
-
return value.replace(/&/gu, "&").replace(/</gu, "<").replace(/>/gu, ">").replace(/"/gu, """);
|
|
977
|
-
}
|
|
978
|
-
__name(escapeXml, "escapeXml");
|
|
979
|
-
|
|
980
|
-
// packages/ui/src/icon.ts
|
|
981
|
-
function Icon(props = {}) {
|
|
982
|
-
const root = createSvgIconNode(() => {
|
|
983
|
-
const definition = resolveIcon(
|
|
984
|
-
readProp2(props, "icon", void 0) ?? readProp2(props, "name", void 0)
|
|
985
|
-
);
|
|
986
|
-
if (!definition) {
|
|
987
|
-
if (hasProp2(props, "children")) return void 0;
|
|
988
|
-
throw new Error("Vobs UI: Icon requires a registered `name` or an `icon` definition");
|
|
989
|
-
}
|
|
990
|
-
return iconDefinitionToSvg(definition);
|
|
991
|
-
}, props, {
|
|
992
|
-
class: "vui-icon icon",
|
|
993
|
-
defaultSvgAttributes: {
|
|
994
|
-
fill: "none",
|
|
995
|
-
stroke: "currentColor",
|
|
996
|
-
"stroke-width": 2,
|
|
997
|
-
"stroke-linecap": "butt",
|
|
998
|
-
"stroke-linejoin": "miter"
|
|
999
|
-
}
|
|
1000
|
-
});
|
|
1001
|
-
if (hasProp2(props, "children")) mountSlot(root, props, "children");
|
|
1002
|
-
return root;
|
|
1003
|
-
}
|
|
1004
|
-
__name(Icon, "Icon");
|
|
1005
|
-
function iconDefinitionToSvg(definition) {
|
|
1006
|
-
return {
|
|
1007
|
-
name: definition.name,
|
|
1008
|
-
body: definition.path,
|
|
1009
|
-
viewBox: definition.viewBox
|
|
1010
|
-
};
|
|
1011
|
-
}
|
|
1012
|
-
__name(iconDefinitionToSvg, "iconDefinitionToSvg");
|
|
1013
|
-
var VUI_ICON_PATHS = {
|
|
1014
|
-
search: '<circle cx="11" cy="11" r="7"/><path d="m20 20-3.5-3.5"/>',
|
|
1015
|
-
check: '<polyline points="4 12 10 18 20 6"/>',
|
|
1016
|
-
x: '<line x1="6" y1="6" x2="18" y2="18"/><line x1="18" y1="6" x2="6" y2="18"/>',
|
|
1017
|
-
plus: '<line x1="12" y1="5" x2="12" y2="19"/><line x1="5" y1="12" x2="19" y2="12"/>',
|
|
1018
|
-
minus: '<line x1="5" y1="12" x2="19" y2="12"/>',
|
|
1019
|
-
"chevron-right": '<polyline points="9 6 15 12 9 18"/>',
|
|
1020
|
-
"chevron-down": '<polyline points="6 9 12 15 18 9"/>',
|
|
1021
|
-
"chevron-up": '<polyline points="6 15 12 9 18 15"/>',
|
|
1022
|
-
"chevron-left": '<polyline points="15 6 9 12 15 18"/>',
|
|
1023
|
-
"arrow-left": '<line x1="20" y1="12" x2="4" y2="12"/><polyline points="10 6 4 12 10 18"/>',
|
|
1024
|
-
"arrow-right": '<line x1="4" y1="12" x2="20" y2="12"/><polyline points="14 6 20 12 14 18"/>',
|
|
1025
|
-
"arrow-up": '<line x1="12" y1="20" x2="12" y2="4"/><polyline points="6 10 12 4 18 10"/>',
|
|
1026
|
-
"arrow-down": '<line x1="12" y1="4" x2="12" y2="20"/><polyline points="6 14 12 20 18 14"/>',
|
|
1027
|
-
atom: '<circle cx="12" cy="12" r="2"/><ellipse cx="12" cy="12" rx="10" ry="4"/><ellipse cx="12" cy="12" rx="10" ry="4" transform="rotate(60 12 12)"/><ellipse cx="12" cy="12" rx="10" ry="4" transform="rotate(120 12 12)"/>',
|
|
1028
|
-
globe: '<circle cx="12" cy="12" r="9"/><path d="M3 12h18M12 3a14 14 0 0 1 0 18M12 3a14 14 0 0 0 0 18"/>',
|
|
1029
|
-
"arrow-expand": '<polyline points="14 4 20 4 20 10"/><line x1="14" y1="10" x2="20" y2="4"/><polyline points="10 20 4 20 4 14"/><line x1="10" y1="14" x2="4" y2="20"/>',
|
|
1030
|
-
"arrow-minimize": '<polyline points="20 4 14 10 20 10"/><line x1="14" y1="10" x2="14" y2="4"/><polyline points="4 20 10 14 4 14"/><line x1="10" y1="14" x2="10" y2="20"/>',
|
|
1031
|
-
"check-circle": '<circle cx="12" cy="12" r="9"/><polyline points="8 12 11 15 16 9"/>',
|
|
1032
|
-
"alert-circle": '<circle cx="12" cy="12" r="9"/><line x1="12" y1="8" x2="12" y2="13"/><line x1="12" y1="16" x2="12" y2="16.01"/>',
|
|
1033
|
-
"alert-triangle": '<path d="M12 3 22 20 2 20 Z"/><line x1="12" y1="10" x2="12" y2="15"/><line x1="12" y1="18" x2="12" y2="18.01"/>',
|
|
1034
|
-
info: '<circle cx="12" cy="12" r="9"/><line x1="12" y1="11" x2="12" y2="16"/><line x1="12" y1="8" x2="12" y2="8.01"/>',
|
|
1035
|
-
home: '<polygon points="3 11 12 3 21 11 21 21 14 21 14 14 10 14 10 21 3 21 3 11"/>',
|
|
1036
|
-
user: '<path d="M4 21v-1a6 6 0 0 1 6-6h4a6 6 0 0 1 6 6v1"/><circle cx="12" cy="8" r="4"/>',
|
|
1037
|
-
settings: '<circle cx="12" cy="12" r="3"/><path d="M19.4 15a1.7 1.7 0 0 0 .3 1.8l.1.1a2 2 0 1 1-2.8 2.8l-.1-.1a1.7 1.7 0 0 0-1.8-.3 1.7 1.7 0 0 0-1 1.5V21a2 2 0 1 1-4 0v-.1a1.7 1.7 0 0 0-1-1.5 1.7 1.7 0 0 0-1.8.3l-.1.1a2 2 0 1 1-2.8-2.8l.1-.1a1.7 1.7 0 0 0 .3-1.8 1.7 1.7 0 0 0-1.5-1H3a2 2 0 1 1 0-4h.1a1.7 1.7 0 0 0 1.5-1 1.7 1.7 0 0 0-.3-1.8l-.1-.1a2 2 0 1 1 2.8-2.8l.1.1a1.7 1.7 0 0 0 1.8.3H9a1.7 1.7 0 0 0 1-1.5V3a2 2 0 1 1 4 0v.1a1.7 1.7 0 0 0 1 1.5 1.7 1.7 0 0 0 1.8-.3l.1-.1a2 2 0 1 1 2.8 2.8l-.1.1a1.7 1.7 0 0 0-.3 1.8V9a1.7 1.7 0 0 0 1.5 1H21a2 2 0 1 1 0 4h-.1a1.7 1.7 0 0 0-1.5 1z"/>',
|
|
1038
|
-
menu: '<line x1="4" y1="6" x2="20" y2="6"/><line x1="4" y1="12" x2="20" y2="12"/><line x1="4" y1="18" x2="20" y2="18"/>',
|
|
1039
|
-
"more-h": '<circle cx="5" cy="12" r="1.5" fill="currentColor"/><circle cx="12" cy="12" r="1.5" fill="currentColor"/><circle cx="19" cy="12" r="1.5" fill="currentColor"/>',
|
|
1040
|
-
calendar: '<rect x="3" y="5" width="18" height="16"/><line x1="3" y1="10" x2="21" y2="10"/><line x1="8" y1="3" x2="8" y2="7"/><line x1="16" y1="3" x2="16" y2="7"/>',
|
|
1041
|
-
filter: '<polygon points="3 4 21 4 14 12 14 20 10 18 10 12 3 4"/>',
|
|
1042
|
-
sort: '<path d="M8 20V4"/><polyline points="4 8 8 4 12 8"/><path d="M16 4v16"/><polyline points="12 16 16 20 20 16"/>',
|
|
1043
|
-
edit: '<path d="M4 20h4l10-10-4-4L4 16v4z"/><path d="M14 6l4 4"/>',
|
|
1044
|
-
trash: '<polyline points="4 6 20 6"/><path d="M6 6v14h12V6"/><path d="M9 6V4h6v2"/><line x1="10" y1="10" x2="10" y2="17"/><line x1="14" y1="10" x2="14" y2="17"/>',
|
|
1045
|
-
download: '<path d="M12 3v12"/><polyline points="7 10 12 15 17 10"/><line x1="3" y1="21" x2="21" y2="21"/>',
|
|
1046
|
-
upload: '<path d="M12 21V6"/><polyline points="7 11 12 6 17 11"/><line x1="3" y1="21" x2="21" y2="21"/>',
|
|
1047
|
-
pause: '<line x1="9" y1="5" x2="9" y2="19"/><line x1="15" y1="5" x2="15" y2="19"/>',
|
|
1048
|
-
play: '<polygon points="8 5 19 12 8 19 8 5"/>',
|
|
1049
|
-
refresh: '<polyline points="21 4 21 10 15 10"/><polyline points="3 20 3 14 9 14"/><path d="M20.5 9A9 9 0 0 0 5 5.5L3 7M3.5 15A9 9 0 0 0 19 18.5L21 17"/>',
|
|
1050
|
-
bell: '<path d="M6 8a6 6 0 0 1 12 0c0 7 3 8 3 8H3s3-1 3-8z"/><path d="M10 21a2 2 0 0 0 4 0"/>',
|
|
1051
|
-
folder: '<path d="M3 6h6l2 3h10v10H3z"/>',
|
|
1052
|
-
code: '<polyline points="16 18 22 12 16 6"/><polyline points="8 6 2 12 8 18"/>',
|
|
1053
|
-
sparkles: '<path d="M12 3l1.8 4.2L18 9l-4.2 1.8L12 15l-1.8-4.2L6 9l4.2-1.8L12 3z"/><path d="M19 14l1 2.2 2.2 1-2.2 1L19 20.4l-1-2.2-2.2-1 2.2-1L19 14z"/>',
|
|
1054
|
-
zap: '<polygon points="13 2 4 14 12 14 11 22 20 10 12 10 13 2"/>',
|
|
1055
|
-
sun: '<circle cx="12" cy="12" r="4"/><line x1="12" y1="2" x2="12" y2="5"/><line x1="12" y1="19" x2="12" y2="22"/><line x1="2" y1="12" x2="5" y2="12"/><line x1="19" y1="12" x2="22" y2="12"/><line x1="4.6" y1="4.6" x2="6.7" y2="6.7"/><line x1="17.3" y1="17.3" x2="19.4" y2="19.4"/><line x1="4.6" y1="19.4" x2="6.7" y2="17.3"/><line x1="17.3" y1="6.7" x2="19.4" y2="4.6"/>',
|
|
1056
|
-
moon: '<path d="M21 12.8A9 9 0 1 1 11.2 3a7 7 0 0 0 9.8 9.8z"/>',
|
|
1057
|
-
terminal: '<polyline points="4 7 9 12 4 17"/><line x1="12" y1="17" x2="20" y2="17"/>'
|
|
1058
|
-
};
|
|
1059
|
-
var iconRegistry = new Map(
|
|
1060
|
-
Object.entries(VUI_ICON_PATHS).map(([name, path]) => [name, { name, path }])
|
|
1061
|
-
);
|
|
1062
|
-
function resolveIcon(icon) {
|
|
1063
|
-
return typeof icon === "string" ? iconRegistry.get(icon) : icon;
|
|
1064
|
-
}
|
|
1065
|
-
__name(resolveIcon, "resolveIcon");
|
|
1066
|
-
|
|
1067
186
|
// packages/table/src/icons.ts
|
|
187
|
+
var import_vobs2 = require("@vobs/vobs");
|
|
188
|
+
var import_ui = require("@vobs/ui");
|
|
1068
189
|
function defaultIcons() {
|
|
1069
190
|
return {
|
|
1070
|
-
ascending: /* @__PURE__ */ __name(() => createComponent(Icon, { name: "chevron-up" }), "ascending"),
|
|
1071
|
-
descending: /* @__PURE__ */ __name(() => createComponent(Icon, { name: "chevron-down" }), "descending"),
|
|
1072
|
-
unsorted: /* @__PURE__ */ __name(() => createComponent(Icon, { name: "sort" }), "unsorted"),
|
|
1073
|
-
previous: /* @__PURE__ */ __name(() => createComponent(Icon, { name: "chevron-left" }), "previous"),
|
|
1074
|
-
next: /* @__PURE__ */ __name(() => createComponent(Icon, { name: "chevron-right" }), "next")
|
|
191
|
+
ascending: /* @__PURE__ */ __name(() => (0, import_vobs2.createComponent)(import_ui.Icon, { name: "chevron-up" }), "ascending"),
|
|
192
|
+
descending: /* @__PURE__ */ __name(() => (0, import_vobs2.createComponent)(import_ui.Icon, { name: "chevron-down" }), "descending"),
|
|
193
|
+
unsorted: /* @__PURE__ */ __name(() => (0, import_vobs2.createComponent)(import_ui.Icon, { name: "sort" }), "unsorted"),
|
|
194
|
+
previous: /* @__PURE__ */ __name(() => (0, import_vobs2.createComponent)(import_ui.Icon, { name: "chevron-left" }), "previous"),
|
|
195
|
+
next: /* @__PURE__ */ __name(() => (0, import_vobs2.createComponent)(import_ui.Icon, { name: "chevron-right" }), "next")
|
|
1075
196
|
};
|
|
1076
197
|
}
|
|
1077
198
|
__name(defaultIcons, "defaultIcons");
|
|
@@ -1084,15 +205,15 @@ var DEFAULT_ROW_HEIGHT = 40;
|
|
|
1084
205
|
var DEFAULT_VIRTUAL_HEIGHT = 400;
|
|
1085
206
|
var textCollator = new Intl.Collator(void 0, { numeric: true, sensitivity: "base" });
|
|
1086
207
|
function KitDataTable(props = {}) {
|
|
1087
|
-
const root = createElement("section");
|
|
1088
|
-
const toolbar = createElement("div");
|
|
1089
|
-
const viewport = createElement("div");
|
|
1090
|
-
const table = createElement("table");
|
|
1091
|
-
const head = createElement("thead");
|
|
1092
|
-
const body = createElement("tbody");
|
|
1093
|
-
const footer = createElement("footer");
|
|
1094
|
-
const scrollTop = state(0);
|
|
1095
|
-
internalQueries.set(props, state({
|
|
208
|
+
const root = (0, import_vobs3.createElement)("section");
|
|
209
|
+
const toolbar = (0, import_vobs3.createElement)("div");
|
|
210
|
+
const viewport = (0, import_vobs3.createElement)("div");
|
|
211
|
+
const table = (0, import_vobs3.createElement)("table");
|
|
212
|
+
const head = (0, import_vobs3.createElement)("thead");
|
|
213
|
+
const body = (0, import_vobs3.createElement)("tbody");
|
|
214
|
+
const footer = (0, import_vobs3.createElement)("footer");
|
|
215
|
+
const scrollTop = (0, import_reactivity2.state)(0);
|
|
216
|
+
internalQueries.set(props, (0, import_reactivity2.state)({
|
|
1096
217
|
page: 1,
|
|
1097
218
|
pageSize: DEFAULT_PAGE_SIZE,
|
|
1098
219
|
sort: null,
|
|
@@ -1141,79 +262,79 @@ function KitDataTable(props = {}) {
|
|
|
1141
262
|
"onVisibleColumnIdsChange"
|
|
1142
263
|
]);
|
|
1143
264
|
bindStyle(root, props);
|
|
1144
|
-
setAttribute(toolbar, "class", "vobs-data-table__toolbar");
|
|
1145
|
-
setAttribute(viewport, "class", "vobs-data-table__viewport");
|
|
1146
|
-
setAttribute(viewport, "data-vobs-scrollable", "true");
|
|
1147
|
-
setAttribute(table, "class", "vobs-data-table__table");
|
|
1148
|
-
setAttribute(footer, "class", "vobs-data-table__footer");
|
|
1149
|
-
if (hasProp(props, "toolbar")) insertDynamic(toolbar, null, () => resolveSlot(readProp(props, "toolbar", void 0)));
|
|
1150
|
-
effect(() => {
|
|
1151
|
-
setProperty(toolbar, "hidden", !hasProp(props, "toolbar"));
|
|
265
|
+
(0, import_vobs3.setAttribute)(toolbar, "class", "vobs-data-table__toolbar");
|
|
266
|
+
(0, import_vobs3.setAttribute)(viewport, "class", "vobs-data-table__viewport");
|
|
267
|
+
(0, import_vobs3.setAttribute)(viewport, "data-vobs-scrollable", "true");
|
|
268
|
+
(0, import_vobs3.setAttribute)(table, "class", "vobs-data-table__table");
|
|
269
|
+
(0, import_vobs3.setAttribute)(footer, "class", "vobs-data-table__footer");
|
|
270
|
+
if (hasProp(props, "toolbar")) (0, import_vobs3.insertDynamic)(toolbar, null, () => resolveSlot(readProp(props, "toolbar", void 0)));
|
|
271
|
+
(0, import_reactivity2.effect)(() => {
|
|
272
|
+
(0, import_vobs3.setProperty)(toolbar, "hidden", !hasProp(props, "toolbar"));
|
|
1152
273
|
});
|
|
1153
|
-
effect(() => {
|
|
274
|
+
(0, import_reactivity2.effect)(() => {
|
|
1154
275
|
const virtual = readProp(props, "virtual", false);
|
|
1155
|
-
setProperty(viewport, "tabIndex", virtual ? 0 : -1);
|
|
1156
|
-
setAttribute(viewport, "style", virtual ? `max-height: ${normalizeHeight(readProp(props, "virtualHeight", DEFAULT_VIRTUAL_HEIGHT))}; overflow: auto` : "");
|
|
276
|
+
(0, import_vobs3.setProperty)(viewport, "tabIndex", virtual ? 0 : -1);
|
|
277
|
+
(0, import_vobs3.setAttribute)(viewport, "style", virtual ? `max-height: ${normalizeHeight(readProp(props, "virtualHeight", DEFAULT_VIRTUAL_HEIGHT))}; overflow: auto` : "");
|
|
1157
278
|
});
|
|
1158
|
-
addEventListener(viewport, "scroll", () => {
|
|
279
|
+
(0, import_vobs3.addEventListener)(viewport, "scroll", () => {
|
|
1159
280
|
scrollTop.value = viewport.scrollTop;
|
|
1160
281
|
});
|
|
1161
|
-
insertDynamic(head, null, () => createHeader(props));
|
|
1162
|
-
insertDynamic(body, null, () => createBody(props, scrollTop.value));
|
|
1163
|
-
insertBefore(table, head, null);
|
|
1164
|
-
insertBefore(table, body, null);
|
|
1165
|
-
insertBefore(viewport, table, null);
|
|
1166
|
-
insertDynamic(footer, null, () => createFooter(props));
|
|
1167
|
-
effect(() => {
|
|
1168
|
-
setProperty(footer, "hidden", !shouldShowFooter(props));
|
|
282
|
+
(0, import_vobs3.insertDynamic)(head, null, () => createHeader(props));
|
|
283
|
+
(0, import_vobs3.insertDynamic)(body, null, () => createBody(props, scrollTop.value));
|
|
284
|
+
(0, import_vobs3.insertBefore)(table, head, null);
|
|
285
|
+
(0, import_vobs3.insertBefore)(table, body, null);
|
|
286
|
+
(0, import_vobs3.insertBefore)(viewport, table, null);
|
|
287
|
+
(0, import_vobs3.insertDynamic)(footer, null, () => createFooter(props));
|
|
288
|
+
(0, import_reactivity2.effect)(() => {
|
|
289
|
+
(0, import_vobs3.setProperty)(footer, "hidden", !shouldShowFooter(props));
|
|
1169
290
|
});
|
|
1170
|
-
insertBefore(root, toolbar, null);
|
|
1171
|
-
insertBefore(root, viewport, null);
|
|
1172
|
-
insertBefore(root, footer, null);
|
|
291
|
+
(0, import_vobs3.insertBefore)(root, toolbar, null);
|
|
292
|
+
(0, import_vobs3.insertBefore)(root, viewport, null);
|
|
293
|
+
(0, import_vobs3.insertBefore)(root, footer, null);
|
|
1173
294
|
return root;
|
|
1174
295
|
}
|
|
1175
296
|
__name(KitDataTable, "KitDataTable");
|
|
1176
297
|
function createHeader(props) {
|
|
1177
298
|
const columns = visibleColumns(props);
|
|
1178
|
-
return createFragment((parent, anchor) => {
|
|
1179
|
-
const row = createElement("tr");
|
|
299
|
+
return (0, import_vobs3.createFragment)((parent, anchor) => {
|
|
300
|
+
const row = (0, import_vobs3.createElement)("tr");
|
|
1180
301
|
for (const column of columns) {
|
|
1181
|
-
const cell = createElement("th");
|
|
1182
|
-
setAttribute(cell, "scope", "col");
|
|
1183
|
-
setAttribute(cell, "data-column-id", column.id);
|
|
302
|
+
const cell = (0, import_vobs3.createElement)("th");
|
|
303
|
+
(0, import_vobs3.setAttribute)(cell, "scope", "col");
|
|
304
|
+
(0, import_vobs3.setAttribute)(cell, "data-column-id", column.id);
|
|
1184
305
|
applyColumnStyle(cell, column, readProp(props, "columnSettings", void 0));
|
|
1185
|
-
if (column.sortable) insertBefore(cell, createSortButton(props, column, cell), null);
|
|
1186
|
-
else insertBefore(cell, createText(column.label), null);
|
|
1187
|
-
insertBefore(row, cell, null);
|
|
306
|
+
if (column.sortable) (0, import_vobs3.insertBefore)(cell, createSortButton(props, column, cell), null);
|
|
307
|
+
else (0, import_vobs3.insertBefore)(cell, (0, import_vobs3.createText)(column.label), null);
|
|
308
|
+
(0, import_vobs3.insertBefore)(row, cell, null);
|
|
1188
309
|
}
|
|
1189
|
-
insertBefore(parent, row, anchor);
|
|
310
|
+
(0, import_vobs3.insertBefore)(parent, row, anchor);
|
|
1190
311
|
});
|
|
1191
312
|
}
|
|
1192
313
|
__name(createHeader, "createHeader");
|
|
1193
314
|
function createSortButton(props, column, cell) {
|
|
1194
|
-
const button = createElement("button");
|
|
1195
|
-
const label = createElement("span");
|
|
1196
|
-
const icon = createElement("span");
|
|
1197
|
-
setAttribute(button, "type", "button");
|
|
1198
|
-
setAttribute(button, "class", "vobs-data-table__sort");
|
|
1199
|
-
setAttribute(button, "aria-label", `Sort by ${column.label}`);
|
|
1200
|
-
setAttribute(label, "class", "vobs-data-table__sort-label");
|
|
1201
|
-
setAttribute(icon, "class", "vobs-data-table__sort-icon");
|
|
1202
|
-
insertBefore(label, createText(column.label), null);
|
|
1203
|
-
insertDynamic(icon, null, () => resolveSlot(sortIcon(props, currentSort(props), column.id)));
|
|
1204
|
-
effect(() => {
|
|
315
|
+
const button = (0, import_vobs3.createElement)("button");
|
|
316
|
+
const label = (0, import_vobs3.createElement)("span");
|
|
317
|
+
const icon = (0, import_vobs3.createElement)("span");
|
|
318
|
+
(0, import_vobs3.setAttribute)(button, "type", "button");
|
|
319
|
+
(0, import_vobs3.setAttribute)(button, "class", "vobs-data-table__sort");
|
|
320
|
+
(0, import_vobs3.setAttribute)(button, "aria-label", `Sort by ${column.label}`);
|
|
321
|
+
(0, import_vobs3.setAttribute)(label, "class", "vobs-data-table__sort-label");
|
|
322
|
+
(0, import_vobs3.setAttribute)(icon, "class", "vobs-data-table__sort-icon");
|
|
323
|
+
(0, import_vobs3.insertBefore)(label, (0, import_vobs3.createText)(column.label), null);
|
|
324
|
+
(0, import_vobs3.insertDynamic)(icon, null, () => resolveSlot(sortIcon(props, currentSort(props), column.id)));
|
|
325
|
+
(0, import_reactivity2.effect)(() => {
|
|
1205
326
|
const sort = currentSort(props);
|
|
1206
327
|
const direction = sort?.columnId === column.id ? sort.direction : void 0;
|
|
1207
328
|
setOptionalAttribute(cell, "aria-sort", direction ? direction === "asc" ? "ascending" : "descending" : void 0);
|
|
1208
329
|
setOptionalAttribute(cell, "data-sort-direction", direction);
|
|
1209
330
|
});
|
|
1210
|
-
addEventListener(button, "click", () => {
|
|
331
|
+
(0, import_vobs3.addEventListener)(button, "click", () => {
|
|
1211
332
|
const current = currentSort(props);
|
|
1212
333
|
const next = current?.columnId === column.id ? current.direction === "asc" ? createSort(column, "desc") : null : createSort(column, "asc");
|
|
1213
334
|
emitQuery(props, { ...currentQuery(props), sort: next, page: 1 });
|
|
1214
335
|
});
|
|
1215
|
-
insertBefore(button, label, null);
|
|
1216
|
-
insertBefore(button, icon, null);
|
|
336
|
+
(0, import_vobs3.insertBefore)(button, label, null);
|
|
337
|
+
(0, import_vobs3.insertBefore)(button, icon, null);
|
|
1217
338
|
return button;
|
|
1218
339
|
}
|
|
1219
340
|
__name(createSortButton, "createSortButton");
|
|
@@ -1225,73 +346,73 @@ function createBody(props, scrollTop) {
|
|
|
1225
346
|
if (page.rows.length === 0) return createStateRow(props, "empty");
|
|
1226
347
|
const columns = visibleColumns(props);
|
|
1227
348
|
const window2 = resolveWindow(props, page.rows.length, scrollTop);
|
|
1228
|
-
const fragment = createFragment((parent, anchor) => {
|
|
1229
|
-
if (window2.before > 0) insertBefore(parent, createSpacerRow(columns.length, window2.before), anchor);
|
|
349
|
+
const fragment = (0, import_vobs3.createFragment)((parent, anchor) => {
|
|
350
|
+
if (window2.before > 0) (0, import_vobs3.insertBefore)(parent, createSpacerRow(columns.length, window2.before), anchor);
|
|
1230
351
|
for (let index = window2.start; index < window2.end; index++) {
|
|
1231
|
-
insertBefore(parent, createRow(props, page.rows[index], index, columns), anchor);
|
|
352
|
+
(0, import_vobs3.insertBefore)(parent, createRow(props, page.rows[index], index, columns), anchor);
|
|
1232
353
|
}
|
|
1233
|
-
if (window2.after > 0) insertBefore(parent, createSpacerRow(columns.length, window2.after), anchor);
|
|
354
|
+
if (window2.after > 0) (0, import_vobs3.insertBefore)(parent, createSpacerRow(columns.length, window2.after), anchor);
|
|
1234
355
|
});
|
|
1235
356
|
return fragment;
|
|
1236
357
|
}
|
|
1237
358
|
__name(createBody, "createBody");
|
|
1238
359
|
function createStateRow(props, kind, error) {
|
|
1239
|
-
const row = createElement("tr");
|
|
1240
|
-
const cell = createElement("td");
|
|
1241
|
-
setAttribute(cell, "class", `vobs-data-table__state vobs-data-table__state--${kind}`);
|
|
1242
|
-
setAttribute(cell, "colspan", String(Math.max(1, visibleColumns(props).length)));
|
|
360
|
+
const row = (0, import_vobs3.createElement)("tr");
|
|
361
|
+
const cell = (0, import_vobs3.createElement)("td");
|
|
362
|
+
(0, import_vobs3.setAttribute)(cell, "class", `vobs-data-table__state vobs-data-table__state--${kind}`);
|
|
363
|
+
(0, import_vobs3.setAttribute)(cell, "colspan", String(Math.max(1, visibleColumns(props).length)));
|
|
1243
364
|
let content;
|
|
1244
365
|
if (kind === "error") {
|
|
1245
366
|
const fallback = readProp(props, "error", void 0);
|
|
1246
367
|
const resource = readProp(props, "resource", void 0);
|
|
1247
|
-
content = fallback ? resolveSlot(fallback(error, () => resource?.refetch() ?? Promise.resolve())) : createText(error?.message ?? "Unable to load data");
|
|
368
|
+
content = fallback ? resolveSlot(fallback(error, () => resource?.refetch() ?? Promise.resolve())) : (0, import_vobs3.createText)(error?.message ?? "Unable to load data");
|
|
1248
369
|
} else {
|
|
1249
|
-
content = resolveSlot(readProp(props, kind, void 0)) ?? createText(kind === "loading" ? "Loading..." : "No data");
|
|
370
|
+
content = resolveSlot(readProp(props, kind, void 0)) ?? (0, import_vobs3.createText)(kind === "loading" ? "Loading..." : "No data");
|
|
1250
371
|
}
|
|
1251
|
-
if (content) insertBefore(cell, content, null);
|
|
1252
|
-
insertBefore(row, cell, null);
|
|
372
|
+
if (content) (0, import_vobs3.insertBefore)(cell, content, null);
|
|
373
|
+
(0, import_vobs3.insertBefore)(row, cell, null);
|
|
1253
374
|
return row;
|
|
1254
375
|
}
|
|
1255
376
|
__name(createStateRow, "createStateRow");
|
|
1256
377
|
function createRow(props, row, index, columns) {
|
|
1257
|
-
const tableRow = createElement("tr");
|
|
378
|
+
const tableRow = (0, import_vobs3.createElement)("tr");
|
|
1258
379
|
const rowKey = readProp(props, "rowKey", void 0);
|
|
1259
380
|
if (rowKey) setOptionalAttribute(tableRow, "data-row-key", rowKey(row, index));
|
|
1260
381
|
const onRowClick = readProp(props, "onRowClick", void 0);
|
|
1261
382
|
if (onRowClick) {
|
|
1262
|
-
setProperty(tableRow, "tabIndex", 0);
|
|
1263
|
-
setAttribute(tableRow, "data-clickable", "true");
|
|
1264
|
-
addEventListener(tableRow, "click", () => onRowClick(row, index));
|
|
383
|
+
(0, import_vobs3.setProperty)(tableRow, "tabIndex", 0);
|
|
384
|
+
(0, import_vobs3.setAttribute)(tableRow, "data-clickable", "true");
|
|
385
|
+
(0, import_vobs3.addEventListener)(tableRow, "click", () => onRowClick(row, index));
|
|
1265
386
|
}
|
|
1266
387
|
for (const column of columns) {
|
|
1267
|
-
const cell = createElement("td");
|
|
1268
|
-
setAttribute(cell, "data-column-id", column.id);
|
|
388
|
+
const cell = (0, import_vobs3.createElement)("td");
|
|
389
|
+
(0, import_vobs3.setAttribute)(cell, "data-column-id", column.id);
|
|
1269
390
|
applyColumnStyle(cell, column, readProp(props, "columnSettings", void 0));
|
|
1270
|
-
insertDynamic(cell, null, () => resolveSlot(column.render ? column.render(row, index) : column.key === void 0 ? void 0 : readRowValue(row, column.key)));
|
|
1271
|
-
insertBefore(tableRow, cell, null);
|
|
391
|
+
(0, import_vobs3.insertDynamic)(cell, null, () => resolveSlot(column.render ? column.render(row, index) : column.key === void 0 ? void 0 : readRowValue(row, column.key)));
|
|
392
|
+
(0, import_vobs3.insertBefore)(tableRow, cell, null);
|
|
1272
393
|
}
|
|
1273
394
|
return tableRow;
|
|
1274
395
|
}
|
|
1275
396
|
__name(createRow, "createRow");
|
|
1276
397
|
function createSpacerRow(columnCount, height) {
|
|
1277
|
-
const row = createElement("tr");
|
|
1278
|
-
const cell = createElement("td");
|
|
1279
|
-
setAttribute(cell, "class", "vobs-data-table__spacer");
|
|
1280
|
-
setAttribute(cell, "colspan", String(Math.max(1, columnCount)));
|
|
1281
|
-
setAttribute(cell, "style", `height: ${height}px`);
|
|
1282
|
-
insertBefore(row, cell, null);
|
|
398
|
+
const row = (0, import_vobs3.createElement)("tr");
|
|
399
|
+
const cell = (0, import_vobs3.createElement)("td");
|
|
400
|
+
(0, import_vobs3.setAttribute)(cell, "class", "vobs-data-table__spacer");
|
|
401
|
+
(0, import_vobs3.setAttribute)(cell, "colspan", String(Math.max(1, columnCount)));
|
|
402
|
+
(0, import_vobs3.setAttribute)(cell, "style", `height: ${height}px`);
|
|
403
|
+
(0, import_vobs3.insertBefore)(row, cell, null);
|
|
1283
404
|
return row;
|
|
1284
405
|
}
|
|
1285
406
|
__name(createSpacerRow, "createSpacerRow");
|
|
1286
407
|
function createFooter(props) {
|
|
1287
408
|
const custom = readProp(props, "footer", void 0);
|
|
1288
|
-
if (custom !== void 0) return resolveSlot(custom) ?? createText("");
|
|
409
|
+
if (custom !== void 0) return resolveSlot(custom) ?? (0, import_vobs3.createText)("");
|
|
1289
410
|
const pagination = resolvePaginationState(props);
|
|
1290
|
-
const root = createElement("div");
|
|
1291
|
-
const summary = createElement("span");
|
|
1292
|
-
setAttribute(root, "class", "vobs-data-table__footer-content");
|
|
1293
|
-
setAttribute(summary, "class", "vobs-data-table__summary");
|
|
1294
|
-
insertBefore(summary, createText(pageLabel(
|
|
411
|
+
const root = (0, import_vobs3.createElement)("div");
|
|
412
|
+
const summary = (0, import_vobs3.createElement)("span");
|
|
413
|
+
(0, import_vobs3.setAttribute)(root, "class", "vobs-data-table__footer-content");
|
|
414
|
+
(0, import_vobs3.setAttribute)(summary, "class", "vobs-data-table__summary");
|
|
415
|
+
(0, import_vobs3.insertBefore)(summary, (0, import_vobs3.createText)(pageLabel(
|
|
1295
416
|
props,
|
|
1296
417
|
pagination.page,
|
|
1297
418
|
pagination.pageCount,
|
|
@@ -1300,8 +421,8 @@ function createFooter(props) {
|
|
|
1300
421
|
pagination.pageSize
|
|
1301
422
|
)), null);
|
|
1302
423
|
const actions = hasProp(props, "pagination") ? createCustomPagination(props, pagination) : createPagination(props, pagination);
|
|
1303
|
-
insertBefore(root, summary, null);
|
|
1304
|
-
if (actions) insertBefore(root, actions, null);
|
|
424
|
+
(0, import_vobs3.insertBefore)(root, summary, null);
|
|
425
|
+
if (actions) (0, import_vobs3.insertBefore)(root, actions, null);
|
|
1305
426
|
return root;
|
|
1306
427
|
}
|
|
1307
428
|
__name(createFooter, "createFooter");
|
|
@@ -1322,38 +443,38 @@ function createCustomPagination(props, pagination) {
|
|
|
1322
443
|
}
|
|
1323
444
|
__name(createCustomPagination, "createCustomPagination");
|
|
1324
445
|
function createPagination(props, pagination) {
|
|
1325
|
-
const root = createElement("div");
|
|
446
|
+
const root = (0, import_vobs3.createElement)("div");
|
|
1326
447
|
const mode = readProp(props, "paginationMode", "simple");
|
|
1327
|
-
setAttribute(root, "class", "vobs-data-table__pagination");
|
|
1328
|
-
setAttribute(root, "data-mode", mode);
|
|
1329
|
-
insertBefore(root, createPageButton(props, "previous", pagination), null);
|
|
448
|
+
(0, import_vobs3.setAttribute)(root, "class", "vobs-data-table__pagination");
|
|
449
|
+
(0, import_vobs3.setAttribute)(root, "data-mode", mode);
|
|
450
|
+
(0, import_vobs3.insertBefore)(root, createPageButton(props, "previous", pagination), null);
|
|
1330
451
|
if (mode !== "simple") {
|
|
1331
|
-
const pages = createElement("div");
|
|
1332
|
-
setAttribute(pages, "class", "vobs-data-table__pagination-pages");
|
|
452
|
+
const pages = (0, import_vobs3.createElement)("div");
|
|
453
|
+
(0, import_vobs3.setAttribute)(pages, "class", "vobs-data-table__pagination-pages");
|
|
1333
454
|
for (const item of buildPaginationItems(pagination.page, pagination.pageCount)) {
|
|
1334
|
-
insertBefore(pages, typeof item === "number" ? createPageNumberButton(props, item, pagination.page) : createPageEllipsis(item), null);
|
|
455
|
+
(0, import_vobs3.insertBefore)(pages, typeof item === "number" ? createPageNumberButton(props, item, pagination.page) : createPageEllipsis(item), null);
|
|
1335
456
|
}
|
|
1336
|
-
insertBefore(root, pages, null);
|
|
457
|
+
(0, import_vobs3.insertBefore)(root, pages, null);
|
|
1337
458
|
}
|
|
1338
|
-
insertBefore(root, createPageButton(props, "next", pagination), null);
|
|
1339
|
-
if (mode === "all") insertBefore(root, createJumpControl(props, pagination), null);
|
|
1340
|
-
insertBefore(root, createPageSizeControl(props, pagination), null);
|
|
459
|
+
(0, import_vobs3.insertBefore)(root, createPageButton(props, "next", pagination), null);
|
|
460
|
+
if (mode === "all") (0, import_vobs3.insertBefore)(root, createJumpControl(props, pagination), null);
|
|
461
|
+
(0, import_vobs3.insertBefore)(root, createPageSizeControl(props, pagination), null);
|
|
1341
462
|
return root;
|
|
1342
463
|
}
|
|
1343
464
|
__name(createPagination, "createPagination");
|
|
1344
465
|
function createPageButton(props, direction, pagination) {
|
|
1345
|
-
const button = createElement("button");
|
|
466
|
+
const button = (0, import_vobs3.createElement)("button");
|
|
1346
467
|
const label = direction === "previous" ? readProp(props, "previousLabel", "Previous") : readProp(props, "nextLabel", "Next");
|
|
1347
468
|
const disabled = direction === "previous" ? pagination.page <= 1 : pagination.page >= pagination.pageCount;
|
|
1348
|
-
setAttribute(button, "type", "button");
|
|
1349
|
-
setAttribute(button, "class", "vobs-data-table__page-button");
|
|
1350
|
-
setAttribute(button, "aria-label", label);
|
|
1351
|
-
setProperty(button, "disabled", disabled);
|
|
469
|
+
(0, import_vobs3.setAttribute)(button, "type", "button");
|
|
470
|
+
(0, import_vobs3.setAttribute)(button, "class", "vobs-data-table__page-button");
|
|
471
|
+
(0, import_vobs3.setAttribute)(button, "aria-label", label);
|
|
472
|
+
(0, import_vobs3.setProperty)(button, "disabled", disabled);
|
|
1352
473
|
const icons = resolveIcons(props);
|
|
1353
474
|
const icon = direction === "previous" ? icons.previous : icons.next;
|
|
1354
475
|
const node = icon === void 0 ? void 0 : resolveSlot(icon);
|
|
1355
|
-
if (node) insertBefore(button, node, null);
|
|
1356
|
-
addEventListener(button, "click", () => {
|
|
476
|
+
if (node) (0, import_vobs3.insertBefore)(button, node, null);
|
|
477
|
+
(0, import_vobs3.addEventListener)(button, "click", () => {
|
|
1357
478
|
if (disabled) return;
|
|
1358
479
|
const query = currentQuery(props);
|
|
1359
480
|
goToPage(props, direction === "previous" ? query.page - 1 : query.page + 1, pagination.pageCount);
|
|
@@ -1362,83 +483,83 @@ function createPageButton(props, direction, pagination) {
|
|
|
1362
483
|
}
|
|
1363
484
|
__name(createPageButton, "createPageButton");
|
|
1364
485
|
function createPageNumberButton(props, page, currentPage) {
|
|
1365
|
-
const button = createElement("button");
|
|
486
|
+
const button = (0, import_vobs3.createElement)("button");
|
|
1366
487
|
const active = page === currentPage;
|
|
1367
|
-
setAttribute(button, "type", "button");
|
|
1368
|
-
setAttribute(button, "class", `vobs-data-table__page-button${active ? " is-active" : ""}`);
|
|
1369
|
-
setAttribute(button, "aria-label", `Page ${page}`);
|
|
1370
|
-
if (active) setAttribute(button, "aria-current", "page");
|
|
1371
|
-
insertBefore(button, createText(String(page)), null);
|
|
1372
|
-
addEventListener(button, "click", () => goToPage(props, page, resolvePaginationState(props).pageCount));
|
|
488
|
+
(0, import_vobs3.setAttribute)(button, "type", "button");
|
|
489
|
+
(0, import_vobs3.setAttribute)(button, "class", `vobs-data-table__page-button${active ? " is-active" : ""}`);
|
|
490
|
+
(0, import_vobs3.setAttribute)(button, "aria-label", `Page ${page}`);
|
|
491
|
+
if (active) (0, import_vobs3.setAttribute)(button, "aria-current", "page");
|
|
492
|
+
(0, import_vobs3.insertBefore)(button, (0, import_vobs3.createText)(String(page)), null);
|
|
493
|
+
(0, import_vobs3.addEventListener)(button, "click", () => goToPage(props, page, resolvePaginationState(props).pageCount));
|
|
1373
494
|
return button;
|
|
1374
495
|
}
|
|
1375
496
|
__name(createPageNumberButton, "createPageNumberButton");
|
|
1376
497
|
function createPageEllipsis(side) {
|
|
1377
|
-
const ellipsis = createElement("span");
|
|
1378
|
-
setAttribute(ellipsis, "class", "vobs-data-table__page-ellipsis");
|
|
1379
|
-
setAttribute(ellipsis, "aria-hidden", "true");
|
|
1380
|
-
setAttribute(ellipsis, "data-side", side);
|
|
1381
|
-
insertBefore(ellipsis, createText("..."), null);
|
|
498
|
+
const ellipsis = (0, import_vobs3.createElement)("span");
|
|
499
|
+
(0, import_vobs3.setAttribute)(ellipsis, "class", "vobs-data-table__page-ellipsis");
|
|
500
|
+
(0, import_vobs3.setAttribute)(ellipsis, "aria-hidden", "true");
|
|
501
|
+
(0, import_vobs3.setAttribute)(ellipsis, "data-side", side);
|
|
502
|
+
(0, import_vobs3.insertBefore)(ellipsis, (0, import_vobs3.createText)("..."), null);
|
|
1382
503
|
return ellipsis;
|
|
1383
504
|
}
|
|
1384
505
|
__name(createPageEllipsis, "createPageEllipsis");
|
|
1385
506
|
function createJumpControl(props, pagination) {
|
|
1386
|
-
const root = createElement("form");
|
|
1387
|
-
const label = createElement("label");
|
|
1388
|
-
const input = createElement("input");
|
|
1389
|
-
const submit = createElement("button");
|
|
507
|
+
const root = (0, import_vobs3.createElement)("form");
|
|
508
|
+
const label = (0, import_vobs3.createElement)("label");
|
|
509
|
+
const input = (0, import_vobs3.createElement)("input");
|
|
510
|
+
const submit = (0, import_vobs3.createElement)("button");
|
|
1390
511
|
const jumpLabel = readProp(props, "jumpToLabel", "Go to");
|
|
1391
|
-
setAttribute(root, "class", "vobs-data-table__pagination-jump");
|
|
1392
|
-
setAttribute(label, "class", "vobs-data-table__jump-label");
|
|
1393
|
-
setAttribute(input, "class", "vobs-data-table__jump-input");
|
|
1394
|
-
setAttribute(input, "type", "text");
|
|
1395
|
-
setAttribute(input, "inputmode", "numeric");
|
|
1396
|
-
setAttribute(input, "pattern", "[0-9]*");
|
|
1397
|
-
setAttribute(input, "autocomplete", "off");
|
|
1398
|
-
setAttribute(input, "aria-label", jumpLabel);
|
|
1399
|
-
setAttribute(input, "placeholder", readProp(props, "jumpToPlaceholder", "Page"));
|
|
1400
|
-
setProperty(input, "value", String(pagination.page));
|
|
1401
|
-
setAttribute(submit, "type", "submit");
|
|
1402
|
-
setAttribute(submit, "class", "vobs-data-table__page-button vobs-data-table__jump-submit");
|
|
1403
|
-
setAttribute(submit, "aria-label", readProp(props, "jumpToSubmitLabel", "Go"));
|
|
1404
|
-
insertBefore(label, createText(jumpLabel), null);
|
|
1405
|
-
insertBefore(label, input, null);
|
|
1406
|
-
insertBefore(submit, createText(readProp(props, "jumpToSubmitLabel", "Go")), null);
|
|
1407
|
-
addEventListener(input, "input", () => {
|
|
512
|
+
(0, import_vobs3.setAttribute)(root, "class", "vobs-data-table__pagination-jump");
|
|
513
|
+
(0, import_vobs3.setAttribute)(label, "class", "vobs-data-table__jump-label");
|
|
514
|
+
(0, import_vobs3.setAttribute)(input, "class", "vobs-data-table__jump-input");
|
|
515
|
+
(0, import_vobs3.setAttribute)(input, "type", "text");
|
|
516
|
+
(0, import_vobs3.setAttribute)(input, "inputmode", "numeric");
|
|
517
|
+
(0, import_vobs3.setAttribute)(input, "pattern", "[0-9]*");
|
|
518
|
+
(0, import_vobs3.setAttribute)(input, "autocomplete", "off");
|
|
519
|
+
(0, import_vobs3.setAttribute)(input, "aria-label", jumpLabel);
|
|
520
|
+
(0, import_vobs3.setAttribute)(input, "placeholder", readProp(props, "jumpToPlaceholder", "Page"));
|
|
521
|
+
(0, import_vobs3.setProperty)(input, "value", String(pagination.page));
|
|
522
|
+
(0, import_vobs3.setAttribute)(submit, "type", "submit");
|
|
523
|
+
(0, import_vobs3.setAttribute)(submit, "class", "vobs-data-table__page-button vobs-data-table__jump-submit");
|
|
524
|
+
(0, import_vobs3.setAttribute)(submit, "aria-label", readProp(props, "jumpToSubmitLabel", "Go"));
|
|
525
|
+
(0, import_vobs3.insertBefore)(label, (0, import_vobs3.createText)(jumpLabel), null);
|
|
526
|
+
(0, import_vobs3.insertBefore)(label, input, null);
|
|
527
|
+
(0, import_vobs3.insertBefore)(submit, (0, import_vobs3.createText)(readProp(props, "jumpToSubmitLabel", "Go")), null);
|
|
528
|
+
(0, import_vobs3.addEventListener)(input, "input", () => {
|
|
1408
529
|
const value = input.value.replace(/[^0-9]/gu, "");
|
|
1409
|
-
if (value !== input.value) setProperty(input, "value", value);
|
|
530
|
+
if (value !== input.value) (0, import_vobs3.setProperty)(input, "value", value);
|
|
1410
531
|
});
|
|
1411
|
-
addEventListener(root, "submit", (event) => {
|
|
532
|
+
(0, import_vobs3.addEventListener)(root, "submit", (event) => {
|
|
1412
533
|
event.preventDefault();
|
|
1413
534
|
if (!/^\d+$/u.test(input.value)) return;
|
|
1414
535
|
const requested = Number(input.value);
|
|
1415
536
|
if (!Number.isSafeInteger(requested)) return;
|
|
1416
537
|
goToPage(props, requested, pagination.pageCount);
|
|
1417
538
|
});
|
|
1418
|
-
insertBefore(root, label, null);
|
|
1419
|
-
insertBefore(root, submit, null);
|
|
539
|
+
(0, import_vobs3.insertBefore)(root, label, null);
|
|
540
|
+
(0, import_vobs3.insertBefore)(root, submit, null);
|
|
1420
541
|
return root;
|
|
1421
542
|
}
|
|
1422
543
|
__name(createJumpControl, "createJumpControl");
|
|
1423
544
|
function createPageSizeControl(props, pagination) {
|
|
1424
|
-
const root = createElement("label");
|
|
1425
|
-
const select = createElement("select");
|
|
545
|
+
const root = (0, import_vobs3.createElement)("label");
|
|
546
|
+
const select = (0, import_vobs3.createElement)("select");
|
|
1426
547
|
const label = readProp(props, "pageSizeLabel", "Rows per page");
|
|
1427
|
-
setAttribute(root, "class", "vobs-data-table__page-size");
|
|
1428
|
-
setAttribute(select, "class", "vobs-data-table__page-size-select");
|
|
1429
|
-
setAttribute(select, "aria-label", label);
|
|
1430
|
-
insertBefore(root, createText(label), null);
|
|
548
|
+
(0, import_vobs3.setAttribute)(root, "class", "vobs-data-table__page-size");
|
|
549
|
+
(0, import_vobs3.setAttribute)(select, "class", "vobs-data-table__page-size-select");
|
|
550
|
+
(0, import_vobs3.setAttribute)(select, "aria-label", label);
|
|
551
|
+
(0, import_vobs3.insertBefore)(root, (0, import_vobs3.createText)(label), null);
|
|
1431
552
|
for (const optionValue of pageSizeOptions(props, pagination.pageSize)) {
|
|
1432
|
-
const option = createElement("option");
|
|
1433
|
-
setAttribute(option, "value", String(optionValue));
|
|
1434
|
-
setProperty(option, "textContent", String(optionValue));
|
|
1435
|
-
insertBefore(select, option, null);
|
|
553
|
+
const option = (0, import_vobs3.createElement)("option");
|
|
554
|
+
(0, import_vobs3.setAttribute)(option, "value", String(optionValue));
|
|
555
|
+
(0, import_vobs3.setProperty)(option, "textContent", String(optionValue));
|
|
556
|
+
(0, import_vobs3.insertBefore)(select, option, null);
|
|
1436
557
|
}
|
|
1437
|
-
setProperty(select, "value", String(pagination.pageSize));
|
|
1438
|
-
addEventListener(select, "change", () => {
|
|
558
|
+
(0, import_vobs3.setProperty)(select, "value", String(pagination.pageSize));
|
|
559
|
+
(0, import_vobs3.addEventListener)(select, "change", () => {
|
|
1439
560
|
setPageSize(props, Number(select.value));
|
|
1440
561
|
});
|
|
1441
|
-
insertBefore(root, select, null);
|
|
562
|
+
(0, import_vobs3.insertBefore)(root, select, null);
|
|
1442
563
|
return root;
|
|
1443
564
|
}
|
|
1444
565
|
__name(createPageSizeControl, "createPageSizeControl");
|
|
@@ -1667,7 +788,7 @@ function applyColumnStyle(cell, column, settings) {
|
|
|
1667
788
|
normalizePixels(width) ? `width: ${normalizePixels(width)}` : "",
|
|
1668
789
|
normalizePixels(column.minWidth) ? `min-width: ${normalizePixels(column.minWidth)}` : ""
|
|
1669
790
|
].filter(Boolean).join("; ");
|
|
1670
|
-
if (styles) setAttribute(cell, "style", styles);
|
|
791
|
+
if (styles) (0, import_vobs3.setAttribute)(cell, "style", styles);
|
|
1671
792
|
setOptionalAttribute(cell, "data-align", column.align);
|
|
1672
793
|
}
|
|
1673
794
|
__name(applyColumnStyle, "applyColumnStyle");
|
|
@@ -1685,17 +806,19 @@ function readRowValue(row, key) {
|
|
|
1685
806
|
__name(readRowValue, "readRowValue");
|
|
1686
807
|
|
|
1687
808
|
// packages/table/src/column-settings.ts
|
|
809
|
+
var import_reactivity3 = require("@vobs/reactivity");
|
|
810
|
+
var import_vobs4 = require("@vobs/vobs");
|
|
1688
811
|
function KitColumnSettings(props = {}) {
|
|
1689
|
-
const root = createElement("details");
|
|
1690
|
-
const summary = createElement("summary");
|
|
1691
|
-
const panel = createElement("div");
|
|
812
|
+
const root = (0, import_vobs4.createElement)("details");
|
|
813
|
+
const summary = (0, import_vobs4.createElement)("summary");
|
|
814
|
+
const panel = (0, import_vobs4.createElement)("div");
|
|
1692
815
|
const columns = readColumns(props);
|
|
1693
|
-
const internalSettings = state(untrack(() => initialSettings(props, columns)));
|
|
1694
|
-
const panelOpen = state(false);
|
|
1695
|
-
untrack(() => restoreSettings(props, columns, internalSettings));
|
|
1696
|
-
effect(() => {
|
|
816
|
+
const internalSettings = (0, import_reactivity3.state)((0, import_reactivity3.untrack)(() => initialSettings(props, columns)));
|
|
817
|
+
const panelOpen = (0, import_reactivity3.state)(false);
|
|
818
|
+
(0, import_reactivity3.untrack)(() => restoreSettings(props, columns, internalSettings));
|
|
819
|
+
(0, import_reactivity3.effect)(() => {
|
|
1697
820
|
currentSettings(props, internalSettings, columns);
|
|
1698
|
-
if (panelOpen.value) setProperty(root, "open", true);
|
|
821
|
+
if (panelOpen.value) (0, import_vobs4.setProperty)(root, "open", true);
|
|
1699
822
|
});
|
|
1700
823
|
bindClassList(root, props, () => ["vobs-column-settings"]);
|
|
1701
824
|
bindCommonAttributes(root, props, [
|
|
@@ -1712,53 +835,53 @@ function KitColumnSettings(props = {}) {
|
|
|
1712
835
|
"onReset",
|
|
1713
836
|
"onPersistenceError"
|
|
1714
837
|
]);
|
|
1715
|
-
setAttribute(summary, "class", "vobs-column-settings__trigger");
|
|
1716
|
-
setAttribute(panel, "class", "vobs-column-settings__panel");
|
|
1717
|
-
setAttribute(panel, "role", "group");
|
|
1718
|
-
addEventListener(summary, "click", (event) => {
|
|
838
|
+
(0, import_vobs4.setAttribute)(summary, "class", "vobs-column-settings__trigger");
|
|
839
|
+
(0, import_vobs4.setAttribute)(panel, "class", "vobs-column-settings__panel");
|
|
840
|
+
(0, import_vobs4.setAttribute)(panel, "role", "group");
|
|
841
|
+
(0, import_vobs4.addEventListener)(summary, "click", (event) => {
|
|
1719
842
|
event.preventDefault();
|
|
1720
843
|
panelOpen.value = !root.open;
|
|
1721
|
-
setProperty(root, "open", panelOpen.value);
|
|
844
|
+
(0, import_vobs4.setProperty)(root, "open", panelOpen.value);
|
|
1722
845
|
});
|
|
1723
846
|
if (hasProp(props, "trigger")) {
|
|
1724
|
-
insertDynamic(summary, null, () => resolveSlot(readProp(props, "trigger", void 0)));
|
|
847
|
+
(0, import_vobs4.insertDynamic)(summary, null, () => resolveSlot(readProp(props, "trigger", void 0)));
|
|
1725
848
|
} else {
|
|
1726
|
-
const label = createText("");
|
|
1727
|
-
|
|
1728
|
-
insertBefore(summary, label, null);
|
|
849
|
+
const label = (0, import_vobs4.createText)("");
|
|
850
|
+
bindText(label, () => readProp(props, "label", "Columns"));
|
|
851
|
+
(0, import_vobs4.insertBefore)(summary, label, null);
|
|
1729
852
|
}
|
|
1730
|
-
insertDynamic(panel, null, () => createColumnOptions(props, internalSettings, columns, root));
|
|
1731
|
-
insertBefore(root, summary, null);
|
|
1732
|
-
insertBefore(root, panel, null);
|
|
853
|
+
(0, import_vobs4.insertDynamic)(panel, null, () => createColumnOptions(props, internalSettings, columns, root));
|
|
854
|
+
(0, import_vobs4.insertBefore)(root, summary, null);
|
|
855
|
+
(0, import_vobs4.insertBefore)(root, panel, null);
|
|
1733
856
|
return root;
|
|
1734
857
|
}
|
|
1735
858
|
__name(KitColumnSettings, "KitColumnSettings");
|
|
1736
859
|
function createColumnOptions(props, internalSettings, columns, root) {
|
|
1737
860
|
const settings = currentSettings(props, internalSettings, columns);
|
|
1738
|
-
return createFragment((parent, anchor) => {
|
|
1739
|
-
const reset = createElement("button");
|
|
1740
|
-
const resetLabel = createText("");
|
|
1741
|
-
setAttribute(reset, "type", "button");
|
|
1742
|
-
setAttribute(reset, "class", "vobs-column-settings__reset");
|
|
1743
|
-
|
|
1744
|
-
addEventListener(reset, "click", (event) => {
|
|
861
|
+
return (0, import_vobs4.createFragment)((parent, anchor) => {
|
|
862
|
+
const reset = (0, import_vobs4.createElement)("button");
|
|
863
|
+
const resetLabel = (0, import_vobs4.createText)("");
|
|
864
|
+
(0, import_vobs4.setAttribute)(reset, "type", "button");
|
|
865
|
+
(0, import_vobs4.setAttribute)(reset, "class", "vobs-column-settings__reset");
|
|
866
|
+
bindText(resetLabel, () => readProp(props, "resetLabel", "Reset columns"));
|
|
867
|
+
(0, import_vobs4.addEventListener)(reset, "click", (event) => {
|
|
1745
868
|
event.preventDefault();
|
|
1746
869
|
event.stopPropagation();
|
|
1747
870
|
resetSettings(props, internalSettings, columns, root);
|
|
1748
871
|
});
|
|
1749
|
-
insertBefore(reset, resetLabel, null);
|
|
1750
|
-
insertBefore(parent, reset, anchor);
|
|
1751
|
-
const visibility = createElement("div");
|
|
1752
|
-
setAttribute(visibility, "class", "vobs-column-settings__visibility");
|
|
872
|
+
(0, import_vobs4.insertBefore)(reset, resetLabel, null);
|
|
873
|
+
(0, import_vobs4.insertBefore)(parent, reset, anchor);
|
|
874
|
+
const visibility = (0, import_vobs4.createElement)("div");
|
|
875
|
+
(0, import_vobs4.setAttribute)(visibility, "class", "vobs-column-settings__visibility");
|
|
1753
876
|
for (const column of columns) {
|
|
1754
|
-
insertBefore(visibility, createVisibilityOption(props, internalSettings, columns, column), null);
|
|
877
|
+
(0, import_vobs4.insertBefore)(visibility, createVisibilityOption(props, internalSettings, columns, column), null);
|
|
1755
878
|
}
|
|
1756
|
-
insertBefore(parent, visibility, anchor);
|
|
1757
|
-
const layout = createElement("div");
|
|
1758
|
-
setAttribute(layout, "class", "vobs-column-settings__layout");
|
|
879
|
+
(0, import_vobs4.insertBefore)(parent, visibility, anchor);
|
|
880
|
+
const layout = (0, import_vobs4.createElement)("div");
|
|
881
|
+
(0, import_vobs4.setAttribute)(layout, "class", "vobs-column-settings__layout");
|
|
1759
882
|
const ordered = orderColumns(columns, settings.columnOrder);
|
|
1760
883
|
for (const [index, column] of ordered.entries()) {
|
|
1761
|
-
insertBefore(layout, createLayoutOption(
|
|
884
|
+
(0, import_vobs4.insertBefore)(layout, createLayoutOption(
|
|
1762
885
|
props,
|
|
1763
886
|
internalSettings,
|
|
1764
887
|
columns,
|
|
@@ -1768,20 +891,20 @@ function createColumnOptions(props, internalSettings, columns, root) {
|
|
|
1768
891
|
index === ordered.length - 1
|
|
1769
892
|
), null);
|
|
1770
893
|
}
|
|
1771
|
-
insertBefore(parent, layout, anchor);
|
|
894
|
+
(0, import_vobs4.insertBefore)(parent, layout, anchor);
|
|
1772
895
|
});
|
|
1773
896
|
}
|
|
1774
897
|
__name(createColumnOptions, "createColumnOptions");
|
|
1775
898
|
function createVisibilityOption(props, internalSettings, columns, column) {
|
|
1776
|
-
const option = createElement("label");
|
|
1777
|
-
const input = createElement("input");
|
|
1778
|
-
const text = createText(column.label);
|
|
899
|
+
const option = (0, import_vobs4.createElement)("label");
|
|
900
|
+
const input = (0, import_vobs4.createElement)("input");
|
|
901
|
+
const text = (0, import_vobs4.createText)(column.label);
|
|
1779
902
|
const settings = currentSettings(props, internalSettings, columns);
|
|
1780
|
-
setAttribute(option, "class", "vobs-column-settings__option");
|
|
1781
|
-
setAttribute(input, "type", "checkbox");
|
|
1782
|
-
setProperty(input, "checked", settings.visibleColumnIds.includes(column.id));
|
|
1783
|
-
setProperty(input, "disabled", settings.visibleColumnIds.length <= 1 && input.checked);
|
|
1784
|
-
addEventListener(input, "change", () => {
|
|
903
|
+
(0, import_vobs4.setAttribute)(option, "class", "vobs-column-settings__option");
|
|
904
|
+
(0, import_vobs4.setAttribute)(input, "type", "checkbox");
|
|
905
|
+
(0, import_vobs4.setProperty)(input, "checked", settings.visibleColumnIds.includes(column.id));
|
|
906
|
+
(0, import_vobs4.setProperty)(input, "disabled", settings.visibleColumnIds.length <= 1 && input.checked);
|
|
907
|
+
(0, import_vobs4.addEventListener)(input, "change", () => {
|
|
1785
908
|
const current = currentSettings(props, internalSettings, columns);
|
|
1786
909
|
const visible = new Set(current.visibleColumnIds);
|
|
1787
910
|
if (input.checked) visible.add(column.id);
|
|
@@ -1793,36 +916,36 @@ function createVisibilityOption(props, internalSettings, columns, column) {
|
|
|
1793
916
|
visibleColumnIds: nextIds
|
|
1794
917
|
});
|
|
1795
918
|
});
|
|
1796
|
-
insertBefore(option, input, null);
|
|
1797
|
-
insertBefore(option, text, null);
|
|
919
|
+
(0, import_vobs4.insertBefore)(option, input, null);
|
|
920
|
+
(0, import_vobs4.insertBefore)(option, text, null);
|
|
1798
921
|
return option;
|
|
1799
922
|
}
|
|
1800
923
|
__name(createVisibilityOption, "createVisibilityOption");
|
|
1801
924
|
function createLayoutOption(props, internalSettings, columns, column, root, isFirst, isLast) {
|
|
1802
|
-
const option = createElement("div");
|
|
1803
|
-
const label = createElement("span");
|
|
1804
|
-
const controls = createElement("div");
|
|
925
|
+
const option = (0, import_vobs4.createElement)("div");
|
|
926
|
+
const label = (0, import_vobs4.createElement)("span");
|
|
927
|
+
const controls = (0, import_vobs4.createElement)("div");
|
|
1805
928
|
const up = createMoveButton("up", column.label, isFirst);
|
|
1806
929
|
const down = createMoveButton("down", column.label, isLast);
|
|
1807
|
-
const width = createElement("input");
|
|
930
|
+
const width = (0, import_vobs4.createElement)("input");
|
|
1808
931
|
const current = currentSettings(props, internalSettings, columns);
|
|
1809
932
|
const configuredWidth = current.columnWidths[column.id] ?? column.width;
|
|
1810
|
-
setAttribute(option, "class", "vobs-column-settings__layout-option");
|
|
1811
|
-
setAttribute(option, "data-column-id", column.id);
|
|
1812
|
-
setAttribute(label, "class", "vobs-column-settings__layout-label");
|
|
1813
|
-
setProperty(label, "textContent", column.label);
|
|
1814
|
-
setAttribute(controls, "class", "vobs-column-settings__layout-controls");
|
|
1815
|
-
setAttribute(width, "type", "text");
|
|
1816
|
-
setAttribute(width, "class", "vobs-column-settings__width");
|
|
1817
|
-
setAttribute(width, "placeholder", "auto");
|
|
1818
|
-
setAttribute(width, "aria-label", `${column.label} width`);
|
|
1819
|
-
setProperty(width, "value", displayWidth(configuredWidth));
|
|
1820
|
-
addEventListener(up, "click", (event) => {
|
|
933
|
+
(0, import_vobs4.setAttribute)(option, "class", "vobs-column-settings__layout-option");
|
|
934
|
+
(0, import_vobs4.setAttribute)(option, "data-column-id", column.id);
|
|
935
|
+
(0, import_vobs4.setAttribute)(label, "class", "vobs-column-settings__layout-label");
|
|
936
|
+
(0, import_vobs4.setProperty)(label, "textContent", column.label);
|
|
937
|
+
(0, import_vobs4.setAttribute)(controls, "class", "vobs-column-settings__layout-controls");
|
|
938
|
+
(0, import_vobs4.setAttribute)(width, "type", "text");
|
|
939
|
+
(0, import_vobs4.setAttribute)(width, "class", "vobs-column-settings__width");
|
|
940
|
+
(0, import_vobs4.setAttribute)(width, "placeholder", "auto");
|
|
941
|
+
(0, import_vobs4.setAttribute)(width, "aria-label", `${column.label} width`);
|
|
942
|
+
(0, import_vobs4.setProperty)(width, "value", displayWidth(configuredWidth));
|
|
943
|
+
(0, import_vobs4.addEventListener)(up, "click", (event) => {
|
|
1821
944
|
event.preventDefault();
|
|
1822
945
|
event.stopPropagation();
|
|
1823
946
|
moveColumn(props, internalSettings, columns, column.id, -1, root);
|
|
1824
947
|
});
|
|
1825
|
-
addEventListener(down, "click", (event) => {
|
|
948
|
+
(0, import_vobs4.addEventListener)(down, "click", (event) => {
|
|
1826
949
|
event.preventDefault();
|
|
1827
950
|
event.stopPropagation();
|
|
1828
951
|
moveColumn(props, internalSettings, columns, column.id, 1, root);
|
|
@@ -1844,29 +967,29 @@ function createLayoutOption(props, internalSettings, columns, column, root, isFi
|
|
|
1844
967
|
columnWidths: nextWidths
|
|
1845
968
|
});
|
|
1846
969
|
}, "commitWidth");
|
|
1847
|
-
addEventListener(width, "change", commitWidth);
|
|
1848
|
-
addEventListener(width, "blur", commitWidth);
|
|
1849
|
-
addEventListener(width, "keydown", (event) => {
|
|
970
|
+
(0, import_vobs4.addEventListener)(width, "change", commitWidth);
|
|
971
|
+
(0, import_vobs4.addEventListener)(width, "blur", commitWidth);
|
|
972
|
+
(0, import_vobs4.addEventListener)(width, "keydown", (event) => {
|
|
1850
973
|
if (event.key !== "Enter") return;
|
|
1851
974
|
event.preventDefault();
|
|
1852
975
|
commitWidth();
|
|
1853
976
|
});
|
|
1854
|
-
insertBefore(controls, up, null);
|
|
1855
|
-
insertBefore(controls, down, null);
|
|
1856
|
-
insertBefore(controls, width, null);
|
|
1857
|
-
insertBefore(option, label, null);
|
|
1858
|
-
insertBefore(option, controls, null);
|
|
977
|
+
(0, import_vobs4.insertBefore)(controls, up, null);
|
|
978
|
+
(0, import_vobs4.insertBefore)(controls, down, null);
|
|
979
|
+
(0, import_vobs4.insertBefore)(controls, width, null);
|
|
980
|
+
(0, import_vobs4.insertBefore)(option, label, null);
|
|
981
|
+
(0, import_vobs4.insertBefore)(option, controls, null);
|
|
1859
982
|
return option;
|
|
1860
983
|
}
|
|
1861
984
|
__name(createLayoutOption, "createLayoutOption");
|
|
1862
985
|
function createMoveButton(direction, columnLabel, disabled) {
|
|
1863
|
-
const button = createElement("button");
|
|
1864
|
-
setAttribute(button, "type", "button");
|
|
1865
|
-
setAttribute(button, "class", `vobs-column-settings__move vobs-column-settings__move--${direction}`);
|
|
1866
|
-
setAttribute(button, "aria-label", `Move ${columnLabel} ${direction}`);
|
|
1867
|
-
setAttribute(button, "title", `Move ${columnLabel} ${direction}`);
|
|
1868
|
-
setProperty(button, "disabled", disabled);
|
|
1869
|
-
insertBefore(button, createText(direction === "up" ? "\u2191" : "\u2193"), null);
|
|
986
|
+
const button = (0, import_vobs4.createElement)("button");
|
|
987
|
+
(0, import_vobs4.setAttribute)(button, "type", "button");
|
|
988
|
+
(0, import_vobs4.setAttribute)(button, "class", `vobs-column-settings__move vobs-column-settings__move--${direction}`);
|
|
989
|
+
(0, import_vobs4.setAttribute)(button, "aria-label", `Move ${columnLabel} ${direction}`);
|
|
990
|
+
(0, import_vobs4.setAttribute)(button, "title", `Move ${columnLabel} ${direction}`);
|
|
991
|
+
(0, import_vobs4.setProperty)(button, "disabled", disabled);
|
|
992
|
+
(0, import_vobs4.insertBefore)(button, (0, import_vobs4.createText)(direction === "up" ? "\u2191" : "\u2193"), null);
|
|
1870
993
|
return button;
|
|
1871
994
|
}
|
|
1872
995
|
__name(createMoveButton, "createMoveButton");
|
|
@@ -1974,7 +1097,7 @@ function reportPersistenceError(props, error) {
|
|
|
1974
1097
|
__name(reportPersistenceError, "reportPersistenceError");
|
|
1975
1098
|
function reopenPanel(root) {
|
|
1976
1099
|
setTimeout(() => {
|
|
1977
|
-
setProperty(root, "open", true);
|
|
1100
|
+
(0, import_vobs4.setProperty)(root, "open", true);
|
|
1978
1101
|
}, 0);
|
|
1979
1102
|
}
|
|
1980
1103
|
__name(reopenPanel, "reopenPanel");
|
|
@@ -2038,6 +1161,7 @@ function createLocalColumnSettingsPersistence(key, storage) {
|
|
|
2038
1161
|
return memory.get(normalizedKey) ?? null;
|
|
2039
1162
|
}
|
|
2040
1163
|
}
|
|
1164
|
+
__name(read, "read");
|
|
2041
1165
|
}
|
|
2042
1166
|
__name(createLocalColumnSettingsPersistence, "createLocalColumnSettingsPersistence");
|
|
2043
1167
|
function resolveLocalStorage() {
|
|
@@ -2055,13 +1179,14 @@ function isColumnSettings(value) {
|
|
|
2055
1179
|
return Array.isArray(candidate.visibleColumnIds) && candidate.visibleColumnIds.every((id) => typeof id === "string") && Array.isArray(candidate.columnOrder) && candidate.columnOrder.every((id) => typeof id === "string") && Boolean(candidate.columnWidths) && typeof candidate.columnWidths === "object" && !Array.isArray(candidate.columnWidths);
|
|
2056
1180
|
}
|
|
2057
1181
|
__name(isColumnSettings, "isColumnSettings");
|
|
2058
|
-
|
|
2059
|
-
exports
|
|
2060
|
-
|
|
2061
|
-
|
|
2062
|
-
|
|
2063
|
-
|
|
2064
|
-
|
|
2065
|
-
|
|
2066
|
-
|
|
1182
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
1183
|
+
0 && (module.exports = {
|
|
1184
|
+
KitColumnSettings,
|
|
1185
|
+
KitDataTable,
|
|
1186
|
+
createColumnSettingsPersistence,
|
|
1187
|
+
createDefaultColumnSettings,
|
|
1188
|
+
createLocalColumnSettingsPersistence,
|
|
1189
|
+
defaultIcons,
|
|
1190
|
+
normalizeColumnSettings
|
|
1191
|
+
});
|
|
2067
1192
|
//# sourceMappingURL=index.cjs.map
|