Commit 5ef0dd2a124781ed0bec0c17b95f4a4d78ec7822
1 parent
e7a70dc6
add phone and email field
Showing
3 changed files
with
31 additions
and
5 deletions
Show diff stats
ds_files/ds_types.anubis
| @@ -107,7 +107,9 @@ public define List(DS_Type_File) hayamiki_lib_types_description = | @@ -107,7 +107,9 @@ public define List(DS_Type_File) hayamiki_lib_types_description = | ||
| 107 | [ | 107 | [ |
| 108 | component(extern_type("HK_Text_Field_Attr", model_types+"hk_text_field_attr.anubis"), "hk_text_field_attr"), | 108 | component(extern_type("HK_Text_Field_Attr", model_types+"hk_text_field_attr.anubis"), "hk_text_field_attr"), |
| 109 | ]), | 109 | ]), |
| 110 | - enum("color_field", comment("String which representing RGBA color like HTML")) | 110 | + enum("color_field", comment("String which representing RGBA color like HTML")), |
| 111 | + enum("phone_field", comment("phone field")), | ||
| 112 | + enum("email_field", comment("email field")), | ||
| 111 | ]), | 113 | ]), |
| 112 | 114 | ||
| 113 | // | 115 | // |
model/fields.anubis
| @@ -245,10 +245,18 @@ public define JsonValue | @@ -245,10 +245,18 @@ public define JsonValue | ||
| 245 | text_field(attr) then // text of variable size | 245 | text_field(attr) then // text of variable size |
| 246 | [ json_member("type", json_string("text_field")), | 246 | [ json_member("type", json_string("text_field")), |
| 247 | json_member("text_attribute", json_string(to_String(attr))) | 247 | json_member("text_attribute", json_string(to_String(attr))) |
| 248 | - ] | 248 | + ], |
| 249 | 249 | ||
| 250 | color_field then | 250 | color_field then |
| 251 | [ json_member("type", json_string("color_field")) | 251 | [ json_member("type", json_string("color_field")) |
| 252 | + ], | ||
| 253 | + | ||
| 254 | + phone_field then | ||
| 255 | + [ json_member("type", json_string("phone_field")) | ||
| 256 | + ], | ||
| 257 | + | ||
| 258 | + email_field then | ||
| 259 | + [ json_member("type", json_string("email_field")) | ||
| 252 | ] | 260 | ] |
| 253 | }, | 261 | }, |
| 254 | 262 |
model/types/hk_model_field.anubis
| 1 | /* | 1 | /* |
| 2 | * Created by 伝作 (Densaku). | 2 | * Created by 伝作 (Densaku). |
| 3 | * Types & Messages generator written by フランスのトトロ aka (David RENÉ) | 3 | * Types & Messages generator written by フランスのトトロ aka (David RENÉ) |
| 4 | - * Date: 2017-04-12 | ||
| 5 | - * Time: 23:52:21 | 4 | + * Date: 2017-05-02 |
| 5 | + * Time: 10:06:16 | ||
| 6 | * | 6 | * |
| 7 | */ | 7 | */ |
| 8 | 8 | ||
| @@ -52,7 +52,9 @@ public type HK_Model_Field: | @@ -52,7 +52,9 @@ public type HK_Model_Field: | ||
| 52 | text_field( | 52 | text_field( |
| 53 | HK_Text_Field_Attr hk_text_field_attr | 53 | HK_Text_Field_Attr hk_text_field_attr |
| 54 | ), | 54 | ), |
| 55 | - color_field //String which representing RGBA color like HTML | 55 | + color_field, //String which representing RGBA color like HTML |
| 56 | + phone_field, //phone field | ||
| 57 | + email_field //email field | ||
| 56 | . | 58 | . |
| 57 | 59 | ||
| 58 | HK_Model_Field message format | 60 | HK_Model_Field message format |
| @@ -138,6 +140,14 @@ public define Message | @@ -138,6 +140,14 @@ public define Message | ||
| 138 | color_field then | 140 | color_field then |
| 139 | forget(add_string(_hk_model_field_message, "__TYPE_ALT__", "color_field")), | 141 | forget(add_string(_hk_model_field_message, "__TYPE_ALT__", "color_field")), |
| 140 | 142 | ||
| 143 | + //Alternative phone_field (NO TYPE) | ||
| 144 | + phone_field then | ||
| 145 | + forget(add_string(_hk_model_field_message, "__TYPE_ALT__", "phone_field")), | ||
| 146 | + | ||
| 147 | + //Alternative email_field (NO TYPE) | ||
| 148 | + email_field then | ||
| 149 | + forget(add_string(_hk_model_field_message, "__TYPE_ALT__", "email_field")), | ||
| 150 | + | ||
| 141 | }; | 151 | }; |
| 142 | _hk_model_field_message | 152 | _hk_model_field_message |
| 143 | . | 153 | . |
| @@ -233,6 +243,12 @@ public define Maybe(HK_Model_Field) | @@ -233,6 +243,12 @@ public define Maybe(HK_Model_Field) | ||
| 233 | else //Alternative color_field (NO TYPE) | 243 | else //Alternative color_field (NO TYPE) |
| 234 | if __type_alt__ = "color_field" then | 244 | if __type_alt__ = "color_field" then |
| 235 | success(color_field) | 245 | success(color_field) |
| 246 | + else //Alternative phone_field (NO TYPE) | ||
| 247 | + if __type_alt__ = "phone_field" then | ||
| 248 | + success(phone_field) | ||
| 249 | + else //Alternative email_field (NO TYPE) | ||
| 250 | + if __type_alt__ = "email_field" then | ||
| 251 | + success(email_field) | ||
| 236 | else | 252 | else |
| 237 | failure //No valid Alternative found ! | 253 | failure //No valid Alternative found ! |
| 238 | else | 254 | else |