@vobs/table 1.2.0 → 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 +9 -5
package/dist/column-settings.cjs
CHANGED
|
@@ -1,615 +1,36 @@
|
|
|
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 markHmrInstanceMounted(node, parent) {
|
|
409
|
-
const instance = hmrInstances.get(node);
|
|
410
|
-
if (instance) instance.parent = parent;
|
|
411
|
-
}
|
|
412
|
-
__name(markHmrInstanceMounted, "markHmrInstanceMounted");
|
|
413
|
-
var hmrInstances = /* @__PURE__ */ new WeakMap();
|
|
414
|
-
var nodeOwners = /* @__PURE__ */ new WeakMap();
|
|
415
|
-
var eventBindings = /* @__PURE__ */ new WeakMap();
|
|
416
|
-
function getRenderer() {
|
|
417
|
-
{
|
|
418
|
-
throw new Error("\u6E32\u67D3\u5668\u672A\u521D\u59CB\u5316");
|
|
419
|
-
}
|
|
420
|
-
}
|
|
421
|
-
__name(getRenderer, "getRenderer");
|
|
422
|
-
function createText(content) {
|
|
423
|
-
return getRenderer().createText(content);
|
|
424
|
-
}
|
|
425
|
-
__name(createText, "createText");
|
|
426
|
-
function createElement(tag) {
|
|
427
|
-
return getRenderer().createElement(tag);
|
|
428
|
-
}
|
|
429
|
-
__name(createElement, "createElement");
|
|
430
|
-
function createComment(content) {
|
|
431
|
-
return getRenderer().createComment(content);
|
|
432
|
-
}
|
|
433
|
-
__name(createComment, "createComment");
|
|
434
|
-
function insertBefore(parent, child, anchor) {
|
|
435
|
-
if (isVobsFragment(child)) {
|
|
436
|
-
child.mount(parent, isVobsFragment(anchor) ? anchor.start : anchor);
|
|
437
|
-
return;
|
|
438
|
-
}
|
|
439
|
-
getRenderer().insertBefore(parent, child, isVobsFragment(anchor) ? anchor.start : anchor);
|
|
440
|
-
markHmrInstanceMounted(child, parent);
|
|
441
|
-
}
|
|
442
|
-
__name(insertBefore, "insertBefore");
|
|
443
|
-
function removeChild(parent, child) {
|
|
444
|
-
disposeNodeOwner(child);
|
|
445
|
-
if (isVobsFragment(child)) {
|
|
446
|
-
child.unmount(parent);
|
|
447
|
-
return;
|
|
448
|
-
}
|
|
449
|
-
getRenderer().removeChild(parent, child);
|
|
450
|
-
}
|
|
451
|
-
__name(removeChild, "removeChild");
|
|
452
|
-
function setTextContent(node, content) {
|
|
453
|
-
getRenderer().setTextContent(node, content);
|
|
454
|
-
}
|
|
455
|
-
__name(setTextContent, "setTextContent");
|
|
456
|
-
function setProperty(node, key, value) {
|
|
457
|
-
getRenderer().setProperty(node, key, value);
|
|
458
|
-
}
|
|
459
|
-
__name(setProperty, "setProperty");
|
|
460
|
-
function setAttribute(node, key, value) {
|
|
461
|
-
getRenderer().setAttribute(node, key, value);
|
|
462
|
-
}
|
|
463
|
-
__name(setAttribute, "setAttribute");
|
|
464
|
-
function addEventListener(node, event, handler) {
|
|
465
|
-
const renderer = getRenderer();
|
|
466
|
-
const owner = getCurrentOwner();
|
|
467
|
-
let bindings = eventBindings.get(node);
|
|
468
|
-
if (!bindings) {
|
|
469
|
-
bindings = /* @__PURE__ */ new Map();
|
|
470
|
-
eventBindings.set(node, bindings);
|
|
471
|
-
}
|
|
472
|
-
const previous = bindings.get(event);
|
|
473
|
-
if (previous && previous.original === handler && previous.owner === owner) return;
|
|
474
|
-
if (previous) renderer.removeEventListener(node, event, previous.handler);
|
|
475
|
-
const listener = owner ? (reason) => {
|
|
476
|
-
try {
|
|
477
|
-
owner.run(() => handler(reason));
|
|
478
|
-
} catch (error) {
|
|
479
|
-
const handled = owner.handleError(error);
|
|
480
|
-
invokeRuntimeDebug("error", {
|
|
481
|
-
error,
|
|
482
|
-
owner,
|
|
483
|
-
phase: "event",
|
|
484
|
-
handled,
|
|
485
|
-
recovery: handled ? "handled" : "propagated"
|
|
486
|
-
});
|
|
487
|
-
if (!handled) throw error;
|
|
488
|
-
}
|
|
489
|
-
} : handler;
|
|
490
|
-
const binding = { handler: listener, owner, original: handler };
|
|
491
|
-
bindings.set(event, binding);
|
|
492
|
-
renderer.addEventListener(node, event, listener);
|
|
493
|
-
owner?.onDispose(() => {
|
|
494
|
-
if (bindings?.get(event) !== binding) return;
|
|
495
|
-
bindings.delete(event);
|
|
496
|
-
renderer.removeEventListener(node, event, listener);
|
|
497
|
-
});
|
|
498
|
-
}
|
|
499
|
-
__name(addEventListener, "addEventListener");
|
|
500
|
-
function createBlock(factory) {
|
|
501
|
-
const owner = createOwner();
|
|
502
|
-
setOwnerDebugName(owner, "dynamic");
|
|
503
|
-
let node;
|
|
504
|
-
try {
|
|
505
|
-
node = owner.run(factory);
|
|
506
|
-
} catch (error) {
|
|
507
|
-
owner.dispose();
|
|
508
|
-
throw error;
|
|
509
|
-
}
|
|
510
|
-
if (!node) {
|
|
511
|
-
owner.dispose();
|
|
512
|
-
return null;
|
|
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 });
|
|
513
17
|
}
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
}
|
|
517
|
-
__name(createBlock, "createBlock");
|
|
518
|
-
function associateNodeOwner(node, owner) {
|
|
519
|
-
nodeOwners.set(node, owner);
|
|
520
|
-
}
|
|
521
|
-
__name(associateNodeOwner, "associateNodeOwner");
|
|
522
|
-
function disposeNodeOwner(node) {
|
|
523
|
-
const owner = nodeOwners.get(node);
|
|
524
|
-
if (!owner) return;
|
|
525
|
-
nodeOwners.delete(node);
|
|
526
|
-
owner.dispose();
|
|
527
|
-
}
|
|
528
|
-
__name(disposeNodeOwner, "disposeNodeOwner");
|
|
529
|
-
|
|
530
|
-
// packages/runtime/src/fragment.ts
|
|
531
|
-
function createFragment(factory) {
|
|
532
|
-
const start = createComment("vobs:fragment:start");
|
|
533
|
-
const end = createComment("vobs:fragment:end");
|
|
534
|
-
let parent = null;
|
|
535
|
-
let initialized = false;
|
|
536
|
-
const owner = getCurrentOwner();
|
|
537
|
-
const fragment = {
|
|
538
|
-
kind: "vobs-fragment",
|
|
539
|
-
start,
|
|
540
|
-
end,
|
|
541
|
-
mount(nextParent, anchor) {
|
|
542
|
-
if (parent && parent !== nextParent) {
|
|
543
|
-
throw new Error("Vobs Fragment: \u4E0D\u80FD\u8DE8\u7236\u8282\u70B9\u79FB\u52A8 Fragment");
|
|
544
|
-
}
|
|
545
|
-
if (initialized) {
|
|
546
|
-
moveRange(nextParent, start, end, anchor);
|
|
547
|
-
return;
|
|
548
|
-
}
|
|
549
|
-
const renderer = getRenderer();
|
|
550
|
-
renderer.insertBefore(nextParent, start, anchor);
|
|
551
|
-
renderer.insertBefore(nextParent, end, anchor);
|
|
552
|
-
parent = nextParent;
|
|
553
|
-
initialized = true;
|
|
554
|
-
if (owner) owner.run(() => factory(nextParent, end));
|
|
555
|
-
else factory(nextParent, end);
|
|
556
|
-
},
|
|
557
|
-
unmount(nextParent) {
|
|
558
|
-
if (!initialized || parent !== nextParent) {
|
|
559
|
-
throw new Error("Vobs Fragment: Fragment \u4E0D\u5C5E\u4E8E\u6307\u5B9A\u7236\u8282\u70B9");
|
|
560
|
-
}
|
|
561
|
-
const renderer = getRenderer();
|
|
562
|
-
let current = renderer.nextSibling(start);
|
|
563
|
-
while (current && current !== end) {
|
|
564
|
-
const next = renderer.nextSibling(current);
|
|
565
|
-
renderer.removeChild(nextParent, current);
|
|
566
|
-
current = next;
|
|
567
|
-
}
|
|
568
|
-
renderer.removeChild(nextParent, start);
|
|
569
|
-
renderer.removeChild(nextParent, end);
|
|
570
|
-
parent = null;
|
|
571
|
-
initialized = false;
|
|
572
|
-
}
|
|
573
|
-
};
|
|
574
|
-
return fragment;
|
|
575
|
-
}
|
|
576
|
-
__name(createFragment, "createFragment");
|
|
577
|
-
function isVobsFragment(value) {
|
|
578
|
-
return Boolean(value) && typeof value === "object" && value.kind === "vobs-fragment";
|
|
579
|
-
}
|
|
580
|
-
__name(isVobsFragment, "isVobsFragment");
|
|
581
|
-
function moveRange(parent, start, end, anchor) {
|
|
582
|
-
const renderer = getRenderer();
|
|
583
|
-
const nodes = [start];
|
|
584
|
-
let current = renderer.nextSibling(start);
|
|
585
|
-
while (current) {
|
|
586
|
-
nodes.push(current);
|
|
587
|
-
if (current === end) break;
|
|
588
|
-
current = renderer.nextSibling(current);
|
|
589
|
-
}
|
|
590
|
-
if (nodes[nodes.length - 1] !== end) {
|
|
591
|
-
throw new Error("Vobs Fragment: \u627E\u4E0D\u5230\u7ED3\u675F\u951A\u70B9");
|
|
592
|
-
}
|
|
593
|
-
for (const node of nodes) renderer.insertBefore(parent, node, anchor);
|
|
594
|
-
}
|
|
595
|
-
__name(moveRange, "moveRange");
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
596
21
|
|
|
597
|
-
// packages/
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
if (current) removeChild(parent, current);
|
|
606
|
-
current = next;
|
|
607
|
-
if (current) insertBefore(parent, current, marker);
|
|
608
|
-
});
|
|
609
|
-
}
|
|
610
|
-
__name(insertDynamic, "insertDynamic");
|
|
22
|
+
// packages/table/src/column-settings.ts
|
|
23
|
+
var column_settings_exports = {};
|
|
24
|
+
__export(column_settings_exports, {
|
|
25
|
+
KitColumnSettings: () => KitColumnSettings
|
|
26
|
+
});
|
|
27
|
+
module.exports = __toCommonJS(column_settings_exports);
|
|
28
|
+
var import_reactivity2 = require("@vobs/reactivity");
|
|
29
|
+
var import_vobs2 = require("@vobs/vobs");
|
|
611
30
|
|
|
612
31
|
// packages/table/src/utils.ts
|
|
32
|
+
var import_reactivity = require("@vobs/reactivity");
|
|
33
|
+
var import_vobs = require("@vobs/vobs");
|
|
613
34
|
function readProp(props, name, fallback) {
|
|
614
35
|
const value = Reflect.get(props, name);
|
|
615
36
|
return value === void 0 ? fallback : value;
|
|
@@ -620,38 +41,38 @@ function hasProp(props, name) {
|
|
|
620
41
|
}
|
|
621
42
|
__name(hasProp, "hasProp");
|
|
622
43
|
function bindClassList(root, props, classes) {
|
|
623
|
-
effect(() => {
|
|
44
|
+
(0, import_reactivity.effect)(() => {
|
|
624
45
|
const userClasses = [readString(props, "class"), readString(props, "className")];
|
|
625
|
-
setAttribute(root, "class", [...classes(), ...userClasses].filter(Boolean).join(" "));
|
|
46
|
+
(0, import_vobs.setAttribute)(root, "class", [...classes(), ...userClasses].filter(Boolean).join(" "));
|
|
626
47
|
});
|
|
627
48
|
}
|
|
628
49
|
__name(bindClassList, "bindClassList");
|
|
629
50
|
function bindCommonAttributes(root, props, skip) {
|
|
630
51
|
const ignored = /* @__PURE__ */ new Set([...skip, "class", "className", "style", "children"]);
|
|
631
|
-
effect(() => {
|
|
52
|
+
(0, import_reactivity.effect)(() => {
|
|
632
53
|
for (const name of Object.keys(props)) {
|
|
633
54
|
if (ignored.has(name) || name.startsWith("on")) continue;
|
|
634
55
|
if (name !== "id" && name !== "title" && name !== "role" && name !== "tabIndex" && !name.startsWith("aria-") && !name.startsWith("data-")) continue;
|
|
635
56
|
const value = Reflect.get(props, name);
|
|
636
57
|
if (value === void 0 || value === null || value === false) removeAttribute(root, normalizeAttributeName(name));
|
|
637
|
-
else setAttribute(root, normalizeAttributeName(name), String(value));
|
|
58
|
+
else (0, import_vobs.setAttribute)(root, normalizeAttributeName(name), String(value));
|
|
638
59
|
}
|
|
639
60
|
});
|
|
640
61
|
}
|
|
641
62
|
__name(bindCommonAttributes, "bindCommonAttributes");
|
|
642
|
-
function
|
|
643
|
-
effect(() => setTextContent(node, String(read() ?? "")));
|
|
63
|
+
function bindText(node, read) {
|
|
64
|
+
(0, import_reactivity.effect)(() => (0, import_vobs.setTextContent)(node, String(read() ?? "")));
|
|
644
65
|
}
|
|
645
|
-
__name(
|
|
66
|
+
__name(bindText, "bindText");
|
|
646
67
|
function resolveSlot(value) {
|
|
647
68
|
const resolved = typeof value === "function" ? value() : value;
|
|
648
69
|
if (resolved === void 0 || resolved === null) return null;
|
|
649
|
-
if (typeof resolved === "string" || typeof resolved === "number") return createText(String(resolved));
|
|
70
|
+
if (typeof resolved === "string" || typeof resolved === "number") return (0, import_vobs.createText)(String(resolved));
|
|
650
71
|
if (Array.isArray(resolved)) {
|
|
651
|
-
return createFragment((parent, anchor) => {
|
|
72
|
+
return (0, import_vobs.createFragment)((parent, anchor) => {
|
|
652
73
|
for (const child of resolved) {
|
|
653
74
|
const node = resolveSlot(child);
|
|
654
|
-
if (node) insertBefore(parent, node, anchor);
|
|
75
|
+
if (node) (0, import_vobs.insertBefore)(parent, node, anchor);
|
|
655
76
|
}
|
|
656
77
|
});
|
|
657
78
|
}
|
|
@@ -738,16 +159,16 @@ __name(removeAttribute, "removeAttribute");
|
|
|
738
159
|
|
|
739
160
|
// packages/table/src/column-settings.ts
|
|
740
161
|
function KitColumnSettings(props = {}) {
|
|
741
|
-
const root = createElement("details");
|
|
742
|
-
const summary = createElement("summary");
|
|
743
|
-
const panel = createElement("div");
|
|
162
|
+
const root = (0, import_vobs2.createElement)("details");
|
|
163
|
+
const summary = (0, import_vobs2.createElement)("summary");
|
|
164
|
+
const panel = (0, import_vobs2.createElement)("div");
|
|
744
165
|
const columns = readColumns(props);
|
|
745
|
-
const internalSettings = state(untrack(() => initialSettings(props, columns)));
|
|
746
|
-
const panelOpen = state(false);
|
|
747
|
-
untrack(() => restoreSettings(props, columns, internalSettings));
|
|
748
|
-
effect(() => {
|
|
166
|
+
const internalSettings = (0, import_reactivity2.state)((0, import_reactivity2.untrack)(() => initialSettings(props, columns)));
|
|
167
|
+
const panelOpen = (0, import_reactivity2.state)(false);
|
|
168
|
+
(0, import_reactivity2.untrack)(() => restoreSettings(props, columns, internalSettings));
|
|
169
|
+
(0, import_reactivity2.effect)(() => {
|
|
749
170
|
currentSettings(props, internalSettings, columns);
|
|
750
|
-
if (panelOpen.value) setProperty(root, "open", true);
|
|
171
|
+
if (panelOpen.value) (0, import_vobs2.setProperty)(root, "open", true);
|
|
751
172
|
});
|
|
752
173
|
bindClassList(root, props, () => ["vobs-column-settings"]);
|
|
753
174
|
bindCommonAttributes(root, props, [
|
|
@@ -764,53 +185,53 @@ function KitColumnSettings(props = {}) {
|
|
|
764
185
|
"onReset",
|
|
765
186
|
"onPersistenceError"
|
|
766
187
|
]);
|
|
767
|
-
setAttribute(summary, "class", "vobs-column-settings__trigger");
|
|
768
|
-
setAttribute(panel, "class", "vobs-column-settings__panel");
|
|
769
|
-
setAttribute(panel, "role", "group");
|
|
770
|
-
addEventListener(summary, "click", (event) => {
|
|
188
|
+
(0, import_vobs2.setAttribute)(summary, "class", "vobs-column-settings__trigger");
|
|
189
|
+
(0, import_vobs2.setAttribute)(panel, "class", "vobs-column-settings__panel");
|
|
190
|
+
(0, import_vobs2.setAttribute)(panel, "role", "group");
|
|
191
|
+
(0, import_vobs2.addEventListener)(summary, "click", (event) => {
|
|
771
192
|
event.preventDefault();
|
|
772
193
|
panelOpen.value = !root.open;
|
|
773
|
-
setProperty(root, "open", panelOpen.value);
|
|
194
|
+
(0, import_vobs2.setProperty)(root, "open", panelOpen.value);
|
|
774
195
|
});
|
|
775
196
|
if (hasProp(props, "trigger")) {
|
|
776
|
-
insertDynamic(summary, null, () => resolveSlot(readProp(props, "trigger", void 0)));
|
|
197
|
+
(0, import_vobs2.insertDynamic)(summary, null, () => resolveSlot(readProp(props, "trigger", void 0)));
|
|
777
198
|
} else {
|
|
778
|
-
const label = createText("");
|
|
779
|
-
|
|
780
|
-
insertBefore(summary, label, null);
|
|
199
|
+
const label = (0, import_vobs2.createText)("");
|
|
200
|
+
bindText(label, () => readProp(props, "label", "Columns"));
|
|
201
|
+
(0, import_vobs2.insertBefore)(summary, label, null);
|
|
781
202
|
}
|
|
782
|
-
insertDynamic(panel, null, () => createColumnOptions(props, internalSettings, columns, root));
|
|
783
|
-
insertBefore(root, summary, null);
|
|
784
|
-
insertBefore(root, panel, null);
|
|
203
|
+
(0, import_vobs2.insertDynamic)(panel, null, () => createColumnOptions(props, internalSettings, columns, root));
|
|
204
|
+
(0, import_vobs2.insertBefore)(root, summary, null);
|
|
205
|
+
(0, import_vobs2.insertBefore)(root, panel, null);
|
|
785
206
|
return root;
|
|
786
207
|
}
|
|
787
208
|
__name(KitColumnSettings, "KitColumnSettings");
|
|
788
209
|
function createColumnOptions(props, internalSettings, columns, root) {
|
|
789
210
|
const settings = currentSettings(props, internalSettings, columns);
|
|
790
|
-
return createFragment((parent, anchor) => {
|
|
791
|
-
const reset = createElement("button");
|
|
792
|
-
const resetLabel = createText("");
|
|
793
|
-
setAttribute(reset, "type", "button");
|
|
794
|
-
setAttribute(reset, "class", "vobs-column-settings__reset");
|
|
795
|
-
|
|
796
|
-
addEventListener(reset, "click", (event) => {
|
|
211
|
+
return (0, import_vobs2.createFragment)((parent, anchor) => {
|
|
212
|
+
const reset = (0, import_vobs2.createElement)("button");
|
|
213
|
+
const resetLabel = (0, import_vobs2.createText)("");
|
|
214
|
+
(0, import_vobs2.setAttribute)(reset, "type", "button");
|
|
215
|
+
(0, import_vobs2.setAttribute)(reset, "class", "vobs-column-settings__reset");
|
|
216
|
+
bindText(resetLabel, () => readProp(props, "resetLabel", "Reset columns"));
|
|
217
|
+
(0, import_vobs2.addEventListener)(reset, "click", (event) => {
|
|
797
218
|
event.preventDefault();
|
|
798
219
|
event.stopPropagation();
|
|
799
220
|
resetSettings(props, internalSettings, columns, root);
|
|
800
221
|
});
|
|
801
|
-
insertBefore(reset, resetLabel, null);
|
|
802
|
-
insertBefore(parent, reset, anchor);
|
|
803
|
-
const visibility = createElement("div");
|
|
804
|
-
setAttribute(visibility, "class", "vobs-column-settings__visibility");
|
|
222
|
+
(0, import_vobs2.insertBefore)(reset, resetLabel, null);
|
|
223
|
+
(0, import_vobs2.insertBefore)(parent, reset, anchor);
|
|
224
|
+
const visibility = (0, import_vobs2.createElement)("div");
|
|
225
|
+
(0, import_vobs2.setAttribute)(visibility, "class", "vobs-column-settings__visibility");
|
|
805
226
|
for (const column of columns) {
|
|
806
|
-
insertBefore(visibility, createVisibilityOption(props, internalSettings, columns, column), null);
|
|
227
|
+
(0, import_vobs2.insertBefore)(visibility, createVisibilityOption(props, internalSettings, columns, column), null);
|
|
807
228
|
}
|
|
808
|
-
insertBefore(parent, visibility, anchor);
|
|
809
|
-
const layout = createElement("div");
|
|
810
|
-
setAttribute(layout, "class", "vobs-column-settings__layout");
|
|
229
|
+
(0, import_vobs2.insertBefore)(parent, visibility, anchor);
|
|
230
|
+
const layout = (0, import_vobs2.createElement)("div");
|
|
231
|
+
(0, import_vobs2.setAttribute)(layout, "class", "vobs-column-settings__layout");
|
|
811
232
|
const ordered = orderColumns(columns, settings.columnOrder);
|
|
812
233
|
for (const [index, column] of ordered.entries()) {
|
|
813
|
-
insertBefore(layout, createLayoutOption(
|
|
234
|
+
(0, import_vobs2.insertBefore)(layout, createLayoutOption(
|
|
814
235
|
props,
|
|
815
236
|
internalSettings,
|
|
816
237
|
columns,
|
|
@@ -820,20 +241,20 @@ function createColumnOptions(props, internalSettings, columns, root) {
|
|
|
820
241
|
index === ordered.length - 1
|
|
821
242
|
), null);
|
|
822
243
|
}
|
|
823
|
-
insertBefore(parent, layout, anchor);
|
|
244
|
+
(0, import_vobs2.insertBefore)(parent, layout, anchor);
|
|
824
245
|
});
|
|
825
246
|
}
|
|
826
247
|
__name(createColumnOptions, "createColumnOptions");
|
|
827
248
|
function createVisibilityOption(props, internalSettings, columns, column) {
|
|
828
|
-
const option = createElement("label");
|
|
829
|
-
const input = createElement("input");
|
|
830
|
-
const text = createText(column.label);
|
|
249
|
+
const option = (0, import_vobs2.createElement)("label");
|
|
250
|
+
const input = (0, import_vobs2.createElement)("input");
|
|
251
|
+
const text = (0, import_vobs2.createText)(column.label);
|
|
831
252
|
const settings = currentSettings(props, internalSettings, columns);
|
|
832
|
-
setAttribute(option, "class", "vobs-column-settings__option");
|
|
833
|
-
setAttribute(input, "type", "checkbox");
|
|
834
|
-
setProperty(input, "checked", settings.visibleColumnIds.includes(column.id));
|
|
835
|
-
setProperty(input, "disabled", settings.visibleColumnIds.length <= 1 && input.checked);
|
|
836
|
-
addEventListener(input, "change", () => {
|
|
253
|
+
(0, import_vobs2.setAttribute)(option, "class", "vobs-column-settings__option");
|
|
254
|
+
(0, import_vobs2.setAttribute)(input, "type", "checkbox");
|
|
255
|
+
(0, import_vobs2.setProperty)(input, "checked", settings.visibleColumnIds.includes(column.id));
|
|
256
|
+
(0, import_vobs2.setProperty)(input, "disabled", settings.visibleColumnIds.length <= 1 && input.checked);
|
|
257
|
+
(0, import_vobs2.addEventListener)(input, "change", () => {
|
|
837
258
|
const current = currentSettings(props, internalSettings, columns);
|
|
838
259
|
const visible = new Set(current.visibleColumnIds);
|
|
839
260
|
if (input.checked) visible.add(column.id);
|
|
@@ -845,36 +266,36 @@ function createVisibilityOption(props, internalSettings, columns, column) {
|
|
|
845
266
|
visibleColumnIds: nextIds
|
|
846
267
|
});
|
|
847
268
|
});
|
|
848
|
-
insertBefore(option, input, null);
|
|
849
|
-
insertBefore(option, text, null);
|
|
269
|
+
(0, import_vobs2.insertBefore)(option, input, null);
|
|
270
|
+
(0, import_vobs2.insertBefore)(option, text, null);
|
|
850
271
|
return option;
|
|
851
272
|
}
|
|
852
273
|
__name(createVisibilityOption, "createVisibilityOption");
|
|
853
274
|
function createLayoutOption(props, internalSettings, columns, column, root, isFirst, isLast) {
|
|
854
|
-
const option = createElement("div");
|
|
855
|
-
const label = createElement("span");
|
|
856
|
-
const controls = createElement("div");
|
|
275
|
+
const option = (0, import_vobs2.createElement)("div");
|
|
276
|
+
const label = (0, import_vobs2.createElement)("span");
|
|
277
|
+
const controls = (0, import_vobs2.createElement)("div");
|
|
857
278
|
const up = createMoveButton("up", column.label, isFirst);
|
|
858
279
|
const down = createMoveButton("down", column.label, isLast);
|
|
859
|
-
const width = createElement("input");
|
|
280
|
+
const width = (0, import_vobs2.createElement)("input");
|
|
860
281
|
const current = currentSettings(props, internalSettings, columns);
|
|
861
282
|
const configuredWidth = current.columnWidths[column.id] ?? column.width;
|
|
862
|
-
setAttribute(option, "class", "vobs-column-settings__layout-option");
|
|
863
|
-
setAttribute(option, "data-column-id", column.id);
|
|
864
|
-
setAttribute(label, "class", "vobs-column-settings__layout-label");
|
|
865
|
-
setProperty(label, "textContent", column.label);
|
|
866
|
-
setAttribute(controls, "class", "vobs-column-settings__layout-controls");
|
|
867
|
-
setAttribute(width, "type", "text");
|
|
868
|
-
setAttribute(width, "class", "vobs-column-settings__width");
|
|
869
|
-
setAttribute(width, "placeholder", "auto");
|
|
870
|
-
setAttribute(width, "aria-label", `${column.label} width`);
|
|
871
|
-
setProperty(width, "value", displayWidth(configuredWidth));
|
|
872
|
-
addEventListener(up, "click", (event) => {
|
|
283
|
+
(0, import_vobs2.setAttribute)(option, "class", "vobs-column-settings__layout-option");
|
|
284
|
+
(0, import_vobs2.setAttribute)(option, "data-column-id", column.id);
|
|
285
|
+
(0, import_vobs2.setAttribute)(label, "class", "vobs-column-settings__layout-label");
|
|
286
|
+
(0, import_vobs2.setProperty)(label, "textContent", column.label);
|
|
287
|
+
(0, import_vobs2.setAttribute)(controls, "class", "vobs-column-settings__layout-controls");
|
|
288
|
+
(0, import_vobs2.setAttribute)(width, "type", "text");
|
|
289
|
+
(0, import_vobs2.setAttribute)(width, "class", "vobs-column-settings__width");
|
|
290
|
+
(0, import_vobs2.setAttribute)(width, "placeholder", "auto");
|
|
291
|
+
(0, import_vobs2.setAttribute)(width, "aria-label", `${column.label} width`);
|
|
292
|
+
(0, import_vobs2.setProperty)(width, "value", displayWidth(configuredWidth));
|
|
293
|
+
(0, import_vobs2.addEventListener)(up, "click", (event) => {
|
|
873
294
|
event.preventDefault();
|
|
874
295
|
event.stopPropagation();
|
|
875
296
|
moveColumn(props, internalSettings, columns, column.id, -1, root);
|
|
876
297
|
});
|
|
877
|
-
addEventListener(down, "click", (event) => {
|
|
298
|
+
(0, import_vobs2.addEventListener)(down, "click", (event) => {
|
|
878
299
|
event.preventDefault();
|
|
879
300
|
event.stopPropagation();
|
|
880
301
|
moveColumn(props, internalSettings, columns, column.id, 1, root);
|
|
@@ -896,29 +317,29 @@ function createLayoutOption(props, internalSettings, columns, column, root, isFi
|
|
|
896
317
|
columnWidths: nextWidths
|
|
897
318
|
});
|
|
898
319
|
}, "commitWidth");
|
|
899
|
-
addEventListener(width, "change", commitWidth);
|
|
900
|
-
addEventListener(width, "blur", commitWidth);
|
|
901
|
-
addEventListener(width, "keydown", (event) => {
|
|
320
|
+
(0, import_vobs2.addEventListener)(width, "change", commitWidth);
|
|
321
|
+
(0, import_vobs2.addEventListener)(width, "blur", commitWidth);
|
|
322
|
+
(0, import_vobs2.addEventListener)(width, "keydown", (event) => {
|
|
902
323
|
if (event.key !== "Enter") return;
|
|
903
324
|
event.preventDefault();
|
|
904
325
|
commitWidth();
|
|
905
326
|
});
|
|
906
|
-
insertBefore(controls, up, null);
|
|
907
|
-
insertBefore(controls, down, null);
|
|
908
|
-
insertBefore(controls, width, null);
|
|
909
|
-
insertBefore(option, label, null);
|
|
910
|
-
insertBefore(option, controls, null);
|
|
327
|
+
(0, import_vobs2.insertBefore)(controls, up, null);
|
|
328
|
+
(0, import_vobs2.insertBefore)(controls, down, null);
|
|
329
|
+
(0, import_vobs2.insertBefore)(controls, width, null);
|
|
330
|
+
(0, import_vobs2.insertBefore)(option, label, null);
|
|
331
|
+
(0, import_vobs2.insertBefore)(option, controls, null);
|
|
911
332
|
return option;
|
|
912
333
|
}
|
|
913
334
|
__name(createLayoutOption, "createLayoutOption");
|
|
914
335
|
function createMoveButton(direction, columnLabel, disabled) {
|
|
915
|
-
const button = createElement("button");
|
|
916
|
-
setAttribute(button, "type", "button");
|
|
917
|
-
setAttribute(button, "class", `vobs-column-settings__move vobs-column-settings__move--${direction}`);
|
|
918
|
-
setAttribute(button, "aria-label", `Move ${columnLabel} ${direction}`);
|
|
919
|
-
setAttribute(button, "title", `Move ${columnLabel} ${direction}`);
|
|
920
|
-
setProperty(button, "disabled", disabled);
|
|
921
|
-
insertBefore(button, createText(direction === "up" ? "\u2191" : "\u2193"), null);
|
|
336
|
+
const button = (0, import_vobs2.createElement)("button");
|
|
337
|
+
(0, import_vobs2.setAttribute)(button, "type", "button");
|
|
338
|
+
(0, import_vobs2.setAttribute)(button, "class", `vobs-column-settings__move vobs-column-settings__move--${direction}`);
|
|
339
|
+
(0, import_vobs2.setAttribute)(button, "aria-label", `Move ${columnLabel} ${direction}`);
|
|
340
|
+
(0, import_vobs2.setAttribute)(button, "title", `Move ${columnLabel} ${direction}`);
|
|
341
|
+
(0, import_vobs2.setProperty)(button, "disabled", disabled);
|
|
342
|
+
(0, import_vobs2.insertBefore)(button, (0, import_vobs2.createText)(direction === "up" ? "\u2191" : "\u2193"), null);
|
|
922
343
|
return button;
|
|
923
344
|
}
|
|
924
345
|
__name(createMoveButton, "createMoveButton");
|
|
@@ -1026,11 +447,12 @@ function reportPersistenceError(props, error) {
|
|
|
1026
447
|
__name(reportPersistenceError, "reportPersistenceError");
|
|
1027
448
|
function reopenPanel(root) {
|
|
1028
449
|
setTimeout(() => {
|
|
1029
|
-
setProperty(root, "open", true);
|
|
450
|
+
(0, import_vobs2.setProperty)(root, "open", true);
|
|
1030
451
|
}, 0);
|
|
1031
452
|
}
|
|
1032
453
|
__name(reopenPanel, "reopenPanel");
|
|
1033
|
-
|
|
1034
|
-
exports
|
|
1035
|
-
|
|
454
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
455
|
+
0 && (module.exports = {
|
|
456
|
+
KitColumnSettings
|
|
457
|
+
});
|
|
1036
458
|
//# sourceMappingURL=column-settings.cjs.map
|