@lvce-editor/renderer-process 13.9.0 → 13.11.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.
@@ -1266,6 +1266,7 @@ const TextArea$1 = 'textarea';
1266
1266
  const Select$1 = 'select';
1267
1267
  const Option$1 = 'option';
1268
1268
  const Code$1 = 'code';
1269
+ const Label$1 = 'label';
1269
1270
  const Audio$2 = 0;
1270
1271
  const Button = 1;
1271
1272
  const Col = 2;
@@ -1319,6 +1320,7 @@ const TextArea = 62;
1319
1320
  const Select = 63;
1320
1321
  const Option = 64;
1321
1322
  const Code$2 = 65;
1323
+ const Label = 66;
1322
1324
  const getElementTag = type => {
1323
1325
  switch (type) {
1324
1326
  case Audio$2:
@@ -1425,6 +1427,8 @@ const getElementTag = type => {
1425
1427
  return Option$1;
1426
1428
  case Code$2:
1427
1429
  return Code$1;
1430
+ case Label:
1431
+ return Label$1;
1428
1432
  default:
1429
1433
  throw new Error(`element tag not found ${type}`);
1430
1434
  }
@@ -1825,6 +1829,8 @@ const getEventListenerArg = (param, event) => {
1825
1829
  return event.defaultPrevented;
1826
1830
  case 'event.target.dataset.name':
1827
1831
  return event.target.dataset.name;
1832
+ case 'event.target.dataset.index':
1833
+ return event.target.dataset.index;
1828
1834
  default:
1829
1835
  return param;
1830
1836
  }
@@ -10294,7 +10300,7 @@ const focusElementByName = (viewletId, name) => {
10294
10300
  }
10295
10301
  $Element.focus();
10296
10302
  };
10297
- const setValueByName = (viewletId, name, value) => {
10303
+ const setElementProperty = (viewletId, name, key, value) => {
10298
10304
  const selector = `[name="${name}"]`;
10299
10305
  const instance = state$6.instances[viewletId];
10300
10306
  if (!instance) {
@@ -10307,7 +10313,13 @@ const setValueByName = (viewletId, name, value) => {
10307
10313
  if (!$Element) {
10308
10314
  return;
10309
10315
  }
10310
- $Element.value = value;
10316
+ $Element[key] = value;
10317
+ };
10318
+ const setValueByName = (viewletId, name, value) => {
10319
+ setElementProperty(viewletId, name, 'value', value);
10320
+ };
10321
+ const setCheckBoxValue = (viewletId, name, value) => {
10322
+ setElementProperty(viewletId, name, 'checked', value);
10311
10323
  };
10312
10324
  const setSelectionByName = (viewletId, name, start, end) => {
10313
10325
  const selector = `[name="${name}"]`;
@@ -10540,11 +10552,16 @@ const sendMultiple = commands => {
10540
10552
  // @ts-ignore
10541
10553
  setValueByName(viewletId, method, ...args);
10542
10554
  break;
10555
+ case 'Viewlet.setCheckBoxValue':
10556
+ // @ts-ignore
10557
+ setCheckBoxValue(viewletId, method, ...args);
10558
+ break;
10543
10559
  case 'Viewlet.setSelectionByName':
10544
10560
  // @ts-ignore
10545
10561
  setSelectionByName(viewletId, method, ...args);
10546
10562
  break;
10547
10563
  case 'Viewlet.registerEventListeners':
10564
+ // @ts-ignore
10548
10565
  registerEventListeners(viewletId, method, ...args);
10549
10566
  break;
10550
10567
  case 'Viewlet.setUid':
@@ -10722,6 +10739,8 @@ const getFn = command => {
10722
10739
  return focusElementByName;
10723
10740
  case 'Viewlet.setValueByName':
10724
10741
  return setValueByName;
10742
+ case 'Viewlet.setCheckBoxValue':
10743
+ return setCheckBoxValue;
10725
10744
  case 'Viewlet.registerEventListeners':
10726
10745
  return registerEventListeners;
10727
10746
  case 'Viewlet.setPatches':
@@ -10739,6 +10758,7 @@ const getFn = command => {
10739
10758
  const executeCommands = commands => {
10740
10759
  for (const [command, ...args] of commands) {
10741
10760
  const fn = getFn(command);
10761
+ // @ts-ignore
10742
10762
  fn(...args);
10743
10763
  }
10744
10764
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/renderer-process",
3
- "version": "13.9.0",
3
+ "version": "13.11.0",
4
4
  "description": "",
5
5
  "keywords": [
6
6
  "lvce-editor",