@bagelink/vue 1.2.107 → 1.2.109

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/index.mjs CHANGED
@@ -27925,7 +27925,8 @@ const _sfc_main$w = /* @__PURE__ */ defineComponent({
27925
27925
  flushQueue,
27926
27926
  fileToUrl,
27927
27927
  addFile,
27928
- browse
27928
+ browse,
27929
+ pk
27929
27930
  } = useFileUpload({
27930
27931
  disabled: props2.disabled,
27931
27932
  dirPath: props2.dirPath,
@@ -27947,9 +27948,21 @@ const _sfc_main$w = /* @__PURE__ */ defineComponent({
27947
27948
  emit2("addFileStart");
27948
27949
  addFile((_a = e.dataTransfer) == null ? void 0 : _a.files);
27949
27950
  await flushQueue();
27950
- emit2("update:modelValue", pathKeys.value);
27951
27951
  isDragOver.value = false;
27952
27952
  }
27953
+ watchDebounced(() => toValue(pk), (value) => {
27954
+ if (props2.multiple) emit2("update:modelValue", value);
27955
+ else emit2("update:modelValue", value[0] || void 0);
27956
+ }, { deep: true, immediate: true });
27957
+ watchDebounced(() => props2.modelValue, (newVal, oldVal) => {
27958
+ if (`${newVal}` === `${oldVal}`) return;
27959
+ if (newVal === void 0) return;
27960
+ if (Array.isArray(newVal)) {
27961
+ pk.value = newVal;
27962
+ } else {
27963
+ pk.value = [newVal];
27964
+ }
27965
+ }, { immediate: true, debounce: 500 });
27953
27966
  return (_ctx, _cache) => {
27954
27967
  const _directive_tooltip = resolveDirective("tooltip");
27955
27968
  const _directive_lightbox = resolveDirective("lightbox");
@@ -28185,7 +28198,7 @@ const _sfc_main$w = /* @__PURE__ */ defineComponent({
28185
28198
  };
28186
28199
  }
28187
28200
  });
28188
- const UploadInput = /* @__PURE__ */ _export_sfc(_sfc_main$w, [["__scopeId", "data-v-34a82c5f"]]);
28201
+ const UploadInput = /* @__PURE__ */ _export_sfc(_sfc_main$w, [["__scopeId", "data-v-2ba685b5"]]);
28189
28202
  const FONT_AWESOME_ICONS = [
28190
28203
  "trash-can",
28191
28204
  "message",
@@ -32832,50 +32845,49 @@ const _sfc_main$t = /* @__PURE__ */ defineComponent({
32832
32845
  }
32833
32846
  });
32834
32847
  const Image$1 = /* @__PURE__ */ _export_sfc(_sfc_main$t, [["__scopeId", "data-v-2f5e271c"]]);
32835
- const _hoisted_1$m = { class: "upload-data-container" };
32836
- const _hoisted_2$d = ["textContent"];
32837
- const _hoisted_3$a = {
32848
+ const _hoisted_1$m = ["textContent"];
32849
+ const _hoisted_2$d = {
32838
32850
  key: 1,
32839
32851
  class: "loading-container"
32840
32852
  };
32841
- const _hoisted_4$6 = {
32853
+ const _hoisted_3$a = {
32842
32854
  key: 2,
32843
32855
  class: "config-section"
32844
32856
  };
32845
- const _hoisted_5$6 = { class: "file-info mb-1" };
32846
- const _hoisted_6$5 = { class: "file-chip" };
32847
- const _hoisted_7$4 = { class: "header-config" };
32848
- const _hoisted_8$3 = { class: "mapping-table" };
32849
- const _hoisted_9$2 = { class: "tbl" };
32850
- const _hoisted_10$2 = { class: "field-label" };
32851
- const _hoisted_11$2 = { key: 0 };
32852
- const _hoisted_12$2 = { key: 2 };
32853
- const _hoisted_13$1 = { key: 3 };
32854
- const _hoisted_14$1 = {
32857
+ const _hoisted_4$6 = { class: "file-info mb-1" };
32858
+ const _hoisted_5$6 = { class: "file-chip" };
32859
+ const _hoisted_6$5 = { class: "header-config" };
32860
+ const _hoisted_7$4 = { class: "mapping-table" };
32861
+ const _hoisted_8$3 = { class: "tbl" };
32862
+ const _hoisted_9$2 = { class: "field-label" };
32863
+ const _hoisted_10$2 = { key: 0 };
32864
+ const _hoisted_11$2 = { key: 2 };
32865
+ const _hoisted_12$2 = { key: 3 };
32866
+ const _hoisted_13$1 = {
32855
32867
  key: 0,
32856
32868
  class: "field-disabled-reason"
32857
32869
  };
32858
- const _hoisted_15 = { key: 1 };
32859
- const _hoisted_16 = { class: "default-value-container" };
32860
- const _hoisted_17 = { class: "action-buttons-cell" };
32861
- const _hoisted_18 = {
32870
+ const _hoisted_14$1 = { key: 1 };
32871
+ const _hoisted_15 = { class: "default-value-container" };
32872
+ const _hoisted_16 = { class: "action-buttons-cell" };
32873
+ const _hoisted_17 = {
32862
32874
  key: 0,
32863
32875
  class: "action-buttons"
32864
32876
  };
32865
- const _hoisted_19 = {
32877
+ const _hoisted_18 = {
32866
32878
  key: 1,
32867
32879
  class: "action-buttons"
32868
32880
  };
32881
+ const _hoisted_19 = { key: 0 };
32869
32882
  const _hoisted_20 = { key: 0 };
32870
32883
  const _hoisted_21 = { key: 0 };
32871
- const _hoisted_22 = { key: 0 };
32872
- const _hoisted_23 = { key: 1 };
32873
- const _hoisted_24 = { class: "mb-1" };
32874
- const _hoisted_25 = { key: 0 };
32875
- const _hoisted_26 = { class: "flex gap-1" };
32876
- const _hoisted_27 = { class: "default-value-container" };
32877
- const _hoisted_28 = { class: "action-buttons-cell" };
32878
- const _hoisted_29 = { key: 0 };
32884
+ const _hoisted_22 = { key: 1 };
32885
+ const _hoisted_23 = { class: "mb-1" };
32886
+ const _hoisted_24 = { key: 0 };
32887
+ const _hoisted_25 = { class: "flex gap-1" };
32888
+ const _hoisted_26 = { class: "default-value-container" };
32889
+ const _hoisted_27 = { class: "action-buttons-cell" };
32890
+ const _hoisted_28 = { key: 0 };
32879
32891
  const _sfc_main$s = /* @__PURE__ */ defineComponent({
32880
32892
  __name: "ImportData",
32881
32893
  props: {
@@ -33050,7 +33062,6 @@ const _sfc_main$s = /* @__PURE__ */ defineComponent({
33050
33062
  }
33051
33063
  if (field.attrs && field.attrs.options && field.attrs.options.length > 0) {
33052
33064
  field.options = field.attrs.options;
33053
- console.log(`Added options for field ${field.id}:`, field.options);
33054
33065
  }
33055
33066
  allFields.push(field);
33056
33067
  }
@@ -33436,7 +33447,6 @@ const _sfc_main$s = /* @__PURE__ */ defineComponent({
33436
33447
  }
33437
33448
  const { addFile, browse, fileQueue } = useFileUpload();
33438
33449
  async function handleFilesUploaded() {
33439
- console.log("fileQueue", fileQueue.value);
33440
33450
  file.value = fileQueue.value[0].file;
33441
33451
  if (!file.value) return;
33442
33452
  isLoading.value = true;
@@ -33459,15 +33469,12 @@ const _sfc_main$s = /* @__PURE__ */ defineComponent({
33459
33469
  }
33460
33470
  function openTransformDialog(field) {
33461
33471
  try {
33462
- console.log("Opening transform dialog for field:", field.id, field);
33463
33472
  if (!field.options) {
33464
33473
  field.options = [];
33465
33474
  }
33466
33475
  if (field.attrs && field.attrs.options) {
33467
- console.log("Copying options from attrs for field:", field.id);
33468
- field.options = Array.isArray(field.attrs.options) ? field.attrs.options : [];
33476
+ field.options = field.attrs.options;
33469
33477
  }
33470
- console.log("Field options after processing:", field.options);
33471
33478
  selectedTransformField.value = field;
33472
33479
  if (!transformations[field.id]) {
33473
33480
  transformations[field.id] = [];
@@ -33559,25 +33566,6 @@ ${unmatchedValues.length} values could not be automatically matched.`);
33559
33566
  alert("An error occurred while trying to auto-populate transformations. See console for details.");
33560
33567
  }
33561
33568
  }
33562
- function debugFieldOptions() {
33563
- console.log("Checking all fields for options:");
33564
- schemaFields.value.forEach((field) => {
33565
- var _a;
33566
- console.log(`Field ${field.id} (${field.label}):`, {
33567
- directOptions: field.options,
33568
- hasDirectOptions: field.options && field.options.length > 0,
33569
- attrOptions: (_a = field.attrs) == null ? void 0 : _a.options,
33570
- hasAttrOptions: field.attrs && field.attrs.options && field.attrs.options.length > 0,
33571
- visibleButton: field.options && field.options.length > 0 || field.attrs && field.attrs.options && field.attrs.options.length > 0
33572
- });
33573
- });
33574
- }
33575
- watchEffect(() => {
33576
- if (props2.schema && props2.schema.length > 0) {
33577
- console.log("Schema loaded, checking options");
33578
- debugFieldOptions();
33579
- }
33580
- });
33581
33569
  function detectDateFormat(value) {
33582
33570
  const formats = [
33583
33571
  /^\d{4}-\d{2}-\d{2}$/,
@@ -33919,554 +33907,560 @@ ${unmatchedValues.length} values could not be automatically matched.`);
33919
33907
  }
33920
33908
  return (_ctx, _cache) => {
33921
33909
  const _directive_tooltip = resolveDirective("tooltip");
33922
- return openBlock(), createElementBlock("div", _hoisted_1$m, [
33923
- createElementVNode("h2", {
33924
- textContent: toDisplayString(props2.title || "Upload and Map Data")
33925
- }, null, 8, _hoisted_2$d),
33926
- !file.value ? (openBlock(), createBlock(unref(DragOver), {
33927
- key: 0,
33928
- accept: ".csv,.xls,.xlsx",
33929
- onAddFiles: unref(addFile),
33930
- onClick: _cache[0] || (_cache[0] = ($event) => unref(browse)(false))
33931
- }, {
33932
- default: withCtx(() => [
33933
- createVNode(unref(_sfc_main$15), { class: "flex flex-column items-center justify-center outline-dashed outline-3 hover" }, {
33934
- default: withCtx(() => [
33935
- createVNode(unref(_sfc_main$v), {
33936
- name: "upload_file",
33937
- size: "5"
33938
- }),
33939
- _cache[30] || (_cache[30] = createElementVNode("p", null, "Drag and drop an Excel or CSV file here", -1)),
33940
- _cache[31] || (_cache[31] = createElementVNode("p", null, "or click to select a file", -1)),
33941
- _cache[32] || (_cache[32] = createElementVNode("p", { class: "txt-12 color-gray" }, " Accepts .xlsx, .xls, and .csv files ", -1))
33942
- ]),
33943
- _: 1
33944
- })
33945
- ]),
33946
- _: 1
33947
- }, 8, ["onAddFiles"])) : createCommentVNode("", true),
33948
- isLoading.value ? (openBlock(), createElementBlock("div", _hoisted_3$a, _cache[33] || (_cache[33] = [
33949
- createElementVNode("div", { class: "spinner" }, null, -1),
33950
- createElementVNode("p", null, "Processing your file...", -1)
33951
- ]))) : createCommentVNode("", true),
33952
- file.value && !isLoading.value && sheetNames.value.length > 0 ? (openBlock(), createElementBlock("div", _hoisted_4$6, [
33953
- createElementVNode("div", _hoisted_5$6, [
33954
- createElementVNode("div", _hoisted_6$5, toDisplayString(file.value.name), 1),
33955
- createVNode(unref(Btn), {
33956
- thin: "",
33957
- round: "",
33958
- value: "Change File",
33959
- onClick: _cache[1] || (_cache[1] = ($event) => file.value = null)
33960
- })
33961
- ]),
33962
- sheetNames.value.length > 1 ? (openBlock(), createBlock(unref(SelectInput), {
33910
+ return openBlock(), createBlock(unref(_sfc_main$15), { class: "upload-data-container h-100p grid overflow-hidden list-wrap" }, {
33911
+ default: withCtx(() => [
33912
+ createElementVNode("h2", {
33913
+ class: "line-height-1 m-0 pb-2 txt-center",
33914
+ textContent: toDisplayString(props2.title || "Upload and Map Data")
33915
+ }, null, 8, _hoisted_1$m),
33916
+ !file.value ? (openBlock(), createBlock(unref(DragOver), {
33963
33917
  key: 0,
33964
- modelValue: selectedSheet.value,
33965
- "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => selectedSheet.value = $event),
33966
- options: sheetNames.value,
33967
- label: "Select Sheet"
33968
- }, null, 8, ["modelValue", "options"])) : createCommentVNode("", true),
33969
- createElementVNode("div", _hoisted_7$4, [
33970
- _cache[34] || (_cache[34] = createElementVNode("label", null, "File has headers?", -1)),
33971
- createVNode(unref(CheckInput), {
33972
- modelValue: hasHeaders.value,
33973
- "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => hasHeaders.value = $event),
33974
- label: "First row contains column names"
33975
- }, null, 8, ["modelValue"])
33976
- ])
33977
- ])) : createCommentVNode("", true),
33978
- file.value && !isLoading.value && fileHeaders.value.length > 0 ? (openBlock(), createBlock(unref(_sfc_main$15), { key: 3 }, {
33979
- default: withCtx(() => [
33980
- _cache[38] || (_cache[38] = createElementVNode("h3", { class: "mt-0" }, " Map Fields ", -1)),
33981
- _cache[39] || (_cache[39] = createElementVNode("p", { class: "instructions" }, " Match each required field to a column from your file, set default values, or configure transformations ", -1)),
33982
- createElementVNode("div", _hoisted_8$3, [
33983
- createElementVNode("table", _hoisted_9$2, [
33984
- _cache[35] || (_cache[35] = createElementVNode("thead", null, [
33985
- createElementVNode("tr", null, [
33986
- createElementVNode("th", null, "Schema Field"),
33987
- createElementVNode("th", null, "File Column"),
33988
- createElementVNode("th", null, "Default Value"),
33989
- createElementVNode("th", null, "Data Type"),
33990
- createElementVNode("th", null, "Actions")
33918
+ accept: ".csv,.xls,.xlsx",
33919
+ onAddFiles: unref(addFile),
33920
+ onClick: _cache[0] || (_cache[0] = ($event) => unref(browse)(false))
33921
+ }, {
33922
+ default: withCtx(() => [
33923
+ createVNode(unref(_sfc_main$15), { class: "flex flex-column items-center justify-center outline-dashed outline-3 bg-input hover h-100p justify-content-center" }, {
33924
+ default: withCtx(() => [
33925
+ createVNode(unref(_sfc_main$v), {
33926
+ name: "upload",
33927
+ size: "5"
33928
+ }),
33929
+ _cache[30] || (_cache[30] = createElementVNode("p", null, "Drag and drop an Excel or CSV file here", -1)),
33930
+ _cache[31] || (_cache[31] = createElementVNode("p", null, "or click to select a file", -1)),
33931
+ _cache[32] || (_cache[32] = createElementVNode("p", { class: "txt-12 color-gray" }, " Accepts .xlsx, .xls, and .csv files ", -1))
33932
+ ]),
33933
+ _: 1
33934
+ })
33935
+ ]),
33936
+ _: 1
33937
+ }, 8, ["onAddFiles"])) : createCommentVNode("", true),
33938
+ isLoading.value ? (openBlock(), createElementBlock("div", _hoisted_2$d, _cache[33] || (_cache[33] = [
33939
+ createElementVNode("div", { class: "spinner" }, null, -1),
33940
+ createElementVNode("p", null, "Processing your file...", -1)
33941
+ ]))) : createCommentVNode("", true),
33942
+ file.value && !isLoading.value && sheetNames.value.length > 0 ? (openBlock(), createElementBlock("div", _hoisted_3$a, [
33943
+ createElementVNode("div", _hoisted_4$6, [
33944
+ createElementVNode("div", _hoisted_5$6, toDisplayString(file.value.name), 1),
33945
+ createVNode(unref(Btn), {
33946
+ thin: "",
33947
+ round: "",
33948
+ value: "Change File",
33949
+ onClick: _cache[1] || (_cache[1] = ($event) => file.value = null)
33950
+ })
33951
+ ]),
33952
+ sheetNames.value.length > 1 ? (openBlock(), createBlock(unref(SelectInput), {
33953
+ key: 0,
33954
+ modelValue: selectedSheet.value,
33955
+ "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => selectedSheet.value = $event),
33956
+ options: sheetNames.value,
33957
+ label: "Select Sheet"
33958
+ }, null, 8, ["modelValue", "options"])) : createCommentVNode("", true),
33959
+ createElementVNode("div", _hoisted_6$5, [
33960
+ createVNode(unref(CheckInput), {
33961
+ modelValue: hasHeaders.value,
33962
+ "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => hasHeaders.value = $event),
33963
+ label: "Mark this if file has a header row"
33964
+ }, null, 8, ["modelValue"])
33965
+ ])
33966
+ ])) : createCommentVNode("", true),
33967
+ file.value && !isLoading.value && fileHeaders.value.length > 0 ? (openBlock(), createBlock(unref(_sfc_main$15), {
33968
+ key: 3,
33969
+ class: "overflow h-100p"
33970
+ }, {
33971
+ default: withCtx(() => [
33972
+ _cache[37] || (_cache[37] = createElementVNode("h3", { class: "mt-0" }, " Map Fields ", -1)),
33973
+ _cache[38] || (_cache[38] = createElementVNode("p", { class: "instructions" }, " Match each required field to a column from your file, set default values, or configure transformations ", -1)),
33974
+ createElementVNode("div", _hoisted_7$4, [
33975
+ createElementVNode("table", _hoisted_8$3, [
33976
+ _cache[34] || (_cache[34] = createElementVNode("thead", null, [
33977
+ createElementVNode("tr", null, [
33978
+ createElementVNode("th", null, "Schema Field"),
33979
+ createElementVNode("th", null, "File Column"),
33980
+ createElementVNode("th", null, "Default Value"),
33981
+ createElementVNode("th", null, "Data Type"),
33982
+ createElementVNode("th", null, "Actions")
33983
+ ])
33984
+ ], -1)),
33985
+ createElementVNode("tbody", null, [
33986
+ (openBlock(true), createElementBlock(Fragment, null, renderList(schemaFields.value, (field) => {
33987
+ return openBlock(), createElementBlock("tr", {
33988
+ key: field.id,
33989
+ class: normalizeClass({ "array-field-row": field.isArrayField || field.$el === "array" })
33990
+ }, [
33991
+ createElementVNode("td", null, [
33992
+ createElementVNode("div", _hoisted_9$2, [
33993
+ createTextVNode(toDisplayString(field.label) + " ", 1),
33994
+ field.isArrayField ? (openBlock(), createElementBlock("span", _hoisted_10$2, "↳")) : createCommentVNode("", true),
33995
+ field.$el === "array" ? (openBlock(), createBlock(unref(Pill), {
33996
+ key: 1,
33997
+ outline: "",
33998
+ thin: "",
33999
+ value: "Array"
34000
+ })) : createCommentVNode("", true),
34001
+ isFieldRequired(field) ? (openBlock(), createElementBlock("span", _hoisted_11$2, "*")) : createCommentVNode("", true),
34002
+ getFieldDescription(field).isConditional ? (openBlock(), createElementBlock("span", _hoisted_12$2, "†")) : createCommentVNode("", true)
34003
+ ]),
34004
+ field.disabled ? (openBlock(), createElementBlock("div", _hoisted_13$1, toDisplayString(field.disabledReason), 1)) : createCommentVNode("", true),
34005
+ getFieldDescription(field).isConditional ? (openBlock(), createElementBlock("div", _hoisted_14$1, toDisplayString(getFieldDescription(field).description), 1)) : createCommentVNode("", true)
34006
+ ]),
34007
+ createElementVNode("td", null, [
34008
+ createVNode(unref(SelectInput), {
34009
+ modelValue: fieldMapping[field.id],
34010
+ "onUpdate:modelValue": ($event) => fieldMapping[field.id] = $event,
34011
+ options: fileHeaders.value,
34012
+ required: isFieldRequired(field),
34013
+ disabled: field.disabled,
34014
+ onChange: ($event) => handleSelectChange($event, field.id)
34015
+ }, null, 8, ["modelValue", "onUpdate:modelValue", "options", "required", "disabled", "onChange"])
34016
+ ]),
34017
+ createElementVNode("td", null, [
34018
+ createElementVNode("div", _hoisted_15, [
34019
+ createTextVNode(toDisplayString(initDefaultValue(field.id)) + " ", 1),
34020
+ (openBlock(), createBlock(resolveDynamicComponent(unref(renderField)(getFieldWithDefaults(field)))))
34021
+ ])
34022
+ ]),
34023
+ createElementVNode("td", null, [
34024
+ createVNode(unref(SelectInput), {
34025
+ modelValue: fieldDataTypes[field.id],
34026
+ "onUpdate:modelValue": ($event) => fieldDataTypes[field.id] = $event,
34027
+ options: dataTypeOptions,
34028
+ disabled: !fieldMapping[field.id] && !defaultValues[field.id]
34029
+ }, null, 8, ["modelValue", "onUpdate:modelValue", "disabled"])
34030
+ ]),
34031
+ createElementVNode("td", null, [
34032
+ createElementVNode("div", _hoisted_16, [
34033
+ withDirectives(createVNode(unref(Btn), {
34034
+ thin: "",
34035
+ disabled: field.disabled,
34036
+ icon: "transform",
34037
+ onClick: ($event) => openTransformDialog(field)
34038
+ }, null, 8, ["disabled", "onClick"]), [
34039
+ [_directive_tooltip, "Transform"]
34040
+ ]),
34041
+ field.$el === "array" ? withDirectives((openBlock(), createBlock(unref(Btn), {
34042
+ key: 0,
34043
+ thin: "",
34044
+ icon: "attach_file",
34045
+ disabled: field.disabled,
34046
+ onClick: ($event) => openRelatedDialog(field)
34047
+ }, null, 8, ["disabled", "onClick"])), [
34048
+ [_directive_tooltip, "Related File"]
34049
+ ]) : createCommentVNode("", true)
34050
+ ])
34051
+ ])
34052
+ ], 2);
34053
+ }), 128))
33991
34054
  ])
33992
- ], -1)),
33993
- createElementVNode("tbody", null, [
33994
- (openBlock(true), createElementBlock(Fragment, null, renderList(schemaFields.value, (field) => {
33995
- return openBlock(), createElementBlock("tr", {
33996
- key: field.id,
33997
- class: normalizeClass({ "array-field-row": field.isArrayField || field.$el === "array" })
33998
- }, [
33999
- createElementVNode("td", null, [
34000
- createElementVNode("div", _hoisted_10$2, [
34001
- createTextVNode(toDisplayString(field.label) + " ", 1),
34002
- field.isArrayField ? (openBlock(), createElementBlock("span", _hoisted_11$2, "↳")) : createCommentVNode("", true),
34003
- field.$el === "array" ? (openBlock(), createBlock(unref(Pill), {
34004
- key: 1,
34005
- outline: "",
34055
+ ])
34056
+ ]),
34057
+ mappingComplete.value ? (openBlock(), createElementBlock("div", _hoisted_17, [
34058
+ createVNode(unref(Btn), { onClick: showPreview }, {
34059
+ default: withCtx(() => _cache[35] || (_cache[35] = [
34060
+ createTextVNode(" Preview Data ")
34061
+ ])),
34062
+ _: 1
34063
+ })
34064
+ ])) : (openBlock(), createElementBlock("div", _hoisted_18, _cache[36] || (_cache[36] = [
34065
+ createElementVNode("div", { class: "mapping-incomplete-message" }, " Please map the required fields to continue ", -1)
34066
+ ])))
34067
+ ]),
34068
+ _: 1
34069
+ })) : createCommentVNode("", true),
34070
+ createVNode(unref(_sfc_main$f), {
34071
+ visible: showTransformDialog.value,
34072
+ "onUpdate:visible": _cache[11] || (_cache[11] = ($event) => showTransformDialog.value = $event),
34073
+ title: "Configure Transformations",
34074
+ width: "800"
34075
+ }, {
34076
+ default: withCtx(() => [
34077
+ selectedTransformField.value ? (openBlock(), createElementBlock("div", _hoisted_19, [
34078
+ createElementVNode("p", null, [
34079
+ _cache[39] || (_cache[39] = createTextVNode("Create transformations for ")),
34080
+ createElementVNode("strong", null, toDisplayString(selectedTransformField.value.label), 1)
34081
+ ]),
34082
+ createVNode(unref(Btn), {
34083
+ icon: "auto_awesome",
34084
+ thin: "",
34085
+ value: "Autodetect",
34086
+ onClick: _cache[4] || (_cache[4] = ($event) => autoPopulateTransformations(selectedTransformField.value.id))
34087
+ }),
34088
+ createElementVNode("table", null, [
34089
+ _cache[40] || (_cache[40] = createElementVNode("thead", null, [
34090
+ createElementVNode("tr", null, [
34091
+ createElementVNode("th", null, "Source Value"),
34092
+ createElementVNode("th", null, "Target Value"),
34093
+ createElementVNode("th", null, "Action")
34094
+ ])
34095
+ ], -1)),
34096
+ createElementVNode("tbody", null, [
34097
+ (openBlock(true), createElementBlock(Fragment, null, renderList(transformations[selectedTransformField.value.id] || [], (transform, index2) => {
34098
+ return openBlock(), createElementBlock("tr", { key: index2 }, [
34099
+ createElementVNode("td", null, toDisplayString(transform.sourceValue), 1),
34100
+ createElementVNode("td", null, toDisplayString(transform.targetValue), 1),
34101
+ createElementVNode("td", null, [
34102
+ withDirectives(createVNode(unref(Btn), {
34006
34103
  thin: "",
34007
- value: "Array"
34008
- })) : createCommentVNode("", true),
34009
- isFieldRequired(field) ? (openBlock(), createElementBlock("span", _hoisted_12$2, "*")) : createCommentVNode("", true),
34010
- getFieldDescription(field).isConditional ? (openBlock(), createElementBlock("span", _hoisted_13$1, "")) : createCommentVNode("", true)
34011
- ]),
34012
- field.disabled ? (openBlock(), createElementBlock("div", _hoisted_14$1, toDisplayString(field.disabledReason), 1)) : createCommentVNode("", true),
34013
- getFieldDescription(field).isConditional ? (openBlock(), createElementBlock("div", _hoisted_15, toDisplayString(getFieldDescription(field).description), 1)) : createCommentVNode("", true)
34014
- ]),
34015
- createElementVNode("td", null, [
34016
- createVNode(unref(SelectInput), {
34017
- modelValue: fieldMapping[field.id],
34018
- "onUpdate:modelValue": ($event) => fieldMapping[field.id] = $event,
34019
- options: fileHeaders.value,
34020
- required: isFieldRequired(field),
34021
- disabled: field.disabled,
34022
- onChange: ($event) => handleSelectChange($event, field.id)
34023
- }, null, 8, ["modelValue", "onUpdate:modelValue", "options", "required", "disabled", "onChange"])
34024
- ]),
34025
- createElementVNode("td", null, [
34026
- createElementVNode("div", _hoisted_16, [
34027
- createTextVNode(toDisplayString(initDefaultValue(field.id)) + " ", 1),
34028
- (openBlock(), createBlock(resolveDynamicComponent(unref(renderField)(getFieldWithDefaults(field)))))
34104
+ icon: "delete",
34105
+ color: "red",
34106
+ onClick: ($event) => removeTransformation(selectedTransformField.value.id, index2)
34107
+ }, null, 8, ["onClick"]), [
34108
+ [_directive_tooltip, "Remove"]
34109
+ ])
34029
34110
  ])
34030
- ]),
34111
+ ]);
34112
+ }), 128)),
34113
+ createElementVNode("tr", null, [
34031
34114
  createElementVNode("td", null, [
34032
- createVNode(unref(SelectInput), {
34033
- modelValue: fieldDataTypes[field.id],
34034
- "onUpdate:modelValue": ($event) => fieldDataTypes[field.id] = $event,
34035
- options: dataTypeOptions,
34036
- disabled: !fieldMapping[field.id] && !defaultValues[field.id]
34037
- }, null, 8, ["modelValue", "onUpdate:modelValue", "disabled"])
34115
+ fieldMapping[selectedTransformField.value.id] ? (openBlock(), createBlock(unref(SelectInput), {
34116
+ key: 0,
34117
+ modelValue: selectedSourceValue.value,
34118
+ "onUpdate:modelValue": _cache[5] || (_cache[5] = ($event) => selectedSourceValue.value = $event),
34119
+ searchable: "",
34120
+ options: sourceValueOptions.value,
34121
+ placeholder: "Select source value"
34122
+ }, null, 8, ["modelValue", "options"])) : withDirectives((openBlock(), createElementBlock("input", {
34123
+ key: 1,
34124
+ "onUpdate:modelValue": _cache[6] || (_cache[6] = ($event) => selectedSourceValue.value = $event),
34125
+ type: "text",
34126
+ placeholder: "Source value"
34127
+ }, null, 512)), [
34128
+ [vModelText, selectedSourceValue.value]
34129
+ ])
34038
34130
  ]),
34039
34131
  createElementVNode("td", null, [
34040
- createElementVNode("div", _hoisted_17, [
34041
- withDirectives(createVNode(unref(Btn), {
34042
- thin: "",
34043
- disabled: field.disabled,
34044
- icon: "transform",
34045
- onClick: ($event) => openTransformDialog(field)
34046
- }, null, 8, ["disabled", "onClick"]), [
34047
- [_directive_tooltip, "Transform"]
34048
- ]),
34049
- field.$el === "array" ? withDirectives((openBlock(), createBlock(unref(Btn), {
34050
- key: 0,
34051
- thin: "",
34052
- icon: "attach_file",
34053
- disabled: field.disabled,
34054
- onClick: ($event) => openRelatedDialog(field)
34055
- }, null, 8, ["disabled", "onClick"])), [
34056
- [_directive_tooltip, "Related File"]
34057
- ]) : createCommentVNode("", true)
34132
+ selectedTransformField.value.options && selectedTransformField.value.options.length > 0 ? (openBlock(), createBlock(unref(SelectInput), {
34133
+ key: 0,
34134
+ modelValue: selectedTargetValue.value,
34135
+ "onUpdate:modelValue": _cache[7] || (_cache[7] = ($event) => selectedTargetValue.value = $event),
34136
+ searchable: "",
34137
+ options: selectedTransformField.value.options,
34138
+ placeholder: "Select target value"
34139
+ }, null, 8, ["modelValue", "options"])) : withDirectives((openBlock(), createElementBlock("input", {
34140
+ key: 1,
34141
+ "onUpdate:modelValue": _cache[8] || (_cache[8] = ($event) => selectedTargetValue.value = $event),
34142
+ type: "text",
34143
+ placeholder: "Target value"
34144
+ }, null, 512)), [
34145
+ [vModelText, selectedTargetValue.value]
34058
34146
  ])
34059
- ])
34060
- ], 2);
34061
- }), 128))
34062
- ])
34063
- ])
34064
- ]),
34065
- mappingComplete.value ? (openBlock(), createElementBlock("div", _hoisted_18, [
34066
- createVNode(unref(Btn), { onClick: showPreview }, {
34067
- default: withCtx(() => _cache[36] || (_cache[36] = [
34068
- createTextVNode(" Preview Data ")
34069
- ])),
34070
- _: 1
34071
- })
34072
- ])) : (openBlock(), createElementBlock("div", _hoisted_19, _cache[37] || (_cache[37] = [
34073
- createElementVNode("div", { class: "mapping-incomplete-message" }, " Please map the required fields to continue ", -1)
34074
- ])))
34075
- ]),
34076
- _: 1
34077
- })) : createCommentVNode("", true),
34078
- createVNode(unref(_sfc_main$f), {
34079
- visible: showTransformDialog.value,
34080
- "onUpdate:visible": _cache[11] || (_cache[11] = ($event) => showTransformDialog.value = $event),
34081
- title: "Configure Transformations",
34082
- width: "800"
34083
- }, {
34084
- default: withCtx(() => [
34085
- selectedTransformField.value ? (openBlock(), createElementBlock("div", _hoisted_20, [
34086
- createElementVNode("p", null, [
34087
- _cache[40] || (_cache[40] = createTextVNode("Create transformations for ")),
34088
- createElementVNode("strong", null, toDisplayString(selectedTransformField.value.label), 1)
34089
- ]),
34090
- createVNode(unref(Btn), {
34091
- icon: "auto_awesome",
34092
- thin: "",
34093
- value: "Autodetect",
34094
- onClick: _cache[4] || (_cache[4] = ($event) => autoPopulateTransformations(selectedTransformField.value.id))
34095
- }),
34096
- createElementVNode("table", null, [
34097
- _cache[41] || (_cache[41] = createElementVNode("thead", null, [
34098
- createElementVNode("tr", null, [
34099
- createElementVNode("th", null, "Source Value"),
34100
- createElementVNode("th", null, "Target Value"),
34101
- createElementVNode("th", null, "Action")
34102
- ])
34103
- ], -1)),
34104
- createElementVNode("tbody", null, [
34105
- (openBlock(true), createElementBlock(Fragment, null, renderList(transformations[selectedTransformField.value.id] || [], (transform, index2) => {
34106
- return openBlock(), createElementBlock("tr", { key: index2 }, [
34107
- createElementVNode("td", null, toDisplayString(transform.sourceValue), 1),
34108
- createElementVNode("td", null, toDisplayString(transform.targetValue), 1),
34147
+ ]),
34109
34148
  createElementVNode("td", null, [
34110
34149
  withDirectives(createVNode(unref(Btn), {
34111
34150
  thin: "",
34112
- icon: "delete",
34113
- color: "red",
34114
- onClick: ($event) => removeTransformation(selectedTransformField.value.id, index2)
34115
- }, null, 8, ["onClick"]), [
34116
- [_directive_tooltip, "Remove"]
34151
+ icon: "add",
34152
+ color: "primary",
34153
+ onClick: _cache[9] || (_cache[9] = ($event) => addTransformation(selectedTransformField.value.id))
34154
+ }, null, 512), [
34155
+ [_directive_tooltip, "Add"]
34117
34156
  ])
34118
34157
  ])
34119
- ]);
34120
- }), 128)),
34121
- createElementVNode("tr", null, [
34122
- createElementVNode("td", null, [
34123
- fieldMapping[selectedTransformField.value.id] ? (openBlock(), createBlock(unref(SelectInput), {
34124
- key: 0,
34125
- modelValue: selectedSourceValue.value,
34126
- "onUpdate:modelValue": _cache[5] || (_cache[5] = ($event) => selectedSourceValue.value = $event),
34127
- searchable: "",
34128
- options: sourceValueOptions.value,
34129
- placeholder: "Select source value"
34130
- }, null, 8, ["modelValue", "options"])) : withDirectives((openBlock(), createElementBlock("input", {
34131
- key: 1,
34132
- "onUpdate:modelValue": _cache[6] || (_cache[6] = ($event) => selectedSourceValue.value = $event),
34133
- type: "text",
34134
- placeholder: "Source value"
34135
- }, null, 512)), [
34136
- [vModelText, selectedSourceValue.value]
34137
- ])
34138
- ]),
34139
- createElementVNode("td", null, [
34140
- selectedTransformField.value.options && selectedTransformField.value.options.length > 0 ? (openBlock(), createBlock(unref(SelectInput), {
34141
- key: 0,
34142
- modelValue: selectedTargetValue.value,
34143
- "onUpdate:modelValue": _cache[7] || (_cache[7] = ($event) => selectedTargetValue.value = $event),
34144
- searchable: "",
34145
- options: selectedTransformField.value.options,
34146
- placeholder: "Select target value"
34147
- }, null, 8, ["modelValue", "options"])) : withDirectives((openBlock(), createElementBlock("input", {
34148
- key: 1,
34149
- "onUpdate:modelValue": _cache[8] || (_cache[8] = ($event) => selectedTargetValue.value = $event),
34150
- type: "text",
34151
- placeholder: "Target value"
34152
- }, null, 512)), [
34153
- [vModelText, selectedTargetValue.value]
34154
- ])
34155
- ]),
34156
- createElementVNode("td", null, [
34157
- withDirectives(createVNode(unref(Btn), {
34158
- thin: "",
34159
- icon: "add",
34160
- color: "primary",
34161
- onClick: _cache[9] || (_cache[9] = ($event) => addTransformation(selectedTransformField.value.id))
34162
- }, null, 512), [
34163
- [_directive_tooltip, "Add"]
34164
- ])
34165
34158
  ])
34166
34159
  ])
34167
- ])
34168
- ]),
34169
- createVNode(unref(Btn), {
34170
- thin: "",
34171
- value: "Close",
34172
- onClick: _cache[10] || (_cache[10] = ($event) => showTransformDialog.value = false)
34173
- })
34174
- ])) : createCommentVNode("", true)
34175
- ]),
34176
- _: 1
34177
- }, 8, ["visible"]),
34178
- createVNode(unref(_sfc_main$f), {
34179
- visible: showRelatedDialog.value,
34180
- "onUpdate:visible": _cache[17] || (_cache[17] = ($event) => showRelatedDialog.value = $event),
34181
- title: "Configure Related Data",
34182
- width: "900"
34183
- }, {
34184
- default: withCtx(() => {
34185
- var _a;
34186
- return [
34187
- selectedRelationField.value ? (openBlock(), createElementBlock("div", _hoisted_21, [
34188
- createElementVNode("p", null, "Upload a file with related data for " + toDisplayString(selectedRelationField.value.label), 1),
34189
- !relatedFiles[selectedRelationField.value.id] ? (openBlock(), createElementBlock("div", _hoisted_22, [
34190
- createVNode(unref(DragOver), {
34191
- accept: ".csv,.xls,.xlsx",
34192
- onAddFiles: _cache[12] || (_cache[12] = (files2) => {
34193
- if (files2[0]) processRelatedFile(selectedRelationField.value.id, files2[0]);
34160
+ ]),
34161
+ createVNode(unref(Btn), {
34162
+ thin: "",
34163
+ value: "Close",
34164
+ onClick: _cache[10] || (_cache[10] = ($event) => showTransformDialog.value = false)
34165
+ })
34166
+ ])) : createCommentVNode("", true)
34167
+ ]),
34168
+ _: 1
34169
+ }, 8, ["visible"]),
34170
+ createVNode(unref(_sfc_main$f), {
34171
+ visible: showRelatedDialog.value,
34172
+ "onUpdate:visible": _cache[17] || (_cache[17] = ($event) => showRelatedDialog.value = $event),
34173
+ title: "Configure Related Data",
34174
+ width: "900"
34175
+ }, {
34176
+ default: withCtx(() => {
34177
+ var _a;
34178
+ return [
34179
+ selectedRelationField.value ? (openBlock(), createElementBlock("div", _hoisted_20, [
34180
+ createElementVNode("p", null, "Upload a file with related data for " + toDisplayString(selectedRelationField.value.label), 1),
34181
+ !relatedFiles[selectedRelationField.value.id] ? (openBlock(), createElementBlock("div", _hoisted_21, [
34182
+ createVNode(unref(DragOver), {
34183
+ accept: ".csv,.xls,.xlsx",
34184
+ onAddFiles: _cache[12] || (_cache[12] = (files2) => {
34185
+ if (files2[0]) processRelatedFile(selectedRelationField.value.id, files2[0]);
34186
+ })
34187
+ }, {
34188
+ default: withCtx(() => [
34189
+ createVNode(unref(_sfc_main$15), { class: "flex flex-column items-center justify-center outline-dashed outline-3 hover bg-input" }, {
34190
+ default: withCtx(() => [
34191
+ createVNode(unref(_sfc_main$v), {
34192
+ name: "upload",
34193
+ size: "5"
34194
+ }),
34195
+ _cache[41] || (_cache[41] = createElementVNode("p", null, "Drag and drop an Excel or CSV file here", -1)),
34196
+ _cache[42] || (_cache[42] = createElementVNode("p", null, "or click to select a file", -1)),
34197
+ _cache[43] || (_cache[43] = createElementVNode("p", { class: "txt-12 color-gray" }, " Accepts .xlsx, .xls, and .csv files ", -1))
34198
+ ]),
34199
+ _: 1
34200
+ })
34201
+ ]),
34202
+ _: 1
34194
34203
  })
34195
- }, {
34196
- default: withCtx(() => [
34197
- createVNode(unref(_sfc_main$15), { class: "flex flex-column items-center justify-center outline-dashed outline-3 hover" }, {
34204
+ ])) : (openBlock(), createElementBlock("div", _hoisted_22, [
34205
+ createElementVNode("div", _hoisted_23, [
34206
+ createVNode(unref(Pill), null, {
34198
34207
  default: withCtx(() => [
34199
- createVNode(unref(_sfc_main$v), {
34200
- name: "upload_file",
34201
- size: "5"
34202
- }),
34203
- _cache[42] || (_cache[42] = createElementVNode("p", null, "Drag and drop an Excel or CSV file here", -1)),
34204
- _cache[43] || (_cache[43] = createElementVNode("p", null, "or click to select a file", -1)),
34205
- _cache[44] || (_cache[44] = createElementVNode("p", { class: "txt-12 color-gray" }, " Accepts .xlsx, .xls, and .csv files ", -1))
34208
+ createTextVNode(toDisplayString(relatedFiles[selectedRelationField.value.id].name), 1)
34206
34209
  ]),
34207
34210
  _: 1
34211
+ }),
34212
+ createVNode(unref(Btn), {
34213
+ thin: "",
34214
+ round: "",
34215
+ value: "Change File",
34216
+ onClick: _cache[13] || (_cache[13] = ($event) => relatedFiles[selectedRelationField.value.id] = null)
34208
34217
  })
34209
34218
  ]),
34210
- _: 1
34211
- })
34212
- ])) : (openBlock(), createElementBlock("div", _hoisted_23, [
34213
- createElementVNode("div", _hoisted_24, [
34214
- createVNode(unref(Pill), null, {
34215
- default: withCtx(() => [
34216
- createTextVNode(toDisplayString(relatedFiles[selectedRelationField.value.id].name), 1)
34219
+ relatedFileData[selectedRelationField.value.id] ? (openBlock(), createElementBlock("div", _hoisted_24, [
34220
+ _cache[46] || (_cache[46] = createElementVNode("h4", null, "Configure Relationship", -1)),
34221
+ createElementVNode("div", _hoisted_25, [
34222
+ createVNode(unref(SelectInput), {
34223
+ modelValue: parentKeyField[selectedRelationField.value.id],
34224
+ "onUpdate:modelValue": _cache[14] || (_cache[14] = ($event) => parentKeyField[selectedRelationField.value.id] = $event),
34225
+ options: fileHeaders.value,
34226
+ label: "Source Key Field (from this file)"
34227
+ }, null, 8, ["modelValue", "options"]),
34228
+ createVNode(unref(SelectInput), {
34229
+ modelValue: relatedKeyField[selectedRelationField.value.id],
34230
+ "onUpdate:modelValue": _cache[15] || (_cache[15] = ($event) => relatedKeyField[selectedRelationField.value.id] = $event),
34231
+ options: Object.keys(relatedFileData[selectedRelationField.value.id][0] || {}),
34232
+ label: "Related Key Field (from related file)"
34233
+ }, null, 8, ["modelValue", "options"])
34217
34234
  ]),
34218
- _: 1
34219
- }),
34220
- createVNode(unref(Btn), {
34221
- thin: "",
34222
- round: "",
34223
- value: "Change File",
34224
- onClick: _cache[13] || (_cache[13] = ($event) => relatedFiles[selectedRelationField.value.id] = null)
34225
- })
34235
+ _cache[47] || (_cache[47] = createElementVNode("h4", null, "Map Related Fields", -1)),
34236
+ createElementVNode("table", null, [
34237
+ _cache[45] || (_cache[45] = createElementVNode("thead", null, [
34238
+ createElementVNode("tr", null, [
34239
+ createElementVNode("th", null, "Child Field"),
34240
+ createElementVNode("th", null, "Related File Column"),
34241
+ createElementVNode("th", null, "Default Value"),
34242
+ createElementVNode("th", null, "Data Type"),
34243
+ createElementVNode("th", null, "Actions")
34244
+ ])
34245
+ ], -1)),
34246
+ createElementVNode("tbody", null, [
34247
+ (openBlock(true), createElementBlock(Fragment, null, renderList(((_a = selectedRelationField.value.attrs) == null ? void 0 : _a.schema) || [], (schemaItem) => {
34248
+ var _a2, _b;
34249
+ return openBlock(), createElementBlock("tr", {
34250
+ key: schemaItem.id
34251
+ }, [
34252
+ createElementVNode("td", null, toDisplayString(schemaItem.label), 1),
34253
+ createElementVNode("td", null, [
34254
+ createVNode(unref(SelectInput), {
34255
+ modelValue: relatedFileMappings[selectedRelationField.value.id][schemaItem.id],
34256
+ "onUpdate:modelValue": ($event) => relatedFileMappings[selectedRelationField.value.id][schemaItem.id] = $event,
34257
+ options: Object.keys(relatedFileData[selectedRelationField.value.id][0] || {}),
34258
+ placeholder: "Select column..."
34259
+ }, null, 8, ["modelValue", "onUpdate:modelValue", "options"])
34260
+ ]),
34261
+ createElementVNode("td", null, [
34262
+ createElementVNode("div", _hoisted_26, [
34263
+ createTextVNode(toDisplayString(initRelatedDefaultValue(selectedRelationField.value.id, schemaItem.id)) + " ", 1),
34264
+ (openBlock(), createBlock(resolveDynamicComponent(unref(renderField)(getRelatedFieldWithDefaults(selectedRelationField.value.id, schemaItem)))))
34265
+ ])
34266
+ ]),
34267
+ createElementVNode("td", null, [
34268
+ createVNode(unref(SelectInput), {
34269
+ modelValue: relatedFieldDataTypes[`${selectedRelationField.value.id}.${schemaItem.id}`],
34270
+ "onUpdate:modelValue": ($event) => relatedFieldDataTypes[`${selectedRelationField.value.id}.${schemaItem.id}`] = $event,
34271
+ options: dataTypeOptions,
34272
+ disabled: !((_a2 = relatedFileMappings[selectedRelationField.value.id]) == null ? void 0 : _a2[schemaItem.id]) && !((_b = relatedDefaultValues[selectedRelationField.value.id]) == null ? void 0 : _b[schemaItem.id])
34273
+ }, null, 8, ["modelValue", "onUpdate:modelValue", "disabled"])
34274
+ ]),
34275
+ createElementVNode("td", null, [
34276
+ createElementVNode("div", _hoisted_27, [
34277
+ createVNode(unref(Btn), {
34278
+ thin: "",
34279
+ icon: "transform",
34280
+ onClick: ($event) => openRelatedTransformDialog(selectedRelationField.value.id, schemaItem)
34281
+ }, {
34282
+ default: withCtx(() => _cache[44] || (_cache[44] = [
34283
+ createTextVNode(" Transform ")
34284
+ ])),
34285
+ _: 2
34286
+ }, 1032, ["onClick"])
34287
+ ])
34288
+ ])
34289
+ ]);
34290
+ }), 128))
34291
+ ])
34292
+ ])
34293
+ ])) : createCommentVNode("", true)
34294
+ ])),
34295
+ createVNode(unref(Btn), {
34296
+ value: "Close",
34297
+ onClick: _cache[16] || (_cache[16] = ($event) => showRelatedDialog.value = false)
34298
+ })
34299
+ ])) : createCommentVNode("", true)
34300
+ ];
34301
+ }),
34302
+ _: 1
34303
+ }, 8, ["visible"]),
34304
+ createVNode(unref(_sfc_main$f), {
34305
+ visible: showPreviewModal.value,
34306
+ "onUpdate:visible": _cache[21] || (_cache[21] = ($event) => showPreviewModal.value = $event),
34307
+ title: "Data Preview & Edit",
34308
+ width: "1200"
34309
+ }, {
34310
+ default: withCtx(() => [
34311
+ createElementVNode("div", null, [
34312
+ createVNode(unref(Spreadsheet), {
34313
+ modelValue: previewData.value,
34314
+ "onUpdate:modelValue": _cache[18] || (_cache[18] = ($event) => previewData.value = $event),
34315
+ "column-config": spreadsheetColumns.value,
34316
+ "allow-add-row": ""
34317
+ }, null, 8, ["modelValue", "column-config"])
34318
+ ]),
34319
+ createElementVNode("div", null, [
34320
+ createElementVNode("div", null, " Showing all " + toDisplayString(previewData.value.length) + " records. You can edit values directly. ", 1),
34321
+ createElementVNode("div", null, [
34322
+ createVNode(unref(Btn), {
34323
+ value: "Cancel",
34324
+ onClick: _cache[19] || (_cache[19] = ($event) => showPreviewModal.value = false)
34325
+ }),
34326
+ createVNode(unref(Btn), {
34327
+ value: "Import Data",
34328
+ onClick: _cache[20] || (_cache[20] = ($event) => processData())
34329
+ })
34330
+ ])
34331
+ ])
34332
+ ]),
34333
+ _: 1
34334
+ }, 8, ["visible"]),
34335
+ createVNode(unref(_sfc_main$f), {
34336
+ visible: showRelatedTransformDialog.value,
34337
+ "onUpdate:visible": _cache[29] || (_cache[29] = ($event) => showRelatedTransformDialog.value = $event),
34338
+ title: "Configure Related Transformations",
34339
+ width: "800"
34340
+ }, {
34341
+ default: withCtx(() => {
34342
+ var _a, _b, _c;
34343
+ return [
34344
+ selectedRelatedTransformField.value ? (openBlock(), createElementBlock("div", _hoisted_28, [
34345
+ createElementVNode("p", null, [
34346
+ _cache[48] || (_cache[48] = createTextVNode("Create transformations for ")),
34347
+ createElementVNode("strong", null, toDisplayString(selectedRelatedTransformField.value.field.label), 1),
34348
+ createTextVNode(" in " + toDisplayString((_a = selectedRelationField.value) == null ? void 0 : _a.label), 1)
34226
34349
  ]),
34227
- relatedFileData[selectedRelationField.value.id] ? (openBlock(), createElementBlock("div", _hoisted_25, [
34228
- _cache[47] || (_cache[47] = createElementVNode("h4", null, "Configure Relationship", -1)),
34229
- createElementVNode("div", _hoisted_26, [
34230
- createVNode(unref(SelectInput), {
34231
- modelValue: parentKeyField[selectedRelationField.value.id],
34232
- "onUpdate:modelValue": _cache[14] || (_cache[14] = ($event) => parentKeyField[selectedRelationField.value.id] = $event),
34233
- options: fileHeaders.value,
34234
- label: "Source Key Field (from this file)"
34235
- }, null, 8, ["modelValue", "options"]),
34236
- createVNode(unref(SelectInput), {
34237
- modelValue: relatedKeyField[selectedRelationField.value.id],
34238
- "onUpdate:modelValue": _cache[15] || (_cache[15] = ($event) => relatedKeyField[selectedRelationField.value.id] = $event),
34239
- options: Object.keys(relatedFileData[selectedRelationField.value.id][0] || {}),
34240
- label: "Related Key Field (from related file)"
34241
- }, null, 8, ["modelValue", "options"])
34242
- ]),
34243
- _cache[48] || (_cache[48] = createElementVNode("h4", null, "Map Related Fields", -1)),
34350
+ createElementVNode("div", null, [
34351
+ createElementVNode("div", null, [
34352
+ createVNode(unref(Btn), {
34353
+ thin: "",
34354
+ icon: "auto_awesome",
34355
+ value: "Autolink",
34356
+ color: "primary",
34357
+ onClick: _cache[22] || (_cache[22] = ($event) => autoPopulateRelatedTransformations(
34358
+ selectedRelatedTransformField.value.parentId,
34359
+ selectedRelatedTransformField.value.field.id
34360
+ ))
34361
+ })
34362
+ ])
34363
+ ]),
34364
+ createElementVNode("div", null, [
34244
34365
  createElementVNode("table", null, [
34245
- _cache[46] || (_cache[46] = createElementVNode("thead", null, [
34366
+ _cache[49] || (_cache[49] = createElementVNode("thead", null, [
34246
34367
  createElementVNode("tr", null, [
34247
- createElementVNode("th", null, "Child Field"),
34248
- createElementVNode("th", null, "Related File Column"),
34249
- createElementVNode("th", null, "Default Value"),
34250
- createElementVNode("th", null, "Data Type"),
34251
- createElementVNode("th", null, "Actions")
34368
+ createElementVNode("th", null, "Source Value"),
34369
+ createElementVNode("th", null, "Target Value"),
34370
+ createElementVNode("th", null, "Action")
34252
34371
  ])
34253
34372
  ], -1)),
34254
34373
  createElementVNode("tbody", null, [
34255
- (openBlock(true), createElementBlock(Fragment, null, renderList(((_a = selectedRelationField.value.attrs) == null ? void 0 : _a.schema) || [], (schemaItem) => {
34256
- var _a2, _b;
34257
- return openBlock(), createElementBlock("tr", {
34258
- key: schemaItem.id
34259
- }, [
34260
- createElementVNode("td", null, toDisplayString(schemaItem.label), 1),
34261
- createElementVNode("td", null, [
34262
- createVNode(unref(SelectInput), {
34263
- modelValue: relatedFileMappings[selectedRelationField.value.id][schemaItem.id],
34264
- "onUpdate:modelValue": ($event) => relatedFileMappings[selectedRelationField.value.id][schemaItem.id] = $event,
34265
- options: Object.keys(relatedFileData[selectedRelationField.value.id][0] || {}),
34266
- placeholder: "Select column..."
34267
- }, null, 8, ["modelValue", "onUpdate:modelValue", "options"])
34268
- ]),
34269
- createElementVNode("td", null, [
34270
- createElementVNode("div", _hoisted_27, [
34271
- createTextVNode(toDisplayString(initRelatedDefaultValue(selectedRelationField.value.id, schemaItem.id)) + " ", 1),
34272
- (openBlock(), createBlock(resolveDynamicComponent(unref(renderField)(getRelatedFieldWithDefaults(selectedRelationField.value.id, schemaItem)))))
34273
- ])
34274
- ]),
34374
+ (openBlock(true), createElementBlock(Fragment, null, renderList(((_b = relatedTransformations[selectedRelatedTransformField.value.parentId]) == null ? void 0 : _b[selectedRelatedTransformField.value.field.id]) || [], (transform, index2) => {
34375
+ return openBlock(), createElementBlock("tr", { key: index2 }, [
34376
+ createElementVNode("td", null, toDisplayString(transform.sourceValue), 1),
34377
+ createElementVNode("td", null, toDisplayString(transform.targetValue), 1),
34275
34378
  createElementVNode("td", null, [
34276
- createVNode(unref(SelectInput), {
34277
- modelValue: relatedFieldDataTypes[`${selectedRelationField.value.id}.${schemaItem.id}`],
34278
- "onUpdate:modelValue": ($event) => relatedFieldDataTypes[`${selectedRelationField.value.id}.${schemaItem.id}`] = $event,
34279
- options: dataTypeOptions,
34280
- disabled: !((_a2 = relatedFileMappings[selectedRelationField.value.id]) == null ? void 0 : _a2[schemaItem.id]) && !((_b = relatedDefaultValues[selectedRelationField.value.id]) == null ? void 0 : _b[schemaItem.id])
34281
- }, null, 8, ["modelValue", "onUpdate:modelValue", "disabled"])
34282
- ]),
34283
- createElementVNode("td", null, [
34284
- createElementVNode("div", _hoisted_28, [
34285
- createVNode(unref(Btn), {
34286
- thin: "",
34287
- icon: "transform",
34288
- onClick: ($event) => openRelatedTransformDialog(selectedRelationField.value.id, schemaItem)
34289
- }, {
34290
- default: withCtx(() => _cache[45] || (_cache[45] = [
34291
- createTextVNode(" Transform ")
34292
- ])),
34293
- _: 2
34294
- }, 1032, ["onClick"])
34379
+ withDirectives(createVNode(unref(Btn), {
34380
+ thin: "",
34381
+ icon: "delete",
34382
+ color: "red",
34383
+ onClick: ($event) => removeRelatedTransformation(
34384
+ selectedRelatedTransformField.value.parentId,
34385
+ selectedRelatedTransformField.value.field.id,
34386
+ index2
34387
+ )
34388
+ }, null, 8, ["onClick"]), [
34389
+ [_directive_tooltip, "Remove"]
34295
34390
  ])
34296
34391
  ])
34297
34392
  ]);
34298
- }), 128))
34299
- ])
34300
- ])
34301
- ])) : createCommentVNode("", true)
34302
- ])),
34303
- createVNode(unref(Btn), {
34304
- value: "Close",
34305
- onClick: _cache[16] || (_cache[16] = ($event) => showRelatedDialog.value = false)
34306
- })
34307
- ])) : createCommentVNode("", true)
34308
- ];
34309
- }),
34310
- _: 1
34311
- }, 8, ["visible"]),
34312
- createVNode(unref(_sfc_main$f), {
34313
- visible: showPreviewModal.value,
34314
- "onUpdate:visible": _cache[21] || (_cache[21] = ($event) => showPreviewModal.value = $event),
34315
- title: "Data Preview & Edit",
34316
- width: "1200"
34317
- }, {
34318
- default: withCtx(() => [
34319
- createElementVNode("div", null, [
34320
- createVNode(unref(Spreadsheet), {
34321
- modelValue: previewData.value,
34322
- "onUpdate:modelValue": _cache[18] || (_cache[18] = ($event) => previewData.value = $event),
34323
- "column-config": spreadsheetColumns.value,
34324
- "allow-add-row": ""
34325
- }, null, 8, ["modelValue", "column-config"])
34326
- ]),
34327
- createElementVNode("div", null, [
34328
- createElementVNode("div", null, " Showing all " + toDisplayString(previewData.value.length) + " records. You can edit values directly. ", 1),
34329
- createElementVNode("div", null, [
34330
- createVNode(unref(Btn), {
34331
- value: "Cancel",
34332
- onClick: _cache[19] || (_cache[19] = ($event) => showPreviewModal.value = false)
34333
- }),
34334
- createVNode(unref(Btn), {
34335
- value: "Import Data",
34336
- onClick: _cache[20] || (_cache[20] = ($event) => processData())
34337
- })
34338
- ])
34339
- ])
34340
- ]),
34341
- _: 1
34342
- }, 8, ["visible"]),
34343
- createVNode(unref(_sfc_main$f), {
34344
- visible: showRelatedTransformDialog.value,
34345
- "onUpdate:visible": _cache[29] || (_cache[29] = ($event) => showRelatedTransformDialog.value = $event),
34346
- title: "Configure Related Transformations",
34347
- width: "800"
34348
- }, {
34349
- default: withCtx(() => {
34350
- var _a, _b, _c;
34351
- return [
34352
- selectedRelatedTransformField.value ? (openBlock(), createElementBlock("div", _hoisted_29, [
34353
- createElementVNode("p", null, [
34354
- _cache[49] || (_cache[49] = createTextVNode("Create transformations for ")),
34355
- createElementVNode("strong", null, toDisplayString(selectedRelatedTransformField.value.field.label), 1),
34356
- createTextVNode(" in " + toDisplayString((_a = selectedRelationField.value) == null ? void 0 : _a.label), 1)
34357
- ]),
34358
- createElementVNode("div", null, [
34359
- createElementVNode("div", null, [
34360
- createVNode(unref(Btn), {
34361
- thin: "",
34362
- icon: "auto_awesome",
34363
- value: "Autolink",
34364
- color: "primary",
34365
- onClick: _cache[22] || (_cache[22] = ($event) => autoPopulateRelatedTransformations(
34366
- selectedRelatedTransformField.value.parentId,
34367
- selectedRelatedTransformField.value.field.id
34368
- ))
34369
- })
34370
- ])
34371
- ]),
34372
- createElementVNode("div", null, [
34373
- createElementVNode("table", null, [
34374
- _cache[50] || (_cache[50] = createElementVNode("thead", null, [
34375
- createElementVNode("tr", null, [
34376
- createElementVNode("th", null, "Source Value"),
34377
- createElementVNode("th", null, "Target Value"),
34378
- createElementVNode("th", null, "Action")
34379
- ])
34380
- ], -1)),
34381
- createElementVNode("tbody", null, [
34382
- (openBlock(true), createElementBlock(Fragment, null, renderList(((_b = relatedTransformations[selectedRelatedTransformField.value.parentId]) == null ? void 0 : _b[selectedRelatedTransformField.value.field.id]) || [], (transform, index2) => {
34383
- return openBlock(), createElementBlock("tr", { key: index2 }, [
34384
- createElementVNode("td", null, toDisplayString(transform.sourceValue), 1),
34385
- createElementVNode("td", null, toDisplayString(transform.targetValue), 1),
34393
+ }), 128)),
34394
+ createElementVNode("tr", null, [
34395
+ createElementVNode("td", null, [
34396
+ ((_c = relatedFileMappings[selectedRelatedTransformField.value.parentId]) == null ? void 0 : _c[selectedRelatedTransformField.value.field.id]) ? (openBlock(), createBlock(unref(SelectInput), {
34397
+ key: 0,
34398
+ modelValue: selectedRelatedSourceValue.value,
34399
+ "onUpdate:modelValue": _cache[23] || (_cache[23] = ($event) => selectedRelatedSourceValue.value = $event),
34400
+ searchable: "",
34401
+ options: relatedSourceValueOptions.value,
34402
+ placeholder: "Select source value"
34403
+ }, null, 8, ["modelValue", "options"])) : withDirectives((openBlock(), createElementBlock("input", {
34404
+ key: 1,
34405
+ "onUpdate:modelValue": _cache[24] || (_cache[24] = ($event) => selectedRelatedSourceValue.value = $event),
34406
+ type: "text",
34407
+ placeholder: "Source value"
34408
+ }, null, 512)), [
34409
+ [vModelText, selectedRelatedSourceValue.value]
34410
+ ])
34411
+ ]),
34412
+ createElementVNode("td", null, [
34413
+ selectedRelatedTransformField.value.field.options && selectedRelatedTransformField.value.field.options.length > 0 ? (openBlock(), createBlock(unref(SelectInput), {
34414
+ key: 0,
34415
+ modelValue: selectedRelatedTargetValue.value,
34416
+ "onUpdate:modelValue": _cache[25] || (_cache[25] = ($event) => selectedRelatedTargetValue.value = $event),
34417
+ searchable: "",
34418
+ options: selectedRelatedTransformField.value.field.options,
34419
+ placeholder: "Select target value"
34420
+ }, null, 8, ["modelValue", "options"])) : withDirectives((openBlock(), createElementBlock("input", {
34421
+ key: 1,
34422
+ "onUpdate:modelValue": _cache[26] || (_cache[26] = ($event) => selectedRelatedTargetValue.value = $event),
34423
+ type: "text",
34424
+ placeholder: "Target value"
34425
+ }, null, 512)), [
34426
+ [vModelText, selectedRelatedTargetValue.value]
34427
+ ])
34428
+ ]),
34386
34429
  createElementVNode("td", null, [
34387
34430
  withDirectives(createVNode(unref(Btn), {
34388
34431
  thin: "",
34389
- icon: "delete",
34390
- color: "red",
34391
- onClick: ($event) => removeRelatedTransformation(
34432
+ icon: "add",
34433
+ color: "primary",
34434
+ onClick: _cache[27] || (_cache[27] = ($event) => addRelatedTransformation(
34392
34435
  selectedRelatedTransformField.value.parentId,
34393
- selectedRelatedTransformField.value.field.id,
34394
- index2
34395
- )
34396
- }, null, 8, ["onClick"]), [
34397
- [_directive_tooltip, "Remove"]
34436
+ selectedRelatedTransformField.value.field.id
34437
+ ))
34438
+ }, null, 512), [
34439
+ [_directive_tooltip, "Add"]
34398
34440
  ])
34399
34441
  ])
34400
- ]);
34401
- }), 128)),
34402
- createElementVNode("tr", null, [
34403
- createElementVNode("td", null, [
34404
- ((_c = relatedFileMappings[selectedRelatedTransformField.value.parentId]) == null ? void 0 : _c[selectedRelatedTransformField.value.field.id]) ? (openBlock(), createBlock(unref(SelectInput), {
34405
- key: 0,
34406
- modelValue: selectedRelatedSourceValue.value,
34407
- "onUpdate:modelValue": _cache[23] || (_cache[23] = ($event) => selectedRelatedSourceValue.value = $event),
34408
- searchable: "",
34409
- options: relatedSourceValueOptions.value,
34410
- placeholder: "Select source value"
34411
- }, null, 8, ["modelValue", "options"])) : withDirectives((openBlock(), createElementBlock("input", {
34412
- key: 1,
34413
- "onUpdate:modelValue": _cache[24] || (_cache[24] = ($event) => selectedRelatedSourceValue.value = $event),
34414
- type: "text",
34415
- placeholder: "Source value"
34416
- }, null, 512)), [
34417
- [vModelText, selectedRelatedSourceValue.value]
34418
- ])
34419
- ]),
34420
- createElementVNode("td", null, [
34421
- selectedRelatedTransformField.value.field.options && selectedRelatedTransformField.value.field.options.length > 0 ? (openBlock(), createBlock(unref(SelectInput), {
34422
- key: 0,
34423
- modelValue: selectedRelatedTargetValue.value,
34424
- "onUpdate:modelValue": _cache[25] || (_cache[25] = ($event) => selectedRelatedTargetValue.value = $event),
34425
- searchable: "",
34426
- options: selectedRelatedTransformField.value.field.options,
34427
- placeholder: "Select target value"
34428
- }, null, 8, ["modelValue", "options"])) : withDirectives((openBlock(), createElementBlock("input", {
34429
- key: 1,
34430
- "onUpdate:modelValue": _cache[26] || (_cache[26] = ($event) => selectedRelatedTargetValue.value = $event),
34431
- type: "text",
34432
- placeholder: "Target value"
34433
- }, null, 512)), [
34434
- [vModelText, selectedRelatedTargetValue.value]
34435
- ])
34436
- ]),
34437
- createElementVNode("td", null, [
34438
- withDirectives(createVNode(unref(Btn), {
34439
- thin: "",
34440
- icon: "add",
34441
- color: "primary",
34442
- onClick: _cache[27] || (_cache[27] = ($event) => addRelatedTransformation(
34443
- selectedRelatedTransformField.value.parentId,
34444
- selectedRelatedTransformField.value.field.id
34445
- ))
34446
- }, null, 512), [
34447
- [_directive_tooltip, "Add"]
34448
- ])
34449
34442
  ])
34450
34443
  ])
34451
34444
  ])
34445
+ ]),
34446
+ createElementVNode("div", null, [
34447
+ createVNode(unref(Btn), {
34448
+ onClick: _cache[28] || (_cache[28] = ($event) => showRelatedTransformDialog.value = false)
34449
+ }, {
34450
+ default: withCtx(() => _cache[50] || (_cache[50] = [
34451
+ createTextVNode(" Close ")
34452
+ ])),
34453
+ _: 1
34454
+ })
34452
34455
  ])
34453
- ]),
34454
- createElementVNode("div", null, [
34455
- createVNode(unref(Btn), {
34456
- onClick: _cache[28] || (_cache[28] = ($event) => showRelatedTransformDialog.value = false)
34457
- }, {
34458
- default: withCtx(() => _cache[51] || (_cache[51] = [
34459
- createTextVNode(" Close ")
34460
- ])),
34461
- _: 1
34462
- })
34463
- ])
34464
- ])) : createCommentVNode("", true)
34465
- ];
34466
- }),
34467
- _: 1
34468
- }, 8, ["visible"])
34469
- ]);
34456
+ ])) : createCommentVNode("", true)
34457
+ ];
34458
+ }),
34459
+ _: 1
34460
+ }, 8, ["visible"])
34461
+ ]),
34462
+ _: 1
34463
+ });
34470
34464
  };
34471
34465
  }
34472
34466
  });