attrs
2 years ago
calc.module
2 years ago
html.macro
2 years ago
init
2 years ago
inputs
2 years ago
reactive
2 years ago
reporting
2 years ago
signals
2 years ago
submit
2 years ago
Observable.js
2 years ago
functions.js
2 years ago
main.js
2 years ago
supports.js
2 years ago
supports.js
64 lines
| 1 | /** |
| 2 | * @param node {HTMLElement} |
| 3 | * @returns {boolean} |
| 4 | */ |
| 5 | function isChangeType( node ) { |
| 6 | return [ 'select-one', 'range' ].includes( node.type ); |
| 7 | } |
| 8 | |
| 9 | /** |
| 10 | * @param node {HTMLElement} |
| 11 | * @returns {boolean} |
| 12 | */ |
| 13 | function isInputMask( node ) { |
| 14 | return ( |
| 15 | node.classList.contains( 'jet-form-builder__masked-field' ) && |
| 16 | jQuery.fn.inputmask |
| 17 | ); |
| 18 | } |
| 19 | |
| 20 | /** |
| 21 | * @param node {HTMLElement} |
| 22 | * @returns {boolean} |
| 23 | */ |
| 24 | function isSelect( node ) { |
| 25 | return [ 'select-multiple', 'select-one' ].includes( node?.type ); |
| 26 | } |
| 27 | |
| 28 | function isMultiSelect( node ) { |
| 29 | return 'select-multiple' === node?.type; |
| 30 | } |
| 31 | |
| 32 | /** |
| 33 | * @param node {HTMLElement} |
| 34 | * @returns {boolean} |
| 35 | */ |
| 36 | function isHidden( node ) { |
| 37 | return 'hidden' === node.type; |
| 38 | } |
| 39 | |
| 40 | /** |
| 41 | * @param node {HTMLElement} |
| 42 | * @returns {boolean} |
| 43 | */ |
| 44 | function isRange( node ) { |
| 45 | return 'range' === node.type; |
| 46 | } |
| 47 | |
| 48 | /** |
| 49 | * @param node {HTMLElement} |
| 50 | * @returns {boolean} |
| 51 | */ |
| 52 | function isWysiwyg( node ) { |
| 53 | return node.classList.contains( 'wysiwyg-field' ); |
| 54 | } |
| 55 | |
| 56 | export { |
| 57 | isWysiwyg, |
| 58 | isHidden, |
| 59 | isRange, |
| 60 | isSelect, |
| 61 | isMultiSelect, |
| 62 | isChangeType, |
| 63 | isInputMask, |
| 64 | }; |