diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS
new file mode 100644
index 00000000..bbe36932
--- /dev/null
+++ b/.github/CODEOWNERS
@@ -0,0 +1 @@
+@AxelPeter @FredericEspiau @euhmeuh @JeremyDec
diff --git a/.github/CODE_OF_CONDUCT.md b/.github/CODE_OF_CONDUCT.md
new file mode 100644
index 00000000..6270440b
--- /dev/null
+++ b/.github/CODE_OF_CONDUCT.md
@@ -0,0 +1,74 @@
+# Contributor Covenant Code of Conduct
+
+## Our Pledge
+
+In the interest of fostering an open and welcoming environment, we as
+contributors and maintainers pledge to making participation in our project and
+our community a harassment-free experience for everyone, regardless of age, body
+size, disability, ethnicity, gender identity and expression, level of experience,
+nationality, personal appearance, race, religion, or sexual identity and
+orientation.
+
+## Our Standards
+
+Examples of behavior that contributes to creating a positive environment
+include:
+
+* Using welcoming and inclusive language
+* Being respectful of differing viewpoints and experiences
+* Gracefully accepting constructive criticism
+* Focusing on what is best for the community
+* Showing empathy towards other community members
+
+Examples of unacceptable behavior by participants include:
+
+* The use of sexualized language or imagery and unwelcome sexual attention or
+advances
+* Trolling, insulting/derogatory comments, and personal or political attacks
+* Public or private harassment
+* Publishing others' private information, such as a physical or electronic
+ address, without explicit permission
+* Other conduct which could reasonably be considered inappropriate in a
+ professional setting
+
+## Our Responsibilities
+
+Project maintainers are responsible for clarifying the standards of acceptable
+behavior and are expected to take appropriate and fair corrective action in
+response to any instances of unacceptable behavior.
+
+Project maintainers have the right and responsibility to remove, edit, or
+reject comments, commits, code, wiki edits, issues, and other contributions
+that are not aligned to this Code of Conduct, or to ban temporarily or
+permanently any contributor for other behaviors that they deem inappropriate,
+threatening, offensive, or harmful.
+
+## Scope
+
+This Code of Conduct applies both within project spaces and in public spaces
+when an individual is representing the project or its community. Examples of
+representing a project or community include using an official project e-mail
+address, posting via an official social media account, or acting as an appointed
+representative at an online or offline event. Representation of a project may be
+further defined and clarified by project maintainers.
+
+## Enforcement
+
+Instances of abusive, harassing, or otherwise unacceptable behavior may be
+reported by contacting the project team at [github@ovh.net](mailto:github@ovh.net). All
+complaints will be reviewed and investigated and will result in a response that
+is deemed necessary and appropriate to the circumstances. The project team is
+obligated to maintain confidentiality with regard to the reporter of an incident.
+Further details of specific enforcement policies may be posted separately.
+
+Project maintainers who do not follow or enforce the Code of Conduct in good
+faith may face temporary or permanent repercussions as determined by other
+members of the project's leadership.
+
+## Attribution
+
+This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
+available at [http://contributor-covenant.org/version/1/4][version]
+
+[homepage]: http://contributor-covenant.org
+[version]: http://contributor-covenant.org/version/1/4/
diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md
new file mode 100644
index 00000000..a2c61201
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE.md
@@ -0,0 +1,26 @@
+### Description
+
+
+
+
+### Steps to reproduce
+
+
+1. [First Step]
+2. [Second Step]
+3. [and so on...]
+
+**Expected behavior**:
+
+
+
+**Actual behavior**:
+
+
+
+**Frequency**:
+
+
+### Additional information
+
+
diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md
new file mode 100644
index 00000000..decc978f
--- /dev/null
+++ b/.github/PULL_REQUEST_TEMPLATE.md
@@ -0,0 +1,27 @@
+### Requirements
+
+* Filling out the template is required. Any pull request that does not include enough information to be reviewed in a timely manner may be closed at the maintainers' discretion.
+* All new code requires tests to ensure against regressions
+
+## Title of the Pull Requests
+
+
+### Description of the Change
+
+
+
+
+### Benefits
+
+
+
+
+### Possible Drawbacks
+
+
+
+
+### Applicable Issues
+
+
+
diff --git a/README.md b/README.md
index 0ede3f63..e220e5c7 100644
--- a/README.md
+++ b/README.md
@@ -1,13 +1,15 @@
+# OVH UI Kit (AngularJS)
+
+
+
+A set of maintainable components for the OVH ecosystem (AngularJS).
+
[](https://nodei.co/npm/ovh-ui-angular/)

[]()
[](https://gitter.im/ovh/ux)
-# OVH UI (Angular)
-
-A set of maintainable components for the OVH ecosystem (Angular).
-
## Installation
### Prerequisites
@@ -23,25 +25,31 @@ You will also need these dependencies in your project:
Follow the [guide](https://github.com/ovh-ux/ovh-ui-kit) for _ovh-ui-kit_, because you need to integrate it by _yourself_.
-### bower
+### Install with [npm](https://www.npmjs.com/)
```bash
-bower install --save ovh-ui-angular
+npm install ovh-ui-angular
```
-### npm
+### Install with [yarn](https://yarnpkg.com)
```bash
-npm install --save ovh-ui-angular
+yarn add ovh-ui-angular
+```
+
+### Install with [bower](https://bower.io/) (deprecated)
+
+```bash
+bower install --save ovh-ui-angular
```
## Usage
-1. In your `index.html`, you need to load `oui-angular.js`:
+1. In your `index.html`, you need to load `oui-angular.min.js`:
```html
...
-
+
...
```
diff --git a/package.json b/package.json
index b632e25d..32f12cd1 100644
--- a/package.json
+++ b/package.json
@@ -33,16 +33,16 @@
}
},
"dependencies": {
- "clipboard": "2.0.1",
+ "angular": "~1.6.1",
+ "angular-aria": "~1.6.1",
+ "angular-sanitize": "~1.6.1",
+ "clipboard": "^2.0.1",
"escape-string-regexp": "^1.0.5",
- "flatpickr": "4.5.0",
+ "flatpickr": "^4.5.1",
"popper.js": "^1.14.3"
},
"devDependencies": {
- "angular": "~1.6.1",
- "angular-aria": "~1.6.1",
"angular-mocks": "~1.6.1",
- "angular-sanitize": "~1.6.1",
"autoprefixer": "^8.0.0",
"babel-cli": "^6.18.0",
"babel-core": "^6.21.0",
@@ -54,7 +54,6 @@
"babel-preset-env": "^1.6.1",
"babel-preset-stage-2": "^6.22.0",
"babel-register": "^6.18.0",
- "bootstrap": "^3.3.7",
"cross-env": "^5.1.0",
"css-loader": "^0.28.4",
"eslint": "^4.3.0",
diff --git a/packages/oui-action-menu/README.md b/packages/oui-action-menu/README.md
index 070bfd46..62d801d1 100644
--- a/packages/oui-action-menu/README.md
+++ b/packages/oui-action-menu/README.md
@@ -91,19 +91,19 @@
| Attribute | Type | Binding | One-time binding | Values | Default | Description
| ---- | ---- | ---- | ---- | ---- | ---- | ----
-| `text` | string | @ | yes | | | button label
-| `aria-label` | string | @? | yes | | | accessibility label
-| `align` | string | @? | yes | `start`,`center`,`end` | `center` | menu alignment
-| `compact` | boolean | | yes | | `false` | use the compact button
-| `disabled` | boolean | | | | `false` | disable flag
+| `text` | string | @ | yes | n/a | n/a | button label
+| `aria-label` | string | @? | yes | n/a | n/a | accessibility label
+| `align` | string | @? | yes | `start`, `center`, `end` | `center` | menu alignment
+| `compact` | boolean | | yes | `true`, `false` | `false` | use the compact button
+| `disabled` | boolean | | no | `true`, `false` | `false` | disable flag
### oui-action-menu-item
| Attribute | Type | Binding | One-time binding | Values | Default | Description
| ---- | ---- | ---- | ---- | ---- | ---- | ----
-| `text` | string | @ | | | | button label
-| `aria-label` | string | @? | | | | accessibility label
-| `href` | string | @? | yes | | | hypertext link (link)
-| `disabled` | boolean | | | | `false` | disable (button)
-| `external` | boolean | @? | yes | | | display external icon (link)
-| `on-click` | | &? | | | | on-click handler (button)
+| `text` | string | @ | no | n/a | n/a | button label
+| `aria-label` | string | @? | no | n/a | n/a | accessibility label
+| `href` | string | @? | yes | n/a | n/a | hypertext link (link)
+| `disabled` | boolean | | no | `true`, `false` | `false` | disable (button)
+| `external` | boolean | @? | yes | `true`, `false` | `false` | display external icon (link)
+| `on-click` | function | &? | no | n/a | n/a | on-click handler (button)
diff --git a/packages/oui-angular/src/index.js b/packages/oui-angular/src/index.js
index f5987913..0c2c42ba 100644
--- a/packages/oui-angular/src/index.js
+++ b/packages/oui-angular/src/index.js
@@ -37,43 +37,45 @@ import Textarea from "@oui-angular/oui-textarea/src";
import Tile from "@oui-angular/oui-tile/src";
import Tooltip from "@oui-angular/oui-tooltip/src";
-angular.module("oui", [
- ActionMenu,
- BackButton,
- Button,
- Calendar,
- Checkbox,
- Chips,
- Clipboard,
- Collapsible,
- CriteriaAdder,
- CriteriaContainer,
- Datagrid,
- Dropdown,
- Field,
- FormActions,
- GuideMenu,
- HeaderTabs,
- Message,
- Modal,
- Navbar,
- Numeric,
- PageHeader,
- Pagination,
- Popover,
- Progress,
- Radio,
- RadioGroup,
- RadioToggleGroup,
- Search,
- Select,
- SelectPicker,
- Skeleton,
- Slideshow,
- Spinner,
- Stepper,
- Switch,
- Textarea,
- Tile,
- Tooltip
-]);
+export default angular
+ .module("oui", [
+ ActionMenu,
+ BackButton,
+ Button,
+ Calendar,
+ Checkbox,
+ Chips,
+ Clipboard,
+ Collapsible,
+ CriteriaAdder,
+ CriteriaContainer,
+ Datagrid,
+ Dropdown,
+ Field,
+ FormActions,
+ GuideMenu,
+ HeaderTabs,
+ Message,
+ Modal,
+ Navbar,
+ Numeric,
+ PageHeader,
+ Pagination,
+ Popover,
+ Progress,
+ Radio,
+ RadioGroup,
+ RadioToggleGroup,
+ Search,
+ Select,
+ SelectPicker,
+ Skeleton,
+ Slideshow,
+ Spinner,
+ Stepper,
+ Switch,
+ Textarea,
+ Tile,
+ Tooltip
+ ])
+ .name;
diff --git a/packages/oui-back-button/README.md b/packages/oui-back-button/README.md
index a6012b08..3164d9b3 100644
--- a/packages/oui-back-button/README.md
+++ b/packages/oui-back-button/README.md
@@ -28,11 +28,10 @@
| Attribute | Type | Binding | One-time binding | Values | Default | Description
| ---- | ---- | ---- | ---- | ---- | ---- | ----
-| `id` | string | @? | true | | | id attribute of the input
-| `name` | string | @? | true | | | name attribute of the input
-| `aria-label` | string | @? | true | | | accessibility label
-| `heading` | string | @? | true | | | text of the header
-| `on-click` | function | &? | | | | callback on component click
-| `href` | string | @? | true | | | url of the return link
-| `state` | string | @? | yes | | | state of the return link
-| `stateParams` | object | | | | | state params of the return link
+| `id` | string | @? | yes | n/a | n/a | id attribute of the button/link
+| `name` | string | @? | yes | n/a | n/a | name attribute of the button/link
+| `aria-label` | string | @? | yes | n/a | n/a | accessibility label of the button/link
+| `href` | string | @? | yes | n/a | n/a | url of the return link
+| `state` | string | @? | yes | n/a | n/a | state of the return link
+| `stateParams` | object | | no | n/a | n/a | state params of the return link
+| `on-click` | function | &? | no | n/a | n/a | callback on component click
diff --git a/packages/oui-back-button/src/back-button.component.js b/packages/oui-back-button/src/back-button.component.js
index aff90480..e3d2a867 100644
--- a/packages/oui-back-button/src/back-button.component.js
+++ b/packages/oui-back-button/src/back-button.component.js
@@ -7,13 +7,13 @@ export default {
bindings: {
id: "@?",
name: "@?",
+ heading: "@?", // Deprecated: Replaced by transclude value
+ title: "@?", // Deprecated: Replaced by transclude value
ariaLabel: "@?",
- heading: "@?",
- title: "@?", // Deprecated: Replaced by 'heading'
- onClick: "&?",
href: "@?",
state: "@?",
- stateParams: ""
+ stateParams: "",
+ onClick: "&?"
},
transclude: true
};
diff --git a/packages/oui-back-button/src/back-button.html b/packages/oui-back-button/src/back-button.html
index aabc6d51..29bf275f 100644
--- a/packages/oui-back-button/src/back-button.html
+++ b/packages/oui-back-button/src/back-button.html
@@ -1,22 +1,28 @@
-
+ type="button"
+ class="oui-button oui-button_icon-alone"
+ ng-attr-aria-label="{{:: $ctrl.ariaLabel }}"
+ ng-attr-id="{{:: $ctrl.id }}"
+ ng-attr-name="{{:: $ctrl.name }}"
+ ng-click="$ctrl.onBtnClick()">
+
-
+
-
+
diff --git a/packages/oui-button/README.md b/packages/oui-button/README.md
index 5349de49..49e54969 100644
--- a/packages/oui-button/README.md
+++ b/packages/oui-button/README.md
@@ -30,34 +30,33 @@
```html:preview
-
-
+ Previous
+ Next
-
-
+ Previous
+ Next
```
### Accessibility
```html:preview
-
+Button with accessibility
```
- `aria-label` add an attribute `aria-label` on the button.
## API
-| Attribute | Type | Binding | One-time Binding | Values | Default | Description |
-| ---- | ---- | ---- | ---- | ---- | ---- | ---- |
-| text | string | @ | true | | | button text |
-| id | string | @? | true | | | id attribute of the button |
-| name | string | @? | true | | | name attribute of the button |
-| type | string | @? | true | submit,button,reset | button | type attribute of the button |
-| variant | string | @? | true | primary,secondary,link | secondary | modifier for button |
-| variant-nav | string | @? | true | next,previous | | nav modifier for button |
-| aria-label | string | @? | true | | | accessibility label |
-| disabled | boolean | | | | false | disabled flag |
-| on-click | function | &? | | | | click handler
+| Attribute | Type | Binding | One-time Binding | Values | Default | Description
+| ---- | ---- | ---- | ---- | ---- | ---- | ----
+| `id` | string | @? | yes | n/a | n/a | id attribute of the button
+| `name` | string | @? | yes | n/a | n/a | name attribute of the button
+| `type` | string | @? | yes | `submit`, `button`, `reset` | `button` | type attribute of the button
+| `variant` | string | @? | yes | `primary`, `secondary`, `link` | `secondary` | modifier for button
+| `variant-nav` | string | @? | yes | `next`, `previous` | n/a | nav modifier for button
+| `aria-label` | string | @? | yes | n/a | n/a | accessibility label
+| `disabled` | boolean | | no | `true`, `false` | `false` | disabled flag
+| `on-click` | function | &? | no | n/a | n/a | click handler
diff --git a/packages/oui-button/src/button.component.js b/packages/oui-button/src/button.component.js
index 8c75fc2b..9bb491b5 100644
--- a/packages/oui-button/src/button.component.js
+++ b/packages/oui-button/src/button.component.js
@@ -3,17 +3,15 @@ import template from "./button.html";
export default {
bindings: {
- text: "@",
+ text: "@?", // Deprecated: Replaced by transclude value
id: "@?",
name: "@?",
- type: "@?", // values: submit|button|reset (default: button)
- variant: "@?", // values: primary|secondary|link (default: secondary)
- variantNav: "@?", // values: previous|next
+ type: "@?",
+ variant: "@?",
+ variantNav: "@?",
ariaLabel: "@?",
-
disabled: "",
-
- onClick: "&?"
+ onClick: "&"
},
controller,
template,
diff --git a/packages/oui-button/src/button.controller.js b/packages/oui-button/src/button.controller.js
index c7533e84..0ded8cd7 100644
--- a/packages/oui-button/src/button.controller.js
+++ b/packages/oui-button/src/button.controller.js
@@ -1,4 +1,4 @@
-import { addBooleanParameter } from "@oui-angular/common/component-utils";
+import { addBooleanParameter, addDefaultParameter } from "@oui-angular/common/component-utils";
export default class {
constructor ($attrs, $element, $timeout) {
@@ -10,17 +10,9 @@ export default class {
}
$onInit () {
- // Add default value for attribute 'type'
- if (angular.isUndefined(this.type)) {
- this.type = "button";
- }
-
- // Add default value for attribute 'variant'
- if (angular.isUndefined(this.variant)) {
- this.variant = "secondary";
- }
-
addBooleanParameter(this, "disabled");
+ addDefaultParameter(this, "type", "button");
+ addDefaultParameter(this, "variant", "secondary");
}
$postLink () {
diff --git a/packages/oui-calendar/README.md b/packages/oui-calendar/README.md
index 8eaef7ed..5d8766e7 100644
--- a/packages/oui-calendar/README.md
+++ b/packages/oui-calendar/README.md
@@ -151,29 +151,29 @@ Use `mode` to set a different selection mode for the calendar
## API
-| Attribute | Type | Binding | One-time Binding | Values | Default | Description |
-| ---- | ---- | ---- | ---- | ---- | ---- | ---- |
-| `model` | object | = | | See [Supplying Dates](https://flatpickr.js.org/examples/#supplying-dates-for-flatpickr) | | model bound to component |
-| `id` | string | @? | true | | | id attribute of the field |
-| `name` | string | @? | true | | | name attribute of the field |
-| `placeholder` | string | @? | true | | | placeholder text |
-| `inline` | boolean | | false | `true`, `false` | `false` | show the calendar below the input |
-| `static` | boolean | | false | `true`, `false` | `false` | position the calendar relatively to the input |
-| `mode` | string | @? | true | `single`, `multiple`, `range` | `single` | selection mode |
-| `format` | string | @? | true | See [Formatting Tokens](https://flatpickr.js.org/formatting/) | `Y-m-d` | format the date of the model |
-| `alt-format` | string | @? | true | See [Formatting Tokens](https://flatpickr.js.org/formatting/) | `Y-m-d` | format the date of the field. `format` is used if undefined |
-| `append-to-body` | boolean | | true | `true`, `false` | `false` | append the calendar to the body of the page |
-| `inline` | boolean | | true | `true`, `false` | `false` | show the calendar below the input in `inline-block` |
-| `max-date` | object | | true | See [Supplying Dates](https://flatpickr.js.org/examples/#supplying-dates-for-flatpickr) | | specifies the maximum/latest date (inclusively) allowed for selection |
-| `min-date` | object | | true | See [Supplying Dates](https://flatpickr.js.org/examples/#supplying-dates-for-flatpickr) | | specifies the minimum/earliest date (inclusively) allowed for selection |
-| `disable-date` | array | | true | See [Supplying Dates](https://flatpickr.js.org/examples/#supplying-dates-for-flatpickr) | | make certain dates unavailable for selection |
-| `enable-date` | array | | true | See [Supplying Dates](https://flatpickr.js.org/examples/#supplying-dates-for-flatpickr) | | make certain dates only available for selection |
-| `disabled` | boolean | | | `true`, `false` | `false` | disabled flag |
-| `required` | boolean | | | `true`, `false` | `false` | required flag |
-| `week-numbers` | boolean | | | `true`, `false` | `false` | week numbers flag |
-| `on-change` | function | & | | | | handler triggered when the user selects a date, or changes the time on a selected date |
-| `on-close` | function | & | | | | handler triggered when the calendar is closed |
-| `on-open` | function | & | | | | handler triggered when the calendar is opened |
+| Attribute | Type | Binding | One-time Binding | Values | Default | Description
+| ---- | ---- | ---- | ---- | ---- | ---- | ----
+| `model` | object | = | no | See [Supplying Dates](https://flatpickr.js.org/examples/#supplying-dates-for-flatpickr) | n/a | model bound to component
+| `id` | string | @? | yes | n/a | n/a | id attribute of the field
+| `name` | string | @? | yes | n/a | n/a | name attribute of the field
+| `placeholder` | string | @? | yes | n/a | n/a | placeholder text
+| `inline` | boolean | | no | `true`, `false` | `false` | show the calendar below the input
+| `static` | boolean | | no | `true`, `false` | `false` | position the calendar relatively to the input
+| `mode` | string | @? | yes | `single`, `multiple`, `range` | `single` | selection mode
+| `format` | string | @? | yes | See [Formatting Tokens](https://flatpickr.js.org/formatting/) | `Y-m-d` | format the date of the model
+| `alt-format` | string | @? | yes | See [Formatting Tokens](https://flatpickr.js.org/formatting/) | `Y-m-d` | format the date of the field. `format` is used if undefined
+| `append-to-body` | boolean | | yes | `true`, `false` | `false` | append the calendar to the body of the page
+| `inline` | boolean | | yes | `true`, `false` | `false` | show the calendar below the input in `inline-block`
+| `max-date` | object | | yes | See [Supplying Dates](https://flatpickr.js.org/examples/#supplying-dates-for-flatpickr) | n/a | specifies the maximum/latest date (inclusively) allowed for selection
+| `min-date` | object | | yes | See [Supplying Dates](https://flatpickr.js.org/examples/#supplying-dates-for-flatpickr) | n/a | specifies the minimum/earliest date (inclusively) allowed for selection
+| `disable-date` | array | | yes | See [Supplying Dates](https://flatpickr.js.org/examples/#supplying-dates-for-flatpickr) | n/a | make certain dates unavailable for selection
+| `enable-date` | array | | yes | See [Supplying Dates](https://flatpickr.js.org/examples/#supplying-dates-for-flatpickr) | n/a | make certain dates only available for selection
+| `week-numbers` | boolean | | yes | `true`, `false` | `false` | week numbers flag
+| `disabled` | boolean | | no | `true`, `false` | `false` | disabled flag
+| `required` | boolean | | no | `true`, `false` | `false` | required flag
+| `on-change` | function | & | no | n/a | n/a | handler triggered when the user selects a date, or changes the time on a selected date
+| `on-close` | function | & | no | n/a | n/a | handler triggered when the calendar is closed
+| `on-open` | function | & | no | n/a | n/a | handler triggered when the calendar is opened
## Configuration
diff --git a/packages/oui-checkbox/README.md b/packages/oui-checkbox/README.md
index bccf8618..b1d470c8 100644
--- a/packages/oui-checkbox/README.md
+++ b/packages/oui-checkbox/README.md
@@ -7,16 +7,16 @@
### Unchecked
```html:preview
-
-
+Normal
+Disabled
```
### Checked
```html:preview
-
-
+ Normal
+ Disabled
```
@@ -24,8 +24,8 @@
```html:preview
-
-
+ Normal
+ Disabled
```
@@ -34,7 +34,7 @@
```html:preview
@@ -44,38 +44,32 @@
```html:preview
-
-
+ Normal
+ Disabled
```
### On change
-**Note:** Model will not be refreshed until the `on-change` callback as not finished. If you want to access the new model inside the `on-change` callback you need to use the `modelValue` variable as below.
+**Note**: Model will not be refreshed until the `on-change` callback hasn't returned. If you want to access the new model inside the `on-change` callback you need to use the `modelValue` variable as below.
```html:preview
+>Normal
Last onChange value: {{ $ctrl.lastOnChangeValue }}
```
-### Accessibility
-
-Needs to be done.
-
## API
-| Attribute | Type | Binding | One-time Binding | Values | Default | Description
-| ---- | ---- | ---- | ---- | ---- | ---- | ----
-| text | string | @ | | | | checkbox text
-| description | string | @? | | | | description text
-| id | string | @? | `true` | | | id attribute of the checkbox
-| name | string | @? | `true` | | | name attribute of the checkbox
-| disabled | boolean | | | | false | disabled flag
-| model | nullable<boolean> | =? | | `true`, `false`, `null` | | current value of the checkbox and null is considered as `indeterminate`
-| required | boolean | | | | false | `true` if the checkbox should be checked
-| on-change | function | &? | | | | handler triggered when value has changed
+| Attribute | Type | Binding | One-time Binding | Values | Default | Description
+| ---- | ---- | ---- | ---- | ---- | ---- | ----
+| `model` | boolean | null | =? | no | `true`, `false`, `null` | n/a | current value of the checkbox and null is considered as `indeterminate`
+| `id` | string | @? | yes | n/a | n/a | id attribute of the checkbox
+| `name` | string | @? | yes | n/a | n/a | name attribute of the checkbox
+| `description` | string | @? | no | n/a | n/a | description text
+| `disabled` | boolean | | no | `true`, `false` | `false` | disabled flag
+| `required` | boolean | | no | `true`, `false` | `false` | required flag
+| `on-change` | function | & | no | n/a | n/a | handler triggered when value has changed
diff --git a/packages/oui-checkbox/src/checkbox.component.js b/packages/oui-checkbox/src/checkbox.component.js
index 984e83de..3663b59a 100644
--- a/packages/oui-checkbox/src/checkbox.component.js
+++ b/packages/oui-checkbox/src/checkbox.component.js
@@ -5,13 +5,14 @@ export default {
template,
controller,
bindings: {
- text: "@",
- description: "@?",
+ model: "=?",
id: "@?",
name: "@?",
- model: "=?",
- onChange: "&?",
+ text: "@?", // Deprecated: Replaced by transclude value
+ description: "@?",
disabled: "",
- required: ""
- }
+ required: "",
+ onChange: "&"
+ },
+ transclude: true
};
diff --git a/packages/oui-checkbox/src/checkbox.controller.js b/packages/oui-checkbox/src/checkbox.controller.js
index 9f5f7965..331b01c7 100644
--- a/packages/oui-checkbox/src/checkbox.controller.js
+++ b/packages/oui-checkbox/src/checkbox.controller.js
@@ -17,6 +17,7 @@ export default class {
// So we use $timeout to force the $apply
this.$timeout(() =>
this.$element
+ .addClass("oui-checkbox")
.removeAttr("id")
.removeAttr("name")
);
diff --git a/packages/oui-checkbox/src/checkbox.html b/packages/oui-checkbox/src/checkbox.html
index 1ee3ae1a..fc1249ef 100644
--- a/packages/oui-checkbox/src/checkbox.html
+++ b/packages/oui-checkbox/src/checkbox.html
@@ -1,27 +1,28 @@
-
-
-
+
+
-
-
-
-
-
-
-
+ {{$ctrl.text}}
+
+
+
+
+
+
-
-
-
+
+
+
diff --git a/packages/oui-chips/README.md b/packages/oui-chips/README.md
index adaae211..17a4de2b 100644
--- a/packages/oui-chips/README.md
+++ b/packages/oui-chips/README.md
@@ -49,9 +49,9 @@
## API
-| Attribute | Type | Binding | One-time Binding | Values | Default | Description |
-| ---- | ---- | ---- | ---- | ---- | ---- | ---- |
-| items | object | < | | | | items bound to component |
-| closable | boolean | | | | false | closable flag |
-| stacked | boolean | | | | false | stacked flag |
-| on-remove | function | & | | | | handler triggered when items are removed |
+| Attribute | Type | Binding | One-time Binding | Values | Default | Description
+| ---- | ---- | ---- | ---- | ---- | ---- | ----
+| `items` | object | < | no | n/a | n/a | items bound to component
+| `closable` | boolean | | yes | `true`, `false` | `false` | closable flag
+| `stacked` | boolean | | yes | `true`, `false` | `false` | stacked flag
+| `on-remove` | function | & | no | n/a | n/a | handler triggered when items are removed
diff --git a/packages/oui-chips/src/chips.component.js b/packages/oui-chips/src/chips.component.js
index a32f9c2e..df8ec779 100644
--- a/packages/oui-chips/src/chips.component.js
+++ b/packages/oui-chips/src/chips.component.js
@@ -9,10 +9,8 @@ export default {
controller,
bindings: {
items: "<",
-
closable: "",
stacked: "",
-
onRemove: "&"
}
};
diff --git a/packages/oui-clipboard/README.md b/packages/oui-clipboard/README.md
index aa04d74f..e8c2f1c6 100644
--- a/packages/oui-clipboard/README.md
+++ b/packages/oui-clipboard/README.md
@@ -11,15 +11,19 @@
-
Model value: {{$ctrl.simpleModel | json}}
+
Model value: {{$ctrl.simpleModel}}
```
### Formatted text
```html:preview
-
+
@@ -29,8 +33,8 @@ Donec vitae lobortis dui, at accumsan purus. Nullam porta leo purus, nec digniss
## API
-| Attribute | Type | Binding | One-time Binding | Values | Default | Description
-| ---- | ---- | ---- | ---- | ---- | ---- | ----
-| id | string | @? | true | | | id attribute of the input
-| name | string | @? | true | | | name attribute of the input
-| model | object | = | true | | | model bound to component
+| Attribute | Type | Binding | One-time Binding | Values | Default | Description
+| ---- | ---- | ---- | ---- | ---- | ---- | ----
+| `model` | object | = | no | n/a | n/a | model bound to component
+| `id` | string | @? | yes | n/a | n/a | id attribute of the input
+| `name` | string | @? | yes | n/a | n/a | name attribute of the input
diff --git a/packages/oui-clipboard/src/clipboard.html b/packages/oui-clipboard/src/clipboard.html
index 3171c5c9..a905081d 100644
--- a/packages/oui-clipboard/src/clipboard.html
+++ b/packages/oui-clipboard/src/clipboard.html
@@ -3,7 +3,7 @@
ng-attr-id="{{::$ctrl.id}}"
ng-attr-name="{{::$ctrl.name}}"
ng-click="$ctrl.onInputClick()"
- ng-model="::$ctrl.model"
+ ng-model="$ctrl.model"
oui-tooltip="{{$ctrl.tooltipText}}"
readonly>
this.$element
.addClass("oui-collapsible")
+ .attr("id", this.id)
.removeAttr("aria-label")
);
diff --git a/packages/oui-collapsible/src/collapsible.html b/packages/oui-collapsible/src/collapsible.html
index 274e958a..4d07be79 100644
--- a/packages/oui-collapsible/src/collapsible.html
+++ b/packages/oui-collapsible/src/collapsible.html
@@ -4,7 +4,7 @@
aria-expanded="{{$ctrl.expanded}}"
aria-controls="{{::$ctrl.id}}">
{{::$ctrl.heading}}
-
+
diff --git a/packages/oui-criteria-adder/README.md b/packages/oui-criteria-adder/README.md
index 6ea82b9e..96773498 100644
--- a/packages/oui-criteria-adder/README.md
+++ b/packages/oui-criteria-adder/README.md
@@ -22,24 +22,24 @@
## API
-| Attribute | Type | Binding | One-time Binding | Values | Default | Description |
-| ---- | ---- | ---- | ---- | ---- | ---- | ---- |
-| `id` | string | @? | true | | | id attribute of the component |
-| `name` | string | @ | true | | | name attribute of the component |
-| `align` | string | @? | true | start,center,end | center | modifier for alignment |
-| `properties` | array | < | | | | array of objects with columns informations |
-| `on-submit` | function | & | | | | handler triggered when form is submitted |
+| Attribute | Type | Binding | One-time Binding | Values | Default | Description
+| ---- | ---- | ---- | ---- | ---- | ---- | ----
+| `id` | string | @? | yes | n/a | n/a | id attribute of the component
+| `name` | string | @ | yes | n/a | n/a | name attribute of the component
+| `align` | string | @? | yes | `start`, `center`, `end` | `center` | modifier for alignment
+| `properties` | array | < | no | n/a | n/a | array of objects with columns informations
+| `on-submit` | function | & | no | n/a | n/a | handler triggered when form is submitted
-### `properties`
+### `properties` attribute
`properties` is an array of objects defined as this:
-| Attribute | Type | Description |
-| ---- | ---- | ----- |
-| `name` | string | Property to filter (can be a nested one) |
-| `title` | string | Human readeable title for the property |
-| `type` | string | Data type |
-| `typeOptions` | object | Specific options |
+| Attribute | Type | Description
+| ---- | ---- | -----
+| `name` | string | Property to filter (can be a nested one)
+| `title` | string | Human readeable title for the property
+| `type` | string | Data type
+| `typeOptions` | object | Specific options
## Configuration
@@ -49,36 +49,64 @@ The pagination can be globally configured with a provider.
angular.module("myModule", [
"oui.criteria-adder"
]).config(ouiCriteriaAdderConfiguration => {
- ouiCriteriaAdderConfiguration.translations = {
+ ouiCriteriaAdderConfiguration.setOperatorsByType({ // default operatorsByType
+ "boolean": [
+ "is",
+ "isNot"
+ ],
+ date: [
+ "is",
+ "isAfter",
+ "isBefore"
+ ],
+ number: [
+ "is",
+ "smaller",
+ "bigger"
+ ],
+ options: [
+ "is",
+ "isNot"
+ ],
+ string: [
+ "contains",
+ "containsNot",
+ "startsWith",
+ "endsWith",
+ "is",
+ "isNot"
+ ]
+ });
+ ouiCriteriaAdderConfiguration.setTranslations({ // default translations
column_label: "Column",
operator_label: "Operator",
-
+
operator_boolean_is: "is",
operator_boolean_isNot: "is not",
-
+
operator_string_contains: "contains",
operator_string_containsNot: "does not contain",
operator_string_startsWith: "starts with",
operator_string_endsWith: "ends with",
operator_string_is: "is",
operator_string_isNot: "is not",
-
+
operator_number_is: "is",
operator_number_smaller: "is smaller than",
operator_number_bigger: "is bigger than",
-
+
operator_date_is: "is",
operator_date_isBefore: "is before",
operator_date_isAfter: "is after",
-
+
operator_options_is: "is",
operator_options_isNot: "is not",
-
+
true_label: "Yes",
false_label: "No",
-
+
value_label: "Value",
submit_label: "Add"
- };
+ });
});
```
diff --git a/packages/oui-criteria-adder/src/criteria-adder.component.js b/packages/oui-criteria-adder/src/criteria-adder.component.js
index 854a679c..10fa784b 100644
--- a/packages/oui-criteria-adder/src/criteria-adder.component.js
+++ b/packages/oui-criteria-adder/src/criteria-adder.component.js
@@ -9,10 +9,8 @@ export default {
id: "@?",
name: "@",
align: "@?",
-
properties: "<",
disabled: "",
-
onSubmit: "&"
},
controller,
diff --git a/packages/oui-criteria-adder/src/criteria-adder.provider.js b/packages/oui-criteria-adder/src/criteria-adder.provider.js
index e420480e..8faeb81f 100644
--- a/packages/oui-criteria-adder/src/criteria-adder.provider.js
+++ b/packages/oui-criteria-adder/src/criteria-adder.provider.js
@@ -1,3 +1,5 @@
+import merge from "lodash/merge";
+
export default class {
constructor () {
this.operatorsByType = {
@@ -67,7 +69,7 @@ export default class {
* @param {Object} operatorsByType a list of operators by type
*/
setOperatorsByType (operatorsByType) {
- this.operatorsByType = operatorsByType;
+ this.operatorsByType = merge(this.operatorsByType, operatorsByType);
return this;
}
@@ -76,7 +78,7 @@ export default class {
* @param {Object} translations a map of translations
*/
setTranslations (translations) {
- this.translations = translations;
+ this.translations = merge(this.translations, translations);
return this;
}
diff --git a/packages/oui-datagrid/README.md b/packages/oui-datagrid/README.md
index d1fe6b50..319b04c0 100644
--- a/packages/oui-datagrid/README.md
+++ b/packages/oui-datagrid/README.md
@@ -680,17 +680,17 @@ call `rows-loader` and then a `row-loader` call for each line.
### oui-datagrid
-| Attribute | Type | Binding | One-time binding | Values | Default | Description |
-| ---- | ---- | ---- | ---- | ---- | ---- | ---- |
-| `id` | string | @? | | | | id of the datagrid |
-| `page-size` | number | @? | | | 25 | maximum number of rows to show on each pages |
-| `rows` | array | | yes | | | rows to show |
-| `rows-loader` | function | &? | yes | | | gets all rows (returns a promise with all rows) |
-| `row-loader` | function | &? | yes | | | gets row details (returns a promise with details) |
-| `customizable` | boolean | | | | false | if the datagrid is customizable |
-| `selectable-rows` | boolean | | | | false | if rows can be selected
-| `columns-parameters` | array | | | | undefined | columns parameters (see below) |
-| `on-columns-parameters-change` | function | & | | | | triggered on column parameter change when datagrid is customizable |
+| Attribute | Type | Binding | One-time binding | Values | Default | Description
+| ---- | ---- | ---- | ---- | ---- | ---- | ----
+| `id` | string | @? | no | n/a | n/a | id of the datagrid
+| `page-size` | number | @? | no | n/a | `25` | maximum number of rows to show on each pages
+| `rows` | array | | yes | n/a | n/a | rows to show
+| `rows-loader` | function | &? | yes | n/a | n/a | gets all rows (returns a promise with all rows)
+| `row-loader` | function | &? | yes | n/a | n/a | gets row details (returns a promise with details)
+| `customizable` | boolean | | no | `true`, `false` | `false` | if the datagrid is customizable
+| `selectable-rows` | boolean | | no | `true`, `false` | `false` | if rows can be selected
+| `columns-parameters` | array | | no | n/a | `undefined` | columns parameters (see below)
+| `on-columns-parameters-change` | function | & | no | n/a | n/a | triggered on column parameter change when datagrid is customizable
`columns-parameters` is an array describing all basic parameters of each column.
@@ -715,17 +715,17 @@ These parameters override properties defined in `oui-column` or `columns` attrib
### oui-column / `columns` attribute
-| Attribute | Type | Binding | One-time binding | Values | Default | Description |
-| ---- | ---- | ---- | ---- | ---- | ---- | ---- |
-| `title` | string | N/A | yes | | | column title put in header |
-| `property` | string | N/A | yes | | null | property path used to get value from value |
-| `sortable` | string | N/A | yes | `asc`, `desc` | `asc` on `sortable=""` | makes a column sortable and gives the order |
-| `type` | string | N/A | | See below | null | define a column type |
-| `filterable` | N/A | N/A | | | | define a filterable column |
-| `searchable` | N/A | N/A | | | | define a searchable column |
-| `type-options` / `typeOptions` | object | N/A | | See below | {} | define options related to column type (see below) |
-| `hidden` | boolean | N/A | | `true` / `false` | false | if the column is hidden by default |
-| `prevent-customization` / `preventCustomization` | N/A | N/A | | | | prevent a column to be customizable |
+| Attribute | Type | Binding | One-time binding | Values | Default | Description
+| ---- | ---- | ---- | ---- | ---- | ---- | ----
+| `title` | string | n/a | yes | n/a | n/a | column title put in header
+| `property` | string | n/a | yes | n/a | `null` | property path used to get value from value
+| `sortable` | string | n/a | yes | `asc`, `desc` | `asc` | makes a column sortable and gives the order
+| `type` | string | n/a | no | See below | `null` | define a column type
+| `filterable` | n/a | n/a | no | n/a | n/a | define a filterable column
+| `searchable` | n/a | n/a | no | n/a | n/a | define a searchable column
+| `type-options` / `typeOptions` | object | n/a | no | See below | `{}` | define options related to column type (see below)
+| `hidden` | boolean | n/a | no | `true`, `false` | `false` | if the column is hidden by default
+| `prevent-customization` / `preventCustomization` | n/a | n/a | no | n/a | n/a | prevent a column to be customizable
`typeOptions` is used to give options to feed criteria values. Example:
@@ -746,10 +746,10 @@ const typeOptions = {
### rows-loader promise response
-| Attribute | Type | Binding | One-time binding | Values | Default | Description |
-| ---- | ---- | ---- | ---- | ---- | ---- | ---- |
-| `data` | array | | yes | | | rows to show |
-| `meta` | object | N/A | yes | | | an object containing pagination information { totalCount: X } |
+| Attribute | Type | Binding | One-time binding | Values | Default | Description
+| ---- | ---- | ---- | ---- | ---- | ---- | ----
+| `data` | array | | yes | n/a | n/a | rows to show
+| `meta` | object | n/a | yes | n/a | n/a | an object containing pagination information { totalCount: X }
### oui-action-menu
@@ -761,10 +761,10 @@ Can be used as a column and will be sticked on side on smaller devices. Document
It will refresh the content of a datagrid that has a specific `id`.
-| Argument | Type | Default | Description |
-| ---- | ---- | ---- | ---- |
-| `id` | string | (mandatory) | the `id` of the datagrid |
-| `showSpinner` | boolean | false | if you want to show the spinner while `rows-loader` is executed (like a first load) |
+| Argument | Type | Default | Description
+| ---- | ---- | ---- | ----
+| `id` | string | (mandatory) | the `id` of the datagrid
+| `showSpinner` | boolean | `false` | if you want to show the spinner while `rows-loader` is executed (like a first load)
## Configuration
diff --git a/packages/oui-datagrid/src/datagrid.provider.js b/packages/oui-datagrid/src/datagrid.provider.js
index 78931b4f..e8dfa0ad 100644
--- a/packages/oui-datagrid/src/datagrid.provider.js
+++ b/packages/oui-datagrid/src/datagrid.provider.js
@@ -1,3 +1,5 @@
+import merge from "lodash/merge";
+
export default class {
constructor () {
this.pageSize = 25;
@@ -20,7 +22,7 @@ export default class {
* @param {Object} translations a map of translations
*/
setTranslations (translations) {
- this.translations = translations;
+ this.translations = merge(this.translations, translations);
return this;
}
diff --git a/packages/oui-dropdown/README.md b/packages/oui-dropdown/README.md
index d8c95dd6..1843139e 100644
--- a/packages/oui-dropdown/README.md
+++ b/packages/oui-dropdown/README.md
@@ -163,7 +163,7 @@ Use `oui-dropdown-trigger` as a directive for custom trigger button
```html:preview
-
+
@@ -240,43 +240,43 @@ See Guide menu component .
| Attribute | Type | Binding | One-time Binding | Values | Default | Description
| ---- | ---- | ---- | ---- | ---- | ---- | ----
| `align` | string | @? | yes | `start`, `center`, `end` | `start` | modifier for alignment
-| `arrow` | boolean | | | `true`, `false` | `false` | display the dropdown arrow
-| `persistent` | boolean | | | `true`, `false` | `false` | prevent dropdown to close on click
+| `arrow` | boolean | | no | `true`, `false` | `false` | display the dropdown arrow
+| `persistent` | boolean | | no | `true`, `false` | `false` | prevent dropdown to close on click
### oui-dropdown-trigger
-| Attribute | Type | Binding | One-time Binding | Values | Default | Description
-| ---- | ---- | ---- | ---- | ---- | ---- | ----
-| `text` | string | @ | yes | | | display the default dropdown with this text
-| `aria-label` | string | @? | yes | | | accessibility label
-| `disabled` | boolean | | | `true`, `false` | `false` | disabled flag
+| Attribute | Type | Binding | One-time Binding | Values | Default | Description
+| ---- | ---- | ---- | ---- | ---- | ---- | ----
+| `text` | string | @ | yes | n/a | n/a | display the default dropdown with this text
+| `aria-label` | string | @? | yes | n/a | n/a | accessibility label
+| `disabled` | boolean | | no | `true`, `false` | `false` | disabled flag
-**Note:** It can be used as a `component` or an `attribute`.
+**Note**: It can be used as a `component` or an `attribute`.
### oui-dropdown-content
-**Note:** It can be used as a `component` or an `attribute`.
+**Note**: It can be used as a `component` or an `attribute`.
### oui-dropdown-group
-| Attribute | Type | Binding | One-time Binding | Values | Default | Description
-| ---- | ---- | ---- | ---- | ---- | ---- | ----
-| `label` | string | @ | yes | | | dropdown group label
+| Attribute | Type | Binding | One-time Binding | Values | Default | Description
+| ---- | ---- | ---- | ---- | ---- | ---- | ----
+| `label` | string | @ | yes | n/a | n/a | dropdown group label
### oui-dropdown-item
-| Attribute | Type | Binding | One-time Binding | Values | Default | Description
-| ---- | ---- | ---- | ---- | ---- | ---- | ----
-| `text` | string | @ | yes | | | dropdown item text
-| `aria-label` | string | @? | yes | | | accessibility label
-| `href` | string | @? | yes | | | href of the item
-| `state` | string | @? | yes | | | state of the item
-| `state-params` | object | | | | | state-params of the item
-| `disabled` | boolean | | | `true`, `false` | `false` | disabled flag
-| `external` | boolean | | yes | `true`, `false` | `false` | external flag
-| `on-click` | function | & | | | | callback on component click
-
-**Note:** `ui-router` is needed for the attributes `state` and `state-params`.
+| Attribute | Type | Binding | One-time Binding | Values | Default | Description
+| ---- | ---- | ---- | ---- | ---- | ---- | ----
+| `text` | string | @ | yes | n/a | n/a | dropdown item text
+| `aria-label` | string | @? | yes | n/a | n/a | accessibility label
+| `href` | string | @? | yes | n/a | n/a | href of the item
+| `state` | string | @? | yes | n/a | n/a | state of the item
+| `state-params` | object | | no | n/a | n/a | state-params of the item
+| `disabled` | boolean | | no | `true`, `false` | `false` | disabled flag
+| `external` | boolean | | yes | `true`, `false` | `false` | external flag
+| `on-click` | function | & | no | n/a | n/a | callback on component click
+
+**Note**: `ui-router` is needed for the attributes `state` and `state-params`.
### oui-dropdown-divider
diff --git a/packages/oui-dropdown/src/trigger/dropdown-trigger.html b/packages/oui-dropdown/src/trigger/dropdown-trigger.html
index aec82cd8..f5df86fd 100644
--- a/packages/oui-dropdown/src/trigger/dropdown-trigger.html
+++ b/packages/oui-dropdown/src/trigger/dropdown-trigger.html
@@ -7,5 +7,5 @@
aria-haspopup="true"
aria-expanded="false">
-
+
diff --git a/packages/oui-field/README.md b/packages/oui-field/README.md
index d20fcc7f..f59a7227 100644
--- a/packages/oui-field/README.md
+++ b/packages/oui-field/README.md
@@ -165,7 +165,7 @@
OSX
Windows
-
+
@@ -237,17 +237,15 @@
```
-
## API
-| Attribute | Type | Binding | One-time binding | Values | Default | Description |
-| ---- | ---- | ---- | ---- | ---- | ---- | ---- |
-| `error-messages` | object | | no | | | a dictionary to override default messages |
-| `help-text` | string | @? | yes | | | a text to help fill the form field |
-| `size` | string | @? | yes | `xs`, `s`, `m`, `l`, `xl`, `auto` | `auto` | the field size |
-| `label` | function | @? | yes | | | the field label |
-| `label-popover` | string | @? | yes | | | a text to describe the field or give more information |
-
+| Attribute | Type | Binding | One-time binding | Values | Default | Description
+| ---- | ---- | ---- | ---- | ---- | ---- | ----
+| `label` | string | @? | yes | n/a | n/a | field label
+| `label-popover` | string | @? | yes | n/a | n/a | text to describe the field or give more information
+| `help-text` | string | @? | yes | n/a | n/a | text to help fill the form field
+| `size` | string | @? | yes | `xs`, `s`, `m`, `l`, `xl`, `auto` | `auto` | field size
+| `error-messages` | object | | no | n/a | n/a | dictionary to override default messages
## Configuration
@@ -257,7 +255,7 @@ The validation messages can be globally configured with a provider.
angular.module("myModule", [
"oui.field"
]).config(ouiFieldConfiguration => {
- ouiFieldConfiguration.translations = {
+ ouiFieldConfiguration.setTranslations({ // default translations
errors: {
required: "Mandatory.",
number: "Invalid number.",
@@ -268,6 +266,6 @@ angular.module("myModule", [
maxlength: "Too high ({{maxlength}} characters max).",
pattern: "Invalid format."
}
- };
+ });
});
```
diff --git a/packages/oui-field/src/field.controller.js b/packages/oui-field/src/field.controller.js
index 3de2a0e3..ee48f3ea 100644
--- a/packages/oui-field/src/field.controller.js
+++ b/packages/oui-field/src/field.controller.js
@@ -41,7 +41,6 @@ export default class FieldController {
this.invalidOnBlur = false;
this.hasFocus = false;
this.size = this.size || "auto";
-
}
$postLink () {
diff --git a/packages/oui-field/src/field.html b/packages/oui-field/src/field.html
index 9f8a460d..20b844ed 100644
--- a/packages/oui-field/src/field.html
+++ b/packages/oui-field/src/field.html
@@ -22,7 +22,7 @@
-
+
diff --git a/packages/oui-field/src/field.provider.js b/packages/oui-field/src/field.provider.js
index 43ed5d55..ae4010cb 100644
--- a/packages/oui-field/src/field.provider.js
+++ b/packages/oui-field/src/field.provider.js
@@ -1,3 +1,5 @@
+import merge from "lodash/merge";
+
export default class {
constructor () {
this.translations = {
@@ -19,7 +21,7 @@ export default class {
* @param {Object} translations a map of translations
*/
setTranslations (translations) {
- this.translations = translations;
+ this.translations = merge(this.translations, translations);
return this;
}
diff --git a/packages/oui-field/src/index.spec.js b/packages/oui-field/src/index.spec.js
index f7ff759d..a4e0aa34 100644
--- a/packages/oui-field/src/index.spec.js
+++ b/packages/oui-field/src/index.spec.js
@@ -389,7 +389,7 @@ describe("ouiField", () => {
OSX
Windows
-
+
`);
diff --git a/packages/oui-form-actions/README.md b/packages/oui-form-actions/README.md
index 7670a310..a2be4a1e 100644
--- a/packages/oui-form-actions/README.md
+++ b/packages/oui-form-actions/README.md
@@ -7,53 +7,57 @@
### Default
```html:preview
-
-
+
```
+**Note**: Cancel button is hidden if there is no `href` or `on-cancel` attributes.
### Custom naming
```html:preview
-
-
-
-
+
+
```
-
### on-submit and on-cancel events
```html:preview
-
-
-
Last action: {{ $ctrl.lastAction }}
-
-```
-
-### on-submit only
-```html:preview
+
+ Last action : {{ $ctrl.lastAction }}
+
+ on-submit="$ctrl.lastAction = 'submit'"
+ on-cancel="$ctrl.lastAction = 'cancel'">
+
```
-In accordance to guidelines, submit button must be always enabled.
## API
-| Attribute | Type | Binding | One-time Binding | Values | Default | Description |
-| ---- | ---- | ---- | ---- | ---- | ---- | ---- |
-| on-submit | function | & | | | | submit handler |
-| on-cancel | function | & | | | | cancel handler |
-| submit-text | string | @? | true | | "Submit" | submit button text |
-| cancel-text | string | @? | true | | "Cancel" | cancel button text |
-| href | string | @? | true | | | link url on cancel |
+| Attribute | Type | Binding | One-time Binding | Values | Default | Description
+| ---- | ---- | ---- | ---- | ---- | ---- | ----
+| `submit-text` | string | @? | yes | n/a | `Submit` | submit button text
+| `cancel-text` | string | @? | yes | n/a | `Cancel` | cancel button text
+| `href` | string | @? | yes | n/a | n/a | link url on cancel
+| `on-submit` | function | & | no | n/a | n/a | button submit click handler
+| `on-cancel` | function | &? | no | n/a | n/a | button cancel click handler
+
+## Configuration
+
+The form actions can be globally configured with a provider.
+
+```js
+angular.module("myModule", [
+ "oui.form-actions"
+]).config(ouiFormActionsConfiguration => {
+ ouiFormActionsConfiguration.setTranslations({ // default translations
+ submit: "Submit",
+ cancel: "Cancel"
+ });
+});
+```
diff --git a/packages/oui-form-actions/src/form-actions.html b/packages/oui-form-actions/src/form-actions.html
index f9d731bb..48e1a666 100644
--- a/packages/oui-form-actions/src/form-actions.html
+++ b/packages/oui-form-actions/src/form-actions.html
@@ -1,20 +1,17 @@
-
+
-
+
-
+
diff --git a/packages/oui-form-actions/src/form-actions.provider.js b/packages/oui-form-actions/src/form-actions.provider.js
index c811a81f..0257070a 100644
--- a/packages/oui-form-actions/src/form-actions.provider.js
+++ b/packages/oui-form-actions/src/form-actions.provider.js
@@ -1,3 +1,5 @@
+import merge from "lodash/merge";
+
export default class {
constructor () {
this.translations = {
@@ -6,8 +8,12 @@ export default class {
};
}
+ /**
+ * Set the translations
+ * @param {Object} translations a map of translations
+ */
setTranslations (translations) {
- this.translations = translations;
+ this.translations = merge(this.translations, translations);
return this;
}
diff --git a/packages/oui-form-actions/src/index.spec.js b/packages/oui-form-actions/src/index.spec.js
index c416b192..e16ad21f 100644
--- a/packages/oui-form-actions/src/index.spec.js
+++ b/packages/oui-form-actions/src/index.spec.js
@@ -104,9 +104,8 @@ describe("ouiFormActions", () => {
`);
- const cancelButton = component.find("button").eq(1);
- expect(cancelButton.hasClass("ng-hide")).toBe(true);
+ expect(component.find("button").length).toBe(1);
});
it("should trigger click on submit button", () => {
diff --git a/packages/oui-guide-menu/README.md b/packages/oui-guide-menu/README.md
index 7c1ab002..193a11b7 100644
--- a/packages/oui-guide-menu/README.md
+++ b/packages/oui-guide-menu/README.md
@@ -55,25 +55,25 @@
### oui-guide-menu
-| Attribute | Type | Binding | One-time Binding | Values | Default | Description
-| ---- | ---- | ---- | ---- | ---- | ---- | ----
-| `text` | string | @ | yes | | | button guide text
-| `aria-label` | string | @? | yes | | | accessibility label
-| `align` | string | @? | yes | `start`,`center`,`end` | `end` | menu alignment
+| Attribute | Type | Binding | One-time Binding | Values | Default | Description
+| ---- | ---- | ---- | ---- | ---- | ---- | ----
+| `text` | string | @ | yes | n/a | n/a | button guide text
+| `aria-label` | string | @? | yes | n/a | n/a | accessibility label
+| `align` | string | @? | yes | `start`,`center`,`end` | `end` | menu alignment
### oui-guide-menu-item
-| Attribute | Type | Binding | One-time binding | Values | Default | Description
-| ---- | ---- | ---- | ---- | ---- | ---- | ----
-| `text` | string | @ | | | | button label
-| `aria-label` | string | @? | | | | accessibility label
-| `href` | string | @? | yes | | | hypertext link (link)
-| `disabled` | boolean | | | | `false` | disable (button)
-| `external` | boolean | @? | yes | | | display external icon (link)
-| `on-click` | | &? | | | | on-click handler (button)
+| Attribute | Type | Binding | One-time binding | Values | Default | Description
+| ---- | ---- | ---- | ---- | ---- | ---- | ----
+| `text` | string | @ | no | n/a | n/a | button label
+| `aria-label` | string | @? | no | n/a | n/a | accessibility label
+| `href` | string | @? | yes | n/a | n/a | hypertext link (link)
+| `disabled` | boolean | | no | `true`, `false` | `false` | disable (button)
+| `external` | boolean | @? | yes | `true`, `false` | `false` | display external icon (link)
+| `on-click` | function | &? | no | n/a | n/a | on-click handler (button)
### oui-guide-menu-group
-| Attribute | Type | Binding | One-time Binding | Values | Default | Description
-| ---- | ---- | ---- | ---- | ---- | ---- | ----
-| `label` | string | @ | yes | | | guide-menu group label
+| Attribute | Type | Binding | One-time Binding | Values | Default | Description
+| ---- | ---- | ---- | ---- | ---- | ---- | ----
+| `label` | string | @ | yes | n/a | n/a | guide-menu group label
diff --git a/packages/oui-header-tabs/README.md b/packages/oui-header-tabs/README.md
index 7e2d249c..5ce82047 100644
--- a/packages/oui-header-tabs/README.md
+++ b/packages/oui-header-tabs/README.md
@@ -8,33 +8,33 @@
```html:preview
-
-
-
-
-
+
+
+
+
+
```
### With dropdown
```html:preview
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
```
@@ -42,22 +42,22 @@
```html:preview
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
```
@@ -65,22 +65,22 @@
```html:preview
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
```
@@ -88,23 +88,23 @@
### oui-header-tabs-item
-| Attribute | Type | Binding | One-time Binding | Values | Default | Description
-| ---- | ---- | ---- | ---- | ---- | ---- | ----
-| `text` | string | @ | yes | | | display the menu item with this text
-| `href` | string | @? | yes | | | href of the menu item
-| `state` | string | @? | yes | | | state of the menu item
-| `stateParams` | object | | | | | state params of the menu item
-| `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
+| Attribute | Type | Binding | One-time Binding | Values | Default | Description
+| ---- | ---- | ---- | ---- | ---- | ---- | ----
+| `text` | string | @ | yes | n/a | n/a | display the menu item with this text
+| `href` | string | @? | yes | n/a | n/a | href of the menu item
+| `state` | string | @? | yes | n/a | n/a | state of the menu item
+| `stateParams` | object | | no | n/a | n/a | state params of the menu item
+| `active` | boolean | | no | `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`.
+**Note**: `ui-router` is needed for the attributes `state` and `state-params`.
### oui-header-tabs-dropdown
-| Attribute | Type | Binding | One-time Binding | Values | Default | Description
-| ---- | ---- | ---- | ---- | ---- | ---- | ----
-| `text` | string | @ | yes | | | display the dropdown with this text
+| Attribute | Type | Binding | One-time Binding | Values | Default | Description
+| ---- | ---- | ---- | ---- | ---- | ---- | ----
+| `text` | string | @ | yes | n/a | n/a | display the dropdown with this text
### oui-header-tabs-divider
diff --git a/packages/oui-message/README.md b/packages/oui-message/README.md
index 1a0163ef..3a082ae9 100644
--- a/packages/oui-message/README.md
+++ b/packages/oui-message/README.md
@@ -36,8 +36,8 @@
## API
-| Attribute | Type | Binding | One-time binding | Values | default | Description |
-| ---- | ---- | ---- | ---- | ---- | ---- | ---- |
-| type | String | @ | yes | `info`, `success`, `warning`, `error` | | Message type |
-| aria-close-button-label | function | @? | yes | | | accessibility label for close button |
-| on-dismissed | function | &? | | | | dismissed handler |
+| Attribute | Type | Binding | One-time binding | Values | Default | Description
+| ---- | ---- | ---- | ---- | ---- | ---- | ----
+| `type` | string | @ | yes | `info`, `success`, `warning`, `error` | n/a | message type
+| `aria-close-button-label` | function | @? | yes | n/a | n/a | accessibility label for close button
+| `on-dismissed` | function | &? | no | n/a | n/a | dismissed handler
diff --git a/packages/oui-message/src/message.html b/packages/oui-message/src/message.html
index 023461e7..dd4b09cf 100644
--- a/packages/oui-message/src/message.html
+++ b/packages/oui-message/src/message.html
@@ -1,13 +1,10 @@
-
-
-
-
-
+
+
+ class="oui-icon oui-icon-close oui-message__close-button"
+ type="button"
+ ng-click="$ctrl.dismiss()"
+ ng-attr-aria-label="{{::$ctrl.ariaCloseButtonLabel}}">
diff --git a/packages/oui-modal/README.md b/packages/oui-modal/README.md
index 48f59740..a7819810 100644
--- a/packages/oui-modal/README.md
+++ b/packages/oui-modal/README.md
@@ -76,13 +76,13 @@
## API
-| Attribute | Type | Binding | One-time Binding | Values | Default | Description |
-| ---- | ---- | ---- | ---- | ---- | ---- | ---- |
-| `heading` | string | @ | yes | | | modal title |
-| `primary-action` | function | &? | | | | confirmation callback |
-| `primary-label` | string | @? | yes | | | confirmation label |
-| `secondary-action` | function | &? | | | | cancellation callback |
-| `secondary-label` | string | @? | yes | | | cancellation label |
-| `on-dismiss` | function | &? | | | | dismiss callback |
-| `loading` | boolean | | | | false | display loader flag |
-| `type` | string | @? | yes | warning, success, info | | display loader flag |
+| Attribute | Type | Binding | One-time Binding | Values | Default | Description
+| ---- | ---- | ---- | ---- | ---- | ---- | ----
+| `heading` | string | @ | yes | n/a | n/a | modal title
+| `type` | string | @? | yes | `warning`, `success`, `info` | n/a | modal type
+| `loading` | boolean | | no | `true`, `false` | `false` | display loader flag
+| `primary-label` | string | @? | yes | n/a | n/a | confirmation label
+| `primary-action` | function | & | no | n/a | n/a | confirmation callback
+| `secondary-label` | string | @? | yes | n/a | n/a | cancellation label
+| `secondary-action` | function | & | no | n/a | n/a | cancellation callback
+| `on-dismiss` | function | & | no | n/a | n/a | dismiss callback
diff --git a/packages/oui-modal/src/modal.component.js b/packages/oui-modal/src/modal.component.js
index 93f025b5..5a656647 100644
--- a/packages/oui-modal/src/modal.component.js
+++ b/packages/oui-modal/src/modal.component.js
@@ -7,13 +7,13 @@ export default {
bindings: {
heading: "@?",
title: "@?", // Deprecated: Replaced by 'heading'
- primaryAction: "&?",
+ type: "@?",
+ loading: "",
primaryLabel: "@?",
- secondaryAction: "&?",
+ primaryAction: "&",
secondaryLabel: "@?",
- onDismiss: "&?",
- loading: "",
- type: "@?"
+ secondaryAction: "&",
+ onDismiss: "&"
},
transclude: true
};
diff --git a/packages/oui-modal/src/modal.controller.js b/packages/oui-modal/src/modal.controller.js
index f12c9529..65ad806c 100644
--- a/packages/oui-modal/src/modal.controller.js
+++ b/packages/oui-modal/src/modal.controller.js
@@ -1,10 +1,12 @@
import { addBooleanParameter } from "@oui-angular/common/component-utils";
export default class {
- constructor ($attrs) {
+ constructor ($attrs, $element, $timeout) {
"ngInject";
this.$attrs = $attrs;
+ this.$element = $element;
+ this.$timeout = $timeout;
}
$onInit () {
@@ -15,4 +17,12 @@ export default class {
this.heading = this.title;
}
}
+
+ $postLink () {
+ this.$timeout(() =>
+ this.$element
+ .addClass("oui-modal")
+ .addClass("oui-modal_shadow")
+ );
+ }
}
diff --git a/packages/oui-modal/src/modal.html b/packages/oui-modal/src/modal.html
index d4768cde..f374c115 100644
--- a/packages/oui-modal/src/modal.html
+++ b/packages/oui-modal/src/modal.html
@@ -1,41 +1,40 @@
-
-