PluginProbe ʕ •ᴥ•ʔ
Booking for Appointments and Events Calendar – Amelia / 1.2.31
Booking for Appointments and Events Calendar – Amelia v1.2.31
2.4.9 2.4.8 2.4.7 2.4.6 2.4.5 2.4.4 2.4.3 2.4.2 2.4.1 2.4 trunk 1.2.1 1.2.10 1.2.11 1.2.12 1.2.13 1.2.14 1.2.15 1.2.16 1.2.17 1.2.18 1.2.19 1.2.2 1.2.20 1.2.21 1.2.22 1.2.23 1.2.24 1.2.25 1.2.26 1.2.27 1.2.28 1.2.29 1.2.3 1.2.30 1.2.31 1.2.32 1.2.33 1.2.34 1.2.35 1.2.36 1.2.37 1.2.38 1.2.4 1.2.5 1.2.6 1.2.7 1.2.8 1.2.9 2.0 2.0.1 2.0.2 2.1 2.1.1 2.1.2 2.1.3 2.2 2.2.1 2.3
ameliabooking / v3 / src / views / _components / button / AmAdvButton.vue
ameliabooking / v3 / src / views / _components / button Last commit date
AmAdvButton.vue 4 years ago AmButton.vue 1 year ago AmButtonGroup.vue 1 year ago
AmAdvButton.vue
172 lines
1 <template>
2 <el-button
3 class="am-adv-button"
4 :class="[`am-adv-button__${btnSize}`, isIconClass, customClass]"
5 :size="size"
6 :type="type"
7 :plain="plain"
8 :round="round"
9 :circle="circle"
10 :loading="loading"
11 :disabled="disabled"
12 :autofocus="autofocus"
13 :native-type="nativeType"
14 :auto-insert-space="autoInsertSpace"
15 @click="handleClick"
16 >
17 <slot v-if="(prefixIcon || Object.keys(prefixIcon).length) && !iconOnly" name="prefixIcon">
18 <component :is="prefixIcon" v-if="typeof prefixIcon === 'object'"></component>
19 <span v-if="typeof prefixIcon === 'string'" :class="`am-icon-${prefixIcon}`"></span>
20 </slot>
21 <slot v-if="(icon || Object.keys(icon).length) && iconOnly" name="icon">
22 <component :is="icon" v-if="typeof icon === 'object'"></component>
23 <span v-if="typeof icon === 'string'" :class="`am-icon-${icon}`"></span>
24 </slot>
25 <slot v-if="loadingIcon || Object.keys(loadingIcon).length" name="icon">
26 <component :is="loadingIcon" v-if="typeof loadingIcon === 'object'"></component>
27 <span v-if="typeof loadingIcon === 'string'" :class="`am-icon-${loadingIcon}`"></span>
28 </slot>
29 <slot v-if="$slots.default && !iconOnly"></slot>
30 <slot v-if="(suffixIcon || Object.keys(suffixIcon).length) && !iconOnly" name="suffixIcon">
31 <component :is="suffixIcon" v-if="typeof suffixIcon === 'object'"></component>
32 <span v-if="typeof suffixIcon === 'string'" :class="`am-icon-${suffixIcon}`"></span>
33 </slot>
34 </el-button>
35 </template>
36
37 <script setup>
38 import {computed} from "vue";
39
40 /**
41 * Component Props
42 */
43 const props = defineProps({
44 customClass: {
45 type: String,
46 default: ''
47 },
48 iconOnly: {
49 type: Boolean,
50 default: false
51 },
52 // default / medium / small / mini / micro
53 btnSize: {
54 type: String,
55 default: 'default',
56 validator(value) {
57 return ['default', 'medium', 'small', 'mini', 'micro'].includes(value)
58 }
59 },
60 size: {
61 // large / default / medium /small
62 type: String,
63 default: 'default'
64 },
65 type: {
66 // primary / success / warning / danger / info / text
67 type: String,
68 default: ''
69 },
70 nativeType: {
71 // button / submit / reset
72 type: String,
73 default: 'button'
74 },
75 plain: {
76 type: Boolean,
77 default: false
78 },
79 round: {
80 type: Boolean,
81 default: false
82 },
83 circle: {
84 type: Boolean,
85 default: false
86 },
87 loading: {
88 type: Boolean,
89 default: false
90 },
91 disabled: {
92 type: Boolean,
93 default: false
94 },
95 autofocus: {
96 type: Boolean,
97 default: false
98 },
99 autoInsertSpace: {
100 type: Boolean
101 },
102 icon: {
103 type: [String, Object, Function],
104 default: ''
105 },
106 loadingIcon: {
107 type: [String, Object, Function],
108 default: ''
109 },
110 prefixIcon: {
111 type: [String, Object, Function],
112 default: ''
113 },
114 suffixIcon: {
115 type: [String, Object, Function],
116 default: ''
117 }
118 })
119
120 const isIconClass = computed(() => props.iconOnly ? `am-adv-button__${props.btnSize}-icon` : '')
121
122 /**
123 * Component Emits
124 * */
125 const emits = defineEmits(['click'])
126
127 /**
128 * Component Event Handlers
129 */
130 const handleClick = (event) => {
131 emits('click', event)
132 }
133 </script>
134
135 <style lang="scss">
136 $button: 'am-adv-button__';
137
138 // Colors
139 $defaultButtonBackgroundColor: #FFFFFF;
140 $defaultButtonTextColor: #1A2C37;
141 $defaultButtonBorderColor: #E0E2E4;
142
143
144 #amelia-container {
145 .am-adv-button {
146
147 // Button sizes
148 // Default
149 &__default {}
150 // Medium
151 &__medium {}
152 // Mini
153 &__mini {}
154 // Micro
155 &__micro {
156 height: 24px;
157 font-size: 16px;
158 transition: all .3s ease-in-out;
159
160 // Only contains icon
161 &-icon {
162 width: 24px;
163 padding: 4px;
164
165 &.is-loading {
166 width: 48px;
167 }
168 }
169 }
170 }
171 }
172 </style>