meteoric / autoform-ionic Goto Github PK
View Code? Open in Web Editor NEWAutoform templates for Ionic form components
License: MIT License
Autoform templates for Ionic form components
License: MIT License
If you pass label=false
to an afQuickField
, and manually wrap your field in a .item.item-input
, validation messages will be broken. Screenshot: http://cl.ly/image/2f1j25361T09
I created one field to recieve array of string with this code:
dias: {
type: [String],
optional: true,
autoform: {
type: "select-checkbox",
'label-type': 'placeholder',
placeholder: 'Dias',
options: function () {
return [
{label: "Segunda-Feira", value: 'Segunda-Feira'},
{label: "Terça-Feira", value: 'Terça-Feira'},
{label: "Quarta-Feira", value: 'Quarta-Feira'},
{label: "Quinta-Feira", value: 'Quinta-Feira'},
{label: "Sexta-Feira", value: 'Sexta-Feira'},
{label: "Sábado", value: 'Sábado'},
{label: "Domingo", value: 'Domingo'}
];
}
}
},
Then in QuickFOrm the checkbox fields looks like this:
Have some way to fix it or it is a bug?
I need to add additional classes, namely item-text-wrap
, to the div
generated by "boolean-checkbox" type, and potentially by other checkbox and radio types. Like this:
<div class="item item-checkbox item-text-wrap">
<label class="checkbox">
<input type="checkbox" value="" name="allStatementsTrue" data-schema-key="allStatementsTrue">
</label>
Check here if ALL of the above statements are TRUE.
</div>
I'm thinking maybe just add div-class="item-text-wrap"
attribute and in the theme templates, append that to the "item item-checkbox" classes.
If you think that's a good way to do it, I can do a PR.
this package allows to render an ionic Toggle, which is great. Unfortunately I can not figure out how to set the initial state of the toggle. The underlying checkbox is set correctly, but the toggle in the UI is always on. I am using this with simple-schema. Here is a definition where the toggle should be off.
What am I doing wrong?
var geofence = false;
return new SimpleSchema({
geofence:{
type: Boolean,
label: 'In Vicinity',
defaultValue: geofence,
autoform: {
type: 'toggle'
checked: geofence,
}
}
});
Getting an unexpected constraint?
But I'm using aldeed:[email protected]
When doing either of the following, a label is still shown.
{{> afQuickField name="response" type="select-radio" options=question.input.options label=false}}
{{> afFieldInput name="response" type="select-radio" options=question.input.options label=false}}
Currently atmosphere has version 0.1.5 only. Can one of the org owners publish 0.1.6?
This is rather a question than an issue:
Are you planning on integrating the Slider / Range type for autoform?
Cheers
Hello,
I'm trying to add file upload capability using cfs:autoform. Unfortunately, the moment meteoric:autoform-ionic package is added to the project, the file upload input button breaks.
Atleast It doesn't show up with the following lines of code:
{{#autoForm id="insertForm" type="insert" collection="Docs"}}
{{> afQuickField name="name"}}
{{> afQuickField name="fileId" type="cfs-file" collection="files"}}
<button type="submit">Submit</button>
{{/autoForm}}
So the afQuickField does not generate an input type="file" tag at all in the HTML structure. Anyone else facing this weird issue? I made sure all dependencies for both packages are added to the project.
I just began exploring meteoric, forgive me if i'm doing something obviously wrong. But any light on this would be greatly appreciated, thanks.
Can we access to the inputs types without using the {{>quickForm ...}}?
That way I could trigger modals for the inputs e.g a date picker. Is there a way to do this with the {{quickForm...}}?
Not sure if this is because of any versions or dependency, my autoform is not working and I am getting this error, I have the screenshot and the schema code, form code below,
<template name="assesmentNew">
{{#ionModal customTemplate=true}}
{{# autoForm collection="Assesments" id="assesments-new-form" type="insert"}}
<div class="bar bar-header bar-stable">
<button data-dismiss="modal" type="button" class="button button-clear">Cancel</button>
<h2 class="title">New Assesment</h2>
<button type="submit" class="button button-positive button-clear">Save</button>
</div>
<div class="content has-header overflow-scroll">
{{> afQuickField name="name" }}
{{> afQuickField name="email"}}
{{> afQuickField name="category"}}
{{> afQuickField name="location"}}
</div>
{{/autoForm}}
{{/ionModal}}
</template>
Assesments = new Mongo.Collection('assesments');
Assesments.before.insert(function (userId, doc) {
doc.createdAt = new Date();
});
Assesments.attachSchema(new SimpleSchema({
name: {
type: String,
label: 'First Name',
autoform: {
'label-type': 'floating',
placeholder: 'First Name'
}
},
email: {
type: String,
label: 'Email',
autoform: {
'label-type': 'floating',
placeholder: 'Email'
}
},
category: {
type: String,
label: 'Category',
optional: true,
autoform: {
options: [
{value: 'General', label: 'General'},
{value: 'Reported', label: 'Reported'},
{value: 'Follow Up', label: 'Follow Up'}
],
type: 'select-radio'
}
},
assesmentDate: {
type: Date,
label: 'Assesment Date',
optional: true
},
location: {
type: String,
label: 'Location',
autoform: {
'label-type': 'floating',
placeholder: 'Location'
},
max: 200
},
createdBy: {
type: String,
autoValue: function() {
return this.userId
}
}
}
));
if (Meteor.isServer) {
Assesments.allow({
insert: function (userId, doc) {
return true;
},
update: function (userId, doc, fieldNames, modifier) {
return true;
},
remove: function (userId, doc) {
return true;
}
});
}
Screenshot: http://cl.ly/image/093Q3F0H0t3G
Hi there,
when I try to add Hooks to autoform-ionic I get the error message:
Uncaught ReferenceError: AutoForm is not defined
I think this is because in your package.js file aldeeds autoform package is just added but not exported of some kind. Is this right?
When I add aldeeds autoform additionally to this package it works fine, but I am wondering whether it makes sense to have both packages installed and also two different autoform versions then.
Wouldn't it be better to export the autoform object from this package so it can be used like so
AutoForm.hooks(...
Regards
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.