PluginProbe ʕ •ᴥ•ʔ
JetFormBuilder — Dynamic Blocks Form Builder / 3.1.1
JetFormBuilder — Dynamic Blocks Form Builder v3.1.1
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 / assets / src / frontend / main / reporting / restrictions / Restriction.js
jetformbuilder / assets / src / frontend / main / reporting / restrictions Last commit date
NativeRestriction.js 2 years ago RequiredRestriction.js 2 years ago Restriction.js 2 years ago
Restriction.js
68 lines
1 function Restriction() {
2 /**
3 * @type {ReportingInterface}
4 */
5 this.reporting = null;
6 /**
7 * You can override this property
8 * if you want to make this Restriction overridable
9 *
10 * @since 3.1.0
11 *
12 * @type {string}
13 */
14 this.type = '';
15 }
16
17 Restriction.prototype = {
18 /**
19 * @param node {HTMLElement|HTMLInputElement}
20 * @param reporting {ReportingInterface}
21 */
22 isSupported: function ( node, reporting ) {
23 return true;
24 },
25 /**
26 * @since 3.1.0
27 * @returns {string}
28 */
29 getType: function () {
30 return this.type;
31 },
32 /**
33 * @param reporting {ReportingInterface}
34 */
35 setReporting: function ( reporting ) {
36 this.reporting = reporting;
37 },
38 getValue: function () {
39 return this.reporting.input.value.current;
40 },
41 /**
42 * @returns {boolean}
43 */
44 validate: function () {
45 throw new Error( 'validate is wrong' );
46 },
47 /**
48 * @return {Promise<*>}
49 */
50 validatePromise: async function () {
51 let validationResult;
52
53 try {
54 validationResult = await this.validate();
55 }
56 catch ( error ) {
57 return Promise.reject( error?.message ?? error );
58 }
59
60 return validationResult
61 ? Promise.resolve()
62 : Promise.reject( 'validate is wrong' );
63 },
64 onReady() {
65 },
66 };
67
68 export default Restriction;