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