@spicainternational/ngx-sds-components 5.24.0 → 5.25.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/esm2020/public-api.mjs +2 -1
- package/esm2020/src/lib/message/message.component.mjs +3 -3
- package/esm2020/src/lib/modal/dialog/dialog.component.mjs +21 -5
- package/esm2020/src/lib/modal/modal.component.mjs +26 -3
- package/esm2020/src/lib/table-actions/public-api.mjs +3 -0
- package/esm2020/src/lib/table-actions/spicainternational-ngx-sds-components-src-lib-table-actions.mjs +5 -0
- package/esm2020/src/lib/table-actions/table-actions.component.mjs +32 -0
- package/esm2020/src/lib/table-actions/table-actions.model.mjs +2 -0
- package/esm2020/src/lib/table-actions/table-actions.module.mjs +34 -0
- package/fesm2015/spicainternational-ngx-sds-components-src-lib-message.mjs +2 -2
- package/fesm2015/spicainternational-ngx-sds-components-src-lib-message.mjs.map +1 -1
- package/fesm2015/spicainternational-ngx-sds-components-src-lib-modal.mjs +45 -6
- package/fesm2015/spicainternational-ngx-sds-components-src-lib-modal.mjs.map +1 -1
- package/fesm2015/spicainternational-ngx-sds-components-src-lib-table-actions.mjs +71 -0
- package/fesm2015/spicainternational-ngx-sds-components-src-lib-table-actions.mjs.map +1 -0
- package/fesm2015/spicainternational-ngx-sds-components.mjs +1 -0
- package/fesm2015/spicainternational-ngx-sds-components.mjs.map +1 -1
- package/fesm2020/spicainternational-ngx-sds-components-src-lib-message.mjs +2 -2
- package/fesm2020/spicainternational-ngx-sds-components-src-lib-message.mjs.map +1 -1
- package/fesm2020/spicainternational-ngx-sds-components-src-lib-modal.mjs +45 -6
- package/fesm2020/spicainternational-ngx-sds-components-src-lib-modal.mjs.map +1 -1
- package/fesm2020/spicainternational-ngx-sds-components-src-lib-table-actions.mjs +70 -0
- package/fesm2020/spicainternational-ngx-sds-components-src-lib-table-actions.mjs.map +1 -0
- package/fesm2020/spicainternational-ngx-sds-components.mjs +1 -0
- package/fesm2020/spicainternational-ngx-sds-components.mjs.map +1 -1
- package/package.json +10 -1
- package/public-api.d.ts +1 -0
- package/src/lib/message/message.component.d.ts +1 -1
- package/src/lib/modal/dialog/dialog.component.d.ts +9 -2
- package/src/lib/modal/modal.component.d.ts +11 -3
- package/src/lib/table-actions/package.json +10 -0
- package/src/lib/table-actions/public-api.d.ts +2 -0
- package/src/lib/table-actions/spicainternational-ngx-sds-components-src-lib-table-actions.d.ts +5 -0
- package/src/lib/table-actions/table-actions.component.d.ts +16 -0
- package/src/lib/table-actions/table-actions.model.d.ts +13 -0
- package/src/lib/table-actions/table-actions.module.d.ts +10 -0
|
@@ -17,16 +17,34 @@ class SdsModalComponent {
|
|
|
17
17
|
this.autoFocusCloseButton = false;
|
|
18
18
|
this.isScrollable = true;
|
|
19
19
|
this.closeOnEscape = false;
|
|
20
|
+
/**
|
|
21
|
+
* @deprecated Use isOpenChange instead
|
|
22
|
+
*/
|
|
20
23
|
this.modalOpen = new EventEmitter();
|
|
24
|
+
/**
|
|
25
|
+
* @deprecated Use isOpenChange instead
|
|
26
|
+
*/
|
|
21
27
|
this.modalClose = new EventEmitter();
|
|
22
28
|
this.closeClick = new EventEmitter();
|
|
23
29
|
this.closeEscapeKeypress = new EventEmitter();
|
|
24
30
|
this.closeIcon = faXmark;
|
|
31
|
+
// public isOpen: boolean = false;
|
|
25
32
|
this.isOpen = false;
|
|
33
|
+
this.isOpenChange = new EventEmitter();
|
|
26
34
|
this.translations = {
|
|
27
35
|
close: undefined
|
|
28
36
|
};
|
|
29
37
|
}
|
|
38
|
+
ngOnChanges(changes) {
|
|
39
|
+
if (changes['isOpen']) {
|
|
40
|
+
if (this.isOpen) {
|
|
41
|
+
this.open();
|
|
42
|
+
}
|
|
43
|
+
else {
|
|
44
|
+
this.close();
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
30
48
|
ngOnInit() { }
|
|
31
49
|
open() {
|
|
32
50
|
if (this._modal != undefined) {
|
|
@@ -42,6 +60,7 @@ class SdsModalComponent {
|
|
|
42
60
|
this._modal.nativeElement.style.display = 'none';
|
|
43
61
|
this.isOpen = false;
|
|
44
62
|
this.modalClose.emit();
|
|
63
|
+
this.isOpenChange.emit(this.isOpen);
|
|
45
64
|
}
|
|
46
65
|
}
|
|
47
66
|
onCloseButtonClick() {
|
|
@@ -60,10 +79,10 @@ class SdsModalComponent {
|
|
|
60
79
|
}
|
|
61
80
|
}
|
|
62
81
|
SdsModalComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.1", ngImport: i0, type: SdsModalComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
63
|
-
SdsModalComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.1", type: SdsModalComponent, selector: "sds-modal", inputs: { modalTitle: "modalTitle", showHeader: "showHeader", showFooter: "showFooter", size: "size", modalDialogId: "modalDialogId", showCloseButton: "showCloseButton", autoFocusCloseButton: "autoFocusCloseButton", translations: "translations", isScrollable: "isScrollable", closeOnEscape: "closeOnEscape" }, outputs: { modalOpen: "modalOpen", modalClose: "modalClose", closeClick: "closeClick", closeEscapeKeypress: "closeEscapeKeypress" }, queries: [{ propertyName: "headerContent", first: true, predicate: ["header"], descendants: true }], viewQueries: [{ propertyName: "_modal", first: true, predicate: ["modal"], descendants: true }, { propertyName: "_closeButton", first: true, predicate: ["closeButton"], descendants: true }], ngImport: i0, template: "<div #modal class=\"modal\" (keydown)=\"onKeydown($event)\" [cdkTrapFocus]=\"isOpen\" [cdkTrapFocusAutoCapture]=\"true\" >\r\n <div\r\n class=\"modal-dialog modal-dialog-centered\"\r\n [class.modal-dialog-scrollable] = \"isScrollable\"\r\n [attr.id]=\"modalDialogId\"\r\n [ngClass]=\"'modal-' + size\"\r\n role=\"document\"\r\n >\r\n <div class=\"modal-content\">\r\n\r\n <div *ngIf=\"showHeader && headerContent\" class=\"modal-header\">\r\n <ng-content select='header'></ng-content>\r\n </div> \r\n\r\n <div \r\n *ngIf=\"showHeader && !headerContent\" \r\n class=\"modal-header\"\r\n >\r\n <h5 class=\"modal-title\">{{modalTitle}}</h5>\r\n <button \r\n #closeButton\r\n *ngIf=\"showCloseButton\"\r\n type=\"button\" \r\n class=\"btn-close\" \r\n [title]=\"translations.close ?? ''\"\r\n (click)=\"onCloseButtonClick()\">\r\n </button>\r\n </div>\r\n\r\n <div \r\n class=\"modal-body\"\r\n [class.pt-0]=\"showHeader\"\r\n [class.pb-0]=\"showFooter\"\r\n >\r\n <ng-content></ng-content>\r\n </div>\r\n\r\n <div *ngIf=\"showFooter\" class=\"modal-footer\">\r\n <ng-content select=\"footer\"></ng-content>\r\n </div> \r\n </div>\r\n </div>\r\n</div>", styles: [".modal{background:rgba(0,0,0,.5)}.modal .modal-header button.btn-close:hover{background-color:#e9ecef}.modal.in{opacity:1}.modal.in .modal-dialog{transform:translate(0)}.modal-backdrop.fade{filter:alpha(opacity=0);opacity:0}.modal-backdrop.in{filter:alpha(opacity=50);opacity:.5}@media (min-width: 820px){.modal-820{max-width:820px}}\n"], directives: [{ type: i1.CdkTrapFocus, selector: "[cdkTrapFocus]", inputs: ["cdkTrapFocus", "cdkTrapFocusAutoCapture"], exportAs: ["cdkTrapFocus"] }, { type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
|
|
82
|
+
SdsModalComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.1", type: SdsModalComponent, selector: "sds-modal", inputs: { modalTitle: "modalTitle", showHeader: "showHeader", showFooter: "showFooter", size: "size", modalDialogId: "modalDialogId", showCloseButton: "showCloseButton", autoFocusCloseButton: "autoFocusCloseButton", translations: "translations", isScrollable: "isScrollable", closeOnEscape: "closeOnEscape", isOpen: "isOpen" }, outputs: { modalOpen: "modalOpen", modalClose: "modalClose", closeClick: "closeClick", closeEscapeKeypress: "closeEscapeKeypress", isOpenChange: "isOpenChange" }, queries: [{ propertyName: "headerContent", first: true, predicate: ["header"], descendants: true }], viewQueries: [{ propertyName: "_modal", first: true, predicate: ["modal"], descendants: true }, { propertyName: "_closeButton", first: true, predicate: ["closeButton"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "<div #modal class=\"modal\" (keydown)=\"onKeydown($event)\" [cdkTrapFocus]=\"isOpen\" [cdkTrapFocusAutoCapture]=\"true\" >\r\n <div\r\n class=\"modal-dialog modal-dialog-centered\"\r\n [class.modal-dialog-scrollable] = \"isScrollable\"\r\n [attr.id]=\"modalDialogId\"\r\n [ngClass]=\"'modal-' + size\"\r\n role=\"document\"\r\n >\r\n <div class=\"modal-content\">\r\n\r\n <div *ngIf=\"showHeader && headerContent\" class=\"modal-header\">\r\n <ng-content select='header'></ng-content>\r\n </div> \r\n\r\n <div \r\n *ngIf=\"showHeader && !headerContent\" \r\n class=\"modal-header\"\r\n >\r\n <h5 class=\"modal-title\">{{modalTitle}}</h5>\r\n <button \r\n #closeButton\r\n *ngIf=\"showCloseButton\"\r\n type=\"button\" \r\n class=\"btn-close sds-fs-75\" \r\n [title]=\"translations.close ?? ''\"\r\n (click)=\"onCloseButtonClick()\">\r\n </button>\r\n </div>\r\n\r\n <div \r\n class=\"modal-body\"\r\n [class.pt-0]=\"showHeader\"\r\n [class.pb-0]=\"showFooter\"\r\n >\r\n <ng-content></ng-content>\r\n </div>\r\n\r\n <div *ngIf=\"showFooter\" class=\"modal-footer\">\r\n <ng-content select=\"footer\"></ng-content>\r\n </div> \r\n </div>\r\n </div>\r\n</div>", styles: [".modal{background:rgba(0,0,0,.5)}.modal .modal-header button.btn-close{font-size:.75em}.modal .modal-header button.btn-close:hover{background-color:#e9ecef}.modal.in{opacity:1}.modal.in .modal-dialog{transform:translate(0)}.modal-backdrop.fade{filter:alpha(opacity=0);opacity:0}.modal-backdrop.in{filter:alpha(opacity=50);opacity:.5}@media (min-width: 820px){.modal-820{max-width:820px}}\n"], directives: [{ type: i1.CdkTrapFocus, selector: "[cdkTrapFocus]", inputs: ["cdkTrapFocus", "cdkTrapFocusAutoCapture"], exportAs: ["cdkTrapFocus"] }, { type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
|
|
64
83
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.1", ngImport: i0, type: SdsModalComponent, decorators: [{
|
|
65
84
|
type: Component,
|
|
66
|
-
args: [{ selector: 'sds-modal', template: "<div #modal class=\"modal\" (keydown)=\"onKeydown($event)\" [cdkTrapFocus]=\"isOpen\" [cdkTrapFocusAutoCapture]=\"true\" >\r\n <div\r\n class=\"modal-dialog modal-dialog-centered\"\r\n [class.modal-dialog-scrollable] = \"isScrollable\"\r\n [attr.id]=\"modalDialogId\"\r\n [ngClass]=\"'modal-' + size\"\r\n role=\"document\"\r\n >\r\n <div class=\"modal-content\">\r\n\r\n <div *ngIf=\"showHeader && headerContent\" class=\"modal-header\">\r\n <ng-content select='header'></ng-content>\r\n </div> \r\n\r\n <div \r\n *ngIf=\"showHeader && !headerContent\" \r\n class=\"modal-header\"\r\n >\r\n <h5 class=\"modal-title\">{{modalTitle}}</h5>\r\n <button \r\n #closeButton\r\n *ngIf=\"showCloseButton\"\r\n type=\"button\" \r\n class=\"btn-close\" \r\n [title]=\"translations.close ?? ''\"\r\n (click)=\"onCloseButtonClick()\">\r\n </button>\r\n </div>\r\n\r\n <div \r\n class=\"modal-body\"\r\n [class.pt-0]=\"showHeader\"\r\n [class.pb-0]=\"showFooter\"\r\n >\r\n <ng-content></ng-content>\r\n </div>\r\n\r\n <div *ngIf=\"showFooter\" class=\"modal-footer\">\r\n <ng-content select=\"footer\"></ng-content>\r\n </div> \r\n </div>\r\n </div>\r\n</div>", styles: [".modal{background:rgba(0,0,0,.5)}.modal .modal-header button.btn-close:hover{background-color:#e9ecef}.modal.in{opacity:1}.modal.in .modal-dialog{transform:translate(0)}.modal-backdrop.fade{filter:alpha(opacity=0);opacity:0}.modal-backdrop.in{filter:alpha(opacity=50);opacity:.5}@media (min-width: 820px){.modal-820{max-width:820px}}\n"] }]
|
|
85
|
+
args: [{ selector: 'sds-modal', template: "<div #modal class=\"modal\" (keydown)=\"onKeydown($event)\" [cdkTrapFocus]=\"isOpen\" [cdkTrapFocusAutoCapture]=\"true\" >\r\n <div\r\n class=\"modal-dialog modal-dialog-centered\"\r\n [class.modal-dialog-scrollable] = \"isScrollable\"\r\n [attr.id]=\"modalDialogId\"\r\n [ngClass]=\"'modal-' + size\"\r\n role=\"document\"\r\n >\r\n <div class=\"modal-content\">\r\n\r\n <div *ngIf=\"showHeader && headerContent\" class=\"modal-header\">\r\n <ng-content select='header'></ng-content>\r\n </div> \r\n\r\n <div \r\n *ngIf=\"showHeader && !headerContent\" \r\n class=\"modal-header\"\r\n >\r\n <h5 class=\"modal-title\">{{modalTitle}}</h5>\r\n <button \r\n #closeButton\r\n *ngIf=\"showCloseButton\"\r\n type=\"button\" \r\n class=\"btn-close sds-fs-75\" \r\n [title]=\"translations.close ?? ''\"\r\n (click)=\"onCloseButtonClick()\">\r\n </button>\r\n </div>\r\n\r\n <div \r\n class=\"modal-body\"\r\n [class.pt-0]=\"showHeader\"\r\n [class.pb-0]=\"showFooter\"\r\n >\r\n <ng-content></ng-content>\r\n </div>\r\n\r\n <div *ngIf=\"showFooter\" class=\"modal-footer\">\r\n <ng-content select=\"footer\"></ng-content>\r\n </div> \r\n </div>\r\n </div>\r\n</div>", styles: [".modal{background:rgba(0,0,0,.5)}.modal .modal-header button.btn-close{font-size:.75em}.modal .modal-header button.btn-close:hover{background-color:#e9ecef}.modal.in{opacity:1}.modal.in .modal-dialog{transform:translate(0)}.modal-backdrop.fade{filter:alpha(opacity=0);opacity:0}.modal-backdrop.in{filter:alpha(opacity=50);opacity:.5}@media (min-width: 820px){.modal-820{max-width:820px}}\n"] }]
|
|
67
86
|
}], ctorParameters: function () { return []; }, propDecorators: { headerContent: [{
|
|
68
87
|
type: ContentChild,
|
|
69
88
|
args: ['header']
|
|
@@ -95,6 +114,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.1", ngImpor
|
|
|
95
114
|
type: Output
|
|
96
115
|
}], closeEscapeKeypress: [{
|
|
97
116
|
type: Output
|
|
117
|
+
}], isOpen: [{
|
|
118
|
+
type: Input
|
|
119
|
+
}], isOpenChange: [{
|
|
120
|
+
type: Output
|
|
98
121
|
}], _modal: [{
|
|
99
122
|
type: ViewChild,
|
|
100
123
|
args: ['modal', { static: false }]
|
|
@@ -104,6 +127,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.1", ngImpor
|
|
|
104
127
|
}] } });
|
|
105
128
|
|
|
106
129
|
class SdsDialogComponent {
|
|
130
|
+
// public isOpen: boolean = false;
|
|
107
131
|
constructor() {
|
|
108
132
|
this.title = '';
|
|
109
133
|
this.closeText = 'close';
|
|
@@ -120,9 +144,16 @@ class SdsDialogComponent {
|
|
|
120
144
|
this.showPrimaryButton = true;
|
|
121
145
|
this.showSecondaryButton = true;
|
|
122
146
|
this.autofocusElement = 'primary';
|
|
147
|
+
/**
|
|
148
|
+
* @deprecated Use isOpenChange instead
|
|
149
|
+
*/
|
|
123
150
|
this.dialogOpen = new EventEmitter();
|
|
151
|
+
/**
|
|
152
|
+
* @deprecated Use isOpenChange instead
|
|
153
|
+
*/
|
|
124
154
|
this.dialogClose = new EventEmitter();
|
|
125
155
|
this.isOpen = false;
|
|
156
|
+
this.isOpenChange = new EventEmitter();
|
|
126
157
|
}
|
|
127
158
|
ngOnInit() {
|
|
128
159
|
if (this.autofocusElement == 'primary' && !this.showPrimaryButton) {
|
|
@@ -140,13 +171,15 @@ class SdsDialogComponent {
|
|
|
140
171
|
this._callbackData = data;
|
|
141
172
|
if (this._modal != undefined) {
|
|
142
173
|
this.isOpen = true;
|
|
143
|
-
this._modal.open();
|
|
174
|
+
// this._modal.open();
|
|
175
|
+
this.isOpenChange.emit(this.isOpen);
|
|
144
176
|
}
|
|
145
177
|
}
|
|
146
178
|
close() {
|
|
147
179
|
if (this._modal != undefined) {
|
|
148
180
|
this.isOpen = false;
|
|
149
|
-
this._modal.close();
|
|
181
|
+
// this._modal.close();
|
|
182
|
+
this.isOpenChange.emit(this.isOpen);
|
|
150
183
|
}
|
|
151
184
|
}
|
|
152
185
|
onSecondaryClick() {
|
|
@@ -165,11 +198,13 @@ class SdsDialogComponent {
|
|
|
165
198
|
if (this._callback) {
|
|
166
199
|
this._callback('close', this._callbackData);
|
|
167
200
|
}
|
|
201
|
+
this.close();
|
|
168
202
|
}
|
|
169
203
|
onCloseEscapeKeypress() {
|
|
170
204
|
if (this._callback) {
|
|
171
205
|
this._callback('close', this._callbackData);
|
|
172
206
|
}
|
|
207
|
+
this.close();
|
|
173
208
|
}
|
|
174
209
|
onModalClose() {
|
|
175
210
|
this.dialogClose.emit();
|
|
@@ -192,10 +227,10 @@ class SdsDialogComponent {
|
|
|
192
227
|
}
|
|
193
228
|
}
|
|
194
229
|
SdsDialogComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.1", ngImport: i0, type: SdsDialogComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
195
|
-
SdsDialogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.1", type: SdsDialogComponent, selector: "sds-dialog", inputs: { title: "title", closeText: "closeText", size: "size", primaryButtonText: "primaryButtonText", primaryButtonClass: "primaryButtonClass", primaryButtonType: "primaryButtonType", primaryButtonId: "primaryButtonId", secondaryButtonText: "secondaryButtonText", secondaryButtonClass: "secondaryButtonClass", secondaryButtonType: "secondaryButtonType", secondaryButtonId: "secondaryButtonId", closeOnEscape: "closeOnEscape", showHeader: "showHeader", showCloseButton: "showCloseButton", showPrimaryButton: "showPrimaryButton", showSecondaryButton: "showSecondaryButton", autofocusElement: "autofocusElement", modalDialogId: "modalDialogId" }, outputs: { dialogOpen: "dialogOpen", dialogClose: "dialogClose" }, viewQueries: [{ propertyName: "_modal", first: true, predicate: ["modal"], descendants: true, static: true }, { propertyName: "_content", first: true, predicate: ["content"], descendants: true, read: ElementRef, static: true }, { propertyName: "_primaryButton", first: true, predicate: ["primaryButton"], descendants: true, read: ElementRef }, { propertyName: "_secondaryButton", first: true, predicate: ["secondaryButton"], descendants: true, read: ElementRef }], ngImport: i0, template: "<sds-modal\r\n #modal\r\n [modalTitle]=\"title\"\r\n [size]=\"size\"\r\n [modalDialogId]=\"modalDialogId\"\r\n [showCloseButton]=\"showCloseButton\"\r\n [showHeader]=\"showHeader\"\r\n [translations]=\"{ close: closeText}\"\r\n [autoFocusCloseButton]=\"autofocusElement === 'close'\"\r\n [closeOnEscape]=\"closeOnEscape\"\r\n (closeClick)=\"onCloseClick()\"\r\n (closeEscapeKeypress)=\"onCloseEscapeKeypress()\"\r\n (modalClose)=\"onModalClose()\"\r\n (modalOpen)=\"onModalOpen()\"\r\n>\r\n\r\n <div #content [attr.tabindex]=\"autofocusElement === 'content' ? 0 : undefined\" >\r\n <ng-content></ng-content>\r\n </div>\r\n <ng-container #footer ngProjectAs='footer'>\r\n <button\r\n #secondaryButton\r\n *ngIf=\"showSecondaryButton\"\r\n [attr.id]=\"secondaryButtonId\"\r\n class=\"btn\"\r\n [class]=\"secondaryButtonClass\"\r\n (click)=\"onSecondaryClick()\"\r\n >{{secondaryButtonText}}</button>\r\n <button\r\n #primaryButton\r\n *ngIf=\"showPrimaryButton\"\r\n [attr.id]=\"primaryButtonId\"\r\n class=\"btn\"\r\n [class]=\"primaryButtonClass\"\r\n (click)=\"onPrimaryClick()\"\r\n >{{primaryButtonText}}</button>\r\n </ng-container>\r\n</sds-modal>\r\n", styles: [""], components: [{ type: SdsModalComponent, selector: "sds-modal", inputs: ["modalTitle", "showHeader", "showFooter", "size", "modalDialogId", "showCloseButton", "autoFocusCloseButton", "translations", "isScrollable", "closeOnEscape"], outputs: ["modalOpen", "modalClose", "closeClick", "closeEscapeKeypress"] }], directives: [{ type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
|
|
230
|
+
SdsDialogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.1", type: SdsDialogComponent, selector: "sds-dialog", inputs: { title: "title", closeText: "closeText", size: "size", primaryButtonText: "primaryButtonText", primaryButtonClass: "primaryButtonClass", primaryButtonType: "primaryButtonType", primaryButtonId: "primaryButtonId", secondaryButtonText: "secondaryButtonText", secondaryButtonClass: "secondaryButtonClass", secondaryButtonType: "secondaryButtonType", secondaryButtonId: "secondaryButtonId", closeOnEscape: "closeOnEscape", showHeader: "showHeader", showCloseButton: "showCloseButton", showPrimaryButton: "showPrimaryButton", showSecondaryButton: "showSecondaryButton", autofocusElement: "autofocusElement", modalDialogId: "modalDialogId", isOpen: "isOpen" }, outputs: { dialogOpen: "dialogOpen", dialogClose: "dialogClose", isOpenChange: "isOpenChange" }, viewQueries: [{ propertyName: "_modal", first: true, predicate: ["modal"], descendants: true, static: true }, { propertyName: "_content", first: true, predicate: ["content"], descendants: true, read: ElementRef, static: true }, { propertyName: "_primaryButton", first: true, predicate: ["primaryButton"], descendants: true, read: ElementRef }, { propertyName: "_secondaryButton", first: true, predicate: ["secondaryButton"], descendants: true, read: ElementRef }], ngImport: i0, template: "<sds-modal\r\n #modal\r\n [modalTitle]=\"title\"\r\n [size]=\"size\"\r\n [modalDialogId]=\"modalDialogId\"\r\n [showCloseButton]=\"showCloseButton\"\r\n [showHeader]=\"showHeader\"\r\n [translations]=\"{ close: closeText}\"\r\n [autoFocusCloseButton]=\"autofocusElement === 'close'\"\r\n [closeOnEscape]=\"closeOnEscape\"\r\n (closeClick)=\"onCloseClick()\"\r\n (closeEscapeKeypress)=\"onCloseEscapeKeypress()\"\r\n (modalClose)=\"onModalClose()\"\r\n (modalOpen)=\"onModalOpen()\"\r\n [(isOpen)]=\"isOpen\"\r\n>\r\n\r\n <div #content [attr.tabindex]=\"autofocusElement === 'content' ? 0 : undefined\" >\r\n <ng-content></ng-content>\r\n </div>\r\n <ng-container #footer ngProjectAs='footer'>\r\n <button\r\n #secondaryButton\r\n *ngIf=\"showSecondaryButton\"\r\n [attr.id]=\"secondaryButtonId\"\r\n class=\"btn\"\r\n [class]=\"secondaryButtonClass\"\r\n (click)=\"onSecondaryClick()\"\r\n >{{secondaryButtonText}}</button>\r\n <button\r\n #primaryButton\r\n *ngIf=\"showPrimaryButton\"\r\n [attr.id]=\"primaryButtonId\"\r\n class=\"btn\"\r\n [class]=\"primaryButtonClass\"\r\n (click)=\"onPrimaryClick()\"\r\n >{{primaryButtonText}}</button>\r\n </ng-container>\r\n</sds-modal>\r\n", styles: [""], components: [{ type: SdsModalComponent, selector: "sds-modal", inputs: ["modalTitle", "showHeader", "showFooter", "size", "modalDialogId", "showCloseButton", "autoFocusCloseButton", "translations", "isScrollable", "closeOnEscape", "isOpen"], outputs: ["modalOpen", "modalClose", "closeClick", "closeEscapeKeypress", "isOpenChange"] }], directives: [{ type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
|
|
196
231
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.1", ngImport: i0, type: SdsDialogComponent, decorators: [{
|
|
197
232
|
type: Component,
|
|
198
|
-
args: [{ selector: 'sds-dialog', template: "<sds-modal\r\n #modal\r\n [modalTitle]=\"title\"\r\n [size]=\"size\"\r\n [modalDialogId]=\"modalDialogId\"\r\n [showCloseButton]=\"showCloseButton\"\r\n [showHeader]=\"showHeader\"\r\n [translations]=\"{ close: closeText}\"\r\n [autoFocusCloseButton]=\"autofocusElement === 'close'\"\r\n [closeOnEscape]=\"closeOnEscape\"\r\n (closeClick)=\"onCloseClick()\"\r\n (closeEscapeKeypress)=\"onCloseEscapeKeypress()\"\r\n (modalClose)=\"onModalClose()\"\r\n (modalOpen)=\"onModalOpen()\"\r\n>\r\n\r\n <div #content [attr.tabindex]=\"autofocusElement === 'content' ? 0 : undefined\" >\r\n <ng-content></ng-content>\r\n </div>\r\n <ng-container #footer ngProjectAs='footer'>\r\n <button\r\n #secondaryButton\r\n *ngIf=\"showSecondaryButton\"\r\n [attr.id]=\"secondaryButtonId\"\r\n class=\"btn\"\r\n [class]=\"secondaryButtonClass\"\r\n (click)=\"onSecondaryClick()\"\r\n >{{secondaryButtonText}}</button>\r\n <button\r\n #primaryButton\r\n *ngIf=\"showPrimaryButton\"\r\n [attr.id]=\"primaryButtonId\"\r\n class=\"btn\"\r\n [class]=\"primaryButtonClass\"\r\n (click)=\"onPrimaryClick()\"\r\n >{{primaryButtonText}}</button>\r\n </ng-container>\r\n</sds-modal>\r\n", styles: [""] }]
|
|
233
|
+
args: [{ selector: 'sds-dialog', template: "<sds-modal\r\n #modal\r\n [modalTitle]=\"title\"\r\n [size]=\"size\"\r\n [modalDialogId]=\"modalDialogId\"\r\n [showCloseButton]=\"showCloseButton\"\r\n [showHeader]=\"showHeader\"\r\n [translations]=\"{ close: closeText}\"\r\n [autoFocusCloseButton]=\"autofocusElement === 'close'\"\r\n [closeOnEscape]=\"closeOnEscape\"\r\n (closeClick)=\"onCloseClick()\"\r\n (closeEscapeKeypress)=\"onCloseEscapeKeypress()\"\r\n (modalClose)=\"onModalClose()\"\r\n (modalOpen)=\"onModalOpen()\"\r\n [(isOpen)]=\"isOpen\"\r\n>\r\n\r\n <div #content [attr.tabindex]=\"autofocusElement === 'content' ? 0 : undefined\" >\r\n <ng-content></ng-content>\r\n </div>\r\n <ng-container #footer ngProjectAs='footer'>\r\n <button\r\n #secondaryButton\r\n *ngIf=\"showSecondaryButton\"\r\n [attr.id]=\"secondaryButtonId\"\r\n class=\"btn\"\r\n [class]=\"secondaryButtonClass\"\r\n (click)=\"onSecondaryClick()\"\r\n >{{secondaryButtonText}}</button>\r\n <button\r\n #primaryButton\r\n *ngIf=\"showPrimaryButton\"\r\n [attr.id]=\"primaryButtonId\"\r\n class=\"btn\"\r\n [class]=\"primaryButtonClass\"\r\n (click)=\"onPrimaryClick()\"\r\n >{{primaryButtonText}}</button>\r\n </ng-container>\r\n</sds-modal>\r\n", styles: [""] }]
|
|
199
234
|
}], ctorParameters: function () { return []; }, propDecorators: { title: [{
|
|
200
235
|
type: Input
|
|
201
236
|
}], closeText: [{
|
|
@@ -236,6 +271,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.1", ngImpor
|
|
|
236
271
|
type: Output
|
|
237
272
|
}], dialogClose: [{
|
|
238
273
|
type: Output
|
|
274
|
+
}], isOpen: [{
|
|
275
|
+
type: Input
|
|
276
|
+
}], isOpenChange: [{
|
|
277
|
+
type: Output
|
|
239
278
|
}], _modal: [{
|
|
240
279
|
type: ViewChild,
|
|
241
280
|
args: ['modal', { static: true }]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"spicainternational-ngx-sds-components-src-lib-modal.mjs","sources":["../../../projects/ngx-sds-components/src/lib/modal/modal.component.ts","../../../projects/ngx-sds-components/src/lib/modal/modal.component.html","../../../projects/ngx-sds-components/src/lib/modal/dialog/dialog.component.ts","../../../projects/ngx-sds-components/src/lib/modal/dialog/dialog.component.html","../../../projects/ngx-sds-components/src/lib/modal/modal.module.ts","../../../projects/ngx-sds-components/src/lib/modal/spicainternational-ngx-sds-components-src-lib-modal.ts"],"sourcesContent":["import {\r\n Component,\r\n ElementRef,\r\n Input,\r\n OnInit,\r\n Output,\r\n ViewChild,\r\n EventEmitter,\r\n ContentChild\r\n} from '@angular/core';\r\nimport { faXmark } from '@fortawesome/pro-regular-svg-icons';\r\nimport { ModalTranslations } from './modal.model';\r\n\r\n@Component({\r\n selector: 'sds-modal',\r\n templateUrl: './modal.component.html',\r\n styleUrls: ['./modal.component.scss'],\r\n})\r\nexport class SdsModalComponent implements OnInit {\r\n @ContentChild('header') headerContent: ElementRef = { nativeElement: undefined };\r\n\r\n @Input() public modalTitle?: string;\r\n @Input() public showHeader: boolean = true;\r\n @Input() public showFooter: boolean = true;\r\n @Input() public size: 'sm' | 'md' | 'lg' | 'xl' | '820' = 'md';\r\n @Input() public modalDialogId?: string;\r\n @Input() public showCloseButton: boolean = true;\r\n @Input() public autoFocusCloseButton: boolean = false;\r\n\r\n @Input() public translations: ModalTranslations;\r\n @Input() public isScrollable = true;\r\n @Input() public closeOnEscape = false;\r\n\r\n @Output() public modalOpen: EventEmitter<void> = new EventEmitter<void>();\r\n @Output() public modalClose: EventEmitter<void> = new EventEmitter<void>();\r\n\r\n @Output() public closeClick: EventEmitter<void> = new EventEmitter<void>();\r\n @Output() public closeEscapeKeypress: EventEmitter<void> = new EventEmitter<void>();\r\n\r\n public closeIcon = faXmark;\r\n\r\n public isOpen: boolean = false;\r\n\r\n @ViewChild('modal', { static: false }) private _modal: ElementRef | undefined;\r\n @ViewChild('closeButton', { static: false }) private _closeButton: ElementRef | undefined;\r\n \r\n\r\n constructor() {\r\n this.translations = {\r\n close: undefined\r\n }\r\n }\r\n\r\n ngOnInit(): void {}\r\n\r\n public open(): void {\r\n if (this._modal != undefined) {\r\n this._modal.nativeElement.style.display = 'block';\r\n this.isOpen = true;\r\n if(this.autoFocusCloseButton)\r\n this._closeButton?.nativeElement.focus();\r\n this.modalOpen.emit();\r\n }\r\n }\r\n\r\n public close(): void {\r\n if (this._modal != undefined) {\r\n this._modal.nativeElement.style.display = 'none';\r\n this.isOpen = false;\r\n this.modalClose.emit();\r\n }\r\n }\r\n\r\n public onCloseButtonClick(){\r\n this.closeClick.emit();\r\n this.close();\r\n }\r\n\r\n onKeydown(event: KeyboardEvent){\r\n if (\r\n event.code === 'Escape' &&\r\n this.closeOnEscape && \r\n this._modal != undefined && \r\n this._modal.nativeElement.style.display === 'block'){\r\n // console.log(`${this.constructor.name} got event: ${event.code}`);\r\n this.closeEscapeKeypress.emit();\r\n this.close();\r\n }\r\n }\r\n}\r\n","<div #modal class=\"modal\" (keydown)=\"onKeydown($event)\" [cdkTrapFocus]=\"isOpen\" [cdkTrapFocusAutoCapture]=\"true\" >\r\n <div\r\n class=\"modal-dialog modal-dialog-centered\"\r\n [class.modal-dialog-scrollable] = \"isScrollable\"\r\n [attr.id]=\"modalDialogId\"\r\n [ngClass]=\"'modal-' + size\"\r\n role=\"document\"\r\n >\r\n <div class=\"modal-content\">\r\n\r\n <div *ngIf=\"showHeader && headerContent\" class=\"modal-header\">\r\n <ng-content select='header'></ng-content>\r\n </div> \r\n\r\n <div \r\n *ngIf=\"showHeader && !headerContent\" \r\n class=\"modal-header\"\r\n >\r\n <h5 class=\"modal-title\">{{modalTitle}}</h5>\r\n <button \r\n #closeButton\r\n *ngIf=\"showCloseButton\"\r\n type=\"button\" \r\n class=\"btn-close\" \r\n [title]=\"translations.close ?? ''\"\r\n (click)=\"onCloseButtonClick()\">\r\n </button>\r\n </div>\r\n\r\n <div \r\n class=\"modal-body\"\r\n [class.pt-0]=\"showHeader\"\r\n [class.pb-0]=\"showFooter\"\r\n >\r\n <ng-content></ng-content>\r\n </div>\r\n\r\n <div *ngIf=\"showFooter\" class=\"modal-footer\">\r\n <ng-content select=\"footer\"></ng-content>\r\n </div> \r\n </div>\r\n </div>\r\n</div>","import { Component, ElementRef, EventEmitter, Input, OnChanges, OnInit, Output, SimpleChanges, ViewChild } from '@angular/core';\r\nimport { SdsModalComponent } from '../modal.component';\r\nimport { ButtonType } from './dialog.types';\r\n\r\ntype modalButton = 'primary' | 'secondary' | 'close';\r\n\r\n@Component({\r\n selector: 'sds-dialog',\r\n templateUrl: './dialog.component.html',\r\n styleUrls: ['./dialog.component.scss'],\r\n})\r\nexport class SdsDialogComponent implements OnInit {\r\n @Input() public title: string = '';\r\n @Input() public closeText?: string = 'close';\r\n @Input() public size: 'sm' | 'md' | 'lg' | 'xl' = 'md';\r\n\r\n @Input() public primaryButtonText: string = 'Ok';\r\n @Input() public primaryButtonClass: string = 'btn-primary';\r\n @Input() public primaryButtonType: ButtonType = 'button';\r\n @Input() public primaryButtonId?: string;\r\n \r\n @Input() public secondaryButtonText: string = 'Cancel'; \r\n @Input() public secondaryButtonClass: string = 'btn-secondary';\r\n @Input() public secondaryButtonType: ButtonType = 'button';\r\n @Input() public secondaryButtonId?: string;\r\n\r\n @Input() public closeOnEscape: boolean = true;\r\n @Input() public showHeader: boolean = true;\r\n @Input() public showCloseButton: boolean = true;\r\n @Input() public showPrimaryButton: boolean = true;\r\n @Input() public showSecondaryButton: boolean = true;\r\n @Input() public autofocusElement: 'primary' | 'secondary' | 'close' | 'content' = 'primary';\r\n\r\n @Input() public modalDialogId?: string;\r\n\r\n\r\n @Output() public dialogOpen: EventEmitter<void> = new EventEmitter<void>();\r\n @Output() public dialogClose: EventEmitter<void> = new EventEmitter<void>();\r\n\r\n @ViewChild('modal', { static: true }) private _modal: SdsModalComponent | undefined;\r\n @ViewChild('content', { read: ElementRef, static: true }) private _content?: ElementRef;\r\n @ViewChild('primaryButton', { read: ElementRef, static: false }) private _primaryButton?: ElementRef;\r\n @ViewChild('secondaryButton', { read: ElementRef, static: false }) private _secondaryButton?: ElementRef;\r\n\r\n private _callback?: Function;\r\n private _callbackData: any;\r\n\r\n public isOpen: boolean = false;\r\n\r\n constructor() {}\r\n\r\n ngOnInit(): void {\r\n if (this.autofocusElement == 'primary' && !this.showPrimaryButton) {\r\n this.autofocusElement = 'secondary';\r\n }\r\n if (this.autofocusElement == 'secondary' && !this.showSecondaryButton) {\r\n this.autofocusElement = 'close';\r\n }\r\n if (this.autofocusElement == 'close' && !this.showCloseButton) {\r\n this.autofocusElement = 'content';\r\n }\r\n }\r\n\r\n public open(callback?: (button: modalButton, data: any) => void, data?: any): void{\r\n this._callback = callback;\r\n this._callbackData = data;\r\n\r\n if (this._modal != undefined) {\r\n this.isOpen = true;\r\n this._modal.open();\r\n }\r\n }\r\n\r\n private close(): void {\r\n if (this._modal != undefined) {\r\n this.isOpen = false;\r\n this._modal.close();\r\n }\r\n }\r\n\r\n public onSecondaryClick(): void {\r\n if (this._callback) {\r\n this._callback('secondary', this._callbackData);\r\n }\r\n this.close();\r\n }\r\n\r\n public onPrimaryClick(): void {\r\n if (this._callback) {\r\n this._callback('primary', this._callbackData);\r\n }\r\n this.close();\r\n }\r\n\r\n public onCloseClick(): void {\r\n if (this._callback) {\r\n this._callback('close', this._callbackData);\r\n }\r\n }\r\n\r\n public onCloseEscapeKeypress(): void {\r\n if (this._callback) {\r\n this._callback('close', this._callbackData);\r\n }\r\n }\r\n\r\n public onModalClose(): void {\r\n this.dialogClose.emit();\r\n }\r\n\r\n public onModalOpen(): void {\r\n this.dialogOpen.emit();\r\n switch (this.autofocusElement) {\r\n case 'primary':\r\n this._primaryButton?.nativeElement.focus();\r\n break;\r\n case 'secondary':\r\n this._secondaryButton?.nativeElement.focus();\r\n break;\r\n case 'content':\r\n this._content?.nativeElement.focus();\r\n break;\r\n default:\r\n break;\r\n }\r\n } \r\n\r\n}\r\n\r\n\r\n\r\n","<sds-modal\r\n #modal\r\n [modalTitle]=\"title\"\r\n [size]=\"size\"\r\n [modalDialogId]=\"modalDialogId\"\r\n [showCloseButton]=\"showCloseButton\"\r\n [showHeader]=\"showHeader\"\r\n [translations]=\"{ close: closeText}\"\r\n [autoFocusCloseButton]=\"autofocusElement === 'close'\"\r\n [closeOnEscape]=\"closeOnEscape\"\r\n (closeClick)=\"onCloseClick()\"\r\n (closeEscapeKeypress)=\"onCloseEscapeKeypress()\"\r\n (modalClose)=\"onModalClose()\"\r\n (modalOpen)=\"onModalOpen()\"\r\n>\r\n\r\n <div #content [attr.tabindex]=\"autofocusElement === 'content' ? 0 : undefined\" >\r\n <ng-content></ng-content>\r\n </div>\r\n <ng-container #footer ngProjectAs='footer'>\r\n <button\r\n #secondaryButton\r\n *ngIf=\"showSecondaryButton\"\r\n [attr.id]=\"secondaryButtonId\"\r\n class=\"btn\"\r\n [class]=\"secondaryButtonClass\"\r\n (click)=\"onSecondaryClick()\"\r\n >{{secondaryButtonText}}</button>\r\n <button\r\n #primaryButton\r\n *ngIf=\"showPrimaryButton\"\r\n [attr.id]=\"primaryButtonId\"\r\n class=\"btn\"\r\n [class]=\"primaryButtonClass\"\r\n (click)=\"onPrimaryClick()\"\r\n >{{primaryButtonText}}</button>\r\n </ng-container>\r\n</sds-modal>\r\n","import { NgModule } from '@angular/core';\r\nimport { CommonModule } from '@angular/common';\r\nimport { SdsModalComponent } from './modal.component';\r\nimport { FontAwesomeModule } from '@fortawesome/angular-fontawesome';\r\nimport { SdsDialogComponent } from './dialog/dialog.component';\r\nimport { A11yModule } from '@angular/cdk/a11y';\r\n\r\n\r\nconst components = [\r\n SdsModalComponent,\r\n SdsDialogComponent\r\n];\r\n\r\n@NgModule({\r\n declarations: [\r\n ...components\r\n ],\r\n imports: [\r\n CommonModule,\r\n A11yModule,\r\n FontAwesomeModule\r\n ],\r\n exports: [\r\n ...components\r\n]\r\n})\r\nexport class SdsModalModule { }\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["i1.SdsModalComponent"],"mappings":";;;;;;;;;MAkBa,iBAAiB,CAAA;AA6B1B,IAAA,WAAA,GAAA;AA5BwB,QAAA,IAAA,CAAA,aAAa,GAAe,EAAE,aAAa,EAAE,SAAS,EAAE,CAAC;QAGjE,IAAU,CAAA,UAAA,GAAY,IAAI,CAAC;QAC3B,IAAU,CAAA,UAAA,GAAY,IAAI,CAAC;QAC3B,IAAI,CAAA,IAAA,GAAsC,IAAI,CAAC;QAE/C,IAAe,CAAA,eAAA,GAAY,IAAI,CAAC;QAChC,IAAoB,CAAA,oBAAA,GAAY,KAAK,CAAC;QAGtC,IAAY,CAAA,YAAA,GAAG,IAAI,CAAC;QACpB,IAAa,CAAA,aAAA,GAAG,KAAK,CAAC;AAErB,QAAA,IAAA,CAAA,SAAS,GAAuB,IAAI,YAAY,EAAQ,CAAC;AACzD,QAAA,IAAA,CAAA,UAAU,GAAuB,IAAI,YAAY,EAAQ,CAAC;AAE1D,QAAA,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","sources":["../../../projects/ngx-sds-components/src/lib/modal/modal.component.ts","../../../projects/ngx-sds-components/src/lib/modal/modal.component.html","../../../projects/ngx-sds-components/src/lib/modal/dialog/dialog.component.ts","../../../projects/ngx-sds-components/src/lib/modal/dialog/dialog.component.html","../../../projects/ngx-sds-components/src/lib/modal/modal.module.ts","../../../projects/ngx-sds-components/src/lib/modal/spicainternational-ngx-sds-components-src-lib-modal.ts"],"sourcesContent":["import {\r\n Component,\r\n ElementRef,\r\n Input,\r\n OnInit,\r\n Output,\r\n ViewChild,\r\n EventEmitter,\r\n ContentChild,\r\n OnChanges,\r\n SimpleChanges\r\n} from '@angular/core';\r\nimport { faXmark } from '@fortawesome/pro-regular-svg-icons';\r\nimport { ModalTranslations } from './modal.model';\r\n\r\n@Component({\r\n selector: 'sds-modal',\r\n templateUrl: './modal.component.html',\r\n styleUrls: ['./modal.component.scss'],\r\n})\r\nexport class SdsModalComponent implements OnInit, OnChanges {\r\n @ContentChild('header') headerContent: ElementRef = { nativeElement: undefined };\r\n\r\n @Input() public modalTitle?: string;\r\n @Input() public showHeader: boolean = true;\r\n @Input() public showFooter: boolean = true;\r\n @Input() public size: 'sm' | 'md' | 'lg' | 'xl' | '820' = 'md';\r\n @Input() public modalDialogId?: string;\r\n @Input() public showCloseButton: boolean = true;\r\n @Input() public autoFocusCloseButton: boolean = false;\r\n\r\n @Input() public translations: ModalTranslations;\r\n @Input() public isScrollable = true;\r\n @Input() public closeOnEscape = false;\r\n\r\n /**\r\n * @deprecated Use isOpenChange instead\r\n */\r\n @Output() public modalOpen: EventEmitter<void> = new EventEmitter<void>();\r\n\r\n /**\r\n * @deprecated Use isOpenChange instead\r\n */\r\n @Output() public modalClose: EventEmitter<void> = new EventEmitter<void>();\r\n\r\n @Output() public closeClick: EventEmitter<void> = new EventEmitter<void>();\r\n @Output() public closeEscapeKeypress: EventEmitter<void> = new EventEmitter<void>();\r\n\r\n public closeIcon = faXmark;\r\n\r\n // public isOpen: boolean = false;\r\n @Input() public isOpen: boolean = false;\r\n @Output() public isOpenChange: EventEmitter<boolean> = new EventEmitter<boolean>();\r\n\r\n @ViewChild('modal', { static: false }) private _modal: ElementRef | undefined;\r\n @ViewChild('closeButton', { static: false }) private _closeButton: ElementRef | undefined;\r\n \r\n\r\n constructor() {\r\n this.translations = {\r\n close: undefined\r\n }\r\n }\r\n ngOnChanges(changes: SimpleChanges): void {\r\n if (changes['isOpen']) {\r\n if (this.isOpen) {\r\n this.open();\r\n } else {\r\n this.close();\r\n }\r\n }\r\n }\r\n\r\n ngOnInit(): void {}\r\n\r\n public open(): void {\r\n if (this._modal != undefined) {\r\n this._modal.nativeElement.style.display = 'block';\r\n this.isOpen = true;\r\n if(this.autoFocusCloseButton)\r\n this._closeButton?.nativeElement.focus();\r\n this.modalOpen.emit();\r\n }\r\n }\r\n\r\n public close(): void {\r\n if (this._modal != undefined) {\r\n this._modal.nativeElement.style.display = 'none';\r\n this.isOpen = false;\r\n this.modalClose.emit();\r\n\r\n this.isOpenChange.emit(this.isOpen);\r\n }\r\n }\r\n\r\n public onCloseButtonClick(){\r\n this.closeClick.emit();\r\n this.close();\r\n }\r\n\r\n onKeydown(event: KeyboardEvent){\r\n if (\r\n event.code === 'Escape' &&\r\n this.closeOnEscape && \r\n this._modal != undefined && \r\n this._modal.nativeElement.style.display === 'block'){\r\n // console.log(`${this.constructor.name} got event: ${event.code}`);\r\n this.closeEscapeKeypress.emit();\r\n this.close();\r\n }\r\n }\r\n}\r\n","<div #modal class=\"modal\" (keydown)=\"onKeydown($event)\" [cdkTrapFocus]=\"isOpen\" [cdkTrapFocusAutoCapture]=\"true\" >\r\n <div\r\n class=\"modal-dialog modal-dialog-centered\"\r\n [class.modal-dialog-scrollable] = \"isScrollable\"\r\n [attr.id]=\"modalDialogId\"\r\n [ngClass]=\"'modal-' + size\"\r\n role=\"document\"\r\n >\r\n <div class=\"modal-content\">\r\n\r\n <div *ngIf=\"showHeader && headerContent\" class=\"modal-header\">\r\n <ng-content select='header'></ng-content>\r\n </div> \r\n\r\n <div \r\n *ngIf=\"showHeader && !headerContent\" \r\n class=\"modal-header\"\r\n >\r\n <h5 class=\"modal-title\">{{modalTitle}}</h5>\r\n <button \r\n #closeButton\r\n *ngIf=\"showCloseButton\"\r\n type=\"button\" \r\n class=\"btn-close sds-fs-75\" \r\n [title]=\"translations.close ?? ''\"\r\n (click)=\"onCloseButtonClick()\">\r\n </button>\r\n </div>\r\n\r\n <div \r\n class=\"modal-body\"\r\n [class.pt-0]=\"showHeader\"\r\n [class.pb-0]=\"showFooter\"\r\n >\r\n <ng-content></ng-content>\r\n </div>\r\n\r\n <div *ngIf=\"showFooter\" class=\"modal-footer\">\r\n <ng-content select=\"footer\"></ng-content>\r\n </div> \r\n </div>\r\n </div>\r\n</div>","import { Component, ElementRef, EventEmitter, Input, OnChanges, OnInit, Output, SimpleChanges, ViewChild } from '@angular/core';\r\nimport { SdsModalComponent } from '../modal.component';\r\nimport { ButtonType } from './dialog.types';\r\n\r\ntype modalButton = 'primary' | 'secondary' | 'close';\r\n\r\n@Component({\r\n selector: 'sds-dialog',\r\n templateUrl: './dialog.component.html',\r\n styleUrls: ['./dialog.component.scss'],\r\n})\r\nexport class SdsDialogComponent implements OnInit {\r\n @Input() public title: string = '';\r\n @Input() public closeText?: string = 'close';\r\n @Input() public size: 'sm' | 'md' | 'lg' | 'xl' = 'md';\r\n\r\n @Input() public primaryButtonText: string = 'Ok';\r\n @Input() public primaryButtonClass: string = 'btn-primary';\r\n @Input() public primaryButtonType: ButtonType = 'button';\r\n @Input() public primaryButtonId?: string;\r\n \r\n @Input() public secondaryButtonText: string = 'Cancel'; \r\n @Input() public secondaryButtonClass: string = 'btn-secondary';\r\n @Input() public secondaryButtonType: ButtonType = 'button';\r\n @Input() public secondaryButtonId?: string;\r\n\r\n @Input() public closeOnEscape: boolean = true;\r\n @Input() public showHeader: boolean = true;\r\n @Input() public showCloseButton: boolean = true;\r\n @Input() public showPrimaryButton: boolean = true;\r\n @Input() public showSecondaryButton: boolean = true;\r\n @Input() public autofocusElement: 'primary' | 'secondary' | 'close' | 'content' = 'primary';\r\n\r\n @Input() public modalDialogId?: string;\r\n\r\n /**\r\n * @deprecated Use isOpenChange instead\r\n */\r\n @Output() public dialogOpen: EventEmitter<void> = new EventEmitter<void>();\r\n\r\n /**\r\n * @deprecated Use isOpenChange instead\r\n */\r\n @Output() public dialogClose: EventEmitter<void> = new EventEmitter<void>();\r\n\r\n\r\n @Input() public isOpen: boolean = false;\r\n @Output() public isOpenChange: EventEmitter<boolean> = new EventEmitter<boolean>();\r\n\r\n @ViewChild('modal', { static: true }) private _modal: SdsModalComponent | undefined;\r\n @ViewChild('content', { read: ElementRef, static: true }) private _content?: ElementRef;\r\n @ViewChild('primaryButton', { read: ElementRef, static: false }) private _primaryButton?: ElementRef;\r\n @ViewChild('secondaryButton', { read: ElementRef, static: false }) private _secondaryButton?: ElementRef;\r\n\r\n private _callback?: Function;\r\n private _callbackData: any;\r\n\r\n // public isOpen: boolean = false;\r\n\r\n constructor() {}\r\n\r\n ngOnInit(): void {\r\n if (this.autofocusElement == 'primary' && !this.showPrimaryButton) {\r\n this.autofocusElement = 'secondary';\r\n }\r\n if (this.autofocusElement == 'secondary' && !this.showSecondaryButton) {\r\n this.autofocusElement = 'close';\r\n }\r\n if (this.autofocusElement == 'close' && !this.showCloseButton) {\r\n this.autofocusElement = 'content';\r\n }\r\n }\r\n\r\n public open(callback?: (button: modalButton, data: any) => void, data?: any): void{\r\n this._callback = callback;\r\n this._callbackData = data;\r\n\r\n if (this._modal != undefined) {\r\n this.isOpen = true;\r\n // this._modal.open();\r\n\r\n this.isOpenChange.emit(this.isOpen);\r\n }\r\n }\r\n\r\n private close(): void {\r\n if (this._modal != undefined) {\r\n this.isOpen = false;\r\n // this._modal.close();\r\n\r\n this.isOpenChange.emit(this.isOpen);\r\n }\r\n }\r\n\r\n public onSecondaryClick(): void {\r\n if (this._callback) {\r\n this._callback('secondary', this._callbackData);\r\n }\r\n this.close();\r\n }\r\n\r\n public onPrimaryClick(): void {\r\n if (this._callback) {\r\n this._callback('primary', this._callbackData);\r\n }\r\n this.close();\r\n }\r\n\r\n public onCloseClick(): void {\r\n if (this._callback) {\r\n this._callback('close', this._callbackData);\r\n }\r\n this.close();\r\n }\r\n\r\n public onCloseEscapeKeypress(): void {\r\n if (this._callback) {\r\n this._callback('close', this._callbackData);\r\n }\r\n this.close();\r\n }\r\n\r\n public onModalClose(): void {\r\n this.dialogClose.emit();\r\n }\r\n\r\n public onModalOpen(): void {\r\n this.dialogOpen.emit();\r\n switch (this.autofocusElement) {\r\n case 'primary':\r\n this._primaryButton?.nativeElement.focus();\r\n break;\r\n case 'secondary':\r\n this._secondaryButton?.nativeElement.focus();\r\n break;\r\n case 'content':\r\n this._content?.nativeElement.focus();\r\n break;\r\n default:\r\n break;\r\n }\r\n } \r\n\r\n}\r\n\r\n\r\n\r\n","<sds-modal\r\n #modal\r\n [modalTitle]=\"title\"\r\n [size]=\"size\"\r\n [modalDialogId]=\"modalDialogId\"\r\n [showCloseButton]=\"showCloseButton\"\r\n [showHeader]=\"showHeader\"\r\n [translations]=\"{ close: closeText}\"\r\n [autoFocusCloseButton]=\"autofocusElement === 'close'\"\r\n [closeOnEscape]=\"closeOnEscape\"\r\n (closeClick)=\"onCloseClick()\"\r\n (closeEscapeKeypress)=\"onCloseEscapeKeypress()\"\r\n (modalClose)=\"onModalClose()\"\r\n (modalOpen)=\"onModalOpen()\"\r\n [(isOpen)]=\"isOpen\"\r\n>\r\n\r\n <div #content [attr.tabindex]=\"autofocusElement === 'content' ? 0 : undefined\" >\r\n <ng-content></ng-content>\r\n </div>\r\n <ng-container #footer ngProjectAs='footer'>\r\n <button\r\n #secondaryButton\r\n *ngIf=\"showSecondaryButton\"\r\n [attr.id]=\"secondaryButtonId\"\r\n class=\"btn\"\r\n [class]=\"secondaryButtonClass\"\r\n (click)=\"onSecondaryClick()\"\r\n >{{secondaryButtonText}}</button>\r\n <button\r\n #primaryButton\r\n *ngIf=\"showPrimaryButton\"\r\n [attr.id]=\"primaryButtonId\"\r\n class=\"btn\"\r\n [class]=\"primaryButtonClass\"\r\n (click)=\"onPrimaryClick()\"\r\n >{{primaryButtonText}}</button>\r\n </ng-container>\r\n</sds-modal>\r\n","import { NgModule } from '@angular/core';\r\nimport { CommonModule } from '@angular/common';\r\nimport { SdsModalComponent } from './modal.component';\r\nimport { FontAwesomeModule } from '@fortawesome/angular-fontawesome';\r\nimport { SdsDialogComponent } from './dialog/dialog.component';\r\nimport { A11yModule } from '@angular/cdk/a11y';\r\n\r\n\r\nconst components = [\r\n SdsModalComponent,\r\n SdsDialogComponent\r\n];\r\n\r\n@NgModule({\r\n declarations: [\r\n ...components\r\n ],\r\n imports: [\r\n CommonModule,\r\n A11yModule,\r\n FontAwesomeModule\r\n ],\r\n exports: [\r\n ...components\r\n]\r\n})\r\nexport class SdsModalModule { }\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["i1.SdsModalComponent"],"mappings":";;;;;;;;;MAoBa,iBAAiB,CAAA;AAsC1B,IAAA,WAAA,GAAA;AArCwB,QAAA,IAAA,CAAA,aAAa,GAAe,EAAE,aAAa,EAAE,SAAS,EAAE,CAAC;QAGjE,IAAU,CAAA,UAAA,GAAY,IAAI,CAAC;QAC3B,IAAU,CAAA,UAAA,GAAY,IAAI,CAAC;QAC3B,IAAI,CAAA,IAAA,GAAsC,IAAI,CAAC;QAE/C,IAAe,CAAA,eAAA,GAAY,IAAI,CAAC;QAChC,IAAoB,CAAA,oBAAA,GAAY,KAAK,CAAC;QAGtC,IAAY,CAAA,YAAA,GAAG,IAAI,CAAC;QACpB,IAAa,CAAA,aAAA,GAAG,KAAK,CAAC;AAEtC;;AAEG;AACc,QAAA,IAAA,CAAA,SAAS,GAAuB,IAAI,YAAY,EAAQ,CAAC;AAE1E;;AAEG;AACc,QAAA,IAAA,CAAA,UAAU,GAAuB,IAAI,YAAY,EAAQ,CAAC;AAE1D,QA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,iBAjBvB,iBAAiB;AACjB,QAAA,kBAAkB,aAQlB,YAAY;QACZ,UAAU;AACV,QAAA,iBAAiB,aAXjB,iBAAiB;QACjB,kBAAkB,CAAA,EAAA,CAAA,CAAA;AAgBT,cAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,cAAc,EAThB,OAAA,EAAA,CAAA;YACP,YAAY;YACZ,UAAU;YACV,iBAAiB;AAClB,SAAA,CAAA,EAAA,CAAA,CAAA;2FAKU,cAAc,EAAA,UAAA,EAAA,CAAA;kBAb1B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,YAAY,EAAE;AACZ,wBAAA,GAAG,UAAU;AACd,qBAAA;AACD,oBAAA,OAAO,EAAE;wBACP,YAAY;wBACZ,UAAU;wBACV,iBAAiB;AAClB,qBAAA;AACD,oBAAA,OAAO,EAAE;AACP,wBAAA,GAAG,UAAU;AAChB,qBAAA;AACA,iBAAA,CAAA;;;ACzBD;;AAEG;;;;"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { Component, Input, NgModule } from '@angular/core';
|
|
3
|
+
import * as i2 from '@angular/common';
|
|
4
|
+
import { CommonModule } from '@angular/common';
|
|
5
|
+
import * as i1 from '@fortawesome/angular-fontawesome';
|
|
6
|
+
import { FontAwesomeModule } from '@fortawesome/angular-fontawesome';
|
|
7
|
+
import { DxPopoverModule } from 'devextreme-angular';
|
|
8
|
+
|
|
9
|
+
class SdsTableActionsComponent {
|
|
10
|
+
constructor() {
|
|
11
|
+
this.actions = [];
|
|
12
|
+
this.optionsIcon = ['far', 'ellipsis'];
|
|
13
|
+
this.showIcons = true;
|
|
14
|
+
this.optionsButtonUUID = `sds-ta-${Math.ceil(Math.random() * 1000000)}`;
|
|
15
|
+
this.showDropdown = false;
|
|
16
|
+
}
|
|
17
|
+
executeAction(action) {
|
|
18
|
+
if (action.type = 'action') {
|
|
19
|
+
action.callback?.();
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
ngOnInit() { }
|
|
23
|
+
}
|
|
24
|
+
SdsTableActionsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.1", ngImport: i0, type: SdsTableActionsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
25
|
+
SdsTableActionsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.1", type: SdsTableActionsComponent, selector: "sds-table-actions", inputs: { actions: "actions", optionsIcon: "optionsIcon", showIcons: "showIcons" }, ngImport: i0, template: "\n<div class=\"sds-row-actions-container me-2\">\n <div class=\"dropdown\">\n\n <div class=\"sds-row-actions btn-group shadow-sm\">\n <ng-container *ngFor=\"let spotlightAction of actions\">\n <ng-container \n *ngIf=\"spotlightAction.type === 'action' && spotlightAction.spotlight\"\n [ngTemplateOutlet]=\"spotlightButtonTemplate\"\n [ngTemplateOutletContext]=\"{ action: spotlightAction }\">\n </ng-container>\n </ng-container>\n\n\n <button \n class=\"btn sds-row-quick-action sds-row-actions-button\"\n type=\"button\" \n data-bs-toggle=\"dropdown\" \n aria-expanded=\"false\">\n <fa-icon [icon]=\"optionsIcon\" [fixedWidth]=\"true\" [size]=\"'sm'\"></fa-icon>\n </button>\n\n <ul class=\"dropdown-menu py-2\">\n <li *ngFor=\"let action of actions\">\n\n <ng-container \n *ngIf=\"action.type === 'action'\"\n [ngTemplateOutlet]=\"dropdownActionTemplate\"\n [ngTemplateOutletContext]=\"{ action: action }\">\n </ng-container>\n\n <ng-container \n *ngIf=\"action.type === 'divider'\"\n [ngTemplateOutlet]=\"dropdownDividerTemplate\"\n >\n </ng-container>\n </li>\n </ul>\n\n\n <!-- <button \n [id]=\"optionsButtonUUID\"\n class=\"btn sds-row-quick-action sds-row-actions-button\"\n type=\"button\"\n (click)=\"showDropdown = !showDropdown\">\n <fa-icon [icon]=\"optionsIcon\" [fixedWidth]=\"true\" [size]=\"'sm'\"></fa-icon>\n </button>\n\n \n <dx-popover\n target=\"#{{optionsButtonUUID}}\"\n [(visible)]=\"showDropdown\"\n [wrapperAttr]=\"{ class: 'sds-table-actions-popover' }\"\n >\n <ul class=\"dropdown-menu py-2\">\n <li *ngFor=\"let action of actions\">\n \n <ng-container \n *ngIf=\"action.type === 'action'\"\n [ngTemplateOutlet]=\"dropdownActionTemplate\"\n [ngTemplateOutletContext]=\"{ action: action }\">\n </ng-container>\n \n <ng-container \n *ngIf=\"action.type === 'divider'\"\n [ngTemplateOutlet]=\"dropdownDividerTemplate\"\n >\n </ng-container>\n </li>\n </ul> \n </dx-popover> -->\n\n\n </div>\n\n\n <button \n class=\"btn sds-row-actions-placeholder\"\n type=\"button\">\n <fa-icon [icon]=\"optionsIcon\" [fixedWidth]=\"true\"></fa-icon>\n </button>\n\n </div>\n</div>\n\n\n<ng-template #spotlightButtonTemplate let-action=\"action\">\n\n <button \n type=\"button\" \n class=\"btn sds-row-quick-action\" \n rel=\"tooltip\"\n (click)=\"executeAction(action)\"\n title=\"{{action.name}}\"\n >\n <fa-icon \n *ngIf=\"action.icon\"\n [icon]=\"action.icon\" \n [size]=\"'sm'\"\n [fixedWidth]=\"true\">\n </fa-icon>\n <!-- <fa-icon [icon]=\"ICON_DELETE\" [fixedWidth]=\"true\"> </fa-icon> -->\n </button> \n\n \n</ng-template>\n\n\n<ng-template #dropdownActionTemplate let-action=\"action\">\n <button \n class=\"dropdown-item\" \n [class.dropdown-item-danger] = \"action.style === 'danger'\" \n type=\"button\" \n (click)=\"executeAction(action)\"\n >\n <div class=\"sds-flex-row-center gap-2\">\n <div \n *ngIf=\"showIcons\"\n class=\"action-button-icon\"\n >\n <fa-icon \n *ngIf=\"action.icon\"\n [icon]=\"action.icon\" \n [size]=\"'sm'\"\n [fixedWidth]=\"true\">\n </fa-icon>\n </div>\n <span>{{action.name}}</span>\n </div>\n </button>\n</ng-template>\n\n<ng-template #dropdownDividerTemplate >\n <hr class=\"dropdown-divider\">\n</ng-template>", styles: [".dropdown-item-danger{color:#cc5252}.dropdown-item-danger:active{background-color:#cc5252;color:#f8f9fa}.action-button-icon{width:1.2rem}.sds-row-actions{right:0}.sds-row-actions-button{border-top-right-radius:.266rem!important;border-bottom-right-radius:.266rem!important}\n"], components: [{ type: i1.FaIconComponent, selector: "fa-icon", inputs: ["icon", "title", "spin", "pulse", "mask", "styles", "flip", "size", "pull", "border", "inverse", "symbol", "rotate", "fixedWidth", "classes", "transform", "a11yRole"] }], directives: [{ type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i2.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }] });
|
|
26
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.1", ngImport: i0, type: SdsTableActionsComponent, decorators: [{
|
|
27
|
+
type: Component,
|
|
28
|
+
args: [{ selector: 'sds-table-actions', template: "\n<div class=\"sds-row-actions-container me-2\">\n <div class=\"dropdown\">\n\n <div class=\"sds-row-actions btn-group shadow-sm\">\n <ng-container *ngFor=\"let spotlightAction of actions\">\n <ng-container \n *ngIf=\"spotlightAction.type === 'action' && spotlightAction.spotlight\"\n [ngTemplateOutlet]=\"spotlightButtonTemplate\"\n [ngTemplateOutletContext]=\"{ action: spotlightAction }\">\n </ng-container>\n </ng-container>\n\n\n <button \n class=\"btn sds-row-quick-action sds-row-actions-button\"\n type=\"button\" \n data-bs-toggle=\"dropdown\" \n aria-expanded=\"false\">\n <fa-icon [icon]=\"optionsIcon\" [fixedWidth]=\"true\" [size]=\"'sm'\"></fa-icon>\n </button>\n\n <ul class=\"dropdown-menu py-2\">\n <li *ngFor=\"let action of actions\">\n\n <ng-container \n *ngIf=\"action.type === 'action'\"\n [ngTemplateOutlet]=\"dropdownActionTemplate\"\n [ngTemplateOutletContext]=\"{ action: action }\">\n </ng-container>\n\n <ng-container \n *ngIf=\"action.type === 'divider'\"\n [ngTemplateOutlet]=\"dropdownDividerTemplate\"\n >\n </ng-container>\n </li>\n </ul>\n\n\n <!-- <button \n [id]=\"optionsButtonUUID\"\n class=\"btn sds-row-quick-action sds-row-actions-button\"\n type=\"button\"\n (click)=\"showDropdown = !showDropdown\">\n <fa-icon [icon]=\"optionsIcon\" [fixedWidth]=\"true\" [size]=\"'sm'\"></fa-icon>\n </button>\n\n \n <dx-popover\n target=\"#{{optionsButtonUUID}}\"\n [(visible)]=\"showDropdown\"\n [wrapperAttr]=\"{ class: 'sds-table-actions-popover' }\"\n >\n <ul class=\"dropdown-menu py-2\">\n <li *ngFor=\"let action of actions\">\n \n <ng-container \n *ngIf=\"action.type === 'action'\"\n [ngTemplateOutlet]=\"dropdownActionTemplate\"\n [ngTemplateOutletContext]=\"{ action: action }\">\n </ng-container>\n \n <ng-container \n *ngIf=\"action.type === 'divider'\"\n [ngTemplateOutlet]=\"dropdownDividerTemplate\"\n >\n </ng-container>\n </li>\n </ul> \n </dx-popover> -->\n\n\n </div>\n\n\n <button \n class=\"btn sds-row-actions-placeholder\"\n type=\"button\">\n <fa-icon [icon]=\"optionsIcon\" [fixedWidth]=\"true\"></fa-icon>\n </button>\n\n </div>\n</div>\n\n\n<ng-template #spotlightButtonTemplate let-action=\"action\">\n\n <button \n type=\"button\" \n class=\"btn sds-row-quick-action\" \n rel=\"tooltip\"\n (click)=\"executeAction(action)\"\n title=\"{{action.name}}\"\n >\n <fa-icon \n *ngIf=\"action.icon\"\n [icon]=\"action.icon\" \n [size]=\"'sm'\"\n [fixedWidth]=\"true\">\n </fa-icon>\n <!-- <fa-icon [icon]=\"ICON_DELETE\" [fixedWidth]=\"true\"> </fa-icon> -->\n </button> \n\n \n</ng-template>\n\n\n<ng-template #dropdownActionTemplate let-action=\"action\">\n <button \n class=\"dropdown-item\" \n [class.dropdown-item-danger] = \"action.style === 'danger'\" \n type=\"button\" \n (click)=\"executeAction(action)\"\n >\n <div class=\"sds-flex-row-center gap-2\">\n <div \n *ngIf=\"showIcons\"\n class=\"action-button-icon\"\n >\n <fa-icon \n *ngIf=\"action.icon\"\n [icon]=\"action.icon\" \n [size]=\"'sm'\"\n [fixedWidth]=\"true\">\n </fa-icon>\n </div>\n <span>{{action.name}}</span>\n </div>\n </button>\n</ng-template>\n\n<ng-template #dropdownDividerTemplate >\n <hr class=\"dropdown-divider\">\n</ng-template>", styles: [".dropdown-item-danger{color:#cc5252}.dropdown-item-danger:active{background-color:#cc5252;color:#f8f9fa}.action-button-icon{width:1.2rem}.sds-row-actions{right:0}.sds-row-actions-button{border-top-right-radius:.266rem!important;border-bottom-right-radius:.266rem!important}\n"] }]
|
|
29
|
+
}], ctorParameters: function () { return []; }, propDecorators: { actions: [{
|
|
30
|
+
type: Input
|
|
31
|
+
}], optionsIcon: [{
|
|
32
|
+
type: Input
|
|
33
|
+
}], showIcons: [{
|
|
34
|
+
type: Input
|
|
35
|
+
}] } });
|
|
36
|
+
|
|
37
|
+
class SdsTableActionsModule {
|
|
38
|
+
}
|
|
39
|
+
SdsTableActionsModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.1", ngImport: i0, type: SdsTableActionsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
40
|
+
SdsTableActionsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.1", ngImport: i0, type: SdsTableActionsModule, declarations: [SdsTableActionsComponent], imports: [CommonModule,
|
|
41
|
+
FontAwesomeModule,
|
|
42
|
+
DxPopoverModule], exports: [SdsTableActionsComponent] });
|
|
43
|
+
SdsTableActionsModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.1", ngImport: i0, type: SdsTableActionsModule, imports: [[
|
|
44
|
+
CommonModule,
|
|
45
|
+
FontAwesomeModule,
|
|
46
|
+
DxPopoverModule
|
|
47
|
+
]] });
|
|
48
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.1", ngImport: i0, type: SdsTableActionsModule, decorators: [{
|
|
49
|
+
type: NgModule,
|
|
50
|
+
args: [{
|
|
51
|
+
declarations: [
|
|
52
|
+
SdsTableActionsComponent
|
|
53
|
+
],
|
|
54
|
+
imports: [
|
|
55
|
+
CommonModule,
|
|
56
|
+
FontAwesomeModule,
|
|
57
|
+
DxPopoverModule
|
|
58
|
+
],
|
|
59
|
+
exports: [
|
|
60
|
+
SdsTableActionsComponent
|
|
61
|
+
]
|
|
62
|
+
}]
|
|
63
|
+
}] });
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Generated bundle index. Do not edit.
|
|
67
|
+
*/
|
|
68
|
+
|
|
69
|
+
export { SdsTableActionsComponent, SdsTableActionsModule };
|
|
70
|
+
//# sourceMappingURL=spicainternational-ngx-sds-components-src-lib-table-actions.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"spicainternational-ngx-sds-components-src-lib-table-actions.mjs","sources":["../../../projects/ngx-sds-components/src/lib/table-actions/table-actions.component.ts","../../../projects/ngx-sds-components/src/lib/table-actions/table-actions.component.html","../../../projects/ngx-sds-components/src/lib/table-actions/table-actions.module.ts","../../../projects/ngx-sds-components/src/lib/table-actions/spicainternational-ngx-sds-components-src-lib-table-actions.ts"],"sourcesContent":["import { Component, Input, OnInit } from '@angular/core';\nimport { TableAction, TableActionDivider } from './table-actions.model';\nimport { IconProp } from '@fortawesome/fontawesome-svg-core';\n\n@Component({\n selector: 'sds-table-actions',\n templateUrl: './table-actions.component.html',\n styleUrls: ['./table-actions.component.scss'],\n})\nexport class SdsTableActionsComponent implements OnInit {\n\n @Input() actions: (TableAction | TableActionDivider)[] = [];\n\n @Input() optionsIcon: IconProp = ['far', 'ellipsis'];\n @Input() showIcons: boolean = true;\n\n public optionsButtonUUID = `sds-ta-${Math.ceil(Math.random() * 1000000)}`;\n public showDropdown = false;\n\n constructor() {}\n\n public executeAction(action: any): void {\n if (action.type = 'action') {\n action.callback?.();\n }\n }\n\n ngOnInit(): void {}\n}\n","\n<div class=\"sds-row-actions-container me-2\">\n <div class=\"dropdown\">\n\n <div class=\"sds-row-actions btn-group shadow-sm\">\n <ng-container *ngFor=\"let spotlightAction of actions\">\n <ng-container \n *ngIf=\"spotlightAction.type === 'action' && spotlightAction.spotlight\"\n [ngTemplateOutlet]=\"spotlightButtonTemplate\"\n [ngTemplateOutletContext]=\"{ action: spotlightAction }\">\n </ng-container>\n </ng-container>\n\n\n <button \n class=\"btn sds-row-quick-action sds-row-actions-button\"\n type=\"button\" \n data-bs-toggle=\"dropdown\" \n aria-expanded=\"false\">\n <fa-icon [icon]=\"optionsIcon\" [fixedWidth]=\"true\" [size]=\"'sm'\"></fa-icon>\n </button>\n\n <ul class=\"dropdown-menu py-2\">\n <li *ngFor=\"let action of actions\">\n\n <ng-container \n *ngIf=\"action.type === 'action'\"\n [ngTemplateOutlet]=\"dropdownActionTemplate\"\n [ngTemplateOutletContext]=\"{ action: action }\">\n </ng-container>\n\n <ng-container \n *ngIf=\"action.type === 'divider'\"\n [ngTemplateOutlet]=\"dropdownDividerTemplate\"\n >\n </ng-container>\n </li>\n </ul>\n\n\n <!-- <button \n [id]=\"optionsButtonUUID\"\n class=\"btn sds-row-quick-action sds-row-actions-button\"\n type=\"button\"\n (click)=\"showDropdown = !showDropdown\">\n <fa-icon [icon]=\"optionsIcon\" [fixedWidth]=\"true\" [size]=\"'sm'\"></fa-icon>\n </button>\n\n \n <dx-popover\n target=\"#{{optionsButtonUUID}}\"\n [(visible)]=\"showDropdown\"\n [wrapperAttr]=\"{ class: 'sds-table-actions-popover' }\"\n >\n <ul class=\"dropdown-menu py-2\">\n <li *ngFor=\"let action of actions\">\n \n <ng-container \n *ngIf=\"action.type === 'action'\"\n [ngTemplateOutlet]=\"dropdownActionTemplate\"\n [ngTemplateOutletContext]=\"{ action: action }\">\n </ng-container>\n \n <ng-container \n *ngIf=\"action.type === 'divider'\"\n [ngTemplateOutlet]=\"dropdownDividerTemplate\"\n >\n </ng-container>\n </li>\n </ul> \n </dx-popover> -->\n\n\n </div>\n\n\n <button \n class=\"btn sds-row-actions-placeholder\"\n type=\"button\">\n <fa-icon [icon]=\"optionsIcon\" [fixedWidth]=\"true\"></fa-icon>\n </button>\n\n </div>\n</div>\n\n\n<ng-template #spotlightButtonTemplate let-action=\"action\">\n\n <button \n type=\"button\" \n class=\"btn sds-row-quick-action\" \n rel=\"tooltip\"\n (click)=\"executeAction(action)\"\n title=\"{{action.name}}\"\n >\n <fa-icon \n *ngIf=\"action.icon\"\n [icon]=\"action.icon\" \n [size]=\"'sm'\"\n [fixedWidth]=\"true\">\n </fa-icon>\n <!-- <fa-icon [icon]=\"ICON_DELETE\" [fixedWidth]=\"true\"> </fa-icon> -->\n </button> \n\n \n</ng-template>\n\n\n<ng-template #dropdownActionTemplate let-action=\"action\">\n <button \n class=\"dropdown-item\" \n [class.dropdown-item-danger] = \"action.style === 'danger'\" \n type=\"button\" \n (click)=\"executeAction(action)\"\n >\n <div class=\"sds-flex-row-center gap-2\">\n <div \n *ngIf=\"showIcons\"\n class=\"action-button-icon\"\n >\n <fa-icon \n *ngIf=\"action.icon\"\n [icon]=\"action.icon\" \n [size]=\"'sm'\"\n [fixedWidth]=\"true\">\n </fa-icon>\n </div>\n <span>{{action.name}}</span>\n </div>\n </button>\n</ng-template>\n\n<ng-template #dropdownDividerTemplate >\n <hr class=\"dropdown-divider\">\n</ng-template>","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { SdsTableActionsComponent } from './table-actions.component';\nimport { FontAwesomeModule } from '@fortawesome/angular-fontawesome';\nimport { DxPopoverModule } from 'devextreme-angular';\n\n\n\n@NgModule({\n declarations: [\n SdsTableActionsComponent\n ],\n imports: [\n CommonModule,\n FontAwesomeModule,\n DxPopoverModule\n ],\n exports: [\n SdsTableActionsComponent\n ]\n})\nexport class SdsTableActionsModule { }\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;MASa,wBAAwB,CAAA;AAUjC,IAAA,WAAA,GAAA;QARS,IAAO,CAAA,OAAA,GAAyC,EAAE,CAAC;AAEnD,QAAA,IAAA,CAAA,WAAW,GAAa,CAAC,KAAK,EAAE,UAAU,CAAC,CAAC;QAC5C,IAAS,CAAA,SAAA,GAAY,IAAI,CAAC;AAE5B,QAAA,IAAA,CAAA,iBAAiB,GAAG,CAAA,OAAA,EAAU,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,OAAO,CAAC,EAAE,CAAC;QACnE,IAAY,CAAA,YAAA,GAAG,KAAK,CAAC;KAEZ;AAET,IAAA,aAAa,CAAC,MAAW,EAAA;AAC5B,QAAA,IAAI,MAAM,CAAC,IAAI,GAAG,QAAQ,EAAE;AACxB,YAAA,MAAM,CAAC,QAAQ,IAAI,CAAC;AACvB,SAAA;KACJ;AAED,IAAA,QAAQ,MAAW;;qHAlBV,wBAAwB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;AAAxB,wBAAA,CAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,wBAAwB,6ICTrC,okJAsIc,EAAA,MAAA,EAAA,CAAA,qRAAA,CAAA,EAAA,UAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,eAAA,EAAA,QAAA,EAAA,SAAA,EAAA,MAAA,EAAA,CAAA,MAAA,EAAA,OAAA,EAAA,MAAA,EAAA,OAAA,EAAA,MAAA,EAAA,QAAA,EAAA,MAAA,EAAA,MAA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,EAAA,EAAA,IAAA,EAAA,qBAAqB,EATvB,OAAA,EAAA,CAAA;YACP,YAAY;YACZ,iBAAiB;YACjB,eAAe;AAChB,SAAA,CAAA,EAAA,CAAA,CAAA;2FAKU,qBAAqB,EAAA,UAAA,EAAA,CAAA;kBAbjC,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,YAAY,EAAE;wBACZ,wBAAwB;AACzB,qBAAA;AACD,oBAAA,OAAO,EAAE;wBACP,YAAY;wBACZ,iBAAiB;wBACjB,eAAe;AAChB,qBAAA;AACD,oBAAA,OAAO,EAAE;wBACP,wBAAwB;AACzB,qBAAA;AACF,iBAAA,CAAA;;;ACpBD;;AAEG;;;;"}
|
|
@@ -24,6 +24,7 @@ export * from '@spicainternational/ngx-sds-components/src/lib/side-bar';
|
|
|
24
24
|
export * from '@spicainternational/ngx-sds-components/src/lib/static-value';
|
|
25
25
|
export * from '@spicainternational/ngx-sds-components/src/lib/timer';
|
|
26
26
|
export * from '@spicainternational/ngx-sds-components/src/lib/tooltip';
|
|
27
|
+
export * from '@spicainternational/ngx-sds-components/src/lib/table-actions';
|
|
27
28
|
|
|
28
29
|
/*
|
|
29
30
|
* Public API Surface of ngx-sds-components
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"spicainternational-ngx-sds-components.mjs","sources":["../../../projects/ngx-sds-components/src/public-api.ts","../../../projects/ngx-sds-components/src/spicainternational-ngx-sds-components.ts"],"sourcesContent":["/*\r\n * Public API Surface of ngx-sds-components\r\n */\r\n\r\nexport * from '@spicainternational/ngx-sds-components/src/lib/app-switcher';\r\nexport * from '@spicainternational/ngx-sds-components/src/lib/avatar';\r\nexport * from '@spicainternational/ngx-sds-components/src/lib/badge';\r\nexport * from '@spicainternational/ngx-sds-components/src/lib/callout';\r\nexport * from '@spicainternational/ngx-sds-components/src/lib/color-picker';\r\nexport * from '@spicainternational/ngx-sds-components/src/lib/ellipsis';\r\nexport * from '@spicainternational/ngx-sds-components/src/lib/expansion-panel';\r\nexport * from '@spicainternational/ngx-sds-components/src/lib/date-picker';\r\nexport * from '@spicainternational/ngx-sds-components/src/lib/date-pipes';\r\nexport * from '@spicainternational/ngx-sds-components/src/lib/duration-pipe';\r\nexport * from '@spicainternational/ngx-sds-components/src/lib/duration-box';\r\nexport * from '@spicainternational/ngx-sds-components/src/lib/highlight-text';\r\nexport * from '@spicainternational/ngx-sds-components/src/lib/intersection';\r\nexport * from '@spicainternational/ngx-sds-components/src/lib/keyboard-shortcut';\r\nexport * from '@spicainternational/ngx-sds-components/src/lib/layout';\r\nexport * from '@spicainternational/ngx-sds-components/src/lib/message';\r\nexport * from '@spicainternational/ngx-sds-components/src/lib/modal';\r\nexport * from '@spicainternational/ngx-sds-components/src/lib/navigation';\r\nexport * from '@spicainternational/ngx-sds-components/src/lib/page-header';\r\nexport * from '@spicainternational/ngx-sds-components/src/lib/pane';\r\nexport * from '@spicainternational/ngx-sds-components/src/lib/quick-info';\r\nexport * from '@spicainternational/ngx-sds-components/src/lib/segmented-control';\r\nexport * from '@spicainternational/ngx-sds-components/src/lib/side-bar';\r\nexport * from '@spicainternational/ngx-sds-components/src/lib/static-value';\r\nexport * from '@spicainternational/ngx-sds-components/src/lib/timer';\r\nexport * from '@spicainternational/ngx-sds-components/src/lib/tooltip';\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"spicainternational-ngx-sds-components.mjs","sources":["../../../projects/ngx-sds-components/src/public-api.ts","../../../projects/ngx-sds-components/src/spicainternational-ngx-sds-components.ts"],"sourcesContent":["/*\r\n * Public API Surface of ngx-sds-components\r\n */\r\n\r\nexport * from '@spicainternational/ngx-sds-components/src/lib/app-switcher';\r\nexport * from '@spicainternational/ngx-sds-components/src/lib/avatar';\r\nexport * from '@spicainternational/ngx-sds-components/src/lib/badge';\r\nexport * from '@spicainternational/ngx-sds-components/src/lib/callout';\r\nexport * from '@spicainternational/ngx-sds-components/src/lib/color-picker';\r\nexport * from '@spicainternational/ngx-sds-components/src/lib/ellipsis';\r\nexport * from '@spicainternational/ngx-sds-components/src/lib/expansion-panel';\r\nexport * from '@spicainternational/ngx-sds-components/src/lib/date-picker';\r\nexport * from '@spicainternational/ngx-sds-components/src/lib/date-pipes';\r\nexport * from '@spicainternational/ngx-sds-components/src/lib/duration-pipe';\r\nexport * from '@spicainternational/ngx-sds-components/src/lib/duration-box';\r\nexport * from '@spicainternational/ngx-sds-components/src/lib/highlight-text';\r\nexport * from '@spicainternational/ngx-sds-components/src/lib/intersection';\r\nexport * from '@spicainternational/ngx-sds-components/src/lib/keyboard-shortcut';\r\nexport * from '@spicainternational/ngx-sds-components/src/lib/layout';\r\nexport * from '@spicainternational/ngx-sds-components/src/lib/message';\r\nexport * from '@spicainternational/ngx-sds-components/src/lib/modal';\r\nexport * from '@spicainternational/ngx-sds-components/src/lib/navigation';\r\nexport * from '@spicainternational/ngx-sds-components/src/lib/page-header';\r\nexport * from '@spicainternational/ngx-sds-components/src/lib/pane';\r\nexport * from '@spicainternational/ngx-sds-components/src/lib/quick-info';\r\nexport * from '@spicainternational/ngx-sds-components/src/lib/segmented-control';\r\nexport * from '@spicainternational/ngx-sds-components/src/lib/side-bar';\r\nexport * from '@spicainternational/ngx-sds-components/src/lib/static-value';\r\nexport * from '@spicainternational/ngx-sds-components/src/lib/timer';\r\nexport * from '@spicainternational/ngx-sds-components/src/lib/tooltip';\r\nexport * from '@spicainternational/ngx-sds-components/src/lib/table-actions';\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AAEG;;ACFH;;AAEG"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@spicainternational/ngx-sds-components",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.25.1",
|
|
4
|
+
"license": "MIT",
|
|
4
5
|
"description": "Spica design system angular components.",
|
|
5
6
|
"peerDependencies": {
|
|
6
7
|
"@angular/common": ">=13.3.0",
|
|
@@ -230,6 +231,14 @@
|
|
|
230
231
|
"node": "./fesm2015/spicainternational-ngx-sds-components-src-lib-static-value.mjs",
|
|
231
232
|
"default": "./fesm2020/spicainternational-ngx-sds-components-src-lib-static-value.mjs"
|
|
232
233
|
},
|
|
234
|
+
"./src/lib/table-actions": {
|
|
235
|
+
"types": "./src/lib/table-actions/spicainternational-ngx-sds-components-src-lib-table-actions.d.ts",
|
|
236
|
+
"esm2020": "./esm2020/src/lib/table-actions/spicainternational-ngx-sds-components-src-lib-table-actions.mjs",
|
|
237
|
+
"es2020": "./fesm2020/spicainternational-ngx-sds-components-src-lib-table-actions.mjs",
|
|
238
|
+
"es2015": "./fesm2015/spicainternational-ngx-sds-components-src-lib-table-actions.mjs",
|
|
239
|
+
"node": "./fesm2015/spicainternational-ngx-sds-components-src-lib-table-actions.mjs",
|
|
240
|
+
"default": "./fesm2020/spicainternational-ngx-sds-components-src-lib-table-actions.mjs"
|
|
241
|
+
},
|
|
233
242
|
"./src/lib/timer": {
|
|
234
243
|
"types": "./src/lib/timer/spicainternational-ngx-sds-components-src-lib-timer.d.ts",
|
|
235
244
|
"esm2020": "./esm2020/src/lib/timer/spicainternational-ngx-sds-components-src-lib-timer.mjs",
|
package/public-api.d.ts
CHANGED
|
@@ -24,3 +24,4 @@ export * from '@spicainternational/ngx-sds-components/src/lib/side-bar';
|
|
|
24
24
|
export * from '@spicainternational/ngx-sds-components/src/lib/static-value';
|
|
25
25
|
export * from '@spicainternational/ngx-sds-components/src/lib/timer';
|
|
26
26
|
export * from '@spicainternational/ngx-sds-components/src/lib/tooltip';
|
|
27
|
+
export * from '@spicainternational/ngx-sds-components/src/lib/table-actions';
|
|
@@ -12,7 +12,7 @@ export declare class SdsMessageComponent implements OnInit {
|
|
|
12
12
|
showAction: boolean;
|
|
13
13
|
actionText: string;
|
|
14
14
|
actionClick: EventEmitter<void>;
|
|
15
|
-
style: 'default' | 'danger' | 'success';
|
|
15
|
+
style: 'default' | 'danger' | 'success' | 'warning';
|
|
16
16
|
showMessage: boolean;
|
|
17
17
|
constructor();
|
|
18
18
|
ngOnInit(): void;
|
|
@@ -21,15 +21,22 @@ export declare class SdsDialogComponent implements OnInit {
|
|
|
21
21
|
showSecondaryButton: boolean;
|
|
22
22
|
autofocusElement: 'primary' | 'secondary' | 'close' | 'content';
|
|
23
23
|
modalDialogId?: string;
|
|
24
|
+
/**
|
|
25
|
+
* @deprecated Use isOpenChange instead
|
|
26
|
+
*/
|
|
24
27
|
dialogOpen: EventEmitter<void>;
|
|
28
|
+
/**
|
|
29
|
+
* @deprecated Use isOpenChange instead
|
|
30
|
+
*/
|
|
25
31
|
dialogClose: EventEmitter<void>;
|
|
32
|
+
isOpen: boolean;
|
|
33
|
+
isOpenChange: EventEmitter<boolean>;
|
|
26
34
|
private _modal;
|
|
27
35
|
private _content?;
|
|
28
36
|
private _primaryButton?;
|
|
29
37
|
private _secondaryButton?;
|
|
30
38
|
private _callback?;
|
|
31
39
|
private _callbackData;
|
|
32
|
-
isOpen: boolean;
|
|
33
40
|
constructor();
|
|
34
41
|
ngOnInit(): void;
|
|
35
42
|
open(callback?: (button: modalButton, data: any) => void, data?: any): void;
|
|
@@ -41,6 +48,6 @@ export declare class SdsDialogComponent implements OnInit {
|
|
|
41
48
|
onModalClose(): void;
|
|
42
49
|
onModalOpen(): void;
|
|
43
50
|
static ɵfac: i0.ɵɵFactoryDeclaration<SdsDialogComponent, never>;
|
|
44
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<SdsDialogComponent, "sds-dialog", never, { "title": "title"; "closeText": "closeText"; "size": "size"; "primaryButtonText": "primaryButtonText"; "primaryButtonClass": "primaryButtonClass"; "primaryButtonType": "primaryButtonType"; "primaryButtonId": "primaryButtonId"; "secondaryButtonText": "secondaryButtonText"; "secondaryButtonClass": "secondaryButtonClass"; "secondaryButtonType": "secondaryButtonType"; "secondaryButtonId": "secondaryButtonId"; "closeOnEscape": "closeOnEscape"; "showHeader": "showHeader"; "showCloseButton": "showCloseButton"; "showPrimaryButton": "showPrimaryButton"; "showSecondaryButton": "showSecondaryButton"; "autofocusElement": "autofocusElement"; "modalDialogId": "modalDialogId"; }, { "dialogOpen": "dialogOpen"; "dialogClose": "dialogClose"; }, never, ["*"]>;
|
|
51
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<SdsDialogComponent, "sds-dialog", never, { "title": "title"; "closeText": "closeText"; "size": "size"; "primaryButtonText": "primaryButtonText"; "primaryButtonClass": "primaryButtonClass"; "primaryButtonType": "primaryButtonType"; "primaryButtonId": "primaryButtonId"; "secondaryButtonText": "secondaryButtonText"; "secondaryButtonClass": "secondaryButtonClass"; "secondaryButtonType": "secondaryButtonType"; "secondaryButtonId": "secondaryButtonId"; "closeOnEscape": "closeOnEscape"; "showHeader": "showHeader"; "showCloseButton": "showCloseButton"; "showPrimaryButton": "showPrimaryButton"; "showSecondaryButton": "showSecondaryButton"; "autofocusElement": "autofocusElement"; "modalDialogId": "modalDialogId"; "isOpen": "isOpen"; }, { "dialogOpen": "dialogOpen"; "dialogClose": "dialogClose"; "isOpenChange": "isOpenChange"; }, never, ["*"]>;
|
|
45
52
|
}
|
|
46
53
|
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { ElementRef, OnInit, EventEmitter } from '@angular/core';
|
|
1
|
+
import { ElementRef, OnInit, EventEmitter, OnChanges, SimpleChanges } from '@angular/core';
|
|
2
2
|
import { ModalTranslations } from './modal.model';
|
|
3
3
|
import * as i0 from "@angular/core";
|
|
4
|
-
export declare class SdsModalComponent implements OnInit {
|
|
4
|
+
export declare class SdsModalComponent implements OnInit, OnChanges {
|
|
5
5
|
headerContent: ElementRef;
|
|
6
6
|
modalTitle?: string;
|
|
7
7
|
showHeader: boolean;
|
|
@@ -13,20 +13,28 @@ export declare class SdsModalComponent implements OnInit {
|
|
|
13
13
|
translations: ModalTranslations;
|
|
14
14
|
isScrollable: boolean;
|
|
15
15
|
closeOnEscape: boolean;
|
|
16
|
+
/**
|
|
17
|
+
* @deprecated Use isOpenChange instead
|
|
18
|
+
*/
|
|
16
19
|
modalOpen: EventEmitter<void>;
|
|
20
|
+
/**
|
|
21
|
+
* @deprecated Use isOpenChange instead
|
|
22
|
+
*/
|
|
17
23
|
modalClose: EventEmitter<void>;
|
|
18
24
|
closeClick: EventEmitter<void>;
|
|
19
25
|
closeEscapeKeypress: EventEmitter<void>;
|
|
20
26
|
closeIcon: import("@fortawesome/fontawesome-common-types").IconDefinition;
|
|
21
27
|
isOpen: boolean;
|
|
28
|
+
isOpenChange: EventEmitter<boolean>;
|
|
22
29
|
private _modal;
|
|
23
30
|
private _closeButton;
|
|
24
31
|
constructor();
|
|
32
|
+
ngOnChanges(changes: SimpleChanges): void;
|
|
25
33
|
ngOnInit(): void;
|
|
26
34
|
open(): void;
|
|
27
35
|
close(): void;
|
|
28
36
|
onCloseButtonClick(): void;
|
|
29
37
|
onKeydown(event: KeyboardEvent): void;
|
|
30
38
|
static ɵfac: i0.ɵɵFactoryDeclaration<SdsModalComponent, never>;
|
|
31
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<SdsModalComponent, "sds-modal", never, { "modalTitle": "modalTitle"; "showHeader": "showHeader"; "showFooter": "showFooter"; "size": "size"; "modalDialogId": "modalDialogId"; "showCloseButton": "showCloseButton"; "autoFocusCloseButton": "autoFocusCloseButton"; "translations": "translations"; "isScrollable": "isScrollable"; "closeOnEscape": "closeOnEscape"; }, { "modalOpen": "modalOpen"; "modalClose": "modalClose"; "closeClick": "closeClick"; "closeEscapeKeypress": "closeEscapeKeypress"; }, ["headerContent"], ["header", "*", "footer"]>;
|
|
39
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<SdsModalComponent, "sds-modal", never, { "modalTitle": "modalTitle"; "showHeader": "showHeader"; "showFooter": "showFooter"; "size": "size"; "modalDialogId": "modalDialogId"; "showCloseButton": "showCloseButton"; "autoFocusCloseButton": "autoFocusCloseButton"; "translations": "translations"; "isScrollable": "isScrollable"; "closeOnEscape": "closeOnEscape"; "isOpen": "isOpen"; }, { "modalOpen": "modalOpen"; "modalClose": "modalClose"; "closeClick": "closeClick"; "closeEscapeKeypress": "closeEscapeKeypress"; "isOpenChange": "isOpenChange"; }, ["headerContent"], ["header", "*", "footer"]>;
|
|
32
40
|
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
{
|
|
2
|
+
"module": "../../../fesm2015/spicainternational-ngx-sds-components-src-lib-table-actions.mjs",
|
|
3
|
+
"es2020": "../../../fesm2020/spicainternational-ngx-sds-components-src-lib-table-actions.mjs",
|
|
4
|
+
"esm2020": "../../../esm2020/src/lib/table-actions/spicainternational-ngx-sds-components-src-lib-table-actions.mjs",
|
|
5
|
+
"fesm2020": "../../../fesm2020/spicainternational-ngx-sds-components-src-lib-table-actions.mjs",
|
|
6
|
+
"fesm2015": "../../../fesm2015/spicainternational-ngx-sds-components-src-lib-table-actions.mjs",
|
|
7
|
+
"typings": "spicainternational-ngx-sds-components-src-lib-table-actions.d.ts",
|
|
8
|
+
"sideEffects": false,
|
|
9
|
+
"name": "@spicainternational/ngx-sds-components/src/lib/table-actions"
|
|
10
|
+
}
|