@winexist/ngp 0.2.0 → 0.4.0

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,12 +1,25 @@
1
1
  import * as i0 from '@angular/core';
2
- import { input, Component, output, signal, effect, ViewChild, ContentChild, Input } from '@angular/core';
3
- import * as i2 from '@angular/common';
2
+ import { input, Component, output, signal, effect, ViewChild, ContentChild, Input, forwardRef, inject, Injectable } from '@angular/core';
3
+ import * as i3 from '@angular/common';
4
4
  import { CommonModule } from '@angular/common';
5
5
  import * as i1 from 'primeng/fileupload';
6
6
  import { FileUploadModule } from 'primeng/fileupload';
7
- import { NgControl } from '@angular/forms';
7
+ import * as i4 from '@angular/forms';
8
+ import { NgControl, FormsModule, NG_VALUE_ACCESSOR, FormBuilder, ReactiveFormsModule, NG_VALIDATORS } from '@angular/forms';
8
9
  import * as i1$1 from 'primeng/message';
9
10
  import { MessageModule } from 'primeng/message';
11
+ import * as i1$2 from '@ng-select/ng-select';
12
+ import { NgSelectModule } from '@ng-select/ng-select';
13
+ import * as i4$1 from 'primeng/floatlabel';
14
+ import { FloatLabelModule } from 'primeng/floatlabel';
15
+ import * as i5 from 'primeng/progressspinner';
16
+ import { ProgressSpinnerModule } from 'primeng/progressspinner';
17
+ import { RxwebValidators } from '@rxweb/reactive-form-validators';
18
+ import * as i1$3 from 'primeng/inputtext';
19
+ import { InputTextModule } from 'primeng/inputtext';
20
+ import * as i2 from 'primeng/inputnumber';
21
+ import { InputNumberModule } from 'primeng/inputnumber';
22
+ import { HttpClient } from '@angular/common/http';
10
23
 
11
24
  class EmptyComponent {
12
25
  title = input('Section is empty.', ...(ngDevMode ? [{ debugName: "title" }] : []));
@@ -105,7 +118,7 @@ class FileUploadComponent {
105
118
  return typedFile;
106
119
  }
107
120
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: FileUploadComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
108
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.15", type: FileUploadComponent, isStandalone: true, selector: "ngp-file-upload", inputs: { files: { classPropertyName: "files", publicName: "files", isSignal: true, isRequired: false, transformFunction: null }, multiple: { classPropertyName: "multiple", publicName: "multiple", isSignal: true, isRequired: false, transformFunction: null }, accept: { classPropertyName: "accept", publicName: "accept", isSignal: true, isRequired: false, transformFunction: null }, maxFileSize: { classPropertyName: "maxFileSize", publicName: "maxFileSize", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, showUploadButton: { classPropertyName: "showUploadButton", publicName: "showUploadButton", isSignal: true, isRequired: false, transformFunction: null }, cancelLabel: { classPropertyName: "cancelLabel", publicName: "cancelLabel", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { filesSelected: "filesSelected", filesCleared: "filesCleared" }, viewQueries: [{ propertyName: "fileUploader", first: true, predicate: ["fileUploader"], descendants: true }], ngImport: i0, template: "<p-fileupload #fileUploader [multiple]=\"multiple()\" [showUploadButton]=\"showUploadButton()\"\n [cancelLabel]=\"cancelLabel()\" [accept]=\"accept()\" auto=\"false\" [maxFileSize]=\"maxFileSize()\" mode=\"advanced\"\n [customUpload]=\"true\" styleClass=\"!bg-gray-50\" (onSelect)=\"onFileSelect($event)\" (onClear)=\"onClear()\">\n <ng-template #content>\n @if (uploadedFiles().length) {\n <ul class=\"space-y-2\">\n @for (file of uploadedFiles(); track $index) {\n <li class=\"flex justify-between gap-4 p-2 bg-gray-100 rounded\">\n <div class=\"flex gap-2\">\n <ng-container [ngTemplateOutlet]=\"iconTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: file.fileType }\"></ng-container>\n <span class=\"text-sm\"> {{ file.name }} - {{ formatFileSize(file.size) }} </span>\n </div>\n <button type=\"button\" (click)=\"removeFile($index)\" class=\"text-red-500 hover:text-red-700 text-sm\">\n <span class=\"material-icons !text-base\"> cancel </span>\n </button>\n </li>\n }\n </ul>\n } @else {\n <div class=\"flex flex-col items-center gap-3\">\n <img src=\"assets/images/file-upload.svg\" alt=\"File Upload\" class=\"w-28 mx-auto\" />\n <span class=\"font-semibold text-center text-gray-400 text-sm\">\n Drag & drop or<br />\n click the \"Choose\" button to add new files\n </span>\n </div>\n }\n </ng-template>\n <ng-template #file></ng-template>\n</p-fileupload>\n\n<ng-template #iconTemplate let-type>\n @if (type === 'image') {\n <span class=\"material-icons\"> image </span>\n } @else if (type === 'pdf') {\n <span class=\"material-icons\"> picture_as_pdf </span>\n } @else {\n <span class=\"material-icons\"> insert_drive_file </span>\n }\n</ng-template>", styles: [""], dependencies: [{ kind: "ngmodule", type: FileUploadModule }, { kind: "component", type: i1.FileUpload, selector: "p-fileupload, p-fileUpload", inputs: ["name", "url", "method", "multiple", "accept", "disabled", "auto", "withCredentials", "maxFileSize", "invalidFileSizeMessageSummary", "invalidFileSizeMessageDetail", "invalidFileTypeMessageSummary", "invalidFileTypeMessageDetail", "invalidFileLimitMessageDetail", "invalidFileLimitMessageSummary", "style", "styleClass", "previewWidth", "chooseLabel", "uploadLabel", "cancelLabel", "chooseIcon", "uploadIcon", "cancelIcon", "showUploadButton", "showCancelButton", "mode", "headers", "customUpload", "fileLimit", "uploadStyleClass", "cancelStyleClass", "removeStyleClass", "chooseStyleClass", "chooseButtonProps", "uploadButtonProps", "cancelButtonProps", "files"], outputs: ["onBeforeUpload", "onSend", "onUpload", "onError", "onClear", "onRemove", "onSelect", "onProgress", "uploadHandler", "onImageError", "onRemoveUploadedFile"] }, { kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i2.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] });
121
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.15", type: FileUploadComponent, isStandalone: true, selector: "ngp-file-upload", inputs: { files: { classPropertyName: "files", publicName: "files", isSignal: true, isRequired: false, transformFunction: null }, multiple: { classPropertyName: "multiple", publicName: "multiple", isSignal: true, isRequired: false, transformFunction: null }, accept: { classPropertyName: "accept", publicName: "accept", isSignal: true, isRequired: false, transformFunction: null }, maxFileSize: { classPropertyName: "maxFileSize", publicName: "maxFileSize", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, showUploadButton: { classPropertyName: "showUploadButton", publicName: "showUploadButton", isSignal: true, isRequired: false, transformFunction: null }, cancelLabel: { classPropertyName: "cancelLabel", publicName: "cancelLabel", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { filesSelected: "filesSelected", filesCleared: "filesCleared" }, viewQueries: [{ propertyName: "fileUploader", first: true, predicate: ["fileUploader"], descendants: true }], ngImport: i0, template: "<p-fileupload #fileUploader [multiple]=\"multiple()\" [showUploadButton]=\"showUploadButton()\"\n [cancelLabel]=\"cancelLabel()\" [accept]=\"accept()\" auto=\"false\" [maxFileSize]=\"maxFileSize()\" mode=\"advanced\"\n [customUpload]=\"true\" styleClass=\"!bg-gray-50\" (onSelect)=\"onFileSelect($event)\" (onClear)=\"onClear()\">\n <ng-template #content>\n @if (uploadedFiles().length) {\n <ul class=\"space-y-2\">\n @for (file of uploadedFiles(); track $index) {\n <li class=\"flex justify-between gap-4 p-2 bg-gray-100 rounded\">\n <div class=\"flex gap-2\">\n <ng-container [ngTemplateOutlet]=\"iconTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: file.fileType }\"></ng-container>\n <span class=\"text-sm\"> {{ file.name }} - {{ formatFileSize(file.size) }} </span>\n </div>\n <button type=\"button\" (click)=\"removeFile($index)\" class=\"text-red-500 hover:text-red-700 text-sm\">\n <span class=\"material-icons !text-base\"> cancel </span>\n </button>\n </li>\n }\n </ul>\n } @else {\n <div class=\"flex flex-col items-center gap-3\">\n <img src=\"assets/images/file-upload.svg\" alt=\"File Upload\" class=\"w-28 mx-auto\" />\n <span class=\"font-semibold text-center text-gray-400 text-sm\">\n Drag & drop or<br />\n click the \"Choose\" button to add new files\n </span>\n </div>\n }\n </ng-template>\n <ng-template #file></ng-template>\n</p-fileupload>\n\n<ng-template #iconTemplate let-type>\n @if (type === 'image') {\n <span class=\"material-icons\"> image </span>\n } @else if (type === 'pdf') {\n <span class=\"material-icons\"> picture_as_pdf </span>\n } @else {\n <span class=\"material-icons\"> insert_drive_file </span>\n }\n</ng-template>", styles: [""], dependencies: [{ kind: "ngmodule", type: FileUploadModule }, { kind: "component", type: i1.FileUpload, selector: "p-fileupload, p-fileUpload", inputs: ["name", "url", "method", "multiple", "accept", "disabled", "auto", "withCredentials", "maxFileSize", "invalidFileSizeMessageSummary", "invalidFileSizeMessageDetail", "invalidFileTypeMessageSummary", "invalidFileTypeMessageDetail", "invalidFileLimitMessageDetail", "invalidFileLimitMessageSummary", "style", "styleClass", "previewWidth", "chooseLabel", "uploadLabel", "cancelLabel", "chooseIcon", "uploadIcon", "cancelIcon", "showUploadButton", "showCancelButton", "mode", "headers", "customUpload", "fileLimit", "uploadStyleClass", "cancelStyleClass", "removeStyleClass", "chooseStyleClass", "chooseButtonProps", "uploadButtonProps", "cancelButtonProps", "files"], outputs: ["onBeforeUpload", "onSend", "onUpload", "onError", "onClear", "onRemove", "onSelect", "onProgress", "uploadHandler", "onImageError", "onRemoveUploadedFile"] }, { kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i3.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] });
109
122
  }
110
123
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: FileUploadComponent, decorators: [{
111
124
  type: Component,
@@ -168,11 +181,344 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImpo
168
181
  args: [NgControl]
169
182
  }] } });
170
183
 
184
+ class BasicNgSelectComponent {
185
+ options = input([], ...(ngDevMode ? [{ debugName: "options" }] : []));
186
+ bindLabel = input('', ...(ngDevMode ? [{ debugName: "bindLabel" }] : []));
187
+ bindValue = input('', ...(ngDevMode ? [{ debugName: "bindValue" }] : []));
188
+ placeholder = input('Select an option', ...(ngDevMode ? [{ debugName: "placeholder" }] : []));
189
+ clearable = input(true, ...(ngDevMode ? [{ debugName: "clearable" }] : []));
190
+ searchable = input(true, ...(ngDevMode ? [{ debugName: "searchable" }] : []));
191
+ loading = input(false, ...(ngDevMode ? [{ debugName: "loading" }] : []));
192
+ label = input(null, ...(ngDevMode ? [{ debugName: "label" }] : []));
193
+ required = input(true, ...(ngDevMode ? [{ debugName: "required" }] : []));
194
+ // Internal state
195
+ value = null;
196
+ disabled = false;
197
+ // ControlValueAccessor callbacks
198
+ onChange = () => { };
199
+ onTouched = () => { };
200
+ // Handle value changes from ng-select
201
+ onValueChange(value) {
202
+ this.value = value;
203
+ this.onChange(value);
204
+ }
205
+ writeValue(val) {
206
+ this.value = val;
207
+ }
208
+ registerOnChange(fn) {
209
+ this.onChange = fn;
210
+ }
211
+ registerOnTouched(fn) {
212
+ this.onTouched = fn;
213
+ }
214
+ setDisabledState(isDisabled) {
215
+ this.disabled = isDisabled;
216
+ }
217
+ // Compare function for ng-select
218
+ compareWith = (item, selected) => {
219
+ const bindValueKey = this.bindValue();
220
+ // If no bindValue is set, compare entire objects
221
+ if (!bindValueKey) {
222
+ return item === selected;
223
+ }
224
+ // Handle null/undefined cases
225
+ if (!item || !selected) {
226
+ return item === selected;
227
+ }
228
+ // If selected is a primitive (just the id), compare with item's property
229
+ if (typeof selected !== 'object') {
230
+ return item[bindValueKey] === selected;
231
+ }
232
+ // If both are objects, compare the bindValue property
233
+ return item[bindValueKey] === selected[bindValueKey];
234
+ };
235
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: BasicNgSelectComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
236
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.15", type: BasicNgSelectComponent, isStandalone: true, selector: "ngp-basic-select", inputs: { options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null }, bindLabel: { classPropertyName: "bindLabel", publicName: "bindLabel", isSignal: true, isRequired: false, transformFunction: null }, bindValue: { classPropertyName: "bindValue", publicName: "bindValue", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, clearable: { classPropertyName: "clearable", publicName: "clearable", isSignal: true, isRequired: false, transformFunction: null }, searchable: { classPropertyName: "searchable", publicName: "searchable", isSignal: true, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null } }, providers: [
237
+ {
238
+ provide: NG_VALUE_ACCESSOR,
239
+ useExisting: forwardRef(() => BasicNgSelectComponent),
240
+ multi: true
241
+ }
242
+ ], ngImport: i0, template: "<ngp-form-field-wrapper>\n <p-floatlabel variant=\"in\">\n <ng-select [(ngModel)]=\"value\" [bindLabel]=\"bindLabel()\" [bindValue]=\"bindValue()\" [items]=\"options()\"\n [compareWith]=\"compareWith\" [clearable]=\"clearable()\" (change)=\"onValueChange($event)\">\n <ng-template ng-loadingspinner-tmp>\n <ng-container [ngTemplateOutlet]=\"spinner\" />\n </ng-template>\n </ng-select>\n\n @if (label()) {\n <label class=\"block mb-2\" [ngClass]=\"{'required-label': required() }\">{{ label() }}</label>\n }\n </p-floatlabel>\n</ngp-form-field-wrapper>\n\n<ng-template #spinner>\n <p-progress-spinner ariaLabel=\"loading\" styleClass=\"text-gray-400\" />\n</ng-template>", styles: [""], dependencies: [{ kind: "ngmodule", type: NgSelectModule }, { kind: "component", type: i1$2.NgSelectComponent, selector: "ng-select", inputs: ["ariaLabelDropdown", "ariaLabel", "markFirst", "placeholder", "fixedPlaceholder", "notFoundText", "typeToSearchText", "preventToggleOnRightClick", "addTagText", "loadingText", "clearAllText", "dropdownPosition", "appendTo", "outsideClickEvent", "loading", "closeOnSelect", "hideSelected", "selectOnTab", "openOnEnter", "maxSelectedItems", "groupBy", "groupValue", "bufferAmount", "virtualScroll", "selectableGroup", "tabFocusOnClearButton", "selectableGroupAsModel", "searchFn", "trackByFn", "clearOnBackspace", "labelForId", "inputAttrs", "tabIndex", "readonly", "searchWhileComposing", "minTermLength", "editableSearchTerm", "ngClass", "typeahead", "multiple", "addTag", "searchable", "clearable", "deselectOnClick", "clearSearchOnAdd", "compareWith", "keyDownFn", "bindLabel", "bindValue", "appearance", "isOpen", "items"], outputs: ["bindLabelChange", "bindValueChange", "appearanceChange", "isOpenChange", "itemsChange", "blur", "focus", "change", "open", "close", "search", "clear", "add", "remove", "scroll", "scrollToEnd"], exportAs: ["ngSelect"] }, { kind: "directive", type: i1$2.NgLoadingSpinnerTemplateDirective, selector: "[ng-loadingspinner-tmp]" }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i4.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i3.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i3.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: FormFieldWrapperComponent, selector: "ngp-form-field-wrapper", inputs: ["validationMessages"] }, { kind: "ngmodule", type: FloatLabelModule }, { kind: "component", type: i4$1.FloatLabel, selector: "p-floatlabel, p-floatLabel, p-float-label", inputs: ["variant"] }, { kind: "ngmodule", type: ProgressSpinnerModule }, { kind: "component", type: i5.ProgressSpinner, selector: "p-progressSpinner, p-progress-spinner, p-progressspinner", inputs: ["styleClass", "strokeWidth", "fill", "animationDuration", "ariaLabel"] }] });
243
+ }
244
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: BasicNgSelectComponent, decorators: [{
245
+ type: Component,
246
+ args: [{ selector: 'ngp-basic-select', imports: [NgSelectModule, FormsModule, CommonModule, FormFieldWrapperComponent, FloatLabelModule, ProgressSpinnerModule], providers: [
247
+ {
248
+ provide: NG_VALUE_ACCESSOR,
249
+ useExisting: forwardRef(() => BasicNgSelectComponent),
250
+ multi: true
251
+ }
252
+ ], template: "<ngp-form-field-wrapper>\n <p-floatlabel variant=\"in\">\n <ng-select [(ngModel)]=\"value\" [bindLabel]=\"bindLabel()\" [bindValue]=\"bindValue()\" [items]=\"options()\"\n [compareWith]=\"compareWith\" [clearable]=\"clearable()\" (change)=\"onValueChange($event)\">\n <ng-template ng-loadingspinner-tmp>\n <ng-container [ngTemplateOutlet]=\"spinner\" />\n </ng-template>\n </ng-select>\n\n @if (label()) {\n <label class=\"block mb-2\" [ngClass]=\"{'required-label': required() }\">{{ label() }}</label>\n }\n </p-floatlabel>\n</ngp-form-field-wrapper>\n\n<ng-template #spinner>\n <p-progress-spinner ariaLabel=\"loading\" styleClass=\"text-gray-400\" />\n</ng-template>" }]
253
+ }], propDecorators: { options: [{ type: i0.Input, args: [{ isSignal: true, alias: "options", required: false }] }], bindLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "bindLabel", required: false }] }], bindValue: [{ type: i0.Input, args: [{ isSignal: true, alias: "bindValue", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], clearable: [{ type: i0.Input, args: [{ isSignal: true, alias: "clearable", required: false }] }], searchable: [{ type: i0.Input, args: [{ isSignal: true, alias: "searchable", required: false }] }], loading: [{ type: i0.Input, args: [{ isSignal: true, alias: "loading", required: false }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], required: [{ type: i0.Input, args: [{ isSignal: true, alias: "required", required: false }] }] } });
254
+
255
+ class AddressService {
256
+ url = `/api/v1/records/address`;
257
+ http = inject(HttpClient);
258
+ getProvinces() {
259
+ return this.http.get(`${this.url}/provinces`);
260
+ }
261
+ getMunicipalities(provinceId) {
262
+ return this.http.get(`${this.url}/municipalities/${provinceId}`);
263
+ }
264
+ getBarangays(muncipalityId, params) {
265
+ return this.http.get(`${this.url}/barangay/${muncipalityId}`, { params });
266
+ }
267
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: AddressService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
268
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: AddressService, providedIn: 'root' });
269
+ }
270
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: AddressService, decorators: [{
271
+ type: Injectable,
272
+ args: [{
273
+ providedIn: 'root'
274
+ }]
275
+ }] });
276
+
277
+ class FgAddressComponent {
278
+ showHeader = input(true, ...(ngDevMode ? [{ debugName: "showHeader" }] : []));
279
+ isCreateMode = input(true, ...(ngDevMode ? [{ debugName: "isCreateMode" }] : []));
280
+ addressForm;
281
+ provHttp$;
282
+ cityHttp$;
283
+ barangayHttp$;
284
+ provinceOptions = [];
285
+ cityOptions = [];
286
+ barangayOptions = [];
287
+ isDisabled = signal(false, ...(ngDevMode ? [{ debugName: "isDisabled" }] : []));
288
+ pendingAddress = null;
289
+ isInitializing = false;
290
+ onChange = () => { };
291
+ onTouched = () => { };
292
+ addressService = inject(AddressService);
293
+ fb = inject(FormBuilder);
294
+ constructor() {
295
+ this.addressForm = this.fb.group({
296
+ line1: [null, RxwebValidators.required()],
297
+ line2: [null],
298
+ barangay: [null, RxwebValidators.required()],
299
+ city: [null, RxwebValidators.required()],
300
+ province: [null, RxwebValidators.required()],
301
+ country: ['Philippines', RxwebValidators.required()],
302
+ zipCode: [null, RxwebValidators.required()],
303
+ landmark: [null, RxwebValidators.required()]
304
+ });
305
+ // Use effect to watch for form value changes
306
+ effect(() => {
307
+ if (this.isDisabled()) {
308
+ this.addressForm.disable({ emitEvent: false });
309
+ }
310
+ else {
311
+ this.addressForm.enable({ emitEvent: false });
312
+ }
313
+ });
314
+ // Subscribe to form changes
315
+ this.addressForm.valueChanges.subscribe((value) => {
316
+ this.onChange(value);
317
+ this.onTouched();
318
+ });
319
+ this.loadProvince();
320
+ // Handle province changes - works for both create and edit mode
321
+ this.addressForm.get('province')?.valueChanges.subscribe((prov) => {
322
+ if (prov && !this.isInitializing) {
323
+ this.clearFieldByName('city');
324
+ this.clearFieldByName('barangay');
325
+ this.cityOptions = [];
326
+ this.barangayOptions = [];
327
+ this.loadCityByProvinceId(prov.id);
328
+ }
329
+ });
330
+ // Handle city changes - works for both create and edit mode
331
+ this.addressForm.get('city')?.valueChanges.subscribe((city) => {
332
+ if (city && !this.isInitializing) {
333
+ this.clearFieldByName('barangay');
334
+ this.barangayOptions = [];
335
+ this.loadBarangayByCityId(city.id);
336
+ }
337
+ });
338
+ }
339
+ clearFieldByName(fieldName) {
340
+ this.addressForm.get(fieldName)?.setValue(null, { emitEvent: false });
341
+ }
342
+ loadProvince() {
343
+ this.provHttp$ = this.addressService
344
+ .getProvinces()
345
+ .subscribe((res) => {
346
+ this.provinceOptions = res;
347
+ // If we have a pending address to load, process it now
348
+ if (this.pendingAddress) {
349
+ this.initializeEditMode(this.pendingAddress);
350
+ }
351
+ });
352
+ }
353
+ loadCityByProvinceId(id) {
354
+ this.cityHttp$ = this.addressService
355
+ .getMunicipalities(id)
356
+ .subscribe((res) => {
357
+ this.cityOptions = res;
358
+ // Continue initialization if needed
359
+ if (this.isInitializing && this.pendingAddress) {
360
+ this.setCityFromPending();
361
+ }
362
+ });
363
+ }
364
+ loadBarangayByCityId(id) {
365
+ this.barangayHttp$ = this.addressService
366
+ .getBarangays(id)
367
+ .subscribe((res) => {
368
+ this.barangayOptions = res;
369
+ // Continue initialization if needed
370
+ if (this.isInitializing && this.pendingAddress) {
371
+ this.setBarangayFromPending();
372
+ }
373
+ });
374
+ }
375
+ initializeEditMode(address) {
376
+ this.isInitializing = true;
377
+ // Set non-cascading fields first
378
+ this.addressForm.patchValue({
379
+ line1: address.line1,
380
+ line2: address.line2,
381
+ country: address.country || 'Philippines',
382
+ zipCode: address.zipCode,
383
+ landmark: address.landmark
384
+ }, { emitEvent: false });
385
+ // Find and set province
386
+ if (address.province && typeof address.province === 'string') {
387
+ const provinceItem = this.provinceOptions.find(p => p.name.toLowerCase() === address.province?.toLowerCase());
388
+ if (provinceItem) {
389
+ this.addressForm.get('province')?.setValue(provinceItem, { emitEvent: false });
390
+ this.loadCityByProvinceId(provinceItem.id);
391
+ }
392
+ else {
393
+ this.completeInitialization();
394
+ }
395
+ }
396
+ else {
397
+ this.completeInitialization();
398
+ }
399
+ }
400
+ setCityFromPending() {
401
+ if (!this.pendingAddress?.city || typeof this.pendingAddress.city !== 'string') {
402
+ this.completeInitialization();
403
+ return;
404
+ }
405
+ const cityItem = this.cityOptions.find(c => c.name.toLowerCase() === this.pendingAddress.city?.toLowerCase());
406
+ if (cityItem) {
407
+ this.addressForm.get('city')?.setValue(cityItem, { emitEvent: false });
408
+ this.loadBarangayByCityId(cityItem.id);
409
+ }
410
+ else {
411
+ this.completeInitialization();
412
+ }
413
+ }
414
+ setBarangayFromPending() {
415
+ if (!this.pendingAddress?.barangay || typeof this.pendingAddress.barangay !== 'string') {
416
+ this.completeInitialization();
417
+ return;
418
+ }
419
+ const barangayItem = this.barangayOptions.find(b => b.name.toLowerCase() === this.pendingAddress.barangay?.toLowerCase());
420
+ if (barangayItem) {
421
+ this.addressForm.get('barangay')?.setValue(barangayItem, { emitEvent: false });
422
+ }
423
+ this.completeInitialization();
424
+ }
425
+ completeInitialization() {
426
+ this.isInitializing = false;
427
+ this.pendingAddress = null;
428
+ }
429
+ // ControlValueAccessor methods
430
+ writeValue(value) {
431
+ if (value) {
432
+ // Check if this is edit mode with string values (names instead of objects)
433
+ const isEditModeWithNames = !this.isCreateMode() &&
434
+ typeof value.province === 'string';
435
+ if (isEditModeWithNames) {
436
+ this.pendingAddress = value;
437
+ // If provinces are already loaded, start initialization
438
+ if (this.provinceOptions.length > 0) {
439
+ this.initializeEditMode(value);
440
+ }
441
+ // Otherwise, it will be triggered when provinces load
442
+ }
443
+ else {
444
+ // Create mode or already has proper objects
445
+ this.addressForm.patchValue(value, { emitEvent: false });
446
+ // Load cascading data if IDs are present
447
+ const province = value.province;
448
+ if (province && typeof province === 'object' && 'id' in province) {
449
+ this.loadCityByProvinceId(province.id);
450
+ }
451
+ const city = value.city;
452
+ if (city && typeof city === 'object' && 'id' in city) {
453
+ this.loadBarangayByCityId(city.id);
454
+ }
455
+ }
456
+ }
457
+ else {
458
+ this.addressForm.reset({ country: 'Philippines' }, { emitEvent: false });
459
+ }
460
+ }
461
+ registerOnChange(fn) {
462
+ this.onChange = fn;
463
+ }
464
+ registerOnTouched(fn) {
465
+ this.onTouched = fn;
466
+ }
467
+ setDisabledState(isDisabled) {
468
+ this.isDisabled?.set(isDisabled);
469
+ if (isDisabled) {
470
+ this.addressForm.disable();
471
+ }
472
+ else {
473
+ this.addressForm.enable();
474
+ }
475
+ }
476
+ validate(control) {
477
+ return this.addressForm?.valid ? null : { invalidAddress: true };
478
+ }
479
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: FgAddressComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
480
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.15", type: FgAddressComponent, isStandalone: true, selector: "ngp-fg-address", inputs: { showHeader: { classPropertyName: "showHeader", publicName: "showHeader", isSignal: true, isRequired: false, transformFunction: null }, isCreateMode: { classPropertyName: "isCreateMode", publicName: "isCreateMode", isSignal: true, isRequired: false, transformFunction: null } }, providers: [
481
+ {
482
+ provide: NG_VALUE_ACCESSOR,
483
+ useExisting: forwardRef(() => FgAddressComponent),
484
+ multi: true
485
+ },
486
+ {
487
+ provide: NG_VALIDATORS,
488
+ useExisting: forwardRef(() => FgAddressComponent),
489
+ multi: true
490
+ }
491
+ ], ngImport: i0, template: "@if (showHeader()) {\n\t<h2 class=\"text-xl font-semibold mb-4\">Address</h2>\n}\n<form [formGroup]=\"addressForm\">\n\t<div class=\"grid grid-cols-1 md:grid-cols-2 gap-4\">\n\t\t<div>\n\t\t\t<ngp-form-field-wrapper>\n\t\t\t\t<p-floatlabel variant=\"in\">\n\t\t\t\t\t<input pInputText trim=\"blur\" id=\"country\" formControlName=\"country\" class=\"w-full\" />\n\t\t\t\t\t<label for=\"country\" class=\"block mb-2 required-label\">Country</label>\n\t\t\t\t</p-floatlabel>\n\t\t\t</ngp-form-field-wrapper>\n\t\t</div>\n\t\t<div>\n\t\t\t<ngp-form-field-wrapper>\n\t\t\t\t<p-floatlabel variant=\"in\">\n\t\t\t\t\t<ng-select\n\t\t\t\t\t\tformControlName=\"province\"\n\t\t\t\t\t\t[items]=\"provinceOptions\"\n\t\t\t\t\t\t[loading]=\"provHttp$ && !provHttp$.closed\"\n\t\t\t\t\t\tbindLabel=\"name\" />\n\t\t\t\t\t<label for=\"province\" class=\"block mb-2 required-label\">Province</label>\n\t\t\t\t</p-floatlabel>\n\t\t\t</ngp-form-field-wrapper>\n\t\t</div>\n\t</div>\n\n\t<div class=\"grid grid-cols-1 md:grid-cols-2 gap-4\">\n\t\t<div>\n\t\t\t<ngp-form-field-wrapper>\n\t\t\t\t<p-floatlabel variant=\"in\">\n\t\t\t\t\t<ng-select\n\t\t\t\t\t\tformControlName=\"city\"\n\t\t\t\t\t\t[items]=\"cityOptions\"\n\t\t\t\t\t\t[loading]=\"cityHttp$ && !cityHttp$.closed\"\n\t\t\t\t\t\tbindLabel=\"name\" />\n\t\t\t\t\t<label for=\"city\" class=\"block mb-2 required-label\">City/Municipality</label>\n\t\t\t\t</p-floatlabel>\n\t\t\t</ngp-form-field-wrapper>\n\t\t</div>\n\n\t\t<div>\n\t\t\t<ngp-form-field-wrapper>\n\t\t\t\t<p-floatlabel variant=\"in\">\n\t\t\t\t\t<ng-select\n\t\t\t\t\t\tformControlName=\"barangay\"\n\t\t\t\t\t\t[items]=\"barangayOptions\"\n\t\t\t\t\t\t[loading]=\"barangayHttp$ && !barangayHttp$.closed\"\n\t\t\t\t\t\tbindLabel=\"name\" />\n\n\t\t\t\t\t<label for=\"barangay\" class=\"block mb-2 required-label\">Barangay</label>\n\t\t\t\t</p-floatlabel>\n\t\t\t</ngp-form-field-wrapper>\n\t\t</div>\n\t</div>\n\n\t<div>\n\t\t<ngp-form-field-wrapper>\n\t\t\t<p-floatlabel variant=\"in\">\n\t\t\t\t<label for=\"line1\" class=\"block mb-2 required-label\">Line 1</label>\n\t\t\t\t<input pInputText trim=\"blur\" id=\"line1\" formControlName=\"line1\" class=\"w-full\" />\n\t\t\t</p-floatlabel>\n\t\t</ngp-form-field-wrapper>\n\t</div>\n\n\t<div>\n\t\t<ngp-form-field-wrapper>\n\t\t\t<p-floatlabel variant=\"in\">\n\t\t\t\t<label for=\"line2\" class=\"block mb-2\">Line 2</label>\n\t\t\t\t<input pInputText trim=\"blur\" id=\"line2\" formControlName=\"line2\" class=\"w-full\" />\n\t\t\t</p-floatlabel>\n\t\t</ngp-form-field-wrapper>\n\t</div>\n\t<div class=\"grid grid-cols-1 md:grid-cols-2 gap-4\">\n\t\t<div>\n\t\t\t<ngp-form-field-wrapper>\n\t\t\t\t<p-floatlabel variant=\"in\">\n\t\t\t\t\t<p-inputnumber\n\t\t\t\t\t\t[inputId]=\"'zipCode'\"\n\t\t\t\t\t\tformControlName=\"zipCode\"\n\t\t\t\t\t\tstyleClass=\"w-full\"\n\t\t\t\t\t\t[useGrouping]=\"false\" />\n\t\t\t\t\t<label for=\"zipCode\" class=\"block mb-2 required-label\">Zip Code</label>\n\t\t\t\t</p-floatlabel>\n\t\t\t</ngp-form-field-wrapper>\n\t\t</div>\n\t\t<div>\n\t\t\t<ngp-form-field-wrapper>\n\t\t\t\t<p-floatlabel variant=\"in\">\n\t\t\t\t\t<label for=\"landmark\" class=\"block mb-2 required-label\">Nearest Landmark</label>\n\t\t\t\t\t<input pInputText trim=\"blur\" id=\"landmark\" formControlName=\"landmark\" class=\"w-full\" />\n\t\t\t\t</p-floatlabel>\n\t\t\t</ngp-form-field-wrapper>\n\t\t</div>\n\t</div>\n</form>\n", styles: [""], dependencies: [{ kind: "ngmodule", type: InputTextModule }, { kind: "directive", type: i1$3.InputText, selector: "[pInputText]", inputs: ["hostName", "ptInputText", "pSize", "variant", "fluid", "invalid"] }, { kind: "ngmodule", type: InputNumberModule }, { kind: "component", type: i2.InputNumber, selector: "p-inputNumber, p-inputnumber, p-input-number", inputs: ["showButtons", "format", "buttonLayout", "inputId", "styleClass", "placeholder", "tabindex", "title", "ariaLabelledBy", "ariaDescribedBy", "ariaLabel", "ariaRequired", "autocomplete", "incrementButtonClass", "decrementButtonClass", "incrementButtonIcon", "decrementButtonIcon", "readonly", "allowEmpty", "locale", "localeMatcher", "mode", "currency", "currencyDisplay", "useGrouping", "minFractionDigits", "maxFractionDigits", "prefix", "suffix", "inputStyle", "inputStyleClass", "showClear", "autofocus"], outputs: ["onInput", "onFocus", "onBlur", "onKeyDown", "onClear"] }, { kind: "ngmodule", type: FloatLabelModule }, { kind: "component", type: i4$1.FloatLabel, selector: "p-floatlabel, p-floatLabel, p-float-label", inputs: ["variant"] }, { kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i4.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i4.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: i4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i4.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i4.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i4.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: FormFieldWrapperComponent, selector: "ngp-form-field-wrapper", inputs: ["validationMessages"] }, { kind: "ngmodule", type: NgSelectModule }, { kind: "component", type: i1$2.NgSelectComponent, selector: "ng-select", inputs: ["ariaLabelDropdown", "ariaLabel", "markFirst", "placeholder", "fixedPlaceholder", "notFoundText", "typeToSearchText", "preventToggleOnRightClick", "addTagText", "loadingText", "clearAllText", "dropdownPosition", "appendTo", "outsideClickEvent", "loading", "closeOnSelect", "hideSelected", "selectOnTab", "openOnEnter", "maxSelectedItems", "groupBy", "groupValue", "bufferAmount", "virtualScroll", "selectableGroup", "tabFocusOnClearButton", "selectableGroupAsModel", "searchFn", "trackByFn", "clearOnBackspace", "labelForId", "inputAttrs", "tabIndex", "readonly", "searchWhileComposing", "minTermLength", "editableSearchTerm", "ngClass", "typeahead", "multiple", "addTag", "searchable", "clearable", "deselectOnClick", "clearSearchOnAdd", "compareWith", "keyDownFn", "bindLabel", "bindValue", "appearance", "isOpen", "items"], outputs: ["bindLabelChange", "bindValueChange", "appearanceChange", "isOpenChange", "itemsChange", "blur", "focus", "change", "open", "close", "search", "clear", "add", "remove", "scroll", "scrollToEnd"], exportAs: ["ngSelect"] }] });
492
+ }
493
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: FgAddressComponent, decorators: [{
494
+ type: Component,
495
+ args: [{ selector: 'ngp-fg-address', imports: [
496
+ InputTextModule,
497
+ InputNumberModule,
498
+ FloatLabelModule,
499
+ CommonModule,
500
+ ReactiveFormsModule,
501
+ FormFieldWrapperComponent,
502
+ NgSelectModule
503
+ ], providers: [
504
+ {
505
+ provide: NG_VALUE_ACCESSOR,
506
+ useExisting: forwardRef(() => FgAddressComponent),
507
+ multi: true
508
+ },
509
+ {
510
+ provide: NG_VALIDATORS,
511
+ useExisting: forwardRef(() => FgAddressComponent),
512
+ multi: true
513
+ }
514
+ ], template: "@if (showHeader()) {\n\t<h2 class=\"text-xl font-semibold mb-4\">Address</h2>\n}\n<form [formGroup]=\"addressForm\">\n\t<div class=\"grid grid-cols-1 md:grid-cols-2 gap-4\">\n\t\t<div>\n\t\t\t<ngp-form-field-wrapper>\n\t\t\t\t<p-floatlabel variant=\"in\">\n\t\t\t\t\t<input pInputText trim=\"blur\" id=\"country\" formControlName=\"country\" class=\"w-full\" />\n\t\t\t\t\t<label for=\"country\" class=\"block mb-2 required-label\">Country</label>\n\t\t\t\t</p-floatlabel>\n\t\t\t</ngp-form-field-wrapper>\n\t\t</div>\n\t\t<div>\n\t\t\t<ngp-form-field-wrapper>\n\t\t\t\t<p-floatlabel variant=\"in\">\n\t\t\t\t\t<ng-select\n\t\t\t\t\t\tformControlName=\"province\"\n\t\t\t\t\t\t[items]=\"provinceOptions\"\n\t\t\t\t\t\t[loading]=\"provHttp$ && !provHttp$.closed\"\n\t\t\t\t\t\tbindLabel=\"name\" />\n\t\t\t\t\t<label for=\"province\" class=\"block mb-2 required-label\">Province</label>\n\t\t\t\t</p-floatlabel>\n\t\t\t</ngp-form-field-wrapper>\n\t\t</div>\n\t</div>\n\n\t<div class=\"grid grid-cols-1 md:grid-cols-2 gap-4\">\n\t\t<div>\n\t\t\t<ngp-form-field-wrapper>\n\t\t\t\t<p-floatlabel variant=\"in\">\n\t\t\t\t\t<ng-select\n\t\t\t\t\t\tformControlName=\"city\"\n\t\t\t\t\t\t[items]=\"cityOptions\"\n\t\t\t\t\t\t[loading]=\"cityHttp$ && !cityHttp$.closed\"\n\t\t\t\t\t\tbindLabel=\"name\" />\n\t\t\t\t\t<label for=\"city\" class=\"block mb-2 required-label\">City/Municipality</label>\n\t\t\t\t</p-floatlabel>\n\t\t\t</ngp-form-field-wrapper>\n\t\t</div>\n\n\t\t<div>\n\t\t\t<ngp-form-field-wrapper>\n\t\t\t\t<p-floatlabel variant=\"in\">\n\t\t\t\t\t<ng-select\n\t\t\t\t\t\tformControlName=\"barangay\"\n\t\t\t\t\t\t[items]=\"barangayOptions\"\n\t\t\t\t\t\t[loading]=\"barangayHttp$ && !barangayHttp$.closed\"\n\t\t\t\t\t\tbindLabel=\"name\" />\n\n\t\t\t\t\t<label for=\"barangay\" class=\"block mb-2 required-label\">Barangay</label>\n\t\t\t\t</p-floatlabel>\n\t\t\t</ngp-form-field-wrapper>\n\t\t</div>\n\t</div>\n\n\t<div>\n\t\t<ngp-form-field-wrapper>\n\t\t\t<p-floatlabel variant=\"in\">\n\t\t\t\t<label for=\"line1\" class=\"block mb-2 required-label\">Line 1</label>\n\t\t\t\t<input pInputText trim=\"blur\" id=\"line1\" formControlName=\"line1\" class=\"w-full\" />\n\t\t\t</p-floatlabel>\n\t\t</ngp-form-field-wrapper>\n\t</div>\n\n\t<div>\n\t\t<ngp-form-field-wrapper>\n\t\t\t<p-floatlabel variant=\"in\">\n\t\t\t\t<label for=\"line2\" class=\"block mb-2\">Line 2</label>\n\t\t\t\t<input pInputText trim=\"blur\" id=\"line2\" formControlName=\"line2\" class=\"w-full\" />\n\t\t\t</p-floatlabel>\n\t\t</ngp-form-field-wrapper>\n\t</div>\n\t<div class=\"grid grid-cols-1 md:grid-cols-2 gap-4\">\n\t\t<div>\n\t\t\t<ngp-form-field-wrapper>\n\t\t\t\t<p-floatlabel variant=\"in\">\n\t\t\t\t\t<p-inputnumber\n\t\t\t\t\t\t[inputId]=\"'zipCode'\"\n\t\t\t\t\t\tformControlName=\"zipCode\"\n\t\t\t\t\t\tstyleClass=\"w-full\"\n\t\t\t\t\t\t[useGrouping]=\"false\" />\n\t\t\t\t\t<label for=\"zipCode\" class=\"block mb-2 required-label\">Zip Code</label>\n\t\t\t\t</p-floatlabel>\n\t\t\t</ngp-form-field-wrapper>\n\t\t</div>\n\t\t<div>\n\t\t\t<ngp-form-field-wrapper>\n\t\t\t\t<p-floatlabel variant=\"in\">\n\t\t\t\t\t<label for=\"landmark\" class=\"block mb-2 required-label\">Nearest Landmark</label>\n\t\t\t\t\t<input pInputText trim=\"blur\" id=\"landmark\" formControlName=\"landmark\" class=\"w-full\" />\n\t\t\t\t</p-floatlabel>\n\t\t\t</ngp-form-field-wrapper>\n\t\t</div>\n\t</div>\n</form>\n" }]
515
+ }], ctorParameters: () => [], propDecorators: { showHeader: [{ type: i0.Input, args: [{ isSignal: true, alias: "showHeader", required: false }] }], isCreateMode: [{ type: i0.Input, args: [{ isSignal: true, alias: "isCreateMode", required: false }] }] } });
516
+
171
517
  // export * from './lib/components/components';
172
518
 
173
519
  /**
174
520
  * Generated bundle index. Do not edit.
175
521
  */
176
522
 
177
- export { EmptyComponent, FileUploadComponent, FormFieldWrapperComponent };
523
+ export { BasicNgSelectComponent, EmptyComponent, FgAddressComponent, FileUploadComponent, FormFieldWrapperComponent };
178
524
  //# sourceMappingURL=winexist-ngp.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"winexist-ngp.mjs","sources":["../../../packages/src/lib/components/empty/empty.component.ts","../../../packages/src/lib/components/empty/empty.component.html","../../../packages/src/lib/components/file-upload/file-upload.component.ts","../../../packages/src/lib/components/file-upload/file-upload.component.html","../../../packages/src/lib/components/form-field-wrapper/form-field-wrapper.component.ts","../../../packages/src/lib/components/form-field-wrapper/form-field-wrapper.component.html","../../../packages/src/index.ts","../../../packages/src/winexist-ngp.ts"],"sourcesContent":["import { Component, input } from '@angular/core';\n\n@Component({\n\tselector: 'ngp-empty',\n\timports: [],\n\ttemplateUrl: './empty.component.html',\n\tstyleUrl: './empty.component.css'\n})\nexport class EmptyComponent {\n\ttitle = input<string>('Section is empty.');\n\tmessage = input<string>('No data available.');\n\timgSrc = input<string>();\n\n}\n","<div class=\"w-full flex justify-center items-center p-5 h-full\">\n <div class=\"flex items-center gap-3\">\n @if (imgSrc()) {\n <img alt=\"Empty\" [src]=\"imgSrc()\" class=\"w-[80px]\" />\n } @else {\n <div class=\"!rounded-md p-5 !bg-slate-100 mb-6\">\n <span class=\"material-icons !text-gray-400 !text-7xl\"> search_off </span>\n </div>\n }\n\n <div class=\"flex flex-col\">\n <span class=\"!text-gray-900 !text-2xl !font-bold\">{{ title() }}</span>\n @if (message()) {\n <span class=\"!text-gray-400 !text-base\">{{ message() }}</span>\n }\n </div>\n </div>\n</div>","import { CommonModule } from '@angular/common';\nimport { Component, effect, ElementRef, input, output, signal, ViewChild } from '@angular/core';\nimport { FileSelectEvent, FileUploadModule } from 'primeng/fileupload';\n\n// Add interface for typed files\ninterface TypedFile extends File {\n\tfileType?: 'image' | 'pdf' | 'other';\n}\n\n@Component({\n\tselector: 'ngp-file-upload',\n\timports: [FileUploadModule, CommonModule],\n\ttemplateUrl: './file-upload.component.html',\n\tstyleUrl: './file-upload.component.css',\n})\nexport class FileUploadComponent {\n\t@ViewChild('fileUploader') fileUploader!: ElementRef;\n\n\t// Signal-based inputs with defaults\n\tfiles = input<File[]>([]);\n\tmultiple = input(true);\n\taccept = input('.pdf,.png,.jpg,.jpeg,.doc,.docx,.csv,.xls,.xlsx');\n\tmaxFileSize = input(2097152); // 2MB in bytes\n\tplaceholder = input('Drag and drop new files here to upload.');\n\tshowUploadButton = input<boolean>(false);\n\tcancelLabel = input('Clear');\n\n\t// Signal-based outputs\n\tfilesSelected = output<File[]>();\n\tfilesCleared = output<void>();\n\n\t// Internal state\n\tuploadedFiles = signal<TypedFile[]>([]);\n\n\tconstructor() {\n\t\teffect(() => {\n\t\t\tconst _files = this.files();\n\t\t\tif (_files.length) {\n\t\t\t\tthis.uploadedFiles.set(_files.map((file) => this.addFileType(file)));\n\t\t\t}\n\t\t});\n\t}\n\n\tonFileSelect(event: FileSelectEvent) {\n\t\tconst validFiles = event.currentFiles.filter(\n\t\t\t(file) => file.size <= this.maxFileSize() && this.isValidFileType(file)\n\t\t);\n\n\t\tif (validFiles.length) {\n\t\t\t// Add type to files before adding to uploadedFiles\n\t\t\tconst typedFiles = validFiles.map((file) => this.addFileType(file));\n\n\t\t\tif (this.multiple()) {\n\t\t\t\tthis.uploadedFiles.update((files) => Array.from(new Set([...files, ...typedFiles])));\n\t\t\t} else {\n\t\t\t\tthis.uploadedFiles.set(typedFiles);\n\t\t\t}\n\t\t\tthis.filesSelected.emit(typedFiles);\n\t\t}\n\t}\n\n\tonClear() {\n\t\tthis.uploadedFiles.set([]);\n\t\tthis.filesCleared.emit();\n\t}\n\n\tremoveFile(index: number) {\n\t\tthis.uploadedFiles.update((files) => files.filter((_, i) => i !== index));\n\t\tthis.filesSelected.emit(this.uploadedFiles());\n\t}\n\n\tisValidFileType(file: File): boolean {\n\t\tconst acceptedTypes = this.accept().split(',');\n\t\treturn acceptedTypes.some((type) =>\n\t\t\tfile.name.toLowerCase().endsWith(type.trim().toLowerCase())\n\t\t);\n\t}\n\n\tformatFileSize(bytes: number): string {\n\t\tif (bytes === 0) return '0 Bytes';\n\t\tconst k = 1024;\n\t\tconst sizes = ['Bytes', 'KB', 'MB', 'GB'];\n\t\tconst i = Math.floor(Math.log(bytes) / Math.log(k));\n\t\treturn parseFloat((bytes / Math.pow(k, i)).toFixed(2)) + ' ' + sizes[i];\n\t}\n\n\tclear() {\n\t\tthis.uploadedFiles.set([]);\n\t\tif (this.fileUploader?.nativeElement?.clear) {\n\t\t\tthis.fileUploader.nativeElement.clear();\n\t\t}\n\t}\n\n\t// Function to determine file type based on extension\n\tgetFileTypeByExtension(file: File): 'image' | 'pdf' | 'other' {\n\t\tconst fileName = file.name.toLowerCase();\n\t\tconst imageExtensions = ['.png', '.jpg', '.jpeg', '.gif', '.bmp', '.svg', '.webp'];\n\t\tconst pdfExtension = '.pdf';\n\n\t\tif (imageExtensions.some((ext) => fileName.endsWith(ext))) {\n\t\t\treturn 'image';\n\t\t} else if (fileName.endsWith(pdfExtension)) {\n\t\t\treturn 'pdf';\n\t\t} else {\n\t\t\treturn 'other';\n\t\t}\n\t}\n\n\t// Function to add type property to file\n\taddFileType(file: File): TypedFile {\n\t\tconst typedFile = file as TypedFile;\n\t\ttypedFile.fileType = this.getFileTypeByExtension(file);\n\t\treturn typedFile;\n\t}\n}\n","<p-fileupload #fileUploader [multiple]=\"multiple()\" [showUploadButton]=\"showUploadButton()\"\n [cancelLabel]=\"cancelLabel()\" [accept]=\"accept()\" auto=\"false\" [maxFileSize]=\"maxFileSize()\" mode=\"advanced\"\n [customUpload]=\"true\" styleClass=\"!bg-gray-50\" (onSelect)=\"onFileSelect($event)\" (onClear)=\"onClear()\">\n <ng-template #content>\n @if (uploadedFiles().length) {\n <ul class=\"space-y-2\">\n @for (file of uploadedFiles(); track $index) {\n <li class=\"flex justify-between gap-4 p-2 bg-gray-100 rounded\">\n <div class=\"flex gap-2\">\n <ng-container [ngTemplateOutlet]=\"iconTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: file.fileType }\"></ng-container>\n <span class=\"text-sm\"> {{ file.name }} - {{ formatFileSize(file.size) }} </span>\n </div>\n <button type=\"button\" (click)=\"removeFile($index)\" class=\"text-red-500 hover:text-red-700 text-sm\">\n <span class=\"material-icons !text-base\"> cancel </span>\n </button>\n </li>\n }\n </ul>\n } @else {\n <div class=\"flex flex-col items-center gap-3\">\n <img src=\"assets/images/file-upload.svg\" alt=\"File Upload\" class=\"w-28 mx-auto\" />\n <span class=\"font-semibold text-center text-gray-400 text-sm\">\n Drag & drop or<br />\n click the \"Choose\" button to add new files\n </span>\n </div>\n }\n </ng-template>\n <ng-template #file></ng-template>\n</p-fileupload>\n\n<ng-template #iconTemplate let-type>\n @if (type === 'image') {\n <span class=\"material-icons\"> image </span>\n } @else if (type === 'pdf') {\n <span class=\"material-icons\"> picture_as_pdf </span>\n } @else {\n <span class=\"material-icons\"> insert_drive_file </span>\n }\n</ng-template>","// form-field-wrapper.component.ts\nimport { CommonModule } from '@angular/common';\nimport { Component, ContentChild, Input, AfterContentInit, OnDestroy } from '@angular/core';\nimport { NgControl } from '@angular/forms';\nimport { Subscription } from 'rxjs';\nimport { MessageModule } from 'primeng/message';\n\n@Component({\n\tselector: 'ngp-form-field-wrapper',\n\tstandalone: true,\n\timports: [CommonModule, MessageModule],\n\ttemplateUrl: './form-field-wrapper.component.html',\n\tstyleUrls: ['./form-field-wrapper.component.scss']\n})\nexport class FormFieldWrapperComponent implements AfterContentInit, OnDestroy {\n\t@Input() validationMessages: { [key: string]: string } = {\n\t\trequired: 'This field is required',\n\t\temail: 'Please enter a valid email',\n\t\tminlength: 'Input does not meet minimum length',\n\t\tmaxlength: 'Input exceeds maximum length',\n\t\tpattern: 'Input format is invalid',\n\t\tendTimeBeforeStartTime: 'End time must not be before start time',\n\t\tbreakStartBeforeEarliestStart: 'Break start time cannot be before the earliest start time'\n\t};\n\n\t@ContentChild(NgControl) control?: NgControl;\n\n\tprivate subscription?: Subscription;\n\n\tngAfterContentInit(): void {\n\t\tif (this.control) {\n\t\t\tthis.subscription = this.control.statusChanges?.subscribe(() => { });\n\t\t}\n\t}\n\n\tngOnDestroy(): void {\n\t\tthis.subscription?.unsubscribe();\n\t}\n\n\tshouldShowError(): boolean {\n\t\treturn (\n\t\t\t!!this.control &&\n\t\t\tthis.control.invalid === true &&\n\t\t\t(this.control.dirty === true || this.control.touched === true)\n\t\t);\n\t}\n\n\tgetErrorMessage(): string {\n\t\tif (!this.control?.errors) {\n\t\t\treturn '';\n\t\t}\n\n\t\tconst firstErrorKey = Object.keys(this.control.errors)[0];\n\t\tconst error = this.control.errors[firstErrorKey];\n\n\t\tif (this.control.errors['message']) {\n\t\t\treturn this.control.errors['message'];\n\t\t}\n\t\tif (error?.message) {\n\t\t\treturn error.message;\n\t\t}\n\n\t\treturn this.validationMessages[firstErrorKey] || `Invalid input: ${firstErrorKey}`;\n\t}\n}\n","<div class=\"form-field-container\">\n <ng-content></ng-content>\n @if (shouldShowError()) {\n <p-message severity=\"error\" variant=\"simple\" size=\"small\" [text]=\"getErrorMessage()\">\n </p-message>\n }\n</div>","// export * from './lib/components/components';\nexport * from './lib/components/empty/empty.component'\nexport * from './lib/components/file-upload/file-upload.component'\nexport * from './lib/components/form-field-wrapper/form-field-wrapper.component'","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i1"],"mappings":";;;;;;;;;;MAQa,cAAc,CAAA;AAC1B,IAAA,KAAK,GAAG,KAAK,CAAS,mBAAmB,iDAAC;AAC1C,IAAA,OAAO,GAAG,KAAK,CAAS,oBAAoB,mDAAC;IAC7C,MAAM,GAAG,KAAK,CAAA,IAAA,SAAA,GAAA,CAAA,SAAA,EAAA,EAAA,SAAA,EAAA,QAAA,EAAA,CAAA,GAAA,EAAA,CAAA,CAAU;wGAHZ,cAAc,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;AAAd,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,IAAA,EAAA,cAAc,kcCR3B,gnBAiBM,EAAA,MAAA,EAAA,CAAA,EAAA,CAAA,EAAA,CAAA;;4FDTO,cAAc,EAAA,UAAA,EAAA,CAAA;kBAN1B,SAAS;AACC,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,WAAW,WACZ,EAAE,EAAA,QAAA,EAAA,gnBAAA,EAAA;;;MEWC,mBAAmB,CAAA;AACJ,IAAA,YAAY;;AAGvC,IAAA,KAAK,GAAG,KAAK,CAAS,EAAE,iDAAC;AACzB,IAAA,QAAQ,GAAG,KAAK,CAAC,I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,yBAAyB,6KAWvB,SAAS,EAAA,WAAA,EAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,ECzBxB,8NAMM,EAAA,MAAA,EAAA,CAAA,mkBAAA,CAAA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,EDIK,YAAY,8BAAE,aAAa,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAAA,IAAA,CAAA,OAAA,EAAA,QAAA,EAAA,WAAA,EAAA,MAAA,EAAA,CAAA,UAAA,EAAA,MAAA,EAAA,QAAA,EAAA,OAAA,EAAA,YAAA,EAAA,UAAA,EAAA,MAAA,EAAA,WAAA,EAAA,MAAA,EAAA,uBAAA,EAAA,uBAAA,EAAA,MAAA,EAAA,SAAA,CAAA,EAAA,OAAA,EAAA,CAAA,SAAA,CAAA,EAAA,CAAA,EAAA,CAAA;;4FAIzB,yBAAyB,EAAA,UAAA,EAAA,CAAA;kBAPrC,SAAS;AACC,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,wBAAwB,cACtB,IAAI,EAAA,OAAA,EACP,CAAC,YAAY,EAAE,aAAa,CAAC,EAAA,QAAA,EAAA,8NAAA,EAAA,MAAA,EAAA,CAAA,mkBAAA,CAAA,EAAA;;sBAKrC;;sBAUA,YAAY;uBAAC,SAAS;;;AEzBxB;;ACAA;;AAEG;;;;"}
1
+ {"version":3,"file":"winexist-ngp.mjs","sources":["../../../packages/src/lib/components/empty/empty.component.ts","../../../packages/src/lib/components/empty/empty.component.html","../../../packages/src/lib/components/file-upload/file-upload.component.ts","../../../packages/src/lib/components/file-upload/file-upload.component.html","../../../packages/src/lib/components/form-field-wrapper/form-field-wrapper.component.ts","../../../packages/src/lib/components/form-field-wrapper/form-field-wrapper.component.html","../../../packages/src/lib/components/select/ng-select/basic/basic-ng-select.component.ts","../../../packages/src/lib/components/select/ng-select/basic/basic-ng-select.component.html","../../../packages/src/lib/services/address/address.service.ts","../../../packages/src/lib/components/fg-address/fg-address.component.ts","../../../packages/src/lib/components/fg-address/fg-address.component.html","../../../packages/src/index.ts","../../../packages/src/winexist-ngp.ts"],"sourcesContent":["import { Component, input } from '@angular/core';\n\n@Component({\n\tselector: 'ngp-empty',\n\timports: [],\n\ttemplateUrl: './empty.component.html',\n\tstyleUrl: './empty.component.css'\n})\nexport class EmptyComponent {\n\ttitle = input<string>('Section is empty.');\n\tmessage = input<string>('No data available.');\n\timgSrc = input<string>();\n\n}\n","<div class=\"w-full flex justify-center items-center p-5 h-full\">\n <div class=\"flex items-center gap-3\">\n @if (imgSrc()) {\n <img alt=\"Empty\" [src]=\"imgSrc()\" class=\"w-[80px]\" />\n } @else {\n <div class=\"!rounded-md p-5 !bg-slate-100 mb-6\">\n <span class=\"material-icons !text-gray-400 !text-7xl\"> search_off </span>\n </div>\n }\n\n <div class=\"flex flex-col\">\n <span class=\"!text-gray-900 !text-2xl !font-bold\">{{ title() }}</span>\n @if (message()) {\n <span class=\"!text-gray-400 !text-base\">{{ message() }}</span>\n }\n </div>\n </div>\n</div>","import { CommonModule } from '@angular/common';\nimport { Component, effect, ElementRef, input, output, signal, ViewChild } from '@angular/core';\nimport { FileSelectEvent, FileUploadModule } from 'primeng/fileupload';\n\n// Add interface for typed files\ninterface TypedFile extends File {\n\tfileType?: 'image' | 'pdf' | 'other';\n}\n\n@Component({\n\tselector: 'ngp-file-upload',\n\timports: [FileUploadModule, CommonModule],\n\ttemplateUrl: './file-upload.component.html',\n\tstyleUrl: './file-upload.component.css',\n})\nexport class FileUploadComponent {\n\t@ViewChild('fileUploader') fileUploader!: ElementRef;\n\n\t// Signal-based inputs with defaults\n\tfiles = input<File[]>([]);\n\tmultiple = input(true);\n\taccept = input('.pdf,.png,.jpg,.jpeg,.doc,.docx,.csv,.xls,.xlsx');\n\tmaxFileSize = input(2097152); // 2MB in bytes\n\tplaceholder = input('Drag and drop new files here to upload.');\n\tshowUploadButton = input<boolean>(false);\n\tcancelLabel = input('Clear');\n\n\t// Signal-based outputs\n\tfilesSelected = output<File[]>();\n\tfilesCleared = output<void>();\n\n\t// Internal state\n\tuploadedFiles = signal<TypedFile[]>([]);\n\n\tconstructor() {\n\t\teffect(() => {\n\t\t\tconst _files = this.files();\n\t\t\tif (_files.length) {\n\t\t\t\tthis.uploadedFiles.set(_files.map((file) => this.addFileType(file)));\n\t\t\t}\n\t\t});\n\t}\n\n\tonFileSelect(event: FileSelectEvent) {\n\t\tconst validFiles = event.currentFiles.filter(\n\t\t\t(file) => file.size <= this.maxFileSize() && this.isValidFileType(file)\n\t\t);\n\n\t\tif (validFiles.length) {\n\t\t\t// Add type to files before adding to uploadedFiles\n\t\t\tconst typedFiles = validFiles.map((file) => this.addFileType(file));\n\n\t\t\tif (this.multiple()) {\n\t\t\t\tthis.uploadedFiles.update((files) => Array.from(new Set([...files, ...typedFiles])));\n\t\t\t} else {\n\t\t\t\tthis.uploadedFiles.set(typedFiles);\n\t\t\t}\n\t\t\tthis.filesSelected.emit(typedFiles);\n\t\t}\n\t}\n\n\tonClear() {\n\t\tthis.uploadedFiles.set([]);\n\t\tthis.filesCleared.emit();\n\t}\n\n\tremoveFile(index: number) {\n\t\tthis.uploadedFiles.update((files) => files.filter((_, i) => i !== index));\n\t\tthis.filesSelected.emit(this.uploadedFiles());\n\t}\n\n\tisValidFileType(file: File): boolean {\n\t\tconst acceptedTypes = this.accept().split(',');\n\t\treturn acceptedTypes.some((type) =>\n\t\t\tfile.name.toLowerCase().endsWith(type.trim().toLowerCase())\n\t\t);\n\t}\n\n\tformatFileSize(bytes: number): string {\n\t\tif (bytes === 0) return '0 Bytes';\n\t\tconst k = 1024;\n\t\tconst sizes = ['Bytes', 'KB', 'MB', 'GB'];\n\t\tconst i = Math.floor(Math.log(bytes) / Math.log(k));\n\t\treturn parseFloat((bytes / Math.pow(k, i)).toFixed(2)) + ' ' + sizes[i];\n\t}\n\n\tclear() {\n\t\tthis.uploadedFiles.set([]);\n\t\tif (this.fileUploader?.nativeElement?.clear) {\n\t\t\tthis.fileUploader.nativeElement.clear();\n\t\t}\n\t}\n\n\t// Function to determine file type based on extension\n\tgetFileTypeByExtension(file: File): 'image' | 'pdf' | 'other' {\n\t\tconst fileName = file.name.toLowerCase();\n\t\tconst imageExtensions = ['.png', '.jpg', '.jpeg', '.gif', '.bmp', '.svg', '.webp'];\n\t\tconst pdfExtension = '.pdf';\n\n\t\tif (imageExtensions.some((ext) => fileName.endsWith(ext))) {\n\t\t\treturn 'image';\n\t\t} else if (fileName.endsWith(pdfExtension)) {\n\t\t\treturn 'pdf';\n\t\t} else {\n\t\t\treturn 'other';\n\t\t}\n\t}\n\n\t// Function to add type property to file\n\taddFileType(file: File): TypedFile {\n\t\tconst typedFile = file as TypedFile;\n\t\ttypedFile.fileType = this.getFileTypeByExtension(file);\n\t\treturn typedFile;\n\t}\n}\n","<p-fileupload #fileUploader [multiple]=\"multiple()\" [showUploadButton]=\"showUploadButton()\"\n [cancelLabel]=\"cancelLabel()\" [accept]=\"accept()\" auto=\"false\" [maxFileSize]=\"maxFileSize()\" mode=\"advanced\"\n [customUpload]=\"true\" styleClass=\"!bg-gray-50\" (onSelect)=\"onFileSelect($event)\" (onClear)=\"onClear()\">\n <ng-template #content>\n @if (uploadedFiles().length) {\n <ul class=\"space-y-2\">\n @for (file of uploadedFiles(); track $index) {\n <li class=\"flex justify-between gap-4 p-2 bg-gray-100 rounded\">\n <div class=\"flex gap-2\">\n <ng-container [ngTemplateOutlet]=\"iconTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: file.fileType }\"></ng-container>\n <span class=\"text-sm\"> {{ file.name }} - {{ formatFileSize(file.size) }} </span>\n </div>\n <button type=\"button\" (click)=\"removeFile($index)\" class=\"text-red-500 hover:text-red-700 text-sm\">\n <span class=\"material-icons !text-base\"> cancel </span>\n </button>\n </li>\n }\n </ul>\n } @else {\n <div class=\"flex flex-col items-center gap-3\">\n <img src=\"assets/images/file-upload.svg\" alt=\"File Upload\" class=\"w-28 mx-auto\" />\n <span class=\"font-semibold text-center text-gray-400 text-sm\">\n Drag & drop or<br />\n click the \"Choose\" button to add new files\n </span>\n </div>\n }\n </ng-template>\n <ng-template #file></ng-template>\n</p-fileupload>\n\n<ng-template #iconTemplate let-type>\n @if (type === 'image') {\n <span class=\"material-icons\"> image </span>\n } @else if (type === 'pdf') {\n <span class=\"material-icons\"> picture_as_pdf </span>\n } @else {\n <span class=\"material-icons\"> insert_drive_file </span>\n }\n</ng-template>","// form-field-wrapper.component.ts\nimport { CommonModule } from '@angular/common';\nimport { Component, ContentChild, Input, AfterContentInit, OnDestroy } from '@angular/core';\nimport { NgControl } from '@angular/forms';\nimport { Subscription } from 'rxjs';\nimport { MessageModule } from 'primeng/message';\n\n@Component({\n\tselector: 'ngp-form-field-wrapper',\n\tstandalone: true,\n\timports: [CommonModule, MessageModule],\n\ttemplateUrl: './form-field-wrapper.component.html',\n\tstyleUrls: ['./form-field-wrapper.component.scss']\n})\nexport class FormFieldWrapperComponent implements AfterContentInit, OnDestroy {\n\t@Input() validationMessages: { [key: string]: string } = {\n\t\trequired: 'This field is required',\n\t\temail: 'Please enter a valid email',\n\t\tminlength: 'Input does not meet minimum length',\n\t\tmaxlength: 'Input exceeds maximum length',\n\t\tpattern: 'Input format is invalid',\n\t\tendTimeBeforeStartTime: 'End time must not be before start time',\n\t\tbreakStartBeforeEarliestStart: 'Break start time cannot be before the earliest start time'\n\t};\n\n\t@ContentChild(NgControl) control?: NgControl;\n\n\tprivate subscription?: Subscription;\n\n\tngAfterContentInit(): void {\n\t\tif (this.control) {\n\t\t\tthis.subscription = this.control.statusChanges?.subscribe(() => { });\n\t\t}\n\t}\n\n\tngOnDestroy(): void {\n\t\tthis.subscription?.unsubscribe();\n\t}\n\n\tshouldShowError(): boolean {\n\t\treturn (\n\t\t\t!!this.control &&\n\t\t\tthis.control.invalid === true &&\n\t\t\t(this.control.dirty === true || this.control.touched === true)\n\t\t);\n\t}\n\n\tgetErrorMessage(): string {\n\t\tif (!this.control?.errors) {\n\t\t\treturn '';\n\t\t}\n\n\t\tconst firstErrorKey = Object.keys(this.control.errors)[0];\n\t\tconst error = this.control.errors[firstErrorKey];\n\n\t\tif (this.control.errors['message']) {\n\t\t\treturn this.control.errors['message'];\n\t\t}\n\t\tif (error?.message) {\n\t\t\treturn error.message;\n\t\t}\n\n\t\treturn this.validationMessages[firstErrorKey] || `Invalid input: ${firstErrorKey}`;\n\t}\n}\n","<div class=\"form-field-container\">\n <ng-content></ng-content>\n @if (shouldShowError()) {\n <p-message severity=\"error\" variant=\"simple\" size=\"small\" [text]=\"getErrorMessage()\">\n </p-message>\n }\n</div>","import { CommonModule } from '@angular/common';\nimport { Component, forwardRef, input } from '@angular/core';\nimport { ControlValueAccessor, FormsModule, NG_VALUE_ACCESSOR } from '@angular/forms';\nimport { NgSelectModule } from '@ng-select/ng-select';\nimport { FormFieldWrapperComponent } from '../../../form-field-wrapper/form-field-wrapper.component';\nimport { FloatLabelModule } from 'primeng/floatlabel'\nimport { ProgressSpinnerModule } from 'primeng/progressspinner'\n\ntype SelectValue<T> = T | T[];\ntype SelectValueOrNull<T> = SelectValue<T> | null;\n\n@Component({\n\tselector: 'ngp-basic-select',\n\timports: [NgSelectModule, FormsModule, CommonModule, FormFieldWrapperComponent, FloatLabelModule, ProgressSpinnerModule],\n\ttemplateUrl: './basic-ng-select.component.html',\n\tstyleUrl: './basic-ng-select.component.scss',\n\tproviders: [\n\t\t{\n\t\t\tprovide: NG_VALUE_ACCESSOR,\n\t\t\tuseExisting: forwardRef(() => BasicNgSelectComponent),\n\t\t\tmulti: true\n\t\t}\n\t]\n})\nexport class BasicNgSelectComponent<T = any> implements ControlValueAccessor {\n\toptions = input<T[]>([]);\n\tbindLabel = input<string>('');\n\tbindValue = input<string>('');\n\tplaceholder = input<string>('Select an option');\n\tclearable = input<boolean>(true);\n\tsearchable = input<boolean>(true);\n\tloading = input<boolean>(false);\n\tlabel = input<string | null>(null);\n\trequired = input<boolean>(true);\n\n\t// Internal state\n\tvalue: SelectValueOrNull<T> = null;\n\tdisabled = false;\n\n\t// ControlValueAccessor callbacks\n\tprivate onChange: (value: SelectValueOrNull<T>) => void = () => { };\n\tonTouched: () => void = () => { };\n\n\t// Handle value changes from ng-select\n\tonValueChange(value: SelectValueOrNull<T>): void {\n\t\tthis.value = value;\n\t\tthis.onChange(value);\n\t}\n\n\twriteValue(val: SelectValueOrNull<T>): void {\n\t\tthis.value = val;\n\t}\n\n\tregisterOnChange(fn: (val: SelectValueOrNull<T>) => void): void {\n\t\tthis.onChange = fn;\n\t}\n\n\tregisterOnTouched(fn: () => void): void {\n\t\tthis.onTouched = fn;\n\t}\n\n\tsetDisabledState?(isDisabled: boolean): void {\n\t\tthis.disabled = isDisabled;\n\t}\n\n\t// Compare function for ng-select\n\tcompareWith = (item: any, selected: any) => {\n\t\tconst bindValueKey = this.bindValue();\n\n\t\t// If no bindValue is set, compare entire objects\n\t\tif (!bindValueKey) {\n\t\t\treturn item === selected;\n\t\t}\n\n\t\t// Handle null/undefined cases\n\t\tif (!item || !selected) {\n\t\t\treturn item === selected;\n\t\t}\n\n\t\t// If selected is a primitive (just the id), compare with item's property\n\t\tif (typeof selected !== 'object') {\n\t\t\treturn item[bindValueKey] === selected;\n\t\t}\n\n\t\t// If both are objects, compare the bindValue property\n\t\treturn item[bindValueKey] === selected[bindValueKey];\n\t};\n}\n","<ngp-form-field-wrapper>\n <p-floatlabel variant=\"in\">\n <ng-select [(ngModel)]=\"value\" [bindLabel]=\"bindLabel()\" [bindValue]=\"bindValue()\" [items]=\"options()\"\n [compareWith]=\"compareWith\" [clearable]=\"clearable()\" (change)=\"onValueChange($event)\">\n <ng-template ng-loadingspinner-tmp>\n <ng-container [ngTemplateOutlet]=\"spinner\" />\n </ng-template>\n </ng-select>\n\n @if (label()) {\n <label class=\"block mb-2\" [ngClass]=\"{'required-label': required() }\">{{ label() }}</label>\n }\n </p-floatlabel>\n</ngp-form-field-wrapper>\n\n<ng-template #spinner>\n <p-progress-spinner ariaLabel=\"loading\" styleClass=\"text-gray-400\" />\n</ng-template>","import { HttpClient } from '@angular/common/http';\nimport { inject, Injectable } from '@angular/core';\nimport { Observable } from 'rxjs';\nimport { IdName } from '../../models/common.model';\n\n@Injectable({\n\tprovidedIn: 'root'\n})\nexport class AddressService {\n\turl = `/api/v1/records/address`;\n\thttp = inject(HttpClient);\n\n\tgetProvinces(): Observable<IdName[]> {\n\t\treturn this.http.get<IdName[]>(`${this.url}/provinces`);\n\t}\n\n\tgetMunicipalities(provinceId: number): Observable<any> {\n\t\treturn this.http.get<any>(`${this.url}/municipalities/${provinceId}`);\n\t}\n\n\tgetBarangays(muncipalityId: any, params?: any): Observable<any> {\n\t\treturn this.http.get<any>(`${this.url}/barangay/${muncipalityId}`, { params });\n\t}\n}\n","import { Component, effect, forwardRef, inject, input, signal } from '@angular/core';\nimport {\n\tAbstractControl,\n\tControlValueAccessor,\n\tFormBuilder,\n\tFormGroup,\n\tNG_VALIDATORS,\n\tNG_VALUE_ACCESSOR,\n\tReactiveFormsModule,\n\tValidationErrors,\n\tValidator\n} from '@angular/forms';\nimport { RxwebValidators } from '@rxweb/reactive-form-validators';\nimport { IdName } from '../../models/common.model';\nimport { Subscription } from 'rxjs';\nimport { CommonModule } from '@angular/common';\nimport { FormFieldWrapperComponent } from '../form-field-wrapper/form-field-wrapper.component';\nimport { InputTextModule } from 'primeng/inputtext';\nimport { InputNumberModule } from 'primeng/inputnumber';\nimport { FloatLabelModule } from 'primeng/floatlabel';\nimport { NgSelectModule } from '@ng-select/ng-select';\nimport { Address, Barangay, City } from '../../models/address.model';\nimport { AddressService } from '../../services/address/address.service';\n\n@Component({\n\tselector: 'ngp-fg-address',\n\timports: [\n\t\tInputTextModule,\n\t\tInputNumberModule,\n\t\tFloatLabelModule,\n\t\tCommonModule,\n\t\tReactiveFormsModule,\n\t\tFormFieldWrapperComponent,\n\t\tNgSelectModule\n\t],\n\ttemplateUrl: './fg-address.component.html',\n\tstyleUrl: './fg-address.component.scss',\n\tproviders: [\n\t\t{\n\t\t\tprovide: NG_VALUE_ACCESSOR,\n\t\t\tuseExisting: forwardRef(() => FgAddressComponent),\n\t\t\tmulti: true\n\t\t},\n\t\t{\n\t\t\tprovide: NG_VALIDATORS,\n\t\t\tuseExisting: forwardRef(() => FgAddressComponent),\n\t\t\tmulti: true\n\t\t}\n\t]\n})\nexport class FgAddressComponent implements ControlValueAccessor, Validator {\n\tshowHeader = input<boolean>(true);\n\tisCreateMode = input<boolean>(true);\n\n\taddressForm!: FormGroup;\n\tprovHttp$!: Subscription;\n\tcityHttp$!: Subscription;\n\tbarangayHttp$!: Subscription;\n\tprovinceOptions: IdName[] = [];\n\tcityOptions: City[] = [];\n\tbarangayOptions: Barangay[] = [];\n\n\tisDisabled = signal<boolean>(false);\n\tprivate pendingAddress: Address | null = null;\n\tprivate isInitializing = false;\n\n\tprivate onChange: (value: Address | null) => void = () => {};\n\tprivate onTouched: () => void = () => {};\n\n\tprivate readonly addressService = inject(AddressService);\n\tprivate readonly fb = inject(FormBuilder);\n\n\tconstructor() {\n\t\tthis.addressForm = this.fb.group({\n\t\t\tline1: [null, RxwebValidators.required()],\n\t\t\tline2: [null],\n\t\t\tbarangay: [null, RxwebValidators.required()],\n\t\t\tcity: [null, RxwebValidators.required()],\n\t\t\tprovince: [null, RxwebValidators.required()],\n\t\t\tcountry: ['Philippines', RxwebValidators.required()],\n\t\t\tzipCode: [null, RxwebValidators.required()],\n\t\t\tlandmark: [null, RxwebValidators.required()]\n\t\t});\n\n\t\t// Use effect to watch for form value changes\n\t\teffect(() => {\n\t\t\tif (this.isDisabled()) {\n\t\t\t\tthis.addressForm.disable({ emitEvent: false });\n\t\t\t} else {\n\t\t\t\tthis.addressForm.enable({ emitEvent: false });\n\t\t\t}\n\t\t});\n\n\t\t// Subscribe to form changes\n\t\tthis.addressForm.valueChanges.subscribe((value) => {\n\t\t\tthis.onChange(value);\n\t\t\tthis.onTouched();\n\t\t});\n\n\t\tthis.loadProvince();\n\n\t\t// Handle province changes - works for both create and edit mode\n\t\tthis.addressForm.get('province')?.valueChanges.subscribe((prov) => {\n\t\t\tif (prov && !this.isInitializing) {\n\t\t\t\tthis.clearFieldByName('city');\n\t\t\t\tthis.clearFieldByName('barangay');\n\t\t\t\tthis.cityOptions = [];\n\t\t\t\tthis.barangayOptions = [];\n\t\t\t\tthis.loadCityByProvinceId(prov.id);\n\t\t\t}\n\t\t});\n\n\t\t// Handle city changes - works for both create and edit mode\n\t\tthis.addressForm.get('city')?.valueChanges.subscribe((city) => {\n\t\t\tif (city && !this.isInitializing) {\n\t\t\t\tthis.clearFieldByName('barangay');\n\t\t\t\tthis.barangayOptions = [];\n\t\t\t\tthis.loadBarangayByCityId(city.id);\n\t\t\t}\n\t\t});\n\t}\n\n\tclearFieldByName(fieldName: string): void {\n\t\tthis.addressForm.get(fieldName)?.setValue(null, { emitEvent: false });\n\t}\n\n\tloadProvince(): void {\n\t\tthis.provHttp$ = this.addressService\n\t\t\t.getProvinces()\n\t\t\t.subscribe((res) => {\n\t\t\t\tthis.provinceOptions = res;\n\t\t\t\t\n\t\t\t\t// If we have a pending address to load, process it now\n\t\t\t\tif (this.pendingAddress) {\n\t\t\t\t\tthis.initializeEditMode(this.pendingAddress);\n\t\t\t\t}\n\t\t\t});\n\t}\n\n\tloadCityByProvinceId(id: number): void {\n\t\tthis.cityHttp$ = this.addressService\n\t\t\t.getMunicipalities(id)\n\t\t\t.subscribe((res) => {\n\t\t\t\tthis.cityOptions = res;\n\t\t\t\t\n\t\t\t\t// Continue initialization if needed\n\t\t\t\tif (this.isInitializing && this.pendingAddress) {\n\t\t\t\t\tthis.setCityFromPending();\n\t\t\t\t}\n\t\t\t});\n\t}\n\n\tloadBarangayByCityId(id: number): void {\n\t\tthis.barangayHttp$ = this.addressService\n\t\t\t.getBarangays(id)\n\t\t\t.subscribe((res) => {\n\t\t\t\tthis.barangayOptions = res;\n\t\t\t\t\n\t\t\t\t// Continue initialization if needed\n\t\t\t\tif (this.isInitializing && this.pendingAddress) {\n\t\t\t\t\tthis.setBarangayFromPending();\n\t\t\t\t}\n\t\t\t});\n\t}\n\n\tprivate initializeEditMode(address: Address): void {\n\t\tthis.isInitializing = true;\n\t\t\n\t\t// Set non-cascading fields first\n\t\tthis.addressForm.patchValue({\n\t\t\tline1: address.line1,\n\t\t\tline2: address.line2,\n\t\t\tcountry: address.country || 'Philippines',\n\t\t\tzipCode: address.zipCode,\n\t\t\tlandmark: address.landmark\n\t\t}, { emitEvent: false });\n\n\t\t// Find and set province\n\t\tif (address.province && typeof address.province === 'string') {\n\t\t\tconst provinceItem = this.provinceOptions.find(\n\t\t\t\tp => p.name.toLowerCase() === address.province?.toLowerCase()\n\t\t\t);\n\t\t\t\n\t\t\tif (provinceItem) {\n\t\t\t\tthis.addressForm.get('province')?.setValue(provinceItem, { emitEvent: false });\n\t\t\t\tthis.loadCityByProvinceId(provinceItem.id);\n\t\t\t} else {\n\t\t\t\tthis.completeInitialization();\n\t\t\t}\n\t\t} else {\n\t\t\tthis.completeInitialization();\n\t\t}\n\t}\n\n\tprivate setCityFromPending(): void {\n\t\tif (!this.pendingAddress?.city || typeof this.pendingAddress.city !== 'string') {\n\t\t\tthis.completeInitialization();\n\t\t\treturn;\n\t\t}\n\n\t\tconst cityItem = this.cityOptions.find(\n\t\t\tc => c.name.toLowerCase() === this.pendingAddress!.city?.toLowerCase()\n\t\t);\n\t\t\n\t\tif (cityItem) {\n\t\t\tthis.addressForm.get('city')?.setValue(cityItem, { emitEvent: false });\n\t\t\tthis.loadBarangayByCityId(cityItem.id);\n\t\t} else {\n\t\t\tthis.completeInitialization();\n\t\t}\n\t}\n\n\tprivate setBarangayFromPending(): void {\n\t\tif (!this.pendingAddress?.barangay || typeof this.pendingAddress.barangay !== 'string') {\n\t\t\tthis.completeInitialization();\n\t\t\treturn;\n\t\t}\n\n\t\tconst barangayItem = this.barangayOptions.find(\n\t\t\tb => b.name.toLowerCase() === this.pendingAddress!.barangay?.toLowerCase()\n\t\t);\n\t\t\n\t\tif (barangayItem) {\n\t\t\tthis.addressForm.get('barangay')?.setValue(barangayItem, { emitEvent: false });\n\t\t}\n\t\t\n\t\tthis.completeInitialization();\n\t}\n\n\tprivate completeInitialization(): void {\n\t\tthis.isInitializing = false;\n\t\tthis.pendingAddress = null;\n\t}\n\n\t// ControlValueAccessor methods\n\twriteValue(value: Address | null): void {\n\t\tif (value) {\n\t\t\t// Check if this is edit mode with string values (names instead of objects)\n\t\t\tconst isEditModeWithNames = !this.isCreateMode() && \n\t\t\t\ttypeof value.province === 'string';\n\n\t\t\tif (isEditModeWithNames) {\n\t\t\t\tthis.pendingAddress = value;\n\t\t\t\t\n\t\t\t\t// If provinces are already loaded, start initialization\n\t\t\t\tif (this.provinceOptions.length > 0) {\n\t\t\t\t\tthis.initializeEditMode(value);\n\t\t\t\t}\n\t\t\t\t// Otherwise, it will be triggered when provinces load\n\t\t\t} else {\n\t\t\t\t// Create mode or already has proper objects\n\t\t\t\tthis.addressForm.patchValue(value, { emitEvent: false });\n\t\t\t\t\n\t\t\t\t// Load cascading data if IDs are present\n\t\t\t\tconst province = value.province;\n\t\t\t\tif (province && typeof province === 'object' && 'id' in province) {\n\t\t\t\t\tthis.loadCityByProvinceId((province as any).id);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tconst city = value.city;\n\t\t\t\tif (city && typeof city === 'object' && 'id' in city) {\n\t\t\t\t\tthis.loadBarangayByCityId((city as any).id);\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tthis.addressForm.reset({ country: 'Philippines' }, { emitEvent: false });\n\t\t}\n\t}\n\n\tregisterOnChange(fn: (value: Address | null) => void): void {\n\t\tthis.onChange = fn;\n\t}\n\n\tregisterOnTouched(fn: () => void): void {\n\t\tthis.onTouched = fn;\n\t}\n\n\tsetDisabledState(isDisabled: boolean): void {\n\t\tthis.isDisabled?.set(isDisabled);\n\t\tif (isDisabled) {\n\t\t\tthis.addressForm.disable();\n\t\t} else {\n\t\t\tthis.addressForm.enable();\n\t\t}\n\t}\n\n\tvalidate(control: AbstractControl): ValidationErrors | null {\n\t\treturn this.addressForm?.valid ? null : { invalidAddress: true };\n\t}\n}","@if (showHeader()) {\n\t<h2 class=\"text-xl font-semibold mb-4\">Address</h2>\n}\n<form [formGroup]=\"addressForm\">\n\t<div class=\"grid grid-cols-1 md:grid-cols-2 gap-4\">\n\t\t<div>\n\t\t\t<ngp-form-field-wrapper>\n\t\t\t\t<p-floatlabel variant=\"in\">\n\t\t\t\t\t<input pInputText trim=\"blur\" id=\"country\" formControlName=\"country\" class=\"w-full\" />\n\t\t\t\t\t<label for=\"country\" class=\"block mb-2 required-label\">Country</label>\n\t\t\t\t</p-floatlabel>\n\t\t\t</ngp-form-field-wrapper>\n\t\t</div>\n\t\t<div>\n\t\t\t<ngp-form-field-wrapper>\n\t\t\t\t<p-floatlabel variant=\"in\">\n\t\t\t\t\t<ng-select\n\t\t\t\t\t\tformControlName=\"province\"\n\t\t\t\t\t\t[items]=\"provinceOptions\"\n\t\t\t\t\t\t[loading]=\"provHttp$ && !provHttp$.closed\"\n\t\t\t\t\t\tbindLabel=\"name\" />\n\t\t\t\t\t<label for=\"province\" class=\"block mb-2 required-label\">Province</label>\n\t\t\t\t</p-floatlabel>\n\t\t\t</ngp-form-field-wrapper>\n\t\t</div>\n\t</div>\n\n\t<div class=\"grid grid-cols-1 md:grid-cols-2 gap-4\">\n\t\t<div>\n\t\t\t<ngp-form-field-wrapper>\n\t\t\t\t<p-floatlabel variant=\"in\">\n\t\t\t\t\t<ng-select\n\t\t\t\t\t\tformControlName=\"city\"\n\t\t\t\t\t\t[items]=\"cityOptions\"\n\t\t\t\t\t\t[loading]=\"cityHttp$ && !cityHttp$.closed\"\n\t\t\t\t\t\tbindLabel=\"name\" />\n\t\t\t\t\t<label for=\"city\" class=\"block mb-2 required-label\">City/Municipality</label>\n\t\t\t\t</p-floatlabel>\n\t\t\t</ngp-form-field-wrapper>\n\t\t</div>\n\n\t\t<div>\n\t\t\t<ngp-form-field-wrapper>\n\t\t\t\t<p-floatlabel variant=\"in\">\n\t\t\t\t\t<ng-select\n\t\t\t\t\t\tformControlName=\"barangay\"\n\t\t\t\t\t\t[items]=\"barangayOptions\"\n\t\t\t\t\t\t[loading]=\"barangayHttp$ && !barangayHttp$.closed\"\n\t\t\t\t\t\tbindLabel=\"name\" />\n\n\t\t\t\t\t<label for=\"barangay\" class=\"block mb-2 required-label\">Barangay</label>\n\t\t\t\t</p-floatlabel>\n\t\t\t</ngp-form-field-wrapper>\n\t\t</div>\n\t</div>\n\n\t<div>\n\t\t<ngp-form-field-wrapper>\n\t\t\t<p-floatlabel variant=\"in\">\n\t\t\t\t<label for=\"line1\" class=\"block mb-2 required-label\">Line 1</label>\n\t\t\t\t<input pInputText trim=\"blur\" id=\"line1\" formControlName=\"line1\" class=\"w-full\" />\n\t\t\t</p-floatlabel>\n\t\t</ngp-form-field-wrapper>\n\t</div>\n\n\t<div>\n\t\t<ngp-form-field-wrapper>\n\t\t\t<p-floatlabel variant=\"in\">\n\t\t\t\t<label for=\"line2\" class=\"block mb-2\">Line 2</label>\n\t\t\t\t<input pInputText trim=\"blur\" id=\"line2\" formControlName=\"line2\" class=\"w-full\" />\n\t\t\t</p-floatlabel>\n\t\t</ngp-form-field-wrapper>\n\t</div>\n\t<div class=\"grid grid-cols-1 md:grid-cols-2 gap-4\">\n\t\t<div>\n\t\t\t<ngp-form-field-wrapper>\n\t\t\t\t<p-floatlabel variant=\"in\">\n\t\t\t\t\t<p-inputnumber\n\t\t\t\t\t\t[inputId]=\"'zipCode'\"\n\t\t\t\t\t\tformControlName=\"zipCode\"\n\t\t\t\t\t\tstyleClass=\"w-full\"\n\t\t\t\t\t\t[useGrouping]=\"false\" />\n\t\t\t\t\t<label for=\"zipCode\" class=\"block mb-2 required-label\">Zip Code</label>\n\t\t\t\t</p-floatlabel>\n\t\t\t</ngp-form-field-wrapper>\n\t\t</div>\n\t\t<div>\n\t\t\t<ngp-form-field-wrapper>\n\t\t\t\t<p-floatlabel variant=\"in\">\n\t\t\t\t\t<label for=\"landmark\" class=\"block mb-2 required-label\">Nearest Landmark</label>\n\t\t\t\t\t<input pInputText trim=\"blur\" id=\"landmark\" formControlName=\"landmark\" class=\"w-full\" />\n\t\t\t\t</p-floatlabel>\n\t\t\t</ngp-form-field-wrapper>\n\t\t</div>\n\t</div>\n</form>\n","// export * from './lib/components/components';\nexport * from './lib/components/empty/empty.component'\nexport * from './lib/components/file-upload/file-upload.component'\nexport * from './lib/components/form-field-wrapper/form-field-wrapper.component'\nexport * from './lib/components/select/ng-select/basic/basic-ng-select.component'\nexport * from './lib/components/fg-address/fg-address.component'\n\n// Models\nexport * from './lib/models/common.model'","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i2","i1","i4","i3","i5"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;MAQa,cAAc,CAAA;AAC1B,IAAA,KAAK,GAAG,KAAK,CAAS,mBAAmB,iDAAC;AAC1C,IAAA,OAAO,GAAG,KAAK,CAAS,oBAAoB,mDAAC;IAC7C,MAAM,GAAG,KAAK,CAAA,IAAA,SAAA,GAAA,CAAA,SAAA,EAAA,EAAA,SAAA,EAAA,QAAA,EAAA,CAAA,GAAA,EAAA,CAAA,CAAU;wGAHZ,cAAc,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;AAAd,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,IAAA,EAAA,cAAc,kcCR3B,gnBAiBM,EAAA,MAAA,EAAA,CAAA,EAAA,CAAA,EAAA,CAAA;;4FDTO,cAAc,EAAA,UAAA,EAAA,CAAA;kBAN1B,SAAS;AACC,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,WAAW,WACZ,EAAE,EAAA,QAAA,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AAA,EAAA,WAAA,EAAA,WAAA,EAAA,YAAA,EAAA,QAAA,EAAA,OAAA,CAAA,EAAA,OAAA,EAAA,CAAA,iBAAA,EAAA,iBAAA,EAAA,kBAAA,EAAA,cAAA,EAAA,aAAA,EAAA,MAAA,EAAA,OAAA,EAAA,QAAA,EAAA,MAAA,EAAA,OAAA,EAAA,QAAA,EAAA,OAAA,EAAA,KAAA,EAAA,QAAA,EAAA,QAAA,EAAA,aAAA,CAAA,EAAA,QAAA,EAAA,CAAA,UAAA,CAAA,EAAA,CAAA,EAAA,CAAA;;4FAiBH,kBAAkB,EAAA,UAAA,EAAA,CAAA;kBA1B9B,SAAS;AACC,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,gBAAgB,EAAA,OAAA,EACjB;wBACR,eAAe;wBACf,iBAAiB;wBACjB,gBAAgB;wBAChB,YAAY;wBACZ,mBAAmB;wBACnB,yBAAyB;wBACzB;qBACA,EAAA,SAAA,EAGU;AACV,wBAAA;AACC,4BAAA,OAAO,EAAE,iBAAiB;AAC1B,4BAAA,WAAW,EAAE,UAAU,CAAC,wBAAwB,CAAC;AACjD,4BAAA,KAAK,EAAE;AACP,yBAAA;AACD,wBAAA;AACC,4BAAA,OAAO,EAAE,aAAa;AACtB,4BAAA,WAAW,EAAE,UAAU,CAAC,wBAAwB,CAAC;AACjD,4BAAA,KAAK,EAAE;AACP;AACD,qBAAA,EAAA,QAAA,EAAA,40GAAA,EAAA;;;AEhDF;;ACAA;;AAEG;;;;"}
package/index.d.ts CHANGED
@@ -1,7 +1,8 @@
1
1
  import * as _angular_core from '@angular/core';
2
2
  import { ElementRef, AfterContentInit, OnDestroy } from '@angular/core';
3
3
  import { FileSelectEvent } from 'primeng/fileupload';
4
- import { NgControl } from '@angular/forms';
4
+ import { NgControl, ControlValueAccessor, Validator, FormGroup, AbstractControl, ValidationErrors } from '@angular/forms';
5
+ import { Subscription } from 'rxjs';
5
6
 
6
7
  declare class EmptyComponent {
7
8
  title: _angular_core.InputSignal<string>;
@@ -53,4 +54,88 @@ declare class FormFieldWrapperComponent implements AfterContentInit, OnDestroy {
53
54
  static ɵcmp: _angular_core.ɵɵComponentDeclaration<FormFieldWrapperComponent, "ngp-form-field-wrapper", never, { "validationMessages": { "alias": "validationMessages"; "required": false; }; }, {}, ["control"], ["*"], true, never>;
54
55
  }
55
56
 
56
- export { EmptyComponent, FileUploadComponent, FormFieldWrapperComponent };
57
+ type SelectValue<T> = T | T[];
58
+ type SelectValueOrNull<T> = SelectValue<T> | null;
59
+ declare class BasicNgSelectComponent<T = any> implements ControlValueAccessor {
60
+ options: _angular_core.InputSignal<T[]>;
61
+ bindLabel: _angular_core.InputSignal<string>;
62
+ bindValue: _angular_core.InputSignal<string>;
63
+ placeholder: _angular_core.InputSignal<string>;
64
+ clearable: _angular_core.InputSignal<boolean>;
65
+ searchable: _angular_core.InputSignal<boolean>;
66
+ loading: _angular_core.InputSignal<boolean>;
67
+ label: _angular_core.InputSignal<string | null>;
68
+ required: _angular_core.InputSignal<boolean>;
69
+ value: SelectValueOrNull<T>;
70
+ disabled: boolean;
71
+ private onChange;
72
+ onTouched: () => void;
73
+ onValueChange(value: SelectValueOrNull<T>): void;
74
+ writeValue(val: SelectValueOrNull<T>): void;
75
+ registerOnChange(fn: (val: SelectValueOrNull<T>) => void): void;
76
+ registerOnTouched(fn: () => void): void;
77
+ setDisabledState?(isDisabled: boolean): void;
78
+ compareWith: (item: any, selected: any) => boolean;
79
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<BasicNgSelectComponent<any>, never>;
80
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<BasicNgSelectComponent<any>, "ngp-basic-select", never, { "options": { "alias": "options"; "required": false; "isSignal": true; }; "bindLabel": { "alias": "bindLabel"; "required": false; "isSignal": true; }; "bindValue": { "alias": "bindValue"; "required": false; "isSignal": true; }; "placeholder": { "alias": "placeholder"; "required": false; "isSignal": true; }; "clearable": { "alias": "clearable"; "required": false; "isSignal": true; }; "searchable": { "alias": "searchable"; "required": false; "isSignal": true; }; "loading": { "alias": "loading"; "required": false; "isSignal": true; }; "label": { "alias": "label"; "required": false; "isSignal": true; }; "required": { "alias": "required"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
81
+ }
82
+
83
+ interface IdName {
84
+ id: number;
85
+ name: string;
86
+ }
87
+
88
+ interface Address {
89
+ line1: string | null;
90
+ line2: string | null;
91
+ barangay: string | null;
92
+ city: string | null;
93
+ province: string | null;
94
+ country: string;
95
+ zipCode: string | null;
96
+ landmark: string | null;
97
+ }
98
+ interface City extends IdName {
99
+ provinceId: number;
100
+ }
101
+ interface Barangay extends IdName {
102
+ municipality_id: number;
103
+ }
104
+
105
+ declare class FgAddressComponent implements ControlValueAccessor, Validator {
106
+ showHeader: _angular_core.InputSignal<boolean>;
107
+ isCreateMode: _angular_core.InputSignal<boolean>;
108
+ addressForm: FormGroup;
109
+ provHttp$: Subscription;
110
+ cityHttp$: Subscription;
111
+ barangayHttp$: Subscription;
112
+ provinceOptions: IdName[];
113
+ cityOptions: City[];
114
+ barangayOptions: Barangay[];
115
+ isDisabled: _angular_core.WritableSignal<boolean>;
116
+ private pendingAddress;
117
+ private isInitializing;
118
+ private onChange;
119
+ private onTouched;
120
+ private readonly addressService;
121
+ private readonly fb;
122
+ constructor();
123
+ clearFieldByName(fieldName: string): void;
124
+ loadProvince(): void;
125
+ loadCityByProvinceId(id: number): void;
126
+ loadBarangayByCityId(id: number): void;
127
+ private initializeEditMode;
128
+ private setCityFromPending;
129
+ private setBarangayFromPending;
130
+ private completeInitialization;
131
+ writeValue(value: Address | null): void;
132
+ registerOnChange(fn: (value: Address | null) => void): void;
133
+ registerOnTouched(fn: () => void): void;
134
+ setDisabledState(isDisabled: boolean): void;
135
+ validate(control: AbstractControl): ValidationErrors | null;
136
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<FgAddressComponent, never>;
137
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<FgAddressComponent, "ngp-fg-address", never, { "showHeader": { "alias": "showHeader"; "required": false; "isSignal": true; }; "isCreateMode": { "alias": "isCreateMode"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
138
+ }
139
+
140
+ export { BasicNgSelectComponent, EmptyComponent, FgAddressComponent, FileUploadComponent, FormFieldWrapperComponent };
141
+ export type { IdName };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@winexist/ngp",
3
- "version": "0.2.0",
3
+ "version": "0.4.0",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "^20.3.0",
6
6
  "@angular/core": "^20.3.0"