@processmaker/screen-builder 2.67.0 → 2.69.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@processmaker/screen-builder",
3
- "version": "2.67.0",
3
+ "version": "2.69.0",
4
4
  "scripts": {
5
5
  "serve": "vue-cli-service serve",
6
6
  "build": "vue-cli-service build",
@@ -32,17 +32,17 @@
32
32
  </div>
33
33
 
34
34
  <div class="mt-3" v-if="fields.length > 1">
35
- <label for="pmql">{{ $t("PMQL") }}</label>
36
- <mustache-helper />
37
- <b-form-textarea
38
- id="pmql"
39
- rows="4"
40
- v-model="pmql"
41
- data-cy="inspector-collection-pmql"
42
- />
43
- <small class="form-text text-muted">{{
44
- $t("Add a PMQL query to filter the result list. Use `data` as prefix")
45
- }}</small>
35
+ <pmql-input
36
+ :search-type="'collections_w_mustaches'"
37
+ class="mb-1"
38
+ data-cy="inspector-collection-pmql"
39
+ :input-label="'PMQL'"
40
+ v-model="pmql"
41
+ :condensed="true"
42
+ :ai-enabled="true"
43
+ :placeholder="$t('PMQL')">
44
+ </pmql-input>
45
+ <small class="form-text text-muted">{{ $t('Advanced data search') }}</small>
46
46
  </div>
47
47
 
48
48
  <div class="mt-3" v-if="fields.length > 1">
@@ -58,6 +58,7 @@
58
58
  </template>
59
59
 
60
60
  <script>
61
+ import { debounce } from "lodash";
61
62
  import _ from "lodash";
62
63
  import MustacheHelper from "./mustache-helper";
63
64
  import ScreenVariableSelector from '../screen-variable-selector.vue';
@@ -109,6 +110,11 @@ export default {
109
110
  deep: true
110
111
  }
111
112
  },
113
+ created() {
114
+ this.onDebouncedPmqlChange = debounce((pmql) => {
115
+ this.onPmqlChange(pmql);
116
+ }, 1000);
117
+ },
112
118
  computed: {
113
119
  options() {
114
120
  return Object.fromEntries(CONFIG_FIELDS.map(field => [field, this[field]]));
@@ -151,6 +157,12 @@ export default {
151
157
  })
152
158
  ];
153
159
  });
160
+ },
161
+ onNLQConversion(pmql) {
162
+ this.pmql = pmql;
163
+ },
164
+ onPmqlChange(pmql) {
165
+ this.pmql = pmql;
154
166
  }
155
167
  },
156
168
  mounted() {
@@ -4,65 +4,75 @@
4
4
  <label>{{ label }}</label>
5
5
  <b-button-toolbar>
6
6
  <b-button-group size="sm">
7
- <b-button size="sm"
8
- variant="outline-light"
7
+ <b-button
9
8
  v-for="option in options"
10
9
  :key="option.value"
10
+ size="sm"
11
+ variant="outline-light"
11
12
  class="btn btn-sm mr-1 pr-1 pl-1 pt-0 pb-0 btn-outline-none"
12
13
  :class="['bg-' + parsedColor(option.value)]"
13
14
  :title="option.content"
14
15
  >
15
- <i class="fas fa-check"
16
- :class="[option.value === value ? 'text-light' : 'text-' + parsedColor(option.value)]"
16
+ <i
17
+ class="fas fa-check"
18
+ :class="[
19
+ option.value === value
20
+ ? 'text-light'
21
+ : 'text-' + parsedColor(option.value)
22
+ ]"
17
23
  @click="selectColor(option.value)"
18
24
  />
19
25
  </b-button>
20
26
  </b-button-group>
21
27
  </b-button-toolbar>
22
- <small @click="checkColor">
23
- <i class="fas fa-ban"/>
24
- {{ $t('Clear Color Selection') }}
28
+ <small @click="checkColor()">
29
+ <i class="fas fa-ban" />
30
+ {{ $t("Clear Color Selection") }}
25
31
  </small>
26
32
  </div>
27
33
  </div>
28
34
  </template>
29
35
 
30
36
  <script>
31
-
32
37
  export default {
33
- props: ['label', 'value', 'helper', 'options'],
34
- components: {
35
- },
38
+ components: {},
39
+ props: ["label", "value", "helper", "options"],
36
40
  data() {
37
41
  return {
38
- newColor: '',
42
+ newColor: ""
39
43
  };
40
44
  },
41
45
  computed: {
42
46
  hasColor() {
43
- return !!this.value;
44
- },
47
+ return Boolean(this.value);
48
+ }
45
49
  },
46
50
  methods: {
51
+ emitChanges(value) {
52
+ this.$emit("input", value);
53
+ this.$emit("update-state");
54
+ },
47
55
  checkColor() {
48
- this.hasColor ? this.$emit('input', '') : null;
56
+ if (this.hasColor) {
57
+ this.emitChanges("");
58
+ }
49
59
  },
50
60
  selectColor(color) {
51
- this.$emit('input', color);
61
+ this.emitChanges(color);
52
62
  },
53
63
  parsedColor(color) {
54
- return color.split('-')[1];
55
- },
56
- },
64
+ return color.split("-")[1];
65
+ }
66
+ }
57
67
  };
58
68
  </script>
59
69
 
60
70
  <style lang="scss" scoped>
61
- .image-preview {
62
- border: 1px solid #ced4da;
63
- border-radius: 4px;
64
- height: 4em;
65
- text-align: center;
66
- overflow: hidden;
67
- }
71
+ .image-preview {
72
+ border: 1px solid #ced4da;
73
+ border-radius: 4px;
74
+ height: 4em;
75
+ text-align: center;
76
+ overflow: hidden;
77
+ }
68
78
  </style>
@@ -230,12 +230,10 @@
230
230
  :search-type="'collections'"
231
231
  class="mb-1"
232
232
  :input-label="'PMQL'"
233
- :value="pmqlQuery"
233
+ v-model="pmqlQuery"
234
234
  :condensed="true"
235
235
  :ai-enabled="true"
236
- :placeholder="$t('PMQL')"
237
- @submit="onNLQConversion"
238
- @pmqlchange="onDebouncedPmqlChange">
236
+ :placeholder="$t('PMQL')">
239
237
  </pmql-input>
240
238
  <small class="form-text text-muted">{{ $t('Advanced data search') }}</small>
241
239
  </div>