@bagelink/vue 0.0.1224 → 0.0.1227
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/BglComponent.vue.d.ts.map +1 -1
- package/dist/components/Btn.vue.d.ts.map +1 -1
- package/dist/components/Spreadsheet/Index.vue.d.ts +1 -0
- package/dist/components/Spreadsheet/Index.vue.d.ts.map +1 -1
- package/dist/components/form/BagelForm.vue.d.ts +1 -0
- package/dist/components/form/BagelForm.vue.d.ts.map +1 -1
- package/dist/components/lightbox/Lightbox.vue.d.ts.map +1 -1
- package/dist/components/lightbox/lightbox.types.d.ts +2 -1
- package/dist/components/lightbox/lightbox.types.d.ts.map +1 -1
- package/dist/composables/useSchemaField.d.ts +9 -5
- package/dist/composables/useSchemaField.d.ts.map +1 -1
- package/dist/index.cjs +69 -35
- package/dist/index.mjs +70 -36
- package/dist/style.css +73 -70
- package/dist/types/BagelForm.d.ts +2 -1
- package/dist/types/BagelForm.d.ts.map +1 -1
- package/dist/utils/BagelFormUtils.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/components/Btn.vue +3 -0
- package/src/components/Spreadsheet/Index.vue +41 -17
- package/src/components/form/BagelForm.vue +6 -2
- package/src/components/lightbox/Lightbox.vue +5 -5
- package/src/components/lightbox/lightbox.types.ts +2 -1
- package/src/composables/useSchemaField.ts +36 -12
- package/src/types/BagelForm.ts +2 -1
- package/src/utils/BagelFormUtils.ts +2 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BglComponent.vue.d.ts","sourceRoot":"","sources":["../../src/components/BglComponent.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"BglComponent.vue.d.ts","sourceRoot":"","sources":["../../src/components/BglComponent.vue"],"names":[],"mappings":"AAAA,OA6LO,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAA;yBAmBzB,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,eAChC,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,CAAC,OAAO,CAAC,cAClD,mBAAmB,CAAC,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,OAAO,CAAC,CAAC,iBAC5F,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,CAAC,QAAQ,CAAC;WAqP1D,mBAAmB,CAAC;;;eAlPpB,KAAK,CAAC,CAAC,CAAC;aACV,MAAM;qBACE,GAAG;qBACH,MAAM;mBA+O0E,CAAC,4BAA2B;oBACzG,OAAO,KAAK,EAAE,gBAAgB,CAAC,EAAE,CAAC,GAAG,IAAI;WAClD,GAAG;;yBAnCkB,GAAG;;;OAwCpB,OAAO,KAAK,EAAE,KAAK,GAAG;IAAE,KAAK,CAAC,EAAE,OAAO,CAAC,OAAO,WAAW,CAAC,CAAA;CAAE;AA/PzE,wBA+P4E;AAC5E,KAAK,mBAAmB,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAG,GAAG,EAAE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Btn.vue.d.ts","sourceRoot":"","sources":["../../src/components/Btn.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Btn.vue.d.ts","sourceRoot":"","sources":["../../src/components/Btn.vue"],"names":[],"mappings":"AA2QA,OAAO,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAMxD,KAAK,WAAW,GAAG;IACjB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,IAAI,CAAC,EAAE,QAAQ,CAAA;IACf,OAAO,CAAC,EAAE,QAAQ,CAAA;IAClB,KAAK,CAAC,EAAE,SAAS,CAAA;IACjB,KAAK,CAAC,EAAE,SAAS,CAAA;IACjB,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,IAAI,CAAC,EAAE,QAAQ,GAAG,QAAQ,GAAG,OAAO,CAAA;IACpC,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,OAAO,CAAC,EAAE,CAAC,CAAC,EAAE,UAAU,KAAK,IAAI,CAAA;CACjC,CAAC;AAiDH,iBAAS,cAAc;WA4IT,OAAO,IAA6B;;yBAVpB,GAAG;;;;EAehC;AAcD,KAAK,oBAAoB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAC9D,QAAA,MAAM,eAAe;aAlNT,CAAC,CAAC,EAAE,UAAU,KAAK,IAAI;UAT1B,QAAQ,GAAG,QAAQ,GAAG,OAAO;cATzB,OAAO;YAMT,OAAO;aACN,OAAO;WAQT,OAAO;aALL,OAAO;UACV,MAAM;QAKR,MAAM;YACF,OAAO;6EA2NhB,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAAnG,wBAAoG;AAapG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACxC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Index.vue.d.ts","sourceRoot":"","sources":["../../../src/components/Spreadsheet/Index.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Index.vue.d.ts","sourceRoot":"","sources":["../../../src/components/Spreadsheet/Index.vue"],"names":[],"mappings":"AAy2BA,KAAK,YAAY,GAAG,MAAM,GAAG,QAAQ,GAAG,UAAU,GAAG,MAAM,GAAG,YAAY,GAAG,OAAO,GAAG,SAAS,CAAA;AAEhG,UAAU,YAAY;IACrB,GAAG,EAAE,MAAM,CAAA;IACX,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,MAAM,CAAC,EAAE,YAAY,CAAA;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,YAAY,CAAC,EAAE,GAAG,CAAA;CAClB;AAGD,UAAU,KAAK;IACd,UAAU,EAAE,KAAK,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,CAAA;IACtC,YAAY,CAAC,EAAE,YAAY,EAAE,CAAA;IAC7B,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,WAAW,CAAC,EAAE,OAAO,CAAA;CACrB;;;;;;AAgnCD,wBAQG"}
|
|
@@ -23,6 +23,7 @@ declare const _default: <T extends {
|
|
|
23
23
|
submit: () => Promise<void>;
|
|
24
24
|
isDirty: import('@vue-macros/reactivity-transform/macros.js').ComputedVariable<false> | import('@vue-macros/reactivity-transform/macros.js').ComputedVariable<true>;
|
|
25
25
|
validateForm: () => boolean;
|
|
26
|
+
formState: "error" | "success" | "idle" | "submitting";
|
|
26
27
|
}): any;
|
|
27
28
|
success?(_: {}): any;
|
|
28
29
|
error?(_: {}): any;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BagelForm.vue.d.ts","sourceRoot":"","sources":["../../../src/components/form/BagelForm.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"BagelForm.vue.d.ts","sourceRoot":"","sources":["../../../src/components/form/BagelForm.vue"],"names":[],"mappings":"AAoHA,OAAO,KAAK,EAAE,gBAAgB,EAAS,MAAM,eAAe,CAAA;AAK5D,MAAM,WAAW,cAAc,CAAC,EAAE;IACjC,UAAU,CAAC,EAAE,EAAE,CAAA;IACf,MAAM,CAAC,EAAE,gBAAgB,CAAC,EAAE,CAAC,CAAA;IAC7B,GAAG,CAAC,EAAE,MAAM,GAAG,UAAU,CAAA;IACzB,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,EAAE,KAAK,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAA;CAC7C;yBAEgB,CAAC,SAAS;IAAC,CAAC,GAAG,EAAC,MAAM,GAAE,GAAG,CAAA;CAAC,eAC/B,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,CAAC,OAAO,CAAC,cAClD,mBAAmB,CAAC,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,OAAO,CAAC,CAAC,iBAC5F,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,CAAC,QAAQ,CAAC;WA+L1D,mBAAmB,CAAC;;6KAAkE,CAAC,4BAA2B;oBACzG,OAAO,KAAK,EAAE,gBAAgB;;;;MAAsB,GAAG,IAAI;WACpE,GAAG;;yBAxCkB,GAAG;;;;;;YACJ,GAAG;yBACF,GAAG;uBACL,GAAG;;cAlJzB,mBAAmB,SAAS,CAAC,KAAG,IAAI;OA4L7B,OAAO,KAAK,EAAE,KAAK,GAAG;IAAE,KAAK,CAAC,EAAE,OAAO,CAAC,OAAO,WAAW,CAAC,CAAA;CAAE;AAzMzE,wBAyM4E;AAC5E,KAAK,mBAAmB,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAG,GAAG,EAAE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Lightbox.vue.d.ts","sourceRoot":"","sources":["../../../src/components/lightbox/Lightbox.vue"],"names":[],"mappings":"AAgRA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAA;AAUpD,iBAAS,IAAI,CAAC,IAAI,EAAE,YAAY,EAAE,UAAU,CAAC,EAAE,YAAY,EAAE,QAK5D;AAED,iBAAS,KAAK,SAGb;;;;;
|
|
1
|
+
{"version":3,"file":"Lightbox.vue.d.ts","sourceRoot":"","sources":["../../../src/components/lightbox/Lightbox.vue"],"names":[],"mappings":"AAgRA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAA;AAUpD,iBAAS,IAAI,CAAC,IAAI,EAAE,YAAY,EAAE,UAAU,CAAC,EAAE,YAAY,EAAE,QAK5D;AAED,iBAAS,KAAK,SAGb;;;;;AAsjBD,wBAOG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lightbox.types.d.ts","sourceRoot":"","sources":["../../../src/components/lightbox/lightbox.types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,YAAY;IAC5B,GAAG,EAAE,MAAM,CAAA;
|
|
1
|
+
{"version":3,"file":"lightbox.types.d.ts","sourceRoot":"","sources":["../../../src/components/lightbox/lightbox.types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,YAAY;IAC5B,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,MAAM,CAAA;IACZ,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAA;CAClB"}
|
|
@@ -1,18 +1,22 @@
|
|
|
1
1
|
import { VNode } from 'vue';
|
|
2
|
-
import { BaseBagelField } from '../types/BagelForm';
|
|
2
|
+
import { BaseBagelField, BglFormSchemaT } from '../types/BagelForm';
|
|
3
3
|
export interface UseSchemaFieldOptions<T> {
|
|
4
4
|
mode?: 'form' | 'preview' | 'table';
|
|
5
5
|
getRowData?: () => T;
|
|
6
6
|
onUpdate?: (field: BaseBagelField<T>, value: any) => void;
|
|
7
7
|
includeUnset?: boolean;
|
|
8
8
|
}
|
|
9
|
+
interface SlotProps<T> {
|
|
10
|
+
row: T;
|
|
11
|
+
field: BaseBagelField<T>;
|
|
12
|
+
}
|
|
13
|
+
type SlotFunction<T> = (props: SlotProps<T>) => any;
|
|
14
|
+
type SupportedSlot<T> = BglFormSchemaT<T> | VNode | SlotFunction<T>;
|
|
9
15
|
export declare function useSchemaField<T extends {
|
|
10
16
|
[key: string]: any;
|
|
11
17
|
}>(options: UseSchemaFieldOptions<T>): {
|
|
12
|
-
renderField: (field: BaseBagelField<T>, slots?: Record<string,
|
|
13
|
-
row: T;
|
|
14
|
-
field: BaseBagelField<T>;
|
|
15
|
-
}) => any>) => VNode | null;
|
|
18
|
+
renderField: (field: BaseBagelField<T>, slots?: Record<string, SupportedSlot<T>>) => VNode | null;
|
|
16
19
|
getComponent: (field: BaseBagelField<T>) => any;
|
|
17
20
|
};
|
|
21
|
+
export {};
|
|
18
22
|
//# sourceMappingURL=useSchemaField.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useSchemaField.d.ts","sourceRoot":"","sources":["../../src/composables/useSchemaField.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,KAAK,CAAA;AAChC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAA;
|
|
1
|
+
{"version":3,"file":"useSchemaField.d.ts","sourceRoot":"","sources":["../../src/composables/useSchemaField.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,KAAK,CAAA;AAChC,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAA;AAwBxE,MAAM,WAAW,qBAAqB,CAAC,CAAC;IACvC,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,CAAA;IACnC,UAAU,CAAC,EAAE,MAAM,CAAC,CAAA;IACpB,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,cAAc,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,GAAG,KAAK,IAAI,CAAA;IACzD,YAAY,CAAC,EAAE,OAAO,CAAA;CACtB;AAID,UAAU,SAAS,CAAC,CAAC;IAAI,GAAG,EAAE,CAAC,CAAC;IAAC,KAAK,EAAE,cAAc,CAAC,CAAC,CAAC,CAAA;CAAE;AAC3D,KAAK,YAAY,CAAC,CAAC,IAAI,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC,CAAC,KAAK,GAAG,CAAA;AACnD,KAAK,aAAa,CAAC,CAAC,IAAI,cAAc,CAAC,CAAC,CAAC,GAAG,KAAK,GAAG,YAAY,CAAC,CAAC,CAAC,CAAA;AAEnE,wBAAgB,cAAc,CAAC,CAAC,SAAS;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;CAAE,EAAE,OAAO,EAAE,qBAAqB,CAAC,CAAC,CAAC;yBAsCzF,cAAc,CAAC,CAAC,CAAC,UAChB,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC,KACtC,KAAK,GAAG,IAAI;0BArCc,cAAc,CAAC,CAAC,CAAC;EA2M9C"}
|
package/dist/index.cjs
CHANGED
|
@@ -317,7 +317,7 @@ const _sfc_main$1k = /* @__PURE__ */ vue.defineComponent({
|
|
|
317
317
|
};
|
|
318
318
|
}
|
|
319
319
|
});
|
|
320
|
-
const Btn = /* @__PURE__ */ _export_sfc(_sfc_main$1k, [["__scopeId", "data-v-
|
|
320
|
+
const Btn = /* @__PURE__ */ _export_sfc(_sfc_main$1k, [["__scopeId", "data-v-bfc435b3"]]);
|
|
321
321
|
const _hoisted_1$17 = ["dismissable"];
|
|
322
322
|
const _hoisted_2$Q = { class: "m-0" };
|
|
323
323
|
const _sfc_main$1j = /* @__PURE__ */ vue.defineComponent({
|
|
@@ -10763,6 +10763,11 @@ function useSchemaField(options) {
|
|
|
10763
10763
|
}
|
|
10764
10764
|
return typeof field.$el === "object" ? field.$el : componentMap[field.$el] ?? field.$el ?? "div";
|
|
10765
10765
|
}
|
|
10766
|
+
function renderChild(child, slots) {
|
|
10767
|
+
if (typeof child === "string") return child;
|
|
10768
|
+
if (vue.isVNode(child)) return child;
|
|
10769
|
+
return renderField(child, slots);
|
|
10770
|
+
}
|
|
10766
10771
|
function renderField(field, slots) {
|
|
10767
10772
|
const Component = getComponent(field);
|
|
10768
10773
|
if (!Component) return null;
|
|
@@ -10842,17 +10847,24 @@ function useSchemaField(options) {
|
|
|
10842
10847
|
props2.class = classify(currentValue, rowData, fieldClass, props2.class);
|
|
10843
10848
|
const componentSlots = {};
|
|
10844
10849
|
if (children2 == null ? void 0 : children2.length) {
|
|
10845
|
-
componentSlots.default = () => children2.map((child) =>
|
|
10846
|
-
if (typeof child === "string") return child;
|
|
10847
|
-
return renderField(child, slots);
|
|
10848
|
-
}).filter(Boolean);
|
|
10850
|
+
componentSlots.default = () => children2.map((child) => renderChild(child, slots)).filter(Boolean);
|
|
10849
10851
|
}
|
|
10850
10852
|
if (isSlotValueComponent && transformedValue !== void 0) {
|
|
10851
10853
|
componentSlots.default = () => (transformedValue == null ? void 0 : transformedValue.toString()) || "";
|
|
10852
10854
|
}
|
|
10853
10855
|
if (fieldSlots) {
|
|
10854
10856
|
Object.entries(fieldSlots).forEach(([name, slot]) => {
|
|
10855
|
-
componentSlots[name] =
|
|
10857
|
+
componentSlots[name] = () => {
|
|
10858
|
+
if (Array.isArray(slot)) {
|
|
10859
|
+
return slot.map((schemaField) => renderField(schemaField, slots));
|
|
10860
|
+
} else if (vue.isVNode(slot)) {
|
|
10861
|
+
return slot;
|
|
10862
|
+
} else if (typeof slot === "function") {
|
|
10863
|
+
const slotFn = slot;
|
|
10864
|
+
return slotFn({ row: rowData, field });
|
|
10865
|
+
}
|
|
10866
|
+
return slot;
|
|
10867
|
+
};
|
|
10856
10868
|
});
|
|
10857
10869
|
}
|
|
10858
10870
|
const slotContent = field.id && (slots == null ? void 0 : slots[field.id]) ? slots[field.id]({ row: rowData, field }) : void 0;
|
|
@@ -15107,9 +15119,12 @@ const _sfc_main$S = /* @__PURE__ */ vue.defineComponent({
|
|
|
15107
15119
|
async function handleSubmit() {
|
|
15108
15120
|
var _a2;
|
|
15109
15121
|
try {
|
|
15122
|
+
if (formState.value === "submitting") return;
|
|
15123
|
+
formState.value = "submitting";
|
|
15110
15124
|
await ((_a2 = props2.onSubmit) == null ? void 0 : _a2.call(props2, formData.value));
|
|
15111
15125
|
initialFormData.value = structuredClone(formData.value);
|
|
15112
15126
|
formState.value = "success";
|
|
15127
|
+
window.parent.postMessage({ type: "BAGEL_FORM_SUCCESS", data: formData.value }, "*");
|
|
15113
15128
|
} catch (error) {
|
|
15114
15129
|
formState.value = "error";
|
|
15115
15130
|
}
|
|
@@ -15147,7 +15162,8 @@ const _sfc_main$S = /* @__PURE__ */ vue.defineComponent({
|
|
|
15147
15162
|
vue.renderSlot(_ctx.$slots, "submit", {
|
|
15148
15163
|
submit: handleSubmit,
|
|
15149
15164
|
isDirty: isDirty.value,
|
|
15150
|
-
validateForm
|
|
15165
|
+
validateForm,
|
|
15166
|
+
formState: formState.value
|
|
15151
15167
|
}),
|
|
15152
15168
|
formState.value === "success" ? vue.renderSlot(_ctx.$slots, "success", { key: 2 }) : vue.createCommentVNode("", true),
|
|
15153
15169
|
formState.value === "error" ? vue.renderSlot(_ctx.$slots, "error", { key: 3 }) : vue.createCommentVNode("", true)
|
|
@@ -42146,7 +42162,7 @@ const _hoisted_5$1 = {
|
|
|
42146
42162
|
};
|
|
42147
42163
|
const _hoisted_6$1 = ["onClick"];
|
|
42148
42164
|
const _hoisted_7$1 = ["onClick"];
|
|
42149
|
-
const _hoisted_8$1 = ["onMousedown", "onMouseover", "onFocusin", "onDblclick", "onKeydown"];
|
|
42165
|
+
const _hoisted_8$1 = ["tabindex", "onMousedown", "onMouseover", "onFocusin", "onDblclick", "onKeydown"];
|
|
42150
42166
|
const _hoisted_9$1 = ["value", "onInput"];
|
|
42151
42167
|
const _hoisted_10$1 = { class: "spreadsheet-cell spreadsheetCellPlaceHolder" };
|
|
42152
42168
|
const _hoisted_11$1 = {
|
|
@@ -42166,7 +42182,7 @@ const _hoisted_16 = {
|
|
|
42166
42182
|
};
|
|
42167
42183
|
const _hoisted_17 = ["onClick"];
|
|
42168
42184
|
const _hoisted_18 = ["onClick"];
|
|
42169
|
-
const _hoisted_19 = ["onMousedown", "onMouseover", "onFocusin", "onDblclick", "onKeydown"];
|
|
42185
|
+
const _hoisted_19 = ["tabindex", "onMousedown", "onMouseover", "onFocusin", "onDblclick", "onKeydown"];
|
|
42170
42186
|
const _hoisted_20 = ["value", "onInput"];
|
|
42171
42187
|
const _hoisted_21 = { class: "spreadsheet-cell spreadsheetCellPlaceHolder" };
|
|
42172
42188
|
const _hoisted_22 = {
|
|
@@ -42250,7 +42266,8 @@ const _sfc_main$5 = /* @__PURE__ */ vue.defineComponent({
|
|
|
42250
42266
|
format: (configuredColumn == null ? void 0 : configuredColumn.format) ?? "text",
|
|
42251
42267
|
width: configuredColumn == null ? void 0 : configuredColumn.width,
|
|
42252
42268
|
fixed: (configuredColumn == null ? void 0 : configuredColumn.fixed) ?? false,
|
|
42253
|
-
hidden: (configuredColumn == null ? void 0 : configuredColumn.hidden) ?? false
|
|
42269
|
+
hidden: (configuredColumn == null ? void 0 : configuredColumn.hidden) ?? false,
|
|
42270
|
+
defaultValue: configuredColumn == null ? void 0 : configuredColumn.defaultValue
|
|
42254
42271
|
};
|
|
42255
42272
|
});
|
|
42256
42273
|
});
|
|
@@ -42420,7 +42437,7 @@ const _sfc_main$5 = /* @__PURE__ */ vue.defineComponent({
|
|
|
42420
42437
|
if (column == null ? void 0 : column.locked) return;
|
|
42421
42438
|
saveState("cell");
|
|
42422
42439
|
const parsedValue = parseValueForFormat(newValue, column == null ? void 0 : column.format);
|
|
42423
|
-
localRows.value[rowIndex][key] = parsedValue;
|
|
42440
|
+
localRows.value[rowIndex][key] = parsedValue ?? (column == null ? void 0 : column.defaultValue) ?? ((column == null ? void 0 : column.format) === "boolean" ? false : "");
|
|
42424
42441
|
emitUpdate();
|
|
42425
42442
|
}
|
|
42426
42443
|
const fixedColumns = vue.computed(() => {
|
|
@@ -42432,7 +42449,11 @@ const _sfc_main$5 = /* @__PURE__ */ vue.defineComponent({
|
|
|
42432
42449
|
function createEmptyRow() {
|
|
42433
42450
|
const newRow = {};
|
|
42434
42451
|
columns.value.forEach((col) => {
|
|
42435
|
-
|
|
42452
|
+
if (col.defaultValue !== void 0) {
|
|
42453
|
+
newRow[col.key] = col.defaultValue;
|
|
42454
|
+
} else {
|
|
42455
|
+
newRow[col.key] = col.format === "boolean" ? false : "";
|
|
42456
|
+
}
|
|
42436
42457
|
});
|
|
42437
42458
|
return newRow;
|
|
42438
42459
|
}
|
|
@@ -42512,6 +42533,9 @@ const _sfc_main$5 = /* @__PURE__ */ vue.defineComponent({
|
|
|
42512
42533
|
const input = editInputRef.value.get(inputKey);
|
|
42513
42534
|
if (input) {
|
|
42514
42535
|
input.focus();
|
|
42536
|
+
if (initialKey !== void 0) {
|
|
42537
|
+
input.value = initialKey;
|
|
42538
|
+
}
|
|
42515
42539
|
}
|
|
42516
42540
|
});
|
|
42517
42541
|
}
|
|
@@ -42526,7 +42550,17 @@ const _sfc_main$5 = /* @__PURE__ */ vue.defineComponent({
|
|
|
42526
42550
|
}
|
|
42527
42551
|
editingCell.value = null;
|
|
42528
42552
|
editingOriginalValue.value = null;
|
|
42529
|
-
|
|
42553
|
+
}
|
|
42554
|
+
function handleStopEditingAndBlur(cancelled = false) {
|
|
42555
|
+
vue.nextTick(() => {
|
|
42556
|
+
stopEditing(cancelled);
|
|
42557
|
+
vue.nextTick(() => {
|
|
42558
|
+
const spreadsheet = document.querySelector(".spreadsheet");
|
|
42559
|
+
if (spreadsheet) {
|
|
42560
|
+
spreadsheet.focus();
|
|
42561
|
+
}
|
|
42562
|
+
});
|
|
42563
|
+
});
|
|
42530
42564
|
}
|
|
42531
42565
|
window.addEventListener("mouseup", handleMouseUp);
|
|
42532
42566
|
function selectEntireRow(rowIndex) {
|
|
@@ -42679,7 +42713,7 @@ const _sfc_main$5 = /* @__PURE__ */ vue.defineComponent({
|
|
|
42679
42713
|
locked: !isCellEditable(col.key)
|
|
42680
42714
|
}),
|
|
42681
42715
|
style: vue.normalizeStyle({ width: col.width }),
|
|
42682
|
-
tabindex:
|
|
42716
|
+
tabindex: col.hidden ? void 0 : 0,
|
|
42683
42717
|
onMousedown: ($event) => handleMouseDown(rowIndex, fixedColumns.value.indexOf(col)),
|
|
42684
42718
|
onMouseover: ($event) => handleMouseOver(rowIndex, fixedColumns.value.indexOf(col)),
|
|
42685
42719
|
onFocusin: ($event) => handleMouseOver(rowIndex, fixedColumns.value.indexOf(col)),
|
|
@@ -42693,12 +42727,11 @@ const _sfc_main$5 = /* @__PURE__ */ vue.defineComponent({
|
|
|
42693
42727
|
value: row[col.key],
|
|
42694
42728
|
type: "text",
|
|
42695
42729
|
class: "spreadsheet-input",
|
|
42696
|
-
autofocus: "",
|
|
42697
42730
|
onInput: (e) => updateCell(rowIndex, col.key, e.target.value),
|
|
42698
|
-
onBlur: _cache[1] || (_cache[1] = ($event) =>
|
|
42731
|
+
onBlur: _cache[1] || (_cache[1] = ($event) => handleStopEditingAndBlur(false)),
|
|
42699
42732
|
onKeydown: [
|
|
42700
|
-
_cache[2] || (_cache[2] = vue.withKeys(vue.withModifiers(($event) =>
|
|
42701
|
-
_cache[3] || (_cache[3] = vue.withKeys(vue.withModifiers(($event) =>
|
|
42733
|
+
_cache[2] || (_cache[2] = vue.withKeys(vue.withModifiers(($event) => handleStopEditingAndBlur(false), ["prevent"]), ["enter"])),
|
|
42734
|
+
_cache[3] || (_cache[3] = vue.withKeys(vue.withModifiers(($event) => handleStopEditingAndBlur(true), ["prevent"]), ["esc"]))
|
|
42702
42735
|
],
|
|
42703
42736
|
onMousedown: _cache[4] || (_cache[4] = vue.withModifiers(() => {
|
|
42704
42737
|
}, ["stop"]))
|
|
@@ -42763,7 +42796,7 @@ const _sfc_main$5 = /* @__PURE__ */ vue.defineComponent({
|
|
|
42763
42796
|
locked: !isCellEditable(col.key)
|
|
42764
42797
|
}),
|
|
42765
42798
|
style: vue.normalizeStyle({ width: col.width }),
|
|
42766
|
-
tabindex:
|
|
42799
|
+
tabindex: col.hidden ? void 0 : 0,
|
|
42767
42800
|
onMousedown: ($event) => handleMouseDown(rowIndex, fixedColumns.value.length + colIndex),
|
|
42768
42801
|
onMouseover: ($event) => handleMouseOver(rowIndex, fixedColumns.value.length + colIndex),
|
|
42769
42802
|
onFocusin: ($event) => handleMouseOver(rowIndex, fixedColumns.value.length + colIndex),
|
|
@@ -42777,12 +42810,11 @@ const _sfc_main$5 = /* @__PURE__ */ vue.defineComponent({
|
|
|
42777
42810
|
value: row[col.key],
|
|
42778
42811
|
type: "text",
|
|
42779
42812
|
class: "spreadsheet-input",
|
|
42780
|
-
autofocus: "",
|
|
42781
42813
|
onInput: (e) => updateCell(rowIndex, col.key, e.target.value),
|
|
42782
|
-
onBlur: _cache[6] || (_cache[6] = ($event) =>
|
|
42814
|
+
onBlur: _cache[6] || (_cache[6] = ($event) => handleStopEditingAndBlur(false)),
|
|
42783
42815
|
onKeydown: [
|
|
42784
|
-
_cache[7] || (_cache[7] = vue.withKeys(vue.withModifiers(($event) =>
|
|
42785
|
-
_cache[8] || (_cache[8] = vue.withKeys(vue.withModifiers(($event) =>
|
|
42816
|
+
_cache[7] || (_cache[7] = vue.withKeys(vue.withModifiers(($event) => handleStopEditingAndBlur(false), ["prevent"]), ["enter"])),
|
|
42817
|
+
_cache[8] || (_cache[8] = vue.withKeys(vue.withModifiers(($event) => handleStopEditingAndBlur(true), ["prevent"]), ["esc"]))
|
|
42786
42818
|
],
|
|
42787
42819
|
onMousedown: _cache[9] || (_cache[9] = vue.withModifiers(() => {
|
|
42788
42820
|
}, ["stop"]))
|
|
@@ -42829,7 +42861,7 @@ const _sfc_main$5 = /* @__PURE__ */ vue.defineComponent({
|
|
|
42829
42861
|
};
|
|
42830
42862
|
}
|
|
42831
42863
|
});
|
|
42832
|
-
const Index = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["__scopeId", "data-v-
|
|
42864
|
+
const Index = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["__scopeId", "data-v-784daa05"]]);
|
|
42833
42865
|
const _sfc_main$4 = /* @__PURE__ */ vue.defineComponent({
|
|
42834
42866
|
__name: "Title",
|
|
42835
42867
|
props: {
|
|
@@ -43697,7 +43729,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
43697
43729
|
return (_ctx, _cache) => {
|
|
43698
43730
|
return vue.openBlock(), vue.createBlock(vue.Transition, { name: "fade" }, {
|
|
43699
43731
|
default: vue.withCtx(() => {
|
|
43700
|
-
var _a2, _b, _c, _d, _e2, _f, _g, _h;
|
|
43732
|
+
var _a2, _b, _c, _d, _e2, _f, _g, _h, _i, _j;
|
|
43701
43733
|
return [
|
|
43702
43734
|
vue.unref(isOpen) ? (vue.openBlock(), vue.createElementBlock("div", {
|
|
43703
43735
|
key: 0,
|
|
@@ -43758,7 +43790,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
43758
43790
|
onClick: _cache[2] || (_cache[2] = ($event) => zoom.value++)
|
|
43759
43791
|
}, null, 8, ["disabled"])
|
|
43760
43792
|
])) : vue.createCommentVNode("", true),
|
|
43761
|
-
((_c = vue.unref(currentItem)) == null ? void 0 : _c.openFile) ? (vue.openBlock(), vue.createBlock(vue.unref(Btn), {
|
|
43793
|
+
((_c = vue.unref(currentItem)) == null ? void 0 : _c.openFile) && ((_d = vue.unref(currentItem)) == null ? void 0 : _d.src) ? (vue.openBlock(), vue.createBlock(vue.unref(Btn), {
|
|
43762
43794
|
key: 1,
|
|
43763
43795
|
class: "color-white",
|
|
43764
43796
|
round: "",
|
|
@@ -43766,10 +43798,10 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
43766
43798
|
flat: "",
|
|
43767
43799
|
iconEnd: "arrow_outward",
|
|
43768
43800
|
value: "Open File",
|
|
43769
|
-
href: (
|
|
43801
|
+
href: (_e2 = vue.unref(currentItem)) == null ? void 0 : _e2.src,
|
|
43770
43802
|
target: "_blank"
|
|
43771
43803
|
}, null, 8, ["href"])) : vue.createCommentVNode("", true),
|
|
43772
|
-
((
|
|
43804
|
+
((_f = vue.unref(currentItem)) == null ? void 0 : _f.download) && ((_g = vue.unref(currentItem)) == null ? void 0 : _g.src) ? (vue.openBlock(), vue.createBlock(vue.unref(Btn), {
|
|
43773
43805
|
key: 2,
|
|
43774
43806
|
class: "color-white",
|
|
43775
43807
|
round: "",
|
|
@@ -43777,10 +43809,10 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
43777
43809
|
flat: "",
|
|
43778
43810
|
icon: "download",
|
|
43779
43811
|
value: "Download File",
|
|
43780
|
-
href: upgradeHeaders((
|
|
43812
|
+
href: upgradeHeaders((_h = vue.unref(currentItem)) == null ? void 0 : _h.src),
|
|
43781
43813
|
download: ""
|
|
43782
43814
|
}, null, 8, ["href"])) : vue.createCommentVNode("", true),
|
|
43783
|
-
!((
|
|
43815
|
+
!((_i = vue.unref(currentItem)) == null ? void 0 : _i.openFile) && !((_j = vue.unref(currentItem)) == null ? void 0 : _j.download) ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_4)) : vue.createCommentVNode("", true)
|
|
43784
43816
|
]),
|
|
43785
43817
|
vue.createVNode(vue.unref(Carousel), {
|
|
43786
43818
|
index: vue.unref(currentIndex),
|
|
@@ -43805,18 +43837,19 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
43805
43837
|
vue.createVNode(vue.unref(Image$1), {
|
|
43806
43838
|
draggable: false,
|
|
43807
43839
|
src: item == null ? void 0 : item.src,
|
|
43840
|
+
pathKey: item == null ? void 0 : item.pathKey,
|
|
43808
43841
|
alt: "Preview",
|
|
43809
43842
|
class: "vw90 lightbox-image"
|
|
43810
|
-
}, null, 8, ["src"])
|
|
43843
|
+
}, null, 8, ["src", "pathKey"])
|
|
43811
43844
|
]),
|
|
43812
43845
|
_: 2
|
|
43813
|
-
}, 1032, ["zoom", "disabled"])) : (item == null ? void 0 : item.type) === "video" ? (vue.openBlock(), vue.createBlock(vue.unref(BglVideo), {
|
|
43846
|
+
}, 1032, ["zoom", "disabled"])) : (item == null ? void 0 : item.type) === "video" && (item == null ? void 0 : item.src) ? (vue.openBlock(), vue.createBlock(vue.unref(BglVideo), {
|
|
43814
43847
|
key: 1,
|
|
43815
43848
|
src: item == null ? void 0 : item.src,
|
|
43816
43849
|
autoplay: "",
|
|
43817
43850
|
controls: "",
|
|
43818
43851
|
class: "vw90"
|
|
43819
|
-
}, null, 8, ["src"])) : (item == null ? void 0 : item.type) === "pdf" ? (vue.openBlock(), vue.createElementBlock("embed", {
|
|
43852
|
+
}, null, 8, ["src"])) : (item == null ? void 0 : item.type) === "pdf" && (item == null ? void 0 : item.src) ? (vue.openBlock(), vue.createElementBlock("embed", {
|
|
43820
43853
|
key: 2,
|
|
43821
43854
|
src: vue.unref(normalizeURL)(item == null ? void 0 : item.src),
|
|
43822
43855
|
type: "application/pdf",
|
|
@@ -43888,7 +43921,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
43888
43921
|
};
|
|
43889
43922
|
}
|
|
43890
43923
|
});
|
|
43891
|
-
const Lightbox$1 = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-
|
|
43924
|
+
const Lightbox$1 = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-194584ac"]]);
|
|
43892
43925
|
const groups = {};
|
|
43893
43926
|
let clickHandler = (_e2) => void 0;
|
|
43894
43927
|
const lightboxDirective = {
|
|
@@ -44287,7 +44320,8 @@ function findBglFieldById(id, _schema) {
|
|
|
44287
44320
|
for (const field of _schema) {
|
|
44288
44321
|
if (field.id === id) return field;
|
|
44289
44322
|
if (field.children && Number(field.children.length) > 0) {
|
|
44290
|
-
const
|
|
44323
|
+
const fieldChildren = field.children.filter((c2) => typeof c2 === "object" && "$el" in c2);
|
|
44324
|
+
const child = findBglFieldById(id, fieldChildren);
|
|
44291
44325
|
if (child) return child;
|
|
44292
44326
|
}
|
|
44293
44327
|
}
|