@processmaker/screen-builder 3.0.7 → 3.1.1

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@processmaker/screen-builder",
3
- "version": "3.0.7",
3
+ "version": "3.1.1",
4
4
  "scripts": {
5
5
  "dev": "VITE_COVERAGE=true vite",
6
6
  "build": "vite build",
@@ -57,7 +57,7 @@
57
57
  "@fortawesome/fontawesome-free": "^5.6.1",
58
58
  "@originjs/vite-plugin-commonjs": "^1.0.3",
59
59
  "@panter/vue-i18next": "^0.15.2",
60
- "@processmaker/vue-form-elements": "0.61.2",
60
+ "@processmaker/vue-form-elements": "0.63.0",
61
61
  "@processmaker/vue-multiselect": "2.3.0",
62
62
  "@storybook/addon-essentials": "^7.6.13",
63
63
  "@storybook/addon-interactions": "^7.6.13",
@@ -116,7 +116,7 @@
116
116
  },
117
117
  "peerDependencies": {
118
118
  "@panter/vue-i18next": "^0.15.0",
119
- "@processmaker/vue-form-elements": "0.61.2",
119
+ "@processmaker/vue-form-elements": "0.63.0",
120
120
  "i18next": "^15.0.8",
121
121
  "vue": "^2.6.12",
122
122
  "vuex": "^3.1.1"
@@ -31,6 +31,16 @@
31
31
  />
32
32
  </div>
33
33
 
34
+ <div v-if="fields.length > 1 && renderAs === 'checkbox'" class="mt-3">
35
+ <label for="aria-label">{{ $t("Aria Label") }}</label>
36
+ <b-form-select
37
+ id="aria-label"
38
+ v-model="ariaLabelField"
39
+ :options="fields"
40
+ data-cy="inspector-collection-aria-label"
41
+ />
42
+ </div>
43
+
34
44
  <div v-if="fields.length > 1" class="mt-3">
35
45
  <pmql-input
36
46
  v-model="pmql"
@@ -72,6 +82,7 @@ const CONFIG_FIELDS = [
72
82
  "collectionId",
73
83
  "labelField",
74
84
  "valueField",
85
+ "ariaLabelField",
75
86
  "pmql",
76
87
  "unique"
77
88
  ];
@@ -81,7 +92,7 @@ export default {
81
92
  MustacheHelper,
82
93
  ScreenVariableSelector
83
94
  },
84
- props: ["value"],
95
+ props: ["value", "renderAs"],
85
96
  data() {
86
97
  return {
87
98
  collections: [],
@@ -89,6 +100,7 @@ export default {
89
100
  collectionId: null,
90
101
  labelField: null,
91
102
  valueField: null,
103
+ ariaLabelField: null,
92
104
  pmql: "",
93
105
  unique: false
94
106
  };
@@ -137,6 +149,7 @@ export default {
137
149
  resetFields() {
138
150
  this.labelField = null;
139
151
  this.valueField = null;
152
+ this.ariaLabelField = null;
140
153
  },
141
154
  getCollections() {
142
155
  this.$dataProvider.getCollections().then((response) => {
@@ -28,6 +28,9 @@
28
28
  </div>
29
29
  <label class="mt-3" for="option-content">{{ $t('Content') }}</label>
30
30
  <b-form-input id="option-content" v-model="optionContent" data-cy="inspector-option-content" />
31
+
32
+ <label v-if="renderAs === 'checkbox'" class="mt-3" for="option-aria-label">{{ $t('Aria Label') }}</label>
33
+ <b-form-input v-if="renderAs === 'checkbox'" id="option-aria-label" v-model="optionAriaLabel" data-cy="inspector-option-aria-label" />
31
34
  </div>
32
35
 
33
36
  <div class="card-footer text-right p-2">
@@ -74,6 +77,9 @@
74
77
  </div>
75
78
  <label class="mt-3" for="option-content">{{ $t('Content') }}</label>
76
79
  <b-form-input id="option-content" v-model="optionContent" data-cy="inspector-option-content" />
80
+
81
+ <label v-if="renderAs === 'checkbox'" class="mt-3" for="option-aria-label">{{ $t('Aria Label') }}</label>
82
+ <b-form-input v-if="renderAs === 'checkbox'" id="option-aria-label" v-model="optionAriaLabel" data-cy="inspector-option-aria-label" />
77
83
  </div>
78
84
 
79
85
  <div class="card-footer text-right p-2">
@@ -131,7 +137,7 @@
131
137
  </div>
132
138
 
133
139
  <div v-if="dataSource === dataSourceValues.collection">
134
- <collection-select-list v-model="collectionOptions"></collection-select-list>
140
+ <collection-select-list v-model="collectionOptions" :renderAs="renderAs"></collection-select-list>
135
141
  </div>
136
142
 
137
143
  <div v-if="showRenderAs">
@@ -203,12 +209,21 @@
203
209
  <mustache-helper/>
204
210
  <b-form-input id="value" v-model="value" @change="valueChanged" data-cy="inspector-datasource-content"/>
205
211
  <small class="form-text text-muted mb-3">{{ $t('Content to display to the user in the select list.') }}</small>
212
+
213
+ <label v-if="renderAs === 'checkbox'" for="aria-label">{{ $t('Aria Label') }}</label>
214
+ <mustache-helper v-if="renderAs === 'checkbox'" />
215
+ <b-form-input v-if="renderAs === 'checkbox'" id="aria-label" v-model="optionAriaLabel" data-cy="inspector-datasource-aria-label"/>
216
+ <small v-if="renderAs === 'checkbox'" class="form-text text-muted mb-3">{{ $t('Aria label for accessibility support.') }}</small>
206
217
  </div>
207
218
 
208
219
  <div v-if="valueTypeReturned === 'single' && dataSource === dataSourceValues.dataObject">
209
220
  <label for="key">{{ $t('Variable Data Property') }}</label>
210
221
  <b-form-input id="key" v-model="key" @change="keyChanged" placeholder="Request Variable Property" data-cy="inspector-options-value" />
211
222
  <small class="form-text text-muted mb-3">{{ $t('Enter the property name from the Request data variable that will be passed as the value when selected.') }}</small>
223
+
224
+ <label v-if="renderAs === 'checkbox'" for="aria-label">{{ $t('Aria Label') }}</label>
225
+ <b-form-input v-if="renderAs === 'checkbox'" id="aria-label" v-model="optionAriaLabel" placeholder="Aria Label Property" data-cy="inspector-options-aria-label" />
226
+ <small v-if="renderAs === 'checkbox'" class="form-text text-muted mb-3">{{ $t('Enter the property name for the aria label from the Request data variable.') }}</small>
212
227
  </div>
213
228
 
214
229
  <div v-if="dataSource === dataSourceValues.dataConnector">
@@ -287,6 +302,7 @@ export default {
287
302
  removeIndex: null,
288
303
  optionValue: '',
289
304
  optionContent: '',
305
+ optionAriaLabel: '',
290
306
  showRenderAs: false,
291
307
  renderAs: 'dropdown',
292
308
  allowMultiSelect: false,
@@ -413,6 +429,9 @@ export default {
413
429
  valueField() {
414
430
  return this.value || 'content';
415
431
  },
432
+ ariaLabelField() {
433
+ return this.optionAriaLabel || 'ariaLabel';
434
+ },
416
435
  currentItemToDelete() {
417
436
  if (this.removeIndex !== null
418
437
  && this.optionsList.length > 0
@@ -450,6 +469,7 @@ export default {
450
469
  editIndex: this.editIndex,
451
470
  removeIndex: this.removeIndex,
452
471
  valueTypeReturned: this.valueTypeReturned,
472
+ optionAriaLabel: this.optionAriaLabel,
453
473
  };
454
474
  },
455
475
  },
@@ -467,6 +487,7 @@ export default {
467
487
  this.selectedEndPoint = this.options.selectedEndPoint,
468
488
  this.key = this.options.key;
469
489
  this.value = this.options.value;
490
+ this.optionAriaLabel = this.options.optionAriaLabel;
470
491
  this.pmqlQuery = this.options.pmqlQuery;
471
492
  this.defaultOptionKey= this.options.defaultOptionKey;
472
493
  this.selectedOptions = this.options.selectedOptions;
@@ -530,8 +551,9 @@ export default {
530
551
  const that = this;
531
552
  jsonList.forEach (item => {
532
553
  that.optionsList.push({
533
- [that.keyField] : item[that.keyField],
534
- [that.valueField] : item[that.valueField],
554
+ [that.keyField]: item[that.keyField],
555
+ [that.valueField]: item[that.valueField],
556
+ [that.ariaLabelField]: item[that.ariaLabelField]
535
557
  });
536
558
  });
537
559
  this.jsonError = '';
@@ -560,12 +582,14 @@ export default {
560
582
  this.editIndex = index;
561
583
  this.optionContent = this.optionsList[index][this.valueField];
562
584
  this.optionValue = this.optionsList[index][this.keyField];
585
+ this.optionAriaLabel = this.optionsList[index][this.ariaLabelField];
563
586
  this.optionError = '';
564
587
  },
565
588
  showAddOption() {
566
589
  this.optionCardType = 'insert';
567
590
  this.optionContent = '';
568
591
  this.optionValue = '';
592
+ this.optionAriaLabel = '';
569
593
  this.showOptionCard = true;
570
594
  this.optionError = '';
571
595
  this.editIndex = null;
@@ -582,6 +606,7 @@ export default {
582
606
  {
583
607
  [this.valueField]: this.optionContent,
584
608
  [this.keyField]: this.optionValue,
609
+ [this.ariaLabelField]: this.optionAriaLabel,
585
610
  }
586
611
  );
587
612
  }
@@ -592,6 +617,7 @@ export default {
592
617
  }
593
618
  this.optionsList[this.editIndex][this.keyField] = this.optionValue;
594
619
  this.optionsList[this.editIndex][this.valueField] = this.optionContent;
620
+ this.optionsList[this.editIndex][this.ariaLabelField] = this.optionAriaLabel;
595
621
  }
596
622
 
597
623
  this.jsonData = JSON.stringify(this.optionsList);