@sdata/web-vue 3.7.1 → 3.9.0
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.
|
@@ -137,6 +137,16 @@ var auto_complete_default = /* @__PURE__ */ defineComponent({
|
|
|
137
137
|
"dropdownReachBottom": (_ev) => true
|
|
138
138
|
},
|
|
139
139
|
/**
|
|
140
|
+
* @zh 前缀元素
|
|
141
|
+
* @en Prefix
|
|
142
|
+
* @slot prefix
|
|
143
|
+
*/
|
|
144
|
+
/**
|
|
145
|
+
* @zh 后缀元素
|
|
146
|
+
* @en Suffix
|
|
147
|
+
* @slot suffix
|
|
148
|
+
*/
|
|
149
|
+
/**
|
|
140
150
|
* @zh 弹出框的页脚
|
|
141
151
|
* @en The footer of the popup menu box
|
|
142
152
|
* @slot footer
|
|
@@ -138,6 +138,7 @@ var file_previewer_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ d
|
|
|
138
138
|
return (_visible$value = visible === null || visible === void 0 ? void 0 : visible.value) !== null && _visible$value !== void 0 ? _visible$value : localVisible.value;
|
|
139
139
|
});
|
|
140
140
|
const shouldRender = computed(() => !fullscreen.value || mergedVisible.value);
|
|
141
|
+
const useImagePreview = computed(() => type.value === "image" && fullscreen.value && !slots.content);
|
|
141
142
|
const container = usePopupContainer(document.body, reactive({ popupContainer }));
|
|
142
143
|
const popupVisible = computed(() => fullscreen.value && mergedVisible.value);
|
|
143
144
|
const { zIndex } = usePopupManager("dialog", { visible: popupVisible });
|
|
@@ -186,14 +187,15 @@ var file_previewer_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ d
|
|
|
186
187
|
const mergedImageProps = computed(() => {
|
|
187
188
|
var _imageProps$value;
|
|
188
189
|
const userProps = (_imageProps$value = imageProps === null || imageProps === void 0 ? void 0 : imageProps.value) !== null && _imageProps$value !== void 0 ? _imageProps$value : {};
|
|
189
|
-
return _objectSpread2(_objectSpread2({
|
|
190
|
-
preview: false,
|
|
191
|
-
width: "100%",
|
|
192
|
-
height: "100%",
|
|
193
|
-
fit: "contain",
|
|
194
|
-
alt: (title === null || title === void 0 ? void 0 : title.value) || ""
|
|
195
|
-
}, userProps), {}, {
|
|
190
|
+
return _objectSpread2(_objectSpread2({ alt: (title === null || title === void 0 ? void 0 : title.value) || "" }, userProps), {}, {
|
|
196
191
|
src: currentSrc.value,
|
|
192
|
+
renderToBody: renderToBody.value,
|
|
193
|
+
previewProps: _objectSpread2({
|
|
194
|
+
maskClosable: maskClosable.value,
|
|
195
|
+
closable: closable.value,
|
|
196
|
+
popupContainer: popupContainer === null || popupContainer === void 0 ? void 0 : popupContainer.value,
|
|
197
|
+
escToClose: escToClose.value
|
|
198
|
+
}, userProps.previewProps),
|
|
197
199
|
onLoad: (event) => {
|
|
198
200
|
callEventHandler(userProps.onLoad, event);
|
|
199
201
|
onPreviewLoad();
|
|
@@ -281,6 +283,10 @@ var file_previewer_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ d
|
|
|
281
283
|
function onMaskClick() {
|
|
282
284
|
if (maskClosable.value) close();
|
|
283
285
|
}
|
|
286
|
+
function onImagePreviewVisibleChange(nextVisible) {
|
|
287
|
+
if (!nextVisible && mergedVisible.value) emit("close");
|
|
288
|
+
setVisible(nextVisible);
|
|
289
|
+
}
|
|
284
290
|
function onKeyDown(event) {
|
|
285
291
|
if (fullscreen.value && escToClose.value && event.key === KEYBOARD_KEY.ESC) {
|
|
286
292
|
event.stopPropagation();
|
|
@@ -376,7 +382,12 @@ var file_previewer_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ d
|
|
|
376
382
|
onLoadError
|
|
377
383
|
});
|
|
378
384
|
return (_ctx, _cache) => {
|
|
379
|
-
return openBlock(), createBlock(
|
|
385
|
+
return useImagePreview.value ? (openBlock(), createBlock(unref(Image), mergeProps({ key: currentSrc.value + "image" }, mergedImageProps.value, {
|
|
386
|
+
"preview-visible": mergedVisible.value,
|
|
387
|
+
class: `${unref(prefixCls)}-image`,
|
|
388
|
+
onPreviewVisibleChange: onImagePreviewVisibleChange
|
|
389
|
+
}), null, 16, ["preview-visible", "class"])) : (openBlock(), createBlock(Teleport, {
|
|
390
|
+
key: 1,
|
|
380
391
|
to: unref(container),
|
|
381
392
|
disabled: !unref(fullscreen) || !unref(renderToBody)
|
|
382
393
|
}, [shouldRender.value ? (openBlock(), createElementBlock("div", {
|
|
@@ -431,7 +442,7 @@ var file_previewer_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ d
|
|
|
431
442
|
key: 3,
|
|
432
443
|
class: normalizeClass(`${unref(prefixCls)}-error`)
|
|
433
444
|
}, "文件预览加载失败", 2)) : createCommentVNode("", true)
|
|
434
|
-
], 46, _hoisted_1)) : createCommentVNode("", true)], 8, ["to", "disabled"]);
|
|
445
|
+
], 46, _hoisted_1)) : createCommentVNode("", true)], 8, ["to", "disabled"]));
|
|
435
446
|
};
|
|
436
447
|
}
|
|
437
448
|
}));
|
|
@@ -209,11 +209,13 @@ var image_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComp
|
|
|
209
209
|
if (groupContext === null || groupContext === void 0 ? void 0 : groupContext.preview) groupContext.preview(imageId);
|
|
210
210
|
else {
|
|
211
211
|
emit("preview-visible-change", true);
|
|
212
|
+
emit("update:previewVisible", true);
|
|
212
213
|
setPreviewVisible(true);
|
|
213
214
|
}
|
|
214
215
|
}
|
|
215
216
|
function onPreviewClose() {
|
|
216
217
|
emit("preview-visible-change", false);
|
|
218
|
+
emit("update:previewVisible", false);
|
|
217
219
|
setPreviewVisible(false);
|
|
218
220
|
}
|
|
219
221
|
const imgStyle = sizeStyle;
|
package/json/web-types.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"$schema": "https://raw.githubusercontent.com/JetBrains/web-types/master/schema/web-types.json",
|
|
3
3
|
"framework": "vue",
|
|
4
4
|
"name": "@sdata/web-vue",
|
|
5
|
-
"version": "3.
|
|
5
|
+
"version": "3.8.0",
|
|
6
6
|
"contributions": {
|
|
7
7
|
"html": {
|
|
8
8
|
"types-syntax": "typescript",
|
|
@@ -361,6 +361,14 @@
|
|
|
361
361
|
{
|
|
362
362
|
"name": "footer",
|
|
363
363
|
"description": "The footer of the popup menu box"
|
|
364
|
+
},
|
|
365
|
+
{
|
|
366
|
+
"name": "suffix",
|
|
367
|
+
"description": "Suffix"
|
|
368
|
+
},
|
|
369
|
+
{
|
|
370
|
+
"name": "prefix",
|
|
371
|
+
"description": "Prefix"
|
|
364
372
|
}
|
|
365
373
|
]
|
|
366
374
|
},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sdata/web-vue",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.9.0",
|
|
4
4
|
"description": "SD Design Vue: A Vue.js 3 UI Library",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"sd",
|
|
@@ -85,10 +85,9 @@
|
|
|
85
85
|
"@vue/test-utils": "^2.4.11",
|
|
86
86
|
"@vueuse/core": "^14.3.0",
|
|
87
87
|
"clean-css": "^5.3.3",
|
|
88
|
+
"cypress": "15.18.0",
|
|
88
89
|
"fast-glob": "^3.3.3",
|
|
89
90
|
"glob": "^13.0.6",
|
|
90
|
-
"jest-serializer-vue": "^3.1.0",
|
|
91
|
-
"jsdom": "^29.1.1",
|
|
92
91
|
"sass": "^1.101.0",
|
|
93
92
|
"semantic-release": "^25.0.5",
|
|
94
93
|
"svgo": "^4.0.1",
|
|
@@ -96,7 +95,6 @@
|
|
|
96
95
|
"typescript": "^6.0.3",
|
|
97
96
|
"vite": "^8.0.16",
|
|
98
97
|
"vite-plus": "^0.1.24",
|
|
99
|
-
"vitest": "^4.1.9",
|
|
100
98
|
"vue-docgen-api": "4.79.2",
|
|
101
99
|
"vue-tsc": "^3.3.5"
|
|
102
100
|
},
|
|
@@ -126,7 +124,11 @@
|
|
|
126
124
|
"dtsgen": "pnpm run build:dts",
|
|
127
125
|
"pretypecheck": "pnpm run icongen",
|
|
128
126
|
"typecheck": "vue-tsc --noEmit -p tsconfig.json",
|
|
129
|
-
"test": "
|
|
130
|
-
"test:
|
|
127
|
+
"test": "cypress run --component --browser chrome",
|
|
128
|
+
"test:affected": "node ./scripts/find-affected-cypress-specs.mjs",
|
|
129
|
+
"test:affected:unit": "node --test ./scripts/find-affected-cypress-specs.test.mjs",
|
|
130
|
+
"test:headed": "cypress run --component --browser chrome --headed",
|
|
131
|
+
"cypress:open": "cypress open --component",
|
|
132
|
+
"cypress:run": "cypress run --component --browser chrome"
|
|
131
133
|
}
|
|
132
134
|
}
|