-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #225 from US-CBP/bugfix/check-radio
Bugfix/check radio
- Loading branch information
Showing
10 changed files
with
101 additions
and
75 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
3 changes: 1 addition & 2 deletions
3
packages/web-components/src/components/cbp-flex-item/cbp-flex-item.scss
This file contains 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 |
---|---|---|
@@ -1,4 +1,3 @@ | ||
cbp-flex-item:not([hidden]) { | ||
display: block; | ||
position: relative; | ||
} | ||
} |
71 changes: 42 additions & 29 deletions
71
packages/web-components/src/components/cbp-flex-item/cbp-flex-item.tsx
This file contains 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 |
---|---|---|
@@ -1,42 +1,55 @@ | ||
import { Component, Prop, Element, Host, h} from '@stencil/core'; | ||
import { setCSSProps } from '../../utils/utils'; | ||
|
||
/** | ||
* @slot - Content slotted in the default slot may consist of any combination of text or DOM nodes. | ||
*/ | ||
@Component({ | ||
tag: 'cbp-flex-item', | ||
styleUrl: 'cbp-flex-item.scss', | ||
tag: 'cbp-flex-item', | ||
styleUrl: 'cbp-flex-item.scss', | ||
}) | ||
export class CbpFlexItem { | ||
|
||
@Element() host: HTMLElement; | ||
@Element() host: HTMLElement; | ||
|
||
@Prop() alignSelf: "auto" | "stretch" | "flex-start" | "flex-end" | "center" | "baseline"; | ||
@Prop() order: number; | ||
@Prop() flexGrow: number; | ||
@Prop() flexShrink: number; | ||
@Prop() flexBasis: string; | ||
/** Supports adding inline styles as an object */ | ||
@Prop() sx: any = {}; | ||
/** Specifies the alignment of the specific flex item along the cross-axis separate from the parent context. */ | ||
@Prop() alignSelf: "auto" | "stretch" | "flex-start" | "flex-end" | "center" | "baseline"; | ||
|
||
/** Specifies an ordinal group value for sorting this flex item within its group. Defaults to zero, which renders the items in DOM order. */ | ||
@Prop() order: number; | ||
|
||
/** Specifies the growth factor the item will grow at relative to other items. Defaults to zero, as flex items do not grow by default. */ | ||
@Prop() flexGrow: number; | ||
|
||
/** Specifies the shrink factor the item will shrink at relative to other items. Defaults to 1, as flex items will shrink at an equal rate by default, taking content size into consideration. */ | ||
@Prop() flexShrink: number; | ||
|
||
/** Specifies a basis (in CSS units or content values) for calculating flex behavior different from the default of "auto" (which usually evaluates to "content"). */ | ||
@Prop() flexBasis: string; | ||
|
||
/** Supports adding inline styles as an object */ | ||
@Prop() sx: any = {}; | ||
|
||
componentWillLoad() { | ||
if (typeof this.sx == "string") { | ||
this.sx = JSON.parse(this.sx) || {} | ||
} | ||
setCSSProps(this.host, { | ||
'align-self': this.alignSelf, | ||
'order': this.order, | ||
'flex-grow': this.flexGrow, | ||
'flex-shrink': this.flexShrink, | ||
'flex-basis': this.flexBasis, | ||
...this.sx | ||
}); | ||
} | ||
|
||
render() { | ||
return ( | ||
<Host> | ||
<slot /> | ||
</Host> | ||
); | ||
componentWillLoad() { | ||
if (typeof this.sx == "string") { | ||
this.sx = JSON.parse(this.sx) || {} | ||
} | ||
setCSSProps(this.host, { | ||
'align-self': this.alignSelf, | ||
'order': this.order, | ||
'flex-grow': this.flexGrow, | ||
'flex-shrink': this.flexShrink, | ||
'flex-basis': this.flexBasis, | ||
...this.sx | ||
}); | ||
} | ||
|
||
render() { | ||
return ( | ||
<Host> | ||
<slot /> | ||
</Host> | ||
); | ||
} | ||
} |
This file contains 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 |
---|---|---|
@@ -1,7 +1,7 @@ | ||
cbp-flex:not([hidden]) { | ||
display: flex; | ||
|
||
&[display='inline-flex'] { | ||
&[display="inline-flex"] { | ||
display: inline-flex; | ||
} | ||
} |
This file contains 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
21 changes: 21 additions & 0 deletions
21
packages/web-components/src/components/cbp-flex/cbp-flex.tsx
This file contains 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
2 changes: 1 addition & 1 deletion
2
packages/web-components/src/components/cbp-form-field/api-docs.mdx
This file contains 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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
import { Meta, Markdown } from "@storybook/blocks"; | ||
import Docs from './readme.md?raw'; | ||
|
||
<Meta title="Components/Form Field/API Docs" /> | ||
<Meta title="Components/Form Fields/API Docs" /> | ||
|
||
<Markdown>{Docs}</Markdown> |
This file contains 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
This file contains 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