@indice/ng-components 0.2.167-beta.35 → 0.2.167-beta.37

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.
@@ -2396,6 +2396,89 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0", ngImpor
2396
2396
  type: Input
2397
2397
  }] } });
2398
2398
 
2399
+ class ToggleButtonComponent {
2400
+ constructor() {
2401
+ this.value = false;
2402
+ this.disabled = false;
2403
+ this.icon = true;
2404
+ this.valueChange = new EventEmitter();
2405
+ this.onChange$ = undefined;
2406
+ this.onTouched$ = undefined;
2407
+ }
2408
+ ngOnInit() {
2409
+ }
2410
+ writeValue(obj) {
2411
+ if (obj) {
2412
+ this.value = obj || false;
2413
+ }
2414
+ }
2415
+ registerOnChange(fn) {
2416
+ this.onChange$ = fn;
2417
+ }
2418
+ registerOnTouched(fn) {
2419
+ this.onTouched$ = fn;
2420
+ }
2421
+ onBlur(event) {
2422
+ if (this.onTouched$) {
2423
+ this.onTouched$();
2424
+ }
2425
+ }
2426
+ changeValue() {
2427
+ this.value = !this.value;
2428
+ this.valueChange.emit(this.value);
2429
+ if (this.onChange$) {
2430
+ this.onChange$(this.value);
2431
+ }
2432
+ if (this.onTouched$) {
2433
+ this.onTouched$();
2434
+ }
2435
+ }
2436
+ }
2437
+ ToggleButtonComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0", ngImport: i0, type: ToggleButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
2438
+ ToggleButtonComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.0", type: ToggleButtonComponent, selector: "lib-toggle-button", inputs: { value: "value", disabled: "disabled", icon: "icon", text: "text", textTrue: ["text-true", "textTrue"], textFalse: ["text-false", "textFalse"], description: "description", descriptionTrue: ["description-true", "descriptionTrue"], descriptionFalse: ["description-false", "descriptionFalse"] }, outputs: { valueChange: "valueChange" }, providers: [
2439
+ {
2440
+ provide: NG_VALUE_ACCESSOR,
2441
+ useExisting: forwardRef(() => ToggleButtonComponent),
2442
+ multi: true
2443
+ }
2444
+ ], ngImport: i0, template: "<!-- Enabled: \"bg-indigo-600\", Not Enabled: \"bg-gray-200\" -->\n<div class=\"flex items-center\">\n<button type=\"button\"\n (click)=\"changeValue()\"\n [disabled]=\"disabled\"\n class=\"toggle-button-button\" \n [class.toggle-button-bg-false] = \"!value\"\n [class.toggle-button-bg-true] = \"value\"\n [class.toggle-button-button-disabled]=\"disabled\"\n role=\"switch\" \n aria-checked=\"false\">\n <span class=\"sr-only\">{{value ? textTrue : textFalse}}</span>\n <!-- Enabled: \"translate-x-5\", Not Enabled: \"translate-x-0\" -->\n <span \n class=\"toggle-button-icon-container\"\n [class.toggle-button-icon-container-false] = \"!value\"\n [class.toggle-button-icon-container-true] = \"value\">\n <!-- Enabled: \"opacity-0 ease-out duration-100\", Not Enabled: \"opacity-100 ease-in duration-200\" -->\n <span \n [class.toggle-button-container-inner-true]=\"value\"\n [class.toggle-button-container-inner-false]=\"!value\"\n class=\"toggle-button-icon-container-inner\"\n aria-hidden=\"true\">\n <svg *ngIf=\"icon\" class=\"toggle-button-icon\" fill=\"none\" viewBox=\"0 0 12 12\">\n <path d=\"M4 8l2-2m0 0l2-2M6 6L4 4m2 2l2 2\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" />\n </svg>\n </span>\n <!-- Enabled: \"opacity-0 ease-out duration-100\", Not Enabled: \"opacity-100 ease-in duration-200\" -->\n <span \n [class.toggle-button-container-inner-true]=\"!value\"\n [class.toggle-button-container-inner-false]=\"value\"\n class=\"toggle-button-icon-container-inner\"\n aria-hidden=\"true\">\n <svg *ngIf=\"icon\" class=\"toggle-button-icon\" fill=\"currentColor\" viewBox=\"0 0 12 12\">\n <path d=\"M3.707 5.293a1 1 0 00-1.414 1.414l1.414-1.414zM5 8l-.707.707a1 1 0 001.414 0L5 8zm4.707-3.293a1 1 0 00-1.414-1.414l1.414 1.414zm-7.414 2l2 2 1.414-1.414-2-2-1.414 1.414zm3.414 2l4-4-1.414-1.414-4 4 1.414 1.414z\" />\n </svg>\n </span>\n </span>\n</button>\n<span class=\"ml-3\" id=\"toggle-button-labels\">\n <div class=\"toggle-button-text\">{{value ? textTrue : textFalse}}</div>\n <div *ngIf=\"text\" class=\"toggle-button-text\">{{text}}</div>\n <div *ngIf=\"description\" class=\"toggle-button-description\">{{description}}</div>\n <div class=\"toggle-button-description\">{{value ? descriptionTrue : descriptionFalse}}</div>\n</span>\n</div>", dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
2445
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0", ngImport: i0, type: ToggleButtonComponent, decorators: [{
2446
+ type: Component,
2447
+ args: [{ selector: 'lib-toggle-button', providers: [
2448
+ {
2449
+ provide: NG_VALUE_ACCESSOR,
2450
+ useExisting: forwardRef(() => ToggleButtonComponent),
2451
+ multi: true
2452
+ }
2453
+ ], template: "<!-- Enabled: \"bg-indigo-600\", Not Enabled: \"bg-gray-200\" -->\n<div class=\"flex items-center\">\n<button type=\"button\"\n (click)=\"changeValue()\"\n [disabled]=\"disabled\"\n class=\"toggle-button-button\" \n [class.toggle-button-bg-false] = \"!value\"\n [class.toggle-button-bg-true] = \"value\"\n [class.toggle-button-button-disabled]=\"disabled\"\n role=\"switch\" \n aria-checked=\"false\">\n <span class=\"sr-only\">{{value ? textTrue : textFalse}}</span>\n <!-- Enabled: \"translate-x-5\", Not Enabled: \"translate-x-0\" -->\n <span \n class=\"toggle-button-icon-container\"\n [class.toggle-button-icon-container-false] = \"!value\"\n [class.toggle-button-icon-container-true] = \"value\">\n <!-- Enabled: \"opacity-0 ease-out duration-100\", Not Enabled: \"opacity-100 ease-in duration-200\" -->\n <span \n [class.toggle-button-container-inner-true]=\"value\"\n [class.toggle-button-container-inner-false]=\"!value\"\n class=\"toggle-button-icon-container-inner\"\n aria-hidden=\"true\">\n <svg *ngIf=\"icon\" class=\"toggle-button-icon\" fill=\"none\" viewBox=\"0 0 12 12\">\n <path d=\"M4 8l2-2m0 0l2-2M6 6L4 4m2 2l2 2\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" />\n </svg>\n </span>\n <!-- Enabled: \"opacity-0 ease-out duration-100\", Not Enabled: \"opacity-100 ease-in duration-200\" -->\n <span \n [class.toggle-button-container-inner-true]=\"!value\"\n [class.toggle-button-container-inner-false]=\"value\"\n class=\"toggle-button-icon-container-inner\"\n aria-hidden=\"true\">\n <svg *ngIf=\"icon\" class=\"toggle-button-icon\" fill=\"currentColor\" viewBox=\"0 0 12 12\">\n <path d=\"M3.707 5.293a1 1 0 00-1.414 1.414l1.414-1.414zM5 8l-.707.707a1 1 0 001.414 0L5 8zm4.707-3.293a1 1 0 00-1.414-1.414l1.414 1.414zm-7.414 2l2 2 1.414-1.414-2-2-1.414 1.414zm3.414 2l4-4-1.414-1.414-4 4 1.414 1.414z\" />\n </svg>\n </span>\n </span>\n</button>\n<span class=\"ml-3\" id=\"toggle-button-labels\">\n <div class=\"toggle-button-text\">{{value ? textTrue : textFalse}}</div>\n <div *ngIf=\"text\" class=\"toggle-button-text\">{{text}}</div>\n <div *ngIf=\"description\" class=\"toggle-button-description\">{{description}}</div>\n <div class=\"toggle-button-description\">{{value ? descriptionTrue : descriptionFalse}}</div>\n</span>\n</div>" }]
2454
+ }], ctorParameters: function () { return []; }, propDecorators: { value: [{
2455
+ type: Input
2456
+ }], disabled: [{
2457
+ type: Input
2458
+ }], icon: [{
2459
+ type: Input
2460
+ }], text: [{
2461
+ type: Input,
2462
+ args: ['text']
2463
+ }], textTrue: [{
2464
+ type: Input,
2465
+ args: ['text-true']
2466
+ }], textFalse: [{
2467
+ type: Input,
2468
+ args: ['text-false']
2469
+ }], description: [{
2470
+ type: Input,
2471
+ args: ['description']
2472
+ }], descriptionTrue: [{
2473
+ type: Input,
2474
+ args: ['description-true']
2475
+ }], descriptionFalse: [{
2476
+ type: Input,
2477
+ args: ['description-false']
2478
+ }], valueChange: [{
2479
+ type: Output
2480
+ }] } });
2481
+
2399
2482
  class DynamicComponentHostDirective {
2400
2483
  constructor(viewContainerRef) {
2401
2484
  this.viewContainerRef = viewContainerRef;
@@ -4381,7 +4464,8 @@ IndiceComponentsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0",
4381
4464
  ToggleComponent,
4382
4465
  UnauthorizedComponent,
4383
4466
  UserProfileMenuComponent,
4384
- ViewLayoutComponent], imports: [CommonModule,
4467
+ ViewLayoutComponent,
4468
+ ToggleButtonComponent], imports: [CommonModule,
4385
4469
  RouterModule,
4386
4470
  IndiceAuthModule,
4387
4471
  FormsModule], exports: [AddressPipe,
@@ -4424,7 +4508,8 @@ IndiceComponentsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0",
4424
4508
  ToasterContainerComponent,
4425
4509
  ToggleComponent,
4426
4510
  UnauthorizedComponent,
4427
- ViewLayoutComponent] });
4511
+ ViewLayoutComponent,
4512
+ ToggleButtonComponent] });
4428
4513
  IndiceComponentsModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.0.0", ngImport: i0, type: IndiceComponentsModule, imports: [CommonModule,
4429
4514
  RouterModule,
4430
4515
  IndiceAuthModule,
@@ -4483,7 +4568,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0", ngImpor
4483
4568
  ToggleComponent,
4484
4569
  UnauthorizedComponent,
4485
4570
  UserProfileMenuComponent,
4486
- ViewLayoutComponent
4571
+ ViewLayoutComponent,
4572
+ ToggleButtonComponent
4487
4573
  ],
4488
4574
  imports: [
4489
4575
  CommonModule,
@@ -4532,7 +4618,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0", ngImpor
4532
4618
  ToasterContainerComponent,
4533
4619
  ToggleComponent,
4534
4620
  UnauthorizedComponent,
4535
- ViewLayoutComponent
4621
+ ViewLayoutComponent,
4622
+ ToggleButtonComponent
4536
4623
  ]
4537
4624
  }]
4538
4625
  }] });
@@ -4543,5 +4630,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0", ngImpor
4543
4630
  * Generated bundle index. Do not edit.
4544
4631
  */
4545
4632
 
4546
- export { APP_LANGUAGES, APP_LINKS, APP_NOTIFICATIONS, AddressPipe, AuthCallbackComponent, AuthRenewComponent, AvatarInitialsComponent, BaseListComponent, BreadcrumbComponent, BreadcrumbItem, BreadcrumbRouteData, BreadcrumbService, ClickOutsideDirective, CollapsiblePanelComponent, ComboboxComponent, ComponentLoaderFactory, DatepickerComponent, DefaultShellConfig, DropDownMenuComponent, DurationFormatPipe, ErrorComponent, ExternalNavLink, FormLayoutComponent, FragmentNavLink, HeaderMetaItem, Icons, IndiceComponentsModule, KpiTileComponent, LIBSTEPPER_ACCESSOR, LIBTABGROUP_ACCESSOR, LibStepComponent, LibStepInfoDirective, LibStepLabelDirective, LibStepperComponent, LibTabComponent, LibTabGroupComponent, LibTabLabelDirective, ListColumnComponent, ListDetailsSectionComponent, ListTileComponent, ListViewComponent, ListViewEmptyStateComponent, ListViewType, LoggedOutComponent, MODAL_CONFIG_DEFAULT_OVERRIDE, MenuOption, Modal, ModalOptions, ModalService, ModelViewLayoutComponent, NULL_TOAST, NavLink, NavLinksListComponent, NotificationNavLink, PageNotFoundComponent, PagerComponent, PagerPosition, RouterViewAction, SCREEN_SIZE, SHELL_CONFIG, ShellFooterComponent, ShellHeaderComponent, ShellLayoutComponent, ShellLayoutType, ShellSidebarComponent, ShellSidebarHeaderComponent, SidePaneComponent, SidePaneOverlayType, SidePaneSize, SideViewLayoutComponent, SkeletonLoaderComponent, StepState, StepperType, SwitchViewAction, ToastType, ToasterComponent, ToasterContainerComponent, ToasterService, ToggleComponent, UnauthorizedComponent, UserSettingsService, ViewAction, ViewLayoutComponent };
4633
+ export { APP_LANGUAGES, APP_LINKS, APP_NOTIFICATIONS, AddressPipe, AuthCallbackComponent, AuthRenewComponent, AvatarInitialsComponent, BaseListComponent, BreadcrumbComponent, BreadcrumbItem, BreadcrumbRouteData, BreadcrumbService, ClickOutsideDirective, CollapsiblePanelComponent, ComboboxComponent, ComponentLoaderFactory, DatepickerComponent, DefaultShellConfig, DropDownMenuComponent, DurationFormatPipe, ErrorComponent, ExternalNavLink, FormLayoutComponent, FragmentNavLink, HeaderMetaItem, Icons, IndiceComponentsModule, KpiTileComponent, LIBSTEPPER_ACCESSOR, LIBTABGROUP_ACCESSOR, LibStepComponent, LibStepInfoDirective, LibStepLabelDirective, LibStepperComponent, LibTabComponent, LibTabGroupComponent, LibTabLabelDirective, ListColumnComponent, ListDetailsSectionComponent, ListTileComponent, ListViewComponent, ListViewEmptyStateComponent, ListViewType, LoggedOutComponent, MODAL_CONFIG_DEFAULT_OVERRIDE, MenuOption, Modal, ModalOptions, ModalService, ModelViewLayoutComponent, NULL_TOAST, NavLink, NavLinksListComponent, NotificationNavLink, PageNotFoundComponent, PagerComponent, PagerPosition, RouterViewAction, SCREEN_SIZE, SHELL_CONFIG, ShellFooterComponent, ShellHeaderComponent, ShellLayoutComponent, ShellLayoutType, ShellSidebarComponent, ShellSidebarHeaderComponent, SidePaneComponent, SidePaneOverlayType, SidePaneSize, SideViewLayoutComponent, SkeletonLoaderComponent, StepState, StepperType, SwitchViewAction, ToastType, ToasterComponent, ToasterContainerComponent, ToasterService, ToggleButtonComponent, ToggleComponent, UnauthorizedComponent, UserSettingsService, ViewAction, ViewLayoutComponent };
4547
4634
  //# sourceMappingURL=indice-ng-components.mjs.map