@qikdev/vue-ui 0.1.60 → 0.1.63

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.60";
35
+ const version$1 = "0.1.63";
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;
@@ -4633,13 +4633,13 @@ const _hoisted_1$L = { class: "table-date-cell" };
4633
4633
  const _hoisted_2$D = { key: 0 };
4634
4634
  const _hoisted_3$w = { class: "off" };
4635
4635
  const _hoisted_4$s = { class: "on" };
4636
- const _hoisted_5$m = { class: "spacer" };
4636
+ const _hoisted_5$n = { class: "spacer" };
4637
4637
  function _sfc_render$_(_ctx, _cache, $props, $setup, $data, $options) {
4638
4638
  return openBlock(), createElementBlock("td", _hoisted_1$L, [
4639
4639
  $options.hasValue ? (openBlock(), createElementBlock("div", _hoisted_2$D, [
4640
4640
  createElementVNode("span", _hoisted_3$w, toDisplayString($options.readable), 1),
4641
4641
  createElementVNode("span", _hoisted_4$s, toDisplayString($options.timeago), 1),
4642
- createElementVNode("span", _hoisted_5$m, toDisplayString($options.readable), 1)
4642
+ createElementVNode("span", _hoisted_5$n, toDisplayString($options.readable), 1)
4643
4643
  ])) : createCommentVNode("", true)
4644
4644
  ]);
4645
4645
  }
@@ -5186,7 +5186,7 @@ const _hoisted_3$u = {
5186
5186
  class: "first table-select shrink"
5187
5187
  };
5188
5188
  const _hoisted_4$r = /* @__PURE__ */ createTextVNode(" Select Page ");
5189
- const _hoisted_5$l = /* @__PURE__ */ createTextVNode(" Deselect Page ");
5189
+ const _hoisted_5$m = /* @__PURE__ */ createTextVNode(" Deselect Page ");
5190
5190
  const _hoisted_6$i = /* @__PURE__ */ createTextVNode(" Deselect All ");
5191
5191
  const _hoisted_7$f = ["onClick"];
5192
5192
  const _hoisted_8$8 = {
@@ -5225,7 +5225,7 @@ function _sfc_render$U(_ctx, _cache, $props, $setup, $data, $options) {
5225
5225
  onClick: _cache[1] || (_cache[1] = ($event) => $options.deselectPage())
5226
5226
  }, {
5227
5227
  default: withCtx(() => [
5228
- _hoisted_5$l
5228
+ _hoisted_5$m
5229
5229
  ]),
5230
5230
  _: 1
5231
5231
  })) : createCommentVNode("", true),
@@ -5422,7 +5422,7 @@ function _sfc_render$S(_ctx, _cache, $props, $setup, $data, $options) {
5422
5422
  _: 3
5423
5423
  }, 8, ["active", "loading", "to", "href", "target", "style", "class", "disabled"]);
5424
5424
  }
5425
- var UXButton = /* @__PURE__ */ _export_sfc(_sfc_main$S, [["render", _sfc_render$S], ["__scopeId", "data-v-e3e87f60"]]);
5425
+ var UXButton = /* @__PURE__ */ _export_sfc(_sfc_main$S, [["render", _sfc_render$S], ["__scopeId", "data-v-56c95efc"]]);
5426
5426
  var checkbox_vue_vue_type_style_index_0_scoped_true_lang$1 = "";
5427
5427
  const _sfc_main$R = {
5428
5428
  props: {
@@ -5826,7 +5826,7 @@ const _sfc_main$M = {
5826
5826
  },
5827
5827
  expandOn: {
5828
5828
  type: String,
5829
- default: "click"
5829
+ default: "none"
5830
5830
  }
5831
5831
  },
5832
5832
  methods: {
@@ -6606,7 +6606,7 @@ const _hoisted_4$q = {
6606
6606
  key: 2,
6607
6607
  class: "ui-select-button"
6608
6608
  };
6609
- const _hoisted_5$k = ["multiple"];
6609
+ const _hoisted_5$l = ["multiple"];
6610
6610
  const _hoisted_6$h = {
6611
6611
  key: 0,
6612
6612
  value: ""
@@ -6643,7 +6643,7 @@ function _sfc_render$H(_ctx, _cache, $props, $setup, $data, $options) {
6643
6643
  value: option2.value
6644
6644
  }, toDisplayString(option2.title), 9, _hoisted_7$e);
6645
6645
  }), 256))
6646
- ], 40, _hoisted_5$k), [
6646
+ ], 40, _hoisted_5$l), [
6647
6647
  [vModelSelect, _ctx.model]
6648
6648
  ])
6649
6649
  ], 2);
@@ -6735,7 +6735,7 @@ const _hoisted_3$s = {
6735
6735
  class: "ux-field-description"
6736
6736
  };
6737
6737
  const _hoisted_4$p = { key: 2 };
6738
- const _hoisted_5$j = /* @__PURE__ */ createTextVNode(" Country Code ");
6738
+ const _hoisted_5$k = /* @__PURE__ */ createTextVNode(" Country Code ");
6739
6739
  const _hoisted_6$g = { key: 0 };
6740
6740
  const _hoisted_7$d = { key: 1 };
6741
6741
  const _hoisted_8$7 = { class: "ux-text-wrap" };
@@ -6773,7 +6773,7 @@ function _sfc_render$G(_ctx, _cache, $props, $setup, $data, $options) {
6773
6773
  }, {
6774
6774
  default: withCtx(() => [
6775
6775
  !entry.countryCode ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
6776
- _hoisted_5$j
6776
+ _hoisted_5$k
6777
6777
  ], 64)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
6778
6778
  $data.lookup[entry.countryCode] ? (openBlock(), createElementBlock("div", _hoisted_6$g, toDisplayString($data.lookup[entry.countryCode].emoji) + " - " + toDisplayString($data.lookup[entry.countryCode].alpha2), 1)) : (openBlock(), createElementBlock("div", _hoisted_7$d, "Loading"))
6779
6779
  ], 64))
@@ -7429,7 +7429,7 @@ const _hoisted_4$o = {
7429
7429
  key: 2,
7430
7430
  class: "ui-select-button"
7431
7431
  };
7432
- const _hoisted_5$i = ["multiple"];
7432
+ const _hoisted_5$j = ["multiple"];
7433
7433
  const _hoisted_6$f = {
7434
7434
  key: 0,
7435
7435
  value: ""
@@ -7466,7 +7466,7 @@ function _sfc_render$F(_ctx, _cache, $props, $setup, $data, $options) {
7466
7466
  value: option2.value
7467
7467
  }, toDisplayString(option2.title), 9, _hoisted_7$c);
7468
7468
  }), 256))
7469
- ], 40, _hoisted_5$i), [
7469
+ ], 40, _hoisted_5$j), [
7470
7470
  [vModelSelect, _ctx.model]
7471
7471
  ])
7472
7472
  ], 2);
@@ -10199,11 +10199,33 @@ const _sfc_main$D = {
10199
10199
  }
10200
10200
  },
10201
10201
  mixins: [InputMixin],
10202
- created() {
10202
+ async created() {
10203
+ this.glossary = await this.$sdk.content.glossary({ hash: true });
10203
10204
  this.value = this.cleanInput(this.value, true);
10204
10205
  this.dispatch();
10205
10206
  },
10207
+ data() {
10208
+ return {
10209
+ glossary: {}
10210
+ };
10211
+ },
10206
10212
  methods: {
10213
+ async create() {
10214
+ var _a;
10215
+ const self2 = this;
10216
+ if (!((_a = self2.$sdk.global) == null ? void 0 : _a.create)) {
10217
+ return;
10218
+ }
10219
+ const item = await self2.$sdk.global.create(self2.field.referenceType);
10220
+ if (self2.multiValue) {
10221
+ if (!self2.model) {
10222
+ self2.model = [];
10223
+ }
10224
+ self2.model.push(item);
10225
+ } else {
10226
+ self2.model = item;
10227
+ }
10228
+ },
10207
10229
  clear() {
10208
10230
  this.model = void 0;
10209
10231
  this.touch();
@@ -10264,6 +10286,27 @@ const _sfc_main$D = {
10264
10286
  }
10265
10287
  },
10266
10288
  computed: {
10289
+ canAdd() {
10290
+ const self2 = this;
10291
+ if (!self2.maximum) {
10292
+ return true;
10293
+ }
10294
+ return self2.multiValue ? self2.model.length < self2.maximum : !self2.model;
10295
+ },
10296
+ canCreate() {
10297
+ var _a;
10298
+ if (!((_a = this.$sdk.global) == null ? void 0 : _a.create)) {
10299
+ return;
10300
+ }
10301
+ var basicType = this.field.referenceType;
10302
+ var definedType = basicType;
10303
+ var match2 = this.glossary[this.field.referenceType];
10304
+ if (match2) {
10305
+ basicType = match2.definesType || match2.key;
10306
+ definedType = match2.key || match2.definesType;
10307
+ }
10308
+ return this.user && this.$sdk.access.canCreate(this.user, definedType, basicType);
10309
+ },
10267
10310
  summary() {
10268
10311
  if (this.multiValue) {
10269
10312
  if (this.model && this.model.length) {
@@ -10277,6 +10320,9 @@ const _sfc_main$D = {
10277
10320
  if (difference) {
10278
10321
  summary = `${summary}... +${difference} more...`;
10279
10322
  }
10323
+ if (!summary) {
10324
+ return `Click to select`;
10325
+ }
10280
10326
  return summary;
10281
10327
  } else {
10282
10328
  return `Click to select`;
@@ -10307,11 +10353,15 @@ const _hoisted_4$n = {
10307
10353
  key: 3,
10308
10354
  class: "items"
10309
10355
  };
10356
+ const _hoisted_5$i = /* @__PURE__ */ createTextVNode(" Create ");
10310
10357
  function _sfc_render$D(_ctx, _cache, $props, $setup, $data, $options) {
10311
10358
  const _component_ux_icon = resolveComponent("ux-icon");
10312
10359
  const _component_ux_button = resolveComponent("ux-button");
10313
10360
  const _component_item = resolveComponent("item");
10314
10361
  const _component_draggable = resolveComponent("draggable");
10362
+ const _component_flex_cell = resolveComponent("flex-cell");
10363
+ const _component_flex_spacer = resolveComponent("flex-spacer");
10364
+ const _component_flex_row = resolveComponent("flex-row");
10315
10365
  return openBlock(), createElementBlock(Fragment, null, [
10316
10366
  _ctx.showLabel ? (openBlock(), createElementBlock("label", _hoisted_1$x, [
10317
10367
  createTextVNode(toDisplayString(_ctx.label) + " ", 1),
@@ -10382,15 +10432,50 @@ function _sfc_render$D(_ctx, _cache, $props, $setup, $data, $options) {
10382
10432
  _: 1
10383
10433
  }, 8, ["item"])
10384
10434
  ])) : createCommentVNode("", true),
10385
- createVNode(_component_ux_button, { onClick: $options.open }, {
10435
+ $options.canAdd ? (openBlock(), createBlock(_component_flex_row, {
10436
+ key: 4,
10437
+ gap: ""
10438
+ }, {
10386
10439
  default: withCtx(() => [
10387
- createTextVNode(toDisplayString($options.summary), 1)
10440
+ createVNode(_component_flex_cell, { shrink: "" }, {
10441
+ default: withCtx(() => [
10442
+ createVNode(_component_ux_button, { onClick: $options.open }, {
10443
+ default: withCtx(() => [
10444
+ createTextVNode(toDisplayString($options.summary), 1)
10445
+ ]),
10446
+ _: 1
10447
+ }, 8, ["onClick"])
10448
+ ]),
10449
+ _: 1
10450
+ }),
10451
+ $options.canCreate ? (openBlock(), createBlock(_component_flex_cell, {
10452
+ key: 0,
10453
+ shrink: ""
10454
+ }, {
10455
+ default: withCtx(() => [
10456
+ createVNode(_component_ux_button, {
10457
+ color: "primary",
10458
+ onClick: $options.create
10459
+ }, {
10460
+ default: withCtx(() => [
10461
+ _hoisted_5$i,
10462
+ createVNode(_component_ux_icon, {
10463
+ right: "",
10464
+ icon: "fa-plus"
10465
+ })
10466
+ ]),
10467
+ _: 1
10468
+ }, 8, ["onClick"])
10469
+ ]),
10470
+ _: 1
10471
+ })) : createCommentVNode("", true),
10472
+ createVNode(_component_flex_spacer)
10388
10473
  ]),
10389
10474
  _: 1
10390
- }, 8, ["onClick"])
10475
+ })) : createCommentVNode("", true)
10391
10476
  ], 64);
10392
10477
  }
10393
- var ContentSelect = /* @__PURE__ */ _export_sfc(_sfc_main$D, [["render", _sfc_render$D], ["__scopeId", "data-v-49f2d443"]]);
10478
+ var ContentSelect = /* @__PURE__ */ _export_sfc(_sfc_main$D, [["render", _sfc_render$D], ["__scopeId", "data-v-60b312d0"]]);
10394
10479
  var typeSelect_vue_vue_type_style_index_0_scoped_true_lang = "";
10395
10480
  function isUndefined$3(entry) {
10396
10481
  return entry === void 0 || typeof entry === "undefined" || entry === null || String(entry) === "null" || String(entry) === "undefined";
@@ -16721,7 +16806,7 @@ function _sfc_render$a(_ctx, _cache, $props, $setup, $data, $options) {
16721
16806
  ])
16722
16807
  ]);
16723
16808
  }
16724
- var Search = /* @__PURE__ */ _export_sfc(_sfc_main$a, [["render", _sfc_render$a], ["__scopeId", "data-v-53fd0043"]]);
16809
+ var Search = /* @__PURE__ */ _export_sfc(_sfc_main$a, [["render", _sfc_render$a], ["__scopeId", "data-v-303d6348"]]);
16725
16810
  var RenderMixin = {
16726
16811
  props: {
16727
16812
  field: {
@@ -17746,6 +17831,7 @@ function defaultColumns(self2, type) {
17746
17831
  return columns;
17747
17832
  }
17748
17833
  let cancelInflight;
17834
+ let cancelledUnmount;
17749
17835
  let typeCacheKey;
17750
17836
  const _sfc_main$5 = {
17751
17837
  props: {
@@ -17810,6 +17896,11 @@ const _sfc_main$5 = {
17810
17896
  },
17811
17897
  deactivated() {
17812
17898
  typeCacheKey = this.$sdk.global.cacheKeys[this.type];
17899
+ if (cancelInflight) {
17900
+ cancelInflight();
17901
+ cancelInflight = null;
17902
+ cancelledUnmount = true;
17903
+ }
17813
17904
  },
17814
17905
  async activated() {
17815
17906
  var self2 = this;
@@ -17818,6 +17909,10 @@ const _sfc_main$5 = {
17818
17909
  typeCacheKey = nowCacheKey;
17819
17910
  self2.dataSource = await self2.load();
17820
17911
  }
17912
+ if (cancelledUnmount) {
17913
+ cancelledUnmount = false;
17914
+ self2.dataSource = await self2.load();
17915
+ }
17821
17916
  },
17822
17917
  async created() {
17823
17918
  var self2 = this;
@@ -18193,7 +18288,7 @@ const _sfc_main$5 = {
18193
18288
  };
18194
18289
  }
18195
18290
  };
18196
- const _withScopeId = (n2) => (pushScopeId("data-v-444f4547"), n2 = n2(), popScopeId(), n2);
18291
+ const _withScopeId = (n2) => (pushScopeId("data-v-00a8af80"), n2 = n2(), popScopeId(), n2);
18197
18292
  const _hoisted_1$5 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ createElementVNode("p", null, null, -1));
18198
18293
  const _hoisted_2$4 = { class: "footer" };
18199
18294
  function _sfc_render$5(_ctx, _cache, $props, $setup, $data, $options) {
@@ -18367,7 +18462,7 @@ function _sfc_render$5(_ctx, _cache, $props, $setup, $data, $options) {
18367
18462
  _: 3
18368
18463
  })) : createCommentVNode("", true);
18369
18464
  }
18370
- var ContentBrowser = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["render", _sfc_render$5], ["__scopeId", "data-v-444f4547"]]);
18465
+ var ContentBrowser = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["render", _sfc_render$5], ["__scopeId", "data-v-00a8af80"]]);
18371
18466
  var ModalMixin = {
18372
18467
  props: {
18373
18468
  options: {