@hairy/vue-lib 1.47.0 → 1.49.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.
@@ -1,1258 +0,0 @@
1
- "use strict";
2
- (() => {
3
- var __create = Object.create;
4
- var __defProp = Object.defineProperty;
5
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
- var __getOwnPropNames = Object.getOwnPropertyNames;
7
- var __getProtoOf = Object.getPrototypeOf;
8
- var __hasOwnProp = Object.prototype.hasOwnProperty;
9
- var __commonJS = (cb, mod) => function __require() {
10
- return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
11
- };
12
- var __export = (target, all) => {
13
- for (var name in all)
14
- __defProp(target, name, { get: all[name], enumerable: true });
15
- };
16
- var __copyProps = (to, from, except, desc) => {
17
- if (from && typeof from === "object" || typeof from === "function") {
18
- for (let key of __getOwnPropNames(from))
19
- if (!__hasOwnProp.call(to, key) && key !== except)
20
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
21
- }
22
- return to;
23
- };
24
- var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
25
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
26
- // If the importer is in node compatibility mode or this is not an ESM
27
- // file that has been converted to a CommonJS file using a Babel-
28
- // compatible transform (i.e. "__esModule" has not been set), then set
29
- // "default" to the CommonJS "module.exports" for node compatibility.
30
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
31
- mod
32
- ));
33
-
34
- // globals:vue
35
- var require_vue = __commonJS({
36
- "globals:vue"(exports, module) {
37
- "use strict";
38
- module.exports = Vue;
39
- }
40
- });
41
-
42
- // globals:@vueuse/core
43
- var require_core = __commonJS({
44
- "globals:@vueuse/core"(exports, module) {
45
- "use strict";
46
- module.exports = VueUse;
47
- }
48
- });
49
-
50
- // ../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/isObject.js
51
- var require_isObject = __commonJS({
52
- "../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/isObject.js"(exports, module) {
53
- "use strict";
54
- function isObject(value) {
55
- var type = typeof value;
56
- return value != null && (type == "object" || type == "function");
57
- }
58
- module.exports = isObject;
59
- }
60
- });
61
-
62
- // ../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_freeGlobal.js
63
- var require_freeGlobal = __commonJS({
64
- "../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_freeGlobal.js"(exports, module) {
65
- "use strict";
66
- var freeGlobal2 = typeof global == "object" && global && global.Object === Object && global;
67
- module.exports = freeGlobal2;
68
- }
69
- });
70
-
71
- // ../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_root.js
72
- var require_root = __commonJS({
73
- "../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_root.js"(exports, module) {
74
- "use strict";
75
- var freeGlobal2 = require_freeGlobal();
76
- var freeSelf2 = typeof self == "object" && self && self.Object === Object && self;
77
- var root2 = freeGlobal2 || freeSelf2 || Function("return this")();
78
- module.exports = root2;
79
- }
80
- });
81
-
82
- // ../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/now.js
83
- var require_now = __commonJS({
84
- "../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/now.js"(exports, module) {
85
- "use strict";
86
- var root2 = require_root();
87
- var now = function() {
88
- return root2.Date.now();
89
- };
90
- module.exports = now;
91
- }
92
- });
93
-
94
- // ../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_trimmedEndIndex.js
95
- var require_trimmedEndIndex = __commonJS({
96
- "../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_trimmedEndIndex.js"(exports, module) {
97
- "use strict";
98
- var reWhitespace = /\s/;
99
- function trimmedEndIndex(string) {
100
- var index = string.length;
101
- while (index-- && reWhitespace.test(string.charAt(index))) {
102
- }
103
- return index;
104
- }
105
- module.exports = trimmedEndIndex;
106
- }
107
- });
108
-
109
- // ../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_baseTrim.js
110
- var require_baseTrim = __commonJS({
111
- "../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_baseTrim.js"(exports, module) {
112
- "use strict";
113
- var trimmedEndIndex = require_trimmedEndIndex();
114
- var reTrimStart = /^\s+/;
115
- function baseTrim(string) {
116
- return string ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, "") : string;
117
- }
118
- module.exports = baseTrim;
119
- }
120
- });
121
-
122
- // ../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_Symbol.js
123
- var require_Symbol = __commonJS({
124
- "../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_Symbol.js"(exports, module) {
125
- "use strict";
126
- var root2 = require_root();
127
- var Symbol3 = root2.Symbol;
128
- module.exports = Symbol3;
129
- }
130
- });
131
-
132
- // ../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_getRawTag.js
133
- var require_getRawTag = __commonJS({
134
- "../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_getRawTag.js"(exports, module) {
135
- "use strict";
136
- var Symbol3 = require_Symbol();
137
- var objectProto3 = Object.prototype;
138
- var hasOwnProperty2 = objectProto3.hasOwnProperty;
139
- var nativeObjectToString3 = objectProto3.toString;
140
- var symToStringTag3 = Symbol3 ? Symbol3.toStringTag : void 0;
141
- function getRawTag2(value) {
142
- var isOwn = hasOwnProperty2.call(value, symToStringTag3), tag = value[symToStringTag3];
143
- try {
144
- value[symToStringTag3] = void 0;
145
- var unmasked = true;
146
- } catch (e) {
147
- }
148
- var result = nativeObjectToString3.call(value);
149
- if (unmasked) {
150
- if (isOwn) {
151
- value[symToStringTag3] = tag;
152
- } else {
153
- delete value[symToStringTag3];
154
- }
155
- }
156
- return result;
157
- }
158
- module.exports = getRawTag2;
159
- }
160
- });
161
-
162
- // ../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_objectToString.js
163
- var require_objectToString = __commonJS({
164
- "../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_objectToString.js"(exports, module) {
165
- "use strict";
166
- var objectProto3 = Object.prototype;
167
- var nativeObjectToString3 = objectProto3.toString;
168
- function objectToString2(value) {
169
- return nativeObjectToString3.call(value);
170
- }
171
- module.exports = objectToString2;
172
- }
173
- });
174
-
175
- // ../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_baseGetTag.js
176
- var require_baseGetTag = __commonJS({
177
- "../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_baseGetTag.js"(exports, module) {
178
- "use strict";
179
- var Symbol3 = require_Symbol();
180
- var getRawTag2 = require_getRawTag();
181
- var objectToString2 = require_objectToString();
182
- var nullTag2 = "[object Null]";
183
- var undefinedTag2 = "[object Undefined]";
184
- var symToStringTag3 = Symbol3 ? Symbol3.toStringTag : void 0;
185
- function baseGetTag2(value) {
186
- if (value == null) {
187
- return value === void 0 ? undefinedTag2 : nullTag2;
188
- }
189
- return symToStringTag3 && symToStringTag3 in Object(value) ? getRawTag2(value) : objectToString2(value);
190
- }
191
- module.exports = baseGetTag2;
192
- }
193
- });
194
-
195
- // ../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/isObjectLike.js
196
- var require_isObjectLike = __commonJS({
197
- "../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/isObjectLike.js"(exports, module) {
198
- "use strict";
199
- function isObjectLike2(value) {
200
- return value != null && typeof value == "object";
201
- }
202
- module.exports = isObjectLike2;
203
- }
204
- });
205
-
206
- // ../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/isSymbol.js
207
- var require_isSymbol = __commonJS({
208
- "../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/isSymbol.js"(exports, module) {
209
- "use strict";
210
- var baseGetTag2 = require_baseGetTag();
211
- var isObjectLike2 = require_isObjectLike();
212
- var symbolTag = "[object Symbol]";
213
- function isSymbol(value) {
214
- return typeof value == "symbol" || isObjectLike2(value) && baseGetTag2(value) == symbolTag;
215
- }
216
- module.exports = isSymbol;
217
- }
218
- });
219
-
220
- // ../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/toNumber.js
221
- var require_toNumber = __commonJS({
222
- "../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/toNumber.js"(exports, module) {
223
- "use strict";
224
- var baseTrim = require_baseTrim();
225
- var isObject = require_isObject();
226
- var isSymbol = require_isSymbol();
227
- var NAN = 0 / 0;
228
- var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
229
- var reIsBinary = /^0b[01]+$/i;
230
- var reIsOctal = /^0o[0-7]+$/i;
231
- var freeParseInt = parseInt;
232
- function toNumber(value) {
233
- if (typeof value == "number") {
234
- return value;
235
- }
236
- if (isSymbol(value)) {
237
- return NAN;
238
- }
239
- if (isObject(value)) {
240
- var other = typeof value.valueOf == "function" ? value.valueOf() : value;
241
- value = isObject(other) ? other + "" : other;
242
- }
243
- if (typeof value != "string") {
244
- return value === 0 ? value : +value;
245
- }
246
- value = baseTrim(value);
247
- var isBinary = reIsBinary.test(value);
248
- return isBinary || reIsOctal.test(value) ? freeParseInt(value.slice(2), isBinary ? 2 : 8) : reIsBadHex.test(value) ? NAN : +value;
249
- }
250
- module.exports = toNumber;
251
- }
252
- });
253
-
254
- // ../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/debounce.js
255
- var require_debounce = __commonJS({
256
- "../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/debounce.js"(exports, module) {
257
- "use strict";
258
- var isObject = require_isObject();
259
- var now = require_now();
260
- var toNumber = require_toNumber();
261
- var FUNC_ERROR_TEXT = "Expected a function";
262
- var nativeMax = Math.max;
263
- var nativeMin = Math.min;
264
- function debounce3(func, wait, options) {
265
- var lastArgs, lastThis, maxWait, result, timerId, lastCallTime, lastInvokeTime = 0, leading = false, maxing = false, trailing = true;
266
- if (typeof func != "function") {
267
- throw new TypeError(FUNC_ERROR_TEXT);
268
- }
269
- wait = toNumber(wait) || 0;
270
- if (isObject(options)) {
271
- leading = !!options.leading;
272
- maxing = "maxWait" in options;
273
- maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;
274
- trailing = "trailing" in options ? !!options.trailing : trailing;
275
- }
276
- function invokeFunc(time) {
277
- var args = lastArgs, thisArg = lastThis;
278
- lastArgs = lastThis = void 0;
279
- lastInvokeTime = time;
280
- result = func.apply(thisArg, args);
281
- return result;
282
- }
283
- function leadingEdge(time) {
284
- lastInvokeTime = time;
285
- timerId = setTimeout(timerExpired, wait);
286
- return leading ? invokeFunc(time) : result;
287
- }
288
- function remainingWait(time) {
289
- var timeSinceLastCall = time - lastCallTime, timeSinceLastInvoke = time - lastInvokeTime, timeWaiting = wait - timeSinceLastCall;
290
- return maxing ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke) : timeWaiting;
291
- }
292
- function shouldInvoke(time) {
293
- var timeSinceLastCall = time - lastCallTime, timeSinceLastInvoke = time - lastInvokeTime;
294
- return lastCallTime === void 0 || timeSinceLastCall >= wait || timeSinceLastCall < 0 || maxing && timeSinceLastInvoke >= maxWait;
295
- }
296
- function timerExpired() {
297
- var time = now();
298
- if (shouldInvoke(time)) {
299
- return trailingEdge(time);
300
- }
301
- timerId = setTimeout(timerExpired, remainingWait(time));
302
- }
303
- function trailingEdge(time) {
304
- timerId = void 0;
305
- if (trailing && lastArgs) {
306
- return invokeFunc(time);
307
- }
308
- lastArgs = lastThis = void 0;
309
- return result;
310
- }
311
- function cancel() {
312
- if (timerId !== void 0) {
313
- clearTimeout(timerId);
314
- }
315
- lastInvokeTime = 0;
316
- lastArgs = lastCallTime = lastThis = timerId = void 0;
317
- }
318
- function flush() {
319
- return timerId === void 0 ? result : trailingEdge(now());
320
- }
321
- function debounced() {
322
- var time = now(), isInvoking = shouldInvoke(time);
323
- lastArgs = arguments;
324
- lastThis = this;
325
- lastCallTime = time;
326
- if (isInvoking) {
327
- if (timerId === void 0) {
328
- return leadingEdge(lastCallTime);
329
- }
330
- if (maxing) {
331
- clearTimeout(timerId);
332
- timerId = setTimeout(timerExpired, wait);
333
- return invokeFunc(lastCallTime);
334
- }
335
- }
336
- if (timerId === void 0) {
337
- timerId = setTimeout(timerExpired, wait);
338
- }
339
- return result;
340
- }
341
- debounced.cancel = cancel;
342
- debounced.flush = flush;
343
- return debounced;
344
- }
345
- module.exports = debounce3;
346
- }
347
- });
348
-
349
- // ../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/throttle.js
350
- var require_throttle = __commonJS({
351
- "../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/throttle.js"(exports, module) {
352
- "use strict";
353
- var debounce3 = require_debounce();
354
- var isObject = require_isObject();
355
- var FUNC_ERROR_TEXT = "Expected a function";
356
- function throttle2(func, wait, options) {
357
- var leading = true, trailing = true;
358
- if (typeof func != "function") {
359
- throw new TypeError(FUNC_ERROR_TEXT);
360
- }
361
- if (isObject(options)) {
362
- leading = "leading" in options ? !!options.leading : leading;
363
- trailing = "trailing" in options ? !!options.trailing : trailing;
364
- }
365
- return debounce3(func, wait, {
366
- "leading": leading,
367
- "maxWait": wait,
368
- "trailing": trailing
369
- });
370
- }
371
- module.exports = throttle2;
372
- }
373
- });
374
-
375
- // ../../node_modules/.pnpm/vue-demi@0.14.10_@vue+compo_218aa61227e07b729d509d8ec156bb9f/node_modules/vue-demi/lib/index.mjs
376
- var lib_exports = {};
377
- __export(lib_exports, {
378
- Vue: () => Vue2,
379
- Vue2: () => Vue22,
380
- del: () => del,
381
- install: () => install,
382
- isVue2: () => isVue2,
383
- isVue3: () => isVue3,
384
- set: () => set
385
- });
386
- var Vue2 = __toESM(require_vue(), 1);
387
- __reExport(lib_exports, __toESM(require_vue(), 1));
388
- var isVue2 = false;
389
- var isVue3 = true;
390
- var Vue22 = void 0;
391
- function install() {
392
- }
393
- function set(target, key, val) {
394
- if (Array.isArray(target)) {
395
- target.length = Math.max(target.length, key);
396
- target.splice(key, 1, val);
397
- return val;
398
- }
399
- target[key] = val;
400
- return val;
401
- }
402
- function del(target, key) {
403
- if (Array.isArray(target)) {
404
- target.splice(key, 1);
405
- return;
406
- }
407
- delete target[key];
408
- }
409
-
410
- // src/components/c-field.ts
411
- var Field = (0, lib_exports.defineComponent)({
412
- name: "Field",
413
- props: {
414
- is: {
415
- type: [String, Number, Object],
416
- default: ""
417
- }
418
- },
419
- setup(props) {
420
- return () => {
421
- if (typeof props.is === "string" || typeof props.is === "number")
422
- return props.is;
423
- return props.is ? (0, lib_exports.h)(props.is) : null;
424
- };
425
- }
426
- });
427
-
428
- // ../../node_modules/.pnpm/css-render@0.15.14/node_modules/css-render/esm/parse.js
429
- function ampCount(selector) {
430
- let cnt = 0;
431
- for (let i = 0; i < selector.length; ++i) {
432
- if (selector[i] === "&")
433
- ++cnt;
434
- }
435
- return cnt;
436
- }
437
- var separatorRegex = /\s*,(?![^(]*\))\s*/g;
438
- var extraSpaceRegex = /\s+/g;
439
- function resolveSelectorWithAmp(amp, selector) {
440
- const nextAmp = [];
441
- selector.split(separatorRegex).forEach((partialSelector) => {
442
- let round = ampCount(partialSelector);
443
- if (!round) {
444
- amp.forEach((partialAmp) => {
445
- nextAmp.push(
446
- // eslint-disable-next-line @typescript-eslint/strict-boolean-expressions
447
- (partialAmp && partialAmp + " ") + partialSelector
448
- );
449
- });
450
- return;
451
- } else if (round === 1) {
452
- amp.forEach((partialAmp) => {
453
- nextAmp.push(partialSelector.replace("&", partialAmp));
454
- });
455
- return;
456
- }
457
- let partialNextAmp = [
458
- partialSelector
459
- ];
460
- while (round--) {
461
- const nextPartialNextAmp = [];
462
- partialNextAmp.forEach((selectorItr) => {
463
- amp.forEach((partialAmp) => {
464
- nextPartialNextAmp.push(selectorItr.replace("&", partialAmp));
465
- });
466
- });
467
- partialNextAmp = nextPartialNextAmp;
468
- }
469
- partialNextAmp.forEach((part) => nextAmp.push(part));
470
- });
471
- return nextAmp;
472
- }
473
- function resolveSelector(amp, selector) {
474
- const nextAmp = [];
475
- selector.split(separatorRegex).forEach((partialSelector) => {
476
- amp.forEach((partialAmp) => {
477
- nextAmp.push((partialAmp && partialAmp + " ") + partialSelector);
478
- });
479
- });
480
- return nextAmp;
481
- }
482
- function parseSelectorPath(selectorPaths) {
483
- let amp = [""];
484
- selectorPaths.forEach((selector) => {
485
- selector = selector && selector.trim();
486
- if (
487
- // eslint-disable-next-line @typescript-eslint/strict-boolean-expressions
488
- !selector
489
- ) {
490
- return;
491
- }
492
- if (selector.includes("&")) {
493
- amp = resolveSelectorWithAmp(amp, selector);
494
- } else {
495
- amp = resolveSelector(amp, selector);
496
- }
497
- });
498
- return amp.join(", ").replace(extraSpaceRegex, " ");
499
- }
500
-
501
- // ../../node_modules/.pnpm/css-render@0.15.14/node_modules/css-render/esm/utils.js
502
- function removeElement(el) {
503
- if (!el)
504
- return;
505
- const parentElement = el.parentElement;
506
- if (parentElement)
507
- parentElement.removeChild(el);
508
- }
509
- function queryElement(id, parent) {
510
- return (parent !== null && parent !== void 0 ? parent : document.head).querySelector(`style[cssr-id="${id}"]`);
511
- }
512
- function createElement(id) {
513
- const el = document.createElement("style");
514
- el.setAttribute("cssr-id", id);
515
- return el;
516
- }
517
- function isMediaOrSupports(selector) {
518
- if (!selector)
519
- return false;
520
- return /^\s*@(s|m)/.test(selector);
521
- }
522
-
523
- // ../../node_modules/.pnpm/css-render@0.15.14/node_modules/css-render/esm/render.js
524
- var kebabRegex = /[A-Z]/g;
525
- function kebabCase(pattern) {
526
- return pattern.replace(kebabRegex, (match) => "-" + match.toLowerCase());
527
- }
528
- function unwrapProperty(prop, indent = " ") {
529
- if (typeof prop === "object" && prop !== null) {
530
- return " {\n" + Object.entries(prop).map((v) => {
531
- return indent + ` ${kebabCase(v[0])}: ${v[1]};`;
532
- }).join("\n") + "\n" + indent + "}";
533
- }
534
- return `: ${prop};`;
535
- }
536
- function unwrapProperties(props, instance, params) {
537
- if (typeof props === "function") {
538
- return props({
539
- context: instance.context,
540
- props: params
541
- });
542
- }
543
- return props;
544
- }
545
- function createStyle(selector, props, instance, params) {
546
- if (!props)
547
- return "";
548
- const unwrappedProps = unwrapProperties(props, instance, params);
549
- if (!unwrappedProps)
550
- return "";
551
- if (typeof unwrappedProps === "string") {
552
- return `${selector} {
553
- ${unwrappedProps}
554
- }`;
555
- }
556
- const propertyNames = Object.keys(unwrappedProps);
557
- if (propertyNames.length === 0) {
558
- if (instance.config.keepEmptyBlock)
559
- return selector + " {\n}";
560
- return "";
561
- }
562
- const statements = selector ? [
563
- selector + " {"
564
- ] : [];
565
- propertyNames.forEach((propertyName) => {
566
- const property = unwrappedProps[propertyName];
567
- if (propertyName === "raw") {
568
- statements.push("\n" + property + "\n");
569
- return;
570
- }
571
- propertyName = kebabCase(propertyName);
572
- if (property !== null && property !== void 0) {
573
- statements.push(` ${propertyName}${unwrapProperty(property)}`);
574
- }
575
- });
576
- if (selector) {
577
- statements.push("}");
578
- }
579
- return statements.join("\n");
580
- }
581
- function loopCNodeListWithCallback(children, options, callback) {
582
- if (!children)
583
- return;
584
- children.forEach((child) => {
585
- if (Array.isArray(child)) {
586
- loopCNodeListWithCallback(child, options, callback);
587
- } else if (typeof child === "function") {
588
- const grandChildren = child(options);
589
- if (Array.isArray(grandChildren)) {
590
- loopCNodeListWithCallback(grandChildren, options, callback);
591
- } else if (grandChildren) {
592
- callback(grandChildren);
593
- }
594
- } else if (child) {
595
- callback(child);
596
- }
597
- });
598
- }
599
- function traverseCNode(node, selectorPaths, styles, instance, params) {
600
- const $ = node.$;
601
- let blockSelector = "";
602
- if (!$ || typeof $ === "string") {
603
- if (isMediaOrSupports($)) {
604
- blockSelector = $;
605
- } else {
606
- selectorPaths.push($);
607
- }
608
- } else if (typeof $ === "function") {
609
- const selector2 = $({
610
- context: instance.context,
611
- props: params
612
- });
613
- if (isMediaOrSupports(selector2)) {
614
- blockSelector = selector2;
615
- } else {
616
- selectorPaths.push(selector2);
617
- }
618
- } else {
619
- if ($.before)
620
- $.before(instance.context);
621
- if (!$.$ || typeof $.$ === "string") {
622
- if (isMediaOrSupports($.$)) {
623
- blockSelector = $.$;
624
- } else {
625
- selectorPaths.push($.$);
626
- }
627
- } else if ($.$) {
628
- const selector2 = $.$({
629
- context: instance.context,
630
- props: params
631
- });
632
- if (isMediaOrSupports(selector2)) {
633
- blockSelector = selector2;
634
- } else {
635
- selectorPaths.push(selector2);
636
- }
637
- }
638
- }
639
- const selector = parseSelectorPath(selectorPaths);
640
- const style2 = createStyle(selector, node.props, instance, params);
641
- if (blockSelector) {
642
- styles.push(`${blockSelector} {`);
643
- } else if (style2.length) {
644
- styles.push(style2);
645
- }
646
- if (node.children) {
647
- loopCNodeListWithCallback(node.children, {
648
- context: instance.context,
649
- props: params
650
- }, (childNode) => {
651
- if (typeof childNode === "string") {
652
- const style3 = createStyle(selector, { raw: childNode }, instance, params);
653
- styles.push(style3);
654
- } else {
655
- traverseCNode(childNode, selectorPaths, styles, instance, params);
656
- }
657
- });
658
- }
659
- selectorPaths.pop();
660
- if (blockSelector) {
661
- styles.push("}");
662
- }
663
- if ($ && $.after)
664
- $.after(instance.context);
665
- }
666
- function render(node, instance, props) {
667
- const styles = [];
668
- traverseCNode(node, [], styles, instance, props);
669
- return styles.join("\n\n");
670
- }
671
-
672
- // ../../node_modules/.pnpm/@emotion+hash@0.8.0/node_modules/@emotion/hash/dist/hash.esm.js
673
- function murmur2(str) {
674
- var h4 = 0;
675
- var k, i = 0, len = str.length;
676
- for (; len >= 4; ++i, len -= 4) {
677
- k = str.charCodeAt(i) & 255 | (str.charCodeAt(++i) & 255) << 8 | (str.charCodeAt(++i) & 255) << 16 | (str.charCodeAt(++i) & 255) << 24;
678
- k = /* Math.imul(k, m): */
679
- (k & 65535) * 1540483477 + ((k >>> 16) * 59797 << 16);
680
- k ^= /* k >>> r: */
681
- k >>> 24;
682
- h4 = /* Math.imul(k, m): */
683
- (k & 65535) * 1540483477 + ((k >>> 16) * 59797 << 16) ^ /* Math.imul(h, m): */
684
- (h4 & 65535) * 1540483477 + ((h4 >>> 16) * 59797 << 16);
685
- }
686
- switch (len) {
687
- case 3:
688
- h4 ^= (str.charCodeAt(i + 2) & 255) << 16;
689
- case 2:
690
- h4 ^= (str.charCodeAt(i + 1) & 255) << 8;
691
- case 1:
692
- h4 ^= str.charCodeAt(i) & 255;
693
- h4 = /* Math.imul(h, m): */
694
- (h4 & 65535) * 1540483477 + ((h4 >>> 16) * 59797 << 16);
695
- }
696
- h4 ^= h4 >>> 13;
697
- h4 = /* Math.imul(h, m): */
698
- (h4 & 65535) * 1540483477 + ((h4 >>> 16) * 59797 << 16);
699
- return ((h4 ^ h4 >>> 15) >>> 0).toString(36);
700
- }
701
- var hash_esm_default = murmur2;
702
-
703
- // ../../node_modules/.pnpm/css-render@0.15.14/node_modules/css-render/esm/mount.js
704
- if (typeof window !== "undefined") {
705
- window.__cssrContext = {};
706
- }
707
- function unmount(instance, node, id, parent) {
708
- const { els } = node;
709
- if (id === void 0) {
710
- els.forEach(removeElement);
711
- node.els = [];
712
- } else {
713
- const target = queryElement(id, parent);
714
- if (target && els.includes(target)) {
715
- removeElement(target);
716
- node.els = els.filter((el) => el !== target);
717
- }
718
- }
719
- }
720
- function addElementToList(els, target) {
721
- els.push(target);
722
- }
723
- function mount(instance, node, id, props, head, force, anchorMetaName, parent, ssrAdapter) {
724
- let style2;
725
- if (id === void 0) {
726
- style2 = node.render(props);
727
- id = hash_esm_default(style2);
728
- }
729
- if (ssrAdapter) {
730
- ssrAdapter.adapter(id, style2 !== null && style2 !== void 0 ? style2 : node.render(props));
731
- return;
732
- }
733
- if (parent === void 0) {
734
- parent = document.head;
735
- }
736
- const queriedTarget = queryElement(id, parent);
737
- if (queriedTarget !== null && !force) {
738
- return queriedTarget;
739
- }
740
- const target = queriedTarget !== null && queriedTarget !== void 0 ? queriedTarget : createElement(id);
741
- if (style2 === void 0)
742
- style2 = node.render(props);
743
- target.textContent = style2;
744
- if (queriedTarget !== null)
745
- return queriedTarget;
746
- if (anchorMetaName) {
747
- const anchorMetaEl = parent.querySelector(`meta[name="${anchorMetaName}"]`);
748
- if (anchorMetaEl) {
749
- parent.insertBefore(target, anchorMetaEl);
750
- addElementToList(node.els, target);
751
- return target;
752
- }
753
- }
754
- if (head) {
755
- parent.insertBefore(target, parent.querySelector("style, link"));
756
- } else {
757
- parent.appendChild(target);
758
- }
759
- addElementToList(node.els, target);
760
- return target;
761
- }
762
-
763
- // ../../node_modules/.pnpm/css-render@0.15.14/node_modules/css-render/esm/c.js
764
- function wrappedRender(props) {
765
- return render(this, this.instance, props);
766
- }
767
- function wrappedMount(options = {}) {
768
- const { id, ssr, props, head = false, force = false, anchorMetaName, parent } = options;
769
- const targetElement = mount(this.instance, this, id, props, head, force, anchorMetaName, parent, ssr);
770
- return targetElement;
771
- }
772
- function wrappedUnmount(options = {}) {
773
- const { id, parent } = options;
774
- unmount(this.instance, this, id, parent);
775
- }
776
- var createCNode = function(instance, $, props, children) {
777
- return {
778
- instance,
779
- $,
780
- props,
781
- children,
782
- els: [],
783
- render: wrappedRender,
784
- mount: wrappedMount,
785
- unmount: wrappedUnmount
786
- };
787
- };
788
- var c = function(instance, $, props, children) {
789
- if (Array.isArray($)) {
790
- return createCNode(instance, { $: null }, null, $);
791
- } else if (Array.isArray(props)) {
792
- return createCNode(instance, $, null, props);
793
- } else if (Array.isArray(children)) {
794
- return createCNode(instance, $, props, children);
795
- } else {
796
- return createCNode(instance, $, props, null);
797
- }
798
- };
799
-
800
- // ../../node_modules/.pnpm/css-render@0.15.14/node_modules/css-render/esm/CssRender.js
801
- function CssRender(config = {}) {
802
- const cssr = {
803
- c: (...args) => c(cssr, ...args),
804
- use: (plugin, ...args) => plugin.install(cssr, ...args),
805
- find: queryElement,
806
- context: {},
807
- config
808
- };
809
- return cssr;
810
- }
811
-
812
- // ../../node_modules/.pnpm/css-render@0.15.14/node_modules/css-render/esm/index.js
813
- var esm_default = CssRender;
814
-
815
- // src/components/collapse-transition.ts
816
- var { c: c2 } = esm_default();
817
- var CollapseTransition = (0, lib_exports.defineComponent)({
818
- name: "CollapseTransition",
819
- setup(_, { slots }) {
820
- const on = {
821
- onBeforeEnter(el) {
822
- el.classList.add("collapse-transition");
823
- if (!el.dataset)
824
- el.dataset = {};
825
- el.dataset.oldPaddingTop = el.style.paddingTop;
826
- el.dataset.oldPaddingBottom = el.style.paddingBottom;
827
- el.style.height = "0";
828
- el.style.paddingTop = "0";
829
- el.style.paddingBottom = "0";
830
- },
831
- onEnter(el) {
832
- el.dataset.oldOverflow = el.style.overflow;
833
- if (el.scrollHeight !== 0) {
834
- el.style.height = `${el.scrollHeight}px`;
835
- el.style.paddingTop = el.dataset.oldPaddingTop || "0";
836
- el.style.paddingBottom = el.dataset.oldPaddingBottom || "0";
837
- } else {
838
- el.style.height = "";
839
- el.style.paddingTop = el.dataset.oldPaddingTop || "0";
840
- el.style.paddingBottom = el.dataset.oldPaddingBottom || "0";
841
- }
842
- el.style.overflow = "hidden";
843
- },
844
- onAfterEnter(el) {
845
- el.classList.remove("collapse-transition");
846
- el.style.height = "";
847
- el.style.overflow = el.dataset.oldOverflow || "0";
848
- },
849
- onBeforeLeave(el) {
850
- if (!el.dataset)
851
- el.dataset = {};
852
- el.dataset.oldPaddingTop = el.style.paddingTop;
853
- el.dataset.oldPaddingBottom = el.style.paddingBottom;
854
- el.dataset.oldOverflow = el.style.overflow;
855
- el.style.height = `${el.scrollHeight}px`;
856
- el.style.overflow = "hidden";
857
- },
858
- onLeave(el) {
859
- if (el.scrollHeight !== 0) {
860
- el.classList.add("collapse-transition");
861
- el.style.transitionProperty = "height";
862
- el.style.height = "0";
863
- el.style.paddingTop = "0";
864
- el.style.paddingBottom = "0";
865
- }
866
- },
867
- onAfterLeave(el) {
868
- el.classList.remove("collapse-transition");
869
- el.style.height = "";
870
- el.style.overflow = el.dataset.oldOverflow || "0";
871
- el.style.paddingTop = el.dataset.oldPaddingTop || "0";
872
- el.style.paddingBottom = el.dataset.oldPaddingBottom || "0";
873
- }
874
- };
875
- style.mount();
876
- return () => (0, lib_exports.h)(lib_exports.Transition, on, slots);
877
- }
878
- });
879
- var style = c2(".collapse-transition", {
880
- transition: "0.2s height ease-in-out, 0.2s padding-top ease-in-out,0.2s padding-bottom ease-in-out"
881
- });
882
-
883
- // src/hooks/syncElementScroll/index.ts
884
- var import_core = __toESM(require_core(), 1);
885
- var import_debounce = __toESM(require_debounce(), 1);
886
- var import_throttle = __toESM(require_throttle(), 1);
887
- var import_vue = __toESM(require_vue(), 1);
888
- function syncElementSyncScroll(fromTarget, toTarget, options = {}) {
889
- const { left = true, top = true, wait, immediate = true } = options;
890
- const debounceScrollLocks = (0, import_vue.reactive)({ from: false, to: false });
891
- const onChangeLockScrollListener = (0, import_debounce.default)(
892
- (type) => {
893
- debounceScrollLocks[type] = true;
894
- },
895
- 20,
896
- { leading: true, trailing: false }
897
- );
898
- const offChangeLockScrollListener = (0, import_debounce.default)(
899
- (type) => {
900
- debounceScrollLocks[type] = false;
901
- },
902
- 20,
903
- { leading: false, trailing: true }
904
- );
905
- const syncScroll = (type) => {
906
- const positive = type;
907
- const opposite = type === "from" ? "to" : "from";
908
- const elements = (0, import_vue.reactive)({
909
- from: fromTarget,
910
- to: toTarget
911
- });
912
- if (debounceScrollLocks[type])
913
- return;
914
- onChangeLockScrollListener(opposite);
915
- const aElement = elements[positive];
916
- const bElement = elements[opposite];
917
- const options2 = {};
918
- if (left)
919
- options2.left = aElement.scrollLeft;
920
- if (top)
921
- options2.top = aElement.scrollTop;
922
- if (!aElement || !bElement)
923
- return;
924
- bElement?.scroll(options2);
925
- offChangeLockScrollListener(opposite);
926
- };
927
- const syncFromTo = () => syncScroll("from");
928
- const syncToFrom = () => syncScroll("to");
929
- let toStopHandle;
930
- let formStopHandle;
931
- const stop = () => {
932
- toStopHandle?.();
933
- formStopHandle?.();
934
- };
935
- const start = () => {
936
- toStopHandle = (0, import_core.useEventListener)(fromTarget, "scroll", (0, import_throttle.default)(syncFromTo, wait));
937
- formStopHandle = (0, import_core.useEventListener)(toTarget, "scroll", (0, import_throttle.default)(syncToFrom, wait));
938
- };
939
- if (immediate)
940
- start();
941
- return { stop, start, syncFromTo, syncToFrom };
942
- }
943
-
944
- // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_freeGlobal.js
945
- var freeGlobal = typeof global == "object" && global && global.Object === Object && global;
946
- var freeGlobal_default = freeGlobal;
947
-
948
- // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_root.js
949
- var freeSelf = typeof self == "object" && self && self.Object === Object && self;
950
- var root = freeGlobal_default || freeSelf || Function("return this")();
951
- var root_default = root;
952
-
953
- // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_Symbol.js
954
- var Symbol2 = root_default.Symbol;
955
- var Symbol_default = Symbol2;
956
-
957
- // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_getRawTag.js
958
- var objectProto = Object.prototype;
959
- var hasOwnProperty = objectProto.hasOwnProperty;
960
- var nativeObjectToString = objectProto.toString;
961
- var symToStringTag = Symbol_default ? Symbol_default.toStringTag : void 0;
962
- function getRawTag(value) {
963
- var isOwn = hasOwnProperty.call(value, symToStringTag), tag = value[symToStringTag];
964
- try {
965
- value[symToStringTag] = void 0;
966
- var unmasked = true;
967
- } catch (e) {
968
- }
969
- var result = nativeObjectToString.call(value);
970
- if (unmasked) {
971
- if (isOwn) {
972
- value[symToStringTag] = tag;
973
- } else {
974
- delete value[symToStringTag];
975
- }
976
- }
977
- return result;
978
- }
979
- var getRawTag_default = getRawTag;
980
-
981
- // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_objectToString.js
982
- var objectProto2 = Object.prototype;
983
- var nativeObjectToString2 = objectProto2.toString;
984
- function objectToString(value) {
985
- return nativeObjectToString2.call(value);
986
- }
987
- var objectToString_default = objectToString;
988
-
989
- // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseGetTag.js
990
- var nullTag = "[object Null]";
991
- var undefinedTag = "[object Undefined]";
992
- var symToStringTag2 = Symbol_default ? Symbol_default.toStringTag : void 0;
993
- function baseGetTag(value) {
994
- if (value == null) {
995
- return value === void 0 ? undefinedTag : nullTag;
996
- }
997
- return symToStringTag2 && symToStringTag2 in Object(value) ? getRawTag_default(value) : objectToString_default(value);
998
- }
999
- var baseGetTag_default = baseGetTag;
1000
-
1001
- // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isObjectLike.js
1002
- function isObjectLike(value) {
1003
- return value != null && typeof value == "object";
1004
- }
1005
- var isObjectLike_default = isObjectLike;
1006
-
1007
- // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isArray.js
1008
- var isArray = Array.isArray;
1009
- var isArray_default = isArray;
1010
-
1011
- // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isString.js
1012
- var stringTag = "[object String]";
1013
- function isString(value) {
1014
- return typeof value == "string" || !isArray_default(value) && isObjectLike_default(value) && baseGetTag_default(value) == stringTag;
1015
- }
1016
- var isString_default = isString;
1017
-
1018
- // ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isNumber.js
1019
- var numberTag = "[object Number]";
1020
- function isNumber(value) {
1021
- return typeof value == "number" || isObjectLike_default(value) && baseGetTag_default(value) == numberTag;
1022
- }
1023
- var isNumber_default = isNumber;
1024
-
1025
- // ../util-core/src/util/unit.ts
1026
- function unit(value, unit2 = "px") {
1027
- if (!(isString_default(value) || isNumber_default(value)))
1028
- return "";
1029
- value = String(value);
1030
- return /\D/.test(value) ? value : value + unit2;
1031
- }
1032
-
1033
- // src/hooks/syncElementSize/index.ts
1034
- var import_core2 = __toESM(require_core(), 1);
1035
- var import_vue2 = __toESM(require_vue(), 1);
1036
- function syncElementSize(fromTarget, toTarget, options = {}) {
1037
- const { width: isOnWidth = true, height: isOnHeight = false } = options;
1038
- const defaultSize = { width: "", height: "" };
1039
- const fromSize = (0, import_core2.useElementSize)(fromTarget);
1040
- let widthStopHandle;
1041
- let heightStopHandle;
1042
- const sync = (type) => {
1043
- const sources = [fromSize[type], toTarget];
1044
- const callback = () => {
1045
- const element = (0, import_core2.unrefElement)(toTarget);
1046
- if (!element)
1047
- return void 0;
1048
- element.style[type] = unit(fromSize[type].value);
1049
- };
1050
- return (0, import_vue2.watch)(sources, callback, { immediate: true, ...options });
1051
- };
1052
- const stop = () => {
1053
- widthStopHandle?.();
1054
- heightStopHandle?.();
1055
- const element = (0, import_core2.unrefElement)(toTarget);
1056
- element.style.width = defaultSize.width;
1057
- element.style.height = defaultSize.height;
1058
- };
1059
- const start = () => {
1060
- if (isOnWidth)
1061
- widthStopHandle = sync("width");
1062
- if (isOnHeight)
1063
- heightStopHandle = sync("height");
1064
- };
1065
- (0, import_vue2.watch)(
1066
- () => (0, import_vue2.unref)(toTarget),
1067
- () => {
1068
- const element = (0, import_core2.unrefElement)(toTarget);
1069
- defaultSize.width = element.style.width;
1070
- defaultSize.height = element.style.height;
1071
- }
1072
- );
1073
- start();
1074
- return { start, stop };
1075
- }
1076
-
1077
- // src/hooks/useChecked/index.ts
1078
- var import_vue3 = __toESM(require_vue(), 1);
1079
- function useChecked(target, checked = true, unchecked = false) {
1080
- return (0, import_vue3.computed)({
1081
- get: () => target.value === (0, import_vue3.unref)(checked),
1082
- set: (_value) => {
1083
- target.value = _value ? (0, import_vue3.unref)(checked) : (0, import_vue3.unref)(unchecked);
1084
- }
1085
- });
1086
- }
1087
-
1088
- // src/hooks/usePaginationServer/index.ts
1089
- var import_core3 = __toESM(require_core(), 1);
1090
- var import_debounce2 = __toESM(require_debounce(), 1);
1091
- var import_vue4 = __toESM(require_vue(), 1);
1092
- function useServerPagination(options) {
1093
- const total = (0, import_vue4.ref)(Infinity);
1094
- const pagination = (0, import_core3.useOffsetPagination)({ total, ...options });
1095
- const resolveOptions = (0, import_vue4.reactive)({
1096
- currentPage: pagination.currentPage,
1097
- currentPageSize: pagination.currentPageSize,
1098
- total
1099
- });
1100
- const paginationRef = (0, import_vue4.reactive)({
1101
- currentPage: pagination.currentPage,
1102
- currentPageSize: pagination.currentPageSize,
1103
- pageCount: pagination.pageCount,
1104
- isFirstPage: pagination.isFirstPage,
1105
- isLastPage: pagination.isLastPage,
1106
- total
1107
- });
1108
- const state = (0, import_vue4.ref)([]);
1109
- const {
1110
- execute: _execute,
1111
- isLoading: loading,
1112
- error
1113
- } = (0, import_core3.useAsyncState)(async () => {
1114
- const resolved = await options.resolve(resolveOptions);
1115
- return resolved;
1116
- }, []);
1117
- const execute = (0, import_debounce2.default)(async () => {
1118
- state.value = await _execute();
1119
- }, 100);
1120
- (0, import_vue4.nextTick)(() => {
1121
- (0, import_vue4.watch)([pagination.currentPageSize, ...options.sources || []], execute, { immediate: true, ...options });
1122
- (0, import_vue4.watch)(pagination.currentPage, (newValue, oldValue) => newValue !== oldValue && execute());
1123
- });
1124
- return {
1125
- state,
1126
- loading,
1127
- error,
1128
- execute,
1129
- pagination: paginationRef,
1130
- next: pagination.next,
1131
- prev: pagination.prev
1132
- };
1133
- }
1134
-
1135
- // src/hooks/useSelectedMultiple/index.ts
1136
- var import_vue6 = __toESM(require_vue(), 1);
1137
-
1138
- // src/hooks/utils/extendSelected.ts
1139
- var import_core4 = __toESM(require_core(), 1);
1140
- var import_vue5 = __toESM(require_vue(), 1);
1141
- function extendSelected(array, fieldName) {
1142
- (0, import_vue5.watch)(
1143
- array,
1144
- (items) => {
1145
- for (const item of items) {
1146
- if (typeof item[fieldName] === "undefined")
1147
- (0, import_core4.extendRef)(item, { [fieldName]: (0, import_vue5.ref)(false) });
1148
- }
1149
- },
1150
- { immediate: true, flush: "sync" }
1151
- );
1152
- }
1153
-
1154
- // src/hooks/useSelectedMultiple/index.ts
1155
- function useSelectedMultiple(array, options = {}) {
1156
- const { fieldName = "select", disabled } = options;
1157
- extendSelected(array, fieldName);
1158
- const selected = (0, import_vue6.computed)(() => (0, import_vue6.unref)(array).filter((item) => item[fieldName]));
1159
- const isSelectedAll = (0, import_vue6.computed)({
1160
- get: () => !selected.value?.length && !(0, import_vue6.unref)(array).some((item) => !item[fieldName]),
1161
- set: (value) => (0, import_vue6.unref)(array).forEach((item, index) => {
1162
- if (!disabled?.(item, index))
1163
- item[fieldName] = value;
1164
- })
1165
- });
1166
- const isSelected = (0, import_vue6.computed)(() => !!(0, import_vue6.unref)(array).some((item) => item[fieldName]));
1167
- const isIndeterminate = (0, import_vue6.computed)(() => {
1168
- const selectCount = selected.value.length;
1169
- return selectCount > 0 && selectCount < (0, import_vue6.unref)(array).length;
1170
- });
1171
- return { selected, isSelectedAll, isSelected, isIndeterminate };
1172
- }
1173
-
1174
- // src/hooks/useSelectedSingle/index.ts
1175
- var import_vue7 = __toESM(require_vue(), 1);
1176
- function useSelectedSingle(array, options = {}) {
1177
- const fieldName = options.fieldName ?? "select";
1178
- const required = options.required ?? false;
1179
- extendSelected(array, fieldName);
1180
- const SELECTED_SINGLE_KEY = "selected_single_key";
1181
- const isLocked = (0, import_vue7.ref)(false);
1182
- const isSelected = (0, import_vue7.computed)(() => !!(0, import_vue7.unref)(array).some((item) => item.select));
1183
- if (required) {
1184
- const recover = (bool) => {
1185
- const index = required === true ? 0 : required;
1186
- if (!bool && (0, import_vue7.unref)(array).length > 0)
1187
- (0, import_vue7.unref)(array)[index][fieldName] = true;
1188
- };
1189
- (0, import_vue7.watch)(isSelected, recover, { flush: "sync", immediate: true });
1190
- }
1191
- const itemChange = (neglect) => {
1192
- if (isLocked.value)
1193
- return;
1194
- isLocked.value = true;
1195
- const _array = (0, import_vue7.unref)(array);
1196
- const _value = !_array[neglect][fieldName];
1197
- if (required && !_value)
1198
- _array[neglect][fieldName] = true;
1199
- _array.forEach((target, index) => {
1200
- if (neglect === index)
1201
- return void 0;
1202
- if (!target[fieldName])
1203
- return void 0;
1204
- target[fieldName] = false;
1205
- });
1206
- isLocked.value = false;
1207
- };
1208
- const targetEffect = (target, index) => {
1209
- if (!target[SELECTED_SINGLE_KEY]) {
1210
- return (0, import_vue7.watch)(
1211
- () => target[fieldName],
1212
- () => itemChange(index),
1213
- { flush: "sync" }
1214
- );
1215
- }
1216
- Object.defineProperty(target, SELECTED_SINGLE_KEY, { value: true });
1217
- };
1218
- (0, import_vue7.watch)(
1219
- array,
1220
- () => {
1221
- (0, import_vue7.unref)(array).forEach(targetEffect);
1222
- },
1223
- { immediate: true, flush: "sync" }
1224
- );
1225
- const selected = (0, import_vue7.computed)(() => (0, import_vue7.unref)(array).find((v) => v[fieldName]));
1226
- return { selected, isSelected };
1227
- }
1228
-
1229
- // src/utils/index.ts
1230
- function ehr(component, tag) {
1231
- const container = document.createElement(tag || "dev");
1232
- (0, lib_exports.render)((0, lib_exports.h)(component), container);
1233
- return container;
1234
- }
1235
- function propertyToRef(data, prop) {
1236
- return (0, lib_exports.computed)({
1237
- get() {
1238
- return data[prop];
1239
- },
1240
- set(v) {
1241
- data[prop] = v;
1242
- }
1243
- });
1244
- }
1245
- })();
1246
- /*! Bundled license information:
1247
-
1248
- lodash-es/lodash.js:
1249
- (**
1250
- * @license
1251
- * Lodash (Custom Build) <https://lodash.com/>
1252
- * Build: `lodash modularize exports="es" -o ./`
1253
- * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
1254
- * Released under MIT license <https://lodash.com/license>
1255
- * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
1256
- * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
1257
- *)
1258
- */