taro-react-uilib 1.3.4-13 → 1.3.4-14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +9 -0
- package/dist/components/Checkbox/index.js +1 -1
- package/dist/components/Checkbox/index.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.umd.js +1 -1
- package/dist/index.umd.js.map +1 -1
- package/dist/styles/components/button.scss +4 -1
- package/lib/components/Checkbox/index.js +1 -1
- package/lib/components/Checkbox/index.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
## [1.3.4-14](https://code.xhdev.xyz/h5group/taro-uilib/compare/v1.3.4-13...v1.3.4-14) (2023-08-16)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* weapp button ([538259d](https://code.xhdev.xyz/h5group/taro-uilib/commits/538259d6d8b9653b2334714d76e1f049dfa84b96))
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
1
10
|
## [1.3.4-13](https://code.xhdev.xyz/h5group/taro-uilib/compare/v1.3.4-12...v1.3.4-13) (2023-08-15)
|
|
2
11
|
|
|
3
12
|
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import e from"react";import a from"classnames";import{CheckboxGroup as t}from"@tarojs/components";import c from"../src/hooks/useGenerateId.js";import{pxTransform as l}from"../src/utils/index.js";import s from"./Group/index.js";var o=function(s){var o=s.className,r=s.name,n=s.label,h=s.id,i=s.circle,m=s.onChange,p=s.align,d=s.direction,u=s.justify,x=s.checked,b=s.disabled,k=s.value,v=s.style,
|
|
1
|
+
import e from"react";import a from"classnames";import{CheckboxGroup as t}from"@tarojs/components";import c from"../src/hooks/useGenerateId.js";import{pxTransform as l}from"../src/utils/index.js";import s from"./Group/index.js";var o=function(s){var o=s.className,r=s.name,n=s.label,h=s.id,i=s.circle,m=s.onChange,p=s.align,d=s.direction,u=s.justify,x=s.checked,b=s.disabled,k=s.value,v=s.style,E=s.size,N=void 0===E?0:E,f=s.color,g=void 0===f?"var(--color-primary)":f,y=c(h,"xh-checkbox-id"),C=function(e){var a=x||!1,t="";"h5"===process.env.TARO_ENV?(a=e.target.checked,t=e.target.value):(a=e.detail.value.length>0,t=e.detail.value[0]),m&&m(a,t)},j=a("xh-checkbox",o,p,d,u,{h5:"h5"===process.env.TARO_ENV});return"h5"!==process.env.TARO_ENV?e.createElement(t,{onChange:C},e.createElement("label",{htmlFor:y,className:j,style:v},e.createElement("input",{type:"checkbox",id:y,name:r,className:a("xh-checkbox-input",{tt:"tt"===process.env.TARO_ENV}),onChange:C,disabled:b,value:k,checked:x,color:g}),e.createElement("span",{className:a("xh-checkbox-input-fake",i&&"circle",{tt:"tt"===process.env.TARO_ENV}),style:N>0?{width:l(N),height:l(N)}:{}}),e.createElement("span",{className:"xh-checkbox-label"},n))):e.createElement("label",{htmlFor:y,className:j,style:v},e.createElement("input",{type:"checkbox",id:y,name:r,className:"xh-checkbox-input",onChange:C,value:k,defaultChecked:x}),e.createElement("span",{style:N>0?{width:l(N),height:l(N)}:{},className:a("xh-checkbox-input-fake",i&&"circle")}),e.createElement("span",{className:"xh-checkbox-label"},n))};o.Group=s;export{o as default};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../src/components/Checkbox/index.tsx"],"sourcesContent":["import React, { FC, ReactNode } from \"react\";\nimport classNames from \"classnames\";\nimport { CheckboxGroup } from \"@tarojs/components\";\nimport useGenerateId from \"@/hooks/useGenerateId\";\nimport { pxTransform } from \"@/utils\";\nimport Group from \"./Group\";\nimport \"./index.scss\";\nimport type { XHComponentCommonProps } from \"../../types\";\n\ntype CompoundedComponent = React.ForwardRefExoticComponent<\n XHCheckboxProps & React.RefAttributes<HTMLInputElement>\n> & {\n Group: typeof Group;\n};\n\nexport type XHCheckboxProps = {\n onChange?: (check: boolean, value: string) => void;\n checked?: boolean;\n name?: string;\n label: string | ReactNode;\n size?: number;\n circle?: boolean;\n align?: \"center\" | \"end\";\n direction?: \"rtl\";\n justify?: \"around\" | \"between\";\n value?: string | number;\n id?: string;\n disabled?: boolean;\n style?: React.CSSProperties;\n /**\n * 抖音不支持属性选择器\n * @description 主要为抖音支持颜色\n */\n color?: string;\n} & XHComponentCommonProps;\n\nconst XHCheckbox: FC<XHCheckboxProps> = props => {\n const {\n className,\n name,\n label,\n id,\n circle,\n onChange,\n align,\n direction,\n justify,\n checked,\n disabled,\n value,\n style,\n size = 0,\n color = \"
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/components/Checkbox/index.tsx"],"sourcesContent":["import React, { FC, ReactNode } from \"react\";\nimport classNames from \"classnames\";\nimport { CheckboxGroup } from \"@tarojs/components\";\nimport useGenerateId from \"@/hooks/useGenerateId\";\nimport { pxTransform } from \"@/utils\";\nimport Group from \"./Group\";\nimport \"./index.scss\";\nimport type { XHComponentCommonProps } from \"../../types\";\n\ntype CompoundedComponent = React.ForwardRefExoticComponent<\n XHCheckboxProps & React.RefAttributes<HTMLInputElement>\n> & {\n Group: typeof Group;\n};\n\nexport type XHCheckboxProps = {\n onChange?: (check: boolean, value: string) => void;\n checked?: boolean;\n name?: string;\n label: string | ReactNode;\n size?: number;\n circle?: boolean;\n align?: \"center\" | \"end\";\n direction?: \"rtl\";\n justify?: \"around\" | \"between\";\n value?: string | number;\n id?: string;\n disabled?: boolean;\n style?: React.CSSProperties;\n /**\n * 抖音不支持属性选择器\n * @description 主要为抖音支持颜色\n */\n color?: string;\n} & XHComponentCommonProps;\n\nconst XHCheckbox: FC<XHCheckboxProps> = props => {\n const {\n className,\n name,\n label,\n id,\n circle,\n onChange,\n align,\n direction,\n justify,\n checked,\n disabled,\n value,\n style,\n size = 0,\n color = \"var(--color-primary)\",\n } = props;\n\n const finalId = useGenerateId(id, \"xh-checkbox-id\");\n\n const handleOnchange = e => {\n let finalchecked = checked || false;\n let value = \"\";\n if (process.env.TARO_ENV === \"h5\") {\n finalchecked = e.target.checked;\n value = e.target.value;\n } else {\n finalchecked = e.detail.value.length > 0;\n value = e.detail.value[0];\n }\n onChange && onChange(finalchecked, value);\n };\n\n const cls = classNames(\"xh-checkbox\", className, align, direction, justify, {\n h5: process.env.TARO_ENV === \"h5\",\n });\n if (process.env.TARO_ENV !== \"h5\") {\n return (\n <CheckboxGroup onChange={handleOnchange}>\n <label htmlFor={finalId} className={cls} style={style}>\n <input\n type=\"checkbox\"\n id={finalId}\n name={name}\n className={classNames(\"xh-checkbox-input\", {\n tt: process.env.TARO_ENV === \"tt\",\n })}\n onChange={handleOnchange}\n disabled={disabled}\n value={value}\n checked={checked}\n color={color}\n />\n <span\n className={classNames(\n \"xh-checkbox-input-fake\",\n circle && \"circle\",\n { tt: process.env.TARO_ENV === \"tt\" }\n )}\n style={\n size > 0\n ? {\n width: pxTransform(size),\n height: pxTransform(size),\n }\n : {}\n }\n ></span>\n <span className=\"xh-checkbox-label\">{label}</span>\n </label>\n </CheckboxGroup>\n );\n }\n\n return (\n <label htmlFor={finalId} className={cls} style={style}>\n <input\n type=\"checkbox\"\n id={finalId}\n name={name}\n className=\"xh-checkbox-input\"\n onChange={handleOnchange}\n value={value}\n defaultChecked={checked}\n />\n <span\n style={\n size > 0\n ? {\n width: pxTransform(size),\n height: pxTransform(size),\n }\n : {}\n }\n className={classNames(\"xh-checkbox-input-fake\", circle && \"circle\")}\n ></span>\n <span className=\"xh-checkbox-label\">{label}</span>\n </label>\n );\n};\n\nconst CheckBox = XHCheckbox as CompoundedComponent;\nCheckBox.Group = Group;\n\nexport default CheckBox;\n"],"names":["CheckBox","props","className","name","label","id","circle","onChange","align","direction","justify","checked","disabled","value","style","_a","size","_b","color","finalId","useGenerateId","handleOnchange","e","finalchecked","process","env","TARO_ENV","target","detail","length","cls","classNames","h5","React","createElement","CheckboxGroup","htmlFor","type","tt","width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