@lvce-editor/renderer-process 10.42.0 → 10.43.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/dist/rendererProcessMain.js +20 -0
- package/package.json +1 -1
|
@@ -5951,6 +5951,21 @@ const focusElementByName = (viewletId, name) => {
|
|
|
5951
5951
|
}
|
|
5952
5952
|
$Element.focus();
|
|
5953
5953
|
};
|
|
5954
|
+
const setValueByName = (viewletId, name, value) => {
|
|
5955
|
+
const selector = `[name="${name}"]`;
|
|
5956
|
+
const instance = state$6.instances[viewletId];
|
|
5957
|
+
if (!instance) {
|
|
5958
|
+
return;
|
|
5959
|
+
}
|
|
5960
|
+
const {
|
|
5961
|
+
$Viewlet
|
|
5962
|
+
} = instance.state;
|
|
5963
|
+
const $Element = $Viewlet.querySelector(selector);
|
|
5964
|
+
if (!$Element) {
|
|
5965
|
+
return;
|
|
5966
|
+
}
|
|
5967
|
+
$Element.value = value;
|
|
5968
|
+
};
|
|
5954
5969
|
const focusSelector = (viewletId, selector) => {
|
|
5955
5970
|
const instance = state$6.instances[viewletId];
|
|
5956
5971
|
if (!instance) {
|
|
@@ -6124,6 +6139,9 @@ const sendMultiple = commands => {
|
|
|
6124
6139
|
case 'Viewlet.focusElementByName':
|
|
6125
6140
|
// @ts-ignore
|
|
6126
6141
|
return focusElementByName(viewletId, method, ...args);
|
|
6142
|
+
case 'Viewlet.setValueByName':
|
|
6143
|
+
// @ts-ignore
|
|
6144
|
+
return setValueByName(viewletId, method, ...args);
|
|
6127
6145
|
case 'Viewlet.registerEventListeners':
|
|
6128
6146
|
return registerEventListeners(viewletId, method, ...args);
|
|
6129
6147
|
default:
|
|
@@ -6289,6 +6307,8 @@ const getFn = command => {
|
|
|
6289
6307
|
return createFunctionalRoot;
|
|
6290
6308
|
case 'Viewlet.focusElementByName':
|
|
6291
6309
|
return focusElementByName;
|
|
6310
|
+
case 'Viewlet.setValueByName':
|
|
6311
|
+
return setValueByName;
|
|
6292
6312
|
case 'Viewlet.registerEventListeners':
|
|
6293
6313
|
return registerEventListeners;
|
|
6294
6314
|
default:
|