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

nuke-input

Package Overview
Dependencies
Maintainers
3
Versions
185
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nuke-input - npm Package Compare versions

Comparing version 1.0.56 to 2.0.0

7

HISTORY.md
# Changelog
## 2.0.0 / 2018-03-22
* [[cdd5c513](http://gitlab.alibaba-inc.com/nuke/input/commit/cdd5c5132416da0e571a1c9f36d4985d62ba42c9)] - `feat` update dependencies
* [[83298f5d](http://gitlab.alibaba-inc.com/nuke/input/commit/83298f5d215a3e31d5b4bf1049db9065b5d11c95)] - `fix` fix theme/index
* [[c3ee848b](http://gitlab.alibaba-inc.com/nuke/input/commit/c3ee848bdc6fbd39ef789e2f9949724c3f61c62e)] - `fix` fix theme.jsx
* [[0cdf1729](http://gitlab.alibaba-inc.com/nuke/input/commit/0cdf1729f463546be8c04b071df547f0c3073824)] - `fix` fix theme index
## 1.0.56 / 2018-03-14

@@ -5,0 +12,0 @@

628

lib/styles/variable.js
'use strict';
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
function VariableMix(theme) {
var core = theme.Core;
var ComponentCustomStyle = theme.Input;
var ComponentCustomStyle = theme.Input || {};
// / text
// / @namespace statement/disabled
var inputDisabledColor = core['color-text1-1'];
// / border
// / @namespace statement
var inputBorderColor = core['color-line1-2'];
// / border-style
// / @namespace statement
var inputBorderStyle = core['line-solid'];
// / width
// / @namespace size/border
var inputLineWidth = core['line-1'];
// / height
// / @namespace size/bounding
var inputSingleHeight = core.s10;
// / text
// / @namespace size/text
var inputSingleFontSize = core['font-size-body-3'];
var inputPlacepolderFontSize = core['font-size-subhead'];
// / text
// / @namespace statement
var inputSingleReadonlyColor = core['color-text1-2'];
// / placeholder
// / @namespace statement
var inputPlaceholderColor = core['color-text1-2'];
// / corner
// / @namespace statement
var inputSingleRadius = core['corner-1'];
// / text
// / @namespace statement
var inputSingleColor = core['color-text1-4'];
// / border
// / @namespace statement
var inputSingleLineColor = core['color-line1-2'];
// / height
// / @namespace size/bounding
var inputMultipleHeight = core.s20;
// / text
// / @namespace size/text
var inputMultipleFontSize = core['font-size-body-3'];
// / padding
// / @namespace size/bounding
var inputMultipleInsetPadding = core.s1;
// / text
// / @namespace statement
var inputMultipleInsetColor = core['color-text1-4'];
// / corner
// / @namespace statement
var inputMultipleRadius = core['corner-0'];
// / text
// / @namespace statement
var inputMultipleColor = core['color-text1-4'];
// / border
// / @namespace statement
var inputMultipleBorderColor = core['color-line1-2'];
var placeholderHeight = core.s6;
var MDborderColor = core['color-line1-2'];
var MDFocusBorderColor = core['color-brand1-6'];
var MDErrorBorderColor = core['color-error-3'];
var MDPlaceholderSmallHeight = core.s6;
var MDBorderRadius = core['corner-0'];
var MDPlaceholderColor = core['color-text1-1'];
var MDPlaceholderSmallFontSize = core['font-size-caption'];
var MDErrorTextColor = core['color-error-3'];
var countColor = core['color-text1-1'];
var countFontSize = core['font-size-caption'];
var variables = {
var inputVariables = {
/**
* background
* @property statement
*/
'bg-color': core['color-white'],
/**
* background
* @property statement/disabled
*/
'disabled-bg-color': core['color-fill1-3'],
/**
* border
* @property statement/disabled
*/
'disabled-line-color': core['color-line1-1'],
'disabled-color': inputDisabledColor,
'border-color': inputBorderColor,
'border-style': inputBorderStyle,
/**
* text
* @property statement/disabled
*/
'disabled-color': core['color-text1-1'],
/**
* border
* @property statement
*/
'border-color': core['color-line1-2'],
/**
* border-style
* @property statement
*/
'border-style': core['line-solid'],
/**
* border
* @property statement
*/
'line-width': core['line-1'],
/**
* height
* @property size/bouncing
*/
'single-height': core.s10,
'single-font-size': inputSingleFontSize,
'single-readonly-color': inputSingleReadonlyColor,
'placeholder-color': inputPlaceholderColor,
/**
* text
* @property size/text
*/
'single-font-size': core['font-size-body-3'],
/**
* text
* @property statement
*/
'single-readonly-color': core['color-text1-2'],
/**
* text
* @property statement/placeholder
*/
'placeholder-color': core['color-text1-2'],
/**
* text
* @property size/placeholder
*/
'placeholder-font-size': core['font-size-subhead'],
/**
* height
* @property size/placeholder
*/
'placeholder-height': core.s6,
/**
* min-width
* @property size/placeholder
*/
'placeholder-min-width': 200,
/**
* top
* @property size/placeholder
*/
'placeholder-top': 10,
/**
* padding(l, r)
* @property size/bouncing
*/
'single-padding-left-right': 20,
/**
* corner
* @property statement
*/
'single-radius': core['corner-1'],
/**
* text
* @property statement
*/
'single-color': core['color-text1-4'],
/**
* border
* @property statement
*/
'single-line-color': core['color-line1-2'],
/**
* height
* @property size/bounding
*/
'multiple-height': core.s20,
/**
* text
* @property size/text
*/
'multiple-font-size': core['font-size-body-3'],
/**
* padding
* @property size/bounding
*/
'multiple-inset-padding': core.s1,
/**
* text
* @property statement
*/
'multiple-inset-color': core['color-text1-4'],
/**
* padding(l, r)
* @property size/bouncing
*/
'multiple-padding': core.s1,
/**
* corner
* @property statement
*/
'multiple-radius': core['corner-0'],
/**
* text
* @property statement
*/
'multiple-color': core['color-text1-4'],
/**
* border
* @property statement
*/
'multiple-border-color': core['color-line1-2'],
/**
* bottom
* @property size/count
*/
'single-count-bottom': 14,
/**
* right
* @property size/count
*/
'single-count-right': 10,
/**
* min-width
* @property size/count
*/
'single-count-min-width': 200,
/**
* text
* @property statement/count
*/
'count-color': core['color-text1-1'],
/**
* text
* @property statement/count
*/
'count-font-size': core['font-size-caption'],
/**
* text
* @property statement/count
*/
'count-error-color': core['color-error-3'],
/**
* bottom
* @property size/count
*/
'multiple-count-bottom': 16,
/**
* right
* @property size/count
*/
'multiple-count-right': 10,
/**
* min-width
* @property size/count
*/
'multiple-count-min-width': 200,
/**
* height
* @property size/error
*/
'error-height': core.s6,
/**
* text
* @property statement/error
*/
'error-text-color': core['color-error-3'],
/**
* lineHeight
* @property size/error
*/
'error-text-line-height': core.s6,
/**
* text
* @property size/error
*/
'error-text-font-size': core['font-size-caption'],
/**
* padding(t)
* @property size/error
*/
'error-text-padding-top': 6,
/**
* border
* @property statement/error
*/
'error-border-color': core['color-error-3'],
/**
* border
* @property statement/focus
*/
'focus-border-color': core['color-brand1-6'],
/**
* width
* @property size/clear
*/
'clear-width': 34,
/**
* height
* @property size/clear
*/
'clear-height': 34,
/**
* top
* @property size/clear
*/
'clear-top': 26,
/**
* right
* @property size/clear
*/
'clear-right': 20,
/**
* width
* @property size/icon
*/
'icon-width': 34,
/**
* height
* @property size/icon
*/
'icon-height': 34,
/**
* top
* @property size/icon
*/
'icon-top': 26,
/**
* right
* @property size/icon
*/
'icon-right': 20,
/**
* width
* @property size/warning
*/
'warning-width': 38,
/**
* height
* @property size/warning
*/
'warning-height': 38,
/**
* bottom
* @property size/warning
*/
'warning-bottom': 6,
/**
* right
* @property size/warning
*/
'warning-right': 4,
/**
* text
* @property statement/placeholder
*/
'md-focus-placeholder-color': core['color-brand1-6'],
/**
* text
* @property statement/placeholder
*/
'md-empty-placeholder-color': core['color-text1-2'],
'md-error-placeholder-color': MDErrorTextColor,
/**
* text
* @property statement/placeholder
*/
'md-error-placeholder-color': core['color-error-3'],
/**
* text
* @property statement/placeholder/disabled
*/
'md-disabled-placeholder-color': core['color-text1-1'],
'placeholder-font-size': inputPlacepolderFontSize,
'single-padding-left-right': 20,
'single-radius': inputSingleRadius,
'single-color': inputSingleColor,
'single-line-color': inputSingleLineColor,
'multiple-height': inputMultipleHeight,
'multiple-font-size': inputMultipleFontSize,
'multiple-inset-padding': inputMultipleInsetPadding,
'multiple-inset-color': inputMultipleInsetColor,
'multiple-padding': core.s1,
'multiple-radius': inputMultipleRadius,
'multiple-color': inputMultipleColor,
'multiple-border-color': inputMultipleBorderColor,
'md-border-color': MDborderColor,
'md-border-radius': MDBorderRadius,
'md-focus-border-color': MDFocusBorderColor,
'md-error-border-color': MDErrorBorderColor,
/**
* border
* @property statement/placeholder
*/
'md-border-color': core['color-line1-2'],
/**
* corner
* @property statement
*/
'md-border-radius': core['corner-0'],
/**
* border
* @property statement/focus
*/
'md-focus-border-color': core['color-brand1-6'],
/**
* border
* @property statement/error
*/
'md-error-border-color': core['color-error-3'],
/**
* border-top
* @property statement
*/
'md-border-top-width': 0,
/**
* height
* @property size/line
*/
'md-line-height': core['line-2'],
/**
* margin(t,b)
* @property size/line
*/
'md-line-margin-tb': core['line-1'],
/**
* height
* @property size/line/focus
*/
'md-line-focus-height': core['line-3'],
/**
* height
* @property size/line/error
*/
'md-line-error-height': core['line-3'],
'md-focus-line-height': 4,
/**
* border-left
* @property size/bounding
*/
'md-border-left-width': 0,
/**
* border-right
* @property size/bounding
*/
'md-border-right-width': 0,
'placeholder-height': placeholderHeight,
'placeholder-min-width': 200,
/**
* height
* @property size/placeholder
*/
'md-placeholder-height': 40,
/**
* height
* @property size/placeholder/small
*/
'md-placeholder-small-height': 36,
/**
* padding(t)
* @property size/placeholder/small
*/
'md-placeholder-small-padding-top': 6,
/**
* text
* @property size/placeholder
*/
'md-placeholder-font-size': core['font-size-body-3'],
'md-placeholder-color': MDPlaceholderColor,
/**
* text
* @property statement/placeholder
*/
'md-placeholder-color': core['color-text1-1'],
/**
* text
* @property size/placeholder/small
*/
'md-placeholder-small-font-size': core['font-size-caption'],
/**
* height
* @property size/bounding
*/
'md-input-height': 40,
/**
* margin(t)
* @property size/bounding
*/
'md-input-margin-top': 6,
/**
* margin(b)
* @property size/bounding
*/
'md-input-margin-bottom': 6,
/**
* height
* @property size/help
*/
'md-help-height': 28,
/**
* margin(t)
* @property size/help
*/
'md-help-margin-top': core.s1,
/**
* height
* @property size/error
*/
'md-error-height': 28,
'md-error-text-color': MDErrorTextColor,
/**
* text
* @property statement/error
*/
'md-error-text-color': core['color-error-3'],
/**
* text
* @property size/error
*/
'md-error-text-font-size': core['font-size-footnote'],
'single-count-bottom': 14,
'single-count-right': 10,
'single-count-min-width': 200,
'count-color': countColor,
'count-font-size': countFontSize,
'multiple-count-bottom': 16,
'multiple-count-right': 10,
'multiple-count-min-width': 200,
/**
* bottom
* @property size/count
*/
'md-single-count-bottom': 10,
/**
* right
* @property size/count
*/
'md-single-count-right': 10,
/**
* width
* @property size/clear
*/
'md-clear-width': 32,
/**
* height
* @property size/clear
*/
'md-clear-height': 32,
/**
* top
* @property size/clear
*/
'md-clear-top': 40,
/**
* right
* @property size/clear
*/
'md-clear-right': 10,
/**
* width
* @property size/icon
*/
'md-icon-width': 32,
/**
* height
* @property size/icon
*/
'md-icon-height': 32,
/**
* top
* @property size/icon
*/
'md-icon-top': 40,
/**
* right
* @property size/icon
*/
'md-icon-right': 10,
/**
* width
* @property size/warning
*/
'md-warning-width': 36,
/**
* height
* @property size/warning
*/
'md-warning-height': 36,
/**
* bottom
* @property size/warning
*/
'md-warning-bottom': 6,
/**
* right
* @property size/warning
*/
'md-warning-right': 10,
'error-height': core.s6,
'error-text-color': core['color-error-3'],
'error-text-font-size': core['font-size-caption'],
'error-text-padding-top': 6,
'error-border-color': core['color-error-3'],
'focus-border-color': core['color-brand1-6'],
'clear-width': 34,
'clear-height': 34,
'clear-top': 26,
'clear-right': 20,
'icon-width': 34,
'icon-height': 34,
'icon-top': 26,
'icon-right': 20,
'warning-width': 38,
'warning-height': 38,
'warning-bottom': 6,
'warning-right': 4,
/**
* height
* @property size/bouding
*/
'md-multiple-height': 160,
'placeholder-top': 10,
/**
* top
* @property size/placeholder
*/
'md-placeholder-top': 50,
/**
* top
* @property size/placeholder/small
*/
'md-placeholder-small-top': 0,
'multiple-md-placeholder-top': 10,
'count-error-color': core['color-error-3'],
'error-text-line-height': core.s6
/**
* top
* @property size/placeholder
*/
'multiple-md-placeholder-top': 10
};
return _extends({}, variables, ComponentCustomStyle);
// should alway use var statement to carray a assigngg
var variable = Object.assign(inputVariables, ComponentCustomStyle);
return variable;
}
module.exports = VariableMix;
{
"name": "nuke-input",
"version": "1.0.56",
"version": "2.0.0",
"description": "输入框",
"main": "lib/index",
"files": [
"lib",
"docs",
"theme",
"README.md",
"HISTORY.md"
],
"keywords": [
"nuke",
"input"
],
"files": ["lib", "docs", "theme", "README.md", "HISTORY.md"],
"keywords": ["nuke", "input"],
"author": {

@@ -32,9 +23,9 @@ "name": "leanhunter",

"dependencies": {
"nuke-core": "^1.x.x",
"nuke-env": "^1.x.x",
"nuke-helper": "^0.x.x",
"nuke-text": "^0.x.x",
"nuke-theme-provider": "^1.x.x",
"nuke-view": "^1.x.x",
"nuke-image": "^1.x.x"
"nuke-core": "^2.x.x",
"nuke-env": "^2.x.x",
"nuke-helper": "^2.x.x",
"nuke-text": "^2.x.x",
"nuke-theme-provider": "^2.x.x",
"nuke-view": "^2.x.x",
"nuke-image": "^2.x.x"
},

@@ -53,3 +44,3 @@ "devDependencies": {

"mocha": "^3.4.2",
"nuke-button": "^1.x.x",
"nuke-button": "^2.x.x",
"nuke-page": "^1.x.x",

@@ -56,0 +47,0 @@ "resemblejs-node": "^1.0.0",

/** @jsx createElement */
import { createElement, Component, render } from 'rax';
import View from 'nuke-view';
import Text from 'nuke-text';
import Input from 'nuke-input';
import Page from 'nuke-page';
import { isWeb, appInfo } from 'nuke-env';
import { StyleProvider } from 'nuke-theme-provider';
import {
decodeVar,
DemoContainer,
DemoSection,
Demo,
DemoItem,
initDemo,
} from '@alife/nuke-demo-helper';

@@ -13,13 +19,3 @@ const isAndroid = appInfo.platform.toLowerCase() === 'android';

let md = {
Core: {
[`color-brand1-1`]: '#00BBD3',
[`color-brand1-6`]: '#1A9CB7',
[`color-brand1-9`]: '#0096A6',
[`color-error-3`]: '#D50000'
}
};
let App = class NukeDemoIndex extends Component {
const App = class NukeDemoIndex extends Component {
constructor() {

@@ -30,18 +26,14 @@ super();

status2: 'error',
value: '111'
}
value: '111',
};
this.checkLength = this.checkLength.bind(this);
}
change = () => {
this.setState({
status1: 'success'
})
}
status1: 'success',
});
};
checkLength(text) {
let length = text.length;
const length = text.length;
// this.setState({value:text});
}

@@ -51,35 +43,80 @@

return (
<StyleProvider style={md} commonConfigs={{ fixedFont: true }} androidConfigs={{ materialDesign: isAndroid, rippleEnabled: true }}>
<Page title="Textareas ">
<Page.Intro main="Enter Voucher"></Page.Intro>
<View style={styles.demoBlock}>
<Input multiple materialDesign={false} renderClear={true} type="text" placeholder="Ender Voucher Code" />
</View>
<StyleProvider
commonConfigs={{ fixedFont: true }}
androidConfigs={{ materialDesign: isAndroid, rippleEnabled: false }}
style={decodeVar(this.props.variable)}
>
<DemoContainer>
<DemoSection title="全局-Size">
<Demo>
<DemoItem direction="row">
<Input
multiple
materialDesign={false}
renderClear
type="text"
placeholder="Ender Voucher Code"
/>
</DemoItem>
<Page.Intro main="Voucher , error first, then success"></Page.Intro>
<View style={styles.demoBlock}>
<Input multiple materialDesign={false} renderClear={true} defaultValue={'WATSON$7189833'} onInput={this.checkLength} status={this.state.status1} type="text" onChange={this.change} placeholder="Ender Voucher Code" errorMessage={'Voucher code error'} />
</View>
<DemoItem direction="row">
<Input
multiple
materialDesign={false}
renderClear
defaultValue={'WATSON$7189833'}
onInput={this.checkLength}
status={this.state.status1}
type="text"
onChange={this.change}
placeholder="Ender Voucher Code"
errorMessage={'Voucher code error'}
/>
</DemoItem>
<Page.Intro main="renderCount"></Page.Intro>
<View style={styles.demoBlock}>
<Input multiple maxRows={5} onInput={this.checkLength} renderCount={true} type="text" placeholder="milti-line input label" />
</View>
<Page.Intro main="always error"></Page.Intro>
<View style={styles.demoBlock}>
<Input multiple maxLength={20} maxRows={20} defaultValue={this.state.value} onInput={this.checkLength} renderCount={false} errorMessage="error" renderError={true} renderClear={true} type="text" status={this.state.status2} placeholder="milti-line input label" />
</View>
</Page>
<DemoItem direction="row">
<Input
multiple
maxRows={5}
onInput={this.checkLength}
renderCount
type="text"
placeholder="milti-line input label"
/>
</DemoItem>
<DemoItem direction="row">
<Input
multiple
maxLength={20}
maxRows={20}
defaultValue={this.state.value}
onInput={this.checkLength}
renderCount={false}
errorMessage="error"
renderError
renderClear
type="text"
status={this.state.status2}
placeholder="milti-line input label"
/>
</DemoItem>
</Demo>
</DemoSection>
</DemoContainer>
</StyleProvider>
);
}
}
};
const styles = {
demoBlock: {
marginLeft: 30,
marginRight: 30
}
}
render(<App />);
marginRight: 30,
},
};
window.renderDemo = function (lang, variable) {
render(<App variable={variable} />);
};
renderDemo();
initDemo('input');
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