@sebgroup/green-core 1.5.1 → 1.7.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/components/datepicker/datepicker.d.ts +8 -0
- package/components/dropdown/dropdown.d.ts +11 -3
- package/components/index.d.ts +1 -0
- package/generated/locales/sv.d.ts +4 -0
- package/index.js +166 -62
- package/localization.js +4 -0
- package/package.json +1 -1
- package/primitives/calendar/calendar.d.ts +1 -1
- package/primitives/listbox/option.d.ts +1 -2
- package/primitives/menu/menu-heading.d.ts +6 -0
- package/primitives/menu/menu-heading.styles.d.ts +2 -0
- package/transitional-styles.js +169 -69
- package/utils/testing/index.d.ts +1 -1
|
@@ -43,6 +43,14 @@ export declare class GdsDatepicker extends GdsFormControlElement<Date> {
|
|
|
43
43
|
* Whether to show a column of week numbers in the calendar.
|
|
44
44
|
*/
|
|
45
45
|
showWeekNumbers: boolean;
|
|
46
|
+
/**
|
|
47
|
+
* Whether to use the small variant of the datepicker field.
|
|
48
|
+
*/
|
|
49
|
+
size: 'small' | 'medium';
|
|
50
|
+
/**
|
|
51
|
+
* Whether to hide the label above the input field.
|
|
52
|
+
*/
|
|
53
|
+
hideLabel: boolean;
|
|
46
54
|
/**
|
|
47
55
|
* The date format to use. Accepts a string with the characters `y`, `m` and `d` in any order, separated by a delimiter.
|
|
48
56
|
* For example, `y-m-d` or `d/m/y`. All three characters must be present.
|
|
@@ -3,14 +3,13 @@ import '../../primitives/listbox';
|
|
|
3
3
|
import type { GdsOption, OptionsContainer } from '../../primitives/listbox';
|
|
4
4
|
import '../../primitives/popover';
|
|
5
5
|
import { GdsFormControlElement } from '../form-control';
|
|
6
|
-
import { CSSResult } from 'lit';
|
|
7
6
|
/**
|
|
8
7
|
* @element gds-dropdown
|
|
9
8
|
* A dropdown consist of a trigger button and a list of selectable options. It is used to select a single value from a list of options.
|
|
10
9
|
*
|
|
11
10
|
* @status beta
|
|
12
11
|
*
|
|
13
|
-
* @slot - Options for the dropdown. Accepts `gds-option` elements.
|
|
12
|
+
* @slot - Options for the dropdown. Accepts `gds-option` and `gds-menu-heading` elements.
|
|
14
13
|
* @slot button - The trigger button for the dropdown. Custom content for the button can be assigned through this slot.
|
|
15
14
|
* @slot sub-label - Renders between the label and the trigger button.
|
|
16
15
|
* @slot message - Renders below the trigger button. Will be red if there is a validation error.
|
|
@@ -20,7 +19,7 @@ import { CSSResult } from 'lit';
|
|
|
20
19
|
*/
|
|
21
20
|
export declare class GdsDropdown<ValueT = any> extends GdsFormControlElement<ValueT | ValueT[]> implements OptionsContainer {
|
|
22
21
|
#private;
|
|
23
|
-
static styles: CSSResult;
|
|
22
|
+
static styles: import("lit").CSSResult;
|
|
24
23
|
static shadowRootOptions: ShadowRootInit;
|
|
25
24
|
/**
|
|
26
25
|
* The label of the dropdown.
|
|
@@ -77,6 +76,15 @@ export declare class GdsDropdown<ValueT = any> extends GdsFormControlElement<Val
|
|
|
77
76
|
* are still readable and apply appropriate custom layout or truncation if neccecary.
|
|
78
77
|
*/
|
|
79
78
|
syncPopoverWidth: boolean;
|
|
79
|
+
/**
|
|
80
|
+
* Size of the dropdown. Supports `medium` and `small`. There is no `large` size for dropdowns.
|
|
81
|
+
* `medium` is the default size.
|
|
82
|
+
*/
|
|
83
|
+
size: 'medium' | 'small';
|
|
84
|
+
/**
|
|
85
|
+
* Whether to hide the label.
|
|
86
|
+
*/
|
|
87
|
+
hideLabel: boolean;
|
|
80
88
|
/**
|
|
81
89
|
* Get the options of the dropdown.
|
|
82
90
|
*/
|
package/components/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export * from './dropdown/dropdown';
|
|
2
2
|
export * from '../primitives/listbox/option';
|
|
3
|
+
export * from '../primitives/menu/menu-heading';
|
|
3
4
|
export * from './context-menu/context-menu';
|
|
4
5
|
export * from '../primitives/menu/menu-item';
|
|
5
6
|
export * from './datepicker/datepicker';
|
|
@@ -8,16 +8,19 @@ export declare const templates: {
|
|
|
8
8
|
s281846ef0421c71f: string;
|
|
9
9
|
s39938ecdae568740: string;
|
|
10
10
|
s407a88a592a0987c: string;
|
|
11
|
+
s46d6587089bd0356: string;
|
|
11
12
|
s5052d10b539eabf0: string;
|
|
12
13
|
s58bfb494feb8eb02: import("@lit/localize").StrResult;
|
|
13
14
|
s5d929ff1619ac0c9: string;
|
|
14
15
|
s5e8250fb85d64c23: string;
|
|
16
|
+
s62931b2a50168976: string;
|
|
15
17
|
s63d040e37887f17e: string;
|
|
16
18
|
s6cfed919e21ac6ac: string;
|
|
17
19
|
s6d24cd19e23b8185: string;
|
|
18
20
|
s74aa0319e62b2eb7: string;
|
|
19
21
|
s7793b811d20184fe: string;
|
|
20
22
|
s7fd3469f78111589: string;
|
|
23
|
+
s8ade4e9d5e804d6a: string;
|
|
21
24
|
s9836b719fa8ef857: string;
|
|
22
25
|
s987ac119fac8d621: string;
|
|
23
26
|
sa6f2645578b2d2bc: string;
|
|
@@ -28,5 +31,6 @@ export declare const templates: {
|
|
|
28
31
|
scb6b9cb49cf93277: string;
|
|
29
32
|
sd898d99fd9c13de6: string;
|
|
30
33
|
se0955919920ee87d: string;
|
|
34
|
+
se4129fd6b9d7b4c2: string;
|
|
31
35
|
sf295af199c723ec8: string;
|
|
32
36
|
};
|
package/index.js
CHANGED
|
@@ -37,6 +37,7 @@ import { property as property5, query, queryAsync, state as state4 } from "lit/d
|
|
|
37
37
|
import { unsafeHTML as unsafeHTML2 } from "lit/directives/unsafe-html.js";
|
|
38
38
|
import { when as when2 } from "lit/directives/when.js";
|
|
39
39
|
import { ifDefined } from "lit/directives/if-defined.js";
|
|
40
|
+
import { classMap as classMap3 } from "lit/directives/class-map.js";
|
|
40
41
|
import { msg as msg2, str, updateWhenLocaleChanges } from "@lit/localize";
|
|
41
42
|
import "reflect-metadata";
|
|
42
43
|
|
|
@@ -143,10 +144,11 @@ function watchMediaQuery(q) {
|
|
|
143
144
|
// libs/core/src/utils/helpers/custom-element-scoping.ts
|
|
144
145
|
import { html as litHtml } from "lit";
|
|
145
146
|
import { customElement } from "lit/decorators.js";
|
|
146
|
-
var VER_SUFFIX = "-
|
|
147
|
+
var VER_SUFFIX = "-16d025";
|
|
147
148
|
var elementLookupTable = /* @__PURE__ */ new Map();
|
|
148
149
|
var gdsCustomElement = (tagName) => {
|
|
149
150
|
if (globalThis.GDS_DISABLE_VERSIONED_ELEMENTS) {
|
|
151
|
+
elementLookupTable.set(tagName, tagName);
|
|
150
152
|
return customElement(tagName);
|
|
151
153
|
}
|
|
152
154
|
const versionedTagName = tagName + VER_SUFFIX;
|
|
@@ -419,7 +421,7 @@ var GdsListbox = class extends GdsElement {
|
|
|
419
421
|
if (!__privateGet(this, _slotRef).value)
|
|
420
422
|
return [];
|
|
421
423
|
return unwrap(__privateGet(this, _slotRef).value).assignedElements().filter(
|
|
422
|
-
(o) => !o.hasAttribute("isplaceholder")
|
|
424
|
+
(o) => !o.hasAttribute("isplaceholder") && o.gdsElementName === "gds-option"
|
|
423
425
|
) || [];
|
|
424
426
|
}
|
|
425
427
|
/**
|
|
@@ -1125,6 +1127,8 @@ var GdsDropdown = class extends GdsFormControlElement {
|
|
|
1125
1127
|
this.compareWith = (a, b) => a === b;
|
|
1126
1128
|
this.searchFilter = (q, o) => o.innerHTML.toLowerCase().includes(q.toLowerCase());
|
|
1127
1129
|
this.syncPopoverWidth = false;
|
|
1130
|
+
this.size = "medium";
|
|
1131
|
+
this.hideLabel = false;
|
|
1128
1132
|
__privateAdd(this, _optionElements, void 0);
|
|
1129
1133
|
/**
|
|
1130
1134
|
* Event handler for filtering the options in the dropdown.
|
|
@@ -1237,7 +1241,7 @@ var GdsDropdown = class extends GdsFormControlElement {
|
|
|
1237
1241
|
return html`
|
|
1238
1242
|
${this._tStyles}
|
|
1239
1243
|
${when2(
|
|
1240
|
-
this.label,
|
|
1244
|
+
this.label && !this.hideLabel,
|
|
1241
1245
|
() => html`<label for="trigger">${this.label}</label>`
|
|
1242
1246
|
)}
|
|
1243
1247
|
|
|
@@ -1251,6 +1255,8 @@ var GdsDropdown = class extends GdsFormControlElement {
|
|
|
1251
1255
|
aria-owns="listbox"
|
|
1252
1256
|
aria-controls="listbox"
|
|
1253
1257
|
aria-expanded="${this.open}"
|
|
1258
|
+
aria-label="${this.label}"
|
|
1259
|
+
class=${classMap3({ small: this.size === "small" })}
|
|
1254
1260
|
>
|
|
1255
1261
|
<slot name="trigger">
|
|
1256
1262
|
<span>${unsafeHTML2(this.displayValue)}</span>
|
|
@@ -1286,7 +1292,7 @@ var GdsDropdown = class extends GdsFormControlElement {
|
|
|
1286
1292
|
@gds-focus="${__privateGet(this, _handleOptionFocusChange)}"
|
|
1287
1293
|
@keydown=${__privateGet(this, _handleListboxKeyDown)}
|
|
1288
1294
|
>
|
|
1289
|
-
<slot gds-allow="gds-option"></slot>
|
|
1295
|
+
<slot gds-allow="gds-option gds-menu-heading"></slot>
|
|
1290
1296
|
</gds-listbox>
|
|
1291
1297
|
</gds-popover>
|
|
1292
1298
|
`;
|
|
@@ -1399,8 +1405,14 @@ __decorateClass([
|
|
|
1399
1405
|
property5()
|
|
1400
1406
|
], GdsDropdown.prototype, "searchFilter", 2);
|
|
1401
1407
|
__decorateClass([
|
|
1402
|
-
property5({ type: Boolean })
|
|
1408
|
+
property5({ type: Boolean, attribute: "sync-popover-width" })
|
|
1403
1409
|
], GdsDropdown.prototype, "syncPopoverWidth", 2);
|
|
1410
|
+
__decorateClass([
|
|
1411
|
+
property5()
|
|
1412
|
+
], GdsDropdown.prototype, "size", 2);
|
|
1413
|
+
__decorateClass([
|
|
1414
|
+
property5({ type: Boolean, attribute: "hide-label" })
|
|
1415
|
+
], GdsDropdown.prototype, "hideLabel", 2);
|
|
1404
1416
|
__decorateClass([
|
|
1405
1417
|
state4()
|
|
1406
1418
|
], GdsDropdown.prototype, "_tStyles", 2);
|
|
@@ -1434,10 +1446,48 @@ GdsDropdown = __decorateClass([
|
|
|
1434
1446
|
gdsCustomElement("gds-dropdown")
|
|
1435
1447
|
], GdsDropdown);
|
|
1436
1448
|
|
|
1449
|
+
// libs/core/src/primitives/menu/menu-heading.ts
|
|
1450
|
+
import { html as html5 } from "lit";
|
|
1451
|
+
|
|
1452
|
+
// libs/core/src/primitives/menu/menu-heading.styles.ts
|
|
1453
|
+
import { css as css5 } from "lit";
|
|
1454
|
+
var style5 = css5`
|
|
1455
|
+
@layer base, reset, transitional-styles;
|
|
1456
|
+
@layer base {
|
|
1457
|
+
:host {
|
|
1458
|
+
padding: 0.5 1rem;
|
|
1459
|
+
cursor: pointer;
|
|
1460
|
+
}
|
|
1461
|
+
|
|
1462
|
+
:host(:hover) {
|
|
1463
|
+
background-color: grey;
|
|
1464
|
+
}
|
|
1465
|
+
}
|
|
1466
|
+
`;
|
|
1467
|
+
var menu_heading_styles_default = style5;
|
|
1468
|
+
|
|
1469
|
+
// libs/core/src/primitives/menu/menu-heading.ts
|
|
1470
|
+
var GdsMenuHeading = class extends GdsElement {
|
|
1471
|
+
connectedCallback() {
|
|
1472
|
+
super.connectedCallback();
|
|
1473
|
+
this.setAttribute("inert", "true");
|
|
1474
|
+
this.updateComplete.then(
|
|
1475
|
+
() => TransitionalStyles.instance.apply(this, "gds-menu-heading")
|
|
1476
|
+
);
|
|
1477
|
+
}
|
|
1478
|
+
render() {
|
|
1479
|
+
return html5`<slot></slot>`;
|
|
1480
|
+
}
|
|
1481
|
+
};
|
|
1482
|
+
GdsMenuHeading.styles = menu_heading_styles_default;
|
|
1483
|
+
GdsMenuHeading = __decorateClass([
|
|
1484
|
+
gdsCustomElement("gds-menu-heading")
|
|
1485
|
+
], GdsMenuHeading);
|
|
1486
|
+
|
|
1437
1487
|
// libs/core/src/components/context-menu/context-menu.ts
|
|
1438
1488
|
import { nothing } from "lit";
|
|
1439
1489
|
import { msg as msg3 } from "@lit/localize";
|
|
1440
|
-
import { classMap as
|
|
1490
|
+
import { classMap as classMap4 } from "lit-html/directives/class-map.js";
|
|
1441
1491
|
import { property as property6, queryAsync as queryAsync2, state as state6 } from "lit/decorators.js";
|
|
1442
1492
|
|
|
1443
1493
|
// libs/core/src/primitives/menu/menu.ts
|
|
@@ -1459,7 +1509,7 @@ var GdsMenu = class extends GdsElement {
|
|
|
1459
1509
|
if (!this.#slotRef.value)
|
|
1460
1510
|
return [];
|
|
1461
1511
|
return unwrap(this.#slotRef.value).assignedElements().filter(
|
|
1462
|
-
(o) => !o.hasAttribute("isplaceholder")
|
|
1512
|
+
(o) => !o.hasAttribute("isplaceholder") && o.gdsElementName === "gds-menu-item"
|
|
1463
1513
|
) || [];
|
|
1464
1514
|
}
|
|
1465
1515
|
/**
|
|
@@ -1507,7 +1557,7 @@ var GdsContextMenu = class extends GdsElement {
|
|
|
1507
1557
|
return html`${this._tStyles}
|
|
1508
1558
|
<button
|
|
1509
1559
|
id="trigger"
|
|
1510
|
-
class="icon border-0 small ${
|
|
1560
|
+
class="icon border-0 small ${classMap4({ highlighted: this.open })}"
|
|
1511
1561
|
aria-label=${this.buttonLabel ?? this.label}
|
|
1512
1562
|
aria-haspopup="menu"
|
|
1513
1563
|
aria-controls="menu"
|
|
@@ -1531,7 +1581,7 @@ var GdsContextMenu = class extends GdsElement {
|
|
|
1531
1581
|
aria-label=${this.label ?? this.buttonLabel}
|
|
1532
1582
|
@gds-menu-item-click=${__privateMethod(this, _handleItemClick, handleItemClick_fn)}
|
|
1533
1583
|
>
|
|
1534
|
-
<slot allow="gds-menu-item"></slot>
|
|
1584
|
+
<slot allow="gds-menu-item gds-menu-heading"></slot>
|
|
1535
1585
|
</gds-menu>
|
|
1536
1586
|
</gds-popover>`;
|
|
1537
1587
|
}
|
|
@@ -1618,12 +1668,13 @@ import { when as when4 } from "lit/directives/when.js";
|
|
|
1618
1668
|
import { until } from "lit/directives/until.js";
|
|
1619
1669
|
import { map } from "lit/directives/map.js";
|
|
1620
1670
|
import { repeat } from "lit/directives/repeat.js";
|
|
1671
|
+
import { classMap as classMap6 } from "lit/directives/class-map.js";
|
|
1621
1672
|
import { nothing as nothing2 } from "lit";
|
|
1622
1673
|
import { msg as msg5 } from "@lit/localize";
|
|
1623
1674
|
|
|
1624
1675
|
// libs/core/src/primitives/calendar/calendar.ts
|
|
1625
|
-
import { html as
|
|
1626
|
-
import { classMap as
|
|
1676
|
+
import { html as html7 } from "lit";
|
|
1677
|
+
import { classMap as classMap5 } from "lit/directives/class-map.js";
|
|
1627
1678
|
import { when as when3 } from "lit/directives/when.js";
|
|
1628
1679
|
import { property as property7, query as query2, state as state8 } from "lit/decorators.js";
|
|
1629
1680
|
import { msg as msg4 } from "@lit/localize";
|
|
@@ -1644,7 +1695,7 @@ import {
|
|
|
1644
1695
|
eachWeekOfInterval,
|
|
1645
1696
|
eachDayOfInterval
|
|
1646
1697
|
} from "date-fns";
|
|
1647
|
-
import { html as
|
|
1698
|
+
import { html as html6 } from "lit-html";
|
|
1648
1699
|
function renderMonthGridView(date, template) {
|
|
1649
1700
|
const monthStart = startOfMonth(date);
|
|
1650
1701
|
const monthEnd = endOfMonth(date);
|
|
@@ -1652,7 +1703,7 @@ function renderMonthGridView(date, template) {
|
|
|
1652
1703
|
{ start: monthStart, end: monthEnd },
|
|
1653
1704
|
{ weekStartsOn: 1 }
|
|
1654
1705
|
);
|
|
1655
|
-
return
|
|
1706
|
+
return html6`${template(
|
|
1656
1707
|
weeks.map((weekStartDay) => ({
|
|
1657
1708
|
days: eachDayOfInterval({
|
|
1658
1709
|
start: weekStartDay,
|
|
@@ -1663,8 +1714,8 @@ function renderMonthGridView(date, template) {
|
|
|
1663
1714
|
}
|
|
1664
1715
|
|
|
1665
1716
|
// libs/core/src/primitives/calendar/calendar.styles.ts
|
|
1666
|
-
import { css as
|
|
1667
|
-
var
|
|
1717
|
+
import { css as css6 } from "lit";
|
|
1718
|
+
var style6 = css6`
|
|
1668
1719
|
@layer base, reset, transitional-styles;
|
|
1669
1720
|
@layer base {
|
|
1670
1721
|
td.disabled {
|
|
@@ -1676,7 +1727,7 @@ var style5 = css5`
|
|
|
1676
1727
|
}
|
|
1677
1728
|
}
|
|
1678
1729
|
`;
|
|
1679
|
-
var calendar_styles_default =
|
|
1730
|
+
var calendar_styles_default = style6;
|
|
1680
1731
|
|
|
1681
1732
|
// libs/core/src/primitives/calendar/calendar.ts
|
|
1682
1733
|
var _setSelectedDate, setSelectedDate_fn, _handleKeyDown, handleKeyDown_fn;
|
|
@@ -1685,7 +1736,6 @@ var GdsCalendar = class extends GdsElement {
|
|
|
1685
1736
|
super(...arguments);
|
|
1686
1737
|
__privateAdd(this, _setSelectedDate);
|
|
1687
1738
|
__privateAdd(this, _handleKeyDown);
|
|
1688
|
-
this.value = /* @__PURE__ */ new Date();
|
|
1689
1739
|
this.min = new Date((/* @__PURE__ */ new Date()).getFullYear() - 10, 0, 1);
|
|
1690
1740
|
this.max = new Date((/* @__PURE__ */ new Date()).getFullYear() + 10, 0, 1);
|
|
1691
1741
|
this.focusedDate = /* @__PURE__ */ new Date();
|
|
@@ -1720,11 +1770,11 @@ var GdsCalendar = class extends GdsElement {
|
|
|
1720
1770
|
}
|
|
1721
1771
|
render() {
|
|
1722
1772
|
const currentDate = /* @__PURE__ */ new Date();
|
|
1723
|
-
return
|
|
1773
|
+
return html7`${this._tStyles}
|
|
1724
1774
|
<table>
|
|
1725
1775
|
<thead>
|
|
1726
1776
|
<tr>
|
|
1727
|
-
${when3(this.showWeekNumbers, () =>
|
|
1777
|
+
${when3(this.showWeekNumbers, () => html7`<th></th>`)}
|
|
1728
1778
|
<th>${msg4("Mon")}</th>
|
|
1729
1779
|
<th>${msg4("Tue")}</th>
|
|
1730
1780
|
<th>${msg4("Wed")}</th>
|
|
@@ -1737,27 +1787,27 @@ var GdsCalendar = class extends GdsElement {
|
|
|
1737
1787
|
<tbody>
|
|
1738
1788
|
${renderMonthGridView(
|
|
1739
1789
|
this.focusedDate,
|
|
1740
|
-
(weeks) =>
|
|
1790
|
+
(weeks) => html7`
|
|
1741
1791
|
${weeks.map(
|
|
1742
|
-
(week) =>
|
|
1792
|
+
(week) => html7`
|
|
1743
1793
|
<tr>
|
|
1744
1794
|
${when3(
|
|
1745
1795
|
this.showWeekNumbers,
|
|
1746
|
-
() =>
|
|
1796
|
+
() => html7`<td class="week-number">
|
|
1747
1797
|
${getWeek(week.days[0])}
|
|
1748
1798
|
</td>`
|
|
1749
1799
|
)}
|
|
1750
1800
|
${week.days.map((day) => {
|
|
1751
1801
|
const isDisabled = !isSameMonth(this.focusedDate, day) || day < this.min || day > this.max;
|
|
1752
|
-
return
|
|
1802
|
+
return html7`
|
|
1753
1803
|
<td
|
|
1754
|
-
class="${
|
|
1804
|
+
class="${classMap5({
|
|
1755
1805
|
disabled: isDisabled,
|
|
1756
1806
|
today: isSameDay(currentDate, day)
|
|
1757
1807
|
})}"
|
|
1758
1808
|
?disabled=${isDisabled}
|
|
1759
1809
|
tabindex="${isSameDay(this.focusedDate, day) ? 0 : -1}"
|
|
1760
|
-
aria-selected="${isSameDay(this.value, day)}"
|
|
1810
|
+
aria-selected="${this.value && isSameDay(this.value, day)}"
|
|
1761
1811
|
aria-label="${day.toDateString()}"
|
|
1762
1812
|
@click=${() => isDisabled ? null : __privateMethod(this, _setSelectedDate, setSelectedDate_fn).call(this, day)}
|
|
1763
1813
|
id="dateCell-${day.getDate()}"
|
|
@@ -1883,10 +1933,10 @@ GdsCalendar = __decorateClass([
|
|
|
1883
1933
|
], GdsCalendar);
|
|
1884
1934
|
|
|
1885
1935
|
// libs/core/src/components/datepicker/date-part-spinner.ts
|
|
1886
|
-
import { LitElement as
|
|
1936
|
+
import { LitElement as LitElement6 } from "lit";
|
|
1887
1937
|
import { property as property8, state as state9 } from "lit/decorators.js";
|
|
1888
1938
|
var _inputBuffer, _increment, _decrement, _handleClick, _handleFocus, _handleBlur, _handleWheel, _handleKeyDown2, _focusNextSpinner, focusNextSpinner_fn, _dispatchChangeEvent, dispatchChangeEvent_fn, _formatNumber, formatNumber_fn, _clamp, clamp_fn, _clearInputBuffer, clearInputBuffer_fn;
|
|
1889
|
-
var GdsDatePartSpinner = class extends
|
|
1939
|
+
var GdsDatePartSpinner = class extends LitElement6 {
|
|
1890
1940
|
constructor() {
|
|
1891
1941
|
super(...arguments);
|
|
1892
1942
|
__privateAdd(this, _focusNextSpinner);
|
|
@@ -1928,7 +1978,6 @@ var GdsDatePartSpinner = class extends LitElement7 {
|
|
|
1928
1978
|
__privateMethod(this, _clearInputBuffer, clearInputBuffer_fn).call(this);
|
|
1929
1979
|
this.value = __privateMethod(this, _clamp, clamp_fn).call(this, parseInt(this.value.toString()));
|
|
1930
1980
|
__privateMethod(this, _dispatchChangeEvent, dispatchChangeEvent_fn).call(this);
|
|
1931
|
-
document.getSelection()?.removeAllRanges();
|
|
1932
1981
|
});
|
|
1933
1982
|
__privateAdd(this, _handleWheel, (e) => {
|
|
1934
1983
|
e.stopPropagation();
|
|
@@ -2059,8 +2108,8 @@ GdsDatePartSpinner = __decorateClass([
|
|
|
2059
2108
|
], GdsDatePartSpinner);
|
|
2060
2109
|
|
|
2061
2110
|
// libs/core/src/components/datepicker/datepicker.styles.ts
|
|
2062
|
-
import { css as
|
|
2063
|
-
var styles =
|
|
2111
|
+
import { css as css7 } from "lit";
|
|
2112
|
+
var styles = css7`
|
|
2064
2113
|
@layer base, reset, transitional-styles;
|
|
2065
2114
|
@layer base {
|
|
2066
2115
|
label {
|
|
@@ -2078,7 +2127,7 @@ var dateConverter = {
|
|
|
2078
2127
|
return value.toISOString();
|
|
2079
2128
|
}
|
|
2080
2129
|
};
|
|
2081
|
-
var _valueOnOpen, _renderBackToValidRangeButton, renderBackToValidRangeButton_fn, _focusDate, focusDate_fn, _getSpinnerLabel, getSpinnerLabel_fn, _getMinSpinnerValue, getMinSpinnerValue_fn, _getMaxSpinnerValue, getMaxSpinnerValue_fn, _dispatchChangeEvent2, dispatchChangeEvent_fn2, _dispatchInputEvent, dispatchInputEvent_fn, _handleClipboardCopy, _handleClipboardPaste, _handleFieldClick, _handleCalendarChange, _handleMonthChange, _handleYearChange, _handleIncrementFocusedMonth, _handleDecrementFocusedMonth, _handleCalendarFocusChange, _handlePopoverStateChange, _handleSpinnerKeydown, _parseDateFormat, parseDateFormat_fn, _handleSpinnerChange, _spinnerState, _years, years_get, _isValueOutsideRange, isValueOutsideRange_get;
|
|
2130
|
+
var _valueOnOpen, _renderBackToValidRangeButton, renderBackToValidRangeButton_fn, _focusDate, focusDate_fn, _getSpinnerLabel, getSpinnerLabel_fn, _getMinSpinnerValue, getMinSpinnerValue_fn, _getMaxSpinnerValue, getMaxSpinnerValue_fn, _dispatchChangeEvent2, dispatchChangeEvent_fn2, _dispatchInputEvent, dispatchInputEvent_fn, _handleFieldFocusOut, _handleSpinnerFocus, _handleClipboardCopy, _handleClipboardPaste, _handleFieldClick, _handleCalendarChange, _handleMonthChange, _handleYearChange, _handleIncrementFocusedMonth, _handleDecrementFocusedMonth, _handleCalendarFocusChange, _handlePopoverStateChange, _handleSpinnerKeydown, _parseDateFormat, parseDateFormat_fn, _handleSpinnerChange, _spinnerState, _years, years_get, _isValueOutsideRange, isValueOutsideRange_get;
|
|
2082
2131
|
var GdsDatepicker = class extends GdsFormControlElement {
|
|
2083
2132
|
constructor() {
|
|
2084
2133
|
super(...arguments);
|
|
@@ -2103,28 +2152,54 @@ var GdsDatepicker = class extends GdsFormControlElement {
|
|
|
2103
2152
|
this.open = false;
|
|
2104
2153
|
this.label = "";
|
|
2105
2154
|
this.showWeekNumbers = false;
|
|
2155
|
+
this.size = "medium";
|
|
2156
|
+
this.hideLabel = false;
|
|
2106
2157
|
this._focusedMonth = (/* @__PURE__ */ new Date()).getMonth();
|
|
2107
2158
|
this._focusedYear = (/* @__PURE__ */ new Date()).getFullYear();
|
|
2108
2159
|
this._dateFormatLayout = __privateMethod(this, _parseDateFormat, parseDateFormat_fn).call(this, "y-m-d");
|
|
2109
2160
|
__privateAdd(this, _valueOnOpen, void 0);
|
|
2161
|
+
__privateAdd(this, _handleFieldFocusOut, (e) => {
|
|
2162
|
+
this._elTrigger.then((_) => {
|
|
2163
|
+
const parent = e.relatedTarget?.parentElement;
|
|
2164
|
+
if (parent === e.target)
|
|
2165
|
+
return;
|
|
2166
|
+
document.getSelection()?.removeAllRanges();
|
|
2167
|
+
});
|
|
2168
|
+
});
|
|
2169
|
+
__privateAdd(this, _handleSpinnerFocus, (e) => {
|
|
2170
|
+
this._elTrigger.then((field) => {
|
|
2171
|
+
document.getSelection()?.removeAllRanges();
|
|
2172
|
+
const range = new Range();
|
|
2173
|
+
range.setStart(field.firstChild, 0);
|
|
2174
|
+
range.setEnd(field.lastChild, 4);
|
|
2175
|
+
document.getSelection()?.addRange(range);
|
|
2176
|
+
});
|
|
2177
|
+
});
|
|
2110
2178
|
__privateAdd(this, _handleClipboardCopy, (e) => {
|
|
2111
|
-
|
|
2112
|
-
|
|
2179
|
+
this._elTrigger.then((field) => {
|
|
2180
|
+
if (e.currentTarget !== field)
|
|
2181
|
+
return;
|
|
2182
|
+
e.preventDefault();
|
|
2183
|
+
e.clipboardData?.setData("text/plain", this.displayValue);
|
|
2184
|
+
});
|
|
2113
2185
|
});
|
|
2114
2186
|
__privateAdd(this, _handleClipboardPaste, (e) => {
|
|
2115
|
-
|
|
2116
|
-
|
|
2117
|
-
|
|
2118
|
-
|
|
2119
|
-
|
|
2120
|
-
|
|
2121
|
-
|
|
2122
|
-
|
|
2123
|
-
|
|
2187
|
+
this._elTrigger.then((field) => {
|
|
2188
|
+
if (e.currentTarget !== field)
|
|
2189
|
+
return;
|
|
2190
|
+
e.preventDefault();
|
|
2191
|
+
const pasted = e.clipboardData?.getData("text/plain");
|
|
2192
|
+
if (!pasted)
|
|
2193
|
+
return;
|
|
2194
|
+
const pastedDate = new Date(pasted);
|
|
2195
|
+
if (pastedDate.toString() === "Invalid Date")
|
|
2196
|
+
return;
|
|
2197
|
+
this.value = pastedDate;
|
|
2198
|
+
__privateMethod(this, _dispatchChangeEvent2, dispatchChangeEvent_fn2).call(this);
|
|
2199
|
+
});
|
|
2124
2200
|
});
|
|
2125
2201
|
__privateAdd(this, _handleFieldClick, (e) => {
|
|
2126
2202
|
this._elSpinners[0].focus();
|
|
2127
|
-
window.getSelection()?.selectAllChildren(this._elSpinners[0]);
|
|
2128
2203
|
});
|
|
2129
2204
|
__privateAdd(this, _handleCalendarChange, (e) => {
|
|
2130
2205
|
e.stopPropagation();
|
|
@@ -2166,7 +2241,7 @@ var GdsDatepicker = class extends GdsFormControlElement {
|
|
|
2166
2241
|
return;
|
|
2167
2242
|
this.open = e.detail.open;
|
|
2168
2243
|
if (e.detail.reason === "close") {
|
|
2169
|
-
this.value = (await this._elCalendar).
|
|
2244
|
+
this.value = (await this._elCalendar).value;
|
|
2170
2245
|
__privateMethod(this, _dispatchChangeEvent2, dispatchChangeEvent_fn2).call(this);
|
|
2171
2246
|
}
|
|
2172
2247
|
if (e.detail.reason === "cancel") {
|
|
@@ -2228,7 +2303,7 @@ var GdsDatepicker = class extends GdsFormControlElement {
|
|
|
2228
2303
|
* Get a string representation of the currently displayed value in the input field. The formatting will match the dateformat attribute.
|
|
2229
2304
|
*/
|
|
2230
2305
|
get displayValue() {
|
|
2231
|
-
return this._elInput.innerText;
|
|
2306
|
+
return this._elInput.innerText.replace(/\s+/g, "");
|
|
2232
2307
|
}
|
|
2233
2308
|
/**
|
|
2234
2309
|
* A reference to a date cell element (<td>) inside the shadow root of the calendar primitive.
|
|
@@ -2243,18 +2318,24 @@ var GdsDatepicker = class extends GdsFormControlElement {
|
|
|
2243
2318
|
}
|
|
2244
2319
|
render() {
|
|
2245
2320
|
return html`${this._tStyles}
|
|
2246
|
-
|
|
2321
|
+
${when4(
|
|
2322
|
+
this.label && !this.hideLabel,
|
|
2323
|
+
() => html`<label for="spinner-0" id="label">${this.label}</label>`
|
|
2324
|
+
)}
|
|
2247
2325
|
|
|
2248
2326
|
<div class="form-info"><slot name="sub-label"></slot></div>
|
|
2249
2327
|
|
|
2250
2328
|
<div
|
|
2251
|
-
class
|
|
2329
|
+
class=${classMap6({ field: true, small: this.size === "small" })}
|
|
2252
2330
|
id="trigger"
|
|
2253
2331
|
@click=${__privateGet(this, _handleFieldClick)}
|
|
2254
2332
|
@copy=${__privateGet(this, _handleClipboardCopy)}
|
|
2255
2333
|
@paste=${__privateGet(this, _handleClipboardPaste)}
|
|
2256
2334
|
>
|
|
2257
|
-
<div
|
|
2335
|
+
<div
|
|
2336
|
+
class=${classMap6({ input: true, "is-placeholder": !this.value })}
|
|
2337
|
+
@focusout=${__privateGet(this, _handleFieldFocusOut)}
|
|
2338
|
+
>
|
|
2258
2339
|
${join(
|
|
2259
2340
|
map(
|
|
2260
2341
|
this._dateFormatLayout.layout,
|
|
@@ -2268,6 +2349,11 @@ var GdsDatepicker = class extends GdsFormControlElement {
|
|
|
2268
2349
|
aria-describedby="label"
|
|
2269
2350
|
@keydown=${__privateGet(this, _handleSpinnerKeydown)}
|
|
2270
2351
|
@change=${(e) => __privateGet(this, _handleSpinnerChange).call(this, e.detail.value, f.name)}
|
|
2352
|
+
@focus=${__privateGet(this, _handleSpinnerFocus)}
|
|
2353
|
+
@touchend=${(e) => {
|
|
2354
|
+
this.open = true;
|
|
2355
|
+
e.preventDefault();
|
|
2356
|
+
}}
|
|
2271
2357
|
></gds-date-part-spinner>`
|
|
2272
2358
|
),
|
|
2273
2359
|
html`<span>${this._dateFormatLayout.delimiter}</span>`
|
|
@@ -2282,14 +2368,11 @@ var GdsDatepicker = class extends GdsFormControlElement {
|
|
|
2282
2368
|
aria-describedby="label"
|
|
2283
2369
|
@click=${() => this.open = !this.open}
|
|
2284
2370
|
>
|
|
2285
|
-
<svg
|
|
2286
|
-
|
|
2287
|
-
|
|
2288
|
-
|
|
2289
|
-
|
|
2290
|
-
<path
|
|
2291
|
-
d="M152 64h144V24c0-13.25 10.7-24 24-24s24 10.75 24 24v40h40c35.3 0 64 28.65 64 64v320c0 35.3-28.7 64-64 64H64c-35.35 0-64-28.7-64-64V128c0-35.35 28.65-64 64-64h40V24c0-13.25 10.7-24 24-24s24 10.75 24 24v40zM48 248h80v-56H48v56zm0 48v64h80v-64H48zm128 0v64h96v-64h-96zm144 0v64h80v-64h-80zm80-104h-80v56h80v-56zm0 216h-80v56h64c8.8 0 16-7.2 16-16v-40zm-128 0h-96v56h96v-56zm-144 0H48v40c0 8.8 7.16 16 16 16h64v-56zm144-216h-96v56h96v-56z "
|
|
2292
|
-
/>
|
|
2371
|
+
<svg viewBox="0 0 24 24" inert>
|
|
2372
|
+
<rect x="3" y="4" width="18" height="18" rx="2" ry="2" />
|
|
2373
|
+
<line x1="16" y1="2" x2="16" y2="6" />
|
|
2374
|
+
<line x1="8" y1="2" x2="8" y2="6" />
|
|
2375
|
+
<line x1="3" y1="10" x2="21" y2="10" />
|
|
2293
2376
|
</svg>
|
|
2294
2377
|
</button>
|
|
2295
2378
|
</div>
|
|
@@ -2300,9 +2383,10 @@ var GdsDatepicker = class extends GdsFormControlElement {
|
|
|
2300
2383
|
.triggerRef=${this._elTrigger}
|
|
2301
2384
|
.open=${this.open}
|
|
2302
2385
|
@gds-ui-state=${__privateGet(this, _handlePopoverStateChange)}
|
|
2386
|
+
label=${this.label}
|
|
2303
2387
|
id="calendar-popover"
|
|
2304
2388
|
.placement=${"bottom-end"}
|
|
2305
|
-
.calcMinWidth=${() => "
|
|
2389
|
+
.calcMinWidth=${() => this.showWeekNumbers ? "350px" : "305px"}
|
|
2306
2390
|
@focusin=${async (e) => {
|
|
2307
2391
|
const isPopover = e.target?.id === "calendar-popover";
|
|
2308
2392
|
if (!isPopover)
|
|
@@ -2311,13 +2395,19 @@ var GdsDatepicker = class extends GdsFormControlElement {
|
|
|
2311
2395
|
}}
|
|
2312
2396
|
>
|
|
2313
2397
|
<div class="header">
|
|
2314
|
-
<button
|
|
2398
|
+
<button
|
|
2399
|
+
@click=${__privateGet(this, _handleDecrementFocusedMonth)}
|
|
2400
|
+
aria-label=${msg5("Previous month")}
|
|
2401
|
+
>
|
|
2315
2402
|
<i class="icon prev"></i>
|
|
2316
2403
|
</button>
|
|
2317
2404
|
<gds-dropdown
|
|
2318
2405
|
.value=${this._focusedMonth.toString()}
|
|
2319
2406
|
@change=${__privateGet(this, _handleMonthChange)}
|
|
2320
|
-
|
|
2407
|
+
label="${msg5("Month")}"
|
|
2408
|
+
style="width:120px"
|
|
2409
|
+
size="small"
|
|
2410
|
+
hide-label
|
|
2321
2411
|
>
|
|
2322
2412
|
<gds-option value="0">${msg5("January")}</gds-option>
|
|
2323
2413
|
<gds-option value="1">${msg5("February")}</gds-option>
|
|
@@ -2335,7 +2425,9 @@ var GdsDatepicker = class extends GdsFormControlElement {
|
|
|
2335
2425
|
<gds-dropdown
|
|
2336
2426
|
.value=${this._focusedYear.toString()}
|
|
2337
2427
|
@change=${__privateGet(this, _handleYearChange)}
|
|
2338
|
-
|
|
2428
|
+
label="${msg5("Year")}"
|
|
2429
|
+
size="small"
|
|
2430
|
+
hide-label
|
|
2339
2431
|
>
|
|
2340
2432
|
${repeat(
|
|
2341
2433
|
__privateGet(this, _years, years_get),
|
|
@@ -2343,7 +2435,10 @@ var GdsDatepicker = class extends GdsFormControlElement {
|
|
|
2343
2435
|
(year) => html`<gds-option value=${year}>${year}</gds-option>`
|
|
2344
2436
|
)}
|
|
2345
2437
|
</gds-dropdown>
|
|
2346
|
-
<button
|
|
2438
|
+
<button
|
|
2439
|
+
@click=${__privateGet(this, _handleIncrementFocusedMonth)}
|
|
2440
|
+
aria-label=${msg5("Next month")}
|
|
2441
|
+
>
|
|
2347
2442
|
<i class="icon next"></i>
|
|
2348
2443
|
</button>
|
|
2349
2444
|
</div>
|
|
@@ -2476,6 +2571,8 @@ dispatchInputEvent_fn = function() {
|
|
|
2476
2571
|
})
|
|
2477
2572
|
);
|
|
2478
2573
|
};
|
|
2574
|
+
_handleFieldFocusOut = new WeakMap();
|
|
2575
|
+
_handleSpinnerFocus = new WeakMap();
|
|
2479
2576
|
_handleClipboardCopy = new WeakMap();
|
|
2480
2577
|
_handleClipboardPaste = new WeakMap();
|
|
2481
2578
|
_handleFieldClick = new WeakMap();
|
|
@@ -2547,8 +2644,14 @@ __decorateClass([
|
|
|
2547
2644
|
property9()
|
|
2548
2645
|
], GdsDatepicker.prototype, "label", 2);
|
|
2549
2646
|
__decorateClass([
|
|
2550
|
-
property9({ type: Boolean })
|
|
2647
|
+
property9({ type: Boolean, attribute: "show-week-numbers" })
|
|
2551
2648
|
], GdsDatepicker.prototype, "showWeekNumbers", 2);
|
|
2649
|
+
__decorateClass([
|
|
2650
|
+
property9()
|
|
2651
|
+
], GdsDatepicker.prototype, "size", 2);
|
|
2652
|
+
__decorateClass([
|
|
2653
|
+
property9({ type: Boolean, attribute: "hide-label" })
|
|
2654
|
+
], GdsDatepicker.prototype, "hideLabel", 2);
|
|
2552
2655
|
__decorateClass([
|
|
2553
2656
|
property9()
|
|
2554
2657
|
], GdsDatepicker.prototype, "dateformat", 1);
|
|
@@ -2592,6 +2695,7 @@ export {
|
|
|
2592
2695
|
GdsContextMenu,
|
|
2593
2696
|
GdsDatepicker,
|
|
2594
2697
|
GdsDropdown,
|
|
2698
|
+
GdsMenuHeading,
|
|
2595
2699
|
GdsMenuItem,
|
|
2596
2700
|
GdsOption,
|
|
2597
2701
|
VER_SUFFIX,
|
package/localization.js
CHANGED
|
@@ -29,16 +29,19 @@ var templates = {
|
|
|
29
29
|
"s281846ef0421c71f": `November`,
|
|
30
30
|
"s39938ecdae568740": `September`,
|
|
31
31
|
"s407a88a592a0987c": `Augusti`,
|
|
32
|
+
"s46d6587089bd0356": `N\xE4sta m\xE5nad`,
|
|
32
33
|
"s5052d10b539eabf0": `Mars`,
|
|
33
34
|
"s58bfb494feb8eb02": str`${0} valda`,
|
|
34
35
|
"s5d929ff1619ac0c9": `S\xF6k`,
|
|
35
36
|
"s5e8250fb85d64c23": `St\xE4ng`,
|
|
37
|
+
"s62931b2a50168976": `F\xF6reg\xE5ende m\xE5nad`,
|
|
36
38
|
"s63d040e37887f17e": `Idag`,
|
|
37
39
|
"s6cfed919e21ac6ac": `Tor`,
|
|
38
40
|
"s6d24cd19e23b8185": `Tis`,
|
|
39
41
|
"s74aa0319e62b2eb7": `Ons`,
|
|
40
42
|
"s7793b811d20184fe": `December`,
|
|
41
43
|
"s7fd3469f78111589": `\xD6ppna meny`,
|
|
44
|
+
"s8ade4e9d5e804d6a": `F\xF6rsta tillg\xE4ngliga datum`,
|
|
42
45
|
"s9836b719fa8ef857": `L\xF6r`,
|
|
43
46
|
"s987ac119fac8d621": `S\xF6n`,
|
|
44
47
|
"sa6f2645578b2d2bc": `\xC5r`,
|
|
@@ -49,6 +52,7 @@ var templates = {
|
|
|
49
52
|
"scb6b9cb49cf93277": `April`,
|
|
50
53
|
"sd898d99fd9c13de6": `S\xF6k i listan av val`,
|
|
51
54
|
"se0955919920ee87d": `Dag`,
|
|
55
|
+
"se4129fd6b9d7b4c2": `Sista tillg\xE4ngliga datum`,
|
|
52
56
|
"sf295af199c723ec8": `Fre`
|
|
53
57
|
};
|
|
54
58
|
|
package/package.json
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import { LitElement } from 'lit';
|
|
2
1
|
import { GdsElement } from '../../gds-element';
|
|
3
2
|
import 'reflect-metadata';
|
|
4
3
|
export interface OptionsContainer extends HTMLElement {
|
|
5
4
|
options: GdsOption[];
|
|
6
5
|
multiple: boolean;
|
|
7
6
|
}
|
|
8
|
-
declare const GdsOption_base: (new (...args: any[]) => LitElement) & typeof GdsElement;
|
|
7
|
+
declare const GdsOption_base: (new (...args: any[]) => import("lit").LitElement) & typeof GdsElement;
|
|
9
8
|
/**
|
|
10
9
|
* @element gds-option
|
|
11
10
|
* @internal
|
package/transitional-styles.js
CHANGED
|
@@ -70,11 +70,10 @@ var option_trans_styles_default = `/**
|
|
|
70
70
|
@layer base, reset, transitional-styles;
|
|
71
71
|
@layer transitional-styles {
|
|
72
72
|
:host {
|
|
73
|
-
padding-left:
|
|
74
|
-
padding-right:
|
|
73
|
+
padding-left: 1rem;
|
|
74
|
+
padding-right: 1rem;
|
|
75
75
|
padding-bottom: 0.75rem;
|
|
76
76
|
padding-top: 0.75rem;
|
|
77
|
-
transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1), outline-offset 0s, outline-width 0s;
|
|
78
77
|
line-height: 1.25;
|
|
79
78
|
cursor: pointer;
|
|
80
79
|
display: flex;
|
|
@@ -83,22 +82,19 @@ var option_trans_styles_default = `/**
|
|
|
83
82
|
-moz-user-select: none;
|
|
84
83
|
user-select: none;
|
|
85
84
|
}
|
|
86
|
-
:host:
|
|
87
|
-
background-color:
|
|
88
|
-
color: rgb(255, 255, 255);
|
|
89
|
-
--background: #199be3;
|
|
90
|
-
--color: rgb(255, 255, 255);
|
|
91
|
-
border-color: #199be3;
|
|
85
|
+
:host:hover, :host:focus-visible {
|
|
86
|
+
background-color: var(--gds-ref-pallet-base200);
|
|
92
87
|
}
|
|
93
|
-
:host
|
|
94
|
-
background-color:
|
|
95
|
-
color: rgb(255, 255, 255);
|
|
96
|
-
--background: rgb(0, 122, 199);
|
|
97
|
-
--color: rgb(255, 255, 255);
|
|
98
|
-
border-color: rgb(0, 122, 199);
|
|
88
|
+
:host:active {
|
|
89
|
+
background-color: var(--gds-ref-pallet-base300);
|
|
99
90
|
}
|
|
100
|
-
:host
|
|
91
|
+
:host:focus {
|
|
92
|
+
outline-color: #000;
|
|
93
|
+
outline-offset: -0.25rem;
|
|
94
|
+
}
|
|
95
|
+
:host.active.sg-highlighted, :host[aria-selected=true] {
|
|
101
96
|
background: var(--gds-ref-pallet-base800);
|
|
97
|
+
color: #fff;
|
|
102
98
|
}
|
|
103
99
|
:host(:hover),
|
|
104
100
|
:host(:focus-visible) {
|
|
@@ -146,10 +142,33 @@ var option_trans_styles_default = `/**
|
|
|
146
142
|
}
|
|
147
143
|
}`;
|
|
148
144
|
|
|
145
|
+
// libs/core/src/primitives/menu/menu-heading.trans.styles.scss
|
|
146
|
+
var menu_heading_trans_styles_default = `@layer base, reset, transitional-styles;
|
|
147
|
+
@layer transitional-styles {
|
|
148
|
+
:host {
|
|
149
|
+
padding: 0.75rem 1rem;
|
|
150
|
+
background-color: var(--gds-ref-pallet-base300);
|
|
151
|
+
color: var(--gds-ref-pallet-base800);
|
|
152
|
+
display: flex;
|
|
153
|
+
-webkit-user-select: none;
|
|
154
|
+
-moz-user-select: none;
|
|
155
|
+
user-select: none;
|
|
156
|
+
font-size: 0.875rem;
|
|
157
|
+
font-weight: 500;
|
|
158
|
+
}
|
|
159
|
+
:host([aria-hidden=true]) {
|
|
160
|
+
display: none;
|
|
161
|
+
}
|
|
162
|
+
}`;
|
|
163
|
+
|
|
149
164
|
// libs/core/src/primitives/listbox/listbox.trans.styles.ts
|
|
150
165
|
function register() {
|
|
151
166
|
TransitionalStyles.instance.register("gds-listbox", listbox_trans_styles_default.toString());
|
|
152
167
|
TransitionalStyles.instance.register("gds-option", option_trans_styles_default.toString());
|
|
168
|
+
TransitionalStyles.instance.register(
|
|
169
|
+
"gds-menu-heading",
|
|
170
|
+
menu_heading_trans_styles_default.toString()
|
|
171
|
+
);
|
|
153
172
|
}
|
|
154
173
|
|
|
155
174
|
// libs/core/src/primitives/popover/popover.trans.styles.scss
|
|
@@ -1967,6 +1986,7 @@ a.button.tertiary.danger:focus-visible {
|
|
|
1967
1986
|
width: 2rem;
|
|
1968
1987
|
border-radius: 50%;
|
|
1969
1988
|
position: relative;
|
|
1989
|
+
--color: var(--gds-sys-color-base);
|
|
1970
1990
|
}
|
|
1971
1991
|
.close:not(:disabled):not(.disabled) > div::after, .close:not(:disabled):not(.disabled) > div::before {
|
|
1972
1992
|
height: 0.789375rem;
|
|
@@ -2028,9 +2048,7 @@ a.button.tertiary.danger:focus-visible {
|
|
|
2028
2048
|
visibility: visible;
|
|
2029
2049
|
}
|
|
2030
2050
|
header {
|
|
2031
|
-
border-bottom: 1px solid var(--border-color);
|
|
2032
2051
|
display: flex;
|
|
2033
|
-
padding: 0.25rem 0.75rem;
|
|
2034
2052
|
}
|
|
2035
2053
|
@media (min-width: 36em) {
|
|
2036
2054
|
header {
|
|
@@ -2038,13 +2056,14 @@ a.button.tertiary.danger:focus-visible {
|
|
|
2038
2056
|
}
|
|
2039
2057
|
}
|
|
2040
2058
|
header button.close {
|
|
2041
|
-
margin:
|
|
2059
|
+
margin: 0rem;
|
|
2060
|
+
padding: 0;
|
|
2042
2061
|
}
|
|
2043
2062
|
header h2 {
|
|
2044
2063
|
flex-grow: 1;
|
|
2045
|
-
font-weight:
|
|
2064
|
+
font-weight: 400;
|
|
2046
2065
|
line-height: 1.5;
|
|
2047
|
-
margin: 0;
|
|
2066
|
+
margin: 0.25rem 0 0 0.75rem;
|
|
2048
2067
|
}
|
|
2049
2068
|
dialog {
|
|
2050
2069
|
--z-index: var(--sg-z-index-popover);
|
|
@@ -2057,7 +2076,6 @@ a.button.tertiary.danger:focus-visible {
|
|
|
2057
2076
|
position: fixed;
|
|
2058
2077
|
visibility: hidden;
|
|
2059
2078
|
z-index: var(--z-index);
|
|
2060
|
-
border-width: 0;
|
|
2061
2079
|
inset: 0;
|
|
2062
2080
|
overflow: hidden;
|
|
2063
2081
|
padding: 0;
|
|
@@ -2109,8 +2127,10 @@ a.button.tertiary.danger:focus-visible {
|
|
|
2109
2127
|
}
|
|
2110
2128
|
@media (max-width: 35.98em) {
|
|
2111
2129
|
dialog {
|
|
2112
|
-
border-radius: 0.5rem;
|
|
2113
2130
|
max-height: 80svh;
|
|
2131
|
+
border-radius: 0.25rem;
|
|
2132
|
+
border: 1px solid var(--border-color);
|
|
2133
|
+
padding-bottom: 0;
|
|
2114
2134
|
}
|
|
2115
2135
|
dialog.v-kb-visible {
|
|
2116
2136
|
inset-block-end: auto;
|
|
@@ -2366,6 +2386,22 @@ var dropdown_trans_styles_default = `/**
|
|
|
2366
2386
|
input[type=week][aria-disabled=true]::placeholder {
|
|
2367
2387
|
color: var(--text-disabled-color);
|
|
2368
2388
|
}
|
|
2389
|
+
input:not([type]):hover,
|
|
2390
|
+
input[type=date]:hover,
|
|
2391
|
+
input[type=datetime]:hover,
|
|
2392
|
+
input[type=datetime-local]:hover,
|
|
2393
|
+
input[type=email]:hover,
|
|
2394
|
+
input[type=month]:hover,
|
|
2395
|
+
input[type=number]:hover,
|
|
2396
|
+
input[type=password]:hover,
|
|
2397
|
+
input[type=search]:hover,
|
|
2398
|
+
input[type=tel]:hover,
|
|
2399
|
+
input[type=text]:hover,
|
|
2400
|
+
input[type=time]:hover,
|
|
2401
|
+
input[type=url]:hover,
|
|
2402
|
+
input[type=week]:hover {
|
|
2403
|
+
background-color: var(--gds-ref-pallet-base100);
|
|
2404
|
+
}
|
|
2369
2405
|
input[type=number] {
|
|
2370
2406
|
-moz-appearance: textfield;
|
|
2371
2407
|
}
|
|
@@ -2574,10 +2610,10 @@ var dropdown_trans_styles_default = `/**
|
|
|
2574
2610
|
border-left: solid 2px var(--gds-ref-pallet-base800);
|
|
2575
2611
|
content: "";
|
|
2576
2612
|
display: block;
|
|
2577
|
-
height: 0.
|
|
2578
|
-
width: 0.
|
|
2613
|
+
height: 0.5rem;
|
|
2614
|
+
width: 0.5rem;
|
|
2579
2615
|
position: relative;
|
|
2580
|
-
top: -0.
|
|
2616
|
+
top: -0.15rem;
|
|
2581
2617
|
transform: translate(75%, 0) rotate3d(0, 0, 1, -45deg) scale3d(1, 1, -1);
|
|
2582
2618
|
transition: transform 300ms ease-in;
|
|
2583
2619
|
flex-shrink: 0;
|
|
@@ -2588,6 +2624,12 @@ var dropdown_trans_styles_default = `/**
|
|
|
2588
2624
|
button:hover::after {
|
|
2589
2625
|
border-color: currentColor;
|
|
2590
2626
|
}
|
|
2627
|
+
button.small {
|
|
2628
|
+
font-size: 0.875rem;
|
|
2629
|
+
}
|
|
2630
|
+
button:hover {
|
|
2631
|
+
background: var(--gds-ref-pallet-base300);
|
|
2632
|
+
}
|
|
2591
2633
|
label {
|
|
2592
2634
|
display: block;
|
|
2593
2635
|
font-weight: 500;
|
|
@@ -2830,16 +2872,12 @@ var calendar_trans_styles_default = `/* stylelint-disable max-nesting-depth */
|
|
|
2830
2872
|
:host table {
|
|
2831
2873
|
border-spacing: 0;
|
|
2832
2874
|
}
|
|
2833
|
-
@media (max-width: 35.98em) {
|
|
2834
|
-
:host table {
|
|
2835
|
-
width: 100%;
|
|
2836
|
-
}
|
|
2837
|
-
}
|
|
2838
2875
|
:host table tr th,
|
|
2839
2876
|
:host table tr td {
|
|
2840
|
-
height: 2.
|
|
2877
|
+
height: 2.75rem;
|
|
2841
2878
|
text-align: center;
|
|
2842
|
-
width: 2.
|
|
2879
|
+
width: 2.75rem;
|
|
2880
|
+
box-sizing: border-box;
|
|
2843
2881
|
}
|
|
2844
2882
|
:host table thead th {
|
|
2845
2883
|
background: var(--sg-bg-level-2);
|
|
@@ -2879,23 +2917,23 @@ var calendar_trans_styles_default = `/* stylelint-disable max-nesting-depth */
|
|
|
2879
2917
|
color: var(--gds-sys-color-font);
|
|
2880
2918
|
cursor: pointer;
|
|
2881
2919
|
}
|
|
2882
|
-
:host table tbody tr td:focus-visible:not(
|
|
2883
|
-
border: solid 1px var(--sg-bg-level-2);
|
|
2884
|
-
border-radius: 4px;
|
|
2885
|
-
cursor: pointer;
|
|
2886
|
-
position: relative;
|
|
2887
|
-
z-index: 0;
|
|
2888
|
-
}
|
|
2889
|
-
:host table tbody tr td:focus-visible:not(.disabled):focus:not(:focus-visible) {
|
|
2920
|
+
:host table tbody tr td:focus-visible:focus:not(:focus-visible) {
|
|
2890
2921
|
box-shadow: none;
|
|
2891
2922
|
outline: 0;
|
|
2892
2923
|
}
|
|
2893
|
-
:host table tbody tr td:focus-visible:
|
|
2924
|
+
:host table tbody tr td:focus-visible:focus, :host table tbody tr td:focus-visible:focus-visible {
|
|
2894
2925
|
outline-color: var(--gds-sys-color-focus-outline);
|
|
2895
2926
|
outline-style: solid;
|
|
2896
2927
|
outline-width: 0.125rem;
|
|
2897
2928
|
outline-offset: 0.125rem;
|
|
2898
2929
|
}
|
|
2930
|
+
:host table tbody tr td:focus-visible:not(.disabled) {
|
|
2931
|
+
border: solid 1px var(--sg-bg-level-2);
|
|
2932
|
+
border-radius: 4px;
|
|
2933
|
+
cursor: pointer;
|
|
2934
|
+
position: relative;
|
|
2935
|
+
z-index: 0;
|
|
2936
|
+
}
|
|
2899
2937
|
:host table tbody tr td[aria-selected=true] {
|
|
2900
2938
|
background: var(--gds-ref-pallet-base800);
|
|
2901
2939
|
border: solid 1px var(--sg-bg-level-2);
|
|
@@ -2916,6 +2954,8 @@ var calendar_trans_styles_default = `/* stylelint-disable max-nesting-depth */
|
|
|
2916
2954
|
color: hsl(var(--sg-hsl-disabled-color));
|
|
2917
2955
|
cursor: not-allowed;
|
|
2918
2956
|
font-weight: 400;
|
|
2957
|
+
border-radius: 4px;
|
|
2958
|
+
border: solid 1px var(--sg-bg-level-2);
|
|
2919
2959
|
}
|
|
2920
2960
|
:host table tbody tr td.disabled.sg-date-holiday {
|
|
2921
2961
|
color: hsla(var(--sg-hsl-red-2), 0.25);
|
|
@@ -2927,7 +2967,7 @@ var calendar_trans_styles_default = `/* stylelint-disable max-nesting-depth */
|
|
|
2927
2967
|
}
|
|
2928
2968
|
@layer _modifiers {
|
|
2929
2969
|
.week-number {
|
|
2930
|
-
border-right: solid 1px var(--
|
|
2970
|
+
border-right: solid 1px var(--gds-ref-pallet-base300);
|
|
2931
2971
|
font-weight: 400;
|
|
2932
2972
|
pointer-events: none;
|
|
2933
2973
|
}
|
|
@@ -3038,28 +3078,29 @@ i.sg-icon.sg-icon-ellipsis::before {
|
|
|
3038
3078
|
}
|
|
3039
3079
|
.field {
|
|
3040
3080
|
border-radius: var(--sg-border-radius);
|
|
3081
|
+
border: solid var(--sg-border-width) var(--sg-border-color);
|
|
3082
|
+
--border-color: var(--sg-border-color);
|
|
3041
3083
|
align-items: center;
|
|
3042
3084
|
background-color: var(--sg-form-control-bg);
|
|
3043
3085
|
box-sizing: border-box;
|
|
3044
3086
|
color: var(--sg-text-primary);
|
|
3045
3087
|
display: flex;
|
|
3046
|
-
justify-content: center;
|
|
3047
3088
|
justify-content: space-between;
|
|
3089
|
+
align-items: stretch;
|
|
3048
3090
|
margin: 0.5rem 0;
|
|
3049
3091
|
min-height: 2.75rem;
|
|
3092
|
+
cursor: text;
|
|
3093
|
+
}
|
|
3094
|
+
.field:hover {
|
|
3095
|
+
background-color: var(--gds-ref-pallet-base100);
|
|
3050
3096
|
}
|
|
3051
3097
|
.field .input {
|
|
3052
3098
|
padding-left: 1rem;
|
|
3053
3099
|
padding-right: 1rem;
|
|
3054
|
-
|
|
3055
|
-
padding-top: 0.75rem;
|
|
3056
|
-
border-top: solid var(--sg-border-width) var(--sg-border-color);
|
|
3057
|
-
border-bottom: solid var(--sg-border-width) var(--sg-border-color);
|
|
3058
|
-
border-left: solid var(--sg-border-width) var(--sg-border-color);
|
|
3059
|
-
--border-color: var(--sg-border-color);
|
|
3060
|
-
border-radius: var(--sg-border-radius) 0 0 var(--sg-border-radius);
|
|
3100
|
+
border-radius: var(--sg-border-radius);
|
|
3061
3101
|
flex-grow: 1;
|
|
3062
|
-
|
|
3102
|
+
display: flex;
|
|
3103
|
+
align-items: center;
|
|
3063
3104
|
}
|
|
3064
3105
|
.field .input:focus:not(:focus-visible) {
|
|
3065
3106
|
box-shadow: none;
|
|
@@ -3071,16 +3112,25 @@ i.sg-icon.sg-icon-ellipsis::before {
|
|
|
3071
3112
|
outline-width: 0.125rem;
|
|
3072
3113
|
outline-offset: 0.125rem;
|
|
3073
3114
|
}
|
|
3074
|
-
.field span {
|
|
3075
|
-
|
|
3115
|
+
.field .input::-moz-selection, .field .input span::-moz-selection {
|
|
3116
|
+
background: transparent;
|
|
3117
|
+
}
|
|
3118
|
+
.field .input::selection,
|
|
3119
|
+
.field .input span::selection {
|
|
3120
|
+
background: transparent;
|
|
3121
|
+
}
|
|
3122
|
+
.field .input.is-placeholder {
|
|
3123
|
+
opacity: 0;
|
|
3124
|
+
}
|
|
3125
|
+
.field .input.is-placeholder:hover, .field .input.is-placeholder:focus, .field .input.is-placeholder:has(:focus) {
|
|
3126
|
+
opacity: 0.7;
|
|
3076
3127
|
}
|
|
3077
3128
|
.field [role=spinbutton] {
|
|
3078
|
-
cursor: default;
|
|
3079
3129
|
display: inline-block;
|
|
3080
3130
|
}
|
|
3081
3131
|
.field [role=spinbutton]:focus {
|
|
3082
|
-
background: color-mix(in srgb, var(--gds-sys-color-blue) 50%, transparent);
|
|
3083
3132
|
outline: none;
|
|
3133
|
+
background: color-mix(in srgb, var(--gds-sys-color-blue) 50%, transparent);
|
|
3084
3134
|
}
|
|
3085
3135
|
.field [role=spinbutton]::-moz-selection {
|
|
3086
3136
|
background: transparent;
|
|
@@ -3089,16 +3139,15 @@ i.sg-icon.sg-icon-ellipsis::before {
|
|
|
3089
3139
|
background: transparent;
|
|
3090
3140
|
}
|
|
3091
3141
|
.field button {
|
|
3142
|
+
border-radius: var(--sg-border-radius);
|
|
3092
3143
|
-webkit-appearance: none;
|
|
3093
3144
|
-moz-appearance: none;
|
|
3094
3145
|
appearance: none;
|
|
3095
|
-
background: var(--intent-info-background);
|
|
3096
3146
|
border: 0;
|
|
3097
|
-
border-radius: 0 var(--sg-border-radius) var(--sg-border-radius) 0;
|
|
3098
3147
|
box-sizing: border-box;
|
|
3099
3148
|
cursor: pointer;
|
|
3100
|
-
|
|
3101
|
-
|
|
3149
|
+
width: 2.75rem;
|
|
3150
|
+
background: transparent;
|
|
3102
3151
|
}
|
|
3103
3152
|
.field button:focus:not(:focus-visible) {
|
|
3104
3153
|
box-shadow: none;
|
|
@@ -3110,8 +3159,23 @@ i.sg-icon.sg-icon-ellipsis::before {
|
|
|
3110
3159
|
outline-width: 0.125rem;
|
|
3111
3160
|
outline-offset: 0.125rem;
|
|
3112
3161
|
}
|
|
3113
|
-
.field button
|
|
3114
|
-
|
|
3162
|
+
.field button:hover {
|
|
3163
|
+
background: var(--gds-ref-pallet-base300);
|
|
3164
|
+
}
|
|
3165
|
+
.field button svg {
|
|
3166
|
+
width: 1rem;
|
|
3167
|
+
height: 1rem;
|
|
3168
|
+
}
|
|
3169
|
+
.field button svg > * {
|
|
3170
|
+
fill: none;
|
|
3171
|
+
stroke: currentColor;
|
|
3172
|
+
stroke-linecap: round;
|
|
3173
|
+
stroke-linejoin: round;
|
|
3174
|
+
stroke-width: 2px;
|
|
3175
|
+
}
|
|
3176
|
+
.field.small {
|
|
3177
|
+
min-height: 2rem;
|
|
3178
|
+
font-size: 0.875rem;
|
|
3115
3179
|
}
|
|
3116
3180
|
:host(:invalid) .field + .form-info {
|
|
3117
3181
|
position: relative;
|
|
@@ -3142,6 +3206,11 @@ i.sg-icon.sg-icon-ellipsis::before {
|
|
|
3142
3206
|
display: flex;
|
|
3143
3207
|
justify-content: space-between;
|
|
3144
3208
|
}
|
|
3209
|
+
@media (max-width: 35.98em) {
|
|
3210
|
+
.header {
|
|
3211
|
+
padding-top: 0;
|
|
3212
|
+
}
|
|
3213
|
+
}
|
|
3145
3214
|
.header > * {
|
|
3146
3215
|
margin-left: 0.25rem;
|
|
3147
3216
|
margin-right: 0.25rem;
|
|
@@ -3151,14 +3220,32 @@ i.sg-icon.sg-icon-ellipsis::before {
|
|
|
3151
3220
|
flex: 1 1;
|
|
3152
3221
|
}
|
|
3153
3222
|
.header button {
|
|
3223
|
+
border-radius: var(--sg-border-radius);
|
|
3154
3224
|
-webkit-appearance: none;
|
|
3155
3225
|
-moz-appearance: none;
|
|
3156
3226
|
appearance: none;
|
|
3157
3227
|
background: transparent;
|
|
3158
3228
|
border: 0;
|
|
3159
3229
|
cursor: pointer;
|
|
3160
|
-
padding: 0.
|
|
3161
|
-
width:
|
|
3230
|
+
padding: 0.5rem 0.5rem;
|
|
3231
|
+
width: 2.75rem;
|
|
3232
|
+
margin: 0.125rem 0.25rem;
|
|
3233
|
+
}
|
|
3234
|
+
.header button:focus:not(:focus-visible) {
|
|
3235
|
+
box-shadow: none;
|
|
3236
|
+
outline: 0;
|
|
3237
|
+
}
|
|
3238
|
+
.header button:focus, .header button:focus-visible {
|
|
3239
|
+
outline-color: var(--gds-sys-color-focus-outline);
|
|
3240
|
+
outline-style: solid;
|
|
3241
|
+
outline-width: 0.125rem;
|
|
3242
|
+
outline-offset: 0.125rem;
|
|
3243
|
+
}
|
|
3244
|
+
.header button:hover {
|
|
3245
|
+
background: var(--gds-ref-pallet-base300);
|
|
3246
|
+
}
|
|
3247
|
+
.header button:focus-visible {
|
|
3248
|
+
outline-offset: 0;
|
|
3162
3249
|
}
|
|
3163
3250
|
.header button .icon::before {
|
|
3164
3251
|
background: none;
|
|
@@ -3166,16 +3253,16 @@ i.sg-icon.sg-icon-ellipsis::before {
|
|
|
3166
3253
|
border-left: 2px solid;
|
|
3167
3254
|
content: "";
|
|
3168
3255
|
display: block;
|
|
3169
|
-
height:
|
|
3256
|
+
height: 8px;
|
|
3170
3257
|
margin-top: 2px;
|
|
3171
|
-
width:
|
|
3258
|
+
width: 8px;
|
|
3172
3259
|
}
|
|
3173
3260
|
.header button .icon.prev::before {
|
|
3174
|
-
margin-left:
|
|
3261
|
+
margin-left: 3px;
|
|
3175
3262
|
transform: translate(75%) rotate(45deg) scaleZ(-1);
|
|
3176
3263
|
}
|
|
3177
3264
|
.header button .icon.next::before {
|
|
3178
|
-
margin-left: -
|
|
3265
|
+
margin-left: -1px;
|
|
3179
3266
|
transform: translate(75%) rotate(-135deg) scaleZ(-1);
|
|
3180
3267
|
}
|
|
3181
3268
|
.footer {
|
|
@@ -3201,10 +3288,23 @@ i.sg-icon.sg-icon-ellipsis::before {
|
|
|
3201
3288
|
font-weight: 500;
|
|
3202
3289
|
padding: 0.5rem 0.75rem;
|
|
3203
3290
|
}
|
|
3291
|
+
.footer button:focus:not(:focus-visible) {
|
|
3292
|
+
box-shadow: none;
|
|
3293
|
+
outline: 0;
|
|
3294
|
+
}
|
|
3295
|
+
.footer button:focus, .footer button:focus-visible {
|
|
3296
|
+
outline-color: var(--gds-sys-color-focus-outline);
|
|
3297
|
+
outline-style: solid;
|
|
3298
|
+
outline-width: 0.125rem;
|
|
3299
|
+
outline-offset: 0.125rem;
|
|
3300
|
+
}
|
|
3204
3301
|
.footer button:hover {
|
|
3205
3302
|
background: var(--intent-info-background);
|
|
3206
3303
|
color: #fff;
|
|
3207
3304
|
}
|
|
3305
|
+
.footer .clear {
|
|
3306
|
+
margin-right: auto;
|
|
3307
|
+
}
|
|
3208
3308
|
}`;
|
|
3209
3309
|
|
|
3210
3310
|
// libs/core/src/components/datepicker/datepicker.trans.styles.ts
|
|
@@ -3215,7 +3315,7 @@ function register6() {
|
|
|
3215
3315
|
// libs/core/src/utils/helpers/custom-element-scoping.ts
|
|
3216
3316
|
import { html as litHtml } from "lit";
|
|
3217
3317
|
import { customElement } from "lit/decorators.js";
|
|
3218
|
-
var VER_SUFFIX = "-
|
|
3318
|
+
var VER_SUFFIX = "-16d025";
|
|
3219
3319
|
var elementLookupTable = /* @__PURE__ */ new Map();
|
|
3220
3320
|
var templateCache = /* @__PURE__ */ new WeakMap();
|
|
3221
3321
|
function applyElementScoping(strings, ...values) {
|
package/utils/testing/index.d.ts
CHANGED
|
@@ -36,4 +36,4 @@ export declare function conditionToBeTrue(condition: () => boolean): Promise<voi
|
|
|
36
36
|
export declare function isWebKit(): boolean;
|
|
37
37
|
export declare function isChromium(): boolean;
|
|
38
38
|
export declare function isFirefox(): boolean;
|
|
39
|
-
export declare function onlyDate(date: Date): string;
|
|
39
|
+
export declare function onlyDate(date: Date | undefined): string | undefined;
|