@raketa-builder/menu-builder 0.3.0 → 0.5.0
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/.turbo/turbo-build.log +2 -2
- package/.turbo/turbo-lint.log +12 -12
- package/dist/index.js +21 -1
- package/package.json +1 -1
- package/src/MenuBuilder/Factories.js +1 -0
- package/src/MenuBuilder/ItemForm.js +16 -0
- package/src/MenuBuilder/index.js +6 -1
package/.turbo/turbo-build.log
CHANGED
package/.turbo/turbo-lint.log
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
$ TIMING=1 eslint "**/*.js"
|
|
2
|
-
Rule
|
|
3
|
-
|
|
4
|
-
react/
|
|
5
|
-
react/
|
|
6
|
-
react/require-render-return
|
|
7
|
-
react
|
|
8
|
-
react/
|
|
9
|
-
react-hooks/rules-of-hooks
|
|
10
|
-
react/no-string-refs
|
|
11
|
-
react/no-unescaped-entities
|
|
12
|
-
react/no-
|
|
13
|
-
|
|
2
|
+
Rule | Time (ms) | Relative
|
|
3
|
+
:---------------------------------|----------:|--------:
|
|
4
|
+
react/display-name | 28.043 | 25.4%
|
|
5
|
+
react/no-direct-mutation-state | 27.800 | 25.2%
|
|
6
|
+
react/require-render-return | 20.287 | 18.4%
|
|
7
|
+
react/no-deprecated | 4.712 | 4.3%
|
|
8
|
+
react-hooks/exhaustive-deps | 4.033 | 3.7%
|
|
9
|
+
react-hooks/rules-of-hooks | 3.917 | 3.5%
|
|
10
|
+
react/no-string-refs | 3.201 | 2.9%
|
|
11
|
+
react/no-unescaped-entities | 2.490 | 2.3%
|
|
12
|
+
react/jsx-no-comment-textnodes | 1.645 | 1.5%
|
|
13
|
+
jsx-a11y/role-supports-aria-props | 1.306 | 1.2%
|
package/dist/index.js
CHANGED
|
@@ -1118,6 +1118,7 @@ var Factories = {
|
|
|
1118
1118
|
item: () => ({
|
|
1119
1119
|
id: rand(4),
|
|
1120
1120
|
html_id: "",
|
|
1121
|
+
class_name: "",
|
|
1121
1122
|
label: "New item",
|
|
1122
1123
|
url: "#",
|
|
1123
1124
|
target: "",
|
|
@@ -1261,6 +1262,20 @@ var ItemForm = ({ item, onChange, onRemove, onDuplicate }) => /* @__PURE__ */ (0
|
|
|
1261
1262
|
}
|
|
1262
1263
|
)
|
|
1263
1264
|
] }),
|
|
1265
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_ui2.FormGroup, { children: [
|
|
1266
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_ui2.Label, { htmlFor: "class_name", children: "CSS class" }),
|
|
1267
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
1268
|
+
import_ui2.Input,
|
|
1269
|
+
{
|
|
1270
|
+
name: "class_name",
|
|
1271
|
+
type: "text",
|
|
1272
|
+
value: item.class_name,
|
|
1273
|
+
onChange: (e) => onChange(__spreadProps(__spreadValues({}, item), {
|
|
1274
|
+
class_name: e.target.value
|
|
1275
|
+
}))
|
|
1276
|
+
}
|
|
1277
|
+
)
|
|
1278
|
+
] }),
|
|
1264
1279
|
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_ui2.FormGroup, { children: [
|
|
1265
1280
|
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_ui2.Label, { htmlFor: "target", children: "Target" }),
|
|
1266
1281
|
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
|
|
@@ -1705,7 +1720,12 @@ var MenuBuilder = ({ widgets, value, onChange }) => {
|
|
|
1705
1720
|
items: state.items,
|
|
1706
1721
|
tab: currentTab,
|
|
1707
1722
|
onTab: (tab) => setState(__spreadProps(__spreadValues({}, state), { tab })),
|
|
1708
|
-
onChange: (items) =>
|
|
1723
|
+
onChange: (items) => {
|
|
1724
|
+
const newState = __spreadProps(__spreadValues({}, state), { items });
|
|
1725
|
+
setState(newState);
|
|
1726
|
+
if (onChange)
|
|
1727
|
+
onChange(newState);
|
|
1728
|
+
}
|
|
1709
1729
|
}
|
|
1710
1730
|
),
|
|
1711
1731
|
currentItem && /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { children: [
|
package/package.json
CHANGED
|
@@ -62,6 +62,22 @@ const ItemForm = ({ item, onChange, onRemove, onDuplicate }) => (
|
|
|
62
62
|
/>
|
|
63
63
|
</FormGroup>
|
|
64
64
|
|
|
65
|
+
<FormGroup>
|
|
66
|
+
<Label htmlFor="class_name">CSS class</Label>
|
|
67
|
+
|
|
68
|
+
<Input
|
|
69
|
+
name="class_name"
|
|
70
|
+
type="text"
|
|
71
|
+
value={item.class_name}
|
|
72
|
+
onChange={(e) =>
|
|
73
|
+
onChange({
|
|
74
|
+
...item,
|
|
75
|
+
class_name: e.target.value,
|
|
76
|
+
})
|
|
77
|
+
}
|
|
78
|
+
/>
|
|
79
|
+
</FormGroup>
|
|
80
|
+
|
|
65
81
|
<FormGroup>
|
|
66
82
|
<Label htmlFor="target">Target</Label>
|
|
67
83
|
|
package/src/MenuBuilder/index.js
CHANGED
|
@@ -56,7 +56,12 @@ const MenuBuilder = ({ widgets, value, onChange }) => {
|
|
|
56
56
|
items={state.items}
|
|
57
57
|
tab={currentTab}
|
|
58
58
|
onTab={(tab) => setState({ ...state, tab })}
|
|
59
|
-
onChange={(items) =>
|
|
59
|
+
onChange={(items) => {
|
|
60
|
+
const newState = { ...state, items };
|
|
61
|
+
|
|
62
|
+
setState(newState);
|
|
63
|
+
if (onChange) onChange(newState);
|
|
64
|
+
}}
|
|
60
65
|
/>
|
|
61
66
|
|
|
62
67
|
{currentItem && (
|