@frollo/frollo-web-ui 8.0.4 → 8.1.1

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,8 @@
1
- import { g as render$3, h as render$4 } from './index-B-9TSbb0.js';
2
- import { defineComponent, computed, ref, onMounted, useCssVars, pushScopeId, popScopeId, resolveComponent, openBlock, createElementBlock, normalizeClass, createElementVNode, renderSlot, createCommentVNode, Fragment, renderList, withKeys, toDisplayString, createBlock, createVNode } from 'vue';
1
+ import { g as render$3, h as render$4, i as render$5, f as render$6 } from './index-svDiDkSU.js';
2
+ import { defineComponent, computed, ref, onMounted, useCssVars, pushScopeId, popScopeId, resolveComponent, openBlock, createElementBlock, createElementVNode, normalizeClass, renderSlot, createCommentVNode, Fragment, renderList, withKeys, toDisplayString, createBlock, createVNode, withCtx } from 'vue';
3
3
  import { u as useColours } from './get-root-colours-DYEoJPEb.js';
4
4
  import { s as script$2 } from './fw-loading-bar-DThRjdw1.js';
5
+ import { s as script$3 } from './fw-button-DdxvSBFa.js';
5
6
  import { s as styleInject } from './style-inject.es-tgCJW-Cu.js';
6
7
 
7
8
  var __default__ = defineComponent({
@@ -9,11 +10,15 @@ var __default__ = defineComponent({
9
10
  components: {
10
11
  ArrowSortSvg: render$3,
11
12
  ArrowDownSvg: render$4,
12
- FwLoadingBar: script$2
13
+ ChevronLeftSvg: render$5,
14
+ ChevronRightSvg: render$6,
15
+ FwLoadingBar: script$2,
16
+ FwButton: script$3
13
17
  },
14
18
  emits: [/** Fired when a row is clicked with row data */
15
19
  'rowClicked', /** Fired when a column is sorted */
16
- 'columnSorted'],
20
+ 'columnSorted', /** Fired when a page number or arrow is clicked */
21
+ 'pageChanged'],
17
22
  props: {
18
23
  items: {
19
24
  type: Array,
@@ -37,6 +42,16 @@ var __default__ = defineComponent({
37
42
  },
38
43
  autoSortColumn: {
39
44
  type: Number
45
+ },
46
+ enablePagination: {
47
+ type: Boolean,
48
+ "default": false
49
+ },
50
+ totalAmount: {
51
+ type: Number
52
+ },
53
+ pageSize: {
54
+ type: Number
40
55
  }
41
56
  },
42
57
  setup: function setup(props, ctx) {
@@ -46,10 +61,15 @@ var __default__ = defineComponent({
46
61
  var sortBy = ref('');
47
62
  var sortDirection = ref('asc');
48
63
  var currentSortedColumn = ref('');
64
+ var currentPage = ref(1);
65
+ var maxPageAmount = ref();
49
66
  onMounted(function () {
50
67
  if (Number(props.autoSortColumn) >= 0) {
51
68
  sortColumn(columns.value[Number(props.autoSortColumn)], false);
52
69
  }
70
+ if (props.totalAmount && props.pageSize) {
71
+ maxPageAmount.value = Math.ceil(props.totalAmount / props.pageSize);
72
+ }
53
73
  });
54
74
  var _useColours = useColours(),
55
75
  bgHoverColor = _useColours.primaryFade5;
@@ -119,6 +139,10 @@ var __default__ = defineComponent({
119
139
  var rowClicked = function rowClicked(row) {
120
140
  if (props.clickableRows) ctx.emit('rowClicked', row);
121
141
  };
142
+ var pageArrowClick = function pageArrowClick(next) {
143
+ currentPage.value = currentPage.value + (next ? 1 : -1);
144
+ ctx.emit('pageChanged', next);
145
+ };
122
146
  return {
123
147
  columns: columns,
124
148
  sortBy: sortBy,
@@ -131,14 +155,17 @@ var __default__ = defineComponent({
131
155
  isColumnSortable: isColumnSortable,
132
156
  isDisabled: isDisabled,
133
157
  rowClicked: rowClicked,
134
- bgHoverColor: bgHoverColor
158
+ bgHoverColor: bgHoverColor,
159
+ currentPage: currentPage,
160
+ maxPageAmount: maxPageAmount,
161
+ pageArrowClick: pageArrowClick
135
162
  };
136
163
  }
137
164
  });
138
165
  var __injectCSSVars__ = function __injectCSSVars__() {
139
166
  useCssVars(function (_ctx) {
140
167
  return {
141
- "d606643a": _ctx.bgHoverColor
168
+ "11c7ec1c": _ctx.bgHoverColor
142
169
  };
143
170
  });
144
171
  };
@@ -149,42 +176,52 @@ __default__.setup = __setup__ ? function (props, ctx) {
149
176
  } : __injectCSSVars__;
150
177
 
151
178
  var _withScopeId = function _withScopeId(n) {
152
- return pushScopeId("data-v-46577d1a"), n = n(), popScopeId(), n;
179
+ return pushScopeId("data-v-b7ffd9d4"), n = n(), popScopeId(), n;
180
+ };
181
+ var _hoisted_1$2 = {
182
+ "class": "flex flex-col"
153
183
  };
154
- var _hoisted_1$2 = ["aria-busy"];
155
- var _hoisted_2$1 = {
184
+ var _hoisted_2$1 = ["aria-busy"];
185
+ var _hoisted_3$1 = {
156
186
  "class": "text-p2 border-b border-grey-40"
157
187
  };
158
- var _hoisted_3$1 = ["tabindex", "onKeydown", "onClick"];
159
- var _hoisted_4 = {
188
+ var _hoisted_4 = ["tabindex", "onKeydown", "onClick"];
189
+ var _hoisted_5 = {
160
190
  "class": "flex flex-row items-center"
161
191
  };
162
- var _hoisted_5 = {
192
+ var _hoisted_6 = {
163
193
  key: 0,
164
194
  "class": "ml-1 flex items-center justify-center w-5"
165
195
  };
166
- var _hoisted_6 = {
196
+ var _hoisted_7 = {
167
197
  "class": "text-p2 bg-white font-light"
168
198
  };
169
- var _hoisted_7 = {
199
+ var _hoisted_8 = {
170
200
  key: 0,
171
201
  "class": "py-4 pl-5 pr-3 text-left"
172
202
  };
173
- var _hoisted_8 = {
203
+ var _hoisted_9 = {
174
204
  key: 0,
175
205
  "class": "py-4 pl-5 pr-3 text-left"
176
206
  };
177
- var _hoisted_9 = ["onClick", "tabindex", "onKeydown"];
178
- var _hoisted_10 = ["innerHTML"];
207
+ var _hoisted_10 = ["onClick", "tabindex", "onKeydown"];
208
+ var _hoisted_11 = ["innerHTML"];
209
+ var _hoisted_12 = {
210
+ key: 0,
211
+ "class": "flex flex-row justify-center h-[44px] mt-8 space-x-2 mb-[40px]"
212
+ };
179
213
  function render$2(_ctx, _cache, $props, $setup, $data, $options) {
180
214
  var _component_ArrowSortSvg = resolveComponent("ArrowSortSvg");
181
215
  var _component_ArrowDownSvg = resolveComponent("ArrowDownSvg");
182
216
  var _component_FwLoadingBar = resolveComponent("FwLoadingBar");
183
- return openBlock(), createElementBlock("table", {
184
- "class": normalizeClass(["fw-table table-auto table-responsive rounded-md shadow-card", _ctx.loading ? 'cursor-wait' : '']),
217
+ var _component_ChevronLeftSvg = resolveComponent("ChevronLeftSvg");
218
+ var _component_FwButton = resolveComponent("FwButton");
219
+ var _component_ChevronRightSvg = resolveComponent("ChevronRightSvg");
220
+ return openBlock(), createElementBlock("div", _hoisted_1$2, [createElementVNode("table", {
221
+ "class": normalizeClass(["fw-table table-auto table-responsive rounded-md shadow-card flex-1", _ctx.loading ? 'cursor-wait' : '']),
185
222
  "aria-live": "polite",
186
223
  "aria-busy": _ctx.loading
187
- }, [createElementVNode("thead", _hoisted_2$1, [createElementVNode("tr", null, [_ctx.$slots.preHead ? renderSlot(_ctx.$slots, "preHead", {
224
+ }, [createElementVNode("thead", _hoisted_3$1, [createElementVNode("tr", null, [_ctx.$slots.preHead ? renderSlot(_ctx.$slots, "preHead", {
188
225
  key: 0
189
226
  }) : createCommentVNode("", true), (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.columns, function (column, thKey) {
190
227
  return openBlock(), createElementBlock(Fragment, {
@@ -199,9 +236,9 @@ function render$2(_ctx, _cache, $props, $setup, $data, $options) {
199
236
  onClick: function onClick($event) {
200
237
  return _ctx.sortColumn(column);
201
238
  }
202
- }, [createElementVNode("div", _hoisted_4, [createElementVNode("span", {
239
+ }, [createElementVNode("div", _hoisted_5, [createElementVNode("span", {
203
240
  "class": normalizeClass(_ctx.sortedIcon('asc', column) || _ctx.sortedIcon('desc', column) ? 'text-primary' : '')
204
- }, toDisplayString(column), 3), _ctx.isColumnSortable(column) ? (openBlock(), createElementBlock("span", _hoisted_5, [!_ctx.sortedIcon('asc', column) && !_ctx.sortedIcon('desc', column) ? (openBlock(), createBlock(_component_ArrowSortSvg, {
241
+ }, toDisplayString(column), 3), _ctx.isColumnSortable(column) ? (openBlock(), createElementBlock("span", _hoisted_6, [!_ctx.sortedIcon('asc', column) && !_ctx.sortedIcon('desc', column) ? (openBlock(), createBlock(_component_ArrowSortSvg, {
205
242
  key: 0,
206
243
  "class": "inline-block w-full text-grey-base"
207
244
  })) : createCommentVNode("", true), _ctx.sortedIcon('asc', column) ? (openBlock(), createBlock(_component_ArrowDownSvg, {
@@ -210,10 +247,10 @@ function render$2(_ctx, _cache, $props, $setup, $data, $options) {
210
247
  })) : createCommentVNode("", true), _ctx.sortedIcon('desc', column) ? (openBlock(), createBlock(_component_ArrowDownSvg, {
211
248
  key: 2,
212
249
  "class": "inline-block w-4 text-primary"
213
- })) : createCommentVNode("", true)])) : createCommentVNode("", true)])], 42, _hoisted_3$1)) : createCommentVNode("", true)], 64);
250
+ })) : createCommentVNode("", true)])) : createCommentVNode("", true)])], 42, _hoisted_4)) : createCommentVNode("", true)], 64);
214
251
  }), 128)), _ctx.$slots.head ? renderSlot(_ctx.$slots, "head", {
215
252
  key: 1
216
- }) : createCommentVNode("", true)])]), createElementVNode("tbody", _hoisted_6, [_ctx.loading ? (openBlock(true), createElementBlock(Fragment, {
253
+ }) : createCommentVNode("", true)])]), createElementVNode("tbody", _hoisted_7, [_ctx.loading ? (openBlock(true), createElementBlock(Fragment, {
217
254
  key: 0
218
255
  }, renderList(_ctx.sortedData, function (row, trKey) {
219
256
  return openBlock(), createElementBlock("tr", {
@@ -221,10 +258,10 @@ function render$2(_ctx, _cache, $props, $setup, $data, $options) {
221
258
  }, [(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.columns, function (column, colKey) {
222
259
  return openBlock(), createElementBlock(Fragment, {
223
260
  key: colKey
224
- }, [!_ctx.isDisabled(column) ? (openBlock(), createElementBlock("td", _hoisted_7, [createVNode(_component_FwLoadingBar, {
261
+ }, [!_ctx.isDisabled(column) ? (openBlock(), createElementBlock("td", _hoisted_8, [createVNode(_component_FwLoadingBar, {
225
262
  "class": "w-full h-7"
226
263
  })])) : createCommentVNode("", true)], 64);
227
- }), 128)), _ctx.$slots.row ? (openBlock(), createElementBlock("td", _hoisted_8, [createVNode(_component_FwLoadingBar, {
264
+ }), 128)), _ctx.$slots.row ? (openBlock(), createElementBlock("td", _hoisted_9, [createVNode(_component_FwLoadingBar, {
228
265
  "class": "w-full h-7"
229
266
  })])) : createCommentVNode("", true)]);
230
267
  }), 128)) : (openBlock(true), createElementBlock(Fragment, {
@@ -250,20 +287,51 @@ function render$2(_ctx, _cache, $props, $setup, $data, $options) {
250
287
  key: 0,
251
288
  "class": "py-2 pl-5 pr-3 text-left",
252
289
  innerHTML: _ctx.formattedText(row, column)
253
- }, null, 8, _hoisted_10)) : createCommentVNode("", true)], 64);
290
+ }, null, 8, _hoisted_11)) : createCommentVNode("", true)], 64);
254
291
  }), 128)), _ctx.$slots.row ? renderSlot(_ctx.$slots, "row", {
255
292
  key: 1,
256
293
  row: row
257
- }) : createCommentVNode("", true)], 42, _hoisted_9);
258
- }), 128))])], 10, _hoisted_1$2);
294
+ }) : createCommentVNode("", true)], 42, _hoisted_10);
295
+ }), 128))])], 10, _hoisted_2$1), _ctx.enablePagination ? (openBlock(), createElementBlock("div", _hoisted_12, [createVNode(_component_FwButton, {
296
+ variant: 'tertiary',
297
+ disabled: _ctx.currentPage === 1,
298
+ size: "sm",
299
+ "class": "border-grey-40",
300
+ onClick: _cache[0] || (_cache[0] = function ($event) {
301
+ return _ctx.pageArrowClick(false);
302
+ })
303
+ }, {
304
+ "default": withCtx(function () {
305
+ return [createVNode(_component_ChevronLeftSvg, {
306
+ "class": "h-4 w-4",
307
+ "stroke-width": "3"
308
+ })];
309
+ }),
310
+ _: 1
311
+ }, 8, ["disabled"]), renderSlot(_ctx.$slots, "page"), createVNode(_component_FwButton, {
312
+ variant: 'tertiary',
313
+ disabled: _ctx.currentPage === _ctx.maxPageAmount,
314
+ size: "sm",
315
+ "class": "border-grey-40",
316
+ onClick: _cache[1] || (_cache[1] = function ($event) {
317
+ return _ctx.pageArrowClick(true);
318
+ })
319
+ }, {
320
+ "default": withCtx(function () {
321
+ return [createVNode(_component_ChevronRightSvg, {
322
+ "class": "h-4 w-4"
323
+ })];
324
+ }),
325
+ _: 1
326
+ }, 8, ["disabled"])])) : createCommentVNode("", true)]);
259
327
  }
260
328
 
261
- var css_248z = ".fw-table-head--sortable[data-v-46577d1a]:hover{background-color:var(--d606643a)}.fw-table-row[data-v-46577d1a]:hover{background-color:var(--d606643a)}";
262
- var stylesheet = ".fw-table-head--sortable[data-v-46577d1a]:hover{background-color:var(--d606643a)}.fw-table-row[data-v-46577d1a]:hover{background-color:var(--d606643a)}";
329
+ var css_248z = ".fw-table-head--sortable[data-v-b7ffd9d4]:hover{background-color:var(--11c7ec1c)}.fw-table-row[data-v-b7ffd9d4]:hover{background-color:var(--11c7ec1c)}";
330
+ var stylesheet = ".fw-table-head--sortable[data-v-b7ffd9d4]:hover{background-color:var(--11c7ec1c)}.fw-table-row[data-v-b7ffd9d4]:hover{background-color:var(--11c7ec1c)}";
263
331
  styleInject(css_248z);
264
332
 
265
333
  __default__.render = render$2;
266
- __default__.__scopeId = "data-v-46577d1a";
334
+ __default__.__scopeId = "data-v-b7ffd9d4";
267
335
 
268
336
  var script$1 = defineComponent({
269
337
  name: 'FwTableHead'
package/esm/fw-table.js CHANGED
@@ -1,7 +1,9 @@
1
- export { _ as FwTable, s as FwTableHead, a as FwTableRow } from './fw-table-row-7vke3KXB.js';
2
- import './index-B-9TSbb0.js';
1
+ export { _ as FwTable, s as FwTableHead, a as FwTableRow } from './fw-table-row-Cianlk0N.js';
2
+ import './index-svDiDkSU.js';
3
3
  import 'vue';
4
4
  import './check--YD4Ts6g.js';
5
5
  import './get-root-colours-DYEoJPEb.js';
6
6
  import './fw-loading-bar-DThRjdw1.js';
7
7
  import './style-inject.es-tgCJW-Cu.js';
8
+ import './fw-button-DdxvSBFa.js';
9
+ import './fw-loading-spinner-BEzZf1xe.js';
@@ -1,8 +1,8 @@
1
1
  import { defineComponent, ref, computed, useCssVars, resolveComponent, openBlock, createElementBlock, normalizeClass, Fragment, createTextVNode, toDisplayString, renderSlot, createCommentVNode, createBlock, withCtx, createVNode } from 'vue';
2
2
  import './fw-button.js';
3
- import { b as render$1 } from './index-B-9TSbb0.js';
3
+ import { b as render$1 } from './index-svDiDkSU.js';
4
4
  import { u as useColours } from './get-root-colours-DYEoJPEb.js';
5
- import { s as script } from './fw-button-D8GUq_wg.js';
5
+ import { s as script } from './fw-button-DdxvSBFa.js';
6
6
  import { s as styleInject } from './style-inject.es-tgCJW-Cu.js';
7
7
 
8
8
  var __default__ = defineComponent({
package/esm/fw-tag.js CHANGED
@@ -1,9 +1,9 @@
1
- export { _ as FwTag } from './fw-tag-BVEv8PMh.js';
1
+ export { _ as FwTag } from './fw-tag-508OLlZR.js';
2
2
  import 'vue';
3
3
  import './fw-button.js';
4
- import './fw-button-D8GUq_wg.js';
5
- import './fw-loading-spinner-AsWqai_A.js';
6
- import './index-B-9TSbb0.js';
4
+ import './fw-button-DdxvSBFa.js';
5
+ import './fw-loading-spinner-BEzZf1xe.js';
6
+ import './index-svDiDkSU.js';
7
7
  import './check--YD4Ts6g.js';
8
8
  import './style-inject.es-tgCJW-Cu.js';
9
9
  import './get-root-colours-DYEoJPEb.js';
package/esm/fw-toast.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { defineComponent, ref, computed, onMounted, watchEffect, openBlock, createElementBlock, Fragment, createBlock, Teleport, createVNode, TransitionGroup, createCommentVNode, Transition, withCtx, normalizeClass, createElementVNode, resolveDynamicComponent, renderSlot } from 'vue';
2
2
  import { u as uniqueId } from './uniqueId-DK6xzFd8.js';
3
- import { c as render$1, d as render$2, j as render$3 } from './index-B-9TSbb0.js';
3
+ import { c as render$1, d as render$2, k as render$3 } from './index-svDiDkSU.js';
4
4
  import { s as styleInject } from './style-inject.es-tgCJW-Cu.js';
5
5
  import './check--YD4Ts6g.js';
6
6
 
@@ -1,9 +1,9 @@
1
1
  import { defineComponent, createElementVNode, resolveComponent, openBlock, createBlock, withCtx, createCommentVNode, toDisplayString, createElementBlock } from 'vue';
2
2
  import { s as script$1 } from './fw-card-bsYbpPmW.js';
3
- import { s as script$2 } from './fw-image-DAUZLkf4.js';
3
+ import { s as script$2 } from './fw-image-DedhILQL.js';
4
4
  import './fw-loading-bar-DThRjdw1.js';
5
5
  import './style-inject.es-tgCJW-Cu.js';
6
- import './index-B-9TSbb0.js';
6
+ import './index-svDiDkSU.js';
7
7
  import './check--YD4Ts6g.js';
8
8
 
9
9
  var script = defineComponent({
@@ -583,4 +583,4 @@ function render(_ctx, _cache) {
583
583
  return (openBlock(), createElementBlock("svg", _hoisted_1, [..._hoisted_3]))
584
584
  }
585
585
 
586
- export { render$3 as a, render$6 as b, render$b as c, render$a as d, render$7 as e, render$n as f, render$9 as g, render$8 as h, render$d as i, render$l as j, render$s as k, render$o as r };
586
+ export { render$3 as a, render$6 as b, render$b as c, render$a as d, render$7 as e, render$n as f, render$9 as g, render$8 as h, render$m as i, render$d as j, render$l as k, render$s as l, render$o as r };
package/esm/index.js CHANGED
@@ -24,19 +24,19 @@ import { FwDatePicker as __default__$1 } from './fw-date-picker.js';
24
24
  import { FwPopover as __default__$3 } from './fw-popover.js';
25
25
  import { FwEmailPulse as __default__$2, FwSuccessPulse as __default__$4 } from './fw-animations.js';
26
26
  import { F as Form } from './vee-validate.esm-3ptvCDR1.js';
27
- import { s as script$7 } from './fw-input-CPU_C8IU.js';
28
- import { s as script$5 } from './fw-dropdown-YXj5yyty.js';
27
+ import { s as script$7 } from './fw-input-BPFFMpc2.js';
28
+ import { s as script$5 } from './fw-dropdown-BcnKbaW1.js';
29
29
  import { s as script$2 } from './fw-card-bsYbpPmW.js';
30
- import { s as script$1 } from './fw-button-D8GUq_wg.js';
31
- import { _ as __default__$6 } from './fw-tag-BVEv8PMh.js';
32
- import { _ as __default__$5, s as script$i, a as script$j } from './fw-table-row-7vke3KXB.js';
33
- import { s as script$6 } from './fw-image-DAUZLkf4.js';
30
+ import { s as script$1 } from './fw-button-DdxvSBFa.js';
31
+ import { _ as __default__$6 } from './fw-tag-508OLlZR.js';
32
+ import { _ as __default__$5, s as script$i, a as script$j } from './fw-table-row-Cianlk0N.js';
33
+ import { s as script$6 } from './fw-image-DedhILQL.js';
34
34
  import { s as script$8 } from './fw-loading-bar-DThRjdw1.js';
35
- import { s as script$a } from './fw-loading-spinner-AsWqai_A.js';
35
+ import { s as script$a } from './fw-loading-spinner-BEzZf1xe.js';
36
36
  import { reactive, createApp, h } from 'vue';
37
37
  import './uniqueId-DK6xzFd8.js';
38
38
  import './style-inject.es-tgCJW-Cu.js';
39
- import './index-B-9TSbb0.js';
39
+ import './index-svDiDkSU.js';
40
40
  import './check--YD4Ts6g.js';
41
41
  import './get-root-colours-DYEoJPEb.js';
42
42
  import './index-BVcOAKar.js';