@sarafapp/ant-design 1.0.11 → 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.
@@ -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-014d287c"]]);
4
+ const e = /* @__PURE__ */ r(o, [["__scopeId", "data-v-fb4823cf"]]);
5
5
  export {
6
- f as default
6
+ e as default
7
7
  };
@@ -1,5 +1,5 @@
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";
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
3
  const Oe = { key: 0 }, xe = { key: 1 }, Ne = { key: 2 }, ze = /* @__PURE__ */ Se({
4
4
  __name: "SarafTableGenerator",
5
5
  props: {
@@ -8,24 +8,24 @@ const Oe = { key: 0 }, xe = { key: 1 }, Ne = { key: 2 }, ze = /* @__PURE__ */ Se
8
8
  tableConfig: {}
9
9
  },
10
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(() => ({
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(() => ({
12
12
  total: P.value,
13
13
  current: E.value,
14
14
  showLessItems: !0,
15
15
  showTotal(e) {
16
16
  return "تعداد کل: " + e;
17
17
  },
18
- defaultPageSize: A.DEFAULT_ITEM_COUNT_PER_PAGE,
18
+ defaultPageSize: b.DEFAULT_ITEM_COUNT_PER_PAGE,
19
19
  pageSize: O.value,
20
- position: [A.PAGINATION_POSITION]
21
- })), N = p(() => {
20
+ position: [b.PAGINATION_POSITION]
21
+ })), N = d(() => {
22
22
  var e;
23
- return ((e = c.value[c.value.length - 1]) == null ? void 0 : e.cellType) === k.ACTION;
24
- }), J = p(() => g.value ? {
23
+ return ((e = c.value[c.value.length - 1]) == null ? void 0 : e.cellType) === A.ACTION;
24
+ }), J = d(() => y.value ? {
25
25
  onSelect: W,
26
26
  onSelectAll: X,
27
27
  selectedRowKeys: R.value
28
- } : null), Q = p(() => !!h.value.summaryItems.length);
28
+ } : null), Q = d(() => !!S.value.summaryItems.length);
29
29
  function W(e) {
30
30
  t.dataSource.selectRow(e);
31
31
  }
@@ -37,11 +37,11 @@ const Oe = { key: 0 }, xe = { key: 1 }, Ne = { key: 2 }, ze = /* @__PURE__ */ Se
37
37
  e.current,
38
38
  e.pageSize
39
39
  ), s != null && s.columnKey) {
40
- const v = new ke(
40
+ const _ = new ke(
41
41
  s.columnKey,
42
42
  Z(s.order)
43
43
  );
44
- await t.dataSource.sort(v);
44
+ await t.dataSource.sort(_);
45
45
  }
46
46
  }
47
47
  function Z(e) {
@@ -89,13 +89,13 @@ const Oe = { key: 0 }, xe = { key: 1 }, Ne = { key: 2 }, ze = /* @__PURE__ */ Se
89
89
  return e.getProps ? e.getProps(u) : null;
90
90
  }
91
91
  function D() {
92
- h.value = t.dataSource.loadSummarySchema();
92
+ S.value = t.dataSource.loadSummarySchema();
93
93
  }
94
94
  function L(e) {
95
95
  c.value = e;
96
96
  }
97
97
  function z(e) {
98
- _.value = e;
98
+ k.value = e;
99
99
  }
100
100
  function M(e) {
101
101
  R.value = t.dataSource.getSelectedRowIds();
@@ -113,105 +113,101 @@ const Oe = { key: 0 }, xe = { key: 1 }, Ne = { key: 2 }, ze = /* @__PURE__ */ Se
113
113
  x.value = e;
114
114
  }
115
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);
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
117
  }), he(() => {
118
118
  B(), D();
119
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);
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);
121
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);
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"]);
215
211
  };
216
212
  }
217
213
  });