@vunk/plus 1.2.2 → 1.3.1
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/SendOutlined.mjs +2 -2
- package/components/agent-chat-provider/index.d.ts +7 -0
- package/components/agent-chat-provider/index.mjs +789 -0
- package/components/agent-chat-provider/src/api.d.ts +3 -0
- package/components/agent-chat-provider/src/const-roles.d.ts +8 -0
- package/components/agent-chat-provider/src/const.d.ts +1 -0
- package/components/agent-chat-provider/src/index.vue.d.ts +47 -0
- package/components/agent-chat-provider/src/types.d.ts +37 -0
- package/components/agent-chat-provider/src/use.d.ts +29 -0
- package/components/avatar/index.mjs +2 -2
- package/components/avatar/src/ctx.d.ts +4 -4
- package/components/avatar/src/index.vue.d.ts +66 -125
- package/components/broadcasting-markdown/index.css +3 -0
- package/components/broadcasting-markdown/index.d.ts +5 -0
- package/components/broadcasting-markdown/index.mjs +637 -0
- package/components/broadcasting-markdown/src/const.d.ts +18 -0
- package/components/broadcasting-markdown/src/ctx.d.ts +93 -0
- package/components/broadcasting-markdown/src/custom-speech.vue.d.ts +109 -0
- package/components/broadcasting-markdown/src/index.vue.d.ts +477 -0
- package/components/broadcasting-markdown/src/paragraph.vue.d.ts +78 -0
- package/components/broadcasting-markdown/src/speech-error.vue.d.ts +60 -0
- package/components/broadcasting-markdown/src/types.d.ts +17 -0
- package/components/broadcasting-markdown/src/use.d.ts +3 -0
- package/components/broadcasting-markdown/src/web-speech.vue.d.ts +102 -0
- package/components/bubble-list/index.css +18 -0
- package/components/bubble-list/index.d.ts +5 -0
- package/components/bubble-list/index.mjs +386 -0
- package/components/bubble-list/src/ctx.d.ts +30 -0
- package/components/bubble-list/src/index.vue.d.ts +927 -0
- package/components/bubble-list/src/types.d.ts +4 -0
- package/components/bubble-templates/index.css +18 -0
- package/components/bubble-templates/index.d.ts +4 -0
- package/components/bubble-templates/index.mjs +258 -0
- package/components/bubble-templates/src/index.vue.d.ts +631 -0
- package/components/bubble-templates/src/types.d.ts +30 -0
- package/components/chat-independent/index.css +47 -0
- package/components/chat-independent/index.d.ts +4 -0
- package/components/chat-independent/index.mjs +184 -0
- package/components/chat-independent/src/const.d.ts +13 -0
- package/components/chat-independent/src/ctx.d.ts +20 -0
- package/components/chat-independent/src/index.vue.d.ts +2388 -0
- package/components/chat-independent/src/types.d.ts +13 -0
- package/components/index.d.ts +0 -0
- package/components/index.mjs +1 -0
- package/components/index2.mjs +35980 -0
- package/components/lottie-animation/index.mjs +2 -2
- package/components/lottie-animation/src/index.vue.d.ts +1 -1
- package/components/monaco-editor/index.mjs +2 -2
- package/components/monaco-editor/src/ctx.d.ts +3 -3
- package/components/monaco-editor/src/index.vue.d.ts +3 -3
- package/components/monaco-environment/index.mjs +1 -1
- package/components/recorder-button/index.css +7 -10
- package/components/recorder-button/index.mjs +115 -83
- package/components/recorder-button/src/ctx.d.ts +27 -6
- package/components/recorder-button/src/index.vue.d.ts +196 -202
- package/components/recorder-button/src/types.d.ts +1 -0
- package/components/routes-menu-content/index.mjs +5 -5
- package/components/routes-menu-content/src/ctx.d.ts +1 -1
- package/components/routes-menu-content/src/index.vue.d.ts +223 -101
- package/components/routes-menu-content/src/item/core/ctx.d.ts +1 -1
- package/components/routes-menu-content/src/item/core/index.vue.d.ts +175 -53
- package/components/routes-menu-content/src/item/index.vue.d.ts +221 -99
- package/components/sender/index.css +2 -5
- package/components/sender/index.mjs +32 -13
- package/components/sender/src/SenderHeader.vue.d.ts +31 -45
- package/components/sender/src/ctx.d.ts +23 -3
- package/components/sender/src/index.vue.d.ts +170 -124
- package/components/sender/src/types.d.ts +1 -1
- package/components/speech-button/index.mjs +7 -14
- package/components/speech-button/src/ctx.d.ts +1 -1
- package/components/speech-button/src/index.vue.d.ts +3 -3
- package/components/table-columns/index.d.ts +1 -1
- package/components/table-columns/index.mjs +3 -6
- package/components/table-columns/src/ctx.d.ts +8 -8
- package/components/table-columns/src/el-ctx.d.ts +7 -7
- package/components/table-columns/src/index.vue.d.ts +38 -36
- package/components/tables-v1/index.mjs +3 -3
- package/components/tables-v1/src/ctx.d.ts +66 -68
- package/components/tables-v1/src/el-ctx.d.ts +48 -51
- package/components/tables-v1/src/index.vue.d.ts +1950 -1933
- package/components/tables-v1-checkbox/index.mjs +269 -33
- package/components/tables-v1-checkbox/src/ctx.d.ts +65 -67
- package/components/tables-v1-checkbox/src/index.vue.d.ts +2167 -2159
- package/components/typing-markdown/index.mjs +128 -33
- package/components/typing-markdown/src/core.d.ts +2 -3
- package/components/typing-markdown/src/ctx.d.ts +5 -5
- package/components/typing-markdown/src/index.vue.d.ts +9 -9
- package/components/vditor/index.mjs +5 -9
- package/components/vditor/src/ctx.d.ts +2 -2
- package/components/vditor/src/handle-fullscreen.vue.d.ts +3 -3
- package/components/vditor/src/handle-value.vue.d.ts +3 -3
- package/components/vditor/src/index.vue.d.ts +11 -11
- package/composables/el-breakpoints/index.d.ts +1 -1
- package/composables/recorder/index.mjs +751 -182
- package/icons/_plugin-vue_export-helper.mjs +9 -0
- package/icons/end/index.d.ts +4 -0
- package/icons/end/index.mjs +36 -0
- package/icons/end/src/avatar.d.ts +12 -0
- package/icons/end/src/icon.d.ts +57 -0
- package/icons/keyboard/index.d.ts +4 -0
- package/icons/keyboard/index.mjs +36 -0
- package/icons/keyboard/src/avatar.d.ts +12 -0
- package/icons/keyboard/src/icon.d.ts +57 -0
- package/icons/start/index.d.ts +4 -0
- package/icons/start/index.mjs +36 -0
- package/icons/start/src/avatar.d.ts +12 -0
- package/icons/start/src/icon.d.ts +57 -0
- package/icons/voice/index.d.ts +4 -0
- package/icons/voice/index.mjs +51 -0
- package/icons/voice/src/avatar.d.ts +12 -0
- package/icons/voice/src/icon.d.ts +57 -0
- package/icons/voice/src/index.vue.d.ts +4 -0
- package/index.css +99 -15
- package/package.json +51 -7
- package/fetch/PlusFetch/index.d.ts +0 -14
- package/fetch/PlusFetch/index.mjs +0 -638
- package/fetch/PlusFetch/types.d.ts +0 -54
- package/fetch/index.d.ts +0 -1
- package/fetch/index.mjs +0 -5
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { computed, ref, watch, inject, isVNode, Comment, Fragment, shallowRef, watchEffect, provide, onBeforeUnmount, onBeforeMount, toRef, defineComponent, h, createVNode, resolveComponent,
|
|
1
|
+
import { computed, ref, watch, inject, isVNode, Comment, Fragment, shallowRef, watchEffect, provide, onBeforeUnmount, onBeforeMount, toRef, defineComponent, h, createVNode, resolveComponent, createBlock, openBlock, withCtx, mergeProps, toHandlers } from 'vue';
|
|
2
2
|
import { _VkTabelsV1Ctx, VkTablesV1 } from '@vunk/plus/components/tables-v1';
|
|
3
3
|
import { VkCheckRecordLogicProvider, VkCheckRecordLogic } from '@vunk/core';
|
|
4
4
|
import { noop } from '@vunk/shared/function';
|
|
@@ -617,31 +617,203 @@ function createKey(prefix, suffix) {
|
|
|
617
617
|
return prefix + (suffix === 'default' ? '' : suffix.replace(/^[a-z]/, startChar => startChar.toUpperCase()));
|
|
618
618
|
}
|
|
619
619
|
|
|
620
|
+
// src: https://www.w3schools.com/colors/colors_names.asp
|
|
620
621
|
var colors = {
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
622
|
+
aliceblue: "#F0F8FF",
|
|
623
|
+
antiquewhite: "#FAEBD7",
|
|
624
|
+
aqua: "#0FF",
|
|
625
|
+
aquamarine: "#7FFFD4",
|
|
626
|
+
azure: "#F0FFFF",
|
|
627
|
+
beige: "#F5F5DC",
|
|
628
|
+
bisque: "#FFE4C4",
|
|
629
|
+
black: "#000",
|
|
630
|
+
blanchedalmond: "#FFEBCD",
|
|
631
|
+
blue: "#00F",
|
|
632
|
+
blueviolet: "#8A2BE2",
|
|
633
|
+
brown: "#A52A2A",
|
|
634
|
+
burlywood: "#DEB887",
|
|
635
|
+
cadetblue: "#5F9EA0",
|
|
636
|
+
chartreuse: "#7FFF00",
|
|
637
|
+
chocolate: "#D2691E",
|
|
638
|
+
coral: "#FF7F50",
|
|
639
|
+
cornflowerblue: "#6495ED",
|
|
640
|
+
cornsilk: "#FFF8DC",
|
|
641
|
+
crimson: "#DC143C",
|
|
642
|
+
cyan: "#0FF",
|
|
643
|
+
darkblue: "#00008B",
|
|
644
|
+
darkcyan: "#008B8B",
|
|
645
|
+
darkgoldenrod: "#B8860B",
|
|
646
|
+
darkgray: "#A9A9A9",
|
|
647
|
+
darkgrey: "#A9A9A9",
|
|
648
|
+
darkgreen: "#006400",
|
|
649
|
+
darkkhaki: "#BDB76B",
|
|
650
|
+
darkmagenta: "#8B008B",
|
|
651
|
+
darkolivegreen: "#556B2F",
|
|
652
|
+
darkorange: "#FF8C00",
|
|
653
|
+
darkorchid: "#9932CC",
|
|
654
|
+
darkred: "#8B0000",
|
|
655
|
+
darksalmon: "#E9967A",
|
|
656
|
+
darkseagreen: "#8FBC8F",
|
|
657
|
+
darkslateblue: "#483D8B",
|
|
658
|
+
darkslategray: "#2F4F4F",
|
|
659
|
+
darkslategrey: "#2F4F4F",
|
|
660
|
+
darkturquoise: "#00CED1",
|
|
661
|
+
darkviolet: "#9400D3",
|
|
662
|
+
deeppink: "#FF1493",
|
|
663
|
+
deepskyblue: "#00BFFF",
|
|
664
|
+
dimgray: "#696969",
|
|
665
|
+
dimgrey: "#696969",
|
|
666
|
+
dodgerblue: "#1E90FF",
|
|
667
|
+
firebrick: "#B22222",
|
|
668
|
+
floralwhite: "#FFFAF0",
|
|
669
|
+
forestgreen: "#228B22",
|
|
670
|
+
fuchsia: "#F0F",
|
|
671
|
+
gainsboro: "#DCDCDC",
|
|
672
|
+
ghostwhite: "#F8F8FF",
|
|
673
|
+
gold: "#FFD700",
|
|
674
|
+
goldenrod: "#DAA520",
|
|
675
|
+
gray: "#808080",
|
|
676
|
+
grey: "#808080",
|
|
677
|
+
green: "#008000",
|
|
678
|
+
greenyellow: "#ADFF2F",
|
|
679
|
+
honeydew: "#F0FFF0",
|
|
680
|
+
hotpink: "#FF69B4",
|
|
681
|
+
indianred: "#CD5C5C",
|
|
682
|
+
indigo: "#4B0082",
|
|
683
|
+
ivory: "#FFFFF0",
|
|
684
|
+
khaki: "#F0E68C",
|
|
685
|
+
lavender: "#E6E6FA",
|
|
686
|
+
lavenderblush: "#FFF0F5",
|
|
687
|
+
lawngreen: "#7CFC00",
|
|
688
|
+
lemonchiffon: "#FFFACD",
|
|
689
|
+
lightblue: "#ADD8E6",
|
|
690
|
+
lightcoral: "#F08080",
|
|
691
|
+
lightcyan: "#E0FFFF",
|
|
692
|
+
lightgoldenrodyellow: "#FAFAD2",
|
|
693
|
+
lightgray: "#D3D3D3",
|
|
694
|
+
lightgrey: "#D3D3D3",
|
|
695
|
+
lightgreen: "#90EE90",
|
|
696
|
+
lightpink: "#FFB6C1",
|
|
697
|
+
lightsalmon: "#FFA07A",
|
|
698
|
+
lightseagreen: "#20B2AA",
|
|
699
|
+
lightskyblue: "#87CEFA",
|
|
700
|
+
lightslategray: "#778899",
|
|
701
|
+
lightslategrey: "#778899",
|
|
702
|
+
lightsteelblue: "#B0C4DE",
|
|
703
|
+
lightyellow: "#FFFFE0",
|
|
704
|
+
lime: "#0F0",
|
|
705
|
+
limegreen: "#32CD32",
|
|
706
|
+
linen: "#FAF0E6",
|
|
707
|
+
magenta: "#F0F",
|
|
708
|
+
maroon: "#800000",
|
|
709
|
+
mediumaquamarine: "#66CDAA",
|
|
710
|
+
mediumblue: "#0000CD",
|
|
711
|
+
mediumorchid: "#BA55D3",
|
|
712
|
+
mediumpurple: "#9370DB",
|
|
713
|
+
mediumseagreen: "#3CB371",
|
|
714
|
+
mediumslateblue: "#7B68EE",
|
|
715
|
+
mediumspringgreen: "#00FA9A",
|
|
716
|
+
mediumturquoise: "#48D1CC",
|
|
717
|
+
mediumvioletred: "#C71585",
|
|
718
|
+
midnightblue: "#191970",
|
|
719
|
+
mintcream: "#F5FFFA",
|
|
720
|
+
mistyrose: "#FFE4E1",
|
|
721
|
+
moccasin: "#FFE4B5",
|
|
722
|
+
navajowhite: "#FFDEAD",
|
|
723
|
+
navy: "#000080",
|
|
724
|
+
oldlace: "#FDF5E6",
|
|
725
|
+
olive: "#808000",
|
|
726
|
+
olivedrab: "#6B8E23",
|
|
727
|
+
orange: "#FFA500",
|
|
728
|
+
orangered: "#FF4500",
|
|
729
|
+
orchid: "#DA70D6",
|
|
730
|
+
palegoldenrod: "#EEE8AA",
|
|
731
|
+
palegreen: "#98FB98",
|
|
732
|
+
paleturquoise: "#AFEEEE",
|
|
733
|
+
palevioletred: "#DB7093",
|
|
734
|
+
papayawhip: "#FFEFD5",
|
|
735
|
+
peachpuff: "#FFDAB9",
|
|
736
|
+
peru: "#CD853F",
|
|
737
|
+
pink: "#FFC0CB",
|
|
738
|
+
plum: "#DDA0DD",
|
|
739
|
+
powderblue: "#B0E0E6",
|
|
740
|
+
purple: "#800080",
|
|
741
|
+
rebeccapurple: "#663399",
|
|
742
|
+
red: "#F00",
|
|
743
|
+
rosybrown: "#BC8F8F",
|
|
744
|
+
royalblue: "#4169E1",
|
|
745
|
+
saddlebrown: "#8B4513",
|
|
746
|
+
salmon: "#FA8072",
|
|
747
|
+
sandybrown: "#F4A460",
|
|
748
|
+
seagreen: "#2E8B57",
|
|
749
|
+
seashell: "#FFF5EE",
|
|
750
|
+
sienna: "#A0522D",
|
|
751
|
+
silver: "#C0C0C0",
|
|
752
|
+
skyblue: "#87CEEB",
|
|
753
|
+
slateblue: "#6A5ACD",
|
|
754
|
+
slategray: "#708090",
|
|
755
|
+
slategrey: "#708090",
|
|
756
|
+
snow: "#FFFAFA",
|
|
757
|
+
springgreen: "#00FF7F",
|
|
758
|
+
steelblue: "#4682B4",
|
|
759
|
+
tan: "#D2B48C",
|
|
760
|
+
teal: "#008080",
|
|
761
|
+
thistle: "#D8BFD8",
|
|
762
|
+
tomato: "#FF6347",
|
|
763
|
+
turquoise: "#40E0D0",
|
|
764
|
+
violet: "#EE82EE",
|
|
765
|
+
wheat: "#F5DEB3",
|
|
766
|
+
white: "#FFF",
|
|
767
|
+
whitesmoke: "#F5F5F5",
|
|
768
|
+
yellow: "#FF0",
|
|
769
|
+
yellowgreen: "#9ACD32",
|
|
770
|
+
transparent: "#0000"
|
|
638
771
|
};
|
|
639
772
|
|
|
773
|
+
// All the algorithms credit to https://stackoverflow.com/questions/36721830/convert-hsl-to-rgb-and-hex/54014428#54014428
|
|
774
|
+
// original author: Kamil Kiełczewski
|
|
775
|
+
/**
|
|
776
|
+
* @param h 360
|
|
777
|
+
* @param s 100
|
|
778
|
+
* @param l 100
|
|
779
|
+
* @returns [h, s, v] 360, 100, 100
|
|
780
|
+
*/
|
|
781
|
+
/**
|
|
782
|
+
* @param h 360
|
|
783
|
+
* @param s 100
|
|
784
|
+
* @param v 100
|
|
785
|
+
* @returns [r, g, b] 255, 255, 255
|
|
786
|
+
*/
|
|
787
|
+
function hsv2rgb(h, s, v) {
|
|
788
|
+
s /= 100;
|
|
789
|
+
v /= 100;
|
|
790
|
+
let f = (n, k = (n + h / 60) % 6) => v - v * s * Math.max(Math.min(k, 4 - k, 1), 0);
|
|
791
|
+
return [f(5) * 255, f(3) * 255, f(1) * 255];
|
|
792
|
+
}
|
|
793
|
+
/**
|
|
794
|
+
* @param h 360
|
|
795
|
+
* @param s 100
|
|
796
|
+
* @param l 100
|
|
797
|
+
* @returns [255, 255, 255]
|
|
798
|
+
*/
|
|
799
|
+
function hsl2rgb(h, s, l) {
|
|
800
|
+
s /= 100;
|
|
801
|
+
l /= 100;
|
|
802
|
+
let a = s * Math.min(l, 1 - l);
|
|
803
|
+
let f = (n, k = (n + h / 30) % 12) => l - a * Math.max(Math.min(k - 3, 9 - k, 1), -1);
|
|
804
|
+
return [f(0) * 255, f(8) * 255, f(4) * 255];
|
|
805
|
+
}
|
|
806
|
+
|
|
640
807
|
const prefix = '^\\s*';
|
|
641
808
|
const suffix = '\\s*$';
|
|
809
|
+
const percent = '\\s*((\\.\\d+)|(\\d+(\\.\\d*)?))%\\s*'; // 4 offset
|
|
642
810
|
const float = '\\s*((\\.\\d+)|(\\d+(\\.\\d*)?))\\s*'; // 4 offset
|
|
643
811
|
const hex = '([0-9A-Fa-f])';
|
|
644
812
|
const dhex = '([0-9A-Fa-f]{2})';
|
|
813
|
+
const hslRegex = new RegExp(`${prefix}hsl\\s*\\(${float},${percent},${percent}\\)${suffix}`);
|
|
814
|
+
const hsvRegex = new RegExp(`${prefix}hsv\\s*\\(${float},${percent},${percent}\\)${suffix}`);
|
|
815
|
+
const hslaRegex = new RegExp(`${prefix}hsla\\s*\\(${float},${percent},${percent},${float}\\)${suffix}`);
|
|
816
|
+
const hsvaRegex = new RegExp(`${prefix}hsva\\s*\\(${float},${percent},${percent},${float}\\)${suffix}`);
|
|
645
817
|
const rgbRegex = new RegExp(`${prefix}rgb\\s*\\(${float},${float},${float}\\)${suffix}`);
|
|
646
818
|
const rgbaRegex = new RegExp(`${prefix}rgba\\s*\\(${float},${float},${float},${float}\\)${suffix}`);
|
|
647
819
|
const sHexRegex = new RegExp(`${prefix}#${hex}${hex}${hex}${suffix}`);
|
|
@@ -651,9 +823,61 @@ const hexaRegex = new RegExp(`${prefix}#${dhex}${dhex}${dhex}${dhex}${suffix}`);
|
|
|
651
823
|
function parseHex(value) {
|
|
652
824
|
return parseInt(value, 16);
|
|
653
825
|
}
|
|
826
|
+
/**
|
|
827
|
+
* Convert color string to hsla array
|
|
828
|
+
* @param color format like hsl(180, 100%, 100%), hsla(180, 100%, 100%, 1)
|
|
829
|
+
* @returns
|
|
830
|
+
*/
|
|
831
|
+
function hsla(color) {
|
|
832
|
+
try {
|
|
833
|
+
let i;
|
|
834
|
+
if ((i = hslaRegex.exec(color))) {
|
|
835
|
+
return [
|
|
836
|
+
roundDeg(i[1]),
|
|
837
|
+
roundPercent(i[5]),
|
|
838
|
+
roundPercent(i[9]),
|
|
839
|
+
roundAlpha(i[13])
|
|
840
|
+
];
|
|
841
|
+
}
|
|
842
|
+
else if ((i = hslRegex.exec(color))) {
|
|
843
|
+
return [roundDeg(i[1]), roundPercent(i[5]), roundPercent(i[9]), 1];
|
|
844
|
+
}
|
|
845
|
+
throw new Error(`[seemly/hsla]: Invalid color value ${color}.`);
|
|
846
|
+
}
|
|
847
|
+
catch (e) {
|
|
848
|
+
throw e;
|
|
849
|
+
}
|
|
850
|
+
}
|
|
851
|
+
/**
|
|
852
|
+
* Convert color string to hsva array
|
|
853
|
+
* @param color format like hsv(180, 100%, 100%), hsva(180, 100%, 100%, 1)
|
|
854
|
+
* @returns
|
|
855
|
+
*/
|
|
856
|
+
function hsva(color) {
|
|
857
|
+
try {
|
|
858
|
+
let i;
|
|
859
|
+
if ((i = hsvaRegex.exec(color))) {
|
|
860
|
+
return [
|
|
861
|
+
roundDeg(i[1]),
|
|
862
|
+
roundPercent(i[5]),
|
|
863
|
+
roundPercent(i[9]),
|
|
864
|
+
roundAlpha(i[13])
|
|
865
|
+
];
|
|
866
|
+
}
|
|
867
|
+
else if ((i = hsvRegex.exec(color))) {
|
|
868
|
+
return [roundDeg(i[1]), roundPercent(i[5]), roundPercent(i[9]), 1];
|
|
869
|
+
}
|
|
870
|
+
throw new Error(`[seemly/hsva]: Invalid color value ${color}.`);
|
|
871
|
+
}
|
|
872
|
+
catch (e) {
|
|
873
|
+
throw e;
|
|
874
|
+
}
|
|
875
|
+
}
|
|
654
876
|
/**
|
|
655
877
|
* Convert color string to rgba array.
|
|
656
|
-
* @param color format like #000[0], #000000[00], rgb(0, 0, 0),
|
|
878
|
+
* @param color format like #000[0], #000000[00], rgb(0, 0, 0),
|
|
879
|
+
* rgba(0, 0, 0, 0), hsl(a) color, hsv(a) color and color keywords and
|
|
880
|
+
* transparent
|
|
657
881
|
* @returns
|
|
658
882
|
*/
|
|
659
883
|
function rgba(color) {
|
|
@@ -700,6 +924,14 @@ function rgba(color) {
|
|
|
700
924
|
else if (color in colors) {
|
|
701
925
|
return rgba(colors[color]);
|
|
702
926
|
}
|
|
927
|
+
else if (hslRegex.test(color) || hslaRegex.test(color)) {
|
|
928
|
+
const [h, s, l, a] = hsla(color);
|
|
929
|
+
return [...hsl2rgb(h, s, l), a];
|
|
930
|
+
}
|
|
931
|
+
else if (hsvRegex.test(color) || hsvaRegex.test(color)) {
|
|
932
|
+
const [h, s, v, a] = hsva(color);
|
|
933
|
+
return [...hsv2rgb(h, s, v), a];
|
|
934
|
+
}
|
|
703
935
|
throw new Error(`[seemly/rgba]: Invalid color value ${color}.`);
|
|
704
936
|
}
|
|
705
937
|
catch (e) {
|
|
@@ -727,7 +959,7 @@ function composite(background, overlay) {
|
|
|
727
959
|
}
|
|
728
960
|
function changeColor(base, options) {
|
|
729
961
|
const [r, g, b, a = 1] = Array.isArray(base) ? base : rgba(base);
|
|
730
|
-
if (options.alpha) {
|
|
962
|
+
if (typeof options.alpha === 'number') {
|
|
731
963
|
return stringifyRgba(r, g, b, options.alpha);
|
|
732
964
|
}
|
|
733
965
|
return stringifyRgba(r, g, b, a);
|
|
@@ -745,6 +977,14 @@ function roundAlpha(value) {
|
|
|
745
977
|
return 0;
|
|
746
978
|
return v;
|
|
747
979
|
}
|
|
980
|
+
function roundDeg(value) {
|
|
981
|
+
const v = Math.round(Number(value));
|
|
982
|
+
if (v >= 360)
|
|
983
|
+
return 0;
|
|
984
|
+
if (v < 0)
|
|
985
|
+
return 0;
|
|
986
|
+
return v;
|
|
987
|
+
}
|
|
748
988
|
function roundChannel(value) {
|
|
749
989
|
const v = Math.round(Number(value));
|
|
750
990
|
if (v > 255)
|
|
@@ -753,6 +993,14 @@ function roundChannel(value) {
|
|
|
753
993
|
return 0;
|
|
754
994
|
return v;
|
|
755
995
|
}
|
|
996
|
+
function roundPercent(value) {
|
|
997
|
+
const v = Math.round(Number(value));
|
|
998
|
+
if (v > 100)
|
|
999
|
+
return 100;
|
|
1000
|
+
if (v < 0)
|
|
1001
|
+
return 0;
|
|
1002
|
+
return v;
|
|
1003
|
+
}
|
|
756
1004
|
function toRgbaString(base) {
|
|
757
1005
|
const [r, g, b] = base;
|
|
758
1006
|
if (3 in base) {
|
|
@@ -3316,22 +3564,11 @@ const base = {
|
|
|
3316
3564
|
// disabled placeholder
|
|
3317
3565
|
alphaClose: '0.6',
|
|
3318
3566
|
alphaDisabled: '0.5',
|
|
3319
|
-
alphaDisabledInput: '0.02',
|
|
3320
|
-
alphaPending: '0.05',
|
|
3321
|
-
alphaTablePending: '0.02',
|
|
3322
|
-
alphaPressed: '0.07',
|
|
3323
3567
|
alphaAvatar: '0.2',
|
|
3324
|
-
alphaRail: '0.14',
|
|
3325
3568
|
alphaProgressRail: '.08',
|
|
3326
|
-
alphaBorder: '0.12',
|
|
3327
|
-
alphaDivider: '0.06',
|
|
3328
3569
|
alphaInput: '0',
|
|
3329
|
-
alphaAction: '0.02',
|
|
3330
|
-
alphaTab: '0.04',
|
|
3331
3570
|
alphaScrollbar: '0.25',
|
|
3332
3571
|
alphaScrollbarHover: '0.4',
|
|
3333
|
-
alphaCode: '0.05',
|
|
3334
|
-
alphaTag: '0.02',
|
|
3335
3572
|
// primary
|
|
3336
3573
|
primaryHover: '#36ad6a',
|
|
3337
3574
|
primaryDefault: '#18a058',
|
|
@@ -3540,7 +3777,6 @@ function self$1(vars) {
|
|
|
3540
3777
|
});
|
|
3541
3778
|
}
|
|
3542
3779
|
const radioLight = {
|
|
3543
|
-
name: 'Radio',
|
|
3544
3780
|
common: derived,
|
|
3545
3781
|
self: self$1
|
|
3546
3782
|
};
|
|
@@ -4134,7 +4370,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
4134
4370
|
/* STABLE */
|
|
4135
4371
|
}, 8, ["model-value", "oid-field"]);
|
|
4136
4372
|
}
|
|
4137
|
-
var VkTablesV1Checkbox = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]
|
|
4373
|
+
var VkTablesV1Checkbox = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
4138
4374
|
|
|
4139
4375
|
var types = /*#__PURE__*/Object.freeze({
|
|
4140
4376
|
__proto__: null
|