@bagelink/vue 0.0.182 → 0.0.188

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.
Files changed (113) hide show
  1. package/dist/components/Btn.vue.d.ts +1 -1
  2. package/dist/components/Btn.vue.d.ts.map +1 -1
  3. package/dist/components/Comments.vue.d.ts +1 -1
  4. package/dist/components/Comments.vue.d.ts.map +1 -1
  5. package/dist/components/ContactSubmissions.vue.d.ts +1 -1
  6. package/dist/components/DataPreview.vue.d.ts +1 -1
  7. package/dist/components/DataPreview.vue.d.ts.map +1 -1
  8. package/dist/components/DropDown.vue.d.ts +1 -1
  9. package/dist/components/FormSchema.vue.d.ts +1 -1
  10. package/dist/components/FormSchema.vue.d.ts.map +1 -1
  11. package/dist/components/LangText.vue.d.ts +1 -1
  12. package/dist/components/LangText.vue.d.ts.map +1 -1
  13. package/dist/components/ListItem.vue.d.ts +1 -1
  14. package/dist/components/ListItem.vue.d.ts.map +1 -1
  15. package/dist/components/ListView.vue.d.ts +3 -3
  16. package/dist/components/ListView.vue.d.ts.map +1 -1
  17. package/dist/components/MaterialIcon.vue.d.ts +1 -1
  18. package/dist/components/MaterialIcon.vue.d.ts.map +1 -1
  19. package/dist/components/Modal.vue.d.ts +1 -1
  20. package/dist/components/Modal.vue.d.ts.map +1 -1
  21. package/dist/components/ModalForm.vue.d.ts +1 -1
  22. package/dist/components/ModalForm.vue.d.ts.map +1 -1
  23. package/dist/components/NavBar.vue.d.ts +1 -1
  24. package/dist/components/NavBar.vue.d.ts.map +1 -1
  25. package/dist/components/PageTitle.vue.d.ts +1 -1
  26. package/dist/components/PageTitle.vue.d.ts.map +1 -1
  27. package/dist/components/PersonPreview.vue.d.ts +1 -1
  28. package/dist/components/PersonPreview.vue.d.ts.map +1 -1
  29. package/dist/components/PersonPreviewFormkit.vue.d.ts +1 -1
  30. package/dist/components/PersonPreviewFormkit.vue.d.ts.map +1 -1
  31. package/dist/components/RTXEditor.vue.d.ts +1 -1
  32. package/dist/components/RTXEditor.vue.d.ts.map +1 -1
  33. package/dist/components/RouterWrapper.vue.d.ts +1 -1
  34. package/dist/components/TabbedLayout.vue.d.ts +1 -1
  35. package/dist/components/TabbedLayout.vue.d.ts.map +1 -1
  36. package/dist/components/TableSchema.vue.d.ts +1 -1
  37. package/dist/components/TableSchema.vue.d.ts.map +1 -1
  38. package/dist/components/TopBar.vue.d.ts +1 -1
  39. package/dist/components/TopBar.vue.d.ts.map +1 -1
  40. package/dist/components/charts/BarChart.vue.d.ts +1 -1
  41. package/dist/components/charts/BarChart.vue.d.ts.map +1 -1
  42. package/dist/components/dashboard/Lineart.vue.d.ts +2 -2
  43. package/dist/components/dashboard/Lineart.vue.d.ts.map +1 -1
  44. package/dist/components/form/ItemRef.vue.d.ts +1 -1
  45. package/dist/components/form/ItemRef.vue.d.ts.map +1 -1
  46. package/dist/components/form/MaterialIcon.vue.d.ts +1 -1
  47. package/dist/components/form/MaterialIcon.vue.d.ts.map +1 -1
  48. package/dist/components/form/PlainInputField.vue.d.ts +1 -1
  49. package/dist/components/form/PlainInputField.vue.d.ts.map +1 -1
  50. package/dist/components/form/inputs/CheckInput.vue.d.ts +1 -1
  51. package/dist/components/form/inputs/CheckInput.vue.d.ts.map +1 -1
  52. package/dist/components/form/inputs/Checkbox.vue.d.ts +1 -1
  53. package/dist/components/form/inputs/ColorPicker.vue.d.ts +1 -1
  54. package/dist/components/form/inputs/ColorPicker.vue.d.ts.map +1 -1
  55. package/dist/components/form/inputs/CurrencyInput.vue.d.ts +1 -1
  56. package/dist/components/form/inputs/CurrencyInput.vue.d.ts.map +1 -1
  57. package/dist/components/form/inputs/DateInput.vue.d.ts +1 -1
  58. package/dist/components/form/inputs/DateInput.vue.d.ts.map +1 -1
  59. package/dist/components/form/inputs/DatetimeInput.vue.d.ts +1 -1
  60. package/dist/components/form/inputs/DatetimeInput.vue.d.ts.map +1 -1
  61. package/dist/components/form/inputs/DurationInput.vue.d.ts +1 -1
  62. package/dist/components/form/inputs/DurationInput.vue.d.ts.map +1 -1
  63. package/dist/components/form/inputs/DynamicLinkField.vue.d.ts +1 -1
  64. package/dist/components/form/inputs/DynamicLinkField.vue.d.ts.map +1 -1
  65. package/dist/components/form/inputs/EmailInput.vue.d.ts +1 -1
  66. package/dist/components/form/inputs/EmailInput.vue.d.ts.map +1 -1
  67. package/dist/components/form/inputs/FloatInput.vue.d.ts +1 -1
  68. package/dist/components/form/inputs/FloatInput.vue.d.ts.map +1 -1
  69. package/dist/components/form/inputs/IntInput.vue.d.ts +1 -1
  70. package/dist/components/form/inputs/IntInput.vue.d.ts.map +1 -1
  71. package/dist/components/form/inputs/JSONInput.vue.d.ts +1 -1
  72. package/dist/components/form/inputs/JSONInput.vue.d.ts.map +1 -1
  73. package/dist/components/form/inputs/LinkField.vue.d.ts +1 -1
  74. package/dist/components/form/inputs/LinkField.vue.d.ts.map +1 -1
  75. package/dist/components/form/inputs/Password.vue.d.ts +1 -1
  76. package/dist/components/form/inputs/Password.vue.d.ts.map +1 -1
  77. package/dist/components/form/inputs/PasswordInput.vue.d.ts +1 -1
  78. package/dist/components/form/inputs/PasswordInput.vue.d.ts.map +1 -1
  79. package/dist/components/form/inputs/PlainText.vue.d.ts +1 -1
  80. package/dist/components/form/inputs/PlainText.vue.d.ts.map +1 -1
  81. package/dist/components/form/inputs/ReadOnlyInput.vue.d.ts +1 -1
  82. package/dist/components/form/inputs/ReadOnlyInput.vue.d.ts.map +1 -1
  83. package/dist/components/form/inputs/RichTextEditor.vue.d.ts +1 -1
  84. package/dist/components/form/inputs/RichTextEditor.vue.d.ts.map +1 -1
  85. package/dist/components/form/inputs/SelectField.vue.d.ts +1 -1
  86. package/dist/components/form/inputs/SelectField.vue.d.ts.map +1 -1
  87. package/dist/components/form/inputs/TableField.vue.d.ts +1 -1
  88. package/dist/components/form/inputs/TableField.vue.d.ts.map +1 -1
  89. package/dist/components/form/inputs/TextArea.vue.d.ts +1 -1
  90. package/dist/components/form/inputs/TextArea.vue.d.ts.map +1 -1
  91. package/dist/components/form/inputs/TextInput.vue.d.ts +1 -1
  92. package/dist/components/form/inputs/TextInput.vue.d.ts.map +1 -1
  93. package/dist/components/formkit/AddressArray.vue.d.ts +1 -1
  94. package/dist/components/formkit/AddressArray.vue.d.ts.map +1 -1
  95. package/dist/components/formkit/BankDetailsArray.vue.d.ts +1 -1
  96. package/dist/components/formkit/BankDetailsArray.vue.d.ts.map +1 -1
  97. package/dist/components/formkit/ContactArrayFormKit.vue.d.ts +1 -1
  98. package/dist/components/formkit/ContactArrayFormKit.vue.d.ts.map +1 -1
  99. package/dist/components/formkit/FileUploader.vue.d.ts +1 -1
  100. package/dist/components/formkit/FileUploader.vue.d.ts.map +1 -1
  101. package/dist/components/formkit/MiscFields.vue.d.ts +1 -1
  102. package/dist/components/formkit/MiscFields.vue.d.ts.map +1 -1
  103. package/dist/components/formkit/Toggle.vue.d.ts +1 -1
  104. package/dist/components/whatsapp/form/MsgTemplate.vue.d.ts +1 -1
  105. package/dist/components/whatsapp/form/MsgTemplate.vue.d.ts.map +1 -1
  106. package/dist/components/whatsapp/form/TextVariableExamples.vue.d.ts +1 -1
  107. package/dist/index.cjs +22 -15
  108. package/dist/index.mjs +22 -15
  109. package/dist/style.css +18 -18
  110. package/package.json +15 -16
  111. package/src/components/dashboard/Lineart.vue +136 -115
  112. package/src/components/formkit/FileUploader.vue +9 -7
  113. package/tsconfig.json +0 -30
package/dist/index.mjs CHANGED
@@ -1190,7 +1190,7 @@ function isAbsoluteURL(url) {
1190
1190
  return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(url);
1191
1191
  }
1192
1192
  function combineURLs(baseURL, relativeURL) {
1193
- return relativeURL ? baseURL.replace(/\/+$/, "") + "/" + relativeURL.replace(/^\/+/, "") : baseURL;
1193
+ return relativeURL ? baseURL.replace(/\/?\/$/, "") + "/" + relativeURL.replace(/^\/+/, "") : baseURL;
1194
1194
  }
1195
1195
  function buildFullPath(baseURL, requestedURL) {
1196
1196
  if (baseURL && !isAbsoluteURL(requestedURL)) {
@@ -1614,7 +1614,7 @@ function mergeConfig(config1, config2) {
1614
1614
  });
1615
1615
  return config;
1616
1616
  }
1617
- const VERSION = "1.6.2";
1617
+ const VERSION = "1.6.3";
1618
1618
  const validators$1 = {};
1619
1619
  ["object", "boolean", "number", "function", "string", "symbol"].forEach((type3, i2) => {
1620
1620
  validators$1[type3] = function validator2(thing) {
@@ -2386,7 +2386,7 @@ const _sfc_main$T = /* @__PURE__ */ defineComponent({
2386
2386
  return (_ctx, _cache) => {
2387
2387
  return openBlock(), createElementBlock(Fragment$1, null, [
2388
2388
  createElementVNode("span", _hoisted_1$Z, null, 512),
2389
- createTextVNode(" " + toDisplayString(_ctx.input) + " ", 1)
2389
+ createTextVNode(" " + toDisplayString(_ctx.input), 1)
2390
2390
  ], 64);
2391
2391
  };
2392
2392
  }
@@ -17816,9 +17816,10 @@ const _sfc_main$s = /* @__PURE__ */ defineComponent({
17816
17816
  (_h = (_g = (_f = dropCircle.value) == null ? void 0 : _f.style) == null ? void 0 : _g.setProperty) == null ? void 0 : _h.call(_g, "top", `${top2}px`);
17817
17817
  }
17818
17818
  function emitValue() {
17819
- var _a;
17819
+ var _a, _b, _c;
17820
+ const relationshipKey = (_b = (_a = props2.context) == null ? void 0 : _a.attrs) == null ? void 0 : _b.relationshipKey;
17820
17821
  if (!computedMultiple.value)
17821
- return (_a = props2.context) == null ? void 0 : _a.node.input(files.value[0].serverFile);
17822
+ return (_c = props2.context) == null ? void 0 : _c.node.input(relationshipKey ? files.value[0].serverFile.id : files.value[0].serverFile);
17822
17823
  return alert("not implemented");
17823
17824
  }
17824
17825
  const isImg = (file) => {
@@ -17872,16 +17873,18 @@ const _sfc_main$s = /* @__PURE__ */ defineComponent({
17872
17873
  uploadFiles();
17873
17874
  }
17874
17875
  onMounted(() => {
17875
- var _a, _b, _c, _d, _e, _f, _g;
17876
+ var _a, _b, _c, _d, _e, _f, _g, _h;
17876
17877
  (_a = dropZoneEl.value) == null ? void 0 : _a.addEventListener("dragover", animateCircle);
17877
- if (!computedMultiple.value && ((_b = props2.context) == null ? void 0 : _b.value)) {
17878
+ const relationshipKey = (_c = (_b = props2.context) == null ? void 0 : _b.attrs) == null ? void 0 : _c.relationshipKey;
17879
+ const imageObj = relationshipKey ? (_f = (_e = (_d = props2.context) == null ? void 0 : _d.node) == null ? void 0 : _e.parent) == null ? void 0 : _f.value[relationshipKey] : (_h = (_g = props2.context) == null ? void 0 : _g.node) == null ? void 0 : _h.value;
17880
+ if (!computedMultiple.value && imageObj) {
17878
17881
  files.value.push({
17879
- serverFile: (_c = props2.context) == null ? void 0 : _c.value,
17882
+ serverFile: imageObj,
17880
17883
  uploaded: true,
17881
17884
  uploading: false,
17882
17885
  progress: 100,
17883
- dataUrl: (_e = (_d = props2.context) == null ? void 0 : _d.value) == null ? void 0 : _e.url,
17884
- name: (_g = (_f = props2.context) == null ? void 0 : _f.value) == null ? void 0 : _g.name
17886
+ dataUrl: imageObj == null ? void 0 : imageObj.url,
17887
+ name: imageObj == null ? void 0 : imageObj.name
17885
17888
  });
17886
17889
  }
17887
17890
  });
@@ -28580,9 +28583,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
28580
28583
  },
28581
28584
  setup(__props) {
28582
28585
  const props2 = __props;
28583
- const data2 = computed(
28584
- () => props2.locale === "he" ? [...props2.data].reverse() : props2.data
28585
- );
28586
+ const data2 = computed(() => props2.locale === "he" ? [...props2.data].reverse() : props2.data);
28586
28587
  const meanValue = computed(() => {
28587
28588
  const sum = props2.data.reduce((acc, curr) => acc + +curr.total_value, 0);
28588
28589
  return sum / props2.data.length;
@@ -28609,11 +28610,17 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
28609
28610
  total_value: {
28610
28611
  color: BRAND_COLOR,
28611
28612
  label: "סכום",
28612
- format: (v) => `₪${v.toLocaleString()}`
28613
+ format: (v) => {
28614
+ var _a;
28615
+ return `₪${((_a = v == null ? void 0 : v.toLocaleString) == null ? void 0 : _a.call(v)) || ""}`;
28616
+ }
28613
28617
  },
28614
28618
  total_count: {
28615
28619
  label: "מספר התרומות",
28616
- format: (v) => `${v.toLocaleString()}`
28620
+ format: (v) => {
28621
+ var _a;
28622
+ return `${((_a = v == null ? void 0 : v.toLocaleString) == null ? void 0 : _a.call(v)) || ""}`;
28623
+ }
28617
28624
  }
28618
28625
  };
28619
28626
  let chartSize = ref(null);
package/dist/style.css CHANGED
@@ -2235,37 +2235,37 @@ input[type='email'][data-v-ed81a514] {
2235
2235
  }
2236
2236
 
2237
2237
  .chart-line {
2238
- width: 100%;
2239
- height: 300px;
2238
+ width: 100%;
2239
+ height: 300px;
2240
2240
  }
2241
2241
  [dir="rtl"] .chart-line {
2242
- direction: ltr;
2242
+ direction: ltr;
2243
2243
  }
2244
- .chart-line .v-tooltip-content > div {
2245
- border: none !important;
2246
- border-radius: 6px !important;
2247
- background-color: black !important;
2248
- opacity: 0.7;
2249
- padding: 0.5rem 1rem !important;
2250
- box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06) !important;
2251
- font-weight: 300;
2244
+ .chart-line .v-tooltip-content>div {
2245
+ border: none !important;
2246
+ border-radius: 6px !important;
2247
+ background-color: black !important;
2248
+ opacity: 0.7;
2249
+ padding: 0.5rem 1rem !important;
2250
+ box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06) !important;
2251
+ font-weight: 300;
2252
2252
  }
2253
- .chart-line .v-tooltip-content > div b {
2254
- font-weight: 400;
2253
+ .chart-line .v-tooltip-content>div b {
2254
+ font-weight: 400;
2255
2255
  }
2256
2256
  .layer-grid g:last-child {
2257
- display: none;
2257
+ display: none;
2258
2258
  }
2259
2259
  .layer-axis-x .tick:nth-child(2n + 1) {
2260
- opacity: 0;
2260
+ opacity: 0;
2261
2261
  }
2262
2262
  @media screen and (max-width: 910px) {
2263
2263
  .chart-line {
2264
- height: 140px;
2264
+ height: 140px;
2265
2265
  }
2266
2266
  .layer-axis-x .tick {
2267
- opacity: 0;
2268
- font-size: 0;
2267
+ opacity: 0;
2268
+ font-size: 0;
2269
2269
  }
2270
2270
  }
2271
2271
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@bagelink/vue",
3
3
  "type": "module",
4
- "version": "0.0.182",
4
+ "version": "0.0.188",
5
5
  "description": "Bagel core sdk packages",
6
6
  "author": {
7
7
  "name": "Neveh Allon",
@@ -50,11 +50,10 @@
50
50
  "./tsconfig.json",
51
51
  "./vite.config.ts"
52
52
  ],
53
- "dependencies": {
54
- "vue": "^3.3.11"
55
- },
53
+ "dependencies": {},
56
54
  "devDependencies": {
57
- "@vue-macros/reactivity-transform": "^0.4.0"
55
+ "vue": "^3.4.3",
56
+ "@vue-macros/reactivity-transform": "^0.4.1"
58
57
  },
59
58
  "peerDependencies": {
60
59
  "@bagelink/sdk": "*",
@@ -74,37 +73,37 @@
74
73
  },
75
74
  "peerDependenciesMeta": {
76
75
  "vue3-charts": {
77
- "option": true
76
+ "optional": true
78
77
  },
79
78
  "@formkit/vue": {
80
- "option": true
79
+ "optional": true
81
80
  },
82
81
  "@formkit/core": {
83
- "option": true
82
+ "optional": true
84
83
  },
85
84
  "vue-draggable-next": {
86
- "option": true
85
+ "optional": true
87
86
  },
88
87
  "prosemirror-commands": {
89
- "option": true
88
+ "optional": true
90
89
  },
91
90
  "prosemirror-history": {
92
- "option": true
91
+ "optional": true
93
92
  },
94
93
  "prosemirror-keymap": {
95
- "option": true
94
+ "optional": true
96
95
  },
97
96
  "prosemirror-model": {
98
- "option": true
97
+ "optional": true
99
98
  },
100
99
  "prosemirror-schema-basic": {
101
- "option": true
100
+ "optional": true
102
101
  },
103
102
  "prosemirror-state": {
104
- "option": true
103
+ "optional": true
105
104
  },
106
105
  "prosemirror-view": {
107
- "option": true
106
+ "optional": true
108
107
  }
109
108
  },
110
109
  "publishConfig": {
@@ -1,100 +1,121 @@
1
1
  <template>
2
- <div ref="chartContainer" class="chart-line">
3
- <Chart
4
- v-if="chartSize"
5
- :size="chartSize"
6
- :data="data"
7
- :margin="chartMargin"
8
- :axis="axisConfig"
9
- >
10
- <template #layers>
11
- <Grid :center="true" strokeDasharray="2,2" :hideY="true" />
12
- <Area
13
- aria-label="Profit/Loss"
14
- :dataKeys="['date', 'total_value']"
15
- type="monotone"
16
- :areaStyle="{ fill: 'url(#grad)' }"
17
- />
18
- <Line
19
- :dataKeys="['date', 'total_value']"
20
- type="monotone"
21
- :dotStyle="dotStyling"
22
- :lineStyle="{ stroke: BRAND_COLOR, r: 2 }"
23
- />
24
- <Marker
25
- v-if="displayMarker"
26
- :value="meanValue"
27
- label="ממוצע"
28
- :color="BRAND_COLOR"
29
- :strokeWidth="2"
30
- strokeDasharray="6 6"
31
- />
32
- <defs>
33
- <linearGradient id="grad" gradientTransform="rotate(90)">
34
- <stop offset="0%" :stop-color="BRAND_COLOR" stop-opacity="1" />
35
- <stop offset="100%" stop-color="white" stop-opacity="0.4" />
36
- </linearGradient>
37
- </defs>
38
- </template>
39
- <template #widgets>
40
- <Tooltip color="white" :config="tooltipConfiguration" />
41
- </template>
42
- </Chart>
43
- </div>
2
+ <div
3
+ ref="chartContainer"
4
+ class="chart-line"
5
+ >
6
+ <Chart
7
+ v-if="chartSize"
8
+ :size="chartSize"
9
+ :data="data"
10
+ :margin="chartMargin"
11
+ :axis="axisConfig"
12
+ >
13
+ <template #layers>
14
+ <Grid
15
+ :center="true"
16
+ strokeDasharray="2,2"
17
+ :hideY="true"
18
+ />
19
+ <Area
20
+ aria-label="Profit/Loss"
21
+ :dataKeys="['date', 'total_value']"
22
+ type="monotone"
23
+ :areaStyle="{ fill: 'url(#grad)' }"
24
+ />
25
+ <Line
26
+ :dataKeys="['date', 'total_value']"
27
+ type="monotone"
28
+ :dotStyle="dotStyling"
29
+ :lineStyle="{ stroke: BRAND_COLOR, r: 2 }"
30
+ />
31
+ <Marker
32
+ v-if="displayMarker"
33
+ :value="meanValue"
34
+ label="ממוצע"
35
+ :color="BRAND_COLOR"
36
+ :strokeWidth="2"
37
+ strokeDasharray="6 6"
38
+ />
39
+ <defs>
40
+ <linearGradient
41
+ id="grad"
42
+ gradientTransform="rotate(90)"
43
+ >
44
+ <stop
45
+ offset="0%"
46
+ :stop-color="BRAND_COLOR"
47
+ stop-opacity="1"
48
+ />
49
+ <stop
50
+ offset="100%"
51
+ stop-color="white"
52
+ stop-opacity="0.4"
53
+ />
54
+ </linearGradient>
55
+ </defs>
56
+ </template>
57
+ <template #widgets>
58
+ <Tooltip
59
+ color="white"
60
+ :config="tooltipConfiguration"
61
+ />
62
+ </template>
63
+ </Chart>
64
+ </div>
44
65
  </template>
45
66
 
46
67
  <script lang="ts" setup>
47
- import { onMounted, onUnmounted } from "vue";
48
- import { Chart, Grid, Line, Area, Tooltip, Marker } from "vue3-charts";
49
- import type { ChartAxis, Data } from "vue3-charts/dist/types";
68
+ import { onMounted, onUnmounted } from 'vue';
69
+ import {
70
+ Chart, Grid, Line, Area, Tooltip, Marker,
71
+ } from 'vue3-charts';
72
+ import type { ChartAxis, Data } from 'vue3-charts/dist/types';
50
73
 
51
74
  const props = defineProps<{ data: Data[]; locale: string }>();
52
75
 
53
- const data = $computed(() =>
54
- props.locale === "he" ? [...props.data].reverse() : props.data
55
- );
76
+ const data = $computed(() => (props.locale === 'he' ? [...props.data].reverse() : props.data));
56
77
 
57
78
  interface Size {
58
- width: number;
59
- height: number;
79
+ width: number;
80
+ height: number;
60
81
  }
61
82
 
62
83
  // Computed properties
63
84
  const meanValue = $computed(() => {
64
- const sum = props.data.reduce((acc, curr) => acc + +curr.total_value, 0);
65
- return sum / props.data.length;
85
+ const sum = props.data.reduce((acc, curr) => acc + +curr.total_value, 0);
86
+ return sum / props.data.length;
66
87
  });
67
88
 
68
89
  const axisConfig = $computed<ChartAxis>(() => ({
69
- primary: {
70
- type: "band",
71
- rotate: true,
72
- ticks: 5,
73
- domain: ["dataMin", "dataMax"],
74
- tickValues:
75
- props.data?.length > 100 ? [""] : props.data.map((d: any) => d.date),
76
- },
77
- secondary: {
78
- domain: ["dataMin", "dataMax * 1.05"],
79
- type: "linear",
80
- ticks: 8,
81
- },
90
+ primary: {
91
+ type: 'band',
92
+ rotate: true,
93
+ ticks: 5,
94
+ domain: ['dataMin', 'dataMax'],
95
+ tickValues:
96
+ props.data?.length > 100 ? [''] : props.data.map((d: any) => d.date),
97
+ },
98
+ secondary: {
99
+ domain: ['dataMin', 'dataMax * 1.05'],
100
+ type: 'linear',
101
+ ticks: 8,
102
+ },
82
103
  }));
83
104
 
84
105
  // Constants
85
- const BRAND_COLOR = "var(--bgl-primary)";
106
+ const BRAND_COLOR = 'var(--bgl-primary)';
86
107
 
87
108
  const tooltipConfiguration = {
88
- date: { label: "תאריך" },
89
- total_value: {
90
- color: BRAND_COLOR,
91
- label: "סכום",
92
- format: (v: number) => `₪${v.toLocaleString()}`,
93
- },
94
- total_count: {
95
- label: "מספר התרומות",
96
- format: (v: number) => `${v.toLocaleString()}`,
97
- },
109
+ date: { label: 'תאריך' },
110
+ total_value: {
111
+ color: BRAND_COLOR,
112
+ label: 'סכום',
113
+ format: (v: number) => `₪${v?.toLocaleString?.() || ''}`,
114
+ },
115
+ total_count: {
116
+ label: 'מספר התרומות',
117
+ format: (v: number) => `${v?.toLocaleString?.() || ''}`,
118
+ },
98
119
  };
99
120
 
100
121
  // Refs
@@ -102,83 +123,83 @@ let chartSize = $ref<Size | null>(null);
102
123
  const chartContainer = $ref<HTMLElement>();
103
124
  const displayMarker = $ref(true);
104
125
  const chartMargin = $ref({
105
- left: 0,
106
- top: 0,
107
- right: 0,
108
- bottom: 0,
126
+ left: 0,
127
+ top: 0,
128
+ right: 0,
129
+ bottom: 0,
109
130
  });
110
131
 
111
132
  // Functions
112
133
  const adjustChartSize = () => {
113
- chartSize = null;
114
- const el = chartContainer;
115
- if (!el) return;
116
- const { width, height } = el.getBoundingClientRect();
117
- chartSize = { width: width - 5, height: height - 10 };
118
- console.log(chartSize);
134
+ chartSize = null;
135
+ const el = chartContainer;
136
+ if (!el) return;
137
+ const { width, height } = el.getBoundingClientRect();
138
+ chartSize = { width: width - 5, height: height - 10 };
139
+ console.log(chartSize);
119
140
  };
120
141
 
121
142
  const handleResize = () => {
122
- setTimeout(adjustChartSize, 300);
143
+ setTimeout(adjustChartSize, 300);
123
144
  };
124
145
 
125
146
  // Lifecycle hooks
126
147
  onMounted(() => {
127
- adjustChartSize();
128
- window.addEventListener("resize", handleResize);
148
+ adjustChartSize();
149
+ window.addEventListener('resize', handleResize);
129
150
  });
130
151
 
131
152
  onUnmounted(() => {
132
- window.removeEventListener("resize", handleResize);
153
+ window.removeEventListener('resize', handleResize);
133
154
  });
134
155
 
135
156
  // Style Configurations
136
157
  const dotStyling = (ctx: Record<string, any>) => ({
137
- r: ctx.active ? 5 : 1,
138
- fill: BRAND_COLOR,
158
+ r: ctx.active ? 5 : 1,
159
+ fill: BRAND_COLOR,
139
160
  });
140
161
  </script>
141
162
 
142
163
  <style>
143
164
  .chart-line {
144
- width: 100%;
145
- height: 300px;
165
+ width: 100%;
166
+ height: 300px;
146
167
  }
147
168
 
148
169
  [dir="rtl"] .chart-line {
149
- direction: ltr;
170
+ direction: ltr;
150
171
  }
151
172
 
152
- .chart-line .v-tooltip-content > div {
153
- border: none !important;
154
- border-radius: 6px !important;
155
- background-color: black !important;
156
- opacity: 0.7;
157
- padding: 0.5rem 1rem !important;
158
- box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06) !important;
159
- font-weight: 300;
173
+ .chart-line .v-tooltip-content>div {
174
+ border: none !important;
175
+ border-radius: 6px !important;
176
+ background-color: black !important;
177
+ opacity: 0.7;
178
+ padding: 0.5rem 1rem !important;
179
+ box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06) !important;
180
+ font-weight: 300;
160
181
  }
161
182
 
162
- .chart-line .v-tooltip-content > div b {
163
- font-weight: 400;
183
+ .chart-line .v-tooltip-content>div b {
184
+ font-weight: 400;
164
185
  }
165
186
 
166
187
  .layer-grid g:last-child {
167
- display: none;
188
+ display: none;
168
189
  }
169
190
 
170
191
  .layer-axis-x .tick:nth-child(2n + 1) {
171
- opacity: 0;
192
+ opacity: 0;
172
193
  }
173
194
 
174
195
  @media screen and (max-width: 910px) {
175
- .chart-line {
176
- height: 140px;
177
- }
178
-
179
- .layer-axis-x .tick {
180
- opacity: 0;
181
- font-size: 0;
182
- }
196
+ .chart-line {
197
+ height: 140px;
198
+ }
199
+
200
+ .layer-axis-x .tick {
201
+ opacity: 0;
202
+ font-size: 0;
203
+ }
183
204
  }
184
205
  </style>
@@ -142,8 +142,8 @@ function animateCircle(e: DragEvent) {
142
142
 
143
143
  function emitValue() {
144
144
  // const fileValues = files.map((f) => f.serverFile?.id);
145
- // console.log({ files });
146
- if (!computedMultiple) return props.context?.node.input(files[0].serverFile);
145
+ const relationshipKey = props.context?.attrs?.relationshipKey;
146
+ if (!computedMultiple) return props.context?.node.input(relationshipKey ? files[0].serverFile.id : files[0].serverFile);
147
147
  // eslint-disable-next-line no-alert
148
148
  return alert('not implemented');
149
149
  }
@@ -157,7 +157,7 @@ function uploadFiles() {
157
157
  if (file.uploaded || file.uploading || !file.file) return;
158
158
  file.uploading = true;
159
159
  file.serverFile = await bagel.uploadFile(file.file, {
160
- onUploadProgress: (e) => (file.progress = e.progress * 100 - 1),
160
+ onUploadProgress: (e: any) => (file.progress = e.progress * 100 - 1),
161
161
  });
162
162
  file.progress += 1;
163
163
  emitValue();
@@ -202,14 +202,16 @@ async function addFiles(addedFiles: FileList) {
202
202
 
203
203
  onMounted(() => {
204
204
  dropZoneEl?.addEventListener('dragover', animateCircle);
205
- if (!computedMultiple && props.context?.value) {
205
+ const relationshipKey = props.context?.attrs?.relationshipKey;
206
+ const imageObj = relationshipKey ? props.context?.node?.parent?.value[relationshipKey] : props.context?.node?.value;
207
+ if (!computedMultiple && imageObj) {
206
208
  files.push({
207
- serverFile: props.context?.value,
209
+ serverFile: imageObj,
208
210
  uploaded: true,
209
211
  uploading: false,
210
212
  progress: 100,
211
- dataUrl: props.context?.value?.url,
212
- name: props.context?.value?.name,
213
+ dataUrl: imageObj?.url,
214
+ name: imageObj?.name,
213
215
  });
214
216
  }
215
217
  });
package/tsconfig.json CHANGED
@@ -35,36 +35,6 @@
35
35
  "@bagelink/vue/*": [
36
36
  "./vue/src/*"
37
37
  ],
38
- // "#": [
39
- // "./src/index.ts"
40
- // ],
41
- // "#/*": [
42
- // "./src/*"
43
- // ],
44
- // "#/components": [
45
- // "./src/components/index.ts"
46
- // ],
47
- // "#/components/*": [
48
- // "./src/components/*"
49
- // ],
50
- // "#/types": [
51
- // "./src/types/index.ts"
52
- // ],
53
- // "#/types/*": [
54
- // "./src/types/*"
55
- // ],
56
- // "#/utils": [
57
- // "./src/utils/index.ts"
58
- // ],
59
- // "#/utils/*": [
60
- // "./src/utils/*"
61
- // ],
62
- // "#/plugins": [
63
- // "./src/plugins/index.ts"
64
- // ],
65
- // "#/plugins/*": [
66
- // "./src/plugins/*"
67
- // ],
68
38
  },
69
39
  },
70
40
  "include": [