@saltcorn/builder 0.8.8-beta.4 → 0.8.8-beta.6
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/package.json
CHANGED
|
@@ -178,32 +178,54 @@ export const RelationPicker = ({ options, viewname, update }) => {
|
|
|
178
178
|
`${inboundKey.name}_${inboundKey.table}_${level.table}_${reclevel}`
|
|
179
179
|
);
|
|
180
180
|
return hasSubLevels ? (
|
|
181
|
-
<
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
>
|
|
188
|
-
<div
|
|
189
|
-
className={`dropdown-toggle ${identifier}_inbound_toggle dropdown_level_${reclevel}`}
|
|
181
|
+
<div key={`${identifier}_inboundkey_key_div`}>
|
|
182
|
+
<li
|
|
183
|
+
key={`${identifier}_inboundkey_key`}
|
|
184
|
+
className={`dropdown-item ${identifier}_inbound_item item_level_${reclevel} ${
|
|
185
|
+
reclevel < 5 ? "dropstart" : "dropdown"
|
|
186
|
+
}`}
|
|
190
187
|
role="button"
|
|
191
|
-
aria-expanded="false"
|
|
192
|
-
onClick={() => {
|
|
193
|
-
$(
|
|
194
|
-
`.${identifier}_inbound_toggle,${levelClasses(
|
|
195
|
-
reclevel
|
|
196
|
-
)}`
|
|
197
|
-
).dropdown("toggle");
|
|
198
|
-
if (reclevel > maxRecLevel) setMaxRecLevel(reclevel);
|
|
199
|
-
$(activeClasses(reclevel)).removeClass("active");
|
|
200
|
-
$(`.${identifier}_inbound_item`).addClass(() => "active");
|
|
201
|
-
}}
|
|
202
188
|
>
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
189
|
+
<div
|
|
190
|
+
className={`dropdown-toggle ${identifier}_inbound_toggle dropdown_level_${reclevel}`}
|
|
191
|
+
role="button"
|
|
192
|
+
aria-expanded="false"
|
|
193
|
+
onClick={() => {
|
|
194
|
+
$(
|
|
195
|
+
`.${identifier}_inbound_toggle,${levelClasses(
|
|
196
|
+
reclevel
|
|
197
|
+
)}`
|
|
198
|
+
).dropdown("toggle");
|
|
199
|
+
if (reclevel > maxRecLevel) setMaxRecLevel(reclevel);
|
|
200
|
+
$(activeClasses(reclevel)).removeClass("active");
|
|
201
|
+
$(`.${identifier}_inbound_item`).addClass(
|
|
202
|
+
() => "active"
|
|
203
|
+
);
|
|
204
|
+
}}
|
|
205
|
+
>
|
|
206
|
+
{inboundKey.name} (from {inboundKey.table})
|
|
207
|
+
</div>
|
|
208
|
+
{buildPicker(inboundKey, reclevel + 1)}
|
|
209
|
+
</li>
|
|
210
|
+
{/* it's a level and a direct link */}
|
|
211
|
+
{inboundKey.relPath ? (
|
|
212
|
+
<li
|
|
213
|
+
key={`${identifier}_inboundkey_key_direct`}
|
|
214
|
+
className="dropdown-item"
|
|
215
|
+
role="button"
|
|
216
|
+
onClick={() => {
|
|
217
|
+
update(inboundKey.relPath);
|
|
218
|
+
$(".dropdown-item.active").removeClass("active");
|
|
219
|
+
$(`${levelClasses(0)}`).dropdown("toggle");
|
|
220
|
+
setMaxRecLevel(maxRecLevelDefault);
|
|
221
|
+
}}
|
|
222
|
+
>
|
|
223
|
+
{inboundKey.name} (from {inboundKey.table})
|
|
224
|
+
</li>
|
|
225
|
+
) : (
|
|
226
|
+
""
|
|
227
|
+
)}
|
|
228
|
+
</div>
|
|
207
229
|
) : (
|
|
208
230
|
<li
|
|
209
231
|
key={`${identifier}_inboundkey_key`}
|
|
@@ -89,9 +89,11 @@ const SearchBarSettings = () => {
|
|
|
89
89
|
actions: { setProp },
|
|
90
90
|
has_dropdown,
|
|
91
91
|
show_badges,
|
|
92
|
+
autofocus,
|
|
92
93
|
} = useNode((node) => ({
|
|
93
94
|
has_dropdown: node.data.props.has_dropdown,
|
|
94
95
|
show_badges: node.data.props.show_badges,
|
|
96
|
+
autofocus: node.data.props.autofocus,
|
|
95
97
|
}));
|
|
96
98
|
const setAProp = setAPropGen(setProp);
|
|
97
99
|
|
|
@@ -117,6 +119,16 @@ const SearchBarSettings = () => {
|
|
|
117
119
|
/>
|
|
118
120
|
<label className="form-check-label">Show current state badges</label>
|
|
119
121
|
</div>
|
|
122
|
+
<div className="form-check">
|
|
123
|
+
<input
|
|
124
|
+
className="form-check-input"
|
|
125
|
+
name="block"
|
|
126
|
+
type="checkbox"
|
|
127
|
+
checked={autofocus}
|
|
128
|
+
onChange={setAProp("autofocus", { checked: true })}
|
|
129
|
+
/>
|
|
130
|
+
<label className="form-check-label">Autofocus</label>
|
|
131
|
+
</div>
|
|
120
132
|
</div>
|
|
121
133
|
);
|
|
122
134
|
};
|
|
@@ -129,11 +141,12 @@ SearchBar.craft = {
|
|
|
129
141
|
props: {
|
|
130
142
|
has_dropdown: false,
|
|
131
143
|
show_badges: false,
|
|
144
|
+
autofocus: false,
|
|
132
145
|
},
|
|
133
146
|
related: {
|
|
134
147
|
settings: SearchBarSettings,
|
|
135
148
|
segment_type: "search_bar",
|
|
136
149
|
hasContents: true,
|
|
137
|
-
fields: ["has_dropdown", "show_badges"],
|
|
150
|
+
fields: ["has_dropdown", "show_badges", "autofocus"],
|
|
138
151
|
},
|
|
139
152
|
};
|
|
@@ -197,7 +197,7 @@ const ViewSettings = () => {
|
|
|
197
197
|
</select>
|
|
198
198
|
</div>
|
|
199
199
|
)}
|
|
200
|
-
{options.mode
|
|
200
|
+
{options.mode !== "edit" && (
|
|
201
201
|
<Fragment>
|
|
202
202
|
<div>
|
|
203
203
|
<label>State</label>
|
|
@@ -207,10 +207,17 @@ const ViewSettings = () => {
|
|
|
207
207
|
onChange={setAProp("state")}
|
|
208
208
|
onBlur={setAProp("state")}
|
|
209
209
|
>
|
|
210
|
-
{buildOptions(
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
210
|
+
{buildOptions(
|
|
211
|
+
[
|
|
212
|
+
"shared",
|
|
213
|
+
...(options.mode === "page" ? ["fixed"] : []),
|
|
214
|
+
"local",
|
|
215
|
+
],
|
|
216
|
+
{
|
|
217
|
+
valAttr: true,
|
|
218
|
+
capitalize: true,
|
|
219
|
+
}
|
|
220
|
+
)}
|
|
214
221
|
</select>
|
|
215
222
|
</div>
|
|
216
223
|
{state === "fixed" &&
|