@sarafapp/ant-design 1.0.20 → 1.0.21

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 e = /* @__PURE__ */ r(o, [["__scopeId", "data-v-fb4823cf"]]);
4
+ const f = /* @__PURE__ */ r(o, [["__scopeId", "data-v-49642402"]]);
5
5
  export {
6
- e as default
6
+ f as default
7
7
  };
@@ -1,6 +1,7 @@
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({
1
+ import { defineComponent as he, ref as r, computed as i, onBeforeMount as ye, onBeforeUpdate as _e, onBeforeUnmount as ge, resolveComponent as d, createBlock as h, openBlock as n, createSlots as ve, withCtx as l, createElementBlock as p, createCommentVNode as C, unref as y, toDisplayString as m, resolveDynamicComponent as Ce, normalizeProps as Te, mergeProps as we, createVNode as f, createElementVNode as be, Fragment as T, renderList as F, withModifiers as Ae, createTextVNode as w, renderSlot as ke } from "vue";
2
+ import { SelectableTableGenerator as Re, TableConstants as b, CellType as A, HeaderType as Ie, SortDetail as Pe, SortOrderTableHeader as xe, SortOrder as W, TABLE_ACTION_COLUMN as Ee, isOnlyOneItem as Oe, isLastItem as Ne } from "@sarafapp/iron_core";
3
+ import Be from "../dataDisplay/tooltip/SarafTooltip.vue.es.js";
4
+ const De = { key: 0 }, Le = { key: 2 }, Ue = /* @__PURE__ */ he({
4
5
  __name: "SarafTableGenerator",
5
6
  props: {
6
7
  dataSource: {},
@@ -8,8 +9,8 @@ const Oe = { key: 0 }, xe = { key: 1 }, Ne = { key: 2 }, ze = /* @__PURE__ */ Se
8
9
  tableConfig: {}
9
10
  },
10
11
  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(() => ({
12
- total: P.value,
12
+ const t = j, k = r(""), u = r([]), R = r([]), I = r([]), S = r(), _ = i(() => t.dataSource instanceof Re), P = i(() => u.value.length > b.MINIMAL_LOADABLE_HEADER_COUNT), x = r(0), E = r(0), O = r(0), N = r(!1), q = i(() => ({
13
+ total: x.value,
13
14
  current: E.value,
14
15
  showLessItems: !0,
15
16
  showTotal(e) {
@@ -18,159 +19,174 @@ const Oe = { key: 0 }, xe = { key: 1 }, Ne = { key: 2 }, ze = /* @__PURE__ */ Se
18
19
  defaultPageSize: b.DEFAULT_ITEM_COUNT_PER_PAGE,
19
20
  pageSize: O.value,
20
21
  position: [b.PAGINATION_POSITION]
21
- })), N = d(() => {
22
+ })), B = i(() => {
22
23
  var e;
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,
27
- selectedRowKeys: R.value
28
- } : null), Q = d(() => !!S.value.summaryItems.length);
29
- function W(e) {
24
+ return ((e = u.value[u.value.length - 1]) == null ? void 0 : e.cellType) === A.ACTION;
25
+ }), J = i(() => _.value ? {
26
+ onSelect: Y,
27
+ onSelectAll: Z,
28
+ selectedRowKeys: I.value
29
+ } : null), Q = i(() => !!S.value.summaryItems.length);
30
+ function X(e) {
31
+ const o = e.currentTarget;
32
+ k.value = o.scrollWidth > o.clientWidth ? o.innerText : "";
33
+ }
34
+ function Y(e) {
30
35
  t.dataSource.selectRow(e);
31
36
  }
32
- function X() {
37
+ function Z() {
33
38
  t.dataSource.selectAll();
34
39
  }
35
- async function Y(e, u, s) {
36
- if (e && await t.dataSource.paginate(
37
- e.current,
38
- e.pageSize
39
- ), s != null && s.columnKey) {
40
- const _ = new ke(
40
+ async function ee(e, o, s) {
41
+ if (e && await t.dataSource.paginate(e.current, e.pageSize), s != null && s.columnKey) {
42
+ const g = new Pe(
41
43
  s.columnKey,
42
- Z(s.order)
44
+ te(s.order)
43
45
  );
44
- await t.dataSource.sort(_);
46
+ await t.dataSource.sort(g);
45
47
  }
46
48
  }
47
- function Z(e) {
48
- return e === Re.ASC ? $.ASC : $.DESC;
49
+ function te(e) {
50
+ return e === xe.ASC ? W.ASC : W.DESC;
49
51
  }
50
- async function ee() {
51
- await t.dataSource.load(), B();
52
+ async function ae() {
53
+ await t.dataSource.load(), D();
52
54
  }
53
- function B() {
55
+ function D() {
54
56
  const e = t.dataSource.hasAnyAction();
55
- e && !N.value && te(), !e && N.value && ae();
57
+ e && !B.value && oe(), !e && B.value && ne();
56
58
  }
57
- function te() {
58
- c.value.push(Ie);
59
+ function oe() {
60
+ u.value.push(Ee);
59
61
  }
60
- function ae() {
61
- c.value.pop();
62
+ function ne() {
63
+ u.value.pop();
62
64
  }
63
- function oe(e) {
65
+ function le(e) {
64
66
  t.dataSource.handleClick(e);
65
67
  }
66
- function ne(e) {
68
+ function re(e) {
67
69
  t.dataSource.handleMetaClick(e);
68
70
  }
69
- function le(e) {
71
+ function ce(e) {
70
72
  t.dataSource.handleDoubleClick(e);
71
73
  }
72
- function re(e) {
74
+ function ue(e) {
73
75
  return {
74
- onClick(u) {
75
- u.metaKey ? ne(e) : oe(e);
76
+ onClick(o) {
77
+ o.metaKey ? re(e) : le(e);
76
78
  },
77
79
  onDblclick() {
78
- le(e);
80
+ ce(e);
79
81
  }
80
82
  };
81
83
  }
82
- function ce(e) {
84
+ function se(e) {
83
85
  return e.id;
84
86
  }
85
- function ue(e, u) {
86
- return !Pe(e) && !Ee(e, u);
87
+ function ie(e, o) {
88
+ return !Oe(e) && !Ne(e, o);
87
89
  }
88
- function se(e, u) {
89
- return e.getProps ? e.getProps(u) : null;
90
+ function de(e, o) {
91
+ return e.getProps ? e.getProps(o) : null;
90
92
  }
91
- function D() {
93
+ function L() {
92
94
  S.value = t.dataSource.loadSummarySchema();
93
95
  }
94
- function L(e) {
95
- c.value = e;
96
+ function M(e) {
97
+ u.value = e;
96
98
  }
97
99
  function z(e) {
98
- k.value = e;
100
+ R.value = e;
99
101
  }
100
- function M(e) {
101
- R.value = t.dataSource.getSelectedRowIds();
102
+ function V(e) {
103
+ I.value = t.dataSource.getSelectedRowIds();
102
104
  }
103
105
  function H(e) {
104
- P.value = e;
106
+ x.value = e;
105
107
  }
106
108
  function U(e) {
107
109
  E.value = e;
108
110
  }
109
- function V(e) {
110
- O.value = e;
111
- }
112
111
  function K(e) {
113
- x.value = e;
112
+ O.value = e;
114
113
  }
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();
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), y.value && t.dataSource.selectedRows.detach(M);
121
- }), (e, u) => {
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,
114
+ function G(e) {
115
+ N.value = e;
116
+ }
117
+ return ye(() => {
118
+ ae(), L(), t.dataSource.headerSchema.attach(M), t.dataSource.rows.attach(z), t.dataSource.currentPage.attach(U), t.dataSource.currentPageSize.attach(K), t.dataSource.totalItems.attach(H), t.dataSource.isExpandable.attach(G), _.value && t.dataSource.selectedRows.attach(V);
119
+ }), _e(() => {
120
+ D(), L();
121
+ }), ge(() => {
122
+ t.dataSource.onDestroy(), t.dataSource.headerSchema.detach(M), t.dataSource.rows.detach(z), t.dataSource.currentPage.detach(U), t.dataSource.currentPageSize.detach(K), t.dataSource.totalItems.detach(H), t.dataSource.isExpandable.detach(G), _.value && t.dataSource.selectedRows.detach(V);
123
+ }), (e, o) => {
124
+ const s = d("a-button"), g = d("a-divider"), $ = d("a-table-summary-cell"), pe = d("a-typography-text"), me = d("a-table-summary-row"), fe = d("a-table");
125
+ return n(), h(fe, {
126
+ columns: u.value,
127
+ "data-source": R.value,
126
128
  pagination: q.value,
127
- "custom-row": re,
128
- "row-key": ce,
129
+ "custom-row": ue,
130
+ "row-key": se,
129
131
  loading: t.isLoading,
130
132
  scroll: t.dataSource.scrollDetail,
131
133
  "row-selection": J.value,
132
134
  class: "saraf-table",
133
- onChange: Y
134
- }, _e({ _: 2 }, [
135
- I.value ? {
135
+ onChange: ee
136
+ }, ve({ _: 2 }, [
137
+ P.value ? {
136
138
  name: "headerCell",
137
- fn: n(({ column: a }) => [
138
- a.headerType === C(Ae).Text ? (o(), p("span", Oe, m(a.title), 1)) : v("", !0)
139
+ fn: l(({ column: a }) => [
140
+ a.headerType === y(Ie).Text ? (n(), p("span", De, m(a.title), 1)) : C("", !0)
139
141
  ]),
140
142
  key: "0"
141
143
  } : void 0,
142
- I.value ? {
144
+ P.value ? {
143
145
  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
146
+ fn: l(({ column: a, record: c }) => [
147
+ t.tableConfig.getCellComponentRegistry().getRegisteredComponents().has(a.cellType) ? (n(), h(Ce(
148
+ t.tableConfig.getCellComponentRegistry().getRegisteredComponents().get(a.cellType)
149
+ ), Te(we({ key: 0 }, { ...de(a, c), data: c[a.path] })), null, 16)) : a.cellType === y(A).Text ? (n(), p("div", {
150
+ key: 1,
151
+ ref: "tooltipTarget",
152
+ class: "ellipsis-cell",
153
+ onMouseenter: X
154
+ }, [
155
+ f(y(Be), { title: k.value }, {
156
+ default: l(() => [
157
+ be("span", null, m(c[a.path]), 1)
158
+ ]),
159
+ _: 2
160
+ }, 1032, ["title"])
161
+ ], 544)) : a.cellType === y(A).ACTION ? (n(), p("span", Le, [
162
+ (n(!0), p(T, null, F(t.dataSource.getRowActions(c), (v, Se) => (n(), p(T, {
163
+ key: v.actionName
148
164
  }, [
149
- h(s, {
165
+ f(s, {
150
166
  type: "link",
151
- onClick: we((Be) => g.handler(l), ["stop"])
167
+ onClick: Ae((Me) => v.handler(c), ["stop"])
152
168
  }, {
153
- default: n(() => [
154
- T(m(g.actionName), 1)
169
+ default: l(() => [
170
+ w(m(v.actionName), 1)
155
171
  ]),
156
172
  _: 2
157
173
  }, 1032, ["onClick"]),
158
- ue(
159
- t.dataSource.getRowActions(l).length,
160
- me
161
- ) ? (o(), f(_, {
174
+ ie(
175
+ t.dataSource.getRowActions(c).length,
176
+ Se
177
+ ) ? (n(), h(g, {
162
178
  key: 0,
163
179
  type: "vertical"
164
- })) : v("", !0)
180
+ })) : C("", !0)
165
181
  ], 64))), 128))
166
- ])) : v("", !0)
182
+ ])) : C("", !0)
167
183
  ]),
168
184
  key: "1"
169
185
  } : void 0,
170
- x.value ? {
186
+ N.value ? {
171
187
  name: "expandedRowRender",
172
- fn: n(({ record: a }) => [
173
- Te(e.$slots, "expandedRowRender", {
188
+ fn: l(({ record: a }) => [
189
+ ke(e.$slots, "expandedRowRender", {
174
190
  row: a
175
191
  }, void 0, !0)
176
192
  ]),
@@ -178,23 +194,23 @@ const Oe = { key: 0 }, xe = { key: 1 }, Ne = { key: 2 }, ze = /* @__PURE__ */ Se
178
194
  } : void 0,
179
195
  Q.value ? {
180
196
  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)
197
+ fn: l(() => [
198
+ f(me, null, {
199
+ default: l(() => [
200
+ f($, null, {
201
+ default: l(() => [
202
+ w(m(S.value.summaryTitle), 1)
187
203
  ]),
188
204
  _: 1
189
205
  }),
190
- (o(!0), p(w, null, F(S.value.summaryItems, (a, l) => (o(), f(G, {
191
- key: l,
206
+ (n(!0), p(T, null, F(S.value.summaryItems, (a, c) => (n(), h($, {
207
+ key: c,
192
208
  align: a.align
193
209
  }, {
194
- default: n(() => [
195
- h(de, null, {
196
- default: n(() => [
197
- T(m(a.data), 1)
210
+ default: l(() => [
211
+ f(pe, null, {
212
+ default: l(() => [
213
+ w(m(a.data), 1)
198
214
  ]),
199
215
  _: 2
200
216
  }, 1024)
@@ -212,5 +228,5 @@ const Oe = { key: 0 }, xe = { key: 1 }, Ne = { key: 2 }, ze = /* @__PURE__ */ Se
212
228
  }
213
229
  });
214
230
  export {
215
- ze as default
231
+ Ue as default
216
232
  };
@@ -1,7 +1,7 @@
1
1
  import a from "./SarafTradeDateCell.vue.es2.js";
2
2
  /* empty css */
3
3
  import o from "../_virtual/_plugin-vue_export-helper.es.js";
4
- const f = /* @__PURE__ */ o(a, [["__scopeId", "data-v-70704877"]]);
4
+ const f = /* @__PURE__ */ o(a, [["__scopeId", "data-v-964bffe7"]]);
5
5
  export {
6
6
  f as default
7
7
  };
@@ -1,22 +1,25 @@
1
- import { defineComponent as o, createElementBlock as d, openBlock as r, createVNode as c, createElementVNode as e, unref as n, toDisplayString as a } from "vue";
2
- import i from "../icons/SarafArrowIcon.vue.es.js";
3
- const l = { class: "saraf-trade-date-cell-container" }, _ = { class: "date-info" }, p = { class: "date" }, m = { class: "time" }, f = { class: "date-info" }, u = { class: "date" }, D = { class: "time" }, S = /* @__PURE__ */ o({
1
+ import { defineComponent as c, createElementBlock as n, openBlock as i, createVNode as l, createElementVNode as t, unref as _, toDisplayString as r } from "vue";
2
+ import D from "../icons/SarafArrowIcon.vue.es.js";
3
+ const u = { class: "saraf-trade-date-cell-container" }, p = { class: "date-info" }, f = { class: "date" }, m = { class: "time" }, h = { class: "date-info" }, x = { class: "date" }, q = { class: "time" }, S = /* @__PURE__ */ c({
4
4
  __name: "SarafTradeDateCell",
5
5
  props: {
6
6
  tradeDate: {}
7
7
  },
8
- setup(s) {
9
- const t = s;
10
- return (h, v) => (r(), d("div", l, [
11
- c(n(i)),
12
- e("div", null, [
13
- e("div", _, [
14
- e("p", p, a(t.tradeDate.requestedDateInJalali), 1),
15
- e("p", m, a(t.tradeDate.requestedTime), 1)
8
+ setup(o) {
9
+ const e = o;
10
+ function a(d, s) {
11
+ return s === 0 || !s ? "-" : d;
12
+ }
13
+ return (d, s) => (i(), n("div", u, [
14
+ l(_(D)),
15
+ t("div", null, [
16
+ t("div", p, [
17
+ t("p", f, r(a(e.tradeDate.requestedDateInJalali, e.tradeDate.requestedDate)), 1),
18
+ t("p", m, r(a(e.tradeDate.requestedTime, e.tradeDate.requestedDate)), 1)
16
19
  ]),
17
- e("div", f, [
18
- e("p", u, a(t.tradeDate.executedDateInJalali), 1),
19
- e("p", D, a(t.tradeDate.executedDateTime), 1)
20
+ t("div", h, [
21
+ t("p", x, r(a(e.tradeDate.executedDateInJalali, e.tradeDate.executedDate)), 1),
22
+ t("p", q, r(a(e.tradeDate.executedDateTime, e.tradeDate.executedDate)), 1)
20
23
  ])
21
24
  ])
22
25
  ]));
@@ -6,5 +6,6 @@ export { SarafTab } from './tab/model/SarafTab';
6
6
  export { default as SarafChart } from './chart/SarafChart.vue';
7
7
  export { AreaChartDataSource } from './chart/model/AreaChartDataSource';
8
8
  export { DonutChartDataSource } from './chart/model/DonutChartDataSource';
9
- export { ChartType, RawChartDataPoint, ChartSettings, ChartSeries, } from './chart/model/ChartTypes';
9
+ export { ChartType, RawChartDataPoint, ChartSettings, ChartSeries } from './chart/model/ChartTypes';
10
10
  export { TooltipDirective } from './tooltip/model/tooltipDirective';
11
+ export { default as SarafTooltip } from './tooltip/SarafTooltip.vue';
@@ -0,0 +1,24 @@
1
+ import { TooltipPlacement } from './model/Constants.ts';
2
+ type __VLS_Props = {
3
+ title: string;
4
+ placement?: TooltipPlacement.Top | TooltipPlacement.Left | TooltipPlacement.Right | TooltipPlacement.Bottom | TooltipPlacement.TopLeft | TooltipPlacement.TopRight | TooltipPlacement.BottomLeft | TooltipPlacement.BottomRight;
5
+ };
6
+ declare function __VLS_template(): {
7
+ attrs: Partial<{}>;
8
+ slots: {
9
+ default?(_: {}): any;
10
+ };
11
+ refs: {};
12
+ rootEl: any;
13
+ };
14
+ type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
15
+ declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
16
+ placement: TooltipPlacement.Top | TooltipPlacement.Left | TooltipPlacement.Right | TooltipPlacement.Bottom | TooltipPlacement.TopLeft | TooltipPlacement.TopRight | TooltipPlacement.BottomLeft | TooltipPlacement.BottomRight;
17
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
18
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
19
+ export default _default;
20
+ type __VLS_WithTemplateSlots<T, S> = T & {
21
+ new (): {
22
+ $slots: S;
23
+ };
24
+ };
@@ -0,0 +1,27 @@
1
+ import { defineComponent as n, resolveComponent as p, createBlock as a, openBlock as r, withCtx as c, renderSlot as m } from "vue";
2
+ import { TooltipPlacement as i } from "./model/Constants.es.js";
3
+ const u = /* @__PURE__ */ n({
4
+ __name: "SarafTooltip",
5
+ props: {
6
+ title: {},
7
+ placement: { default: i.BottomLeft }
8
+ },
9
+ setup(e) {
10
+ const t = e;
11
+ return (o, s) => {
12
+ const l = p("a-tooltip");
13
+ return r(), a(l, {
14
+ title: t.title,
15
+ placement: t.placement
16
+ }, {
17
+ default: c(() => [
18
+ m(o.$slots, "default")
19
+ ]),
20
+ _: 3
21
+ }, 8, ["title", "placement"]);
22
+ };
23
+ }
24
+ });
25
+ export {
26
+ u as default
27
+ };
@@ -0,0 +1,4 @@
1
+ import f from "./SarafTooltip.vue.es.js";
2
+ export {
3
+ f as default
4
+ };
@@ -0,0 +1,10 @@
1
+ export declare enum TooltipPlacement {
2
+ Top = "top",
3
+ Bottom = "bottom",
4
+ Left = "left",
5
+ Right = "right",
6
+ TopRight = "topRight",
7
+ TopLeft = "topLeft",
8
+ BottomLeft = "bottomLeft",
9
+ BottomRight = "bottomRight"
10
+ }
@@ -0,0 +1,4 @@
1
+ var f = /* @__PURE__ */ ((t) => (t.Top = "top", t.Bottom = "bottom", t.Left = "left", t.Right = "right", t.TopRight = "topRight", t.TopLeft = "topLeft", t.BottomLeft = "bottomLeft", t.BottomRight = "bottomRight", t))(f || {});
2
+ export {
3
+ f as TooltipPlacement
4
+ };