@taiga-ui/kit 4.52.0-canary.b61d3d0 → 4.52.0-canary.c107f6a

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.
@@ -4,7 +4,7 @@ import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
4
4
  import { ActivatedRoute, Router } from '@angular/router';
5
5
  import { TuiDialogService } from '@taiga-ui/core/components/dialog';
6
6
  import { PolymorpheusComponent } from '@taiga-ui/polymorpheus';
7
- import { from, of, switchMap } from 'rxjs';
7
+ import { from, of, delay, switchMap } from 'rxjs';
8
8
 
9
9
  function tuiGenerateDialogableRoute(component, { path = '', outlet = '', ...dialogOptions } = {}) {
10
10
  return {
@@ -32,7 +32,12 @@ class TuiRoutableDialog {
32
32
  this.dialog = inject(TuiDialogService);
33
33
  const { dialog } = this.route.snapshot.data;
34
34
  from(isClass(dialog) ? of(dialog) : dialog().then((m) => m.default ?? m))
35
- .pipe(switchMap((dialog) => this.dialog.open(new PolymorpheusComponent(dialog, this.injector), this.route.snapshot.data['dialogOptions'])), takeUntilDestroyed())
35
+ .pipe(
36
+ /**
37
+ * All portal hosts are created only after the first render
38
+ * See `@if (top()) {...}` condition in `tui-root`
39
+ */
40
+ delay(0), switchMap((dialog) => this.dialog.open(new PolymorpheusComponent(dialog, this.injector), this.route.snapshot.data['dialogOptions'])), takeUntilDestroyed())
36
41
  .subscribe({ complete: () => this.onDialogClosing() });
37
42
  }
38
43
  get lazyLoadedBackUrl() {
@@ -1 +1 @@
1
- {"version":3,"file":"taiga-ui-kit-components-routable-dialog.mjs","sources":["../../../projects/kit/components/routable-dialog/generate-dialogable-route.ts","../../../projects/kit/components/routable-dialog/routable-dialog.component.ts","../../../projects/kit/components/routable-dialog/taiga-ui-kit-components-routable-dialog.ts"],"sourcesContent":["import {type Type} from '@angular/core';\nimport {type DefaultExport, type Route} from '@angular/router';\nimport {type TuiDialogOptions} from '@taiga-ui/core/components/dialog';\n\nexport function tuiGenerateDialogableRoute<I>(\n component: Type<any> | (() => Promise<DefaultExport<Type<any>> | Type<any>>),\n {\n path = '',\n outlet = '',\n ...dialogOptions\n }: Partial<TuiDialogOptions<I>> & {path?: string; outlet?: string} = {},\n): Route {\n return {\n path,\n outlet,\n loadComponent: async () => import('./routable-dialog.component'),\n data: {\n dialog: component,\n backUrl: path\n .split('/')\n .map(() => '..')\n .join('/'),\n isLazy: path === '',\n dialogOptions,\n },\n };\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n inject,\n INJECTOR,\n type Type,\n} from '@angular/core';\nimport {takeUntilDestroyed} from '@angular/core/rxjs-interop';\nimport {ActivatedRoute, Router} from '@angular/router';\nimport {TuiDialogService} from '@taiga-ui/core/components/dialog';\nimport {PolymorpheusComponent} from '@taiga-ui/polymorpheus';\nimport {from, of, switchMap} from 'rxjs';\n\n@Component({\n selector: 'tui-routable-dialog',\n template: '',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport default class TuiRoutableDialog {\n private readonly route = inject(ActivatedRoute);\n private readonly router = inject(Router);\n private readonly injector = inject(INJECTOR);\n private readonly initialUrl = this.router.url;\n private readonly dialog = inject(TuiDialogService);\n\n constructor() {\n const {dialog} = this.route.snapshot.data;\n\n from(isClass(dialog) ? of(dialog) : dialog().then((m: any) => m.default ?? m))\n .pipe(\n switchMap((dialog: any) =>\n this.dialog.open(\n new PolymorpheusComponent<Type<any>>(dialog, this.injector),\n this.route.snapshot.data['dialogOptions'],\n ),\n ),\n takeUntilDestroyed(),\n )\n .subscribe({complete: () => this.onDialogClosing()});\n }\n\n private get lazyLoadedBackUrl(): string {\n return (this.route.parent?.snapshot.url || []).map(() => '..').join('/');\n }\n\n private onDialogClosing(): void {\n if (this.initialUrl === this.router.url) {\n this.navigateToParent();\n }\n }\n\n private navigateToParent(): void {\n const backUrl = this.route.snapshot.data['isLazy']\n ? this.lazyLoadedBackUrl\n : this.route.snapshot.data['backUrl'];\n\n void this.router.navigate([backUrl], {\n relativeTo: this.route,\n });\n }\n}\n\nfunction isClass(fn: unknown): boolean {\n return (\n typeof fn === 'function' &&\n Object.getOwnPropertyDescriptor(fn, 'prototype')?.writable === false\n );\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;SAIgB,0BAA0B,CACtC,SAA4E,EAC5E,EACI,IAAI,GAAG,EAAE,EACT,MAAM,GAAG,EAAE,EACX,GAAG,aAAa,KACiD,EAAE,EAAA;IAEvE,OAAO;QACH,IAAI;QACJ,MAAM;QACN,aAAa,EAAE,YAAY,wEAAqC;AAChE,QAAA,IAAI,EAAE;AACF,YAAA,MAAM,EAAE,SAAS;AACjB,YAAA,OAAO,EAAE;iBACJ,KAAK,CAAC,GAAG;AACT,iBAAA,GAAG,CAAC,MAAM,IAAI;iBACd,IAAI,CAAC,GAAG,CAAC;YACd,MAAM,EAAE,IAAI,KAAK,EAAE;YACnB,aAAa;AAChB,SAAA;KACJ;AACL;;ACRc,MAAO,iBAAiB,CAAA;AAOlC,IAAA,WAAA,GAAA;AANiB,QAAA,IAAA,CAAA,KAAK,GAAG,MAAM,CAAC,cAAc,CAAC;AAC9B,QAAA,IAAA,CAAA,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;AACvB,QAAA,IAAA,CAAA,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC;AAC3B,QAAA,IAAA,CAAA,UAAU,GAAG,IAAI,CAAC,MAAM,CAAC,GAAG;AAC5B,QAAA,IAAA,CAAA,MAAM,GAAG,MAAM,CAAC,gBAAgB,CAAC;QAG9C,MAAM,EAAC,MAAM,EAAC,GAAG,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI;AAEzC,QAAA,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,GAAG,MAAM,EAAE,CAAC,IAAI,CAAC,CAAC,CAAM,KAAK,CAAC,CAAC,OAAO,IAAI,CAAC,CAAC;AACxE,aAAA,IAA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,IAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA,CAAA;;4FAGK,iBAAiB,EAAA,UAAA,EAAA,CAAA;kBALrC,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACP,oBAAA,QAAQ,EAAE,qBAAqB;AAC/B,oBAAA,QAAQ,EAAE,EAAE;oBACZ,eAAe,EAAE,uBAAuB,CAAC,MAAM;AAClD,iBAAA;;AA6CD,SAAS,OAAO,CAAC,EAAW,EAAA;AACxB,IAAA,QACI,OAAO,EAAE,KAAK,UAAU;AACxB,QAAA,MAAM,CAAC,wBAAwB,CAAC,EAAE,EAAE,WAAW,CAAC,EAAE,QAAQ,KAAK,KAAK;AAE5E;;;;;;;ACnEA;;AAEG;;;;"}
1
+ {"version":3,"file":"taiga-ui-kit-components-routable-dialog.mjs","sources":["../../../projects/kit/components/routable-dialog/generate-dialogable-route.ts","../../../projects/kit/components/routable-dialog/routable-dialog.component.ts","../../../projects/kit/components/routable-dialog/taiga-ui-kit-components-routable-dialog.ts"],"sourcesContent":["import {type Type} from '@angular/core';\nimport {type DefaultExport, type Route} from '@angular/router';\nimport {type TuiDialogOptions} from '@taiga-ui/core/components/dialog';\n\nexport function tuiGenerateDialogableRoute<I>(\n component: Type<any> | (() => Promise<DefaultExport<Type<any>> | Type<any>>),\n {\n path = '',\n outlet = '',\n ...dialogOptions\n }: Partial<TuiDialogOptions<I>> & {path?: string; outlet?: string} = {},\n): Route {\n return {\n path,\n outlet,\n loadComponent: async () => import('./routable-dialog.component'),\n data: {\n dialog: component,\n backUrl: path\n .split('/')\n .map(() => '..')\n .join('/'),\n isLazy: path === '',\n dialogOptions,\n },\n };\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n inject,\n INJECTOR,\n type Type,\n} from '@angular/core';\nimport {takeUntilDestroyed} from '@angular/core/rxjs-interop';\nimport {ActivatedRoute, Router} from '@angular/router';\nimport {TuiDialogService} from '@taiga-ui/core/components/dialog';\nimport {PolymorpheusComponent} from '@taiga-ui/polymorpheus';\nimport {delay, from, of, switchMap} from 'rxjs';\n\n@Component({\n selector: 'tui-routable-dialog',\n template: '',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport default class TuiRoutableDialog {\n private readonly route = inject(ActivatedRoute);\n private readonly router = inject(Router);\n private readonly injector = inject(INJECTOR);\n private readonly initialUrl = this.router.url;\n private readonly dialog = inject(TuiDialogService);\n\n constructor() {\n const {dialog} = this.route.snapshot.data;\n\n from(isClass(dialog) ? of(dialog) : dialog().then((m: any) => m.default ?? m))\n .pipe(\n /**\n * All portal hosts are created only after the first render\n * See `@if (top()) {...}` condition in `tui-root`\n */\n delay(0),\n switchMap((dialog: any) =>\n this.dialog.open(\n new PolymorpheusComponent<Type<any>>(dialog, this.injector),\n this.route.snapshot.data['dialogOptions'],\n ),\n ),\n takeUntilDestroyed(),\n )\n .subscribe({complete: () => this.onDialogClosing()});\n }\n\n private get lazyLoadedBackUrl(): string {\n return (this.route.parent?.snapshot.url || []).map(() => '..').join('/');\n }\n\n private onDialogClosing(): void {\n if (this.initialUrl === this.router.url) {\n this.navigateToParent();\n }\n }\n\n private navigateToParent(): void {\n const backUrl = this.route.snapshot.data['isLazy']\n ? this.lazyLoadedBackUrl\n : this.route.snapshot.data['backUrl'];\n\n void this.router.navigate([backUrl], {\n relativeTo: this.route,\n });\n }\n}\n\nfunction isClass(fn: unknown): boolean {\n return (\n typeof fn === 'function' &&\n Object.getOwnPropertyDescriptor(fn, 'prototype')?.writable === false\n );\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;SAIgB,0BAA0B,CACtC,SAA4E,EAC5E,EACI,IAAI,GAAG,EAAE,EACT,MAAM,GAAG,EAAE,EACX,GAAG,aAAa,KACiD,EAAE,EAAA;IAEvE,OAAO;QACH,IAAI;QACJ,MAAM;QACN,aAAa,EAAE,YAAY,wEAAqC;AAChE,QAAA,IAAI,EAAE;AACF,YAA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K,UAAU;AACxB,QAAA,MAAM,CAAC,wBAAwB,CAAC,EAAE,EAAE,WAAW,CAAC,EAAE,QAAQ,KAAK,KAAK;AAE5E;;;;;;;ACxEA;;AAEG;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@taiga-ui/kit",
3
- "version": "4.52.0-canary.b61d3d0",
3
+ "version": "4.52.0-canary.c107f6a",
4
4
  "description": "Taiga UI Angular main components kit",
5
5
  "keywords": [
6
6
  "angular",
@@ -10,7 +10,10 @@
10
10
  "directive"
11
11
  ],
12
12
  "homepage": "https://github.com/taiga-family/taiga-ui",
13
- "repository": "https://github.com/taiga-family/taiga-ui",
13
+ "repository": {
14
+ "type": "git",
15
+ "url": "https://github.com/taiga-family/taiga-ui"
16
+ },
14
17
  "license": "Apache-2.0",
15
18
  "exports": {
16
19
  "./styles/*": "./styles/*",
@@ -73,17 +76,17 @@
73
76
  "types": "./components/breadcrumbs/index.d.ts",
74
77
  "default": "./fesm2022/taiga-ui-kit-components-breadcrumbs.mjs"
75
78
  },
76
- "./components/calendar-range": {
77
- "types": "./components/calendar-range/index.d.ts",
78
- "default": "./fesm2022/taiga-ui-kit-components-calendar-range.mjs"
79
+ "./components/button-loading": {
80
+ "types": "./components/button-loading/index.d.ts",
81
+ "default": "./fesm2022/taiga-ui-kit-components-button-loading.mjs"
79
82
  },
80
83
  "./components/calendar-month": {
81
84
  "types": "./components/calendar-month/index.d.ts",
82
85
  "default": "./fesm2022/taiga-ui-kit-components-calendar-month.mjs"
83
86
  },
84
- "./components/button-loading": {
85
- "types": "./components/button-loading/index.d.ts",
86
- "default": "./fesm2022/taiga-ui-kit-components-button-loading.mjs"
87
+ "./components/calendar-range": {
88
+ "types": "./components/calendar-range/index.d.ts",
89
+ "default": "./fesm2022/taiga-ui-kit-components-calendar-range.mjs"
87
90
  },
88
91
  "./components/carousel": {
89
92
  "types": "./components/carousel/index.d.ts",
@@ -305,14 +308,14 @@
305
308
  "types": "./components/status/index.d.ts",
306
309
  "default": "./fesm2022/taiga-ui-kit-components-status.mjs"
307
310
  },
308
- "./components/switch": {
309
- "types": "./components/switch/index.d.ts",
310
- "default": "./fesm2022/taiga-ui-kit-components-switch.mjs"
311
- },
312
311
  "./components/stepper": {
313
312
  "types": "./components/stepper/index.d.ts",
314
313
  "default": "./fesm2022/taiga-ui-kit-components-stepper.mjs"
315
314
  },
315
+ "./components/switch": {
316
+ "types": "./components/switch/index.d.ts",
317
+ "default": "./fesm2022/taiga-ui-kit-components-switch.mjs"
318
+ },
316
319
  "./components/tabs": {
317
320
  "types": "./components/tabs/index.d.ts",
318
321
  "default": "./fesm2022/taiga-ui-kit-components-tabs.mjs"
@@ -449,7 +452,7 @@
449
452
  "@ng-web-apis/resize-observer": "^4.12.2",
450
453
  "@taiga-ui/cdk": "^4.52.0",
451
454
  "@taiga-ui/core": "^4.52.0",
452
- "@taiga-ui/design-tokens": "~0.260.0",
455
+ "@taiga-ui/design-tokens": "~0.261.0",
453
456
  "@taiga-ui/i18n": "^4.52.0",
454
457
  "@taiga-ui/polymorpheus": "^4.9.0",
455
458
  "rxjs": ">=7.0.0"