@taiga-ui/addon-doc 2.23.0 → 2.27.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.
- package/README.md +123 -135
- package/bundles/taiga-ui-addon-doc.umd.js +985 -931
- 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 +4 -1
- package/components/demo/demo.component.d.ts +8 -8
- package/components/documentation/documentation-property-connector.directive.d.ts +1 -1
- package/components/example/example-get-tabs.pipe.d.ts +4 -0
- package/components/example/example.component.d.ts +4 -7
- 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 +11 -4
- package/esm2015/components/code/code.module.js +1 -1
- package/esm2015/components/copy/copy.component.js +2 -2
- package/esm2015/components/copy/copy.module.js +1 -1
- package/esm2015/components/demo/demo.component.js +13 -13
- package/esm2015/components/demo/demo.module.js +1 -1
- package/esm2015/components/documentation/documentation-property-connector.directive.js +6 -7
- package/esm2015/components/documentation/documentation.component.js +2 -2
- package/esm2015/components/documentation/documentation.module.js +2 -2
- package/esm2015/components/example/example-get-tabs.pipe.js +12 -0
- package/esm2015/components/example/example.component.js +8 -26
- package/esm2015/components/example/example.module.js +4 -3
- package/esm2015/components/main/main.module.js +1 -1
- package/esm2015/components/navigation/navigation.component.js +3 -3
- 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 +4 -4
- 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/interfaces/page.js +1 -1
- package/esm2015/internal/header/header.component.js +2 -2
- 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 +2 -2
- package/esm2015/internal/see-also/see-also.module.js +1 -1
- package/esm2015/internal/source-code/source-code.component.js +2 -2
- 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 +12 -11
- package/esm2015/tokens/code-editor.js +1 -1
- package/esm2015/tokens/example-content-processor.js +2 -4
- package/esm2015/tokens/i18n.js +13 -5
- package/esm2015/tokens/pages.js +1 -1
- package/esm2015/tokens/source-code.js +1 -1
- package/esm2015/utils/raw-load-record.js +12 -0
- package/esm2015/utils/raw-load.js +7 -0
- package/esm5/addon-doc.module.js +1 -1
- package/esm5/components/code/code.component.js +15 -4
- package/esm5/components/code/code.module.js +1 -1
- package/esm5/components/copy/copy.component.js +2 -2
- package/esm5/components/copy/copy.module.js +1 -1
- package/esm5/components/demo/demo.component.js +13 -13
- package/esm5/components/demo/demo.module.js +1 -1
- package/esm5/components/documentation/documentation-property-connector.directive.js +6 -7
- package/esm5/components/documentation/documentation.component.js +2 -2
- package/esm5/components/documentation/documentation.module.js +2 -2
- package/esm5/components/example/example-get-tabs.pipe.js +15 -0
- package/esm5/components/example/example.component.js +9 -43
- package/esm5/components/example/example.module.js +4 -3
- package/esm5/components/main/main.module.js +1 -1
- package/esm5/components/navigation/navigation.component.js +3 -3
- 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 +4 -4
- 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/interfaces/page.js +1 -1
- package/esm5/internal/header/header.component.js +2 -2
- 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 +2 -2
- package/esm5/internal/see-also/see-also.module.js +1 -1
- package/esm5/internal/source-code/source-code.component.js +2 -2
- 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 +12 -11
- package/esm5/tokens/code-editor.js +1 -1
- package/esm5/tokens/example-content-processor.js +2 -4
- package/esm5/tokens/i18n.js +13 -5
- package/esm5/tokens/pages.js +1 -1
- package/esm5/tokens/source-code.js +1 -1
- package/esm5/utils/raw-load-record.js +44 -0
- package/esm5/utils/raw-load.js +21 -0
- package/fesm2015/taiga-ui-addon-doc.js +603 -587
- package/fesm2015/taiga-ui-addon-doc.js.map +1 -1
- package/fesm5/taiga-ui-addon-doc.js +972 -919
- package/fesm5/taiga-ui-addon-doc.js.map +1 -1
- package/interfaces/page.d.ts +4 -0
- package/package.json +7 -6
- package/public-api.d.ts +4 -4
- package/taiga-ui-addon-doc.d.ts +11 -10
- package/taiga-ui-addon-doc.metadata.json +1 -1
- package/utils/raw-load-record.d.ts +2 -0
- package/utils/raw-load.d.ts +2 -0
package/README.md
CHANGED
|
@@ -26,154 +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
|
-
|
|
32
|
-
</tui-doc-main>
|
|
33
|
-
```
|
|
29
|
+
```html
|
|
30
|
+
<tui-doc-main>You can add content here, it will be shown below navigation in the sidebar</tui-doc-main>
|
|
31
|
+
```
|
|
34
32
|
|
|
35
33
|
2. Configure languages to highlight in your main module:
|
|
36
34
|
|
|
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
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
export class AppBrowserModule {}
|
|
66
|
-
```
|
|
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
|
+
```
|
|
67
63
|
|
|
68
64
|
3. Configure documentation providers:
|
|
69
65
|
|
|
70
|
-
|
|
66
|
+
`TUI_DOC_PAGES` — an array of pages, see `TuiDocPages` type
|
|
71
67
|
|
|
72
|
-
|
|
68
|
+
`TUI_DOC_LOGO` — an src for the SVG logo in the sidebar
|
|
73
69
|
|
|
74
|
-
|
|
70
|
+
`TUI_DOC_DEFAULT_TABS` — an array of default named for tabs on your typical page
|
|
75
71
|
|
|
76
|
-
|
|
72
|
+
`TUI_DOC_TITLE` — a title prefix for the browser tab
|
|
77
73
|
|
|
78
|
-
|
|
74
|
+
`TUI_DOC_SEE_ALSO` — a two dimensional array of related pages by their titles
|
|
79
75
|
|
|
80
76
|
4. Configure routing:
|
|
81
77
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
> when navigating to that route.
|
|
78
|
+
```typescript
|
|
79
|
+
import {Routes} from '@angular/router';
|
|
80
|
+
|
|
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
|
+
|
|
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.
|
|
100
95
|
|
|
101
96
|
5. Create pages.
|
|
102
97
|
|
|
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
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
>
|
|
174
|
-
Some input
|
|
175
|
-
</ng-template>
|
|
176
|
-
</tui-doc-documentation>
|
|
177
|
-
</ng-template>
|
|
178
|
-
</tui-doc-page>
|
|
179
|
-
```
|
|
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
|
+
```
|