@micromag/element-keypad 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 +106 -38
- package/package.json +9 -7
package/es/index.js
CHANGED
|
@@ -1,47 +1,115 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { c } from 'react/compiler-runtime';
|
|
2
2
|
import classNames from 'classnames';
|
|
3
3
|
import { getStyleFromAlignment } from '@micromag/core/utils';
|
|
4
4
|
import { jsx } from 'react/jsx-runtime';
|
|
5
5
|
|
|
6
6
|
var styles = {"inner":"micromag-element-keypad-inner"};
|
|
7
7
|
|
|
8
|
-
function Keypad(
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
align
|
|
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
|
-
|
|
8
|
+
function Keypad(t0) {
|
|
9
|
+
const $ = c(20);
|
|
10
|
+
const {
|
|
11
|
+
items: t1,
|
|
12
|
+
align: t2,
|
|
13
|
+
columns: t3,
|
|
14
|
+
spacing: t4,
|
|
15
|
+
className: t5,
|
|
16
|
+
itemClassName: t6,
|
|
17
|
+
innerClassName: t7
|
|
18
|
+
} = t0;
|
|
19
|
+
const items = t1 === undefined ? null : t1;
|
|
20
|
+
const align = t2 === undefined ? null : t2;
|
|
21
|
+
const columns = t3 === undefined ? 1 : t3;
|
|
22
|
+
const spacing = t4 === undefined ? 10 : t4;
|
|
23
|
+
const className = t5 === undefined ? null : t5;
|
|
24
|
+
const itemClassName = t6 === undefined ? null : t6;
|
|
25
|
+
const innerClassName = t7 === undefined ? null : t7;
|
|
26
|
+
const itemWidth = `${100 / columns}%`;
|
|
27
|
+
let t8;
|
|
28
|
+
if ($[0] !== className) {
|
|
29
|
+
t8 = classNames([styles.container, className]);
|
|
30
|
+
$[0] = className;
|
|
31
|
+
$[1] = t8;
|
|
32
|
+
} else {
|
|
33
|
+
t8 = $[1];
|
|
34
|
+
}
|
|
35
|
+
let t9;
|
|
36
|
+
if ($[2] !== innerClassName) {
|
|
37
|
+
t9 = classNames([styles.inner, innerClassName]);
|
|
38
|
+
$[2] = innerClassName;
|
|
39
|
+
$[3] = t9;
|
|
40
|
+
} else {
|
|
41
|
+
t9 = $[3];
|
|
42
|
+
}
|
|
43
|
+
let t10;
|
|
44
|
+
if ($[4] !== align) {
|
|
45
|
+
t10 = getStyleFromAlignment({
|
|
46
|
+
horizontal: align
|
|
47
|
+
});
|
|
48
|
+
$[4] = align;
|
|
49
|
+
$[5] = t10;
|
|
50
|
+
} else {
|
|
51
|
+
t10 = $[5];
|
|
52
|
+
}
|
|
53
|
+
let t11;
|
|
54
|
+
if ($[6] !== t10) {
|
|
55
|
+
t11 = {
|
|
56
|
+
...t10
|
|
57
|
+
};
|
|
58
|
+
$[6] = t10;
|
|
59
|
+
$[7] = t11;
|
|
60
|
+
} else {
|
|
61
|
+
t11 = $[7];
|
|
62
|
+
}
|
|
63
|
+
let t12;
|
|
64
|
+
if ($[8] !== itemClassName || $[9] !== itemWidth || $[10] !== items || $[11] !== spacing) {
|
|
65
|
+
t12 = items !== null ? items.map(item => {
|
|
66
|
+
const {
|
|
67
|
+
key
|
|
68
|
+
} = item || {};
|
|
69
|
+
return /*#__PURE__*/jsx("div", {
|
|
70
|
+
className: classNames([styles.item, itemClassName]),
|
|
71
|
+
style: {
|
|
72
|
+
width: itemWidth,
|
|
73
|
+
padding: spacing / 2
|
|
74
|
+
},
|
|
75
|
+
children: item
|
|
76
|
+
}, key);
|
|
77
|
+
}) : null;
|
|
78
|
+
$[8] = itemClassName;
|
|
79
|
+
$[9] = itemWidth;
|
|
80
|
+
$[10] = items;
|
|
81
|
+
$[11] = spacing;
|
|
82
|
+
$[12] = t12;
|
|
83
|
+
} else {
|
|
84
|
+
t12 = $[12];
|
|
85
|
+
}
|
|
86
|
+
let t13;
|
|
87
|
+
if ($[13] !== t11 || $[14] !== t12 || $[15] !== t9) {
|
|
88
|
+
t13 = /*#__PURE__*/jsx("div", {
|
|
89
|
+
className: t9,
|
|
90
|
+
style: t11,
|
|
91
|
+
children: t12
|
|
92
|
+
});
|
|
93
|
+
$[13] = t11;
|
|
94
|
+
$[14] = t12;
|
|
95
|
+
$[15] = t9;
|
|
96
|
+
$[16] = t13;
|
|
97
|
+
} else {
|
|
98
|
+
t13 = $[16];
|
|
99
|
+
}
|
|
100
|
+
let t14;
|
|
101
|
+
if ($[17] !== t13 || $[18] !== t8) {
|
|
102
|
+
t14 = /*#__PURE__*/jsx("div", {
|
|
103
|
+
className: t8,
|
|
104
|
+
children: t13
|
|
105
|
+
});
|
|
106
|
+
$[17] = t13;
|
|
107
|
+
$[18] = t8;
|
|
108
|
+
$[19] = t14;
|
|
109
|
+
} else {
|
|
110
|
+
t14 = $[19];
|
|
111
|
+
}
|
|
112
|
+
return t14;
|
|
45
113
|
}
|
|
46
114
|
|
|
47
115
|
export { Keypad as default };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@micromag/element-keypad",
|
|
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
|
}
|