@bagelink/vue 0.0.1048 → 0.0.1056

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -59,7 +59,7 @@ const _sfc_main$17 = /* @__PURE__ */ defineComponent({
59
59
  };
60
60
  }
61
61
  });
62
- const _hoisted_1$U = ["aria-expanded", "aria-controls"];
62
+ const _hoisted_1$V = ["aria-expanded", "aria-controls"];
63
63
  const _hoisted_2$B = { class: "accordion-label" };
64
64
  const _hoisted_3$s = ["id", "aria-hidden"];
65
65
  const _sfc_main$16 = /* @__PURE__ */ defineComponent({
@@ -136,7 +136,7 @@ const _sfc_main$16 = /* @__PURE__ */ defineComponent({
136
136
  }, [
137
137
  createVNode(unref(_sfc_main$d), { icon: computedIcon.value }, null, 8, ["icon"])
138
138
  ], 2)) : createCommentVNode("", true)
139
- ], 8, _hoisted_1$U),
139
+ ], 8, _hoisted_1$V),
140
140
  createVNode(Transition, { name: "expand" }, {
141
141
  default: withCtx(() => [
142
142
  unref(isOpen) ? (openBlock(), createElementBlock("div", {
@@ -162,7 +162,7 @@ const _export_sfc = (sfc, props2) => {
162
162
  return target;
163
163
  };
164
164
  const AccordionItem = /* @__PURE__ */ _export_sfc(_sfc_main$16, [["__scopeId", "data-v-1e73ca3e"]]);
165
- const _hoisted_1$T = { class: "relative" };
165
+ const _hoisted_1$U = { class: "relative" };
166
166
  const _sfc_main$15 = /* @__PURE__ */ defineComponent({
167
167
  __name: "AddressSearch",
168
168
  emits: ["addressSelected"],
@@ -185,7 +185,7 @@ const _sfc_main$15 = /* @__PURE__ */ defineComponent({
185
185
  (_a2 = suggestion.value) == null ? void 0 : _a2.show();
186
186
  }
187
187
  return (_ctx, _cache) => {
188
- return openBlock(), createElementBlock("div", _hoisted_1$T, [
188
+ return openBlock(), createElementBlock("div", _hoisted_1$U, [
189
189
  createVNode(unref(_sfc_main$W), {
190
190
  ref_key: "suggestion",
191
191
  ref: suggestion,
@@ -221,7 +221,7 @@ const _sfc_main$15 = /* @__PURE__ */ defineComponent({
221
221
  };
222
222
  }
223
223
  });
224
- const _hoisted_1$S = {
224
+ const _hoisted_1$T = {
225
225
  key: 1,
226
226
  class: "bgl_btn-flex"
227
227
  };
@@ -290,7 +290,7 @@ const _sfc_main$14 = /* @__PURE__ */ defineComponent({
290
290
  _ctx.loading ? (openBlock(), createBlock(unref(Loading), {
291
291
  key: 0,
292
292
  size: "15"
293
- })) : (openBlock(), createElementBlock("div", _hoisted_1$S, [
293
+ })) : (openBlock(), createElementBlock("div", _hoisted_1$T, [
294
294
  _ctx.icon ? (openBlock(), createBlock(unref(_sfc_main$d), {
295
295
  key: 0,
296
296
  icon: _ctx.icon
@@ -313,7 +313,7 @@ const _sfc_main$14 = /* @__PURE__ */ defineComponent({
313
313
  }
314
314
  });
315
315
  const Btn = /* @__PURE__ */ _export_sfc(_sfc_main$14, [["__scopeId", "data-v-c23a3626"]]);
316
- const _hoisted_1$R = ["dismissable"];
316
+ const _hoisted_1$S = ["dismissable"];
317
317
  const _hoisted_2$A = { class: "m-0" };
318
318
  const _sfc_main$13 = /* @__PURE__ */ defineComponent({
319
319
  __name: "Alert",
@@ -351,12 +351,12 @@ const _sfc_main$13 = /* @__PURE__ */ defineComponent({
351
351
  icon: "close",
352
352
  onClick: _cache[0] || (_cache[0] = ($event) => isDismissed.value = true)
353
353
  })
354
- ], 10, _hoisted_1$R)) : createCommentVNode("", true);
354
+ ], 10, _hoisted_1$S)) : createCommentVNode("", true);
355
355
  };
356
356
  }
357
357
  });
358
358
  const Alert = /* @__PURE__ */ _export_sfc(_sfc_main$13, [["__scopeId", "data-v-57141c32"]]);
359
- const _hoisted_1$Q = ["src", "alt"];
359
+ const _hoisted_1$R = ["src", "alt"];
360
360
  const _sfc_main$12 = /* @__PURE__ */ defineComponent({
361
361
  __name: "Avatar",
362
362
  props: {
@@ -375,7 +375,7 @@ const _sfc_main$12 = /* @__PURE__ */ defineComponent({
375
375
  key: 0,
376
376
  src: _ctx.src,
377
377
  alt: _ctx.name
378
- }, null, 8, _hoisted_1$Q)) : (openBlock(), createElementBlock("p", {
378
+ }, null, 8, _hoisted_1$R)) : (openBlock(), createElementBlock("p", {
379
379
  key: 1,
380
380
  style: normalizeStyle({ "line-height": `${_ctx.size}px`, "font-size": `calc(1.5rem * ${_ctx.size} / 50)` })
381
381
  }, toDisplayString((_ctx.fallback || unref(initials)(_ctx.name || "")).toUpperCase()), 5))
@@ -414,6 +414,7 @@ const _sfc_main$11 = /* @__PURE__ */ defineComponent({
414
414
  }
415
415
  });
416
416
  const Badge = /* @__PURE__ */ _export_sfc(_sfc_main$11, [["__scopeId", "data-v-2f3caf93"]]);
417
+ const _hoisted_1$Q = { key: 1 };
417
418
  const _sfc_main$10 = /* @__PURE__ */ defineComponent({
418
419
  __name: "BglComponent",
419
420
  props: {
@@ -503,6 +504,12 @@ const _sfc_main$10 = /* @__PURE__ */ defineComponent({
503
504
  updateField(props2.id, val);
504
505
  }
505
506
  });
507
+ const computedFieldData = computed(
508
+ () => {
509
+ var _a2, _b;
510
+ return ((_b = (_a2 = props2.field).transform) == null ? void 0 : _b.call(_a2, fieldData.value, props2.modelValue)) ?? fieldData.value;
511
+ }
512
+ );
506
513
  const vIf = computed(() => {
507
514
  if (props2.field["v-if"] === void 0 && props2.field.vIf === void 0) return true;
508
515
  if (typeof props2.field["v-if"] === "boolean" || typeof props2.field.vIf === "boolean") return props2.field["v-if"];
@@ -516,7 +523,10 @@ const _sfc_main$10 = /* @__PURE__ */ defineComponent({
516
523
  );
517
524
  const computedAttrs = computed(() => {
518
525
  const attrs = { ...customAttrs.value, ...props2.field.attrs };
519
- return bindAttrs(attrs, fieldData.value, props2.modelValue);
526
+ const boundAttrs = bindAttrs(attrs, fieldData.value, props2.modelValue);
527
+ return Object.fromEntries(
528
+ Object.entries(boundAttrs).filter(([_2, value]) => value !== void 0)
529
+ );
520
530
  });
521
531
  const computedClass = computed(
522
532
  () => {
@@ -543,14 +553,16 @@ const _sfc_main$10 = /* @__PURE__ */ defineComponent({
543
553
  }), {
544
554
  default: withCtx(() => [
545
555
  _ctx.field.$el === "form" ? renderSlot(_ctx.$slots, "default", { key: 0 }) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
546
- createTextVNode(toDisplayString(fieldData.value) + " ", 1),
556
+ createTextVNode(toDisplayString(computedFieldData.value) + " ", 1),
547
557
  (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.field.children, (child, ii) => {
548
- return openBlock(), createBlock(_component_BglComponent, {
549
- id: [props2.id, child.id].filter(Boolean).join("."),
550
- key: child.id || ii,
551
- field: child,
552
- "parent-path": props2.id
553
- }, null, 8, ["id", "field", "parent-path"]);
558
+ return openBlock(), createElementBlock(Fragment, { key: ii }, [
559
+ typeof child !== "string" ? (openBlock(), createBlock(_component_BglComponent, {
560
+ key: 0,
561
+ id: [props2.id, child.id].filter(Boolean).join("."),
562
+ field: child,
563
+ "parent-path": props2.id
564
+ }, null, 8, ["id", "field", "parent-path"])) : (openBlock(), createElementBlock("span", _hoisted_1$Q, toDisplayString(child), 1))
565
+ ], 64);
554
566
  }), 128))
555
567
  ], 64))
556
568
  ]),
@@ -10009,7 +10021,7 @@ const _sfc_main$S = /* @__PURE__ */ defineComponent({
10009
10021
  if (typeof props2.field.vIf === "function") return props2.field.vIf(fieldData.value, formState == null ? void 0 : formState.data.value);
10010
10022
  return true;
10011
10023
  });
10012
- computed(
10024
+ const computedFieldData = computed(
10013
10025
  () => {
10014
10026
  var _a2, _b;
10015
10027
  return ((_b = (_a2 = props2.field).transform) == null ? void 0 : _b.call(_a2, fieldData.value, formState == null ? void 0 : formState.data.value)) ?? fieldData.value;
@@ -10021,7 +10033,10 @@ const _sfc_main$S = /* @__PURE__ */ defineComponent({
10021
10033
  const computedAttrs = computed(() => {
10022
10034
  const attrs = { ...customAttrs.value, ...props2.field.attrs };
10023
10035
  delete attrs.schema;
10024
- return bindAttrs(attrs, fieldData.value, formState == null ? void 0 : formState.data.value);
10036
+ const boundAttrs = bindAttrs(attrs, fieldData.value, formState == null ? void 0 : formState.data.value);
10037
+ return Object.fromEntries(
10038
+ Object.entries(boundAttrs).filter(([_2, value]) => value !== void 0)
10039
+ );
10025
10040
  });
10026
10041
  const computedClass = computed(
10027
10042
  () => {
@@ -10047,6 +10062,7 @@ const _sfc_main$S = /* @__PURE__ */ defineComponent({
10047
10062
  schema: ((_a2 = _ctx.field.attrs) == null ? void 0 : _a2.schema) ?? void 0
10048
10063
  }), {
10049
10064
  default: withCtx(() => [
10065
+ createTextVNode(toDisplayString(computedFieldData.value) + " ", 1),
10050
10066
  (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.field.children, (child, ii) => {
10051
10067
  return openBlock(), createElementBlock(Fragment, { key: ii }, [
10052
10068
  typeof child !== "string" ? (openBlock(), createBlock(_component_BglField, {
@@ -20481,8 +20497,8 @@ const _sfc_main$A = /* @__PURE__ */ defineComponent({
20481
20497
  const toPercentage = computed(() => (validTo.value - min2) / (max2 - min2) * 100);
20482
20498
  watch(() => props2.modelValue, (newVal) => {
20483
20499
  if (Array.isArray(newVal) && multiRange) {
20484
- from.value = newVal[0];
20485
- to2.value = newVal[1];
20500
+ from.value = newVal[0] ?? min2;
20501
+ to2.value = newVal[1] ?? max2;
20486
20502
  } else if (!Array.isArray(newVal)) {
20487
20503
  from.value = newVal ?? min2;
20488
20504
  to2.value = max2;
@@ -20520,7 +20536,7 @@ const _sfc_main$A = /* @__PURE__ */ defineComponent({
20520
20536
  class: "from",
20521
20537
  type: "range",
20522
20538
  min: unref(min2),
20523
- max: unref(multiRange) ? validTo.value : unref(max2),
20539
+ max: unref(max2),
20524
20540
  step: unref(step),
20525
20541
  required: _ctx.required,
20526
20542
  disabled: unref(disabled),
@@ -20532,7 +20548,7 @@ const _sfc_main$A = /* @__PURE__ */ defineComponent({
20532
20548
  value: validTo.value,
20533
20549
  class: "to",
20534
20550
  type: "range",
20535
- min: validFrom.value,
20551
+ min: unref(min2),
20536
20552
  max: unref(max2),
20537
20553
  step: unref(step),
20538
20554
  required: _ctx.required,
@@ -20608,7 +20624,7 @@ const _sfc_main$A = /* @__PURE__ */ defineComponent({
20608
20624
  };
20609
20625
  }
20610
20626
  });
20611
- const RangeInput = /* @__PURE__ */ _export_sfc(_sfc_main$A, [["__scopeId", "data-v-c427a28c"]]);
20627
+ const RangeInput = /* @__PURE__ */ _export_sfc(_sfc_main$A, [["__scopeId", "data-v-36a4519c"]]);
20612
20628
  const tableTools = [
20613
20629
  "mergeCells",
20614
20630
  "splitCells",
@@ -30435,7 +30451,6 @@ const _sfc_main$s = /* @__PURE__ */ defineComponent({
30435
30451
  lines: {},
30436
30452
  autocomplete: {},
30437
30453
  autofocus: { type: Boolean },
30438
- debounceDelay: { default: 300 },
30439
30454
  onFocusout: {}
30440
30455
  },
30441
30456
  emits: ["update:modelValue", "debounce"],
@@ -30450,13 +30465,13 @@ const _sfc_main$s = /* @__PURE__ */ defineComponent({
30450
30465
  if (props2.multiline || props2.code) return 4;
30451
30466
  return 1;
30452
30467
  });
30453
- const debounceUpdate = useDebounceFn(() => {
30454
- emit2("debounce", inputVal.value);
30455
- }, props2.debounceDelay);
30468
+ function emitValue() {
30469
+ emit2("update:modelValue", inputVal.value);
30470
+ }
30456
30471
  function updateInputVal() {
30457
30472
  if (props2.disabled) return;
30458
- emit2("update:modelValue", inputVal.value);
30459
- void debounceUpdate();
30473
+ emitValue();
30474
+ debounce(emitValue, 300);
30460
30475
  }
30461
30476
  watch(
30462
30477
  () => props2.modelValue,
@@ -30551,7 +30566,7 @@ const _sfc_main$s = /* @__PURE__ */ defineComponent({
30551
30566
  };
30552
30567
  }
30553
30568
  });
30554
- const TextInput = /* @__PURE__ */ _export_sfc(_sfc_main$s, [["__scopeId", "data-v-0e10a3b5"]]);
30569
+ const TextInput = /* @__PURE__ */ _export_sfc(_sfc_main$s, [["__scopeId", "data-v-3c20ae39"]]);
30555
30570
  const _hoisted_1$j = ["title"];
30556
30571
  const _hoisted_2$a = ["id", "required"];
30557
30572
  const _hoisted_3$8 = ["for"];
@@ -32791,7 +32806,7 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
32791
32806
  emits: /* @__PURE__ */ mergeModels(["update:selectedItems", "orderBy", "select", "lastItemVisible"], ["update:loading", "update:itemHeight", "update:selectedItems"]),
32792
32807
  setup(__props, { emit: __emit }) {
32793
32808
  useCssVars((_ctx) => ({
32794
- "19ae1fec": unref(computedItemHeight)
32809
+ "f80ef6d8": unref(computedItemHeight)
32795
32810
  }));
32796
32811
  const emit2 = __emit;
32797
32812
  const NON_DIGIT_REGEX = /[^\d.-]/g;
@@ -33018,7 +33033,7 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
33018
33033
  };
33019
33034
  }
33020
33035
  });
33021
- const TableSchema = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["__scopeId", "data-v-248ceeff"]]);
33036
+ const TableSchema = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["__scopeId", "data-v-4c462da5"]]);
33022
33037
  const _sfc_main$4 = /* @__PURE__ */ defineComponent({
33023
33038
  __name: "Title",
33024
33039
  props: {
@@ -33281,6 +33296,12 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
33281
33296
  pointerPosX.value = newMousePosX;
33282
33297
  pointerPosY.value = newMousePosY;
33283
33298
  }
33299
+ function onInteractionEnd() {
33300
+ debounce(() => {
33301
+ limit();
33302
+ panLocked.value = scale.value === 1;
33303
+ }, 100);
33304
+ }
33284
33305
  function limit() {
33285
33306
  if (scale.value < __props.minScale) {
33286
33307
  scale.value = __props.minScale;
@@ -33335,6 +33356,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
33335
33356
  function onMouseWheelDo(wheelDelta) {
33336
33357
  const scaleDelta = 1.25 ** (wheelDelta / 120);
33337
33358
  tryToScale(scaleDelta);
33359
+ onInteractionEnd();
33338
33360
  }
33339
33361
  function onMouseDown(ev) {
33340
33362
  refreshContainerPos();
@@ -33346,6 +33368,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
33346
33368
  }
33347
33369
  function onMouseUp() {
33348
33370
  isPointerDown.value = false;
33371
+ onInteractionEnd();
33349
33372
  document.removeEventListener("mouseup", onMouseUp);
33350
33373
  document.removeEventListener("mousemove", onMouseMove);
33351
33374
  }
@@ -33372,6 +33395,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
33372
33395
  if (ev.touches.length === 0) {
33373
33396
  isPointerDown.value = false;
33374
33397
  if (Math.abs(scale.value - 1) < 0.1) scale.value = 1;
33398
+ onInteractionEnd();
33375
33399
  } else if (ev.touches.length === 1) {
33376
33400
  pointerPosX.value = ev.touches[0].clientX;
33377
33401
  pointerPosY.value = ev.touches[0].clientY;
@@ -34369,7 +34393,7 @@ function uploadField(id, label, options) {
34369
34393
  function bglForm(idOrField, ...schema) {
34370
34394
  if (typeof idOrField === "string") {
34371
34395
  return {
34372
- $el: markRaw(_sfc_main$R),
34396
+ $el: "bagelform",
34373
34397
  id: idOrField,
34374
34398
  attrs: {
34375
34399
  schema: [idOrField, ...schema]
@@ -34377,7 +34401,7 @@ function bglForm(idOrField, ...schema) {
34377
34401
  };
34378
34402
  }
34379
34403
  return {
34380
- $el: markRaw(_sfc_main$R),
34404
+ $el: "bagelform",
34381
34405
  attrs: {
34382
34406
  schema: [idOrField, ...schema]
34383
34407
  }
@@ -34463,18 +34487,14 @@ function formatString(str, format2) {
34463
34487
  }
34464
34488
  return str;
34465
34489
  }
34466
- function debounce(callback, wait, immediate) {
34467
- let timeout;
34468
- return function(...args) {
34469
- const later = () => {
34470
- timeout = void 0;
34471
- if (!immediate) callback.apply(this, args);
34472
- };
34473
- const callNow = immediate && timeout === void 0;
34474
- clearTimeout(timeout);
34475
- timeout = setTimeout(later, wait);
34476
- if (callNow) callback.apply(this, args);
34477
- };
34490
+ const debouncers = /* @__PURE__ */ new Map();
34491
+ function debounce(fn2, wait = 500) {
34492
+ clearTimeout(debouncers.get(fn2));
34493
+ const timeout = setTimeout(() => {
34494
+ fn2();
34495
+ debouncers.delete(fn2);
34496
+ }, wait);
34497
+ debouncers.set(fn2, timeout);
34478
34498
  }
34479
34499
  function keyToLabel(key) {
34480
34500
  if (key === void 0) return key;