@qikdev/vue-ui 0.1.37 → 0.1.40

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, pushScopeId, popScopeId, createElementVNode, normalizeStyle, createCommentVNode, Teleport, createTextVNode, vModelSelect, withKeys, withModifiers, vModelText, TransitionGroup, defineComponent, h, nextTick, vModelDynamic, vModelCheckbox, mergeProps, toHandlers, reactive, watch } from "vue";
34
34
  import { EventDispatcher } from "@qikdev/sdk";
35
- const version$1 = "0.1.37";
35
+ const version$1 = "0.1.40";
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;
@@ -146,14 +146,12 @@ const _sfc_main$_ = {
146
146
  },
147
147
  methods: {
148
148
  select(i2) {
149
- console.log("SELECT", this.activeIndex);
150
149
  this.activeIndex = i2;
151
150
  }
152
151
  },
153
152
  computed: {
154
153
  tabs() {
155
154
  var slotChildren = this.$slots.default();
156
- console.log("SLOT CHILDREN", slotChildren);
157
155
  return slotChildren;
158
156
  }
159
157
  }
@@ -200,7 +198,7 @@ function _sfc_render$_(_ctx, _cache, $props, $setup, $data, $options) {
200
198
  _: 1
201
199
  });
202
200
  }
203
- var UXTabset = /* @__PURE__ */ _export_sfc(_sfc_main$_, [["render", _sfc_render$_], ["__scopeId", "data-v-b5715b66"]]);
201
+ var UXTabset = /* @__PURE__ */ _export_sfc(_sfc_main$_, [["render", _sfc_render$_], ["__scopeId", "data-v-1835b512"]]);
204
202
  const _sfc_main$Z = {
205
203
  props: {
206
204
  heading: {
@@ -242,7 +240,7 @@ const _sfc_main$Y = {
242
240
  }
243
241
  }
244
242
  };
245
- const _withScopeId$4 = (n2) => (pushScopeId("data-v-5ef0f22e"), n2 = n2(), popScopeId(), n2);
243
+ const _withScopeId$4 = (n2) => (pushScopeId("data-v-27f20370"), n2 = n2(), popScopeId(), n2);
246
244
  const _hoisted_1$L = /* @__PURE__ */ _withScopeId$4(() => /* @__PURE__ */ createElementVNode("i", { class: "fa fa-spin fa-spinner" }, null, -1));
247
245
  const _hoisted_2$B = [
248
246
  _hoisted_1$L
@@ -252,7 +250,7 @@ function _sfc_render$Y(_ctx, _cache, $props, $setup, $data, $options) {
252
250
  class: normalizeClass(["ux-spinner", { large: $props.large }])
253
251
  }, _hoisted_2$B, 2);
254
252
  }
255
- var Spinner = /* @__PURE__ */ _export_sfc(_sfc_main$Y, [["render", _sfc_render$Y], ["__scopeId", "data-v-5ef0f22e"]]);
253
+ var Spinner = /* @__PURE__ */ _export_sfc(_sfc_main$Y, [["render", _sfc_render$Y], ["__scopeId", "data-v-27f20370"]]);
256
254
  var button_vue_vue_type_style_index_0_scoped_true_lang = "";
257
255
  const _sfc_main$X = {
258
256
  components: {
@@ -758,7 +756,7 @@ function _sfc_render$S(_ctx, _cache, $props, $setup, $data, $options) {
758
756
  ]))
759
757
  ], 2);
760
758
  }
761
- var UXMenu = /* @__PURE__ */ _export_sfc(_sfc_main$S, [["render", _sfc_render$S], ["__scopeId", "data-v-3d55731c"]]);
759
+ var UXMenu = /* @__PURE__ */ _export_sfc(_sfc_main$S, [["render", _sfc_render$S], ["__scopeId", "data-v-29d476a2"]]);
762
760
  var image_vue_vue_type_style_index_0_scoped_true_lang = "";
763
761
  const _sfc_main$R = {
764
762
  props: {
@@ -942,6 +940,60 @@ function _sfc_render$O(_ctx, _cache, $props, $setup, $data, $options) {
942
940
  ]);
943
941
  }
944
942
  var UXListItem = /* @__PURE__ */ _export_sfc(_sfc_main$O, [["render", _sfc_render$O], ["__scopeId", "data-v-0e73c260"]]);
943
+ var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
944
+ var safeJsonStringify$1 = { exports: {} };
945
+ var hasProp = Object.prototype.hasOwnProperty;
946
+ function throwsMessage(err) {
947
+ return "[Throws: " + (err ? err.message : "?") + "]";
948
+ }
949
+ function safeGetValueFromPropertyOnObject(obj, property) {
950
+ if (hasProp.call(obj, property)) {
951
+ try {
952
+ return obj[property];
953
+ } catch (err) {
954
+ return throwsMessage(err);
955
+ }
956
+ }
957
+ return obj[property];
958
+ }
959
+ function ensureProperties(obj) {
960
+ var seen = [];
961
+ function visit(obj2) {
962
+ if (obj2 === null || typeof obj2 !== "object") {
963
+ return obj2;
964
+ }
965
+ if (seen.indexOf(obj2) !== -1) {
966
+ return "[Circular]";
967
+ }
968
+ seen.push(obj2);
969
+ if (typeof obj2.toJSON === "function") {
970
+ try {
971
+ var fResult = visit(obj2.toJSON());
972
+ seen.pop();
973
+ return fResult;
974
+ } catch (err) {
975
+ return throwsMessage(err);
976
+ }
977
+ }
978
+ if (Array.isArray(obj2)) {
979
+ var aResult = obj2.map(visit);
980
+ seen.pop();
981
+ return aResult;
982
+ }
983
+ var result = Object.keys(obj2).reduce(function(result2, prop) {
984
+ result2[prop] = visit(safeGetValueFromPropertyOnObject(obj2, prop));
985
+ return result2;
986
+ }, {});
987
+ seen.pop();
988
+ return result;
989
+ }
990
+ return visit(obj);
991
+ }
992
+ safeJsonStringify$1.exports = function(data, replacer, space) {
993
+ return JSON.stringify(ensureProperties(data), replacer, space);
994
+ };
995
+ safeJsonStringify$1.exports.ensureProperties = ensureProperties;
996
+ var safeJsonStringify = safeJsonStringify$1.exports;
945
997
  function isUndefined$7(v, type) {
946
998
  return v === void 0 || v === null || type == "date" && v.toString && v.toString() === "Invalid Date";
947
999
  }
@@ -966,7 +1018,7 @@ var InputMixin = {
966
1018
  modelValue(val, old) {
967
1019
  var cleanedValue = this.cleanInput(val);
968
1020
  var cleanedModel = this.cleanInput(this.model);
969
- if (JSON.stringify(cleanedValue) != JSON.stringify(cleanedModel)) {
1021
+ if (safeJsonStringify(cleanedValue) != safeJsonStringify(cleanedModel)) {
970
1022
  this.model = cleanedValue;
971
1023
  }
972
1024
  }
@@ -6677,7 +6729,6 @@ function _sfc_render$B(_ctx, _cache, $props, $setup, $data, $options) {
6677
6729
  ])) : createCommentVNode("", true);
6678
6730
  }
6679
6731
  var FilterCondition = /* @__PURE__ */ _export_sfc(_sfc_main$B, [["render", _sfc_render$B]]);
6680
- var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
6681
6732
  function isObject$4(value) {
6682
6733
  var type = typeof value;
6683
6734
  return value != null && (type == "object" || type == "function");
@@ -10250,7 +10301,9 @@ const _sfc_main$l = {
10250
10301
  return actual;
10251
10302
  },
10252
10303
  changeString() {
10253
- return `${JSON.stringify(this.fieldModel)}-${this.actualField.minimum}-${this.actualField.referenceType}`;
10304
+ const fieldModel = this.fieldModel;
10305
+ const stringified = safeJsonStringify(fieldModel);
10306
+ return `${stringified}-${this.actualField.minimum}-${this.actualField.referenceType}`;
10254
10307
  },
10255
10308
  valid() {
10256
10309
  return !this.invalid;
@@ -10670,7 +10723,7 @@ function _sfc_render$l(_ctx, _cache, $props, $setup, $data, $options) {
10670
10723
  $options.error && $data.validateResults.message ? (openBlock(), createElementBlock("div", _hoisted_1$g, toDisplayString($data.validateResults.message), 1)) : createCommentVNode("", true)
10671
10724
  ], 34)) : createCommentVNode("", true);
10672
10725
  }
10673
- var UXFormField = /* @__PURE__ */ _export_sfc(_sfc_main$l, [["render", _sfc_render$l], ["__scopeId", "data-v-8477ba44"]]);
10726
+ var UXFormField = /* @__PURE__ */ _export_sfc(_sfc_main$l, [["render", _sfc_render$l], ["__scopeId", "data-v-54e7b3ce"]]);
10674
10727
  var form_vue_vue_type_style_index_0_scoped_true_lang = "";
10675
10728
  const _sfc_main$k = {
10676
10729
  props: {
@@ -17211,21 +17264,46 @@ const _sfc_main$5 = {
17211
17264
  return defaultSort;
17212
17265
  },
17213
17266
  fields() {
17214
- var allFields = [...this.definition.fields];
17215
- var definedFields = this.definition.definedFields || [];
17267
+ const self2 = this;
17268
+ const isFormSubmission = self2.definition.definesType === "submission";
17269
+ var allFields = [...self2.definition.fields];
17270
+ var definedFields = self2.definition.definedFields || [];
17216
17271
  if (definedFields.length) {
17217
- var customFields = {
17218
- title: `${this.definition.title}`,
17219
- minimum: 1,
17220
- maximum: 1,
17221
- key: "data",
17222
- asObject: true,
17223
- type: "group",
17224
- fields: definedFields
17225
- };
17226
- allFields.push(customFields);
17272
+ if (isFormSubmission) {
17273
+ var formDataFields = {
17274
+ title: `Form Data`,
17275
+ minimum: 1,
17276
+ maximum: 1,
17277
+ key: "formData",
17278
+ asObject: true,
17279
+ type: "group",
17280
+ fields: definedFields
17281
+ };
17282
+ allFields.push(formDataFields);
17283
+ var dataFields = {
17284
+ title: `Data`,
17285
+ minimum: 1,
17286
+ maximum: 1,
17287
+ key: "data",
17288
+ asObject: true,
17289
+ type: "group",
17290
+ fields: definedFields
17291
+ };
17292
+ allFields.push(dataFields);
17293
+ } else {
17294
+ var dataFields = {
17295
+ title: `${self2.definition.title}`,
17296
+ minimum: 1,
17297
+ maximum: 1,
17298
+ key: "data",
17299
+ asObject: true,
17300
+ type: "group",
17301
+ fields: definedFields
17302
+ };
17303
+ allFields.push(dataFields);
17304
+ }
17227
17305
  }
17228
- var mapped = this.$qik.utils.mapFields(allFields).filter(function(field) {
17306
+ var mapped = self2.$qik.utils.mapFields(allFields).filter(function(field) {
17229
17307
  var isObject2 = field.type == "group" && field.asObject && (field.minimum == 1 && field.maximum == 1);
17230
17308
  return !isObject2;
17231
17309
  }).map(function(field) {
@@ -17339,11 +17417,12 @@ const _sfc_main$5 = {
17339
17417
  },
17340
17418
  methods: {
17341
17419
  toggleField(field) {
17342
- var key = field.path;
17420
+ var key = field.path || field.key;
17343
17421
  var index2 = this.additionalFields.findIndex(function(f) {
17344
- return f.key == key;
17422
+ return f.path === key || f.key === key;
17345
17423
  });
17346
- if (index2 == -1) {
17424
+ console.log("index", index2, key);
17425
+ if (index2 === -1) {
17347
17426
  this.additionalFields.push(field);
17348
17427
  } else {
17349
17428
  this.additionalFields.splice(index2, 1);
@@ -17453,7 +17532,7 @@ const _sfc_main$5 = {
17453
17532
  };
17454
17533
  }
17455
17534
  };
17456
- const _withScopeId = (n2) => (pushScopeId("data-v-0f7f08aa"), n2 = n2(), popScopeId(), n2);
17535
+ const _withScopeId = (n2) => (pushScopeId("data-v-685be52b"), n2 = n2(), popScopeId(), n2);
17457
17536
  const _hoisted_1$5 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ createElementVNode("p", null, null, -1));
17458
17537
  const _hoisted_2$4 = { class: "footer" };
17459
17538
  function _sfc_render$5(_ctx, _cache, $props, $setup, $data, $options) {
@@ -17524,7 +17603,8 @@ function _sfc_render$5(_ctx, _cache, $props, $setup, $data, $options) {
17524
17603
  default: withCtx(() => [
17525
17604
  (openBlock(true), createElementBlock(Fragment, null, renderList($options.fields, (field) => {
17526
17605
  return openBlock(), createBlock(_component_ux_list_item, {
17527
- onClick: ($event) => $options.toggleField(field)
17606
+ onClick: ($event) => $options.toggleField(field),
17607
+ key: field.path
17528
17608
  }, {
17529
17609
  default: withCtx(() => [
17530
17610
  createVNode(_component_ux_icon, {
@@ -17535,7 +17615,7 @@ function _sfc_render$5(_ctx, _cache, $props, $setup, $data, $options) {
17535
17615
  ]),
17536
17616
  _: 2
17537
17617
  }, 1032, ["onClick"]);
17538
- }), 256))
17618
+ }), 128))
17539
17619
  ]),
17540
17620
  _: 1
17541
17621
  })
@@ -17622,7 +17702,7 @@ function _sfc_render$5(_ctx, _cache, $props, $setup, $data, $options) {
17622
17702
  _: 3
17623
17703
  })) : createCommentVNode("", true);
17624
17704
  }
17625
- var ContentBrowser = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["render", _sfc_render$5], ["__scopeId", "data-v-0f7f08aa"]]);
17705
+ var ContentBrowser = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["render", _sfc_render$5], ["__scopeId", "data-v-685be52b"]]);
17626
17706
  var ModalMixin = {
17627
17707
  props: {
17628
17708
  options: {