@cmstops/pro-compo 0.1.90 → 0.1.91

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.
@@ -76,6 +76,7 @@ const _sfc_main = defineComponent({
76
76
  topImageTitleValid: {},
77
77
  showTitle: { type: Boolean },
78
78
  cropper: { type: Boolean },
79
+ cropperRatios: {},
79
80
  aiImages: {},
80
81
  series: {},
81
82
  thumbsMax: {},
@@ -241,9 +242,9 @@ const _sfc_main = defineComponent({
241
242
  ].includes(series);
242
243
  });
243
244
  const submitCallback = (data) => {
244
- var _a;
245
+ var _a, _b, _c, _d;
245
246
  const isPcBaner = props.mode === "doc" && thumbBannerModel.value === "pcBanner" && !docSeriesShowTopThemeColor.value;
246
- const _useCropper = props.mode === "doc" ? true : useCropper.value;
247
+ const _useCropper = ["thumb", "doc"].includes(props.mode) ? true : useCropper.value;
247
248
  if (["smiple", "thumbs"].includes(props.mode)) {
248
249
  dialogMediaSelectionShow.value = false;
249
250
  const media = data[0];
@@ -262,15 +263,18 @@ const _sfc_main = defineComponent({
262
263
  });
263
264
  } else {
264
265
  cropperData.value = [].concat(data);
265
- if (thumbBannerModel.value === "banner" || docSeriesShowTopThemeColor.value) {
266
- aspectRatioProp.value = docThumbRatioMap()[2];
266
+ if (thumbBannerModel.value === "banner") {
267
+ aspectRatioProp.value = ((_a = props.cropperRatios) == null ? void 0 : _a[1]) || docThumbRatioMap()[2];
268
+ }
269
+ if (thumbBannerModel.value === "pcBanner" && docSeriesShowTopThemeColor.value) {
270
+ aspectRatioProp.value = ((_b = props.cropperRatios) == null ? void 0 : _b[2]) || docThumbRatioMap()[2];
267
271
  }
268
272
  if (thumbBannerModel.value === "thumb") {
269
- aspectRatioProp.value = docThumbRatioMap()[model.value];
273
+ aspectRatioProp.value = ((_c = props.cropperRatios) == null ? void 0 : _c[0]) || docThumbRatioMap()[model.value];
270
274
  if (data.length) {
271
275
  const media = data[0];
272
276
  const wh = [];
273
- (_a = media.metas) == null ? void 0 : _a.map((item) => {
277
+ (_d = media.metas) == null ? void 0 : _d.map((item) => {
274
278
  if (item.key === "width")
275
279
  wh.unshift(parseInt(item.value, 10));
276
280
  if (item.key === "height")
@@ -77,6 +77,7 @@ const _sfc_main = vue.defineComponent({
77
77
  topImageTitleValid: {},
78
78
  showTitle: { type: Boolean },
79
79
  cropper: { type: Boolean },
80
+ cropperRatios: {},
80
81
  aiImages: {},
81
82
  series: {},
82
83
  thumbsMax: {},
@@ -242,9 +243,9 @@ const _sfc_main = vue.defineComponent({
242
243
  ].includes(series);
243
244
  });
244
245
  const submitCallback = (data) => {
245
- var _a;
246
+ var _a, _b, _c, _d;
246
247
  const isPcBaner = props.mode === "doc" && thumbBannerModel.value === "pcBanner" && !docSeriesShowTopThemeColor.value;
247
- const _useCropper = props.mode === "doc" ? true : useCropper.value;
248
+ const _useCropper = ["thumb", "doc"].includes(props.mode) ? true : useCropper.value;
248
249
  if (["smiple", "thumbs"].includes(props.mode)) {
249
250
  dialogMediaSelectionShow.value = false;
250
251
  const media = data[0];
@@ -263,15 +264,18 @@ const _sfc_main = vue.defineComponent({
263
264
  });
264
265
  } else {
265
266
  cropperData.value = [].concat(data);
266
- if (thumbBannerModel.value === "banner" || docSeriesShowTopThemeColor.value) {
267
- aspectRatioProp.value = doc.docThumbRatioMap()[2];
267
+ if (thumbBannerModel.value === "banner") {
268
+ aspectRatioProp.value = ((_a = props.cropperRatios) == null ? void 0 : _a[1]) || doc.docThumbRatioMap()[2];
269
+ }
270
+ if (thumbBannerModel.value === "pcBanner" && docSeriesShowTopThemeColor.value) {
271
+ aspectRatioProp.value = ((_b = props.cropperRatios) == null ? void 0 : _b[2]) || doc.docThumbRatioMap()[2];
268
272
  }
269
273
  if (thumbBannerModel.value === "thumb") {
270
- aspectRatioProp.value = doc.docThumbRatioMap()[model.value];
274
+ aspectRatioProp.value = ((_c = props.cropperRatios) == null ? void 0 : _c[0]) || doc.docThumbRatioMap()[model.value];
271
275
  if (data.length) {
272
276
  const media = data[0];
273
277
  const wh = [];
274
- (_a = media.metas) == null ? void 0 : _a.map((item) => {
278
+ (_d = media.metas) == null ? void 0 : _d.map((item) => {
275
279
  if (item.key === "width")
276
280
  wh.unshift(parseInt(item.value, 10));
277
281
  if (item.key === "height")
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cmstops/pro-compo",
3
- "version": "0.1.90",
3
+ "version": "0.1.91",
4
4
  "description": "",
5
5
  "keywords": [
6
6
  "vue",