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) + +![OVH component](https://user-images.githubusercontent.com/3379410/27423240-3f944bc4-5731-11e7-87bb-3ff603aff8a7.png) + +A set of maintainable components for the OVH ecosystem (AngularJS). + [![NPM](https://nodei.co/npm/ovh-ui-angular.png?downloads=true&downloadRank=true&stars=true)](https://nodei.co/npm/ovh-ui-angular/) ![Project status stable](https://img.shields.io/badge/status-stable-blue.svg) [![Maintenance](https://img.shields.io/maintenance/yes/2018.svg)]() [![Chat on gitter](https://img.shields.io/gitter/room/ovh/ux.svg)](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 | - + 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()"> + - + - +

{{::$ctrl.heading}}

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 | - +Normal +Disabled ``` ### Checked ```html:preview
- - + Normal + Disabled
``` @@ -24,8 +24,8 @@ ```html:preview
- - + Normal + Disabled
``` @@ -34,7 +34,7 @@ ```html:preview
- + Agreements
Is this form valid? : {{ form.$valid ? "yes" : "no" }}
@@ -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 | 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 @@ -
- -
+ + + 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 |
-

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>
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: " @@ -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 | - + 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 @@ - + @@ -237,17 +237,15 @@ ``` - ## API -| Attribute | Type | Binding | One-time binding | Values | Default | Description | -| ---- | ---- | ---- | ---- | ---- | ---- | ---- | -| `error-messages` | object | { - 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", () => { - + `); 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 | - - - - - + + + + + ``` ### 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 | - - -
-
- + +
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 | + 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 @@ -
-
- -
-
- +
+ -
- + aria-hidden="true"> + +
+

+ ng-if="::!!$ctrl.heading" + ng-bind="::$ctrl.heading">

-
- +
diff --git a/packages/oui-navbar/README.md b/packages/oui-navbar/README.md index eb8f3eba..8935a624 100644 --- a/packages/oui-navbar/README.md +++ b/packages/oui-navbar/README.md @@ -490,79 +490,79 @@ The property `name` **must be** `"user"`. ### oui-navbar -| Attribute | Type | Binding | One-time Binding | Values | Default | Description -| ---- | ---- | ---- | ---- | ---- | ---- | ---- -| `brand` | object | - + - - + aria-hidden="true">
  • - +
    @@ -91,9 +91,9 @@
  • - +
    diff --git a/packages/oui-numeric/README.md b/packages/oui-numeric/README.md index a0e070d0..4e4a7aa6 100644 --- a/packages/oui-numeric/README.md +++ b/packages/oui-numeric/README.md @@ -8,9 +8,7 @@ ```html:preview + model="$ctrl.size"> ``` @@ -18,11 +16,9 @@ ```html:preview + min="2" + max="8" + model="$ctrl.core"> ``` @@ -30,21 +26,19 @@ ```html:preview + model="$ctrl.foo" + disabled> ``` ## 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 | string | = | | | | model bound to component | -| min | integer | - this.$element - .removeAttr("id") - .removeAttr("name") - ); - } - $onInit () { - if (!this.id) { - this.$log.warn("Missing required attribute id"); - } + addDefaultParameter(this, "id", `ouiNumeric${this.$id}`); + addBooleanParameter(this, "disabled"); if (!angular.isNumber(this.min)) { if (angular.isDefined(this.min)) { @@ -72,6 +63,18 @@ export default class { this.previousValue = this.model; } + $postLink () { + // Sometimes the digest cycle is done before dom manipulation, + // So we use $timeout to force the $apply + this.$timeout(() => + this.$element + .addClass("oui-input-group") + .addClass("oui-input-group_numeric") + .removeAttr("id") + .removeAttr("name") + ); + } + setModelValue (value) { // updates model and displayed value this.model = value; diff --git a/packages/oui-numeric/src/numeric.html b/packages/oui-numeric/src/numeric.html index cc8d7d64..feec2c47 100644 --- a/packages/oui-numeric/src/numeric.html +++ b/packages/oui-numeric/src/numeric.html @@ -1,29 +1,27 @@ -
    - - - -
    + + + diff --git a/packages/oui-page-header/README.md b/packages/oui-page-header/README.md index c18a47c7..9c9adc22 100644 --- a/packages/oui-page-header/README.md +++ b/packages/oui-page-header/README.md @@ -39,26 +39,26 @@ ```html:preview - - - - - - - - - - - - - + + + + + + + + + + + + + ``` ## API -| Attribute | Type | Binding | One-time Binding | Values | Default | Description | -| ---- | ---- | ---- | ---- | ---- | ---- | ---- | -| heading | string | @? | true | | | title of the header | -| description | string | @? | true | | | subtitle of the header | +| Attribute | Type | Binding | One-time Binding | Values | Default | Description +| ---- | ---- | ---- | ---- | ---- | ---- | ---- +| `heading` | string | @? | yes | n/a | n/a | title of the header +| `description` | string | @? | yes | n/a | n/a | subtitle of the header diff --git a/packages/oui-page-header/src/page-header.html b/packages/oui-page-header/src/page-header.html index 94847b7b..6ca3094a 100644 --- a/packages/oui-page-header/src/page-header.html +++ b/packages/oui-page-header/src/page-header.html @@ -1,16 +1,21 @@
    -

    +

    +

    + ng-if="::!!$ctrl.description" + ng-bind="::$ctrl.description"> +
    + ng-if="$ctrl.transcludeGuide" + ng-transclude="guide"> +
    + ng-if="$ctrl.transcludeTabs" + ng-transclude="tabs"> +
    diff --git a/packages/oui-pagination/README.md b/packages/oui-pagination/README.md index 25e67396..1e37f928 100644 --- a/packages/oui-pagination/README.md +++ b/packages/oui-pagination/README.md @@ -37,13 +37,13 @@ ## API -| Attribute | Type | Binding | One-time Binding | Values | Default | Description | -| ---- | ---- | ---- | ---- | ---- | ---- | ---- | -| `current-offset` | Number | < | no | | | offset of the current page first item | -| `page-size` | Number | - +