From d018a4ba08595102f84d69343d076ff751dc21b6 Mon Sep 17 00:00:00 2001 From: bplok20010 Date: Sun, 9 Aug 2020 23:36:09 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=86=E8=8A=82=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 87 +- docs/asset-manifest.json | 8 +- docs/index.html | 2 +- ...227.chunk.css => index.17558ed5.chunk.css} | 0 docs/static/js/2.ed4c38d5.chunk.js | 1 - docs/static/js/2.f4e8ea2a.chunk.js | 1 + docs/static/js/index.17558ed5.chunk.js | 1 + docs/static/js/index.75c3a227.chunk.js | 1 - ....70097ef2.js => runtime-index.1e14c4f9.js} | 0 package-lock.json | 51779 ++++++++-------- package.json | 24 +- src/Form.tsx | 162 +- src/FormItem.tsx | 24 +- src/NativeField.tsx | 2 +- src/style/index.css | 58 + src/style/index.ts | 2 +- style/package.json | 6 + 17 files changed, 25657 insertions(+), 26501 deletions(-) rename docs/static/css/{index.75c3a227.chunk.css => index.17558ed5.chunk.css} (100%) delete mode 100644 docs/static/js/2.ed4c38d5.chunk.js create mode 100644 docs/static/js/2.f4e8ea2a.chunk.js create mode 100644 docs/static/js/index.17558ed5.chunk.js delete mode 100644 docs/static/js/index.75c3a227.chunk.js rename docs/static/js/{runtime-index.70097ef2.js => runtime-index.1e14c4f9.js} (100%) create mode 100644 src/style/index.css create mode 100644 style/package.json diff --git a/README.md b/README.md index caede2a..6d9ec4f 100644 --- a/README.md +++ b/README.md @@ -160,7 +160,7 @@ function Input(props){ ### NativeInput ```ts -component: React.ElementType; +component?: React.ElementType; onChange?: (value: any) => void; inputRef?: (dom: any) => void; [others: string]: any; @@ -265,51 +265,64 @@ export default function NativeInput(props) { ## 基础样式 -```scss -$form-item-cls: nex-form-item; +```css +.rw-form-item { + display: flex; +} -.#{$form-item-cls} { - display: flex; +.rw-form-item-inline { + display: inline-flex; +} - &-inline { - display: inline-flex; - } +.rw-form-item-label { + text-align: right; + flex: none; +} - &-label { - text-align: right; - flex: none; - } +.rw-form-item-label-left { + text-align: left; +} - &-label-left { - text-align: left; - } +.rw-form-item-top { + display: block; +} - &-top { - display: block; - } +.rw-form-item-top.rw-form-item-inline { + display: inline-block; + vertical-align: top; +} - &-top.#{$form-item-cls}-inline { - display: inline-block; - vertical-align: top; - } +.rw-form-item-top .rw-form-item-label { + text-align: left; + display: block; +} - &-top &-label { - text-align: left; - display: block; - } +.rw-form-item-label { + text-align: right; + flex: none; +} - &-control { - position: relative; - flex: 1; - } +.rw-form-item-label { + text-align: right; + flex: none; +} - &.is-required &-label:before { - content: "*"; - display: inline-block; - margin-right: 4px; - font-family: SimSun; - color: red; - } +.rw-form-item-label { + text-align: right; + flex: none; +} + +.rw-form-item-control { + position: relative; + flex: 1; +} + +.rw-form-item.is-required .rw-form-item-label:before { + content: "*"; + display: inline-block; + margin-right: 4px; + font-family: SimSun; + color: red; } diff --git a/docs/asset-manifest.json b/docs/asset-manifest.json index 6e99be5..a4b9d97 100644 --- a/docs/asset-manifest.json +++ b/docs/asset-manifest.json @@ -1,7 +1,7 @@ { - "index.css": "static/css/index.75c3a227.chunk.css", - "index.js": "static/js/index.75c3a227.chunk.js", - "runtime-index.js": "static/js/runtime-index.70097ef2.js", - "static/js/2.ed4c38d5.chunk.js": "static/js/2.ed4c38d5.chunk.js", + "index.css": "static/css/index.17558ed5.chunk.css", + "index.js": "static/js/index.17558ed5.chunk.js", + "runtime-index.js": "static/js/runtime-index.1e14c4f9.js", + "static/js/2.f4e8ea2a.chunk.js": "static/js/2.f4e8ea2a.chunk.js", "index.html": "index.html" } \ No newline at end of file diff --git a/docs/index.html b/docs/index.html index 010a528..edeafe7 100644 --- a/docs/index.html +++ b/docs/index.html @@ -1 +1 @@ -Form
\ No newline at end of file +Form
\ No newline at end of file diff --git a/docs/static/css/index.75c3a227.chunk.css b/docs/static/css/index.17558ed5.chunk.css similarity index 100% rename from docs/static/css/index.75c3a227.chunk.css rename to docs/static/css/index.17558ed5.chunk.css diff --git a/docs/static/js/2.ed4c38d5.chunk.js b/docs/static/js/2.ed4c38d5.chunk.js deleted file mode 100644 index 603c201..0000000 --- a/docs/static/js/2.ed4c38d5.chunk.js +++ /dev/null @@ -1 +0,0 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[2],[function(e,t,n){"use strict";e.exports=n(124)},function(e,t,n){(function(t){var n=function(e){return e&&e.Math==Math&&e};e.exports=n("object"==typeof globalThis&&globalThis)||n("object"==typeof window&&window)||n("object"==typeof self&&self)||n("object"==typeof t&&t)||Function("return this")()}).call(this,n(57))},function(e,t,n){var r=n(1),o=n(58),i=n(5),l=n(61),a=n(62),u=n(97),c=o("wks"),s=r.Symbol,f=u?s:s&&s.withoutSetter||l;e.exports=function(e){return i(c,e)||(a&&i(s,e)?c[e]=s[e]:c[e]=f("Symbol."+e)),c[e]}},function(e,t){e.exports=function(e){try{return!!e()}catch(t){return!0}}},function(e,t){e.exports=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}},function(e,t){var n={}.hasOwnProperty;e.exports=function(e,t){return n.call(e,t)}},function(e,t,n){var r=n(9);e.exports=function(e){if(!r(e))throw TypeError(String(e)+" is not an object");return e}},function(e,t,n){var r=n(8),o=n(11),i=n(22);e.exports=r?function(e,t,n){return o.f(e,t,i(1,n))}:function(e,t,n){return e[t]=n,e}},function(e,t,n){var r=n(3);e.exports=!r((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]}))},function(e,t){e.exports=function(e){return"object"===typeof e?null!==e:"function"===typeof e}},function(e,t,n){var r=n(1),o=n(43).f,i=n(7),l=n(18),a=n(34),u=n(102),c=n(71);e.exports=function(e,t){var n,s,f,d,p,h=e.target,v=e.global,m=e.stat;if(n=v?r:m?r[h]||a(h,{}):(r[h]||{}).prototype)for(s in t){if(d=t[s],f=e.noTargetGet?(p=o(n,s))&&p.value:n[s],!c(v?s:h+(m?".":"#")+s,e.forced)&&void 0!==f){if(typeof d===typeof f)continue;u(d,f)}(e.sham||f&&f.sham)&&i(d,"sham",!0),l(n,s,d,e)}}},function(e,t,n){var r=n(8),o=n(60),i=n(6),l=n(36),a=Object.defineProperty;t.f=r?a:function(e,t,n){if(i(e),t=l(t,!0),i(n),o)try{return a(e,t,n)}catch(r){}if("get"in n||"set"in n)throw TypeError("Accessors not supported");return"value"in n&&(e[t]=n.value),e}},function(e,t,n){"use strict";var r=n(21),o=n(96),i=n(17),l=n(41),a=n(101),u=l.set,c=l.getterFor("Array Iterator");e.exports=a(Array,"Array",(function(e,t){u(this,{type:"Array Iterator",target:r(e),index:0,kind:t})}),(function(){var e=c(this),t=e.target,n=e.kind,r=e.index++;return!t||r>=t.length?(e.target=void 0,{value:void 0,done:!0}):"keys"==n?{value:r,done:!1}:"values"==n?{value:t[r],done:!1}:{value:[r,t[r]],done:!1}}),"values"),i.Arguments=i.Array,o("keys"),o("values"),o("entries")},function(e,t){var n={}.toString;e.exports=function(e){return n.call(e).slice(8,-1)}},function(e,t,n){var r=n(99),o=n(1),i=function(e){return"function"==typeof e?e:void 0};e.exports=function(e,t){return arguments.length<2?i(r[e])||i(o[e]):r[e]&&r[e][t]||o[e]&&o[e][t]}},function(e,t,n){var r;!function(){"use strict";var n={}.hasOwnProperty;function o(){for(var e=[],t=0;t0?o(r(e),9007199254740991):0}},function(e,t,n){var r=n(56);e.exports=function(e){return Object(r(e))}},function(e,t){e.exports=function(e){if("function"!=typeof e)throw TypeError(String(e)+" is not a function");return e}},function(e,t,n){var r=n(10),o=n(123);r({target:"Object",stat:!0,forced:Object.assign!==o},{assign:o})},function(e,t,n){var r=n(1),o=n(85),i=n(12),l=n(7),a=n(2),u=a("iterator"),c=a("toStringTag"),s=i.values;for(var f in o){var d=r[f],p=d&&d.prototype;if(p){if(p[u]!==s)try{l(p,u,s)}catch(v){p[u]=s}if(p[c]||l(p,c,f),o[f])for(var h in i)if(p[h]!==i[h])try{l(p,h,i[h])}catch(v){p[h]=i[h]}}}},function(e,t,n){var r=n(49)(Object,"create");e.exports=r},function(e,t,n){var r=n(89);e.exports=function(e,t){for(var n=e.length;n--;)if(r(e[n][0],t))return n;return-1}},function(e,t,n){var r=n(171);e.exports=function(e,t){var n=e.__data__;return r(t)?n["string"==typeof t?"string":"hash"]:n.map}},function(e,t){function n(){return e.exports=n=Object.assign||function(e){for(var t=1;t=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}},function(e,t,n){var r=n(3),o=n(13),i="".split;e.exports=r((function(){return!Object("z").propertyIsEnumerable(0)}))?function(e){return"String"==o(e)?i.call(e,""):Object(e)}:Object},function(e,t,n){var r=n(1),o=n(7);e.exports=function(e,t){try{o(r,e,t)}catch(n){r[e]=t}return t}},function(e,t,n){var r=n(1),o=n(9),i=r.document,l=o(i)&&o(i.createElement);e.exports=function(e){return l?i.createElement(e):{}}},function(e,t,n){var r=n(9);e.exports=function(e,t){if(!r(e))return e;var n,o;if(t&&"function"==typeof(n=e.toString)&&!r(o=n.call(e)))return o;if("function"==typeof(n=e.valueOf)&&!r(o=n.call(e)))return o;if(!t&&"function"==typeof(n=e.toString)&&!r(o=n.call(e)))return o;throw TypeError("Can't convert object to primitive value")}},function(e,t){var n=Math.ceil,r=Math.floor;e.exports=function(e){return isNaN(e=+e)?0:(e>0?r:n)(e)}},function(e,t){e.exports={}},function(e,t){e.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},function(e,t,n){var r=n(58),o=n(61),i=r("keys");e.exports=function(e){return i[e]||(i[e]=o(e))}},function(e,t,n){var r,o,i,l=n(100),a=n(1),u=n(9),c=n(7),s=n(5),f=n(40),d=n(38),p=a.WeakMap;if(l){var h=new p,v=h.get,m=h.has,y=h.set;r=function(e,t){return y.call(h,e,t),t},o=function(e){return v.call(h,e)||{}},i=function(e){return m.call(h,e)}}else{var g=f("state");d[g]=!0,r=function(e,t){return c(e,g,t),t},o=function(e){return s(e,g)?e[g]:{}},i=function(e){return s(e,g)}}e.exports={set:r,get:o,has:i,enforce:function(e){return i(e)?o(e):r(e,{})},getterFor:function(e){return function(t){var n;if(!u(t)||(n=o(t)).type!==e)throw TypeError("Incompatible receiver, "+e+" required");return n}}}},function(e,t,n){var r=n(59),o=Function.toString;"function"!=typeof r.inspectSource&&(r.inspectSource=function(e){return o.call(e)}),e.exports=r.inspectSource},function(e,t,n){var r=n(8),o=n(69),i=n(22),l=n(21),a=n(36),u=n(5),c=n(60),s=Object.getOwnPropertyDescriptor;t.f=r?s:function(e,t){if(e=l(e),t=a(t,!0),c)try{return s(e,t)}catch(n){}if(u(e,t))return i(!o.f.call(e,t),e[t])}},function(e,t,n){var r=n(11).f,o=n(5),i=n(2)("toStringTag");e.exports=function(e,t,n){e&&!o(e=n?e:e.prototype,i)&&r(e,i,{configurable:!0,value:t})}},function(e,t,n){"use strict";var r,o,i,l,a=n(10),u=n(16),c=n(1),s=n(14),f=n(74),d=n(18),p=n(109),h=n(44),v=n(110),m=n(9),y=n(25),g=n(111),b=n(13),w=n(42),x=n(112),k=n(118),E=n(75),T=n(76).set,S=n(119),_=n(79),C=n(120),P=n(80),O=n(121),N=n(41),z=n(71),j=n(2),M=n(81),I=j("species"),R="Promise",F=N.get,L=N.set,A=N.getterFor(R),D=f,U=c.TypeError,V=c.document,W=c.process,$=s("fetch"),Q=P.f,H=Q,B="process"==b(W),K=!!(V&&V.createEvent&&c.dispatchEvent),q=z(R,(function(){if(!(w(D)!==String(D))){if(66===M)return!0;if(!B&&"function"!=typeof PromiseRejectionEvent)return!0}if(u&&!D.prototype.finally)return!0;if(M>=51&&/native code/.test(D))return!1;var e=D.resolve(1),t=function(e){e((function(){}),(function(){}))};return(e.constructor={})[I]=t,!(e.then((function(){}))instanceof t)})),Y=q||!k((function(e){D.all(e).catch((function(){}))})),G=function(e){var t;return!(!m(e)||"function"!=typeof(t=e.then))&&t},X=function(e,t,n){if(!t.notified){t.notified=!0;var r=t.reactions;S((function(){for(var o=t.value,i=1==t.state,l=0;r.length>l;){var a,u,c,s=r[l++],f=i?s.ok:s.fail,d=s.resolve,p=s.reject,h=s.domain;try{f?(i||(2===t.rejection&&te(e,t),t.rejection=1),!0===f?a=o:(h&&h.enter(),a=f(o),h&&(h.exit(),c=!0)),a===s.promise?p(U("Promise-chain cycle")):(u=G(a))?u.call(a,d,p):d(a)):p(o)}catch(v){h&&!c&&h.exit(),p(v)}}t.reactions=[],t.notified=!1,n&&!t.rejection&&Z(e,t)}))}},J=function(e,t,n){var r,o;K?((r=V.createEvent("Event")).promise=t,r.reason=n,r.initEvent(e,!1,!0),c.dispatchEvent(r)):r={promise:t,reason:n},(o=c["on"+e])?o(r):"unhandledrejection"===e&&C("Unhandled promise rejection",n)},Z=function(e,t){T.call(c,(function(){var n,r=t.value;if(ee(t)&&(n=O((function(){B?W.emit("unhandledRejection",r,e):J("unhandledrejection",e,r)})),t.rejection=B||ee(t)?2:1,n.error))throw n.value}))},ee=function(e){return 1!==e.rejection&&!e.parent},te=function(e,t){T.call(c,(function(){B?W.emit("rejectionHandled",e):J("rejectionhandled",e,t.value)}))},ne=function(e,t,n,r){return function(o){e(t,n,o,r)}},re=function(e,t,n,r){t.done||(t.done=!0,r&&(t=r),t.value=n,t.state=2,X(e,t,!0))},oe=function(e,t,n,r){if(!t.done){t.done=!0,r&&(t=r);try{if(e===n)throw U("Promise can't be resolved itself");var o=G(n);o?S((function(){var r={done:!1};try{o.call(n,ne(oe,e,r,t),ne(re,e,r,t))}catch(i){re(e,r,i,t)}})):(t.value=n,t.state=1,X(e,t,!1))}catch(i){re(e,{done:!1},i,t)}}};q&&(D=function(e){g(this,D,R),y(e),r.call(this);var t=F(this);try{e(ne(oe,this,t),ne(re,this,t))}catch(n){re(this,t,n)}},(r=function(e){L(this,{type:R,done:!1,notified:!1,parent:!1,reactions:[],rejection:!1,state:0,value:void 0})}).prototype=p(D.prototype,{then:function(e,t){var n=A(this),r=Q(E(this,D));return r.ok="function"!=typeof e||e,r.fail="function"==typeof t&&t,r.domain=B?W.domain:void 0,n.parent=!0,n.reactions.push(r),0!=n.state&&X(this,n,!1),r.promise},catch:function(e){return this.then(void 0,e)}}),o=function(){var e=new r,t=F(e);this.promise=e,this.resolve=ne(oe,e,t),this.reject=ne(re,e,t)},P.f=Q=function(e){return e===D||e===i?new o(e):H(e)},u||"function"!=typeof f||(l=f.prototype.then,d(f.prototype,"then",(function(e,t){var n=this;return new D((function(e,t){l.call(n,e,t)})).then(e,t)}),{unsafe:!0}),"function"==typeof $&&a({global:!0,enumerable:!0,forced:!0},{fetch:function(e){return _(D,$.apply(c,arguments))}}))),a({global:!0,wrap:!0,forced:q},{Promise:D}),h(D,R,!1,!0),v(R),i=s(R),a({target:R,stat:!0,forced:q},{reject:function(e){var t=Q(this);return t.reject.call(void 0,e),t.promise}}),a({target:R,stat:!0,forced:u||q},{resolve:function(e){return _(u&&this===i?D:this,e)}}),a({target:R,stat:!0,forced:Y},{all:function(e){var t=this,n=Q(t),r=n.resolve,o=n.reject,i=O((function(){var n=y(t.resolve),i=[],l=0,a=1;x(e,(function(e){var u=l++,c=!1;i.push(void 0),a++,n.call(t,e).then((function(e){c||(c=!0,i[u]=e,--a||r(i))}),o)})),--a||r(i)}));return i.error&&o(i.value),n.promise},race:function(e){var t=this,n=Q(t),r=n.reject,o=O((function(){var o=y(t.resolve);x(e,(function(e){o.call(t,e).then(n.resolve,r)}))}));return o.error&&r(o.value),n.promise}})},function(e,t,n){var r=n(25);e.exports=function(e,t,n){if(r(e),void 0===t)return e;switch(n){case 0:return function(){return e.call(t)};case 1:return function(n){return e.call(t,n)};case 2:return function(n,r){return e.call(t,n,r)};case 3:return function(n,r,o){return e.call(t,n,r,o)}}return function(){return e.apply(t,arguments)}}},function(e,t,n){var r=n(46),o=n(33),i=n(24),l=n(23),a=n(84),u=[].push,c=function(e){var t=1==e,n=2==e,c=3==e,s=4==e,f=6==e,d=5==e||f;return function(p,h,v,m){for(var y,g,b=i(p),w=o(b),x=r(h,v,3),k=l(w.length),E=0,T=m||a,S=t?T(p,k):n?T(p,0):void 0;k>E;E++)if((d||E in w)&&(g=x(y=w[E],E,b),e))if(t)S[E]=g;else if(g)switch(e){case 3:return!0;case 5:return y;case 6:return E;case 2:u.call(S,y)}else if(s)return!1;return f?-1:c||s?s:S}};e.exports={forEach:c(0),map:c(1),filter:c(2),some:c(3),every:c(4),find:c(5),findIndex:c(6)}},function(e,t,n){var r=n(3),o=n(2),i=n(81),l=o("species");e.exports=function(e){return i>=51||!r((function(){var t=[];return(t.constructor={})[l]=function(){return{foo:1}},1!==t[e](Boolean).foo}))}},function(e,t,n){var r=n(142),o=n(149);e.exports=function(e,t){var n=o(e,t);return r(n)?n:void 0}},function(e,t,n){var r=n(51).Symbol;e.exports=r},function(e,t,n){var r=n(143),o="object"==typeof self&&self&&self.Object===Object&&self,i=r||o||Function("return this")();e.exports=i},function(e,t){e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},function(e,t){var n=Array.isArray;e.exports=n},function(e,t,n){var r=n(88),o=n(151);e.exports=function(e){return"symbol"==typeof e||o(e)&&"[object Symbol]"==r(e)}},function(e,t,n){var r=n(138);e.exports=function(e,t,n){return null==e?e:r(e,t,n)}},function(e,t){e.exports=function(e){if(void 0==e)throw TypeError("Can't call method on "+e);return e}},function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(r){"object"===typeof window&&(n=window)}e.exports=n},function(e,t,n){var r=n(16),o=n(59);(e.exports=function(e,t){return o[e]||(o[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.6.5",mode:r?"pure":"global",copyright:"\xa9 2020 Denis Pushkarev (zloirock.ru)"})},function(e,t,n){var r=n(1),o=n(34),i=r["__core-js_shared__"]||o("__core-js_shared__",{});e.exports=i},function(e,t,n){var r=n(8),o=n(3),i=n(35);e.exports=!r&&!o((function(){return 7!=Object.defineProperty(i("div"),"a",{get:function(){return 7}}).a}))},function(e,t){var n=0,r=Math.random();e.exports=function(e){return"Symbol("+String(void 0===e?"":e)+")_"+(++n+r).toString(36)}},function(e,t,n){var r=n(3);e.exports=!!Object.getOwnPropertySymbols&&!r((function(){return!String(Symbol())}))},function(e,t,n){var r,o=n(6),i=n(98),l=n(39),a=n(38),u=n(68),c=n(35),s=n(40),f=s("IE_PROTO"),d=function(){},p=function(e){return"