block.json
191 lines
| 1 | { |
| 2 | "name": "kubio/search-form", |
| 3 | "category": "kubio-site-data", |
| 4 | "attributes": { |
| 5 | "kubio": { |
| 6 | "type": "object" |
| 7 | }, |
| 8 | "placeholderText": { |
| 9 | "type": "string", |
| 10 | "default": "Search..." |
| 11 | }, |
| 12 | "iconName": { |
| 13 | "type": "string", |
| 14 | "default": "font-awesome/search" |
| 15 | } |
| 16 | }, |
| 17 | "supports": { |
| 18 | "kubio": { |
| 19 | "appearanceEffect": true, |
| 20 | "default": { |
| 21 | "props": { |
| 22 | "layout": "inputAndButton", |
| 23 | "buttonType": "icon", |
| 24 | "buttonText": "Search" |
| 25 | }, |
| 26 | "style": { |
| 27 | "descendants": { |
| 28 | "input": { |
| 29 | "border": { |
| 30 | "top": { |
| 31 | "width": { |
| 32 | "value": 1, |
| 33 | "unit": "px" |
| 34 | }, |
| 35 | "style": "solid" |
| 36 | }, |
| 37 | "right": { |
| 38 | "width": { |
| 39 | "value": 1, |
| 40 | "unit": "px" |
| 41 | }, |
| 42 | "style": "solid" |
| 43 | }, |
| 44 | "bottom": { |
| 45 | "width": { |
| 46 | "value": 1, |
| 47 | "unit": "px" |
| 48 | }, |
| 49 | "style": "solid" |
| 50 | }, |
| 51 | "left": { |
| 52 | "width": { |
| 53 | "value": 1, |
| 54 | "unit": "px" |
| 55 | }, |
| 56 | "style": "solid" |
| 57 | } |
| 58 | } |
| 59 | }, |
| 60 | "button": { |
| 61 | "width": { |
| 62 | "unit": "px", |
| 63 | "value": 60 |
| 64 | }, |
| 65 | "background": {} |
| 66 | }, |
| 67 | "icon": { |
| 68 | "size": { |
| 69 | "value": 16 |
| 70 | } |
| 71 | } |
| 72 | } |
| 73 | } |
| 74 | }, |
| 75 | "elementsEnum": { |
| 76 | "OUTER": "outer", |
| 77 | "PLACEHOLDER": "placeholder", |
| 78 | "FORM": "form", |
| 79 | "INPUT": "input", |
| 80 | "BUTTON": "button", |
| 81 | "ICON": "icon", |
| 82 | "BUTTONTEXT": "buttonText" |
| 83 | }, |
| 84 | "elementsByName": { |
| 85 | "outer": { |
| 86 | "wrapper": true, |
| 87 | "default": true, |
| 88 | "className": [ |
| 89 | "search-form-container" |
| 90 | ] |
| 91 | }, |
| 92 | "placeholder": { |
| 93 | "selector": { |
| 94 | "normal": ".search-input::placeholder", |
| 95 | "hover": ".search-input:hover::placeholder" |
| 96 | } |
| 97 | }, |
| 98 | "form": { |
| 99 | "props": { |
| 100 | "tag": "form" |
| 101 | }, |
| 102 | "className": [ |
| 103 | "search-form" |
| 104 | ] |
| 105 | }, |
| 106 | "input": { |
| 107 | "props": { |
| 108 | "tag": "input" |
| 109 | }, |
| 110 | "className": [ |
| 111 | "search-input" |
| 112 | ] |
| 113 | }, |
| 114 | "button": { |
| 115 | "props": { |
| 116 | "tag": "button" |
| 117 | }, |
| 118 | "className": [ |
| 119 | "search-button" |
| 120 | ] |
| 121 | }, |
| 122 | "icon": { |
| 123 | "props": { |
| 124 | "tag": "icon" |
| 125 | }, |
| 126 | "className": [ |
| 127 | "button-icon" |
| 128 | ] |
| 129 | }, |
| 130 | "buttonText": { |
| 131 | "props": { |
| 132 | "tag": "span" |
| 133 | } |
| 134 | } |
| 135 | }, |
| 136 | "template": { |
| 137 | "type": "element", |
| 138 | "props": { |
| 139 | "name": "outer" |
| 140 | }, |
| 141 | "children": [ |
| 142 | { |
| 143 | "type": "element", |
| 144 | "props": { |
| 145 | "name": "form" |
| 146 | }, |
| 147 | "children": [ |
| 148 | { |
| 149 | "type": "element", |
| 150 | "props": { |
| 151 | "name": "lightbox" |
| 152 | } |
| 153 | }, |
| 154 | { |
| 155 | "type": "element", |
| 156 | "props": { |
| 157 | "name": "input", |
| 158 | "shouldRender": "computed.showInput" |
| 159 | } |
| 160 | }, |
| 161 | { |
| 162 | "type": "element", |
| 163 | "props": { |
| 164 | "name": "button", |
| 165 | "shouldRender": "computed.showButton" |
| 166 | }, |
| 167 | "children": [ |
| 168 | { |
| 169 | "type": "element", |
| 170 | "props": { |
| 171 | "name": "icon", |
| 172 | "shouldRender": "computed.showButtonIcon" |
| 173 | } |
| 174 | }, |
| 175 | { |
| 176 | "type": "element", |
| 177 | "props": { |
| 178 | "name": "buttonText", |
| 179 | "shouldRender": "computed.showButtonText" |
| 180 | } |
| 181 | } |
| 182 | ] |
| 183 | } |
| 184 | ] |
| 185 | } |
| 186 | ] |
| 187 | } |
| 188 | } |
| 189 | } |
| 190 | } |
| 191 |