@bagelink/vue 0.0.562 → 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 +620 -201
  23. package/dist/index.d.ts +1 -0
  24. package/dist/index.d.ts.map +1 -1
  25. package/dist/index.mjs +621 -202
  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 +4 -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 +294 -108
  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 +24 -2
package/dist/index.cjs CHANGED
@@ -2568,7 +2568,7 @@ const isPlainObject$1 = (val) => {
2568
2568
  const prototype2 = getPrototypeOf(val);
2569
2569
  return (prototype2 === null || prototype2 === Object.prototype || Object.getPrototypeOf(prototype2) === null) && !(Symbol.toStringTag in val) && !(Symbol.iterator in val);
2570
2570
  };
2571
- const isDate$1 = kindOfTest("Date");
2571
+ const isDate$2 = kindOfTest("Date");
2572
2572
  const isFile = kindOfTest("File");
2573
2573
  const isBlob = kindOfTest("Blob");
2574
2574
  const isFileList = kindOfTest("FileList");
@@ -2843,7 +2843,7 @@ const utils$1 = {
2843
2843
  isResponse,
2844
2844
  isHeaders,
2845
2845
  isUndefined,
2846
- isDate: isDate$1,
2846
+ isDate: isDate$2,
2847
2847
  isFile,
2848
2848
  isBlob,
2849
2849
  isRegExp: isRegExp$1,
@@ -5284,7 +5284,23 @@ function iffer(field, itemData) {
5284
5284
  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);
5285
5285
  return true;
5286
5286
  }
5287
- const denullify = (itemData, fieldID) => fieldID && itemData ? itemData[fieldID] : null;
5287
+ function denullify(itemData, fieldID) {
5288
+ if (!fieldID) return null;
5289
+ return itemData ? itemData[fieldID] : null;
5290
+ }
5291
+ const isDate$1 = (dateToTest) => !Number.isNaN(Date.parse(dateToTest));
5292
+ function getFallbackSchema(data2, showFields) {
5293
+ const keys4 = [
5294
+ ...new Set((data2 ?? []).map(Object.keys).flat())
5295
+ ];
5296
+ const schema = keys4.map(
5297
+ (id) => ({
5298
+ id,
5299
+ label: keyToLabel(id)
5300
+ })
5301
+ );
5302
+ return showFields ? schema.filter((f2) => showFields.includes(f2.id) || !f2.id) : schema;
5303
+ }
5288
5304
  const bagelInjectionKey = Symbol("bagel");
5289
5305
  const i18nTInjectionKey = Symbol("bagel");
5290
5306
  function useBagel() {
@@ -5373,19 +5389,30 @@ const ModalPlugin = {
5373
5389
  app.component("ModalContainer", ModalComponent);
5374
5390
  }
5375
5391
  };
5392
+ function useBglSchema({ schema, showFields, data: data2 } = {}) {
5393
+ let _schema = schema;
5394
+ if (typeof _schema === "function") {
5395
+ _schema = _schema();
5396
+ }
5397
+ if (_schema) {
5398
+ return showFields && showFields.length ? _schema.filter((f2) => showFields.includes(f2.id)) : _schema;
5399
+ }
5400
+ return getFallbackSchema(data2, showFields);
5401
+ }
5376
5402
  const _sfc_main$O = /* @__PURE__ */ vue.defineComponent({
5377
5403
  __name: "MaterialIcon",
5378
5404
  props: {
5379
5405
  icon: {},
5380
5406
  name: {},
5381
5407
  size: {},
5382
- color: {}
5408
+ color: {},
5409
+ weight: {}
5383
5410
  },
5384
5411
  setup(__props) {
5385
5412
  return (_ctx, _cache) => {
5386
- return vue.openBlock(), vue.createElementBlock("div", {
5413
+ return vue.openBlock(), vue.createElementBlock("span", {
5387
5414
  class: "bgl_icon-font",
5388
- style: vue.normalizeStyle({ fontSize: `${_ctx.size}rem`, color: _ctx.color })
5415
+ style: vue.normalizeStyle({ fontSize: `${_ctx.size}rem`, color: _ctx.color, "font-variation-settings": `'wght' ${_ctx.weight || 400}` })
5389
5416
  }, vue.toDisplayString(_ctx.icon || _ctx.name), 5);
5390
5417
  };
5391
5418
  }
@@ -5394,7 +5421,7 @@ const _hoisted_1$J = { class: "full-nav" };
5394
5421
  const _hoisted_2$A = { class: "nav-scroll" };
5395
5422
  const _hoisted_3$n = { class: "nav-links-wrapper" };
5396
5423
  const _hoisted_4$f = { class: "tooltip" };
5397
- const _hoisted_5$c = { class: "bot-buttons-wrapper" };
5424
+ const _hoisted_5$d = { class: "bot-buttons-wrapper" };
5398
5425
  const _hoisted_6$8 = { class: "tooltip" };
5399
5426
  const _sfc_main$N = /* @__PURE__ */ vue.defineComponent({
5400
5427
  __name: "NavBar",
@@ -5449,7 +5476,7 @@ const _sfc_main$N = /* @__PURE__ */ vue.defineComponent({
5449
5476
  }), 128))
5450
5477
  ])
5451
5478
  ]),
5452
- vue.createElementVNode("div", _hoisted_5$c, [
5479
+ vue.createElementVNode("div", _hoisted_5$d, [
5453
5480
  (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(_ctx.footerLinks, (link) => {
5454
5481
  return vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(link.to ? "router-link" : "div"), {
5455
5482
  key: link.label,
@@ -5516,8 +5543,8 @@ const _sfc_main$M = /* @__PURE__ */ vue.defineComponent({
5516
5543
  },
5517
5544
  setup(__props) {
5518
5545
  vue.useCssVars((_ctx) => ({
5519
- "5113a6cf": computedBackgroundColor.value,
5520
- "ae07d62c": cumputedTextColor.value
5546
+ "39397c0e": computedBackgroundColor.value,
5547
+ "427e8569": cumputedTextColor.value
5521
5548
  }));
5522
5549
  const props2 = __props;
5523
5550
  const isComponent = vue.computed(() => {
@@ -5606,7 +5633,7 @@ const _sfc_main$M = /* @__PURE__ */ vue.defineComponent({
5606
5633
  };
5607
5634
  }
5608
5635
  });
5609
- const Btn = /* @__PURE__ */ _export_sfc(_sfc_main$M, [["__scopeId", "data-v-65a6e961"]]);
5636
+ const Btn = /* @__PURE__ */ _export_sfc(_sfc_main$M, [["__scopeId", "data-v-59ea4a90"]]);
5610
5637
  const _hoisted_1$H = {
5611
5638
  key: 0,
5612
5639
  class: "tool-bar"
@@ -5989,67 +6016,369 @@ const _sfc_main$G = /* @__PURE__ */ vue.defineComponent({
5989
6016
  };
5990
6017
  }
5991
6018
  });
5992
- const _hoisted_1$C = { class: "table-list-wrap h-100" };
5993
- const _hoisted_2$t = { class: "infinite-wrapper" };
5994
- const _hoisted_3$j = { class: "row first-row" };
5995
- const _hoisted_4$d = ["onClick"];
5996
- const _hoisted_5$b = { class: "flex" };
5997
- const _hoisted_6$7 = ["onClick"];
5998
- const _hoisted_7$2 = { key: 1 };
6019
+ function tryOnScopeDispose(fn3) {
6020
+ if (vue.getCurrentScope()) {
6021
+ vue.onScopeDispose(fn3);
6022
+ return true;
6023
+ }
6024
+ return false;
6025
+ }
6026
+ function toValue(r2) {
6027
+ return typeof r2 === "function" ? r2() : vue.unref(r2);
6028
+ }
6029
+ const isClient = typeof window !== "undefined" && typeof document !== "undefined";
6030
+ typeof WorkerGlobalScope !== "undefined" && globalThis instanceof WorkerGlobalScope;
6031
+ function getLifeCycleTarget(target) {
6032
+ return target || vue.getCurrentInstance();
6033
+ }
6034
+ function tryOnMounted(fn3, sync = true, target) {
6035
+ const instance = getLifeCycleTarget();
6036
+ if (instance)
6037
+ vue.onMounted(fn3, target);
6038
+ else if (sync)
6039
+ fn3();
6040
+ else
6041
+ vue.nextTick(fn3);
6042
+ }
6043
+ function unrefElement(elRef) {
6044
+ var _a2;
6045
+ const plain = toValue(elRef);
6046
+ return (_a2 = plain == null ? void 0 : plain.$el) != null ? _a2 : plain;
6047
+ }
6048
+ const defaultWindow = isClient ? window : void 0;
6049
+ function useMounted() {
6050
+ const isMounted = vue.ref(false);
6051
+ const instance = vue.getCurrentInstance();
6052
+ if (instance) {
6053
+ vue.onMounted(() => {
6054
+ isMounted.value = true;
6055
+ }, instance);
6056
+ }
6057
+ return isMounted;
6058
+ }
6059
+ function useSupported(callback) {
6060
+ const isMounted = useMounted();
6061
+ return vue.computed(() => {
6062
+ isMounted.value;
6063
+ return Boolean(callback());
6064
+ });
6065
+ }
6066
+ function useResizeObserver(target, callback, options = {}) {
6067
+ const { window: window2 = defaultWindow, ...observerOptions } = options;
6068
+ let observer;
6069
+ const isSupported = useSupported(() => window2 && "ResizeObserver" in window2);
6070
+ const cleanup = () => {
6071
+ if (observer) {
6072
+ observer.disconnect();
6073
+ observer = void 0;
6074
+ }
6075
+ };
6076
+ const targets = vue.computed(() => Array.isArray(target) ? target.map((el) => unrefElement(el)) : [unrefElement(target)]);
6077
+ const stopWatch = vue.watch(
6078
+ targets,
6079
+ (els) => {
6080
+ cleanup();
6081
+ if (isSupported.value && window2) {
6082
+ observer = new ResizeObserver(callback);
6083
+ for (const _el of els)
6084
+ _el && observer.observe(_el, observerOptions);
6085
+ }
6086
+ },
6087
+ { immediate: true, flush: "post" }
6088
+ );
6089
+ const stop = () => {
6090
+ cleanup();
6091
+ stopWatch();
6092
+ };
6093
+ tryOnScopeDispose(stop);
6094
+ return {
6095
+ isSupported,
6096
+ stop
6097
+ };
6098
+ }
6099
+ function useElementSize(target, initialSize = { width: 0, height: 0 }, options = {}) {
6100
+ const { window: window2 = defaultWindow, box = "content-box" } = options;
6101
+ const isSVG = vue.computed(() => {
6102
+ var _a2, _b;
6103
+ return (_b = (_a2 = unrefElement(target)) == null ? void 0 : _a2.namespaceURI) == null ? void 0 : _b.includes("svg");
6104
+ });
6105
+ const width = vue.ref(initialSize.width);
6106
+ const height = vue.ref(initialSize.height);
6107
+ const { stop: stop1 } = useResizeObserver(
6108
+ target,
6109
+ ([entry]) => {
6110
+ const boxSize = box === "border-box" ? entry.borderBoxSize : box === "content-box" ? entry.contentBoxSize : entry.devicePixelContentBoxSize;
6111
+ if (window2 && isSVG.value) {
6112
+ const $elem = unrefElement(target);
6113
+ if ($elem) {
6114
+ const rect = $elem.getBoundingClientRect();
6115
+ width.value = rect.width;
6116
+ height.value = rect.height;
6117
+ }
6118
+ } else {
6119
+ if (boxSize) {
6120
+ const formatBoxSize = Array.isArray(boxSize) ? boxSize : [boxSize];
6121
+ width.value = formatBoxSize.reduce((acc, { inlineSize }) => acc + inlineSize, 0);
6122
+ height.value = formatBoxSize.reduce((acc, { blockSize }) => acc + blockSize, 0);
6123
+ } else {
6124
+ width.value = entry.contentRect.width;
6125
+ height.value = entry.contentRect.height;
6126
+ }
6127
+ }
6128
+ },
6129
+ options
6130
+ );
6131
+ tryOnMounted(() => {
6132
+ const ele = unrefElement(target);
6133
+ if (ele) {
6134
+ width.value = "offsetWidth" in ele ? ele.offsetWidth : initialSize.width;
6135
+ height.value = "offsetHeight" in ele ? ele.offsetHeight : initialSize.height;
6136
+ }
6137
+ });
6138
+ const stop2 = vue.watch(
6139
+ () => unrefElement(target),
6140
+ (ele) => {
6141
+ width.value = ele ? initialSize.width : 0;
6142
+ height.value = ele ? initialSize.height : 0;
6143
+ }
6144
+ );
6145
+ function stop() {
6146
+ stop1();
6147
+ stop2();
6148
+ }
6149
+ return {
6150
+ width,
6151
+ height,
6152
+ stop
6153
+ };
6154
+ }
6155
+ function useVirtualList(list, options) {
6156
+ const { containerStyle, wrapperProps, scrollTo, calculateRange, currentList, containerRef } = "itemHeight" in options ? useVerticalVirtualList(options, list) : useHorizontalVirtualList(options, list);
6157
+ return {
6158
+ list: currentList,
6159
+ scrollTo,
6160
+ containerProps: {
6161
+ ref: containerRef,
6162
+ onScroll: () => {
6163
+ calculateRange();
6164
+ },
6165
+ style: containerStyle
6166
+ },
6167
+ wrapperProps
6168
+ };
6169
+ }
6170
+ function useVirtualListResources(list) {
6171
+ const containerRef = vue.ref(null);
6172
+ const size2 = useElementSize(containerRef);
6173
+ const currentList = vue.ref([]);
6174
+ const source = vue.shallowRef(list);
6175
+ const state2 = vue.ref({ start: 0, end: 10 });
6176
+ return { state: state2, source, currentList, size: size2, containerRef };
6177
+ }
6178
+ function createGetViewCapacity(state2, source, itemSize) {
6179
+ return (containerSize) => {
6180
+ if (typeof itemSize === "number")
6181
+ return Math.ceil(containerSize / itemSize);
6182
+ const { start: start2 = 0 } = state2.value;
6183
+ let sum = 0;
6184
+ let capacity = 0;
6185
+ for (let i2 = start2; i2 < source.value.length; i2++) {
6186
+ const size2 = itemSize(i2);
6187
+ sum += size2;
6188
+ capacity = i2;
6189
+ if (sum > containerSize)
6190
+ break;
6191
+ }
6192
+ return capacity - start2;
6193
+ };
6194
+ }
6195
+ function createGetOffset(source, itemSize) {
6196
+ return (scrollDirection) => {
6197
+ if (typeof itemSize === "number")
6198
+ return Math.floor(scrollDirection / itemSize) + 1;
6199
+ let sum = 0;
6200
+ let offset2 = 0;
6201
+ for (let i2 = 0; i2 < source.value.length; i2++) {
6202
+ const size2 = itemSize(i2);
6203
+ sum += size2;
6204
+ if (sum >= scrollDirection) {
6205
+ offset2 = i2;
6206
+ break;
6207
+ }
6208
+ }
6209
+ return offset2 + 1;
6210
+ };
6211
+ }
6212
+ function createCalculateRange(type3, overscan, getOffset, getViewCapacity, { containerRef, state: state2, currentList, source }) {
6213
+ return () => {
6214
+ const element = containerRef.value;
6215
+ if (element) {
6216
+ const offset2 = getOffset(type3 === "vertical" ? element.scrollTop : element.scrollLeft);
6217
+ const viewCapacity = getViewCapacity(type3 === "vertical" ? element.clientHeight : element.clientWidth);
6218
+ const from2 = offset2 - overscan;
6219
+ const to2 = offset2 + viewCapacity + overscan;
6220
+ state2.value = {
6221
+ start: from2 < 0 ? 0 : from2,
6222
+ end: to2 > source.value.length ? source.value.length : to2
6223
+ };
6224
+ currentList.value = source.value.slice(state2.value.start, state2.value.end).map((ele, index2) => ({
6225
+ data: ele,
6226
+ index: index2 + state2.value.start
6227
+ }));
6228
+ }
6229
+ };
6230
+ }
6231
+ function createGetDistance(itemSize, source) {
6232
+ return (index2) => {
6233
+ if (typeof itemSize === "number") {
6234
+ const size22 = index2 * itemSize;
6235
+ return size22;
6236
+ }
6237
+ const size2 = source.value.slice(0, index2).reduce((sum, _2, i2) => sum + itemSize(i2), 0);
6238
+ return size2;
6239
+ };
6240
+ }
6241
+ function useWatchForSizes(size2, list, containerRef, calculateRange) {
6242
+ vue.watch([size2.width, size2.height, list, containerRef], () => {
6243
+ calculateRange();
6244
+ });
6245
+ }
6246
+ function createComputedTotalSize(itemSize, source) {
6247
+ return vue.computed(() => {
6248
+ if (typeof itemSize === "number")
6249
+ return source.value.length * itemSize;
6250
+ return source.value.reduce((sum, _2, index2) => sum + itemSize(index2), 0);
6251
+ });
6252
+ }
6253
+ const scrollToDictionaryForElementScrollKey = {
6254
+ horizontal: "scrollLeft",
6255
+ vertical: "scrollTop"
6256
+ };
6257
+ function createScrollTo(type3, calculateRange, getDistance, containerRef) {
6258
+ return (index2) => {
6259
+ if (containerRef.value) {
6260
+ containerRef.value[scrollToDictionaryForElementScrollKey[type3]] = getDistance(index2);
6261
+ calculateRange();
6262
+ }
6263
+ };
6264
+ }
6265
+ function useHorizontalVirtualList(options, list) {
6266
+ const resources = useVirtualListResources(list);
6267
+ const { state: state2, source, currentList, size: size2, containerRef } = resources;
6268
+ const containerStyle = { overflowX: "auto" };
6269
+ const { itemWidth, overscan = 5 } = options;
6270
+ const getViewCapacity = createGetViewCapacity(state2, source, itemWidth);
6271
+ const getOffset = createGetOffset(source, itemWidth);
6272
+ const calculateRange = createCalculateRange("horizontal", overscan, getOffset, getViewCapacity, resources);
6273
+ const getDistanceLeft = createGetDistance(itemWidth, source);
6274
+ const offsetLeft = vue.computed(() => getDistanceLeft(state2.value.start));
6275
+ const totalWidth = createComputedTotalSize(itemWidth, source);
6276
+ useWatchForSizes(size2, list, containerRef, calculateRange);
6277
+ const scrollTo = createScrollTo("horizontal", calculateRange, getDistanceLeft, containerRef);
6278
+ const wrapperProps = vue.computed(() => {
6279
+ return {
6280
+ style: {
6281
+ height: "100%",
6282
+ width: `${totalWidth.value - offsetLeft.value}px`,
6283
+ marginLeft: `${offsetLeft.value}px`,
6284
+ display: "flex"
6285
+ }
6286
+ };
6287
+ });
6288
+ return {
6289
+ scrollTo,
6290
+ calculateRange,
6291
+ wrapperProps,
6292
+ containerStyle,
6293
+ currentList,
6294
+ containerRef
6295
+ };
6296
+ }
6297
+ function useVerticalVirtualList(options, list) {
6298
+ const resources = useVirtualListResources(list);
6299
+ const { state: state2, source, currentList, size: size2, containerRef } = resources;
6300
+ const containerStyle = { overflowY: "auto" };
6301
+ const { itemHeight, overscan = 5 } = options;
6302
+ const getViewCapacity = createGetViewCapacity(state2, source, itemHeight);
6303
+ const getOffset = createGetOffset(source, itemHeight);
6304
+ const calculateRange = createCalculateRange("vertical", overscan, getOffset, getViewCapacity, resources);
6305
+ const getDistanceTop = createGetDistance(itemHeight, source);
6306
+ const offsetTop = vue.computed(() => getDistanceTop(state2.value.start));
6307
+ const totalHeight = createComputedTotalSize(itemHeight, source);
6308
+ useWatchForSizes(size2, list, containerRef, calculateRange);
6309
+ const scrollTo = createScrollTo("vertical", calculateRange, getDistanceTop, containerRef);
6310
+ const wrapperProps = vue.computed(() => {
6311
+ return {
6312
+ style: {
6313
+ width: "100%",
6314
+ height: `${totalHeight.value - offsetTop.value}px`,
6315
+ marginTop: `${offsetTop.value}px`
6316
+ }
6317
+ };
6318
+ });
6319
+ return {
6320
+ calculateRange,
6321
+ scrollTo,
6322
+ containerStyle,
6323
+ wrapperProps,
6324
+ currentList,
6325
+ containerRef
6326
+ };
6327
+ }
6328
+ const _withScopeId$3 = (n2) => (vue.pushScopeId("data-v-73d79ea6"), n2 = n2(), vue.popScopeId(), n2);
6329
+ const _hoisted_1$C = {
6330
+ key: 0,
6331
+ class: "loading-table-wrapper z-99 h-100 w-100 absolute inset"
6332
+ };
6333
+ const _hoisted_2$t = /* @__PURE__ */ _withScopeId$3(() => /* @__PURE__ */ vue.createElementVNode("div", { class: "loading-table-animation absolute oval" }, null, -1));
6334
+ const _hoisted_3$j = [
6335
+ _hoisted_2$t
6336
+ ];
6337
+ const _hoisted_4$d = { class: "infinite-wrapper" };
6338
+ const _hoisted_5$c = { class: "row first-row" };
6339
+ const _hoisted_6$7 = { key: 0 };
6340
+ const _hoisted_7$2 = ["onClick"];
6341
+ const _hoisted_8$1 = { class: "flex" };
6342
+ const _hoisted_9$1 = ["onClick"];
6343
+ const _hoisted_10$1 = { key: 0 };
6344
+ const _hoisted_11$1 = ["value"];
6345
+ const _hoisted_12$1 = { key: 1 };
5999
6346
  const _sfc_main$F = /* @__PURE__ */ vue.defineComponent({
6000
6347
  __name: "TableSchema",
6001
- props: {
6348
+ props: /* @__PURE__ */ vue.mergeModels({
6002
6349
  selectedItems: {},
6003
6350
  data: {},
6004
6351
  schema: { type: Function },
6005
6352
  showFields: {}
6006
- },
6007
- emits: ["update:selectedItems", "orderBy", "select"],
6353
+ }, {
6354
+ "loading": { default: false },
6355
+ "loadingModifiers": {},
6356
+ "itemHeight": { default: 50 },
6357
+ "itemHeightModifiers": {}
6358
+ }),
6359
+ emits: /* @__PURE__ */ vue.mergeModels(["update:selectedItems", "orderBy", "select"], ["update:loading", "update:itemHeight"]),
6008
6360
  setup(__props, { emit: __emit }) {
6361
+ vue.useCssVars((_ctx) => ({
6362
+ "59d71ad2": vue.unref(computedItemHiehgt)
6363
+ }));
6009
6364
  const props2 = __props;
6010
6365
  const emit2 = __emit;
6011
6366
  const slots = vue.useSlots();
6012
- const loading = vue.ref(true);
6013
- let selectedItems = vue.ref(props2.selectedItems || []);
6014
- vue.computed({
6015
- get: () => selectedItems.value,
6016
- set: (value) => {
6017
- selectedItems.value = value;
6018
- emit2("update:selectedItems", value);
6019
- }
6020
- });
6021
- function selectElement(item) {
6022
- emit2("select", item);
6023
- }
6024
- let sortDirection = vue.ref("ASC");
6367
+ const loading = vue.useModel(__props, "loading");
6368
+ const itemHeight = vue.useModel(__props, "itemHeight");
6369
+ const computedItemHiehgt = vue.computed(() => `${itemHeight.value}px`);
6025
6370
  let sortField = vue.ref("");
6371
+ let sortDirection = vue.ref("ASC");
6372
+ let selectedItems = vue.ref(props2.selectedItems || []);
6373
+ const isSelectable = vue.computed(() => Array.isArray(props2.selectedItems));
6026
6374
  const computedSortField = vue.computed(() => `_transformed_${sortField.value}`);
6027
- function getFallbackSchema() {
6028
- const keys4 = [
6029
- ...new Set((props2.data || []).map(Object.keys).flat())
6030
- ];
6031
- const schema = keys4.map((id) => ({
6032
- id,
6033
- label: keyToLabel(id)
6034
- }));
6035
- return props2.showFields ? schema.filter((f2) => {
6036
- var _a2;
6037
- return ((_a2 = props2.showFields) == null ? void 0 : _a2.includes(f2.id)) ?? !f2.id;
6038
- }) : schema;
6039
- }
6040
- const computedSchema = vue.computed(() => {
6041
- let _schema = props2.schema;
6042
- if (typeof _schema === "function") {
6043
- _schema = _schema();
6044
- }
6045
- if (_schema) {
6046
- return props2.showFields ? _schema.filter((f2) => {
6047
- var _a2;
6048
- return (_a2 = props2.showFields) == null ? void 0 : _a2.includes(f2.id);
6049
- }) : _schema;
6050
- }
6051
- return getFallbackSchema();
6052
- });
6375
+ const computedSchema = vue.computed(
6376
+ () => useBglSchema({
6377
+ schema: props2.schema,
6378
+ showFields: props2.showFields,
6379
+ data: props2.data
6380
+ })
6381
+ );
6053
6382
  function transform(rowData) {
6054
6383
  var _a2;
6055
6384
  const obj = { ...rowData };
@@ -6068,10 +6397,14 @@ const _sfc_main$F = /* @__PURE__ */ vue.defineComponent({
6068
6397
  const dta = [...props2.data].map(transform);
6069
6398
  if (sortField.value) {
6070
6399
  return dta.sort((a2, b2) => {
6071
- const aValue = a2[computedSortField.value] ?? a2[sortField.value] ?? "";
6072
- const bValue = b2[computedSortField.value] ?? b2[sortField.value] ?? "";
6073
- const numAValue = Number.parseInt(aValue.replace(/[^\d.-]/g, ""), 10);
6074
- const numBValue = Number.parseInt(bValue.replace(/[^\d.-]/g, ""), 10);
6400
+ let aValue = a2[computedSortField.value] ?? a2[sortField.value] ?? "";
6401
+ let bValue = b2[computedSortField.value] ?? b2[sortField.value] ?? "";
6402
+ if (isDate$1(aValue) && isDate$1(bValue)) {
6403
+ aValue = new Date(aValue).getTime();
6404
+ bValue = new Date(bValue).getTime();
6405
+ }
6406
+ const numAValue = Number.parseInt(`${aValue}`.replace(/[^\d.-]/g, ""), 10);
6407
+ const numBValue = Number.parseInt(`${bValue}`.replace(/[^\d.-]/g, ""), 10);
6075
6408
  if (!Number.isNaN(numAValue) && !Number.isNaN(numBValue)) {
6076
6409
  if (sortDirection.value === "ASC") return numAValue - numBValue;
6077
6410
  return numBValue - numAValue;
@@ -6096,68 +6429,138 @@ const _sfc_main$F = /* @__PURE__ */ vue.defineComponent({
6096
6429
  }
6097
6430
  emit2("orderBy", `${fieldname} ${sortDirection.value}`.trim());
6098
6431
  }
6432
+ const { list, containerProps, wrapperProps, scrollTo } = useVirtualList(
6433
+ computedData,
6434
+ {
6435
+ itemHeight: itemHeight.value,
6436
+ overscan: 10
6437
+ }
6438
+ );
6439
+ vue.watch(
6440
+ () => computedData.value.length,
6441
+ (newLength, oldLength) => {
6442
+ if (newLength === oldLength) return;
6443
+ scrollTo(0);
6444
+ }
6445
+ );
6446
+ const allSelector = vue.ref(null);
6447
+ let computedSelectedItems = vue.computed({
6448
+ get: () => selectedItems.value,
6449
+ set: (value) => {
6450
+ selectedItems.value = value;
6451
+ emit2("update:selectedItems", value);
6452
+ updateAllSelectorState();
6453
+ }
6454
+ });
6455
+ function updateAllSelectorState() {
6456
+ if (!allSelector.value) return;
6457
+ const allSelected = computedData.value.length === computedSelectedItems.value.length && computedData.value.every((s2) => computedSelectedItems.value.includes(s2.id));
6458
+ allSelector.value.checked = allSelected;
6459
+ allSelector.value.indeterminate = !allSelected && computedSelectedItems.value.length > 0;
6460
+ }
6461
+ function toggleSelectItem(item) {
6462
+ if (!computedSelectedItems.value.length) {
6463
+ emit2("select", item);
6464
+ return;
6465
+ }
6466
+ const index2 = computedSelectedItems.value.indexOf(item.id);
6467
+ if (index2 > -1) {
6468
+ computedSelectedItems.value.splice(index2, 1);
6469
+ } else {
6470
+ computedSelectedItems.value.push(item.id);
6471
+ }
6472
+ }
6473
+ function toggleSelectAll(event) {
6474
+ const value = event.target.checked;
6475
+ computedSelectedItems.value = value ? computedData.value.map((d2) => d2.id) : [];
6476
+ }
6099
6477
  return (_ctx, _cache) => {
6100
- return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$C, [
6101
- vue.createElementVNode("table", _hoisted_2$t, [
6102
- vue.createElementVNode("thead", _hoisted_3$j, [
6103
- (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(computedSchema.value, (field) => {
6104
- return vue.openBlock(), vue.createElementBlock("th", {
6105
- key: field.id,
6106
- class: "col",
6107
- onClick: ($event) => sort2((field == null ? void 0 : field.id) || "")
6108
- }, [
6109
- vue.createElementVNode("div", _hoisted_5$b, [
6110
- vue.createTextVNode(vue.toDisplayString(field.label || vue.unref(keyToLabel)(field.id)) + " ", 1),
6111
- vue.createElementVNode("div", {
6112
- class: vue.normalizeClass(["list-arrows", { sorted: vue.unref(sortField) === field.id }])
6113
- }, [
6114
- vue.createVNode(vue.unref(_sfc_main$O), {
6115
- class: vue.normalizeClass({ desc: vue.unref(sortDirection) === "DESC" }),
6116
- icon: "keyboard_arrow_up"
6117
- }, null, 8, ["class"])
6118
- ], 2)
6119
- ])
6120
- ], 8, _hoisted_4$d);
6121
- }), 128))
6122
- ]),
6123
- vue.createElementVNode("tbody", {
6124
- ref: "infinite",
6125
- class: vue.normalizeClass(["rows infinite", { loading: loading.value }])
6126
- }, [
6127
- (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(computedData.value, (row) => {
6128
- return vue.openBlock(), vue.createElementBlock("tr", {
6129
- key: row.id,
6130
- class: "row row-item position-relative",
6131
- onClick: ($event) => selectElement(row)
6132
- }, [
6133
- (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(computedSchema.value, (field) => {
6134
- return vue.openBlock(), vue.createElementBlock("td", {
6135
- key: `${field.id}-${row.id}`,
6136
- class: "col"
6137
- }, [
6138
- field.id && vue.unref(slots)[field.id] ? vue.renderSlot(_ctx.$slots, field.id, {
6139
- key: 0,
6140
- row,
6141
- field
6142
- }, void 0, true) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_7$2, [
6143
- vue.createVNode(vue.unref(_sfc_main$p), {
6144
- class: "embedded-field",
6145
- field,
6146
- modelValue: row,
6147
- label: ""
6148
- }, null, 8, ["field", "modelValue"])
6149
- ]))
6150
- ]);
6151
- }), 128))
6152
- ], 8, _hoisted_6$7);
6153
- }), 128))
6154
- ], 2)
6155
- ])
6156
- ]);
6478
+ return vue.openBlock(), vue.createElementBlock("div", vue.mergeProps({ class: "table-list-wrap h-100" }, vue.unref(containerProps), {
6479
+ class: { "loading-table": loading.value }
6480
+ }), [
6481
+ loading.value ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$C, _hoisted_3$j)) : (vue.openBlock(), vue.createElementBlock("div", vue.normalizeProps(vue.mergeProps({ key: 1 }, vue.unref(wrapperProps))), [
6482
+ vue.createElementVNode("table", _hoisted_4$d, [
6483
+ vue.createElementVNode("thead", _hoisted_5$c, [
6484
+ vue.unref(isSelectable) ? (vue.openBlock(), vue.createElementBlock("th", _hoisted_6$7, [
6485
+ vue.createElementVNode("input", {
6486
+ ref_key: "allSelector",
6487
+ ref: allSelector,
6488
+ type: "checkbox",
6489
+ onClick: _cache[0] || (_cache[0] = vue.withModifiers(() => {
6490
+ }, ["stop"])),
6491
+ onChange: toggleSelectAll
6492
+ }, null, 544)
6493
+ ])) : vue.createCommentVNode("", true),
6494
+ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(vue.unref(computedSchema), (field) => {
6495
+ return vue.openBlock(), vue.createElementBlock("th", {
6496
+ key: field.id,
6497
+ class: "col",
6498
+ onClick: ($event) => sort2((field == null ? void 0 : field.id) || "")
6499
+ }, [
6500
+ vue.createElementVNode("div", _hoisted_8$1, [
6501
+ vue.createTextVNode(vue.toDisplayString(field.label || vue.unref(keyToLabel)(field.id)) + " ", 1),
6502
+ vue.createElementVNode("div", {
6503
+ class: vue.normalizeClass(["list-arrows", { sorted: vue.unref(sortField) === field.id }])
6504
+ }, [
6505
+ vue.createVNode(vue.unref(_sfc_main$O), {
6506
+ class: vue.normalizeClass({ desc: vue.unref(sortDirection) === "DESC" }),
6507
+ icon: "keyboard_arrow_up"
6508
+ }, null, 8, ["class"])
6509
+ ], 2)
6510
+ ])
6511
+ ], 8, _hoisted_7$2);
6512
+ }), 128))
6513
+ ]),
6514
+ vue.createElementVNode("tbody", null, [
6515
+ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(vue.unref(list), ({ data: row }) => {
6516
+ return vue.openBlock(), vue.createElementBlock("tr", {
6517
+ key: row.id,
6518
+ class: vue.normalizeClass(["row row-item position-relative", { selected: vue.unref(computedSelectedItems).includes(row.id) }]),
6519
+ onClick: ($event) => toggleSelectItem(row)
6520
+ }, [
6521
+ vue.unref(isSelectable) ? (vue.openBlock(), vue.createElementBlock("td", _hoisted_10$1, [
6522
+ vue.createElementVNode("div", {
6523
+ onClick: _cache[2] || (_cache[2] = vue.withModifiers(() => {
6524
+ }, ["stop"]))
6525
+ }, [
6526
+ vue.withDirectives(vue.createElementVNode("input", {
6527
+ "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => vue.isRef(computedSelectedItems) ? computedSelectedItems.value = $event : computedSelectedItems = $event),
6528
+ type: "checkbox",
6529
+ value: row.id
6530
+ }, null, 8, _hoisted_11$1), [
6531
+ [vue.vModelCheckbox, vue.unref(computedSelectedItems)]
6532
+ ])
6533
+ ])
6534
+ ])) : vue.createCommentVNode("", true),
6535
+ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(vue.unref(computedSchema), (field) => {
6536
+ return vue.openBlock(), vue.createElementBlock("td", {
6537
+ key: `${field.id}-${row.id}`,
6538
+ class: "col"
6539
+ }, [
6540
+ field.id && vue.unref(slots)[field.id] ? vue.renderSlot(_ctx.$slots, field.id, {
6541
+ key: 0,
6542
+ row,
6543
+ field
6544
+ }, void 0, true) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_12$1, [
6545
+ vue.createVNode(vue.unref(_sfc_main$p), {
6546
+ class: "embedded-field",
6547
+ field,
6548
+ modelValue: row,
6549
+ label: ""
6550
+ }, null, 8, ["field", "modelValue"])
6551
+ ]))
6552
+ ]);
6553
+ }), 128))
6554
+ ], 10, _hoisted_9$1);
6555
+ }), 128))
6556
+ ])
6557
+ ])
6558
+ ], 16))
6559
+ ], 16);
6157
6560
  };
6158
6561
  }
6159
6562
  });
6160
- const TableSchema = /* @__PURE__ */ _export_sfc(_sfc_main$F, [["__scopeId", "data-v-adf0cb31"]]);
6563
+ const TableSchema = /* @__PURE__ */ _export_sfc(_sfc_main$F, [["__scopeId", "data-v-73d79ea6"]]);
6161
6564
  const _sfc_main$E = {};
6162
6565
  const _hoisted_1$B = { class: "flex space-between" };
6163
6566
  function _sfc_render$1(_ctx, _cache) {
@@ -6199,7 +6602,7 @@ const _hoisted_2$s = {
6199
6602
  };
6200
6603
  const _hoisted_3$i = { class: "key" };
6201
6604
  const _hoisted_4$c = { key: 1 };
6202
- const _hoisted_5$a = { class: "key" };
6605
+ const _hoisted_5$b = { class: "key" };
6203
6606
  const _hoisted_6$6 = { class: "vlue" };
6204
6607
  const _sfc_main$C = /* @__PURE__ */ vue.defineComponent({
6205
6608
  __name: "DataPreview",
@@ -6215,16 +6618,12 @@ const _sfc_main$C = /* @__PURE__ */ vue.defineComponent({
6215
6618
  setup(__props) {
6216
6619
  const props2 = __props;
6217
6620
  const itemData = vue.useModel(__props, "data");
6218
- const computedSchema = vue.computed(() => {
6219
- const schema = Object.keys(itemData.value);
6220
- if (props2.showFields && props2.showFields.length) {
6221
- return schema.filter((field) => {
6222
- var _a2;
6223
- return (_a2 = props2.showFields) == null ? void 0 : _a2.includes(field);
6224
- });
6225
- }
6226
- return schema;
6227
- });
6621
+ const computedSchema = vue.computed(
6622
+ () => getFallbackSchema(
6623
+ [itemData.value],
6624
+ props2.showFields
6625
+ )
6626
+ );
6228
6627
  return (_ctx, _cache) => {
6229
6628
  var _a2;
6230
6629
  return __props.data ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$A, [
@@ -6249,13 +6648,13 @@ const _sfc_main$C = /* @__PURE__ */ vue.defineComponent({
6249
6648
  ], 64);
6250
6649
  }), 128)),
6251
6650
  !((_a2 = _ctx.schema) == null ? void 0 : _a2.length) ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_4$c, [
6252
- (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(computedSchema.value, (key) => {
6651
+ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(computedSchema.value, ({ id, label }) => {
6253
6652
  return vue.openBlock(), vue.createElementBlock("div", {
6254
- key,
6653
+ key: id,
6255
6654
  class: "data-row"
6256
6655
  }, [
6257
- vue.createElementVNode("div", _hoisted_5$a, vue.toDisplayString(vue.unref(keyToLabel)(key)), 1),
6258
- vue.createElementVNode("div", _hoisted_6$6, vue.toDisplayString(itemData.value[key]), 1)
6656
+ vue.createElementVNode("div", _hoisted_5$b, vue.toDisplayString(label), 1),
6657
+ vue.createElementVNode("div", _hoisted_6$6, vue.toDisplayString(itemData.value[id ?? ""]), 1)
6259
6658
  ]);
6260
6659
  }), 128))
6261
6660
  ])) : vue.createCommentVNode("", true),
@@ -6264,7 +6663,7 @@ const _sfc_main$C = /* @__PURE__ */ vue.defineComponent({
6264
6663
  };
6265
6664
  }
6266
6665
  });
6267
- const DataPreview = /* @__PURE__ */ _export_sfc(_sfc_main$C, [["__scopeId", "data-v-078d6853"]]);
6666
+ const DataPreview = /* @__PURE__ */ _export_sfc(_sfc_main$C, [["__scopeId", "data-v-2281300f"]]);
6268
6667
  const _hoisted_1$z = {
6269
6668
  key: 0,
6270
6669
  class: "card_label"
@@ -16312,7 +16711,6 @@ const _sfc_main$s = /* @__PURE__ */ vue.defineComponent({
16312
16711
  if (props2.address) {
16313
16712
  geocodeAddress(props2.address).catch(console.error);
16314
16713
  }
16315
- console.log(props2.zoomControl, props2.center);
16316
16714
  map4.value = L$1.map(id.value, {
16317
16715
  center: props2.center,
16318
16716
  zoom: props2.zoom,
@@ -16332,7 +16730,8 @@ const _sfc_main$s = /* @__PURE__ */ vue.defineComponent({
16332
16730
  }
16333
16731
  async function geocodeAddress(address) {
16334
16732
  var _a2;
16335
- const geocodeUrl = `https://nominatim.openstreetmap.org/search?format=json&q=${encodeURIComponent(address)}`;
16733
+ const addressURL = address.replace(/\s+/g, "+");
16734
+ const geocodeUrl = `https://nominatim.openstreetmap.org/search?format=json&q=${encodeURI(addressURL)}`;
16336
16735
  const res = await fetch(geocodeUrl);
16337
16736
  const data2 = await res.json() || [];
16338
16737
  data2.forEach((element) => {
@@ -16617,16 +17016,20 @@ const _sfc_main$o = /* @__PURE__ */ vue.defineComponent({
16617
17016
  id: {},
16618
17017
  title: {},
16619
17018
  small: { type: Boolean },
16620
- required: { type: Boolean }
17019
+ required: { type: Boolean },
17020
+ defaultValue: { type: Boolean, default: false }
16621
17021
  }, {
16622
- "modelValue": { type: Boolean, ...{ default: false } },
17022
+ "modelValue": { type: Boolean, ...{ default: void 0 } },
16623
17023
  "modelModifiers": {}
16624
17024
  }),
16625
17025
  emits: ["update:modelValue"],
16626
17026
  setup(__props) {
16627
17027
  const props2 = __props;
16628
- const inputId = vue.ref(props2.id || Math.random().toString(36).substring(7));
17028
+ const inputId = vue.computed(() => props2.id || Math.random().toString(36).substring(7));
16629
17029
  const checked = vue.useModel(__props, "modelValue");
17030
+ vue.onMounted(() => {
17031
+ if (checked.value === void 0) checked.value = props2.defaultValue;
17032
+ });
16630
17033
  return (_ctx, _cache) => {
16631
17034
  return vue.openBlock(), vue.createElementBlock("div", {
16632
17035
  class: vue.normalizeClass(["bagel-input bgl-checkbox align-items-center ps-025", { small: _ctx.small }]),
@@ -16650,7 +17053,7 @@ const _sfc_main$o = /* @__PURE__ */ vue.defineComponent({
16650
17053
  };
16651
17054
  }
16652
17055
  });
16653
- const CheckInput = /* @__PURE__ */ _export_sfc(_sfc_main$o, [["__scopeId", "data-v-ac068f18"]]);
17056
+ const CheckInput = /* @__PURE__ */ _export_sfc(_sfc_main$o, [["__scopeId", "data-v-e8fcfd5e"]]);
16654
17057
  function toDate(argument) {
16655
17058
  const argStr = Object.prototype.toString.call(argument);
16656
17059
  if (argument instanceof Date || typeof argument === "object" && argStr === "[object Date]") {
@@ -25105,6 +25508,7 @@ const _hoisted_2$m = { key: 0 };
25105
25508
  const _sfc_main$n = /* @__PURE__ */ vue.defineComponent({
25106
25509
  __name: "DateInput",
25107
25510
  props: {
25511
+ required: { type: Boolean },
25108
25512
  label: {},
25109
25513
  editMode: { type: Boolean, default: true },
25110
25514
  small: { type: Boolean, default: false },
@@ -25149,6 +25553,7 @@ const _sfc_main$n = /* @__PURE__ */ vue.defineComponent({
25149
25553
  ref: datePicker,
25150
25554
  modelValue: date2.value,
25151
25555
  "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => date2.value = $event),
25556
+ required: _ctx.required,
25152
25557
  "auto-apply": true,
25153
25558
  "enable-time-picker": _ctx.enableTime,
25154
25559
  "allowed-dates": _ctx.allowedDates
@@ -25157,7 +25562,7 @@ const _sfc_main$n = /* @__PURE__ */ vue.defineComponent({
25157
25562
  "minutes-increment": _ctx.minutesIncrement,
25158
25563
  "minutes-grid-increment": _ctx.minutesGridIncrement,
25159
25564
  "start-time": { hours: 8, minutes: 0 }
25160
- }), null, 16, ["modelValue", "enable-time-picker", "allowed-dates", "time-picker-inline", "minutes-increment", "minutes-grid-increment"])
25565
+ }), null, 16, ["modelValue", "required", "enable-time-picker", "allowed-dates", "time-picker-inline", "minutes-increment", "minutes-grid-increment"])
25161
25566
  ], 10, _hoisted_1$s);
25162
25567
  };
25163
25568
  }
@@ -27902,7 +28307,7 @@ const _hoisted_1$p = ["title"];
27902
28307
  const _hoisted_2$j = { class: "bagel-input" };
27903
28308
  const _hoisted_3$e = { class: "table-side-scroll" };
27904
28309
  const _hoisted_4$a = { class: "table-header" };
27905
- const _hoisted_5$9 = { class: "table-reorder" };
28310
+ const _hoisted_5$a = { class: "table-reorder" };
27906
28311
  const _hoisted_6$5 = { class: "table-action" };
27907
28312
  const _sfc_main$k = /* @__PURE__ */ vue.defineComponent({
27908
28313
  __name: "TableField",
@@ -28000,7 +28405,7 @@ const _sfc_main$k = /* @__PURE__ */ vue.defineComponent({
28000
28405
  key: row.id,
28001
28406
  class: "flex table-row"
28002
28407
  }, [
28003
- vue.createElementVNode("div", _hoisted_5$9, [
28408
+ vue.createElementVNode("div", _hoisted_5$a, [
28004
28409
  vue.createVNode(vue.unref(_sfc_main$O), { icon: "more_vert" })
28005
28410
  ]),
28006
28411
  (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList((_a3 = vue.unref(entityMeta)) == null ? void 0 : _a3.fields, (field) => {
@@ -28053,7 +28458,7 @@ const _hoisted_1$o = ["title"];
28053
28458
  const _hoisted_2$i = ["for"];
28054
28459
  const _hoisted_3$d = ["id", "title", "autocomplete", "type", "placeholder", "disabled", "required", "pattern"];
28055
28460
  const _hoisted_4$9 = ["id", "title", "type", "rows", "placeholder", "disabled", "required", "pattern"];
28056
- const _hoisted_5$8 = { key: 2 };
28461
+ const _hoisted_5$9 = { key: 2 };
28057
28462
  const _sfc_main$j = /* @__PURE__ */ vue.defineComponent({
28058
28463
  __name: "TextInput",
28059
28464
  props: {
@@ -28159,7 +28564,7 @@ const _sfc_main$j = /* @__PURE__ */ vue.defineComponent({
28159
28564
  }, _ctx.nativeInputAttrs, { onInput: updateInputVal }), null, 16, _hoisted_4$9)), [
28160
28565
  [vue.vModelText, vue.unref(inputVal)]
28161
28566
  ]),
28162
- _ctx.helptext ? (vue.openBlock(), vue.createElementBlock("p", _hoisted_5$8, vue.toDisplayString(_ctx.helptext), 1)) : vue.createCommentVNode("", true)
28567
+ _ctx.helptext ? (vue.openBlock(), vue.createElementBlock("p", _hoisted_5$9, vue.toDisplayString(_ctx.helptext), 1)) : vue.createCommentVNode("", true)
28163
28568
  ], 8, _hoisted_2$i),
28164
28569
  _ctx.iconStart ? (vue.openBlock(), vue.createBlock(vue.unref(_sfc_main$O), {
28165
28570
  key: 0,
@@ -28259,7 +28664,7 @@ const _hoisted_3$c = {
28259
28664
  class: "time-wrap"
28260
28665
  };
28261
28666
  const _hoisted_4$8 = ["id", "name", "value"];
28262
- const _hoisted_5$7 = ["for"];
28667
+ const _hoisted_5$8 = ["for"];
28263
28668
  const _sfc_main$g = /* @__PURE__ */ vue.defineComponent({
28264
28669
  __name: "DatePicker",
28265
28670
  props: {
@@ -28322,7 +28727,7 @@ const _sfc_main$g = /* @__PURE__ */ vue.defineComponent({
28322
28727
  ]),
28323
28728
  vue.createElementVNode("label", {
28324
28729
  for: `${hr2}_${_ctx.id}`
28325
- }, vue.toDisplayString(hr2), 9, _hoisted_5$7)
28730
+ }, vue.toDisplayString(hr2), 9, _hoisted_5$8)
28326
28731
  ], 64);
28327
28732
  }), 128))
28328
28733
  ])) : vue.createCommentVNode("", true)
@@ -28334,7 +28739,7 @@ const _hoisted_1$k = { class: "bagel-input" };
28334
28739
  const _hoisted_2$f = { class: "pb-025" };
28335
28740
  const _hoisted_3$b = { class: "flex gap-05 flex-wrap" };
28336
28741
  const _hoisted_4$7 = ["id", "name", "value", "checked"];
28337
- const _hoisted_5$6 = ["for"];
28742
+ const _hoisted_5$7 = ["for"];
28338
28743
  const _sfc_main$f = /* @__PURE__ */ vue.defineComponent({
28339
28744
  __name: "RadioPillsInput",
28340
28745
  props: {
@@ -28394,7 +28799,7 @@ const _sfc_main$f = /* @__PURE__ */ vue.defineComponent({
28394
28799
  }, null, 40, _hoisted_4$7),
28395
28800
  vue.createElementVNode("label", {
28396
28801
  for: `${_ctx.id}-${getValue(option2)}`
28397
- }, vue.toDisplayString(getLabel(option2)), 9, _hoisted_5$6)
28802
+ }, vue.toDisplayString(getLabel(option2)), 9, _hoisted_5$7)
28398
28803
  ]);
28399
28804
  }), 128))
28400
28805
  ])
@@ -28403,7 +28808,7 @@ const _sfc_main$f = /* @__PURE__ */ vue.defineComponent({
28403
28808
  }
28404
28809
  });
28405
28810
  const RadioPillsInput = /* @__PURE__ */ _export_sfc(_sfc_main$f, [["__scopeId", "data-v-681173be"]]);
28406
- const _withScopeId$2 = (n2) => (vue.pushScopeId("data-v-82316bcb"), n2 = n2(), vue.popScopeId(), n2);
28811
+ const _withScopeId$2 = (n2) => (vue.pushScopeId("data-v-1ce244aa"), n2 = n2(), vue.popScopeId(), n2);
28407
28812
  const _hoisted_1$j = { class: "bagel-input" };
28408
28813
  const _hoisted_2$e = {
28409
28814
  key: 0,
@@ -28414,7 +28819,7 @@ const _hoisted_4$6 = {
28414
28819
  key: 1,
28415
28820
  class: "multi-image-item previewName"
28416
28821
  };
28417
- const _hoisted_5$5 = ["src"];
28822
+ const _hoisted_5$6 = ["src"];
28418
28823
  const _hoisted_6$4 = { class: "no-margin" };
28419
28824
  const _hoisted_7$1 = {
28420
28825
  key: 0,
@@ -28431,25 +28836,23 @@ const _hoisted_12 = {
28431
28836
  const _hoisted_13 = /* @__PURE__ */ _withScopeId$2(() => /* @__PURE__ */ vue.createElementVNode("p", null, "Drop files here or click to upload", -1));
28432
28837
  const _sfc_main$e = /* @__PURE__ */ vue.defineComponent({
28433
28838
  __name: "FileUpload",
28434
- props: /* @__PURE__ */ vue.mergeModels({
28839
+ props: {
28435
28840
  label: {},
28436
28841
  multiple: { type: Boolean },
28437
28842
  files: {},
28438
28843
  deleteEndpoint: {},
28439
28844
  bindkey: {},
28845
+ modelValue: {},
28440
28846
  width: {}
28441
- }, {
28442
- "modelValue": {},
28443
- "modelModifiers": {}
28444
- }),
28847
+ },
28445
28848
  emits: ["update:modelValue"],
28446
- setup(__props) {
28849
+ setup(__props, { emit: __emit }) {
28447
28850
  const props2 = __props;
28448
28851
  const bagel = useBagel();
28449
28852
  const bindKey2 = props2.bindkey || "id";
28450
- const file_bindkeys = vue.useModel(__props, "modelValue");
28853
+ const emit2 = __emit;
28854
+ let file_bindkeys = vue.ref(props2.modelValue || []);
28451
28855
  const storageFiles = vue.ref([]);
28452
- const compareIds = (v1, v2) => [v1].flat().join(",") === [v2].flat().join(",");
28453
28856
  vue.onMounted(() => {
28454
28857
  if (!props2.files && [file_bindkeys.value].flat().length) {
28455
28858
  const ids = [file_bindkeys.value].flat().filter(Boolean);
@@ -28479,21 +28882,19 @@ const _sfc_main$e = /* @__PURE__ */ vue.defineComponent({
28479
28882
  },
28480
28883
  { immediate: true }
28481
28884
  );
28482
- vue.watch(
28483
- () => storageFiles.value,
28484
- (newFiles) => {
28485
- let idValue;
28486
- if (props2.multiple) {
28487
- idValue = newFiles.map((f2) => f2[bindKey2]);
28488
- } else {
28489
- idValue = newFiles[0][bindKey2] || "";
28490
- }
28491
- if (!compareIds(file_bindkeys.value, idValue)) {
28492
- file_bindkeys.value = idValue;
28493
- }
28494
- },
28495
- { deep: true }
28496
- );
28885
+ function updateModelValue() {
28886
+ let idValue;
28887
+ if (props2.multiple) {
28888
+ idValue = storageFiles.value.map((f2) => f2[bindKey2]);
28889
+ } else {
28890
+ idValue = storageFiles.value[0][bindKey2] || "";
28891
+ }
28892
+ const isSame = [idValue].flat().every((id) => [file_bindkeys.value].flat().includes(id));
28893
+ if (!isSame) {
28894
+ file_bindkeys.value = idValue;
28895
+ emit2("update:modelValue", file_bindkeys.value);
28896
+ }
28897
+ }
28497
28898
  const fileQueue = vue.ref([]);
28498
28899
  let isDragOver = vue.ref(false);
28499
28900
  function preventDefault(e) {
@@ -28507,16 +28908,20 @@ const _sfc_main$e = /* @__PURE__ */ vue.defineComponent({
28507
28908
  if (props2.deleteEndpoint) {
28508
28909
  void bagel.delete(`${props2.deleteEndpoint}/${file.id}`);
28509
28910
  }
28911
+ updateModelValue();
28510
28912
  }
28511
- function flushQueue() {
28512
- fileQueue.value.forEach(async (file, i2) => {
28913
+ async function flushQueue() {
28914
+ for (const file of fileQueue.value) {
28915
+ file.uploading = true;
28513
28916
  if (!props2.multiple) storageFiles.value.splice(0, 1);
28514
28917
  const serverFile = await bagel.uploadFile(file.file, {
28515
28918
  onUploadProgress: (e) => file.progress = e.progress * 100 - 1
28516
28919
  });
28517
28920
  storageFiles.value.push(serverFile);
28921
+ const i2 = fileQueue.value.indexOf(file);
28518
28922
  fileQueue.value.splice(i2, 1);
28519
- });
28923
+ }
28924
+ updateModelValue();
28520
28925
  }
28521
28926
  function browse() {
28522
28927
  const input = document.createElement("input");
@@ -28525,7 +28930,9 @@ const _sfc_main$e = /* @__PURE__ */ vue.defineComponent({
28525
28930
  input.onchange = (e) => {
28526
28931
  const target = e.target;
28527
28932
  if (target.files) {
28528
- Array.from(target.files).forEach((file) => fileQueue.value.push({ name: file.name, file, progress: 0 }));
28933
+ Array.from(target.files).forEach(
28934
+ (file) => fileQueue.value.push({ name: file.name, file, progress: 0 })
28935
+ );
28529
28936
  }
28530
28937
  flushQueue();
28531
28938
  };
@@ -28544,7 +28951,9 @@ const _sfc_main$e = /* @__PURE__ */ vue.defineComponent({
28544
28951
  function drop3(e) {
28545
28952
  preventDefault(e);
28546
28953
  if (e.dataTransfer) {
28547
- Array.from(e.dataTransfer.files).forEach((file) => fileQueue.value.push({ name: file.name, file, progress: 0 }));
28954
+ Array.from(e.dataTransfer.files).forEach(
28955
+ (file) => fileQueue.value.push({ name: file.name, file, progress: 0 })
28956
+ );
28548
28957
  }
28549
28958
  isDragOver.value = false;
28550
28959
  flushQueue();
@@ -28582,7 +28991,7 @@ const _sfc_main$e = /* @__PURE__ */ vue.defineComponent({
28582
28991
  class: "preview",
28583
28992
  src: file.url,
28584
28993
  alt: ""
28585
- }, null, 8, _hoisted_5$5),
28994
+ }, null, 8, _hoisted_5$6),
28586
28995
  vue.createElementVNode("p", _hoisted_6$4, vue.toDisplayString(file.name), 1),
28587
28996
  vue.createVNode(vue.unref(Btn), {
28588
28997
  thin: "",
@@ -28639,14 +29048,15 @@ const _sfc_main$e = /* @__PURE__ */ vue.defineComponent({
28639
29048
  };
28640
29049
  }
28641
29050
  });
28642
- const $el = /* @__PURE__ */ _export_sfc(_sfc_main$e, [["__scopeId", "data-v-82316bcb"]]);
28643
- const _withScopeId$1 = (n2) => (vue.pushScopeId("data-v-50198c44"), n2 = n2(), vue.popScopeId(), n2);
29051
+ const $el = /* @__PURE__ */ _export_sfc(_sfc_main$e, [["__scopeId", "data-v-1ce244aa"]]);
29052
+ const _withScopeId$1 = (n2) => (vue.pushScopeId("data-v-eceeebfb"), n2 = n2(), vue.popScopeId(), n2);
28644
29053
  const _hoisted_1$i = ["title"];
28645
29054
  const _hoisted_2$d = /* @__PURE__ */ _withScopeId$1(() => /* @__PURE__ */ vue.createElementVNode("span", { class: "slider round" }, null, -1));
28646
29055
  const _hoisted_3$9 = [
28647
29056
  _hoisted_2$d
28648
29057
  ];
28649
- const _hoisted_4$5 = ["id"];
29058
+ const _hoisted_4$5 = ["id", "required"];
29059
+ const _hoisted_5$5 = ["for"];
28650
29060
  const _sfc_main$d = /* @__PURE__ */ vue.defineComponent({
28651
29061
  __name: "ToggleInput",
28652
29062
  props: /* @__PURE__ */ vue.mergeModels({
@@ -28654,14 +29064,16 @@ const _sfc_main$d = /* @__PURE__ */ vue.defineComponent({
28654
29064
  id: {},
28655
29065
  title: {},
28656
29066
  small: { type: Boolean },
29067
+ required: { type: Boolean },
28657
29068
  defaultValue: { type: Boolean, default: false }
28658
29069
  }, {
28659
- "modelValue": { type: Boolean },
29070
+ "modelValue": { type: Boolean, ...{ default: void 0 } },
28660
29071
  "modelModifiers": {}
28661
29072
  }),
28662
29073
  emits: ["update:modelValue"],
28663
29074
  setup(__props) {
28664
29075
  const props2 = __props;
29076
+ const inputId = vue.ref(props2.id || Math.random().toString(36).substring(7));
28665
29077
  const checked = vue.useModel(__props, "modelValue");
28666
29078
  vue.onMounted(() => {
28667
29079
  if (checked.value === void 0) checked.value = props2.defaultValue;
@@ -28669,26 +29081,30 @@ const _sfc_main$d = /* @__PURE__ */ vue.defineComponent({
28669
29081
  return (_ctx, _cache) => {
28670
29082
  return vue.openBlock(), vue.createElementBlock("div", {
28671
29083
  class: vue.normalizeClass(["bagel-input bgl-checkbox justify-content-center gap-1", { small: _ctx.small }]),
28672
- title: _ctx.title
29084
+ title: _ctx.title,
29085
+ onClick: _cache[1] || (_cache[1] = vue.withModifiers(($event) => checked.value = !checked.value, ["prevent"]))
28673
29086
  }, [
28674
29087
  vue.createElementVNode("div", {
28675
29088
  class: vue.normalizeClass(["switch", { checked: checked.value }])
28676
29089
  }, _hoisted_3$9, 2),
28677
- vue.createElementVNode("label", null, [
28678
- vue.createTextVNode(vue.toDisplayString(_ctx.label) + " ", 1),
28679
- vue.withDirectives(vue.createElementVNode("input", {
28680
- id: _ctx.id,
28681
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => checked.value = $event),
28682
- type: "checkbox"
28683
- }, null, 8, _hoisted_4$5), [
28684
- [vue.vModelCheckbox, checked.value]
28685
- ])
28686
- ])
29090
+ vue.withDirectives(vue.createElementVNode("input", {
29091
+ id: inputId.value,
29092
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => checked.value = $event),
29093
+ type: "checkbox",
29094
+ required: _ctx.required
29095
+ }, null, 8, _hoisted_4$5), [
29096
+ [vue.vModelCheckbox, checked.value]
29097
+ ]),
29098
+ vue.createElementVNode("label", { for: inputId.value }, [
29099
+ vue.renderSlot(_ctx.$slots, "label", {}, () => [
29100
+ vue.createTextVNode(vue.toDisplayString(_ctx.label), 1)
29101
+ ], true)
29102
+ ], 8, _hoisted_5$5)
28687
29103
  ], 10, _hoisted_1$i);
28688
29104
  };
28689
29105
  }
28690
29106
  });
28691
- const ToggleInput = /* @__PURE__ */ _export_sfc(_sfc_main$d, [["__scopeId", "data-v-50198c44"]]);
29107
+ const ToggleInput = /* @__PURE__ */ _export_sfc(_sfc_main$d, [["__scopeId", "data-v-eceeebfb"]]);
28692
29108
  function OrderedMap(content) {
28693
29109
  this.content = content;
28694
29110
  }
@@ -62522,7 +62938,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
62522
62938
  };
62523
62939
  }
62524
62940
  });
62525
- const TabbedLayout = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-bb096cbe"]]);
62941
+ const TabbedLayout = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-70d6cf78"]]);
62526
62942
  const countryArray = [
62527
62943
  ["Afghanistan (افغانستان)", "AF", "93"],
62528
62944
  ["Albania (Shqipëri)", "AL", "355"],
@@ -62909,11 +63325,14 @@ exports.copyText = copyText;
62909
63325
  exports.debounce = debounce$2;
62910
63326
  exports.denullify = denullify;
62911
63327
  exports.formatString = formatString;
63328
+ exports.getFallbackSchema = getFallbackSchema;
62912
63329
  exports.i18nTInjectionKey = i18nTInjectionKey;
62913
63330
  exports.iffer = iffer;
62914
63331
  exports.initials = initials;
63332
+ exports.isDate = isDate$1;
62915
63333
  exports.keyToLabel = keyToLabel;
62916
63334
  exports.useBagel = useBagel;
63335
+ exports.useBglSchema = useBglSchema;
62917
63336
  exports.useEscape = useEscape;
62918
63337
  exports.useI18nT = useI18nT;
62919
63338
  exports.useLang = useLang;