@sarafapp/ant-design 1.0.25 → 1.0.26

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,205 +1,218 @@
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 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 = {
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
+ }, Ue = ["src", "alt"], He = { key: 1 }, Ke = {
18
+ key: 12,
19
+ class: "action-column"
20
+ }, tt = /* @__PURE__ */ se({
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(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
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
+ })), O = d(() => {
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 : "";
42
47
  }
43
- function z() {
48
+ function $(e) {
49
+ l.dataSource.rowSelect(e);
50
+ }
51
+ function F() {
44
52
  l.dataSource.selectAll();
45
53
  }
46
- function O() {
47
- I.value = l.dataSource.getSelectedRowIds();
54
+ function N() {
55
+ P.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(
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(
55
60
  m.columnKey,
56
- G(m.order)
61
+ W(m.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 W(e) {
67
+ return e === ve.ASC ? L.ASC : L.DESC;
63
68
  }
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();
69
+ async function j() {
70
+ await l.dataSource.load(), R();
71
71
  }
72
- function j() {
73
- d.value.push(_e);
72
+ function R() {
73
+ p.value = l.dataSource.headerSchema;
74
+ const e = l.dataSource.hasAnyAction();
75
+ e && !O.value && q(), !e && O.value && J();
74
76
  }
75
77
  function q() {
76
- d.value.pop();
78
+ p.value.push(Ce);
79
+ }
80
+ function J() {
81
+ p.value.pop();
77
82
  }
78
- function J(a) {
79
- l.dataSource.handleClick(a);
83
+ function Q(e) {
84
+ l.dataSource.handleClick(e);
80
85
  }
81
- function Q(a) {
82
- l.dataSource.handleMetaClick(a);
86
+ function X(e) {
87
+ l.dataSource.handleMetaClick(e);
83
88
  }
84
- function W(a) {
85
- l.dataSource.handleDoubleClick(a);
89
+ function Y(e) {
90
+ l.dataSource.handleDoubleClick(e);
86
91
  }
87
- function X(a) {
92
+ function Z(e) {
88
93
  return {
89
- onClick(p) {
90
- p.metaKey ? Q(a) : J(a);
94
+ onClick(c) {
95
+ c.metaKey ? X(e) : Q(e);
91
96
  },
92
97
  onDblclick() {
93
- W(a);
98
+ Y(e);
94
99
  }
95
100
  };
96
101
  }
97
- function Y(a) {
98
- return a.id;
102
+ function ee(e) {
103
+ return e.id;
99
104
  }
100
- function Z(a, p) {
101
- return !be(a) && !Ce(a, p);
105
+ function te(e, c) {
106
+ return !ge(e) && !ke(e, c);
102
107
  }
103
- function ee(a, p) {
104
- return a.getProps ? a.getProps(p) : null;
108
+ function ae(e, c) {
109
+ return e.getProps ? e.getProps(c) : null;
105
110
  }
106
- function ae() {
107
- T.value && l.dataSource.selectedRows.attach(
108
- O
109
- );
111
+ function le() {
112
+ _.value && l.dataSource.selectedRows.attach(N);
110
113
  }
111
- function te() {
112
- T.value && l.dataSource.selectedRows.detach(
113
- O
114
- );
114
+ function ne() {
115
+ _.value && l.dataSource.selectedRows.detach(N);
115
116
  }
116
- function R() {
117
- S.value = l.dataSource.loadSummarySchema();
117
+ function x() {
118
+ T.value = l.dataSource.loadSummarySchema();
118
119
  }
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,
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,
134
135
  scroll: l.dataSource.getScrollDetail(),
135
- "row-selection": H.value,
136
+ "row-selection": K.value,
136
137
  class: "saraf-table",
137
- onChange: F
138
- }, de({ _: 2 }, [
139
- P.value ? {
138
+ onChange: G
139
+ }, me({ _: 2 }, [
140
+ D.value ? {
140
141
  name: "headerCell",
141
- fn: c(({ column: e }) => [
142
- e.headerType === t(Se).Text ? (n(), s("span", Re, f(e.title), 1)) : g("", !0)
142
+ fn: s(({ column: t }) => [
143
+ t.headerType === a(_e).Text ? (n(), u("span", Le, f(t.title), 1)) : g("", !0)
143
144
  ]),
144
145
  key: "0"
145
146
  } : void 0,
146
- P.value ? {
147
+ D.value ? {
147
148
  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({
149
+ fn: s(({ column: t, record: o }) => [
150
+ t.cellType === a(r).Text ? (n(), u("div", {
151
+ key: 0,
152
+ ref: "tooltipTarget",
153
+ class: "ellipsis-cell",
154
+ onMouseenter: z
155
+ }, [
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({
150
163
  key: 1,
151
- content: o[e.path]
152
- }, ee(e, o)), null, 16, ["content"])) : e.cellType === t(r).BankCard ? (n(), i(t(ge), {
164
+ content: o[t.path]
165
+ }, ae(t, o)), null, 16, ["content"])) : t.cellType === a(r).BankCard ? (n(), i(a(Ie), {
153
166
  key: 2,
154
- "card-number": o[e.path]
155
- }, null, 8, ["card-number"])) : e.cellType === t(r).Iban ? (n(), i(t(ke), {
167
+ "card-number": o[t.path]
168
+ }, null, 8, ["card-number"])) : t.cellType === a(r).Iban ? (n(), i(a(Pe), {
156
169
  key: 3,
157
- iban: o[e.path]
158
- }, null, 8, ["iban"])) : e.cellType === t(r).Symbol ? (n(), i(t(Ae), {
170
+ iban: o[t.path]
171
+ }, null, 8, ["iban"])) : t.cellType === a(r).Symbol ? (n(), i(a(De), {
159
172
  key: 4,
160
- symbol: o[e.path]
161
- }, null, 8, ["symbol"])) : e.cellType === t(r).TradeDetail ? (n(), i(t(we), {
173
+ symbol: o[t.path]
174
+ }, null, 8, ["symbol"])) : t.cellType === a(r).TradeDetail ? (n(), i(a(Oe), {
162
175
  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), {
176
+ "symbol-trade-amount-detail": o[t.path]
177
+ }, null, 8, ["symbol-trade-amount-detail"])) : t.cellType === a(r).SymbolPrice ? (n(), i(a(Ne), {
165
178
  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), {
179
+ "symbol-price-in-trade": o[t.path]
180
+ }, null, 8, ["symbol-price-in-trade"])) : t.cellType === a(r).TradeSymbol ? (n(), i(a(Re), {
168
181
  key: 7,
169
- "symbol-in-trade": o[e.path]
170
- }, null, 8, ["symbol-in-trade"])) : e.cellType === t(r).TradeDate ? (n(), i(t(De), {
182
+ "symbol-in-trade": o[t.path]
183
+ }, null, 8, ["symbol-in-trade"])) : t.cellType === a(r).TradeDate ? (n(), i(a(xe), {
171
184
  key: 8,
172
- "trade-date": o[e.path]
173
- }, null, 8, ["trade-date"])) : e.cellType === t(r).Price ? (n(), i(t(Oe), {
185
+ "trade-date": o[t.path]
186
+ }, null, 8, ["trade-date"])) : t.cellType === a(r).Price ? (n(), i(a(Ee), {
174
187
  key: 9,
175
- price: o[e.path]
176
- }, null, 8, ["price"])) : e.cellType === t(r).DynamicCurrencyPrice ? (n(), i(t(Ne), {
188
+ price: o[t.path]
189
+ }, null, 8, ["price"])) : t.cellType === a(r).DynamicCurrencyPrice ? (n(), i(a(Be), {
177
190
  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", {
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", {
181
194
  key: 0,
182
195
  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, {
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, {
188
201
  key: C.actionName
189
202
  }, [
190
- h(m, {
203
+ S(m, {
191
204
  type: "link",
192
- onClick: me((Ue) => C.handler(o), ["stop"])
205
+ onClick: Se((Ve) => C.handler(o), ["stop"])
193
206
  }, {
194
- default: c(() => [
207
+ default: s(() => [
195
208
  A(f(C.actionName), 1)
196
209
  ]),
197
210
  _: 2
198
211
  }, 1032, ["onClick"]),
199
- Z(
212
+ te(
200
213
  l.dataSource.getAccessedActions(o).length,
201
- re
202
- ) ? (n(), i(b, {
214
+ ce
215
+ ) ? (n(), i(v, {
203
216
  key: 0,
204
217
  type: "vertical"
205
218
  })) : g("", !0)
@@ -210,32 +223,32 @@ const Re = { key: 0 }, Ee = { key: 0 }, xe = {
210
223
  } : void 0,
211
224
  l.dataSource.isExpandable() ? {
212
225
  name: "expandedRowRender",
213
- fn: c(({ record: e }) => [
214
- ye(a.$slots, "expandedRowRender", {
215
- row: e
226
+ fn: s(({ record: t }) => [
227
+ Te(e.$slots, "expandedRowRender", {
228
+ row: t
216
229
  }, void 0, !0)
217
230
  ]),
218
231
  key: "2"
219
232
  } : void 0,
220
- K.value ? {
233
+ V.value ? {
221
234
  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)
235
+ fn: s(() => [
236
+ S(re, null, {
237
+ default: s(() => [
238
+ S(E, null, {
239
+ default: s(() => [
240
+ A(f(T.value.summaryTitle), 1)
228
241
  ]),
229
242
  _: 1
230
243
  }),
231
- (n(!0), s(k, null, x(S.value.summaryItems, (e, o) => (n(), i(E, {
244
+ (n(!0), u(k, null, B(T.value.summaryItems, (t, o) => (n(), i(E, {
232
245
  key: o,
233
- align: e.align
246
+ align: t.align
234
247
  }, {
235
- default: c(() => [
236
- h(le, null, {
237
- default: c(() => [
238
- A(f(e.data), 1)
248
+ default: s(() => [
249
+ S(oe, null, {
250
+ default: s(() => [
251
+ A(f(t.data), 1)
239
252
  ]),
240
253
  _: 2
241
254
  }, 1024)
@@ -253,5 +266,5 @@ const Re = { key: 0 }, Ee = { key: 0 }, xe = {
253
266
  }
254
267
  });
255
268
  export {
256
- Xe as default
269
+ tt as default
257
270
  };
@@ -1,6 +1,8 @@
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<{} & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, never>, never> & {
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"> & {
4
6
  dataSource: TableGenerator<T> | SelectableTableGenerator<T>;
5
7
  isLoading: boolean;
6
8
  tableConfig: TableConfig;
@@ -13,7 +15,7 @@ declare const _default: <T>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>
13
15
  row: T;
14
16
  }): any;
15
17
  };
16
- emit: {};
18
+ emit: (event: "copy", value: string) => void;
17
19
  }>) => import('vue').VNode & {
18
20
  __ctx?: Awaited<typeof __VLS_setup>;
19
21
  };
@@ -1,7 +1,7 @@
1
1
  import o from "./SarafTableGenerator.vue.es2.js";
2
2
  /* empty css */
3
3
  import r from "../_virtual/_plugin-vue_export-helper.es.js";
4
- const f = /* @__PURE__ */ r(o, [["__scopeId", "data-v-c0f9d0ee"]]);
4
+ const f = /* @__PURE__ */ r(o, [["__scopeId", "data-v-0e014554"]]);
5
5
  export {
6
6
  f as default
7
7
  };