@sarafapp/ant-design 1.0.9 → 1.0.11

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