@qikdev/vue-ui 0.1.77 → 0.1.78

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/lib.es.js CHANGED
@@ -32,7 +32,7 @@ var __objRest = (source, exclude) => {
32
32
  };
33
33
  import { openBlock, createElementBlock, renderSlot, resolveComponent, createBlock, withCtx, createVNode, Fragment, renderList, normalizeClass, toDisplayString, withDirectives, resolveDynamicComponent, vShow, withModifiers, createTextVNode, createCommentVNode, createElementVNode, mergeProps, toHandlers, pushScopeId, popScopeId, normalizeStyle, Teleport, vModelSelect, withKeys, vModelText, TransitionGroup, defineComponent, h, nextTick, vModelDynamic, vModelCheckbox, reactive, watch } from "vue";
34
34
  import { EventDispatcher } from "@qikdev/sdk";
35
- const version$1 = "0.1.77";
35
+ const version$1 = "0.1.78";
36
36
  var flexColumn_vue_vue_type_style_index_0_scoped_true_lang = "";
37
37
  var _export_sfc = (sfc, props2) => {
38
38
  const target = sfc.__vccOpts || sfc;
@@ -5927,10 +5927,13 @@ const _sfc_main$L = {
5927
5927
  type: Object
5928
5928
  },
5929
5929
  width: {
5930
- type: [Number, String]
5930
+ type: Number
5931
5931
  },
5932
5932
  height: {
5933
- type: [Number, String]
5933
+ type: Number
5934
+ },
5935
+ inline: {
5936
+ type: Boolean
5934
5937
  },
5935
5938
  quality: {
5936
5939
  type: Number
@@ -5967,11 +5970,12 @@ const _sfc_main$L = {
5967
5970
  };
5968
5971
  },
5969
5972
  computed: {
5970
- aspectStyle() {
5971
- return {
5972
- "aspect-ratio": `${this.imageHeight / this.imageWidth}`,
5973
- "object-fit": "contain"
5974
- };
5973
+ className() {
5974
+ var classes = [];
5975
+ if (this.portrait) {
5976
+ classes.push("img-portrait");
5977
+ }
5978
+ return classes.join(" ");
5975
5979
  },
5976
5980
  isSvg() {
5977
5981
  var _a;
@@ -5984,11 +5988,8 @@ const _sfc_main$L = {
5984
5988
  return true;
5985
5989
  }
5986
5990
  },
5987
- defaultWidth() {
5988
- return;
5989
- },
5990
- defaultHeight() {
5991
- return;
5991
+ portrait() {
5992
+ return this.crop ? this.dimensionHeight > this.dimensionWidth : this.modelHeight > this.modelWidth;
5992
5993
  },
5993
5994
  imageWidth() {
5994
5995
  return parseInt(this.width);
@@ -5996,6 +5997,14 @@ const _sfc_main$L = {
5996
5997
  imageHeight() {
5997
5998
  return parseInt(this.height);
5998
5999
  },
6000
+ modelWidth() {
6001
+ var _a;
6002
+ return parseInt((_a = this.model) == null ? void 0 : _a.width);
6003
+ },
6004
+ modelHeight() {
6005
+ var _a;
6006
+ return parseInt((_a = this.model) == null ? void 0 : _a.height);
6007
+ },
5999
6008
  id() {
6000
6009
  return this.$sdk.utils.id(this.model);
6001
6010
  },
@@ -6003,10 +6012,10 @@ const _sfc_main$L = {
6003
6012
  var params = {};
6004
6013
  params.access_token = this.$sdk.auth.getCurrentToken();
6005
6014
  if (this.imageWidth) {
6006
- params.w = this.imageWidth ? this.imageWidth : this.defaultWidth;
6015
+ params.w = this.imageWidth ? this.imageWidth : null;
6007
6016
  }
6008
6017
  if (this.imageHeight) {
6009
- params.h = this.imageHeight ? this.imageHeight : this.defaultHeight;
6018
+ params.h = this.imageHeight ? this.imageHeight : null;
6010
6019
  }
6011
6020
  if (this.crop) {
6012
6021
  params.c = true;
@@ -6035,23 +6044,45 @@ const _sfc_main$L = {
6035
6044
  delete params.h;
6036
6045
  return this.$sdk.api.generateEndpointURL(`/${this.type}/${this.id}`, params);
6037
6046
  },
6047
+ imageStyle() {
6048
+ var style = {};
6049
+ if (!this.crop) {
6050
+ style["object-fit"] = "contain";
6051
+ }
6052
+ if (this.inline) {
6053
+ style.maxWidth = "100%";
6054
+ } else {
6055
+ style.width = "100%";
6056
+ style.height = "100%";
6057
+ style.top = `0`;
6058
+ style.left = `0`;
6059
+ style.position = "absolute";
6060
+ }
6061
+ return style;
6062
+ },
6063
+ dimensionWidth() {
6064
+ return this.imageWidth && this.imageHeight ? this.imageWidth : this.modelWidth;
6065
+ },
6066
+ dimensionHeight() {
6067
+ return this.imageWidth && this.imageHeight ? this.imageHeight : this.modelHeight;
6068
+ },
6038
6069
  style() {
6039
6070
  var _a, _b, _c;
6040
6071
  var style = {};
6072
+ if (this.inline) {
6073
+ style.display = "inline-block";
6074
+ } else {
6075
+ if (this.dimensionHeight && this.dimensionWidth) {
6076
+ style.height = 0;
6077
+ style.overflow = "hidden";
6078
+ style.paddingBottom = `${this.dimensionHeight / this.dimensionWidth * 100}%`;
6079
+ style.position = "relative";
6080
+ }
6081
+ }
6041
6082
  var colors = (_c = (_b = (_a = this.model) == null ? void 0 : _a.fileMeta) == null ? void 0 : _b.colors) == null ? void 0 : _c.colors;
6042
6083
  if (colors && colors.length) {
6043
6084
  style.backgroundColor = colors[0];
6044
6085
  }
6045
- var dimensionWidth = this.model.width;
6046
- var dimensionHeight = this.model.height;
6047
- if (this.width && this.height) {
6048
- dimensionWidth = this.width;
6049
- dimensionHeight = this.height;
6050
- }
6051
- if (dimensionHeight && dimensionWidth) {
6052
- style.height = 0;
6053
- style.paddingBottom = `${dimensionHeight / dimensionWidth * 100}%`;
6054
- }
6055
6086
  if (this.isSvg)
6056
6087
  ;
6057
6088
  else {
@@ -6067,7 +6098,7 @@ const _hoisted_1$F = ["data"];
6067
6098
  const _hoisted_2$y = ["src"];
6068
6099
  function _sfc_render$L(_ctx, _cache, $props, $setup, $data, $options) {
6069
6100
  return openBlock(), createElementBlock("div", {
6070
- class: "ux-image",
6101
+ class: normalizeClass(["ux-image", $options.className]),
6071
6102
  style: normalizeStyle($options.style)
6072
6103
  }, [
6073
6104
  $props.svg ? (openBlock(), createElementBlock("object", {
@@ -6076,12 +6107,12 @@ function _sfc_render$L(_ctx, _cache, $props, $setup, $data, $options) {
6076
6107
  data: $options.src
6077
6108
  }, null, 8, _hoisted_1$F)) : (openBlock(), createElementBlock("img", {
6078
6109
  key: 1,
6079
- src: $options.src,
6080
- style: normalizeStyle($options.aspectStyle)
6110
+ style: normalizeStyle($options.imageStyle),
6111
+ src: $options.src
6081
6112
  }, null, 12, _hoisted_2$y))
6082
- ], 4);
6113
+ ], 6);
6083
6114
  }
6084
- var UXImage = /* @__PURE__ */ _export_sfc(_sfc_main$L, [["render", _sfc_render$L], ["__scopeId", "data-v-0013b853"]]);
6115
+ var UXImage = /* @__PURE__ */ _export_sfc(_sfc_main$L, [["render", _sfc_render$L], ["__scopeId", "data-v-1f7127ce"]]);
6085
6116
  var progressbar_vue_vue_type_style_index_0_scoped_true_lang = "";
6086
6117
  const _sfc_main$K = {
6087
6118
  props: {
@@ -18441,9 +18472,11 @@ const _sfc_main$5 = {
18441
18472
  const { promise, cancel } = await self2.$sdk.content.list(self2.type, loadCriteria, { cancellable: true });
18442
18473
  cancelInflight = cancel;
18443
18474
  promise.then(function(res) {
18475
+ cancelInflight = null;
18444
18476
  self2.loading = false;
18445
18477
  });
18446
18478
  promise.catch(function(err) {
18479
+ cancelInflight = null;
18447
18480
  });
18448
18481
  const { data } = await promise;
18449
18482
  data.items.forEach(self2.ensureMeta);
@@ -18476,7 +18509,7 @@ const _sfc_main$5 = {
18476
18509
  };
18477
18510
  }
18478
18511
  };
18479
- const _withScopeId = (n2) => (pushScopeId("data-v-2e0c57ea"), n2 = n2(), popScopeId(), n2);
18512
+ const _withScopeId = (n2) => (pushScopeId("data-v-4d612010"), n2 = n2(), popScopeId(), n2);
18480
18513
  const _hoisted_1$5 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ createElementVNode("p", null, null, -1));
18481
18514
  const _hoisted_2$4 = { class: "footer" };
18482
18515
  function _sfc_render$5(_ctx, _cache, $props, $setup, $data, $options) {
@@ -18650,7 +18683,7 @@ function _sfc_render$5(_ctx, _cache, $props, $setup, $data, $options) {
18650
18683
  _: 3
18651
18684
  })) : createCommentVNode("", true);
18652
18685
  }
18653
- var ContentBrowser = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["render", _sfc_render$5], ["__scopeId", "data-v-2e0c57ea"]]);
18686
+ var ContentBrowser = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["render", _sfc_render$5], ["__scopeId", "data-v-4d612010"]]);
18654
18687
  var ModalMixin = {
18655
18688
  props: {
18656
18689
  options: {