@sebgroup/green-core 2.30.0 → 2.31.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/button/button.styles.js +8 -1
- package/components/input/input.component.js +16 -1
- package/custom-elements.json +12307 -12307
- package/gds-element.js +1 -1
- package/generated/mcp/components.json +1 -1
- package/generated/mcp/icons.json +1 -1
- package/generated/mcp/index.json +1 -1
- package/generated/react/index.d.ts +3 -3
- package/generated/react/index.js +3 -3
- package/package.json +1 -1
- package/utils/helpers/custom-element-scoping.js +1 -1
|
@@ -25,7 +25,6 @@ const style = css`
|
|
|
25
25
|
box-sizing: border-box;
|
|
26
26
|
border: none;
|
|
27
27
|
cursor: pointer;
|
|
28
|
-
min-block-size: var(--_block-size);
|
|
29
28
|
min-width: 0;
|
|
30
29
|
background-color: var(--gds-sys-color-l3-neutral-01);
|
|
31
30
|
color: var(--gds-sys-color-content-neutral-03);
|
|
@@ -78,6 +77,14 @@ const style = css`
|
|
|
78
77
|
white-space: nowrap;
|
|
79
78
|
min-width: 0;
|
|
80
79
|
}
|
|
80
|
+
|
|
81
|
+
&:not(.wrapped) {
|
|
82
|
+
block-size: var(--_block-size);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
&.wrapped {
|
|
86
|
+
min-block-size: var(--_block-size);
|
|
87
|
+
}
|
|
81
88
|
}
|
|
82
89
|
}
|
|
83
90
|
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
__privateMethod,
|
|
6
6
|
__privateSet
|
|
7
7
|
} from "../../chunks/chunk.QU3DSPNU.js";
|
|
8
|
-
var _charCounterComputed, _Input_instances, shouldShowFooter_fn, _handleOnInput, _handleOnChange, _handleFieldClick, _handleClearBtnClick, renderFieldContents_fn, renderSlotLead_fn, renderSlotTrail_fn, renderNativeInput_fn, renderClearButton_fn;
|
|
8
|
+
var _charCounterComputed, _Input_instances, shouldShowFooter_fn, _handleOnInput, _handleOnChange, _handleOnKeyDown, _handleFieldClick, _handleClearBtnClick, renderFieldContents_fn, renderSlotLead_fn, renderSlotTrail_fn, renderNativeInput_fn, renderClearButton_fn;
|
|
9
9
|
import { localized, msg } from "@lit/localize";
|
|
10
10
|
import { property, query, queryAsync } from "lit/decorators.js";
|
|
11
11
|
import { ifDefined } from "lit/directives/if-defined.js";
|
|
@@ -58,6 +58,19 @@ let Input = class extends GdsFormControlElement {
|
|
|
58
58
|
composed: true
|
|
59
59
|
});
|
|
60
60
|
});
|
|
61
|
+
__privateAdd(this, _handleOnKeyDown, (e) => {
|
|
62
|
+
if (e.key !== "Enter") return;
|
|
63
|
+
if (this.disabled) return;
|
|
64
|
+
if (e.isComposing) return;
|
|
65
|
+
if (e.repeat) return;
|
|
66
|
+
const form = this.form ?? this.closest("form");
|
|
67
|
+
if (!form) return;
|
|
68
|
+
queueMicrotask(() => {
|
|
69
|
+
if (e.defaultPrevented) return;
|
|
70
|
+
if (this.disabled) return;
|
|
71
|
+
form.requestSubmit();
|
|
72
|
+
});
|
|
73
|
+
});
|
|
61
74
|
__privateAdd(this, _handleFieldClick, () => {
|
|
62
75
|
this.elInputAsync.then((el) => el.focus());
|
|
63
76
|
});
|
|
@@ -214,6 +227,7 @@ shouldShowFooter_fn = function() {
|
|
|
214
227
|
};
|
|
215
228
|
_handleOnInput = new WeakMap();
|
|
216
229
|
_handleOnChange = new WeakMap();
|
|
230
|
+
_handleOnKeyDown = new WeakMap();
|
|
217
231
|
_handleFieldClick = new WeakMap();
|
|
218
232
|
_handleClearBtnClick = new WeakMap();
|
|
219
233
|
renderFieldContents_fn = function() {
|
|
@@ -236,6 +250,7 @@ renderNativeInput_fn = function() {
|
|
|
236
250
|
<input
|
|
237
251
|
class="native-control"
|
|
238
252
|
@input=${__privateGet(this, _handleOnInput)}
|
|
253
|
+
@keydown=${__privateGet(this, _handleOnKeyDown)}
|
|
239
254
|
@change=${__privateGet(this, _handleOnChange)}
|
|
240
255
|
.value=${this.value}
|
|
241
256
|
id="input"
|