@qikdev/vue-ui 0.1.82 → 0.1.83

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.83";
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,38 @@ 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
+ shrink: ""
5351
+ }, {
5352
+ default: withCtx(() => [
5353
+ createTextVNode(toDisplayString($options.currentSortDirection === "asc" ? "\u25B4" : "\u25BE"), 1)
5354
+ ]),
5355
+ _: 1
5356
+ })) : createCommentVNode("", true)
5357
+ ];
5358
+ }),
5359
+ _: 2
5360
+ }, 1024)
5361
+ ], 10, _hoisted_7$f);
5294
5362
  }), 256)),
5295
5363
  $props.enableActions ? (openBlock(), createElementBlock("th", _hoisted_8$8, [
5296
5364
  renderSlot(_ctx.$slots, "corner", {}, void 0, true)
@@ -5317,7 +5385,7 @@ function _sfc_render$W(_ctx, _cache, $props, $setup, $data, $options) {
5317
5385
  ], 512)
5318
5386
  ]);
5319
5387
  }
5320
- var NativeTable = /* @__PURE__ */ _export_sfc(_sfc_main$W, [["render", _sfc_render$W], ["__scopeId", "data-v-e626ef3a"]]);
5388
+ var NativeTable = /* @__PURE__ */ _export_sfc(_sfc_main$W, [["render", _sfc_render$W], ["__scopeId", "data-v-129ac46c"]]);
5321
5389
  var spinner_vue_vue_type_style_index_0_scoped_true_lang = "";
5322
5390
  const _sfc_main$V = {
5323
5391
  props: {
@@ -18503,7 +18571,7 @@ const _sfc_main$5 = {
18503
18571
  }
18504
18572
  return view;
18505
18573
  },
18506
- sort() {
18574
+ defaultSort() {
18507
18575
  var _a;
18508
18576
  var defaultSort = ((_a = this.definition) == null ? void 0 : _a.defaultSort) || {
18509
18577
  key: "title",
@@ -18684,7 +18752,7 @@ const _sfc_main$5 = {
18684
18752
  },
18685
18753
  loadCriteria() {
18686
18754
  var self2 = this;
18687
- var sort2 = self2.sort;
18755
+ var sort2 = self2.sort || self2.defaultSort;
18688
18756
  var search = self2.keywords;
18689
18757
  var select = self2.selectFields;
18690
18758
  var page = self2.page;
@@ -18846,6 +18914,7 @@ const _sfc_main$5 = {
18846
18914
  operator: "and",
18847
18915
  filters: []
18848
18916
  },
18917
+ sort: this.defaultSort,
18849
18918
  keywords: this.search,
18850
18919
  dateRangeFilter: {
18851
18920
  dateRange: this.dateRange
@@ -18854,7 +18923,7 @@ const _sfc_main$5 = {
18854
18923
  };
18855
18924
  }
18856
18925
  };
18857
- const _withScopeId = (n2) => (pushScopeId("data-v-90e9b06e"), n2 = n2(), popScopeId(), n2);
18926
+ const _withScopeId = (n2) => (pushScopeId("data-v-651a3eab"), n2 = n2(), popScopeId(), n2);
18858
18927
  const _hoisted_1$5 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ createElementVNode("p", null, null, -1));
18859
18928
  const _hoisted_2$4 = { key: 0 };
18860
18929
  const _hoisted_3$4 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ createElementVNode("p", null, null, -1));
@@ -18901,6 +18970,8 @@ function _sfc_render$5(_ctx, _cache, $props, $setup, $data, $options) {
18901
18970
  "onClick:item": $options.rowClicked
18902
18971
  }, null, 8, ["cacheKey", "selection", "items", "onClick:actions", "onSelect:item:toggle", "onClick:item"])) : (openBlock(), createBlock(_component_native_table, {
18903
18972
  key: 1,
18973
+ sort: $data.sort,
18974
+ "onUpdate:sort": _cache[0] || (_cache[0] = ($event) => $data.sort = $event),
18904
18975
  enableActions: $props.enableActions,
18905
18976
  total: $options.totalItems,
18906
18977
  selectAll: $options.selectAll,
@@ -18950,7 +19021,7 @@ function _sfc_render$5(_ctx, _cache, $props, $setup, $data, $options) {
18950
19021
  })
18951
19022
  ]),
18952
19023
  _: 1
18953
- }, 8, ["enableActions", "total", "selectAll", "deselectAll", "selection", "onClick:row", "onClick:actions", "onSelect:row:toggle", "onSelect:multiple", "onDeselect:multiple", "rows", "columns"]))
19024
+ }, 8, ["sort", "enableActions", "total", "selectAll", "deselectAll", "selection", "onClick:row", "onClick:actions", "onSelect:row:toggle", "onSelect:multiple", "onDeselect:multiple", "rows", "columns"]))
18954
19025
  ]),
18955
19026
  _: 1
18956
19027
  })) : !$data.loading ? (openBlock(), createBlock(_component_flex_column, {
@@ -18986,7 +19057,7 @@ function _sfc_render$5(_ctx, _cache, $props, $setup, $data, $options) {
18986
19057
  default: withCtx(() => [
18987
19058
  createVNode(_component_search, {
18988
19059
  modelValue: $data.keywords,
18989
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $data.keywords = $event),
19060
+ "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => $data.keywords = $event),
18990
19061
  loading: $options.searching,
18991
19062
  debounce: 500,
18992
19063
  placeholder: "Keyword Search"
@@ -18996,14 +19067,14 @@ function _sfc_render$5(_ctx, _cache, $props, $setup, $data, $options) {
18996
19067
  createVNode(_component_ux_field, {
18997
19068
  field: $options.dateRangeField,
18998
19069
  modelValue: $data.dateRangeFilter,
18999
- "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => $data.dateRangeFilter = $event)
19070
+ "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => $data.dateRangeFilter = $event)
19000
19071
  }, null, 8, ["field", "modelValue"])
19001
19072
  ])) : createCommentVNode("", true),
19002
19073
  _hoisted_3$4,
19003
19074
  createVNode(_component_filter_builder, {
19004
19075
  definition: $data.definition,
19005
19076
  modelValue: $data.filter,
19006
- "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => $data.filter = $event)
19077
+ "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => $data.filter = $event)
19007
19078
  }, null, 8, ["definition", "modelValue"])
19008
19079
  ]),
19009
19080
  _: 1
@@ -19023,7 +19094,7 @@ function _sfc_render$5(_ctx, _cache, $props, $setup, $data, $options) {
19023
19094
  createElementVNode("div", _hoisted_4$4, [
19024
19095
  createVNode(_component_pager, {
19025
19096
  page: $data.page,
19026
- "onUpdate:page": _cache[3] || (_cache[3] = ($event) => $data.page = $event),
19097
+ "onUpdate:page": _cache[4] || (_cache[4] = ($event) => $data.page = $event),
19027
19098
  total: $options.totalItems
19028
19099
  }, null, 8, ["page", "total"])
19029
19100
  ]),
@@ -19040,7 +19111,7 @@ function _sfc_render$5(_ctx, _cache, $props, $setup, $data, $options) {
19040
19111
  _: 3
19041
19112
  })) : createCommentVNode("", true);
19042
19113
  }
19043
- var ContentBrowser = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["render", _sfc_render$5], ["__scopeId", "data-v-90e9b06e"]]);
19114
+ var ContentBrowser = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["render", _sfc_render$5], ["__scopeId", "data-v-651a3eab"]]);
19044
19115
  var ModalMixin = {
19045
19116
  props: {
19046
19117
  options: {