From ede37bd57d28d3e04a8b1c421ea4cb98695c65e5 Mon Sep 17 00:00:00 2001 From: buhichan Date: Wed, 24 Aug 2016 17:02:59 +0800 Subject: [PATCH] feat(wrapper): Compability of horizontal form This commit gives users the ability to add custom classes to labels and the parent div element of fields #89 Not compatible with horizontal forms --- README.md | 15 +++++++++++++++ src/wrappers/index.js | 2 ++ src/wrappers/label.html | 7 +++++-- 3 files changed, 22 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index a811c9b..fcbce5d 100644 --- a/README.md +++ b/README.md @@ -91,6 +91,20 @@ NOTE: All of these properties will be under the `templateOptions` property as of ###### Default >`undefined` +--- +##### labelClass (string) +>`labelClass` is used to add classes to labels. + +###### Default +>`undefined` + +--- +##### fieldDivClass (string) +>`fieldDivClass` is used to add classes to the parent div element of the field. + +###### Default +>`undefined` + --- ##### addonLeft (object) >`addonLeft` is used to add an add-on on the left of a field. The object accepts three properties: `text` that sets a simple text, `onClick` will add a `cursor:pointer` and an ng-click to the addon (invoked with the options and scope), and `class` that sets classes to the add-on. @@ -324,3 +338,4 @@ Please see the [CONTRIBUTING Guidelines](CONTRIBUTING.md). A special thanks to [Nimbly](http://gonimbly.com) for creating/sponsoring angular-formly's development. Thanks to [Kent C. Dodds](https://github.com/kentcdodds) for his continued support on the project. + diff --git a/src/wrappers/index.js b/src/wrappers/index.js index 7c71ce8..1bbab80 100644 --- a/src/wrappers/index.js +++ b/src/wrappers/index.js @@ -9,8 +9,10 @@ export default ngModule => { apiCheck: check => ({ templateOptions: { label: check.string.optional, + labelClass: check.string.optional, required: check.bool.optional, labelSrOnly: check.bool.optional, + fieldDivClass: check.string.optional } }) }, diff --git a/src/wrappers/label.html b/src/wrappers/label.html index 7144454..bfd8560 100644 --- a/src/wrappers/label.html +++ b/src/wrappers/label.html @@ -1,7 +1,10 @@
-
+