@sarafapp/ant-design 1.0.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.
- package/README.md +66 -0
- package/dist/Constants.es.js +4 -0
- package/dist/_virtual/_commonjsHelpers.es.js +8 -0
- package/dist/_virtual/_plugin-vue_export-helper.es.js +9 -0
- package/dist/_virtual/dayjs.min.es.js +4 -0
- package/dist/baseForm/SarafFiledInvalidMessage.vue.es.js +7 -0
- package/dist/baseForm/SarafFiledInvalidMessage.vue.es2.js +20 -0
- package/dist/baseForm/SarafSearchFiled.vue.es.js +56 -0
- package/dist/baseForm/SarafSearchFiled.vue.es2.js +4 -0
- package/dist/baseForm/SarafSelect.vue.es.js +7 -0
- package/dist/baseForm/SarafSelect.vue.es2.js +153 -0
- package/dist/baseForm/SarafTextFiled.vue.es.js +7 -0
- package/dist/baseForm/SarafTextFiled.vue.es2.js +88 -0
- package/dist/baseForm/model/Constants.es.js +8 -0
- package/dist/baseTable/SarafBankCardTableCell.vue.es.js +7 -0
- package/dist/baseTable/SarafBankCardTableCell.vue.es2.js +27 -0
- package/dist/baseTable/SarafDynamicCurrencyPriceTableCell.vue.es.js +7 -0
- package/dist/baseTable/SarafDynamicCurrencyPriceTableCell.vue.es2.js +19 -0
- package/dist/baseTable/SarafIbanTableCell.vue.es.js +7 -0
- package/dist/baseTable/SarafIbanTableCell.vue.es2.js +27 -0
- package/dist/baseTable/SarafPriceTableCell.vue.es.js +7 -0
- package/dist/baseTable/SarafPriceTableCell.vue.es2.js +20 -0
- package/dist/baseTable/SarafSymbolTableCell.vue.es.js +7 -0
- package/dist/baseTable/SarafSymbolTableCell.vue.es2.js +20 -0
- package/dist/baseTable/SarafTable.vue.es.js +7 -0
- package/dist/baseTable/SarafTable.vue.es2.js +257 -0
- package/dist/baseTable/SarafTradeAmountTableCell.vue.es.js +7 -0
- package/dist/baseTable/SarafTradeAmountTableCell.vue.es2.js +27 -0
- package/dist/baseTable/SarafTradeDateCell.vue.es.js +7 -0
- package/dist/baseTable/SarafTradeDateCell.vue.es2.js +27 -0
- package/dist/baseTable/SarafTradeSymbolCell.vue.es.js +7 -0
- package/dist/baseTable/SarafTradeSymbolCell.vue.es2.js +29 -0
- package/dist/baseTable/SarafTradeSymbolPriceCell.vue.es.js +7 -0
- package/dist/baseTable/SarafTradeSymbolPriceCell.vue.es2.js +32 -0
- package/dist/dataDisplay/chart/SarafChart.vue.es.js +23 -0
- package/dist/dataDisplay/chart/SarafChart.vue.es2.js +4 -0
- package/dist/dataDisplay/chart/model/AreaChartDataSource.es.js +30 -0
- package/dist/dataDisplay/chart/model/CategoricalDataSource.es.js +21 -0
- package/dist/dataDisplay/chart/model/ChartTypes.es.js +34 -0
- package/dist/dataDisplay/chart/model/DataSource.es.js +62 -0
- package/dist/dataDisplay/chart/model/DonutChartDataSource.es.js +62 -0
- package/dist/dataDisplay/tag/SarafTag.vue.es.js +7 -0
- package/dist/dataDisplay/tag/SarafTag.vue.es2.js +40 -0
- package/dist/dataDisplay/tag/model/Constants.es.js +4 -0
- package/dist/dataDisplay/tooltip/model/tooltipDirective.es.js +29 -0
- package/dist/dataEntry/checkbox/SarafCheckbox.vue.es.js +7 -0
- package/dist/dataEntry/checkbox/SarafCheckbox.vue.es2.js +34 -0
- package/dist/datePicker/SarafDatePicker.vue.es.js +7 -0
- package/dist/datePicker/SarafDatePicker.vue.es2.js +75 -0
- package/dist/datePicker/SarafRangePicker.vue.es.js +7 -0
- package/dist/datePicker/SarafRangePicker.vue.es2.js +79 -0
- package/dist/general/button/SarafButton.vue.es.js +7 -0
- package/dist/general/button/SarafButton.vue.es2.js +56 -0
- package/dist/general/button/model/Constants.es.js +5 -0
- package/dist/icons/ArrowDownIcon.vue.es.js +28 -0
- package/dist/icons/ArrowDownIcon.vue.es2.js +4 -0
- package/dist/icons/ArrowUpIcon.vue.es.js +28 -0
- package/dist/icons/ArrowUpIcon.vue.es2.js +4 -0
- package/dist/icons/BurgerIcon.vue.es.js +26 -0
- package/dist/icons/BurgerIcon.vue.es2.js +4 -0
- package/dist/icons/GiftCardIcon.vue.es.js +19 -0
- package/dist/icons/PlusIcon.vue.es.js +24 -0
- package/dist/icons/ResetIcon.vue.es.js +23 -0
- package/dist/icons/SarafArrowIcon.vue.es.js +24 -0
- package/dist/icons/SarafLogoIcon.vue.es.js +42 -0
- package/dist/icons/SearchIcon.vue.es.js +29 -0
- package/dist/index.d.ts +584 -0
- package/dist/index.es.js +90 -0
- package/dist/index.js +57 -0
- package/dist/layout/SarafDialog.vue.es.js +36 -0
- package/dist/layout/SarafDialog.vue.es3.js +5 -0
- package/dist/layout/SarafDialogFooter.vue.es.js +13 -0
- package/dist/loaders/spinners/SarafDefaultSpinner.vue.es.js +21 -0
- package/dist/loaders/spinners/SarafDefaultSpinner.vue.es2.js +4 -0
- package/dist/loaders/spinners/model/Constants.es.js +4 -0
- package/dist/loaders/spinners/model/SarafDefaultSpinner.es.js +13 -0
- package/dist/node_modules/@ant-design/colors/dist/index.esm.es.js +119 -0
- package/dist/node_modules/@ant-design/icons-svg/es/asn/LoadingOutlined.es.js +4 -0
- package/dist/node_modules/@ant-design/icons-vue/es/components/AntdIcon.es.js +117 -0
- package/dist/node_modules/@ant-design/icons-vue/es/components/Context.es.js +11 -0
- package/dist/node_modules/@ant-design/icons-vue/es/components/IconBase.es.js +77 -0
- package/dist/node_modules/@ant-design/icons-vue/es/components/InsertStyle.es.js +13 -0
- package/dist/node_modules/@ant-design/icons-vue/es/components/twoTonePrimaryColor.es.js +60 -0
- package/dist/node_modules/@ant-design/icons-vue/es/dynamicCSS.es.js +72 -0
- package/dist/node_modules/@ant-design/icons-vue/es/icons/LoadingOutlined.es.js +28 -0
- package/dist/node_modules/@ant-design/icons-vue/es/utils.es.js +131 -0
- package/dist/node_modules/@ctrl/tinycolor/dist/module/conversion.es.js +70 -0
- package/dist/node_modules/@ctrl/tinycolor/dist/module/css-color-names.es.js +153 -0
- package/dist/node_modules/@ctrl/tinycolor/dist/module/format-input.es.js +68 -0
- package/dist/node_modules/@ctrl/tinycolor/dist/module/util.es.js +28 -0
- package/dist/node_modules/dayjs/dayjs.min.es.js +282 -0
- package/dist/style.css +1 -0
- package/package.json +46 -0
|
@@ -0,0 +1,257 @@
|
|
|
1
|
+
import { defineComponent as ie, ref as v, computed as u, onBeforeMount as ce, onBeforeUpdate as se, onBeforeUnmount as ue, resolveComponent as y, createBlock as i, openBlock as n, createSlots as de, withCtx as c, createElementBlock as s, createCommentVNode as g, unref as t, toDisplayString as f, mergeProps as pe, Fragment as k, renderList as x, createVNode as h, withModifiers as me, createTextVNode as A, renderSlot as ye } from "vue";
|
|
2
|
+
import { SelectableTable as fe, TableConstants as w, CellType as r, HeaderType as Se, SortDetail as he, SortOrderTableHeader as Te, SortOrder as B, TABLE_ACTION_COLUMN as _e, isOnlyOneItem as be, isLastItem as Ce } from "@sarafapp/iron_core";
|
|
3
|
+
import ve from "../dataDisplay/tag/SarafTag.vue.es.js";
|
|
4
|
+
import ge from "./SarafBankCardTableCell.vue.es.js";
|
|
5
|
+
import ke from "./SarafIbanTableCell.vue.es.js";
|
|
6
|
+
import Ae from "./SarafSymbolTableCell.vue.es.js";
|
|
7
|
+
import we from "./SarafTradeAmountTableCell.vue.es.js";
|
|
8
|
+
import Ie from "./SarafTradeSymbolPriceCell.vue.es.js";
|
|
9
|
+
import Pe from "./SarafTradeSymbolCell.vue.es.js";
|
|
10
|
+
import De from "./SarafTradeDateCell.vue.es.js";
|
|
11
|
+
import Oe from "./SarafPriceTableCell.vue.es.js";
|
|
12
|
+
import Ne from "./SarafDynamicCurrencyPriceTableCell.vue.es.js";
|
|
13
|
+
const Re = { key: 0 }, Ee = { key: 0 }, xe = {
|
|
14
|
+
key: 11,
|
|
15
|
+
class: "saraf-image-cell-wrapper"
|
|
16
|
+
}, Be = ["src", "alt"], Le = { key: 1 }, Me = { key: 12 }, Xe = /* @__PURE__ */ ie({
|
|
17
|
+
__name: "SarafTable",
|
|
18
|
+
props: {
|
|
19
|
+
dataSource: {}
|
|
20
|
+
},
|
|
21
|
+
setup(L) {
|
|
22
|
+
const l = L, d = v([]), I = v([]), S = v(), T = u(() => l.dataSource instanceof fe), M = u(() => l.dataSource.isLoading()), P = u(() => d.value.length > w.MINIMAL_LOADABLE_HEADER_COUNT), _ = u(() => l.dataSource.getData()), U = u(() => ({
|
|
23
|
+
total: _.value.totalItems,
|
|
24
|
+
current: _.value.currentPage,
|
|
25
|
+
showLessItems: !0,
|
|
26
|
+
showTotal(a) {
|
|
27
|
+
return "تعداد کل: " + a;
|
|
28
|
+
},
|
|
29
|
+
defaultPageSize: w.DEFAULT_ITEM_COUNT_PER_PAGE,
|
|
30
|
+
pageSize: l.dataSource.getItemCountPerPage(),
|
|
31
|
+
position: [w.PAGINATION_POSITION]
|
|
32
|
+
})), D = u(() => {
|
|
33
|
+
var a;
|
|
34
|
+
return ((a = d.value[d.value.length - 1]) == null ? void 0 : a.cellType) === r.ACTION;
|
|
35
|
+
}), H = u(() => T.value ? {
|
|
36
|
+
onSelect: V,
|
|
37
|
+
onSelectAll: z,
|
|
38
|
+
selectedRowKeys: I.value
|
|
39
|
+
} : null), K = u(() => !!S.value.summaryItems.length);
|
|
40
|
+
function V(a) {
|
|
41
|
+
l.dataSource.rowSelect(a);
|
|
42
|
+
}
|
|
43
|
+
function z() {
|
|
44
|
+
l.dataSource.selectAll();
|
|
45
|
+
}
|
|
46
|
+
function O() {
|
|
47
|
+
I.value = l.dataSource.getSelectedRowIds();
|
|
48
|
+
}
|
|
49
|
+
async function F(a, p, m) {
|
|
50
|
+
if (a && await l.dataSource.paginate(
|
|
51
|
+
a.current,
|
|
52
|
+
a.pageSize
|
|
53
|
+
), m != null && m.columnKey) {
|
|
54
|
+
const b = new he(
|
|
55
|
+
m.columnKey,
|
|
56
|
+
G(m.order)
|
|
57
|
+
);
|
|
58
|
+
await l.dataSource.sort(b);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
function G(a) {
|
|
62
|
+
return a === Te.ASC ? B.ASC : B.DESC;
|
|
63
|
+
}
|
|
64
|
+
async function $() {
|
|
65
|
+
await l.dataSource.load(), N();
|
|
66
|
+
}
|
|
67
|
+
function N() {
|
|
68
|
+
d.value = l.dataSource.headerSchema;
|
|
69
|
+
const a = l.dataSource.hasAnyAction();
|
|
70
|
+
a && !D.value && j(), !a && D.value && q();
|
|
71
|
+
}
|
|
72
|
+
function j() {
|
|
73
|
+
d.value.push(_e);
|
|
74
|
+
}
|
|
75
|
+
function q() {
|
|
76
|
+
d.value.pop();
|
|
77
|
+
}
|
|
78
|
+
function J(a) {
|
|
79
|
+
l.dataSource.handleClick(a);
|
|
80
|
+
}
|
|
81
|
+
function Q(a) {
|
|
82
|
+
l.dataSource.handleMetaClick(a);
|
|
83
|
+
}
|
|
84
|
+
function W(a) {
|
|
85
|
+
l.dataSource.handleDoubleClick(a);
|
|
86
|
+
}
|
|
87
|
+
function X(a) {
|
|
88
|
+
return {
|
|
89
|
+
onClick(p) {
|
|
90
|
+
p.metaKey ? Q(a) : J(a);
|
|
91
|
+
},
|
|
92
|
+
onDblclick() {
|
|
93
|
+
W(a);
|
|
94
|
+
}
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
function Y(a) {
|
|
98
|
+
return a.id;
|
|
99
|
+
}
|
|
100
|
+
function Z(a, p) {
|
|
101
|
+
return !be(a) && !Ce(a, p);
|
|
102
|
+
}
|
|
103
|
+
function ee(a, p) {
|
|
104
|
+
return a.getProps ? a.getProps(p) : null;
|
|
105
|
+
}
|
|
106
|
+
function ae() {
|
|
107
|
+
T.value && l.dataSource.selectedRows.attach(
|
|
108
|
+
O
|
|
109
|
+
);
|
|
110
|
+
}
|
|
111
|
+
function te() {
|
|
112
|
+
T.value && l.dataSource.selectedRows.detach(
|
|
113
|
+
O
|
|
114
|
+
);
|
|
115
|
+
}
|
|
116
|
+
function R() {
|
|
117
|
+
S.value = l.dataSource.loadSummarySchema();
|
|
118
|
+
}
|
|
119
|
+
return ce(() => {
|
|
120
|
+
$(), ae(), R();
|
|
121
|
+
}), se(() => {
|
|
122
|
+
N(), R();
|
|
123
|
+
}), ue(() => {
|
|
124
|
+
l.dataSource.onDestroy(), te();
|
|
125
|
+
}), (a, p) => {
|
|
126
|
+
const m = y("a-button"), b = y("a-divider"), E = y("a-table-summary-cell"), le = y("a-typography-text"), ne = y("a-table-summary-row"), oe = y("a-table");
|
|
127
|
+
return n(), i(oe, {
|
|
128
|
+
columns: d.value,
|
|
129
|
+
"data-source": _.value.rows,
|
|
130
|
+
pagination: U.value,
|
|
131
|
+
"custom-row": X,
|
|
132
|
+
"row-key": Y,
|
|
133
|
+
loading: M.value,
|
|
134
|
+
scroll: l.dataSource.getScrollDetail(),
|
|
135
|
+
"row-selection": H.value,
|
|
136
|
+
class: "saraf-table",
|
|
137
|
+
onChange: F
|
|
138
|
+
}, de({ _: 2 }, [
|
|
139
|
+
P.value ? {
|
|
140
|
+
name: "headerCell",
|
|
141
|
+
fn: c(({ column: e }) => [
|
|
142
|
+
e.headerType === t(Se).Text ? (n(), s("span", Re, f(e.title), 1)) : g("", !0)
|
|
143
|
+
]),
|
|
144
|
+
key: "0"
|
|
145
|
+
} : void 0,
|
|
146
|
+
P.value ? {
|
|
147
|
+
name: "bodyCell",
|
|
148
|
+
fn: c(({ column: e, record: o }) => [
|
|
149
|
+
e.cellType === t(r).Text ? (n(), s("span", Ee, f(o[e.path]), 1)) : e.cellType === t(r).Tag ? (n(), i(t(ve), pe({
|
|
150
|
+
key: 1,
|
|
151
|
+
content: o[e.path]
|
|
152
|
+
}, ee(e, o)), null, 16, ["content"])) : e.cellType === t(r).BankCard ? (n(), i(t(ge), {
|
|
153
|
+
key: 2,
|
|
154
|
+
"card-number": o[e.path]
|
|
155
|
+
}, null, 8, ["card-number"])) : e.cellType === t(r).Iban ? (n(), i(t(ke), {
|
|
156
|
+
key: 3,
|
|
157
|
+
iban: o[e.path]
|
|
158
|
+
}, null, 8, ["iban"])) : e.cellType === t(r).Symbol ? (n(), i(t(Ae), {
|
|
159
|
+
key: 4,
|
|
160
|
+
symbol: o[e.path]
|
|
161
|
+
}, null, 8, ["symbol"])) : e.cellType === t(r).TradeDetail ? (n(), i(t(we), {
|
|
162
|
+
key: 5,
|
|
163
|
+
"symbol-trade-amount-detail": o[e.path]
|
|
164
|
+
}, null, 8, ["symbol-trade-amount-detail"])) : e.cellType === t(r).SymbolPrice ? (n(), i(t(Ie), {
|
|
165
|
+
key: 6,
|
|
166
|
+
"symbol-price-in-trade": o[e.path]
|
|
167
|
+
}, null, 8, ["symbol-price-in-trade"])) : e.cellType === t(r).TradeSymbol ? (n(), i(t(Pe), {
|
|
168
|
+
key: 7,
|
|
169
|
+
"symbol-in-trade": o[e.path]
|
|
170
|
+
}, null, 8, ["symbol-in-trade"])) : e.cellType === t(r).TradeDate ? (n(), i(t(De), {
|
|
171
|
+
key: 8,
|
|
172
|
+
"trade-date": o[e.path]
|
|
173
|
+
}, null, 8, ["trade-date"])) : e.cellType === t(r).Price ? (n(), i(t(Oe), {
|
|
174
|
+
key: 9,
|
|
175
|
+
price: o[e.path]
|
|
176
|
+
}, null, 8, ["price"])) : e.cellType === t(r).DynamicCurrencyPrice ? (n(), i(t(Ne), {
|
|
177
|
+
key: 10,
|
|
178
|
+
amount: o[e.path]
|
|
179
|
+
}, null, 8, ["amount"])) : e.cellType === t(r).Image ? (n(), s("div", xe, [
|
|
180
|
+
o[e.path] ? (n(), s("img", {
|
|
181
|
+
key: 0,
|
|
182
|
+
class: "saraf-image-cell",
|
|
183
|
+
src: o[e.path],
|
|
184
|
+
alt: o[e.path]
|
|
185
|
+
}, null, 8, Be)) : (n(), s("div", Le, "--"))
|
|
186
|
+
])) : e.cellType === t(r).ACTION ? (n(), s("span", Me, [
|
|
187
|
+
(n(!0), s(k, null, x(l.dataSource.getAccessedActions(o), (C, re) => (n(), s(k, {
|
|
188
|
+
key: C.actionName
|
|
189
|
+
}, [
|
|
190
|
+
h(m, {
|
|
191
|
+
type: "link",
|
|
192
|
+
onClick: me((Ue) => C.handler(o), ["stop"])
|
|
193
|
+
}, {
|
|
194
|
+
default: c(() => [
|
|
195
|
+
A(f(C.actionName), 1)
|
|
196
|
+
]),
|
|
197
|
+
_: 2
|
|
198
|
+
}, 1032, ["onClick"]),
|
|
199
|
+
Z(
|
|
200
|
+
l.dataSource.getAccessedActions(o).length,
|
|
201
|
+
re
|
|
202
|
+
) ? (n(), i(b, {
|
|
203
|
+
key: 0,
|
|
204
|
+
type: "vertical"
|
|
205
|
+
})) : g("", !0)
|
|
206
|
+
], 64))), 128))
|
|
207
|
+
])) : g("", !0)
|
|
208
|
+
]),
|
|
209
|
+
key: "1"
|
|
210
|
+
} : void 0,
|
|
211
|
+
l.dataSource.isExpandable() ? {
|
|
212
|
+
name: "expandedRowRender",
|
|
213
|
+
fn: c(({ record: e }) => [
|
|
214
|
+
ye(a.$slots, "expandedRowRender", {
|
|
215
|
+
row: e
|
|
216
|
+
}, void 0, !0)
|
|
217
|
+
]),
|
|
218
|
+
key: "2"
|
|
219
|
+
} : void 0,
|
|
220
|
+
K.value ? {
|
|
221
|
+
name: "summary",
|
|
222
|
+
fn: c(() => [
|
|
223
|
+
h(ne, null, {
|
|
224
|
+
default: c(() => [
|
|
225
|
+
h(E, null, {
|
|
226
|
+
default: c(() => [
|
|
227
|
+
A(f(S.value.summaryTitle), 1)
|
|
228
|
+
]),
|
|
229
|
+
_: 1
|
|
230
|
+
}),
|
|
231
|
+
(n(!0), s(k, null, x(S.value.summaryItems, (e, o) => (n(), i(E, {
|
|
232
|
+
key: o,
|
|
233
|
+
align: e.align
|
|
234
|
+
}, {
|
|
235
|
+
default: c(() => [
|
|
236
|
+
h(le, null, {
|
|
237
|
+
default: c(() => [
|
|
238
|
+
A(f(e.data), 1)
|
|
239
|
+
]),
|
|
240
|
+
_: 2
|
|
241
|
+
}, 1024)
|
|
242
|
+
]),
|
|
243
|
+
_: 2
|
|
244
|
+
}, 1032, ["align"]))), 128))
|
|
245
|
+
]),
|
|
246
|
+
_: 1
|
|
247
|
+
})
|
|
248
|
+
]),
|
|
249
|
+
key: "3"
|
|
250
|
+
} : void 0
|
|
251
|
+
]), 1032, ["columns", "data-source", "pagination", "loading", "scroll", "row-selection"]);
|
|
252
|
+
};
|
|
253
|
+
}
|
|
254
|
+
});
|
|
255
|
+
export {
|
|
256
|
+
Xe as default
|
|
257
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { defineComponent as a, createElementBlock as n, openBlock as r, createVNode as c, createElementVNode as e, unref as l, toDisplayString as s } from "vue";
|
|
2
|
+
import d from "../icons/SarafArrowIcon.vue.es.js";
|
|
3
|
+
const m = { class: "saraf-trade-amount-detail-wrapper" }, i = { class: "saraf-trade-amount" }, u = { class: "price-detail" }, p = { class: "symbol" }, _ = { class: "price" }, A = { class: "price-detail" }, b = { class: "symbol" }, f = { class: "price" }, x = /* @__PURE__ */ a({
|
|
4
|
+
__name: "SarafTradeAmountTableCell",
|
|
5
|
+
props: {
|
|
6
|
+
symbolTradeAmountDetail: {}
|
|
7
|
+
},
|
|
8
|
+
setup(o) {
|
|
9
|
+
const t = o;
|
|
10
|
+
return (y, h) => (r(), n("div", m, [
|
|
11
|
+
c(l(d)),
|
|
12
|
+
e("div", i, [
|
|
13
|
+
e("span", u, [
|
|
14
|
+
e("span", p, s(t.symbolTradeAmountDetail.requestedAmount.symbol), 1),
|
|
15
|
+
e("span", _, s(t.symbolTradeAmountDetail.requestedAmount.truncatedValue), 1)
|
|
16
|
+
]),
|
|
17
|
+
e("span", A, [
|
|
18
|
+
e("span", b, s(t.symbolTradeAmountDetail.executedAmount.symbol), 1),
|
|
19
|
+
e("span", f, s(t.symbolTradeAmountDetail.executedAmount.truncatedValue), 1)
|
|
20
|
+
])
|
|
21
|
+
])
|
|
22
|
+
]));
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
export {
|
|
26
|
+
x as default
|
|
27
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { defineComponent as o, createElementBlock as d, openBlock as r, createVNode as c, createElementVNode as e, unref as n, toDisplayString as a } from "vue";
|
|
2
|
+
import i from "../icons/SarafArrowIcon.vue.es.js";
|
|
3
|
+
const l = { class: "saraf-trade-date-cell-container" }, _ = { class: "date-info" }, p = { class: "date" }, m = { class: "time" }, f = { class: "date-info" }, u = { class: "date" }, D = { class: "time" }, S = /* @__PURE__ */ o({
|
|
4
|
+
__name: "SarafTradeDateCell",
|
|
5
|
+
props: {
|
|
6
|
+
tradeDate: {}
|
|
7
|
+
},
|
|
8
|
+
setup(s) {
|
|
9
|
+
const t = s;
|
|
10
|
+
return (h, v) => (r(), d("div", l, [
|
|
11
|
+
c(n(i)),
|
|
12
|
+
e("div", null, [
|
|
13
|
+
e("div", _, [
|
|
14
|
+
e("p", p, a(t.tradeDate.requestedDateInJalali), 1),
|
|
15
|
+
e("p", m, a(t.tradeDate.requestedTime), 1)
|
|
16
|
+
]),
|
|
17
|
+
e("div", f, [
|
|
18
|
+
e("p", u, a(t.tradeDate.executedDateInJalali), 1),
|
|
19
|
+
e("p", D, a(t.tradeDate.executedDateTime), 1)
|
|
20
|
+
])
|
|
21
|
+
])
|
|
22
|
+
]));
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
export {
|
|
26
|
+
S as default
|
|
27
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { defineComponent as a, createElementBlock as s, openBlock as m, createElementVNode as l, toDisplayString as o } from "vue";
|
|
2
|
+
const r = { class: "saraf-symbol-price-in-trade" }, t = ["src", "alt"], d = ["src", "alt"], i = /* @__PURE__ */ a({
|
|
3
|
+
__name: "SarafTradeSymbolCell",
|
|
4
|
+
props: {
|
|
5
|
+
symbolInTrade: {}
|
|
6
|
+
},
|
|
7
|
+
setup(n) {
|
|
8
|
+
const e = n;
|
|
9
|
+
return (c, y) => (m(), s("div", r, [
|
|
10
|
+
l("div", null, [
|
|
11
|
+
l("img", {
|
|
12
|
+
src: e.symbolInTrade.soldSymbol.image,
|
|
13
|
+
alt: e.symbolInTrade.soldSymbol.enName
|
|
14
|
+
}, null, 8, t),
|
|
15
|
+
l("p", null, o(e.symbolInTrade.soldSymbol.enName), 1)
|
|
16
|
+
]),
|
|
17
|
+
l("div", null, [
|
|
18
|
+
l("img", {
|
|
19
|
+
src: e.symbolInTrade.buySymbol.image,
|
|
20
|
+
alt: e.symbolInTrade.buySymbol.enName
|
|
21
|
+
}, null, 8, d),
|
|
22
|
+
l("p", null, o(e.symbolInTrade.buySymbol.enName), 1)
|
|
23
|
+
])
|
|
24
|
+
]));
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
export {
|
|
28
|
+
i as default
|
|
29
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { defineComponent as o, createElementBlock as t, openBlock as c, createElementVNode as e, toDisplayString as s, unref as a } from "vue";
|
|
2
|
+
import { Symbols as i } from "@sarafapp/iron_core";
|
|
3
|
+
const m = { class: "saraf-symbol-price-in-trade" }, d = ["src", "alt"], p = ["src", "alt"], T = /* @__PURE__ */ o({
|
|
4
|
+
__name: "SarafTradeSymbolPriceCell",
|
|
5
|
+
props: {
|
|
6
|
+
symbolPriceInTrade: {}
|
|
7
|
+
},
|
|
8
|
+
setup(n) {
|
|
9
|
+
const r = n;
|
|
10
|
+
return (u, l) => (c(), t("div", m, [
|
|
11
|
+
e("div", null, [
|
|
12
|
+
e("img", {
|
|
13
|
+
src: r.symbolPriceInTrade.symbolImage,
|
|
14
|
+
alt: r.symbolPriceInTrade.symobl
|
|
15
|
+
}, null, 8, d),
|
|
16
|
+
e("p", null, s(r.symbolPriceInTrade.truncatedSymbolPrice), 1),
|
|
17
|
+
l[0] || (l[0] = e("p", { class: "currency" }, "دلار", -1))
|
|
18
|
+
]),
|
|
19
|
+
e("div", null, [
|
|
20
|
+
e("img", {
|
|
21
|
+
src: r.symbolPriceInTrade.USDTImage,
|
|
22
|
+
alt: a(i).USDT
|
|
23
|
+
}, null, 8, p),
|
|
24
|
+
e("p", null, s(r.symbolPriceInTrade.truncatedUSDTPrice), 1),
|
|
25
|
+
l[1] || (l[1] = e("p", { class: "currency" }, "تومان", -1))
|
|
26
|
+
])
|
|
27
|
+
]));
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
export {
|
|
31
|
+
T as default
|
|
32
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { defineComponent as r, createBlock as a, openBlock as i, unref as p } from "vue";
|
|
2
|
+
import s from "vue3-apexcharts";
|
|
3
|
+
const d = /* @__PURE__ */ r({
|
|
4
|
+
__name: "SarafChart",
|
|
5
|
+
props: {
|
|
6
|
+
dataSource: {},
|
|
7
|
+
width: { default: "100%" },
|
|
8
|
+
height: { default: "400px" }
|
|
9
|
+
},
|
|
10
|
+
setup(o) {
|
|
11
|
+
const e = o;
|
|
12
|
+
return (t, h) => (i(), a(p(s), {
|
|
13
|
+
type: e.dataSource.getType(),
|
|
14
|
+
options: e.dataSource.getOptions(),
|
|
15
|
+
series: e.dataSource.getSeries(),
|
|
16
|
+
width: t.width,
|
|
17
|
+
height: t.height
|
|
18
|
+
}, null, 8, ["type", "options", "series", "width", "height"]));
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
export {
|
|
22
|
+
d as default
|
|
23
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { CategoricalChartDataSource as i } from "./CategoricalDataSource.es.js";
|
|
2
|
+
import { ChartType as o } from "./ChartTypes.es.js";
|
|
3
|
+
class c extends i {
|
|
4
|
+
constructor(e) {
|
|
5
|
+
super(o.AREA, e);
|
|
6
|
+
}
|
|
7
|
+
generateSeries() {
|
|
8
|
+
return this.rawData.map((e, t) => {
|
|
9
|
+
var s;
|
|
10
|
+
return {
|
|
11
|
+
name: ((s = this.settings.seriesNames) == null ? void 0 : s[t]) || `Series ${t + 1}`,
|
|
12
|
+
data: e.map((a) => a.value ?? null)
|
|
13
|
+
};
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
generateOptions() {
|
|
17
|
+
var t;
|
|
18
|
+
const e = this.generateCommonOptions();
|
|
19
|
+
return (t = this.settings.xAxisCategories) != null && t.length ? e.xaxis = {
|
|
20
|
+
categories: this.settings.xAxisCategories
|
|
21
|
+
} : this.rawData.forEach((s) => {
|
|
22
|
+
var a;
|
|
23
|
+
for (const r of s)
|
|
24
|
+
(a = e.xaxis) == null || a.categories.push(r.label);
|
|
25
|
+
}), e;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
export {
|
|
29
|
+
c as AreaChartDataSource
|
|
30
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { ChartDataSource as s } from "./DataSource.es.js";
|
|
2
|
+
class n extends s {
|
|
3
|
+
constructor(a, e) {
|
|
4
|
+
super(a, e);
|
|
5
|
+
}
|
|
6
|
+
completeData() {
|
|
7
|
+
var a;
|
|
8
|
+
return (a = this.settings.xAxisCategories) != null && a.length ? this.rawData.map((e) => {
|
|
9
|
+
const r = new Map(
|
|
10
|
+
e.map((t) => [t.label, t.value])
|
|
11
|
+
);
|
|
12
|
+
return this.settings.xAxisCategories.map((t) => ({
|
|
13
|
+
label: t,
|
|
14
|
+
value: r.get(t) ?? null
|
|
15
|
+
}));
|
|
16
|
+
}) : this.rawData;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
export {
|
|
20
|
+
n as CategoricalChartDataSource
|
|
21
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
var o = Object.defineProperty;
|
|
2
|
+
var n = (s, t, e) => t in s ? o(s, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : s[t] = e;
|
|
3
|
+
var a = (s, t, e) => n(s, typeof t != "symbol" ? t + "" : t, e);
|
|
4
|
+
var c = /* @__PURE__ */ ((s) => (s.LINE = "line", s.AREA = "area", s.BAR = "bar", s.PIE = "pie", s.DONUT = "donut", s))(c || {});
|
|
5
|
+
class u {
|
|
6
|
+
constructor(t, e) {
|
|
7
|
+
a(this, "label");
|
|
8
|
+
a(this, "value");
|
|
9
|
+
this.label = t, this.value = e;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
class b {
|
|
13
|
+
constructor(t, e = !1, i = !1, r = [], l = []) {
|
|
14
|
+
a(this, "title");
|
|
15
|
+
a(this, "toolbar");
|
|
16
|
+
a(this, "sensitive");
|
|
17
|
+
a(this, "xAxisCategories");
|
|
18
|
+
a(this, "seriesNames");
|
|
19
|
+
this.title = t, this.toolbar = e, this.sensitive = i, this.xAxisCategories = r, this.seriesNames = l;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
class v {
|
|
23
|
+
constructor(t, e) {
|
|
24
|
+
a(this, "name");
|
|
25
|
+
a(this, "data");
|
|
26
|
+
this.name = t, this.data = e;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
export {
|
|
30
|
+
v as ChartSeries,
|
|
31
|
+
b as ChartSettings,
|
|
32
|
+
c as ChartType,
|
|
33
|
+
u as RawChartDataPoint
|
|
34
|
+
};
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
var n = Object.defineProperty;
|
|
2
|
+
var h = (s, t, e) => t in s ? n(s, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : s[t] = e;
|
|
3
|
+
var i = (s, t, e) => h(s, typeof t != "symbol" ? t + "" : t, e);
|
|
4
|
+
class l {
|
|
5
|
+
constructor(t, e) {
|
|
6
|
+
i(this, "rawData", []);
|
|
7
|
+
i(this, "settings");
|
|
8
|
+
i(this, "options", null);
|
|
9
|
+
i(this, "series", null);
|
|
10
|
+
i(this, "chartType");
|
|
11
|
+
this.chartType = t, this.settings = e;
|
|
12
|
+
}
|
|
13
|
+
setRawData(t) {
|
|
14
|
+
this.rawData = t, this.checkData(), this.series = this.generateSeries(), this.options = this.generateOptions();
|
|
15
|
+
}
|
|
16
|
+
checkData() {
|
|
17
|
+
this.settings.sensitive ? this.validateData() : this.rawData = this.completeData();
|
|
18
|
+
}
|
|
19
|
+
validateData() {
|
|
20
|
+
if (!this.isDataValid())
|
|
21
|
+
throw new Error("Validation failed: Data is incomplete or missing.");
|
|
22
|
+
}
|
|
23
|
+
isDataValid() {
|
|
24
|
+
return this.rawData.every(
|
|
25
|
+
(t) => {
|
|
26
|
+
var e;
|
|
27
|
+
return (e = this.settings.xAxisCategories) == null ? void 0 : e.every(
|
|
28
|
+
(r) => t.some(
|
|
29
|
+
(a) => a.label === r && a.value !== null
|
|
30
|
+
)
|
|
31
|
+
);
|
|
32
|
+
}
|
|
33
|
+
);
|
|
34
|
+
}
|
|
35
|
+
generateCommonOptions() {
|
|
36
|
+
return {
|
|
37
|
+
chart: {
|
|
38
|
+
type: this.getType(),
|
|
39
|
+
toolbar: { show: this.settings.toolbar }
|
|
40
|
+
},
|
|
41
|
+
title: {
|
|
42
|
+
text: this.settings.title,
|
|
43
|
+
align: "center"
|
|
44
|
+
},
|
|
45
|
+
xaxis: {
|
|
46
|
+
categories: []
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
getSeries() {
|
|
51
|
+
return this.series ?? [];
|
|
52
|
+
}
|
|
53
|
+
getOptions() {
|
|
54
|
+
return this.options;
|
|
55
|
+
}
|
|
56
|
+
getType() {
|
|
57
|
+
return this.chartType;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
export {
|
|
61
|
+
l as ChartDataSource
|
|
62
|
+
};
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { ChartDataSource as s } from "./DataSource.es.js";
|
|
2
|
+
import { ChartType as o } from "./ChartTypes.es.js";
|
|
3
|
+
import { Formatter as i } from "@sarafapp/iron_core";
|
|
4
|
+
class p extends s {
|
|
5
|
+
constructor(t) {
|
|
6
|
+
super(o.DONUT, t);
|
|
7
|
+
}
|
|
8
|
+
completeData() {
|
|
9
|
+
var t;
|
|
10
|
+
return (t = this.settings.xAxisCategories) != null && t.length ? this.rawData.map((a) => {
|
|
11
|
+
const r = new Map(a.map((e) => [e.label, e]));
|
|
12
|
+
return this.settings.xAxisCategories.map(
|
|
13
|
+
(e) => r.get(e) || { label: e, value: null }
|
|
14
|
+
);
|
|
15
|
+
}) : this.rawData;
|
|
16
|
+
}
|
|
17
|
+
generateSeries() {
|
|
18
|
+
return this.rawData && this.rawData.length > 0 && this.rawData[0] ? this.rawData[0].map((t) => t.value ?? 0) : [];
|
|
19
|
+
}
|
|
20
|
+
generateOptions() {
|
|
21
|
+
var a;
|
|
22
|
+
const t = this.generateCommonOptions();
|
|
23
|
+
if ((a = this.settings.xAxisCategories) != null && a.length)
|
|
24
|
+
t.labels = this.settings.xAxisCategories;
|
|
25
|
+
else {
|
|
26
|
+
t.labels = [];
|
|
27
|
+
const r = this.rawData[0] || [];
|
|
28
|
+
for (const e of r)
|
|
29
|
+
t.labels.push(e.label);
|
|
30
|
+
}
|
|
31
|
+
return t;
|
|
32
|
+
}
|
|
33
|
+
setTotalValue(t) {
|
|
34
|
+
this.options.plotOptions = {
|
|
35
|
+
pie: {
|
|
36
|
+
donut: {
|
|
37
|
+
background: "#fff1f3",
|
|
38
|
+
labels: {
|
|
39
|
+
show: !0,
|
|
40
|
+
total: {
|
|
41
|
+
show: !0,
|
|
42
|
+
showAlways: !0,
|
|
43
|
+
label: t,
|
|
44
|
+
fontSize: "14px",
|
|
45
|
+
fontFamily: "IRANSansX",
|
|
46
|
+
fontWeight: 600,
|
|
47
|
+
color: "#16191d",
|
|
48
|
+
formatter: function(a) {
|
|
49
|
+
return i.toCurrencyWithDotSeparator(
|
|
50
|
+
a.globals.seriesTotals.reduce((r, e) => r + e, 0)
|
|
51
|
+
);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
export {
|
|
61
|
+
p as DonutChartDataSource
|
|
62
|
+
};
|