@@ -14,41 +14,33 @@ import { Component, Prop, Host, h } from '@stencil/core';
1414export class Divider implements ComponentInterface {
1515 /**
1616 * Set to `"xxsmall"` for the smallest spacing.
17- * Set to "xsmall" for a very small spacing.
18- * Set to `"small"` for a small spacing.
19- * Set to "medium" for a medium spacing.
20- * Set to "large" for a large spacing.
17+ * Set to "xsmall" for very small spacing.
18+ * Set to `"small"` for small spacing.
19+ * Set to "medium" for medium spacing.
20+ * Set to "large" for large spacing.
2121 * Set to `"xlarge"` for the largest spacing.
2222 *
23- * Defaults to `"small"` for the `ionic` theme, undefined for all other themes .
23+ * Defaults to `"xxsmall"` .
2424 */
25- @Prop ( { reflect : true } ) spacing ?: 'xxsmall' | 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge' | 'xxlarge' ;
25+ @Prop ( { reflect : true } ) spacing ?: 'xxsmall' | 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge' | 'xxlarge' = 'xxsmall' ;
2626
2727 /**
2828 * If `true`, the divider will have horizontal margins
2929 * By default, it's `false`
3030 */
3131 @Prop ( ) inset ?: boolean = false ;
3232
33- private getSpacing ( ) : string | undefined {
34- const { spacing } = this ;
35-
36- if ( spacing === undefined ) {
37- return 'xxsmall' ;
38- }
39-
40- return spacing ;
41- }
4233
4334 render ( ) {
35+ const { inset, spacing } = this ;
4436 const theme = getIonTheme ( this ) ;
45- const spacing = this . getSpacing ( ) ;
37+
4638 return (
4739 < Host
4840 class = { {
4941 [ theme ] : true ,
50- [ `divider-space -${ spacing } ` ] : spacing !== undefined ,
51- [ `divider-inset` ] : this . inset || false ,
42+ [ `divider-spacing -${ spacing } ` ] : spacing !== undefined ,
43+ [ `divider-inset` ] : inset ,
5244 } }
5345 >
5446 < hr />
0 commit comments