@qikdev/vue-ui 0.1.96 → 0.2.3

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, vModelText, vModelSelect, withKeys, TransitionGroup, defineComponent, h, nextTick, vModelDynamic, vModelCheckbox, reactive, watch } from "vue";
34
34
  import { EventDispatcher } from "@qikdev/sdk";
35
- const version$1 = "0.1.96";
35
+ const version$1 = "0.2.3";
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;
@@ -702,24 +702,32 @@ var Thumbnail_vue_vue_type_style_index_0_scoped_true_lang = "";
702
702
  const _sfc_main$17 = {
703
703
  mixins: [TableCellMixin],
704
704
  computed: {
705
+ imageSource() {
706
+ return this.value && this.value._id ? this.value : this.row;
707
+ },
705
708
  type() {
706
709
  var _a, _b;
707
- return (_b = (_a = this.row) == null ? void 0 : _a.meta) == null ? void 0 : _b.type;
710
+ return (_b = (_a = this.imageSource) == null ? void 0 : _a.meta) == null ? void 0 : _b.type;
711
+ }
712
+ },
713
+ methods: {
714
+ clicked(item) {
715
+ this.$sdk.dispatch("item:view", this.imageSource);
708
716
  }
709
717
  }
710
718
  };
711
719
  const _hoisted_1$S = { class: "table-image-cell" };
712
- const _hoisted_2$I = {
713
- key: 0,
714
- class: "image-wrapper"
715
- };
716
720
  function _sfc_render$17(_ctx, _cache, $props, $setup, $data, $options) {
717
721
  const _component_ux_image = resolveComponent("ux-image");
718
722
  const _component_ux_icon = resolveComponent("ux-icon");
719
723
  return openBlock(), createElementBlock("td", _hoisted_1$S, [
720
- $options.type == "image" || $options.type == "video" ? (openBlock(), createElementBlock("div", _hoisted_2$I, [
724
+ $options.type == "image" || $options.type == "video" ? (openBlock(), createElementBlock("div", {
725
+ key: 0,
726
+ onClick: _cache[0] || (_cache[0] = withModifiers(($event) => $options.clicked(_ctx.value), ["stop", "prevent"])),
727
+ class: "image-wrapper"
728
+ }, [
721
729
  createVNode(_component_ux_image, {
722
- item: _ctx.row,
730
+ item: $options.imageSource,
723
731
  type: $options.type,
724
732
  width: 100,
725
733
  height: 100
@@ -730,7 +738,7 @@ function _sfc_render$17(_ctx, _cache, $props, $setup, $data, $options) {
730
738
  }))
731
739
  ]);
732
740
  }
733
- var ThumbnailCell = /* @__PURE__ */ _export_sfc(_sfc_main$17, [["render", _sfc_render$17], ["__scopeId", "data-v-8ce152b2"]]);
741
+ var ThumbnailCell = /* @__PURE__ */ _export_sfc(_sfc_main$17, [["render", _sfc_render$17], ["__scopeId", "data-v-246a2688"]]);
734
742
  var Button_vue_vue_type_style_index_0_scoped_true_lang = "";
735
743
  const _sfc_main$16 = {
736
744
  data() {
@@ -4827,8 +4835,13 @@ const _sfc_main$10 = {
4827
4835
  async created() {
4828
4836
  const self2 = this;
4829
4837
  let component;
4830
- const cellType = self2.column.type;
4831
- const cellRenderer = self2.column.renderer;
4838
+ let cellType = self2.column.type;
4839
+ let cellRenderer = self2.column.renderer;
4840
+ if (cellType == "reference") {
4841
+ if (self2.column.referenceType === "image") {
4842
+ cellRenderer = "thumbnail";
4843
+ }
4844
+ }
4832
4845
  switch (cellRenderer) {
4833
4846
  case "button":
4834
4847
  component = ButtonCell;
@@ -4940,7 +4953,7 @@ function _sfc_render$10(_ctx, _cache, $props, $setup, $data, $options) {
4940
4953
  }, null, 8, ["type", "value"]))
4941
4954
  ]));
4942
4955
  }
4943
- var TableCell = /* @__PURE__ */ _export_sfc(_sfc_main$10, [["render", _sfc_render$10], ["__scopeId", "data-v-c6534cd4"]]);
4956
+ var TableCell = /* @__PURE__ */ _export_sfc(_sfc_main$10, [["render", _sfc_render$10], ["__scopeId", "data-v-6c8f100b"]]);
4944
4957
  const _sfc_main$$ = {
4945
4958
  components: {
4946
4959
  TableCell
@@ -5990,6 +6003,13 @@ const _sfc_main$S = {
5990
6003
  default: "none"
5991
6004
  }
5992
6005
  },
6006
+ computed: {
6007
+ filteredItems() {
6008
+ return this.items.filter(function(item) {
6009
+ return !item.disabled;
6010
+ });
6011
+ }
6012
+ },
5993
6013
  methods: {
5994
6014
  toggle(item) {
5995
6015
  item.expanded = !item.expanded;
@@ -6004,7 +6024,7 @@ function _sfc_render$S(_ctx, _cache, $props, $setup, $data, $options) {
6004
6024
  const _component_ux_link = resolveComponent("ux-link");
6005
6025
  const _component_menulist = resolveComponent("menulist", true);
6006
6026
  return openBlock(), createElementBlock("ul", null, [
6007
- (openBlock(true), createElementBlock(Fragment, null, renderList($props.items, (item) => {
6027
+ (openBlock(true), createElementBlock(Fragment, null, renderList($options.filteredItems, (item) => {
6008
6028
  var _a;
6009
6029
  return openBlock(), createElementBlock("li", {
6010
6030
  class: normalizeClass({ expanded: item.expanded, collapsed: item.collapsed })
@@ -6055,6 +6075,9 @@ const _sfc_main$R = {
6055
6075
  item: {
6056
6076
  type: Object
6057
6077
  },
6078
+ alt: {
6079
+ type: String
6080
+ },
6058
6081
  width: {
6059
6082
  type: Number
6060
6083
  },
@@ -6099,6 +6122,9 @@ const _sfc_main$R = {
6099
6122
  };
6100
6123
  },
6101
6124
  computed: {
6125
+ altText() {
6126
+ return this.alt || this.model.title;
6127
+ },
6102
6128
  className() {
6103
6129
  var classes = [];
6104
6130
  if (this.portrait) {
@@ -6223,8 +6249,8 @@ const _sfc_main$R = {
6223
6249
  }
6224
6250
  }
6225
6251
  };
6226
- const _hoisted_1$J = ["data"];
6227
- const _hoisted_2$C = ["src"];
6252
+ const _hoisted_1$J = ["alt", "data"];
6253
+ const _hoisted_2$C = ["alt", "src"];
6228
6254
  function _sfc_render$R(_ctx, _cache, $props, $setup, $data, $options) {
6229
6255
  return openBlock(), createElementBlock("div", {
6230
6256
  class: normalizeClass(["ux-image", $options.className]),
@@ -6232,16 +6258,18 @@ function _sfc_render$R(_ctx, _cache, $props, $setup, $data, $options) {
6232
6258
  }, [
6233
6259
  $props.svg ? (openBlock(), createElementBlock("object", {
6234
6260
  key: 0,
6261
+ alt: $options.altText,
6235
6262
  type: "image/svg+xml",
6236
6263
  data: $options.src
6237
6264
  }, null, 8, _hoisted_1$J)) : (openBlock(), createElementBlock("img", {
6238
6265
  key: 1,
6266
+ alt: $options.altText,
6239
6267
  style: normalizeStyle($options.imageStyle),
6240
6268
  src: $options.src
6241
6269
  }, null, 12, _hoisted_2$C))
6242
6270
  ], 6);
6243
6271
  }
6244
- var UXImage = /* @__PURE__ */ _export_sfc(_sfc_main$R, [["render", _sfc_render$R], ["__scopeId", "data-v-a5d2a840"]]);
6272
+ var UXImage = /* @__PURE__ */ _export_sfc(_sfc_main$R, [["render", _sfc_render$R], ["__scopeId", "data-v-a7872864"]]);
6245
6273
  var progressbar_vue_vue_type_style_index_0_scoped_true_lang = "";
6246
6274
  const _sfc_main$Q = {
6247
6275
  props: {
@@ -16530,11 +16558,13 @@ const _sfc_main$h = {
16530
16558
  return this.field.expressions;
16531
16559
  },
16532
16560
  expressionsContext() {
16561
+ var _a;
16562
+ var additionalContext = ((_a = this.additionalContext) == null ? void 0 : _a.value) || {};
16533
16563
  const context = {
16534
16564
  this: this.model,
16535
16565
  model: this.model,
16536
16566
  data: this.parentModel,
16537
- additional: __spreadValues({}, this.additionalContext.value)
16567
+ additional: __spreadValues({}, additionalContext)
16538
16568
  };
16539
16569
  return context;
16540
16570
  },
@@ -16909,7 +16939,7 @@ function _sfc_render$h(_ctx, _cache, $props, $setup, $data, $options) {
16909
16939
  $options.error && $data.validateResults.message ? (openBlock(), createElementBlock("div", _hoisted_1$c, toDisplayString($data.validateResults.message), 1)) : createCommentVNode("", true)
16910
16940
  ], 34)) : createCommentVNode("", true);
16911
16941
  }
16912
- var UXFormField = /* @__PURE__ */ _export_sfc(_sfc_main$h, [["render", _sfc_render$h], ["__scopeId", "data-v-64d30f70"]]);
16942
+ var UXFormField = /* @__PURE__ */ _export_sfc(_sfc_main$h, [["render", _sfc_render$h], ["__scopeId", "data-v-2d97aad1"]]);
16913
16943
  var form_vue_vue_type_style_index_0_scoped_true_lang = "";
16914
16944
  const _sfc_main$g = {
16915
16945
  props: {