Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename hideLabel params to showLabel for consistency #652

Merged
merged 1 commit into from
Feb 27, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions packages/clay-checkbox/demos/a11y.html
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,8 @@ <h4>Hidden Label Checkbox</h4>

new metal.ClayCheckbox(
{
hideLabel: true,
label: 'Hidden Label Checkbox'
label: 'Hidden Label Checkbox',
showLabel: false,
},
'#hidden-label-block'
);
Expand Down
4 changes: 2 additions & 2 deletions packages/clay-checkbox/demos/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,8 @@ <h4>Hidden Label Checkbox</h4>

new metal.ClayCheckbox(
{
hideLabel: true,
label: 'Hidden Label Checkbox'
label: 'Hidden Label Checkbox',
showLabel: false,
},
'#hidden-label-block'
);
Expand Down
20 changes: 10 additions & 10 deletions packages/clay-checkbox/src/ClayCheckbox.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,15 +59,6 @@ ClayCheckbox.STATE = {
*/
elementClasses: Config.string(),

/**
* Flag to indicate if label should be hide.
* @instance
* @memberof ClayCheckbox
* @type {?bool}
* @default false
*/
hideLabel: Config.bool().value(false),

/**
* Id to be applied to the element.
* @instance
Expand Down Expand Up @@ -106,7 +97,7 @@ ClayCheckbox.STATE = {

/**
* Custom content of the checkbox label. Use it to use your custom html.
* If this is used label and hideLabel params are ignored.
* If this is used label and showLabel params are ignored.
* @instance
* @memberof ClayCheckbox
* @type {?html|undefined}
Expand All @@ -123,6 +114,15 @@ ClayCheckbox.STATE = {
*/
name: Config.string(),

/**
* Flag to indicate if label should be hide.
* @instance
* @memberof ClayCheckbox
* @type {?bool}
* @default true
*/
showLabel: Config.bool().value(true),

/**
* Value to be applied to the element.
* @instance
Expand Down
8 changes: 4 additions & 4 deletions packages/clay-checkbox/src/ClayCheckbox.soy
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@
{@param? checked: bool}
{@param? disabled: bool}
{@param? elementClasses: string}
{@param? hideLabel: bool}
{@param? id: string}
{@param? indeterminate: bool}
{@param? inline: bool}
{@param? label: string}
{@param? labelContent: html}
{@param? name: string}
{@param? showLabel: bool}
{@param? value: string}

{let $attributes kind="attributes"}
Expand All @@ -38,10 +38,10 @@
{param ariaLabelledBy: $ariaLabelledBy /}
{param checked: $indeterminate or $checked /}
{param disabled: $disabled /}
{param hideLabel: $hideLabel /}
{param label: $label /}
{param labelContent: $labelContent /}
{param name: $name /}
{param showLabel: $showLabel ?: true /}
{param value: $value /}
{/call}
</div>
Expand All @@ -54,10 +54,10 @@
{@param? ariaLabelledBy: string}
{@param? checked: bool}
{@param? disabled: bool}
{@param? hideLabel: bool}
{@param? label: string}
{@param? labelContent: html}
{@param? name: string}
{@param? showLabel: bool}
{@param? value: string}

<label>
Expand Down Expand Up @@ -94,7 +94,7 @@
{if $label}
{let $spanLabelClasses kind="text"}
custom-control-label-text
{if $hideLabel}
{if not $showLabel}
{sp}sr-only
{/if}
{/let}
Expand Down
2 changes: 1 addition & 1 deletion packages/clay-checkbox/src/__tests__/ClayCheckbox.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ describe('ClayCheckbox', function() {

it('should render a checkbox with hidden label', () => {
clayCheckbox = new ClayCheckbox({
hideLabel: true,
label: 'My Checkbox',
showLabel: false,
});

expect(clayCheckbox).toMatchSnapshot();
Expand Down
20 changes: 10 additions & 10 deletions packages/clay-dataset-display/src/ClayDatasetDisplay.js
Original file line number Diff line number Diff line change
Expand Up @@ -323,16 +323,6 @@ ClayDatasetDisplay.STATE = {
*/
filterItems: filterItemsValidator,

/**
* Flag to indicate if the `Done` button in management toolbar filter dropdown
* should be hide or not.
* @instance
* @memberof ClayDatasetDisplay
* @type {?bool}
* @default false
*/
hideFiltersDoneButton: Config.bool().value(false),

/**
* Id to be applied to the element.
* @instance
Expand Down Expand Up @@ -396,6 +386,16 @@ ClayDatasetDisplay.STATE = {
*/
selectedView: Config.number(),

/**
* Flag to indicate if the `Done` button in management toolbar filter dropdown
* should be shown or not.
* @instance
* @memberof ClayDatasetDisplay
* @type {?bool}
* @default true
*/
showFiltersDoneButton: Config.bool().value(true),

/**
* Sorting order.
* @instance
Expand Down
4 changes: 2 additions & 2 deletions packages/clay-dataset-display/src/ClayDatasetDisplay.soy
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,14 @@
separator: bool,
type: string
]>}
{@param? hideFiltersDoneButton: bool}
{@param? id: string}
{@param? items: ?}
{@param? searchActionURL: string}
{@param? searchFormName: string}
{@param? searchInputName: string}
{@param? selectable: bool}
{@param? selectedView: int}
{@param? showFiltersDoneButton: bool}
{@param? sortingOrder: string}
{@param? title: string}
{@param? views: list<[
Expand Down Expand Up @@ -98,13 +98,13 @@
'viewTypeClicked': $_handleViewTypeClicked
] /}
{param filterItems: $filterItems /}
{param hideFiltersDoneButton: $hideFiltersDoneButton /}
{param ref: 'managementToolbar' /}
{param searchActionURL: $searchActionURL /}
{param searchFormName: $searchFormName /}
{param searchInputName: $searchInputName /}
{param selectable: $selectable /}
{param selectedItems: $_selectedItems ? length($_selectedItems) : 0 /}
{param showFiltersDoneButton: $showFiltersDoneButton ?: true /}
{param sortingOrder: $sortingOrder /}
{param spritemap: $spritemap /}
{param totalItems: $_totalItems /}
Expand Down
2 changes: 1 addition & 1 deletion packages/clay-list/src/ClayList.soy
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@
{param checked: $item.selected /}
{param disabled: $item.disabled /}
{param events: ['change': $_handleItemToggled] /}
{param hideLabel: true /}
{param label: $item.selected ? 'Select' : 'Deselect' /}
{param name kind="text"}
{if $schema.inputName}
Expand All @@ -106,6 +105,7 @@
{/if}
{/param}

{param showLabel: false /}
{param value: $item[$schema.inputValueField] /}
{/call}
</div>
Expand Down
20 changes: 10 additions & 10 deletions packages/clay-management-toolbar/src/ClayManagementToolbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -238,16 +238,6 @@ ClayManagementToolbar.STATE = {
*/
filterItems: filterItemsValidator,

/**
* Flag to indicate if the `Done` button in filter dropdown should be hide or
* not.
* @instance
* @memberof ClayManagementToolbar
* @type {?bool}
* @default false
*/
hideFiltersDoneButton: Config.bool().value(false),

/**
* Id to be applied to the element.
* @instance
Expand Down Expand Up @@ -321,6 +311,16 @@ ClayManagementToolbar.STATE = {
*/
showAdvancedSearch: Config.bool().value(false),

/**
* Flag to indicate if the `Done` button in filter dropdown should be shown or
* not.
* @instance
* @memberof ClayManagementToolbar
* @type {?bool}
* @default true
*/
showFiltersDoneButton: Config.bool().value(true),

/**
* Flag to indicate if the Info button should be shown or not.
* @instance
Expand Down
14 changes: 7 additions & 7 deletions packages/clay-management-toolbar/src/ClayManagementToolbar.soy
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@
separator: bool,
type: string
]>}
{@param? hideFiltersDoneButton: bool}
{@param? id: string}
{@param? searchActionURL: string}
{@param? searchFormName: string}
Expand All @@ -62,6 +61,7 @@
{@param? selectable: bool}
{@param? selectedItems: number}
{@param? showAdvancedSearch: bool}
{@param? showFiltersDoneButton: bool}
{@param? showInfoButton: bool}
{@param? showSearch: bool}
{@param? sortingOrder: string}
Expand Down Expand Up @@ -116,13 +116,13 @@
{param creationMenu: $creationMenu /}
{param disabled: $totalItems == 0 /}
{param filterItems: $filterItems /}
{param hideFiltersDoneButton: $hideFiltersDoneButton /}
{param searchActionURL: $searchActionURL /}
{param searchFormName: $searchFormName /}
{param searchInputName: $searchInputName /}
{param searchValue: $searchValue /}
{param selectable: $selectable /}
{param showAdvancedSearch: $showAdvancedSearch /}
{param showFiltersDoneButton: $showFiltersDoneButton ?: true /}
{param showInfoButton: $showInfoButton /}
{param showSearch: $showSearch != false /}
{param sortingOrder: $sortingOrder /}
Expand Down Expand Up @@ -172,10 +172,10 @@
{call ClayCheckbox.render}
{param checked: true /}
{param events: ['change': $_handleSelectPageCheckboxChanged] /}
{param hideLabel: true /}
{param indeterminate: $selectedItems < $totalItems /}
{param label: 'Select Page' /}
{param ref: 'selectPageCheckbox' /}
{param showLabel: false /}
{/call}
</li>
<li class="nav-item">
Expand Down Expand Up @@ -335,13 +335,13 @@
separator: bool,
type: string
]>}
{@param? hideFiltersDoneButton: bool}
{@param? searchActionURL: string}
{@param? searchFormName: string}
{@param? searchInputName: string}
{@param? searchValue: string}
{@param? selectable: bool}
{@param? showAdvancedSearch: bool}
{@param? showFiltersDoneButton: bool}
{@param? showInfoButton: bool}
{@param? showSearch: bool}
{@param? sortingOrder: string}
Expand Down Expand Up @@ -370,9 +370,9 @@
{call ClayCheckbox.render}
{param disabled: $disabled /}
{param events: ['change': $_handleSelectPageCheckboxChanged] /}
{param hideLabel: true /}
{param label: 'Select Page' /}
{param ref: 'selectPageCheckbox' /}
{param showLabel: false /}
{/call}
</li>
{/if}
Expand All @@ -397,9 +397,9 @@

<li class="dropdown nav-item">
{call ClayDropdownBase.render}
{param button: $hideFiltersDoneButton ? null : [
{param button: $showFiltersDoneButton ? [
'label': 'Done'
] /}
] : null /}
{param disabled: $disabled /}
{param events: ['buttonClicked': $_handleFilterDoneButtonClick] /}
{param items: $filterItems /}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ describe('ClayManagementToolbar', function() {
type: 'item',
},
],
hideFiltersDoneButton: true,
showFiltersDoneButton: false,
spritemap: spritemap,
});

Expand Down
4 changes: 2 additions & 2 deletions packages/clay-radio/demos/a11y.html
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,8 @@ <h4>Hidden Label Radio</h4>

new metal.ClayRadio(
{
hideLabel: true,
label: 'Hidden Label Radio'
label: 'Hidden Label Radio',
showLabel: false,
},
'#hidden-label-block'
);
Expand Down
4 changes: 2 additions & 2 deletions packages/clay-radio/demos/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,8 @@ <h4>Hidden Label Radio</h4>

new metal.ClayRadio(
{
hideLabel: true,
label: 'Hidden Label Radio'
label: 'Hidden Label Radio',
showLabel: false,
},
'#hidden-label-block'
);
Expand Down
20 changes: 10 additions & 10 deletions packages/clay-radio/src/ClayRadio.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,6 @@ ClayRadio.STATE = {
*/
elementClasses: Config.string(),

/**
* Flag to indicate if label should be hide.
* @instance
* @memberof ClayRadio
* @type {?bool}
* @default false
*/
hideLabel: Config.bool().value(false),

/**
* Id to be applied to the element.
* @instance
Expand Down Expand Up @@ -81,7 +72,7 @@ ClayRadio.STATE = {

/**
* Custom content of the radio label. Use it to use your custom html.
* If this is used label and hideLabel params are ignored.
* If this is used label and showLabel params are ignored.
* @instance
* @memberof ClayRadio
* @type {?html|undefined}
Expand All @@ -98,6 +89,15 @@ ClayRadio.STATE = {
*/
name: Config.string(),

/**
* Flag to indicate if label should be hide.
* @instance
* @memberof ClayRadio
* @type {?bool}
* @default true
*/
showLabel: Config.bool().value(true),

/**
* Value to be applied to the element.
* @instance
Expand Down
Loading