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

ac-upload

Package Overview
Dependencies
Maintainers
14
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ac-upload - npm Package Compare versions

Comparing version 0.1.6 to 0.1.7

lib/locale/en_US.js

145

lib/index.js

@@ -7,2 +7,6 @@ 'use strict';

var _from = require('babel-runtime/core-js/array/from');
var _from2 = _interopRequireDefault(_from);
var _defineProperty = require('babel-runtime/core-js/object/define-property');

@@ -36,2 +40,28 @@

var _zh = require('react-intl/locale-data/zh');
var _zh2 = _interopRequireDefault(_zh);
var _en = require('react-intl/locale-data/en');
var _en2 = _interopRequireDefault(_en);
var _zh_CN = require('./locale/zh_CN.js');
var _zh_CN2 = _interopRequireDefault(_zh_CN);
var _en_US = require('./locale/en_US.js');
var _en_US2 = _interopRequireDefault(_en_US);
var _zh_TW = require('./locale/zh_TW.js');
var _zh_TW2 = _interopRequireDefault(_zh_TW);
var _reactIntl = require('react-intl');
var _reactCookies = require('react-cookies');
var _reactCookies2 = _interopRequireDefault(_reactCookies);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

@@ -45,2 +75,25 @@

function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return (0, _from2.default)(arr); } }
(0, _reactIntl.addLocaleData)([].concat(_toConsumableArray(_en2.default), _toConsumableArray(_zh2.default)));
var messages = {};
messages['en'] = _en_US2.default;
messages['en-US'] = _en_US2.default;
messages['en_US'] = _en_US2.default;
messages['zh'] = _zh_CN2.default;
messages['zh-CN'] = _zh_CN2.default;
messages['zh_CN'] = _zh_CN2.default;
messages['zh-TW'] = _zh_TW2.default;
messages['zh_TW'] = _zh_TW2.default;
var localeMap = {
'en-US': 'en',
'en_US': 'en',
'zh-CN': 'zh',
'zh_CN': 'zh',
'zh-TW': 'zh',
'zh_TW': 'zh'
};
var propTypes = {

@@ -150,58 +203,65 @@ title: _propTypes2.default.string,

};
var localeSrc = this.props.locale || _reactCookies2.default.load('u_locale') || 'zh';
var locale = localeMap[localeSrc] || localeSrc;
return _react2.default.createElement(
'span',
{ className: 'ac-upload-wrap' },
_reactIntl.IntlProvider,
{ locale: locale, messages: messages[localeSrc] },
_react2.default.createElement(
'span',
{ onClick: this.showModeHandler },
this.props.children
),
_react2.default.createElement(
_tinperBee.Modal,
{
dialogClassName: 'ac-upload-modal',
backdrop: false,
autoFocus: false,
enforceFocus: false,
show: this.state.show,
onHide: this.hideModelHandler },
{ className: 'ac-upload-wrap' },
_react2.default.createElement(
_tinperBee.Modal.Header,
{
closeButton: true },
_react2.default.createElement(
_tinperBee.Modal.Title,
null,
this.props.title
)
'span',
{ onClick: this.showModeHandler },
this.props.children
),
_react2.default.createElement(
_tinperBee.Modal.Body,
null,
_tinperBee.Modal,
{
dialogClassName: 'ac-upload-modal',
backdrop: false,
autoFocus: false,
enforceFocus: false,
show: this.state.show,
onHide: this.hideModelHandler },
_react2.default.createElement(
'div',
{ className: 'ac-upload-wrap' },
_tinperBee.Modal.Header,
{
closeButton: true },
_react2.default.createElement(
_tinperBee.Upload,
uploadProps,
!this.props.isView && _react2.default.createElement(
_tinperBee.Modal.Title,
null,
_react2.default.createElement(_reactIntl.FormattedMessage, { id: 'intl.title', defaultMessage: this.props.title })
)
),
_react2.default.createElement(
_tinperBee.Modal.Body,
null,
_react2.default.createElement(
'div',
{ className: 'ac-upload-wrap' },
_react2.default.createElement(
_tinperBee.Upload,
uploadProps,
!this.props.isView && _react2.default.createElement(
'div',
{ className: 'opeat' },
_react2.default.createElement('div', { className: 'svg-ready' }),
_react2.default.createElement(
'div',
{ className: 'upload-tips' },
_react2.default.createElement(_reactIntl.FormattedMessage, { id: 'intl.msg.upload' })
)
)
),
this.props.isView && this.props.defaultFileList.length == 0 && _react2.default.createElement(
'div',
{ className: 'opeat' },
_react2.default.createElement('div', { className: 'svg-ready' }),
_react2.default.createElement('div', { className: 'svg-no-pic' }),
_react2.default.createElement(
'div',
{ className: 'upload-tips' },
'\u70B9\u51FB\u9009\u62E9\u4E0A\u4F20\u6587\u4EF6'
{ style: { "fontSize": "14px" }, className: 'upload-tips' },
_react2.default.createElement(_reactIntl.FormattedMessage, { id: 'intl.msg.empty' })
)
)
),
this.props.isView && this.props.defaultFileList.length == 0 && _react2.default.createElement(
'div',
{ className: 'opeat' },
_react2.default.createElement('div', { className: 'svg-no-pic' }),
_react2.default.createElement(
'div',
{ style: { "fontSize": "14px" }, className: 'upload-tips' },
'\u6682\u65E0\u9644\u4EF6'
)
)

@@ -231,2 +291,3 @@ )

};
exports.default = AcUpload;
{
"name": "ac-upload",
"version": "0.1.6",
"version": "0.1.7",
"description": "tinper-bee ac upload components",

@@ -10,3 +10,4 @@ "main": "./lib/index.js",

"build": "rm -rf build && rm -rf lib && rm -rf dist && babel src -d lib --no-comments",
"bundle": "webpack --progress --mode=development && webpack --progress -p --output-filename ac-upload.min.js"
"bundle": "webpack --progress --mode=development && webpack --progress -p --output-filename ac-upload.min.js",
"all": "npm run build && npm run bundle"
},

@@ -58,3 +59,7 @@ "keywords": [

"webpack-cli": "^3.1.0"
},
"dependencies": {
"react-cookies": "^0.1.0",
"react-intl": "^2.8.0"
}
}

@@ -59,6 +59,7 @@ ## AC-Upload

7|name|string|上传设置的参数file名字默认`files[]`
8|onSuccess|function|上传成功后的回调,返回所有response
9|onError|function|上传失败后的回调,用于处理后续失败操作
10|maxSize|number|附件限制大小
11|onDelete|function|删除的时候触发的回调参数为file对象
12|beforeUpload|function|在上传之前执行的函数,当Promise返回false或者被拒绝,函数被中指。不兼容老ie
8|locale|string|语言设置选项,默认为简体中文(zh_CN),目前支持简体中文(zh_CN),繁体中文(zh_TW),英文(en_US)三种
9|onSuccess|function|上传成功后的回调,返回所有response
10|onError|function|上传失败后的回调,用于处理后续失败操作
11|maxSize|number|附件限制大小
12|onDelete|function|删除的时候触发的回调参数为file对象
13|beforeUpload|function|在上传之前执行的函数,当Promise返回false或者被拒绝,函数被中指。不兼容老ie

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

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