diff --git a/dist/ionic-decorator.js b/dist/ionic-decorator.js new file mode 100644 index 000000000..482330b89 --- /dev/null +++ b/dist/ionic-decorator.js @@ -0,0 +1,92 @@ +angular.module("schemaForm").run(["$templateCache", function($templateCache) {$templateCache.put("directives/decorators/ionic/actions-trcl.html","
"); +$templateCache.put("directives/decorators/ionic/actions.html","
"); +$templateCache.put("directives/decorators/ionic/array.html","

{{ form.title }}

"); +$templateCache.put("directives/decorators/ionic/checkbox.html","
"); +$templateCache.put("directives/decorators/ionic/checkboxes.html","
"); +$templateCache.put("directives/decorators/ionic/default.html",""); +$templateCache.put("directives/decorators/ionic/fieldset-trcl.html","
{{ form.title }}
"); +$templateCache.put("directives/decorators/ionic/fieldset.html","
{{ form.title }}
"); +$templateCache.put("directives/decorators/ionic/help.html","
"); +$templateCache.put("directives/decorators/ionic/radio-buttons.html","
"); +$templateCache.put("directives/decorators/ionic/radios-inline.html","
"); +$templateCache.put("directives/decorators/ionic/radios.html",""); +$templateCache.put("directives/decorators/ionic/readonly.html","
"); +$templateCache.put("directives/decorators/ionic/section.html","
"); +$templateCache.put("directives/decorators/ionic/select.html",""); +$templateCache.put("directives/decorators/ionic/submit.html"," "); +$templateCache.put("directives/decorators/ionic/tabarray.html","
"); +$templateCache.put("directives/decorators/ionic/tabs.html","
"); +$templateCache.put("directives/decorators/ionic/textarea.html","
{{ (hasError() && errorMessage(schemaError())) || form.description}}
");}]); +angular.module('schemaForm').config(['schemaFormDecoratorsProvider', function(decoratorsProvider) { + var base = 'directives/decorators/ionic/'; + + decoratorsProvider.createDecorator('ionicDecorator', { + textarea: base + 'textarea.html', + fieldset: base + 'fieldset.html', + array: base + 'array.html', + tabarray: base + 'tabarray.html', + tabs: base + 'tabs.html', + section: base + 'section.html', + conditional: base + 'section.html', + actions: base + 'actions.html', + select: base + 'select.html', + checkbox: base + 'checkbox.html', + checkboxes: base + 'checkboxes.html', + number: base + 'default.html', + password: base + 'default.html', + submit: base + 'submit.html', + button: base + 'submit.html', + radios: base + 'radios.html', + 'radios-inline': base + 'radios-inline.html', + radiobuttons: base + 'radio-buttons.html', + help: base + 'help.html', + date: base + 'default.html', + 'default': base + 'default.html' + }, [ + // function(form) { + // if (form.readonly && form.key && form.type !== 'fieldset') { + // return base + 'readonly.html'; + // } + // } + ]); + + //manual use directives + decoratorsProvider.createDirectives({ + textarea: base + 'textarea.html', + select: base + 'select.html', + checkbox: base + 'checkbox.html', + checkboxes: base + 'checkboxes.html', + number: base + 'default.html', + submit: base + 'submit.html', + button: base + 'submit.html', + text: base + 'default.html', + date: base + 'default.html', + password: base + 'default.html', + datepicker: base + 'datepicker.html', + input: base + 'default.html', + radios: base + 'radios.html', + 'radios-inline': base + 'radios-inline.html', + radiobuttons: base + 'radio-buttons.html', + }); + +}]).directive('sfFieldset', function() { + return { + transclude: true, + scope: true, + templateUrl: 'directives/decorators/ionic/fieldset-trcl.html', + link: function(scope, element, attrs) { + scope.title = scope.$eval(attrs.title); + } + }; +}); + +// .directive('formatDate',function (){ +// return { +// require: 'ngModel', +// link: function(scope, elem, attr, modelCtrl) { +// modelCtrl.$formatters.push(function(modelValue){ +// return new Date(modelValue); +// }); +// } +// }; +// }); diff --git a/dist/ionic-decorator.min.js b/dist/ionic-decorator.min.js new file mode 100644 index 000000000..4505b009e --- /dev/null +++ b/dist/ionic-decorator.min.js @@ -0,0 +1 @@ +angular.module("schemaForm").run(["$templateCache",function(e){e.put("directives/decorators/ionic/actions-trcl.html",'
'),e.put("directives/decorators/ionic/actions.html",'
'),e.put("directives/decorators/ionic/array.html",'

{{ form.title }}

'),e.put("directives/decorators/ionic/checkbox.html",'
'),e.put("directives/decorators/ionic/checkboxes.html",'
'),e.put("directives/decorators/ionic/default.html",''),e.put("directives/decorators/ionic/fieldset-trcl.html",'
{{ form.title }}
'),e.put("directives/decorators/ionic/fieldset.html",'
{{ form.title }}
'),e.put("directives/decorators/ionic/help.html",'
'),e.put("directives/decorators/ionic/radio-buttons.html",'
'),e.put("directives/decorators/ionic/radios-inline.html",'
'),e.put("directives/decorators/ionic/radios.html",''),e.put("directives/decorators/ionic/readonly.html",'
'),e.put("directives/decorators/ionic/section.html",'
'),e.put("directives/decorators/ionic/select.html",''),e.put("directives/decorators/ionic/submit.html",' '),e.put("directives/decorators/ionic/tabarray.html",'
'),e.put("directives/decorators/ionic/tabs.html",'
'),e.put("directives/decorators/ionic/textarea.html",'
{{ (hasError() && errorMessage(schemaError())) || form.description}}
')}]),angular.module("schemaForm").config(["schemaFormDecoratorsProvider",function(e){var t="directives/decorators/ionic/";e.createDecorator("ionicDecorator",{textarea:t+"textarea.html",fieldset:t+"fieldset.html",array:t+"array.html",tabarray:t+"tabarray.html",tabs:t+"tabs.html",section:t+"section.html",conditional:t+"section.html",actions:t+"actions.html",select:t+"select.html",checkbox:t+"checkbox.html",checkboxes:t+"checkboxes.html",number:t+"default.html",password:t+"default.html",submit:t+"submit.html",button:t+"submit.html",radios:t+"radios.html","radios-inline":t+"radios-inline.html",radiobuttons:t+"radio-buttons.html",help:t+"help.html","default":t+"default.html"},[]),e.createDirectives({textarea:t+"textarea.html",select:t+"select.html",checkbox:t+"checkbox.html",checkboxes:t+"checkboxes.html",number:t+"default.html",submit:t+"submit.html",button:t+"submit.html",text:t+"default.html",date:t+"default.html",password:t+"default.html",datepicker:t+"datepicker.html",input:t+"default.html",radios:t+"radios.html","radios-inline":t+"radios-inline.html",radiobuttons:t+"radio-buttons.html"})}]).directive("sfFieldset",function(){return{transclude:!0,scope:!0,templateUrl:"directives/decorators/ionic/fieldset-trcl.html",link:function(e,t,o){e.title=e.$eval(o.title)}}}).directive("formatDate",function(){return{require:"ngModel",link:function(e,t,o,s){s.$formatters.push(function(e){return angular.isString(e)||angular.isNumber(e)?new Date(e):e}),s.$parsers.push(function(e){return e?e.toString():void 0})}}}); \ No newline at end of file diff --git a/gulp/tasks/default.js b/gulp/tasks/default.js index b5ee304c8..f333cb59c 100644 --- a/gulp/tasks/default.js +++ b/gulp/tasks/default.js @@ -2,6 +2,7 @@ var gulp = require('gulp'); gulp.task('default', [ 'minify', + 'ionic', 'bootstrap', 'bootstrap-datepicker' ]); diff --git a/gulp/tasks/ionic.js b/gulp/tasks/ionic.js new file mode 100644 index 000000000..9dcfc55a7 --- /dev/null +++ b/gulp/tasks/ionic.js @@ -0,0 +1,29 @@ +var gulp = require('gulp'), + streamqueue = require('streamqueue'), + minifyHtml = require('gulp-minify-html'), + templateCache = require('gulp-angular-templatecache'), + concat = require('gulp-concat'), + uglify = require('gulp-uglify'); + +gulp.task('ionic', function() { + var stream = streamqueue({objectMode: true}); + stream.queue( + gulp.src('./src/directives/decorators/ionic/*.html') + .pipe(minifyHtml({ + empty: true, + spare: true, + quotes: true + })) + .pipe(templateCache({ + module: 'schemaForm', + root: 'directives/decorators/ionic/' + })) + ); + stream.queue(gulp.src('./src/directives/decorators/ionic/*.js')); + + stream.done() + .pipe(concat('ionic-decorator.min.js')) + .pipe(uglify()) + .pipe(gulp.dest('./dist/')); + +}); \ No newline at end of file diff --git a/src/directives/decorators/ionic/actions-trcl.html b/src/directives/decorators/ionic/actions-trcl.html new file mode 100644 index 000000000..0b32cbc2f --- /dev/null +++ b/src/directives/decorators/ionic/actions-trcl.html @@ -0,0 +1 @@ +
diff --git a/src/directives/decorators/ionic/actions.html b/src/directives/decorators/ionic/actions.html new file mode 100644 index 000000000..31c4df472 --- /dev/null +++ b/src/directives/decorators/ionic/actions.html @@ -0,0 +1,13 @@ +
+ + +
diff --git a/src/directives/decorators/ionic/array.html b/src/directives/decorators/ionic/array.html new file mode 100644 index 000000000..be0686245 --- /dev/null +++ b/src/directives/decorators/ionic/array.html @@ -0,0 +1,37 @@ +
+

{{ form.title }}

+
    +
  1. + +
    +
    + +
    +
    + + +
  2. +
+ +
+
+ +
+
+
+
diff --git a/src/directives/decorators/ionic/checkbox.html b/src/directives/decorators/ionic/checkbox.html new file mode 100644 index 000000000..03455c10a --- /dev/null +++ b/src/directives/decorators/ionic/checkbox.html @@ -0,0 +1,33 @@ + + + +
+ + +
+
diff --git a/src/directives/decorators/ionic/checkboxes.html b/src/directives/decorators/ionic/checkboxes.html new file mode 100644 index 000000000..f926ee2e0 --- /dev/null +++ b/src/directives/decorators/ionic/checkboxes.html @@ -0,0 +1,20 @@ +
+ +
+ + +
+
+
diff --git a/src/directives/decorators/ionic/default.html b/src/directives/decorators/ionic/default.html new file mode 100644 index 000000000..2743d373b --- /dev/null +++ b/src/directives/decorators/ionic/default.html @@ -0,0 +1,143 @@ + + diff --git a/src/directives/decorators/ionic/fieldset-trcl.html b/src/directives/decorators/ionic/fieldset-trcl.html new file mode 100644 index 000000000..eb0516bfb --- /dev/null +++ b/src/directives/decorators/ionic/fieldset-trcl.html @@ -0,0 +1,5 @@ +
+ {{ form.title }} +
+
+
diff --git a/src/directives/decorators/ionic/fieldset.html b/src/directives/decorators/ionic/fieldset.html new file mode 100644 index 000000000..2276d67c3 --- /dev/null +++ b/src/directives/decorators/ionic/fieldset.html @@ -0,0 +1,5 @@ +
+ {{ form.title }} +
+ +
diff --git a/src/directives/decorators/ionic/help.html b/src/directives/decorators/ionic/help.html new file mode 100644 index 000000000..aca5bb56a --- /dev/null +++ b/src/directives/decorators/ionic/help.html @@ -0,0 +1 @@ +
diff --git a/src/directives/decorators/ionic/ionic-decorator.js b/src/directives/decorators/ionic/ionic-decorator.js new file mode 100644 index 000000000..d2fecccc0 --- /dev/null +++ b/src/directives/decorators/ionic/ionic-decorator.js @@ -0,0 +1,80 @@ +angular.module('schemaForm').config(['schemaFormDecoratorsProvider', function(decoratorsProvider) { + var base = 'directives/decorators/ionic/'; + + decoratorsProvider.createDecorator('ionicDecorator', { + textarea: base + 'textarea.html', + fieldset: base + 'fieldset.html', + array: base + 'array.html', + tabarray: base + 'tabarray.html', + tabs: base + 'tabs.html', + section: base + 'section.html', + conditional: base + 'section.html', + actions: base + 'actions.html', + select: base + 'select.html', + checkbox: base + 'checkbox.html', + checkboxes: base + 'checkboxes.html', + number: base + 'default.html', + password: base + 'default.html', + submit: base + 'submit.html', + button: base + 'submit.html', + radios: base + 'radios.html', + 'radios-inline': base + 'radios-inline.html', + radiobuttons: base + 'radio-buttons.html', + help: base + 'help.html', + 'default': base + 'default.html' + }, [ + // function(form) { + // if (form.readonly && form.key && form.type !== 'fieldset') { + // return base + 'readonly.html'; + // } + // } + ]); + + //manual use directives + decoratorsProvider.createDirectives({ + textarea: base + 'textarea.html', + select: base + 'select.html', + checkbox: base + 'checkbox.html', + checkboxes: base + 'checkboxes.html', + number: base + 'default.html', + submit: base + 'submit.html', + button: base + 'submit.html', + text: base + 'default.html', + date: base + 'default.html', + password: base + 'default.html', + datepicker: base + 'datepicker.html', + input: base + 'default.html', + radios: base + 'radios.html', + 'radios-inline': base + 'radios-inline.html', + radiobuttons: base + 'radio-buttons.html', + }); + +}]).directive('sfFieldset', function() { + return { + transclude: true, + scope: true, + templateUrl: 'directives/decorators/ionic/fieldset-trcl.html', + link: function(scope, element, attrs) { + scope.title = scope.$eval(attrs.title); + } + }; +}) + +.directive('formatDate',function (){ + return { + require: 'ngModel', + link: function(scope, elem, attr, modelCtrl) { + modelCtrl.$formatters.push(function(value){ + if (angular.isString(value) || angular.isNumber(value)) { + return new Date(value); + } + return value; + }) + modelCtrl.$parsers.push(function(value){ + if(value){ + return value.toString(); + } + }) + } + } +}); diff --git a/src/directives/decorators/ionic/radio-buttons.html b/src/directives/decorators/ionic/radio-buttons.html new file mode 100644 index 000000000..97fa41b65 --- /dev/null +++ b/src/directives/decorators/ionic/radio-buttons.html @@ -0,0 +1,23 @@ +
+
+ +
+
+ +
+
+
diff --git a/src/directives/decorators/ionic/radios-inline.html b/src/directives/decorators/ionic/radios-inline.html new file mode 100644 index 000000000..f46cd8fd5 --- /dev/null +++ b/src/directives/decorators/ionic/radios-inline.html @@ -0,0 +1,17 @@ +
+ +
+ +
+
+
diff --git a/src/directives/decorators/ionic/radios.html b/src/directives/decorators/ionic/radios.html new file mode 100644 index 000000000..b16402708 --- /dev/null +++ b/src/directives/decorators/ionic/radios.html @@ -0,0 +1,36 @@ + + + + + diff --git a/src/directives/decorators/ionic/readonly.html b/src/directives/decorators/ionic/readonly.html new file mode 100644 index 000000000..4f0b1d126 --- /dev/null +++ b/src/directives/decorators/ionic/readonly.html @@ -0,0 +1,6 @@ +
+ + + +
+
diff --git a/src/directives/decorators/ionic/section.html b/src/directives/decorators/ionic/section.html new file mode 100644 index 000000000..a11c5d817 --- /dev/null +++ b/src/directives/decorators/ionic/section.html @@ -0,0 +1,4 @@ +
+ +
diff --git a/src/directives/decorators/ionic/select.html b/src/directives/decorators/ionic/select.html new file mode 100644 index 000000000..29dac6ece --- /dev/null +++ b/src/directives/decorators/ionic/select.html @@ -0,0 +1,39 @@ + + + \ No newline at end of file diff --git a/src/directives/decorators/ionic/submit.html b/src/directives/decorators/ionic/submit.html new file mode 100644 index 000000000..f8cddc032 --- /dev/null +++ b/src/directives/decorators/ionic/submit.html @@ -0,0 +1,10 @@ + + diff --git a/src/directives/decorators/ionic/tabarray.html b/src/directives/decorators/ionic/tabarray.html new file mode 100644 index 000000000..44d33ee51 --- /dev/null +++ b/src/directives/decorators/ionic/tabarray.html @@ -0,0 +1,58 @@ + +
+
+ +
+ +
+
+
+ + + + +
+
+
+ +
+ +
+ +
diff --git a/src/directives/decorators/ionic/tabs.html b/src/directives/decorators/ionic/tabs.html new file mode 100644 index 000000000..747a358bd --- /dev/null +++ b/src/directives/decorators/ionic/tabs.html @@ -0,0 +1,21 @@ +
+ + +
+
+ + +
+
+
diff --git a/src/directives/decorators/ionic/textarea.html b/src/directives/decorators/ionic/textarea.html new file mode 100644 index 000000000..9a0f29d74 --- /dev/null +++ b/src/directives/decorators/ionic/textarea.html @@ -0,0 +1,12 @@ +
+ + + {{ (hasError() && errorMessage(schemaError())) || form.description}} +