@policystudio/policy-studio-ui-vue 1.0.12 → 1.0.16
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
|
@@ -6,15 +6,14 @@
|
|
|
6
6
|
>
|
|
7
7
|
<i
|
|
8
8
|
v-if="icon"
|
|
9
|
-
class="psui-
|
|
10
|
-
:class="{ 'psui-text-sm': size === 'small' }"
|
|
9
|
+
:class="['psui-mr-2', iconClasses]"
|
|
11
10
|
>
|
|
12
11
|
{{ icon }}
|
|
13
12
|
</i>
|
|
14
13
|
<div class="psui-flex-grow psui-text-left">{{ label }}</div>
|
|
15
14
|
<i
|
|
16
|
-
v-if="iconRight"
|
|
17
|
-
:class="
|
|
15
|
+
v-if="iconRight"
|
|
16
|
+
:class="['psui-ml-2', iconClasses]"
|
|
18
17
|
>
|
|
19
18
|
{{ iconRight }}
|
|
20
19
|
</i>
|
|
@@ -59,16 +58,21 @@ export default {
|
|
|
59
58
|
type: String,
|
|
60
59
|
default: ''
|
|
61
60
|
},
|
|
61
|
+
'icon-color': {
|
|
62
|
+
type: String,
|
|
63
|
+
default: ''
|
|
64
|
+
},
|
|
62
65
|
color: {
|
|
63
66
|
type: String,
|
|
64
67
|
default: ''
|
|
65
68
|
}
|
|
66
69
|
},
|
|
67
|
-
data () {
|
|
68
|
-
return {
|
|
69
|
-
}
|
|
70
|
-
},
|
|
71
70
|
computed: {
|
|
71
|
+
iconClasses() {
|
|
72
|
+
const size = this.sizes === 'small' ? 'psui-text-sm' : ''
|
|
73
|
+
const color = this.iconColor.length > 0 ? `psui-text-${this.iconColor}` : ''
|
|
74
|
+
return `psui-my-auto material-icons ${size} ${color}`
|
|
75
|
+
},
|
|
72
76
|
classes() {
|
|
73
77
|
let sizeCss = 'psui-px-4 psui-py-2'
|
|
74
78
|
if (this.size === 'medium') sizeCss = 'psui-px-4 psui-py-1'
|
|
@@ -76,7 +80,16 @@ export default {
|
|
|
76
80
|
if (this.outline) return `${sizeCss} psui-bg-white psui-border ${this.disabled ? 'psui-border-gray-40 psui-text-gray-40' : 'psui-border-blue-60 psui-text-blue-60'}`
|
|
77
81
|
if (this.ghost) return `${sizeCss} ${this.disabled ? 'psui-bg-gray-20 psui-text-gray-40' : 'psui-bg-blue-20 psui-text-blue-60 active:psui-shadow-inner'}`
|
|
78
82
|
if (this.textOnly) {
|
|
79
|
-
const
|
|
83
|
+
const hasTextColor = this.textColor.length > 0
|
|
84
|
+
const color = hasTextColor ? this.textColor.split('hover:')[0] : ''
|
|
85
|
+
const hover = hasTextColor ? this.textColor.split('hover:')[1] : ''
|
|
86
|
+
|
|
87
|
+
let textCss = 'psui-text-blue-50 hover:psui-text-blue-60'
|
|
88
|
+
if (this.disabled) textCss = 'psui-text-gray-40'
|
|
89
|
+
|
|
90
|
+
if (hasTextColor) textCss = `psui-text-${color}`
|
|
91
|
+
if (hover) textCss += `hover:psui-text-${hover}`
|
|
92
|
+
|
|
80
93
|
return `${sizeCss} ${textCss}`
|
|
81
94
|
}
|
|
82
95
|
if (this.disabled) return `${sizeCss} psui-bg-gray-20 psui-text-gray-40`
|
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
<script>
|
|
13
13
|
export const sizes = ['big', 'small']
|
|
14
14
|
export default {
|
|
15
|
+
name: 'PsSwitch',
|
|
15
16
|
computed: {
|
|
16
17
|
text() {
|
|
17
18
|
if (this.label && this.labelActived) {
|
|
@@ -57,6 +58,10 @@ export default {
|
|
|
57
58
|
</script>
|
|
58
59
|
|
|
59
60
|
<style scoped>
|
|
61
|
+
/*
|
|
62
|
+
@TODO - Fix the apply error
|
|
63
|
+
https://www.dropbox.com/s/83vwthcdvdt5t97/Screen%20Shot%202022-01-06%20at%2011.49.00%20AM.png?dl=0
|
|
64
|
+
|
|
60
65
|
.ps-switch {
|
|
61
66
|
width: 46px;
|
|
62
67
|
}
|
|
@@ -88,5 +93,5 @@ input:checked + .toggle-bg:after {
|
|
|
88
93
|
|
|
89
94
|
input:checked + .toggle-bg {
|
|
90
95
|
@apply psui-bg-green-20 psui-border-green-20;
|
|
91
|
-
}
|
|
96
|
+
} */
|
|
92
97
|
</style>
|
|
@@ -12,6 +12,14 @@
|
|
|
12
12
|
:aria-required="required"
|
|
13
13
|
:aria-invalid="validation.hasError"
|
|
14
14
|
:class="[getInputClasses, { 'psui-border-red' : validation.hasError }]"
|
|
15
|
+
:required="required"
|
|
16
|
+
:value="value"
|
|
17
|
+
@focus="$emit('focus')"
|
|
18
|
+
@blur="$emit('blur')"
|
|
19
|
+
@input="$emit('input', $event.target.value)"
|
|
20
|
+
@keydown.enter="$emit('keydown', $event.target.value)"
|
|
21
|
+
@change="$emit('change')"
|
|
22
|
+
v-bind="getAttrs"
|
|
15
23
|
/>
|
|
16
24
|
<div class="psui-absolute psui-inset-y-0 psui-right-0 psui-pr-2 psui-flex psui-items-center" v-if="this.$slots.append">
|
|
17
25
|
<slot name="append"></slot>
|
|
@@ -56,6 +64,9 @@ export default {
|
|
|
56
64
|
return { hasError: false, checked: false, filled: false, required: false }
|
|
57
65
|
}
|
|
58
66
|
},
|
|
67
|
+
value: {
|
|
68
|
+
required: true,
|
|
69
|
+
},
|
|
59
70
|
},
|
|
60
71
|
computed: {
|
|
61
72
|
getInputClasses() {
|
|
@@ -66,8 +77,17 @@ export default {
|
|
|
66
77
|
},
|
|
67
78
|
getPadding() {
|
|
68
79
|
return this.mini ? 'psui-px-2 mini-p' : 'psui-py-2 psui-px-4'
|
|
80
|
+
},
|
|
81
|
+
getAttrs() {
|
|
82
|
+
const defaultAttrs = {
|
|
83
|
+
autocapitalize: 'sentences',
|
|
84
|
+
autocomplete: 'chrome-off',
|
|
85
|
+
autocorrect: 'off',
|
|
86
|
+
spellcheck: 'spellcheck'
|
|
87
|
+
}
|
|
88
|
+
return { ...defaultAttrs, ...this.$attrs }
|
|
69
89
|
}
|
|
70
|
-
}
|
|
90
|
+
},
|
|
71
91
|
}
|
|
72
92
|
</script>
|
|
73
93
|
|
package/src/index.js
CHANGED
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
import PsButton from './components/buttons/PsButton.vue';
|
|
2
2
|
import PsCheckbox from './components/controls/PsCheckbox.vue';
|
|
3
|
+
import PsRadioButton from './components/controls/PsRadioButton.vue';
|
|
4
|
+
import PsSlider from './components/controls/PsSlider.vue';
|
|
5
|
+
import PsSwitch from './components/controls/PsSwitch.vue';
|
|
6
|
+
import PsToggle from './components/controls/PsToggle.vue';
|
|
7
|
+
import PsInput from './components/forms/PsInput.vue';
|
|
3
8
|
import PsDialog from './components/notifications/PsDialog.vue';
|
|
4
9
|
import PsToast from './components/notifications/PsToast.vue';
|
|
5
10
|
import PsTabHeader from './components/tabs/PsTabHeader.vue';
|
|
6
|
-
import PsRadioButton from './components/controls/PsRadioButton.vue';
|
|
7
11
|
|
|
8
12
|
export default {
|
|
9
13
|
install(Vue) {
|
|
@@ -13,6 +17,10 @@ export default {
|
|
|
13
17
|
Vue.component('PsToast', PsToast);
|
|
14
18
|
Vue.component('PsTabHeader', PsTabHeader);
|
|
15
19
|
Vue.component('PsRadioButton', PsRadioButton);
|
|
20
|
+
Vue.component('PsSlider', PsSlider);
|
|
21
|
+
Vue.component('PsSwitch', PsSwitch);
|
|
22
|
+
Vue.component('PsInput', PsInput);
|
|
23
|
+
Vue.component('PsToggle', PsToggle);
|
|
16
24
|
}
|
|
17
25
|
};
|
|
18
26
|
|
|
@@ -22,5 +30,9 @@ export {
|
|
|
22
30
|
PsDialog,
|
|
23
31
|
PsToast,
|
|
24
32
|
PsTabHeader,
|
|
25
|
-
PsRadioButton
|
|
33
|
+
PsRadioButton,
|
|
34
|
+
PsSlider,
|
|
35
|
+
PsSwitch,
|
|
36
|
+
PsInput,
|
|
37
|
+
PsToggle
|
|
26
38
|
}
|