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