@threadlabs/looma 0.26.16 → 0.26.17
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/components/ui-meter/ui-meter.html +59 -8
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/styles/ui-meter.css +34 -0
- package/vanilla/UiMeter.d.ts +2 -0
- package/vanilla/UiMeter.js +136 -38
- package/vue/UiMeter.d.ts +27 -0
- package/vue/UiMeter.vue +514 -77
- package/vue/chunks/UiMeter.js +271 -57
- package/vue/components.css +49 -24
package/vue/chunks/UiMeter.js
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { t as _plugin_vue_export_helper_default } from "./_plugin-vue_export-helper.js";
|
|
2
2
|
import { a as vPropValidity, n as checkedProp } from "./props.js";
|
|
3
|
-
import { computed,
|
|
3
|
+
import { Fragment, computed, createCommentVNode, createElementBlock, defineComponent, getCurrentInstance, mergeProps, normalizeStyle, openBlock, renderList, unref, watchSyncEffect, withDirectives } from "vue";
|
|
4
4
|
//#region .build/vue/UiMeter.vue?vue&type=script&setup=true&lang.ts
|
|
5
5
|
var _hoisted_1 = [
|
|
6
|
+
"role",
|
|
7
|
+
"aria-valuemin",
|
|
6
8
|
"aria-valuemax",
|
|
7
9
|
"aria-valuenow",
|
|
8
10
|
"aria-valuetext",
|
|
@@ -10,11 +12,13 @@ var _hoisted_1 = [
|
|
|
10
12
|
"data-ui-meter-segments",
|
|
11
13
|
"data-label",
|
|
12
14
|
"data-max",
|
|
15
|
+
"data-parts",
|
|
13
16
|
"data-segments",
|
|
14
17
|
"data-size",
|
|
15
18
|
"data-tone",
|
|
16
19
|
"data-value",
|
|
17
20
|
"data-value-text",
|
|
21
|
+
"data-variant",
|
|
18
22
|
"data-ui-meter-state"
|
|
19
23
|
];
|
|
20
24
|
function createFormatValue() {
|
|
@@ -252,6 +256,10 @@ var UiMeter_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PURE
|
|
|
252
256
|
type: null,
|
|
253
257
|
default: 1
|
|
254
258
|
},
|
|
259
|
+
parts: {
|
|
260
|
+
type: null,
|
|
261
|
+
default: () => []
|
|
262
|
+
},
|
|
255
263
|
segments: {
|
|
256
264
|
type: null,
|
|
257
265
|
default: 0
|
|
@@ -271,6 +279,10 @@ var UiMeter_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PURE
|
|
|
271
279
|
valueText: {
|
|
272
280
|
type: null,
|
|
273
281
|
default: ""
|
|
282
|
+
},
|
|
283
|
+
variant: {
|
|
284
|
+
type: null,
|
|
285
|
+
default: "progress"
|
|
274
286
|
}
|
|
275
287
|
},
|
|
276
288
|
setup(__props) {
|
|
@@ -292,10 +304,38 @@ var UiMeter_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PURE
|
|
|
292
304
|
name: "number"
|
|
293
305
|
},
|
|
294
306
|
required: false,
|
|
295
|
-
target: { attribute: "
|
|
307
|
+
target: { attribute: "max" },
|
|
296
308
|
description: "The value of a full bar, as on a native meter: 1 for a fraction, or the whole amount (a total, a count of items) with value as the part of it. Must be\n above 0; otherwise the bar is empty.",
|
|
297
309
|
default: 1
|
|
298
310
|
},
|
|
311
|
+
parts: {
|
|
312
|
+
type: {
|
|
313
|
+
kind: "list",
|
|
314
|
+
item: {
|
|
315
|
+
kind: "object",
|
|
316
|
+
fields: [{
|
|
317
|
+
name: "value",
|
|
318
|
+
type: {
|
|
319
|
+
kind: "terminal",
|
|
320
|
+
name: "number"
|
|
321
|
+
},
|
|
322
|
+
optional: false
|
|
323
|
+
}, {
|
|
324
|
+
name: "color",
|
|
325
|
+
type: {
|
|
326
|
+
kind: "terminal",
|
|
327
|
+
name: "string"
|
|
328
|
+
},
|
|
329
|
+
optional: false
|
|
330
|
+
}],
|
|
331
|
+
open: false
|
|
332
|
+
}
|
|
333
|
+
},
|
|
334
|
+
required: false,
|
|
335
|
+
target: { attribute: "parts" },
|
|
336
|
+
description: "Categories in display order for distribution. Positive finite values determine each share without rounding; zero\n and negative values draw nothing. Supply label and valueText to describe every category, and a visible text legend so colour is never the only\n explanation.",
|
|
337
|
+
default: []
|
|
338
|
+
},
|
|
299
339
|
segments: {
|
|
300
340
|
type: {
|
|
301
341
|
kind: "terminal",
|
|
@@ -354,17 +394,30 @@ var UiMeter_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PURE
|
|
|
354
394
|
target: { attribute: "valuetext" },
|
|
355
395
|
description: "The value as assistive technology reads it (\"$750 of $1,240 collected\", \"3 of 5 done, overdue\"). Empty reads the whole percentage in the current\n locale.",
|
|
356
396
|
default: ""
|
|
397
|
+
},
|
|
398
|
+
variant: {
|
|
399
|
+
type: {
|
|
400
|
+
kind: "terminal",
|
|
401
|
+
name: "keyword"
|
|
402
|
+
},
|
|
403
|
+
required: false,
|
|
404
|
+
target: { attribute: "variant" },
|
|
405
|
+
description: "progress measures one value against max. distribution shows mutually exclusive parts of a whole as a full-width proportional bar; it uses parts rather than\n value/max and is an image, not a progress reading.",
|
|
406
|
+
values: ["progress", "distribution"],
|
|
407
|
+
default: "progress"
|
|
357
408
|
}
|
|
358
409
|
} };
|
|
359
410
|
const props = __props;
|
|
360
411
|
const acceptedProps = {
|
|
361
412
|
label: "",
|
|
362
413
|
max: 1,
|
|
414
|
+
parts: () => [],
|
|
363
415
|
segments: 0,
|
|
364
416
|
size: "md",
|
|
365
417
|
tone: "neutral",
|
|
366
418
|
value: 0,
|
|
367
|
-
valueText: ""
|
|
419
|
+
valueText: "",
|
|
420
|
+
variant: "progress"
|
|
368
421
|
};
|
|
369
422
|
const checkedProps = computed(() => ({
|
|
370
423
|
label: checkedProp(props["label"], {
|
|
@@ -375,6 +428,28 @@ var UiMeter_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PURE
|
|
|
375
428
|
kind: "terminal",
|
|
376
429
|
name: "number"
|
|
377
430
|
}, false, "max", acceptedProps),
|
|
431
|
+
parts: checkedProp(props["parts"], {
|
|
432
|
+
kind: "list",
|
|
433
|
+
item: {
|
|
434
|
+
kind: "object",
|
|
435
|
+
fields: [{
|
|
436
|
+
name: "value",
|
|
437
|
+
type: {
|
|
438
|
+
kind: "terminal",
|
|
439
|
+
name: "number"
|
|
440
|
+
},
|
|
441
|
+
optional: false
|
|
442
|
+
}, {
|
|
443
|
+
name: "color",
|
|
444
|
+
type: {
|
|
445
|
+
kind: "terminal",
|
|
446
|
+
name: "string"
|
|
447
|
+
},
|
|
448
|
+
optional: false
|
|
449
|
+
}],
|
|
450
|
+
open: false
|
|
451
|
+
}
|
|
452
|
+
}, false, "parts", acceptedProps),
|
|
378
453
|
segments: checkedProp(props["segments"], {
|
|
379
454
|
kind: "terminal",
|
|
380
455
|
name: "number"
|
|
@@ -394,7 +469,11 @@ var UiMeter_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PURE
|
|
|
394
469
|
valueText: checkedProp(props["valueText"], {
|
|
395
470
|
kind: "terminal",
|
|
396
471
|
name: "string"
|
|
397
|
-
}, false, "valueText", acceptedProps)
|
|
472
|
+
}, false, "valueText", acceptedProps),
|
|
473
|
+
variant: checkedProp(props["variant"], {
|
|
474
|
+
kind: "terminal",
|
|
475
|
+
name: "keyword"
|
|
476
|
+
}, false, "variant", acceptedProps)
|
|
398
477
|
}));
|
|
399
478
|
checkedProps.value;
|
|
400
479
|
watchSyncEffect(() => {
|
|
@@ -461,66 +540,188 @@ var UiMeter_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PURE
|
|
|
461
540
|
});
|
|
462
541
|
let guardedPrevious = null;
|
|
463
542
|
const guarded = computed(() => {
|
|
543
|
+
if (((objectValue, indexValue) => objectValue === Symbol.for("html-next.invalid-result") || indexValue === Symbol.for("html-next.invalid-result") ? Symbol.for("html-next.invalid-result") : objectValue[indexValue])({
|
|
544
|
+
true: "img",
|
|
545
|
+
false: "meter"
|
|
546
|
+
}, concat(checkedProps.value.variant === "distribution")) === Symbol.for("html-next.invalid-result")) return guardedPrevious;
|
|
547
|
+
return guardedPrevious = attribute(((objectValue, indexValue) => objectValue === Symbol.for("html-next.invalid-result") || indexValue === Symbol.for("html-next.invalid-result") ? Symbol.for("html-next.invalid-result") : objectValue[indexValue])({
|
|
548
|
+
true: "img",
|
|
549
|
+
false: "meter"
|
|
550
|
+
}, concat(checkedProps.value.variant === "distribution")));
|
|
551
|
+
});
|
|
552
|
+
let guardedBindingPrevious = null;
|
|
553
|
+
const guardedBinding = computed(() => {
|
|
554
|
+
if (((objectValue, indexValue) => objectValue === Symbol.for("html-next.invalid-result") || indexValue === Symbol.for("html-next.invalid-result") ? Symbol.for("html-next.invalid-result") : objectValue[indexValue])({
|
|
555
|
+
true: null,
|
|
556
|
+
false: 0
|
|
557
|
+
}, concat(checkedProps.value.variant === "distribution")) === Symbol.for("html-next.invalid-result")) return guardedBindingPrevious;
|
|
558
|
+
return guardedBindingPrevious = typeof ((objectValue, indexValue) => objectValue === Symbol.for("html-next.invalid-result") || indexValue === Symbol.for("html-next.invalid-result") ? Symbol.for("html-next.invalid-result") : objectValue[indexValue])({
|
|
559
|
+
true: null,
|
|
560
|
+
false: 0
|
|
561
|
+
}, concat(checkedProps.value.variant === "distribution")) === "boolean" ? String(((objectValue, indexValue) => objectValue === Symbol.for("html-next.invalid-result") || indexValue === Symbol.for("html-next.invalid-result") ? Symbol.for("html-next.invalid-result") : objectValue[indexValue])({
|
|
562
|
+
true: null,
|
|
563
|
+
false: 0
|
|
564
|
+
}, concat(checkedProps.value.variant === "distribution"))) : attribute(((objectValue, indexValue) => objectValue === Symbol.for("html-next.invalid-result") || indexValue === Symbol.for("html-next.invalid-result") ? Symbol.for("html-next.invalid-result") : objectValue[indexValue])({
|
|
565
|
+
true: null,
|
|
566
|
+
false: 0
|
|
567
|
+
}, concat(checkedProps.value.variant === "distribution")));
|
|
568
|
+
});
|
|
569
|
+
let guardedBinding2Previous = null;
|
|
570
|
+
const guardedBinding2 = computed(() => {
|
|
571
|
+
if (((objectValue, indexValue) => objectValue === Symbol.for("html-next.invalid-result") || indexValue === Symbol.for("html-next.invalid-result") ? Symbol.for("html-next.invalid-result") : objectValue[indexValue])({
|
|
572
|
+
true: null,
|
|
573
|
+
false: checkedProps.value.max
|
|
574
|
+
}, concat(checkedProps.value.variant === "distribution")) === Symbol.for("html-next.invalid-result")) return guardedBinding2Previous;
|
|
575
|
+
return guardedBinding2Previous = typeof ((objectValue, indexValue) => objectValue === Symbol.for("html-next.invalid-result") || indexValue === Symbol.for("html-next.invalid-result") ? Symbol.for("html-next.invalid-result") : objectValue[indexValue])({
|
|
576
|
+
true: null,
|
|
577
|
+
false: checkedProps.value.max
|
|
578
|
+
}, concat(checkedProps.value.variant === "distribution")) === "boolean" ? String(((objectValue, indexValue) => objectValue === Symbol.for("html-next.invalid-result") || indexValue === Symbol.for("html-next.invalid-result") ? Symbol.for("html-next.invalid-result") : objectValue[indexValue])({
|
|
579
|
+
true: null,
|
|
580
|
+
false: checkedProps.value.max
|
|
581
|
+
}, concat(checkedProps.value.variant === "distribution"))) : attribute(((objectValue, indexValue) => objectValue === Symbol.for("html-next.invalid-result") || indexValue === Symbol.for("html-next.invalid-result") ? Symbol.for("html-next.invalid-result") : objectValue[indexValue])({
|
|
582
|
+
true: null,
|
|
583
|
+
false: checkedProps.value.max
|
|
584
|
+
}, concat(checkedProps.value.variant === "distribution")));
|
|
585
|
+
});
|
|
586
|
+
let guardedBinding3Previous = null;
|
|
587
|
+
const guardedBinding3 = computed(() => {
|
|
588
|
+
if (((objectValue, indexValue) => objectValue === Symbol.for("html-next.invalid-result") || indexValue === Symbol.for("html-next.invalid-result") ? Symbol.for("html-next.invalid-result") : objectValue[indexValue])({
|
|
589
|
+
true: null,
|
|
590
|
+
false: amount.value
|
|
591
|
+
}, concat(checkedProps.value.variant === "distribution")) === Symbol.for("html-next.invalid-result")) return guardedBinding3Previous;
|
|
592
|
+
return guardedBinding3Previous = typeof ((objectValue, indexValue) => objectValue === Symbol.for("html-next.invalid-result") || indexValue === Symbol.for("html-next.invalid-result") ? Symbol.for("html-next.invalid-result") : objectValue[indexValue])({
|
|
593
|
+
true: null,
|
|
594
|
+
false: amount.value
|
|
595
|
+
}, concat(checkedProps.value.variant === "distribution")) === "boolean" ? String(((objectValue, indexValue) => objectValue === Symbol.for("html-next.invalid-result") || indexValue === Symbol.for("html-next.invalid-result") ? Symbol.for("html-next.invalid-result") : objectValue[indexValue])({
|
|
596
|
+
true: null,
|
|
597
|
+
false: amount.value
|
|
598
|
+
}, concat(checkedProps.value.variant === "distribution"))) : attribute(((objectValue, indexValue) => objectValue === Symbol.for("html-next.invalid-result") || indexValue === Symbol.for("html-next.invalid-result") ? Symbol.for("html-next.invalid-result") : objectValue[indexValue])({
|
|
599
|
+
true: null,
|
|
600
|
+
false: amount.value
|
|
601
|
+
}, concat(checkedProps.value.variant === "distribution")));
|
|
602
|
+
});
|
|
603
|
+
let guardedBinding4Previous = null;
|
|
604
|
+
const guardedBinding4 = computed(() => {
|
|
464
605
|
if (((objectValue, indexValue) => objectValue === Symbol.for("html-next.invalid-result") || indexValue === Symbol.for("html-next.invalid-result") ? Symbol.for("html-next.invalid-result") : objectValue[indexValue])((() => {
|
|
465
606
|
const value = {
|
|
466
|
-
true:
|
|
467
|
-
false:
|
|
607
|
+
true: null,
|
|
608
|
+
false: ((objectValue, indexValue) => objectValue === Symbol.for("html-next.invalid-result") || indexValue === Symbol.for("html-next.invalid-result") ? Symbol.for("html-next.invalid-result") : objectValue[indexValue])((() => {
|
|
609
|
+
const value = {
|
|
610
|
+
true: checkedProps.value.valueText,
|
|
611
|
+
false: formatValue(number(percent.value) === void 0 || number(100) === void 0 ? void 0 : number(percent.value) / number(100), "number", "format", "percent", { maximumFractionDigits: 0 })
|
|
612
|
+
};
|
|
613
|
+
return Object.values(value).some((entry) => entry === Symbol.for("html-next.invalid-result")) ? Symbol.for("html-next.invalid-result") : value;
|
|
614
|
+
})(), concat(checkedProps.value.valueText !== ""))
|
|
468
615
|
};
|
|
469
616
|
return Object.values(value).some((entry) => entry === Symbol.for("html-next.invalid-result")) ? Symbol.for("html-next.invalid-result") : value;
|
|
470
|
-
})(), concat(checkedProps.value.
|
|
471
|
-
return
|
|
617
|
+
})(), concat(checkedProps.value.variant === "distribution")) === Symbol.for("html-next.invalid-result")) return guardedBinding4Previous;
|
|
618
|
+
return guardedBinding4Previous = typeof ((objectValue, indexValue) => objectValue === Symbol.for("html-next.invalid-result") || indexValue === Symbol.for("html-next.invalid-result") ? Symbol.for("html-next.invalid-result") : objectValue[indexValue])((() => {
|
|
472
619
|
const value = {
|
|
473
|
-
true:
|
|
474
|
-
false:
|
|
620
|
+
true: null,
|
|
621
|
+
false: ((objectValue, indexValue) => objectValue === Symbol.for("html-next.invalid-result") || indexValue === Symbol.for("html-next.invalid-result") ? Symbol.for("html-next.invalid-result") : objectValue[indexValue])((() => {
|
|
622
|
+
const value = {
|
|
623
|
+
true: checkedProps.value.valueText,
|
|
624
|
+
false: formatValue(number(percent.value) === void 0 || number(100) === void 0 ? void 0 : number(percent.value) / number(100), "number", "format", "percent", { maximumFractionDigits: 0 })
|
|
625
|
+
};
|
|
626
|
+
return Object.values(value).some((entry) => entry === Symbol.for("html-next.invalid-result")) ? Symbol.for("html-next.invalid-result") : value;
|
|
627
|
+
})(), concat(checkedProps.value.valueText !== ""))
|
|
475
628
|
};
|
|
476
629
|
return Object.values(value).some((entry) => entry === Symbol.for("html-next.invalid-result")) ? Symbol.for("html-next.invalid-result") : value;
|
|
477
|
-
})(), concat(checkedProps.value.
|
|
630
|
+
})(), concat(checkedProps.value.variant === "distribution")) === "boolean" ? String(((objectValue, indexValue) => objectValue === Symbol.for("html-next.invalid-result") || indexValue === Symbol.for("html-next.invalid-result") ? Symbol.for("html-next.invalid-result") : objectValue[indexValue])((() => {
|
|
478
631
|
const value = {
|
|
479
|
-
true:
|
|
480
|
-
false:
|
|
632
|
+
true: null,
|
|
633
|
+
false: ((objectValue, indexValue) => objectValue === Symbol.for("html-next.invalid-result") || indexValue === Symbol.for("html-next.invalid-result") ? Symbol.for("html-next.invalid-result") : objectValue[indexValue])((() => {
|
|
634
|
+
const value = {
|
|
635
|
+
true: checkedProps.value.valueText,
|
|
636
|
+
false: formatValue(number(percent.value) === void 0 || number(100) === void 0 ? void 0 : number(percent.value) / number(100), "number", "format", "percent", { maximumFractionDigits: 0 })
|
|
637
|
+
};
|
|
638
|
+
return Object.values(value).some((entry) => entry === Symbol.for("html-next.invalid-result")) ? Symbol.for("html-next.invalid-result") : value;
|
|
639
|
+
})(), concat(checkedProps.value.valueText !== ""))
|
|
481
640
|
};
|
|
482
641
|
return Object.values(value).some((entry) => entry === Symbol.for("html-next.invalid-result")) ? Symbol.for("html-next.invalid-result") : value;
|
|
483
|
-
})(), concat(checkedProps.value.
|
|
642
|
+
})(), concat(checkedProps.value.variant === "distribution"))) : attribute(((objectValue, indexValue) => objectValue === Symbol.for("html-next.invalid-result") || indexValue === Symbol.for("html-next.invalid-result") ? Symbol.for("html-next.invalid-result") : objectValue[indexValue])((() => {
|
|
484
643
|
const value = {
|
|
485
|
-
true:
|
|
486
|
-
false:
|
|
644
|
+
true: null,
|
|
645
|
+
false: ((objectValue, indexValue) => objectValue === Symbol.for("html-next.invalid-result") || indexValue === Symbol.for("html-next.invalid-result") ? Symbol.for("html-next.invalid-result") : objectValue[indexValue])((() => {
|
|
646
|
+
const value = {
|
|
647
|
+
true: checkedProps.value.valueText,
|
|
648
|
+
false: formatValue(number(percent.value) === void 0 || number(100) === void 0 ? void 0 : number(percent.value) / number(100), "number", "format", "percent", { maximumFractionDigits: 0 })
|
|
649
|
+
};
|
|
650
|
+
return Object.values(value).some((entry) => entry === Symbol.for("html-next.invalid-result")) ? Symbol.for("html-next.invalid-result") : value;
|
|
651
|
+
})(), concat(checkedProps.value.valueText !== ""))
|
|
487
652
|
};
|
|
488
653
|
return Object.values(value).some((entry) => entry === Symbol.for("html-next.invalid-result")) ? Symbol.for("html-next.invalid-result") : value;
|
|
489
|
-
})(), concat(checkedProps.value.
|
|
654
|
+
})(), concat(checkedProps.value.variant === "distribution")));
|
|
490
655
|
});
|
|
491
|
-
let
|
|
492
|
-
const
|
|
493
|
-
if (((objectValue, indexValue) => objectValue === Symbol.for("html-next.invalid-result") || indexValue === Symbol.for("html-next.invalid-result") ? Symbol.for("html-next.invalid-result") : objectValue[indexValue])({
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
656
|
+
let guardedBinding5Previous = null;
|
|
657
|
+
const guardedBinding5 = computed(() => {
|
|
658
|
+
if (((objectValue, indexValue) => objectValue === Symbol.for("html-next.invalid-result") || indexValue === Symbol.for("html-next.invalid-result") ? Symbol.for("html-next.invalid-result") : objectValue[indexValue])((() => {
|
|
659
|
+
const value = {
|
|
660
|
+
true: ((objectValue, indexValue) => objectValue === Symbol.for("html-next.invalid-result") || indexValue === Symbol.for("html-next.invalid-result") ? Symbol.for("html-next.invalid-result") : objectValue[indexValue])((() => {
|
|
661
|
+
const value = {
|
|
662
|
+
true: concat(checkedProps.value.label, ": ", checkedProps.value.valueText),
|
|
663
|
+
false: checkedProps.value.label
|
|
664
|
+
};
|
|
665
|
+
return Object.values(value).some((entry) => entry === Symbol.for("html-next.invalid-result")) ? Symbol.for("html-next.invalid-result") : value;
|
|
666
|
+
})(), concat(checkedProps.value.variant === "distribution" && checkedProps.value.valueText !== "")),
|
|
667
|
+
false: null
|
|
668
|
+
};
|
|
669
|
+
return Object.values(value).some((entry) => entry === Symbol.for("html-next.invalid-result")) ? Symbol.for("html-next.invalid-result") : value;
|
|
670
|
+
})(), concat(checkedProps.value.label !== "")) === Symbol.for("html-next.invalid-result")) return guardedBinding5Previous;
|
|
671
|
+
return guardedBinding5Previous = typeof ((objectValue, indexValue) => objectValue === Symbol.for("html-next.invalid-result") || indexValue === Symbol.for("html-next.invalid-result") ? Symbol.for("html-next.invalid-result") : objectValue[indexValue])((() => {
|
|
672
|
+
const value = {
|
|
673
|
+
true: ((objectValue, indexValue) => objectValue === Symbol.for("html-next.invalid-result") || indexValue === Symbol.for("html-next.invalid-result") ? Symbol.for("html-next.invalid-result") : objectValue[indexValue])((() => {
|
|
674
|
+
const value = {
|
|
675
|
+
true: concat(checkedProps.value.label, ": ", checkedProps.value.valueText),
|
|
676
|
+
false: checkedProps.value.label
|
|
677
|
+
};
|
|
678
|
+
return Object.values(value).some((entry) => entry === Symbol.for("html-next.invalid-result")) ? Symbol.for("html-next.invalid-result") : value;
|
|
679
|
+
})(), concat(checkedProps.value.variant === "distribution" && checkedProps.value.valueText !== "")),
|
|
680
|
+
false: null
|
|
681
|
+
};
|
|
682
|
+
return Object.values(value).some((entry) => entry === Symbol.for("html-next.invalid-result")) ? Symbol.for("html-next.invalid-result") : value;
|
|
683
|
+
})(), concat(checkedProps.value.label !== "")) === "boolean" ? String(((objectValue, indexValue) => objectValue === Symbol.for("html-next.invalid-result") || indexValue === Symbol.for("html-next.invalid-result") ? Symbol.for("html-next.invalid-result") : objectValue[indexValue])((() => {
|
|
684
|
+
const value = {
|
|
685
|
+
true: ((objectValue, indexValue) => objectValue === Symbol.for("html-next.invalid-result") || indexValue === Symbol.for("html-next.invalid-result") ? Symbol.for("html-next.invalid-result") : objectValue[indexValue])((() => {
|
|
686
|
+
const value = {
|
|
687
|
+
true: concat(checkedProps.value.label, ": ", checkedProps.value.valueText),
|
|
688
|
+
false: checkedProps.value.label
|
|
689
|
+
};
|
|
690
|
+
return Object.values(value).some((entry) => entry === Symbol.for("html-next.invalid-result")) ? Symbol.for("html-next.invalid-result") : value;
|
|
691
|
+
})(), concat(checkedProps.value.variant === "distribution" && checkedProps.value.valueText !== "")),
|
|
692
|
+
false: null
|
|
693
|
+
};
|
|
694
|
+
return Object.values(value).some((entry) => entry === Symbol.for("html-next.invalid-result")) ? Symbol.for("html-next.invalid-result") : value;
|
|
695
|
+
})(), concat(checkedProps.value.label !== ""))) : attribute(((objectValue, indexValue) => objectValue === Symbol.for("html-next.invalid-result") || indexValue === Symbol.for("html-next.invalid-result") ? Symbol.for("html-next.invalid-result") : objectValue[indexValue])((() => {
|
|
696
|
+
const value = {
|
|
697
|
+
true: ((objectValue, indexValue) => objectValue === Symbol.for("html-next.invalid-result") || indexValue === Symbol.for("html-next.invalid-result") ? Symbol.for("html-next.invalid-result") : objectValue[indexValue])((() => {
|
|
698
|
+
const value = {
|
|
699
|
+
true: concat(checkedProps.value.label, ": ", checkedProps.value.valueText),
|
|
700
|
+
false: checkedProps.value.label
|
|
701
|
+
};
|
|
702
|
+
return Object.values(value).some((entry) => entry === Symbol.for("html-next.invalid-result")) ? Symbol.for("html-next.invalid-result") : value;
|
|
703
|
+
})(), concat(checkedProps.value.variant === "distribution" && checkedProps.value.valueText !== "")),
|
|
704
|
+
false: null
|
|
705
|
+
};
|
|
706
|
+
return Object.values(value).some((entry) => entry === Symbol.for("html-next.invalid-result")) ? Symbol.for("html-next.invalid-result") : value;
|
|
707
|
+
})(), concat(checkedProps.value.label !== "")));
|
|
507
708
|
});
|
|
508
|
-
let
|
|
509
|
-
const
|
|
709
|
+
let guardedBinding6Previous = null;
|
|
710
|
+
const guardedBinding6 = computed(() => {
|
|
510
711
|
if (((objectValue, indexValue) => objectValue === Symbol.for("html-next.invalid-result") || indexValue === Symbol.for("html-next.invalid-result") ? Symbol.for("html-next.invalid-result") : objectValue[indexValue])({
|
|
511
712
|
true: checkedProps.value.segments,
|
|
512
713
|
false: null
|
|
513
|
-
}, concat(number(checkedProps.value.segments) === void 0 || number(1) === void 0 ? void 0 : number(checkedProps.value.segments) > number(1))) === Symbol.for("html-next.invalid-result")) return
|
|
514
|
-
return
|
|
714
|
+
}, concat(checkedProps.value.variant === "progress" && (number(checkedProps.value.segments) === void 0 || number(1) === void 0 ? void 0 : number(checkedProps.value.segments) > number(1)))) === Symbol.for("html-next.invalid-result")) return guardedBinding6Previous;
|
|
715
|
+
return guardedBinding6Previous = attribute(((objectValue, indexValue) => objectValue === Symbol.for("html-next.invalid-result") || indexValue === Symbol.for("html-next.invalid-result") ? Symbol.for("html-next.invalid-result") : objectValue[indexValue])({
|
|
515
716
|
true: checkedProps.value.segments,
|
|
516
717
|
false: null
|
|
517
|
-
}, concat(number(checkedProps.value.segments) === void 0 || number(1) === void 0 ? void 0 : number(checkedProps.value.segments) > number(1))));
|
|
718
|
+
}, concat(checkedProps.value.variant === "progress" && (number(checkedProps.value.segments) === void 0 || number(1) === void 0 ? void 0 : number(checkedProps.value.segments) > number(1)))));
|
|
518
719
|
});
|
|
519
|
-
let
|
|
520
|
-
const
|
|
720
|
+
let guardedBinding7Previous = null;
|
|
721
|
+
const guardedBinding7 = computed(() => {
|
|
521
722
|
const candidate = concat(percent.value, "%");
|
|
522
|
-
if (candidate === Symbol.for("html-next.invalid-result")) return
|
|
523
|
-
return
|
|
723
|
+
if (candidate === Symbol.for("html-next.invalid-result")) return guardedBinding7Previous;
|
|
724
|
+
return guardedBinding7Previous = candidate;
|
|
524
725
|
});
|
|
525
726
|
const hydrationNode = hydrationInstance?.vnode.el;
|
|
526
727
|
if (typeof window !== "undefined" && hydrationNode != null && (!(hydrationNode instanceof Element) || hydrationNode.localName !== "span")) throw Object.assign(/* @__PURE__ */ new Error("HR005: Server markup for <ui-meter> has an incompatible root."), {
|
|
@@ -535,7 +736,9 @@ var UiMeter_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PURE
|
|
|
535
736
|
checkedProps.value.size && "size",
|
|
536
737
|
checkedProps.value.size != null && `size=${encodeURIComponent(checkedProps.value.size)}`,
|
|
537
738
|
checkedProps.value.tone && "tone",
|
|
538
|
-
checkedProps.value.tone != null && `tone=${encodeURIComponent(checkedProps.value.tone)}
|
|
739
|
+
checkedProps.value.tone != null && `tone=${encodeURIComponent(checkedProps.value.tone)}`,
|
|
740
|
+
checkedProps.value.variant && "variant",
|
|
741
|
+
checkedProps.value.variant != null && `variant=${encodeURIComponent(checkedProps.value.variant)}`
|
|
539
742
|
].filter(Boolean).join(" "));
|
|
540
743
|
function text(value) {
|
|
541
744
|
if (Array.isArray(value)) return value.map(text).join(" ");
|
|
@@ -608,33 +811,44 @@ var UiMeter_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PURE
|
|
|
608
811
|
return !Number.isFinite(result) ? Symbol.for("html-next.invalid-result") : unit === void 0 ? result : String(result) + unit;
|
|
609
812
|
}
|
|
610
813
|
return (_ctx, _cache) => {
|
|
611
|
-
return withDirectives((openBlock(), createElementBlock("span", mergeProps({
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
"aria-
|
|
615
|
-
|
|
616
|
-
"aria-
|
|
617
|
-
"aria-
|
|
618
|
-
"
|
|
619
|
-
"aria-label": guardedBinding.value,
|
|
620
|
-
"data-ui-meter-segments": guardedBinding2.value,
|
|
814
|
+
return withDirectives((openBlock(), createElementBlock("span", mergeProps({ "data-component": "ui-meter" }, nativeAttrs(_ctx.$attrs), {
|
|
815
|
+
role: guarded.value,
|
|
816
|
+
"aria-valuemin": guardedBinding.value,
|
|
817
|
+
"aria-valuemax": guardedBinding2.value,
|
|
818
|
+
"aria-valuenow": guardedBinding3.value,
|
|
819
|
+
"aria-valuetext": guardedBinding4.value,
|
|
820
|
+
"aria-label": guardedBinding5.value,
|
|
821
|
+
"data-ui-meter-segments": guardedBinding6.value,
|
|
621
822
|
"data-label": reflectedProp("label", "label", checkedProps.value.label, void 0, false),
|
|
622
823
|
"data-max": reflectedProp("max", "max", checkedProps.value.max, void 0, false),
|
|
824
|
+
"data-parts": reflectedProp("parts", "parts", checkedProps.value.parts, void 0, false),
|
|
623
825
|
"data-segments": reflectedProp("segments", "segments", checkedProps.value.segments, void 0, false),
|
|
624
826
|
"data-size": reflectedProp("size", "size", checkedProps.value.size, void 0, false),
|
|
625
827
|
"data-tone": reflectedProp("tone", "tone", checkedProps.value.tone, void 0, false),
|
|
626
828
|
"data-value": reflectedProp("value", "value", checkedProps.value.value, void 0, false),
|
|
627
829
|
"data-value-text": reflectedProp("valueText", "value-text", checkedProps.value.valueText, void 0, false),
|
|
830
|
+
"data-variant": reflectedProp("variant", "variant", checkedProps.value.variant, void 0, false),
|
|
628
831
|
"data-ui-meter-state": hostState.value || void 0
|
|
629
|
-
}), [
|
|
832
|
+
}), [checkedProps.value.variant === "progress" ? (openBlock(), createElementBlock("span", {
|
|
833
|
+
key: 0,
|
|
630
834
|
class: "fill",
|
|
631
|
-
style: normalizeStyle({ "inline-size":
|
|
632
|
-
}, null, 4)
|
|
835
|
+
style: normalizeStyle({ "inline-size": guardedBinding7.value })
|
|
836
|
+
}, null, 4)) : createCommentVNode("v-if", true), checkedProps.value.variant === "distribution" ? (openBlock(true), createElementBlock(Fragment, { key: 1 }, renderList(checkedProps.value.parts, (part, index) => {
|
|
837
|
+
return openBlock(), createElementBlock(Fragment, { key: index }, [part.value > 0 && part.value - part.value === 0 ? (openBlock(), createElementBlock("span", {
|
|
838
|
+
key: 0,
|
|
839
|
+
class: "part",
|
|
840
|
+
"aria-hidden": "true",
|
|
841
|
+
style: normalizeStyle({
|
|
842
|
+
"flex-grow": part.value,
|
|
843
|
+
"background-color": part.color
|
|
844
|
+
})
|
|
845
|
+
}, null, 4)) : createCommentVNode("v-if", true)], 64);
|
|
846
|
+
}), 128)) : createCommentVNode("v-if", true)], 16, _hoisted_1)), [[unref(vPropValidity), {
|
|
633
847
|
contract: propValidityContract,
|
|
634
848
|
values: { ...props }
|
|
635
849
|
}]]);
|
|
636
850
|
};
|
|
637
851
|
}
|
|
638
|
-
}), [["__scopeId", "data-v-
|
|
852
|
+
}), [["__scopeId", "data-v-c308c037"]]);
|
|
639
853
|
//#endregion
|
|
640
854
|
export { UiMeter_default as t };
|
package/vue/components.css
CHANGED
|
@@ -6532,7 +6532,7 @@ svg[data-v-219fa683-s] {
|
|
|
6532
6532
|
syntax: "*";
|
|
6533
6533
|
inherits: false;
|
|
6534
6534
|
}
|
|
6535
|
-
[data-component~="ui-meter"][data-v-
|
|
6535
|
+
[data-component~="ui-meter"][data-v-c308c037] {
|
|
6536
6536
|
--_meter-fill: var(--ui-text-muted);
|
|
6537
6537
|
|
|
6538
6538
|
display: inline-block;
|
|
@@ -6548,30 +6548,30 @@ svg[data-v-219fa683-s] {
|
|
|
6548
6548
|
/* Unseen until forced colours draw it, where the track's own colour is gone. */
|
|
6549
6549
|
outline: var(--ui-border-width) solid transparent;
|
|
6550
6550
|
}
|
|
6551
|
-
[data-component~="ui-meter"][data-ui-meter-state~="size=sm"][data-v-
|
|
6551
|
+
[data-component~="ui-meter"][data-ui-meter-state~="size=sm"][data-v-c308c037] {
|
|
6552
6552
|
inline-size: var(--ui-meter-inline-size, 5rem);
|
|
6553
6553
|
block-size: var(--ui-space-1);
|
|
6554
6554
|
}
|
|
6555
|
-
.fill[data-v-
|
|
6555
|
+
.fill[data-v-c308c037] {
|
|
6556
6556
|
display: block;
|
|
6557
6557
|
block-size: 100%;
|
|
6558
6558
|
background-color: var(--_meter-fill);
|
|
6559
6559
|
background-image: linear-gradient(to bottom, rgb(255 255 255 / 0.26), transparent 70%);
|
|
6560
6560
|
box-shadow: inset 0 1px rgb(255 255 255 / 0.26), inset 0 -1px rgb(0 0 0 / 0.1);
|
|
6561
6561
|
}
|
|
6562
|
-
[data-component~="ui-meter"][data-ui-meter-state~="tone=accent"][data-v-
|
|
6562
|
+
[data-component~="ui-meter"][data-ui-meter-state~="tone=accent"][data-v-c308c037] {
|
|
6563
6563
|
--_meter-fill: var(--ui-accent-solid);
|
|
6564
6564
|
}
|
|
6565
|
-
[data-component~="ui-meter"][data-ui-meter-state~="tone=info"][data-v-
|
|
6565
|
+
[data-component~="ui-meter"][data-ui-meter-state~="tone=info"][data-v-c308c037] {
|
|
6566
6566
|
--_meter-fill: var(--ui-info-solid);
|
|
6567
6567
|
}
|
|
6568
|
-
[data-component~="ui-meter"][data-ui-meter-state~="tone=success"][data-v-
|
|
6568
|
+
[data-component~="ui-meter"][data-ui-meter-state~="tone=success"][data-v-c308c037] {
|
|
6569
6569
|
--_meter-fill: var(--ui-success-solid);
|
|
6570
6570
|
}
|
|
6571
|
-
[data-component~="ui-meter"][data-ui-meter-state~="tone=warning"][data-v-
|
|
6571
|
+
[data-component~="ui-meter"][data-ui-meter-state~="tone=warning"][data-v-c308c037] {
|
|
6572
6572
|
--_meter-fill: var(--ui-warning-solid);
|
|
6573
6573
|
}
|
|
6574
|
-
[data-component~="ui-meter"][data-ui-meter-state~="tone=danger"][data-v-
|
|
6574
|
+
[data-component~="ui-meter"][data-ui-meter-state~="tone=danger"][data-v-c308c037] {
|
|
6575
6575
|
--_meter-fill: var(--ui-danger-solid);
|
|
6576
6576
|
}
|
|
6577
6577
|
|
|
@@ -6583,40 +6583,40 @@ svg[data-v-219fa683-s] {
|
|
|
6583
6583
|
The count arrives as an attribute, not an inline custom property (which would add a style
|
|
6584
6584
|
attribute to every meter), so a continuous meter renders exactly as before, and the rules below
|
|
6585
6585
|
turn it into a number. That caps it at 12, until attr() with a type reads any count in every engine. */
|
|
6586
|
-
[data-component~="ui-meter"][data-ui-meter-segments="2"][data-v-
|
|
6586
|
+
[data-component~="ui-meter"][data-ui-meter-segments="2"][data-v-c308c037] {
|
|
6587
6587
|
--_segments: 2;
|
|
6588
6588
|
}
|
|
6589
|
-
[data-component~="ui-meter"][data-ui-meter-segments="3"][data-v-
|
|
6589
|
+
[data-component~="ui-meter"][data-ui-meter-segments="3"][data-v-c308c037] {
|
|
6590
6590
|
--_segments: 3;
|
|
6591
6591
|
}
|
|
6592
|
-
[data-component~="ui-meter"][data-ui-meter-segments="4"][data-v-
|
|
6592
|
+
[data-component~="ui-meter"][data-ui-meter-segments="4"][data-v-c308c037] {
|
|
6593
6593
|
--_segments: 4;
|
|
6594
6594
|
}
|
|
6595
|
-
[data-component~="ui-meter"][data-ui-meter-segments="5"][data-v-
|
|
6595
|
+
[data-component~="ui-meter"][data-ui-meter-segments="5"][data-v-c308c037] {
|
|
6596
6596
|
--_segments: 5;
|
|
6597
6597
|
}
|
|
6598
|
-
[data-component~="ui-meter"][data-ui-meter-segments="6"][data-v-
|
|
6598
|
+
[data-component~="ui-meter"][data-ui-meter-segments="6"][data-v-c308c037] {
|
|
6599
6599
|
--_segments: 6;
|
|
6600
6600
|
}
|
|
6601
|
-
[data-component~="ui-meter"][data-ui-meter-segments="7"][data-v-
|
|
6601
|
+
[data-component~="ui-meter"][data-ui-meter-segments="7"][data-v-c308c037] {
|
|
6602
6602
|
--_segments: 7;
|
|
6603
6603
|
}
|
|
6604
|
-
[data-component~="ui-meter"][data-ui-meter-segments="8"][data-v-
|
|
6604
|
+
[data-component~="ui-meter"][data-ui-meter-segments="8"][data-v-c308c037] {
|
|
6605
6605
|
--_segments: 8;
|
|
6606
6606
|
}
|
|
6607
|
-
[data-component~="ui-meter"][data-ui-meter-segments="9"][data-v-
|
|
6607
|
+
[data-component~="ui-meter"][data-ui-meter-segments="9"][data-v-c308c037] {
|
|
6608
6608
|
--_segments: 9;
|
|
6609
6609
|
}
|
|
6610
|
-
[data-component~="ui-meter"][data-ui-meter-segments="10"][data-v-
|
|
6610
|
+
[data-component~="ui-meter"][data-ui-meter-segments="10"][data-v-c308c037] {
|
|
6611
6611
|
--_segments: 10;
|
|
6612
6612
|
}
|
|
6613
|
-
[data-component~="ui-meter"][data-ui-meter-segments="11"][data-v-
|
|
6613
|
+
[data-component~="ui-meter"][data-ui-meter-segments="11"][data-v-c308c037] {
|
|
6614
6614
|
--_segments: 11;
|
|
6615
6615
|
}
|
|
6616
|
-
[data-component~="ui-meter"][data-ui-meter-segments="12"][data-v-
|
|
6616
|
+
[data-component~="ui-meter"][data-ui-meter-segments="12"][data-v-c308c037] {
|
|
6617
6617
|
--_segments: 12;
|
|
6618
6618
|
}
|
|
6619
|
-
[data-component~="ui-meter"][data-ui-meter-segments][data-v-
|
|
6619
|
+
[data-component~="ui-meter"][data-ui-meter-segments][data-v-c308c037] {
|
|
6620
6620
|
--_meter-gap: var(--ui-space-1);
|
|
6621
6621
|
--_meter-period: calc((100% + var(--_meter-gap)) / var(--_segments));
|
|
6622
6622
|
--_meter-segment: calc(var(--_meter-period) - var(--_meter-gap));
|
|
@@ -6627,20 +6627,45 @@ svg[data-v-219fa683-s] {
|
|
|
6627
6627
|
transparent 0 var(--_meter-period)
|
|
6628
6628
|
);
|
|
6629
6629
|
}
|
|
6630
|
-
[data-component~="ui-meter"][data-ui-meter-state~="size=sm"][data-ui-meter-segments][data-v-
|
|
6630
|
+
[data-component~="ui-meter"][data-ui-meter-state~="size=sm"][data-ui-meter-segments][data-v-c308c037] {
|
|
6631
6631
|
--_meter-gap: var(--ui-space-0-5);
|
|
6632
6632
|
}
|
|
6633
6633
|
|
|
6634
|
+
/* A categorical distribution uses flex ratios, avoiding rounded percentages and retaining
|
|
6635
|
+
identical geometry before hydration. It has no progress mask or growing-value animation. */
|
|
6636
|
+
[data-component~="ui-meter"][data-ui-meter-state~="variant=distribution"][data-v-c308c037] {
|
|
6637
|
+
display: flex;
|
|
6638
|
+
inline-size: 100%;
|
|
6639
|
+
block-size: var(--ui-space-4);
|
|
6640
|
+
gap: var(--ui-space-0-5);
|
|
6641
|
+
}
|
|
6642
|
+
[data-component~="ui-meter"][data-ui-meter-state~="variant=distribution"][size="sm"][data-v-c308c037] {
|
|
6643
|
+
block-size: var(--ui-space-2);
|
|
6644
|
+
}
|
|
6645
|
+
.part[data-v-c308c037] {
|
|
6646
|
+
flex-basis: 0;
|
|
6647
|
+
min-inline-size: 0;
|
|
6648
|
+
block-size: 100%;
|
|
6649
|
+
}
|
|
6650
|
+
@media (forced-colors: active) {
|
|
6651
|
+
.part[data-v-c308c037] {
|
|
6652
|
+
forced-color-adjust: none;
|
|
6653
|
+
background: CanvasText !important;
|
|
6654
|
+
outline: var(--ui-border-width) solid Canvas;
|
|
6655
|
+
outline-offset: calc(-1 * var(--ui-border-width));
|
|
6656
|
+
}
|
|
6657
|
+
}
|
|
6658
|
+
|
|
6634
6659
|
/* Forced colours drop backgrounds: draw the fill in the text colour inside the outlined track. */
|
|
6635
6660
|
@media (forced-colors: active) {
|
|
6636
|
-
.fill[data-v-
|
|
6661
|
+
.fill[data-v-c308c037] {
|
|
6637
6662
|
forced-color-adjust: none;
|
|
6638
6663
|
background: CanvasText;
|
|
6639
6664
|
}
|
|
6640
6665
|
|
|
6641
6666
|
/* The mask clips the track's outline, so each segment draws its own: the inset shadow draws the
|
|
6642
6667
|
top and bottom edges and the gradient the ends. */
|
|
6643
|
-
[data-component~="ui-meter"][data-ui-meter-segments][data-v-
|
|
6668
|
+
[data-component~="ui-meter"][data-ui-meter-segments][data-v-c308c037] {
|
|
6644
6669
|
forced-color-adjust: none;
|
|
6645
6670
|
background: repeating-linear-gradient(
|
|
6646
6671
|
to right,
|
|
@@ -6654,7 +6679,7 @@ svg[data-v-219fa683-s] {
|
|
|
6654
6679
|
}
|
|
6655
6680
|
|
|
6656
6681
|
/* A component that sets its display still honours the hidden attribute on its root. */
|
|
6657
|
-
[data-component~="ui-meter"][hidden][data-v-
|
|
6682
|
+
[data-component~="ui-meter"][hidden][data-v-c308c037] {
|
|
6658
6683
|
display: none;
|
|
6659
6684
|
}
|
|
6660
6685
|
|