@tarojs/components 3.6.22-nightly.8 → 3.6.22-nightly.9

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 (45) hide show
  1. package/dist/cjs/loader.cjs.js +1 -1
  2. package/dist/cjs/taro-components.cjs.js +1 -1
  3. package/dist/cjs/taro-swiper-core_2.cjs.entry.js +4 -2
  4. package/dist/cjs/taro-switch-core.cjs.entry.js +11 -10
  5. package/dist/cjs/taro-textarea-core.cjs.entry.js +10 -1
  6. package/dist/collection/components/swiper/swiper.js +4 -2
  7. package/dist/collection/components/switch/switch.js +12 -12
  8. package/dist/collection/components/textarea/textarea.js +11 -0
  9. package/dist/components/taro-swiper-core.js +4 -2
  10. package/dist/components/taro-switch-core.js +12 -12
  11. package/dist/components/taro-textarea-core.js +10 -1
  12. package/dist/esm/loader.js +1 -1
  13. package/dist/esm/taro-components.js +1 -1
  14. package/dist/esm/taro-swiper-core_2.entry.js +4 -2
  15. package/dist/esm/taro-switch-core.entry.js +11 -10
  16. package/dist/esm/taro-textarea-core.entry.js +10 -1
  17. package/dist/esm-es5/loader.js +1 -1
  18. package/dist/esm-es5/taro-components.js +1 -1
  19. package/dist/esm-es5/taro-swiper-core_2.entry.js +1 -1
  20. package/dist/esm-es5/taro-switch-core.entry.js +1 -1
  21. package/dist/esm-es5/taro-textarea-core.entry.js +1 -1
  22. package/dist/taro-components/p-35cca0f9.entry.js +1 -0
  23. package/dist/taro-components/p-61cb688a.entry.js +1 -0
  24. package/dist/taro-components/p-67ff5a50.system.entry.js +1 -0
  25. package/dist/taro-components/p-74129eac.entry.js +1 -0
  26. package/dist/taro-components/{p-fbd33d55.system.entry.js → p-92daad3f.system.entry.js} +1 -1
  27. package/dist/taro-components/{p-170ce205.system.entry.js → p-96d3e67b.system.entry.js} +1 -1
  28. package/dist/taro-components/p-a972aa1d.system.js +1 -1
  29. package/dist/taro-components/taro-components.esm.js +1 -1
  30. package/dist/types/components/switch/switch.d.ts +3 -3
  31. package/dist/types/components/textarea/textarea.d.ts +1 -0
  32. package/lib/react/react-component-lib/createComponent.js +2 -1
  33. package/lib/react/react-component-lib/createComponent.js.map +1 -1
  34. package/lib/react/react-component-lib/utils/attachProps.d.ts +16 -7
  35. package/lib/react/react-component-lib/utils/attachProps.js +85 -9
  36. package/lib/react/react-component-lib/utils/attachProps.js.map +1 -1
  37. package/lib/react/react-component-lib/utils/index.js +1 -1
  38. package/package.json +4 -4
  39. package/types/Checkbox.d.ts +0 -4
  40. package/types/Picker.d.ts +13 -1
  41. package/types/Radio.d.ts +0 -4
  42. package/dist/taro-components/p-4408d796.entry.js +0 -1
  43. package/dist/taro-components/p-59187d48.entry.js +0 -1
  44. package/dist/taro-components/p-76f3547f.system.entry.js +0 -1
  45. package/dist/taro-components/p-9253a23b.entry.js +0 -1
@@ -1,3 +1,4 @@
1
+ import { flushSync, unstable_batchedUpdates } from 'react-dom';
1
2
  import { camelToDashCase } from './case.js';
2
3
 
3
4
  /**
@@ -35,20 +36,73 @@ const getClassName = (classList, newProps, oldProps) => {
35
36
  };
36
37
  // Note(taro): 禁用 react 合成事件抛出 (避免自定义事件属性调用问题, 例如: event.detail.value 等)
37
38
  const isCoveredByReact = (__eventNameSuffix) => false;
39
+ function getComponentName(node) {
40
+ return node.tagName.replace(/^TARO-/, '').replace(/-CORE$/, '');
41
+ }
42
+ function getControlledValue(node) {
43
+ const componentName = getComponentName(node);
44
+ if (['INPUT', 'TEXTAREA', 'SLIDER', 'PICKER'].includes(componentName)) {
45
+ return 'value';
46
+ }
47
+ else if (componentName === 'SWITCH') {
48
+ // Radio、Checkbox 受 RadioGroup、CheckboxGroup 控制,不支持受控
49
+ return 'checked';
50
+ }
51
+ else {
52
+ return null;
53
+ }
54
+ }
55
+ function getPropsAfterReactUpdate(node) {
56
+ const key = Object.keys(node).find(key => key.includes('__reactProps'));
57
+ if (key) {
58
+ return node[key];
59
+ }
60
+ else {
61
+ return null;
62
+ }
63
+ }
64
+ function finishedEventHandler(node) {
65
+ const controlledValue = getControlledValue(node);
66
+ // 不是可以受控的表单组件,直接返回
67
+ if (!controlledValue)
68
+ return;
69
+ // 立即执行事件回调中用户可能触发了的 React 更新
70
+ flushSync();
71
+ // 组件在 React 更新后的 React props
72
+ const newProps = getPropsAfterReactUpdate(node);
73
+ if ((newProps === null || newProps === void 0 ? void 0 : newProps.hasOwnProperty(controlledValue)) && newProps[controlledValue] !== node[controlledValue]) {
74
+ // 如果 React Props 的 value 和 DOM 上的 value 不一致,以 React Props 为准(受控)
75
+ node[controlledValue] = newProps[controlledValue];
76
+ node.setAttribute(controlledValue, newProps[controlledValue]);
77
+ }
78
+ }
38
79
  const syncEvent = (node, eventName, newEventHandler) => {
39
80
  const eventStore = node.__events || (node.__events = {});
40
81
  const oldEventHandler = eventStore[eventName];
41
- // Remove old listener so they don't double up.
42
- if (oldEventHandler) {
82
+ if (!newEventHandler && oldEventHandler) {
43
83
  node.removeEventListener(eventName, oldEventHandler);
44
84
  }
45
- // Bind new listener.
46
- node.addEventListener(eventName, (eventStore[eventName] = function handler(e) {
47
- if (newEventHandler) {
48
- newEventHandler.call(this, e);
85
+ else {
86
+ if (oldEventHandler) {
87
+ if (oldEventHandler.fn === newEventHandler) {
88
+ return;
89
+ }
90
+ else {
91
+ // 删除旧的,绑定新的
92
+ node.removeEventListener(eventName, oldEventHandler);
93
+ }
49
94
  }
50
- }));
95
+ const listener = eventStore[eventName] = function (e) {
96
+ // React batch event updates
97
+ unstable_batchedUpdates(() => newEventHandler.call(this, e));
98
+ // 控制是否更新受控组件的 value 值
99
+ finishedEventHandler(node);
100
+ };
101
+ listener.fn = newEventHandler;
102
+ node.addEventListener(eventName, listener);
103
+ }
51
104
  };
105
+ // TODO(performace): ReactComponent 已更新了一次,这里手动更新可能存在重复设置属性的问题
52
106
  const attachProps = (node, newProps, oldProps = {}) => {
53
107
  // some test frameworks don't render DOM elements, so we test here to make sure we are dealing with DOM first
54
108
  if (node instanceof Element) {
@@ -62,7 +116,7 @@ const attachProps = (node, newProps, oldProps = {}) => {
62
116
  const eventName = name.substring(2);
63
117
  const eventNameLc = eventName.toLowerCase();
64
118
  if (!isCoveredByReact(eventNameLc)) {
65
- syncEvent(node, eventNameLc, undefined);
119
+ syncEvent(node, eventNameLc);
66
120
  }
67
121
  }
68
122
  else {
@@ -96,8 +150,30 @@ const attachProps = (node, newProps, oldProps = {}) => {
96
150
  }
97
151
  }
98
152
  });
153
+ // 保证受控组件会被默认绑定一个空事件,用于触发 finishedEventHandler 中的受控逻辑
154
+ const controlledValue = getControlledValue(node);
155
+ if (controlledValue &&
156
+ newProps.hasOwnProperty(controlledValue)) {
157
+ const handleChangeEvent = ['INPUT', 'TEXTAREA'].includes(getComponentName(node)) ? 'input' : 'change';
158
+ node.__events || (node.__events = {});
159
+ if (!node.__events.hasOwnProperty(handleChangeEvent)) {
160
+ syncEvent(node, handleChangeEvent, function () { });
161
+ }
162
+ }
99
163
  }
100
164
  };
165
+ function applyUnControlledDefaultValue(node, props) {
166
+ const controlledValue = getControlledValue(node);
167
+ // 不是可以受控的表单组件,直接返回
168
+ if (!controlledValue)
169
+ return;
170
+ const defaultValueName = 'default' + controlledValue.charAt(0).toUpperCase() + controlledValue.slice(1);
171
+ if (!props.hasOwnProperty(controlledValue) && props.hasOwnProperty(defaultValueName)) {
172
+ // 如果是可以受控的表单组件,当没有传入 value/checked 而是传入 defaultValue/defaultChecked 时,把表单值初始化为 defaultValue/defaultChecked
173
+ node[controlledValue] = props[defaultValueName];
174
+ node.setAttribute(controlledValue, props[defaultValueName]);
175
+ }
176
+ }
101
177
 
102
- export { attachProps, getClassName, isCoveredByReact, syncEvent };
178
+ export { applyUnControlledDefaultValue, attachProps, getClassName, isCoveredByReact, syncEvent };
103
179
  //# sourceMappingURL=attachProps.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"attachProps.js","sources":["../../../../../taro-components-library-react/src/react-component-lib/utils/attachProps.ts"],"sourcesContent":["/**\n * Modify from https://github.com/ionic-team/stencil-ds-output-targets/blob/main/packages/react-output-target/react-component-lib/utils/attachProps.ts\n * MIT License https://github.com/ionic-team/stencil-ds-output-targets/blob/main/LICENSE\n */\nimport { camelToDashCase } from './case'\n\nconst arrayToMap = (arr: string[] | DOMTokenList) => {\n const map = new Map<string, string>();\n (arr as string[]).forEach((s: string) => map.set(s, s))\n return map\n}\n\nexport const getClassName = (classList: DOMTokenList, newProps: any, oldProps: any) => {\n const newClassProp: string = newProps.className || newProps.class\n const oldClassProp: string = oldProps.className || oldProps.class\n // map the classes to Maps for performance\n const currentClasses = arrayToMap(classList)\n const incomingPropClasses = arrayToMap(newClassProp ? newClassProp.split(' ') : [])\n const oldPropClasses = arrayToMap(oldClassProp ? oldClassProp.split(' ') : [])\n const finalClassNames: string[] = []\n // loop through each of the current classes on the component\n // to see if it should be a part of the classNames added\n currentClasses.forEach((currentClass) => {\n if (incomingPropClasses.has(currentClass)) {\n // add it as its already included in classnames coming in from newProps\n finalClassNames.push(currentClass)\n incomingPropClasses.delete(currentClass)\n } else if (!oldPropClasses.has(currentClass)) {\n // add it as it has NOT been removed by user\n finalClassNames.push(currentClass)\n }\n })\n incomingPropClasses.forEach((s) => finalClassNames.push(s))\n return finalClassNames.join(' ')\n}\n\n// Note(taro): 禁用 react 合成事件抛出 (避免自定义事件属性调用问题, 例如: event.detail.value 等)\nexport const isCoveredByReact = (__eventNameSuffix: string) => false\n\nexport const syncEvent = (\n node: Element & { __events?: { [key: string]: ((e: Event) => any) | undefined } },\n eventName: string,\n newEventHandler?: (e: Event) => any\n) => {\n const eventStore = node.__events || (node.__events = {})\n const oldEventHandler = eventStore[eventName]\n\n // Remove old listener so they don't double up.\n if (oldEventHandler) {\n node.removeEventListener(eventName, oldEventHandler)\n }\n\n // Bind new listener.\n node.addEventListener(\n eventName,\n (eventStore[eventName] = function handler (e: Event) {\n if (newEventHandler) {\n newEventHandler.call(this, e)\n }\n })\n )\n}\n\nexport const attachProps = (node: HTMLElement, newProps: any, oldProps: any = {}) => {\n // some test frameworks don't render DOM elements, so we test here to make sure we are dealing with DOM first\n if (node instanceof Element) {\n Object.keys(oldProps).forEach((name) => {\n if (['style', 'children', 'ref', 'class', 'className', 'forwardedRef'].includes(name)) {\n return\n }\n // Note: 移除节点上冗余事件、属性\n if (!newProps.hasOwnProperty(name)) {\n if (/^on([A-Z].*)/.test(name)) {\n const eventName = name.substring(2)\n const eventNameLc = eventName.toLowerCase()\n\n if (!isCoveredByReact(eventNameLc)) {\n syncEvent(node, eventNameLc, undefined)\n }\n } else {\n (node as any)[name] = null\n node.removeAttribute(camelToDashCase(name))\n }\n }\n })\n // add any classes in className to the class list\n node.className = getClassName(node.classList, newProps, oldProps)\n\n Object.keys(newProps).forEach((name) => {\n /** Note(taro): 优化 style 属性的处理\n * 1. 考虑到兼容旧版本项目,支持使用字符串配置 style 属性,但这并非推荐写法,且不考虑优化在 style 移除时同步删除属性\n * 2. style 属性应当交与前端 UI 框架自行处理,不考虑实现类似于 reactify-wc 的更新策略\n */\n if ((name === 'style' && typeof newProps[name] !== 'string') || ['children', 'ref', 'class', 'className', 'forwardedRef'].includes(name)) {\n return\n }\n if (/^on([A-Z].*)/.test(name)) {\n const eventName = name.substring(2)\n const eventNameLc = eventName.toLowerCase()\n\n if (!isCoveredByReact(eventNameLc)) {\n syncEvent(node, eventNameLc, newProps[name])\n }\n } else {\n (node as any)[name] = newProps[name]\n const propType = typeof newProps[name]\n if (propType === 'string') {\n node.setAttribute(camelToDashCase(name), newProps[name])\n }\n }\n })\n }\n}\n"],"names":[],"mappings":";;AAAA;;;AAGG;AAGH,MAAM,UAAU,GAAG,CAAC,GAA4B,KAAI;AAClD,IAAA,MAAM,GAAG,GAAG,IAAI,GAAG,EAAkB,CAAC;AACrC,IAAA,GAAgB,CAAC,OAAO,CAAC,CAAC,CAAS,KAAK,GAAG,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAA;AACvD,IAAA,OAAO,GAAG,CAAA;AACZ,CA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AQ,EAAE;AACzB,oBAAA,IAAI,CAAC,YAAY,CAAC,eAAe,CAAC,IAAI,CAAC,EAAE,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAA;AACzD,iBAAA;AACF,aAAA;AACH,SAAC,CAAC,CAAA;AACH,KAAA;AACH;;;;"}
1
+ {"version":3,"file":"attachProps.js","sources":["../../../../../taro-components-library-react/src/react-component-lib/utils/attachProps.ts"],"sourcesContent":["/**\n * Modify from https://github.com/ionic-team/stencil-ds-output-targets/blob/main/packages/react-output-target/react-component-lib/utils/attachProps.ts\n * MIT License https://github.com/ionic-team/stencil-ds-output-targets/blob/main/LICENSE\n */\nimport { flushSync, unstable_batchedUpdates } from 'react-dom'\n\nimport { camelToDashCase } from './case'\n\nconst arrayToMap = (arr: string[] | DOMTokenList) => {\n const map = new Map<string, string>();\n (arr as string[]).forEach((s: string) => map.set(s, s))\n return map\n}\n\nexport const getClassName = (classList: DOMTokenList, newProps: any, oldProps: any) => {\n const newClassProp: string = newProps.className || newProps.class\n const oldClassProp: string = oldProps.className || oldProps.class\n // map the classes to Maps for performance\n const currentClasses = arrayToMap(classList)\n const incomingPropClasses = arrayToMap(newClassProp ? newClassProp.split(' ') : [])\n const oldPropClasses = arrayToMap(oldClassProp ? oldClassProp.split(' ') : [])\n const finalClassNames: string[] = []\n // loop through each of the current classes on the component\n // to see if it should be a part of the classNames added\n currentClasses.forEach((currentClass) => {\n if (incomingPropClasses.has(currentClass)) {\n // add it as its already included in classnames coming in from newProps\n finalClassNames.push(currentClass)\n incomingPropClasses.delete(currentClass)\n } else if (!oldPropClasses.has(currentClass)) {\n // add it as it has NOT been removed by user\n finalClassNames.push(currentClass)\n }\n })\n incomingPropClasses.forEach((s) => finalClassNames.push(s))\n return finalClassNames.join(' ')\n}\n\n// Note(taro): 禁用 react 合成事件抛出 (避免自定义事件属性调用问题, 例如: event.detail.value 等)\nexport const isCoveredByReact = (__eventNameSuffix: string) => false\n\ninterface EventCenter {\n [key: string]: EventCenter.EventCallback | undefined\n}\n\nnamespace EventCenter {\n export interface EventCallback {\n (e: Event): any\n fn?: (e: Event) => any\n }\n}\n\ntype HTMLElementWithEvents = HTMLElement & { __events?: EventCenter }\n\nfunction getComponentName (node: HTMLElement): string {\n return node.tagName.replace(/^TARO-/, '').replace(/-CORE$/, '')\n}\n\nfunction getControlledValue (node: HTMLElement): string | null {\n const componentName = getComponentName(node)\n if (['INPUT', 'TEXTAREA', 'SLIDER', 'PICKER'].includes(componentName)) {\n return 'value'\n } else if (componentName === 'SWITCH') {\n // Radio、Checkbox 受 RadioGroup、CheckboxGroup 控制,不支持受控\n return 'checked'\n } else {\n return null\n }\n}\n\nfunction getPropsAfterReactUpdate (node: HTMLElement): Record<string, any> | null {\n const key = Object.keys(node).find(key => key.includes('__reactProps'))\n if (key) {\n return node[key] as Record<string, any>\n } else {\n return null\n }\n}\n\nfunction finishedEventHandler (node: HTMLElement) {\n const controlledValue = getControlledValue(node)\n\n // 不是可以受控的表单组件,直接返回\n if (!controlledValue) return\n\n // 立即执行事件回调中用户可能触发了的 React 更新\n flushSync()\n\n // 组件在 React 更新后的 React props\n const newProps = getPropsAfterReactUpdate(node)\n if (newProps?.hasOwnProperty(controlledValue) && newProps[controlledValue] !== node[controlledValue]) {\n // 如果 React Props 的 value 和 DOM 上的 value 不一致,以 React Props 为准(受控)\n node[controlledValue] = newProps[controlledValue]\n node.setAttribute(controlledValue, newProps[controlledValue])\n }\n}\n\nexport const syncEvent = (\n node: HTMLElementWithEvents,\n eventName: string,\n newEventHandler?: (e: Event) => any\n) => {\n const eventStore = node.__events ||= {}\n const oldEventHandler = eventStore[eventName]\n\n if (!newEventHandler && oldEventHandler) {\n node.removeEventListener(eventName, oldEventHandler)\n } else {\n if (oldEventHandler) {\n if (oldEventHandler.fn === newEventHandler) {\n return\n } else {\n // 删除旧的,绑定新的\n node.removeEventListener(eventName, oldEventHandler)\n }\n }\n\n const listener: EventCenter.EventCallback = eventStore[eventName] = function (e: Event) {\n // React batch event updates\n unstable_batchedUpdates(() => newEventHandler.call(this, e))\n // 控制是否更新受控组件的 value 值\n finishedEventHandler(node)\n }\n listener.fn = newEventHandler\n node.addEventListener(\n eventName,\n listener\n )\n }\n}\n\n// TODO(performace): ReactComponent 已更新了一次,这里手动更新可能存在重复设置属性的问题\nexport const attachProps = (node: HTMLElementWithEvents, newProps: any, oldProps: any = {}) => {\n // some test frameworks don't render DOM elements, so we test here to make sure we are dealing with DOM first\n if (node instanceof Element) {\n Object.keys(oldProps).forEach((name) => {\n if (['style', 'children', 'ref', 'class', 'className', 'forwardedRef'].includes(name)) {\n return\n }\n // Note: 移除节点上冗余事件、属性\n if (!newProps.hasOwnProperty(name)) {\n if (/^on([A-Z].*)/.test(name)) {\n const eventName = name.substring(2)\n const eventNameLc = eventName.toLowerCase()\n\n if (!isCoveredByReact(eventNameLc)) {\n syncEvent(node, eventNameLc)\n }\n } else {\n (node as any)[name] = null\n node.removeAttribute(camelToDashCase(name))\n }\n }\n })\n // add any classes in className to the class list\n node.className = getClassName(node.classList, newProps, oldProps)\n\n Object.keys(newProps).forEach((name) => {\n /** Note(taro): 优化 style 属性的处理\n * 1. 考虑到兼容旧版本项目,支持使用字符串配置 style 属性,但这并非推荐写法,且不考虑优化在 style 移除时同步删除属性\n * 2. style 属性应当交与前端 UI 框架自行处理,不考虑实现类似于 reactify-wc 的更新策略\n */\n if ((name === 'style' && typeof newProps[name] !== 'string') || ['children', 'ref', 'class', 'className', 'forwardedRef'].includes(name)) {\n return\n }\n if (/^on([A-Z].*)/.test(name)) {\n const eventName = name.substring(2)\n const eventNameLc = eventName.toLowerCase()\n\n if (!isCoveredByReact(eventNameLc)) {\n syncEvent(node, eventNameLc, newProps[name])\n }\n } else {\n (node as any)[name] = newProps[name]\n const propType = typeof newProps[name]\n if (propType === 'string') {\n node.setAttribute(camelToDashCase(name), newProps[name])\n }\n }\n })\n\n // 保证受控组件会被默认绑定一个空事件,用于触发 finishedEventHandler 中的受控逻辑\n const controlledValue = getControlledValue(node)\n if (\n controlledValue &&\n newProps.hasOwnProperty(controlledValue)\n ) {\n const handleChangeEvent = ['INPUT', 'TEXTAREA'].includes(getComponentName(node)) ? 'input' : 'change'\n node.__events ||= {}\n if (!node.__events.hasOwnProperty(handleChangeEvent)) {\n syncEvent(node, handleChangeEvent, function () {})\n }\n }\n }\n}\n\nexport function applyUnControlledDefaultValue (node: HTMLElementWithEvents, props: any) {\n const controlledValue = getControlledValue(node)\n\n // 不是可以受控的表单组件,直接返回\n if (!controlledValue) return\n\n const defaultValueName = 'default' + controlledValue.charAt(0).toUpperCase() + controlledValue.slice(1)\n if (!props.hasOwnProperty(controlledValue) && props.hasOwnProperty(defaultValueName)) {\n // 如果是可以受控的表单组件,当没有传入 value/checked 而是传入 defaultValue/defaultChecked 时,把表单值初始化为 defaultValue/defaultChecked\n node[controlledValue] = props[defaultValueName]\n node.setAttribute(controlledValue, props[defaultValueName])\n }\n}\n"],"names":[],"mappings":";;;AAAA;;;AAGG;AAKH,MAAM,UAAU,GAAG,CAAC,GAA4B,KAAI;AAClD,IAAA,MAAM,GAAG,GAAG,IAAI,GAAG,EAAkB,CAAC;AACrC,IAAA,GAAgB,CAAC,OAAO,CAAC,CAAC,CAAS,KAAK,GAAG,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAA;AACvD,IAAA,OAAO,GAAG,CAAA;AACZ,CAAC,CAAA;AAEY,MAAA,YAAY,GAAG,CAAC,SAAuB,EAAE,QAAa,EAAE,QAAa,KAAI;IACpF,MAAM,YAAY,GAAW,QAAQ,CAAC,SAAS,IAAI,QAAQ,CAAC,KAAK,CAAA;IACjE,MAAM,YAAY,GAAW,QAAQ,CAAC,SAAS,IAAI,QAAQ,CAAC,KAAK,CAAA;;AAEjE,IAAA,MAAM,cAAc,GAAG,UAAU,CAAC,SAAS,CAAC,CAAA;AAC5C,IAAA,MAAM,mBAAmB,GAAG,UAAU,CAAC,YAAY,GAAG,YAAY,CAAC,KAAK,CAAC,GA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CAAC,CAAC,CAAC,CAAA;AACvG,IAAA,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,eAAe,CAAC,IAAI,KAAK,CAAC,cAAc,CAAC,gBAAgB,CAAC,EAAE;;QAEpF,IAAI,CAAC,eAAe,CAAC,GAAG,KAAK,CAAC,gBAAgB,CAAC,CAAA;QAC/C,IAAI,CAAC,YAAY,CAAC,eAAe,EAAE,KAAK,CAAC,gBAAgB,CAAC,CAAC,CAAA;AAC5D,KAAA;AACH;;;;"}
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- export { attachProps, getClassName, isCoveredByReact, syncEvent } from './attachProps.js';
2
+ export { applyUnControlledDefaultValue, attachProps, getClassName, isCoveredByReact, syncEvent } from './attachProps.js';
3
3
  export { camelToDashCase, dashToPascalCase } from './case.js';
4
4
 
5
5
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tarojs/components",
3
- "version": "3.6.22-nightly.8",
3
+ "version": "3.6.22-nightly.9",
4
4
  "description": "Taro 组件库",
5
5
  "browser": "dist/index.js",
6
6
  "main:h5": "dist/index.js",
@@ -36,8 +36,8 @@
36
36
  "resolve-pathname": "^3.0.0",
37
37
  "tslib": "^2.6.2",
38
38
  "swiper": "6.8.0",
39
- "@tarojs/components-advanced": "3.6.22-nightly.8",
40
- "@tarojs/taro": "3.6.22-nightly.8"
39
+ "@tarojs/components-advanced": "3.6.22-nightly.9",
40
+ "@tarojs/taro": "3.6.22-nightly.9"
41
41
  },
42
42
  "devDependencies": {
43
43
  "@babel/generator": "^7.20.0",
@@ -89,7 +89,7 @@
89
89
  "generate:stencil-config": "esbuild ./scripts/stencil/stencil.config.ts --external:lightningcss --bundle --platform=node --outfile=stencil.config.js",
90
90
  "sync:types": "pnpm run tsx --files scripts/json-schema-to-types.ts",
91
91
  "test": "cross-env NODE_ENV=test stencil test --spec --e2e",
92
- "test:ci": "pnpm test -- --ci --no-build",
92
+ "test:ci": "pnpm test -- --ci -i --coverage --silent --no-build",
93
93
  "test:coverage": "pnpm test -- --ci --screenshot --coverage",
94
94
  "test:watch": "pnpm test -- --screenshot --watch",
95
95
  "tsx": "ts-node --skipIgnore"
@@ -15,10 +15,6 @@ interface CheckboxProps extends StandardProps {
15
15
  * @default false
16
16
  */
17
17
  checked?: boolean
18
- /** 设置在 React 非受控状态下,当前是否选中
19
- * @supported weapp, alipay, swan, tt, qq, jd, h5, rn
20
- */
21
- defaultChecked?: boolean
22
18
  /** checkbox的颜色,同 css 的 color
23
19
  * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid
24
20
  */
package/types/Picker.d.ts CHANGED
@@ -158,7 +158,11 @@ interface PickerTimeProps extends PickerStandardProps {
158
158
  * value 的值表示选择了 range 中的第几个(下标从 0 开始)
159
159
  * @supported weapp, h5, rn, harmony_hybrid
160
160
  */
161
- value: string
161
+ value?: string
162
+ /** 设置 React 非受控状态下的初始取值
163
+ * @supported weapp, h5, rn
164
+ */
165
+ defaultValue?: string
162
166
  /**
163
167
  * 仅当 mode 为 "time" 或 "date" 时有效,表示有效时间范围的开始,字符串格式为"hh:mm"
164
168
  * @supported weapp, h5, rn, harmony_hybrid
@@ -191,6 +195,10 @@ interface PickerDateProps extends PickerStandardProps {
191
195
  * @default 0
192
196
  */
193
197
  value: string
198
+ /** 设置 React 非受控状态下的初始取值
199
+ * @supported weapp, h5, rn
200
+ */
201
+ defaultValue?: string
194
202
  /**
195
203
  * 仅当 mode 为 "time" 或 "date" 时有效,表示有效时间范围的开始,字符串格式为"YYYY-MM-DD"
196
204
  * @supported weapp, h5, rn, harmony_hybrid
@@ -237,6 +245,10 @@ interface PickerRegionProps extends PickerStandardProps {
237
245
  * @default []
238
246
  */
239
247
  value?: string[]
248
+ /** 设置 React 非受控状态下的初始取值
249
+ * @supported weapp, h5, rn
250
+ */
251
+ defaultValue?: string[]
240
252
  /**
241
253
  * 可为每一列的顶部添加一个自定义的项
242
254
  * @supported weapp, h5, rn, harmony_hybrid
package/types/Radio.d.ts CHANGED
@@ -10,10 +10,6 @@ interface RadioProps extends StandardProps {
10
10
  * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid
11
11
  */
12
12
  checked?: boolean
13
- /** 设置在 React 非受控状态下,当前是否选中
14
- * @supported weapp, alipay, swan, tt, qq, jd, h5, rn
15
- */
16
- defaultChecked?: boolean
17
13
  /** 是否禁用
18
14
  * @default false
19
15
  * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid
@@ -1 +0,0 @@
1
- import{r as i,c as e,h as t,H as r,g as n}from"./p-98b1fc13.js";import{c as s}from"./p-de951a46.js";import o from"swiper/swiper-bundle.esm.js";import{d as a}from"./p-d3c7f87d.js";var p,A,w=function(i,e,t,r){if("a"===t&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?i!==e||!r:!e.has(i))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===t?r:"a"===t?r.call(i):r?r.value:e.get(i)},l=function(i,e,t,r,n){if("m"===r)throw new TypeError("Private method is not writable");if("a"===r&&!n)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?i!==e||!n:!e.has(i))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?n.call(i,t):n?n.value=t:e.set(i,t),t};let c=0;const d=class{constructor(t){i(this,t),this.onChange=e(this,"change",7),this.onAnimationFinish=e(this,"animationfinish",7),p.set(this,c++),A.set(this,""),this.handleSwiperLoopListen=()=>{var i,e,t;(null===(i=this.observerFirst)||void 0===i?void 0:i.disconnect)&&this.observerFirst.disconnect(),(null===(e=this.observerLast)||void 0===e?void 0:e.disconnect)&&this.observerLast.disconnect(),this.observerFirst=new MutationObserver(this.handleSwiperLoopDebounce),this.observerLast=new MutationObserver(this.handleSwiperLoopDebounce);const r=(null===(t=this.swiper.$wrapperEl)||void 0===t?void 0:t[0]).querySelectorAll("taro-swiper-item-core:not(.swiper-slide-duplicate)");r.length>=1?this.observerFirst.observe(r[0],{characterData:!0}):r.length>=2&&this.observerLast.observe(r[r.length-1],{characterData:!0})},this.handleSwiperLoop=()=>{var i,e,t,r;if(!this.swiper||!this.circular)return;const n=this.swiper;((null===(i=this.swiperWrapper)||void 0===i?void 0:i.querySelectorAll(".swiper-slide-duplicate"))||[]).length<2?(null===(e=n.loopDestroy)||void 0===e||e.call(n),null===(t=n.loopCreate)||void 0===t||t.call(n)):null===(r=n.loopFix)||void 0===r||r.call(n)},this.handleSwiperLoopDebounce=a(this.handleSwiperLoop,50),this.handleSwiperSizeDebounce=a((()=>{this.swiper&&!this.circular&&this.swiper.updateSlides()}),50),this.swiperWrapper=void 0,this.swiper=void 0,this.isWillLoadCalled=!1,this.indicatorDots=!1,this.indicatorColor="rgba(0, 0, 0, .3)",this.indicatorActiveColor="#000000",this.autoplay=!1,this.current=0,this.interval=5e3,this.duration=500,this.circular=!1,this.vertical=!1,this.previousMargin="0px",this.nextMargin="0px",this.displayMultipleItems=1,this.full=!1,this.zoom=!1,this.observer=void 0,this.observerFirst=void 0,this.observerLast=void 0}watchCurrent(i){if(!this.isWillLoadCalled)return;const e=parseInt(i,10);isNaN(e)||(this.circular?this.swiper.isBeginning||this.swiper.isEnd||this.swiper.slideToLoop(e):this.swiper.slideTo(e))}watchAutoplay(i){if(!this.isWillLoadCalled||!this.swiper)return;const e=this.swiper.autoplay;if(e){if(e.running===i)return;i?(this.swiper.params&&"object"==typeof this.swiper.params.autoplay&&(!0===this.swiper.params.autoplay.disableOnInteraction&&(this.swiper.params.autoplay.disableOnInteraction=!1),this.swiper.params.autoplay.delay=this.interval),e.start()):e.stop()}}watchDuration(i){this.isWillLoadCalled&&(this.swiper.params.speed=i)}watchInterval(i){this.isWillLoadCalled&&"object"==typeof this.swiper.params.autoplay&&(this.swiper.params.autoplay.delay=i)}watchSwiperWrapper(i){this.isWillLoadCalled&&i&&(this.el.appendChild=e=>i.appendChild(e),this.el.insertBefore=(e,t)=>i.insertBefore(e,t),this.el.replaceChild=(e,t)=>i.replaceChild(e,t),this.el.removeChild=e=>i.removeChild(e),this.el.addEventListener("DOMNodeInserted",this.handleSwiperSizeDebounce),this.el.addEventListener("DOMNodeRemoved",this.handleSwiperSizeDebounce),this.el.addEventListener("MutationObserver",this.handleSwiperSizeDebounce))}watchCircular(){this.swiper&&(this.swiper.destroy(),this.handleInit())}watchDisplayMultipleItems(){this.swiper&&(this.swiper.destroy(),this.handleInit())}componentWillLoad(){this.isWillLoadCalled=!0}componentDidLoad(){var i;if(this.handleInit(),!this.swiper||!this.circular)return;const e=null===(i=this.swiper.$wrapperEl)||void 0===i?void 0:i[0];this.observer=new MutationObserver(this.handleSwiperLoopListen),this.observer.observe(e,{childList:!0})}componentWillUpdate(){var i,e;this.swiper&&(this.autoplay&&!(null===(i=this.swiper.autoplay)||void 0===i?void 0:i.running)&&(null===(e=this.swiper.autoplay)||void 0===e||e.start()),this.swiper.update())}componentDidRender(){this.handleSwiperLoop()}disconnectedCallback(){var i,e,t,r,n,s;this.el.removeEventListener("DOMNodeInserted",this.handleSwiperSizeDebounce),this.el.removeEventListener("DOMNodeRemoved",this.handleSwiperSizeDebounce),this.el.removeEventListener("MutationObserver",this.handleSwiperSizeDebounce),null===(e=null===(i=this.observer)||void 0===i?void 0:i.disconnect)||void 0===e||e.call(i),null===(r=null===(t=this.observerFirst)||void 0===t?void 0:t.disconnect)||void 0===r||r.call(t),null===(s=null===(n=this.observerLast)||void 0===n?void 0:n.disconnect)||void 0===s||s.call(n)}handleInit(){const{autoplay:i,circular:e,current:t,displayMultipleItems:r,duration:n,interval:s,vertical:a}=this,c=this,d={pagination:{el:`.taro-swiper-${w(this,p,"f")} > .swiper-container > .swiper-pagination`},direction:a?"vertical":"horizontal",loop:e,slidesPerView:r,initialSlide:e?t+1:t,speed:n,observer:!0,observeParents:!0,zoom:this.zoom,on:{slideTo(){c.current=this.realIndex},slideChangeTransitionEnd(){e&&(this.isBeginning||this.isEnd)?this.slideToLoop(this.realIndex,0):c.onChange.emit({current:this.realIndex,source:w(c,A,"f")})},touchEnd:()=>{l(c,A,"touch","f")},autoplay(){l(c,A,"autoplay","f")},transitionEnd(){setTimeout((()=>{l(c,A,"","f")})),c.onAnimationFinish.emit({current:this.realIndex,source:w(c,A,"f")})},observerUpdate(i,e){const t=e.target;(t&&"string"==typeof t.className?t.className:"").includes("taro_page")&&"none"!==t.style.display&&c.autoplay&&t.contains(i.$el[0])&&(c.circular?i.slideToLoop(this.realIndex,0):i.slideTo(this.realIndex))}}};i&&(d.autoplay={delay:s,disableOnInteraction:!1}),this.swiper=new o(`.taro-swiper-${w(this,p,"f")} > .swiper-container`,d),this.swiperWrapper=this.el.querySelector(`.taro-swiper-${w(this,p,"f")} > .swiper-container > .swiper-wrapper`)}render(){const{vertical:i,indicatorDots:e,indicatorColor:n,indicatorActiveColor:o}=this,a={overflow:"hidden"},A={overflow:"visible"};this.full&&(a.height="100%",A.height="100%");const[,l]=/^(\d+)px/.exec(this.previousMargin)||[],[,c]=/^(\d+)px/.exec(this.nextMargin)||[],d=parseInt(l)||0,g=parseInt(c)||0;return i?(A.marginTop=`${d}px`,A.marginBottom=`${g}px`):(A.marginRight=`${g}px`,A.marginLeft=`${d}px`),t(r,{class:`taro-swiper-${w(this,p,"f")}`,style:a},t("div",{class:"swiper-container",style:A},t("style",{type:"text/css"},`\n .taro-swiper-${w(this,p,"f")} > .swiper-container > .swiper-pagination > .swiper-pagination-bullet { background: ${n} }\n .taro-swiper-${w(this,p,"f")} > .swiper-container > .swiper-pagination > .swiper-pagination-bullet-active { background: ${o} }\n `),t("div",{class:"swiper-wrapper"},t("slot",null)),t("div",{class:s("swiper-pagination",{"swiper-pagination-hidden":!e,"swiper-pagination-bullets":e})})))}get el(){return n(this)}static get watchers(){return{current:["watchCurrent"],autoplay:["watchAutoplay"],duration:["watchDuration"],interval:["watchInterval"],swiperWrapper:["watchSwiperWrapper"],circular:["watchCircular"],displayMultipleItems:["watchDisplayMultipleItems"]}}};p=new WeakMap,A=new WeakMap,d.style="@font-face{font-family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DAjgbRAAB42mNgYGBkAIIbCZo5IPrmUn0hGA0AO8EFTQAA') format('woff');font-weight:400;font-style:normal}:root{--swiper-theme-color:#007aff}.swiper-container{margin-left:auto;margin-right:auto;position:relative;overflow:hidden;list-style:none;padding:0;z-index:1}.swiper-container-vertical>.swiper-wrapper{-ms-flex-direction:column;flex-direction:column}.swiper-wrapper{position:relative;width:100%;height:100%;z-index:1;display:-ms-flexbox;display:flex;-webkit-transition-property:-webkit-transform;transition-property:-webkit-transform;transition-property:transform;transition-property:transform, -webkit-transform;-webkit-box-sizing:content-box;box-sizing:content-box}.swiper-container-android .swiper-slide,.swiper-wrapper{-webkit-transform:translate3d(0px,0,0);transform:translate3d(0px,0,0)}.swiper-container-multirow>.swiper-wrapper{-ms-flex-wrap:wrap;flex-wrap:wrap}.swiper-container-multirow-column>.swiper-wrapper{-ms-flex-wrap:wrap;flex-wrap:wrap;-ms-flex-direction:column;flex-direction:column}.swiper-container-free-mode>.swiper-wrapper{-webkit-transition-timing-function:ease-out;transition-timing-function:ease-out;margin:0 auto}.swiper-container-pointer-events{-ms-touch-action:pan-y;touch-action:pan-y}.swiper-container-pointer-events.swiper-container-vertical{-ms-touch-action:pan-x;touch-action:pan-x}.swiper-slide{-ms-flex-negative:0;flex-shrink:0;width:100%;height:100%;position:relative;-webkit-transition-property:-webkit-transform;transition-property:-webkit-transform;transition-property:transform;transition-property:transform, -webkit-transform}.swiper-slide-invisible-blank{visibility:hidden}.swiper-container-autoheight,.swiper-container-autoheight .swiper-slide{height:auto}.swiper-container-autoheight .swiper-wrapper{-ms-flex-align:start;align-items:flex-start;-webkit-transition-property:height,-webkit-transform;transition-property:height,-webkit-transform;transition-property:transform,height;transition-property:transform,height,-webkit-transform}.swiper-container-3d{-webkit-perspective:1200px;perspective:1200px}.swiper-container-3d .swiper-cube-shadow,.swiper-container-3d .swiper-slide,.swiper-container-3d .swiper-slide-shadow-bottom,.swiper-container-3d .swiper-slide-shadow-left,.swiper-container-3d .swiper-slide-shadow-right,.swiper-container-3d .swiper-slide-shadow-top,.swiper-container-3d .swiper-wrapper{-webkit-transform-style:preserve-3d;transform-style:preserve-3d}.swiper-container-3d .swiper-slide-shadow-bottom,.swiper-container-3d .swiper-slide-shadow-left,.swiper-container-3d .swiper-slide-shadow-right,.swiper-container-3d .swiper-slide-shadow-top{position:absolute;left:0;top:0;width:100%;height:100%;pointer-events:none;z-index:10}.swiper-container-3d .swiper-slide-shadow-left{background-image:-webkit-gradient(linear,right top, left top,from(rgba(0,0,0,.5)),to(rgba(0,0,0,0)));background-image:linear-gradient(to left,rgba(0,0,0,.5),rgba(0,0,0,0))}.swiper-container-3d .swiper-slide-shadow-right{background-image:-webkit-gradient(linear,left top, right top,from(rgba(0,0,0,.5)),to(rgba(0,0,0,0)));background-image:linear-gradient(to right,rgba(0,0,0,.5),rgba(0,0,0,0))}.swiper-container-3d .swiper-slide-shadow-top{background-image:-webkit-gradient(linear,left bottom, left top,from(rgba(0,0,0,.5)),to(rgba(0,0,0,0)));background-image:linear-gradient(to top,rgba(0,0,0,.5),rgba(0,0,0,0))}.swiper-container-3d .swiper-slide-shadow-bottom{background-image:-webkit-gradient(linear,left top, left bottom,from(rgba(0,0,0,.5)),to(rgba(0,0,0,0)));background-image:linear-gradient(to bottom,rgba(0,0,0,.5),rgba(0,0,0,0))}.swiper-container-css-mode>.swiper-wrapper{overflow:auto;scrollbar-width:none;-ms-overflow-style:none}.swiper-container-css-mode>.swiper-wrapper::-webkit-scrollbar{display:none}.swiper-container-css-mode>.swiper-wrapper>.swiper-slide{scroll-snap-align:start start}.swiper-container-horizontal.swiper-container-css-mode>.swiper-wrapper{-webkit-scroll-snap-type:x mandatory;-ms-scroll-snap-type:x mandatory;scroll-snap-type:x mandatory}.swiper-container-vertical.swiper-container-css-mode>.swiper-wrapper{-webkit-scroll-snap-type:y mandatory;-ms-scroll-snap-type:y mandatory;scroll-snap-type:y mandatory}@font-face{font-family:swiper-icons;src:url('data:application/font-woff;charset=utf-8;base64, d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GA0AO8EFTQAA') format('woff');font-weight:400;font-style:normal}:root{--swiper-theme-color:#007aff}.swiper-container{margin-left:auto;margin-right:auto;position:relative;overflow:hidden;list-style:none;padding:0;z-index:1}.swiper-container-vertical>.swiper-wrapper{-ms-flex-direction:column;flex-direction:column}.swiper-wrapper{position:relative;width:100%;height:100%;z-index:1;display:-ms-flexbox;display:flex;-webkit-transition-property:-webkit-transform;transition-property:-webkit-transform;transition-property:transform;transition-property:transform, -webkit-transform;-webkit-box-sizing:content-box;box-sizing:content-box}.swiper-container-android .swiper-slide,.swiper-wrapper{-webkit-transform:translate3d(0px,0,0);transform:translate3d(0px,0,0)}.swiper-container-multirow>.swiper-wrapper{-ms-flex-wrap:wrap;flex-wrap:wrap}.swiper-container-multirow-column>.swiper-wrapper{-ms-flex-wrap:wrap;flex-wrap:wrap;-ms-flex-direction:column;flex-direction:column}.swiper-container-free-mode>.swiper-wrapper{-webkit-transition-timing-function:ease-out;transition-timing-function:ease-out;margin:0 auto}.swiper-container-pointer-events{-ms-touch-action:pan-y;touch-action:pan-y}.swiper-container-pointer-events.swiper-container-vertical{-ms-touch-action:pan-x;touch-action:pan-x}.swiper-slide{-ms-flex-negative:0;flex-shrink:0;width:100%;height:100%;position:relative;-webkit-transition-property:-webkit-transform;transition-property:-webkit-transform;transition-property:transform;transition-property:transform, -webkit-transform}.swiper-slide-invisible-blank{visibility:hidden}.swiper-container-autoheight,.swiper-container-autoheight .swiper-slide{height:auto}.swiper-container-autoheight .swiper-wrapper{-ms-flex-align:start;align-items:flex-start;-webkit-transition-property:height,-webkit-transform;transition-property:height,-webkit-transform;transition-property:transform,height;transition-property:transform,height,-webkit-transform}.swiper-container-3d{-webkit-perspective:1200px;perspective:1200px}.swiper-container-3d .swiper-cube-shadow,.swiper-container-3d .swiper-slide,.swiper-container-3d .swiper-slide-shadow-bottom,.swiper-container-3d .swiper-slide-shadow-left,.swiper-container-3d .swiper-slide-shadow-right,.swiper-container-3d .swiper-slide-shadow-top,.swiper-container-3d .swiper-wrapper{-webkit-transform-style:preserve-3d;transform-style:preserve-3d}.swiper-container-3d .swiper-slide-shadow-bottom,.swiper-container-3d .swiper-slide-shadow-left,.swiper-container-3d .swiper-slide-shadow-right,.swiper-container-3d .swiper-slide-shadow-top{position:absolute;left:0;top:0;width:100%;height:100%;pointer-events:none;z-index:10}.swiper-container-3d .swiper-slide-shadow-left{background-image:-webkit-gradient(linear,right top, left top,from(rgba(0,0,0,.5)),to(rgba(0,0,0,0)));background-image:linear-gradient(to left,rgba(0,0,0,.5),rgba(0,0,0,0))}.swiper-container-3d .swiper-slide-shadow-right{background-image:-webkit-gradient(linear,left top, right top,from(rgba(0,0,0,.5)),to(rgba(0,0,0,0)));background-image:linear-gradient(to right,rgba(0,0,0,.5),rgba(0,0,0,0))}.swiper-container-3d .swiper-slide-shadow-top{background-image:-webkit-gradient(linear,left bottom, left top,from(rgba(0,0,0,.5)),to(rgba(0,0,0,0)));background-image:linear-gradient(to top,rgba(0,0,0,.5),rgba(0,0,0,0))}.swiper-container-3d .swiper-slide-shadow-bottom{background-image:-webkit-gradient(linear,left top, left bottom,from(rgba(0,0,0,.5)),to(rgba(0,0,0,0)));background-image:linear-gradient(to bottom,rgba(0,0,0,.5),rgba(0,0,0,0))}.swiper-container-css-mode>.swiper-wrapper{overflow:auto;scrollbar-width:none;-ms-overflow-style:none}.swiper-container-css-mode>.swiper-wrapper::-webkit-scrollbar{display:none}.swiper-container-css-mode>.swiper-wrapper>.swiper-slide{scroll-snap-align:start start}.swiper-container-horizontal.swiper-container-css-mode>.swiper-wrapper{-webkit-scroll-snap-type:x mandatory;-ms-scroll-snap-type:x mandatory;scroll-snap-type:x mandatory}.swiper-container-vertical.swiper-container-css-mode>.swiper-wrapper{-webkit-scroll-snap-type:y mandatory;-ms-scroll-snap-type:y mandatory;scroll-snap-type:y mandatory}:root{--swiper-navigation-size:44px}.swiper-button-next,.swiper-button-prev{position:absolute;top:50%;width:calc(var(--swiper-navigation-size)/ 44 * 27);height:var(--swiper-navigation-size);margin-top:calc(0px - (var(--swiper-navigation-size)/ 2));z-index:10;cursor:pointer;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;color:var(--swiper-navigation-color,var(--swiper-theme-color))}.swiper-button-next.swiper-button-disabled,.swiper-button-prev.swiper-button-disabled{opacity:.35;cursor:auto;pointer-events:none}.swiper-button-next:after,.swiper-button-prev:after{font-family:swiper-icons;font-size:var(--swiper-navigation-size);text-transform:none!important;letter-spacing:0;text-transform:none;font-variant:initial;line-height:1}.swiper-button-prev,.swiper-container-rtl .swiper-button-next{left:10px;right:auto}.swiper-button-prev:after,.swiper-container-rtl .swiper-button-next:after{content:'prev'}.swiper-button-next,.swiper-container-rtl .swiper-button-prev{right:10px;left:auto}.swiper-button-next:after,.swiper-container-rtl .swiper-button-prev:after{content:'next'}.swiper-button-next.swiper-button-white,.swiper-button-prev.swiper-button-white{--swiper-navigation-color:#ffffff}.swiper-button-next.swiper-button-black,.swiper-button-prev.swiper-button-black{--swiper-navigation-color:#000000}.swiper-button-lock{display:none}.swiper-pagination{position:absolute;text-align:center;-webkit-transition:.3s opacity;transition:.3s opacity;-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0);z-index:10}.swiper-pagination.swiper-pagination-hidden{opacity:0}.swiper-container-horizontal>.swiper-pagination-bullets,.swiper-pagination-custom,.swiper-pagination-fraction{bottom:10px;left:0;width:100%}.swiper-pagination-bullets-dynamic{overflow:hidden;font-size:0}.swiper-pagination-bullets-dynamic .swiper-pagination-bullet{-webkit-transform:scale(.33);transform:scale(.33);position:relative}.swiper-pagination-bullets-dynamic .swiper-pagination-bullet-active{-webkit-transform:scale(1);transform:scale(1)}.swiper-pagination-bullets-dynamic .swiper-pagination-bullet-active-main{-webkit-transform:scale(1);transform:scale(1)}.swiper-pagination-bullets-dynamic .swiper-pagination-bullet-active-prev{-webkit-transform:scale(.66);transform:scale(.66)}.swiper-pagination-bullets-dynamic .swiper-pagination-bullet-active-prev-prev{-webkit-transform:scale(.33);transform:scale(.33)}.swiper-pagination-bullets-dynamic .swiper-pagination-bullet-active-next{-webkit-transform:scale(.66);transform:scale(.66)}.swiper-pagination-bullets-dynamic .swiper-pagination-bullet-active-next-next{-webkit-transform:scale(.33);transform:scale(.33)}.swiper-pagination-bullet{width:8px;height:8px;display:inline-block;border-radius:50%;background:#000;opacity:.2}button.swiper-pagination-bullet{border:none;margin:0;padding:0;-webkit-box-shadow:none;box-shadow:none;-webkit-appearance:none;-moz-appearance:none;appearance:none}.swiper-pagination-clickable .swiper-pagination-bullet{cursor:pointer}.swiper-pagination-bullet-active{opacity:1;background:var(--swiper-pagination-color,var(--swiper-theme-color))}.swiper-container-vertical>.swiper-pagination-bullets{right:10px;top:50%;-webkit-transform:translate3d(0px,-50%,0);transform:translate3d(0px,-50%,0)}.swiper-container-vertical>.swiper-pagination-bullets .swiper-pagination-bullet{margin:6px 0;display:block}.swiper-container-vertical>.swiper-pagination-bullets.swiper-pagination-bullets-dynamic{top:50%;-webkit-transform:translateY(-50%);transform:translateY(-50%);width:8px}.swiper-container-vertical>.swiper-pagination-bullets.swiper-pagination-bullets-dynamic .swiper-pagination-bullet{display:inline-block;-webkit-transition:.2s transform,.2s top;transition:.2s transform,.2s top}.swiper-container-horizontal>.swiper-pagination-bullets .swiper-pagination-bullet{margin:0 4px}.swiper-container-horizontal>.swiper-pagination-bullets.swiper-pagination-bullets-dynamic{left:50%;-webkit-transform:translateX(-50%);transform:translateX(-50%);white-space:nowrap}.swiper-container-horizontal>.swiper-pagination-bullets.swiper-pagination-bullets-dynamic .swiper-pagination-bullet{-webkit-transition:.2s transform,.2s left;transition:.2s transform,.2s left}.swiper-container-horizontal.swiper-container-rtl>.swiper-pagination-bullets-dynamic .swiper-pagination-bullet{-webkit-transition:.2s transform,.2s right;transition:.2s transform,.2s right}.swiper-pagination-progressbar{background:rgba(0,0,0,.25);position:absolute}.swiper-pagination-progressbar .swiper-pagination-progressbar-fill{background:var(--swiper-pagination-color,var(--swiper-theme-color));position:absolute;left:0;top:0;width:100%;height:100%;-webkit-transform:scale(0);transform:scale(0);-webkit-transform-origin:left top;transform-origin:left top}.swiper-container-rtl .swiper-pagination-progressbar .swiper-pagination-progressbar-fill{-webkit-transform-origin:right top;transform-origin:right top}.swiper-container-horizontal>.swiper-pagination-progressbar,.swiper-container-vertical>.swiper-pagination-progressbar.swiper-pagination-progressbar-opposite{width:100%;height:4px;left:0;top:0}.swiper-container-horizontal>.swiper-pagination-progressbar.swiper-pagination-progressbar-opposite,.swiper-container-vertical>.swiper-pagination-progressbar{width:4px;height:100%;left:0;top:0}.swiper-pagination-white{--swiper-pagination-color:#ffffff}.swiper-pagination-black{--swiper-pagination-color:#000000}.swiper-pagination-lock{display:none}.swiper-scrollbar{border-radius:10px;position:relative;-ms-touch-action:none;background:rgba(0,0,0,.1)}.swiper-container-horizontal>.swiper-scrollbar{position:absolute;left:1%;bottom:3px;z-index:50;height:5px;width:98%}.swiper-container-vertical>.swiper-scrollbar{position:absolute;right:3px;top:1%;z-index:50;width:5px;height:98%}.swiper-scrollbar-drag{height:100%;width:100%;position:relative;background:rgba(0,0,0,.5);border-radius:10px;left:0;top:0}.swiper-scrollbar-cursor-drag{cursor:move}.swiper-scrollbar-lock{display:none}.swiper-zoom-container{width:100%;height:100%;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;text-align:center}.swiper-zoom-container>canvas,.swiper-zoom-container>img,.swiper-zoom-container>svg{max-width:100%;max-height:100%;-o-object-fit:contain;object-fit:contain}.swiper-slide-zoomed{cursor:move}.swiper-lazy-preloader{width:42px;height:42px;position:absolute;left:50%;top:50%;margin-left:-21px;margin-top:-21px;z-index:10;-webkit-transform-origin:50%;transform-origin:50%;-webkit-animation:swiper-preloader-spin 1s infinite linear;animation:swiper-preloader-spin 1s infinite linear;-webkit-box-sizing:border-box;box-sizing:border-box;border:4px solid var(--swiper-preloader-color,var(--swiper-theme-color));border-radius:50%;border-top-color:transparent}.swiper-lazy-preloader-white{--swiper-preloader-color:#fff}.swiper-lazy-preloader-black{--swiper-preloader-color:#000}@-webkit-keyframes swiper-preloader-spin{100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes swiper-preloader-spin{100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}.swiper-container .swiper-notification{position:absolute;left:0;top:0;pointer-events:none;opacity:0;z-index:-1000}.swiper-container-fade.swiper-container-free-mode .swiper-slide{-webkit-transition-timing-function:ease-out;transition-timing-function:ease-out}.swiper-container-fade .swiper-slide{pointer-events:none;-webkit-transition-property:opacity;transition-property:opacity}.swiper-container-fade .swiper-slide .swiper-slide{pointer-events:none}.swiper-container-fade .swiper-slide-active,.swiper-container-fade .swiper-slide-active .swiper-slide-active{pointer-events:auto}.swiper-container-cube{overflow:visible}.swiper-container-cube .swiper-slide{pointer-events:none;-webkit-backface-visibility:hidden;backface-visibility:hidden;z-index:1;visibility:hidden;-webkit-transform-origin:0 0;transform-origin:0 0;width:100%;height:100%}.swiper-container-cube .swiper-slide .swiper-slide{pointer-events:none}.swiper-container-cube.swiper-container-rtl .swiper-slide{-webkit-transform-origin:100% 0;transform-origin:100% 0}.swiper-container-cube .swiper-slide-active,.swiper-container-cube .swiper-slide-active .swiper-slide-active{pointer-events:auto}.swiper-container-cube .swiper-slide-active,.swiper-container-cube .swiper-slide-next,.swiper-container-cube .swiper-slide-next+.swiper-slide,.swiper-container-cube .swiper-slide-prev{pointer-events:auto;visibility:visible}.swiper-container-cube .swiper-slide-shadow-bottom,.swiper-container-cube .swiper-slide-shadow-left,.swiper-container-cube .swiper-slide-shadow-right,.swiper-container-cube .swiper-slide-shadow-top{z-index:0;-webkit-backface-visibility:hidden;backface-visibility:hidden}.swiper-container-cube .swiper-cube-shadow{position:absolute;left:0;bottom:0px;width:100%;height:100%;opacity:.6;z-index:0}.swiper-container-cube .swiper-cube-shadow:before{content:'';background:#000;position:absolute;left:0;top:0;bottom:0;right:0;-webkit-filter:blur(50px);filter:blur(50px)}.swiper-container-flip{overflow:visible}.swiper-container-flip .swiper-slide{pointer-events:none;-webkit-backface-visibility:hidden;backface-visibility:hidden;z-index:1}.swiper-container-flip .swiper-slide .swiper-slide{pointer-events:none}.swiper-container-flip .swiper-slide-active,.swiper-container-flip .swiper-slide-active .swiper-slide-active{pointer-events:auto}.swiper-container-flip .swiper-slide-shadow-bottom,.swiper-container-flip .swiper-slide-shadow-left,.swiper-container-flip .swiper-slide-shadow-right,.swiper-container-flip .swiper-slide-shadow-top{z-index:0;-webkit-backface-visibility:hidden;backface-visibility:hidden}taro-swiper-core{height:150px;display:block}taro-swiper-core .swiper-container{height:100%}taro-swiper-core .swiper-pagination{font-size:0}taro-swiper-core .swiper-pagination.swiper-pagination-bullet{opacity:1}taro-swiper-core .swiper-pagination.swiper-pagination-hidden{display:none}";const g=Node.prototype.cloneNode,h=class{constructor(e){i(this,e),this.itemId=void 0,this.deep=!1}handleCloneNode(i,e){const t=g.call(i,!1),r=this.handleChildNodes(i);if(e)for(let i=0;i<r.length;i++){const n=r[i];if(!n)break;let s=e;if(2!==n.nodeType&&8!==n.nodeType){!0===this.deep||n["s-cr"]||(s=!1);const i=this.handleCloneNode(n,s);t.appendChild(i)}}return t}handleChildNodes(i){const e=i.childNodes;if(i["s-sc"]){const i=[];for(let t=0;t<e.length;t++){const r=e[t]["s-nr"];r&&i.push(r)}return i}return Array.from(e)}componentDidRender(){this.el.cloneNode=(i=!1)=>this.handleCloneNode(this.el,i)}render(){return t(r,{class:"swiper-slide","item-id":this.itemId})}get el(){return n(this)}};export{d as taro_swiper_core,h as taro_swiper_item_core}
@@ -1 +0,0 @@
1
- import{r as t,c as e,h as s,g as i}from"./p-98b1fc13.js";function h(t){return null!=t?t:""}const a=class{constructor(s){t(this,s),this.onInput=e(this,"input",7),this.onFocus=e(this,"focus",7),this.onBlur=e(this,"blur",7),this.onConfirm=e(this,"confirm",7),this.onChange=e(this,"change",7),this.onLineChange=e(this,"linechange",7),this.onKeyDown=e(this,"keydown",7),this.handleInput=t=>{t.stopPropagation(),this.handleLineChange();const e=t.target.value||"";this.onInput.emit({value:e,cursor:e.length})},this.handleFocus=t=>{t.stopPropagation(),this.onFocus.emit({value:t.target.value})},this.handleBlur=t=>{t.stopPropagation(),this.onBlur.emit({value:t.target.value})},this.handleChange=t=>{t.stopPropagation(),this.onChange.emit({value:t.target.value})},this.handleLineChange=()=>{const t=this.getNumberOfLines();t!==this.line&&(this.line=t,this.onLineChange.emit({height:this.textareaRef.clientHeight,lineCount:this.line}))},this.handleKeyDown=t=>{t.stopPropagation();const{value:e}=t.target,s=t.keyCode||t.code;this.onKeyDown.emit({value:e,cursor:e.length,keyCode:s}),13===s&&this.onConfirm.emit({value:e})},this.calculateContentHeight=(t,e)=>{let s=t.style.height,i=t.offsetHeight,h=t.scrollHeight,a=t.style.overflow,o=t.style.minHeight||null;if(!(i>=h))return h;if(t.style.minHeight=0,t.style.height=i+e+"px",t.style.overflow="hidden",h<t.scrollHeight){for(;t.offsetHeight>=t.scrollHeight;)t.style.height=(i-=e)+"px";for(;t.offsetHeight<t.scrollHeight;)t.style.height=i+++"px";return t.style.height=s,t.style.overflow=a,t.style.minHeight=o,i}},this.getNumberOfLines=()=>{const t=this.textareaRef,e=window.getComputedStyle?window.getComputedStyle(t):t.style,s=parseInt(e.lineHeight,10),i=this.calculateContentHeight(t,s);return Math.floor(i/s)},this.value="",this.placeholder=void 0,this.disabled=!1,this.maxlength=140,this.autoFocus=!1,this.autoHeight=!1,this.name=void 0,this.nativeProps={},this.line=1}watchAutoFocus(t,e){var s;!e&&t&&(null===(s=this.textareaRef)||void 0===s||s.focus())}async focus(){this.textareaRef.focus()}render(){const{value:t,placeholder:e,disabled:i,maxlength:a,autoFocus:o,autoHeight:n,name:r,nativeProps:u,handleInput:c,handleFocus:l,handleBlur:d,handleChange:p}=this,g={};return n&&(g.rows=this.line),s("textarea",Object.assign({ref:t=>{t&&(this.textareaRef=t,o&&t&&t.focus())},class:"taro-textarea "+(n?"auto-height":""),value:h(t),placeholder:e,name:r,disabled:i,maxlength:a,autofocus:o,onInput:c,onFocus:l,onBlur:d,onChange:p,onKeyDown:this.handleKeyDown},u,g))}get el(){return i(this)}static get watchers(){return{autoFocus:["watchAutoFocus"]}}};a.style="taro-textarea-core{width:300px;display:block}taro-textarea-core .auto-height{height:auto}.taro-textarea{height:inherit;-webkit-appearance:none;-moz-appearance:none;appearance:none;cursor:auto;border:0;width:100%;line-height:1.5;display:block;position:relative}.taro-textarea:focus{outline:none}";export{a as taro_textarea_core}
@@ -1 +0,0 @@
1
- var __awaiter=this&&this.__awaiter||function(e,t,n,o){function i(e){return e instanceof n?e:new n((function(t){t(e)}))}return new(n||(n=Promise))((function(n,a){function r(e){try{l(o.next(e))}catch(e){a(e)}}function u(e){try{l(o["throw"](e))}catch(e){a(e)}}function l(e){e.done?n(e.value):i(e.value).then(r,u)}l((o=o.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var n={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},o,i,a,r;return r={next:u(0),throw:u(1),return:u(2)},typeof Symbol==="function"&&(r[Symbol.iterator]=function(){return this}),r;function u(e){return function(t){return l([e,t])}}function l(u){if(o)throw new TypeError("Generator is already executing.");while(r&&(r=0,u[0]&&(n=0)),n)try{if(o=1,i&&(a=u[0]&2?i["return"]:u[0]?i["throw"]||((a=i["return"])&&a.call(i),0):i.next)&&!(a=a.call(i,u[1])).done)return a;if(i=0,a)u=[u[0]&2,a.value];switch(u[0]){case 0:case 1:a=u;break;case 4:n.label++;return{value:u[1],done:false};case 5:n.label++;i=u[1];u=[0];continue;case 7:u=n.ops.pop();n.trys.pop();continue;default:if(!(a=n.trys,a=a.length>0&&a[a.length-1])&&(u[0]===6||u[0]===2)){n=0;continue}if(u[0]===3&&(!a||u[1]>a[0]&&u[1]<a[3])){n.label=u[1];break}if(u[0]===6&&n.label<a[1]){n.label=a[1];a=u;break}if(a&&n.label<a[2]){n.label=a[2];n.ops.push(u);break}if(a[2])n.ops.pop();n.trys.pop();continue}u=t.call(e,n)}catch(e){u=[6,e];i=0}finally{o=a=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:true}}};System.register(["./p-6bbb639a.system.js"],(function(e){"use strict";var t,n,o,i;return{setters:[function(e){t=e.r;n=e.c;o=e.h;i=e.g}],execute:function(){var a="taro-textarea-core{width:300px;display:block}taro-textarea-core .auto-height{height:auto}.taro-textarea{height:inherit;-webkit-appearance:none;-moz-appearance:none;appearance:none;cursor:auto;border:0;width:100%;line-height:1.5;display:block;position:relative}.taro-textarea:focus{outline:none}";function r(e){return e!==null&&e!==void 0?e:""}var u=e("taro_textarea_core",function(){function e(e){var o=this;t(this,e);this.onInput=n(this,"input",7);this.onFocus=n(this,"focus",7);this.onBlur=n(this,"blur",7);this.onConfirm=n(this,"confirm",7);this.onChange=n(this,"change",7);this.onLineChange=n(this,"linechange",7);this.onKeyDown=n(this,"keydown",7);this.handleInput=function(e){e.stopPropagation();o.handleLineChange();var t=e.target.value||"";o.onInput.emit({value:t,cursor:t.length})};this.handleFocus=function(e){e.stopPropagation();o.onFocus.emit({value:e.target.value})};this.handleBlur=function(e){e.stopPropagation();o.onBlur.emit({value:e.target.value})};this.handleChange=function(e){e.stopPropagation();o.onChange.emit({value:e.target.value})};this.handleLineChange=function(){var e=o.getNumberOfLines();if(e!==o.line){o.line=e;o.onLineChange.emit({height:o.textareaRef.clientHeight,lineCount:o.line})}};this.handleKeyDown=function(e){e.stopPropagation();var t=e.target.value;var n=e.keyCode||e.code;o.onKeyDown.emit({value:t,cursor:t.length,keyCode:n});n===13&&o.onConfirm.emit({value:t})};this.calculateContentHeight=function(e,t){var n=e.style.height,o=e.offsetHeight,i=e.scrollHeight,a=e.style.overflow,r=e.style.minHeight||null;if(o>=i){e.style.minHeight=0;e.style.height=o+t+"px";e.style.overflow="hidden";if(i<e.scrollHeight){while(e.offsetHeight>=e.scrollHeight){e.style.height=(o-=t)+"px"}while(e.offsetHeight<e.scrollHeight){e.style.height=o+++"px"}e.style.height=n;e.style.overflow=a;e.style.minHeight=r;return o}}else{return i}};this.getNumberOfLines=function(){var e=o.textareaRef,t=window.getComputedStyle?window.getComputedStyle(e):e.style,n=parseInt(t.lineHeight,10),i=o.calculateContentHeight(e,n),a=Math.floor(i/n);return a};this.value="";this.placeholder=undefined;this.disabled=false;this.maxlength=140;this.autoFocus=false;this.autoHeight=false;this.name=undefined;this.nativeProps={};this.line=1}e.prototype.watchAutoFocus=function(e,t){var n;if(!t&&e){(n=this.textareaRef)===null||n===void 0?void 0:n.focus()}};e.prototype.focus=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){this.textareaRef.focus();return[2]}))}))};e.prototype.render=function(){var e=this;var t=this,n=t.value,i=t.placeholder,a=t.disabled,u=t.maxlength,l=t.autoFocus,s=t.autoHeight,h=t.name,c=t.nativeProps,f=t.handleInput,g=t.handleFocus,p=t.handleBlur,d=t.handleChange;var v={};if(s){v.rows=this.line}return o("textarea",Object.assign({ref:function(t){if(t){e.textareaRef=t;if(l&&t)t.focus()}},class:"taro-textarea ".concat(s?"auto-height":""),value:r(n),placeholder:i,name:h,disabled:a,maxlength:u,autofocus:l,onInput:f,onFocus:g,onBlur:p,onChange:d,onKeyDown:this.handleKeyDown},c,v))};Object.defineProperty(e.prototype,"el",{get:function(){return i(this)},enumerable:false,configurable:true});Object.defineProperty(e,"watchers",{get:function(){return{autoFocus:["watchAutoFocus"]}},enumerable:false,configurable:true});return e}());u.style=a}}}));
@@ -1 +0,0 @@
1
- import{r as i,c as t,h as e,g as o}from"./p-98b1fc13.js";const s=class{constructor(e){i(this,e),this.onChange=t(this,"change",7),this.switchChange=i=>{i.stopPropagation();const t=i.target.checked;this.isChecked=t,this.onChange.emit({value:t})},this.type="switch",this.checked=!1,this.color="#04BE02",this.name=void 0,this.disabled=!1,this.nativeProps={},this.isChecked=void 0,this.isWillLoadCalled=!1}function(i,t){this.isWillLoadCalled&&i!==t&&(this.isChecked=i)}componentWillLoad(){this.isWillLoadCalled=!0,this.isChecked=this.checked}componentDidLoad(){Object.defineProperty(this.el,"value",{get:()=>this.isChecked,configurable:!0})}render(){const{type:i,color:t,isChecked:o,name:s,disabled:r,nativeProps:c}=this;return e("input",Object.assign({type:"checkbox",class:`weui-${i}`,style:o?{borderColor:t||"04BE02",backgroundColor:t||"04BE02"}:{},checked:o,name:s,disabled:r,onChange:this.switchChange},c))}get el(){return o(this)}static get watchers(){return{checked:["function"]}}};s.style='.weui-cell_switch{padding-top:6.5px;padding-bottom:6.5px}.weui-switch{-webkit-appearance:none;-moz-appearance:none;appearance:none}.weui-switch,.weui-switch-cp__box{-webkit-box-sizing:border-box;box-sizing:border-box;background-color:#dfdfdf;border:1px solid #dfdfdf;border-radius:16px;outline:0;width:52px;height:32px;-webkit-transition:background-color .1s,border .1s;transition:background-color .1s,border .1s;position:relative}.weui-switch:before,.weui-switch-cp__box:before{content:" ";background-color:#fdfdfd;border-radius:15px;width:50px;height:30px;-webkit-transition:-webkit-transform .35s cubic-bezier(.45,1,.4,1);transition:-webkit-transform .35s cubic-bezier(.45,1,.4,1);transition:transform .35s cubic-bezier(.45,1,.4,1);transition:transform .35s cubic-bezier(.45,1,.4,1), -webkit-transform .35s cubic-bezier(.45,1,.4,1);position:absolute;top:0;left:0}.weui-switch:after,.weui-switch-cp__box:after{content:" ";background-color:#fff;border-radius:15px;width:30px;height:30px;-webkit-transition:-webkit-transform .35s cubic-bezier(.4,.4,.25,1.35);transition:-webkit-transform .35s cubic-bezier(.4,.4,.25,1.35);transition:transform .35s cubic-bezier(.4,.4,.25,1.35);transition:transform .35s cubic-bezier(.4,.4,.25,1.35), -webkit-transform .35s cubic-bezier(.4,.4,.25,1.35);position:absolute;top:0;left:0;-webkit-box-shadow:0 1px 3px rgba(0,0,0,.4);box-shadow:0 1px 3px rgba(0,0,0,.4)}.weui-switch:checked,.weui-switch-cp__input:checked~.weui-switch-cp__box{background-color:#04be02;border-color:#04be02}.weui-switch:checked:before,.weui-switch-cp__input:checked~.weui-switch-cp__box:before{-webkit-transform:scale(0);transform:scale(0)}.weui-switch:checked:after,.weui-switch-cp__input:checked~.weui-switch-cp__box:after{-webkit-transform:translate(20px);transform:translate(20px)}.weui-switch-cp__input{position:absolute;left:-9999px}.weui-switch-cp__box{display:block}taro-switch-core{width:52px;height:32px;display:inline-block}taro-switch-core .weui-switch{width:100%;height:100%;display:block}';export{s as taro_switch_core}