@sarafapp/ant-design 1.0.25 → 1.0.27
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/baseForm/SarafNumberFiled.vue.d.ts +2 -0
- package/dist/baseForm/SarafNumberFiled.vue.es.js +1 -1
- package/dist/baseForm/SarafNumberFiled.vue.es2.js +39 -33
- package/dist/baseForm/SarafSearchFiled.vue.es.js +13 -12
- package/dist/baseForm/SarafSelect.vue.d.ts +2 -0
- package/dist/baseForm/SarafSelect.vue.es.js +1 -1
- package/dist/baseForm/SarafSelect.vue.es2.js +73 -69
- package/dist/baseTable/SarafPriceTableCell.vue.es.js +3 -3
- package/dist/baseTable/SarafPriceTableCell.vue.es2.js +10 -10
- package/dist/baseTable/SarafTable.vue.es.js +1 -1
- package/dist/baseTable/SarafTable.vue.es2.js +194 -166
- package/dist/baseTable/SarafTableGenerator.vue.es.js +3 -3
- package/dist/baseTable/SarafTableGenerator.vue.es2.js +130 -115
- package/dist/baseTable/SarafTradeSymbolPriceCell.vue.es.js +1 -1
- package/dist/baseTable/SarafTradeSymbolPriceCell.vue.es2.js +25 -23
- package/dist/index.js +4 -4
- package/dist/style.css +1 -1
- package/package.json +2 -2
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { SelectableTableGenerator as
|
|
3
|
-
import
|
|
4
|
-
const
|
|
5
|
-
key:
|
|
1
|
+
import { defineComponent as _e, ref as u, computed as d, onBeforeMount as ge, onBeforeUpdate as ve, onBeforeUnmount as Te, resolveComponent as p, createBlock as _, openBlock as o, createSlots as we, withCtx as l, createElementBlock as s, createCommentVNode as g, unref as m, toDisplayString as S, normalizeClass as ke, resolveDynamicComponent as be, normalizeProps as Ae, mergeProps as Ie, createVNode as h, createElementVNode as Re, Fragment as w, renderList as j, withModifiers as Oe, createTextVNode as k, renderSlot as Pe } from "vue";
|
|
2
|
+
import { SelectableTableGenerator as Ne, TableConstants as b, CellType as y, HeaderType as xe, SortDetail as Ee, SortOrderTableHeader as Le, SortOrder as q, TABLE_ACTION_COLUMN as Be, isOnlyOneItem as De, isLastItem as ze } from "@sarafapp/iron_core";
|
|
3
|
+
import Me from "../dataDisplay/tooltip/SarafTooltip.vue.es.js";
|
|
4
|
+
const Ve = { key: 0 }, He = ["onClick"], Ue = {
|
|
5
|
+
key: 1,
|
|
6
6
|
class: "action-column"
|
|
7
|
-
},
|
|
7
|
+
}, We = /* @__PURE__ */ _e({
|
|
8
8
|
__name: "SarafTableGenerator",
|
|
9
9
|
props: {
|
|
10
10
|
dataSource: {},
|
|
@@ -12,209 +12,224 @@ const Be = { key: 0 }, De = {
|
|
|
12
12
|
tableConfig: {},
|
|
13
13
|
hasInitialLoad: { type: Boolean, default: !0 }
|
|
14
14
|
},
|
|
15
|
-
setup(
|
|
16
|
-
const t =
|
|
17
|
-
total:
|
|
18
|
-
current:
|
|
15
|
+
setup(J) {
|
|
16
|
+
const t = J, A = u(""), i = u([]), I = u([]), R = u([]), C = u(), v = d(() => t.dataSource instanceof Ne), O = d(() => i.value.length > b.MINIMAL_LOADABLE_HEADER_COUNT), P = u(0), N = u(0), x = u(0), E = u(!1), Q = d(() => ({
|
|
17
|
+
total: P.value,
|
|
18
|
+
current: N.value,
|
|
19
19
|
showLessItems: !0,
|
|
20
20
|
showTotal(e) {
|
|
21
21
|
return "تعداد کل: " + e;
|
|
22
22
|
},
|
|
23
23
|
defaultPageSize: b.DEFAULT_ITEM_COUNT_PER_PAGE,
|
|
24
|
-
pageSize:
|
|
24
|
+
pageSize: x.value,
|
|
25
25
|
position: [b.PAGINATION_POSITION]
|
|
26
|
-
})), L =
|
|
26
|
+
})), L = d(() => {
|
|
27
27
|
var e;
|
|
28
|
-
return ((e =
|
|
29
|
-
}),
|
|
30
|
-
onSelect:
|
|
31
|
-
onSelectAll:
|
|
28
|
+
return ((e = i.value[i.value.length - 1]) == null ? void 0 : e.cellType) === y.ACTION;
|
|
29
|
+
}), X = d(() => v.value ? {
|
|
30
|
+
onSelect: te,
|
|
31
|
+
onSelectAll: ae,
|
|
32
32
|
selectedRowKeys: R.value
|
|
33
|
-
} : null),
|
|
34
|
-
function
|
|
35
|
-
|
|
36
|
-
k.value = o.scrollWidth > o.clientWidth ? o.innerText : "";
|
|
33
|
+
} : null), Y = d(() => !!C.value.summaryItems.length);
|
|
34
|
+
function B(e) {
|
|
35
|
+
return e.onClick;
|
|
37
36
|
}
|
|
38
|
-
function
|
|
37
|
+
function D(e) {
|
|
38
|
+
return e.cellType !== y.ACTION && typeof B(e) == "function";
|
|
39
|
+
}
|
|
40
|
+
async function Z(e, n, r) {
|
|
41
|
+
D(e) && (r.stopPropagation(), await B(e)(n));
|
|
42
|
+
}
|
|
43
|
+
function ee(e) {
|
|
44
|
+
const n = e.currentTarget;
|
|
45
|
+
A.value = n.scrollWidth > n.clientWidth ? n.innerText : "";
|
|
46
|
+
}
|
|
47
|
+
function te(e) {
|
|
39
48
|
t.dataSource.selectRow(e);
|
|
40
49
|
}
|
|
41
|
-
function
|
|
50
|
+
function ae() {
|
|
42
51
|
t.dataSource.selectAll();
|
|
43
52
|
}
|
|
44
|
-
async function
|
|
45
|
-
if (e && await t.dataSource.paginate(e.current, e.pageSize),
|
|
46
|
-
const
|
|
47
|
-
|
|
48
|
-
|
|
53
|
+
async function ne(e, n, r) {
|
|
54
|
+
if (e && await t.dataSource.paginate(e.current, e.pageSize), r != null && r.columnKey) {
|
|
55
|
+
const T = new Ee(
|
|
56
|
+
r.columnKey,
|
|
57
|
+
oe(r.order)
|
|
49
58
|
);
|
|
50
|
-
await t.dataSource.sort(
|
|
59
|
+
await t.dataSource.sort(T);
|
|
51
60
|
}
|
|
52
61
|
}
|
|
53
|
-
function
|
|
54
|
-
return e ===
|
|
62
|
+
function oe(e) {
|
|
63
|
+
return e === Le.ASC ? q.ASC : q.DESC;
|
|
55
64
|
}
|
|
56
|
-
async function
|
|
57
|
-
t.hasInitialLoad && await t.dataSource.load(),
|
|
65
|
+
async function le() {
|
|
66
|
+
t.hasInitialLoad && await t.dataSource.load(), z();
|
|
58
67
|
}
|
|
59
|
-
function
|
|
68
|
+
function z() {
|
|
60
69
|
const e = t.dataSource.hasAnyAction();
|
|
61
|
-
e && !L.value &&
|
|
70
|
+
e && !L.value && re(), !e && L.value && ce();
|
|
62
71
|
}
|
|
63
|
-
function
|
|
64
|
-
|
|
72
|
+
function re() {
|
|
73
|
+
i.value.push(Be);
|
|
65
74
|
}
|
|
66
|
-
function
|
|
67
|
-
|
|
75
|
+
function ce() {
|
|
76
|
+
i.value.pop();
|
|
68
77
|
}
|
|
69
|
-
function
|
|
78
|
+
function ue(e) {
|
|
70
79
|
t.dataSource.handleClick(e);
|
|
71
80
|
}
|
|
72
|
-
function
|
|
81
|
+
function ie(e) {
|
|
73
82
|
t.dataSource.handleMetaClick(e);
|
|
74
83
|
}
|
|
75
|
-
function
|
|
84
|
+
function se(e) {
|
|
76
85
|
t.dataSource.handleDoubleClick(e);
|
|
77
86
|
}
|
|
78
|
-
function
|
|
87
|
+
function de(e) {
|
|
79
88
|
return {
|
|
80
|
-
onClick(
|
|
81
|
-
|
|
89
|
+
onClick(n) {
|
|
90
|
+
n.metaKey ? ie(e) : ue(e);
|
|
82
91
|
},
|
|
83
92
|
onDblclick() {
|
|
84
|
-
|
|
93
|
+
se(e);
|
|
85
94
|
}
|
|
86
95
|
};
|
|
87
96
|
}
|
|
88
|
-
function
|
|
97
|
+
function pe(e) {
|
|
89
98
|
return e.id;
|
|
90
99
|
}
|
|
91
|
-
function
|
|
92
|
-
return !
|
|
93
|
-
}
|
|
94
|
-
function de(e, o) {
|
|
95
|
-
return e.getProps ? e.getProps(o) : null;
|
|
100
|
+
function fe(e, n) {
|
|
101
|
+
return !De(e) && !ze(e, n);
|
|
96
102
|
}
|
|
97
|
-
function
|
|
98
|
-
|
|
103
|
+
function me(e, n) {
|
|
104
|
+
return e.getProps ? e.getProps(n) : null;
|
|
99
105
|
}
|
|
100
|
-
function M(
|
|
101
|
-
|
|
102
|
-
}
|
|
103
|
-
function z(e) {
|
|
104
|
-
I.value = e;
|
|
106
|
+
function M() {
|
|
107
|
+
C.value = t.dataSource.loadSummarySchema();
|
|
105
108
|
}
|
|
106
109
|
function V(e) {
|
|
107
|
-
|
|
110
|
+
i.value = e;
|
|
108
111
|
}
|
|
109
112
|
function H(e) {
|
|
110
|
-
|
|
113
|
+
I.value = e;
|
|
111
114
|
}
|
|
112
115
|
function U(e) {
|
|
113
|
-
|
|
116
|
+
R.value = t.dataSource.getSelectedRowIds();
|
|
114
117
|
}
|
|
115
118
|
function K(e) {
|
|
116
|
-
|
|
119
|
+
P.value = e;
|
|
117
120
|
}
|
|
118
121
|
function G(e) {
|
|
119
122
|
N.value = e;
|
|
120
123
|
}
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
124
|
+
function $(e) {
|
|
125
|
+
x.value = e;
|
|
126
|
+
}
|
|
127
|
+
function F(e) {
|
|
128
|
+
E.value = e;
|
|
129
|
+
}
|
|
130
|
+
return ge(() => {
|
|
131
|
+
le(), M(), t.dataSource.headerSchema.attach(V), t.dataSource.rows.attach(H), t.dataSource.currentPage.attach(G), t.dataSource.currentPageSize.attach($), t.dataSource.totalItems.attach(K), t.dataSource.isExpandable.attach(F), v.value && t.dataSource.selectedRows.attach(U);
|
|
132
|
+
}), ve(() => {
|
|
133
|
+
z(), M();
|
|
134
|
+
}), Te(() => {
|
|
135
|
+
t.dataSource.onDestroy(), t.dataSource.headerSchema.detach(V), t.dataSource.rows.detach(H), t.dataSource.currentPage.detach(G), t.dataSource.currentPageSize.detach($), t.dataSource.totalItems.detach(K), t.dataSource.isExpandable.detach(F), v.value && t.dataSource.selectedRows.detach(U);
|
|
136
|
+
}), (e, n) => {
|
|
137
|
+
const r = p("a-button"), T = p("a-divider"), W = p("a-table-summary-cell"), Se = p("a-typography-text"), he = p("a-table-summary-row"), ye = p("a-table");
|
|
138
|
+
return o(), _(ye, {
|
|
139
|
+
columns: i.value,
|
|
131
140
|
"data-source": I.value,
|
|
132
|
-
pagination:
|
|
133
|
-
"custom-row":
|
|
134
|
-
"row-key":
|
|
141
|
+
pagination: Q.value,
|
|
142
|
+
"custom-row": de,
|
|
143
|
+
"row-key": pe,
|
|
135
144
|
loading: t.isLoading,
|
|
136
145
|
scroll: t.dataSource.scrollDetail,
|
|
137
|
-
"row-selection":
|
|
146
|
+
"row-selection": X.value,
|
|
138
147
|
class: "saraf-table",
|
|
139
|
-
onChange:
|
|
140
|
-
},
|
|
141
|
-
|
|
148
|
+
onChange: ne
|
|
149
|
+
}, we({ _: 2 }, [
|
|
150
|
+
O.value ? {
|
|
142
151
|
name: "headerCell",
|
|
143
152
|
fn: l(({ column: a }) => [
|
|
144
|
-
a.headerType ===
|
|
153
|
+
a.headerType === m(xe).Text ? (o(), s("span", Ve, S(a.title), 1)) : g("", !0)
|
|
145
154
|
]),
|
|
146
155
|
key: "0"
|
|
147
156
|
} : void 0,
|
|
148
|
-
|
|
157
|
+
O.value ? {
|
|
149
158
|
name: "bodyCell",
|
|
150
159
|
fn: l(({ column: a, record: c }) => [
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
ref: "tooltipTarget",
|
|
156
|
-
class: "ellipsis-cell",
|
|
157
|
-
onMouseenter: X
|
|
160
|
+
a.cellType !== m(y).ACTION ? (o(), s("div", {
|
|
161
|
+
key: 0,
|
|
162
|
+
class: ke(["saraf-table-cell", { "clickable-cell": D(a) }]),
|
|
163
|
+
onClick: (f) => Z(a, c, f)
|
|
158
164
|
}, [
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
165
|
+
t.tableConfig.getCellComponentRegistry().getRegisteredComponents().has(a.cellType) ? (o(), _(be(
|
|
166
|
+
t.tableConfig.getCellComponentRegistry().getRegisteredComponents().get(a.cellType)
|
|
167
|
+
), Ae(Ie({ key: 0 }, { ...me(a, c), data: c[a.path] })), null, 16)) : a.cellType === m(y).Text ? (o(), s("div", {
|
|
168
|
+
key: 1,
|
|
169
|
+
ref: "tooltipTarget",
|
|
170
|
+
class: "ellipsis-cell",
|
|
171
|
+
onMouseenter: ee
|
|
172
|
+
}, [
|
|
173
|
+
h(m(Me), { title: A.value }, {
|
|
174
|
+
default: l(() => [
|
|
175
|
+
Re("span", null, S(c[a.path]), 1)
|
|
176
|
+
]),
|
|
177
|
+
_: 2
|
|
178
|
+
}, 1032, ["title"])
|
|
179
|
+
], 544)) : g("", !0)
|
|
180
|
+
], 10, He)) : a.cellType === m(y).ACTION ? (o(), s("span", Ue, [
|
|
181
|
+
(o(!0), s(w, null, j(t.dataSource.getRowActions(c), (f, Ce) => (o(), s(w, {
|
|
182
|
+
key: f.actionName
|
|
168
183
|
}, [
|
|
169
|
-
|
|
184
|
+
h(r, {
|
|
170
185
|
type: "link",
|
|
171
|
-
onClick:
|
|
186
|
+
onClick: Oe((Ke) => f.handler(c), ["stop"])
|
|
172
187
|
}, {
|
|
173
188
|
default: l(() => [
|
|
174
|
-
|
|
189
|
+
k(S(f.actionName), 1)
|
|
175
190
|
]),
|
|
176
191
|
_: 2
|
|
177
192
|
}, 1032, ["onClick"]),
|
|
178
|
-
|
|
193
|
+
fe(
|
|
179
194
|
t.dataSource.getRowActions(c).length,
|
|
180
|
-
|
|
181
|
-
) ? (
|
|
195
|
+
Ce
|
|
196
|
+
) ? (o(), _(T, {
|
|
182
197
|
key: 0,
|
|
183
198
|
type: "vertical"
|
|
184
|
-
})) :
|
|
199
|
+
})) : g("", !0)
|
|
185
200
|
], 64))), 128))
|
|
186
|
-
])) :
|
|
201
|
+
])) : g("", !0)
|
|
187
202
|
]),
|
|
188
203
|
key: "1"
|
|
189
204
|
} : void 0,
|
|
190
|
-
|
|
205
|
+
E.value ? {
|
|
191
206
|
name: "expandedRowRender",
|
|
192
207
|
fn: l(({ record: a }) => [
|
|
193
|
-
|
|
208
|
+
Pe(e.$slots, "expandedRowRender", {
|
|
194
209
|
row: a
|
|
195
210
|
}, void 0, !0)
|
|
196
211
|
]),
|
|
197
212
|
key: "2"
|
|
198
213
|
} : void 0,
|
|
199
|
-
|
|
214
|
+
Y.value ? {
|
|
200
215
|
name: "summary",
|
|
201
216
|
fn: l(() => [
|
|
202
|
-
|
|
217
|
+
h(he, null, {
|
|
203
218
|
default: l(() => [
|
|
204
|
-
|
|
219
|
+
h(W, null, {
|
|
205
220
|
default: l(() => [
|
|
206
|
-
|
|
221
|
+
k(S(C.value.summaryTitle), 1)
|
|
207
222
|
]),
|
|
208
223
|
_: 1
|
|
209
224
|
}),
|
|
210
|
-
(
|
|
225
|
+
(o(!0), s(w, null, j(C.value.summaryItems, (a, c) => (o(), _(W, {
|
|
211
226
|
key: c,
|
|
212
227
|
align: a.align
|
|
213
228
|
}, {
|
|
214
229
|
default: l(() => [
|
|
215
|
-
|
|
230
|
+
h(Se, null, {
|
|
216
231
|
default: l(() => [
|
|
217
|
-
|
|
232
|
+
k(S(a.data), 1)
|
|
218
233
|
]),
|
|
219
234
|
_: 2
|
|
220
235
|
}, 1024)
|
|
@@ -232,5 +247,5 @@ const Be = { key: 0 }, De = {
|
|
|
232
247
|
}
|
|
233
248
|
});
|
|
234
249
|
export {
|
|
235
|
-
|
|
250
|
+
We as default
|
|
236
251
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./SarafTradeSymbolPriceCell.vue.es2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import r from "../_virtual/_plugin-vue_export-helper.es.js";
|
|
4
|
-
const m = /* @__PURE__ */ r(o, [["__scopeId", "data-v-
|
|
4
|
+
const m = /* @__PURE__ */ r(o, [["__scopeId", "data-v-8956da6c"]]);
|
|
5
5
|
export {
|
|
6
6
|
m as default
|
|
7
7
|
};
|
|
@@ -1,32 +1,34 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { Symbols as
|
|
3
|
-
const
|
|
1
|
+
import { defineComponent as l, createElementBlock as r, openBlock as s, Fragment as i, createElementVNode as o, toDisplayString as n, unref as a } from "vue";
|
|
2
|
+
import { Symbols as m } from "@sarafapp/iron_core";
|
|
3
|
+
const d = { class: "saraf-symbol-price-in-trade" }, y = { key: 0 }, b = ["src", "alt"], _ = { key: 1 }, p = { key: 2 }, P = ["src", "alt"], T = { key: 3 }, u = { key: 1 }, k = /* @__PURE__ */ l({
|
|
4
4
|
__name: "SarafTradeSymbolPriceCell",
|
|
5
5
|
props: {
|
|
6
6
|
symbolPriceInTrade: {}
|
|
7
7
|
},
|
|
8
|
-
setup(
|
|
9
|
-
const
|
|
10
|
-
return (
|
|
11
|
-
e(
|
|
12
|
-
e("
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
e("
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
8
|
+
setup(c) {
|
|
9
|
+
const e = c;
|
|
10
|
+
return (I, t) => (s(), r("div", d, [
|
|
11
|
+
e.symbolPriceInTrade.USDTPrice || e.symbolPriceInTrade.symbolPrice ? (s(), r(i, { key: 0 }, [
|
|
12
|
+
e.symbolPriceInTrade.symbolPrice ? (s(), r("div", y, [
|
|
13
|
+
o("img", {
|
|
14
|
+
src: e.symbolPriceInTrade.symbolImage,
|
|
15
|
+
alt: e.symbolPriceInTrade.symobl
|
|
16
|
+
}, null, 8, b),
|
|
17
|
+
o("p", null, n(e.symbolPriceInTrade.truncatedSymbolPrice), 1),
|
|
18
|
+
t[0] || (t[0] = o("p", { class: "currency" }, "دلار", -1))
|
|
19
|
+
])) : (s(), r("div", _, "-")),
|
|
20
|
+
e.symbolPriceInTrade.USDTPrice ? (s(), r("div", p, [
|
|
21
|
+
o("img", {
|
|
22
|
+
src: e.symbolPriceInTrade.USDTImage,
|
|
23
|
+
alt: a(m).USDT
|
|
24
|
+
}, null, 8, P),
|
|
25
|
+
o("p", null, n(e.symbolPriceInTrade.truncatedUSDTPrice), 1),
|
|
26
|
+
t[1] || (t[1] = o("p", { class: "currency" }, "تومان", -1))
|
|
27
|
+
])) : (s(), r("div", T, "-"))
|
|
28
|
+
], 64)) : (s(), r("p", u, "-"))
|
|
27
29
|
]));
|
|
28
30
|
}
|
|
29
31
|
});
|
|
30
32
|
export {
|
|
31
|
-
|
|
33
|
+
k as default
|
|
32
34
|
};
|