@sarafapp/ant-design 1.0.10 → 1.0.12

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.
Files changed (23) hide show
  1. package/dist/baseTable/SarafTableGenerator.vue.es.js +4 -4
  2. package/dist/baseTable/SarafTableGenerator.vue.es2.js +145 -150
  3. package/dist/index.d.ts +2 -0
  4. package/dist/index.js +4 -19
  5. package/dist/style.css +1 -1
  6. package/package.json +1 -1
  7. package/dist/node_modules/tslib/tslib.es6.es.js +0 -155
  8. package/dist/node_modules/tsyringe/dist/esm5/dependency-container.es.js +0 -256
  9. package/dist/node_modules/tsyringe/dist/esm5/error-helpers.es.js +0 -21
  10. package/dist/node_modules/tsyringe/dist/esm5/index.es.js +0 -9
  11. package/dist/node_modules/tsyringe/dist/esm5/interceptors.es.js +0 -25
  12. package/dist/node_modules/tsyringe/dist/esm5/lazy-helpers.es.js +0 -38
  13. package/dist/node_modules/tsyringe/dist/esm5/providers/class-provider.es.js +0 -6
  14. package/dist/node_modules/tsyringe/dist/esm5/providers/factory-provider.es.js +0 -6
  15. package/dist/node_modules/tsyringe/dist/esm5/providers/injection-token.es.js +0 -19
  16. package/dist/node_modules/tsyringe/dist/esm5/providers/provider.es.js +0 -10
  17. package/dist/node_modules/tsyringe/dist/esm5/providers/token-provider.es.js +0 -6
  18. package/dist/node_modules/tsyringe/dist/esm5/providers/value-provider.es.js +0 -6
  19. package/dist/node_modules/tsyringe/dist/esm5/registry-base.es.js +0 -27
  20. package/dist/node_modules/tsyringe/dist/esm5/registry.es.js +0 -12
  21. package/dist/node_modules/tsyringe/dist/esm5/resolution-context.es.js +0 -9
  22. package/dist/node_modules/tsyringe/dist/esm5/types/disposable.es.js +0 -9
  23. package/dist/node_modules/tsyringe/dist/esm5/types/lifecycle.es.js +0 -8
@@ -1,7 +1,7 @@
1
- import a from "./SarafTableGenerator.vue.es2.js";
1
+ import o from "./SarafTableGenerator.vue.es2.js";
2
2
  /* empty css */
3
- import o from "../_virtual/_plugin-vue_export-helper.es.js";
4
- const f = /* @__PURE__ */ o(a, [["__scopeId", "data-v-97dbf1ab"]]);
3
+ import r from "../_virtual/_plugin-vue_export-helper.es.js";
4
+ const e = /* @__PURE__ */ r(o, [["__scopeId", "data-v-fb4823cf"]]);
5
5
  export {
6
- f as default
6
+ e as default
7
7
  };
@@ -1,221 +1,216 @@
1
- import { defineComponent as fe, ref as r, computed as p, onBeforeMount as he, onBeforeUpdate as ye, onBeforeUnmount as _e, resolveComponent as m, createElementBlock as i, openBlock as o, Fragment as _, createTextVNode as S, createVNode as f, toDisplayString as d, createSlots as ge, withCtx as l, createCommentVNode as T, unref as h, createBlock as b, resolveDynamicComponent as ve, normalizeProps as Ce, mergeProps as we, renderList as $, withModifiers as Te, renderSlot as be } from "vue";
2
- import { SelectableTableGenerator as Ae, TableConstants as A, TableConfig as ke, CellType as k, HeaderType as Re, SortDetail as Ie, SortOrderTableHeader as Pe, SortOrder as j, TABLE_ACTION_COLUMN as Ee, isOnlyOneItem as Oe, isLastItem as xe } from "@sarafapp/iron_core";
3
- import "../node_modules/tsyringe/dist/esm5/index.es.js";
4
- import { instance as Ne } from "../node_modules/tsyringe/dist/esm5/dependency-container.es.js";
5
- const Be = { key: 0 }, De = { key: 1 }, Le = { key: 2 }, Ke = /* @__PURE__ */ fe({
1
+ import { defineComponent as Se, ref as r, computed as d, onBeforeMount as fe, onBeforeUpdate as he, onBeforeUnmount as ye, resolveComponent as i, createBlock as f, openBlock as o, createSlots as _e, withCtx as n, createElementBlock as p, createCommentVNode as v, unref as C, toDisplayString as m, resolveDynamicComponent as ge, normalizeProps as ve, mergeProps as Ce, Fragment as w, renderList as F, createVNode as h, withModifiers as we, createTextVNode as T, renderSlot as Te } from "vue";
2
+ import { SelectableTableGenerator as be, TableConstants as b, CellType as A, HeaderType as Ae, SortDetail as ke, SortOrderTableHeader as Re, SortOrder as $, TABLE_ACTION_COLUMN as Ie, isOnlyOneItem as Pe, isLastItem as Ee } from "@sarafapp/iron_core";
3
+ const Oe = { key: 0 }, xe = { key: 1 }, Ne = { key: 2 }, ze = /* @__PURE__ */ Se({
6
4
  __name: "SarafTableGenerator",
7
5
  props: {
8
6
  dataSource: {},
9
- isLoading: { type: Boolean }
7
+ isLoading: { type: Boolean },
8
+ tableConfig: {}
10
9
  },
11
- setup(q) {
12
- const t = q, c = r([]), g = r([]), R = r([]), y = r(), v = p(() => t.dataSource instanceof Ae), I = p(() => c.value.length > A.MINIMAL_LOADABLE_HEADER_COUNT), P = r(0), E = r(0), O = r(0), x = r(!1), N = Ne.resolve(ke), J = p(() => ({
10
+ setup(j) {
11
+ const t = j, c = r([]), k = r([]), R = r([]), S = r(), y = d(() => t.dataSource instanceof be), I = d(() => c.value.length > b.MINIMAL_LOADABLE_HEADER_COUNT), P = r(0), E = r(0), O = r(0), x = r(!1), q = d(() => ({
13
12
  total: P.value,
14
13
  current: E.value,
15
14
  showLessItems: !0,
16
15
  showTotal(e) {
17
16
  return "تعداد کل: " + e;
18
17
  },
19
- defaultPageSize: A.DEFAULT_ITEM_COUNT_PER_PAGE,
18
+ defaultPageSize: b.DEFAULT_ITEM_COUNT_PER_PAGE,
20
19
  pageSize: O.value,
21
- position: [A.PAGINATION_POSITION]
22
- })), B = p(() => {
20
+ position: [b.PAGINATION_POSITION]
21
+ })), N = d(() => {
23
22
  var e;
24
- return ((e = c.value[c.value.length - 1]) == null ? void 0 : e.cellType) === k.ACTION;
25
- }), Q = p(() => v.value ? {
26
- onSelect: X,
27
- onSelectAll: Y,
23
+ return ((e = c.value[c.value.length - 1]) == null ? void 0 : e.cellType) === A.ACTION;
24
+ }), J = d(() => y.value ? {
25
+ onSelect: W,
26
+ onSelectAll: X,
28
27
  selectedRowKeys: R.value
29
- } : null), W = p(() => !!y.value.summaryItems.length);
30
- function X(e) {
28
+ } : null), Q = d(() => !!S.value.summaryItems.length);
29
+ function W(e) {
31
30
  t.dataSource.selectRow(e);
32
31
  }
33
- function Y() {
32
+ function X() {
34
33
  t.dataSource.selectAll();
35
34
  }
36
- async function Z(e, u, s) {
35
+ async function Y(e, u, s) {
37
36
  if (e && await t.dataSource.paginate(
38
37
  e.current,
39
38
  e.pageSize
40
39
  ), s != null && s.columnKey) {
41
- const C = new Ie(
40
+ const _ = new ke(
42
41
  s.columnKey,
43
- ee(s.order)
42
+ Z(s.order)
44
43
  );
45
- await t.dataSource.sort(C);
44
+ await t.dataSource.sort(_);
46
45
  }
47
46
  }
48
- function ee(e) {
49
- return e === Pe.ASC ? j.ASC : j.DESC;
47
+ function Z(e) {
48
+ return e === Re.ASC ? $.ASC : $.DESC;
50
49
  }
51
- async function te() {
52
- await t.dataSource.load(), D();
50
+ async function ee() {
51
+ await t.dataSource.load(), B();
53
52
  }
54
- function D() {
53
+ function B() {
55
54
  const e = t.dataSource.hasAnyAction();
56
- e && !B.value && ae(), !e && B.value && oe();
55
+ e && !N.value && te(), !e && N.value && ae();
57
56
  }
58
- function ae() {
59
- c.value.push(Ee);
57
+ function te() {
58
+ c.value.push(Ie);
60
59
  }
61
- function oe() {
60
+ function ae() {
62
61
  c.value.pop();
63
62
  }
64
- function ne(e) {
63
+ function oe(e) {
65
64
  t.dataSource.handleClick(e);
66
65
  }
67
- function le(e) {
66
+ function ne(e) {
68
67
  t.dataSource.handleMetaClick(e);
69
68
  }
70
- function re(e) {
69
+ function le(e) {
71
70
  t.dataSource.handleDoubleClick(e);
72
71
  }
73
- function ce(e) {
72
+ function re(e) {
74
73
  return {
75
74
  onClick(u) {
76
- u.metaKey ? le(e) : ne(e);
75
+ u.metaKey ? ne(e) : oe(e);
77
76
  },
78
77
  onDblclick() {
79
- re(e);
78
+ le(e);
80
79
  }
81
80
  };
82
81
  }
83
- function ue(e) {
82
+ function ce(e) {
84
83
  return e.id;
85
84
  }
86
- function se(e, u) {
87
- return !Oe(e) && !xe(e, u);
85
+ function ue(e, u) {
86
+ return !Pe(e) && !Ee(e, u);
88
87
  }
89
- function ie(e, u) {
88
+ function se(e, u) {
90
89
  return e.getProps ? e.getProps(u) : null;
91
90
  }
92
- function L() {
93
- y.value = t.dataSource.loadSummarySchema();
91
+ function D() {
92
+ S.value = t.dataSource.loadSummarySchema();
94
93
  }
95
- function z(e) {
94
+ function L(e) {
96
95
  c.value = e;
97
96
  }
98
- function M(e) {
99
- g.value = e;
97
+ function z(e) {
98
+ k.value = e;
100
99
  }
101
- function H(e) {
100
+ function M(e) {
102
101
  R.value = t.dataSource.getSelectedRowIds();
103
102
  }
104
- function U(e) {
103
+ function H(e) {
105
104
  P.value = e;
106
105
  }
107
- function V(e) {
106
+ function U(e) {
108
107
  E.value = e;
109
108
  }
110
- function K(e) {
109
+ function V(e) {
111
110
  O.value = e;
112
111
  }
113
- function G(e) {
112
+ function K(e) {
114
113
  x.value = e;
115
114
  }
116
- return he(() => {
117
- te(), L(), t.dataSource.headerSchema.attach(z), t.dataSource.rows.attach(M), t.dataSource.currentPage.attach(V), t.dataSource.currentPageSize.attach(K), t.dataSource.totalItems.attach(U), t.dataSource.isExpandable.attach(G), v.value && t.dataSource.selectedRows.attach(H);
115
+ return fe(() => {
116
+ ee(), D(), t.dataSource.headerSchema.attach(L), t.dataSource.rows.attach(z), t.dataSource.currentPage.attach(U), t.dataSource.currentPageSize.attach(V), t.dataSource.totalItems.attach(H), t.dataSource.isExpandable.attach(K), y.value && t.dataSource.selectedRows.attach(M);
117
+ }), he(() => {
118
+ B(), D();
118
119
  }), ye(() => {
119
- D(), L();
120
- }), _e(() => {
121
- t.dataSource.onDestroy(), t.dataSource.headerSchema.detach(z), t.dataSource.rows.detach(M), t.dataSource.currentPage.detach(V), t.dataSource.currentPageSize.detach(K), t.dataSource.totalItems.detach(U), t.dataSource.isExpandable.detach(G), v.value && t.dataSource.selectedRows.detach(H);
120
+ t.dataSource.onDestroy(), t.dataSource.headerSchema.detach(L), t.dataSource.rows.detach(z), t.dataSource.currentPage.detach(U), t.dataSource.currentPageSize.detach(V), t.dataSource.totalItems.detach(H), t.dataSource.isExpandable.detach(K), y.value && t.dataSource.selectedRows.detach(M);
122
121
  }), (e, u) => {
123
- const s = m("a-button"), C = m("a-divider"), F = m("a-table-summary-cell"), de = m("a-typography-text"), pe = m("a-table-summary-row"), me = m("a-table");
124
- return o(), i(_, null, [
125
- S(d(console.log(g.value)) + " ", 1),
126
- f(me, {
127
- columns: c.value,
128
- "data-source": g.value,
129
- pagination: J.value,
130
- "custom-row": ce,
131
- "row-key": ue,
132
- loading: t.isLoading,
133
- scroll: t.dataSource.scrollDetail,
134
- "row-selection": Q.value,
135
- class: "saraf-table",
136
- onChange: Z
137
- }, ge({ _: 2 }, [
138
- I.value ? {
139
- name: "headerCell",
140
- fn: l(({ column: a }) => [
141
- a.headerType === h(Re).Text ? (o(), i("span", Be, d(a.title), 1)) : T("", !0)
142
- ]),
143
- key: "0"
144
- } : void 0,
145
- I.value ? {
146
- name: "bodyCell",
147
- fn: l(({ column: a, record: n }) => [
148
- S(d(console.log(a, n)) + " ", 1),
149
- h(N).getCellComponentRegistry().getRegisteredComponents().has(a.cellType) ? (o(), b(ve(h(N).getCellComponentRegistry().getRegisteredComponents().get(a.cellType)), Ce(we({ key: 0 }, { ...ie(a, n), data: n[a.path] })), null, 16)) : a.cellType === h(k).Text ? (o(), i("span", De, d(n[a.path]), 1)) : a.cellType === h(k).ACTION ? (o(), i("span", Le, [
150
- (o(!0), i(_, null, $(t.dataSource.getRowActions(n), (w, Se) => (o(), i(_, {
151
- key: w.actionName
152
- }, [
153
- f(s, {
154
- type: "link",
155
- onClick: Te((ze) => w.handler(n), ["stop"])
156
- }, {
157
- default: l(() => [
158
- S(d(w.actionName), 1)
159
- ]),
160
- _: 2
161
- }, 1032, ["onClick"]),
162
- se(
163
- t.dataSource.getRowActions(n).length,
164
- Se
165
- ) ? (o(), b(C, {
166
- key: 0,
167
- type: "vertical"
168
- })) : T("", !0)
169
- ], 64))), 128))
170
- ])) : T("", !0)
171
- ]),
172
- key: "1"
173
- } : void 0,
174
- x.value ? {
175
- name: "expandedRowRender",
176
- fn: l(({ record: a }) => [
177
- be(e.$slots, "expandedRowRender", {
178
- row: a
179
- }, void 0, !0)
180
- ]),
181
- key: "2"
182
- } : void 0,
183
- W.value ? {
184
- name: "summary",
185
- fn: l(() => [
186
- f(pe, null, {
187
- default: l(() => [
188
- f(F, null, {
189
- default: l(() => [
190
- S(d(y.value.summaryTitle), 1)
191
- ]),
192
- _: 1
193
- }),
194
- (o(!0), i(_, null, $(y.value.summaryItems, (a, n) => (o(), b(F, {
195
- key: n,
196
- align: a.align
197
- }, {
198
- default: l(() => [
199
- f(de, null, {
200
- default: l(() => [
201
- S(d(a.data), 1)
202
- ]),
203
- _: 2
204
- }, 1024)
205
- ]),
206
- _: 2
207
- }, 1032, ["align"]))), 128))
208
- ]),
209
- _: 1
210
- })
211
- ]),
212
- key: "3"
213
- } : void 0
214
- ]), 1032, ["columns", "data-source", "pagination", "loading", "scroll", "row-selection"])
215
- ], 64);
122
+ const s = i("a-button"), _ = i("a-divider"), G = i("a-table-summary-cell"), de = i("a-typography-text"), ie = i("a-table-summary-row"), pe = i("a-table");
123
+ return o(), f(pe, {
124
+ columns: c.value,
125
+ "data-source": k.value,
126
+ pagination: q.value,
127
+ "custom-row": re,
128
+ "row-key": ce,
129
+ loading: t.isLoading,
130
+ scroll: t.dataSource.scrollDetail,
131
+ "row-selection": J.value,
132
+ class: "saraf-table",
133
+ onChange: Y
134
+ }, _e({ _: 2 }, [
135
+ I.value ? {
136
+ name: "headerCell",
137
+ fn: n(({ column: a }) => [
138
+ a.headerType === C(Ae).Text ? (o(), p("span", Oe, m(a.title), 1)) : v("", !0)
139
+ ]),
140
+ key: "0"
141
+ } : void 0,
142
+ I.value ? {
143
+ name: "bodyCell",
144
+ fn: n(({ column: a, record: l }) => [
145
+ t.tableConfig.getCellComponentRegistry().getRegisteredComponents().has(a.cellType) ? (o(), f(ge(t.tableConfig.getCellComponentRegistry().getRegisteredComponents().get(a.cellType)), ve(Ce({ key: 0 }, { ...se(a, l), data: l[a.path] })), null, 16)) : a.cellType === C(A).Text ? (o(), p("span", xe, m(l[a.path]), 1)) : a.cellType === C(A).ACTION ? (o(), p("span", Ne, [
146
+ (o(!0), p(w, null, F(t.dataSource.getRowActions(l), (g, me) => (o(), p(w, {
147
+ key: g.actionName
148
+ }, [
149
+ h(s, {
150
+ type: "link",
151
+ onClick: we((Be) => g.handler(l), ["stop"])
152
+ }, {
153
+ default: n(() => [
154
+ T(m(g.actionName), 1)
155
+ ]),
156
+ _: 2
157
+ }, 1032, ["onClick"]),
158
+ ue(
159
+ t.dataSource.getRowActions(l).length,
160
+ me
161
+ ) ? (o(), f(_, {
162
+ key: 0,
163
+ type: "vertical"
164
+ })) : v("", !0)
165
+ ], 64))), 128))
166
+ ])) : v("", !0)
167
+ ]),
168
+ key: "1"
169
+ } : void 0,
170
+ x.value ? {
171
+ name: "expandedRowRender",
172
+ fn: n(({ record: a }) => [
173
+ Te(e.$slots, "expandedRowRender", {
174
+ row: a
175
+ }, void 0, !0)
176
+ ]),
177
+ key: "2"
178
+ } : void 0,
179
+ Q.value ? {
180
+ name: "summary",
181
+ fn: n(() => [
182
+ h(ie, null, {
183
+ default: n(() => [
184
+ h(G, null, {
185
+ default: n(() => [
186
+ T(m(S.value.summaryTitle), 1)
187
+ ]),
188
+ _: 1
189
+ }),
190
+ (o(!0), p(w, null, F(S.value.summaryItems, (a, l) => (o(), f(G, {
191
+ key: l,
192
+ align: a.align
193
+ }, {
194
+ default: n(() => [
195
+ h(de, null, {
196
+ default: n(() => [
197
+ T(m(a.data), 1)
198
+ ]),
199
+ _: 2
200
+ }, 1024)
201
+ ]),
202
+ _: 2
203
+ }, 1032, ["align"]))), 128))
204
+ ]),
205
+ _: 1
206
+ })
207
+ ]),
208
+ key: "3"
209
+ } : void 0
210
+ ]), 1032, ["columns", "data-source", "pagination", "loading", "scroll", "row-selection"]);
216
211
  };
217
212
  }
218
213
  });
219
214
  export {
220
- Ke as default
215
+ ze as default
221
216
  };
package/dist/index.d.ts CHANGED
@@ -19,6 +19,7 @@ import { SelectableTableGenerator } from '@sarafapp/iron_core';
19
19
  import { ShallowUnwrapRef } from 'vue';
20
20
  import { SymbolInTrade } from '@sarafapp/iron_core';
21
21
  import { SymbolPriceInTrade } from '@sarafapp/iron_core';
22
+ import { TableConfig } from '@sarafapp/iron_core';
22
23
  import { TableGenerator } from '@sarafapp/iron_core';
23
24
  import { TradeAmount } from '@sarafapp/iron_core';
24
25
  import { TradeDate } from '@sarafapp/iron_core';
@@ -607,6 +608,7 @@ export declare const SarafTableGenerator: <T>(__VLS_props: NonNullable<Awaited<t
607
608
  props: __VLS_PrettifyLocal_5<Pick<Partial<{}> & Omit<{} & VNodeProps & AllowedComponentProps & ComponentCustomProps, never>, never> & {
608
609
  dataSource: TableGenerator<T> | SelectableTableGenerator<T>;
609
610
  isLoading: boolean;
611
+ tableConfig: TableConfig;
610
612
  } & Partial<{}>> & PublicProps;
611
613
  expose(exposed: ShallowUnwrapRef< {}>): void;
612
614
  attrs: any;