@egose/shadcn-theme-ng-tw 0.0.14 → 0.0.16
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/accordion/fesm2022/accordion.mjs +2 -2
- package/alert/fesm2022/alert.mjs +2 -2
- package/autocomplete/fesm2022/autocomplete.mjs +3 -3
- package/badge/fesm2022/badge.mjs +1 -1
- package/basic-alert/fesm2022/basic-alert.mjs +2 -2
- package/button/fesm2022/button.mjs +2 -2
- package/calendar/fesm2022/calendar.mjs +3 -3
- package/checkbox/README.md +64 -0
- package/checkbox/fesm2022/checkbox.mjs +146 -0
- package/checkbox/fesm2022/checkbox.mjs.map +1 -0
- package/checkbox/index.d.ts +55 -0
- package/confirmation-dialog/fesm2022/confirmation-dialog.mjs +4 -4
- package/date-picker/fesm2022/date-picker.mjs +4 -4
- package/dialog/fesm2022/dialog.mjs +2 -2
- package/exports.json +1 -1
- package/form-checkbox/README.md +64 -0
- package/form-checkbox/fesm2022/form-checkbox.mjs +134 -0
- package/form-checkbox/fesm2022/form-checkbox.mjs.map +1 -0
- package/form-checkbox/index.d.ts +26 -0
- package/form-date-picker/fesm2022/form-date-picker.mjs +4 -4
- package/form-field/fesm2022/form-field.mjs +1 -1
- package/form-field-simple/README.md +64 -0
- package/form-field-simple/fesm2022/form-field-simple.mjs +82 -0
- package/form-field-simple/fesm2022/form-field-simple.mjs.map +1 -0
- package/form-field-simple/index.d.ts +22 -0
- package/form-searchable-multiselect/fesm2022/form-searchable-multiselect.mjs +21 -14
- package/form-searchable-multiselect/fesm2022/form-searchable-multiselect.mjs.map +1 -1
- package/form-select/fesm2022/form-select.mjs +5 -5
- package/form-text-input/fesm2022/form-text-input.mjs +4 -4
- package/form-textarea/fesm2022/form-textarea.mjs +4 -4
- package/input/fesm2022/input.mjs +1 -1
- package/label/fesm2022/label.mjs +1 -1
- package/package.json +13 -1
- package/popover/fesm2022/popover.mjs +1 -1
- package/radio-group/fesm2022/radio-group.mjs +1 -1
- package/searchable-multiselect/fesm2022/searchable-multiselect.mjs +1 -1
- package/select/fesm2022/select.mjs +2 -2
- package/separator/fesm2022/separator.mjs +1 -1
- package/sonner/fesm2022/sonner.mjs +1 -1
- package/spinner/fesm2022/spinner.mjs +1 -1
- package/switch/fesm2022/switch.mjs +1 -1
- package/tabs/fesm2022/tabs.mjs +3 -3
|
@@ -2,10 +2,10 @@ import * as i0 from '@angular/core';
|
|
|
2
2
|
import { inject, input, computed, Directive, ViewEncapsulation, ChangeDetectionStrategy, Component, NgModule } from '@angular/core';
|
|
3
3
|
import * as i1 from '@spartan-ng/brain/accordion';
|
|
4
4
|
import { BrnAccordion, BrnAccordionContent, BrnAccordionItem, BrnAccordionTrigger } from '@spartan-ng/brain/accordion';
|
|
5
|
-
import { hlm } from '@egose/shadcn-theme-ng/utils';
|
|
5
|
+
import { hlm } from '@egose/shadcn-theme-ng-tw/utils';
|
|
6
6
|
import { provideIcons } from '@ng-icons/core';
|
|
7
7
|
import { lucideChevronDown } from '@ng-icons/lucide';
|
|
8
|
-
import { provideHlmIconConfig } from '@egose/shadcn-theme-ng/icon';
|
|
8
|
+
import { provideHlmIconConfig } from '@egose/shadcn-theme-ng-tw/icon';
|
|
9
9
|
|
|
10
10
|
class HlmAccordion {
|
|
11
11
|
_brn = inject(BrnAccordion);
|
package/alert/fesm2022/alert.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import { input, computed, Directive, NgModule } from '@angular/core';
|
|
3
|
-
import { hlm } from '@egose/shadcn-theme-ng/utils';
|
|
3
|
+
import { hlm } from '@egose/shadcn-theme-ng-tw/utils';
|
|
4
4
|
import { cva } from 'class-variance-authority';
|
|
5
|
-
import { provideHlmIconConfig } from '@egose/shadcn-theme-ng/icon';
|
|
5
|
+
import { provideHlmIconConfig } from '@egose/shadcn-theme-ng-tw/icon';
|
|
6
6
|
|
|
7
7
|
const alertVariants = cva('tw:relative tw:w-full tw:items-start tw:gap-y-0.5 tw:rounded-lg tw:border tw:px-4 tw:py-3 tw:text-sm tw:has-[>[hlmAlertIcon]]:grid tw:has-[>[hlmAlertIcon]]:grid-cols-[calc(theme(spacing.1)*4)_1fr] tw:has-[>[hlmAlertIcon]]:gap-x-3 tw:[&>[hlmAlertIcon]]:size-4 tw:[&>[hlmAlertIcon]]:translate-y-0.5 tw:[&>[hlmAlertIcon]]:text-current', {
|
|
8
8
|
variants: {
|
|
@@ -7,9 +7,9 @@ import { lucideChevronDown, lucideSearch } from '@ng-icons/lucide';
|
|
|
7
7
|
import * as i1 from '@spartan-ng/brain/autocomplete';
|
|
8
8
|
import { BrnAutocompleteGroup, BrnAutocompleteItem, BrnAutocompleteList, BrnAutocompleteSearchInput, BrnAutocomplete, BrnAutocompleteEmpty } from '@spartan-ng/brain/autocomplete';
|
|
9
9
|
import { BrnPopover, BrnPopoverContent } from '@spartan-ng/brain/popover';
|
|
10
|
-
import { provideHlmIconConfig, HlmIcon } from '@egose/shadcn-theme-ng/icon';
|
|
11
|
-
import { HlmPopoverContent } from '@egose/shadcn-theme-ng/popover';
|
|
12
|
-
import { hlm } from '@egose/shadcn-theme-ng/utils';
|
|
10
|
+
import { provideHlmIconConfig, HlmIcon } from '@egose/shadcn-theme-ng-tw/icon';
|
|
11
|
+
import { HlmPopoverContent } from '@egose/shadcn-theme-ng-tw/popover';
|
|
12
|
+
import { hlm } from '@egose/shadcn-theme-ng-tw/utils';
|
|
13
13
|
import { BrnDialog } from '@spartan-ng/brain/dialog';
|
|
14
14
|
|
|
15
15
|
class HlmAutocompleteEmpty {
|
package/badge/fesm2022/badge.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import { input, signal, computed, Component } from '@angular/core';
|
|
3
3
|
import { cva } from 'class-variance-authority';
|
|
4
|
-
import { hlm } from '@egose/shadcn-theme-ng/utils';
|
|
4
|
+
import { hlm } from '@egose/shadcn-theme-ng-tw/utils';
|
|
5
5
|
|
|
6
6
|
const badgeVariants = cva([
|
|
7
7
|
'tw:inline-flex',
|
|
@@ -2,8 +2,8 @@ import * as i0 from '@angular/core';
|
|
|
2
2
|
import { input, Component } from '@angular/core';
|
|
3
3
|
import { NgIcon, provideIcons } from '@ng-icons/core';
|
|
4
4
|
import { lucideGhost, lucideLink, lucideZap, lucideThumbsUp, lucideStar, lucideBell, lucideCircleAlert, lucideBatteryWarning, lucideInfo, lucideCircleCheck } from '@ng-icons/lucide';
|
|
5
|
-
import { HlmAlert, HlmAlertIcon, HlmAlertTitle, HlmAlertDescription } from '@egose/shadcn-theme-ng/alert';
|
|
6
|
-
import { HlmIcon } from '@egose/shadcn-theme-ng/icon';
|
|
5
|
+
import { HlmAlert, HlmAlertIcon, HlmAlertTitle, HlmAlertDescription } from '@egose/shadcn-theme-ng-tw/alert';
|
|
6
|
+
import { HlmIcon } from '@egose/shadcn-theme-ng-tw/icon';
|
|
7
7
|
|
|
8
8
|
class EgBasicAlert {
|
|
9
9
|
variant = input('info', ...(ngDevMode ? [{ debugName: "variant" }] : []));
|
|
@@ -3,9 +3,9 @@ import { input, signal, computed, Component, NgModule } from '@angular/core';
|
|
|
3
3
|
import { NgTemplateOutlet } from '@angular/common';
|
|
4
4
|
import * as i1 from '@spartan-ng/brain/button';
|
|
5
5
|
import { BrnButton } from '@spartan-ng/brain/button';
|
|
6
|
-
import { HlmSpinner } from '@egose/shadcn-theme-ng/spinner';
|
|
6
|
+
import { HlmSpinner } from '@egose/shadcn-theme-ng-tw/spinner';
|
|
7
7
|
import { cva } from 'class-variance-authority';
|
|
8
|
-
import { hlm } from '@egose/shadcn-theme-ng/utils';
|
|
8
|
+
import { hlm } from '@egose/shadcn-theme-ng-tw/utils';
|
|
9
9
|
|
|
10
10
|
const buttonVariants = cva([
|
|
11
11
|
'tw:cursor-pointer',
|
|
@@ -4,9 +4,9 @@ import { provideIcons, NgIcon } from '@ng-icons/core';
|
|
|
4
4
|
import { lucideChevronRight, lucideChevronLeft } from '@ng-icons/lucide';
|
|
5
5
|
import { injectBrnCalendarI18n, BrnCalendar, BrnCalendarHeader, BrnCalendarNextButton, BrnCalendarPreviousButton, BrnCalendarWeekday, BrnCalendarWeek, BrnCalendarCellButton, BrnCalendarCell, BrnCalendarGrid, BrnCalendarMulti, BrnCalendarRange } from '@spartan-ng/brain/calendar';
|
|
6
6
|
import { injectDateAdapter } from '@spartan-ng/brain/date-time';
|
|
7
|
-
import { buttonVariants } from '@egose/shadcn-theme-ng/button';
|
|
8
|
-
import { HlmIcon } from '@egose/shadcn-theme-ng/icon';
|
|
9
|
-
import { hlm } from '@egose/shadcn-theme-ng/utils';
|
|
7
|
+
import { buttonVariants } from '@egose/shadcn-theme-ng-tw/button';
|
|
8
|
+
import { HlmIcon } from '@egose/shadcn-theme-ng-tw/icon';
|
|
9
|
+
import { hlm } from '@egose/shadcn-theme-ng-tw/utils';
|
|
10
10
|
|
|
11
11
|
class HlmCalendar {
|
|
12
12
|
calendarClass = input('', ...(ngDevMode ? [{ debugName: "calendarClass" }] : []));
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
# Checkbox
|
|
2
|
+
|
|
3
|
+
This project was generated using [Angular CLI](https://github.com/angular/angular-cli) version 20.3.0.
|
|
4
|
+
|
|
5
|
+
## Code scaffolding
|
|
6
|
+
|
|
7
|
+
Angular CLI includes powerful code scaffolding tools. To generate a new component, run:
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
ng generate component component-name
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
For a complete list of available schematics (such as `components`, `directives`, or `pipes`), run:
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
ng generate --help
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Building
|
|
20
|
+
|
|
21
|
+
To build the library, run:
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
ng build checkbox
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
This command will compile your project, and the build artifacts will be placed in the `dist/` directory.
|
|
28
|
+
|
|
29
|
+
### Publishing the Library
|
|
30
|
+
|
|
31
|
+
Once the project is built, you can publish your library by following these steps:
|
|
32
|
+
|
|
33
|
+
1. Navigate to the `dist` directory:
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
cd dist/checkbox
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
2. Run the `npm publish` command to publish your library to the npm registry:
|
|
40
|
+
```bash
|
|
41
|
+
npm publish
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## Running unit tests
|
|
45
|
+
|
|
46
|
+
To execute unit tests with the [Karma](https://karma-runner.github.io) test runner, use the following command:
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
ng test
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
## Running end-to-end tests
|
|
53
|
+
|
|
54
|
+
For end-to-end (e2e) testing, run:
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
ng e2e
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
Angular CLI does not come with an end-to-end testing framework by default. You can choose one that suits your needs.
|
|
61
|
+
|
|
62
|
+
## Additional Resources
|
|
63
|
+
|
|
64
|
+
For more information on using the Angular CLI, including detailed command references, visit the [Angular CLI Overview and Command Reference](https://angular.dev/tools/cli) page.
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { forwardRef, input, computed, model, booleanAttribute, signal, output, ChangeDetectionStrategy, Component, NgModule } from '@angular/core';
|
|
3
|
+
import { NG_VALUE_ACCESSOR } from '@angular/forms';
|
|
4
|
+
import { provideIcons, NgIcon } from '@ng-icons/core';
|
|
5
|
+
import { lucideCheck } from '@ng-icons/lucide';
|
|
6
|
+
import { BrnCheckbox } from '@spartan-ng/brain/checkbox';
|
|
7
|
+
import { HlmIcon } from '@egose/shadcn-theme-ng-tw/icon';
|
|
8
|
+
import { hlm } from '@egose/shadcn-theme-ng-tw/utils';
|
|
9
|
+
|
|
10
|
+
const HLM_CHECKBOX_VALUE_ACCESSOR = {
|
|
11
|
+
provide: NG_VALUE_ACCESSOR,
|
|
12
|
+
useExisting: forwardRef(() => HlmCheckbox),
|
|
13
|
+
multi: true,
|
|
14
|
+
};
|
|
15
|
+
class HlmCheckbox {
|
|
16
|
+
userClass = input('', ...(ngDevMode ? [{ debugName: "userClass", alias: 'class' }] : [{ alias: 'class' }]));
|
|
17
|
+
_computedClass = computed(() => hlm('tw:border-input tw:dark:bg-input/30 tw:data-[state=checked]:bg-primary tw:data-[state=checked]:text-primary-foreground tw:dark:data-[state=checked]:bg-primary tw:data-[state=checked]:border-primary tw:focus-visible:border-ring tw:focus-visible:ring-ring/50 tw:aria-invalid:ring-destructive/20 tw:dark:aria-invalid:ring-destructive/40 tw:aria-invalid:border-destructive tw:shadow-xs tw:peer tw:size-4 tw:shrink-0 tw:cursor-default tw:rounded-[4px] tw:border tw:outline-none tw:transition-shadow tw:focus-visible:ring-[3px] tw:disabled:cursor-not-allowed tw:disabled:opacity-50', this.userClass(), this._state().disabled() ? 'tw:cursor-not-allowed tw:opacity-50' : ''), ...(ngDevMode ? [{ debugName: "_computedClass" }] : []));
|
|
18
|
+
/** Used to set the id on the underlying brn element. */
|
|
19
|
+
id = input(null, ...(ngDevMode ? [{ debugName: "id" }] : []));
|
|
20
|
+
/** Used to set the aria-label attribute on the underlying brn element. */
|
|
21
|
+
ariaLabel = input(null, ...(ngDevMode ? [{ debugName: "ariaLabel", alias: 'aria-label' }] : [{ alias: 'aria-label' }]));
|
|
22
|
+
/** Used to set the aria-labelledby attribute on the underlying brn element. */
|
|
23
|
+
ariaLabelledby = input(null, ...(ngDevMode ? [{ debugName: "ariaLabelledby", alias: 'aria-labelledby' }] : [{ alias: 'aria-labelledby' }]));
|
|
24
|
+
/** Used to set the aria-describedby attribute on the underlying brn element. */
|
|
25
|
+
ariaDescribedby = input(null, ...(ngDevMode ? [{ debugName: "ariaDescribedby", alias: 'aria-describedby' }] : [{ alias: 'aria-describedby' }]));
|
|
26
|
+
/** The checked state of the checkbox. */
|
|
27
|
+
checked = model(false, ...(ngDevMode ? [{ debugName: "checked" }] : []));
|
|
28
|
+
/** The name attribute of the checkbox. */
|
|
29
|
+
name = input(null, ...(ngDevMode ? [{ debugName: "name" }] : []));
|
|
30
|
+
/** Whether the checkbox is required. */
|
|
31
|
+
required = input(false, ...(ngDevMode ? [{ debugName: "required", transform: booleanAttribute }] : [{ transform: booleanAttribute }]));
|
|
32
|
+
/** Whether the checkbox is disabled. */
|
|
33
|
+
disabled = input(false, ...(ngDevMode ? [{ debugName: "disabled", transform: booleanAttribute }] : [{ transform: booleanAttribute }]));
|
|
34
|
+
_state = computed(() => ({
|
|
35
|
+
disabled: signal(this.disabled()),
|
|
36
|
+
}), ...(ngDevMode ? [{ debugName: "_state" }] : []));
|
|
37
|
+
changed = output();
|
|
38
|
+
_onChange;
|
|
39
|
+
_onTouched;
|
|
40
|
+
_handleChange() {
|
|
41
|
+
if (this._state().disabled())
|
|
42
|
+
return;
|
|
43
|
+
const previousChecked = this.checked();
|
|
44
|
+
this.checked.set(previousChecked === 'indeterminate' ? true : !previousChecked);
|
|
45
|
+
this._onChange?.(!previousChecked);
|
|
46
|
+
this.changed.emit(!previousChecked);
|
|
47
|
+
}
|
|
48
|
+
/** CONTROL VALUE ACCESSOR */
|
|
49
|
+
writeValue(value) {
|
|
50
|
+
this.checked.set(!!value);
|
|
51
|
+
}
|
|
52
|
+
registerOnChange(fn) {
|
|
53
|
+
this._onChange = fn;
|
|
54
|
+
}
|
|
55
|
+
registerOnTouched(fn) {
|
|
56
|
+
this._onTouched = fn;
|
|
57
|
+
}
|
|
58
|
+
setDisabledState(isDisabled) {
|
|
59
|
+
this._state().disabled.set(isDisabled);
|
|
60
|
+
}
|
|
61
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: HlmCheckbox, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
62
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.1", type: HlmCheckbox, isStandalone: true, selector: "hlm-checkbox", inputs: { userClass: { classPropertyName: "userClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null }, id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "aria-label", isSignal: true, isRequired: false, transformFunction: null }, ariaLabelledby: { classPropertyName: "ariaLabelledby", publicName: "aria-labelledby", isSignal: true, isRequired: false, transformFunction: null }, ariaDescribedby: { classPropertyName: "ariaDescribedby", publicName: "aria-describedby", isSignal: true, isRequired: false, transformFunction: null }, checked: { classPropertyName: "checked", publicName: "checked", isSignal: true, isRequired: false, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { checked: "checkedChange", changed: "changed" }, host: { properties: { "attr.id": "null", "attr.aria-label": "null", "attr.aria-labelledby": "null", "attr.aria-describedby": "null", "attr.data-disabled": "_state().disabled() ? \"\" : null" }, classAttribute: "contents peer" }, providers: [HLM_CHECKBOX_VALUE_ACCESSOR], ngImport: i0, template: `
|
|
63
|
+
<brn-checkbox
|
|
64
|
+
[id]="id()"
|
|
65
|
+
[name]="name()"
|
|
66
|
+
[class]="_computedClass()"
|
|
67
|
+
[checked]="checked()"
|
|
68
|
+
[disabled]="_state().disabled()"
|
|
69
|
+
[required]="required()"
|
|
70
|
+
[aria-label]="ariaLabel()"
|
|
71
|
+
[aria-labelledby]="ariaLabelledby()"
|
|
72
|
+
[aria-describedby]="ariaDescribedby()"
|
|
73
|
+
(changed)="_handleChange()"
|
|
74
|
+
(touched)="_onTouched?.()"
|
|
75
|
+
>
|
|
76
|
+
@if (checked()) {
|
|
77
|
+
<span class="tw:flex tw:items-center tw:justify-center tw:text-current tw:transition-none">
|
|
78
|
+
<ng-icon hlm size="14px" name="lucideCheck" />
|
|
79
|
+
</span>
|
|
80
|
+
}
|
|
81
|
+
</brn-checkbox>
|
|
82
|
+
`, isInline: true, dependencies: [{ kind: "component", type: BrnCheckbox, selector: "brn-checkbox", inputs: ["checked", "id", "name", "class", "aria-label", "aria-labelledby", "aria-describedby", "required", "disabled"], outputs: ["checkedChange", "changed", "touched"] }, { kind: "component", type: NgIcon, selector: "ng-icon", inputs: ["name", "svg", "size", "strokeWidth", "color"] }, { kind: "directive", type: HlmIcon, selector: "ng-icon[hlm]", inputs: ["size"] }], viewProviders: [provideIcons({ lucideCheck })], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
83
|
+
}
|
|
84
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: HlmCheckbox, decorators: [{
|
|
85
|
+
type: Component,
|
|
86
|
+
args: [{
|
|
87
|
+
selector: 'hlm-checkbox',
|
|
88
|
+
imports: [BrnCheckbox, NgIcon, HlmIcon],
|
|
89
|
+
template: `
|
|
90
|
+
<brn-checkbox
|
|
91
|
+
[id]="id()"
|
|
92
|
+
[name]="name()"
|
|
93
|
+
[class]="_computedClass()"
|
|
94
|
+
[checked]="checked()"
|
|
95
|
+
[disabled]="_state().disabled()"
|
|
96
|
+
[required]="required()"
|
|
97
|
+
[aria-label]="ariaLabel()"
|
|
98
|
+
[aria-labelledby]="ariaLabelledby()"
|
|
99
|
+
[aria-describedby]="ariaDescribedby()"
|
|
100
|
+
(changed)="_handleChange()"
|
|
101
|
+
(touched)="_onTouched?.()"
|
|
102
|
+
>
|
|
103
|
+
@if (checked()) {
|
|
104
|
+
<span class="tw:flex tw:items-center tw:justify-center tw:text-current tw:transition-none">
|
|
105
|
+
<ng-icon hlm size="14px" name="lucideCheck" />
|
|
106
|
+
</span>
|
|
107
|
+
}
|
|
108
|
+
</brn-checkbox>
|
|
109
|
+
`,
|
|
110
|
+
host: {
|
|
111
|
+
class: 'contents peer',
|
|
112
|
+
'[attr.id]': 'null',
|
|
113
|
+
'[attr.aria-label]': 'null',
|
|
114
|
+
'[attr.aria-labelledby]': 'null',
|
|
115
|
+
'[attr.aria-describedby]': 'null',
|
|
116
|
+
'[attr.data-disabled]': '_state().disabled() ? "" : null',
|
|
117
|
+
},
|
|
118
|
+
providers: [HLM_CHECKBOX_VALUE_ACCESSOR],
|
|
119
|
+
viewProviders: [provideIcons({ lucideCheck })],
|
|
120
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
121
|
+
}]
|
|
122
|
+
}] });
|
|
123
|
+
|
|
124
|
+
/*
|
|
125
|
+
* Public API Surface of checkbox
|
|
126
|
+
*/
|
|
127
|
+
const HlmCheckboxImports = [HlmCheckbox];
|
|
128
|
+
class HlmCheckboxModule {
|
|
129
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: HlmCheckboxModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
130
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.1", ngImport: i0, type: HlmCheckboxModule, imports: [HlmCheckbox], exports: [HlmCheckbox] });
|
|
131
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: HlmCheckboxModule, imports: [HlmCheckboxImports] });
|
|
132
|
+
}
|
|
133
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: HlmCheckboxModule, decorators: [{
|
|
134
|
+
type: NgModule,
|
|
135
|
+
args: [{
|
|
136
|
+
imports: [...HlmCheckboxImports],
|
|
137
|
+
exports: [...HlmCheckboxImports],
|
|
138
|
+
}]
|
|
139
|
+
}] });
|
|
140
|
+
|
|
141
|
+
/**
|
|
142
|
+
* Generated bundle index. Do not edit.
|
|
143
|
+
*/
|
|
144
|
+
|
|
145
|
+
export { HLM_CHECKBOX_VALUE_ACCESSOR, HlmCheckbox, HlmCheckboxImports, HlmCheckboxModule };
|
|
146
|
+
//# sourceMappingURL=checkbox.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"checkbox.mjs","sources":["../../../projects/checkbox/src/lib/checkbox.ts","../../../projects/checkbox/src/public-api.ts","../../../projects/checkbox/src/checkbox.ts"],"sourcesContent":["import { BooleanInput } from '@angular/cdk/coercion';\nimport {\n ChangeDetectionStrategy,\n Component,\n booleanAttribute,\n computed,\n forwardRef,\n input,\n model,\n output,\n signal,\n} from '@angular/core';\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';\nimport { NgIcon, provideIcons } from '@ng-icons/core';\nimport { lucideCheck } from '@ng-icons/lucide';\nimport { BrnCheckbox } from '@spartan-ng/brain/checkbox';\nimport type { ChangeFn, TouchFn } from '@spartan-ng/brain/forms';\nimport { HlmIcon } from '@egose/shadcn-theme-ng/icon';\nimport { hlm } from '@egose/shadcn-theme-ng/utils';\nimport type { ClassValue } from 'clsx';\n\nexport const HLM_CHECKBOX_VALUE_ACCESSOR = {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => HlmCheckbox),\n multi: true,\n};\n\n@Component({\n selector: 'hlm-checkbox',\n imports: [BrnCheckbox, NgIcon, HlmIcon],\n template: `\n <brn-checkbox\n [id]=\"id()\"\n [name]=\"name()\"\n [class]=\"_computedClass()\"\n [checked]=\"checked()\"\n [disabled]=\"_state().disabled()\"\n [required]=\"required()\"\n [aria-label]=\"ariaLabel()\"\n [aria-labelledby]=\"ariaLabelledby()\"\n [aria-describedby]=\"ariaDescribedby()\"\n (changed)=\"_handleChange()\"\n (touched)=\"_onTouched?.()\"\n >\n @if (checked()) {\n <span class=\"tw:flex tw:items-center tw:justify-center tw:text-current tw:transition-none\">\n <ng-icon hlm size=\"14px\" name=\"lucideCheck\" />\n </span>\n }\n </brn-checkbox>\n `,\n host: {\n class: 'contents peer',\n '[attr.id]': 'null',\n '[attr.aria-label]': 'null',\n '[attr.aria-labelledby]': 'null',\n '[attr.aria-describedby]': 'null',\n '[attr.data-disabled]': '_state().disabled() ? \"\" : null',\n },\n providers: [HLM_CHECKBOX_VALUE_ACCESSOR],\n viewProviders: [provideIcons({ lucideCheck })],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class HlmCheckbox implements ControlValueAccessor {\n public readonly userClass = input<ClassValue>('', { alias: 'class' });\n\n protected readonly _computedClass = computed(() =>\n hlm(\n 'tw:border-input tw:dark:bg-input/30 tw:data-[state=checked]:bg-primary tw:data-[state=checked]:text-primary-foreground tw:dark:data-[state=checked]:bg-primary tw:data-[state=checked]:border-primary tw:focus-visible:border-ring tw:focus-visible:ring-ring/50 tw:aria-invalid:ring-destructive/20 tw:dark:aria-invalid:ring-destructive/40 tw:aria-invalid:border-destructive tw:shadow-xs tw:peer tw:size-4 tw:shrink-0 tw:cursor-default tw:rounded-[4px] tw:border tw:outline-none tw:transition-shadow tw:focus-visible:ring-[3px] tw:disabled:cursor-not-allowed tw:disabled:opacity-50',\n this.userClass(),\n this._state().disabled() ? 'tw:cursor-not-allowed tw:opacity-50' : '',\n ),\n );\n\n /** Used to set the id on the underlying brn element. */\n public readonly id = input<string | null>(null);\n\n /** Used to set the aria-label attribute on the underlying brn element. */\n public readonly ariaLabel = input<string | null>(null, { alias: 'aria-label' });\n\n /** Used to set the aria-labelledby attribute on the underlying brn element. */\n public readonly ariaLabelledby = input<string | null>(null, { alias: 'aria-labelledby' });\n\n /** Used to set the aria-describedby attribute on the underlying brn element. */\n public readonly ariaDescribedby = input<string | null>(null, { alias: 'aria-describedby' });\n\n /** The checked state of the checkbox. */\n public readonly checked = model<CheckboxValue>(false);\n\n /** The name attribute of the checkbox. */\n public readonly name = input<string | null>(null);\n\n /** Whether the checkbox is required. */\n public readonly required = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n /** Whether the checkbox is disabled. */\n public readonly disabled = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n protected readonly _state = computed(() => ({\n disabled: signal(this.disabled()),\n }));\n\n public readonly changed = output<boolean>();\n\n protected _onChange?: ChangeFn<CheckboxValue>;\n protected _onTouched?: TouchFn;\n\n protected _handleChange(): void {\n if (this._state().disabled()) return;\n\n const previousChecked = this.checked();\n this.checked.set(previousChecked === 'indeterminate' ? true : !previousChecked);\n this._onChange?.(!previousChecked);\n this.changed.emit(!previousChecked);\n }\n\n /** CONTROL VALUE ACCESSOR */\n writeValue(value: CheckboxValue): void {\n this.checked.set(!!value);\n }\n\n registerOnChange(fn: ChangeFn<CheckboxValue>): void {\n this._onChange = fn;\n }\n\n registerOnTouched(fn: TouchFn): void {\n this._onTouched = fn;\n }\n\n setDisabledState(isDisabled: boolean): void {\n this._state().disabled.set(isDisabled);\n }\n}\n\ntype CheckboxValue = boolean | 'indeterminate';\n","/*\n * Public API Surface of checkbox\n */\n\nimport { NgModule } from '@angular/core';\n\nimport { HlmCheckbox } from './lib/checkbox';\n\nexport * from './lib/checkbox';\n\nexport const HlmCheckboxImports = [HlmCheckbox] as const;\n@NgModule({\n imports: [...HlmCheckboxImports],\n exports: [...HlmCheckboxImports],\n})\nexport class HlmCheckboxModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;AAqBO,MAAM,2BAA2B,GAAG;AACzC,IAAA,OAAO,EAAE,iBAAiB;AAC1B,IAAA,WAAW,EAAE,UAAU,CAAC,MAAM,WAAW,CAAC;AAC1C,IAAA,KAAK,EAAE,IAAI;;MAuCA,WAAW,CAAA;AACN,IAAA,SAAS,GAAG,KAAK,CAAa,EAAE,6CAAI,KAAK,EAAE,OAAO,EAAA,CAAA,GAAA,CAAhB,EAAE,KAAK,EAAE,OAAO,EAAE,GAAC;AAElD,IAAA,cAAc,GAAG,QAAQ,CAAC,MAC3C,GAAG,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
|
|
3
|
+
import { ControlValueAccessor } from '@angular/forms';
|
|
4
|
+
import { ChangeFn, TouchFn } from '@spartan-ng/brain/forms';
|
|
5
|
+
import { ClassValue } from 'clsx';
|
|
6
|
+
|
|
7
|
+
declare const HLM_CHECKBOX_VALUE_ACCESSOR: {
|
|
8
|
+
provide: _angular_core.InjectionToken<readonly ControlValueAccessor[]>;
|
|
9
|
+
useExisting: _angular_core.Type<any>;
|
|
10
|
+
multi: boolean;
|
|
11
|
+
};
|
|
12
|
+
declare class HlmCheckbox implements ControlValueAccessor {
|
|
13
|
+
readonly userClass: _angular_core.InputSignal<ClassValue>;
|
|
14
|
+
protected readonly _computedClass: _angular_core.Signal<string>;
|
|
15
|
+
/** Used to set the id on the underlying brn element. */
|
|
16
|
+
readonly id: _angular_core.InputSignal<string | null>;
|
|
17
|
+
/** Used to set the aria-label attribute on the underlying brn element. */
|
|
18
|
+
readonly ariaLabel: _angular_core.InputSignal<string | null>;
|
|
19
|
+
/** Used to set the aria-labelledby attribute on the underlying brn element. */
|
|
20
|
+
readonly ariaLabelledby: _angular_core.InputSignal<string | null>;
|
|
21
|
+
/** Used to set the aria-describedby attribute on the underlying brn element. */
|
|
22
|
+
readonly ariaDescribedby: _angular_core.InputSignal<string | null>;
|
|
23
|
+
/** The checked state of the checkbox. */
|
|
24
|
+
readonly checked: _angular_core.ModelSignal<CheckboxValue>;
|
|
25
|
+
/** The name attribute of the checkbox. */
|
|
26
|
+
readonly name: _angular_core.InputSignal<string | null>;
|
|
27
|
+
/** Whether the checkbox is required. */
|
|
28
|
+
readonly required: _angular_core.InputSignalWithTransform<boolean, BooleanInput>;
|
|
29
|
+
/** Whether the checkbox is disabled. */
|
|
30
|
+
readonly disabled: _angular_core.InputSignalWithTransform<boolean, BooleanInput>;
|
|
31
|
+
protected readonly _state: _angular_core.Signal<{
|
|
32
|
+
disabled: _angular_core.WritableSignal<boolean>;
|
|
33
|
+
}>;
|
|
34
|
+
readonly changed: _angular_core.OutputEmitterRef<boolean>;
|
|
35
|
+
protected _onChange?: ChangeFn<CheckboxValue>;
|
|
36
|
+
protected _onTouched?: TouchFn;
|
|
37
|
+
protected _handleChange(): void;
|
|
38
|
+
/** CONTROL VALUE ACCESSOR */
|
|
39
|
+
writeValue(value: CheckboxValue): void;
|
|
40
|
+
registerOnChange(fn: ChangeFn<CheckboxValue>): void;
|
|
41
|
+
registerOnTouched(fn: TouchFn): void;
|
|
42
|
+
setDisabledState(isDisabled: boolean): void;
|
|
43
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<HlmCheckbox, never>;
|
|
44
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<HlmCheckbox, "hlm-checkbox", never, { "userClass": { "alias": "class"; "required": false; "isSignal": true; }; "id": { "alias": "id"; "required": false; "isSignal": true; }; "ariaLabel": { "alias": "aria-label"; "required": false; "isSignal": true; }; "ariaLabelledby": { "alias": "aria-labelledby"; "required": false; "isSignal": true; }; "ariaDescribedby": { "alias": "aria-describedby"; "required": false; "isSignal": true; }; "checked": { "alias": "checked"; "required": false; "isSignal": true; }; "name": { "alias": "name"; "required": false; "isSignal": true; }; "required": { "alias": "required"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; }, { "checked": "checkedChange"; "changed": "changed"; }, never, never, true, never>;
|
|
45
|
+
}
|
|
46
|
+
type CheckboxValue = boolean | 'indeterminate';
|
|
47
|
+
|
|
48
|
+
declare const HlmCheckboxImports: readonly [typeof HlmCheckbox];
|
|
49
|
+
declare class HlmCheckboxModule {
|
|
50
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<HlmCheckboxModule, never>;
|
|
51
|
+
static ɵmod: _angular_core.ɵɵNgModuleDeclaration<HlmCheckboxModule, never, [typeof HlmCheckbox], [typeof HlmCheckbox]>;
|
|
52
|
+
static ɵinj: _angular_core.ɵɵInjectorDeclaration<HlmCheckboxModule>;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export { HLM_CHECKBOX_VALUE_ACCESSOR, HlmCheckbox, HlmCheckboxImports, HlmCheckboxModule };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import { inject, Component, Injectable } from '@angular/core';
|
|
3
|
-
import { HlmButton } from '@egose/shadcn-theme-ng/button';
|
|
4
|
-
import * as i1 from '@egose/shadcn-theme-ng/dialog';
|
|
5
|
-
import { HlmDialogDescription, HlmDialogHeader, HlmDialogFooter, HlmDialogTitle } from '@egose/shadcn-theme-ng/dialog';
|
|
3
|
+
import { HlmButton } from '@egose/shadcn-theme-ng-tw/button';
|
|
4
|
+
import * as i1 from '@egose/shadcn-theme-ng-tw/dialog';
|
|
5
|
+
import { HlmDialogDescription, HlmDialogHeader, HlmDialogFooter, HlmDialogTitle } from '@egose/shadcn-theme-ng-tw/dialog';
|
|
6
6
|
import { BrnDialogRef, injectBrnDialogContext } from '@spartan-ng/brain/dialog';
|
|
7
|
-
import { HlmIcon } from '@egose/shadcn-theme-ng/icon';
|
|
7
|
+
import { HlmIcon } from '@egose/shadcn-theme-ng-tw/icon';
|
|
8
8
|
import { NgIcon, provideIcons } from '@ng-icons/core';
|
|
9
9
|
import { lucideTriangleAlert } from '@ng-icons/lucide';
|
|
10
10
|
|
|
@@ -5,10 +5,10 @@ import { NgIcon, provideIcons } from '@ng-icons/core';
|
|
|
5
5
|
import { lucideChevronDown } from '@ng-icons/lucide';
|
|
6
6
|
import { BrnPopover, BrnPopoverTrigger, BrnPopoverContent } from '@spartan-ng/brain/popover';
|
|
7
7
|
import { BrnFormFieldControl } from '@spartan-ng/brain/form-field';
|
|
8
|
-
import { HlmCalendar, HlmCalendarMulti, HlmCalendarRange } from '@egose/shadcn-theme-ng/calendar';
|
|
9
|
-
import { HlmIcon } from '@egose/shadcn-theme-ng/icon';
|
|
10
|
-
import { HlmPopoverContent } from '@egose/shadcn-theme-ng/popover';
|
|
11
|
-
import { hlm } from '@egose/shadcn-theme-ng/utils';
|
|
8
|
+
import { HlmCalendar, HlmCalendarMulti, HlmCalendarRange } from '@egose/shadcn-theme-ng-tw/calendar';
|
|
9
|
+
import { HlmIcon } from '@egose/shadcn-theme-ng-tw/icon';
|
|
10
|
+
import { HlmPopoverContent } from '@egose/shadcn-theme-ng-tw/popover';
|
|
11
|
+
import { hlm } from '@egose/shadcn-theme-ng-tw/utils';
|
|
12
12
|
|
|
13
13
|
function getDefaultConfig$2() {
|
|
14
14
|
return {
|
|
@@ -3,11 +3,11 @@ import { input, computed, effect, untracked, Directive, forwardRef, ViewEncapsul
|
|
|
3
3
|
import * as i1 from '@spartan-ng/brain/dialog';
|
|
4
4
|
import { BrnDialog, BrnDialogOverlay, provideBrnDialogDefaultOptions, BrnDialogRef, injectBrnDialogContext, BrnDialogClose, BrnDialogDescription, BrnDialogTitle, BrnDialogService, cssClassesToArray, DEFAULT_BRN_DIALOG_OPTIONS } from '@spartan-ng/brain/dialog';
|
|
5
5
|
import { injectCustomClassSettable } from '@spartan-ng/brain/core';
|
|
6
|
-
import { hlm } from '@egose/shadcn-theme-ng/utils';
|
|
6
|
+
import { hlm } from '@egose/shadcn-theme-ng-tw/utils';
|
|
7
7
|
import { NgComponentOutlet } from '@angular/common';
|
|
8
8
|
import { NgIcon, provideIcons } from '@ng-icons/core';
|
|
9
9
|
import { lucideX } from '@ng-icons/lucide';
|
|
10
|
-
import { HlmIcon } from '@egose/shadcn-theme-ng/icon';
|
|
10
|
+
import { HlmIcon } from '@egose/shadcn-theme-ng-tw/icon';
|
|
11
11
|
|
|
12
12
|
const hlmDialogOverlayClass = 'tw:data-[state=open]:animate-in tw:data-[state=closed]:animate-out tw:data-[state=closed]:fade-out-0 tw:data-[state=open]:fade-in-0 tw:bg-black/50';
|
|
13
13
|
class HlmDialogOverlay {
|
package/exports.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"./utils":{"types":"./utils/index.d.ts","default":"./utils/fesm2022/utils.mjs"},"./icon":{"types":"./icon/index.d.ts","default":"./icon/fesm2022/icon.mjs"},"./spinner":{"types":"./spinner/index.d.ts","default":"./spinner/fesm2022/spinner.mjs"},"./badge":{"types":"./badge/index.d.ts","default":"./badge/fesm2022/badge.mjs"},"./input":{"types":"./input/index.d.ts","default":"./input/fesm2022/input.mjs"},"./select":{"types":"./select/index.d.ts","default":"./select/fesm2022/select.mjs"},"./button":{"types":"./button/index.d.ts","default":"./button/fesm2022/button.mjs"},"./accordion":{"types":"./accordion/index.d.ts","default":"./accordion/fesm2022/accordion.mjs"},"./alert":{"types":"./alert/index.d.ts","default":"./alert/fesm2022/alert.mjs"},"./switch":{"types":"./switch/index.d.ts","default":"./switch/fesm2022/switch.mjs"},"./label":{"types":"./label/index.d.ts","default":"./label/fesm2022/label.mjs"},"./form-field":{"types":"./form-field/index.d.ts","default":"./form-field/fesm2022/form-field.mjs"},"./popover":{"types":"./popover/index.d.ts","default":"./popover/fesm2022/popover.mjs"},"./calendar":{"types":"./calendar/index.d.ts","default":"./calendar/fesm2022/calendar.mjs"},"./date-picker":{"types":"./date-picker/index.d.ts","default":"./date-picker/fesm2022/date-picker.mjs"},"./dialog":{"types":"./dialog/index.d.ts","default":"./dialog/fesm2022/dialog.mjs"},"./radio-group":{"types":"./radio-group/index.d.ts","default":"./radio-group/fesm2022/radio-group.mjs"},"./separator":{"types":"./separator/index.d.ts","default":"./separator/fesm2022/separator.mjs"},"./tabs":{"types":"./tabs/index.d.ts","default":"./tabs/fesm2022/tabs.mjs"},"./tooltip":{"types":"./tooltip/index.d.ts","default":"./tooltip/fesm2022/tooltip.mjs"},"./form-select":{"types":"./form-select/index.d.ts","default":"./form-select/fesm2022/form-select.mjs"},"./form-text-input":{"types":"./form-text-input/index.d.ts","default":"./form-text-input/fesm2022/form-text-input.mjs"},"./form-textarea":{"types":"./form-textarea/index.d.ts","default":"./form-textarea/fesm2022/form-textarea.mjs"},"./form-date-picker":{"types":"./form-date-picker/index.d.ts","default":"./form-date-picker/fesm2022/form-date-picker.mjs"},"./basic-alert":{"types":"./basic-alert/index.d.ts","default":"./basic-alert/fesm2022/basic-alert.mjs"},"./confirmation-dialog":{"types":"./confirmation-dialog/index.d.ts","default":"./confirmation-dialog/fesm2022/confirmation-dialog.mjs"},"./sonner":{"types":"./sonner/index.d.ts","default":"./sonner/fesm2022/sonner.mjs"},"./autocomplete":{"types":"./autocomplete/index.d.ts","default":"./autocomplete/fesm2022/autocomplete.mjs"},"./searchable-multiselect":{"types":"./searchable-multiselect/index.d.ts","default":"./searchable-multiselect/fesm2022/searchable-multiselect.mjs"},"./form-searchable-multiselect":{"types":"./form-searchable-multiselect/index.d.ts","default":"./form-searchable-multiselect/fesm2022/form-searchable-multiselect.mjs"}}
|
|
1
|
+
{"./utils":{"types":"./utils/index.d.ts","default":"./utils/fesm2022/utils.mjs"},"./icon":{"types":"./icon/index.d.ts","default":"./icon/fesm2022/icon.mjs"},"./spinner":{"types":"./spinner/index.d.ts","default":"./spinner/fesm2022/spinner.mjs"},"./badge":{"types":"./badge/index.d.ts","default":"./badge/fesm2022/badge.mjs"},"./input":{"types":"./input/index.d.ts","default":"./input/fesm2022/input.mjs"},"./select":{"types":"./select/index.d.ts","default":"./select/fesm2022/select.mjs"},"./button":{"types":"./button/index.d.ts","default":"./button/fesm2022/button.mjs"},"./accordion":{"types":"./accordion/index.d.ts","default":"./accordion/fesm2022/accordion.mjs"},"./alert":{"types":"./alert/index.d.ts","default":"./alert/fesm2022/alert.mjs"},"./switch":{"types":"./switch/index.d.ts","default":"./switch/fesm2022/switch.mjs"},"./label":{"types":"./label/index.d.ts","default":"./label/fesm2022/label.mjs"},"./form-field":{"types":"./form-field/index.d.ts","default":"./form-field/fesm2022/form-field.mjs"},"./form-field-simple":{"types":"./form-field-simple/index.d.ts","default":"./form-field-simple/fesm2022/form-field-simple.mjs"},"./checkbox":{"types":"./checkbox/index.d.ts","default":"./checkbox/fesm2022/checkbox.mjs"},"./popover":{"types":"./popover/index.d.ts","default":"./popover/fesm2022/popover.mjs"},"./calendar":{"types":"./calendar/index.d.ts","default":"./calendar/fesm2022/calendar.mjs"},"./date-picker":{"types":"./date-picker/index.d.ts","default":"./date-picker/fesm2022/date-picker.mjs"},"./dialog":{"types":"./dialog/index.d.ts","default":"./dialog/fesm2022/dialog.mjs"},"./radio-group":{"types":"./radio-group/index.d.ts","default":"./radio-group/fesm2022/radio-group.mjs"},"./separator":{"types":"./separator/index.d.ts","default":"./separator/fesm2022/separator.mjs"},"./tabs":{"types":"./tabs/index.d.ts","default":"./tabs/fesm2022/tabs.mjs"},"./tooltip":{"types":"./tooltip/index.d.ts","default":"./tooltip/fesm2022/tooltip.mjs"},"./form-select":{"types":"./form-select/index.d.ts","default":"./form-select/fesm2022/form-select.mjs"},"./form-text-input":{"types":"./form-text-input/index.d.ts","default":"./form-text-input/fesm2022/form-text-input.mjs"},"./form-textarea":{"types":"./form-textarea/index.d.ts","default":"./form-textarea/fesm2022/form-textarea.mjs"},"./form-date-picker":{"types":"./form-date-picker/index.d.ts","default":"./form-date-picker/fesm2022/form-date-picker.mjs"},"./basic-alert":{"types":"./basic-alert/index.d.ts","default":"./basic-alert/fesm2022/basic-alert.mjs"},"./confirmation-dialog":{"types":"./confirmation-dialog/index.d.ts","default":"./confirmation-dialog/fesm2022/confirmation-dialog.mjs"},"./sonner":{"types":"./sonner/index.d.ts","default":"./sonner/fesm2022/sonner.mjs"},"./autocomplete":{"types":"./autocomplete/index.d.ts","default":"./autocomplete/fesm2022/autocomplete.mjs"},"./searchable-multiselect":{"types":"./searchable-multiselect/index.d.ts","default":"./searchable-multiselect/fesm2022/searchable-multiselect.mjs"},"./form-searchable-multiselect":{"types":"./form-searchable-multiselect/index.d.ts","default":"./form-searchable-multiselect/fesm2022/form-searchable-multiselect.mjs"},"./form-checkbox":{"types":"./form-checkbox/index.d.ts","default":"./form-checkbox/fesm2022/form-checkbox.mjs"}}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
# FormCheckbox
|
|
2
|
+
|
|
3
|
+
This project was generated using [Angular CLI](https://github.com/angular/angular-cli) version 20.3.0.
|
|
4
|
+
|
|
5
|
+
## Code scaffolding
|
|
6
|
+
|
|
7
|
+
Angular CLI includes powerful code scaffolding tools. To generate a new component, run:
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
ng generate component component-name
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
For a complete list of available schematics (such as `components`, `directives`, or `pipes`), run:
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
ng generate --help
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Building
|
|
20
|
+
|
|
21
|
+
To build the library, run:
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
ng build form-checkbox
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
This command will compile your project, and the build artifacts will be placed in the `dist/` directory.
|
|
28
|
+
|
|
29
|
+
### Publishing the Library
|
|
30
|
+
|
|
31
|
+
Once the project is built, you can publish your library by following these steps:
|
|
32
|
+
|
|
33
|
+
1. Navigate to the `dist` directory:
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
cd dist/form-checkbox
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
2. Run the `npm publish` command to publish your library to the npm registry:
|
|
40
|
+
```bash
|
|
41
|
+
npm publish
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## Running unit tests
|
|
45
|
+
|
|
46
|
+
To execute unit tests with the [Karma](https://karma-runner.github.io) test runner, use the following command:
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
ng test
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
## Running end-to-end tests
|
|
53
|
+
|
|
54
|
+
For end-to-end (e2e) testing, run:
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
ng e2e
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
Angular CLI does not come with an end-to-end testing framework by default. You can choose one that suits your needs.
|
|
61
|
+
|
|
62
|
+
## Additional Resources
|
|
63
|
+
|
|
64
|
+
For more information on using the Angular CLI, including detailed command references, visit the [Angular CLI Overview and Command Reference](https://angular.dev/tools/cli) page.
|