@frollo/frollo-web-ui 8.1.0 → 8.1.2
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.
- package/cjs/index.js +31 -98
- package/esm/fw-provider-list.js +1 -1
- package/esm/{fw-table-row-DhDvTJHm.js → fw-table-row-CBQBV4yq.js} +28 -96
- package/esm/fw-table.js +1 -4
- package/esm/index.js +1 -1
- package/frollo-web-ui.esm.js +31 -98
- package/index.d.ts +9 -7
- package/package.json +1 -1
- package/types/components/fw-table/fw-table.vue.d.ts +8 -7
- package/types/components/fw-table/index.types.d.ts +1 -0
- package/web-components/index.js +33 -100
package/frollo-web-ui.esm.js
CHANGED
|
@@ -8302,10 +8302,10 @@ var _hoisted_10$4 = {
|
|
|
8302
8302
|
};
|
|
8303
8303
|
var _hoisted_11$2 = ["aria-labelledby"];
|
|
8304
8304
|
var _hoisted_12$2 = ["onClick"];
|
|
8305
|
-
var _hoisted_13$
|
|
8305
|
+
var _hoisted_13$1 = {
|
|
8306
8306
|
"class": "flex items-center gap-x-2"
|
|
8307
8307
|
};
|
|
8308
|
-
var _hoisted_14$
|
|
8308
|
+
var _hoisted_14$1 = {
|
|
8309
8309
|
"class": "flex flex-col text-left"
|
|
8310
8310
|
};
|
|
8311
8311
|
var _hoisted_15$1 = {
|
|
@@ -8364,11 +8364,11 @@ function render$p(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
8364
8364
|
onClick: function onClick($event) {
|
|
8365
8365
|
return _ctx.selectOption(option);
|
|
8366
8366
|
}
|
|
8367
|
-
}, [createElementVNode("div", _hoisted_13$
|
|
8367
|
+
}, [createElementVNode("div", _hoisted_13$1, [option.image_url ? (openBlock(), createBlock(_component_FwImage, {
|
|
8368
8368
|
key: 0,
|
|
8369
8369
|
src: option.image_url,
|
|
8370
8370
|
"class": "w-[20px] h-[20px]"
|
|
8371
|
-
}, null, 8, ["src"])) : createCommentVNode("", true), createElementVNode("div", _hoisted_14$
|
|
8371
|
+
}, null, 8, ["src"])) : createCommentVNode("", true), createElementVNode("div", _hoisted_14$1, [createElementVNode("span", null, toDisplayString(option.label), 1), option.description ? (openBlock(), createElementBlock("span", _hoisted_15$1, toDisplayString(option.description), 1)) : createCommentVNode("", true)])])], 10, _hoisted_12$2);
|
|
8372
8372
|
}), 128))], 10, _hoisted_11$2), [[vShow, _ctx.isOpen]])];
|
|
8373
8373
|
}),
|
|
8374
8374
|
_: 1
|
|
@@ -9565,8 +9565,7 @@ var __default__$6 = defineComponent({
|
|
|
9565
9565
|
ChevronLeftSvg: render$O,
|
|
9566
9566
|
ChevronRightSvg: render$P,
|
|
9567
9567
|
FwLoadingBar: script$k,
|
|
9568
|
-
FwButton: script$f
|
|
9569
|
-
FwInput: script$m
|
|
9568
|
+
FwButton: script$f
|
|
9570
9569
|
},
|
|
9571
9570
|
emits: [/** Fired when a row is clicked with row data */
|
|
9572
9571
|
'rowClicked', /** Fired when a column is sorted */
|
|
@@ -9602,6 +9601,9 @@ var __default__$6 = defineComponent({
|
|
|
9602
9601
|
},
|
|
9603
9602
|
totalAmount: {
|
|
9604
9603
|
type: Number
|
|
9604
|
+
},
|
|
9605
|
+
pageSize: {
|
|
9606
|
+
type: Number
|
|
9605
9607
|
}
|
|
9606
9608
|
},
|
|
9607
9609
|
setup: function setup(props, ctx) {
|
|
@@ -9611,39 +9613,15 @@ var __default__$6 = defineComponent({
|
|
|
9611
9613
|
var sortBy = ref('');
|
|
9612
9614
|
var sortDirection = ref('asc');
|
|
9613
9615
|
var currentSortedColumn = ref('');
|
|
9614
|
-
var currentPage = ref(
|
|
9615
|
-
var
|
|
9616
|
-
var pages = computed(function () {
|
|
9617
|
-
if (!props.totalAmount) return;
|
|
9618
|
-
var currentPageNumber = Number(currentPage.value);
|
|
9619
|
-
var pageButtons = [];
|
|
9620
|
-
var pageNumberLimit = currentPageNumber + maxDisplayedPages - 1;
|
|
9621
|
-
var maxPageNumber = props.totalAmount - currentPageNumber < maxDisplayedPages ? props.totalAmount : pageNumberLimit + 1;
|
|
9622
|
-
for (var i = currentPageNumber; i < maxPageNumber + 1; i++) {
|
|
9623
|
-
pageButtons.push({
|
|
9624
|
-
pageNumber: i.toString(),
|
|
9625
|
-
selected: i.toString() === currentPage.value
|
|
9626
|
-
});
|
|
9627
|
-
}
|
|
9628
|
-
if (props.totalAmount === maxDisplayedPages) {
|
|
9629
|
-
return pageButtons;
|
|
9630
|
-
}
|
|
9631
|
-
if (props.totalAmount - currentPageNumber > maxDisplayedPages) {
|
|
9632
|
-
pageButtons.push({
|
|
9633
|
-
pageNumber: '...',
|
|
9634
|
-
selected: false
|
|
9635
|
-
}, {
|
|
9636
|
-
pageNumber: props.totalAmount.toString(),
|
|
9637
|
-
selected: false
|
|
9638
|
-
});
|
|
9639
|
-
}
|
|
9640
|
-
ctx.emit('pageChanged', currentPage.value);
|
|
9641
|
-
return pageButtons;
|
|
9642
|
-
});
|
|
9616
|
+
var currentPage = ref(1);
|
|
9617
|
+
var maxPageAmount = ref();
|
|
9643
9618
|
onMounted(function () {
|
|
9644
9619
|
if (Number(props.autoSortColumn) >= 0) {
|
|
9645
9620
|
sortColumn(columns.value[Number(props.autoSortColumn)], false);
|
|
9646
9621
|
}
|
|
9622
|
+
if (props.totalAmount && props.pageSize) {
|
|
9623
|
+
maxPageAmount.value = Math.ceil(props.totalAmount / props.pageSize);
|
|
9624
|
+
}
|
|
9647
9625
|
});
|
|
9648
9626
|
var _useColours = useColours(),
|
|
9649
9627
|
bgHoverColor = _useColours.primaryFade5;
|
|
@@ -9713,15 +9691,9 @@ var __default__$6 = defineComponent({
|
|
|
9713
9691
|
var rowClicked = function rowClicked(row) {
|
|
9714
9692
|
if (props.clickableRows) ctx.emit('rowClicked', row);
|
|
9715
9693
|
};
|
|
9716
|
-
var pageNumberClick = function pageNumberClick(pageNumber) {
|
|
9717
|
-
if (pageNumber === '...') {
|
|
9718
|
-
currentPage.value = (Number(currentPage.value) + maxDisplayedPages + 1).toString();
|
|
9719
|
-
return;
|
|
9720
|
-
}
|
|
9721
|
-
currentPage.value = pageNumber;
|
|
9722
|
-
};
|
|
9723
9694
|
var pageArrowClick = function pageArrowClick(next) {
|
|
9724
|
-
currentPage.value =
|
|
9695
|
+
currentPage.value = currentPage.value + (next ? 1 : -1);
|
|
9696
|
+
ctx.emit('pageChanged', next);
|
|
9725
9697
|
};
|
|
9726
9698
|
return {
|
|
9727
9699
|
columns: columns,
|
|
@@ -9737,8 +9709,7 @@ var __default__$6 = defineComponent({
|
|
|
9737
9709
|
rowClicked: rowClicked,
|
|
9738
9710
|
bgHoverColor: bgHoverColor,
|
|
9739
9711
|
currentPage: currentPage,
|
|
9740
|
-
|
|
9741
|
-
pageNumberClick: pageNumberClick,
|
|
9712
|
+
maxPageAmount: maxPageAmount,
|
|
9742
9713
|
pageArrowClick: pageArrowClick
|
|
9743
9714
|
};
|
|
9744
9715
|
}
|
|
@@ -9746,7 +9717,7 @@ var __default__$6 = defineComponent({
|
|
|
9746
9717
|
var __injectCSSVars__$5 = function __injectCSSVars__() {
|
|
9747
9718
|
useCssVars(function (_ctx) {
|
|
9748
9719
|
return {
|
|
9749
|
-
"
|
|
9720
|
+
"73ca01a2": _ctx.bgHoverColor
|
|
9750
9721
|
};
|
|
9751
9722
|
});
|
|
9752
9723
|
};
|
|
@@ -9757,7 +9728,7 @@ __default__$6.setup = __setup__$5 ? function (props, ctx) {
|
|
|
9757
9728
|
} : __injectCSSVars__$5;
|
|
9758
9729
|
|
|
9759
9730
|
var _withScopeId$4 = function _withScopeId(n) {
|
|
9760
|
-
return pushScopeId("data-v-
|
|
9731
|
+
return pushScopeId("data-v-b2774452"), n = n(), popScopeId(), n;
|
|
9761
9732
|
};
|
|
9762
9733
|
var _hoisted_1$p = {
|
|
9763
9734
|
"class": "flex flex-col"
|
|
@@ -9789,30 +9760,20 @@ var _hoisted_10$1 = ["onClick", "tabindex", "onKeydown"];
|
|
|
9789
9760
|
var _hoisted_11$1 = ["innerHTML"];
|
|
9790
9761
|
var _hoisted_12$1 = {
|
|
9791
9762
|
key: 0,
|
|
9792
|
-
"class": "flex flex-row h-[44px] mt-8
|
|
9793
|
-
};
|
|
9794
|
-
var _hoisted_13$1 = {
|
|
9795
|
-
"class": "h-4 w-4"
|
|
9763
|
+
"class": "flex flex-row justify-center h-[44px] mt-8 space-x-2 mb-[40px]"
|
|
9796
9764
|
};
|
|
9797
|
-
var _hoisted_14$1 = /*#__PURE__*/_withScopeId$4(function () {
|
|
9798
|
-
return /*#__PURE__*/createElementVNode("strong", {
|
|
9799
|
-
"class": "whitespace-nowrap px-4 self-center"
|
|
9800
|
-
}, "Go to", -1);
|
|
9801
|
-
});
|
|
9802
9765
|
function render$f(_ctx, _cache, $props, $setup, $data, $options) {
|
|
9803
|
-
var _ctx$options;
|
|
9804
9766
|
var _component_ArrowSortSvg = resolveComponent("ArrowSortSvg");
|
|
9805
9767
|
var _component_ArrowDownSvg = resolveComponent("ArrowDownSvg");
|
|
9806
9768
|
var _component_FwLoadingBar = resolveComponent("FwLoadingBar");
|
|
9807
9769
|
var _component_ChevronLeftSvg = resolveComponent("ChevronLeftSvg");
|
|
9808
9770
|
var _component_FwButton = resolveComponent("FwButton");
|
|
9809
9771
|
var _component_ChevronRightSvg = resolveComponent("ChevronRightSvg");
|
|
9810
|
-
|
|
9811
|
-
|
|
9812
|
-
"class": normalizeClass(["fw-table table-auto table-responsive rounded-md shadow-card flex-1", _ctx.loading ? 'cursor-wait' : '']),
|
|
9772
|
+
return openBlock(), createElementBlock("div", _hoisted_1$p, [createElementVNode("table", mergeProps(_ctx.$attrs, {
|
|
9773
|
+
"class": ["fw-table table-auto table-responsive rounded-md shadow-card flex-1", _ctx.loading ? 'cursor-wait' : ''],
|
|
9813
9774
|
"aria-live": "polite",
|
|
9814
9775
|
"aria-busy": _ctx.loading
|
|
9815
|
-
}, [createElementVNode("thead", _hoisted_3$j, [createElementVNode("tr", null, [_ctx.$slots.preHead ? renderSlot(_ctx.$slots, "preHead", {
|
|
9776
|
+
}), [createElementVNode("thead", _hoisted_3$j, [createElementVNode("tr", null, [_ctx.$slots.preHead ? renderSlot(_ctx.$slots, "preHead", {
|
|
9816
9777
|
key: 0
|
|
9817
9778
|
}) : createCommentVNode("", true), (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.columns, function (column, thKey) {
|
|
9818
9779
|
return openBlock(), createElementBlock(Fragment, {
|
|
@@ -9883,9 +9844,9 @@ function render$f(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
9883
9844
|
key: 1,
|
|
9884
9845
|
row: row
|
|
9885
9846
|
}) : createCommentVNode("", true)], 42, _hoisted_10$1);
|
|
9886
|
-
}), 128))])],
|
|
9847
|
+
}), 128))])], 16, _hoisted_2$n), _ctx.enablePagination ? (openBlock(), createElementBlock("div", _hoisted_12$1, [createVNode(_component_FwButton, {
|
|
9887
9848
|
variant: 'tertiary',
|
|
9888
|
-
disabled: _ctx.currentPage ===
|
|
9849
|
+
disabled: _ctx.currentPage === 1,
|
|
9889
9850
|
size: "sm",
|
|
9890
9851
|
"class": "border-grey-40",
|
|
9891
9852
|
onClick: _cache[0] || (_cache[0] = function ($event) {
|
|
@@ -9894,33 +9855,14 @@ function render$f(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
9894
9855
|
}, {
|
|
9895
9856
|
"default": withCtx(function () {
|
|
9896
9857
|
return [createVNode(_component_ChevronLeftSvg, {
|
|
9897
|
-
"class": "h-4 w-4
|
|
9858
|
+
"class": "h-4 w-4",
|
|
9898
9859
|
"stroke-width": "3"
|
|
9899
9860
|
})];
|
|
9900
9861
|
}),
|
|
9901
9862
|
_: 1
|
|
9902
|
-
}, 8, ["disabled"]), (
|
|
9903
|
-
return openBlock(), createBlock(_component_FwButton, {
|
|
9904
|
-
rounded: "",
|
|
9905
|
-
size: "sm",
|
|
9906
|
-
key: page.pageNumber,
|
|
9907
|
-
variant: page.selected ? 'tertiary' : 'secondary',
|
|
9908
|
-
"class": normalizeClass({
|
|
9909
|
-
'border-none': !page.selected,
|
|
9910
|
-
'bg-transparent': true
|
|
9911
|
-
}),
|
|
9912
|
-
onClick: function onClick($event) {
|
|
9913
|
-
return _ctx.pageNumberClick(page.pageNumber);
|
|
9914
|
-
}
|
|
9915
|
-
}, {
|
|
9916
|
-
"default": withCtx(function () {
|
|
9917
|
-
return [createElementVNode("div", _hoisted_13$1, [createElementVNode("strong", null, toDisplayString(page.pageNumber), 1)])];
|
|
9918
|
-
}),
|
|
9919
|
-
_: 2
|
|
9920
|
-
}, 1032, ["variant", "class", "onClick"]);
|
|
9921
|
-
}), 128)), createVNode(_component_FwButton, {
|
|
9863
|
+
}, 8, ["disabled"]), renderSlot(_ctx.$slots, "page"), createVNode(_component_FwButton, {
|
|
9922
9864
|
variant: 'tertiary',
|
|
9923
|
-
disabled: _ctx.
|
|
9865
|
+
disabled: _ctx.currentPage === _ctx.maxPageAmount,
|
|
9924
9866
|
size: "sm",
|
|
9925
9867
|
"class": "border-grey-40",
|
|
9926
9868
|
onClick: _cache[1] || (_cache[1] = function ($event) {
|
|
@@ -9933,24 +9875,15 @@ function render$f(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
9933
9875
|
})];
|
|
9934
9876
|
}),
|
|
9935
9877
|
_: 1
|
|
9936
|
-
}, 8, ["disabled"])
|
|
9937
|
-
"center-align-input": "",
|
|
9938
|
-
"class": "max-w-[66px] p-0 text-center",
|
|
9939
|
-
name: "page",
|
|
9940
|
-
modelValue: _ctx.currentPage,
|
|
9941
|
-
"onUpdate:modelValue": _cache[2] || (_cache[2] = function ($event) {
|
|
9942
|
-
return _ctx.currentPage = $event;
|
|
9943
|
-
}),
|
|
9944
|
-
type: "tel"
|
|
9945
|
-
}, null, 8, ["modelValue"])])) : createCommentVNode("", true)]);
|
|
9878
|
+
}, 8, ["disabled"])])) : createCommentVNode("", true)]);
|
|
9946
9879
|
}
|
|
9947
9880
|
|
|
9948
|
-
var css_248z$a = ".fw-table-head--sortable[data-v-
|
|
9949
|
-
var stylesheet$a = ".fw-table-head--sortable[data-v-
|
|
9881
|
+
var css_248z$a = ".fw-table-head--sortable[data-v-b2774452]:hover{background-color:var(--73ca01a2)}.fw-table-row[data-v-b2774452]:hover{background-color:var(--73ca01a2)}";
|
|
9882
|
+
var stylesheet$a = ".fw-table-head--sortable[data-v-b2774452]:hover{background-color:var(--73ca01a2)}.fw-table-row[data-v-b2774452]:hover{background-color:var(--73ca01a2)}";
|
|
9950
9883
|
styleInject(css_248z$a);
|
|
9951
9884
|
|
|
9952
9885
|
__default__$6.render = render$f;
|
|
9953
|
-
__default__$6.__scopeId = "data-v-
|
|
9886
|
+
__default__$6.__scopeId = "data-v-b2774452";
|
|
9954
9887
|
|
|
9955
9888
|
var script$9 = defineComponent({
|
|
9956
9889
|
name: 'FwTableHead'
|
package/index.d.ts
CHANGED
|
@@ -1293,6 +1293,7 @@ declare interface FwTableProps {
|
|
|
1293
1293
|
autoSortColumn?: number;
|
|
1294
1294
|
enablePagination?: boolean;
|
|
1295
1295
|
totalAmount?: number;
|
|
1296
|
+
pageSize?: number;
|
|
1296
1297
|
}
|
|
1297
1298
|
|
|
1298
1299
|
declare interface FwAccordionProps {
|
|
@@ -1496,10 +1497,6 @@ declare const __default__$6: vue.DefineComponent<{
|
|
|
1496
1497
|
dismissable: boolean;
|
|
1497
1498
|
}, {}>;
|
|
1498
1499
|
|
|
1499
|
-
interface PageButton {
|
|
1500
|
-
pageNumber: string;
|
|
1501
|
-
selected: boolean;
|
|
1502
|
-
}
|
|
1503
1500
|
declare const __default__$5: vue.DefineComponent<{
|
|
1504
1501
|
items: {
|
|
1505
1502
|
type: PropType<FwTableItem[]>;
|
|
@@ -1531,6 +1528,9 @@ declare const __default__$5: vue.DefineComponent<{
|
|
|
1531
1528
|
totalAmount: {
|
|
1532
1529
|
type: NumberConstructor;
|
|
1533
1530
|
};
|
|
1531
|
+
pageSize: {
|
|
1532
|
+
type: NumberConstructor;
|
|
1533
|
+
};
|
|
1534
1534
|
}, {
|
|
1535
1535
|
columns: vue.ComputedRef<string[]>;
|
|
1536
1536
|
sortBy: vue.Ref<string>;
|
|
@@ -1544,9 +1544,8 @@ declare const __default__$5: vue.DefineComponent<{
|
|
|
1544
1544
|
isDisabled: (column: string) => boolean;
|
|
1545
1545
|
rowClicked: (row: FwTableItem) => void;
|
|
1546
1546
|
bgHoverColor: string;
|
|
1547
|
-
currentPage: vue.Ref<
|
|
1548
|
-
|
|
1549
|
-
pageNumberClick: (pageNumber: string) => void;
|
|
1547
|
+
currentPage: vue.Ref<number>;
|
|
1548
|
+
maxPageAmount: vue.Ref<number | undefined>;
|
|
1550
1549
|
pageArrowClick: (next: boolean) => void;
|
|
1551
1550
|
}, unknown, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, ("rowClicked" | "columnSorted" | "pageChanged")[], "rowClicked" | "columnSorted" | "pageChanged", vue.PublicProps, Readonly<vue.ExtractPropTypes<{
|
|
1552
1551
|
items: {
|
|
@@ -1579,6 +1578,9 @@ declare const __default__$5: vue.DefineComponent<{
|
|
|
1579
1578
|
totalAmount: {
|
|
1580
1579
|
type: NumberConstructor;
|
|
1581
1580
|
};
|
|
1581
|
+
pageSize: {
|
|
1582
|
+
type: NumberConstructor;
|
|
1583
|
+
};
|
|
1582
1584
|
}>> & {
|
|
1583
1585
|
onRowClicked?: ((...args: any[]) => any) | undefined;
|
|
1584
1586
|
onColumnSorted?: ((...args: any[]) => any) | undefined;
|
package/package.json
CHANGED
|
@@ -1,9 +1,5 @@
|
|
|
1
1
|
import { PropType } from 'vue';
|
|
2
2
|
import { FwTableItem, FwTableSort } from './index.types';
|
|
3
|
-
interface PageButton {
|
|
4
|
-
pageNumber: string;
|
|
5
|
-
selected: boolean;
|
|
6
|
-
}
|
|
7
3
|
declare const __default__: import("vue").DefineComponent<{
|
|
8
4
|
items: {
|
|
9
5
|
type: PropType<FwTableItem[]>;
|
|
@@ -35,6 +31,9 @@ declare const __default__: import("vue").DefineComponent<{
|
|
|
35
31
|
totalAmount: {
|
|
36
32
|
type: NumberConstructor;
|
|
37
33
|
};
|
|
34
|
+
pageSize: {
|
|
35
|
+
type: NumberConstructor;
|
|
36
|
+
};
|
|
38
37
|
}, {
|
|
39
38
|
columns: import("vue").ComputedRef<string[]>;
|
|
40
39
|
sortBy: import("vue").Ref<string>;
|
|
@@ -48,9 +47,8 @@ declare const __default__: import("vue").DefineComponent<{
|
|
|
48
47
|
isDisabled: (column: string) => boolean;
|
|
49
48
|
rowClicked: (row: FwTableItem) => void;
|
|
50
49
|
bgHoverColor: string;
|
|
51
|
-
currentPage: import("vue").Ref<
|
|
52
|
-
|
|
53
|
-
pageNumberClick: (pageNumber: string) => void;
|
|
50
|
+
currentPage: import("vue").Ref<number>;
|
|
51
|
+
maxPageAmount: import("vue").Ref<number | undefined>;
|
|
54
52
|
pageArrowClick: (next: boolean) => void;
|
|
55
53
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("rowClicked" | "columnSorted" | "pageChanged")[], "rowClicked" | "columnSorted" | "pageChanged", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
56
54
|
items: {
|
|
@@ -83,6 +81,9 @@ declare const __default__: import("vue").DefineComponent<{
|
|
|
83
81
|
totalAmount: {
|
|
84
82
|
type: NumberConstructor;
|
|
85
83
|
};
|
|
84
|
+
pageSize: {
|
|
85
|
+
type: NumberConstructor;
|
|
86
|
+
};
|
|
86
87
|
}>> & {
|
|
87
88
|
onRowClicked?: ((...args: any[]) => any) | undefined;
|
|
88
89
|
onColumnSorted?: ((...args: any[]) => any) | undefined;
|