FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

fix(flex): in breakpointMods set breakpoint as optional and add enums by boaz0 · Pull Request #3258 · patternfly/patternfly-react · GitHub

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .md  (1) .ts  (1) .tsx  (1) All 3 file types selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
    • FlexUtils.tsx
      • Flex.md
    • index.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -2,98 +2,112 @@ import * as React from 'react';
import { getModifier } from '@patternfly/react-styles';
import styles from '@patternfly/react-styles/css/layouts/Flex/flex';

export enum FlexModifiers {
flex = 'flex',
'inline-flex' = 'inline-flex',
'spacer-none' = 'spacer-none',
'spacer-xs' = 'spacer-xs',
'spacer-sm' = 'spacer-sm',
'spacer-md' = 'spacer-md',
'spacer-lg' = 'spacer-lg',
'spacer-xl' = 'spacer-xl',
'spacer-2xl' = 'spacer-2xl',
'spacer-3xl' = 'spacer-3xl',
'space-items-none' = 'space-items-none',
'space-items-xs' = 'space-items-xs',
'space-items-sm' = 'space-items-sm',
'space-items-md' = 'space-items-md',
'space-items-lg' = 'space-items-lg',
'space-items-xl' = 'space-items-xl',
'space-items-2xl' = 'space-items-2xl',
'space-items-3xl' = 'space-items-3xl',
grow = 'grow',
shrink = 'shrink',
'flex-1' = 'flex-1',
'flex-2' = 'flex-2',
'flex-3' = 'flex-3',
'flex-4' = 'flex-4',
'flex-default' = 'flex-default',
'flex-none' = 'flex-none',
column = 'column',
'column-reverse' = 'column-reverse',
row = 'row',
'row-reverse' = 'row-reverse',
wrap = 'wrap',
'wrap-reverse' = 'wrap-reverse',
nowrap = 'nowrap',
'align-right' = 'align-right',
'align-left' = 'align-left',
'align-self-flex-start' = 'align-self-flex-start',
'align-self-flex-end' = 'align-self-flex-end',
'align-self-flex-center' = 'align-self-flex-center',
'align-self-flex-baseline' = 'align-self-flex-baseline',
'align-self-flex-stretch' = 'align-self-flex-stretch',
'justify-content-flex-end' = 'justify-content-flex-end',
'justify-content-center' = 'justify-content-center',
'justify-content-flex-space-between' = 'justify-content-flex-space-between',

sahil143 Nov 20, 2019
edited
Loading

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

@boaz0 @tlabaj Not sure if this value is correct. Docs example says to use justify-content-space-between https://github.com/patternfly/patternfly-react/pull/3258/files#diff-fee6334c94230e770989b535c35f87f7R428
Also, justify-content-flex-space-between doesn't work when this is used an undefined class is applied to the element.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

😨 ho snap! I see this now. It looks like the Modifier type was in correct to begin with. It didn't have justify-content-space-between and the flex.css doesn't have justify-content-space-between but justify-content-space-between.

My mistake for not paying attention. I will suggest a fix

'justify-content-space-around' = 'justify-content-space-around',
'justify-content-space-evenly' = 'justify-content-space-evenly',
'justify-content-flex-start' = 'justify-content-flex-start',
'full-width' = 'full-width',
'align-items-flex-start' = 'align-items-flex-start',
'align-items-flex-end' = 'align-items-flex-end',
'align-items-center' = 'align-items-center',
'align-items-stretch' = 'align-items-stretch',
'align-items-baseline' = 'align-items-baseline',
'align-content-flex-start' = 'align-content-flex-start',
'align-content-flex-end' = 'align-content-flex-end',
'align-content-center' = 'align-content-center',
'align-content-stretch' = 'align-content-stretch',
'align-content-space-between' = 'align-content-space-between',
'align-content-space-around' = 'align-content-space-around'
}

export enum FlexItemModifiers {
'spacer-none' = 'spacer-none',
'spacer-xs' = 'spacer-xs',
'spacer-sm' = 'spacer-sm',
'spacer-md' = 'spacer-md',
'spacer-lg' = 'spacer-lg',
'spacer-xl' = 'spacer-xl',
'spacer-2xl' = 'spacer-2xl',
'spacer-3xl' = 'spacer-3xl',
grow = 'grow',
shrink = 'shrink',
'flex-1' = 'flex-1',
'flex-2' = 'flex-2',
'flex-3' = 'flex-3',
'flex-4' = 'flex-4',
'flex-default' = 'flex-default',
'flex-none' = 'flex-none',
'align-right' = 'align-right',
'align-left' = 'align-left',
'align-self-flex-start' = 'align-self-flex-start',
'align-self-flex-end' = 'align-self-flex-end',
'align-self-flex-center' = 'align-self-flex-center',
'align-self-flex-baseline' = 'align-self-flex-baseline',
'align-self-flex-stretch' = 'align-self-flex-stretch',
'full-width' = 'full-width'
}

export enum FlexBreakpoints {
sm = 'sm',
md = 'md',
lg = 'lg',
xl = 'xl',
'2xl' = '2xl'
}

export interface FlexBreakpointMod {
/** The attribute to modify */
modifier:
| 'flex'
| 'inline-flex'
| 'spacer-none'
| 'spacer-xs'
| 'spacer-sm'
| 'spacer-md'
| 'spacer-lg'
| 'spacer-xl'
| 'spacer-2xl'
| 'spacer-3xl'
| 'space-items-none'
| 'space-items-xs'
| 'space-items-sm'
| 'space-items-md'
| 'space-items-lg'
| 'space-items-xl'
| 'space-items-2xl'
| 'space-items-3xl'
| 'grow'
| 'shrink'
| 'flex-1'
| 'flex-2'
| 'flex-3'
| 'flex-4'
| 'flex-default'
| 'flex-none'
| 'column'
| 'column-reverse'
| 'row'
| 'row-reverse'
| 'wrap'
| 'wrap-reverse'
| 'nowrap'
| 'align-right'
| 'align-left'
| 'align-self-flex-start'
| 'align-self-flex-end'
| 'align-self-flex-center'
| 'align-self-flex-baseline'
| 'align-self-flex-stretch'
| 'justify-content-flex-end'
| 'justify-content-center'
| 'justify-content-flex-space-between'
| 'justify-content-space-around'
| 'justify-content-space-evenly'
| 'justify-content-flex-start'
| 'full-width'
| 'align-items-flex-start'
| 'align-items-flex-end'
| 'align-items-center'
| 'align-items-stretch'
| 'align-items-baseline'
| 'align-content-flex-start'
| 'align-content-flex-end'
| 'align-content-center'
| 'align-content-stretch'
| 'align-content-space-between'
| 'align-content-space-around';
modifier: keyof typeof FlexModifiers;
/** The breakpoint at which to apply the modifier */
breakpoint: 'sm' | 'md' | 'lg' | 'xl' | '2xl';
breakpoint?: keyof typeof FlexBreakpoints;
}

export interface FlexItemBreakpointMod {
/** The attribute to modify */
modifier:
| 'spacer-none'
| 'spacer-xs'
| 'spacer-sm'
| 'spacer-md'
| 'spacer-lg'
| 'spacer-xl'
| 'spacer-2xl'
| 'spacer-3xl'
| 'grow'
| 'shrink'
| 'flex-1'
| 'flex-2'
| 'flex-3'
| 'flex-4'
| 'flex-default'
| 'flex-none'
| 'align-right'
| 'align-left'
| 'align-self-flex-start'
| 'align-self-flex-end'
| 'align-self-flex-center'
| 'align-self-flex-baseline'
| 'align-self-flex-stretch'
| 'full-width';
modifier: keyof typeof FlexItemModifiers;
/** The breakpoint at which to apply the modifier */
breakpoint: 'sm' | 'md' | 'lg' | 'xl' | '2xl';
breakpoint?: FlexBreakpoints;
}
Loading

Back | FazBrowse Home | New Git URL