@cscfi/csc-ui 1.3.4 → 1.3.5
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/c-autocomplete_34.cjs.entry.js +8 -5
- package/dist/cjs/c-autocomplete_34.cjs.entry.js.map +1 -1
- package/dist/cjs/csc-ui.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/components/c-input/c-input.js +2 -1
- package/dist/collection/components/c-input/c-input.js.map +1 -1
- package/dist/collection/components/c-text-field/c-text-field.js +8 -26
- package/dist/collection/components/c-text-field/c-text-field.js.map +1 -1
- package/dist/components/c-input2.js +2 -1
- package/dist/components/c-input2.js.map +1 -1
- package/dist/components/c-text-field.js +6 -5
- package/dist/components/c-text-field.js.map +1 -1
- package/dist/csc-ui/csc-ui.esm.js +1 -1
- package/dist/csc-ui/csc-ui.esm.js.map +1 -1
- package/dist/csc-ui/{p-d457b878.entry.js → p-b6b10c87.entry.js} +2 -2
- package/dist/csc-ui/p-b6b10c87.entry.js.map +1 -0
- package/dist/esm/c-autocomplete_34.entry.js +8 -5
- package/dist/esm/c-autocomplete_34.entry.js.map +1 -1
- package/dist/esm/csc-ui.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/types/components/c-text-field/c-text-field.d.ts +0 -1
- package/dist/types/components.d.ts +0 -10
- package/package.json +1 -1
- package/vscode-data.json +0 -4
- package/dist/csc-ui/p-d457b878.entry.js.map +0 -1
|
@@ -1175,8 +1175,9 @@ const CInput = class {
|
|
|
1175
1175
|
_preventNonNumericalInput(event) {
|
|
1176
1176
|
if (this.type !== 'number')
|
|
1177
1177
|
return;
|
|
1178
|
-
if (!event.key.match(/^[0-9
|
|
1178
|
+
if (!event.key.match(/^[0-9,\.-]+$/)) {
|
|
1179
1179
|
event.preventDefault();
|
|
1180
|
+
}
|
|
1180
1181
|
}
|
|
1181
1182
|
_renderBorders() {
|
|
1182
1183
|
if (this.shadow)
|
|
@@ -2445,6 +2446,9 @@ const CTextField = class {
|
|
|
2445
2446
|
}
|
|
2446
2447
|
this._originalType = '';
|
|
2447
2448
|
this._handleChange = (event) => {
|
|
2449
|
+
if (this.type === 'number' && !event.target.value && event.key === '-') {
|
|
2450
|
+
return;
|
|
2451
|
+
}
|
|
2448
2452
|
this.value = this.trimWhitespace
|
|
2449
2453
|
? event.target.value.trim()
|
|
2450
2454
|
: event.target.value;
|
|
@@ -2475,14 +2479,13 @@ const CTextField = class {
|
|
|
2475
2479
|
this.max = null;
|
|
2476
2480
|
this.min = null;
|
|
2477
2481
|
this.name = undefined;
|
|
2478
|
-
this.number = false;
|
|
2479
2482
|
this.placeholder = undefined;
|
|
2480
2483
|
this.readonly = false;
|
|
2481
2484
|
this.required = false;
|
|
2482
2485
|
this.rows = 1;
|
|
2483
2486
|
this.shadow = false;
|
|
2484
2487
|
this.step = null;
|
|
2485
|
-
this.type =
|
|
2488
|
+
this.type = 'text';
|
|
2486
2489
|
this.valid = true;
|
|
2487
2490
|
this.validate = false;
|
|
2488
2491
|
this.validateOnBlur = false;
|
|
@@ -2524,11 +2527,11 @@ const CTextField = class {
|
|
|
2524
2527
|
disabled: this.disabled,
|
|
2525
2528
|
readonly: this.readonly,
|
|
2526
2529
|
value: this.value,
|
|
2527
|
-
|
|
2530
|
+
onkeyup: this._handleChange,
|
|
2528
2531
|
onChange: this._handleChange,
|
|
2529
2532
|
onBlur: this._handleBlur,
|
|
2530
2533
|
},
|
|
2531
|
-
input: Object.assign(Object.assign(Object.assign({ type: this.
|
|
2534
|
+
input: Object.assign(Object.assign(Object.assign({ type: this.type, min: this.min, max: this.max, step: this.step }, (!!this.autocomplete && { autocomplete: this.autocomplete })), (!!this.autocapitalize && { autocapitalize: this.autocapitalize })), (!!this.autocorrect && { autocorrect: this.autocorrect })),
|
|
2532
2535
|
textArea: {
|
|
2533
2536
|
rows: this.rows,
|
|
2534
2537
|
},
|