All Projects → djhi → meteor-autoform-materialize

djhi / meteor-autoform-materialize

Licence: MIT License
DEPRECATED - Meteor AutoForm Materialize templates

Programming Languages

javascript
184084 projects - #8 most used programming language
HTML
75241 projects

Projects that are alternatives of or similar to meteor-autoform-materialize

Meteor Autoform
AutoForm is a Meteor package that adds UI components and helpers to easily create basic forms with automatic insert and update events, and automatic reactive validation.
Stars: ✭ 1,453 (+2927.08%)
Mutual labels:  meteor, autoform
meteor-autoform-bs-datepicker
Custom "bootstrap-datepicker" input type for AutoForm
Stars: ✭ 25 (-47.92%)
Mutual labels:  meteor, autoform
meteor-autoform-bs-datetimepicker
Custom bootstrap-datetimepicker input type with timezone support for AutoForm
Stars: ✭ 18 (-62.5%)
Mutual labels:  meteor, autoform
meteor-bootstrap-tagsinput
Bootstrap Tags Input packaged for Meteor Platform
Stars: ✭ 12 (-75%)
Mutual labels:  meteor
Meteor-logger
🧾 Meteor isomorphic logger. Store application logs in File (FS), MongoDB, or print in Console
Stars: ✭ 51 (+6.25%)
Mutual labels:  meteor
Meteor-Remember-Me
Meteor accounts extension with remember me functionality
Stars: ✭ 13 (-72.92%)
Mutual labels:  meteor
meteor-auth0
Auth0 Login Flow for Meteor apps
Stars: ✭ 20 (-58.33%)
Mutual labels:  meteor
meteor-server-autorun
Server-side Tracker.autorun
Stars: ✭ 36 (-25%)
Mutual labels:  meteor
meteor-publication-collector
Test a Meteor publication by collecting its output.
Stars: ✭ 32 (-33.33%)
Mutual labels:  meteor
Dermatron
Dermatology focused medical records software, augmented with computer vision and artificial intelligence [Meteor packaged with Electron]
Stars: ✭ 19 (-60.42%)
Mutual labels:  meteor
svelte-meteor-data
Reactively track Meteor data inside Svelte components
Stars: ✭ 14 (-70.83%)
Mutual labels:  meteor
meteor-stat
Get a simple analysis of your Meteor app
Stars: ✭ 22 (-54.17%)
Mutual labels:  meteor
polytunes
An collaborative music game using Meteor and Web Audio
Stars: ✭ 23 (-52.08%)
Mutual labels:  meteor
pwa-meteor
meteor based pwa
Stars: ✭ 14 (-70.83%)
Mutual labels:  meteor
meteor-spacebars-tohtml
Meteor package to ease rendering spacebars to html
Stars: ✭ 35 (-27.08%)
Mutual labels:  meteor
latelier
L'atelier, a project management tool
Stars: ✭ 74 (+54.17%)
Mutual labels:  meteor
blaze-magic-events
A new way of binding event handlers to html elements for Meteor's Blaze.
Stars: ✭ 26 (-45.83%)
Mutual labels:  meteor
meteor-vuetify
Experimenting with using Vuetify on a Meteor project.
Stars: ✭ 18 (-62.5%)
Mutual labels:  meteor
meteor-postcss
PostCSS for Meteor
Stars: ✭ 68 (+41.67%)
Mutual labels:  meteor
meteor-google-spreadsheets
Google Spreadsheets for Meteor
Stars: ✭ 53 (+10.42%)
Mutual labels:  meteor

Meteor Autoform Materialize templates

DEPRECATED - Adds materialize templates for autoform.

Important - I no longer use Meteor and won't be updating this project anymore. Please use https://github.com/mozfet/meteor-autoform-materialize which will be updated. Thanks to @mozfet for taking over this project.

Setup

  1. meteor add gildaspk:autoform-materialize
  2. In a client file (ex: /client/config/autoform.js)
AutoForm.setDefaultTemplate('materialize');

You must add materialize CSS and JavaScript yourself. Some packages can help:

Usage and demo

You can checkout the playground which is running here.

Additional type

PickADate

Materialize uses pickadate for date inputs.

You can apply it directly in your template:

{{> afFieldInput name='dateFieldName' type="pickadate"}}

You can also specify it at the schema level:

MySchema = new SimpleSchema({
  dateFieldName: {
    type: Date
    autoform: {
      type:"pickadate"
    }
  }
});

Choosing a Timezone

By default, the field's value will be a Date object representing the selected date and time in the browser's timezone (i.e., based on the user's computer time settings). In most cases, you probably want the Date object relative to some other timezone that you have previously stored. For example, if the form is setting the start date of an event, you want the date to be relative to the event venue's timezone. You can specify a different IANA timezone ID by adding a timezoneId attribute.

{
  date: {
    type: Date,
    autoform: {
      type: "pickadate",
      timezoneId: "America/New_York"
    }
  }
}

Or:

{{> afFieldInput name="typeTest" type="pickadate" timezoneId="America/New_York"}}

Automatic Type Conversions

This input type is intended to be used with type: Date schema keys, but it also works with other schema types. Here's a list:

  • Date: Value is stored as a Date object representing the selected date and time in the timezone you specified with the timezoneId attribute. By default, the timezone is that of the browser (i.e., the user's computer time settings).
  • String: Value is stored as a string representation of the selected date in ISO format, e.g., "2014-11-25T00:00:00".
  • Number: Value is stored as the result of calling getTime() on the Date object (representing the selected date and time in the timezone you specified).
  • Array: If the schema expects an array of Date or String or Number, the value is converted to a one-item array and stored.

To provide pickadate options, set a pickadateOptions attribute equal to a helper that returns the options object.

Switch

You an also use switches

At the template level:

{{> afFieldInput name='dateFieldName' type="switch"}}

At the schema level:

MySchema = new SimpleSchema({
  booleanFieldName: {
    type: Boolean
    autoform: {
      type:"switch"
    }
  }
});

You may specify the trueLabel or falseLabel options to customize the switch.

At the template level:

{{> afFieldInput name='dateFieldName' type="switch" trueLabel="Online" falseLabel="Offline"}}

At the schema level:

MySchema = new SimpleSchema({
  booleanFieldName: {
    type: Boolean
    autoform: {
      type:"switch"
      trueLabel:"Online"
      falseLabel:"Offline"
    }
  }
});

If you need other values than boolean, you may specify the trueValue or falseValue options to customize the switch.

At the template level:

{{> afFieldInput name='dateFieldName' type="switch" trueValue="online" falseValue="offline"}}

At the schema level:

MySchema = new SimpleSchema({
  booleanFieldName: {
    type: Boolean
    autoform: {
      type:"switch"
      trueValue:"online"
      falseValue:"offline"
    }
  }
});

Input with prepended icon

You can add icon to any field like this:

{{> afQuickField name='subject' icon='person'}}

For blank space in place of icon, just use "none":

{{> afQuickField name='subject' icon='none'}}

It also works for textarea:

{{> afQuickField name='message' type='textarea' icon='person'}}

Troubleshooting

Extra carets on selects

This happen when using materialize version 0.97.0. A fix has been released with version 0.97.1 but there are other issues.

You should use poetic:materialize-scss until those problems are corrected.

Contributors

  • Gildas Garcia (@djhi)
  • Razvan Teslaru (@rteslaru)
  • Chun Yang (@Chun-Yang)

License

autoform-materialize is licensed under the MIT Licence, courtesy of marmelab.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].