@yup/taro-ui 0.0.8 → 1.0.0

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.
Files changed (149) hide show
  1. package/README.md +228 -1
  2. package/es/_virtual/_rollupPluginBabelHelpers.js +3 -1
  3. package/es/components/avatar/index.d.ts +18 -0
  4. package/es/components/avatar/index.js +1 -0
  5. package/es/components/avatar/style/index.css +28 -0
  6. package/es/components/avatar/style/index.d.ts +2 -0
  7. package/es/components/avatar/style/index.js +2 -0
  8. package/es/components/button/index.d.ts +19 -3
  9. package/es/components/button/index.js +1 -1
  10. package/es/components/button/style/index.css +118 -48
  11. package/es/components/button/style/index.d.ts +1 -0
  12. package/es/components/button/style/index.js +1 -0
  13. package/es/components/checkbox/checkbox-group.d.ts +6 -2
  14. package/es/components/checkbox/checkbox-group.js +1 -1
  15. package/es/components/checkbox/index.js +1 -1
  16. package/es/components/checkbox/style/index.css +2 -24
  17. package/es/components/checkbox/style/index.d.ts +1 -0
  18. package/es/components/checkbox/style/index.js +1 -0
  19. package/es/components/city-selector/hooks/useLevel2Multiple.d.ts +24 -0
  20. package/es/components/city-selector/hooks/useLevel2Multiple.js +1 -0
  21. package/es/components/city-selector/hooks/useLevel2Single.d.ts +19 -0
  22. package/es/components/city-selector/hooks/useLevel2Single.js +1 -0
  23. package/es/components/city-selector/hooks/useMultiple.d.ts +28 -0
  24. package/es/components/city-selector/hooks/useMultiple.js +1 -0
  25. package/es/components/city-selector/hooks/useSingle.d.ts +23 -0
  26. package/es/components/city-selector/hooks/useSingle.js +1 -0
  27. package/es/components/city-selector/index.d.ts +5 -0
  28. package/es/components/city-selector/index.js +1 -0
  29. package/es/components/city-selector/style/index.css +153 -0
  30. package/es/components/city-selector/style/index.d.ts +2 -0
  31. package/es/components/city-selector/util.d.ts +2 -0
  32. package/es/components/city-selector/util.js +1 -0
  33. package/es/components/date-picker-view/index.d.ts +40 -0
  34. package/es/components/date-picker-view/index.js +1 -0
  35. package/es/components/date-picker-view/style/index.css +3 -0
  36. package/es/components/date-picker-view/style/index.d.ts +2 -0
  37. package/es/components/date-picker-view/style/index.js +2 -0
  38. package/es/components/date-picker-view/util.d.ts +7 -0
  39. package/es/components/date-picker-view/util.js +1 -0
  40. package/es/components/dialog/context.d.ts +4 -0
  41. package/es/components/dialog/index.d.ts +31 -0
  42. package/es/components/dialog/index.js +1 -0
  43. package/es/components/dialog/style/index.css +113 -0
  44. package/es/components/dialog/style/index.d.ts +2 -0
  45. package/es/components/dialog/style/index.js +2 -0
  46. package/es/components/form/form-item.js +1 -1
  47. package/es/components/form/index.js +1 -1
  48. package/es/components/form/style/index.css +0 -22
  49. package/es/components/form/style/index.d.ts +1 -0
  50. package/es/components/form/style/index.js +1 -0
  51. package/es/components/icon/index.d.ts +12 -0
  52. package/es/components/icon/index.js +1 -0
  53. package/es/components/icon/style/iconfont.css +72 -0
  54. package/es/components/icon/style/iconfont.ttf +0 -0
  55. package/es/components/icon/style/iconfont.woff +0 -0
  56. package/es/components/icon/style/iconfont.woff2 +0 -0
  57. package/es/components/icon/style/index.d.ts +1 -0
  58. package/es/components/icon/style/index.js +1 -0
  59. package/es/components/input/index.d.ts +12 -0
  60. package/es/components/input/index.js +1 -1
  61. package/es/components/input/style/index.css +33 -32
  62. package/es/components/input/style/index.d.ts +2 -0
  63. package/es/components/input/style/index.js +2 -0
  64. package/es/components/input/style/search.css +21 -0
  65. package/es/components/media-uploader/index.d.ts +123 -0
  66. package/es/components/media-uploader/index.js +1 -0
  67. package/es/components/media-uploader/style/index.css +93 -0
  68. package/es/components/media-uploader/style/index.d.ts +2 -0
  69. package/es/components/media-uploader/style/index.js +2 -0
  70. package/es/components/picker-view/index.d.ts +25 -0
  71. package/es/components/picker-view/index.js +1 -0
  72. package/es/components/picker-view/style/index.css +62 -0
  73. package/es/components/picker-view/style/index.d.ts +2 -0
  74. package/es/components/picker-view/style/index.js +2 -0
  75. package/es/components/popup/index.d.ts +62 -0
  76. package/es/components/popup/index.js +1 -0
  77. package/es/components/popup/style/index.css +91 -0
  78. package/es/components/popup/style/index.d.ts +2 -0
  79. package/es/components/popup/style/index.js +2 -0
  80. package/es/components/radio/context.d.ts +5 -0
  81. package/es/components/radio/context.js +1 -0
  82. package/es/components/radio/index.js +1 -1
  83. package/es/components/radio/radio-group.js +1 -1
  84. package/es/components/radio/style/group.css +0 -22
  85. package/es/components/radio/style/index.d.ts +1 -0
  86. package/es/components/radio/style/index.js +1 -0
  87. package/es/components/radio/style/radio.css +11 -24
  88. package/es/components/safe-area/index.d.ts +13 -0
  89. package/es/components/safe-area/index.js +1 -0
  90. package/es/components/safe-area/style/index.css +3 -0
  91. package/es/components/safe-area/style/index.d.ts +2 -0
  92. package/es/components/safe-area/style/index.js +2 -0
  93. package/es/components/safe-area/util.d.ts +5 -0
  94. package/es/components/safe-area/util.js +1 -0
  95. package/es/components/switch/index.d.ts +6 -0
  96. package/es/components/switch/index.js +1 -0
  97. package/es/components/switch/style/index.css +38 -0
  98. package/es/components/switch/style/index.d.ts +2 -0
  99. package/es/components/switch/style/index.js +2 -0
  100. package/es/components/tag/index.d.ts +18 -0
  101. package/es/components/tag/index.js +1 -0
  102. package/es/components/tag/style/index.css +92 -0
  103. package/es/components/tag/style/index.d.ts +2 -0
  104. package/es/components/tag/style/index.js +2 -0
  105. package/es/components/toast/style/index.css +0 -22
  106. package/es/components/toast/style/index.d.ts +1 -0
  107. package/es/components/toast/style/index.js +1 -0
  108. package/es/components/toast/toast.js +1 -1
  109. package/es/components/toast/withToast.js +1 -1
  110. package/es/global/global.css +21 -0
  111. package/es/global/index.d.ts +2 -1
  112. package/es/global/theme-default.css +21 -0
  113. package/es/global/variables.css +0 -0
  114. package/es/hooks/useRefState.d.ts +7 -0
  115. package/es/hooks/useRefState.js +1 -0
  116. package/es/index.d.ts +26 -0
  117. package/es/index.js +1 -1
  118. package/es/node_modules/@yup/taro-checkbox/dist/_virtual/_rollupPluginBabelHelpers.js +1 -0
  119. package/es/node_modules/@yup/taro-checkbox/dist/checkbox-group.js +1 -0
  120. package/es/node_modules/@yup/taro-checkbox/dist/context.js +1 -0
  121. package/es/node_modules/@yup/taro-checkbox/dist/index.js +1 -0
  122. package/es/node_modules/@yup/taro-form/dist/_virtual/_rollupPluginBabelHelpers.js +3 -0
  123. package/es/node_modules/@yup/taro-form/dist/context.js +1 -0
  124. package/es/node_modules/@yup/taro-form/dist/formItem.js +1 -0
  125. package/es/node_modules/@yup/taro-form/dist/fromStore.js +1 -0
  126. package/es/node_modules/@yup/taro-form/dist/index.js +1 -0
  127. package/es/node_modules/@yup/taro-form/dist/useForm.js +1 -0
  128. package/es/node_modules/@yup/taro-form/dist/useWatch.js +1 -0
  129. package/es/node_modules/@yup/taro-radio/dist/_virtual/_rollupPluginBabelHelpers.js +1 -0
  130. package/es/node_modules/@yup/taro-radio/dist/context.js +1 -0
  131. package/es/node_modules/@yup/taro-radio/dist/index.js +1 -0
  132. package/es/node_modules/@yup/taro-radio/dist/radio-group.js +1 -0
  133. package/es/style/iconfont.ttf +0 -0
  134. package/es/style/iconfont.woff +0 -0
  135. package/es/style/iconfont.woff2 +0 -0
  136. package/es/style/index.css +282 -227
  137. package/es/utils/is.js +1 -1
  138. package/package.json +16 -9
  139. package/es/_virtual/_commonjsHelpers.js +0 -1
  140. package/es/_virtual/index.js +0 -1
  141. package/es/_virtual/jsx-runtime.js +0 -1
  142. package/es/_virtual/react-jsx-runtime.development.js +0 -1
  143. package/es/_virtual/react-jsx-runtime.production.min.js +0 -1
  144. package/es/global.css +0 -22
  145. package/es/node_modules/classnames/index.js +0 -1
  146. package/es/node_modules/react/cjs/react-jsx-runtime.development.js +0 -1
  147. package/es/node_modules/react/cjs/react-jsx-runtime.production.min.js +0 -10
  148. package/es/node_modules/react/jsx-runtime.js +0 -1
  149. package/es/utils/react.d.ts +0 -2
@@ -0,0 +1,3 @@
1
+ import{typeof as r}from"../../../../../_virtual/_rollupPluginBabelHelpers.js";function t(r,t){(null==t||t>r.length)&&(t=r.length);for(var e=0,n=Array(t);e<t;e++)n[e]=r[e];return n}function e(r){if(Array.isArray(r))return r}function n(r,t,e,n,o,i,a){try{var u=r[i](a),c=u.value}catch(r){return void e(r)}u.done?t(c):Promise.resolve(c).then(n,o)}function o(r){return function(){var t=this,e=arguments;return new Promise(function(o,i){var a=r.apply(t,e);function u(r){n(a,o,i,u,c,"next",r)}function c(r){n(a,o,i,u,c,"throw",r)}u(void 0)})}}function i(r,t){if(!(r instanceof t))throw new TypeError("Cannot call a class as a function")}function a(r,t){for(var e=0;e<t.length;e++){var n=t[e];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(r,j(n.key),n)}}function u(r,t,e){return t&&a(r.prototype,t),e&&a(r,e),Object.defineProperty(r,"prototype",{writable:!1}),r}function c(r,t){var e="undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(!e){if(Array.isArray(r)||(e=P(r))||t&&r&&"number"==typeof r.length){e&&(r=e);var n=0,o=function(){};return{s:o,n:function(){return n>=r.length?{done:!0}:{done:!1,value:r[n++]}},e:function(r){throw r},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){e=e.call(r)},n:function(){var r=e.next();return a=r.done,r},e:function(r){u=!0,i=r},f:function(){try{a||null==e.return||e.return()}finally{if(u)throw i}}}}function f(r,t,e){return(t=j(t))in r?Object.defineProperty(r,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):r[t]=e,r}function l(){return l=Object.assign?Object.assign.bind():function(r){for(var t=1;t<arguments.length;t++){var e=arguments[t];for(var n in e)({}).hasOwnProperty.call(e,n)&&(r[n]=e[n])}return r},l.apply(null,arguments)}function s(r,t){var e=null==r?null:"undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(null!=e){var n,o,i,a,u=[],c=!0,f=!1;try{if(i=(e=e.call(r)).next,0===t){if(Object(e)!==e)return;c=!1}else for(;!(c=(n=i.call(e)).done)&&(u.push(n.value),u.length!==t);c=!0);}catch(r){f=!0,o=r}finally{try{if(!c&&null!=e.return&&(a=e.return(),Object(a)!==a))return}finally{if(f)throw o}}return u}}function y(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function p(r,t){var e=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(r,t).enumerable})),e.push.apply(e,n)}return e}function b(r){for(var t=1;t<arguments.length;t++){var e=null!=arguments[t]?arguments[t]:{};t%2?p(Object(e),!0).forEach(function(t){f(r,t,e[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(e)):p(Object(e)).forEach(function(t){Object.defineProperty(r,t,Object.getOwnPropertyDescriptor(e,t))})}return r}function v(r,t){if(null==r)return{};var e,n,o=m(r,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(r);for(n=0;n<i.length;n++)e=i[n],-1===t.indexOf(e)&&{}.propertyIsEnumerable.call(r,e)&&(o[e]=r[e])}return o}function m(r,t){if(null==r)return{};var e={};for(var n in r)if({}.hasOwnProperty.call(r,n)){if(-1!==t.indexOf(n))continue;e[n]=r[n]}return e}function h(){
2
+ /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */
3
+ var r,t,e="function"==typeof Symbol?Symbol:{},n=e.iterator||"@@iterator",o=e.toStringTag||"@@toStringTag";function i(e,n,o,i){var c=n&&n.prototype instanceof u?n:u,f=Object.create(c.prototype);return d(f,"_invoke",function(e,n,o){var i,u,c,f=0,l=o||[],s=!1,y={p:0,n:0,v:r,a:p,f:p.bind(r,4),d:function(t,e){return i=t,u=0,c=r,y.n=e,a}};function p(e,n){for(u=e,c=n,t=0;!s&&f&&!o&&t<l.length;t++){var o,i=l[t],p=y.p,b=i[2];e>3?(o=b===n)&&(c=i[(u=i[4])?5:(u=3,3)],i[4]=i[5]=r):i[0]<=p&&((o=e<2&&p<i[1])?(u=0,y.v=n,y.n=i[1]):p<b&&(o=e<3||i[0]>n||n>b)&&(i[4]=e,i[5]=n,y.n=b,u=0))}if(o||e>1)return a;throw s=!0,n}return function(o,l,b){if(f>1)throw TypeError("Generator is already running");for(s&&1===l&&p(l,b),u=l,c=b;(t=u<2?r:c)||!s;){i||(u?u<3?(u>1&&(y.n=-1),p(u,c)):y.n=c:y.v=c);try{if(f=2,i){if(u||(o="next"),t=i[o]){if(!(t=t.call(i,c)))throw TypeError("iterator result is not an object");if(!t.done)return t;c=t.value,u<2&&(u=0)}else 1===u&&(t=i.return)&&t.call(i),u<2&&(c=TypeError("The iterator does not provide a '"+o+"' method"),u=1);i=r}else if((t=(s=y.n<0)?c:e.call(n,y))!==a)break}catch(t){i=r,u=1,c=t}finally{f=1}}return{value:t,done:s}}}(e,o,i),!0),f}var a={};function u(){}function c(){}function f(){}t=Object.getPrototypeOf;var l=[][n]?t(t([][n]())):(d(t={},n,function(){return this}),t),s=f.prototype=u.prototype=Object.create(l);function y(r){return Object.setPrototypeOf?Object.setPrototypeOf(r,f):(r.__proto__=f,d(r,o,"GeneratorFunction")),r.prototype=Object.create(s),r}return c.prototype=f,d(s,"constructor",f),d(f,"constructor",c),c.displayName="GeneratorFunction",d(f,o,"GeneratorFunction"),d(s),d(s,o,"Generator"),d(s,n,function(){return this}),d(s,"toString",function(){return"[object Generator]"}),(h=function(){return{w:i,m:y}})()}function d(r,t,e,n){var o=Object.defineProperty;try{o({},"",{})}catch(r){o=0}d=function(r,t,e,n){function i(t,e){d(r,t,function(r){return this._invoke(t,e,r)})}t?o?o(r,t,{value:e,enumerable:!n,configurable:!n,writable:!n}):r[t]=e:(i("next",0),i("throw",1),i("return",2))},d(r,t,e,n)}function O(r,t){return e(r)||s(r,t)||P(r,t)||y()}function g(t,e){if("object"!=r(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var o=n.call(t,e||"default");if("object"!=r(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}function j(t){var e=g(t,"string");return"symbol"==r(e)?e:e+""}function w(r){return w="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(r){return typeof r}:function(r){return r&&"function"==typeof Symbol&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},w(r)}function P(r,e){if(r){if("string"==typeof r)return t(r,e);var n={}.toString.call(r).slice(8,-1);return"Object"===n&&r.constructor&&(n=r.constructor.name),"Map"===n||"Set"===n?Array.from(r):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?t(r,e):void 0}}export{t as arrayLikeToArray,e as arrayWithHoles,o as asyncToGenerator,i as classCallCheck,u as createClass,c as createForOfIteratorHelper,f as defineProperty,l as extends,s as iterableToArrayLimit,y as nonIterableRest,b as objectSpread2,v as objectWithoutProperties,m as objectWithoutPropertiesLoose,h as regenerator,d as regeneratorDefine,O as slicedToArray,g as toPrimitive,j as toPropertyKey,w as typeof,P as unsupportedIterableToArray};
@@ -0,0 +1 @@
1
+ import r from"react";var t=r.createContext({});export{t as FormContext};
@@ -0,0 +1 @@
1
+ import{objectWithoutProperties as e,slicedToArray as l,extends as r,toPropertyKey as t,objectSpread2 as n,defineProperty as a,typeof as o}from"./_virtual/_rollupPluginBabelHelpers.js";import"core-js/modules/es.array.for-each.js";import"core-js/modules/es.array.map.js";import"core-js/modules/es.function.name.js";import"core-js/modules/es.object.to-string.js";import"core-js/modules/web.dom-collections.for-each.js";import s from"react";import u from"classnames";import{View as i,Input as c}from"@tarojs/components";import{FormContext as m}from"./context.js";var f=["children","name","initialValue","label","getValueFromEvent","trigger","className","rules","dependencies","preserve"],p=function(p){var d=p.children,v=p.name,b=p.initialValue,j=p.label,y=p.getValueFromEvent,g=p.trigger,E=p.className,V=p.rules,h=p.dependencies,F=p.preserve,N=e(p,f),x=s.useContext(m),P=x.form,w=x.initialValues,A=s.useState(),C=l(A,2),R=C[0],S=C[1],_=s.useReducer(function(e){return e+1},0),B=l(_,2)[1],H=function(e){null==P||P.setFieldValue(v,y?y(e):"string"==typeof e||"number"==typeof e?e:null!=e&&e.detail&&"object"===o(e.detail)?e.detail.value:e)};s.useEffect(function(){function e(e){S(e)}if(v)return null==P||P.setRules(v,V||[]),null==P||P.subscribe(v,e),null==P||P.setFieldValue(v,b),null==P||P.registerField(v,b),function(){null==P||P.unsubscribe(v,e),null==P||P.unregisterField(v,F)}},[v]),s.useEffect(function(){if(null!=h&&h.length)return h.forEach(function(e){null==P||P.subscribe(e,B)}),function(){h.forEach(function(e){null==P||P.unsubscribe(e,B)})}},[h,P]);return s.createElement(i,r({className:u("yp-form-item-wrapper",E)},N),s.createElement(i,{className:"yp-form-item-label"},j),s.createElement(i,{className:"yp-form-item-children"},function(){var l,r=d;"function"==typeof d&&(r=d(P));var o=s.isValidElement(r)&&r.type===c,u=g||(o?"onInput":"onChange"),i=(null===(l=r)||void 0===l?void 0:l.props)||{},m=i[u],f=i.defaultValue;i.name;var p=i.value,j=e(i,[u,"defaultValue","name","value"].map(t));return s.isValidElement(r)?s.cloneElement(r,n(a(a({defaultValue:f||b||(v&&v in w?null==w?void 0:w[v]:""),name:v},u,function(){for(var e=arguments.length,l=new Array(e),r=0;r<e;r++)l[r]=arguments[r];null==m||m.apply(void 0,l),H.apply(void 0,l)}),"value",p||R),j||{})):r}()))};export{p as default};
@@ -0,0 +1 @@
1
+ import{createClass as e,classCallCheck as r,defineProperty as s,createForOfIteratorHelper as t,objectSpread2 as a,asyncToGenerator as i,regenerator as n}from"./_virtual/_rollupPluginBabelHelpers.js";import"core-js/modules/es.array.concat.js";import"core-js/modules/es.array.filter.js";import"core-js/modules/es.array.for-each.js";import"core-js/modules/es.array.from.js";import"core-js/modules/es.array.iterator.js";import"core-js/modules/es.array.reduce.js";import"core-js/modules/es.map.js";import"core-js/modules/es.object.keys.js";import"core-js/modules/es.object.to-string.js";import"core-js/modules/es.promise.js";import"core-js/modules/es.string.iterator.js";import"core-js/modules/es.string.trim.js";import"core-js/modules/web.dom-collections.for-each.js";import"core-js/modules/web.dom-collections.iterator.js";var l=function(){return e(function e(){var l=this;r(this,e),s(this,"fields",new Map),s(this,"value",{}),s(this,"rules",{}),s(this,"subscribers",{}),s(this,"changeHandlers",[]),s(this,"setRules",function(e,r){l.rules[e]=r}),s(this,"requireRuleValid",function(e,r){var s;"string"==typeof r&&e.whitespace&&(r=null===(s=r)||void 0===s?void 0:s.trim());return!(e.required&&!r)}),s(this,"getValue",function(){var e,r={},s=t(l.fields.keys());try{for(s.s();!(e=s.n()).done;){var a=e.value;r[a]=l.value[a]}}catch(e){s.e(e)}finally{s.f()}return r}),s(this,"validateFields",function(){var e=i(n().m(function e(r){var s,a,i,u,o,c,f,d,h,m,v,g,b,p,j;return n().w(function(e){for(;;)switch(e.p=e.n){case 0:s=null!=r&&r.length?r:Array.from(l.fields.keys()),a=t(s),e.p=1,a.s();case 2:if((i=a.n()).done){e.n=17;break}if(o=i.value,l.fields.has(o)){e.n=3;break}return e.a(3,16);case 3:c=l.rules[o]||[],f=null===(u=l.value)||void 0===u?void 0:u[o],d=t(c),e.p=4,d.s();case 5:if((h=d.n()).done){e.n=13;break}if(!(m=h.value).validator){e.n=9;break}return e.p=6,e.n=7,null==m||null===(v=m.validator)||void 0===v?void 0:v.call(m,m,null===(g=l.value)||void 0===g?void 0:g[o],l);case 7:e.n=9;break;case 8:return e.p=8,b=e.v,e.a(2,Promise.reject({message:m.message||b,field:o,rule:m}));case 9:if(e.p=9,l.requireRuleValid(m,f)){e.n=10;break}return e.a(2,Promise.reject({message:m.message,field:o,rule:m}));case 10:e.n=12;break;case 11:return e.p=11,e.v,e.a(2,Promise.reject({message:m.message,field:o,rule:m}));case 12:e.n=5;break;case 13:e.n=15;break;case 14:e.p=14,p=e.v,d.e(p);case 15:return e.p=15,d.f(),e.f(15);case 16:e.n=2;break;case 17:e.n=19;break;case 18:e.p=18,j=e.v,a.e(j);case 19:return e.p=19,a.f(),e.f(19);case 20:return e.a(2,Promise.resolve(l.getValue()))}},e,null,[[9,11],[6,8],[4,14,15,16],[1,18,19,20]])}));return function(r){return e.apply(this,arguments)}}()),s(this,"getFieldsValue",function(e){if(null!=e&&e.length){var r=l.getValue();return null==e?void 0:e.reduce(function(e,s){return e[s]=r[s],e},{})}return l.getValue()}),s(this,"setFieldsValue",function(e){for(var r,s={},t=a(a({},l.value),e),i=0;i<Object.keys(e).length;i++){var n=Object.keys(e)[i];l.fields.has(n)&&(l.value[n]!==e[n]&&(s[n]=e[n]),l.notify(n,t[n]))}l.value=t,null!==(r=Object.keys(s))&&void 0!==r&&r.length&&l.triggerChange(s,a({},l.value))}),s(this,"getFieldValue",function(e){return l.getValue()[e]}),s(this,"setFieldValue",function(e,r){var t=l.value[e];l.value[e]=r,t!==r&&l.triggerChange(s({},e,r),a(a({},l.value),{},s({},e,r))),l.notify(e,r)}),s(this,"subscribe",function(e,r){var s=l.subscribers[e]||[];l.subscribers[e]=s.concat(r)}),s(this,"registerField",function(e,r){l.fields.set(e,r)}),s(this,"unregisterField",function(e,r){r||l.fields.delete(e)}),s(this,"registerChangeHandler",function(e){l.changeHandlers.push(e)}),s(this,"unregisterChangeHandler",function(e){l.changeHandlers=l.changeHandlers.filter(function(r){return r!==e})}),s(this,"triggerChange",function(e,r){var s;null!==(s=l.changeHandlers)&&void 0!==s&&s.length&&l.changeHandlers.forEach(function(s){return s(e,r)})})},[{key:"unsubscribe",value:function(e,r){this.subscribers[e]&&(this.subscribers[e]=this.subscribers[e].filter(function(e){return e!==r}))}},{key:"notify",value:function(e,r){this.subscribers[e]&&this.subscribers[e].forEach(function(e){return e(r)})}}])}();export{l as default};
@@ -0,0 +1 @@
1
+ import{objectWithoutProperties as e,slicedToArray as r}from"./_virtual/_rollupPluginBabelHelpers.js";import t from"react";import{Form as o}from"@tarojs/components";import a from"./useForm.js";import i from"./useWatch.js";import{FormContext as n}from"./context.js";import s from"./formItem.js";var l=["form","children","initialValues","onValuesChange"],m=function(i){var s=i.form,m=i.children,u=i.initialValues,f=void 0===u?{}:u,c=i.onValuesChange,p=e(i,l),d=a(s),h=r(d,1)[0];return t.useEffect(function(){function e(e,r){c&&c(e,r)}return null==h||h.setFieldsValue(f),h.registerChangeHandler(e),function(){h.unregisterChangeHandler(e)}},[]),t.createElement(n.Provider,{value:{form:h,initialValues:f}},t.createElement(o,p,m))};m.useForm=a,m.useWatch=i,m.Item=s;export{m as default};
@@ -0,0 +1 @@
1
+ import r from"react";import e from"./fromStore.js";function t(t){var n=r.useRef(t||new e);return n.current||t===n.current||(n.current=t||n.current),[n.current]}export{t as default};
@@ -0,0 +1 @@
1
+ import{slicedToArray as e}from"./_virtual/_rollupPluginBabelHelpers.js";import r from"react";import{FormContext as t}from"./context.js";function o(o,u){var i,l=r.useContext(t).form,n=r.useState(null===(i=u||l)||void 0===i?void 0:i.getFieldValue(o)),a=e(n,2),s=a[0],f=a[1];return r.useEffect(function(){var e;null===(e=u||l)||void 0===e||e.subscribe(o,function(e){f(e)})},[u]),s}export{o as default};
@@ -0,0 +1 @@
1
+ function r(r,t){(null==t||t>r.length)&&(t=r.length);for(var e=0,n=Array(t);e<t;e++)n[e]=r[e];return n}function t(r){if(Array.isArray(r))return r}function e(r,t){var e=null==r?null:"undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(null!=e){var n,o,a,i,l=[],u=!0,f=!1;try{if(a=(e=e.call(r)).next,0===t){if(Object(e)!==e)return;u=!1}else for(;!(u=(n=a.call(e)).done)&&(l.push(n.value),l.length!==t);u=!0);}catch(r){f=!0,o=r}finally{try{if(!u&&null!=e.return&&(i=e.return(),Object(i)!==i))return}finally{if(f)throw o}}return l}}function n(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function o(r,t){if(null==r)return{};var e,n,o=a(r,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(r);for(n=0;n<i.length;n++)e=i[n],-1===t.indexOf(e)&&{}.propertyIsEnumerable.call(r,e)&&(o[e]=r[e])}return o}function a(r,t){if(null==r)return{};var e={};for(var n in r)if({}.hasOwnProperty.call(r,n)){if(-1!==t.indexOf(n))continue;e[n]=r[n]}return e}function i(r,o){return t(r)||e(r,o)||l(r,o)||n()}function l(t,e){if(t){if("string"==typeof t)return r(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(t,e):void 0}}export{r as arrayLikeToArray,t as arrayWithHoles,e as iterableToArrayLimit,n as nonIterableRest,o as objectWithoutProperties,a as objectWithoutPropertiesLoose,i as slicedToArray,l as unsupportedIterableToArray};
@@ -0,0 +1 @@
1
+ import{createContext as r}from"react";var o=r({});export{o as RadioGroupContext};
@@ -0,0 +1 @@
1
+ import{objectWithoutProperties as e,slicedToArray as a}from"./_virtual/_rollupPluginBabelHelpers.js";import o from"classnames";import r from"react";import{View as i}from"@tarojs/components";import{RadioGroupContext as l}from"./context.js";import t from"./radio-group.js";var n=["icon","disabled","children","onChange","className"],s=function(t){var s=t.icon,c=t.disabled,d=t.children,u=t.onChange,m=t.className,p=e(t,n),f=r.useContext(l),h=f.defaultValue,v=f.onRadioChange,b=f.value,y=f.disabled,g=r.useState(h===p.value),j=a(g,2),C=j[0],k=j[1];return r.useEffect(function(){"checked"in p?k(p.checked||!1):v&&k(b===p.value)},[p,b,v]),r.createElement(i,{onClick:function(){C||c||y||(C||(u&&u(p.value),v&&v(p.value)),k(!0))},className:o("yp-radio",{"yp-radio--icon":s,"yp-radio--checked":C,"yp-radio--disabled":c||y},m)},s?null:d,null==s?void 0:s(C))};s.Group=t,s.displayName="Radio";export{s as default};
@@ -0,0 +1 @@
1
+ import{objectWithoutProperties as e,slicedToArray as a}from"./_virtual/_rollupPluginBabelHelpers.js";import r from"react";import o from"classnames";import{View as l}from"@tarojs/components";import{RadioGroupContext as t}from"./context.js";var i=["defaultValue","children","onChange","className","disabled"],s=function(s){var u=s.defaultValue,n=s.children,d=s.onChange,m=s.className,c=s.disabled,p=e(s,i),f=r.useState(u),v=a(f,2),b=v[0],g=v[1];return r.useEffect(function(){"value"in p&&g(p.value)},[p]),r.createElement(t.Provider,{value:{value:b,onRadioChange:function(e){e!==b&&d&&d(e),g(e)},disabled:c,defaultValue:u}},r.createElement(l,{className:o("yp-radio-group",{"yp-radio-group-disabled":c},m)},n))};s.displayName="RadioGroup";export{s as default};
Binary file
Binary file
Binary file