@taiga-ui/addon-doc 2.53.0 → 2.55.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1170,7 +1170,7 @@
1170
1170
  // Ambient type cannot be used without dynamic https://github.com/angular/angular/issues/23395
1171
1171
  // @dynamic
1172
1172
  var TuiDocExampleComponent = /** @class */ (function () {
1173
- function TuiDocExampleComponent(id, clipboard, notifications, location, copyTexts$, texts, codeEditor, processContent, isCypress, codeActions) {
1173
+ function TuiDocExampleComponent(id, clipboard, notifications, location, copyTexts$, texts, codeEditor, processContent, isCypress, codeActions, router, route, ngLocation) {
1174
1174
  var _this = this;
1175
1175
  this.id = id;
1176
1176
  this.clipboard = clipboard;
@@ -1182,6 +1182,9 @@
1182
1182
  this.processContent = processContent;
1183
1183
  this.isCypress = isCypress;
1184
1184
  this.codeActions = codeActions;
1185
+ this.router = router;
1186
+ this.route = route;
1187
+ this.ngLocation = ngLocation;
1185
1188
  this.rawLoader$$ = new rxjs.BehaviorSubject({});
1186
1189
  this.heading = '';
1187
1190
  this.description = '';
@@ -1209,6 +1212,7 @@
1209
1212
  ? this.location.href.slice(0, Math.max(0, hashPosition))
1210
1213
  : this.location.href;
1211
1214
  var url = currentUrl + "#" + this.id;
1215
+ this.setFragmentWithoutRedirect(this.id);
1212
1216
  this.clipboard.copy(url);
1213
1217
  this.notifications
1214
1218
  .show(this.texts[1], {
@@ -1223,6 +1227,12 @@
1223
1227
  this.loading$.next(true);
1224
1228
  (_a = this.codeEditor) === null || _a === void 0 ? void 0 : _a.edit(this.componentName, (_b = this.id) !== null && _b !== void 0 ? _b : '', files).finally(function () { return _this.loading$.next(false); });
1225
1229
  };
1230
+ TuiDocExampleComponent.prototype.setFragmentWithoutRedirect = function (id) {
1231
+ var url = this.router
1232
+ .createUrlTree([], { relativeTo: this.route, fragment: id || '' })
1233
+ .toString();
1234
+ this.ngLocation.go(url);
1235
+ };
1226
1236
  TuiDocExampleComponent.ctorParameters = function () { return [
1227
1237
  { type: String, decorators: [{ type: core.Attribute, args: ['id',] }] },
1228
1238
  { type: clipboard.Clipboard, decorators: [{ type: core.Inject, args: [clipboard.Clipboard,] }] },
@@ -1233,7 +1243,10 @@
1233
1243
  { type: undefined, decorators: [{ type: core.Optional }, { type: core.Inject, args: [TUI_DOC_CODE_EDITOR,] }] },
1234
1244
  { type: undefined, decorators: [{ type: core.Inject, args: [TUI_DOC_EXAMPLE_CONTENT_PROCESSOR,] }] },
1235
1245
  { type: Boolean, decorators: [{ type: core.Inject, args: [cdk.TUI_IS_CYPRESS,] }] },
1236
- { type: Array, decorators: [{ type: core.Inject, args: [TUI_DOC_CODE_ACTIONS,] }] }
1246
+ { type: Array, decorators: [{ type: core.Inject, args: [TUI_DOC_CODE_ACTIONS,] }] },
1247
+ { type: router.Router, decorators: [{ type: core.Inject, args: [router.Router,] }] },
1248
+ { type: router.ActivatedRoute, decorators: [{ type: core.Inject, args: [router.ActivatedRoute,] }] },
1249
+ { type: common.Location, decorators: [{ type: core.Inject, args: [common.Location,] }] }
1237
1250
  ]; };
1238
1251
  __decorate([
1239
1252
  core.Input()
@@ -1264,7 +1277,10 @@
1264
1277
  __param(6, core.Inject(TUI_DOC_CODE_EDITOR)),
1265
1278
  __param(7, core.Inject(TUI_DOC_EXAMPLE_CONTENT_PROCESSOR)),
1266
1279
  __param(8, core.Inject(cdk.TUI_IS_CYPRESS)),
1267
- __param(9, core.Inject(TUI_DOC_CODE_ACTIONS))
1280
+ __param(9, core.Inject(TUI_DOC_CODE_ACTIONS)),
1281
+ __param(10, core.Inject(router.Router)),
1282
+ __param(11, core.Inject(router.ActivatedRoute)),
1283
+ __param(12, core.Inject(common.Location))
1268
1284
  ], TuiDocExampleComponent);
1269
1285
  return TuiDocExampleComponent;
1270
1286
  }());