@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.cjs CHANGED
@@ -5284,8 +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
+ }
5288
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
+ }
5289
5304
  const bagelInjectionKey = Symbol("bagel");
5290
5305
  const i18nTInjectionKey = Symbol("bagel");
5291
5306
  function useBagel() {
@@ -5374,19 +5389,30 @@ const ModalPlugin = {
5374
5389
  app.component("ModalContainer", ModalComponent);
5375
5390
  }
5376
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
+ }
5377
5402
  const _sfc_main$O = /* @__PURE__ */ vue.defineComponent({
5378
5403
  __name: "MaterialIcon",
5379
5404
  props: {
5380
5405
  icon: {},
5381
5406
  name: {},
5382
5407
  size: {},
5383
- color: {}
5408
+ color: {},
5409
+ weight: {}
5384
5410
  },
5385
5411
  setup(__props) {
5386
5412
  return (_ctx, _cache) => {
5387
- return vue.openBlock(), vue.createElementBlock("div", {
5413
+ return vue.openBlock(), vue.createElementBlock("span", {
5388
5414
  class: "bgl_icon-font",
5389
- 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}` })
5390
5416
  }, vue.toDisplayString(_ctx.icon || _ctx.name), 5);
5391
5417
  };
5392
5418
  }
@@ -5395,7 +5421,7 @@ const _hoisted_1$J = { class: "full-nav" };
5395
5421
  const _hoisted_2$A = { class: "nav-scroll" };
5396
5422
  const _hoisted_3$n = { class: "nav-links-wrapper" };
5397
5423
  const _hoisted_4$f = { class: "tooltip" };
5398
- const _hoisted_5$c = { class: "bot-buttons-wrapper" };
5424
+ const _hoisted_5$d = { class: "bot-buttons-wrapper" };
5399
5425
  const _hoisted_6$8 = { class: "tooltip" };
5400
5426
  const _sfc_main$N = /* @__PURE__ */ vue.defineComponent({
5401
5427
  __name: "NavBar",
@@ -5450,7 +5476,7 @@ const _sfc_main$N = /* @__PURE__ */ vue.defineComponent({
5450
5476
  }), 128))
5451
5477
  ])
5452
5478
  ]),
5453
- vue.createElementVNode("div", _hoisted_5$c, [
5479
+ vue.createElementVNode("div", _hoisted_5$d, [
5454
5480
  (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(_ctx.footerLinks, (link) => {
5455
5481
  return vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(link.to ? "router-link" : "div"), {
5456
5482
  key: link.label,
@@ -5517,8 +5543,8 @@ const _sfc_main$M = /* @__PURE__ */ vue.defineComponent({
5517
5543
  },
5518
5544
  setup(__props) {
5519
5545
  vue.useCssVars((_ctx) => ({
5520
- "5113a6cf": computedBackgroundColor.value,
5521
- "ae07d62c": cumputedTextColor.value
5546
+ "39397c0e": computedBackgroundColor.value,
5547
+ "427e8569": cumputedTextColor.value
5522
5548
  }));
5523
5549
  const props2 = __props;
5524
5550
  const isComponent = vue.computed(() => {
@@ -5607,7 +5633,7 @@ const _sfc_main$M = /* @__PURE__ */ vue.defineComponent({
5607
5633
  };
5608
5634
  }
5609
5635
  });
5610
- 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"]]);
5611
5637
  const _hoisted_1$H = {
5612
5638
  key: 0,
5613
5639
  class: "tool-bar"
@@ -5990,67 +6016,369 @@ const _sfc_main$G = /* @__PURE__ */ vue.defineComponent({
5990
6016
  };
5991
6017
  }
5992
6018
  });
5993
- const _hoisted_1$C = { class: "table-list-wrap h-100" };
5994
- const _hoisted_2$t = { class: "infinite-wrapper" };
5995
- const _hoisted_3$j = { class: "row first-row" };
5996
- const _hoisted_4$d = ["onClick"];
5997
- const _hoisted_5$b = { class: "flex" };
5998
- const _hoisted_6$7 = ["onClick"];
5999
- 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 };
6000
6346
  const _sfc_main$F = /* @__PURE__ */ vue.defineComponent({
6001
6347
  __name: "TableSchema",
6002
- props: {
6348
+ props: /* @__PURE__ */ vue.mergeModels({
6003
6349
  selectedItems: {},
6004
6350
  data: {},
6005
6351
  schema: { type: Function },
6006
6352
  showFields: {}
6007
- },
6008
- 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"]),
6009
6360
  setup(__props, { emit: __emit }) {
6361
+ vue.useCssVars((_ctx) => ({
6362
+ "59d71ad2": vue.unref(computedItemHiehgt)
6363
+ }));
6010
6364
  const props2 = __props;
6011
6365
  const emit2 = __emit;
6012
6366
  const slots = vue.useSlots();
6013
- const loading = vue.ref(true);
6014
- let selectedItems = vue.ref(props2.selectedItems || []);
6015
- vue.computed({
6016
- get: () => selectedItems.value,
6017
- set: (value) => {
6018
- selectedItems.value = value;
6019
- emit2("update:selectedItems", value);
6020
- }
6021
- });
6022
- function selectElement(item) {
6023
- emit2("select", item);
6024
- }
6025
- 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`);
6026
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));
6027
6374
  const computedSortField = vue.computed(() => `_transformed_${sortField.value}`);
6028
- function getFallbackSchema() {
6029
- const keys4 = [
6030
- ...new Set((props2.data || []).map(Object.keys).flat())
6031
- ];
6032
- const schema = keys4.map((id) => ({
6033
- id,
6034
- label: keyToLabel(id)
6035
- }));
6036
- return props2.showFields ? schema.filter((f2) => {
6037
- var _a2;
6038
- return ((_a2 = props2.showFields) == null ? void 0 : _a2.includes(f2.id)) ?? !f2.id;
6039
- }) : schema;
6040
- }
6041
- const computedSchema = vue.computed(() => {
6042
- let _schema = props2.schema;
6043
- if (typeof _schema === "function") {
6044
- _schema = _schema();
6045
- }
6046
- if (_schema) {
6047
- return props2.showFields ? _schema.filter((f2) => {
6048
- var _a2;
6049
- return (_a2 = props2.showFields) == null ? void 0 : _a2.includes(f2.id);
6050
- }) : _schema;
6051
- }
6052
- return getFallbackSchema();
6053
- });
6375
+ const computedSchema = vue.computed(
6376
+ () => useBglSchema({
6377
+ schema: props2.schema,
6378
+ showFields: props2.showFields,
6379
+ data: props2.data
6380
+ })
6381
+ );
6054
6382
  function transform(rowData) {
6055
6383
  var _a2;
6056
6384
  const obj = { ...rowData };
@@ -6101,68 +6429,138 @@ const _sfc_main$F = /* @__PURE__ */ vue.defineComponent({
6101
6429
  }
6102
6430
  emit2("orderBy", `${fieldname} ${sortDirection.value}`.trim());
6103
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
+ }
6104
6477
  return (_ctx, _cache) => {
6105
- return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$C, [
6106
- vue.createElementVNode("table", _hoisted_2$t, [
6107
- vue.createElementVNode("thead", _hoisted_3$j, [
6108
- (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(computedSchema.value, (field) => {
6109
- return vue.openBlock(), vue.createElementBlock("th", {
6110
- key: field.id,
6111
- class: "col",
6112
- onClick: ($event) => sort2((field == null ? void 0 : field.id) || "")
6113
- }, [
6114
- vue.createElementVNode("div", _hoisted_5$b, [
6115
- vue.createTextVNode(vue.toDisplayString(field.label || vue.unref(keyToLabel)(field.id)) + " ", 1),
6116
- vue.createElementVNode("div", {
6117
- class: vue.normalizeClass(["list-arrows", { sorted: vue.unref(sortField) === field.id }])
6118
- }, [
6119
- vue.createVNode(vue.unref(_sfc_main$O), {
6120
- class: vue.normalizeClass({ desc: vue.unref(sortDirection) === "DESC" }),
6121
- icon: "keyboard_arrow_up"
6122
- }, null, 8, ["class"])
6123
- ], 2)
6124
- ])
6125
- ], 8, _hoisted_4$d);
6126
- }), 128))
6127
- ]),
6128
- vue.createElementVNode("tbody", {
6129
- ref: "infinite",
6130
- class: vue.normalizeClass(["rows infinite", { loading: loading.value }])
6131
- }, [
6132
- (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(computedData.value, (row) => {
6133
- return vue.openBlock(), vue.createElementBlock("tr", {
6134
- key: row.id,
6135
- class: "row row-item position-relative",
6136
- onClick: ($event) => selectElement(row)
6137
- }, [
6138
- (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(computedSchema.value, (field) => {
6139
- return vue.openBlock(), vue.createElementBlock("td", {
6140
- key: `${field.id}-${row.id}`,
6141
- class: "col"
6142
- }, [
6143
- field.id && vue.unref(slots)[field.id] ? vue.renderSlot(_ctx.$slots, field.id, {
6144
- key: 0,
6145
- row,
6146
- field
6147
- }, void 0, true) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_7$2, [
6148
- vue.createVNode(vue.unref(_sfc_main$p), {
6149
- class: "embedded-field",
6150
- field,
6151
- modelValue: row,
6152
- label: ""
6153
- }, null, 8, ["field", "modelValue"])
6154
- ]))
6155
- ]);
6156
- }), 128))
6157
- ], 8, _hoisted_6$7);
6158
- }), 128))
6159
- ], 2)
6160
- ])
6161
- ]);
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);
6162
6560
  };
6163
6561
  }
6164
6562
  });
6165
- const TableSchema = /* @__PURE__ */ _export_sfc(_sfc_main$F, [["__scopeId", "data-v-1628cf1a"]]);
6563
+ const TableSchema = /* @__PURE__ */ _export_sfc(_sfc_main$F, [["__scopeId", "data-v-73d79ea6"]]);
6166
6564
  const _sfc_main$E = {};
6167
6565
  const _hoisted_1$B = { class: "flex space-between" };
6168
6566
  function _sfc_render$1(_ctx, _cache) {
@@ -6204,7 +6602,7 @@ const _hoisted_2$s = {
6204
6602
  };
6205
6603
  const _hoisted_3$i = { class: "key" };
6206
6604
  const _hoisted_4$c = { key: 1 };
6207
- const _hoisted_5$a = { class: "key" };
6605
+ const _hoisted_5$b = { class: "key" };
6208
6606
  const _hoisted_6$6 = { class: "vlue" };
6209
6607
  const _sfc_main$C = /* @__PURE__ */ vue.defineComponent({
6210
6608
  __name: "DataPreview",
@@ -6220,16 +6618,12 @@ const _sfc_main$C = /* @__PURE__ */ vue.defineComponent({
6220
6618
  setup(__props) {
6221
6619
  const props2 = __props;
6222
6620
  const itemData = vue.useModel(__props, "data");
6223
- const computedSchema = vue.computed(() => {
6224
- const schema = Object.keys(itemData.value);
6225
- if (props2.showFields && props2.showFields.length) {
6226
- return schema.filter((field) => {
6227
- var _a2;
6228
- return (_a2 = props2.showFields) == null ? void 0 : _a2.includes(field);
6229
- });
6230
- }
6231
- return schema;
6232
- });
6621
+ const computedSchema = vue.computed(
6622
+ () => getFallbackSchema(
6623
+ [itemData.value],
6624
+ props2.showFields
6625
+ )
6626
+ );
6233
6627
  return (_ctx, _cache) => {
6234
6628
  var _a2;
6235
6629
  return __props.data ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$A, [
@@ -6254,13 +6648,13 @@ const _sfc_main$C = /* @__PURE__ */ vue.defineComponent({
6254
6648
  ], 64);
6255
6649
  }), 128)),
6256
6650
  !((_a2 = _ctx.schema) == null ? void 0 : _a2.length) ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_4$c, [
6257
- (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 }) => {
6258
6652
  return vue.openBlock(), vue.createElementBlock("div", {
6259
- key,
6653
+ key: id,
6260
6654
  class: "data-row"
6261
6655
  }, [
6262
- vue.createElementVNode("div", _hoisted_5$a, vue.toDisplayString(vue.unref(keyToLabel)(key)), 1),
6263
- 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)
6264
6658
  ]);
6265
6659
  }), 128))
6266
6660
  ])) : vue.createCommentVNode("", true),
@@ -6269,7 +6663,7 @@ const _sfc_main$C = /* @__PURE__ */ vue.defineComponent({
6269
6663
  };
6270
6664
  }
6271
6665
  });
6272
- 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"]]);
6273
6667
  const _hoisted_1$z = {
6274
6668
  key: 0,
6275
6669
  class: "card_label"
@@ -16317,7 +16711,6 @@ const _sfc_main$s = /* @__PURE__ */ vue.defineComponent({
16317
16711
  if (props2.address) {
16318
16712
  geocodeAddress(props2.address).catch(console.error);
16319
16713
  }
16320
- console.log(props2.zoomControl, props2.center);
16321
16714
  map4.value = L$1.map(id.value, {
16322
16715
  center: props2.center,
16323
16716
  zoom: props2.zoom,
@@ -16337,7 +16730,8 @@ const _sfc_main$s = /* @__PURE__ */ vue.defineComponent({
16337
16730
  }
16338
16731
  async function geocodeAddress(address) {
16339
16732
  var _a2;
16340
- 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)}`;
16341
16735
  const res = await fetch(geocodeUrl);
16342
16736
  const data2 = await res.json() || [];
16343
16737
  data2.forEach((element) => {
@@ -16622,16 +17016,20 @@ const _sfc_main$o = /* @__PURE__ */ vue.defineComponent({
16622
17016
  id: {},
16623
17017
  title: {},
16624
17018
  small: { type: Boolean },
16625
- required: { type: Boolean }
17019
+ required: { type: Boolean },
17020
+ defaultValue: { type: Boolean, default: false }
16626
17021
  }, {
16627
- "modelValue": { type: Boolean, ...{ default: false } },
17022
+ "modelValue": { type: Boolean, ...{ default: void 0 } },
16628
17023
  "modelModifiers": {}
16629
17024
  }),
16630
17025
  emits: ["update:modelValue"],
16631
17026
  setup(__props) {
16632
17027
  const props2 = __props;
16633
- 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));
16634
17029
  const checked = vue.useModel(__props, "modelValue");
17030
+ vue.onMounted(() => {
17031
+ if (checked.value === void 0) checked.value = props2.defaultValue;
17032
+ });
16635
17033
  return (_ctx, _cache) => {
16636
17034
  return vue.openBlock(), vue.createElementBlock("div", {
16637
17035
  class: vue.normalizeClass(["bagel-input bgl-checkbox align-items-center ps-025", { small: _ctx.small }]),
@@ -16655,7 +17053,7 @@ const _sfc_main$o = /* @__PURE__ */ vue.defineComponent({
16655
17053
  };
16656
17054
  }
16657
17055
  });
16658
- 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"]]);
16659
17057
  function toDate(argument) {
16660
17058
  const argStr = Object.prototype.toString.call(argument);
16661
17059
  if (argument instanceof Date || typeof argument === "object" && argStr === "[object Date]") {
@@ -25110,6 +25508,7 @@ const _hoisted_2$m = { key: 0 };
25110
25508
  const _sfc_main$n = /* @__PURE__ */ vue.defineComponent({
25111
25509
  __name: "DateInput",
25112
25510
  props: {
25511
+ required: { type: Boolean },
25113
25512
  label: {},
25114
25513
  editMode: { type: Boolean, default: true },
25115
25514
  small: { type: Boolean, default: false },
@@ -25154,6 +25553,7 @@ const _sfc_main$n = /* @__PURE__ */ vue.defineComponent({
25154
25553
  ref: datePicker,
25155
25554
  modelValue: date2.value,
25156
25555
  "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => date2.value = $event),
25556
+ required: _ctx.required,
25157
25557
  "auto-apply": true,
25158
25558
  "enable-time-picker": _ctx.enableTime,
25159
25559
  "allowed-dates": _ctx.allowedDates
@@ -25162,7 +25562,7 @@ const _sfc_main$n = /* @__PURE__ */ vue.defineComponent({
25162
25562
  "minutes-increment": _ctx.minutesIncrement,
25163
25563
  "minutes-grid-increment": _ctx.minutesGridIncrement,
25164
25564
  "start-time": { hours: 8, minutes: 0 }
25165
- }), 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"])
25166
25566
  ], 10, _hoisted_1$s);
25167
25567
  };
25168
25568
  }
@@ -27907,7 +28307,7 @@ const _hoisted_1$p = ["title"];
27907
28307
  const _hoisted_2$j = { class: "bagel-input" };
27908
28308
  const _hoisted_3$e = { class: "table-side-scroll" };
27909
28309
  const _hoisted_4$a = { class: "table-header" };
27910
- const _hoisted_5$9 = { class: "table-reorder" };
28310
+ const _hoisted_5$a = { class: "table-reorder" };
27911
28311
  const _hoisted_6$5 = { class: "table-action" };
27912
28312
  const _sfc_main$k = /* @__PURE__ */ vue.defineComponent({
27913
28313
  __name: "TableField",
@@ -28005,7 +28405,7 @@ const _sfc_main$k = /* @__PURE__ */ vue.defineComponent({
28005
28405
  key: row.id,
28006
28406
  class: "flex table-row"
28007
28407
  }, [
28008
- vue.createElementVNode("div", _hoisted_5$9, [
28408
+ vue.createElementVNode("div", _hoisted_5$a, [
28009
28409
  vue.createVNode(vue.unref(_sfc_main$O), { icon: "more_vert" })
28010
28410
  ]),
28011
28411
  (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList((_a3 = vue.unref(entityMeta)) == null ? void 0 : _a3.fields, (field) => {
@@ -28058,7 +28458,7 @@ const _hoisted_1$o = ["title"];
28058
28458
  const _hoisted_2$i = ["for"];
28059
28459
  const _hoisted_3$d = ["id", "title", "autocomplete", "type", "placeholder", "disabled", "required", "pattern"];
28060
28460
  const _hoisted_4$9 = ["id", "title", "type", "rows", "placeholder", "disabled", "required", "pattern"];
28061
- const _hoisted_5$8 = { key: 2 };
28461
+ const _hoisted_5$9 = { key: 2 };
28062
28462
  const _sfc_main$j = /* @__PURE__ */ vue.defineComponent({
28063
28463
  __name: "TextInput",
28064
28464
  props: {
@@ -28164,7 +28564,7 @@ const _sfc_main$j = /* @__PURE__ */ vue.defineComponent({
28164
28564
  }, _ctx.nativeInputAttrs, { onInput: updateInputVal }), null, 16, _hoisted_4$9)), [
28165
28565
  [vue.vModelText, vue.unref(inputVal)]
28166
28566
  ]),
28167
- _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)
28168
28568
  ], 8, _hoisted_2$i),
28169
28569
  _ctx.iconStart ? (vue.openBlock(), vue.createBlock(vue.unref(_sfc_main$O), {
28170
28570
  key: 0,
@@ -28264,7 +28664,7 @@ const _hoisted_3$c = {
28264
28664
  class: "time-wrap"
28265
28665
  };
28266
28666
  const _hoisted_4$8 = ["id", "name", "value"];
28267
- const _hoisted_5$7 = ["for"];
28667
+ const _hoisted_5$8 = ["for"];
28268
28668
  const _sfc_main$g = /* @__PURE__ */ vue.defineComponent({
28269
28669
  __name: "DatePicker",
28270
28670
  props: {
@@ -28327,7 +28727,7 @@ const _sfc_main$g = /* @__PURE__ */ vue.defineComponent({
28327
28727
  ]),
28328
28728
  vue.createElementVNode("label", {
28329
28729
  for: `${hr2}_${_ctx.id}`
28330
- }, vue.toDisplayString(hr2), 9, _hoisted_5$7)
28730
+ }, vue.toDisplayString(hr2), 9, _hoisted_5$8)
28331
28731
  ], 64);
28332
28732
  }), 128))
28333
28733
  ])) : vue.createCommentVNode("", true)
@@ -28339,7 +28739,7 @@ const _hoisted_1$k = { class: "bagel-input" };
28339
28739
  const _hoisted_2$f = { class: "pb-025" };
28340
28740
  const _hoisted_3$b = { class: "flex gap-05 flex-wrap" };
28341
28741
  const _hoisted_4$7 = ["id", "name", "value", "checked"];
28342
- const _hoisted_5$6 = ["for"];
28742
+ const _hoisted_5$7 = ["for"];
28343
28743
  const _sfc_main$f = /* @__PURE__ */ vue.defineComponent({
28344
28744
  __name: "RadioPillsInput",
28345
28745
  props: {
@@ -28399,7 +28799,7 @@ const _sfc_main$f = /* @__PURE__ */ vue.defineComponent({
28399
28799
  }, null, 40, _hoisted_4$7),
28400
28800
  vue.createElementVNode("label", {
28401
28801
  for: `${_ctx.id}-${getValue(option2)}`
28402
- }, vue.toDisplayString(getLabel(option2)), 9, _hoisted_5$6)
28802
+ }, vue.toDisplayString(getLabel(option2)), 9, _hoisted_5$7)
28403
28803
  ]);
28404
28804
  }), 128))
28405
28805
  ])
@@ -28408,7 +28808,7 @@ const _sfc_main$f = /* @__PURE__ */ vue.defineComponent({
28408
28808
  }
28409
28809
  });
28410
28810
  const RadioPillsInput = /* @__PURE__ */ _export_sfc(_sfc_main$f, [["__scopeId", "data-v-681173be"]]);
28411
- 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);
28412
28812
  const _hoisted_1$j = { class: "bagel-input" };
28413
28813
  const _hoisted_2$e = {
28414
28814
  key: 0,
@@ -28419,7 +28819,7 @@ const _hoisted_4$6 = {
28419
28819
  key: 1,
28420
28820
  class: "multi-image-item previewName"
28421
28821
  };
28422
- const _hoisted_5$5 = ["src"];
28822
+ const _hoisted_5$6 = ["src"];
28423
28823
  const _hoisted_6$4 = { class: "no-margin" };
28424
28824
  const _hoisted_7$1 = {
28425
28825
  key: 0,
@@ -28436,25 +28836,23 @@ const _hoisted_12 = {
28436
28836
  const _hoisted_13 = /* @__PURE__ */ _withScopeId$2(() => /* @__PURE__ */ vue.createElementVNode("p", null, "Drop files here or click to upload", -1));
28437
28837
  const _sfc_main$e = /* @__PURE__ */ vue.defineComponent({
28438
28838
  __name: "FileUpload",
28439
- props: /* @__PURE__ */ vue.mergeModels({
28839
+ props: {
28440
28840
  label: {},
28441
28841
  multiple: { type: Boolean },
28442
28842
  files: {},
28443
28843
  deleteEndpoint: {},
28444
28844
  bindkey: {},
28845
+ modelValue: {},
28445
28846
  width: {}
28446
- }, {
28447
- "modelValue": {},
28448
- "modelModifiers": {}
28449
- }),
28847
+ },
28450
28848
  emits: ["update:modelValue"],
28451
- setup(__props) {
28849
+ setup(__props, { emit: __emit }) {
28452
28850
  const props2 = __props;
28453
28851
  const bagel = useBagel();
28454
28852
  const bindKey2 = props2.bindkey || "id";
28455
- const file_bindkeys = vue.useModel(__props, "modelValue");
28853
+ const emit2 = __emit;
28854
+ let file_bindkeys = vue.ref(props2.modelValue || []);
28456
28855
  const storageFiles = vue.ref([]);
28457
- const compareIds = (v1, v2) => [v1].flat().join(",") === [v2].flat().join(",");
28458
28856
  vue.onMounted(() => {
28459
28857
  if (!props2.files && [file_bindkeys.value].flat().length) {
28460
28858
  const ids = [file_bindkeys.value].flat().filter(Boolean);
@@ -28484,21 +28882,19 @@ const _sfc_main$e = /* @__PURE__ */ vue.defineComponent({
28484
28882
  },
28485
28883
  { immediate: true }
28486
28884
  );
28487
- vue.watch(
28488
- () => storageFiles.value,
28489
- (newFiles) => {
28490
- let idValue;
28491
- if (props2.multiple) {
28492
- idValue = newFiles.map((f2) => f2[bindKey2]);
28493
- } else {
28494
- idValue = newFiles[0][bindKey2] || "";
28495
- }
28496
- if (!compareIds(file_bindkeys.value, idValue)) {
28497
- file_bindkeys.value = idValue;
28498
- }
28499
- },
28500
- { deep: true }
28501
- );
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
+ }
28502
28898
  const fileQueue = vue.ref([]);
28503
28899
  let isDragOver = vue.ref(false);
28504
28900
  function preventDefault(e) {
@@ -28512,16 +28908,20 @@ const _sfc_main$e = /* @__PURE__ */ vue.defineComponent({
28512
28908
  if (props2.deleteEndpoint) {
28513
28909
  void bagel.delete(`${props2.deleteEndpoint}/${file.id}`);
28514
28910
  }
28911
+ updateModelValue();
28515
28912
  }
28516
- function flushQueue() {
28517
- fileQueue.value.forEach(async (file, i2) => {
28913
+ async function flushQueue() {
28914
+ for (const file of fileQueue.value) {
28915
+ file.uploading = true;
28518
28916
  if (!props2.multiple) storageFiles.value.splice(0, 1);
28519
28917
  const serverFile = await bagel.uploadFile(file.file, {
28520
28918
  onUploadProgress: (e) => file.progress = e.progress * 100 - 1
28521
28919
  });
28522
28920
  storageFiles.value.push(serverFile);
28921
+ const i2 = fileQueue.value.indexOf(file);
28523
28922
  fileQueue.value.splice(i2, 1);
28524
- });
28923
+ }
28924
+ updateModelValue();
28525
28925
  }
28526
28926
  function browse() {
28527
28927
  const input = document.createElement("input");
@@ -28530,7 +28930,9 @@ const _sfc_main$e = /* @__PURE__ */ vue.defineComponent({
28530
28930
  input.onchange = (e) => {
28531
28931
  const target = e.target;
28532
28932
  if (target.files) {
28533
- 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
+ );
28534
28936
  }
28535
28937
  flushQueue();
28536
28938
  };
@@ -28549,7 +28951,9 @@ const _sfc_main$e = /* @__PURE__ */ vue.defineComponent({
28549
28951
  function drop3(e) {
28550
28952
  preventDefault(e);
28551
28953
  if (e.dataTransfer) {
28552
- 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
+ );
28553
28957
  }
28554
28958
  isDragOver.value = false;
28555
28959
  flushQueue();
@@ -28587,7 +28991,7 @@ const _sfc_main$e = /* @__PURE__ */ vue.defineComponent({
28587
28991
  class: "preview",
28588
28992
  src: file.url,
28589
28993
  alt: ""
28590
- }, null, 8, _hoisted_5$5),
28994
+ }, null, 8, _hoisted_5$6),
28591
28995
  vue.createElementVNode("p", _hoisted_6$4, vue.toDisplayString(file.name), 1),
28592
28996
  vue.createVNode(vue.unref(Btn), {
28593
28997
  thin: "",
@@ -28644,14 +29048,15 @@ const _sfc_main$e = /* @__PURE__ */ vue.defineComponent({
28644
29048
  };
28645
29049
  }
28646
29050
  });
28647
- const $el = /* @__PURE__ */ _export_sfc(_sfc_main$e, [["__scopeId", "data-v-82316bcb"]]);
28648
- 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);
28649
29053
  const _hoisted_1$i = ["title"];
28650
29054
  const _hoisted_2$d = /* @__PURE__ */ _withScopeId$1(() => /* @__PURE__ */ vue.createElementVNode("span", { class: "slider round" }, null, -1));
28651
29055
  const _hoisted_3$9 = [
28652
29056
  _hoisted_2$d
28653
29057
  ];
28654
- const _hoisted_4$5 = ["id"];
29058
+ const _hoisted_4$5 = ["id", "required"];
29059
+ const _hoisted_5$5 = ["for"];
28655
29060
  const _sfc_main$d = /* @__PURE__ */ vue.defineComponent({
28656
29061
  __name: "ToggleInput",
28657
29062
  props: /* @__PURE__ */ vue.mergeModels({
@@ -28659,14 +29064,16 @@ const _sfc_main$d = /* @__PURE__ */ vue.defineComponent({
28659
29064
  id: {},
28660
29065
  title: {},
28661
29066
  small: { type: Boolean },
29067
+ required: { type: Boolean },
28662
29068
  defaultValue: { type: Boolean, default: false }
28663
29069
  }, {
28664
- "modelValue": { type: Boolean },
29070
+ "modelValue": { type: Boolean, ...{ default: void 0 } },
28665
29071
  "modelModifiers": {}
28666
29072
  }),
28667
29073
  emits: ["update:modelValue"],
28668
29074
  setup(__props) {
28669
29075
  const props2 = __props;
29076
+ const inputId = vue.ref(props2.id || Math.random().toString(36).substring(7));
28670
29077
  const checked = vue.useModel(__props, "modelValue");
28671
29078
  vue.onMounted(() => {
28672
29079
  if (checked.value === void 0) checked.value = props2.defaultValue;
@@ -28674,26 +29081,30 @@ const _sfc_main$d = /* @__PURE__ */ vue.defineComponent({
28674
29081
  return (_ctx, _cache) => {
28675
29082
  return vue.openBlock(), vue.createElementBlock("div", {
28676
29083
  class: vue.normalizeClass(["bagel-input bgl-checkbox justify-content-center gap-1", { small: _ctx.small }]),
28677
- title: _ctx.title
29084
+ title: _ctx.title,
29085
+ onClick: _cache[1] || (_cache[1] = vue.withModifiers(($event) => checked.value = !checked.value, ["prevent"]))
28678
29086
  }, [
28679
29087
  vue.createElementVNode("div", {
28680
29088
  class: vue.normalizeClass(["switch", { checked: checked.value }])
28681
29089
  }, _hoisted_3$9, 2),
28682
- vue.createElementVNode("label", null, [
28683
- vue.createTextVNode(vue.toDisplayString(_ctx.label) + " ", 1),
28684
- vue.withDirectives(vue.createElementVNode("input", {
28685
- id: _ctx.id,
28686
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => checked.value = $event),
28687
- type: "checkbox"
28688
- }, null, 8, _hoisted_4$5), [
28689
- [vue.vModelCheckbox, checked.value]
28690
- ])
28691
- ])
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)
28692
29103
  ], 10, _hoisted_1$i);
28693
29104
  };
28694
29105
  }
28695
29106
  });
28696
- 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"]]);
28697
29108
  function OrderedMap(content) {
28698
29109
  this.content = content;
28699
29110
  }
@@ -62527,7 +62938,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
62527
62938
  };
62528
62939
  }
62529
62940
  });
62530
- const TabbedLayout = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-bb096cbe"]]);
62941
+ const TabbedLayout = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-70d6cf78"]]);
62531
62942
  const countryArray = [
62532
62943
  ["Afghanistan (افغانستان)", "AF", "93"],
62533
62944
  ["Albania (Shqipëri)", "AL", "355"],
@@ -62914,12 +63325,14 @@ exports.copyText = copyText;
62914
63325
  exports.debounce = debounce$2;
62915
63326
  exports.denullify = denullify;
62916
63327
  exports.formatString = formatString;
63328
+ exports.getFallbackSchema = getFallbackSchema;
62917
63329
  exports.i18nTInjectionKey = i18nTInjectionKey;
62918
63330
  exports.iffer = iffer;
62919
63331
  exports.initials = initials;
62920
63332
  exports.isDate = isDate$1;
62921
63333
  exports.keyToLabel = keyToLabel;
62922
63334
  exports.useBagel = useBagel;
63335
+ exports.useBglSchema = useBglSchema;
62923
63336
  exports.useEscape = useEscape;
62924
63337
  exports.useI18nT = useI18nT;
62925
63338
  exports.useLang = useLang;