@seniorsistemas/angular-components 17.1.0 → 17.1.1
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/bundles/seniorsistemas-angular-components.umd.js +115 -107
- package/bundles/seniorsistemas-angular-components.umd.js.map +1 -1
- package/bundles/seniorsistemas-angular-components.umd.min.js +2 -2
- package/bundles/seniorsistemas-angular-components.umd.min.js.map +1 -1
- package/components/switch/switch.component.d.ts +1 -0
- package/components/table/table-paging/table-paging.component.d.ts +1 -0
- package/esm2015/components/accordion/accordion.module.js +3 -3
- package/esm2015/components/accordion/components/accordion-panel/accordion-panel.component.js +3 -3
- package/esm2015/components/dynamic-form/components/fields/boolean/boolean-switch-field.component.js +2 -2
- package/esm2015/components/dynamic-form/components/fields/chips/chips-field.component.js +3 -2
- package/esm2015/components/dynamic-form/dynamic-form.module.js +3 -3
- package/esm2015/components/switch/switch.component.js +6 -3
- package/esm2015/components/table/table-paging/table-paging.component.js +6 -2
- package/esm5/components/accordion/accordion.module.js +3 -3
- package/esm5/components/accordion/components/accordion-panel/accordion-panel.component.js +3 -3
- package/esm5/components/dynamic-form/components/fields/boolean/boolean-switch-field.component.js +2 -2
- package/esm5/components/dynamic-form/components/fields/chips/chips-field.component.js +3 -2
- package/esm5/components/dynamic-form/dynamic-form.module.js +3 -3
- package/esm5/components/switch/switch.component.js +6 -3
- package/esm5/components/table/table-paging/table-paging.component.js +6 -2
- package/fesm2015/seniorsistemas-angular-components.js +108 -101
- package/fesm2015/seniorsistemas-angular-components.js.map +1 -1
- package/fesm5/seniorsistemas-angular-components.js +113 -106
- package/fesm5/seniorsistemas-angular-components.js.map +1 -1
- package/package.json +1 -1
- package/seniorsistemas-angular-components.metadata.json +1 -1
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { __decorate, __rest, __awaiter, __param } from 'tslib';
|
|
2
|
-
import { EventEmitter, Input, Output, Component, ContentChildren, ɵɵdefineInjectable, Injectable, ElementRef, ApplicationRef, ComponentFactoryResolver, Injector,
|
|
2
|
+
import { EventEmitter, Input, Output, Component, ContentChildren, ViewChild, HostListener, forwardRef, NgModule, ɵɵdefineInjectable, Injectable, ElementRef, ApplicationRef, ComponentFactoryResolver, Injector, Directive, HostBinding, Renderer2, Pipe, ViewEncapsulation, InjectionToken, Inject, TemplateRef, ViewContainerRef, ChangeDetectorRef, Optional, ContentChild } from '@angular/core';
|
|
3
3
|
import { trigger, transition, style as style$7, animate, state, group, query, animateChild } from '@angular/animations';
|
|
4
4
|
import { CommonModule } from '@angular/common';
|
|
5
|
-
import { FormsModule, ReactiveFormsModule, FormControl,
|
|
5
|
+
import { NG_VALUE_ACCESSOR, FormsModule, ReactiveFormsModule, FormControl, FormGroup, NG_VALIDATORS, Validators, FormArray, ControlContainer } from '@angular/forms';
|
|
6
6
|
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
|
|
7
|
-
import { InputSwitchModule } from 'primeng/inputswitch';
|
|
8
7
|
import { RouterModule, NavigationEnd, PRIMARY_OUTLET, ActivatedRoute, Router } from '@angular/router';
|
|
9
8
|
import { BreadcrumbModule as BreadcrumbModule$1 } from 'primeng/breadcrumb';
|
|
10
9
|
import { Subject, of, from, forkJoin, throwError, ReplaySubject } from 'rxjs';
|
|
@@ -138,7 +137,7 @@ __decorate([
|
|
|
138
137
|
AccordionPanelComponent = __decorate([
|
|
139
138
|
Component({
|
|
140
139
|
selector: "s-accordion-panel",
|
|
141
|
-
template: "<div\n class=\"accordion-panel\"\n [ngClass]=\"{\n 'accordion-panel--open': isOpen,\n 'accordion-panel--disabled': disabled\n }\">\n <div class=\"header\" (click)=\"onTabClick()\">\n <div class=\"header__title\">\n <span class=\"icon\" [ngClass]=\"isOpen ? 'fas fa-minus' : 'fas fa-plus'\"></span>\n <span\n *ngIf=\"validationMessage\"\n class=\"exclamation-icon fas fa-exclamation-circle\"\n [sTooltip]=\"validationMessage\">\n </span>\n <span class=\"title\">{{ header }}</span>\n </div>\n <div class=\"header__controls\">\n <button\n *ngFor=\"let button of buttons\"\n class=\"icon-button\"\n [ngClass]=\"button.icon\"\n (click)=\"onIconButtonsClick($event, button.onClick)\">\n </button>\n <
|
|
140
|
+
template: "<div\n class=\"accordion-panel\"\n [ngClass]=\"{\n 'accordion-panel--open': isOpen,\n 'accordion-panel--disabled': disabled\n }\">\n <div class=\"header\" (click)=\"onTabClick()\">\n <div class=\"header__title\">\n <span class=\"icon\" [ngClass]=\"isOpen ? 'fas fa-minus' : 'fas fa-plus'\"></span>\n <span\n *ngIf=\"validationMessage\"\n class=\"exclamation-icon fas fa-exclamation-circle\"\n [sTooltip]=\"validationMessage\">\n </span>\n <span class=\"title\">{{ header }}</span>\n </div>\n <div class=\"header__controls\">\n <button\n *ngFor=\"let button of buttons\"\n class=\"icon-button\"\n [ngClass]=\"button.icon\"\n (click)=\"onIconButtonsClick($event, button.onClick)\">\n </button>\n <s-switch\n *ngIf=\"switch\"\n class=\"switch\"\n [disabled]=\"disabled\"\n [(ngModel)]=\"switchState\"\n (click)=\"$event.stopPropagation()\"\n (valueChanged)=\"switch.onChange($event)\">\n </s-switch>\n </div>\n </div>\n <ng-container *ngIf=\"cache; then cacheTemplate else cachelessTemplate\"></ng-container>\n</div>\n\n<ng-template #cacheTemplate>\n <div\n class=\"content\"\n [@cacheAnimation]=\"isOpen\"\n [@.disabled]=\"isContentAnimationDisabled\"\n (@cacheAnimation.start)=\"onContentAnimationStart()\"\n (@cacheAnimation.done)=\"onContentAnimationDone()\">\n <div class=\"content-container\">\n <ng-container [ngTemplateOutlet]=\"panelContent\"></ng-container>\n </div>\n </div>\n</ng-template>\n\n<ng-template #cachelessTemplate>\n <div\n *ngIf=\"isOpen\"\n class=\"content\"\n @cachelessAnimation\n [@.disabled]=\"isContentAnimationDisabled\"\n (@cachelessAnimation.start)=\"onContentAnimationStart()\"\n (@cachelessAnimation.done)=\"onContentAnimationDone()\">\n <div class=\"content-container\">\n <ng-container [ngTemplateOutlet]=\"panelContent\"></ng-container>\n </div>\n </div>\n</ng-template>\n\n<ng-template #panelContent>\n <ng-content></ng-content>\n</ng-template>",
|
|
142
141
|
animations: [
|
|
143
142
|
trigger("cachelessAnimation", [
|
|
144
143
|
transition(":enter", [style$7({ height: "0" }), animate("200ms linear", style$7({ height: "*" }))]),
|
|
@@ -150,7 +149,7 @@ AccordionPanelComponent = __decorate([
|
|
|
150
149
|
transition("* => *", animate("200ms")),
|
|
151
150
|
]),
|
|
152
151
|
],
|
|
153
|
-
styles: [".accordion-panel{border-bottom:1px solid #c1c1cc}.accordion-panel .header{-ms-flex-align:center;align-items:center;background-color:#fff;cursor:pointer;display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;padding:16px;-webkit-user-select:none;-ms-user-select:none;user-select:none}.accordion-panel .header .header__title{-ms-flex-align:center;align-items:center;display:-ms-flexbox;display:flex;-ms-flex-wrap:nowrap;flex-wrap:nowrap}.accordion-panel .header .header__title .icon{color:#212533;font-size:1rem;margin-right:12px}.accordion-panel .header .header__title .exclamation-icon{color:#c13018;font-size:1rem;margin-right:12px}.accordion-panel .header .header__title .title{font-family:\"Open Sans\" sans-serif;font-size:.875rem;font-weight:700;line-height:150%;text-transform:uppercase}.accordion-panel .header .header__controls{-ms-flex-align:center;align-items:center;display:-ms-flexbox;display:flex;margin-left:16px}.accordion-panel .header .header__controls .icon-button{color:#212533;cursor:pointer;font-size:1rem;margin-left:
|
|
152
|
+
styles: [".accordion-panel{border-bottom:1px solid #c1c1cc}.accordion-panel .header{-ms-flex-align:center;align-items:center;background-color:#fff;cursor:pointer;display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;padding:16px;-webkit-user-select:none;-ms-user-select:none;user-select:none}.accordion-panel .header .header__title{-ms-flex-align:center;align-items:center;display:-ms-flexbox;display:flex;-ms-flex-wrap:nowrap;flex-wrap:nowrap}.accordion-panel .header .header__title .icon{color:#212533;font-size:1rem;margin-right:12px}.accordion-panel .header .header__title .exclamation-icon{color:#c13018;font-size:1rem;margin-right:12px}.accordion-panel .header .header__title .title{font-family:\"Open Sans\" sans-serif;font-size:.875rem;font-weight:700;line-height:150%;text-transform:uppercase}.accordion-panel .header .header__controls{-ms-flex-align:center;align-items:center;display:-ms-flexbox;display:flex;margin-left:16px}.accordion-panel .header .header__controls .icon-button{color:#212533;cursor:pointer;font-size:1rem;margin-left:12px;padding:4px;border:none;background:0 0}.accordion-panel .header .header__controls .switch{padding-left:16px}.accordion-panel .content{background-color:#fff;overflow:hidden}.accordion-panel .content .content-container{margin:20px}.accordion-panel--open .header{background-color:#eeebf2;border-bottom:1px solid #c1c1cc}.accordion-panel--disabled .header{cursor:auto}.accordion-panel--disabled .header .header__title .icon,.accordion-panel--disabled .header .header__title .title{color:#c1c1cc}.accordion-panel--disabled .header .header__controls .icon-button{color:#c1c1cc;cursor:auto}"]
|
|
154
153
|
})
|
|
155
154
|
], AccordionPanelComponent);
|
|
156
155
|
|
|
@@ -227,6 +226,100 @@ AccordionComponent = __decorate([
|
|
|
227
226
|
})
|
|
228
227
|
], AccordionComponent);
|
|
229
228
|
|
|
229
|
+
var SwitchComponent_1;
|
|
230
|
+
let SwitchComponent = SwitchComponent_1 = class SwitchComponent {
|
|
231
|
+
constructor() {
|
|
232
|
+
this.readonly = false;
|
|
233
|
+
this.disabled = false;
|
|
234
|
+
this.valueChanged = new EventEmitter();
|
|
235
|
+
this.value = false;
|
|
236
|
+
}
|
|
237
|
+
onFocusIn() {
|
|
238
|
+
const switchElement = this.switchRef.nativeElement;
|
|
239
|
+
switchElement.classList.add("switch--focus");
|
|
240
|
+
}
|
|
241
|
+
onFocusOut() {
|
|
242
|
+
const switchElement = this.switchRef.nativeElement;
|
|
243
|
+
switchElement.classList.remove("switch--focus");
|
|
244
|
+
}
|
|
245
|
+
writeValue(value) {
|
|
246
|
+
if (!this.disabled) {
|
|
247
|
+
this.value = value;
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
registerOnChange(onChange) {
|
|
251
|
+
this._onChange = onChange;
|
|
252
|
+
}
|
|
253
|
+
registerOnTouched(onTouched) {
|
|
254
|
+
this._onTouched = onTouched;
|
|
255
|
+
}
|
|
256
|
+
setDisabledState(disabled) {
|
|
257
|
+
this.disabled = disabled;
|
|
258
|
+
}
|
|
259
|
+
toggleCheck() {
|
|
260
|
+
this.value = !this.value;
|
|
261
|
+
this.valueChanged.emit(this.value);
|
|
262
|
+
if (this._onChange) {
|
|
263
|
+
this._onChange(this.value);
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
};
|
|
267
|
+
__decorate([
|
|
268
|
+
Input()
|
|
269
|
+
], SwitchComponent.prototype, "readonly", void 0);
|
|
270
|
+
__decorate([
|
|
271
|
+
Input()
|
|
272
|
+
], SwitchComponent.prototype, "trueLabel", void 0);
|
|
273
|
+
__decorate([
|
|
274
|
+
Input()
|
|
275
|
+
], SwitchComponent.prototype, "falseLabel", void 0);
|
|
276
|
+
__decorate([
|
|
277
|
+
Input()
|
|
278
|
+
], SwitchComponent.prototype, "inputId", void 0);
|
|
279
|
+
__decorate([
|
|
280
|
+
Input()
|
|
281
|
+
], SwitchComponent.prototype, "inputName", void 0);
|
|
282
|
+
__decorate([
|
|
283
|
+
Input()
|
|
284
|
+
], SwitchComponent.prototype, "disabled", void 0);
|
|
285
|
+
__decorate([
|
|
286
|
+
Output()
|
|
287
|
+
], SwitchComponent.prototype, "valueChanged", void 0);
|
|
288
|
+
__decorate([
|
|
289
|
+
Input()
|
|
290
|
+
], SwitchComponent.prototype, "value", void 0);
|
|
291
|
+
__decorate([
|
|
292
|
+
ViewChild("switch", { static: true })
|
|
293
|
+
], SwitchComponent.prototype, "switchRef", void 0);
|
|
294
|
+
__decorate([
|
|
295
|
+
HostListener('focusin')
|
|
296
|
+
], SwitchComponent.prototype, "onFocusIn", null);
|
|
297
|
+
__decorate([
|
|
298
|
+
HostListener('focusout')
|
|
299
|
+
], SwitchComponent.prototype, "onFocusOut", null);
|
|
300
|
+
SwitchComponent = SwitchComponent_1 = __decorate([
|
|
301
|
+
Component({
|
|
302
|
+
selector: 's-switch',
|
|
303
|
+
template: "<div #switch class=\"switch\" [ngClass]=\"{ 'switch--disabled': disabled }\">\n <label class=\"switch-toggle\">\n <input\n #input\n [id]=\"inputId\"\n [name]=\"inputName\"\n type=\"checkbox\"\n [checked]=\"value\"\n [disabled]=\"readonly || disabled\"\n (change)=\"toggleCheck()\">\n <span class=\"slider\"></span>\n </label>\n <span class=\"label\">\n {{ value ? trueLabel : falseLabel }}\n </span>\n</div>",
|
|
304
|
+
providers: [{
|
|
305
|
+
provide: NG_VALUE_ACCESSOR,
|
|
306
|
+
useExisting: forwardRef(() => SwitchComponent_1),
|
|
307
|
+
multi: true,
|
|
308
|
+
}],
|
|
309
|
+
styles: [".switch{display:-ms-inline-flexbox;display:inline-flex;-ms-flex-align:center;align-items:center}.switch .switch-toggle{display:inline-block;height:24px;margin:0;position:relative;width:40px}.switch .switch-toggle input{height:0;opacity:0;width:0}.switch .switch-toggle input:checked+.slider{background-color:#428bca;border-radius:15px}.switch .switch-toggle input:checked+.slider:before{transform:translateX(16px)}.switch .switch-toggle .slider{background-color:#a5a5b2;border-radius:15px;bottom:0;cursor:pointer;left:0;position:absolute;right:0;top:0;transition:.4s}.switch .switch-toggle .slider:before{background-color:#fff;border-radius:50%;bottom:4px;content:\"\";height:16px;left:4px;position:absolute;transition:.4s;width:16px}.switch .label{color:#212533;font-family:\"Open Sans\" sans-serif;font-size:.875rem;font-weight:400;line-height:150%;margin-left:12px}.switch--disabled{opacity:.5}.switch--focus .switch-toggle .slider{box-shadow:0 0 0 2px #428BCA80}"]
|
|
310
|
+
})
|
|
311
|
+
], SwitchComponent);
|
|
312
|
+
|
|
313
|
+
let SwitchModule = class SwitchModule {
|
|
314
|
+
};
|
|
315
|
+
SwitchModule = __decorate([
|
|
316
|
+
NgModule({
|
|
317
|
+
imports: [CommonModule],
|
|
318
|
+
declarations: [SwitchComponent],
|
|
319
|
+
exports: [SwitchComponent],
|
|
320
|
+
})
|
|
321
|
+
], SwitchModule);
|
|
322
|
+
|
|
230
323
|
var TooltipPosition;
|
|
231
324
|
(function (TooltipPosition) {
|
|
232
325
|
TooltipPosition["Top"] = "top";
|
|
@@ -612,7 +705,7 @@ AccordionModule = __decorate([
|
|
|
612
705
|
FormsModule,
|
|
613
706
|
BrowserAnimationsModule,
|
|
614
707
|
TooltipModule,
|
|
615
|
-
|
|
708
|
+
SwitchModule,
|
|
616
709
|
],
|
|
617
710
|
declarations: [
|
|
618
711
|
AccordionComponent,
|
|
@@ -5675,6 +5768,7 @@ let TablePagingComponent = class TablePagingComponent {
|
|
|
5675
5768
|
constructor(translate, hostProjectConfigs) {
|
|
5676
5769
|
this.translate = translate;
|
|
5677
5770
|
this.hostProjectConfigs = hostProjectConfigs;
|
|
5771
|
+
this.exportable = true;
|
|
5678
5772
|
this.enableExportSelectedRecords = true;
|
|
5679
5773
|
}
|
|
5680
5774
|
ngOnChanges(changes) {
|
|
@@ -5866,6 +5960,9 @@ __decorate([
|
|
|
5866
5960
|
__decorate([
|
|
5867
5961
|
Input()
|
|
5868
5962
|
], TablePagingComponent.prototype, "table", void 0);
|
|
5963
|
+
__decorate([
|
|
5964
|
+
Input()
|
|
5965
|
+
], TablePagingComponent.prototype, "exportable", void 0);
|
|
5869
5966
|
__decorate([
|
|
5870
5967
|
Input()
|
|
5871
5968
|
], TablePagingComponent.prototype, "enableExportSelectedRecords", void 0);
|
|
@@ -5886,7 +5983,7 @@ __decorate([
|
|
|
5886
5983
|
], TablePagingComponent.prototype, "totalRecordsText", void 0);
|
|
5887
5984
|
TablePagingComponent = __decorate([
|
|
5888
5985
|
Component({
|
|
5889
|
-
template: "<div class=\"paging-container\">\n <span class=\"total-records\">\n {{totalRecordsText}}\n </span>\n <s-button
|
|
5986
|
+
template: "<div class=\"paging-container\">\n <span class=\"total-records\">\n {{totalRecordsText}}\n </span>\n <s-button\n *ngIf=\"exportable\"\n class=\"export-button\" \n priority=\"default\" \n iconClass=\"fa fa-fw fa-file-export\" \n [disabled]=\"false\" \n [auxiliary]=\"true\" \n [tooltip]=\"getTooltipText()\" \n [model]=\"getActions()\">\n </s-button>\n</div>\n",
|
|
5890
5987
|
selector: "s-table-paging",
|
|
5891
5988
|
styles: [".paging-container{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}.export-button{margin-left:6px}"]
|
|
5892
5989
|
}),
|
|
@@ -5983,7 +6080,8 @@ __decorate([
|
|
|
5983
6080
|
], ChipsFieldComponent.prototype, "formControl", void 0);
|
|
5984
6081
|
ChipsFieldComponent = __decorate([
|
|
5985
6082
|
Component({
|
|
5986
|
-
template: "<p-chips\n *ngIf=\"field.keyFilter\"\n [inputId]=\"(field.id || field.name)\"\n [formControl]=\"formControl\"\n [placeholder]=\"field.placeholder\"\n [allowDuplicate]=\"false\"\n [addOnTab]=\"true\"\n [addOnBlur]=\"true\"\n (onAdd)=\"field.onAdd ? field.onAdd($event) : null\"\n (onRemove)=\"field.onRemove ? field.onRemove($event) : null\"\n (onChipClick)=\"field.onChipClick ? field.onChipClick($event) : null\"\n (onFocus)=\"field.onFocus ? field.onFocus($event) : null\"\n (onBlur)=\"field.onBlur ? field.onBlur($event) : null\"\n [pKeyFilter]=\"field.keyFilter\">\n</p-chips>\n\n<p-chips\n *ngIf=\"!field.keyFilter\"\n [inputId]=\"(field.id || field.name)\"\n [formControl]=\"formControl\"\n [placeholder]=\"field.placeholder\"\n [allowDuplicate]=\"false\"\n [addOnTab]=\"true\"\n [addOnBlur]=\"true\"\n (onAdd)=\"field.onAdd ? field.onAdd($event) : null\"\n (onRemove)=\"field.onRemove ? field.onRemove($event) : null\"\n (onChipClick)=\"field.onChipClick ? field.onChipClick($event) : null\"\n (onFocus)=\"field.onFocus ? field.onFocus($event) : null\"\n (onBlur)=\"field.onBlur ? field.onBlur($event) : null\">\n</p-chips>\n"
|
|
6083
|
+
template: "<p-chips\n *ngIf=\"field.keyFilter\"\n [inputId]=\"(field.id || field.name)\"\n [formControl]=\"formControl\"\n [placeholder]=\"field.placeholder\"\n [allowDuplicate]=\"false\"\n [addOnTab]=\"true\"\n [addOnBlur]=\"true\"\n (onAdd)=\"field.onAdd ? field.onAdd($event) : null\"\n (onRemove)=\"field.onRemove ? field.onRemove($event) : null\"\n (onChipClick)=\"field.onChipClick ? field.onChipClick($event) : null\"\n (onFocus)=\"field.onFocus ? field.onFocus($event) : null\"\n (onBlur)=\"field.onBlur ? field.onBlur($event) : null\"\n [pKeyFilter]=\"field.keyFilter\">\n <ng-template let-item pTemplate=\"item\">\n <span\n class=\"chip-content\"\n [sTooltip]=\"item\">\n {{ item }}\n </span>\n </ng-template>\n</p-chips>\n\n<p-chips\n *ngIf=\"!field.keyFilter\"\n [inputId]=\"(field.id || field.name)\"\n [formControl]=\"formControl\"\n [placeholder]=\"field.placeholder\"\n [allowDuplicate]=\"false\"\n [addOnTab]=\"true\"\n [addOnBlur]=\"true\"\n (onAdd)=\"field.onAdd ? field.onAdd($event) : null\"\n (onRemove)=\"field.onRemove ? field.onRemove($event) : null\"\n (onChipClick)=\"field.onChipClick ? field.onChipClick($event) : null\"\n (onFocus)=\"field.onFocus ? field.onFocus($event) : null\"\n (onBlur)=\"field.onBlur ? field.onBlur($event) : null\">\n <ng-template let-item pTemplate=\"item\">\n <span\n class=\"chip-content\"\n [sTooltip]=\"item\">\n {{ item }}\n </span>\n </ng-template>\n</p-chips>\n",
|
|
6084
|
+
styles: [".chip-content{display:block;padding-right:1rem}"]
|
|
5987
6085
|
})
|
|
5988
6086
|
], ChipsFieldComponent);
|
|
5989
6087
|
|
|
@@ -6433,7 +6531,7 @@ __decorate([
|
|
|
6433
6531
|
], BooleanSwitchFieldComponent.prototype, "formControl", void 0);
|
|
6434
6532
|
BooleanSwitchFieldComponent = __decorate([
|
|
6435
6533
|
Component({
|
|
6436
|
-
template: "<div class=\"ui-grid ui-grid-responsive ui-grid-pad ui-fluid\">\n <div class=\"ui-grid-row\">\n <div class=\"i-grid-col-1\">\n <
|
|
6534
|
+
template: "<div class=\"ui-grid ui-grid-responsive ui-grid-pad ui-fluid\">\n <div class=\"ui-grid-row\">\n <div class=\"i-grid-col-1\">\n <s-switch\n [id]=\"(field.id || field.name)\"\n [inputName]=\"field.name\"\n [formControl]=\"formControl\"\n [sTooltip]=\"field.tooltip\"\n tooltipPosition=\"top\"\n (valueChanged)=\"field.onChange ? field.onChange($event) : null\">\n </s-switch>\n </div>\n <div class=\"i-grid-col-1\" *ngIf=\"field.optionsLabel\">\n <ng-container *ngIf=\"formControl.value; else caseFalse\">\n <span>{{ field.optionsLabel.true }}</span>\n </ng-container>\n <ng-template #caseFalse>\n <span>{{ field.optionsLabel.false }}</span>\n </ng-template>\n </div>\n </div>\n</div>"
|
|
6437
6535
|
})
|
|
6438
6536
|
], BooleanSwitchFieldComponent);
|
|
6439
6537
|
|
|
@@ -7243,7 +7341,7 @@ DynamicFormModule = __decorate([
|
|
|
7243
7341
|
MaskFormatterModule,
|
|
7244
7342
|
HotkeyModule.forRoot(),
|
|
7245
7343
|
MouseEventsModule,
|
|
7246
|
-
|
|
7344
|
+
SwitchModule,
|
|
7247
7345
|
PasswordStrengthModule,
|
|
7248
7346
|
SliderModule,
|
|
7249
7347
|
],
|
|
@@ -13259,97 +13357,6 @@ SplitButtonModule = __decorate([
|
|
|
13259
13357
|
})
|
|
13260
13358
|
], SplitButtonModule);
|
|
13261
13359
|
|
|
13262
|
-
var SwitchComponent_1;
|
|
13263
|
-
let SwitchComponent = SwitchComponent_1 = class SwitchComponent {
|
|
13264
|
-
constructor() {
|
|
13265
|
-
this.readonly = false;
|
|
13266
|
-
this.disabled = false;
|
|
13267
|
-
this.valueChanged = new EventEmitter();
|
|
13268
|
-
this.value = false;
|
|
13269
|
-
}
|
|
13270
|
-
onFocusIn() {
|
|
13271
|
-
const switchElement = this.switchRef.nativeElement;
|
|
13272
|
-
switchElement.classList.add("switch--focus");
|
|
13273
|
-
}
|
|
13274
|
-
onFocusOut() {
|
|
13275
|
-
const switchElement = this.switchRef.nativeElement;
|
|
13276
|
-
switchElement.classList.remove("switch--focus");
|
|
13277
|
-
}
|
|
13278
|
-
writeValue(value) {
|
|
13279
|
-
if (!this.disabled) {
|
|
13280
|
-
this.value = value;
|
|
13281
|
-
}
|
|
13282
|
-
}
|
|
13283
|
-
registerOnChange(onChange) {
|
|
13284
|
-
this._onChange = onChange;
|
|
13285
|
-
}
|
|
13286
|
-
registerOnTouched(onTouched) {
|
|
13287
|
-
this._onTouched = onTouched;
|
|
13288
|
-
}
|
|
13289
|
-
setDisabledState(disabled) {
|
|
13290
|
-
this.disabled = disabled;
|
|
13291
|
-
}
|
|
13292
|
-
toggleCheck() {
|
|
13293
|
-
this.value = !this.value;
|
|
13294
|
-
this.valueChanged.emit(this.value);
|
|
13295
|
-
if (this._onChange) {
|
|
13296
|
-
this._onChange(this.value);
|
|
13297
|
-
}
|
|
13298
|
-
}
|
|
13299
|
-
};
|
|
13300
|
-
__decorate([
|
|
13301
|
-
Input()
|
|
13302
|
-
], SwitchComponent.prototype, "readonly", void 0);
|
|
13303
|
-
__decorate([
|
|
13304
|
-
Input()
|
|
13305
|
-
], SwitchComponent.prototype, "trueLabel", void 0);
|
|
13306
|
-
__decorate([
|
|
13307
|
-
Input()
|
|
13308
|
-
], SwitchComponent.prototype, "falseLabel", void 0);
|
|
13309
|
-
__decorate([
|
|
13310
|
-
Input()
|
|
13311
|
-
], SwitchComponent.prototype, "inputId", void 0);
|
|
13312
|
-
__decorate([
|
|
13313
|
-
Input()
|
|
13314
|
-
], SwitchComponent.prototype, "disabled", void 0);
|
|
13315
|
-
__decorate([
|
|
13316
|
-
Output()
|
|
13317
|
-
], SwitchComponent.prototype, "valueChanged", void 0);
|
|
13318
|
-
__decorate([
|
|
13319
|
-
Input()
|
|
13320
|
-
], SwitchComponent.prototype, "value", void 0);
|
|
13321
|
-
__decorate([
|
|
13322
|
-
ViewChild("switch", { static: true })
|
|
13323
|
-
], SwitchComponent.prototype, "switchRef", void 0);
|
|
13324
|
-
__decorate([
|
|
13325
|
-
HostListener('focusin')
|
|
13326
|
-
], SwitchComponent.prototype, "onFocusIn", null);
|
|
13327
|
-
__decorate([
|
|
13328
|
-
HostListener('focusout')
|
|
13329
|
-
], SwitchComponent.prototype, "onFocusOut", null);
|
|
13330
|
-
SwitchComponent = SwitchComponent_1 = __decorate([
|
|
13331
|
-
Component({
|
|
13332
|
-
selector: 's-switch',
|
|
13333
|
-
template: "<div #switch class=\"switch\" [ngClass]=\"{ 'switch--disabled': disabled }\">\n <label class=\"switch-toggle\">\n <input\n #input\n [id]=\"inputId\"\n type=\"checkbox\"\n [checked]=\"value\"\n [disabled]=\"readonly || disabled\"\n (change)=\"toggleCheck()\">\n <span class=\"slider\"></span>\n </label>\n <span class=\"label\">\n {{ value ? trueLabel : falseLabel }}\n </span>\n</div>",
|
|
13334
|
-
providers: [{
|
|
13335
|
-
provide: NG_VALUE_ACCESSOR,
|
|
13336
|
-
useExisting: forwardRef(() => SwitchComponent_1),
|
|
13337
|
-
multi: true,
|
|
13338
|
-
}],
|
|
13339
|
-
styles: [".switch{display:-ms-inline-flexbox;display:inline-flex}.switch .switch-toggle{display:inline-block;height:24px;position:relative;width:40px}.switch .switch-toggle input{height:0;opacity:0;width:0}.switch .switch-toggle input:checked+.slider{background-color:#428bca;border-radius:15px}.switch .switch-toggle input:checked+.slider:before{transform:translateX(16px)}.switch .switch-toggle .slider{background-color:#a5a5b2;border-radius:15px;bottom:0;cursor:pointer;left:0;position:absolute;right:0;top:0;transition:.4s}.switch .switch-toggle .slider:before{background-color:#fff;border-radius:50%;bottom:4px;content:\"\";height:16px;left:4px;position:absolute;transition:.4s;width:16px}.switch .label{color:#212533;font-family:\"Open Sans\" sans-serif;font-size:.875rem;font-weight:400;line-height:150%;margin-left:12px}.switch--disabled{opacity:.5}.switch--focus .switch-toggle .slider{box-shadow:0 0 0 2px #428BCA80}"]
|
|
13340
|
-
})
|
|
13341
|
-
], SwitchComponent);
|
|
13342
|
-
|
|
13343
|
-
let SwitchModule = class SwitchModule {
|
|
13344
|
-
};
|
|
13345
|
-
SwitchModule = __decorate([
|
|
13346
|
-
NgModule({
|
|
13347
|
-
imports: [CommonModule],
|
|
13348
|
-
declarations: [SwitchComponent],
|
|
13349
|
-
exports: [SwitchComponent],
|
|
13350
|
-
})
|
|
13351
|
-
], SwitchModule);
|
|
13352
|
-
|
|
13353
13360
|
let PanelComponent = class PanelComponent {
|
|
13354
13361
|
constructor() {
|
|
13355
13362
|
this.toggleable = true;
|