@weeehaoooz/talos-ui 0.1.1 → 0.1.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/README.md +2 -0
- package/fesm2022/{weeehaoooz-talos-ui-button-button-group.mjs → weeehaoooz-talos-ui-button.mjs} +91 -15
- package/fesm2022/weeehaoooz-talos-ui-button.mjs.map +1 -0
- package/fesm2022/weeehaoooz-talos-ui-data-display.mjs +3110 -0
- package/fesm2022/weeehaoooz-talos-ui-data-display.mjs.map +1 -0
- package/fesm2022/weeehaoooz-talos-ui-data-viz.mjs +2414 -0
- package/fesm2022/weeehaoooz-talos-ui-data-viz.mjs.map +1 -0
- package/fesm2022/weeehaoooz-talos-ui-dropdown.mjs +1039 -0
- package/fesm2022/weeehaoooz-talos-ui-dropdown.mjs.map +1 -0
- package/fesm2022/weeehaoooz-talos-ui-feedback.mjs +2885 -0
- package/fesm2022/weeehaoooz-talos-ui-feedback.mjs.map +1 -0
- package/fesm2022/weeehaoooz-talos-ui-form.mjs +10799 -0
- package/fesm2022/weeehaoooz-talos-ui-form.mjs.map +1 -0
- package/fesm2022/weeehaoooz-talos-ui-layout.mjs +1316 -7
- package/fesm2022/weeehaoooz-talos-ui-layout.mjs.map +1 -1
- package/fesm2022/weeehaoooz-talos-ui-nav.mjs +3 -3
- package/fesm2022/weeehaoooz-talos-ui-nav.mjs.map +1 -1
- package/fesm2022/weeehaoooz-talos-ui.mjs +21592 -16293
- package/fesm2022/weeehaoooz-talos-ui.mjs.map +1 -1
- package/package.json +20 -139
- package/styles/_breadcrumb.scss +16 -0
- package/styles/_button-group.scss +2 -1
- package/styles/_buttons.scss +51 -0
- package/styles/_dropdown.scss +438 -0
- package/styles/_form-controls.scss +13 -0
- package/styles/_progress-bar.scss +43 -0
- package/styles/_skeleton.scss +176 -0
- package/styles/_spinner.scss +58 -0
- package/styles/_variables.scss +33 -0
- package/styles/index.scss +6 -1
- package/types/weeehaoooz-talos-ui-button.d.ts +92 -0
- package/types/weeehaoooz-talos-ui-button.d.ts.map +1 -0
- package/types/weeehaoooz-talos-ui-data-display.d.ts +1018 -0
- package/types/weeehaoooz-talos-ui-data-display.d.ts.map +1 -0
- package/types/weeehaoooz-talos-ui-data-viz.d.ts +839 -0
- package/types/weeehaoooz-talos-ui-data-viz.d.ts.map +1 -0
- package/types/weeehaoooz-talos-ui-dropdown.d.ts +187 -0
- package/types/weeehaoooz-talos-ui-dropdown.d.ts.map +1 -0
- package/types/weeehaoooz-talos-ui-feedback.d.ts +1495 -0
- package/types/weeehaoooz-talos-ui-feedback.d.ts.map +1 -0
- package/types/weeehaoooz-talos-ui-form.d.ts +2639 -0
- package/types/weeehaoooz-talos-ui-form.d.ts.map +1 -0
- package/types/weeehaoooz-talos-ui-layout.d.ts +851 -3
- package/types/weeehaoooz-talos-ui-layout.d.ts.map +1 -1
- package/types/weeehaoooz-talos-ui-nav.d.ts +1 -1
- package/types/weeehaoooz-talos-ui.d.ts +7148 -4629
- package/types/weeehaoooz-talos-ui.d.ts.map +1 -1
- package/fesm2022/weeehaoooz-talos-ui-button-button-group.mjs.map +0 -1
- package/fesm2022/weeehaoooz-talos-ui-button-button.mjs +0 -94
- package/fesm2022/weeehaoooz-talos-ui-button-button.mjs.map +0 -1
- package/fesm2022/weeehaoooz-talos-ui-data-display-badge.mjs +0 -233
- package/fesm2022/weeehaoooz-talos-ui-data-display-badge.mjs.map +0 -1
- package/fesm2022/weeehaoooz-talos-ui-data-display-data-grid.mjs +0 -1627
- package/fesm2022/weeehaoooz-talos-ui-data-display-data-grid.mjs.map +0 -1
- package/fesm2022/weeehaoooz-talos-ui-data-display-status-tag.mjs +0 -361
- package/fesm2022/weeehaoooz-talos-ui-data-display-status-tag.mjs.map +0 -1
- package/fesm2022/weeehaoooz-talos-ui-data-display-timeline.mjs +0 -312
- package/fesm2022/weeehaoooz-talos-ui-data-display-timeline.mjs.map +0 -1
- package/fesm2022/weeehaoooz-talos-ui-data-display-trend-indicator.mjs +0 -235
- package/fesm2022/weeehaoooz-talos-ui-data-display-trend-indicator.mjs.map +0 -1
- package/fesm2022/weeehaoooz-talos-ui-data-viz-category-bar.mjs +0 -462
- package/fesm2022/weeehaoooz-talos-ui-data-viz-category-bar.mjs.map +0 -1
- package/fesm2022/weeehaoooz-talos-ui-data-viz-heatmap.mjs +0 -805
- package/fesm2022/weeehaoooz-talos-ui-data-viz-heatmap.mjs.map +0 -1
- package/fesm2022/weeehaoooz-talos-ui-data-viz-mini-donut.mjs +0 -267
- package/fesm2022/weeehaoooz-talos-ui-data-viz-mini-donut.mjs.map +0 -1
- package/fesm2022/weeehaoooz-talos-ui-data-viz-mini-gauge.mjs +0 -351
- package/fesm2022/weeehaoooz-talos-ui-data-viz-mini-gauge.mjs.map +0 -1
- package/fesm2022/weeehaoooz-talos-ui-data-viz-sparkline.mjs +0 -566
- package/fesm2022/weeehaoooz-talos-ui-data-viz-sparkline.mjs.map +0 -1
- package/fesm2022/weeehaoooz-talos-ui-feedback-alert.mjs +0 -534
- package/fesm2022/weeehaoooz-talos-ui-feedback-alert.mjs.map +0 -1
- package/fesm2022/weeehaoooz-talos-ui-feedback-dialog.mjs +0 -446
- package/fesm2022/weeehaoooz-talos-ui-feedback-dialog.mjs.map +0 -1
- package/fesm2022/weeehaoooz-talos-ui-feedback-snackbar.mjs +0 -376
- package/fesm2022/weeehaoooz-talos-ui-feedback-snackbar.mjs.map +0 -1
- package/fesm2022/weeehaoooz-talos-ui-feedback-tooltip.mjs +0 -147
- package/fesm2022/weeehaoooz-talos-ui-feedback-tooltip.mjs.map +0 -1
- package/fesm2022/weeehaoooz-talos-ui-form-affix.mjs +0 -242
- package/fesm2022/weeehaoooz-talos-ui-form-affix.mjs.map +0 -1
- package/fesm2022/weeehaoooz-talos-ui-form-autocomplete.mjs +0 -514
- package/fesm2022/weeehaoooz-talos-ui-form-autocomplete.mjs.map +0 -1
- package/fesm2022/weeehaoooz-talos-ui-form-checkbox.mjs +0 -548
- package/fesm2022/weeehaoooz-talos-ui-form-checkbox.mjs.map +0 -1
- package/fesm2022/weeehaoooz-talos-ui-form-chips.mjs +0 -692
- package/fesm2022/weeehaoooz-talos-ui-form-chips.mjs.map +0 -1
- package/fesm2022/weeehaoooz-talos-ui-form-color-picker.mjs +0 -761
- package/fesm2022/weeehaoooz-talos-ui-form-color-picker.mjs.map +0 -1
- package/fesm2022/weeehaoooz-talos-ui-form-date-picker.mjs +0 -896
- package/fesm2022/weeehaoooz-talos-ui-form-date-picker.mjs.map +0 -1
- package/fesm2022/weeehaoooz-talos-ui-form-date-range-picker.mjs +0 -872
- package/fesm2022/weeehaoooz-talos-ui-form-date-range-picker.mjs.map +0 -1
- package/fesm2022/weeehaoooz-talos-ui-form-date-time-picker.mjs +0 -119
- package/fesm2022/weeehaoooz-talos-ui-form-date-time-picker.mjs.map +0 -1
- package/fesm2022/weeehaoooz-talos-ui-form-date-time-range-picker.mjs +0 -135
- package/fesm2022/weeehaoooz-talos-ui-form-date-time-range-picker.mjs.map +0 -1
- package/fesm2022/weeehaoooz-talos-ui-form-drop-zone.mjs +0 -666
- package/fesm2022/weeehaoooz-talos-ui-form-drop-zone.mjs.map +0 -1
- package/fesm2022/weeehaoooz-talos-ui-form-form-field.mjs +0 -147
- package/fesm2022/weeehaoooz-talos-ui-form-form-field.mjs.map +0 -1
- package/fesm2022/weeehaoooz-talos-ui-form-input.mjs +0 -33
- package/fesm2022/weeehaoooz-talos-ui-form-input.mjs.map +0 -1
- package/fesm2022/weeehaoooz-talos-ui-form-otp.mjs +0 -455
- package/fesm2022/weeehaoooz-talos-ui-form-otp.mjs.map +0 -1
- package/fesm2022/weeehaoooz-talos-ui-form-password-input.mjs +0 -379
- package/fesm2022/weeehaoooz-talos-ui-form-password-input.mjs.map +0 -1
- package/fesm2022/weeehaoooz-talos-ui-form-radio.mjs +0 -297
- package/fesm2022/weeehaoooz-talos-ui-form-radio.mjs.map +0 -1
- package/fesm2022/weeehaoooz-talos-ui-form-range-input.mjs +0 -661
- package/fesm2022/weeehaoooz-talos-ui-form-range-input.mjs.map +0 -1
- package/fesm2022/weeehaoooz-talos-ui-form-rating.mjs +0 -346
- package/fesm2022/weeehaoooz-talos-ui-form-rating.mjs.map +0 -1
- package/fesm2022/weeehaoooz-talos-ui-form-select-input.mjs +0 -896
- package/fesm2022/weeehaoooz-talos-ui-form-select-input.mjs.map +0 -1
- package/fesm2022/weeehaoooz-talos-ui-form-slide-toggle.mjs +0 -252
- package/fesm2022/weeehaoooz-talos-ui-form-slide-toggle.mjs.map +0 -1
- package/fesm2022/weeehaoooz-talos-ui-form-transfer-list.mjs +0 -916
- package/fesm2022/weeehaoooz-talos-ui-form-transfer-list.mjs.map +0 -1
- package/types/weeehaoooz-talos-ui-button-button-group.d.ts +0 -62
- package/types/weeehaoooz-talos-ui-button-button-group.d.ts.map +0 -1
- package/types/weeehaoooz-talos-ui-button-button.d.ts +0 -38
- package/types/weeehaoooz-talos-ui-button-button.d.ts.map +0 -1
- package/types/weeehaoooz-talos-ui-data-display-badge.d.ts +0 -119
- package/types/weeehaoooz-talos-ui-data-display-badge.d.ts.map +0 -1
- package/types/weeehaoooz-talos-ui-data-display-data-grid.d.ts +0 -272
- package/types/weeehaoooz-talos-ui-data-display-data-grid.d.ts.map +0 -1
- package/types/weeehaoooz-talos-ui-data-display-status-tag.d.ts +0 -135
- package/types/weeehaoooz-talos-ui-data-display-status-tag.d.ts.map +0 -1
- package/types/weeehaoooz-talos-ui-data-display-timeline.d.ts +0 -144
- package/types/weeehaoooz-talos-ui-data-display-timeline.d.ts.map +0 -1
- package/types/weeehaoooz-talos-ui-data-display-trend-indicator.d.ts +0 -83
- package/types/weeehaoooz-talos-ui-data-display-trend-indicator.d.ts.map +0 -1
- package/types/weeehaoooz-talos-ui-data-viz-category-bar.d.ts +0 -255
- package/types/weeehaoooz-talos-ui-data-viz-category-bar.d.ts.map +0 -1
- package/types/weeehaoooz-talos-ui-data-viz-heatmap.d.ts +0 -204
- package/types/weeehaoooz-talos-ui-data-viz-heatmap.d.ts.map +0 -1
- package/types/weeehaoooz-talos-ui-data-viz-mini-donut.d.ts +0 -101
- package/types/weeehaoooz-talos-ui-data-viz-mini-donut.d.ts.map +0 -1
- package/types/weeehaoooz-talos-ui-data-viz-mini-gauge.d.ts +0 -138
- package/types/weeehaoooz-talos-ui-data-viz-mini-gauge.d.ts.map +0 -1
- package/types/weeehaoooz-talos-ui-data-viz-sparkline.d.ts +0 -161
- package/types/weeehaoooz-talos-ui-data-viz-sparkline.d.ts.map +0 -1
- package/types/weeehaoooz-talos-ui-feedback-alert.d.ts +0 -212
- package/types/weeehaoooz-talos-ui-feedback-alert.d.ts.map +0 -1
- package/types/weeehaoooz-talos-ui-feedback-dialog.d.ts +0 -259
- package/types/weeehaoooz-talos-ui-feedback-dialog.d.ts.map +0 -1
- package/types/weeehaoooz-talos-ui-feedback-snackbar.d.ts +0 -147
- package/types/weeehaoooz-talos-ui-feedback-snackbar.d.ts.map +0 -1
- package/types/weeehaoooz-talos-ui-feedback-tooltip.d.ts +0 -32
- package/types/weeehaoooz-talos-ui-feedback-tooltip.d.ts.map +0 -1
- package/types/weeehaoooz-talos-ui-form-affix.d.ts +0 -88
- package/types/weeehaoooz-talos-ui-form-affix.d.ts.map +0 -1
- package/types/weeehaoooz-talos-ui-form-autocomplete.d.ts +0 -113
- package/types/weeehaoooz-talos-ui-form-autocomplete.d.ts.map +0 -1
- package/types/weeehaoooz-talos-ui-form-checkbox.d.ts +0 -165
- package/types/weeehaoooz-talos-ui-form-checkbox.d.ts.map +0 -1
- package/types/weeehaoooz-talos-ui-form-chips.d.ts +0 -152
- package/types/weeehaoooz-talos-ui-form-chips.d.ts.map +0 -1
- package/types/weeehaoooz-talos-ui-form-color-picker.d.ts +0 -144
- package/types/weeehaoooz-talos-ui-form-color-picker.d.ts.map +0 -1
- package/types/weeehaoooz-talos-ui-form-date-picker.d.ts +0 -138
- package/types/weeehaoooz-talos-ui-form-date-picker.d.ts.map +0 -1
- package/types/weeehaoooz-talos-ui-form-date-range-picker.d.ts +0 -148
- package/types/weeehaoooz-talos-ui-form-date-range-picker.d.ts.map +0 -1
- package/types/weeehaoooz-talos-ui-form-date-time-picker.d.ts +0 -44
- package/types/weeehaoooz-talos-ui-form-date-time-picker.d.ts.map +0 -1
- package/types/weeehaoooz-talos-ui-form-date-time-range-picker.d.ts +0 -48
- package/types/weeehaoooz-talos-ui-form-date-time-range-picker.d.ts.map +0 -1
- package/types/weeehaoooz-talos-ui-form-drop-zone.d.ts +0 -227
- package/types/weeehaoooz-talos-ui-form-drop-zone.d.ts.map +0 -1
- package/types/weeehaoooz-talos-ui-form-form-field.d.ts +0 -42
- package/types/weeehaoooz-talos-ui-form-form-field.d.ts.map +0 -1
- package/types/weeehaoooz-talos-ui-form-input.d.ts +0 -15
- package/types/weeehaoooz-talos-ui-form-input.d.ts.map +0 -1
- package/types/weeehaoooz-talos-ui-form-otp.d.ts +0 -111
- package/types/weeehaoooz-talos-ui-form-otp.d.ts.map +0 -1
- package/types/weeehaoooz-talos-ui-form-password-input.d.ts +0 -145
- package/types/weeehaoooz-talos-ui-form-password-input.d.ts.map +0 -1
- package/types/weeehaoooz-talos-ui-form-radio.d.ts +0 -84
- package/types/weeehaoooz-talos-ui-form-radio.d.ts.map +0 -1
- package/types/weeehaoooz-talos-ui-form-range-input.d.ts +0 -181
- package/types/weeehaoooz-talos-ui-form-range-input.d.ts.map +0 -1
- package/types/weeehaoooz-talos-ui-form-rating.d.ts +0 -110
- package/types/weeehaoooz-talos-ui-form-rating.d.ts.map +0 -1
- package/types/weeehaoooz-talos-ui-form-select-input.d.ts +0 -195
- package/types/weeehaoooz-talos-ui-form-select-input.d.ts.map +0 -1
- package/types/weeehaoooz-talos-ui-form-slide-toggle.d.ts +0 -79
- package/types/weeehaoooz-talos-ui-form-slide-toggle.d.ts.map +0 -1
- package/types/weeehaoooz-talos-ui-form-transfer-list.d.ts +0 -192
- package/types/weeehaoooz-talos-ui-form-transfer-list.d.ts.map +0 -1
|
@@ -1,548 +0,0 @@
|
|
|
1
|
-
import * as i0 from '@angular/core';
|
|
2
|
-
import { inject, ElementRef, input, output, signal, computed, forwardRef, Directive, effect, Component, viewChild, NgModule } from '@angular/core';
|
|
3
|
-
import { NG_VALUE_ACCESSOR } from '@angular/forms';
|
|
4
|
-
|
|
5
|
-
let groupCounter = 0;
|
|
6
|
-
class TalosCheckboxGroupDirective {
|
|
7
|
-
elementRef = inject((ElementRef));
|
|
8
|
-
/** Name attribute for the checkbox group */
|
|
9
|
-
name = input(`talos-checkbox-group-${++groupCounter}`, /* @ts-ignore */
|
|
10
|
-
...(ngDevMode ? [{ debugName: "name" }] : /* istanbul ignore next */ []));
|
|
11
|
-
/** Size applied to all child checkboxes unless overridden */
|
|
12
|
-
size = input('md', /* @ts-ignore */
|
|
13
|
-
...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
|
|
14
|
-
/** Visual color variant applied to all child checkboxes */
|
|
15
|
-
variant = input('primary', /* @ts-ignore */
|
|
16
|
-
...(ngDevMode ? [{ debugName: "variant" }] : /* istanbul ignore next */ []));
|
|
17
|
-
/** Layout direction of checkboxes within group */
|
|
18
|
-
direction = input('vertical', /* @ts-ignore */
|
|
19
|
-
...(ngDevMode ? [{ debugName: "direction" }] : /* istanbul ignore next */ []));
|
|
20
|
-
/** Whether the entire checkbox group is disabled */
|
|
21
|
-
disabled = input(false, /* @ts-ignore */
|
|
22
|
-
...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
|
|
23
|
-
/** Whether the group is in an invalid error state */
|
|
24
|
-
invalid = input(false, /* @ts-ignore */
|
|
25
|
-
...(ngDevMode ? [{ debugName: "invalid" }] : /* istanbul ignore next */ []));
|
|
26
|
-
/** Emits when group selection array changes */
|
|
27
|
-
valueChange = output();
|
|
28
|
-
// Internal state
|
|
29
|
-
value = signal([], /* @ts-ignore */
|
|
30
|
-
...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
|
|
31
|
-
isDisabled = signal(false, /* @ts-ignore */
|
|
32
|
-
...(ngDevMode ? [{ debugName: "isDisabled" }] : /* istanbul ignore next */ []));
|
|
33
|
-
isTouched = signal(false, /* @ts-ignore */
|
|
34
|
-
...(ngDevMode ? [{ debugName: "isTouched" }] : /* istanbul ignore next */ []));
|
|
35
|
-
/** Effective disabled state taking into account CVA and input */
|
|
36
|
-
effectiveDisabled = computed(() => this.disabled() || this.isDisabled(), /* @ts-ignore */
|
|
37
|
-
...(ngDevMode ? [{ debugName: "effectiveDisabled" }] : /* istanbul ignore next */ []));
|
|
38
|
-
onChange = () => { };
|
|
39
|
-
onTouched = () => { };
|
|
40
|
-
// --- ControlValueAccessor Interface ---
|
|
41
|
-
writeValue(val) {
|
|
42
|
-
if (Array.isArray(val)) {
|
|
43
|
-
this.value.set([...val]);
|
|
44
|
-
}
|
|
45
|
-
else if (val === null || val === undefined) {
|
|
46
|
-
this.value.set([]);
|
|
47
|
-
}
|
|
48
|
-
else {
|
|
49
|
-
this.value.set([val]);
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
registerOnChange(fn) {
|
|
53
|
-
this.onChange = fn;
|
|
54
|
-
}
|
|
55
|
-
registerOnTouched(fn) {
|
|
56
|
-
this.onTouched = fn;
|
|
57
|
-
}
|
|
58
|
-
setDisabledState(isDisabled) {
|
|
59
|
-
this.isDisabled.set(isDisabled);
|
|
60
|
-
}
|
|
61
|
-
/** Helper to check if a specific item value is currently selected in group */
|
|
62
|
-
isValueSelected(val) {
|
|
63
|
-
return this.value().includes(val);
|
|
64
|
-
}
|
|
65
|
-
/** Toggles the selection status of a value in the group array */
|
|
66
|
-
toggleValue(val) {
|
|
67
|
-
if (this.effectiveDisabled() || val === undefined)
|
|
68
|
-
return;
|
|
69
|
-
const current = this.value();
|
|
70
|
-
let updated;
|
|
71
|
-
if (current.includes(val)) {
|
|
72
|
-
updated = current.filter((v) => v !== val);
|
|
73
|
-
}
|
|
74
|
-
else {
|
|
75
|
-
updated = [...current, val];
|
|
76
|
-
}
|
|
77
|
-
this.value.set(updated);
|
|
78
|
-
this.onChange(updated);
|
|
79
|
-
this.valueChange.emit(updated);
|
|
80
|
-
this.markAsTouched();
|
|
81
|
-
}
|
|
82
|
-
/** Selects all passed values */
|
|
83
|
-
selectAll(values) {
|
|
84
|
-
if (this.effectiveDisabled())
|
|
85
|
-
return;
|
|
86
|
-
const uniqueValues = Array.from(new Set(values));
|
|
87
|
-
this.value.set(uniqueValues);
|
|
88
|
-
this.onChange(uniqueValues);
|
|
89
|
-
this.valueChange.emit(uniqueValues);
|
|
90
|
-
this.markAsTouched();
|
|
91
|
-
}
|
|
92
|
-
/** Deselects all values */
|
|
93
|
-
deselectAll() {
|
|
94
|
-
if (this.effectiveDisabled())
|
|
95
|
-
return;
|
|
96
|
-
this.value.set([]);
|
|
97
|
-
this.onChange([]);
|
|
98
|
-
this.valueChange.emit([]);
|
|
99
|
-
this.markAsTouched();
|
|
100
|
-
}
|
|
101
|
-
markAsTouched() {
|
|
102
|
-
if (!this.isTouched()) {
|
|
103
|
-
this.isTouched.set(true);
|
|
104
|
-
this.onTouched();
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: TalosCheckboxGroupDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
108
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.1.1", type: TalosCheckboxGroupDirective, isStandalone: true, selector: "[talosCheckboxGroup], [talos-checkbox-group]", inputs: { name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, direction: { classPropertyName: "direction", publicName: "direction", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, invalid: { classPropertyName: "invalid", publicName: "invalid", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { valueChange: "valueChange" }, host: { attributes: { "role": "group" }, properties: { "class.direction-vertical": "direction() === \"vertical\"", "class.direction-horizontal": "direction() === \"horizontal\"", "class.is-disabled": "effectiveDisabled()", "class.is-invalid": "invalid()" }, classAttribute: "talos-checkbox-group" }, providers: [
|
|
109
|
-
{
|
|
110
|
-
provide: NG_VALUE_ACCESSOR,
|
|
111
|
-
useExisting: forwardRef(() => TalosCheckboxGroupDirective),
|
|
112
|
-
multi: true
|
|
113
|
-
}
|
|
114
|
-
], exportAs: ["talosCheckboxGroup"], ngImport: i0 });
|
|
115
|
-
}
|
|
116
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: TalosCheckboxGroupDirective, decorators: [{
|
|
117
|
-
type: Directive,
|
|
118
|
-
args: [{
|
|
119
|
-
selector: '[talosCheckboxGroup], [talos-checkbox-group]',
|
|
120
|
-
exportAs: 'talosCheckboxGroup',
|
|
121
|
-
providers: [
|
|
122
|
-
{
|
|
123
|
-
provide: NG_VALUE_ACCESSOR,
|
|
124
|
-
useExisting: forwardRef(() => TalosCheckboxGroupDirective),
|
|
125
|
-
multi: true
|
|
126
|
-
}
|
|
127
|
-
],
|
|
128
|
-
host: {
|
|
129
|
-
'class': 'talos-checkbox-group',
|
|
130
|
-
'role': 'group',
|
|
131
|
-
'[class.direction-vertical]': 'direction() === "vertical"',
|
|
132
|
-
'[class.direction-horizontal]': 'direction() === "horizontal"',
|
|
133
|
-
'[class.is-disabled]': 'effectiveDisabled()',
|
|
134
|
-
'[class.is-invalid]': 'invalid()'
|
|
135
|
-
}
|
|
136
|
-
}]
|
|
137
|
-
}], propDecorators: { name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], direction: [{ type: i0.Input, args: [{ isSignal: true, alias: "direction", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], invalid: [{ type: i0.Input, args: [{ isSignal: true, alias: "invalid", required: false }] }], valueChange: [{ type: i0.Output, args: ["valueChange"] }] } });
|
|
138
|
-
|
|
139
|
-
class TalosCheckboxDirective {
|
|
140
|
-
elementRef = inject((ElementRef));
|
|
141
|
-
groupDir = inject(TalosCheckboxGroupDirective, { optional: true });
|
|
142
|
-
/** Value associated with this checkbox when part of a group */
|
|
143
|
-
value = input(undefined, /* @ts-ignore */
|
|
144
|
-
...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
|
|
145
|
-
/** Standalone checked state */
|
|
146
|
-
checked = input(false, /* @ts-ignore */
|
|
147
|
-
...(ngDevMode ? [{ debugName: "checked" }] : /* istanbul ignore next */ []));
|
|
148
|
-
/** Sizing variation for the checkbox */
|
|
149
|
-
size = input('md', /* @ts-ignore */
|
|
150
|
-
...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
|
|
151
|
-
/** Visual color variant for the checkbox */
|
|
152
|
-
variant = input('primary', /* @ts-ignore */
|
|
153
|
-
...(ngDevMode ? [{ debugName: "variant" }] : /* istanbul ignore next */ []));
|
|
154
|
-
/** Whether the checkbox is disabled */
|
|
155
|
-
disabled = input(false, /* @ts-ignore */
|
|
156
|
-
...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
|
|
157
|
-
/** Whether the checkbox is in an invalid error state */
|
|
158
|
-
invalid = input(false, /* @ts-ignore */
|
|
159
|
-
...(ngDevMode ? [{ debugName: "invalid" }] : /* istanbul ignore next */ []));
|
|
160
|
-
/** Whether the checkbox is in an indeterminate visual & property state */
|
|
161
|
-
indeterminate = input(false, /* @ts-ignore */
|
|
162
|
-
...(ngDevMode ? [{ debugName: "indeterminate" }] : /* istanbul ignore next */ []));
|
|
163
|
-
/** Output event emitted when checked state changes */
|
|
164
|
-
checkedChange = output();
|
|
165
|
-
// Computed state
|
|
166
|
-
effectiveSize = computed(() => {
|
|
167
|
-
return this.groupDir ? this.groupDir.size() : this.size();
|
|
168
|
-
}, /* @ts-ignore */
|
|
169
|
-
...(ngDevMode ? [{ debugName: "effectiveSize" }] : /* istanbul ignore next */ []));
|
|
170
|
-
effectiveVariant = computed(() => {
|
|
171
|
-
return this.groupDir ? this.groupDir.variant() : this.variant();
|
|
172
|
-
}, /* @ts-ignore */
|
|
173
|
-
...(ngDevMode ? [{ debugName: "effectiveVariant" }] : /* istanbul ignore next */ []));
|
|
174
|
-
effectiveDisabled = computed(() => {
|
|
175
|
-
return this.disabled() || (this.groupDir ? this.groupDir.effectiveDisabled() : false);
|
|
176
|
-
}, /* @ts-ignore */
|
|
177
|
-
...(ngDevMode ? [{ debugName: "effectiveDisabled" }] : /* istanbul ignore next */ []));
|
|
178
|
-
effectiveInvalid = computed(() => {
|
|
179
|
-
return this.invalid() || (this.groupDir ? this.groupDir.invalid() : false);
|
|
180
|
-
}, /* @ts-ignore */
|
|
181
|
-
...(ngDevMode ? [{ debugName: "effectiveInvalid" }] : /* istanbul ignore next */ []));
|
|
182
|
-
isChecked = computed(() => {
|
|
183
|
-
if (this.groupDir && this.value() !== undefined) {
|
|
184
|
-
return this.groupDir.isValueSelected(this.value());
|
|
185
|
-
}
|
|
186
|
-
return this.checked();
|
|
187
|
-
}, /* @ts-ignore */
|
|
188
|
-
...(ngDevMode ? [{ debugName: "isChecked" }] : /* istanbul ignore next */ []));
|
|
189
|
-
constructor() {
|
|
190
|
-
// Keep native input element indeterminate property synced
|
|
191
|
-
effect(() => {
|
|
192
|
-
const isIndeterminate = this.indeterminate();
|
|
193
|
-
if (this.elementRef.nativeElement) {
|
|
194
|
-
this.elementRef.nativeElement.indeterminate = isIndeterminate;
|
|
195
|
-
}
|
|
196
|
-
});
|
|
197
|
-
}
|
|
198
|
-
onNativeChange(event) {
|
|
199
|
-
if (this.effectiveDisabled())
|
|
200
|
-
return;
|
|
201
|
-
const target = event.target;
|
|
202
|
-
const isChecked = target.checked;
|
|
203
|
-
if (this.groupDir && this.value() !== undefined) {
|
|
204
|
-
this.groupDir.toggleValue(this.value());
|
|
205
|
-
}
|
|
206
|
-
this.checkedChange.emit(isChecked);
|
|
207
|
-
}
|
|
208
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: TalosCheckboxDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
209
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.1.1", type: TalosCheckboxDirective, isStandalone: true, selector: "input[type=\"checkbox\"][talosCheckbox], input[type=\"checkbox\"][talos-checkbox]", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, checked: { classPropertyName: "checked", publicName: "checked", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, invalid: { classPropertyName: "invalid", publicName: "invalid", isSignal: true, isRequired: false, transformFunction: null }, indeterminate: { classPropertyName: "indeterminate", publicName: "indeterminate", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { checkedChange: "checkedChange" }, host: { listeners: { "change": "onNativeChange($event)" }, properties: { "class.checkbox-sm": "effectiveSize() === \"sm\"", "class.checkbox-md": "effectiveSize() === \"md\"", "class.checkbox-lg": "effectiveSize() === \"lg\"", "class.talos-checkbox-primary": "effectiveVariant() === \"primary\"", "class.talos-checkbox-secondary": "effectiveVariant() === \"secondary\"", "class.talos-checkbox-success": "effectiveVariant() === \"success\"", "class.talos-checkbox-danger": "effectiveVariant() === \"danger\"", "class.is-invalid": "effectiveInvalid()", "class.is-indeterminate": "indeterminate()", "checked": "isChecked()", "disabled": "effectiveDisabled()", "indeterminate": "indeterminate()" }, classAttribute: "talos-checkbox" }, exportAs: ["talosCheckbox"], ngImport: i0 });
|
|
210
|
-
}
|
|
211
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: TalosCheckboxDirective, decorators: [{
|
|
212
|
-
type: Directive,
|
|
213
|
-
args: [{
|
|
214
|
-
selector: 'input[type="checkbox"][talosCheckbox], input[type="checkbox"][talos-checkbox]',
|
|
215
|
-
exportAs: 'talosCheckbox',
|
|
216
|
-
host: {
|
|
217
|
-
'class': 'talos-checkbox',
|
|
218
|
-
'[class.checkbox-sm]': 'effectiveSize() === "sm"',
|
|
219
|
-
'[class.checkbox-md]': 'effectiveSize() === "md"',
|
|
220
|
-
'[class.checkbox-lg]': 'effectiveSize() === "lg"',
|
|
221
|
-
'[class.talos-checkbox-primary]': 'effectiveVariant() === "primary"',
|
|
222
|
-
'[class.talos-checkbox-secondary]': 'effectiveVariant() === "secondary"',
|
|
223
|
-
'[class.talos-checkbox-success]': 'effectiveVariant() === "success"',
|
|
224
|
-
'[class.talos-checkbox-danger]': 'effectiveVariant() === "danger"',
|
|
225
|
-
'[class.is-invalid]': 'effectiveInvalid()',
|
|
226
|
-
'[class.is-indeterminate]': 'indeterminate()',
|
|
227
|
-
'[checked]': 'isChecked()',
|
|
228
|
-
'[disabled]': 'effectiveDisabled()',
|
|
229
|
-
'[indeterminate]': 'indeterminate()',
|
|
230
|
-
'(change)': 'onNativeChange($event)'
|
|
231
|
-
}
|
|
232
|
-
}]
|
|
233
|
-
}], ctorParameters: () => [], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }], checked: [{ type: i0.Input, args: [{ isSignal: true, alias: "checked", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], invalid: [{ type: i0.Input, args: [{ isSignal: true, alias: "invalid", required: false }] }], indeterminate: [{ type: i0.Input, args: [{ isSignal: true, alias: "indeterminate", required: false }] }], checkedChange: [{ type: i0.Output, args: ["checkedChange"] }] } });
|
|
234
|
-
|
|
235
|
-
class TalosCheckboxGroupComponent {
|
|
236
|
-
groupDir = inject(TalosCheckboxGroupDirective, { self: true });
|
|
237
|
-
// Inputs forwarded via hostDirectives or component bindings
|
|
238
|
-
name = input(this.groupDir.name(), /* @ts-ignore */
|
|
239
|
-
...(ngDevMode ? [{ debugName: "name" }] : /* istanbul ignore next */ []));
|
|
240
|
-
size = input('md', /* @ts-ignore */
|
|
241
|
-
...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
|
|
242
|
-
variant = input('primary', /* @ts-ignore */
|
|
243
|
-
...(ngDevMode ? [{ debugName: "variant" }] : /* istanbul ignore next */ []));
|
|
244
|
-
direction = input('vertical', /* @ts-ignore */
|
|
245
|
-
...(ngDevMode ? [{ debugName: "direction" }] : /* istanbul ignore next */ []));
|
|
246
|
-
disabled = input(false, /* @ts-ignore */
|
|
247
|
-
...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
|
|
248
|
-
invalid = input(false, /* @ts-ignore */
|
|
249
|
-
...(ngDevMode ? [{ debugName: "invalid" }] : /* istanbul ignore next */ []));
|
|
250
|
-
valueChange = output();
|
|
251
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: TalosCheckboxGroupComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
252
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.1.1", type: TalosCheckboxGroupComponent, isStandalone: true, selector: "talos-checkbox-group", inputs: { name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, direction: { classPropertyName: "direction", publicName: "direction", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, invalid: { classPropertyName: "invalid", publicName: "invalid", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { valueChange: "valueChange" }, hostDirectives: [{ directive: TalosCheckboxGroupDirective, inputs: ["name", "name", "size", "size", "variant", "variant", "direction", "direction", "disabled", "disabled", "invalid", "invalid"], outputs: ["valueChange", "valueChange"] }], ngImport: i0, template: '<ng-content></ng-content>', isInline: true });
|
|
253
|
-
}
|
|
254
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: TalosCheckboxGroupComponent, decorators: [{
|
|
255
|
-
type: Component,
|
|
256
|
-
args: [{
|
|
257
|
-
selector: 'talos-checkbox-group',
|
|
258
|
-
template: '<ng-content></ng-content>',
|
|
259
|
-
hostDirectives: [
|
|
260
|
-
{
|
|
261
|
-
directive: TalosCheckboxGroupDirective,
|
|
262
|
-
inputs: ['name', 'size', 'variant', 'direction', 'disabled', 'invalid'],
|
|
263
|
-
outputs: ['valueChange']
|
|
264
|
-
}
|
|
265
|
-
]
|
|
266
|
-
}]
|
|
267
|
-
}], propDecorators: { name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], direction: [{ type: i0.Input, args: [{ isSignal: true, alias: "direction", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], invalid: [{ type: i0.Input, args: [{ isSignal: true, alias: "invalid", required: false }] }], valueChange: [{ type: i0.Output, args: ["valueChange"] }] } });
|
|
268
|
-
|
|
269
|
-
class TalosCheckboxParentDirective {
|
|
270
|
-
elementRef = inject((ElementRef));
|
|
271
|
-
checkboxDir = inject(TalosCheckboxDirective, { optional: true, self: true });
|
|
272
|
-
ancestorGroup = inject(TalosCheckboxGroupDirective, { optional: true });
|
|
273
|
-
/** Optional explicit reference to a TalosCheckboxGroupDirective instance */
|
|
274
|
-
group = input(undefined, /* @ts-ignore */
|
|
275
|
-
...(ngDevMode ? [{ debugName: "group" }] : /* istanbul ignore next */ []));
|
|
276
|
-
/** List of all selectable values for the parent checkbox to manage */
|
|
277
|
-
values = input([], /* @ts-ignore */
|
|
278
|
-
...(ngDevMode ? [{ debugName: "values" }] : /* istanbul ignore next */ []));
|
|
279
|
-
/** Effective active checkbox group */
|
|
280
|
-
targetGroup = computed(() => this.group() || this.ancestorGroup, /* @ts-ignore */
|
|
281
|
-
...(ngDevMode ? [{ debugName: "targetGroup" }] : /* istanbul ignore next */ []));
|
|
282
|
-
/** Whether all target values are selected */
|
|
283
|
-
isAllSelected = computed(() => {
|
|
284
|
-
const grp = this.targetGroup();
|
|
285
|
-
const allVals = this.values();
|
|
286
|
-
if (!grp || allVals.length === 0)
|
|
287
|
-
return false;
|
|
288
|
-
const selectedVals = grp.value();
|
|
289
|
-
return allVals.every((val) => selectedVals.includes(val));
|
|
290
|
-
}, /* @ts-ignore */
|
|
291
|
-
...(ngDevMode ? [{ debugName: "isAllSelected" }] : /* istanbul ignore next */ []));
|
|
292
|
-
/** Whether some (but not all) target values are selected */
|
|
293
|
-
isIndeterminate = computed(() => {
|
|
294
|
-
const grp = this.targetGroup();
|
|
295
|
-
const allVals = this.values();
|
|
296
|
-
if (!grp || allVals.length === 0)
|
|
297
|
-
return false;
|
|
298
|
-
const selectedVals = grp.value();
|
|
299
|
-
const count = allVals.filter((val) => selectedVals.includes(val)).length;
|
|
300
|
-
return count > 0 && count < allVals.length;
|
|
301
|
-
}, /* @ts-ignore */
|
|
302
|
-
...(ngDevMode ? [{ debugName: "isIndeterminate" }] : /* istanbul ignore next */ []));
|
|
303
|
-
constructor() {
|
|
304
|
-
// Keep element's indeterminate property synced dynamically
|
|
305
|
-
effect(() => {
|
|
306
|
-
const indeterminate = this.isIndeterminate();
|
|
307
|
-
if (this.elementRef.nativeElement) {
|
|
308
|
-
this.elementRef.nativeElement.indeterminate = indeterminate;
|
|
309
|
-
}
|
|
310
|
-
});
|
|
311
|
-
}
|
|
312
|
-
onParentToggle(event) {
|
|
313
|
-
const grp = this.targetGroup();
|
|
314
|
-
const allVals = this.values();
|
|
315
|
-
if (!grp || allVals.length === 0)
|
|
316
|
-
return;
|
|
317
|
-
if (this.isAllSelected()) {
|
|
318
|
-
// If currently all selected, deselect all values managed by this parent
|
|
319
|
-
const currentSelected = grp.value();
|
|
320
|
-
const remaining = currentSelected.filter((v) => !allVals.includes(v));
|
|
321
|
-
grp.selectAll(remaining);
|
|
322
|
-
}
|
|
323
|
-
else {
|
|
324
|
-
// If none or indeterminate, select all values managed by this parent
|
|
325
|
-
const currentSelected = grp.value();
|
|
326
|
-
const updated = Array.from(new Set([...currentSelected, ...allVals]));
|
|
327
|
-
grp.selectAll(updated);
|
|
328
|
-
}
|
|
329
|
-
}
|
|
330
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: TalosCheckboxParentDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
331
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.1.1", type: TalosCheckboxParentDirective, isStandalone: true, selector: "input[type=\"checkbox\"][talosCheckboxParent], input[type=\"checkbox\"][talos-checkbox-parent], input[type=\"checkbox\"][talosSelectAll], input[type=\"checkbox\"][talos-select-all]", inputs: { group: { classPropertyName: "group", publicName: "group", isSignal: true, isRequired: false, transformFunction: null }, values: { classPropertyName: "values", publicName: "values", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "change": "onParentToggle($event)" }, properties: { "checked": "isAllSelected()", "indeterminate": "isIndeterminate()", "class.is-indeterminate": "isIndeterminate()" } }, exportAs: ["talosCheckboxParent"], ngImport: i0 });
|
|
332
|
-
}
|
|
333
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: TalosCheckboxParentDirective, decorators: [{
|
|
334
|
-
type: Directive,
|
|
335
|
-
args: [{
|
|
336
|
-
selector: 'input[type="checkbox"][talosCheckboxParent], input[type="checkbox"][talos-checkbox-parent], input[type="checkbox"][talosSelectAll], input[type="checkbox"][talos-select-all]',
|
|
337
|
-
exportAs: 'talosCheckboxParent',
|
|
338
|
-
host: {
|
|
339
|
-
'[checked]': 'isAllSelected()',
|
|
340
|
-
'[indeterminate]': 'isIndeterminate()',
|
|
341
|
-
'[class.is-indeterminate]': 'isIndeterminate()',
|
|
342
|
-
'(change)': 'onParentToggle($event)'
|
|
343
|
-
}
|
|
344
|
-
}]
|
|
345
|
-
}], ctorParameters: () => [], propDecorators: { group: [{ type: i0.Input, args: [{ isSignal: true, alias: "group", required: false }] }], values: [{ type: i0.Input, args: [{ isSignal: true, alias: "values", required: false }] }] } });
|
|
346
|
-
|
|
347
|
-
let checkboxCounter = 0;
|
|
348
|
-
class TalosCheckboxComponent {
|
|
349
|
-
inputRef = viewChild('inputEl', /* @ts-ignore */
|
|
350
|
-
...(ngDevMode ? [{ debugName: "inputRef" }] : /* istanbul ignore next */ []));
|
|
351
|
-
groupDir = inject(TalosCheckboxGroupDirective, { optional: true });
|
|
352
|
-
/** Value associated with this checkbox when part of a group */
|
|
353
|
-
value = input(undefined, /* @ts-ignore */
|
|
354
|
-
...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
|
|
355
|
-
/** Standalone checked state */
|
|
356
|
-
checked = input(false, /* @ts-ignore */
|
|
357
|
-
...(ngDevMode ? [{ debugName: "checked" }] : /* istanbul ignore next */ []));
|
|
358
|
-
/** Sizing variation for the checkbox */
|
|
359
|
-
size = input('md', /* @ts-ignore */
|
|
360
|
-
...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
|
|
361
|
-
/** Visual color variant for the checkbox */
|
|
362
|
-
variant = input('primary', /* @ts-ignore */
|
|
363
|
-
...(ngDevMode ? [{ debugName: "variant" }] : /* istanbul ignore next */ []));
|
|
364
|
-
/** Whether the checkbox is disabled */
|
|
365
|
-
disabled = input(false, /* @ts-ignore */
|
|
366
|
-
...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
|
|
367
|
-
/** Whether the checkbox is in an invalid error state */
|
|
368
|
-
invalid = input(false, /* @ts-ignore */
|
|
369
|
-
...(ngDevMode ? [{ debugName: "invalid" }] : /* istanbul ignore next */ []));
|
|
370
|
-
/** Whether the checkbox is in an indeterminate visual & property state */
|
|
371
|
-
indeterminate = input(false, /* @ts-ignore */
|
|
372
|
-
...(ngDevMode ? [{ debugName: "indeterminate" }] : /* istanbul ignore next */ []));
|
|
373
|
-
/** Emitted when checked state changes */
|
|
374
|
-
checkedChange = output();
|
|
375
|
-
// Internal reactive state for CVA
|
|
376
|
-
internalValue = signal(false, /* @ts-ignore */
|
|
377
|
-
...(ngDevMode ? [{ debugName: "internalValue" }] : /* istanbul ignore next */ []));
|
|
378
|
-
isDisabled = signal(false, /* @ts-ignore */
|
|
379
|
-
...(ngDevMode ? [{ debugName: "isDisabled" }] : /* istanbul ignore next */ []));
|
|
380
|
-
isTouched = signal(false, /* @ts-ignore */
|
|
381
|
-
...(ngDevMode ? [{ debugName: "isTouched" }] : /* istanbul ignore next */ []));
|
|
382
|
-
// Effective state computations
|
|
383
|
-
effectiveSize = computed(() => {
|
|
384
|
-
return this.groupDir ? this.groupDir.size() : this.size();
|
|
385
|
-
}, /* @ts-ignore */
|
|
386
|
-
...(ngDevMode ? [{ debugName: "effectiveSize" }] : /* istanbul ignore next */ []));
|
|
387
|
-
effectiveVariant = computed(() => {
|
|
388
|
-
return this.groupDir ? this.groupDir.variant() : this.variant();
|
|
389
|
-
}, /* @ts-ignore */
|
|
390
|
-
...(ngDevMode ? [{ debugName: "effectiveVariant" }] : /* istanbul ignore next */ []));
|
|
391
|
-
effectiveDisabled = computed(() => {
|
|
392
|
-
return this.disabled() || this.isDisabled() || (this.groupDir ? this.groupDir.effectiveDisabled() : false);
|
|
393
|
-
}, /* @ts-ignore */
|
|
394
|
-
...(ngDevMode ? [{ debugName: "effectiveDisabled" }] : /* istanbul ignore next */ []));
|
|
395
|
-
effectiveInvalid = computed(() => {
|
|
396
|
-
return this.invalid() || (this.groupDir ? this.groupDir.invalid() : false);
|
|
397
|
-
}, /* @ts-ignore */
|
|
398
|
-
...(ngDevMode ? [{ debugName: "effectiveInvalid" }] : /* istanbul ignore next */ []));
|
|
399
|
-
isChecked = computed(() => {
|
|
400
|
-
if (this.groupDir && this.value() !== undefined) {
|
|
401
|
-
return this.groupDir.isValueSelected(this.value());
|
|
402
|
-
}
|
|
403
|
-
return this.internalValue() || this.checked();
|
|
404
|
-
}, /* @ts-ignore */
|
|
405
|
-
...(ngDevMode ? [{ debugName: "isChecked" }] : /* istanbul ignore next */ []));
|
|
406
|
-
onChange = () => { };
|
|
407
|
-
onTouched = () => { };
|
|
408
|
-
// --- ControlValueAccessor Implementation ---
|
|
409
|
-
writeValue(val) {
|
|
410
|
-
this.internalValue.set(!!val);
|
|
411
|
-
}
|
|
412
|
-
registerOnChange(fn) {
|
|
413
|
-
this.onChange = fn;
|
|
414
|
-
}
|
|
415
|
-
registerOnTouched(fn) {
|
|
416
|
-
this.onTouched = fn;
|
|
417
|
-
}
|
|
418
|
-
setDisabledState(isDisabled) {
|
|
419
|
-
this.isDisabled.set(isDisabled);
|
|
420
|
-
}
|
|
421
|
-
onDirectiveCheckedChange(isChecked) {
|
|
422
|
-
if (this.effectiveDisabled())
|
|
423
|
-
return;
|
|
424
|
-
this.internalValue.set(isChecked);
|
|
425
|
-
this.onChange(isChecked);
|
|
426
|
-
this.checkedChange.emit(isChecked);
|
|
427
|
-
this.markAsTouched();
|
|
428
|
-
}
|
|
429
|
-
markAsTouched() {
|
|
430
|
-
if (!this.isTouched()) {
|
|
431
|
-
this.isTouched.set(true);
|
|
432
|
-
this.onTouched();
|
|
433
|
-
}
|
|
434
|
-
}
|
|
435
|
-
/** Focuses the native HTML input element */
|
|
436
|
-
focusInput() {
|
|
437
|
-
this.inputRef()?.nativeElement.focus();
|
|
438
|
-
}
|
|
439
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: TalosCheckboxComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
440
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "22.1.1", type: TalosCheckboxComponent, isStandalone: true, selector: "talos-checkbox", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, checked: { classPropertyName: "checked", publicName: "checked", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, invalid: { classPropertyName: "invalid", publicName: "invalid", isSignal: true, isRequired: false, transformFunction: null }, indeterminate: { classPropertyName: "indeterminate", publicName: "indeterminate", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { checkedChange: "checkedChange" }, host: { classAttribute: "talos-checkbox-host" }, providers: [
|
|
441
|
-
{
|
|
442
|
-
provide: NG_VALUE_ACCESSOR,
|
|
443
|
-
useExisting: forwardRef(() => TalosCheckboxComponent),
|
|
444
|
-
multi: true
|
|
445
|
-
}
|
|
446
|
-
], viewQueries: [{ propertyName: "inputRef", first: true, predicate: ["inputEl"], descendants: true, isSignal: true }], ngImport: i0, template: `
|
|
447
|
-
<label class="talos-checkbox-wrapper" [class.is-disabled]="effectiveDisabled()">
|
|
448
|
-
<input
|
|
449
|
-
#inputEl
|
|
450
|
-
type="checkbox"
|
|
451
|
-
talosCheckbox
|
|
452
|
-
[value]="value()"
|
|
453
|
-
[checked]="isChecked()"
|
|
454
|
-
[size]="effectiveSize()"
|
|
455
|
-
[variant]="effectiveVariant()"
|
|
456
|
-
[disabled]="effectiveDisabled()"
|
|
457
|
-
[invalid]="effectiveInvalid()"
|
|
458
|
-
[indeterminate]="indeterminate()"
|
|
459
|
-
(checkedChange)="onDirectiveCheckedChange($event)"
|
|
460
|
-
/>
|
|
461
|
-
<span class="talos-checkbox-label">
|
|
462
|
-
<ng-content></ng-content>
|
|
463
|
-
</span>
|
|
464
|
-
</label>
|
|
465
|
-
`, isInline: true, dependencies: [{ kind: "directive", type: TalosCheckboxDirective, selector: "input[type=\"checkbox\"][talosCheckbox], input[type=\"checkbox\"][talos-checkbox]", inputs: ["value", "checked", "size", "variant", "disabled", "invalid", "indeterminate"], outputs: ["checkedChange"], exportAs: ["talosCheckbox"] }] });
|
|
466
|
-
}
|
|
467
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: TalosCheckboxComponent, decorators: [{
|
|
468
|
-
type: Component,
|
|
469
|
-
args: [{
|
|
470
|
-
selector: 'talos-checkbox',
|
|
471
|
-
imports: [TalosCheckboxDirective],
|
|
472
|
-
providers: [
|
|
473
|
-
{
|
|
474
|
-
provide: NG_VALUE_ACCESSOR,
|
|
475
|
-
useExisting: forwardRef(() => TalosCheckboxComponent),
|
|
476
|
-
multi: true
|
|
477
|
-
}
|
|
478
|
-
],
|
|
479
|
-
host: {
|
|
480
|
-
'class': 'talos-checkbox-host'
|
|
481
|
-
},
|
|
482
|
-
template: `
|
|
483
|
-
<label class="talos-checkbox-wrapper" [class.is-disabled]="effectiveDisabled()">
|
|
484
|
-
<input
|
|
485
|
-
#inputEl
|
|
486
|
-
type="checkbox"
|
|
487
|
-
talosCheckbox
|
|
488
|
-
[value]="value()"
|
|
489
|
-
[checked]="isChecked()"
|
|
490
|
-
[size]="effectiveSize()"
|
|
491
|
-
[variant]="effectiveVariant()"
|
|
492
|
-
[disabled]="effectiveDisabled()"
|
|
493
|
-
[invalid]="effectiveInvalid()"
|
|
494
|
-
[indeterminate]="indeterminate()"
|
|
495
|
-
(checkedChange)="onDirectiveCheckedChange($event)"
|
|
496
|
-
/>
|
|
497
|
-
<span class="talos-checkbox-label">
|
|
498
|
-
<ng-content></ng-content>
|
|
499
|
-
</span>
|
|
500
|
-
</label>
|
|
501
|
-
`
|
|
502
|
-
}]
|
|
503
|
-
}], propDecorators: { inputRef: [{ type: i0.ViewChild, args: ['inputEl', { isSignal: true }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }], checked: [{ type: i0.Input, args: [{ isSignal: true, alias: "checked", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], invalid: [{ type: i0.Input, args: [{ isSignal: true, alias: "invalid", required: false }] }], indeterminate: [{ type: i0.Input, args: [{ isSignal: true, alias: "indeterminate", required: false }] }], checkedChange: [{ type: i0.Output, args: ["checkedChange"] }] } });
|
|
504
|
-
|
|
505
|
-
/**
|
|
506
|
-
* Convenience NgModule wrapping standalone checkbox directives and components.
|
|
507
|
-
*
|
|
508
|
-
* Allows developers who prefer `TalosCheckboxModule` to import all checkbox utilities in one go.
|
|
509
|
-
*/
|
|
510
|
-
class TalosCheckboxModule {
|
|
511
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: TalosCheckboxModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
512
|
-
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "22.1.1", ngImport: i0, type: TalosCheckboxModule, imports: [TalosCheckboxDirective,
|
|
513
|
-
TalosCheckboxGroupDirective,
|
|
514
|
-
TalosCheckboxGroupComponent,
|
|
515
|
-
TalosCheckboxParentDirective,
|
|
516
|
-
TalosCheckboxComponent], exports: [TalosCheckboxDirective,
|
|
517
|
-
TalosCheckboxGroupDirective,
|
|
518
|
-
TalosCheckboxGroupComponent,
|
|
519
|
-
TalosCheckboxParentDirective,
|
|
520
|
-
TalosCheckboxComponent] });
|
|
521
|
-
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: TalosCheckboxModule });
|
|
522
|
-
}
|
|
523
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: TalosCheckboxModule, decorators: [{
|
|
524
|
-
type: NgModule,
|
|
525
|
-
args: [{
|
|
526
|
-
imports: [
|
|
527
|
-
TalosCheckboxDirective,
|
|
528
|
-
TalosCheckboxGroupDirective,
|
|
529
|
-
TalosCheckboxGroupComponent,
|
|
530
|
-
TalosCheckboxParentDirective,
|
|
531
|
-
TalosCheckboxComponent
|
|
532
|
-
],
|
|
533
|
-
exports: [
|
|
534
|
-
TalosCheckboxDirective,
|
|
535
|
-
TalosCheckboxGroupDirective,
|
|
536
|
-
TalosCheckboxGroupComponent,
|
|
537
|
-
TalosCheckboxParentDirective,
|
|
538
|
-
TalosCheckboxComponent
|
|
539
|
-
]
|
|
540
|
-
}]
|
|
541
|
-
}] });
|
|
542
|
-
|
|
543
|
-
/**
|
|
544
|
-
* Generated bundle index. Do not edit.
|
|
545
|
-
*/
|
|
546
|
-
|
|
547
|
-
export { TalosCheckboxComponent, TalosCheckboxDirective, TalosCheckboxGroupComponent, TalosCheckboxGroupDirective, TalosCheckboxModule, TalosCheckboxParentDirective };
|
|
548
|
-
//# sourceMappingURL=weeehaoooz-talos-ui-form-checkbox.mjs.map
|