Skip to content

Commit

Permalink
chore: make boolean props false by default (#409)
Browse files Browse the repository at this point in the history
  • Loading branch information
ilhan007 authored May 20, 2019
1 parent 650bcb0 commit 9c243f9
Show file tree
Hide file tree
Showing 26 changed files with 165 additions and 4 deletions.
3 changes: 2 additions & 1 deletion packages/base/src/State.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ class State {
if (typeof this._data[prop] !== "undefined") {
return this._data[prop];
}
if (propData.type === "boolean") {

if (propData.type === "boolean" || propData.type === Boolean) {
return false;
} else if (propData.multiple) { // eslint-disable-line
return [];
Expand Down
1 change: 1 addition & 0 deletions packages/main/src/Button.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ const metadata = {
* <code>import InputElementsFormSupport from "@ui5/webcomponents/dist/InputElementsFormSupport";</code>
*
* @type {boolean}
* @defaultvalue false
* @public
*/
submits: {
Expand Down
2 changes: 2 additions & 0 deletions packages/main/src/DatePicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ const metadata = {
* Determines whether the <code>ui5-datepicker</code> is displayed as disabled.
*
* @type {boolean}
* @defaultvalue false
* @public
*/
disabled: {
Expand All @@ -97,6 +98,7 @@ const metadata = {
* Determines whether the <code>ui5-datepicker</code> is displayed as readonly.
*
* @type {boolean}
* @defaultvalue false
* @public
*/
readonly: {
Expand Down
1 change: 1 addition & 0 deletions packages/main/src/Dialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ const metadata = {
* 90% of the viewport.
*
* @type {Boolean}
* @defaultvalue false
* @public
*/
stretch: {
Expand Down
3 changes: 3 additions & 0 deletions packages/main/src/Input.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ const metadata = {
* <b>Note:</b> A disabled <code>ui5-input</code> is completely uninteractive.
*
* @type {boolean}
* @defaultvalue false
* @public
*/
disabled: {
Expand All @@ -96,6 +97,7 @@ const metadata = {
* but still provides visual feedback upon user interaction.
*
* @type {boolean}
* @defaultvalue false
* @public
*/
readonly: {
Expand Down Expand Up @@ -169,6 +171,7 @@ const metadata = {
* Defines whether the <code>ui5-input</code> should show suggestions, if such are present.
*
* @type {Boolean}
* @defaultvalue false
* @public
*/
showSuggestions: {
Expand Down
2 changes: 2 additions & 0 deletions packages/main/src/Label.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ const metadata = {
* <b>Note:</b> Usually indicates that user input is required.
*
* @type {boolean}
* @defaultvalue false
* @public
*/
required: {
Expand All @@ -37,6 +38,7 @@ const metadata = {
* <b>Note:</b> By default the text would truncate.
*
* @type {boolean}
* @defaultvalue false
* @public
*/
wrap: {
Expand Down
2 changes: 2 additions & 0 deletions packages/main/src/Link.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ const metadata = {
* <b>Note:</b> When disabled, the link cannot be triggered by the user.
*
* @type {boolean}
* @defaultvalue false
* @public
*/
disabled: {
Expand Down Expand Up @@ -84,6 +85,7 @@ const metadata = {
* <b>Note:</b> the text is truncated by default.
*
* @type {boolean}
* @defaultvalue false
* @public
*/
wrap: {
Expand Down
3 changes: 3 additions & 0 deletions packages/main/src/List.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ const metadata = {
* Determines whether the list items are indented.
*
* @type {boolean}
* @defaultvalue false
* @public
*/
inset: {
Expand All @@ -95,6 +96,7 @@ const metadata = {
* <code>MultiSelect</code>, and <code>Delete</code>.
*
* @type {string}
* @defaultvalue "None"
* @public
*/
mode: {
Expand Down Expand Up @@ -125,6 +127,7 @@ const metadata = {
* </ul>
*
* @type {string}
* @defaultvalue "All"
* @public
*/
separators: {
Expand Down
2 changes: 2 additions & 0 deletions packages/main/src/ListItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ const metadata = {
/**
* Defines the selected state of the <code>ListItem</code>.
* @type {boolean}
* @defaultvalue false
* @public
*/
selected: {
Expand All @@ -34,6 +35,7 @@ const metadata = {
* while with type <code>Inactive</code> - will not.
*
* @type {string}
* @defaultvalue "Active"
* @public
*/
type: {
Expand Down
2 changes: 2 additions & 0 deletions packages/main/src/Panel.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ const metadata = {
* expandable/collapsible by user interaction.
*
* @type {boolean}
* @defaultvalue false
* @public
*/
fixed: {
Expand All @@ -81,6 +82,7 @@ const metadata = {
* Indicates whether the <code>ui5-panel</code> is collapsed and only the header is displayed.
*
* @type {boolean}
* @defaultvalue false
* @public
*/
collapsed: {
Expand Down
7 changes: 7 additions & 0 deletions packages/main/src/Popover.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ const metadata = {
* Determines on which side the <code>ui5-popover</code> is placed at.
*
* @type {PopoverPlacementType}
* @defaultvalue "Right"
* @public
*/
placementType: {
Expand All @@ -40,6 +41,7 @@ const metadata = {
* Determines the horizontal alignment of the <code>ui5-popover</code>.
*
* @type {PopoverHorizontalAlign}
* @defaultvalue "Center"
* @public
*/
horizontalAlign: {
Expand All @@ -51,6 +53,7 @@ const metadata = {
* Determines the vertical alignment of the <code>ui5-popover</code>.
*
* @type {PopoverVerticalAlign}
* @defaultvalue "Center"
* @public
*/
verticalAlign: {
Expand All @@ -64,6 +67,7 @@ const metadata = {
* If enabled, it blocks any interaction with the background.
*
* @type {boolean}
* @defaultvalue false
* @public
*/
modal: {
Expand All @@ -74,6 +78,7 @@ const metadata = {
* Determines whether the <code>ui5-popover</code> arrow is hidden.
*
* @type {boolean}
* @defaultvalue false
* @public
*/
hideArrow: {
Expand All @@ -84,6 +89,7 @@ const metadata = {
* Determines whether the <code>ui5-popover</code> would close upon user scroll.
*
* @type {boolean}
* @defaultvalue false
* @public
*/
stayOpenOnScroll: {
Expand All @@ -95,6 +101,7 @@ const metadata = {
* over the target.
*
* @type {boolean}
* @defaultvalue false
* @public
*/
allowTargetOverlap: {
Expand Down
1 change: 1 addition & 0 deletions packages/main/src/Popup.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ const metadata = {
* Defines whether the header is hidden.
*
* @type {Boolean}
* @defaultvalue false
* @public
*/
hideHeader: {
Expand Down
4 changes: 4 additions & 0 deletions packages/main/src/RadioButton.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ const metadata = {
* <b>Note:</b> A disabled <code>ui5-radiobutton</code> is completely uninteractive.
*
* @type {boolean}
* @defaultvalue false
* @public
*/
disabled: {
Expand All @@ -47,6 +48,7 @@ const metadata = {
* but still provides visual feedback upon user interaction.
*
* @type {boolean}
* @defaultvalue false
* @public
*/
readOnly: {
Expand All @@ -61,6 +63,7 @@ const metadata = {
* or by using the Space or Enter key.
*
* @type {boolean}
* @defaultvalue false
* @public
*/
selected: {
Expand All @@ -87,6 +90,7 @@ const metadata = {
* the <code>ui5-radiobutton</code>.
*
* @type {string}
* @defaultvalue "None"
* @public
*/
valueState: {
Expand Down
2 changes: 2 additions & 0 deletions packages/main/src/Select.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ const metadata = {
* <b>Note:</b> A disabled <code>ui5-select</code> is noninteractive.
*
* @type {boolean}
* @defaultvalue false
* @public
*/
disabled: {
Expand All @@ -66,6 +67,7 @@ const metadata = {
* Available options are: <code>None</code>, <code>Success</code>, <code>Warning</code> and <code>Error</code>.
*
* @type {string}
* @defaultvalue "None"
* @public
*/
valueState: {
Expand Down
2 changes: 2 additions & 0 deletions packages/main/src/ShellBar.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ const metadata = {
/**
* Defines, if the product switch icon would be displayed.
* @type {boolean}
* @defaultvalue false
* @public
*/
showProductSwitch: {
Expand All @@ -102,6 +103,7 @@ const metadata = {
/**
* Defines, if the product CoPilot icon would be displayed.
* @type {boolean}
* @defaultvalue false
* @public
*/
showCoPilot: {
Expand Down
1 change: 1 addition & 0 deletions packages/main/src/StandardListItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ const metadata = {
* <b>Note:</b> If <code>image</code> is set, the <code>icon</code> would be displayed after the <code>image</code>.
*
* @type {boolean}
* @defaultvalue false
* @public
*/
iconEnd: {
Expand Down
6 changes: 3 additions & 3 deletions packages/main/src/Switch.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const metadata = {
* pressing the <code>Enter</code> or <code>Space</code> key.
*
* @type {boolean}
* @default false
* @defaultvalue false
* @public
*/
checked: {
Expand All @@ -41,7 +41,7 @@ const metadata = {
* <b>Note:</b> A disabled <code>ui5-switch</code> is noninteractive.
*
* @type {boolean}
* @default false
* @defaultvalue false
* @public
*/
disabled: {
Expand Down Expand Up @@ -83,7 +83,7 @@ const metadata = {
* <b>Note:</b> If <code>Graphical</code> type is set,
* positive and negative icons will replace the <code>textOn</code> and <code>textOff</code>.
* @type {string}
* @default Textual
* @defaultvalue "Textual"
* @public
*/
type: {
Expand Down
9 changes: 9 additions & 0 deletions packages/main/src/Tab.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ const metadata = {
/**
* Enabled items can be selected.
* @type {Boolean}
* @defaultvalue false
* @public
*/
disabled: {
Expand Down Expand Up @@ -80,13 +81,21 @@ const metadata = {
* Instead of the semantic icon color the brand color can be used, this is named Default.
* Semantic colors and brand colors should not be mixed up inside one IconTabBar.
* @type {IconColor}
* @defaultvalue "Default"
* @public
*/
iconColor: {
type: IconColor,
defaultValue: IconColor.Default,
},

/**
* Specifies if the <code>ui5-tab</code> is selected.
*
* @type {Boolean}
* @defaultvalue false
* @public
*/
selected: {
type: Boolean,
defaultValue: false,
Expand Down
3 changes: 3 additions & 0 deletions packages/main/src/TabContainer.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ const metadata = {
* expandable/collapsible by user interaction.
*
* @type {Boolean}
* @defaultvalue false
* @public
*/
fixed: {
Expand All @@ -58,6 +59,7 @@ const metadata = {
* Determines whether the tab content is collapsed.
*
* @type {Boolean}
* @defaultvalue false
* @public
*/
collapsed: {
Expand All @@ -71,6 +73,7 @@ const metadata = {
* so that it's easier for the user to select a specific tab filter.
*
* @type {Boolean}
* @defaultvalue false
* @public
*/
showOverflow: {
Expand Down
1 change: 1 addition & 0 deletions packages/main/src/Table.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ const metadata = {
* </ul>
*
* @type {boolean}
* @defaultvalue false
* @public
*/
stickyColumnHeader: {
Expand Down
1 change: 1 addition & 0 deletions packages/main/src/TableColumn.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ const metadata = {
* Setting this property to <code>true</code>, shows this column as pop-in instead of hiding it.
*
* @type {boolean}
* @defaultvalue false
* @public
*/
demandPopin: {
Expand Down
1 change: 1 addition & 0 deletions packages/main/src/TimelineItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ const metadata = {
* Defines whether the name is clickable.
*
* @type {Boolean}
* @defaultvalue false
* @public
*/
itemNameClickable: {
Expand Down
Loading

0 comments on commit 9c243f9

Please sign in to comment.