Skip to content

Commit

Permalink
Merge branch 'main' into 8515-datagrid-dropdown
Browse files Browse the repository at this point in the history
  • Loading branch information
tmcconechy committed Apr 5, 2024
2 parents 661e089 + bc4eb48 commit c98f473
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 6 deletions.
11 changes: 10 additions & 1 deletion app/views/components/module-nav/example-index.html
Expand Up @@ -62,7 +62,7 @@
<aside id="nav" class="module-nav" data-options="{ 'filterable': true }">
<div class="module-nav-bar">
<!-- Module Nav's top-level navigation items are inside the accordion -->
<div class="module-nav-accordion accordion panel" data-options="{'allowOnePane': false}">
<div class="module-nav-accordion accordion panel" data-options="{'allowOnePane': false }">
<!-- Module switcher -->
<div class="module-nav-header accordion-section">
<div class="module-nav-switcher">
Expand Down Expand Up @@ -355,6 +355,10 @@ <h1>Module Nav</h1>
<input type="checkbox" class="checkbox" name="hide-completely" id="hide-completely" />
<label for="hide-completely" class="checkbox-label">Hide completely</label>
</div>
<div class="field">
<input type="checkbox" class="checkbox" name="disable-switcher" id="disable-switcher" />
<label for="disable-switcher" class="checkbox-label">Disable switcher</label>
</div>
</div>
</div>
<div class="row test-spacer">&nbsp;</div>
Expand All @@ -379,6 +383,7 @@ <h1>Module Nav</h1>
const hideCompletelyEl = $('#hide-completely');
const hamburgerBtnEl = $('#header-hamburger');
const pinSectionsCheckEl = $('#pin-sections');
const disableSwitcher = $('#disable-switcher');

displayCheckEl.on('change.test', (e) => {
navAPI.updated({ showDetailView: displayCheckEl[0].checked });
Expand All @@ -388,6 +393,10 @@ <h1>Module Nav</h1>
navAPI.updated({ pinSections: pinSectionsCheckEl[0].checked });
});

disableSwitcher.on('change.test', (e, mode) => {
navAPI.updated({ disableSwitcher: disableSwitcher[0].checked });
})

if (hamburgerBtnEl.length) {
hamburgerBtnEl.on('click.test', (e) => {
navAPI.handleHamburgerClick();
Expand Down
5 changes: 5 additions & 0 deletions docs/CHANGELOG.md
Expand Up @@ -2,9 +2,14 @@

## v4.95.0

## v4.95.0 Features

- `[Module Nav]` Added setting `disableSwitcher` to disable nav switcher. ([#8381](https://github.com/infor-design/enterprise/issues/8381))

## v4.95.0 Fixes

- `[Datagrid]` Fixed search icon misalignment in dropwdown cells. ([#8515](https://github.com/infor-design/enterprise/issues/8515))
- `[Forms]` Fixed fileupload layout in compact form. ([#8537](https://github.com/infor-design/enterprise/issues/8537))

## v4.94.0

Expand Down
16 changes: 15 additions & 1 deletion src/components/module-nav/module-nav.dropdown.scss
Expand Up @@ -5,7 +5,7 @@ $module-nav-container-size: $module-nav-switcher-button-size + $module-nav-switc

@mixin module-nav-div-dropdown-adjustment() {
background-color: $module-nav-switcher-dropdown-background-color;
padding-block-start: 9px;
padding-block-start: 7px;
padding-block-end: 7px;
padding-inline-start: 8px;
padding-inline-end: 40px;
Expand Down Expand Up @@ -37,6 +37,20 @@ $module-nav-container-size: $module-nav-switcher-button-size + $module-nav-switc
top: 4px;
}

&.is-disabled {
background-color: transparent;
border: none;
margin-inline-start: -6px;

span {
font-size: 2rem;
}

+ .icon {
display: none;
}
}

// Overrides a dropdown default
&:focus {
box-shadow: none;
Expand Down
10 changes: 8 additions & 2 deletions src/components/module-nav/module-nav.js
Expand Up @@ -40,7 +40,8 @@ const MODULE_NAV_DEFAULTS = {
showGuestSection: false,
showSearchBar: true,
enableOutsideClick: false,
autoCollapseOnMobile: true
autoCollapseOnMobile: true,
disableSwitcher: false
};

const toggleScrollbar = (el, doToggle) => {
Expand Down Expand Up @@ -189,7 +190,12 @@ ModuleNav.prototype = {

// Auto-init child components, if applicable
if (this.settings.initChildren) {
if (!this.switcherAPI) $(this.switcherEl).modulenavswitcher({ displayMode: this.settings.displayMode });
if (!this.switcherAPI) {
$(this.switcherEl).modulenavswitcher({
displayMode: this.settings.displayMode,
disabled: this.settings.disableSwitcher
});
}
if (!this.settingsAPI) $(this.settingsEl).modulenavsettings({ displayMode: this.settings.displayMode });
if (!this.accordionAPI) {
$(this.accordionEl).accordion(this.settings.accordionSettings);
Expand Down
13 changes: 11 additions & 2 deletions src/components/module-nav/module-nav.switcher.js
Expand Up @@ -180,13 +180,22 @@ ModuleNavSwitcher.prototype = {
},

renderRoleDropdown() {
const roleDropdown = $(this.roleDropdownEl);

if (this.settings.generate && (!this.roleDropdownContainerEl || !this.roleDropdownEl)) {
this.element[0].insertAdjacentHTML('beforeend', dropdownTemplate(this.settings.roleDropdownLabel));
}
if (!$(this.roleDropdownEl).find('option').length) {
if (!roleDropdown.find('option').length) {
this.renderDropdownOptions();
}
$(this.roleDropdownEl).dropdown({

if (this.settings.disabled) {
roleDropdown.attr('disabled', true);
} else {
roleDropdown.removeAttr('disabled');
}

roleDropdown.dropdown({
cssClass: 'role-dropdown',
dropdownIcon: 'expand-all',
extraListWrapper: true,
Expand Down

0 comments on commit c98f473

Please sign in to comment.