@raketa-builder/menu-builder 1.6.4 → 1.6.5
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.
|
@@ -32,7 +32,7 @@ const ColumnBuilder = ({ value, onChange }) => {
|
|
|
32
32
|
onChange(newState);
|
|
33
33
|
};
|
|
34
34
|
const updateColumnWidth = (column, width) => {
|
|
35
|
-
const updatedColumn = __spreadProps(__spreadValues({}, column), { width: parseInt(width) });
|
|
35
|
+
const updatedColumn = width === "" ? __spreadProps(__spreadValues({}, column), { width: void 0 }) : __spreadProps(__spreadValues({}, column), { width: parseInt(width) });
|
|
36
36
|
updateColumn(state.columns, updatedColumn);
|
|
37
37
|
};
|
|
38
38
|
const duplicateColumn = (items, item) => {
|
|
@@ -80,16 +80,16 @@ const ColumnBuilder = ({ value, onChange }) => {
|
|
|
80
80
|
gap: "0.5em"
|
|
81
81
|
},
|
|
82
82
|
children: state.columns.map((column, idx) => {
|
|
83
|
-
const
|
|
84
|
-
const
|
|
83
|
+
const selectValue = column.width !== void 0 ? column.width.toString() : "";
|
|
84
|
+
const widthStyle = column.width !== void 0 ? {
|
|
85
|
+
flexBasis: `calc(${column.width / 5 * 100}% - 0.5em)`,
|
|
86
|
+
minWidth: `calc(${column.width / 5 * 100}% - 0.5em)`,
|
|
87
|
+
flex: `0 0 calc(${column.width / 5 * 100}% - 0.5em)`
|
|
88
|
+
} : {};
|
|
85
89
|
return /* @__PURE__ */ jsxs(
|
|
86
90
|
Panel,
|
|
87
91
|
{
|
|
88
|
-
style:
|
|
89
|
-
flexBasis: `calc(${widthPercentage}% - 0.5em)`,
|
|
90
|
-
minWidth: `calc(${widthPercentage}% - 0.5em)`,
|
|
91
|
-
flex: `0 0 calc(${widthPercentage}% - 0.5em)`
|
|
92
|
-
},
|
|
92
|
+
style: widthStyle,
|
|
93
93
|
children: [
|
|
94
94
|
/* @__PURE__ */ jsxs(
|
|
95
95
|
PanelTitle,
|
|
@@ -116,17 +116,18 @@ const ColumnBuilder = ({ value, onChange }) => {
|
|
|
116
116
|
/* @__PURE__ */ jsxs(
|
|
117
117
|
"select",
|
|
118
118
|
{
|
|
119
|
-
value:
|
|
119
|
+
value: selectValue,
|
|
120
120
|
onChange: (e) => updateColumnWidth(column, e.target.value),
|
|
121
121
|
style: {
|
|
122
122
|
padding: "0.25em 0.35em",
|
|
123
123
|
borderRadius: "4px",
|
|
124
124
|
border: "1px solid #ccc",
|
|
125
125
|
fontSize: "0.875rem",
|
|
126
|
-
minWidth: "
|
|
126
|
+
minWidth: "60px"
|
|
127
127
|
},
|
|
128
|
-
title: `Width: ${
|
|
128
|
+
title: selectValue === "" ? "Width: Auto" : `Width: ${selectValue}/5`,
|
|
129
129
|
children: [
|
|
130
|
+
/* @__PURE__ */ jsx("option", { value: "", children: "Auto" }),
|
|
130
131
|
/* @__PURE__ */ jsx("option", { value: "1", children: "Width 1" }),
|
|
131
132
|
/* @__PURE__ */ jsx("option", { value: "2", children: "Width 2" }),
|
|
132
133
|
/* @__PURE__ */ jsx("option", { value: "3", children: "Width 3" }),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@raketa-builder/menu-builder",
|
|
3
|
-
"version": "1.6.
|
|
3
|
+
"version": "1.6.5",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.mjs",
|
|
@@ -30,8 +30,8 @@
|
|
|
30
30
|
"react-dom": ">=19.1.0 && <=19.3.0"
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@raketa-builder/builder": "1.6.
|
|
34
|
-
"@raketa-builder/ui": "1.6.
|
|
33
|
+
"@raketa-builder/builder": "1.6.5",
|
|
34
|
+
"@raketa-builder/ui": "1.6.5",
|
|
35
35
|
"react-sortablejs": "6.1.4"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|