shirkasoft-ui-components 1.3.7 → 1.3.9
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 +38 -13
- package/fesm2022/shirkasoft-ui-components-button.mjs +2 -2
- package/fesm2022/shirkasoft-ui-components-button.mjs.map +1 -1
- package/fesm2022/shirkasoft-ui-components-confirm-dialog.mjs +2 -2
- package/fesm2022/shirkasoft-ui-components-confirm-dialog.mjs.map +1 -1
- package/fesm2022/shirkasoft-ui-components-date-picker.mjs +90 -9
- package/fesm2022/shirkasoft-ui-components-date-picker.mjs.map +1 -1
- package/fesm2022/shirkasoft-ui-components-loading.mjs +2 -2
- package/fesm2022/shirkasoft-ui-components-loading.mjs.map +1 -1
- package/fesm2022/shirkasoft-ui-components-modal.mjs +2 -2
- package/fesm2022/shirkasoft-ui-components-modal.mjs.map +1 -1
- package/fesm2022/shirkasoft-ui-components-notification.mjs +2 -2
- package/fesm2022/shirkasoft-ui-components-notification.mjs.map +1 -1
- package/fesm2022/shirkasoft-ui-components-price-input.mjs +2 -2
- package/fesm2022/shirkasoft-ui-components-price-input.mjs.map +1 -1
- package/fesm2022/shirkasoft-ui-components-select.mjs +2 -2
- package/fesm2022/shirkasoft-ui-components-select.mjs.map +1 -1
- package/fesm2022/shirkasoft-ui-components-table.mjs +198 -12
- package/fesm2022/shirkasoft-ui-components-table.mjs.map +1 -1
- package/fesm2022/shirkasoft-ui-components-tabs.mjs +7 -12
- package/fesm2022/shirkasoft-ui-components-tabs.mjs.map +1 -1
- package/fesm2022/shirkasoft-ui-components-tag.mjs +3 -3
- package/fesm2022/shirkasoft-ui-components-tag.mjs.map +1 -1
- package/fesm2022/shirkasoft-ui-components-text-field.mjs +2 -2
- package/fesm2022/shirkasoft-ui-components-text-field.mjs.map +1 -1
- package/fesm2022/shirkasoft-ui-components-toggle.mjs +61 -24
- package/fesm2022/shirkasoft-ui-components-toggle.mjs.map +1 -1
- package/package.json +2 -2
- package/src/theme.css +80 -0
- package/types/shirkasoft-ui-components-date-picker.d.ts +24 -4
- package/types/shirkasoft-ui-components-table.d.ts +86 -9
- package/types/shirkasoft-ui-components-toggle.d.ts +7 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { input, output, signal, effect, forwardRef, Component } from '@angular/core';
|
|
2
|
+
import { input, output, signal, computed, effect, forwardRef, Component } from '@angular/core';
|
|
3
3
|
import { NG_VALUE_ACCESSOR } from '@angular/forms';
|
|
4
4
|
import { CommonModule } from '@angular/common';
|
|
5
5
|
|
|
@@ -22,10 +22,14 @@ class ToggleComponent {
|
|
|
22
22
|
this.checked = input(undefined, ...(ngDevMode ? [{ debugName: "checked" }] : /* istanbul ignore next */ []));
|
|
23
23
|
/** Emitted with the new value when the user toggles the control. */
|
|
24
24
|
this.checkedChange = output();
|
|
25
|
+
/** Disables the control (also settable through reactive forms). */
|
|
26
|
+
this.disabled = input(false, ...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
|
|
25
27
|
/** Internal controlled/reactive value. */
|
|
26
28
|
this._value = signal(false, ...(ngDevMode ? [{ debugName: "_value" }] : /* istanbul ignore next */ []));
|
|
27
29
|
/** Reactive disabled state. */
|
|
28
30
|
this._disabled = signal(false, ...(ngDevMode ? [{ debugName: "_disabled" }] : /* istanbul ignore next */ []));
|
|
31
|
+
/** Disabled through the `disabled` input or the form control. */
|
|
32
|
+
this.isDisabled = computed(() => this.disabled() || this._disabled(), ...(ngDevMode ? [{ debugName: "isDisabled" }] : /* istanbul ignore next */ []));
|
|
29
33
|
/** Callback notified with the new value on change (ControlValueAccessor). */
|
|
30
34
|
this.onChange = () => { };
|
|
31
35
|
/** Callback notified when the control loses focus or is touched. */
|
|
@@ -57,8 +61,15 @@ class ToggleComponent {
|
|
|
57
61
|
* Inverts the current value (unless disabled), notifies the form control,
|
|
58
62
|
* marks the control as touched and emits `checkedChange`.
|
|
59
63
|
*/
|
|
64
|
+
/** Space/Enter toggles the focused switch or checkbox. */
|
|
65
|
+
onKeydown(event) {
|
|
66
|
+
if (event.key === ' ' || event.key === 'Enter') {
|
|
67
|
+
event.preventDefault();
|
|
68
|
+
this.toggle();
|
|
69
|
+
}
|
|
70
|
+
}
|
|
60
71
|
toggle() {
|
|
61
|
-
if (this.
|
|
72
|
+
if (this.isDisabled())
|
|
62
73
|
return;
|
|
63
74
|
const newValue = !this._value();
|
|
64
75
|
this._value.set(newValue);
|
|
@@ -67,7 +78,7 @@ class ToggleComponent {
|
|
|
67
78
|
this.checkedChange.emit(newValue);
|
|
68
79
|
}
|
|
69
80
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.23", ngImport: i0, type: ToggleComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
70
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.23", type: ToggleComponent, isStandalone: true, selector: "shk-toggle", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, mode: { classPropertyName: "mode", publicName: "mode", isSignal: true, isRequired: false, transformFunction: null }, checked: { classPropertyName: "checked", publicName: "checked", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { checkedChange: "checkedChange" }, providers: [
|
|
81
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.23", type: ToggleComponent, isStandalone: true, selector: "shk-toggle", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, mode: { classPropertyName: "mode", publicName: "mode", isSignal: true, isRequired: false, transformFunction: null }, checked: { classPropertyName: "checked", publicName: "checked", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { checkedChange: "checkedChange" }, providers: [
|
|
71
82
|
{
|
|
72
83
|
provide: NG_VALUE_ACCESSOR,
|
|
73
84
|
useExisting: forwardRef(() => ToggleComponent),
|
|
@@ -77,11 +88,21 @@ class ToggleComponent {
|
|
|
77
88
|
<div class="relative">
|
|
78
89
|
<label
|
|
79
90
|
class="inline-flex items-center gap-3 cursor-pointer select-none"
|
|
80
|
-
[class.opacity-50]="
|
|
81
|
-
[class.cursor-not-allowed]="
|
|
91
|
+
[class.opacity-50]="isDisabled()"
|
|
92
|
+
[class.cursor-not-allowed]="isDisabled()"
|
|
93
|
+
[class.shk-toggle-disabled]="isDisabled()"
|
|
82
94
|
>
|
|
83
95
|
@if (mode() === 'toggle') {
|
|
84
|
-
<div
|
|
96
|
+
<div
|
|
97
|
+
class="shk-toggle-control relative flex-shrink-0 rounded-full"
|
|
98
|
+
role="switch"
|
|
99
|
+
[attr.aria-checked]="_value()"
|
|
100
|
+
[attr.aria-disabled]="isDisabled() || null"
|
|
101
|
+
[attr.aria-label]="label() || null"
|
|
102
|
+
[attr.tabindex]="isDisabled() ? -1 : 0"
|
|
103
|
+
(keydown)="onKeydown($event)"
|
|
104
|
+
(click)="toggle()"
|
|
105
|
+
>
|
|
85
106
|
<div
|
|
86
107
|
class="w-10 h-6 rounded-full transition-colors duration-200"
|
|
87
108
|
[class._shk-bg-primary]="_value()"
|
|
@@ -89,13 +110,19 @@ class ToggleComponent {
|
|
|
89
110
|
[class._shk-dark-bg-surface-600]="!_value()"
|
|
90
111
|
></div>
|
|
91
112
|
<div
|
|
92
|
-
class="absolute top-0.5 left-0.5 w-5 h-5 _shk-bg-white rounded-full shadow transition-transform duration-200"
|
|
113
|
+
class="shk-toggle-thumb absolute top-0.5 left-0.5 w-5 h-5 _shk-bg-white rounded-full shadow transition-transform duration-200"
|
|
93
114
|
[class.translate-x-4]="_value()"
|
|
94
115
|
></div>
|
|
95
116
|
</div>
|
|
96
117
|
} @else {
|
|
97
118
|
<div
|
|
98
|
-
class="flex-shrink-0 w-4 h-4 rounded border-2 transition-colors duration-200 flex items-center justify-center"
|
|
119
|
+
class="shk-toggle-control shk-toggle-box flex-shrink-0 w-4 h-4 rounded border-2 transition-colors duration-200 flex items-center justify-center"
|
|
120
|
+
role="checkbox"
|
|
121
|
+
[attr.aria-checked]="_value()"
|
|
122
|
+
[attr.aria-disabled]="isDisabled() || null"
|
|
123
|
+
[attr.aria-label]="label() || null"
|
|
124
|
+
[attr.tabindex]="isDisabled() ? -1 : 0"
|
|
125
|
+
(keydown)="onKeydown($event)"
|
|
99
126
|
[class._shk-bg-primary]="_value()"
|
|
100
127
|
[class._shk-border-primary]="_value()"
|
|
101
128
|
[class._shk-border-surface-300]="!_value()"
|
|
@@ -116,23 +143,29 @@ class ToggleComponent {
|
|
|
116
143
|
}
|
|
117
144
|
</label>
|
|
118
145
|
</div>
|
|
119
|
-
`, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }] }); }
|
|
146
|
+
`, isInline: true, styles: [".shk-toggle-control{outline:none;transition:box-shadow .15s ease}.shk-toggle-control:focus-visible{box-shadow:0 0 0 3px color-mix(in srgb,var(--shk-primary-500) 30%,transparent)}.shk-toggle-box{border-radius:.3rem}label:not(.shk-toggle-disabled):hover .shk-toggle-box[aria-checked=false]{border-color:var(--shk-primary-400)}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }] }); }
|
|
120
147
|
}
|
|
121
148
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.23", ngImport: i0, type: ToggleComponent, decorators: [{
|
|
122
149
|
type: Component,
|
|
123
|
-
args: [{
|
|
124
|
-
selector: 'shk-toggle',
|
|
125
|
-
standalone: true,
|
|
126
|
-
imports: [CommonModule],
|
|
127
|
-
template: `
|
|
150
|
+
args: [{ selector: 'shk-toggle', standalone: true, imports: [CommonModule], template: `
|
|
128
151
|
<div class="relative">
|
|
129
152
|
<label
|
|
130
153
|
class="inline-flex items-center gap-3 cursor-pointer select-none"
|
|
131
|
-
[class.opacity-50]="
|
|
132
|
-
[class.cursor-not-allowed]="
|
|
154
|
+
[class.opacity-50]="isDisabled()"
|
|
155
|
+
[class.cursor-not-allowed]="isDisabled()"
|
|
156
|
+
[class.shk-toggle-disabled]="isDisabled()"
|
|
133
157
|
>
|
|
134
158
|
@if (mode() === 'toggle') {
|
|
135
|
-
<div
|
|
159
|
+
<div
|
|
160
|
+
class="shk-toggle-control relative flex-shrink-0 rounded-full"
|
|
161
|
+
role="switch"
|
|
162
|
+
[attr.aria-checked]="_value()"
|
|
163
|
+
[attr.aria-disabled]="isDisabled() || null"
|
|
164
|
+
[attr.aria-label]="label() || null"
|
|
165
|
+
[attr.tabindex]="isDisabled() ? -1 : 0"
|
|
166
|
+
(keydown)="onKeydown($event)"
|
|
167
|
+
(click)="toggle()"
|
|
168
|
+
>
|
|
136
169
|
<div
|
|
137
170
|
class="w-10 h-6 rounded-full transition-colors duration-200"
|
|
138
171
|
[class._shk-bg-primary]="_value()"
|
|
@@ -140,13 +173,19 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.23", ngImpo
|
|
|
140
173
|
[class._shk-dark-bg-surface-600]="!_value()"
|
|
141
174
|
></div>
|
|
142
175
|
<div
|
|
143
|
-
class="absolute top-0.5 left-0.5 w-5 h-5 _shk-bg-white rounded-full shadow transition-transform duration-200"
|
|
176
|
+
class="shk-toggle-thumb absolute top-0.5 left-0.5 w-5 h-5 _shk-bg-white rounded-full shadow transition-transform duration-200"
|
|
144
177
|
[class.translate-x-4]="_value()"
|
|
145
178
|
></div>
|
|
146
179
|
</div>
|
|
147
180
|
} @else {
|
|
148
181
|
<div
|
|
149
|
-
class="flex-shrink-0 w-4 h-4 rounded border-2 transition-colors duration-200 flex items-center justify-center"
|
|
182
|
+
class="shk-toggle-control shk-toggle-box flex-shrink-0 w-4 h-4 rounded border-2 transition-colors duration-200 flex items-center justify-center"
|
|
183
|
+
role="checkbox"
|
|
184
|
+
[attr.aria-checked]="_value()"
|
|
185
|
+
[attr.aria-disabled]="isDisabled() || null"
|
|
186
|
+
[attr.aria-label]="label() || null"
|
|
187
|
+
[attr.tabindex]="isDisabled() ? -1 : 0"
|
|
188
|
+
(keydown)="onKeydown($event)"
|
|
150
189
|
[class._shk-bg-primary]="_value()"
|
|
151
190
|
[class._shk-border-primary]="_value()"
|
|
152
191
|
[class._shk-border-surface-300]="!_value()"
|
|
@@ -167,16 +206,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.23", ngImpo
|
|
|
167
206
|
}
|
|
168
207
|
</label>
|
|
169
208
|
</div>
|
|
170
|
-
`,
|
|
171
|
-
providers: [
|
|
209
|
+
`, providers: [
|
|
172
210
|
{
|
|
173
211
|
provide: NG_VALUE_ACCESSOR,
|
|
174
212
|
useExisting: forwardRef(() => ToggleComponent),
|
|
175
213
|
multi: true,
|
|
176
214
|
},
|
|
177
|
-
],
|
|
178
|
-
|
|
179
|
-
}], ctorParameters: () => [], propDecorators: { label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], mode: [{ type: i0.Input, args: [{ isSignal: true, alias: "mode", required: false }] }], checked: [{ type: i0.Input, args: [{ isSignal: true, alias: "checked", required: false }] }], checkedChange: [{ type: i0.Output, args: ["checkedChange"] }] } });
|
|
215
|
+
], styles: [".shk-toggle-control{outline:none;transition:box-shadow .15s ease}.shk-toggle-control:focus-visible{box-shadow:0 0 0 3px color-mix(in srgb,var(--shk-primary-500) 30%,transparent)}.shk-toggle-box{border-radius:.3rem}label:not(.shk-toggle-disabled):hover .shk-toggle-box[aria-checked=false]{border-color:var(--shk-primary-400)}\n"] }]
|
|
216
|
+
}], ctorParameters: () => [], propDecorators: { label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], mode: [{ type: i0.Input, args: [{ isSignal: true, alias: "mode", required: false }] }], checked: [{ type: i0.Input, args: [{ isSignal: true, alias: "checked", required: false }] }], checkedChange: [{ type: i0.Output, args: ["checkedChange"] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }] } });
|
|
180
217
|
|
|
181
218
|
/**
|
|
182
219
|
* Generated bundle index. Do not edit.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shirkasoft-ui-components-toggle.mjs","sources":["../../../projects/ui-components/toggle/toggle.component.ts","../../../projects/ui-components/toggle/shirkasoft-ui-components-toggle.ts"],"sourcesContent":["import { Component, forwardRef, input, output, signal, effect } from '@angular/core';\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';\nimport { CommonModule } from '@angular/common';\n\n/**\n * Shirkasoft UI Components.\n * Authors: Roberto Valladares Martin (Ansem13), Julio César García García (Sanjuli14).\n * Belongs to Shirkasoft.\n */\n\n/**\n * Switch / checkbox component that implements ControlValueAccessor so it can\n * be used with reactive and template-driven forms.\n */\n@Component({\n selector: 'shk-toggle',\n standalone: true,\n imports: [CommonModule],\n template: `\n <div class=\"relative\">\n <label\n class=\"inline-flex items-center gap-3 cursor-pointer select-none\"\n [class.opacity-50]=\"
|
|
1
|
+
{"version":3,"file":"shirkasoft-ui-components-toggle.mjs","sources":["../../../projects/ui-components/toggle/toggle.component.ts","../../../projects/ui-components/toggle/shirkasoft-ui-components-toggle.ts"],"sourcesContent":["import { Component, forwardRef, input, output, signal, effect, computed } from '@angular/core';\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';\nimport { CommonModule } from '@angular/common';\n\n/**\n * Shirkasoft UI Components.\n * Authors: Roberto Valladares Martin (Ansem13), Julio César García García (Sanjuli14).\n * Belongs to Shirkasoft.\n */\n\n/**\n * Switch / checkbox component that implements ControlValueAccessor so it can\n * be used with reactive and template-driven forms.\n */\n@Component({\n selector: 'shk-toggle',\n standalone: true,\n imports: [CommonModule],\n template: `\n <div class=\"relative\">\n <label\n class=\"inline-flex items-center gap-3 cursor-pointer select-none\"\n [class.opacity-50]=\"isDisabled()\"\n [class.cursor-not-allowed]=\"isDisabled()\"\n [class.shk-toggle-disabled]=\"isDisabled()\"\n >\n @if (mode() === 'toggle') {\n <div\n class=\"shk-toggle-control relative flex-shrink-0 rounded-full\"\n role=\"switch\"\n [attr.aria-checked]=\"_value()\"\n [attr.aria-disabled]=\"isDisabled() || null\"\n [attr.aria-label]=\"label() || null\"\n [attr.tabindex]=\"isDisabled() ? -1 : 0\"\n (keydown)=\"onKeydown($event)\"\n (click)=\"toggle()\"\n >\n <div\n class=\"w-10 h-6 rounded-full transition-colors duration-200\"\n [class._shk-bg-primary]=\"_value()\"\n [class._shk-bg-surface-300]=\"!_value()\"\n [class._shk-dark-bg-surface-600]=\"!_value()\"\n ></div>\n <div\n class=\"shk-toggle-thumb absolute top-0.5 left-0.5 w-5 h-5 _shk-bg-white rounded-full shadow transition-transform duration-200\"\n [class.translate-x-4]=\"_value()\"\n ></div>\n </div>\n } @else {\n <div\n class=\"shk-toggle-control shk-toggle-box flex-shrink-0 w-4 h-4 rounded border-2 transition-colors duration-200 flex items-center justify-center\"\n role=\"checkbox\"\n [attr.aria-checked]=\"_value()\"\n [attr.aria-disabled]=\"isDisabled() || null\"\n [attr.aria-label]=\"label() || null\"\n [attr.tabindex]=\"isDisabled() ? -1 : 0\"\n (keydown)=\"onKeydown($event)\"\n [class._shk-bg-primary]=\"_value()\"\n [class._shk-border-primary]=\"_value()\"\n [class._shk-border-surface-300]=\"!_value()\"\n [class._shk-dark-border-surface-600]=\"!_value()\"\n (click)=\"toggle()\"\n >\n @if (_value()) {\n <svg class=\"w-3 h-3 text-white\" viewBox=\"0 0 12 12\" fill=\"none\">\n <path d=\"M2 6l3 3 5-5\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n </svg>\n }\n </div>\n }\n @if (label()) {\n <span class=\"text-sm _shk-text-surface-700 _shk-dark-text-surface-300\">\n {{ label() }}\n </span>\n }\n </label>\n </div>\n `,\n styles: [\n `\n .shk-toggle-control {\n outline: none;\n transition: box-shadow 0.15s ease;\n }\n .shk-toggle-control:focus-visible {\n box-shadow: 0 0 0 3px color-mix(in srgb, var(--shk-primary-500) 30%, transparent);\n }\n .shk-toggle-box {\n border-radius: 0.3rem;\n }\n label:not(.shk-toggle-disabled):hover .shk-toggle-box[aria-checked='false'] {\n border-color: var(--shk-primary-400);\n }\n `,\n ],\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => ToggleComponent),\n multi: true,\n },\n ],\n})\nexport class ToggleComponent implements ControlValueAccessor {\n /** Text displayed next to the control. */\n label = input<string>('');\n /** Visual style: 'toggle' (switch) or 'checkbox'. Defaults to 'toggle'. */\n mode = input<'toggle' | 'checkbox'>('toggle');\n /** Manually controlled checked state (supports one-way binding). */\n checked = input<boolean | undefined>(undefined);\n /** Emitted with the new value when the user toggles the control. */\n checkedChange = output<boolean>();\n /** Disables the control (also settable through reactive forms). */\n disabled = input<boolean>(false);\n\n /** Internal controlled/reactive value. */\n _value = signal(false);\n /** Reactive disabled state. */\n _disabled = signal(false);\n /** Disabled through the `disabled` input or the form control. */\n isDisabled = computed(() => this.disabled() || this._disabled());\n\n /** Callback notified with the new value on change (ControlValueAccessor). */\n private onChange: (value: boolean) => void = () => {};\n\n /** Callback notified when the control loses focus or is touched. */\n private onTouched: () => void = () => {};\n\n constructor() {\n effect(() => {\n const manual = this.checked();\n if (manual !== undefined) {\n this._value.set(manual);\n }\n });\n }\n\n /** Sets the value from the form control. */\n writeValue(value: any): void {\n this._value.set(!!value);\n }\n\n /** Registers the callback invoked on value changes (ControlValueAccessor). */\n registerOnChange(fn: any): void {\n this.onChange = fn;\n }\n\n /** Registers the callback invoked when the control is touched. */\n registerOnTouched(fn: any): void {\n this.onTouched = fn;\n }\n\n /** Reflects the disabled state of the form control. */\n setDisabledState(isDisabled: boolean): void {\n this._disabled.set(isDisabled);\n }\n\n /**\n * Inverts the current value (unless disabled), notifies the form control,\n * marks the control as touched and emits `checkedChange`.\n */\n /** Space/Enter toggles the focused switch or checkbox. */\n onKeydown(event: KeyboardEvent): void {\n if (event.key === ' ' || event.key === 'Enter') {\n event.preventDefault();\n this.toggle();\n }\n }\n\n toggle(): void {\n if (this.isDisabled()) return;\n const newValue = !this._value();\n this._value.set(newValue);\n this.onChange(newValue);\n this.onTouched();\n this.checkedChange.emit(newValue);\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;AAIA;;;;AAIG;AAEH;;;AAGG;MA0FU,eAAe,CAAA;AAyB1B,IAAA,WAAA,GAAA;;AAvBA,QAAA,IAAA,CAAA,KAAK,GAAG,KAAK,CAAS,EAAE,4EAAC;;AAEzB,QAAA,IAAA,CAAA,IAAI,GAAG,KAAK,CAAwB,QAAQ,2EAAC;;AAE7C,QAAA,IAAA,CAAA,OAAO,GAAG,KAAK,CAAsB,SAAS,8EAAC;;QAE/C,IAAA,CAAA,aAAa,GAAG,MAAM,EAAW;;AAEjC,QAAA,IAAA,CAAA,QAAQ,GAAG,KAAK,CAAU,KAAK,+EAAC;;AAGhC,QAAA,IAAA,CAAA,MAAM,GAAG,MAAM,CAAC,KAAK,6EAAC;;AAEtB,QAAA,IAAA,CAAA,SAAS,GAAG,MAAM,CAAC,KAAK,gFAAC;;AAEzB,QAAA,IAAA,CAAA,UAAU,GAAG,QAAQ,CAAC,MAAM,IAAI,CAAC,QAAQ,EAAE,IAAI,IAAI,CAAC,SAAS,EAAE,iFAAC;;AAGxD,QAAA,IAAA,CAAA,QAAQ,GAA6B,MAAK,EAAE,CAAC;;AAG7C,QAAA,IAAA,CAAA,SAAS,GAAe,MAAK,EAAE,CAAC;QAGtC,MAAM,CAAC,MAAK;AACV,YAAA,MAAM,MAAM,GAAG,IAAI,CAAC,OAAO,EAAE;AAC7B,YAAA,IAAI,MAAM,KAAK,SAAS,EAAE;AACxB,gBAAA,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC;YACzB;AACF,QAAA,CAAC,CAAC;IACJ;;AAGA,IAAA,UAAU,CAAC,KAAU,EAAA;QACnB,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC;IAC1B;;AAGA,IAAA,gBAAgB,CAAC,EAAO,EAAA;AACtB,QAAA,IAAI,CAAC,QAAQ,GAAG,EAAE;IACpB;;AAGA,IAAA,iBAAiB,CAAC,EAAO,EAAA;AACvB,QAAA,IAAI,CAAC,SAAS,GAAG,EAAE;IACrB;;AAGA,IAAA,gBAAgB,CAAC,UAAmB,EAAA;AAClC,QAAA,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,UAAU,CAAC;IAChC;AAEA;;;AAGG;;AAEH,IAAA,SAAS,CAAC,KAAoB,EAAA;AAC5B,QAAA,IAAI,KAAK,CAAC,GAAG,KAAK,GAAG,IAAI,KAAK,CAAC,GAAG,KAAK,OAAO,EAAE;YAC9C,KAAK,CAAC,cAAc,EAAE;YACtB,IAAI,CAAC,MAAM,EAAE;QACf;IACF;IAEA,MAAM,GAAA;QACJ,IAAI,IAAI,CAAC,UAAU,EAAE;YAAE;AACvB,QAAA,MAAM,QAAQ,GAAG,CAAC,IAAI,CAAC,MAAM,EAAE;AAC/B,QAAA,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,QAAQ,CAAC;AACzB,QAAA,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC;QACvB,IAAI,CAAC,SAAS,EAAE;AAChB,QAAA,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,QAAQ,CAAC;IACnC;+GAzEW,eAAe,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;AAAf,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,IAAA,EAAA,eAAe,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,YAAA,EAAA,MAAA,EAAA,EAAA,KAAA,EAAA,EAAA,iBAAA,EAAA,OAAA,EAAA,UAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,IAAA,EAAA,EAAA,iBAAA,EAAA,MAAA,EAAA,UAAA,EAAA,MAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,OAAA,EAAA,EAAA,iBAAA,EAAA,SAAA,EAAA,UAAA,EAAA,SAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,QAAA,EAAA,EAAA,iBAAA,EAAA,UAAA,EAAA,UAAA,EAAA,UAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,EAAA,OAAA,EAAA,EAAA,aAAA,EAAA,eAAA,EAAA,EAAA,SAAA,EARf;AACT,YAAA;AACE,gBAAA,OAAO,EAAE,iBAAiB;AAC1B,gBAAA,WAAW,EAAE,UAAU,CAAC,MAAM,eAAe,CAAC;AAC9C,gBAAA,KAAK,EAAE,IAAI;AACZ,aAAA;SACF,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,EAnFS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2DT,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,MAAA,EAAA,CAAA,wUAAA,CAAA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,EA5DS,YAAY,EAAA,CAAA,EAAA,CAAA,CAAA;;4FAsFX,eAAe,EAAA,UAAA,EAAA,CAAA;kBAzF3B,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,YAAY,cACV,IAAI,EAAA,OAAA,EACP,CAAC,YAAY,CAAC,EAAA,QAAA,EACb;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2DT,EAAA,SAAA,EAkBU;AACT,wBAAA;AACE,4BAAA,OAAO,EAAE,iBAAiB;AAC1B,4BAAA,WAAW,EAAE,UAAU,CAAC,qBAAqB,CAAC;AAC9C,4BAAA,KAAK,EAAE,IAAI;AACZ,yBAAA;AACF,qBAAA,EAAA,MAAA,EAAA,CAAA,wUAAA,CAAA,EAAA;;;ACrGH;;AAEG;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "shirkasoft-ui-components",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.9",
|
|
4
4
|
"description": "Angular UI Components Library — themeable via CSS custom properties",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"angular",
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"bugs": {
|
|
20
20
|
"url": "https://github.com/Ansem13/shirkasoft-ui-components/issues"
|
|
21
21
|
},
|
|
22
|
-
"homepage": "https://
|
|
22
|
+
"homepage": "https://ui-library.shirkasoft.com/",
|
|
23
23
|
"peerDependencies": {
|
|
24
24
|
"@angular/common": "^21.2.0",
|
|
25
25
|
"@angular/core": "^21.2.0",
|
package/src/theme.css
CHANGED
|
@@ -460,3 +460,83 @@
|
|
|
460
460
|
._shk-scrollbar::-webkit-scrollbar-corner {
|
|
461
461
|
background: transparent;
|
|
462
462
|
}
|
|
463
|
+
|
|
464
|
+
/* ============================================================
|
|
465
|
+
Form controls (text-field, price-input, select trigger…)
|
|
466
|
+
Soft focus ring + clearly distinguishable disabled state.
|
|
467
|
+
Element-qualified selectors so they win over the Tailwind
|
|
468
|
+
utilities used in the templates regardless of import order.
|
|
469
|
+
============================================================ */
|
|
470
|
+
:root {
|
|
471
|
+
--shk-ring: color-mix(in srgb, var(--shk-primary-500) 22%, transparent);
|
|
472
|
+
--shk-ring-error: color-mix(in srgb, var(--shk-error-500) 22%, transparent);
|
|
473
|
+
}
|
|
474
|
+
input.shk-control,
|
|
475
|
+
textarea.shk-control,
|
|
476
|
+
div.shk-control {
|
|
477
|
+
transition:
|
|
478
|
+
border-color 0.15s ease,
|
|
479
|
+
box-shadow 0.15s ease,
|
|
480
|
+
background-color 0.15s ease;
|
|
481
|
+
}
|
|
482
|
+
input.shk-control:focus,
|
|
483
|
+
textarea.shk-control:focus,
|
|
484
|
+
div.shk-control:focus,
|
|
485
|
+
div.shk-control:focus-within,
|
|
486
|
+
div.shk-control.open {
|
|
487
|
+
outline: none;
|
|
488
|
+
border-color: var(--shk-primary-500);
|
|
489
|
+
box-shadow: 0 0 0 3px var(--shk-ring);
|
|
490
|
+
}
|
|
491
|
+
/* Lift the focused field over an attached button (search, currency…) so
|
|
492
|
+
the ring isn't hidden on that side. */
|
|
493
|
+
input.shk-control.shk-control-addon:focus {
|
|
494
|
+
position: relative;
|
|
495
|
+
z-index: 1;
|
|
496
|
+
}
|
|
497
|
+
/* Field whose error was just fixed keeps its green state while focused. */
|
|
498
|
+
input.shk-control.shk-control-valid:focus,
|
|
499
|
+
textarea.shk-control.shk-control-valid:focus {
|
|
500
|
+
border-color: var(--shk-success-600);
|
|
501
|
+
box-shadow: 0 0 0 3px color-mix(in srgb, var(--shk-success-600) 22%, transparent);
|
|
502
|
+
}
|
|
503
|
+
input.shk-control[aria-invalid='true']:focus,
|
|
504
|
+
textarea.shk-control[aria-invalid='true']:focus,
|
|
505
|
+
div.shk-control[aria-invalid='true']:focus-within,
|
|
506
|
+
div.shk-control[aria-invalid='true'].open {
|
|
507
|
+
border-color: var(--shk-error-500);
|
|
508
|
+
box-shadow: 0 0 0 3px var(--shk-ring-error);
|
|
509
|
+
}
|
|
510
|
+
input.shk-control:disabled,
|
|
511
|
+
textarea.shk-control:disabled,
|
|
512
|
+
div.shk-control.shk-control-disabled {
|
|
513
|
+
background-color: var(--shk-surface-100);
|
|
514
|
+
border-color: var(--shk-surface-200);
|
|
515
|
+
color: var(--shk-surface-500);
|
|
516
|
+
cursor: not-allowed;
|
|
517
|
+
box-shadow: none;
|
|
518
|
+
}
|
|
519
|
+
.dark input.shk-control:disabled,
|
|
520
|
+
.dark textarea.shk-control:disabled,
|
|
521
|
+
.dark div.shk-control.shk-control-disabled {
|
|
522
|
+
background-color: var(--shk-surface-50);
|
|
523
|
+
color: var(--shk-surface-400);
|
|
524
|
+
}
|
|
525
|
+
div.shk-control.shk-control-disabled * {
|
|
526
|
+
cursor: not-allowed;
|
|
527
|
+
}
|
|
528
|
+
|
|
529
|
+
/* ============================================================
|
|
530
|
+
Reduced motion: honour the OS setting in every component.
|
|
531
|
+
Loading indicators (spinners, dots, bars) are essential feedback
|
|
532
|
+
and keep animating, otherwise the UI looks frozen.
|
|
533
|
+
============================================================ */
|
|
534
|
+
@media (prefers-reduced-motion: reduce) {
|
|
535
|
+
[class*='shk-']:not([class*='spin']):not([class*='shk-loading']),
|
|
536
|
+
[class*='shk-']:not([class*='spin']):not([class*='shk-loading'])::before,
|
|
537
|
+
[class*='shk-']:not([class*='spin']):not([class*='shk-loading'])::after {
|
|
538
|
+
animation-duration: 0.01ms !important;
|
|
539
|
+
animation-iteration-count: 1 !important;
|
|
540
|
+
transition-duration: 0.01ms !important;
|
|
541
|
+
}
|
|
542
|
+
}
|
|
@@ -2,7 +2,7 @@ import * as _angular_core from '@angular/core';
|
|
|
2
2
|
import { ControlValueAccessor, FormGroup, FormControl } from '@angular/forms';
|
|
3
3
|
|
|
4
4
|
/** Which granularity the picker edits: a day, a month or a year. */
|
|
5
|
-
type DatePickerView = 'date' | 'month' | 'year';
|
|
5
|
+
type DatePickerView = 'date' | 'week' | 'month' | 'year';
|
|
6
6
|
/** Which time selection mode the analog clock is in. */
|
|
7
7
|
type ClockMode = 'hours' | 'minutes';
|
|
8
8
|
/**
|
|
@@ -22,8 +22,10 @@ declare class DatePickerComponent implements ControlValueAccessor {
|
|
|
22
22
|
private transloco;
|
|
23
23
|
/** HTML id for the input (for label/for pairing). */
|
|
24
24
|
id: _angular_core.InputSignal<string>;
|
|
25
|
-
/** Granularity of the picker ('date' | 'month' | 'year'). */
|
|
25
|
+
/** Granularity of the picker ('date' | 'week' | 'month' | 'year'). */
|
|
26
26
|
view: _angular_core.InputSignal<DatePickerView>;
|
|
27
|
+
/** First day of the week (0=Sunday ... 6=Saturday), used by week view. */
|
|
28
|
+
weekStart: _angular_core.InputSignal<number>;
|
|
27
29
|
/** Label shown above the input. */
|
|
28
30
|
label: _angular_core.InputSignal<string>;
|
|
29
31
|
/** Placeholder of the input. */
|
|
@@ -128,6 +130,17 @@ declare class DatePickerComponent implements ControlValueAccessor {
|
|
|
128
130
|
firstDayOfMonth: _angular_core.Signal<number>;
|
|
129
131
|
/** Calendar grid: nulls for leading blanks then the days of the month. */
|
|
130
132
|
calendarDays: _angular_core.Signal<(number | null)[]>;
|
|
133
|
+
/** Weeks of the viewed month (rows aligned to `weekStart`), for week view. */
|
|
134
|
+
monthWeeks: _angular_core.Signal<{
|
|
135
|
+
index: number;
|
|
136
|
+
start: Date;
|
|
137
|
+
end: Date;
|
|
138
|
+
range: string;
|
|
139
|
+
}[]>;
|
|
140
|
+
/** Localized range label for a week (e.g. '2 — 8 feb'). */
|
|
141
|
+
formatWeekRange(start: Date, end: Date): string;
|
|
142
|
+
/** Localized label for a week row ('Semana N' / 'Week N'). */
|
|
143
|
+
weekLabel(index: number): string;
|
|
131
144
|
/** Whether the prev navigation button is allowed by `minValue`. */
|
|
132
145
|
canGoPrev: _angular_core.Signal<boolean>;
|
|
133
146
|
/** Whether the next navigation button is allowed by `maxValue`. */
|
|
@@ -171,7 +184,8 @@ declare class DatePickerComponent implements ControlValueAccessor {
|
|
|
171
184
|
selectMonth(monthIndex: number): void;
|
|
172
185
|
/** Selects a day - completes the date selection. */
|
|
173
186
|
selectDay(day: number): void;
|
|
174
|
-
/**
|
|
187
|
+
/** Selects a week - emits its start date (YYYY-MM-DD). */
|
|
188
|
+
selectWeek(start: Date): void;
|
|
175
189
|
private setValue;
|
|
176
190
|
/** Confirms the selected time and commits the combined date+time value. */
|
|
177
191
|
confirmTime(): void;
|
|
@@ -272,6 +286,12 @@ declare class DatePickerComponent implements ControlValueAccessor {
|
|
|
272
286
|
private parseTimeOnly;
|
|
273
287
|
/** Whether the given day is today's date. */
|
|
274
288
|
isToday(day: number): boolean;
|
|
289
|
+
/** ISO date (YYYY-MM-DD) of the week start containing the given date. */
|
|
290
|
+
private weekStartISO;
|
|
291
|
+
/** Whether the given week row contains the displayed/selected date. */
|
|
292
|
+
isSelectedWeek(start: Date): boolean;
|
|
293
|
+
/** Whether the given week row contains today's date. */
|
|
294
|
+
isCurrentWeek(start: Date): boolean;
|
|
275
295
|
/** Whether the given month matches the selected month and year. */
|
|
276
296
|
isSelectedMonth(monthIndex: number): boolean;
|
|
277
297
|
isCurrentMonth(monthIndex: number): boolean;
|
|
@@ -282,7 +302,7 @@ declare class DatePickerComponent implements ControlValueAccessor {
|
|
|
282
302
|
registerOnTouched(fn: any): void;
|
|
283
303
|
setDisabledState(isDisabled: boolean): void;
|
|
284
304
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<DatePickerComponent, never>;
|
|
285
|
-
static ɵcmp: _angular_core.ɵɵComponentDeclaration<DatePickerComponent, "shk-date-picker", never, { "id": { "alias": "id"; "required": false; "isSignal": true; }; "view": { "alias": "view"; "required": false; "isSignal": true; }; "label": { "alias": "label"; "required": false; "isSignal": true; }; "placeholder": { "alias": "placeholder"; "required": false; "isSignal": true; }; "formGroup": { "alias": "formGroup"; "required": false; "isSignal": true; }; "control": { "alias": "control"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "errorMessage": { "alias": "errorMessage"; "required": false; "isSignal": true; }; "errorMessages": { "alias": "errorMessages"; "required": false; "isSignal": true; }; "minValue": { "alias": "minValue"; "required": false; "isSignal": true; }; "maxValue": { "alias": "maxValue"; "required": false; "isSignal": true; }; "locale": { "alias": "locale"; "required": false; "isSignal": true; }; "timeOnly": { "alias": "timeOnly"; "required": false; "isSignal": true; }; "showTime": { "alias": "showTime"; "required": false; "isSignal": true; }; "hourFormat": { "alias": "hourFormat"; "required": false; "isSignal": true; }; "showSeconds": { "alias": "showSeconds"; "required": false; "isSignal": true; }; "minuteStep": { "alias": "minuteStep"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
305
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<DatePickerComponent, "shk-date-picker", never, { "id": { "alias": "id"; "required": false; "isSignal": true; }; "view": { "alias": "view"; "required": false; "isSignal": true; }; "weekStart": { "alias": "weekStart"; "required": false; "isSignal": true; }; "label": { "alias": "label"; "required": false; "isSignal": true; }; "placeholder": { "alias": "placeholder"; "required": false; "isSignal": true; }; "formGroup": { "alias": "formGroup"; "required": false; "isSignal": true; }; "control": { "alias": "control"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "errorMessage": { "alias": "errorMessage"; "required": false; "isSignal": true; }; "errorMessages": { "alias": "errorMessages"; "required": false; "isSignal": true; }; "minValue": { "alias": "minValue"; "required": false; "isSignal": true; }; "maxValue": { "alias": "maxValue"; "required": false; "isSignal": true; }; "locale": { "alias": "locale"; "required": false; "isSignal": true; }; "timeOnly": { "alias": "timeOnly"; "required": false; "isSignal": true; }; "showTime": { "alias": "showTime"; "required": false; "isSignal": true; }; "hourFormat": { "alias": "hourFormat"; "required": false; "isSignal": true; }; "showSeconds": { "alias": "showSeconds"; "required": false; "isSignal": true; }; "minuteStep": { "alias": "minuteStep"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
286
306
|
}
|
|
287
307
|
|
|
288
308
|
export { DatePickerComponent };
|
|
@@ -39,6 +39,14 @@ interface RowAction {
|
|
|
39
39
|
isVisible?: (rowData: any) => boolean;
|
|
40
40
|
isDisabled?: (rowData: any) => boolean;
|
|
41
41
|
}
|
|
42
|
+
interface BulkAction {
|
|
43
|
+
label: string;
|
|
44
|
+
icon?: string | any;
|
|
45
|
+
onClick: (selectedRows: any[]) => void;
|
|
46
|
+
class?: string;
|
|
47
|
+
isVisible?: (selectedRows: any[]) => boolean;
|
|
48
|
+
isDisabled?: (selectedRows: any[]) => boolean;
|
|
49
|
+
}
|
|
42
50
|
interface PageChangeEvent {
|
|
43
51
|
first: number;
|
|
44
52
|
rows: number;
|
|
@@ -50,16 +58,13 @@ interface FilterChangeEvent {
|
|
|
50
58
|
[key: string]: any;
|
|
51
59
|
};
|
|
52
60
|
}
|
|
53
|
-
/**
|
|
54
|
-
* Shirkasoft UI Components.
|
|
55
|
-
* Authors: Roberto Valladares Martin (Ansem13), Julio César García García (Sanjuli14).
|
|
56
|
-
* Belongs to Shirkasoft.
|
|
57
|
-
*/
|
|
58
61
|
/**
|
|
59
62
|
* Data table with sorting, column filters, global search, pagination,
|
|
60
63
|
* row/header actions, tag cells and optional server-side mode.
|
|
61
64
|
*/
|
|
62
65
|
declare class TableComponent {
|
|
66
|
+
/** Unique id prefix so several tables on the same page don't share element ids. */
|
|
67
|
+
protected readonly uid: string;
|
|
63
68
|
private fb;
|
|
64
69
|
private cdr;
|
|
65
70
|
private transloco;
|
|
@@ -124,6 +129,19 @@ declare class TableComponent {
|
|
|
124
129
|
}[]>;
|
|
125
130
|
/** Currently active filter chip value. */
|
|
126
131
|
activeFilter: _angular_core.InputSignal<string>;
|
|
132
|
+
/** Whether to render the leading checkbox column for multi-row selection. */
|
|
133
|
+
selectable: _angular_core.InputSignal<boolean>;
|
|
134
|
+
/**
|
|
135
|
+
* Field used to identify rows in the selection (keeps it stable across
|
|
136
|
+
* pages and data reloads). Falls back to the row reference when missing.
|
|
137
|
+
*/
|
|
138
|
+
dataKey: _angular_core.InputSignal<string>;
|
|
139
|
+
/** Optional predicate to disable the checkbox of specific rows. */
|
|
140
|
+
isRowSelectable: _angular_core.InputSignal<((row: any) => boolean) | undefined>;
|
|
141
|
+
/** Actions shown in the header while at least one row is selected. */
|
|
142
|
+
bulkActions: _angular_core.InputSignal<BulkAction[]>;
|
|
143
|
+
/** Selected rows. Supports two-way binding via `[(selection)]`. */
|
|
144
|
+
selection: _angular_core.ModelSignal<any[]>;
|
|
127
145
|
/** Emits when the user clicks the refresh button. */
|
|
128
146
|
refresh: _angular_core.OutputEmitterRef<void>;
|
|
129
147
|
/** Emits page changes (server-side mode) with first/rows/page info. */
|
|
@@ -175,6 +193,20 @@ declare class TableComponent {
|
|
|
175
193
|
private columnFilterSubscriptions;
|
|
176
194
|
/** Columns array with the leading `actions` column when row actions exist. */
|
|
177
195
|
columnsWithActions: _angular_core.Signal<Column[]>;
|
|
196
|
+
/** Keys of the selected rows, for O(1) lookups in the template. */
|
|
197
|
+
private selectedKeys;
|
|
198
|
+
/** Whether non-empty data has been received (see the selection pruning effect). */
|
|
199
|
+
private hasReceivedData;
|
|
200
|
+
/** Selectable rows of the current page. */
|
|
201
|
+
protected selectablePageRows: _angular_core.Signal<any[]>;
|
|
202
|
+
/** Whether every selectable row of the current page is selected. */
|
|
203
|
+
allPageSelected: _angular_core.Signal<boolean>;
|
|
204
|
+
/** Whether only part of the current page is selected (header checkbox indeterminate). */
|
|
205
|
+
somePageSelected: _angular_core.Signal<boolean>;
|
|
206
|
+
/** Visible bulk actions for the current selection. */
|
|
207
|
+
visibleBulkActions: _angular_core.Signal<BulkAction[]>;
|
|
208
|
+
/** Number of rendered columns, including the selection column. */
|
|
209
|
+
totalColspan: _angular_core.Signal<number>;
|
|
178
210
|
/** Total records: server-provided in server mode, locally computed otherwise. */
|
|
179
211
|
effectiveTotalRecords: _angular_core.Signal<number>;
|
|
180
212
|
/**
|
|
@@ -208,6 +240,31 @@ declare class TableComponent {
|
|
|
208
240
|
private applyColumnFilters;
|
|
209
241
|
/** Slices the filtered rows for the current page. */
|
|
210
242
|
private updateDisplayedData;
|
|
243
|
+
/** Identity used for a row inside the selection. */
|
|
244
|
+
private getSelectionKey;
|
|
245
|
+
/** Whether the row's checkbox is enabled. */
|
|
246
|
+
canSelectRow(row: any): boolean;
|
|
247
|
+
/** Whether the row is currently selected. */
|
|
248
|
+
isRowSelected(row: any): boolean;
|
|
249
|
+
/** Selects/deselects a single row. */
|
|
250
|
+
toggleRowSelection(row: any): void;
|
|
251
|
+
/**
|
|
252
|
+
* Header checkbox: selects every selectable row of the current page or,
|
|
253
|
+
* when all of them are already selected, removes them from the selection.
|
|
254
|
+
* Rows selected on other pages are kept.
|
|
255
|
+
*/
|
|
256
|
+
toggleSelectAllPage(): void;
|
|
257
|
+
/** Clears the whole selection. */
|
|
258
|
+
clearSelection(): void;
|
|
259
|
+
/** Runs a bulk action with the current selection. */
|
|
260
|
+
runBulkAction(action: BulkAction): void;
|
|
261
|
+
/** Whether a bulk action is disabled for the current selection. */
|
|
262
|
+
isBulkActionDisabled(action: BulkAction): boolean;
|
|
263
|
+
/**
|
|
264
|
+
* Drops selected rows that no longer exist in the data (client mode, e.g.
|
|
265
|
+
* after a bulk delete) and refreshes kept rows with their new references.
|
|
266
|
+
*/
|
|
267
|
+
private pruneSelection;
|
|
211
268
|
/** Emits the filter chip clicked in the template. */
|
|
212
269
|
onFilterClick(value: string): void;
|
|
213
270
|
/** Toggles the sort direction of a column (first click sorts ascending). */
|
|
@@ -221,8 +278,26 @@ declare class TableComponent {
|
|
|
221
278
|
onSearchInput(value: string): void;
|
|
222
279
|
/** Clears a column filter value and hides its input. */
|
|
223
280
|
clearFilter(field: string): void;
|
|
224
|
-
/**
|
|
225
|
-
|
|
281
|
+
/** Width (px) of the column filter popup, used to keep it inside the viewport. */
|
|
282
|
+
private readonly FILTER_POPUP_WIDTH;
|
|
283
|
+
/** Viewport position of the open column filter popup. */
|
|
284
|
+
filterPopupPosition: _angular_core.WritableSignal<{
|
|
285
|
+
top: number;
|
|
286
|
+
left: number;
|
|
287
|
+
}>;
|
|
288
|
+
/** Filter button the open popup is anchored to, and its scroll/resize listener cleanup. */
|
|
289
|
+
private filterAnchor;
|
|
290
|
+
private filterListenersCleanup;
|
|
291
|
+
/**
|
|
292
|
+
* Toggles a column filter popup. Only one popup is open at a time. The
|
|
293
|
+
* popup uses `position: fixed` anchored to the filter button, so the
|
|
294
|
+
* header cell (`overflow: hidden`) and the scroll wrapper can't clip it.
|
|
295
|
+
*/
|
|
296
|
+
toggleFilter(field: string, event?: Event): void;
|
|
297
|
+
/** Closes every column filter popup (values are kept). */
|
|
298
|
+
closeFilters(): void;
|
|
299
|
+
/** Places the filter popup under its button, clamped to the viewport. */
|
|
300
|
+
private updateFilterPopupPosition;
|
|
226
301
|
/**
|
|
227
302
|
* Whether a column filter is non-empty. Avoids treating the number 0 as
|
|
228
303
|
* "no value".
|
|
@@ -307,9 +382,11 @@ declare class TableComponent {
|
|
|
307
382
|
private getRowKey;
|
|
308
383
|
/** Closes all open action dropdowns when clicking anywhere on the document. */
|
|
309
384
|
onDocumentClick(): void;
|
|
385
|
+
/** Closes the column filter popup with Escape. */
|
|
386
|
+
onEscape(): void;
|
|
310
387
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<TableComponent, never>;
|
|
311
|
-
static ɵcmp: _angular_core.ɵɵComponentDeclaration<TableComponent, "shk-table", never, { "data": { "alias": "data"; "required": false; "isSignal": true; }; "columns": { "alias": "columns"; "required": false; "isSignal": true; }; "rowsPerPage": { "alias": "rowsPerPage"; "required": false; "isSignal": true; }; "rowsPerPageOptions": { "alias": "rowsPerPageOptions"; "required": false; "isSignal": true; }; "loading": { "alias": "loading"; "required": false; "isSignal": true; }; "showActionRow": { "alias": "showActionRow"; "required": false; "isSignal": true; }; "customTemplates": { "alias": "customTemplates"; "required": false; "isSignal": true; }; "headerActions": { "alias": "headerActions"; "required": false; "isSignal": true; }; "rowActions": { "alias": "rowActions"; "required": false; "isSignal": true; }; "hasShadow": { "alias": "hasShadow"; "required": false; "isSignal": true; }; "defaultSortField": { "alias": "defaultSortField"; "required": false; "isSignal": true; }; "defaultSortOrder": { "alias": "defaultSortOrder"; "required": false; "isSignal": true; }; "showSearch": { "alias": "showSearch"; "required": false; "isSignal": true; }; "searchPlaceholder": { "alias": "searchPlaceholder"; "required": false; "isSignal": true; }; "emptyMessage": { "alias": "emptyMessage"; "required": false; "isSignal": true; }; "serverSide": { "alias": "serverSide"; "required": false; "isSignal": true; }; "totalRecords": { "alias": "totalRecords"; "required": false; "isSignal": true; }; "filters": { "alias": "filters"; "required": false; "isSignal": true; }; "activeFilter": { "alias": "activeFilter"; "required": false; "isSignal": true; }; }, { "refresh": "refresh"; "pageChange": "pageChange"; "filterChange": "filterChange"; "searchChange": "searchChange"; "filterClick": "filterClick"; }, never, never, true, never>;
|
|
388
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<TableComponent, "shk-table", never, { "data": { "alias": "data"; "required": false; "isSignal": true; }; "columns": { "alias": "columns"; "required": false; "isSignal": true; }; "rowsPerPage": { "alias": "rowsPerPage"; "required": false; "isSignal": true; }; "rowsPerPageOptions": { "alias": "rowsPerPageOptions"; "required": false; "isSignal": true; }; "loading": { "alias": "loading"; "required": false; "isSignal": true; }; "showActionRow": { "alias": "showActionRow"; "required": false; "isSignal": true; }; "customTemplates": { "alias": "customTemplates"; "required": false; "isSignal": true; }; "headerActions": { "alias": "headerActions"; "required": false; "isSignal": true; }; "rowActions": { "alias": "rowActions"; "required": false; "isSignal": true; }; "hasShadow": { "alias": "hasShadow"; "required": false; "isSignal": true; }; "defaultSortField": { "alias": "defaultSortField"; "required": false; "isSignal": true; }; "defaultSortOrder": { "alias": "defaultSortOrder"; "required": false; "isSignal": true; }; "showSearch": { "alias": "showSearch"; "required": false; "isSignal": true; }; "searchPlaceholder": { "alias": "searchPlaceholder"; "required": false; "isSignal": true; }; "emptyMessage": { "alias": "emptyMessage"; "required": false; "isSignal": true; }; "serverSide": { "alias": "serverSide"; "required": false; "isSignal": true; }; "totalRecords": { "alias": "totalRecords"; "required": false; "isSignal": true; }; "filters": { "alias": "filters"; "required": false; "isSignal": true; }; "activeFilter": { "alias": "activeFilter"; "required": false; "isSignal": true; }; "selectable": { "alias": "selectable"; "required": false; "isSignal": true; }; "dataKey": { "alias": "dataKey"; "required": false; "isSignal": true; }; "isRowSelectable": { "alias": "isRowSelectable"; "required": false; "isSignal": true; }; "bulkActions": { "alias": "bulkActions"; "required": false; "isSignal": true; }; "selection": { "alias": "selection"; "required": false; "isSignal": true; }; }, { "selection": "selectionChange"; "refresh": "refresh"; "pageChange": "pageChange"; "filterChange": "filterChange"; "searchChange": "searchChange"; "filterClick": "filterClick"; }, never, never, true, never>;
|
|
312
389
|
}
|
|
313
390
|
|
|
314
391
|
export { TableComponent };
|
|
315
|
-
export type { Column, FilterChangeEvent, PageChangeEvent, RowAction, TableAction };
|
|
392
|
+
export type { BulkAction, Column, FilterChangeEvent, PageChangeEvent, RowAction, TableAction };
|
|
@@ -19,10 +19,14 @@ declare class ToggleComponent implements ControlValueAccessor {
|
|
|
19
19
|
checked: _angular_core.InputSignal<boolean | undefined>;
|
|
20
20
|
/** Emitted with the new value when the user toggles the control. */
|
|
21
21
|
checkedChange: _angular_core.OutputEmitterRef<boolean>;
|
|
22
|
+
/** Disables the control (also settable through reactive forms). */
|
|
23
|
+
disabled: _angular_core.InputSignal<boolean>;
|
|
22
24
|
/** Internal controlled/reactive value. */
|
|
23
25
|
_value: _angular_core.WritableSignal<boolean>;
|
|
24
26
|
/** Reactive disabled state. */
|
|
25
27
|
_disabled: _angular_core.WritableSignal<boolean>;
|
|
28
|
+
/** Disabled through the `disabled` input or the form control. */
|
|
29
|
+
isDisabled: _angular_core.Signal<boolean>;
|
|
26
30
|
/** Callback notified with the new value on change (ControlValueAccessor). */
|
|
27
31
|
private onChange;
|
|
28
32
|
/** Callback notified when the control loses focus or is touched. */
|
|
@@ -40,9 +44,11 @@ declare class ToggleComponent implements ControlValueAccessor {
|
|
|
40
44
|
* Inverts the current value (unless disabled), notifies the form control,
|
|
41
45
|
* marks the control as touched and emits `checkedChange`.
|
|
42
46
|
*/
|
|
47
|
+
/** Space/Enter toggles the focused switch or checkbox. */
|
|
48
|
+
onKeydown(event: KeyboardEvent): void;
|
|
43
49
|
toggle(): void;
|
|
44
50
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<ToggleComponent, never>;
|
|
45
|
-
static ɵcmp: _angular_core.ɵɵComponentDeclaration<ToggleComponent, "shk-toggle", never, { "label": { "alias": "label"; "required": false; "isSignal": true; }; "mode": { "alias": "mode"; "required": false; "isSignal": true; }; "checked": { "alias": "checked"; "required": false; "isSignal": true; }; }, { "checkedChange": "checkedChange"; }, never, never, true, never>;
|
|
51
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<ToggleComponent, "shk-toggle", never, { "label": { "alias": "label"; "required": false; "isSignal": true; }; "mode": { "alias": "mode"; "required": false; "isSignal": true; }; "checked": { "alias": "checked"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; }, { "checkedChange": "checkedChange"; }, never, never, true, never>;
|
|
46
52
|
}
|
|
47
53
|
|
|
48
54
|
export { ToggleComponent };
|