@micromag/element-checkbox 0.4.71 → 0.4.77
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/es/index.js +121 -39
- package/package.json +9 -7
package/es/index.js
CHANGED
|
@@ -1,47 +1,129 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { c } from 'react/compiler-runtime';
|
|
2
2
|
import classNames from 'classnames';
|
|
3
3
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
4
4
|
|
|
5
5
|
var styles = {"container":"micromag-element-checkbox-container","label":"micromag-element-checkbox-label","input":"micromag-element-checkbox-input"};
|
|
6
6
|
|
|
7
|
-
function Checkbox(
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
value
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
7
|
+
function Checkbox(t0) {
|
|
8
|
+
const $ = c(24);
|
|
9
|
+
const {
|
|
10
|
+
option: t1,
|
|
11
|
+
value: t2,
|
|
12
|
+
onChange: t3,
|
|
13
|
+
focusable: t4,
|
|
14
|
+
checkboxStyle: t5,
|
|
15
|
+
className: t6
|
|
16
|
+
} = t0;
|
|
17
|
+
const option = t1 === undefined ? null : t1;
|
|
18
|
+
const value = t2 === undefined ? null : t2;
|
|
19
|
+
const onChange = t3 === undefined ? null : t3;
|
|
20
|
+
const focusable = t4 === undefined ? true : t4;
|
|
21
|
+
const checkboxStyle = t5 === undefined ? null : t5;
|
|
22
|
+
const className = t6 === undefined ? null : t6;
|
|
23
|
+
let t7;
|
|
24
|
+
if ($[0] !== option) {
|
|
25
|
+
t7 = option || {};
|
|
26
|
+
$[0] = option;
|
|
27
|
+
$[1] = t7;
|
|
28
|
+
} else {
|
|
29
|
+
t7 = $[1];
|
|
30
|
+
}
|
|
31
|
+
const {
|
|
32
|
+
body: t8
|
|
33
|
+
} = t7;
|
|
34
|
+
const body = t8 === undefined ? null : t8;
|
|
35
|
+
let t9;
|
|
36
|
+
if ($[2] !== className) {
|
|
37
|
+
t9 = classNames([styles.container, className]);
|
|
38
|
+
$[2] = className;
|
|
39
|
+
$[3] = t9;
|
|
40
|
+
} else {
|
|
41
|
+
t9 = $[3];
|
|
42
|
+
}
|
|
43
|
+
let t10;
|
|
44
|
+
if ($[4] !== checkboxStyle) {
|
|
45
|
+
t10 = {
|
|
46
|
+
...checkboxStyle
|
|
47
|
+
};
|
|
48
|
+
$[4] = checkboxStyle;
|
|
49
|
+
$[5] = t10;
|
|
50
|
+
} else {
|
|
51
|
+
t10 = $[5];
|
|
52
|
+
}
|
|
53
|
+
const t11 = body === value;
|
|
54
|
+
let t12;
|
|
55
|
+
if ($[6] !== t11) {
|
|
56
|
+
t12 = classNames([styles.label, {
|
|
57
|
+
active: t11
|
|
58
|
+
}]);
|
|
59
|
+
$[6] = t11;
|
|
60
|
+
$[7] = t12;
|
|
61
|
+
} else {
|
|
62
|
+
t12 = $[7];
|
|
63
|
+
}
|
|
64
|
+
const t13 = value === true;
|
|
65
|
+
const t14 = value === true;
|
|
66
|
+
const t15 = focusable ? "0" : "-1";
|
|
67
|
+
let t16;
|
|
68
|
+
if ($[8] !== onChange || $[9] !== value) {
|
|
69
|
+
t16 = () => {
|
|
70
|
+
if (onChange !== null) {
|
|
71
|
+
onChange(!value);
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
$[8] = onChange;
|
|
75
|
+
$[9] = value;
|
|
76
|
+
$[10] = t16;
|
|
77
|
+
} else {
|
|
78
|
+
t16 = $[10];
|
|
79
|
+
}
|
|
80
|
+
let t17;
|
|
81
|
+
if ($[11] !== t13 || $[12] !== t14 || $[13] !== t15 || $[14] !== t16) {
|
|
82
|
+
t17 = /*#__PURE__*/jsx("input", {
|
|
83
|
+
className: styles.input,
|
|
84
|
+
type: "checkbox",
|
|
85
|
+
autoComplete: "off",
|
|
86
|
+
value: t13,
|
|
87
|
+
checked: t14,
|
|
88
|
+
tabIndex: t15,
|
|
89
|
+
onChange: t16
|
|
90
|
+
});
|
|
91
|
+
$[11] = t13;
|
|
92
|
+
$[12] = t14;
|
|
93
|
+
$[13] = t15;
|
|
94
|
+
$[14] = t16;
|
|
95
|
+
$[15] = t17;
|
|
96
|
+
} else {
|
|
97
|
+
t17 = $[15];
|
|
98
|
+
}
|
|
99
|
+
let t18;
|
|
100
|
+
if ($[16] !== body || $[17] !== t12 || $[18] !== t17) {
|
|
101
|
+
t18 = /*#__PURE__*/jsxs("label", {
|
|
102
|
+
className: t12,
|
|
103
|
+
children: [t17, body]
|
|
104
|
+
});
|
|
105
|
+
$[16] = body;
|
|
106
|
+
$[17] = t12;
|
|
107
|
+
$[18] = t17;
|
|
108
|
+
$[19] = t18;
|
|
109
|
+
} else {
|
|
110
|
+
t18 = $[19];
|
|
111
|
+
}
|
|
112
|
+
let t19;
|
|
113
|
+
if ($[20] !== t10 || $[21] !== t18 || $[22] !== t9) {
|
|
114
|
+
t19 = /*#__PURE__*/jsx("div", {
|
|
115
|
+
className: t9,
|
|
116
|
+
style: t10,
|
|
117
|
+
children: t18
|
|
118
|
+
});
|
|
119
|
+
$[20] = t10;
|
|
120
|
+
$[21] = t18;
|
|
121
|
+
$[22] = t9;
|
|
122
|
+
$[23] = t19;
|
|
123
|
+
} else {
|
|
124
|
+
t19 = $[23];
|
|
125
|
+
}
|
|
126
|
+
return t19;
|
|
45
127
|
}
|
|
46
128
|
|
|
47
129
|
export { Checkbox as default };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@micromag/element-checkbox",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.77",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "",
|
|
6
6
|
"keywords": [
|
|
@@ -32,9 +32,11 @@
|
|
|
32
32
|
"license": "ISC",
|
|
33
33
|
"type": "module",
|
|
34
34
|
"module": "es/index.js",
|
|
35
|
+
"style": "./assets/css/styles.css",
|
|
35
36
|
"exports": {
|
|
36
37
|
".": {
|
|
37
38
|
"types": "./es/index.d.ts",
|
|
39
|
+
"style": "./assets/css/styles.css",
|
|
38
40
|
"import": "./es/index.js"
|
|
39
41
|
},
|
|
40
42
|
"./assets/css/styles": "./assets/css/styles.css",
|
|
@@ -51,16 +53,16 @@
|
|
|
51
53
|
"build": "../../scripts/prepare-package.sh --types"
|
|
52
54
|
},
|
|
53
55
|
"devDependencies": {
|
|
54
|
-
"react": "^
|
|
55
|
-
"react-dom": "^
|
|
56
|
+
"react": "^19.0.0",
|
|
57
|
+
"react-dom": "^19.0.0"
|
|
56
58
|
},
|
|
57
59
|
"peerDependencies": {
|
|
58
|
-
"react": "^
|
|
59
|
-
"react-dom": "^
|
|
60
|
+
"react": "^19.0.0",
|
|
61
|
+
"react-dom": "^19.0.0"
|
|
60
62
|
},
|
|
61
63
|
"dependencies": {
|
|
62
64
|
"@babel/runtime": "^7.28.6",
|
|
63
|
-
"@micromag/core": "^0.4.
|
|
65
|
+
"@micromag/core": "^0.4.77",
|
|
64
66
|
"classnames": "^2.2.6",
|
|
65
67
|
"lodash": "^4.17.23",
|
|
66
68
|
"react-intl": "^8.1.3 || ^10.0.0",
|
|
@@ -70,6 +72,6 @@
|
|
|
70
72
|
"access": "public",
|
|
71
73
|
"registry": "https://registry.npmjs.org/"
|
|
72
74
|
},
|
|
73
|
-
"gitHead": "
|
|
75
|
+
"gitHead": "b55c2c748383d30c8ff0ca7594e499dbdc8d1c10",
|
|
74
76
|
"types": "es/index.d.ts"
|
|
75
77
|
}
|