@bagelink/vue 0.0.564 → 0.0.566

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.
Files changed (51) hide show
  1. package/dist/components/DataPreview.vue.d.ts.map +1 -1
  2. package/dist/components/MaterialIcon.vue.d.ts +2 -0
  3. package/dist/components/MaterialIcon.vue.d.ts.map +1 -1
  4. package/dist/components/TableSchema.vue.d.ts +34 -21
  5. package/dist/components/TableSchema.vue.d.ts.map +1 -1
  6. package/dist/components/form/BglForm.vue.d.ts.map +1 -1
  7. package/dist/components/form/inputs/CheckInput.vue.d.ts +21 -11
  8. package/dist/components/form/inputs/CheckInput.vue.d.ts.map +1 -1
  9. package/dist/components/form/inputs/DateInput.vue.d.ts +2 -0
  10. package/dist/components/form/inputs/DateInput.vue.d.ts.map +1 -1
  11. package/dist/components/form/inputs/FileUpload.vue.d.ts +31 -41
  12. package/dist/components/form/inputs/FileUpload.vue.d.ts.map +1 -1
  13. package/dist/components/form/inputs/RadioPillsInput.vue.d.ts +1 -1
  14. package/dist/components/form/inputs/RadioPillsInput.vue.d.ts.map +1 -1
  15. package/dist/components/form/inputs/TelInput.vue.d.ts +11 -11
  16. package/dist/components/form/inputs/TelInput.vue.d.ts.map +1 -1
  17. package/dist/components/form/inputs/ToggleInput.vue.d.ts +18 -3
  18. package/dist/components/form/inputs/ToggleInput.vue.d.ts.map +1 -1
  19. package/dist/components/layout/TabbedLayout.vue.d.ts.map +1 -1
  20. package/dist/composables/index.d.ts +10 -0
  21. package/dist/composables/index.d.ts.map +1 -0
  22. package/dist/index.cjs +608 -195
  23. package/dist/index.d.ts +1 -0
  24. package/dist/index.d.ts.map +1 -1
  25. package/dist/index.mjs +609 -196
  26. package/dist/style.css +262 -119
  27. package/dist/types/BagelForm.d.ts +1 -0
  28. package/dist/types/BagelForm.d.ts.map +1 -1
  29. package/dist/utils/index.d.ts +3 -2
  30. package/dist/utils/index.d.ts.map +1 -1
  31. package/package.json +15 -14
  32. package/src/components/Btn.vue +1 -1
  33. package/src/components/DataPreview.vue +12 -13
  34. package/src/components/MapEmbed.vue +2 -2
  35. package/src/components/MaterialIcon.vue +7 -3
  36. package/src/components/TableSchema.vue +283 -104
  37. package/src/components/form/BglFieldSet.vue +0 -2
  38. package/src/components/form/BglForm.vue +2 -4
  39. package/src/components/form/inputs/CheckInput.vue +13 -6
  40. package/src/components/form/inputs/DateInput.vue +2 -0
  41. package/src/components/form/inputs/FileUpload.vue +63 -47
  42. package/src/components/form/inputs/ToggleInput.vue +22 -5
  43. package/src/components/layout/TabbedLayout.vue +1 -1
  44. package/src/composables/index.ts +24 -0
  45. package/src/index.ts +1 -0
  46. package/src/styles/layout.css +24 -0
  47. package/src/styles/mobilLayout.css +23 -0
  48. package/src/styles/text.css +0 -2
  49. package/src/styles/theme.css +2 -1
  50. package/src/types/BagelForm.ts +2 -0
  51. package/src/utils/index.ts +22 -2
package/dist/index.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  var __defProp2 = Object.defineProperty;
2
2
  var __defNormalProp2 = (obj, key, value) => key in obj ? __defProp2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3
3
  var __publicField2 = (obj, key, value) => __defNormalProp2(obj, typeof key !== "symbol" ? key + "" : key, value);
4
- import { pushScopeId, popScopeId, defineComponent, nextTick, openBlock, createBlock, createElementBlock, normalizeClass, renderSlot, normalizeProps, guardReactiveProps, withScopeId, resolveComponent, normalizeStyle, withKeys, createElementVNode, Fragment as Fragment$1, createCommentVNode, mergeProps, withCtx, createVNode, ref, createApp, h as h$2, toDisplayString, reactive, computed, inject, unref, renderList, resolveDynamicComponent, useCssVars, useSlots, withModifiers, createTextVNode, watch, onMounted, onUnmounted, mergeModels, useModel, createSlots, Transition, provide, isRef, withDirectives, vModelCheckbox, toRef, Teleport, render as render$f, onBeforeUpdate, vShow, getCurrentScope, onScopeDispose, TransitionGroup, vModelDynamic, vModelText, vModelRadio, onBeforeUnmount, getCurrentInstance, watchEffect, markRaw, customRef, resolveDirective } from "vue";
4
+ import { pushScopeId, popScopeId, defineComponent, nextTick, openBlock, createBlock, createElementBlock, normalizeClass, renderSlot, normalizeProps, guardReactiveProps, withScopeId, resolveComponent, normalizeStyle, withKeys, createElementVNode, Fragment as Fragment$1, createCommentVNode, mergeProps, withCtx, createVNode, ref, createApp, h as h$2, toDisplayString, reactive, computed, inject, unref, renderList, resolveDynamicComponent, useCssVars, useSlots, withModifiers, createTextVNode, watch, onMounted, onUnmounted, mergeModels, useModel, createSlots, Transition, getCurrentScope, onScopeDispose, getCurrentInstance, shallowRef, withDirectives, isRef, vModelCheckbox, provide, toRef, Teleport, render as render$f, onBeforeUpdate, vShow, TransitionGroup, vModelDynamic, vModelText, vModelRadio, onBeforeUnmount, watchEffect, markRaw, customRef, resolveDirective } from "vue";
5
5
  const sides = ["top", "right", "bottom", "left"];
6
6
  const alignments = ["start", "end"];
7
7
  const placements$1 = /* @__PURE__ */ sides.reduce((acc, side) => acc.concat(side, side + "-" + alignments[0], side + "-" + alignments[1]), []);
@@ -5282,8 +5282,23 @@ function iffer(field, itemData) {
5282
5282
  if (typeof field["v-if"] === "function") return (_a2 = field["v-if"]) == null ? void 0 : _a2.call(field, itemData == null ? void 0 : itemData[field.id], itemData);
5283
5283
  return true;
5284
5284
  }
5285
- const denullify = (itemData, fieldID) => fieldID && itemData ? itemData[fieldID] : null;
5285
+ function denullify(itemData, fieldID) {
5286
+ if (!fieldID) return null;
5287
+ return itemData ? itemData[fieldID] : null;
5288
+ }
5286
5289
  const isDate$1 = (dateToTest) => !Number.isNaN(Date.parse(dateToTest));
5290
+ function getFallbackSchema(data2, showFields) {
5291
+ const keys4 = [
5292
+ ...new Set((data2 ?? []).map(Object.keys).flat())
5293
+ ];
5294
+ const schema = keys4.map(
5295
+ (id) => ({
5296
+ id,
5297
+ label: keyToLabel(id)
5298
+ })
5299
+ );
5300
+ return showFields ? schema.filter((f2) => showFields.includes(f2.id) || !f2.id) : schema;
5301
+ }
5287
5302
  const bagelInjectionKey = Symbol("bagel");
5288
5303
  const i18nTInjectionKey = Symbol("bagel");
5289
5304
  function useBagel() {
@@ -5372,19 +5387,30 @@ const ModalPlugin = {
5372
5387
  app.component("ModalContainer", ModalComponent);
5373
5388
  }
5374
5389
  };
5390
+ function useBglSchema({ schema, showFields, data: data2 } = {}) {
5391
+ let _schema = schema;
5392
+ if (typeof _schema === "function") {
5393
+ _schema = _schema();
5394
+ }
5395
+ if (_schema) {
5396
+ return showFields && showFields.length ? _schema.filter((f2) => showFields.includes(f2.id)) : _schema;
5397
+ }
5398
+ return getFallbackSchema(data2, showFields);
5399
+ }
5375
5400
  const _sfc_main$O = /* @__PURE__ */ defineComponent({
5376
5401
  __name: "MaterialIcon",
5377
5402
  props: {
5378
5403
  icon: {},
5379
5404
  name: {},
5380
5405
  size: {},
5381
- color: {}
5406
+ color: {},
5407
+ weight: {}
5382
5408
  },
5383
5409
  setup(__props) {
5384
5410
  return (_ctx, _cache) => {
5385
- return openBlock(), createElementBlock("div", {
5411
+ return openBlock(), createElementBlock("span", {
5386
5412
  class: "bgl_icon-font",
5387
- style: normalizeStyle({ fontSize: `${_ctx.size}rem`, color: _ctx.color })
5413
+ style: normalizeStyle({ fontSize: `${_ctx.size}rem`, color: _ctx.color, "font-variation-settings": `'wght' ${_ctx.weight || 400}` })
5388
5414
  }, toDisplayString(_ctx.icon || _ctx.name), 5);
5389
5415
  };
5390
5416
  }
@@ -5393,7 +5419,7 @@ const _hoisted_1$J = { class: "full-nav" };
5393
5419
  const _hoisted_2$A = { class: "nav-scroll" };
5394
5420
  const _hoisted_3$n = { class: "nav-links-wrapper" };
5395
5421
  const _hoisted_4$f = { class: "tooltip" };
5396
- const _hoisted_5$c = { class: "bot-buttons-wrapper" };
5422
+ const _hoisted_5$d = { class: "bot-buttons-wrapper" };
5397
5423
  const _hoisted_6$8 = { class: "tooltip" };
5398
5424
  const _sfc_main$N = /* @__PURE__ */ defineComponent({
5399
5425
  __name: "NavBar",
@@ -5448,7 +5474,7 @@ const _sfc_main$N = /* @__PURE__ */ defineComponent({
5448
5474
  }), 128))
5449
5475
  ])
5450
5476
  ]),
5451
- createElementVNode("div", _hoisted_5$c, [
5477
+ createElementVNode("div", _hoisted_5$d, [
5452
5478
  (openBlock(true), createElementBlock(Fragment$1, null, renderList(_ctx.footerLinks, (link) => {
5453
5479
  return openBlock(), createBlock(resolveDynamicComponent(link.to ? "router-link" : "div"), {
5454
5480
  key: link.label,
@@ -5515,8 +5541,8 @@ const _sfc_main$M = /* @__PURE__ */ defineComponent({
5515
5541
  },
5516
5542
  setup(__props) {
5517
5543
  useCssVars((_ctx) => ({
5518
- "5113a6cf": computedBackgroundColor.value,
5519
- "ae07d62c": cumputedTextColor.value
5544
+ "39397c0e": computedBackgroundColor.value,
5545
+ "427e8569": cumputedTextColor.value
5520
5546
  }));
5521
5547
  const props2 = __props;
5522
5548
  const isComponent = computed(() => {
@@ -5605,7 +5631,7 @@ const _sfc_main$M = /* @__PURE__ */ defineComponent({
5605
5631
  };
5606
5632
  }
5607
5633
  });
5608
- const Btn = /* @__PURE__ */ _export_sfc(_sfc_main$M, [["__scopeId", "data-v-65a6e961"]]);
5634
+ const Btn = /* @__PURE__ */ _export_sfc(_sfc_main$M, [["__scopeId", "data-v-59ea4a90"]]);
5609
5635
  const _hoisted_1$H = {
5610
5636
  key: 0,
5611
5637
  class: "tool-bar"
@@ -5988,67 +6014,369 @@ const _sfc_main$G = /* @__PURE__ */ defineComponent({
5988
6014
  };
5989
6015
  }
5990
6016
  });
5991
- const _hoisted_1$C = { class: "table-list-wrap h-100" };
5992
- const _hoisted_2$t = { class: "infinite-wrapper" };
5993
- const _hoisted_3$j = { class: "row first-row" };
5994
- const _hoisted_4$d = ["onClick"];
5995
- const _hoisted_5$b = { class: "flex" };
5996
- const _hoisted_6$7 = ["onClick"];
5997
- const _hoisted_7$2 = { key: 1 };
6017
+ function tryOnScopeDispose(fn3) {
6018
+ if (getCurrentScope()) {
6019
+ onScopeDispose(fn3);
6020
+ return true;
6021
+ }
6022
+ return false;
6023
+ }
6024
+ function toValue(r2) {
6025
+ return typeof r2 === "function" ? r2() : unref(r2);
6026
+ }
6027
+ const isClient = typeof window !== "undefined" && typeof document !== "undefined";
6028
+ typeof WorkerGlobalScope !== "undefined" && globalThis instanceof WorkerGlobalScope;
6029
+ function getLifeCycleTarget(target) {
6030
+ return target || getCurrentInstance();
6031
+ }
6032
+ function tryOnMounted(fn3, sync = true, target) {
6033
+ const instance = getLifeCycleTarget();
6034
+ if (instance)
6035
+ onMounted(fn3, target);
6036
+ else if (sync)
6037
+ fn3();
6038
+ else
6039
+ nextTick(fn3);
6040
+ }
6041
+ function unrefElement(elRef) {
6042
+ var _a2;
6043
+ const plain = toValue(elRef);
6044
+ return (_a2 = plain == null ? void 0 : plain.$el) != null ? _a2 : plain;
6045
+ }
6046
+ const defaultWindow = isClient ? window : void 0;
6047
+ function useMounted() {
6048
+ const isMounted = ref(false);
6049
+ const instance = getCurrentInstance();
6050
+ if (instance) {
6051
+ onMounted(() => {
6052
+ isMounted.value = true;
6053
+ }, instance);
6054
+ }
6055
+ return isMounted;
6056
+ }
6057
+ function useSupported(callback) {
6058
+ const isMounted = useMounted();
6059
+ return computed(() => {
6060
+ isMounted.value;
6061
+ return Boolean(callback());
6062
+ });
6063
+ }
6064
+ function useResizeObserver(target, callback, options = {}) {
6065
+ const { window: window2 = defaultWindow, ...observerOptions } = options;
6066
+ let observer;
6067
+ const isSupported = useSupported(() => window2 && "ResizeObserver" in window2);
6068
+ const cleanup = () => {
6069
+ if (observer) {
6070
+ observer.disconnect();
6071
+ observer = void 0;
6072
+ }
6073
+ };
6074
+ const targets = computed(() => Array.isArray(target) ? target.map((el) => unrefElement(el)) : [unrefElement(target)]);
6075
+ const stopWatch = watch(
6076
+ targets,
6077
+ (els) => {
6078
+ cleanup();
6079
+ if (isSupported.value && window2) {
6080
+ observer = new ResizeObserver(callback);
6081
+ for (const _el of els)
6082
+ _el && observer.observe(_el, observerOptions);
6083
+ }
6084
+ },
6085
+ { immediate: true, flush: "post" }
6086
+ );
6087
+ const stop = () => {
6088
+ cleanup();
6089
+ stopWatch();
6090
+ };
6091
+ tryOnScopeDispose(stop);
6092
+ return {
6093
+ isSupported,
6094
+ stop
6095
+ };
6096
+ }
6097
+ function useElementSize(target, initialSize = { width: 0, height: 0 }, options = {}) {
6098
+ const { window: window2 = defaultWindow, box = "content-box" } = options;
6099
+ const isSVG = computed(() => {
6100
+ var _a2, _b;
6101
+ return (_b = (_a2 = unrefElement(target)) == null ? void 0 : _a2.namespaceURI) == null ? void 0 : _b.includes("svg");
6102
+ });
6103
+ const width = ref(initialSize.width);
6104
+ const height = ref(initialSize.height);
6105
+ const { stop: stop1 } = useResizeObserver(
6106
+ target,
6107
+ ([entry]) => {
6108
+ const boxSize = box === "border-box" ? entry.borderBoxSize : box === "content-box" ? entry.contentBoxSize : entry.devicePixelContentBoxSize;
6109
+ if (window2 && isSVG.value) {
6110
+ const $elem = unrefElement(target);
6111
+ if ($elem) {
6112
+ const rect = $elem.getBoundingClientRect();
6113
+ width.value = rect.width;
6114
+ height.value = rect.height;
6115
+ }
6116
+ } else {
6117
+ if (boxSize) {
6118
+ const formatBoxSize = Array.isArray(boxSize) ? boxSize : [boxSize];
6119
+ width.value = formatBoxSize.reduce((acc, { inlineSize }) => acc + inlineSize, 0);
6120
+ height.value = formatBoxSize.reduce((acc, { blockSize }) => acc + blockSize, 0);
6121
+ } else {
6122
+ width.value = entry.contentRect.width;
6123
+ height.value = entry.contentRect.height;
6124
+ }
6125
+ }
6126
+ },
6127
+ options
6128
+ );
6129
+ tryOnMounted(() => {
6130
+ const ele = unrefElement(target);
6131
+ if (ele) {
6132
+ width.value = "offsetWidth" in ele ? ele.offsetWidth : initialSize.width;
6133
+ height.value = "offsetHeight" in ele ? ele.offsetHeight : initialSize.height;
6134
+ }
6135
+ });
6136
+ const stop2 = watch(
6137
+ () => unrefElement(target),
6138
+ (ele) => {
6139
+ width.value = ele ? initialSize.width : 0;
6140
+ height.value = ele ? initialSize.height : 0;
6141
+ }
6142
+ );
6143
+ function stop() {
6144
+ stop1();
6145
+ stop2();
6146
+ }
6147
+ return {
6148
+ width,
6149
+ height,
6150
+ stop
6151
+ };
6152
+ }
6153
+ function useVirtualList(list, options) {
6154
+ const { containerStyle, wrapperProps, scrollTo, calculateRange, currentList, containerRef } = "itemHeight" in options ? useVerticalVirtualList(options, list) : useHorizontalVirtualList(options, list);
6155
+ return {
6156
+ list: currentList,
6157
+ scrollTo,
6158
+ containerProps: {
6159
+ ref: containerRef,
6160
+ onScroll: () => {
6161
+ calculateRange();
6162
+ },
6163
+ style: containerStyle
6164
+ },
6165
+ wrapperProps
6166
+ };
6167
+ }
6168
+ function useVirtualListResources(list) {
6169
+ const containerRef = ref(null);
6170
+ const size2 = useElementSize(containerRef);
6171
+ const currentList = ref([]);
6172
+ const source = shallowRef(list);
6173
+ const state2 = ref({ start: 0, end: 10 });
6174
+ return { state: state2, source, currentList, size: size2, containerRef };
6175
+ }
6176
+ function createGetViewCapacity(state2, source, itemSize) {
6177
+ return (containerSize) => {
6178
+ if (typeof itemSize === "number")
6179
+ return Math.ceil(containerSize / itemSize);
6180
+ const { start: start2 = 0 } = state2.value;
6181
+ let sum = 0;
6182
+ let capacity = 0;
6183
+ for (let i2 = start2; i2 < source.value.length; i2++) {
6184
+ const size2 = itemSize(i2);
6185
+ sum += size2;
6186
+ capacity = i2;
6187
+ if (sum > containerSize)
6188
+ break;
6189
+ }
6190
+ return capacity - start2;
6191
+ };
6192
+ }
6193
+ function createGetOffset(source, itemSize) {
6194
+ return (scrollDirection) => {
6195
+ if (typeof itemSize === "number")
6196
+ return Math.floor(scrollDirection / itemSize) + 1;
6197
+ let sum = 0;
6198
+ let offset2 = 0;
6199
+ for (let i2 = 0; i2 < source.value.length; i2++) {
6200
+ const size2 = itemSize(i2);
6201
+ sum += size2;
6202
+ if (sum >= scrollDirection) {
6203
+ offset2 = i2;
6204
+ break;
6205
+ }
6206
+ }
6207
+ return offset2 + 1;
6208
+ };
6209
+ }
6210
+ function createCalculateRange(type3, overscan, getOffset, getViewCapacity, { containerRef, state: state2, currentList, source }) {
6211
+ return () => {
6212
+ const element = containerRef.value;
6213
+ if (element) {
6214
+ const offset2 = getOffset(type3 === "vertical" ? element.scrollTop : element.scrollLeft);
6215
+ const viewCapacity = getViewCapacity(type3 === "vertical" ? element.clientHeight : element.clientWidth);
6216
+ const from2 = offset2 - overscan;
6217
+ const to2 = offset2 + viewCapacity + overscan;
6218
+ state2.value = {
6219
+ start: from2 < 0 ? 0 : from2,
6220
+ end: to2 > source.value.length ? source.value.length : to2
6221
+ };
6222
+ currentList.value = source.value.slice(state2.value.start, state2.value.end).map((ele, index2) => ({
6223
+ data: ele,
6224
+ index: index2 + state2.value.start
6225
+ }));
6226
+ }
6227
+ };
6228
+ }
6229
+ function createGetDistance(itemSize, source) {
6230
+ return (index2) => {
6231
+ if (typeof itemSize === "number") {
6232
+ const size22 = index2 * itemSize;
6233
+ return size22;
6234
+ }
6235
+ const size2 = source.value.slice(0, index2).reduce((sum, _2, i2) => sum + itemSize(i2), 0);
6236
+ return size2;
6237
+ };
6238
+ }
6239
+ function useWatchForSizes(size2, list, containerRef, calculateRange) {
6240
+ watch([size2.width, size2.height, list, containerRef], () => {
6241
+ calculateRange();
6242
+ });
6243
+ }
6244
+ function createComputedTotalSize(itemSize, source) {
6245
+ return computed(() => {
6246
+ if (typeof itemSize === "number")
6247
+ return source.value.length * itemSize;
6248
+ return source.value.reduce((sum, _2, index2) => sum + itemSize(index2), 0);
6249
+ });
6250
+ }
6251
+ const scrollToDictionaryForElementScrollKey = {
6252
+ horizontal: "scrollLeft",
6253
+ vertical: "scrollTop"
6254
+ };
6255
+ function createScrollTo(type3, calculateRange, getDistance, containerRef) {
6256
+ return (index2) => {
6257
+ if (containerRef.value) {
6258
+ containerRef.value[scrollToDictionaryForElementScrollKey[type3]] = getDistance(index2);
6259
+ calculateRange();
6260
+ }
6261
+ };
6262
+ }
6263
+ function useHorizontalVirtualList(options, list) {
6264
+ const resources = useVirtualListResources(list);
6265
+ const { state: state2, source, currentList, size: size2, containerRef } = resources;
6266
+ const containerStyle = { overflowX: "auto" };
6267
+ const { itemWidth, overscan = 5 } = options;
6268
+ const getViewCapacity = createGetViewCapacity(state2, source, itemWidth);
6269
+ const getOffset = createGetOffset(source, itemWidth);
6270
+ const calculateRange = createCalculateRange("horizontal", overscan, getOffset, getViewCapacity, resources);
6271
+ const getDistanceLeft = createGetDistance(itemWidth, source);
6272
+ const offsetLeft = computed(() => getDistanceLeft(state2.value.start));
6273
+ const totalWidth = createComputedTotalSize(itemWidth, source);
6274
+ useWatchForSizes(size2, list, containerRef, calculateRange);
6275
+ const scrollTo = createScrollTo("horizontal", calculateRange, getDistanceLeft, containerRef);
6276
+ const wrapperProps = computed(() => {
6277
+ return {
6278
+ style: {
6279
+ height: "100%",
6280
+ width: `${totalWidth.value - offsetLeft.value}px`,
6281
+ marginLeft: `${offsetLeft.value}px`,
6282
+ display: "flex"
6283
+ }
6284
+ };
6285
+ });
6286
+ return {
6287
+ scrollTo,
6288
+ calculateRange,
6289
+ wrapperProps,
6290
+ containerStyle,
6291
+ currentList,
6292
+ containerRef
6293
+ };
6294
+ }
6295
+ function useVerticalVirtualList(options, list) {
6296
+ const resources = useVirtualListResources(list);
6297
+ const { state: state2, source, currentList, size: size2, containerRef } = resources;
6298
+ const containerStyle = { overflowY: "auto" };
6299
+ const { itemHeight, overscan = 5 } = options;
6300
+ const getViewCapacity = createGetViewCapacity(state2, source, itemHeight);
6301
+ const getOffset = createGetOffset(source, itemHeight);
6302
+ const calculateRange = createCalculateRange("vertical", overscan, getOffset, getViewCapacity, resources);
6303
+ const getDistanceTop = createGetDistance(itemHeight, source);
6304
+ const offsetTop = computed(() => getDistanceTop(state2.value.start));
6305
+ const totalHeight = createComputedTotalSize(itemHeight, source);
6306
+ useWatchForSizes(size2, list, containerRef, calculateRange);
6307
+ const scrollTo = createScrollTo("vertical", calculateRange, getDistanceTop, containerRef);
6308
+ const wrapperProps = computed(() => {
6309
+ return {
6310
+ style: {
6311
+ width: "100%",
6312
+ height: `${totalHeight.value - offsetTop.value}px`,
6313
+ marginTop: `${offsetTop.value}px`
6314
+ }
6315
+ };
6316
+ });
6317
+ return {
6318
+ calculateRange,
6319
+ scrollTo,
6320
+ containerStyle,
6321
+ wrapperProps,
6322
+ currentList,
6323
+ containerRef
6324
+ };
6325
+ }
6326
+ const _withScopeId$3 = (n2) => (pushScopeId("data-v-73d79ea6"), n2 = n2(), popScopeId(), n2);
6327
+ const _hoisted_1$C = {
6328
+ key: 0,
6329
+ class: "loading-table-wrapper z-99 h-100 w-100 absolute inset"
6330
+ };
6331
+ const _hoisted_2$t = /* @__PURE__ */ _withScopeId$3(() => /* @__PURE__ */ createElementVNode("div", { class: "loading-table-animation absolute oval" }, null, -1));
6332
+ const _hoisted_3$j = [
6333
+ _hoisted_2$t
6334
+ ];
6335
+ const _hoisted_4$d = { class: "infinite-wrapper" };
6336
+ const _hoisted_5$c = { class: "row first-row" };
6337
+ const _hoisted_6$7 = { key: 0 };
6338
+ const _hoisted_7$2 = ["onClick"];
6339
+ const _hoisted_8$1 = { class: "flex" };
6340
+ const _hoisted_9$1 = ["onClick"];
6341
+ const _hoisted_10$1 = { key: 0 };
6342
+ const _hoisted_11$1 = ["value"];
6343
+ const _hoisted_12$1 = { key: 1 };
5998
6344
  const _sfc_main$F = /* @__PURE__ */ defineComponent({
5999
6345
  __name: "TableSchema",
6000
- props: {
6346
+ props: /* @__PURE__ */ mergeModels({
6001
6347
  selectedItems: {},
6002
6348
  data: {},
6003
6349
  schema: { type: Function },
6004
6350
  showFields: {}
6005
- },
6006
- emits: ["update:selectedItems", "orderBy", "select"],
6351
+ }, {
6352
+ "loading": { default: false },
6353
+ "loadingModifiers": {},
6354
+ "itemHeight": { default: 50 },
6355
+ "itemHeightModifiers": {}
6356
+ }),
6357
+ emits: /* @__PURE__ */ mergeModels(["update:selectedItems", "orderBy", "select"], ["update:loading", "update:itemHeight"]),
6007
6358
  setup(__props, { emit: __emit }) {
6359
+ useCssVars((_ctx) => ({
6360
+ "59d71ad2": unref(computedItemHiehgt)
6361
+ }));
6008
6362
  const props2 = __props;
6009
6363
  const emit2 = __emit;
6010
6364
  const slots = useSlots();
6011
- const loading = ref(true);
6012
- let selectedItems = ref(props2.selectedItems || []);
6013
- computed({
6014
- get: () => selectedItems.value,
6015
- set: (value) => {
6016
- selectedItems.value = value;
6017
- emit2("update:selectedItems", value);
6018
- }
6019
- });
6020
- function selectElement(item) {
6021
- emit2("select", item);
6022
- }
6023
- let sortDirection = ref("ASC");
6365
+ const loading = useModel(__props, "loading");
6366
+ const itemHeight = useModel(__props, "itemHeight");
6367
+ const computedItemHiehgt = computed(() => `${itemHeight.value}px`);
6024
6368
  let sortField = ref("");
6369
+ let sortDirection = ref("ASC");
6370
+ let selectedItems = ref(props2.selectedItems || []);
6371
+ const isSelectable = computed(() => Array.isArray(props2.selectedItems));
6025
6372
  const computedSortField = computed(() => `_transformed_${sortField.value}`);
6026
- function getFallbackSchema() {
6027
- const keys4 = [
6028
- ...new Set((props2.data || []).map(Object.keys).flat())
6029
- ];
6030
- const schema = keys4.map((id) => ({
6031
- id,
6032
- label: keyToLabel(id)
6033
- }));
6034
- return props2.showFields ? schema.filter((f2) => {
6035
- var _a2;
6036
- return ((_a2 = props2.showFields) == null ? void 0 : _a2.includes(f2.id)) ?? !f2.id;
6037
- }) : schema;
6038
- }
6039
- const computedSchema = computed(() => {
6040
- let _schema = props2.schema;
6041
- if (typeof _schema === "function") {
6042
- _schema = _schema();
6043
- }
6044
- if (_schema) {
6045
- return props2.showFields ? _schema.filter((f2) => {
6046
- var _a2;
6047
- return (_a2 = props2.showFields) == null ? void 0 : _a2.includes(f2.id);
6048
- }) : _schema;
6049
- }
6050
- return getFallbackSchema();
6051
- });
6373
+ const computedSchema = computed(
6374
+ () => useBglSchema({
6375
+ schema: props2.schema,
6376
+ showFields: props2.showFields,
6377
+ data: props2.data
6378
+ })
6379
+ );
6052
6380
  function transform(rowData) {
6053
6381
  var _a2;
6054
6382
  const obj = { ...rowData };
@@ -6099,68 +6427,138 @@ const _sfc_main$F = /* @__PURE__ */ defineComponent({
6099
6427
  }
6100
6428
  emit2("orderBy", `${fieldname} ${sortDirection.value}`.trim());
6101
6429
  }
6430
+ const { list, containerProps, wrapperProps, scrollTo } = useVirtualList(
6431
+ computedData,
6432
+ {
6433
+ itemHeight: itemHeight.value,
6434
+ overscan: 10
6435
+ }
6436
+ );
6437
+ watch(
6438
+ () => computedData.value.length,
6439
+ (newLength, oldLength) => {
6440
+ if (newLength === oldLength) return;
6441
+ scrollTo(0);
6442
+ }
6443
+ );
6444
+ const allSelector = ref(null);
6445
+ let computedSelectedItems = computed({
6446
+ get: () => selectedItems.value,
6447
+ set: (value) => {
6448
+ selectedItems.value = value;
6449
+ emit2("update:selectedItems", value);
6450
+ updateAllSelectorState();
6451
+ }
6452
+ });
6453
+ function updateAllSelectorState() {
6454
+ if (!allSelector.value) return;
6455
+ const allSelected = computedData.value.length === computedSelectedItems.value.length && computedData.value.every((s2) => computedSelectedItems.value.includes(s2.id));
6456
+ allSelector.value.checked = allSelected;
6457
+ allSelector.value.indeterminate = !allSelected && computedSelectedItems.value.length > 0;
6458
+ }
6459
+ function toggleSelectItem(item) {
6460
+ if (!computedSelectedItems.value.length) {
6461
+ emit2("select", item);
6462
+ return;
6463
+ }
6464
+ const index2 = computedSelectedItems.value.indexOf(item.id);
6465
+ if (index2 > -1) {
6466
+ computedSelectedItems.value.splice(index2, 1);
6467
+ } else {
6468
+ computedSelectedItems.value.push(item.id);
6469
+ }
6470
+ }
6471
+ function toggleSelectAll(event) {
6472
+ const value = event.target.checked;
6473
+ computedSelectedItems.value = value ? computedData.value.map((d2) => d2.id) : [];
6474
+ }
6102
6475
  return (_ctx, _cache) => {
6103
- return openBlock(), createElementBlock("div", _hoisted_1$C, [
6104
- createElementVNode("table", _hoisted_2$t, [
6105
- createElementVNode("thead", _hoisted_3$j, [
6106
- (openBlock(true), createElementBlock(Fragment$1, null, renderList(computedSchema.value, (field) => {
6107
- return openBlock(), createElementBlock("th", {
6108
- key: field.id,
6109
- class: "col",
6110
- onClick: ($event) => sort2((field == null ? void 0 : field.id) || "")
6111
- }, [
6112
- createElementVNode("div", _hoisted_5$b, [
6113
- createTextVNode(toDisplayString(field.label || unref(keyToLabel)(field.id)) + " ", 1),
6114
- createElementVNode("div", {
6115
- class: normalizeClass(["list-arrows", { sorted: unref(sortField) === field.id }])
6116
- }, [
6117
- createVNode(unref(_sfc_main$O), {
6118
- class: normalizeClass({ desc: unref(sortDirection) === "DESC" }),
6119
- icon: "keyboard_arrow_up"
6120
- }, null, 8, ["class"])
6121
- ], 2)
6122
- ])
6123
- ], 8, _hoisted_4$d);
6124
- }), 128))
6125
- ]),
6126
- createElementVNode("tbody", {
6127
- ref: "infinite",
6128
- class: normalizeClass(["rows infinite", { loading: loading.value }])
6129
- }, [
6130
- (openBlock(true), createElementBlock(Fragment$1, null, renderList(computedData.value, (row) => {
6131
- return openBlock(), createElementBlock("tr", {
6132
- key: row.id,
6133
- class: "row row-item position-relative",
6134
- onClick: ($event) => selectElement(row)
6135
- }, [
6136
- (openBlock(true), createElementBlock(Fragment$1, null, renderList(computedSchema.value, (field) => {
6137
- return openBlock(), createElementBlock("td", {
6138
- key: `${field.id}-${row.id}`,
6139
- class: "col"
6140
- }, [
6141
- field.id && unref(slots)[field.id] ? renderSlot(_ctx.$slots, field.id, {
6142
- key: 0,
6143
- row,
6144
- field
6145
- }, void 0, true) : (openBlock(), createElementBlock("div", _hoisted_7$2, [
6146
- createVNode(unref(_sfc_main$p), {
6147
- class: "embedded-field",
6148
- field,
6149
- modelValue: row,
6150
- label: ""
6151
- }, null, 8, ["field", "modelValue"])
6152
- ]))
6153
- ]);
6154
- }), 128))
6155
- ], 8, _hoisted_6$7);
6156
- }), 128))
6157
- ], 2)
6158
- ])
6159
- ]);
6476
+ return openBlock(), createElementBlock("div", mergeProps({ class: "table-list-wrap h-100" }, unref(containerProps), {
6477
+ class: { "loading-table": loading.value }
6478
+ }), [
6479
+ loading.value ? (openBlock(), createElementBlock("div", _hoisted_1$C, _hoisted_3$j)) : (openBlock(), createElementBlock("div", normalizeProps(mergeProps({ key: 1 }, unref(wrapperProps))), [
6480
+ createElementVNode("table", _hoisted_4$d, [
6481
+ createElementVNode("thead", _hoisted_5$c, [
6482
+ unref(isSelectable) ? (openBlock(), createElementBlock("th", _hoisted_6$7, [
6483
+ createElementVNode("input", {
6484
+ ref_key: "allSelector",
6485
+ ref: allSelector,
6486
+ type: "checkbox",
6487
+ onClick: _cache[0] || (_cache[0] = withModifiers(() => {
6488
+ }, ["stop"])),
6489
+ onChange: toggleSelectAll
6490
+ }, null, 544)
6491
+ ])) : createCommentVNode("", true),
6492
+ (openBlock(true), createElementBlock(Fragment$1, null, renderList(unref(computedSchema), (field) => {
6493
+ return openBlock(), createElementBlock("th", {
6494
+ key: field.id,
6495
+ class: "col",
6496
+ onClick: ($event) => sort2((field == null ? void 0 : field.id) || "")
6497
+ }, [
6498
+ createElementVNode("div", _hoisted_8$1, [
6499
+ createTextVNode(toDisplayString(field.label || unref(keyToLabel)(field.id)) + " ", 1),
6500
+ createElementVNode("div", {
6501
+ class: normalizeClass(["list-arrows", { sorted: unref(sortField) === field.id }])
6502
+ }, [
6503
+ createVNode(unref(_sfc_main$O), {
6504
+ class: normalizeClass({ desc: unref(sortDirection) === "DESC" }),
6505
+ icon: "keyboard_arrow_up"
6506
+ }, null, 8, ["class"])
6507
+ ], 2)
6508
+ ])
6509
+ ], 8, _hoisted_7$2);
6510
+ }), 128))
6511
+ ]),
6512
+ createElementVNode("tbody", null, [
6513
+ (openBlock(true), createElementBlock(Fragment$1, null, renderList(unref(list), ({ data: row }) => {
6514
+ return openBlock(), createElementBlock("tr", {
6515
+ key: row.id,
6516
+ class: normalizeClass(["row row-item position-relative", { selected: unref(computedSelectedItems).includes(row.id) }]),
6517
+ onClick: ($event) => toggleSelectItem(row)
6518
+ }, [
6519
+ unref(isSelectable) ? (openBlock(), createElementBlock("td", _hoisted_10$1, [
6520
+ createElementVNode("div", {
6521
+ onClick: _cache[2] || (_cache[2] = withModifiers(() => {
6522
+ }, ["stop"]))
6523
+ }, [
6524
+ withDirectives(createElementVNode("input", {
6525
+ "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => isRef(computedSelectedItems) ? computedSelectedItems.value = $event : computedSelectedItems = $event),
6526
+ type: "checkbox",
6527
+ value: row.id
6528
+ }, null, 8, _hoisted_11$1), [
6529
+ [vModelCheckbox, unref(computedSelectedItems)]
6530
+ ])
6531
+ ])
6532
+ ])) : createCommentVNode("", true),
6533
+ (openBlock(true), createElementBlock(Fragment$1, null, renderList(unref(computedSchema), (field) => {
6534
+ return openBlock(), createElementBlock("td", {
6535
+ key: `${field.id}-${row.id}`,
6536
+ class: "col"
6537
+ }, [
6538
+ field.id && unref(slots)[field.id] ? renderSlot(_ctx.$slots, field.id, {
6539
+ key: 0,
6540
+ row,
6541
+ field
6542
+ }, void 0, true) : (openBlock(), createElementBlock("div", _hoisted_12$1, [
6543
+ createVNode(unref(_sfc_main$p), {
6544
+ class: "embedded-field",
6545
+ field,
6546
+ modelValue: row,
6547
+ label: ""
6548
+ }, null, 8, ["field", "modelValue"])
6549
+ ]))
6550
+ ]);
6551
+ }), 128))
6552
+ ], 10, _hoisted_9$1);
6553
+ }), 128))
6554
+ ])
6555
+ ])
6556
+ ], 16))
6557
+ ], 16);
6160
6558
  };
6161
6559
  }
6162
6560
  });
6163
- const TableSchema = /* @__PURE__ */ _export_sfc(_sfc_main$F, [["__scopeId", "data-v-1628cf1a"]]);
6561
+ const TableSchema = /* @__PURE__ */ _export_sfc(_sfc_main$F, [["__scopeId", "data-v-73d79ea6"]]);
6164
6562
  const _sfc_main$E = {};
6165
6563
  const _hoisted_1$B = { class: "flex space-between" };
6166
6564
  function _sfc_render$1(_ctx, _cache) {
@@ -6202,7 +6600,7 @@ const _hoisted_2$s = {
6202
6600
  };
6203
6601
  const _hoisted_3$i = { class: "key" };
6204
6602
  const _hoisted_4$c = { key: 1 };
6205
- const _hoisted_5$a = { class: "key" };
6603
+ const _hoisted_5$b = { class: "key" };
6206
6604
  const _hoisted_6$6 = { class: "vlue" };
6207
6605
  const _sfc_main$C = /* @__PURE__ */ defineComponent({
6208
6606
  __name: "DataPreview",
@@ -6218,16 +6616,12 @@ const _sfc_main$C = /* @__PURE__ */ defineComponent({
6218
6616
  setup(__props) {
6219
6617
  const props2 = __props;
6220
6618
  const itemData = useModel(__props, "data");
6221
- const computedSchema = computed(() => {
6222
- const schema = Object.keys(itemData.value);
6223
- if (props2.showFields && props2.showFields.length) {
6224
- return schema.filter((field) => {
6225
- var _a2;
6226
- return (_a2 = props2.showFields) == null ? void 0 : _a2.includes(field);
6227
- });
6228
- }
6229
- return schema;
6230
- });
6619
+ const computedSchema = computed(
6620
+ () => getFallbackSchema(
6621
+ [itemData.value],
6622
+ props2.showFields
6623
+ )
6624
+ );
6231
6625
  return (_ctx, _cache) => {
6232
6626
  var _a2;
6233
6627
  return __props.data ? (openBlock(), createElementBlock("div", _hoisted_1$A, [
@@ -6252,13 +6646,13 @@ const _sfc_main$C = /* @__PURE__ */ defineComponent({
6252
6646
  ], 64);
6253
6647
  }), 128)),
6254
6648
  !((_a2 = _ctx.schema) == null ? void 0 : _a2.length) ? (openBlock(), createElementBlock("div", _hoisted_4$c, [
6255
- (openBlock(true), createElementBlock(Fragment$1, null, renderList(computedSchema.value, (key) => {
6649
+ (openBlock(true), createElementBlock(Fragment$1, null, renderList(computedSchema.value, ({ id, label }) => {
6256
6650
  return openBlock(), createElementBlock("div", {
6257
- key,
6651
+ key: id,
6258
6652
  class: "data-row"
6259
6653
  }, [
6260
- createElementVNode("div", _hoisted_5$a, toDisplayString(unref(keyToLabel)(key)), 1),
6261
- createElementVNode("div", _hoisted_6$6, toDisplayString(itemData.value[key]), 1)
6654
+ createElementVNode("div", _hoisted_5$b, toDisplayString(label), 1),
6655
+ createElementVNode("div", _hoisted_6$6, toDisplayString(itemData.value[id ?? ""]), 1)
6262
6656
  ]);
6263
6657
  }), 128))
6264
6658
  ])) : createCommentVNode("", true),
@@ -6267,7 +6661,7 @@ const _sfc_main$C = /* @__PURE__ */ defineComponent({
6267
6661
  };
6268
6662
  }
6269
6663
  });
6270
- const DataPreview = /* @__PURE__ */ _export_sfc(_sfc_main$C, [["__scopeId", "data-v-078d6853"]]);
6664
+ const DataPreview = /* @__PURE__ */ _export_sfc(_sfc_main$C, [["__scopeId", "data-v-2281300f"]]);
6271
6665
  const _hoisted_1$z = {
6272
6666
  key: 0,
6273
6667
  class: "card_label"
@@ -16315,7 +16709,6 @@ const _sfc_main$s = /* @__PURE__ */ defineComponent({
16315
16709
  if (props2.address) {
16316
16710
  geocodeAddress(props2.address).catch(console.error);
16317
16711
  }
16318
- console.log(props2.zoomControl, props2.center);
16319
16712
  map4.value = L$1.map(id.value, {
16320
16713
  center: props2.center,
16321
16714
  zoom: props2.zoom,
@@ -16335,7 +16728,8 @@ const _sfc_main$s = /* @__PURE__ */ defineComponent({
16335
16728
  }
16336
16729
  async function geocodeAddress(address) {
16337
16730
  var _a2;
16338
- const geocodeUrl = `https://nominatim.openstreetmap.org/search?format=json&q=${encodeURIComponent(address)}`;
16731
+ const addressURL = address.replace(/\s+/g, "+");
16732
+ const geocodeUrl = `https://nominatim.openstreetmap.org/search?format=json&q=${encodeURI(addressURL)}`;
16339
16733
  const res = await fetch(geocodeUrl);
16340
16734
  const data2 = await res.json() || [];
16341
16735
  data2.forEach((element) => {
@@ -16620,16 +17014,20 @@ const _sfc_main$o = /* @__PURE__ */ defineComponent({
16620
17014
  id: {},
16621
17015
  title: {},
16622
17016
  small: { type: Boolean },
16623
- required: { type: Boolean }
17017
+ required: { type: Boolean },
17018
+ defaultValue: { type: Boolean, default: false }
16624
17019
  }, {
16625
- "modelValue": { type: Boolean, ...{ default: false } },
17020
+ "modelValue": { type: Boolean, ...{ default: void 0 } },
16626
17021
  "modelModifiers": {}
16627
17022
  }),
16628
17023
  emits: ["update:modelValue"],
16629
17024
  setup(__props) {
16630
17025
  const props2 = __props;
16631
- const inputId = ref(props2.id || Math.random().toString(36).substring(7));
17026
+ const inputId = computed(() => props2.id || Math.random().toString(36).substring(7));
16632
17027
  const checked = useModel(__props, "modelValue");
17028
+ onMounted(() => {
17029
+ if (checked.value === void 0) checked.value = props2.defaultValue;
17030
+ });
16633
17031
  return (_ctx, _cache) => {
16634
17032
  return openBlock(), createElementBlock("div", {
16635
17033
  class: normalizeClass(["bagel-input bgl-checkbox align-items-center ps-025", { small: _ctx.small }]),
@@ -16653,7 +17051,7 @@ const _sfc_main$o = /* @__PURE__ */ defineComponent({
16653
17051
  };
16654
17052
  }
16655
17053
  });
16656
- const CheckInput = /* @__PURE__ */ _export_sfc(_sfc_main$o, [["__scopeId", "data-v-ac068f18"]]);
17054
+ const CheckInput = /* @__PURE__ */ _export_sfc(_sfc_main$o, [["__scopeId", "data-v-e8fcfd5e"]]);
16657
17055
  function toDate(argument) {
16658
17056
  const argStr = Object.prototype.toString.call(argument);
16659
17057
  if (argument instanceof Date || typeof argument === "object" && argStr === "[object Date]") {
@@ -25108,6 +25506,7 @@ const _hoisted_2$m = { key: 0 };
25108
25506
  const _sfc_main$n = /* @__PURE__ */ defineComponent({
25109
25507
  __name: "DateInput",
25110
25508
  props: {
25509
+ required: { type: Boolean },
25111
25510
  label: {},
25112
25511
  editMode: { type: Boolean, default: true },
25113
25512
  small: { type: Boolean, default: false },
@@ -25152,6 +25551,7 @@ const _sfc_main$n = /* @__PURE__ */ defineComponent({
25152
25551
  ref: datePicker,
25153
25552
  modelValue: date2.value,
25154
25553
  "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => date2.value = $event),
25554
+ required: _ctx.required,
25155
25555
  "auto-apply": true,
25156
25556
  "enable-time-picker": _ctx.enableTime,
25157
25557
  "allowed-dates": _ctx.allowedDates
@@ -25160,7 +25560,7 @@ const _sfc_main$n = /* @__PURE__ */ defineComponent({
25160
25560
  "minutes-increment": _ctx.minutesIncrement,
25161
25561
  "minutes-grid-increment": _ctx.minutesGridIncrement,
25162
25562
  "start-time": { hours: 8, minutes: 0 }
25163
- }), null, 16, ["modelValue", "enable-time-picker", "allowed-dates", "time-picker-inline", "minutes-increment", "minutes-grid-increment"])
25563
+ }), null, 16, ["modelValue", "required", "enable-time-picker", "allowed-dates", "time-picker-inline", "minutes-increment", "minutes-grid-increment"])
25164
25564
  ], 10, _hoisted_1$s);
25165
25565
  };
25166
25566
  }
@@ -27905,7 +28305,7 @@ const _hoisted_1$p = ["title"];
27905
28305
  const _hoisted_2$j = { class: "bagel-input" };
27906
28306
  const _hoisted_3$e = { class: "table-side-scroll" };
27907
28307
  const _hoisted_4$a = { class: "table-header" };
27908
- const _hoisted_5$9 = { class: "table-reorder" };
28308
+ const _hoisted_5$a = { class: "table-reorder" };
27909
28309
  const _hoisted_6$5 = { class: "table-action" };
27910
28310
  const _sfc_main$k = /* @__PURE__ */ defineComponent({
27911
28311
  __name: "TableField",
@@ -28003,7 +28403,7 @@ const _sfc_main$k = /* @__PURE__ */ defineComponent({
28003
28403
  key: row.id,
28004
28404
  class: "flex table-row"
28005
28405
  }, [
28006
- createElementVNode("div", _hoisted_5$9, [
28406
+ createElementVNode("div", _hoisted_5$a, [
28007
28407
  createVNode(unref(_sfc_main$O), { icon: "more_vert" })
28008
28408
  ]),
28009
28409
  (openBlock(true), createElementBlock(Fragment$1, null, renderList((_a3 = unref(entityMeta)) == null ? void 0 : _a3.fields, (field) => {
@@ -28056,7 +28456,7 @@ const _hoisted_1$o = ["title"];
28056
28456
  const _hoisted_2$i = ["for"];
28057
28457
  const _hoisted_3$d = ["id", "title", "autocomplete", "type", "placeholder", "disabled", "required", "pattern"];
28058
28458
  const _hoisted_4$9 = ["id", "title", "type", "rows", "placeholder", "disabled", "required", "pattern"];
28059
- const _hoisted_5$8 = { key: 2 };
28459
+ const _hoisted_5$9 = { key: 2 };
28060
28460
  const _sfc_main$j = /* @__PURE__ */ defineComponent({
28061
28461
  __name: "TextInput",
28062
28462
  props: {
@@ -28162,7 +28562,7 @@ const _sfc_main$j = /* @__PURE__ */ defineComponent({
28162
28562
  }, _ctx.nativeInputAttrs, { onInput: updateInputVal }), null, 16, _hoisted_4$9)), [
28163
28563
  [vModelText, unref(inputVal)]
28164
28564
  ]),
28165
- _ctx.helptext ? (openBlock(), createElementBlock("p", _hoisted_5$8, toDisplayString(_ctx.helptext), 1)) : createCommentVNode("", true)
28565
+ _ctx.helptext ? (openBlock(), createElementBlock("p", _hoisted_5$9, toDisplayString(_ctx.helptext), 1)) : createCommentVNode("", true)
28166
28566
  ], 8, _hoisted_2$i),
28167
28567
  _ctx.iconStart ? (openBlock(), createBlock(unref(_sfc_main$O), {
28168
28568
  key: 0,
@@ -28262,7 +28662,7 @@ const _hoisted_3$c = {
28262
28662
  class: "time-wrap"
28263
28663
  };
28264
28664
  const _hoisted_4$8 = ["id", "name", "value"];
28265
- const _hoisted_5$7 = ["for"];
28665
+ const _hoisted_5$8 = ["for"];
28266
28666
  const _sfc_main$g = /* @__PURE__ */ defineComponent({
28267
28667
  __name: "DatePicker",
28268
28668
  props: {
@@ -28325,7 +28725,7 @@ const _sfc_main$g = /* @__PURE__ */ defineComponent({
28325
28725
  ]),
28326
28726
  createElementVNode("label", {
28327
28727
  for: `${hr2}_${_ctx.id}`
28328
- }, toDisplayString(hr2), 9, _hoisted_5$7)
28728
+ }, toDisplayString(hr2), 9, _hoisted_5$8)
28329
28729
  ], 64);
28330
28730
  }), 128))
28331
28731
  ])) : createCommentVNode("", true)
@@ -28337,7 +28737,7 @@ const _hoisted_1$k = { class: "bagel-input" };
28337
28737
  const _hoisted_2$f = { class: "pb-025" };
28338
28738
  const _hoisted_3$b = { class: "flex gap-05 flex-wrap" };
28339
28739
  const _hoisted_4$7 = ["id", "name", "value", "checked"];
28340
- const _hoisted_5$6 = ["for"];
28740
+ const _hoisted_5$7 = ["for"];
28341
28741
  const _sfc_main$f = /* @__PURE__ */ defineComponent({
28342
28742
  __name: "RadioPillsInput",
28343
28743
  props: {
@@ -28397,7 +28797,7 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
28397
28797
  }, null, 40, _hoisted_4$7),
28398
28798
  createElementVNode("label", {
28399
28799
  for: `${_ctx.id}-${getValue(option2)}`
28400
- }, toDisplayString(getLabel(option2)), 9, _hoisted_5$6)
28800
+ }, toDisplayString(getLabel(option2)), 9, _hoisted_5$7)
28401
28801
  ]);
28402
28802
  }), 128))
28403
28803
  ])
@@ -28406,7 +28806,7 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
28406
28806
  }
28407
28807
  });
28408
28808
  const RadioPillsInput = /* @__PURE__ */ _export_sfc(_sfc_main$f, [["__scopeId", "data-v-681173be"]]);
28409
- const _withScopeId$2 = (n2) => (pushScopeId("data-v-82316bcb"), n2 = n2(), popScopeId(), n2);
28809
+ const _withScopeId$2 = (n2) => (pushScopeId("data-v-1ce244aa"), n2 = n2(), popScopeId(), n2);
28410
28810
  const _hoisted_1$j = { class: "bagel-input" };
28411
28811
  const _hoisted_2$e = {
28412
28812
  key: 0,
@@ -28417,7 +28817,7 @@ const _hoisted_4$6 = {
28417
28817
  key: 1,
28418
28818
  class: "multi-image-item previewName"
28419
28819
  };
28420
- const _hoisted_5$5 = ["src"];
28820
+ const _hoisted_5$6 = ["src"];
28421
28821
  const _hoisted_6$4 = { class: "no-margin" };
28422
28822
  const _hoisted_7$1 = {
28423
28823
  key: 0,
@@ -28434,25 +28834,23 @@ const _hoisted_12 = {
28434
28834
  const _hoisted_13 = /* @__PURE__ */ _withScopeId$2(() => /* @__PURE__ */ createElementVNode("p", null, "Drop files here or click to upload", -1));
28435
28835
  const _sfc_main$e = /* @__PURE__ */ defineComponent({
28436
28836
  __name: "FileUpload",
28437
- props: /* @__PURE__ */ mergeModels({
28837
+ props: {
28438
28838
  label: {},
28439
28839
  multiple: { type: Boolean },
28440
28840
  files: {},
28441
28841
  deleteEndpoint: {},
28442
28842
  bindkey: {},
28843
+ modelValue: {},
28443
28844
  width: {}
28444
- }, {
28445
- "modelValue": {},
28446
- "modelModifiers": {}
28447
- }),
28845
+ },
28448
28846
  emits: ["update:modelValue"],
28449
- setup(__props) {
28847
+ setup(__props, { emit: __emit }) {
28450
28848
  const props2 = __props;
28451
28849
  const bagel = useBagel();
28452
28850
  const bindKey2 = props2.bindkey || "id";
28453
- const file_bindkeys = useModel(__props, "modelValue");
28851
+ const emit2 = __emit;
28852
+ let file_bindkeys = ref(props2.modelValue || []);
28454
28853
  const storageFiles = ref([]);
28455
- const compareIds = (v1, v2) => [v1].flat().join(",") === [v2].flat().join(",");
28456
28854
  onMounted(() => {
28457
28855
  if (!props2.files && [file_bindkeys.value].flat().length) {
28458
28856
  const ids = [file_bindkeys.value].flat().filter(Boolean);
@@ -28482,21 +28880,19 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
28482
28880
  },
28483
28881
  { immediate: true }
28484
28882
  );
28485
- watch(
28486
- () => storageFiles.value,
28487
- (newFiles) => {
28488
- let idValue;
28489
- if (props2.multiple) {
28490
- idValue = newFiles.map((f2) => f2[bindKey2]);
28491
- } else {
28492
- idValue = newFiles[0][bindKey2] || "";
28493
- }
28494
- if (!compareIds(file_bindkeys.value, idValue)) {
28495
- file_bindkeys.value = idValue;
28496
- }
28497
- },
28498
- { deep: true }
28499
- );
28883
+ function updateModelValue() {
28884
+ let idValue;
28885
+ if (props2.multiple) {
28886
+ idValue = storageFiles.value.map((f2) => f2[bindKey2]);
28887
+ } else {
28888
+ idValue = storageFiles.value[0][bindKey2] || "";
28889
+ }
28890
+ const isSame = [idValue].flat().every((id) => [file_bindkeys.value].flat().includes(id));
28891
+ if (!isSame) {
28892
+ file_bindkeys.value = idValue;
28893
+ emit2("update:modelValue", file_bindkeys.value);
28894
+ }
28895
+ }
28500
28896
  const fileQueue = ref([]);
28501
28897
  let isDragOver = ref(false);
28502
28898
  function preventDefault(e) {
@@ -28510,16 +28906,20 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
28510
28906
  if (props2.deleteEndpoint) {
28511
28907
  void bagel.delete(`${props2.deleteEndpoint}/${file.id}`);
28512
28908
  }
28909
+ updateModelValue();
28513
28910
  }
28514
- function flushQueue() {
28515
- fileQueue.value.forEach(async (file, i2) => {
28911
+ async function flushQueue() {
28912
+ for (const file of fileQueue.value) {
28913
+ file.uploading = true;
28516
28914
  if (!props2.multiple) storageFiles.value.splice(0, 1);
28517
28915
  const serverFile = await bagel.uploadFile(file.file, {
28518
28916
  onUploadProgress: (e) => file.progress = e.progress * 100 - 1
28519
28917
  });
28520
28918
  storageFiles.value.push(serverFile);
28919
+ const i2 = fileQueue.value.indexOf(file);
28521
28920
  fileQueue.value.splice(i2, 1);
28522
- });
28921
+ }
28922
+ updateModelValue();
28523
28923
  }
28524
28924
  function browse() {
28525
28925
  const input = document.createElement("input");
@@ -28528,7 +28928,9 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
28528
28928
  input.onchange = (e) => {
28529
28929
  const target = e.target;
28530
28930
  if (target.files) {
28531
- Array.from(target.files).forEach((file) => fileQueue.value.push({ name: file.name, file, progress: 0 }));
28931
+ Array.from(target.files).forEach(
28932
+ (file) => fileQueue.value.push({ name: file.name, file, progress: 0 })
28933
+ );
28532
28934
  }
28533
28935
  flushQueue();
28534
28936
  };
@@ -28547,7 +28949,9 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
28547
28949
  function drop3(e) {
28548
28950
  preventDefault(e);
28549
28951
  if (e.dataTransfer) {
28550
- Array.from(e.dataTransfer.files).forEach((file) => fileQueue.value.push({ name: file.name, file, progress: 0 }));
28952
+ Array.from(e.dataTransfer.files).forEach(
28953
+ (file) => fileQueue.value.push({ name: file.name, file, progress: 0 })
28954
+ );
28551
28955
  }
28552
28956
  isDragOver.value = false;
28553
28957
  flushQueue();
@@ -28585,7 +28989,7 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
28585
28989
  class: "preview",
28586
28990
  src: file.url,
28587
28991
  alt: ""
28588
- }, null, 8, _hoisted_5$5),
28992
+ }, null, 8, _hoisted_5$6),
28589
28993
  createElementVNode("p", _hoisted_6$4, toDisplayString(file.name), 1),
28590
28994
  createVNode(unref(Btn), {
28591
28995
  thin: "",
@@ -28642,14 +29046,15 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
28642
29046
  };
28643
29047
  }
28644
29048
  });
28645
- const $el = /* @__PURE__ */ _export_sfc(_sfc_main$e, [["__scopeId", "data-v-82316bcb"]]);
28646
- const _withScopeId$1 = (n2) => (pushScopeId("data-v-50198c44"), n2 = n2(), popScopeId(), n2);
29049
+ const $el = /* @__PURE__ */ _export_sfc(_sfc_main$e, [["__scopeId", "data-v-1ce244aa"]]);
29050
+ const _withScopeId$1 = (n2) => (pushScopeId("data-v-eceeebfb"), n2 = n2(), popScopeId(), n2);
28647
29051
  const _hoisted_1$i = ["title"];
28648
29052
  const _hoisted_2$d = /* @__PURE__ */ _withScopeId$1(() => /* @__PURE__ */ createElementVNode("span", { class: "slider round" }, null, -1));
28649
29053
  const _hoisted_3$9 = [
28650
29054
  _hoisted_2$d
28651
29055
  ];
28652
- const _hoisted_4$5 = ["id"];
29056
+ const _hoisted_4$5 = ["id", "required"];
29057
+ const _hoisted_5$5 = ["for"];
28653
29058
  const _sfc_main$d = /* @__PURE__ */ defineComponent({
28654
29059
  __name: "ToggleInput",
28655
29060
  props: /* @__PURE__ */ mergeModels({
@@ -28657,14 +29062,16 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
28657
29062
  id: {},
28658
29063
  title: {},
28659
29064
  small: { type: Boolean },
29065
+ required: { type: Boolean },
28660
29066
  defaultValue: { type: Boolean, default: false }
28661
29067
  }, {
28662
- "modelValue": { type: Boolean },
29068
+ "modelValue": { type: Boolean, ...{ default: void 0 } },
28663
29069
  "modelModifiers": {}
28664
29070
  }),
28665
29071
  emits: ["update:modelValue"],
28666
29072
  setup(__props) {
28667
29073
  const props2 = __props;
29074
+ const inputId = ref(props2.id || Math.random().toString(36).substring(7));
28668
29075
  const checked = useModel(__props, "modelValue");
28669
29076
  onMounted(() => {
28670
29077
  if (checked.value === void 0) checked.value = props2.defaultValue;
@@ -28672,26 +29079,30 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
28672
29079
  return (_ctx, _cache) => {
28673
29080
  return openBlock(), createElementBlock("div", {
28674
29081
  class: normalizeClass(["bagel-input bgl-checkbox justify-content-center gap-1", { small: _ctx.small }]),
28675
- title: _ctx.title
29082
+ title: _ctx.title,
29083
+ onClick: _cache[1] || (_cache[1] = withModifiers(($event) => checked.value = !checked.value, ["prevent"]))
28676
29084
  }, [
28677
29085
  createElementVNode("div", {
28678
29086
  class: normalizeClass(["switch", { checked: checked.value }])
28679
29087
  }, _hoisted_3$9, 2),
28680
- createElementVNode("label", null, [
28681
- createTextVNode(toDisplayString(_ctx.label) + " ", 1),
28682
- withDirectives(createElementVNode("input", {
28683
- id: _ctx.id,
28684
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => checked.value = $event),
28685
- type: "checkbox"
28686
- }, null, 8, _hoisted_4$5), [
28687
- [vModelCheckbox, checked.value]
28688
- ])
28689
- ])
29088
+ withDirectives(createElementVNode("input", {
29089
+ id: inputId.value,
29090
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => checked.value = $event),
29091
+ type: "checkbox",
29092
+ required: _ctx.required
29093
+ }, null, 8, _hoisted_4$5), [
29094
+ [vModelCheckbox, checked.value]
29095
+ ]),
29096
+ createElementVNode("label", { for: inputId.value }, [
29097
+ renderSlot(_ctx.$slots, "label", {}, () => [
29098
+ createTextVNode(toDisplayString(_ctx.label), 1)
29099
+ ], true)
29100
+ ], 8, _hoisted_5$5)
28690
29101
  ], 10, _hoisted_1$i);
28691
29102
  };
28692
29103
  }
28693
29104
  });
28694
- const ToggleInput = /* @__PURE__ */ _export_sfc(_sfc_main$d, [["__scopeId", "data-v-50198c44"]]);
29105
+ const ToggleInput = /* @__PURE__ */ _export_sfc(_sfc_main$d, [["__scopeId", "data-v-eceeebfb"]]);
28695
29106
  function OrderedMap(content) {
28696
29107
  this.content = content;
28697
29108
  }
@@ -62525,7 +62936,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
62525
62936
  };
62526
62937
  }
62527
62938
  });
62528
- const TabbedLayout = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-bb096cbe"]]);
62939
+ const TabbedLayout = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-70d6cf78"]]);
62529
62940
  const countryArray = [
62530
62941
  ["Afghanistan (افغانستان)", "AF", "93"],
62531
62942
  ["Albania (Shqipëri)", "AL", "355"],
@@ -62913,12 +63324,14 @@ export {
62913
63324
  debounce$2 as debounce,
62914
63325
  denullify,
62915
63326
  formatString,
63327
+ getFallbackSchema,
62916
63328
  i18nTInjectionKey,
62917
63329
  iffer,
62918
63330
  initials,
62919
63331
  isDate$1 as isDate,
62920
63332
  keyToLabel,
62921
63333
  useBagel,
63334
+ useBglSchema,
62922
63335
  useEscape,
62923
63336
  useI18nT,
62924
63337
  useLang,