@cscfi/csc-ui 1.3.3 → 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 +14 -6
- package/dist/cjs/c-autocomplete_34.cjs.entry.js.map +1 -1
- package/dist/cjs/c-data-table.cjs.entry.js +1 -0
- package/dist/cjs/c-data-table.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-checkbox/c-checkbox.js +7 -0
- package/dist/collection/components/c-checkbox/c-checkbox.js.map +1 -1
- package/dist/collection/components/c-data-table/c-data-table.js +1 -0
- package/dist/collection/components/c-data-table/c-data-table.js.map +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-checkbox2.js +8 -2
- package/dist/components/c-checkbox2.js.map +1 -1
- package/dist/components/c-data-table.js +1 -0
- package/dist/components/c-data-table.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-b6b10c87.entry.js +2 -0
- package/dist/csc-ui/p-b6b10c87.entry.js.map +1 -0
- package/dist/csc-ui/p-ed924115.entry.js +2 -0
- package/dist/csc-ui/p-ed924115.entry.js.map +1 -0
- package/dist/esm/c-autocomplete_34.entry.js +14 -6
- package/dist/esm/c-autocomplete_34.entry.js.map +1 -1
- package/dist/esm/c-data-table.entry.js +1 -0
- package/dist/esm/c-data-table.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-checkbox/c-checkbox.d.ts +1 -0
- 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-c40b6bd2.entry.js +0 -2
- package/dist/csc-ui/p-c40b6bd2.entry.js.map +0 -1
- package/dist/csc-ui/p-e7b91787.entry.js +0 -2
- package/dist/csc-ui/p-e7b91787.entry.js.map +0 -1
|
@@ -571,6 +571,10 @@ const CCheckbox = class {
|
|
|
571
571
|
onValidChange(valid) {
|
|
572
572
|
this._handleValidation(valid || this.valid);
|
|
573
573
|
}
|
|
574
|
+
onValueChange(value) {
|
|
575
|
+
this.checked = this.trueValue === value;
|
|
576
|
+
this.internals.setFormValue(this.checked ? this.trueValue.toString() : this.falseValue.toString());
|
|
577
|
+
}
|
|
574
578
|
handleKeyDown(event) {
|
|
575
579
|
if (['Space'].includes(event.code)) {
|
|
576
580
|
event.preventDefault();
|
|
@@ -632,7 +636,8 @@ const CCheckbox = class {
|
|
|
632
636
|
get el() { return index.getElement(this); }
|
|
633
637
|
static get watchers() { return {
|
|
634
638
|
"validation": ["onValidationMessageChange"],
|
|
635
|
-
"valid": ["onValidChange"]
|
|
639
|
+
"valid": ["onValidChange"],
|
|
640
|
+
"value": ["onValueChange"]
|
|
636
641
|
}; }
|
|
637
642
|
};
|
|
638
643
|
CCheckbox.style = cCheckboxCss;
|
|
@@ -1170,8 +1175,9 @@ const CInput = class {
|
|
|
1170
1175
|
_preventNonNumericalInput(event) {
|
|
1171
1176
|
if (this.type !== 'number')
|
|
1172
1177
|
return;
|
|
1173
|
-
if (!event.key.match(/^[0-9
|
|
1178
|
+
if (!event.key.match(/^[0-9,\.-]+$/)) {
|
|
1174
1179
|
event.preventDefault();
|
|
1180
|
+
}
|
|
1175
1181
|
}
|
|
1176
1182
|
_renderBorders() {
|
|
1177
1183
|
if (this.shadow)
|
|
@@ -2440,6 +2446,9 @@ const CTextField = class {
|
|
|
2440
2446
|
}
|
|
2441
2447
|
this._originalType = '';
|
|
2442
2448
|
this._handleChange = (event) => {
|
|
2449
|
+
if (this.type === 'number' && !event.target.value && event.key === '-') {
|
|
2450
|
+
return;
|
|
2451
|
+
}
|
|
2443
2452
|
this.value = this.trimWhitespace
|
|
2444
2453
|
? event.target.value.trim()
|
|
2445
2454
|
: event.target.value;
|
|
@@ -2470,14 +2479,13 @@ const CTextField = class {
|
|
|
2470
2479
|
this.max = null;
|
|
2471
2480
|
this.min = null;
|
|
2472
2481
|
this.name = undefined;
|
|
2473
|
-
this.number = false;
|
|
2474
2482
|
this.placeholder = undefined;
|
|
2475
2483
|
this.readonly = false;
|
|
2476
2484
|
this.required = false;
|
|
2477
2485
|
this.rows = 1;
|
|
2478
2486
|
this.shadow = false;
|
|
2479
2487
|
this.step = null;
|
|
2480
|
-
this.type =
|
|
2488
|
+
this.type = 'text';
|
|
2481
2489
|
this.valid = true;
|
|
2482
2490
|
this.validate = false;
|
|
2483
2491
|
this.validateOnBlur = false;
|
|
@@ -2519,11 +2527,11 @@ const CTextField = class {
|
|
|
2519
2527
|
disabled: this.disabled,
|
|
2520
2528
|
readonly: this.readonly,
|
|
2521
2529
|
value: this.value,
|
|
2522
|
-
|
|
2530
|
+
onkeyup: this._handleChange,
|
|
2523
2531
|
onChange: this._handleChange,
|
|
2524
2532
|
onBlur: this._handleBlur,
|
|
2525
2533
|
},
|
|
2526
|
-
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 })),
|
|
2527
2535
|
textArea: {
|
|
2528
2536
|
rows: this.rows,
|
|
2529
2537
|
},
|