cax-design-system 1.2.13 → 2.0.0
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/README.md +1 -2
- package/badge/badge.d.ts +5 -7
- package/badge/badge.directive.d.ts +5 -5
- package/calendar/calendar.d.ts +1 -0
- package/checkbox/checkbox.d.ts +5 -1
- package/chip/chip.d.ts +4 -3
- package/colorpicker/colorpicker.d.ts +1 -8
- package/colorpicker/colorpicker.module.d.ts +9 -0
- package/colorpicker/public_api.d.ts +1 -0
- package/esm2022/avatar/avatar.mjs +3 -3
- package/esm2022/badge/badge.directive.mjs +15 -33
- package/esm2022/badge/badge.mjs +5 -6
- package/esm2022/calendar/calendar.mjs +22 -12
- package/esm2022/checkbox/checkbox.mjs +20 -5
- package/esm2022/chip/chip.mjs +11 -7
- package/esm2022/colorpicker/colorpicker.mjs +6 -120
- package/esm2022/colorpicker/colorpicker.module.mjs +19 -0
- package/esm2022/colorpicker/public_api.mjs +2 -1
- package/esm2022/confirmdialog/confirmdialog.mjs +2 -2
- package/esm2022/navigation/navigation.mjs +5 -14
- package/esm2022/radiobutton/radiobutton.mjs +10 -3
- package/esm2022/table/components/table-checkbox/table-checkbox.mjs +5 -4
- package/esm2022/table/components/table-header-checkbox/table-header-checkbox.mjs +3 -3
- package/esm2022/table/directives/cell-highlight.directive.mjs +42 -0
- package/esm2022/table/directives/dynamic-column-width.directive.mjs +34 -0
- package/esm2022/table/public_api.mjs +3 -1
- package/esm2022/table/table.mjs +20 -4
- package/esm2022/table/table.module.mjs +15 -5
- package/esm2022/tag/tag.mjs +3 -3
- package/fesm2022/cax-design-system-avatar.mjs +2 -2
- package/fesm2022/cax-design-system-avatar.mjs.map +1 -1
- package/fesm2022/cax-design-system-badge.mjs +18 -37
- package/fesm2022/cax-design-system-badge.mjs.map +1 -1
- package/fesm2022/cax-design-system-calendar.mjs +21 -11
- package/fesm2022/cax-design-system-calendar.mjs.map +1 -1
- package/fesm2022/cax-design-system-checkbox.mjs +19 -4
- package/fesm2022/cax-design-system-checkbox.mjs.map +1 -1
- package/fesm2022/cax-design-system-chip.mjs +10 -6
- package/fesm2022/cax-design-system-chip.mjs.map +1 -1
- package/fesm2022/cax-design-system-colorpicker.mjs +5 -104
- package/fesm2022/cax-design-system-colorpicker.mjs.map +1 -1
- package/fesm2022/cax-design-system-confirmdialog.mjs +1 -1
- package/fesm2022/cax-design-system-confirmdialog.mjs.map +1 -1
- package/fesm2022/cax-design-system-navigation.mjs +4 -13
- package/fesm2022/cax-design-system-navigation.mjs.map +1 -1
- package/fesm2022/cax-design-system-radiobutton.mjs +9 -2
- package/fesm2022/cax-design-system-radiobutton.mjs.map +1 -1
- package/fesm2022/cax-design-system-table.mjs +110 -13
- package/fesm2022/cax-design-system-table.mjs.map +1 -1
- package/fesm2022/cax-design-system-tag.mjs +2 -2
- package/fesm2022/cax-design-system-tag.mjs.map +1 -1
- package/navigation/navigation.d.ts +2 -6
- package/package.json +79 -79
- package/radiobutton/radiobutton.d.ts +6 -1
- package/resources/cax.min.scss +1 -1
- package/resources/cax.scss +9602 -6
- package/resources/components/avatar/avatar.scss +2 -1
- package/resources/components/calendar/calendar.scss +9 -4
- package/resources/components/chip/chip.scss +0 -57
- package/resources/components/colorpicker/colorpicker-images.css +2 -2
- package/resources/components/colorpicker/{colorpicker.css → colorpicker.scss} +19 -20
- package/resources/components/navigation/navigation.scss +2 -26
- package/resources/components/radiobutton/radiobutton.scss +0 -4
- package/resources/components/table/table.scss +92 -0
- package/resources/components/tag/tag.scss +9 -3
- package/resources/styles/colors.scss +397 -0
- package/resources/styles/shadow-blur.scss +22 -0
- package/resources/styles/space-radius-border.scss +49 -0
- package/resources/styles/typography.scss +135 -0
- package/table/components/table-checkbox/table-checkbox.d.ts +1 -0
- package/table/directives/cell-highlight.directive.d.ts +14 -0
- package/table/directives/dynamic-column-width.directive.d.ts +12 -0
- package/table/public_api.d.ts +2 -0
- package/table/table.d.ts +10 -1
- package/table/table.module.d.ts +5 -3
- package/resources/themes/cax-theme.scss +0 -9332
|
@@ -22,6 +22,7 @@ class Checkbox {
|
|
|
22
22
|
cd;
|
|
23
23
|
injector;
|
|
24
24
|
config;
|
|
25
|
+
size = 'md';
|
|
25
26
|
/**
|
|
26
27
|
* Value of the checkbox.
|
|
27
28
|
* @group Props
|
|
@@ -127,6 +128,9 @@ class Checkbox {
|
|
|
127
128
|
* @param {CheckboxChangeEvent} event - Custom value change event.
|
|
128
129
|
* @group Emits
|
|
129
130
|
*/
|
|
131
|
+
indeterminate = false;
|
|
132
|
+
// New event emitter for indeterminate change
|
|
133
|
+
indeterminateChange = new EventEmitter();
|
|
130
134
|
onChange = new EventEmitter();
|
|
131
135
|
/**
|
|
132
136
|
* Callback to invoke when the receives focus.
|
|
@@ -192,6 +196,10 @@ class Checkbox {
|
|
|
192
196
|
}
|
|
193
197
|
}
|
|
194
198
|
else {
|
|
199
|
+
if (this.indeterminate) {
|
|
200
|
+
this.indeterminate = false; // Reset indeterminate state on user interaction
|
|
201
|
+
this.indeterminateChange.emit(this.indeterminate);
|
|
202
|
+
}
|
|
195
203
|
newModelValue = this.checked() ? this.falseValue : this.trueValue;
|
|
196
204
|
this.model = newModelValue;
|
|
197
205
|
this.onModelChange(newModelValue);
|
|
@@ -232,17 +240,19 @@ class Checkbox {
|
|
|
232
240
|
});
|
|
233
241
|
}
|
|
234
242
|
checked() {
|
|
235
|
-
return this.binary ? this.model === this.trueValue : ObjectUtils.contains(this.value, this.model);
|
|
243
|
+
return !this.indeterminate && (this.binary ? this.model === this.trueValue : ObjectUtils.contains(this.value, this.model));
|
|
236
244
|
}
|
|
237
245
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.9", ngImport: i0, type: Checkbox, deps: [{ token: i0.ChangeDetectorRef }, { token: i0.Injector }, { token: i1.caxConfig }], target: i0.ɵɵFactoryTarget.Component });
|
|
238
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "16.1.0", version: "18.2.9", type: Checkbox, selector: "cax-checkbox", inputs: { value: "value", name: "name", disabled: ["disabled", "disabled", booleanAttribute], binary: ["binary", "binary", booleanAttribute], label: "label", ariaLabelledBy: "ariaLabelledBy", ariaLabel: "ariaLabel", tabindex: ["tabindex", "tabindex", numberAttribute], inputId: "inputId", style: "style", styleClass: "styleClass", labelStyleClass: "labelStyleClass", formControl: "formControl", checkboxIcon: "checkboxIcon", readonly: ["readonly", "readonly", booleanAttribute], required: ["required", "required", booleanAttribute], autofocus: ["autofocus", "autofocus", booleanAttribute], trueValue: "trueValue", falseValue: "falseValue", variant: "variant", model: "model" }, outputs: { onChange: "onChange", onFocus: "onFocus", onBlur: "onBlur" }, host: { classAttribute: "cax-element" }, providers: [CHECKBOX_VALUE_ACCESSOR], queries: [{ propertyName: "templates", predicate: CaxTemplate }], viewQueries: [{ propertyName: "inputViewChild", first: true, predicate: ["input"], descendants: true }], ngImport: i0, template: "<div\r\n [ngStyle]=\"style\"\r\n [ngClass]=\"{\r\n 'cax-checkbox cax-component': true,\r\n 'cax-checkbox-checked': checked(),\r\n 'cax-checkbox-disabled': disabled,\r\n 'cax-checkbox-focused': focused,\r\n 'cax-variant-filled': variant === 'filled' || config.inputStyle() === 'filled'\r\n}\"\r\n [class]=\"styleClass\"\r\n [attr.data-pc-name]=\"'checkbox'\"\r\n [attr.data-pc-section]=\"'root'\"\r\n>\r\n <div class=\"cax-hidden-accessible\" [attr.data-pc-section]=\"'hiddenInputWrapper'\" [attr.data-cax-hidden-accessible]=\"true\">\r\n <input\r\n #input\r\n [attr.id]=\"inputId\"\r\n type=\"checkbox\"\r\n [value]=\"value\"\r\n [attr.name]=\"name\"\r\n [checked]=\"checked()\"\r\n [attr.tabindex]=\"tabindex\"\r\n [disabled]=\"disabled\"\r\n [readonly]=\"readonly\"\r\n [attr.required]=\"required\"\r\n [attr.aria-labelledby]=\"ariaLabelledBy\"\r\n [attr.aria-label]=\"ariaLabel\"\r\n [attr.aria-checked]=\"checked()\"\r\n (change)=\"handleChange($event)\"\r\n (focus)=\"onInputFocus($event)\"\r\n (blur)=\"onInputBlur($event)\"\r\n [attr.data-pc-section]=\"'hiddenInput'\"\r\n caxAutoFocus\r\n [autofocus]=\"autofocus\"\r\n />\r\n </div>\r\n <div\r\n class=\"cax-checkbox-box\"\r\n [ngClass]=\"{ 'cax-highlight': checked(), 'cax-disabled': disabled, 'cax-focus': focused }\"\r\n (click)=\"onClick($event, input, true)\"\r\n [attr.data-cax-highlight]=\"checked()\"\r\n [attr.data-cax-disabled]=\"disabled\"\r\n [attr.data-cax-focused]=\"focused\"\r\n [attr.data-pc-section]=\"'input'\"\r\n >\r\n <ng-container *ngIf=\"checked()\">\r\n <ng-container *ngIf=\"!checkboxIconTemplate\">\r\n <span *ngIf=\"checkboxIcon\" class=\"cax-checkbox-icon\" [ngClass]=\"checkboxIcon\" [attr.data-pc-section]=\"'icon'\"></span>\r\n <!-- <CheckIcon *ngIf=\"!checkboxIcon\" [styleClass]=\"'cax-checkbox-icon'\" [attr.data-pc-section]=\"'icon'\" /> -->\r\n <ng-container *ngIf=\"!checkboxIcon\" >\r\n <svg\r\n width=\"11\"\r\n height=\"10\"\r\n viewBox=\"0 0 14 14\"\r\n fill=\"none\"\r\n xmlns=\"http://www.w3.org/2000/svg\"\r\n [attr.aria-label]=\"ariaLabel\"\r\n [attr.aria-hidden]=\"ariaHidden\"\r\n [attr.role]=\"role\"\r\n >\r\n <path\r\n d=\"M4.86199 11.5948C4.78717 11.5923 4.71366 11.5745 4.64596 11.5426C4.57826 11.5107 4.51779 11.4652 4.46827 11.4091L0.753985 7.69483C0.683167 7.64891 0.623706 7.58751 0.580092 7.51525C0.536478 7.44299 0.509851 7.36177 0.502221 7.27771C0.49459 7.19366 0.506156 7.10897 0.536046 7.03004C0.565935 6.95111 0.613367 6.88 0.674759 6.82208C0.736151 6.76416 0.8099 6.72095 0.890436 6.69571C0.970973 6.67046 1.05619 6.66385 1.13966 6.67635C1.22313 6.68886 1.30266 6.72017 1.37226 6.76792C1.44186 6.81567 1.4997 6.8786 1.54141 6.95197L4.86199 10.2503L12.6397 2.49483C12.7444 2.42694 12.8689 2.39617 12.9932 2.40745C13.1174 2.41873 13.2343 2.47141 13.3251 2.55705C13.4159 2.64268 13.4753 2.75632 13.4938 2.87973C13.5123 3.00315 13.4888 3.1292 13.4271 3.23768L5.2557 11.4091C5.20618 11.4652 5.14571 11.5107 5.07801 11.5426C5.01031 11.5745 4.9368 11.5923 4.86199 11.5948Z\"\r\n fill=\"currentColor\"\r\n stroke=\"currentColor\"\r\n stroke-width=\"1\"\r\n />\r\n </svg>\r\n\r\n </ng-container>\r\n </ng-container>\r\n <span *ngIf=\"checkboxIconTemplate\" class=\"cax-checkbox-icon\" [attr.data-pc-section]=\"'icon'\">\r\n <ng-template *ngTemplateOutlet=\"checkboxIconTemplate\"></ng-template>\r\n </span>\r\n </ng-container>\r\n </div>\r\n</div>\r\n<label\r\n (click)=\"onClick($event, input, true)\"\r\n [class]=\"labelStyleClass\"\r\n [ngClass]=\"{
|
|
246
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "16.1.0", version: "18.2.9", type: Checkbox, selector: "cax-checkbox", inputs: { size: "size", value: "value", name: "name", disabled: ["disabled", "disabled", booleanAttribute], binary: ["binary", "binary", booleanAttribute], label: "label", ariaLabelledBy: "ariaLabelledBy", ariaLabel: "ariaLabel", tabindex: ["tabindex", "tabindex", numberAttribute], inputId: "inputId", style: "style", styleClass: "styleClass", labelStyleClass: "labelStyleClass", formControl: "formControl", checkboxIcon: "checkboxIcon", readonly: ["readonly", "readonly", booleanAttribute], required: ["required", "required", booleanAttribute], autofocus: ["autofocus", "autofocus", booleanAttribute], trueValue: "trueValue", falseValue: "falseValue", variant: "variant", indeterminate: ["indeterminate", "indeterminate", booleanAttribute], model: "model" }, outputs: { indeterminateChange: "indeterminateChange", onChange: "onChange", onFocus: "onFocus", onBlur: "onBlur" }, host: { classAttribute: "cax-element" }, providers: [CHECKBOX_VALUE_ACCESSOR], queries: [{ propertyName: "templates", predicate: CaxTemplate }], viewQueries: [{ propertyName: "inputViewChild", first: true, predicate: ["input"], descendants: true }], ngImport: i0, template: "<div\r\n [ngStyle]=\"style\"\r\n [ngClass]=\"{\r\n 'cax-checkbox cax-component': true,\r\n 'cax-checkbox-checked': checked(),\r\n 'cax-checkbox-indeterminate': indeterminate,\r\n 'cax-checkbox-disabled': disabled,\r\n 'cax-checkbox-focused': focused,\r\n 'cax-variant-filled': variant === 'filled' || config.inputStyle() === 'filled'\r\n}\"\r\n [class]=\"styleClass\"\r\n [attr.data-pc-name]=\"'checkbox'\"\r\n [attr.data-pc-section]=\"'root'\"\r\n>\r\n <div class=\"cax-hidden-accessible\" [attr.data-pc-section]=\"'hiddenInputWrapper'\" [attr.data-cax-hidden-accessible]=\"true\">\r\n <input\r\n #input\r\n [attr.id]=\"inputId\"\r\n type=\"checkbox\"\r\n [value]=\"value\"\r\n [attr.name]=\"name\"\r\n [checked]=\"checked()\"\r\n [attr.indeterminate]=\"indeterminate ? 'true' : null\"\r\n [attr.tabindex]=\"tabindex\"\r\n [disabled]=\"disabled\"\r\n [readonly]=\"readonly\"\r\n [attr.required]=\"required\"\r\n [attr.aria-labelledby]=\"ariaLabelledBy\"\r\n [attr.aria-label]=\"ariaLabel\"\r\n [attr.aria-checked]=\"checked()\"\r\n (change)=\"handleChange($event)\"\r\n (focus)=\"onInputFocus($event)\"\r\n (blur)=\"onInputBlur($event)\"\r\n [attr.data-pc-section]=\"'hiddenInput'\"\r\n caxAutoFocus\r\n [autofocus]=\"autofocus\"\r\n />\r\n </div>\r\n <div\r\n class=\"cax-checkbox-box\"\r\n [ngClass]=\"{ 'cax-highlight': checked(), 'cax-disabled': disabled, 'cax-focus': focused,\r\n 'cax-checkbox-indeterminate': indeterminate, \r\n 'cax-checkbox-sm': size == 'sm',\r\n 'cax-checkbox-md': size == 'md',\r\n 'cax-checkbox-lg': size == 'lg', }\"\r\n (click)=\"onClick($event, input, true)\"\r\n [attr.data-cax-highlight]=\"checked()\"\r\n [attr.data-cax-disabled]=\"disabled\"\r\n [attr.data-cax-focused]=\"focused\"\r\n [attr.data-pc-section]=\"'input'\"\r\n >\r\n <ng-container *ngIf=\"indeterminate\">\r\n <span class=\"cax cax-leaf cax-checkbox-leaf-indeterminate cax-checkbox-icon\"></span> \r\n </ng-container>\r\n <ng-container *ngIf=\"checked() && !indeterminate\">\r\n <ng-container *ngIf=\"!checkboxIconTemplate\">\r\n <span *ngIf=\"checkboxIcon\" class=\"cax-checkbox-icon\" [ngClass]=\"checkboxIcon\" [attr.data-pc-section]=\"'icon'\"></span>\r\n <!-- <CheckIcon *ngIf=\"!checkboxIcon\" [styleClass]=\"'cax-checkbox-icon'\" [attr.data-pc-section]=\"'icon'\" /> -->\r\n <ng-container *ngIf=\"!checkboxIcon\" >\r\n <svg\r\n width=\"11\"\r\n height=\"10\"\r\n viewBox=\"0 0 14 14\"\r\n fill=\"none\"\r\n xmlns=\"http://www.w3.org/2000/svg\"\r\n [attr.aria-label]=\"ariaLabel\"\r\n [attr.aria-hidden]=\"ariaHidden\"\r\n [attr.role]=\"role\"\r\n >\r\n <path\r\n d=\"M4.86199 11.5948C4.78717 11.5923 4.71366 11.5745 4.64596 11.5426C4.57826 11.5107 4.51779 11.4652 4.46827 11.4091L0.753985 7.69483C0.683167 7.64891 0.623706 7.58751 0.580092 7.51525C0.536478 7.44299 0.509851 7.36177 0.502221 7.27771C0.49459 7.19366 0.506156 7.10897 0.536046 7.03004C0.565935 6.95111 0.613367 6.88 0.674759 6.82208C0.736151 6.76416 0.8099 6.72095 0.890436 6.69571C0.970973 6.67046 1.05619 6.66385 1.13966 6.67635C1.22313 6.68886 1.30266 6.72017 1.37226 6.76792C1.44186 6.81567 1.4997 6.8786 1.54141 6.95197L4.86199 10.2503L12.6397 2.49483C12.7444 2.42694 12.8689 2.39617 12.9932 2.40745C13.1174 2.41873 13.2343 2.47141 13.3251 2.55705C13.4159 2.64268 13.4753 2.75632 13.4938 2.87973C13.5123 3.00315 13.4888 3.1292 13.4271 3.23768L5.2557 11.4091C5.20618 11.4652 5.14571 11.5107 5.07801 11.5426C5.01031 11.5745 4.9368 11.5923 4.86199 11.5948Z\"\r\n fill=\"currentColor\"\r\n stroke=\"currentColor\"\r\n stroke-width=\"1\"\r\n />\r\n </svg>\r\n\r\n </ng-container>\r\n </ng-container>\r\n <span *ngIf=\"checkboxIconTemplate\" class=\"cax-checkbox-icon\" [attr.data-pc-section]=\"'icon'\">\r\n <ng-template *ngTemplateOutlet=\"checkboxIconTemplate\"></ng-template>\r\n </span>\r\n </ng-container>\r\n </div>\r\n</div>\r\n<label\r\n (click)=\"onClick($event, input, true)\"\r\n [class]=\"labelStyleClass\"\r\n [ngClass]=\"{\r\n 'cax-checkbox-label': true, \r\n 'cax-checkbox-label-active': checked(), \r\n 'cax-disabled': disabled, \r\n 'cax-checkbox-label-focus': focused,\r\n 'cax-checkbox-label-sm': size === 'sm',\r\n 'cax-checkbox-label-md': size === 'md',\r\n 'cax-checkbox-label-lg': size === 'lg'\r\n }\"\r\n *ngIf=\"label\"\r\n [attr.for]=\"inputId\"\r\n [attr.data-pc-section]=\"'label'\"\r\n>\r\n {{ label }}</label\r\n>\r\n", styles: ["@layer cax{.cax-checkbox{display:inline-flex;cursor:pointer;-webkit-user-select:none;user-select:none;vertical-align:bottom;position:relative}.cax-checkbox-disabled{cursor:default!important;pointer-events:none}.cax-checkbox-box{display:flex;justify-content:center;align-items:center}cax-checkbox{display:inline-flex;vertical-align:bottom;align-items:center}.cax-checkbox-label{line-height:1}}\n"], dependencies: [{ kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i2.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: i3.AutoFocus, selector: "[caxAutoFocus]", inputs: ["autofocus"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
239
247
|
}
|
|
240
248
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.9", ngImport: i0, type: Checkbox, decorators: [{
|
|
241
249
|
type: Component,
|
|
242
250
|
args: [{ selector: 'cax-checkbox', providers: [CHECKBOX_VALUE_ACCESSOR], changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, host: {
|
|
243
251
|
class: 'cax-element'
|
|
244
|
-
}, template: "<div\r\n [ngStyle]=\"style\"\r\n [ngClass]=\"{\r\n 'cax-checkbox cax-component': true,\r\n 'cax-checkbox-checked': checked(),\r\n 'cax-checkbox-disabled': disabled,\r\n 'cax-checkbox-focused': focused,\r\n 'cax-variant-filled': variant === 'filled' || config.inputStyle() === 'filled'\r\n}\"\r\n [class]=\"styleClass\"\r\n [attr.data-pc-name]=\"'checkbox'\"\r\n [attr.data-pc-section]=\"'root'\"\r\n>\r\n <div class=\"cax-hidden-accessible\" [attr.data-pc-section]=\"'hiddenInputWrapper'\" [attr.data-cax-hidden-accessible]=\"true\">\r\n <input\r\n #input\r\n [attr.id]=\"inputId\"\r\n type=\"checkbox\"\r\n [value]=\"value\"\r\n [attr.name]=\"name\"\r\n [checked]=\"checked()\"\r\n [attr.tabindex]=\"tabindex\"\r\n [disabled]=\"disabled\"\r\n [readonly]=\"readonly\"\r\n [attr.required]=\"required\"\r\n [attr.aria-labelledby]=\"ariaLabelledBy\"\r\n [attr.aria-label]=\"ariaLabel\"\r\n [attr.aria-checked]=\"checked()\"\r\n (change)=\"handleChange($event)\"\r\n (focus)=\"onInputFocus($event)\"\r\n (blur)=\"onInputBlur($event)\"\r\n [attr.data-pc-section]=\"'hiddenInput'\"\r\n caxAutoFocus\r\n [autofocus]=\"autofocus\"\r\n />\r\n </div>\r\n <div\r\n class=\"cax-checkbox-box\"\r\n [ngClass]=\"{ 'cax-highlight': checked(), 'cax-disabled': disabled, 'cax-focus': focused }\"\r\n (click)=\"onClick($event, input, true)\"\r\n [attr.data-cax-highlight]=\"checked()\"\r\n [attr.data-cax-disabled]=\"disabled\"\r\n [attr.data-cax-focused]=\"focused\"\r\n [attr.data-pc-section]=\"'input'\"\r\n >\r\n <ng-container *ngIf=\"checked()\">\r\n <ng-container *ngIf=\"!checkboxIconTemplate\">\r\n <span *ngIf=\"checkboxIcon\" class=\"cax-checkbox-icon\" [ngClass]=\"checkboxIcon\" [attr.data-pc-section]=\"'icon'\"></span>\r\n <!-- <CheckIcon *ngIf=\"!checkboxIcon\" [styleClass]=\"'cax-checkbox-icon'\" [attr.data-pc-section]=\"'icon'\" /> -->\r\n <ng-container *ngIf=\"!checkboxIcon\" >\r\n <svg\r\n width=\"11\"\r\n height=\"10\"\r\n viewBox=\"0 0 14 14\"\r\n fill=\"none\"\r\n xmlns=\"http://www.w3.org/2000/svg\"\r\n [attr.aria-label]=\"ariaLabel\"\r\n [attr.aria-hidden]=\"ariaHidden\"\r\n [attr.role]=\"role\"\r\n >\r\n <path\r\n d=\"M4.86199 11.5948C4.78717 11.5923 4.71366 11.5745 4.64596 11.5426C4.57826 11.5107 4.51779 11.4652 4.46827 11.4091L0.753985 7.69483C0.683167 7.64891 0.623706 7.58751 0.580092 7.51525C0.536478 7.44299 0.509851 7.36177 0.502221 7.27771C0.49459 7.19366 0.506156 7.10897 0.536046 7.03004C0.565935 6.95111 0.613367 6.88 0.674759 6.82208C0.736151 6.76416 0.8099 6.72095 0.890436 6.69571C0.970973 6.67046 1.05619 6.66385 1.13966 6.67635C1.22313 6.68886 1.30266 6.72017 1.37226 6.76792C1.44186 6.81567 1.4997 6.8786 1.54141 6.95197L4.86199 10.2503L12.6397 2.49483C12.7444 2.42694 12.8689 2.39617 12.9932 2.40745C13.1174 2.41873 13.2343 2.47141 13.3251 2.55705C13.4159 2.64268 13.4753 2.75632 13.4938 2.87973C13.5123 3.00315 13.4888 3.1292 13.4271 3.23768L5.2557 11.4091C5.20618 11.4652 5.14571 11.5107 5.07801 11.5426C5.01031 11.5745 4.9368 11.5923 4.86199 11.5948Z\"\r\n fill=\"currentColor\"\r\n stroke=\"currentColor\"\r\n stroke-width=\"1\"\r\n />\r\n </svg>\r\n\r\n </ng-container>\r\n </ng-container>\r\n <span *ngIf=\"checkboxIconTemplate\" class=\"cax-checkbox-icon\" [attr.data-pc-section]=\"'icon'\">\r\n <ng-template *ngTemplateOutlet=\"checkboxIconTemplate\"></ng-template>\r\n </span>\r\n </ng-container>\r\n </div>\r\n</div>\r\n<label\r\n (click)=\"onClick($event, input, true)\"\r\n [class]=\"labelStyleClass\"\r\n [ngClass]=\"{
|
|
245
|
-
}], ctorParameters: () => [{ type: i0.ChangeDetectorRef }, { type: i0.Injector }, { type: i1.caxConfig }], propDecorators: {
|
|
252
|
+
}, template: "<div\r\n [ngStyle]=\"style\"\r\n [ngClass]=\"{\r\n 'cax-checkbox cax-component': true,\r\n 'cax-checkbox-checked': checked(),\r\n 'cax-checkbox-indeterminate': indeterminate,\r\n 'cax-checkbox-disabled': disabled,\r\n 'cax-checkbox-focused': focused,\r\n 'cax-variant-filled': variant === 'filled' || config.inputStyle() === 'filled'\r\n}\"\r\n [class]=\"styleClass\"\r\n [attr.data-pc-name]=\"'checkbox'\"\r\n [attr.data-pc-section]=\"'root'\"\r\n>\r\n <div class=\"cax-hidden-accessible\" [attr.data-pc-section]=\"'hiddenInputWrapper'\" [attr.data-cax-hidden-accessible]=\"true\">\r\n <input\r\n #input\r\n [attr.id]=\"inputId\"\r\n type=\"checkbox\"\r\n [value]=\"value\"\r\n [attr.name]=\"name\"\r\n [checked]=\"checked()\"\r\n [attr.indeterminate]=\"indeterminate ? 'true' : null\"\r\n [attr.tabindex]=\"tabindex\"\r\n [disabled]=\"disabled\"\r\n [readonly]=\"readonly\"\r\n [attr.required]=\"required\"\r\n [attr.aria-labelledby]=\"ariaLabelledBy\"\r\n [attr.aria-label]=\"ariaLabel\"\r\n [attr.aria-checked]=\"checked()\"\r\n (change)=\"handleChange($event)\"\r\n (focus)=\"onInputFocus($event)\"\r\n (blur)=\"onInputBlur($event)\"\r\n [attr.data-pc-section]=\"'hiddenInput'\"\r\n caxAutoFocus\r\n [autofocus]=\"autofocus\"\r\n />\r\n </div>\r\n <div\r\n class=\"cax-checkbox-box\"\r\n [ngClass]=\"{ 'cax-highlight': checked(), 'cax-disabled': disabled, 'cax-focus': focused,\r\n 'cax-checkbox-indeterminate': indeterminate, \r\n 'cax-checkbox-sm': size == 'sm',\r\n 'cax-checkbox-md': size == 'md',\r\n 'cax-checkbox-lg': size == 'lg', }\"\r\n (click)=\"onClick($event, input, true)\"\r\n [attr.data-cax-highlight]=\"checked()\"\r\n [attr.data-cax-disabled]=\"disabled\"\r\n [attr.data-cax-focused]=\"focused\"\r\n [attr.data-pc-section]=\"'input'\"\r\n >\r\n <ng-container *ngIf=\"indeterminate\">\r\n <span class=\"cax cax-leaf cax-checkbox-leaf-indeterminate cax-checkbox-icon\"></span> \r\n </ng-container>\r\n <ng-container *ngIf=\"checked() && !indeterminate\">\r\n <ng-container *ngIf=\"!checkboxIconTemplate\">\r\n <span *ngIf=\"checkboxIcon\" class=\"cax-checkbox-icon\" [ngClass]=\"checkboxIcon\" [attr.data-pc-section]=\"'icon'\"></span>\r\n <!-- <CheckIcon *ngIf=\"!checkboxIcon\" [styleClass]=\"'cax-checkbox-icon'\" [attr.data-pc-section]=\"'icon'\" /> -->\r\n <ng-container *ngIf=\"!checkboxIcon\" >\r\n <svg\r\n width=\"11\"\r\n height=\"10\"\r\n viewBox=\"0 0 14 14\"\r\n fill=\"none\"\r\n xmlns=\"http://www.w3.org/2000/svg\"\r\n [attr.aria-label]=\"ariaLabel\"\r\n [attr.aria-hidden]=\"ariaHidden\"\r\n [attr.role]=\"role\"\r\n >\r\n <path\r\n d=\"M4.86199 11.5948C4.78717 11.5923 4.71366 11.5745 4.64596 11.5426C4.57826 11.5107 4.51779 11.4652 4.46827 11.4091L0.753985 7.69483C0.683167 7.64891 0.623706 7.58751 0.580092 7.51525C0.536478 7.44299 0.509851 7.36177 0.502221 7.27771C0.49459 7.19366 0.506156 7.10897 0.536046 7.03004C0.565935 6.95111 0.613367 6.88 0.674759 6.82208C0.736151 6.76416 0.8099 6.72095 0.890436 6.69571C0.970973 6.67046 1.05619 6.66385 1.13966 6.67635C1.22313 6.68886 1.30266 6.72017 1.37226 6.76792C1.44186 6.81567 1.4997 6.8786 1.54141 6.95197L4.86199 10.2503L12.6397 2.49483C12.7444 2.42694 12.8689 2.39617 12.9932 2.40745C13.1174 2.41873 13.2343 2.47141 13.3251 2.55705C13.4159 2.64268 13.4753 2.75632 13.4938 2.87973C13.5123 3.00315 13.4888 3.1292 13.4271 3.23768L5.2557 11.4091C5.20618 11.4652 5.14571 11.5107 5.07801 11.5426C5.01031 11.5745 4.9368 11.5923 4.86199 11.5948Z\"\r\n fill=\"currentColor\"\r\n stroke=\"currentColor\"\r\n stroke-width=\"1\"\r\n />\r\n </svg>\r\n\r\n </ng-container>\r\n </ng-container>\r\n <span *ngIf=\"checkboxIconTemplate\" class=\"cax-checkbox-icon\" [attr.data-pc-section]=\"'icon'\">\r\n <ng-template *ngTemplateOutlet=\"checkboxIconTemplate\"></ng-template>\r\n </span>\r\n </ng-container>\r\n </div>\r\n</div>\r\n<label\r\n (click)=\"onClick($event, input, true)\"\r\n [class]=\"labelStyleClass\"\r\n [ngClass]=\"{\r\n 'cax-checkbox-label': true, \r\n 'cax-checkbox-label-active': checked(), \r\n 'cax-disabled': disabled, \r\n 'cax-checkbox-label-focus': focused,\r\n 'cax-checkbox-label-sm': size === 'sm',\r\n 'cax-checkbox-label-md': size === 'md',\r\n 'cax-checkbox-label-lg': size === 'lg'\r\n }\"\r\n *ngIf=\"label\"\r\n [attr.for]=\"inputId\"\r\n [attr.data-pc-section]=\"'label'\"\r\n>\r\n {{ label }}</label\r\n>\r\n", styles: ["@layer cax{.cax-checkbox{display:inline-flex;cursor:pointer;-webkit-user-select:none;user-select:none;vertical-align:bottom;position:relative}.cax-checkbox-disabled{cursor:default!important;pointer-events:none}.cax-checkbox-box{display:flex;justify-content:center;align-items:center}cax-checkbox{display:inline-flex;vertical-align:bottom;align-items:center}.cax-checkbox-label{line-height:1}}\n"] }]
|
|
253
|
+
}], ctorParameters: () => [{ type: i0.ChangeDetectorRef }, { type: i0.Injector }, { type: i1.caxConfig }], propDecorators: { size: [{
|
|
254
|
+
type: Input
|
|
255
|
+
}], value: [{
|
|
246
256
|
type: Input
|
|
247
257
|
}], name: [{
|
|
248
258
|
type: Input
|
|
@@ -288,6 +298,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.9", ngImpor
|
|
|
288
298
|
type: Input
|
|
289
299
|
}], variant: [{
|
|
290
300
|
type: Input
|
|
301
|
+
}], indeterminate: [{
|
|
302
|
+
type: Input,
|
|
303
|
+
args: [{ transform: booleanAttribute }]
|
|
304
|
+
}], indeterminateChange: [{
|
|
305
|
+
type: Output
|
|
291
306
|
}], onChange: [{
|
|
292
307
|
type: Output
|
|
293
308
|
}], onFocus: [{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cax-design-system-checkbox.mjs","sources":["../../src/app/components/checkbox/checkbox.ts","../../src/app/components/checkbox/checkbox.html","../../src/app/components/checkbox/checkbox.module.ts","../../src/app/components/checkbox/cax-design-system-checkbox.ts"],"sourcesContent":["import {\n booleanAttribute,\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n ContentChildren,\n ElementRef,\n EventEmitter,\n forwardRef,\n Injector,\n Input,\n numberAttribute,\n Output,\n QueryList,\n TemplateRef,\n ViewChild,\n ViewEncapsulation\n} from '@angular/core';\nimport { ControlValueAccessor, FormControl, NG_VALUE_ACCESSOR, NgControl } from '@angular/forms';\nimport { CaxTemplate, caxConfig } from 'cax-design-system/api';\nimport { Nullable } from 'cax-design-system/ts-helpers';\nimport { ObjectUtils } from 'cax-design-system/utils';\nimport { CheckboxChangeEvent } from './checkbox.interface';\n\nexport const CHECKBOX_VALUE_ACCESSOR: any = {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => Checkbox),\n multi: true\n};\n/**\n * Checkbox is an extension to standard checkbox element with theming.\n * @group Components\n */\n@Component({\n selector: 'cax-checkbox',\n templateUrl: './checkbox.html',\n providers: [CHECKBOX_VALUE_ACCESSOR],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n styleUrls: ['./checkbox.scss'],\n host: {\n class: 'cax-element'\n }\n})\nexport class Checkbox implements ControlValueAccessor {\n /**\n * Value of the checkbox.\n * @group Props\n */\n @Input() value: any;\n /**\n * Name of the checkbox group.\n * @group Props\n */\n @Input() name: string | undefined;\n /**\n * When present, it specifies that the element should be disabled.\n * @group Props\n */\n @Input({ transform: booleanAttribute }) disabled: boolean | undefined;\n /**\n * Allows to select a boolean value instead of multiple values.\n * @group Props\n */\n @Input({ transform: booleanAttribute }) binary: boolean | undefined;\n /**\n * Label of the checkbox.\n * @group Props\n */\n @Input() label: string | undefined;\n /**\n * Establishes relationships between the component and label(s) where its value should be one or more element IDs.\n * @group Props\n */\n @Input() ariaLabelledBy: string | undefined;\n /**\n * Used to define a string that labels the input element.\n * @group Props\n */\n @Input() ariaLabel: string | undefined;\n /**\n * Index of the element in tabbing order.\n * @group Props\n */\n @Input({ transform: numberAttribute }) tabindex: number | undefined;\n /**\n * Identifier of the focus input to match a label defined for the component.\n * @group Props\n */\n @Input() inputId: string | undefined;\n /**\n * Inline style of the component.\n * @group Props\n */\n @Input() style: { [klass: string]: any } | null | undefined;\n /**\n * Style class of the component.\n * @group Props\n */\n @Input() styleClass: string | undefined;\n /**\n * Style class of the label.\n * @group Props\n */\n @Input() labelStyleClass: string | undefined;\n /**\n * Form control value.\n * @group Props\n */\n @Input() formControl: FormControl | undefined;\n /**\n * Icon class of the checkbox icon.\n * @group Props\n */\n @Input() checkboxIcon: string | undefined;\n /**\n * When present, it specifies that the component cannot be edited.\n * @group Props\n */\n @Input({ transform: booleanAttribute }) readonly: boolean | undefined;\n /**\n * When present, it specifies that checkbox must be checked before submitting the form.\n * @group Props\n */\n @Input({ transform: booleanAttribute }) required: boolean | undefined;\n /**\n * When present, it specifies that the component should automatically get focus on load.\n * @group Props\n */\n @Input({ transform: booleanAttribute }) autofocus: boolean | undefined;\n /**\n * Value in checked state.\n * @group Props\n */\n @Input() trueValue: any = true;\n /**\n * Value in unchecked state.\n * @group Props\n */\n @Input() falseValue: any = false;\n /**\n * Specifies the input variant of the component.\n * @group Props\n */\n @Input() variant: 'filled' | 'outlined' = 'outlined';\n /**\n * Callback to invoke on value change.\n * @param {CheckboxChangeEvent} event - Custom value change event.\n * @group Emits\n */\n @Output() onChange: EventEmitter<CheckboxChangeEvent> = new EventEmitter();\n /**\n * Callback to invoke when the receives focus.\n * @param {Event} event - Browser event.\n * @group Emits\n */\n @Output() onFocus: EventEmitter<Event> = new EventEmitter<Event>();\n /**\n * Callback to invoke when the loses focus.\n * @param {Event} event - Browser event.\n * @group Emits\n */\n @Output() onBlur: EventEmitter<Event> = new EventEmitter<Event>();\n\n @ViewChild('input') inputViewChild: Nullable<ElementRef>;\n\n @ContentChildren(CaxTemplate) templates: Nullable<QueryList<CaxTemplate>>;\n\n checkboxIconTemplate: TemplateRef<any>;\n\n @Input() model: any;\n\n onModelChange: Function = () => {};\n\n onModelTouched: Function = () => {};\n\n focused: boolean = false;\n\n constructor(\n public cd: ChangeDetectorRef,\n private readonly injector: Injector,\n public config: caxConfig\n ) {}\n\n ngAfterContentInit() {\n this.templates.forEach((item) => {\n switch (item.getType()) {\n case 'icon':\n this.checkboxIconTemplate = item.template;\n break;\n }\n });\n }\n\n onClick(event, checkbox, focus: boolean) {\n event.preventDefault();\n\n if (this.disabled || this.readonly) {\n return;\n }\n\n this.updateModel(event);\n\n if (focus) {\n checkbox.focus();\n }\n }\n\n updateModel(event) {\n let newModelValue;\n\n /*\n * When `formControlName` or `formControl` is used - `writeValue` is not called after control changes.\n * Otherwise it is causing multiple references to the actual value: there is one array reference inside the component and another one in the control value.\n * `selfControl` is the source of truth of references, it is made to avoid reference loss.\n * */\n const selfControl = this.injector.get<NgControl | null>(NgControl, null, { optional: true, self: true });\n\n const currentModelValue = selfControl && !this.formControl ? selfControl.value : this.model;\n\n if (!this.binary) {\n if (this.checked()) newModelValue = currentModelValue.filter((val) => !ObjectUtils.equals(val, this.value));\n else newModelValue = currentModelValue ? [...currentModelValue, this.value] : [this.value];\n\n this.onModelChange(newModelValue);\n this.model = newModelValue;\n\n if (this.formControl) {\n this.formControl.setValue(newModelValue);\n }\n } else {\n newModelValue = this.checked() ? this.falseValue : this.trueValue;\n this.model = newModelValue;\n this.onModelChange(newModelValue);\n }\n\n this.onChange.emit({ checked: newModelValue, originalEvent: event });\n }\n\n handleChange(event) {\n if (!this.readonly) {\n this.updateModel(event);\n }\n }\n\n onInputFocus(event) {\n this.focused = true;\n this.onFocus.emit(event);\n }\n\n onInputBlur(event) {\n this.focused = false;\n this.onBlur.emit(event);\n this.onModelTouched();\n }\n\n focus() {\n this.inputViewChild.nativeElement.focus();\n }\n\n writeValue(model: any): void {\n this.model = model;\n this.cd.markForCheck();\n }\n\n registerOnChange(fn: Function): void {\n this.onModelChange = fn;\n }\n\n registerOnTouched(fn: Function): void {\n this.onModelTouched = fn;\n }\n\n setDisabledState(val: boolean): void {\n setTimeout(() => {\n this.disabled = val;\n this.cd.markForCheck();\n });\n }\n\n checked() {\n return this.binary ? this.model === this.trueValue : ObjectUtils.contains(this.value, this.model);\n }\n}\n","<div\r\n [ngStyle]=\"style\"\r\n [ngClass]=\"{\r\n 'cax-checkbox cax-component': true,\r\n 'cax-checkbox-checked': checked(),\r\n 'cax-checkbox-disabled': disabled,\r\n 'cax-checkbox-focused': focused,\r\n 'cax-variant-filled': variant === 'filled' || config.inputStyle() === 'filled'\r\n}\"\r\n [class]=\"styleClass\"\r\n [attr.data-pc-name]=\"'checkbox'\"\r\n [attr.data-pc-section]=\"'root'\"\r\n>\r\n <div class=\"cax-hidden-accessible\" [attr.data-pc-section]=\"'hiddenInputWrapper'\" [attr.data-cax-hidden-accessible]=\"true\">\r\n <input\r\n #input\r\n [attr.id]=\"inputId\"\r\n type=\"checkbox\"\r\n [value]=\"value\"\r\n [attr.name]=\"name\"\r\n [checked]=\"checked()\"\r\n [attr.tabindex]=\"tabindex\"\r\n [disabled]=\"disabled\"\r\n [readonly]=\"readonly\"\r\n [attr.required]=\"required\"\r\n [attr.aria-labelledby]=\"ariaLabelledBy\"\r\n [attr.aria-label]=\"ariaLabel\"\r\n [attr.aria-checked]=\"checked()\"\r\n (change)=\"handleChange($event)\"\r\n (focus)=\"onInputFocus($event)\"\r\n (blur)=\"onInputBlur($event)\"\r\n [attr.data-pc-section]=\"'hiddenInput'\"\r\n caxAutoFocus\r\n [autofocus]=\"autofocus\"\r\n />\r\n </div>\r\n <div\r\n class=\"cax-checkbox-box\"\r\n [ngClass]=\"{ 'cax-highlight': checked(), 'cax-disabled': disabled, 'cax-focus': focused }\"\r\n (click)=\"onClick($event, input, true)\"\r\n [attr.data-cax-highlight]=\"checked()\"\r\n [attr.data-cax-disabled]=\"disabled\"\r\n [attr.data-cax-focused]=\"focused\"\r\n [attr.data-pc-section]=\"'input'\"\r\n >\r\n <ng-container *ngIf=\"checked()\">\r\n <ng-container *ngIf=\"!checkboxIconTemplate\">\r\n <span *ngIf=\"checkboxIcon\" class=\"cax-checkbox-icon\" [ngClass]=\"checkboxIcon\" [attr.data-pc-section]=\"'icon'\"></span>\r\n <!-- <CheckIcon *ngIf=\"!checkboxIcon\" [styleClass]=\"'cax-checkbox-icon'\" [attr.data-pc-section]=\"'icon'\" /> -->\r\n <ng-container *ngIf=\"!checkboxIcon\" >\r\n <svg\r\n width=\"11\"\r\n height=\"10\"\r\n viewBox=\"0 0 14 14\"\r\n fill=\"none\"\r\n xmlns=\"http://www.w3.org/2000/svg\"\r\n [attr.aria-label]=\"ariaLabel\"\r\n [attr.aria-hidden]=\"ariaHidden\"\r\n [attr.role]=\"role\"\r\n >\r\n <path\r\n d=\"M4.86199 11.5948C4.78717 11.5923 4.71366 11.5745 4.64596 11.5426C4.57826 11.5107 4.51779 11.4652 4.46827 11.4091L0.753985 7.69483C0.683167 7.64891 0.623706 7.58751 0.580092 7.51525C0.536478 7.44299 0.509851 7.36177 0.502221 7.27771C0.49459 7.19366 0.506156 7.10897 0.536046 7.03004C0.565935 6.95111 0.613367 6.88 0.674759 6.82208C0.736151 6.76416 0.8099 6.72095 0.890436 6.69571C0.970973 6.67046 1.05619 6.66385 1.13966 6.67635C1.22313 6.68886 1.30266 6.72017 1.37226 6.76792C1.44186 6.81567 1.4997 6.8786 1.54141 6.95197L4.86199 10.2503L12.6397 2.49483C12.7444 2.42694 12.8689 2.39617 12.9932 2.40745C13.1174 2.41873 13.2343 2.47141 13.3251 2.55705C13.4159 2.64268 13.4753 2.75632 13.4938 2.87973C13.5123 3.00315 13.4888 3.1292 13.4271 3.23768L5.2557 11.4091C5.20618 11.4652 5.14571 11.5107 5.07801 11.5426C5.01031 11.5745 4.9368 11.5923 4.86199 11.5948Z\"\r\n fill=\"currentColor\"\r\n stroke=\"currentColor\"\r\n stroke-width=\"1\"\r\n />\r\n </svg>\r\n\r\n </ng-container>\r\n </ng-container>\r\n <span *ngIf=\"checkboxIconTemplate\" class=\"cax-checkbox-icon\" [attr.data-pc-section]=\"'icon'\">\r\n <ng-template *ngTemplateOutlet=\"checkboxIconTemplate\"></ng-template>\r\n </span>\r\n </ng-container>\r\n </div>\r\n</div>\r\n<label\r\n (click)=\"onClick($event, input, true)\"\r\n [class]=\"labelStyleClass\"\r\n [ngClass]=\"{ 'cax-checkbox-label': true, 'cax-checkbox-label-active': checked(), 'cax-disabled': disabled, 'cax-checkbox-label-focus': focused }\"\r\n *ngIf=\"label\"\r\n [attr.for]=\"inputId\"\r\n [attr.data-pc-section]=\"'label'\"\r\n>\r\n {{ label }}</label\r\n>\r\n","import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { SharedModule } from 'cax-design-system/api';\nimport { AutoFocusModule } from 'cax-design-system/autofocus';\nimport { Checkbox } from './checkbox';\n\n@NgModule({\n imports: [CommonModule, AutoFocusModule, SharedModule],\n exports: [Checkbox, SharedModule],\n declarations: [Checkbox]\n})\nexport class CheckboxModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;;;;;;AAwBa,MAAA,uBAAuB,GAAQ;AACxC,IAAA,OAAO,EAAE,iBAAiB;AAC1B,IAAA,WAAW,EAAE,UAAU,CAAC,MAAM,QAAQ,CAAC;AACvC,IAAA,KAAK,EAAE,IAAI;EACb;AACF;;;AAGG;MAYU,QAAQ,CAAA;AAuIN,IAAA,EAAA,CAAA;AACU,IAAA,QAAA,CAAA;AACV,IAAA,MAAA,CAAA;AAxIX;;;AAGG;AACM,IAAA,KAAK,CAAM;AACpB;;;AAGG;AACM,IAAA,IAAI,CAAqB;AAClC;;;AAGG;AACqC,IAAA,QAAQ,CAAsB;AACtE;;;AAGG;AACqC,IAAA,MAAM,CAAsB;AACpE;;;AAGG;AACM,IAAA,KAAK,CAAqB;AACnC;;;AAGG;AACM,IAAA,cAAc,CAAqB;AAC5C;;;AAGG;AACM,IAAA,SAAS,CAAqB;AACvC;;;AAGG;AACoC,IAAA,QAAQ,CAAqB;AACpE;;;AAGG;AACM,IAAA,OAAO,CAAqB;AACrC;;;AAGG;AACM,IAAA,KAAK,CAA8C;AAC5D;;;AAGG;AACM,IAAA,UAAU,CAAqB;AACxC;;;AAGG;AACM,IAAA,eAAe,CAAqB;AAC7C;;;AAGG;AACM,IAAA,WAAW,CAA0B;AAC9C;;;AAGG;AACM,IAAA,YAAY,CAAqB;AAC1C;;;AAGG;AACqC,IAAA,QAAQ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C,eAAe;uBAAC,WAAW,CAAA;gBAInB,KAAK,EAAA,CAAA;sBAAb,KAAK;;;ME/JG,cAAc,CAAA;uGAAd,cAAc,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;wGAAd,cAAc,EAAA,YAAA,EAAA,CAFR,QAAQ,CAAA,EAAA,OAAA,EAAA,CAFb,YAAY,EAAE,eAAe,EAAE,YAAY,CAAA,EAAA,OAAA,EAAA,CAC3C,QAAQ,EAAE,YAAY,CAAA,EAAA,CAAA,CAAA;AAGvB,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,cAAc,YAJb,YAAY,EAAE,eAAe,EAAE,YAAY,EACjC,YAAY,CAAA,EAAA,CAAA,CAAA;;2FAGvB,cAAc,EAAA,UAAA,EAAA,CAAA;kBAL1B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACN,oBAAA,OAAO,EAAE,CAAC,YAAY,EAAE,eAAe,EAAE,YAAY,CAAC;AACtD,oBAAA,OAAO,EAAE,CAAC,QAAQ,EAAE,YAAY,CAAC;oBACjC,YAAY,EAAE,CAAC,QAAQ,CAAC;AAC3B,iBAAA,CAAA;;;ACVD;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"cax-design-system-checkbox.mjs","sources":["../../src/app/components/checkbox/checkbox.ts","../../src/app/components/checkbox/checkbox.html","../../src/app/components/checkbox/checkbox.module.ts","../../src/app/components/checkbox/cax-design-system-checkbox.ts"],"sourcesContent":["import {\n booleanAttribute,\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n ContentChildren,\n ElementRef,\n EventEmitter,\n forwardRef,\n Injector,\n Input,\n numberAttribute,\n Output,\n QueryList,\n TemplateRef,\n ViewChild,\n ViewEncapsulation\n} from '@angular/core';\nimport { ControlValueAccessor, FormControl, NG_VALUE_ACCESSOR, NgControl } from '@angular/forms';\nimport { CaxTemplate, caxConfig } from 'cax-design-system/api';\nimport { Nullable } from 'cax-design-system/ts-helpers';\nimport { ObjectUtils } from 'cax-design-system/utils';\nimport { CheckboxChangeEvent } from './checkbox.interface';\n\nexport const CHECKBOX_VALUE_ACCESSOR: any = {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => Checkbox),\n multi: true\n};\n/**\n * Checkbox is an extension to standard checkbox element with theming.\n * @group Components\n */\n@Component({\n selector: 'cax-checkbox',\n templateUrl: './checkbox.html',\n providers: [CHECKBOX_VALUE_ACCESSOR],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n styleUrls: ['./checkbox.scss'],\n host: {\n class: 'cax-element'\n }\n})\nexport class Checkbox implements ControlValueAccessor {\n @Input() size: 'sm' | 'md' | 'lg' = 'md';\n /**\n * Value of the checkbox.\n * @group Props\n */\n @Input() value: any;\n /**\n * Name of the checkbox group.\n * @group Props\n */\n @Input() name: string | undefined;\n /**\n * When present, it specifies that the element should be disabled.\n * @group Props\n */\n @Input({ transform: booleanAttribute }) disabled: boolean | undefined;\n /**\n * Allows to select a boolean value instead of multiple values.\n * @group Props\n */\n @Input({ transform: booleanAttribute }) binary: boolean | undefined;\n /**\n * Label of the checkbox.\n * @group Props\n */\n @Input() label: string | undefined;\n /**\n * Establishes relationships between the component and label(s) where its value should be one or more element IDs.\n * @group Props\n */\n @Input() ariaLabelledBy: string | undefined;\n /**\n * Used to define a string that labels the input element.\n * @group Props\n */\n @Input() ariaLabel: string | undefined;\n /**\n * Index of the element in tabbing order.\n * @group Props\n */\n @Input({ transform: numberAttribute }) tabindex: number | undefined;\n /**\n * Identifier of the focus input to match a label defined for the component.\n * @group Props\n */\n @Input() inputId: string | undefined;\n /**\n * Inline style of the component.\n * @group Props\n */\n @Input() style: { [klass: string]: any } | null | undefined;\n /**\n * Style class of the component.\n * @group Props\n */\n @Input() styleClass: string | undefined;\n /**\n * Style class of the label.\n * @group Props\n */\n @Input() labelStyleClass: string | undefined;\n /**\n * Form control value.\n * @group Props\n */\n @Input() formControl: FormControl | undefined;\n /**\n * Icon class of the checkbox icon.\n * @group Props\n */\n @Input() checkboxIcon: string | undefined;\n /**\n * When present, it specifies that the component cannot be edited.\n * @group Props\n */\n @Input({ transform: booleanAttribute }) readonly: boolean | undefined;\n /**\n * When present, it specifies that checkbox must be checked before submitting the form.\n * @group Props\n */\n @Input({ transform: booleanAttribute }) required: boolean | undefined;\n /**\n * When present, it specifies that the component should automatically get focus on load.\n * @group Props\n */\n @Input({ transform: booleanAttribute }) autofocus: boolean | undefined;\n /**\n * Value in checked state.\n * @group Props\n */\n @Input() trueValue: any = true;\n /**\n * Value in unchecked state.\n * @group Props\n */\n @Input() falseValue: any = false;\n /**\n * Specifies the input variant of the component.\n * @group Props\n */\n @Input() variant: 'filled' | 'outlined' = 'outlined';\n /**\n * Callback to invoke on value change.\n * @param {CheckboxChangeEvent} event - Custom value change event.\n * @group Emits\n */\n @Input({ transform: booleanAttribute }) indeterminate: boolean = false;\n\n // New event emitter for indeterminate change\n @Output() indeterminateChange: EventEmitter<boolean> = new EventEmitter<boolean>();\n @Output() onChange: EventEmitter<CheckboxChangeEvent> = new EventEmitter();\n /**\n * Callback to invoke when the receives focus.\n * @param {Event} event - Browser event.\n * @group Emits\n */\n @Output() onFocus: EventEmitter<Event> = new EventEmitter<Event>();\n /**\n * Callback to invoke when the loses focus.\n * @param {Event} event - Browser event.\n * @group Emits\n */\n @Output() onBlur: EventEmitter<Event> = new EventEmitter<Event>();\n\n @ViewChild('input') inputViewChild: Nullable<ElementRef>;\n\n @ContentChildren(CaxTemplate) templates: Nullable<QueryList<CaxTemplate>>;\n\n checkboxIconTemplate: TemplateRef<any>;\n\n @Input() model: any;\n\n onModelChange: Function = () => {};\n\n onModelTouched: Function = () => {};\n\n focused: boolean = false;\n\n constructor(\n public cd: ChangeDetectorRef,\n private readonly injector: Injector,\n public config: caxConfig\n ) {}\n\n ngAfterContentInit() {\n this.templates.forEach((item) => {\n switch (item.getType()) {\n case 'icon':\n this.checkboxIconTemplate = item.template;\n break;\n }\n });\n }\n\n onClick(event, checkbox, focus: boolean) {\n event.preventDefault();\n\n if (this.disabled || this.readonly) {\n return;\n }\n\n this.updateModel(event);\n\n if (focus) {\n checkbox.focus();\n }\n }\n\n updateModel(event) {\n let newModelValue;\n\n /*\n * When `formControlName` or `formControl` is used - `writeValue` is not called after control changes.\n * Otherwise it is causing multiple references to the actual value: there is one array reference inside the component and another one in the control value.\n * `selfControl` is the source of truth of references, it is made to avoid reference loss.\n * */\n const selfControl = this.injector.get<NgControl | null>(NgControl, null, { optional: true, self: true });\n\n const currentModelValue = selfControl && !this.formControl ? selfControl.value : this.model;\n\n if (!this.binary) {\n if (this.checked()) newModelValue = currentModelValue.filter((val) => !ObjectUtils.equals(val, this.value));\n else newModelValue = currentModelValue ? [...currentModelValue, this.value] : [this.value];\n\n this.onModelChange(newModelValue);\n this.model = newModelValue;\n\n if (this.formControl) {\n this.formControl.setValue(newModelValue);\n }\n } else {\n if (this.indeterminate) {\n this.indeterminate = false; // Reset indeterminate state on user interaction\n this.indeterminateChange.emit(this.indeterminate);\n }\n newModelValue = this.checked() ? this.falseValue : this.trueValue;\n this.model = newModelValue;\n this.onModelChange(newModelValue);\n }\n\n this.onChange.emit({ checked: newModelValue, originalEvent: event });\n }\n\n handleChange(event) {\n if (!this.readonly) {\n this.updateModel(event);\n }\n }\n\n onInputFocus(event) {\n this.focused = true;\n this.onFocus.emit(event);\n }\n\n onInputBlur(event) {\n this.focused = false;\n this.onBlur.emit(event);\n this.onModelTouched();\n }\n\n focus() {\n this.inputViewChild.nativeElement.focus();\n }\n\n writeValue(model: any): void {\n this.model = model;\n this.cd.markForCheck();\n }\n\n registerOnChange(fn: Function): void {\n this.onModelChange = fn;\n }\n\n registerOnTouched(fn: Function): void {\n this.onModelTouched = fn;\n }\n\n setDisabledState(val: boolean): void {\n setTimeout(() => {\n this.disabled = val;\n this.cd.markForCheck();\n });\n }\n\n checked() {\n return !this.indeterminate && (this.binary ? this.model === this.trueValue : ObjectUtils.contains(this.value, this.model));\n }\n}\n","<div\r\n [ngStyle]=\"style\"\r\n [ngClass]=\"{\r\n 'cax-checkbox cax-component': true,\r\n 'cax-checkbox-checked': checked(),\r\n 'cax-checkbox-indeterminate': indeterminate,\r\n 'cax-checkbox-disabled': disabled,\r\n 'cax-checkbox-focused': focused,\r\n 'cax-variant-filled': variant === 'filled' || config.inputStyle() === 'filled'\r\n}\"\r\n [class]=\"styleClass\"\r\n [attr.data-pc-name]=\"'checkbox'\"\r\n [attr.data-pc-section]=\"'root'\"\r\n>\r\n <div class=\"cax-hidden-accessible\" [attr.data-pc-section]=\"'hiddenInputWrapper'\" [attr.data-cax-hidden-accessible]=\"true\">\r\n <input\r\n #input\r\n [attr.id]=\"inputId\"\r\n type=\"checkbox\"\r\n [value]=\"value\"\r\n [attr.name]=\"name\"\r\n [checked]=\"checked()\"\r\n [attr.indeterminate]=\"indeterminate ? 'true' : null\"\r\n [attr.tabindex]=\"tabindex\"\r\n [disabled]=\"disabled\"\r\n [readonly]=\"readonly\"\r\n [attr.required]=\"required\"\r\n [attr.aria-labelledby]=\"ariaLabelledBy\"\r\n [attr.aria-label]=\"ariaLabel\"\r\n [attr.aria-checked]=\"checked()\"\r\n (change)=\"handleChange($event)\"\r\n (focus)=\"onInputFocus($event)\"\r\n (blur)=\"onInputBlur($event)\"\r\n [attr.data-pc-section]=\"'hiddenInput'\"\r\n caxAutoFocus\r\n [autofocus]=\"autofocus\"\r\n />\r\n </div>\r\n <div\r\n class=\"cax-checkbox-box\"\r\n [ngClass]=\"{ 'cax-highlight': checked(), 'cax-disabled': disabled, 'cax-focus': focused,\r\n 'cax-checkbox-indeterminate': indeterminate, \r\n 'cax-checkbox-sm': size == 'sm',\r\n 'cax-checkbox-md': size == 'md',\r\n 'cax-checkbox-lg': size == 'lg', }\"\r\n (click)=\"onClick($event, input, true)\"\r\n [attr.data-cax-highlight]=\"checked()\"\r\n [attr.data-cax-disabled]=\"disabled\"\r\n [attr.data-cax-focused]=\"focused\"\r\n [attr.data-pc-section]=\"'input'\"\r\n >\r\n <ng-container *ngIf=\"indeterminate\">\r\n <span class=\"cax cax-leaf cax-checkbox-leaf-indeterminate cax-checkbox-icon\"></span> \r\n </ng-container>\r\n <ng-container *ngIf=\"checked() && !indeterminate\">\r\n <ng-container *ngIf=\"!checkboxIconTemplate\">\r\n <span *ngIf=\"checkboxIcon\" class=\"cax-checkbox-icon\" [ngClass]=\"checkboxIcon\" [attr.data-pc-section]=\"'icon'\"></span>\r\n <!-- <CheckIcon *ngIf=\"!checkboxIcon\" [styleClass]=\"'cax-checkbox-icon'\" [attr.data-pc-section]=\"'icon'\" /> -->\r\n <ng-container *ngIf=\"!checkboxIcon\" >\r\n <svg\r\n width=\"11\"\r\n height=\"10\"\r\n viewBox=\"0 0 14 14\"\r\n fill=\"none\"\r\n xmlns=\"http://www.w3.org/2000/svg\"\r\n [attr.aria-label]=\"ariaLabel\"\r\n [attr.aria-hidden]=\"ariaHidden\"\r\n [attr.role]=\"role\"\r\n >\r\n <path\r\n d=\"M4.86199 11.5948C4.78717 11.5923 4.71366 11.5745 4.64596 11.5426C4.57826 11.5107 4.51779 11.4652 4.46827 11.4091L0.753985 7.69483C0.683167 7.64891 0.623706 7.58751 0.580092 7.51525C0.536478 7.44299 0.509851 7.36177 0.502221 7.27771C0.49459 7.19366 0.506156 7.10897 0.536046 7.03004C0.565935 6.95111 0.613367 6.88 0.674759 6.82208C0.736151 6.76416 0.8099 6.72095 0.890436 6.69571C0.970973 6.67046 1.05619 6.66385 1.13966 6.67635C1.22313 6.68886 1.30266 6.72017 1.37226 6.76792C1.44186 6.81567 1.4997 6.8786 1.54141 6.95197L4.86199 10.2503L12.6397 2.49483C12.7444 2.42694 12.8689 2.39617 12.9932 2.40745C13.1174 2.41873 13.2343 2.47141 13.3251 2.55705C13.4159 2.64268 13.4753 2.75632 13.4938 2.87973C13.5123 3.00315 13.4888 3.1292 13.4271 3.23768L5.2557 11.4091C5.20618 11.4652 5.14571 11.5107 5.07801 11.5426C5.01031 11.5745 4.9368 11.5923 4.86199 11.5948Z\"\r\n fill=\"currentColor\"\r\n stroke=\"currentColor\"\r\n stroke-width=\"1\"\r\n />\r\n </svg>\r\n\r\n </ng-container>\r\n </ng-container>\r\n <span *ngIf=\"checkboxIconTemplate\" class=\"cax-checkbox-icon\" [attr.data-pc-section]=\"'icon'\">\r\n <ng-template *ngTemplateOutlet=\"checkboxIconTemplate\"></ng-template>\r\n </span>\r\n </ng-container>\r\n </div>\r\n</div>\r\n<label\r\n (click)=\"onClick($event, input, true)\"\r\n [class]=\"labelStyleClass\"\r\n [ngClass]=\"{\r\n 'cax-checkbox-label': true, \r\n 'cax-checkbox-label-active': checked(), \r\n 'cax-disabled': disabled, \r\n 'cax-checkbox-label-focus': focused,\r\n 'cax-checkbox-label-sm': size === 'sm',\r\n 'cax-checkbox-label-md': size === 'md',\r\n 'cax-checkbox-label-lg': size === 'lg'\r\n }\"\r\n *ngIf=\"label\"\r\n [attr.for]=\"inputId\"\r\n [attr.data-pc-section]=\"'label'\"\r\n>\r\n {{ label }}</label\r\n>\r\n","import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { SharedModule } from 'cax-design-system/api';\nimport { AutoFocusModule } from 'cax-design-system/autofocus';\nimport { Checkbox } from './checkbox';\n\n@NgModule({\n imports: [CommonModule, AutoFocusModule, SharedModule],\n exports: [Checkbox, SharedModule],\n declarations: [Checkbox]\n})\nexport class CheckboxModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;;;;;;AAwBa,MAAA,uBAAuB,GAAQ;AACxC,IAAA,OAAO,EAAE,iBAAiB;AAC1B,IAAA,WAAW,EAAE,UAAU,CAAC,MAAM,QAAQ,CAAC;AACv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BAL1B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACN,oBAAA,OAAO,EAAE,CAAC,YAAY,EAAE,eAAe,EAAE,YAAY,CAAC;AACtD,oBAAA,OAAO,EAAE,CAAC,QAAQ,EAAE,YAAY,CAAC;oBACjC,YAAY,EAAE,CAAC,QAAQ,CAAC;AAC3B,iBAAA,CAAA;;;ACVD;;AAEG;;;;"}
|
|
@@ -13,9 +13,10 @@ class Chip {
|
|
|
13
13
|
alt;
|
|
14
14
|
style;
|
|
15
15
|
styleClass;
|
|
16
|
-
type = 'default';
|
|
17
16
|
removable = false;
|
|
18
17
|
removeIcon;
|
|
18
|
+
size = 'md';
|
|
19
|
+
severity = 'primary';
|
|
19
20
|
onRemove = new EventEmitter();
|
|
20
21
|
onImageError = new EventEmitter();
|
|
21
22
|
config = inject(caxConfig);
|
|
@@ -36,7 +37,8 @@ class Chip {
|
|
|
36
37
|
return {
|
|
37
38
|
'cax-chip cax-component': true,
|
|
38
39
|
'cax-chip-image': this.image != null,
|
|
39
|
-
[`cax-chip-${this.
|
|
40
|
+
[`cax-chip-${this.severity}`]: !!this.severity,
|
|
41
|
+
[`cax-chip-${this.size}`]: !!this.size
|
|
40
42
|
};
|
|
41
43
|
}
|
|
42
44
|
close(event) {
|
|
@@ -52,13 +54,13 @@ class Chip {
|
|
|
52
54
|
this.onImageError.emit(event);
|
|
53
55
|
}
|
|
54
56
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.9", ngImport: i0, type: Chip, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
55
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "16.1.0", version: "18.2.9", type: Chip, selector: "cax-chip", inputs: { label: "label", icon: "icon", image: "image", alt: "alt", style: "style", styleClass: "styleClass",
|
|
57
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "16.1.0", version: "18.2.9", type: Chip, selector: "cax-chip", inputs: { label: "label", icon: "icon", image: "image", alt: "alt", style: "style", styleClass: "styleClass", removable: ["removable", "removable", booleanAttribute], removeIcon: "removeIcon", size: "size", severity: "severity" }, outputs: { onRemove: "onRemove", onImageError: "onImageError" }, host: { classAttribute: "cax-element" }, queries: [{ propertyName: "templates", predicate: CaxTemplate }], ngImport: i0, template: "<div\r\n [ngClass]=\"containerClass()\"\r\n [class]=\"styleClass\"\r\n [ngStyle]=\"style\"\r\n *ngIf=\"visible\"\r\n [attr.data-pc-name]=\"'chip'\"\r\n [attr.aria-label]=\"label\"\r\n [attr.data-pc-section]=\"'root'\"\r\n>\r\n <ng-content></ng-content>\r\n <img [src]=\"image\" *ngIf=\"image; else iconTemplate\" (error)=\"imageError($event)\" [alt]=\"alt\" />\r\n <ng-template #iconTemplate>\r\n <span *ngIf=\"icon\" [class]=\"icon\" [ngClass]=\"'cax-chip-icon'\" [attr.data-pc-section]=\"'icon'\"></span>\r\n </ng-template>\r\n <div class=\"-chip-text\" *ngIf=\"label\" [attr.data-pc-section]=\"'label'\">{{ label }}</div>\r\n <ng-container *ngIf=\"removable\">\r\n <ng-container *ngIf=\"!removeIconTemplate\">\r\n <span\r\n tabindex=\"0\"\r\n *ngIf=\"removeIcon\"\r\n [class]=\"removeIcon\"\r\n [ngClass]=\"'cax-chip-remove-icon'\"\r\n [attr.data-pc-section]=\"'removeicon'\"\r\n (click)=\"close($event)\"\r\n (keydown)=\"onKeydown($event)\"\r\n [attr.aria-label]=\"removeAriaLabel\"\r\n role=\"button\"\r\n ></span>\r\n <TimesCircleIcon\r\n tabindex=\"0\"\r\n *ngIf=\"!removeIcon\"\r\n [class]=\"'cax-chip-remove-icon'\"\r\n [attr.data-pc-section]=\"'removeicon'\"\r\n (click)=\"close($event)\"\r\n (keydown)=\"onKeydown($event)\"\r\n [attr.aria-label]=\"removeAriaLabel\"\r\n role=\"button\"\r\n />\r\n </ng-container>\r\n <span\r\n *ngIf=\"removeIconTemplate\"\r\n tabindex=\"0\"\r\n [attr.data-pc-section]=\"'removeicon'\"\r\n class=\"cax-chip-remove-icon\"\r\n (click)=\"close($event)\"\r\n (keydown)=\"onKeydown($event)\"\r\n [attr.aria-label]=\"removeAriaLabel\"\r\n role=\"button\"\r\n >\r\n <ng-template *ngTemplateOutlet=\"removeIconTemplate\"></ng-template>\r\n </span>\r\n </ng-container>\r\n</div>\r\n", styles: ["@layer cax{.cax-chip{display:inline-flex;align-items:center}}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "component", type: i2.TimesCircleIcon, selector: "TimesCircleIcon" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
56
58
|
}
|
|
57
59
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.9", ngImport: i0, type: Chip, decorators: [{
|
|
58
60
|
type: Component,
|
|
59
61
|
args: [{ selector: 'cax-chip', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, host: {
|
|
60
62
|
class: 'cax-element'
|
|
61
|
-
}, template: "<div\r\n [ngClass]=\"containerClass()\"\r\n [class]=\"styleClass\"\r\n [ngStyle]=\"style\"\r\n *ngIf=\"visible\"\r\n [attr.data-pc-name]=\"'chip'\"\r\n [attr.aria-label]=\"label\"\r\n [attr.data-pc-section]=\"'root'\"\r\n>\r\n <ng-content></ng-content>\r\n <img [src]=\"image\" *ngIf=\"image; else iconTemplate\" (error)=\"imageError($event)\" [alt]=\"alt\" />\r\n <ng-template #iconTemplate>\r\n <span *ngIf=\"icon\" [class]=\"icon\" [ngClass]=\"'cax-chip-icon'\" [attr.data-pc-section]=\"'icon'\"></span>\r\n </ng-template>\r\n <div class=\"-chip-text\" *ngIf=\"label\" [attr.data-pc-section]=\"'label'\">{{ label }}</div>\r\n <ng-container *ngIf=\"removable\">\r\n <ng-container *ngIf=\"!removeIconTemplate\">\r\n <span\r\n tabindex=\"0\"\r\n *ngIf=\"removeIcon\"\r\n [class]=\"removeIcon\"\r\n [ngClass]=\"'cax-chip-remove-icon'\"\r\n [attr.data-pc-section]=\"'removeicon'\"\r\n (click)=\"close($event)\"\r\n (keydown)=\"onKeydown($event)\"\r\n [attr.aria-label]=\"removeAriaLabel\"\r\n role=\"button\"\r\n ></span>\r\n <TimesCircleIcon\r\n tabindex=\"0\"\r\n *ngIf=\"!removeIcon\"\r\n [class]=\"'cax-chip-remove-icon'\"\r\n [attr.data-pc-section]=\"'removeicon'\"\r\n (click)=\"close($event)\"\r\n (keydown)=\"onKeydown($event)\"\r\n [attr.aria-label]=\"removeAriaLabel\"\r\n role=\"button\"\r\n />\r\n </ng-container>\r\n <span\r\n *ngIf=\"removeIconTemplate\"\r\n tabindex=\"0\"\r\n [attr.data-pc-section]=\"'removeicon'\"\r\n class=\"cax-chip-remove-icon\"\r\n (click)=\"close($event)\"\r\n (keydown)=\"onKeydown($event)\"\r\n [attr.aria-label]=\"removeAriaLabel\"\r\n role=\"button\"\r\n >\r\n <ng-template *ngTemplateOutlet=\"removeIconTemplate\"></ng-template>\r\n </span>\r\n </ng-container>\r\n</div>\r\n", styles: ["@layer cax{.cax-chip{display:inline-flex;align-items:center
|
|
63
|
+
}, template: "<div\r\n [ngClass]=\"containerClass()\"\r\n [class]=\"styleClass\"\r\n [ngStyle]=\"style\"\r\n *ngIf=\"visible\"\r\n [attr.data-pc-name]=\"'chip'\"\r\n [attr.aria-label]=\"label\"\r\n [attr.data-pc-section]=\"'root'\"\r\n>\r\n <ng-content></ng-content>\r\n <img [src]=\"image\" *ngIf=\"image; else iconTemplate\" (error)=\"imageError($event)\" [alt]=\"alt\" />\r\n <ng-template #iconTemplate>\r\n <span *ngIf=\"icon\" [class]=\"icon\" [ngClass]=\"'cax-chip-icon'\" [attr.data-pc-section]=\"'icon'\"></span>\r\n </ng-template>\r\n <div class=\"-chip-text\" *ngIf=\"label\" [attr.data-pc-section]=\"'label'\">{{ label }}</div>\r\n <ng-container *ngIf=\"removable\">\r\n <ng-container *ngIf=\"!removeIconTemplate\">\r\n <span\r\n tabindex=\"0\"\r\n *ngIf=\"removeIcon\"\r\n [class]=\"removeIcon\"\r\n [ngClass]=\"'cax-chip-remove-icon'\"\r\n [attr.data-pc-section]=\"'removeicon'\"\r\n (click)=\"close($event)\"\r\n (keydown)=\"onKeydown($event)\"\r\n [attr.aria-label]=\"removeAriaLabel\"\r\n role=\"button\"\r\n ></span>\r\n <TimesCircleIcon\r\n tabindex=\"0\"\r\n *ngIf=\"!removeIcon\"\r\n [class]=\"'cax-chip-remove-icon'\"\r\n [attr.data-pc-section]=\"'removeicon'\"\r\n (click)=\"close($event)\"\r\n (keydown)=\"onKeydown($event)\"\r\n [attr.aria-label]=\"removeAriaLabel\"\r\n role=\"button\"\r\n />\r\n </ng-container>\r\n <span\r\n *ngIf=\"removeIconTemplate\"\r\n tabindex=\"0\"\r\n [attr.data-pc-section]=\"'removeicon'\"\r\n class=\"cax-chip-remove-icon\"\r\n (click)=\"close($event)\"\r\n (keydown)=\"onKeydown($event)\"\r\n [attr.aria-label]=\"removeAriaLabel\"\r\n role=\"button\"\r\n >\r\n <ng-template *ngTemplateOutlet=\"removeIconTemplate\"></ng-template>\r\n </span>\r\n </ng-container>\r\n</div>\r\n", styles: ["@layer cax{.cax-chip{display:inline-flex;align-items:center}}\n"] }]
|
|
62
64
|
}], propDecorators: { label: [{
|
|
63
65
|
type: Input
|
|
64
66
|
}], icon: [{
|
|
@@ -71,13 +73,15 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.9", ngImpor
|
|
|
71
73
|
type: Input
|
|
72
74
|
}], styleClass: [{
|
|
73
75
|
type: Input
|
|
74
|
-
}], type: [{
|
|
75
|
-
type: Input
|
|
76
76
|
}], removable: [{
|
|
77
77
|
type: Input,
|
|
78
78
|
args: [{ transform: booleanAttribute }]
|
|
79
79
|
}], removeIcon: [{
|
|
80
80
|
type: Input
|
|
81
|
+
}], size: [{
|
|
82
|
+
type: Input
|
|
83
|
+
}], severity: [{
|
|
84
|
+
type: Input
|
|
81
85
|
}], onRemove: [{
|
|
82
86
|
type: Output
|
|
83
87
|
}], onImageError: [{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cax-design-system-chip.mjs","sources":["../../src/app/components/chip/chip.ts","../../src/app/components/chip/chip.html","../../src/app/components/chip/chip.module.ts","../../src/app/components/chip/cax-design-system-chip.ts"],"sourcesContent":["import { AfterContentInit, Component, ContentChildren, EventEmitter, Input, Output, QueryList, TemplateRef, ChangeDetectionStrategy, ViewEncapsulation, inject, booleanAttribute } from '@angular/core';\nimport { caxConfig, CaxTemplate, TranslationKeys } from 'cax-design-system/api';\n\ntype
|
|
1
|
+
{"version":3,"file":"cax-design-system-chip.mjs","sources":["../../src/app/components/chip/chip.ts","../../src/app/components/chip/chip.html","../../src/app/components/chip/chip.module.ts","../../src/app/components/chip/cax-design-system-chip.ts"],"sourcesContent":["import { AfterContentInit, Component, ContentChildren, EventEmitter, Input, Output, QueryList, TemplateRef, ChangeDetectionStrategy, ViewEncapsulation, inject, booleanAttribute } from '@angular/core';\nimport { caxConfig, CaxTemplate, TranslationKeys } from 'cax-design-system/api';\n\ntype ChipSeverity = 'primary' | 'secondary' | 'success' | 'warning' | 'error';\n\n@Component({\n selector: 'cax-chip',\n templateUrl: './chip.html',\n styleUrls: ['./chip.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n host: {\n class: 'cax-element'\n }\n})\nexport class Chip implements AfterContentInit {\n @Input() label: string | undefined;\n @Input() icon: string | undefined;\n @Input() image: string | undefined;\n @Input() alt: string | undefined;\n @Input() style: { [klass: string]: any } | null | undefined;\n @Input() styleClass: string | undefined;\n @Input({ transform: booleanAttribute }) removable: boolean | undefined = false;\n @Input() removeIcon: string | undefined;\n @Input() size: 'sm' | 'md' | 'lg' = 'md';\n @Input() severity: ChipSeverity = 'primary';\n @Output() onRemove: EventEmitter<MouseEvent> = new EventEmitter<MouseEvent>();\n @Output() onImageError: EventEmitter<Event> = new EventEmitter<Event>();\n config = inject(caxConfig);\n visible: boolean = true;\n removeIconTemplate: TemplateRef<any> | undefined;\n\n get removeAriaLabel() {\n return this.config.getTranslation(TranslationKeys.ARIA)['removeLabel'];\n }\n\n @ContentChildren(CaxTemplate) templates: QueryList<CaxTemplate> | undefined;\n\n ngAfterContentInit() {\n (this.templates as QueryList<CaxTemplate>).forEach((item) => {\n if (item.getType() === 'removeicon') {\n this.removeIconTemplate = item.template;\n }\n });\n }\n\n containerClass() {\n return {\n 'cax-chip cax-component': true,\n 'cax-chip-image': this.image != null,\n [`cax-chip-${this.severity}`]: !!this.severity,\n [`cax-chip-${this.size}`]: !!this.size\n };\n }\n\n close(event: Event) {\n this.visible = false;\n this.onRemove.emit(event as MouseEvent); // Cast if necessary for MouseEvent-specific handlers\n }\n\n onKeydown(event: KeyboardEvent) {\n if (event.key === 'Enter' || event.key === 'Backspace') {\n this.close(event);\n }\n }\n\n imageError(event: Event) {\n this.onImageError.emit(event);\n }\n}\n","<div\r\n [ngClass]=\"containerClass()\"\r\n [class]=\"styleClass\"\r\n [ngStyle]=\"style\"\r\n *ngIf=\"visible\"\r\n [attr.data-pc-name]=\"'chip'\"\r\n [attr.aria-label]=\"label\"\r\n [attr.data-pc-section]=\"'root'\"\r\n>\r\n <ng-content></ng-content>\r\n <img [src]=\"image\" *ngIf=\"image; else iconTemplate\" (error)=\"imageError($event)\" [alt]=\"alt\" />\r\n <ng-template #iconTemplate>\r\n <span *ngIf=\"icon\" [class]=\"icon\" [ngClass]=\"'cax-chip-icon'\" [attr.data-pc-section]=\"'icon'\"></span>\r\n </ng-template>\r\n <div class=\"-chip-text\" *ngIf=\"label\" [attr.data-pc-section]=\"'label'\">{{ label }}</div>\r\n <ng-container *ngIf=\"removable\">\r\n <ng-container *ngIf=\"!removeIconTemplate\">\r\n <span\r\n tabindex=\"0\"\r\n *ngIf=\"removeIcon\"\r\n [class]=\"removeIcon\"\r\n [ngClass]=\"'cax-chip-remove-icon'\"\r\n [attr.data-pc-section]=\"'removeicon'\"\r\n (click)=\"close($event)\"\r\n (keydown)=\"onKeydown($event)\"\r\n [attr.aria-label]=\"removeAriaLabel\"\r\n role=\"button\"\r\n ></span>\r\n <TimesCircleIcon\r\n tabindex=\"0\"\r\n *ngIf=\"!removeIcon\"\r\n [class]=\"'cax-chip-remove-icon'\"\r\n [attr.data-pc-section]=\"'removeicon'\"\r\n (click)=\"close($event)\"\r\n (keydown)=\"onKeydown($event)\"\r\n [attr.aria-label]=\"removeAriaLabel\"\r\n role=\"button\"\r\n />\r\n </ng-container>\r\n <span\r\n *ngIf=\"removeIconTemplate\"\r\n tabindex=\"0\"\r\n [attr.data-pc-section]=\"'removeicon'\"\r\n class=\"cax-chip-remove-icon\"\r\n (click)=\"close($event)\"\r\n (keydown)=\"onKeydown($event)\"\r\n [attr.aria-label]=\"removeAriaLabel\"\r\n role=\"button\"\r\n >\r\n <ng-template *ngTemplateOutlet=\"removeIconTemplate\"></ng-template>\r\n </span>\r\n </ng-container>\r\n</div>\r\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { Chip } from './chip';\nimport { TimesCircleIcon } from 'cax-design-system/icons/timescircle';\nimport { SharedModule } from 'cax-design-system/api';\n\n@NgModule({\n imports: [CommonModule, TimesCircleIcon, SharedModule],\n declarations: [Chip],\n exports: [Chip, SharedModule]\n})\nexport class ChipModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;;;MAea,IAAI,CAAA;AACJ,IAAA,KAAK,C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AA;;;ACVD;;AAEG;;;;"}
|
|
@@ -7,8 +7,8 @@ import { NG_VALUE_ACCESSOR } from '@angular/forms';
|
|
|
7
7
|
import * as i1 from 'cax-design-system/api';
|
|
8
8
|
import { TranslationKeys } from 'cax-design-system/api';
|
|
9
9
|
import { DomHandler, ConnectedOverlayScrollHandler } from 'cax-design-system/dom';
|
|
10
|
-
import { AutoFocusModule } from 'cax-design-system/autofocus';
|
|
11
10
|
import { ZIndexUtils } from 'cax-design-system/utils';
|
|
11
|
+
import { AutoFocusModule } from 'cax-design-system/autofocus';
|
|
12
12
|
|
|
13
13
|
const COLORPICKER_VALUE_ACCESSOR = {
|
|
14
14
|
provide: NG_VALUE_ACCESSOR,
|
|
@@ -645,113 +645,13 @@ class ColorPicker {
|
|
|
645
645
|
this.onOverlayHide();
|
|
646
646
|
}
|
|
647
647
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.9", ngImport: i0, type: ColorPicker, deps: [{ token: DOCUMENT }, { token: PLATFORM_ID }, { token: i0.ElementRef }, { token: i0.Renderer2 }, { token: i0.ChangeDetectorRef }, { token: i1.caxConfig }, { token: i1.OverlayService }], target: i0.ɵɵFactoryTarget.Component });
|
|
648
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "16.1.0", version: "18.2.9", type: ColorPicker, selector: "
|
|
649
|
-
<div
|
|
650
|
-
#container
|
|
651
|
-
[ngStyle]="style"
|
|
652
|
-
[class]="styleClass"
|
|
653
|
-
[ngClass]="{ 'p-colorpicker p-component': true, 'p-colorpicker-overlay': !inline, 'p-colorpicker-dragging': colorDragging || hueDragging }"
|
|
654
|
-
[attr.data-pc-name]="'colorpicker'"
|
|
655
|
-
[attr.data-pc-section]="'root'"
|
|
656
|
-
>
|
|
657
|
-
<input
|
|
658
|
-
*ngIf="!inline"
|
|
659
|
-
#input
|
|
660
|
-
type="text"
|
|
661
|
-
class="p-colorpicker-preview p-inputtext"
|
|
662
|
-
[ngClass]="{ 'p-disabled': disabled }"
|
|
663
|
-
readonly="readonly"
|
|
664
|
-
[attr.tabindex]="tabindex"
|
|
665
|
-
[disabled]="disabled"
|
|
666
|
-
(click)="onInputClick()"
|
|
667
|
-
(keydown)="onInputKeydown($event)"
|
|
668
|
-
(focus)="onInputFocus()"
|
|
669
|
-
[attr.id]="inputId"
|
|
670
|
-
[style.backgroundColor]="inputBgColor"
|
|
671
|
-
[attr.data-pc-section]="'input'"
|
|
672
|
-
[attr.aria-label]="ariaLabel"
|
|
673
|
-
pAutoFocus
|
|
674
|
-
[autofocus]="autofocus"
|
|
675
|
-
/>
|
|
676
|
-
<div
|
|
677
|
-
*ngIf="inline || overlayVisible"
|
|
678
|
-
[ngClass]="{ 'p-colorpicker-panel': true, 'p-colorpicker-overlay-panel': !inline, 'p-disabled': disabled }"
|
|
679
|
-
(click)="onOverlayClick($event)"
|
|
680
|
-
[@overlayAnimation]="{ value: 'visible', params: { showTransitionParams: showTransitionOptions, hideTransitionParams: hideTransitionOptions } }"
|
|
681
|
-
[@.disabled]="inline === true"
|
|
682
|
-
(@overlayAnimation.start)="onOverlayAnimationStart($event)"
|
|
683
|
-
(@overlayAnimation.done)="onOverlayAnimationEnd($event)"
|
|
684
|
-
[attr.data-pc-section]="'panel'"
|
|
685
|
-
>
|
|
686
|
-
<div class="p-colorpicker-content" [attr.data-pc-section]="'content'">
|
|
687
|
-
<div #colorSelector class="p-colorpicker-color-selector" (touchstart)="onColorDragStart($event)" (touchmove)="onDrag($event)" (touchend)="onDragEnd()" (mousedown)="onColorMousedown($event)" [attr.data-pc-section]="'selector'">
|
|
688
|
-
<div class="p-colorpicker-color" [attr.data-pc-section]="'color'">
|
|
689
|
-
<div #colorHandle class="p-colorpicker-color-handle" [attr.data-pc-section]="'colorHandle'"></div>
|
|
690
|
-
</div>
|
|
691
|
-
</div>
|
|
692
|
-
<div #hue class="p-colorpicker-hue" (mousedown)="onHueMousedown($event)" (touchstart)="onHueDragStart($event)" (touchmove)="onDrag($event)" (touchend)="onDragEnd()" [attr.data-pc-section]="'hue'">
|
|
693
|
-
<div #hueHandle class="p-colorpicker-hue-handle" [attr.data-pc-section]="'hueHandle'"></div>
|
|
694
|
-
</div>
|
|
695
|
-
</div>
|
|
696
|
-
</div>
|
|
697
|
-
</div>
|
|
698
|
-
`, isInline: true, styles: ["@layer cax{.p-colorpicker{display:inline-block}.p-colorpicker-dragging{cursor:pointer}.p-colorpicker-overlay{position:relative}.p-colorpicker-panel{position:relative;width:193px;height:166px}.p-colorpicker-overlay-panel{position:absolute;top:0;left:0}.p-colorpicker-preview{cursor:pointer}.p-colorpicker-panel .p-colorpicker-content{position:relative}.p-colorpicker-panel .p-colorpicker-color-selector{width:150px;height:150px;top:8px;left:8px;position:absolute}.p-colorpicker-panel .p-colorpicker-color{width:150px;height:150px}.p-colorpicker-panel .p-colorpicker-color-handle{position:absolute;top:0;left:150px;border-radius:100%;width:10px;height:10px;border-width:1px;border-style:solid;margin:-5px 0 0 -5px;cursor:pointer;opacity:.85}.p-colorpicker-panel .p-colorpicker-hue{width:17px;height:150px;top:8px;left:167px;position:absolute;opacity:.85}.p-colorpicker-panel .p-colorpicker-hue-handle{position:absolute;top:150px;left:0;width:21px;margin-left:-2px;margin-top:-5px;height:10px;border-width:2px;border-style:solid;opacity:.85;cursor:pointer}}\n"], dependencies: [{ kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }], animations: [trigger('overlayAnimation', [transition(':enter', [style({ opacity: 0, transform: 'scaleY(0.8)' }), animate('{{showTransitionParams}}')]), transition(':leave', [animate('{{hideTransitionParams}}', style({ opacity: 0 }))])])], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
648
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "16.1.0", version: "18.2.9", type: ColorPicker, selector: "cax-colorPicker", inputs: { style: "style", styleClass: "styleClass", inline: ["inline", "inline", booleanAttribute], format: "format", appendTo: "appendTo", disabled: ["disabled", "disabled", booleanAttribute], tabindex: "tabindex", inputId: "inputId", autoZIndex: ["autoZIndex", "autoZIndex", booleanAttribute], baseZIndex: ["baseZIndex", "baseZIndex", numberAttribute], showTransitionOptions: "showTransitionOptions", hideTransitionOptions: "hideTransitionOptions", autofocus: ["autofocus", "autofocus", booleanAttribute] }, outputs: { onChange: "onChange", onShow: "onShow", onHide: "onHide" }, host: { classAttribute: "cax-element" }, providers: [COLORPICKER_VALUE_ACCESSOR], viewQueries: [{ propertyName: "containerViewChild", first: true, predicate: ["container"], descendants: true }, { propertyName: "inputViewChild", first: true, predicate: ["input"], descendants: true }, { propertyName: "colorSelector", first: true, predicate: ["colorSelector"], descendants: true }, { propertyName: "colorHandle", first: true, predicate: ["colorHandle"], descendants: true }, { propertyName: "hue", first: true, predicate: ["hue"], descendants: true }, { propertyName: "hueHandle", first: true, predicate: ["hueHandle"], descendants: true }], ngImport: i0, template: "<div\r\n #container\r\n [ngStyle]=\"style\"\r\n [class]=\"styleClass\"\r\n [ngClass]=\"{ 'cax-colorpicker cax-component': true, 'cax-colorpicker-overlay': !inline, 'cax-colorpicker-dragging': colorDragging || hueDragging }\"\r\n [attr.data-pc-name]=\"'colorpicker'\"\r\n [attr.data-pc-section]=\"'root'\"\r\n>\r\n <input\r\n *ngIf=\"!inline\"\r\n #input\r\n type=\"text\"\r\n class=\"cax-colorpicker-preview cax-inputtext\"\r\n [ngClass]=\"{ 'cax-disabled': disabled }\"\r\n readonly=\"readonly\"\r\n [attr.tabindex]=\"tabindex\"\r\n [disabled]=\"disabled\"\r\n (click)=\"onInputClick()\"\r\n (keydown)=\"onInputKeydown($event)\"\r\n (focus)=\"onInputFocus()\"\r\n [attr.id]=\"inputId\"\r\n [style.backgroundColor]=\"inputBgColor\"\r\n [attr.data-pc-section]=\"'input'\"\r\n [attr.aria-label]=\"ariaLabel\"\r\n pAutoFocus\r\n [autofocus]=\"autofocus\"\r\n />\r\n <div\r\n *ngIf=\"inline || overlayVisible\"\r\n [ngClass]=\"{ 'cax-colorpicker-panel': true, 'cax-colorpicker-overlay-panel': !inline, 'cax-disabled': disabled }\"\r\n (click)=\"onOverlayClick($event)\"\r\n [@overlayAnimation]=\"{ value: 'visible', params: { showTransitionParams: showTransitionOptions, hideTransitionParams: hideTransitionOptions } }\"\r\n [@.disabled]=\"inline === true\"\r\n (@overlayAnimation.start)=\"onOverlayAnimationStart($event)\"\r\n (@overlayAnimation.done)=\"onOverlayAnimationEnd($event)\"\r\n [attr.data-pc-section]=\"'panel'\"\r\n >\r\n <div class=\"cax-colorpicker-content\" [attr.data-pc-section]=\"'content'\">\r\n <div #colorSelector class=\"cax-colorpicker-color-selector\" (touchstart)=\"onColorDragStart($event)\" (touchmove)=\"onDrag($event)\" (touchend)=\"onDragEnd()\" (mousedown)=\"onColorMousedown($event)\" [attr.data-pc-section]=\"'selector'\">\r\n <div class=\"cax-colorpicker-color\" [attr.data-pc-section]=\"'color'\">\r\n <div #colorHandle class=\"cax-colorpicker-color-handle\" [attr.data-pc-section]=\"'colorHandle'\"></div>\r\n </div>\r\n </div>\r\n <div #hue class=\"cax-colorpicker-hue\" (mousedown)=\"onHueMousedown($event)\" (touchstart)=\"onHueDragStart($event)\" (touchmove)=\"onDrag($event)\" (touchend)=\"onDragEnd()\" [attr.data-pc-section]=\"'hue'\">\r\n <div #hueHandle class=\"cax-colorpicker-hue-handle\" [attr.data-pc-section]=\"'hueHandle'\"></div>\r\n </div>\r\n </div>\r\n </div>\r\n</div>\r\n", styles: ["@layer cax{.cax-colorpicker{display:inline-block}.cax-colorpicker-dragging{cursor:pointer}.cax-colorpicker-overlay{position:relative}.cax-colorpicker-panel{position:relative;min-width:198px;min-height:174px;border-radius:var(--radius-100)}.cax-colorpicker-overlay-panel{position:absolute;top:0;left:0}.cax-colorpicker-preview{cursor:pointer}.cax-colorpicker-panel .cax-colorpicker-content{position:relative;margin:var(--space-100)}.cax-colorpicker-panel .cax-colorpicker-color-selector{width:150px;height:150px;position:absolute}.cax-colorpicker-panel .cax-colorpicker-color{width:150px;height:150px}.cax-colorpicker-panel .cax-colorpicker-color-handle{position:absolute;top:0;left:150px;border-radius:100%;width:10px;height:10px;border-width:1px;border-style:solid;margin:-5px 0 0 -5px;cursor:pointer;opacity:.85}.cax-colorpicker-panel .cax-colorpicker-hue{width:16px;height:150px;left:165px;position:absolute;opacity:.85}.cax-colorpicker-panel .cax-colorpicker-hue-handle{position:absolute;top:150px;left:0;width:20px;margin-left:-2px;margin-top:-5px;height:10px;border-width:2px;border-style:solid;opacity:.85;cursor:pointer}}\n"], dependencies: [{ kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }], animations: [trigger('overlayAnimation', [transition(':enter', [style({ opacity: 0, transform: 'scaleY(0.8)' }), animate('{{showTransitionParams}}')]), transition(':leave', [animate('{{hideTransitionParams}}', style({ opacity: 0 }))])])], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
699
649
|
}
|
|
700
650
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.9", ngImport: i0, type: ColorPicker, decorators: [{
|
|
701
651
|
type: Component,
|
|
702
|
-
args: [{ selector: '
|
|
703
|
-
<div
|
|
704
|
-
#container
|
|
705
|
-
[ngStyle]="style"
|
|
706
|
-
[class]="styleClass"
|
|
707
|
-
[ngClass]="{ 'p-colorpicker p-component': true, 'p-colorpicker-overlay': !inline, 'p-colorpicker-dragging': colorDragging || hueDragging }"
|
|
708
|
-
[attr.data-pc-name]="'colorpicker'"
|
|
709
|
-
[attr.data-pc-section]="'root'"
|
|
710
|
-
>
|
|
711
|
-
<input
|
|
712
|
-
*ngIf="!inline"
|
|
713
|
-
#input
|
|
714
|
-
type="text"
|
|
715
|
-
class="p-colorpicker-preview p-inputtext"
|
|
716
|
-
[ngClass]="{ 'p-disabled': disabled }"
|
|
717
|
-
readonly="readonly"
|
|
718
|
-
[attr.tabindex]="tabindex"
|
|
719
|
-
[disabled]="disabled"
|
|
720
|
-
(click)="onInputClick()"
|
|
721
|
-
(keydown)="onInputKeydown($event)"
|
|
722
|
-
(focus)="onInputFocus()"
|
|
723
|
-
[attr.id]="inputId"
|
|
724
|
-
[style.backgroundColor]="inputBgColor"
|
|
725
|
-
[attr.data-pc-section]="'input'"
|
|
726
|
-
[attr.aria-label]="ariaLabel"
|
|
727
|
-
pAutoFocus
|
|
728
|
-
[autofocus]="autofocus"
|
|
729
|
-
/>
|
|
730
|
-
<div
|
|
731
|
-
*ngIf="inline || overlayVisible"
|
|
732
|
-
[ngClass]="{ 'p-colorpicker-panel': true, 'p-colorpicker-overlay-panel': !inline, 'p-disabled': disabled }"
|
|
733
|
-
(click)="onOverlayClick($event)"
|
|
734
|
-
[@overlayAnimation]="{ value: 'visible', params: { showTransitionParams: showTransitionOptions, hideTransitionParams: hideTransitionOptions } }"
|
|
735
|
-
[@.disabled]="inline === true"
|
|
736
|
-
(@overlayAnimation.start)="onOverlayAnimationStart($event)"
|
|
737
|
-
(@overlayAnimation.done)="onOverlayAnimationEnd($event)"
|
|
738
|
-
[attr.data-pc-section]="'panel'"
|
|
739
|
-
>
|
|
740
|
-
<div class="p-colorpicker-content" [attr.data-pc-section]="'content'">
|
|
741
|
-
<div #colorSelector class="p-colorpicker-color-selector" (touchstart)="onColorDragStart($event)" (touchmove)="onDrag($event)" (touchend)="onDragEnd()" (mousedown)="onColorMousedown($event)" [attr.data-pc-section]="'selector'">
|
|
742
|
-
<div class="p-colorpicker-color" [attr.data-pc-section]="'color'">
|
|
743
|
-
<div #colorHandle class="p-colorpicker-color-handle" [attr.data-pc-section]="'colorHandle'"></div>
|
|
744
|
-
</div>
|
|
745
|
-
</div>
|
|
746
|
-
<div #hue class="p-colorpicker-hue" (mousedown)="onHueMousedown($event)" (touchstart)="onHueDragStart($event)" (touchmove)="onDrag($event)" (touchend)="onDragEnd()" [attr.data-pc-section]="'hue'">
|
|
747
|
-
<div #hueHandle class="p-colorpicker-hue-handle" [attr.data-pc-section]="'hueHandle'"></div>
|
|
748
|
-
</div>
|
|
749
|
-
</div>
|
|
750
|
-
</div>
|
|
751
|
-
</div>
|
|
752
|
-
`, animations: [trigger('overlayAnimation', [transition(':enter', [style({ opacity: 0, transform: 'scaleY(0.8)' }), animate('{{showTransitionParams}}')]), transition(':leave', [animate('{{hideTransitionParams}}', style({ opacity: 0 }))])])], providers: [COLORPICKER_VALUE_ACCESSOR], changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, host: {
|
|
652
|
+
args: [{ selector: 'cax-colorPicker', animations: [trigger('overlayAnimation', [transition(':enter', [style({ opacity: 0, transform: 'scaleY(0.8)' }), animate('{{showTransitionParams}}')]), transition(':leave', [animate('{{hideTransitionParams}}', style({ opacity: 0 }))])])], providers: [COLORPICKER_VALUE_ACCESSOR], changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, host: {
|
|
753
653
|
class: 'cax-element'
|
|
754
|
-
}, styles: ["@layer cax{.
|
|
654
|
+
}, template: "<div\r\n #container\r\n [ngStyle]=\"style\"\r\n [class]=\"styleClass\"\r\n [ngClass]=\"{ 'cax-colorpicker cax-component': true, 'cax-colorpicker-overlay': !inline, 'cax-colorpicker-dragging': colorDragging || hueDragging }\"\r\n [attr.data-pc-name]=\"'colorpicker'\"\r\n [attr.data-pc-section]=\"'root'\"\r\n>\r\n <input\r\n *ngIf=\"!inline\"\r\n #input\r\n type=\"text\"\r\n class=\"cax-colorpicker-preview cax-inputtext\"\r\n [ngClass]=\"{ 'cax-disabled': disabled }\"\r\n readonly=\"readonly\"\r\n [attr.tabindex]=\"tabindex\"\r\n [disabled]=\"disabled\"\r\n (click)=\"onInputClick()\"\r\n (keydown)=\"onInputKeydown($event)\"\r\n (focus)=\"onInputFocus()\"\r\n [attr.id]=\"inputId\"\r\n [style.backgroundColor]=\"inputBgColor\"\r\n [attr.data-pc-section]=\"'input'\"\r\n [attr.aria-label]=\"ariaLabel\"\r\n pAutoFocus\r\n [autofocus]=\"autofocus\"\r\n />\r\n <div\r\n *ngIf=\"inline || overlayVisible\"\r\n [ngClass]=\"{ 'cax-colorpicker-panel': true, 'cax-colorpicker-overlay-panel': !inline, 'cax-disabled': disabled }\"\r\n (click)=\"onOverlayClick($event)\"\r\n [@overlayAnimation]=\"{ value: 'visible', params: { showTransitionParams: showTransitionOptions, hideTransitionParams: hideTransitionOptions } }\"\r\n [@.disabled]=\"inline === true\"\r\n (@overlayAnimation.start)=\"onOverlayAnimationStart($event)\"\r\n (@overlayAnimation.done)=\"onOverlayAnimationEnd($event)\"\r\n [attr.data-pc-section]=\"'panel'\"\r\n >\r\n <div class=\"cax-colorpicker-content\" [attr.data-pc-section]=\"'content'\">\r\n <div #colorSelector class=\"cax-colorpicker-color-selector\" (touchstart)=\"onColorDragStart($event)\" (touchmove)=\"onDrag($event)\" (touchend)=\"onDragEnd()\" (mousedown)=\"onColorMousedown($event)\" [attr.data-pc-section]=\"'selector'\">\r\n <div class=\"cax-colorpicker-color\" [attr.data-pc-section]=\"'color'\">\r\n <div #colorHandle class=\"cax-colorpicker-color-handle\" [attr.data-pc-section]=\"'colorHandle'\"></div>\r\n </div>\r\n </div>\r\n <div #hue class=\"cax-colorpicker-hue\" (mousedown)=\"onHueMousedown($event)\" (touchstart)=\"onHueDragStart($event)\" (touchmove)=\"onDrag($event)\" (touchend)=\"onDragEnd()\" [attr.data-pc-section]=\"'hue'\">\r\n <div #hueHandle class=\"cax-colorpicker-hue-handle\" [attr.data-pc-section]=\"'hueHandle'\"></div>\r\n </div>\r\n </div>\r\n </div>\r\n</div>\r\n", styles: ["@layer cax{.cax-colorpicker{display:inline-block}.cax-colorpicker-dragging{cursor:pointer}.cax-colorpicker-overlay{position:relative}.cax-colorpicker-panel{position:relative;min-width:198px;min-height:174px;border-radius:var(--radius-100)}.cax-colorpicker-overlay-panel{position:absolute;top:0;left:0}.cax-colorpicker-preview{cursor:pointer}.cax-colorpicker-panel .cax-colorpicker-content{position:relative;margin:var(--space-100)}.cax-colorpicker-panel .cax-colorpicker-color-selector{width:150px;height:150px;position:absolute}.cax-colorpicker-panel .cax-colorpicker-color{width:150px;height:150px}.cax-colorpicker-panel .cax-colorpicker-color-handle{position:absolute;top:0;left:150px;border-radius:100%;width:10px;height:10px;border-width:1px;border-style:solid;margin:-5px 0 0 -5px;cursor:pointer;opacity:.85}.cax-colorpicker-panel .cax-colorpicker-hue{width:16px;height:150px;left:165px;position:absolute;opacity:.85}.cax-colorpicker-panel .cax-colorpicker-hue-handle{position:absolute;top:150px;left:0;width:20px;margin-left:-2px;margin-top:-5px;height:10px;border-width:2px;border-style:solid;opacity:.85;cursor:pointer}}\n"] }]
|
|
755
655
|
}], ctorParameters: () => [{ type: Document, decorators: [{
|
|
756
656
|
type: Inject,
|
|
757
657
|
args: [DOCUMENT]
|
|
@@ -814,6 +714,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.9", ngImpor
|
|
|
814
714
|
type: ViewChild,
|
|
815
715
|
args: ['hueHandle']
|
|
816
716
|
}] } });
|
|
717
|
+
|
|
817
718
|
class ColorPickerModule {
|
|
818
719
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.9", ngImport: i0, type: ColorPickerModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
819
720
|
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.2.9", ngImport: i0, type: ColorPickerModule, declarations: [ColorPicker], imports: [CommonModule, AutoFocusModule], exports: [ColorPicker] });
|