@bagelink/vue 0.0.126 → 0.0.130

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,11 +1,11 @@
1
1
  declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__VLS_TypePropsToRuntimeProps<{
2
2
  data: any[];
3
- schema?: any[] | undefined;
3
+ schema?: (() => any[]) | undefined;
4
4
  }>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
5
5
  select: (...args: any[]) => void;
6
6
  }, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
7
7
  data: any[];
8
- schema?: any[] | undefined;
8
+ schema?: (() => any[]) | undefined;
9
9
  }>>> & {
10
10
  onSelect?: ((...args: any[]) => any) | undefined;
11
11
  }, {}, {}>, Partial<Record<any, (_: {
package/dist/index.cjs CHANGED
@@ -15342,7 +15342,7 @@ const _sfc_main$A = /* @__PURE__ */ vue.defineComponent({
15342
15342
  __name: "TableSchema",
15343
15343
  props: {
15344
15344
  data: {},
15345
- schema: {}
15345
+ schema: { type: Function }
15346
15346
  },
15347
15347
  emits: ["select"],
15348
15348
  setup(__props, { emit: __emit }) {
@@ -15379,10 +15379,13 @@ const _sfc_main$A = /* @__PURE__ */ vue.defineComponent({
15379
15379
  }
15380
15380
  };
15381
15381
  const columns = vue.computed(
15382
- () => props2.schema || Object.keys(props2.data[0]).map((k) => ({
15383
- id: k,
15384
- inputType: "PlainText"
15385
- }))
15382
+ () => {
15383
+ var _a;
15384
+ return ((_a = props2.schema) == null ? void 0 : _a.call(props2)) || Object.keys(props2.data[0]).map((k) => ({
15385
+ id: k,
15386
+ inputType: "PlainText"
15387
+ }));
15388
+ }
15386
15389
  );
15387
15390
  return (_ctx, _cache) => {
15388
15391
  return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$I, [
@@ -15451,7 +15454,7 @@ const _sfc_main$A = /* @__PURE__ */ vue.defineComponent({
15451
15454
  };
15452
15455
  }
15453
15456
  });
15454
- const TableSchema = /* @__PURE__ */ _export_sfc(_sfc_main$A, [["__scopeId", "data-v-5c5ba615"]]);
15457
+ const TableSchema = /* @__PURE__ */ _export_sfc(_sfc_main$A, [["__scopeId", "data-v-ef2c4aa7"]]);
15455
15458
  const _sfc_main$z = {};
15456
15459
  const _hoisted_1$H = { class: "flex space-between" };
15457
15460
  function _sfc_render$1(_ctx, _cache) {
@@ -15495,7 +15498,7 @@ const _sfc_main$x = /* @__PURE__ */ vue.defineComponent({
15495
15498
  setup(__props) {
15496
15499
  const bagel = useBagel();
15497
15500
  const props2 = __props;
15498
- const schema2 = [
15501
+ const schema2 = () => [
15499
15502
  {
15500
15503
  id: "created_at",
15501
15504
  label: "Date",
@@ -17911,7 +17914,7 @@ const _sfc_main$n = /* @__PURE__ */ vue.defineComponent({
17911
17914
  modalForm({
17912
17915
  side: true,
17913
17916
  title: `${first_name} ${last_name}`,
17914
- schema: props2.personSchema,
17917
+ schema: props2.personSchema(),
17915
17918
  modelValue: person.value,
17916
17919
  onSubmit: (newPerson) => bagel.put("/person", newPerson)
17917
17920
  // .then(() => toast.success(i18nT('updatedSuccessfully'))), // TODO: use toast
package/dist/index.mjs CHANGED
@@ -15340,7 +15340,7 @@ const _sfc_main$A = /* @__PURE__ */ defineComponent({
15340
15340
  __name: "TableSchema",
15341
15341
  props: {
15342
15342
  data: {},
15343
- schema: {}
15343
+ schema: { type: Function }
15344
15344
  },
15345
15345
  emits: ["select"],
15346
15346
  setup(__props, { emit: __emit }) {
@@ -15377,10 +15377,13 @@ const _sfc_main$A = /* @__PURE__ */ defineComponent({
15377
15377
  }
15378
15378
  };
15379
15379
  const columns = computed(
15380
- () => props2.schema || Object.keys(props2.data[0]).map((k) => ({
15381
- id: k,
15382
- inputType: "PlainText"
15383
- }))
15380
+ () => {
15381
+ var _a;
15382
+ return ((_a = props2.schema) == null ? void 0 : _a.call(props2)) || Object.keys(props2.data[0]).map((k) => ({
15383
+ id: k,
15384
+ inputType: "PlainText"
15385
+ }));
15386
+ }
15384
15387
  );
15385
15388
  return (_ctx, _cache) => {
15386
15389
  return openBlock(), createElementBlock("div", _hoisted_1$I, [
@@ -15449,7 +15452,7 @@ const _sfc_main$A = /* @__PURE__ */ defineComponent({
15449
15452
  };
15450
15453
  }
15451
15454
  });
15452
- const TableSchema = /* @__PURE__ */ _export_sfc(_sfc_main$A, [["__scopeId", "data-v-5c5ba615"]]);
15455
+ const TableSchema = /* @__PURE__ */ _export_sfc(_sfc_main$A, [["__scopeId", "data-v-ef2c4aa7"]]);
15453
15456
  const _sfc_main$z = {};
15454
15457
  const _hoisted_1$H = { class: "flex space-between" };
15455
15458
  function _sfc_render$1(_ctx, _cache) {
@@ -15493,7 +15496,7 @@ const _sfc_main$x = /* @__PURE__ */ defineComponent({
15493
15496
  setup(__props) {
15494
15497
  const bagel = useBagel();
15495
15498
  const props2 = __props;
15496
- const schema2 = [
15499
+ const schema2 = () => [
15497
15500
  {
15498
15501
  id: "created_at",
15499
15502
  label: "Date",
@@ -17909,7 +17912,7 @@ const _sfc_main$n = /* @__PURE__ */ defineComponent({
17909
17912
  modalForm({
17910
17913
  side: true,
17911
17914
  title: `${first_name} ${last_name}`,
17912
- schema: props2.personSchema,
17915
+ schema: props2.personSchema(),
17913
17916
  modelValue: person.value,
17914
17917
  onSubmit: (newPerson) => bagel.put("/person", newPerson)
17915
17918
  // .then(() => toast.success(i18nT('updatedSuccessfully'))), // TODO: use toast
@@ -1,6 +1,7 @@
1
1
  import { InjectionKey } from 'vue';
2
2
  import type { Plugin } from 'vue';
3
3
  import type { BtnOptions } from '..';
4
+ import type { FormKitSchemaDefinition } from '@formkit/core';
4
5
  interface ModalOptions {
5
6
  title?: string;
6
7
  dismissable?: boolean;
@@ -13,7 +14,7 @@ interface ModalFormOptions extends ModalOptions {
13
14
  'onUpdate:modelValue'?: (val: any) => void;
14
15
  onSubmit: (val: any) => void;
15
16
  onDelete?: (id: string) => void;
16
- schema: any;
17
+ schema: FormKitSchemaDefinition;
17
18
  }
18
19
  interface ModalApi {
19
20
  showModal: (options: ModalOptions, slots?: Record<string, any>) => void;
@@ -1 +1 @@
1
- {"version":3,"file":"modal.d.ts","sourceRoot":"","sources":["../../src/plugins/modal.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,YAAY,EACf,MAAM,KAAK,CAAC;AACb,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,KAAK,CAAC;AAClC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAGhD,UAAU,YAAY;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,OAAO,CAAC,EAAE,UAAU,EAAE,CAAC;IACvB,KAAK,CAAC,EAAE,MAAM,CAAC;CACf;AAED,UAAU,gBAAiB,SAAQ,YAAY;IAC9C,UAAU,CAAC,EAAE,GAAG,CAAC;IAEjB,qBAAqB,CAAC,EAAE,CAAC,GAAG,EAAE,GAAG,KAAK,IAAI,CAAC;IAE3C,QAAQ,EAAE,CAAC,GAAG,EAAE,GAAG,KAAK,IAAI,CAAC;IAE7B,QAAQ,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAChC,MAAM,EAAE,GAAG,CAAC;CACZ;AAED,UAAU,QAAQ;IAEjB,SAAS,EAAE,CAAC,OAAO,EAAE,YAAY,EAAE,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,KAAK,IAAI,CAAC;IAExE,SAAS,EAAE,CAAC,OAAO,EAAE,gBAAgB,EAAE,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,KAAK,IAAI,CAAC;IAE5E,SAAS,EAAE,CAAC,KAAK,CAAC,EAAE,MAAM,KAAK,IAAI,CAA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E,SAAS,EAAE,CAAC,KAAK,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;CAEpC;AAED,eAAO,MAAM,WAAW,EAAE,YAAY,CAAC,QAAQ,CAAmB,CAAC;AAEnE,eAAO,MAAM,QAAQ,QAAO,QAI3B,CAAC;AAQF,eAAO,MAAM,WAAW,EAAE,MAgDzB,CAAC"}
package/dist/style.css CHANGED
@@ -782,37 +782,37 @@
782
782
  transform: translateY(-2.6rem);
783
783
  }
784
784
 
785
- .list-arrows[data-v-5c5ba615] {
785
+ .list-arrows[data-v-ef2c4aa7] {
786
786
  opacity: 0;
787
787
  }
788
- .list-arrows .icon-font[data-v-5c5ba615] {
788
+ .list-arrows .icon-font[data-v-ef2c4aa7] {
789
789
  transition: all ease-in-out 0.2s;
790
790
  }
791
- .list-arrows.sorted[data-v-5c5ba615] {
791
+ .list-arrows.sorted[data-v-ef2c4aa7] {
792
792
  opacity: 1;
793
793
  }
794
- .col img[data-v-5c5ba615] {
794
+ .col img[data-v-ef2c4aa7] {
795
795
  height: 35px;
796
796
  margin-top: -14px;
797
797
  margin-bottom: -14px;
798
798
  border-radius: 5px;
799
799
  }
800
- .list-arrows.sorted .desc[data-v-5c5ba615] {
800
+ .list-arrows.sorted .desc[data-v-ef2c4aa7] {
801
801
  transform: rotate(180deg);
802
802
  }
803
- table[data-v-5c5ba615] {
803
+ table[data-v-ef2c4aa7] {
804
804
  border-collapse: separate;
805
805
  border-spacing: 0 15px;
806
806
  border-collapse: collapse;
807
807
  }
808
- th[data-v-5c5ba615] {
808
+ th[data-v-ef2c4aa7] {
809
809
  font-weight: 400;
810
810
  }
811
- .row[data-v-5c5ba615] {
811
+ .row[data-v-ef2c4aa7] {
812
812
  border-bottom: 1px solid var(--border-color);
813
813
  cursor: pointer;
814
814
  }
815
- .row.first-row[data-v-5c5ba615] {
815
+ .row.first-row[data-v-ef2c4aa7] {
816
816
  font-size: 0.8rem;
817
817
  color: var(--bgl-black-tint);
818
818
  position: sticky;
@@ -822,7 +822,7 @@ th[data-v-5c5ba615] {
822
822
  height: 50px;
823
823
  vertical-align: bottom;
824
824
  }
825
- .row.first-row[data-v-5c5ba615]::after {
825
+ .row.first-row[data-v-ef2c4aa7]::after {
826
826
  content: '';
827
827
  border-bottom: 1px solid var(--border-color);
828
828
  position: absolute;
@@ -830,11 +830,11 @@ th[data-v-5c5ba615] {
830
830
  right: 0;
831
831
  bottom: -1px;
832
832
  }
833
- .first-row .col[data-v-5c5ba615] {
833
+ .first-row .col[data-v-ef2c4aa7] {
834
834
  cursor: pointer;
835
835
  background: var(--bgl-white);
836
836
  }
837
- .col[data-v-5c5ba615] {
837
+ .col[data-v-ef2c4aa7] {
838
838
  white-space: nowrap;
839
839
  padding: 14px;
840
840
  transition: var(--bgl-transition);
@@ -843,16 +843,16 @@ th[data-v-5c5ba615] {
843
843
  padding-right: 1rem;
844
844
  align-items: center;
845
845
  }
846
- .col>div[data-v-5c5ba615] {
846
+ .col>div[data-v-ef2c4aa7] {
847
847
  display: flex;
848
848
  gap: 0.5rem;
849
849
  }
850
- .max-col-width[data-v-5c5ba615] {
850
+ .max-col-width[data-v-ef2c4aa7] {
851
851
  max-width: 30vw;
852
852
  overflow: hidden;
853
853
  text-overflow: ellipsis;
854
854
  }
855
- .col.check .icon-font[data-v-5c5ba615] {
855
+ .col.check .icon-font[data-v-ef2c4aa7] {
856
856
  border-radius: 100%;
857
857
  background: var(--bgl-blue-20);
858
858
  color: var(--bgl-blue);
@@ -863,27 +863,27 @@ th[data-v-5c5ba615] {
863
863
  justify-content: center;
864
864
  margin-top: -2px;
865
865
  }
866
- .rows[data-v-5c5ba615] {
866
+ .rows[data-v-ef2c4aa7] {
867
867
  font-size: 0.8125em;
868
868
  }
869
- .table-list[data-v-5c5ba615] {
869
+ .table-list[data-v-ef2c4aa7] {
870
870
  height: 100%;
871
871
  position: relative;
872
872
  padding-left: 0 !important;
873
873
  padding-right: 0 !important;
874
874
  overflow: auto;
875
875
  }
876
- .BagelTable .table-list[data-v-5c5ba615] {
876
+ .BagelTable .table-list[data-v-ef2c4aa7] {
877
877
  overflow: unset;
878
878
  }
879
- .row-item[data-v-5c5ba615] {
879
+ .row-item[data-v-ef2c4aa7] {
880
880
  height: 50px;
881
881
  transition: all 200ms ease;
882
882
  }
883
- .row-item[data-v-5c5ba615]:hover {
883
+ .row-item[data-v-ef2c4aa7]:hover {
884
884
  background: var(--bgl-gray-light);
885
885
  }
886
- .infinite-wrapper[data-v-5c5ba615] {
886
+ .infinite-wrapper[data-v-ef2c4aa7] {
887
887
  overflow-y: auto;
888
888
  width: 100%;
889
889
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@bagelink/vue",
3
3
  "type": "module",
4
- "version": "0.0.126",
4
+ "version": "0.0.130",
5
5
  "description": "Bagel core sdk packages",
6
6
  "author": {
7
7
  "name": "Neveh Allon",
@@ -21,7 +21,7 @@ const props = defineProps({
21
21
  },
22
22
  });
23
23
 
24
- const schema = [
24
+ const schema = () => [
25
25
  {
26
26
  id: 'created_at',
27
27
  label: 'Date',
@@ -99,7 +99,7 @@ const showEditForm = async () => {
99
99
  modalForm({
100
100
  side: true,
101
101
  title: `${first_name} ${last_name}`,
102
- schema: props.personSchema,
102
+ schema: props.personSchema(),
103
103
  modelValue: person,
104
104
  onSubmit: (newPerson) => bagel.put('/person', newPerson),
105
105
  // .then(() => toast.success(i18nT('updatedSuccessfully'))), // TODO: use toast
@@ -72,7 +72,7 @@ const loading = $ref(true);
72
72
 
73
73
  const props = defineProps<{
74
74
  data: any[];
75
- schema?: any[];
75
+ schema?: () => any[];
76
76
  }>();
77
77
 
78
78
  const emit = defineEmits(['select']);
@@ -110,7 +110,7 @@ const sort = (fieldname: string) => {
110
110
 
111
111
  const columns = $computed(
112
112
  () => (
113
- props.schema ||
113
+ props.schema?.() ||
114
114
  Object.keys(props.data[0]).map((k: string) => ({
115
115
  id: k,
116
116
  inputType: 'PlainText',
@@ -4,6 +4,7 @@ import {
4
4
  import type { Plugin } from 'vue';
5
5
  import type { BtnOptions } from '@bagelink/vue';
6
6
  import { Modal, ModalForm } from '@bagelink/vue';
7
+ import type { FormKitSchemaDefinition } from '@formkit/core';
7
8
 
8
9
  interface ModalOptions {
9
10
  title?: string;
@@ -21,7 +22,7 @@ interface ModalFormOptions extends ModalOptions {
21
22
  onSubmit: (val: any) => void;
22
23
  // eslint-disable-next-line no-unused-vars
23
24
  onDelete?: (id: string) => void;
24
- schema: any;
25
+ schema: FormKitSchemaDefinition;
25
26
  }
26
27
 
27
28
  interface ModalApi {