@bagelink/vue 1.4.14 → 1.4.18
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/components/ImportData.vue.d.ts +2 -1
- package/dist/components/ImportData.vue.d.ts.map +1 -1
- package/dist/components/Slider.vue.d.ts +6 -0
- package/dist/components/Slider.vue.d.ts.map +1 -1
- package/dist/index.cjs +436 -164
- package/dist/index.mjs +437 -165
- package/dist/style.css +11 -5
- package/dist/utils/useSearch.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/components/ImportData.vue +20 -247
- package/src/components/Slider.vue +508 -85
- package/src/components/lightbox/Lightbox.vue +1 -1
- package/src/styles/text.css +8 -0
- package/src/utils/useSearch.ts +22 -3
package/dist/index.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
var __defProp = Object.defineProperty;
|
|
2
2
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
3
3
|
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
4
|
-
import { defineComponent, reactive, provide, createElementBlock, openBlock, renderSlot, ref, computed, inject, watch, normalizeClass, createElementVNode, createVNode, unref, createCommentVNode, toDisplayString, Transition, withCtx, Fragment, renderList, createBlock, isRef, useSlots, resolveDirective, withDirectives, resolveDynamicComponent, mergeProps, withKeys, withModifiers, createTextVNode, normalizeStyle, getCurrentScope, onScopeDispose, toValue, nextTick, onMounted, getCurrentInstance, shallowRef, onUnmounted, resolveComponent, isVNode, h as h$2, mergeModels, useCssVars, useModel, vModelCheckbox, createApp, pushScopeId, popScopeId, withScopeId, normalizeProps, guardReactiveProps, createSlots, vModelText, Comment, Text, vModelRadio, TransitionGroup, vModelDynamic, onBeforeUnmount, watchEffect, toRef } from "vue";
|
|
4
|
+
import { defineComponent, reactive, provide, createElementBlock, openBlock, renderSlot, ref, computed, inject, watch, normalizeClass, createElementVNode, createVNode, unref, createCommentVNode, toDisplayString, Transition, withCtx, Fragment, renderList, createBlock, isRef, useSlots, resolveDirective, withDirectives, resolveDynamicComponent, mergeProps, withKeys, withModifiers, createTextVNode, normalizeStyle, getCurrentScope, onScopeDispose, toValue, nextTick, onMounted, getCurrentInstance, shallowRef, onUnmounted, resolveComponent, isVNode, h as h$2, mergeModels, useCssVars, useModel, vModelCheckbox, createApp, pushScopeId, popScopeId, withScopeId, normalizeProps, guardReactiveProps, createSlots, vModelText, Comment, Text, vModelRadio, TransitionGroup, vModelDynamic, onBeforeUnmount, watchEffect, toRef, onUpdated } from "vue";
|
|
5
5
|
import { RouterLink } from "vue-router";
|
|
6
6
|
const _sfc_main$1i = /* @__PURE__ */ defineComponent({
|
|
7
7
|
__name: "Accordion",
|
|
@@ -32511,53 +32511,54 @@ const _hoisted_5$6 = {
|
|
|
32511
32511
|
key: 0,
|
|
32512
32512
|
class: "config-section flex gap-05 pb-2 m_flex-wrap"
|
|
32513
32513
|
};
|
|
32514
|
-
const _hoisted_6$5 =
|
|
32515
|
-
const _hoisted_7$4 = {
|
|
32516
|
-
const _hoisted_8$3 = { class: "
|
|
32517
|
-
const _hoisted_9$3 = { class: "
|
|
32518
|
-
const _hoisted_10$2 = {
|
|
32519
|
-
const _hoisted_11$2 = { key:
|
|
32520
|
-
const _hoisted_12$2 = { key:
|
|
32521
|
-
const _hoisted_13$1 = {
|
|
32514
|
+
const _hoisted_6$5 = ["textContent"];
|
|
32515
|
+
const _hoisted_7$4 = { key: 1 };
|
|
32516
|
+
const _hoisted_8$3 = { class: "mapping-table" };
|
|
32517
|
+
const _hoisted_9$3 = { class: "field-label" };
|
|
32518
|
+
const _hoisted_10$2 = { class: "grid-span-2 input-size line-height-1 inline-block" };
|
|
32519
|
+
const _hoisted_11$2 = { key: 0 };
|
|
32520
|
+
const _hoisted_12$2 = { key: 2 };
|
|
32521
|
+
const _hoisted_13$1 = { key: 3 };
|
|
32522
|
+
const _hoisted_14$1 = {
|
|
32522
32523
|
key: 0,
|
|
32523
32524
|
class: "field-disabled-reason"
|
|
32524
32525
|
};
|
|
32525
|
-
const
|
|
32526
|
-
const
|
|
32527
|
-
const
|
|
32528
|
-
const
|
|
32529
|
-
const
|
|
32526
|
+
const _hoisted_15 = { key: 1 };
|
|
32527
|
+
const _hoisted_16 = { class: "fileColSelect" };
|
|
32528
|
+
const _hoisted_17 = { class: "default-value-container hideLabel" };
|
|
32529
|
+
const _hoisted_18 = { class: "flex gap-05 my-05" };
|
|
32530
|
+
const _hoisted_19 = {
|
|
32530
32531
|
key: 0,
|
|
32531
32532
|
class: "action-buttons"
|
|
32532
32533
|
};
|
|
32533
|
-
const
|
|
32534
|
+
const _hoisted_20 = {
|
|
32534
32535
|
key: 1,
|
|
32535
32536
|
class: "action-buttons"
|
|
32536
32537
|
};
|
|
32537
|
-
const
|
|
32538
|
-
const
|
|
32539
|
-
const
|
|
32540
|
-
const
|
|
32541
|
-
const
|
|
32542
|
-
const
|
|
32543
|
-
const
|
|
32544
|
-
const
|
|
32545
|
-
const
|
|
32546
|
-
const
|
|
32547
|
-
const
|
|
32538
|
+
const _hoisted_21 = { key: 0 };
|
|
32539
|
+
const _hoisted_22 = { class: "flex space-between gap-1 mb-1 border-bottom pb-05 m_flex-wrap" };
|
|
32540
|
+
const _hoisted_23 = { class: "grid-span-2 input-size line-height-1" };
|
|
32541
|
+
const _hoisted_24 = { class: "grid-span-4 input-size line-height-1 ellipsis-1" };
|
|
32542
|
+
const _hoisted_25 = { class: "grid grid-wrap-7 gap-1 align-items-center m_gap-025 m_pb-1-5" };
|
|
32543
|
+
const _hoisted_26 = { class: "grid-span-2" };
|
|
32544
|
+
const _hoisted_27 = { class: "grid-span-4" };
|
|
32545
|
+
const _hoisted_28 = { class: "flex pt-05" };
|
|
32546
|
+
const _hoisted_29 = { key: 0 };
|
|
32547
|
+
const _hoisted_30 = { class: "pb-05" };
|
|
32548
|
+
const _hoisted_31 = {
|
|
32548
32549
|
key: 0,
|
|
32549
32550
|
class: "mb-05"
|
|
32550
32551
|
};
|
|
32551
|
-
const
|
|
32552
|
-
const
|
|
32553
|
-
const
|
|
32554
|
-
const
|
|
32555
|
-
const
|
|
32556
|
-
const
|
|
32557
|
-
const
|
|
32558
|
-
const
|
|
32559
|
-
const
|
|
32560
|
-
const
|
|
32552
|
+
const _hoisted_32 = { key: 1 };
|
|
32553
|
+
const _hoisted_33 = { class: "mb-1" };
|
|
32554
|
+
const _hoisted_34 = { key: 0 };
|
|
32555
|
+
const _hoisted_35 = { class: "flex gap-1" };
|
|
32556
|
+
const _hoisted_36 = { class: "default-value-container" };
|
|
32557
|
+
const _hoisted_37 = { class: "action-buttons-cell" };
|
|
32558
|
+
const _hoisted_38 = { class: "flex pt-05" };
|
|
32559
|
+
const _hoisted_39 = { class: "mt-1" };
|
|
32560
|
+
const _hoisted_40 = { class: "flex gap-1 mt-1 space-between" };
|
|
32561
|
+
const _hoisted_41 = { key: 0 };
|
|
32561
32562
|
const _sfc_main$s = /* @__PURE__ */ defineComponent({
|
|
32562
32563
|
__name: "ImportData",
|
|
32563
32564
|
props: {
|
|
@@ -32594,33 +32595,33 @@ const _sfc_main$s = /* @__PURE__ */ defineComponent({
|
|
|
32594
32595
|
const sheetNames = ref([]);
|
|
32595
32596
|
const selectedSheet = ref("");
|
|
32596
32597
|
const hasHeaders = ref(true);
|
|
32597
|
-
const fieldMapping = reactive({});
|
|
32598
32598
|
const isLoading = ref(false);
|
|
32599
32599
|
const showPreviewModal = ref(false);
|
|
32600
32600
|
const previewData = ref([]);
|
|
32601
32601
|
const mappingComplete = ref(false);
|
|
32602
32602
|
const fileHeaders = ref([]);
|
|
32603
|
-
const defaultValues = reactive({});
|
|
32604
|
-
const transformations = reactive({});
|
|
32605
32603
|
const showTransformDialog = ref(false);
|
|
32606
32604
|
const selectedTransformField = ref(null);
|
|
32605
|
+
const showRelatedDialog = ref(false);
|
|
32606
|
+
const selectedRelationField = ref(null);
|
|
32607
|
+
const selectedSourceValue = ref("");
|
|
32608
|
+
const selectedTargetValue = ref("");
|
|
32609
|
+
const showRelatedTransformDialog = ref(false);
|
|
32610
|
+
const selectedRelatedTransformField = ref(null);
|
|
32611
|
+
const selectedRelatedSourceValue = ref("");
|
|
32612
|
+
const selectedRelatedTargetValue = ref("");
|
|
32613
|
+
const fieldMapping = reactive({});
|
|
32614
|
+
const defaultValues = reactive({});
|
|
32615
|
+
const transformations = reactive({});
|
|
32607
32616
|
const fieldDataTypes = reactive({});
|
|
32608
32617
|
const relatedFiles = reactive({});
|
|
32609
32618
|
const relatedFileData = reactive({});
|
|
32610
32619
|
const relatedFileMappings = reactive({});
|
|
32611
|
-
const showRelatedDialog = ref(false);
|
|
32612
|
-
const selectedRelationField = ref(null);
|
|
32613
32620
|
const relatedKeyField = reactive({});
|
|
32614
32621
|
const parentKeyField = reactive({});
|
|
32615
|
-
const selectedSourceValue = ref("");
|
|
32616
|
-
const selectedTargetValue = ref("");
|
|
32617
32622
|
const relatedFieldDataTypes = reactive({});
|
|
32618
32623
|
const relatedDefaultValues = reactive({});
|
|
32619
32624
|
const relatedTransformations = reactive({});
|
|
32620
|
-
const showRelatedTransformDialog = ref(false);
|
|
32621
|
-
const selectedRelatedTransformField = ref(null);
|
|
32622
|
-
const selectedRelatedSourceValue = ref("");
|
|
32623
|
-
const selectedRelatedTargetValue = ref("");
|
|
32624
32625
|
const formData = ref({});
|
|
32625
32626
|
const { renderField } = useSchemaField({
|
|
32626
32627
|
mode: "form",
|
|
@@ -32772,9 +32773,7 @@ const _sfc_main$s = /* @__PURE__ */ defineComponent({
|
|
|
32772
32773
|
});
|
|
32773
32774
|
return allFields;
|
|
32774
32775
|
}
|
|
32775
|
-
const schemaFields = computed(() =>
|
|
32776
|
-
return getAllFields(props2.schema || []);
|
|
32777
|
-
});
|
|
32776
|
+
const schemaFields = computed(() => getAllFields(toValue(props2.schema) || []));
|
|
32778
32777
|
function isFieldRequired(field) {
|
|
32779
32778
|
if (field.isArrayField && field.parentField) {
|
|
32780
32779
|
return false;
|
|
@@ -32924,9 +32923,7 @@ const _sfc_main$s = /* @__PURE__ */ defineComponent({
|
|
|
32924
32923
|
value = defaultValues[field.id];
|
|
32925
32924
|
useDefault = true;
|
|
32926
32925
|
}
|
|
32927
|
-
if (value === null)
|
|
32928
|
-
return;
|
|
32929
|
-
}
|
|
32926
|
+
if (value === null) return;
|
|
32930
32927
|
if (!useDefault && transformations[field.id] && transformations[field.id].length > 0) {
|
|
32931
32928
|
const transform = transformations[field.id].find(
|
|
32932
32929
|
(t) => t.sourceValue == value || t.sourceValue === String(value)
|
|
@@ -33061,7 +33058,6 @@ const _sfc_main$s = /* @__PURE__ */ defineComponent({
|
|
|
33061
33058
|
return {
|
|
33062
33059
|
key: field.id,
|
|
33063
33060
|
title: field.label,
|
|
33064
|
-
// Special formatting for array child fields
|
|
33065
33061
|
formatter: field.isArrayField ? formatArrayChildValue : void 0
|
|
33066
33062
|
};
|
|
33067
33063
|
});
|
|
@@ -33630,7 +33626,9 @@ ${unmatchedValues.length} values could not be automatically matched.`);
|
|
|
33630
33626
|
size: "1.5",
|
|
33631
33627
|
weight: "300"
|
|
33632
33628
|
}),
|
|
33633
|
-
createElementVNode("p",
|
|
33629
|
+
createElementVNode("p", {
|
|
33630
|
+
textContent: toDisplayString(file.value.name)
|
|
33631
|
+
}, null, 8, _hoisted_6$5)
|
|
33634
33632
|
]),
|
|
33635
33633
|
_: 1
|
|
33636
33634
|
})), [
|
|
@@ -33651,9 +33649,9 @@ ${unmatchedValues.length} values could not be automatically matched.`);
|
|
|
33651
33649
|
style: { "--bgl-accent-color": "var(--bgl-black)", "--bgl-primary": "var(--bgl-black)" }
|
|
33652
33650
|
}, null, 8, ["modelValue"])
|
|
33653
33651
|
])) : createCommentVNode("", true),
|
|
33654
|
-
file.value && !isLoading.value && fileHeaders.value.length > 0 ? (openBlock(), createElementBlock("div",
|
|
33652
|
+
file.value && !isLoading.value && fileHeaders.value.length > 0 ? (openBlock(), createElementBlock("div", _hoisted_7$4, [
|
|
33655
33653
|
_cache[36] || (_cache[36] = createElementVNode("p", { class: "label pb-1 border-bottom mb-1" }, " Match each required field to a column from your file, set default values, or configure transformations ", -1)),
|
|
33656
|
-
createElementVNode("div",
|
|
33654
|
+
createElementVNode("div", _hoisted_8$3, [
|
|
33657
33655
|
_cache[33] || (_cache[33] = createElementVNode("div", { class: "grid grid-wrap-5 gap-1 bold pb-1 m_none" }, [
|
|
33658
33656
|
createElementVNode("p", null, "Schema Field"),
|
|
33659
33657
|
createElementVNode("p", null, "Column from File"),
|
|
@@ -33667,9 +33665,9 @@ ${unmatchedValues.length} values could not be automatically matched.`);
|
|
|
33667
33665
|
class: normalizeClass(["grid grid-wrap-5 gap-1 m_gap-025 m_pb-1-5", { "array-field-row": field.isArrayField || field.$el === "array" }])
|
|
33668
33666
|
}, [
|
|
33669
33667
|
createElementVNode("div", null, [
|
|
33670
|
-
createElementVNode("div",
|
|
33671
|
-
createElementVNode("p",
|
|
33672
|
-
field.isArrayField ? (openBlock(), createElementBlock("span",
|
|
33668
|
+
createElementVNode("div", _hoisted_9$3, [
|
|
33669
|
+
createElementVNode("p", _hoisted_10$2, toDisplayString(field.label), 1),
|
|
33670
|
+
field.isArrayField ? (openBlock(), createElementBlock("span", _hoisted_11$2, "↳")) : createCommentVNode("", true),
|
|
33673
33671
|
field.$el === "array" ? (openBlock(), createBlock(unref(Pill), {
|
|
33674
33672
|
key: 1,
|
|
33675
33673
|
class: "txt10 ms-05",
|
|
@@ -33677,13 +33675,13 @@ ${unmatchedValues.length} values could not be automatically matched.`);
|
|
|
33677
33675
|
thin: "",
|
|
33678
33676
|
value: "Array"
|
|
33679
33677
|
})) : createCommentVNode("", true),
|
|
33680
|
-
isFieldRequired(field) ? (openBlock(), createElementBlock("span",
|
|
33681
|
-
getFieldDescription(field).isConditional ? (openBlock(), createElementBlock("span",
|
|
33678
|
+
isFieldRequired(field) ? (openBlock(), createElementBlock("span", _hoisted_12$2, "*")) : createCommentVNode("", true),
|
|
33679
|
+
getFieldDescription(field).isConditional ? (openBlock(), createElementBlock("span", _hoisted_13$1, "†")) : createCommentVNode("", true)
|
|
33682
33680
|
]),
|
|
33683
|
-
field.disabled ? (openBlock(), createElementBlock("div",
|
|
33684
|
-
getFieldDescription(field).isConditional ? (openBlock(), createElementBlock("div",
|
|
33681
|
+
field.disabled ? (openBlock(), createElementBlock("div", _hoisted_14$1, toDisplayString(field.disabledReason), 1)) : createCommentVNode("", true),
|
|
33682
|
+
getFieldDescription(field).isConditional ? (openBlock(), createElementBlock("div", _hoisted_15, toDisplayString(getFieldDescription(field).description), 1)) : createCommentVNode("", true)
|
|
33685
33683
|
]),
|
|
33686
|
-
createElementVNode("div",
|
|
33684
|
+
createElementVNode("div", _hoisted_16, [
|
|
33687
33685
|
createVNode(unref(SelectInput), {
|
|
33688
33686
|
modelValue: fieldMapping[field.id],
|
|
33689
33687
|
"onUpdate:modelValue": ($event) => fieldMapping[field.id] = $event,
|
|
@@ -33696,7 +33694,7 @@ ${unmatchedValues.length} values could not be automatically matched.`);
|
|
|
33696
33694
|
}, null, 8, ["modelValue", "onUpdate:modelValue", "options", "required", "disabled", "onChange"])
|
|
33697
33695
|
]),
|
|
33698
33696
|
createElementVNode("div", null, [
|
|
33699
|
-
createElementVNode("div",
|
|
33697
|
+
createElementVNode("div", _hoisted_17, [
|
|
33700
33698
|
createTextVNode(toDisplayString(initDefaultValue(field.id)) + " ", 1),
|
|
33701
33699
|
(openBlock(), createBlock(resolveDynamicComponent(unref(renderField)(getFieldWithDefaults(field)))))
|
|
33702
33700
|
])
|
|
@@ -33710,7 +33708,7 @@ ${unmatchedValues.length} values could not be automatically matched.`);
|
|
|
33710
33708
|
}, null, 8, ["modelValue", "onUpdate:modelValue", "disabled"])
|
|
33711
33709
|
]),
|
|
33712
33710
|
createElementVNode("div", null, [
|
|
33713
|
-
createElementVNode("div",
|
|
33711
|
+
createElementVNode("div", _hoisted_18, [
|
|
33714
33712
|
withDirectives(createVNode(unref(Btn), {
|
|
33715
33713
|
thin: "",
|
|
33716
33714
|
disabled: field.disabled,
|
|
@@ -33733,7 +33731,7 @@ ${unmatchedValues.length} values could not be automatically matched.`);
|
|
|
33733
33731
|
], 2);
|
|
33734
33732
|
}), 128))
|
|
33735
33733
|
]),
|
|
33736
|
-
mappingComplete.value ? (openBlock(), createElementBlock("div",
|
|
33734
|
+
mappingComplete.value ? (openBlock(), createElementBlock("div", _hoisted_19, [
|
|
33737
33735
|
createVNode(unref(Btn), { onClick: showPreview }, {
|
|
33738
33736
|
default: withCtx(() => _cache[34] || (_cache[34] = [
|
|
33739
33737
|
createTextVNode(" Preview Data ")
|
|
@@ -33741,7 +33739,7 @@ ${unmatchedValues.length} values could not be automatically matched.`);
|
|
|
33741
33739
|
_: 1,
|
|
33742
33740
|
__: [34]
|
|
33743
33741
|
})
|
|
33744
|
-
])) : (openBlock(), createElementBlock("div",
|
|
33742
|
+
])) : (openBlock(), createElementBlock("div", _hoisted_20, _cache[35] || (_cache[35] = [
|
|
33745
33743
|
createElementVNode("div", { class: "mapping-incomplete-message" }, " Please map the required fields to continue ", -1)
|
|
33746
33744
|
])))
|
|
33747
33745
|
])) : createCommentVNode("", true)
|
|
@@ -33753,8 +33751,8 @@ ${unmatchedValues.length} values could not be automatically matched.`);
|
|
|
33753
33751
|
width: "800"
|
|
33754
33752
|
}, {
|
|
33755
33753
|
default: withCtx(() => [
|
|
33756
|
-
selectedTransformField.value ? (openBlock(), createElementBlock("div",
|
|
33757
|
-
createElementVNode("div",
|
|
33754
|
+
selectedTransformField.value ? (openBlock(), createElementBlock("div", _hoisted_21, [
|
|
33755
|
+
createElementVNode("div", _hoisted_22, [
|
|
33758
33756
|
createElementVNode("p", null, [
|
|
33759
33757
|
_cache[37] || (_cache[37] = createTextVNode("Create transformations for ")),
|
|
33760
33758
|
createElementVNode("strong", null, toDisplayString(selectedTransformField.value.label), 1)
|
|
@@ -33778,8 +33776,8 @@ ${unmatchedValues.length} values could not be automatically matched.`);
|
|
|
33778
33776
|
key: index2,
|
|
33779
33777
|
class: "grid grid-wrap-7 gap-1 align-items-center m_gap-025 m_pb-1-5"
|
|
33780
33778
|
}, [
|
|
33781
|
-
createElementVNode("p",
|
|
33782
|
-
createElementVNode("p",
|
|
33779
|
+
createElementVNode("p", _hoisted_23, toDisplayString(transform.sourceValue), 1),
|
|
33780
|
+
createElementVNode("p", _hoisted_24, toDisplayString(transform.targetValue), 1),
|
|
33783
33781
|
withDirectives(createVNode(unref(Btn), {
|
|
33784
33782
|
class: "mb-05",
|
|
33785
33783
|
thin: "",
|
|
@@ -33791,8 +33789,8 @@ ${unmatchedValues.length} values could not be automatically matched.`);
|
|
|
33791
33789
|
])
|
|
33792
33790
|
]);
|
|
33793
33791
|
}), 128)),
|
|
33794
|
-
createElementVNode("div",
|
|
33795
|
-
createElementVNode("div",
|
|
33792
|
+
createElementVNode("div", _hoisted_25, [
|
|
33793
|
+
createElementVNode("div", _hoisted_26, [
|
|
33796
33794
|
fieldMapping[selectedTransformField.value.id] ? (openBlock(), createBlock(unref(SelectInput), {
|
|
33797
33795
|
key: 0,
|
|
33798
33796
|
modelValue: selectedSourceValue.value,
|
|
@@ -33808,7 +33806,7 @@ ${unmatchedValues.length} values could not be automatically matched.`);
|
|
|
33808
33806
|
placeholder: "Source value"
|
|
33809
33807
|
}, null, 8, ["modelValue"]))
|
|
33810
33808
|
]),
|
|
33811
|
-
createElementVNode("div",
|
|
33809
|
+
createElementVNode("div", _hoisted_27, [
|
|
33812
33810
|
selectedTransformField.value.options && selectedTransformField.value.options.length > 0 ? (openBlock(), createBlock(unref(SelectInput), {
|
|
33813
33811
|
key: 0,
|
|
33814
33812
|
modelValue: selectedTargetValue.value,
|
|
@@ -33836,7 +33834,7 @@ ${unmatchedValues.length} values could not be automatically matched.`);
|
|
|
33836
33834
|
])
|
|
33837
33835
|
])
|
|
33838
33836
|
]),
|
|
33839
|
-
createElementVNode("div",
|
|
33837
|
+
createElementVNode("div", _hoisted_28, [
|
|
33840
33838
|
createVNode(unref(Btn), {
|
|
33841
33839
|
class: "ms-auto",
|
|
33842
33840
|
value: "Close",
|
|
@@ -33856,9 +33854,9 @@ ${unmatchedValues.length} values could not be automatically matched.`);
|
|
|
33856
33854
|
default: withCtx(() => {
|
|
33857
33855
|
var _a;
|
|
33858
33856
|
return [
|
|
33859
|
-
selectedRelationField.value ? (openBlock(), createElementBlock("div",
|
|
33860
|
-
createElementVNode("p",
|
|
33861
|
-
!relatedFiles[selectedRelationField.value.id] ? (openBlock(), createElementBlock("div",
|
|
33857
|
+
selectedRelationField.value ? (openBlock(), createElementBlock("div", _hoisted_29, [
|
|
33858
|
+
createElementVNode("p", _hoisted_30, " Upload a file with related data for " + toDisplayString(selectedRelationField.value.label), 1),
|
|
33859
|
+
!relatedFiles[selectedRelationField.value.id] ? (openBlock(), createElementBlock("div", _hoisted_31, [
|
|
33862
33860
|
createVNode(unref(DragOver), {
|
|
33863
33861
|
accept: ".csv,.xls,.xlsx",
|
|
33864
33862
|
browse: "",
|
|
@@ -33881,8 +33879,8 @@ ${unmatchedValues.length} values could not be automatically matched.`);
|
|
|
33881
33879
|
]),
|
|
33882
33880
|
_: 1
|
|
33883
33881
|
})
|
|
33884
|
-
])) : (openBlock(), createElementBlock("div",
|
|
33885
|
-
createElementVNode("div",
|
|
33882
|
+
])) : (openBlock(), createElementBlock("div", _hoisted_32, [
|
|
33883
|
+
createElementVNode("div", _hoisted_33, [
|
|
33886
33884
|
createVNode(unref(Pill), null, {
|
|
33887
33885
|
default: withCtx(() => [
|
|
33888
33886
|
createTextVNode(toDisplayString(relatedFiles[selectedRelationField.value.id].name), 1)
|
|
@@ -33896,9 +33894,9 @@ ${unmatchedValues.length} values could not be automatically matched.`);
|
|
|
33896
33894
|
onClick: _cache[12] || (_cache[12] = ($event) => relatedFiles[selectedRelationField.value.id] = null)
|
|
33897
33895
|
})
|
|
33898
33896
|
]),
|
|
33899
|
-
relatedFileData[selectedRelationField.value.id] ? (openBlock(), createElementBlock("div",
|
|
33897
|
+
relatedFileData[selectedRelationField.value.id] ? (openBlock(), createElementBlock("div", _hoisted_34, [
|
|
33900
33898
|
_cache[44] || (_cache[44] = createElementVNode("h4", null, "Configure Relationship", -1)),
|
|
33901
|
-
createElementVNode("div",
|
|
33899
|
+
createElementVNode("div", _hoisted_35, [
|
|
33902
33900
|
createVNode(unref(SelectInput), {
|
|
33903
33901
|
modelValue: parentKeyField[selectedRelationField.value.id],
|
|
33904
33902
|
"onUpdate:modelValue": _cache[13] || (_cache[13] = ($event) => parentKeyField[selectedRelationField.value.id] = $event),
|
|
@@ -33939,7 +33937,7 @@ ${unmatchedValues.length} values could not be automatically matched.`);
|
|
|
33939
33937
|
}, null, 8, ["modelValue", "onUpdate:modelValue", "options"])
|
|
33940
33938
|
]),
|
|
33941
33939
|
createElementVNode("td", null, [
|
|
33942
|
-
createElementVNode("div",
|
|
33940
|
+
createElementVNode("div", _hoisted_36, [
|
|
33943
33941
|
createTextVNode(toDisplayString(initRelatedDefaultValue(selectedRelationField.value.id, schemaItem.id)) + " ", 1),
|
|
33944
33942
|
(openBlock(), createBlock(resolveDynamicComponent(unref(renderField)(getRelatedFieldWithDefaults(selectedRelationField.value.id, schemaItem)))))
|
|
33945
33943
|
])
|
|
@@ -33953,7 +33951,7 @@ ${unmatchedValues.length} values could not be automatically matched.`);
|
|
|
33953
33951
|
}, null, 8, ["modelValue", "onUpdate:modelValue", "disabled"])
|
|
33954
33952
|
]),
|
|
33955
33953
|
createElementVNode("td", null, [
|
|
33956
|
-
createElementVNode("div",
|
|
33954
|
+
createElementVNode("div", _hoisted_37, [
|
|
33957
33955
|
createVNode(unref(Btn), {
|
|
33958
33956
|
thin: "",
|
|
33959
33957
|
icon: "transform",
|
|
@@ -33973,7 +33971,7 @@ ${unmatchedValues.length} values could not be automatically matched.`);
|
|
|
33973
33971
|
])
|
|
33974
33972
|
])) : createCommentVNode("", true)
|
|
33975
33973
|
])),
|
|
33976
|
-
createElementVNode("div",
|
|
33974
|
+
createElementVNode("div", _hoisted_38, [
|
|
33977
33975
|
createVNode(unref(Btn), {
|
|
33978
33976
|
class: "ms-auto",
|
|
33979
33977
|
value: "Close",
|
|
@@ -34002,8 +34000,8 @@ ${unmatchedValues.length} values could not be automatically matched.`);
|
|
|
34002
34000
|
}, null, 8, ["modelValue", "column-config"])
|
|
34003
34001
|
]),
|
|
34004
34002
|
createElementVNode("div", null, [
|
|
34005
|
-
createElementVNode("p",
|
|
34006
|
-
createElementVNode("div",
|
|
34003
|
+
createElementVNode("p", _hoisted_39, " Showing all " + toDisplayString(previewData.value.length) + " records. You can edit values directly. ", 1),
|
|
34004
|
+
createElementVNode("div", _hoisted_40, [
|
|
34007
34005
|
createVNode(unref(Btn), {
|
|
34008
34006
|
flat: "",
|
|
34009
34007
|
thin: "",
|
|
@@ -34028,7 +34026,7 @@ ${unmatchedValues.length} values could not be automatically matched.`);
|
|
|
34028
34026
|
default: withCtx(() => {
|
|
34029
34027
|
var _a, _b, _c;
|
|
34030
34028
|
return [
|
|
34031
|
-
selectedRelatedTransformField.value ? (openBlock(), createElementBlock("div",
|
|
34029
|
+
selectedRelatedTransformField.value ? (openBlock(), createElementBlock("div", _hoisted_41, [
|
|
34032
34030
|
createElementVNode("p", null, [
|
|
34033
34031
|
_cache[46] || (_cache[46] = createTextVNode("Create transformations for ")),
|
|
34034
34032
|
createElementVNode("strong", null, toDisplayString(selectedRelatedTransformField.value.field.label), 1),
|
|
@@ -34132,13 +34130,8 @@ ${unmatchedValues.length} values could not be automatically matched.`);
|
|
|
34132
34130
|
]),
|
|
34133
34131
|
createElementVNode("div", null, [
|
|
34134
34132
|
createVNode(unref(Btn), {
|
|
34133
|
+
value: "Close",
|
|
34135
34134
|
onClick: _cache[27] || (_cache[27] = ($event) => showRelatedTransformDialog.value = false)
|
|
34136
|
-
}, {
|
|
34137
|
-
default: withCtx(() => _cache[48] || (_cache[48] = [
|
|
34138
|
-
createTextVNode(" Close ")
|
|
34139
|
-
])),
|
|
34140
|
-
_: 1,
|
|
34141
|
-
__: [48]
|
|
34142
34135
|
})
|
|
34143
34136
|
])
|
|
34144
34137
|
])) : createCommentVNode("", true)
|
|
@@ -35709,6 +35702,7 @@ const _hoisted_2$3 = {
|
|
|
35709
35702
|
};
|
|
35710
35703
|
const _hoisted_3$3 = ["aria-label", "onClick"];
|
|
35711
35704
|
const dragThreshold = 10;
|
|
35705
|
+
const MAX_EMPTY_REBUILD_ATTEMPTS = 3;
|
|
35712
35706
|
const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
35713
35707
|
__name: "Slider",
|
|
35714
35708
|
props: {
|
|
@@ -35743,6 +35737,7 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
|
35743
35737
|
const { innerWidth } = useDevice();
|
|
35744
35738
|
const transformProperty = ref("transform");
|
|
35745
35739
|
const pointerDown = ref(false);
|
|
35740
|
+
const isBuilding = ref(false);
|
|
35746
35741
|
const drag = ref({
|
|
35747
35742
|
startX: 0,
|
|
35748
35743
|
endX: 0,
|
|
@@ -35755,6 +35750,7 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
|
35755
35750
|
const linearAnimationFrame = ref(null);
|
|
35756
35751
|
const isHovering = ref(false);
|
|
35757
35752
|
const linearOffset = ref(0);
|
|
35753
|
+
const emptyRebuildAttempts = ref(0);
|
|
35758
35754
|
const perPage = computed(() => {
|
|
35759
35755
|
if (typeof props2.perPage === "number") {
|
|
35760
35756
|
return props2.perPage;
|
|
@@ -35801,10 +35797,40 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
|
35801
35797
|
if (!innerElements.value.length) return 0;
|
|
35802
35798
|
return config.value.loop ? innerElements.value.length : Math.ceil(innerElements.value.length - perPage.value + 1);
|
|
35803
35799
|
});
|
|
35804
|
-
|
|
35800
|
+
ref(false);
|
|
35801
|
+
const slotObserver = ref(null);
|
|
35802
|
+
const isMounted = ref(false);
|
|
35803
|
+
const slotContainer = ref(null);
|
|
35804
|
+
onMounted(() => {
|
|
35805
|
+
isMounted.value = true;
|
|
35806
|
+
nextTick(() => {
|
|
35807
|
+
init();
|
|
35808
|
+
});
|
|
35809
|
+
});
|
|
35805
35810
|
onBeforeUnmount(() => {
|
|
35811
|
+
isMounted.value = false;
|
|
35806
35812
|
stopAutoplay();
|
|
35807
35813
|
detachEvents();
|
|
35814
|
+
if (slotObserver.value) {
|
|
35815
|
+
slotObserver.value.disconnect();
|
|
35816
|
+
slotObserver.value = null;
|
|
35817
|
+
}
|
|
35818
|
+
if (carouselRef.value) {
|
|
35819
|
+
carouselRef.value.innerHTML = "";
|
|
35820
|
+
}
|
|
35821
|
+
});
|
|
35822
|
+
onUpdated(() => {
|
|
35823
|
+
if (isMounted.value && !isBuilding.value && emptyRebuildAttempts.value < MAX_EMPTY_REBUILD_ATTEMPTS) {
|
|
35824
|
+
if (slotContainer.value) {
|
|
35825
|
+
const slotElements = Array.from(slotContainer.value.children);
|
|
35826
|
+
if (slotElements.length !== innerElements.value.length || innerElements.value.length === 0) {
|
|
35827
|
+
innerElements.value = slotElements.map((el) => el.cloneNode(true));
|
|
35828
|
+
nextTick(() => {
|
|
35829
|
+
updateSlider();
|
|
35830
|
+
});
|
|
35831
|
+
}
|
|
35832
|
+
}
|
|
35833
|
+
}
|
|
35808
35834
|
});
|
|
35809
35835
|
watch(() => props2, () => {
|
|
35810
35836
|
resizeHandler();
|
|
@@ -35855,10 +35881,12 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
|
35855
35881
|
}
|
|
35856
35882
|
}
|
|
35857
35883
|
async function init() {
|
|
35858
|
-
if (!carouselRef.value) return;
|
|
35884
|
+
if (!carouselRef.value || !slotContainer.value || !isMounted.value) return;
|
|
35859
35885
|
transformProperty.value = webkitOrNot();
|
|
35860
35886
|
await sleep(10);
|
|
35861
|
-
innerElements.value = Array.from(
|
|
35887
|
+
innerElements.value = Array.from(slotContainer.value.children).map(
|
|
35888
|
+
(el) => el.cloneNode(true)
|
|
35889
|
+
);
|
|
35862
35890
|
if (!innerElements.value.length) {
|
|
35863
35891
|
console.warn("No carousel items found during initialization");
|
|
35864
35892
|
return;
|
|
@@ -35868,7 +35896,7 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
|
35868
35896
|
carouselRef.value.style.overflow = "hidden";
|
|
35869
35897
|
carouselRef.value.style.direction = config.value.rtl ? "rtl" : "ltr";
|
|
35870
35898
|
attachEvents();
|
|
35871
|
-
|
|
35899
|
+
setupSlotObserver();
|
|
35872
35900
|
buildSliderFrame();
|
|
35873
35901
|
if (config.value.autoplay !== "disabled") {
|
|
35874
35902
|
startAutoplay();
|
|
@@ -35876,79 +35904,152 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
|
35876
35904
|
config.value.onInit();
|
|
35877
35905
|
}
|
|
35878
35906
|
function buildSliderFrame() {
|
|
35879
|
-
if (!carouselRef.value) return;
|
|
35880
|
-
|
|
35881
|
-
|
|
35882
|
-
|
|
35883
|
-
|
|
35884
|
-
|
|
35885
|
-
|
|
35886
|
-
|
|
35887
|
-
|
|
35888
|
-
|
|
35889
|
-
|
|
35890
|
-
|
|
35891
|
-
|
|
35892
|
-
carouselRef.value.
|
|
35893
|
-
|
|
35894
|
-
|
|
35895
|
-
|
|
35896
|
-
|
|
35897
|
-
|
|
35898
|
-
|
|
35899
|
-
|
|
35907
|
+
if (!carouselRef.value || !isMounted.value) return;
|
|
35908
|
+
isBuilding.value = true;
|
|
35909
|
+
try {
|
|
35910
|
+
if (!innerElements.value.length) {
|
|
35911
|
+
console.warn("No carousel items found");
|
|
35912
|
+
emptyRebuildAttempts.value++;
|
|
35913
|
+
isBuilding.value = false;
|
|
35914
|
+
return;
|
|
35915
|
+
}
|
|
35916
|
+
emptyRebuildAttempts.value = 0;
|
|
35917
|
+
const originalCount = innerElements.value.length;
|
|
35918
|
+
const widthItem = selectorWidth.value / perPage.value;
|
|
35919
|
+
const itemsToBuild = config.value.loop ? originalCount + 2 * perPage.value : originalCount;
|
|
35920
|
+
carouselRef.value.innerHTML = "";
|
|
35921
|
+
if (!sliderFrame.value) {
|
|
35922
|
+
sliderFrame.value = document.createElement("div");
|
|
35923
|
+
} else {
|
|
35924
|
+
while (sliderFrame.value.firstChild) {
|
|
35925
|
+
sliderFrame.value.removeChild(sliderFrame.value.firstChild);
|
|
35926
|
+
}
|
|
35927
|
+
}
|
|
35928
|
+
sliderFrame.value.style.width = `${widthItem * itemsToBuild}px`;
|
|
35929
|
+
enableTransition();
|
|
35930
|
+
if (config.value.draggable) {
|
|
35931
|
+
carouselRef.value.style.cursor = "-webkit-grab";
|
|
35932
|
+
}
|
|
35933
|
+
const docFragment = document.createDocumentFragment();
|
|
35934
|
+
if (config.value.loop && innerElements.value.length > 0) {
|
|
35935
|
+
for (let i2 = originalCount - perPage.value; i2 < originalCount; i2++) {
|
|
35936
|
+
if (i2 >= 0 && i2 < originalCount) {
|
|
35937
|
+
const original = innerElements.value[i2];
|
|
35938
|
+
const clone2 = original.cloneNode(true);
|
|
35939
|
+
if (clone2 instanceof HTMLElement) {
|
|
35940
|
+
clone2.setAttribute("data-clone", "before");
|
|
35941
|
+
copyAttributesAndEvents(original, clone2);
|
|
35942
|
+
}
|
|
35943
|
+
const wrapped = buildSliderFrameItem(clone2);
|
|
35944
|
+
docFragment.appendChild(wrapped);
|
|
35945
|
+
}
|
|
35946
|
+
}
|
|
35947
|
+
}
|
|
35948
|
+
for (let i2 = 0; i2 < originalCount; i2++) {
|
|
35949
|
+
const element = innerElements.value[i2];
|
|
35950
|
+
const wrapped = buildSliderFrameItem(element.cloneNode(true));
|
|
35951
|
+
docFragment.appendChild(wrapped);
|
|
35952
|
+
}
|
|
35953
|
+
if (config.value.loop && innerElements.value.length > 0) {
|
|
35954
|
+
for (let i2 = 0; i2 < perPage.value; i2++) {
|
|
35955
|
+
if (i2 >= 0 && i2 < originalCount) {
|
|
35956
|
+
const original = innerElements.value[i2];
|
|
35957
|
+
const clone2 = original.cloneNode(true);
|
|
35958
|
+
if (clone2 instanceof HTMLElement) {
|
|
35959
|
+
clone2.setAttribute("data-clone", "after");
|
|
35960
|
+
copyAttributesAndEvents(original, clone2);
|
|
35961
|
+
}
|
|
35962
|
+
const wrapped = buildSliderFrameItem(clone2);
|
|
35963
|
+
docFragment.appendChild(wrapped);
|
|
35964
|
+
}
|
|
35900
35965
|
}
|
|
35901
35966
|
}
|
|
35967
|
+
sliderFrame.value.appendChild(docFragment);
|
|
35968
|
+
carouselRef.value.appendChild(sliderFrame.value);
|
|
35969
|
+
if (currentSlide.value >= innerElements.value.length) {
|
|
35970
|
+
currentSlide.value = Math.max(0, innerElements.value.length - 1);
|
|
35971
|
+
}
|
|
35972
|
+
slideToCurrent();
|
|
35973
|
+
} catch (error) {
|
|
35974
|
+
console.error("Error building slider frame:", error);
|
|
35975
|
+
} finally {
|
|
35976
|
+
isBuilding.value = false;
|
|
35902
35977
|
}
|
|
35903
|
-
|
|
35904
|
-
|
|
35905
|
-
|
|
35978
|
+
}
|
|
35979
|
+
function copyAttributesAndEvents(original, clone2) {
|
|
35980
|
+
if (!(original instanceof HTMLElement) || !(clone2 instanceof HTMLElement)) {
|
|
35981
|
+
return;
|
|
35906
35982
|
}
|
|
35907
|
-
|
|
35908
|
-
|
|
35909
|
-
|
|
35910
|
-
|
|
35911
|
-
|
|
35912
|
-
}
|
|
35983
|
+
const allAttrs = original.attributes;
|
|
35984
|
+
for (let i2 = 0; i2 < allAttrs.length; i2++) {
|
|
35985
|
+
const attr = allAttrs[i2];
|
|
35986
|
+
if (attr.name !== "id") {
|
|
35987
|
+
clone2.setAttribute(attr.name, attr.value);
|
|
35913
35988
|
}
|
|
35914
35989
|
}
|
|
35915
|
-
|
|
35916
|
-
|
|
35917
|
-
|
|
35918
|
-
|
|
35919
|
-
|
|
35920
|
-
|
|
35990
|
+
clone2.addEventListener("click", (e) => {
|
|
35991
|
+
if (typeof original.click === "function") {
|
|
35992
|
+
const clickEvent = new MouseEvent("click", {
|
|
35993
|
+
bubbles: true,
|
|
35994
|
+
cancelable: true,
|
|
35995
|
+
view: window
|
|
35996
|
+
});
|
|
35997
|
+
original.dispatchEvent(clickEvent);
|
|
35998
|
+
e.stopPropagation();
|
|
35999
|
+
}
|
|
36000
|
+
});
|
|
36001
|
+
if (original.tagName === "A" && clone2.tagName === "A") {
|
|
36002
|
+
const originalHref = original.getAttribute("href");
|
|
36003
|
+
if (originalHref) {
|
|
36004
|
+
clone2.addEventListener("click", (e) => {
|
|
36005
|
+
e.preventDefault();
|
|
36006
|
+
if (original.onclick) {
|
|
36007
|
+
original.onclick(new MouseEvent("click"));
|
|
36008
|
+
} else {
|
|
36009
|
+
const targetBlank = original.getAttribute("target") === "_blank";
|
|
36010
|
+
if (targetBlank) {
|
|
36011
|
+
window.open(originalHref, "_blank");
|
|
36012
|
+
} else {
|
|
36013
|
+
window.location.href = originalHref;
|
|
36014
|
+
}
|
|
36015
|
+
}
|
|
36016
|
+
});
|
|
35921
36017
|
}
|
|
35922
36018
|
}
|
|
35923
|
-
slideToCurrent();
|
|
35924
36019
|
}
|
|
35925
36020
|
function buildSliderFrameItem(elm) {
|
|
35926
36021
|
const elementContainer = document.createElement("div");
|
|
35927
36022
|
elementContainer.style.cssFloat = config.value.rtl ? "right" : "left";
|
|
35928
36023
|
elementContainer.style.float = config.value.rtl ? "right" : "left";
|
|
35929
36024
|
elementContainer.style.padding = config.value.slideGap ? `${config.value.slideGap / 2}rem` : "0";
|
|
35930
|
-
const percentage = config.value.loop ? 100 / (innerElements.value.length + perPage.value
|
|
36025
|
+
const percentage = config.value.loop ? 100 / (innerElements.value.length + 2 * perPage.value) : 100 / innerElements.value.length;
|
|
35931
36026
|
elementContainer.style.width = `${percentage}%`;
|
|
35932
36027
|
elementContainer.appendChild(elm);
|
|
35933
36028
|
return elementContainer;
|
|
35934
36029
|
}
|
|
35935
36030
|
function slideToCurrent(enableTransitionFlag) {
|
|
35936
|
-
|
|
35937
|
-
|
|
35938
|
-
|
|
35939
|
-
|
|
36031
|
+
try {
|
|
36032
|
+
if (!isMounted.value || !innerElements.value.length || !sliderFrame.value) return;
|
|
36033
|
+
const currentSlideValue = config.value.loop ? currentSlide.value + perPage.value : currentSlide.value;
|
|
36034
|
+
const offset2 = (config.value.rtl ? 1 : -1) * currentSlideValue * (selectorWidth.value / perPage.value);
|
|
36035
|
+
if (enableTransitionFlag && sliderFrame.value) {
|
|
35940
36036
|
requestAnimationFrame(() => {
|
|
35941
|
-
|
|
35942
|
-
|
|
36037
|
+
if (!isMounted.value || !sliderFrame.value) return;
|
|
36038
|
+
requestAnimationFrame(() => {
|
|
36039
|
+
if (!isMounted.value || !sliderFrame.value) return;
|
|
36040
|
+
enableTransition();
|
|
35943
36041
|
sliderFrame.value.style[transformProperty.value] = `translate3d(${offset2}px, 0, 0)`;
|
|
35944
|
-
}
|
|
36042
|
+
});
|
|
35945
36043
|
});
|
|
35946
|
-
})
|
|
35947
|
-
|
|
35948
|
-
|
|
36044
|
+
} else if (sliderFrame.value) {
|
|
36045
|
+
sliderFrame.value.style[transformProperty.value] = `translate3d(${offset2}px, 0, 0)`;
|
|
36046
|
+
}
|
|
36047
|
+
} catch (error) {
|
|
36048
|
+
console.error("Error in slideToCurrent:", error);
|
|
35949
36049
|
}
|
|
35950
36050
|
}
|
|
35951
36051
|
function prev(howManySlides = 1) {
|
|
36052
|
+
if (!isMounted.value || isBuilding.value || !innerElements.value.length) return;
|
|
35952
36053
|
const beforeChange = currentSlide.value;
|
|
35953
36054
|
if (config.value.loop) {
|
|
35954
36055
|
const isNewIndexClone = currentSlide.value - howManySlides < 0;
|
|
@@ -35978,6 +36079,7 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
|
35978
36079
|
}
|
|
35979
36080
|
}
|
|
35980
36081
|
function next(howManySlides = 1) {
|
|
36082
|
+
if (!isMounted.value || isBuilding.value || !innerElements.value.length) return;
|
|
35981
36083
|
const beforeChange = currentSlide.value;
|
|
35982
36084
|
if (config.value.loop) {
|
|
35983
36085
|
const isNewIndexClone = currentSlide.value + howManySlides > innerElements.value.length - perPage.value;
|
|
@@ -36030,6 +36132,7 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
|
36030
36132
|
}
|
|
36031
36133
|
}
|
|
36032
36134
|
function updateAfterDrag() {
|
|
36135
|
+
if (!isMounted.value) return;
|
|
36033
36136
|
const movement = (config.value.rtl ? -1 : 1) * (drag.value.endX - drag.value.startX);
|
|
36034
36137
|
const movementDistance = Math.abs(movement);
|
|
36035
36138
|
const howManySliderToSlide = config.value.multipleDrag ? Math.ceil(movementDistance / (selectorWidth.value / perPage.value)) : 1;
|
|
@@ -36061,6 +36164,7 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
|
36061
36164
|
};
|
|
36062
36165
|
}
|
|
36063
36166
|
function touchstartHandler(e) {
|
|
36167
|
+
if (isBuilding.value || !isMounted.value) return;
|
|
36064
36168
|
const target = e.target;
|
|
36065
36169
|
const ignoreTags = ["TEXTAREA", "OPTION", "INPUT", "SELECT"].includes(target.nodeName);
|
|
36066
36170
|
if (ignoreTags) {
|
|
@@ -36077,8 +36181,30 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
|
36077
36181
|
if (isLink || isImage) {
|
|
36078
36182
|
drag.value.preventClick = false;
|
|
36079
36183
|
}
|
|
36184
|
+
if (config.value.autoplay === "linear" && sliderFrame.value) {
|
|
36185
|
+
const currentTransform = getComputedStyle(sliderFrame.value)[transformProperty.value];
|
|
36186
|
+
if (currentTransform && currentTransform !== "none") {
|
|
36187
|
+
try {
|
|
36188
|
+
const matrix2 = new DOMMatrix(currentTransform);
|
|
36189
|
+
const currentX = matrix2.m41;
|
|
36190
|
+
const itemWidth = selectorWidth.value / perPage.value;
|
|
36191
|
+
if (config.value.loop) {
|
|
36192
|
+
const totalPosition = Math.abs(currentX);
|
|
36193
|
+
const slidePosition = Math.round(totalPosition / itemWidth) - perPage.value;
|
|
36194
|
+
currentSlide.value = slidePosition >= 0 ? slidePosition % innerElements.value.length : (innerElements.value.length + slidePosition % innerElements.value.length) % innerElements.value.length;
|
|
36195
|
+
} else {
|
|
36196
|
+
const slidePosition = Math.round(Math.abs(currentX) / itemWidth);
|
|
36197
|
+
currentSlide.value = Math.min(Math.max(slidePosition, 0), innerElements.value.length - perPage.value);
|
|
36198
|
+
}
|
|
36199
|
+
} catch (e22) {
|
|
36200
|
+
console.error("Error parsing transform matrix:", e22);
|
|
36201
|
+
}
|
|
36202
|
+
}
|
|
36203
|
+
stopAutoplay();
|
|
36204
|
+
}
|
|
36080
36205
|
}
|
|
36081
36206
|
function touchendHandler(e) {
|
|
36207
|
+
if (isBuilding.value || !isMounted.value) return;
|
|
36082
36208
|
e.stopPropagation();
|
|
36083
36209
|
if (isDragging.value) {
|
|
36084
36210
|
document.addEventListener("click", function preventClickAfterDrag(event) {
|
|
@@ -36095,11 +36221,12 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
|
36095
36221
|
updateAfterDrag();
|
|
36096
36222
|
}
|
|
36097
36223
|
clearDrag();
|
|
36098
|
-
if (config.value.autoplay !== "disabled") {
|
|
36224
|
+
if (config.value.autoplay !== "disabled" && !isHovering.value && isMounted.value) {
|
|
36099
36225
|
startAutoplay();
|
|
36100
36226
|
}
|
|
36101
36227
|
}
|
|
36102
36228
|
function touchmoveHandler(e) {
|
|
36229
|
+
if (isBuilding.value || !isMounted.value) return;
|
|
36103
36230
|
e.stopPropagation();
|
|
36104
36231
|
if (drag.value.letItGo === null) {
|
|
36105
36232
|
drag.value.letItGo = Math.abs(drag.value.startY - e.touches[0].pageY) < Math.abs(drag.value.startX - e.touches[0].pageX);
|
|
@@ -36123,6 +36250,7 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
|
36123
36250
|
}
|
|
36124
36251
|
}
|
|
36125
36252
|
function mousedownHandler(e) {
|
|
36253
|
+
if (isBuilding.value || !isMounted.value) return;
|
|
36126
36254
|
const target = e.target;
|
|
36127
36255
|
const ignoreTags = ["TEXTAREA", "OPTION", "INPUT", "SELECT"].includes(target.nodeName);
|
|
36128
36256
|
if (ignoreTags) return;
|
|
@@ -36137,8 +36265,30 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
|
36137
36265
|
if (isLink || isImage) {
|
|
36138
36266
|
drag.value.preventClick = false;
|
|
36139
36267
|
}
|
|
36268
|
+
if (config.value.autoplay === "linear" && sliderFrame.value) {
|
|
36269
|
+
const currentTransform = getComputedStyle(sliderFrame.value)[transformProperty.value];
|
|
36270
|
+
if (currentTransform && currentTransform !== "none") {
|
|
36271
|
+
try {
|
|
36272
|
+
const matrix2 = new DOMMatrix(currentTransform);
|
|
36273
|
+
const currentX = matrix2.m41;
|
|
36274
|
+
const itemWidth = selectorWidth.value / perPage.value;
|
|
36275
|
+
if (config.value.loop) {
|
|
36276
|
+
const totalPosition = Math.abs(currentX);
|
|
36277
|
+
const slidePosition = Math.round(totalPosition / itemWidth) - perPage.value;
|
|
36278
|
+
currentSlide.value = slidePosition >= 0 ? slidePosition % innerElements.value.length : (innerElements.value.length + slidePosition % innerElements.value.length) % innerElements.value.length;
|
|
36279
|
+
} else {
|
|
36280
|
+
const slidePosition = Math.round(Math.abs(currentX) / itemWidth);
|
|
36281
|
+
currentSlide.value = Math.min(Math.max(slidePosition, 0), innerElements.value.length - perPage.value);
|
|
36282
|
+
}
|
|
36283
|
+
} catch (e22) {
|
|
36284
|
+
console.error("Error parsing transform matrix:", e22);
|
|
36285
|
+
}
|
|
36286
|
+
}
|
|
36287
|
+
stopAutoplay();
|
|
36288
|
+
}
|
|
36140
36289
|
}
|
|
36141
36290
|
function mouseupHandler(e) {
|
|
36291
|
+
if (isBuilding.value || !isMounted.value) return;
|
|
36142
36292
|
e.stopPropagation();
|
|
36143
36293
|
if (isDragging.value) {
|
|
36144
36294
|
document.addEventListener("click", function preventClickAfterDrag(event) {
|
|
@@ -36158,11 +36308,12 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
|
36158
36308
|
updateAfterDrag();
|
|
36159
36309
|
}
|
|
36160
36310
|
clearDrag();
|
|
36161
|
-
if (config.value.autoplay !== "disabled" && !isHovering.value) {
|
|
36311
|
+
if (config.value.autoplay !== "disabled" && !isHovering.value && isMounted.value) {
|
|
36162
36312
|
startAutoplay();
|
|
36163
36313
|
}
|
|
36164
36314
|
}
|
|
36165
36315
|
function mousemoveHandler(e) {
|
|
36316
|
+
if (isBuilding.value || !isMounted.value) return;
|
|
36166
36317
|
e.preventDefault();
|
|
36167
36318
|
if (pointerDown.value) {
|
|
36168
36319
|
drag.value.endX = e.pageX;
|
|
@@ -36185,6 +36336,7 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
|
36185
36336
|
}
|
|
36186
36337
|
}
|
|
36187
36338
|
function mouseleaveHandler(e) {
|
|
36339
|
+
if (isBuilding.value || !isMounted.value) return;
|
|
36188
36340
|
if (pointerDown.value) {
|
|
36189
36341
|
pointerDown.value = false;
|
|
36190
36342
|
if (carouselRef.value) {
|
|
@@ -36198,6 +36350,7 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
|
36198
36350
|
}
|
|
36199
36351
|
}
|
|
36200
36352
|
function clickHandler2(e) {
|
|
36353
|
+
if (isBuilding.value || !isMounted.value) return;
|
|
36201
36354
|
if (drag.value.preventClick || isDragging.value) {
|
|
36202
36355
|
e.preventDefault();
|
|
36203
36356
|
e.stopPropagation();
|
|
@@ -36208,6 +36361,7 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
|
36208
36361
|
}
|
|
36209
36362
|
function dragstartHandler(e) {
|
|
36210
36363
|
var _a;
|
|
36364
|
+
if (isBuilding.value || !isMounted.value) return;
|
|
36211
36365
|
if (config.value.draggable) {
|
|
36212
36366
|
const target = e.target;
|
|
36213
36367
|
const isDraggableElement = target.tagName === "IMG" || target.tagName === "A" || ((_a = target.parentElement) == null ? void 0 : _a.tagName) === "A";
|
|
@@ -36264,10 +36418,11 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
|
36264
36418
|
}
|
|
36265
36419
|
}
|
|
36266
36420
|
async function startAutoplay() {
|
|
36421
|
+
if (!isMounted.value) return;
|
|
36267
36422
|
stopAutoplay();
|
|
36268
36423
|
if (config.value.autoplay === "standard") {
|
|
36269
36424
|
autoplayTimer.value = window.setInterval(() => {
|
|
36270
|
-
if (!isHovering.value) {
|
|
36425
|
+
if (isMounted.value && !isHovering.value && !isBuilding.value) {
|
|
36271
36426
|
next();
|
|
36272
36427
|
}
|
|
36273
36428
|
}, config.value.autoplayInterval);
|
|
@@ -36286,9 +36441,15 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
|
36286
36441
|
}
|
|
36287
36442
|
}
|
|
36288
36443
|
function startLinearAutoplay() {
|
|
36289
|
-
|
|
36444
|
+
if (!isMounted.value || !innerElements.value.length) return;
|
|
36445
|
+
const itemWidth = selectorWidth.value / perPage.value;
|
|
36446
|
+
linearOffset.value = currentSlide.value * itemWidth;
|
|
36290
36447
|
let lastTimestamp = 0;
|
|
36291
36448
|
const animate = (timestamp2) => {
|
|
36449
|
+
if (!isMounted.value || !sliderFrame.value) {
|
|
36450
|
+
stopAutoplay();
|
|
36451
|
+
return;
|
|
36452
|
+
}
|
|
36292
36453
|
if (!lastTimestamp) lastTimestamp = timestamp2;
|
|
36293
36454
|
const elapsed = timestamp2 - lastTimestamp;
|
|
36294
36455
|
lastTimestamp = timestamp2;
|
|
@@ -36298,7 +36459,6 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
|
36298
36459
|
}
|
|
36299
36460
|
const pixelsToMove = elapsed / 1e3 * config.value.autoplaySpeed;
|
|
36300
36461
|
linearOffset.value += pixelsToMove;
|
|
36301
|
-
const itemWidth = selectorWidth.value / perPage.value;
|
|
36302
36462
|
const totalWidth = itemWidth * innerElements.value.length;
|
|
36303
36463
|
if (linearOffset.value >= totalWidth) {
|
|
36304
36464
|
if (config.value.loop) {
|
|
@@ -36306,22 +36466,29 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
|
36306
36466
|
} else {
|
|
36307
36467
|
linearOffset.value = totalWidth - itemWidth;
|
|
36308
36468
|
stopAutoplay();
|
|
36309
|
-
return;
|
|
36310
36469
|
}
|
|
36311
36470
|
}
|
|
36312
|
-
if (sliderFrame.value) {
|
|
36471
|
+
if (sliderFrame.value && !isBuilding.value) {
|
|
36313
36472
|
const direction = config.value.rtl ? 1 : -1;
|
|
36314
36473
|
sliderFrame.value.style.transition = "none";
|
|
36315
|
-
|
|
36474
|
+
let displayOffset = linearOffset.value;
|
|
36475
|
+
if (config.value.loop) {
|
|
36476
|
+
displayOffset = linearOffset.value + perPage.value * itemWidth;
|
|
36477
|
+
}
|
|
36478
|
+
sliderFrame.value.style[transformProperty.value] = `translate3d(${direction * displayOffset}px, 0, 0)`;
|
|
36316
36479
|
}
|
|
36317
36480
|
const newSlide = Math.floor(linearOffset.value / itemWidth) % innerElements.value.length;
|
|
36318
36481
|
if (newSlide !== currentSlide.value) {
|
|
36319
36482
|
currentSlide.value = newSlide;
|
|
36320
36483
|
config.value.onChange();
|
|
36321
36484
|
}
|
|
36322
|
-
|
|
36485
|
+
if (isMounted.value) {
|
|
36486
|
+
linearAnimationFrame.value = requestAnimationFrame(animate);
|
|
36487
|
+
}
|
|
36323
36488
|
};
|
|
36324
|
-
|
|
36489
|
+
if (isMounted.value) {
|
|
36490
|
+
linearAnimationFrame.value = requestAnimationFrame(animate);
|
|
36491
|
+
}
|
|
36325
36492
|
}
|
|
36326
36493
|
function mouseenterHandler() {
|
|
36327
36494
|
isHovering.value = true;
|
|
@@ -36337,6 +36504,91 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
|
36337
36504
|
startAutoplay();
|
|
36338
36505
|
}
|
|
36339
36506
|
}
|
|
36507
|
+
function setupSlotObserver() {
|
|
36508
|
+
if (!slotContainer.value || slotObserver.value) return;
|
|
36509
|
+
slotObserver.value = new MutationObserver((mutations) => {
|
|
36510
|
+
if (isBuilding.value || !isMounted.value || emptyRebuildAttempts.value >= MAX_EMPTY_REBUILD_ATTEMPTS) {
|
|
36511
|
+
return;
|
|
36512
|
+
}
|
|
36513
|
+
let needsRebuild = false;
|
|
36514
|
+
for (const mutation of mutations) {
|
|
36515
|
+
if (mutation.type === "childList") {
|
|
36516
|
+
needsRebuild = true;
|
|
36517
|
+
break;
|
|
36518
|
+
}
|
|
36519
|
+
}
|
|
36520
|
+
if (needsRebuild) {
|
|
36521
|
+
nextTick(() => {
|
|
36522
|
+
if (isMounted.value && slotContainer.value) {
|
|
36523
|
+
innerElements.value = Array.from(slotContainer.value.children).map(
|
|
36524
|
+
(el) => el.cloneNode(true)
|
|
36525
|
+
);
|
|
36526
|
+
updateSlider();
|
|
36527
|
+
}
|
|
36528
|
+
});
|
|
36529
|
+
}
|
|
36530
|
+
});
|
|
36531
|
+
slotObserver.value.observe(slotContainer.value, {
|
|
36532
|
+
childList: true,
|
|
36533
|
+
subtree: false,
|
|
36534
|
+
attributes: false,
|
|
36535
|
+
characterData: false
|
|
36536
|
+
});
|
|
36537
|
+
}
|
|
36538
|
+
function updateSlider() {
|
|
36539
|
+
if (!carouselRef.value || !slotContainer.value || isBuilding.value || !isMounted.value) return;
|
|
36540
|
+
if (emptyRebuildAttempts.value >= MAX_EMPTY_REBUILD_ATTEMPTS) {
|
|
36541
|
+
console.warn("Too many rebuild attempts with no items, stopping");
|
|
36542
|
+
return;
|
|
36543
|
+
}
|
|
36544
|
+
try {
|
|
36545
|
+
if (slotObserver.value) {
|
|
36546
|
+
slotObserver.value.disconnect();
|
|
36547
|
+
}
|
|
36548
|
+
const slotElements = Array.from(slotContainer.value.children).map((el) => el.cloneNode(true));
|
|
36549
|
+
if (slotElements.length > 0 || innerElements.value.length > 0 && emptyRebuildAttempts.value === 0) {
|
|
36550
|
+
const previousCount = innerElements.value.length;
|
|
36551
|
+
innerElements.value = slotElements;
|
|
36552
|
+
if (currentSlide.value >= innerElements.value.length) {
|
|
36553
|
+
currentSlide.value = Math.max(0, innerElements.value.length - 1);
|
|
36554
|
+
}
|
|
36555
|
+
const isInitialPopulation = previousCount === 0 && slotElements.length > 0;
|
|
36556
|
+
const wasAutoplay = config.value.autoplay !== "disabled";
|
|
36557
|
+
if (wasAutoplay) {
|
|
36558
|
+
stopAutoplay();
|
|
36559
|
+
}
|
|
36560
|
+
buildSliderFrame();
|
|
36561
|
+
if (wasAutoplay && !isHovering.value && innerElements.value.length > 0) {
|
|
36562
|
+
setTimeout(() => {
|
|
36563
|
+
startAutoplay();
|
|
36564
|
+
}, 50);
|
|
36565
|
+
}
|
|
36566
|
+
}
|
|
36567
|
+
} catch (error) {
|
|
36568
|
+
console.error("Error updating slider:", error);
|
|
36569
|
+
} finally {
|
|
36570
|
+
if (slotObserver.value && slotContainer.value) {
|
|
36571
|
+
slotObserver.value.observe(slotContainer.value, {
|
|
36572
|
+
childList: true,
|
|
36573
|
+
subtree: false,
|
|
36574
|
+
attributes: false,
|
|
36575
|
+
characterData: false
|
|
36576
|
+
});
|
|
36577
|
+
}
|
|
36578
|
+
}
|
|
36579
|
+
}
|
|
36580
|
+
function resetSlider() {
|
|
36581
|
+
emptyRebuildAttempts.value = 0;
|
|
36582
|
+
if (slotContainer.value) {
|
|
36583
|
+
const slotElements = Array.from(slotContainer.value.children).map((el) => el.cloneNode(true));
|
|
36584
|
+
if (slotElements.length > 0) {
|
|
36585
|
+
innerElements.value = slotElements;
|
|
36586
|
+
nextTick(() => {
|
|
36587
|
+
buildSliderFrame();
|
|
36588
|
+
});
|
|
36589
|
+
}
|
|
36590
|
+
}
|
|
36591
|
+
}
|
|
36340
36592
|
__expose({
|
|
36341
36593
|
prev,
|
|
36342
36594
|
next,
|
|
@@ -36348,17 +36600,25 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
|
36348
36600
|
destroy: destroy2,
|
|
36349
36601
|
currentSlide,
|
|
36350
36602
|
pauseAutoplay,
|
|
36351
|
-
resumeAutoplay
|
|
36603
|
+
resumeAutoplay,
|
|
36604
|
+
updateSlider,
|
|
36605
|
+
resetSlider
|
|
36352
36606
|
});
|
|
36353
36607
|
return (_ctx, _cache) => {
|
|
36354
36608
|
return openBlock(), createElementBlock("div", _hoisted_1$5, [
|
|
36355
36609
|
createElementVNode("div", {
|
|
36356
|
-
ref_key: "
|
|
36357
|
-
ref:
|
|
36358
|
-
class: "carousel-container"
|
|
36610
|
+
ref_key: "slotContainer",
|
|
36611
|
+
ref: slotContainer,
|
|
36612
|
+
class: "carousel-slot-container",
|
|
36613
|
+
style: { "display": "none" }
|
|
36359
36614
|
}, [
|
|
36360
36615
|
renderSlot(_ctx.$slots, "default", {}, void 0, true)
|
|
36361
36616
|
], 512),
|
|
36617
|
+
createElementVNode("div", {
|
|
36618
|
+
ref_key: "carouselRef",
|
|
36619
|
+
ref: carouselRef,
|
|
36620
|
+
class: "carousel-container"
|
|
36621
|
+
}, null, 512),
|
|
36362
36622
|
props2.dots && totalDots.value > 1 ? (openBlock(), createElementBlock("div", _hoisted_2$3, [
|
|
36363
36623
|
(openBlock(true), createElementBlock(Fragment, null, renderList(totalDots.value, (i2) => {
|
|
36364
36624
|
return openBlock(), createElementBlock("button", {
|
|
@@ -36374,7 +36634,7 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
|
36374
36634
|
};
|
|
36375
36635
|
}
|
|
36376
36636
|
});
|
|
36377
|
-
const Slider = /* @__PURE__ */ _export_sfc(_sfc_main$7, [["__scopeId", "data-v-
|
|
36637
|
+
const Slider = /* @__PURE__ */ _export_sfc(_sfc_main$7, [["__scopeId", "data-v-7225d57d"]]);
|
|
36378
36638
|
const _hoisted_1$4 = { class: "stickyTop" };
|
|
36379
36639
|
const _hoisted_2$2 = {
|
|
36380
36640
|
key: 0,
|
|
@@ -38258,7 +38518,7 @@ const _hoisted_1 = {
|
|
|
38258
38518
|
key: 0,
|
|
38259
38519
|
class: "navigation flex space-between px-3 w-100 absolute m_px-1 m_none z-9"
|
|
38260
38520
|
};
|
|
38261
|
-
const _hoisted_2 = { class: "flex start fixed top-1 w-100 space-between px-1" };
|
|
38521
|
+
const _hoisted_2 = { class: "flex start fixed top-1 w-100 space-between px-1 z-9" };
|
|
38262
38522
|
const _hoisted_3 = {
|
|
38263
38523
|
key: 0,
|
|
38264
38524
|
class: "center"
|
|
@@ -39615,7 +39875,19 @@ function searchItems(params) {
|
|
|
39615
39875
|
const relevance = calculateItemRelevance(item);
|
|
39616
39876
|
return [item, relevance];
|
|
39617
39877
|
});
|
|
39618
|
-
|
|
39878
|
+
const nonZeroItems = scoredItems.filter(([, score]) => score > 0);
|
|
39879
|
+
let filteredItems = nonZeroItems;
|
|
39880
|
+
if (nonZeroItems.length > 0) {
|
|
39881
|
+
const maxScore = Math.max(...nonZeroItems.map(([, score]) => score));
|
|
39882
|
+
if (maxScore > 5) {
|
|
39883
|
+
const threshold = maxScore * 0.25;
|
|
39884
|
+
filteredItems = nonZeroItems.filter(([, score]) => score >= threshold);
|
|
39885
|
+
} else if (maxScore > 2) {
|
|
39886
|
+
const threshold = maxScore * 0.15;
|
|
39887
|
+
filteredItems = nonZeroItems.filter(([, score]) => score >= threshold);
|
|
39888
|
+
}
|
|
39889
|
+
}
|
|
39890
|
+
return filteredItems.sort(([, scoreA], [, scoreB]) => scoreB - scoreA).map(([item]) => item);
|
|
39619
39891
|
}
|
|
39620
39892
|
function useSearch(params) {
|
|
39621
39893
|
const { searchTerm, minChars = 2, serverSearch, debounceMs = 300 } = params;
|