@bagelink/vue 0.0.663 → 0.0.667

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,55 +1,35 @@
1
1
  import { BglFormSchemaT } from '..';
2
2
 
3
- declare function __VLS_template(): Partial<Record<string, (_: {
4
- row: Record<string, any>;
5
- field: import('..').Field<Record<string, any>>;
6
- }) => any>>;
7
- declare const __VLS_component: import('vue').DefineComponent<{
8
- loading: import('vue').PropType<any>;
9
- itemHeight: import('vue').PropType<any>;
10
- selectedItems: {
11
- type: import('vue').PropType<string[]>;
12
- };
13
- data: {
14
- type: import('vue').PropType<any[]>;
15
- required: true;
16
- };
17
- schema: {
18
- type: import('vue').PropType<BglFormSchemaT | (() => BglFormSchemaT)>;
19
- };
20
- showFields: {
21
- type: import('vue').PropType<string[]>;
22
- };
23
- }, {}, unknown, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
24
- select: (...args: any[]) => void;
25
- "update:selectedItems": (...args: any[]) => void;
26
- orderBy: (...args: any[]) => void;
27
- }, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
28
- loading: import('vue').PropType<any>;
29
- itemHeight: import('vue').PropType<any>;
30
- selectedItems: {
31
- type: import('vue').PropType<string[]>;
32
- };
33
- data: {
34
- type: import('vue').PropType<any[]>;
35
- required: true;
36
- };
37
- schema: {
38
- type: import('vue').PropType<BglFormSchemaT | (() => BglFormSchemaT)>;
39
- };
40
- showFields: {
41
- type: import('vue').PropType<string[]>;
42
- };
43
- }>> & {
44
- onSelect?: ((...args: any[]) => any) | undefined;
45
- "onUpdate:selectedItems"?: ((...args: any[]) => any) | undefined;
46
- onOrderBy?: ((...args: any[]) => any) | undefined;
47
- }, {}, {}>;
48
- declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, ReturnType<typeof __VLS_template>>;
49
- export default _default;
50
- type __VLS_WithTemplateSlots<T, S> = T & {
51
- new (): {
52
- $slots: S;
53
- };
3
+ export type SortDirectionsT = 'ASC' | 'DESC';
4
+ declare const _default: <T extends Record<string, any>>(__VLS_props: Awaited<typeof __VLS_setup>["props"], __VLS_ctx?: __VLS_Prettify<Pick<Awaited<typeof __VLS_setup>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
5
+ props: __VLS_Prettify<__VLS_OmitKeepDiscriminatedUnion<(Partial<{}> & Omit<{
6
+ onSelect?: ((args_0: T) => any) | undefined;
7
+ "onUpdate:selectedItems"?: ((args_0: string[]) => any) | undefined;
8
+ onOrderBy?: ((args_0: string) => any) | undefined;
9
+ } & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps & Readonly<import('vue').ExtractPropTypes<{}>> & {
10
+ onSelect?: ((args_0: T) => any) | undefined;
11
+ "onUpdate:selectedItems"?: ((args_0: string[]) => any) | undefined;
12
+ onOrderBy?: ((args_0: string) => any) | undefined;
13
+ }, never>) & ({
14
+ selectedItems?: string[];
15
+ data: T[];
16
+ schema?: BglFormSchemaT<T> | (() => BglFormSchemaT<T>);
17
+ showFields?: string[];
18
+ } & {
19
+ loading?: any;
20
+ itemHeight?: any;
21
+ }), keyof import('vue').VNodeProps | keyof import('vue').AllowedComponentProps>> & {} & (import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps);
22
+ expose(exposed: import('vue').ShallowUnwrapRef<{}>): void;
23
+ attrs: any;
24
+ slots: ReturnType<() => Partial<Record<string, (_: {
25
+ row: Record<string, any>;
26
+ field: import('..').Field<T>;
27
+ }) => any>>>;
28
+ emit: ((evt: "select", args_0: T) => void) & ((evt: "update:selectedItems", args_0: string[]) => void) & ((evt: "orderBy", args_0: string) => void);
29
+ }>) => import('vue').VNode<import('vue').RendererNode, import('vue').RendererElement, {
30
+ [key: string]: any;
31
+ }> & {
32
+ __ctx?: Awaited<typeof __VLS_setup>;
54
33
  };
34
+ export default _default;
55
35
  //# sourceMappingURL=TableSchema.vue.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"TableSchema.vue.d.ts","sourceRoot":"","sources":["../../src/components/TableSchema.vue"],"names":[],"mappings":"AAEA,OAAO,EAEN,KAAK,cAAc,EAKnB,MAAM,eAAe,CAAA;AAqKtB,iBAAS,cAAc;;;MAyV+D,GAAG,GAIxF;AAmCD,QAAA,MAAM,eAAe;aAvYV,OAAO,KAAK,EAAE,QAAQ,CAAC,GAAG,CAAC;gBACxB,OAAO,KAAK,EAAE,QAAQ,CAAC,GAAG,CAAC;;;;;;kBAwZ4J,IAAI;;;6DATvK,cAAc;;;;;;;;;;aAhZrC,OAAO,KAAK,EAAE,QAAQ,CAAC,GAAG,CAAC;gBACxB,OAAO,KAAK,EAAE,QAAQ,CAAC,GAAG,CAAC;;;;;;kBAwZ4J,IAAI;;;6DATvK,cAAc;;;;;;;;;UAM9C,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAAvG,wBAAwG;AAGxG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAAE,QAAO;QAClD,MAAM,EAAE,CAAC,CAAC;KACT,CAAA;CAAE,CAAC"}
1
+ {"version":3,"file":"TableSchema.vue.d.ts","sourceRoot":"","sources":["../../src/components/TableSchema.vue"],"names":[],"mappings":"AAEA,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,eACjC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,OAAO,CAAC,cACrC,cAAc,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,OAAO,CAAC,CAAC,iBAC1E,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,CAAC,QAAQ,CAAC;WAgjB1D,cAAc,CAAC,gCAAgC,CAAC;;;;;;;;;wBAZtC,MAAM,EAAE;cAClB,CAAC,EAAE;iBACA,cAAc,CAAC,CAAC,CAAC,GAAG,CAAC,MAAM,cAAc,CAAC,CAAC,CAAC,CAAC;qBACzC,MAAM,EAAE;;kBAEV,GAAG;qBACA,GAAG;MAMuG,6EAAkC,CAAC,6GAAwD;oBACpM,OAAO,KAAK,EAAE,gBAAgB,CAAC,EAAE,CAAC,GAAG,IAAI;WAClD,GAAG;WACH,UAAU;;;UApDqE,GAAG,GAoDjD;;;;;YAII,OAAO,CAAC,OAAO,WAAW,CAAC;;AA1jBvE,wBA0jB2E"}
@@ -1,37 +1,24 @@
1
1
  import { Field } from '../..';
2
2
 
3
- declare const _default: import('vue').DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
4
- field: Field;
5
- modelValue: Record<string, any>;
6
- }>, {
7
- modelValue: () => {};
8
- }>, {}, unknown, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
9
- "update:modelValue": (...args: any[]) => void;
10
- }, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
11
- field: Field;
12
- modelValue: Record<string, any>;
13
- }>, {
14
- modelValue: () => {};
15
- }>>> & {
16
- "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
17
- }, {
18
- modelValue: Record<string, any>;
19
- }, {}>;
20
- export default _default;
21
- type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
22
- type __VLS_TypePropsToRuntimeProps<T> = {
23
- [K in keyof T]-?: {} extends Pick<T, K> ? {
24
- type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
25
- } : {
26
- type: import('vue').PropType<T[K]>;
27
- required: true;
28
- };
29
- };
30
- type __VLS_WithDefaults<P, D> = {
31
- [K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
32
- default: D[K];
33
- }> : P[K];
3
+ declare const _default: <T extends Record<string, any>>(__VLS_props: Awaited<typeof __VLS_setup>["props"], __VLS_ctx?: __VLS_Prettify<Pick<Awaited<typeof __VLS_setup>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
4
+ props: __VLS_Prettify<__VLS_OmitKeepDiscriminatedUnion<(Partial<{}> & Omit<{
5
+ "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
6
+ } & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps & Readonly<import('vue').ExtractPropTypes<{}>> & {
7
+ "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
8
+ }, never>) & {
9
+ field: Field<T>;
10
+ modelValue: Record<string, any>;
11
+ }, keyof import('vue').VNodeProps | keyof import('vue').AllowedComponentProps>> & {} & (import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps);
12
+ expose(exposed: import('vue').ShallowUnwrapRef<{}>): void;
13
+ attrs: any;
14
+ slots: ReturnType<() => {}>;
15
+ emit: (event: "update:modelValue", ...args: any[]) => void;
16
+ }>) => import('vue').VNode<import('vue').RendererNode, import('vue').RendererElement, {
17
+ [key: string]: any;
18
+ }> & {
19
+ __ctx?: Awaited<typeof __VLS_setup>;
34
20
  };
21
+ export default _default;
35
22
  type __VLS_Prettify<T> = {
36
23
  [K in keyof T]: T[K];
37
24
  } & {};
@@ -1 +1 @@
1
- {"version":3,"file":"BglField.vue.d.ts","sourceRoot":"","sources":["../../../src/components/form/BglField.vue"],"names":[],"mappings":"AAEA,OAAO,EAGN,KAAK,KAAK,EAOV,MAAM,eAAe,CAAA;;WA2Jb,KAAK;gBACA,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;;;;;;WADxB,KAAK;gBACA,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;;;;;;gBAAnB,M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C,OAAO,WAAW,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,OAAO,CAAC,CAAC,iBAC1E,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,CAAC,QAAQ,CAAC;WA4J1D,cAAc,CAAC,gCAAgC,CAAC;;;;;eAP9C,KAAK,CAAC,CAAC,CAAC;oBACH,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;KAMwF,6EAAkC,CAAC,6GAAwD;oBACpM,OAAO,KAAK,EAAE,gBAAgB,CAAC,EAAE,CAAC,GAAG,IAAI;WAClD,GAAG;WACH,UAAU,UAAuB;;;;;YAII,OAAO,CAAC,OAAO,WAAW,CAAC;;AAtKvE,wBAsK2E;AAQ3E,KAAK,cAAc,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAG,GAAG,EAAE,CAAC"}
@@ -1,12 +1,12 @@
1
1
  import { BglFormSchemaFnT, BglFormSchemaT } from '..';
2
2
  import { Ref, UnwrapRef } from 'vue';
3
3
 
4
- interface useBglSchemaParamsT {
5
- schema?: BglFormSchemaFnT;
4
+ interface useBglSchemaParamsT<T> {
5
+ schema?: BglFormSchemaFnT<T>;
6
6
  showFields?: string[];
7
7
  data?: any[];
8
8
  }
9
- export declare function useBglSchema({ schema, showFields, data }?: useBglSchemaParamsT): BglFormSchemaT;
9
+ export declare function useBglSchema<T = Record<string, unknown>>({ schema, showFields, data }?: useBglSchemaParamsT<T>): BglFormSchemaT<T>;
10
10
  export declare function useLocalStorage<T>(key: string, initialValue: T): Ref<UnwrapRef<T>>;
11
11
  export {};
12
12
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/composables/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,gBAAgB,EAAE,KAAK,cAAc,EAAqB,MAAM,eAAe,CAAA;AAC7F,OAAO,KAAK,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,KAAK,CAAA;AAGzC,UAAU,mBAAmB;IAC5B,MAAM,CAAC,EAAE,gBAAgB,CAAA;IACzB,UAAU,CAAC,EAAE,MAAM,EAAE,CAAA;IACrB,IAAI,CAAC,EAAE,GAAG,EAAE,CAAA;CACZ;AAED,wBAAgB,YAAY,CAC3B,EAAE,MAAM,EAAE,UAAU,EAAE,IAAI,EAAE,GAAE,mBAAwB,GACpD,cAAc,CAahB;AAED,wBAAgB,eAAe,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,YAAY,EAAE,CAAC,GAAG,GAAG,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAUlF"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/composables/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,gBAAgB,EAAE,KAAK,cAAc,EAAqB,MAAM,eAAe,CAAA;AAC7F,OAAO,KAAK,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,KAAK,CAAA;AAGzC,UAAU,mBAAmB,CAAC,CAAC;IAC9B,MAAM,CAAC,EAAE,gBAAgB,CAAC,CAAC,CAAC,CAAA;IAC5B,UAAU,CAAC,EAAE,MAAM,EAAE,CAAA;IACrB,IAAI,CAAC,EAAE,GAAG,EAAE,CAAA;CACZ;AAED,wBAAgB,YAAY,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACvD,EAAE,MAAM,EAAE,UAAU,EAAE,IAAI,EAAE,GAAE,mBAAmB,CAAC,CAAC,CAAM,GACvD,cAAc,CAAC,CAAC,CAAC,CAanB;AAED,wBAAgB,eAAe,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,YAAY,EAAE,CAAC,GAAG,GAAG,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAUlF"}
package/dist/index.cjs CHANGED
@@ -6364,7 +6364,7 @@ function useVerticalVirtualList(options, list) {
6364
6364
  containerRef
6365
6365
  };
6366
6366
  }
6367
- const _withScopeId$3 = (n2) => (vue.pushScopeId("data-v-323b7449"), n2 = n2(), vue.popScopeId(), n2);
6367
+ const _withScopeId$3 = (n2) => (vue.pushScopeId("data-v-6653fb41"), n2 = n2(), vue.popScopeId(), n2);
6368
6368
  const _hoisted_1$D = {
6369
6369
  key: 0,
6370
6370
  class: "loading-table-wrapper z-99 h-100 w-100 absolute inset"
@@ -6398,7 +6398,7 @@ const _sfc_main$G = /* @__PURE__ */ vue.defineComponent({
6398
6398
  emits: /* @__PURE__ */ vue.mergeModels(["update:selectedItems", "orderBy", "select"], ["update:loading", "update:itemHeight"]),
6399
6399
  setup(__props, { emit: __emit }) {
6400
6400
  vue.useCssVars((_ctx) => ({
6401
- "867d7c12": vue.unref(computedItemHiehgt)
6401
+ "96a68704": vue.unref(computedItemHiehgt)
6402
6402
  }));
6403
6403
  const props2 = __props;
6404
6404
  const emit2 = __emit;
@@ -6603,7 +6603,7 @@ const _sfc_main$G = /* @__PURE__ */ vue.defineComponent({
6603
6603
  };
6604
6604
  }
6605
6605
  });
6606
- const TableSchema = /* @__PURE__ */ _export_sfc(_sfc_main$G, [["__scopeId", "data-v-323b7449"]]);
6606
+ const TableSchema = /* @__PURE__ */ _export_sfc(_sfc_main$G, [["__scopeId", "data-v-6653fb41"]]);
6607
6607
  const _sfc_main$F = {};
6608
6608
  const _hoisted_1$C = { class: "flex space-between" };
6609
6609
  function _sfc_render$1(_ctx, _cache) {
package/dist/index.mjs CHANGED
@@ -6362,7 +6362,7 @@ function useVerticalVirtualList(options, list) {
6362
6362
  containerRef
6363
6363
  };
6364
6364
  }
6365
- const _withScopeId$3 = (n2) => (pushScopeId("data-v-323b7449"), n2 = n2(), popScopeId(), n2);
6365
+ const _withScopeId$3 = (n2) => (pushScopeId("data-v-6653fb41"), n2 = n2(), popScopeId(), n2);
6366
6366
  const _hoisted_1$D = {
6367
6367
  key: 0,
6368
6368
  class: "loading-table-wrapper z-99 h-100 w-100 absolute inset"
@@ -6396,7 +6396,7 @@ const _sfc_main$G = /* @__PURE__ */ defineComponent({
6396
6396
  emits: /* @__PURE__ */ mergeModels(["update:selectedItems", "orderBy", "select"], ["update:loading", "update:itemHeight"]),
6397
6397
  setup(__props, { emit: __emit }) {
6398
6398
  useCssVars((_ctx) => ({
6399
- "867d7c12": unref(computedItemHiehgt)
6399
+ "96a68704": unref(computedItemHiehgt)
6400
6400
  }));
6401
6401
  const props2 = __props;
6402
6402
  const emit2 = __emit;
@@ -6601,7 +6601,7 @@ const _sfc_main$G = /* @__PURE__ */ defineComponent({
6601
6601
  };
6602
6602
  }
6603
6603
  });
6604
- const TableSchema = /* @__PURE__ */ _export_sfc(_sfc_main$G, [["__scopeId", "data-v-323b7449"]]);
6604
+ const TableSchema = /* @__PURE__ */ _export_sfc(_sfc_main$G, [["__scopeId", "data-v-6653fb41"]]);
6605
6605
  const _sfc_main$F = {};
6606
6606
  const _hoisted_1$C = { class: "flex space-between" };
6607
6607
  function _sfc_render$1(_ctx, _cache) {
package/dist/style.css CHANGED
@@ -647,19 +647,19 @@ a[data-v-26f1062f] {
647
647
  }
648
648
  }
649
649
 
650
- .selected[data-v-323b7449] {
650
+ .selected[data-v-6653fb41] {
651
651
  background: var(--bgl-primary-tint);
652
652
  }
653
- tbody tr.selected[data-v-323b7449]:hover {
653
+ tbody tr.selected[data-v-6653fb41]:hover {
654
654
  background: var(--bgl-primary-light);
655
655
  }
656
- .loading-table[data-v-323b7449] {
656
+ .loading-table[data-v-6653fb41] {
657
657
  position: relative;
658
658
  }
659
- .inset[data-v-323b7449] {
659
+ .inset[data-v-6653fb41] {
660
660
  inset: 0;
661
661
  }
662
- .loading-table-animation[data-v-323b7449] {
662
+ .loading-table-animation[data-v-6653fb41] {
663
663
  --size: 60px;
664
664
  top: 30vh;
665
665
  inset-inline-start: calc(50% - var(--size));
@@ -667,9 +667,9 @@ tbody tr.selected[data-v-323b7449]:hover {
667
667
  border-top: 4px solid var(--bgl-primary);
668
668
  width: var(--size);
669
669
  height: var(--size);
670
- animation: loading-table-323b7449 1s linear infinite;
670
+ animation: loading-table-6653fb41 1s linear infinite;
671
671
  }
672
- @keyframes loading-table-323b7449 {
672
+ @keyframes loading-table-6653fb41 {
673
673
  0% {
674
674
  transform: translate(-50%, -50%) rotate(0deg);
675
675
  }
@@ -677,52 +677,52 @@ tbody tr.selected[data-v-323b7449]:hover {
677
677
  transform: translate(-50%, -50%) rotate(360deg);
678
678
  }
679
679
  }
680
- .list-arrows[data-v-323b7449] {
680
+ .list-arrows[data-v-6653fb41] {
681
681
  opacity: 0;
682
682
  }
683
- .list-arrows .bgl_icon-font[data-v-323b7449] {
683
+ .list-arrows .bgl_icon-font[data-v-6653fb41] {
684
684
  transition: all ease-in-out 0.2s;
685
685
  }
686
- .list-arrows.sorted[data-v-323b7449] {
686
+ .list-arrows.sorted[data-v-6653fb41] {
687
687
  opacity: 1;
688
688
  }
689
- .col img[data-v-323b7449] {
689
+ .col img[data-v-6653fb41] {
690
690
  height: 35px;
691
691
  margin-top: -14px;
692
692
  margin-bottom: -14px;
693
693
  border-radius: 5px;
694
694
  }
695
- .list-arrows.sorted .desc[data-v-323b7449] {
695
+ .list-arrows.sorted .desc[data-v-6653fb41] {
696
696
  transform: rotate(180deg);
697
697
  display: inline-block;
698
698
  }
699
- table[data-v-323b7449] {
699
+ table[data-v-6653fb41] {
700
700
  border-collapse: separate;
701
701
  border-spacing: 0 15px;
702
702
  border-collapse: collapse;
703
703
  width: 100%;
704
704
  }
705
- th[data-v-323b7449] {
705
+ th[data-v-6653fb41] {
706
706
  font-size: 0.8rem;
707
707
  color: var(--bgl-black-tint);
708
708
  position: sticky;
709
709
  top: 0;
710
710
  z-index: 2;
711
711
  background: var(--bgl-white);
712
- height: var(--867d7c12);
712
+ height: var(--96a68704);
713
713
  vertical-align: bottom;
714
714
  font-weight: 400;
715
715
  text-align: start;
716
716
  }
717
- .embedded-field[data-v-323b7449] {
717
+ .embedded-field[data-v-6653fb41] {
718
718
  margin-bottom: -0.2rem;
719
719
  margin-top: -0.2rem;
720
720
  }
721
- .row[data-v-323b7449] {
721
+ .row[data-v-6653fb41] {
722
722
  border-bottom: 1px solid var(--border-color);
723
723
  cursor: pointer;
724
724
  }
725
- .row.first-row[data-v-323b7449] {
725
+ .row.first-row[data-v-6653fb41] {
726
726
  font-size: 0.8rem;
727
727
  color: var(--bgl-black-tint);
728
728
  position: sticky;
@@ -731,7 +731,7 @@ th[data-v-323b7449] {
731
731
  background: var(--bgl-white);
732
732
  vertical-align: bottom;
733
733
  }
734
- .row.first-row[data-v-323b7449]::after {
734
+ .row.first-row[data-v-6653fb41]::after {
735
735
  content: '';
736
736
  border-bottom: 1px solid var(--border-color);
737
737
  position: absolute;
@@ -739,30 +739,30 @@ th[data-v-323b7449] {
739
739
  right: 0;
740
740
  bottom: -1px;
741
741
  }
742
- .first-row .col[data-v-323b7449] {
742
+ .first-row .col[data-v-6653fb41] {
743
743
  cursor: pointer;
744
744
  background: var(--bgl-white);
745
745
  }
746
- .col[data-v-323b7449] {
746
+ .col[data-v-6653fb41] {
747
747
  white-space: nowrap;
748
748
  padding: 0.75rem 1rem;
749
749
  transition: var(--bgl-transition);
750
750
  line-height: 1;
751
751
  align-items: center;
752
752
  }
753
- .col[data-v-323b7449]:has(.bagel-input) {
753
+ .col[data-v-6653fb41]:has(.bagel-input) {
754
754
  padding: 0rem 0.25rem;
755
755
  }
756
- .col > div[data-v-323b7449] {
756
+ .col > div[data-v-6653fb41] {
757
757
  display: flex;
758
758
  gap: 0.5rem;
759
759
  }
760
- .max-col-width[data-v-323b7449] {
760
+ .max-col-width[data-v-6653fb41] {
761
761
  max-width: 30vw;
762
762
  overflow: hidden;
763
763
  text-overflow: ellipsis;
764
764
  }
765
- .col.check .bgl_icon-font[data-v-323b7449] {
765
+ .col.check .bgl_icon-font[data-v-6653fb41] {
766
766
  border-radius: 100%;
767
767
  background: var(--bgl-blue-20);
768
768
  color: var(--bgl-primary);
@@ -773,35 +773,35 @@ th[data-v-323b7449] {
773
773
  justify-content: center;
774
774
  margin-top: -2px;
775
775
  }
776
- .rows[data-v-323b7449] {
776
+ .rows[data-v-6653fb41] {
777
777
  font-size: 0.88em;
778
778
  }
779
- .table-list[data-v-323b7449] {
779
+ .table-list[data-v-6653fb41] {
780
780
  height: 100%;
781
781
  position: relative;
782
782
  padding-left: 0 !important;
783
783
  padding-right: 0 !important;
784
784
  overflow: auto;
785
785
  }
786
- .BagelTable .table-list[data-v-323b7449] {
786
+ .BagelTable .table-list[data-v-6653fb41] {
787
787
  overflow: unset;
788
788
  }
789
- .row-item[data-v-323b7449] {
790
- height: var(--867d7c12);
789
+ .row-item[data-v-6653fb41] {
790
+ height: var(--96a68704);
791
791
  transition: all 200ms ease;
792
792
  }
793
- .row-item[data-v-323b7449]:hover {
793
+ .row-item[data-v-6653fb41]:hover {
794
794
  background: var(--bgl-gray-light);
795
795
  }
796
- .row-item input[type='checkbox'][data-v-323b7449] {
796
+ .row-item input[type='checkbox'][data-v-6653fb41] {
797
797
  margin-top: 0.45rem !important;
798
798
  accent-color: var(--bgl-accent-color);
799
799
  }
800
- .infinite-wrapper[data-v-323b7449] {
800
+ .infinite-wrapper[data-v-6653fb41] {
801
801
  overflow-y: auto;
802
802
  width: 100%;
803
803
  }
804
- input[type='checkbox'][data-v-323b7449] {
804
+ input[type='checkbox'][data-v-6653fb41] {
805
805
  margin-top: 0.3rem !important;
806
806
  accent-color: var(--bgl-accent-color);
807
807
  transform: scale(1.2);
@@ -813,7 +813,7 @@ input[type='checkbox'][data-v-323b7449] {
813
813
  height: 0.85rem;
814
814
  width: 0.85rem;
815
815
  }
816
- input[type='checkbox'][data-v-323b7449]::before {
816
+ input[type='checkbox'][data-v-6653fb41]::before {
817
817
  content: '';
818
818
  height: 0.85rem;
819
819
  width: 0.85rem;
@@ -826,18 +826,18 @@ input[type='checkbox'][data-v-323b7449]::before {
826
826
  transform: scale(1);
827
827
  position: absolute;
828
828
  }
829
- input[type='checkbox'][data-v-323b7449]:hover::before {
829
+ input[type='checkbox'][data-v-6653fb41]:hover::before {
830
830
  opacity: 0.2;
831
831
  transform: scale(2);
832
832
  }
833
- [lang='he'] [dir='ltr'][data-v-323b7449] {
833
+ [lang='he'] [dir='ltr'][data-v-6653fb41] {
834
834
  text-align: right;
835
835
  }
836
- th input[type='checkbox'][data-v-323b7449] {
836
+ th input[type='checkbox'][data-v-6653fb41] {
837
837
  transform: translateY(0.2rem) scale(1.2);
838
838
  accent-color: var(--bgl-accent-color);
839
839
  }
840
- th[data-v-323b7449]::after {
840
+ th[data-v-6653fb41]::after {
841
841
  content: '';
842
842
  border-bottom: 1px solid var(--border-color);
843
843
  position: absolute;
@@ -845,24 +845,24 @@ th[data-v-323b7449]::after {
845
845
  right: 0;
846
846
  bottom: -1px;
847
847
  }
848
- tr[data-v-323b7449] {
848
+ tr[data-v-6653fb41] {
849
849
  border-bottom: 1px solid var(--border-color);
850
850
  cursor: pointer;
851
851
  align-items: center;
852
852
  }
853
- td[data-v-323b7449],
854
- th[data-v-323b7449] {
853
+ td[data-v-6653fb41],
854
+ th[data-v-6653fb41] {
855
855
  white-space: nowrap;
856
856
  padding: 0.75rem 0.65rem;
857
857
  transition: var(--bgl-transition);
858
858
  line-height: 1;
859
859
  }
860
- tbody tr[data-v-323b7449] {
860
+ tbody tr[data-v-6653fb41] {
861
861
  font-size: 0.88em;
862
- height: var(--867d7c12);
862
+ height: var(--96a68704);
863
863
  transition: all 200ms ease;
864
864
  }
865
- tbody tr[data-v-323b7449]:hover {
865
+ tbody tr[data-v-6653fb41]:hover {
866
866
  background: var(--bgl-gray-light);
867
867
  }
868
868
 
@@ -13,5 +13,5 @@ export declare const isDate: (dateToTest: any) => boolean;
13
13
  export { formatString } from './strings';
14
14
  export * as bagelFormUtils from './BagelFormUtils';
15
15
  export { useLang } from './lang';
16
- export declare function getFallbackSchema(data?: any[], showFields?: string[]): BglFormSchemaT;
16
+ export declare function getFallbackSchema<T>(data?: any[], showFields?: string[]): BglF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AAM,MAAM,eAAgB,GAAG,YAA0C,CAAA;AAEhF,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AAExC,OAAO,KAAK,cAAc,MAAM,kBAAkB,CAAA;AAElD,OAAO,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAA;AAEhC,wBAAgB,iBAAiB,CAAC,CAAC,EAAE,IAAI,CAAC,EAAE,GAAG,EAAE,EAAE,UAAU,CAAC,EAAE,MAAM,EAAE,GAAG,cAAc,CAAC,CAAC,CAAC,CAe3F"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@bagelink/vue",
3
3
  "type": "module",
4
- "version": "0.0.663",
4
+ "version": "0.0.667",
5
5
  "description": "Bagel core sdk packages",
6
6
  "author": {
7
7
  "name": "Neveh Allon",
@@ -1,4 +1,4 @@
1
- <script setup lang="ts">
1
+ <script setup lang="ts" generic="T extends Record<string, any>">
2
2
  import {
3
3
  BglField,
4
4
  type BglFormSchemaT,
@@ -10,14 +10,23 @@ import {
10
10
  import { computed, useSlots, watch } from 'vue'
11
11
  import { useVirtualList } from '@vueuse/core'
12
12
 
13
+ export type SortDirectionsT = 'ASC' | 'DESC'
13
14
  const props = defineProps<{
14
15
  selectedItems?: string[]
15
- data: any[]
16
- schema?: BglFormSchemaT | (() => BglFormSchemaT)
16
+ data: T[]
17
+ schema?: BglFormSchemaT<T> | (() => BglFormSchemaT<T>)
17
18
  showFields?: string[]
18
19
  }>()
19
20
 
20
- const emit = defineEmits(['update:selectedItems', 'orderBy', 'select'])
21
+ const emit = defineEmits<{
22
+ 'update:selectedItems': [string[]]
23
+ // 'orderBy': [`${string} ${SortDirectionsT}`]
24
+ 'orderBy': [string]
25
+ 'select': [T]
26
+ }>(
27
+ // ['update:selectedItems', 'orderBy', 'select']
28
+ )
29
+
21
30
  const slots = useSlots()
22
31
  const loading = defineModel('loading', { default: false })
23
32
 
@@ -25,14 +34,14 @@ const itemHeight = defineModel('itemHeight', { default: 50 })
25
34
  const computedItemHiehgt = $computed(() => `${itemHeight.value}px`)
26
35
 
27
36
  let sortField = $ref('')
28
- let sortDirection = $ref('ASC')
37
+ let sortDirection = $ref<SortDirectionsT>('ASC')
29
38
  let selectedItems = $ref<string[]>(props.selectedItems || [])
30
39
 
31
40
  const isSelectable = $computed(() => Array.isArray(props.selectedItems))
32
41
 
33
42
  const computedSortField = $computed(() => `_transformed_${sortField}`)
34
43
 
35
- const computedSchema = $computed(() => useBglSchema({
44
+ const computedSchema = $computed(() => useBglSchema<T>({
36
45
  schema: props.schema,
37
46
  showFields: props.showFields,
38
47
  data: props.data,
@@ -145,7 +154,7 @@ function toggleSelectItem(item: Record<string, any>) {
145
154
  if (key.startsWith('_transformed_')) delete obj[key]
146
155
  })
147
156
 
148
- emit('select', obj)
157
+ emit('select', obj as T)
149
158
  return
150
159
  }
151
160
  const index = computedSelectedItems.indexOf(item.id)
@@ -1,4 +1,4 @@
1
- <script lang="ts" setup>
1
+ <script setup lang="ts" generic="T extends Record<string, any>">
2
2
  import {
3
3
  CheckInput,
4
4
  DateInput,
@@ -13,7 +13,7 @@ import {
13
13
 
14
14
  const props = withDefaults(
15
15
  defineProps<{
16
- field: Field
16
+ field: Field<T>
17
17
  modelValue: Record<string, any>
18
18
  }>(),
19
19
  {
@@ -57,13 +57,13 @@ const vIf = $computed(() => {
57
57
  if (props.field['v-if'] === undefined && props.field.vIf === undefined) return true
58
58
  if (typeof props.field['v-if'] === 'boolean' || typeof props.field.vIf === 'boolean') return props.field['v-if']
59
59
  if (typeof props.field['v-if'] === 'string' || typeof props.field.vIf === 'string') return true
60
- if (typeof props.field['v-if'] === 'function') return props.field['v-if'](fieldData, formData)
61
- if (typeof props.field.vIf === 'function') return props.field.vIf(fieldData, formData)
60
+ if (typeof props.field['v-if'] === 'function') return props.field['v-if'](fieldData, formData as T)
61
+ if (typeof props.field.vIf === 'function') return props.field.vIf(fieldData, formData as T)
62
62
  return true
63
63
  })
64
64
 
65
65
  const computedFieldData = $computed(
66
- () => props.field.transform?.(fieldData, props.modelValue) ?? fieldData
66
+ () => props.field.transform?.(fieldData, props.modelValue as T) ?? fieldData
67
67
  )
68
68
 
69
69
  const computedOptions = $computed(
@@ -94,7 +94,7 @@ const computedClass = $computed(
94
94
  :disabled="field.disabled"
95
95
  :options="computedOptions"
96
96
  :helptext="field.helptext"
97
- @update:modelValue="($event: any) => field?.onUpdate?.($event, formData)"
97
+ @update:modelValue="($event: any) => field?.onUpdate?.($event, formData as T)"
98
98
  >
99
99
  {{ computedFieldData }}
100
100
  <BglField
@@ -2,15 +2,15 @@ import { type BglFormSchemaFnT, type BglFormSchemaT, getFallbackSchema } from '@
2
2
  import type { Ref, UnwrapRef } from 'vue'
3
3
  import { ref, watch } from 'vue'
4
4
 
5
- interface useBglSchemaParamsT {
6
- schema?: BglFormSchemaFnT
5
+ interface useBglSchemaParamsT<T> {
6
+ schema?: BglFormSchemaFnT<T>
7
7
  showFields?: string[]
8
8
  data?: any[]
9
9
  }
10
10
 
11
- export function useBglSchema(
12
- { schema, showFields, data }: useBglSchemaParamsT = {}
13
- ): BglFormSchemaT {
11
+ export function useBglSchema<T = Record<string, unknown>>(
12
+ { schema, showFields, data }: useBglSchemaParamsT<T> = {}
13
+ ): BglFormSchemaT<T> {
14
14
  let _schema = schema
15
15
  if (typeof _schema === 'function') {
16
16
  _schema = _schema()
@@ -20,7 +20,7 @@ export function useBglSchema(
20
20
  showFields && showFields.length
21
21
  ? _schema.filter(f => showFields.includes(f.id as string))
22
22
  : _schema
23
- ) as BglFormSchemaT
23
+ ) as BglFormSchemaT<T>
24
24
  }
25
25
  return getFallbackSchema(data, showFields)
26
26
  }
@@ -69,12 +69,12 @@ export * as bagelFormUtils from './BagelFormUtils'
69
69
 
70
70
  export { useLang } from './lang'
71
71
 
72
- export function getFallbackSchema(data?: any[], showFields?: string[]): BglFormSchemaT {
72
+ export function getFallbackSchema<T>(data?: any[], showFields?: string[]): BglFormSchemaT<T> {
73
73
  const keys = [
74
74
  ...new Set((data ?? []).map(Object.keys).flat()),
75
75
  ] as string[]
76
76
 
77
- const schema: BglFormSchemaT = keys.map(
77
+ const schema: BglFormSchemaT<T> = keys.map(
78
78
  id => ({
79
79
  id,
80
80
  label: keyToLabel(id),