@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
|
@@ -1171,8 +1171,9 @@ const CInput = class {
|
|
|
1171
1171
|
_preventNonNumericalInput(event) {
|
|
1172
1172
|
if (this.type !== 'number')
|
|
1173
1173
|
return;
|
|
1174
|
-
if (!event.key.match(/^[0-9
|
|
1174
|
+
if (!event.key.match(/^[0-9,\.-]+$/)) {
|
|
1175
1175
|
event.preventDefault();
|
|
1176
|
+
}
|
|
1176
1177
|
}
|
|
1177
1178
|
_renderBorders() {
|
|
1178
1179
|
if (this.shadow)
|
|
@@ -2441,6 +2442,9 @@ const CTextField = class {
|
|
|
2441
2442
|
}
|
|
2442
2443
|
this._originalType = '';
|
|
2443
2444
|
this._handleChange = (event) => {
|
|
2445
|
+
if (this.type === 'number' && !event.target.value && event.key === '-') {
|
|
2446
|
+
return;
|
|
2447
|
+
}
|
|
2444
2448
|
this.value = this.trimWhitespace
|
|
2445
2449
|
? event.target.value.trim()
|
|
2446
2450
|
: event.target.value;
|
|
@@ -2471,14 +2475,13 @@ const CTextField = class {
|
|
|
2471
2475
|
this.max = null;
|
|
2472
2476
|
this.min = null;
|
|
2473
2477
|
this.name = undefined;
|
|
2474
|
-
this.number = false;
|
|
2475
2478
|
this.placeholder = undefined;
|
|
2476
2479
|
this.readonly = false;
|
|
2477
2480
|
this.required = false;
|
|
2478
2481
|
this.rows = 1;
|
|
2479
2482
|
this.shadow = false;
|
|
2480
2483
|
this.step = null;
|
|
2481
|
-
this.type =
|
|
2484
|
+
this.type = 'text';
|
|
2482
2485
|
this.valid = true;
|
|
2483
2486
|
this.validate = false;
|
|
2484
2487
|
this.validateOnBlur = false;
|
|
@@ -2520,11 +2523,11 @@ const CTextField = class {
|
|
|
2520
2523
|
disabled: this.disabled,
|
|
2521
2524
|
readonly: this.readonly,
|
|
2522
2525
|
value: this.value,
|
|
2523
|
-
|
|
2526
|
+
onkeyup: this._handleChange,
|
|
2524
2527
|
onChange: this._handleChange,
|
|
2525
2528
|
onBlur: this._handleBlur,
|
|
2526
2529
|
},
|
|
2527
|
-
input: Object.assign(Object.assign(Object.assign({ type: this.
|
|
2530
|
+
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 })),
|
|
2528
2531
|
textArea: {
|
|
2529
2532
|
rows: this.rows,
|
|
2530
2533
|
},
|