Skip to content
This repository was archived by the owner on Aug 7, 2020. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
6083efc
fix(oui-datagrid): wait row promise before displaying cell template (…
frenautvh May 25, 2018
94f00b0
chore(oui-calendar): bump version of flatpickr to v4.5.0 (#193)
AxelPeter May 28, 2018
7733002
fix(oui-datagrid): add refresh & update events
frenautvh May 23, 2018
3d00851
feat(oui-datagrid): add datagrid service for refresh
May 28, 2018
c0233ca
feat(oui-collapsible): add oui-collapsible component (#173)
ganeshkumar1989 Jun 4, 2018
d2d9d1b
feat(oui-skeleton): add oui-skeleton component (#185)
varun257 Jun 4, 2018
0927421
fix(oui-action-menu): disable one-time binding for the text attribute
euhmeuh May 29, 2018
2546d9c
feat(oui-clipboard): add oui-clipboard component (#174)
varun257 Jun 6, 2018
8f2e5f7
feat(oui-slideshow): add slideshow component (#184)
rfougier Jun 12, 2018
a78c62f
fix(oui-slideshow): updade slideshow module naming (#202)
rfougier Jun 12, 2018
7a3bba5
feat(oui-navbar): add placeholder for notification (#199)
JDownloader Jun 13, 2018
751e7e7
feat(oui-datagrid): add datagrid customization (#196)
neolitec Jun 13, 2018
7a1a444
fix(oui-stepper): remove one time-binding on description (#203)
Jisay Jun 13, 2018
b48c8c9
feat(oui-field): add custom message support (#197)
Jisay Jun 13, 2018
a67c234
fix(oui-navbar): remove one-time binding on main links classnames
Jun 13, 2018
5663a03
feat(oui-page-header): create page-header component (#204)
rfougier Jun 15, 2018
b5f3264
chore(oui-slideshow): rename title attribute to heading
Jun 14, 2018
590959b
chore(oui-collapsible): rename title attribute to heading
Jun 14, 2018
5ceeb3c
fix(oui-modal): rename title attribute to heading
Jun 14, 2018
3391fe5
fix(oui-back-button): rename title attribute to heading
Jun 14, 2018
42808de
refactor: update oui-dropdown for action-menu and guide-menu (#198)
AxelPeter Jun 18, 2018
35b1378
chore: rename popover container
Jun 18, 2018
c1b312d
feat(oui-tile): create oui-tile component (#200)
whispyy Jun 18, 2018
1d2257e
docs(oui-dropdown): fix documentation heading (#208)
rfougier Jun 19, 2018
f0b21fd
feat(oui-guide-menu): create component (#207)
whispyy Jun 20, 2018
640bc84
chore: update to specs
Jun 20, 2018
ad07640
feat(oui-header-tabs): add header-tabs component (#209)
rfougier Jun 21, 2018
54f354a
chore: bump version to v2.16.0
rfougier Jun 21, 2018
792ae77
fix(oui-header-tabs): add active class when dropdown has an active it…
rfougier Jun 26, 2018
bc367ac
chore: bump version to v2.16.1
rfougier Jun 27, 2018
40bda50
refactor(oui-header-tabs): fix BEM naming (#214)
rfougier Jun 27, 2018
c09b9ba
fix(oui-datagrid): fix type options with dynamic columns (#218)
whispyy Jun 28, 2018
d0172b8
feat(oui-header-tabs): add disabled flag on items (#217)
rfougier Jun 28, 2018
103fd71
docs(oui-page-header): add missing header-tabs example (#220)
rfougier Jun 28, 2018
6bc8c89
fix(oui-tile): fix loading state (#219)
AxelPeter Jun 28, 2018
7ddee58
Merge branch 'master' into develop
Jun 29, 2018
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
61 changes: 61 additions & 0 deletions packages/oui-datagrid/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -465,6 +465,67 @@ You can use `row-loader`. It take the current row as argument and must return a
</oui-datagrid>
```

### Filtering using dynamic column

```html:preview
<oui-datagrid
rows="$ctrl.servers"
page-size="5"
columns="[{
title: 'Name',
property: 'name',
sortable: 'asc',
searchable: true,
filterable: true,
type: 'string',
typeOptions: {
operators: [
'contains'
]
}
},
{
title: 'CPUs',
property: 'cpu',
sortable: true,
searchable: true,
filterable: true,
type: 'number'
},
{
title: 'Running',
property: 'up',
sortable: true,
filterable: true,
type: 'boolean'
},
{
title: 'Purpose',
property: 'purpose',
sortable: true,
filterable: true,
type: 'options',
typeOptions: {
values: {
network: 'Network',
database: 'Database',
static: 'Static content',
frontend: 'Frontend',
backend: 'Backend',
broker: 'Broker',
others: 'Others'
}
}
},
{
title: 'IP',
property: 'ip',
sortable: true,
filterable: true,
type: 'string'
}]"></oui-datagrid>
```

### Refresh

#### Local datagrid
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ export default class DatagridColumnBuilder {
};
}

buildFromJs (columnsDescription, $scope) {
buildFromJs (columnsDescription) {
const columns = [];
const currentSorting = {
columnName: undefined,
Expand Down Expand Up @@ -132,8 +132,9 @@ export default class DatagridColumnBuilder {
column.searchable = DatagridColumnBuilder.isSearchable(column) &&
columnDescription.searchable;

if (column.typeOptions) {
column.typeOptions = this.$parse(column.typeOptions)($scope);

if (columnDescription.typeOptions) {
column.typeOptions = columnDescription.typeOptions;
}

column.preventCustomization = columnDescription.preventCustomization;
Expand Down
28 changes: 26 additions & 2 deletions packages/oui-header-tabs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,32 @@
<oui-header-tabs-item text="Datagrid" href="/#!/oui-angular/datagrid"></oui-header-tabs-item>
<oui-header-tabs-item text="Criteria Adder" href="#!/oui-angular/criteria-adder"></oui-header-tabs-item>
</oui-header-tabs-dropdown>
<oui-header-tabs-item text="Header Tabs" href="/#!/oui-angular/header-tabs" active></oui-header-tabs-item>
<oui-header-tabs-item text="Page Header" href="/#!/oui-angular/page-header"></oui-header-tabs-item>
</oui-header-tabs>
```

### Disabled items

```html:preview
<oui-header-tabs>
<oui-header-tabs-item text="Home" href="/#" disabled></oui-header-tabs-item>
<oui-header-tabs-dropdown text="Form">
<oui-header-tabs-item text="Field" href="/#!/oui-angular/field" disabled></oui-header-tabs-item>
<oui-header-tabs-divider></oui-header-tabs-divider>
<oui-header-tabs-item text="Checkbox" href="#!/oui-angular/checkbox"></oui-header-tabs-item>
<oui-header-tabs-item text="Radio" href="#!/oui-angular/radio-group" disabled></oui-header-tabs-item>
<oui-header-tabs-divider></oui-header-tabs-divider>
<oui-header-tabs-item text="Select" href="/#!/oui-angular/select"></oui-header-tabs-item>
<oui-header-tabs-item text="Select Picker" href="/#!/oui-angular/select-picker"></oui-header-tabs-item>
</oui-header-tabs-dropdown>
<oui-header-tabs-dropdown text="Datagrid">
<oui-header-tabs-item text="Datagrid" href="/#!/oui-angular/datagrid" disabled></oui-header-tabs-item>
<oui-header-tabs-item text="Criteria Adder" href="#!/oui-angular/criteria-adder" disabled></oui-header-tabs-item>
</oui-header-tabs-dropdown>
<oui-header-tabs-item text="Page Header" href="/#!/oui-angular/page-header"></oui-header-tabs-item>
<oui-header-tabs-item text="Header Tabs" href="/#!/oui-angular/header-tabs" active></oui-header-tabs-item>
</oui-header-tabs>
</oui-header-tabs>
```

### In Page Header
Expand Down Expand Up @@ -71,8 +94,9 @@
| `href` | string | @? | yes | | | href of the menu item
| `state` | boolean | @? | yes | | | state of the menu item
| `stateParams` | object | <? | | | | state params of the menu item
| `external` | boolean | <? | yes | `true`, `false` | `false` | external link flag
| `active` | boolean | <? | | `true`, `false` | `false` | manual active flag
| `disabled` | boolean | <? | yes | `true`, `false` | `false` | disabled flag
| `external` | boolean | <? | yes | `true`, `false` | `false` | external link flag

**Note:** `ui-router` is needed for the attributes `state` and `state-params`.

Expand Down
30 changes: 2 additions & 28 deletions packages/oui-header-tabs/src/header-tabs-dropdown.component.js
Original file line number Diff line number Diff line change
@@ -1,37 +1,11 @@
import controller from "./header-tabs-dropdown.controller";
import template from "./header-tabs-dropdown.html";

const itemClass = "oui-header-tabs__item";
const dropDownClass = `${itemClass}_dropdown`;

export default {
bindings: {
text: "@"
},
controller: class {
constructor ($element, $scope, $timeout) {
"ngInject";

this.$element = $element;
this.$scope = $scope;
this.$timeout = $timeout;
}

$postLink () {
this.$timeout(() => {
this.$element
.addClass(`${itemClass} ${dropDownClass}`)
.attr("role", "listitem");

this.$scope.$watch(() => !!this.$element[0].querySelector(`.${itemClass}_active`), hasActive => {
if (hasActive) {
this.$element.addClass(`${dropDownClass}_active`);
} else {
this.$element.removeClass(`${dropDownClass}_active`);
}
});
});
}
},
controller,
template,
transclude: true
};
45 changes: 45 additions & 0 deletions packages/oui-header-tabs/src/header-tabs-dropdown.controller.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
const ouiHeaderTabsItemClass = "oui-header-tabs__item";
const ouiHeaderTabsItemActiveClass = `${ouiHeaderTabsItemClass}_active`;
const ouiHeaderTabsItemDisabledClass = `${ouiHeaderTabsItemClass}_disabled`;
const ouiHeaderTabsDropDownClass = `${ouiHeaderTabsItemClass}_dropdown`;

export default class {
constructor ($element, $scope, $timeout) {
"ngInject";

this.$element = $element;
this.$scope = $scope;
this.$timeout = $timeout;
}

$onInit () {
this.disabled = false;
}

$postLink () {
this.$timeout(() => {
this.$element
.addClass(`${ouiHeaderTabsItemClass} ${ouiHeaderTabsDropDownClass}`)
.attr("role", "listitem");

const itemCount = (this.$element[0].querySelectorAll(`.${ouiHeaderTabsItemClass}`) || []).length;
this.$scope.$watch(() => (this.$element[0].querySelectorAll(`.${ouiHeaderTabsItemDisabledClass}`) || []).length, itemDisabledCount => {
if (itemDisabledCount === itemCount) {
this.disabled = true;
this.$element.addClass(ouiHeaderTabsItemDisabledClass);
} else {
this.disabled = false;
this.$element.removeClass(ouiHeaderTabsItemDisabledClass);
}
});

this.$scope.$watch(() => !!this.$element[0].querySelector(`.${ouiHeaderTabsItemActiveClass}`), hasActive => {
if (hasActive) {
this.$element.addClass(ouiHeaderTabsItemActiveClass);
} else {
this.$element.removeClass(ouiHeaderTabsItemActiveClass);
}
});
});
}
}
3 changes: 2 additions & 1 deletion packages/oui-header-tabs/src/header-tabs-dropdown.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<oui-dropdown align="center" arrow>
<oui-dropdown-trigger text="{{::$ctrl.text}}"></oui-dropdown-trigger>
<oui-dropdown-trigger text="{{::$ctrl.text}}"
disabled="$ctrl.disabled"></oui-dropdown-trigger>
<oui-dropdown-content class="oui-header-tabs__dropdown-container" role="list"
ng-transclude>
</oui-dropdown-content>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ export default {
state: "@?",
stateParams: "<?",
external: "<?",
active: "<?"
active: "<?",
disabled: "<?"
}
};
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export default class {

$onInit () {
addBooleanParameter(this, "active");
addBooleanParameter(this, "disabled");
addBooleanParameter(this, "external");

if (this.external) {
Expand Down
8 changes: 5 additions & 3 deletions packages/oui-header-tabs/src/header-tabs-item.html
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
<div class="oui-header-tabs__item" role="listitem"
ui-sref-active="oui-header-tabs__item_active"
ng-class="{ 'oui-header-tabs__item_active': $ctrl.active }">
ng-class="{ 'oui-header-tabs__item_active': $ctrl.active, 'oui-header-tabs__item_disabled': $ctrl.disabled }">
<a ng-attr-rel="{{::$ctrl.linkRel}}"
ng-attr-target="{{::$ctrl.linkTarget}}"
ng-href="{{::$ctrl.href}}"
ng-if="::!!$ctrl.href">
ng-if="!!$ctrl.href && !$ctrl.disabled">
<span ng-bind="::$ctrl.text"></span>
<span class="oui-icon oui-icon-external_link" aria-hidden="true"
ng-if="::$ctrl.external">
</span>
</a>
<a ng-bind="::$ctrl.text"
ng-if="::!!$ctrl.state"
ng-if="!!$ctrl.state && !$ctrl.disabled"
ui-sref="{{::$ctrl.getFullSref()}}">
</a>
<span ng-bind="::$ctrl.text"
ng-if="!!$ctrl.disabled"></span>
</div>
40 changes: 40 additions & 0 deletions packages/oui-header-tabs/src/index.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,46 @@ describe("ouiHeaderTabs", () => {
expect(linkItem.querySelector(".oui-icon-external_link")).not.toBeNull();
});

it("should display the header tabs with disabled items", () => {
const element = TestUtils.compileTemplate(`
<oui-header-tabs>
<oui-header-tabs-item text="Disabled" disabled></oui-header-tabs-item>
<oui-header-tabs-dropdown text="Dropdown">
<oui-header-tabs-item text="Disabled 1" disabled></oui-header-tabs-item>
<oui-header-tabs-item text="Disabled 2" disabled></oui-header-tabs-item>
</oui-header-tabs-dropdown>
</oui-header-tabs>`
);

$timeout.flush();

const item = element[0].querySelector(".oui-header-tabs__item");
expect(angular.element(item).hasClass("oui-header-tabs__item_disabled")).toBe(true);
const trigger = element[0].querySelector(".oui-dropdown__trigger");
expect(angular.element(trigger).attr("disabled")).toBe("disabled");
const dropDown = element[0].querySelector(".oui-header-tabs__item_dropdown");
expect(angular.element(dropDown).hasClass("oui-header-tabs__item_disabled")).toBe(true);
});

it("should display the header tabs with active items", () => {
const element = TestUtils.compileTemplate(`
<oui-header-tabs>
<oui-header-tabs-item text="Active" active></oui-header-tabs-item>
<oui-header-tabs-dropdown text="Dropdown">
<oui-header-tabs-item text="Active 1" active></oui-header-tabs-item>
<oui-header-tabs-item text="Active 2"></oui-header-tabs-item>
</oui-header-tabs-dropdown>
</oui-header-tabs>`
);

$timeout.flush();

const item = element[0].querySelector(".oui-header-tabs__item");
expect(angular.element(item).hasClass("oui-header-tabs__item_active")).toBe(true);
const dropDown = element[0].querySelector(".oui-header-tabs__item_dropdown");
expect(angular.element(dropDown).hasClass("oui-header-tabs__item_active")).toBe(true);
});

it("should display the header tabs with closed dropdown", () => {
const element = TestUtils.compileTemplate(`
<oui-header-tabs>
Expand Down
16 changes: 15 additions & 1 deletion packages/oui-page-header/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,21 @@
### With tabs

```html:preview
<oui-page-header heading="My title" description="My subtitle"></oui-page-header>
<oui-page-header heading="My title" description="My subtitle">
<oui-header-tabs>
<oui-header-tabs-item text="Home" href="/#"></oui-header-tabs-item>
<oui-header-tabs-item text="Page Header" href="/#!/oui-angular/page-header" active></oui-header-tabs-item>
<oui-header-tabs-item text="Header Tabs" href="/#!/oui-angular/header-tabs"></oui-header-tabs-item>
<oui-header-tabs-dropdown text="Form">
<oui-header-tabs-item text="Field" href="/#!/oui-angular/field"></oui-header-tabs-item>
<oui-header-tabs-divider></oui-header-tabs-divider>
<oui-header-tabs-item text="Checkbox" href="#!/oui-angular/checkbox"></oui-header-tabs-item>
<oui-header-tabs-item text="Radio" href="#!/oui-angular/radio-group"></oui-header-tabs-item>
</oui-header-tabs-dropdown>
<oui-header-tabs-item text="Pagination" href="/#!/oui-angular/pagination"></oui-header-tabs-item>
<oui-header-tabs-item text="Datagrid" href="/#!/oui-angular/datagrid"></oui-header-tabs-item>
</oui-header-tabs>
</oui-page-header>
```


Expand Down
18 changes: 18 additions & 0 deletions packages/oui-tile/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,24 @@
</oui-tile>
```

### Loading state

```html:preview
<div ng-init="$ctrl.loading = true" class="oui-doc-preview-only-keep-children">
<button class="oui-button oui-doc-preview-only" type="button"
ng-class="{
'oui-button_primary': $ctrl.loading,
'oui-button_secondary': !$ctrl.loading
}"
ng-click="$ctrl.loading = !$ctrl.loading">
Toggle loading
</button>
<oui-tile heading="Title" description="A great legend for this tile." loading="$ctrl.loading">
<p>Nulla ac dui a est varius eleifend nec vitae ipsum. Nunc venenatis luctus nisi quis pulvinar. Duis justo massa, mattis nec metus scelerisque, mattis tristique quam. Sed eget neque elementum, facilisis velit eget, iaculis lectus. Quisque at molestie justo. Ut tincidunt augue non tortor tincidunt facilisis. Donec ut lectus a leo porttitor eleifend. Morbi venenatis turpis eu rutrum consectetur. Sed auctor ligula at erat euismod, imperdiet posuere est feugiat. Quisque maximus ultricies risus sed varius.</p>
</oui-tile>
</div>
```

## API

### oui-tile
Expand Down
9 changes: 8 additions & 1 deletion packages/oui-tile/src/tile.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
<div class="oui-tile">
<h4 class="oui-header_4 oui-tile__title" ng-bind="::$ctrl.heading"></h4>
<p class="oui-tile__legend" ng-if="!!$ctrl.description" ng-bind="::$ctrl.description"></p>
<div class="oui-tile__body" ng-transclude></div>
<div class="oui-tile__body"
ng-if="!$ctrl.loading"
ng-transclude>
</div>
<div class="oui-tile__loader"
ng-if="$ctrl.loading">
<oui-spinner size="m"></oui-spinner>
</div>
</div>