@gct-paas/core-web 0.1.5-dev.3 → 0.1.5-dev.5
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/_plugin-vue_export-helper-4vvM2fiX.js +1 -0
- package/dist/icon-next-picker-CShmDJI0.js +1 -0
- package/dist/index.min.css +1 -1
- package/dist/loader.esm.min.js +1 -1
- package/dist/monaco-editor-B8f_I6sY.js +1 -0
- package/dist/overlayscrollbars-vue-B2LfyB-V.js +1 -0
- package/es/components/I18nSelect/src/i18n-select-btn.vue.d.ts +2 -2
- package/es/components/I18nSelect/src/i18n-select-input.vue.d.ts +6 -6
- package/es/components/I18nSelect/src/i18n-select-textarea.vue.d.ts +6 -6
- package/es/components/UserPick/index.d.ts +1 -1
- package/es/components/UserPick/src/user-pick.vue_vue_type_script_setup_true_lang.mjs +2 -2
- package/es/components/base-button/base-button.vue.d.ts +6 -6
- package/es/components/base-button/base-button.vue.mjs +1 -1
- package/es/components/basic-button/basic-button.vue.d.ts +4 -4
- package/es/components/field-upload/src/FieldUpload.vue.d.ts +3 -3
- package/es/components/field-upload/src/components/base-upload.vue.d.ts +2 -2
- package/es/components/field-upload/src/components/base-upload.vue.mjs +2 -2
- package/es/components/field-upload/src/components/base-upload.vue_vue_type_script_name_baseUpload_setup_true_lang.mjs +4 -3
- package/es/components/field-upload/src/components/{base-upload.vue_vue_type_style_index_0_scoped_f53b6ac6_lang.css → base-upload.vue_vue_type_style_index_0_scoped_65872e0a_lang.css} +18 -18
- package/es/components/field-upload/src/components/file-list.vue.mjs +2 -2
- package/es/components/field-upload/src/components/file-list.vue_vue_type_script_setup_true_name_fileList_lang.mjs +2 -2
- package/es/components/field-upload/src/components/{file-list.vue_vue_type_style_index_0_scoped_3918aad0_lang.css → file-list.vue_vue_type_style_index_0_scoped_543b5221_lang.css} +25 -25
- package/es/components/field-upload/src/components/upload-design.vue.mjs +2 -2
- package/es/components/field-upload/src/components/upload-design.vue_vue_type_script_name_UploadDesign_setup_true_lang.mjs +4 -3
- package/es/components/field-upload/src/components/{upload-design.vue_vue_type_style_index_0_scoped_1e5189c1_lang.css → upload-design.vue_vue_type_style_index_0_scoped_5fd18cf8_lang.css} +10 -10
- package/es/components/field-upload/src/hooks/hooks.d.ts +1 -1
- package/es/components/icon-next-picker/icon-next-picker.vue.mjs +6 -0
- package/es/components/{icon-next/src/IconNextPicker.vue_vue_type_script_setup_true_name_IconNextPicker_lang.mjs → icon-next-picker/icon-next-picker.vue_vue_type_script_setup_true_name_IconNextPicker_lang.mjs} +7 -11
- package/es/components/image-upload/index.mjs +1 -1
- package/es/components/image-upload/src/ImageUpload.vue.d.ts +2 -2
- package/es/components/image-upload/src/components/base-upload.vue.d.ts +2 -2
- package/es/components/index.d.ts +1 -5
- package/es/components/index.mjs +2 -11
- package/es/create-app-vue.mjs +5 -3
- package/es/hooks/index.d.ts +0 -1
- package/es/hooks/index.mjs +0 -1
- package/es/index.mjs +35 -40
- package/es/modules/code-editor/index.d.ts +24 -24
- package/es/modules/code-editor/monaco-editor.vue.d.ts +9 -9
- package/es/modules/code-editor/useEditorConsole.d.ts +1 -1
- package/es/modules/color-picker/src/ColorPicker.vue.d.ts +2 -2
- package/es/modules/color-picker/src/ColorPicker.vue.mjs +1 -1
- package/es/modules/formula-editor/formula-editor.mjs +1 -2
- package/es/modules/gct-dnd/components/gct-dnd-container/gct-dnd-container.d.ts +1 -1
- package/es/modules/gct-dnd/components/gct-dnd-item/gct-dnd-item.d.ts +1 -1
- package/es/modules/gct-form/editor/gct-form-date-format-select/gct-form-date-format-select.d.ts +4 -4
- package/es/modules/gct-form/editor/gct-form-i18n/gct-form-i18n.d.ts +4 -4
- package/es/modules/gct-form/editor/gct-form-multiple-choice/gct-form-multiple-choice.d.ts +2 -2
- package/es/modules/gct-form/editor/gct-form-table/gct-form-table.d.ts +2 -2
- package/es/modules/gct-form/editor/gct-select-form-table/gct-select-form-table.d.ts +2 -2
- package/es/modules/gct-form/widgets/gct-edit-form/gct-edit-form.d.ts +1 -1
- package/es/modules/gct-table/editor/gct-table-date/gct-table-date.mjs +1 -1
- package/es/modules/gct-table/editor/gct-table-text/gct-table-text.mjs +1 -1
- package/es/modules/gct-table/widgets/gct-table/gct-table.d.ts +2 -2
- package/es/modules/global-modal/src/BasicModal.vue.d.ts +32 -32
- package/es/modules/global-modal/src/components/GlboalModal.d.ts +10 -10
- package/es/modules/global-modal/src/components/ModalFooter.vue.d.ts +10 -10
- package/es/modules/global-modal/src/components/ModalWrapper.vue.d.ts +5 -5
- package/es/modules/picture-cropper/src/CopperFreeModal.vue.d.ts +3 -3
- package/es/modules/picture-cropper/src/Cropper.vue.d.ts +9 -9
- package/es/modules/picture-cropper/src/CropperAvatar.vue.d.ts +2 -2
- package/es/modules/picture-cropper/src/CropperAvatar.vue.mjs +2 -2
- package/es/modules/picture-cropper/src/CropperAvatar.vue_vue_type_script_setup_true_name_CropperAvatar_lang.mjs +1 -3
- package/es/modules/picture-cropper/src/{CropperAvatar.vue_vue_type_style_index_0_scoped_af219c4c_lang.css → CropperAvatar.vue_vue_type_style_index_0_scoped_b1cbaaf1_lang.css} +7 -7
- package/es/modules/picture-cropper/src/CropperFree.vue.d.ts +3 -3
- package/es/modules/picture-cropper/src/CropperFree.vue.mjs +2 -2
- package/es/modules/picture-cropper/src/CropperFree.vue_vue_type_script_setup_true_name_CropperPhoto_lang.mjs +1 -3
- package/es/modules/picture-cropper/src/{CropperFree.vue_vue_type_style_index_0_scoped_015ef4a4_lang.css → CropperFree.vue_vue_type_style_index_0_scoped_bab12130_lang.css} +16 -16
- package/es/modules/picture-preview/src/Functional.vue.d.ts +4 -4
- package/es/modules/target-loading/src/target-loading.vue.d.ts +2 -2
- package/es/setup-app.d.ts +2 -1
- package/es/setup-app.mjs +3 -1
- package/package.json +10 -8
- package/dist/monaco-editor-DCEyjUmJ.js +0 -1
- package/dist/useMonacoEditor-kyCCXYcK.js +0 -1
- package/es/components/assets-svg-icon/assets-svg-icon.css +0 -188
- package/es/components/assets-svg-icon/assets-svg-icon.d.ts +0 -134
- package/es/components/assets-svg-icon/assets-svg-icon.mjs +0 -167
- package/es/components/assets-svg-icon/request.d.ts +0 -2
- package/es/components/assets-svg-icon/request.mjs +0 -68
- package/es/components/assets-svg-icon/utils.d.ts +0 -9
- package/es/components/assets-svg-icon/utils.mjs +0 -23
- package/es/components/assets-svg-icon/validate.d.ts +0 -4
- package/es/components/assets-svg-icon/validate.mjs +0 -29
- package/es/components/icon-next/data/icons.data.d.ts +0 -5
- package/es/components/icon-next/hooks/useIconAsset.d.ts +0 -16
- package/es/components/icon-next/hooks/useIconAsset.mjs +0 -36
- package/es/components/icon-next/hooks/useIconPark.d.ts +0 -16
- package/es/components/icon-next/hooks/useIconPark.mjs +0 -52
- package/es/components/icon-next/hooks/useIconPlatform.d.ts +0 -8
- package/es/components/icon-next/hooks/useIconPlatform.mjs +0 -43
- package/es/components/icon-next/index.d.ts +0 -3
- package/es/components/icon-next/index.mjs +0 -3
- package/es/components/icon-next/src/IconNext.vue.d.ts +0 -40
- package/es/components/icon-next/src/IconNext.vue.mjs +0 -7
- package/es/components/icon-next/src/IconNext.vue_vue_type_script_setup_true_name_IconNext_lang.mjs +0 -113
- package/es/components/icon-next/src/IconNext.vue_vue_type_style_index_0_scoped_360a87c9_lang.css +0 -18
- package/es/components/icon-next/src/IconNextPicker.vue.mjs +0 -6
- package/es/components/icon-next/types/index.d.ts +0 -17
- package/es/components/icon-next/types/index.mjs +0 -11
- package/es/components/svg-icon/svg-icon.vue.d.ts +0 -40
- package/es/components/svg-icon/svg-icon.vue.mjs +0 -6
- package/es/components/svg-icon/svg-icon.vue_vue_type_script_setup_true_name_SvgIcon_lang.mjs +0 -52
- package/es/components/svg-icon/svg-icon.vue_vue_type_style_index_0_lang.css +0 -73
- package/es/components/wujie-container/wujie-container.css +0 -74
- package/es/components/wujie-container/wujie-container.d.ts +0 -11
- package/es/components/wujie-container/wujie-container.mjs +0 -61
- package/es/hooks/useFile.d.ts +0 -4
- package/es/hooks/useFile.mjs +0 -22
- package/dist/{cropper-DyP6CFER.js → cropper-DPh9NaIi.js} +0 -0
- package/dist/{de_DE-DIDpd1gQ.js → de_DE-BY1He8Sf.js} +0 -0
- package/dist/{en_US-BaP-b1tP.js → en_US-CuX-vrWy.js} +0 -0
- package/dist/{es_ES-NOVlNQnw.js → es_ES-BqHRjpc9.js} +0 -0
- package/dist/{fr_FR-Bk_x0L7S.js → fr_FR-C4TFcMTv.js} +0 -0
- package/dist/{ja_JP-CeseBQS9.js → ja_JP-CgXnA74i.js} +0 -0
- package/dist/{pt_PT-DFlFmzXZ.js → pt_PT-C0ALlHDr.js} +0 -0
- package/dist/{ru_RU-C5XPaRfl.js → ru_RU-D39vUeFW.js} +0 -0
- package/dist/{tr_TR-CODhj5X1.js → tr_TR-Cm3P61iH.js} +0 -0
- package/dist/{vi_VN-BjwID8XV.js → vi_VN-BZ_iPKuE.js} +0 -0
- package/dist/{zh_CN-BKmwBYsr.js → zh_CN-DY_wA21D.js} +0 -0
- package/dist/{zh_TW-BSGEo2Qx.js → zh_TW-A1Y7MG2g.js} +0 -0
- package/es/components/{icon-next/src/IconNextPicker.vue.d.ts → icon-next-picker/icon-next-picker.vue.d.ts} +5 -5
- /package/es/components/{icon-next/src/IconNextPicker.vue_vue_type_style_index_0_lang.css → icon-next-picker/icon-next-picker.vue_vue_type_style_index_0_lang.css} +0 -0
- /package/es/modules/gct-table/editor/{gct-table-text/gct-table-text.css → gct-table-date/gct-table-date.css} +0 -0
|
@@ -1,167 +0,0 @@
|
|
|
1
|
-
import { getSrc, isRTL } from "./utils.mjs";
|
|
2
|
-
import { getSvgContent, ioniconContent } from "./request.mjs";
|
|
3
|
-
import './assets-svg-icon.css';/* empty css */
|
|
4
|
-
import { computed, createVNode, defineComponent, getCurrentInstance, nextTick, onMounted, onUnmounted, ref, watch } from "vue";
|
|
5
|
-
import { useNamespace } from "@gct-paas/core";
|
|
6
|
-
//#region src/components/assets-svg-icon/assets-svg-icon.tsx
|
|
7
|
-
/**
|
|
8
|
-
* Create color classes for the icon.
|
|
9
|
-
* @param color - The color of the icon.
|
|
10
|
-
* @returns The color classes for the icon.
|
|
11
|
-
*/
|
|
12
|
-
var createColorClasses = (color) => {
|
|
13
|
-
return color ? {
|
|
14
|
-
"ion-color": true,
|
|
15
|
-
[`ion-color-${color}`]: true
|
|
16
|
-
} : null;
|
|
17
|
-
};
|
|
18
|
-
/**
|
|
19
|
-
* SVG图标组件 - 简化版本 (仅浏览器环境)
|
|
20
|
-
*
|
|
21
|
-
* 此组件是基于Stencil ion-icon组件简化的Vue实现,
|
|
22
|
-
* 专门用于浏览器环境,仅支持通过src属性加载SVG。
|
|
23
|
-
*
|
|
24
|
-
* ## 功能
|
|
25
|
-
* - 支持通过直接URL加载SVG图标
|
|
26
|
-
* - 支持懒加载
|
|
27
|
-
* - 支持RTL文本方向自动翻转
|
|
28
|
-
* - 支持颜色和大小变化
|
|
29
|
-
* - 支持SVG内容安全检查
|
|
30
|
-
*
|
|
31
|
-
* ## 使用示例
|
|
32
|
-
*
|
|
33
|
-
* // 使用 src 属性
|
|
34
|
-
* <SvgIcon src="/path/to/icon.svg" />
|
|
35
|
-
*
|
|
36
|
-
* // 设置大小和颜色
|
|
37
|
-
* <SvgIcon src="/path/to/icon.svg" size="large" color="primary" />
|
|
38
|
-
*
|
|
39
|
-
* // RTL 支持
|
|
40
|
-
* <SvgIcon src="/path/to/icon.svg" flipRtl={true} />
|
|
41
|
-
*
|
|
42
|
-
* // 懒加载
|
|
43
|
-
* <SvgIcon src="/path/to/icon.svg" lazy={true} />
|
|
44
|
-
*
|
|
45
|
-
* // 禁用 SVG 清理
|
|
46
|
-
* <SvgIcon src="/path/to/icon.svg" sanitize={false} />
|
|
47
|
-
*/
|
|
48
|
-
var AssetsSvgIcon = /* @__PURE__ */ defineComponent({
|
|
49
|
-
name: "AssetsSvgIcon",
|
|
50
|
-
props: {
|
|
51
|
-
color: { type: String },
|
|
52
|
-
flipRtl: { type: Boolean },
|
|
53
|
-
src: {
|
|
54
|
-
type: String,
|
|
55
|
-
required: true
|
|
56
|
-
},
|
|
57
|
-
size: { type: String },
|
|
58
|
-
lazy: {
|
|
59
|
-
type: Boolean,
|
|
60
|
-
default: false
|
|
61
|
-
},
|
|
62
|
-
sanitize: {
|
|
63
|
-
type: Boolean,
|
|
64
|
-
default: true
|
|
65
|
-
}
|
|
66
|
-
},
|
|
67
|
-
setup(props) {
|
|
68
|
-
const ns = useNamespace("assets-svg-icon");
|
|
69
|
-
const instance = getCurrentInstance();
|
|
70
|
-
let io;
|
|
71
|
-
const didLoadIcon = ref(false);
|
|
72
|
-
const svgContent = ref(void 0);
|
|
73
|
-
const isVisible = ref(false);
|
|
74
|
-
/**
|
|
75
|
-
* Wait until the icon is visible in the viewport.
|
|
76
|
-
* @param el - The element to observe.
|
|
77
|
-
* @param rootMargin - The root margin of the observer.
|
|
78
|
-
* @param cb - The callback to call when the element is visible.
|
|
79
|
-
*/
|
|
80
|
-
const waitUntilVisible = (el, rootMargin, cb) => {
|
|
81
|
-
/**
|
|
82
|
-
* browser doesn't support IntersectionObserver
|
|
83
|
-
* so just fallback to always show it
|
|
84
|
-
*/
|
|
85
|
-
if (!Boolean(typeof window !== "undefined" && props.lazy && window.IntersectionObserver)) return cb();
|
|
86
|
-
const intersectionObserver = io = new window.IntersectionObserver((data) => {
|
|
87
|
-
if (data[0]?.isIntersecting) {
|
|
88
|
-
intersectionObserver.disconnect();
|
|
89
|
-
io = void 0;
|
|
90
|
-
cb();
|
|
91
|
-
}
|
|
92
|
-
}, { rootMargin });
|
|
93
|
-
intersectionObserver.observe(el);
|
|
94
|
-
};
|
|
95
|
-
/**
|
|
96
|
-
* Load the icon using only src URL
|
|
97
|
-
*/
|
|
98
|
-
const loadIcon = () => {
|
|
99
|
-
if (typeof window !== "undefined" && isVisible.value && props.src) {
|
|
100
|
-
const url = getSrc(props.src);
|
|
101
|
-
if (url) {
|
|
102
|
-
if (ioniconContent.has(url)) svgContent.value = ioniconContent.get(url);
|
|
103
|
-
else getSvgContent(url, props.sanitize).then(() => {
|
|
104
|
-
svgContent.value = ioniconContent.get(url);
|
|
105
|
-
});
|
|
106
|
-
didLoadIcon.value = true;
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
};
|
|
110
|
-
onMounted(() => {
|
|
111
|
-
const el = instance?.vnode.el;
|
|
112
|
-
if (el)
|
|
113
|
-
/**
|
|
114
|
-
* purposely do not return the promise here because loading
|
|
115
|
-
* the svg file should not hold up loading the app
|
|
116
|
-
* only load the svg if it's visible
|
|
117
|
-
*/
|
|
118
|
-
waitUntilVisible(el, "50px", () => {
|
|
119
|
-
isVisible.value = true;
|
|
120
|
-
loadIcon();
|
|
121
|
-
});
|
|
122
|
-
nextTick(() => {
|
|
123
|
-
if (!didLoadIcon.value) loadIcon();
|
|
124
|
-
});
|
|
125
|
-
});
|
|
126
|
-
onUnmounted(() => {
|
|
127
|
-
if (io) {
|
|
128
|
-
io.disconnect();
|
|
129
|
-
io = void 0;
|
|
130
|
-
}
|
|
131
|
-
});
|
|
132
|
-
watch(() => props.src, () => {
|
|
133
|
-
loadIcon();
|
|
134
|
-
});
|
|
135
|
-
return {
|
|
136
|
-
ns,
|
|
137
|
-
svgContent,
|
|
138
|
-
classes: computed(() => {
|
|
139
|
-
const { flipRtl, size, color } = props;
|
|
140
|
-
const el = instance?.vnode.el;
|
|
141
|
-
/**
|
|
142
|
-
* if flipRtl is true, the icon should change direction when `dir` changes
|
|
143
|
-
*/
|
|
144
|
-
const shouldBeFlippable = flipRtl;
|
|
145
|
-
return {
|
|
146
|
-
...createColorClasses(color),
|
|
147
|
-
[`icon-${size}`]: !!size,
|
|
148
|
-
"flip-rtl": shouldBeFlippable,
|
|
149
|
-
"icon-rtl": shouldBeFlippable && isRTL(el),
|
|
150
|
-
[ns.b()]: true
|
|
151
|
-
};
|
|
152
|
-
})
|
|
153
|
-
};
|
|
154
|
-
},
|
|
155
|
-
render() {
|
|
156
|
-
const { svgContent, classes } = this;
|
|
157
|
-
return createVNode("div", {
|
|
158
|
-
"role": "img",
|
|
159
|
-
"class": classes
|
|
160
|
-
}, [typeof window !== "undefined" && svgContent ? createVNode("div", {
|
|
161
|
-
"class": "icon-inner",
|
|
162
|
-
"innerHTML": svgContent
|
|
163
|
-
}, null) : createVNode("div", { "class": "icon-inner" }, null)]);
|
|
164
|
-
}
|
|
165
|
-
});
|
|
166
|
-
//#endregion
|
|
167
|
-
export { AssetsSvgIcon };
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
import { isEncodedDataUrl, isSvgDataUrl, validateContent } from "./validate.mjs";
|
|
2
|
-
//#region src/components/assets-svg-icon/request.ts
|
|
3
|
-
var ioniconContent = /* @__PURE__ */ new Map();
|
|
4
|
-
var requests = /* @__PURE__ */ new Map();
|
|
5
|
-
var parser;
|
|
6
|
-
/**
|
|
7
|
-
* Safely fallback to an empty svg
|
|
8
|
-
*/
|
|
9
|
-
function safeFallback(url) {
|
|
10
|
-
const svg = "";
|
|
11
|
-
ioniconContent.set(url, svg);
|
|
12
|
-
return svg;
|
|
13
|
-
}
|
|
14
|
-
var getSvgContent = (url, sanitize) => {
|
|
15
|
-
/**
|
|
16
|
-
* See if we already have a request for this url
|
|
17
|
-
*/
|
|
18
|
-
const req = requests.get(url);
|
|
19
|
-
if (req) return req;
|
|
20
|
-
if (typeof fetch !== "undefined" && typeof document !== "undefined") {
|
|
21
|
-
/**
|
|
22
|
-
* If the url is a data url of an svg, then try to parse it
|
|
23
|
-
* with the DOMParser. This works with content security policies enabled.
|
|
24
|
-
*/
|
|
25
|
-
if (isSvgDataUrl(url) && isEncodedDataUrl(url)) return Promise.resolve(getSvgByUrl(url));
|
|
26
|
-
return fetchSvg(url, sanitize);
|
|
27
|
-
}
|
|
28
|
-
return Promise.resolve(safeFallback(url));
|
|
29
|
-
};
|
|
30
|
-
function getSvgByUrl(url) {
|
|
31
|
-
if (!parser)
|
|
32
|
-
/**
|
|
33
|
-
* Create an instance of the DOM parser. This creates a single
|
|
34
|
-
* parser instance for the entire app, which is more efficient.
|
|
35
|
-
*/
|
|
36
|
-
parser = new DOMParser();
|
|
37
|
-
const svg = parser.parseFromString(url, "text/html").querySelector("svg");
|
|
38
|
-
if (svg) {
|
|
39
|
-
ioniconContent.set(url, svg.outerHTML);
|
|
40
|
-
return svg.outerHTML;
|
|
41
|
-
}
|
|
42
|
-
throw new Error(`Could not parse svg from ${url}`);
|
|
43
|
-
}
|
|
44
|
-
function fetchSvg(url, sanitize) {
|
|
45
|
-
/**
|
|
46
|
-
* We don't already have a request
|
|
47
|
-
*/
|
|
48
|
-
const req = fetch(url).then((rsp) => {
|
|
49
|
-
/**
|
|
50
|
-
* When fetching from a file:// URL, some browsers return
|
|
51
|
-
* a 0 status code even when the request succeeds so don't
|
|
52
|
-
* rely on rsp.ok as the only signal of success.
|
|
53
|
-
*/
|
|
54
|
-
return rsp.text().then((svgContent) => {
|
|
55
|
-
if (svgContent && sanitize !== false) svgContent = validateContent(svgContent);
|
|
56
|
-
const svg = svgContent || "";
|
|
57
|
-
ioniconContent.set(url, svg);
|
|
58
|
-
return svg;
|
|
59
|
-
}).catch(() => safeFallback(url));
|
|
60
|
-
}).catch(() => safeFallback(url));
|
|
61
|
-
/**
|
|
62
|
-
* Cache for the same requests
|
|
63
|
-
*/
|
|
64
|
-
requests.set(url, req);
|
|
65
|
-
return req;
|
|
66
|
-
}
|
|
67
|
-
//#endregion
|
|
68
|
-
export { getSvgContent, ioniconContent };
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export declare const isStr: (val: any) => val is string;
|
|
2
|
-
export declare const isSrc: (str: string) => boolean;
|
|
3
|
-
export declare const getSrc: (src: string | undefined) => string | null;
|
|
4
|
-
/**
|
|
5
|
-
* Returns `true` if the document or host element
|
|
6
|
-
* has a `dir` set to `rtl`. The host value will always
|
|
7
|
-
* take priority over the root document value.
|
|
8
|
-
*/
|
|
9
|
-
export declare const isRTL: (hostEl?: Pick<HTMLElement, "dir">) => boolean;
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
//#region src/components/assets-svg-icon/utils.ts
|
|
2
|
-
var isStr = (val) => typeof val === "string";
|
|
3
|
-
var isSrc = (str) => str.length > 0 && /(\/|\.)/.test(str);
|
|
4
|
-
var getSrc = (src) => {
|
|
5
|
-
if (isStr(src)) {
|
|
6
|
-
src = src.trim();
|
|
7
|
-
if (isSrc(src)) return src;
|
|
8
|
-
}
|
|
9
|
-
return null;
|
|
10
|
-
};
|
|
11
|
-
/**
|
|
12
|
-
* Returns `true` if the document or host element
|
|
13
|
-
* has a `dir` set to `rtl`. The host value will always
|
|
14
|
-
* take priority over the root document value.
|
|
15
|
-
*/
|
|
16
|
-
var isRTL = (hostEl) => {
|
|
17
|
-
if (hostEl) {
|
|
18
|
-
if (hostEl.dir !== "") return hostEl.dir.toLowerCase() === "rtl";
|
|
19
|
-
}
|
|
20
|
-
return document?.dir.toLowerCase() === "rtl";
|
|
21
|
-
};
|
|
22
|
-
//#endregion
|
|
23
|
-
export { getSrc, isRTL, isStr };
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { isStr } from "./utils.mjs";
|
|
2
|
-
//#region src/components/assets-svg-icon/validate.ts
|
|
3
|
-
var validateContent = (svgContent) => {
|
|
4
|
-
const div = document.createElement("div");
|
|
5
|
-
div.innerHTML = svgContent;
|
|
6
|
-
for (let i = div.childNodes.length - 1; i >= 0; i--) if (div.childNodes[i].nodeName.toLowerCase() !== "svg") div.removeChild(div.childNodes[i]);
|
|
7
|
-
const svgElm = div.firstElementChild;
|
|
8
|
-
if (svgElm && svgElm.nodeName.toLowerCase() === "svg") {
|
|
9
|
-
const svgClass = svgElm.getAttribute("class") || "";
|
|
10
|
-
svgElm.setAttribute("class", (svgClass + " s-ion-icon").trim());
|
|
11
|
-
if (isValid(svgElm)) return div.innerHTML;
|
|
12
|
-
}
|
|
13
|
-
return "";
|
|
14
|
-
};
|
|
15
|
-
var isValid = (elm) => {
|
|
16
|
-
if (elm.nodeType === 1) {
|
|
17
|
-
if (elm.nodeName.toLowerCase() === "script") return false;
|
|
18
|
-
for (let i = 0; i < elm.attributes.length; i++) {
|
|
19
|
-
const name = elm.attributes[i].name;
|
|
20
|
-
if (isStr(name) && name.toLowerCase().indexOf("on") === 0) return false;
|
|
21
|
-
}
|
|
22
|
-
for (let i = 0; i < elm.childNodes.length; i++) if (!isValid(elm.childNodes[i])) return false;
|
|
23
|
-
}
|
|
24
|
-
return true;
|
|
25
|
-
};
|
|
26
|
-
var isSvgDataUrl = (url) => url.startsWith("data:image/svg+xml");
|
|
27
|
-
var isEncodedDataUrl = (url) => url.indexOf(";utf8,") !== -1;
|
|
28
|
-
//#endregion
|
|
29
|
-
export { isEncodedDataUrl, isSvgDataUrl, validateContent };
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
export declare function useIconAsset(): {
|
|
2
|
-
getIconAssetCats: () => Promise<{
|
|
3
|
-
id: string;
|
|
4
|
-
name: string;
|
|
5
|
-
children: {
|
|
6
|
-
id: string;
|
|
7
|
-
name: string;
|
|
8
|
-
icons?: {
|
|
9
|
-
id: string;
|
|
10
|
-
name: string;
|
|
11
|
-
_filter_: string[];
|
|
12
|
-
}[] | undefined;
|
|
13
|
-
children?: /*elided*/ any[] | undefined;
|
|
14
|
-
}[];
|
|
15
|
-
}[]>;
|
|
16
|
-
};
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { IconNamespaceEnum } from "../types/index.mjs";
|
|
2
|
-
import { computed, ref } from "vue";
|
|
3
|
-
//#region src/components/icon-next/hooks/useIconAsset.ts
|
|
4
|
-
var iconAssetIcons = ref([]);
|
|
5
|
-
var iconParkCats = computed(() => {
|
|
6
|
-
return [{
|
|
7
|
-
id: "IconAsset",
|
|
8
|
-
name: "资产图标",
|
|
9
|
-
children: iconAssetIcons.value
|
|
10
|
-
}].filter((i) => i.children?.length);
|
|
11
|
-
});
|
|
12
|
-
function useIconAsset() {
|
|
13
|
-
async function getIconAssetCats() {
|
|
14
|
-
if (iconAssetIcons.value.length > 0) return iconParkCats.value;
|
|
15
|
-
const params = { assetsModule: "ICON" };
|
|
16
|
-
iconAssetIcons.value = await Promise.all([_api.platform.category.getList(params), _api.platform.assets.getList(params)]).then(([catRes, iconRes]) => {
|
|
17
|
-
return catRes?.map((c) => {
|
|
18
|
-
return {
|
|
19
|
-
id: `${c.id}`,
|
|
20
|
-
name: c.name,
|
|
21
|
-
icons: iconRes?.filter((i) => i.categoryId === c.id).map((item) => {
|
|
22
|
-
Object.assign(item, {
|
|
23
|
-
id: `${IconNamespaceEnum.Asset}:${item.path}`,
|
|
24
|
-
_filter_: [item.name]
|
|
25
|
-
});
|
|
26
|
-
return item;
|
|
27
|
-
})
|
|
28
|
-
};
|
|
29
|
-
}).filter((i) => i.icons?.length);
|
|
30
|
-
});
|
|
31
|
-
return iconParkCats.value;
|
|
32
|
-
}
|
|
33
|
-
return { getIconAssetCats };
|
|
34
|
-
}
|
|
35
|
-
//#endregion
|
|
36
|
-
export { useIconAsset };
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
export declare function useIconPark(): {
|
|
2
|
-
getIconParkCats: () => {
|
|
3
|
-
id: string;
|
|
4
|
-
name: string;
|
|
5
|
-
children: {
|
|
6
|
-
id: string;
|
|
7
|
-
name: string;
|
|
8
|
-
icons?: {
|
|
9
|
-
id: string;
|
|
10
|
-
name: string;
|
|
11
|
-
_filter_: string[];
|
|
12
|
-
}[] | undefined;
|
|
13
|
-
children?: /*elided*/ any[] | undefined;
|
|
14
|
-
}[];
|
|
15
|
-
}[];
|
|
16
|
-
};
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import { IconNamespaceEnum } from "../types/index.mjs";
|
|
2
|
-
import { computed, ref } from "vue";
|
|
3
|
-
import IconParkJson from "@icon-park/vue-next/icons.json";
|
|
4
|
-
//#region src/components/icon-next/hooks/useIconPark.ts
|
|
5
|
-
var CategoyEnum = /* @__PURE__ */ function(CategoyEnum) {
|
|
6
|
-
CategoyEnum["Base"] = "Base";
|
|
7
|
-
CategoyEnum["Others"] = "Others";
|
|
8
|
-
return CategoyEnum;
|
|
9
|
-
}(CategoyEnum || {});
|
|
10
|
-
var iconParkIcons = ref([]);
|
|
11
|
-
var iconParkCats = computed(() => {
|
|
12
|
-
return [{
|
|
13
|
-
id: "IconPark",
|
|
14
|
-
name: "IconPark",
|
|
15
|
-
children: iconParkIcons.value
|
|
16
|
-
}];
|
|
17
|
-
});
|
|
18
|
-
function useIconPark() {
|
|
19
|
-
function getIconParkCats() {
|
|
20
|
-
if (iconParkIcons.value.length > 0) return iconParkCats.value;
|
|
21
|
-
const cats = [];
|
|
22
|
-
IconParkJson.forEach((item) => {
|
|
23
|
-
const icon = {
|
|
24
|
-
...item,
|
|
25
|
-
id: `${IconNamespaceEnum.IconPark}:${item.name}`,
|
|
26
|
-
_filter_: [
|
|
27
|
-
...item.tag,
|
|
28
|
-
item.title,
|
|
29
|
-
item.name
|
|
30
|
-
]
|
|
31
|
-
};
|
|
32
|
-
let category = cats.find((c) => c.id === icon.category);
|
|
33
|
-
if (category) category.icons.push(icon);
|
|
34
|
-
else {
|
|
35
|
-
category = {
|
|
36
|
-
id: icon.category,
|
|
37
|
-
name: icon.categoryCN,
|
|
38
|
-
icons: [icon]
|
|
39
|
-
};
|
|
40
|
-
cats.push(category);
|
|
41
|
-
}
|
|
42
|
-
});
|
|
43
|
-
const base = cats.filter((c) => c.id === CategoyEnum.Base);
|
|
44
|
-
const others = cats.filter((c) => c.id === CategoyEnum.Others);
|
|
45
|
-
const middle = cats.filter((c) => ![CategoyEnum.Base, CategoyEnum.Others].includes(c.id));
|
|
46
|
-
iconParkIcons.value = base.concat(middle, others);
|
|
47
|
-
return iconParkCats.value;
|
|
48
|
-
}
|
|
49
|
-
return { getIconParkCats };
|
|
50
|
-
}
|
|
51
|
-
//#endregion
|
|
52
|
-
export { useIconPark };
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { IconNamespaceEnum } from "../types/index.mjs";
|
|
2
|
-
import { computed } from "vue";
|
|
3
|
-
import { iconsNames } from "@gct-paas/platform-icons";
|
|
4
|
-
//#region src/components/icon-next/hooks/useIconPlatform.ts
|
|
5
|
-
var iconPlatformCats = computed(() => {
|
|
6
|
-
return [{
|
|
7
|
-
id: "medicalCare",
|
|
8
|
-
name: "医疗器械",
|
|
9
|
-
icons: medicalCareIcons.value
|
|
10
|
-
}, {
|
|
11
|
-
id: "IconPlatform",
|
|
12
|
-
name: "平台图标",
|
|
13
|
-
icons: platformIcons.value
|
|
14
|
-
}];
|
|
15
|
-
});
|
|
16
|
-
var platformIcons = computed(() => {
|
|
17
|
-
return iconsNames.filter((e) => /^(icon-platform)/.test(e)).map((e) => {
|
|
18
|
-
const iconName = e.replace(/icon-/g, "");
|
|
19
|
-
return {
|
|
20
|
-
id: `${IconNamespaceEnum.Platform}:${iconName}`,
|
|
21
|
-
name: iconName,
|
|
22
|
-
_filter_: [iconName]
|
|
23
|
-
};
|
|
24
|
-
});
|
|
25
|
-
});
|
|
26
|
-
var medicalCareIcons = computed(() => {
|
|
27
|
-
return iconsNames.filter((e) => /^(icon-medicalCare)/.test(e)).map((e) => {
|
|
28
|
-
const iconName = e.replace(/icon-/g, "");
|
|
29
|
-
return {
|
|
30
|
-
id: `${IconNamespaceEnum.Platform}:${iconName}`,
|
|
31
|
-
name: e.replace(/icon-medicalCare-/g, ""),
|
|
32
|
-
_filter_: [iconName]
|
|
33
|
-
};
|
|
34
|
-
});
|
|
35
|
-
});
|
|
36
|
-
function useIconPlatform() {
|
|
37
|
-
function getIconPlatformCats() {
|
|
38
|
-
return iconPlatformCats.value;
|
|
39
|
-
}
|
|
40
|
-
return { getIconPlatformCats };
|
|
41
|
-
}
|
|
42
|
-
//#endregion
|
|
43
|
-
export { useIconPlatform };
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
|
|
2
|
-
value: {
|
|
3
|
-
type: (ObjectConstructor | StringConstructor)[];
|
|
4
|
-
required: true;
|
|
5
|
-
};
|
|
6
|
-
color: {
|
|
7
|
-
type: StringConstructor;
|
|
8
|
-
default: string;
|
|
9
|
-
};
|
|
10
|
-
background: {
|
|
11
|
-
type: StringConstructor;
|
|
12
|
-
default: string;
|
|
13
|
-
};
|
|
14
|
-
size: {
|
|
15
|
-
type: NumberConstructor;
|
|
16
|
-
default: number;
|
|
17
|
-
};
|
|
18
|
-
}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
19
|
-
value: {
|
|
20
|
-
type: (ObjectConstructor | StringConstructor)[];
|
|
21
|
-
required: true;
|
|
22
|
-
};
|
|
23
|
-
color: {
|
|
24
|
-
type: StringConstructor;
|
|
25
|
-
default: string;
|
|
26
|
-
};
|
|
27
|
-
background: {
|
|
28
|
-
type: StringConstructor;
|
|
29
|
-
default: string;
|
|
30
|
-
};
|
|
31
|
-
size: {
|
|
32
|
-
type: NumberConstructor;
|
|
33
|
-
default: number;
|
|
34
|
-
};
|
|
35
|
-
}>> & Readonly<{}>, {
|
|
36
|
-
color: string;
|
|
37
|
-
size: number;
|
|
38
|
-
background: string;
|
|
39
|
-
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
40
|
-
export default _default;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import _plugin_vue_export_helper_default from "../../../_virtual/_plugin-vue_export-helper.mjs";
|
|
2
|
-
import IconNext_vue_vue_type_script_setup_true_name_IconNext_lang_default from "./IconNext.vue_vue_type_script_setup_true_name_IconNext_lang.mjs";
|
|
3
|
-
import './IconNext.vue_vue_type_style_index_0_scoped_360a87c9_lang.css';/* empty css */
|
|
4
|
-
//#region src/components/icon-next/src/IconNext.vue
|
|
5
|
-
var IconNext_default = /* @__PURE__ */ _plugin_vue_export_helper_default(IconNext_vue_vue_type_script_setup_true_name_IconNext_lang_default, [["__scopeId", "data-v-360a87c9"]]);
|
|
6
|
-
//#endregion
|
|
7
|
-
export { IconNext_default as default };
|
package/es/components/icon-next/src/IconNext.vue_vue_type_script_setup_true_name_IconNext_lang.mjs
DELETED
|
@@ -1,113 +0,0 @@
|
|
|
1
|
-
import svg_icon_default from "../../svg-icon/svg-icon.vue.mjs";
|
|
2
|
-
import { IconNamespaceEnum } from "../types/index.mjs";
|
|
3
|
-
import { computed, createBlock, createElementBlock, defineComponent, normalizeClass, normalizeStyle, openBlock, unref } from "vue";
|
|
4
|
-
import { VITE_MINIO_PATH } from "@gct-paas/core";
|
|
5
|
-
import { IconPark } from "@icon-park/vue-next/es/all";
|
|
6
|
-
//#region src/components/icon-next/src/IconNext.vue?vue&type=script&setup=true&name=IconNext&lang.ts
|
|
7
|
-
var IconNext_vue_vue_type_script_setup_true_name_IconNext_lang_default = /* @__PURE__ */ defineComponent({
|
|
8
|
-
__name: "IconNext",
|
|
9
|
-
props: {
|
|
10
|
-
value: {
|
|
11
|
-
type: [String, Object],
|
|
12
|
-
required: true
|
|
13
|
-
},
|
|
14
|
-
color: {
|
|
15
|
-
type: String,
|
|
16
|
-
default: "#FFFFFF"
|
|
17
|
-
},
|
|
18
|
-
background: {
|
|
19
|
-
type: String,
|
|
20
|
-
default: "transparent"
|
|
21
|
-
},
|
|
22
|
-
size: {
|
|
23
|
-
type: Number,
|
|
24
|
-
default: 24
|
|
25
|
-
}
|
|
26
|
-
},
|
|
27
|
-
setup(__props) {
|
|
28
|
-
function fileUrlParser(url) {
|
|
29
|
-
if (!url) return url;
|
|
30
|
-
return `${VITE_MINIO_PATH}${url.startsWith("/") ? "" : "/"}${url}`;
|
|
31
|
-
}
|
|
32
|
-
const props = __props;
|
|
33
|
-
/**
|
|
34
|
-
* 图标命名空间
|
|
35
|
-
*/
|
|
36
|
-
const namespace = computed(() => {
|
|
37
|
-
const value = props.value;
|
|
38
|
-
if (!value) return void 0;
|
|
39
|
-
if (value.includes(":")) return value.split(":")[0];
|
|
40
|
-
else if (value.startsWith("preset-")) return IconNamespaceEnum.Preset;
|
|
41
|
-
});
|
|
42
|
-
/**
|
|
43
|
-
* 图标实际名称
|
|
44
|
-
*/
|
|
45
|
-
const iconName = computed(() => {
|
|
46
|
-
const value = props.value;
|
|
47
|
-
if (!value) return void 0;
|
|
48
|
-
if (value.includes(":")) return value.split(":")[1];
|
|
49
|
-
return props.value;
|
|
50
|
-
});
|
|
51
|
-
const iconBgImage = computed(() => {
|
|
52
|
-
return `url('${fileUrlParser(iconName.value)}')`;
|
|
53
|
-
});
|
|
54
|
-
return (_ctx, _cache) => {
|
|
55
|
-
return namespace.value === unref(IconNamespaceEnum).IconPark ? (openBlock(), createBlock(unref(IconPark), {
|
|
56
|
-
key: `${iconName.value}-${__props.size}`,
|
|
57
|
-
type: iconName.value,
|
|
58
|
-
style: normalizeStyle({
|
|
59
|
-
"--color": __props.color,
|
|
60
|
-
"--bg-color": __props.background
|
|
61
|
-
}),
|
|
62
|
-
class: "icon-next",
|
|
63
|
-
size: __props.size
|
|
64
|
-
}, null, 8, [
|
|
65
|
-
"type",
|
|
66
|
-
"style",
|
|
67
|
-
"size"
|
|
68
|
-
])) : namespace.value === unref(IconNamespaceEnum).Preset || namespace.value === unref(IconNamespaceEnum).Platform ? (openBlock(), createBlock(svg_icon_default, {
|
|
69
|
-
key: 1,
|
|
70
|
-
name: iconName.value,
|
|
71
|
-
style: normalizeStyle({
|
|
72
|
-
"--color": __props.color,
|
|
73
|
-
"--bg-color": __props.background
|
|
74
|
-
}),
|
|
75
|
-
class: "icon-next",
|
|
76
|
-
size: __props.size
|
|
77
|
-
}, null, 8, [
|
|
78
|
-
"name",
|
|
79
|
-
"style",
|
|
80
|
-
"size"
|
|
81
|
-
])) : namespace.value === unref(IconNamespaceEnum).Asset ? (openBlock(), createElementBlock("i", {
|
|
82
|
-
key: 2,
|
|
83
|
-
class: "icon-next",
|
|
84
|
-
style: normalizeStyle({
|
|
85
|
-
"--size": __props.size + "px",
|
|
86
|
-
"--bg-image": iconBgImage.value
|
|
87
|
-
})
|
|
88
|
-
}, null, 4)) : namespace.value === unref(IconNamespaceEnum).GctIconFont ? (openBlock(), createElementBlock("i", {
|
|
89
|
-
key: 3,
|
|
90
|
-
class: normalizeClass([`gct-iconfont ${iconName.value}`, "icon-next"]),
|
|
91
|
-
style: normalizeStyle({
|
|
92
|
-
fontSize: __props.size + "px",
|
|
93
|
-
lineHeight: 1,
|
|
94
|
-
"--color": __props.color,
|
|
95
|
-
"--bg-color": __props.background,
|
|
96
|
-
"--size": __props.size + "px"
|
|
97
|
-
})
|
|
98
|
-
}, null, 6)) : (openBlock(), createElementBlock("i", {
|
|
99
|
-
key: 4,
|
|
100
|
-
class: normalizeClass([`iconfont ${iconName.value}`, "icon-next"]),
|
|
101
|
-
style: normalizeStyle({
|
|
102
|
-
fontSize: __props.size + "px",
|
|
103
|
-
lineHeight: 1,
|
|
104
|
-
"--color": __props.color,
|
|
105
|
-
"--bg-color": __props.background,
|
|
106
|
-
"--size": __props.size + "px"
|
|
107
|
-
})
|
|
108
|
-
}, null, 6));
|
|
109
|
-
};
|
|
110
|
-
}
|
|
111
|
-
});
|
|
112
|
-
//#endregion
|
|
113
|
-
export { IconNext_vue_vue_type_script_setup_true_name_IconNext_lang_default as default };
|