@fkui/vue 5.45.0 → 5.46.0
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/dist/cjs/index.cjs.js +230 -87
- package/dist/cjs/index.cjs.js.map +1 -1
- package/dist/cjs/pageobject.js +1 -1
- package/dist/cjs/pageobject.js.map +2 -2
- package/dist/esm/index.esm.js +231 -88
- package/dist/esm/index.esm.js.map +1 -1
- package/dist/types/index.d.ts +122 -15
- package/dist/types/tsdoc-metadata.json +1 -1
- package/htmlvalidate/elements/internal-components.js +0 -4
- package/package.json +2 -2
package/dist/esm/index.esm.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent, computed, openBlock, createElementBlock, normalizeClass, renderSlot, mergeProps, createTextVNode, createElementVNode, isVNode, Comment, createApp, resolveComponent, withKeys, createCommentVNode, toDisplayString, createVNode, createBlock, withCtx, Fragment, renderList, withModifiers, getCurrentInstance, resolveDynamicComponent, onMounted, toValue, onUnmounted, useSlots, normalizeProps, guardReactiveProps, Transition, Teleport, normalizeStyle, useTemplateRef, watchEffect, watch, nextTick, withDirectives, vShow,
|
|
1
|
+
import { defineComponent, computed, openBlock, createElementBlock, normalizeClass, renderSlot, mergeProps, createTextVNode, createElementVNode, isVNode, Comment, createApp, resolveComponent, withKeys, createCommentVNode, toDisplayString, createVNode, createBlock, withCtx, Fragment, renderList, withModifiers, getCurrentInstance, resolveDynamicComponent, onMounted, toValue, onUnmounted, useSlots, ref, normalizeProps, guardReactiveProps, unref, Transition, Teleport, normalizeStyle, useTemplateRef, watchEffect, watch, nextTick, withDirectives, vShow, readonly, inject, toRef, provide, createSlots, vModelSelect, vModelDynamic, toHandlers, shallowRef, toRefs } from "vue";
|
|
2
2
|
import { TranslationService, isSet, configLogic, focus as focus$1, ElementIdService, pushFocus, findTabbableElements, popFocus, scrollTo, Reference, documentOrderComparator, ValidationService, isValidatableHTMLElement, alertScreenReader, debounce, handleTab, isEmpty, deepClone, formatNumber, parseNumber, parseBankAccountNumber, parseBankgiro, parseClearingNumber, formatPersonnummer, parsePersonnummer, parsePlusgiro, formatPostalCode, parsePercent, formatPercent, parseOrganisationsnummer, isInvalidDatesConfig, isInvalidWeekdaysConfig, parseDate, waitForScreenReader, focusFirst, saveFocus, addFocusListener, removeFocusListener, restoreFocus, DomUtils } from "@fkui/logic";
|
|
3
3
|
import { getWeekdayNamings, groupByWeek, FDate, DateFormat } from "@fkui/date";
|
|
4
4
|
const statuses = ["default", "warning", "error", "success", "info"];
|
|
@@ -5530,6 +5530,9 @@ const _sfc_main$12 = defineComponent({
|
|
|
5530
5530
|
};
|
|
5531
5531
|
},
|
|
5532
5532
|
computed: {
|
|
5533
|
+
ariaLabel() {
|
|
5534
|
+
return `${this.value.monthName} ${this.value.year}`;
|
|
5535
|
+
},
|
|
5533
5536
|
totalCols() {
|
|
5534
5537
|
return this.hideWeekNumbers ? 7 : 8;
|
|
5535
5538
|
},
|
|
@@ -5571,50 +5574,43 @@ const _sfc_main$12 = defineComponent({
|
|
|
5571
5574
|
}
|
|
5572
5575
|
}
|
|
5573
5576
|
});
|
|
5574
|
-
const _hoisted_1$O =
|
|
5577
|
+
const _hoisted_1$O = ["aria-label"];
|
|
5578
|
+
const _hoisted_2$A = {
|
|
5575
5579
|
key: 0,
|
|
5576
5580
|
class: "calendar-month__col--week"
|
|
5577
5581
|
};
|
|
5578
|
-
const _hoisted_2$A = {
|
|
5579
|
-
role: "presentation"
|
|
5580
|
-
};
|
|
5581
5582
|
const _hoisted_3$s = {
|
|
5582
|
-
role: "presentation"
|
|
5583
|
-
};
|
|
5584
|
-
const _hoisted_4$n = {
|
|
5585
5583
|
key: 0,
|
|
5586
5584
|
scope: "col",
|
|
5587
5585
|
"aria-hidden": "true",
|
|
5588
5586
|
class: "calendar-month__header-cell"
|
|
5589
5587
|
};
|
|
5590
|
-
const
|
|
5591
|
-
const
|
|
5592
|
-
role: "presentation"
|
|
5593
|
-
};
|
|
5594
|
-
const _hoisted_7$d = {
|
|
5588
|
+
const _hoisted_4$n = ["title"];
|
|
5589
|
+
const _hoisted_5$i = {
|
|
5595
5590
|
key: 0,
|
|
5596
5591
|
class: "calendar-month__cell calendar-month__cell--week-number",
|
|
5597
5592
|
"aria-hidden": "true"
|
|
5598
5593
|
};
|
|
5599
|
-
const
|
|
5600
|
-
const
|
|
5601
|
-
const
|
|
5594
|
+
const _hoisted_6$e = ["colspan"];
|
|
5595
|
+
const _hoisted_7$d = ["colspan"];
|
|
5596
|
+
const _hoisted_8$8 = {
|
|
5602
5597
|
key: 0,
|
|
5603
5598
|
"aria-hidden": "true"
|
|
5604
5599
|
};
|
|
5605
|
-
const
|
|
5606
|
-
const
|
|
5600
|
+
const _hoisted_9$5 = ["colspan"];
|
|
5601
|
+
const _hoisted_10$3 = {
|
|
5607
5602
|
key: 1,
|
|
5608
5603
|
"aria-hidden": "true"
|
|
5609
5604
|
};
|
|
5610
|
-
const
|
|
5605
|
+
const _hoisted_11$2 = ["colspan"];
|
|
5611
5606
|
function _sfc_render$Q(_ctx, _cache, $props, $setup, $data, $options) {
|
|
5612
5607
|
return openBlock(), createElementBlock("table", {
|
|
5613
5608
|
class: "calendar-month__table",
|
|
5614
|
-
role: "
|
|
5609
|
+
role: "grid",
|
|
5610
|
+
"aria-label": _ctx.ariaLabel,
|
|
5615
5611
|
onFocusin: _cache[0] || (_cache[0] = (...args) => _ctx.onFocusin && _ctx.onFocusin(...args)),
|
|
5616
5612
|
onFocusout: _cache[1] || (_cache[1] = (...args) => _ctx.onFocusout && _ctx.onFocusout(...args))
|
|
5617
|
-
}, [createElementVNode("colgroup", null, [!_ctx.internalHideWeekNumbers ? (openBlock(), createElementBlock("col",
|
|
5613
|
+
}, [createElementVNode("colgroup", null, [!_ctx.internalHideWeekNumbers ? (openBlock(), createElementBlock("col", _hoisted_2$A)) : createCommentVNode("", true), _cache[2] || (_cache[2] = createTextVNode()), _cache[3] || (_cache[3] = createElementVNode("col", {
|
|
5618
5614
|
class: "calendar-month__col--day"
|
|
5619
5615
|
}, null, -1)), _cache[4] || (_cache[4] = createTextVNode()), _cache[5] || (_cache[5] = createElementVNode("col", {
|
|
5620
5616
|
class: "calendar-month__col--day"
|
|
@@ -5628,26 +5624,23 @@ function _sfc_render$Q(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
5628
5624
|
class: "calendar-month__col--day"
|
|
5629
5625
|
}, null, -1)), _cache[14] || (_cache[14] = createTextVNode()), _cache[15] || (_cache[15] = createElementVNode("col", {
|
|
5630
5626
|
class: "calendar-month__col--day"
|
|
5631
|
-
}, null, -1))]), _cache[22] || (_cache[22] = createTextVNode()), createElementVNode("thead",
|
|
5627
|
+
}, null, -1))]), _cache[22] || (_cache[22] = createTextVNode()), createElementVNode("thead", null, [createElementVNode("tr", null, [!_ctx.internalHideWeekNumbers ? (openBlock(), createElementBlock("th", _hoisted_3$s)) : createCommentVNode("", true), _cache[16] || (_cache[16] = createTextVNode()), (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.weekdays, (weekday) => {
|
|
5632
5628
|
return openBlock(), createElementBlock("th", {
|
|
5633
5629
|
key: weekday.name,
|
|
5634
5630
|
scope: "col",
|
|
5635
|
-
role: "presentation",
|
|
5636
5631
|
class: "calendar-month__header-cell"
|
|
5637
5632
|
}, [createElementVNode("abbr", {
|
|
5638
|
-
"aria-hidden": "true",
|
|
5639
5633
|
title: weekday.name
|
|
5640
|
-
}, toDisplayString(_ctx.showShortWeekdays ? weekday.shortName : weekday.name), 9,
|
|
5641
|
-
}), 128))])]), _cache[23] || (_cache[23] = createTextVNode()), createElementVNode("tbody",
|
|
5634
|
+
}, toDisplayString(_ctx.showShortWeekdays ? weekday.shortName : weekday.name), 9, _hoisted_4$n)]);
|
|
5635
|
+
}), 128))])]), _cache[23] || (_cache[23] = createTextVNode()), createElementVNode("tbody", null, [(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.weeks, (week) => {
|
|
5642
5636
|
return openBlock(), createElementBlock("tr", {
|
|
5643
|
-
key: week.week
|
|
5644
|
-
|
|
5645
|
-
}, [!_ctx.internalHideWeekNumbers ? (openBlock(), createElementBlock("td", _hoisted_7$d, toDisplayString(week.week), 1)) : createCommentVNode("", true), _cache[17] || (_cache[17] = createTextVNode()), _ctx.getDayStartOffset(week.days) ? (openBlock(), createElementBlock("td", {
|
|
5637
|
+
key: week.week
|
|
5638
|
+
}, [!_ctx.internalHideWeekNumbers ? (openBlock(), createElementBlock("td", _hoisted_5$i, toDisplayString(week.week), 1)) : createCommentVNode("", true), _cache[17] || (_cache[17] = createTextVNode()), _ctx.getDayStartOffset(week.days) ? (openBlock(), createElementBlock("td", {
|
|
5646
5639
|
key: 1,
|
|
5647
5640
|
class: "calendar-month__cell",
|
|
5648
5641
|
colspan: _ctx.getDayStartOffset(week.days),
|
|
5649
5642
|
"aria-hidden": "true"
|
|
5650
|
-
}, null, 8,
|
|
5643
|
+
}, null, 8, _hoisted_6$e)) : createCommentVNode("", true), _cache[18] || (_cache[18] = createTextVNode()), (openBlock(true), createElementBlock(Fragment, null, renderList(week.days, (day) => {
|
|
5651
5644
|
return openBlock(), createElementBlock("td", {
|
|
5652
5645
|
key: day.toString(),
|
|
5653
5646
|
class: "calendar-month__cell",
|
|
@@ -5661,16 +5654,16 @@ function _sfc_render$Q(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
5661
5654
|
class: "calendar-month__cell",
|
|
5662
5655
|
colspan: _ctx.getDayEndOffset(week.days),
|
|
5663
5656
|
"aria-hidden": "true"
|
|
5664
|
-
}, null, 8,
|
|
5665
|
-
}), 128)), _cache[20] || (_cache[20] = createTextVNode()), _ctx.weeks.length < 5 ? (openBlock(), createElementBlock("tr",
|
|
5657
|
+
}, null, 8, _hoisted_7$d)) : createCommentVNode("", true)]);
|
|
5658
|
+
}), 128)), _cache[20] || (_cache[20] = createTextVNode()), _ctx.weeks.length < 5 ? (openBlock(), createElementBlock("tr", _hoisted_8$8, [createElementVNode("td", {
|
|
5666
5659
|
class: "calendar-month__cell",
|
|
5667
5660
|
colspan: _ctx.totalCols,
|
|
5668
5661
|
"aria-hidden": "true"
|
|
5669
|
-
}, null, 8,
|
|
5662
|
+
}, null, 8, _hoisted_9$5)])) : createCommentVNode("", true), _cache[21] || (_cache[21] = createTextVNode()), _ctx.weeks.length < 6 ? (openBlock(), createElementBlock("tr", _hoisted_10$3, [createElementVNode("td", {
|
|
5670
5663
|
class: "calendar-month__cell",
|
|
5671
5664
|
colspan: _ctx.totalCols,
|
|
5672
5665
|
"aria-hidden": "true"
|
|
5673
|
-
}, null, 8,
|
|
5666
|
+
}, null, 8, _hoisted_11$2)])) : createCommentVNode("", true)])], 40, _hoisted_1$O);
|
|
5674
5667
|
}
|
|
5675
5668
|
const ICalendarMonthGrid = /* @__PURE__ */ _export_sfc(_sfc_main$12, [["render", _sfc_render$Q]]);
|
|
5676
5669
|
const DayStep = {
|
|
@@ -5743,6 +5736,11 @@ const _sfc_main$11 = defineComponent({
|
|
|
5743
5736
|
this.$emit("click", date);
|
|
5744
5737
|
},
|
|
5745
5738
|
async onKeydownDay(date, event) {
|
|
5739
|
+
if (event.code === "Enter" || event.code === "Space") {
|
|
5740
|
+
event.preventDefault();
|
|
5741
|
+
this.$emit("click", date);
|
|
5742
|
+
return;
|
|
5743
|
+
}
|
|
5746
5744
|
if (!isDayStepKey(event)) {
|
|
5747
5745
|
return;
|
|
5748
5746
|
}
|
|
@@ -5790,13 +5788,13 @@ function _sfc_render$P(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
5790
5788
|
}, {
|
|
5791
5789
|
default: withCtx(({
|
|
5792
5790
|
date
|
|
5793
|
-
}) => [createElementVNode("
|
|
5791
|
+
}) => [createElementVNode("div", {
|
|
5794
5792
|
ref: date.toString(),
|
|
5793
|
+
role: "gridcell",
|
|
5795
5794
|
class: "calendar-month__button",
|
|
5796
5795
|
"data-test": "select-day-button",
|
|
5797
5796
|
"data-date": date.toString(),
|
|
5798
5797
|
tabindex: _ctx.getTabindex(date),
|
|
5799
|
-
type: "button",
|
|
5800
5798
|
onClick: withModifiers(($event) => _ctx.onClickDay(date), ["stop", "prevent"]),
|
|
5801
5799
|
onKeydown: ($event) => _ctx.onKeydownDay(date, $event)
|
|
5802
5800
|
}, [renderSlot(_ctx.$slots, "default", {
|
|
@@ -6004,9 +6002,7 @@ function useSlotUtils() {
|
|
|
6004
6002
|
}
|
|
6005
6003
|
};
|
|
6006
6004
|
}
|
|
6007
|
-
const _hoisted_1$K =
|
|
6008
|
-
class: "card card--default"
|
|
6009
|
-
};
|
|
6005
|
+
const _hoisted_1$K = ["id"];
|
|
6010
6006
|
const _hoisted_2$y = {
|
|
6011
6007
|
key: 0,
|
|
6012
6008
|
class: "card__header"
|
|
@@ -6020,16 +6016,91 @@ const _hoisted_4$m = {
|
|
|
6020
6016
|
};
|
|
6021
6017
|
const _sfc_main$_ = /* @__PURE__ */ defineComponent({
|
|
6022
6018
|
__name: "FCard",
|
|
6019
|
+
props: {
|
|
6020
|
+
/**
|
|
6021
|
+
* Element to focus on when card is invalid. Set when using validation.
|
|
6022
|
+
*/
|
|
6023
|
+
focusRef: {
|
|
6024
|
+
type: Object,
|
|
6025
|
+
required: false,
|
|
6026
|
+
default: null
|
|
6027
|
+
},
|
|
6028
|
+
/**
|
|
6029
|
+
* Optional id (generated by default).
|
|
6030
|
+
*/
|
|
6031
|
+
id: {
|
|
6032
|
+
type: String,
|
|
6033
|
+
required: false,
|
|
6034
|
+
default: () => ElementIdService.generateElementId()
|
|
6035
|
+
}
|
|
6036
|
+
},
|
|
6023
6037
|
setup(__props) {
|
|
6024
6038
|
const {
|
|
6025
6039
|
hasSlot: hasSlot2
|
|
6026
6040
|
} = useSlotUtils();
|
|
6041
|
+
const validationMessage = ref("");
|
|
6042
|
+
const hasError = ref(false);
|
|
6043
|
+
const isMounted = ref(false);
|
|
6027
6044
|
const hasHeaderSlot = computed(() => hasSlot2("header"));
|
|
6028
6045
|
const hasFooterSlot = computed(() => hasSlot2("footer"));
|
|
6046
|
+
const cardClass = computed(() => `card card--${hasError.value ? "error" : "default"}`);
|
|
6047
|
+
const props = __props;
|
|
6048
|
+
onMounted(() => isMounted.value = true);
|
|
6049
|
+
async function onValidity({
|
|
6050
|
+
detail
|
|
6051
|
+
}) {
|
|
6052
|
+
if (!isMounted.value) {
|
|
6053
|
+
return;
|
|
6054
|
+
}
|
|
6055
|
+
if (!props.focusRef) {
|
|
6056
|
+
throw new Error("Element to focus on when card is invalid (`focusRef`) is required when using card validation.");
|
|
6057
|
+
}
|
|
6058
|
+
const focusElementId = props.focusRef.id;
|
|
6059
|
+
if (!focusElementId) {
|
|
6060
|
+
throw new Error("An id must be set on the card's focus element.");
|
|
6061
|
+
}
|
|
6062
|
+
hasError.value = !detail.isValid;
|
|
6063
|
+
validationMessage.value = detail.validationMessage;
|
|
6064
|
+
dispatchComponentValidityEvent(props.focusRef, {
|
|
6065
|
+
...detail,
|
|
6066
|
+
errorMessage: validationMessage.value,
|
|
6067
|
+
focusElementId
|
|
6068
|
+
});
|
|
6069
|
+
}
|
|
6029
6070
|
return (_ctx, _cache) => {
|
|
6030
|
-
return openBlock(), createElementBlock("div",
|
|
6071
|
+
return openBlock(), createElementBlock("div", {
|
|
6072
|
+
id: __props.id,
|
|
6073
|
+
class: normalizeClass(cardClass.value),
|
|
6074
|
+
onValidity
|
|
6075
|
+
}, [hasHeaderSlot.value ? (openBlock(), createElementBlock("div", _hoisted_2$y, [renderSlot(_ctx.$slots, "header", normalizeProps(guardReactiveProps({
|
|
6031
6076
|
headingSlotClass: "card__header-label"
|
|
6032
|
-
})))])) : createCommentVNode("", true), _cache[
|
|
6077
|
+
})))])) : createCommentVNode("", true), _cache[1] || (_cache[1] = createTextVNode()), renderSlot(_ctx.$slots, "error-message", normalizeProps(guardReactiveProps({
|
|
6078
|
+
hasError: hasError.value,
|
|
6079
|
+
validationMessage: validationMessage.value
|
|
6080
|
+
})), () => [hasError.value ? (openBlock(), createBlock(unref(IFlex), {
|
|
6081
|
+
key: 0,
|
|
6082
|
+
gap: "1x",
|
|
6083
|
+
class: "card__error-message"
|
|
6084
|
+
}, {
|
|
6085
|
+
default: withCtx(() => [createVNode(unref(IFlexItem), {
|
|
6086
|
+
shrink: "",
|
|
6087
|
+
align: "center"
|
|
6088
|
+
}, {
|
|
6089
|
+
default: withCtx(() => [createVNode(unref(FIcon), {
|
|
6090
|
+
name: "error"
|
|
6091
|
+
})]),
|
|
6092
|
+
_: 1
|
|
6093
|
+
}), _cache[0] || (_cache[0] = createTextVNode()), createVNode(unref(IFlexItem), {
|
|
6094
|
+
grow: ""
|
|
6095
|
+
}, {
|
|
6096
|
+
default: withCtx(() => [createTextVNode(toDisplayString(validationMessage.value), 1)]),
|
|
6097
|
+
_: 1
|
|
6098
|
+
})]),
|
|
6099
|
+
_: 1
|
|
6100
|
+
})) : createCommentVNode("", true)]), _cache[2] || (_cache[2] = createTextVNode()), createElementVNode("div", _hoisted_3$r, [renderSlot(_ctx.$slots, "default")]), _cache[3] || (_cache[3] = createTextVNode()), hasFooterSlot.value ? (openBlock(), createElementBlock("div", _hoisted_4$m, [renderSlot(_ctx.$slots, "footer", normalizeProps(guardReactiveProps({
|
|
6101
|
+
hasError: hasError.value,
|
|
6102
|
+
validationMessage: validationMessage.value
|
|
6103
|
+
})))])) : createCommentVNode("", true)], 42, _hoisted_1$K);
|
|
6033
6104
|
};
|
|
6034
6105
|
}
|
|
6035
6106
|
});
|
|
@@ -9815,7 +9886,16 @@ const _sfc_main$J = defineComponent({
|
|
|
9815
9886
|
}
|
|
9816
9887
|
},
|
|
9817
9888
|
setup() {
|
|
9818
|
-
|
|
9889
|
+
const {
|
|
9890
|
+
renderColumns,
|
|
9891
|
+
setVisibilityColumn: setVisibilityColumn2,
|
|
9892
|
+
addColumn: addColumn2
|
|
9893
|
+
} = FTableInjected();
|
|
9894
|
+
return {
|
|
9895
|
+
renderColumns,
|
|
9896
|
+
setVisibilityColumn: setVisibilityColumn2,
|
|
9897
|
+
addColumn: addColumn2
|
|
9898
|
+
};
|
|
9819
9899
|
},
|
|
9820
9900
|
computed: {
|
|
9821
9901
|
classes() {
|
|
@@ -13719,10 +13799,6 @@ function useExpandableTable(expandableAttribute, keyAttribute, describedby, emit
|
|
|
13719
13799
|
const expanded = isExpanded(row) ? [] : ["table__expandable-row--collapsed"];
|
|
13720
13800
|
return ["table__expandable-row", ...border, ...expanded];
|
|
13721
13801
|
}
|
|
13722
|
-
function expandableColumnClasses(column, index) {
|
|
13723
|
-
const indented = index === 0 ? ["table__column--indented"] : [];
|
|
13724
|
-
return ["table__column", `table__column--${column.type}`, column.size, ...indented];
|
|
13725
|
-
}
|
|
13726
13802
|
function getExpandableDescribedby(row) {
|
|
13727
13803
|
if (!isExpandableTable) {
|
|
13728
13804
|
return void 0;
|
|
@@ -13756,7 +13832,6 @@ function useExpandableTable(expandableAttribute, keyAttribute, describedby, emit
|
|
|
13756
13832
|
isExpanded,
|
|
13757
13833
|
rowAriaExpanded,
|
|
13758
13834
|
expandableRowClasses,
|
|
13759
|
-
expandableColumnClasses,
|
|
13760
13835
|
getExpandableDescribedby,
|
|
13761
13836
|
expandableRows,
|
|
13762
13837
|
hasExpandableContent
|
|
@@ -13866,6 +13941,22 @@ const _sfc_main$g = defineComponent({
|
|
|
13866
13941
|
type: Array,
|
|
13867
13942
|
required: false,
|
|
13868
13943
|
default: void 0
|
|
13944
|
+
},
|
|
13945
|
+
/**
|
|
13946
|
+
* Enable showing the active row.
|
|
13947
|
+
*/
|
|
13948
|
+
showActive: {
|
|
13949
|
+
type: Boolean,
|
|
13950
|
+
required: false,
|
|
13951
|
+
default: true
|
|
13952
|
+
},
|
|
13953
|
+
/**
|
|
13954
|
+
* V-model will bind to value containing the current active row.
|
|
13955
|
+
*/
|
|
13956
|
+
active: {
|
|
13957
|
+
type: Object,
|
|
13958
|
+
required: false,
|
|
13959
|
+
default: () => void 0
|
|
13869
13960
|
}
|
|
13870
13961
|
},
|
|
13871
13962
|
emits: [
|
|
@@ -13874,6 +13965,7 @@ const _sfc_main$g = defineComponent({
|
|
|
13874
13965
|
"update",
|
|
13875
13966
|
"unselect",
|
|
13876
13967
|
"update:modelValue",
|
|
13968
|
+
"update:active",
|
|
13877
13969
|
"select",
|
|
13878
13970
|
/**
|
|
13879
13971
|
* Emitted when row is expanded.
|
|
@@ -13908,7 +14000,8 @@ const _sfc_main$g = defineComponent({
|
|
|
13908
14000
|
activeRow: void 0,
|
|
13909
14001
|
columns: [],
|
|
13910
14002
|
selectedRows: [],
|
|
13911
|
-
tr: []
|
|
14003
|
+
tr: [],
|
|
14004
|
+
tbodyKey: 0
|
|
13912
14005
|
};
|
|
13913
14006
|
},
|
|
13914
14007
|
computed: {
|
|
@@ -13946,7 +14039,7 @@ const _sfc_main$g = defineComponent({
|
|
|
13946
14039
|
return tableScrollClasses(this.scroll);
|
|
13947
14040
|
},
|
|
13948
14041
|
nbOfColumns() {
|
|
13949
|
-
let columnCount = this.
|
|
14042
|
+
let columnCount = this.visibleColumns.length;
|
|
13950
14043
|
if (this.selectable) {
|
|
13951
14044
|
columnCount++;
|
|
13952
14045
|
}
|
|
@@ -13967,6 +14060,20 @@ const _sfc_main$g = defineComponent({
|
|
|
13967
14060
|
});
|
|
13968
14061
|
}
|
|
13969
14062
|
}
|
|
14063
|
+
},
|
|
14064
|
+
active: {
|
|
14065
|
+
immediate: true,
|
|
14066
|
+
handler: function() {
|
|
14067
|
+
this.updateActiveRowFromVModel();
|
|
14068
|
+
}
|
|
14069
|
+
},
|
|
14070
|
+
showActive: {
|
|
14071
|
+
immediate: true,
|
|
14072
|
+
handler: function(val) {
|
|
14073
|
+
if (!val) {
|
|
14074
|
+
this.tbodyKey ^= 1;
|
|
14075
|
+
}
|
|
14076
|
+
}
|
|
13970
14077
|
}
|
|
13971
14078
|
},
|
|
13972
14079
|
updated() {
|
|
@@ -13985,6 +14092,9 @@ const _sfc_main$g = defineComponent({
|
|
|
13985
14092
|
},
|
|
13986
14093
|
methods: {
|
|
13987
14094
|
isActive(row) {
|
|
14095
|
+
if (!this.showActive) {
|
|
14096
|
+
return false;
|
|
14097
|
+
}
|
|
13988
14098
|
return itemEquals(row, this.activeRow, this.keyAttribute);
|
|
13989
14099
|
},
|
|
13990
14100
|
isSelected(row) {
|
|
@@ -14017,7 +14127,7 @@ const _sfc_main$g = defineComponent({
|
|
|
14017
14127
|
}
|
|
14018
14128
|
if (!itemEquals(row, this.activeRow, this.keyAttribute)) {
|
|
14019
14129
|
this.$emit("change", row);
|
|
14020
|
-
this.
|
|
14130
|
+
this.setActiveRow(row);
|
|
14021
14131
|
if (tr) {
|
|
14022
14132
|
tr.focus();
|
|
14023
14133
|
const td = tr.children[0];
|
|
@@ -14108,6 +14218,17 @@ const _sfc_main$g = defineComponent({
|
|
|
14108
14218
|
},
|
|
14109
14219
|
escapeNewlines(value) {
|
|
14110
14220
|
return value.replace(/\n/g, "<br/>");
|
|
14221
|
+
},
|
|
14222
|
+
updateActiveRowFromVModel() {
|
|
14223
|
+
if (this.active === void 0) {
|
|
14224
|
+
this.setActiveRow(void 0);
|
|
14225
|
+
} else if (!itemEquals(this.active, this.activeRow, this.keyAttribute)) {
|
|
14226
|
+
this.setActiveRow(this.active);
|
|
14227
|
+
}
|
|
14228
|
+
},
|
|
14229
|
+
setActiveRow(row) {
|
|
14230
|
+
this.activeRow = row;
|
|
14231
|
+
this.$emit("update:active", this.activeRow);
|
|
14111
14232
|
}
|
|
14112
14233
|
}
|
|
14113
14234
|
});
|
|
@@ -14145,40 +14266,37 @@ const _hoisted_11$1 = {
|
|
|
14145
14266
|
key: 1,
|
|
14146
14267
|
class: "table__column__description"
|
|
14147
14268
|
};
|
|
14148
|
-
const _hoisted_12$1 =
|
|
14149
|
-
|
|
14150
|
-
};
|
|
14151
|
-
const _hoisted_13 = ["aria-label", "aria-expanded", "aria-level", "aria-describedby", "onKeydown", "onClick"];
|
|
14152
|
-
const _hoisted_14 = {
|
|
14269
|
+
const _hoisted_12$1 = ["aria-label", "aria-expanded", "aria-level", "aria-describedby", "onKeydown", "onClick"];
|
|
14270
|
+
const _hoisted_13 = {
|
|
14153
14271
|
key: 0
|
|
14154
14272
|
};
|
|
14155
|
-
const
|
|
14273
|
+
const _hoisted_14 = {
|
|
14156
14274
|
key: 0,
|
|
14157
14275
|
class: "table__expand-icon"
|
|
14158
14276
|
};
|
|
14159
|
-
const
|
|
14277
|
+
const _hoisted_15 = {
|
|
14160
14278
|
key: 1,
|
|
14161
14279
|
class: "table__column--selectable"
|
|
14162
14280
|
};
|
|
14163
|
-
const
|
|
14281
|
+
const _hoisted_16 = {
|
|
14164
14282
|
class: "table__input"
|
|
14165
14283
|
};
|
|
14166
|
-
const
|
|
14284
|
+
const _hoisted_17 = {
|
|
14167
14285
|
key: 0,
|
|
14168
14286
|
class: "sr-only"
|
|
14169
14287
|
};
|
|
14170
|
-
const
|
|
14288
|
+
const _hoisted_18 = {
|
|
14171
14289
|
key: 0,
|
|
14172
|
-
class: "table__column--
|
|
14290
|
+
class: "table__column--placeholder"
|
|
14173
14291
|
};
|
|
14174
|
-
const
|
|
14175
|
-
const
|
|
14292
|
+
const _hoisted_19 = ["colspan"];
|
|
14293
|
+
const _hoisted_20 = {
|
|
14176
14294
|
key: 0
|
|
14177
14295
|
};
|
|
14178
|
-
const
|
|
14296
|
+
const _hoisted_21 = {
|
|
14179
14297
|
key: 1
|
|
14180
14298
|
};
|
|
14181
|
-
const
|
|
14299
|
+
const _hoisted_22 = ["colspan"];
|
|
14182
14300
|
function _sfc_render$g(_ctx, _cache, $props, $setup, $data, $options) {
|
|
14183
14301
|
const _component_f_icon = resolveComponent("f-icon");
|
|
14184
14302
|
const _component_f_checkbox_field = resolveComponent("f-checkbox-field");
|
|
@@ -14187,12 +14305,12 @@ function _sfc_render$g(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
14187
14305
|
}, [createElementVNode("table", mergeProps({
|
|
14188
14306
|
class: ["table", _ctx.tableClasses],
|
|
14189
14307
|
role: _ctx.tableRole
|
|
14190
|
-
}, _ctx.$attrs), [_ctx.hasCaption ? (openBlock(), createElementBlock("caption", _hoisted_2$d, [renderSlot(_ctx.$slots, "caption")])) : createCommentVNode("", true), _cache[
|
|
14308
|
+
}, _ctx.$attrs), [_ctx.hasCaption ? (openBlock(), createElementBlock("caption", _hoisted_2$d, [renderSlot(_ctx.$slots, "caption")])) : createCommentVNode("", true), _cache[15] || (_cache[15] = createTextVNode()), createElementVNode("colgroup", null, [_ctx.isExpandableTable ? (openBlock(), createElementBlock("col", _hoisted_3$9)) : createCommentVNode("", true), _cache[0] || (_cache[0] = createTextVNode()), _ctx.selectable ? (openBlock(), createElementBlock("col", _hoisted_4$8)) : createCommentVNode("", true), _cache[1] || (_cache[1] = createTextVNode()), (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.columns, (column) => {
|
|
14191
14309
|
return openBlock(), createElementBlock("col", {
|
|
14192
14310
|
key: column.id,
|
|
14193
14311
|
class: normalizeClass(column.size)
|
|
14194
14312
|
}, null, 2);
|
|
14195
|
-
}), 128))]), _cache[
|
|
14313
|
+
}), 128))]), _cache[16] || (_cache[16] = createTextVNode()), createElementVNode("thead", null, [createElementVNode("tr", _hoisted_5$6, [_ctx.isExpandableTable ? (openBlock(), createElementBlock("th", _hoisted_6$4, [createElementVNode("span", _hoisted_7$4, toDisplayString(_ctx.$t("fkui.interactive-table.select", "Expandera")), 1)])) : createCommentVNode("", true), _cache[4] || (_cache[4] = createTextVNode()), _ctx.selectable ? (openBlock(), createElementBlock("th", _hoisted_8$4, [createElementVNode("span", _hoisted_9$3, toDisplayString(_ctx.$t("fkui.interactive-table.select", "Markera")), 1)])) : createCommentVNode("", true), _cache[5] || (_cache[5] = createTextVNode()), (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.visibleColumns, (column) => {
|
|
14196
14314
|
return openBlock(), createElementBlock("th", mergeProps({
|
|
14197
14315
|
key: column.id,
|
|
14198
14316
|
scope: "col",
|
|
@@ -14206,7 +14324,10 @@ function _sfc_render$g(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
14206
14324
|
class: normalizeClass(_ctx.iconClasses(column)),
|
|
14207
14325
|
name: _ctx.iconName(column)
|
|
14208
14326
|
}, null, 8, ["class", "name"])) : createCommentVNode("", true), _cache[3] || (_cache[3] = createTextVNode()), column.description ? (openBlock(), createElementBlock("span", _hoisted_11$1, toDisplayString(column.description), 1)) : createCommentVNode("", true)], 16);
|
|
14209
|
-
}), 128))])]), _cache[
|
|
14327
|
+
}), 128))])]), _cache[17] || (_cache[17] = createTextVNode()), (openBlock(), createElementBlock("tbody", {
|
|
14328
|
+
ref: "tbodyElement",
|
|
14329
|
+
key: _ctx.tbodyKey
|
|
14330
|
+
}, [(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.rows, (row, index) => {
|
|
14210
14331
|
return openBlock(), createElementBlock(Fragment, {
|
|
14211
14332
|
key: _ctx.rowKey(row)
|
|
14212
14333
|
}, [createElementVNode("tr", {
|
|
@@ -14218,15 +14339,15 @@ function _sfc_render$g(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
14218
14339
|
tabindex: "0",
|
|
14219
14340
|
onKeydown: withModifiers(($event) => _ctx.onKeydown($event, index), ["self"]),
|
|
14220
14341
|
onClick: ($event) => _ctx.onClick($event, row, index)
|
|
14221
|
-
}, [_ctx.isExpandableTable ? (openBlock(), createElementBlock("td",
|
|
14342
|
+
}, [_ctx.isExpandableTable ? (openBlock(), createElementBlock("td", _hoisted_13, [_ctx.hasExpandableContent(row) ? (openBlock(), createElementBlock("div", _hoisted_14, [createVNode(_component_f_icon, {
|
|
14222
14343
|
name: "arrow-right",
|
|
14223
14344
|
rotate: _ctx.isExpanded(row) ? "270" : "90"
|
|
14224
|
-
}, null, 8, ["rotate"])])) : createCommentVNode("", true)])) : createCommentVNode("", true), _cache[6] || (_cache[6] = createTextVNode()), _ctx.selectable ? (openBlock(), createElementBlock("td",
|
|
14345
|
+
}, null, 8, ["rotate"])])) : createCommentVNode("", true)])) : createCommentVNode("", true), _cache[6] || (_cache[6] = createTextVNode()), _ctx.selectable ? (openBlock(), createElementBlock("td", _hoisted_15, [createElementVNode("div", _hoisted_16, [createVNode(_component_f_checkbox_field, {
|
|
14225
14346
|
value: true,
|
|
14226
14347
|
"model-value": _ctx.isSelected(row),
|
|
14227
14348
|
onClick: withModifiers(($event) => _ctx.onSelect(row), ["self"])
|
|
14228
14349
|
}, {
|
|
14229
|
-
default: withCtx(() => [_ctx.hasCheckboxDescription ? (openBlock(), createElementBlock("span",
|
|
14350
|
+
default: withCtx(() => [_ctx.hasCheckboxDescription ? (openBlock(), createElementBlock("span", _hoisted_17, [renderSlot(_ctx.$slots, "checkbox-description", mergeProps({
|
|
14230
14351
|
ref_for: true
|
|
14231
14352
|
}, {
|
|
14232
14353
|
row
|
|
@@ -14236,21 +14357,21 @@ function _sfc_render$g(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
14236
14357
|
ref_for: true
|
|
14237
14358
|
}, {
|
|
14238
14359
|
row
|
|
14239
|
-
}))], 42,
|
|
14360
|
+
}))], 42, _hoisted_12$1), _cache[11] || (_cache[11] = createTextVNode()), _ctx.isExpandableTable && _ctx.hasExpandableContent(row) ? (openBlock(true), createElementBlock(Fragment, {
|
|
14240
14361
|
key: 0
|
|
14241
14362
|
}, renderList(_ctx.expandableRows(row), (expandableRow, expandableIndex) => {
|
|
14242
14363
|
return openBlock(), createElementBlock("tr", {
|
|
14243
14364
|
key: _ctx.rowKey(expandableRow),
|
|
14244
14365
|
"aria-level": "2",
|
|
14245
14366
|
class: normalizeClass(_ctx.expandableRowClasses(row, expandableIndex))
|
|
14246
|
-
}, [_cache[8] || (_cache[8] = createElementVNode("td",
|
|
14247
|
-
|
|
14248
|
-
},
|
|
14249
|
-
|
|
14250
|
-
|
|
14251
|
-
|
|
14252
|
-
|
|
14253
|
-
})
|
|
14367
|
+
}, [_cache[8] || (_cache[8] = createElementVNode("td", {
|
|
14368
|
+
class: "table__column--placeholder"
|
|
14369
|
+
}, null, -1)), _cache[9] || (_cache[9] = createTextVNode()), _ctx.selectable ? (openBlock(), createElementBlock("td", _hoisted_18)) : createCommentVNode("", true), _cache[10] || (_cache[10] = createTextVNode()), !_ctx.hasExpandableSlot ? renderSlot(_ctx.$slots, "default", mergeProps({
|
|
14370
|
+
key: 1,
|
|
14371
|
+
ref_for: true
|
|
14372
|
+
}, {
|
|
14373
|
+
row: expandableRow
|
|
14374
|
+
})) : (openBlock(), createElementBlock("td", {
|
|
14254
14375
|
key: 2,
|
|
14255
14376
|
class: "table__column table__column--indented",
|
|
14256
14377
|
colspan: _ctx.columns.length
|
|
@@ -14259,14 +14380,16 @@ function _sfc_render$g(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
14259
14380
|
}, {
|
|
14260
14381
|
expandableRow,
|
|
14261
14382
|
parentRow: row
|
|
14262
|
-
}))], 8,
|
|
14383
|
+
}))], 8, _hoisted_19))], 2);
|
|
14263
14384
|
}), 128)) : createCommentVNode("", true)], 64);
|
|
14264
|
-
}), 128)), _cache[
|
|
14385
|
+
}), 128)), _cache[13] || (_cache[13] = createTextVNode()), _ctx.isEmpty && _ctx.columns.length === 0 ? (openBlock(), createElementBlock("tr", _hoisted_20, [renderSlot(_ctx.$slots, "default", normalizeProps(guardReactiveProps({
|
|
14265
14386
|
row: {}
|
|
14266
|
-
})))])) : createCommentVNode("", true), _cache[
|
|
14387
|
+
})))])) : createCommentVNode("", true), _cache[14] || (_cache[14] = createTextVNode()), _ctx.isEmpty ? (openBlock(), createElementBlock("tr", _hoisted_21, [createElementVNode("td", {
|
|
14267
14388
|
class: "table__column table__column--action",
|
|
14268
14389
|
colspan: _ctx.nbOfColumns
|
|
14269
|
-
}, [renderSlot(_ctx.$slots, "empty", {}, () => [createTextVNode(toDisplayString(_ctx.$t("fkui.interactive-table.empty", "Tabellen är tom")), 1)])], 8,
|
|
14390
|
+
}, [renderSlot(_ctx.$slots, "empty", {}, () => [createTextVNode(toDisplayString(_ctx.$t("fkui.interactive-table.empty", "Tabellen är tom")), 1)])], 8, _hoisted_22), _cache[12] || (_cache[12] = createTextVNode()), renderSlot(_ctx.$slots, "default", normalizeProps(guardReactiveProps({
|
|
14391
|
+
row: {}
|
|
14392
|
+
})))])) : createCommentVNode("", true)]))], 16, _hoisted_1$f)], 2);
|
|
14270
14393
|
}
|
|
14271
14394
|
const FInteractiveTable = /* @__PURE__ */ _export_sfc(_sfc_main$g, [["render", _sfc_render$g]]);
|
|
14272
14395
|
const _sfc_main$f = defineComponent({
|
|
@@ -17000,6 +17123,20 @@ const _sfc_main = defineComponent({
|
|
|
17000
17123
|
});
|
|
17001
17124
|
}
|
|
17002
17125
|
DomUtils.focus(headerElement);
|
|
17126
|
+
},
|
|
17127
|
+
beforeNextWrapper() {
|
|
17128
|
+
return this.beforeNext({
|
|
17129
|
+
key: this.step.key,
|
|
17130
|
+
stepNumber: this.stepNumber,
|
|
17131
|
+
totalSteps: this.totalSteps
|
|
17132
|
+
});
|
|
17133
|
+
},
|
|
17134
|
+
beforeValidationWrapper() {
|
|
17135
|
+
return this.beforeValidation({
|
|
17136
|
+
key: this.step.key,
|
|
17137
|
+
stepNumber: this.stepNumber,
|
|
17138
|
+
totalSteps: this.totalSteps
|
|
17139
|
+
});
|
|
17003
17140
|
}
|
|
17004
17141
|
}
|
|
17005
17142
|
});
|
|
@@ -17115,19 +17252,25 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
17115
17252
|
}, {
|
|
17116
17253
|
default: withCtx(() => [createVNode(_component_f_validation_form, {
|
|
17117
17254
|
id: _ctx.formId,
|
|
17118
|
-
"before-submit": _ctx.
|
|
17119
|
-
"before-validation": _ctx.
|
|
17255
|
+
"before-submit": _ctx.beforeNextWrapper,
|
|
17256
|
+
"before-validation": _ctx.beforeValidationWrapper,
|
|
17120
17257
|
"use-error-list": _ctx.useErrorList,
|
|
17121
17258
|
class: "wizard-step-body",
|
|
17122
17259
|
onSubmit: _ctx.onSubmit
|
|
17123
17260
|
}, {
|
|
17124
|
-
"error-message": withCtx(() => [renderSlot(_ctx.$slots, "error-message",
|
|
17261
|
+
"error-message": withCtx(() => [renderSlot(_ctx.$slots, "error-message", normalizeProps(guardReactiveProps({
|
|
17262
|
+
stepNumber: _ctx.stepNumber,
|
|
17263
|
+
totalSteps: _ctx.totalSteps
|
|
17264
|
+
})), () => [createTextVNode(toDisplayString(_ctx.$t("fkui.wizard-step.errorlist.title", "Oj, du har glömt att fylla i något. Gå till:")), 1)])]),
|
|
17125
17265
|
default: withCtx(() => [renderSlot(_ctx.$slots, "default"), _cache[14] || (_cache[14] = createTextVNode()), createElementVNode("div", _hoisted_10, [createElementVNode("button", {
|
|
17126
17266
|
"data-test": "submit-button",
|
|
17127
17267
|
"data-disabled": _ctx.ignoreClick ? "true" : "false",
|
|
17128
17268
|
type: "submit",
|
|
17129
17269
|
class: "button button--primary button-group__item button--large"
|
|
17130
|
-
}, [renderSlot(_ctx.$slots, "next-button-text",
|
|
17270
|
+
}, [renderSlot(_ctx.$slots, "next-button-text", normalizeProps(guardReactiveProps({
|
|
17271
|
+
stepNumber: _ctx.stepNumber,
|
|
17272
|
+
totalSteps: _ctx.totalSteps
|
|
17273
|
+
})), () => [_ctx.isFinalStep ? (openBlock(), createElementBlock(Fragment, {
|
|
17131
17274
|
key: 0
|
|
17132
17275
|
}, [createTextVNode(toDisplayString(_ctx.$t("fkui.wizard-step.button.next.text-final", "Gå vidare och granska")), 1)], 64)) : (openBlock(), createElementBlock(Fragment, {
|
|
17133
17276
|
key: 1
|