|
1 | | -import { Component } from '@angular/core'; |
2 | | - |
3 | | -@Component({ |
4 | | - selector: 'sp-doc', |
5 | | - styles: [` |
6 | | - :host { |
7 | | - display: block; |
8 | | - width: 100%; |
9 | | - margin: 50px 0; |
10 | | - } |
11 | | - h4 { |
12 | | - margin: 20px 0; |
13 | | - } |
14 | | - .sel { |
15 | | - font-size: 16px; |
16 | | - color: #adadad; |
17 | | - } |
18 | | - tr > th { |
19 | | - color: #adadad; |
20 | | - } |
21 | | - tr > th:first-child, |
22 | | - .selContent { |
23 | | - font-weight: bold; |
24 | | - color: #ffc421; |
25 | | - } |
26 | | - tr > td:first-child { |
27 | | - font-weight: bold; |
28 | | - } |
29 | | - `], |
30 | | - templateUrl: './doc.route.component.html' |
31 | | -}) |
32 | | -export class DocComponent { |
33 | | - |
34 | | - readonly splitDoc = { |
35 | | - inputs: [ |
36 | | - {name: 'direction', type: 'string', default: '"horizontal"', details: 'Select split direction: <code>"horizontal"</code> or <code>"vertical"</code>.'}, |
37 | | - {name: 'gutterSize', type: 'number', default: '11', details: `Gutters's size (dragging elements) in pixels.`}, |
38 | | - {name: 'disabled', type: 'boolean', default: 'false', details: 'Disable the dragging feature (remove cursor/image on gutters). <code>(gutterClick)</code> still emits.'}, |
39 | | - {name: 'useTransition', type: 'boolean', default: 'false', details: 'Add transition when toggling visibility using <code>[visible]</code> or <code>[size]</code>.<br><u>Warning: Transitions are not working for <a href="https://github.com/philipwalton/flexbugs#flexbug-16">IE/Edge/Safari</a></u>'}, |
40 | | - ], |
41 | | - outputs: [ |
42 | | - {name: 'dragStart', value: '{gutterNum: number, sizes: Array<number>}', details: 'Emit when drag starts.'}, |
43 | | - {name: 'dragEnd', value: '{gutterNum: number, sizes: Array<number>}', details: 'Emit when drag ends.'}, |
44 | | - {name: 'gutterClick', value: '{gutterNum: number, sizes: Array<number>}', details: 'Emit when user clicks on a gutter.'}, |
45 | | - {name: 'transitionEnd', value: 'Array<number>', details: 'Emit when transition ends (could be triggered from <code>[visible]</code> or <code>[size]</code>).<br>Only if <code>[useTransition]="true"</code>.<br><u>Warning: Transitions are not working for <a href="https://github.com/philipwalton/flexbugs#flexbug-16">IE/Edge/Safari</a></u>'}, |
46 | | - ], |
47 | | - class: [ |
48 | | - {name: 'dragProgress$', type: 'Observable<{gutterNum: number, sizes: Array<number>}>', details: 'Emit when dragging. Replace old <code>(dragProgress)</code> template event for better flexibility about change detection mechanism.'}, |
49 | | - {name: 'setVisibleAreaSizes()', type: '(Array<number>) => boolean', details: 'Set all <b>visible</b> area sizes in one go, return a boolean to know if input values were correct. Useful when combined with <code>dragProgress$</code> to sync multiple splits.'}, |
50 | | - {name: 'getVisibleAreaSizes()', type: '() => Array<number>', details: 'Get all <b>visible</b> area sizes.'}, |
51 | | - ], |
52 | | - }; |
53 | | - |
54 | | - readonly splitAreaDoc = { |
55 | | - inputs: [ |
56 | | - {name: 'size', type: 'number', default: '100/nb_visible_areas', details: 'Size of the area in percent (value between <code>0</code> and <code>100</code>).<br>If not provided or if all areas sizes not equal to 100, all areas will have the same size.'}, |
57 | | - ] |
58 | | - } |
59 | | - |
60 | | - readonly cssClasses = { |
61 | | - split: [ |
62 | | - {name: 'is-init', details: 'Added after component initialization.'}, |
63 | | - {name: 'is-horizontal / is-vertical', details: 'Depends on <code><as-split [direction]="x"></code>.'}, |
64 | | - {name: 'is-disabled', details: 'Added when <code><as-split [disabled]="true"></code>.'}, |
65 | | - {name: 'is-transition', details: 'Added when <code><as-split [useTransition]="true"></code>.'}, |
66 | | - {name: 'is-dragging', details: 'Added while a gutter is dragged.'}, |
67 | | - ], |
68 | | - area: [ |
69 | | - {name: 'as-split-area', details: 'Added on all areas.'}, |
70 | | - {name: 'is-hided', details: 'Added when <code><as-split-area [visible]="false"></code>.'}, |
71 | | - ], |
72 | | - gutter: [ |
73 | | - {name: 'as-split-gutter', details: 'Added on all gutters.'}, |
74 | | - {name: 'is-dragged', details: 'Added on gutter while dragged.'}, |
75 | | - ], |
76 | | - }; |
77 | | - |
78 | | -} |
| 1 | +import { Component } from '@angular/core'; |
| 2 | + |
| 3 | +@Component({ |
| 4 | + selector: 'sp-doc', |
| 5 | + styles: [` |
| 6 | + :host { |
| 7 | + display: block; |
| 8 | + width: 100%; |
| 9 | + margin: 50px 0; |
| 10 | + } |
| 11 | + h4 { |
| 12 | + margin: 20px 0; |
| 13 | + } |
| 14 | + .sel { |
| 15 | + font-size: 16px; |
| 16 | + color: #adadad; |
| 17 | + } |
| 18 | + tr > th { |
| 19 | + color: #adadad; |
| 20 | + } |
| 21 | + tr > th:first-child, |
| 22 | + .selContent { |
| 23 | + font-weight: bold; |
| 24 | + color: #ffc421; |
| 25 | + } |
| 26 | + tr > td:first-child { |
| 27 | + font-weight: bold; |
| 28 | + } |
| 29 | + `], |
| 30 | + templateUrl: './doc.route.component.html' |
| 31 | +}) |
| 32 | +export class DocComponent { |
| 33 | + |
| 34 | + readonly splitDoc = { |
| 35 | + inputs: [ |
| 36 | + {name: 'direction', type: 'string', default: '"horizontal"', details: 'Select split direction: <code>"horizontal"</code> or <code>"vertical"</code>.'}, |
| 37 | + {name: 'gutterSize', type: 'number', default: '11', details: `Gutters's size (dragging elements) in pixels.`}, |
| 38 | + {name: 'disabled', type: 'boolean', default: 'false', details: 'Disable the dragging feature (remove cursor/image on gutters). <code>(gutterClick)</code> still emits.'}, |
| 39 | + {name: 'useTransition', type: 'boolean', default: 'false', details: 'Add transition when toggling visibility using <code>[visible]</code> or <code>[size]</code>.<br><u>Warning: Transitions are not working for <a href="https://github.com/philipwalton/flexbugs#flexbug-16">IE/Edge/Safari</a></u>'}, |
| 40 | + ], |
| 41 | + outputs: [ |
| 42 | + {name: 'dragStart', value: '{gutterNum: number, sizes: Array<number>}', details: 'Emit when drag starts.'}, |
| 43 | + {name: 'dragEnd', value: '{gutterNum: number, sizes: Array<number>}', details: 'Emit when drag ends.'}, |
| 44 | + {name: 'gutterClick', value: '{gutterNum: number, sizes: Array<number>}', details: 'Emit when user clicks on a gutter.'}, |
| 45 | + {name: 'transitionEnd', value: 'Array<number>', details: 'Emit when transition ends (could be triggered from <code>[visible]</code> or <code>[size]</code>).<br>Only if <code>[useTransition]="true"</code>.<br><u>Warning: Transitions are not working for <a href="https://github.com/philipwalton/flexbugs#flexbug-16">IE/Edge/Safari</a></u>'}, |
| 46 | + ], |
| 47 | + class: [ |
| 48 | + {name: 'dragProgress$', type: 'Observable<{gutterNum: number, sizes: Array<number>}>', details: 'Emit when dragging. Replace old <code>(dragProgress)</code> template event for better flexibility about change detection mechanism.'}, |
| 49 | + {name: 'setVisibleAreaSizes()', type: '(Array<number>) => boolean', details: 'Set all <b>visible</b> area sizes in one go, return a boolean to know if input values were correct. Useful when combined with <code>dragProgress$</code> to sync multiple splits.'}, |
| 50 | + {name: 'getVisibleAreaSizes()', type: '() => Array<number>', details: 'Get all <b>visible</b> area sizes.'}, |
| 51 | + ], |
| 52 | + }; |
| 53 | + |
| 54 | + readonly splitAreaDoc = { |
| 55 | + inputs: [ |
| 56 | + {name: 'size', type: 'number', default: '100/nb_visible_areas', details: 'Size of the area in percent (value between <code>0</code> and <code>100</code>).<br>If not provided or if all areas sizes not equal to 100, all areas will have the same size.'}, |
| 57 | + ] |
| 58 | + } |
| 59 | + |
| 60 | + readonly cssClasses = { |
| 61 | + split: [ |
| 62 | + {name: 'is-init', details: 'Added after component initialization.'}, |
| 63 | + {name: 'is-horizontal / is-vertical', details: 'Depends on <code><as-split [direction]="x"></code>.'}, |
| 64 | + {name: 'is-disabled', details: 'Added when <code><as-split [disabled]="true"></code>.'}, |
| 65 | + {name: 'is-transition', details: 'Added when <code><as-split [useTransition]="true"></code>.'}, |
| 66 | + {name: 'is-dragging', details: 'Added while a gutter is dragged.'}, |
| 67 | + ], |
| 68 | + area: [ |
| 69 | + {name: 'as-split-area', details: 'Added on all areas.'}, |
| 70 | + {name: 'is-hided', details: 'Added when <code><as-split-area [visible]="false"></code>.'}, |
| 71 | + ], |
| 72 | + gutter: [ |
| 73 | + {name: 'as-split-gutter', details: 'Added on all gutters.'}, |
| 74 | + {name: 'is-dragged', details: 'Added on gutter while dragged.'}, |
| 75 | + ], |
| 76 | + }; |
| 77 | + |
| 78 | +} |
0 commit comments