@esolve/ng-esolve-connect 0.138.0 → 0.139.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.
- package/fesm2022/esolve-ng-esolve-connect-media.mjs +7 -3
- package/fesm2022/esolve-ng-esolve-connect-media.mjs.map +1 -1
- package/fesm2022/esolve-ng-esolve-connect-survey.mjs +4 -2
- package/fesm2022/esolve-ng-esolve-connect-survey.mjs.map +1 -1
- package/fesm2022/esolve-ng-esolve-connect.mjs +39 -7
- package/fesm2022/esolve-ng-esolve-connect.mjs.map +1 -1
- package/index.d.ts +9 -0
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { inject, Injectable, InjectionToken, Injector, Input, Component, NgModule } from '@angular/core';
|
|
2
|
+
import { inject, Injectable, InjectionToken, Injector, isDevMode, Input, Component, NgModule } from '@angular/core';
|
|
3
3
|
import * as i1 from '@angular/cdk/portal';
|
|
4
4
|
import { ComponentPortal, PortalModule } from '@angular/cdk/portal';
|
|
5
5
|
import { EsolveSeoInfo, EsolveTag, EsolveTopic, EsolveManufacturer, EsolveRange, EsolveConfigService } from '@esolve/ng-esolve-connect';
|
|
@@ -409,7 +409,9 @@ class EsolveMediaLayoutComponent {
|
|
|
409
409
|
}
|
|
410
410
|
catch (error) {
|
|
411
411
|
this.portal = null;
|
|
412
|
-
|
|
412
|
+
if (isDevMode()) {
|
|
413
|
+
console.error(error);
|
|
414
|
+
}
|
|
413
415
|
}
|
|
414
416
|
}
|
|
415
417
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: EsolveMediaLayoutComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
@@ -453,7 +455,9 @@ class EsolveMediaSectionComponent {
|
|
|
453
455
|
this.portals.push(portal);
|
|
454
456
|
}
|
|
455
457
|
catch (error) {
|
|
456
|
-
|
|
458
|
+
if (isDevMode()) {
|
|
459
|
+
console.error(error);
|
|
460
|
+
}
|
|
457
461
|
continue;
|
|
458
462
|
}
|
|
459
463
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"esolve-ng-esolve-connect-media.mjs","sources":["../../../../libs/ng-esolve-connect/media/src/lib/classes/esolve-heading.model.ts","../../../../libs/ng-esolve-connect/media/src/lib/classes/esolve-media-group.model.ts","../../../../libs/ng-esolve-connect/media/src/lib/classes/esolve-media-layout-section.model.ts","../../../../libs/ng-esolve-connect/media/src/lib/classes/esolve-media-link.model.ts","../../../../libs/ng-esolve-connect/media/src/lib/classes/esolve-media-article.model.ts","../../../../libs/ng-esolve-connect/media/src/lib/services/esolve-media.service.ts","../../../../libs/ng-esolve-connect/media/src/lib/esolve-connect-media-config.token.ts","../../../../libs/ng-esolve-connect/media/src/lib/services/esolve-media-layout.service.ts","../../../../libs/ng-esolve-connect/media/src/lib/components/media-layout/esolve-media-layout.component.ts","../../../../libs/ng-esolve-connect/media/src/lib/components/media-layout/esolve-media-layout.component.html","../../../../libs/ng-esolve-connect/media/src/lib/components/media-section/esolve-media-section.component.ts","../../../../libs/ng-esolve-connect/media/src/lib/components/media-section/esolve-media-section.component.html","../../../../libs/ng-esolve-connect/media/src/lib/functions/provide-ng-esolve-connect-media.function.ts","../../../../libs/ng-esolve-connect/media/src/lib/ng-esolve-connect-media.module.ts","../../../../libs/ng-esolve-connect/media/src/esolve-ng-esolve-connect-media.ts"],"sourcesContent":["export class EsolveHeading {\n constructor(\n public identifier: string,\n public value: string,\n ) {}\n}\n","import { EsolveMediaGroupRecord } from '../interfaces';\n\nexport class EsolveMediaGroup {\n public id = 0;\n public name = '';\n public sef_name = '';\n public description = '';\n\n constructor(record?: EsolveMediaGroupRecord) {\n if (record) {\n this.id = +(record.id ?? 0);\n this.name = record.name ?? '';\n this.sef_name = record.sef_name ?? '';\n this.description = record.description ?? '';\n }\n }\n}\n","import {\n EsolveMediaLayoutSectionRecord,\n EsolveMediaSectionDataGeneric,\n} from '../interfaces';\nimport { EsolveMediaLayoutSectionType } from '../types';\n\nexport class EsolveMediaLayoutSection {\n public type: EsolveMediaLayoutSectionType;\n public sub_type = '';\n public identifier: string;\n\n private data?: EsolveMediaSectionDataGeneric;\n\n constructor(record: EsolveMediaLayoutSectionRecord) {\n this.type = record.type;\n this.identifier = record.identifier;\n this.sub_type = record.sub_type ?? '';\n\n if (record.data) {\n this.data = record.data;\n }\n }\n\n public getData<T = EsolveMediaSectionDataGeneric>(): T | null {\n if (typeof this.data === 'undefined') {\n return null;\n }\n\n return this.data as T;\n }\n}\n","import { EsolveUrlTarget } from '@esolve/ng-esolve-connect';\n\nimport { EsolveMediaLinkRecord } from '../interfaces';\n\nexport class EsolveMediaLink {\n public caption: string;\n public url: string;\n public target: EsolveUrlTarget;\n\n constructor(record: EsolveMediaLinkRecord) {\n this.url = record.url;\n this.caption = record.caption ?? 'Read more...';\n this.target = record.target ?? '_self';\n }\n}\n","import {\n EsolveSeoDetails,\n EsolveTag,\n EsolveTopic,\n EsolveSeoInfo,\n EsolveManufacturer,\n EsolveRange,\n EsolveCustomFields,\n} from '@esolve/ng-esolve-connect';\n\nimport { EsolveMediaRecord } from '../interfaces';\n\nimport { EsolveMediaGroup } from './esolve-media-group.model';\nimport { EsolveMediaLayoutSection } from './esolve-media-layout-section.model';\nimport { EsolveMediaLink } from './esolve-media-link.model';\n\nexport class EsolveMediaArticle implements EsolveSeoDetails {\n public identifier: string;\n public title: string;\n public sub_title: string;\n public published_date?: Date;\n public article: string;\n public layout = '';\n public image_url = '';\n public tags: EsolveTag[] = [];\n public topics: EsolveTopic[] = [];\n public seo_details: EsolveSeoInfo;\n public group?: EsolveMediaGroup;\n public manufacturer?: EsolveManufacturer;\n public range?: EsolveRange;\n public sections?: Map<string, EsolveMediaLayoutSection[]>;\n public link?: EsolveMediaLink;\n public custom_fields?: EsolveCustomFields;\n\n constructor(record: EsolveMediaRecord) {\n this.identifier = record.identifier;\n this.title = record.title;\n this.sub_title = record.sub_title;\n\n if (record.txdate) {\n this.published_date = new Date(+record.txdate * 1000);\n }\n\n this.article = record.article;\n\n let seo_title = record.seo_page_title ?? '';\n const seo_keywords = record.seo_keywords ?? '';\n const seo_description = record.seo_description ?? '';\n\n if (seo_title.trim() === '') {\n seo_title = this.title;\n }\n\n this.seo_details = new EsolveSeoInfo(\n seo_title,\n seo_description,\n seo_keywords,\n );\n\n this.image_url = record.image_url ?? '';\n if (this.image_url !== '') {\n this.image_url = this.image_url + '?cs=' + record.image_checksum;\n }\n\n if (record.tags && record.tags.length > 0) {\n for (const tag of record.tags) {\n this.tags.push(new EsolveTag(tag));\n }\n }\n\n if (record.topics && record.topics.length > 0) {\n for (const topic of record.topics) {\n this.topics.push(new EsolveTopic(topic));\n }\n }\n\n if (record.media_group) {\n this.group = new EsolveMediaGroup(record.media_group);\n }\n\n if (record.manufacturer) {\n this.manufacturer = new EsolveManufacturer(record.manufacturer);\n }\n\n if (record.range) {\n this.range = new EsolveRange(record.range);\n }\n\n if (\n record.is_both_master_and_minor_article ||\n !record.is_minor_article\n ) {\n this.layout = record.layout ?? '';\n\n if (record.sections) {\n this.sections = new Map<string, EsolveMediaLayoutSection[]>();\n\n for (const key in record.sections) {\n const section_list: EsolveMediaLayoutSection[] = [];\n const section_records = record.sections[key];\n\n for (const section_record of section_records) {\n section_list.push(\n new EsolveMediaLayoutSection(section_record),\n );\n }\n\n this.sections.set(key, section_list);\n }\n }\n }\n\n if (\n record.is_both_master_and_minor_article ||\n record.is_minor_article\n ) {\n if (record.sef_url) {\n this.link = new EsolveMediaLink({\n url: record.sef_url,\n caption: record.link_caption,\n target: record.target,\n });\n }\n }\n\n if (record.custom_fields) {\n this.custom_fields = record.custom_fields;\n }\n }\n}\n","import { inject, Injectable } from '@angular/core';\nimport { HttpClient, HttpParams } from '@angular/common/http';\n\nimport { Observable } from 'rxjs';\nimport { map } from 'rxjs/operators';\n\nimport {\n EsolveGetResponse,\n EsolveConfigService,\n EsolveSort,\n} from '@esolve/ng-esolve-connect';\n\nimport { EsolveMediaArticle, EsolveHeading } from '../classes';\nimport { EsolveMediaRecord, EsolveHeadingRecord } from '../interfaces';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class EsolveMediaService {\n private config = inject(EsolveConfigService);\n private http = inject(HttpClient);\n\n /**\n * Retrieves the media record from the eSolve instance using the identifier\n *\n * @param identifier String representing the eSolve media identifier\n */\n public getMediaArticle(identifier: string): Observable<EsolveMediaArticle> {\n const params = new HttpParams({ fromObject: { identifier } });\n\n // TODO: Error Handling\n return this.getMediaRecords(params).pipe(\n map((response) => {\n if (\n response.records === undefined ||\n response.records.length <= 0\n ) {\n throw response;\n }\n\n const mediaRecord = response.records[0];\n\n if (!mediaRecord.active) {\n throw response;\n }\n\n return this.processMediaRecord(mediaRecord);\n }),\n );\n }\n\n /**\n * Retrieves a group of media records from the eSolve instance linked to a group\n *\n * @param media_group String representing the eSolve media group\n */\n public getGroupedMediaArticles(\n media_group: string,\n sort?: EsolveSort\n ): Observable<EsolveMediaArticle[]> {\n\n let params = new HttpParams();\n\n params = params.set('media_group_sef', media_group);\n\n if (sort) {\n if (sort.field) {\n params = params.set('sort', sort.field);\n }\n\n if (sort.order) {\n params = params.set('order', sort.order);\n }\n }\n\n return this.getMediaRecords(params).pipe(\n map((response) => {\n const mediaArticles: EsolveMediaArticle[] = [];\n\n if (\n response.records !== undefined &&\n response.records.length > 0\n ) {\n for (const mediaRecord of response.records) {\n if (mediaRecord.active) {\n mediaArticles.push(\n this.processMediaRecord(mediaRecord),\n );\n }\n }\n }\n\n return mediaArticles;\n }),\n );\n }\n\n /**\n * Retrieves the media heading records from the eSolve instance using the identifiers\n *\n * @param identifiers Array of strings representing the eSolve heading identifiers\n */\n public getHeadings(identifiers: string[]): Observable<EsolveHeading[]> {\n return this.http\n .get<EsolveGetResponse<EsolveHeadingRecord[]>>(\n `${this.config.api_url}/get-headings.php`,\n {\n params: {\n identifier: identifiers.join(','),\n },\n },\n )\n .pipe(\n map((response) => {\n const headings: EsolveHeading[] = [];\n\n if (\n response.records !== undefined &&\n response.records.length > 0\n ) {\n for (const heading_record of response.records) {\n headings.push(\n this.processHeadingRecord(heading_record),\n );\n }\n }\n\n return headings;\n }),\n );\n }\n\n /**\n * Processes media article record\n *\n * @param record Record from eSolve instance\n */\n private processMediaRecord(record: EsolveMediaRecord): EsolveMediaArticle {\n return new EsolveMediaArticle(record);\n }\n\n /**\n * Processes media heading record\n *\n * @param record Record from eSolve instance\n */\n private processHeadingRecord(record: EsolveHeadingRecord): EsolveHeading {\n return new EsolveHeading(record.identifier, record.value);\n }\n\n /**\n * Retrieves media records from eSolve instance.\n *\n * @param params HTTP params\n */\n private getMediaRecords(\n params: HttpParams,\n ): Observable<EsolveGetResponse<EsolveMediaRecord[]>> {\n return this.http.get<EsolveGetResponse<EsolveMediaRecord[]>>(\n `${this.config.api_url}/get-media.php`,\n { params },\n );\n }\n}\n","import { InjectionToken } from '@angular/core';\n\nimport { EsolveConnectMediaConfig } from './interfaces';\n\nexport const ESOLVE_CONNECT_MEDIA_CONFIG =\n new InjectionToken<EsolveConnectMediaConfig>('esolve.connect.media.config');\n","import { ComponentType } from '@angular/cdk/portal';\nimport { inject, Injectable } from '@angular/core';\n\nimport { EsolveMediaArticle, EsolveMediaLayoutSection } from '../classes';\nimport { EsolveSectionKeyOptions } from '../interfaces';\n\nimport { ESOLVE_CONNECT_MEDIA_CONFIG } from '../esolve-connect-media-config.token';\n\n@Injectable()\nexport class EsolveMediaLayoutService {\n private readonly section_key_delimiter = '>>>';\n private readonly default_section_group_key = '__default';\n private readonly default_layout_key = '__default__';\n\n private media?: EsolveMediaArticle;\n private layout_map = new Map<string, ComponentType<any>>();\n private section_map = new Map<string, ComponentType<any>>();\n private default_layout: string;\n\n constructor() {\n const config = inject(ESOLVE_CONNECT_MEDIA_CONFIG);\n\n if (config.layouts.length === 0) {\n throw new Error('No layouts have been defined');\n }\n\n for (const layout of config.layouts) {\n this.setLayout(layout.key, layout.component);\n\n if (layout.sections) {\n for (const section_group_key in layout.sections) {\n const sections = layout.sections[section_group_key];\n\n if (!sections || sections.length === 0) {\n continue;\n }\n\n for (const section of sections) {\n const key_options: EsolveSectionKeyOptions = {\n type: section.key,\n sub_type: section.sub_key,\n layout: layout.key,\n };\n\n if (\n section_group_key !== this.default_section_group_key\n ) {\n key_options.group = section_group_key;\n }\n\n this.setSection(section.component, key_options);\n }\n }\n }\n }\n\n const default_layout = config.default_layout;\n\n if (default_layout) {\n this.default_layout = default_layout;\n } else {\n this.default_layout = config.layouts[0].key;\n }\n\n if (config.sections.length > 0) {\n for (const section of config.sections) {\n const key_options: EsolveSectionKeyOptions = {\n type: section.key,\n sub_type: section.sub_key,\n };\n\n this.setSection(section.component, key_options);\n }\n }\n }\n\n public getMedia() {\n if (!this.media) {\n throw new Error('Media not declared');\n }\n\n return this.media;\n }\n\n public setMedia(media: EsolveMediaArticle) {\n this.media = media;\n }\n\n public getLayout() {\n const media = this.getMedia();\n\n let layout_key = media.layout;\n\n if (layout_key === '') {\n layout_key = this.default_layout;\n }\n\n return this.searchLayout(layout_key);\n }\n\n public getSectionContent(key: string) {\n const media = this.getMedia();\n\n if (media.sections) {\n const section = media.sections.get(key);\n\n if (section) {\n return section;\n }\n }\n\n return [];\n }\n\n public getSectionComponent(key: string, section: EsolveMediaLayoutSection) {\n const type = section.type;\n const sub_type = section.sub_type;\n const { layout } = this.getMedia();\n\n const section_key = this.createSectionMapKey({\n type,\n sub_type,\n layout,\n group: key,\n });\n\n let component = this.section_map.get(section_key);\n\n if (component) {\n return component;\n }\n\n const layout_key = this.createSectionMapKey({\n type,\n sub_type,\n layout,\n });\n\n component = this.section_map.get(layout_key);\n\n if (component) {\n return component;\n }\n\n const base_key = this.createSectionMapKey({\n type,\n sub_type,\n });\n\n component = this.section_map.get(base_key);\n\n if (component) {\n return component;\n }\n\n throw new Error(`Section component not defined for ${section_key}`);\n }\n\n private searchLayout(layout_key: string) {\n if (layout_key === this.default_layout_key) {\n layout_key = this.default_layout;\n }\n\n const component = this.layout_map.get(layout_key);\n\n if (!component) {\n throw new Error(`Layout component not defined for ${layout_key}`);\n }\n\n return component;\n }\n\n private setLayout(key: string, component: ComponentType<any>) {\n this.layout_map.set(key, component);\n }\n\n private setSection(\n component: ComponentType<any>,\n key_options: EsolveSectionKeyOptions,\n ) {\n const key = this.createSectionMapKey(key_options);\n\n this.section_map.set(key, component);\n }\n\n private createSectionMapKey(key_options: EsolveSectionKeyOptions) {\n const { type, sub_type, layout, group } = key_options;\n\n const key_array: string[] = [type];\n\n if (sub_type) {\n key_array.push(sub_type);\n }\n\n if (layout) {\n key_array.push(layout);\n\n if (group) {\n key_array.push(group);\n }\n }\n\n return key_array.join(this.section_key_delimiter);\n }\n}\n","import { Component, OnChanges, Input, Injector, inject } from '@angular/core';\nimport { ComponentPortal, PortalModule } from '@angular/cdk/portal';\n\nimport { EsolveMediaArticle } from '../../classes';\nimport { EsolveMediaLayoutService } from '../../services';\n\n@Component({\n selector: 'eslv-media-layout',\n templateUrl: 'esolve-media-layout.component.html',\n imports: [PortalModule],\n providers: [EsolveMediaLayoutService]\n})\nexport class EsolveMediaLayoutComponent implements OnChanges {\n private readonly layoutService = inject(EsolveMediaLayoutService);\n\n @Input({ required: true }) public media!: EsolveMediaArticle;\n\n public portal?: ComponentPortal<any> | null;\n\n public ngOnChanges(): void {\n try {\n this.layoutService.setMedia(this.media);\n const component = this.layoutService.getLayout();\n const injector = Injector.create({\n providers: [\n {\n provide: EsolveMediaLayoutService,\n useValue: this.layoutService,\n },\n ],\n });\n\n this.portal = new ComponentPortal(component, null, injector);\n } catch (error) {\n this.portal = null;\n console.error(error);\n }\n }\n}\n","<ng-template [cdkPortalOutlet]=\"portal\" />\n","import { Component, Injector, Input, OnChanges, inject } from '@angular/core';\nimport { ComponentPortal, PortalModule } from '@angular/cdk/portal';\n\nimport { EsolveMediaLayoutSection } from '../../classes';\nimport { EsolveMediaLayoutService } from '../../services';\n\n@Component({\n selector: 'eslv-media-section',\n templateUrl: './esolve-media-section.component.html',\n imports: [PortalModule]\n})\nexport class EsolveMediaSectionComponent implements OnChanges {\n private readonly layoutService = inject(EsolveMediaLayoutService);\n\n @Input({ required: true }) public key!: string;\n\n public portals: ComponentPortal<any>[] = [];\n\n public ngOnChanges(): void {\n const sections = this.layoutService.getSectionContent(this.key);\n this.processPortals(sections);\n }\n\n private processPortals(sections: EsolveMediaLayoutSection[]) {\n this.portals = [];\n\n for (const section of sections) {\n const injector = Injector.create({\n providers: [\n {\n provide: EsolveMediaLayoutSection,\n useValue: section,\n },\n {\n provide: EsolveMediaLayoutService,\n useValue: this.layoutService,\n },\n ],\n });\n\n try {\n const component = this.layoutService.getSectionComponent(\n this.key,\n section,\n );\n\n const portal = new ComponentPortal(component, null, injector);\n this.portals.push(portal);\n } catch (error) {\n console.error(error);\n\n continue;\n }\n }\n }\n}\n","@if (portals.length > 0) {\n @for (portal of portals; track $index) {\n <ng-template [cdkPortalOutlet]=\"portal\" />\n }\n}\n","import { Provider } from '@angular/core';\n\nimport { EsolveConnectMediaConfig } from '../interfaces';\nimport { ESOLVE_CONNECT_MEDIA_CONFIG } from '../esolve-connect-media-config.token';\n\nexport function provideNgEsolveConnectMedia(\n config: EsolveConnectMediaConfig,\n): Provider {\n return {\n provide: ESOLVE_CONNECT_MEDIA_CONFIG,\n useValue: config,\n };\n}\n","import { ModuleWithProviders, NgModule } from '@angular/core';\n\nimport {\n EsolveMediaLayoutComponent,\n EsolveMediaSectionComponent,\n} from './components';\nimport { EsolveConnectMediaConfig } from './interfaces';\nimport { provideNgEsolveConnectMedia } from './functions';\n\n@NgModule({\n imports: [EsolveMediaLayoutComponent, EsolveMediaSectionComponent],\n exports: [EsolveMediaLayoutComponent, EsolveMediaSectionComponent],\n})\nexport class NgEsolveConnectMediaModule {\n public static withConfig(\n config: EsolveConnectMediaConfig,\n ): ModuleWithProviders<NgEsolveConnectMediaModule> {\n return {\n ngModule: NgEsolveConnectMediaModule,\n providers: [provideNgEsolveConnectMedia(config)],\n };\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;MAAa,aAAa,CAAA;IACtB,WAAA,CACW,UAAkB,EAClB,KAAa,EAAA;QADb,IAAA,CAAA,UAAU,GAAV,UAAU;QACV,IAAA,CAAA,KAAK,GAAL,KAAK;IACb;AACN;;MCHY,gBAAgB,CAAA;AAMzB,IAAA,WAAA,CAAY,MAA+B,EAAA;QALpC,IAAA,CAAA,EAAE,GAAG,CAAC;QACN,IAAA,CAAA,IAAI,GAAG,EAAE;QACT,IAAA,CAAA,QAAQ,GAAG,EAAE;QACb,IAAA,CAAA,WAAW,GAAG,EAAE;QAGnB,IAAI,MAAM,EAAE;YACR,IAAI,CAAC,EAAE,GAAG,EAAE,MAAM,CAAC,EAAE,IAAI,CAAC,CAAC;YAC3B,IAAI,CAAC,IAAI,GAAG,MAAM,CAAC,IAAI,IAAI,EAAE;YAC7B,IAAI,CAAC,QAAQ,GAAG,MAAM,CAAC,QAAQ,IAAI,EAAE;YACrC,IAAI,CAAC,WAAW,GAAG,MAAM,CAAC,WAAW,IAAI,EAAE;QAC/C;IACJ;AACH;;MCVY,wBAAwB,CAAA;AAOjC,IAAA,WAAA,CAAY,MAAsC,EAAA;QAL3C,IAAA,CAAA,QAAQ,GAAG,EAAE;AAMhB,QAAA,IAAI,CAAC,IAAI,GAAG,MAAM,CAAC,IAAI;AACvB,QAAA,IAAI,CAAC,UAAU,GAAG,MAAM,CAAC,UAAU;QACnC,IAAI,CAAC,QAAQ,GAAG,MAAM,CAAC,QAAQ,IAAI,EAAE;AAErC,QAAA,IAAI,MAAM,CAAC,IAAI,EAAE;AACb,YAAA,IAAI,CAAC,IAAI,GAAG,MAAM,CAAC,IAAI;QAC3B;IACJ;IAEO,OAAO,GAAA;AACV,QAAA,IAAI,OAAO,IAAI,CAAC,IAAI,KAAK,WAAW,EAAE;AAClC,YAAA,OAAO,I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N,oBAAA,OAAO,EAAE,CAAC,0BAA0B,EAAE,2BAA2B,CAAC;AAClE,oBAAA,OAAO,EAAE,CAAC,0BAA0B,EAAE,2BAA2B,CAAC;AACrE,iBAAA;;;ACZD;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"esolve-ng-esolve-connect-media.mjs","sources":["../../../../libs/ng-esolve-connect/media/src/lib/classes/esolve-heading.model.ts","../../../../libs/ng-esolve-connect/media/src/lib/classes/esolve-media-group.model.ts","../../../../libs/ng-esolve-connect/media/src/lib/classes/esolve-media-layout-section.model.ts","../../../../libs/ng-esolve-connect/media/src/lib/classes/esolve-media-link.model.ts","../../../../libs/ng-esolve-connect/media/src/lib/classes/esolve-media-article.model.ts","../../../../libs/ng-esolve-connect/media/src/lib/services/esolve-media.service.ts","../../../../libs/ng-esolve-connect/media/src/lib/esolve-connect-media-config.token.ts","../../../../libs/ng-esolve-connect/media/src/lib/services/esolve-media-layout.service.ts","../../../../libs/ng-esolve-connect/media/src/lib/components/media-layout/esolve-media-layout.component.ts","../../../../libs/ng-esolve-connect/media/src/lib/components/media-layout/esolve-media-layout.component.html","../../../../libs/ng-esolve-connect/media/src/lib/components/media-section/esolve-media-section.component.ts","../../../../libs/ng-esolve-connect/media/src/lib/components/media-section/esolve-media-section.component.html","../../../../libs/ng-esolve-connect/media/src/lib/functions/provide-ng-esolve-connect-media.function.ts","../../../../libs/ng-esolve-connect/media/src/lib/ng-esolve-connect-media.module.ts","../../../../libs/ng-esolve-connect/media/src/esolve-ng-esolve-connect-media.ts"],"sourcesContent":["export class EsolveHeading {\n constructor(\n public identifier: string,\n public value: string,\n ) {}\n}\n","import { EsolveMediaGroupRecord } from '../interfaces';\n\nexport class EsolveMediaGroup {\n public id = 0;\n public name = '';\n public sef_name = '';\n public description = '';\n\n constructor(record?: EsolveMediaGroupRecord) {\n if (record) {\n this.id = +(record.id ?? 0);\n this.name = record.name ?? '';\n this.sef_name = record.sef_name ?? '';\n this.description = record.description ?? '';\n }\n }\n}\n","import {\n EsolveMediaLayoutSectionRecord,\n EsolveMediaSectionDataGeneric,\n} from '../interfaces';\nimport { EsolveMediaLayoutSectionType } from '../types';\n\nexport class EsolveMediaLayoutSection {\n public type: EsolveMediaLayoutSectionType;\n public sub_type = '';\n public identifier: string;\n\n private data?: EsolveMediaSectionDataGeneric;\n\n constructor(record: EsolveMediaLayoutSectionRecord) {\n this.type = record.type;\n this.identifier = record.identifier;\n this.sub_type = record.sub_type ?? '';\n\n if (record.data) {\n this.data = record.data;\n }\n }\n\n public getData<T = EsolveMediaSectionDataGeneric>(): T | null {\n if (typeof this.data === 'undefined') {\n return null;\n }\n\n return this.data as T;\n }\n}\n","import { EsolveUrlTarget } from '@esolve/ng-esolve-connect';\n\nimport { EsolveMediaLinkRecord } from '../interfaces';\n\nexport class EsolveMediaLink {\n public caption: string;\n public url: string;\n public target: EsolveUrlTarget;\n\n constructor(record: EsolveMediaLinkRecord) {\n this.url = record.url;\n this.caption = record.caption ?? 'Read more...';\n this.target = record.target ?? '_self';\n }\n}\n","import {\n EsolveSeoDetails,\n EsolveTag,\n EsolveTopic,\n EsolveSeoInfo,\n EsolveManufacturer,\n EsolveRange,\n EsolveCustomFields,\n} from '@esolve/ng-esolve-connect';\n\nimport { EsolveMediaRecord } from '../interfaces';\n\nimport { EsolveMediaGroup } from './esolve-media-group.model';\nimport { EsolveMediaLayoutSection } from './esolve-media-layout-section.model';\nimport { EsolveMediaLink } from './esolve-media-link.model';\n\nexport class EsolveMediaArticle implements EsolveSeoDetails {\n public identifier: string;\n public title: string;\n public sub_title: string;\n public published_date?: Date;\n public article: string;\n public layout = '';\n public image_url = '';\n public tags: EsolveTag[] = [];\n public topics: EsolveTopic[] = [];\n public seo_details: EsolveSeoInfo;\n public group?: EsolveMediaGroup;\n public manufacturer?: EsolveManufacturer;\n public range?: EsolveRange;\n public sections?: Map<string, EsolveMediaLayoutSection[]>;\n public link?: EsolveMediaLink;\n public custom_fields?: EsolveCustomFields;\n\n constructor(record: EsolveMediaRecord) {\n this.identifier = record.identifier;\n this.title = record.title;\n this.sub_title = record.sub_title;\n\n if (record.txdate) {\n this.published_date = new Date(+record.txdate * 1000);\n }\n\n this.article = record.article;\n\n let seo_title = record.seo_page_title ?? '';\n const seo_keywords = record.seo_keywords ?? '';\n const seo_description = record.seo_description ?? '';\n\n if (seo_title.trim() === '') {\n seo_title = this.title;\n }\n\n this.seo_details = new EsolveSeoInfo(\n seo_title,\n seo_description,\n seo_keywords,\n );\n\n this.image_url = record.image_url ?? '';\n if (this.image_url !== '') {\n this.image_url = this.image_url + '?cs=' + record.image_checksum;\n }\n\n if (record.tags && record.tags.length > 0) {\n for (const tag of record.tags) {\n this.tags.push(new EsolveTag(tag));\n }\n }\n\n if (record.topics && record.topics.length > 0) {\n for (const topic of record.topics) {\n this.topics.push(new EsolveTopic(topic));\n }\n }\n\n if (record.media_group) {\n this.group = new EsolveMediaGroup(record.media_group);\n }\n\n if (record.manufacturer) {\n this.manufacturer = new EsolveManufacturer(record.manufacturer);\n }\n\n if (record.range) {\n this.range = new EsolveRange(record.range);\n }\n\n if (\n record.is_both_master_and_minor_article ||\n !record.is_minor_article\n ) {\n this.layout = record.layout ?? '';\n\n if (record.sections) {\n this.sections = new Map<string, EsolveMediaLayoutSection[]>();\n\n for (const key in record.sections) {\n const section_list: EsolveMediaLayoutSection[] = [];\n const section_records = record.sections[key];\n\n for (const section_record of section_records) {\n section_list.push(\n new EsolveMediaLayoutSection(section_record),\n );\n }\n\n this.sections.set(key, section_list);\n }\n }\n }\n\n if (\n record.is_both_master_and_minor_article ||\n record.is_minor_article\n ) {\n if (record.sef_url) {\n this.link = new EsolveMediaLink({\n url: record.sef_url,\n caption: record.link_caption,\n target: record.target,\n });\n }\n }\n\n if (record.custom_fields) {\n this.custom_fields = record.custom_fields;\n }\n }\n}\n","import { inject, Injectable } from '@angular/core';\nimport { HttpClient, HttpParams } from '@angular/common/http';\n\nimport { Observable } from 'rxjs';\nimport { map } from 'rxjs/operators';\n\nimport {\n EsolveGetResponse,\n EsolveConfigService,\n EsolveSort,\n} from '@esolve/ng-esolve-connect';\n\nimport { EsolveMediaArticle, EsolveHeading } from '../classes';\nimport { EsolveMediaRecord, EsolveHeadingRecord } from '../interfaces';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class EsolveMediaService {\n private config = inject(EsolveConfigService);\n private http = inject(HttpClient);\n\n /**\n * Retrieves the media record from the eSolve instance using the identifier\n *\n * @param identifier String representing the eSolve media identifier\n */\n public getMediaArticle(identifier: string): Observable<EsolveMediaArticle> {\n const params = new HttpParams({ fromObject: { identifier } });\n\n // TODO: Error Handling\n return this.getMediaRecords(params).pipe(\n map((response) => {\n if (\n response.records === undefined ||\n response.records.length <= 0\n ) {\n throw response;\n }\n\n const mediaRecord = response.records[0];\n\n if (!mediaRecord.active) {\n throw response;\n }\n\n return this.processMediaRecord(mediaRecord);\n }),\n );\n }\n\n /**\n * Retrieves a group of media records from the eSolve instance linked to a group\n *\n * @param media_group String representing the eSolve media group\n */\n public getGroupedMediaArticles(\n media_group: string,\n sort?: EsolveSort\n ): Observable<EsolveMediaArticle[]> {\n\n let params = new HttpParams();\n\n params = params.set('media_group_sef', media_group);\n\n if (sort) {\n if (sort.field) {\n params = params.set('sort', sort.field);\n }\n\n if (sort.order) {\n params = params.set('order', sort.order);\n }\n }\n\n return this.getMediaRecords(params).pipe(\n map((response) => {\n const mediaArticles: EsolveMediaArticle[] = [];\n\n if (\n response.records !== undefined &&\n response.records.length > 0\n ) {\n for (const mediaRecord of response.records) {\n if (mediaRecord.active) {\n mediaArticles.push(\n this.processMediaRecord(mediaRecord),\n );\n }\n }\n }\n\n return mediaArticles;\n }),\n );\n }\n\n /**\n * Retrieves the media heading records from the eSolve instance using the identifiers\n *\n * @param identifiers Array of strings representing the eSolve heading identifiers\n */\n public getHeadings(identifiers: string[]): Observable<EsolveHeading[]> {\n return this.http\n .get<EsolveGetResponse<EsolveHeadingRecord[]>>(\n `${this.config.api_url}/get-headings.php`,\n {\n params: {\n identifier: identifiers.join(','),\n },\n },\n )\n .pipe(\n map((response) => {\n const headings: EsolveHeading[] = [];\n\n if (\n response.records !== undefined &&\n response.records.length > 0\n ) {\n for (const heading_record of response.records) {\n headings.push(\n this.processHeadingRecord(heading_record),\n );\n }\n }\n\n return headings;\n }),\n );\n }\n\n /**\n * Processes media article record\n *\n * @param record Record from eSolve instance\n */\n private processMediaRecord(record: EsolveMediaRecord): EsolveMediaArticle {\n return new EsolveMediaArticle(record);\n }\n\n /**\n * Processes media heading record\n *\n * @param record Record from eSolve instance\n */\n private processHeadingRecord(record: EsolveHeadingRecord): EsolveHeading {\n return new EsolveHeading(record.identifier, record.value);\n }\n\n /**\n * Retrieves media records from eSolve instance.\n *\n * @param params HTTP params\n */\n private getMediaRecords(\n params: HttpParams,\n ): Observable<EsolveGetResponse<EsolveMediaRecord[]>> {\n return this.http.get<EsolveGetResponse<EsolveMediaRecord[]>>(\n `${this.config.api_url}/get-media.php`,\n { params },\n );\n }\n}\n","import { InjectionToken } from '@angular/core';\n\nimport { EsolveConnectMediaConfig } from './interfaces';\n\nexport const ESOLVE_CONNECT_MEDIA_CONFIG =\n new InjectionToken<EsolveConnectMediaConfig>('esolve.connect.media.config');\n","import { ComponentType } from '@angular/cdk/portal';\nimport { inject, Injectable } from '@angular/core';\n\nimport { EsolveMediaArticle, EsolveMediaLayoutSection } from '../classes';\nimport { EsolveSectionKeyOptions } from '../interfaces';\n\nimport { ESOLVE_CONNECT_MEDIA_CONFIG } from '../esolve-connect-media-config.token';\n\n@Injectable()\nexport class EsolveMediaLayoutService {\n private readonly section_key_delimiter = '>>>';\n private readonly default_section_group_key = '__default';\n private readonly default_layout_key = '__default__';\n\n private media?: EsolveMediaArticle;\n private layout_map = new Map<string, ComponentType<any>>();\n private section_map = new Map<string, ComponentType<any>>();\n private default_layout: string;\n\n constructor() {\n const config = inject(ESOLVE_CONNECT_MEDIA_CONFIG);\n\n if (config.layouts.length === 0) {\n throw new Error('No layouts have been defined');\n }\n\n for (const layout of config.layouts) {\n this.setLayout(layout.key, layout.component);\n\n if (layout.sections) {\n for (const section_group_key in layout.sections) {\n const sections = layout.sections[section_group_key];\n\n if (!sections || sections.length === 0) {\n continue;\n }\n\n for (const section of sections) {\n const key_options: EsolveSectionKeyOptions = {\n type: section.key,\n sub_type: section.sub_key,\n layout: layout.key,\n };\n\n if (\n section_group_key !== this.default_section_group_key\n ) {\n key_options.group = section_group_key;\n }\n\n this.setSection(section.component, key_options);\n }\n }\n }\n }\n\n const default_layout = config.default_layout;\n\n if (default_layout) {\n this.default_layout = default_layout;\n } else {\n this.default_layout = config.layouts[0].key;\n }\n\n if (config.sections.length > 0) {\n for (const section of config.sections) {\n const key_options: EsolveSectionKeyOptions = {\n type: section.key,\n sub_type: section.sub_key,\n };\n\n this.setSection(section.component, key_options);\n }\n }\n }\n\n public getMedia() {\n if (!this.media) {\n throw new Error('Media not declared');\n }\n\n return this.media;\n }\n\n public setMedia(media: EsolveMediaArticle) {\n this.media = media;\n }\n\n public getLayout() {\n const media = this.getMedia();\n\n let layout_key = media.layout;\n\n if (layout_key === '') {\n layout_key = this.default_layout;\n }\n\n return this.searchLayout(layout_key);\n }\n\n public getSectionContent(key: string) {\n const media = this.getMedia();\n\n if (media.sections) {\n const section = media.sections.get(key);\n\n if (section) {\n return section;\n }\n }\n\n return [];\n }\n\n public getSectionComponent(key: string, section: EsolveMediaLayoutSection) {\n const type = section.type;\n const sub_type = section.sub_type;\n const { layout } = this.getMedia();\n\n const section_key = this.createSectionMapKey({\n type,\n sub_type,\n layout,\n group: key,\n });\n\n let component = this.section_map.get(section_key);\n\n if (component) {\n return component;\n }\n\n const layout_key = this.createSectionMapKey({\n type,\n sub_type,\n layout,\n });\n\n component = this.section_map.get(layout_key);\n\n if (component) {\n return component;\n }\n\n const base_key = this.createSectionMapKey({\n type,\n sub_type,\n });\n\n component = this.section_map.get(base_key);\n\n if (component) {\n return component;\n }\n\n throw new Error(`Section component not defined for ${section_key}`);\n }\n\n private searchLayout(layout_key: string) {\n if (layout_key === this.default_layout_key) {\n layout_key = this.default_layout;\n }\n\n const component = this.layout_map.get(layout_key);\n\n if (!component) {\n throw new Error(`Layout component not defined for ${layout_key}`);\n }\n\n return component;\n }\n\n private setLayout(key: string, component: ComponentType<any>) {\n this.layout_map.set(key, component);\n }\n\n private setSection(\n component: ComponentType<any>,\n key_options: EsolveSectionKeyOptions,\n ) {\n const key = this.createSectionMapKey(key_options);\n\n this.section_map.set(key, component);\n }\n\n private createSectionMapKey(key_options: EsolveSectionKeyOptions) {\n const { type, sub_type, layout, group } = key_options;\n\n const key_array: string[] = [type];\n\n if (sub_type) {\n key_array.push(sub_type);\n }\n\n if (layout) {\n key_array.push(layout);\n\n if (group) {\n key_array.push(group);\n }\n }\n\n return key_array.join(this.section_key_delimiter);\n }\n}\n","import { ComponentPortal, PortalModule } from '@angular/cdk/portal';\nimport {\n Component,\n inject,\n Injector,\n Input,\n isDevMode,\n OnChanges,\n} from '@angular/core';\n\nimport { EsolveMediaArticle } from '../../classes';\nimport { EsolveMediaLayoutService } from '../../services';\n\n@Component({\n selector: 'eslv-media-layout',\n templateUrl: 'esolve-media-layout.component.html',\n imports: [PortalModule],\n providers: [EsolveMediaLayoutService]\n})\nexport class EsolveMediaLayoutComponent implements OnChanges {\n private readonly layoutService = inject(EsolveMediaLayoutService);\n\n @Input({ required: true }) public media!: EsolveMediaArticle;\n\n public portal?: ComponentPortal<any> | null;\n\n public ngOnChanges(): void {\n try {\n this.layoutService.setMedia(this.media);\n const component = this.layoutService.getLayout();\n const injector = Injector.create({\n providers: [\n {\n provide: EsolveMediaLayoutService,\n useValue: this.layoutService,\n },\n ],\n });\n\n this.portal = new ComponentPortal(component, null, injector);\n } catch (error) {\n this.portal = null;\n\n if (isDevMode()) {\n console.error(error);\n }\n }\n }\n}\n","<ng-template [cdkPortalOutlet]=\"portal\" />\n","import { ComponentPortal, PortalModule } from '@angular/cdk/portal';\nimport { Component, inject, Injector, Input, isDevMode, OnChanges } from '@angular/core';\n\nimport { EsolveMediaLayoutSection } from '../../classes';\nimport { EsolveMediaLayoutService } from '../../services';\n\n@Component({\n selector: 'eslv-media-section',\n templateUrl: './esolve-media-section.component.html',\n imports: [PortalModule],\n})\nexport class EsolveMediaSectionComponent implements OnChanges {\n private readonly layoutService = inject(EsolveMediaLayoutService);\n\n @Input({ required: true }) public key!: string;\n\n public portals: ComponentPortal<any>[] = [];\n\n public ngOnChanges(): void {\n const sections = this.layoutService.getSectionContent(this.key);\n this.processPortals(sections);\n }\n\n private processPortals(sections: EsolveMediaLayoutSection[]) {\n this.portals = [];\n\n for (const section of sections) {\n const injector = Injector.create({\n providers: [\n {\n provide: EsolveMediaLayoutSection,\n useValue: section,\n },\n {\n provide: EsolveMediaLayoutService,\n useValue: this.layoutService,\n },\n ],\n });\n\n try {\n const component = this.layoutService.getSectionComponent(\n this.key,\n section,\n );\n\n const portal = new ComponentPortal(component, null, injector);\n this.portals.push(portal);\n } catch (error) {\n if (isDevMode()) {\n console.error(error);\n }\n\n continue;\n }\n }\n }\n}\n","@if (portals.length > 0) {\n @for (portal of portals; track $index) {\n <ng-template [cdkPortalOutlet]=\"portal\" />\n }\n}\n","import { Provider } from '@angular/core';\n\nimport { EsolveConnectMediaConfig } from '../interfaces';\nimport { ESOLVE_CONNECT_MEDIA_CONFIG } from '../esolve-connect-media-config.token';\n\nexport function provideNgEsolveConnectMedia(\n config: EsolveConnectMediaConfig,\n): Provider {\n return {\n provide: ESOLVE_CONNECT_MEDIA_CONFIG,\n useValue: config,\n };\n}\n","import { ModuleWithProviders, NgModule } from '@angular/core';\n\nimport {\n EsolveMediaLayoutComponent,\n EsolveMediaSectionComponent,\n} from './components';\nimport { EsolveConnectMediaConfig } from './interfaces';\nimport { provideNgEsolveConnectMedia } from './functions';\n\n@NgModule({\n imports: [EsolveMediaLayoutComponent, EsolveMediaSectionComponent],\n exports: [EsolveMediaLayoutComponent, EsolveMediaSectionComponent],\n})\nexport class NgEsolveConnectMediaModule {\n public static withConfig(\n config: EsolveConnectMediaConfig,\n ): ModuleWithProviders<NgEsolveConnectMediaModule> {\n return {\n ngModule: NgEsolveConnectMediaModule,\n providers: [provideNgEsolveConnectMedia(config)],\n };\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;MAAa,aAAa,CAAA;IACtB,WAAA,CACW,UAAkB,EAClB,KAAa,EAAA;QADb,IAAA,CAAA,UAAU,GAAV,UAAU;QACV,IAAA,CAAA,KAAK,GAAL,KAAK;IACb;AACN;;MCHY,gBAAgB,CAAA;AAMzB,IAAA,WAAA,CAAY,MAA+B,EAAA;QALpC,IAAA,CAAA,EAAE,GAAG,CAAC;QACN,IAAA,CAAA,IAAI,GAAG,EAAE;QACT,IAAA,CAAA,QAAQ,GAAG,EAAE;QACb,IAAA,CAAA,WAAW,GAAG,EAAE;QAGnB,IAAI,MAAM,EAAE;YACR,IAAI,CAAC,EAAE,GAAG,EAAE,MAAM,CAAC,EAAE,IAAI,CAAC,CAAC;YAC3B,IAAI,CAAC,IAAI,GAAG,MAAM,CAAC,IAAI,IAAI,EAAE;YAC7B,IAAI,CAAC,QAAQ,GAAG,MAAM,CAAC,QAAQ,IAAI,EAAE;YACrC,IAAI,CAAC,WAAW,GAAG,MAAM,CAAC,WAAW,IAAI,EAAE;QAC/C;IACJ;AACH;;MCVY,wBAAwB,CAAA;AAOjC,IAAA,WAAA,CAAY,MAAsC,EAAA;QAL3C,IAAA,CAAA,QAAQ,GAAG,EAAE;AAMhB,QAAA,IAAI,CAAC,IAAI,GAAG,MAAM,CAAC,IAAI;AACvB,QAAA,IAAI,CAAC,UAAU,GAAG,MAAM,CAAC,UAAU;QACnC,IAAI,CAAC,QAAQ,GAAG,MAAM,CAAC,QAAQ,IAAI,EAAE;AAErC,QAAA,IAAI,MAAM,CAAC,IAAI,EAAE;AACb,YAAA,IAAI,CAAC,IAAI,GAAG,MAAM,CAAC,IAAI;QAC3B;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AExD,0BAA0B,EAAA,OAAA,EAAA,CAHzB,0BAA0B,EAAE,2BAA2B,CAAA,EAAA,CAAA,CAAA;;4FAGxD,0BAA0B,EAAA,UAAA,EAAA,CAAA;kBAJtC,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACN,oBAAA,OAAO,EAAE,CAAC,0BAA0B,EAAE,2BAA2B,CAAC;AAClE,oBAAA,OAAO,EAAE,CAAC,0BAA0B,EAAE,2BAA2B,CAAC;AACrE,iBAAA;;;ACZD;;AAEG;;;;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { EsolveSeoInfo, EsolveResponseResult, EsolveConfigService, EsolveErrorHandlerService, EsolveResponseHandlerService } from '@esolve/ng-esolve-connect';
|
|
2
2
|
import * as i0 from '@angular/core';
|
|
3
|
-
import { inject, Injectable } from '@angular/core';
|
|
3
|
+
import { isDevMode, inject, Injectable } from '@angular/core';
|
|
4
4
|
import { HttpClient, HttpParams } from '@angular/common/http';
|
|
5
5
|
import { throwError } from 'rxjs';
|
|
6
6
|
import { map, catchError } from 'rxjs/operators';
|
|
@@ -74,7 +74,9 @@ class EsolveSurveyOptionsQuestion extends EsolveSurveyQuestion {
|
|
|
74
74
|
this.processOption(option);
|
|
75
75
|
}
|
|
76
76
|
catch (error) {
|
|
77
|
-
|
|
77
|
+
if (isDevMode()) {
|
|
78
|
+
console.error(error);
|
|
79
|
+
}
|
|
78
80
|
}
|
|
79
81
|
}
|
|
80
82
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"esolve-ng-esolve-connect-survey.mjs","sources":["../../../../libs/ng-esolve-connect/survey/src/lib/classes/esolve-survey-question.model.ts","../../../../libs/ng-esolve-connect/survey/src/lib/classes/esolve-survey-values-question.model.ts","../../../../libs/ng-esolve-connect/survey/src/lib/classes/esolve-survey-check-question.model.ts","../../../../libs/ng-esolve-connect/survey/src/lib/classes/esolve-survey-text-question.model.ts","../../../../libs/ng-esolve-connect/survey/src/lib/classes/esolve-survey-input-question.model.ts","../../../../libs/ng-esolve-connect/survey/src/lib/classes/esolve-survey-radio-question.model.ts","../../../../libs/ng-esolve-connect/survey/src/lib/classes/esolve-survey-options-question.model.ts","../../../../libs/ng-esolve-connect/survey/src/lib/classes/esolve-survey-rating-question.model.ts","../../../../libs/ng-esolve-connect/survey/src/lib/classes/esolve-survey-select-question.model.ts","../../../../libs/ng-esolve-connect/survey/src/lib/classes/esolve-survey-textarea-question.model.ts","../../../../libs/ng-esolve-connect/survey/src/lib/classes/esolve-survey.model.ts","../../../../libs/ng-esolve-connect/survey/src/lib/classes/esolve-survey-answer-result.model.ts","../../../../libs/ng-esolve-connect/survey/src/lib/services/esolve-survey.service.ts","../../../../libs/ng-esolve-connect/survey/src/esolve-ng-esolve-connect-survey.ts"],"sourcesContent":["import { EsolveSurveyQuestionRecord } from '../interfaces';\nimport { EsolveSurveyQuestionType } from '../types';\n\nexport abstract class EsolveSurveyQuestion {\n public abstract type: EsolveSurveyQuestionType;\n public id: number;\n public identifier: string;\n public question: string;\n public title: string;\n public description: string;\n\n constructor(record: EsolveSurveyQuestionRecord) {\n this.id = record.id;\n this.identifier = record.identifier;\n this.question = record.question;\n this.title = record.title;\n this.description = record.description;\n }\n}\n","import { EsolveSurveyValuesQuestionRecord } from '../interfaces';\n\nimport { EsolveSurveyQuestion } from './esolve-survey-question.model';\n\nexport abstract class EsolveSurveyValuesQuestion extends EsolveSurveyQuestion {\n public values: string[] = [];\n\n constructor(record: EsolveSurveyValuesQuestionRecord) {\n super(record);\n\n if (record.values.length > 0) {\n this.values = record.values;\n }\n }\n}\n","import { EsolveSurveyValuesQuestionRecord } from '../interfaces';\n\nimport { EsolveSurveyValuesQuestion } from './esolve-survey-values-question.model';\n\nexport class EsolveSurveyCheckQuestion extends EsolveSurveyValuesQuestion {\n public readonly type = 'check_boxes';\n\n constructor(record: EsolveSurveyValuesQuestionRecord) {\n if (record.type !== 'check_boxes') {\n throw new Error('Invalid type');\n }\n\n super(record);\n }\n}\n","import { EsolveSurveyTextQuestionRecord } from '../interfaces';\n\nimport { EsolveSurveyQuestion } from './esolve-survey-question.model';\n\nexport abstract class EsolveSurveyTextQuestion extends EsolveSurveyQuestion {\n public length: number;\n public placeholder = '';\n\n constructor(record: EsolveSurveyTextQuestionRecord) {\n super(record);\n\n this.length = record.length;\n this.placeholder = record.placeholder;\n }\n}\n","import { EsolveSurveyTextQuestionRecord } from '../interfaces';\n\nimport { EsolveSurveyTextQuestion } from './esolve-survey-text-question.model';\n\nexport class EsolveSurveyInputQuestion extends EsolveSurveyTextQuestion {\n public readonly type = 'input';\n\n constructor(record: EsolveSurveyTextQuestionRecord) {\n if (record.type !== 'input') {\n throw new Error('Invalid type');\n }\n\n super(record);\n }\n}\n","import { EsolveSurveyValuesQuestionRecord } from '../interfaces';\n\nimport { EsolveSurveyValuesQuestion } from './esolve-survey-values-question.model';\n\nexport class EsolveSurveyRadioQuestion extends EsolveSurveyValuesQuestion {\n public readonly type = 'radio_boxes';\n\n constructor(record: EsolveSurveyValuesQuestionRecord) {\n if (record.type !== 'radio_boxes') {\n throw new Error('Invalid type');\n }\n\n super(record);\n }\n}\n","import {\n EsolveSurveyOption,\n EsolveSurveyOptionsQuestionRecord,\n} from '../interfaces';\n\nimport { EsolveSurveyQuestion } from './esolve-survey-question.model';\n\nexport abstract class EsolveSurveyOptionsQuestion<\n T extends number | string,\n> extends EsolveSurveyQuestion {\n public options: EsolveSurveyOption<T>[] = [];\n\n constructor(record: EsolveSurveyOptionsQuestionRecord) {\n super(record);\n\n if (record.options.length > 0) {\n for (const option of record.options) {\n try {\n this.processOption(option);\n } catch (error) {\n console.error(error);\n }\n }\n }\n }\n\n protected abstract processValue(option: number | string): T;\n\n protected processOption(option: EsolveSurveyOption<string | number>): void {\n this.options.push({\n label: option.label,\n value: this.processValue(option.value),\n });\n }\n}\n","import { EsolveSurveyOptionsQuestionRecord } from '../interfaces';\n\nimport { EsolveSurveyOptionsQuestion } from './esolve-survey-options-question.model';\n\nexport class EsolveSurveyRatingQuestion extends EsolveSurveyOptionsQuestion<number> {\n public readonly type = 'rating';\n\n constructor(record: EsolveSurveyOptionsQuestionRecord) {\n if (record.type !== 'rating') {\n throw new Error('Invalid type');\n }\n\n super(record);\n }\n\n protected processValue(value: string | number): number {\n if (typeof value === 'string') {\n throw new Error('Value must be a number');\n }\n\n return value;\n }\n}\n","import {\n EsolveSurveyOption,\n EsolveSurveyOptionsQuestionRecord,\n} from '../interfaces';\n\nimport { EsolveSurveyOptionsQuestion } from './esolve-survey-options-question.model';\n\nexport class EsolveSurveySelectQuestion extends EsolveSurveyOptionsQuestion<string> {\n public readonly type = 'select';\n\n public placeholder?: string;\n\n constructor(record: EsolveSurveyOptionsQuestionRecord) {\n if (record.type !== 'select') {\n throw new Error('Invalid type');\n }\n\n super(record);\n }\n\n protected processValue(value: string | number): string {\n if (typeof value === 'number') {\n throw new Error('Value must be a string');\n }\n\n return value;\n }\n\n protected override processOption(option: EsolveSurveyOption<string>): void {\n if (option.value === '' && !this.placeholder) {\n this.placeholder = option.label;\n return;\n }\n\n this.options.push({\n label: option.label,\n value: this.processValue(option.value),\n });\n }\n}\n","import { EsolveSurveyTextQuestionRecord } from '../interfaces';\n\nimport { EsolveSurveyTextQuestion } from './esolve-survey-text-question.model';\n\nexport class EsolveSurveyTextareaQuestion extends EsolveSurveyTextQuestion {\n public readonly type = 'textarea';\n\n constructor(record: EsolveSurveyTextQuestionRecord) {\n if (record.type !== 'textarea') {\n throw new Error('Invalid type');\n }\n\n super(record);\n }\n}\n","import { EsolveSeoDetails, EsolveSeoInfo } from '@esolve/ng-esolve-connect';\n\nimport { EsolveSurveyRecord } from '../interfaces';\nimport { EsolveSurveyQuestionRecordList, EsolveSurveyType } from '../types';\n\nimport { EsolveSurveyQuestion } from './esolve-survey-question.model';\nimport { EsolveSurveyCheckQuestion } from './esolve-survey-check-question.model';\nimport { EsolveSurveyInputQuestion } from './esolve-survey-input-question.model';\nimport { EsolveSurveyRadioQuestion } from './esolve-survey-radio-question.model';\nimport { EsolveSurveyRatingQuestion } from './esolve-survey-rating-question.model';\nimport { EsolveSurveySelectQuestion } from './esolve-survey-select-question.model';\nimport { EsolveSurveyTextareaQuestion } from './esolve-survey-textarea-question.model';\n\nexport class EsolveSurvey implements EsolveSeoDetails {\n public id: number;\n public type: EsolveSurveyType;\n public identifier: string;\n public title: string;\n public description: string;\n public questions: EsolveSurveyQuestion[] = [];\n public seo_details: EsolveSeoInfo;\n\n constructor(record: EsolveSurveyRecord) {\n this.id = record.id;\n this.type = record.type;\n this.identifier = record.identifier;\n this.title = record.title;\n this.description = record.description;\n\n if (record.questions.length > 0) {\n this.processQuestions(record.questions);\n }\n\n this.seo_details = new EsolveSeoInfo(this.title, this.description);\n }\n\n private processQuestions(questions: EsolveSurveyQuestionRecordList) {\n for (const record of questions) {\n switch (record.type) {\n case 'input': {\n const question = new EsolveSurveyInputQuestion(record);\n\n this.questions.push(question);\n break;\n }\n\n case 'textarea': {\n const question = new EsolveSurveyTextareaQuestion(record);\n\n this.questions.push(question);\n break;\n }\n\n case 'radio_boxes': {\n const question = new EsolveSurveyRadioQuestion(record);\n\n this.questions.push(question);\n break;\n }\n\n case 'check_boxes': {\n const question = new EsolveSurveyCheckQuestion(record);\n\n this.questions.push(question);\n break;\n }\n\n case 'select': {\n const question = new EsolveSurveySelectQuestion(record);\n\n this.questions.push(question);\n break;\n }\n\n case 'rating': {\n const question = new EsolveSurveyRatingQuestion(record);\n\n this.questions.push(question);\n break;\n }\n\n default:\n break;\n }\n }\n }\n}\n","import { EsolveResponseResult } from '@esolve/ng-esolve-connect';\n\nimport { EsolveSurveyAnswerResponse } from '../interfaces';\n\nexport class EsolveSurveyAnswerResult extends EsolveResponseResult {\n public invalid_question_ids?: number[];\n\n constructor(response: EsolveSurveyAnswerResponse) {\n super(response);\n\n if (\n response.invalid_question_ids &&\n response.invalid_question_ids.length > 0\n ) {\n this.invalid_question_ids = response.invalid_question_ids;\n }\n }\n}\n","import { Injectable, inject } from '@angular/core';\nimport {\n HttpClient,\n HttpParams,\n HttpErrorResponse,\n} from '@angular/common/http';\n\nimport { Observable, throwError } from 'rxjs';\nimport { catchError, map } from 'rxjs/operators';\n\nimport {\n EsolveErrorHandlerService,\n EsolveGetResponse,\n EsolveResponseHandlerService,\n EsolveSetResponse,\n EsolveConfigService,\n} from '@esolve/ng-esolve-connect';\n\nimport {\n EsolveSurveyAnswerResponse,\n EsolveSurveyOptions,\n EsolveSurveyRecord,\n} from '../interfaces';\n\nimport { EsolveSurvey, EsolveSurveyAnswerResult } from '../classes';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class EsolveSurveyService {\n private readonly config = inject(EsolveConfigService);\n private readonly http = inject(HttpClient);\n private readonly errorHandler = inject(EsolveErrorHandlerService);\n private readonly responseHandler = inject(EsolveResponseHandlerService);\n\n /**\n * Get survey from eSolve API\n *\n * @param options\n *\n * @returns An `Observable` with requested survey\n */\n public getSurvey(options: {\n id: number;\n transaction_id?: number;\n }): Observable<EsolveSurvey>;\n public getSurvey(options: {\n identifier: string;\n transaction_id?: number;\n }): Observable<EsolveSurvey>;\n /**\n * Get survey from eSolve API\n *\n * @param id\n * @param transaction_id\n *\n * @returns An `Observable` with requested survey\n */\n public getSurvey(\n id: number,\n transaction_id?: number,\n ): Observable<EsolveSurvey>;\n /**\n * Get survey from eSolve API\n *\n * @param identifier\n * @param transaction_id\n *\n * @returns An `Observable` with requested survey\n */\n public getSurvey(\n identifier: string,\n transaction_id?: number,\n ): Observable<EsolveSurvey>;\n /**\n * Get survey from eSolve API\n *\n * @param options_or_id\n * @param transaction_id\n *\n * @returns An `Observable` with requested survey\n */\n public getSurvey(\n options_or_id: string | number | EsolveSurveyOptions,\n transaction_id?: number,\n ): Observable<EsolveSurvey> {\n try {\n const params = this.setParams(options_or_id, transaction_id);\n\n return this.http\n .get<\n EsolveGetResponse<EsolveSurveyRecord>\n >(`${this.config.api_url}/get-survey.php`, { params })\n .pipe(\n map((response) => {\n if (\n response.records === undefined ||\n Array.isArray(response.records)\n ) {\n throw response;\n }\n\n return new EsolveSurvey(response.records);\n }),\n );\n } catch (error) {\n return throwError(() => error);\n }\n }\n\n /**\n * Set the survey answer\n *\n * @param data\n * @param options\n *\n * @returns An `Observable` with the result\n */\n public setSurveyAnswer(\n data: FormData,\n options: {\n id: number;\n transaction_id?: number;\n },\n ): Observable<EsolveSurveyAnswerResult>;\n public setSurveyAnswer(\n data: FormData,\n options: {\n identifier: string;\n transaction_id?: number;\n },\n ): Observable<EsolveSurveyAnswerResult>;\n /**\n * Set the survey answer\n *\n * @param data\n * @param id\n * @param transaction_id\n *\n * @returns An `Observable` with the result\n */\n public setSurveyAnswer(\n data: FormData,\n id: number,\n transaction_id?: number,\n ): Observable<EsolveSurveyAnswerResult>;\n /**\n * Set the survey answer\n *\n * @param data\n * @param identifier\n * @param transaction_id\n *\n * @returns An `Observable` with the result\n */\n public setSurveyAnswer(\n data: FormData,\n identifier: string,\n transaction_id?: number,\n ): Observable<EsolveSurveyAnswerResult>;\n /**\n * Set the survey answer\n *\n * @param data\n * @param options_or_id\n * @param transaction_id\n *\n * @returns An `Observable` with the result\n */\n public setSurveyAnswer(\n data: FormData,\n options_or_id: string | number | EsolveSurveyOptions,\n transaction_id?: number,\n ): Observable<EsolveSurveyAnswerResult> {\n try {\n const params = this.setParams(options_or_id, transaction_id);\n\n return this.http\n .post<EsolveSetResponse<EsolveSurveyAnswerResponse>>(\n `${this.config.api_url}/set-survey-answer.php`,\n data,\n {\n responseType: 'json',\n observe: 'body',\n params,\n },\n )\n .pipe(\n map((http_response) =>\n this.responseHandler.validateSingleHttpResponse(\n http_response,\n (response) =>\n new EsolveSurveyAnswerResult(response),\n ),\n ),\n catchError((errorRes: HttpErrorResponse | any) => {\n return this.errorHandler.handleHttpPostError(\n 'set-survey-answer',\n errorRes,\n );\n }),\n );\n } catch (error) {\n return throwError(() => error);\n }\n }\n\n private setParams(\n options_or_id: string | number | EsolveSurveyOptions,\n transaction_id?: number,\n ): HttpParams {\n let params = new HttpParams();\n\n if (typeof options_or_id === 'string') {\n params = params.set('identifier', options_or_id);\n } else if (typeof options_or_id === 'number') {\n params = params.set('surveys_id', options_or_id);\n } else {\n if (typeof options_or_id.id !== 'undefined') {\n params = params.set('surveys_id', options_or_id.id);\n } else if (typeof options_or_id.identifier !== 'undefined') {\n params = params.set('identifier', options_or_id.identifier);\n } else {\n throw new Error(\n 'Either ID or Identifier is required to retrieve survey',\n );\n }\n\n transaction_id = options_or_id.transaction_id;\n }\n\n if (typeof transaction_id !== 'undefined') {\n params = params.set('cart_id', transaction_id);\n }\n\n return params;\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;MAGsB,oBAAoB,CAAA;AAQtC,IAAA,WAAA,CAAY,MAAkC,EAAA;AAC1C,QAAA,IAAI,CAAC,EAAE,GAAG,MAAM,CAAC,EAAE;AACnB,QAAA,IAAI,CAAC,UAAU,GAAG,MAAM,CAAC,UAAU;AACnC,QAAA,IAAI,CAAC,QAAQ,GAAG,MAAM,CAAC,QAAQ;AAC/B,QAAA,IAAI,CAAC,KAAK,GAAG,MAAM,CAAC,KAAK;AACzB,QAAA,IAAI,CAAC,WAAW,GAAG,MAAM,CAAC,WAAW;IACzC;AACH;;ACdK,MAAgB,0BAA2B,SAAQ,oBAAoB,CAAA;AAGzE,IAAA,WAAA,CAAY,MAAwC,EAAA;QAChD,KAAK,CAAC,MAAM,CAAC;QAHV,IAAA,CAAA,MAAM,GAAa,EAAE;QAKxB,IAAI,MAAM,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE;AAC1B,YAAA,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM;QAC/B;IACJ;AACH;;ACVK,MAAO,yBAA0B,SAAQ,0BAA0B,CAAA;AAGrE,IAAA,WAAA,CAAY,MAAwC,EAAA;AAChD,QAAA,IAAI,MAAM,CAAC,IAAI,KAAK,aAAa,EAAE;AAC/B,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,CAAC,YAAY,EAAE,aAAa,CAAC,EAAE,CAAC;YACvD;AAAO,iBAAA,IAAI,OAAO,aAAa,CAAC,UAAU,KAAK,WAAW,EAAE;gBACxD,MAAM,GAAG,MAAM,CAAC,GAAG,CAAC,YAAY,EAAE,aAAa,CAAC,UAAU,CAAC;YAC/D;iBAAO;AACH,gBAAA,MAAM,IAAI,KAAK,CACX,wDAAwD,CAC3D;YACL;AAEA,YAAA,cAAc,GAAG,aAAa,CAAC,cAAc;QACjD;AAEA,QAAA,IAAI,OAAO,cAAc,KAAK,WAAW,EAAE;YACvC,MAAM,GAAG,MAAM,CAAC,GAAG,CAAC,SAAS,EAAE,cAAc,CAAC;QAClD;AAEA,QAAA,OAAO,MAAM;IACjB;+GA/MS,mBAAmB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAAnB,IAAA,SAAA,IAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,mBAAmB,cAFhB,MAAM,EAAA,CAAA,CAAA;;4FAET,mBAAmB,EAAA,UAAA,EAAA,CAAA;kBAH/B,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,UAAU,EAAE,MAAM;AACrB,iBAAA;;;AC5BD;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"esolve-ng-esolve-connect-survey.mjs","sources":["../../../../libs/ng-esolve-connect/survey/src/lib/classes/esolve-survey-question.model.ts","../../../../libs/ng-esolve-connect/survey/src/lib/classes/esolve-survey-values-question.model.ts","../../../../libs/ng-esolve-connect/survey/src/lib/classes/esolve-survey-check-question.model.ts","../../../../libs/ng-esolve-connect/survey/src/lib/classes/esolve-survey-text-question.model.ts","../../../../libs/ng-esolve-connect/survey/src/lib/classes/esolve-survey-input-question.model.ts","../../../../libs/ng-esolve-connect/survey/src/lib/classes/esolve-survey-radio-question.model.ts","../../../../libs/ng-esolve-connect/survey/src/lib/classes/esolve-survey-options-question.model.ts","../../../../libs/ng-esolve-connect/survey/src/lib/classes/esolve-survey-rating-question.model.ts","../../../../libs/ng-esolve-connect/survey/src/lib/classes/esolve-survey-select-question.model.ts","../../../../libs/ng-esolve-connect/survey/src/lib/classes/esolve-survey-textarea-question.model.ts","../../../../libs/ng-esolve-connect/survey/src/lib/classes/esolve-survey.model.ts","../../../../libs/ng-esolve-connect/survey/src/lib/classes/esolve-survey-answer-result.model.ts","../../../../libs/ng-esolve-connect/survey/src/lib/services/esolve-survey.service.ts","../../../../libs/ng-esolve-connect/survey/src/esolve-ng-esolve-connect-survey.ts"],"sourcesContent":["import { EsolveSurveyQuestionRecord } from '../interfaces';\nimport { EsolveSurveyQuestionType } from '../types';\n\nexport abstract class EsolveSurveyQuestion {\n public abstract type: EsolveSurveyQuestionType;\n public id: number;\n public identifier: string;\n public question: string;\n public title: string;\n public description: string;\n\n constructor(record: EsolveSurveyQuestionRecord) {\n this.id = record.id;\n this.identifier = record.identifier;\n this.question = record.question;\n this.title = record.title;\n this.description = record.description;\n }\n}\n","import { EsolveSurveyValuesQuestionRecord } from '../interfaces';\n\nimport { EsolveSurveyQuestion } from './esolve-survey-question.model';\n\nexport abstract class EsolveSurveyValuesQuestion extends EsolveSurveyQuestion {\n public values: string[] = [];\n\n constructor(record: EsolveSurveyValuesQuestionRecord) {\n super(record);\n\n if (record.values.length > 0) {\n this.values = record.values;\n }\n }\n}\n","import { EsolveSurveyValuesQuestionRecord } from '../interfaces';\n\nimport { EsolveSurveyValuesQuestion } from './esolve-survey-values-question.model';\n\nexport class EsolveSurveyCheckQuestion extends EsolveSurveyValuesQuestion {\n public readonly type = 'check_boxes';\n\n constructor(record: EsolveSurveyValuesQuestionRecord) {\n if (record.type !== 'check_boxes') {\n throw new Error('Invalid type');\n }\n\n super(record);\n }\n}\n","import { EsolveSurveyTextQuestionRecord } from '../interfaces';\n\nimport { EsolveSurveyQuestion } from './esolve-survey-question.model';\n\nexport abstract class EsolveSurveyTextQuestion extends EsolveSurveyQuestion {\n public length: number;\n public placeholder = '';\n\n constructor(record: EsolveSurveyTextQuestionRecord) {\n super(record);\n\n this.length = record.length;\n this.placeholder = record.placeholder;\n }\n}\n","import { EsolveSurveyTextQuestionRecord } from '../interfaces';\n\nimport { EsolveSurveyTextQuestion } from './esolve-survey-text-question.model';\n\nexport class EsolveSurveyInputQuestion extends EsolveSurveyTextQuestion {\n public readonly type = 'input';\n\n constructor(record: EsolveSurveyTextQuestionRecord) {\n if (record.type !== 'input') {\n throw new Error('Invalid type');\n }\n\n super(record);\n }\n}\n","import { EsolveSurveyValuesQuestionRecord } from '../interfaces';\n\nimport { EsolveSurveyValuesQuestion } from './esolve-survey-values-question.model';\n\nexport class EsolveSurveyRadioQuestion extends EsolveSurveyValuesQuestion {\n public readonly type = 'radio_boxes';\n\n constructor(record: EsolveSurveyValuesQuestionRecord) {\n if (record.type !== 'radio_boxes') {\n throw new Error('Invalid type');\n }\n\n super(record);\n }\n}\n","import { isDevMode } from '@angular/core';\nimport {\n EsolveSurveyOption,\n EsolveSurveyOptionsQuestionRecord,\n} from '../interfaces';\nimport { EsolveSurveyQuestion } from './esolve-survey-question.model';\n\nexport abstract class EsolveSurveyOptionsQuestion<\n T extends number | string,\n> extends EsolveSurveyQuestion {\n public options: EsolveSurveyOption<T>[] = [];\n\n constructor(record: EsolveSurveyOptionsQuestionRecord) {\n super(record);\n\n if (record.options.length > 0) {\n for (const option of record.options) {\n try {\n this.processOption(option);\n } catch (error) {\n if (isDevMode()) {\n console.error(error);\n }\n }\n }\n }\n }\n\n protected abstract processValue(option: number | string): T;\n\n protected processOption(option: EsolveSurveyOption<string | number>): void {\n this.options.push({\n label: option.label,\n value: this.processValue(option.value),\n });\n }\n}\n","import { EsolveSurveyOptionsQuestionRecord } from '../interfaces';\n\nimport { EsolveSurveyOptionsQuestion } from './esolve-survey-options-question.model';\n\nexport class EsolveSurveyRatingQuestion extends EsolveSurveyOptionsQuestion<number> {\n public readonly type = 'rating';\n\n constructor(record: EsolveSurveyOptionsQuestionRecord) {\n if (record.type !== 'rating') {\n throw new Error('Invalid type');\n }\n\n super(record);\n }\n\n protected processValue(value: string | number): number {\n if (typeof value === 'string') {\n throw new Error('Value must be a number');\n }\n\n return value;\n }\n}\n","import {\n EsolveSurveyOption,\n EsolveSurveyOptionsQuestionRecord,\n} from '../interfaces';\n\nimport { EsolveSurveyOptionsQuestion } from './esolve-survey-options-question.model';\n\nexport class EsolveSurveySelectQuestion extends EsolveSurveyOptionsQuestion<string> {\n public readonly type = 'select';\n\n public placeholder?: string;\n\n constructor(record: EsolveSurveyOptionsQuestionRecord) {\n if (record.type !== 'select') {\n throw new Error('Invalid type');\n }\n\n super(record);\n }\n\n protected processValue(value: string | number): string {\n if (typeof value === 'number') {\n throw new Error('Value must be a string');\n }\n\n return value;\n }\n\n protected override processOption(option: EsolveSurveyOption<string>): void {\n if (option.value === '' && !this.placeholder) {\n this.placeholder = option.label;\n return;\n }\n\n this.options.push({\n label: option.label,\n value: this.processValue(option.value),\n });\n }\n}\n","import { EsolveSurveyTextQuestionRecord } from '../interfaces';\n\nimport { EsolveSurveyTextQuestion } from './esolve-survey-text-question.model';\n\nexport class EsolveSurveyTextareaQuestion extends EsolveSurveyTextQuestion {\n public readonly type = 'textarea';\n\n constructor(record: EsolveSurveyTextQuestionRecord) {\n if (record.type !== 'textarea') {\n throw new Error('Invalid type');\n }\n\n super(record);\n }\n}\n","import { EsolveSeoDetails, EsolveSeoInfo } from '@esolve/ng-esolve-connect';\n\nimport { EsolveSurveyRecord } from '../interfaces';\nimport { EsolveSurveyQuestionRecordList, EsolveSurveyType } from '../types';\n\nimport { EsolveSurveyQuestion } from './esolve-survey-question.model';\nimport { EsolveSurveyCheckQuestion } from './esolve-survey-check-question.model';\nimport { EsolveSurveyInputQuestion } from './esolve-survey-input-question.model';\nimport { EsolveSurveyRadioQuestion } from './esolve-survey-radio-question.model';\nimport { EsolveSurveyRatingQuestion } from './esolve-survey-rating-question.model';\nimport { EsolveSurveySelectQuestion } from './esolve-survey-select-question.model';\nimport { EsolveSurveyTextareaQuestion } from './esolve-survey-textarea-question.model';\n\nexport class EsolveSurvey implements EsolveSeoDetails {\n public id: number;\n public type: EsolveSurveyType;\n public identifier: string;\n public title: string;\n public description: string;\n public questions: EsolveSurveyQuestion[] = [];\n public seo_details: EsolveSeoInfo;\n\n constructor(record: EsolveSurveyRecord) {\n this.id = record.id;\n this.type = record.type;\n this.identifier = record.identifier;\n this.title = record.title;\n this.description = record.description;\n\n if (record.questions.length > 0) {\n this.processQuestions(record.questions);\n }\n\n this.seo_details = new EsolveSeoInfo(this.title, this.description);\n }\n\n private processQuestions(questions: EsolveSurveyQuestionRecordList) {\n for (const record of questions) {\n switch (record.type) {\n case 'input': {\n const question = new EsolveSurveyInputQuestion(record);\n\n this.questions.push(question);\n break;\n }\n\n case 'textarea': {\n const question = new EsolveSurveyTextareaQuestion(record);\n\n this.questions.push(question);\n break;\n }\n\n case 'radio_boxes': {\n const question = new EsolveSurveyRadioQuestion(record);\n\n this.questions.push(question);\n break;\n }\n\n case 'check_boxes': {\n const question = new EsolveSurveyCheckQuestion(record);\n\n this.questions.push(question);\n break;\n }\n\n case 'select': {\n const question = new EsolveSurveySelectQuestion(record);\n\n this.questions.push(question);\n break;\n }\n\n case 'rating': {\n const question = new EsolveSurveyRatingQuestion(record);\n\n this.questions.push(question);\n break;\n }\n\n default:\n break;\n }\n }\n }\n}\n","import { EsolveResponseResult } from '@esolve/ng-esolve-connect';\n\nimport { EsolveSurveyAnswerResponse } from '../interfaces';\n\nexport class EsolveSurveyAnswerResult extends EsolveResponseResult {\n public invalid_question_ids?: number[];\n\n constructor(response: EsolveSurveyAnswerResponse) {\n super(response);\n\n if (\n response.invalid_question_ids &&\n response.invalid_question_ids.length > 0\n ) {\n this.invalid_question_ids = response.invalid_question_ids;\n }\n }\n}\n","import { Injectable, inject } from '@angular/core';\nimport {\n HttpClient,\n HttpParams,\n HttpErrorResponse,\n} from '@angular/common/http';\n\nimport { Observable, throwError } from 'rxjs';\nimport { catchError, map } from 'rxjs/operators';\n\nimport {\n EsolveErrorHandlerService,\n EsolveGetResponse,\n EsolveResponseHandlerService,\n EsolveSetResponse,\n EsolveConfigService,\n} from '@esolve/ng-esolve-connect';\n\nimport {\n EsolveSurveyAnswerResponse,\n EsolveSurveyOptions,\n EsolveSurveyRecord,\n} from '../interfaces';\n\nimport { EsolveSurvey, EsolveSurveyAnswerResult } from '../classes';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class EsolveSurveyService {\n private readonly config = inject(EsolveConfigService);\n private readonly http = inject(HttpClient);\n private readonly errorHandler = inject(EsolveErrorHandlerService);\n private readonly responseHandler = inject(EsolveResponseHandlerService);\n\n /**\n * Get survey from eSolve API\n *\n * @param options\n *\n * @returns An `Observable` with requested survey\n */\n public getSurvey(options: {\n id: number;\n transaction_id?: number;\n }): Observable<EsolveSurvey>;\n public getSurvey(options: {\n identifier: string;\n transaction_id?: number;\n }): Observable<EsolveSurvey>;\n /**\n * Get survey from eSolve API\n *\n * @param id\n * @param transaction_id\n *\n * @returns An `Observable` with requested survey\n */\n public getSurvey(\n id: number,\n transaction_id?: number,\n ): Observable<EsolveSurvey>;\n /**\n * Get survey from eSolve API\n *\n * @param identifier\n * @param transaction_id\n *\n * @returns An `Observable` with requested survey\n */\n public getSurvey(\n identifier: string,\n transaction_id?: number,\n ): Observable<EsolveSurvey>;\n /**\n * Get survey from eSolve API\n *\n * @param options_or_id\n * @param transaction_id\n *\n * @returns An `Observable` with requested survey\n */\n public getSurvey(\n options_or_id: string | number | EsolveSurveyOptions,\n transaction_id?: number,\n ): Observable<EsolveSurvey> {\n try {\n const params = this.setParams(options_or_id, transaction_id);\n\n return this.http\n .get<\n EsolveGetResponse<EsolveSurveyRecord>\n >(`${this.config.api_url}/get-survey.php`, { params })\n .pipe(\n map((response) => {\n if (\n response.records === undefined ||\n Array.isArray(response.records)\n ) {\n throw response;\n }\n\n return new EsolveSurvey(response.records);\n }),\n );\n } catch (error) {\n return throwError(() => error);\n }\n }\n\n /**\n * Set the survey answer\n *\n * @param data\n * @param options\n *\n * @returns An `Observable` with the result\n */\n public setSurveyAnswer(\n data: FormData,\n options: {\n id: number;\n transaction_id?: number;\n },\n ): Observable<EsolveSurveyAnswerResult>;\n public setSurveyAnswer(\n data: FormData,\n options: {\n identifier: string;\n transaction_id?: number;\n },\n ): Observable<EsolveSurveyAnswerResult>;\n /**\n * Set the survey answer\n *\n * @param data\n * @param id\n * @param transaction_id\n *\n * @returns An `Observable` with the result\n */\n public setSurveyAnswer(\n data: FormData,\n id: number,\n transaction_id?: number,\n ): Observable<EsolveSurveyAnswerResult>;\n /**\n * Set the survey answer\n *\n * @param data\n * @param identifier\n * @param transaction_id\n *\n * @returns An `Observable` with the result\n */\n public setSurveyAnswer(\n data: FormData,\n identifier: string,\n transaction_id?: number,\n ): Observable<EsolveSurveyAnswerResult>;\n /**\n * Set the survey answer\n *\n * @param data\n * @param options_or_id\n * @param transaction_id\n *\n * @returns An `Observable` with the result\n */\n public setSurveyAnswer(\n data: FormData,\n options_or_id: string | number | EsolveSurveyOptions,\n transaction_id?: number,\n ): Observable<EsolveSurveyAnswerResult> {\n try {\n const params = this.setParams(options_or_id, transaction_id);\n\n return this.http\n .post<EsolveSetResponse<EsolveSurveyAnswerResponse>>(\n `${this.config.api_url}/set-survey-answer.php`,\n data,\n {\n responseType: 'json',\n observe: 'body',\n params,\n },\n )\n .pipe(\n map((http_response) =>\n this.responseHandler.validateSingleHttpResponse(\n http_response,\n (response) =>\n new EsolveSurveyAnswerResult(response),\n ),\n ),\n catchError((errorRes: HttpErrorResponse | any) => {\n return this.errorHandler.handleHttpPostError(\n 'set-survey-answer',\n errorRes,\n );\n }),\n );\n } catch (error) {\n return throwError(() => error);\n }\n }\n\n private setParams(\n options_or_id: string | number | EsolveSurveyOptions,\n transaction_id?: number,\n ): HttpParams {\n let params = new HttpParams();\n\n if (typeof options_or_id === 'string') {\n params = params.set('identifier', options_or_id);\n } else if (typeof options_or_id === 'number') {\n params = params.set('surveys_id', options_or_id);\n } else {\n if (typeof options_or_id.id !== 'undefined') {\n params = params.set('surveys_id', options_or_id.id);\n } else if (typeof options_or_id.identifier !== 'undefined') {\n params = params.set('identifier', options_or_id.identifier);\n } else {\n throw new Error(\n 'Either ID or Identifier is required to retrieve survey',\n );\n }\n\n transaction_id = options_or_id.transaction_id;\n }\n\n if (typeof transaction_id !== 'undefined') {\n params = params.set('cart_id', transaction_id);\n }\n\n return params;\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;MAGsB,oBAAoB,CAAA;AAQtC,IAAA,WAAA,CAAY,MAAkC,EAAA;AAC1C,QAAA,IAAI,CAAC,EAAE,GAAG,MAAM,CAAC,EAAE;AACnB,QAAA,IAAI,CAAC,UAAU,GAAG,MAAM,CAAC,UAAU;AACnC,QAAA,IAAI,CAAC,QAAQ,GAAG,MAAM,CAAC,QAAQ;AAC/B,QAAA,IAAI,CAAC,KAAK,GAAG,MAAM,CAAC,KAAK;AACzB,QAAA,IAAI,CAAC,WAAW,GAAG,MAAM,CAAC,WAAW;IACzC;AACH;;ACdK,MAAgB,0BAA2B,SAAQ,oBAAoB,CAAA;AAGzE,IAAA,WAAA,CAAY,MAAwC,EAAA;QAChD,KAAK,CAAC,MAAM,CAAC;QAHV,IAAA,CAAA,MAAM,GAAa,EAAE;QAKxB,IAAI,MAAM,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE;AAC1B,YAAA,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM;QAC/B;IACJ;AACH;;ACVK,MAAO,yBAA0B,SAAQ,0BAA0B,CAAA;AAGrE,IAAA,WAAA,CAAY,MAAwC,EAAA;AAChD,QAAA,IAAI,MAAM,CAAC,IAAI,KAAK,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,KAAK,WAAW,EAAE;gBACzC,MAAM,GAAG,MAAM,CAAC,GAAG,CAAC,YAAY,EAAE,aAAa,CAAC,EAAE,CAAC;YACvD;AAAO,iBAAA,IAAI,OAAO,aAAa,CAAC,UAAU,KAAK,WAAW,EAAE;gBACxD,MAAM,GAAG,MAAM,CAAC,GAAG,CAAC,YAAY,EAAE,aAAa,CAAC,UAAU,CAAC;YAC/D;iBAAO;AACH,gBAAA,MAAM,IAAI,KAAK,CACX,wDAAwD,CAC3D;YACL;AAEA,YAAA,cAAc,GAAG,aAAa,CAAC,cAAc;QACjD;AAEA,QAAA,IAAI,OAAO,cAAc,KAAK,WAAW,EAAE;YACvC,MAAM,GAAG,MAAM,CAAC,GAAG,CAAC,SAAS,EAAE,cAAc,CAAC;QAClD;AAEA,QAAA,OAAO,MAAM;IACjB;+GA/MS,mBAAmB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAAnB,IAAA,SAAA,IAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,mBAAmB,cAFhB,MAAM,EAAA,CAAA,CAAA;;4FAET,mBAAmB,EAAA,UAAA,EAAA,CAAA;kBAH/B,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,UAAU,EAAE,MAAM;AACrB,iBAAA;;;AC5BD;;AAEG;;;;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { isPlatformBrowser, CommonModule, IMAGE_LOADER } from '@angular/common';
|
|
2
2
|
import { HttpClient, HttpParams, HttpErrorResponse, HttpStatusCode, HttpHeaders, provideHttpClient, withInterceptors, withInterceptorsFromDi } from '@angular/common/http';
|
|
3
3
|
import * as i0 from '@angular/core';
|
|
4
|
-
import { InjectionToken, inject, Injectable, DOCUMENT, PLATFORM_ID, ApplicationRef, signal, computed, provideAppInitializer, NgModule, ElementRef, HostListener, Input, Directive } from '@angular/core';
|
|
4
|
+
import { InjectionToken, inject, Injectable, DOCUMENT, PLATFORM_ID, isDevMode, ApplicationRef, signal, computed, provideAppInitializer, NgModule, ElementRef, HostListener, Input, Directive } from '@angular/core';
|
|
5
5
|
import { SsrCookieService } from 'ngx-cookie-service-ssr';
|
|
6
6
|
import { toObservable } from '@angular/core/rxjs-interop';
|
|
7
7
|
import { throwError, map as map$1, of, BehaviorSubject, Subject, firstValueFrom, iif, filter, take, shareReplay, switchMap as switchMap$1, timer, takeUntil, distinctUntilChanged, from, catchError as catchError$1, tap, merge } from 'rxjs';
|
|
@@ -379,6 +379,26 @@ class EsolveCategoryTreeService {
|
|
|
379
379
|
return this.processTree(response.records);
|
|
380
380
|
}));
|
|
381
381
|
}
|
|
382
|
+
/**
|
|
383
|
+
* Retrieve the manufacturer tree structure for a specific manufacturer from the eSolve
|
|
384
|
+
* instance and converts it into the correct format
|
|
385
|
+
*
|
|
386
|
+
* @param manufacturer_id Id of the manufacturer to get the tree for
|
|
387
|
+
*
|
|
388
|
+
* @returns Observable containing manufacturer tree data
|
|
389
|
+
*/
|
|
390
|
+
getManufacturerTree(manufacturer_id) {
|
|
391
|
+
let params = new HttpParams();
|
|
392
|
+
params = params.set('manufacturer_id', manufacturer_id);
|
|
393
|
+
return this.http
|
|
394
|
+
.get(`${this.config.api_url}/get-manufacturer-tree.php`, { params })
|
|
395
|
+
.pipe(map((response) => {
|
|
396
|
+
if (response.records === undefined) {
|
|
397
|
+
throw response;
|
|
398
|
+
}
|
|
399
|
+
return this.processTree(response.records);
|
|
400
|
+
}));
|
|
401
|
+
}
|
|
382
402
|
/**
|
|
383
403
|
* Retrieve the details of a category tree item from the eSolve instance and
|
|
384
404
|
* converts it to the correct format.
|
|
@@ -3332,7 +3352,9 @@ class EsolveCouponsService {
|
|
|
3332
3352
|
return this.jsonDecodeMap(coupons_json);
|
|
3333
3353
|
}
|
|
3334
3354
|
catch (error) {
|
|
3335
|
-
|
|
3355
|
+
if (isDevMode()) {
|
|
3356
|
+
console.error(error);
|
|
3357
|
+
}
|
|
3336
3358
|
// soft error
|
|
3337
3359
|
}
|
|
3338
3360
|
}
|
|
@@ -3568,7 +3590,9 @@ class EsolveVouchersService {
|
|
|
3568
3590
|
return this.jsonDecodeMap(vouchers_json);
|
|
3569
3591
|
}
|
|
3570
3592
|
catch (error) {
|
|
3571
|
-
|
|
3593
|
+
if (isDevMode()) {
|
|
3594
|
+
console.error(error);
|
|
3595
|
+
}
|
|
3572
3596
|
// soft error
|
|
3573
3597
|
}
|
|
3574
3598
|
}
|
|
@@ -4389,7 +4413,9 @@ class EsolveAuthService {
|
|
|
4389
4413
|
this.handleAuthentication(result);
|
|
4390
4414
|
}
|
|
4391
4415
|
catch (error) {
|
|
4392
|
-
|
|
4416
|
+
if (isDevMode()) {
|
|
4417
|
+
console.error(error);
|
|
4418
|
+
}
|
|
4393
4419
|
}
|
|
4394
4420
|
}
|
|
4395
4421
|
login(email, password) {
|
|
@@ -4512,7 +4538,9 @@ class EsolveAuthService {
|
|
|
4512
4538
|
valid = true;
|
|
4513
4539
|
}
|
|
4514
4540
|
catch (error) {
|
|
4515
|
-
|
|
4541
|
+
if (isDevMode()) {
|
|
4542
|
+
console.error(error);
|
|
4543
|
+
}
|
|
4516
4544
|
this.session.updateToken('');
|
|
4517
4545
|
this.session.reset();
|
|
4518
4546
|
}
|
|
@@ -4558,7 +4586,9 @@ class EsolveAuthService {
|
|
|
4558
4586
|
token = result.key;
|
|
4559
4587
|
}
|
|
4560
4588
|
catch (error) {
|
|
4561
|
-
|
|
4589
|
+
if (isDevMode()) {
|
|
4590
|
+
console.error(error);
|
|
4591
|
+
}
|
|
4562
4592
|
this.session.updateToken('');
|
|
4563
4593
|
if (this.is_browser && this.#validating_session_retries() > 1) {
|
|
4564
4594
|
// Wait before attempting to refresh if already tried and failed
|
|
@@ -4626,7 +4656,9 @@ class EsolveAuthService {
|
|
|
4626
4656
|
return result;
|
|
4627
4657
|
}
|
|
4628
4658
|
catch (error) {
|
|
4629
|
-
|
|
4659
|
+
if (isDevMode()) {
|
|
4660
|
+
console.error(error);
|
|
4661
|
+
}
|
|
4630
4662
|
this.session.updateToken('');
|
|
4631
4663
|
this.session.reset();
|
|
4632
4664
|
}
|