@canlooks/can-ui 0.0.35 → 0.0.36
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/components/toggleButton/toggleButton.js +2 -2
- package/dist/cjs/utils/style.js +6 -1
- package/dist/esm/components/toggleButton/toggleButton.js +2 -2
- package/dist/esm/utils/style.js +6 -1
- package/documentation/dist/assets/{index-DRjQeSoV.js → index-DSdHC6BI.js} +258 -258
- package/documentation/dist/index.html +1 -1
- package/package.json +1 -1
|
@@ -35,13 +35,13 @@ exports.ToggleButton = (({ variant = 'filled', size, color = 'primary', disabled
|
|
|
35
35
|
if (items) {
|
|
36
36
|
return items.map((p, i) => {
|
|
37
37
|
const itemValue = p[primaryKey];
|
|
38
|
-
return ((0, jsx_runtime_1.jsx)(button_1.Button, { ref: p.ref, shape: p.shape, prefix: p.prefix, suffix: p.suffix, loading: p.loading, label: p.label, ...makeProps(p, itemValue, (0, utils_1.isSelected)(itemValue, innerValue
|
|
38
|
+
return ((0, jsx_runtime_1.jsx)(button_1.Button, { ref: p.ref, shape: p.shape, prefix: p.prefix, suffix: p.suffix, loading: p.loading, label: p.label, ...makeProps(p, itemValue, (0, utils_1.isSelected)(itemValue, innerValue)), children: p.children }, itemValue ?? i));
|
|
39
39
|
});
|
|
40
40
|
}
|
|
41
41
|
return react_1.Children.map(props.children, c => {
|
|
42
42
|
if ((0, react_1.isValidElement)(c)) {
|
|
43
43
|
const { props } = c;
|
|
44
|
-
return (0, react_1.cloneElement)(c, makeProps(props, props.value, (0, utils_1.isSelected)(props.value, innerValue
|
|
44
|
+
return (0, react_1.cloneElement)(c, makeProps(props, props.value, (0, utils_1.isSelected)(props.value, innerValue)));
|
|
45
45
|
}
|
|
46
46
|
return c;
|
|
47
47
|
});
|
package/dist/cjs/utils/style.js
CHANGED
|
@@ -38,7 +38,12 @@ function defineClasses(prefixName, names) {
|
|
|
38
38
|
return ret;
|
|
39
39
|
}
|
|
40
40
|
function defineInnerClasses(prefixName, names) {
|
|
41
|
-
|
|
41
|
+
const prefix = definePrefix('CanUI-' + (0, utils_1.humpToSegmented)(prefixName));
|
|
42
|
+
const ret = { root: prefix() };
|
|
43
|
+
names?.forEach(name => {
|
|
44
|
+
ret[name] = prefix((0, utils_1.humpToSegmented)(name));
|
|
45
|
+
});
|
|
46
|
+
return ret;
|
|
42
47
|
}
|
|
43
48
|
/**
|
|
44
49
|
* 用于定义css,返回一个可调用的函数,可直接传入emotion的css属性
|
|
@@ -32,13 +32,13 @@ export const ToggleButton = (({ variant = 'filled', size, color = 'primary', dis
|
|
|
32
32
|
if (items) {
|
|
33
33
|
return items.map((p, i) => {
|
|
34
34
|
const itemValue = p[primaryKey];
|
|
35
|
-
return (_jsx(Button, { ref: p.ref, shape: p.shape, prefix: p.prefix, suffix: p.suffix, loading: p.loading, label: p.label, ...makeProps(p, itemValue, isSelected(itemValue, innerValue
|
|
35
|
+
return (_jsx(Button, { ref: p.ref, shape: p.shape, prefix: p.prefix, suffix: p.suffix, loading: p.loading, label: p.label, ...makeProps(p, itemValue, isSelected(itemValue, innerValue)), children: p.children }, itemValue ?? i));
|
|
36
36
|
});
|
|
37
37
|
}
|
|
38
38
|
return Children.map(props.children, c => {
|
|
39
39
|
if (isValidElement(c)) {
|
|
40
40
|
const { props } = c;
|
|
41
|
-
return cloneElement(c, makeProps(props, props.value, isSelected(props.value, innerValue
|
|
41
|
+
return cloneElement(c, makeProps(props, props.value, isSelected(props.value, innerValue)));
|
|
42
42
|
}
|
|
43
43
|
return c;
|
|
44
44
|
});
|
package/dist/esm/utils/style.js
CHANGED
|
@@ -22,7 +22,12 @@ export function defineClasses(prefixName, names) {
|
|
|
22
22
|
return ret;
|
|
23
23
|
}
|
|
24
24
|
export function defineInnerClasses(prefixName, names) {
|
|
25
|
-
|
|
25
|
+
const prefix = definePrefix('CanUI-' + humpToSegmented(prefixName));
|
|
26
|
+
const ret = { root: prefix() };
|
|
27
|
+
names?.forEach(name => {
|
|
28
|
+
ret[name] = prefix(humpToSegmented(name));
|
|
29
|
+
});
|
|
30
|
+
return ret;
|
|
26
31
|
}
|
|
27
32
|
/**
|
|
28
33
|
* 用于定义css,返回一个可调用的函数,可直接传入emotion的css属性
|