@ebrains/components 1.3.0 → 1.4.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/dist/cjs/components.cjs.js +1 -1
- package/dist/cjs/{eds-avatar_28.cjs.entry.js → eds-avatar_29.cjs.entry.js} +172 -53
- package/dist/cjs/index-88c8039f.js +2 -6
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/components/eds-input-elements/eds-input/eds-input.js +62 -2
- package/dist/collection/components/eds-input-field/eds-input-field.js +100 -26
- package/dist/collection/components/eds-input-field/eds-input-field.stories.js +19 -1
- package/dist/collection/components/eds-table/eds-table.js +7 -12
- package/dist/collection/components/eds-toast/eds-toast.js +20 -1
- package/dist/collection/shared-ui/eds-form/eds-form.js +20 -14
- package/dist/collection/utils/eds-form/formValidators.js +1 -1
- package/dist/collection/utils/eds-form/individualValidator.js +15 -1
- package/dist/collection/utils/eds-form/validateInput.js +1 -1
- package/dist/components/components.esm.js +1 -1
- package/dist/components/eds-form.js +37 -17
- package/dist/components/eds-input-field2.js +48 -22
- package/dist/components/eds-input2.js +14 -2
- package/dist/components/eds-table2.js +7 -12
- package/dist/components/eds-toast2.js +4 -2
- package/dist/components/p-b998223d.entry.js +1 -0
- package/dist/esm/components.js +1 -1
- package/dist/esm/{eds-avatar_28.entry.js → eds-avatar_29.entry.js} +172 -54
- package/dist/esm/index-fdb33359.js +2 -6
- package/dist/esm/loader.js +1 -1
- package/dist/hydrate/index.js +109 -54
- package/dist/hydrate/index.mjs +109 -54
- package/dist/stencil.config.js +7 -1
- package/dist/types/components/eds-input-elements/eds-input/eds-input.d.ts +3 -0
- package/dist/types/components/eds-input-field/eds-input-field.d.ts +8 -2
- package/dist/types/components/eds-input-field/eds-input-field.stories.d.ts +12 -0
- package/dist/types/components/eds-toast/eds-toast.d.ts +5 -0
- package/dist/types/components.d.ts +50 -4
- package/dist/types/utils/eds-form/individualValidator.d.ts +1 -1
- package/package.json +1 -1
- package/dist/cjs/eds-toast.cjs.entry.js +0 -77
- package/dist/components/p-326d9e55.entry.js +0 -1
- package/dist/components/p-4ffdf8ac.entry.js +0 -1
- package/dist/esm/eds-toast.entry.js +0 -73
package/dist/hydrate/index.mjs
CHANGED
|
@@ -7139,11 +7139,25 @@ class EdsFooter {
|
|
|
7139
7139
|
}
|
|
7140
7140
|
|
|
7141
7141
|
// utils/validators.ts
|
|
7142
|
-
function validateField(name, value, type, required, maxLength) {
|
|
7142
|
+
function validateField(name, value, type, required, maxLength, min, max) {
|
|
7143
7143
|
const errors = [];
|
|
7144
7144
|
if (required && !value) {
|
|
7145
7145
|
errors.push(`${name} is required.`);
|
|
7146
7146
|
}
|
|
7147
|
+
if (type === 'number') {
|
|
7148
|
+
const parsed = typeof value === 'number' ? value : parseFloat(value);
|
|
7149
|
+
if (isNaN(parsed)) {
|
|
7150
|
+
errors.push(`${name} must be a valid number.`);
|
|
7151
|
+
}
|
|
7152
|
+
else {
|
|
7153
|
+
if (typeof min === 'number' && parsed < min) {
|
|
7154
|
+
errors.push(`${name} must be greater than or equal to ${min}.`);
|
|
7155
|
+
}
|
|
7156
|
+
if (typeof max === 'number' && parsed > max) {
|
|
7157
|
+
errors.push(`${name} must be less than or equal to ${max}.`);
|
|
7158
|
+
}
|
|
7159
|
+
}
|
|
7160
|
+
}
|
|
7147
7161
|
if (maxLength && typeof value === 'string' && value.length > maxLength) {
|
|
7148
7162
|
errors.push(`${name} must be at most ${maxLength} characters.`);
|
|
7149
7163
|
}
|
|
@@ -7237,7 +7251,7 @@ isFieldVisible) {
|
|
|
7237
7251
|
const inputEl = findFieldElement(formEl, field.name);
|
|
7238
7252
|
if (inputEl) {
|
|
7239
7253
|
const value = inputEl.value;
|
|
7240
|
-
const fieldErrors = validateField(field.name, value, field.type, field.required, field.maxlength);
|
|
7254
|
+
const fieldErrors = validateField(field.name, value, field.type, field.required, field.maxlength, field.min, field.max);
|
|
7241
7255
|
if (fieldErrors.length > 0) {
|
|
7242
7256
|
errors[field.name] = fieldErrors;
|
|
7243
7257
|
hasError = true;
|
|
@@ -7262,7 +7276,7 @@ function validateInputField(field, value, formEl) {
|
|
|
7262
7276
|
}
|
|
7263
7277
|
return validateSingleBox(field.name, field.required, formEl);
|
|
7264
7278
|
}
|
|
7265
|
-
return validateField(field.name, value, field.type, field.required, field.maxlength);
|
|
7279
|
+
return validateField(field.name, value, field.type, field.required, field.maxlength, field.min, field.max);
|
|
7266
7280
|
}
|
|
7267
7281
|
|
|
7268
7282
|
/**
|
|
@@ -7347,11 +7361,12 @@ class EdsForm {
|
|
|
7347
7361
|
linkElement.dispatchEvent(event);
|
|
7348
7362
|
}
|
|
7349
7363
|
isFieldVisible(field) {
|
|
7350
|
-
if (!field.condition)
|
|
7364
|
+
if (!field.condition)
|
|
7351
7365
|
return true;
|
|
7352
|
-
|
|
7353
|
-
const
|
|
7354
|
-
|
|
7366
|
+
const actual = this.values[field.condition.field];
|
|
7367
|
+
const expected = field.condition.value;
|
|
7368
|
+
// Handle loose match between booleans and strings
|
|
7369
|
+
return String(actual) === String(expected);
|
|
7355
7370
|
}
|
|
7356
7371
|
validateForm() {
|
|
7357
7372
|
const { errors, hasError } = validateFormFields(this.parsedFields, this.formEl, this.values, (field, values) => {
|
|
@@ -7438,6 +7453,7 @@ class EdsForm {
|
|
|
7438
7453
|
}
|
|
7439
7454
|
handleChange(e, field) {
|
|
7440
7455
|
const target = e.target;
|
|
7456
|
+
let newValue = target.value;
|
|
7441
7457
|
if (target.type === 'checkbox') {
|
|
7442
7458
|
// Get the current comma separated string or default to an empty string.
|
|
7443
7459
|
const currentStr = this.values[field.name] || '';
|
|
@@ -7453,13 +7469,14 @@ class EdsForm {
|
|
|
7453
7469
|
// Remove the value from the array if the checkbox is unchecked.
|
|
7454
7470
|
valuesArray = valuesArray.filter((item) => item !== target.value);
|
|
7455
7471
|
}
|
|
7456
|
-
|
|
7457
|
-
this.values = Object.assign(Object.assign({}, this.values), { [field.name]: valuesArray.join(',') });
|
|
7472
|
+
newValue = valuesArray.join(',');
|
|
7458
7473
|
}
|
|
7459
|
-
else {
|
|
7460
|
-
|
|
7461
|
-
|
|
7474
|
+
else if (target.type === 'radio') {
|
|
7475
|
+
if (!target.checked)
|
|
7476
|
+
return; // Only react to the selected radio
|
|
7477
|
+
newValue = target.value;
|
|
7462
7478
|
}
|
|
7479
|
+
this.values = Object.assign(Object.assign({}, this.values), { [field.name]: newValue });
|
|
7463
7480
|
// If it’s the password field, return here for no event emission
|
|
7464
7481
|
if (field.name === 'password') {
|
|
7465
7482
|
return;
|
|
@@ -7468,13 +7485,16 @@ class EdsForm {
|
|
|
7468
7485
|
this.form.emit({
|
|
7469
7486
|
event: 'change',
|
|
7470
7487
|
field: field.name,
|
|
7471
|
-
value:
|
|
7488
|
+
value: newValue,
|
|
7472
7489
|
message: `${field.name} updated`
|
|
7473
7490
|
//data: this.makeFormData()
|
|
7474
7491
|
});
|
|
7475
7492
|
}
|
|
7476
7493
|
handleInput(e, field) {
|
|
7477
7494
|
const target = e.target;
|
|
7495
|
+
if (target.type === 'radio' && !target.checked)
|
|
7496
|
+
return;
|
|
7497
|
+
const newValue = target.value;
|
|
7478
7498
|
// Update the field's value in state.
|
|
7479
7499
|
//this.values = { ...this.values, [field.name]: target.value };
|
|
7480
7500
|
// Create a copy of the current errors.
|
|
@@ -7494,7 +7514,7 @@ class EdsForm {
|
|
|
7494
7514
|
this.form.emit({
|
|
7495
7515
|
event: 'input',
|
|
7496
7516
|
field: field.name,
|
|
7497
|
-
value:
|
|
7517
|
+
value: newValue,
|
|
7498
7518
|
message: `${field.name} updated`
|
|
7499
7519
|
//data: this.makeFormData()
|
|
7500
7520
|
});
|
|
@@ -7558,13 +7578,13 @@ class EdsForm {
|
|
|
7558
7578
|
render() {
|
|
7559
7579
|
const hiddenFields = this.parsedFields.filter((field) => field.type === 'hidden');
|
|
7560
7580
|
const otherFields = this.parsedFields.filter((field) => field.type !== 'hidden');
|
|
7561
|
-
return (hAsync("form", { key: '
|
|
7581
|
+
return (hAsync("form", { key: '98825e73a0279bed49b82caf2cc0529f30b53c70', ref: (el) => (this.formEl = el), autocomplete: "on", onSubmit: this.handleSubmit }, hAsync("div", { key: '6b9abe2a6c2d091d57ea9ca383d9edb5d48445dc' }, hAsync("slot", { key: '930bcd24d9b1c6ec1b29ccb1c3150897fa9d0a35' }), hiddenFields.map((field, index) => (hAsync("eds-input", { key: index, type: "hidden", name: field.name, value: field.value }))), otherFields.map((field, index) => {
|
|
7562
7582
|
var _a, _b;
|
|
7563
7583
|
if (!this.isFieldVisible(field)) {
|
|
7564
7584
|
return null;
|
|
7565
7585
|
}
|
|
7566
|
-
return (hAsync("eds-input-field", { key: index, name: field.name, id: `${this.name}_${field.name}`, label: field.label, placeholder: field.placeholder, value: this.values[field.name] || null, type: field.type, icon: field.icon || null, disabled: field.disabled, required: field.required, maxLength: field.maxlength, hint: field.hint, link: field.link, message: field.message, error: ((_a = this.errors[field.name]) === null || _a === void 0 ? void 0 : _a.length) > 0, errorMessage: (_b = this.errors[field.name]) === null || _b === void 0 ? void 0 : _b.join('<br />'), onInput: (e) => this.handleInput(e, field), onChangeNative: (e) => this.handleChange(e, field), class: index > 0 ? 'mt-20' : '', options: field.options }));
|
|
7567
|
-
})), this.formBtn && (hAsync("div", { key: '
|
|
7586
|
+
return (hAsync("eds-input-field", { key: index, name: field.name, id: `${this.name}_${field.name}`, label: field.label, placeholder: field.placeholder, value: this.values[field.name] || null, min: field.min, max: field.max, step: field.step, type: field.type, icon: field.icon || null, disabled: field.disabled, required: field.required, maxLength: field.maxlength, hint: field.hint, link: field.link, message: field.message, error: ((_a = this.errors[field.name]) === null || _a === void 0 ? void 0 : _a.length) > 0, errorMessage: (_b = this.errors[field.name]) === null || _b === void 0 ? void 0 : _b.join('<br />'), onInput: (e) => this.handleInput(e, field), onChangeNative: (e) => this.handleChange(e, field), class: index > 0 ? 'mt-20' : '', options: field.options }));
|
|
7587
|
+
})), this.formBtn && (hAsync("div", { key: 'e0ab2f16ff4a677a2b09a1069212e374f6d6eff8', class: "mt-20" }, hAsync("eds-button", { key: '781250d5e456a3f0176ade6e28356063c6981bb7', intent: "primary", label: this.formBtnLabel, disabled: this.isSubmitting, loading: this.isSubmitting, onClick: () => this.handleSubmit() })))));
|
|
7568
7588
|
}
|
|
7569
7589
|
get el() { return getElement(this); }
|
|
7570
7590
|
static get watchers() { return {
|
|
@@ -10927,6 +10947,9 @@ class EdsInput {
|
|
|
10927
10947
|
this.maxLength = undefined;
|
|
10928
10948
|
this.options = [];
|
|
10929
10949
|
this.extraClass = undefined;
|
|
10950
|
+
this.min = undefined;
|
|
10951
|
+
this.max = undefined;
|
|
10952
|
+
this.step = undefined;
|
|
10930
10953
|
this.innerVal = '';
|
|
10931
10954
|
this.maxLengthReached = false;
|
|
10932
10955
|
}
|
|
@@ -10949,12 +10972,18 @@ class EdsInput {
|
|
|
10949
10972
|
render() {
|
|
10950
10973
|
const withIcon = !!this.icon;
|
|
10951
10974
|
const describedBy = this.hasMessage || this.error ? `${this.name}-error` : '';
|
|
10952
|
-
return (hAsync("div", { key: '
|
|
10975
|
+
return (hAsync("div", { key: '8645092d1b4c53609cbac2077fd0575f7bae4aaa', class: "relative flex items-center" }, this.type === 'textarea' ? (hAsync("textarea", { id: this.inputId || this.name, name: this.name, placeholder: this.placeholder, value: this.innerVal.toString(), required: this.required, disabled: this.disabled, class: `min-h-80 input input-textarea ${withIcon ? 'input-with-icon' : ''} ${this.error ? 'input-error' : ''} ${this.extraClass}`, "aria-invalid": this.error ? 'true' : 'false', "aria-describedby": describedBy, maxlength: this.maxLength, onInput: this.handleInput, onChange: this.handleInput })) : this.type === 'select' ? (hAsync("select", { id: this.inputId || this.name, name: this.name, required: this.required, disabled: this.disabled, class: `input input-select ${this.error ? 'input-error' : ''} ${this.extraClass}`, "aria-invalid": this.error ? 'true' : 'false', "aria-describedby": describedBy, onInput: this.handleInput, onChange: this.handleInput }, this.options.map((option) => (hAsync("option", { value: option.value, selected: option.value === this.innerVal, key: option.value }, option.label))))) : (hAsync("input", Object.assign({ id: this.inputId || this.name, name: this.name, placeholder: this.placeholder, value: this.innerVal.toString(), required: this.required, disabled: this.disabled, type: this.type, checked: ['radio', 'checkbox'].includes(this.type) ? this.checked : undefined }, (this.type === 'number'
|
|
10976
|
+
? {
|
|
10977
|
+
min: this.min,
|
|
10978
|
+
max: this.max,
|
|
10979
|
+
step: this.step,
|
|
10980
|
+
}
|
|
10981
|
+
: {}), { class: `
|
|
10953
10982
|
${this.extraClass || ''}
|
|
10954
10983
|
input ${this.type === 'radio' ? 'input-radio' : this.type === 'checkbox' ? 'input-checkbox' : ''}
|
|
10955
10984
|
${withIcon && this.type !== 'radio' && this.type !== 'checkbox' ? 'input-icon pl-36' : ''}
|
|
10956
10985
|
${this.error ? 'input-error' : ''}
|
|
10957
|
-
`, "aria-invalid": this.error ? 'true' : 'false', "aria-describedby": describedBy, maxlength: this.maxLength, onInput: this.handleInput, onChange: this.handleInput })), this.maxLength && this.type === 'textarea' && (hAsync("span", { key: '
|
|
10986
|
+
`, "aria-invalid": this.error ? 'true' : 'false', "aria-describedby": describedBy, maxlength: this.maxLength, onInput: this.handleInput, onChange: this.handleInput }))), this.maxLength && this.type === 'textarea' && (hAsync("span", { key: '3cbf1dbffabb0cb895c6b69651933867584606d0', class: `input-counter f-ui-05 absolute bottom-8 right-8 ${this.maxLengthReached ? 'input-counter-error' : ''}` }, this.maxLength)), this.icon && (hAsync("eds-icon-wrapper", { key: 'fb3a7051ecb72a5f425a0590dae14ee731e40a60', class: `absolute top-1/2 left-[4px] -translate-y-1/2 ${this.disabled ? 'text-lightest' : 'text-lightest'}`, icon: this.icon }))));
|
|
10958
10987
|
}
|
|
10959
10988
|
get el() { return getElement(this); }
|
|
10960
10989
|
static get watchers() { return {
|
|
@@ -10978,6 +11007,9 @@ class EdsInput {
|
|
|
10978
11007
|
"maxLength": [2, "max-length"],
|
|
10979
11008
|
"options": [16],
|
|
10980
11009
|
"extraClass": [1, "extra-class"],
|
|
11010
|
+
"min": [2],
|
|
11011
|
+
"max": [2],
|
|
11012
|
+
"step": [2],
|
|
10981
11013
|
"innerVal": [32],
|
|
10982
11014
|
"maxLengthReached": [32]
|
|
10983
11015
|
},
|
|
@@ -10996,19 +11028,52 @@ class EdsInputField {
|
|
|
10996
11028
|
this.edsinput = createEvent(this, "edsinput", 7);
|
|
10997
11029
|
this.edschange = createEvent(this, "edschange", 7);
|
|
10998
11030
|
this.handleNativeInput = (ev) => {
|
|
10999
|
-
var _a;
|
|
11031
|
+
var _a, _b;
|
|
11000
11032
|
(_a = this.onInput) === null || _a === void 0 ? void 0 : _a.call(this, ev);
|
|
11001
11033
|
if (this.shouldEmitValue()) {
|
|
11002
|
-
const
|
|
11003
|
-
|
|
11034
|
+
const target = ev.target;
|
|
11035
|
+
let value = target.value;
|
|
11036
|
+
if (this.type === 'checkbox' && ((_b = this.parsedOptions) === null || _b === void 0 ? void 0 : _b.length) > 0) {
|
|
11037
|
+
// checkbox group case
|
|
11038
|
+
const checkboxes = this.hostEl.querySelectorAll(`input[type="checkbox"][name="${this.name}"]`);
|
|
11039
|
+
value = Array.from(checkboxes)
|
|
11040
|
+
.filter(cb => cb.checked)
|
|
11041
|
+
.map(cb => cb.value);
|
|
11042
|
+
}
|
|
11043
|
+
else if (this.type === 'checkbox') {
|
|
11044
|
+
value = target.checked;
|
|
11045
|
+
}
|
|
11046
|
+
else if (this.type === 'radio') {
|
|
11047
|
+
value = target.value;
|
|
11048
|
+
}
|
|
11049
|
+
else {
|
|
11050
|
+
value = target.value;
|
|
11051
|
+
}
|
|
11052
|
+
this.edsinput.emit({ value });
|
|
11004
11053
|
}
|
|
11005
11054
|
};
|
|
11006
11055
|
this.handleNativeChange = (ev) => {
|
|
11007
|
-
var _a;
|
|
11056
|
+
var _a, _b;
|
|
11008
11057
|
(_a = this.onChangeNative) === null || _a === void 0 ? void 0 : _a.call(this, ev);
|
|
11009
11058
|
if (this.shouldEmitValue()) {
|
|
11010
11059
|
const target = ev.target;
|
|
11011
|
-
|
|
11060
|
+
let value = target.value;
|
|
11061
|
+
if (this.type === 'checkbox' && ((_b = this.parsedOptions) === null || _b === void 0 ? void 0 : _b.length) > 0) {
|
|
11062
|
+
// checkbox group case
|
|
11063
|
+
const checkboxes = this.hostEl.querySelectorAll(`input[type="checkbox"][name="${this.name}"]`);
|
|
11064
|
+
value = Array.from(checkboxes)
|
|
11065
|
+
.filter(cb => cb.checked)
|
|
11066
|
+
.map(cb => cb.value);
|
|
11067
|
+
}
|
|
11068
|
+
else if (this.type === 'checkbox') {
|
|
11069
|
+
value = target.checked;
|
|
11070
|
+
}
|
|
11071
|
+
else if (this.type === 'radio') {
|
|
11072
|
+
value = target.value;
|
|
11073
|
+
}
|
|
11074
|
+
else {
|
|
11075
|
+
value = target.value;
|
|
11076
|
+
}
|
|
11012
11077
|
this.edschange.emit({ value });
|
|
11013
11078
|
}
|
|
11014
11079
|
};
|
|
@@ -11027,6 +11092,9 @@ class EdsInputField {
|
|
|
11027
11092
|
this.errorMessage = undefined;
|
|
11028
11093
|
this.value = undefined;
|
|
11029
11094
|
this.maxLength = undefined;
|
|
11095
|
+
this.min = undefined;
|
|
11096
|
+
this.max = undefined;
|
|
11097
|
+
this.step = undefined;
|
|
11030
11098
|
this.options = undefined;
|
|
11031
11099
|
this.type = 'text';
|
|
11032
11100
|
this.onChangeNative = undefined;
|
|
@@ -11051,22 +11119,9 @@ class EdsInputField {
|
|
|
11051
11119
|
return [];
|
|
11052
11120
|
}
|
|
11053
11121
|
render() {
|
|
11054
|
-
const inputOpts = {
|
|
11055
|
-
|
|
11056
|
-
|
|
11057
|
-
placeholder: this.placeholder,
|
|
11058
|
-
disabled: this.disabled,
|
|
11059
|
-
onInput: this.handleNativeInput,
|
|
11060
|
-
onChange: this.handleNativeChange,
|
|
11061
|
-
type: this.type,
|
|
11062
|
-
required: this.required,
|
|
11063
|
-
value: this.value,
|
|
11064
|
-
error: this.error,
|
|
11065
|
-
icon: this.icon,
|
|
11066
|
-
checked: this.checked
|
|
11067
|
-
};
|
|
11068
|
-
return (hAsync("div", { key: '6f048dc1418d0738fc097d3c48148ccfdf70fbdc' }, this.type === 'checkbox' || this.type === 'radio' ? (this.parsedOptions.length > 0 ? (hAsync("fieldset", { class: "space-y-4 mt-8" }, hAsync("div", { class: "flex justify-between" }, this.label && (hAsync("eds-input-label", { name: this.inputId || this.name, label: this.label, required: this.required })), this.hint && (hAsync("p", { id: `${this.name}-hint`, class: "f-ui-05 text-lighter mt-8 ml-8" }, this.hint))), this.parsedOptions.map((option) => (hAsync("div", { class: "flex items-center gap-x-2", key: option.value }, hAsync("eds-input", Object.assign({}, inputOpts, { value: option.value, checked: typeof this.value === 'string' &&
|
|
11069
|
-
this.value.split(',').includes(String(option.value)) })), hAsync("eds-input-label", { name: `${this.name}-${option.value}`, label: option.label })))))) : (hAsync("div", { class: "flex items-center gap-x-8" }, hAsync("eds-input", Object.assign({}, inputOpts, { value: this.value, checked: this.value === 'on' })), this.label && (hAsync("eds-input-label", { name: this.inputId || this.name, label: this.label, disabled: this.disabled, required: this.required }))))) : (hAsync("div", null, hAsync("div", { class: "flex justify-between" }, this.label && (hAsync("eds-input-label", { name: this.inputId || this.name, label: this.label, disabled: this.disabled, required: this.required })), this.hint && (hAsync("p", { id: `${this.name}-hint`, class: "f-ui-05 text-lighter mt-8 ml-8" }, this.hint))), this.type === 'select' ? (hAsync("eds-input-select", Object.assign({}, inputOpts, { options: this.parsedOptions }))) : this.type === 'file' ? (hAsync("input", { type: "file", id: this.inputId || this.name, name: this.name, onChange: this.onChangeNative, disabled: this.disabled, required: this.required })) : this.type === 'search' ? (hAsync("eds-input-search", { name: "search-box" })) : this.type === 'range' ? ((() => {
|
|
11122
|
+
const inputOpts = Object.assign({ name: this.name, id: this.inputId, placeholder: this.placeholder, disabled: this.disabled, onInput: this.handleNativeInput, onChange: this.handleNativeChange, type: this.type, required: this.required, value: this.value, error: this.error, icon: this.icon, checked: this.checked }, (this.type === 'number' ? { min: this.min, max: this.max, step: this.step } : {}));
|
|
11123
|
+
return (hAsync("div", { key: '48926c14240f7e26d2277729d829d98ab17f9eee' }, this.type === 'checkbox' || this.type === 'radio' ? (this.parsedOptions.length > 0 ? (hAsync("fieldset", { class: "space-y-4 mt-8" }, hAsync("div", { class: "flex justify-between" }, this.label && (hAsync("eds-input-label", { name: this.inputId || this.name, label: this.label, required: this.required })), this.hint && (hAsync("p", { id: `${this.name}-hint`, class: "f-ui-05 text-lighter mt-8 ml-8" }, this.hint))), this.parsedOptions.map((option) => (hAsync("div", { class: "flex items-center gap-x-2", key: option.value }, hAsync("eds-input", Object.assign({}, inputOpts, { value: option.value, checked: typeof this.value === 'string' &&
|
|
11124
|
+
this.value.split(',').includes(String(option.value)) })), hAsync("eds-input-label", { name: `${this.name}-${option.value}`, label: option.label })))))) : (hAsync("div", { class: "flex items-center gap-x-8" }, hAsync("eds-input", Object.assign({}, inputOpts, { value: this.value, checked: this.value === 'on' || this.checked })), this.label && (hAsync("eds-input-label", { name: this.inputId || this.name, label: this.label, disabled: this.disabled, required: this.required }))))) : (hAsync("div", null, hAsync("div", { class: "flex justify-between" }, this.label && (hAsync("eds-input-label", { name: this.inputId || this.name, label: this.label, disabled: this.disabled, required: this.required })), this.hint && (hAsync("p", { id: `${this.name}-hint`, class: "f-ui-05 text-lighter mt-8 ml-8" }, this.hint))), this.type === 'select' ? (hAsync("eds-input-select", Object.assign({}, inputOpts, { options: this.parsedOptions }))) : this.type === 'file' ? (hAsync("input", { type: "file", id: this.inputId || this.name, name: this.name, onChange: this.onChangeNative, disabled: this.disabled, required: this.required })) : this.type === 'search' ? (hAsync("eds-input-search", { name: "search-box" })) : this.type === 'range' ? ((() => {
|
|
11070
11125
|
var _a, _b, _c;
|
|
11071
11126
|
const rangeProps = {
|
|
11072
11127
|
name: inputOpts.name,
|
|
@@ -11079,7 +11134,7 @@ class EdsInputField {
|
|
|
11079
11134
|
const opt = this.parsedOptions;
|
|
11080
11135
|
const numberValue = typeof this.value === 'string' ? parseFloat(this.value) : this.value || 0;
|
|
11081
11136
|
return (hAsync("eds-input-range", Object.assign({}, rangeProps, { min: (_a = opt[0]) === null || _a === void 0 ? void 0 : _a.value, max: (_b = opt[1]) === null || _b === void 0 ? void 0 : _b.value, step: (_c = opt[2]) === null || _c === void 0 ? void 0 : _c.value, value: numberValue })));
|
|
11082
|
-
})()) : (hAsync("eds-input", Object.assign({}, inputOpts))))), hAsync("div", { key: '
|
|
11137
|
+
})()) : (hAsync("eds-input", Object.assign({}, inputOpts))))), hAsync("div", { key: '72b565ac1c52a56d7e563e227baf187d72f2ba21', class: "mt-4" }, hAsync("eds-input-footer", { key: '65c40184d6fd5dfc730a46ffe8e826687c7d6f36', id: `${this.name}-footer`, name: this.name, message: this.message, "error-message": this.errorMessage, error: this.error, link: this.link }))));
|
|
11083
11138
|
}
|
|
11084
11139
|
get hostEl() { return getElement(this); }
|
|
11085
11140
|
static get style() { return EdsInputFieldStyle0; }
|
|
@@ -11102,6 +11157,9 @@ class EdsInputField {
|
|
|
11102
11157
|
"errorMessage": [1, "error-message"],
|
|
11103
11158
|
"value": [8],
|
|
11104
11159
|
"maxLength": [2, "max-length"],
|
|
11160
|
+
"min": [2],
|
|
11161
|
+
"max": [2],
|
|
11162
|
+
"step": [2],
|
|
11105
11163
|
"options": [1],
|
|
11106
11164
|
"type": [1],
|
|
11107
11165
|
"onChangeNative": [16],
|
|
@@ -13258,10 +13316,9 @@ class EdsTable {
|
|
|
13258
13316
|
}
|
|
13259
13317
|
updateColumns() {
|
|
13260
13318
|
var _a, _b;
|
|
13261
|
-
//
|
|
13319
|
+
// Grab all data‐keys from the first row (if any) as before:
|
|
13262
13320
|
this.columns = this.tbData.length > 0 ? Object.keys(this.tbData[0]) : [];
|
|
13263
|
-
//
|
|
13264
|
-
// (you can call it anything; we’ll detect it in render())
|
|
13321
|
+
// Instead of pushing each action.name, add just a single “actions” column
|
|
13265
13322
|
if (((_b = (_a = this.parsedActions) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 0) > 0 && this.tbData.length > 0) {
|
|
13266
13323
|
this.columns.push('actions');
|
|
13267
13324
|
}
|
|
@@ -13288,30 +13345,26 @@ class EdsTable {
|
|
|
13288
13345
|
const columnWidth = visibleColumnsCount > 0 ? Math.floor((currentContainerWidth / visibleColumnsCount) * this.divisionFactor()) : 100;
|
|
13289
13346
|
const paginatedRows = this.getPaginatedRows();
|
|
13290
13347
|
const lastPage = Math.ceil(this.totalRows / this.rowsPerPage);
|
|
13291
|
-
return (hAsync("div", { key: '
|
|
13348
|
+
return (hAsync("div", { key: 'f188b98870101f250e8515178d50763bb708ade5' }, this.searchEnabled && (hAsync("div", { key: '96f046ad286df6cb46e9f9f6d3e45a69f90af108' }, hAsync("eds-input-field", { key: 1, name: "search", "aria-label": "Search", type: "text", placeholder: "Search...", onInput: (event) => this.handleSearch(event) }))), hAsync("div", { key: 'bbf27504732266f3e3ae299fcf742a653a23fdef', class: "mt-20" }, hAsync("table", { key: 'a1c76a7b0d4c4a1382c34cf58a49896567610403', class: "block overflow-x-auto mt-6 p-0" }, hAsync("thead", { key: 'ea7e4b5d1c48c63094a96ba5c8fb38bf8e805024' }, hAsync("tr", { key: '6e49bc93f9678f5f6449269728ca893a88ceb51a', class: "m-0 p-0 border border-softer even:bg-inverse-softer" }, this.columns.map((col) => {
|
|
13292
13349
|
var _a;
|
|
13293
|
-
// 3) For the “actions” column, override the header to “Actions”
|
|
13294
13350
|
if (col === 'actions') {
|
|
13295
|
-
|
|
13296
|
-
return (hAsync("th", { class: "m-0 py-8 border border-softer f-ui-02 break-words", style: { minWidth: `${columnWidth - 4}px` } }, "Actions"));
|
|
13351
|
+
return (hAsync("th", { class: "m-0 py-8 border border-softer f-ui-02 break-words", style: { minWidth: `${columnWidth - 4}px` } }));
|
|
13297
13352
|
}
|
|
13298
|
-
// Otherwise, render column name or action label if you do want to override:
|
|
13299
13353
|
if (!((_a = this.parsedConfig[col]) === null || _a === void 0 ? void 0 : _a.hidden)) {
|
|
13300
13354
|
return (hAsync("th", { class: "m-0 py-8 border border-softer f-ui-02 break-words", style: { minWidth: `${columnWidth - 4}px` } }, this.capitalize(col)));
|
|
13301
13355
|
}
|
|
13302
13356
|
return null;
|
|
13303
|
-
}))), hAsync("tbody", { key: '
|
|
13357
|
+
}))), hAsync("tbody", { key: '7f09b3133241c4a19ad75c27134c04192e9dc357' }, paginatedRows.map((row) => (hAsync("tr", { class: "m-0 p-0 border border-softer even:bg-inverse-softer" }, this.columns.map((col) => {
|
|
13304
13358
|
var _a;
|
|
13305
13359
|
if (col === 'actions') {
|
|
13306
|
-
// 4) Render ALL actions inside a single <td> for this row:
|
|
13307
13360
|
return (hAsync("td", { class: "text-center border border-softer m-0 f-ui-02 break-words actions-cell", style: { minWidth: `${columnWidth - 4}px` } }, hAsync("div", { style: { display: 'flex', gap: '0.5rem', justifyContent: 'center', flexWrap: 'wrap' } }, this.parsedActions.map((act) => (hAsync("span", { style: { whiteSpace: 'nowrap' } }, this.renderSingleActionCell(act.name, row)))))));
|
|
13308
13361
|
}
|
|
13309
13362
|
if (!((_a = this.parsedConfig[col]) === null || _a === void 0 ? void 0 : _a.hidden)) {
|
|
13310
|
-
// Regular data cell
|
|
13363
|
+
// Regular data cell
|
|
13311
13364
|
return (hAsync("td", { class: "text-center border border-softer m-0 py-8 f-ui-2 break-words", style: { minWidth: `${columnWidth - 4}px` } }, this.renderCell(row[col], col)));
|
|
13312
13365
|
}
|
|
13313
13366
|
return null;
|
|
13314
|
-
}))))))), this.shouldEnablePagination() && (hAsync("div", { key: '
|
|
13367
|
+
}))))))), this.shouldEnablePagination() && (hAsync("div", { key: 'ceb320ba2e1cb14e4220c653c92bb2a9e8bf3593', class: "mt-20" }, hAsync("eds-pagination", { key: '19c22566443e476742fd7f5e232c9240ecb34bec', currentPage: this.currentPage, lastPage: lastPage, perPage: this.rowsPerPage, total: this.totalRows, mode: "default" })))));
|
|
13315
13368
|
}
|
|
13316
13369
|
get hostEl() { return getElement(this); }
|
|
13317
13370
|
static get watchers() { return {
|
|
@@ -13623,7 +13676,7 @@ class EdsTimeline {
|
|
|
13623
13676
|
const edsToastCss = ".relative{position:relative}.right-4{right:0.25rem}.bottom-4{bottom:0.25rem}.w-auto{width:auto}.flex{display:flex}.items-center{align-items:center}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-4{gap:0.25rem}.f-ui-01{font-family:var(--f-ui-01-fontFamily);font-weight:var(--f-ui-01-fontWeight);font-size:var(--f-ui-01-fontSize);line-height:var(--f-ui-01-lineHeight);letter-spacing:var(--f-ui-01-letterSpacing)}.ml-8{margin-left:0.5rem}.p-12{padding:0.75rem}.rounded-lg{border-radius:16px}.shadow-md{--tw-shadow:0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);--tw-shadow-colored:0 4px 6px -1px var(--tw-shadow-color),\n 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),\n var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}.bg-dark{background-color:var(--grey-300)}.bg-success{background-color:var(--green-200)}.bg-error{background-color:var(--red-200)}.bg-warning{background-color:var(--yellow-200)}.text-light{color:var(--grey-700)}.text-current{color:currentColor}.text-default{color:var(--black)}";
|
|
13624
13677
|
var EdsToastStyle0 = edsToastCss;
|
|
13625
13678
|
|
|
13626
|
-
const toastStyles = cva(['relative
|
|
13679
|
+
const toastStyles = cva(['relative bottom-4 w-auto p-12 rounded-lg shadow-md'], {
|
|
13627
13680
|
variants: {
|
|
13628
13681
|
intent: {
|
|
13629
13682
|
default: 'bg-dark text-light',
|
|
@@ -13639,10 +13692,12 @@ const toastStyles = cva(['relative right-4 bottom-4 w-auto p-12 rounded-lg shado
|
|
|
13639
13692
|
class EdsToast {
|
|
13640
13693
|
constructor(hostRef) {
|
|
13641
13694
|
registerInstance(this, hostRef);
|
|
13695
|
+
this.toast = createEvent(this, "toast", 7);
|
|
13642
13696
|
/**
|
|
13643
13697
|
* Dismisses the toast.
|
|
13644
13698
|
*/
|
|
13645
13699
|
this.dismissToast = () => {
|
|
13700
|
+
this.toast.emit({ visible: false, label: 'dismissed' });
|
|
13646
13701
|
this.visible = false;
|
|
13647
13702
|
};
|
|
13648
13703
|
this.message = undefined;
|
package/dist/stencil.config.js
CHANGED
|
@@ -25,10 +25,16 @@ export const config = {
|
|
|
25
25
|
dest: path.resolve(__dirname, '../../dist/packages/components'),
|
|
26
26
|
},
|
|
27
27
|
{
|
|
28
|
-
//
|
|
28
|
+
// LICENSE next to this config file
|
|
29
29
|
src: path.resolve(__dirname, 'LICENSE'),
|
|
30
30
|
// your stencil dist folder
|
|
31
31
|
dest: path.resolve(__dirname, '../../dist/packages/components'),
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
// CHANGELOG.md next to this config file
|
|
35
|
+
src: path.resolve(__dirname, 'CHANGELOG.md'),
|
|
36
|
+
// your stencil dist folder
|
|
37
|
+
dest: path.resolve(__dirname, '../../dist/packages/components'),
|
|
32
38
|
}
|
|
33
39
|
]
|
|
34
40
|
},
|
|
@@ -33,6 +33,12 @@ export declare class EdsInputField {
|
|
|
33
33
|
value?: string | number;
|
|
34
34
|
/** The maximum allowed length for text input. */
|
|
35
35
|
maxLength?: number;
|
|
36
|
+
/** Minimum value for number or range inputs */
|
|
37
|
+
min?: number;
|
|
38
|
+
/** Maximum value for number or range inputs */
|
|
39
|
+
max?: number;
|
|
40
|
+
/** Step value for number or range inputs */
|
|
41
|
+
step?: number;
|
|
36
42
|
/**
|
|
37
43
|
* Options for select, checkbox, radio, or range inputs.
|
|
38
44
|
* Can be a JSON string or an array of `{ value, label }` objects.
|
|
@@ -63,14 +69,14 @@ export declare class EdsInputField {
|
|
|
63
69
|
* Use `event.detail.value` to access the new value.
|
|
64
70
|
*/
|
|
65
71
|
edsinput: EventEmitter<{
|
|
66
|
-
value: string;
|
|
72
|
+
value: string | boolean | string[];
|
|
67
73
|
}>;
|
|
68
74
|
/**
|
|
69
75
|
* Emits on blur or change event (e.g., selecting an option, leaving the field).
|
|
70
76
|
* Use `event.detail.value` to access the final value.
|
|
71
77
|
*/
|
|
72
78
|
edschange: EventEmitter<{
|
|
73
|
-
value: string;
|
|
79
|
+
value: string | boolean | string[];
|
|
74
80
|
}>;
|
|
75
81
|
/** Reference to the host element. */
|
|
76
82
|
hostEl: HTMLElement;
|
|
@@ -43,6 +43,18 @@ declare const _default: {
|
|
|
43
43
|
control: string;
|
|
44
44
|
description: string;
|
|
45
45
|
};
|
|
46
|
+
min: {
|
|
47
|
+
control: string;
|
|
48
|
+
description: string;
|
|
49
|
+
};
|
|
50
|
+
max: {
|
|
51
|
+
control: string;
|
|
52
|
+
description: string;
|
|
53
|
+
};
|
|
54
|
+
step: {
|
|
55
|
+
control: string;
|
|
56
|
+
description: string;
|
|
57
|
+
};
|
|
46
58
|
message: {
|
|
47
59
|
control: string;
|
|
48
60
|
description: string;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { EventEmitter } from '../../stencil-public-runtime';
|
|
1
2
|
export declare class EdsToast {
|
|
2
3
|
/**
|
|
3
4
|
* The main message or text to be displayed in the toast.
|
|
@@ -18,6 +19,10 @@ export declare class EdsToast {
|
|
|
18
19
|
*/
|
|
19
20
|
visible: boolean;
|
|
20
21
|
el: HTMLElement;
|
|
22
|
+
toast: EventEmitter<{
|
|
23
|
+
visible: boolean;
|
|
24
|
+
label: 'dismissed' | 'shown';
|
|
25
|
+
}>;
|
|
21
26
|
private dismissTimeout;
|
|
22
27
|
componentDidLoad(): void;
|
|
23
28
|
/**
|
|
@@ -1070,11 +1070,14 @@ export namespace Components {
|
|
|
1070
1070
|
"hasMessage": boolean;
|
|
1071
1071
|
"icon"?: string;
|
|
1072
1072
|
"inputId"?: string;
|
|
1073
|
+
"max"?: number;
|
|
1073
1074
|
"maxLength"?: number;
|
|
1075
|
+
"min"?: number;
|
|
1074
1076
|
"name": string;
|
|
1075
1077
|
"options"?: { label: string; value: string }[];
|
|
1076
1078
|
"placeholder"?: string;
|
|
1077
1079
|
"required": boolean;
|
|
1080
|
+
"step"?: number;
|
|
1078
1081
|
"type": string;
|
|
1079
1082
|
"value"?: string | number;
|
|
1080
1083
|
}
|
|
@@ -1119,6 +1122,10 @@ export namespace Components {
|
|
|
1119
1122
|
* Optional link associated with the input (for help or docs).
|
|
1120
1123
|
*/
|
|
1121
1124
|
"link"?: { url: string; label: string };
|
|
1125
|
+
/**
|
|
1126
|
+
* Maximum value for number or range inputs
|
|
1127
|
+
*/
|
|
1128
|
+
"max"?: number;
|
|
1122
1129
|
/**
|
|
1123
1130
|
* The maximum allowed length for text input.
|
|
1124
1131
|
*/
|
|
@@ -1127,6 +1134,10 @@ export namespace Components {
|
|
|
1127
1134
|
* Message shown below the input (e.g., additional info or validation message).
|
|
1128
1135
|
*/
|
|
1129
1136
|
"message"?: string;
|
|
1137
|
+
/**
|
|
1138
|
+
* Minimum value for number or range inputs
|
|
1139
|
+
*/
|
|
1140
|
+
"min"?: number;
|
|
1130
1141
|
/**
|
|
1131
1142
|
* The `name` attribute of the input element. Required for form submission.
|
|
1132
1143
|
*/
|
|
@@ -1151,6 +1162,10 @@ export namespace Components {
|
|
|
1151
1162
|
* If `true`, the input is required.
|
|
1152
1163
|
*/
|
|
1153
1164
|
"required": boolean;
|
|
1165
|
+
/**
|
|
1166
|
+
* Step value for number or range inputs
|
|
1167
|
+
*/
|
|
1168
|
+
"step"?: number;
|
|
1154
1169
|
/**
|
|
1155
1170
|
* Type of the input: e.g., `text`, `checkbox`, `select`, `range`, etc.
|
|
1156
1171
|
*/
|
|
@@ -1962,6 +1977,10 @@ export interface EdsTabsCustomEvent<T> extends CustomEvent<T> {
|
|
|
1962
1977
|
detail: T;
|
|
1963
1978
|
target: HTMLEdsTabsElement;
|
|
1964
1979
|
}
|
|
1980
|
+
export interface EdsToastCustomEvent<T> extends CustomEvent<T> {
|
|
1981
|
+
detail: T;
|
|
1982
|
+
target: HTMLEdsToastElement;
|
|
1983
|
+
}
|
|
1965
1984
|
declare global {
|
|
1966
1985
|
interface HTMLColorPrimaryPaletteElement extends Components.ColorPrimaryPalette, HTMLStencilElement {
|
|
1967
1986
|
}
|
|
@@ -2629,8 +2648,8 @@ declare global {
|
|
|
2629
2648
|
new (): HTMLEdsInputElement;
|
|
2630
2649
|
};
|
|
2631
2650
|
interface HTMLEdsInputFieldElementEventMap {
|
|
2632
|
-
"edsinput": { value: string };
|
|
2633
|
-
"edschange": { value: string };
|
|
2651
|
+
"edsinput": { value: string | boolean | string[] };
|
|
2652
|
+
"edschange": { value: string | boolean | string[] };
|
|
2634
2653
|
}
|
|
2635
2654
|
interface HTMLEdsInputFieldElement extends Components.EdsInputField, HTMLStencilElement {
|
|
2636
2655
|
addEventListener<K extends keyof HTMLEdsInputFieldElementEventMap>(type: K, listener: (this: HTMLEdsInputFieldElement, ev: EdsInputFieldCustomEvent<HTMLEdsInputFieldElementEventMap[K]>) => any, options?: boolean | AddEventListenerOptions): void;
|
|
@@ -2987,7 +3006,18 @@ declare global {
|
|
|
2987
3006
|
prototype: HTMLEdsTimelineElement;
|
|
2988
3007
|
new (): HTMLEdsTimelineElement;
|
|
2989
3008
|
};
|
|
3009
|
+
interface HTMLEdsToastElementEventMap {
|
|
3010
|
+
"toast": { visible: boolean; label: 'dismissed' | 'shown' };
|
|
3011
|
+
}
|
|
2990
3012
|
interface HTMLEdsToastElement extends Components.EdsToast, HTMLStencilElement {
|
|
3013
|
+
addEventListener<K extends keyof HTMLEdsToastElementEventMap>(type: K, listener: (this: HTMLEdsToastElement, ev: EdsToastCustomEvent<HTMLEdsToastElementEventMap[K]>) => any, options?: boolean | AddEventListenerOptions): void;
|
|
3014
|
+
addEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
|
|
3015
|
+
addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
|
|
3016
|
+
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
|
|
3017
|
+
removeEventListener<K extends keyof HTMLEdsToastElementEventMap>(type: K, listener: (this: HTMLEdsToastElement, ev: EdsToastCustomEvent<HTMLEdsToastElementEventMap[K]>) => any, options?: boolean | EventListenerOptions): void;
|
|
3018
|
+
removeEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
|
|
3019
|
+
removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
|
|
3020
|
+
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
|
2991
3021
|
}
|
|
2992
3022
|
var HTMLEdsToastElement: {
|
|
2993
3023
|
prototype: HTMLEdsToastElement;
|
|
@@ -4321,11 +4351,14 @@ declare namespace LocalJSX {
|
|
|
4321
4351
|
"hasMessage"?: boolean;
|
|
4322
4352
|
"icon"?: string;
|
|
4323
4353
|
"inputId"?: string;
|
|
4354
|
+
"max"?: number;
|
|
4324
4355
|
"maxLength"?: number;
|
|
4356
|
+
"min"?: number;
|
|
4325
4357
|
"name": string;
|
|
4326
4358
|
"options"?: { label: string; value: string }[];
|
|
4327
4359
|
"placeholder"?: string;
|
|
4328
4360
|
"required"?: boolean;
|
|
4361
|
+
"step"?: number;
|
|
4329
4362
|
"type"?: string;
|
|
4330
4363
|
"value"?: string | number;
|
|
4331
4364
|
}
|
|
@@ -4370,6 +4403,10 @@ declare namespace LocalJSX {
|
|
|
4370
4403
|
* Optional link associated with the input (for help or docs).
|
|
4371
4404
|
*/
|
|
4372
4405
|
"link"?: { url: string; label: string };
|
|
4406
|
+
/**
|
|
4407
|
+
* Maximum value for number or range inputs
|
|
4408
|
+
*/
|
|
4409
|
+
"max"?: number;
|
|
4373
4410
|
/**
|
|
4374
4411
|
* The maximum allowed length for text input.
|
|
4375
4412
|
*/
|
|
@@ -4378,6 +4415,10 @@ declare namespace LocalJSX {
|
|
|
4378
4415
|
* Message shown below the input (e.g., additional info or validation message).
|
|
4379
4416
|
*/
|
|
4380
4417
|
"message"?: string;
|
|
4418
|
+
/**
|
|
4419
|
+
* Minimum value for number or range inputs
|
|
4420
|
+
*/
|
|
4421
|
+
"min"?: number;
|
|
4381
4422
|
/**
|
|
4382
4423
|
* The `name` attribute of the input element. Required for form submission.
|
|
4383
4424
|
*/
|
|
@@ -4389,11 +4430,11 @@ declare namespace LocalJSX {
|
|
|
4389
4430
|
/**
|
|
4390
4431
|
* Emits on blur or change event (e.g., selecting an option, leaving the field). Use `event.detail.value` to access the final value.
|
|
4391
4432
|
*/
|
|
4392
|
-
"onEdschange"?: (event: EdsInputFieldCustomEvent<{ value: string }>) => void;
|
|
4433
|
+
"onEdschange"?: (event: EdsInputFieldCustomEvent<{ value: string | boolean | string[] }>) => void;
|
|
4393
4434
|
/**
|
|
4394
4435
|
* Emits on every user input (key press, typing, etc.). Use `event.detail.value` to access the new value.
|
|
4395
4436
|
*/
|
|
4396
|
-
"onEdsinput"?: (event: EdsInputFieldCustomEvent<{ value: string }>) => void;
|
|
4437
|
+
"onEdsinput"?: (event: EdsInputFieldCustomEvent<{ value: string | boolean | string[] }>) => void;
|
|
4397
4438
|
/**
|
|
4398
4439
|
* Native `onInput` handler for React/Vue wrappers. Enables use without manually attaching DOM event listeners.
|
|
4399
4440
|
*/
|
|
@@ -4410,6 +4451,10 @@ declare namespace LocalJSX {
|
|
|
4410
4451
|
* If `true`, the input is required.
|
|
4411
4452
|
*/
|
|
4412
4453
|
"required"?: boolean;
|
|
4454
|
+
/**
|
|
4455
|
+
* Step value for number or range inputs
|
|
4456
|
+
*/
|
|
4457
|
+
"step"?: number;
|
|
4413
4458
|
/**
|
|
4414
4459
|
* Type of the input: e.g., `text`, `checkbox`, `select`, `range`, etc.
|
|
4415
4460
|
*/
|
|
@@ -5099,6 +5144,7 @@ declare namespace LocalJSX {
|
|
|
5099
5144
|
* The main message or text to be displayed in the toast.
|
|
5100
5145
|
*/
|
|
5101
5146
|
"message": string;
|
|
5147
|
+
"onToast"?: (event: EdsToastCustomEvent<{ visible: boolean; label: 'dismissed' | 'shown' }>) => void;
|
|
5102
5148
|
}
|
|
5103
5149
|
interface EdsToastManager {
|
|
5104
5150
|
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export declare function validateField(name: string, value: string | number, type: string, required: boolean, maxLength?: number): string[];
|
|
1
|
+
export declare function validateField(name: string, value: string | number, type: string, required: boolean, maxLength?: number, min?: number, max?: number): string[];
|
|
2
2
|
export declare function validateFieldGroup(name: string, required: boolean, formEl: HTMLFormElement): string[];
|
|
3
3
|
export declare function validateSingleBox(name: string, required: boolean, formEl: HTMLFormElement): string[];
|