@policystudio/policy-studio-ui-vue 1.1.32 → 1.1.33

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": "@policystudio/policy-studio-ui-vue",
3
- "version": "1.1.32",
3
+ "version": "1.1.33",
4
4
  "description": "Policy Studio UI",
5
5
  "main": "src/index.js",
6
6
  "author": "Policy Studio Team",
@@ -2,17 +2,47 @@
2
2
  <div class="psui-el-input" :class="[getComponentClass, `layout-${layout}`]" >
3
3
 
4
4
  <label v-if="label"> {{ label }} </label>
5
-
5
+
6
6
  <div
7
7
  class="psui-el-input-wrapper"
8
8
  @mouseenter="$emit('mouseenter',$event)"
9
9
  @mouseleave="$emit('mouseleave',$event)"
10
10
  >
11
-
12
11
  <div v-if="$slots.prepend" class="psui-el-input-prepend">
13
12
  <slot name="prepend"></slot>
14
13
  </div>
14
+ <PsRichTooltip
15
+ v-if="showTooltip"
16
+ css-class="w-48"
17
+ :ignore-dialog="!showTooltip"
18
+ >
19
+ <template v-slot:trigger>
20
+ <input
21
+ :title="title"
22
+ :type="type"
23
+ :placeholder="placeholder"
24
+ :disabled="disabled"
25
+ :value="value"
26
+ :step="step"
27
+ :min="minValue"
28
+ :max="maxValue"
29
+ @focus="onInputFocus"
30
+ @blur="onInputBlur"
31
+ @input="$emit('input', $event)"
32
+ @keydown="$emit('keydown', $event)"
33
+ @change="$emit('change', $event)"
34
+ v-bind="getAttrs"
35
+ :class="{ 'focus': isFocus }"
36
+ />
37
+ </template>
38
+ <template v-slot:content>
39
+ <div class="text-left">
40
+ {{ tooltipText }}
41
+ </div>
42
+ </template>
43
+ </PsRichTooltip>
15
44
  <input
45
+ v-else
16
46
  :title="title"
17
47
  :type="type"
18
48
  :placeholder="placeholder"
@@ -33,9 +63,8 @@
33
63
  <span v-if="hasError" class="material-icons psui-text-red-20 material-icons-sharp">error</span>
34
64
  <slot v-else name="append"></slot>
35
65
  </div>
36
-
37
66
  </div>
38
-
67
+
39
68
  <p v-if="hint || (hasError && typeof hasError === 'string')" class="psui-el-input-hint">
40
69
  {{ typeof hasError === 'string' ? hasError : hint }}
41
70
  </p>
@@ -44,8 +73,13 @@
44
73
  </template>
45
74
 
46
75
  <script>
76
+ import PsRichTooltip from '../tooltip/PsRichTooltip.vue'
77
+
47
78
  export default {
48
79
  name: 'PsInput',
80
+ components: {
81
+ PsRichTooltip,
82
+ },
49
83
  props: {
50
84
  /**
51
85
  * It set the title and also its tooltip default behavior
@@ -122,6 +156,14 @@ export default {
122
156
  },
123
157
  step:{
124
158
  type: null
159
+ },
160
+ showTooltip: {
161
+ type: Boolean,
162
+ default: false,
163
+ },
164
+ tooltipText: {
165
+ type: String,
166
+ default: '',
125
167
  },
126
168
  },
127
169
  data: () => ({