@qikdev/vue-ui 0.1.67 → 0.1.71

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.67";
35
+ const version$1 = "0.1.71";
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;
@@ -6182,6 +6182,7 @@ var InputMixin = {
6182
6182
  mounted() {
6183
6183
  this.checkAutofocus();
6184
6184
  },
6185
+ inject: ["form", "fieldPath"],
6185
6186
  computed: {
6186
6187
  optionLookup() {
6187
6188
  var self2 = this;
@@ -12835,10 +12836,9 @@ const _sfc_main$p = {
12835
12836
  fileItem.state = "processing";
12836
12837
  var body = new FormData();
12837
12838
  var jsonData = {};
12838
- var allScopeIDs = self2.user ? Object.keys(self2.user.permissions) : [];
12839
- jsonData.meta = {
12840
- scopes: allScopeIDs
12841
- };
12839
+ jsonData.attachment = true;
12840
+ jsonData.form = self2.$sdk.utils.id(self2.form);
12841
+ jsonData.fieldPath = self2.fieldPath;
12842
12842
  body.append("json", JSON.stringify(jsonData));
12843
12843
  body.append("file", fileItem.file, fileItem.name);
12844
12844
  var config = {
@@ -12867,7 +12867,6 @@ const _sfc_main$p = {
12867
12867
  config.headers = {
12868
12868
  "Content-Type": void 0
12869
12869
  };
12870
- console.log("FORM FILE UPLOAD", self2.field);
12871
12870
  let uploadURL = `/file/upload`;
12872
12871
  if (self2.$sdk.fileAPI) {
12873
12872
  uploadURL = `${self2.$sdk.fileAPI}${uploadURL}`;
@@ -13036,7 +13035,7 @@ function _sfc_render$p(_ctx, _cache, $props, $setup, $data, $options) {
13036
13035
  }, 8, ["onFiles"]))
13037
13036
  ], 64);
13038
13037
  }
13039
- var Upload = /* @__PURE__ */ _export_sfc(_sfc_main$p, [["render", _sfc_render$p], ["__scopeId", "data-v-dbc07a4e"]]);
13038
+ var Upload = /* @__PURE__ */ _export_sfc(_sfc_main$p, [["render", _sfc_render$p], ["__scopeId", "data-v-397fdaa7"]]);
13040
13039
  var group_vue_vue_type_style_index_0_scoped_true_lang$1 = "";
13041
13040
  const _sfc_main$o = {
13042
13041
  mixins: [InputMixin],
@@ -13048,6 +13047,12 @@ const _sfc_main$o = {
13048
13047
  },
13049
13048
  modelValue: {
13050
13049
  type: [Object, Array]
13050
+ },
13051
+ trail: {
13052
+ type: Array,
13053
+ default() {
13054
+ return [];
13055
+ }
13051
13056
  }
13052
13057
  },
13053
13058
  data() {
@@ -13219,6 +13224,7 @@ function _sfc_render$o(_ctx, _cache, $props, $setup, $data, $options) {
13219
13224
  }, {
13220
13225
  default: withCtx(() => [
13221
13226
  createVNode(_component_ux_form, {
13227
+ trail: $props.trail,
13222
13228
  ref: "form",
13223
13229
  submission: $props.submission,
13224
13230
  "onForm:state": $options.stateChange,
@@ -13227,7 +13233,7 @@ function _sfc_render$o(_ctx, _cache, $props, $setup, $data, $options) {
13227
13233
  "onUpdate:modelValue": ($event) => _ctx.model[index2] = $event,
13228
13234
  flex: $options.sameLine,
13229
13235
  fields: _ctx.field.fields
13230
- }, null, 8, ["submission", "onForm:state", "parentModel", "modelValue", "onUpdate:modelValue", "flex", "fields"])
13236
+ }, null, 8, ["trail", "submission", "onForm:state", "parentModel", "modelValue", "onUpdate:modelValue", "flex", "fields"])
13231
13237
  ]),
13232
13238
  _: 2
13233
13239
  }, 1536), [
@@ -13322,6 +13328,7 @@ function _sfc_render$o(_ctx, _cache, $props, $setup, $data, $options) {
13322
13328
  createVNode(_component_ux_form, {
13323
13329
  ref_for: true,
13324
13330
  ref: "form",
13331
+ trail: $props.trail,
13325
13332
  submission: $props.submission,
13326
13333
  "onForm:state": $options.stateChange,
13327
13334
  parentModel: _ctx.parentModel,
@@ -13329,7 +13336,7 @@ function _sfc_render$o(_ctx, _cache, $props, $setup, $data, $options) {
13329
13336
  "onUpdate:modelValue": ($event) => _ctx.model[index2] = $event,
13330
13337
  flex: $options.sameLine,
13331
13338
  fields: _ctx.field.fields
13332
- }, null, 8, ["submission", "onForm:state", "parentModel", "modelValue", "onUpdate:modelValue", "flex", "fields"])
13339
+ }, null, 8, ["trail", "submission", "onForm:state", "parentModel", "modelValue", "onUpdate:modelValue", "flex", "fields"])
13333
13340
  ]),
13334
13341
  _: 2
13335
13342
  }, 1536), [
@@ -13400,6 +13407,7 @@ function _sfc_render$o(_ctx, _cache, $props, $setup, $data, $options) {
13400
13407
  default: withCtx(() => [
13401
13408
  createVNode(_component_ux_form, {
13402
13409
  ref: "form",
13410
+ trail: $props.trail,
13403
13411
  submission: $props.submission,
13404
13412
  "onForm:state": $options.stateChange,
13405
13413
  parentModel: _ctx.parentModel,
@@ -13407,7 +13415,7 @@ function _sfc_render$o(_ctx, _cache, $props, $setup, $data, $options) {
13407
13415
  "onUpdate:modelValue": _cache[7] || (_cache[7] = ($event) => _ctx.model = $event),
13408
13416
  flex: $options.sameLine,
13409
13417
  fields: _ctx.field.fields
13410
- }, null, 8, ["submission", "onForm:state", "parentModel", "modelValue", "flex", "fields"])
13418
+ }, null, 8, ["trail", "submission", "onForm:state", "parentModel", "modelValue", "flex", "fields"])
13411
13419
  ]),
13412
13420
  _: 1
13413
13421
  })
@@ -13416,6 +13424,7 @@ function _sfc_render$o(_ctx, _cache, $props, $setup, $data, $options) {
13416
13424
  })) : (openBlock(), createBlock(_component_ux_form, {
13417
13425
  key: 1,
13418
13426
  ref: "form",
13427
+ trail: $props.trail,
13419
13428
  submission: $props.submission,
13420
13429
  "onForm:state": $options.stateChange,
13421
13430
  parentModel: _ctx.parentModel,
@@ -13423,7 +13432,7 @@ function _sfc_render$o(_ctx, _cache, $props, $setup, $data, $options) {
13423
13432
  "onUpdate:modelValue": _cache[8] || (_cache[8] = ($event) => _ctx.model = $event),
13424
13433
  flex: $options.sameLine,
13425
13434
  fields: _ctx.field.fields
13426
- }, null, 8, ["submission", "onForm:state", "parentModel", "modelValue", "flex", "fields"]))
13435
+ }, null, 8, ["trail", "submission", "onForm:state", "parentModel", "modelValue", "flex", "fields"]))
13427
13436
  ], 64)) : (openBlock(), createBlock(_component_ux_button, {
13428
13437
  key: 1,
13429
13438
  onClick: _cache[9] || (_cache[9] = ($event) => $options.createSingleObject())
@@ -13440,6 +13449,7 @@ function _sfc_render$o(_ctx, _cache, $props, $setup, $data, $options) {
13440
13449
  ], 64)) : (openBlock(), createBlock(_component_ux_form, {
13441
13450
  key: 1,
13442
13451
  ref: "form",
13452
+ trail: $props.trail,
13443
13453
  submission: $props.submission,
13444
13454
  "onForm:state": $options.stateChange,
13445
13455
  parentModel: _ctx.parentModel,
@@ -13447,10 +13457,10 @@ function _sfc_render$o(_ctx, _cache, $props, $setup, $data, $options) {
13447
13457
  "onUpdate:modelValue": _cache[10] || (_cache[10] = ($event) => _ctx.model = $event),
13448
13458
  flex: $options.sameLine,
13449
13459
  fields: _ctx.field.fields
13450
- }, null, 8, ["submission", "onForm:state", "parentModel", "modelValue", "flex", "fields"]))
13460
+ }, null, 8, ["trail", "submission", "onForm:state", "parentModel", "modelValue", "flex", "fields"]))
13451
13461
  ], 64));
13452
13462
  }
13453
- var FieldGroup$1 = /* @__PURE__ */ _export_sfc(_sfc_main$o, [["render", _sfc_render$o], ["__scopeId", "data-v-53c1ace8"]]);
13463
+ var FieldGroup$1 = /* @__PURE__ */ _export_sfc(_sfc_main$o, [["render", _sfc_render$o], ["__scopeId", "data-v-71c41d3a"]]);
13454
13464
  const _sfc_main$n = {
13455
13465
  props: {
13456
13466
  option: {
@@ -15661,6 +15671,12 @@ const _sfc_main$d = {
15661
15671
  RichTextField
15662
15672
  },
15663
15673
  props: {
15674
+ trail: {
15675
+ type: Array,
15676
+ default() {
15677
+ return [];
15678
+ }
15679
+ },
15664
15680
  submission: {
15665
15681
  type: Boolean,
15666
15682
  default: false
@@ -15692,6 +15708,11 @@ const _sfc_main$d = {
15692
15708
  };
15693
15709
  },
15694
15710
  inject: ["parentFormElement"],
15711
+ provide() {
15712
+ return {
15713
+ fieldPath: this.fieldPath
15714
+ };
15715
+ },
15695
15716
  created() {
15696
15717
  this.checkDirtyState();
15697
15718
  },
@@ -15854,6 +15875,14 @@ const _sfc_main$d = {
15854
15875
  }
15855
15876
  },
15856
15877
  computed: {
15878
+ fieldPath() {
15879
+ return this.currentTrail.join(".");
15880
+ },
15881
+ currentTrail() {
15882
+ var trail = this.trail.slice();
15883
+ trail.push(this.field.key);
15884
+ return trail;
15885
+ },
15857
15886
  title() {
15858
15887
  return this.field.title;
15859
15888
  },
@@ -16153,6 +16182,7 @@ function _sfc_render$d(_ctx, _cache, $props, $setup, $data, $options) {
16153
16182
  $options.widget == "group" ? (openBlock(), createElementBlock(Fragment, { key: 8 }, [
16154
16183
  $options.asObject ? (openBlock(), createBlock(_component_field_group, {
16155
16184
  key: 0,
16185
+ trail: $options.currentTrail,
16156
16186
  submission: $props.submission,
16157
16187
  "onForm:state": $options.groupStateAltered,
16158
16188
  ref: "group",
@@ -16161,8 +16191,9 @@ function _sfc_render$d(_ctx, _cache, $props, $setup, $data, $options) {
16161
16191
  parentModel: $props.parentModel,
16162
16192
  modelValue: $options.fieldModel,
16163
16193
  "onUpdate:modelValue": _cache[7] || (_cache[7] = ($event) => $options.fieldModel = $event)
16164
- }, null, 8, ["submission", "onForm:state", "onTouched", "field", "parentModel", "modelValue"])) : (openBlock(), createBlock(_component_field_group, {
16194
+ }, null, 8, ["trail", "submission", "onForm:state", "onTouched", "field", "parentModel", "modelValue"])) : (openBlock(), createBlock(_component_field_group, {
16165
16195
  key: 1,
16196
+ trail: $props.trail,
16166
16197
  submission: $props.submission,
16167
16198
  "onForm:state": $options.groupStateAltered,
16168
16199
  ref: "group",
@@ -16171,10 +16202,11 @@ function _sfc_render$d(_ctx, _cache, $props, $setup, $data, $options) {
16171
16202
  parentModel: $props.parentModel,
16172
16203
  modelValue: $options.sourceModel,
16173
16204
  "onUpdate:modelValue": _cache[8] || (_cache[8] = ($event) => $options.sourceModel = $event)
16174
- }, null, 8, ["submission", "onForm:state", "onTouched", "field", "parentModel", "modelValue"]))
16205
+ }, null, 8, ["trail", "submission", "onForm:state", "onTouched", "field", "parentModel", "modelValue"]))
16175
16206
  ], 64)) : createCommentVNode("", true),
16176
16207
  $options.widget == "form" ? (openBlock(), createBlock(_component_field_group, {
16177
16208
  key: 9,
16209
+ trail: $options.currentTrail,
16178
16210
  submission: $props.submission,
16179
16211
  "onForm:state": $options.groupStateAltered,
16180
16212
  ref: "group",
@@ -16183,7 +16215,7 @@ function _sfc_render$d(_ctx, _cache, $props, $setup, $data, $options) {
16183
16215
  parentModel: $props.parentModel,
16184
16216
  modelValue: $options.fieldModel,
16185
16217
  "onUpdate:modelValue": _cache[9] || (_cache[9] = ($event) => $options.fieldModel = $event)
16186
- }, null, 8, ["submission", "onForm:state", "onTouched", "field", "parentModel", "modelValue"])) : createCommentVNode("", true),
16218
+ }, null, 8, ["trail", "submission", "onForm:state", "onTouched", "field", "parentModel", "modelValue"])) : createCommentVNode("", true),
16187
16219
  $options.widget == "select" ? (openBlock(), createBlock(_component_native_select, {
16188
16220
  key: 10,
16189
16221
  onTouched: $options.touch,
@@ -16293,13 +16325,22 @@ function _sfc_render$d(_ctx, _cache, $props, $setup, $data, $options) {
16293
16325
  $options.error && $data.validateResults.message ? (openBlock(), createElementBlock("div", _hoisted_1$a, toDisplayString($data.validateResults.message), 1)) : createCommentVNode("", true)
16294
16326
  ], 34)) : createCommentVNode("", true);
16295
16327
  }
16296
- var UXFormField = /* @__PURE__ */ _export_sfc(_sfc_main$d, [["render", _sfc_render$d], ["__scopeId", "data-v-6c49b812"]]);
16328
+ var UXFormField = /* @__PURE__ */ _export_sfc(_sfc_main$d, [["render", _sfc_render$d], ["__scopeId", "data-v-77633d3c"]]);
16297
16329
  var form_vue_vue_type_style_index_0_scoped_true_lang = "";
16298
16330
  const _sfc_main$c = {
16299
16331
  props: {
16300
16332
  parentModel: {
16301
16333
  type: Object
16302
16334
  },
16335
+ parentForm: {
16336
+ type: Object
16337
+ },
16338
+ trail: {
16339
+ type: Array,
16340
+ default() {
16341
+ return [];
16342
+ }
16343
+ },
16303
16344
  fields: {
16304
16345
  type: Array,
16305
16346
  default() {
@@ -16321,6 +16362,7 @@ const _sfc_main$c = {
16321
16362
  default: false
16322
16363
  }
16323
16364
  },
16365
+ inject: ["form", "parentFormElement"],
16324
16366
  watch: {
16325
16367
  modelValue(val, old) {
16326
16368
  this.model = val;
@@ -16344,7 +16386,6 @@ const _sfc_main$c = {
16344
16386
  parentFormElement
16345
16387
  };
16346
16388
  },
16347
- inject: ["parentFormElement"],
16348
16389
  mounted() {
16349
16390
  const self2 = this;
16350
16391
  self2.mounted = true;
@@ -16461,6 +16502,9 @@ const _sfc_main$c = {
16461
16502
  UxField: UXFormField
16462
16503
  },
16463
16504
  computed: {
16505
+ currentTrail() {
16506
+ return this.trail;
16507
+ },
16464
16508
  fieldHash() {
16465
16509
  return this.renderFields.reduce(function(set, field) {
16466
16510
  if (!field) {
@@ -16514,6 +16558,7 @@ function _sfc_render$c(_ctx, _cache, $props, $setup, $data, $options) {
16514
16558
  return openBlock(), createBlock(_component_ux_field, {
16515
16559
  ref_for: true,
16516
16560
  ref: "field",
16561
+ trail: $options.currentTrail,
16517
16562
  submission: $props.submission,
16518
16563
  "onField:mount": $options.fieldMounted,
16519
16564
  "onField:unmount": $options.fieldUnmounted,
@@ -16530,12 +16575,12 @@ function _sfc_render$c(_ctx, _cache, $props, $setup, $data, $options) {
16530
16575
  parentModel: $props.parentModel || $options.formModel,
16531
16576
  class: normalizeClass($options.fieldClass),
16532
16577
  key: `ux-form-field-${field.key}-${index2}`
16533
- }, null, 8, ["submission", "onField:mount", "onField:unmount", "onField:dirty", "onField:invalid", "onField:valid", "onField:error", "onField:focus", "onField:blur", "onField:touched", "field", "modelValue", "parentModel", "class"]);
16578
+ }, null, 8, ["trail", "submission", "onField:mount", "onField:unmount", "onField:dirty", "onField:invalid", "onField:valid", "onField:error", "onField:focus", "onField:blur", "onField:touched", "field", "modelValue", "parentModel", "class"]);
16534
16579
  }), 128))
16535
16580
  ], true)
16536
16581
  ], 2);
16537
16582
  }
16538
- var UXForm = /* @__PURE__ */ _export_sfc(_sfc_main$c, [["render", _sfc_render$c], ["__scopeId", "data-v-6296f844"]]);
16583
+ var UXForm = /* @__PURE__ */ _export_sfc(_sfc_main$c, [["render", _sfc_render$c], ["__scopeId", "data-v-f463bb0c"]]);
16539
16584
  var submissionform_vue_vue_type_style_index_0_scoped_true_lang = "";
16540
16585
  const STATE_READY = "form.ready";
16541
16586
  const STATE_PROCESSING = "form.processing";
@@ -16567,6 +16612,7 @@ const _sfc_main$b = {
16567
16612
  this.state = STATE_READY;
16568
16613
  this.error = null;
16569
16614
  this.submitAttempted = false;
16615
+ self.$emit("reset");
16570
16616
  },
16571
16617
  async submit() {
16572
16618
  const self2 = this;
@@ -16580,18 +16626,21 @@ const _sfc_main$b = {
16580
16626
  return;
16581
16627
  }
16582
16628
  self2.state = STATE_PROCESSING;
16629
+ self2.$emit("processing");
16583
16630
  await self2.preSubmit();
16584
16631
  const submission = JSON.parse(JSON.stringify(self2.model));
16585
16632
  self2.$sdk.api.post(`/form/${self2.formID}`, submission).then(submissionComplete, submissionFailed);
16586
16633
  async function submissionComplete(res) {
16587
16634
  await self2.postSubmit();
16588
16635
  self2.state = STATE_COMPLETE;
16636
+ self2.$emit("success", res.data);
16589
16637
  }
16590
16638
  async function submissionFailed(err) {
16591
16639
  var _a;
16592
16640
  err = ((_a = err.response) == null ? void 0 : _a.data) || err;
16593
16641
  self2.error = err;
16594
16642
  self2.state = STATE_ERROR;
16643
+ self2.$emit("error", err);
16595
16644
  }
16596
16645
  },
16597
16646
  async preSubmit() {
@@ -16602,6 +16651,11 @@ const _sfc_main$b = {
16602
16651
  components: {
16603
16652
  UxForm: UXForm
16604
16653
  },
16654
+ provide() {
16655
+ return {
16656
+ form: this.form
16657
+ };
16658
+ },
16605
16659
  props: {
16606
16660
  modelValue: {
16607
16661
  type: Object,
@@ -16617,6 +16671,9 @@ const _sfc_main$b = {
16617
16671
  watch: {
16618
16672
  modelValue(val, old) {
16619
16673
  this.model = val;
16674
+ },
16675
+ model(m) {
16676
+ this.$emit("update:modelValue", m);
16620
16677
  }
16621
16678
  },
16622
16679
  data() {
@@ -16654,7 +16711,7 @@ const _sfc_main$b = {
16654
16711
  }
16655
16712
  }
16656
16713
  };
16657
- const _withScopeId$1 = (n2) => (pushScopeId("data-v-7ac54a6a"), n2 = n2(), popScopeId(), n2);
16714
+ const _withScopeId$1 = (n2) => (pushScopeId("data-v-0eb82701"), n2 = n2(), popScopeId(), n2);
16658
16715
  const _hoisted_1$9 = { class: "ux-submission-form" };
16659
16716
  const _hoisted_2$7 = /* @__PURE__ */ _withScopeId$1(() => /* @__PURE__ */ createElementVNode("h3", null, "An error occurred", -1));
16660
16717
  const _hoisted_3$5 = { key: 0 };
@@ -16727,7 +16784,7 @@ function _sfc_render$b(_ctx, _cache, $props, $setup, $data, $options) {
16727
16784
  ], 64))
16728
16785
  ]);
16729
16786
  }
16730
- var UXSubmissionForm = /* @__PURE__ */ _export_sfc(_sfc_main$b, [["render", _sfc_render$b], ["__scopeId", "data-v-7ac54a6a"]]);
16787
+ var UXSubmissionForm = /* @__PURE__ */ _export_sfc(_sfc_main$b, [["render", _sfc_render$b], ["__scopeId", "data-v-0eb82701"]]);
16731
16788
  var search_vue_vue_type_style_index_0_scoped_true_lang = "";
16732
16789
  const _sfc_main$a = {
16733
16790
  props: {