@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.
@@ -1,10 +1,10 @@
1
- import { defineComponent as he, ref as r, computed as i, onBeforeMount as ye, onBeforeUpdate as _e, onBeforeUnmount as ge, resolveComponent as d, createBlock as h, openBlock as n, createSlots as ve, withCtx as l, createElementBlock as p, createCommentVNode as C, unref as y, toDisplayString as m, resolveDynamicComponent as Ce, normalizeProps as Te, mergeProps as we, createVNode as f, createElementVNode as be, Fragment as T, renderList as F, withModifiers as Ae, createTextVNode as w, renderSlot as ke } from "vue";
2
- import { SelectableTableGenerator as Ie, TableConstants as b, CellType as A, HeaderType as Re, SortDetail as Pe, SortOrderTableHeader as xe, SortOrder as W, TABLE_ACTION_COLUMN as Ee, isOnlyOneItem as Oe, isLastItem as Ne } from "@sarafapp/iron_core";
3
- import Le from "../dataDisplay/tooltip/SarafTooltip.vue.es.js";
4
- const Be = { key: 0 }, De = {
5
- key: 2,
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
- }, Ue = /* @__PURE__ */ he({
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(j) {
16
- const t = j, k = r(""), u = r([]), I = r([]), R = r([]), S = r(), _ = i(() => t.dataSource instanceof Ie), P = i(() => u.value.length > b.MINIMAL_LOADABLE_HEADER_COUNT), x = r(0), E = r(0), O = r(0), N = r(!1), q = i(() => ({
17
- total: x.value,
18
- current: E.value,
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: O.value,
24
+ pageSize: x.value,
25
25
  position: [b.PAGINATION_POSITION]
26
- })), L = i(() => {
26
+ })), L = d(() => {
27
27
  var e;
28
- return ((e = u.value[u.value.length - 1]) == null ? void 0 : e.cellType) === A.ACTION;
29
- }), J = i(() => _.value ? {
30
- onSelect: Y,
31
- onSelectAll: Z,
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), Q = i(() => !!S.value.summaryItems.length);
34
- function X(e) {
35
- const o = e.currentTarget;
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 Y(e) {
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 Z() {
50
+ function ae() {
42
51
  t.dataSource.selectAll();
43
52
  }
44
- async function ee(e, o, s) {
45
- if (e && await t.dataSource.paginate(e.current, e.pageSize), s != null && s.columnKey) {
46
- const g = new Pe(
47
- s.columnKey,
48
- te(s.order)
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(g);
59
+ await t.dataSource.sort(T);
51
60
  }
52
61
  }
53
- function te(e) {
54
- return e === xe.ASC ? W.ASC : W.DESC;
62
+ function oe(e) {
63
+ return e === Le.ASC ? q.ASC : q.DESC;
55
64
  }
56
- async function ae() {
57
- t.hasInitialLoad && await t.dataSource.load(), B();
65
+ async function le() {
66
+ t.hasInitialLoad && await t.dataSource.load(), z();
58
67
  }
59
- function B() {
68
+ function z() {
60
69
  const e = t.dataSource.hasAnyAction();
61
- e && !L.value && oe(), !e && L.value && ne();
70
+ e && !L.value && re(), !e && L.value && ce();
62
71
  }
63
- function oe() {
64
- u.value.push(Ee);
72
+ function re() {
73
+ i.value.push(Be);
65
74
  }
66
- function ne() {
67
- u.value.pop();
75
+ function ce() {
76
+ i.value.pop();
68
77
  }
69
- function le(e) {
78
+ function ue(e) {
70
79
  t.dataSource.handleClick(e);
71
80
  }
72
- function re(e) {
81
+ function ie(e) {
73
82
  t.dataSource.handleMetaClick(e);
74
83
  }
75
- function ce(e) {
84
+ function se(e) {
76
85
  t.dataSource.handleDoubleClick(e);
77
86
  }
78
- function ue(e) {
87
+ function de(e) {
79
88
  return {
80
- onClick(o) {
81
- o.metaKey ? re(e) : le(e);
89
+ onClick(n) {
90
+ n.metaKey ? ie(e) : ue(e);
82
91
  },
83
92
  onDblclick() {
84
- ce(e);
93
+ se(e);
85
94
  }
86
95
  };
87
96
  }
88
- function se(e) {
97
+ function pe(e) {
89
98
  return e.id;
90
99
  }
91
- function ie(e, o) {
92
- return !Oe(e) && !Ne(e, o);
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 D() {
98
- S.value = t.dataSource.loadSummarySchema();
103
+ function me(e, n) {
104
+ return e.getProps ? e.getProps(n) : null;
99
105
  }
100
- function M(e) {
101
- u.value = e;
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
- R.value = t.dataSource.getSelectedRowIds();
110
+ i.value = e;
108
111
  }
109
112
  function H(e) {
110
- x.value = e;
113
+ I.value = e;
111
114
  }
112
115
  function U(e) {
113
- E.value = e;
116
+ R.value = t.dataSource.getSelectedRowIds();
114
117
  }
115
118
  function K(e) {
116
- O.value = e;
119
+ P.value = e;
117
120
  }
118
121
  function G(e) {
119
122
  N.value = e;
120
123
  }
121
- return ye(() => {
122
- ae(), D(), t.dataSource.headerSchema.attach(M), t.dataSource.rows.attach(z), t.dataSource.currentPage.attach(U), t.dataSource.currentPageSize.attach(K), t.dataSource.totalItems.attach(H), t.dataSource.isExpandable.attach(G), _.value && t.dataSource.selectedRows.attach(V);
123
- }), _e(() => {
124
- B(), D();
125
- }), ge(() => {
126
- t.dataSource.onDestroy(), t.dataSource.headerSchema.detach(M), t.dataSource.rows.detach(z), t.dataSource.currentPage.detach(U), t.dataSource.currentPageSize.detach(K), t.dataSource.totalItems.detach(H), t.dataSource.isExpandable.detach(G), _.value && t.dataSource.selectedRows.detach(V);
127
- }), (e, o) => {
128
- const s = d("a-button"), g = d("a-divider"), $ = d("a-table-summary-cell"), pe = d("a-typography-text"), me = d("a-table-summary-row"), fe = d("a-table");
129
- return n(), h(fe, {
130
- columns: u.value,
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: q.value,
133
- "custom-row": ue,
134
- "row-key": se,
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": J.value,
146
+ "row-selection": X.value,
138
147
  class: "saraf-table",
139
- onChange: ee
140
- }, ve({ _: 2 }, [
141
- P.value ? {
148
+ onChange: ne
149
+ }, we({ _: 2 }, [
150
+ O.value ? {
142
151
  name: "headerCell",
143
152
  fn: l(({ column: a }) => [
144
- a.headerType === y(Re).Text ? (n(), p("span", Be, m(a.title), 1)) : C("", !0)
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
- P.value ? {
157
+ O.value ? {
149
158
  name: "bodyCell",
150
159
  fn: l(({ column: a, record: c }) => [
151
- t.tableConfig.getCellComponentRegistry().getRegisteredComponents().has(a.cellType) ? (n(), h(Ce(
152
- t.tableConfig.getCellComponentRegistry().getRegisteredComponents().get(a.cellType)
153
- ), Te(we({ key: 0 }, { ...de(a, c), data: c[a.path] })), null, 16)) : a.cellType === y(A).Text ? (n(), p("div", {
154
- key: 1,
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
- f(y(Le), { title: k.value }, {
160
- default: l(() => [
161
- be("span", null, m(c[a.path]), 1)
162
- ]),
163
- _: 2
164
- }, 1032, ["title"])
165
- ], 544)) : a.cellType === y(A).ACTION ? (n(), p("span", De, [
166
- (n(!0), p(T, null, F(t.dataSource.getRowActions(c), (v, Se) => (n(), p(T, {
167
- key: v.actionName
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
- f(s, {
184
+ h(r, {
170
185
  type: "link",
171
- onClick: Ae((Me) => v.handler(c), ["stop"])
186
+ onClick: Oe((Ke) => f.handler(c), ["stop"])
172
187
  }, {
173
188
  default: l(() => [
174
- w(m(v.actionName), 1)
189
+ k(S(f.actionName), 1)
175
190
  ]),
176
191
  _: 2
177
192
  }, 1032, ["onClick"]),
178
- ie(
193
+ fe(
179
194
  t.dataSource.getRowActions(c).length,
180
- Se
181
- ) ? (n(), h(g, {
195
+ Ce
196
+ ) ? (o(), _(T, {
182
197
  key: 0,
183
198
  type: "vertical"
184
- })) : C("", !0)
199
+ })) : g("", !0)
185
200
  ], 64))), 128))
186
- ])) : C("", !0)
201
+ ])) : g("", !0)
187
202
  ]),
188
203
  key: "1"
189
204
  } : void 0,
190
- N.value ? {
205
+ E.value ? {
191
206
  name: "expandedRowRender",
192
207
  fn: l(({ record: a }) => [
193
- ke(e.$slots, "expandedRowRender", {
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
- Q.value ? {
214
+ Y.value ? {
200
215
  name: "summary",
201
216
  fn: l(() => [
202
- f(me, null, {
217
+ h(he, null, {
203
218
  default: l(() => [
204
- f($, null, {
219
+ h(W, null, {
205
220
  default: l(() => [
206
- w(m(S.value.summaryTitle), 1)
221
+ k(S(C.value.summaryTitle), 1)
207
222
  ]),
208
223
  _: 1
209
224
  }),
210
- (n(!0), p(T, null, F(S.value.summaryItems, (a, c) => (n(), h($, {
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
- f(pe, null, {
230
+ h(Se, null, {
216
231
  default: l(() => [
217
- w(m(a.data), 1)
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
- Ue as default
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-60c1412e"]]);
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 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({
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(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
- ])
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
- T as default
33
+ k as default
32
34
  };