@gct-paas/core-web 0.1.4-dev.17 → 0.1.4-dev.19
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/chunk-lEgNpoW5.js +1 -0
- package/dist/cropper-DyP6CFER.js +1 -0
- package/dist/{de_DE-WZ3EB5Ei.js → de_DE-DIDpd1gQ.js} +1 -1
- package/dist/{en_US-CsMalKr8.js → en_US-BaP-b1tP.js} +1 -1
- package/dist/{es_ES-B9hxIQ3B.js → es_ES-NOVlNQnw.js} +1 -1
- package/dist/{fr_FR-C6_kWsnc.js → fr_FR-Bk_x0L7S.js} +1 -1
- package/dist/index.min.css +1 -1
- package/dist/{ja_JP-Bh5yjd5R.js → ja_JP-CeseBQS9.js} +1 -1
- package/dist/loader.esm.min.js +1 -1
- package/dist/{monaco-editor-BhuLUOmL.js → monaco-editor-DCEyjUmJ.js} +1 -1
- package/dist/{pt_PT-BWSTPDc8.js → pt_PT-DFlFmzXZ.js} +1 -1
- package/dist/{ru_RU-BhsOXNnH.js → ru_RU-C5XPaRfl.js} +1 -1
- package/dist/{tr_TR-DFflgWBG.js → tr_TR-CODhj5X1.js} +1 -1
- package/dist/useMonacoEditor-kyCCXYcK.js +1 -0
- package/dist/{vi_VN-pWDyqq2t.js → vi_VN-BjwID8XV.js} +1 -1
- package/dist/{zh_CN-TmE4LVWm.js → zh_CN-BKmwBYsr.js} +1 -1
- package/dist/{zh_TW-CkLTTF7p.js → zh_TW-BSGEo2Qx.js} +1 -1
- package/es/components/icon-next/src/IconNext.vue.d.ts +2 -2
- package/es/components/icon-next/src/IconNext.vue.mjs +2 -2
- package/es/components/icon-next/src/IconNext.vue_vue_type_script_setup_true_name_IconNext_lang.mjs +1 -1
- package/es/components/icon-next/src/{IconNext.vue_vue_type_style_index_0_scoped_c5a83130_lang.css → IconNext.vue_vue_type_style_index_0_scoped_360a87c9_lang.css} +3 -3
- package/es/components/icon-next/src/IconNextPicker.vue_vue_type_style_index_0_lang.css +3 -0
- package/es/index.d.ts +2 -1
- package/es/index.mjs +10 -2
- 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/global-modal/src/props.mjs +2 -4
- package/es/modules/picture-cropper/index.d.ts +6 -0
- package/es/modules/picture-cropper/index.mjs +5 -0
- package/es/modules/{Cropper → picture-cropper}/src/CopperFreeModal.vue.d.ts +2 -3
- package/es/modules/{Cropper → picture-cropper}/src/CopperFreeModal.vue.mjs +3 -3
- package/es/modules/{Cropper → picture-cropper}/src/CopperFreeModal.vue_vue_type_script_setup_true_name_CropperModal_lang.mjs +1 -1
- package/es/modules/{Cropper/src/CopperFreeModal.vue_vue_type_style_index_0_scoped_d24895d3_lang.css → picture-cropper/src/CopperFreeModal.vue_vue_type_style_index_0_scoped_488ed4c7_lang.css} +10 -10
- package/es/modules/{Cropper → picture-cropper}/src/CopperModal.vue.d.ts +2 -3
- package/es/modules/{Cropper → picture-cropper}/src/CopperModal.vue.mjs +3 -3
- package/es/modules/{Cropper → picture-cropper}/src/CopperModal.vue_vue_type_script_setup_true_name_CropperModal_lang.mjs +1 -1
- package/es/modules/{Cropper/src/CopperModal.vue_vue_type_style_index_0_scoped_a65b9ff7_lang.css → picture-cropper/src/CopperModal.vue_vue_type_style_index_0_scoped_ceff5f65_lang.css} +14 -14
- package/es/modules/{Cropper → picture-cropper}/src/Cropper.vue.mjs +1 -1
- package/es/modules/{Cropper → picture-cropper}/src/Cropper.vue_vue_type_script_lang.mjs +3 -4
- package/es/modules/{Cropper → picture-cropper}/src/CropperAvatar.vue.d.ts +2 -3
- package/es/modules/{Cropper → picture-cropper}/src/CropperAvatar.vue.mjs +3 -3
- package/es/modules/{Cropper → picture-cropper}/src/CropperAvatar.vue_vue_type_script_setup_true_name_CropperAvatar_lang.mjs +10 -9
- package/es/modules/{Cropper/src/CropperAvatar.vue_vue_type_style_index_0_scoped_683cf5bb_lang.css → picture-cropper/src/CropperAvatar.vue_vue_type_style_index_0_scoped_af219c4c_lang.css} +7 -7
- package/es/modules/{Cropper → picture-cropper}/src/CropperFree.vue.d.ts +2 -3
- package/es/modules/{Cropper → picture-cropper}/src/CropperFree.vue.mjs +3 -3
- package/es/modules/{Cropper → picture-cropper}/src/CropperFree.vue_vue_type_script_setup_true_name_CropperPhoto_lang.mjs +22 -17
- package/es/modules/{Cropper/src/CropperFree.vue_vue_type_style_index_0_scoped_dc019220_lang.css → picture-cropper/src/CropperFree.vue_vue_type_style_index_0_scoped_f287eb8f_lang.css} +16 -16
- package/es/modules/picture-preview/index.d.ts +2 -0
- package/es/modules/picture-preview/index.mjs +2 -0
- package/es/modules/picture-preview/src/Functional.vue.d.ts +60 -0
- package/es/modules/picture-preview/src/Functional.vue.mjs +6 -0
- package/es/modules/picture-preview/src/Functional.vue_vue_type_script_lang.mjs +287 -0
- package/es/modules/picture-preview/src/Functional.vue_vue_type_style_index_0_lang.css +101 -0
- package/es/modules/picture-preview/src/functional.d.ts +2 -0
- package/es/modules/picture-preview/src/functional.mjs +19 -0
- package/es/modules/picture-preview/src/picture-preview.vue.d.ts +51 -0
- package/es/modules/picture-preview/src/picture-preview.vue.mjs +6 -0
- package/es/modules/picture-preview/src/picture-preview.vue_vue_type_script_setup_true_lang.mjs +49 -0
- package/es/modules/picture-preview/src/picture-preview.vue_vue_type_style_index_0_lang.css +70 -0
- package/es/modules/picture-preview/src/typing.d.ts +51 -0
- package/package.json +5 -5
- package/dist/BpmnApproval.vue-BQUAB11v.js +0 -1
- package/dist/BpmnBusiness.vue-C5duJF50.js +0 -1
- package/dist/BpmnEnd.vue-BjEcQnG0.js +0 -1
- package/dist/BpmnExclusive.vue-Cx276gAF.js +0 -1
- package/dist/BpmnForm.vue-CF07AB3T.js +0 -1
- package/dist/BpmnJoin.vue-DZgck71H.js +0 -1
- package/dist/BpmnJs.vue-BdKux96j.js +0 -1
- package/dist/BpmnMessage.vue-DABYKBdz.js +0 -1
- package/dist/BpmnParallel.vue-CUi6RogD.js +0 -1
- package/dist/BpmnStart.vue-lvEOgVJW.js +0 -1
- package/dist/NodeFlow.vue-DsiKwCpI.js +0 -1
- package/dist/NodeTools.vue-CKtwcfn2.js +0 -1
- package/dist/NodeTooltips.vue-BuKpNXoA.js +0 -1
- package/dist/enums-DefcbOFc.js +0 -1
- package/dist/node-popover.vue-CnA0OEQf.js +0 -1
- package/dist/useGctBpmn-wMjCfvFc.js +0 -1
- package/dist/useMonacoEditor-no1c2RQN.js +0 -1
- package/es/modules/Cropper/index.d.ts +0 -5
- package/es/modules/Cropper/index.mjs +0 -11
- package/es/modules/Cropper/src/typing.d.ts +0 -11
- /package/dist/{objectSpread2-BL8YUfIz.js → objectSpread2-Cr8AaZiL.js} +0 -0
- /package/es/modules/gct-table/editor/{gct-table-text/gct-table-text.css → gct-table-date/gct-table-date.css} +0 -0
- /package/es/modules/{Cropper → picture-cropper}/src/Cropper.vue.d.ts +0 -0
- /package/es/modules/{Cropper → picture-cropper}/src/Cropper.vue_vue_type_style_index_0_lang.css +0 -0
|
@@ -0,0 +1,287 @@
|
|
|
1
|
+
import { computed, createTextVNode, createVNode, defineComponent, reactive, ref, unref, watchEffect } from "vue";
|
|
2
|
+
import { CloseOutlined, LeftOutlined, RightOutlined } from "@ant-design/icons-vue";
|
|
3
|
+
//#region src/modules/picture-preview/src/Functional.vue?vue&type=script&lang.tsx
|
|
4
|
+
var StatueEnum = /* @__PURE__ */ function(StatueEnum) {
|
|
5
|
+
StatueEnum[StatueEnum["LOADING"] = 0] = "LOADING";
|
|
6
|
+
StatueEnum[StatueEnum["DONE"] = 1] = "DONE";
|
|
7
|
+
StatueEnum[StatueEnum["FAIL"] = 2] = "FAIL";
|
|
8
|
+
return StatueEnum;
|
|
9
|
+
}(StatueEnum || {});
|
|
10
|
+
var props = {
|
|
11
|
+
show: {
|
|
12
|
+
type: Boolean,
|
|
13
|
+
default: false
|
|
14
|
+
},
|
|
15
|
+
imageList: {
|
|
16
|
+
type: Array,
|
|
17
|
+
default: null
|
|
18
|
+
},
|
|
19
|
+
index: {
|
|
20
|
+
type: Number,
|
|
21
|
+
default: 0
|
|
22
|
+
},
|
|
23
|
+
scaleStep: { type: Number },
|
|
24
|
+
defaultWidth: { type: Number },
|
|
25
|
+
maskClosable: { type: Boolean },
|
|
26
|
+
rememberState: { type: Boolean }
|
|
27
|
+
};
|
|
28
|
+
var prefixCls = "img-preview";
|
|
29
|
+
var Functional_vue_vue_type_script_lang_default = /* @__PURE__ */ defineComponent({
|
|
30
|
+
name: "ImagePreview",
|
|
31
|
+
props,
|
|
32
|
+
emits: ["img-load", "img-error"],
|
|
33
|
+
setup(props, { expose, emit }) {
|
|
34
|
+
const stateMap = /* @__PURE__ */ new Map();
|
|
35
|
+
const imgState = reactive({
|
|
36
|
+
currentUrl: "",
|
|
37
|
+
imgScale: 1,
|
|
38
|
+
imgRotate: 0,
|
|
39
|
+
imgTop: 0,
|
|
40
|
+
imgLeft: 0,
|
|
41
|
+
status: StatueEnum.LOADING,
|
|
42
|
+
currentIndex: 0,
|
|
43
|
+
moveX: 0,
|
|
44
|
+
moveY: 0,
|
|
45
|
+
show: props.show
|
|
46
|
+
});
|
|
47
|
+
const wrapElRef = ref(null);
|
|
48
|
+
const imgElRef = ref(null);
|
|
49
|
+
function init() {
|
|
50
|
+
initMouseWheel();
|
|
51
|
+
const { index, imageList } = props;
|
|
52
|
+
if (!imageList || !imageList.length) throw new Error("imageList is undefined");
|
|
53
|
+
imgState.currentIndex = index;
|
|
54
|
+
handleIChangeImage(imageList[index]);
|
|
55
|
+
}
|
|
56
|
+
function initState() {
|
|
57
|
+
imgState.imgScale = 1;
|
|
58
|
+
imgState.imgRotate = 0;
|
|
59
|
+
imgState.imgTop = 0;
|
|
60
|
+
imgState.imgLeft = 0;
|
|
61
|
+
}
|
|
62
|
+
function initMouseWheel() {
|
|
63
|
+
const wrapEl = unref(wrapElRef);
|
|
64
|
+
if (!wrapEl) return;
|
|
65
|
+
wrapEl.onmousewheel = scrollFunc;
|
|
66
|
+
document.body.addEventListener("DOMMouseScroll", scrollFunc);
|
|
67
|
+
document.ondragstart = function() {
|
|
68
|
+
return false;
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
const getScaleStep = computed(() => {
|
|
72
|
+
const scaleStep = props?.scaleStep ?? 0;
|
|
73
|
+
if (scaleStep > 0 && scaleStep < 100) return scaleStep / 100;
|
|
74
|
+
else return imgState.imgScale / 10;
|
|
75
|
+
});
|
|
76
|
+
function scrollFunc(e) {
|
|
77
|
+
e = e || window.event;
|
|
78
|
+
e.delta = e.wheelDelta || -e.detail;
|
|
79
|
+
e.preventDefault();
|
|
80
|
+
if (e.delta > 0) scaleFunc(getScaleStep.value);
|
|
81
|
+
if (e.delta < 0) scaleFunc(-getScaleStep.value);
|
|
82
|
+
}
|
|
83
|
+
function scaleFunc(num) {
|
|
84
|
+
const MIN_SCALE = .02;
|
|
85
|
+
const GRA = .1;
|
|
86
|
+
if (imgState.imgScale <= .2 && num < 0) return;
|
|
87
|
+
imgState.imgScale += num * GRA;
|
|
88
|
+
if (imgState.imgScale < 0) imgState.imgScale = MIN_SCALE;
|
|
89
|
+
}
|
|
90
|
+
function rotateFunc(deg) {
|
|
91
|
+
imgState.imgRotate += deg;
|
|
92
|
+
}
|
|
93
|
+
function handleMouseUp() {
|
|
94
|
+
const imgEl = unref(imgElRef);
|
|
95
|
+
if (!imgEl) return;
|
|
96
|
+
imgEl.onmousemove = null;
|
|
97
|
+
}
|
|
98
|
+
function handleIChangeImage(url) {
|
|
99
|
+
imgState.status = StatueEnum.LOADING;
|
|
100
|
+
const img = new Image();
|
|
101
|
+
img.src = url;
|
|
102
|
+
img.onload = (e) => {
|
|
103
|
+
if (imgState.currentUrl !== url) {
|
|
104
|
+
const ele = e.composedPath();
|
|
105
|
+
if (props.rememberState) {
|
|
106
|
+
stateMap.set(imgState.currentUrl, {
|
|
107
|
+
scale: imgState.imgScale,
|
|
108
|
+
top: imgState.imgTop,
|
|
109
|
+
left: imgState.imgLeft,
|
|
110
|
+
rotate: imgState.imgRotate
|
|
111
|
+
});
|
|
112
|
+
const stateInfo = stateMap.get(url);
|
|
113
|
+
if (stateInfo) {
|
|
114
|
+
imgState.imgScale = stateInfo.scale;
|
|
115
|
+
imgState.imgTop = stateInfo.top;
|
|
116
|
+
imgState.imgRotate = stateInfo.rotate;
|
|
117
|
+
imgState.imgLeft = stateInfo.left;
|
|
118
|
+
} else {
|
|
119
|
+
initState();
|
|
120
|
+
if (props.defaultWidth) imgState.imgScale = props.defaultWidth / ele[0].naturalWidth;
|
|
121
|
+
}
|
|
122
|
+
} else if (props.defaultWidth) imgState.imgScale = props.defaultWidth / ele[0].naturalWidth;
|
|
123
|
+
ele && emit("img-load", {
|
|
124
|
+
index: imgState.currentIndex,
|
|
125
|
+
dom: ele[0],
|
|
126
|
+
url
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
imgState.currentUrl = url;
|
|
130
|
+
imgState.status = StatueEnum.DONE;
|
|
131
|
+
};
|
|
132
|
+
img.onerror = (e) => {
|
|
133
|
+
const ele = e.composedPath();
|
|
134
|
+
ele && emit("img-error", {
|
|
135
|
+
index: imgState.currentIndex,
|
|
136
|
+
dom: ele[0],
|
|
137
|
+
url
|
|
138
|
+
});
|
|
139
|
+
imgState.status = StatueEnum.FAIL;
|
|
140
|
+
};
|
|
141
|
+
}
|
|
142
|
+
function handleClose(e) {
|
|
143
|
+
e && e.stopPropagation();
|
|
144
|
+
close();
|
|
145
|
+
}
|
|
146
|
+
function close() {
|
|
147
|
+
imgState.show = false;
|
|
148
|
+
document.body.removeEventListener("DOMMouseScroll", scrollFunc);
|
|
149
|
+
document.ondragstart = null;
|
|
150
|
+
}
|
|
151
|
+
function resume() {
|
|
152
|
+
initState();
|
|
153
|
+
}
|
|
154
|
+
expose({
|
|
155
|
+
resume,
|
|
156
|
+
close,
|
|
157
|
+
prev: handleChange.bind(null, "left"),
|
|
158
|
+
next: handleChange.bind(null, "right"),
|
|
159
|
+
setScale: (scale) => {
|
|
160
|
+
if (scale > 0 && scale <= 10) imgState.imgScale = scale;
|
|
161
|
+
},
|
|
162
|
+
setRotate: (rotate) => {
|
|
163
|
+
imgState.imgRotate = rotate;
|
|
164
|
+
}
|
|
165
|
+
});
|
|
166
|
+
function handleChange(direction) {
|
|
167
|
+
const { currentIndex } = imgState;
|
|
168
|
+
const { imageList } = props;
|
|
169
|
+
if (direction === "left") {
|
|
170
|
+
imgState.currentIndex -= 1;
|
|
171
|
+
if (currentIndex <= 0) imgState.currentIndex = imageList.length - 1;
|
|
172
|
+
}
|
|
173
|
+
if (direction === "right") {
|
|
174
|
+
imgState.currentIndex += 1;
|
|
175
|
+
if (currentIndex >= imageList.length - 1) imgState.currentIndex = 0;
|
|
176
|
+
}
|
|
177
|
+
handleIChangeImage(imageList[imgState.currentIndex]);
|
|
178
|
+
}
|
|
179
|
+
function handleAddMoveListener(e) {
|
|
180
|
+
e = e || window.event;
|
|
181
|
+
imgState.moveX = e.clientX;
|
|
182
|
+
imgState.moveY = e.clientY;
|
|
183
|
+
const imgEl = unref(imgElRef);
|
|
184
|
+
if (imgEl) imgEl.onmousemove = moveFunc;
|
|
185
|
+
}
|
|
186
|
+
function moveFunc(e) {
|
|
187
|
+
e = e || window.event;
|
|
188
|
+
e.preventDefault();
|
|
189
|
+
const movementX = e.clientX - imgState.moveX;
|
|
190
|
+
const movementY = e.clientY - imgState.moveY;
|
|
191
|
+
imgState.imgLeft += movementX;
|
|
192
|
+
imgState.imgTop += movementY;
|
|
193
|
+
imgState.moveX = e.clientX;
|
|
194
|
+
imgState.moveY = e.clientY;
|
|
195
|
+
}
|
|
196
|
+
const getImageStyle = computed(() => {
|
|
197
|
+
const { imgScale, imgRotate, imgTop, imgLeft } = imgState;
|
|
198
|
+
return {
|
|
199
|
+
transform: `scale(${imgScale}) rotate(${imgRotate}deg)`,
|
|
200
|
+
marginTop: `${imgTop}px`,
|
|
201
|
+
marginLeft: `${imgLeft}px`,
|
|
202
|
+
maxWidth: props.defaultWidth ? "unset" : "100%"
|
|
203
|
+
};
|
|
204
|
+
});
|
|
205
|
+
const getIsMultipleImage = computed(() => {
|
|
206
|
+
const { imageList } = props;
|
|
207
|
+
return imageList.length > 1;
|
|
208
|
+
});
|
|
209
|
+
watchEffect(() => {
|
|
210
|
+
if (props.show) init();
|
|
211
|
+
if (props.imageList) initState();
|
|
212
|
+
});
|
|
213
|
+
const handleMaskClick = (e) => {
|
|
214
|
+
if (props.maskClosable && e.target && e.target.classList.contains(`${prefixCls}-content`)) handleClose(e);
|
|
215
|
+
};
|
|
216
|
+
const renderClose = () => {
|
|
217
|
+
return createVNode("div", {
|
|
218
|
+
"class": `${prefixCls}__close`,
|
|
219
|
+
"onClick": handleClose
|
|
220
|
+
}, [createVNode(CloseOutlined, { "class": `${prefixCls}__close-icon` }, null)]);
|
|
221
|
+
};
|
|
222
|
+
const renderIndex = () => {
|
|
223
|
+
if (!unref(getIsMultipleImage)) return null;
|
|
224
|
+
const { currentIndex } = imgState;
|
|
225
|
+
const { imageList } = props;
|
|
226
|
+
return createVNode("div", { "class": `${prefixCls}__index` }, [
|
|
227
|
+
currentIndex + 1,
|
|
228
|
+
createTextVNode(" / "),
|
|
229
|
+
imageList.length
|
|
230
|
+
]);
|
|
231
|
+
};
|
|
232
|
+
const renderController = () => {
|
|
233
|
+
return createVNode("div", { "class": `${prefixCls}__controller` }, [
|
|
234
|
+
createVNode("div", {
|
|
235
|
+
"class": `${prefixCls}__controller-item`,
|
|
236
|
+
"onClick": () => scaleFunc(-getScaleStep.value)
|
|
237
|
+
}, [createVNode("img", { "src": "/extras-assets/svg/preview/unscale.svg" }, null)]),
|
|
238
|
+
createVNode("div", {
|
|
239
|
+
"class": `${prefixCls}__controller-item`,
|
|
240
|
+
"onClick": () => scaleFunc(getScaleStep.value)
|
|
241
|
+
}, [createVNode("img", { "src": "/extras-assets/svg/preview/scale.svg" }, null)]),
|
|
242
|
+
createVNode("div", {
|
|
243
|
+
"class": `${prefixCls}__controller-item`,
|
|
244
|
+
"onClick": resume
|
|
245
|
+
}, [createVNode("img", { "src": "/extras-assets/svg/preview/resume.svg" }, null)]),
|
|
246
|
+
createVNode("div", {
|
|
247
|
+
"class": `${prefixCls}__controller-item`,
|
|
248
|
+
"onClick": () => rotateFunc(-90)
|
|
249
|
+
}, [createVNode("img", { "src": "/extras-assets/svg/preview/unrotate.svg" }, null)]),
|
|
250
|
+
createVNode("div", {
|
|
251
|
+
"class": `${prefixCls}__controller-item`,
|
|
252
|
+
"onClick": () => rotateFunc(90)
|
|
253
|
+
}, [createVNode("img", { "src": "/extras-assets/svg/preview/p-rotate.svg" }, null)])
|
|
254
|
+
]);
|
|
255
|
+
};
|
|
256
|
+
const renderArrow = (direction) => {
|
|
257
|
+
if (!unref(getIsMultipleImage)) return null;
|
|
258
|
+
return createVNode("div", {
|
|
259
|
+
"class": [`${prefixCls}__arrow`, direction],
|
|
260
|
+
"onClick": () => handleChange(direction)
|
|
261
|
+
}, [direction === "left" ? createVNode(LeftOutlined, null, null) : createVNode(RightOutlined, null, null)]);
|
|
262
|
+
};
|
|
263
|
+
return () => {
|
|
264
|
+
return imgState.show && createVNode("div", {
|
|
265
|
+
"class": prefixCls,
|
|
266
|
+
"ref": wrapElRef,
|
|
267
|
+
"onMouseup": handleMouseUp,
|
|
268
|
+
"onClick": handleMaskClick
|
|
269
|
+
}, [createVNode("div", { "class": `${prefixCls}-content` }, [
|
|
270
|
+
createVNode("img", {
|
|
271
|
+
"style": unref(getImageStyle),
|
|
272
|
+
"class": [`${prefixCls}-image`, imgState.status === StatueEnum.DONE ? "" : "hidden"],
|
|
273
|
+
"ref": imgElRef,
|
|
274
|
+
"src": imgState.currentUrl,
|
|
275
|
+
"onMousedown": handleAddMoveListener
|
|
276
|
+
}, null),
|
|
277
|
+
renderClose(),
|
|
278
|
+
renderIndex(),
|
|
279
|
+
renderController(),
|
|
280
|
+
renderArrow("left"),
|
|
281
|
+
renderArrow("right")
|
|
282
|
+
])]);
|
|
283
|
+
};
|
|
284
|
+
}
|
|
285
|
+
});
|
|
286
|
+
//#endregion
|
|
287
|
+
export { Functional_vue_vue_type_script_lang_default as default };
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
.img-preview {
|
|
2
|
+
position: fixed;
|
|
3
|
+
z-index: 9999;
|
|
4
|
+
inset: 0;
|
|
5
|
+
background: rgba(0, 0, 0, 0.5);
|
|
6
|
+
user-select: none;
|
|
7
|
+
}
|
|
8
|
+
.img-preview-content {
|
|
9
|
+
display: flex;
|
|
10
|
+
align-items: center;
|
|
11
|
+
justify-content: center;
|
|
12
|
+
width: 100%;
|
|
13
|
+
height: 100%;
|
|
14
|
+
color: var(--gct-color-white);
|
|
15
|
+
}
|
|
16
|
+
.img-preview-image {
|
|
17
|
+
transition: transform 0.3s;
|
|
18
|
+
cursor: pointer;
|
|
19
|
+
}
|
|
20
|
+
.img-preview__close {
|
|
21
|
+
position: absolute;
|
|
22
|
+
top: -40px;
|
|
23
|
+
right: -40px;
|
|
24
|
+
width: 80px;
|
|
25
|
+
height: 80px;
|
|
26
|
+
overflow: hidden;
|
|
27
|
+
transition: all 0.2s;
|
|
28
|
+
border-radius: 50%;
|
|
29
|
+
background-color: rgba(0, 0, 0, 0.5);
|
|
30
|
+
color: var(--gct-color-white);
|
|
31
|
+
cursor: pointer;
|
|
32
|
+
}
|
|
33
|
+
.img-preview__close-icon {
|
|
34
|
+
position: absolute;
|
|
35
|
+
top: 46px;
|
|
36
|
+
left: 16px;
|
|
37
|
+
font-size: 16px;
|
|
38
|
+
}
|
|
39
|
+
.img-preview__close:hover {
|
|
40
|
+
background-color: rgba(0, 0, 0, 0.8);
|
|
41
|
+
}
|
|
42
|
+
.img-preview__index {
|
|
43
|
+
position: absolute;
|
|
44
|
+
bottom: 5%;
|
|
45
|
+
left: 50%;
|
|
46
|
+
padding: 0 22px;
|
|
47
|
+
transform: translateX(-50%);
|
|
48
|
+
border-radius: 15px;
|
|
49
|
+
background: rgba(109, 109, 109, 0.6);
|
|
50
|
+
font-size: 16px;
|
|
51
|
+
}
|
|
52
|
+
.img-preview__controller {
|
|
53
|
+
display: flex;
|
|
54
|
+
position: absolute;
|
|
55
|
+
bottom: 10%;
|
|
56
|
+
left: 50%;
|
|
57
|
+
justify-content: center;
|
|
58
|
+
width: 260px;
|
|
59
|
+
height: 44px;
|
|
60
|
+
margin-left: -139px;
|
|
61
|
+
padding: 0 22px;
|
|
62
|
+
border-radius: 22px;
|
|
63
|
+
background: rgba(109, 109, 109, 0.6);
|
|
64
|
+
}
|
|
65
|
+
.img-preview__controller-item {
|
|
66
|
+
display: flex;
|
|
67
|
+
height: 100%;
|
|
68
|
+
padding: 0 9px;
|
|
69
|
+
transition: all 0.2s;
|
|
70
|
+
font-size: 24px;
|
|
71
|
+
cursor: pointer;
|
|
72
|
+
}
|
|
73
|
+
.img-preview__controller-item:hover {
|
|
74
|
+
transform: scale(1.2);
|
|
75
|
+
}
|
|
76
|
+
.img-preview__controller-item img {
|
|
77
|
+
width: 1em;
|
|
78
|
+
}
|
|
79
|
+
.img-preview__arrow {
|
|
80
|
+
display: flex;
|
|
81
|
+
position: absolute;
|
|
82
|
+
top: 50%;
|
|
83
|
+
align-items: center;
|
|
84
|
+
justify-content: center;
|
|
85
|
+
width: 50px;
|
|
86
|
+
height: 50px;
|
|
87
|
+
transition: all 0.2s;
|
|
88
|
+
border-radius: 50%;
|
|
89
|
+
background-color: rgba(0, 0, 0, 0.5);
|
|
90
|
+
font-size: 28px;
|
|
91
|
+
cursor: pointer;
|
|
92
|
+
}
|
|
93
|
+
.img-preview__arrow:hover {
|
|
94
|
+
background-color: rgba(0, 0, 0, 0.8);
|
|
95
|
+
}
|
|
96
|
+
.img-preview__arrow.left {
|
|
97
|
+
left: 50px;
|
|
98
|
+
}
|
|
99
|
+
.img-preview__arrow.right {
|
|
100
|
+
right: 50px;
|
|
101
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import Functional_default from "./Functional.vue.mjs";
|
|
2
|
+
import { createVNode, render } from "vue";
|
|
3
|
+
//#region src/modules/picture-preview/src/functional.ts
|
|
4
|
+
var instance = null;
|
|
5
|
+
function createImgPreview(options) {
|
|
6
|
+
const propsData = {};
|
|
7
|
+
const container = document.createElement("div");
|
|
8
|
+
Object.assign(propsData, {
|
|
9
|
+
show: true,
|
|
10
|
+
index: 0,
|
|
11
|
+
scaleStep: 100
|
|
12
|
+
}, options);
|
|
13
|
+
instance = createVNode(Functional_default, propsData);
|
|
14
|
+
render(instance, container);
|
|
15
|
+
document.body.appendChild(container);
|
|
16
|
+
return instance.component?.exposed;
|
|
17
|
+
}
|
|
18
|
+
//#endregion
|
|
19
|
+
export { createImgPreview };
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { PropType } from 'vue';
|
|
2
|
+
interface ImageProps {
|
|
3
|
+
alt?: string;
|
|
4
|
+
fallback?: string;
|
|
5
|
+
src: string;
|
|
6
|
+
width: string | number;
|
|
7
|
+
height?: string | number;
|
|
8
|
+
placeholder?: string | boolean;
|
|
9
|
+
preview?: boolean | {
|
|
10
|
+
visible?: boolean;
|
|
11
|
+
onVisibleChange?: (visible: boolean, prevVisible: boolean) => void;
|
|
12
|
+
getContainer: string | HTMLElement | (() => HTMLElement);
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
type ImageItem = string | ImageProps;
|
|
16
|
+
declare function __VLS_template(): {
|
|
17
|
+
attrs: Partial<{}>;
|
|
18
|
+
slots: {
|
|
19
|
+
default?(_: {}): any;
|
|
20
|
+
};
|
|
21
|
+
refs: {};
|
|
22
|
+
rootEl: HTMLDivElement;
|
|
23
|
+
};
|
|
24
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
25
|
+
declare const __VLS_component: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
|
|
26
|
+
functional: {
|
|
27
|
+
type: BooleanConstructor;
|
|
28
|
+
};
|
|
29
|
+
imageList: {
|
|
30
|
+
type: PropType<ImageItem[]>;
|
|
31
|
+
default: () => never[];
|
|
32
|
+
};
|
|
33
|
+
}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
34
|
+
functional: {
|
|
35
|
+
type: BooleanConstructor;
|
|
36
|
+
};
|
|
37
|
+
imageList: {
|
|
38
|
+
type: PropType<ImageItem[]>;
|
|
39
|
+
default: () => never[];
|
|
40
|
+
};
|
|
41
|
+
}>> & Readonly<{}>, {
|
|
42
|
+
functional: boolean;
|
|
43
|
+
imageList: ImageItem[];
|
|
44
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, HTMLDivElement>;
|
|
45
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
46
|
+
export default _default;
|
|
47
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
48
|
+
new (): {
|
|
49
|
+
$slots: S;
|
|
50
|
+
};
|
|
51
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import picture_preview_vue_vue_type_script_setup_true_lang_default from "./picture-preview.vue_vue_type_script_setup_true_lang.mjs";
|
|
2
|
+
import './picture-preview.vue_vue_type_style_index_0_lang.css';/* empty css */
|
|
3
|
+
//#region src/modules/picture-preview/src/picture-preview.vue
|
|
4
|
+
var picture_preview_default = picture_preview_vue_vue_type_script_setup_true_lang_default;
|
|
5
|
+
//#endregion
|
|
6
|
+
export { picture_preview_default as default };
|
package/es/modules/picture-preview/src/picture-preview.vue_vue_type_script_setup_true_lang.mjs
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { Fragment, computed, createBlock, createElementBlock, createSlots, createVNode, defineComponent, mergeProps, normalizeClass, openBlock, renderList, renderSlot, resolveComponent, unref, withCtx } from "vue";
|
|
2
|
+
import { isString } from "lodash-es";
|
|
3
|
+
import { useNamespace } from "@gct-paas/core";
|
|
4
|
+
import { Image } from "ant-design-vue";
|
|
5
|
+
//#region src/modules/picture-preview/src/picture-preview.vue?vue&type=script&setup=true&lang.ts
|
|
6
|
+
var picture_preview_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
|
|
7
|
+
__name: "picture-preview",
|
|
8
|
+
props: {
|
|
9
|
+
functional: { type: Boolean },
|
|
10
|
+
imageList: {
|
|
11
|
+
type: Array,
|
|
12
|
+
default: () => []
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
setup(__props) {
|
|
16
|
+
const props = __props;
|
|
17
|
+
const ns = useNamespace("image-preview");
|
|
18
|
+
const getImageList = computed(() => {
|
|
19
|
+
return props.imageList.map((item) => {
|
|
20
|
+
if (isString(item)) return {
|
|
21
|
+
src: item,
|
|
22
|
+
placeholder: false
|
|
23
|
+
};
|
|
24
|
+
return item;
|
|
25
|
+
});
|
|
26
|
+
});
|
|
27
|
+
return (_ctx, _cache) => {
|
|
28
|
+
const _component_PreviewGroup = resolveComponent("PreviewGroup");
|
|
29
|
+
return openBlock(), createElementBlock("div", { class: normalizeClass(unref(ns).b()) }, [createVNode(_component_PreviewGroup, null, {
|
|
30
|
+
default: withCtx(() => [!__props.imageList || _ctx.$slots.default ? renderSlot(_ctx.$slots, "default", { key: 0 }) : (openBlock(true), createElementBlock(Fragment, { key: 1 }, renderList(getImageList.value, (item) => {
|
|
31
|
+
return openBlock(), createBlock(unref(Image), mergeProps({
|
|
32
|
+
key: item.src,
|
|
33
|
+
ref_for: true
|
|
34
|
+
}, item), createSlots({ _: 2 }, [item.placeholder ? {
|
|
35
|
+
name: "placeholder",
|
|
36
|
+
fn: withCtx(() => [createVNode(unref(Image), mergeProps({ ref_for: true }, item, {
|
|
37
|
+
src: item.placeholder,
|
|
38
|
+
preview: false
|
|
39
|
+
}), null, 16, ["src"])]),
|
|
40
|
+
key: "0"
|
|
41
|
+
} : void 0]), 1040);
|
|
42
|
+
}), 128))]),
|
|
43
|
+
_: 3
|
|
44
|
+
})], 2);
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
//#endregion
|
|
49
|
+
export { picture_preview_vue_vue_type_script_setup_true_lang_default as default };
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
@charset "UTF-8";
|
|
2
|
+
/* stylelint-disable scss/no-global-function-names */
|
|
3
|
+
/* bem('block', 'element', 'modifier') => 'ibiz-block__element--modifier' */
|
|
4
|
+
/**
|
|
5
|
+
* 定义 Block 块
|
|
6
|
+
* @param {String} $block - Block 块名称
|
|
7
|
+
* @example
|
|
8
|
+
* @include b('button') {
|
|
9
|
+
* padding: 10px;
|
|
10
|
+
* }
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
13
|
+
* 定义 Element 元素
|
|
14
|
+
* @param {String|List} $element - Element 元素名称,支持单个或多个
|
|
15
|
+
* @example
|
|
16
|
+
* @include b('button') {
|
|
17
|
+
* @include e('text') {
|
|
18
|
+
* color: #000;
|
|
19
|
+
* }
|
|
20
|
+
* }
|
|
21
|
+
* // 或传入多个元素
|
|
22
|
+
* @include b('button') {
|
|
23
|
+
* @include e(('text', 'icon')) {
|
|
24
|
+
* margin: 5px;
|
|
25
|
+
* }
|
|
26
|
+
* }
|
|
27
|
+
*/
|
|
28
|
+
/**
|
|
29
|
+
* 定义 Modifier 修饰符
|
|
30
|
+
* @param {String|List} $modifier - Modifier 修饰符名称,支持单个或多个
|
|
31
|
+
* @example
|
|
32
|
+
* @include b('button') {
|
|
33
|
+
* @include m('primary') {
|
|
34
|
+
* background: blue;
|
|
35
|
+
* }
|
|
36
|
+
* }
|
|
37
|
+
* // 或传入多个修饰符
|
|
38
|
+
* @include b('button') {
|
|
39
|
+
* @include m(('primary', 'large')) {
|
|
40
|
+
* background: blue;
|
|
41
|
+
* font-size: 16px;
|
|
42
|
+
* }
|
|
43
|
+
* }
|
|
44
|
+
*/
|
|
45
|
+
/**
|
|
46
|
+
* 定义状态选择器
|
|
47
|
+
* @param {String} $state - 状态名称
|
|
48
|
+
* @example
|
|
49
|
+
* @include b('button') {
|
|
50
|
+
* @include when('disabled') {
|
|
51
|
+
* opacity: 0.5;
|
|
52
|
+
* }
|
|
53
|
+
* }
|
|
54
|
+
*/
|
|
55
|
+
/**
|
|
56
|
+
* 深色主题样式
|
|
57
|
+
* @param {String} $block - Block 块名称
|
|
58
|
+
* @example
|
|
59
|
+
* @include dark('button') {
|
|
60
|
+
* background: #333;
|
|
61
|
+
* color: #fff;
|
|
62
|
+
* }
|
|
63
|
+
*/
|
|
64
|
+
/* stylelint-disable scss/no-global-function-names */
|
|
65
|
+
.gct-image-preview .ant-image {
|
|
66
|
+
margin-right: 10px;
|
|
67
|
+
}
|
|
68
|
+
.gct-image-preview .ant-image-preview-operations {
|
|
69
|
+
background-color: rgba(0, 0, 0, 0.4);
|
|
70
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
export interface Options {
|
|
2
|
+
show?: boolean;
|
|
3
|
+
imageList: string[];
|
|
4
|
+
index?: number;
|
|
5
|
+
scaleStep?: number;
|
|
6
|
+
defaultWidth?: number;
|
|
7
|
+
maskClosable?: boolean;
|
|
8
|
+
rememberState?: boolean;
|
|
9
|
+
onImgLoad?: ({ index, url, dom, }: {
|
|
10
|
+
index: number;
|
|
11
|
+
url: string;
|
|
12
|
+
dom: HTMLImageElement;
|
|
13
|
+
}) => void;
|
|
14
|
+
onImgError?: ({ index, url, dom, }: {
|
|
15
|
+
index: number;
|
|
16
|
+
url: string;
|
|
17
|
+
dom: HTMLImageElement;
|
|
18
|
+
}) => void;
|
|
19
|
+
}
|
|
20
|
+
export interface Props {
|
|
21
|
+
show: boolean;
|
|
22
|
+
instance: Props;
|
|
23
|
+
imageList: string[];
|
|
24
|
+
index: number;
|
|
25
|
+
scaleStep: number;
|
|
26
|
+
defaultWidth: number;
|
|
27
|
+
maskClosable: boolean;
|
|
28
|
+
rememberState: boolean;
|
|
29
|
+
}
|
|
30
|
+
export interface PreviewActions {
|
|
31
|
+
resume: () => void;
|
|
32
|
+
close: () => void;
|
|
33
|
+
prev: () => void;
|
|
34
|
+
next: () => void;
|
|
35
|
+
setScale: (scale: number) => void;
|
|
36
|
+
setRotate: (rotate: number) => void;
|
|
37
|
+
}
|
|
38
|
+
export interface ImageProps {
|
|
39
|
+
alt?: string;
|
|
40
|
+
fallback?: string;
|
|
41
|
+
src: string;
|
|
42
|
+
width: string | number;
|
|
43
|
+
height?: string | number;
|
|
44
|
+
placeholder?: string | boolean;
|
|
45
|
+
preview?: boolean | {
|
|
46
|
+
visible?: boolean;
|
|
47
|
+
onVisibleChange?: (visible: boolean, prevVisible: boolean) => void;
|
|
48
|
+
getContainer: string | HTMLElement | (() => HTMLElement);
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
export type ImageItem = string | ImageProps;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gct-paas/core-web",
|
|
3
|
-
"version": "0.1.4-dev.
|
|
3
|
+
"version": "0.1.4-dev.19",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "paas 平台网页端核心包",
|
|
6
6
|
"loader": "dist/loader.esm.min.js",
|
|
@@ -46,11 +46,11 @@
|
|
|
46
46
|
},
|
|
47
47
|
"dependencies": {
|
|
48
48
|
"@ant-design/icons-vue": "^6.1.0",
|
|
49
|
-
"@gct-paas/api": "^0.1.2-dev.
|
|
50
|
-
"@gct-paas/core": "0.1.4-dev.
|
|
49
|
+
"@gct-paas/api": "^0.1.2-dev.2",
|
|
50
|
+
"@gct-paas/core": "0.1.4-dev.19",
|
|
51
51
|
"@gct-paas/flow": "0.0.1-dev.0",
|
|
52
52
|
"@gct-paas/platform-icons": "^0.0.2",
|
|
53
|
-
"@gct-paas/scss": "0.1.4-dev.
|
|
53
|
+
"@gct-paas/scss": "0.1.4-dev.19",
|
|
54
54
|
"@icon-park/vue-next": "^1.4.2",
|
|
55
55
|
"@monaco-editor/loader": "^1.7.0",
|
|
56
56
|
"@vueuse/core": "^14.1.0",
|
|
@@ -78,5 +78,5 @@
|
|
|
78
78
|
"vant": ">=4",
|
|
79
79
|
"vue": ">=3"
|
|
80
80
|
},
|
|
81
|
-
"gitHead": "
|
|
81
|
+
"gitHead": "efd978bbe7552b0c5ef6dbc5b62780c68aa116ab"
|
|
82
82
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e,o,r as n,s as d,t as s}from"./NodeTooltips.vue-BuKpNXoA.js";import{t}from"./NodeTools.vue-CKtwcfn2.js";import"./enums-DefcbOFc.js";import{n as a,t as l}from"./node-popover.vue-CnA0OEQf.js";import{createElementBlock as i,createElementVNode as p,createVNode as r,defineComponent as m,normalizeClass as u,normalizeStyle as c,openBlock as v,toDisplayString as f,unref as _,withCtx as I}from"vue";var N=["title"],j=/* @__PURE__ */e(/* @__PURE__ */m({__name:"BpmnApproval",props:{node:{}},setup(e){const{onNodeClick:m,nodeSelectedId:j,nodeInstStatusMap:g,isInstMode:h}=n();return(n,k)=>(v(),i("div",{class:"gf__node",onClick:k[0]||(k[0]=o=>_(m)(e.node))},[r(t,{node:e.node},null,8,["node"]),r(s,{node:e.node},null,8,["node"]),r(a,{node:e.node},null,8,["node"]),r(l,{node:e.node},{default:I(()=>[p("div",{class:u(["gct-bpmn__approval",{selected:_(j)===e.node.id,"inst-mode":_(h),"is-pending":_(g)[e.node.id]?.status===_(o).PENDING}]),style:c({"--color":_(d)[_(g)[e.node.id]?.status]||"#3168ec"})},[k[1]||(k[1]=p("div",null,[p("i",{class:"iconfont icon-shenpi1 lh-[1em]"})],-1)),p("div",{title:e.node.data?.name,class:"flex-1 ell"},f(e.node.data?.name),9,N)],6)]),_:1},8,["node"])]))}}),[["__scopeId","data-v-aee493d9"]]);export{j as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e,r as o,t as n}from"./NodeTooltips.vue-BuKpNXoA.js";import{t as d}from"./NodeTools.vue-CKtwcfn2.js";import{createElementBlock as s,createElementVNode as l,createVNode as t,defineComponent as a,normalizeClass as i,openBlock as c,toDisplayString as m,unref as r}from"vue";var p=["title"],u=/* @__PURE__ */e(/* @__PURE__ */a({__name:"BpmnBusiness",props:{node:{}},setup(e){const{onNodeClick:a,nodeSelectedId:u}=o();return(o,v)=>(c(),s("div",{class:"gf__node",onClick:v[0]||(v[0]=o=>r(a)(e.node))},[t(d,{node:e.node},null,8,["node"]),t(n,{node:e.node},null,8,["node"]),l("div",{class:i(["gct-bpmn__message",{selected:r(u)===e.node.id}])},[v[1]||(v[1]=l("div",null,[l("i",{class:"iconfont icon-xiaoxitongzhi lh-[1em]"})],-1)),l("div",{title:e.node.data?.name,class:"flex-1 ell"},m(e.node.data?.name),9,p)],2)]))}}),[["__scopeId","data-v-176742d9"]]);export{u as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e,t as o}from"./NodeTooltips.vue-BuKpNXoA.js";import"./enums-DefcbOFc.js";import{t}from"./useGctBpmn-wMjCfvFc.js";import{createElementBlock as n,createElementVNode as d,createVNode as a,defineComponent as p,openBlock as r,toDisplayString as s,unref as m}from"vue";import{useI18n as l}from"vue-i18n";var i=["title"],u=/* @__PURE__ */p({__name:"BpmnEnd",props:{node:{}},setup(p){const{t:u}=l(),{onNodeClick:c}=e(),{getI18nName:x}=t();return(e,t)=>(r(),n("div",{class:"gf__node",onClick:t[0]||(t[0]=e=>m(c)(p.node))},[a(o,{node:p.node},null,8,["node"]),d("div",{title:m(u)(m(x)(p.node.data))||p.node.data?.name,class:"h-36px w-66px bg-[#666] rounded-18px color-white text-center lh-36px ell pl-10px pr-10px"},s(m(u)(m(x)(p.node.data))||p.node.data?.name),9,i)]))}});export{u as default};
|