@lucca-front/ng 21.3.0-rc.4 → 21.3.0-rc.6
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/lucca-front-ng-callout.mjs +1 -1
- package/fesm2022/lucca-front-ng-callout.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-color.mjs +2 -2
- package/fesm2022/lucca-front-ng-color.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-core-select-user.mjs +2 -2
- package/fesm2022/lucca-front-ng-core-select-user.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-core-select.mjs +135 -102
- package/fesm2022/lucca-front-ng-core-select.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-date2.mjs +3 -3
- package/fesm2022/lucca-front-ng-date2.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-filter-pills.mjs +2 -2
- package/fesm2022/lucca-front-ng-filter-pills.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-form-field.mjs +2 -2
- package/fesm2022/lucca-front-ng-form-field.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-forms-rich-text-input.mjs +1 -1
- package/fesm2022/lucca-front-ng-forms-rich-text-input.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-forms.mjs +86 -35
- package/fesm2022/lucca-front-ng-forms.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-impersonation.mjs +1 -1
- package/fesm2022/lucca-front-ng-impersonation.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-multi-select.mjs +18 -5
- package/fesm2022/lucca-front-ng-multi-select.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-option.mjs +4 -4
- package/fesm2022/lucca-front-ng-option.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-popover2.mjs +8 -4
- package/fesm2022/lucca-front-ng-popover2.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-simple-select.mjs +20 -7
- package/fesm2022/lucca-front-ng-simple-select.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-skeleton.mjs +2 -2
- package/fesm2022/lucca-front-ng-skeleton.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-software-icon-wrapper.mjs +1 -1
- package/fesm2022/lucca-front-ng-software-icon-wrapper.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-time.mjs +22 -10
- package/fesm2022/lucca-front-ng-time.mjs.map +1 -1
- package/fesm2022/lucca-front-ng-title.mjs +17 -2
- package/fesm2022/lucca-front-ng-title.mjs.map +1 -1
- package/package.json +4 -4
- package/schematics/collection.json +10 -0
- package/schematics/deprecated-resolver/index.js +70 -0
- package/schematics/deprecated-resolver/migration.spec.js +25 -0
- package/schematics/deprecated-resolver/schema.json +23 -0
- package/schematics/lib/deprecated-mapper.js +109 -0
- package/schematics/lib/index.js +1 -0
- package/schematics/lu-grid/index.js +23 -0
- package/schematics/lu-grid/migration.js +264 -0
- package/schematics/lu-grid/migration.spec.js +23 -0
- package/schematics/lu-grid/schema.json +23 -0
- package/src/definitions/option/_option-item.scss +4 -24
- package/types/lucca-front-ng-core-select.d.ts +5 -0
- package/types/lucca-front-ng-forms.d.ts +30 -5
- package/types/lucca-front-ng-popover2.d.ts +5 -1
- package/types/lucca-front-ng-simple-select.d.ts +3 -0
- package/types/lucca-front-ng-time.d.ts +3 -1
- package/types/lucca-front-ng-title.d.ts +5 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lucca-front-ng-title.mjs","sources":["../../../packages/ng/title/title-translate.service.ts","../../../packages/ng/title/title.model.ts","../../../packages/ng/title/title.service.ts","../../../packages/ng/title/title.module.ts","../../../packages/ng/title/title.strategy.ts","../../../packages/ng/title/lucca-front-ng-title.ts"],"sourcesContent":["import { InjectionToken } from '@angular/core';\nimport { Observable } from 'rxjs';\n\nexport const LU_TITLE_TRANSLATE_SERVICE = new InjectionToken<ILuTitleTranslateService>('LU_TITLE_TRANSLATE_SERVICE');\n\nexport interface ILuTitleTranslateService {\n\ttranslate(key: string, args?: Record<string, unknown>): string | Observable<string>;\n}\n","export type PageTitle = { title: string; params?: { [param: string]: string } };\nexport const TitleSeparator = ' – ';\n","import { Inject, Injectable } from '@angular/core';\nimport { Title } from '@angular/platform-browser';\nimport { ActivatedRouteSnapshot, ActivationEnd, Router } from '@angular/router';\nimport { BehaviorSubject, combineLatest, ObservableInput, of } from 'rxjs';\nimport { distinctUntilChanged, filter, map, switchMap, tap } from 'rxjs/operators';\nimport { ILuTitleTranslateService, LU_TITLE_TRANSLATE_SERVICE } from './title-translate.service';\nimport { PageTitle, TitleSeparator } from './title.model';\n\n/**\n * @deprecated use Title strategy instead\n */\n@Injectable()\nexport class LuTitleService {\n\tprivate titlePartsSubject = new BehaviorSubject<Array<string | ObservableInput<string>>>(['Lucca']);\n\ttitleParts$ = this.titlePartsSubject.asObservable();\n\ttitle$ = this.titleParts$.pipe(\n\t\tswitchMap((titleParts) => combineLatest(titleParts.map((part) => (typeof part === 'string' ? of(part) : part)))),\n\t\tmap((parts) => parts.join(TitleSeparator)),\n\t);\n\n\tconstructor(\n\t\tprivate router: Router,\n\t\tprivate title: Title,\n\t\t@Inject(LU_TITLE_TRANSLATE_SERVICE) private translateService: ILuTitleTranslateService,\n\t) {}\n\n\tinit(applicationNameTranslationKey: string) {\n\t\tthis.router.events\n\t\t\t.pipe(\n\t\t\t\tfilter((event) => {\n\t\t\t\t\treturn event instanceof ActivationEnd && event.snapshot.children.length === 0;\n\t\t\t\t}),\n\t\t\t\tmap((event: ActivationEnd) => getPageTitleParts(event.snapshot)),\n\t\t\t\tmap((titleParts) => uniqTitle(titleParts)),\n\t\t\t\tmap((titleParts) => titleParts.filter(({ title }) => title !== '').map(({ title, params }) => this.translateService.translate(title, params))),\n\t\t\t\tmap((titleParts: Array<string>) => [...titleParts, this.translateService.translate(applicationNameTranslationKey, {}), 'Lucca'].filter((x) => !!x)),\n\t\t\t\tdistinctUntilChanged(),\n\t\t\t\ttap((titleParts) => this.titlePartsSubject.next(titleParts)),\n\t\t\t)\n\t\t\t.subscribe();\n\n\t\tthis.title$.pipe(tap((title) => this.title.setTitle(title))).subscribe();\n\t}\n\n\tprependTitle(title: string | ObservableInput<string>) {\n\t\tthis.titlePartsSubject.next([title, ...this.titlePartsSubject.value]);\n\t}\n\n\toverrideFirstTitlePart(title: string | ObservableInput<string>) {\n\t\tthis.titlePartsSubject.next([title, ...this.titlePartsSubject.value.slice(1)]);\n\t}\n}\n\nfunction getPageTitleParts(snapshot: ActivatedRouteSnapshot): Array<PageTitle> {\n\tconst pageTitle: PageTitle = {\n\t\ttitle: (snapshot.data?.['title'] || '') as string,\n\t\tparams: { ...snapshot.params, ...snapshot.data },\n\t};\n\treturn snapshot.parent ? [pageTitle, ...getPageTitleParts(snapshot.parent)] : [pageTitle];\n}\n\nfunction uniqTitle(titleParts: Array<PageTitle>): Array<PageTitle> {\n\treturn titleParts.filter(({ title }, index) => titleParts.findIndex((pageTitle) => pageTitle.title === title) === index);\n}\n","import { NgModule } from '@angular/core';\nimport { RouterModule } from '@angular/router';\nimport { LuTitleService } from './title.service';\n\n/**\n * @deprecated use title streatgy instead\n */\n@NgModule({\n\timports: [RouterModule],\n\tproviders: [LuTitleService],\n})\nexport class LuTitleModule {}\n","import { inject, Injectable, InjectionToken, Provider } from '@angular/core';\nimport { Title } from '@angular/platform-browser';\nimport { ActivatedRouteSnapshot, RouterStateSnapshot, TitleStrategy } from '@angular/router';\nimport { BehaviorSubject, combineLatest, isObservable, Observable, ObservableInput, of } from 'rxjs';\nimport { distinctUntilChanged, map, switchMap, tap } from 'rxjs/operators';\nimport { ILuTitleTranslateService, LU_TITLE_TRANSLATE_SERVICE } from './title-translate.service';\nimport { PageTitle, TitleSeparator } from './title.model';\n\nexport const ɵAPP_TITLE = new InjectionToken<string | Observable<string>>('APP_TITLE');\nexport type LuTitleNamingStrategy = 'product' | 'other';\nexport const ɵNAMING_STRATEGY = new InjectionToken<LuTitleNamingStrategy>('NAMING_STRATEGY', { factory: () => 'product' });\n\n/**\n * @deprecated Use `provideLuTitleStrategy` instead.\n */\nexport const APP_TITLE = ɵAPP_TITLE;\n\nconst Lucca = 'Lucca';\n\n@Injectable({ providedIn: 'root' })\nexport class LuTitleStrategy extends TitleStrategy {\n\tprivate title = inject(Title);\n\tprivate translateService = inject<ILuTitleTranslateService>(LU_TITLE_TRANSLATE_SERVICE, { optional: true });\n\tprivate appTitle = inject(ɵAPP_TITLE);\n\tprivate namingStrategy = inject(ɵNAMING_STRATEGY);\n\n\tprivate luccaTitle$ = isObservable(this.appTitle) ? this.appTitle.pipe(map((title) => this.#luccaTitle(title))) : of(this.#luccaTitle(this.appTitle));\n\n\tprivate titlePartsSubject = new BehaviorSubject<Array<string | ObservableInput<string>>>([Lucca]);\n\ttitleParts$ = this.titlePartsSubject.asObservable();\n\ttitle$ = this.titleParts$.pipe(\n\t\tswitchMap((titleParts) => combineLatest(titleParts.map((part) => (typeof part === 'string' ? of(part) : part)))),\n\t\tmap((parts) => parts.join(TitleSeparator)),\n\t\tdistinctUntilChanged(),\n\t);\n\tconstructor() {\n\t\tsuper();\n\t\tthis.title$.pipe(tap((title) => this.title.setTitle(title))).subscribe();\n\t}\n\n\toverride updateTitle(routerState: RouterStateSnapshot) {\n\t\t// Title page is display from child to root\n\t\tconst pageTitles = this.#getPageTitleParts(routerState.root).reverse();\n\t\tconst translatedPageTitles = uniqTitle(pageTitles)\n\t\t\t.filter(({ title }) => title !== '')\n\t\t\t.map(({ title, params }) => (this.translateService ? this.translateService.translate(title, params) : title));\n\t\t// Add the name app\n\t\tconst titleParts = [...translatedPageTitles, this.luccaTitle$].filter((x) => !!x);\n\t\tthis.titlePartsSubject.next(titleParts);\n\t}\n\n\tprependTitle(title: string | ObservableInput<string>) {\n\t\tthis.titlePartsSubject.next([title, ...this.titlePartsSubject.value]);\n\t}\n\n\toverrideFirstTitlePart(title: string | ObservableInput<string>) {\n\t\tthis.titlePartsSubject.next([title, ...this.titlePartsSubject.value.slice(1)]);\n\t}\n\n\t#getPageTitleParts(snapshot: ActivatedRouteSnapshot): Array<PageTitle> {\n\t\tconst pageTitle: PageTitle = {\n\t\t\ttitle: this.getResolvedTitleForRoute(snapshot) as string,\n\t\t\tparams: { ...snapshot.params, ...snapshot.data },\n\t\t};\n\t\treturn snapshot.firstChild ? [pageTitle, ...this.#getPageTitleParts(snapshot.firstChild)] : [pageTitle];\n\t}\n\n\t#luccaTitle(appTitle: string) {\n\t\tif (appTitle.includes(Lucca)) {\n\t\t\treturn appTitle;\n\t\t}\n\t\tif (this.namingStrategy === 'product') {\n\t\t\treturn `${Lucca} ${appTitle}`;\n\t\t}\n\t\treturn `${appTitle}${TitleSeparator}${Lucca}`;\n\t}\n}\n\nfunction uniqTitle(titleParts: Array<PageTitle>): Array<PageTitle> {\n\treturn titleParts.filter(({ title }, index) => titleParts.findIndex((pageTitle) => pageTitle.title === title) === index);\n}\n\nexport interface LuTitleStrategyOptions {\n\tappTitle?: () => string | Observable<string>;\n\ttranslateService?: () => ILuTitleTranslateService;\n\tnamingStrategy?: LuTitleNamingStrategy;\n}\n\nexport function provideLuTitleStrategy(options: LuTitleStrategyOptions): Provider[] {\n\tconst providers: Provider[] = [{ provide: TitleStrategy, useClass: LuTitleStrategy }];\n\n\tif (options.appTitle) {\n\t\tproviders.push({ provide: ɵAPP_TITLE, useFactory: options.appTitle });\n\t}\n\tif (options.translateService) {\n\t\tproviders.push({ provide: LU_TITLE_TRANSLATE_SERVICE, useFactory: options.translateService });\n\t}\n\tif (options.namingStrategy) {\n\t\tproviders.push({ provide: ɵNAMING_STRATEGY, useValue: options.namingStrategy });\n\t}\n\n\treturn providers;\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["uniqTitle"],"mappings":";;;;;;;;;MAGa,0BAA0B,GAAG,IAAI,cAAc,CAA2B,4BAA4B;;ACF5G,MAAM,cAAc,GAAG;;ACO9B;;AAEG;MAEU,cAAc,CAAA;AAQ1B,IAAA,WAAA,CACS,MAAc,EACd,KAAY,EACwB,gBAA0C,EA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D3B,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;AA2DlC,SAAS,SAAS,CAAC,UAA4B,EAAA;AAC9C,IAAA,OAAO,UAAU,CAAC,MAAM,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,KAAK,KAAK,UAAU,CAAC,SAAS,CAAC,CAAC,SAAS,KAAK,SAAS,CAAC,KAAK,KAAK,KAAK,CAAC,KAAK,KAAK,CAAC;AACzH;AAQM,SAAU,sBAAsB,CAAC,OAA+B,EAAA;AACrE,IAAA,MAAM,SAAS,GAAe,CAAC,EAAE,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,eAAe,EAAE,CAAC;AAErF,IAAA,IAAI,OAAO,CAAC,QAAQ,EAAE;AACrB,QAAA,SAAS,CAAC,IAAI,CAAC,EAAE,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,OAAO,CAAC,QAAQ,EAAE,CAAC;IACtE;AACA,IAAA,IAAI,OAAO,CAAC,gBAAgB,EAAE;AAC7B,QAAA,SAAS,CAAC,IAAI,CAAC,EAAE,OAAO,EAAE,0BAA0B,EAAE,UAAU,EAAE,OAAO,CAAC,gBAAgB,EAAE,CAAC;IAC9F;AACA,IAAA,IAAI,OAAO,CAAC,cAAc,EAAE;AAC3B,QAAA,SAAS,CAAC,IAAI,CAAC,EAAE,OAAO,EAAE,gBAAgB,EAAE,QAAQ,EAAE,OAAO,CAAC,cAAc,EAAE,CAAC;IAChF;AAEA,IAAA,OAAO,SAAS;AACjB;;ACtGA;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"lucca-front-ng-title.mjs","sources":["../../../packages/ng/title/title-translate.service.ts","../../../packages/ng/title/title.model.ts","../../../packages/ng/title/title.service.ts","../../../packages/ng/title/title.module.ts","../../../packages/ng/title/title.strategy.ts","../../../packages/ng/title/lucca-front-ng-title.ts"],"sourcesContent":["import { InjectionToken } from '@angular/core';\nimport { Observable } from 'rxjs';\n\nexport const LU_TITLE_TRANSLATE_SERVICE = new InjectionToken<ILuTitleTranslateService>('LU_TITLE_TRANSLATE_SERVICE');\n\nexport interface ILuTitleTranslateService {\n\ttranslate(key: string, args?: Record<string, unknown>): string | Observable<string>;\n}\n","export type PageTitle = { title: string; params?: { [param: string]: string } };\nexport const TitleSeparator = ' – ';\n","import { Inject, Injectable } from '@angular/core';\nimport { Title } from '@angular/platform-browser';\nimport { ActivatedRouteSnapshot, ActivationEnd, Router } from '@angular/router';\nimport { BehaviorSubject, combineLatest, ObservableInput, of } from 'rxjs';\nimport { distinctUntilChanged, filter, map, switchMap, tap } from 'rxjs/operators';\nimport { ILuTitleTranslateService, LU_TITLE_TRANSLATE_SERVICE } from './title-translate.service';\nimport { PageTitle, TitleSeparator } from './title.model';\n\n/**\n * @deprecated use Title strategy instead\n */\n@Injectable()\nexport class LuTitleService {\n\tprivate titlePartsSubject = new BehaviorSubject<Array<string | ObservableInput<string>>>(['Lucca']);\n\ttitleParts$ = this.titlePartsSubject.asObservable();\n\ttitle$ = this.titleParts$.pipe(\n\t\tswitchMap((titleParts) => combineLatest(titleParts.map((part) => (typeof part === 'string' ? of(part) : part)))),\n\t\tmap((parts) => parts.join(TitleSeparator)),\n\t);\n\n\tconstructor(\n\t\tprivate router: Router,\n\t\tprivate title: Title,\n\t\t@Inject(LU_TITLE_TRANSLATE_SERVICE) private translateService: ILuTitleTranslateService,\n\t) {}\n\n\tinit(applicationNameTranslationKey: string) {\n\t\tthis.router.events\n\t\t\t.pipe(\n\t\t\t\tfilter((event) => {\n\t\t\t\t\treturn event instanceof ActivationEnd && event.snapshot.children.length === 0;\n\t\t\t\t}),\n\t\t\t\tmap((event: ActivationEnd) => getPageTitleParts(event.snapshot)),\n\t\t\t\tmap((titleParts) => uniqTitle(titleParts)),\n\t\t\t\tmap((titleParts) => titleParts.filter(({ title }) => title !== '').map(({ title, params }) => this.translateService.translate(title, params))),\n\t\t\t\tmap((titleParts: Array<string>) => [...titleParts, this.translateService.translate(applicationNameTranslationKey, {}), 'Lucca'].filter((x) => !!x)),\n\t\t\t\tdistinctUntilChanged(),\n\t\t\t\ttap((titleParts) => this.titlePartsSubject.next(titleParts)),\n\t\t\t)\n\t\t\t.subscribe();\n\n\t\tthis.title$.pipe(tap((title) => this.title.setTitle(title))).subscribe();\n\t}\n\n\tprependTitle(title: string | ObservableInput<string>) {\n\t\tthis.titlePartsSubject.next([title, ...this.titlePartsSubject.value]);\n\t}\n\n\toverrideFirstTitlePart(title: string | ObservableInput<string>) {\n\t\tthis.titlePartsSubject.next([title, ...this.titlePartsSubject.value.slice(1)]);\n\t}\n}\n\nfunction getPageTitleParts(snapshot: ActivatedRouteSnapshot): Array<PageTitle> {\n\tconst pageTitle: PageTitle = {\n\t\ttitle: (snapshot.data?.['title'] || '') as string,\n\t\tparams: { ...snapshot.params, ...snapshot.data },\n\t};\n\treturn snapshot.parent ? [pageTitle, ...getPageTitleParts(snapshot.parent)] : [pageTitle];\n}\n\nfunction uniqTitle(titleParts: Array<PageTitle>): Array<PageTitle> {\n\treturn titleParts.filter(({ title }, index) => titleParts.findIndex((pageTitle) => pageTitle.title === title) === index);\n}\n","import { NgModule } from '@angular/core';\nimport { RouterModule } from '@angular/router';\nimport { LuTitleService } from './title.service';\n\n/**\n * @deprecated use title streatgy instead\n */\n@NgModule({\n\timports: [RouterModule],\n\tproviders: [LuTitleService],\n})\nexport class LuTitleModule {}\n","import { LiveAnnouncer } from '@angular/cdk/a11y';\nimport { inject, Injectable, InjectionToken, Provider } from '@angular/core';\nimport { Title } from '@angular/platform-browser';\nimport { ActivatedRouteSnapshot, RouterStateSnapshot, TitleStrategy } from '@angular/router';\nimport { isNotNil } from '@lucca-front/ng/core';\nimport { BehaviorSubject, combineLatest, isObservable, Observable, ObservableInput, of } from 'rxjs';\nimport { distinctUntilChanged, map, switchMap, tap } from 'rxjs/operators';\nimport { ILuTitleTranslateService, LU_TITLE_TRANSLATE_SERVICE } from './title-translate.service';\nimport { PageTitle, TitleSeparator } from './title.model';\n\nexport const ɵAPP_TITLE = new InjectionToken<string | Observable<string>>('APP_TITLE');\nexport type LuTitleNamingStrategy = 'product' | 'other';\nexport const ɵNAMING_STRATEGY = new InjectionToken<LuTitleNamingStrategy>('NAMING_STRATEGY', { factory: () => 'product' });\nexport const ɵREAD_TITLE_BY_LIVE_ANNOUNCER = new InjectionToken<boolean>('READ_TITLE_BY_LIVE_ANNOUNCEMENT', { factory: () => false });\n\n/**\n * @deprecated Use `provideLuTitleStrategy` instead.\n */\nexport const APP_TITLE = ɵAPP_TITLE;\n\nconst Lucca = 'Lucca';\n\n@Injectable({ providedIn: 'root' })\nexport class LuTitleStrategy extends TitleStrategy {\n\tprivate title = inject(Title);\n\tprivate translateService = inject<ILuTitleTranslateService>(LU_TITLE_TRANSLATE_SERVICE, { optional: true });\n\tprivate appTitle = inject(ɵAPP_TITLE);\n\tprivate namingStrategy = inject(ɵNAMING_STRATEGY);\n\tprivate readTitleByLiveAnnouncer = inject(ɵREAD_TITLE_BY_LIVE_ANNOUNCER);\n\tprivate liveAnnouncer = inject(LiveAnnouncer);\n\n\tprivate luccaTitle$ = isObservable(this.appTitle) ? this.appTitle.pipe(map((title) => this.#luccaTitle(title))) : of(this.#luccaTitle(this.appTitle));\n\n\tprivate titlePartsSubject = new BehaviorSubject<Array<string | ObservableInput<string>>>([Lucca]);\n\ttitleParts$ = this.titlePartsSubject.asObservable();\n\ttitle$ = this.titleParts$.pipe(\n\t\tswitchMap((titleParts) => combineLatest(titleParts.map((part) => (typeof part === 'string' ? of(part) : part)))),\n\t\tmap((parts) => parts.join(TitleSeparator)),\n\t\tdistinctUntilChanged(),\n\t);\n\tconstructor() {\n\t\tsuper();\n\t\tthis.title$\n\t\t\t.pipe(\n\t\t\t\ttap((title) => {\n\t\t\t\t\tthis.title.setTitle(title);\n\t\t\t\t\tif (this.readTitleByLiveAnnouncer) {\n\t\t\t\t\t\tvoid this.liveAnnouncer.announce(title, 'polite');\n\t\t\t\t\t}\n\t\t\t\t}),\n\t\t\t)\n\t\t\t.subscribe();\n\t}\n\n\toverride updateTitle(routerState: RouterStateSnapshot) {\n\t\t// Title page is display from child to root\n\t\tconst pageTitles = this.#getPageTitleParts(routerState.root).reverse();\n\t\tconst translatedPageTitles = uniqTitle(pageTitles)\n\t\t\t.filter(({ title }) => title !== '')\n\t\t\t.map(({ title, params }) => (this.translateService ? this.translateService.translate(title, params) : title));\n\t\t// Add the name app\n\t\tconst titleParts = [...translatedPageTitles, this.luccaTitle$].filter((x) => !!x);\n\t\tthis.titlePartsSubject.next(titleParts);\n\t}\n\n\tprependTitle(title: string | ObservableInput<string>) {\n\t\tthis.titlePartsSubject.next([title, ...this.titlePartsSubject.value]);\n\t}\n\n\toverrideFirstTitlePart(title: string | ObservableInput<string>) {\n\t\tthis.titlePartsSubject.next([title, ...this.titlePartsSubject.value.slice(1)]);\n\t}\n\n\t#getPageTitleParts(snapshot: ActivatedRouteSnapshot): Array<PageTitle> {\n\t\tconst pageTitle: PageTitle = {\n\t\t\ttitle: this.getResolvedTitleForRoute(snapshot) as string,\n\t\t\tparams: { ...snapshot.params, ...snapshot.data },\n\t\t};\n\t\treturn snapshot.firstChild ? [pageTitle, ...this.#getPageTitleParts(snapshot.firstChild)] : [pageTitle];\n\t}\n\n\t#luccaTitle(appTitle: string) {\n\t\tif (appTitle.includes(Lucca)) {\n\t\t\treturn appTitle;\n\t\t}\n\t\tif (this.namingStrategy === 'product') {\n\t\t\treturn `${Lucca} ${appTitle}`;\n\t\t}\n\t\treturn `${appTitle}${TitleSeparator}${Lucca}`;\n\t}\n}\n\nfunction uniqTitle(titleParts: Array<PageTitle>): Array<PageTitle> {\n\treturn titleParts.filter(({ title }, index) => titleParts.findIndex((pageTitle) => pageTitle.title === title) === index);\n}\n\nexport interface LuTitleStrategyOptions {\n\tappTitle?: () => string | Observable<string>;\n\ttranslateService?: () => ILuTitleTranslateService;\n\tnamingStrategy?: LuTitleNamingStrategy;\n\treadTitleByLiveAnnouncer?: boolean;\n}\n\nexport function provideLuTitleStrategy(options: LuTitleStrategyOptions): Provider[] {\n\tconst providers: Provider[] = [{ provide: TitleStrategy, useClass: LuTitleStrategy }];\n\n\tif (options.appTitle) {\n\t\tproviders.push({ provide: ɵAPP_TITLE, useFactory: options.appTitle });\n\t}\n\tif (options.translateService) {\n\t\tproviders.push({ provide: LU_TITLE_TRANSLATE_SERVICE, useFactory: options.translateService });\n\t}\n\tif (options.namingStrategy) {\n\t\tproviders.push({ provide: ɵNAMING_STRATEGY, useValue: options.namingStrategy });\n\t}\n\tif (isNotNil(options.readTitleByLiveAnnouncer)) {\n\t\tproviders.push({ provide: ɵREAD_TITLE_BY_LIVE_ANNOUNCER, useValue: options.readTitleByLiveAnnouncer });\n\t}\n\n\treturn providers;\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["uniqTitle"],"mappings":";;;;;;;;;;;MAGa,0BAA0B,GAAG,IAAI,cAAc,CAA2B,4BAA4B;;ACF5G,MAAM,cAAc,GAAG;;ACO9B;;AAEG;MAEU,cAAc,CAAA;AAQ1B,IAAA,WAAA,CACS,MAAc,EACd,KAAY,EACwB,gBAA0C,EAAA;QAF9E,IAAA,CAAA,MAAM,GAAN,MAAM;QACN,IAAA,CAAA,KAAK,GAAL,KAAK;QAC+B,IAAA,CAAA,gBAAgB,GAAhB,gBAAgB;QAVrD,IAAA,CAAA,iBAAiB,GAAG,IAAI,eAAe,CAA0C,CAAC,OAAO,CAAC,CAAC;AACnG,QAAA,IAAA,CAAA,WAAW,GAAG,IAAI,CAAC,iBAAiB,CAAC,YAAY,EAAE;AACnD,QAAA,IAAA,CAAA,MAAM,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI,CAC7B,SAAS,CAAC,CAAC,UAAU,KAAK,aAAa,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,IAAI,MAAM,OAAO,IAAI,KAAK,QAAQ,GAAG,EAAE,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,EAChH,GAAG,C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AE,EAAE,KAAK,KAAK,UAAU,CAAC,SAAS,CAAC,CAAC,SAAS,KAAK,SAAS,CAAC,KAAK,KAAK,KAAK,CAAC,KAAK,KAAK,CAAC;AACzH;AASM,SAAU,sBAAsB,CAAC,OAA+B,EAAA;AACrE,IAAA,MAAM,SAAS,GAAe,CAAC,EAAE,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,eAAe,EAAE,CAAC;AAErF,IAAA,IAAI,OAAO,CAAC,QAAQ,EAAE;AACrB,QAAA,SAAS,CAAC,IAAI,CAAC,EAAE,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,OAAO,CAAC,QAAQ,EAAE,CAAC;IACtE;AACA,IAAA,IAAI,OAAO,CAAC,gBAAgB,EAAE;AAC7B,QAAA,SAAS,CAAC,IAAI,CAAC,EAAE,OAAO,EAAE,0BAA0B,EAAE,UAAU,EAAE,OAAO,CAAC,gBAAgB,EAAE,CAAC;IAC9F;AACA,IAAA,IAAI,OAAO,CAAC,cAAc,EAAE;AAC3B,QAAA,SAAS,CAAC,IAAI,CAAC,EAAE,OAAO,EAAE,gBAAgB,EAAE,QAAQ,EAAE,OAAO,CAAC,cAAc,EAAE,CAAC;IAChF;AACA,IAAA,IAAI,QAAQ,CAAC,OAAO,CAAC,wBAAwB,CAAC,EAAE;AAC/C,QAAA,SAAS,CAAC,IAAI,CAAC,EAAE,OAAO,EAAE,6BAA6B,EAAE,QAAQ,EAAE,OAAO,CAAC,wBAAwB,EAAE,CAAC;IACvG;AAEA,IAAA,OAAO,SAAS;AACjB;;ACxHA;;AAEG;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lucca-front/ng",
|
|
3
|
-
"version": "21.3.0-rc.
|
|
3
|
+
"version": "21.3.0-rc.6",
|
|
4
4
|
"description": "A library of icons made by the team @Lucca",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -28,9 +28,9 @@
|
|
|
28
28
|
"@angular/core": "^21.2.4",
|
|
29
29
|
"@angular/cdk": "^21.0.0",
|
|
30
30
|
"@angular/animations": "^21.0.0",
|
|
31
|
-
"@lucca-front/icons": "21.3.0-rc.
|
|
32
|
-
"@lucca-front/scss": "21.3.0-rc.
|
|
33
|
-
"@lucca/prisme": "21.3.0-rc.
|
|
31
|
+
"@lucca-front/icons": "21.3.0-rc.6",
|
|
32
|
+
"@lucca-front/scss": "21.3.0-rc.6",
|
|
33
|
+
"@lucca/prisme": "21.3.0-rc.6",
|
|
34
34
|
"@types/dompurify": "^3.0.0",
|
|
35
35
|
"isomorphic-dompurify": "^2.17.0",
|
|
36
36
|
"date-fns": "^3.6.0",
|
|
@@ -41,6 +41,11 @@
|
|
|
41
41
|
"factory": "./component-path/index",
|
|
42
42
|
"schema": "./component-path/schema.json"
|
|
43
43
|
},
|
|
44
|
+
"deprecated-resolver": {
|
|
45
|
+
"description": "Migrate deprecated NgModules, types and input output.",
|
|
46
|
+
"factory": "./deprecated-resolver/index",
|
|
47
|
+
"schema": "./deprecated-resolver/schema.json"
|
|
48
|
+
},
|
|
44
49
|
"tokens-typo": {
|
|
45
50
|
"description": "Replace typography tokens with new names.",
|
|
46
51
|
"factory": "./tokens-typo/index",
|
|
@@ -86,6 +91,11 @@
|
|
|
86
91
|
"factory": "./lu-container/index",
|
|
87
92
|
"schema": "./lu-container/schema.json"
|
|
88
93
|
},
|
|
94
|
+
"lu-grid": {
|
|
95
|
+
"description": "Migrate HTML grid to the new lu-grid component",
|
|
96
|
+
"factory": "./lu-grid/index",
|
|
97
|
+
"schema": "./lu-grid/schema.json"
|
|
98
|
+
},
|
|
89
99
|
"lu-button": {
|
|
90
100
|
"description": "Migrate CSS-only buttons to the new luButton component",
|
|
91
101
|
"factory": "./lu-button/index",
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const lib_1 = require("../lib");
|
|
4
|
+
// Nx need to see "@angular-devkit/schematics" in order to run this migration correctly (see https://github.com/nrwl/nx/blob/d9fed4b832bf01d1b9a44ae9e486a5e5cd2d2253/packages/nx/src/command-line/migrate/migrate.ts#L1729-L1738)
|
|
5
|
+
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
6
|
+
require('@angular-devkit/schematics');
|
|
7
|
+
exports.default = (options) => {
|
|
8
|
+
return async (tree, context) => {
|
|
9
|
+
await lib_1.currentSchematicContext.init(context, options);
|
|
10
|
+
new lib_1.DeprecatedMapper(tree, {
|
|
11
|
+
modules: {
|
|
12
|
+
// LuDateModule
|
|
13
|
+
LuDatePickerModule: 'LuDatePickerComponent',
|
|
14
|
+
LuDateSelectInputModule: 'LuDateSelectInputComponent',
|
|
15
|
+
LuDateAdapterModule: 'LuDateAdapterPipe',
|
|
16
|
+
// LuApiModule
|
|
17
|
+
LuApiSelectInputModule: 'LuApiSelectInputComponent',
|
|
18
|
+
// LuDropdownModule
|
|
19
|
+
LuDropdownPanelModule: 'LuDropdownPanelComponent',
|
|
20
|
+
LuDropdownItemModule: 'LuDropdownItemDirective',
|
|
21
|
+
LuDropdownTriggerModule: 'LuDropdownTriggerDirective',
|
|
22
|
+
// LuDepartmentModule
|
|
23
|
+
LuDepartmentSelectInputModule: 'LuDepartmentSelectInputComponent',
|
|
24
|
+
// LuEstablishmentModule
|
|
25
|
+
LuEstablishmentSelectInputModule: 'LuEstablishmentSelectInputComponent',
|
|
26
|
+
// LuUserModule
|
|
27
|
+
LuUserSelectInputModule: 'LuUserSelectInputComponent',
|
|
28
|
+
LuUserDisplayModule: 'LuUserDisplayPipe',
|
|
29
|
+
LuUserPictureModule: 'LuUserPictureComponent',
|
|
30
|
+
LuUserTileModule: 'LuUserTileComponent',
|
|
31
|
+
LuUserMeOptionModule: 'LuUserMeOptionDirective',
|
|
32
|
+
LuUserSearcherModule: 'LuUserPagedSearcherComponent',
|
|
33
|
+
// LuOptionModule
|
|
34
|
+
LuOptionItemModule: 'LuOptionItemComponent',
|
|
35
|
+
LuOptionFeederModule: 'LuOptionFeederComponent',
|
|
36
|
+
LuOptionPagerModule: 'LuOptionPagerComponent',
|
|
37
|
+
LuOptionSearcherModule: 'LuOptionSearcherComponent',
|
|
38
|
+
LuOptionSelectAllModule: 'LuOptionSelectAllComponent',
|
|
39
|
+
LuForOptionsModule: 'LuForOptionsDirective',
|
|
40
|
+
// LuTreeOptionModule
|
|
41
|
+
LuTreeOptionItemModule: 'LuTreeOptionItemComponent',
|
|
42
|
+
LuTreeOptionFeederModule: 'LuTreeOptionFeederComponent',
|
|
43
|
+
LuForTreeOptionsModule: 'LuForTreeOptionsDirective',
|
|
44
|
+
LuTreeOptionSearcherModule: 'LuTreeOptionSearcherComponent',
|
|
45
|
+
// LuPopoverModule
|
|
46
|
+
LuPopoverPanelModule: 'LuPopoverPanelComponent',
|
|
47
|
+
// LuTooltipModule
|
|
48
|
+
LuTooltipTriggerModule: 'LuTooltipTriggerDirective',
|
|
49
|
+
// LuInputModule
|
|
50
|
+
LuInputClearerModule: 'LuInputClearerComponent',
|
|
51
|
+
LuInputDisplayerModule: 'LuInputDisplayerDirective',
|
|
52
|
+
// NgModules simples
|
|
53
|
+
LuToastsModule: 'LuToastsComponent',
|
|
54
|
+
LuNumberModule: 'LuNumberPipe',
|
|
55
|
+
LuScrollModule: 'LuScrollDirective',
|
|
56
|
+
LuSafeContentModule: 'LuSafeHtmlPipe',
|
|
57
|
+
},
|
|
58
|
+
types: {
|
|
59
|
+
ILuTranslation: 'LuTranslation',
|
|
60
|
+
},
|
|
61
|
+
inputsOutputs: {
|
|
62
|
+
'lu-divider': { withRole: '' },
|
|
63
|
+
'button': { delete: 'critical' },
|
|
64
|
+
'lu-loading': { type: { fullpage: 'fullPage' } },
|
|
65
|
+
'lu-single-file-upload': { illustration: { paper: 'invoice' } },
|
|
66
|
+
'lu-highlight-data': { icon: { 'manifying-glass': 'magnifying-glass' } },
|
|
67
|
+
},
|
|
68
|
+
}).run();
|
|
69
|
+
};
|
|
70
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const fs = require("fs");
|
|
4
|
+
const path = require("path");
|
|
5
|
+
const lib_1 = require("../lib");
|
|
6
|
+
const collectionPath = path.normalize(path.join(__dirname, '..', 'collection.json'));
|
|
7
|
+
const testsRoot = path.join(__dirname, 'tests');
|
|
8
|
+
const files = fs.readdirSync(testsRoot);
|
|
9
|
+
describe('Deprecated Resolver Migration', () => {
|
|
10
|
+
it('should rename deprecated module, type identifiers and inputOutput ', async () => {
|
|
11
|
+
// Arrange
|
|
12
|
+
const tree = (0, lib_1.createTreeFromFiles)(testsRoot, files, '.input.');
|
|
13
|
+
const expectedTree = (0, lib_1.createTreeFromFiles)(testsRoot, files, '.output.');
|
|
14
|
+
// Act
|
|
15
|
+
try {
|
|
16
|
+
await (0, lib_1.runSchematic)('collection', collectionPath, 'deprecated-resolver', { skipInstallation: true }, tree);
|
|
17
|
+
}
|
|
18
|
+
catch (error) {
|
|
19
|
+
// eslint-disable-next-line no-console
|
|
20
|
+
console.log(error);
|
|
21
|
+
}
|
|
22
|
+
// Assert
|
|
23
|
+
(0, lib_1.expectTree)(tree).toMatchTree(expectedTree);
|
|
24
|
+
});
|
|
25
|
+
});
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema",
|
|
3
|
+
"$id": "LuccaFrontDeprecatedResolver",
|
|
4
|
+
"title": "Lucca Front Deprecated Resolver Schema",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"properties": {
|
|
7
|
+
"dryRun": {
|
|
8
|
+
"type": "boolean",
|
|
9
|
+
"description": "Run through the migration without making any changes.",
|
|
10
|
+
"default": false
|
|
11
|
+
},
|
|
12
|
+
"skipInstall": {
|
|
13
|
+
"type": "boolean",
|
|
14
|
+
"description": "Skip installing dependencies.",
|
|
15
|
+
"default": false
|
|
16
|
+
},
|
|
17
|
+
"verbose": {
|
|
18
|
+
"type": "boolean",
|
|
19
|
+
"description": "Enable verbose logging.",
|
|
20
|
+
"default": false
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DeprecatedMapper = void 0;
|
|
4
|
+
const typescript_1 = require("typescript");
|
|
5
|
+
const angular_template_1 = require("./angular-template");
|
|
6
|
+
const file_update_1 = require("./file-update");
|
|
7
|
+
const html_ast_1 = require("./html-ast");
|
|
8
|
+
const schematics_1 = require("./schematics");
|
|
9
|
+
class DeprecatedMapper {
|
|
10
|
+
constructor(tree, mappings) {
|
|
11
|
+
this.tree = tree;
|
|
12
|
+
this.mappings = mappings;
|
|
13
|
+
this.allIdentifierMappings = { ...mappings.modules, ...mappings.types };
|
|
14
|
+
this.hasTemplateMigrations = Object.keys(mappings.inputsOutputs).length > 0;
|
|
15
|
+
}
|
|
16
|
+
run() {
|
|
17
|
+
this.tree.visit((path, entry) => {
|
|
18
|
+
if (path.includes('node_modules') || !entry) {
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
if (path.endsWith('.ts') && !path.endsWith('.d.ts')) {
|
|
22
|
+
(0, schematics_1.migrateFile)(path, entry, this.tree, (content) => this.migrateTsFile(path, content));
|
|
23
|
+
}
|
|
24
|
+
else if (path.endsWith('.html') && this.hasTemplateMigrations) {
|
|
25
|
+
(0, schematics_1.migrateFile)(path, entry, this.tree, (content) => this.migrateTemplate(content));
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
migrateTsFile(fileName, content) {
|
|
30
|
+
// 1. Rename TypeScript identifiers (modules & types mappings)
|
|
31
|
+
let result = this.migrateTsIdentifiers(fileName, content);
|
|
32
|
+
// 2. Apply inputsOutputs migrations to any inline Angular template
|
|
33
|
+
if (this.hasTemplateMigrations) {
|
|
34
|
+
result = (0, angular_template_1.updateAngularTemplate)(fileName, result, (template) => this.migrateTemplate(template));
|
|
35
|
+
}
|
|
36
|
+
return result;
|
|
37
|
+
}
|
|
38
|
+
migrateTsIdentifiers(fileName, content) {
|
|
39
|
+
const sourceFile = (0, typescript_1.createSourceFile)(fileName, content, typescript_1.ScriptTarget.ESNext);
|
|
40
|
+
const updates = [];
|
|
41
|
+
(0, typescript_1.forEachChild)(sourceFile, (0, angular_template_1.createVisitor)(typescript_1.isIdentifier, (node) => {
|
|
42
|
+
const newName = this.allIdentifierMappings[node.text];
|
|
43
|
+
if (newName !== undefined && newName !== node.text) {
|
|
44
|
+
updates.push({
|
|
45
|
+
position: node.getStart(sourceFile),
|
|
46
|
+
oldContent: node.text,
|
|
47
|
+
newContent: newName,
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
}));
|
|
51
|
+
return (0, file_update_1.applyUpdates)(content, updates);
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Applies all `inputsOutputs` migrations to a template string.
|
|
55
|
+
* Works on both standalone `.html` content and inline template strings extracted from `.ts` files.
|
|
56
|
+
*/
|
|
57
|
+
migrateTemplate(template) {
|
|
58
|
+
let result = template;
|
|
59
|
+
for (const [selector, inputs] of Object.entries(this.mappings.inputsOutputs)) {
|
|
60
|
+
for (const [inputName, migration] of Object.entries(inputs)) {
|
|
61
|
+
if (migration === '') {
|
|
62
|
+
result = this.removeAttribute(result, selector, inputName);
|
|
63
|
+
}
|
|
64
|
+
else if (typeof migration === 'string') {
|
|
65
|
+
result = (0, angular_template_1.replaceComponentInputName)(selector, inputName, migration, result);
|
|
66
|
+
}
|
|
67
|
+
else {
|
|
68
|
+
result = (0, angular_template_1.replaceComponentInput)(selector, inputName, migration, result);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
return result;
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Removes all occurrences of a static or bound attribute on elements matching the given selector.
|
|
76
|
+
*
|
|
77
|
+
* Handles:
|
|
78
|
+
* - Static boolean: `<lu-divider withRole>`
|
|
79
|
+
* - Static with value: `<lu-divider withRole="true">`
|
|
80
|
+
* - One-way bound: `<lu-divider [withRole]="expr">`
|
|
81
|
+
*
|
|
82
|
+
* The preceding whitespace is included in the removal to keep the markup clean.
|
|
83
|
+
*/
|
|
84
|
+
removeAttribute(template, selector, attrName) {
|
|
85
|
+
return (0, file_update_1.updateContent)(template, (updates) => {
|
|
86
|
+
const htmlAst = new html_ast_1.HtmlAst(template);
|
|
87
|
+
htmlAst.visitElements(selector, (el) => {
|
|
88
|
+
const elAst = new html_ast_1.HtmlAstVisitor(el);
|
|
89
|
+
// Static text attribute: `attrName` (boolean) or `attrName="value"`
|
|
90
|
+
elAst.visitAttribute(attrName, (attr) => {
|
|
91
|
+
const from = attr.sourceSpan.start.offset;
|
|
92
|
+
const to = attr.sourceSpan.end.offset;
|
|
93
|
+
const hasLeadingSpace = from > 0 && template[from - 1] === ' ';
|
|
94
|
+
const removeFrom = hasLeadingSpace ? from - 1 : from;
|
|
95
|
+
updates.push({ position: removeFrom, oldContent: template.slice(removeFrom, to), newContent: '' });
|
|
96
|
+
});
|
|
97
|
+
// Bound attribute: `[attrName]="expr"`
|
|
98
|
+
elAst.visitBoundAttribute(attrName, (attr) => {
|
|
99
|
+
const from = attr.sourceSpan.start.offset;
|
|
100
|
+
const to = attr.sourceSpan.end.offset;
|
|
101
|
+
const hasLeadingSpace = from > 0 && template[from - 1] === ' ';
|
|
102
|
+
const removeFrom = hasLeadingSpace ? from - 1 : from;
|
|
103
|
+
updates.push({ position: removeFrom, oldContent: template.slice(removeFrom, to), newContent: '' });
|
|
104
|
+
});
|
|
105
|
+
});
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
exports.DeprecatedMapper = DeprecatedMapper;
|
package/schematics/lib/index.js
CHANGED
|
@@ -17,6 +17,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
17
17
|
__exportStar(require("./angular-component-ast"), exports);
|
|
18
18
|
__exportStar(require("./angular-template"), exports);
|
|
19
19
|
__exportStar(require("./component-mapper"), exports);
|
|
20
|
+
__exportStar(require("./deprecated-mapper"), exports);
|
|
20
21
|
__exportStar(require("./css-mapper"), exports);
|
|
21
22
|
__exportStar(require("./file-update"), exports);
|
|
22
23
|
__exportStar(require("./html-ast"), exports);
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const typescript_1 = require("typescript");
|
|
4
|
+
const lib_1 = require("../lib");
|
|
5
|
+
const migration_1 = require("./migration");
|
|
6
|
+
// Nx need to see "@angular-devkit/schematics" in order to run this migration correctly (see https://github.com/nrwl/nx/blob/d9fed4b832bf01d1b9a44ae9e486a5e5cd2d2253/packages/nx/src/command-line/migrate/migrate.ts#L1729-L1738)
|
|
7
|
+
require('@angular-devkit/schematics');
|
|
8
|
+
exports.default = (options) => {
|
|
9
|
+
return async (tree, context) => {
|
|
10
|
+
await lib_1.currentSchematicContext.init(context, options);
|
|
11
|
+
tree.visit((path, entry) => {
|
|
12
|
+
if (path.includes('node_modules') || !entry) {
|
|
13
|
+
return;
|
|
14
|
+
}
|
|
15
|
+
if (path.endsWith('.ts') && !path.endsWith('.d.ts')) {
|
|
16
|
+
(0, lib_1.migrateFile)(path, entry, tree, (content) => {
|
|
17
|
+
const sourceFile = (0, typescript_1.createSourceFile)(path, content, typescript_1.ScriptTarget.ESNext);
|
|
18
|
+
return (0, migration_1.migrateComponent)(sourceFile, path, tree);
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
};
|
|
@@ -0,0 +1,264 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.migrateComponent = migrateComponent;
|
|
4
|
+
const change_1 = require("@schematics/angular/utility/change");
|
|
5
|
+
const lib_1 = require("../lib");
|
|
6
|
+
// --- CSS custom properties helpers ---
|
|
7
|
+
function parseCssCustomProperties(style) {
|
|
8
|
+
const result = {};
|
|
9
|
+
style.split(';').map((p) => p.trim()).filter(Boolean).forEach((part) => {
|
|
10
|
+
const colonIdx = part.indexOf(':');
|
|
11
|
+
if (colonIdx === -1) {
|
|
12
|
+
return;
|
|
13
|
+
}
|
|
14
|
+
const prop = part.substring(0, colonIdx).trim();
|
|
15
|
+
const value = part.substring(colonIdx + 1).trim();
|
|
16
|
+
result[prop] = value;
|
|
17
|
+
});
|
|
18
|
+
return result;
|
|
19
|
+
}
|
|
20
|
+
// CSS custom properties that map directly to GridColumnComponent inputs
|
|
21
|
+
const GRID_COLUMN_DIRECT_PROPS = {
|
|
22
|
+
'--grid-colspan': 'colspan',
|
|
23
|
+
'--grid-rowspan': 'rowspan',
|
|
24
|
+
'--grid-column': 'column',
|
|
25
|
+
'--grid-row': 'row',
|
|
26
|
+
'--grid-justify': 'justify',
|
|
27
|
+
'--grid-align': 'align',
|
|
28
|
+
};
|
|
29
|
+
// Prefix for responsive CSS custom properties
|
|
30
|
+
const RESPONSIVE_PREFIX = '--grid-';
|
|
31
|
+
function extractGridColumnInputs(style) {
|
|
32
|
+
const cssProps = parseCssCustomProperties(style);
|
|
33
|
+
const inputs = {};
|
|
34
|
+
const responsive = {};
|
|
35
|
+
const remaining = [];
|
|
36
|
+
for (const [prop, value] of Object.entries(cssProps)) {
|
|
37
|
+
if (GRID_COLUMN_DIRECT_PROPS[prop]) {
|
|
38
|
+
inputs[GRID_COLUMN_DIRECT_PROPS[prop]] = value;
|
|
39
|
+
}
|
|
40
|
+
else if (prop.startsWith(RESPONSIVE_PREFIX) && prop.includes('AtMedia')) {
|
|
41
|
+
// e.g. --grid-colspanAtMediaMinXS → colspanAtMediaMinXS
|
|
42
|
+
const key = prop.substring(RESPONSIVE_PREFIX.length);
|
|
43
|
+
responsive[key] = value;
|
|
44
|
+
}
|
|
45
|
+
else if (prop.startsWith('--grid-')) {
|
|
46
|
+
// Unknown grid property — drop it (it was grid-specific)
|
|
47
|
+
}
|
|
48
|
+
else {
|
|
49
|
+
remaining.push(`${prop}: ${value}`);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
if (Object.keys(responsive).length > 0) {
|
|
53
|
+
inputs.responsive = responsive;
|
|
54
|
+
}
|
|
55
|
+
return { inputs, remainingStyle: remaining.join('; ') };
|
|
56
|
+
}
|
|
57
|
+
// --- Main migration ---
|
|
58
|
+
function migrateComponent(sourceFile, path, tree) {
|
|
59
|
+
const htmlGrids = findHTMLGrids(sourceFile, path, tree);
|
|
60
|
+
const htmlGridColumns = findHTMLGridColumns(sourceFile, path, tree);
|
|
61
|
+
if (htmlGrids.length === 0 && htmlGridColumns.length === 0) {
|
|
62
|
+
return tree.readText(path);
|
|
63
|
+
}
|
|
64
|
+
const tsUpdate = tree.beginUpdate(path);
|
|
65
|
+
const firstItem = htmlGrids[0] || htmlGridColumns[0];
|
|
66
|
+
const isInlineTemplate = firstItem.filePath === path;
|
|
67
|
+
const templateUpdate = isInlineTemplate ? tsUpdate : tree.beginUpdate(firstItem.filePath);
|
|
68
|
+
htmlGrids.forEach((grid) => migrateGridNode(grid, templateUpdate));
|
|
69
|
+
htmlGridColumns.forEach((col) => migrateGridColumnNode(col, templateUpdate));
|
|
70
|
+
const changesToApply = [];
|
|
71
|
+
if (htmlGrids.length > 0) {
|
|
72
|
+
changesToApply.push((0, lib_1.insertTSImportIfNeeded)(sourceFile, path, 'GridComponent', '@lucca-front/ng/grid'), (0, lib_1.insertAngularImportIfNeeded)(sourceFile, path, 'GridComponent'));
|
|
73
|
+
}
|
|
74
|
+
if (htmlGridColumns.length > 0) {
|
|
75
|
+
changesToApply.push((0, lib_1.insertTSImportIfNeeded)(sourceFile, path, 'GridColumnComponent', '@lucca-front/ng/grid'), (0, lib_1.insertAngularImportIfNeeded)(sourceFile, path, 'GridColumnComponent'));
|
|
76
|
+
}
|
|
77
|
+
(0, change_1.applyToUpdateRecorder)(tsUpdate, changesToApply);
|
|
78
|
+
tree.commitUpdate(tsUpdate);
|
|
79
|
+
if (!isInlineTemplate) {
|
|
80
|
+
tree.commitUpdate(templateUpdate);
|
|
81
|
+
}
|
|
82
|
+
return tree.readText(path);
|
|
83
|
+
}
|
|
84
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
85
|
+
function migrateGridNode(grid, templateUpdate) {
|
|
86
|
+
const { node, nodeOffset, inputs } = grid;
|
|
87
|
+
const divLength = node.name.length; // 'div'
|
|
88
|
+
const classesNode = node.attributes.find((attr) => attr.name === 'class');
|
|
89
|
+
const styleNode = node.attributes.find((attr) => attr.name === 'style');
|
|
90
|
+
// Build inputs string (everything that comes after the element name)
|
|
91
|
+
let thingsToAdd = 'lu-grid';
|
|
92
|
+
if (inputs.mode) {
|
|
93
|
+
thingsToAdd += ` mode="${inputs.mode}"`;
|
|
94
|
+
}
|
|
95
|
+
if (inputs.columns) {
|
|
96
|
+
thingsToAdd += ` columns="${inputs.columns}"`;
|
|
97
|
+
}
|
|
98
|
+
// Remove element name 'div'
|
|
99
|
+
templateUpdate.remove(nodeOffset + node.startSourceSpan.start.offset + 1, divLength);
|
|
100
|
+
if (node.children.length > 0 && node.endSourceSpan) {
|
|
101
|
+
// Has children — replace end tag
|
|
102
|
+
templateUpdate.remove(nodeOffset + node.endSourceSpan.start.offset + 1, divLength + 1);
|
|
103
|
+
templateUpdate.insertRight(nodeOffset + node.startSourceSpan.start.offset + 1, thingsToAdd);
|
|
104
|
+
templateUpdate.insertLeft(nodeOffset + node.endSourceSpan.start.offset + 1, '/lu-grid');
|
|
105
|
+
}
|
|
106
|
+
else if (!node.isSelfClosing) {
|
|
107
|
+
// Empty, not self-closing
|
|
108
|
+
const endSpanOffset = node.endSourceSpan?.start.offset || -1;
|
|
109
|
+
templateUpdate.remove(nodeOffset + node.startSourceSpan.end.offset, endSpanOffset - node.startSourceSpan.end.offset);
|
|
110
|
+
if (node.endSourceSpan?.start?.offset) {
|
|
111
|
+
templateUpdate.remove(nodeOffset + node.endSourceSpan.start.offset, node.endSourceSpan.toString().length);
|
|
112
|
+
}
|
|
113
|
+
templateUpdate.insertRight(nodeOffset + node.startSourceSpan.start.offset + 1, thingsToAdd);
|
|
114
|
+
templateUpdate.insertRight(nodeOffset + node.startSourceSpan.end.offset - 1, ` /`);
|
|
115
|
+
}
|
|
116
|
+
// Modify class attribute — remove 'grid' and mode-related classes
|
|
117
|
+
if (classesNode && classesNode.keySpan) {
|
|
118
|
+
const classes = classesNode.value;
|
|
119
|
+
const cleanedClasses = classes.split(' ').filter((c) => c !== 'grid' && c !== 'mod-auto').join(' ');
|
|
120
|
+
templateUpdate.remove(nodeOffset + classesNode.keySpan.start.offset - 1, classesNode.sourceSpan.toString().length + 1);
|
|
121
|
+
if (cleanedClasses) {
|
|
122
|
+
templateUpdate.insertRight(nodeOffset + classesNode.keySpan.start.offset, ` class="${cleanedClasses}"`);
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
// Modify style attribute — remove --grid-columns, keep the rest
|
|
126
|
+
if (styleNode && styleNode.keySpan) {
|
|
127
|
+
const cssProps = parseCssCustomProperties(styleNode.value);
|
|
128
|
+
const remaining = Object.entries(cssProps)
|
|
129
|
+
.filter(([key]) => key !== '--grid-columns')
|
|
130
|
+
.map(([key, val]) => `${key}: ${val}`)
|
|
131
|
+
.join('; ');
|
|
132
|
+
templateUpdate.remove(nodeOffset + styleNode.keySpan.start.offset - 1, styleNode.sourceSpan.toString().length + 1);
|
|
133
|
+
if (remaining) {
|
|
134
|
+
templateUpdate.insertRight(nodeOffset + styleNode.keySpan.start.offset, ` style="${remaining}"`);
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
139
|
+
function migrateGridColumnNode(col, templateUpdate) {
|
|
140
|
+
const { node, nodeOffset, inputs, remainingStyle, extraClasses } = col;
|
|
141
|
+
const divLength = node.name.length; // 'div'
|
|
142
|
+
const classesNode = node.attributes.find((attr) => attr.name === 'class');
|
|
143
|
+
const styleNode = node.attributes.find((attr) => attr.name === 'style');
|
|
144
|
+
// Build inputs string
|
|
145
|
+
let thingsToAdd = 'lu-grid-column';
|
|
146
|
+
if (inputs.colspan) {
|
|
147
|
+
thingsToAdd += ` colspan="${inputs.colspan}"`;
|
|
148
|
+
}
|
|
149
|
+
if (inputs.rowspan) {
|
|
150
|
+
thingsToAdd += ` rowspan="${inputs.rowspan}"`;
|
|
151
|
+
}
|
|
152
|
+
if (inputs.column) {
|
|
153
|
+
thingsToAdd += ` column="${inputs.column}"`;
|
|
154
|
+
}
|
|
155
|
+
if (inputs.row) {
|
|
156
|
+
thingsToAdd += ` row="${inputs.row}"`;
|
|
157
|
+
}
|
|
158
|
+
if (inputs.justify) {
|
|
159
|
+
thingsToAdd += ` justify="${inputs.justify}"`;
|
|
160
|
+
}
|
|
161
|
+
if (inputs.align) {
|
|
162
|
+
thingsToAdd += ` align="${inputs.align}"`;
|
|
163
|
+
}
|
|
164
|
+
if (inputs.responsive) {
|
|
165
|
+
const responsiveEntries = Object.entries(inputs.responsive)
|
|
166
|
+
.map(([key, val]) => `${key}: ${val}`)
|
|
167
|
+
.join(', ');
|
|
168
|
+
thingsToAdd += ` [responsive]="{ ${responsiveEntries} }"`;
|
|
169
|
+
}
|
|
170
|
+
// Remove element name 'div'
|
|
171
|
+
templateUpdate.remove(nodeOffset + node.startSourceSpan.start.offset + 1, divLength);
|
|
172
|
+
if (node.children.length > 0 && node.endSourceSpan) {
|
|
173
|
+
templateUpdate.remove(nodeOffset + node.endSourceSpan.start.offset + 1, divLength + 1);
|
|
174
|
+
templateUpdate.insertRight(nodeOffset + node.startSourceSpan.start.offset + 1, thingsToAdd);
|
|
175
|
+
templateUpdate.insertLeft(nodeOffset + node.endSourceSpan.start.offset + 1, '/lu-grid-column');
|
|
176
|
+
}
|
|
177
|
+
else if (!node.isSelfClosing) {
|
|
178
|
+
const endSpanOffset = node.endSourceSpan?.start.offset || -1;
|
|
179
|
+
templateUpdate.remove(nodeOffset + node.startSourceSpan.end.offset, endSpanOffset - node.startSourceSpan.end.offset);
|
|
180
|
+
if (node.endSourceSpan?.start?.offset) {
|
|
181
|
+
templateUpdate.remove(nodeOffset + node.endSourceSpan.start.offset, node.endSourceSpan.toString().length);
|
|
182
|
+
}
|
|
183
|
+
templateUpdate.insertRight(nodeOffset + node.startSourceSpan.start.offset + 1, thingsToAdd);
|
|
184
|
+
templateUpdate.insertRight(nodeOffset + node.startSourceSpan.end.offset - 1, ` /`);
|
|
185
|
+
}
|
|
186
|
+
// Class attribute: remove 'grid-column', keep extra classes
|
|
187
|
+
if (classesNode && classesNode.keySpan) {
|
|
188
|
+
templateUpdate.remove(nodeOffset + classesNode.keySpan.start.offset - 1, classesNode.sourceSpan.toString().length + 1);
|
|
189
|
+
if (extraClasses) {
|
|
190
|
+
templateUpdate.insertRight(nodeOffset + classesNode.keySpan.start.offset, ` class="${extraClasses}"`);
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
// Style attribute: remove grid-specific properties, keep the rest
|
|
194
|
+
if (styleNode && styleNode.keySpan) {
|
|
195
|
+
templateUpdate.remove(nodeOffset + styleNode.keySpan.start.offset - 1, styleNode.sourceSpan.toString().length + 1);
|
|
196
|
+
if (remainingStyle) {
|
|
197
|
+
templateUpdate.insertRight(nodeOffset + styleNode.keySpan.start.offset, ` style="${remainingStyle}"`);
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
// --- Finders ---
|
|
202
|
+
function findHTMLGrids(sourceFile, basePath, tree) {
|
|
203
|
+
const results = [];
|
|
204
|
+
const ngTemplates = (0, lib_1.extractNgTemplatesIncludingHtml)(sourceFile, tree, basePath);
|
|
205
|
+
ngTemplates.forEach((template) => {
|
|
206
|
+
const htmlAst = new lib_1.HtmlAst(template.content);
|
|
207
|
+
htmlAst.visitNodes((node) => {
|
|
208
|
+
if (!(0, lib_1.isInterestingNode)(node)) {
|
|
209
|
+
return;
|
|
210
|
+
}
|
|
211
|
+
const classes = node.attributes.find((attr) => attr.name === 'class')?.value;
|
|
212
|
+
if (!classes?.match(/(^|\s)grid(\s|$)/)) {
|
|
213
|
+
return;
|
|
214
|
+
}
|
|
215
|
+
const styleAttr = node.attributes.find((attr) => attr.name === 'style')?.value || '';
|
|
216
|
+
const cssProps = parseCssCustomProperties(styleAttr);
|
|
217
|
+
const classParts = classes.split(' ');
|
|
218
|
+
const extraClasses = classParts.filter((c) => c !== 'grid' && c !== 'mod-auto').join(' ');
|
|
219
|
+
const inputs = {
|
|
220
|
+
mode: classParts.includes('mod-auto') ? 'auto' : undefined,
|
|
221
|
+
columns: cssProps['--grid-columns'],
|
|
222
|
+
extraClasses: extraClasses || undefined,
|
|
223
|
+
};
|
|
224
|
+
results.push({
|
|
225
|
+
node,
|
|
226
|
+
inputs,
|
|
227
|
+
nodeOffset: template.offsetStart,
|
|
228
|
+
filePath: template.filePath,
|
|
229
|
+
componentTS: sourceFile,
|
|
230
|
+
});
|
|
231
|
+
});
|
|
232
|
+
});
|
|
233
|
+
return results;
|
|
234
|
+
}
|
|
235
|
+
function findHTMLGridColumns(sourceFile, basePath, tree) {
|
|
236
|
+
const results = [];
|
|
237
|
+
const ngTemplates = (0, lib_1.extractNgTemplatesIncludingHtml)(sourceFile, tree, basePath);
|
|
238
|
+
ngTemplates.forEach((template) => {
|
|
239
|
+
const htmlAst = new lib_1.HtmlAst(template.content);
|
|
240
|
+
htmlAst.visitNodes((node) => {
|
|
241
|
+
if (!(0, lib_1.isInterestingNode)(node)) {
|
|
242
|
+
return;
|
|
243
|
+
}
|
|
244
|
+
const classes = node.attributes.find((attr) => attr.name === 'class')?.value;
|
|
245
|
+
if (!classes?.match(/(^|\s)grid-column(\s|$)/)) {
|
|
246
|
+
return;
|
|
247
|
+
}
|
|
248
|
+
const styleAttr = node.attributes.find((attr) => attr.name === 'style')?.value || '';
|
|
249
|
+
const { inputs, remainingStyle } = extractGridColumnInputs(styleAttr);
|
|
250
|
+
const classParts = classes.split(' ');
|
|
251
|
+
const extraClasses = classParts.filter((c) => c !== 'grid-column').join(' ');
|
|
252
|
+
results.push({
|
|
253
|
+
node,
|
|
254
|
+
inputs,
|
|
255
|
+
remainingStyle: remainingStyle || undefined,
|
|
256
|
+
extraClasses: extraClasses || undefined,
|
|
257
|
+
nodeOffset: template.offsetStart,
|
|
258
|
+
filePath: template.filePath,
|
|
259
|
+
componentTS: sourceFile,
|
|
260
|
+
});
|
|
261
|
+
});
|
|
262
|
+
});
|
|
263
|
+
return results;
|
|
264
|
+
}
|