@sebgroup/green-core 2.22.1 → 2.23.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/input/input.component.d.ts +40 -1
- package/components/input/input.component.js +76 -3
- package/components/table/table.styles.js +13 -34
- package/components/textarea/textarea.component.d.ts +24 -0
- package/components/textarea/textarea.component.js +52 -0
- package/custom-elements.json +2301 -2070
- package/gds-element.js +1 -1
- package/generated/react/index.d.ts +1 -1
- package/generated/react/index.js +1 -1
- package/generated/react/input/index.d.ts +10 -1
- package/generated/react/textarea/index.d.ts +6 -0
- package/package.json +1 -1
- package/utils/helpers/custom-element-scoping.js +1 -1
- package/utils/react.js +0 -2
|
@@ -75,6 +75,46 @@ declare class Input extends GdsFormControlElement<string> {
|
|
|
75
75
|
}) => readonly [number, false | "positive" | "negative"];
|
|
76
76
|
private elInputAsync;
|
|
77
77
|
private elInput;
|
|
78
|
+
/**
|
|
79
|
+
* Move focus to the input element.
|
|
80
|
+
*/
|
|
81
|
+
focus(options?: FocusOptions): void;
|
|
82
|
+
/**
|
|
83
|
+
* Selects all the text in the input element.
|
|
84
|
+
*/
|
|
85
|
+
select(): void;
|
|
86
|
+
/**
|
|
87
|
+
* Sets the value of the input element, replacing a range of text.
|
|
88
|
+
*/
|
|
89
|
+
setRangeText(...args: Parameters<HTMLInputElement['setRangeText']>): void;
|
|
90
|
+
/**
|
|
91
|
+
* Sets the start and end positions of a selection in the input element.
|
|
92
|
+
*/
|
|
93
|
+
setSelectionRange(...args: Parameters<HTMLInputElement['setSelectionRange']>): void;
|
|
94
|
+
/**
|
|
95
|
+
* Opens the browser's picker interface for inputs that support it (e.g., date picker for date inputs).
|
|
96
|
+
*/
|
|
97
|
+
showPicker(): void;
|
|
98
|
+
/**
|
|
99
|
+
* Decreases the value of the input element by the specified step.
|
|
100
|
+
*/
|
|
101
|
+
stepDown(n?: number): void;
|
|
102
|
+
/**
|
|
103
|
+
* Increases the value of the input element by the specified step.
|
|
104
|
+
*/
|
|
105
|
+
stepUp(n?: number): void;
|
|
106
|
+
/** The position of the start of the current text selection in the input element. */
|
|
107
|
+
get selectionStart(): number | null;
|
|
108
|
+
/** Sets the position of the start of the current text selection in the input element. */
|
|
109
|
+
set selectionStart(value: number | null);
|
|
110
|
+
/** The position of the end of the current text selection in the input element. */
|
|
111
|
+
get selectionEnd(): number | null;
|
|
112
|
+
/** Sets the position of the end of the current text selection in the input element. */
|
|
113
|
+
set selectionEnd(value: number | null);
|
|
114
|
+
/** The direction of the current text selection in the input element. */
|
|
115
|
+
get selectionDirection(): "none" | "backward" | "forward" | null;
|
|
116
|
+
/** Sets the direction of the current text selection in the input element. */
|
|
117
|
+
set selectionDirection(value: "none" | "backward" | "forward" | null);
|
|
78
118
|
/**
|
|
79
119
|
* A reference to the clear button element. Returns null if there is no clear button.
|
|
80
120
|
* Intended for use in integration tests.
|
|
@@ -87,7 +127,6 @@ declare class Input extends GdsFormControlElement<string> {
|
|
|
87
127
|
*/
|
|
88
128
|
test_getFieldElement(): Element | null | undefined;
|
|
89
129
|
constructor();
|
|
90
|
-
focus(options?: FocusOptions): void;
|
|
91
130
|
render(): any;
|
|
92
131
|
private _handleValueChange;
|
|
93
132
|
_getValidityAnchor(): HTMLInputElement;
|
|
@@ -74,6 +74,82 @@ let Input = class extends GdsFormControlElement {
|
|
|
74
74
|
});
|
|
75
75
|
this.value = "";
|
|
76
76
|
}
|
|
77
|
+
/**
|
|
78
|
+
* Move focus to the input element.
|
|
79
|
+
*/
|
|
80
|
+
focus(options) {
|
|
81
|
+
this._getValidityAnchor()?.focus(options);
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Selects all the text in the input element.
|
|
85
|
+
*/
|
|
86
|
+
select() {
|
|
87
|
+
this._getValidityAnchor()?.select();
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Sets the value of the input element, replacing a range of text.
|
|
91
|
+
*/
|
|
92
|
+
setRangeText(...args) {
|
|
93
|
+
this._getValidityAnchor()?.setRangeText(...args);
|
|
94
|
+
this.value = this._getValidityAnchor()?.value || "";
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Sets the start and end positions of a selection in the input element.
|
|
98
|
+
*/
|
|
99
|
+
setSelectionRange(...args) {
|
|
100
|
+
this._getValidityAnchor()?.setSelectionRange(...args);
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Opens the browser's picker interface for inputs that support it (e.g., date picker for date inputs).
|
|
104
|
+
*/
|
|
105
|
+
showPicker() {
|
|
106
|
+
this._getValidityAnchor()?.showPicker();
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Decreases the value of the input element by the specified step.
|
|
110
|
+
*/
|
|
111
|
+
stepDown(n) {
|
|
112
|
+
this._getValidityAnchor()?.stepDown(n);
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Increases the value of the input element by the specified step.
|
|
116
|
+
*/
|
|
117
|
+
stepUp(n) {
|
|
118
|
+
this._getValidityAnchor()?.stepUp(n);
|
|
119
|
+
}
|
|
120
|
+
/** The position of the start of the current text selection in the input element. */
|
|
121
|
+
get selectionStart() {
|
|
122
|
+
return this._getValidityAnchor()?.selectionStart;
|
|
123
|
+
}
|
|
124
|
+
/** Sets the position of the start of the current text selection in the input element. */
|
|
125
|
+
set selectionStart(value) {
|
|
126
|
+
const anchor = this._getValidityAnchor();
|
|
127
|
+
if (anchor) {
|
|
128
|
+
anchor.selectionStart = value;
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
/** The position of the end of the current text selection in the input element. */
|
|
132
|
+
get selectionEnd() {
|
|
133
|
+
return this._getValidityAnchor()?.selectionEnd;
|
|
134
|
+
}
|
|
135
|
+
/** Sets the position of the end of the current text selection in the input element. */
|
|
136
|
+
set selectionEnd(value) {
|
|
137
|
+
const anchor = this._getValidityAnchor();
|
|
138
|
+
if (anchor) {
|
|
139
|
+
anchor.selectionEnd = value;
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
/** The direction of the current text selection in the input element. */
|
|
143
|
+
get selectionDirection() {
|
|
144
|
+
return this._getValidityAnchor()?.selectionDirection;
|
|
145
|
+
}
|
|
146
|
+
/** Sets the direction of the current text selection in the input element. */
|
|
147
|
+
set selectionDirection(value) {
|
|
148
|
+
const anchor = this._getValidityAnchor();
|
|
149
|
+
if (anchor) {
|
|
150
|
+
anchor.selectionDirection = value;
|
|
151
|
+
}
|
|
152
|
+
}
|
|
77
153
|
/**
|
|
78
154
|
* A reference to the clear button element. Returns null if there is no clear button.
|
|
79
155
|
* Intended for use in integration tests.
|
|
@@ -89,9 +165,6 @@ let Input = class extends GdsFormControlElement {
|
|
|
89
165
|
test_getFieldElement() {
|
|
90
166
|
return this.shadowRoot?.querySelector("#field");
|
|
91
167
|
}
|
|
92
|
-
focus(options) {
|
|
93
|
-
this._getValidityAnchor()?.focus(options);
|
|
94
|
-
}
|
|
95
168
|
render() {
|
|
96
169
|
return html`
|
|
97
170
|
${when(
|
|
@@ -153,7 +153,6 @@ const TableStyles = css`
|
|
|
153
153
|
|
|
154
154
|
thead tr th {
|
|
155
155
|
padding-block: var(--gds-sys-space-3xs);
|
|
156
|
-
/* background: var(--gds-sys-color-l2-neutral-01); */
|
|
157
156
|
background: var(--_table-header-bg);
|
|
158
157
|
}
|
|
159
158
|
|
|
@@ -254,12 +253,10 @@ const TableStyles = css`
|
|
|
254
253
|
|
|
255
254
|
@media (hover: hover) and (min-width: 768px) {
|
|
256
255
|
tbody tr.selected:hover {
|
|
257
|
-
/* background-color: var(--gds-sys-color-l3-neutral-03); */
|
|
258
256
|
background-color: var(--_table-row-selected-hover);
|
|
259
257
|
}
|
|
260
258
|
|
|
261
259
|
tbody tr:hover:not(.selected) {
|
|
262
|
-
/* background-color: var(--gds-sys-color-l2-neutral-01); */
|
|
263
260
|
background-color: var(--_table-row-hover);
|
|
264
261
|
}
|
|
265
262
|
}
|
|
@@ -625,24 +622,6 @@ const TableStyles = css`
|
|
|
625
622
|
}
|
|
626
623
|
}
|
|
627
624
|
|
|
628
|
-
/* tbody td .cell-content,
|
|
629
|
-
thead th .column-header {
|
|
630
|
-
animation-name: CELL_ANIMATION_HORIZONTAL, CELL_ANIMATION_HORIZONTAL;
|
|
631
|
-
animation-fill-mode: both;
|
|
632
|
-
animation-timing-function: ease-in-out;
|
|
633
|
-
animation-direction: normal, reverse;
|
|
634
|
-
animation-timeline: view(inline);
|
|
635
|
-
animation-range: entry, exit;
|
|
636
|
-
}
|
|
637
|
-
|
|
638
|
-
@keyframes CELL_ANIMATION_HORIZONTAL {
|
|
639
|
-
0% {
|
|
640
|
-
opacity: 0.8;
|
|
641
|
-
filter: blur(12px);
|
|
642
|
-
translate: 4px 0px;
|
|
643
|
-
}
|
|
644
|
-
} */
|
|
645
|
-
|
|
646
625
|
thead {
|
|
647
626
|
position: sticky;
|
|
648
627
|
top: 4px;
|
|
@@ -676,46 +655,46 @@ const TableStyles = css`
|
|
|
676
655
|
}
|
|
677
656
|
|
|
678
657
|
/* Horizontal scroll */
|
|
679
|
-
@property --
|
|
658
|
+
@property --_start-fade {
|
|
680
659
|
syntax: '<length>';
|
|
681
660
|
inherits: false;
|
|
682
661
|
initial-value: 0;
|
|
683
662
|
}
|
|
684
663
|
|
|
685
|
-
@property --
|
|
664
|
+
@property --_end-fade {
|
|
686
665
|
syntax: '<length>';
|
|
687
666
|
inherits: false;
|
|
688
667
|
initial-value: 0;
|
|
689
668
|
}
|
|
690
669
|
|
|
691
|
-
@keyframes
|
|
670
|
+
@keyframes scroll-fade {
|
|
692
671
|
0% {
|
|
693
|
-
--
|
|
672
|
+
--_start-fade: 0;
|
|
694
673
|
}
|
|
695
674
|
10%,
|
|
696
675
|
100% {
|
|
697
|
-
--
|
|
676
|
+
--_start-fade: var(--gds-sys-space-4xl);
|
|
698
677
|
}
|
|
699
678
|
0%,
|
|
700
679
|
90% {
|
|
701
|
-
--
|
|
680
|
+
--_end-fade: var(--gds-sys-space-4xl);
|
|
702
681
|
}
|
|
703
682
|
100% {
|
|
704
|
-
--
|
|
683
|
+
--_end-fade: 0;
|
|
705
684
|
}
|
|
706
685
|
}
|
|
707
686
|
|
|
708
687
|
.data {
|
|
709
|
-
overflow-x:
|
|
688
|
+
overflow-x: auto;
|
|
710
689
|
mask: linear-gradient(
|
|
711
690
|
to right,
|
|
712
691
|
#0000,
|
|
713
|
-
#ffff var(--
|
|
692
|
+
#ffff var(--_start-fade) calc(100% - var(--_end-fade)),
|
|
714
693
|
#0000
|
|
715
694
|
);
|
|
716
|
-
animation:
|
|
717
|
-
animation-timeline: --
|
|
718
|
-
scroll-timeline: --
|
|
695
|
+
animation: scroll-fade;
|
|
696
|
+
animation-timeline: --scroll-fade;
|
|
697
|
+
scroll-timeline: --scroll-fade x;
|
|
719
698
|
}
|
|
720
699
|
}
|
|
721
700
|
}
|
|
@@ -742,7 +721,7 @@ const TableStyles = css`
|
|
|
742
721
|
|
|
743
722
|
/* Scrollbar */
|
|
744
723
|
.data {
|
|
745
|
-
--_scrollbar-color-thumb: var(--gds-sys-color-
|
|
724
|
+
--_scrollbar-color-thumb: var(--gds-sys-color-content-neutral-02);
|
|
746
725
|
--_scrollbar-color-track: var(--gds-sys-color-l3-neutral-02);
|
|
747
726
|
--_scrollbar-width: var(--gds-sys-space-2xs);
|
|
748
727
|
}
|
|
@@ -91,6 +91,30 @@ declare class Textarea extends GdsFormControlElement<string> {
|
|
|
91
91
|
*/
|
|
92
92
|
test_getFieldElement(): Element | null | undefined;
|
|
93
93
|
focus(options?: FocusOptions): void;
|
|
94
|
+
/**
|
|
95
|
+
* Selects all the text in the textarea element.
|
|
96
|
+
*/
|
|
97
|
+
select(): void;
|
|
98
|
+
/**
|
|
99
|
+
* Sets the value of the textarea element, replacing a range of text.
|
|
100
|
+
*/
|
|
101
|
+
setRangeText(...args: Parameters<HTMLTextAreaElement['setRangeText']>): void;
|
|
102
|
+
/**
|
|
103
|
+
* Sets the start and end positions of a selection in the textarea element.
|
|
104
|
+
*/
|
|
105
|
+
setSelectionRange(...args: Parameters<HTMLTextAreaElement['setSelectionRange']>): void;
|
|
106
|
+
/** The position of the start of the current text selection in the textarea element. */
|
|
107
|
+
get selectionStart(): number;
|
|
108
|
+
/** Sets the position of the start of the current text selection in the textarea element. */
|
|
109
|
+
set selectionStart(value: number);
|
|
110
|
+
/** The position of the end of the current text selection in the textarea element. */
|
|
111
|
+
get selectionEnd(): number;
|
|
112
|
+
/** Sets the position of the end of the current text selection in the textarea element. */
|
|
113
|
+
set selectionEnd(value: number);
|
|
114
|
+
/** The direction of the current text selection in the textarea element. */
|
|
115
|
+
get selectionDirection(): "none" | "backward" | "forward";
|
|
116
|
+
/** Sets the direction of the current text selection in the textarea element. */
|
|
117
|
+
set selectionDirection(value: "none" | "backward" | "forward");
|
|
94
118
|
private _handleResize;
|
|
95
119
|
private _handleSlotChange;
|
|
96
120
|
constructor();
|
|
@@ -118,6 +118,58 @@ let Textarea = class extends GdsFormControlElement {
|
|
|
118
118
|
focus(options) {
|
|
119
119
|
this._getValidityAnchor()?.focus(options);
|
|
120
120
|
}
|
|
121
|
+
/**
|
|
122
|
+
* Selects all the text in the textarea element.
|
|
123
|
+
*/
|
|
124
|
+
select() {
|
|
125
|
+
this._getValidityAnchor()?.select();
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* Sets the value of the textarea element, replacing a range of text.
|
|
129
|
+
*/
|
|
130
|
+
setRangeText(...args) {
|
|
131
|
+
this._getValidityAnchor()?.setRangeText(...args);
|
|
132
|
+
this.value = this._getValidityAnchor()?.value || "";
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* Sets the start and end positions of a selection in the textarea element.
|
|
136
|
+
*/
|
|
137
|
+
setSelectionRange(...args) {
|
|
138
|
+
this._getValidityAnchor()?.setSelectionRange(...args);
|
|
139
|
+
}
|
|
140
|
+
/** The position of the start of the current text selection in the textarea element. */
|
|
141
|
+
get selectionStart() {
|
|
142
|
+
return this._getValidityAnchor()?.selectionStart;
|
|
143
|
+
}
|
|
144
|
+
/** Sets the position of the start of the current text selection in the textarea element. */
|
|
145
|
+
set selectionStart(value) {
|
|
146
|
+
const anchor = this._getValidityAnchor();
|
|
147
|
+
if (anchor) {
|
|
148
|
+
anchor.selectionStart = value;
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
/** The position of the end of the current text selection in the textarea element. */
|
|
152
|
+
get selectionEnd() {
|
|
153
|
+
return this._getValidityAnchor()?.selectionEnd;
|
|
154
|
+
}
|
|
155
|
+
/** Sets the position of the end of the current text selection in the textarea element. */
|
|
156
|
+
set selectionEnd(value) {
|
|
157
|
+
const anchor = this._getValidityAnchor();
|
|
158
|
+
if (anchor) {
|
|
159
|
+
anchor.selectionEnd = value;
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
/** The direction of the current text selection in the textarea element. */
|
|
163
|
+
get selectionDirection() {
|
|
164
|
+
return this._getValidityAnchor()?.selectionDirection;
|
|
165
|
+
}
|
|
166
|
+
/** Sets the direction of the current text selection in the textarea element. */
|
|
167
|
+
set selectionDirection(value) {
|
|
168
|
+
const anchor = this._getValidityAnchor();
|
|
169
|
+
if (anchor) {
|
|
170
|
+
anchor.selectionDirection = value;
|
|
171
|
+
}
|
|
172
|
+
}
|
|
121
173
|
_handleResize() {
|
|
122
174
|
if (!this.fieldBase) return;
|
|
123
175
|
Promise.resolve().then(() => {
|