@lluc_llull/ui-lib 0.15.1 → 0.16.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/{lib/components/core/content → content}/hero-section/hero-section.component.d.ts +1 -1
- package/{lib/components/core/content → content}/hero-section/hero-section.interface.d.ts +1 -1
- package/{lib/components/core/content → content}/section-intro/section-intro.component.d.ts +1 -1
- package/{lib/directives → directives}/link-type.directive.d.ts +1 -1
- package/{lib/components/core/feedback → feedback}/404/404.component.d.ts +1 -1
- package/{lib/components/core/feedback → feedback}/404/404.inteface.d.ts +1 -1
- package/fesm2022/lluc_llull-ui-lib-content.mjs +104 -0
- package/fesm2022/lluc_llull-ui-lib-content.mjs.map +1 -0
- package/fesm2022/lluc_llull-ui-lib-directives.mjs +121 -0
- package/fesm2022/lluc_llull-ui-lib-directives.mjs.map +1 -0
- package/fesm2022/{lluc_llull-ui-lib-src-lib-effects.mjs → lluc_llull-ui-lib-effects.mjs} +1 -1
- package/fesm2022/lluc_llull-ui-lib-effects.mjs.map +1 -0
- package/fesm2022/lluc_llull-ui-lib-enums.mjs +15 -0
- package/fesm2022/lluc_llull-ui-lib-enums.mjs.map +1 -0
- package/fesm2022/lluc_llull-ui-lib-feedback.mjs +32 -0
- package/fesm2022/lluc_llull-ui-lib-feedback.mjs.map +1 -0
- package/fesm2022/lluc_llull-ui-lib-footers.mjs +101 -0
- package/fesm2022/lluc_llull-ui-lib-footers.mjs.map +1 -0
- package/fesm2022/lluc_llull-ui-lib-headers.mjs +148 -0
- package/fesm2022/lluc_llull-ui-lib-headers.mjs.map +1 -0
- package/fesm2022/lluc_llull-ui-lib-interfaces.mjs +4 -0
- package/fesm2022/lluc_llull-ui-lib-interfaces.mjs.map +1 -0
- package/fesm2022/lluc_llull-ui-lib-mapper.mjs +188 -0
- package/fesm2022/lluc_llull-ui-lib-mapper.mjs.map +1 -0
- package/fesm2022/lluc_llull-ui-lib-modals.mjs +65 -0
- package/fesm2022/lluc_llull-ui-lib-modals.mjs.map +1 -0
- package/fesm2022/lluc_llull-ui-lib-screen-sizer.mjs +91 -0
- package/fesm2022/lluc_llull-ui-lib-screen-sizer.mjs.map +1 -0
- package/fesm2022/lluc_llull-ui-lib-shared.mjs +70 -0
- package/fesm2022/lluc_llull-ui-lib-shared.mjs.map +1 -0
- package/fesm2022/{lluc_llull-ui-lib-src-lib-sliders.mjs → lluc_llull-ui-lib-sliders.mjs} +1 -1
- package/fesm2022/lluc_llull-ui-lib-sliders.mjs.map +1 -0
- package/fesm2022/lluc_llull-ui-lib-theme.mjs +81 -0
- package/fesm2022/lluc_llull-ui-lib-theme.mjs.map +1 -0
- package/fesm2022/lluc_llull-ui-lib-utils.mjs +43 -0
- package/fesm2022/lluc_llull-ui-lib-utils.mjs.map +1 -0
- package/fesm2022/lluc_llull-ui-lib.mjs +14 -1110
- package/fesm2022/lluc_llull-ui-lib.mjs.map +1 -1
- package/{lib/components/core/footers → footers}/legal-footer/legal-footer.component.d.ts +1 -1
- package/{lib/components/core/footers → footers}/legal-footer/legal-footer.interface.d.ts +1 -1
- package/{lib/components/core/footers → footers}/links-footer/links-footer.component.d.ts +1 -1
- package/footers/links-footer/links-footer.interface.d.ts +4 -0
- package/{lib/components/core/footers → footers}/social-footer/social-footer.component.d.ts +1 -1
- package/{lib/components/core/footers → footers}/social-footer/social-footer.interface.d.ts +1 -1
- package/{lib/components/core/footers → footers}/visual-footer/visual-footer.component.d.ts +1 -1
- package/{lib/components/core/footers → footers}/visual-footer/visual-footer.interface.d.ts +1 -1
- package/{lib/components/core/headers → headers}/header-clear/header-clear.component.d.ts +2 -2
- package/{lib/components/core/headers → headers}/header-clear/header-clear.interface.d.ts +1 -1
- package/{lib/components/core/headers → headers}/header-mobile/header-mobile.component.d.ts +2 -4
- package/{lib/components/core/headers → headers}/header-mobile/header-mobile.interface.d.ts +1 -1
- package/{lib/interfaces → interfaces}/ui-lib-button.interface.d.ts +1 -1
- package/{lib/interfaces → interfaces}/ui-lib-nav-items.interface.d.ts +1 -1
- package/lib/ui-lib.component.d.ts +5 -0
- package/mapper/component-mappers/index.d.ts +12 -0
- package/{lib/services/mapper → mapper}/component-mappers/lang-modal.mapper.d.ts +1 -1
- package/{lib/services/mapper → mapper}/component-mappers/nav-modal.mapper.d.ts +1 -1
- package/{lib/services/mapper → mapper}/mapper.service.d.ts +1 -1
- package/{lib/components/core/modals → modals}/lang-modal/lang-modal.component.d.ts +1 -1
- package/{lib/components/core/modals → modals}/nav-modal/nav-modal.component.d.ts +1 -1
- package/{lib/components/core/modals → modals}/nav-modal/nav-modal.interface.d.ts +1 -1
- package/package.json +59 -7
- package/public-api.d.ts +1 -8
- package/{lib/utils → utils}/utils.d.ts +1 -2
- package/fesm2022/lluc_llull-ui-lib-src-lib-effects.mjs.map +0 -1
- package/fesm2022/lluc_llull-ui-lib-src-lib-sliders.mjs.map +0 -1
- package/lib/components/core/footers/links-footer/links-footer.interface.d.ts +0 -4
- package/lib/components/core/index.d.ts +0 -5
- package/lib/services/index.d.ts +0 -3
- package/lib/services/mapper/component-mappers/index.d.ts +0 -1
- package/src/lib/effects/dynamic-background/dynamic-background.component.d.ts +0 -26
- package/src/lib/effects/dynamic-background/effects/dynamic-effect.interface.d.ts +0 -6
- package/src/lib/effects/dynamic-background/effects/effect-registry.d.ts +0 -3
- package/src/lib/effects/dynamic-background/effects/sphere-deform/sphere-deform.effect.d.ts +0 -13
- package/src/lib/effects/dynamic-background/index.d.ts +0 -1
- package/src/lib/effects/index.d.ts +0 -1
- package/src/lib/sliders/swiper.directive.d.ts +0 -12
- /package/{lib/components/core/content → content}/category-progress/category-progress.component.d.ts +0 -0
- /package/{lib/components/core/content → content}/category-progress/category-progress.interface.d.ts +0 -0
- /package/{lib/components/core/content → content}/category-progress/index.d.ts +0 -0
- /package/{lib/components/core/content → content}/hero-section/hero-section.stories.d.ts +0 -0
- /package/{lib/components/core/content → content}/hero-section/index.d.ts +0 -0
- /package/{lib/components/core/content → content}/index.d.ts +0 -0
- /package/{lib/components/core/content → content}/section-intro/index.d.ts +0 -0
- /package/{lib/components/core/content → content}/section-intro/section-intro.interface.d.ts +0 -0
- /package/{lib/directives → directives}/index.d.ts +0 -0
- /package/{lib/effects → effects}/dynamic-background/dynamic-background.component.d.ts +0 -0
- /package/{lib/effects → effects}/dynamic-background/effects/dynamic-effect.interface.d.ts +0 -0
- /package/{lib/effects → effects}/dynamic-background/effects/effect-registry.d.ts +0 -0
- /package/{lib/effects → effects}/dynamic-background/effects/sphere-deform/sphere-deform.effect.d.ts +0 -0
- /package/{lib/effects → effects}/dynamic-background/index.d.ts +0 -0
- /package/{lib/effects → effects}/index.d.ts +0 -0
- /package/{lib/Enum → enums}/index.d.ts +0 -0
- /package/{lib/Enum → enums}/link-type.enum.d.ts +0 -0
- /package/{lib/components/core/feedback → feedback}/404/index.d.ts +0 -0
- /package/{lib/components/core/feedback → feedback}/index.d.ts +0 -0
- /package/{lib/components/core/footers → footers}/index.d.ts +0 -0
- /package/{lib/components/core/footers → footers}/legal-footer/index.d.ts +0 -0
- /package/{lib/components/core/footers → footers}/links-footer/index.d.ts +0 -0
- /package/{lib/components/core/footers → footers}/social-footer/index.d.ts +0 -0
- /package/{lib/components/core/footers → footers}/visual-footer/index.d.ts +0 -0
- /package/{lib/components/core/headers → headers}/header-clear/index.d.ts +0 -0
- /package/{lib/components/core/headers → headers}/header-mobile/index.d.ts +0 -0
- /package/{lib/components/core/headers → headers}/index.d.ts +0 -0
- /package/{lib/interfaces → interfaces}/index.d.ts +0 -0
- /package/{lib/interfaces → interfaces}/page-config.interface.d.ts +0 -0
- /package/{lib/interfaces → interfaces}/site-config.interface.d.ts +0 -0
- /package/{lib/interfaces → interfaces}/ui-lib-address.interface.d.ts +0 -0
- /package/{lib/interfaces → interfaces}/ui-lib-image.interface.d.ts +0 -0
- /package/{lib/interfaces → interfaces}/ui-lib-lang-item.interface.d.ts +0 -0
- /package/{lib/services/mapper → mapper}/cdn.token.d.ts +0 -0
- /package/{lib/services/mapper → mapper}/component-mappers/404.mapper.d.ts +0 -0
- /package/{lib/services/mapper → mapper}/component-mappers/category-progress.mapper.d.ts +0 -0
- /package/{lib/services/mapper → mapper}/component-mappers/header-clear.mapper.d.ts +0 -0
- /package/{lib/services/mapper → mapper}/component-mappers/hero-section.mapper.d.ts +0 -0
- /package/{lib/services/mapper → mapper}/component-mappers/legal-footer.mapper.d.ts +0 -0
- /package/{lib/services/mapper → mapper}/component-mappers/links-footer.mapper.d.ts +0 -0
- /package/{lib/services/mapper → mapper}/component-mappers/section-intro.mapper.d.ts +0 -0
- /package/{lib/services/mapper → mapper}/component-mappers/social-footer.mapper.d.ts +0 -0
- /package/{lib/services/mapper → mapper}/component-mappers/types.d.ts +0 -0
- /package/{lib/services/mapper → mapper}/component-mappers/visual-footer.mapper.d.ts +0 -0
- /package/{lib/services/mapper → mapper}/index.d.ts +0 -0
- /package/{lib/components/core/modals → modals}/index.d.ts +0 -0
- /package/{lib/components/core/modals → modals}/lang-modal/index.d.ts +0 -0
- /package/{lib/components/core/modals → modals}/lang-modal/lang-modal.interface.d.ts +0 -0
- /package/{lib/components/core/modals → modals}/nav-modal/index.d.ts +0 -0
- /package/{lib/services/screen-sizer → screen-sizer}/index.d.ts +0 -0
- /package/{lib/services/screen-sizer → screen-sizer}/screen-sizer.service.d.ts +0 -0
- /package/{lib/components/shared → shared}/index.d.ts +0 -0
- /package/{lib/components/shared → shared}/ui-icon/index.d.ts +0 -0
- /package/{lib/components/shared → shared}/ui-icon/ui-icon.component.d.ts +0 -0
- /package/{lib/components/shared → shared}/ui-icon/ui-icon.interface.d.ts +0 -0
- /package/{lib/components/shared → shared}/ui-icon/ui-icon.mock.d.ts +0 -0
- /package/{src/lib/sliders → sliders}/index.d.ts +0 -0
- /package/{lib/sliders → sliders}/swiper.directive.d.ts +0 -0
- /package/{lib/services/theme → theme}/index.d.ts +0 -0
- /package/{lib/services/theme → theme}/theme.service.d.ts +0 -0
- /package/{lib/utils → utils}/index.d.ts +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lluc_llull-ui-lib-mapper.mjs","sources":["../../../projects/ui-lib/mapper/component-mappers/category-progress.mapper.ts","../../../projects/ui-lib/mapper/component-mappers/nav-modal.mapper.ts","../../../projects/ui-lib/mapper/component-mappers/header-clear.mapper.ts","../../../projects/ui-lib/mapper/component-mappers/hero-section.mapper.ts","../../../projects/ui-lib/mapper/component-mappers/lang-modal.mapper.ts","../../../projects/ui-lib/mapper/component-mappers/legal-footer.mapper.ts","../../../projects/ui-lib/mapper/component-mappers/links-footer.mapper.ts","../../../projects/ui-lib/mapper/component-mappers/404.mapper.ts","../../../projects/ui-lib/mapper/component-mappers/section-intro.mapper.ts","../../../projects/ui-lib/mapper/component-mappers/social-footer.mapper.ts","../../../projects/ui-lib/mapper/component-mappers/visual-footer.mapper.ts","../../../projects/ui-lib/mapper/component-mappers/index.ts","../../../projects/ui-lib/mapper/cdn.token.ts","../../../projects/ui-lib/mapper/mapper.service.ts","../../../projects/ui-lib/mapper/lluc_llull-ui-lib-mapper.ts"],"sourcesContent":["import { ComponentMapperFn } from './types';\n\nexport const mapCategoryProgress: ComponentMapperFn = (props) => ({\n pretitle: props?.texts?.pretitle,\n title: props?.texts?.title,\n categories: props?.items?.map((item: any) => ({\n title: item.title,\n items: item.items?.map((subItem: any) => ({\n label: subItem.name,\n value: subItem.progress,\n })),\n })),\n});\n","import { UiLibNavItemsI, UiLibSocialItemsI } from '@lluc_llull/ui-lib/interfaces';\n\nexport const mapNavModal = (navigation: any, lang: string): UiLibNavItemsI[] => {\n if (!navigation?.items || !Array.isArray(navigation.items)) return [];\n\n return navigation.items.map((item: any) => {\n const slug = item.slug;\n\n const url = slug === 'home' || slug === '' ? `/${lang}` : `/${lang}/${slug}`;\n\n return {\n label: item.label?.[lang] ?? item.label?.['es'] ?? slug,\n url,\n linkType: 'internal',\n name: slug,\n active: true,\n children: [],\n };\n });\n};\n\nexport const mapSocialLinks = (navigation: any): UiLibSocialItemsI[] => {\n if (!navigation?.social || !Array.isArray(navigation.social)) return [];\n\n return navigation.social.map((item: any, index: number) => ({\n label: item.label ?? '',\n url: item.url ?? '',\n linkType: item.linkType ?? 'external',\n icon: item.icon ?? '',\n order: item.order ?? index,\n }));\n};\n","import { mapImage } from '@lluc_llull/ui-lib/utils';\nimport { mapSocialLinks } from './nav-modal.mapper';\nimport { ComponentMapperFn } from './types';\n\nexport const mapHeaderClear: ComponentMapperFn = (props, cdn) => {\n return {\n logo: mapImage(props?.logo, cdn),\n logoDark: mapImage(props?.logoDark, cdn),\n lang: props?.lang || 'es',\n navigation: props?.navigation,\n socialItems: mapSocialLinks(props?.navigation),\n };\n};\n","import { mapButtons } from '@lluc_llull/ui-lib/utils';\nimport { ComponentMapperFn } from './types';\n\nexport const mapHeroSection: ComponentMapperFn = (props) => ({\n pretitle: props?.texts?.pretitle,\n title: props?.texts?.title,\n subtitle: props?.texts?.subtitle,\n text: props?.texts?.text,\n buttons: mapButtons(props?.buttons),\n highlight: props?.texts?.highlight,\n});\n","import { UiLibLangItemI } from '@lluc_llull/ui-lib/interfaces';\n\nexport const mapLangModal = (langs: any[], currentLang: string = 'es'): UiLibLangItemI[] => {\n if (!Array.isArray(langs)) return [];\n\n return langs.map((lang, index) => {\n const label = lang.labels?.[currentLang] || lang.labels?.[lang.code] || lang.code;\n\n return {\n id: lang.id ?? index,\n code: lang.code,\n label,\n };\n });\n};\n","import { mapButtons } from '@lluc_llull/ui-lib/utils';\nimport { ComponentMapperFn } from './types';\n\nexport const mapLegalFooter: ComponentMapperFn = (props) => ({\n year: props?.texts?.year,\n brand: props?.texts?.brand,\n credits: props?.texts?.credits,\n links: mapButtons(props?.footer_links),\n //variant\n});\n","import { mapButtons } from '@lluc_llull/ui-lib/utils';\nimport { ComponentMapperFn } from './types';\n\nexport const mapLinksFooter: ComponentMapperFn = (props) => ({\n links: mapButtons(props?.footer_links),\n});\n","import { mapButtons } from '@lluc_llull/ui-lib/utils';\nimport { ComponentMapperFn } from './types';\n\nexport const map404: ComponentMapperFn = (props) => ({\n title: props?.texts?.title,\n subtitle: props?.texts?.subtitle,\n highlight: props?.texts?.highlight,\n button: mapButtons(props?.buttons)[0],\n});\n","import { mapButtons } from '@lluc_llull/ui-lib/utils';\nimport { ComponentMapperFn } from './types';\n\nexport const mapSectionIntro: ComponentMapperFn = (props) => ({\n pretitle: props?.texts?.pretitle,\n title: props?.texts?.title,\n subtitle: props?.texts?.subtitle,\n text: props?.texts?.text,\n button: mapButtons(props?.button)[0],\n});\n","import { mapButtons, mapImage } from '@lluc_llull/ui-lib/utils';\nimport { ComponentMapperFn } from './types';\n\nexport const mapSocialFooter: ComponentMapperFn = (props) => ({\n images: mapImage(props?.multimedia),\n socials: mapButtons(props?.social_links),\n hashtag: props?.texts?.hashtag,\n});\n","import { UiLibAddressI } from '@lluc_llull/ui-lib/interfaces';\nimport { mapButtons, mapImage } from '@lluc_llull/ui-lib/utils';\nimport { ComponentMapperFn } from './types';\n\nexport const mapVisualFooter: ComponentMapperFn = (props) => ({\n contactTitle: props?.texts?.contactTitle,\n contactPhone: mapButtons(props?.contactPhone),\n contactEmail: mapButtons(props?.contactEmail),\n addressTitle: props?.texts?.addressTitle,\n address: {\n address: props?.address?.address,\n city: props?.address?.city,\n country: props?.address?.country,\n cp: props?.address?.cp,\n province: props?.address?.province,\n } as UiLibAddressI,\n socialsTitle: props?.texts?.socialsTitle,\n socials: mapButtons(props?.social_links),\n image: mapImage(props?.multimedia),\n});\n","\nexport * from './category-progress.mapper';\nexport * from './header-clear.mapper';\nexport * from './hero-section.mapper';\nexport * from './lang-modal.mapper';\nexport * from './legal-footer.mapper';\nexport * from './links-footer.mapper';\nexport * from './404.mapper';\nexport * from './section-intro.mapper';\nexport * from './social-footer.mapper';\nexport * from './visual-footer.mapper';\nexport * from './nav-modal.mapper';\n\nimport { mapCategoryProgress } from './category-progress.mapper';\nimport { mapHeaderClear } from './header-clear.mapper';\nimport { mapHeroSection } from './hero-section.mapper';\nimport { mapLangModal } from './lang-modal.mapper';\nimport { mapLegalFooter } from './legal-footer.mapper';\nimport { mapLinksFooter } from './links-footer.mapper';\nimport { map404 } from './404.mapper';\nimport { mapSectionIntro } from './section-intro.mapper';\nimport { mapSocialFooter } from './social-footer.mapper';\nimport { mapVisualFooter } from './visual-footer.mapper';\n\nexport const componentMappers: Record<string, (props: any, cdn?: string) => any> = {\n 'hero-section': mapHeroSection,\n 'header-clear': mapHeaderClear,\n 'lang-modal': mapLangModal,\n 'section-intro': mapSectionIntro,\n 'category-progress': mapCategoryProgress,\n 'links-footer': mapLinksFooter,\n 'legal-footer': mapLegalFooter,\n 'social-footer': mapSocialFooter,\n 'visual-footer': mapVisualFooter,\n 'not-found': map404,\n};\n","import { InjectionToken } from '@angular/core';\n\nexport const CDN_BASE_URL = new InjectionToken<string>('CDN_BASE_URL');","import { inject, Injectable, PLATFORM_ID } from '@angular/core';\nimport { BodyComponent } from '@lluc_llull/ui-lib/interfaces';\nimport { CDN_BASE_URL } from './cdn.token';\nimport { componentMappers } from './component-mappers';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class MapperService {\n private platformId = inject(PLATFORM_ID);\n private cdn = inject(CDN_BASE_URL);\n\n mapComponents<T>(body: any[]): BodyComponent<T>[] {\n if (!body || body.length === 0) {\n return [];\n }\n\n return body\n .filter((component) => component && component.name && component.props)\n .map((component) => {\n const name = component.name.toLowerCase();\n const mapper = componentMappers[name];\n\n const mapped: BodyComponent<T> = {\n name,\n order: component.order,\n props: {} as T,\n };\n\n if (mapper) {\n try {\n mapped.props = mapper(component.props, this.cdn) as T;\n } catch (e) {\n console.error(`Error mapping props for component \"${name}\"`, e);\n }\n } else {\n console.warn(`No mapper found for component \"${name}\"`);\n }\n\n return mapped;\n });\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;MAEa,mBAAmB,GAAsB,CAAC,KAAK,MAAM;AAC9D,IAAA,QAAQ,EAAE,K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zD;gBAAE,OAAO,CAAC,EAAE;oBACR,OAAO,CAAC,KAAK,CAAC,CAAA,mCAAA,EAAsC,IAAI,CAAA,CAAA,CAAG,EAAE,CAAC,CAAC;gBACnE;YACJ;iBAAO;AACH,gBAAA,OAAO,CAAC,IAAI,CAAC,kCAAkC,IAAI,CAAA,CAAA,CAAG,CAAC;YAC3D;AAEA,YAAA,OAAO,MAAM;AACjB,QAAA,CAAC,CAAC;IACV;wGAjCS,aAAa,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA;AAAb,IAAA,OAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,aAAa,cAFV,MAAM,EAAA,CAAA;;4FAET,aAAa,EAAA,UAAA,EAAA,CAAA;kBAHzB,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,UAAU,EAAE,MAAM;AACrB,iBAAA;;;ACPD;;AAEG;;;;"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { CommonModule } from '@angular/common';
|
|
2
|
+
import * as i0 from '@angular/core';
|
|
3
|
+
import { Optional, Inject, ChangeDetectionStrategy, Component, EventEmitter, Output, Input } from '@angular/core';
|
|
4
|
+
import * as i1 from '@angular/material/dialog';
|
|
5
|
+
import { MAT_DIALOG_DATA } from '@angular/material/dialog';
|
|
6
|
+
import { mapLangModal } from '@lluc_llull/ui-lib/mapper';
|
|
7
|
+
import { LinkTypeDirective } from '@lluc_llull/ui-lib/directives';
|
|
8
|
+
|
|
9
|
+
class LangModalComponent {
|
|
10
|
+
data;
|
|
11
|
+
dialogRef;
|
|
12
|
+
langs;
|
|
13
|
+
constructor(data, dialogRef) {
|
|
14
|
+
this.data = data;
|
|
15
|
+
this.dialogRef = dialogRef;
|
|
16
|
+
this.langs = mapLangModal(data.langs, data.currentLang);
|
|
17
|
+
}
|
|
18
|
+
selectLang(lang) {
|
|
19
|
+
this.dialogRef?.close(lang);
|
|
20
|
+
}
|
|
21
|
+
closeModal() {
|
|
22
|
+
this.dialogRef?.close();
|
|
23
|
+
}
|
|
24
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.19", ngImport: i0, type: LangModalComponent, deps: [{ token: MAT_DIALOG_DATA, optional: true }, { token: i1.MatDialogRef, optional: true }], target: i0.ɵɵFactoryTarget.Component });
|
|
25
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.19", type: LangModalComponent, isStandalone: true, selector: "lib-lang-modal", ngImport: i0, template: "<div class=\"modal-content\">\n <button (click)=\"closeModal()\" class=\"close-btn\">\u2715</button>\n @if (langs && langs.length > 0) {\n <ol>\n @for (lang of langs; track lang.id) {\n <li (click)=\"selectLang(lang)\">\n <span class=\"modal-item\">{{ lang.label }}</span>\n </li>\n }\n </ol>\n }\n</div>\n", styles: [":root{--font-titles: \"Bebas Neue\", system-ui, sans-serif;--font-base: \"Inter\", system-ui, sans-serif;--font-size-base: 16px;--spacing-xs: .25rem;--spacing-sm: .5rem;--spacing-md: 1rem;--spacing-lg: 2rem;--border-radius: 8px}:host{position:fixed;inset:0;width:100vw;height:100vh;background:var(--modal-bg);z-index:1000;display:flex;align-items:center;justify-content:center}.close-btn{position:absolute;top:1rem;right:2rem;background:none;border:none;color:var(--close-btn);font-size:1.5rem;font-weight:700;cursor:pointer;z-index:1001}ol{padding:0;margin:0;text-align:center;width:100%;max-width:400px;list-style:none;counter-reset:item}li{cursor:pointer;text-align:start;text-transform:uppercase;counter-increment:item}li:before{content:counter(item,decimal-leading-zero) \". \"}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
26
|
+
}
|
|
27
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.19", ngImport: i0, type: LangModalComponent, decorators: [{
|
|
28
|
+
type: Component,
|
|
29
|
+
args: [{ selector: 'lib-lang-modal', standalone: true, imports: [CommonModule], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"modal-content\">\n <button (click)=\"closeModal()\" class=\"close-btn\">\u2715</button>\n @if (langs && langs.length > 0) {\n <ol>\n @for (lang of langs; track lang.id) {\n <li (click)=\"selectLang(lang)\">\n <span class=\"modal-item\">{{ lang.label }}</span>\n </li>\n }\n </ol>\n }\n</div>\n", styles: [":root{--font-titles: \"Bebas Neue\", system-ui, sans-serif;--font-base: \"Inter\", system-ui, sans-serif;--font-size-base: 16px;--spacing-xs: .25rem;--spacing-sm: .5rem;--spacing-md: 1rem;--spacing-lg: 2rem;--border-radius: 8px}:host{position:fixed;inset:0;width:100vw;height:100vh;background:var(--modal-bg);z-index:1000;display:flex;align-items:center;justify-content:center}.close-btn{position:absolute;top:1rem;right:2rem;background:none;border:none;color:var(--close-btn);font-size:1.5rem;font-weight:700;cursor:pointer;z-index:1001}ol{padding:0;margin:0;text-align:center;width:100%;max-width:400px;list-style:none;counter-reset:item}li{cursor:pointer;text-align:start;text-transform:uppercase;counter-increment:item}li:before{content:counter(item,decimal-leading-zero) \". \"}\n"] }]
|
|
30
|
+
}], ctorParameters: () => [{ type: undefined, decorators: [{
|
|
31
|
+
type: Optional
|
|
32
|
+
}, {
|
|
33
|
+
type: Inject,
|
|
34
|
+
args: [MAT_DIALOG_DATA]
|
|
35
|
+
}] }, { type: i1.MatDialogRef, decorators: [{
|
|
36
|
+
type: Optional
|
|
37
|
+
}] }] });
|
|
38
|
+
|
|
39
|
+
class NavModalComponent {
|
|
40
|
+
navItems;
|
|
41
|
+
socialItems;
|
|
42
|
+
close = new EventEmitter();
|
|
43
|
+
closeModal() {
|
|
44
|
+
this.close.emit();
|
|
45
|
+
}
|
|
46
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.19", ngImport: i0, type: NavModalComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
47
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.19", type: NavModalComponent, isStandalone: true, selector: "lib-nav-modal", inputs: { navItems: "navItems", socialItems: "socialItems" }, outputs: { close: "close" }, ngImport: i0, template: "<div class=\"modal-content\">\n <button (click)=\"closeModal()\" class=\"close-btn\">\u2715</button>\n\n @if (navItems?.length) {\n <ol>\n @for (item of navItems; track item.name) {\n <a [href]=\"item.url\" [linkType]=\"item.linkType\" (click)=\"closeModal()\">\n <li>\n <span class=\"modal-item\">{{ item.label }}</span>\n </li>\n </a>\n }\n </ol>\n }\n\n @if (socialItems?.length) {\n <div class=\"buttons\">\n @for (social of socialItems; track social.label) {\n <a class=\"btn btn-link\" [href]=\"social.url\" [linkType]=\"social.linkType\">\n <span>{{ social.icon }}</span>\n {{ social.label }}\n </a>\n }\n </div>\n }\n</div>\n", styles: [":root{--font-titles: \"Bebas Neue\", system-ui, sans-serif;--font-base: \"Inter\", system-ui, sans-serif;--font-size-base: 16px;--spacing-xs: .25rem;--spacing-sm: .5rem;--spacing-md: 1rem;--spacing-lg: 2rem;--border-radius: 8px}:host{position:fixed;inset:0;width:100vw;height:100vh;background:var(--modal-bg);z-index:1000;display:flex;align-items:center;justify-content:center}.close-btn{position:absolute;top:1rem;right:2rem;background:none;border:none;color:var(--close-btn);font-size:1.5rem;font-weight:700;cursor:pointer;z-index:1001}ol{padding:0;margin:0;text-align:center;width:100%;max-width:400px;list-style:none;counter-reset:item}li{cursor:pointer;text-align:start;counter-increment:item}a{text-decoration:none;text-transform:uppercase;color:var(--item-color)}li:before{content:counter(item,decimal-leading-zero) \". \"}.buttons{display:flex;flex-wrap:wrap;justify-content:center}.buttons a{text-transform:lowercase}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: LinkTypeDirective, selector: "[linkType]", inputs: ["linkType", "href"], outputs: ["anchorClicked"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
48
|
+
}
|
|
49
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.19", ngImport: i0, type: NavModalComponent, decorators: [{
|
|
50
|
+
type: Component,
|
|
51
|
+
args: [{ selector: 'lib-nav-modal', standalone: true, imports: [CommonModule, LinkTypeDirective], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"modal-content\">\n <button (click)=\"closeModal()\" class=\"close-btn\">\u2715</button>\n\n @if (navItems?.length) {\n <ol>\n @for (item of navItems; track item.name) {\n <a [href]=\"item.url\" [linkType]=\"item.linkType\" (click)=\"closeModal()\">\n <li>\n <span class=\"modal-item\">{{ item.label }}</span>\n </li>\n </a>\n }\n </ol>\n }\n\n @if (socialItems?.length) {\n <div class=\"buttons\">\n @for (social of socialItems; track social.label) {\n <a class=\"btn btn-link\" [href]=\"social.url\" [linkType]=\"social.linkType\">\n <span>{{ social.icon }}</span>\n {{ social.label }}\n </a>\n }\n </div>\n }\n</div>\n", styles: [":root{--font-titles: \"Bebas Neue\", system-ui, sans-serif;--font-base: \"Inter\", system-ui, sans-serif;--font-size-base: 16px;--spacing-xs: .25rem;--spacing-sm: .5rem;--spacing-md: 1rem;--spacing-lg: 2rem;--border-radius: 8px}:host{position:fixed;inset:0;width:100vw;height:100vh;background:var(--modal-bg);z-index:1000;display:flex;align-items:center;justify-content:center}.close-btn{position:absolute;top:1rem;right:2rem;background:none;border:none;color:var(--close-btn);font-size:1.5rem;font-weight:700;cursor:pointer;z-index:1001}ol{padding:0;margin:0;text-align:center;width:100%;max-width:400px;list-style:none;counter-reset:item}li{cursor:pointer;text-align:start;counter-increment:item}a{text-decoration:none;text-transform:uppercase;color:var(--item-color)}li:before{content:counter(item,decimal-leading-zero) \". \"}.buttons{display:flex;flex-wrap:wrap;justify-content:center}.buttons a{text-transform:lowercase}\n"] }]
|
|
52
|
+
}], propDecorators: { navItems: [{
|
|
53
|
+
type: Input
|
|
54
|
+
}], socialItems: [{
|
|
55
|
+
type: Input
|
|
56
|
+
}], close: [{
|
|
57
|
+
type: Output
|
|
58
|
+
}] } });
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Generated bundle index. Do not edit.
|
|
62
|
+
*/
|
|
63
|
+
|
|
64
|
+
export { LangModalComponent, NavModalComponent };
|
|
65
|
+
//# sourceMappingURL=lluc_llull-ui-lib-modals.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lluc_llull-ui-lib-modals.mjs","sources":["../../../projects/ui-lib/modals/lang-modal/lang-modal.component.ts","../../../projects/ui-lib/modals/lang-modal/lang-modal.component.html","../../../projects/ui-lib/modals/nav-modal/nav-modal.component.ts","../../../projects/ui-lib/modals/nav-modal/nav-modal.component.html","../../../projects/ui-lib/modals/lluc_llull-ui-lib-modals.ts"],"sourcesContent":["import { CommonModule } from '@angular/common';\nimport { ChangeDetectionStrategy, Component, Inject, Optional } from '@angular/core';\nimport { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';\nimport { UiLibLangItemI } from '@lluc_llull/ui-lib/interfaces';\nimport { mapLangModal } from '@lluc_llull/ui-lib/mapper';\n\ninterface LangModalData {\n langs: any[];\n currentLang: string;\n}\n\n@Component({\n selector: 'lib-lang-modal',\n standalone: true,\n imports: [CommonModule],\n templateUrl: './lang-modal.component.html',\n styleUrl: './lang-modal.component.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class LangModalComponent {\n langs!: UiLibLangItemI[];\n\n constructor(\n @Optional() @Inject(MAT_DIALOG_DATA) public data: LangModalData,\n @Optional() public dialogRef?: MatDialogRef<LangModalComponent>,\n ) {\n this.langs = mapLangModal(data.langs, data.currentLang);\n }\n\n selectLang(lang: UiLibLangItemI) {\n this.dialogRef?.close(lang);\n }\n\n closeModal() {\n this.dialogRef?.close();\n }\n}\n","<div class=\"modal-content\">\n <button (click)=\"closeModal()\" class=\"close-btn\">✕</button>\n @if (langs && langs.length > 0) {\n <ol>\n @for (lang of langs; track lang.id) {\n <li (click)=\"selectLang(lang)\">\n <span class=\"modal-item\">{{ lang.label }}</span>\n </li>\n }\n </ol>\n }\n</div>\n","import { CommonModule } from '@angular/common';\nimport { ChangeDetectionStrategy, Component, EventEmitter, Input, Output } from '@angular/core';\nimport { LinkTypeDirective } from '@lluc_llull/ui-lib/directives';\nimport { UiLibNavItemsI, UiLibSocialItemsI } from '@lluc_llull/ui-lib/interfaces';\n\n@Component({\n selector: 'lib-nav-modal',\n standalone: true,\n imports: [CommonModule, LinkTypeDirective],\n templateUrl: './nav-modal.component.html',\n styleUrl: './nav-modal.component.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class NavModalComponent {\n @Input() navItems?: UiLibNavItemsI[];\n @Input() socialItems?: UiLibSocialItemsI[];\n\n @Output() close = new EventEmitter<void>();\n\n closeModal() {\n this.close.emit();\n }\n}\n","<div class=\"modal-content\">\n <button (click)=\"closeModal()\" class=\"close-btn\">✕</button>\n\n @if (navItems?.length) {\n <ol>\n @for (item of navItems; track item.name) {\n <a [href]=\"item.url\" [linkType]=\"item.linkType\" (click)=\"closeModal()\">\n <li>\n <span class=\"modal-item\">{{ item.label }}</span>\n </li>\n </a>\n }\n </ol>\n }\n\n @if (socialItems?.length) {\n <div class=\"buttons\">\n @for (social of socialItems; track social.label) {\n <a class=\"btn btn-link\" [href]=\"social.url\" [linkType]=\"social.linkType\">\n <span>{{ social.icon }}</span>\n {{ social.label }}\n </a>\n }\n </div>\n }\n</div>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;MAmBa,kBAAkB,CAAA;AAIqB,IAAA,IAAA;AACzB,IAAA,SAAA;AAJvB,IAAA,KAAK;IAEL,WAAA,CACgD,IAAmB,EAC5C,SAA4C,EAAA;QADnB,IAAA,CAAA,IAAI,GAAJ,IAAI;QAC7B,IAAA,CAAA,SAAS,GAAT,SAAS;AAE5B,QAAA,IA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AAA;sBAAd;;;AEjBL;;AAEG;;;;"}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { isPlatformBrowser } from '@angular/common';
|
|
2
|
+
import * as i0 from '@angular/core';
|
|
3
|
+
import { signal, inject, PLATFORM_ID, Injectable } from '@angular/core';
|
|
4
|
+
import { fromEvent } from 'rxjs';
|
|
5
|
+
import { debounceTime, map, distinctUntilChanged, startWith } from 'rxjs/operators';
|
|
6
|
+
|
|
7
|
+
class ScreenSizerService {
|
|
8
|
+
breakpoints = {
|
|
9
|
+
xs: 480,
|
|
10
|
+
sm: 768,
|
|
11
|
+
md: 1024,
|
|
12
|
+
lg: 1280,
|
|
13
|
+
xl: 1536,
|
|
14
|
+
};
|
|
15
|
+
isXs = signal(false);
|
|
16
|
+
isSm = signal(false);
|
|
17
|
+
isMd = signal(false);
|
|
18
|
+
isLg = signal(false);
|
|
19
|
+
isXl = signal(false);
|
|
20
|
+
minSm = signal(false);
|
|
21
|
+
minMd = signal(false);
|
|
22
|
+
minLg = signal(false);
|
|
23
|
+
minXl = signal(false);
|
|
24
|
+
platformId = inject(PLATFORM_ID);
|
|
25
|
+
get width() {
|
|
26
|
+
if (isPlatformBrowser(this.platformId)) {
|
|
27
|
+
return Math.min(window.innerWidth, window.outerWidth);
|
|
28
|
+
}
|
|
29
|
+
return 0;
|
|
30
|
+
}
|
|
31
|
+
constructor() {
|
|
32
|
+
if (isPlatformBrowser(this.platformId)) {
|
|
33
|
+
fromEvent(window, 'resize')
|
|
34
|
+
.pipe(debounceTime(200), map(() => this.width), distinctUntilChanged(), startWith(this.width))
|
|
35
|
+
.subscribe((width) => this.updateFlags(width));
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
updateFlags(width) {
|
|
39
|
+
const { xs, sm, md, lg, xl } = this.breakpoints;
|
|
40
|
+
this.isXs.set(width < sm);
|
|
41
|
+
this.isSm.set(width >= sm && width < md);
|
|
42
|
+
this.isMd.set(width >= md && width < lg);
|
|
43
|
+
this.isLg.set(width >= lg && width < xl);
|
|
44
|
+
this.isXl.set(width >= xl);
|
|
45
|
+
this.minSm.set(width >= sm);
|
|
46
|
+
this.minMd.set(width >= md);
|
|
47
|
+
this.minLg.set(width >= lg);
|
|
48
|
+
this.minXl.set(width >= xl);
|
|
49
|
+
}
|
|
50
|
+
// Métodos rápidos si no usas signals directamente
|
|
51
|
+
isXsInstant() {
|
|
52
|
+
return this.isXs();
|
|
53
|
+
}
|
|
54
|
+
isSmInstant() {
|
|
55
|
+
return this.isSm();
|
|
56
|
+
}
|
|
57
|
+
isMdInstant() {
|
|
58
|
+
return this.isMd();
|
|
59
|
+
}
|
|
60
|
+
isLgInstant() {
|
|
61
|
+
return this.isLg();
|
|
62
|
+
}
|
|
63
|
+
isXlInstant() {
|
|
64
|
+
return this.isXl();
|
|
65
|
+
}
|
|
66
|
+
minSmInstant() {
|
|
67
|
+
return this.minSm();
|
|
68
|
+
}
|
|
69
|
+
minMdInstant() {
|
|
70
|
+
return this.minMd();
|
|
71
|
+
}
|
|
72
|
+
minLgInstant() {
|
|
73
|
+
return this.minLg();
|
|
74
|
+
}
|
|
75
|
+
minXlInstant() {
|
|
76
|
+
return this.minXl();
|
|
77
|
+
}
|
|
78
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.19", ngImport: i0, type: ScreenSizerService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
79
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.19", ngImport: i0, type: ScreenSizerService, providedIn: 'root' });
|
|
80
|
+
}
|
|
81
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.19", ngImport: i0, type: ScreenSizerService, decorators: [{
|
|
82
|
+
type: Injectable,
|
|
83
|
+
args: [{ providedIn: 'root' }]
|
|
84
|
+
}], ctorParameters: () => [] });
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* Generated bundle index. Do not edit.
|
|
88
|
+
*/
|
|
89
|
+
|
|
90
|
+
export { ScreenSizerService };
|
|
91
|
+
//# sourceMappingURL=lluc_llull-ui-lib-screen-sizer.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lluc_llull-ui-lib-screen-sizer.mjs","sources":["../../../projects/ui-lib/screen-sizer/screen-sizer.service.ts","../../../projects/ui-lib/screen-sizer/lluc_llull-ui-lib-screen-sizer.ts"],"sourcesContent":["import { isPlatformBrowser } from '@angular/common';\nimport { Injectable, PLATFORM_ID, inject, signal } from '@angular/core';\nimport { fromEvent } from 'rxjs';\nimport { debounceTime, distinctUntilChanged, map, startWith } from 'rxjs/operators';\n\n@Injectable({ providedIn: 'root' })\nexport class ScreenSizerService {\n readonly breakpoints = {\n xs: 480,\n sm: 768,\n md: 1024,\n lg: 1280,\n xl: 1536,\n };\n\n readonly isXs = signal(false);\n readonly isSm = signal(false);\n readonly isMd = signal(false);\n readonly isLg = signal(false);\n readonly isXl = signal(false);\n\n readonly minSm = signal(false);\n readonly minMd = signal(false);\n readonly minLg = signal(false);\n readonly minXl = signal(false);\n\n private readonly platformId = inject(PLATFORM_ID);\n\n get width(): number {\n if (isPlatformBrowser(this.platformId)) {\n return Math.min(window.innerWidth, window.outerWidth);\n }\n return 0;\n }\n\n constructor() {\n if (isPlatformBrowser(this.platformId)) {\n fromEvent(window, 'resize')\n .pipe(\n debounceTime(200),\n map(() => this.width),\n distinctUntilChanged(),\n startWith(this.width),\n )\n .subscribe((width) => this.updateFlags(width));\n }\n }\n\n private updateFlags(width: number) {\n const { xs, sm, md, lg, xl } = this.breakpoints;\n\n this.isXs.set(width < sm);\n this.isSm.set(width >= sm && width < md);\n this.isMd.set(width >= md && width < lg);\n this.isLg.set(width >= lg && width < xl);\n this.isXl.set(width >= xl);\n\n this.minSm.set(width >= sm);\n this.minMd.set(width >= md);\n this.minLg.set(width >= lg);\n this.minXl.set(width >= xl);\n }\n\n // Métodos rápidos si no usas signals directamente\n isXsInstant() {\n return this.isXs();\n }\n isSmInstant() {\n return this.isSm();\n }\n isMdInstant() {\n return this.isMd();\n }\n isLgInstant() {\n return this.isLg();\n }\n isXlInstant() {\n return this.isXl();\n }\n\n minSmInstant() {\n return this.minSm();\n }\n minMdInstant() {\n return this.minMd();\n }\n minLgInstant() {\n return this.minLg();\n }\n minXlInstant() {\n return this.minXl();\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;MAMa,kBAAkB,CAAA;AAClB,IAAA,WAAW,GAAG;AACnB,QAAA,EAAE,EAAE,GAAG;AACP,QAAA,EAAE,EAAE,GAAG;AACP,QAAA,EAAE,EAAE,IAAI;AACR,QAAA,EAAE,EAAE,IAAI;AACR,QAAA,EAAE,EAAE,IAAI;KACX;AAEQ,IAAA,IAAI,GAAG,MAAM,CAAC,KAAK,CAAC;AACpB,IAAA,IAAI,GAAG,MAAM,CAAC,KAAK,CAAC;AACpB,IAAA,IAAI,GAAG,MAAM,CAAC,KAAK,CAAC;AACpB,IAAA,IAAI,GAAG,MAAM,CAAC,KAAK,CAAC;AACpB,IAAA,IAAI,GAAG,MAAM,CAAC,KAAK,CAAC;AAEpB,IAAA,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC;AACrB,IAAA,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC;AACrB,IAAA,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC;AACrB,IAAA,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC;AAEb,IAAA,UAAU,GAAG,MAAM,CAAC,WAAW,CAAC;AAEjD,IAAA,IAAI,KAAK,GAAA;AACL,QAAA,IAAI,iBAAiB,CAAC,IAAI,CAAC,UAAU,CAAC,EAAE;AACpC,YAAA,OAAO,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,UAAU,EAAE,MAAM,CAAC,UAAU,CAAC;QACzD;AACA,QAAA,OAAO,CAAC;IACZ;AAEA,IAAA,WAAA,GAAA;AACI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,IAAI,CAAC,IAAI,EAAE;IACtB;IACA,WAAW,GAAA;AACP,QAAA,OAAO,IAAI,CAAC,IAAI,EAAE;IACtB;IACA,WAAW,GAAA;AACP,QAAA,OAAO,IAAI,CAAC,IAAI,EAAE;IACtB;IACA,WAAW,GAAA;AACP,QAAA,OAAO,IAAI,CAAC,IAAI,EAAE;IACtB;IACA,WAAW,GAAA;AACP,QAAA,OAAO,IAAI,CAAC,IAAI,EAAE;IACtB;IAEA,YAAY,GAAA;AACR,QAAA,OAAO,IAAI,CAAC,KAAK,EAAE;IACvB;IACA,YAAY,GAAA;AACR,QAAA,OAAO,IAAI,CAAC,KAAK,EAAE;IACvB;IACA,YAAY,GAAA;AACR,QAAA,OAAO,IAAI,CAAC,KAAK,EAAE;IACvB;IACA,YAAY,GAAA;AACR,QAAA,OAAO,IAAI,CAAC,KAAK,EAAE;IACvB;wGArFS,kBAAkB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA;AAAlB,IAAA,OAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,kBAAkB,cADL,MAAM,EAAA,CAAA;;4FACnB,kBAAkB,EAAA,UAAA,EAAA,CAAA;kBAD9B,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;;ACLlC;;AAEG;;;;"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import * as i1 from '@angular/common';
|
|
2
|
+
import { CommonModule } from '@angular/common';
|
|
3
|
+
import * as i0 from '@angular/core';
|
|
4
|
+
import { Input, Component } from '@angular/core';
|
|
5
|
+
import * as simpleIcons from 'simple-icons';
|
|
6
|
+
import * as i2 from 'lucide-angular';
|
|
7
|
+
import { LucideAngularModule } from 'lucide-angular';
|
|
8
|
+
|
|
9
|
+
class UiIconComponent {
|
|
10
|
+
name;
|
|
11
|
+
size = 24;
|
|
12
|
+
color = 'currentColor';
|
|
13
|
+
icon;
|
|
14
|
+
ngOnChanges() {
|
|
15
|
+
this.icon = this.resolveBrandIcon();
|
|
16
|
+
}
|
|
17
|
+
get isBrandIcon() {
|
|
18
|
+
return !!this.icon;
|
|
19
|
+
}
|
|
20
|
+
get brandIcon() {
|
|
21
|
+
return this.icon ?? null;
|
|
22
|
+
}
|
|
23
|
+
resolveBrandIcon() {
|
|
24
|
+
if (!this.name)
|
|
25
|
+
return null;
|
|
26
|
+
const key = 'si' + this.name.replace(/[^a-z0-9]/gi, '').replace(/^\w/, (c) => c.toUpperCase());
|
|
27
|
+
return simpleIcons[key] ?? null;
|
|
28
|
+
}
|
|
29
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.19", ngImport: i0, type: UiIconComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
30
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.19", type: UiIconComponent, isStandalone: true, selector: "ui-icon", inputs: { name: "name", size: "size", color: "color" }, usesOnChanges: true, ngImport: i0, template: "<!-- SimpleIcons -->\n<ng-container *ngIf=\"isBrandIcon; else lucideIcon\">\n <svg\n class=\"ui-icon ui-icon--brand\"\n [attr.width]=\"size\"\n [attr.height]=\"size\"\n [attr.fill]=\"color\"\n viewBox=\"0 0 24 24\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path [attr.d]=\"brandIcon?.path\"></path>\n </svg>\n</ng-container>\n\n<!-- Lucide -->\n<ng-template #lucideIcon>\n <lucide-icon\n class=\"ui-icon ui-icon--lucide\"\n [name]=\"name\"\n [size]=\"size\"\n [color]=\"color\"\n ></lucide-icon>\n</ng-template>\n", styles: [".ui-icon{display:inline-flex;align-items:center;justify-content:center;line-height:0;flex-shrink:0}.ui-icon--brand svg{display:block;width:100%!important;height:100%!important}.ui-icon--lucide{display:inline-flex}.ui-icon--lucide svg{display:block;width:100%!important;height:100%!important;min-width:1em;min-height:1em}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: LucideAngularModule }, { kind: "component", type: i2.LucideAngularComponent, selector: "lucide-angular, lucide-icon, i-lucide, span-lucide", inputs: ["class", "name", "img", "color", "absoluteStrokeWidth", "size", "strokeWidth"] }] });
|
|
31
|
+
}
|
|
32
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.19", ngImport: i0, type: UiIconComponent, decorators: [{
|
|
33
|
+
type: Component,
|
|
34
|
+
args: [{ selector: 'ui-icon', standalone: true, imports: [CommonModule, LucideAngularModule], template: "<!-- SimpleIcons -->\n<ng-container *ngIf=\"isBrandIcon; else lucideIcon\">\n <svg\n class=\"ui-icon ui-icon--brand\"\n [attr.width]=\"size\"\n [attr.height]=\"size\"\n [attr.fill]=\"color\"\n viewBox=\"0 0 24 24\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path [attr.d]=\"brandIcon?.path\"></path>\n </svg>\n</ng-container>\n\n<!-- Lucide -->\n<ng-template #lucideIcon>\n <lucide-icon\n class=\"ui-icon ui-icon--lucide\"\n [name]=\"name\"\n [size]=\"size\"\n [color]=\"color\"\n ></lucide-icon>\n</ng-template>\n", styles: [".ui-icon{display:inline-flex;align-items:center;justify-content:center;line-height:0;flex-shrink:0}.ui-icon--brand svg{display:block;width:100%!important;height:100%!important}.ui-icon--lucide{display:inline-flex}.ui-icon--lucide svg{display:block;width:100%!important;height:100%!important;min-width:1em;min-height:1em}\n"] }]
|
|
35
|
+
}], propDecorators: { name: [{
|
|
36
|
+
type: Input
|
|
37
|
+
}], size: [{
|
|
38
|
+
type: Input
|
|
39
|
+
}], color: [{
|
|
40
|
+
type: Input
|
|
41
|
+
}] } });
|
|
42
|
+
|
|
43
|
+
class MockUiIconComponent {
|
|
44
|
+
name;
|
|
45
|
+
size = 24;
|
|
46
|
+
color = 'currentColor';
|
|
47
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.19", ngImport: i0, type: MockUiIconComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
48
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.19", type: MockUiIconComponent, isStandalone: true, selector: "ui-icon", inputs: { name: "name", size: "size", color: "color" }, ngImport: i0, template: '', isInline: true });
|
|
49
|
+
}
|
|
50
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.19", ngImport: i0, type: MockUiIconComponent, decorators: [{
|
|
51
|
+
type: Component,
|
|
52
|
+
args: [{
|
|
53
|
+
selector: 'ui-icon',
|
|
54
|
+
standalone: true,
|
|
55
|
+
template: '',
|
|
56
|
+
}]
|
|
57
|
+
}], propDecorators: { name: [{
|
|
58
|
+
type: Input
|
|
59
|
+
}], size: [{
|
|
60
|
+
type: Input
|
|
61
|
+
}], color: [{
|
|
62
|
+
type: Input
|
|
63
|
+
}] } });
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Generated bundle index. Do not edit.
|
|
67
|
+
*/
|
|
68
|
+
|
|
69
|
+
export { MockUiIconComponent, UiIconComponent };
|
|
70
|
+
//# sourceMappingURL=lluc_llull-ui-lib-shared.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lluc_llull-ui-lib-shared.mjs","sources":["../../../projects/ui-lib/shared/ui-icon/ui-icon.component.ts","../../../projects/ui-lib/shared/ui-icon/ui-icon.component.html","../../../projects/ui-lib/shared/ui-icon/ui-icon.mock.ts","../../../projects/ui-lib/shared/lluc_llull-ui-lib-shared.ts"],"sourcesContent":["import { CommonModule } from '@angular/common';\nimport { Component, Input } from '@angular/core';\nimport type { SimpleIcon } from 'simple-icons';\nimport * as simpleIcons from 'simple-icons';\nimport {LucideAngularModule } from 'lucide-angular';\n\n@Component({\n selector: 'ui-icon',\n standalone: true,\n imports: [CommonModule, LucideAngularModule],\n templateUrl: './ui-icon.component.html',\n styleUrls: ['./ui-icon.component.scss'],\n})\nexport class UiIconComponent {\n @Input() name!: string;\n @Input() size = 24;\n @Input() color = 'currentColor';\n\n private icon?: SimpleIcon | null;\n\n ngOnChanges() {\n this.icon = this.resolveBrandIcon();\n }\n\n get isBrandIcon(): boolean {\n return !!this.icon;\n }\n\n get brandIcon(): SimpleIcon | null {\n return this.icon ?? null;\n }\n\n private resolveBrandIcon(): SimpleIcon | null {\n if (!this.name) return null;\n\n const key =\n 'si' + this.name.replace(/[^a-z0-9]/gi, '').replace(/^\\w/, (c) => c.toUpperCase());\n\n return (simpleIcons as any)[key] ?? null;\n }\n}\n","<!-- SimpleIcons -->\n<ng-container *ngIf=\"isBrandIcon; else lucideIcon\">\n <svg\n class=\"ui-icon ui-icon--brand\"\n [attr.width]=\"size\"\n [attr.height]=\"size\"\n [attr.fill]=\"color\"\n viewBox=\"0 0 24 24\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path [attr.d]=\"brandIcon?.path\"></path>\n </svg>\n</ng-container>\n\n<!-- Lucide -->\n<ng-template #lucideIcon>\n <lucide-icon\n class=\"ui-icon ui-icon--lucide\"\n [name]=\"name\"\n [size]=\"size\"\n [color]=\"color\"\n ></lucide-icon>\n</ng-template>\n","import { Component, Input } from '@angular/core';\n\n@Component({\n selector: 'ui-icon',\n standalone: true,\n template: '',\n})\nexport class MockUiIconComponent {\n @Input() name!: string;\n @Input() size = 24;\n @Input() color = 'currentColor';\n}","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;MAaa,eAAe,CAAA;AACf,IAAA,IAAI;IACJ,IAAI,GAAG,EAAE;IACT,KAAK,GAAG,cAAc;AAEvB,IAAA,IAAI;IAEZ,WAAW,GAAA;AACP,QAAA,IAAI,CAAC,IAAI,GAAG,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../../../projects/ui-lib/sliders/lluc_llull-ui-lib-sliders.ts"],"sourcesContent":["import { AfterViewInit, Directive, ElementRef, Input, OnDestroy } from '@angular/core';\nimport Swiper from 'swiper';\nimport { Autoplay, Navigation, Pagination } from 'swiper/modules';\n\nSwiper.use([Navigation, Pagination, Autoplay]);\n\n@Directive({\n selector: '[appSwiper]',\n standalone: true,\n})\nexport class SwiperDirective implements AfterViewInit, OnDestroy {\n @Input() swiperConfig: any;\n\n private swiperInstance?: Swiper;\n\n constructor(private el: ElementRef) {}\n\n ngAfterViewInit(): void {\n this.swiperInstance = new Swiper(this.el.nativeElement, {\n spaceBetween: 16,\n navigation: {\n nextEl: '.swiper-button-next',\n prevEl: '.swiper-button-prev',\n },\n pagination: { clickable: true },\n breakpoints: {\n 0: { slidesPerView: 1 }, // móviles\n 480: { slidesPerView: 1 }, // small tablets\n 768: { slidesPerView: 3 }, // tablets\n 1024: { slidesPerView: 4 }, // laptops\n 1280: { slidesPerView: 7 }, // desktop → máximo 7\n },\n ...this.swiperConfig,\n });\n }\n\n ngOnDestroy(): void {\n this.swiperInstance?.destroy(true, true);\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;AAIA,MAAM,CAAC,GAAG,CAAC,CAAC,UAAU,EAAE,UAAU,EAAE,QAAQ,CAAC,CAAC;MAMjC,eAAe,CAAA;AAKJ,IAAA,EAAA;AAJX,IAAA,YAAY;AAEb,IAAA,cAAc;AAEtB,IAAA,WAAA,CAAoB,EAAc,EAAA;QAAd,IAAA,CAAA,EAAE,GAAF,EAAE;IAAe;IAErC,eAAe,GAAA;QACX,IAAI,CAAC,cAAc,GAAG,IAAI,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,aAAa,EAAE;AACpD,YAAA,YAAY,EAAE,EAAE;AAChB,YAAA,UAAU,EAAE;AACR,gBAAA,MAAM,EAAE,qBAAqB;AAC7B,gBAAA,MAAM,EAAE,qBAAqB;AAChC,aAAA;AACD,YAAA,UAAU,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE;AAC/B,YAAA,WAAW,EAAE;AACT,gBAAA,CAAC,EAAE,EAAE,aAAa,EAAE,CAAC,EAAE;AACvB,gBAAA,GAAG,EAAE,EAAE,aAAa,EAAE,CAAC,EAAE;AACzB,gBAAA,GAAG,EAAE,EAAE,aAAa,EAAE,CAAC,EAAE;AACzB,gBAAA,IAAI,EAAE,EAAE,aAAa,EAAE,CAAC,EAAE;AAC1B,gBAAA,IAAI,EAAE,EAAE,aAAa,EAAE,CAAC,EAAE;AAC7B,aAAA;YACD,GAAG,IAAI,CAAC,YAAY;AACvB,SAAA,CAAC;IACN;IAEA,WAAW,GAAA;QACP,IAAI,CAAC,cAAc,EAAE,OAAO,CAAC,IAAI,EAAE,IAAI,CAAC;IAC5C;wGA5BS,eAAe,EAAA,IAAA,EAAA,CAAA,EAAA,KAAA,EAAA,EAAA,CAAA,UAAA,EAAA,CAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;4FAAf,eAAe,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,aAAA,EAAA,MAAA,EAAA,EAAA,YAAA,EAAA,cAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA;;4FAAf,eAAe,EAAA,UAAA,EAAA,CAAA;kBAJ3B,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACP,oBAAA,QAAQ,EAAE,aAAa;AACvB,oBAAA,UAAU,EAAE,IAAI;AACnB,iBAAA;+EAEY,YAAY,EAAA,CAAA;sBAApB;;;ACXL;;AAEG;;;;"}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { isPlatformBrowser } from '@angular/common';
|
|
2
|
+
import * as i0 from '@angular/core';
|
|
3
|
+
import { PLATFORM_ID, Inject, Injectable } from '@angular/core';
|
|
4
|
+
import { BehaviorSubject } from 'rxjs';
|
|
5
|
+
|
|
6
|
+
class ThemeService {
|
|
7
|
+
platformId;
|
|
8
|
+
currentThemeSubject = new BehaviorSubject('light');
|
|
9
|
+
currentTheme$ = this.currentThemeSubject.asObservable();
|
|
10
|
+
constructor(platformId) {
|
|
11
|
+
this.platformId = platformId;
|
|
12
|
+
// Aplicar tema por defecto al inicio
|
|
13
|
+
if (isPlatformBrowser(this.platformId)) {
|
|
14
|
+
this.applyTheme('light');
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
getCurrentTheme() {
|
|
18
|
+
return this.currentThemeSubject.value;
|
|
19
|
+
}
|
|
20
|
+
setTheme(theme) {
|
|
21
|
+
this.currentThemeSubject.next(theme);
|
|
22
|
+
this.applyTheme(theme);
|
|
23
|
+
// NO guardar automáticamente en localStorage - solo cuando el usuario hace toggle
|
|
24
|
+
}
|
|
25
|
+
toggleTheme() {
|
|
26
|
+
const currentTheme = this.getCurrentTheme();
|
|
27
|
+
const newTheme = currentTheme === 'light' ? 'dark' : 'light';
|
|
28
|
+
// Guardar en localStorage solo cuando el usuario hace toggle
|
|
29
|
+
if (isPlatformBrowser(this.platformId)) {
|
|
30
|
+
localStorage.setItem('theme', newTheme);
|
|
31
|
+
}
|
|
32
|
+
this.setTheme(newTheme);
|
|
33
|
+
}
|
|
34
|
+
resetTheme() {
|
|
35
|
+
if (isPlatformBrowser(this.platformId)) {
|
|
36
|
+
localStorage.removeItem('theme');
|
|
37
|
+
this.currentThemeSubject.next('light');
|
|
38
|
+
this.applyTheme('light');
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
// Método para cargar el tema guardado (opcional)
|
|
42
|
+
loadSavedTheme() {
|
|
43
|
+
if (isPlatformBrowser(this.platformId)) {
|
|
44
|
+
const savedTheme = localStorage.getItem('theme');
|
|
45
|
+
if (savedTheme) {
|
|
46
|
+
this.setTheme(savedTheme);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
applyTheme(theme) {
|
|
51
|
+
// Solo aplicar en el navegador
|
|
52
|
+
if (!isPlatformBrowser(this.platformId)) {
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
const root = document.documentElement;
|
|
56
|
+
if (theme === 'dark') {
|
|
57
|
+
root.setAttribute('data-theme', 'dark');
|
|
58
|
+
}
|
|
59
|
+
else {
|
|
60
|
+
root.setAttribute('data-theme', 'light');
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.19", ngImport: i0, type: ThemeService, deps: [{ token: PLATFORM_ID }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
64
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.19", ngImport: i0, type: ThemeService, providedIn: 'root' });
|
|
65
|
+
}
|
|
66
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.19", ngImport: i0, type: ThemeService, decorators: [{
|
|
67
|
+
type: Injectable,
|
|
68
|
+
args: [{
|
|
69
|
+
providedIn: 'root',
|
|
70
|
+
}]
|
|
71
|
+
}], ctorParameters: () => [{ type: Object, decorators: [{
|
|
72
|
+
type: Inject,
|
|
73
|
+
args: [PLATFORM_ID]
|
|
74
|
+
}] }] });
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* Generated bundle index. Do not edit.
|
|
78
|
+
*/
|
|
79
|
+
|
|
80
|
+
export { ThemeService };
|
|
81
|
+
//# sourceMappingURL=lluc_llull-ui-lib-theme.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lluc_llull-ui-lib-theme.mjs","sources":["../../../projects/ui-lib/theme/theme.service.ts","../../../projects/ui-lib/theme/lluc_llull-ui-lib-theme.ts"],"sourcesContent":["import { isPlatformBrowser } from '@angular/common';\nimport { Inject, Injectable, PLATFORM_ID } from '@angular/core';\nimport { BehaviorSubject } from 'rxjs';\n\nexport type Theme = 'light' | 'dark';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class ThemeService {\n private currentThemeSubject = new BehaviorSubject<Theme>('light');\n public currentTheme$ = this.currentThemeSubject.asObservable();\n\n constructor(@Inject(PLATFORM_ID) private platformId: Object) {\n // Aplicar tema por defecto al inicio\n if (isPlatformBrowser(this.platformId)) {\n this.applyTheme('light');\n }\n }\n\n public getCurrentTheme(): Theme {\n return this.currentThemeSubject.value;\n }\n\n public setTheme(theme: Theme): void {\n this.currentThemeSubject.next(theme);\n this.applyTheme(theme);\n // NO guardar automáticamente en localStorage - solo cuando el usuario hace toggle\n }\n\n public toggleTheme(): void {\n const currentTheme = this.getCurrentTheme();\n const newTheme: Theme = currentTheme === 'light' ? 'dark' : 'light';\n\n // Guardar en localStorage solo cuando el usuario hace toggle\n if (isPlatformBrowser(this.platformId)) {\n localStorage.setItem('theme', newTheme);\n }\n\n this.setTheme(newTheme);\n }\n\n public resetTheme(): void {\n if (isPlatformBrowser(this.platformId)) {\n localStorage.removeItem('theme');\n this.currentThemeSubject.next('light');\n this.applyTheme('light');\n }\n }\n\n // Método para cargar el tema guardado (opcional)\n public loadSavedTheme(): void {\n if (isPlatformBrowser(this.platformId)) {\n const savedTheme = localStorage.getItem('theme') as Theme;\n if (savedTheme) {\n this.setTheme(savedTheme);\n }\n }\n }\n\n private applyTheme(theme: Theme): void {\n // Solo aplicar en el navegador\n if (!isPlatformBrowser(this.platformId)) {\n return;\n }\n\n const root = document.documentElement;\n\n if (theme === 'dark') {\n root.setAttribute('data-theme', 'dark');\n } else {\n root.setAttribute('data-theme', 'light');\n }\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;MASa,YAAY,CAAA;AAIoB,IAAA,UAAA;AAHjC,IAAA,mBAAmB,GAAG,IAAI,eAAe,CAAQ,OAAO,CAAC;AAC1D,IAAA,aAAa,GAAG,IAAI,CAAC,mBAAmB,CAAC,YAAY,EAAE;AAE9D,IAAA,WAAA,CAAyC,UAAkB,EAAA;QAAlB,IAA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,KAAY,EAAA;;QAE3B,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,UAAU,CAAC,EAAE;YACrC;QACJ;AAEA,QAAA,MAAM,IAAI,GAAG,QAAQ,CAAC,eAAe;AAErC,QAAA,IAAI,KAAK,KAAK,MAAM,EAAE;AAClB,YAAA,IAAI,CAAC,YAAY,CAAC,YAAY,EAAE,MAAM,CAAC;QAC3C;aAAO;AACH,YAAA,IAAI,CAAC,YAAY,CAAC,YAAY,EAAE,OAAO,CAAC;QAC5C;IACJ;AAhES,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,kBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,YAAY,kBAID,WAAW,EAAA,CAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA;AAJtB,IAAA,OAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,YAAY,cAFT,MAAM,EAAA,CAAA;;4FAET,YAAY,EAAA,UAAA,EAAA,CAAA;kBAHxB,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,UAAU,EAAE,MAAM;AACrB,iBAAA;;0BAKgB,MAAM;2BAAC,WAAW;;;ACbnC;;AAEG;;;;"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
function mapButtons(data) {
|
|
2
|
+
if (!Array.isArray(data))
|
|
3
|
+
return [];
|
|
4
|
+
return data
|
|
5
|
+
.filter((item) => item && typeof item === 'object')
|
|
6
|
+
.map((item) => ({
|
|
7
|
+
label: item.label ?? '',
|
|
8
|
+
url: item.link_type === 'internal' ? (item.page ?? '') : (item.url ?? ''),
|
|
9
|
+
linkType: item.link_type ?? 'none',
|
|
10
|
+
icon: item.icon,
|
|
11
|
+
}));
|
|
12
|
+
}
|
|
13
|
+
function mapImage(data, cdn) {
|
|
14
|
+
if (!data || typeof data !== 'object')
|
|
15
|
+
return null;
|
|
16
|
+
const src = data.url ?? data.src ?? '';
|
|
17
|
+
return {
|
|
18
|
+
url: src.startsWith('http') ? src : (cdn ?? '') + src,
|
|
19
|
+
alt: data.alt ?? '',
|
|
20
|
+
width: data.width,
|
|
21
|
+
height: data.height,
|
|
22
|
+
format: data.format,
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
function mapImageOrGallery(data, cdn) {
|
|
26
|
+
if (!data)
|
|
27
|
+
return [];
|
|
28
|
+
if (Array.isArray(data)) {
|
|
29
|
+
return data
|
|
30
|
+
.filter((img) => img && typeof img === 'object')
|
|
31
|
+
.map((img) => mapImage(img, cdn))
|
|
32
|
+
.filter(Boolean);
|
|
33
|
+
}
|
|
34
|
+
const single = mapImage(data, cdn);
|
|
35
|
+
return single ? [single] : [];
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Generated bundle index. Do not edit.
|
|
40
|
+
*/
|
|
41
|
+
|
|
42
|
+
export { mapButtons, mapImage, mapImageOrGallery };
|
|
43
|
+
//# sourceMappingURL=lluc_llull-ui-lib-utils.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lluc_llull-ui-lib-utils.mjs","sources":["../../../projects/ui-lib/utils/utils.ts","../../../projects/ui-lib/utils/lluc_llull-ui-lib-utils.ts"],"sourcesContent":["import { UiLibButtonI, UiLibImageI } from '@lluc_llull/ui-lib/interfaces';\n\nexport function mapButtons(data: any): UiLibButtonI[] {\n if (!Array.isArray(data)) return [];\n\n return data\n .filter((item) => item && typeof item === 'object')\n .map(\n (item): UiLibButtonI => ({\n label: item.label ?? '',\n url: item.link_type === 'internal' ? (item.page ?? '') : (item.url ?? ''),\n linkType: item.link_type ?? 'none',\n icon: item.icon,\n }),\n );\n}\n\nexport function mapImage(data: any, cdn?: string): UiLibImageI | null {\n if (!data || typeof data !== 'object') return null;\n\n const src = data.url ?? data.src ?? '';\n\n return {\n url: src.startsWith('http') ? src : (cdn ?? '') + src,\n alt: data.alt ?? '',\n width: data.width,\n height: data.height,\n format: data.format,\n };\n}\n\nexport function mapImageOrGallery(data: any, cdn?: string): UiLibImageI[] {\n if (!data) return [];\n\n if (Array.isArray(data)) {\n return data\n .filter((img) => img && typeof img === 'object')\n .map((img) => mapImage(img, cdn)!)\n .filter(Boolean);\n }\n\n const single = mapImage(data, cdn);\n return single ? [single] : [];\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":"AAEM,SAAU,UAAU,CAAC,IAAS,EAAA;AAChC,IAAA,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC;AAAE,QAAA,OAAO,EAAE;AAEnC,IAAA,OAAO;AACF,SAAA,MAAM,CAAC,CAAC,IAAI,KAAK,IAAI,IAAI,OAAO,IAAI,KAAK,QAAQ;AACjD,SAAA,GAAG,CACA,CAAC,IAAI,MAAoB;AACrB,QAAA,KAAK,EAAE,IAAI,CAAC,KAAK,IAAI,EAAE;QACvB,GAAG,EAAE,IAAI,CAAC,SAAS,KAAK,UAAU,IAAI,IAAI,CAAC,IAAI,IAAI,EAAE,KAAK,IAAI,CAAC,GAAG,IAAI,EAAE,CAAC;AACzE,QAAA,QAAQ,EAAE,IAAI,CAAC,SAAS,IAAI,MAAM;QAClC,IAAI,EAAE,IAAI,CAAC,IAAI;AAClB,KAAA,CAAC,CACL;AACT;AAEM,SAAU,QAAQ,CAAC,IAAS,EAAE,GAAY,EAAA;AAC5C,IAAA,IAAI,CAAC,IAAI,IAAI,OAAO,IAAI,KAAK,QAAQ;AAAE,QAAA,OAAO,IAAI;IAElD,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,IAAI,IAAI,CAAC,GAAG,IAAI,EAAE;IAEtC,OAAO;QACH,GAAG,EAAE,GAAG,CAAC,UAAU,CAAC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