Skip to content

Commit e5922df

Browse files
committed
Some updates
1 parent 3f7d11b commit e5922df

File tree

8 files changed

+70
-59
lines changed

8 files changed

+70
-59
lines changed

.idea/codeStyles/codeStyleConfig.xml

Lines changed: 0 additions & 5 deletions
This file was deleted.

.idea/vcs.xml

Lines changed: 0 additions & 6 deletions
This file was deleted.

demo/demo.html

Lines changed: 50 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ <h4>Code</h4>
9292

9393
<pre>
9494
&lt;div <strong>bon-f
95-
bon-f-direction-md="column"
95+
bon-f-direction="column"
9696
bon-f-direction-md="row"</strong>&gt;
9797
&lt;div class="green" <strong>bon-fi bon-fi-grow="1"</strong>&gt;&lt;/div&gt;
9898
&lt;div class="yellow" <strong>bon-fi bon-fi-grow="1"</strong>&gt;&lt;/div&gt;
@@ -283,28 +283,69 @@ <h3>Flex Directives</h3>
283283
</p>
284284

285285
<p>
286-
Below tables lists the properties of both the directives.
286+
Below tables lists the properties of both the directives. If default is not provided then it's assumed to be the
287+
browser's default.
287288
</p>
288289

289290
<table>
290291
<caption>Properties of flex container directive <var>bon-f</var></caption>
291292
<thead>
292293
<tr>
293-
<th>Property Name</th>
294-
<th>Type</th>
295-
<th>Default</th>
294+
<th style="width: 25%">Property Name</th>
295+
<th style="width: 10%">Type</th>
296+
<th style="width: 10%">Default</th>
296297
<th>Description</th>
297298
</tr>
298299
</thead>
299300
<tbody>
300301
<tr>
301-
<td>sd</td>
302-
<td>asd</td>
303-
<td>ad</td>
304-
<td>asdsad</td>
302+
<td>bon-f</td>
303+
<td>string</td>
304+
<td>flex</td>
305+
<td>The display type of the container. The value can be either "flex", "inline-flex" or "none".</td>
306+
</tr>
307+
<tr>
308+
<td>bon-f-direction</td>
309+
<td>string</td>
310+
<td></td>
311+
<td>The flex direction. It can be one of these values: "row", "row-reverse", "column" or "column-reverse".</td>
312+
</tr>
313+
<tr>
314+
<td>bon-f-wrap</td>
315+
<td>string</td>
316+
<td></td>
317+
<td>Controls the wrapping behavior of flex items. It can be "nowrap", "wrap" or "wrap-reverse".</td>
318+
</tr>
319+
<tr>
320+
<td>bon-f-justify-content</td>
321+
<td>string</td>
322+
<td></td>
323+
<td>Defines the alignment along the main axis. Some of the possible values are: "flex-start", "flex-end", "center" etc.</td>
324+
</tr>
325+
<tr>
326+
<td>bon-f-align-items</td>
327+
<td>string</td>
328+
<td></td>
329+
<td>Defines the default behaviour for how flex items are laid out along the cross axis. Some of the possible values are: "flex-start", "flex-end", "center" etc.</td>
330+
</tr>
331+
<tr>
332+
<td>bon-f-align-content</td>
333+
<td>string</td>
334+
<td></td>
335+
<td>Defines the alignment of individual items within the main-axis. Some of the possible values are: "flex-start", "flex-end", "center" etc.</td>
305336
</tr>
306337
</tbody>
307338
</table>
308339

340+
<p>
341+
The above properties repeats for other screen sizes with the respective suffix. For example, in case of small screen
342+
the properties are: <var>bon-f-sm</var>, <var>bon-f-direction-sm</var> and so on.
343+
</p>
344+
345+
<table>
346+
<caption>Properties of flex item directive <var>bon-fi</var></caption>
347+
<thead>
348+
</thead>
349+
</table>
309350
</main>
310351
</div>

demo/demo.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@
7676
}
7777

7878
main {
79-
padding: 2rem 4rem;
79+
padding: 2rem 4rem 10rem 4rem;
8080

8181
h1 {
8282
border-bottom: solid 1px #eaefef;

demo/demo.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ class DemoComponent implements AfterViewInit, OnDestroy {
5050
return;
5151
}
5252

53-
if (this.breakpoint == Breakpoint.Large || this.breakpoint === Breakpoint.ExtraLarge) {
53+
if ([Breakpoint.Medium, Breakpoint.Large, Breakpoint.ExtraLarge].indexOf(this.breakpoint) > -1) {
5454
this.isSticky = window.pageYOffset >= this.initialOffset;
5555
} else {
5656
this.isSticky = false;

demo/styles.scss

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,20 +40,31 @@ html, body {
4040

4141
table {
4242
width: 100%;
43-
border: solid 1px #eee;
4443
border-radius: 5px;
4544

4645
caption {
4746
font-weight: bold;
4847
font-size: 16px;
49-
margin: 5px 0;
48+
margin: 10px 0;
49+
text-align: left;
5050
}
5151

5252
thead {
5353
tr {
5454
th {
5555
text-align: left;
56-
margin: 5px;
56+
padding: 10px 0;
57+
font-weight: bold;
58+
border-bottom: solid 1px #eee;
59+
}
60+
}
61+
}
62+
63+
tbody {
64+
tr {
65+
td {
66+
padding: 10px 0;
67+
border-bottom: solid 1px #eee;
5768
}
5869
}
5970
}

lib/base.ts

Lines changed: 1 addition & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@ import { ElementRef, EventEmitter, Inject, OnChanges, OnDestroy, Output } from '
22
import { Breakpoint } from './breakpoint';
33
import { MediaSizeWatcher } from './watcher';
44

5-
/**
6-
* The arguments that'll be passed to handler that listens for breakpoint changes.
7-
*/
85
export interface BreakpointChangeHandlerArgs {
96
breakpoint: Breakpoint;
107
el: ElementRef;
@@ -13,20 +10,11 @@ export interface BreakpointChangeHandlerArgs {
1310

1411
export abstract class BoneBase implements OnChanges, OnDestroy {
1512

16-
/**
17-
* Handler that should be invoked when there is a breakpoint change.
18-
*/
1913
@Output('breakpoint-change')
20-
public breakpointChange: EventEmitter<BreakpointChangeHandlerArgs>;
14+
public breakpointChange: EventEmitter<BreakpointChangeHandlerArgs> = new EventEmitter<BreakpointChangeHandlerArgs>();
2115

22-
/**
23-
* The current breakpoint.
24-
*/
2516
protected breakpoint: Breakpoint;
2617

27-
/**
28-
* The media-size-watcher unsubscribe function.
29-
*/
3018
protected mediaWatcherUnSubscribeFunction: () => void;
3119

3220
protected currentAppliedStyles: any = null;
@@ -44,26 +32,17 @@ export abstract class BoneBase implements OnChanges, OnDestroy {
4432
});
4533
}
4634

47-
/**
48-
* Re-apply the layout on change of props.
49-
*/
5035
ngOnChanges() {
5136
this.applyLayout();
5237
}
5338

54-
/**
55-
* Unsubscribe from watcher and remove the applied styles.
56-
*/
5739
ngOnDestroy() {
5840
this.mediaWatcherUnSubscribeFunction();
5941
this.getStylePropNames().forEach(style => {
6042
this.el.nativeElement.style.removeProperty(style);
6143
});
6244
}
6345

64-
/**
65-
* Applies the layout style properties to the attached element.
66-
*/
6746
public applyLayout(): void {
6847
const styles = this.getStyles();
6948

@@ -82,19 +61,10 @@ export abstract class BoneBase implements OnChanges, OnDestroy {
8261
});
8362
}
8463

85-
/**
86-
* Returns the styles that should be applied to the target element.
87-
*/
8864
public abstract getStyles(): { [key: string]: any };
8965

90-
/**
91-
* Returns the style properties affected by the directive in kebab-cased.
92-
*/
9366
public abstract getStylePropNames(): Array<string>;
9467

95-
/**
96-
* Destroys the directive and removes the changes applied by it.
97-
*/
9868
public destroy(): void {
9969
this.ngOnDestroy();
10070
}

package-lock.json

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)