@qikdev/vue-ui 0.1.82 → 0.1.85

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.82";
35
+ const version$1 = "0.1.85";
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;
@@ -762,6 +762,7 @@ function _sfc_render$12(_ctx, _cache, $props, $setup, $data, $options) {
762
762
  const _component_ux_button = resolveComponent("ux-button");
763
763
  return openBlock(), createElementBlock("td", _hoisted_1$P, [
764
764
  createVNode(_component_ux_button, {
765
+ color: $options.button.color,
765
766
  size: $options.button.size,
766
767
  loading: $data.processing,
767
768
  onClick: withModifiers($options.clicked, ["stop", "prevent"])
@@ -777,10 +778,10 @@ function _sfc_render$12(_ctx, _cache, $props, $setup, $data, $options) {
777
778
  }, null, 8, ["icon"])) : createCommentVNode("", true)
778
779
  ]),
779
780
  _: 1
780
- }, 8, ["size", "loading", "onClick"])
781
+ }, 8, ["color", "size", "loading", "onClick"])
781
782
  ]);
782
783
  }
783
- var ButtonCell = /* @__PURE__ */ _export_sfc(_sfc_main$12, [["render", _sfc_render$12], ["__scopeId", "data-v-3cbecb7e"]]);
784
+ var ButtonCell = /* @__PURE__ */ _export_sfc(_sfc_main$12, [["render", _sfc_render$12], ["__scopeId", "data-v-1c498011"]]);
784
785
  class LuxonError extends Error {
785
786
  }
786
787
  class InvalidDateTimeError extends LuxonError {
@@ -5076,6 +5077,12 @@ const _sfc_main$W = {
5076
5077
  top: 0,
5077
5078
  left: 0
5078
5079
  });
5080
+ },
5081
+ sort(s2) {
5082
+ this.sorting = s2;
5083
+ },
5084
+ sorting(s2) {
5085
+ this.$emit("update:sort", s2);
5079
5086
  }
5080
5087
  },
5081
5088
  props: {
@@ -5112,6 +5119,16 @@ const _sfc_main$W = {
5112
5119
  return true;
5113
5120
  }
5114
5121
  },
5122
+ sort: {
5123
+ type: Object,
5124
+ default() {
5125
+ return {
5126
+ key: "title",
5127
+ type: "string",
5128
+ direction: "asc"
5129
+ };
5130
+ }
5131
+ },
5115
5132
  selection: {
5116
5133
  type: Array,
5117
5134
  default() {
@@ -5125,7 +5142,16 @@ const _sfc_main$W = {
5125
5142
  type: Function
5126
5143
  }
5127
5144
  },
5145
+ data() {
5146
+ return {
5147
+ sorting: this.sort
5148
+ };
5149
+ },
5128
5150
  computed: {
5151
+ currentSortDirection() {
5152
+ var _a;
5153
+ return ((_a = this.sorting) == null ? void 0 : _a.direction) || "asc";
5154
+ },
5129
5155
  selectionHash() {
5130
5156
  var self2 = this;
5131
5157
  return self2.selection.reduce(function(set, row) {
@@ -5193,6 +5219,18 @@ const _sfc_main$W = {
5193
5219
  return array;
5194
5220
  },
5195
5221
  toggleSort(column) {
5222
+ var _a, _b;
5223
+ const currentKey = (_a = this.sorting) == null ? void 0 : _a.key;
5224
+ const currentDirection = ((_b = this.sorting) == null ? void 0 : _b.direction) || "asc";
5225
+ let { key, direction } = column;
5226
+ if (key === currentKey) {
5227
+ direction = currentDirection === "dsc" ? "asc" : "dsc";
5228
+ }
5229
+ this.sorting = {
5230
+ key,
5231
+ direction,
5232
+ type: column.type
5233
+ };
5196
5234
  },
5197
5235
  clickRow(row) {
5198
5236
  this.$emit("click:row", row);
@@ -5230,6 +5268,8 @@ function _sfc_render$W(_ctx, _cache, $props, $setup, $data, $options) {
5230
5268
  const _component_ux_list_item = resolveComponent("ux-list-item");
5231
5269
  const _component_ux_list = resolveComponent("ux-list");
5232
5270
  const _component_ux_menu = resolveComponent("ux-menu");
5271
+ const _component_flex_cell = resolveComponent("flex-cell");
5272
+ const _component_flex_row = resolveComponent("flex-row");
5233
5273
  const _component_table_row = resolveComponent("table-row");
5234
5274
  return openBlock(), createElementBlock("div", _hoisted_1$K, [
5235
5275
  createElementVNode("div", _hoisted_2$C, [
@@ -5287,10 +5327,39 @@ function _sfc_render$W(_ctx, _cache, $props, $setup, $data, $options) {
5287
5327
  })
5288
5328
  ])) : createCommentVNode("", true),
5289
5329
  (openBlock(true), createElementBlock(Fragment, null, renderList($options.renderColumns, (column) => {
5330
+ var _a;
5290
5331
  return openBlock(), createElementBlock("th", {
5291
5332
  onClick: ($event) => $options.toggleSort(column),
5292
- class: normalizeClass(column.class)
5293
- }, toDisplayString(column.title), 11, _hoisted_7$f);
5333
+ class: normalizeClass([{ sortable: column.sortable !== false, active: column.key === ((_a = $data.sorting) == null ? void 0 : _a.key) }, column.class])
5334
+ }, [
5335
+ createVNode(_component_flex_row, {
5336
+ gap: "",
5337
+ vcenter: ""
5338
+ }, {
5339
+ default: withCtx(() => {
5340
+ var _a2;
5341
+ return [
5342
+ createVNode(_component_flex_cell, null, {
5343
+ default: withCtx(() => [
5344
+ createTextVNode(toDisplayString(column.title), 1)
5345
+ ]),
5346
+ _: 2
5347
+ }, 1024),
5348
+ column.key === ((_a2 = $data.sorting) == null ? void 0 : _a2.key) ? (openBlock(), createBlock(_component_flex_cell, {
5349
+ key: 0,
5350
+ class: "caret",
5351
+ shrink: ""
5352
+ }, {
5353
+ default: withCtx(() => [
5354
+ createTextVNode(toDisplayString($options.currentSortDirection === "asc" ? "\u25B2" : "\u25BC"), 1)
5355
+ ]),
5356
+ _: 1
5357
+ })) : createCommentVNode("", true)
5358
+ ];
5359
+ }),
5360
+ _: 2
5361
+ }, 1024)
5362
+ ], 10, _hoisted_7$f);
5294
5363
  }), 256)),
5295
5364
  $props.enableActions ? (openBlock(), createElementBlock("th", _hoisted_8$8, [
5296
5365
  renderSlot(_ctx.$slots, "corner", {}, void 0, true)
@@ -5317,7 +5386,7 @@ function _sfc_render$W(_ctx, _cache, $props, $setup, $data, $options) {
5317
5386
  ], 512)
5318
5387
  ]);
5319
5388
  }
5320
- var NativeTable = /* @__PURE__ */ _export_sfc(_sfc_main$W, [["render", _sfc_render$W], ["__scopeId", "data-v-e626ef3a"]]);
5389
+ var NativeTable = /* @__PURE__ */ _export_sfc(_sfc_main$W, [["render", _sfc_render$W], ["__scopeId", "data-v-23402222"]]);
5321
5390
  var spinner_vue_vue_type_style_index_0_scoped_true_lang = "";
5322
5391
  const _sfc_main$V = {
5323
5392
  props: {
@@ -6344,6 +6413,9 @@ var safeJsonStringify = safeJsonStringify$1.exports;
6344
6413
  function isUndefined$6(v, type) {
6345
6414
  return v === void 0 || v === null || type == "date" && v.toString && v.toString() === "Invalid Date";
6346
6415
  }
6416
+ function isNotEmpty(value) {
6417
+ return value !== void 0 && value !== null;
6418
+ }
6347
6419
  var InputMixin = {
6348
6420
  props: {
6349
6421
  field: {
@@ -6571,13 +6643,15 @@ var InputMixin = {
6571
6643
  },
6572
6644
  getValue(option2) {
6573
6645
  if (!option2) {
6574
- return;
6646
+ return this.cleanTextInput(option2);
6575
6647
  }
6576
- var value = option2._id || option2.value;
6577
- if (!value && option2.title && !this.returnObject) {
6648
+ var value = this.cleanTextInput(option2._id || option2.value);
6649
+ var hasValue = isNotEmpty(value);
6650
+ if (!hasValue && option2.title && !this.returnObject) {
6578
6651
  value = option2.title;
6579
6652
  }
6580
- return value || option2;
6653
+ value = this.cleanTextInput(value);
6654
+ return isNotEmpty(value) ? value : option2;
6581
6655
  },
6582
6656
  getLabel(option2) {
6583
6657
  if (!option2) {
@@ -6719,7 +6793,9 @@ const _sfc_main$I = {
6719
6793
  }
6720
6794
  } else {
6721
6795
  if (self2.multiValue) {
6722
- val = (val || []).filter(Boolean).map(function(i2) {
6796
+ val = (val || []).filter(function(i2) {
6797
+ return i2 !== void 0 && i2 !== null;
6798
+ }).map(function(i2) {
6723
6799
  return self2.getValue(i2);
6724
6800
  });
6725
6801
  } else {
@@ -6742,13 +6818,27 @@ const _sfc_main$I = {
6742
6818
  val.length = self2.maximum;
6743
6819
  }
6744
6820
  }
6745
- val = val.filter(Boolean).map(function(v) {
6821
+ val = val.filter(function(v) {
6822
+ return v !== void 0 && v !== null;
6823
+ }).map(function(v) {
6746
6824
  var valueKey2 = self2.getValue(v);
6747
6825
  return self2.returnObject ? self2.optionLookup[valueKey2] : valueKey2;
6748
6826
  });
6749
6827
  } else {
6750
6828
  var valueKey = self2.getValue(val);
6751
6829
  val = self2.returnObject ? self2.optionLookup[valueKey] : valueKey;
6830
+ switch (val) {
6831
+ case "":
6832
+ switch (self2.type) {
6833
+ case "decimal":
6834
+ case "float":
6835
+ case "number":
6836
+ case "integer":
6837
+ val = void 0;
6838
+ break;
6839
+ }
6840
+ break;
6841
+ }
6752
6842
  }
6753
6843
  return val;
6754
6844
  }
@@ -6840,7 +6930,7 @@ function _sfc_render$I(_ctx, _cache, $props, $setup, $data, $options) {
6840
6930
  ])
6841
6931
  ], 2);
6842
6932
  }
6843
- var NativeSelect = /* @__PURE__ */ _export_sfc(_sfc_main$I, [["render", _sfc_render$I], ["__scopeId", "data-v-be09a2cc"]]);
6933
+ var NativeSelect = /* @__PURE__ */ _export_sfc(_sfc_main$I, [["render", _sfc_render$I], ["__scopeId", "data-v-a06c20f2"]]);
6844
6934
  var phoneNumberInput_vue_vue_type_style_index_0_scoped_true_lang = "";
6845
6935
  const _sfc_main$H = {
6846
6936
  props: {
@@ -18503,7 +18593,7 @@ const _sfc_main$5 = {
18503
18593
  }
18504
18594
  return view;
18505
18595
  },
18506
- sort() {
18596
+ defaultSort() {
18507
18597
  var _a;
18508
18598
  var defaultSort = ((_a = this.definition) == null ? void 0 : _a.defaultSort) || {
18509
18599
  key: "title",
@@ -18684,7 +18774,7 @@ const _sfc_main$5 = {
18684
18774
  },
18685
18775
  loadCriteria() {
18686
18776
  var self2 = this;
18687
- var sort2 = self2.sort;
18777
+ var sort2 = self2.sort || self2.defaultSort;
18688
18778
  var search = self2.keywords;
18689
18779
  var select = self2.selectFields;
18690
18780
  var page = self2.page;
@@ -18846,6 +18936,7 @@ const _sfc_main$5 = {
18846
18936
  operator: "and",
18847
18937
  filters: []
18848
18938
  },
18939
+ sort: this.defaultSort,
18849
18940
  keywords: this.search,
18850
18941
  dateRangeFilter: {
18851
18942
  dateRange: this.dateRange
@@ -18854,7 +18945,7 @@ const _sfc_main$5 = {
18854
18945
  };
18855
18946
  }
18856
18947
  };
18857
- const _withScopeId = (n2) => (pushScopeId("data-v-90e9b06e"), n2 = n2(), popScopeId(), n2);
18948
+ const _withScopeId = (n2) => (pushScopeId("data-v-2bc8da05"), n2 = n2(), popScopeId(), n2);
18858
18949
  const _hoisted_1$5 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ createElementVNode("p", null, null, -1));
18859
18950
  const _hoisted_2$4 = { key: 0 };
18860
18951
  const _hoisted_3$4 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ createElementVNode("p", null, null, -1));
@@ -18901,6 +18992,8 @@ function _sfc_render$5(_ctx, _cache, $props, $setup, $data, $options) {
18901
18992
  "onClick:item": $options.rowClicked
18902
18993
  }, null, 8, ["cacheKey", "selection", "items", "onClick:actions", "onSelect:item:toggle", "onClick:item"])) : (openBlock(), createBlock(_component_native_table, {
18903
18994
  key: 1,
18995
+ sort: $data.sort,
18996
+ "onUpdate:sort": _cache[0] || (_cache[0] = ($event) => $data.sort = $event),
18904
18997
  enableActions: $props.enableActions,
18905
18998
  total: $options.totalItems,
18906
18999
  selectAll: $options.selectAll,
@@ -18950,7 +19043,7 @@ function _sfc_render$5(_ctx, _cache, $props, $setup, $data, $options) {
18950
19043
  })
18951
19044
  ]),
18952
19045
  _: 1
18953
- }, 8, ["enableActions", "total", "selectAll", "deselectAll", "selection", "onClick:row", "onClick:actions", "onSelect:row:toggle", "onSelect:multiple", "onDeselect:multiple", "rows", "columns"]))
19046
+ }, 8, ["sort", "enableActions", "total", "selectAll", "deselectAll", "selection", "onClick:row", "onClick:actions", "onSelect:row:toggle", "onSelect:multiple", "onDeselect:multiple", "rows", "columns"]))
18954
19047
  ]),
18955
19048
  _: 1
18956
19049
  })) : !$data.loading ? (openBlock(), createBlock(_component_flex_column, {
@@ -18986,7 +19079,7 @@ function _sfc_render$5(_ctx, _cache, $props, $setup, $data, $options) {
18986
19079
  default: withCtx(() => [
18987
19080
  createVNode(_component_search, {
18988
19081
  modelValue: $data.keywords,
18989
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $data.keywords = $event),
19082
+ "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => $data.keywords = $event),
18990
19083
  loading: $options.searching,
18991
19084
  debounce: 500,
18992
19085
  placeholder: "Keyword Search"
@@ -18996,14 +19089,14 @@ function _sfc_render$5(_ctx, _cache, $props, $setup, $data, $options) {
18996
19089
  createVNode(_component_ux_field, {
18997
19090
  field: $options.dateRangeField,
18998
19091
  modelValue: $data.dateRangeFilter,
18999
- "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => $data.dateRangeFilter = $event)
19092
+ "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => $data.dateRangeFilter = $event)
19000
19093
  }, null, 8, ["field", "modelValue"])
19001
19094
  ])) : createCommentVNode("", true),
19002
19095
  _hoisted_3$4,
19003
19096
  createVNode(_component_filter_builder, {
19004
19097
  definition: $data.definition,
19005
19098
  modelValue: $data.filter,
19006
- "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => $data.filter = $event)
19099
+ "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => $data.filter = $event)
19007
19100
  }, null, 8, ["definition", "modelValue"])
19008
19101
  ]),
19009
19102
  _: 1
@@ -19023,7 +19116,7 @@ function _sfc_render$5(_ctx, _cache, $props, $setup, $data, $options) {
19023
19116
  createElementVNode("div", _hoisted_4$4, [
19024
19117
  createVNode(_component_pager, {
19025
19118
  page: $data.page,
19026
- "onUpdate:page": _cache[3] || (_cache[3] = ($event) => $data.page = $event),
19119
+ "onUpdate:page": _cache[4] || (_cache[4] = ($event) => $data.page = $event),
19027
19120
  total: $options.totalItems
19028
19121
  }, null, 8, ["page", "total"])
19029
19122
  ]),
@@ -19040,7 +19133,7 @@ function _sfc_render$5(_ctx, _cache, $props, $setup, $data, $options) {
19040
19133
  _: 3
19041
19134
  })) : createCommentVNode("", true);
19042
19135
  }
19043
- var ContentBrowser = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["render", _sfc_render$5], ["__scopeId", "data-v-90e9b06e"]]);
19136
+ var ContentBrowser = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["render", _sfc_render$5], ["__scopeId", "data-v-2bc8da05"]]);
19044
19137
  var ModalMixin = {
19045
19138
  props: {
19046
19139
  options: {