@bagelink/vue 0.0.765 → 0.0.769

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,23 +1,24 @@
1
1
  import { BglFormSchemaT } from '..';
2
2
  export type SortDirectionsT = 'ASC' | 'DESC';
3
+ export type EmitOrderT = `${string} ${SortDirectionsT}`;
3
4
  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<{
4
5
  props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{
5
6
  readonly onSelect?: ((args_0: T) => any) | undefined;
6
7
  readonly "onUpdate:loading"?: ((loading: boolean) => any) | undefined;
7
8
  readonly "onUpdate:itemHeight"?: ((itemHeight: number) => any) | undefined;
8
- readonly "onUpdate:selectedItems"?: ((args_0: string[]) => any) | undefined;
9
- readonly onOrderBy?: ((args_0: string) => any) | undefined;
9
+ readonly "onUpdate:selectedItems"?: ((...args: unknown[]) => any) | undefined;
10
+ readonly onOrderBy?: ((args_0: `${string} ASC` | `${string} DESC`) => any) | undefined;
10
11
  } & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps & Readonly<{}> & Readonly<{
11
12
  onSelect?: ((args_0: T) => any) | undefined;
12
13
  "onUpdate:loading"?: ((loading: boolean) => any) | undefined;
13
14
  "onUpdate:itemHeight"?: ((itemHeight: number) => any) | undefined;
14
- "onUpdate:selectedItems"?: ((args_0: string[]) => any) | undefined;
15
- onOrderBy?: ((args_0: string) => any) | undefined;
15
+ "onUpdate:selectedItems"?: ((...args: unknown[]) => any) | undefined;
16
+ onOrderBy?: ((args_0: `${string} ASC` | `${string} DESC`) => any) | undefined;
16
17
  }>, never>, "onSelect" | "onUpdate:loading" | "onUpdate:itemHeight" | "onUpdate:selectedItems" | "onOrderBy"> & ({
17
18
  loading?: boolean;
18
19
  itemHeight?: number;
20
+ selectedItems?: T[];
19
21
  } & {
20
- selectedItems?: string[];
21
22
  data: T[];
22
23
  schema?: BglFormSchemaT<T> | (() => BglFormSchemaT<T>);
23
24
  showFields?: string[];
@@ -28,9 +29,10 @@ declare const _default: <T extends Record<string, any>>(__VLS_props: NonNullable
28
29
  row: Record<string, any>;
29
30
  field: import('..').Field<T>;
30
31
  }) => any>>;
31
- emit: (((evt: "select", args_0: T) => void) & ((evt: "update:selectedItems", args_0: string[]) => void) & ((evt: "orderBy", args_0: string) => void)) & {
32
+ emit: (((evt: "select", args_0: T) => void) & ((evt: "update:selectedItems", args_0: string[]) => void) & ((evt: "orderBy", args_0: `${string} ASC` | `${string} DESC`) => void)) & {
32
33
  'update:loading': [loading: boolean];
33
34
  'update:itemHeight': [itemHeight: number];
35
+ 'update:selectedItems': [selectedItems: T[]];
34
36
  };
35
37
  }>) => import('vue').VNode<import('vue').RendererNode, import('vue').RendererElement, {
36
38
  [key: string]: any;
@@ -1 +1 @@
1
- {"version":3,"file":"TableSchema.vue.d.ts","sourceRoot":"","sources":["../../src/components/TableSchema.vue"],"names":[],"mappings":"AA8gBA,OAAO,EAEN,KAAK,cAAc,EAKnB,MAAM,eAAe,CAAA;AAItB,MAAM,MAAM,eAAe,GAAG,KAAK,GAAG,MAAM,CAAA;yBAE3B,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;WA+XxD,mBAAmB,CAAC;;;;;;;;;;;;;;;;wBA3Xb,MAAM,EAAE;cAClB,CAAC,EAAE;iBACA,cAAc,CAAC,CAAC,CAAC,GAAG,CAAC,MAAM,cAAc,CAAC,CAAC,CAAC,CAAC;qBACzC,MAAM,EAAE;MAwXiE,CAAC,4BAA2B;oBAChG,OAAO,KAAK,EAAE,gBAAgB,CAAC,EAAE,CAAC,GAAG,IAAI;WAClD,GAAG;;;;UAjDuE,GAAG;UAmD9E;0BA9MS,CAAC,OAAO,SAAiC,CAAC;6BACvC,CAAC,UAAU,QAAoC,CAAC;KA6M1B;;;;YAGC,OAAO,CAAC,OAAO,WAAW,CAAC;;AAzYvE,wBAyY4E;AAC5E,KAAK,mBAAmB,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAG,GAAG,EAAE,CAAC"}
1
+ {"version":3,"file":"TableSchema.vue.d.ts","sourceRoot":"","sources":["../../src/components/TableSchema.vue"],"names":[],"mappings":"AAuhBA,OAAO,EAEN,KAAK,cAAc,EAKnB,MAAM,eAAe,CAAA;AAItB,MAAM,MAAM,eAAe,GAAG,KAAK,GAAG,MAAM,CAAA;AAC5C,MAAM,MAAM,UAAU,GAAG,GAAG,MAAM,IAAI,eAAe,EAAE,CAAA;yBAGtC,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;WAyYxD,mBAAmB,CAAC;;;;;;;;;;;;;;;wBA9MZ,CAAC,EAAE;;cAvLd,CAAC,EAAE;iBACA,cAAc,CAAC,CAAC,CAAC,GAAG,CAAC,MAAM,cAAc,CAAC,CAAC,CAAC,CAAC;qBACzC,MAAM,EAAE;MAmYiE,CAAC,4BAA2B;oBAChG,OAAO,KAAK,EAAE,gBAAgB,CAAC,EAAE,CAAC,GAAG,IAAI;WAClD,GAAG;;;;UAjDuE,GAAG;UAmD9E;0BA/MS,CAAC,OAAO,SAAiC,CAAC;6BACvC,CAAC,UAAU,QAAoC,CAAC;gCAC7C,CAAC,aAAa,EAAC,CAAC,EAAE,CAAC;KA6MA;;;;YAGC,OAAO,CAAC,OAAO,WAAW,CAAC;;AAnZvE,wBAmZ4E;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":"TextInput.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/form/inputs/TextInput.vue"],"names":[],"mappings":"AA4NA,OAAO,EAEN,KAAK,aAAa,EAElB,MAAM,eAAe,CAAA;;SAMf,MAAM;YACH,MAAM;eACH,MAAM;kBACH,MAAM;iBACP,MAAM,GAAG,MAAM;YACpB,MAAM;YACN,OAAO;YACP,OAAO;eACJ,OAAO;cACR,MAAM;aACP,OAAO;eACL,OAAO;WACX,MAAM;uBACM,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;WAC/B,aAAa;gBACR,aAAa;gBACb,OAAO;iBACN,OAAO;WACb,OAAO;YACN,MAAM;mBACC,aAAa;gBAChB,OAAO;oBACH,MAAM;iBACT,CAAC,CAAC,EAAE,UAAU,KAAK,IAAI;;;;;SAvB/B,MAAM;YACH,MAAM;eACH,MAAM;kBACH,MAAM;iBACP,MAAM,GAAG,MAAM;YACpB,MAAM;YACN,OAAO;YACP,OAAO;eACJ,OAAO;cACR,MAAM;aACP,OAAO;eACL,OAAO;WACX,MAAM;uBACM,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;WAC/B,aAAa;gBACR,aAAa;gBACb,OAAO;iBACN,OAAO;WACb,OAAO;YACN,MAAM;mBACC,aAAa;gBAChB,OAAO;oBACH,MAAM;iBACT,CAAC,CAAC,EAAE,UAAU,KAAK,IAAI;;;;;UAX7B,MAAM;gBARA,MAAM,GAAG,MAAM;mBAkBZ,MAAM;;AA4KxB,wBAQG"}
1
+ {"version":3,"file":"TextInput.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/form/inputs/TextInput.vue"],"names":[],"mappings":"AA+NA,OAAO,EAEN,KAAK,aAAa,EAElB,MAAM,eAAe,CAAA;;SAMf,MAAM;YACH,MAAM;eACH,MAAM;kBACH,MAAM;iBACP,MAAM,GAAG,MAAM;YACpB,MAAM;YACN,OAAO;YACP,OAAO;eACJ,OAAO;cACR,MAAM;aACP,OAAO;eACL,OAAO;WACX,MAAM;uBACM,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;WAC/B,aAAa;gBACR,aAAa;gBACb,OAAO;iBACN,OAAO;WACb,OAAO;YACN,MAAM;mBACC,aAAa;gBAChB,OAAO;oBACH,MAAM;iBACT,CAAC,CAAC,EAAE,UAAU,KAAK,IAAI;;;;;SAvB/B,MAAM;YACH,MAAM;eACH,MAAM;kBACH,MAAM;iBACP,MAAM,GAAG,MAAM;YACpB,MAAM;YACN,OAAO;YACP,OAAO;eACJ,OAAO;cACR,MAAM;aACP,OAAO;eACL,OAAO;WACX,MAAM;uBACM,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;WAC/B,aAAa;gBACR,aAAa;gBACb,OAAO;iBACN,OAAO;WACb,OAAO;YACN,MAAM;mBACC,aAAa;gBAChB,OAAO;oBACH,MAAM;iBACT,CAAC,CAAC,EAAE,UAAU,KAAK,IAAI;;;;;UAX7B,MAAM;gBARA,MAAM,GAAG,MAAM;mBAkBZ,MAAM;;AA+KxB,wBAQG"}
package/dist/index.cjs CHANGED
@@ -18535,7 +18535,6 @@ const _sfc_main$A = /* @__PURE__ */ vue.defineComponent({
18535
18535
  const selectedDate = vue.computed({
18536
18536
  get: () => props2.modelValue || /* @__PURE__ */ new Date(),
18537
18537
  set: (value) => {
18538
- console.log(value);
18539
18538
  emit2("update:modelValue", value);
18540
18539
  }
18541
18540
  });
@@ -52111,12 +52110,13 @@ const _sfc_main$n = /* @__PURE__ */ vue.defineComponent({
52111
52110
  if (props2.multiline || props2.code) return 4;
52112
52111
  return 1;
52113
52112
  });
52113
+ const debounceUpdate = debounce(() => {
52114
+ emit2("debounce", inputVal.value);
52115
+ }, props2.debounceDelay);
52114
52116
  function updateInputVal() {
52115
52117
  if (props2.disabled) return;
52116
52118
  emit2("update:modelValue", inputVal.value);
52117
- debounce(() => {
52118
- emit2("debounce", inputVal.value);
52119
- }, props2.debounceDelay);
52119
+ debounceUpdate();
52120
52120
  }
52121
52121
  vue.watch(
52122
52122
  () => props2.modelValue,
@@ -52205,7 +52205,7 @@ const _sfc_main$n = /* @__PURE__ */ vue.defineComponent({
52205
52205
  };
52206
52206
  }
52207
52207
  });
52208
- const TextInput = /* @__PURE__ */ _export_sfc(_sfc_main$n, [["__scopeId", "data-v-0694f3d2"]]);
52208
+ const TextInput = /* @__PURE__ */ _export_sfc(_sfc_main$n, [["__scopeId", "data-v-739e3acb"]]);
52209
52209
  const _hoisted_1$g = ["title"];
52210
52210
  const _hoisted_2$8 = ["id", "required"];
52211
52211
  const _hoisted_3$6 = ["for"];
@@ -53553,22 +53553,24 @@ const _hoisted_10$1 = { key: 1 };
53553
53553
  const _sfc_main$4 = /* @__PURE__ */ vue.defineComponent({
53554
53554
  __name: "TableSchema",
53555
53555
  props: /* @__PURE__ */ vue.mergeModels({
53556
- selectedItems: {},
53557
53556
  data: {},
53558
- schema: { type: Function },
53557
+ schema: {},
53559
53558
  showFields: {}
53560
53559
  }, {
53561
53560
  "loading": { default: false },
53562
53561
  "loadingModifiers": {},
53563
53562
  "itemHeight": { default: 50 },
53564
- "itemHeightModifiers": {}
53563
+ "itemHeightModifiers": {},
53564
+ "selectedItems": {
53565
+ default: () => []
53566
+ },
53567
+ "selectedItemsModifiers": {}
53565
53568
  }),
53566
- emits: /* @__PURE__ */ vue.mergeModels(["update:selectedItems", "orderBy", "select"], ["update:loading", "update:itemHeight"]),
53569
+ emits: /* @__PURE__ */ vue.mergeModels(["update:selectedItems", "orderBy", "select"], ["update:loading", "update:itemHeight", "update:selectedItems"]),
53567
53570
  setup(__props, { emit: __emit }) {
53568
53571
  vue.useCssVars((_ctx) => ({
53569
- "a1a9687c": vue.unref(computedItemHiehgt)
53572
+ "2d5cc186": vue.unref(computedItemHiehgt)
53570
53573
  }));
53571
- const props2 = __props;
53572
53574
  const emit2 = __emit;
53573
53575
  const slots = vue.useSlots();
53574
53576
  const loading = vue.useModel(__props, "loading");
@@ -53576,13 +53578,22 @@ const _sfc_main$4 = /* @__PURE__ */ vue.defineComponent({
53576
53578
  const computedItemHiehgt = vue.computed(() => `${itemHeight.value}px`);
53577
53579
  let sortField = vue.ref("");
53578
53580
  let sortDirection = vue.ref("ASC");
53579
- let selectedItems = vue.ref(props2.selectedItems || []);
53580
- const isSelectable = vue.computed(() => Array.isArray(props2.selectedItems));
53581
+ const selectedItems = vue.useModel(
53582
+ __props,
53583
+ "selectedItems",
53584
+ {
53585
+ set: (value) => {
53586
+ setTimeout(updateAllSelectorState, 0);
53587
+ return value;
53588
+ }
53589
+ }
53590
+ );
53591
+ const isSelectable = vue.computed(() => Array.isArray(selectedItems.value));
53581
53592
  const computedSortField = vue.computed(() => `_transformed_${sortField.value}`);
53582
53593
  const computedSchema = vue.computed(() => useBglSchema({
53583
- schema: props2.schema,
53584
- showFields: props2.showFields,
53585
- data: props2.data
53594
+ schema: __props.schema,
53595
+ showFields: __props.showFields,
53596
+ data: __props.data
53586
53597
  }));
53587
53598
  function transform(rowData) {
53588
53599
  var _a2;
@@ -53599,7 +53610,7 @@ const _sfc_main$4 = /* @__PURE__ */ vue.defineComponent({
53599
53610
  return obj;
53600
53611
  }
53601
53612
  const computedData = vue.computed(() => {
53602
- const dta = [...props2.data].map(transform);
53613
+ const dta = __props.data.map(transform);
53603
53614
  if (sortField.value) {
53604
53615
  return dta.sort((a2, b2) => {
53605
53616
  let aValue = a2[computedSortField.value] ?? a2[sortField.value] ?? "";
@@ -53649,14 +53660,7 @@ const _sfc_main$4 = /* @__PURE__ */ vue.defineComponent({
53649
53660
  }
53650
53661
  );
53651
53662
  const allSelector = vue.ref(null);
53652
- let computedSelectedItems = vue.computed({
53653
- get: () => selectedItems.value,
53654
- set: (value) => {
53655
- selectedItems.value = value;
53656
- emit2("update:selectedItems", value);
53657
- updateAllSelectorState();
53658
- }
53659
- });
53663
+ const computedSelectedItems = vue.computed(() => selectedItems.value);
53660
53664
  function updateAllSelectorState() {
53661
53665
  if (!allSelector.value) return;
53662
53666
  const allSelected = computedData.value.length === computedSelectedItems.value.length && computedData.value.every((s2) => computedSelectedItems.value.includes(s2.id));
@@ -53681,7 +53685,7 @@ const _sfc_main$4 = /* @__PURE__ */ vue.defineComponent({
53681
53685
  }
53682
53686
  function toggleSelectAll(event) {
53683
53687
  const value = event.target.checked;
53684
- computedSelectedItems.value = value ? computedData.value.map((d2) => d2.id) : [];
53688
+ selectedItems.value = value ? computedData.value.map((d2) => d2.id) : [];
53685
53689
  }
53686
53690
  return (_ctx, _cache) => {
53687
53691
  return vue.openBlock(), vue.createElementBlock("div", vue.mergeProps({ class: "table-list-wrap h-100" }, vue.unref(containerProps), {
@@ -53735,11 +53739,11 @@ const _sfc_main$4 = /* @__PURE__ */ vue.defineComponent({
53735
53739
  }, ["stop"]))
53736
53740
  }, [
53737
53741
  vue.withDirectives(vue.createElementVNode("input", {
53738
- "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => vue.isRef(computedSelectedItems) ? computedSelectedItems.value = $event : computedSelectedItems = $event),
53742
+ "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => selectedItems.value = $event),
53739
53743
  type: "checkbox",
53740
53744
  value: row.id
53741
53745
  }, null, 8, _hoisted_9$1), [
53742
- [vue.vModelCheckbox, vue.unref(computedSelectedItems)]
53746
+ [vue.vModelCheckbox, selectedItems.value]
53743
53747
  ])
53744
53748
  ])
53745
53749
  ])) : vue.createCommentVNode("", true),
@@ -53771,7 +53775,7 @@ const _sfc_main$4 = /* @__PURE__ */ vue.defineComponent({
53771
53775
  };
53772
53776
  }
53773
53777
  });
53774
- const TableSchema = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__scopeId", "data-v-c8a90ada"]]);
53778
+ const TableSchema = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__scopeId", "data-v-d8e9a217"]]);
53775
53779
  const _sfc_main$3 = /* @__PURE__ */ vue.defineComponent({
53776
53780
  __name: "Title",
53777
53781
  props: {
package/dist/index.mjs CHANGED
@@ -18533,7 +18533,6 @@ const _sfc_main$A = /* @__PURE__ */ defineComponent({
18533
18533
  const selectedDate = computed({
18534
18534
  get: () => props2.modelValue || /* @__PURE__ */ new Date(),
18535
18535
  set: (value) => {
18536
- console.log(value);
18537
18536
  emit2("update:modelValue", value);
18538
18537
  }
18539
18538
  });
@@ -52109,12 +52108,13 @@ const _sfc_main$n = /* @__PURE__ */ defineComponent({
52109
52108
  if (props2.multiline || props2.code) return 4;
52110
52109
  return 1;
52111
52110
  });
52111
+ const debounceUpdate = debounce(() => {
52112
+ emit2("debounce", inputVal.value);
52113
+ }, props2.debounceDelay);
52112
52114
  function updateInputVal() {
52113
52115
  if (props2.disabled) return;
52114
52116
  emit2("update:modelValue", inputVal.value);
52115
- debounce(() => {
52116
- emit2("debounce", inputVal.value);
52117
- }, props2.debounceDelay);
52117
+ debounceUpdate();
52118
52118
  }
52119
52119
  watch(
52120
52120
  () => props2.modelValue,
@@ -52203,7 +52203,7 @@ const _sfc_main$n = /* @__PURE__ */ defineComponent({
52203
52203
  };
52204
52204
  }
52205
52205
  });
52206
- const TextInput = /* @__PURE__ */ _export_sfc(_sfc_main$n, [["__scopeId", "data-v-0694f3d2"]]);
52206
+ const TextInput = /* @__PURE__ */ _export_sfc(_sfc_main$n, [["__scopeId", "data-v-739e3acb"]]);
52207
52207
  const _hoisted_1$g = ["title"];
52208
52208
  const _hoisted_2$8 = ["id", "required"];
52209
52209
  const _hoisted_3$6 = ["for"];
@@ -53551,22 +53551,24 @@ const _hoisted_10$1 = { key: 1 };
53551
53551
  const _sfc_main$4 = /* @__PURE__ */ defineComponent({
53552
53552
  __name: "TableSchema",
53553
53553
  props: /* @__PURE__ */ mergeModels({
53554
- selectedItems: {},
53555
53554
  data: {},
53556
- schema: { type: Function },
53555
+ schema: {},
53557
53556
  showFields: {}
53558
53557
  }, {
53559
53558
  "loading": { default: false },
53560
53559
  "loadingModifiers": {},
53561
53560
  "itemHeight": { default: 50 },
53562
- "itemHeightModifiers": {}
53561
+ "itemHeightModifiers": {},
53562
+ "selectedItems": {
53563
+ default: () => []
53564
+ },
53565
+ "selectedItemsModifiers": {}
53563
53566
  }),
53564
- emits: /* @__PURE__ */ mergeModels(["update:selectedItems", "orderBy", "select"], ["update:loading", "update:itemHeight"]),
53567
+ emits: /* @__PURE__ */ mergeModels(["update:selectedItems", "orderBy", "select"], ["update:loading", "update:itemHeight", "update:selectedItems"]),
53565
53568
  setup(__props, { emit: __emit }) {
53566
53569
  useCssVars((_ctx) => ({
53567
- "a1a9687c": unref(computedItemHiehgt)
53570
+ "2d5cc186": unref(computedItemHiehgt)
53568
53571
  }));
53569
- const props2 = __props;
53570
53572
  const emit2 = __emit;
53571
53573
  const slots = useSlots();
53572
53574
  const loading = useModel(__props, "loading");
@@ -53574,13 +53576,22 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
53574
53576
  const computedItemHiehgt = computed(() => `${itemHeight.value}px`);
53575
53577
  let sortField = ref("");
53576
53578
  let sortDirection = ref("ASC");
53577
- let selectedItems = ref(props2.selectedItems || []);
53578
- const isSelectable = computed(() => Array.isArray(props2.selectedItems));
53579
+ const selectedItems = useModel(
53580
+ __props,
53581
+ "selectedItems",
53582
+ {
53583
+ set: (value) => {
53584
+ setTimeout(updateAllSelectorState, 0);
53585
+ return value;
53586
+ }
53587
+ }
53588
+ );
53589
+ const isSelectable = computed(() => Array.isArray(selectedItems.value));
53579
53590
  const computedSortField = computed(() => `_transformed_${sortField.value}`);
53580
53591
  const computedSchema = computed(() => useBglSchema({
53581
- schema: props2.schema,
53582
- showFields: props2.showFields,
53583
- data: props2.data
53592
+ schema: __props.schema,
53593
+ showFields: __props.showFields,
53594
+ data: __props.data
53584
53595
  }));
53585
53596
  function transform(rowData) {
53586
53597
  var _a2;
@@ -53597,7 +53608,7 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
53597
53608
  return obj;
53598
53609
  }
53599
53610
  const computedData = computed(() => {
53600
- const dta = [...props2.data].map(transform);
53611
+ const dta = __props.data.map(transform);
53601
53612
  if (sortField.value) {
53602
53613
  return dta.sort((a2, b2) => {
53603
53614
  let aValue = a2[computedSortField.value] ?? a2[sortField.value] ?? "";
@@ -53647,14 +53658,7 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
53647
53658
  }
53648
53659
  );
53649
53660
  const allSelector = ref(null);
53650
- let computedSelectedItems = computed({
53651
- get: () => selectedItems.value,
53652
- set: (value) => {
53653
- selectedItems.value = value;
53654
- emit2("update:selectedItems", value);
53655
- updateAllSelectorState();
53656
- }
53657
- });
53661
+ const computedSelectedItems = computed(() => selectedItems.value);
53658
53662
  function updateAllSelectorState() {
53659
53663
  if (!allSelector.value) return;
53660
53664
  const allSelected = computedData.value.length === computedSelectedItems.value.length && computedData.value.every((s2) => computedSelectedItems.value.includes(s2.id));
@@ -53679,7 +53683,7 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
53679
53683
  }
53680
53684
  function toggleSelectAll(event) {
53681
53685
  const value = event.target.checked;
53682
- computedSelectedItems.value = value ? computedData.value.map((d2) => d2.id) : [];
53686
+ selectedItems.value = value ? computedData.value.map((d2) => d2.id) : [];
53683
53687
  }
53684
53688
  return (_ctx, _cache) => {
53685
53689
  return openBlock(), createElementBlock("div", mergeProps({ class: "table-list-wrap h-100" }, unref(containerProps), {
@@ -53733,11 +53737,11 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
53733
53737
  }, ["stop"]))
53734
53738
  }, [
53735
53739
  withDirectives(createElementVNode("input", {
53736
- "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => isRef(computedSelectedItems) ? computedSelectedItems.value = $event : computedSelectedItems = $event),
53740
+ "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => selectedItems.value = $event),
53737
53741
  type: "checkbox",
53738
53742
  value: row.id
53739
53743
  }, null, 8, _hoisted_9$1), [
53740
- [vModelCheckbox, unref(computedSelectedItems)]
53744
+ [vModelCheckbox, selectedItems.value]
53741
53745
  ])
53742
53746
  ])
53743
53747
  ])) : createCommentVNode("", true),
@@ -53769,7 +53773,7 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
53769
53773
  };
53770
53774
  }
53771
53775
  });
53772
- const TableSchema = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__scopeId", "data-v-c8a90ada"]]);
53776
+ const TableSchema = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__scopeId", "data-v-d8e9a217"]]);
53773
53777
  const _sfc_main$3 = /* @__PURE__ */ defineComponent({
53774
53778
  __name: "Title",
53775
53779
  props: {
package/dist/style.css CHANGED
@@ -1510,61 +1510,61 @@ p {
1510
1510
  font-size: var(--label-font-size);
1511
1511
  }
1512
1512
 
1513
- .bagel-input textarea[data-v-0694f3d2] {
1513
+ .bagel-input textarea[data-v-739e3acb] {
1514
1514
  min-height: unset;
1515
1515
  font-size: var(--input-font-size);
1516
1516
  }
1517
- .bagel-input.text-input textarea[data-v-0694f3d2] {
1517
+ .bagel-input.text-input textarea[data-v-739e3acb] {
1518
1518
  resize: none;
1519
1519
  }
1520
- .code textarea[data-v-0694f3d2] {
1520
+ .code textarea[data-v-739e3acb] {
1521
1521
  font-family: 'Inconsolata', monospace;
1522
1522
  background: var(--bgl-code-bg) !important;
1523
1523
  color: var(--bgl-light-text) !important;
1524
1524
  }
1525
- .code textarea[data-v-0694f3d2]::placeholder {
1525
+ .code textarea[data-v-739e3acb]::placeholder {
1526
1526
  color: var(--bgl-light-text) !important;
1527
1527
  opacity: 0.3;
1528
1528
  }
1529
- .bagel-input.small[data-v-0694f3d2] {
1529
+ .bagel-input.small[data-v-739e3acb] {
1530
1530
  margin-bottom: 0;
1531
1531
  height: 30px;
1532
1532
  }
1533
- .bagel-input.dense label[data-v-0694f3d2] {
1533
+ .bagel-input.dense label[data-v-739e3acb] {
1534
1534
  display: flex;
1535
1535
  align-items: center;
1536
1536
  gap: 0.5rem;
1537
1537
  }
1538
- .bagel-input input[data-v-0694f3d2]:disabled {
1538
+ .bagel-input input[data-v-739e3acb]:disabled {
1539
1539
  background: #f5f5f5;
1540
1540
  }
1541
- .bagel-input label[data-v-0694f3d2] {
1541
+ .bagel-input label[data-v-739e3acb] {
1542
1542
  font-size: var(--label-font-size);
1543
1543
  }
1544
- .textInputIconWrap .bgl_icon-font[data-v-0694f3d2] {
1544
+ .textInputIconWrap .bgl_icon-font[data-v-739e3acb] {
1545
1545
  color: var(--bgl-gray);
1546
1546
  position: absolute;
1547
1547
  bottom: 0px;
1548
1548
  inset-inline-end: 0.25rem;
1549
1549
  margin-block: calc(var(--input-height) / 2 - 16px);
1550
1550
  }
1551
- .textInputIconWrap input[data-v-0694f3d2]{
1551
+ .textInputIconWrap input[data-v-739e3acb]{
1552
1552
  padding-inline-end: 2rem;
1553
1553
  }
1554
- .txtInputIconStart .iconStart[data-v-0694f3d2] {
1554
+ .txtInputIconStart .iconStart[data-v-739e3acb] {
1555
1555
  color: var(--bgl-gray);
1556
1556
  position: absolute;
1557
1557
  bottom: 0px;
1558
1558
  inset-inline-start: 0.25rem;
1559
1559
  margin-block: calc(var(--input-height) / 2 - 16px);
1560
1560
  }
1561
- .txtInputIconStart input[data-v-0694f3d2]{
1561
+ .txtInputIconStart input[data-v-739e3acb]{
1562
1562
  padding-inline-start: 2rem;
1563
1563
  }
1564
- .txtInputIconStart textarea[data-v-0694f3d2] {
1564
+ .txtInputIconStart textarea[data-v-739e3acb] {
1565
1565
  padding-inline-start: 2rem;
1566
1566
  }
1567
- .bagel-input.small textarea[data-v-0694f3d2] {
1567
+ .bagel-input.small textarea[data-v-739e3acb] {
1568
1568
  height: 30px;
1569
1569
  }
1570
1570
 
@@ -3064,22 +3064,22 @@ svg.leaflet-image-layer.leaflet-interactive path {
3064
3064
  }
3065
3065
  }
3066
3066
 
3067
- .table-list-wrap[data-v-c8a90ada] {
3067
+ .table-list-wrap[data-v-d8e9a217] {
3068
3068
  min-height: 150px;
3069
3069
  }
3070
- .selected[data-v-c8a90ada] {
3070
+ .selected[data-v-d8e9a217] {
3071
3071
  background: var(--bgl-primary-tint);
3072
3072
  }
3073
- tbody tr.selected[data-v-c8a90ada]:hover {
3073
+ tbody tr.selected[data-v-d8e9a217]:hover {
3074
3074
  background: var(--bgl-primary-light);
3075
3075
  }
3076
- .loading-table[data-v-c8a90ada] {
3076
+ .loading-table[data-v-d8e9a217] {
3077
3077
  position: relative;
3078
3078
  }
3079
- .inset[data-v-c8a90ada] {
3079
+ .inset[data-v-d8e9a217] {
3080
3080
  inset: 0;
3081
3081
  }
3082
- .loading-table-animation[data-v-c8a90ada] {
3082
+ .loading-table-animation[data-v-d8e9a217] {
3083
3083
  --size: 60px;
3084
3084
  top: 30vh;
3085
3085
  inset-inline-start: calc(50% - var(--size));
@@ -3087,9 +3087,9 @@ tbody tr.selected[data-v-c8a90ada]:hover {
3087
3087
  border-top: 4px solid var(--bgl-primary);
3088
3088
  width: var(--size);
3089
3089
  height: var(--size);
3090
- animation: loading-table-c8a90ada 1s linear infinite;
3090
+ animation: loading-table-d8e9a217 1s linear infinite;
3091
3091
  }
3092
- @keyframes loading-table-c8a90ada {
3092
+ @keyframes loading-table-d8e9a217 {
3093
3093
  0% {
3094
3094
  transform: translate(-50%, -50%) rotate(0deg);
3095
3095
  }
@@ -3097,52 +3097,52 @@ tbody tr.selected[data-v-c8a90ada]:hover {
3097
3097
  transform: translate(-50%, -50%) rotate(360deg);
3098
3098
  }
3099
3099
  }
3100
- .list-arrows[data-v-c8a90ada] {
3100
+ .list-arrows[data-v-d8e9a217] {
3101
3101
  opacity: 0;
3102
3102
  }
3103
- .list-arrows .bgl_icon-font[data-v-c8a90ada] {
3103
+ .list-arrows .bgl_icon-font[data-v-d8e9a217] {
3104
3104
  transition: all ease-in-out 0.2s;
3105
3105
  }
3106
- .list-arrows.sorted[data-v-c8a90ada] {
3106
+ .list-arrows.sorted[data-v-d8e9a217] {
3107
3107
  opacity: 1;
3108
3108
  }
3109
- .col img[data-v-c8a90ada] {
3109
+ .col img[data-v-d8e9a217] {
3110
3110
  height: 35px;
3111
3111
  margin-top: -14px;
3112
3112
  margin-bottom: -14px;
3113
3113
  border-radius: 5px;
3114
3114
  }
3115
- .list-arrows.sorted .desc[data-v-c8a90ada] {
3115
+ .list-arrows.sorted .desc[data-v-d8e9a217] {
3116
3116
  transform: rotate(180deg);
3117
3117
  display: inline-block;
3118
3118
  }
3119
- table[data-v-c8a90ada] {
3119
+ table[data-v-d8e9a217] {
3120
3120
  border-collapse: separate;
3121
3121
  border-spacing: 0 15px;
3122
3122
  border-collapse: collapse;
3123
3123
  width: 100%;
3124
3124
  }
3125
- th[data-v-c8a90ada] {
3125
+ th[data-v-d8e9a217] {
3126
3126
  font-size: 0.8rem;
3127
3127
  color: var(--bgl-black-tint);
3128
3128
  position: sticky;
3129
3129
  top: 0;
3130
3130
  z-index: 2;
3131
3131
  background: var(--bgl-box-bg);
3132
- height: var(--a1a9687c);
3132
+ height: var(--2d5cc186);
3133
3133
  vertical-align: bottom;
3134
3134
  font-weight: 400;
3135
3135
  text-align: start;
3136
3136
  }
3137
- .embedded-field[data-v-c8a90ada] {
3137
+ .embedded-field[data-v-d8e9a217] {
3138
3138
  margin-bottom: -0.2rem;
3139
3139
  margin-top: -0.2rem;
3140
3140
  }
3141
- .row[data-v-c8a90ada] {
3141
+ .row[data-v-d8e9a217] {
3142
3142
  border-bottom: 1px solid var(--border-color);
3143
3143
  cursor: pointer;
3144
3144
  }
3145
- .row.first-row[data-v-c8a90ada] {
3145
+ .row.first-row[data-v-d8e9a217] {
3146
3146
  font-size: 0.8rem;
3147
3147
  color: var(--bgl-black-tint);
3148
3148
  position: sticky;
@@ -3151,7 +3151,7 @@ th[data-v-c8a90ada] {
3151
3151
  background: var(--bgl-box-bg);
3152
3152
  vertical-align: bottom;
3153
3153
  }
3154
- .row.first-row[data-v-c8a90ada]::after {
3154
+ .row.first-row[data-v-d8e9a217]::after {
3155
3155
  content: '';
3156
3156
  border-bottom: 1px solid var(--border-color);
3157
3157
  position: absolute;
@@ -3159,30 +3159,30 @@ th[data-v-c8a90ada] {
3159
3159
  right: 0;
3160
3160
  bottom: -1px;
3161
3161
  }
3162
- .first-row .col[data-v-c8a90ada] {
3162
+ .first-row .col[data-v-d8e9a217] {
3163
3163
  cursor: pointer;
3164
3164
  background: var(--bgl-box-bg);
3165
3165
  }
3166
- .col[data-v-c8a90ada] {
3166
+ .col[data-v-d8e9a217] {
3167
3167
  white-space: nowrap;
3168
3168
  padding: 0.75rem 1rem;
3169
3169
  transition: var(--bgl-transition);
3170
3170
  line-height: 1;
3171
3171
  align-items: center;
3172
3172
  }
3173
- .col[data-v-c8a90ada]:has(.bagel-input) {
3173
+ .col[data-v-d8e9a217]:has(.bagel-input) {
3174
3174
  padding: 0rem 0.25rem;
3175
3175
  }
3176
- .col > div[data-v-c8a90ada] {
3176
+ .col > div[data-v-d8e9a217] {
3177
3177
  display: flex;
3178
3178
  gap: 0.5rem;
3179
3179
  }
3180
- .max-col-width[data-v-c8a90ada] {
3180
+ .max-col-width[data-v-d8e9a217] {
3181
3181
  max-width: 30vw;
3182
3182
  overflow: hidden;
3183
3183
  text-overflow: ellipsis;
3184
3184
  }
3185
- .col.check .bgl_icon-font[data-v-c8a90ada] {
3185
+ .col.check .bgl_icon-font[data-v-d8e9a217] {
3186
3186
  border-radius: 100%;
3187
3187
  background: var(--bgl-blue-20);
3188
3188
  color: var(--bgl-primary);
@@ -3193,35 +3193,35 @@ th[data-v-c8a90ada] {
3193
3193
  justify-content: center;
3194
3194
  margin-top: -2px;
3195
3195
  }
3196
- .rows[data-v-c8a90ada] {
3196
+ .rows[data-v-d8e9a217] {
3197
3197
  font-size: 0.88em;
3198
3198
  }
3199
- .table-list[data-v-c8a90ada] {
3199
+ .table-list[data-v-d8e9a217] {
3200
3200
  height: 100%;
3201
3201
  position: relative;
3202
3202
  padding-left: 0 !important;
3203
3203
  padding-right: 0 !important;
3204
3204
  overflow: auto;
3205
3205
  }
3206
- .BagelTable .table-list[data-v-c8a90ada] {
3206
+ .BagelTable .table-list[data-v-d8e9a217] {
3207
3207
  overflow: unset;
3208
3208
  }
3209
- .row-item[data-v-c8a90ada] {
3210
- height: var(--a1a9687c);
3209
+ .row-item[data-v-d8e9a217] {
3210
+ height: var(--2d5cc186);
3211
3211
  transition: all 200ms ease;
3212
3212
  }
3213
- .row-item[data-v-c8a90ada]:hover {
3213
+ .row-item[data-v-d8e9a217]:hover {
3214
3214
  background: var(--bgl-gray-light);
3215
3215
  }
3216
- .row-item input[type='checkbox'][data-v-c8a90ada] {
3216
+ .row-item input[type='checkbox'][data-v-d8e9a217] {
3217
3217
  margin-top: 0.45rem !important;
3218
3218
  accent-color: var(--bgl-accent-color);
3219
3219
  }
3220
- .infinite-wrapper[data-v-c8a90ada] {
3220
+ .infinite-wrapper[data-v-d8e9a217] {
3221
3221
  overflow-y: auto;
3222
3222
  width: 100%;
3223
3223
  }
3224
- input[type='checkbox'][data-v-c8a90ada] {
3224
+ input[type='checkbox'][data-v-d8e9a217] {
3225
3225
  margin-top: 0.3rem !important;
3226
3226
  accent-color: var(--bgl-accent-color);
3227
3227
  transform: scale(1.2);
@@ -3233,7 +3233,7 @@ input[type='checkbox'][data-v-c8a90ada] {
3233
3233
  height: 0.85rem;
3234
3234
  width: 0.85rem;
3235
3235
  }
3236
- input[type='checkbox'][data-v-c8a90ada]::before {
3236
+ input[type='checkbox'][data-v-d8e9a217]::before {
3237
3237
  content: '';
3238
3238
  height: 0.85rem;
3239
3239
  width: 0.85rem;
@@ -3246,18 +3246,18 @@ input[type='checkbox'][data-v-c8a90ada]::before {
3246
3246
  transform: scale(1);
3247
3247
  position: absolute;
3248
3248
  }
3249
- input[type='checkbox'][data-v-c8a90ada]:hover::before {
3249
+ input[type='checkbox'][data-v-d8e9a217]:hover::before {
3250
3250
  opacity: 0.2;
3251
3251
  transform: scale(2);
3252
3252
  }
3253
- [lang='he'] [dir='ltr'][data-v-c8a90ada] {
3253
+ [lang='he'] [dir='ltr'][data-v-d8e9a217] {
3254
3254
  text-align: right;
3255
3255
  }
3256
- th input[type='checkbox'][data-v-c8a90ada] {
3256
+ th input[type='checkbox'][data-v-d8e9a217] {
3257
3257
  transform: translateY(0.2rem) scale(1.2);
3258
3258
  accent-color: var(--bgl-accent-color);
3259
3259
  }
3260
- th[data-v-c8a90ada]::after {
3260
+ th[data-v-d8e9a217]::after {
3261
3261
  content: '';
3262
3262
  border-bottom: 1px solid var(--border-color);
3263
3263
  position: absolute;
@@ -3265,24 +3265,24 @@ th[data-v-c8a90ada]::after {
3265
3265
  right: 0;
3266
3266
  bottom: -1px;
3267
3267
  }
3268
- tr[data-v-c8a90ada] {
3268
+ tr[data-v-d8e9a217] {
3269
3269
  border-bottom: 1px solid var(--border-color);
3270
3270
  cursor: pointer;
3271
3271
  align-items: center;
3272
3272
  }
3273
- td[data-v-c8a90ada],
3274
- th[data-v-c8a90ada] {
3273
+ td[data-v-d8e9a217],
3274
+ th[data-v-d8e9a217] {
3275
3275
  white-space: nowrap;
3276
3276
  padding: 0.75rem 0.65rem;
3277
3277
  transition: var(--bgl-transition);
3278
3278
  line-height: 1;
3279
3279
  }
3280
- tbody tr[data-v-c8a90ada] {
3280
+ tbody tr[data-v-d8e9a217] {
3281
3281
  font-size: 0.88em;
3282
- height: var(--a1a9687c);
3282
+ height: var(--2d5cc186);
3283
3283
  transition: all 200ms ease;
3284
3284
  }
3285
- tbody tr[data-v-c8a90ada]:hover {
3285
+ tbody tr[data-v-d8e9a217]:hover {
3286
3286
  background: var(--bgl-gray-light);
3287
3287
  }
3288
3288
 
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AAE/D,wBAAgB,QAAQ,CAAC,CAAC,SAAS,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,IAAI,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,GAAG,CAAC,GAAG,IAAI,EAAE,UAAU,CAAC,CAAC,CAAC,KAAK,IAAI,CAYpH;AAED,wBAAgB,UAAU,CAAC,GAAG,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAK3D;AAED,wBAAsB,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,iBAGtE;AAED,wBAAgB,QAAQ,CAAC,GAAG,MAAM,EAAE,MAAM,EAAE,UAG3C;AAED,wBAAgB,SAAS,CAAC,KAAK,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,IAAI,QAIrE;AAED,wBAAgB,QAAQ,CAAC,QAAQ,CAAC,EAAE,GAAG,EAAE,GAAG,CAAC,EAAE,GAAG,EAAE,GAAG,OAAO,EAAE,GAAG,EAAE,UAKpE;AAED,wBAAgB,SAAS,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,KAAK,CAAC,EAAE,UAAU,EAAE,QAAQ,CAAC,EAAE,GAAG,EAAE,GAAG,CAAC,EAAE,CAAC,OAU7F;AAED,wBAAgB,KAAK,CAAC,KAAK,EAAE,GAAG,EAAE,QAAQ,EAAE,GAAG,OAM9C;AAED,wBAAgB,SAAS,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,OAAO,CAAC,EAAE,MAAM,OAGzE;AAED,eAAO,MAAM,MAAM,eAAgB,GAAG,YAA0C,CAAA;AAEhF,OAAO,KAAK,cAAc,MAAM,kBAAkB,CAAA;AAElD,OAAO,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAA;AAEhC,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AAExC,wBAAgB,iBAAiB,CAAC,CAAC,EAAE,IAAI,CAAC,EAAE,GAAG,EAAE,EAAE,UAAU,CAAC,EAAE,MAAM,EAAE,GAAG,cAAc,CAAC,CAAC,CAAC,CAa3F;AAED,eAAO,MAAM,KAAK,QAAQ,MAAM,qBAA0D,CAAA;AAE1F,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAYvD"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AAE/D,wBAAgB,QAAQ,CAAC,CAAC,SAAS,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,IAAI,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,GAAG,CAAC,GAAG,IAAI,EAAE,UAAU,CAAC,CAAC,CAAC,KAAK,IAAI,CAapH;AAED,wBAAgB,UAAU,CAAC,GAAG,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAK3D;AAED,wBAAsB,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,iBAGtE;AAED,wBAAgB,QAAQ,CAAC,GAAG,MAAM,EAAE,MAAM,EAAE,UAG3C;AAED,wBAAgB,SAAS,CAAC,KAAK,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,IAAI,QAIrE;AAED,wBAAgB,QAAQ,CAAC,QAAQ,CAAC,EAAE,GAAG,EAAE,GAAG,CAAC,EAAE,GAAG,EAAE,GAAG,OAAO,EAAE,GAAG,EAAE,UAKpE;AAED,wBAAgB,SAAS,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,KAAK,CAAC,EAAE,UAAU,EAAE,QAAQ,CAAC,EAAE,GAAG,EAAE,GAAG,CAAC,EAAE,CAAC,OAU7F;AAED,wBAAgB,KAAK,CAAC,KAAK,EAAE,GAAG,EAAE,QAAQ,EAAE,GAAG,OAM9C;AAED,wBAAgB,SAAS,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,OAAO,CAAC,EAAE,MAAM,OAGzE;AAED,eAAO,MAAM,MAAM,eAAgB,GAAG,YAA0C,CAAA;AAEhF,OAAO,KAAK,cAAc,MAAM,kBAAkB,CAAA;AAElD,OAAO,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAA;AAEhC,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AAExC,wBAAgB,iBAAiB,CAAC,CAAC,EAAE,IAAI,CAAC,EAAE,GAAG,EAAE,EAAE,UAAU,CAAC,EAAE,MAAM,EAAE,GAAG,cAAc,CAAC,CAAC,CAAC,CAa3F;AAED,eAAO,MAAM,KAAK,QAAQ,MAAM,qBAA0D,CAAA;AAE1F,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAYvD"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@bagelink/vue",
3
3
  "type": "module",
4
- "version": "0.0.765",
4
+ "version": "0.0.769",
5
5
  "description": "Bagel core sdk packages",
6
6
  "author": {
7
7
  "name": "Neveh Allon",
@@ -11,21 +11,25 @@ import { useVirtualList } from '@vueuse/core'
11
11
  import { computed, useSlots, watch } from 'vue'
12
12
 
13
13
  export type SortDirectionsT = 'ASC' | 'DESC'
14
- const props = defineProps<{
15
- selectedItems?: string[]
14
+ export type EmitOrderT = `${string} ${SortDirectionsT}`
15
+
16
+ const {
17
+ data,
18
+ schema,
19
+ showFields,
20
+ // useServerSort = false
21
+ } = defineProps<{
16
22
  data: T[]
17
23
  schema?: BglFormSchemaT<T> | (() => BglFormSchemaT<T>)
18
24
  showFields?: string[]
25
+ // useServerSort?: boolean
19
26
  }>()
20
27
 
21
28
  const emit = defineEmits<{
22
29
  'update:selectedItems': [string[]]
23
- // 'orderBy': [`${string} ${SortDirectionsT}`]
24
- 'orderBy': [string]
30
+ 'orderBy': [EmitOrderT]
25
31
  'select': [T]
26
- }>(
27
- // ['update:selectedItems', 'orderBy', 'select']
28
- )
32
+ }>()
29
33
 
30
34
  const slots = useSlots()
31
35
  const loading = defineModel('loading', { default: false })
@@ -35,16 +39,26 @@ const computedItemHiehgt = $computed(() => `${itemHeight.value}px`)
35
39
 
36
40
  let sortField = $ref('')
37
41
  let sortDirection = $ref<SortDirectionsT>('ASC')
38
- let selectedItems = $ref<string[]>(props.selectedItems || [])
39
42
 
40
- const isSelectable = $computed(() => Array.isArray(props.selectedItems))
43
+ const selectedItems = defineModel<T[]>(
44
+ 'selectedItems',
45
+ {
46
+ default: () => [] as T[],
47
+ set: (value: T[]) => {
48
+ setTimeout(updateAllSelectorState, 0)
49
+ return value
50
+ },
51
+ }
52
+ )
53
+
54
+ const isSelectable = $computed(() => Array.isArray(selectedItems.value))
41
55
 
42
56
  const computedSortField = $computed(() => `_transformed_${sortField}`)
43
57
 
44
58
  const computedSchema = $computed(() => useBglSchema<T>({
45
- schema: props.schema,
46
- showFields: props.showFields,
47
- data: props.data,
59
+ schema,
60
+ showFields,
61
+ data,
48
62
  }))
49
63
 
50
64
  function transform(rowData: any) {
@@ -65,7 +79,8 @@ function transform(rowData: any) {
65
79
  }
66
80
 
67
81
  const computedData = computed(() => {
68
- const dta = [...props.data].map(transform)
82
+ // const dta = [...data].map(transform)
83
+ const dta = data.map(transform)
69
84
  if (sortField as string) {
70
85
  return dta.sort((a, b) => {
71
86
  let aValue = a[computedSortField] ?? a[sortField] ?? ''
@@ -105,7 +120,8 @@ function sort(fieldname: string) {
105
120
  sortField = fieldname
106
121
  sortDirection = 'ASC'
107
122
  }
108
- emit('orderBy', `${fieldname} ${sortDirection}`.trim())
123
+
124
+ emit('orderBy', `${fieldname} ${sortDirection}`.trim() as EmitOrderT)
109
125
  }
110
126
 
111
127
  // #region ? VIRTUAL LIST
@@ -128,14 +144,7 @@ watch(
128
144
 
129
145
  // #region ? SELECT COLUMN
130
146
  const allSelector = $ref<HTMLInputElement | null>(null)
131
- let computedSelectedItems = $computed({
132
- get: () => selectedItems,
133
- set: (value: string[]) => {
134
- selectedItems = value
135
- emit('update:selectedItems', value)
136
- updateAllSelectorState()
137
- },
138
- })
147
+ const computedSelectedItems = $computed(() => selectedItems.value)
139
148
 
140
149
  function updateAllSelectorState() {
141
150
  if (!allSelector) return
@@ -166,7 +175,7 @@ function toggleSelectItem(item: Record<string, any>) {
166
175
 
167
176
  function toggleSelectAll(event: Event) {
168
177
  const value = (event.target as HTMLInputElement).checked
169
- computedSelectedItems = value ? computedData.value.map((d: any) => d.id) : []
178
+ selectedItems.value = value ? computedData.value.map((d: any) => d.id) : []
170
179
  }
171
180
  // #endregion ? SELECT COLUMN
172
181
  </script>
@@ -225,7 +234,7 @@ function toggleSelectAll(event: Event) {
225
234
  <td v-if="isSelectable">
226
235
  <div @click.stop>
227
236
  <input
228
- v-model="computedSelectedItems"
237
+ v-model="selectedItems"
229
238
  type="checkbox"
230
239
  :value="row.id"
231
240
  >
@@ -17,7 +17,7 @@ const emit = defineEmits(['update:modelValue'])
17
17
  const selectedDate = $computed({
18
18
  get: () => props.modelValue || new Date(),
19
19
  set: (value: Date) => {
20
- console.log(value)
20
+ // console.log(value)
21
21
  emit('update:modelValue', value)
22
22
  },
23
23
  })
@@ -51,10 +51,13 @@ const rows = $computed(() => {
51
51
  return 1
52
52
  })
53
53
 
54
+ const debounceUpdate = debounce(() => { emit('debounce', inputVal) }, props.debounceDelay)
54
55
  function updateInputVal() {
55
56
  if (props.disabled) return
57
+
56
58
  emit('update:modelValue', inputVal as string)
57
- debounce(() => { emit('debounce', inputVal) }, props.debounceDelay)
59
+
60
+ debounceUpdate()
58
61
  }
59
62
 
60
63
  watch(
@@ -3,6 +3,7 @@ import type { Attributes, BglFormSchemaT } from '@bagelink/vue'
3
3
  export function debounce<T extends (...args: any[]) => void>(func: T, wait: number): (...args: Parameters<T>) => void {
4
4
  let timeoutId: ReturnType<typeof setTimeout> | undefined
5
5
 
6
+
6
7
  return function (...args: Parameters<T>) {
7
8
  if (timeoutId) {
8
9
  clearTimeout(timeoutId)