@bagelink/vue 1.4.26 → 1.4.28

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.
@@ -5,6 +5,7 @@ interface ImageProps {
5
5
  width?: string | number;
6
6
  height?: string | number;
7
7
  caption?: string;
8
+ modelValue?: string;
8
9
  }
9
10
  declare global {
10
11
  interface Window {
@@ -1 +1 @@
1
- {"version":3,"file":"Image.vue.d.ts","sourceRoot":"","sources":["../../src/components/Image.vue"],"names":[],"mappings":"AAyJA,UAAU,UAAU;IACnB,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IACvB,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IACxB,OAAO,CAAC,EAAE,MAAM,CAAA;CAChB;AAED,OAAO,CAAC,MAAM,CAAC;IACd,UAAU,MAAM;QACf,QAAQ,EAAE,GAAG,CAAA;KACb;CACD;;AA4LD,wBAMG"}
1
+ {"version":3,"file":"Image.vue.d.ts","sourceRoot":"","sources":["../../src/components/Image.vue"],"names":[],"mappings":"AA0JA,UAAU,UAAU;IACnB,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IACvB,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IACxB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,UAAU,CAAC,EAAE,MAAM,CAAA;CACnB;AAED,OAAO,CAAC,MAAM,CAAC;IACd,UAAU,MAAM;QACf,QAAQ,EAAE,GAAG,CAAA;KACb;CACD;;AA4LD,wBAMG"}
@@ -1 +1 @@
1
- {"version":3,"file":"DataTable.vue.d.ts","sourceRoot":"","sources":["../../../src/components/dataTable/DataTable.vue"],"names":[],"mappings":"AA+dA,OAAO,KAAK,EAAyB,IAAI,EAAE,MAAM,eAAe,CAAA;AAEhE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAA;AAY/D,MAAM,MAAM,eAAe,GAAG,KAAK,GAAG,MAAM,CAAA;AAC5C,MAAM,MAAM,UAAU,GAAG,GAAG,MAAM,IAAI,eAAe,EAAE,CAAA;yBAEtC,CAAC,SAAS;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;CAAE,EAAE,CAAC,SAAS,IAAI,CAAC,CAAC,CAAC,EACnE,aAAa,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,CAAC,OAAO,CAAC,EAC9D,YAAY,mBAAmB,CAAC,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,OAAO,CAAC,CAAC,EAC3G,eAAe,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,CAAC,QAAQ,CAAC,EACjE;WAyUO,mBAAmB,CAAC;;;;;;;;;;wBAlNV,MAAM,EAAE;0CAkNoE,CAAC,4BAA2B;oBACzG,OAAO,KAAK,EAAE,gBAAgB,CAAC,EAAE,CAAC,GAAG,IAAI;WAClD,GAAG;;;;UAnD0E,GAAG;UAqDjF,2TAAoC;EAEvC,KACQ,OAAO,KAAK,EAAE,KAAK,GAAG;IAAE,KAAK,CAAC,EAAE,OAAO,CAAC,OAAO,WAAW,CAAC,CAAA;CAAE;AApVzE,wBAoV4E;AAC5E,KAAK,mBAAmB,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAG,GAAG,EAAE,CAAC"}
1
+ {"version":3,"file":"DataTable.vue.d.ts","sourceRoot":"","sources":["../../../src/components/dataTable/DataTable.vue"],"names":[],"mappings":"AAicA,OAAO,KAAK,EAAyB,IAAI,EAAE,MAAM,eAAe,CAAA;AAEhE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAA;AAa/D,MAAM,MAAM,eAAe,GAAG,KAAK,GAAG,MAAM,CAAA;AAC5C,MAAM,MAAM,UAAU,GAAG,GAAG,MAAM,IAAI,eAAe,EAAE,CAAA;yBAEtC,CAAC,SAAS;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;CAAE,EAAE,CAAC,SAAS,IAAI,CAAC,CAAC,CAAC,EACnE,aAAa,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,CAAC,OAAO,CAAC,EAC9D,YAAY,mBAAmB,CAAC,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,OAAO,CAAC,CAAC,EAC3G,eAAe,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,CAAC,QAAQ,CAAC,EACjE;WA2UO,mBAAmB,CAAC;;;;;;;;;;wBApNV,MAAM,EAAE;0CAoNoE,CAAC,4BAA2B;oBACzG,OAAO,KAAK,EAAE,gBAAgB,CAAC,EAAE,CAAC,GAAG,IAAI;WAClD,GAAG;;;;UApD4E,GAAG;UAsDnF,2TAAoC;EAEvC,KACQ,OAAO,KAAK,EAAE,KAAK,GAAG;IAAE,KAAK,CAAC,EAAE,OAAO,CAAC,OAAO,WAAW,CAAC,CAAA;CAAE;AAtVzE,wBAsV4E;AAC5E,KAAK,mBAAmB,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAG,GAAG,EAAE,CAAC"}
package/dist/index.cjs CHANGED
@@ -1577,7 +1577,7 @@ const _hoisted_6$l = ["onClick"];
1577
1577
  const _hoisted_7$h = { class: "event-content" };
1578
1578
  const _hoisted_8$b = { class: "white-space ellipsis-1" };
1579
1579
  const _hoisted_9$8 = { class: "event-time opacity-8" };
1580
- const _hoisted_10$6 = { class: "color-primary txt-12 p-025" };
1580
+ const _hoisted_10$5 = { class: "color-primary txt-12 p-025" };
1581
1581
  const slotHeight$1 = 60;
1582
1582
  const slotDuration$1 = 60;
1583
1583
  const _sfc_main$18 = /* @__PURE__ */ vue.defineComponent({
@@ -1770,7 +1770,7 @@ const _sfc_main$18 = /* @__PURE__ */ vue.defineComponent({
1770
1770
  right: "10px"
1771
1771
  })
1772
1772
  }, [
1773
- vue.createElementVNode("div", _hoisted_10$6, vue.toDisplayString(dragState.value.startTime ? vue.unref(formatDate)(dragState.value.startTime, { fmt: "HH:mm" }) : "") + " - " + vue.toDisplayString(dragState.value.endTime ? vue.unref(formatDate)(dragState.value.endTime, { fmt: "HH:mm" }) : ""), 1)
1773
+ vue.createElementVNode("div", _hoisted_10$5, vue.toDisplayString(dragState.value.startTime ? vue.unref(formatDate)(dragState.value.startTime, { fmt: "HH:mm" }) : "") + " - " + vue.toDisplayString(dragState.value.endTime ? vue.unref(formatDate)(dragState.value.endTime, { fmt: "HH:mm" }) : ""), 1)
1774
1774
  ], 4)) : vue.createCommentVNode("", true)
1775
1775
  ], 32)
1776
1776
  ]),
@@ -9529,19 +9529,15 @@ function useTableVirtualization(options) {
9529
9529
  registerLastItemObserver
9530
9530
  };
9531
9531
  }
9532
- const _hoisted_1$R = {
9533
- key: 0,
9534
- class: "loading-table-wrapper z-99 h-100 w-100 absolute inset"
9535
- };
9536
- const _hoisted_2$E = { class: "infinite-wrapper" };
9537
- const _hoisted_3$x = { class: "row first-row" };
9538
- const _hoisted_4$l = { key: 0 };
9539
- const _hoisted_5$l = ["onClick"];
9540
- const _hoisted_6$h = { class: "flex" };
9541
- const _hoisted_7$d = ["onClick"];
9542
- const _hoisted_8$8 = { key: 0 };
9543
- const _hoisted_9$6 = ["value"];
9544
- const _hoisted_10$5 = { key: 1 };
9532
+ const _hoisted_1$R = { class: "infinite-wrapper" };
9533
+ const _hoisted_2$E = { class: "row first-row" };
9534
+ const _hoisted_3$x = { key: 0 };
9535
+ const _hoisted_4$l = ["onClick"];
9536
+ const _hoisted_5$l = { class: "flex" };
9537
+ const _hoisted_6$h = ["onClick"];
9538
+ const _hoisted_7$d = { key: 0 };
9539
+ const _hoisted_8$8 = ["value"];
9540
+ const _hoisted_9$6 = { key: 1 };
9545
9541
  const _sfc_main$10 = /* @__PURE__ */ vue.defineComponent({
9546
9542
  __name: "DataTable",
9547
9543
  props: /* @__PURE__ */ vue.mergeModels({
@@ -9562,7 +9558,7 @@ const _sfc_main$10 = /* @__PURE__ */ vue.defineComponent({
9562
9558
  emits: /* @__PURE__ */ vue.mergeModels(["orderBy", "select", "lastItemVisible"], ["update:loading", "update:itemHeight", "update:selectedItems"]),
9563
9559
  setup(__props, { emit: __emit }) {
9564
9560
  vue.useCssVars((_ctx) => ({
9565
- "25c2d418": vue.unref(computedItemHeight)
9561
+ "70bc72ee": vue.unref(computedItemHeight)
9566
9562
  }));
9567
9563
  const props2 = __props;
9568
9564
  const emit2 = __emit;
@@ -9656,17 +9652,18 @@ const _sfc_main$10 = /* @__PURE__ */ vue.defineComponent({
9656
9652
  const showLoading = vue.computed(() => loading.value);
9657
9653
  return (_ctx, _cache) => {
9658
9654
  return vue.openBlock(), vue.createElementBlock("div", vue.mergeProps({ class: "table-list-wrap h-100" }, vue.unref(containerProps), {
9659
- class: { "loading-table": showLoading.value }
9655
+ class: { overflowHiddenLoading: showLoading.value }
9660
9656
  }), [
9661
- showLoading.value ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$R, _cache[4] || (_cache[4] = [
9662
- vue.createElementVNode("div", { class: "loading-table-animation fixed oval top-7" }, null, -1)
9663
- ]))) : vue.createCommentVNode("", true),
9657
+ showLoading.value ? (vue.openBlock(), vue.createBlock(vue.unref(Loading), {
9658
+ key: 0,
9659
+ class: "h100p"
9660
+ })) : vue.createCommentVNode("", true),
9664
9661
  vue.createElementVNode("div", vue.mergeProps(vue.unref(wrapperProps), {
9665
9662
  class: { "pointer-events-none": showLoading.value }
9666
9663
  }), [
9667
- vue.createElementVNode("table", _hoisted_2$E, [
9668
- vue.createElementVNode("thead", _hoisted_3$x, [
9669
- vue.unref(isSelectable) ? (vue.openBlock(), vue.createElementBlock("th", _hoisted_4$l, [
9664
+ vue.createElementVNode("table", _hoisted_1$R, [
9665
+ vue.createElementVNode("thead", _hoisted_2$E, [
9666
+ vue.unref(isSelectable) ? (vue.openBlock(), vue.createElementBlock("th", _hoisted_3$x, [
9670
9667
  vue.createElementVNode("input", {
9671
9668
  ref_key: "allSelectorEl",
9672
9669
  ref: allSelectorEl,
@@ -9682,7 +9679,7 @@ const _sfc_main$10 = /* @__PURE__ */ vue.defineComponent({
9682
9679
  class: "col",
9683
9680
  onClick: ($event) => vue.unref(toggleSort)((field == null ? void 0 : field.id) || "")
9684
9681
  }, [
9685
- vue.createElementVNode("div", _hoisted_6$h, [
9682
+ vue.createElementVNode("div", _hoisted_5$l, [
9686
9683
  vue.createTextVNode(vue.toDisplayString(field.label || vue.unref(keyToLabel)(field == null ? void 0 : field.id)) + " ", 1),
9687
9684
  vue.createElementVNode("div", {
9688
9685
  class: vue.normalizeClass(["list-arrows", { sorted: vue.unref(sortField) === (field == null ? void 0 : field.id) }])
@@ -9693,7 +9690,7 @@ const _sfc_main$10 = /* @__PURE__ */ vue.defineComponent({
9693
9690
  }, null, 8, ["class"])
9694
9691
  ], 2)
9695
9692
  ])
9696
- ], 8, _hoisted_5$l);
9693
+ ], 8, _hoisted_4$l);
9697
9694
  }), 128))
9698
9695
  ]),
9699
9696
  vue.createElementVNode("tbody", null, [
@@ -9703,7 +9700,7 @@ const _sfc_main$10 = /* @__PURE__ */ vue.defineComponent({
9703
9700
  class: vue.normalizeClass(["row row-item position-relative", { selected: (row == null ? void 0 : row.id) && vue.unref(computedSelectedItems).includes(row.id) }]),
9704
9701
  onClick: ($event) => vue.unref(toggleSelectItem)(row)
9705
9702
  }, [
9706
- vue.unref(isSelectable) ? (vue.openBlock(), vue.createElementBlock("td", _hoisted_8$8, [
9703
+ vue.unref(isSelectable) ? (vue.openBlock(), vue.createElementBlock("td", _hoisted_7$d, [
9707
9704
  vue.createElementVNode("div", {
9708
9705
  onClick: _cache[3] || (_cache[3] = vue.withModifiers(() => {
9709
9706
  }, ["stop"]))
@@ -9712,7 +9709,7 @@ const _sfc_main$10 = /* @__PURE__ */ vue.defineComponent({
9712
9709
  "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => selectedItems.value = $event),
9713
9710
  type: "checkbox",
9714
9711
  value: (row == null ? void 0 : row.id) || ""
9715
- }, null, 8, _hoisted_9$6), [
9712
+ }, null, 8, _hoisted_8$8), [
9716
9713
  [vue.vModelCheckbox, selectedItems.value]
9717
9714
  ])
9718
9715
  ])
@@ -9727,12 +9724,12 @@ const _sfc_main$10 = /* @__PURE__ */ vue.defineComponent({
9727
9724
  key: 0,
9728
9725
  row,
9729
9726
  field
9730
- }, void 0, true) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_10$5, [
9727
+ }, void 0, true) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_9$6, [
9731
9728
  (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(renderFieldForRow(field, row))))
9732
9729
  ]))
9733
9730
  ]);
9734
9731
  }), 128))
9735
- ], 10, _hoisted_7$d);
9732
+ ], 10, _hoisted_6$h);
9736
9733
  }), 128)),
9737
9734
  props2.onLastItemVisible !== void 0 ? (vue.openBlock(), vue.createElementBlock("tr", {
9738
9735
  key: 0,
@@ -9747,7 +9744,7 @@ const _sfc_main$10 = /* @__PURE__ */ vue.defineComponent({
9747
9744
  };
9748
9745
  }
9749
9746
  });
9750
- const DataTable = /* @__PURE__ */ _export_sfc(_sfc_main$10, [["__scopeId", "data-v-f795f660"]]);
9747
+ const DataTable = /* @__PURE__ */ _export_sfc(_sfc_main$10, [["__scopeId", "data-v-6da6fbe2"]]);
9751
9748
  function useDraggable(options = {}) {
9752
9749
  const isDragging = vue.ref(false);
9753
9750
  const dragElement = vue.ref(null);
@@ -13301,12 +13298,13 @@ function findBglFieldById(id, _schema) {
13301
13298
  return void 0;
13302
13299
  }
13303
13300
  function arrField(id, label, schemaOrType, options) {
13304
- const attrs = { delete: true, add: true, ...options };
13305
- if (typeof schemaOrType === "string") {
13306
- attrs.type = schemaOrType;
13307
- } else {
13308
- attrs.schema = schemaOrType;
13309
- }
13301
+ const arraySpecificAttrs = typeof schemaOrType === "string" ? { type: schemaOrType } : { schema: schemaOrType };
13302
+ const attrs = {
13303
+ delete: true,
13304
+ add: true,
13305
+ ...options,
13306
+ ...arraySpecificAttrs
13307
+ };
13310
13308
  return {
13311
13309
  label,
13312
13310
  id,
@@ -13323,6 +13321,7 @@ function useForm() {
13323
13321
  checkField,
13324
13322
  dateField,
13325
13323
  numField,
13324
+ emailField,
13326
13325
  frmRow,
13327
13326
  uploadField,
13328
13327
  rangeField,
@@ -32385,15 +32384,16 @@ const _sfc_main$t = /* @__PURE__ */ vue.defineComponent({
32385
32384
  alt: {},
32386
32385
  width: {},
32387
32386
  height: {},
32388
- caption: {}
32387
+ caption: {},
32388
+ modelValue: {}
32389
32389
  },
32390
32390
  setup(__props) {
32391
32391
  const props2 = __props;
32392
32392
  let imageSrc = vue.ref(void 0);
32393
32393
  let loadingError = vue.ref(false);
32394
32394
  function getImageUrl() {
32395
- if (!props2.src && !props2.pathKey) return;
32396
- return pathKeyToURL(props2.src || props2.pathKey);
32395
+ if (!props2.src && !props2.pathKey && !props2.modelValue) return;
32396
+ return pathKeyToURL(props2.src || props2.pathKey || props2.modelValue);
32397
32397
  }
32398
32398
  async function getCachedImage(url) {
32399
32399
  if (!("caches" in window)) return void 0;
@@ -32451,7 +32451,7 @@ const _sfc_main$t = /* @__PURE__ */ vue.defineComponent({
32451
32451
  imageSrc.value = void 0;
32452
32452
  }
32453
32453
  }
32454
- vue.watch(() => [props2.src, props2.pathKey], loadImage, { immediate: true });
32454
+ vue.watch(() => [props2.src, props2.pathKey, props2.modelValue], loadImage, { immediate: true });
32455
32455
  return (_ctx, _cache) => {
32456
32456
  return _ctx.caption ? (vue.openBlock(), vue.createElementBlock("figcaption", _hoisted_1$n, [
32457
32457
  vue.unref(imageSrc) ? (vue.openBlock(), vue.createElementBlock("img", vue.mergeProps({
@@ -32492,7 +32492,7 @@ const _sfc_main$t = /* @__PURE__ */ vue.defineComponent({
32492
32492
  };
32493
32493
  }
32494
32494
  });
32495
- const Image$1 = /* @__PURE__ */ _export_sfc(_sfc_main$t, [["__scopeId", "data-v-2f5e271c"]]);
32495
+ const Image$1 = /* @__PURE__ */ _export_sfc(_sfc_main$t, [["__scopeId", "data-v-eed047eb"]]);
32496
32496
  const _hoisted_1$m = ["textContent"];
32497
32497
  const _hoisted_2$e = {
32498
32498
  key: 0,
@@ -39710,14 +39710,26 @@ function formatDate(date2, opts = {}) {
39710
39710
  }
39711
39711
  }
39712
39712
  const fmtDate = formatDate;
39713
+ const htmlReplacers = {
39714
+ "": /<[^>]*>?/g,
39715
+ " ": /&nbsp;/g,
39716
+ '"': /&quot;/g,
39717
+ "'": /&apos;/g,
39718
+ "&": /&amp;/g,
39719
+ "<": /&lt;/g,
39720
+ ">": /&gt;/g
39721
+ };
39713
39722
  function clearHtml(value) {
39714
39723
  if (!value) return "";
39715
- return value.replace(/<[^>]*>?/g, "").replace(/&nbsp;/g, " ").replace(/&quot;/g, '"').replace(/&apos;/g, `'`).replace(/&amp;/g, "&").replace(/&lt;/g, "<").replace(/&gt;/g, ">");
39724
+ return Object.entries(htmlReplacers).reduce(
39725
+ (text, [replacement, regex2]) => text.replace(regex2, replacement),
39726
+ value
39727
+ );
39716
39728
  }
39729
+ const normalizeSearchChars = /[\p{N}\p{L}\s]/gu;
39717
39730
  function normalizeText(text) {
39718
39731
  var _a;
39719
- const searchChars = /[\p{N}\p{L}\s]/gu;
39720
- return ((_a = text.match(searchChars)) == null ? void 0 : _a.join("").toLowerCase()) ?? "";
39732
+ return ((_a = text.match(normalizeSearchChars)) == null ? void 0 : _a.join("").toLowerCase()) ?? "";
39721
39733
  }
39722
39734
  function getValueByPath(obj, path) {
39723
39735
  const keys4 = path.split(".");
@@ -40016,18 +40028,27 @@ exports.Zoomer = Zoomer;
40016
40028
  exports.allCountries = allCountries;
40017
40029
  exports.appendScript = appendScript;
40018
40030
  exports.appendStyle = appendStyle;
40031
+ exports.arrField = arrField;
40019
40032
  exports.bagelFormUtils = BagelFormUtils;
40020
40033
  exports.bagelInjectionKey = bagelInjectionKey;
40034
+ exports.bglForm = bglForm;
40021
40035
  exports.bindAttrs = bindAttrs;
40036
+ exports.checkField = checkField;
40022
40037
  exports.classify = classify;
40023
40038
  exports.clearHtml = clearHtml;
40039
+ exports.colorField = colorField;
40024
40040
  exports.copyText = copyText;
40041
+ exports.dateField = dateField;
40025
40042
  exports.debounce = debounce;
40026
40043
  exports.denullify = denullify;
40027
40044
  exports.downloadFile = downloadFile;
40045
+ exports.emailField = emailField;
40046
+ exports.findBglFieldById = findBglFieldById;
40028
40047
  exports.fmtDate = fmtDate;
40029
40048
  exports.formatDate = formatDate;
40030
40049
  exports.formatString = formatString;
40050
+ exports.frmRow = frmRow;
40051
+ exports.getBaseField = getBaseField;
40031
40052
  exports.getDatePartsMap = getDatePartsMap;
40032
40053
  exports.getFallbackSchema = getFallbackSchema;
40033
40054
  exports.getNestedValue = getNestedValue;
@@ -40041,13 +40062,21 @@ exports.localRef = localRef;
40041
40062
  exports.normalizeDimension = normalizeDimension;
40042
40063
  exports.normalizeText = normalizeText;
40043
40064
  exports.normalizeURL = normalizeURL;
40065
+ exports.numField = numField;
40044
40066
  exports.pathKeyToURL = pathKeyToURL;
40045
40067
  exports.provideBagelFormState = provideBagelFormState;
40068
+ exports.rangeField = rangeField;
40069
+ exports.richText = richText;
40046
40070
  exports.searchItems = searchItems;
40071
+ exports.selectField = selectField;
40072
+ exports.slctField = slctField;
40047
40073
  exports.sleep = sleep;
40048
40074
  exports.slugify = slugify;
40075
+ exports.telField = telField;
40049
40076
  exports.timeAgo = timeAgo;
40050
40077
  exports.timeDelta = timeDelta;
40078
+ exports.txtField = txtField;
40079
+ exports.uploadField = uploadField;
40051
40080
  exports.useBagel = useBagel;
40052
40081
  exports.useBagelFormState = useBagelFormState;
40053
40082
  exports.useBglSchema = useBglSchema;
package/dist/index.d.ts CHANGED
@@ -6,6 +6,7 @@ export { ModalPlugin, useModal } from './plugins/modal';
6
6
  export * from './types';
7
7
  export * from './utils';
8
8
  export * from './utils/allCountries';
9
+ export * from './utils/BagelFormUtils';
9
10
  export * from './utils/calendar/dateUtils';
10
11
  export * from './utils/constants';
11
12
  export * from './utils/useSearch';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAA;AAC5B,cAAc,qCAAqC,CAAA;AACnD,cAAc,eAAe,CAAA;AAC7B,OAAO,EACN,iBAAiB,EACjB,KAAK,YAAY,EACjB,QAAQ,EACR,iBAAiB,EACjB,QAAQ,EACR,QAAQ,GACR,MAAM,iBAAiB,CAAA;AACxB,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAA;AACvD,cAAc,SAAS,CAAA;AACvB,cAAc,SAAS,CAAA;AACvB,cAAc,sBAAsB,CAAA;AACpC,cAAc,4BAA4B,CAAA;AAC1C,OAAO,oBAAoB,CAAA;AAE3B,cAAc,mBAAmB,CAAA;AACjC,cAAc,mBAAmB,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAA;AAC5B,cAAc,qCAAqC,CAAA;AACnD,cAAc,eAAe,CAAA;AAC7B,OAAO,EACN,iBAAiB,EACjB,KAAK,YAAY,EACjB,QAAQ,EACR,iBAAiB,EACjB,QAAQ,EACR,QAAQ,GACR,MAAM,iBAAiB,CAAA;AACxB,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAA;AACvD,cAAc,SAAS,CAAA;AACvB,cAAc,SAAS,CAAA;AACvB,cAAc,sBAAsB,CAAA;AACpC,cAAc,wBAAwB,CAAA;AACtC,OAAO,oBAAoB,CAAA;AAE3B,cAAc,4BAA4B,CAAA;AAC1C,cAAc,mBAAmB,CAAA;AACjC,cAAc,mBAAmB,CAAA"}
package/dist/index.mjs CHANGED
@@ -1575,7 +1575,7 @@ const _hoisted_6$l = ["onClick"];
1575
1575
  const _hoisted_7$h = { class: "event-content" };
1576
1576
  const _hoisted_8$b = { class: "white-space ellipsis-1" };
1577
1577
  const _hoisted_9$8 = { class: "event-time opacity-8" };
1578
- const _hoisted_10$6 = { class: "color-primary txt-12 p-025" };
1578
+ const _hoisted_10$5 = { class: "color-primary txt-12 p-025" };
1579
1579
  const slotHeight$1 = 60;
1580
1580
  const slotDuration$1 = 60;
1581
1581
  const _sfc_main$18 = /* @__PURE__ */ defineComponent({
@@ -1768,7 +1768,7 @@ const _sfc_main$18 = /* @__PURE__ */ defineComponent({
1768
1768
  right: "10px"
1769
1769
  })
1770
1770
  }, [
1771
- createElementVNode("div", _hoisted_10$6, toDisplayString(dragState.value.startTime ? unref(formatDate)(dragState.value.startTime, { fmt: "HH:mm" }) : "") + " - " + toDisplayString(dragState.value.endTime ? unref(formatDate)(dragState.value.endTime, { fmt: "HH:mm" }) : ""), 1)
1771
+ createElementVNode("div", _hoisted_10$5, toDisplayString(dragState.value.startTime ? unref(formatDate)(dragState.value.startTime, { fmt: "HH:mm" }) : "") + " - " + toDisplayString(dragState.value.endTime ? unref(formatDate)(dragState.value.endTime, { fmt: "HH:mm" }) : ""), 1)
1772
1772
  ], 4)) : createCommentVNode("", true)
1773
1773
  ], 32)
1774
1774
  ]),
@@ -9527,19 +9527,15 @@ function useTableVirtualization(options) {
9527
9527
  registerLastItemObserver
9528
9528
  };
9529
9529
  }
9530
- const _hoisted_1$R = {
9531
- key: 0,
9532
- class: "loading-table-wrapper z-99 h-100 w-100 absolute inset"
9533
- };
9534
- const _hoisted_2$E = { class: "infinite-wrapper" };
9535
- const _hoisted_3$x = { class: "row first-row" };
9536
- const _hoisted_4$l = { key: 0 };
9537
- const _hoisted_5$l = ["onClick"];
9538
- const _hoisted_6$h = { class: "flex" };
9539
- const _hoisted_7$d = ["onClick"];
9540
- const _hoisted_8$8 = { key: 0 };
9541
- const _hoisted_9$6 = ["value"];
9542
- const _hoisted_10$5 = { key: 1 };
9530
+ const _hoisted_1$R = { class: "infinite-wrapper" };
9531
+ const _hoisted_2$E = { class: "row first-row" };
9532
+ const _hoisted_3$x = { key: 0 };
9533
+ const _hoisted_4$l = ["onClick"];
9534
+ const _hoisted_5$l = { class: "flex" };
9535
+ const _hoisted_6$h = ["onClick"];
9536
+ const _hoisted_7$d = { key: 0 };
9537
+ const _hoisted_8$8 = ["value"];
9538
+ const _hoisted_9$6 = { key: 1 };
9543
9539
  const _sfc_main$10 = /* @__PURE__ */ defineComponent({
9544
9540
  __name: "DataTable",
9545
9541
  props: /* @__PURE__ */ mergeModels({
@@ -9560,7 +9556,7 @@ const _sfc_main$10 = /* @__PURE__ */ defineComponent({
9560
9556
  emits: /* @__PURE__ */ mergeModels(["orderBy", "select", "lastItemVisible"], ["update:loading", "update:itemHeight", "update:selectedItems"]),
9561
9557
  setup(__props, { emit: __emit }) {
9562
9558
  useCssVars((_ctx) => ({
9563
- "25c2d418": unref(computedItemHeight)
9559
+ "70bc72ee": unref(computedItemHeight)
9564
9560
  }));
9565
9561
  const props2 = __props;
9566
9562
  const emit2 = __emit;
@@ -9654,17 +9650,18 @@ const _sfc_main$10 = /* @__PURE__ */ defineComponent({
9654
9650
  const showLoading = computed(() => loading.value);
9655
9651
  return (_ctx, _cache) => {
9656
9652
  return openBlock(), createElementBlock("div", mergeProps({ class: "table-list-wrap h-100" }, unref(containerProps), {
9657
- class: { "loading-table": showLoading.value }
9653
+ class: { overflowHiddenLoading: showLoading.value }
9658
9654
  }), [
9659
- showLoading.value ? (openBlock(), createElementBlock("div", _hoisted_1$R, _cache[4] || (_cache[4] = [
9660
- createElementVNode("div", { class: "loading-table-animation fixed oval top-7" }, null, -1)
9661
- ]))) : createCommentVNode("", true),
9655
+ showLoading.value ? (openBlock(), createBlock(unref(Loading), {
9656
+ key: 0,
9657
+ class: "h100p"
9658
+ })) : createCommentVNode("", true),
9662
9659
  createElementVNode("div", mergeProps(unref(wrapperProps), {
9663
9660
  class: { "pointer-events-none": showLoading.value }
9664
9661
  }), [
9665
- createElementVNode("table", _hoisted_2$E, [
9666
- createElementVNode("thead", _hoisted_3$x, [
9667
- unref(isSelectable) ? (openBlock(), createElementBlock("th", _hoisted_4$l, [
9662
+ createElementVNode("table", _hoisted_1$R, [
9663
+ createElementVNode("thead", _hoisted_2$E, [
9664
+ unref(isSelectable) ? (openBlock(), createElementBlock("th", _hoisted_3$x, [
9668
9665
  createElementVNode("input", {
9669
9666
  ref_key: "allSelectorEl",
9670
9667
  ref: allSelectorEl,
@@ -9680,7 +9677,7 @@ const _sfc_main$10 = /* @__PURE__ */ defineComponent({
9680
9677
  class: "col",
9681
9678
  onClick: ($event) => unref(toggleSort)((field == null ? void 0 : field.id) || "")
9682
9679
  }, [
9683
- createElementVNode("div", _hoisted_6$h, [
9680
+ createElementVNode("div", _hoisted_5$l, [
9684
9681
  createTextVNode(toDisplayString(field.label || unref(keyToLabel)(field == null ? void 0 : field.id)) + " ", 1),
9685
9682
  createElementVNode("div", {
9686
9683
  class: normalizeClass(["list-arrows", { sorted: unref(sortField) === (field == null ? void 0 : field.id) }])
@@ -9691,7 +9688,7 @@ const _sfc_main$10 = /* @__PURE__ */ defineComponent({
9691
9688
  }, null, 8, ["class"])
9692
9689
  ], 2)
9693
9690
  ])
9694
- ], 8, _hoisted_5$l);
9691
+ ], 8, _hoisted_4$l);
9695
9692
  }), 128))
9696
9693
  ]),
9697
9694
  createElementVNode("tbody", null, [
@@ -9701,7 +9698,7 @@ const _sfc_main$10 = /* @__PURE__ */ defineComponent({
9701
9698
  class: normalizeClass(["row row-item position-relative", { selected: (row == null ? void 0 : row.id) && unref(computedSelectedItems).includes(row.id) }]),
9702
9699
  onClick: ($event) => unref(toggleSelectItem)(row)
9703
9700
  }, [
9704
- unref(isSelectable) ? (openBlock(), createElementBlock("td", _hoisted_8$8, [
9701
+ unref(isSelectable) ? (openBlock(), createElementBlock("td", _hoisted_7$d, [
9705
9702
  createElementVNode("div", {
9706
9703
  onClick: _cache[3] || (_cache[3] = withModifiers(() => {
9707
9704
  }, ["stop"]))
@@ -9710,7 +9707,7 @@ const _sfc_main$10 = /* @__PURE__ */ defineComponent({
9710
9707
  "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => selectedItems.value = $event),
9711
9708
  type: "checkbox",
9712
9709
  value: (row == null ? void 0 : row.id) || ""
9713
- }, null, 8, _hoisted_9$6), [
9710
+ }, null, 8, _hoisted_8$8), [
9714
9711
  [vModelCheckbox, selectedItems.value]
9715
9712
  ])
9716
9713
  ])
@@ -9725,12 +9722,12 @@ const _sfc_main$10 = /* @__PURE__ */ defineComponent({
9725
9722
  key: 0,
9726
9723
  row,
9727
9724
  field
9728
- }, void 0, true) : (openBlock(), createElementBlock("div", _hoisted_10$5, [
9725
+ }, void 0, true) : (openBlock(), createElementBlock("div", _hoisted_9$6, [
9729
9726
  (openBlock(), createBlock(resolveDynamicComponent(renderFieldForRow(field, row))))
9730
9727
  ]))
9731
9728
  ]);
9732
9729
  }), 128))
9733
- ], 10, _hoisted_7$d);
9730
+ ], 10, _hoisted_6$h);
9734
9731
  }), 128)),
9735
9732
  props2.onLastItemVisible !== void 0 ? (openBlock(), createElementBlock("tr", {
9736
9733
  key: 0,
@@ -9745,7 +9742,7 @@ const _sfc_main$10 = /* @__PURE__ */ defineComponent({
9745
9742
  };
9746
9743
  }
9747
9744
  });
9748
- const DataTable = /* @__PURE__ */ _export_sfc(_sfc_main$10, [["__scopeId", "data-v-f795f660"]]);
9745
+ const DataTable = /* @__PURE__ */ _export_sfc(_sfc_main$10, [["__scopeId", "data-v-6da6fbe2"]]);
9749
9746
  function useDraggable(options = {}) {
9750
9747
  const isDragging = ref(false);
9751
9748
  const dragElement = ref(null);
@@ -13299,12 +13296,13 @@ function findBglFieldById(id, _schema) {
13299
13296
  return void 0;
13300
13297
  }
13301
13298
  function arrField(id, label, schemaOrType, options) {
13302
- const attrs = { delete: true, add: true, ...options };
13303
- if (typeof schemaOrType === "string") {
13304
- attrs.type = schemaOrType;
13305
- } else {
13306
- attrs.schema = schemaOrType;
13307
- }
13299
+ const arraySpecificAttrs = typeof schemaOrType === "string" ? { type: schemaOrType } : { schema: schemaOrType };
13300
+ const attrs = {
13301
+ delete: true,
13302
+ add: true,
13303
+ ...options,
13304
+ ...arraySpecificAttrs
13305
+ };
13308
13306
  return {
13309
13307
  label,
13310
13308
  id,
@@ -13321,6 +13319,7 @@ function useForm() {
13321
13319
  checkField,
13322
13320
  dateField,
13323
13321
  numField,
13322
+ emailField,
13324
13323
  frmRow,
13325
13324
  uploadField,
13326
13325
  rangeField,
@@ -32383,15 +32382,16 @@ const _sfc_main$t = /* @__PURE__ */ defineComponent({
32383
32382
  alt: {},
32384
32383
  width: {},
32385
32384
  height: {},
32386
- caption: {}
32385
+ caption: {},
32386
+ modelValue: {}
32387
32387
  },
32388
32388
  setup(__props) {
32389
32389
  const props2 = __props;
32390
32390
  let imageSrc = ref(void 0);
32391
32391
  let loadingError = ref(false);
32392
32392
  function getImageUrl() {
32393
- if (!props2.src && !props2.pathKey) return;
32394
- return pathKeyToURL(props2.src || props2.pathKey);
32393
+ if (!props2.src && !props2.pathKey && !props2.modelValue) return;
32394
+ return pathKeyToURL(props2.src || props2.pathKey || props2.modelValue);
32395
32395
  }
32396
32396
  async function getCachedImage(url) {
32397
32397
  if (!("caches" in window)) return void 0;
@@ -32449,7 +32449,7 @@ const _sfc_main$t = /* @__PURE__ */ defineComponent({
32449
32449
  imageSrc.value = void 0;
32450
32450
  }
32451
32451
  }
32452
- watch(() => [props2.src, props2.pathKey], loadImage, { immediate: true });
32452
+ watch(() => [props2.src, props2.pathKey, props2.modelValue], loadImage, { immediate: true });
32453
32453
  return (_ctx, _cache) => {
32454
32454
  return _ctx.caption ? (openBlock(), createElementBlock("figcaption", _hoisted_1$n, [
32455
32455
  unref(imageSrc) ? (openBlock(), createElementBlock("img", mergeProps({
@@ -32490,7 +32490,7 @@ const _sfc_main$t = /* @__PURE__ */ defineComponent({
32490
32490
  };
32491
32491
  }
32492
32492
  });
32493
- const Image$1 = /* @__PURE__ */ _export_sfc(_sfc_main$t, [["__scopeId", "data-v-2f5e271c"]]);
32493
+ const Image$1 = /* @__PURE__ */ _export_sfc(_sfc_main$t, [["__scopeId", "data-v-eed047eb"]]);
32494
32494
  const _hoisted_1$m = ["textContent"];
32495
32495
  const _hoisted_2$e = {
32496
32496
  key: 0,
@@ -39708,14 +39708,26 @@ function formatDate(date2, opts = {}) {
39708
39708
  }
39709
39709
  }
39710
39710
  const fmtDate = formatDate;
39711
+ const htmlReplacers = {
39712
+ "": /<[^>]*>?/g,
39713
+ " ": /&nbsp;/g,
39714
+ '"': /&quot;/g,
39715
+ "'": /&apos;/g,
39716
+ "&": /&amp;/g,
39717
+ "<": /&lt;/g,
39718
+ ">": /&gt;/g
39719
+ };
39711
39720
  function clearHtml(value) {
39712
39721
  if (!value) return "";
39713
- return value.replace(/<[^>]*>?/g, "").replace(/&nbsp;/g, " ").replace(/&quot;/g, '"').replace(/&apos;/g, `'`).replace(/&amp;/g, "&").replace(/&lt;/g, "<").replace(/&gt;/g, ">");
39722
+ return Object.entries(htmlReplacers).reduce(
39723
+ (text, [replacement, regex2]) => text.replace(regex2, replacement),
39724
+ value
39725
+ );
39714
39726
  }
39727
+ const normalizeSearchChars = /[\p{N}\p{L}\s]/gu;
39715
39728
  function normalizeText(text) {
39716
39729
  var _a;
39717
- const searchChars = /[\p{N}\p{L}\s]/gu;
39718
- return ((_a = text.match(searchChars)) == null ? void 0 : _a.join("").toLowerCase()) ?? "";
39730
+ return ((_a = text.match(normalizeSearchChars)) == null ? void 0 : _a.join("").toLowerCase()) ?? "";
39719
39731
  }
39720
39732
  function getValueByPath(obj, path) {
39721
39733
  const keys4 = path.split(".");
@@ -40015,18 +40027,27 @@ export {
40015
40027
  allCountries,
40016
40028
  appendScript,
40017
40029
  appendStyle,
40030
+ arrField,
40018
40031
  BagelFormUtils as bagelFormUtils,
40019
40032
  bagelInjectionKey,
40033
+ bglForm,
40020
40034
  bindAttrs,
40035
+ checkField,
40021
40036
  classify,
40022
40037
  clearHtml,
40038
+ colorField,
40023
40039
  copyText,
40040
+ dateField,
40024
40041
  debounce,
40025
40042
  denullify,
40026
40043
  downloadFile,
40044
+ emailField,
40045
+ findBglFieldById,
40027
40046
  fmtDate,
40028
40047
  formatDate,
40029
40048
  formatString,
40049
+ frmRow,
40050
+ getBaseField,
40030
40051
  getDatePartsMap,
40031
40052
  getFallbackSchema,
40032
40053
  getNestedValue,
@@ -40040,13 +40061,21 @@ export {
40040
40061
  normalizeDimension,
40041
40062
  normalizeText,
40042
40063
  normalizeURL,
40064
+ numField,
40043
40065
  pathKeyToURL,
40044
40066
  provideBagelFormState,
40067
+ rangeField,
40068
+ richText,
40045
40069
  searchItems,
40070
+ selectField,
40071
+ slctField,
40046
40072
  sleep,
40047
40073
  slugify,
40074
+ telField,
40048
40075
  timeAgo,
40049
40076
  timeDelta,
40077
+ txtField,
40078
+ uploadField,
40050
40079
  useBagel,
40051
40080
  useBagelFormState,
40052
40081
  useBglSchema,
@@ -1 +1 @@
1
- {"version":3,"file":"modal.d.ts","sourceRoot":"","sources":["../../src/plugins/modal.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,KAAK,CAAA;AAE/C,OAAO,KAAK,EAAE,uBAAuB,EAAE,mBAAmB,EAAuB,uBAAuB,EAAE,gBAAgB,EAAE,YAAY,EAAa,MAAM,cAAc,CAAA;AAIzK,MAAM,WAAW,QAAQ;IACxB,SAAS,EAAE,CAAC,CAAC,SAAS;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;KAAE,EAAE,OAAO,EAAE,YAAY,EAAE,KAAK,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;KAAE,KAAK,mBAAmB,CAAC,CAAC,CAAC,GAAG,SAAS,CAAA;IAC1I,aAAa,EAAE,CAAC,CAAC,SAAS;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;KAAE,EAAE,OAAO,EAAE,gBAAgB,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;KAAE,KAAK,uBAAuB,CAAC,CAAC,CAAC,GAAG,SAAS,CAAA;IACzJ,SAAS,EAAE,CAAC,KAAK,CAAC,EAAE,MAAM,KAAK,IAAI,CAAA;IACnC,YAAY,EAAE,CAAC,OAAO,EAAE,uBAAuB,KAAK,OAAO,CAAC,OAAO,CAAC,CAAA;CACpE;AAED,eAAO,MAAM,WAAW,EAAE,YAAY,CAAC,QAAQ,CAAmB,CAAA;AAElE,wBAAgB,QAAQ,IAAI,QAAQ,CAInC;AAED,eAAO,MAAM,WAAW,EAAE,MAsEzB,CAAA"}
1
+ {"version":3,"file":"modal.d.ts","sourceRoot":"","sources":["../../src/plugins/modal.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,KAAK,CAAA;AAE/C,OAAO,KAAK,EAAE,uBAAuB,EAAE,mBAAmB,EAAuB,uBAAuB,EAAE,gBAAgB,EAAE,YAAY,EAAa,MAAM,cAAc,CAAA;AAIzK,MAAM,WAAW,QAAQ;IACxB,SAAS,EAAE,CAAC,CAAC,SAAS;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;KAAE,EAAE,OAAO,EAAE,YAAY,EAAE,KAAK,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;KAAE,KAAK,mBAAmB,CAAC,CAAC,CAAC,GAAG,SAAS,CAAA;IAC1I,aAAa,EAAE,CAAC,CAAC,SAAS;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;KAAE,EAAE,OAAO,EAAE,gBAAgB,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;KAAE,KAAK,uBAAuB,CAAC,CAAC,CAAC,GAAG,SAAS,CAAA;IACzJ,SAAS,EAAE,CAAC,KAAK,CAAC,EAAE,MAAM,KAAK,IAAI,CAAA;IACnC,YAAY,EAAE,CAAC,OAAO,EAAE,uBAAuB,KAAK,OAAO,CAAC,OAAO,CAAC,CAAA;CACpE;AAED,eAAO,MAAM,WAAW,EAAE,YAAY,CAAC,QAAQ,CAAmB,CAAA;AAElE,wBAAgB,QAAQ,IAAI,QAAQ,CAInC;AAED,eAAO,MAAM,WAAW,EAAE,MAuEzB,CAAA"}