aleman 1.4.7 → 1.4.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.
package/ChangeLog
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import {template
|
|
1
|
+
import {template} from 'putout';
|
|
2
2
|
import {
|
|
3
|
+
addClassName,
|
|
3
4
|
hasDataName,
|
|
4
5
|
setAttributeValue,
|
|
5
6
|
} from '../jsx-operator.js';
|
|
6
7
|
|
|
7
|
-
const {addAttributeValue} = operator;
|
|
8
|
-
|
|
9
8
|
const {entries} = Object;
|
|
10
9
|
|
|
11
10
|
const noop = () => {};
|
|
@@ -82,7 +81,7 @@ export const traverse = ({options, push}) => ({
|
|
|
82
81
|
});
|
|
83
82
|
|
|
84
83
|
function setSubmenu(menuItem) {
|
|
85
|
-
|
|
84
|
+
addClassName(menuItem, 'menu-submenu');
|
|
86
85
|
}
|
|
87
86
|
|
|
88
87
|
function setDataMenuPath(key, name, menuItem) {
|
|
@@ -91,7 +90,7 @@ function setDataMenuPath(key, name, menuItem) {
|
|
|
91
90
|
}
|
|
92
91
|
|
|
93
92
|
function setIcon(name, menuItem) {
|
|
94
|
-
|
|
93
|
+
addClassName(menuItem, `icon ${getIconName(name)}`);
|
|
95
94
|
}
|
|
96
95
|
|
|
97
96
|
function getIconName(name) {
|
|
@@ -100,4 +99,3 @@ function getIconName(name) {
|
|
|
100
99
|
.replace(/\s/g, '-')
|
|
101
100
|
.toLowerCase();
|
|
102
101
|
}
|
|
103
|
-
|
|
@@ -1,15 +1,12 @@
|
|
|
1
1
|
import {operator, types} from 'putout';
|
|
2
2
|
import {
|
|
3
3
|
addClassName,
|
|
4
|
+
containsClassName,
|
|
4
5
|
hasDataName,
|
|
5
|
-
removeAttributeValue,
|
|
6
6
|
removeClassName,
|
|
7
7
|
} from '../jsx-operator.js';
|
|
8
8
|
|
|
9
|
-
const {
|
|
10
|
-
getAttributeValue,
|
|
11
|
-
hasTagName,
|
|
12
|
-
} = operator;
|
|
9
|
+
const {hasTagName} = operator;
|
|
13
10
|
|
|
14
11
|
const {isJSXElement} = types;
|
|
15
12
|
|
|
@@ -68,14 +65,12 @@ export const traverse = ({options, push}) => ({
|
|
|
68
65
|
});
|
|
69
66
|
|
|
70
67
|
function isParentSelected(path) {
|
|
71
|
-
|
|
72
|
-
return classAttributeValue.includes('menu-item-selected');
|
|
68
|
+
return containsClassName(path, 'menu-item-selected');
|
|
73
69
|
}
|
|
74
70
|
|
|
75
71
|
function unselect(path) {
|
|
76
72
|
if (!path)
|
|
77
73
|
return;
|
|
78
74
|
|
|
79
|
-
|
|
75
|
+
removeClassName(path, 'menu-item-selected');
|
|
80
76
|
}
|
|
81
|
-
|