@fkui/vue 6.4.0 → 6.5.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 +107 -78
- package/dist/cjs/index.cjs.js.map +1 -1
- package/dist/esm/index.esm.js +107 -78
- package/dist/esm/index.esm.js.map +1 -1
- package/dist/types/index.d.ts +24 -13
- package/dist/types/tsdoc-metadata.json +1 -1
- package/htmlvalidate/configs/recommended.js +1 -0
- package/htmlvalidate/elements/components.js +1 -1
- package/htmlvalidate/rules/ftablecolumn-name.rule.js +58 -0
- package/htmlvalidate/rules/index.js +2 -0
- package/package.json +5 -5
package/dist/cjs/index.cjs.js
CHANGED
|
@@ -4616,7 +4616,7 @@ const _hoisted_5$l = {
|
|
|
4616
4616
|
const _hoisted_6$g = {
|
|
4617
4617
|
class: "modal__header"
|
|
4618
4618
|
};
|
|
4619
|
-
const _hoisted_7$
|
|
4619
|
+
const _hoisted_7$c = {
|
|
4620
4620
|
key: 0,
|
|
4621
4621
|
ref: "modalTitle",
|
|
4622
4622
|
class: "modal__title",
|
|
@@ -4652,7 +4652,7 @@ function _sfc_render$P(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
4652
4652
|
}, [vue.createElementVNode("div", _hoisted_4$q, [vue.createElementVNode("div", _hoisted_5$l, [vue.createElementVNode("div", _hoisted_6$g, [vue.createElementVNode("div", {
|
|
4653
4653
|
tabindex: "0",
|
|
4654
4654
|
onFocus: _cache[0] || (_cache[0] = (...args) => _ctx.onFocusFirst && _ctx.onFocusFirst(...args))
|
|
4655
|
-
}, null, 32), _cache[4] || (_cache[4] = vue.createTextVNode()), _ctx.hasHeaderSlot ? (vue.openBlock(), vue.createElementBlock("h1", _hoisted_7$
|
|
4655
|
+
}, null, 32), _cache[4] || (_cache[4] = vue.createTextVNode()), _ctx.hasHeaderSlot ? (vue.openBlock(), vue.createElementBlock("h1", _hoisted_7$c, [vue.renderSlot(_ctx.$slots, "header")], 512)) : vue.createCommentVNode("", true)]), _cache[5] || (_cache[5] = vue.createTextVNode()), vue.createElementVNode("div", _hoisted_8$8, [vue.renderSlot(_ctx.$slots, "content")], 512), _cache[6] || (_cache[6] = vue.createTextVNode()), vue.createElementVNode("div", _hoisted_9$6, [vue.renderSlot(_ctx.$slots, "footer")])]), _cache[9] || (_cache[9] = vue.createTextVNode()), vue.createElementVNode("div", _hoisted_10$3, [vue.createElementVNode("button", {
|
|
4656
4656
|
type: "button",
|
|
4657
4657
|
class: "close-button",
|
|
4658
4658
|
"aria-label": _ctx.ariaCloseText,
|
|
@@ -4665,8 +4665,8 @@ function _sfc_render$P(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
4665
4665
|
}, null, 32)])])], 2)])], 32)])], 10, _hoisted_1$W)) : vue.createCommentVNode("", true);
|
|
4666
4666
|
}
|
|
4667
4667
|
const FModal = /* @__PURE__ */ _export_sfc(_sfc_main$1c, [["render", _sfc_render$P]]);
|
|
4668
|
-
function prepareButtonList(src
|
|
4669
|
-
|
|
4668
|
+
function prepareButtonList(src) {
|
|
4669
|
+
return src.map((it) => {
|
|
4670
4670
|
var _it$event, _ref, _it$reason, _it$type;
|
|
4671
4671
|
return {
|
|
4672
4672
|
label: it.label,
|
|
@@ -4677,12 +4677,6 @@ function prepareButtonList(src, buttonOrder = config.buttonOrder) {
|
|
|
4677
4677
|
buttonType: it.submitButton ? "submit" : "button"
|
|
4678
4678
|
};
|
|
4679
4679
|
});
|
|
4680
|
-
switch (buttonOrder) {
|
|
4681
|
-
case FKUIConfigButtonOrder.LEFT_TO_RIGHT:
|
|
4682
|
-
return list;
|
|
4683
|
-
case FKUIConfigButtonOrder.RIGHT_TO_LEFT:
|
|
4684
|
-
return list.reverse();
|
|
4685
|
-
}
|
|
4686
4680
|
}
|
|
4687
4681
|
const defaultButtons = [{
|
|
4688
4682
|
label: "Primärknapp",
|
|
@@ -4780,7 +4774,8 @@ const _sfc_main$1b = vue.defineComponent({
|
|
|
4780
4774
|
})],
|
|
4781
4775
|
computed: {
|
|
4782
4776
|
preparedButtons() {
|
|
4783
|
-
|
|
4777
|
+
const preparedButtonList = prepareButtonList(this.buttons);
|
|
4778
|
+
return config.buttonOrder === FKUIConfigButtonOrder.RIGHT_TO_LEFT ? preparedButtonList.reverse() : preparedButtonList;
|
|
4784
4779
|
}
|
|
4785
4780
|
},
|
|
4786
4781
|
methods: {
|
|
@@ -5569,7 +5564,7 @@ const _sfc_main$15 = vue.defineComponent({
|
|
|
5569
5564
|
},
|
|
5570
5565
|
computed: {
|
|
5571
5566
|
preparedButtons() {
|
|
5572
|
-
return prepareButtonList(this.buttons
|
|
5567
|
+
return prepareButtonList(this.buttons);
|
|
5573
5568
|
}
|
|
5574
5569
|
},
|
|
5575
5570
|
methods: {
|
|
@@ -6358,7 +6353,7 @@ const _hoisted_6$e = {
|
|
|
6358
6353
|
class: "calendar-month__cell calendar-month__cell--week-number",
|
|
6359
6354
|
"aria-hidden": "true"
|
|
6360
6355
|
};
|
|
6361
|
-
const _hoisted_7$
|
|
6356
|
+
const _hoisted_7$b = ["colspan"];
|
|
6362
6357
|
const _hoisted_8$7 = ["colspan"];
|
|
6363
6358
|
const _hoisted_9$5 = {
|
|
6364
6359
|
key: 0,
|
|
@@ -6408,7 +6403,7 @@ function _sfc_render$E(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
6408
6403
|
key: 1,
|
|
6409
6404
|
class: "calendar-month__cell",
|
|
6410
6405
|
colspan: _ctx.getDayStartOffset(week.days)
|
|
6411
|
-
}, null, 8, _hoisted_7$
|
|
6406
|
+
}, null, 8, _hoisted_7$b)) : vue.createCommentVNode("", true), _cache[18] || (_cache[18] = vue.createTextVNode()), (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(week.days, (day) => {
|
|
6412
6407
|
return vue.openBlock(), vue.createElementBlock("td", {
|
|
6413
6408
|
key: day.toString(),
|
|
6414
6409
|
class: "calendar-month__cell",
|
|
@@ -9500,7 +9495,7 @@ const _hoisted_5$f = {
|
|
|
9500
9495
|
const _hoisted_6$c = {
|
|
9501
9496
|
key: 1
|
|
9502
9497
|
};
|
|
9503
|
-
const _hoisted_7$
|
|
9498
|
+
const _hoisted_7$a = {
|
|
9504
9499
|
ref: "tooltipAttachTo",
|
|
9505
9500
|
class: "label"
|
|
9506
9501
|
};
|
|
@@ -9531,7 +9526,7 @@ function _sfc_render$t(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
9531
9526
|
name: "error"
|
|
9532
9527
|
}), vue.createTextVNode(" " + vue.toDisplayString(_ctx.validity.validationMessage), 1)])) : vue.createCommentVNode("", true)])], 2)), _cache[7] || (_cache[7] = vue.createTextVNode()), _ctx.hasCheckbox ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_4$j, [_ctx.children.length === 1 ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_5$f, vue.toDisplayString(_ctx.checkboxCheckedScreenReaderText), 1)) : (vue.openBlock(), vue.createElementBlock("span", _hoisted_6$c, vue.toDisplayString(_ctx.numberOfCheckedCheckboxesScreenText), 1))])) : vue.createCommentVNode("", true), _cache[8] || (_cache[8] = vue.createTextVNode()), _ctx.hasTooltipSlot ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, {
|
|
9533
9528
|
key: 1
|
|
9534
|
-
}, [vue.createElementVNode("div", _hoisted_7$
|
|
9529
|
+
}, [vue.createElementVNode("div", _hoisted_7$a, [vue.createElementVNode("span", _hoisted_8$6, [vue.renderSlot(_ctx.$slots, "label")])], 512), _cache[5] || (_cache[5] = vue.createTextVNode()), vue.renderSlot(_ctx.$slots, "tooltip"), _cache[6] || (_cache[6] = vue.createTextVNode()), _ctx.hasDescriptionSlot || _ctx.hasErrorMessageSlot || _ctx.hasError ? (vue.openBlock(), vue.createElementBlock("div", {
|
|
9535
9530
|
key: 0,
|
|
9536
9531
|
class: vue.normalizeClass(["label", _ctx.groupLabelClass]),
|
|
9537
9532
|
"aria-hidden": "true"
|
|
@@ -11049,13 +11044,19 @@ var FTableColumnSort = /* @__PURE__ */ ((FTableColumnSort2) => {
|
|
|
11049
11044
|
return FTableColumnSort2;
|
|
11050
11045
|
})(FTableColumnSort || {});
|
|
11051
11046
|
function addColumn(src, column) {
|
|
11052
|
-
if (
|
|
11047
|
+
if (column.name) {
|
|
11048
|
+
const hasDuplicateName = src.some((it) => it.name === column.name);
|
|
11049
|
+
if (hasDuplicateName) {
|
|
11050
|
+
throw new Error(`Expected FTableColumn to have a unique name but encountered duplicate of "${column.name}"`);
|
|
11051
|
+
}
|
|
11052
|
+
}
|
|
11053
|
+
if (!src.some((col) => col.id === column.id)) {
|
|
11053
11054
|
return [...src, column];
|
|
11054
11055
|
}
|
|
11055
11056
|
return src;
|
|
11056
11057
|
}
|
|
11057
11058
|
function setVisibilityColumn(src, id, visible) {
|
|
11058
|
-
const column = src.find((col) => col.
|
|
11059
|
+
const column = src.find((col) => col.id === id);
|
|
11059
11060
|
if (column) {
|
|
11060
11061
|
column.visible = visible;
|
|
11061
11062
|
}
|
|
@@ -11114,14 +11115,14 @@ const _sfc_main$J = /* @__PURE__ */ vue.defineComponent({
|
|
|
11114
11115
|
__name: "FTableColumn",
|
|
11115
11116
|
props: {
|
|
11116
11117
|
/**
|
|
11117
|
-
* Unique (per-table) identifier.
|
|
11118
|
+
* Unique (per-table) identifier. Typically set to the row
|
|
11119
|
+
* property displayed but any unique string can be used.
|
|
11118
11120
|
*
|
|
11119
|
-
*
|
|
11120
|
-
* be used.
|
|
11121
|
+
* Only required when used with `FSortFilterDataset`.
|
|
11121
11122
|
*/
|
|
11122
11123
|
name: {
|
|
11123
11124
|
type: String,
|
|
11124
|
-
|
|
11125
|
+
default: void 0
|
|
11125
11126
|
},
|
|
11126
11127
|
/**
|
|
11127
11128
|
* If set to true, display the column, set to false to hide it.
|
|
@@ -11204,6 +11205,10 @@ const _sfc_main$J = /* @__PURE__ */ vue.defineComponent({
|
|
|
11204
11205
|
setVisibilityColumn: setVisibilityColumn2,
|
|
11205
11206
|
addColumn: addColumn2
|
|
11206
11207
|
} = FTableInjected();
|
|
11208
|
+
const internalVisible = vue.ref(true);
|
|
11209
|
+
const renderElement = vue.ref(true);
|
|
11210
|
+
const id = logic.ElementIdService.generateElementId("column");
|
|
11211
|
+
const el = vue.useTemplateRef("element");
|
|
11207
11212
|
const props = __props;
|
|
11208
11213
|
const classes = vue.computed(() => {
|
|
11209
11214
|
return ["table__column", `table__column--${props.type}`];
|
|
@@ -11218,33 +11223,51 @@ const _sfc_main$J = /* @__PURE__ */ vue.defineComponent({
|
|
|
11218
11223
|
return "td";
|
|
11219
11224
|
}
|
|
11220
11225
|
});
|
|
11221
|
-
vue.watch(() => props.visible, () =>
|
|
11226
|
+
vue.watch(() => props.visible, () => {
|
|
11227
|
+
internalVisible.value = props.visible;
|
|
11228
|
+
setVisibilityColumn2(id, props.visible);
|
|
11229
|
+
});
|
|
11222
11230
|
vue.onMounted(() => {
|
|
11223
11231
|
if (props.shrink && props.expand) {
|
|
11224
11232
|
throw new Error("Table cannot have both shrink and expand enabled at the same time");
|
|
11225
11233
|
}
|
|
11226
11234
|
const size = props.shrink ? FTableColumnSize.SHRINK : FTableColumnSize.EXPAND;
|
|
11227
|
-
|
|
11228
|
-
|
|
11229
|
-
|
|
11230
|
-
|
|
11231
|
-
|
|
11232
|
-
|
|
11233
|
-
|
|
11234
|
-
|
|
11235
|
-
|
|
11236
|
-
|
|
11237
|
-
|
|
11235
|
+
const header = isHeader();
|
|
11236
|
+
if (header) {
|
|
11237
|
+
addColumn2({
|
|
11238
|
+
name: props.name,
|
|
11239
|
+
title: props.title,
|
|
11240
|
+
description: props.description || void 0,
|
|
11241
|
+
id,
|
|
11242
|
+
size,
|
|
11243
|
+
type: props.type,
|
|
11244
|
+
visible: props.visible,
|
|
11245
|
+
sortable: false,
|
|
11246
|
+
sort: FTableColumnSort.UNSORTED
|
|
11247
|
+
});
|
|
11248
|
+
}
|
|
11249
|
+
renderElement.value = renderColumns && !header;
|
|
11250
|
+
internalVisible.value = props.visible;
|
|
11238
11251
|
});
|
|
11252
|
+
function isHeader() {
|
|
11253
|
+
if (!el.value || !(el.value instanceof HTMLElement)) {
|
|
11254
|
+
return false;
|
|
11255
|
+
}
|
|
11256
|
+
const closest = el.value.closest("thead, tbody");
|
|
11257
|
+
return (closest == null ? void 0 : closest.tagName) === "THEAD";
|
|
11258
|
+
}
|
|
11239
11259
|
return (_ctx, _cache) => {
|
|
11240
|
-
return
|
|
11260
|
+
return renderElement.value && internalVisible.value ? (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(tagName2.value), vue.mergeProps({
|
|
11241
11261
|
key: 0,
|
|
11262
|
+
ref: "element",
|
|
11242
11263
|
class: classes.value,
|
|
11243
11264
|
scope: scope.value
|
|
11244
11265
|
}, _ctx.$attrs), {
|
|
11245
|
-
default: vue.withCtx(() => [vue.
|
|
11266
|
+
default: vue.withCtx(() => [vue.unref(renderColumns) ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, {
|
|
11267
|
+
key: 0
|
|
11268
|
+
}, [vue.renderSlot(_ctx.$slots, "default"), _cache[0] || (_cache[0] = vue.createTextVNode()), _cache[1] || (_cache[1] = vue.createElementVNode("span", {
|
|
11246
11269
|
class: "sr-only"
|
|
11247
|
-
}, " ", -1))]),
|
|
11270
|
+
}, " ", -1))], 64)) : vue.createCommentVNode("", true)]),
|
|
11248
11271
|
_: 3
|
|
11249
11272
|
}, 16, ["class", "scope"])) : vue.createCommentVNode("", true);
|
|
11250
11273
|
};
|
|
@@ -11310,7 +11333,7 @@ const _hoisted_5$d = {
|
|
|
11310
11333
|
class: "label__message label__message--error"
|
|
11311
11334
|
};
|
|
11312
11335
|
const _hoisted_6$b = ["for"];
|
|
11313
|
-
const _hoisted_7$
|
|
11336
|
+
const _hoisted_7$9 = {
|
|
11314
11337
|
key: 0,
|
|
11315
11338
|
class: "label__message label__message--error"
|
|
11316
11339
|
};
|
|
@@ -11336,7 +11359,7 @@ function _sfc_render$p(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
11336
11359
|
}, [vue.renderSlot(_ctx.$slots, "default"), _cache[5] || (_cache[5] = vue.createTextVNode()), vue.renderSlot(_ctx.$slots, "description", {
|
|
11337
11360
|
descriptionClass: _ctx.descriptionClass,
|
|
11338
11361
|
formatDescriptionClass: _ctx.formatDescriptionClass
|
|
11339
|
-
}), _cache[6] || (_cache[6] = vue.createTextVNode()), _ctx.hasErrorMessageSlot ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_7$
|
|
11362
|
+
}), _cache[6] || (_cache[6] = vue.createTextVNode()), _ctx.hasErrorMessageSlot ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_7$9, [vue.createVNode(_component_f_icon, {
|
|
11340
11363
|
class: "label__icon--left",
|
|
11341
11364
|
name: "error"
|
|
11342
11365
|
}), _cache[4] || (_cache[4] = vue.createTextVNode()), vue.renderSlot(_ctx.$slots, "error-message")])) : vue.createCommentVNode("", true)], 8, _hoisted_6$b));
|
|
@@ -11926,7 +11949,7 @@ const _hoisted_6$a = {
|
|
|
11926
11949
|
key: 2,
|
|
11927
11950
|
class: "text-field__append-inner"
|
|
11928
11951
|
};
|
|
11929
|
-
const _hoisted_7$
|
|
11952
|
+
const _hoisted_7$8 = {
|
|
11930
11953
|
key: 3,
|
|
11931
11954
|
class: "text-field__append-inner"
|
|
11932
11955
|
};
|
|
@@ -11996,7 +12019,7 @@ function _sfc_render$n(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
11996
12019
|
"is-open": _ctx.showPopupError,
|
|
11997
12020
|
"error-message": _ctx.validationMessage,
|
|
11998
12021
|
onClose: _ctx.closePopupError
|
|
11999
|
-
}, null, 8, ["anchor", "is-open", "error-message", "onClose"])) : vue.createCommentVNode("", true), _cache[15] || (_cache[15] = vue.createTextVNode()), _ctx.$slots["append-inner"] ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_6$a, [vue.renderSlot(_ctx.$slots, "append-inner")])) : vue.createCommentVNode("", true), _cache[16] || (_cache[16] = vue.createTextVNode()), _ctx.options ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_7$
|
|
12022
|
+
}, null, 8, ["anchor", "is-open", "error-message", "onClose"])) : vue.createCommentVNode("", true), _cache[15] || (_cache[15] = vue.createTextVNode()), _ctx.$slots["append-inner"] ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_6$a, [vue.renderSlot(_ctx.$slots, "append-inner")])) : vue.createCommentVNode("", true), _cache[16] || (_cache[16] = vue.createTextVNode()), _ctx.options ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_7$8, [vue.createVNode(_component_i_combobox_toggle_button, {
|
|
12000
12023
|
disabled: _ctx.disabled,
|
|
12001
12024
|
"aria-controls": _ctx.dropdownIsOpen ? _ctx.dropdownId : void 0,
|
|
12002
12025
|
"aria-expanded": _ctx.dropdownIsOpen,
|
|
@@ -12851,13 +12874,7 @@ const _hoisted_4$e = ["title"];
|
|
|
12851
12874
|
const _hoisted_5$b = {
|
|
12852
12875
|
class: "sr-only"
|
|
12853
12876
|
};
|
|
12854
|
-
const _hoisted_6$9 =
|
|
12855
|
-
value: {
|
|
12856
|
-
attribute: "",
|
|
12857
|
-
ascending: false
|
|
12858
|
-
}
|
|
12859
|
-
};
|
|
12860
|
-
const _hoisted_7$8 = ["value"];
|
|
12877
|
+
const _hoisted_6$9 = ["value"];
|
|
12861
12878
|
const _sfc_main$s = /* @__PURE__ */ vue.defineComponent({
|
|
12862
12879
|
__name: "FSortFilterDataset",
|
|
12863
12880
|
props: {
|
|
@@ -12925,13 +12942,14 @@ const _sfc_main$s = /* @__PURE__ */ vue.defineComponent({
|
|
|
12925
12942
|
}) {
|
|
12926
12943
|
const $t2 = useTranslate();
|
|
12927
12944
|
const searchString = vue.ref("");
|
|
12928
|
-
const
|
|
12945
|
+
const defaultSortValue = {
|
|
12929
12946
|
attribute: "",
|
|
12930
12947
|
name: "",
|
|
12931
12948
|
ascendingName: "",
|
|
12932
12949
|
ascending: false,
|
|
12933
12950
|
id: 0
|
|
12934
|
-
}
|
|
12951
|
+
};
|
|
12952
|
+
const sortAttribute = vue.ref(defaultSortValue);
|
|
12935
12953
|
const sortFilterResult = vue.ref([]);
|
|
12936
12954
|
const debouncedFilterResultset = logic.debounce(filterResultset, 250);
|
|
12937
12955
|
let tableCallbackOnSort = () => {
|
|
@@ -13106,11 +13124,13 @@ const _sfc_main$s = /* @__PURE__ */ vue.defineComponent({
|
|
|
13106
13124
|
onChange: onChangeSortAttribute
|
|
13107
13125
|
}, {
|
|
13108
13126
|
label: vue.withCtx(() => [vue.createTextVNode(vue.toDisplayString(vue.unref($t2)("fkui.sort-filter-dataset.label.sort", "Sortera på")), 1)]),
|
|
13109
|
-
default: vue.withCtx(() => [_cache[5] || (_cache[5] = vue.createTextVNode()), vue.createElementVNode("option",
|
|
13127
|
+
default: vue.withCtx(() => [_cache[5] || (_cache[5] = vue.createTextVNode()), vue.createElementVNode("option", {
|
|
13128
|
+
value: defaultSortValue
|
|
13129
|
+
}, vue.toDisplayString(vue.unref($t2)("fkui.sort-filter-dataset.label.unsorted", "Välj")), 1), _cache[6] || (_cache[6] = vue.createTextVNode()), (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(sortOrders.value, (sortOrder) => {
|
|
13110
13130
|
return vue.openBlock(), vue.createElementBlock("option", {
|
|
13111
13131
|
key: sortOrder.id,
|
|
13112
13132
|
value: sortOrder
|
|
13113
|
-
}, vue.toDisplayString(sortOrder.name) + " (" + vue.toDisplayString(sortOrder.ascendingName) + ")\n ", 9,
|
|
13133
|
+
}, vue.toDisplayString(sortOrder.name) + " (" + vue.toDisplayString(sortOrder.ascendingName) + ")\n ", 9, _hoisted_6$9);
|
|
13114
13134
|
}), 128))]),
|
|
13115
13135
|
_: 1
|
|
13116
13136
|
}, 8, ["modelValue"])]),
|
|
@@ -13278,6 +13298,9 @@ const _sfc_main$r = /* @__PURE__ */ vue.defineComponent({
|
|
|
13278
13298
|
return;
|
|
13279
13299
|
}
|
|
13280
13300
|
let columnName = column.name;
|
|
13301
|
+
if (!columnName) {
|
|
13302
|
+
throw new Error("`FTableColumn` must have a unique `name` when used with `FSortFilterDataset`");
|
|
13303
|
+
}
|
|
13281
13304
|
if (column.sort === FTableColumnSort.DESCENDING) {
|
|
13282
13305
|
columnName = "";
|
|
13283
13306
|
column.sort = FTableColumnSort.UNSORTED;
|
|
@@ -13299,12 +13322,14 @@ const _sfc_main$r = /* @__PURE__ */ vue.defineComponent({
|
|
|
13299
13322
|
}, [vue.createElementVNode("table", vue.mergeProps({
|
|
13300
13323
|
class: ["table", tableClasses.value],
|
|
13301
13324
|
tabindex: tabindex.value
|
|
13302
|
-
}, _ctx.$attrs), [hasCaption.value ? (vue.openBlock(), vue.createElementBlock("caption", _hoisted_2$l, [vue.renderSlot(_ctx.$slots, "caption")])) : vue.createCommentVNode("", true), _cache[
|
|
13325
|
+
}, _ctx.$attrs), [hasCaption.value ? (vue.openBlock(), vue.createElementBlock("caption", _hoisted_2$l, [vue.renderSlot(_ctx.$slots, "caption")])) : vue.createCommentVNode("", true), _cache[5] || (_cache[5] = vue.createTextVNode()), vue.createElementVNode("colgroup", null, [(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(columns.value, (column) => {
|
|
13303
13326
|
return vue.openBlock(), vue.createElementBlock("col", {
|
|
13304
13327
|
key: column.id,
|
|
13305
13328
|
class: vue.normalizeClass(column.size)
|
|
13306
13329
|
}, null, 2);
|
|
13307
|
-
}), 128))]), _cache[
|
|
13330
|
+
}), 128))]), _cache[6] || (_cache[6] = vue.createTextVNode()), vue.createElementVNode("thead", null, [vue.createElementVNode("tr", _hoisted_3$h, [vue.renderSlot(_ctx.$slots, "default", vue.normalizeProps(vue.guardReactiveProps({
|
|
13331
|
+
row: {}
|
|
13332
|
+
}))), _cache[2] || (_cache[2] = vue.createTextVNode()), (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(visibleColumns.value, (column) => {
|
|
13308
13333
|
return vue.openBlock(), vue.createElementBlock("th", vue.mergeProps({
|
|
13309
13334
|
key: column.id,
|
|
13310
13335
|
scope: "col",
|
|
@@ -13318,12 +13343,12 @@ const _sfc_main$r = /* @__PURE__ */ vue.defineComponent({
|
|
|
13318
13343
|
class: vue.normalizeClass(iconClasses2(column)),
|
|
13319
13344
|
name: iconName(column)
|
|
13320
13345
|
}, null, 8, ["class", "name"])) : vue.createCommentVNode("", true), _cache[1] || (_cache[1] = vue.createTextVNode()), column.description ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_5$a, vue.toDisplayString(column.description), 1)) : vue.createCommentVNode("", true)], 16);
|
|
13321
|
-
}), 128))])]), _cache[
|
|
13346
|
+
}), 128))])]), _cache[7] || (_cache[7] = vue.createTextVNode()), vue.createElementVNode("tbody", null, [isEmpty.value && columns.value.length === 0 ? (vue.openBlock(), vue.createElementBlock("tr", _hoisted_6$8, [vue.renderSlot(_ctx.$slots, "default", vue.normalizeProps(vue.guardReactiveProps({
|
|
13322
13347
|
row: {}
|
|
13323
|
-
})))])) : vue.createCommentVNode("", true), _cache[
|
|
13348
|
+
})))])) : vue.createCommentVNode("", true), _cache[3] || (_cache[3] = vue.createTextVNode()), isEmpty.value ? (vue.openBlock(), vue.createElementBlock("tr", _hoisted_7$7, [vue.createElementVNode("td", {
|
|
13324
13349
|
class: "table__column table__column--action",
|
|
13325
13350
|
colspan: columns.value.length
|
|
13326
|
-
}, [vue.renderSlot(_ctx.$slots, "empty", {}, () => [vue.createTextVNode(vue.toDisplayString(vue.unref($t2)("fkui.data-table.empty", "Tabellen är tom")), 1)])], 8, _hoisted_8$5)])) : vue.createCommentVNode("", true), _cache[
|
|
13351
|
+
}, [vue.renderSlot(_ctx.$slots, "empty", {}, () => [vue.createTextVNode(vue.toDisplayString(vue.unref($t2)("fkui.data-table.empty", "Tabellen är tom")), 1)])], 8, _hoisted_8$5)])) : vue.createCommentVNode("", true), _cache[4] || (_cache[4] = vue.createTextVNode()), (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(internalRows.value, (row) => {
|
|
13327
13352
|
return vue.openBlock(), vue.createElementBlock("tr", {
|
|
13328
13353
|
key: rowKey(row),
|
|
13329
13354
|
class: "table__row"
|
|
@@ -14684,7 +14709,7 @@ const _sfc_main$k = /* @__PURE__ */ vue.defineComponent({
|
|
|
14684
14709
|
expandableRows,
|
|
14685
14710
|
hasExpandableContent
|
|
14686
14711
|
} = expandableTable;
|
|
14687
|
-
const
|
|
14712
|
+
const tbody = vue.useTemplateRef("tbodyElement");
|
|
14688
14713
|
const hasCaption = vue.computed(() => {
|
|
14689
14714
|
return hasSlot2("caption", {}, {
|
|
14690
14715
|
stripClasses: []
|
|
@@ -14766,21 +14791,21 @@ const _sfc_main$k = /* @__PURE__ */ vue.defineComponent({
|
|
|
14766
14791
|
immediate: true,
|
|
14767
14792
|
deep: true
|
|
14768
14793
|
});
|
|
14769
|
-
function updateTr(
|
|
14770
|
-
const trElements = [].slice.call(
|
|
14794
|
+
function updateTr(tbodyElement) {
|
|
14795
|
+
const trElements = [].slice.call(tbodyElement.children);
|
|
14771
14796
|
const trInteractableElements = trElements.filter((tr2) => {
|
|
14772
14797
|
return tr2.tabIndex === 0;
|
|
14773
14798
|
});
|
|
14774
14799
|
tr.value = trInteractableElements;
|
|
14775
14800
|
}
|
|
14776
14801
|
vue.onUpdated(() => {
|
|
14777
|
-
if (
|
|
14778
|
-
updateTr(
|
|
14802
|
+
if (tbody.value) {
|
|
14803
|
+
updateTr(tbody.value);
|
|
14779
14804
|
}
|
|
14780
14805
|
});
|
|
14781
14806
|
vue.onMounted(() => {
|
|
14782
|
-
if (
|
|
14783
|
-
updateTr(
|
|
14807
|
+
if (tbody.value) {
|
|
14808
|
+
updateTr(tbody.value);
|
|
14784
14809
|
}
|
|
14785
14810
|
registerCallbackOnSort(callbackOnSort);
|
|
14786
14811
|
registerCallbackOnMount(callbackSortableColumns);
|
|
@@ -14894,6 +14919,9 @@ const _sfc_main$k = /* @__PURE__ */ vue.defineComponent({
|
|
|
14894
14919
|
return;
|
|
14895
14920
|
}
|
|
14896
14921
|
let columnName = column.name;
|
|
14922
|
+
if (!columnName) {
|
|
14923
|
+
throw new Error("`FTableColumn` must have a unique `name` when used with `FSortFilterDataset`");
|
|
14924
|
+
}
|
|
14897
14925
|
if (column.sort === FTableColumnSort.DESCENDING) {
|
|
14898
14926
|
columnName = "";
|
|
14899
14927
|
column.sort = FTableColumnSort.UNSORTED;
|
|
@@ -14938,15 +14966,17 @@ const _sfc_main$k = /* @__PURE__ */ vue.defineComponent({
|
|
|
14938
14966
|
return (_ctx, _cache) => {
|
|
14939
14967
|
return vue.openBlock(), vue.createElementBlock("div", {
|
|
14940
14968
|
class: vue.normalizeClass(wrapperClasses.value)
|
|
14941
|
-
}, [vue.createCommentVNode("", true), _cache[
|
|
14969
|
+
}, [vue.createCommentVNode("", true), _cache[19] || (_cache[19] = vue.createTextVNode()), vue.createElementVNode("table", vue.mergeProps({
|
|
14942
14970
|
class: ["table", tableClasses.value],
|
|
14943
14971
|
role: tableRole.value
|
|
14944
|
-
}, _ctx.$attrs), [hasCaption.value ? (vue.openBlock(), vue.createElementBlock("caption", _hoisted_2$e, [vue.renderSlot(_ctx.$slots, "caption")])) : vue.createCommentVNode("", true), _cache[
|
|
14972
|
+
}, _ctx.$attrs), [hasCaption.value ? (vue.openBlock(), vue.createElementBlock("caption", _hoisted_2$e, [vue.renderSlot(_ctx.$slots, "caption")])) : vue.createCommentVNode("", true), _cache[16] || (_cache[16] = vue.createTextVNode()), vue.createElementVNode("colgroup", null, [vue.unref(isExpandableTable) ? (vue.openBlock(), vue.createElementBlock("col", _hoisted_3$a)) : vue.createCommentVNode("", true), _cache[0] || (_cache[0] = vue.createTextVNode()), __props.selectable ? (vue.openBlock(), vue.createElementBlock("col", _hoisted_4$8)) : vue.createCommentVNode("", true), _cache[1] || (_cache[1] = vue.createTextVNode()), (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(columns.value, (column) => {
|
|
14945
14973
|
return vue.openBlock(), vue.createElementBlock("col", {
|
|
14946
14974
|
key: column.id,
|
|
14947
14975
|
class: vue.normalizeClass(column.size)
|
|
14948
14976
|
}, null, 2);
|
|
14949
|
-
}), 128))]), _cache[
|
|
14977
|
+
}), 128))]), _cache[17] || (_cache[17] = vue.createTextVNode()), vue.createElementVNode("thead", null, [vue.createElementVNode("tr", _hoisted_5$6, [vue.renderSlot(_ctx.$slots, "default", vue.normalizeProps(vue.guardReactiveProps({
|
|
14978
|
+
row: {}
|
|
14979
|
+
}))), _cache[4] || (_cache[4] = vue.createTextVNode()), vue.unref(isExpandableTable) ? (vue.openBlock(), vue.createElementBlock("th", _hoisted_6$4, [vue.createElementVNode("span", _hoisted_7$3, vue.toDisplayString(vue.unref($t2)("fkui.interactive-table.select", "Expandera")), 1)])) : vue.createCommentVNode("", true), _cache[5] || (_cache[5] = vue.createTextVNode()), __props.selectable ? (vue.openBlock(), vue.createElementBlock("th", _hoisted_8$3, [vue.createElementVNode("span", _hoisted_9$3, vue.toDisplayString(vue.unref($t2)("fkui.interactive-table.select", "Markera")), 1)])) : vue.createCommentVNode("", true), _cache[6] || (_cache[6] = vue.createTextVNode()), (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(visibleColumns.value, (column) => {
|
|
14950
14980
|
return vue.openBlock(), vue.createElementBlock("th", vue.mergeProps({
|
|
14951
14981
|
key: column.id,
|
|
14952
14982
|
scope: "col",
|
|
@@ -14960,9 +14990,8 @@ const _sfc_main$k = /* @__PURE__ */ vue.defineComponent({
|
|
|
14960
14990
|
class: vue.normalizeClass(iconClasses2(column)),
|
|
14961
14991
|
name: iconName(column)
|
|
14962
14992
|
}, null, 8, ["class", "name"])) : vue.createCommentVNode("", true), _cache[3] || (_cache[3] = vue.createTextVNode()), column.description ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_11$1, vue.toDisplayString(column.description), 1)) : vue.createCommentVNode("", true)], 16);
|
|
14963
|
-
}), 128))])]), _cache[
|
|
14964
|
-
|
|
14965
|
-
ref: tbodyElement,
|
|
14993
|
+
}), 128))])]), _cache[18] || (_cache[18] = vue.createTextVNode()), (vue.openBlock(), vue.createElementBlock("tbody", {
|
|
14994
|
+
ref: "tbodyElement",
|
|
14966
14995
|
key: tbodyKey.value
|
|
14967
14996
|
}, [(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(internalRows.value, (row, index) => {
|
|
14968
14997
|
return vue.openBlock(), vue.createElementBlock(vue.Fragment, {
|
|
@@ -14979,7 +15008,7 @@ const _sfc_main$k = /* @__PURE__ */ vue.defineComponent({
|
|
|
14979
15008
|
}, [vue.unref(isExpandableTable) ? (vue.openBlock(), vue.createElementBlock("td", _hoisted_13, [vue.unref(hasExpandableContent)(row) ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_14, [vue.createVNode(vue.unref(FIcon), {
|
|
14980
15009
|
name: "arrow-right",
|
|
14981
15010
|
rotate: vue.unref(isExpanded)(row) ? "270" : "90"
|
|
14982
|
-
}, null, 8, ["rotate"])])) : vue.createCommentVNode("", true)])) : vue.createCommentVNode("", true), _cache[
|
|
15011
|
+
}, null, 8, ["rotate"])])) : vue.createCommentVNode("", true)])) : vue.createCommentVNode("", true), _cache[7] || (_cache[7] = vue.createTextVNode()), __props.selectable ? (vue.openBlock(), vue.createElementBlock("td", _hoisted_15, [vue.createElementVNode("div", _hoisted_16, [vue.createVNode(vue.unref(FCheckboxField), {
|
|
14983
15012
|
value: true,
|
|
14984
15013
|
"model-value": isSelected(row),
|
|
14985
15014
|
onClick: vue.withModifiers(($event) => onSelect(row), ["self"])
|
|
@@ -14990,20 +15019,20 @@ const _sfc_main$k = /* @__PURE__ */ vue.defineComponent({
|
|
|
14990
15019
|
row
|
|
14991
15020
|
}))])) : vue.createCommentVNode("", true)]),
|
|
14992
15021
|
_: 2
|
|
14993
|
-
}, 1032, ["model-value", "onClick"])])])) : vue.createCommentVNode("", true), _cache[
|
|
15022
|
+
}, 1032, ["model-value", "onClick"])])])) : vue.createCommentVNode("", true), _cache[8] || (_cache[8] = vue.createTextVNode()), vue.renderSlot(_ctx.$slots, "default", vue.mergeProps({
|
|
14994
15023
|
ref_for: true
|
|
14995
15024
|
}, {
|
|
14996
15025
|
row
|
|
14997
|
-
}))], 42, _hoisted_12$1), _cache[
|
|
15026
|
+
}))], 42, _hoisted_12$1), _cache[12] || (_cache[12] = vue.createTextVNode()), vue.unref(isExpandableTable) && vue.unref(hasExpandableContent)(row) ? (vue.openBlock(true), vue.createElementBlock(vue.Fragment, {
|
|
14998
15027
|
key: 0
|
|
14999
15028
|
}, vue.renderList(vue.unref(expandableRows)(row), (expandableRow, expandableIndex) => {
|
|
15000
15029
|
return vue.openBlock(), vue.createElementBlock("tr", {
|
|
15001
15030
|
key: rowKey(expandableRow),
|
|
15002
15031
|
"aria-level": "2",
|
|
15003
15032
|
class: vue.normalizeClass(vue.unref(expandableRowClasses)(row, expandableIndex))
|
|
15004
|
-
}, [_cache[
|
|
15033
|
+
}, [_cache[9] || (_cache[9] = vue.createElementVNode("td", {
|
|
15005
15034
|
class: "table__column--placeholder"
|
|
15006
|
-
}, null, -1)), _cache[
|
|
15035
|
+
}, null, -1)), _cache[10] || (_cache[10] = vue.createTextVNode()), __props.selectable ? (vue.openBlock(), vue.createElementBlock("td", _hoisted_18)) : vue.createCommentVNode("", true), _cache[11] || (_cache[11] = vue.createTextVNode()), !vue.unref(hasExpandableSlot) ? vue.renderSlot(_ctx.$slots, "default", vue.mergeProps({
|
|
15007
15036
|
key: 1,
|
|
15008
15037
|
ref_for: true
|
|
15009
15038
|
}, {
|
|
@@ -15019,12 +15048,12 @@ const _sfc_main$k = /* @__PURE__ */ vue.defineComponent({
|
|
|
15019
15048
|
parentRow: row
|
|
15020
15049
|
}))], 8, _hoisted_19))], 2);
|
|
15021
15050
|
}), 128)) : vue.createCommentVNode("", true)], 64);
|
|
15022
|
-
}), 128)), _cache[
|
|
15051
|
+
}), 128)), _cache[14] || (_cache[14] = vue.createTextVNode()), isEmpty.value && columns.value.length === 0 ? (vue.openBlock(), vue.createElementBlock("tr", _hoisted_20, [vue.renderSlot(_ctx.$slots, "default", vue.normalizeProps(vue.guardReactiveProps({
|
|
15023
15052
|
row: {}
|
|
15024
|
-
})))])) : vue.createCommentVNode("", true), _cache[
|
|
15053
|
+
})))])) : vue.createCommentVNode("", true), _cache[15] || (_cache[15] = vue.createTextVNode()), isEmpty.value ? (vue.openBlock(), vue.createElementBlock("tr", _hoisted_21, [vue.createElementVNode("td", {
|
|
15025
15054
|
class: "table__column table__column--action",
|
|
15026
15055
|
colspan: nbOfColumns.value
|
|
15027
|
-
}, [vue.renderSlot(_ctx.$slots, "empty", {}, () => [vue.createTextVNode(vue.toDisplayString(vue.unref($t2)("fkui.interactive-table.empty", "Tabellen är tom")), 1)])], 8, _hoisted_22), _cache[
|
|
15056
|
+
}, [vue.renderSlot(_ctx.$slots, "empty", {}, () => [vue.createTextVNode(vue.toDisplayString(vue.unref($t2)("fkui.interactive-table.empty", "Tabellen är tom")), 1)])], 8, _hoisted_22), _cache[13] || (_cache[13] = vue.createTextVNode()), vue.renderSlot(_ctx.$slots, "default", vue.normalizeProps(vue.guardReactiveProps({
|
|
15028
15057
|
row: {}
|
|
15029
15058
|
})))])) : vue.createCommentVNode("", true)]))], 16, _hoisted_1$k)], 2);
|
|
15030
15059
|
};
|