Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

alaska-field-text

Package Overview
Dependencies
Maintainers
1
Versions
29
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

alaska-field-text - npm Package Compare versions

Comparing version 0.12.11 to 0.12.12

6

index.js

@@ -55,3 +55,7 @@ 'use strict';

TextFeild.dbOptions = ['trim', 'match', 'lowercase', 'uppercase', 'maxlength', 'minlength'];
TextFeild.viewOptions = ['trim', 'match', 'lowercase', 'uppercase', 'maxlength', 'minlength', 'addonBefore', 'addonAfter', 'placeholder', 'multiLine', 'translate'];
TextFeild.viewOptions = ['trim', 'match', 'lowercase', 'uppercase', 'maxlength', 'minlength', 'addonBefore', 'addonAfter', 'placeholder', 'multiLine', 'translate', function (options, field) {
if (field.match) {
options.match = field.match.toString();
}
}];
TextFeild.defaultOptions = {

@@ -58,0 +62,0 @@ cell: 'TextFieldCell',

2

package.json
{
"name": "alaska-field-text",
"version": "0.12.11",
"version": "0.12.12",
"description": "Alaska text field",

@@ -5,0 +5,0 @@ "keywords": [

@@ -16,2 +16,19 @@ // @flow

hasError() {
let {
field,
value
} = this.props;
if (value && field.match && typeof field.match === 'string') {
let matchs = field.match.match(/^\/(.+)\/([igm]*)$/);
if (matchs) {
let match = new RegExp(matchs[1], matchs[2]);
if (!match.test(value)) {
return true;
}
}
}
return false;
}
handleChange = (event: SyntheticInputEvent<*>) => {

@@ -35,2 +52,11 @@ if (this.props.onChange) {

className += ' text-field';
if (!errorText && value && field.match && typeof field.match === 'string') {
let matchs = field.match.match(/^\/(.+)\/([igm]*)$/);
if (matchs) {
let match = new RegExp(matchs[1], matchs[2]);
if (!match.test(value)) {
errorText = t('Invalid format');
}
}
}
if (errorText) {

@@ -79,20 +105,18 @@ className += ' has-error';

if (field.horizontal === false) {
let labelElement = label ? <label className="control-label">{label}</label> : null;
if (field.horizontal) {
return (
<div className={className}>
{labelElement}
{inputElement}
{helpElement}
<label className="col-sm-2 control-label">{label}</label>
<div className="col-sm-10">
{inputElement}
{helpElement}
</div>
</div>
);
}
return (
<div className={className}>
<label className="col-sm-2 control-label">{label}</label>
<div className="col-sm-10">
{inputElement}
{helpElement}
</div>
{label ? <label className="control-label">{label}</label> : null}
{inputElement}
{helpElement}
</div>

@@ -99,0 +123,0 @@ );

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc