@kg-ui/kg-ui-plus 0.0.1 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/es/KgCopilot/CopiContent/AnswerHead.vue.mjs +16 -0
- package/dist/es/KgCopilot/CopiContent/AnswerHead.vue2.mjs +4 -0
- package/dist/es/KgCopilot/CopiContent/UserHead.vue.mjs +26 -0
- package/dist/es/KgCopilot/CopiContent/UserHead.vue2.mjs +4 -0
- package/dist/es/KgCopilot/CopiFooter/components/NewTheme.vue.mjs +7 -0
- package/dist/es/KgCopilot/CopiFooter/components/NewTheme.vue2.mjs +49 -0
- package/dist/es/KgCopilot/CopiFooter/components/NewTheme.vue3.mjs +4 -0
- package/dist/es/KgCopilot/CopiFooter/components/SearchInput/SelectPlugin.vue.mjs +7 -0
- package/dist/es/KgCopilot/CopiFooter/components/SearchInput/SelectPlugin.vue2.mjs +94 -0
- package/dist/es/KgCopilot/CopiFooter/components/SearchInput/SelectPlugin.vue3.mjs +4 -0
- package/dist/es/KgCopilot/CopiFooter/components/SearchInput/SpeechControl.vue.mjs +7 -0
- package/dist/es/KgCopilot/CopiFooter/components/SearchInput/SpeechControl.vue2.mjs +33 -0
- package/dist/es/KgCopilot/CopiFooter/components/SearchInput/SpeechControl.vue3.mjs +4 -0
- package/dist/es/KgCopilot/CopiFooter/components/SearchInput/Upload.vue.mjs +7 -0
- package/dist/es/KgCopilot/CopiFooter/components/SearchInput/Upload.vue2.mjs +140 -0
- package/dist/es/KgCopilot/CopiFooter/components/SearchInput/Upload.vue3.mjs +4 -0
- package/dist/es/KgCopilot/CopiFooter/components/SearchInput/index.vue.mjs +7 -0
- package/dist/es/KgCopilot/CopiFooter/components/SearchInput/index.vue2.mjs +131 -0
- package/dist/es/KgCopilot/CopiFooter/components/SearchInput/index.vue3.mjs +4 -0
- package/dist/es/KgCopilot/CopiFooter/index.vue.mjs +7 -0
- package/dist/es/KgCopilot/CopiFooter/index.vue2.mjs +21 -0
- package/dist/es/KgCopilot/CopiFooter/index.vue3.mjs +4 -0
- package/dist/es/KgCopilot/dialogue.vue.mjs +7 -0
- package/dist/es/KgCopilot/dialogue.vue2.mjs +131 -0
- package/dist/es/KgCopilot/dialogue.vue3.mjs +4 -0
- package/dist/es/KgCopilot/index.vue.mjs +7 -0
- package/dist/es/KgCopilot/index.vue2.mjs +49 -0
- package/dist/es/KgCopilot/index.vue3.mjs +4 -0
- package/dist/es/KgCopilot/mdInCode.mjs +56 -0
- package/dist/es/KgCopilot/readMd.vue.mjs +7 -0
- package/dist/es/KgCopilot/readMd.vue2.mjs +87 -0
- package/dist/es/KgCopilot/readMd.vue3.mjs +4 -0
- package/dist/es/ReIcon/index.mjs +11 -0
- package/dist/es/ReIcon/src/iconfont.mjs +46 -0
- package/dist/es/ReIcon/src/iconifyIconOffline.mjs +30 -0
- package/dist/es/ReIcon/src/iconifyIconOnline.mjs +29 -0
- package/dist/es/_virtual/___vite-browser-external.mjs +6 -0
- package/dist/es/_virtual/__vite-browser-external.mjs +4 -0
- package/dist/es/_virtual/_commonjsHelpers.mjs +34 -0
- package/dist/es/_virtual/_plugin-vue_export-helper.mjs +10 -0
- package/dist/es/_virtual/index.mjs +13 -0
- package/dist/es/api/project.mjs +51 -0
- package/dist/es/directives/heighlight/index.mjs +69 -0
- package/dist/es/directives/index.mjs +4 -0
- package/dist/es/home/LFilter/FilterArea.vue.mjs +7 -0
- package/dist/es/home/LFilter/FilterArea.vue2.mjs +507 -0
- package/dist/es/home/LFilter/FilterArea.vue3.mjs +4 -0
- package/dist/es/home/LFilter/FilterHead.vue.mjs +129 -0
- package/dist/es/home/LFilter/FilterHead.vue2.mjs +4 -0
- package/dist/es/home/LFilter/FilterItem.vue.mjs +7 -0
- package/dist/es/home/LFilter/FilterItem.vue2.mjs +114 -0
- package/dist/es/home/LFilter/FilterItem.vue3.mjs +4 -0
- package/dist/es/home/LFilter/FilterItemIcon.vue.mjs +7 -0
- package/dist/es/home/LFilter/FilterItemIcon.vue2.mjs +171 -0
- package/dist/es/home/LFilter/FilterItemIcon.vue3.mjs +4 -0
- package/dist/es/home/LFilter/index.vue.mjs +17 -0
- package/dist/es/home/LFilter/index.vue2.mjs +4 -0
- package/dist/es/home/LProject/index.vue.mjs +7 -0
- package/dist/es/home/LProject/index.vue2.mjs +70 -0
- package/dist/es/home/LProject/index.vue3.mjs +4 -0
- package/dist/es/home/index.vue.mjs +7 -0
- package/dist/es/home/index.vue2.mjs +80 -0
- package/dist/es/home/index.vue3.mjs +4 -0
- package/dist/es/index.mjs +36 -0
- package/dist/es/node_modules/.pnpm/@iconify-icons_ep@1.2.7/node_modules/@iconify-icons/ep/check.mjs +8 -0
- package/dist/es/node_modules/.pnpm/@iconify-icons_ep@1.2.7/node_modules/@iconify-icons/ep/circle-plus.mjs +8 -0
- package/dist/es/node_modules/.pnpm/@iconify-icons_ep@1.2.7/node_modules/@iconify-icons/ep/close.mjs +8 -0
- package/dist/es/node_modules/.pnpm/@iconify-icons_ep@1.2.7/node_modules/@iconify-icons/ep/microphone.mjs +8 -0
- package/dist/es/node_modules/.pnpm/@iconify-icons_ep@1.2.7/node_modules/@iconify-icons/ep/paperclip.mjs +8 -0
- package/dist/es/node_modules/.pnpm/@iconify-icons_ep@1.2.7/node_modules/@iconify-icons/ep/promotion.mjs +8 -0
- package/dist/es/node_modules/.pnpm/@iconify-icons_ep@1.2.7/node_modules/@iconify-icons/ep/upload.mjs +8 -0
- package/dist/es/node_modules/.pnpm/@iconify-icons_ph@1.2.5/node_modules/@iconify-icons/ph/copy-simple.mjs +8 -0
- package/dist/es/node_modules/.pnpm/@iconify-icons_ph@1.2.5/node_modules/@iconify-icons/ph/speaker-high-light.mjs +8 -0
- package/dist/es/node_modules/.pnpm/@iconify-icons_ph@1.2.5/node_modules/@iconify-icons/ph/thumbs-down-thin.mjs +8 -0
- package/dist/es/node_modules/.pnpm/@iconify-icons_ph@1.2.5/node_modules/@iconify-icons/ph/thumbs-up-thin.mjs +8 -0
- package/dist/es/node_modules/.pnpm/@iconify-icons_ph@1.2.5/node_modules/@iconify-icons/ph/warning-bold.mjs +8 -0
- package/dist/es/node_modules/.pnpm/@iconify-icons_ri@1.2.3/node_modules/@iconify-icons/ri/add-line.mjs +8 -0
- package/dist/es/node_modules/.pnpm/@iconify-icons_ri@1.2.3/node_modules/@iconify-icons/ri/arrow-down-s-line.mjs +8 -0
- package/dist/es/node_modules/.pnpm/@iconify-icons_ri@1.2.3/node_modules/@iconify-icons/ri/arrow-up-s-line.mjs +8 -0
- package/dist/es/node_modules/.pnpm/@iconify-icons_ri@1.2.3/node_modules/@iconify-icons/ri/check-fill.mjs +8 -0
- package/dist/es/node_modules/.pnpm/@iconify-icons_ri@1.2.3/node_modules/@iconify-icons/ri/download-line.mjs +8 -0
- package/dist/es/node_modules/.pnpm/@iconify-icons_ri@1.2.3/node_modules/@iconify-icons/ri/more-2-fill.mjs +8 -0
- package/dist/es/node_modules/.pnpm/@iconify_vue@4.0.0_vue@3.2.45/node_modules/@iconify/vue/dist/iconify.mjs +1702 -0
- package/dist/es/node_modules/.pnpm/@iconify_vue@4.0.0_vue@3.2.45/node_modules/@iconify/vue/dist/offline.mjs +436 -0
- package/dist/es/node_modules/.pnpm/@pureadmin_utils@1.8.5_vue@3.2.45/node_modules/@pureadmin/utils/dist/index.mjs +70 -0
- package/dist/es/node_modules/.pnpm/call-bind@1.0.7/node_modules/call-bind/callBound.mjs +16 -0
- package/dist/es/node_modules/.pnpm/call-bind@1.0.7/node_modules/call-bind/index.mjs +36 -0
- package/dist/es/node_modules/.pnpm/define-data-property@1.1.4/node_modules/define-data-property/index.mjs +48 -0
- package/dist/es/node_modules/.pnpm/dompurify@3.0.10/node_modules/dompurify/dist/purify.es.mjs +949 -0
- package/dist/es/node_modules/.pnpm/es-define-property@1.0.0/node_modules/es-define-property/index.mjs +22 -0
- package/dist/es/node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/eval.mjs +4 -0
- package/dist/es/node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/index.mjs +4 -0
- package/dist/es/node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/range.mjs +4 -0
- package/dist/es/node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/ref.mjs +4 -0
- package/dist/es/node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/syntax.mjs +4 -0
- package/dist/es/node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/type.mjs +4 -0
- package/dist/es/node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/uri.mjs +4 -0
- package/dist/es/node_modules/.pnpm/function-bind@1.1.2/node_modules/function-bind/implementation.mjs +72 -0
- package/dist/es/node_modules/.pnpm/function-bind@1.1.2/node_modules/function-bind/index.mjs +6 -0
- package/dist/es/node_modules/.pnpm/get-intrinsic@1.2.4/node_modules/get-intrinsic/index.mjs +320 -0
- package/dist/es/node_modules/.pnpm/gopd@1.0.1/node_modules/gopd/index.mjs +14 -0
- package/dist/es/node_modules/.pnpm/has-property-descriptors@1.0.2/node_modules/has-property-descriptors/index.mjs +19 -0
- package/dist/es/node_modules/.pnpm/has-proto@1.0.3/node_modules/has-proto/index.mjs +11 -0
- package/dist/es/node_modules/.pnpm/has-symbols@1.0.3/node_modules/has-symbols/index.mjs +21 -0
- package/dist/es/node_modules/.pnpm/has-symbols@1.0.3/node_modules/has-symbols/shams.mjs +48 -0
- package/dist/es/node_modules/.pnpm/hasown@2.0.2/node_modules/hasown/index.mjs +8 -0
- package/dist/es/node_modules/.pnpm/highlight.js@11.9.0/node_modules/highlight.js/es/core.mjs +5 -0
- package/dist/es/node_modules/.pnpm/highlight.js@11.9.0/node_modules/highlight.js/es/languages/apache.mjs +91 -0
- package/dist/es/node_modules/.pnpm/highlight.js@11.9.0/node_modules/highlight.js/es/languages/bash.mjs +377 -0
- package/dist/es/node_modules/.pnpm/highlight.js@11.9.0/node_modules/highlight.js/es/languages/basic.mjs +221 -0
- package/dist/es/node_modules/.pnpm/highlight.js@11.9.0/node_modules/highlight.js/es/languages/c.mjs +280 -0
- package/dist/es/node_modules/.pnpm/highlight.js@11.9.0/node_modules/highlight.js/es/languages/css.mjs +732 -0
- package/dist/es/node_modules/.pnpm/highlight.js@11.9.0/node_modules/highlight.js/es/languages/dart.mjs +247 -0
- package/dist/es/node_modules/.pnpm/highlight.js@11.9.0/node_modules/highlight.js/es/languages/django.mjs +47 -0
- package/dist/es/node_modules/.pnpm/highlight.js@11.9.0/node_modules/highlight.js/es/languages/dns.mjs +71 -0
- package/dist/es/node_modules/.pnpm/highlight.js@11.9.0/node_modules/highlight.js/es/languages/dos.mjs +160 -0
- package/dist/es/node_modules/.pnpm/highlight.js@11.9.0/node_modules/highlight.js/es/languages/dust.mjs +38 -0
- package/dist/es/node_modules/.pnpm/highlight.js@11.9.0/node_modules/highlight.js/es/languages/erlang.mjs +176 -0
- package/dist/es/node_modules/.pnpm/highlight.js@11.9.0/node_modules/highlight.js/es/languages/go.mjs +135 -0
- package/dist/es/node_modules/.pnpm/highlight.js@11.9.0/node_modules/highlight.js/es/languages/http.mjs +89 -0
- package/dist/es/node_modules/.pnpm/highlight.js@11.9.0/node_modules/highlight.js/es/languages/java.mjs +254 -0
- package/dist/es/node_modules/.pnpm/highlight.js@11.9.0/node_modules/highlight.js/es/languages/javascript.mjs +698 -0
- package/dist/es/node_modules/.pnpm/highlight.js@11.9.0/node_modules/highlight.js/es/languages/json.mjs +40 -0
- package/dist/es/node_modules/.pnpm/highlight.js@11.9.0/node_modules/highlight.js/es/languages/markdown.mjs +227 -0
- package/dist/es/node_modules/.pnpm/highlight.js@11.9.0/node_modules/highlight.js/es/languages/nginx.mjs +144 -0
- package/dist/es/node_modules/.pnpm/highlight.js@11.9.0/node_modules/highlight.js/es/languages/php.mjs +589 -0
- package/dist/es/node_modules/.pnpm/highlight.js@11.9.0/node_modules/highlight.js/es/languages/python.mjs +414 -0
- package/dist/es/node_modules/.pnpm/highlight.js@11.9.0/node_modules/highlight.js/es/languages/ruby.mjs +414 -0
- package/dist/es/node_modules/.pnpm/highlight.js@11.9.0/node_modules/highlight.js/es/languages/stylus.mjs +766 -0
- package/dist/es/node_modules/.pnpm/highlight.js@11.9.0/node_modules/highlight.js/es/languages/swift.mjs +832 -0
- package/dist/es/node_modules/.pnpm/highlight.js@11.9.0/node_modules/highlight.js/es/languages/typescript.mjs +788 -0
- package/dist/es/node_modules/.pnpm/highlight.js@11.9.0/node_modules/highlight.js/es/languages/xml.mjs +227 -0
- package/dist/es/node_modules/.pnpm/highlight.js@11.9.0/node_modules/highlight.js/lib/core.mjs +1580 -0
- package/dist/es/node_modules/.pnpm/highlight.js@11.9.0/node_modules/highlight.js/styles/paraiso-light.css.mjs +4 -0
- package/dist/es/node_modules/.pnpm/marked@12.0.1/node_modules/marked/lib/marked.esm.mjs +2045 -0
- package/dist/es/node_modules/.pnpm/object-inspect@1.13.1/node_modules/object-inspect/index.mjs +514 -0
- package/dist/es/node_modules/.pnpm/pinyin-match@1.2.4/node_modules/pinyin-match/es/main.mjs +124 -0
- package/dist/es/node_modules/.pnpm/qs@6.11.0/node_modules/qs/lib/formats.mjs +22 -0
- package/dist/es/node_modules/.pnpm/qs@6.11.0/node_modules/qs/lib/index.mjs +14 -0
- package/dist/es/node_modules/.pnpm/qs@6.11.0/node_modules/qs/lib/parse.mjs +199 -0
- package/dist/es/node_modules/.pnpm/qs@6.11.0/node_modules/qs/lib/stringify.mjs +262 -0
- package/dist/es/node_modules/.pnpm/qs@6.11.0/node_modules/qs/lib/utils.mjs +196 -0
- package/dist/es/node_modules/.pnpm/set-function-length@1.2.2/node_modules/set-function-length/index.mjs +54 -0
- package/dist/es/node_modules/.pnpm/side-channel@1.0.6/node_modules/side-channel/index.mjs +115 -0
- package/dist/es/store/index.mjs +8 -0
- package/dist/es/store/modules/copilot.mjs +108 -0
- package/dist/es/store/modules/filters.mjs +346 -0
- package/dist/es/store/modules/types.mjs +19 -0
- package/dist/es/style/index.scss.mjs +4 -0
- package/dist/es/style/tailwind.css.mjs +4 -0
- package/dist/es/style.css +1 -0
- package/dist/es/utils/home.mjs +129 -0
- package/dist/es/utils/http/index.mjs +90 -0
- package/dist/es/utils/message.mjs +42 -0
- package/package.json +1 -1
@@ -0,0 +1,436 @@
|
|
1
|
+
import { defineComponent, h } from "vue";
|
2
|
+
const defaultIconDimensions = Object.freeze(
|
3
|
+
{
|
4
|
+
left: 0,
|
5
|
+
top: 0,
|
6
|
+
width: 16,
|
7
|
+
height: 16
|
8
|
+
}
|
9
|
+
);
|
10
|
+
const defaultIconTransformations = Object.freeze({
|
11
|
+
rotate: 0,
|
12
|
+
vFlip: false,
|
13
|
+
hFlip: false
|
14
|
+
});
|
15
|
+
const defaultIconProps = Object.freeze({
|
16
|
+
...defaultIconDimensions,
|
17
|
+
...defaultIconTransformations
|
18
|
+
});
|
19
|
+
Object.freeze({
|
20
|
+
...defaultIconProps,
|
21
|
+
body: "",
|
22
|
+
hidden: false
|
23
|
+
});
|
24
|
+
({
|
25
|
+
provider: "",
|
26
|
+
aliases: {},
|
27
|
+
not_found: {},
|
28
|
+
...defaultIconDimensions
|
29
|
+
});
|
30
|
+
const defaultIconSizeCustomisations = Object.freeze({
|
31
|
+
width: null,
|
32
|
+
height: null
|
33
|
+
});
|
34
|
+
const defaultIconCustomisations = Object.freeze({
|
35
|
+
...defaultIconSizeCustomisations,
|
36
|
+
...defaultIconTransformations
|
37
|
+
});
|
38
|
+
function mergeCustomisations(defaults, item) {
|
39
|
+
const result = {
|
40
|
+
...defaults
|
41
|
+
};
|
42
|
+
for (const key in item) {
|
43
|
+
const value = item[key];
|
44
|
+
const valueType = typeof value;
|
45
|
+
if (key in defaultIconSizeCustomisations) {
|
46
|
+
if (value === null || value && (valueType === "string" || valueType === "number")) {
|
47
|
+
result[key] = value;
|
48
|
+
}
|
49
|
+
} else if (valueType === typeof result[key]) {
|
50
|
+
result[key] = key === "rotate" ? value % 4 : value;
|
51
|
+
}
|
52
|
+
}
|
53
|
+
return result;
|
54
|
+
}
|
55
|
+
const separator = /[\s,]+/;
|
56
|
+
function flipFromString(custom, flip) {
|
57
|
+
flip.split(separator).forEach((str) => {
|
58
|
+
const value = str.trim();
|
59
|
+
switch (value) {
|
60
|
+
case "horizontal":
|
61
|
+
custom.hFlip = true;
|
62
|
+
break;
|
63
|
+
case "vertical":
|
64
|
+
custom.vFlip = true;
|
65
|
+
break;
|
66
|
+
}
|
67
|
+
});
|
68
|
+
}
|
69
|
+
function rotateFromString(value, defaultValue = 0) {
|
70
|
+
const units = value.replace(/^-?[0-9.]*/, "");
|
71
|
+
function cleanup(value2) {
|
72
|
+
while (value2 < 0) {
|
73
|
+
value2 += 4;
|
74
|
+
}
|
75
|
+
return value2 % 4;
|
76
|
+
}
|
77
|
+
if (units === "") {
|
78
|
+
const num = parseInt(value);
|
79
|
+
return isNaN(num) ? 0 : cleanup(num);
|
80
|
+
} else if (units !== value) {
|
81
|
+
let split = 0;
|
82
|
+
switch (units) {
|
83
|
+
case "%":
|
84
|
+
split = 25;
|
85
|
+
break;
|
86
|
+
case "deg":
|
87
|
+
split = 90;
|
88
|
+
}
|
89
|
+
if (split) {
|
90
|
+
let num = parseFloat(value.slice(0, value.length - units.length));
|
91
|
+
if (isNaN(num)) {
|
92
|
+
return 0;
|
93
|
+
}
|
94
|
+
num = num / split;
|
95
|
+
return num % 1 === 0 ? cleanup(num) : 0;
|
96
|
+
}
|
97
|
+
}
|
98
|
+
return defaultValue;
|
99
|
+
}
|
100
|
+
const unitsSplit = /(-?[0-9.]*[0-9]+[0-9.]*)/g;
|
101
|
+
const unitsTest = /^-?[0-9.]*[0-9]+[0-9.]*$/g;
|
102
|
+
function calculateSize(size, ratio, precision) {
|
103
|
+
if (ratio === 1) {
|
104
|
+
return size;
|
105
|
+
}
|
106
|
+
precision = precision || 100;
|
107
|
+
if (typeof size === "number") {
|
108
|
+
return Math.ceil(size * ratio * precision) / precision;
|
109
|
+
}
|
110
|
+
if (typeof size !== "string") {
|
111
|
+
return size;
|
112
|
+
}
|
113
|
+
const oldParts = size.split(unitsSplit);
|
114
|
+
if (oldParts === null || !oldParts.length) {
|
115
|
+
return size;
|
116
|
+
}
|
117
|
+
const newParts = [];
|
118
|
+
let code = oldParts.shift();
|
119
|
+
let isNumber = unitsTest.test(code);
|
120
|
+
while (true) {
|
121
|
+
if (isNumber) {
|
122
|
+
const num = parseFloat(code);
|
123
|
+
if (isNaN(num)) {
|
124
|
+
newParts.push(code);
|
125
|
+
} else {
|
126
|
+
newParts.push(Math.ceil(num * ratio * precision) / precision);
|
127
|
+
}
|
128
|
+
} else {
|
129
|
+
newParts.push(code);
|
130
|
+
}
|
131
|
+
code = oldParts.shift();
|
132
|
+
if (code === void 0) {
|
133
|
+
return newParts.join("");
|
134
|
+
}
|
135
|
+
isNumber = !isNumber;
|
136
|
+
}
|
137
|
+
}
|
138
|
+
function iconToSVG(icon, customisations) {
|
139
|
+
const fullIcon = {
|
140
|
+
...defaultIconProps,
|
141
|
+
...icon
|
142
|
+
};
|
143
|
+
const fullCustomisations = {
|
144
|
+
...defaultIconCustomisations,
|
145
|
+
...customisations
|
146
|
+
};
|
147
|
+
const box = {
|
148
|
+
left: fullIcon.left,
|
149
|
+
top: fullIcon.top,
|
150
|
+
width: fullIcon.width,
|
151
|
+
height: fullIcon.height
|
152
|
+
};
|
153
|
+
let body = fullIcon.body;
|
154
|
+
[fullIcon, fullCustomisations].forEach((props) => {
|
155
|
+
const transformations = [];
|
156
|
+
const hFlip = props.hFlip;
|
157
|
+
const vFlip = props.vFlip;
|
158
|
+
let rotation = props.rotate;
|
159
|
+
if (hFlip) {
|
160
|
+
if (vFlip) {
|
161
|
+
rotation += 2;
|
162
|
+
} else {
|
163
|
+
transformations.push(
|
164
|
+
"translate(" + (box.width + box.left).toString() + " " + (0 - box.top).toString() + ")"
|
165
|
+
);
|
166
|
+
transformations.push("scale(-1 1)");
|
167
|
+
box.top = box.left = 0;
|
168
|
+
}
|
169
|
+
} else if (vFlip) {
|
170
|
+
transformations.push(
|
171
|
+
"translate(" + (0 - box.left).toString() + " " + (box.height + box.top).toString() + ")"
|
172
|
+
);
|
173
|
+
transformations.push("scale(1 -1)");
|
174
|
+
box.top = box.left = 0;
|
175
|
+
}
|
176
|
+
let tempValue;
|
177
|
+
if (rotation < 0) {
|
178
|
+
rotation -= Math.floor(rotation / 4) * 4;
|
179
|
+
}
|
180
|
+
rotation = rotation % 4;
|
181
|
+
switch (rotation) {
|
182
|
+
case 1:
|
183
|
+
tempValue = box.height / 2 + box.top;
|
184
|
+
transformations.unshift(
|
185
|
+
"rotate(90 " + tempValue.toString() + " " + tempValue.toString() + ")"
|
186
|
+
);
|
187
|
+
break;
|
188
|
+
case 2:
|
189
|
+
transformations.unshift(
|
190
|
+
"rotate(180 " + (box.width / 2 + box.left).toString() + " " + (box.height / 2 + box.top).toString() + ")"
|
191
|
+
);
|
192
|
+
break;
|
193
|
+
case 3:
|
194
|
+
tempValue = box.width / 2 + box.left;
|
195
|
+
transformations.unshift(
|
196
|
+
"rotate(-90 " + tempValue.toString() + " " + tempValue.toString() + ")"
|
197
|
+
);
|
198
|
+
break;
|
199
|
+
}
|
200
|
+
if (rotation % 2 === 1) {
|
201
|
+
if (box.left !== box.top) {
|
202
|
+
tempValue = box.left;
|
203
|
+
box.left = box.top;
|
204
|
+
box.top = tempValue;
|
205
|
+
}
|
206
|
+
if (box.width !== box.height) {
|
207
|
+
tempValue = box.width;
|
208
|
+
box.width = box.height;
|
209
|
+
box.height = tempValue;
|
210
|
+
}
|
211
|
+
}
|
212
|
+
if (transformations.length) {
|
213
|
+
body = '<g transform="' + transformations.join(" ") + '">' + body + "</g>";
|
214
|
+
}
|
215
|
+
});
|
216
|
+
const customisationsWidth = fullCustomisations.width;
|
217
|
+
const customisationsHeight = fullCustomisations.height;
|
218
|
+
const boxWidth = box.width;
|
219
|
+
const boxHeight = box.height;
|
220
|
+
let width;
|
221
|
+
let height;
|
222
|
+
if (customisationsWidth === null) {
|
223
|
+
height = customisationsHeight === null ? "1em" : customisationsHeight === "auto" ? boxHeight : customisationsHeight;
|
224
|
+
width = calculateSize(height, boxWidth / boxHeight);
|
225
|
+
} else {
|
226
|
+
width = customisationsWidth === "auto" ? boxWidth : customisationsWidth;
|
227
|
+
height = customisationsHeight === null ? calculateSize(width, boxHeight / boxWidth) : customisationsHeight === "auto" ? boxHeight : customisationsHeight;
|
228
|
+
}
|
229
|
+
const result = {
|
230
|
+
attributes: {
|
231
|
+
width: width.toString(),
|
232
|
+
height: height.toString(),
|
233
|
+
viewBox: box.left.toString() + " " + box.top.toString() + " " + boxWidth.toString() + " " + boxHeight.toString()
|
234
|
+
},
|
235
|
+
body
|
236
|
+
};
|
237
|
+
return result;
|
238
|
+
}
|
239
|
+
const regex = /\sid="(\S+)"/g;
|
240
|
+
const randomPrefix = "IconifyId" + Date.now().toString(16) + (Math.random() * 16777216 | 0).toString(16);
|
241
|
+
let counter = 0;
|
242
|
+
function replaceIDs(body, prefix = randomPrefix) {
|
243
|
+
const ids = [];
|
244
|
+
let match;
|
245
|
+
while (match = regex.exec(body)) {
|
246
|
+
ids.push(match[1]);
|
247
|
+
}
|
248
|
+
if (!ids.length) {
|
249
|
+
return body;
|
250
|
+
}
|
251
|
+
ids.forEach((id) => {
|
252
|
+
const newID = typeof prefix === "function" ? prefix(id) : prefix + (counter++).toString();
|
253
|
+
const escapedID = id.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
254
|
+
body = body.replace(
|
255
|
+
new RegExp('([#;"])(' + escapedID + ')([")]|\\.[a-z])', "g"),
|
256
|
+
"$1" + newID + "$3"
|
257
|
+
);
|
258
|
+
});
|
259
|
+
return body;
|
260
|
+
}
|
261
|
+
function iconToHTML(body, attributes) {
|
262
|
+
let renderAttribsHTML = body.indexOf("xlink:") === -1 ? "" : ' xmlns:xlink="http://www.w3.org/1999/xlink"';
|
263
|
+
for (const attr in attributes) {
|
264
|
+
renderAttribsHTML += " " + attr + '="' + attributes[attr] + '"';
|
265
|
+
}
|
266
|
+
return '<svg xmlns="http://www.w3.org/2000/svg"' + renderAttribsHTML + ">" + body + "</svg>";
|
267
|
+
}
|
268
|
+
function encodeSVGforURL(svg) {
|
269
|
+
return svg.replace(/"/g, "'").replace(/%/g, "%25").replace(/#/g, "%23").replace(/</g, "%3C").replace(/>/g, "%3E").replace(/\s+/g, " ");
|
270
|
+
}
|
271
|
+
function svgToURL(svg) {
|
272
|
+
return 'url("data:image/svg+xml,' + encodeSVGforURL(svg) + '")';
|
273
|
+
}
|
274
|
+
const defaultExtendedIconCustomisations = {
|
275
|
+
...defaultIconCustomisations,
|
276
|
+
inline: false
|
277
|
+
};
|
278
|
+
const svgDefaults = {
|
279
|
+
"xmlns": "http://www.w3.org/2000/svg",
|
280
|
+
"xmlns:xlink": "http://www.w3.org/1999/xlink",
|
281
|
+
"aria-hidden": true,
|
282
|
+
"role": "img"
|
283
|
+
};
|
284
|
+
const commonProps = {
|
285
|
+
display: "inline-block"
|
286
|
+
};
|
287
|
+
const monotoneProps = {
|
288
|
+
backgroundColor: "currentColor"
|
289
|
+
};
|
290
|
+
const coloredProps = {
|
291
|
+
backgroundColor: "transparent"
|
292
|
+
};
|
293
|
+
const propsToAdd = {
|
294
|
+
Image: "var(--svg)",
|
295
|
+
Repeat: "no-repeat",
|
296
|
+
Size: "100% 100%"
|
297
|
+
};
|
298
|
+
const propsToAddTo = {
|
299
|
+
webkitMask: monotoneProps,
|
300
|
+
mask: monotoneProps,
|
301
|
+
background: coloredProps
|
302
|
+
};
|
303
|
+
for (const prefix in propsToAddTo) {
|
304
|
+
const list = propsToAddTo[prefix];
|
305
|
+
for (const prop in propsToAdd) {
|
306
|
+
list[prefix + prop] = propsToAdd[prop];
|
307
|
+
}
|
308
|
+
}
|
309
|
+
const customisationAliases = {};
|
310
|
+
["horizontal", "vertical"].forEach((prefix) => {
|
311
|
+
const attr = prefix.slice(0, 1) + "Flip";
|
312
|
+
customisationAliases[prefix + "-flip"] = attr;
|
313
|
+
customisationAliases[prefix.slice(0, 1) + "-flip"] = attr;
|
314
|
+
customisationAliases[prefix + "Flip"] = attr;
|
315
|
+
});
|
316
|
+
function fixSize(value) {
|
317
|
+
return value + (value.match(/^[-0-9.]+$/) ? "px" : "");
|
318
|
+
}
|
319
|
+
const render = (icon, props) => {
|
320
|
+
const customisations = mergeCustomisations(defaultExtendedIconCustomisations, props);
|
321
|
+
const componentProps = { ...svgDefaults };
|
322
|
+
const mode = props.mode || "svg";
|
323
|
+
const style = {};
|
324
|
+
const propsStyle = props.style;
|
325
|
+
const customStyle = typeof propsStyle === "object" && !(propsStyle instanceof Array) ? propsStyle : {};
|
326
|
+
for (let key in props) {
|
327
|
+
const value = props[key];
|
328
|
+
if (value === void 0) {
|
329
|
+
continue;
|
330
|
+
}
|
331
|
+
switch (key) {
|
332
|
+
case "icon":
|
333
|
+
case "style":
|
334
|
+
case "onLoad":
|
335
|
+
case "mode":
|
336
|
+
break;
|
337
|
+
case "inline":
|
338
|
+
case "hFlip":
|
339
|
+
case "vFlip":
|
340
|
+
customisations[key] = value === true || value === "true" || value === 1;
|
341
|
+
break;
|
342
|
+
case "flip":
|
343
|
+
if (typeof value === "string") {
|
344
|
+
flipFromString(customisations, value);
|
345
|
+
}
|
346
|
+
break;
|
347
|
+
case "color":
|
348
|
+
style.color = value;
|
349
|
+
break;
|
350
|
+
case "rotate":
|
351
|
+
if (typeof value === "string") {
|
352
|
+
customisations[key] = rotateFromString(value);
|
353
|
+
} else if (typeof value === "number") {
|
354
|
+
customisations[key] = value;
|
355
|
+
}
|
356
|
+
break;
|
357
|
+
case "ariaHidden":
|
358
|
+
case "aria-hidden":
|
359
|
+
if (value !== true && value !== "true") {
|
360
|
+
delete componentProps["aria-hidden"];
|
361
|
+
}
|
362
|
+
break;
|
363
|
+
default: {
|
364
|
+
const alias = customisationAliases[key];
|
365
|
+
if (alias) {
|
366
|
+
if (value === true || value === "true" || value === 1) {
|
367
|
+
customisations[alias] = true;
|
368
|
+
}
|
369
|
+
} else if (defaultExtendedIconCustomisations[key] === void 0) {
|
370
|
+
componentProps[key] = value;
|
371
|
+
}
|
372
|
+
}
|
373
|
+
}
|
374
|
+
}
|
375
|
+
const item = iconToSVG(icon, customisations);
|
376
|
+
const renderAttribs = item.attributes;
|
377
|
+
if (customisations.inline) {
|
378
|
+
style.verticalAlign = "-0.125em";
|
379
|
+
}
|
380
|
+
if (mode === "svg") {
|
381
|
+
componentProps.style = {
|
382
|
+
...style,
|
383
|
+
...customStyle
|
384
|
+
};
|
385
|
+
Object.assign(componentProps, renderAttribs);
|
386
|
+
let localCounter = 0;
|
387
|
+
let id = props.id;
|
388
|
+
if (typeof id === "string") {
|
389
|
+
id = id.replace(/-/g, "_");
|
390
|
+
}
|
391
|
+
componentProps["innerHTML"] = replaceIDs(item.body, id ? () => id + "ID" + localCounter++ : "iconifyVue");
|
392
|
+
return h("svg", componentProps);
|
393
|
+
}
|
394
|
+
const { body, width, height } = icon;
|
395
|
+
const useMask = mode === "mask" || (mode === "bg" ? false : body.indexOf("currentColor") !== -1);
|
396
|
+
const html = iconToHTML(body, {
|
397
|
+
...renderAttribs,
|
398
|
+
width: width + "",
|
399
|
+
height: height + ""
|
400
|
+
});
|
401
|
+
componentProps.style = {
|
402
|
+
...style,
|
403
|
+
"--svg": svgToURL(html),
|
404
|
+
"width": fixSize(renderAttribs.width),
|
405
|
+
"height": fixSize(renderAttribs.height),
|
406
|
+
...commonProps,
|
407
|
+
...useMask ? monotoneProps : coloredProps,
|
408
|
+
...customStyle
|
409
|
+
};
|
410
|
+
return h("span", componentProps);
|
411
|
+
};
|
412
|
+
const storage = /* @__PURE__ */ Object.create(null);
|
413
|
+
function addIcon(name, data) {
|
414
|
+
storage[name] = data;
|
415
|
+
}
|
416
|
+
const Icon = defineComponent({
|
417
|
+
// Do not inherit other attributes: it is handled by render()
|
418
|
+
inheritAttrs: false,
|
419
|
+
// Render icon
|
420
|
+
render() {
|
421
|
+
const props = this.$attrs;
|
422
|
+
const propsIcon = props.icon;
|
423
|
+
const icon = typeof propsIcon === "string" ? storage[propsIcon] : typeof propsIcon === "object" ? propsIcon : null;
|
424
|
+
if (icon === null || typeof icon !== "object" || typeof icon.body !== "string") {
|
425
|
+
return this.$slots.default ? this.$slots.default() : null;
|
426
|
+
}
|
427
|
+
return render({
|
428
|
+
...defaultIconProps,
|
429
|
+
...icon
|
430
|
+
}, props);
|
431
|
+
}
|
432
|
+
});
|
433
|
+
export {
|
434
|
+
Icon,
|
435
|
+
addIcon
|
436
|
+
};
|
@@ -0,0 +1,70 @@
|
|
1
|
+
import * as __viteBrowserExternal from "../../../../../../../_virtual/__vite-browser-external.mjs";
|
2
|
+
import * as se from "vue";
|
3
|
+
var at = Object.defineProperty;
|
4
|
+
var It = Object.getOwnPropertyDescriptor;
|
5
|
+
var Ut = Object.getOwnPropertyNames;
|
6
|
+
var Pt = Object.prototype.hasOwnProperty;
|
7
|
+
var ct = (t, n) => {
|
8
|
+
for (var e in n)
|
9
|
+
at(t, e, { get: n[e], enumerable: true });
|
10
|
+
}, it = (t, n, e, r) => {
|
11
|
+
if (n && typeof n == "object" || typeof n == "function")
|
12
|
+
for (let o of Ut(n))
|
13
|
+
!Pt.call(t, o) && o !== e && at(t, o, { get: () => n[o], enumerable: !(r = It(n, o)) || r.enumerable });
|
14
|
+
return t;
|
15
|
+
}, D = (t, n, e) => (it(t, n, "default"), e && it(e, n, "default"));
|
16
|
+
var Bt = Object.prototype.toString;
|
17
|
+
function O(t, n) {
|
18
|
+
return Bt.call(t) === `[object ${n}]`;
|
19
|
+
}
|
20
|
+
function H(t) {
|
21
|
+
return t !== null && O(t, "Object");
|
22
|
+
}
|
23
|
+
function R(t) {
|
24
|
+
return typeof t < "u";
|
25
|
+
}
|
26
|
+
function dt(t) {
|
27
|
+
return !R(t);
|
28
|
+
}
|
29
|
+
function gt(t) {
|
30
|
+
return t === null;
|
31
|
+
}
|
32
|
+
function Nt(t) {
|
33
|
+
return gt(t) || dt(t);
|
34
|
+
}
|
35
|
+
function Ft(t) {
|
36
|
+
return Q(t) || S(t) ? t.length === 0 : t instanceof Map || t instanceof Set ? t.size === 0 : H(t) ? Object.keys(t).length === 0 : false;
|
37
|
+
}
|
38
|
+
function B(t) {
|
39
|
+
return !!(Ft(t) || Nt(t));
|
40
|
+
}
|
41
|
+
function S(t) {
|
42
|
+
return O(t, "String");
|
43
|
+
}
|
44
|
+
function mt(t) {
|
45
|
+
return typeof t == "function";
|
46
|
+
}
|
47
|
+
function Q(t) {
|
48
|
+
return t && Array.isArray(t);
|
49
|
+
}
|
50
|
+
var I = (t = 20) => new Promise((n) => setTimeout(n, t));
|
51
|
+
var A = {};
|
52
|
+
ct(A, { Fs: () => __viteBrowserExternal });
|
53
|
+
D(A, __viteBrowserExternal);
|
54
|
+
var i = {};
|
55
|
+
ct(i, { Vue: () => se });
|
56
|
+
D(i, se);
|
57
|
+
export {
|
58
|
+
I as delay,
|
59
|
+
O as is,
|
60
|
+
B as isAllEmpty,
|
61
|
+
Q as isArray,
|
62
|
+
R as isDef,
|
63
|
+
Ft as isEmpty,
|
64
|
+
mt as isFunction,
|
65
|
+
gt as isNull,
|
66
|
+
Nt as isNullOrUnDef,
|
67
|
+
H as isObject,
|
68
|
+
S as isString,
|
69
|
+
dt as isUnDef
|
70
|
+
};
|
@@ -0,0 +1,16 @@
|
|
1
|
+
import getIntrinsic from "../../../get-intrinsic@1.2.4/node_modules/get-intrinsic/index.mjs";
|
2
|
+
import "./index.mjs";
|
3
|
+
import { exports as callBindExports } from "../../../../../_virtual/index.mjs";
|
4
|
+
var GetIntrinsic = getIntrinsic;
|
5
|
+
var callBind = callBindExports;
|
6
|
+
var $indexOf = callBind(GetIntrinsic("String.prototype.indexOf"));
|
7
|
+
var callBound = function callBoundIntrinsic(name, allowMissing) {
|
8
|
+
var intrinsic = GetIntrinsic(name, !!allowMissing);
|
9
|
+
if (typeof intrinsic === "function" && $indexOf(name, ".prototype.") > -1) {
|
10
|
+
return callBind(intrinsic);
|
11
|
+
}
|
12
|
+
return intrinsic;
|
13
|
+
};
|
14
|
+
export {
|
15
|
+
callBound as default
|
16
|
+
};
|
@@ -0,0 +1,36 @@
|
|
1
|
+
import { __module as callBind } from "../../../../../_virtual/index.mjs";
|
2
|
+
import functionBind from "../../../function-bind@1.1.2/node_modules/function-bind/index.mjs";
|
3
|
+
import getIntrinsic from "../../../get-intrinsic@1.2.4/node_modules/get-intrinsic/index.mjs";
|
4
|
+
import setFunctionLength from "../../../set-function-length@1.2.2/node_modules/set-function-length/index.mjs";
|
5
|
+
import type from "../../../es-errors@1.3.0/node_modules/es-errors/type.mjs";
|
6
|
+
import { __require as requireEsDefineProperty } from "../../../es-define-property@1.0.0/node_modules/es-define-property/index.mjs";
|
7
|
+
(function(module) {
|
8
|
+
var bind = functionBind;
|
9
|
+
var GetIntrinsic = getIntrinsic;
|
10
|
+
var setFunctionLength$1 = setFunctionLength;
|
11
|
+
var $TypeError = type;
|
12
|
+
var $apply = GetIntrinsic("%Function.prototype.apply%");
|
13
|
+
var $call = GetIntrinsic("%Function.prototype.call%");
|
14
|
+
var $reflectApply = GetIntrinsic("%Reflect.apply%", true) || bind.call($call, $apply);
|
15
|
+
var $defineProperty = requireEsDefineProperty();
|
16
|
+
var $max = GetIntrinsic("%Math.max%");
|
17
|
+
module.exports = function callBind2(originalFunction) {
|
18
|
+
if (typeof originalFunction !== "function") {
|
19
|
+
throw new $TypeError("a function is required");
|
20
|
+
}
|
21
|
+
var func = $reflectApply(bind, $call, arguments);
|
22
|
+
return setFunctionLength$1(
|
23
|
+
func,
|
24
|
+
1 + $max(0, originalFunction.length - (arguments.length - 1)),
|
25
|
+
true
|
26
|
+
);
|
27
|
+
};
|
28
|
+
var applyBind = function applyBind2() {
|
29
|
+
return $reflectApply(bind, $apply, arguments);
|
30
|
+
};
|
31
|
+
if ($defineProperty) {
|
32
|
+
$defineProperty(module.exports, "apply", { value: applyBind });
|
33
|
+
} else {
|
34
|
+
module.exports.apply = applyBind;
|
35
|
+
}
|
36
|
+
})(callBind);
|
@@ -0,0 +1,48 @@
|
|
1
|
+
import { __require as requireEsDefineProperty } from "../../../es-define-property@1.0.0/node_modules/es-define-property/index.mjs";
|
2
|
+
import syntax from "../../../es-errors@1.3.0/node_modules/es-errors/syntax.mjs";
|
3
|
+
import type from "../../../es-errors@1.3.0/node_modules/es-errors/type.mjs";
|
4
|
+
import gopd$1 from "../../../gopd@1.0.1/node_modules/gopd/index.mjs";
|
5
|
+
var $defineProperty = requireEsDefineProperty();
|
6
|
+
var $SyntaxError = syntax;
|
7
|
+
var $TypeError = type;
|
8
|
+
var gopd = gopd$1;
|
9
|
+
var defineDataProperty = function defineDataProperty2(obj, property, value) {
|
10
|
+
if (!obj || typeof obj !== "object" && typeof obj !== "function") {
|
11
|
+
throw new $TypeError("`obj` must be an object or a function`");
|
12
|
+
}
|
13
|
+
if (typeof property !== "string" && typeof property !== "symbol") {
|
14
|
+
throw new $TypeError("`property` must be a string or a symbol`");
|
15
|
+
}
|
16
|
+
if (arguments.length > 3 && typeof arguments[3] !== "boolean" && arguments[3] !== null) {
|
17
|
+
throw new $TypeError("`nonEnumerable`, if provided, must be a boolean or null");
|
18
|
+
}
|
19
|
+
if (arguments.length > 4 && typeof arguments[4] !== "boolean" && arguments[4] !== null) {
|
20
|
+
throw new $TypeError("`nonWritable`, if provided, must be a boolean or null");
|
21
|
+
}
|
22
|
+
if (arguments.length > 5 && typeof arguments[5] !== "boolean" && arguments[5] !== null) {
|
23
|
+
throw new $TypeError("`nonConfigurable`, if provided, must be a boolean or null");
|
24
|
+
}
|
25
|
+
if (arguments.length > 6 && typeof arguments[6] !== "boolean") {
|
26
|
+
throw new $TypeError("`loose`, if provided, must be a boolean");
|
27
|
+
}
|
28
|
+
var nonEnumerable = arguments.length > 3 ? arguments[3] : null;
|
29
|
+
var nonWritable = arguments.length > 4 ? arguments[4] : null;
|
30
|
+
var nonConfigurable = arguments.length > 5 ? arguments[5] : null;
|
31
|
+
var loose = arguments.length > 6 ? arguments[6] : false;
|
32
|
+
var desc = !!gopd && gopd(obj, property);
|
33
|
+
if ($defineProperty) {
|
34
|
+
$defineProperty(obj, property, {
|
35
|
+
configurable: nonConfigurable === null && desc ? desc.configurable : !nonConfigurable,
|
36
|
+
enumerable: nonEnumerable === null && desc ? desc.enumerable : !nonEnumerable,
|
37
|
+
value,
|
38
|
+
writable: nonWritable === null && desc ? desc.writable : !nonWritable
|
39
|
+
});
|
40
|
+
} else if (loose || !nonEnumerable && !nonWritable && !nonConfigurable) {
|
41
|
+
obj[property] = value;
|
42
|
+
} else {
|
43
|
+
throw new $SyntaxError("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.");
|
44
|
+
}
|
45
|
+
};
|
46
|
+
export {
|
47
|
+
defineDataProperty as default
|
48
|
+
};
|