@rivet-health/design-system 6.2.1 → 6.2.2
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/esm2020/lib/input/checkbox/checkbox.component.mjs +19 -3
- package/fesm2015/rivet-health-design-system.mjs +18 -2
- package/fesm2015/rivet-health-design-system.mjs.map +1 -1
- package/fesm2020/rivet-health-design-system.mjs +18 -2
- package/fesm2020/rivet-health-design-system.mjs.map +1 -1
- package/lib/input/checkbox/checkbox.component.d.ts +6 -2
- package/package.json +1 -1
|
@@ -1178,6 +1178,19 @@ class CheckboxComponent {
|
|
|
1178
1178
|
this.required = false;
|
|
1179
1179
|
this.valueChange = new EventEmitter();
|
|
1180
1180
|
}
|
|
1181
|
+
emit(v) {
|
|
1182
|
+
this.valueChange.emit(v);
|
|
1183
|
+
this.ensureSynchronizedState(this.value);
|
|
1184
|
+
}
|
|
1185
|
+
ensureSynchronizedState(v) {
|
|
1186
|
+
if (this.input) {
|
|
1187
|
+
this.input.nativeElement.checked = v;
|
|
1188
|
+
}
|
|
1189
|
+
}
|
|
1190
|
+
ngOnChanges(changes) {
|
|
1191
|
+
if ('value' in changes)
|
|
1192
|
+
this.ensureSynchronizedState(changes['value'].currentValue);
|
|
1193
|
+
}
|
|
1181
1194
|
isCheckboxOnly() {
|
|
1182
1195
|
return !this.label || this.label.nativeElement.childNodes.length === 1;
|
|
1183
1196
|
}
|
|
@@ -1189,10 +1202,10 @@ class CheckboxComponent {
|
|
|
1189
1202
|
}
|
|
1190
1203
|
}
|
|
1191
1204
|
CheckboxComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: CheckboxComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1192
|
-
CheckboxComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: CheckboxComponent, selector: "riv-checkbox", inputs: { name: "name", identifier: "identifier", value: "value", checkedColorToken: "checkedColorToken", indeterminateColorToken: "indeterminateColorToken", checkboxTooltip: "checkboxTooltip", indeterminate: "indeterminate", disabled: "disabled", required: "required" }, outputs: { valueChange: "valueChange" }, viewQueries: [{ propertyName: "label", first: true, predicate: ["label"], descendants: true, static: true }], ngImport: i0, template: "<label\n #label\n [class.disabled]=\"disabled\"\n [class.has-content]=\"!isCheckboxOnly()\"\n>\n <input\n #input\n type=\"checkbox\"\n [id]=\"identifier\"\n [name]=\"name\"\n [required]=\"required\"\n [disabled]=\"disabled\"\n [checked]=\"value\"\n [indeterminate]=\"indeterminate\"\n (change)=\"
|
|
1205
|
+
CheckboxComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: CheckboxComponent, selector: "riv-checkbox", inputs: { name: "name", identifier: "identifier", value: "value", checkedColorToken: "checkedColorToken", indeterminateColorToken: "indeterminateColorToken", checkboxTooltip: "checkboxTooltip", indeterminate: "indeterminate", disabled: "disabled", required: "required" }, outputs: { valueChange: "valueChange" }, viewQueries: [{ propertyName: "label", first: true, predicate: ["label"], descendants: true, static: true }, { propertyName: "input", first: true, predicate: ["input"], descendants: true, static: true }], usesOnChanges: true, ngImport: i0, template: "<label\n #label\n [class.disabled]=\"disabled\"\n [class.has-content]=\"!isCheckboxOnly()\"\n>\n <input\n #input\n type=\"checkbox\"\n [id]=\"identifier\"\n [name]=\"name\"\n [required]=\"required\"\n [disabled]=\"disabled\"\n [checked]=\"value\"\n [indeterminate]=\"indeterminate\"\n (change)=\"emit(!!input.checked)\"\n [style.--checked-background-color]=\"getCheckedBackgroundColor()\"\n [style.--indeterminate-background-color]=\"getIndeterminateBackgroundColor()\"\n [rivTooltip]=\"checkboxTooltip\"\n />\n <ng-content></ng-content>\n</label>\n", styles: [":host{display:inline-flex}label{flex-grow:1;display:inline-flex;gap:var(--size-small);align-items:center}label.has-content{padding:var(--size-xsmall) var(--size-small);border-radius:var(--border-radius-xsmall)}label.has-content:hover:not(.disabled){cursor:pointer;background-color:var(--surface-light-2)}input{--size: calc(var(--base-grid-size) * 4);margin:0;width:var(--size);height:var(--size);position:relative;cursor:pointer;flex-shrink:0}input:before{content:\"\";position:absolute;inset:0;border-radius:var(--border-radius-xsmall);background-color:var(--surface-light-0)}input:after{content:\"\";position:absolute;inset:0;border-radius:var(--border-radius-xsmall);border:var(--border-width) solid var(--border-light-blend);background-repeat:no-repeat;background-position:center center;background-color:var(--surface-light-0)}input:checked:after{background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggc3Ryb2tlPSJ3aGl0ZSIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0iYnV0dCIgZD0iTTMuNSw3LjUgbDMsMyBsNiwtNiIgZmlsbD0ibm9uZSIgLz48L3N2Zz4=);background-color:var(--checked-background-color)}input:indeterminate:after{background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHJlY3QgeD0iMyIgeT0iNyIgd2lkdGg9IjEwIiBoZWlnaHQ9IjIiIGZpbGw9IndoaXRlIiAvPjwvc3ZnPg==);background-color:var(--indeterminate-background-color)}input:disabled{cursor:default}input:disabled:after{background-color:var(--black-20)}input:disabled:checked:after,input:disabled:indeterminate:after{background-color:var(--black-40)}\n"], dependencies: [{ kind: "directive", type: TooltipDirective, selector: "[rivTooltip]", inputs: ["rivTooltip", "rivTooltipTheme", "rivTooltipMaxWidth", "rivTooltipPreferredPosition", "rivTooltipCloseDelay"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1193
1206
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: CheckboxComponent, decorators: [{
|
|
1194
1207
|
type: Component,
|
|
1195
|
-
args: [{ selector: 'riv-checkbox', changeDetection: ChangeDetectionStrategy.OnPush, template: "<label\n #label\n [class.disabled]=\"disabled\"\n [class.has-content]=\"!isCheckboxOnly()\"\n>\n <input\n #input\n type=\"checkbox\"\n [id]=\"identifier\"\n [name]=\"name\"\n [required]=\"required\"\n [disabled]=\"disabled\"\n [checked]=\"value\"\n [indeterminate]=\"indeterminate\"\n (change)=\"
|
|
1208
|
+
args: [{ selector: 'riv-checkbox', changeDetection: ChangeDetectionStrategy.OnPush, template: "<label\n #label\n [class.disabled]=\"disabled\"\n [class.has-content]=\"!isCheckboxOnly()\"\n>\n <input\n #input\n type=\"checkbox\"\n [id]=\"identifier\"\n [name]=\"name\"\n [required]=\"required\"\n [disabled]=\"disabled\"\n [checked]=\"value\"\n [indeterminate]=\"indeterminate\"\n (change)=\"emit(!!input.checked)\"\n [style.--checked-background-color]=\"getCheckedBackgroundColor()\"\n [style.--indeterminate-background-color]=\"getIndeterminateBackgroundColor()\"\n [rivTooltip]=\"checkboxTooltip\"\n />\n <ng-content></ng-content>\n</label>\n", styles: [":host{display:inline-flex}label{flex-grow:1;display:inline-flex;gap:var(--size-small);align-items:center}label.has-content{padding:var(--size-xsmall) var(--size-small);border-radius:var(--border-radius-xsmall)}label.has-content:hover:not(.disabled){cursor:pointer;background-color:var(--surface-light-2)}input{--size: calc(var(--base-grid-size) * 4);margin:0;width:var(--size);height:var(--size);position:relative;cursor:pointer;flex-shrink:0}input:before{content:\"\";position:absolute;inset:0;border-radius:var(--border-radius-xsmall);background-color:var(--surface-light-0)}input:after{content:\"\";position:absolute;inset:0;border-radius:var(--border-radius-xsmall);border:var(--border-width) solid var(--border-light-blend);background-repeat:no-repeat;background-position:center center;background-color:var(--surface-light-0)}input:checked:after{background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggc3Ryb2tlPSJ3aGl0ZSIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0iYnV0dCIgZD0iTTMuNSw3LjUgbDMsMyBsNiwtNiIgZmlsbD0ibm9uZSIgLz48L3N2Zz4=);background-color:var(--checked-background-color)}input:indeterminate:after{background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHJlY3QgeD0iMyIgeT0iNyIgd2lkdGg9IjEwIiBoZWlnaHQ9IjIiIGZpbGw9IndoaXRlIiAvPjwvc3ZnPg==);background-color:var(--indeterminate-background-color)}input:disabled{cursor:default}input:disabled:after{background-color:var(--black-20)}input:disabled:checked:after,input:disabled:indeterminate:after{background-color:var(--black-40)}\n"] }]
|
|
1196
1209
|
}], propDecorators: { name: [{
|
|
1197
1210
|
type: Input
|
|
1198
1211
|
}], identifier: [{
|
|
@@ -1216,6 +1229,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImpor
|
|
|
1216
1229
|
}], label: [{
|
|
1217
1230
|
type: ViewChild,
|
|
1218
1231
|
args: ['label', { static: true }]
|
|
1232
|
+
}], input: [{
|
|
1233
|
+
type: ViewChild,
|
|
1234
|
+
args: ['input', { static: true }]
|
|
1219
1235
|
}] } });
|
|
1220
1236
|
|
|
1221
1237
|
class CardCheckboxComponent extends CheckboxComponent {
|