@qikdev/vue-ui 0.1.89 → 0.1.93

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.89";
35
+ const version$1 = "0.1.93";
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;
@@ -4949,6 +4949,9 @@ const _sfc_main$$ = {
4949
4949
  selected: {
4950
4950
  type: Boolean
4951
4951
  },
4952
+ index: {
4953
+ type: Number
4954
+ },
4952
4955
  row: {
4953
4956
  type: Object,
4954
4957
  required: true
@@ -4979,7 +4982,8 @@ const _sfc_main$$ = {
4979
4982
  this.$emit("click:actions", row);
4980
4983
  },
4981
4984
  clickSelect(row) {
4982
- this.$emit("click:select", row);
4985
+ const index2 = this.index;
4986
+ this.$emit("click:select", row, index2);
4983
4987
  }
4984
4988
  },
4985
4989
  computed: {
@@ -5144,9 +5148,24 @@ const _sfc_main$_ = {
5144
5148
  },
5145
5149
  data() {
5146
5150
  return {
5147
- sorting: this.sort
5151
+ sorting: this.sort,
5152
+ lastSelectedIndex: null,
5153
+ shift: false,
5154
+ keyListenersAdded: false
5148
5155
  };
5149
5156
  },
5157
+ mounted() {
5158
+ this.addKeyListeners();
5159
+ },
5160
+ activated() {
5161
+ this.addKeyListeners();
5162
+ },
5163
+ beforeUnmount() {
5164
+ this.removeKeyListeners();
5165
+ },
5166
+ deactivated() {
5167
+ this.removeKeyListeners();
5168
+ },
5150
5169
  computed: {
5151
5170
  currentSortDirection() {
5152
5171
  var _a;
@@ -5187,6 +5206,32 @@ const _sfc_main$_ = {
5187
5206
  }
5188
5207
  },
5189
5208
  methods: {
5209
+ keyDown(event) {
5210
+ if (event.keyCode == 16) {
5211
+ this.shift = true;
5212
+ }
5213
+ },
5214
+ keyUp(event) {
5215
+ if (event.keyCode == 16) {
5216
+ this.shift = false;
5217
+ }
5218
+ },
5219
+ addKeyListeners() {
5220
+ if (this.keyListenersAdded) {
5221
+ return;
5222
+ }
5223
+ window.addEventListener("keydown", this.keyDown, true);
5224
+ window.addEventListener("keyup", this.keyUp, true);
5225
+ this.keyListenersAdded = true;
5226
+ },
5227
+ removeKeyListeners() {
5228
+ if (!this.keyListenersAdded) {
5229
+ return;
5230
+ }
5231
+ window.removeEventListener("keydown", this.keyDown, true);
5232
+ window.removeEventListener("keyup", this.keyUp, true);
5233
+ this.keyListenersAdded = false;
5234
+ },
5190
5235
  togglePage() {
5191
5236
  var self2 = this;
5192
5237
  if (self2.pageSelected) {
@@ -5218,6 +5263,13 @@ const _sfc_main$_ = {
5218
5263
  }
5219
5264
  return array;
5220
5265
  },
5266
+ selectRange(start, end) {
5267
+ const self2 = this;
5268
+ const startIndex = Math.min(start, end);
5269
+ const endIndex = Math.max(start, end) + 1;
5270
+ var targetRows = self2.renderRows.slice(startIndex, endIndex);
5271
+ self2.$emit("select:multiple", targetRows);
5272
+ },
5221
5273
  toggleSort(column) {
5222
5274
  var _a, _b;
5223
5275
  const currentKey = (_a = this.sorting) == null ? void 0 : _a.key;
@@ -5241,7 +5293,15 @@ const _sfc_main$_ = {
5241
5293
  clickActions(row) {
5242
5294
  this.$emit("click:actions", row);
5243
5295
  },
5244
- clickSelect(row) {
5296
+ clickSelect(row, index2) {
5297
+ const currentSelectedIndex = this.lastSelectedIndex;
5298
+ if (this.shift) {
5299
+ if (currentSelectedIndex != index2) {
5300
+ console.log("FROM", currentSelectedIndex, "-", index2);
5301
+ return this.selectRange(currentSelectedIndex, index2);
5302
+ }
5303
+ }
5304
+ this.lastSelectedIndex = index2;
5245
5305
  this.$emit("select:row:toggle", row);
5246
5306
  }
5247
5307
  }
@@ -5367,7 +5427,7 @@ function _sfc_render$_(_ctx, _cache, $props, $setup, $data, $options) {
5367
5427
  ])
5368
5428
  ]),
5369
5429
  createElementVNode("tbody", null, [
5370
- (openBlock(true), createElementBlock(Fragment, null, renderList($options.renderRows, (row) => {
5430
+ (openBlock(true), createElementBlock(Fragment, null, renderList($options.renderRows, (row, index2) => {
5371
5431
  return openBlock(), createBlock(_component_table_row, {
5372
5432
  enableSelection: $props.enableSelection,
5373
5433
  enableActions: $props.enableActions,
@@ -5378,15 +5438,16 @@ function _sfc_render$_(_ctx, _cache, $props, $setup, $data, $options) {
5378
5438
  "onClick:actions": $options.clickActions,
5379
5439
  selected: $options.isSelected(row),
5380
5440
  row,
5441
+ index: index2,
5381
5442
  columns: $props.columns
5382
- }, null, 8, ["enableSelection", "enableActions", "onClick:cell", "onClick:row", "onClick:select", "onClick:actions", "selected", "row", "columns"]);
5443
+ }, null, 8, ["enableSelection", "enableActions", "onClick:cell", "onClick:row", "onClick:select", "onClick:actions", "selected", "row", "index", "columns"]);
5383
5444
  }), 128))
5384
5445
  ])
5385
5446
  ])
5386
5447
  ], 512)
5387
5448
  ]);
5388
5449
  }
5389
- var NativeTable = /* @__PURE__ */ _export_sfc(_sfc_main$_, [["render", _sfc_render$_], ["__scopeId", "data-v-23402222"]]);
5450
+ var NativeTable = /* @__PURE__ */ _export_sfc(_sfc_main$_, [["render", _sfc_render$_], ["__scopeId", "data-v-2b235040"]]);
5390
5451
  var spinner_vue_vue_type_style_index_0_scoped_true_lang = "";
5391
5452
  const _sfc_main$Z = {
5392
5453
  props: {
@@ -5672,9 +5733,8 @@ const _sfc_main$V = {
5672
5733
  }
5673
5734
  if (this.to) {
5674
5735
  return `router-link`;
5675
- } else {
5676
- return "a";
5677
5736
  }
5737
+ return "a";
5678
5738
  }
5679
5739
  }
5680
5740
  };
@@ -5692,7 +5752,7 @@ function _sfc_render$V(_ctx, _cache, $props, $setup, $data, $options) {
5692
5752
  _: 3
5693
5753
  }, 8, ["onClick", "to", "href", "target", "class"]);
5694
5754
  }
5695
- var UXLink = /* @__PURE__ */ _export_sfc(_sfc_main$V, [["render", _sfc_render$V], ["__scopeId", "data-v-efa81728"]]);
5755
+ var UXLink = /* @__PURE__ */ _export_sfc(_sfc_main$V, [["render", _sfc_render$V], ["__scopeId", "data-v-8b82829a"]]);
5696
5756
  var icon_vue_vue_type_style_index_0_scoped_true_lang = "";
5697
5757
  const _sfc_main$U = {
5698
5758
  props: {
@@ -14644,6 +14704,9 @@ const _sfc_main$n = {
14644
14704
  },
14645
14705
  lang: {
14646
14706
  type: String
14707
+ },
14708
+ readonly: {
14709
+ type: Boolean
14647
14710
  }
14648
14711
  },
14649
14712
  watch: {
@@ -14676,6 +14739,7 @@ function _sfc_render$n(_ctx, _cache, $props, $setup, $data, $options) {
14676
14739
  default: withCtx(() => [
14677
14740
  createVNode(_component_v_ace_editor, {
14678
14741
  onBlur: $options.format,
14742
+ readonly: $props.readonly,
14679
14743
  class: "editor-wrap",
14680
14744
  value: $data.model,
14681
14745
  "onUpdate:value": _cache[0] || (_cache[0] = ($event) => $data.model = $event),
@@ -14684,12 +14748,12 @@ function _sfc_render$n(_ctx, _cache, $props, $setup, $data, $options) {
14684
14748
  lang: $props.lang,
14685
14749
  theme: "tomorrow_night_eighties",
14686
14750
  style: { "height": "300px" }
14687
- }, null, 8, ["onBlur", "value", "onInit", "lang"])
14751
+ }, null, 8, ["onBlur", "readonly", "value", "onInit", "lang"])
14688
14752
  ]),
14689
14753
  _: 1
14690
14754
  })) : createCommentVNode("", true);
14691
14755
  }
14692
- var CodeEditor = /* @__PURE__ */ _export_sfc(_sfc_main$n, [["render", _sfc_render$n], ["__scopeId", "data-v-ff0cfcf4"]]);
14756
+ var CodeEditor = /* @__PURE__ */ _export_sfc(_sfc_main$n, [["render", _sfc_render$n], ["__scopeId", "data-v-edf89936"]]);
14693
14757
  var codeEditorField_vue_vue_type_style_index_0_scoped_true_lang = "";
14694
14758
  const _sfc_main$m = {
14695
14759
  components: {
@@ -14906,9 +14970,7 @@ function _sfc_render$k(_ctx, _cache, $props, $setup, $data, $options) {
14906
14970
  const _component_ux_icon = resolveComponent("ux-icon");
14907
14971
  const _component_ux_button = resolveComponent("ux-button");
14908
14972
  const _component_flex_row = resolveComponent("flex-row");
14909
- return openBlock(), createElementBlock("div", {
14910
- onKeydown: _cache[2] || (_cache[2] = withKeys(withModifiers(($event) => _ctx.enterPress($event), ["stop"]), ["enter"]))
14911
- }, [
14973
+ return openBlock(), createElementBlock("div", null, [
14912
14974
  _ctx.showLabel ? (openBlock(), createElementBlock("label", _hoisted_1$f, [
14913
14975
  createTextVNode(toDisplayString(_ctx.label) + " ", 1),
14914
14976
  _ctx.required ? (openBlock(), createElementBlock("span", _hoisted_2$c, "*")) : createCommentVNode("", true)
@@ -14976,9 +15038,9 @@ function _sfc_render$k(_ctx, _cache, $props, $setup, $data, $options) {
14976
15038
  "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => _ctx.model = $event)
14977
15039
  }, null, 8, ["onFocus", "modelValue"])
14978
15040
  ]))
14979
- ], 32);
15041
+ ]);
14980
15042
  }
14981
- var RichTextField = /* @__PURE__ */ _export_sfc(_sfc_main$k, [["render", _sfc_render$k], ["__scopeId", "data-v-ba71f3d6"]]);
15043
+ var RichTextField = /* @__PURE__ */ _export_sfc(_sfc_main$k, [["render", _sfc_render$k], ["__scopeId", "data-v-46ce3b2b"]]);
14982
15044
  var InternalRouteSelect_vue_vue_type_style_index_0_scoped_true_lang = "";
14983
15045
  function isUndefined$1(entry) {
14984
15046
  return entry === void 0 || typeof entry === "undefined" || entry === null || String(entry) === "null" || String(entry) === "undefined";
@@ -16153,7 +16215,8 @@ function computedExpression(key) {
16153
16215
  return;
16154
16216
  }
16155
16217
  let context = self2.expressionsContext;
16156
- return service.evaluateExpression(expression, context);
16218
+ let result = service.evaluateExpression(expression, context);
16219
+ return result;
16157
16220
  };
16158
16221
  }
16159
16222
  const _sfc_main$h = {
@@ -16219,7 +16282,7 @@ const _sfc_main$h = {
16219
16282
  isDirtyBeforeInput: false
16220
16283
  };
16221
16284
  },
16222
- inject: ["parentFormElement"],
16285
+ inject: ["parentFormElement", "additionalContext"],
16223
16286
  provide() {
16224
16287
  return {
16225
16288
  fieldPath: this.fieldPath
@@ -16469,11 +16532,13 @@ const _sfc_main$h = {
16469
16532
  return this.field.expressions;
16470
16533
  },
16471
16534
  expressionsContext() {
16472
- return {
16535
+ const context = {
16473
16536
  this: this.model,
16474
16537
  model: this.model,
16475
- data: this.parentModel
16538
+ data: this.parentModel,
16539
+ additional: __spreadValues({}, this.additionalContext.value)
16476
16540
  };
16541
+ return context;
16477
16542
  },
16478
16543
  hidden() {
16479
16544
  if (this.actualField.readOnly) {
@@ -16846,7 +16911,7 @@ function _sfc_render$h(_ctx, _cache, $props, $setup, $data, $options) {
16846
16911
  $options.error && $data.validateResults.message ? (openBlock(), createElementBlock("div", _hoisted_1$c, toDisplayString($data.validateResults.message), 1)) : createCommentVNode("", true)
16847
16912
  ], 34)) : createCommentVNode("", true);
16848
16913
  }
16849
- var UXFormField = /* @__PURE__ */ _export_sfc(_sfc_main$h, [["render", _sfc_render$h], ["__scopeId", "data-v-1d0f7c92"]]);
16914
+ var UXFormField = /* @__PURE__ */ _export_sfc(_sfc_main$h, [["render", _sfc_render$h], ["__scopeId", "data-v-64d30f70"]]);
16850
16915
  var form_vue_vue_type_style_index_0_scoped_true_lang = "";
16851
16916
  const _sfc_main$g = {
16852
16917
  props: {
@@ -18550,6 +18615,9 @@ const _sfc_main$9 = {
18550
18615
  },
18551
18616
  selectedItems(items) {
18552
18617
  this.$emit("update:modelValue", items);
18618
+ },
18619
+ loadKey() {
18620
+ this.$emit("loaded");
18553
18621
  }
18554
18622
  },
18555
18623
  computed: {
@@ -18905,7 +18973,6 @@ const _sfc_main$9 = {
18905
18973
  cancelInflight = null;
18906
18974
  self2.loading = false;
18907
18975
  self2.loadKey++;
18908
- self2.$emit("loaded");
18909
18976
  });
18910
18977
  promise.catch(function(err) {
18911
18978
  cancelInflight = null;
@@ -18946,7 +19013,7 @@ const _sfc_main$9 = {
18946
19013
  };
18947
19014
  }
18948
19015
  };
18949
- const _withScopeId$1 = (n2) => (pushScopeId("data-v-7783955b"), n2 = n2(), popScopeId(), n2);
19016
+ const _withScopeId$1 = (n2) => (pushScopeId("data-v-1a77f116"), n2 = n2(), popScopeId(), n2);
18950
19017
  const _hoisted_1$7 = /* @__PURE__ */ _withScopeId$1(() => /* @__PURE__ */ createElementVNode("p", null, null, -1));
18951
19018
  const _hoisted_2$6 = { key: 0 };
18952
19019
  const _hoisted_3$5 = /* @__PURE__ */ _withScopeId$1(() => /* @__PURE__ */ createElementVNode("p", null, null, -1));
@@ -19134,7 +19201,7 @@ function _sfc_render$9(_ctx, _cache, $props, $setup, $data, $options) {
19134
19201
  _: 3
19135
19202
  })) : createCommentVNode("", true);
19136
19203
  }
19137
- var ContentBrowser = /* @__PURE__ */ _export_sfc(_sfc_main$9, [["render", _sfc_render$9], ["__scopeId", "data-v-7783955b"]]);
19204
+ var ContentBrowser = /* @__PURE__ */ _export_sfc(_sfc_main$9, [["render", _sfc_render$9], ["__scopeId", "data-v-1a77f116"]]);
19138
19205
  var ScopeItem_vue_vue_type_style_index_0_scoped_true_lang = "";
19139
19206
  const _sfc_main$8 = {
19140
19207
  props: {