Skip to content

Double escaping single quotes #20

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 26 commits into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
b7b0b1a
Double escaping single quotes
Jun 23, 2016
a823e97
Material upgrades
Jun 28, 2016
c550074
md-auto-complete work, created new sf-changed-auto-complete to watch …
brianpkelley Aug 1, 2016
02ad436
spacing
brianpkelley Aug 1, 2016
7ef7261
Untrack dist files
brianpkelley Aug 1, 2016
0700380
Merge branch 'develop' of https://github.com/json-schema-form/angular…
brianpkelley Aug 1, 2016
2ddee96
removing mdInputBuilder as material-class.js now implements the same …
brianpkelley Aug 1, 2016
e0991ba
Formatting and layout fixes
brianpkelley Sep 14, 2016
c910b5e
Merge branch 'develop' of github.com:betterMDS/angular-schema-form-ma…
brianpkelley Sep 29, 2016
b948805
Resolve conflicts
brianpkelley Sep 29, 2016
53c8a65
Merge pull request #2 from betterMDS/pr/1
brianpkelley Sep 29, 2016
c8ed336
Upstream Changes and DIST files
brianpkelley Sep 29, 2016
e6abd07
web pack build... hopefully
brianpkelley Sep 29, 2016
947a953
more webpack
brianpkelley Sep 29, 2016
46087a9
more webpack...
brianpkelley Sep 30, 2016
3fe8315
Autocomplete dropdown issues
brianpkelley Sep 30, 2016
c9e8f9b
Autocomplete dropdown issues
brianpkelley Sep 30, 2016
114e772
Dropdown readonly
brianpkelley Nov 1, 2016
5c09832
proget
brianpkelley Nov 1, 2016
31b3863
select disable
brianpkelley Nov 1, 2016
50de0da
Fixing md-card flex issues
brianpkelley Jan 12, 2017
8876a35
Updating
brianpkelley Mar 16, 2018
5cfa38b
Misc Updates
brianpkelley May 25, 2018
0cf7498
So... there's like two devs working on this stuff, so i should like, …
brianpkelley Jul 31, 2018
2314256
bump
brianpkelley Jul 31, 2018
15c2ef4
updates
brianpkelley Apr 13, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .bowerrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"directory": "bower_components",
"registry": {
"search": [
"https://bettervideo:md$2016@proget.mdsweb01.bettervideo.com/bower/bower",
"https://bower.herokuapp.com"
],
"register": "https://bettervideo:md$2016@proget.mdsweb01.bettervideo.com/bower/bower",
"publish": "https://bettervideo:md$2016@proget.mdsweb01.bettervideo.com/bower/bower"
},
"strict-ssl": false
}
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -5,6 +5,7 @@ Angular Material Decorator

For https://github.com/json-schema-form/angular-schema-form


Work In Progress
----------------
Angular Material has reached 1.0.0 however I do not feel it is remotely stable yet, this decorator is progressing very cautiously until that project hits a more stable milestone. That said, I have made an early alpha available and will continue to release alpha releases as I add new features, these **are not production quality** as the name alpha implies.
8 changes: 6 additions & 2 deletions bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "angular-schema-form-material",
"version": "1.0.0-alpha.1",
"version": "1.0.0-alpha.2",
"authors": [
"Marcel Bennett <iamanthropic@gmail.com>"
],
@@ -22,7 +22,7 @@
"tests"
],
"dependencies": {
"angular-schema-form": ">=0.8.13"
"angular-schema-form": "git://github.com/betterMDS/angular-schema-form.git#feature/webpack-babel"
},
"devDependencies": {
"angular": "1.5.5",
@@ -32,5 +32,9 @@
"angular-messages": "1.5.5",
"angular-ui-ace": "~0.2.3",
"moment": "~2.10.6"
},
"resolutions": {
"angular": "1.5.8",
"angular-schema-form": "feature/webpack-babel"
}
}
801 changes: 496 additions & 305 deletions dist/angular-schema-form-material.js

Large diffs are not rendered by default.

9 changes: 5 additions & 4 deletions dist/angular-schema-form-material.min.js

Large diffs are not rendered by default.

27 changes: 14 additions & 13 deletions gulpfile.js
Original file line number Diff line number Diff line change
@@ -7,20 +7,21 @@ var gulp = require('gulp'),
uglify = require('gulp-uglify'),
jscs = require('gulp-jscs');

gulp.task('build', function() {
gulp.task('build', ['templates','js']);
gulp.task('js', function() {
var stream = streamqueue({ objectMode: true });
stream.queue(
gulp.src('./src/**/*.html')
.pipe(minifyHtml({
empty: true,
spare: true,
quotes: true
}))
.pipe(templateCache({
module: 'schemaForm',
root: 'decorators/material/'
}))
);
// stream.queue(
// gulp.src('./src/**/*.html')
// .pipe(minifyHtml({
// empty: true,
// spare: true,
// quotes: true
// }))
// .pipe(templateCache({
// module: 'schemaForm',
// root: 'decorators/material/'
// }))
// );
stream.queue(gulp.src('./src/**/*.js'));

stream.done()
244 changes: 175 additions & 69 deletions material-decorator.js

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion material-decorator.min.js

Large diffs are not rendered by default.

28,572 changes: 28,572 additions & 0 deletions package-lock.json

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
{
"name": "angular-schema-form-material",
"version": "1.0.0-alpha.1",
"version": "1.0.0-alpha.5",
"description": "Angular Material decorator for Angular Schema Form",
"main": "dist/material-decorator.js",
"scripts": {
"buildAll": "npm run templates && npm run build",
"templates": "gulp templates",
"dist": "npm run build && npm run minify",
"build": "webpack",
@@ -21,7 +22,7 @@
"angular": ">= 1.2",
"angular-messages": "^1.5.0",
"angular-sanitize": ">= 1.2",
"angular-schema-form": "git://github.com/json-schema-form/angular-schema-form.git#feature/webpack-babel",
"angular-schema-form": "git://github.com/betterMDS/angular-schema-form.git#feature/webpack-babel",
"tv4": "~1.0.15"
},
"devDependencies": {
25 changes: 13 additions & 12 deletions src/angular-schema-form-material-templates.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/angular-schema-form-material-templates.min.js

Large diffs are not rendered by default.

11 changes: 6 additions & 5 deletions src/array.html
Original file line number Diff line number Diff line change
@@ -8,9 +8,9 @@
ng-repeat="item in modelArray track by $index"
schema-form-array-items
class="{{form.fieldHtmlClass}}">
<md-button flex="none" flex-order="2"
<md-button flex="none" flex-order="2" flex="5"
type="button"
ng-hide="form.readonly || form.remove === null"
ng-if=" !( form.readonly || form.remove === null )"
ng-click="deleteFromArray($index)"
ng-disabled="form.schema.minItems >= modelArray.length"
class="md-icon-button" aria-label="More"
@@ -19,16 +19,17 @@
</md-button>
</md-list-item>
</md-list>
<div class="clearfix" style="padding: 15px;" ng-model="modelArray" schema-validate="form">
<div class="clearfix" ng-model="modelArray" schema-validate="form" layout="row" layout-align="end center">
<div class="help-block"
ng-show="(hasError() && errorMessage(schemaError())) || form.description"
ng-bind-html="(hasError() && errorMessage(schemaError())) || form.description"></div>

<md-button ng-hide="form.readonly || form.add === null"
<md-button ng-if=" !( form.readonly || form.add === null )"
ng-click="appendToArray()"
ng-disabled="form.schema.maxItems <= modelArray.length"
type="button"
class="btn md-raised md-primary {{ form.style.add || 'btn-default' }} pull-right">
style="align-self: flex-end;"
class="md-raised md-mini md-primary {{ form.style.add || 'btn-default' }} pull-right">
<i class="glyphicon glyphicon-plus"></i>
{{ form.add || 'Add'}}
</md-button>
14 changes: 8 additions & 6 deletions src/autocomplete.html
Original file line number Diff line number Diff line change
@@ -1,21 +1,23 @@
<div class="form-group {{form.htmlClass}} schema-form-select"
ng-class="{'has-error': hasError(), 'has-success': hasSuccess(), 'has-feedback': form.feedback !== false}"
sf-messages sf-layout>
<div class="form-group {{::form.htmlClass ? form.htmlClass : 'flex-100'}} schema-form-select " sf-layout>
<md-autocomplete flex

ng-class="{'has-error': hasError(), 'has-success': hasSuccess(), 'has-feedback': form.feedback !== false}"
ng-disabled="form.readonly"
ng-model="$$value$$"
sf-autocomplete
sf-field-model="replaceAll"
sf-changed-auto-complete="form"
schema-validate="form"
md-selected-item="$$value$$"
md-search-text="searchText"
md-selected-item-change="'todo';"
md-items="item in evalExpr('this[\''+form.optionFilter+'\'](\''+searchText+'\')')"
md-items="item in evalExpr('this[\\''+form.optionFilter+'\\'](\\''+searchText+'\\')')"
md-item-text="item.name"
md-floating-label="{{::form.title}}"
md-menu-class="autocomplete-custom-template">
md-menu-class="autocomplete-custom-template"
>
<md-item-template>
<span md-highlight-text="searchText">{{item.name}}</span>
<span md-highlight-text="searchText" md-highlight-flags="i">{{item.name}}</span>
</md-item-template>
<md-not-found>
No matches found
9 changes: 8 additions & 1 deletion src/card.html
Original file line number Diff line number Diff line change
@@ -1,2 +1,9 @@
<md-card class="schema-form-card {{form.htmlClass}}">
<md-card ng-disabled="form.readonly">
<!--{{form| json}}-->
<md-card-header ng-if="form.title && !form.notitle">
<md-card-header-text>
<span class="md-title">{{ form.title }}</span>
</md-card-header-text>
</md-card-header>
<md-card-content ng-class='{"layout-column": !form.inline, "layout-row": form.inline, "layout-wrap": form.inline }' sf-field-transclude></md-card-content>
</md-card>
27 changes: 14 additions & 13 deletions src/date.html
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
<div class="schema-form-date {{::form.htmlClass}}">
<label ng-show="showTitle()" for="{{::form.key|sfCamelKey}}">{{::form.title}}</label>
<md-datepicker sf-field-model
sf-changed="form"
schema-validate="form"
sf-type-parser="form.schema"
id="{{::form.key|sfCamelKey}}"
ng-show="::form.key"
ng-class="::form.fieldHtmlClass"
ng-disabled="::form.readonly"
md-placeholder="Enter date" sf-messages>
</md-datepicker>
</div>
<md-input-container class="schema-form-date" ng-class="[ form.htmlClass || 'flex-100' ]">
<label ng-show="showTitle()" for="{{::form.key|sfCamelKey}}">{{::form.title}}</label>
<md-datepicker sf-field-model
sf-changed="form"
schema-validate="form"
sf-type-parser="form.schema"
id="{{::form.key|sfCamelKey}}"
ng-show="::form.key"
ng-class="::form.fieldHtmlClass"
ng-disabled="::form.readonly"

>
</md-datepicker>
</md-input-container>
41 changes: 24 additions & 17 deletions src/default.html
Original file line number Diff line number Diff line change
@@ -1,18 +1,25 @@
<md-input-container class="schema-form-{{::form.type}} {{::form.htmlClass}}"
ng-class="{'has-error': hasError(), 'has-success': hasSuccess(), 'has-feedback': form.feedback !== false}"
sf-messages sf-layout sf-material-class="md-input-has-value">
<label ng-show="showTitle()" for="{{::form.key|sfCamelKey}}">{{::form.title}}</label>
<input sf-field-model
ng-show="::form.key"
type="{{::form.type}}"
step="any"
sf-changed="form"
placeholder="{{form.placeholder}}"
id="{{::form.key|sfCamelKey}}"
ng-class="::form.fieldHtmlClass"
sf-type-parser="form.schema"
ng-disabled="::form.readonly"
schema-validate="form"
name="{{::form.key|sfCamelKey}}"
aria-describedby="{{::form.key|sfCamelKey}}Status" />
<md-input-container
class="form-group schema-form-input"
ng-class="[ form.htmlClass ? form.htmlClass : 'flex-100', {'has-error': hasError(), 'has-success': hasSuccess(), 'has-feedback': form.feedback !== false }]"
sf-messages sf-layout

>
<label ng-show="showTitle()" for="{{::form.key|sfCamelKey}}">{{::form.title}}</label>
<input sf-field-model
ng-show="::form.key"
type="{{::form.type}}"
step="any"
sf-changed="form"
id="{{::form.key|sfCamelKey}}"
ng-class="::form.fieldHtmlClass"
sf-type-parser="form.schema"
ng-disabled="::form.readonly"
schema-validate="form"
name="{{::form.key|sfCamelKey}}"
aria-describedby="{{::form.key|sfCamelKey}}Status"

ng-attr-md-maxlength="{{form.maxlength}}"
ng-attr-maxlength="{{form.maxlength}}"
/>

</md-input-container>
2 changes: 1 addition & 1 deletion src/fieldset-trcl.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<fieldset ng-disabled="form.readonly" class="standard {{form.htmlClass}}" flex>
<legend ng-show="form.title">{{ form.title }}</legend>
<legend ng-show="showTitle()">{{ form.title }}</legend>
<div ng-transclude></div>
</fieldset>
7 changes: 5 additions & 2 deletions src/fieldset.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
<fieldset ng-disabled="form.readonly" class="standard {{form.htmlClass}}" flex>
<legend ng-show="form.title">{{ form.title }}</legend>
<fieldset ng-disabled="form.readonly" class="standard {{ form.htmlClass ? form.htmlClass : 'flex-100' }}">
<legend ng-show="showTitle()">{{ form.title }}</legend>
<div layout="row" layout-wrap sf-field-transclude>

</div>
</fieldset>
8 changes: 4 additions & 4 deletions src/material-class.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
angular.module('schemaForm').directive('sfMaterialClass', function($compile, $timeout) {
angular.module('schemaForm').directive('sfMaterialClass', ["$compile", "$timeout", function($compile, $timeout) {
return {
restrict : 'A',
scope : false,
@@ -15,10 +15,10 @@ angular.module('schemaForm').directive('sfMaterialClass', function($compile, $ti
// Element class is not set in DOM if executed immediately.
// I don't understand exactly why but it's probably related to other directive job.
$timeout(function() {
if (modelValue !== null && typeof modelValue !== 'undefined' && modelValue !== false) {
if (modelValue !== null && typeof modelValue !== 'undefined' && modelValue !== false && modelValue !== '') {
element.addClass(attrs.sfMaterialClass);
}
}, 0);
}, 100);
}
};
});
}]);
769 changes: 464 additions & 305 deletions src/material-decorator.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/radios-inline.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<div class="form-group schema-form-radios-inline {{form.htmlClass}}"
ng-class="{'has-error': hasError(), 'has-success': hasSuccess()}" sf-layout sf-messages>
ng-class="{'has-error': hasError(), 'has-success': hasSuccess()}" sf-layout>
<label class="control-label" ng-show="showTitle()">{{form.title}}</label>
<md-radio-group layout="row"
sf-field-model="replaceAll"
13 changes: 8 additions & 5 deletions src/radios.html
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
<div class="form-group schema-form-radios {{form.htmlClass}}"
ng-class="{'has-error': hasError(), 'has-success': hasSuccess()}">
<label class="control-label" ng-show="showTitle()" aria-label="{{form.title}}" layout="row">{{form.title}} {{form.titleMap | json}}</label>
ng-class="{'has-error': hasError(), 'has-success': hasSuccess()}" sf-messages>
<label class="control-label" ng-show="showTitle()" aria-label="{{form.title}}" layout="row" ng-class="{'md-required': form.required}">{{form.title}}</label>
<div>
<md-radio-group sf-field-model
sf-changed="form"
ng-disabled="form.readonly"
name="{{form.key.join('.')}}"
sf-layout sf-messages>
schema-validate="form"
sf-layout>
<md-radio-button ng-repeat="item in form.titleMap"
ng-value="item.value"
class="{{form.fieldHtmlClass}}"

sf-field-model="ng-class"
ng-class="{ active: item.value === $$value$$ }">
ng-class="{ active: item.value === $$value$$ }"
aria-label="item.name">
<!-- class="{{form.fieldHtmlClass}}" -->
<span ng-bind-html="item.name"></span>
</md-radio-button>
</md-radio-group>
5 changes: 3 additions & 2 deletions src/select.html
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<md-input-container
class="form-group {{::form.htmlClass}} schema-form-select"
class="form-group {{::form.htmlClass ? form.htmlClass : 'flex-100'}} schema-form-select"
ng-class="{'has-error': hasError(), 'has-success': hasSuccess(), 'has-feedback': form.feedback !== false}"
sf-messages sf-layout>
<label ng-show="::showTitle()">{{::form.title}}</label>
<md-select sf-field-model schema-validate="form">
<md-select sf-field-model schema-validate="form" ng-disabled="::form.readonly" name="{{::form.key|sfCamelKey}}" sf-changed="form">
<md-optgroup ng-repeat-start="(key, opt) in form.getOptions(form, evalExpr) | orderBy:'group' as optGroups"
ng-if="opt.group && opt.group != optGroups[key-1].group"
label="{{::opt.group}}"
@@ -16,4 +16,5 @@
ng-value="::opt.value"
ng-repeat-end>{{::opt.name}}</md-option>
</md-select>
<div class="md-errors-spacer"></div>
</md-input-container>
28 changes: 23 additions & 5 deletions src/submit.html
Original file line number Diff line number Diff line change
@@ -1,9 +1,27 @@
<section class="schema-form-submit {{form.htmlClass}}" sf-messages>
<md-button class="md-raised {{ form.style || 'md-primary' }} {{form.fieldHtmlClass}}"
type="{{::form.type}}"
ng-disabled="form.readonly"
aria-label="{{::form.title}}">
<section class="schema-form-submit" ng-class="[ form.htmlClass ]" layout="row">
<md-progress-circular
class="md-accent md-hue-1"
md-mode="indeterminate"
md-diameter="32"
aria-label="Saving"
style="margin: 0 8px 0 0;"
ng-if="model.processing"
></md-progress-circular>

<md-button
class="md-raised"
ng-class="[ form.style || 'md-primary', form.fieldHtmlClass ]"
type="{{::form.type}}"
ng-disabled="form.readonly"
aria-label="{{::form.title}}"
layout="row"
layout-align="space-around center"
ng-click="buttonClick($event,form)"
>

<md-tooltip ng-if="::form.tip">{{::form.tip}}</md-tooltip>


{{::form.title}}
</md-button>
</section>
2 changes: 1 addition & 1 deletion src/textarea.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<md-input-container class="{{::form.htmlClass}} schema-form-textarea" sf-messages sf-layout>
<md-input-container class="schema-form-textarea" sf-messages sf-layout ng-class="[ form.htmlClass || 'flex-100' ]">
<label ng-show="showTitle()" for="{{::form.key|sfCamelKey}}">{{::form.title}}</label>
<textarea ng-class="::form.fieldHtmlClass"
id="{{::form.key|sfCamelKey}}"
14 changes: 14 additions & 0 deletions src/timepicker.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<md-input-container class="schema-form-date" ng-class="[ form.htmlClass || 'flex-100' ]">
<label ng-show="showTitle()" for="{{::form.key|sfCamelKey}}">{{::form.title}}</label>
<md-time-picker sf-field-model
sf-changed="form"
schema-validate="form"
sf-type-parser="form.schema"
id="{{::form.key|sfCamelKey}}"
ng-show="::form.key"
ng-class="::form.fieldHtmlClass"
ng-disabled="::form.readonly"

>
</md-time-picker>
</md-input-container>
2 changes: 1 addition & 1 deletion webpack.config.js
Original file line number Diff line number Diff line change
@@ -7,7 +7,7 @@ console.log('Angular Schema Form v' + pjson.version);
module.exports = {
entry: './src/module.js',
output: {
path: path.join(__dirname, 'dist'),
path: path.join(__dirname, 'dist/'),
filename: 'angular-schema-form-material.js',
libraryTarget: 'umd'
},