@sebgroup/green-core 1.3.0 → 1.4.1
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/date-part-spinner.d.ts +21 -0
- package/components/datepicker/datepicker.d.ts +80 -0
- package/components/datepicker/datepicker.styles.d.ts +1 -0
- package/components/datepicker/datepicker.trans.styles.d.ts +2 -0
- package/components/form-control.d.ts +6 -1
- package/components/index.d.ts +1 -0
- package/generated/locales/sv.d.ts +26 -0
- package/index.js +961 -72
- package/localization.js +27 -1
- package/package.json +2 -2
- package/primitives/calendar/calendar.d.ts +53 -0
- package/primitives/calendar/calendar.styles.d.ts +2 -0
- package/primitives/calendar/calendar.trans.styles.d.ts +2 -0
- package/primitives/calendar/functions.d.ts +5 -0
- package/primitives/listbox/option.d.ts +1 -1
- package/primitives/popover/popover.d.ts +5 -0
- package/transitional-styles.js +425 -4
- package/utils/testing/index.d.ts +9 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
/**
|
|
3
|
+
* @element gds-date-part-spinner
|
|
4
|
+
* @internal
|
|
5
|
+
*
|
|
6
|
+
* A spinner for a date part. Only inteded to be used by the datepicker component.
|
|
7
|
+
*/
|
|
8
|
+
export declare class GdsDatePartSpinner extends LitElement {
|
|
9
|
+
#private;
|
|
10
|
+
static formAssociated: boolean;
|
|
11
|
+
value: number;
|
|
12
|
+
length: number;
|
|
13
|
+
min: number;
|
|
14
|
+
max: number;
|
|
15
|
+
displayValue: string;
|
|
16
|
+
protected createRenderRoot(): this;
|
|
17
|
+
connectedCallback(): void;
|
|
18
|
+
focus(options?: FocusOptions | undefined): void;
|
|
19
|
+
render(): any;
|
|
20
|
+
private _refreshDisplayValue;
|
|
21
|
+
}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { GdsFormControlElement } from '../../components/form-control';
|
|
2
|
+
import '../../primitives/popover/popover';
|
|
3
|
+
import '../../primitives/calendar/calendar';
|
|
4
|
+
import './date-part-spinner';
|
|
5
|
+
/**
|
|
6
|
+
* @element gds-datepicker
|
|
7
|
+
* A form control that allows the user to select a date.
|
|
8
|
+
*
|
|
9
|
+
* @status beta
|
|
10
|
+
*
|
|
11
|
+
* @slot message - Message to show below the input field. Will be red if there is a validation error.
|
|
12
|
+
* @slot sub-label - Renders between the label and the trigger button.
|
|
13
|
+
* *
|
|
14
|
+
* @event change - Fired when the value of the dropdown is changed through user interaction (not when value prop is set programatically).
|
|
15
|
+
* @event gds-ui-state - Fired when the dropdown is opened or closed.
|
|
16
|
+
*/
|
|
17
|
+
export declare class GdsDatepicker extends GdsFormControlElement<Date> {
|
|
18
|
+
#private;
|
|
19
|
+
static styles: import("lit").CSSResult[];
|
|
20
|
+
static shadowRootOptions: ShadowRootInit;
|
|
21
|
+
/**
|
|
22
|
+
* The Date value of the datepicker. This can be set to undefined to clear the datepicker.
|
|
23
|
+
* This can be a string if set via the value attribute in markup, or via the setAttribute DOM API.
|
|
24
|
+
*/
|
|
25
|
+
value?: Date;
|
|
26
|
+
/**
|
|
27
|
+
* The minimum date that can be selected.
|
|
28
|
+
*/
|
|
29
|
+
min: Date;
|
|
30
|
+
/**
|
|
31
|
+
* The maximum date that can be selected.
|
|
32
|
+
*/
|
|
33
|
+
max: Date;
|
|
34
|
+
/**
|
|
35
|
+
* Controls wheter the datepicker popover is open.
|
|
36
|
+
*/
|
|
37
|
+
open: boolean;
|
|
38
|
+
/**
|
|
39
|
+
* The label text displayed above the datepicker. This should always be set to a descriptive label.
|
|
40
|
+
*/
|
|
41
|
+
label: string;
|
|
42
|
+
/**
|
|
43
|
+
* Whether to show a column of week numbers in the calendar.
|
|
44
|
+
*/
|
|
45
|
+
showWeekNumbers: boolean;
|
|
46
|
+
/**
|
|
47
|
+
* The date format to use. Accepts a string with the characters `y`, `m` and `d` in any order, separated by a delimiter.
|
|
48
|
+
* For example, `y-m-d` or `d/m/y`. All three characters must be present.
|
|
49
|
+
*
|
|
50
|
+
* This will determine the structure of the input field.
|
|
51
|
+
*
|
|
52
|
+
* Defaults to `y-m-d`.
|
|
53
|
+
*/
|
|
54
|
+
get dateformat(): string;
|
|
55
|
+
set dateformat(dateformat: string);
|
|
56
|
+
/**
|
|
57
|
+
* Get the currently focused date in the calendar popover. If no date is focused, or the calendar popover
|
|
58
|
+
* is closed, the value will be undefined.
|
|
59
|
+
*/
|
|
60
|
+
getFocusedDate(): Promise<Date | undefined>;
|
|
61
|
+
/**
|
|
62
|
+
* A reference to the calendar button element inside the shadow root.
|
|
63
|
+
* Inteded for use in integration tests.
|
|
64
|
+
*/
|
|
65
|
+
test_calendarButton: Promise<HTMLButtonElement>;
|
|
66
|
+
/**
|
|
67
|
+
* A reference to a date cell element (<td>) inside the shadow root of the calendar primitive.
|
|
68
|
+
* Inteded for use in integration tests.
|
|
69
|
+
*/
|
|
70
|
+
test_getDateCell(dayNumber: number): Promise<Element | null | undefined>;
|
|
71
|
+
private _focusedMonth;
|
|
72
|
+
private _focusedYear;
|
|
73
|
+
private _dateFormatLayout;
|
|
74
|
+
private _elCalendar;
|
|
75
|
+
private _elTrigger;
|
|
76
|
+
private _elSpinners;
|
|
77
|
+
connectedCallback(): void;
|
|
78
|
+
render(): any;
|
|
79
|
+
private _handleValueChange;
|
|
80
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const styles: import("lit").CSSResult;
|
|
@@ -20,7 +20,7 @@ export declare abstract class GdsFormControlElement<ValueT = any> extends LitEle
|
|
|
20
20
|
/**
|
|
21
21
|
* Get or set the value of the form control.
|
|
22
22
|
*/
|
|
23
|
-
value
|
|
23
|
+
value?: ValueT;
|
|
24
24
|
name: string;
|
|
25
25
|
get form(): HTMLFormElement | null;
|
|
26
26
|
get type(): string;
|
|
@@ -33,4 +33,9 @@ export declare abstract class GdsFormControlElement<ValueT = any> extends LitEle
|
|
|
33
33
|
disconnectedCallback(): void;
|
|
34
34
|
private __handleValidityChange;
|
|
35
35
|
private __handleValueChange;
|
|
36
|
+
/**
|
|
37
|
+
* Event handler for the form reset event.
|
|
38
|
+
* Can be overridden by subclasses to rcustomize the reset value.
|
|
39
|
+
*/
|
|
40
|
+
protected _handleFormReset: () => void;
|
|
36
41
|
}
|
package/components/index.d.ts
CHANGED
|
@@ -1,6 +1,32 @@
|
|
|
1
1
|
export declare const templates: {
|
|
2
|
+
s15a16ae9f99f19bf: string;
|
|
3
|
+
s15a852e9f9a50fa5: string;
|
|
4
|
+
s17e3edbe032f79ec: string;
|
|
5
|
+
s1a2dda8f763a68bd: string;
|
|
6
|
+
s1e118319b5202c41: string;
|
|
7
|
+
s1e187019b5262aa6: string;
|
|
8
|
+
s281846ef0421c71f: string;
|
|
9
|
+
s39938ecdae568740: string;
|
|
10
|
+
s407a88a592a0987c: string;
|
|
11
|
+
s5052d10b539eabf0: string;
|
|
2
12
|
s58bfb494feb8eb02: import("@lit/localize").StrResult;
|
|
3
13
|
s5d929ff1619ac0c9: string;
|
|
4
14
|
s5e8250fb85d64c23: string;
|
|
15
|
+
s63d040e37887f17e: string;
|
|
16
|
+
s6cfed919e21ac6ac: string;
|
|
17
|
+
s6d24cd19e23b8185: string;
|
|
18
|
+
s74aa0319e62b2eb7: string;
|
|
19
|
+
s7793b811d20184fe: string;
|
|
20
|
+
s7fd3469f78111589: string;
|
|
21
|
+
s9836b719fa8ef857: string;
|
|
22
|
+
s987ac119fac8d621: string;
|
|
23
|
+
sa6f2645578b2d2bc: string;
|
|
24
|
+
sa7cd5c2ff6d266e7: string;
|
|
25
|
+
sb47daaf9e1c4a905: string;
|
|
26
|
+
sb4f1dffbb6be6302: string;
|
|
27
|
+
sbc083a1dbee9af73: string;
|
|
28
|
+
scb6b9cb49cf93277: string;
|
|
5
29
|
sd898d99fd9c13de6: string;
|
|
30
|
+
se0955919920ee87d: string;
|
|
31
|
+
sf295af199c723ec8: string;
|
|
6
32
|
};
|