tplus-components-touch 3.36.3 → 3.36.6
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/components/autoCompleteWithKeyboard/index.js +31 -9
- package/dist/components/autoCompleteWithKeyboard/index.js.map +1 -1
- package/dist/components/autoCompleteWithKeyboard/index.less +11 -0
- package/dist/components/billSearch/index.js +13 -0
- package/dist/components/billSearch/index.js.map +1 -1
- package/dist/components/billSearch/index.less +8 -0
- package/dist/components/commonForm/autoComplete/index.js +35 -16
- package/dist/components/commonForm/autoComplete/index.js.map +1 -1
- package/dist/components/hotKey/localConfig.js +14 -16
- package/dist/components/hotKey/localConfig.js.map +1 -1
- package/dist/components/input/index.js +4 -1
- package/dist/components/input/index.js.map +1 -1
- package/dist/components/input/scanInput.less +4 -1
- package/dist/components/keyboard/index.js +5 -1
- package/dist/components/keyboard/index.js.map +1 -1
- package/dist/components/keyboard/index.less +39 -23
- package/dist/components/keyboard/letterKeyboard.js +33 -16
- package/dist/components/keyboard/letterKeyboard.js.map +1 -1
- package/dist/components/keyboard/numKeyboard.js +23 -13
- package/dist/components/keyboard/numKeyboard.js.map +1 -1
- package/dist/components/keyboard/numKeyboardScan.js +37 -24
- package/dist/components/keyboard/numKeyboardScan.js.map +1 -1
- package/dist/components/keyboard/numkeyboardPassword.js +31 -14
- package/dist/components/keyboard/numkeyboardPassword.js.map +1 -1
- package/dist/components/keyboard/onlyLetterButton2.less +1 -1
- package/dist/components/layout/sider.js +3 -1
- package/dist/components/layout/sider.js.map +1 -1
- package/dist/components/settlement/prototypeTable/index.js +6 -2
- package/dist/components/settlement/prototypeTable/index.js.map +1 -1
- package/dist/components/settlement/settlement.js +79 -546
- package/dist/components/settlement/settlement.js.map +1 -1
- package/dist/components/settlement/settlement.less +5 -1
- package/dist/components/settlement/settlementStore.js +89 -72
- package/dist/components/settlement/settlementStore.js.map +1 -1
- package/dist/components/touchTable/index.js +11 -1
- package/dist/components/touchTable/index.js.map +1 -1
- package/dist/components/touchTable/index.less +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["tplus-components-touch/components/input/index.js"],"names":["Option","map","defaultClass","Input","props","context","state","onFocus","e","setState","inputFocus","onBlur","changeScanProduct","scanObj","startScan","onScanResult","val","handleChange","handleOk","platform","isHorizontalPad","isMobileEnvironment","className","State","Label","Title","IsScan","Value","SingleShow","Style","InputStyle","tplusInput","ControlType","type","type1","precisionLength","maxLength","inputClassName","autocomplete","isShowScan","scan","value","Component","propTypes","PropTypes","string","bool","object","defaultProps"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mBAAA;;;;;;;;;;AAQA;;;;AACA;;;;AAEA;;AACA;;;;AACA;;;;AACA;;;;AACA;;;;AACA;;;;IAEOA,M,oBAAAA,M;;;AAEP,IAAMC,MAAM;AACR,aAAS,aADD;AAER,WAAO;AAFC,CAAZ;AAIA,IAAMC,eAAe,kBAArB;;IAEqBC,K;;;AACjB,mBAAYC,KAAZ,EAAmBC,OAAnB,EAA4B;AAAA;;AAAA,wIAClBD,KADkB,EACXC,OADW;;AAAA,cAgC5BC,KAhC4B,GAgCpB,EAhCoB;;AAAA,cAkC5BC,OAlC4B,GAkClB,UAACC,CAAD,EAAO;AAAA,gBACRD,OADQ,GACG,MAAKH,KADR,CACRG,OADQ;;AAEfA,oBAAQC,CAAR;AACA,kBAAKC,QAAL,CAAc,EAACC,YAAY,IAAb,EAAd;AACD,SAtC2B;;AAAA,cAwC5BC,MAxC4B,GAwCnB,UAACH,CAAD,EAAO;AAAA,gBACPG,MADO,GACG,MAAKP,KADR,CACPO,MADO;;AAEdA,mBAAOH,CAAP;AACA,kBAAKC,QAAL,CAAc,EAACC,YAAY,KAAb,EAAd;AACD,SA5C2B;;AAAA,cA+C5BE,iBA/C4B,GA+CR,YAAM;AACtB,gBAAI,MAAKC,OAAT,EAAkB,MAAKA,OAAL,CAAaC,SAAb;AACrB,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E,CADJ;AAEI,8BAAMwB,KAFV;AAGI,sCAAcP,KAHlB;AAII,iCAAS,KAAKpB,OAJlB;AAKI,gCAAQ,KAAKI,MALjB;AAMI,yCAAiBwB,eANrB;AAOI,mCAAWC;AAPf,uBAQQhC,KARR;AAxBhB;AALJ,aADJ;AA6CH;;;EAzH8BsC,gB,UAOxBC,S,GAAU;AACbrB,eAAUsB,oBAAUC,MADP,EACc;AAC3BtB,WAAMqB,oBAAUC,MAFH,EAEU;AACvBrB,WAAMoB,oBAAUC,MAHH,EAGU;AACvBpB,WAAMmB,oBAAUC,MAJH,EAIU;AACvBlB,WAAMiB,oBAAUC,MALH,EAKU;AACvBjB,gBAAWgB,oBAAUE,IANR,EAMa;AAC1BjB,WAAMe,oBAAUG,MAPH,EAOU;AACvBjB,gBAAWc,oBAAUG,MARR,EAQe;AAC5Bf,iBAAYY,oBAAUC,MATT,EASgB;AAC7BX,WAAMU,oBAAUC,MAVH,CAUS;AAVT,C,SAaVG,Y,GAAa;AAChB1B,eAAU,EADM;AAEhBC,WAAM,EAFU;AAGhBC,WAAM,EAHU;AAIhBC,WAAM,EAJU;AAKhBE,WAAM,EALU;AAMhBC,gBAAW,KANK;AAOhBC,WAAM,EAPU;AAQhBC,gBAAW,EARK;AAShBvB,aAAS,mBAAM,CAAE,CATD;AAUhBI,YAAQ,kBAAM,CAAE;AAVA,C;kBApBHR,K;;;AA4HrBA,MAAMH,MAAN,GAAeA,MAAf,C,CAAuB","file":"index.js","sourcesContent":["/*\r\n field{\r\n Title:'' title\r\n State:'' input状态\r\n SingleShow:boolean input如何显示 (带框还是只是展示)\r\n }\r\n*/\r\n\r\nimport React, { Component } from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport { Select } from 'antd';\r\nimport { platform } from 'mutants-util';\r\nimport TplusInput from './tplusInput';\r\nimport Ticon from '../ticon';\r\nimport Scan from '../scan';\r\nimport NumKeyboard from '../keyboard/numKeyboard';\r\nimport './style.less';\r\n\r\nconst {Option} = Select;\r\n\r\nconst map = {\r\n 'error': 'inputerror ',\r\n 'tip': 'inputtip ',\r\n}\r\nconst defaultClass = 'input-wrapper-2 '\r\n\r\nexport default class Input extends Component {\r\n constructor(props, context) {\r\n super(props, context)\r\n const { isHorizontalPad } = platform || {};\r\n this.isMobileEnvironment = !!isHorizontalPad;\r\n }\r\n\r\n static propTypes={\r\n className:PropTypes.string,//外层元素类名\r\n State:PropTypes.string,//input 状态 (错误error /提示tip)\r\n Label:PropTypes.string,//提示信息:label\r\n Title:PropTypes.string,//左侧title\r\n Value:PropTypes.string,//值\r\n SingleShow:PropTypes.bool,//input 或者 展示文字\r\n Style:PropTypes.object,//展示文字的 style\r\n InputStyle:PropTypes.object,//input的style\r\n ControlType:PropTypes.string,//空间类型:字符型\r\n type1:PropTypes.string//:数字取值范围 (正负)\r\n }\r\n\r\n static defaultProps={\r\n className:'',\r\n State:'',\r\n Label:'',\r\n Title:'',\r\n Value:'',\r\n SingleShow:false,\r\n Style:{},\r\n InputStyle:{},\r\n onFocus: () => {},\r\n onBlur: () => {},\r\n }\r\n\r\n state = {};\r\n\r\n onFocus = (e) => {\r\n const {onFocus} = this.props;\r\n onFocus(e);\r\n this.setState({inputFocus: true});\r\n }\r\n\r\n onBlur = (e) => {\r\n const {onBlur} = this.props;\r\n onBlur(e);\r\n this.setState({inputFocus: false});\r\n }\r\n\r\n //移动端:扫描商品\r\n changeScanProduct = () => {\r\n if (this.scanObj) this.scanObj.startScan()\r\n }\r\n onScanResult = (val) => {\r\n const { handleChange, handleOk } = this.props;\r\n handleChange && handleChange(val);\r\n handleOk && handleOk();\r\n }\r\n\r\n render(){\r\n let { className, State, Label, Title,IsScan, Value, SingleShow, Style, InputStyle, tplusInput, onFocus, onBlur, ControlType, type, type1, precisionLength, maxLength, inputClassName = '', ...props } = this.props;\r\n const { inputFocus } = this.state;\r\n //解决浏览器自动填充密码的问题\r\n if ('password' === type) {\r\n props.autocomplete = \"new-password\";\r\n props.type = 'password';\r\n }\r\n if (tplusInput) {\r\n return <TplusInput\r\n className={className}\r\n onFocus={onFocus}\r\n onBlur={onBlur}\r\n type={type}\r\n {...props}\r\n />\r\n }\r\n className = defaultClass + (map[State] || '') + className;\r\n let isShowScan = (this.isMobileEnvironment && IsScan == true) ? true : false;\r\n return (\r\n <div className={className}>\r\n {/*{*/}\r\n {/* !!Title.length &&*/}\r\n {/* <label>{Title}:</label>*/}\r\n {/*}*/}\r\n <div>\r\n {\r\n SingleShow ? <span className='value value-singleshow' style={Style} {...props}>{Value}</span> :\r\n ControlType !== 'NumTextBox' ?\r\n <div className={isShowScan ? 'curInput pad' : 'curInput'}>\r\n <input\r\n className={`value ${inputClassName} ${inputFocus ? 'b-theme' : 'inputBlurColor'}`}\r\n style={InputStyle}\r\n value={Value}\r\n maxLength={maxLength ? maxLength : \"\"}\r\n onFocus={this.onFocus}\r\n onBlur={this.onBlur}\r\n {...props}\r\n />\r\n {\r\n isShowScan &&\r\n <div className='curScan'>\r\n <Ticon type='saomiao1' className='icon' onClick={this.changeScanProduct} />\r\n <Scan ref={scan => this.scanObj = scan} onChange={value => this.onScanResult(value)} />\r\n </div>\r\n }\r\n </div>\r\n\r\n :\r\n <NumKeyboard\r\n inputClassName={`value ${inputClassName} ${inputFocus ? 'b-theme' : ''}`}\r\n type={type1}\r\n defaultValue={Value}\r\n onFocus={this.onFocus}\r\n onBlur={this.onBlur}\r\n precisionLength={precisionLength}\r\n maxLength={maxLength}\r\n {...props}\r\n />\r\n }\r\n </div>\r\n </div>\r\n\r\n )\r\n }\r\n}\r\n\r\nInput.Option = Option; //Select.Option\r\n"]}
|
|
1
|
+
{"version":3,"sources":["tplus-components-touch/components/input/index.js"],"names":["Option","map","defaultClass","Input","props","context","state","onFocus","e","setState","inputFocus","onBlur","changeScanProduct","scanObj","startScan","onScanResult","val","handleChange","handleOk","platform","isHorizontalPad","isMobileEnvironment","className","State","Label","Title","IsScan","Value","SingleShow","Style","InputStyle","tplusInput","ControlType","type","type1","precisionLength","maxLength","inputClassName","placement","autocomplete","isShowScan","scan","value","Component","propTypes","PropTypes","string","bool","object","defaultProps"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mBAAA;;;;;;;;;;AAQA;;;;AACA;;;;AAEA;;AACA;;;;AACA;;;;AACA;;;;AACA;;;;AACA;;;;IAEOA,M,oBAAAA,M;;;AAEP,IAAMC,MAAM;AACR,aAAS,aADD;AAER,WAAO;AAFC,CAAZ;AAIA,IAAMC,eAAe,kBAArB;;IAEqBC,K;;;AACjB,mBAAYC,KAAZ,EAAmBC,OAAnB,EAA4B;AAAA;;AAAA,wIAClBD,KADkB,EACXC,OADW;;AAAA,cAgC5BC,KAhC4B,GAgCpB,EAhCoB;;AAAA,cAkC5BC,OAlC4B,GAkClB,UAACC,CAAD,EAAO;AAAA,gBACRD,OADQ,GACG,MAAKH,KADR,CACRG,OADQ;;AAEfA,oBAAQC,CAAR;AACA,kBAAKC,QAAL,CAAc,EAACC,YAAY,IAAb,EAAd;AACD,SAtC2B;;AAAA,cAwC5BC,MAxC4B,GAwCnB,UAACH,CAAD,EAAO;AAAA,gBACPG,MADO,GACG,MAAKP,KADR,CACPO,MADO;;AAEdA,mBAAOH,CAAP;AACA,kBAAKC,QAAL,CAAc,EAACC,YAAY,KAAb,EAAd;AACD,SA5C2B;;AAAA,cA+C5BE,iBA/C4B,GA+CR,YAAM;AACtB,gBAAI,MAAKC,OAAT,EAAkB,MAAKA,OAAL,CAAaC,SAAb;AACrB,SAjD2B;;AAAA,cAkD5BC,YAlD4B,GAkDb,UAACC,GAAD,EAAS;AAAA,8BACe,MAAKZ,KADpB;AAAA,gBACZa,YADY,eACZA,YADY;AAAA,gBACEC,QADF,eACEA,QADF;;AAEpBD,4BAAgBA,aAAaD,GAAb,CAAhB;AACAE,wBAAYA,UAAZ;AACH,SAtD2B;;AAAA,mBAEIC,yBAAY,EAFhB;AAAA,YAEhBC,eAFgB,QAEhBA,eAFgB;;AAGxB,cAAKC,mBAAL,GAA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B,oBAAUC,MADP,EACc;AAC3BvB,WAAMsB,oBAAUC,MAFH,EAEU;AACvBtB,WAAMqB,oBAAUC,MAHH,EAGU;AACvBrB,WAAMoB,oBAAUC,MAJH,EAIU;AACvBnB,WAAMkB,oBAAUC,MALH,EAKU;AACvBlB,gBAAWiB,oBAAUE,IANR,EAMa;AAC1BlB,WAAMgB,oBAAUG,MAPH,EAOU;AACvBlB,gBAAWe,oBAAUG,MARR,EAQe;AAC5BhB,iBAAYa,oBAAUC,MATT,EASgB;AAC7BZ,WAAMW,oBAAUC,MAVH,CAUS;AAVT,C,SAaVG,Y,GAAa;AAChB3B,eAAU,EADM;AAEhBC,WAAM,EAFU;AAGhBC,WAAM,EAHU;AAIhBC,WAAM,EAJU;AAKhBE,WAAM,EALU;AAMhBC,gBAAW,KANK;AAOhBC,WAAM,EAPU;AAQhBC,gBAAW,EARK;AAShBvB,aAAS,mBAAM,CAAE,CATD;AAUhBI,YAAQ,kBAAM,CAAE;AAVA,C;kBApBHR,K;;;AA6HrBA,MAAMH,MAAN,GAAeA,MAAf,C,CAAuB","file":"index.js","sourcesContent":["/*\r\n field{\r\n Title:'' title\r\n State:'' input状态\r\n SingleShow:boolean input如何显示 (带框还是只是展示)\r\n }\r\n*/\r\n\r\nimport React, { Component } from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport { Select } from 'antd';\r\nimport { platform } from 'mutants-util';\r\nimport TplusInput from './tplusInput';\r\nimport Ticon from '../ticon';\r\nimport Scan from '../scan';\r\nimport NumKeyboard from '../keyboard/numKeyboard';\r\nimport './style.less';\r\n\r\nconst {Option} = Select;\r\n\r\nconst map = {\r\n 'error': 'inputerror ',\r\n 'tip': 'inputtip ',\r\n}\r\nconst defaultClass = 'input-wrapper-2 '\r\n\r\nexport default class Input extends Component {\r\n constructor(props, context) {\r\n super(props, context)\r\n const { isHorizontalPad } = platform || {};\r\n this.isMobileEnvironment = !!isHorizontalPad;\r\n }\r\n\r\n static propTypes={\r\n className:PropTypes.string,//外层元素类名\r\n State:PropTypes.string,//input 状态 (错误error /提示tip)\r\n Label:PropTypes.string,//提示信息:label\r\n Title:PropTypes.string,//左侧title\r\n Value:PropTypes.string,//值\r\n SingleShow:PropTypes.bool,//input 或者 展示文字\r\n Style:PropTypes.object,//展示文字的 style\r\n InputStyle:PropTypes.object,//input的style\r\n ControlType:PropTypes.string,//空间类型:字符型\r\n type1:PropTypes.string//:数字取值范围 (正负)\r\n }\r\n\r\n static defaultProps={\r\n className:'',\r\n State:'',\r\n Label:'',\r\n Title:'',\r\n Value:'',\r\n SingleShow:false,\r\n Style:{},\r\n InputStyle:{},\r\n onFocus: () => {},\r\n onBlur: () => {},\r\n }\r\n\r\n state = {};\r\n\r\n onFocus = (e) => {\r\n const {onFocus} = this.props;\r\n onFocus(e);\r\n this.setState({inputFocus: true});\r\n }\r\n\r\n onBlur = (e) => {\r\n const {onBlur} = this.props;\r\n onBlur(e);\r\n this.setState({inputFocus: false});\r\n }\r\n\r\n //移动端:扫描商品\r\n changeScanProduct = () => {\r\n if (this.scanObj) this.scanObj.startScan()\r\n }\r\n onScanResult = (val) => {\r\n const { handleChange, handleOk } = this.props;\r\n handleChange && handleChange(val);\r\n handleOk && handleOk();\r\n }\r\n\r\n render(){\r\n let { className, State, Label, Title,IsScan, Value, SingleShow, Style, InputStyle, tplusInput, onFocus, onBlur, ControlType, type, type1, precisionLength, maxLength, inputClassName = '', placement = 'bottomRight', ...props } = this.props;\r\n const { inputFocus } = this.state;\r\n //解决浏览器自动填充密码的问题\r\n if ('password' === type) {\r\n props.autocomplete = \"new-password\";\r\n props.type = 'password';\r\n }\r\n if (tplusInput) {\r\n return <TplusInput\r\n className={className}\r\n onFocus={onFocus}\r\n onBlur={onBlur}\r\n type={type}\r\n {...props}\r\n />\r\n }\r\n className = defaultClass + (map[State] || '') + className;\r\n let isShowScan = (this.isMobileEnvironment && IsScan == true) ? true : false;\r\n return (\r\n <div className={className}>\r\n {/*{*/}\r\n {/* !!Title.length &&*/}\r\n {/* <label>{Title}:</label>*/}\r\n {/*}*/}\r\n <div>\r\n {\r\n SingleShow ? <span className='value value-singleshow' style={Style} {...props}>{Value}</span> :\r\n ControlType !== 'NumTextBox' ?\r\n <div className={isShowScan ? 'curInput pad' : 'curInput'}>\r\n <input\r\n className={`value ${inputClassName} ${inputFocus ? 'b-theme' : 'inputBlurColor'}`}\r\n style={InputStyle}\r\n value={Value}\r\n maxLength={maxLength ? maxLength : \"\"}\r\n onFocus={this.onFocus}\r\n onBlur={this.onBlur}\r\n {...props}\r\n />\r\n {\r\n isShowScan &&\r\n <div className='curScan'>\r\n <Ticon type='saomiao1' className='icon' onClick={this.changeScanProduct} />\r\n <Scan ref={scan => this.scanObj = scan} onChange={value => this.onScanResult(value)} />\r\n </div>\r\n }\r\n </div>\r\n\r\n :\r\n <NumKeyboard\r\n inputClassName={`value ${inputClassName} ${inputFocus ? 'b-theme' : ''}`}\r\n placement={placement}\r\n type={type1}\r\n defaultValue={Value}\r\n onFocus={this.onFocus}\r\n onBlur={this.onBlur}\r\n precisionLength={precisionLength}\r\n maxLength={maxLength}\r\n {...props}\r\n />\r\n }\r\n </div>\r\n </div>\r\n\r\n )\r\n }\r\n}\r\n\r\nInput.Option = Option; //Select.Option\r\n"]}
|
|
@@ -197,9 +197,13 @@ var Keyboard = (_temp2 = _class = function (_Component) {
|
|
|
197
197
|
var onChange = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : function () {};
|
|
198
198
|
var handleOk = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : Keyboard.close;
|
|
199
199
|
var handleCancel = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : Keyboard.close;
|
|
200
|
+
var option = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
|
|
200
201
|
|
|
201
202
|
//在移动端的情况下,不允许打开自定义键盘。
|
|
202
203
|
var isMobileEnvironment = _mutantsUtil.platform && _mutantsUtil.platform.isHorizontalPad === true || window.android_setKeyBoard && window.android_setKeyBoard.isShowAndroidKeyBoard;
|
|
204
|
+
var _option$bottom = option.bottom,
|
|
205
|
+
bottom = _option$bottom === undefined ? 0 : _option$bottom;
|
|
206
|
+
|
|
203
207
|
return function () {
|
|
204
208
|
var el = document.getElementById('keyboard');
|
|
205
209
|
if (!el) {
|
|
@@ -211,7 +215,7 @@ var Keyboard = (_temp2 = _class = function (_Component) {
|
|
|
211
215
|
|
|
212
216
|
var html = !isMobileEnvironment ? _react2.default.createElement(
|
|
213
217
|
'div',
|
|
214
|
-
{ className: 'modal-container z-letter-keyboard-modal' },
|
|
218
|
+
{ className: 'modal-container z-letter-keyboard-modal', style: { bottom: bottom } },
|
|
215
219
|
_react2.default.createElement(
|
|
216
220
|
'div',
|
|
217
221
|
{ className: 'z-letter-keyboard-modal-body modal-body' },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["tplus-components-touch/components/keyboard/index.js"],"names":["Keyboard","getModule","components","OnlyNumberButton","OnlyNumberButton2","KeyboardInput","OnlyKeyboard","LetterKeyboard","props","type","Module","Component","getNewValue","input","value_old","key","isNumber","cursorIndex","getCursortPosition","indexOf","value_new","value1","value2","selectedTxt","window","getSelection","selectedTxtLength","length","slice","setTimeout","setCaretPosition","ctrl","value","CaretPos","document","selection","focus","Sel","createRange","moveStart","text","selectionStart","index","setSelectionRange","createTextRange","range","collapse","moveEnd","select","close","getElementById","body","removeChild","open","onChange","handleOk","handleCancel","isMobileEnvironment","platform","isHorizontalPad","android_setKeyBoard","isShowAndroidKeyBoard","el","ref","m","createElement","id","appendChild","html","ReactDOM","render","close2","unmountComponentAtNode","classList","add","remove","open2","letterOrNumber"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA;;AAIA;;AAIqD;;AAErD;;AAdA;;;;AACA;;;;AACA;;AAIA;;;;AAIA;;;;AACA;;;;AACA;;;;AAIA;;;;AACA;;;;AAEA;;;;AAEA;;;;IAEqBA,Q;;;;;;;;;;;;;;gNAEnBC,S,GAAY,YAAM;A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T,CAAgBF,IAAhB,EAAsBN,GAAtB;AACD;AACF,GAjBD;AAkBD,C,SAGMS,M,GAAS,YAAM;AACpB,MAAIT,KAAK5B,SAASgB,cAAT,CAAwB,kBAAxB,CAAT;AACA,MAAIY,EAAJ,EAAQ;AACNO,uBAASG,sBAAT,CAAgCV,EAAhC;AACA;AACAA,OAAGW,SAAH,CAAaC,GAAb,CAAiB,uBAAjB;AACAZ,OAAGW,SAAH,CAAaE,MAAb,CAAoB,uBAApB;AACD;AACF,C,SAIMC,K,GAAQ,YAA8G;AAAA,MAA7GtB,QAA6G,uEAAlG,YAAM,CAAG,CAAyF;AAAA,MAAvFC,QAAuF,uEAA5EvD,SAASuE,MAAmE;AAAA,MAA3Df,YAA2D,uEAA5CxD,SAASuE,MAAmC;AAAA,MAA3BL,EAA2B;AAAA,MAAvBW,cAAuB,uEAAN,CAAM;;AAC3H;AACA,MAAIpB,sBAAsBC,yBAAaA,sBAASC,eAAT,KAA6B,IAApE;AACA,MAAIG,KAAK5B,SAASgB,cAAT,CAAwB,kBAAxB,CAAT;AACA,MAAIY,EAAJ,EAAQ;AAAA,QAKGC,GALH,GAKN,SAASA,GAAT,CAAaC,CAAb,EAAgB,CAAG,CALb;;AACNK,uBAASG,sBAAT,CAAgCV,EAAhC;AACA;AACAA,OAAGW,SAAH,CAAaC,GAAb,CAAiB,uBAAjB;AACAZ,OAAGW,SAAH,CAAaE,MAAb,CAAoB,uBAApB;;AAEA,QAAIP,OAAO,CAACX,mBAAD,GAAuB,8BAAC,0BAAD,IAAmB,IAAIS,EAAvB,EAA2B,gBAAgBW,cAA3C,EAA2D,UAAUvB,QAArE,EAA+E,UAAUC,QAAzF,EAAmG,cAAcC,YAAjH,GAAvB,GAA2J,IAAtK;AACAa,uBAASC,MAAT,CAAgBF,IAAhB,EAAsBN,EAAtB;AACD;AACF,C;kBA5IkB9D,Q","file":"index.js","sourcesContent":["import React, { Component } from 'react';\r\nimport ReactDOM from 'react-dom';\r\nimport { platform } from 'mutants-util';\r\n\r\n// import NumKeyboard from './numKeyboard';\r\n\r\nimport LetterKeyboard from './letterKeyboard';\r\n\r\n// import TextKeyboard from './textKeyboard';\r\n\r\nimport OnlyKeyboard from './onlyKeyboard';\r\nimport OnlyLetterButton from './onlyLetterButton';\r\nimport OnlyLetterButton2 from './onlyLetterButton2'; // product 中的键盘\r\n\r\n// import OnlyTextKeyboard from './onlyTextKeyboard';\r\n\r\nimport OnlyNumberButton from './onlyNumberButton';\r\nimport OnlyNumberButton2 from './onlyNumberButton2';\r\n\r\nimport KeyboardInput from './numberButton_input';\r\n\r\nimport './index.less';\r\n\r\nexport default class Keyboard extends Component {\r\n\r\n getModule = () => {\r\n let components = {\r\n 'number': OnlyNumberButton,\r\n 'number2': OnlyNumberButton2,\r\n 'number+input': KeyboardInput,\r\n // 'number+modal': OnlyTextKeyboard,\r\n // 'number+modal+input': NumKeyboard,\r\n // 'number+modal+div': TextKeyboard,\r\n // 'OnlyLetterButton2': OnlyLetterButton2,\r\n 'letter+modal': OnlyKeyboard,\r\n 'letter+modal+input': LetterKeyboard\r\n }\r\n return components[this.props.type] || null;\r\n\r\n }\r\n static getNewValue = (input, value_old, key, isNumber) => { // 数字键盘的处理,需要传第四个参数\r\n value_old = value_old + '';\r\n let cursorIndex = Keyboard.getCursortPosition(input, value_old);\r\n\r\n if (isNumber && key == '-' && (cursorIndex != 0 || value_old.indexOf('-') != -1)) { // 数字键盘,对负号做处理\r\n return value_old;\r\n }\r\n if (isNumber && key == '.' && (cursorIndex == 0 || value_old.indexOf('.') != -1)) { // 数字键盘,对小数点做处理\r\n return value_old;\r\n }\r\n\r\n let value_new, value1, value2;\r\n\r\n let selectedTxt = `${window.getSelection()}`;\r\n\r\n // 如果此input被选中了 替换到这些\r\n if (selectedTxt) {\r\n let selectedTxtLength = selectedTxt.length;\r\n value1 = value_old.slice(0, cursorIndex);\r\n value2 = value_old.slice(cursorIndex + selectedTxtLength, value_old.length);\r\n } else {\r\n value1 = value_old.slice(0, cursorIndex);\r\n value2 = value_old.slice(cursorIndex, value_old.length);\r\n }\r\n\r\n\r\n if (key == 'delete') {\r\n value_new = value1.slice(0, value1.length - 1) + value2;\r\n cursorIndex = cursorIndex == 0 ? 0 : cursorIndex - 1;\r\n } else if (key == 'clear') {\r\n value_new = '';\r\n } else {\r\n value_new = value1 + key + value2;\r\n cursorIndex += key.length;\r\n }\r\n setTimeout(() => {\r\n Keyboard.setCaretPosition(input, cursorIndex); // 此处手动设置光标,不然每次自动跑到最后面去\r\n })\r\n return value_new;\r\n }\r\n\r\n static getCursortPosition = (ctrl, value) => {//获取光标位置函数\r\n var CaretPos = value.length;\t// IE Support\r\n if (document.selection) {\r\n ctrl.focus();\r\n var Sel = document.selection.createRange();\r\n Sel.moveStart('character', -ctrl.value.length);\r\n CaretPos = Sel.text.length;\r\n }\r\n // Firefox support\r\n else if (ctrl.selectionStart || ctrl.selectionStart == '0')\r\n CaretPos = ctrl.selectionStart;\r\n return (CaretPos);\r\n }\r\n static setCaretPosition = (ctrl, index) => {//设置光标位置函数\r\n if (ctrl.setSelectionRange) {\r\n ctrl.focus();\r\n ctrl.setSelectionRange(index, index);\r\n }\r\n else if (ctrl.createTextRange) {\r\n var range = ctrl.createTextRange();\r\n range.collapse(true);\r\n range.moveEnd('character', index);\r\n range.moveStart('character', index);\r\n range.select();\r\n }\r\n }\r\n\r\n static close = () => {\r\n if (document.getElementById('keyboard')) {\r\n document.body.removeChild(document.getElementById('keyboard'));\r\n }\r\n }\r\n\r\n static open = (onChange = () => { }, handleOk = Keyboard.close, handleCancel = Keyboard.close) => {\r\n //在移动端的情况下,不允许打开自定义键盘。\r\n let isMobileEnvironment = platform && (platform.isHorizontalPad === true) || (window.android_setKeyBoard && window.android_setKeyBoard.isShowAndroidKeyBoard);\r\n return () => {\r\n let el = document.getElementById('keyboard');\r\n if (!el) {\r\n let el = document.createElement('div');\r\n el.id = 'keyboard';\r\n document.body.appendChild(el);\r\n function ref(m) { }\r\n let html = !isMobileEnvironment ?\r\n <div className='modal-container z-letter-keyboard-modal'>\r\n <div className='z-letter-keyboard-modal-body modal-body'>\r\n <OnlyLetterButton onChange={onChange} handleOk={handleOk} ref={ref} handleCancel={handleCancel} />\r\n </div>\r\n </div>\r\n :\r\n null;\r\n ReactDOM.render(html, el)\r\n }\r\n }\r\n }\r\n\r\n // 专门为pos开单页 写的关闭键盘的方法 \r\n static close2 = () => {\r\n let el = document.getElementById('product-keyboard');\r\n if (el) {\r\n ReactDOM.unmountComponentAtNode(el)\r\n // el.innerHTML = '';\r\n el.classList.add(\"product-keyboard-hide\");\r\n el.classList.remove(\"product-keyboard-show\");\r\n }\r\n }\r\n\r\n // 专门为pos开单页 写的调用键盘的方法\r\n // /letterOrNumber 1letter 2number\r\n static open2 = (onChange = () => { }, handleOk = Keyboard.close2, handleCancel = Keyboard.close2, id, letterOrNumber = 1) => {\r\n //在移动端的情况下,不允许打开自定义键盘。\r\n let isMobileEnvironment = platform && (platform.isHorizontalPad === true);\r\n let el = document.getElementById('product-keyboard');\r\n if (el) {\r\n ReactDOM.unmountComponentAtNode(el)\r\n // el.innerHTML = '';\r\n el.classList.add(\"product-keyboard-show\");\r\n el.classList.remove(\"product-keyboard-hide\");\r\n function ref(m) { }\r\n let html = !isMobileEnvironment ? <OnlyLetterButton2 id={id} letterOrNumber={letterOrNumber} onChange={onChange} handleOk={handleOk} handleCancel={handleCancel} /> : null\r\n ReactDOM.render(html, el)\r\n }\r\n }\r\n\r\n render() {\r\n let Module = this.getModule();\r\n return (\r\n <Module {...this.props} />\r\n )\r\n }\r\n}"]}
|
|
1
|
+
{"version":3,"sources":["tplus-components-touch/components/keyboard/index.js"],"names":["Keyboard","getModule","components","OnlyNumberButton","OnlyNumberButton2","KeyboardInput","OnlyKeyboard","LetterKeyboard","props","type","Module","Component","getNewValue","input","value_old","key","isNumber","cursorIndex","getCursortPosition","indexOf","value_new","value1","value2","selectedTxt","window","getSelection","selectedTxtLength","length","slice","setTimeout","setCaretPosition","ctrl","value","CaretPos","document","selection","focus","Sel","createRange","moveStart","text","selectionStart","index","setSelectionRange","createTextRange","range","collapse","moveEnd","select","close","getElementById","body","removeChild","open","onChange","handleOk","handleCancel","option","isMobileEnvironment","platform","isHorizontalPad","android_setKeyBoard","isShowAndroidKeyBoard","bottom","el","ref","m","createElement","id","appendChild","html","ReactDOM","render","close2","unmountComponentAtNode","classList","add","remove","open2","letterOrNumber"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA;;AAIA;;AAIqD;;AAErD;;AAdA;;;;AACA;;;;AACA;;AAIA;;;;AAIA;;;;AACA;;;;AACA;;;;AAIA;;;;AACA;;;;AAEA;;;;AAEA;;;;IAEqBA,Q;;;;;;;;;;;;;;gNAEnBC,S,GAAY,YAAM;AAChB,UAAIC,aAAa;AACf,kBAAUC,0BADK;AAEf,mBAAWC,0BAFI;AAGf,wBAAgBC,4BAHD;AAIf;AACA;AACA;AACA;AACA,wBAAgBC,sBARD;AASf,8BAAsBC;AATP,OAAjB;AAWA,aAAOL,WAAW,MAAKM,KAAL,CAAWC,IAAtB,KAA+B,IAAtC;AAED,K;;;AAmGD;;;AAWA;AACA;;;;;6BAgBS;AACP,UAAIC,SAAS,KAAKT,SAAL,EAAb;AACA,aACE,8BAAC,MAAD,EAAY,KAAKO,KAAjB,CADF;AAGD;;;EApJmCG,gB,UAiB7BC,W,GAAc,UAACC,KAAD,EAAQC,SAAR,EAAmBC,GAAnB,EAAwBC,QAAxB,EAAqC;AAAE;AAC1DF,cAAYA,YAAY,EAAxB;AACA,MAAIG,cAAcjB,SAASkB,kBAAT,CAA4BL,KAA5B,EAAmCC,SAAnC,CAAlB;;AAEA,MAAIE,YAAYD,OAAO,GAAnB,KAA2BE,eAAe,CAAf,IAAoBH,UAAUK,OAAV,CAAkB,GAAlB,KAA0B,CAAC,CAA1E,CAAJ,EAAkF;AAAE;AAClF,WAAOL,SAAP;AACD;AACD,MAAIE,YAAYD,OAAO,GAAnB,KAA2BE,eAAe,CA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,MAAII,KAAK9B,SAASgB,cAAT,CAAwB,kBAAxB,CAAT;AACA,MAAIc,EAAJ,EAAQ;AAAA,QAKGC,GALH,GAKN,SAASA,GAAT,CAAaC,CAAb,EAAgB,CAAG,CALb;;AACNK,uBAASG,sBAAT,CAAgCV,EAAhC;AACA;AACAA,OAAGW,SAAH,CAAaC,GAAb,CAAiB,uBAAjB;AACAZ,OAAGW,SAAH,CAAaE,MAAb,CAAoB,uBAApB;;AAEA,QAAIP,OAAO,CAACZ,mBAAD,GAAuB,8BAAC,0BAAD,IAAmB,IAAIU,EAAvB,EAA2B,gBAAgBW,cAA3C,EAA2D,UAAUzB,QAArE,EAA+E,UAAUC,QAAzF,EAAmG,cAAcC,YAAjH,GAAvB,GAA2J,IAAtK;AACAe,uBAASC,MAAT,CAAgBF,IAAhB,EAAsBN,EAAtB;AACD;AACF,C;kBA7IkBhE,Q","file":"index.js","sourcesContent":["import React, { Component } from 'react';\r\nimport ReactDOM from 'react-dom';\r\nimport { platform } from 'mutants-util';\r\n\r\n// import NumKeyboard from './numKeyboard';\r\n\r\nimport LetterKeyboard from './letterKeyboard';\r\n\r\n// import TextKeyboard from './textKeyboard';\r\n\r\nimport OnlyKeyboard from './onlyKeyboard';\r\nimport OnlyLetterButton from './onlyLetterButton';\r\nimport OnlyLetterButton2 from './onlyLetterButton2'; // product 中的键盘\r\n\r\n// import OnlyTextKeyboard from './onlyTextKeyboard';\r\n\r\nimport OnlyNumberButton from './onlyNumberButton';\r\nimport OnlyNumberButton2 from './onlyNumberButton2';\r\n\r\nimport KeyboardInput from './numberButton_input';\r\n\r\nimport './index.less';\r\n\r\nexport default class Keyboard extends Component {\r\n\r\n getModule = () => {\r\n let components = {\r\n 'number': OnlyNumberButton,\r\n 'number2': OnlyNumberButton2,\r\n 'number+input': KeyboardInput,\r\n // 'number+modal': OnlyTextKeyboard,\r\n // 'number+modal+input': NumKeyboard,\r\n // 'number+modal+div': TextKeyboard,\r\n // 'OnlyLetterButton2': OnlyLetterButton2,\r\n 'letter+modal': OnlyKeyboard,\r\n 'letter+modal+input': LetterKeyboard\r\n }\r\n return components[this.props.type] || null;\r\n\r\n }\r\n static getNewValue = (input, value_old, key, isNumber) => { // 数字键盘的处理,需要传第四个参数\r\n value_old = value_old + '';\r\n let cursorIndex = Keyboard.getCursortPosition(input, value_old);\r\n\r\n if (isNumber && key == '-' && (cursorIndex != 0 || value_old.indexOf('-') != -1)) { // 数字键盘,对负号做处理\r\n return value_old;\r\n }\r\n if (isNumber && key == '.' && (cursorIndex == 0 || value_old.indexOf('.') != -1)) { // 数字键盘,对小数点做处理\r\n return value_old;\r\n }\r\n\r\n let value_new, value1, value2;\r\n\r\n let selectedTxt = `${window.getSelection()}`;\r\n\r\n // 如果此input被选中了 替换到这些\r\n if (selectedTxt) {\r\n let selectedTxtLength = selectedTxt.length;\r\n value1 = value_old.slice(0, cursorIndex);\r\n value2 = value_old.slice(cursorIndex + selectedTxtLength, value_old.length);\r\n } else {\r\n value1 = value_old.slice(0, cursorIndex);\r\n value2 = value_old.slice(cursorIndex, value_old.length);\r\n }\r\n\r\n\r\n if (key == 'delete') {\r\n value_new = value1.slice(0, value1.length - 1) + value2;\r\n cursorIndex = cursorIndex == 0 ? 0 : cursorIndex - 1;\r\n } else if (key == 'clear') {\r\n value_new = '';\r\n } else {\r\n value_new = value1 + key + value2;\r\n cursorIndex += key.length;\r\n }\r\n setTimeout(() => {\r\n Keyboard.setCaretPosition(input, cursorIndex); // 此处手动设置光标,不然每次自动跑到最后面去\r\n })\r\n return value_new;\r\n }\r\n\r\n static getCursortPosition = (ctrl, value) => {//获取光标位置函数\r\n var CaretPos = value.length;\t// IE Support\r\n if (document.selection) {\r\n ctrl.focus();\r\n var Sel = document.selection.createRange();\r\n Sel.moveStart('character', -ctrl.value.length);\r\n CaretPos = Sel.text.length;\r\n }\r\n // Firefox support\r\n else if (ctrl.selectionStart || ctrl.selectionStart == '0')\r\n CaretPos = ctrl.selectionStart;\r\n return (CaretPos);\r\n }\r\n static setCaretPosition = (ctrl, index) => {//设置光标位置函数\r\n if (ctrl.setSelectionRange) {\r\n ctrl.focus();\r\n ctrl.setSelectionRange(index, index);\r\n }\r\n else if (ctrl.createTextRange) {\r\n var range = ctrl.createTextRange();\r\n range.collapse(true);\r\n range.moveEnd('character', index);\r\n range.moveStart('character', index);\r\n range.select();\r\n }\r\n }\r\n\r\n static close = () => {\r\n if (document.getElementById('keyboard')) {\r\n document.body.removeChild(document.getElementById('keyboard'));\r\n }\r\n }\r\n\r\n static open = (onChange = () => { }, handleOk = Keyboard.close, handleCancel = Keyboard.close,option = {}) => {\r\n //在移动端的情况下,不允许打开自定义键盘。\r\n let isMobileEnvironment = platform && (platform.isHorizontalPad === true) || (window.android_setKeyBoard && window.android_setKeyBoard.isShowAndroidKeyBoard);\r\n const { bottom = 0 } = option\r\n return () => {\r\n let el = document.getElementById('keyboard');\r\n if (!el) {\r\n let el = document.createElement('div');\r\n el.id = 'keyboard';\r\n document.body.appendChild(el);\r\n function ref(m) { }\r\n let html = !isMobileEnvironment ?\r\n <div className='modal-container z-letter-keyboard-modal' style={{bottom}}>\r\n <div className='z-letter-keyboard-modal-body modal-body'>\r\n <OnlyLetterButton onChange={onChange} handleOk={handleOk} ref={ref} handleCancel={handleCancel} />\r\n </div>\r\n </div>\r\n :\r\n null;\r\n ReactDOM.render(html, el)\r\n }\r\n }\r\n }\r\n\r\n // 专门为pos开单页 写的关闭键盘的方法 \r\n static close2 = () => {\r\n let el = document.getElementById('product-keyboard');\r\n if (el) {\r\n ReactDOM.unmountComponentAtNode(el)\r\n // el.innerHTML = '';\r\n el.classList.add(\"product-keyboard-hide\");\r\n el.classList.remove(\"product-keyboard-show\");\r\n }\r\n }\r\n\r\n // 专门为pos开单页 写的调用键盘的方法\r\n // /letterOrNumber 1letter 2number\r\n static open2 = (onChange = () => { }, handleOk = Keyboard.close2, handleCancel = Keyboard.close2, id, letterOrNumber = 1) => {\r\n //在移动端的情况下,不允许打开自定义键盘。\r\n let isMobileEnvironment = platform && (platform.isHorizontalPad === true);\r\n let el = document.getElementById('product-keyboard');\r\n if (el) {\r\n ReactDOM.unmountComponentAtNode(el)\r\n // el.innerHTML = '';\r\n el.classList.add(\"product-keyboard-show\");\r\n el.classList.remove(\"product-keyboard-hide\");\r\n function ref(m) { }\r\n let html = !isMobileEnvironment ? <OnlyLetterButton2 id={id} letterOrNumber={letterOrNumber} onChange={onChange} handleOk={handleOk} handleCancel={handleCancel} /> : null\r\n ReactDOM.render(html, el)\r\n }\r\n }\r\n\r\n render() {\r\n let Module = this.getModule();\r\n return (\r\n <Module {...this.props} />\r\n )\r\n }\r\n}"]}
|
|
@@ -35,8 +35,8 @@
|
|
|
35
35
|
}
|
|
36
36
|
.num-keyboard-popover {
|
|
37
37
|
// numberKeyboard
|
|
38
|
-
width:
|
|
39
|
-
height:
|
|
38
|
+
width: 400px;
|
|
39
|
+
height: 270px;
|
|
40
40
|
background: none!important;
|
|
41
41
|
.ant-popover-arrow {
|
|
42
42
|
display: none!important;
|
|
@@ -51,24 +51,24 @@
|
|
|
51
51
|
border:none!important;
|
|
52
52
|
.ant-popover-inner-content {
|
|
53
53
|
height: 100%;
|
|
54
|
-
padding:
|
|
54
|
+
padding: 30px 15px 20px 24px !important;
|
|
55
55
|
|
|
56
56
|
.key {
|
|
57
57
|
box-sizing: border-box;
|
|
58
58
|
text-align: center;
|
|
59
59
|
line-height: 60px;
|
|
60
|
-
width:
|
|
61
|
-
height:
|
|
60
|
+
width: 70px;
|
|
61
|
+
height: 46px;
|
|
62
62
|
display: flex;
|
|
63
63
|
flex-direction: column;
|
|
64
64
|
justify-content: center;
|
|
65
65
|
border-radius: 6px;
|
|
66
|
-
font-size:
|
|
66
|
+
font-size: 24px;
|
|
67
67
|
cursor: pointer;
|
|
68
68
|
}
|
|
69
69
|
|
|
70
70
|
.nums {
|
|
71
|
-
width:
|
|
71
|
+
width: 270px;
|
|
72
72
|
float: left;
|
|
73
73
|
margin-left: 5px;
|
|
74
74
|
|
|
@@ -80,19 +80,19 @@
|
|
|
80
80
|
|
|
81
81
|
.dels {
|
|
82
82
|
float: left;
|
|
83
|
-
width:
|
|
83
|
+
width: 70px;
|
|
84
84
|
|
|
85
85
|
.del {
|
|
86
86
|
margin-bottom: 10px;
|
|
87
87
|
}
|
|
88
88
|
|
|
89
89
|
.sure {
|
|
90
|
-
height:
|
|
90
|
+
height: 102px;
|
|
91
91
|
line-height: 22px;
|
|
92
92
|
padding-top: 5px;
|
|
93
93
|
}
|
|
94
94
|
.clear{
|
|
95
|
-
height:
|
|
95
|
+
height: 102px;
|
|
96
96
|
line-height: 22px;
|
|
97
97
|
padding-top: 5px;
|
|
98
98
|
}
|
|
@@ -214,13 +214,13 @@
|
|
|
214
214
|
box-sizing: border-box;
|
|
215
215
|
text-align: center;
|
|
216
216
|
line-height: 60px;
|
|
217
|
-
width:
|
|
218
|
-
height:
|
|
217
|
+
width: 70px;
|
|
218
|
+
height: 46px;
|
|
219
219
|
display: flex;
|
|
220
220
|
flex-direction: column;
|
|
221
221
|
justify-content: center;
|
|
222
222
|
border-radius: 6px;
|
|
223
|
-
font-size:
|
|
223
|
+
font-size: 24px;
|
|
224
224
|
cursor: pointer;
|
|
225
225
|
|
|
226
226
|
&:active {
|
|
@@ -232,30 +232,30 @@
|
|
|
232
232
|
}
|
|
233
233
|
.number-point {
|
|
234
234
|
display: inline-block;
|
|
235
|
-
line-height:
|
|
235
|
+
line-height: 33px;
|
|
236
236
|
}
|
|
237
237
|
|
|
238
238
|
.nums {
|
|
239
|
-
width:
|
|
239
|
+
width: 241px;
|
|
240
240
|
float: left;
|
|
241
241
|
|
|
242
242
|
.num {
|
|
243
243
|
float: left;
|
|
244
|
-
margin: 0
|
|
244
|
+
margin: 0 10px 10px 0px;
|
|
245
245
|
}
|
|
246
246
|
}
|
|
247
247
|
|
|
248
248
|
.dels {
|
|
249
249
|
float: right;
|
|
250
|
-
width:
|
|
250
|
+
width: 70px;
|
|
251
251
|
|
|
252
252
|
.del {
|
|
253
|
-
margin-bottom:
|
|
254
|
-
font-size:
|
|
253
|
+
margin-bottom: 10px;
|
|
254
|
+
font-size: 22px;
|
|
255
255
|
}
|
|
256
256
|
|
|
257
257
|
.sure {
|
|
258
|
-
height:
|
|
258
|
+
height: 102px;
|
|
259
259
|
border-radius: 5px;
|
|
260
260
|
}
|
|
261
261
|
.positive {
|
|
@@ -264,8 +264,8 @@
|
|
|
264
264
|
}
|
|
265
265
|
.sure-no-positive {
|
|
266
266
|
line-height: 33px;
|
|
267
|
-
width:
|
|
268
|
-
height:
|
|
267
|
+
width: 70px;
|
|
268
|
+
height: 46px;
|
|
269
269
|
}
|
|
270
270
|
}
|
|
271
271
|
|
|
@@ -307,10 +307,16 @@
|
|
|
307
307
|
}
|
|
308
308
|
|
|
309
309
|
.number-keyboard-input {
|
|
310
|
-
width:
|
|
310
|
+
width: 332px;
|
|
311
311
|
margin: 0 auto;
|
|
312
312
|
.keyboard-input {
|
|
313
|
+
height: 40px;
|
|
314
|
+
font-size: 24px;
|
|
313
315
|
border: none!important;
|
|
316
|
+
border-radius: 4px;
|
|
317
|
+
}
|
|
318
|
+
input::-webkit-input-placeholder{
|
|
319
|
+
font-size: 22px;
|
|
314
320
|
}
|
|
315
321
|
}
|
|
316
322
|
|
|
@@ -467,4 +473,14 @@
|
|
|
467
473
|
top: -50px!important;
|
|
468
474
|
color: #CCC!important;
|
|
469
475
|
}
|
|
476
|
+
}
|
|
477
|
+
.keybord-icon-focus {
|
|
478
|
+
position: relative;
|
|
479
|
+
.keyboard-icon {
|
|
480
|
+
position: absolute;
|
|
481
|
+
right: 0;
|
|
482
|
+
top: 50% !important;
|
|
483
|
+
z-index: 999;
|
|
484
|
+
transform: translateY(-50%);
|
|
485
|
+
}
|
|
470
486
|
}
|
|
@@ -80,7 +80,6 @@ var LetterKeyboard = (_temp = _class = function (_Component) {
|
|
|
80
80
|
_this.setState({
|
|
81
81
|
visible: !_this.state.visible
|
|
82
82
|
});
|
|
83
|
-
_this.input.input.focus();
|
|
84
83
|
};
|
|
85
84
|
|
|
86
85
|
_this.handleOk = function (e) {
|
|
@@ -106,11 +105,18 @@ var LetterKeyboard = (_temp = _class = function (_Component) {
|
|
|
106
105
|
return _this.state.visible ? _react2.default.createElement(_index3.Ticon, { type: 'jianpan1', style: { color: '#999' } }) : _react2.default.createElement(_index3.Ticon, { type: 'jianpan2', style: { color: '#999' } });
|
|
107
106
|
};
|
|
108
107
|
|
|
109
|
-
_this.iconShowModal = function () {
|
|
108
|
+
_this.iconShowModal = function (e) {
|
|
109
|
+
e.preventDefault();
|
|
110
110
|
if (_this.props.disabled) {
|
|
111
111
|
return;
|
|
112
112
|
}
|
|
113
|
-
|
|
113
|
+
// this.showModal();
|
|
114
|
+
|
|
115
|
+
if (_this.isFocus) {
|
|
116
|
+
_this.input.input.blur();
|
|
117
|
+
} else {
|
|
118
|
+
_this.input.input.focus();
|
|
119
|
+
}
|
|
114
120
|
};
|
|
115
121
|
|
|
116
122
|
_this.getShowValue = function () {
|
|
@@ -118,6 +124,7 @@ var LetterKeyboard = (_temp = _class = function (_Component) {
|
|
|
118
124
|
};
|
|
119
125
|
|
|
120
126
|
_this.inputBlur = function () {
|
|
127
|
+
_this.isFocus = false;
|
|
121
128
|
_this.setState({
|
|
122
129
|
visible: false
|
|
123
130
|
});
|
|
@@ -125,10 +132,12 @@ var LetterKeyboard = (_temp = _class = function (_Component) {
|
|
|
125
132
|
|
|
126
133
|
_this.inputFocus = function () {
|
|
127
134
|
_this.props.onFocus && _this.props.onFocus(_this.input);
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
135
|
+
|
|
136
|
+
// if (this.props.which == 'icon') {
|
|
137
|
+
// return;
|
|
138
|
+
// }
|
|
131
139
|
_this.showModal();
|
|
140
|
+
_this.isFocus = true;
|
|
132
141
|
};
|
|
133
142
|
|
|
134
143
|
_this.inputKeyDown = function (e) {
|
|
@@ -172,7 +181,7 @@ var LetterKeyboard = (_temp = _class = function (_Component) {
|
|
|
172
181
|
{ className: 'keyboard' },
|
|
173
182
|
_react2.default.createElement(
|
|
174
183
|
_input2.default.Group,
|
|
175
|
-
{ className: 'keyboard-input' },
|
|
184
|
+
{ className: 'keyboard-input keybord-icon-focus' },
|
|
176
185
|
_react2.default.createElement(_input2.default, (0, _extends3.default)({ type: 'text'
|
|
177
186
|
}, props, {
|
|
178
187
|
prefix: prefix ? _react2.default.createElement(_index3.Ticon, { type: prefix, className: 'search-icon' }) : null,
|
|
@@ -184,15 +193,23 @@ var LetterKeyboard = (_temp = _class = function (_Component) {
|
|
|
184
193
|
ref: function ref(input) {
|
|
185
194
|
return _this2.input = input;
|
|
186
195
|
},
|
|
187
|
-
allowClear: this.isMobileEnvironment
|
|
188
|
-
suffix
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
+
allowClear: this.isMobileEnvironment
|
|
197
|
+
// suffix={which == 'icon' && !this.isMobileEnvironment ?
|
|
198
|
+
// <span className='keyboard-icon' onMouseDown={e => e.preventDefault()} onClick={this.iconShowModal}>
|
|
199
|
+
// {
|
|
200
|
+
// this.getKeyboardIcon()
|
|
201
|
+
// }
|
|
202
|
+
// </span>
|
|
203
|
+
// :
|
|
204
|
+
// null}
|
|
205
|
+
})),
|
|
206
|
+
which == 'icon' && !this.isMobileEnvironment ? _react2.default.createElement(
|
|
207
|
+
'span',
|
|
208
|
+
{ className: 'keyboard-icon', onMouseDown: function onMouseDown(e) {
|
|
209
|
+
return e.preventDefault();
|
|
210
|
+
}, onClick: this.iconShowModal },
|
|
211
|
+
this.getKeyboardIcon()
|
|
212
|
+
) : null
|
|
196
213
|
),
|
|
197
214
|
!this.isMobileEnvironment && _react2.default.createElement(_index2.default, { type: 'letter+modal', value: value, visible: this.state.visible, onChange: this.setStateValue, handleOk: this.handleOk, handleCancel: this.handleCancel })
|
|
198
215
|
);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["tplus-components-touch/components/keyboard/letterKeyboard.js"],"names":["LetterKeyboard","props","inputChange","e","setState","value","target","onChange","showModal","visible","state","
|
|
1
|
+
{"version":3,"sources":["tplus-components-touch/components/keyboard/letterKeyboard.js"],"names":["LetterKeyboard","props","inputChange","e","setState","value","target","onChange","showModal","visible","state","handleOk","getShowValue","handleCancel","setStateValue","key","newValue","Keyboard","getNewValue","input","getKeyboardIcon","color","iconShowModal","preventDefault","disabled","isFocus","blur","focus","undefined","inputBlur","inputFocus","onFocus","inputKeyDown","keyCode","handleEnter","platform","isHorizontalPad","isMobileEnvironment","onRef","prefix","which","Component","propTypes","PropTypes","func","isRequired","placeholder","string"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mBAAA;;;;;;AAIA;;;;AAEA;;AACA;;;;AACA;;AACA;;;;;;IAEqBA,c;;;AACnB,0BAAYC,KAAZ,EAAmB;AAAA;;AAAA,sJACXA,KADW;;AAAA,UAkBnBC,WAlBmB,GAkBL,UAACC,CAAD,EAAO;AACnB,YAAKC,QAAL,CAAc;AACZC,eAAOF,EAAEG,MAAF,CAASD;AADJ,OAAd;AAGA,YAAKJ,KAAL,CAAWM,QAAX,IAAuB,MAAKN,KAAL,CAAWM,QAAX,CAAoBJ,EAAEG,MAAF,CAASD,KAA7B,CAAvB;AACD,KAvBkB;;AAAA,UAyBnBG,SAzBmB,GAyBP,YAAM;AAChB,YAAKJ,QAAL,CAAc;AACZK,iBAAS,CAAC,MAAKC,KAAL,CAAWD;AADT,OAAd;AAGD,KA7BkB;;AAAA,UA+BnBE,QA/BmB,GA+BR,UAACR,CAAD,EAAO;AAChB,YAAKF,KAAL,CAAWU,QAAX,IAAuB,MAAKV,KAAL,CAAWU,QAAX,CAAoB,MAAKC,YAAL,EAApB,CAAvB;AACA,YAAKJ,SAAL;AACD,KAlCkB;;AAAA,UAoCnBK,YApCmB,GAoCJ,UAACV,CAAD,EAAO;AACpB,YAAKF,KAAL,CAAWY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AMA,MAAb,EAAqB,WAAU,aAA/B,GAAT,GAA2D,IAFtE;AAGG,sBAAU,KAAKrC,WAHlB;AAIG,qBAAS,KAAK4B,UAJjB;AAKG,oBAAQ,KAAKD,SALhB;AAMG,uBAAW,KAAKG,YANnB;AAOG,mBAAO,KAAK/B,KAAL,CAAWI,KAPrB;AAQG,iBAAK;AAAA,qBAAS,OAAKc,KAAL,GAAaA,KAAtB;AAAA,aARR;AASG,wBAAY,KAAKkB;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAjBF,aADJ;AAsBMG,mBAAS,MAAT,IAAmB,CAAC,KAAKH,mBAAzB,GACI;AAAA;AAAA,cAAM,WAAU,eAAhB,EAAgC,aAAa;AAAA,uBAAKlC,EAAEoB,cAAF,EAAL;AAAA,eAA7C,EAAsE,SAAS,KAAKD,aAApF;AAEI,iBAAKF,eAAL;AAFJ,WADJ,GAOI;AA7BV,SAFJ;AAqCI,SAAC,KAAKiB,mBAAN,IACA,8BAAC,eAAD,IAAU,MAAK,cAAf,EAA8B,OAAOhC,KAArC,EAA4C,SAAS,KAAKK,KAAL,CAAWD,OAAhE,EAAyE,UAAU,KAAKK,aAAxF,EAAuG,UAAU,KAAKH,QAAtH,EAAgI,cAAc,KAAKE,YAAnJ;AAtCJ,OADF;AA2CD;;;EAvJyC4B,gB,UAWnCC,S,GAAY;AACjBnC,YAAUoC,oBAAUC,IAAV,CAAeC,UADR;AAEjBlC,YAAUgC,oBAAUC,IAFH;AAGjB/B,gBAAc8B,oBAAUC,IAHP;AAIjBE,eAAaH,oBAAUI,MAJN;AAKjBP,SAAOG,oBAAUI,MALA,CAKO;AALP,C;kBAXA/C,c","file":"letterKeyboard.js","sourcesContent":["/**\r\n * input + letterKeyboard\r\n */\r\n\r\nimport React, { Component } from 'react';\r\nimport { Input } from 'antd';\r\nimport { platform } from 'mutants-util';\r\nimport Keyboard from './index';\r\nimport { Ticon } from '../../index';\r\nimport PropTypes from 'prop-types';\r\n\r\nexport default class LetterKeyboard extends Component {\r\n constructor(props) {\r\n super(props);\r\n this.state = {\r\n visible: false,\r\n value: props.value || ''\r\n }\r\n const { isHorizontalPad } = platform || {};\r\n this.isMobileEnvironment = !!isHorizontalPad;\r\n }\r\n\r\n static propTypes = {\r\n onChange: PropTypes.func.isRequired,\r\n handleOk: PropTypes.func,\r\n handleCancel: PropTypes.func,\r\n placeholder: PropTypes.string,\r\n which: PropTypes.string // 是否要 通过 icon 来触发键盘弹出\r\n }\r\n\r\n inputChange = (e) => {\r\n this.setState({\r\n value: e.target.value\r\n })\r\n this.props.onChange && this.props.onChange(e.target.value);\r\n }\r\n\r\n showModal = () => {\r\n this.setState({\r\n visible: !this.state.visible\r\n });\r\n }\r\n\r\n handleOk = (e) => {\r\n this.props.handleOk && this.props.handleOk(this.getShowValue());\r\n this.showModal();\r\n }\r\n\r\n handleCancel = (e) => {\r\n this.props.handleCancel && this.props.handleCancel(this.getShowValue());\r\n this.showModal()\r\n }\r\n\r\n setStateValue = (key) => {\r\n let newValue = Keyboard.getNewValue(this.input.input, this.getShowValue(), key);\r\n this.setState({\r\n value: newValue\r\n }, () => {\r\n this.props.onChange && this.props.onChange(newValue);\r\n })\r\n }\r\n\r\n getKeyboardIcon = () => {\r\n return (\r\n this.state.visible ?\r\n <Ticon type='jianpan1' style={{ color: '#999' }} />\r\n :\r\n <Ticon type='jianpan2' style={{ color: '#999' }} />\r\n )\r\n }\r\n\r\n iconShowModal = (e) => {\r\n e.preventDefault()\r\n if (this.props.disabled) {\r\n return;\r\n }\r\n // this.showModal();\r\n \r\n if (this.isFocus) {\r\n this.input.input.blur()\r\n } else {\r\n this.input.input.focus()\r\n } \r\n }\r\n\r\n getShowValue = () => {\r\n return this.props.value == undefined ? this.state.value : this.props.value;\r\n }\r\n\r\n inputBlur = () => {\r\n this.isFocus = false\r\n this.setState({\r\n visible: false\r\n })\r\n }\r\n\r\n inputFocus = () => {\r\n this.props.onFocus && this.props.onFocus(this.input)\r\n \r\n // if (this.props.which == 'icon') {\r\n // return;\r\n // }\r\n this.showModal();\r\n this.isFocus = true\r\n }\r\n\r\n inputKeyDown = (e) => {\r\n if (e.keyCode == 13) { // 按下回车按钮\r\n this.props.handleEnter && this.props.handleEnter(this.getShowValue());\r\n }\r\n }\r\n\r\n componentDidMount() {\r\n this.props.onRef && this.props.onRef(this);\r\n }\r\n\r\n render() {\r\n let { prefix, which, onRef, ...props } = { ...this.props };\r\n let value = this.getShowValue();\r\n return (\r\n <div className='keyboard'>\r\n {\r\n <Input.Group className='keyboard-input keybord-icon-focus'>\r\n <Input type=\"text\"\r\n {...props}\r\n prefix={prefix ? <Ticon type={prefix} className='search-icon' /> : null}\r\n onChange={this.inputChange}\r\n onFocus={this.inputFocus}\r\n onBlur={this.inputBlur}\r\n onKeyDown={this.inputKeyDown}\r\n value={this.props.value}\r\n ref={input => this.input = input}\r\n allowClear={this.isMobileEnvironment}\r\n // suffix={which == 'icon' && !this.isMobileEnvironment ?\r\n // <span className='keyboard-icon' onMouseDown={e => e.preventDefault()} onClick={this.iconShowModal}>\r\n // {\r\n // this.getKeyboardIcon()\r\n // }\r\n // </span>\r\n // :\r\n // null}\r\n />\r\n {/* 优化2期修改键盘输入框交互。由小键盘图标点击之后打开的键盘,点击小键盘可以关闭。由于antd的Input组件对suffix做点击事件的冲突,所以将图标移到了Input外面 */}\r\n {\r\n which == 'icon' && !this.isMobileEnvironment ?\r\n <span className='keyboard-icon' onMouseDown={e => e.preventDefault()} onClick={this.iconShowModal}>\r\n {\r\n this.getKeyboardIcon()\r\n }\r\n </span>\r\n :\r\n null\r\n }\r\n </Input.Group>\r\n\r\n }\r\n {\r\n !this.isMobileEnvironment &&\r\n <Keyboard type='letter+modal' value={value} visible={this.state.visible} onChange={this.setStateValue} handleOk={this.handleOk} handleCancel={this.handleCancel} />\r\n }\r\n </div>\r\n )\r\n }\r\n}"]}
|
|
@@ -160,6 +160,7 @@ var NumKeyboard = (_temp = _class = function (_Component) {
|
|
|
160
160
|
{ className: 'del key clear positive', onClick: _this.numClick.bind(_this, 'clear') },
|
|
161
161
|
'\u6E05',
|
|
162
162
|
_react2.default.createElement('br', null),
|
|
163
|
+
_react2.default.createElement('br', null),
|
|
163
164
|
'\u7A7A'
|
|
164
165
|
)
|
|
165
166
|
) : null,
|
|
@@ -176,6 +177,7 @@ var NumKeyboard = (_temp = _class = function (_Component) {
|
|
|
176
177
|
{ className: 'del key sure real-sure', onClick: _this.numClick.bind(_this, 'sure') },
|
|
177
178
|
'\u786E',
|
|
178
179
|
_react2.default.createElement('br', null),
|
|
180
|
+
_react2.default.createElement('br', null),
|
|
179
181
|
'\u5B9A'
|
|
180
182
|
)
|
|
181
183
|
) : null,
|
|
@@ -192,6 +194,7 @@ var NumKeyboard = (_temp = _class = function (_Component) {
|
|
|
192
194
|
{ className: 'del key clear', onClick: _this.numClick.bind(_this, 'clear') },
|
|
193
195
|
'\u6E05',
|
|
194
196
|
_react2.default.createElement('br', null),
|
|
197
|
+
_react2.default.createElement('br', null),
|
|
195
198
|
'\u7A7A'
|
|
196
199
|
)
|
|
197
200
|
) : null
|
|
@@ -279,15 +282,16 @@ var NumKeyboard = (_temp = _class = function (_Component) {
|
|
|
279
282
|
_this.onFocus = function () {
|
|
280
283
|
_this.props.onFocus && _this.props.onFocus();
|
|
281
284
|
_this.input.input.select();
|
|
285
|
+
_this.onVisibleChange(true);
|
|
282
286
|
};
|
|
283
287
|
|
|
284
288
|
_this.onShowPopover = function () {
|
|
285
|
-
_this.
|
|
286
|
-
|
|
287
|
-
}
|
|
289
|
+
if (_this.state.visible) {
|
|
290
|
+
_this.input.input.blur();
|
|
291
|
+
} else {
|
|
288
292
|
_this.input.input.focus();
|
|
289
293
|
_this.input.input.select();
|
|
290
|
-
}
|
|
294
|
+
}
|
|
291
295
|
};
|
|
292
296
|
|
|
293
297
|
_this.getValue = function () {
|
|
@@ -322,13 +326,16 @@ var NumKeyboard = (_temp = _class = function (_Component) {
|
|
|
322
326
|
var propsVisible = _this.props.show;
|
|
323
327
|
var isPropsVisible = propsVisible !== undefined;
|
|
324
328
|
var icon = isPropsVisible ? propsVisible ? 'jianpan1' : 'jianpan2' : _this.state.visible ? 'jianpan1' : 'jianpan2';
|
|
325
|
-
var _this$props
|
|
326
|
-
|
|
329
|
+
var _this$props = _this.props,
|
|
330
|
+
_this$props$popClassN = _this$props.popClassName,
|
|
331
|
+
popClassName = _this$props$popClassN === undefined ? '' : _this$props$popClassN,
|
|
332
|
+
_this$props$placement = _this$props.placement,
|
|
333
|
+
placement = _this$props$placement === undefined ? 'bottomRight' : _this$props$placement;
|
|
327
334
|
|
|
328
335
|
return _this.props.disabled ? _react2.default.createElement(_index.Ticon, { className: 'keyboard-icon', type: icon, style: { color: '#999' } }) : _react2.default.createElement(
|
|
329
336
|
_popover2.default,
|
|
330
337
|
{
|
|
331
|
-
placement:
|
|
338
|
+
placement: placement,
|
|
332
339
|
onVisibleChange: _this.onVisibleChange,
|
|
333
340
|
onHide: _this.onHidePopover,
|
|
334
341
|
title: null
|
|
@@ -387,7 +394,9 @@ var NumKeyboard = (_temp = _class = function (_Component) {
|
|
|
387
394
|
_props2$popClassName = _props2.popClassName,
|
|
388
395
|
popClassName = _props2$popClassName === undefined ? '' : _props2$popClassName,
|
|
389
396
|
_props2$inputClassNam = _props2.inputClassName,
|
|
390
|
-
inputClassName = _props2$inputClassNam === undefined ? '' : _props2$inputClassNam
|
|
397
|
+
inputClassName = _props2$inputClassNam === undefined ? '' : _props2$inputClassNam,
|
|
398
|
+
_props2$placement = _props2.placement,
|
|
399
|
+
placement = _props2$placement === undefined ? 'right' : _props2$placement;
|
|
391
400
|
|
|
392
401
|
var _props = (0, _extends3.default)({}, this.props);
|
|
393
402
|
delete _props.bordered;
|
|
@@ -405,7 +414,7 @@ var NumKeyboard = (_temp = _class = function (_Component) {
|
|
|
405
414
|
{ className: 'keyboard number-keyboard ' + (!bordered ? 'no-bordered' : '') + ' ' + className },
|
|
406
415
|
trigger == 'click' ? _react2.default.createElement(
|
|
407
416
|
_input2.default.Group,
|
|
408
|
-
|
|
417
|
+
{ className: 'keybord-icon-focus' },
|
|
409
418
|
_react2.default.createElement(_input2.default, (0, _extends3.default)({ type: 'text'
|
|
410
419
|
}, _props, {
|
|
411
420
|
className: inputClassName + ' keyboard-input',
|
|
@@ -415,16 +424,17 @@ var NumKeyboard = (_temp = _class = function (_Component) {
|
|
|
415
424
|
ref: function ref(input) {
|
|
416
425
|
return _this2.input = input;
|
|
417
426
|
},
|
|
418
|
-
allowClear: this.isMobileEnvironment
|
|
419
|
-
suffix
|
|
420
|
-
}))
|
|
427
|
+
allowClear: this.isMobileEnvironment
|
|
428
|
+
// suffix={!this.isMobileEnvironment && this.getKeyboardIcon() }
|
|
429
|
+
})),
|
|
430
|
+
!this.isMobileEnvironment && this.getKeyboardIcon()
|
|
421
431
|
) : _react2.default.createElement(
|
|
422
432
|
_input2.default.Group,
|
|
423
433
|
null,
|
|
424
434
|
_react2.default.createElement(
|
|
425
435
|
_popover2.default,
|
|
426
436
|
{
|
|
427
|
-
placement:
|
|
437
|
+
placement: placement,
|
|
428
438
|
onVisibleChange: this.onVisibleChange,
|
|
429
439
|
onHide: this.onHidePopover,
|
|
430
440
|
rootClose: false,
|