@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.
- package/dist/components/Btn.vue.d.ts +1 -1
- package/dist/components/Btn.vue.d.ts.map +1 -1
- package/dist/components/Comments.vue.d.ts +1 -1
- package/dist/components/Comments.vue.d.ts.map +1 -1
- package/dist/components/ContactSubmissions.vue.d.ts +1 -1
- package/dist/components/DataPreview.vue.d.ts +1 -1
- package/dist/components/DataPreview.vue.d.ts.map +1 -1
- package/dist/components/DropDown.vue.d.ts +1 -1
- package/dist/components/FormSchema.vue.d.ts +1 -1
- package/dist/components/FormSchema.vue.d.ts.map +1 -1
- package/dist/components/LangText.vue.d.ts +1 -1
- package/dist/components/LangText.vue.d.ts.map +1 -1
- package/dist/components/ListItem.vue.d.ts +1 -1
- package/dist/components/ListItem.vue.d.ts.map +1 -1
- package/dist/components/ListView.vue.d.ts +3 -3
- package/dist/components/ListView.vue.d.ts.map +1 -1
- package/dist/components/MaterialIcon.vue.d.ts +1 -1
- package/dist/components/MaterialIcon.vue.d.ts.map +1 -1
- package/dist/components/Modal.vue.d.ts +1 -1
- package/dist/components/Modal.vue.d.ts.map +1 -1
- package/dist/components/ModalForm.vue.d.ts +1 -1
- package/dist/components/ModalForm.vue.d.ts.map +1 -1
- package/dist/components/NavBar.vue.d.ts +1 -1
- package/dist/components/NavBar.vue.d.ts.map +1 -1
- package/dist/components/PageTitle.vue.d.ts +1 -1
- package/dist/components/PageTitle.vue.d.ts.map +1 -1
- package/dist/components/PersonPreview.vue.d.ts +1 -1
- package/dist/components/PersonPreview.vue.d.ts.map +1 -1
- package/dist/components/PersonPreviewFormkit.vue.d.ts +1 -1
- package/dist/components/PersonPreviewFormkit.vue.d.ts.map +1 -1
- package/dist/components/RTXEditor.vue.d.ts +1 -1
- package/dist/components/RTXEditor.vue.d.ts.map +1 -1
- package/dist/components/RouterWrapper.vue.d.ts +1 -1
- package/dist/components/TabbedLayout.vue.d.ts +1 -1
- package/dist/components/TabbedLayout.vue.d.ts.map +1 -1
- package/dist/components/TableSchema.vue.d.ts +1 -1
- package/dist/components/TableSchema.vue.d.ts.map +1 -1
- package/dist/components/TopBar.vue.d.ts +1 -1
- package/dist/components/TopBar.vue.d.ts.map +1 -1
- package/dist/components/charts/BarChart.vue.d.ts +1 -1
- package/dist/components/charts/BarChart.vue.d.ts.map +1 -1
- package/dist/components/dashboard/Lineart.vue.d.ts +2 -2
- package/dist/components/dashboard/Lineart.vue.d.ts.map +1 -1
- package/dist/components/form/ItemRef.vue.d.ts +1 -1
- package/dist/components/form/ItemRef.vue.d.ts.map +1 -1
- package/dist/components/form/MaterialIcon.vue.d.ts +1 -1
- package/dist/components/form/MaterialIcon.vue.d.ts.map +1 -1
- package/dist/components/form/PlainInputField.vue.d.ts +1 -1
- package/dist/components/form/PlainInputField.vue.d.ts.map +1 -1
- package/dist/components/form/inputs/CheckInput.vue.d.ts +1 -1
- package/dist/components/form/inputs/CheckInput.vue.d.ts.map +1 -1
- package/dist/components/form/inputs/Checkbox.vue.d.ts +1 -1
- package/dist/components/form/inputs/ColorPicker.vue.d.ts +1 -1
- package/dist/components/form/inputs/ColorPicker.vue.d.ts.map +1 -1
- package/dist/components/form/inputs/CurrencyInput.vue.d.ts +1 -1
- package/dist/components/form/inputs/CurrencyInput.vue.d.ts.map +1 -1
- package/dist/components/form/inputs/DateInput.vue.d.ts +1 -1
- package/dist/components/form/inputs/DateInput.vue.d.ts.map +1 -1
- package/dist/components/form/inputs/DatetimeInput.vue.d.ts +1 -1
- package/dist/components/form/inputs/DatetimeInput.vue.d.ts.map +1 -1
- package/dist/components/form/inputs/DurationInput.vue.d.ts +1 -1
- package/dist/components/form/inputs/DurationInput.vue.d.ts.map +1 -1
- package/dist/components/form/inputs/DynamicLinkField.vue.d.ts +1 -1
- package/dist/components/form/inputs/DynamicLinkField.vue.d.ts.map +1 -1
- package/dist/components/form/inputs/EmailInput.vue.d.ts +1 -1
- package/dist/components/form/inputs/EmailInput.vue.d.ts.map +1 -1
- package/dist/components/form/inputs/FloatInput.vue.d.ts +1 -1
- package/dist/components/form/inputs/FloatInput.vue.d.ts.map +1 -1
- package/dist/components/form/inputs/IntInput.vue.d.ts +1 -1
- package/dist/components/form/inputs/IntInput.vue.d.ts.map +1 -1
- package/dist/components/form/inputs/JSONInput.vue.d.ts +1 -1
- package/dist/components/form/inputs/JSONInput.vue.d.ts.map +1 -1
- package/dist/components/form/inputs/LinkField.vue.d.ts +1 -1
- package/dist/components/form/inputs/LinkField.vue.d.ts.map +1 -1
- package/dist/components/form/inputs/Password.vue.d.ts +1 -1
- package/dist/components/form/inputs/Password.vue.d.ts.map +1 -1
- package/dist/components/form/inputs/PasswordInput.vue.d.ts +1 -1
- package/dist/components/form/inputs/PasswordInput.vue.d.ts.map +1 -1
- package/dist/components/form/inputs/PlainText.vue.d.ts +1 -1
- package/dist/components/form/inputs/PlainText.vue.d.ts.map +1 -1
- package/dist/components/form/inputs/ReadOnlyInput.vue.d.ts +1 -1
- package/dist/components/form/inputs/ReadOnlyInput.vue.d.ts.map +1 -1
- package/dist/components/form/inputs/RichTextEditor.vue.d.ts +1 -1
- package/dist/components/form/inputs/RichTextEditor.vue.d.ts.map +1 -1
- package/dist/components/form/inputs/SelectField.vue.d.ts +1 -1
- package/dist/components/form/inputs/SelectField.vue.d.ts.map +1 -1
- package/dist/components/form/inputs/TableField.vue.d.ts +1 -1
- package/dist/components/form/inputs/TableField.vue.d.ts.map +1 -1
- package/dist/components/form/inputs/TextArea.vue.d.ts +1 -1
- package/dist/components/form/inputs/TextArea.vue.d.ts.map +1 -1
- package/dist/components/form/inputs/TextInput.vue.d.ts +1 -1
- package/dist/components/form/inputs/TextInput.vue.d.ts.map +1 -1
- package/dist/components/formkit/AddressArray.vue.d.ts +1 -1
- package/dist/components/formkit/AddressArray.vue.d.ts.map +1 -1
- package/dist/components/formkit/BankDetailsArray.vue.d.ts +1 -1
- package/dist/components/formkit/BankDetailsArray.vue.d.ts.map +1 -1
- package/dist/components/formkit/ContactArrayFormKit.vue.d.ts +1 -1
- package/dist/components/formkit/ContactArrayFormKit.vue.d.ts.map +1 -1
- package/dist/components/formkit/FileUploader.vue.d.ts +1 -1
- package/dist/components/formkit/FileUploader.vue.d.ts.map +1 -1
- package/dist/components/formkit/MiscFields.vue.d.ts +1 -1
- package/dist/components/formkit/MiscFields.vue.d.ts.map +1 -1
- package/dist/components/formkit/Toggle.vue.d.ts +1 -1
- package/dist/components/whatsapp/form/MsgTemplate.vue.d.ts +1 -1
- package/dist/components/whatsapp/form/MsgTemplate.vue.d.ts.map +1 -1
- package/dist/components/whatsapp/form/TextVariableExamples.vue.d.ts +1 -1
- package/dist/index.cjs +22 -15
- package/dist/index.mjs +22 -15
- package/dist/style.css +18 -18
- package/package.json +15 -16
- package/src/components/dashboard/Lineart.vue +136 -115
- package/src/components/formkit/FileUploader.vue +9 -7
- 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(
|
|
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.
|
|
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)
|
|
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 (
|
|
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
|
-
|
|
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:
|
|
17882
|
+
serverFile: imageObj,
|
|
17880
17883
|
uploaded: true,
|
|
17881
17884
|
uploading: false,
|
|
17882
17885
|
progress: 100,
|
|
17883
|
-
dataUrl:
|
|
17884
|
-
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) =>
|
|
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) =>
|
|
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
|
-
|
|
2239
|
-
|
|
2238
|
+
width: 100%;
|
|
2239
|
+
height: 300px;
|
|
2240
2240
|
}
|
|
2241
2241
|
[dir="rtl"] .chart-line {
|
|
2242
|
-
|
|
2242
|
+
direction: ltr;
|
|
2243
2243
|
}
|
|
2244
|
-
.chart-line .v-tooltip-content
|
|
2245
|
-
|
|
2246
|
-
|
|
2247
|
-
|
|
2248
|
-
|
|
2249
|
-
|
|
2250
|
-
|
|
2251
|
-
|
|
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
|
|
2254
|
-
|
|
2253
|
+
.chart-line .v-tooltip-content>div b {
|
|
2254
|
+
font-weight: 400;
|
|
2255
2255
|
}
|
|
2256
2256
|
.layer-grid g:last-child {
|
|
2257
|
-
|
|
2257
|
+
display: none;
|
|
2258
2258
|
}
|
|
2259
2259
|
.layer-axis-x .tick:nth-child(2n + 1) {
|
|
2260
|
-
|
|
2260
|
+
opacity: 0;
|
|
2261
2261
|
}
|
|
2262
2262
|
@media screen and (max-width: 910px) {
|
|
2263
2263
|
.chart-line {
|
|
2264
|
-
|
|
2264
|
+
height: 140px;
|
|
2265
2265
|
}
|
|
2266
2266
|
.layer-axis-x .tick {
|
|
2267
|
-
|
|
2268
|
-
|
|
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.
|
|
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
|
-
"
|
|
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
|
-
"
|
|
76
|
+
"optional": true
|
|
78
77
|
},
|
|
79
78
|
"@formkit/vue": {
|
|
80
|
-
"
|
|
79
|
+
"optional": true
|
|
81
80
|
},
|
|
82
81
|
"@formkit/core": {
|
|
83
|
-
"
|
|
82
|
+
"optional": true
|
|
84
83
|
},
|
|
85
84
|
"vue-draggable-next": {
|
|
86
|
-
"
|
|
85
|
+
"optional": true
|
|
87
86
|
},
|
|
88
87
|
"prosemirror-commands": {
|
|
89
|
-
"
|
|
88
|
+
"optional": true
|
|
90
89
|
},
|
|
91
90
|
"prosemirror-history": {
|
|
92
|
-
"
|
|
91
|
+
"optional": true
|
|
93
92
|
},
|
|
94
93
|
"prosemirror-keymap": {
|
|
95
|
-
"
|
|
94
|
+
"optional": true
|
|
96
95
|
},
|
|
97
96
|
"prosemirror-model": {
|
|
98
|
-
"
|
|
97
|
+
"optional": true
|
|
99
98
|
},
|
|
100
99
|
"prosemirror-schema-basic": {
|
|
101
|
-
"
|
|
100
|
+
"optional": true
|
|
102
101
|
},
|
|
103
102
|
"prosemirror-state": {
|
|
104
|
-
"
|
|
103
|
+
"optional": true
|
|
105
104
|
},
|
|
106
105
|
"prosemirror-view": {
|
|
107
|
-
"
|
|
106
|
+
"optional": true
|
|
108
107
|
}
|
|
109
108
|
},
|
|
110
109
|
"publishConfig": {
|
|
@@ -1,100 +1,121 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
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
|
|
48
|
-
import {
|
|
49
|
-
|
|
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
|
-
|
|
59
|
-
|
|
79
|
+
width: number;
|
|
80
|
+
height: number;
|
|
60
81
|
}
|
|
61
82
|
|
|
62
83
|
// Computed properties
|
|
63
84
|
const meanValue = $computed(() => {
|
|
64
|
-
|
|
65
|
-
|
|
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
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
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 =
|
|
106
|
+
const BRAND_COLOR = 'var(--bgl-primary)';
|
|
86
107
|
|
|
87
108
|
const tooltipConfiguration = {
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
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
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
126
|
+
left: 0,
|
|
127
|
+
top: 0,
|
|
128
|
+
right: 0,
|
|
129
|
+
bottom: 0,
|
|
109
130
|
});
|
|
110
131
|
|
|
111
132
|
// Functions
|
|
112
133
|
const adjustChartSize = () => {
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
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
|
-
|
|
143
|
+
setTimeout(adjustChartSize, 300);
|
|
123
144
|
};
|
|
124
145
|
|
|
125
146
|
// Lifecycle hooks
|
|
126
147
|
onMounted(() => {
|
|
127
|
-
|
|
128
|
-
|
|
148
|
+
adjustChartSize();
|
|
149
|
+
window.addEventListener('resize', handleResize);
|
|
129
150
|
});
|
|
130
151
|
|
|
131
152
|
onUnmounted(() => {
|
|
132
|
-
|
|
153
|
+
window.removeEventListener('resize', handleResize);
|
|
133
154
|
});
|
|
134
155
|
|
|
135
156
|
// Style Configurations
|
|
136
157
|
const dotStyling = (ctx: Record<string, any>) => ({
|
|
137
|
-
|
|
138
|
-
|
|
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
|
-
|
|
145
|
-
|
|
165
|
+
width: 100%;
|
|
166
|
+
height: 300px;
|
|
146
167
|
}
|
|
147
168
|
|
|
148
169
|
[dir="rtl"] .chart-line {
|
|
149
|
-
|
|
170
|
+
direction: ltr;
|
|
150
171
|
}
|
|
151
172
|
|
|
152
|
-
.chart-line .v-tooltip-content
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
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
|
|
163
|
-
|
|
183
|
+
.chart-line .v-tooltip-content>div b {
|
|
184
|
+
font-weight: 400;
|
|
164
185
|
}
|
|
165
186
|
|
|
166
187
|
.layer-grid g:last-child {
|
|
167
|
-
|
|
188
|
+
display: none;
|
|
168
189
|
}
|
|
169
190
|
|
|
170
191
|
.layer-axis-x .tick:nth-child(2n + 1) {
|
|
171
|
-
|
|
192
|
+
opacity: 0;
|
|
172
193
|
}
|
|
173
194
|
|
|
174
195
|
@media screen and (max-width: 910px) {
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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:
|
|
209
|
+
serverFile: imageObj,
|
|
208
210
|
uploaded: true,
|
|
209
211
|
uploading: false,
|
|
210
212
|
progress: 100,
|
|
211
|
-
dataUrl:
|
|
212
|
-
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": [
|