@folkehelseinstituttet/designsystem 0.36.0 → 0.37.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/base-D76d76ww.js +10 -0
- package/base-D76d76ww.js.map +1 -0
- package/custom-elements.json +1 -1
- package/fhi-data-table-cell.d.ts +1 -0
- package/fhi-data-table-cell.js +82 -0
- package/fhi-data-table-cell.js.map +1 -0
- package/fhi-data-table-cell.manifest.json +1 -0
- package/fhi-data-table-row.d.ts +1 -0
- package/fhi-data-table-row.js +98 -0
- package/fhi-data-table-row.js.map +1 -0
- package/fhi-data-table-row.manifest.json +1 -0
- package/fhi-data-table.d.ts +1 -0
- package/fhi-data-table.js +94 -0
- package/fhi-data-table.js.map +1 -0
- package/fhi-data-table.manifest.json +1 -0
- package/fhi-date-input.js +1 -1
- package/fhi-modal-dialog.js +1 -1
- package/fhi-radio.js +1 -1
- package/fhi-text-input.js +1 -1
- package/fhi-tooltip.js +1 -1
- package/index.js +99 -90
- package/index.js.map +1 -1
- package/package.json +1 -1
- package/query-Ddbd72Um.js +21 -0
- package/query-Ddbd72Um.js.map +1 -0
- package/web-types.json +81 -1
- package/query-NJDNu0-P.js +0 -26
- package/query-NJDNu0-P.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { i as d, n as s, a as f, b as c, t as p } from "./property-DGdAXcEz.js";
|
|
2
|
+
var y = Object.defineProperty, b = Object.getOwnPropertyDescriptor, h = (e, a, r, l) => {
|
|
3
|
+
for (var t = l > 1 ? void 0 : l ? b(a, r) : a, o = e.length - 1, n; o >= 0; o--)
|
|
4
|
+
(n = e[o]) && (t = (l ? n(a, r, t) : n(t)) || t);
|
|
5
|
+
return l && t && y(a, r, t), t;
|
|
6
|
+
};
|
|
7
|
+
const u = "fhi-data-table-cell";
|
|
8
|
+
let i = class extends f {
|
|
9
|
+
constructor() {
|
|
10
|
+
super(...arguments), this.variant = "body";
|
|
11
|
+
}
|
|
12
|
+
update(e) {
|
|
13
|
+
e.has("variant") && (this.role = this.variant === "header" ? "columnheader" : "cell"), super.update(e);
|
|
14
|
+
}
|
|
15
|
+
render() {
|
|
16
|
+
return c`
|
|
17
|
+
<div class="cell-content">
|
|
18
|
+
<slot></slot>
|
|
19
|
+
</div>
|
|
20
|
+
`;
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
i.styles = d`
|
|
24
|
+
:host {
|
|
25
|
+
--fhi-data-table-cell-justify-content: unset;
|
|
26
|
+
--fhi-data-table-cell-align-items: unset;
|
|
27
|
+
|
|
28
|
+
--fhi-data-table-cell-border-style: unset;
|
|
29
|
+
--fhi-data-table-cell-border-width: unset;
|
|
30
|
+
--fhi-data-table-cell-border-color: unset;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
:host {
|
|
34
|
+
--fhi-data-table-cell-justify-content: start;
|
|
35
|
+
--fhi-data-table-cell-align-items: center;
|
|
36
|
+
|
|
37
|
+
display: table-cell;
|
|
38
|
+
vertical-align: middle;
|
|
39
|
+
|
|
40
|
+
padding: var(--fhi-spacing-150);
|
|
41
|
+
color: var(--fhi-color-neutral-text-default);
|
|
42
|
+
|
|
43
|
+
border-style: var(--fhi-data-table-cell-border-style);
|
|
44
|
+
border-width: var(--fhi-data-table-cell-border-width);
|
|
45
|
+
border-color: var(--fhi-data-table-cell-border-color);
|
|
46
|
+
|
|
47
|
+
.cell-content {
|
|
48
|
+
display: flex;
|
|
49
|
+
align-items: var(--fhi-data-table-cell-align-items);
|
|
50
|
+
justify-content: var(--fhi-data-table-cell-justify-content);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
:host([variant='body']) {
|
|
55
|
+
letter-spacing: var(--fhi-typography-body-medium-letter-spacing);
|
|
56
|
+
|
|
57
|
+
font: var(--fhi-typography-body-medium-font-weight)
|
|
58
|
+
var(--fhi-typography-body-medium-font-size) /
|
|
59
|
+
var(--fhi-typography-body-medium-line-height)
|
|
60
|
+
var(--fhi-font-family-default);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
:host([variant='header']) {
|
|
64
|
+
letter-spacing: var(--fhi-typography-title-medium-letter-spacing);
|
|
65
|
+
|
|
66
|
+
font: var(--fhi-typography-title-medium-font-weight)
|
|
67
|
+
var(--fhi-typography-title-medium-font-size) /
|
|
68
|
+
var(--fhi-typography-title-medium-line-height)
|
|
69
|
+
var(--fhi-font-family-default);
|
|
70
|
+
}
|
|
71
|
+
`;
|
|
72
|
+
h([
|
|
73
|
+
s({ type: String, reflect: !0 })
|
|
74
|
+
], i.prototype, "variant", 2);
|
|
75
|
+
i = h([
|
|
76
|
+
p(u)
|
|
77
|
+
], i);
|
|
78
|
+
export {
|
|
79
|
+
i as FhiDataTableCell,
|
|
80
|
+
u as FhiDataTableCellSelector
|
|
81
|
+
};
|
|
82
|
+
//# sourceMappingURL=fhi-data-table-cell.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fhi-data-table-cell.js","sources":["../../src/components/data-table/fhi-data-table-cell/fhi-data-table-cell.component.ts"],"sourcesContent":["import { html, css, LitElement, PropertyValues } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\n\nexport const FhiDataTableCellSelector = 'fhi-data-table-cell';\n\n/**\n * ## FHI Table Cell\n *\n * {@link https://designsystem.fhi.no/?path=/docs/komponenter-data-table--docs}\n *\n * The `<fhi-data-table-cell>` component is an implementation of a table cell according to the FHI Design System guidelines.\n * It allows users to properly display data within a `<fhi-data-table-row>`.\n *\n * The `<fhi-table-cell>` component does not use the native HTML `<td>` or `<th>` elements. Instead, it relies on CSS Grid to achieve the desired layout and styling.\n *\n * @tag fhi-data-table-cell\n * @element fhi-data-table-cell\n */\n@customElement(FhiDataTableCellSelector)\nexport class FhiDataTableCell extends LitElement {\n /**\n * Defines the variant of the table cell, which can be either 'header' or 'body'. This determines the styling and role of the cell within the table.\n * @type {'header' | 'body'}\n */\n @property({ type: String, reflect: true })\n variant: 'header' | 'body' = 'body';\n\n protected update(changedProperties: PropertyValues): void {\n if (changedProperties.has('variant')) {\n this.role = this.variant === 'header' ? 'columnheader' : 'cell';\n }\n\n super.update(changedProperties);\n }\n\n render() {\n return html`\n <div class=\"cell-content\">\n <slot></slot>\n </div>\n `;\n }\n\n static styles = css`\n :host {\n --fhi-data-table-cell-justify-content: unset;\n --fhi-data-table-cell-align-items: unset;\n\n --fhi-data-table-cell-border-style: unset;\n --fhi-data-table-cell-border-width: unset;\n --fhi-data-table-cell-border-color: unset;\n }\n\n :host {\n --fhi-data-table-cell-justify-content: start;\n --fhi-data-table-cell-align-items: center;\n\n display: table-cell;\n vertical-align: middle;\n\n padding: var(--fhi-spacing-150);\n color: var(--fhi-color-neutral-text-default);\n\n border-style: var(--fhi-data-table-cell-border-style);\n border-width: var(--fhi-data-table-cell-border-width);\n border-color: var(--fhi-data-table-cell-border-color);\n\n .cell-content {\n display: flex;\n align-items: var(--fhi-data-table-cell-align-items);\n justify-content: var(--fhi-data-table-cell-justify-content);\n }\n }\n\n :host([variant='body']) {\n letter-spacing: var(--fhi-typography-body-medium-letter-spacing);\n\n font: var(--fhi-typography-body-medium-font-weight)\n var(--fhi-typography-body-medium-font-size) /\n var(--fhi-typography-body-medium-line-height)\n var(--fhi-font-family-default);\n }\n\n :host([variant='header']) {\n letter-spacing: var(--fhi-typography-title-medium-letter-spacing);\n\n font: var(--fhi-typography-title-medium-font-weight)\n var(--fhi-typography-title-medium-font-size) /\n var(--fhi-typography-title-medium-line-height)\n var(--fhi-font-family-default);\n }\n `;\n}\n"],"names":["FhiDataTableCellSelector","FhiDataTableCell","LitElement","changedProperties","html","css","__decorateClass","property","customElement"],"mappings":";;;;;;AAGO,MAAMA,IAA2B;AAgBjC,IAAMC,IAAN,cAA+BC,EAAW;AAAA,EAA1C,cAAA;AAAA,UAAA,GAAA,SAAA,GAML,KAAA,UAA6B;AAAA,EAAA;AAAA,EAEnB,OAAOC,GAAyC;AACxD,IAAIA,EAAkB,IAAI,SAAS,MACjC,KAAK,OAAO,KAAK,YAAY,WAAW,iBAAiB,SAG3D,MAAM,OAAOA,CAAiB;AAAA,EAChC;AAAA,EAEA,SAAS;AACP,WAAOC;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA,EAKT;AAmDF;AAzEaH,EAwBJ,SAASI;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAlBhBC,EAAA;AAAA,EADCC,EAAS,EAAE,MAAM,QAAQ,SAAS,IAAM;AAAA,GAL9BN,EAMX,WAAA,WAAA,CAAA;AANWA,IAANK,EAAA;AAAA,EADNE,EAAcR,CAAwB;AAAA,GAC1BC,CAAA;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"kind":"javascript-module","path":"src/components/data-table/fhi-data-table-cell/fhi-data-table-cell.component.ts","declarations":[{"kind":"class","description":"## FHI Table Cell\n\nhttps://designsystem.fhi.no/?path=/docs/komponenter-data-table--docs\n\nThe `<fhi-data-table-cell>` component is an implementation of a table cell according to the FHI Design System guidelines.\nIt allows users to properly display data within a `<fhi-data-table-row>`.\n\nThe `<fhi-table-cell>` component does not use the native HTML `<td>` or `<th>` elements. Instead, it relies on CSS Grid to achieve the desired layout and styling.","name":"FhiDataTableCell","members":[{"kind":"field","name":"variant","type":{"text":"'header' | 'body'"},"default":"'body'","description":"Defines the variant of the table cell, which can be either 'header' or 'body'. This determines the styling and role of the cell within the table.","attribute":"variant","reflects":true}],"attributes":[{"name":"variant","type":{"text":"'header' | 'body'"},"default":"'body'","description":"Defines the variant of the table cell, which can be either 'header' or 'body'. This determines the styling and role of the cell within the table.","fieldName":"variant"}],"superclass":{"name":"LitElement","package":"lit"},"tagName":"fhi-data-table-cell","customElement":true},{"kind":"variable","name":"FhiDataTableCellSelector","type":{"text":"string"},"default":"'fhi-data-table-cell'"}]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { i as c, n as f, a as u, b as v, t as w } from "./property-DGdAXcEz.js";
|
|
2
|
+
import { e as p } from "./base-D76d76ww.js";
|
|
3
|
+
/**
|
|
4
|
+
* @license
|
|
5
|
+
* Copyright 2021 Google LLC
|
|
6
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
7
|
+
*/
|
|
8
|
+
function y(t) {
|
|
9
|
+
return (e, l) => {
|
|
10
|
+
const { slot: r, selector: a } = {}, i = "slot" + (r ? `[name=${r}]` : ":not([name])");
|
|
11
|
+
return p(e, l, { get() {
|
|
12
|
+
var h;
|
|
13
|
+
const o = (h = this.renderRoot) == null ? void 0 : h.querySelector(i), d = (o == null ? void 0 : o.assignedElements(t)) ?? [];
|
|
14
|
+
return a === void 0 ? d : d.filter((b) => b.matches(a));
|
|
15
|
+
} });
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
var m = Object.defineProperty, g = Object.getOwnPropertyDescriptor, n = (t, e, l, r) => {
|
|
19
|
+
for (var a = r > 1 ? void 0 : r ? g(e, l) : e, i = t.length - 1, o; i >= 0; i--)
|
|
20
|
+
(o = t[i]) && (a = (r ? o(e, l, a) : o(a)) || a);
|
|
21
|
+
return r && a && m(e, l, a), a;
|
|
22
|
+
};
|
|
23
|
+
const C = "fhi-data-table-row";
|
|
24
|
+
let s = class extends u {
|
|
25
|
+
constructor() {
|
|
26
|
+
super(...arguments), this.variant = "body";
|
|
27
|
+
}
|
|
28
|
+
connectedCallback() {
|
|
29
|
+
super.connectedCallback(), this.role = "row";
|
|
30
|
+
}
|
|
31
|
+
update(t) {
|
|
32
|
+
t.has("variant") && this.variant !== "body" && this.variant !== "header" && (this.variant = "body"), super.update(t);
|
|
33
|
+
}
|
|
34
|
+
updated(t) {
|
|
35
|
+
t.has("variant") && this.setCellVariants(), super.updated(t);
|
|
36
|
+
}
|
|
37
|
+
handleSlotChange() {
|
|
38
|
+
this.setCellVariants();
|
|
39
|
+
}
|
|
40
|
+
setCellVariants() {
|
|
41
|
+
this.slotElements.forEach((t) => {
|
|
42
|
+
if (t.tagName.toLowerCase() === "fhi-data-table-cell") {
|
|
43
|
+
const e = t;
|
|
44
|
+
e.variant !== this.variant && (e.variant = this.variant);
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
render() {
|
|
49
|
+
return v`<slot @slotchange=${this.handleSlotChange}></slot>`;
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
s.styles = c`
|
|
53
|
+
:host {
|
|
54
|
+
--fhi-data-table-row-border-style: unset;
|
|
55
|
+
--fhi-data-table-row-border-width: unset;
|
|
56
|
+
--fhi-data-table-row-border-color: unset;
|
|
57
|
+
|
|
58
|
+
--fhi-data-table-row-background: unset;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
:host {
|
|
62
|
+
display: table-row;
|
|
63
|
+
background: var(--fhi-data-table-row-background);
|
|
64
|
+
|
|
65
|
+
--fhi-data-table-row-border-style: none none solid none;
|
|
66
|
+
--fhi-data-table-row-border-width: var(--fhi-dimension-border-width);
|
|
67
|
+
--fhi-data-table-row-border-color: var(
|
|
68
|
+
--fhi-color-neutral-surface-active
|
|
69
|
+
);
|
|
70
|
+
|
|
71
|
+
::slotted(fhi-data-table-cell) {
|
|
72
|
+
--fhi-data-table-cell-background: var(--fhi-data-table-row-background);
|
|
73
|
+
--fhi-data-table-cell-border-style: var(
|
|
74
|
+
--fhi-data-table-row-border-style
|
|
75
|
+
);
|
|
76
|
+
--fhi-data-table-cell-border-width: var(
|
|
77
|
+
--fhi-data-table-row-border-width
|
|
78
|
+
);
|
|
79
|
+
--fhi-data-table-cell-border-color: var(
|
|
80
|
+
--fhi-data-table-row-border-color
|
|
81
|
+
);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
`;
|
|
85
|
+
n([
|
|
86
|
+
f({ type: String, reflect: !0 })
|
|
87
|
+
], s.prototype, "variant", 2);
|
|
88
|
+
n([
|
|
89
|
+
y()
|
|
90
|
+
], s.prototype, "slotElements", 2);
|
|
91
|
+
s = n([
|
|
92
|
+
w(C)
|
|
93
|
+
], s);
|
|
94
|
+
export {
|
|
95
|
+
s as FhiDataTableRow,
|
|
96
|
+
C as FhiDataTableRowSelector
|
|
97
|
+
};
|
|
98
|
+
//# sourceMappingURL=fhi-data-table-row.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fhi-data-table-row.js","sources":["../../../../node_modules/.pnpm/@lit+reactive-element@2.1.2/node_modules/@lit/reactive-element/decorators/query-assigned-elements.js","../../src/components/data-table/fhi-data-table-row/fhi-data-table-row.component.ts"],"sourcesContent":["import{desc as t}from\"./base.js\";\n/**\n * @license\n * Copyright 2021 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */function o(o){return(e,n)=>{const{slot:r,selector:s}=o??{},c=\"slot\"+(r?`[name=${r}]`:\":not([name])\");return t(e,n,{get(){const t=this.renderRoot?.querySelector(c),e=t?.assignedElements(o)??[];return void 0===s?e:e.filter(t=>t.matches(s))}})}}export{o as queryAssignedElements};\n//# sourceMappingURL=query-assigned-elements.js.map\n","import { html, css, LitElement, PropertyValues } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\nimport { queryAssignedElements } from 'lit/decorators.js';\nimport { FhiDataTableCell } from '../fhi-data-table-cell/fhi-data-table-cell.component';\n\nexport const FhiDataTableRowSelector = 'fhi-data-table-row';\n\n/**\n * ## FHI Table Row\n *\n * {@link https://designsystem.fhi.no/?path=/docs/komponenter-data-table-row--docs}\n *\n * The `<fhi-data-table-row>` component is an implementation of a table row according to the FHI Design System guidelines.\n * It allows users to properly display data within a `<fhi-data-table>` using `<fhi-data-table-cell>` components.\n *\n * For various reasons, the `<fhi-data-table-row>` component does not use the native HTML `<tr>` element. Instead, it relies on CSS Grid to achieve the desired layout and styling.\n *\n * @tag fhi-data-table-row\n * @element fhi-data-table-row\n */\n@customElement(FhiDataTableRowSelector)\nexport class FhiDataTableRow extends LitElement {\n /**\n * Defines the variant of the table row, which can be either 'header' or 'body'. This determines the styling and role of the row within the table.\n * If the variant is set to 'header', all child `<fhi-data-table-cell>` elements will also be set to the 'header' variant to ensure consistent styling.\n * @type {'header' | 'body'}\n */\n @property({ type: String, reflect: true })\n variant: 'header' | 'body' = 'body';\n\n @queryAssignedElements()\n slotElements!: Array<HTMLElement>;\n\n connectedCallback(): void {\n super.connectedCallback();\n this.role = 'row';\n }\n\n protected update(changedProperties: PropertyValues): void {\n if (changedProperties.has('variant')) {\n if (this.variant !== 'body' && this.variant !== 'header') {\n this.variant = 'body';\n }\n }\n\n super.update(changedProperties);\n }\n\n protected updated(changedProperties: PropertyValues): void {\n if (changedProperties.has('variant')) {\n this.setCellVariants();\n }\n\n super.updated(changedProperties);\n }\n\n private handleSlotChange() {\n this.setCellVariants();\n }\n\n private setCellVariants() {\n this.slotElements.forEach(element => {\n if (element.tagName.toLowerCase() === 'fhi-data-table-cell') {\n const tableCell = element as FhiDataTableCell;\n\n if (tableCell.variant !== this.variant) {\n tableCell.variant = this.variant;\n }\n }\n });\n }\n\n render() {\n return html`<slot @slotchange=${this.handleSlotChange}></slot>`;\n }\n\n static styles = css`\n :host {\n --fhi-data-table-row-border-style: unset;\n --fhi-data-table-row-border-width: unset;\n --fhi-data-table-row-border-color: unset;\n\n --fhi-data-table-row-background: unset;\n }\n\n :host {\n display: table-row;\n background: var(--fhi-data-table-row-background);\n\n --fhi-data-table-row-border-style: none none solid none;\n --fhi-data-table-row-border-width: var(--fhi-dimension-border-width);\n --fhi-data-table-row-border-color: var(\n --fhi-color-neutral-surface-active\n );\n\n ::slotted(fhi-data-table-cell) {\n --fhi-data-table-cell-background: var(--fhi-data-table-row-background);\n --fhi-data-table-cell-border-style: var(\n --fhi-data-table-row-border-style\n );\n --fhi-data-table-cell-border-width: var(\n --fhi-data-table-row-border-width\n );\n --fhi-data-table-cell-border-color: var(\n --fhi-data-table-row-border-color\n );\n }\n }\n `;\n}\n"],"names":["o","e","n","s","c","t","_a","FhiDataTableRowSelector","FhiDataTableRow","LitElement","changedProperties","element","tableCell","html","css","__decorateClass","property","queryAssignedElements","customElement"],"mappings":";;AACA;AAAA;AAAA;AAAA;AAAA;AAIG,SAASA,EAAEA,GAAE;AAAC,SAAM,CAACC,GAAEC,MAAI;AAAC,UAAK,EAAC,MAAK,GAAE,UAASC,EAAC,IAAK,IAAGC,IAAE,UAAQ,IAAE,SAAS,CAAC,MAAI;AAAgB,WAAOC,EAAEJ,GAAEC,GAAE,EAAC,MAAK;;AAAC,YAAMG,KAAEC,IAAA,KAAK,eAAL,gBAAAA,EAAiB,cAAcF,IAAGH,KAAEI,KAAA,gBAAAA,EAAG,iBAAiBL,OAAI,CAAA;AAAG,aAAgBG,MAAT,SAAWF,IAAEA,EAAE,OAAO,CAAAI,MAAGA,EAAE,QAAQF,CAAC,CAAC;AAAA,IAAC,EAAC,CAAC;AAAA,EAAC;AAAC;;;;;;ACA7O,MAAMI,IAA0B;AAgBhC,IAAMC,IAAN,cAA8BC,EAAW;AAAA,EAAzC,cAAA;AAAA,UAAA,GAAA,SAAA,GAOL,KAAA,UAA6B;AAAA,EAAA;AAAA,EAK7B,oBAA0B;AACxB,UAAM,kBAAA,GACN,KAAK,OAAO;AAAA,EACd;AAAA,EAEU,OAAOC,GAAyC;AACxD,IAAIA,EAAkB,IAAI,SAAS,KAC7B,KAAK,YAAY,UAAU,KAAK,YAAY,aAC9C,KAAK,UAAU,SAInB,MAAM,OAAOA,CAAiB;AAAA,EAChC;AAAA,EAEU,QAAQA,GAAyC;AACzD,IAAIA,EAAkB,IAAI,SAAS,KACjC,KAAK,gBAAA,GAGP,MAAM,QAAQA,CAAiB;AAAA,EACjC;AAAA,EAEQ,mBAAmB;AACzB,SAAK,gBAAA;AAAA,EACP;AAAA,EAEQ,kBAAkB;AACxB,SAAK,aAAa,QAAQ,CAAAC,MAAW;AACnC,UAAIA,EAAQ,QAAQ,YAAA,MAAkB,uBAAuB;AAC3D,cAAMC,IAAYD;AAElB,QAAIC,EAAU,YAAY,KAAK,YAC7BA,EAAU,UAAU,KAAK;AAAA,MAE7B;AAAA,IACF,CAAC;AAAA,EACH;AAAA,EAEA,SAAS;AACP,WAAOC,sBAAyB,KAAK,gBAAgB;AAAA,EACvD;AAmCF;AAxFaL,EAuDJ,SAASM;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAhDhBC,EAAA;AAAA,EADCC,EAAS,EAAE,MAAM,QAAQ,SAAS,IAAM;AAAA,GAN9BR,EAOX,WAAA,WAAA,CAAA;AAGAO,EAAA;AAAA,EADCE,EAAA;AAAsB,GATZT,EAUX,WAAA,gBAAA,CAAA;AAVWA,IAANO,EAAA;AAAA,EADNG,EAAcX,CAAuB;AAAA,GACzBC,CAAA;","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"kind":"javascript-module","path":"src/components/data-table/fhi-data-table-row/fhi-data-table-row.component.ts","declarations":[{"kind":"class","description":"## FHI Table Row\n\nhttps://designsystem.fhi.no/?path=/docs/komponenter-data-table-row--docs\n\nThe `<fhi-data-table-row>` component is an implementation of a table row according to the FHI Design System guidelines.\nIt allows users to properly display data within a `<fhi-data-table>` using `<fhi-data-table-cell>` components.\n\nFor various reasons, the `<fhi-data-table-row>` component does not use the native HTML `<tr>` element. Instead, it relies on CSS Grid to achieve the desired layout and styling.","name":"FhiDataTableRow","members":[{"kind":"method","name":"handleSlotChange","privacy":"private"},{"kind":"method","name":"setCellVariants","privacy":"private"},{"kind":"field","name":"slotElements","type":{"text":"Array<HTMLElement>"}},{"kind":"field","name":"variant","type":{"text":"'header' | 'body'"},"default":"'body'","description":"Defines the variant of the table row, which can be either 'header' or 'body'. This determines the styling and role of the row within the table.\nIf the variant is set to 'header', all child `<fhi-data-table-cell>` elements will also be set to the 'header' variant to ensure consistent styling.","attribute":"variant","reflects":true}],"attributes":[{"name":"variant","type":{"text":"'header' | 'body'"},"default":"'body'","description":"Defines the variant of the table row, which can be either 'header' or 'body'. This determines the styling and role of the row within the table.\nIf the variant is set to 'header', all child `<fhi-data-table-cell>` elements will also be set to the 'header' variant to ensure consistent styling.","fieldName":"variant"}],"superclass":{"name":"LitElement","package":"lit"},"tagName":"fhi-data-table-row","customElement":true},{"kind":"variable","name":"FhiDataTableRowSelector","type":{"text":"string"},"default":"'fhi-data-table-row'"}]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { i as h, n as b, a as c, b as n, t as f } from "./property-DGdAXcEz.js";
|
|
2
|
+
import "./fhi-grid.js";
|
|
3
|
+
import "./fhi-body.js";
|
|
4
|
+
var u = Object.defineProperty, p = Object.getOwnPropertyDescriptor, s = (t, r, l, o) => {
|
|
5
|
+
for (var a = o > 1 ? void 0 : o ? p(r, l) : r, i = t.length - 1, d; i >= 0; i--)
|
|
6
|
+
(d = t[i]) && (a = (o ? d(r, l, a) : d(a)) || a);
|
|
7
|
+
return o && a && u(r, l, a), a;
|
|
8
|
+
};
|
|
9
|
+
const v = "fhi-data-table";
|
|
10
|
+
let e = class extends c {
|
|
11
|
+
connectedCallback() {
|
|
12
|
+
super.connectedCallback(), this.role = "table";
|
|
13
|
+
}
|
|
14
|
+
update(t) {
|
|
15
|
+
super.update(t);
|
|
16
|
+
}
|
|
17
|
+
updated(t) {
|
|
18
|
+
super.updated(t), t.has("caption") && (this.caption ? this.setAttribute("aria-label", this.caption) : this.removeAttribute("aria-label"));
|
|
19
|
+
}
|
|
20
|
+
render() {
|
|
21
|
+
return n`
|
|
22
|
+
<div class="table-content">
|
|
23
|
+
<slot></slot>
|
|
24
|
+
</div>
|
|
25
|
+
${this.caption ? n`<fhi-body class="caption" size="small"
|
|
26
|
+
>${this.caption}</fhi-body
|
|
27
|
+
>` : null}
|
|
28
|
+
`;
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
e.styles = h`
|
|
32
|
+
:host {
|
|
33
|
+
--fhi-data-table-border-color: unset;
|
|
34
|
+
--fhi-data-table-border-radius: unset;
|
|
35
|
+
|
|
36
|
+
--fhi-data-table-background: unset;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
:host {
|
|
40
|
+
--fhi-data-table-border-color: var(--fhi-color-neutral-surface-active);
|
|
41
|
+
--fhi-data-table-border-radius: var(--fhi-border-radius-100);
|
|
42
|
+
|
|
43
|
+
color: var(--fhi-color-neutral-text-default);
|
|
44
|
+
|
|
45
|
+
.caption {
|
|
46
|
+
display: block;
|
|
47
|
+
padding: var(--fhi-spacing-150);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.table-content {
|
|
51
|
+
display: table;
|
|
52
|
+
width: 100%;
|
|
53
|
+
overflow: hidden;
|
|
54
|
+
border: var(--fhi-dimension-border-width) solid
|
|
55
|
+
var(--fhi-data-table-border-color);
|
|
56
|
+
border-radius: var(--fhi-data-table-border-radius);
|
|
57
|
+
background: var(--fhi-data-table-background);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
::slotted(fhi-data-table-row:last-child) {
|
|
61
|
+
--fhi-data-table-row-border-style: none none none none;
|
|
62
|
+
--fhi-data-table-row-border-width: unset;
|
|
63
|
+
--fhi-data-table-row-border-color: unset;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
:host([striped]) {
|
|
68
|
+
::slotted(fhi-data-table-row:nth-child(even)) {
|
|
69
|
+
--fhi-data-table-row-background: var(
|
|
70
|
+
--fhi-color-neutral-background-subtle
|
|
71
|
+
);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
::slotted(fhi-data-table-row:nth-child(odd)) {
|
|
75
|
+
--fhi-data-table-row-background: var(
|
|
76
|
+
--fhi-color-neutral-background-default
|
|
77
|
+
);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
`;
|
|
81
|
+
s([
|
|
82
|
+
b({ type: String, reflect: !0 })
|
|
83
|
+
], e.prototype, "caption", 2);
|
|
84
|
+
s([
|
|
85
|
+
b({ type: Boolean, reflect: !0 })
|
|
86
|
+
], e.prototype, "striped", 2);
|
|
87
|
+
e = s([
|
|
88
|
+
f(v)
|
|
89
|
+
], e);
|
|
90
|
+
export {
|
|
91
|
+
e as FhiDataTable,
|
|
92
|
+
v as FhiDataTableSelector
|
|
93
|
+
};
|
|
94
|
+
//# sourceMappingURL=fhi-data-table.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fhi-data-table.js","sources":["../../src/components/data-table/fhi-data-table/fhi-data-table.component.ts"],"sourcesContent":["import { html, css, LitElement, PropertyValues } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\n\nimport '../../fhi-grid/fhi-grid.component';\nimport '../../typography/fhi-body/fhi-body.component';\n\nexport const FhiDataTableSelector = 'fhi-data-table';\n\n/**\n * ## FHI Table\n *\n * {@link https://designsystem.fhi.no/?path=/docs/komponenter-data-table--docs}\n *\n * The `<fhi-data-table>` component is an implementation of a table according to the FHI Design System guidelines.\n * It allows users to display tabular data in a structured format using `<fhi-data-table-row>` and `<fhi-data-table-cell>` components.\n *\n * The `<fhi-data-table>` component does not use the native HTML `<table>` element. Instead, it relies on CSS Grid to achieve the desired layout and styling.\n *\n * Example usage:\n * ```html\n * <fhi-data-table caption=\"Example Table\" columns=\"2fr 1fr 1fr\">\n * <fhi-data-table-row variant=\"header\">\n * <fhi-data-table-cell>Header 1</fhi-data-table-cell>\n * <fhi-data-table-cell>Header 2</fhi-data-table-cell>\n * <fhi-data-table-cell>Header 3</fhi-data-table-cell>\n * </fhi-data-table-row>\n * <fhi-data-table-row>\n * <fhi-data-table-cell>Data 1</fhi-data-table-cell>\n * <fhi-data-table-cell>Data 2</fhi-data-table-cell>\n * <fhi-data-table-cell>Data 3</fhi-data-table-cell>\n * </fhi-data-table-row>\n * </fhi-data-table>\n * ```\n *\n * @tag fhi-data-table\n * @element fhi-data-table\n */\n@customElement(FhiDataTableSelector)\nexport class FhiDataTable extends LitElement {\n /**\n * The caption of the table. This should provide a brief description of the table's content.\n * @type {string}\n */\n @property({ type: String, reflect: true })\n caption?: string;\n\n /**\n * If set to true, the table will have alternating row colors (striped effect) for better readability.\n * @type {boolean}\n */\n @property({ type: Boolean, reflect: true })\n striped?: boolean;\n\n connectedCallback(): void {\n super.connectedCallback();\n\n this.role = 'table';\n }\n\n protected update(changedProperties: PropertyValues): void {\n super.update(changedProperties);\n }\n\n protected updated(changedProperties: PropertyValues): void {\n super.updated(changedProperties);\n\n if (changedProperties.has('caption')) {\n if (this.caption) {\n this.setAttribute('aria-label', this.caption);\n } else {\n this.removeAttribute('aria-label');\n }\n }\n }\n\n render() {\n return html`\n <div class=\"table-content\">\n <slot></slot>\n </div>\n ${this.caption\n ? html`<fhi-body class=\"caption\" size=\"small\"\n >${this.caption}</fhi-body\n >`\n : null}\n `;\n }\n\n static styles = css`\n :host {\n --fhi-data-table-border-color: unset;\n --fhi-data-table-border-radius: unset;\n\n --fhi-data-table-background: unset;\n }\n\n :host {\n --fhi-data-table-border-color: var(--fhi-color-neutral-surface-active);\n --fhi-data-table-border-radius: var(--fhi-border-radius-100);\n\n color: var(--fhi-color-neutral-text-default);\n\n .caption {\n display: block;\n padding: var(--fhi-spacing-150);\n }\n\n .table-content {\n display: table;\n width: 100%;\n overflow: hidden;\n border: var(--fhi-dimension-border-width) solid\n var(--fhi-data-table-border-color);\n border-radius: var(--fhi-data-table-border-radius);\n background: var(--fhi-data-table-background);\n }\n\n ::slotted(fhi-data-table-row:last-child) {\n --fhi-data-table-row-border-style: none none none none;\n --fhi-data-table-row-border-width: unset;\n --fhi-data-table-row-border-color: unset;\n }\n }\n\n :host([striped]) {\n ::slotted(fhi-data-table-row:nth-child(even)) {\n --fhi-data-table-row-background: var(\n --fhi-color-neutral-background-subtle\n );\n }\n\n ::slotted(fhi-data-table-row:nth-child(odd)) {\n --fhi-data-table-row-background: var(\n --fhi-color-neutral-background-default\n );\n }\n }\n `;\n}\n"],"names":["FhiDataTableSelector","FhiDataTable","LitElement","changedProperties","html","css","__decorateClass","property","customElement"],"mappings":";;;;;;;;AAMO,MAAMA,IAAuB;AAgC7B,IAAMC,IAAN,cAA2BC,EAAW;AAAA,EAe3C,oBAA0B;AACxB,UAAM,kBAAA,GAEN,KAAK,OAAO;AAAA,EACd;AAAA,EAEU,OAAOC,GAAyC;AACxD,UAAM,OAAOA,CAAiB;AAAA,EAChC;AAAA,EAEU,QAAQA,GAAyC;AACzD,UAAM,QAAQA,CAAiB,GAE3BA,EAAkB,IAAI,SAAS,MAC7B,KAAK,UACP,KAAK,aAAa,cAAc,KAAK,OAAO,IAE5C,KAAK,gBAAgB,YAAY;AAAA,EAGvC;AAAA,EAEA,SAAS;AACP,WAAOC;AAAAA;AAAAA;AAAAA;AAAAA,QAIH,KAAK,UACHA;AAAAA,eACK,KAAK,OAAO;AAAA,eAEjB,IAAI;AAAA;AAAA,EAEZ;AAoDF;AApGaH,EAkDJ,SAASI;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AA5ChBC,EAAA;AAAA,EADCC,EAAS,EAAE,MAAM,QAAQ,SAAS,IAAM;AAAA,GAL9BN,EAMX,WAAA,WAAA,CAAA;AAOAK,EAAA;AAAA,EADCC,EAAS,EAAE,MAAM,SAAS,SAAS,IAAM;AAAA,GAZ/BN,EAaX,WAAA,WAAA,CAAA;AAbWA,IAANK,EAAA;AAAA,EADNE,EAAcR,CAAoB;AAAA,GACtBC,CAAA;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"kind":"javascript-module","path":"src/components/data-table/fhi-data-table/fhi-data-table.component.ts","declarations":[{"kind":"class","description":"## FHI Table\n\nhttps://designsystem.fhi.no/?path=/docs/komponenter-data-table--docs\n\nThe `<fhi-data-table>` component is an implementation of a table according to the FHI Design System guidelines.\nIt allows users to display tabular data in a structured format using `<fhi-data-table-row>` and `<fhi-data-table-cell>` components.\n\nThe `<fhi-data-table>` component does not use the native HTML `<table>` element. Instead, it relies on CSS Grid to achieve the desired layout and styling.\n\nExample usage:\n```html\n<fhi-data-table caption=\"Example Table\" columns=\"2fr 1fr 1fr\">\n <fhi-data-table-row variant=\"header\">\n <fhi-data-table-cell>Header 1</fhi-data-table-cell>\n <fhi-data-table-cell>Header 2</fhi-data-table-cell>\n <fhi-data-table-cell>Header 3</fhi-data-table-cell>\n </fhi-data-table-row>\n <fhi-data-table-row>\n <fhi-data-table-cell>Data 1</fhi-data-table-cell>\n <fhi-data-table-cell>Data 2</fhi-data-table-cell>\n <fhi-data-table-cell>Data 3</fhi-data-table-cell>\n </fhi-data-table-row>\n</fhi-data-table>\n```","name":"FhiDataTable","members":[{"kind":"field","name":"caption","type":{"text":"string"},"description":"The caption of the table. This should provide a brief description of the table's content.","attribute":"caption","reflects":true},{"kind":"field","name":"striped","type":{"text":"boolean"},"description":"If set to true, the table will have alternating row colors (striped effect) for better readability.","attribute":"striped","reflects":true}],"attributes":[{"name":"caption","type":{"text":"string"},"description":"The caption of the table. This should provide a brief description of the table's content.","fieldName":"caption"},{"name":"striped","type":{"text":"boolean"},"description":"If set to true, the table will have alternating row colors (striped effect) for better readability.","fieldName":"striped"}],"superclass":{"name":"LitElement","package":"lit"},"tagName":"fhi-data-table","customElement":true},{"kind":"variable","name":"FhiDataTableSelector","type":{"text":"string"},"default":"'fhi-data-table'"}]}
|
package/fhi-date-input.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { i as c, n as o, a as u, b as l, t as g } from "./property-DGdAXcEz.js";
|
|
2
|
-
import { e as y } from "./query-
|
|
2
|
+
import { e as y } from "./query-Ddbd72Um.js";
|
|
3
3
|
import { o as d } from "./if-defined-BW6N1yuF.js";
|
|
4
4
|
import "./fhi-icon-calendar.js";
|
|
5
5
|
const v = () => /^((?!chrome|android).)*safari/i.test(navigator.userAgent);
|
package/fhi-modal-dialog.js
CHANGED
package/fhi-radio.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { i as h, n, a as u, b as p, t as b } from "./property-DGdAXcEz.js";
|
|
2
|
-
import { e as v } from "./query-
|
|
2
|
+
import { e as v } from "./query-Ddbd72Um.js";
|
|
3
3
|
import { o as f } from "./if-defined-BW6N1yuF.js";
|
|
4
4
|
var g = Object.defineProperty, m = Object.getOwnPropertyDescriptor, d = (r, o, t, s) => {
|
|
5
5
|
for (var e = s > 1 ? void 0 : s ? m(o, t) : o, a = r.length - 1, l; a >= 0; a--)
|
package/fhi-text-input.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { i as c, n as a, a as g, b as s, t as u } from "./property-DGdAXcEz.js";
|
|
2
|
-
import { e as y } from "./query-
|
|
2
|
+
import { e as y } from "./query-Ddbd72Um.js";
|
|
3
3
|
import { o as d } from "./if-defined-BW6N1yuF.js";
|
|
4
4
|
var v = Object.defineProperty, f = Object.getOwnPropertyDescriptor, r = (t, e, i, l) => {
|
|
5
5
|
for (var n = l > 1 ? void 0 : l ? f(e, i) : e, p = t.length - 1, h; p >= 0; p--)
|
package/fhi-tooltip.js
CHANGED