@egose/shadcn-theme-ng 0.2.0 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/autocomplete/fesm2022/autocomplete.mjs +1 -1
- package/checkbox/fesm2022/checkbox.mjs +6 -7
- package/checkbox/types/checkbox.d.ts +1 -1
- package/combobox/fesm2022/combobox.mjs +1 -1
- package/date-picker/README.md +15 -11
- package/date-picker/fesm2022/date-picker.mjs +148 -30
- package/date-picker/types/date-picker.d.ts +102 -9
- package/form-autocomplete/README.md +178 -0
- package/form-autocomplete/fesm2022/form-autocomplete.mjs +159 -0
- package/form-autocomplete/package.json +24 -0
- package/form-autocomplete/types/form-autocomplete.d.ts +81 -0
- package/form-checkbox/README.md +29 -18
- package/form-checkbox/fesm2022/form-checkbox.mjs +59 -17
- package/form-checkbox/types/form-checkbox.d.ts +43 -4
- package/form-combobox/README.md +203 -0
- package/form-combobox/fesm2022/form-combobox.mjs +181 -0
- package/form-combobox/package.json +24 -0
- package/form-combobox/types/form-combobox.d.ts +93 -0
- package/form-date-picker/README.md +49 -22
- package/form-date-picker/fesm2022/form-date-picker.mjs +74 -19
- package/form-date-picker/types/form-date-picker.d.ts +37 -1
- package/form-date-picker-multi/README.md +192 -0
- package/form-date-picker-multi/fesm2022/form-date-picker-multi.mjs +158 -0
- package/form-date-picker-multi/package.json +24 -0
- package/form-date-picker-multi/types/form-date-picker-multi.d.ts +78 -0
- package/form-date-range-picker/README.md +254 -0
- package/form-date-range-picker/fesm2022/form-date-range-picker.mjs +159 -0
- package/form-date-range-picker/package.json +24 -0
- package/form-date-range-picker/types/form-date-range-picker.d.ts +75 -0
- package/form-field/README.md +9 -0
- package/form-field/fesm2022/form-field.mjs +80 -5
- package/form-field/types/form-field.d.ts +50 -2
- package/form-field-simple/fesm2022/form-field-simple.mjs +15 -1
- package/form-field-simple/types/form-field-simple.d.ts +9 -2
- package/form-input-otp/README.md +195 -0
- package/form-input-otp/fesm2022/form-input-otp.mjs +140 -0
- package/form-input-otp/package.json +24 -0
- package/form-input-otp/types/form-input-otp.d.ts +78 -0
- package/form-month-year-picker/README.md +189 -0
- package/form-month-year-picker/fesm2022/form-month-year-picker.mjs +154 -0
- package/form-month-year-picker/package.json +24 -0
- package/form-month-year-picker/types/form-month-year-picker.d.ts +73 -0
- package/form-native-select/README.md +206 -0
- package/form-native-select/fesm2022/form-native-select.mjs +132 -0
- package/form-native-select/package.json +24 -0
- package/form-native-select/types/form-native-select.d.ts +77 -0
- package/form-phone-input/README.md +189 -0
- package/form-phone-input/fesm2022/form-phone-input.mjs +142 -0
- package/form-phone-input/package.json +24 -0
- package/form-phone-input/types/form-phone-input.d.ts +78 -0
- package/form-radio-group/README.md +199 -0
- package/form-radio-group/fesm2022/form-radio-group.mjs +140 -0
- package/form-radio-group/package.json +24 -0
- package/form-radio-group/types/form-radio-group.d.ts +83 -0
- package/form-searchable-multiselect/README.md +28 -17
- package/form-searchable-multiselect/fesm2022/form-searchable-multiselect.mjs +57 -19
- package/form-searchable-multiselect/types/form-searchable-multiselect.d.ts +39 -2
- package/form-select/README.md +30 -19
- package/form-select/fesm2022/form-select.mjs +57 -19
- package/form-select/types/form-select.d.ts +39 -2
- package/form-slider/README.md +183 -0
- package/form-slider/fesm2022/form-slider.mjs +140 -0
- package/form-slider/package.json +24 -0
- package/form-slider/types/form-slider.d.ts +80 -0
- package/form-switch/README.md +174 -0
- package/form-switch/fesm2022/form-switch.mjs +129 -0
- package/form-switch/package.json +24 -0
- package/form-switch/types/form-switch.d.ts +70 -0
- package/form-text-input/README.md +37 -26
- package/form-text-input/fesm2022/form-text-input.mjs +57 -19
- package/form-text-input/types/form-text-input.d.ts +39 -2
- package/form-textarea/README.md +33 -22
- package/form-textarea/fesm2022/form-textarea.mjs +57 -19
- package/form-textarea/types/form-textarea.d.ts +39 -2
- package/form-toggle/README.md +187 -0
- package/form-toggle/fesm2022/form-toggle.mjs +193 -0
- package/form-toggle/package.json +24 -0
- package/form-toggle/types/form-toggle.d.ts +100 -0
- package/form-toggle-group/README.md +177 -0
- package/form-toggle-group/fesm2022/form-toggle-group.mjs +145 -0
- package/form-toggle-group/package.json +24 -0
- package/form-toggle-group/types/form-toggle-group.d.ts +85 -0
- package/input-group/fesm2022/input-group.mjs +19 -9
- package/input-group/types/input-group.d.ts +4 -1
- package/native-select/fesm2022/native-select.mjs +18 -6
- package/native-select/types/native-select.d.ts +7 -2
- package/package.json +57 -1
- package/phone-input/README.md +114 -0
- package/phone-input/fesm2022/phone-input.mjs +191 -0
- package/phone-input/package.json +24 -0
- package/phone-input/types/phone-input.d.ts +67 -0
- package/radio-group/types/radio-group.d.ts +1 -1
- package/switch/fesm2022/switch.mjs +7 -5
- package/switch/types/switch.d.ts +2 -1
- package/typography/types/typography.d.ts +8 -8
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { InjectionToken, inject, input, computed, Component } from '@angular/core';
|
|
3
|
+
import * as i1 from '@angular/forms';
|
|
4
|
+
import { FormGroupDirective, ReactiveFormsModule, ControlContainer } from '@angular/forms';
|
|
5
|
+
import { injectEgFormErrorMessages, HlmFormIdGenerator, resolveEgFormError, HlmError, HlmHint } from '@egose/shadcn-theme-ng/form-field';
|
|
6
|
+
import { EgFormField } from '@egose/shadcn-theme-ng/form-field-simple';
|
|
7
|
+
import { HlmLabel } from '@egose/shadcn-theme-ng/label';
|
|
8
|
+
import { HlmToggleGroup, HlmToggleGroupItem } from '@egose/shadcn-theme-ng/toggle-group';
|
|
9
|
+
import { hlm } from '@egose/shadcn-theme-ng/utils';
|
|
10
|
+
|
|
11
|
+
const EgFormToggleGroupConfigToken = new InjectionToken('EgFormToggleGroupConfig');
|
|
12
|
+
function provideEgFormToggleGroupConfig(config) {
|
|
13
|
+
return { provide: EgFormToggleGroupConfigToken, useValue: { ...config } };
|
|
14
|
+
}
|
|
15
|
+
function injectEgFormToggleGroupConfig() {
|
|
16
|
+
return inject(EgFormToggleGroupConfigToken, { optional: true }) ?? {};
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
class EgFormToggleGroup {
|
|
20
|
+
formGroupDirective = inject(FormGroupDirective);
|
|
21
|
+
_errorMessages = injectEgFormErrorMessages();
|
|
22
|
+
generatedId = inject(HlmFormIdGenerator).generate('eg-form-toggle-group');
|
|
23
|
+
_config = injectEgFormToggleGroupConfig();
|
|
24
|
+
label = input(undefined, /* @ts-ignore */
|
|
25
|
+
...(ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []));
|
|
26
|
+
controlId = input(undefined, /* @ts-ignore */
|
|
27
|
+
...(ngDevMode ? [{ debugName: "controlId" }] : /* istanbul ignore next */ []));
|
|
28
|
+
controlName = input('', /* @ts-ignore */
|
|
29
|
+
...(ngDevMode ? [{ debugName: "controlName" }] : /* istanbul ignore next */ []));
|
|
30
|
+
error = input(undefined, /* @ts-ignore */
|
|
31
|
+
...(ngDevMode ? [{ debugName: "error" }] : /* istanbul ignore next */ []));
|
|
32
|
+
/**
|
|
33
|
+
* Auto-resolve the displayed message from the control's `ValidationErrors`
|
|
34
|
+
* when `error()` is unset. Explicit `error()` always wins. Set to `false`
|
|
35
|
+
* for manual-only messages.
|
|
36
|
+
*/
|
|
37
|
+
autoError = input(true, /* @ts-ignore */
|
|
38
|
+
...(ngDevMode ? [{ debugName: "autoError" }] : /* istanbul ignore next */ []));
|
|
39
|
+
hint = input(undefined, /* @ts-ignore */
|
|
40
|
+
...(ngDevMode ? [{ debugName: "hint" }] : /* istanbul ignore next */ []));
|
|
41
|
+
id = input(undefined, /* @ts-ignore */
|
|
42
|
+
...(ngDevMode ? [{ debugName: "id" }] : /* istanbul ignore next */ []));
|
|
43
|
+
type = input('single', /* @ts-ignore */
|
|
44
|
+
...(ngDevMode ? [{ debugName: "type" }] : /* istanbul ignore next */ []));
|
|
45
|
+
disabled = input(false, /* @ts-ignore */
|
|
46
|
+
...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
|
|
47
|
+
required = input(false, /* @ts-ignore */
|
|
48
|
+
...(ngDevMode ? [{ debugName: "required" }] : /* istanbul ignore next */ []));
|
|
49
|
+
variant = input('default', /* @ts-ignore */
|
|
50
|
+
...(ngDevMode ? [{ debugName: "variant" }] : /* istanbul ignore next */ []));
|
|
51
|
+
size = input('default', /* @ts-ignore */
|
|
52
|
+
...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
|
|
53
|
+
options = input([], /* @ts-ignore */
|
|
54
|
+
...(ngDevMode ? [{ debugName: "options" }] : /* istanbul ignore next */ []));
|
|
55
|
+
effectiveId = computed(() => this.controlId() || this.id() || this.generatedId, /* @ts-ignore */
|
|
56
|
+
...(ngDevMode ? [{ debugName: "effectiveId" }] : /* istanbul ignore next */ []));
|
|
57
|
+
errorId = computed(() => `${this.effectiveId()}-error`, /* @ts-ignore */
|
|
58
|
+
...(ngDevMode ? [{ debugName: "errorId" }] : /* istanbul ignore next */ []));
|
|
59
|
+
hintId = computed(() => `${this.effectiveId()}-hint`, /* @ts-ignore */
|
|
60
|
+
...(ngDevMode ? [{ debugName: "hintId" }] : /* istanbul ignore next */ []));
|
|
61
|
+
/**
|
|
62
|
+
* Displayed message: explicit `error()` wins; otherwise (when `autoError()`)
|
|
63
|
+
* auto-resolved from the control's `ValidationErrors`. Plain method (not a
|
|
64
|
+
* computed): `ValidationErrors` is not a signal, so the control must be read
|
|
65
|
+
* fresh on every change-detection pass.
|
|
66
|
+
*/
|
|
67
|
+
resolvedError() {
|
|
68
|
+
const explicit = this.error();
|
|
69
|
+
if (explicit)
|
|
70
|
+
return explicit;
|
|
71
|
+
if (!this.autoError())
|
|
72
|
+
return undefined;
|
|
73
|
+
const control = this.formGroupDirective.form.get(this.controlName());
|
|
74
|
+
return resolveEgFormError(control?.errors ?? null, this.label(), this._errorMessages);
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Whether the error is surfaced: message present + control invalid +
|
|
78
|
+
* touched/dirty/submitted. Gates the visual `<hlm-error>` (and
|
|
79
|
+
* `describedBy()`, where present) so sighted and screen-reader output agree.
|
|
80
|
+
*/
|
|
81
|
+
showError() {
|
|
82
|
+
const control = this.formGroupDirective.form.get(this.controlName());
|
|
83
|
+
return (!!this.resolvedError() &&
|
|
84
|
+
!!control?.invalid &&
|
|
85
|
+
(control.dirty || control.touched || this.formGroupDirective.submitted));
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Combined lock for the brain `linkedSignal`-based disabled state: the raw
|
|
89
|
+
* input write always carries the resolved value, so a same-pass
|
|
90
|
+
* wrapper-toggle + `control.disable()` cannot clobber CVA state.
|
|
91
|
+
*/
|
|
92
|
+
effectiveDisabled() {
|
|
93
|
+
return this.disabled() || !!this.formGroupDirective.form.get(this.controlName())?.disabled;
|
|
94
|
+
}
|
|
95
|
+
describedBy() {
|
|
96
|
+
return this.showError() ? this.errorId() : this.hint() ? this.hintId() : null;
|
|
97
|
+
}
|
|
98
|
+
// Styling
|
|
99
|
+
userClass = input('', { ...(ngDevMode ? { debugName: "userClass" } : /* istanbul ignore next */ {}), alias: 'class' });
|
|
100
|
+
labelClass = input('', /* @ts-ignore */
|
|
101
|
+
...(ngDevMode ? [{ debugName: "labelClass" }] : /* istanbul ignore next */ []));
|
|
102
|
+
groupClass = input('', /* @ts-ignore */
|
|
103
|
+
...(ngDevMode ? [{ debugName: "groupClass" }] : /* istanbul ignore next */ []));
|
|
104
|
+
errorClass = input('', /* @ts-ignore */
|
|
105
|
+
...(ngDevMode ? [{ debugName: "errorClass" }] : /* istanbul ignore next */ []));
|
|
106
|
+
hintClass = input('', /* @ts-ignore */
|
|
107
|
+
...(ngDevMode ? [{ debugName: "hintClass" }] : /* istanbul ignore next */ []));
|
|
108
|
+
// Computed classes (library base < global config < per-instance)
|
|
109
|
+
$userClass = computed(() => hlm("w-full", this.userClass()), /* @ts-ignore */
|
|
110
|
+
...(ngDevMode ? [{ debugName: "$userClass" }] : /* istanbul ignore next */ []));
|
|
111
|
+
$labelClass = computed(() => hlm("mb-1", this._config.labelClass, this.labelClass()), /* @ts-ignore */
|
|
112
|
+
...(ngDevMode ? [{ debugName: "$labelClass" }] : /* istanbul ignore next */ []));
|
|
113
|
+
$groupClass = computed(() => hlm(this._config.groupClass, this.groupClass()), /* @ts-ignore */
|
|
114
|
+
...(ngDevMode ? [{ debugName: "$groupClass" }] : /* istanbul ignore next */ []));
|
|
115
|
+
$errorClass = computed(() => hlm("mt-0", this._config.errorClass, this.errorClass()), /* @ts-ignore */
|
|
116
|
+
...(ngDevMode ? [{ debugName: "$errorClass" }] : /* istanbul ignore next */ []));
|
|
117
|
+
$hintClass = computed(() => hlm("mt-0", this._config.hintClass, this.hintClass()), /* @ts-ignore */
|
|
118
|
+
...(ngDevMode ? [{ debugName: "$hintClass" }] : /* istanbul ignore next */ []));
|
|
119
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: EgFormToggleGroup, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
120
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.3", type: EgFormToggleGroup, isStandalone: true, selector: "eg-form-toggle-group", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, controlId: { classPropertyName: "controlId", publicName: "controlId", isSignal: true, isRequired: false, transformFunction: null }, controlName: { classPropertyName: "controlName", publicName: "controlName", isSignal: true, isRequired: false, transformFunction: null }, error: { classPropertyName: "error", publicName: "error", isSignal: true, isRequired: false, transformFunction: null }, autoError: { classPropertyName: "autoError", publicName: "autoError", isSignal: true, isRequired: false, transformFunction: null }, hint: { classPropertyName: "hint", publicName: "hint", isSignal: true, isRequired: false, transformFunction: null }, id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null }, userClass: { classPropertyName: "userClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null }, labelClass: { classPropertyName: "labelClass", publicName: "labelClass", isSignal: true, isRequired: false, transformFunction: null }, groupClass: { classPropertyName: "groupClass", publicName: "groupClass", isSignal: true, isRequired: false, transformFunction: null }, errorClass: { classPropertyName: "errorClass", publicName: "errorClass", isSignal: true, isRequired: false, transformFunction: null }, hintClass: { classPropertyName: "hintClass", publicName: "hintClass", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "$userClass()" } }, providers: [{ provide: ControlContainer, useExisting: FormGroupDirective }], ngImport: i0, template: "\n @let lbl = label();\n @let cnm = controlName();\n @let hnt = hint();\n @let rqrd = required();\n\n <eg-form-field>\n @if (lbl) {\n <span hlmLabel [class]=\"$labelClass()\"\n >{{ lbl }}\n @if (rqrd) {\n <span class=\"text-red-500\">*</span>\n }\n </span>\n }\n\n <hlm-toggle-group\n [formControlName]=\"cnm\"\n [type]=\"type()\"\n [disabled]=\"effectiveDisabled()\"\n [variant]=\"variant()\"\n [size]=\"size()\"\n [class]=\"$groupClass()\"\n >\n @for (option of options(); track option.value) {\n <button\n hlmToggleGroupItem\n type=\"button\"\n [value]=\"option.value\"\n [disabled]=\"option.disabled ?? false\"\n [attr.aria-describedby]=\"describedBy()\"\n >\n {{ option.label }}\n </button>\n }\n </hlm-toggle-group>\n\n @if (showError()) {\n <hlm-error [id]=\"errorId()\" [class]=\"$errorClass()\">\n {{ resolvedError() }}\n </hlm-error>\n }\n\n @if (hnt) {\n <hlm-hint [id]=\"hintId()\" [class]=\"$hintClass()\">\n {{ hnt }}\n </hlm-hint>\n }\n </eg-form-field>\n ", isInline: true, dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: HlmError, selector: "hlm-error", inputs: ["class"] }, { kind: "directive", type: HlmHint, selector: "hlm-hint", inputs: ["class"] }, { kind: "directive", type: HlmLabel, selector: "[hlmLabel]", inputs: ["class"] }, { kind: "directive", type: HlmToggleGroup, selector: "[hlmToggleGroup],hlm-toggle-group", inputs: ["variant", "size", "spacing", "orientation"] }, { kind: "directive", type: HlmToggleGroupItem, selector: "button[hlmToggleGroupItem]", inputs: ["variant", "size"] }, { kind: "component", type: EgFormField, selector: "eg-form-field", inputs: ["class"] }] });
|
|
121
|
+
}
|
|
122
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: EgFormToggleGroup, decorators: [{
|
|
123
|
+
type: Component,
|
|
124
|
+
args: [{
|
|
125
|
+
selector: 'eg-form-toggle-group',
|
|
126
|
+
standalone: true,
|
|
127
|
+
host: {
|
|
128
|
+
'[class]': '$userClass()',
|
|
129
|
+
},
|
|
130
|
+
imports: [ReactiveFormsModule, HlmError, HlmHint, HlmLabel, HlmToggleGroup, HlmToggleGroupItem, EgFormField],
|
|
131
|
+
providers: [{ provide: ControlContainer, useExisting: FormGroupDirective }],
|
|
132
|
+
template: "\n @let lbl = label();\n @let cnm = controlName();\n @let hnt = hint();\n @let rqrd = required();\n\n <eg-form-field>\n @if (lbl) {\n <span hlmLabel [class]=\"$labelClass()\"\n >{{ lbl }}\n @if (rqrd) {\n <span class=\"text-red-500\">*</span>\n }\n </span>\n }\n\n <hlm-toggle-group\n [formControlName]=\"cnm\"\n [type]=\"type()\"\n [disabled]=\"effectiveDisabled()\"\n [variant]=\"variant()\"\n [size]=\"size()\"\n [class]=\"$groupClass()\"\n >\n @for (option of options(); track option.value) {\n <button\n hlmToggleGroupItem\n type=\"button\"\n [value]=\"option.value\"\n [disabled]=\"option.disabled ?? false\"\n [attr.aria-describedby]=\"describedBy()\"\n >\n {{ option.label }}\n </button>\n }\n </hlm-toggle-group>\n\n @if (showError()) {\n <hlm-error [id]=\"errorId()\" [class]=\"$errorClass()\">\n {{ resolvedError() }}\n </hlm-error>\n }\n\n @if (hnt) {\n <hlm-hint [id]=\"hintId()\" [class]=\"$hintClass()\">\n {{ hnt }}\n </hlm-hint>\n }\n </eg-form-field>\n ",
|
|
133
|
+
}]
|
|
134
|
+
}], propDecorators: { label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], controlId: [{ type: i0.Input, args: [{ isSignal: true, alias: "controlId", required: false }] }], controlName: [{ type: i0.Input, args: [{ isSignal: true, alias: "controlName", required: false }] }], error: [{ type: i0.Input, args: [{ isSignal: true, alias: "error", required: false }] }], autoError: [{ type: i0.Input, args: [{ isSignal: true, alias: "autoError", required: false }] }], hint: [{ type: i0.Input, args: [{ isSignal: true, alias: "hint", required: false }] }], id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: false }] }], type: [{ type: i0.Input, args: [{ isSignal: true, alias: "type", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], required: [{ type: i0.Input, args: [{ isSignal: true, alias: "required", required: false }] }], variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], options: [{ type: i0.Input, args: [{ isSignal: true, alias: "options", required: false }] }], userClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }], labelClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "labelClass", required: false }] }], groupClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "groupClass", required: false }] }], errorClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "errorClass", required: false }] }], hintClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "hintClass", required: false }] }] } });
|
|
135
|
+
|
|
136
|
+
/*
|
|
137
|
+
* Public API Surface of form-toggle-group
|
|
138
|
+
*/
|
|
139
|
+
|
|
140
|
+
/**
|
|
141
|
+
* Generated bundle index. Do not edit.
|
|
142
|
+
*/
|
|
143
|
+
|
|
144
|
+
export { EgFormToggleGroup, injectEgFormToggleGroupConfig, provideEgFormToggleGroupConfig };
|
|
145
|
+
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "form-toggle-group",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"peerDependencies": {
|
|
5
|
+
"@angular/common": "^20.3.0 || ^22.0.0",
|
|
6
|
+
"@angular/core": "^20.3.0 || ^22.0.0"
|
|
7
|
+
},
|
|
8
|
+
"dependencies": {
|
|
9
|
+
"tslib": "^2.3.0"
|
|
10
|
+
},
|
|
11
|
+
"sideEffects": false,
|
|
12
|
+
"module": "fesm2022/form-toggle-group.mjs",
|
|
13
|
+
"typings": "types/form-toggle-group.d.ts",
|
|
14
|
+
"exports": {
|
|
15
|
+
"./package.json": {
|
|
16
|
+
"default": "./package.json"
|
|
17
|
+
},
|
|
18
|
+
".": {
|
|
19
|
+
"types": "./types/form-toggle-group.d.ts",
|
|
20
|
+
"default": "./fesm2022/form-toggle-group.mjs"
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
"type": "module"
|
|
24
|
+
}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import * as _angular_core from '@angular/core';
|
|
2
|
+
import { ValueProvider } from '@angular/core';
|
|
3
|
+
import { ClassValue } from 'clsx';
|
|
4
|
+
|
|
5
|
+
interface ToggleGroupOption {
|
|
6
|
+
value: string;
|
|
7
|
+
label: string;
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
}
|
|
10
|
+
declare class EgFormToggleGroup {
|
|
11
|
+
private readonly formGroupDirective;
|
|
12
|
+
private readonly _errorMessages;
|
|
13
|
+
private readonly generatedId;
|
|
14
|
+
private readonly _config;
|
|
15
|
+
label: _angular_core.InputSignal<string | undefined>;
|
|
16
|
+
controlId: _angular_core.InputSignal<string | undefined>;
|
|
17
|
+
controlName: _angular_core.InputSignal<string>;
|
|
18
|
+
error: _angular_core.InputSignal<string | undefined>;
|
|
19
|
+
/**
|
|
20
|
+
* Auto-resolve the displayed message from the control's `ValidationErrors`
|
|
21
|
+
* when `error()` is unset. Explicit `error()` always wins. Set to `false`
|
|
22
|
+
* for manual-only messages.
|
|
23
|
+
*/
|
|
24
|
+
autoError: _angular_core.InputSignal<boolean>;
|
|
25
|
+
hint: _angular_core.InputSignal<string | undefined>;
|
|
26
|
+
id: _angular_core.InputSignal<string | undefined>;
|
|
27
|
+
type: _angular_core.InputSignal<"single" | "multiple">;
|
|
28
|
+
disabled: _angular_core.InputSignal<boolean>;
|
|
29
|
+
required: _angular_core.InputSignal<boolean>;
|
|
30
|
+
variant: _angular_core.InputSignal<"default" | "outline" | null | undefined>;
|
|
31
|
+
size: _angular_core.InputSignal<"default" | "sm" | "lg" | null | undefined>;
|
|
32
|
+
options: _angular_core.InputSignal<ToggleGroupOption[]>;
|
|
33
|
+
readonly effectiveId: _angular_core.Signal<string>;
|
|
34
|
+
readonly errorId: _angular_core.Signal<string>;
|
|
35
|
+
readonly hintId: _angular_core.Signal<string>;
|
|
36
|
+
/**
|
|
37
|
+
* Displayed message: explicit `error()` wins; otherwise (when `autoError()`)
|
|
38
|
+
* auto-resolved from the control's `ValidationErrors`. Plain method (not a
|
|
39
|
+
* computed): `ValidationErrors` is not a signal, so the control must be read
|
|
40
|
+
* fresh on every change-detection pass.
|
|
41
|
+
*/
|
|
42
|
+
protected resolvedError(): string | undefined;
|
|
43
|
+
/**
|
|
44
|
+
* Whether the error is surfaced: message present + control invalid +
|
|
45
|
+
* touched/dirty/submitted. Gates the visual `<hlm-error>` (and
|
|
46
|
+
* `describedBy()`, where present) so sighted and screen-reader output agree.
|
|
47
|
+
*/
|
|
48
|
+
protected showError(): boolean;
|
|
49
|
+
/**
|
|
50
|
+
* Combined lock for the brain `linkedSignal`-based disabled state: the raw
|
|
51
|
+
* input write always carries the resolved value, so a same-pass
|
|
52
|
+
* wrapper-toggle + `control.disable()` cannot clobber CVA state.
|
|
53
|
+
*/
|
|
54
|
+
effectiveDisabled(): boolean;
|
|
55
|
+
describedBy(): string | null;
|
|
56
|
+
userClass: _angular_core.InputSignal<ClassValue>;
|
|
57
|
+
labelClass: _angular_core.InputSignal<string>;
|
|
58
|
+
groupClass: _angular_core.InputSignal<string>;
|
|
59
|
+
errorClass: _angular_core.InputSignal<string>;
|
|
60
|
+
hintClass: _angular_core.InputSignal<string>;
|
|
61
|
+
$userClass: _angular_core.Signal<string>;
|
|
62
|
+
$labelClass: _angular_core.Signal<string>;
|
|
63
|
+
$groupClass: _angular_core.Signal<string>;
|
|
64
|
+
$errorClass: _angular_core.Signal<string>;
|
|
65
|
+
$hintClass: _angular_core.Signal<string>;
|
|
66
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<EgFormToggleGroup, never>;
|
|
67
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<EgFormToggleGroup, "eg-form-toggle-group", never, { "label": { "alias": "label"; "required": false; "isSignal": true; }; "controlId": { "alias": "controlId"; "required": false; "isSignal": true; }; "controlName": { "alias": "controlName"; "required": false; "isSignal": true; }; "error": { "alias": "error"; "required": false; "isSignal": true; }; "autoError": { "alias": "autoError"; "required": false; "isSignal": true; }; "hint": { "alias": "hint"; "required": false; "isSignal": true; }; "id": { "alias": "id"; "required": false; "isSignal": true; }; "type": { "alias": "type"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "required": { "alias": "required"; "required": false; "isSignal": true; }; "variant": { "alias": "variant"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "options": { "alias": "options"; "required": false; "isSignal": true; }; "userClass": { "alias": "class"; "required": false; "isSignal": true; }; "labelClass": { "alias": "labelClass"; "required": false; "isSignal": true; }; "groupClass": { "alias": "groupClass"; "required": false; "isSignal": true; }; "errorClass": { "alias": "errorClass"; "required": false; "isSignal": true; }; "hintClass": { "alias": "hintClass"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
interface EgFormToggleGroupConfig {
|
|
71
|
+
/**
|
|
72
|
+
* Global class defaults for `eg-form-toggle-group` styling slots.
|
|
73
|
+
* Each is merged under the matching per-instance `*Class` input
|
|
74
|
+
* (library base < global config < per-instance).
|
|
75
|
+
*/
|
|
76
|
+
labelClass?: string;
|
|
77
|
+
groupClass?: string;
|
|
78
|
+
errorClass?: string;
|
|
79
|
+
hintClass?: string;
|
|
80
|
+
}
|
|
81
|
+
declare function provideEgFormToggleGroupConfig(config: Partial<EgFormToggleGroupConfig>): ValueProvider;
|
|
82
|
+
declare function injectEgFormToggleGroupConfig(): EgFormToggleGroupConfig;
|
|
83
|
+
|
|
84
|
+
export { EgFormToggleGroup, injectEgFormToggleGroupConfig, provideEgFormToggleGroupConfig };
|
|
85
|
+
export type { EgFormToggleGroupConfig };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { Directive, input, NgModule } from '@angular/core';
|
|
3
|
-
import { classes } from '@egose/shadcn-theme-ng/utils';
|
|
2
|
+
import { Directive, input, inject, effect, NgModule } from '@angular/core';
|
|
3
|
+
import { classes, hlm } from '@egose/shadcn-theme-ng/utils';
|
|
4
4
|
import { cva } from 'class-variance-authority';
|
|
5
5
|
import * as i1 from '@egose/shadcn-theme-ng/button';
|
|
6
|
-
import {
|
|
6
|
+
import { HlmBtn, provideBrnButtonConfig } from '@egose/shadcn-theme-ng/button';
|
|
7
7
|
import * as i1$1 from '@egose/shadcn-theme-ng/input';
|
|
8
8
|
import { HlmInput } from '@egose/shadcn-theme-ng/input';
|
|
9
9
|
import * as i1$2 from '@egose/shadcn-theme-ng/textarea';
|
|
@@ -64,10 +64,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImpor
|
|
|
64
64
|
const inputGroupAddonVariants = cva("gap-2 text-sm flex items-center shadow-none", {
|
|
65
65
|
variants: {
|
|
66
66
|
size: {
|
|
67
|
-
xs: "h-6 gap-1 rounded-[calc(var(--radius)-5px)] px-1.5 [&>ng-icon:not([class*='text-'])]:text-[length:--spacing(3.5)]",
|
|
67
|
+
xs: "h-6 gap-1 rounded-[calc(var(--radius)-5px)] px-1.5 [&>ng-icon:not([class*='text-'])]:text-[length:--spacing(3.5)] [&_svg:not([class*='size-'])]:size-3.5",
|
|
68
68
|
sm: '',
|
|
69
|
-
'icon-xs': "size-6 rounded-[calc(var(--radius)-5px)] p-0 has-[>ng-icon]:p-0",
|
|
70
|
-
'icon-sm': "size-8 p-0 has-[>ng-icon]:p-0",
|
|
69
|
+
'icon-xs': "size-6 rounded-[calc(var(--radius)-5px)] p-0 has-[>ng-icon]:p-0 [&>ng-icon:not([class*='text-'])]:text-[length:--spacing(3)] [&_svg:not([class*='size-'])]:size-3",
|
|
70
|
+
'icon-sm': "size-8 p-0 has-[>ng-icon]:p-0 [&>ng-icon:not([class*='text-'])]:text-[length:--spacing(4)] [&_svg:not([class*='size-'])]:size-4",
|
|
71
71
|
},
|
|
72
72
|
},
|
|
73
73
|
defaultVariants: {
|
|
@@ -75,15 +75,25 @@ const inputGroupAddonVariants = cva("gap-2 text-sm flex items-center shadow-none
|
|
|
75
75
|
},
|
|
76
76
|
});
|
|
77
77
|
class HlmInputGroupButton {
|
|
78
|
+
_btn = inject(HlmBtn);
|
|
78
79
|
size = input('xs', /* @ts-ignore */
|
|
79
80
|
...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
|
|
80
81
|
type = input('button', /* @ts-ignore */
|
|
81
82
|
...(ngDevMode ? [{ debugName: "type" }] : /* istanbul ignore next */ []));
|
|
83
|
+
userClass = input('', { ...(ngDevMode ? { debugName: "userClass" } : /* istanbul ignore next */ {}), alias: 'class' });
|
|
82
84
|
constructor() {
|
|
83
|
-
classes
|
|
85
|
+
// HlmBtn renders its classes through a `[class]` host binding, so layering
|
|
86
|
+
// another `classes()` call here would lose: the binding output is treated
|
|
87
|
+
// as base classes and merged last, letting HlmBtn's default `h-9 px-4 py-2`
|
|
88
|
+
// beat the input-group sizing and push the button onto the outer
|
|
89
|
+
// container's borders. Route the variant through `setClass()` instead so it
|
|
90
|
+
// wins over the button defaults while explicit `class` values still win.
|
|
91
|
+
effect(() => {
|
|
92
|
+
this._btn.setClass(hlm(inputGroupAddonVariants({ size: this.size() }), this.userClass()));
|
|
93
|
+
});
|
|
84
94
|
}
|
|
85
95
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: HlmInputGroupButton, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
86
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.1.3", type: HlmInputGroupButton, isStandalone: true, selector: "button[hlmInputGroupButton]", inputs: { size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "attr.data-size": "size()", "type": "type()" } }, providers: [
|
|
96
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.1.3", type: HlmInputGroupButton, isStandalone: true, selector: "button[hlmInputGroupButton]", inputs: { size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null }, userClass: { classPropertyName: "userClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "attr.data-size": "size()", "type": "type()" } }, providers: [
|
|
87
97
|
provideBrnButtonConfig({
|
|
88
98
|
variant: 'ghost',
|
|
89
99
|
}),
|
|
@@ -109,7 +119,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImpor
|
|
|
109
119
|
'[type]': 'type()',
|
|
110
120
|
},
|
|
111
121
|
}]
|
|
112
|
-
}], ctorParameters: () => [], propDecorators: { size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], type: [{ type: i0.Input, args: [{ isSignal: true, alias: "type", required: false }] }] } });
|
|
122
|
+
}], ctorParameters: () => [], propDecorators: { size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], type: [{ type: i0.Input, args: [{ isSignal: true, alias: "type", required: false }] }], userClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } });
|
|
113
123
|
|
|
114
124
|
class HlmInputGroupInput {
|
|
115
125
|
constructor() {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
+
import { ClassValue } from 'clsx';
|
|
2
3
|
import * as i1 from '@egose/shadcn-theme-ng/button';
|
|
3
4
|
import * as i1$1 from '@egose/shadcn-theme-ng/input';
|
|
4
5
|
import * as i1$2 from '@egose/shadcn-theme-ng/textarea';
|
|
@@ -17,11 +18,13 @@ declare class HlmInputGroupAddon {
|
|
|
17
18
|
}
|
|
18
19
|
|
|
19
20
|
declare class HlmInputGroupButton {
|
|
21
|
+
private readonly _btn;
|
|
20
22
|
readonly size: i0.InputSignal<"xs" | "sm" | "icon-xs" | "icon-sm" | null | undefined>;
|
|
21
23
|
readonly type: i0.InputSignal<"button" | "submit" | "reset">;
|
|
24
|
+
readonly userClass: i0.InputSignal<ClassValue>;
|
|
22
25
|
constructor();
|
|
23
26
|
static ɵfac: i0.ɵɵFactoryDeclaration<HlmInputGroupButton, never>;
|
|
24
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<HlmInputGroupButton, "button[hlmInputGroupButton]", never, { "size": { "alias": "size"; "required": false; "isSignal": true; }; "type": { "alias": "type"; "required": false; "isSignal": true; }; }, {}, never, never, true, [{ directive: typeof i1.HlmBtn; inputs: { "variant": "variant"; }; outputs: {}; }]>;
|
|
27
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<HlmInputGroupButton, "button[hlmInputGroupButton]", never, { "size": { "alias": "size"; "required": false; "isSignal": true; }; "type": { "alias": "type"; "required": false; "isSignal": true; }; "userClass": { "alias": "class"; "required": false; "isSignal": true; }; }, {}, never, never, true, [{ directive: typeof i1.HlmBtn; inputs: { "variant": "variant"; }; outputs: {}; }]>;
|
|
25
28
|
}
|
|
26
29
|
|
|
27
30
|
declare class HlmInputGroupInput {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { forwardRef, inject, input, computed, booleanAttribute, linkedSignal, output, ChangeDetectionStrategy, Component, Directive, NgModule } from '@angular/core';
|
|
2
|
+
import { forwardRef, inject, input, computed, booleanAttribute, signal, linkedSignal, output, ChangeDetectionStrategy, Component, Directive, NgModule } from '@angular/core';
|
|
3
3
|
import { NG_VALUE_ACCESSOR } from '@angular/forms';
|
|
4
4
|
import { NgIcon, provideIcons } from '@ng-icons/core';
|
|
5
5
|
import { lucideChevronDown } from '@ng-icons/lucide';
|
|
@@ -17,9 +17,15 @@ class HlmNativeSelect {
|
|
|
17
17
|
static _id = 0;
|
|
18
18
|
selectId = input(`hlm-native-select-${HlmNativeSelect._id++}`, /* @ts-ignore */
|
|
19
19
|
...(ngDevMode ? [{ debugName: "selectId" }] : /* istanbul ignore next */ []));
|
|
20
|
+
/** Native `name` attribute forwarded to the inner `<select>`. */
|
|
21
|
+
name = input(undefined, /* @ts-ignore */
|
|
22
|
+
...(ngDevMode ? [{ debugName: "name" }] : /* istanbul ignore next */ []));
|
|
23
|
+
/** ID of the element describing the select (error/hint) for assistive tech. */
|
|
24
|
+
ariaDescribedby = input(null, /* @ts-ignore */
|
|
25
|
+
...(ngDevMode ? [{ debugName: "ariaDescribedby" }] : /* istanbul ignore next */ []));
|
|
20
26
|
selectClass = input('', /* @ts-ignore */
|
|
21
27
|
...(ngDevMode ? [{ debugName: "selectClass" }] : /* istanbul ignore next */ []));
|
|
22
|
-
_computedSelectClass = computed(() => hlm("border-input placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 dark:hover:bg-input/50 focus-visible:border-ring focus-visible:ring-ring/50 data-[matches-spartan-invalid=true]:ring-destructive/20 dark:data-[matches-spartan-invalid=true]:ring-destructive/40 data-[matches-spartan-invalid=true]:border-destructive dark:data-[matches-spartan-invalid=true]:border-destructive/50 h-9 w-full min-w-0 appearance-none rounded-md border bg-transparent py-1 ps-2.5 pe-8 text-sm shadow-xs transition-[color,box-shadow] select-none focus-visible:ring-3 data-[matches-spartan-invalid=true]:ring-3 data-[size=sm]:h-8 outline-none disabled:pointer-events-none disabled:cursor-not-allowed", this.selectClass()), /* @ts-ignore */
|
|
28
|
+
_computedSelectClass = computed(() => hlm("border-input placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 dark:hover:bg-input/50 focus-visible:border-ring focus-visible:ring-ring/50 data-[matches-spartan-invalid=true]:ring-destructive/20 dark:data-[matches-spartan-invalid=true]:ring-destructive/40 data-[matches-spartan-invalid=true]:border-destructive dark:data-[matches-spartan-invalid=true]:border-destructive/50 h-9 w-full min-w-0 appearance-none rounded-md border bg-transparent py-1 ps-2.5 pe-8 text-sm text-foreground shadow-xs transition-[color,box-shadow] select-none focus-visible:ring-3 data-[matches-spartan-invalid=true]:ring-3 data-[size=sm]:h-8 outline-none disabled:pointer-events-none disabled:cursor-not-allowed [color-scheme:light] dark:[color-scheme:dark]", this.selectClass()), /* @ts-ignore */
|
|
23
29
|
...(ngDevMode ? [{ debugName: "_computedSelectClass" }] : /* istanbul ignore next */ []));
|
|
24
30
|
selectIconClass = input('', /* @ts-ignore */
|
|
25
31
|
...(ngDevMode ? [{ debugName: "selectIconClass" }] : /* istanbul ignore next */ []));
|
|
@@ -28,7 +34,9 @@ class HlmNativeSelect {
|
|
|
28
34
|
size = input('default', /* @ts-ignore */
|
|
29
35
|
...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
|
|
30
36
|
disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
31
|
-
|
|
37
|
+
_formDisabled = signal(false, /* @ts-ignore */
|
|
38
|
+
...(ngDevMode ? [{ debugName: "_formDisabled" }] : /* istanbul ignore next */ []));
|
|
39
|
+
_disabled = computed(() => this.disabled() || this._formDisabled(), /* @ts-ignore */
|
|
32
40
|
...(ngDevMode ? [{ debugName: "_disabled" }] : /* istanbul ignore next */ []));
|
|
33
41
|
/** Whether to force the input into an invalid state. */
|
|
34
42
|
forceInvalid = input(false, { ...(ngDevMode ? { debugName: "forceInvalid" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
@@ -73,10 +81,10 @@ class HlmNativeSelect {
|
|
|
73
81
|
this._onTouched = fn;
|
|
74
82
|
}
|
|
75
83
|
setDisabledState(isDisabled) {
|
|
76
|
-
this.
|
|
84
|
+
this._formDisabled.set(isDisabled);
|
|
77
85
|
}
|
|
78
86
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: HlmNativeSelect, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
79
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.1.3", type: HlmNativeSelect, isStandalone: true, selector: "hlm-native-select", inputs: { selectId: { classPropertyName: "selectId", publicName: "selectId", isSignal: true, isRequired: false, transformFunction: null }, selectClass: { classPropertyName: "selectClass", publicName: "selectClass", isSignal: true, isRequired: false, transformFunction: null }, selectIconClass: { classPropertyName: "selectIconClass", publicName: "selectIconClass", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, forceInvalid: { classPropertyName: "forceInvalid", publicName: "forceInvalid", isSignal: true, isRequired: false, transformFunction: null }, ariaInvalidOverride: { classPropertyName: "ariaInvalidOverride", publicName: "aria-invalid", isSignal: true, isRequired: false, transformFunction: null }, valueInput: { classPropertyName: "valueInput", publicName: "value", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { valueChange: "valueChange" }, host: { attributes: { "data-slot": "native-select-wrapper" }, properties: { "attr.data-size": "size()" } }, providers: [
|
|
87
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.1.3", type: HlmNativeSelect, isStandalone: true, selector: "hlm-native-select", inputs: { selectId: { classPropertyName: "selectId", publicName: "selectId", isSignal: true, isRequired: false, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null }, ariaDescribedby: { classPropertyName: "ariaDescribedby", publicName: "ariaDescribedby", isSignal: true, isRequired: false, transformFunction: null }, selectClass: { classPropertyName: "selectClass", publicName: "selectClass", isSignal: true, isRequired: false, transformFunction: null }, selectIconClass: { classPropertyName: "selectIconClass", publicName: "selectIconClass", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, forceInvalid: { classPropertyName: "forceInvalid", publicName: "forceInvalid", isSignal: true, isRequired: false, transformFunction: null }, ariaInvalidOverride: { classPropertyName: "ariaInvalidOverride", publicName: "aria-invalid", isSignal: true, isRequired: false, transformFunction: null }, valueInput: { classPropertyName: "valueInput", publicName: "value", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { valueChange: "valueChange" }, host: { attributes: { "data-slot": "native-select-wrapper" }, properties: { "attr.data-size": "size()" } }, providers: [
|
|
80
88
|
HLM_NATIVE_SELECT_VALUE_ACCESSOR,
|
|
81
89
|
provideIcons({ lucideChevronDown }),
|
|
82
90
|
provideBrnLabelable(HlmNativeSelect),
|
|
@@ -84,6 +92,8 @@ class HlmNativeSelect {
|
|
|
84
92
|
<select
|
|
85
93
|
data-slot="native-select"
|
|
86
94
|
[id]="selectId()"
|
|
95
|
+
[attr.name]="name()"
|
|
96
|
+
[attr.aria-describedby]="ariaDescribedby()"
|
|
87
97
|
[class]="_computedSelectClass()"
|
|
88
98
|
[attr.data-size]="size()"
|
|
89
99
|
[attr.aria-invalid]="_ariaInvalid() ? 'true' : null"
|
|
@@ -127,6 +137,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImpor
|
|
|
127
137
|
<select
|
|
128
138
|
data-slot="native-select"
|
|
129
139
|
[id]="selectId()"
|
|
140
|
+
[attr.name]="name()"
|
|
141
|
+
[attr.aria-describedby]="ariaDescribedby()"
|
|
130
142
|
[class]="_computedSelectClass()"
|
|
131
143
|
[attr.data-size]="size()"
|
|
132
144
|
[attr.aria-invalid]="_ariaInvalid() ? 'true' : null"
|
|
@@ -150,7 +162,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImpor
|
|
|
150
162
|
/>
|
|
151
163
|
`,
|
|
152
164
|
}]
|
|
153
|
-
}], ctorParameters: () => [], propDecorators: { selectId: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectId", required: false }] }], selectClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectClass", required: false }] }], selectIconClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectIconClass", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], forceInvalid: [{ type: i0.Input, args: [{ isSignal: true, alias: "forceInvalid", required: false }] }], ariaInvalidOverride: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-invalid", required: false }] }], valueInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }], valueChange: [{ type: i0.Output, args: ["valueChange"] }] } });
|
|
165
|
+
}], ctorParameters: () => [], propDecorators: { selectId: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectId", required: false }] }], name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: false }] }], ariaDescribedby: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaDescribedby", required: false }] }], selectClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectClass", required: false }] }], selectIconClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectIconClass", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], forceInvalid: [{ type: i0.Input, args: [{ isSignal: true, alias: "forceInvalid", required: false }] }], ariaInvalidOverride: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-invalid", required: false }] }], valueInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }], valueChange: [{ type: i0.Output, args: ["valueChange"] }] } });
|
|
154
166
|
|
|
155
167
|
class HlmNativeSelectOptGroup {
|
|
156
168
|
constructor() {
|
|
@@ -14,13 +14,18 @@ declare class HlmNativeSelect implements ControlValueAccessor {
|
|
|
14
14
|
private readonly _fieldControl;
|
|
15
15
|
private static _id;
|
|
16
16
|
readonly selectId: _angular_core.InputSignal<string>;
|
|
17
|
+
/** Native `name` attribute forwarded to the inner `<select>`. */
|
|
18
|
+
readonly name: _angular_core.InputSignal<string | undefined>;
|
|
19
|
+
/** ID of the element describing the select (error/hint) for assistive tech. */
|
|
20
|
+
readonly ariaDescribedby: _angular_core.InputSignal<string | null>;
|
|
17
21
|
readonly selectClass: _angular_core.InputSignal<ClassValue>;
|
|
18
22
|
protected readonly _computedSelectClass: _angular_core.Signal<string>;
|
|
19
23
|
readonly selectIconClass: _angular_core.InputSignal<ClassValue>;
|
|
20
24
|
protected readonly _computedSelectIconClass: _angular_core.Signal<string>;
|
|
21
25
|
readonly size: _angular_core.InputSignal<"sm" | "default">;
|
|
22
26
|
readonly disabled: _angular_core.InputSignalWithTransform<boolean, BooleanInput>;
|
|
23
|
-
|
|
27
|
+
private readonly _formDisabled;
|
|
28
|
+
protected readonly _disabled: _angular_core.Signal<boolean>;
|
|
24
29
|
/** Whether to force the input into an invalid state. */
|
|
25
30
|
readonly forceInvalid: _angular_core.InputSignalWithTransform<boolean, BooleanInput>;
|
|
26
31
|
/** Manual override for aria-invalid. When not set, auto-detects from the parent autocomplete error state. */
|
|
@@ -45,7 +50,7 @@ declare class HlmNativeSelect implements ControlValueAccessor {
|
|
|
45
50
|
registerOnTouched(fn: TouchFn): void;
|
|
46
51
|
setDisabledState(isDisabled: boolean): void;
|
|
47
52
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<HlmNativeSelect, never>;
|
|
48
|
-
static ɵcmp: _angular_core.ɵɵComponentDeclaration<HlmNativeSelect, "hlm-native-select", never, { "selectId": { "alias": "selectId"; "required": false; "isSignal": true; }; "selectClass": { "alias": "selectClass"; "required": false; "isSignal": true; }; "selectIconClass": { "alias": "selectIconClass"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "forceInvalid": { "alias": "forceInvalid"; "required": false; "isSignal": true; }; "ariaInvalidOverride": { "alias": "aria-invalid"; "required": false; "isSignal": true; }; "valueInput": { "alias": "value"; "required": false; "isSignal": true; }; }, { "valueChange": "valueChange"; }, never, ["*"], true, [{ directive: typeof i1.BrnFieldControl; inputs: {}; outputs: {}; }]>;
|
|
53
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<HlmNativeSelect, "hlm-native-select", never, { "selectId": { "alias": "selectId"; "required": false; "isSignal": true; }; "name": { "alias": "name"; "required": false; "isSignal": true; }; "ariaDescribedby": { "alias": "ariaDescribedby"; "required": false; "isSignal": true; }; "selectClass": { "alias": "selectClass"; "required": false; "isSignal": true; }; "selectIconClass": { "alias": "selectIconClass"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "forceInvalid": { "alias": "forceInvalid"; "required": false; "isSignal": true; }; "ariaInvalidOverride": { "alias": "aria-invalid"; "required": false; "isSignal": true; }; "valueInput": { "alias": "value"; "required": false; "isSignal": true; }; }, { "valueChange": "valueChange"; }, never, ["*"], true, [{ directive: typeof i1.BrnFieldControl; inputs: {}; outputs: {}; }]>;
|
|
49
54
|
}
|
|
50
55
|
|
|
51
56
|
declare class HlmNativeSelectOptGroup {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@egose/shadcn-theme-ng",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"description": "Angular shadcn UI theme",
|
|
5
5
|
"author": "Junmin Ahn",
|
|
6
6
|
"bundles": [
|
|
@@ -150,14 +150,30 @@
|
|
|
150
150
|
"types": "./field/types/field.d.ts",
|
|
151
151
|
"default": "./field/fesm2022/field.mjs"
|
|
152
152
|
},
|
|
153
|
+
"./form-autocomplete": {
|
|
154
|
+
"types": "./form-autocomplete/types/form-autocomplete.d.ts",
|
|
155
|
+
"default": "./form-autocomplete/fesm2022/form-autocomplete.mjs"
|
|
156
|
+
},
|
|
153
157
|
"./form-checkbox": {
|
|
154
158
|
"types": "./form-checkbox/types/form-checkbox.d.ts",
|
|
155
159
|
"default": "./form-checkbox/fesm2022/form-checkbox.mjs"
|
|
156
160
|
},
|
|
161
|
+
"./form-combobox": {
|
|
162
|
+
"types": "./form-combobox/types/form-combobox.d.ts",
|
|
163
|
+
"default": "./form-combobox/fesm2022/form-combobox.mjs"
|
|
164
|
+
},
|
|
157
165
|
"./form-date-picker": {
|
|
158
166
|
"types": "./form-date-picker/types/form-date-picker.d.ts",
|
|
159
167
|
"default": "./form-date-picker/fesm2022/form-date-picker.mjs"
|
|
160
168
|
},
|
|
169
|
+
"./form-date-picker-multi": {
|
|
170
|
+
"types": "./form-date-picker-multi/types/form-date-picker-multi.d.ts",
|
|
171
|
+
"default": "./form-date-picker-multi/fesm2022/form-date-picker-multi.mjs"
|
|
172
|
+
},
|
|
173
|
+
"./form-date-range-picker": {
|
|
174
|
+
"types": "./form-date-range-picker/types/form-date-range-picker.d.ts",
|
|
175
|
+
"default": "./form-date-range-picker/fesm2022/form-date-range-picker.mjs"
|
|
176
|
+
},
|
|
161
177
|
"./form-field": {
|
|
162
178
|
"types": "./form-field/types/form-field.d.ts",
|
|
163
179
|
"default": "./form-field/fesm2022/form-field.mjs"
|
|
@@ -166,6 +182,26 @@
|
|
|
166
182
|
"types": "./form-field-simple/types/form-field-simple.d.ts",
|
|
167
183
|
"default": "./form-field-simple/fesm2022/form-field-simple.mjs"
|
|
168
184
|
},
|
|
185
|
+
"./form-input-otp": {
|
|
186
|
+
"types": "./form-input-otp/types/form-input-otp.d.ts",
|
|
187
|
+
"default": "./form-input-otp/fesm2022/form-input-otp.mjs"
|
|
188
|
+
},
|
|
189
|
+
"./form-month-year-picker": {
|
|
190
|
+
"types": "./form-month-year-picker/types/form-month-year-picker.d.ts",
|
|
191
|
+
"default": "./form-month-year-picker/fesm2022/form-month-year-picker.mjs"
|
|
192
|
+
},
|
|
193
|
+
"./form-native-select": {
|
|
194
|
+
"types": "./form-native-select/types/form-native-select.d.ts",
|
|
195
|
+
"default": "./form-native-select/fesm2022/form-native-select.mjs"
|
|
196
|
+
},
|
|
197
|
+
"./form-phone-input": {
|
|
198
|
+
"types": "./form-phone-input/types/form-phone-input.d.ts",
|
|
199
|
+
"default": "./form-phone-input/fesm2022/form-phone-input.mjs"
|
|
200
|
+
},
|
|
201
|
+
"./form-radio-group": {
|
|
202
|
+
"types": "./form-radio-group/types/form-radio-group.d.ts",
|
|
203
|
+
"default": "./form-radio-group/fesm2022/form-radio-group.mjs"
|
|
204
|
+
},
|
|
169
205
|
"./form-searchable-multiselect": {
|
|
170
206
|
"types": "./form-searchable-multiselect/types/form-searchable-multiselect.d.ts",
|
|
171
207
|
"default": "./form-searchable-multiselect/fesm2022/form-searchable-multiselect.mjs"
|
|
@@ -174,6 +210,14 @@
|
|
|
174
210
|
"types": "./form-select/types/form-select.d.ts",
|
|
175
211
|
"default": "./form-select/fesm2022/form-select.mjs"
|
|
176
212
|
},
|
|
213
|
+
"./form-slider": {
|
|
214
|
+
"types": "./form-slider/types/form-slider.d.ts",
|
|
215
|
+
"default": "./form-slider/fesm2022/form-slider.mjs"
|
|
216
|
+
},
|
|
217
|
+
"./form-switch": {
|
|
218
|
+
"types": "./form-switch/types/form-switch.d.ts",
|
|
219
|
+
"default": "./form-switch/fesm2022/form-switch.mjs"
|
|
220
|
+
},
|
|
177
221
|
"./form-text-input": {
|
|
178
222
|
"types": "./form-text-input/types/form-text-input.d.ts",
|
|
179
223
|
"default": "./form-text-input/fesm2022/form-text-input.mjs"
|
|
@@ -182,6 +226,14 @@
|
|
|
182
226
|
"types": "./form-textarea/types/form-textarea.d.ts",
|
|
183
227
|
"default": "./form-textarea/fesm2022/form-textarea.mjs"
|
|
184
228
|
},
|
|
229
|
+
"./form-toggle": {
|
|
230
|
+
"types": "./form-toggle/types/form-toggle.d.ts",
|
|
231
|
+
"default": "./form-toggle/fesm2022/form-toggle.mjs"
|
|
232
|
+
},
|
|
233
|
+
"./form-toggle-group": {
|
|
234
|
+
"types": "./form-toggle-group/types/form-toggle-group.d.ts",
|
|
235
|
+
"default": "./form-toggle-group/fesm2022/form-toggle-group.mjs"
|
|
236
|
+
},
|
|
185
237
|
"./hover-card": {
|
|
186
238
|
"types": "./hover-card/types/hover-card.d.ts",
|
|
187
239
|
"default": "./hover-card/fesm2022/hover-card.mjs"
|
|
@@ -238,6 +290,10 @@
|
|
|
238
290
|
"types": "./pagination/types/pagination.d.ts",
|
|
239
291
|
"default": "./pagination/fesm2022/pagination.mjs"
|
|
240
292
|
},
|
|
293
|
+
"./phone-input": {
|
|
294
|
+
"types": "./phone-input/types/phone-input.d.ts",
|
|
295
|
+
"default": "./phone-input/fesm2022/phone-input.mjs"
|
|
296
|
+
},
|
|
241
297
|
"./popover": {
|
|
242
298
|
"types": "./popover/types/popover.d.ts",
|
|
243
299
|
"default": "./popover/fesm2022/popover.mjs"
|