ocpview-pro 0.1.9 → 0.1.11

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": "ocpview-pro",
3
- "version": "0.1.9",
3
+ "version": "0.1.11",
4
4
  "title": "ocpviewPlus",
5
5
  "description": "A high quality Service UI components Library with Vue.js",
6
6
  "homepage": "",
@@ -156,6 +156,7 @@ export default {
156
156
  white-space: pre-wrap;
157
157
  }
158
158
  .showtext-link {
159
+ color: #0000EE;
159
160
  text-decoration: underline;
160
161
  cursor: pointer;
161
162
  }
@@ -1,11 +1,11 @@
1
1
 
2
2
  <template>
3
- <div v-show="myConfig.visible">
3
+ <div v-show="myConfig.visible" :class="['textbox-wrapper', { 'textbox-mask': isMaskMode, 'textbox-mask-visible': isMaskMode && maskVisible }]">
4
4
  <Input
5
5
  ref="myControl"
6
6
  v-model="value"
7
7
  :size="myConfig.size"
8
- :type="myConfig.vtype"
8
+ :type="inputType"
9
9
  :password="passwordFlag"
10
10
  :rows="myConfig.rows"
11
11
  :placeholder="myConfig.placeholder"
@@ -19,6 +19,9 @@
19
19
  :search="myConfig.search"
20
20
  @on-search="search"
21
21
  >
22
+ <template v-if="isMaskMode && myConfig.maskToggle" #suffix>
23
+ <Icon :type="maskVisible ? 'md-eye-off' : 'md-eye'" @click.stop="toggleMask" style="cursor:pointer;font-size:16px" />
24
+ </template>
22
25
  <template v-if="myConfig.showAppend" #append>
23
26
  <Button :size="myConfig.size" type="primary" :disabled="myConfig.readOnly" @click="appendClick">{{myConfig.appendText}}</Button>
24
27
  </template>
@@ -43,12 +46,25 @@ export default {
43
46
  search: false,
44
47
  allowInput: true,
45
48
  showAppend:false,
46
- notSpecial:false
49
+ notSpecial:false,
50
+ maskToggle: false
47
51
  },
48
52
  passwordFlag: false,
53
+ maskVisible: false,
49
54
  };
50
55
  },
56
+ computed: {
57
+ isMaskMode() {
58
+ return this.myConfig.vtype === 'mask';
59
+ },
60
+ inputType() {
61
+ return this.isMaskMode ? 'text' : this.myConfig.vtype;
62
+ }
63
+ },
51
64
  methods: {
65
+ toggleMask() {
66
+ this.maskVisible = !this.maskVisible;
67
+ },
52
68
  keyUp(e) {
53
69
  if (this.myConfig.notSpecial) {
54
70
  e.target.value = e.target.value.replace(/[`~!@$%^&*()_\-+=<>?:"{}|,\/;'\\[\]·~!@¥%……&*()——\-+={}|《》?:“”【】、;‘’,。、]/g, '')
@@ -95,4 +111,13 @@ export default {
95
111
  }
96
112
  },
97
113
  };
98
- </script>
114
+ </script>
115
+
116
+ <style scoped>
117
+ .textbox-mask :deep(.ivu-input) {
118
+ -webkit-text-security: disc !important;
119
+ }
120
+ .textbox-mask.textbox-mask-visible :deep(.ivu-input) {
121
+ -webkit-text-security: none !important;
122
+ }
123
+ </style>