PluginProbe ʕ •ᴥ•ʔ
JetFormBuilder — Dynamic Blocks Form Builder / 1.2.2
JetFormBuilder — Dynamic Blocks Form Builder v1.2.2
3.6.3.1 3.6.3 3.6.2.2 3.6.2.1 3.6.2 3.6.1.1 3.6.1 3.6.0.1 trunk 1.0.0 1.0.1 1.0.2 1.0.3 1.1.0 1.1.1 1.1.2 1.1.3 1.1.4 1.1.5 1.1.6 1.1.7 1.2.0 1.2.1 1.2.2 1.2.3 1.2.4 1.2.5 1.2.6 1.2.7 1.3.0 1.3.1 1.3.2 1.3.3 1.4.0 1.4.1 1.4.2 1.4.3 1.5.0 1.5.1 1.5.2 1.5.3 1.5.4 1.5.5 2.0.0 2.0.1 2.0.2 2.0.3 2.0.4 2.0.5 2.0.6 2.1.0 2.1.1 2.1.10 2.1.11 2.1.2 2.1.3 2.1.4 2.1.5 2.1.6 2.1.7 2.1.8 2.1.9 3.0.0 3.0.0.1 3.0.0.2 3.0.0.3 3.0.1 3.0.1.1 3.0.2 3.0.3 3.0.4 3.0.5 3.0.6 3.0.7 3.0.8 3.0.9 3.1.0 3.1.0.1 3.1.1 3.1.2 3.1.3 3.1.4 3.1.5 3.1.6 3.1.7 3.1.8 3.1.9 3.2.0 3.2.1 3.2.2 3.2.3 3.3.0 3.3.1 3.3.2 3.3.3 3.3.3.1 3.3.4 3.3.4.1 3.3.4.2 3.4.0 3.4.1 3.4.2 3.4.3 3.4.4 3.4.5 3.4.5.1 3.4.5.2 3.4.6 3.4.7 3.4.7.1 3.5.0 3.5.1 3.5.1.1 3.5.1.2 3.5.2 3.5.2.1 3.5.3 3.5.4 3.5.5 3.5.6 3.5.6.1 3.5.6.2 3.5.6.3 3.6.0
jetformbuilder / framework / vue-ui / assets / src / js / components / layout / button.js
jetformbuilder / framework / vue-ui / assets / src / js / components / layout Last commit date
button.js 5 years ago collapse.js 5 years ago component-wrapper.js 5 years ago list-table-heading.js 5 years ago list-table-item.js 5 years ago list-table.js 5 years ago notice-component.js 5 years ago notice.js 5 years ago pagination.js 5 years ago popup.js 5 years ago repeater-item.js 5 years ago repeater.js 5 years ago tabs-panel.js 5 years ago tabs.js 5 years ago title.js 5 years ago
button.js
121 lines
1 import { oneOf } from '../../utils/assist';
2 import { checkConditions } from '../../mixins/check-conditions';
3
4 const Button = {
5 name: 'cx-vui-button',
6 template: '#cx-vui-button',
7 mixins: [ checkConditions ],
8 props: {
9 type: {
10 validator ( value ) {
11 return oneOf( value, [ 'button', 'submit', 'reset' ] );
12 },
13 default: 'button'
14 },
15 buttonStyle: {
16 validator ( value ) {
17 return oneOf( value, [ 'default', 'accent', 'link-accent', 'link-error', 'accent-border', 'default-border' ] );
18 },
19 default: 'default'
20 },
21 size: {
22 validator ( value ) {
23 return oneOf( value, [ 'default', 'mini', 'link' ] );
24 },
25 default: 'default'
26 },
27 disabled: {
28 type: Boolean,
29 default: false
30 },
31 loading: {
32 type: Boolean,
33 default: false
34 },
35 customCss: {
36 type: String,
37 },
38 url: {
39 type: String,
40 },
41 target: {
42 type: String,
43 },
44 tagName: {
45 validator( value ) {
46 return oneOf( value, [ 'a', 'button' ] );
47 },
48 default: 'button'
49 },
50 elementId: {
51 type: String
52 },
53 conditions: {
54 type: Array,
55 default() {
56 return [];
57 }
58 },
59 },
60 data() {
61 return {
62 baseClass: 'cx-vui-button',
63 };
64 },
65 computed: {
66 classesList() {
67
68 let classesList = [
69 this.baseClass,
70 this.baseClass + '--style-' + this.buttonStyle,
71 this.baseClass + '--size-' + this.size,
72 ];
73
74 if ( this.loading ) {
75 classesList.push( this.baseClass + '--loading' );
76 }
77
78 if ( this.disabled ) {
79 classesList.push( this.baseClass + '--disabled' );
80 }
81
82 if ( this.customCss ) {
83 classesList.push( this.customCss );
84 }
85
86 return classesList;
87 },
88 tagAtts() {
89
90 let atts = {};
91
92 if ( 'a' === this.tagName ) {
93
94 if ( this.url ) {
95 atts.href = this.url;
96 }
97
98 if ( this.target ) {
99 atts.target = this.target;
100 }
101
102 } else {
103 atts.type = this.type;
104 }
105
106 return atts;
107 }
108 },
109 methods: {
110 handleClick() {
111
112 if ( this.loading || this.disabled ) {
113 return;
114 }
115
116 this.$emit( 'click', event );
117 }
118 },
119 };
120
121 export default Button;