@taiga-ui/addon-doc 2.24.0 → 2.27.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/README.md +121 -121
- package/bundles/taiga-ui-addon-doc.umd.js +935 -935
- package/bundles/taiga-ui-addon-doc.umd.js.map +1 -1
- package/bundles/taiga-ui-addon-doc.umd.min.js +2 -2
- package/bundles/taiga-ui-addon-doc.umd.min.js.map +1 -1
- package/components/code/code.component.d.ts +1 -1
- package/components/demo/demo.component.d.ts +8 -8
- package/components/documentation/documentation-property-connector.directive.d.ts +1 -1
- package/components/navigation/navigation.component.d.ts +1 -1
- package/components/page/page.component.d.ts +1 -1
- package/esm2015/addon-doc.module.js +1 -1
- package/esm2015/components/code/code.component.js +2 -2
- package/esm2015/components/code/code.module.js +1 -1
- package/esm2015/components/copy/copy.module.js +1 -1
- package/esm2015/components/demo/demo.component.js +12 -12
- package/esm2015/components/demo/demo.module.js +1 -1
- package/esm2015/components/documentation/documentation-property-connector.directive.js +6 -6
- package/esm2015/components/documentation/documentation.component.js +2 -2
- package/esm2015/components/documentation/documentation.module.js +2 -2
- package/esm2015/components/example/example.component.js +1 -1
- package/esm2015/components/example/example.module.js +2 -2
- package/esm2015/components/main/main.module.js +1 -1
- package/esm2015/components/navigation/navigation.component.js +2 -2
- package/esm2015/components/navigation/navigation.module.js +1 -1
- package/esm2015/components/navigation/navigation.providers.js +1 -1
- package/esm2015/components/page/page.component.js +3 -3
- package/esm2015/components/page/page.module.js +2 -2
- package/esm2015/components/page/page.providers.js +1 -1
- package/esm2015/directives/scroll-into-view/scroll-into-view.module.js +1 -1
- package/esm2015/internal/header/header.component.js +1 -1
- package/esm2015/internal/header/header.module.js +1 -1
- package/esm2015/internal/input-opacity/input-opacity.module.js +1 -1
- package/esm2015/internal/see-also/see-also.component.js +1 -1
- package/esm2015/internal/see-also/see-also.module.js +1 -1
- package/esm2015/internal/source-code/source-code.component.js +1 -1
- package/esm2015/internal/source-code/source-code.module.js +1 -1
- package/esm2015/languages/russian.js +1 -1
- package/esm2015/public-api.js +5 -5
- package/esm2015/taiga-ui-addon-doc.js +6 -6
- package/esm2015/tokens/code-editor.js +1 -1
- package/esm2015/tokens/pages.js +1 -1
- package/esm2015/tokens/source-code.js +1 -1
- package/esm5/addon-doc.module.js +1 -1
- package/esm5/components/code/code.component.js +2 -2
- package/esm5/components/code/code.module.js +1 -1
- package/esm5/components/copy/copy.module.js +1 -1
- package/esm5/components/demo/demo.component.js +12 -12
- package/esm5/components/demo/demo.module.js +1 -1
- package/esm5/components/documentation/documentation-property-connector.directive.js +6 -6
- package/esm5/components/documentation/documentation.component.js +2 -2
- package/esm5/components/documentation/documentation.module.js +2 -2
- package/esm5/components/example/example.component.js +1 -1
- package/esm5/components/example/example.module.js +2 -2
- package/esm5/components/main/main.module.js +1 -1
- package/esm5/components/navigation/navigation.component.js +2 -2
- package/esm5/components/navigation/navigation.module.js +1 -1
- package/esm5/components/navigation/navigation.providers.js +1 -1
- package/esm5/components/page/page.component.js +3 -3
- package/esm5/components/page/page.module.js +2 -2
- package/esm5/components/page/page.providers.js +1 -1
- package/esm5/directives/scroll-into-view/scroll-into-view.module.js +1 -1
- package/esm5/internal/header/header.component.js +1 -1
- package/esm5/internal/header/header.module.js +1 -1
- package/esm5/internal/input-opacity/input-opacity.module.js +1 -1
- package/esm5/internal/see-also/see-also.component.js +1 -1
- package/esm5/internal/see-also/see-also.module.js +1 -1
- package/esm5/internal/source-code/source-code.component.js +1 -1
- package/esm5/internal/source-code/source-code.module.js +1 -1
- package/esm5/languages/russian.js +1 -1
- package/esm5/public-api.js +5 -5
- package/esm5/taiga-ui-addon-doc.js +6 -6
- package/esm5/tokens/code-editor.js +1 -1
- package/esm5/tokens/pages.js +1 -1
- package/esm5/tokens/source-code.js +1 -1
- package/fesm2015/taiga-ui-addon-doc.js +561 -561
- package/fesm2015/taiga-ui-addon-doc.js.map +1 -1
- package/fesm5/taiga-ui-addon-doc.js +927 -927
- package/fesm5/taiga-ui-addon-doc.js.map +1 -1
- package/package.json +6 -5
- package/public-api.d.ts +4 -4
- package/taiga-ui-addon-doc.d.ts +5 -5
- package/taiga-ui-addon-doc.metadata.json +1 -1
package/README.md
CHANGED
|
@@ -26,142 +26,142 @@ npm i @taiga-ui/addon-doc
|
|
|
26
26
|
|
|
27
27
|
1. Include `TuiDocMainModule` in your App module and use in your template:
|
|
28
28
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
29
|
+
```html
|
|
30
|
+
<tui-doc-main>You can add content here, it will be shown below navigation in the sidebar</tui-doc-main>
|
|
31
|
+
```
|
|
32
32
|
|
|
33
33
|
2. Configure languages to highlight in your main module:
|
|
34
34
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
35
|
+
```typescript
|
|
36
|
+
import {NgModule} from '@angular/core';
|
|
37
|
+
import {TuiDocMainModule} from '@taiga-ui/addon-doc';
|
|
38
|
+
import {hljsLanguages} from './hljsLanguages';
|
|
39
|
+
import {HIGHLIGHT_OPTIONS, HighlightLanguage} from 'ngx-highlightjs';
|
|
40
|
+
import {AppComponent} from './app.component';
|
|
41
|
+
|
|
42
|
+
@NgModule({
|
|
43
|
+
bootstrap: [AppComponent],
|
|
44
|
+
imports: [TuiDocMainModule],
|
|
45
|
+
declarations: [AppComponent],
|
|
46
|
+
providers: [
|
|
47
|
+
{
|
|
48
|
+
provide: HIGHLIGHT_OPTIONS,
|
|
49
|
+
useValue: {
|
|
50
|
+
coreLibraryLoader: () => import('highlight.js/lib/core' as string),
|
|
51
|
+
lineNumbersLoader: () => import('highlightjs-line-numbers.js' as string), // Optional, only if you want the line numbers
|
|
52
|
+
languages: {
|
|
53
|
+
typescript: () => import('highlight.js/lib/languages/typescript' as string),
|
|
54
|
+
less: () => import('highlight.js/lib/languages/less' as string),
|
|
55
|
+
xml: () => import('highlight.js/lib/languages/xml' as string),
|
|
56
|
+
},
|
|
57
|
+
},
|
|
58
|
+
},
|
|
59
|
+
],
|
|
60
|
+
})
|
|
61
|
+
export class AppBrowserModule {}
|
|
62
|
+
```
|
|
63
63
|
|
|
64
64
|
3. Configure documentation providers:
|
|
65
65
|
|
|
66
|
-
|
|
66
|
+
`TUI_DOC_PAGES` — an array of pages, see `TuiDocPages` type
|
|
67
67
|
|
|
68
|
-
|
|
68
|
+
`TUI_DOC_LOGO` — an src for the SVG logo in the sidebar
|
|
69
69
|
|
|
70
|
-
|
|
70
|
+
`TUI_DOC_DEFAULT_TABS` — an array of default named for tabs on your typical page
|
|
71
71
|
|
|
72
|
-
|
|
72
|
+
`TUI_DOC_TITLE` — a title prefix for the browser tab
|
|
73
73
|
|
|
74
|
-
|
|
74
|
+
`TUI_DOC_SEE_ALSO` — a two dimensional array of related pages by their titles
|
|
75
75
|
|
|
76
76
|
4. Configure routing:
|
|
77
77
|
|
|
78
|
-
|
|
79
|
-
|
|
78
|
+
```typescript
|
|
79
|
+
import {Routes} from '@angular/router';
|
|
80
80
|
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
81
|
+
const appRoutes: Routes = [
|
|
82
|
+
{
|
|
83
|
+
path: 'super-page',
|
|
84
|
+
loadChildren: '../super-page/super-page.module#SuperModule',
|
|
85
|
+
data: {
|
|
86
|
+
title: 'Super Page',
|
|
87
|
+
},
|
|
88
|
+
},
|
|
89
|
+
// ...
|
|
90
|
+
];
|
|
91
|
+
```
|
|
92
92
|
|
|
93
|
-
|
|
94
|
-
|
|
93
|
+
> You must have title in route data in order for `TUI_DOC_SEE_ALSO` to work. It would also be automatically added to
|
|
94
|
+
> `TUI_DOC_TITLE` for browser tab title when navigating to that route.
|
|
95
95
|
|
|
96
96
|
5. Create pages.
|
|
97
97
|
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
98
|
+
_Module:_
|
|
99
|
+
|
|
100
|
+
```typescript
|
|
101
|
+
import {NgModule} from '@angular/core';
|
|
102
|
+
import {RouterModule} from '@angular/router';
|
|
103
|
+
import {generateRoutes, TuiAddonDocModule} from '@taiga-ui/addon-doc';
|
|
104
|
+
import {SuperComponent} from './super.component';
|
|
105
|
+
|
|
106
|
+
@NgModule({
|
|
107
|
+
imports: [TuiAddonDocModule, RouterModule.forChild(generateRoutes(SuperComponent))],
|
|
108
|
+
declarations: [SuperComponent],
|
|
109
|
+
exports: [SuperComponent],
|
|
110
|
+
})
|
|
111
|
+
export class SuperModule {}
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
_Component:_
|
|
115
|
+
|
|
116
|
+
```typescript
|
|
117
|
+
import {Component} from '@angular/core';
|
|
118
|
+
|
|
119
|
+
import {default as exampleHtml} from '!!raw-loader!./examples/1/index.html';
|
|
120
|
+
import {default as exampleTs} from '!!raw-loader!./examples/1/index.ts';
|
|
121
|
+
|
|
122
|
+
@Component({
|
|
123
|
+
selector: 'super-component',
|
|
124
|
+
templateUrl: './account.template.html',
|
|
125
|
+
})
|
|
126
|
+
export class SuperComponent {
|
|
127
|
+
// Keys would be used as tabs for code example
|
|
128
|
+
readonly example = {
|
|
129
|
+
TypeScript: exampleTs,
|
|
130
|
+
HTML: exampleHtml,
|
|
131
|
+
};
|
|
132
|
+
|
|
133
|
+
readonly inputVariants = ['input 1', 'input 2'];
|
|
134
|
+
}
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
_Template:_
|
|
138
|
+
|
|
139
|
+
```html
|
|
140
|
+
<tui-doc-page header="Super" package="SUPER-PACKAGE" deprecated>
|
|
141
|
+
<ng-template pageTab>
|
|
142
|
+
<!-- default tab name would be used -->
|
|
143
|
+
This would be the content of a first tab
|
|
144
|
+
|
|
145
|
+
<tui-doc-example id="basic-example" heading="Example of usage" [content]="example">
|
|
146
|
+
<example-1></example-1>
|
|
147
|
+
</tui-doc-example>
|
|
148
|
+
</ng-template>
|
|
149
|
+
|
|
150
|
+
<ng-template pageTab="Documentation">
|
|
151
|
+
<tui-doc-demo>
|
|
152
|
+
<super-component [input]="input"></super-component>
|
|
153
|
+
</tui-doc-demo>
|
|
154
|
+
<tui-doc-documentation>
|
|
155
|
+
<ng-template
|
|
156
|
+
documentationPropertyName="input"
|
|
157
|
+
documentationPropertyMode="input"
|
|
158
|
+
documentationPropertyType="T"
|
|
159
|
+
[documentationPropertyValues]="inputVariants"
|
|
160
|
+
[(documentationPropertyValue)]="input"
|
|
161
|
+
>
|
|
162
|
+
Some input
|
|
163
|
+
</ng-template>
|
|
164
|
+
</tui-doc-documentation>
|
|
165
|
+
</ng-template>
|
|
166
|
+
</tui-doc-page>
|
|
167
|
+
```
|