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