@taiga-ui/addon-doc 2.45.0 → 2.48.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.
@@ -6,7 +6,7 @@
6
6
 
7
7
  MarkdownIt = MarkdownIt && Object.prototype.hasOwnProperty.call(MarkdownIt, 'default') ? MarkdownIt['default'] : MarkdownIt;
8
8
 
9
- /*! *****************************************************************************
9
+ /******************************************************************************
10
10
  Copyright (c) Microsoft Corporation.
11
11
 
12
12
  Permission to use, copy, modify, and/or distribute this software for any
@@ -25,11 +25,13 @@
25
25
  var extendStatics = function(d, b) {
26
26
  extendStatics = Object.setPrototypeOf ||
27
27
  ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
28
- function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
28
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
29
29
  return extendStatics(d, b);
30
30
  };
31
31
 
32
32
  function __extends(d, b) {
33
+ if (typeof b !== "function" && b !== null)
34
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
33
35
  extendStatics(d, b);
34
36
  function __() { this.constructor = d; }
35
37
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
@@ -111,13 +113,20 @@
111
113
  }
112
114
  }
113
115
 
114
- function __createBinding(o, m, k, k2) {
116
+ var __createBinding = Object.create ? (function(o, m, k, k2) {
117
+ if (k2 === undefined) k2 = k;
118
+ var desc = Object.getOwnPropertyDescriptor(m, k);
119
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
120
+ desc = { enumerable: true, get: function() { return m[k]; } };
121
+ }
122
+ Object.defineProperty(o, k2, desc);
123
+ }) : (function(o, m, k, k2) {
115
124
  if (k2 === undefined) k2 = k;
116
125
  o[k2] = m[k];
117
- }
126
+ });
118
127
 
119
- function __exportStar(m, exports) {
120
- for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) exports[p] = m[p];
128
+ function __exportStar(m, o) {
129
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);
121
130
  }
122
131
 
123
132
  function __values(o) {
@@ -149,19 +158,31 @@
149
158
  return ar;
150
159
  }
151
160
 
161
+ /** @deprecated */
152
162
  function __spread() {
153
163
  for (var ar = [], i = 0; i < arguments.length; i++)
154
164
  ar = ar.concat(__read(arguments[i]));
155
165
  return ar;
156
166
  }
157
167
 
168
+ /** @deprecated */
158
169
  function __spreadArrays() {
159
170
  for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
160
171
  for (var r = Array(s), k = 0, i = 0; i < il; i++)
161
172
  for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
162
173
  r[k] = a[j];
163
174
  return r;
164
- };
175
+ }
176
+
177
+ function __spreadArray(to, from, pack) {
178
+ if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
179
+ if (ar || !(i in from)) {
180
+ if (!ar) ar = Array.prototype.slice.call(from, 0, i);
181
+ ar[i] = from[i];
182
+ }
183
+ }
184
+ return to.concat(ar || Array.prototype.slice.call(from));
185
+ }
165
186
 
166
187
  function __await(v) {
167
188
  return this instanceof __await ? (this.v = v, this) : new __await(v);
@@ -198,11 +219,17 @@
198
219
  return cooked;
199
220
  };
200
221
 
222
+ var __setModuleDefault = Object.create ? (function(o, v) {
223
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
224
+ }) : function(o, v) {
225
+ o["default"] = v;
226
+ };
227
+
201
228
  function __importStar(mod) {
202
229
  if (mod && mod.__esModule) return mod;
203
230
  var result = {};
204
- if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
205
- result.default = mod;
231
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
232
+ __setModuleDefault(result, mod);
206
233
  return result;
207
234
  }
208
235
 
@@ -210,19 +237,22 @@
210
237
  return (mod && mod.__esModule) ? mod : { default: mod };
211
238
  }
212
239
 
213
- function __classPrivateFieldGet(receiver, privateMap) {
214
- if (!privateMap.has(receiver)) {
215
- throw new TypeError("attempted to get private field on non-instance");
216
- }
217
- return privateMap.get(receiver);
240
+ function __classPrivateFieldGet(receiver, state, kind, f) {
241
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
242
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
243
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
218
244
  }
219
245
 
220
- function __classPrivateFieldSet(receiver, privateMap, value) {
221
- if (!privateMap.has(receiver)) {
222
- throw new TypeError("attempted to set private field on non-instance");
223
- }
224
- privateMap.set(receiver, value);
225
- return value;
246
+ function __classPrivateFieldSet(receiver, state, value, kind, f) {
247
+ if (kind === "m") throw new TypeError("Private method is not writable");
248
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
249
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
250
+ return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
251
+ }
252
+
253
+ function __classPrivateFieldIn(state, receiver) {
254
+ if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function")) throw new TypeError("Cannot use 'in' operator on non-object");
255
+ return typeof state === "function" ? receiver === state : state.has(receiver);
226
256
  }
227
257
 
228
258
  function rawLoad(content) {
@@ -293,7 +323,7 @@
293
323
  core.Component({
294
324
  selector: 'tui-doc-code',
295
325
  template: "<p\n *ngIf=\"filename\"\n class=\"t-header\"\n>\n {{filename}}\n</p>\n<pre\n *ngFor=\"let content of processor$ | async\"\n class=\"t-code\"\n><code [lineNumbers]=\"true\" [highlight]=\"content\"></code></pre>\n",
296
- styles: [":host{display:block}.t-header{font:var(--tui-font-text-s);font-weight:700}.t-code{margin:0}.t-code+.t-code{margin-top:1rem}.hljs:not(:empty){font:var(--tui-font-text-m);padding:1.5rem 2rem;font-family:monospace;background:var(--tui-clear-disabled);word-wrap:break-word;white-space:pre-wrap}@media all and (-webkit-min-device-pixel-ratio:0) and (min-resolution:0.001dpcm){.hljs:not(:empty)::-webkit-scrollbar,.hljs:not(:empty)::-webkit-scrollbar-thumb{width:1rem;height:1rem;border-radius:6.25rem;background-clip:padding-box;border:6px solid transparent}.hljs:not(:empty)::-webkit-scrollbar{background-color:transparent}.hljs:not(:empty)::-webkit-scrollbar-thumb{background-color:var(--tui-clear-hover)}.hljs:not(:empty)::-webkit-scrollbar-thumb:hover{background-color:var(--tui-clear-active)}.hljs:not(:empty)::-webkit-scrollbar-thumb:active{background-color:var(--tui-text-03)}}:host._has-filename .hljs:not(:empty){border-radius:.75rem}:host-context(tui-root._mobile) .hljs:not(:empty){padding:1rem}"]
326
+ styles: [":host{display:block}.t-header{font:var(--tui-font-text-s);font-weight:700}.t-code{margin:0}.t-code+.t-code{margin-top:1rem}.hljs:not(:empty){font:var(--tui-font-text-m);padding:1.5rem 2rem;font-family:monospace;background:var(--tui-clear-disabled);word-wrap:break-word;white-space:pre-wrap}@media all and (-webkit-min-device-pixel-ratio:0) and (min-resolution:0.001dpcm){.hljs:not(:empty)::-webkit-scrollbar,.hljs:not(:empty)::-webkit-scrollbar-thumb{width:1rem;height:1rem;border-radius:6.25rem;background-clip:padding-box;border:2.667rem solid transparent}.hljs:not(:empty)::-webkit-scrollbar{background-color:transparent}.hljs:not(:empty)::-webkit-scrollbar-thumb{background-color:var(--tui-clear-hover)}.hljs:not(:empty)::-webkit-scrollbar-thumb:hover{background-color:var(--tui-clear-active)}.hljs:not(:empty)::-webkit-scrollbar-thumb:active{background-color:var(--tui-text-03)}}:host._has-filename .hljs:not(:empty){border-radius:.75rem}:host-context(tui-root._mobile) .hljs:not(:empty){padding:1rem}"]
297
327
  })
298
328
  ], TuiDocCodeComponent);
299
329
  return TuiDocCodeComponent;
@@ -684,7 +714,15 @@
684
714
  else if (isNumberParamValue(prepared)) {
685
715
  return Number(prepared);
686
716
  }
687
- return decodeURIComponent(prepared);
717
+ var decodedValue = decodeURIComponent(prepared);
718
+ try {
719
+ return isPossibleArray(decodedValue) || isPossibleObject(decodedValue)
720
+ ? JSON.parse(decodedValue)
721
+ : decodedValue;
722
+ }
723
+ catch (_a) {
724
+ return decodedValue;
725
+ }
688
726
  }
689
727
  function isEmptyParamValue(value) {
690
728
  return ['undefined', 'null', 'NaN', 'Infinity'].includes(value);
@@ -695,6 +733,12 @@
695
733
  function isNumberParamValue(value) {
696
734
  return /^-?[\d.]+(?:e-?\d+)?$/.test(value);
697
735
  }
736
+ function isPossibleArray(value) {
737
+ return value.startsWith('[') && value.endsWith(']');
738
+ }
739
+ function isPossibleObject(value) {
740
+ return value.startsWith('{') && value.endsWith('}');
741
+ }
698
742
 
699
743
  var SERIALIZED_SUFFIX = '$';
700
744
  // @bad TODO: refactor output and value sync
@@ -1166,7 +1210,7 @@
1166
1210
  selector: 'tui-doc-example',
1167
1211
  template: "<h3\n *ngIf=\"heading\"\n class=\"t-title\"\n>\n <span\n polymorpheus-outlet\n [content]=\"heading | tuiDocExampleCapitalize\"\n ></span>\n <button\n *ngIf=\"id\"\n tuiIconButton\n type=\"button\"\n size=\"xs\"\n icon=\"tuiIconLinkLarge\"\n appearance=\"icon\"\n class=\"t-link-icon\"\n [title]=\"copy$ | async\"\n (click)=\"copyExampleLink()\"\n ></button>\n</h3>\n<h4\n *ngIf=\"description\"\n polymorpheus-outlet\n class=\"t-description\"\n [content]=\"description | tuiDocExampleCapitalize\"\n></h4>\n\n<div\n *ngIf=\"processor$ | async as files\"\n class=\"t-example\"\n>\n <ng-container *ngIf=\"files | tuiDocExampleGetTabs: defaultTab as tabs\">\n <div class=\"t-tabs-wrapper\">\n <tui-tabs-with-more\n class=\"t-tabs\"\n [(activeItemIndex)]=\"activeItemIndex\"\n >\n <ng-container *ngFor=\"let tab of tabs\">\n <button\n *tuiTab\n tuiTab\n >\n {{tab}}\n </button>\n </ng-container>\n </tui-tabs-with-more>\n\n <button\n *ngIf=\"codeEditor\"\n tuiButton\n appearance=\"flat\"\n size=\"s\"\n [showLoader]=\"!!(loading$ | async)\"\n (click)=\"edit(files)\"\n >\n Edit on {{codeEditor.name}}\n </button>\n </div>\n\n <div\n *ngFor=\"let tab of tabs; let index = index\"\n class=\"t-content\"\n [class.t-content_animated]=\"!isCypress\"\n [class.t-content_visible]=\"activeItemIndex === index\"\n >\n <ng-container *ngIf=\"index === defaultTabIndex; else anotherTab\">\n <ng-container *ngTemplateOutlet=\"preview\"></ng-container>\n </ng-container>\n <ng-template #anotherTab>\n <ng-container\n *ngTemplateOutlet=\"codeSection; context: { $implicit: files[tabs[activeItemIndex]] || '' }\"\n ></ng-container>\n </ng-template>\n </div>\n </ng-container>\n</div>\n\n<ng-template #preview>\n <div\n automation-id=\"tui-doc-example\"\n class=\"t-demo\"\n >\n <ng-content></ng-content>\n </div>\n</ng-template>\n\n<ng-template\n #codeSection\n let-code\n>\n <tui-doc-copy\n class=\"t-copy-code\"\n [cdkCopyToClipboard]=\"code\"\n ></tui-doc-copy>\n <tui-doc-code [code]=\"code\"></tui-doc-code>\n</ng-template>\n",
1168
1212
  changeDetection: core.ChangeDetectionStrategy.OnPush,
1169
- styles: [":host{position:relative;display:block;padding-top:3.5rem;clear:right}:host :host-context(tui-root._mobile){padding-top:2rem}.t-title{font:var(--tui-font-heading-5);margin:0 0 .5rem}:host-context(tui-root._mobile) .t-title{font:var(--tui-font-heading-6)}.t-description{font:var(--tui-font-text-m);font-weight:400;margin:0}.t-example{position:relative;margin-top:1.5rem;border:1px solid var(--tui-base-03);border-radius:var(--tui-radius-m);box-shadow:0 .125rem .1875rem rgba(0,0,0,.1)}:host-context(tui-root._mobile) .t-example{margin-top:.75rem}.t-tabs-wrapper{display:flex;padding:0 2rem;box-shadow:inset 0 -1px var(--tui-base-03);justify-content:space-between;align-items:center}:host-context(tui-root._mobile) .t-tabs-wrapper{padding:0 1rem}.t-tabs{flex-grow:1}.t-demo{padding:2rem;overflow-x:auto}@media all and (-webkit-min-device-pixel-ratio:0) and (min-resolution:0.001dpcm){.t-demo::-webkit-scrollbar,.t-demo::-webkit-scrollbar-thumb{width:1rem;height:1rem;border-radius:6.25rem;background-clip:padding-box;border:6px solid transparent}.t-demo::-webkit-scrollbar{background-color:transparent}.t-demo::-webkit-scrollbar-thumb{background-color:var(--tui-clear-hover)}.t-demo::-webkit-scrollbar-thumb:hover{background-color:var(--tui-clear-active)}.t-demo::-webkit-scrollbar-thumb:active{background-color:var(--tui-text-03)}}:host-context(tui-root._mobile) .t-demo{padding:1rem}.t-copy-code{position:absolute;top:4.375rem;right:1rem}.t-link-icon{margin-left:.3rem;vertical-align:baseline}.t-content{will-change:opacity;height:0;visibility:hidden;opacity:0}.t-content_animated{transition:opacity .3s ease-in-out}.t-content_visible{height:auto;visibility:visible;opacity:1}"]
1213
+ styles: [":host{position:relative;display:block;padding-top:3.5rem;clear:right}:host :host-context(tui-root._mobile){padding-top:2rem}.t-title{font:var(--tui-font-heading-5);margin:0 0 .5rem}:host-context(tui-root._mobile) .t-title{font:var(--tui-font-heading-6)}.t-description{font:var(--tui-font-text-m);font-weight:400;margin:0}.t-example{position:relative;margin-top:1.5rem;border:1px solid var(--tui-base-03);border-radius:var(--tui-radius-m);box-shadow:0 .125rem .1875rem rgba(0,0,0,.1)}:host-context(tui-root._mobile) .t-example{margin-top:.75rem}.t-tabs-wrapper{display:flex;padding:0 2rem;box-shadow:inset 0 -1px var(--tui-base-03);justify-content:space-between;align-items:center}:host-context(tui-root._mobile) .t-tabs-wrapper{padding:0 1rem}.t-tabs{flex-grow:1}.t-demo{padding:2rem;overflow-x:auto}@media all and (-webkit-min-device-pixel-ratio:0) and (min-resolution:0.001dpcm){.t-demo::-webkit-scrollbar,.t-demo::-webkit-scrollbar-thumb{width:1rem;height:1rem;border-radius:6.25rem;background-clip:padding-box;border:2.667rem solid transparent}.t-demo::-webkit-scrollbar{background-color:transparent}.t-demo::-webkit-scrollbar-thumb{background-color:var(--tui-clear-hover)}.t-demo::-webkit-scrollbar-thumb:hover{background-color:var(--tui-clear-active)}.t-demo::-webkit-scrollbar-thumb:active{background-color:var(--tui-text-03)}}:host-context(tui-root._mobile) .t-demo{padding:1rem}.t-copy-code{position:absolute;top:4.375rem;right:1rem}.t-link-icon{margin-left:.3rem;vertical-align:baseline}.t-content{will-change:opacity;height:0;visibility:hidden;opacity:0}.t-content_animated{transition:opacity .3s ease-in-out}.t-content_visible{height:auto;visibility:visible;opacity:1}"]
1170
1214
  }),
1171
1215
  __param(0, core.Attribute('id')),
1172
1216
  __param(1, core.Inject(clipboard.Clipboard)),
@@ -1269,7 +1313,7 @@
1269
1313
  TuiDocMainComponent = TuiDocMainComponent_1 = __decorate([
1270
1314
  core.Component({
1271
1315
  selector: 'tui-doc-main',
1272
- template: "<tui-theme-night *ngIf=\"night\"></tui-theme-night>\n<tui-root>\n <div class=\"tui-doc-page\">\n <tui-doc-navigation class=\"tui-doc-navigation\">\n <ng-content select=\"tuiDocNavigation\"></ng-content>\n </tui-doc-navigation>\n <div class=\"tui-doc-content\">\n <router-outlet class=\"tui-doc-outlet\"></router-outlet>\n </div>\n </div>\n <header tuiDocHeader>\n <label class=\"night-mode\">\n Night mode\n <tui-toggle\n class=\"tui-toggle\"\n [ngModel]=\"night\"\n (ngModelChange)=\"onMode($event)\"\n ></tui-toggle>\n </label>\n <ng-content select=\"tuiDocHeader\"></ng-content>\n </header>\n <ng-container ngProjectAs=\"tuiOverContent\">\n <ng-content select=\"tuiOverContent\"></ng-content>\n </ng-container>\n <ng-container ngProjectAs=\"tuiOverDialogs\">\n <ng-content select=\"tuiOverDialogs\"></ng-content>\n </ng-container>\n <ng-container ngProjectAs=\"tuiOverAlerts\">\n <ng-content select=\"tuiOverAlerts\"></ng-content>\n </ng-container>\n <!-- TODO: Remove-->\n <ng-container ngProjectAs=\"tuiOverNotifications\">\n <ng-content select=\"tuiOverNotifications\"></ng-content>\n </ng-container>\n <ng-container ngProjectAs=\"tuiOverPortals\">\n <ng-content select=\"tuiOverPortals\"></ng-content>\n </ng-container>\n <ng-container ngProjectAs=\"tuiOverHints\">\n <ng-content select=\"tuiOverHints\"></ng-content>\n </ng-container>\n</tui-root>\n",
1316
+ template: "<tui-theme-night *ngIf=\"night\"></tui-theme-night>\n<tui-root>\n <div class=\"tui-doc-page\">\n <tui-doc-navigation class=\"tui-doc-navigation\">\n <ng-content select=\"tuiDocNavigation\"></ng-content>\n </tui-doc-navigation>\n <div class=\"tui-doc-content\">\n <router-outlet class=\"tui-doc-outlet\"></router-outlet>\n </div>\n </div>\n <header tuiDocHeader>\n <label class=\"night-mode\">\n Night mode\n <tui-toggle\n class=\"tui-toggle\"\n [ngModel]=\"night\"\n (ngModelChange)=\"onMode($event)\"\n ></tui-toggle>\n </label>\n <ng-content select=\"tuiDocHeader\"></ng-content>\n </header>\n <ng-container ngProjectAs=\"tuiOverContent\">\n <ng-content select=\"tuiOverContent\"></ng-content>\n </ng-container>\n <ng-container ngProjectAs=\"tuiOverDialogs\">\n <ng-content select=\"tuiOverDialogs\"></ng-content>\n </ng-container>\n <ng-container ngProjectAs=\"tuiOverAlerts\">\n <ng-content select=\"tuiOverAlerts\"></ng-content>\n </ng-container>\n <!-- TODO: 3.0 Remove-->\n <ng-container ngProjectAs=\"tuiOverNotifications\">\n <ng-content select=\"tuiOverNotifications\"></ng-content>\n </ng-container>\n <ng-container ngProjectAs=\"tuiOverPortals\">\n <ng-content select=\"tuiOverPortals\"></ng-content>\n </ng-container>\n <ng-container ngProjectAs=\"tuiOverHints\">\n <ng-content select=\"tuiOverHints\"></ng-content>\n </ng-container>\n</tui-root>\n",
1273
1317
  encapsulation: core.ViewEncapsulation.None,
1274
1318
  providers: [
1275
1319
  {
@@ -1854,7 +1898,7 @@
1854
1898
  .map(function (page) { return ('subPages' in page ? page.subPages : [page]); })
1855
1899
  .reduce(function (pages, subPages) { return __spread(pages, subPages); }, [])
1856
1900
  .find(function (page) { return page.title === pageTitle; });
1857
- if (page && page.route) {
1901
+ if (page === null || page === void 0 ? void 0 : page.route) {
1858
1902
  return page.route;
1859
1903
  }
1860
1904
  }
@@ -1991,7 +2035,7 @@
1991
2035
  HTML: 'HTML',
1992
2036
  };
1993
2037
 
1994
- // TODO: remove in ivy compilation
2038
+ // TODO: 3.0 remove in ivy compilation
1995
2039
  var DEMO_TEXTS = ['Сделано с помощью директивы: ', 'Фон', 'Детали формы'];
1996
2040
  var DOC_TEXTS = [
1997
2041
  'Аргумент',