aldehyde 0.1.2 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bundle.0f01596e1e84d10b8bf2.js +2 -0
- package/dist/bundle.0f01596e1e84d10b8bf2.js.LICENSE.txt +122 -0
- package/dist/bundle.2a04acb7ce8764934edb.js +1 -0
- package/dist/bundle.30500c2afe2c2c45acf6.js +2 -0
- package/dist/bundle.30500c2afe2c2c45acf6.js.LICENSE.txt +17 -0
- package/dist/bundle.53f2485b907e007e5782.js +2 -0
- package/dist/bundle.53f2485b907e007e5782.js.LICENSE.txt +5 -0
- package/dist/bundle.7a7aa9bf0933d82c416d.js +1 -0
- package/dist/bundle.7ed5a8e47d06d7301945.js +1 -0
- package/dist/bundle.9ca5093d1fc9c8298519.js +1 -0
- package/dist/bundle.a2469e87c8ecb696ca29.js +2 -0
- package/dist/bundle.a2469e87c8ecb696ca29.js.LICENSE.txt +43 -0
- package/dist/bundle.a25841069e0a603e5e3d.js +1 -0
- package/dist/bundle.b2d721b5b57471802e74.js +1 -0
- package/dist/bundle.be9a8465528cb86c29f8.js +1 -0
- package/dist/bundle.c09dd9933f9d77879825.js +1 -0
- package/dist/bundle.cac31c728de49f12bac4.js +1 -0
- package/dist/bundle.e5c8b85d867994f256ca.js +1 -0
- package/dist/bundle.fac79e21e934e1941ef8.js +1 -0
- package/dist/css/163-24392163d3c7b54ea806.css +11 -0
- package/dist/css/290-5e8e152675ab7d201c00.css +886 -0
- package/dist/css/main-cd12907a3d8559605f72.css +27274 -0
- package/dist/images/development-30de07a0.png +0 -0
- package/dist/images/header01-e798000c.jpg +0 -0
- package/dist/images/header02-a5f1ecbc.jpg +0 -0
- package/dist/images/logo-06f6a5d8.png +0 -0
- package/dist/images/logo-54b328b7.png +0 -0
- package/dist/images/pain-point-8f02421e.png +0 -0
- package/dist/images/target-13a5b4b9.png +0 -0
- package/dist/images/time-cost-cb40d2c2.png +0 -0
- package/dist/images/time-prograss-44b86b36.png +0 -0
- package/dist/index.html +4 -0
- package/package.json +1 -1
- package/src/aldehyde/index.tsx +3 -0
- package/src/aldehyde/login/index.css +0 -1
- package/src/aldehyde/login/login.js +0 -1
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
/*
|
|
2
|
+
object-assign
|
|
3
|
+
(c) Sindre Sorhus
|
|
4
|
+
@license MIT
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
/*
|
|
8
|
+
object-assign
|
|
9
|
+
(c) Sindre Sorhus
|
|
10
|
+
@license MIT
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
/*!
|
|
14
|
+
Copyright (c) 2017 Jed Watson.
|
|
15
|
+
Licensed under the MIT License (MIT), see
|
|
16
|
+
http://jedwatson.github.io/classnames
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
/*!
|
|
20
|
+
Copyright (c) 2018 Jed Watson.
|
|
21
|
+
Licensed under the MIT License (MIT), see
|
|
22
|
+
http://jedwatson.github.io/classnames
|
|
23
|
+
*/
|
|
24
|
+
|
|
25
|
+
/*!
|
|
26
|
+
* Determine if an object is a Buffer
|
|
27
|
+
*
|
|
28
|
+
* @author Feross Aboukhadijeh <https://feross.org>
|
|
29
|
+
* @license MIT
|
|
30
|
+
*/
|
|
31
|
+
|
|
32
|
+
/*!
|
|
33
|
+
* The buffer module from node.js, for the browser.
|
|
34
|
+
*
|
|
35
|
+
* @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
|
|
36
|
+
* @license MIT
|
|
37
|
+
*/
|
|
38
|
+
|
|
39
|
+
/*! *****************************************************************************
|
|
40
|
+
Copyright (c) Microsoft Corporation.
|
|
41
|
+
|
|
42
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
43
|
+
purpose with or without fee is hereby granted.
|
|
44
|
+
|
|
45
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
46
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
47
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
48
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
49
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
50
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
51
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
52
|
+
***************************************************************************** */
|
|
53
|
+
|
|
54
|
+
/*! http://mths.be/fromcodepoint v0.1.0 by @mathias */
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* @fileOverview
|
|
58
|
+
* @name asn1-1.0.js
|
|
59
|
+
* @author Kenji Urushima kenji.urushima@gmail.com
|
|
60
|
+
* @version asn1 1.0.13 (2017-Jun-02)
|
|
61
|
+
* @since jsrsasign 2.1
|
|
62
|
+
* @license <a href="https://kjur.github.io/jsrsasign/license/">MIT License</a>
|
|
63
|
+
*/
|
|
64
|
+
|
|
65
|
+
/** @license React v0.20.2
|
|
66
|
+
* scheduler.production.min.js
|
|
67
|
+
*
|
|
68
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
69
|
+
*
|
|
70
|
+
* This source code is licensed under the MIT license found in the
|
|
71
|
+
* LICENSE file in the root directory of this source tree.
|
|
72
|
+
*/
|
|
73
|
+
|
|
74
|
+
/** @license React v16.13.1
|
|
75
|
+
* react-is.production.min.js
|
|
76
|
+
*
|
|
77
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
78
|
+
*
|
|
79
|
+
* This source code is licensed under the MIT license found in the
|
|
80
|
+
* LICENSE file in the root directory of this source tree.
|
|
81
|
+
*/
|
|
82
|
+
|
|
83
|
+
/** @license React v17.0.0
|
|
84
|
+
* react-dom.production.min.js
|
|
85
|
+
*
|
|
86
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
87
|
+
*
|
|
88
|
+
* This source code is licensed under the MIT license found in the
|
|
89
|
+
* LICENSE file in the root directory of this source tree.
|
|
90
|
+
*/
|
|
91
|
+
|
|
92
|
+
/** @license React v17.0.2
|
|
93
|
+
* react.production.min.js
|
|
94
|
+
*
|
|
95
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
96
|
+
*
|
|
97
|
+
* This source code is licensed under the MIT license found in the
|
|
98
|
+
* LICENSE file in the root directory of this source tree.
|
|
99
|
+
*/
|
|
100
|
+
|
|
101
|
+
/** @preserve
|
|
102
|
+
* Counter block mode compatible with Dr Brian Gladman fileenc.c
|
|
103
|
+
* derived from CryptoJS.mode.CTR
|
|
104
|
+
* Jan Hruby jhruby.web@gmail.com
|
|
105
|
+
*/
|
|
106
|
+
|
|
107
|
+
/** @preserve
|
|
108
|
+
(c) 2012 by Cédric Mesnil. All rights reserved.
|
|
109
|
+
|
|
110
|
+
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
|
111
|
+
|
|
112
|
+
- Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
|
|
113
|
+
- Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
|
|
114
|
+
|
|
115
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
116
|
+
*/
|
|
117
|
+
|
|
118
|
+
//! moment.js
|
|
119
|
+
|
|
120
|
+
//! moment.js locale configuration
|
|
121
|
+
|
|
122
|
+
//!\ DECLARE ALIAS AFTER assign prototype !
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunkaldehyde=self.webpackChunkaldehyde||[]).push([[768],{67154:function(e){function t(){return e.exports=t=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var l=arguments[t];for(var a in l)Object.prototype.hasOwnProperty.call(l,a)&&(e[a]=l[a])}return e},e.exports.__esModule=!0,e.exports.default=e.exports,t.apply(this,arguments)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},95318:function(e){e.exports=function(e){return e&&e.__esModule?e:{default:e}},e.exports.__esModule=!0,e.exports.default=e.exports},80037:function(e,t,l){"use strict";var a=l(95318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=a(l(5584)).default;t.default=r},5584:function(e,t,l){"use strict";var a=l(95318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=a(l(67154)),n=a(l(85369)),o=a(l(15704)),c={lang:(0,r.default)({placeholder:"请选择日期",yearPlaceholder:"请选择年份",quarterPlaceholder:"请选择季度",monthPlaceholder:"请选择月份",weekPlaceholder:"请选择周",rangePlaceholder:["开始日期","结束日期"],rangeYearPlaceholder:["开始年份","结束年份"],rangeMonthPlaceholder:["开始月份","结束月份"],rangeQuarterPlaceholder:["开始季度","结束季度"],rangeWeekPlaceholder:["开始周","结束周"]},n.default),timePickerLocale:(0,r.default)({},o.default)};c.lang.ok="确定";var i=c;t.default=i},82925:function(e,t,l){"use strict";var a=l(95318);t.Z=void 0;var r=a(l(74219)),n=a(l(5584)),o=a(l(15704)),c=a(l(80037)),i="${label}不是一个有效的${type}",u={locale:"zh-cn",Pagination:r.default,DatePicker:n.default,TimePicker:o.default,Calendar:c.default,global:{placeholder:"请选择"},Table:{filterTitle:"筛选",filterConfirm:"确定",filterReset:"重置",filterEmptyText:"无筛选项",filterCheckall:"全选",filterSearchPlaceholder:"在筛选项中搜索",selectAll:"全选当页",selectInvert:"反选当页",selectNone:"清空所有",selectionAll:"全选所有",sortTitle:"排序",expand:"展开行",collapse:"关闭行",triggerDesc:"点击降序",triggerAsc:"点击升序",cancelSort:"取消排序"},Modal:{okText:"确定",cancelText:"取消",justOkText:"知道了"},Popconfirm:{cancelText:"取消",okText:"确定"},Transfer:{searchPlaceholder:"请输入搜索内容",itemUnit:"项",itemsUnit:"项",remove:"删除",selectCurrent:"全选当页",removeCurrent:"删除当页",selectAll:"全选所有",removeAll:"删除全部",selectInvert:"反选当页"},Upload:{uploading:"文件上传中",removeFile:"删除文件",uploadError:"上传错误",previewFile:"预览文件",downloadFile:"下载文件"},Empty:{description:"暂无数据"},Icon:{icon:"图标"},Text:{edit:"编辑",copy:"复制",copied:"复制成功",expand:"展开"},PageHeader:{back:"返回"},Form:{optional:"(可选)",defaultValidateMessages:{default:"字段验证错误${label}",required:"请输入${label}",enum:"${label}必须是其中一个[${enum}]",whitespace:"${label}不能为空字符",date:{format:"${label}日期格式无效",parse:"${label}不能转换为日期",invalid:"${label}是一个无效日期"},types:{string:i,method:i,array:i,object:i,number:i,date:i,boolean:i,integer:i,float:i,regexp:i,email:i,url:i,hex:i},string:{len:"${label}须为${len}个字符",min:"${label}最少${min}个字符",max:"${label}最多${max}个字符",range:"${label}须在${min}-${max}字符之间"},number:{len:"${label}必须等于${len}",min:"${label}最小值为${min}",max:"${label}最大值为${max}",range:"${label}须在${min}-${max}之间"},array:{len:"须为${len}个${label}",min:"最少${min}个${label}",max:"最多${max}个${label}",range:"${label}数量须在${min}-${max}之间"},pattern:{mismatch:"${label}与模式不匹配${pattern}"}}},Image:{preview:"预览"}};t.Z=u},15704:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;t.default={placeholder:"请选择时间",rangePlaceholder:["开始时间","结束时间"]}},48187:function(e,t,l){"use strict";l.r(t);var a=l(90237),r=l(65337),n=l(39576),o=l(61378),c=l(69905),i=l(67294),u=l(91256),d=l(82925),s=l(30381),f=l.n(s);l(83839),f().locale("zh-cn");var p=function(e){(0,n.Z)(f,e);var t,l,s=(t=f,l=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,a=(0,c.Z)(t);if(l){var r=(0,c.Z)(this).constructor;e=Reflect.construct(a,arguments,r)}else e=a.apply(this,arguments);return(0,o.Z)(this,e)});function f(){return(0,a.Z)(this,f),s.apply(this,arguments)}return(0,r.Z)(f,[{key:"render",value:function(){return i.createElement(u.ZP,{locale:d.Z},this.props.children)}}]),f}(i.Component);t.default=p},74219:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default={items_per_page:"条/页",jump_to:"跳至",jump_to_confirm:"确定",page:"页",prev_page:"上一页",next_page:"下一页",prev_5:"向前 5 页",next_5:"向后 5 页",prev_3:"向前 3 页",next_3:"向后 3 页",page_size:"页码"}},85369:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;t.default={locale:"zh_CN",today:"今天",now:"此刻",backToToday:"返回今天",ok:"确定",timeSelect:"选择时间",dateSelect:"选择日期",weekSelect:"选择周",clear:"清除",month:"月",year:"年",previousMonth:"上个月 (翻页上键)",nextMonth:"下个月 (翻页下键)",monthSelect:"选择月份",yearSelect:"选择年份",decadeSelect:"选择年代",yearFormat:"YYYY年",dayFormat:"D日",dateFormat:"YYYY年M月D日",dateTimeFormat:"YYYY年M月D日 HH时mm分ss秒",previousYear:"上一年 (Control键加左方向键)",nextYear:"下一年 (Control键加右方向键)",previousDecade:"上一年代",nextDecade:"下一年代",previousCentury:"上一世纪",nextCentury:"下一世纪"}}}]);
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! For license information please see bundle.30500c2afe2c2c45acf6.js.LICENSE.txt */
|
|
2
|
+
(self.webpackChunkaldehyde=self.webpackChunkaldehyde||[]).push([[958],{13237:function(t,e,n){"use strict";n.r(e),n.d(e,{default:function(){return M}});var i=n(84322),o=n.n(i),r=n(59755),a=n(90237),s=n(65337),c=n(95225),h=n(39576),l=n(61378),u=n(69905),d=n(15274),f=n(67294),p=n(62462),v=n(71577),m=n(50146),_=n(75443),y=n(71230),g=n(15746),x=n(58877),w=n.n(x),b=n(1413),P={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M957.6 507.4L603.2 158.2a7.9 7.9 0 00-11.2 0L353.3 393.4a8.03 8.03 0 00-.1 11.3l.1.1 40 39.4-117.2 115.3a8.03 8.03 0 00-.1 11.3l.1.1 39.5 38.9-189.1 187H72.1c-4.4 0-8.1 3.6-8.1 8V860c0 4.4 3.6 8 8 8h344.9c2.1 0 4.1-.8 5.6-2.3l76.1-75.6 40.4 39.8a7.9 7.9 0 0011.2 0l117.1-115.6 40.1 39.5a7.9 7.9 0 0011.2 0l238.7-235.2c3.4-3 3.4-8 .3-11.2zM389.8 796.2H229.6l134.4-133 80.1 78.9-54.3 54.1zm154.8-62.1L373.2 565.2l68.6-67.6 171.4 168.9-68.6 67.6zM713.1 658L450.3 399.1 597.6 254l262.8 259-147.3 145z"}}]},name:"highlight",theme:"outlined"},C=n(41390),E=function(t,e){return f.createElement(C.Z,(0,b.Z)((0,b.Z)({},t),{},{ref:e,icon:P}))};E.displayName="HighlightOutlined";var k=f.forwardRef(E),D=n(82561);var M=function(t){(0,h.Z)(x,t);var e,n,i=(e=x,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,i=(0,u.Z)(e);if(n){var o=(0,u.Z)(this).constructor;t=Reflect.construct(i,arguments,o)}else t=i.apply(this,arguments);return(0,l.Z)(this,t)});function x(){var t;(0,a.Z)(this,x);for(var e=arguments.length,n=new Array(e),s=0;s<e;s++)n[s]=arguments[s];return t=i.call.apply(i,[this].concat(n)),(0,d.Z)((0,c.Z)(t),"state",{modalVisible:!1,molFileLoaded:!1,molFile:void 0,trimmedDataURL:void 0}),(0,d.Z)((0,c.Z)(t),"signCanvas",void 0),(0,d.Z)((0,c.Z)(t),"loadData",(0,r.Z)(o().mark((function e(){var n,i,r;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(n=t.props.value)){e.next=13;break}if(1!=(i=JSON.parse(n)).valid){e.next=10;break}if(!/^image\/png;base64/.test(i.base.type)){e.next=8;break}return e.next=7,D.Z.loadFileTxt(i.base.path);case 7:r=e.sent;case 8:e.next=11;break;case 10:r="new"==i.valid?i.body:void 0;case 11:console.log("file:",r),t.setState({trimmedDataURL:r});case 13:case"end":return e.stop()}}),e)})))),(0,d.Z)((0,c.Z)(t),"saveMolfile",(0,r.Z)(o().mark((function e(){var n;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=t.signCanvas.getTrimmedCanvas().toDataURL("image/png"),console.log("DataURL value:",n),t.triggerChange(n),t.setState({modalVisible:!1,trimmedDataURL:n});case 4:case"end":return e.stop()}}),e)})))),(0,d.Z)((0,c.Z)(t),"triggerChange",(function(e){var n=t.props.onChange;n&&n(JSON.stringify({valid:"new",body:e,suffix:"image/png;base64",fileName:"signature.png"}))})),(0,d.Z)((0,c.Z)(t),"showView",(0,r.Z)(o().mark((function e(){return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t.signCanvas.clear(),t.signCanvas.fromDataURL(t.state.trimmedDataURL),t.setState({modalVisible:!0});case 3:case"end":return e.stop()}}),e)})))),(0,d.Z)((0,c.Z)(t),"onCancel",(function(){t.setState({modalVisible:!1})})),(0,d.Z)((0,c.Z)(t),"onClear",(function(){t.signCanvas.clear()})),t}return(0,s.Z)(x,[{key:"componentDidMount",value:function(){this.loadData()}},{key:"render",value:function(){var t=this,e=this.props,n=e.id,i=e.disabled,o=e.viewOrEdit,r=(e.value,this.state),a=(r.molFile,r.trimmedDataURL);return f.createElement("span",{id:n},a?f.createElement(p.Z,{width:90,src:a,preview:{src:a}}):"","edit"==o?f.createElement(v.Z,{onClick:this.showView},f.createElement(k,null),"编 辑"):"",f.createElement(m.Z,{closable:!1,visible:this.state.modalVisible,forceRender:!0,centered:!0,style:{maxWidth:"calc(100vw - 62px)",maxHeight:"calc(100vw - 50px)"},width:900,onCancel:function(){t.onCancel()},footer:i?[f.createElement(v.Z,{key:1,onClick:function(){t.onCancel()}},"取消")]:[f.createElement(v.Z,{key:1,onClick:function(){t.onClear()}},"清除"),f.createElement(_.Z,{key:2,placement:"top",title:"确定要取消本次编辑的数据吗?",onConfirm:this.onCancel,okText:"确定",cancelText:"取消"},f.createElement(v.Z,null,"取消")),f.createElement(v.Z,{key:3,onClick:function(){t.saveMolfile()},type:"primary"},"确定")],bodyStyle:{width:"900px"}},f.createElement(y.Z,{style:{height:"430px",border:"1px solid #00f",maxWidth:"860px",maxHeight:"calc(100vw - 80px)"}},f.createElement(g.Z,{key:1,span:24,style:{height:"400px"}},f.createElement(w(),{ref:function(e){t.signCanvas=e},penColor:"#000",canvasProps:{width:860,height:400,className:"sigCanvas"}})))))}}]),x}(f.PureComponent);(0,d.Z)(M,"defaultProps",{viewOrEdit:"view"})},58877:function(t,e,n){var i,o,r,a;t.exports=(i=n(45697),o=n(67294),r=n(21518),a=n(41400),function(t){function e(i){if(n[i])return n[i].exports;var o=n[i]={exports:{},id:i,loaded:!1};return t[i].call(o.exports,o,o.exports,e),o.loaded=!0,o.exports}var n={};return e.m=t,e.c=n,e.p="",e(0)}([function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{default:t}}function o(t,e){var n={};for(var i in t)e.indexOf(i)>=0||Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i]);return n}function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function a(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}Object.defineProperty(e,"__esModule",{value:!0});var s=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},c=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),h=i(n(1)),l=n(2),u=i(l),d=i(n(3)),f=i(n(4)),p=function(t){function e(){var t,n,i;r(this,e);for(var s=arguments.length,c=Array(s),h=0;h<s;h++)c[h]=arguments[h];return n=i=a(this,(t=e.__proto__||Object.getPrototypeOf(e)).call.apply(t,[this].concat(c))),i._sigPad=null,i._excludeOurProps=function(){var t=i.props;return t.canvasProps,t.clearOnResize,o(t,["canvasProps","clearOnResize"])},i.getCanvas=function(){return i._canvas},i.getTrimmedCanvas=function(){var t=document.createElement("canvas");return t.width=i._canvas.width,t.height=i._canvas.height,t.getContext("2d").drawImage(i._canvas,0,0),(0,f.default)(t)},i.getSignaturePad=function(){return i._sigPad},i._checkClearOnResize=function(){i.props.clearOnResize&&i._resizeCanvas()},i._resizeCanvas=function(){var t=i.props.canvasProps||{},e=t.width,n=t.height;if(!e||!n){var o=i._canvas,r=Math.max(window.devicePixelRatio||1,1);e||(o.width=o.offsetWidth*r),n||(o.height=o.offsetHeight*r),o.getContext("2d").scale(r,r),i.clear()}},i.on=function(){return window.addEventListener("resize",i._checkClearOnResize),i._sigPad.on()},i.off=function(){return window.removeEventListener("resize",i._checkClearOnResize),i._sigPad.off()},i.clear=function(){return i._sigPad.clear()},i.isEmpty=function(){return i._sigPad.isEmpty()},i.fromDataURL=function(t,e){return i._sigPad.fromDataURL(t,e)},i.toDataURL=function(t,e){return i._sigPad.toDataURL(t,e)},i.fromData=function(t){return i._sigPad.fromData(t)},i.toData=function(){return i._sigPad.toData()},a(i,n)}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),c(e,[{key:"componentDidMount",value:function(){this._sigPad=new d.default(this._canvas,this._excludeOurProps()),this._resizeCanvas(),this.on()}},{key:"componentWillUnmount",value:function(){this.off()}},{key:"componentDidUpdate",value:function(){Object.assign(this._sigPad,this._excludeOurProps())}},{key:"render",value:function(){var t=this,e=this.props.canvasProps;return u.default.createElement("canvas",s({ref:function(e){t._canvas=e}},e))}}]),e}(l.Component);p.propTypes={velocityFilterWeight:h.default.number,minWidth:h.default.number,maxWidth:h.default.number,minDistance:h.default.number,dotSize:h.default.oneOfType([h.default.number,h.default.func]),penColor:h.default.string,throttle:h.default.number,onEnd:h.default.func,onBegin:h.default.func,canvasProps:h.default.object,clearOnResize:h.default.bool},p.defaultProps={clearOnResize:!0},e.default=p},function(t,e){t.exports=i},function(t,e){t.exports=o},function(t,e){t.exports=r},function(t,e){t.exports=a}]))},41400:function(t){t.exports=function(t){function e(i){if(n[i])return n[i].exports;var o=n[i]={exports:{},id:i,loaded:!1};return t[i].call(o.exports,o,o.exports,e),o.loaded=!0,o.exports}var n={};return e.m=t,e.c=n,e.p="",e(0)}([function(t,e){"use strict";function n(t,e,n,i){return function(t,e,n,i){return{red:i[4*(n*e+t)],green:i[4*(n*e+t)+1],blue:i[4*(n*e+t)+2],alpha:i[4*(n*e+t)+3]}}(t,e,n,i).alpha}function i(t,e,i,o){for(var r=t?1:-1,a=t?0:i-1;t?a<i:a>-1;a+=r)for(var s=0;s<e;s++)if(n(s,a,e,o))return a;return null}function o(t,e,i,o){for(var r=t?1:-1,a=t?0:e-1;t?a<e:a>-1;a+=r)for(var s=0;s<i;s++)if(n(a,s,e,o))return a;return null}Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){var e=t.getContext("2d"),n=t.width,r=t.height,a=e.getImageData(0,0,n,r).data,s=i(!0,n,r,a),c=i(!1,n,r,a),h=o(!0,n,r,a),l=o(!1,n,r,a)-h+1,u=c-s+1,d=e.getImageData(h,s,l,u);return t.width=l,t.height=u,e.clearRect(0,0,l,u),e.putImageData(d,0,0),t}}])},21518:function(t,e,n){"use strict";function i(t,e,n){this.x=t,this.y=e,this.time=n||(new Date).getTime()}function o(t,e,n,i){this.startPoint=t,this.control1=e,this.control2=n,this.endPoint=i}function r(t,e){var n=this,i=e||{};this.velocityFilterWeight=i.velocityFilterWeight||.7,this.minWidth=i.minWidth||.5,this.maxWidth=i.maxWidth||2.5,this.throttle="throttle"in i?i.throttle:16,this.minDistance="minDistance"in i?i.minDistance:5,this.throttle?this._strokeMoveUpdate=function(t,e,n){var i,o,r,a=null,s=0;n||(n={});var c=function(){s=!1===n.leading?0:Date.now(),a=null,r=t.apply(i,o),a||(i=o=null)};return function(){var h=Date.now();s||!1!==n.leading||(s=h);var l=e-(h-s);return i=this,o=arguments,l<=0||l>e?(a&&(clearTimeout(a),a=null),s=h,r=t.apply(i,o),a||(i=o=null)):a||!1===n.trailing||(a=setTimeout(c,l)),r}}(r.prototype._strokeUpdate,this.throttle):this._strokeMoveUpdate=r.prototype._strokeUpdate,this.dotSize=i.dotSize||function(){return(this.minWidth+this.maxWidth)/2},this.penColor=i.penColor||"black",this.backgroundColor=i.backgroundColor||"rgba(0,0,0,0)",this.onBegin=i.onBegin,this.onEnd=i.onEnd,this._canvas=t,this._ctx=t.getContext("2d"),this.clear(),this._handleMouseDown=function(t){1===t.which&&(n._mouseButtonDown=!0,n._strokeBegin(t))},this._handleMouseMove=function(t){n._mouseButtonDown&&n._strokeMoveUpdate(t)},this._handleMouseUp=function(t){1===t.which&&n._mouseButtonDown&&(n._mouseButtonDown=!1,n._strokeEnd(t))},this._handleTouchStart=function(t){if(1===t.targetTouches.length){var e=t.changedTouches[0];n._strokeBegin(e)}},this._handleTouchMove=function(t){t.preventDefault();var e=t.targetTouches[0];n._strokeMoveUpdate(e)},this._handleTouchEnd=function(t){t.target===n._canvas&&(t.preventDefault(),n._strokeEnd(t))},this.on()}n.r(e),i.prototype.velocityFrom=function(t){return this.time!==t.time?this.distanceTo(t)/(this.time-t.time):1},i.prototype.distanceTo=function(t){return Math.sqrt(Math.pow(this.x-t.x,2)+Math.pow(this.y-t.y,2))},i.prototype.equals=function(t){return this.x===t.x&&this.y===t.y&&this.time===t.time},o.prototype.length=function(){for(var t=0,e=void 0,n=void 0,i=0;i<=10;i+=1){var o=i/10,r=this._point(o,this.startPoint.x,this.control1.x,this.control2.x,this.endPoint.x),a=this._point(o,this.startPoint.y,this.control1.y,this.control2.y,this.endPoint.y);if(i>0){var s=r-e,c=a-n;t+=Math.sqrt(s*s+c*c)}e=r,n=a}return t},o.prototype._point=function(t,e,n,i,o){return e*(1-t)*(1-t)*(1-t)+3*n*(1-t)*(1-t)*t+3*i*(1-t)*t*t+o*t*t*t},r.prototype.clear=function(){var t=this._ctx,e=this._canvas;t.fillStyle=this.backgroundColor,t.clearRect(0,0,e.width,e.height),t.fillRect(0,0,e.width,e.height),this._data=[],this._reset(),this._isEmpty=!0},r.prototype.fromDataURL=function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=new Image,o=n.ratio||window.devicePixelRatio||1,r=n.width||this._canvas.width/o,a=n.height||this._canvas.height/o;this._reset(),i.src=t,i.onload=function(){e._ctx.drawImage(i,0,0,r,a)},this._isEmpty=!1},r.prototype.toDataURL=function(t){var e;if("image/svg+xml"===t)return this._toSVG();for(var n=arguments.length,i=Array(n>1?n-1:0),o=1;o<n;o++)i[o-1]=arguments[o];return(e=this._canvas).toDataURL.apply(e,[t].concat(i))},r.prototype.on=function(){this._handleMouseEvents(),this._handleTouchEvents()},r.prototype.off=function(){this._canvas.removeEventListener("mousedown",this._handleMouseDown),this._canvas.removeEventListener("mousemove",this._handleMouseMove),document.removeEventListener("mouseup",this._handleMouseUp),this._canvas.removeEventListener("touchstart",this._handleTouchStart),this._canvas.removeEventListener("touchmove",this._handleTouchMove),this._canvas.removeEventListener("touchend",this._handleTouchEnd)},r.prototype.isEmpty=function(){return this._isEmpty},r.prototype._strokeBegin=function(t){this._data.push([]),this._reset(),this._strokeUpdate(t),"function"==typeof this.onBegin&&this.onBegin(t)},r.prototype._strokeUpdate=function(t){var e=t.clientX,n=t.clientY,i=this._createPoint(e,n),o=this._data[this._data.length-1],r=o&&o[o.length-1],a=r&&i.distanceTo(r)<this.minDistance;if(!r||!a){var s=this._addPoint(i),c=s.curve,h=s.widths;c&&h&&this._drawCurve(c,h.start,h.end),this._data[this._data.length-1].push({x:i.x,y:i.y,time:i.time,color:this.penColor})}},r.prototype._strokeEnd=function(t){var e=this.points.length>2,n=this.points[0];if(!e&&n&&this._drawDot(n),n){var i=this._data[this._data.length-1],o=i[i.length-1];n.equals(o)||i.push({x:n.x,y:n.y,time:n.time,color:this.penColor})}"function"==typeof this.onEnd&&this.onEnd(t)},r.prototype._handleMouseEvents=function(){this._mouseButtonDown=!1,this._canvas.addEventListener("mousedown",this._handleMouseDown),this._canvas.addEventListener("mousemove",this._handleMouseMove),document.addEventListener("mouseup",this._handleMouseUp)},r.prototype._handleTouchEvents=function(){this._canvas.style.msTouchAction="none",this._canvas.style.touchAction="none",this._canvas.addEventListener("touchstart",this._handleTouchStart),this._canvas.addEventListener("touchmove",this._handleTouchMove),this._canvas.addEventListener("touchend",this._handleTouchEnd)},r.prototype._reset=function(){this.points=[],this._lastVelocity=0,this._lastWidth=(this.minWidth+this.maxWidth)/2,this._ctx.fillStyle=this.penColor},r.prototype._createPoint=function(t,e,n){var o=this._canvas.getBoundingClientRect();return new i(t-o.left,e-o.top,n||(new Date).getTime())},r.prototype._addPoint=function(t){var e=this.points;if(e.push(t),e.length>2){3===e.length&&e.unshift(e[0]);var n=this._calculateCurveControlPoints(e[0],e[1],e[2]).c2,i=this._calculateCurveControlPoints(e[1],e[2],e[3]).c1,r=new o(e[1],n,i,e[2]),a=this._calculateCurveWidths(r);return e.shift(),{curve:r,widths:a}}return{}},r.prototype._calculateCurveControlPoints=function(t,e,n){var o=t.x-e.x,r=t.y-e.y,a=e.x-n.x,s=e.y-n.y,c=(t.x+e.x)/2,h=(t.y+e.y)/2,l=(e.x+n.x)/2,u=(e.y+n.y)/2,d=Math.sqrt(o*o+r*r),f=Math.sqrt(a*a+s*s),p=f/(d+f),v=l+(c-l)*p,m=u+(h-u)*p,_=e.x-v,y=e.y-m;return{c1:new i(c+_,h+y),c2:new i(l+_,u+y)}},r.prototype._calculateCurveWidths=function(t){var e=t.startPoint,n=t.endPoint,i={start:null,end:null},o=this.velocityFilterWeight*n.velocityFrom(e)+(1-this.velocityFilterWeight)*this._lastVelocity,r=this._strokeWidth(o);return i.start=this._lastWidth,i.end=r,this._lastVelocity=o,this._lastWidth=r,i},r.prototype._strokeWidth=function(t){return Math.max(this.maxWidth/(t+1),this.minWidth)},r.prototype._drawPoint=function(t,e,n){var i=this._ctx;i.moveTo(t,e),i.arc(t,e,n,0,2*Math.PI,!1),this._isEmpty=!1},r.prototype._drawCurve=function(t,e,n){var i=this._ctx,o=n-e,r=Math.floor(t.length());i.beginPath();for(var a=0;a<r;a+=1){var s=a/r,c=s*s,h=c*s,l=1-s,u=l*l,d=u*l,f=d*t.startPoint.x;f+=3*u*s*t.control1.x,f+=3*l*c*t.control2.x,f+=h*t.endPoint.x;var p=d*t.startPoint.y;p+=3*u*s*t.control1.y,p+=3*l*c*t.control2.y,p+=h*t.endPoint.y;var v=e+h*o;this._drawPoint(f,p,v)}i.closePath(),i.fill()},r.prototype._drawDot=function(t){var e=this._ctx,n="function"==typeof this.dotSize?this.dotSize():this.dotSize;e.beginPath(),this._drawPoint(t.x,t.y,n),e.closePath(),e.fill()},r.prototype._fromData=function(t,e,n){for(var o=0;o<t.length;o+=1){var r=t[o];if(r.length>1)for(var a=0;a<r.length;a+=1){var s=r[a],c=new i(s.x,s.y,s.time),h=s.color;if(0===a)this.penColor=h,this._reset(),this._addPoint(c);else if(a!==r.length-1){var l=this._addPoint(c),u=l.curve,d=l.widths;u&&d&&e(u,d,h)}}else this._reset(),n(r[0])}},r.prototype._toSVG=function(){var t=this,e=this._data,n=this._canvas,i=Math.max(window.devicePixelRatio||1,1),o=n.width/i,r=n.height/i,a=document.createElementNS("http://www.w3.org/2000/svg","svg");a.setAttributeNS(null,"width",n.width),a.setAttributeNS(null,"height",n.height),this._fromData(e,(function(t,e,n){var i=document.createElement("path");if(!(isNaN(t.control1.x)||isNaN(t.control1.y)||isNaN(t.control2.x)||isNaN(t.control2.y))){var o="M "+t.startPoint.x.toFixed(3)+","+t.startPoint.y.toFixed(3)+" C "+t.control1.x.toFixed(3)+","+t.control1.y.toFixed(3)+" "+t.control2.x.toFixed(3)+","+t.control2.y.toFixed(3)+" "+t.endPoint.x.toFixed(3)+","+t.endPoint.y.toFixed(3);i.setAttribute("d",o),i.setAttribute("stroke-width",(2.25*e.end).toFixed(3)),i.setAttribute("stroke",n),i.setAttribute("fill","none"),i.setAttribute("stroke-linecap","round"),a.appendChild(i)}}),(function(e){var n=document.createElement("circle"),i="function"==typeof t.dotSize?t.dotSize():t.dotSize;n.setAttribute("r",i),n.setAttribute("cx",e.x),n.setAttribute("cy",e.y),n.setAttribute("fill",e.color),a.appendChild(n)}));var s='<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 '+o+" "+r+'" width="'+o+'" height="'+r+'">',c=a.innerHTML;if(void 0===c){var h=document.createElement("dummy"),l=a.childNodes;h.innerHTML="";for(var u=0;u<l.length;u+=1)h.appendChild(l[u].cloneNode(!0));c=h.innerHTML}return"data:image/svg+xml;base64,"+btoa(s+c+"</svg>")},r.prototype.fromData=function(t){var e=this;this.clear(),this._fromData(t,(function(t,n){return e._drawCurve(t,n.start,n.end)}),(function(t){return e._drawDot(t)})),this._data=t},r.prototype.toData=function(){return this._data},e.default=r}}]);
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Signature Pad v2.3.2
|
|
3
|
+
* https://github.com/szimek/signature_pad
|
|
4
|
+
*
|
|
5
|
+
* Copyright 2017 Szymon Nowak
|
|
6
|
+
* Released under the MIT license
|
|
7
|
+
*
|
|
8
|
+
* The main idea and some parts of the code (e.g. drawing variable width Bézier curve) are taken from:
|
|
9
|
+
* http://corner.squareup.com/2012/07/smoother-signatures.html
|
|
10
|
+
*
|
|
11
|
+
* Implementation of interpolation using cubic Bézier curves is taken from:
|
|
12
|
+
* http://benknowscode.wordpress.com/2012/09/14/path-interpolation-using-cubic-bezier-and-control-point-estimation-in-javascript
|
|
13
|
+
*
|
|
14
|
+
* Algorithm for approximated length of a Bézier curve is taken from:
|
|
15
|
+
* http://www.lemoda.net/maths/bezier-length/index.html
|
|
16
|
+
*
|
|
17
|
+
*/
|