@posiwise/utils 0.0.143 → 0.0.145

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.
@@ -1,53 +1,69 @@
1
- import * as i2 from '@angular/cdk/drag-drop';
2
- import { moveItemInArray, DragDropModule } from '@angular/cdk/drag-drop';
3
- import * as i0 from '@angular/core';
4
- import { EventEmitter, Output, Input, Component } from '@angular/core';
5
- import * as i1 from '@angular/forms';
6
- import { FormsModule } from '@angular/forms';
7
-
8
- /**
9
- * Edit Navbar Modal Component
10
- * Contains drag-drop functionality for reordering navbar items
11
- * This component is lazy-loaded only when the edit modal is opened
12
- */
13
- class EditNavbarModalComponent {
14
- constructor() {
15
- this.save = new EventEmitter();
16
- this.closeEvent = new EventEmitter();
17
- }
18
- dropNavbarItems(event) {
19
- moveItemInArray(this.editingNavbar.items, event.previousIndex, event.currentIndex);
20
- }
21
- dropNavbarSubtitles(index, event) {
22
- moveItemInArray(this.editingNavbar.items[index].subtitles, event.previousIndex, event.currentIndex);
23
- }
24
- addNavbarItem() {
25
- this.editingNavbar.items.push({
26
- title: '',
27
- path: '',
28
- subtitles: []
29
- });
30
- }
31
- removeNavbarItem(index) {
32
- this.editingNavbar.items.splice(index, 1);
33
- }
34
- addNavbarSubtitle(index) {
35
- this.editingNavbar.items[index].subtitles.push({
36
- title: '',
37
- path: ''
38
- });
39
- }
40
- removeNavbarSubtitle(navIndex, subIndex) {
41
- this.editingNavbar.items[navIndex].subtitles.splice(subIndex, 1);
42
- }
43
- onSave() {
44
- this.save.emit(this.editingNavbar);
45
- }
46
- onClose() {
47
- this.closeEvent.emit();
48
- }
49
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.19", ngImport: i0, type: EditNavbarModalComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
50
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.19", type: EditNavbarModalComponent, isStandalone: true, selector: "pw-edit-navbar-modal", inputs: { editingNavbar: "editingNavbar" }, outputs: { save: "save", closeEvent: "closeEvent" }, ngImport: i0, template: `
1
+ import * as i0 from "@angular/core";
2
+ import { Component, EventEmitter, Input, Output } from "@angular/core";
3
+ import * as i1 from "@angular/forms";
4
+ import { FormsModule } from "@angular/forms";
5
+ import * as i2 from "@angular/cdk/drag-drop";
6
+ import { DragDropModule, moveItemInArray } from "@angular/cdk/drag-drop";
7
+ var EditNavbarModalComponent = class EditNavbarModalComponent {
8
+ constructor() {
9
+ this.save = new EventEmitter();
10
+ this.closeEvent = new EventEmitter();
11
+ }
12
+ dropNavbarItems(event) {
13
+ moveItemInArray(this.editingNavbar.items, event.previousIndex, event.currentIndex);
14
+ }
15
+ dropNavbarSubtitles(index, event) {
16
+ moveItemInArray(this.editingNavbar.items[index].subtitles, event.previousIndex, event.currentIndex);
17
+ }
18
+ addNavbarItem() {
19
+ this.editingNavbar.items.push({
20
+ title: "",
21
+ path: "",
22
+ subtitles: []
23
+ });
24
+ }
25
+ removeNavbarItem(index) {
26
+ this.editingNavbar.items.splice(index, 1);
27
+ }
28
+ addNavbarSubtitle(index) {
29
+ this.editingNavbar.items[index].subtitles.push({
30
+ title: "",
31
+ path: ""
32
+ });
33
+ }
34
+ removeNavbarSubtitle(navIndex, subIndex) {
35
+ this.editingNavbar.items[navIndex].subtitles.splice(subIndex, 1);
36
+ }
37
+ onSave() {
38
+ this.save.emit(this.editingNavbar);
39
+ }
40
+ onClose() {
41
+ this.closeEvent.emit();
42
+ }
43
+ static {
44
+ this.ɵfac = i0.ɵɵngDeclareFactory({
45
+ minVersion: "12.0.0",
46
+ version: "22.2.0",
47
+ ngImport: i0,
48
+ type: EditNavbarModalComponent,
49
+ deps: [],
50
+ target: i0.ɵɵFactoryTarget.Component
51
+ });
52
+ }
53
+ static {
54
+ this.ɵcmp = i0.ɵɵngDeclareComponent({
55
+ minVersion: "17.0.0",
56
+ version: "22.2.0",
57
+ type: EditNavbarModalComponent,
58
+ isStandalone: true,
59
+ selector: "pw-edit-navbar-modal",
60
+ inputs: { editingNavbar: "editingNavbar" },
61
+ outputs: {
62
+ save: "save",
63
+ closeEvent: "closeEvent"
64
+ },
65
+ ngImport: i0,
66
+ template: `
51
67
  <div class="modal-header">
52
68
  <h5 class="modal-title">Edit Navbar Links</h5>
53
69
  <button type="button" class="btn-close" aria-label="Close" (click)="onClose()"></button>
@@ -153,15 +169,117 @@ class EditNavbarModalComponent {
153
169
  <button class="btn btn-secondary" (click)="onClose()">Cancel</button>
154
170
  <button class="btn btn-primary" (click)="onSave()">Save</button>
155
171
  </div>
156
- `, isInline: true, dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: DragDropModule }, { kind: "directive", type: i2.CdkDropList, selector: "[cdkDropList], cdk-drop-list", inputs: ["cdkDropListConnectedTo", "cdkDropListData", "cdkDropListOrientation", "id", "cdkDropListLockAxis", "cdkDropListDisabled", "cdkDropListSortingDisabled", "cdkDropListEnterPredicate", "cdkDropListSortPredicate", "cdkDropListAutoScrollDisabled", "cdkDropListAutoScrollStep", "cdkDropListElementContainer", "cdkDropListHasAnchor"], outputs: ["cdkDropListDropped", "cdkDropListEntered", "cdkDropListExited", "cdkDropListSorted"], exportAs: ["cdkDropList"] }, { kind: "directive", type: i2.CdkDrag, selector: "[cdkDrag]", inputs: ["cdkDragData", "cdkDragLockAxis", "cdkDragRootElement", "cdkDragBoundary", "cdkDragStartDelay", "cdkDragFreeDragPosition", "cdkDragDisabled", "cdkDragConstrainPosition", "cdkDragPreviewClass", "cdkDragPreviewContainer", "cdkDragScale"], outputs: ["cdkDragStarted", "cdkDragReleased", "cdkDragEnded", "cdkDragEntered", "cdkDragExited", "cdkDragDropped", "cdkDragMoved"], exportAs: ["cdkDrag"] }, { kind: "directive", type: i2.CdkDragHandle, selector: "[cdkDragHandle]", inputs: ["cdkDragHandleDisabled"] }] }); }
157
- }
158
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.19", ngImport: i0, type: EditNavbarModalComponent, decorators: [{
159
- type: Component,
160
- args: [{
161
- selector: 'pw-edit-navbar-modal',
162
- standalone: true,
163
- imports: [FormsModule, DragDropModule],
164
- template: `
172
+ `,
173
+ isInline: true,
174
+ dependencies: [
175
+ {
176
+ kind: "ngmodule",
177
+ type: FormsModule
178
+ },
179
+ {
180
+ kind: "directive",
181
+ type: i1.DefaultValueAccessor,
182
+ selector: "input:not([type=checkbox]):not([ngNoCva])[formControlName],textarea:not([ngNoCva])[formControlName],input:not([type=checkbox]):not([ngNoCva])[formControl],textarea:not([ngNoCva])[formControl],input:not([type=checkbox]):not([ngNoCva])[ngModel],textarea:not([ngNoCva])[ngModel],[ngDefaultControl]"
183
+ },
184
+ {
185
+ kind: "directive",
186
+ type: i1.NgControlStatus,
187
+ selector: "[formControlName],[ngModel],[formControl]"
188
+ },
189
+ {
190
+ kind: "directive",
191
+ type: i1.NgModel,
192
+ selector: "[ngModel]:not([formControlName]):not([formControl])",
193
+ inputs: [
194
+ "name",
195
+ "disabled",
196
+ "ngModel",
197
+ "ngModelOptions"
198
+ ],
199
+ outputs: ["ngModelChange"],
200
+ exportAs: ["ngModel"]
201
+ },
202
+ {
203
+ kind: "ngmodule",
204
+ type: DragDropModule
205
+ },
206
+ {
207
+ kind: "directive",
208
+ type: i2.CdkDropList,
209
+ selector: "[cdkDropList], cdk-drop-list",
210
+ inputs: [
211
+ "cdkDropListConnectedTo",
212
+ "cdkDropListData",
213
+ "cdkDropListOrientation",
214
+ "id",
215
+ "cdkDropListLockAxis",
216
+ "cdkDropListDisabled",
217
+ "cdkDropListSortingDisabled",
218
+ "cdkDropListEnterPredicate",
219
+ "cdkDropListSortPredicate",
220
+ "cdkDropListAutoScrollDisabled",
221
+ "cdkDropListAutoScrollStep",
222
+ "cdkDropListElementContainer",
223
+ "cdkDropListHasAnchor"
224
+ ],
225
+ outputs: [
226
+ "cdkDropListDropped",
227
+ "cdkDropListEntered",
228
+ "cdkDropListExited",
229
+ "cdkDropListSorted"
230
+ ],
231
+ exportAs: ["cdkDropList"]
232
+ },
233
+ {
234
+ kind: "directive",
235
+ type: i2.CdkDrag,
236
+ selector: "[cdkDrag]",
237
+ inputs: [
238
+ "cdkDragData",
239
+ "cdkDragLockAxis",
240
+ "cdkDragRootElement",
241
+ "cdkDragBoundary",
242
+ "cdkDragStartDelay",
243
+ "cdkDragFreeDragPosition",
244
+ "cdkDragDisabled",
245
+ "cdkDragConstrainPosition",
246
+ "cdkDragPreviewClass",
247
+ "cdkDragPreviewContainer",
248
+ "cdkDragScale"
249
+ ],
250
+ outputs: [
251
+ "cdkDragStarted",
252
+ "cdkDragReleased",
253
+ "cdkDragEnded",
254
+ "cdkDragEntered",
255
+ "cdkDragExited",
256
+ "cdkDragDropped",
257
+ "cdkDragMoved"
258
+ ],
259
+ exportAs: ["cdkDrag"]
260
+ },
261
+ {
262
+ kind: "directive",
263
+ type: i2.CdkDragHandle,
264
+ selector: "[cdkDragHandle]",
265
+ inputs: ["cdkDragHandleDisabled"]
266
+ }
267
+ ]
268
+ });
269
+ }
270
+ };
271
+ i0.ɵɵngDeclareClassMetadata({
272
+ minVersion: "12.0.0",
273
+ version: "22.2.0",
274
+ ngImport: i0,
275
+ type: EditNavbarModalComponent,
276
+ decorators: [{
277
+ type: Component,
278
+ args: [{
279
+ selector: "pw-edit-navbar-modal",
280
+ standalone: true,
281
+ imports: [FormsModule, DragDropModule],
282
+ template: `
165
283
  <div class="modal-header">
166
284
  <h5 class="modal-title">Edit Navbar Links</h5>
167
285
  <button type="button" class="btn-close" aria-label="Close" (click)="onClose()"></button>
@@ -268,14 +386,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.19", ngImpo
268
386
  <button class="btn btn-primary" (click)="onSave()">Save</button>
269
387
  </div>
270
388
  `
271
- }]
272
- }], propDecorators: { editingNavbar: [{
273
- type: Input
274
- }], save: [{
275
- type: Output
276
- }], closeEvent: [{
277
- type: Output
278
- }] } });
279
-
389
+ }]
390
+ }],
391
+ propDecorators: {
392
+ editingNavbar: [{ type: Input }],
393
+ save: [{ type: Output }],
394
+ closeEvent: [{ type: Output }]
395
+ }
396
+ });
280
397
  export { EditNavbarModalComponent };
281
- //# sourceMappingURL=posiwise-utils-edit-navbar-modal.component-DC6PY39N.mjs.map
398
+
399
+ //# sourceMappingURL=posiwise-utils-edit-navbar-modal.component-BD9hKcnO.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"posiwise-utils-edit-navbar-modal.component-BD9hKcnO.mjs","names":[],"sources":["../../../../libs/utils/src/lib/resource-header/edit-navbar-modal.component.ts"],"sourcesContent":["import { moveItemInArray } from '@angular/cdk/drag-drop';\nimport { DragDropModule } from '@angular/cdk/drag-drop';\nimport { Component, EventEmitter, Input, Output } from '@angular/core';\nimport { FormsModule } from '@angular/forms';\n\n/**\n * Edit Navbar Modal Component\n * Contains drag-drop functionality for reordering navbar items\n * This component is lazy-loaded only when the edit modal is opened\n */\n@Component({\n selector: 'pw-edit-navbar-modal',\n standalone: true,\n imports: [FormsModule, DragDropModule],\n template: `\n <div class=\"modal-header\">\n <h5 class=\"modal-title\">Edit Navbar Links</h5>\n <button type=\"button\" class=\"btn-close\" aria-label=\"Close\" (click)=\"onClose()\"></button>\n </div>\n\n <div class=\"modal-body\">\n <h4 class=\"mb-3\">Navbar Section</h4>\n <div cdkDropList (cdkDropListDropped)=\"dropNavbarItems($event)\">\n @for (item of editingNavbar.items; track item; let i = $index) {\n <div class=\"border p-3 mb-3\" cdkDrag>\n <div class=\"row\">\n <div class=\"col-md-5 mb-2\">\n <label [for]=\"'navbarTitle' + i\" class=\"form-label\">Title</label>\n <input\n [id]=\"'navbarTitle' + i\"\n class=\"form-control\"\n [(ngModel)]=\"item.title\"\n />\n </div>\n <div class=\"col-md-5 mb-2\">\n <label [for]=\"'navbarPath' + i\" class=\"form-label\">Path</label>\n <input\n [id]=\"'navbarPath' + i\"\n class=\"form-control\"\n [(ngModel)]=\"item.path\"\n />\n </div>\n <div\n class=\"col-md-2 d-flex justify-content-between align-items-center mt-4\"\n >\n <i\n class=\"fa fa-trash in-page-trash-icon text-danger cursor-pointer\"\n (click)=\"removeNavbarItem(i)\"\n (keydown.enter)=\"removeNavbarItem(i)\"\n (keydown.space)=\"removeNavbarItem(i)\"\n ></i>\n <i\n class=\"fa fa-bars in-page-bars-icon cursor-pointer\"\n cdkDragHandle\n ></i>\n </div>\n </div>\n <div cdkDropList (cdkDropListDropped)=\"dropNavbarSubtitles(i, $event)\">\n @for (sub of item.subtitles; track sub; let j = $index) {\n <div class=\"row border p-3 mb-2 align-items-center\" cdkDrag>\n <div class=\"col-md-5\">\n <label\n [for]=\"'navbarSubtitleTitle' + i + j\"\n class=\"form-label\"\n >Subtitle Title</label\n >\n <input\n [id]=\"'navbarSubtitleTitle' + i + j\"\n class=\"form-control\"\n [(ngModel)]=\"sub.title\"\n />\n </div>\n <div class=\"col-md-5\">\n <label\n [for]=\"'navbarSubtitlePath' + i + j\"\n class=\"form-label\"\n >Subtitle Path</label\n >\n <input\n [id]=\"'navbarSubtitlePath' + i + j\"\n class=\"form-control\"\n [(ngModel)]=\"sub.path\"\n />\n </div>\n <div\n class=\"col-md-2 d-flex justify-content-between align-items-center mt-4\"\n >\n <i\n class=\"fa fa-trash in-page-trash-icon text-danger cursor-pointer\"\n (click)=\"removeNavbarSubtitle(i, j)\"\n (keydown.enter)=\"removeNavbarSubtitle(i, j)\"\n (keydown.space)=\"removeNavbarSubtitle(i, j)\"\n ></i>\n <i\n class=\"fa fa-bars in-page-bars-icon cursor-pointer\"\n cdkDragHandle\n ></i>\n </div>\n </div>\n }\n </div>\n <button\n class=\"btn btn-outline-primary btn-sm mt-2\"\n (click)=\"addNavbarSubtitle(i)\"\n >\n + Add Subtitle\n </button>\n </div>\n }\n </div>\n\n <button class=\"btn btn-primary mt-3\" (click)=\"addNavbarItem()\">\n + Add Navbar Item\n </button>\n </div>\n\n <div class=\"modal-footer\">\n <button class=\"btn btn-secondary\" (click)=\"onClose()\">Cancel</button>\n <button class=\"btn btn-primary\" (click)=\"onSave()\">Save</button>\n </div>\n `\n})\nexport class EditNavbarModalComponent {\n @Input() editingNavbar;\n @Output() save = new EventEmitter<void>();\n @Output() closeEvent = new EventEmitter<void>();\n\n dropNavbarItems(event) {\n moveItemInArray(this.editingNavbar.items, event.previousIndex, event.currentIndex);\n }\n\n dropNavbarSubtitles(index: number, event) {\n moveItemInArray(\n this.editingNavbar.items[index].subtitles,\n event.previousIndex,\n event.currentIndex\n );\n }\n\n addNavbarItem() {\n this.editingNavbar.items.push({\n title: '',\n path: '',\n subtitles: []\n });\n }\n\n removeNavbarItem(index: number) {\n this.editingNavbar.items.splice(index, 1);\n }\n\n addNavbarSubtitle(index: number) {\n this.editingNavbar.items[index].subtitles.push({\n title: '',\n path: ''\n });\n }\n\n removeNavbarSubtitle(navIndex: number, subIndex: number) {\n this.editingNavbar.items[navIndex].subtitles.splice(subIndex, 1);\n }\n\n onSave() {\n this.save.emit(this.editingNavbar);\n }\n\n onClose() {\n this.closeEvent.emit();\n }\n}\n"],"mappings":";;;;;;AA0HA,IAAa,2BAAb,MAAa,yBAAwB;CAhHrC,cAAA;EAkHc,KAAA,OAAO,IAAI,aAAY;EACvB,KAAA,aAAa,IAAI,aAAY;CA4C1C;CA1CG,gBAAgB,OAAK;EACjB,gBAAgB,KAAK,cAAc,OAAO,MAAM,eAAe,MAAM,YAAY;CACrF;CAEA,oBAAoB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