@bagelink/vue 0.0.233-beta.0 → 0.0.234-beta.0

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,12 +1,12 @@
1
1
  import { type BglFormSchemaT } from '..';
2
2
  declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__VLS_TypePropsToRuntimeProps<{
3
3
  data: any[];
4
- schema: BglFormSchemaT;
4
+ schema: BglFormSchemaT | (() => BglFormSchemaT);
5
5
  }>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
6
6
  select: (...args: any[]) => void;
7
7
  }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
8
8
  data: any[];
9
- schema: BglFormSchemaT;
9
+ schema: BglFormSchemaT | (() => BglFormSchemaT);
10
10
  }>>> & {
11
11
  onSelect?: ((...args: any[]) => any) | undefined;
12
12
  }, {}, {}>, Partial<Record<string, (_: {
@@ -1 +1 @@
1
- {"version":3,"file":"TableSchema.vue.d.ts","sourceRoot":"","sources":["../../src/components/TableSchema.vue"],"names":[],"mappings":"AAoEA;AAGA,OAAO,EACN,KAAK,cAAc,EAMnB,MAAM,eAAe,CAAC;;;;;;;;;;;;;;;AAoTvB,wBAAwG;AACxG,KAAK,sBAAsB,CAAC,CAAC,IAAI,CAAC,SAAS,SAAS,GAAG,KAAK,GAAG,CAAC,CAAC;AACjE,KAAK,6BAA6B,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,GAAG,EAAE,SAAS,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;KAAE,GAAG;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAAC,QAAQ,EAAE,IAAI,CAAA;KAAE;CAAE,CAAC;AAC9M,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":"AAoEA;AAGA,OAAO,EACN,KAAK,cAAc,EAMnB,MAAM,eAAe,CAAC;;;;;;;;;;;;;;;AA4TvB,wBAAwG;AACxG,KAAK,sBAAsB,CAAC,CAAC,IAAI,CAAC,SAAS,SAAS,GAAG,KAAK,GAAG,CAAC,CAAC;AACjE,KAAK,6BAA6B,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,GAAG,EAAE,SAAS,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;KAAE,GAAG;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAAC,QAAQ,EAAE,IAAI,CAAA;KAAE;CAAE,CAAC;AAC9M,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAAE,QAAO;QAClD,MAAM,EAAE,CAAC,CAAC;KACT,CAAA;CAAE,CAAC"}
package/dist/index.cjs CHANGED
@@ -15385,12 +15385,19 @@ const _sfc_main$q = /* @__PURE__ */ vue.defineComponent({
15385
15385
  __name: "TableSchema",
15386
15386
  props: {
15387
15387
  data: {},
15388
- schema: {}
15388
+ schema: { type: Function }
15389
15389
  },
15390
15390
  emits: ["select"],
15391
15391
  setup(__props, { emit: __emit }) {
15392
15392
  const slots = vue.useSlots();
15393
15393
  const loading = vue.ref(true);
15394
+ const props2 = __props;
15395
+ const computedSchema = vue.computed(() => {
15396
+ if (typeof props2.schema === "function") {
15397
+ return props2.schema();
15398
+ }
15399
+ return props2.schema;
15400
+ });
15394
15401
  const emit2 = __emit;
15395
15402
  const selectElement = (data2) => emit2("select", data2);
15396
15403
  let sortDirection = vue.ref("");
@@ -15410,7 +15417,7 @@ const _sfc_main$q = /* @__PURE__ */ vue.defineComponent({
15410
15417
  return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$x, [
15411
15418
  vue.createElementVNode("table", _hoisted_2$r, [
15412
15419
  vue.createElementVNode("thead", _hoisted_3$m, [
15413
- (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(_ctx.schema, (field) => {
15420
+ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(computedSchema.value, (field) => {
15414
15421
  return vue.openBlock(), vue.createElementBlock("th", {
15415
15422
  class: "col",
15416
15423
  key: field.id,
@@ -15440,7 +15447,7 @@ const _sfc_main$q = /* @__PURE__ */ vue.defineComponent({
15440
15447
  class: "row row-item position-relative",
15441
15448
  key: row.id
15442
15449
  }, [
15443
- (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(_ctx.schema, (field) => {
15450
+ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(computedSchema.value, (field) => {
15444
15451
  var _a2, _b;
15445
15452
  return vue.openBlock(), vue.createElementBlock("td", {
15446
15453
  class: "col",
@@ -15479,7 +15486,7 @@ const _sfc_main$q = /* @__PURE__ */ vue.defineComponent({
15479
15486
  };
15480
15487
  }
15481
15488
  });
15482
- const TableSchema = /* @__PURE__ */ _export_sfc(_sfc_main$q, [["__scopeId", "data-v-31691460"]]);
15489
+ const TableSchema = /* @__PURE__ */ _export_sfc(_sfc_main$q, [["__scopeId", "data-v-a167604a"]]);
15483
15490
  const _sfc_main$p = {};
15484
15491
  const _hoisted_1$w = { class: "flex space-between" };
15485
15492
  function _sfc_render$1(_ctx, _cache) {
package/dist/index.mjs CHANGED
@@ -15383,12 +15383,19 @@ const _sfc_main$q = /* @__PURE__ */ defineComponent({
15383
15383
  __name: "TableSchema",
15384
15384
  props: {
15385
15385
  data: {},
15386
- schema: {}
15386
+ schema: { type: Function }
15387
15387
  },
15388
15388
  emits: ["select"],
15389
15389
  setup(__props, { emit: __emit }) {
15390
15390
  const slots = useSlots();
15391
15391
  const loading = ref(true);
15392
+ const props2 = __props;
15393
+ const computedSchema = computed(() => {
15394
+ if (typeof props2.schema === "function") {
15395
+ return props2.schema();
15396
+ }
15397
+ return props2.schema;
15398
+ });
15392
15399
  const emit2 = __emit;
15393
15400
  const selectElement = (data2) => emit2("select", data2);
15394
15401
  let sortDirection = ref("");
@@ -15408,7 +15415,7 @@ const _sfc_main$q = /* @__PURE__ */ defineComponent({
15408
15415
  return openBlock(), createElementBlock("div", _hoisted_1$x, [
15409
15416
  createElementVNode("table", _hoisted_2$r, [
15410
15417
  createElementVNode("thead", _hoisted_3$m, [
15411
- (openBlock(true), createElementBlock(Fragment$1, null, renderList(_ctx.schema, (field) => {
15418
+ (openBlock(true), createElementBlock(Fragment$1, null, renderList(computedSchema.value, (field) => {
15412
15419
  return openBlock(), createElementBlock("th", {
15413
15420
  class: "col",
15414
15421
  key: field.id,
@@ -15438,7 +15445,7 @@ const _sfc_main$q = /* @__PURE__ */ defineComponent({
15438
15445
  class: "row row-item position-relative",
15439
15446
  key: row.id
15440
15447
  }, [
15441
- (openBlock(true), createElementBlock(Fragment$1, null, renderList(_ctx.schema, (field) => {
15448
+ (openBlock(true), createElementBlock(Fragment$1, null, renderList(computedSchema.value, (field) => {
15442
15449
  var _a2, _b;
15443
15450
  return openBlock(), createElementBlock("td", {
15444
15451
  class: "col",
@@ -15477,7 +15484,7 @@ const _sfc_main$q = /* @__PURE__ */ defineComponent({
15477
15484
  };
15478
15485
  }
15479
15486
  });
15480
- const TableSchema = /* @__PURE__ */ _export_sfc(_sfc_main$q, [["__scopeId", "data-v-31691460"]]);
15487
+ const TableSchema = /* @__PURE__ */ _export_sfc(_sfc_main$q, [["__scopeId", "data-v-a167604a"]]);
15481
15488
  const _sfc_main$p = {};
15482
15489
  const _hoisted_1$w = { class: "flex space-between" };
15483
15490
  function _sfc_render$1(_ctx, _cache) {
package/dist/style.css CHANGED
@@ -720,37 +720,37 @@
720
720
  transform: translateY(-2.6rem);
721
721
  }
722
722
 
723
- .list-arrows[data-v-31691460] {
723
+ .list-arrows[data-v-a167604a] {
724
724
  opacity: 0;
725
725
  }
726
- .list-arrows .icon-font[data-v-31691460] {
726
+ .list-arrows .icon-font[data-v-a167604a] {
727
727
  transition: all ease-in-out 0.2s;
728
728
  }
729
- .list-arrows.sorted[data-v-31691460] {
729
+ .list-arrows.sorted[data-v-a167604a] {
730
730
  opacity: 1;
731
731
  }
732
- .col img[data-v-31691460] {
732
+ .col img[data-v-a167604a] {
733
733
  height: 35px;
734
734
  margin-top: -14px;
735
735
  margin-bottom: -14px;
736
736
  border-radius: 5px;
737
737
  }
738
- .list-arrows.sorted .desc[data-v-31691460] {
738
+ .list-arrows.sorted .desc[data-v-a167604a] {
739
739
  transform: rotate(180deg);
740
740
  }
741
- table[data-v-31691460] {
741
+ table[data-v-a167604a] {
742
742
  border-collapse: separate;
743
743
  border-spacing: 0 15px;
744
744
  border-collapse: collapse;
745
745
  }
746
- th[data-v-31691460] {
746
+ th[data-v-a167604a] {
747
747
  font-weight: 400;
748
748
  }
749
- .row[data-v-31691460] {
749
+ .row[data-v-a167604a] {
750
750
  border-bottom: 1px solid var(--border-color);
751
751
  cursor: pointer;
752
752
  }
753
- .row.first-row[data-v-31691460] {
753
+ .row.first-row[data-v-a167604a] {
754
754
  font-size: 0.8rem;
755
755
  color: var(--bgl-black-tint);
756
756
  position: sticky;
@@ -760,7 +760,7 @@ th[data-v-31691460] {
760
760
  height: 50px;
761
761
  vertical-align: bottom;
762
762
  }
763
- .row.first-row[data-v-31691460]::after {
763
+ .row.first-row[data-v-a167604a]::after {
764
764
  content: "";
765
765
  border-bottom: 1px solid var(--border-color);
766
766
  position: absolute;
@@ -768,11 +768,11 @@ th[data-v-31691460] {
768
768
  right: 0;
769
769
  bottom: -1px;
770
770
  }
771
- .first-row .col[data-v-31691460] {
771
+ .first-row .col[data-v-a167604a] {
772
772
  cursor: pointer;
773
773
  background: var(--bgl-white);
774
774
  }
775
- .col[data-v-31691460] {
775
+ .col[data-v-a167604a] {
776
776
  white-space: nowrap;
777
777
  padding: 14px;
778
778
  transition: var(--bgl-transition);
@@ -781,16 +781,16 @@ th[data-v-31691460] {
781
781
  padding-right: 1rem;
782
782
  align-items: center;
783
783
  }
784
- .col>div[data-v-31691460] {
784
+ .col>div[data-v-a167604a] {
785
785
  display: flex;
786
786
  gap: 0.5rem;
787
787
  }
788
- .max-col-width[data-v-31691460] {
788
+ .max-col-width[data-v-a167604a] {
789
789
  max-width: 30vw;
790
790
  overflow: hidden;
791
791
  text-overflow: ellipsis;
792
792
  }
793
- .col.check .icon-font[data-v-31691460] {
793
+ .col.check .icon-font[data-v-a167604a] {
794
794
  border-radius: 100%;
795
795
  background: var(--bgl-blue-20);
796
796
  color: var(--bgl-primary);
@@ -801,27 +801,27 @@ th[data-v-31691460] {
801
801
  justify-content: center;
802
802
  margin-top: -2px;
803
803
  }
804
- .rows[data-v-31691460] {
804
+ .rows[data-v-a167604a] {
805
805
  font-size: 0.8125em;
806
806
  }
807
- .table-list[data-v-31691460] {
807
+ .table-list[data-v-a167604a] {
808
808
  height: 100%;
809
809
  position: relative;
810
810
  padding-left: 0 !important;
811
811
  padding-right: 0 !important;
812
812
  overflow: auto;
813
813
  }
814
- .BagelTable .table-list[data-v-31691460] {
814
+ .BagelTable .table-list[data-v-a167604a] {
815
815
  overflow: unset;
816
816
  }
817
- .row-item[data-v-31691460] {
817
+ .row-item[data-v-a167604a] {
818
818
  height: 50px;
819
819
  transition: all 200ms ease;
820
820
  }
821
- .row-item[data-v-31691460]:hover {
821
+ .row-item[data-v-a167604a]:hover {
822
822
  background: var(--bgl-gray-light);
823
823
  }
824
- .infinite-wrapper[data-v-31691460] {
824
+ .infinite-wrapper[data-v-a167604a] {
825
825
  overflow-y: auto;
826
826
  width: 100%;
827
827
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@bagelink/vue",
3
3
  "type": "module",
4
- "version": "0.0.233-beta.0",
4
+ "version": "0.0.234-beta.0",
5
5
  "description": "Bagel core sdk packages",
6
6
  "author": {
7
7
  "name": "Neveh Allon",
@@ -4,7 +4,7 @@
4
4
  <thead class="row first-row">
5
5
  <th
6
6
  class="col"
7
- v-for="field in schema"
7
+ v-for="field in computedSchema"
8
8
  :key="field.id"
9
9
  @click="sort(field?.id || '')"
10
10
  >
@@ -35,7 +35,7 @@
35
35
  >
36
36
  <td
37
37
  class="col"
38
- v-for="field in schema"
38
+ v-for="field in computedSchema"
39
39
  :key="`${field.id}-${row.id}`"
40
40
  >
41
41
  <slot
@@ -81,11 +81,18 @@ import {
81
81
  const slots = useSlots();
82
82
  const loading = $ref(true);
83
83
 
84
- defineProps<{
84
+ const props = defineProps<{
85
85
  data: any[];
86
- schema: BglFormSchemaT;
86
+ schema: BglFormSchemaT | (() => BglFormSchemaT);
87
87
  }>();
88
88
 
89
+ const computedSchema = $computed(() => {
90
+ if (typeof props.schema === 'function') {
91
+ return props.schema();
92
+ }
93
+ return props.schema;
94
+ });
95
+
89
96
  const emit = defineEmits(['select']);
90
97
 
91
98
  const selectElement = (data: Record<string, any>) => emit('select', data);