@bagelink/vue 0.0.1204 → 0.0.1214

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.
@@ -1,6 +1,7 @@
1
1
  import { TableSchemaProps } from '../types/TableSchema';
2
2
  declare const _default: <T extends Record<string, any>>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
3
- props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{} & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, never>, never> & (TableSchemaProps<T> & {
3
+ props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{} & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, never>, never> & (Omit<TableSchemaProps<T>, "data"> & {
4
+ data: T;
4
5
  includeUnset?: boolean;
5
6
  }) & Partial<{}>> & import('vue').PublicProps;
6
7
  expose(exposed: import('vue').ShallowUnwrapRef<{}>): void;
@@ -1 +1 @@
1
- {"version":3,"file":"DataPreview.vue.d.ts","sourceRoot":"","sources":["../../src/components/DataPreview.vue"],"names":[],"mappings":"AAoEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAA;yBAK3C,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,eAChC,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,CAAC,OAAO,CAAC,cAClD,mBAAmB,CAAC,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,OAAO,CAAC,CAAC,iBAC5F,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,CAAC,QAAQ,CAAC;WAqF1D,mBAAmB,CAAC;uBAnF8B,OAAO;oBAmF6B,CAAC,4BAA2B;oBACzG,OAAO,KAAK,EAAE,gBAAgB,CAAC,EAAE,CAAC,GAAG,IAAI;WAClD,GAAG;;UAEJ,EAAE;OAGG,OAAO,KAAK,EAAE,KAAK,GAAG;IAAE,KAAK,CAAC,EAAE,OAAO,CAAC,OAAO,WAAW,CAAC,CAAA;CAAE;AA/FzE,wBA+F4E;AAC5E,KAAK,mBAAmB,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAG,GAAG,EAAE,CAAC"}
1
+ {"version":3,"file":"DataPreview.vue.d.ts","sourceRoot":"","sources":["../../src/components/DataPreview.vue"],"names":[],"mappings":"AAoEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAA;yBAK3C,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,eAChC,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,CAAC,OAAO,CAAC,cAClD,mBAAmB,CAAC,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,OAAO,CAAC,CAAC,iBAC5F,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,CAAC,QAAQ,CAAC;WAqF1D,mBAAmB,CAAC;cAnFmC,CAAC;uBAAiB,OAAO;oBAmFM,CAAC,4BAA2B;oBACzG,OAAO,KAAK,EAAE,gBAAgB,CAAC,EAAE,CAAC,GAAG,IAAI;WAClD,GAAG;;UAEJ,EAAE;OAGG,OAAO,KAAK,EAAE,KAAK,GAAG;IAAE,KAAK,CAAC,EAAE,OAAO,CAAC,OAAO,WAAW,CAAC,CAAA;CAAE;AA/FzE,wBA+F4E;AAC5E,KAAK,mBAAmB,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAG,GAAG,EAAE,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"NumberInput.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/form/inputs/NumberInput.vue"],"names":[],"mappings":"AAkMA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AAI7C,KAAK,YAAY,GAAG,SAAS,GAAG,UAAU,GAAG,YAAY,CAAA;AAEzD,UAAU,gBAAgB;IACzB,UAAU,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IAC5B,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,SAAS,CAAC,EAAE,QAAQ,CAAA;IACpB,IAAI,CAAC,EAAE,QAAQ,CAAA;IACf,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,MAAM,CAAC,EAAE,YAAY,CAAA;IACrB,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,OAAO,CAAC,EAAE,MAAM,CAAA;CAChB;;;;;;AAuTD,wBAQG"}
1
+ {"version":3,"file":"NumberInput.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/form/inputs/NumberInput.vue"],"names":[],"mappings":"AA6NA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AAI7C,KAAK,YAAY,GAAG,SAAS,GAAG,UAAU,GAAG,YAAY,CAAA;AAEzD,UAAU,gBAAgB;IACzB,UAAU,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IAC5B,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,SAAS,CAAC,EAAE,QAAQ,CAAA;IACpB,IAAI,CAAC,EAAE,QAAQ,CAAA;IACf,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,MAAM,CAAC,EAAE,YAAY,CAAA;IACrB,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,OAAO,CAAC,EAAE,MAAM,CAAA;CAChB;;;;;;AAmVD,wBAQG"}
package/dist/index.cjs CHANGED
@@ -748,8 +748,8 @@ const _sfc_main$Z = /* @__PURE__ */ vue.defineComponent({
748
748
  const emit2 = __emit;
749
749
  const ANIMATION_TIMINGS = {
750
750
  TOUCH: 150,
751
- MOBILE: 300,
752
- DESKTOP: 400,
751
+ MOBILE: 420,
752
+ DESKTOP: 840,
753
753
  MAX_DURATION: 300,
754
754
  BASE_DURATION: 150,
755
755
  DURATION_PER_PANEL: 50
@@ -1182,7 +1182,7 @@ const _sfc_main$Z = /* @__PURE__ */ vue.defineComponent({
1182
1182
  };
1183
1183
  }
1184
1184
  });
1185
- const Carousel = /* @__PURE__ */ _export_sfc(_sfc_main$Z, [["__scopeId", "data-v-3a1530dc"]]);
1185
+ const Carousel = /* @__PURE__ */ _export_sfc(_sfc_main$Z, [["__scopeId", "data-v-d0b0c027"]]);
1186
1186
  function _isPlaceholder(a2) {
1187
1187
  return a2 != null && typeof a2 === "object" && a2["@@functional/placeholder"] === true;
1188
1188
  }
@@ -7506,12 +7506,12 @@ const _hoisted_1$M = { class: "data-preview" };
7506
7506
  const _sfc_main$X = /* @__PURE__ */ vue.defineComponent({
7507
7507
  __name: "DataPreview",
7508
7508
  props: {
7509
- data: {},
7510
7509
  schema: { type: Function },
7511
7510
  showFields: {},
7512
7511
  useServerSort: { type: Boolean },
7513
7512
  selectable: { type: Boolean },
7514
7513
  onLastItemVisible: { type: Function },
7514
+ data: {},
7515
7515
  includeUnset: { type: Boolean }
7516
7516
  },
7517
7517
  setup(__props) {
@@ -7544,7 +7544,7 @@ const _sfc_main$X = /* @__PURE__ */ vue.defineComponent({
7544
7544
  };
7545
7545
  }
7546
7546
  });
7547
- const DataPreview = /* @__PURE__ */ _export_sfc(_sfc_main$X, [["__scopeId", "data-v-ff265953"]]);
7547
+ const DataPreview = /* @__PURE__ */ _export_sfc(_sfc_main$X, [["__scopeId", "data-v-550fe546"]]);
7548
7548
  function useTableSelection(options) {
7549
7549
  const allSelectorEl = vue.ref();
7550
7550
  const computedSelectedItems = vue.computed(() => options.selectedItems.value);
@@ -21677,38 +21677,58 @@ const _sfc_main$G = /* @__PURE__ */ vue.defineComponent({
21677
21677
  helptext: {},
21678
21678
  layout: {},
21679
21679
  center: { type: Boolean },
21680
- padZero: {}
21680
+ padZero: { default: 1 }
21681
21681
  },
21682
21682
  emits: ["update:modelValue"],
21683
21683
  setup(__props, { emit: __emit }) {
21684
21684
  const emit2 = __emit;
21685
21685
  let numberValue = vue.ref(Number.parseFloat(`${__props.modelValue}`) || void 0);
21686
21686
  const btnLayouts = ["horizontal", "vertical"];
21687
- const canAdd = vue.computed(() => !(__props.max !== void 0 && (numberValue.value || 0) + __props.step > __props.max));
21688
- const canDecrement = vue.computed(() => !(__props.min !== void 0 && (numberValue.value || 0 - __props.step) < __props.min));
21687
+ function add2(...numbers) {
21688
+ var _a2;
21689
+ const numArr = numbers.map((n2) => n2 || 0);
21690
+ const precision = ((_a2 = __props.step.toString().split(".")[1]) == null ? void 0 : _a2.length) || 0;
21691
+ return Number.parseFloat(numArr.reduce((acc, curr) => acc + curr, 0).toFixed(precision));
21692
+ }
21693
+ function subtract(...numbers) {
21694
+ var _a2;
21695
+ const numArr = numbers.map((n2) => n2 || 0);
21696
+ const firstNum = numArr.shift() || 0;
21697
+ const precision = ((_a2 = __props.step.toString().split(".")[1]) == null ? void 0 : _a2.length) || 0;
21698
+ return Number.parseFloat(numArr.reduce((acc, curr) => acc - curr, firstNum).toFixed(precision));
21699
+ }
21700
+ const canAdd = vue.computed(() => !(__props.max !== void 0 && add2(numberValue.value, __props.step) <= __props.max));
21701
+ const canDecrement = vue.computed(() => __props.min === void 0 || subtract(numberValue.value, __props.step) >= __props.min);
21689
21702
  function increment() {
21690
21703
  if (!canAdd.value) return;
21691
- numberValue.value = (numberValue.value || 0) + __props.step;
21704
+ numberValue.value = add2(numberValue.value || 0, __props.step);
21692
21705
  emit2("update:modelValue", numberValue.value);
21693
21706
  }
21694
21707
  function decrement() {
21695
21708
  if (!canDecrement.value) return;
21696
- numberValue.value = (numberValue.value || 0) - __props.step;
21709
+ numberValue.value = subtract(numberValue.value || 0, __props.step);
21697
21710
  emit2("update:modelValue", numberValue.value);
21698
21711
  }
21699
21712
  function formatNumber2(num) {
21700
- let formatted = num.toString();
21701
- if (__props.padZero && __props.padZero > 0) {
21702
- formatted = formatted.padStart(__props.padZero, "0");
21703
- }
21704
- return formatted.replace(/\B(?=(\d{3})+(?!\d))/g, ",");
21713
+ if (Number.isNaN(num)) return "";
21714
+ const formatter = new Intl.NumberFormat("en-US", {
21715
+ minimumFractionDigits: 0,
21716
+ maximumFractionDigits: 20,
21717
+ useGrouping: true
21718
+ });
21719
+ const formattedNum = formatter.format(num);
21720
+ const [integerPart, decimalPart] = formattedNum.split(".");
21721
+ const padding = __props.padZero && __props.padZero > integerPart.replace(/,/g, "").length ? "0".repeat(__props.padZero - integerPart.replace(/,/g, "").length) : "";
21722
+ return decimalPart ? `${padding}${integerPart}.${decimalPart}` : `${padding}${integerPart}`;
21705
21723
  }
21706
21724
  let formattedValue = vue.ref("");
21707
21725
  function inputHandler() {
21708
- const numeric = formattedValue.value.replace(/[^\d.-]/g, "");
21709
- if (numeric === "" || numeric === "-" || numeric === "." || numeric === "-." || numeric.endsWith(".")) return;
21726
+ let numeric = formattedValue.value.replace(/[^\d.-]/g, "");
21727
+ if (numeric === "-." || numeric.endsWith(".")) return;
21728
+ const emptyValue = ["", "-", "."].includes(numeric);
21729
+ if (emptyValue) numeric = `${__props.min}`;
21710
21730
  numberValue.value = Number.parseFloat(numeric);
21711
- formattedValue.value = formatNumber2(numberValue.value);
21731
+ formattedValue.value = emptyValue ? "" : formatNumber2(numberValue.value);
21712
21732
  emit2("update:modelValue", numberValue.value);
21713
21733
  }
21714
21734
  vue.watch(() => numberValue.value, () => {
@@ -21820,7 +21840,7 @@ const _sfc_main$G = /* @__PURE__ */ vue.defineComponent({
21820
21840
  };
21821
21841
  }
21822
21842
  });
21823
- const NumberInput = /* @__PURE__ */ _export_sfc(_sfc_main$G, [["__scopeId", "data-v-e3916f73"]]);
21843
+ const NumberInput = /* @__PURE__ */ _export_sfc(_sfc_main$G, [["__scopeId", "data-v-d8856711"]]);
21824
21844
  const _hoisted_1$y = ["value", "autofocus", "onKeydown", "onPaste"];
21825
21845
  const _sfc_main$F = /* @__PURE__ */ vue.defineComponent({
21826
21846
  __name: "OTP",
package/dist/index.mjs CHANGED
@@ -746,8 +746,8 @@ const _sfc_main$Z = /* @__PURE__ */ defineComponent({
746
746
  const emit2 = __emit;
747
747
  const ANIMATION_TIMINGS = {
748
748
  TOUCH: 150,
749
- MOBILE: 300,
750
- DESKTOP: 400,
749
+ MOBILE: 420,
750
+ DESKTOP: 840,
751
751
  MAX_DURATION: 300,
752
752
  BASE_DURATION: 150,
753
753
  DURATION_PER_PANEL: 50
@@ -1180,7 +1180,7 @@ const _sfc_main$Z = /* @__PURE__ */ defineComponent({
1180
1180
  };
1181
1181
  }
1182
1182
  });
1183
- const Carousel = /* @__PURE__ */ _export_sfc(_sfc_main$Z, [["__scopeId", "data-v-3a1530dc"]]);
1183
+ const Carousel = /* @__PURE__ */ _export_sfc(_sfc_main$Z, [["__scopeId", "data-v-d0b0c027"]]);
1184
1184
  function _isPlaceholder(a2) {
1185
1185
  return a2 != null && typeof a2 === "object" && a2["@@functional/placeholder"] === true;
1186
1186
  }
@@ -7504,12 +7504,12 @@ const _hoisted_1$M = { class: "data-preview" };
7504
7504
  const _sfc_main$X = /* @__PURE__ */ defineComponent({
7505
7505
  __name: "DataPreview",
7506
7506
  props: {
7507
- data: {},
7508
7507
  schema: { type: Function },
7509
7508
  showFields: {},
7510
7509
  useServerSort: { type: Boolean },
7511
7510
  selectable: { type: Boolean },
7512
7511
  onLastItemVisible: { type: Function },
7512
+ data: {},
7513
7513
  includeUnset: { type: Boolean }
7514
7514
  },
7515
7515
  setup(__props) {
@@ -7542,7 +7542,7 @@ const _sfc_main$X = /* @__PURE__ */ defineComponent({
7542
7542
  };
7543
7543
  }
7544
7544
  });
7545
- const DataPreview = /* @__PURE__ */ _export_sfc(_sfc_main$X, [["__scopeId", "data-v-ff265953"]]);
7545
+ const DataPreview = /* @__PURE__ */ _export_sfc(_sfc_main$X, [["__scopeId", "data-v-550fe546"]]);
7546
7546
  function useTableSelection(options) {
7547
7547
  const allSelectorEl = ref();
7548
7548
  const computedSelectedItems = computed(() => options.selectedItems.value);
@@ -21675,38 +21675,58 @@ const _sfc_main$G = /* @__PURE__ */ defineComponent({
21675
21675
  helptext: {},
21676
21676
  layout: {},
21677
21677
  center: { type: Boolean },
21678
- padZero: {}
21678
+ padZero: { default: 1 }
21679
21679
  },
21680
21680
  emits: ["update:modelValue"],
21681
21681
  setup(__props, { emit: __emit }) {
21682
21682
  const emit2 = __emit;
21683
21683
  let numberValue = ref(Number.parseFloat(`${__props.modelValue}`) || void 0);
21684
21684
  const btnLayouts = ["horizontal", "vertical"];
21685
- const canAdd = computed(() => !(__props.max !== void 0 && (numberValue.value || 0) + __props.step > __props.max));
21686
- const canDecrement = computed(() => !(__props.min !== void 0 && (numberValue.value || 0 - __props.step) < __props.min));
21685
+ function add2(...numbers) {
21686
+ var _a2;
21687
+ const numArr = numbers.map((n2) => n2 || 0);
21688
+ const precision = ((_a2 = __props.step.toString().split(".")[1]) == null ? void 0 : _a2.length) || 0;
21689
+ return Number.parseFloat(numArr.reduce((acc, curr) => acc + curr, 0).toFixed(precision));
21690
+ }
21691
+ function subtract(...numbers) {
21692
+ var _a2;
21693
+ const numArr = numbers.map((n2) => n2 || 0);
21694
+ const firstNum = numArr.shift() || 0;
21695
+ const precision = ((_a2 = __props.step.toString().split(".")[1]) == null ? void 0 : _a2.length) || 0;
21696
+ return Number.parseFloat(numArr.reduce((acc, curr) => acc - curr, firstNum).toFixed(precision));
21697
+ }
21698
+ const canAdd = computed(() => !(__props.max !== void 0 && add2(numberValue.value, __props.step) <= __props.max));
21699
+ const canDecrement = computed(() => __props.min === void 0 || subtract(numberValue.value, __props.step) >= __props.min);
21687
21700
  function increment() {
21688
21701
  if (!canAdd.value) return;
21689
- numberValue.value = (numberValue.value || 0) + __props.step;
21702
+ numberValue.value = add2(numberValue.value || 0, __props.step);
21690
21703
  emit2("update:modelValue", numberValue.value);
21691
21704
  }
21692
21705
  function decrement() {
21693
21706
  if (!canDecrement.value) return;
21694
- numberValue.value = (numberValue.value || 0) - __props.step;
21707
+ numberValue.value = subtract(numberValue.value || 0, __props.step);
21695
21708
  emit2("update:modelValue", numberValue.value);
21696
21709
  }
21697
21710
  function formatNumber2(num) {
21698
- let formatted = num.toString();
21699
- if (__props.padZero && __props.padZero > 0) {
21700
- formatted = formatted.padStart(__props.padZero, "0");
21701
- }
21702
- return formatted.replace(/\B(?=(\d{3})+(?!\d))/g, ",");
21711
+ if (Number.isNaN(num)) return "";
21712
+ const formatter = new Intl.NumberFormat("en-US", {
21713
+ minimumFractionDigits: 0,
21714
+ maximumFractionDigits: 20,
21715
+ useGrouping: true
21716
+ });
21717
+ const formattedNum = formatter.format(num);
21718
+ const [integerPart, decimalPart] = formattedNum.split(".");
21719
+ const padding = __props.padZero && __props.padZero > integerPart.replace(/,/g, "").length ? "0".repeat(__props.padZero - integerPart.replace(/,/g, "").length) : "";
21720
+ return decimalPart ? `${padding}${integerPart}.${decimalPart}` : `${padding}${integerPart}`;
21703
21721
  }
21704
21722
  let formattedValue = ref("");
21705
21723
  function inputHandler() {
21706
- const numeric = formattedValue.value.replace(/[^\d.-]/g, "");
21707
- if (numeric === "" || numeric === "-" || numeric === "." || numeric === "-." || numeric.endsWith(".")) return;
21724
+ let numeric = formattedValue.value.replace(/[^\d.-]/g, "");
21725
+ if (numeric === "-." || numeric.endsWith(".")) return;
21726
+ const emptyValue = ["", "-", "."].includes(numeric);
21727
+ if (emptyValue) numeric = `${__props.min}`;
21708
21728
  numberValue.value = Number.parseFloat(numeric);
21709
- formattedValue.value = formatNumber2(numberValue.value);
21729
+ formattedValue.value = emptyValue ? "" : formatNumber2(numberValue.value);
21710
21730
  emit2("update:modelValue", numberValue.value);
21711
21731
  }
21712
21732
  watch(() => numberValue.value, () => {
@@ -21818,7 +21838,7 @@ const _sfc_main$G = /* @__PURE__ */ defineComponent({
21818
21838
  };
21819
21839
  }
21820
21840
  });
21821
- const NumberInput = /* @__PURE__ */ _export_sfc(_sfc_main$G, [["__scopeId", "data-v-e3916f73"]]);
21841
+ const NumberInput = /* @__PURE__ */ _export_sfc(_sfc_main$G, [["__scopeId", "data-v-d8856711"]]);
21822
21842
  const _hoisted_1$y = ["value", "autofocus", "onKeydown", "onPaste"];
21823
21843
  const _sfc_main$F = /* @__PURE__ */ defineComponent({
21824
21844
  __name: "OTP",
package/dist/style.css CHANGED
@@ -356,13 +356,13 @@ display: block;
356
356
  padding: 0;
357
357
  }
358
358
 
359
- .BglCarousel[data-v-3a1530dc] {
359
+ .BglCarousel[data-v-d0b0c027] {
360
360
  position: relative;
361
361
  width: 100%;
362
362
  overflow: hidden;
363
363
  touch-action: pan-y pinch-zoom; /* Allow vertical scrolling */
364
364
  }
365
- .bgl-slider[data-v-3a1530dc] {
365
+ .bgl-slider[data-v-d0b0c027] {
366
366
  display: flex;
367
367
  position: relative;
368
368
  width: 100%;
@@ -375,26 +375,26 @@ display: block;
375
375
  -webkit-user-select: none;
376
376
  user-select: none;
377
377
  }
378
- .bgl-slider[data-v-3a1530dc] > * {
378
+ .bgl-slider[data-v-d0b0c027] > * {
379
379
  flex: 0 0 calc((100% - (var(--item-count) - 1) * 1%) / var(--item-count));
380
380
  width: calc((100% - (var(--item-count) - 1) * 1%) / var(--item-count));
381
381
  min-width: calc((100% - (var(--item-count) - 1) * 1%) / var(--item-count));
382
382
  position: relative;
383
383
  overflow: hidden;
384
384
  }
385
- .bgl-slider.slides-1[data-v-3a1530dc] > * {
385
+ .bgl-slider.slides-1[data-v-d0b0c027] > * {
386
386
  flex: 0 0 100%;
387
387
  width: 100%;
388
388
  min-width: 100%;
389
389
  }
390
- .dragging .bgl-slider[data-v-3a1530dc] > * {
390
+ .dragging .bgl-slider[data-v-d0b0c027] > * {
391
391
  pointer-events: none;
392
392
  user-select: none;
393
393
  }
394
- .autoHeight[data-v-3a1530dc] {
394
+ .autoHeight[data-v-d0b0c027] {
395
395
  transition: height ease 0.7s;
396
396
  }
397
- .dots[data-v-3a1530dc] {
397
+ .dots[data-v-d0b0c027] {
398
398
  display: flex;
399
399
  justify-content: center;
400
400
  align-items: center;
@@ -402,7 +402,7 @@ display: block;
402
402
  margin-top: 1rem;
403
403
  gap: 8px;
404
404
  }
405
- .dot[data-v-3a1530dc] {
405
+ .dot[data-v-d0b0c027] {
406
406
  height: 10px;
407
407
  width: 10px;
408
408
  border-radius: 50%;
@@ -411,10 +411,10 @@ display: block;
411
411
  transition: opacity 0.3s ease;
412
412
  cursor: pointer;
413
413
  }
414
- .dot[data-v-3a1530dc]:hover {
414
+ .dot[data-v-d0b0c027]:hover {
415
415
  opacity: 0.6;
416
416
  }
417
- .dot.current[data-v-3a1530dc] {
417
+ .dot.current[data-v-d0b0c027] {
418
418
  opacity: 0.8;
419
419
  }
420
420
 
@@ -453,23 +453,23 @@ display: block;
453
453
  }
454
454
  }
455
455
 
456
- .data-preview[data-v-ff265953] {
456
+ .data-preview[data-v-550fe546] {
457
457
  display: flex;
458
458
  flex-direction: column;
459
459
  gap: 0.5rem;
460
460
  }
461
- .preview-field[data-v-ff265953] {
461
+ .preview-field[data-v-550fe546] {
462
462
  display: flex;
463
463
  flex-direction: row;
464
464
  align-items: center;
465
465
  gap: 0.5rem;
466
466
  }
467
- .field-label[data-v-ff265953] {
467
+ .field-label[data-v-550fe546] {
468
468
  font-size: 0.8rem;
469
469
  color: var(--bgl-black-tint);
470
470
  font-weight: 500;
471
471
  }
472
- .field-value[data-v-ff265953] {
472
+ .field-value[data-v-550fe546] {
473
473
  font-size: 0.95rem;
474
474
  }
475
475
 
@@ -1241,14 +1241,14 @@ pre code.hljs{
1241
1241
  direction: ltr;
1242
1242
  }
1243
1243
 
1244
- .txtInputIconStart .iconStart[data-v-e3916f73] {
1244
+ .txtInputIconStart .iconStart[data-v-d8856711] {
1245
1245
  color: var(--input-color);
1246
1246
  position: absolute;
1247
1247
  inset-inline-start:calc(var(--input-height) / 3 - 0.25rem);
1248
1248
  margin-top: calc(var(--input-height) / 2 );
1249
1249
  line-height: 0;
1250
1250
  }
1251
- .textInputSpinnerWrap .spinner[data-v-e3916f73] {
1251
+ .textInputSpinnerWrap .spinner[data-v-d8856711] {
1252
1252
  color: var(--input-color);
1253
1253
  position: absolute;
1254
1254
  inset-inline-end: 0;
@@ -1258,18 +1258,18 @@ pre code.hljs{
1258
1258
  flex-direction: column;
1259
1259
  gap: 0;
1260
1260
  }
1261
- .top-bgl-ctrl-num-btn[data-v-e3916f73]{
1261
+ .top-bgl-ctrl-num-btn[data-v-d8856711]{
1262
1262
  margin-top: calc(var(--input-height) / 10) !important;
1263
1263
  }
1264
- .bgl-ctrl-num-btn[data-v-e3916f73]{
1264
+ .bgl-ctrl-num-btn[data-v-d8856711]{
1265
1265
  height: calc(var(--input-height) / 2.5) !important;
1266
1266
  isolation: isolate;
1267
1267
  }
1268
- .bgl-big-ctrl-num-btn[data-v-e3916f73]{
1268
+ .bgl-big-ctrl-num-btn[data-v-d8856711]{
1269
1269
  width: 100% !important;
1270
1270
  isolation: isolate;
1271
1271
  }
1272
- .bgl-number-input[data-v-e3916f73]{
1272
+ .bgl-number-input[data-v-d8856711]{
1273
1273
  padding-inline-end: 1.75rem !important;
1274
1274
  }
1275
1275
 
@@ -5809,6 +5809,10 @@ to {
5809
5809
  }.w-auto,
5810
5810
  .w-a {
5811
5811
  width: auto !important;
5812
+ }.max-width-none {
5813
+ max-width: none !important;
5814
+ }.max-height-none {
5815
+ max-height: none !important;
5812
5816
  }.h-auto,
5813
5817
  .h-a {
5814
5818
  height: auto !important;
@@ -9523,6 +9527,14 @@ to {
9523
9527
  width: auto !important;
9524
9528
  }
9525
9529
 
9530
+ .m_max-width-none {
9531
+ max-width: none !important;
9532
+ }
9533
+
9534
+ .m_max-height-none {
9535
+ max-height: none !important;
9536
+ }
9537
+
9526
9538
  .m_h-auto,
9527
9539
  .m_h-a {
9528
9540
  height: auto !important;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@bagelink/vue",
3
3
  "type": "module",
4
- "version": "0.0.1204",
4
+ "version": "0.0.1214",
5
5
  "description": "Bagel core sdk packages",
6
6
  "author": {
7
7
  "name": "Neveh Allon",
@@ -18,8 +18,8 @@ const emit = defineEmits(['update:index'])
18
18
  // Constants
19
19
  const ANIMATION_TIMINGS = {
20
20
  TOUCH: 150,
21
- MOBILE: 300,
22
- DESKTOP: 400,
21
+ MOBILE: 420,
22
+ DESKTOP: 840,
23
23
  MAX_DURATION: 300,
24
24
  BASE_DURATION: 150,
25
25
  DURATION_PER_PANEL: 50,
@@ -6,7 +6,7 @@ import { computed, useSlots } from 'vue'
6
6
  import { useSchemaField } from '../composables/useSchemaField'
7
7
  import { useTableData } from './DataTable/useTableData'
8
8
 
9
- const props = defineProps<TableSchemaProps<T> & { includeUnset?: boolean }>()
9
+ const props = defineProps<Omit<TableSchemaProps<T>, 'data'> & { data: T, includeUnset?: boolean }>()
10
10
  const slots = useSlots() as Slots & Record<string, (props: { row: T, field: BaseBagelField<T> }) => any>
11
11
 
12
12
  const data = computed(() => Array.isArray(props.data) ? props.data : [props.data])
@@ -39,7 +39,7 @@ const {
39
39
  helptext,
40
40
  layout,
41
41
  id,
42
- padZero,
42
+ padZero = 1,
43
43
  } = defineProps<NumberInputProps>()
44
44
 
45
45
  const emit = defineEmits(['update:modelValue'])
@@ -48,38 +48,66 @@ let numberValue = $ref(Number.parseFloat(`${modelValue}`) || undefined)
48
48
 
49
49
  const btnLayouts: NumberLayout[] = ['horizontal', 'vertical']
50
50
 
51
- const canAdd = $computed(() => !(max !== undefined && ((numberValue || 0) + step) > max))
52
- const canDecrement = $computed(() => !(min !== undefined && (numberValue || 0 - step) < min))
51
+ function add(...numbers: (number | undefined)[]) {
52
+ const numArr: number[] = numbers.map(n => n || 0)
53
+ const precision = step.toString().split('.')[1]?.length || 0
54
+ return Number.parseFloat(numArr.reduce((acc, curr) => acc + curr, 0).toFixed(precision))
55
+ }
56
+
57
+ function subtract(...numbers: (number | undefined)[]) {
58
+ const numArr: number[] = numbers.map(n => n || 0)
59
+ const firstNum = numArr.shift() || 0
60
+ const precision = step.toString().split('.')[1]?.length || 0
61
+ return Number.parseFloat(numArr.reduce((acc, curr) => acc - curr, firstNum).toFixed(precision))
62
+ }
63
+
64
+ const canAdd = $computed(() => !(max !== undefined && add(numberValue, step) <= max))
65
+ const canDecrement = $computed(() => min === undefined || subtract(numberValue, step) >= min)
53
66
 
54
67
  // Methods
55
68
  function increment() {
56
69
  if (!canAdd) return
57
- numberValue = (numberValue || 0) + step
70
+ numberValue = add(numberValue || 0, step)
58
71
  emit('update:modelValue', numberValue)
59
72
  }
60
73
 
61
74
  function decrement() {
62
75
  if (!canDecrement) return
63
- numberValue = (numberValue || 0) - step
76
+ numberValue = subtract(numberValue || 0, step)
64
77
  emit('update:modelValue', numberValue)
65
78
  }
66
79
 
67
80
  function formatNumber(num: number) {
68
- let formatted = num.toString()
69
- if (padZero && padZero > 0) {
70
- formatted = formatted.padStart(padZero, '0')
71
- }
72
- // eslint-disable-next-line regexp/no-unused-capturing-group
73
- return formatted.replace(/\B(?=(\d{3})+(?!\d))/g, ',')
81
+ if (Number.isNaN(num)) return ''
82
+ const formatter = new Intl.NumberFormat('en-US', {
83
+ minimumFractionDigits: 0,
84
+ maximumFractionDigits: 20,
85
+ useGrouping: true
86
+ })
87
+
88
+ const formattedNum = formatter.format(num)
89
+ const [integerPart, decimalPart] = formattedNum.split('.')
90
+
91
+ // Add padding zeros if needed
92
+ const padding = padZero && padZero > integerPart.replace(/,/g, '').length
93
+ ? '0'.repeat(padZero - integerPart.replace(/,/g, '').length)
94
+ : ''
95
+
96
+ return decimalPart
97
+ ? `${padding}${integerPart}.${decimalPart}`
98
+ : `${padding}${integerPart}`
74
99
  }
75
100
 
76
101
  let formattedValue = $ref('')
77
-
78
102
  function inputHandler() {
79
- const numeric = formattedValue.replace(/[^\d.-]/g, '')
80
- if (numeric === '' || numeric === '-' || numeric === '.' || numeric === '-.' || numeric.endsWith('.')) return
103
+ let numeric = formattedValue.replace(/[^\d.-]/g, '')
104
+ if (numeric === '-.' || numeric.endsWith('.')) return
105
+ const emptyValue = ['', '-', '.'].includes(numeric)
106
+
107
+ if (emptyValue) numeric = `${min}`
108
+
81
109
  numberValue = Number.parseFloat(numeric)
82
- formattedValue = formatNumber(numberValue)
110
+ formattedValue = emptyValue ? '' : formatNumber(numberValue)
83
111
  emit('update:modelValue', numberValue)
84
112
  }
85
113
 
@@ -108,7 +136,6 @@ watch(() => modelValue, (newVal) => {
108
136
  </label>
109
137
  <div class="gap-025" :class="{ 'column flex': layout === 'vertical', 'flex': layout === 'horizontal' }">
110
138
  <Btn v-if="layout && btnLayouts.includes(layout)" flat icon="add" class="radius" :class="[{ 'bgl-big-ctrl-num-btn': layout === 'vertical' }]" tabindex="-1" @click="increment" />
111
-
112
139
  <input
113
140
  :id
114
141
  v-model.trim="formattedValue"
@@ -2860,6 +2860,14 @@
2860
2860
  width: auto !important;
2861
2861
  }
2862
2862
 
2863
+ .max-width-none {
2864
+ max-width: none !important;
2865
+ }
2866
+
2867
+ .max-height-none {
2868
+ max-height: none !important;
2869
+ }
2870
+
2863
2871
  .h-auto,
2864
2872
  .h-a {
2865
2873
  height: auto !important;
@@ -2151,6 +2151,14 @@
2151
2151
  width: auto !important;
2152
2152
  }
2153
2153
 
2154
+ .m_max-width-none {
2155
+ max-width: none !important;
2156
+ }
2157
+
2158
+ .m_max-height-none {
2159
+ max-height: none !important;
2160
+ }
2161
+
2154
2162
  .m_h-auto,
2155
2163
  .m_h-a {
2156
2164
  height: auto !important;