@frollo/frollo-web-ui 1.2.3 → 1.2.5

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 (51) hide show
  1. package/cjs/index.js +1451 -719
  2. package/esm/{add-to-unscopables-44076600.js → add-to-unscopables-a5032b1d.js} +4 -4
  3. package/esm/{array-iteration-10670eca.js → array-iteration-4f83e223.js} +4 -4
  4. package/esm/{classof-b2d09c70.js → classof-088c9833.js} +2 -2
  5. package/esm/create-property-da6d232b.js +26 -0
  6. package/esm/es.array.find-54b8f84b.js +52 -0
  7. package/esm/{es.array.includes-b402df81.js → es.array.includes-9a6e4066.js} +4 -4
  8. package/esm/{es.function.name-383fcdbc.js → es.function.name-2fa3a718.js} +1 -1
  9. package/esm/{es.number.constructor-6def8fd9.js → es.number.constructor-b7faae1f.js} +5 -3
  10. package/esm/{function-name-0d296891.js → function-name-c49146fc.js} +1 -1
  11. package/esm/fw-animations.js +5 -5
  12. package/esm/{fw-button-fb8e3fe2.js → fw-button-d5d2cf19.js} +1 -1
  13. package/esm/fw-button.js +6 -6
  14. package/esm/fw-checkbox.js +2 -2
  15. package/esm/fw-dropdown.js +9 -54
  16. package/esm/fw-image.js +848 -0
  17. package/esm/fw-input.js +6 -6
  18. package/esm/fw-loading-bar-da7d53fb.js +22 -0
  19. package/esm/fw-loading.js +96 -0
  20. package/esm/fw-modal.js +7 -7
  21. package/esm/fw-navigation-menu.js +6 -6
  22. package/esm/fw-progress-bar.js +5 -5
  23. package/esm/fw-table.js +466 -8
  24. package/esm/fw-tabs.js +8 -8
  25. package/esm/fw-tag.js +5 -5
  26. package/esm/{index-26d82b11.js → index-7d8c95be.js} +2 -2
  27. package/esm/{index-ed9adbea.js → index-b3aa1664.js} +94 -80
  28. package/esm/index.js +36 -199
  29. package/esm/{is-forced-2369382d.js → is-forced-fd46b5f2.js} +2 -2
  30. package/esm/{object-keys-f9d76c12.js → object-keys-3c73c404.js} +2 -2
  31. package/esm/{to-string-2588bbbe.js → to-string-c2bd1f4d.js} +2 -2
  32. package/frollo-web-ui.esm.js +1635 -829
  33. package/icons/index.ts +3 -1
  34. package/icons/user.svg +3 -0
  35. package/index.d.ts +149 -17
  36. package/package.json +1 -1
  37. package/types/components/fw-image/fw-image.vue.d.ts +84 -0
  38. package/types/components/fw-image/index.d.ts +2 -0
  39. package/types/components/fw-image/index.types.d.ts +8 -0
  40. package/types/components/fw-loading/fw-loading-bar.vue.d.ts +2 -0
  41. package/types/components/fw-loading/fw-loading-card.vue.d.ts +2 -0
  42. package/types/components/fw-loading/fw-loading-table.vue.d.ts +25 -0
  43. package/types/components/fw-loading/index.d.ts +4 -0
  44. package/types/components/fw-table/fw-table.vue.d.ts +11 -1
  45. package/types/components/fw-table/index.types.d.ts +1 -0
  46. package/types/components/index.d.ts +2 -0
  47. package/types/components/index.types.d.ts +1 -0
  48. package/types/directives/index.d.ts +2 -0
  49. package/types/directives/lazy-loader.d.ts +3 -0
  50. package/types/icons/index.d.ts +2 -1
  51. package/esm/index-2ee67707.js +0 -454
package/esm/fw-input.js CHANGED
@@ -1,12 +1,12 @@
1
- import './es.array.includes-b402df81.js';
1
+ import './es.array.includes-9a6e4066.js';
2
2
  import { defineComponent, ref, computed, createElementVNode, resolveComponent, openBlock, createElementBlock, createVNode, withCtx, toDisplayString, createCommentVNode, renderSlot, mergeProps, Transition, normalizeClass } from 'vue';
3
3
  import { a as Field } from './vee-validate.esm-a17a23c3.js';
4
- import './es.function.name-383fcdbc.js';
4
+ import './es.function.name-2fa3a718.js';
5
5
  import { s as styleInject } from './style-inject.es-1f59c1d0.js';
6
- import './function-name-0d296891.js';
7
- import './object-keys-f9d76c12.js';
8
- import './is-forced-2369382d.js';
9
- import './add-to-unscopables-44076600.js';
6
+ import './function-name-c49146fc.js';
7
+ import './object-keys-3c73c404.js';
8
+ import './is-forced-fd46b5f2.js';
9
+ import './add-to-unscopables-a5032b1d.js';
10
10
 
11
11
  var script = defineComponent({
12
12
  name: 'FwInput',
@@ -0,0 +1,22 @@
1
+ import { defineComponent, openBlock, createElementBlock } from 'vue';
2
+ import { s as styleInject } from './style-inject.es-1f59c1d0.js';
3
+
4
+ var script = defineComponent({
5
+ name: 'FwLoadingBar'
6
+ });
7
+
8
+ var _hoisted_1 = {
9
+ "class": "fw-loading-bar rounded",
10
+ "aria-hidden": "true"
11
+ };
12
+ function render(_ctx, _cache, $props, $setup, $data, $options) {
13
+ return openBlock(), createElementBlock("div", _hoisted_1);
14
+ }
15
+
16
+ var css_248z = ".fw-loading-bar{-webkit-animation:fwSkeletonLoading 1.5s linear infinite;animation:fwSkeletonLoading 1.5s linear infinite;background:#e4e4e4;background-image:-o-linear-gradient(350deg,hsla(0,0%,100%,0) 40%,hsla(0,0%,100%,.5) 50%,hsla(0,0%,100%,0) 60%);background-image:linear-gradient(100deg,hsla(0,0%,100%,0) 40%,hsla(0,0%,100%,.5) 50%,hsla(0,0%,100%,0) 60%);background-size:200% 200%}@-webkit-keyframes fwSkeletonLoading{0%{background-position-x:200%}50%{background-position-x:100%}to{background-position-x:0}}@keyframes fwSkeletonLoading{0%{background-position-x:200%}50%{background-position-x:100%}to{background-position-x:0}}";
17
+ var stylesheet = ".fw-loading-bar{-webkit-animation:fwSkeletonLoading 1.5s linear infinite;animation:fwSkeletonLoading 1.5s linear infinite;background:#e4e4e4;background-image:-o-linear-gradient(350deg,hsla(0,0%,100%,0) 40%,hsla(0,0%,100%,.5) 50%,hsla(0,0%,100%,0) 60%);background-image:linear-gradient(100deg,hsla(0,0%,100%,0) 40%,hsla(0,0%,100%,.5) 50%,hsla(0,0%,100%,0) 60%);background-size:200% 200%}@-webkit-keyframes fwSkeletonLoading{0%{background-position-x:200%}50%{background-position-x:100%}to{background-position-x:0}}@keyframes fwSkeletonLoading{0%{background-position-x:200%}50%{background-position-x:100%}to{background-position-x:0}}";
18
+ styleInject(css_248z);
19
+
20
+ script.render = render;
21
+
22
+ export { script as s };
@@ -0,0 +1,96 @@
1
+ import { s as script$2 } from './fw-loading-bar-da7d53fb.js';
2
+ export { s as FwLoadingBar } from './fw-loading-bar-da7d53fb.js';
3
+ import { defineComponent, resolveComponent, openBlock, createElementBlock, createElementVNode, createVNode, normalizeClass, Fragment, renderList } from 'vue';
4
+ import './es.number.constructor-b7faae1f.js';
5
+ import './style-inject.es-1f59c1d0.js';
6
+ import './function-name-c49146fc.js';
7
+ import './is-forced-fd46b5f2.js';
8
+ import './to-string-c2bd1f4d.js';
9
+ import './classof-088c9833.js';
10
+
11
+ var script$1 = defineComponent({
12
+ name: 'FwLoadingCard',
13
+ components: {
14
+ FwLoadingBar: script$2
15
+ }
16
+ });
17
+
18
+ var _hoisted_1$1 = {
19
+ "class": "fw-loading-card rounded shadow-card relative"
20
+ };
21
+ var _hoisted_2$1 = {
22
+ "class": "w-full bg-white h-12 p-3 pr-12 absolute top-0 left-0 rounded-t"
23
+ };
24
+ function render$1(_ctx, _cache, $props, $setup, $data, $options) {
25
+ var _component_FwLoadingBar = resolveComponent("FwLoadingBar");
26
+
27
+ return openBlock(), createElementBlock("div", _hoisted_1$1, [createElementVNode("div", _hoisted_2$1, [createVNode(_component_FwLoadingBar, {
28
+ "class": "w-2/4 h-5"
29
+ })]), createVNode(_component_FwLoadingBar, {
30
+ "class": "w-full h-full rounded-t-none"
31
+ })]);
32
+ }
33
+
34
+ script$1.render = render$1;
35
+
36
+ var script = defineComponent({
37
+ name: 'FwLoadingTable',
38
+ components: {
39
+ FwLoadingBar: script$2
40
+ },
41
+ props: {
42
+ columns: {
43
+ type: Number,
44
+ "default": 5
45
+ },
46
+ rows: {
47
+ type: Number,
48
+ "default": 5
49
+ }
50
+ },
51
+ setup: function setup() {
52
+ var tableClass = "fw-loading-table table-auto cursor-wait table-responsive rounded border border-grey-40\n border-spacing-px border-separate bg-grey-40";
53
+ return {
54
+ tableClass: tableClass
55
+ };
56
+ }
57
+ });
58
+
59
+ var _hoisted_1 = {
60
+ "class": "text-p-small bg-white"
61
+ };
62
+ var _hoisted_2 = {
63
+ "class": "flex flex-row items-center space-x-1"
64
+ };
65
+ var _hoisted_3 = {
66
+ "class": "text-p-small bg-white font-light"
67
+ };
68
+ function render(_ctx, _cache, $props, $setup, $data, $options) {
69
+ var _component_FwLoadingBar = resolveComponent("FwLoadingBar");
70
+
71
+ return openBlock(), createElementBlock("table", {
72
+ "class": normalizeClass(_ctx.tableClass)
73
+ }, [createElementVNode("thead", _hoisted_1, [createElementVNode("tr", null, [(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.columns, function (column, thKey) {
74
+ return openBlock(), createElementBlock("th", {
75
+ key: thKey,
76
+ "class": "py-3 px-4 text-center border-b border-b-grey-light"
77
+ }, [createElementVNode("div", _hoisted_2, [createVNode(_component_FwLoadingBar, {
78
+ "class": "w-full h-8"
79
+ })])]);
80
+ }), 128))])]), createElementVNode("tbody", _hoisted_3, [(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.rows, function (row, trKey) {
81
+ return openBlock(), createElementBlock("tr", {
82
+ key: trKey
83
+ }, [(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.columns, function (column, colKey) {
84
+ return openBlock(), createElementBlock("td", {
85
+ key: colKey,
86
+ "class": "py-3 px-4 text-left whitespace-nowrap"
87
+ }, [createVNode(_component_FwLoadingBar, {
88
+ "class": "w-full h-6"
89
+ })]);
90
+ }), 128))]);
91
+ }), 128))])], 2);
92
+ }
93
+
94
+ script.render = render;
95
+
96
+ export { script$1 as FwLoadingCard, script as FwLoadingTable };
package/esm/fw-modal.js CHANGED
@@ -1,9 +1,9 @@
1
- export { s as FwModal } from './index-26d82b11.js';
2
- import './es.array.includes-b402df81.js';
3
- import './function-name-0d296891.js';
4
- import './object-keys-f9d76c12.js';
5
- import './is-forced-2369382d.js';
6
- import './add-to-unscopables-44076600.js';
1
+ export { s as FwModal } from './index-7d8c95be.js';
2
+ import './es.array.includes-9a6e4066.js';
3
+ import './function-name-c49146fc.js';
4
+ import './object-keys-3c73c404.js';
5
+ import './is-forced-fd46b5f2.js';
6
+ import './add-to-unscopables-a5032b1d.js';
7
7
  import 'vue';
8
- import './fw-button-fb8e3fe2.js';
8
+ import './fw-button-d5d2cf19.js';
9
9
  import './style-inject.es-1f59c1d0.js';
@@ -1,11 +1,11 @@
1
1
  import { defineComponent, ref, createElementVNode, resolveComponent, openBlock, createElementBlock, renderSlot, createCommentVNode, Fragment, renderList, createBlock, withCtx, createTextVNode, toDisplayString, createVNode, Transition, normalizeClass } from 'vue';
2
- import { s as script$1 } from './fw-button-fb8e3fe2.js';
2
+ import { s as script$1 } from './fw-button-d5d2cf19.js';
3
3
  import { s as styleInject } from './style-inject.es-1f59c1d0.js';
4
- import './es.array.includes-b402df81.js';
5
- import './function-name-0d296891.js';
6
- import './object-keys-f9d76c12.js';
7
- import './is-forced-2369382d.js';
8
- import './add-to-unscopables-44076600.js';
4
+ import './es.array.includes-9a6e4066.js';
5
+ import './function-name-c49146fc.js';
6
+ import './object-keys-3c73c404.js';
7
+ import './is-forced-fd46b5f2.js';
8
+ import './add-to-unscopables-a5032b1d.js';
9
9
 
10
10
  var script = defineComponent({
11
11
  name: 'FwNavigationMenu',
@@ -1,10 +1,10 @@
1
- import './es.number.constructor-6def8fd9.js';
1
+ import './es.number.constructor-b7faae1f.js';
2
2
  import { defineComponent, resolveComponent, openBlock, createElementBlock, createElementVNode, Fragment, renderList, normalizeClass, createBlock, toDisplayString, normalizeStyle, createCommentVNode } from 'vue';
3
3
  import { r as render$1 } from './check-94a5917a.js';
4
- import './function-name-0d296891.js';
5
- import './is-forced-2369382d.js';
6
- import './to-string-2588bbbe.js';
7
- import './classof-b2d09c70.js';
4
+ import './function-name-c49146fc.js';
5
+ import './is-forced-fd46b5f2.js';
6
+ import './to-string-c2bd1f4d.js';
7
+ import './classof-088c9833.js';
8
8
 
9
9
  var script = defineComponent({
10
10
  name: 'FwProgressBar',
package/esm/fw-table.js CHANGED
@@ -1,9 +1,467 @@
1
- export { s as FwTable, b as FwTableHead, c as FwTableRow } from './index-2ee67707.js';
2
- import './function-name-0d296891.js';
3
- import './object-keys-f9d76c12.js';
4
- import './is-forced-2369382d.js';
5
- import './to-string-2588bbbe.js';
6
- import './classof-b2d09c70.js';
7
- import './index-ed9adbea.js';
8
- import 'vue';
1
+ import { i as toObject$2, j as fails$2, t as tryToString$1, q as engineUserAgent, f as functionUncurryThis, h as aCallable$1, s as engineV8Version } from './function-name-c49146fc.js';
2
+ import { _ as _export, o as objectKeys } from './object-keys-3c73c404.js';
3
+ import { e as toAbsoluteIndex$1, l as lengthOfArrayLike$2 } from './is-forced-fd46b5f2.js';
4
+ import { t as toString$1 } from './to-string-c2bd1f4d.js';
5
+ import { c as createProperty$1, a as arrayMethodIsStrict$1 } from './create-property-da6d232b.js';
6
+ import { b as render$3 } from './index-b3aa1664.js';
7
+ import { defineComponent, computed, ref, resolveComponent, openBlock, createElementBlock, normalizeClass, createElementVNode, Fragment, renderList, withKeys, toDisplayString, createVNode, createCommentVNode, renderSlot } from 'vue';
8
+ import { s as script$3 } from './fw-loading-bar-da7d53fb.js';
9
+ import './classof-088c9833.js';
9
10
  import './check-94a5917a.js';
11
+ import './style-inject.es-1f59c1d0.js';
12
+
13
+ var es_object_keys = {};
14
+
15
+ var $$1 = _export;
16
+ var toObject$1 = toObject$2;
17
+ var nativeKeys = objectKeys;
18
+ var fails$1 = fails$2;
19
+
20
+ var FAILS_ON_PRIMITIVES = fails$1(function () { nativeKeys(1); });
21
+
22
+ // `Object.keys` method
23
+ // https://tc39.es/ecma262/#sec-object.keys
24
+ $$1({ target: 'Object', stat: true, forced: FAILS_ON_PRIMITIVES }, {
25
+ keys: function keys(it) {
26
+ return nativeKeys(toObject$1(it));
27
+ }
28
+ });
29
+
30
+ var es_array_sort = {};
31
+
32
+ 'use strict';
33
+ var tryToString = tryToString$1;
34
+
35
+ var $TypeError = TypeError;
36
+
37
+ var deletePropertyOrThrow$1 = function (O, P) {
38
+ if (!delete O[P]) throw $TypeError('Cannot delete property ' + tryToString(P) + ' of ' + tryToString(O));
39
+ };
40
+
41
+ var toAbsoluteIndex = toAbsoluteIndex$1;
42
+ var lengthOfArrayLike$1 = lengthOfArrayLike$2;
43
+ var createProperty = createProperty$1;
44
+
45
+ var $Array = Array;
46
+ var max = Math.max;
47
+
48
+ var arraySliceSimple = function (O, start, end) {
49
+ var length = lengthOfArrayLike$1(O);
50
+ var k = toAbsoluteIndex(start, length);
51
+ var fin = toAbsoluteIndex(end === undefined ? length : end, length);
52
+ var result = $Array(max(fin - k, 0));
53
+ for (var n = 0; k < fin; k++, n++) createProperty(result, n, O[k]);
54
+ result.length = n;
55
+ return result;
56
+ };
57
+
58
+ var arraySlice = arraySliceSimple;
59
+
60
+ var floor = Math.floor;
61
+
62
+ var mergeSort = function (array, comparefn) {
63
+ var length = array.length;
64
+ var middle = floor(length / 2);
65
+ return length < 8 ? insertionSort(array, comparefn) : merge(
66
+ array,
67
+ mergeSort(arraySlice(array, 0, middle), comparefn),
68
+ mergeSort(arraySlice(array, middle), comparefn),
69
+ comparefn
70
+ );
71
+ };
72
+
73
+ var insertionSort = function (array, comparefn) {
74
+ var length = array.length;
75
+ var i = 1;
76
+ var element, j;
77
+
78
+ while (i < length) {
79
+ j = i;
80
+ element = array[i];
81
+ while (j && comparefn(array[j - 1], element) > 0) {
82
+ array[j] = array[--j];
83
+ }
84
+ if (j !== i++) array[j] = element;
85
+ } return array;
86
+ };
87
+
88
+ var merge = function (array, left, right, comparefn) {
89
+ var llength = left.length;
90
+ var rlength = right.length;
91
+ var lindex = 0;
92
+ var rindex = 0;
93
+
94
+ while (lindex < llength || rindex < rlength) {
95
+ array[lindex + rindex] = (lindex < llength && rindex < rlength)
96
+ ? comparefn(left[lindex], right[rindex]) <= 0 ? left[lindex++] : right[rindex++]
97
+ : lindex < llength ? left[lindex++] : right[rindex++];
98
+ } return array;
99
+ };
100
+
101
+ var arraySort = mergeSort;
102
+
103
+ var userAgent$1 = engineUserAgent;
104
+
105
+ var firefox = userAgent$1.match(/firefox\/(\d+)/i);
106
+
107
+ var engineFfVersion = !!firefox && +firefox[1];
108
+
109
+ var UA = engineUserAgent;
110
+
111
+ var engineIsIeOrEdge = /MSIE|Trident/.test(UA);
112
+
113
+ var userAgent = engineUserAgent;
114
+
115
+ var webkit = userAgent.match(/AppleWebKit\/(\d+)\./);
116
+
117
+ var engineWebkitVersion = !!webkit && +webkit[1];
118
+
119
+ 'use strict';
120
+ var $ = _export;
121
+ var uncurryThis = functionUncurryThis;
122
+ var aCallable = aCallable$1;
123
+ var toObject = toObject$2;
124
+ var lengthOfArrayLike = lengthOfArrayLike$2;
125
+ var deletePropertyOrThrow = deletePropertyOrThrow$1;
126
+ var toString = toString$1;
127
+ var fails = fails$2;
128
+ var internalSort = arraySort;
129
+ var arrayMethodIsStrict = arrayMethodIsStrict$1;
130
+ var FF = engineFfVersion;
131
+ var IE_OR_EDGE = engineIsIeOrEdge;
132
+ var V8 = engineV8Version;
133
+ var WEBKIT = engineWebkitVersion;
134
+
135
+ var test = [];
136
+ var un$Sort = uncurryThis(test.sort);
137
+ var push = uncurryThis(test.push);
138
+
139
+ // IE8-
140
+ var FAILS_ON_UNDEFINED = fails(function () {
141
+ test.sort(undefined);
142
+ });
143
+ // V8 bug
144
+ var FAILS_ON_NULL = fails(function () {
145
+ test.sort(null);
146
+ });
147
+ // Old WebKit
148
+ var STRICT_METHOD = arrayMethodIsStrict('sort');
149
+
150
+ var STABLE_SORT = !fails(function () {
151
+ // feature detection can be too slow, so check engines versions
152
+ if (V8) return V8 < 70;
153
+ if (FF && FF > 3) return;
154
+ if (IE_OR_EDGE) return true;
155
+ if (WEBKIT) return WEBKIT < 603;
156
+
157
+ var result = '';
158
+ var code, chr, value, index;
159
+
160
+ // generate an array with more 512 elements (Chakra and old V8 fails only in this case)
161
+ for (code = 65; code < 76; code++) {
162
+ chr = String.fromCharCode(code);
163
+
164
+ switch (code) {
165
+ case 66: case 69: case 70: case 72: value = 3; break;
166
+ case 68: case 71: value = 4; break;
167
+ default: value = 2;
168
+ }
169
+
170
+ for (index = 0; index < 47; index++) {
171
+ test.push({ k: chr + index, v: value });
172
+ }
173
+ }
174
+
175
+ test.sort(function (a, b) { return b.v - a.v; });
176
+
177
+ for (index = 0; index < test.length; index++) {
178
+ chr = test[index].k.charAt(0);
179
+ if (result.charAt(result.length - 1) !== chr) result += chr;
180
+ }
181
+
182
+ return result !== 'DGBEFHACIJK';
183
+ });
184
+
185
+ var FORCED = FAILS_ON_UNDEFINED || !FAILS_ON_NULL || !STRICT_METHOD || !STABLE_SORT;
186
+
187
+ var getSortCompare = function (comparefn) {
188
+ return function (x, y) {
189
+ if (y === undefined) return -1;
190
+ if (x === undefined) return 1;
191
+ if (comparefn !== undefined) return +comparefn(x, y) || 0;
192
+ return toString(x) > toString(y) ? 1 : -1;
193
+ };
194
+ };
195
+
196
+ // `Array.prototype.sort` method
197
+ // https://tc39.es/ecma262/#sec-array.prototype.sort
198
+ $({ target: 'Array', proto: true, forced: FORCED }, {
199
+ sort: function sort(comparefn) {
200
+ if (comparefn !== undefined) aCallable(comparefn);
201
+
202
+ var array = toObject(this);
203
+
204
+ if (STABLE_SORT) return comparefn === undefined ? un$Sort(array) : un$Sort(array, comparefn);
205
+
206
+ var items = [];
207
+ var arrayLength = lengthOfArrayLike(array);
208
+ var itemsLength, index;
209
+
210
+ for (index = 0; index < arrayLength; index++) {
211
+ if (index in array) push(items, array[index]);
212
+ }
213
+
214
+ internalSort(items, getSortCompare(comparefn));
215
+
216
+ itemsLength = items.length;
217
+ index = 0;
218
+
219
+ while (index < itemsLength) array[index] = items[index++];
220
+ while (index < arrayLength) deletePropertyOrThrow(array, index++);
221
+
222
+ return array;
223
+ }
224
+ });
225
+
226
+ var script$2 = defineComponent({
227
+ name: 'FwTable',
228
+ components: {
229
+ CaretDownSvg: render$3,
230
+ FwLoadingBar: script$3
231
+ },
232
+ props: {
233
+ items: {
234
+ type: Array,
235
+ required: true
236
+ },
237
+ options: {
238
+ type: Object,
239
+ required: false
240
+ },
241
+ loading: {
242
+ type: Boolean,
243
+ "default": false
244
+ }
245
+ },
246
+ setup: function setup(props) {
247
+ var columns = computed(function () {
248
+ return Object.keys(props.items[0]);
249
+ });
250
+ var sortBy = ref('');
251
+ var sortDirection = ref('asc');
252
+ var currentSortedColumn = ref('');
253
+
254
+ var sortColumn = function sortColumn(column) {
255
+ if (!isColumnSortable(column)) return;
256
+ currentSortedColumn.value = column;
257
+
258
+ if (sortBy.value === column) {
259
+ sortDirection.value = sortDirection.value === 'asc' ? 'desc' : 'asc';
260
+ } else {
261
+ sortBy.value = column;
262
+ sortDirection.value = 'asc';
263
+ }
264
+ };
265
+
266
+ var sortedData = computed(function () {
267
+ if (!sortBy.value) {
268
+ return props.items;
269
+ }
270
+
271
+ var data = props.items;
272
+ data.sort(function (a, b) {
273
+ var sortVal = a[sortBy.value] > b[sortBy.value] ? 1 : -1;
274
+ return sortDirection.value === 'asc' ? sortVal : -sortVal;
275
+ });
276
+ return data;
277
+ });
278
+
279
+ var formattedText = function formattedText(row, column) {
280
+ var _props$options$column;
281
+
282
+ if (props.options && props.options[column] && (_props$options$column = props.options[column]) !== null && _props$options$column !== void 0 && _props$options$column.formatter) {
283
+ var _props$options$column2;
284
+
285
+ var colFormatter = (_props$options$column2 = props.options[column]) === null || _props$options$column2 === void 0 ? void 0 : _props$options$column2.formatter;
286
+
287
+ if (colFormatter) {
288
+ return colFormatter(row[column]);
289
+ }
290
+ }
291
+
292
+ return row[column];
293
+ };
294
+
295
+ var sortedIcon = function sortedIcon(sortDir, column) {
296
+ if (currentSortedColumn.value === column) {
297
+ if (sortDirection.value === sortDir) {
298
+ return 'text-body';
299
+ }
300
+ }
301
+
302
+ return 'text-grey-light';
303
+ };
304
+
305
+ var isColumnSortable = function isColumnSortable(column) {
306
+ if (props.options && props.options[column]) {
307
+ var _props$options$column3;
308
+
309
+ return (_props$options$column3 = props.options[column]) === null || _props$options$column3 === void 0 ? void 0 : _props$options$column3.isSortable;
310
+ }
311
+
312
+ return false;
313
+ };
314
+
315
+ var isDisabled = function isDisabled(column) {
316
+ var _props$options$column4;
317
+
318
+ if (props.options && (_props$options$column4 = props.options[column]) !== null && _props$options$column4 !== void 0 && _props$options$column4.disabled) {
319
+ return true;
320
+ }
321
+
322
+ return false;
323
+ };
324
+
325
+ return {
326
+ columns: columns,
327
+ sortBy: sortBy,
328
+ sortDirection: sortDirection,
329
+ sortColumn: sortColumn,
330
+ sortedData: sortedData,
331
+ currentSortedColumn: currentSortedColumn,
332
+ sortedIcon: sortedIcon,
333
+ formattedText: formattedText,
334
+ isColumnSortable: isColumnSortable,
335
+ isDisabled: isDisabled
336
+ };
337
+ }
338
+ });
339
+
340
+ var _hoisted_1$2 = {
341
+ "class": "text-p-small bg-grey-20"
342
+ };
343
+ var _hoisted_2$1 = ["tabindex", "onKeydown", "onClick"];
344
+ var _hoisted_3$1 = {
345
+ "class": "flex flex-row items-center space-x-1"
346
+ };
347
+ var _hoisted_4 = {
348
+ "class": "w-full"
349
+ };
350
+ var _hoisted_5 = {
351
+ key: 0
352
+ };
353
+ var _hoisted_6 = {
354
+ "class": "flex flex-col"
355
+ };
356
+ var _hoisted_7 = {
357
+ "class": "text-p-small bg-white font-light"
358
+ };
359
+ var _hoisted_8 = {
360
+ key: 0,
361
+ "class": "py-3 px-4 text-left whitespace-nowrap"
362
+ };
363
+ var _hoisted_9 = {
364
+ key: 0,
365
+ "class": "py-3 px-4 text-left whitespace-nowrap"
366
+ };
367
+ var _hoisted_10 = ["innerHTML"];
368
+ function render$2(_ctx, _cache, $props, $setup, $data, $options) {
369
+ var _component_CaretDownSvg = resolveComponent("CaretDownSvg");
370
+
371
+ var _component_FwLoadingBar = resolveComponent("FwLoadingBar");
372
+
373
+ return openBlock(), createElementBlock("table", {
374
+ "class": normalizeClass(["table-auto table-responsive rounded border border-grey-40 border-spacing-px border-separate bg-grey-40", _ctx.loading ? 'cursor-wait' : ''])
375
+ }, [createElementVNode("thead", _hoisted_1$2, [createElementVNode("tr", null, [(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.columns, function (column, thKey) {
376
+ return openBlock(), createElementBlock(Fragment, {
377
+ key: thKey
378
+ }, [!_ctx.isDisabled(column) ? (openBlock(), createElementBlock("th", {
379
+ key: 0,
380
+ "class": normalizeClass(["py-3 px-4 text-center", _ctx.isColumnSortable(column) ? 'cursor-pointer hover:bg-grey-40' : '']),
381
+ tabindex: _ctx.isColumnSortable(column) ? 1 : -1,
382
+ onKeydown: withKeys(function ($event) {
383
+ return _ctx.sortColumn(column);
384
+ }, ["enter", "space"]),
385
+ onClick: function onClick($event) {
386
+ return _ctx.sortColumn(column);
387
+ }
388
+ }, [createElementVNode("div", _hoisted_3$1, [createElementVNode("span", _hoisted_4, toDisplayString(column), 1), _ctx.isColumnSortable(column) ? (openBlock(), createElementBlock("span", _hoisted_5, [createElementVNode("span", _hoisted_6, [createVNode(_component_CaretDownSvg, {
389
+ "class": normalizeClass(["inline-block w-[12px] rotate-180", _ctx.sortedIcon('asc', column)])
390
+ }, null, 8, ["class"]), createVNode(_component_CaretDownSvg, {
391
+ "class": normalizeClass(["inline-block w-[12px] mt-[2px]", _ctx.sortedIcon('desc', column)])
392
+ }, null, 8, ["class"])])])) : createCommentVNode("", true)])], 42, _hoisted_2$1)) : createCommentVNode("", true)], 64);
393
+ }), 128)), _ctx.$slots.head ? renderSlot(_ctx.$slots, "head", {
394
+ key: 0
395
+ }) : createCommentVNode("", true)])]), createElementVNode("tbody", _hoisted_7, [_ctx.loading ? (openBlock(true), createElementBlock(Fragment, {
396
+ key: 0
397
+ }, renderList(_ctx.sortedData, function (row, trKey) {
398
+ return openBlock(), createElementBlock("tr", {
399
+ key: trKey
400
+ }, [(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.columns, function (column, colKey) {
401
+ return openBlock(), createElementBlock(Fragment, {
402
+ key: colKey
403
+ }, [!_ctx.isDisabled(column) ? (openBlock(), createElementBlock("td", _hoisted_8, [createVNode(_component_FwLoadingBar, {
404
+ "class": "w-full h-7"
405
+ })])) : createCommentVNode("", true)], 64);
406
+ }), 128)), _ctx.$slots.row ? (openBlock(), createElementBlock("td", _hoisted_9, [createVNode(_component_FwLoadingBar, {
407
+ "class": "w-full h-7"
408
+ })])) : createCommentVNode("", true)]);
409
+ }), 128)) : (openBlock(true), createElementBlock(Fragment, {
410
+ key: 1
411
+ }, renderList(_ctx.sortedData, function (row, trKey) {
412
+ return openBlock(), createElementBlock("tr", {
413
+ "class": "border-b border-grey-40 hover:bg-grey-lightest",
414
+ key: trKey
415
+ }, [(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.columns, function (column, colKey) {
416
+ return openBlock(), createElementBlock(Fragment, {
417
+ key: colKey
418
+ }, [!_ctx.isDisabled(column) ? (openBlock(), createElementBlock("td", {
419
+ key: 0,
420
+ "class": "py-3 px-4 text-left whitespace-nowrap",
421
+ innerHTML: _ctx.formattedText(row, column)
422
+ }, null, 8, _hoisted_10)) : createCommentVNode("", true)], 64);
423
+ }), 128)), _ctx.$slots.row ? renderSlot(_ctx.$slots, "row", {
424
+ key: 0,
425
+ row: row
426
+ }) : createCommentVNode("", true)]);
427
+ }), 128))])], 2);
428
+ }
429
+
430
+ script$2.render = render$2;
431
+
432
+ var script$1 = defineComponent({
433
+ name: 'FwTableHead'
434
+ });
435
+
436
+ var _hoisted_1$1 = {
437
+ "class": "py-3 px-4 text-center"
438
+ };
439
+ var _hoisted_2 = {
440
+ "class": "flex flex-row items-center space-x-1"
441
+ };
442
+ var _hoisted_3 = {
443
+ key: 0,
444
+ "class": "w-full"
445
+ };
446
+ function render$1(_ctx, _cache, $props, $setup, $data, $options) {
447
+ return openBlock(), createElementBlock("th", _hoisted_1$1, [createElementVNode("div", _hoisted_2, [_ctx.$slots["default"] ? (openBlock(), createElementBlock("div", _hoisted_3, [renderSlot(_ctx.$slots, "default")])) : createCommentVNode("", true)])]);
448
+ }
449
+
450
+ script$1.render = render$1;
451
+
452
+ var script = defineComponent({
453
+ name: 'FwTableRow'
454
+ });
455
+
456
+ var _hoisted_1 = {
457
+ "class": "py-3 px-4 text-left whitespace-nowrap"
458
+ };
459
+ function render(_ctx, _cache, $props, $setup, $data, $options) {
460
+ return openBlock(), createElementBlock("td", _hoisted_1, [_ctx.$slots["default"] ? renderSlot(_ctx.$slots, "default", {
461
+ key: 0
462
+ }) : createCommentVNode("", true)]);
463
+ }
464
+
465
+ script.render = render;
466
+
467
+ export { script$2 as FwTable, script$1 as FwTableHead, script as FwTableRow };