@cscfi/csc-ui 2.2.4 → 2.2.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 -1
- 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-checkbox/c-checkbox.css +1 -1
- package/dist/collection/components/c-switch/c-switch.js +10 -0
- package/dist/collection/components/c-switch/c-switch.js.map +1 -1
- package/dist/components/c-checkbox2.js +1 -1
- package/dist/components/c-checkbox2.js.map +1 -1
- package/dist/components/c-switch.js +9 -0
- package/dist/components/c-switch.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-f6ca71df.entry.js +2 -0
- package/dist/csc-ui/{p-42587422.entry.js.map → p-f6ca71df.entry.js.map} +1 -1
- package/dist/esm/c-autocomplete_34.entry.js +8 -1
- 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-switch/c-switch.d.ts +1 -0
- package/package.json +1 -1
- package/dist/csc-ui/p-42587422.entry.js +0 -2
|
@@ -555,7 +555,7 @@ const CCardTitle = class {
|
|
|
555
555
|
};
|
|
556
556
|
CCardTitle.style = cCardTitleCss;
|
|
557
557
|
|
|
558
|
-
const cCheckboxCss = "html{box-sizing:border-box}body{margin:0}*,*:before,*:after{box-sizing:inherit;-webkit-tap-highlight-color:transparent}:host{font-family:var(--c-font-family)}::-ms-reveal{display:none}:host{--_c-checkbox-background-color-hover:var(--c-checkbox-background-color-hover, rgba(var(--c-primary-rgb), 0.1));--_c-checkbox-color-active:var(--c-checkbox-color-active, var(--_c-checkbox-color));--_c-checkbox-color-disabled:var(--c-checkbox-color-disabled, var(--c-tertiary-500));--_c-checkbox-color:var(--c-checkbox-color, var(--c-primary-600));--_c-checkbox-color-error:var(--c-error-600)}.c-checkbox{position:relative;width:fit-content}.c-checkbox__label-content{padding-top:
|
|
558
|
+
const cCheckboxCss = "html{box-sizing:border-box}body{margin:0}*,*:before,*:after{box-sizing:inherit;-webkit-tap-highlight-color:transparent}:host{font-family:var(--c-font-family)}::-ms-reveal{display:none}:host{--_c-checkbox-background-color-hover:var(--c-checkbox-background-color-hover, rgba(var(--c-primary-rgb), 0.1));--_c-checkbox-color-active:var(--c-checkbox-color-active, var(--_c-checkbox-color));--_c-checkbox-color-disabled:var(--c-checkbox-color-disabled, var(--c-tertiary-500));--_c-checkbox-color:var(--c-checkbox-color, var(--c-primary-600));--_c-checkbox-color-error:var(--c-error-600)}.c-checkbox{position:relative;width:fit-content}.c-checkbox__label-content{padding-top:12px;text-align:left;user-select:none}.c-checkbox__label-content span.required{color:var(--c-error-600)}.c-checkbox--disabled{--_c-checkbox-color:var(--_c-checkbox-color-disabled);--c-error-600:var(--_c-checkbox-color);--_c-checkbox-color-active:var(--_c-checkbox-color-disabled);color:var(--_c-checkbox-color);opacity:0.75}.c-checkbox--disabled .c-checkbox__label{cursor:default}.c-checkbox--error{--_c-checkbox-color:var(--c-error-600);--_c-checkbox-color-active:var(--_c-checkbox-color-error);color:var(--_c-checkbox-color-error)}.c-checkbox input:focus{outline:none}.c-checkbox input:focus+.c-checkbox__label .ripple{outline:2px var(--_c-checkbox-color-active) solid}@supports selector(:focus-visible){.c-checkbox input:focus+.c-checkbox__label .ripple{outline:none}}.c-checkbox input:focus-visible+.c-checkbox__label .ripple{outline:2px var(--_c-checkbox-color-active) solid}.c-checkbox:not(.c-checkbox--disabled) .ripple:hover{background-color:var(--_c-checkbox-background-color-hover)}.c-checkbox .visuallyhidden{border:0;clip:rect(1px, 1px, 1px, 1px);height:1px;overflow:hidden;padding:0;position:absolute;width:1px}.c-checkbox input:checked+.c-checkbox__label .ripple::before{background:var(--_c-checkbox-color-active);border-color:var(--_c-checkbox-color-active)}.c-checkbox input:checked+.c-checkbox__label .path{stroke:#ffffff;fill:#ffffff;stroke-dashoffset:0;stroke-width:13;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10}.c-checkbox__label{cursor:pointer;display:flex;gap:4px;position:relative;user-select:none}.c-checkbox__label svg{height:14px;left:14px;position:absolute;top:14px;width:14px}.c-checkbox__label--indeterminate .path{stroke-dasharray:0 !important;stroke-dashoffset:0 !important;stroke:transparent}.c-checkbox__label .ripple{border-radius:50%;color:var(--_c-checkbox-color-active);display:grid;height:42px;min-width:42px;overflow:hidden;place-content:center;position:relative;transform:translateZ(0);width:42px}.c-checkbox__label .ripple::before{border-radius:2px;border:2px solid var(--_c-checkbox-color);content:\"\";display:inline-block;height:18px;left:12px;position:absolute;top:12px;transition:all 0.25s ease-out;vertical-align:middle;width:18px}";
|
|
559
559
|
|
|
560
560
|
const CCheckbox = class {
|
|
561
561
|
constructor(hostRef) {
|
|
@@ -2371,6 +2371,10 @@ const CSwitch = class {
|
|
|
2371
2371
|
this.required = false;
|
|
2372
2372
|
this.hasLabel = false;
|
|
2373
2373
|
}
|
|
2374
|
+
onValueChange(value) {
|
|
2375
|
+
this.checked = this.trueValue === value;
|
|
2376
|
+
this.internals.setFormValue(this.checked ? this.trueValue.toString() : this.falseValue.toString());
|
|
2377
|
+
}
|
|
2374
2378
|
componentWillLoad() {
|
|
2375
2379
|
this.checked = this.checked || this.value === this.trueValue;
|
|
2376
2380
|
this.internals.setFormValue(this.checked ? this.trueValue.toString() : this.falseValue.toString());
|
|
@@ -2393,6 +2397,9 @@ const CSwitch = class {
|
|
|
2393
2397
|
}
|
|
2394
2398
|
static get formAssociated() { return true; }
|
|
2395
2399
|
get host() { return getElement(this); }
|
|
2400
|
+
static get watchers() { return {
|
|
2401
|
+
"value": ["onValueChange"]
|
|
2402
|
+
}; }
|
|
2396
2403
|
};
|
|
2397
2404
|
CSwitch.style = cSwitchCss;
|
|
2398
2405
|
|