@iankibetsh/shframework 0.7.9 → 0.8.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -63,21 +63,6 @@
63
63
  color: white;
64
64
  }
65
65
 
66
- .sh-selected-item{
67
- line-height: unset!important;
68
- }
69
- .sh-suggestion-input{
70
- padding: 0.375rem 0.75rem;
71
- }
72
- .sh-suggest{
73
- margin-bottom: 1rem;
74
- }
75
- .sh-suggest-control::after{
76
- margin-top: auto;
77
- margin-bottom: auto;
78
- margin-right: 0.255em;
79
- }
80
-
81
66
  :root {
82
67
  --ck-z-default: 10555 !important;
83
68
  --ck-z-modal: calc(var(--ck-z-default) + 999) !important;
@@ -99,6 +84,21 @@
99
84
  }
100
85
  }
101
86
 
87
+ .sh-selected-item{
88
+ line-height: unset!important;
89
+ }
90
+ .sh-suggestion-input{
91
+ padding: 0.375rem 0.75rem;
92
+ }
93
+ .sh-suggest{
94
+ margin-bottom: 1rem;
95
+ }
96
+ .sh-suggest-control::after{
97
+ margin-top: auto;
98
+ margin-bottom: auto;
99
+ margin-right: 0.255em;
100
+ }
101
+
102
102
  .sh-forgot-link, .sh-register-link{
103
103
  cursor: pointer;
104
104
  }
package/dist/library.js CHANGED
@@ -2170,6 +2170,7 @@ var script$9 = {
2170
2170
  console.log(reason,message);
2171
2171
  if (reason.status === 422) { // change this to 422 validation error response as received from laravel
2172
2172
  this.form_errors = reason.data.errors;
2173
+ this.errorText = 'Fill all the details correctly';
2173
2174
  } else {
2174
2175
  this.errorText = message;
2175
2176
  }
@@ -2240,40 +2241,41 @@ var script$9 = {
2240
2241
  }
2241
2242
  };
2242
2243
 
2243
- const _hoisted_1$9 = {
2244
+ const _hoisted_1$9 = /*#__PURE__*/vue.createElementVNode("h5", { class: "d-none" }, null, -1 /* HOISTED */);
2245
+ const _hoisted_2$9 = {
2244
2246
  ref: "ShAutoForm",
2245
2247
  class: "sh-form"
2246
2248
  };
2247
- const _hoisted_2$9 = {
2249
+ const _hoisted_3$9 = {
2248
2250
  key: 0,
2249
2251
  class: "alert alert-danger alert-dismissible fade show sh-form-submission-error",
2250
2252
  role: "alert"
2251
2253
  };
2252
- const _hoisted_3$9 = /*#__PURE__*/vue.createElementVNode("i", { class: "bi-exclamation-triangle-fill me-1" }, null, -1 /* HOISTED */);
2253
- const _hoisted_4$9 = { key: 0 };
2254
- const _hoisted_5$5 = { key: 1 };
2255
- const _hoisted_6$4 = { class: "row" };
2256
- const _hoisted_7$3 = { class: "fg-label control-label text-capitalize control-bel col-md-12 request-form-label mb-2" };
2257
- const _hoisted_8$2 = { class: "col-md-12" };
2258
- const _hoisted_9$3 = ["data-cy", "placeholder", "name", "onFocus", "onChange"];
2259
- const _hoisted_10$2 = ["data-cy", "placeholder", "name", "onFocus", "onUpdate:modelValue"];
2254
+ const _hoisted_4$9 = /*#__PURE__*/vue.createElementVNode("i", { class: "bi-exclamation-triangle-fill me-1" }, null, -1 /* HOISTED */);
2255
+ const _hoisted_5$5 = { key: 0 };
2256
+ const _hoisted_6$4 = { key: 1 };
2257
+ const _hoisted_7$3 = { class: "row" };
2258
+ const _hoisted_8$2 = { class: "fg-label control-label text-capitalize control-bel col-md-12 request-form-label mb-2" };
2259
+ const _hoisted_9$3 = { class: "col-md-12" };
2260
+ const _hoisted_10$2 = ["data-cy", "placeholder", "name", "onFocus", "onChange"];
2260
2261
  const _hoisted_11$2 = ["data-cy", "placeholder", "name", "onFocus", "onUpdate:modelValue"];
2261
2262
  const _hoisted_12$2 = ["data-cy", "placeholder", "name", "onFocus", "onUpdate:modelValue"];
2262
- const _hoisted_13$2 = ["data-cy", "name", "onFocus", "onUpdate:modelValue"];
2263
- const _hoisted_14$2 = ["disabled", "placeholder", "name", "onFocus", "onUpdate:modelValue"];
2264
- const _hoisted_15$2 = ["name", "onFocus", "onUpdate:modelValue"];
2263
+ const _hoisted_13$2 = ["data-cy", "placeholder", "name", "onFocus", "onUpdate:modelValue"];
2264
+ const _hoisted_14$2 = ["data-cy", "name", "onFocus", "onUpdate:modelValue"];
2265
+ const _hoisted_15$2 = ["disabled", "placeholder", "name", "onFocus", "onUpdate:modelValue"];
2265
2266
  const _hoisted_16$2 = ["name", "onFocus", "onUpdate:modelValue"];
2266
- const _hoisted_17$2 = ["value"];
2267
- const _hoisted_18$2 = {
2267
+ const _hoisted_17$2 = ["name", "onFocus", "onUpdate:modelValue"];
2268
+ const _hoisted_18$2 = ["value"];
2269
+ const _hoisted_19$2 = {
2268
2270
  key: 12,
2269
2271
  class: "invalid-feedback"
2270
2272
  };
2271
- const _hoisted_19$2 = {
2273
+ const _hoisted_20$2 = {
2272
2274
  key: 1,
2273
2275
  class: "row"
2274
2276
  };
2275
- const _hoisted_20$2 = /*#__PURE__*/vue.createElementVNode("h5", null, "Confirm and Submit", -1 /* HOISTED */);
2276
- const _hoisted_21$2 = /*#__PURE__*/vue.createElementVNode("p", null, [
2277
+ const _hoisted_21$2 = /*#__PURE__*/vue.createElementVNode("h5", null, "Confirm and Submit", -1 /* HOISTED */);
2278
+ const _hoisted_22$2 = /*#__PURE__*/vue.createElementVNode("p", null, [
2277
2279
  /*#__PURE__*/vue.createTextVNode("By clicking submit, you agree to our "),
2278
2280
  /*#__PURE__*/vue.createElementVNode("a", {
2279
2281
  target: "_blank",
@@ -2285,11 +2287,11 @@ const _hoisted_21$2 = /*#__PURE__*/vue.createElementVNode("p", null, [
2285
2287
  href: "https://hauzisha.co.ke/privacy-policy"
2286
2288
  }, "privacy policy")
2287
2289
  ], -1 /* HOISTED */);
2288
- const _hoisted_22$2 = [
2289
- _hoisted_20$2,
2290
- _hoisted_21$2
2290
+ const _hoisted_23$1 = [
2291
+ _hoisted_21$2,
2292
+ _hoisted_22$2
2291
2293
  ];
2292
- const _hoisted_23$1 = /*#__PURE__*/vue.createElementVNode("span", {
2294
+ const _hoisted_24$1 = /*#__PURE__*/vue.createElementVNode("span", {
2293
2295
  class: "spinner-border spinner-border-sm",
2294
2296
  role: "status",
2295
2297
  "aria-hidden": "true"
@@ -2300,219 +2302,222 @@ function render$5(_ctx, _cache, $props, $setup, $data, $options) {
2300
2302
  const _component_ShSuggest = vue.resolveComponent("ShSuggest");
2301
2303
  const _component_ShEditor = vue.resolveComponent("ShEditor");
2302
2304
 
2303
- return (vue.openBlock(), vue.createElementBlock("form", _hoisted_1$9, [
2304
- vue.createCommentVNode(" <div v-if=\"form_status == 1\" class=\"alert alert-info\">Processing...</div>"),
2305
- vue.createCommentVNode(" <div v-if=\"form_status == 2\" class=\"alert alert-success\">Success</div>"),
2306
- (_ctx.form_status == 3)
2307
- ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$9, [
2308
- _hoisted_3$9,
2309
- (_ctx.errorText)
2310
- ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_4$9, vue.toDisplayString(_ctx.errorText), 1 /* TEXT */))
2311
- : (vue.openBlock(), vue.createElementBlock("span", _hoisted_5$5, "Unexpected Error Occurred")),
2312
- vue.createCommentVNode(" <button @click=\"hideError\" type=\"button\" class=\"btn-close\" aria-label=\"Close\"></button>")
2313
- ]))
2314
- : vue.createCommentVNode("v-if", true),
2315
- vue.withDirectives(vue.createElementVNode("input", {
2316
- type: "hidden",
2317
- "onUpdate:modelValue": _cache[0] || (_cache[0] = $event => ((_ctx.form_elements['id']) = $event))
2318
- }, null, 512 /* NEED_PATCH */), [
2319
- [vue.vModelText, _ctx.form_elements['id']]
2320
- ]),
2321
- vue.createElementVNode("div", _hoisted_6$4, [
2322
- (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList($props.fields, (field) => {
2323
- return (vue.openBlock(), vue.createElementBlock("div", {
2324
- class: vue.normalizeClass(["form-group", 'col-md-' + $options.getColumns()]),
2325
- key: field
2326
- }, [
2327
- vue.createElementVNode("label", _hoisted_7$3, vue.toDisplayString($options.getLabel(field)), 1 /* TEXT */),
2328
- vue.createElementVNode("div", _hoisted_8$2, [
2329
- ($options.getFieldType(field) === 'component')
2330
- ? (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent($props.customComponent[field]), {
2331
- key: 0,
2332
- "data-cy": field,
2333
- placeholder: _ctx.allPlaceHolders[field] ? _ctx.allPlaceHolders[field] : '',
2334
- name: field,
2335
- onFocus: $event => ($options.removeErrors(field)),
2336
- class: vue.normalizeClass([_ctx.form_errors[field] == null ? ' field_' + field:'is-invalid ' + field, "form-control"]),
2337
- modelValue: _ctx.form_elements[field],
2338
- "onUpdate:modelValue": $event => ((_ctx.form_elements[field]) = $event)
2339
- }, null, 40 /* PROPS, HYDRATE_EVENTS */, ["data-cy", "placeholder", "name", "onFocus", "class", "modelValue", "onUpdate:modelValue"]))
2340
- : vue.createCommentVNode("v-if", true),
2341
- ($options.getFieldType(field) === 'file')
2342
- ? (vue.openBlock(), vue.createElementBlock("input", {
2343
- key: 1,
2344
- "data-cy": field,
2345
- placeholder: _ctx.allPlaceHolders[field] ? _ctx.allPlaceHolders[field] : '',
2346
- name: field,
2347
- onFocus: $event => ($options.removeErrors(field)),
2348
- class: vue.normalizeClass([_ctx.form_errors[field] == null ? ' field_' + field:'is-invalid ' + field, "form-control"]),
2349
- ref_for: true,
2350
- ref: 'file_'+field,
2351
- onChange: $event => ($options.handleFileUpload(field)),
2352
- type: "file"
2353
- }, null, 42 /* CLASS, PROPS, HYDRATE_EVENTS */, _hoisted_9$3))
2354
- : vue.createCommentVNode("v-if", true),
2355
- ($options.getFieldType(field) === 'numeric')
2356
- ? vue.withDirectives((vue.openBlock(), vue.createElementBlock("input", {
2357
- key: 2,
2358
- "data-cy": field,
2359
- placeholder: _ctx.allPlaceHolders[field] ? _ctx.allPlaceHolders[field] : '',
2360
- name: field,
2361
- onFocus: $event => ($options.removeErrors(field)),
2362
- class: vue.normalizeClass([_ctx.form_errors[field] == null ? ' field_' + field:'is-invalid ' + field, "form-control"]),
2363
- "onUpdate:modelValue": $event => ((_ctx.form_elements[field]) = $event),
2364
- type: "number"
2365
- }, null, 42 /* CLASS, PROPS, HYDRATE_EVENTS */, _hoisted_10$2)), [
2366
- [vue.vModelText, _ctx.form_elements[field]]
2367
- ])
2368
- : vue.createCommentVNode("v-if", true),
2369
- ($options.getFieldType(field) === 'password')
2370
- ? vue.withDirectives((vue.openBlock(), vue.createElementBlock("input", {
2371
- key: 3,
2372
- "data-cy": field,
2373
- placeholder: _ctx.allPlaceHolders[field] ? _ctx.allPlaceHolders[field] : '',
2374
- name: field,
2375
- onFocus: $event => ($options.removeErrors(field)),
2376
- class: vue.normalizeClass([_ctx.form_errors[field] == null ? ' field_' + field:'is-invalid ' + field, "form-control"]),
2377
- "onUpdate:modelValue": $event => ((_ctx.form_elements[field]) = $event),
2378
- type: "password"
2379
- }, null, 42 /* CLASS, PROPS, HYDRATE_EVENTS */, _hoisted_11$2)), [
2380
- [vue.vModelText, _ctx.form_elements[field]]
2381
- ])
2382
- : vue.createCommentVNode("v-if", true),
2383
- ($options.getFieldType(field) === 'email')
2384
- ? vue.withDirectives((vue.openBlock(), vue.createElementBlock("input", {
2385
- key: 4,
2386
- "data-cy": field,
2387
- placeholder: _ctx.allPlaceHolders[field] ? _ctx.allPlaceHolders[field] : '',
2388
- name: field,
2389
- onFocus: $event => ($options.removeErrors(field)),
2390
- class: vue.normalizeClass([_ctx.form_errors[field] == null ? ' field_' + field:'is-invalid ' + field, "form-control"]),
2391
- "onUpdate:modelValue": $event => ((_ctx.form_elements[field]) = $event),
2392
- type: "email",
2393
- required: ""
2394
- }, null, 42 /* CLASS, PROPS, HYDRATE_EVENTS */, _hoisted_12$2)), [
2395
- [vue.vModelText, _ctx.form_elements[field]]
2396
- ])
2397
- : vue.createCommentVNode("v-if", true),
2398
- ($options.getFieldType(field) === 'datepicker' && $options.isDisabled(field) === false)
2399
- ? vue.withDirectives((vue.openBlock(), vue.createElementBlock("input", {
2400
- key: 5,
2401
- "data-cy": field,
2402
- type: "datetime-local",
2403
- name: field,
2404
- onFocus: $event => ($options.removeErrors(field)),
2405
- class: vue.normalizeClass([_ctx.form_errors[field] == null ? ' field_' + field:'is-invalid ' + field, "form-control active"]),
2406
- "onUpdate:modelValue": $event => ((_ctx.form_elements[field]) = $event)
2407
- }, null, 42 /* CLASS, PROPS, HYDRATE_EVENTS */, _hoisted_13$2)), [
2408
- [vue.vModelText, _ctx.form_elements[field]]
2409
- ])
2410
- : vue.createCommentVNode("v-if", true),
2411
- ($options.getFieldType(field) === 'phone')
2412
- ? (vue.openBlock(), vue.createBlock(_component_ShPhone, {
2413
- key: 6,
2414
- country_code: $props.country_code,
2415
- placeholder: _ctx.allPlaceHolders[field] ? _ctx.allPlaceHolders[field] : '',
2416
- name: field,
2417
- onFocus: $event => ($options.removeErrors(field)),
2418
- class: vue.normalizeClass([_ctx.form_errors[field] == null ? ' field_' + field:'is-invalid ' + field, "form-control"]),
2419
- modelValue: _ctx.form_elements[field],
2420
- "onUpdate:modelValue": $event => ((_ctx.form_elements[field]) = $event),
2421
- required: ""
2422
- }, null, 8 /* PROPS */, ["country_code", "placeholder", "name", "onFocus", "class", "modelValue", "onUpdate:modelValue"]))
2423
- : vue.createCommentVNode("v-if", true),
2424
- ($options.getFieldType(field) === 'suggest')
2425
- ? (vue.openBlock(), vue.createBlock(_component_ShSuggest, {
2426
- key: 7,
2427
- "select-data": _ctx.selectData[field],
2428
- "fill-selects": $props.fillSelects[field],
2429
- class: vue.normalizeClass(_ctx.form_errors[field] == null ? ' field_' + field:'is-invalid ' + field),
2430
- modelValue: _ctx.form_elements[field],
2431
- "onUpdate:modelValue": $event => ((_ctx.form_elements[field]) = $event)
2432
- }, null, 8 /* PROPS */, ["select-data", "fill-selects", "class", "modelValue", "onUpdate:modelValue"]))
2433
- : vue.createCommentVNode("v-if", true),
2434
- ($options.getFieldType(field) === 'editor')
2435
- ? (vue.openBlock(), vue.createBlock(_component_ShEditor, {
2436
- key: 8,
2437
- placeholder: _ctx.allPlaceHolders[field] ? _ctx.allPlaceHolders[field] : '',
2438
- name: field,
2439
- onFocus: $event => ($options.removeErrors(field)),
2440
- class: vue.normalizeClass([_ctx.form_errors[field] == null ? ' field_' + field:'is-invalid ' + field, "form-control"]),
2441
- modelValue: _ctx.form_elements[field],
2442
- "onUpdate:modelValue": $event => ((_ctx.form_elements[field]) = $event)
2443
- }, null, 8 /* PROPS */, ["placeholder", "name", "onFocus", "class", "modelValue", "onUpdate:modelValue"]))
2444
- : vue.createCommentVNode("v-if", true),
2445
- ($options.getFieldType(field) === 'text')
2446
- ? vue.withDirectives((vue.openBlock(), vue.createElementBlock("input", {
2447
- key: 9,
2448
- disabled: $options.isDisabled(field),
2449
- placeholder: field === 'phone_number' ? 'e.g 0712 345 678':'',
2450
- name: field,
2451
- onFocus: $event => ($options.removeErrors(field)),
2452
- class: vue.normalizeClass([_ctx.form_errors[field] == null ? ' field_' + field:'is-invalid ' + field, "form-control"]),
2453
- "onUpdate:modelValue": $event => ((_ctx.form_elements[field]) = $event),
2454
- type: "text"
2455
- }, null, 42 /* CLASS, PROPS, HYDRATE_EVENTS */, _hoisted_14$2)), [
2456
- [vue.vModelText, _ctx.form_elements[field]]
2457
- ])
2458
- : vue.createCommentVNode("v-if", true),
2459
- ($options.getFieldType(field) === 'textarea')
2460
- ? vue.withDirectives((vue.openBlock(), vue.createElementBlock("textarea", {
2461
- key: 10,
2462
- name: field,
2463
- onFocus: $event => ($options.removeErrors(field)),
2464
- class: vue.normalizeClass([_ctx.form_errors[field] == null ? ' field_' + field:'is-invalid ' + field, "form-control"]),
2465
- "onUpdate:modelValue": $event => ((_ctx.form_elements[field]) = $event)
2466
- }, null, 42 /* CLASS, PROPS, HYDRATE_EVENTS */, _hoisted_15$2)), [
2467
- [vue.vModelText, _ctx.form_elements[field]]
2468
- ])
2469
- : vue.createCommentVNode("v-if", true),
2470
- ($options.getFieldType(field) === 'select' && _ctx.selectData[field] != null)
2471
- ? vue.withDirectives((vue.openBlock(), vue.createElementBlock("select", {
2472
- key: 11,
2473
- name: field,
2474
- onFocus: $event => ($options.removeErrors(field)),
2475
- class: vue.normalizeClass([_ctx.form_errors[field] == null ? ' field_' + field:'is-invalid ' + field, "form-control"]),
2476
- "onUpdate:modelValue": $event => ((_ctx.form_elements[field]) = $event)
2477
- }, [
2478
- (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(_ctx.selectData[field], (item) => {
2479
- return (vue.openBlock(), vue.createElementBlock("option", {
2480
- key: item.id,
2481
- value: item.id
2482
- }, vue.toDisplayString(item.name), 9 /* TEXT, PROPS */, _hoisted_17$2))
2483
- }), 128 /* KEYED_FRAGMENT */))
2484
- ], 42 /* CLASS, PROPS, HYDRATE_EVENTS */, _hoisted_16$2)), [
2485
- [vue.vModelSelect, _ctx.form_elements[field]]
2486
- ])
2487
- : vue.createCommentVNode("v-if", true),
2488
- (_ctx.form_errors[field] != null )
2489
- ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_18$2, vue.toDisplayString(_ctx.form_errors[field][0]), 1 /* TEXT */))
2490
- : vue.createCommentVNode("v-if", true)
2491
- ])
2492
- ], 2 /* CLASS */))
2493
- }), 128 /* KEYED_FRAGMENT */))
2494
- ]),
2495
- ($props.hasTerms)
2496
- ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_19$2, _hoisted_22$2))
2497
- : vue.createCommentVNode("v-if", true),
2498
- (_ctx.form_status == 1)
2499
- ? (vue.openBlock(), vue.createElementBlock("button", {
2500
- key: 2,
2501
- class: vue.normalizeClass(["btn btn-primary", $options.getSubmitBtnClass()]),
2502
- type: "button",
2503
- disabled: ""
2504
- }, [
2505
- _hoisted_23$1,
2506
- vue.createTextVNode(" Processing... ")
2507
- ], 2 /* CLASS */))
2508
- : (vue.openBlock(), vue.createElementBlock("button", {
2509
- key: 3,
2510
- "data-cy": "sh_form_submit",
2511
- class: vue.normalizeClass(["mb-2 form-submit-btn", $options.getSubmitBtnClass()]),
2512
- type: "button",
2513
- onClick: _cache[1] || (_cache[1] = (...args) => ($options.submitForm && $options.submitForm(...args)))
2514
- }, vue.toDisplayString($props.actionLabel ? $props.actionLabel:'Submit'), 3 /* TEXT, CLASS */))
2515
- ], 512 /* NEED_PATCH */))
2305
+ return (vue.openBlock(), vue.createElementBlock(vue.Fragment, null, [
2306
+ _hoisted_1$9,
2307
+ vue.createElementVNode("form", _hoisted_2$9, [
2308
+ vue.createCommentVNode(" <div v-if=\"form_status == 1\" class=\"alert alert-info\">Processing...</div>"),
2309
+ vue.createCommentVNode(" <div v-if=\"form_status == 2\" class=\"alert alert-success\">Success</div>"),
2310
+ (_ctx.form_status == 3)
2311
+ ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_3$9, [
2312
+ _hoisted_4$9,
2313
+ (_ctx.errorText)
2314
+ ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_5$5, vue.toDisplayString(_ctx.errorText), 1 /* TEXT */))
2315
+ : (vue.openBlock(), vue.createElementBlock("span", _hoisted_6$4, "Unexpected Error Occurred")),
2316
+ vue.createCommentVNode(" <button @click=\"hideError\" type=\"button\" class=\"btn-close\" aria-label=\"Close\"></button>")
2317
+ ]))
2318
+ : vue.createCommentVNode("v-if", true),
2319
+ vue.withDirectives(vue.createElementVNode("input", {
2320
+ type: "hidden",
2321
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = $event => ((_ctx.form_elements['id']) = $event))
2322
+ }, null, 512 /* NEED_PATCH */), [
2323
+ [vue.vModelText, _ctx.form_elements['id']]
2324
+ ]),
2325
+ vue.createElementVNode("div", _hoisted_7$3, [
2326
+ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList($props.fields, (field) => {
2327
+ return (vue.openBlock(), vue.createElementBlock("div", {
2328
+ class: vue.normalizeClass(["form-group", 'col-md-' + $options.getColumns()]),
2329
+ key: field
2330
+ }, [
2331
+ vue.createElementVNode("label", _hoisted_8$2, vue.toDisplayString($options.getLabel(field)), 1 /* TEXT */),
2332
+ vue.createElementVNode("div", _hoisted_9$3, [
2333
+ ($options.getFieldType(field) === 'component')
2334
+ ? (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent($props.customComponent[field]), {
2335
+ key: 0,
2336
+ "data-cy": field,
2337
+ placeholder: _ctx.allPlaceHolders[field] ? _ctx.allPlaceHolders[field] : '',
2338
+ name: field,
2339
+ onFocus: $event => ($options.removeErrors(field)),
2340
+ class: vue.normalizeClass([_ctx.form_errors[field] == null ? ' field_' + field:'is-invalid ' + field, "form-control"]),
2341
+ modelValue: _ctx.form_elements[field],
2342
+ "onUpdate:modelValue": $event => ((_ctx.form_elements[field]) = $event)
2343
+ }, null, 40 /* PROPS, HYDRATE_EVENTS */, ["data-cy", "placeholder", "name", "onFocus", "class", "modelValue", "onUpdate:modelValue"]))
2344
+ : vue.createCommentVNode("v-if", true),
2345
+ ($options.getFieldType(field) === 'file')
2346
+ ? (vue.openBlock(), vue.createElementBlock("input", {
2347
+ key: 1,
2348
+ "data-cy": field,
2349
+ placeholder: _ctx.allPlaceHolders[field] ? _ctx.allPlaceHolders[field] : '',
2350
+ name: field,
2351
+ onFocus: $event => ($options.removeErrors(field)),
2352
+ class: vue.normalizeClass([_ctx.form_errors[field] == null ? ' field_' + field:'is-invalid ' + field, "form-control"]),
2353
+ ref_for: true,
2354
+ ref: 'file_'+field,
2355
+ onChange: $event => ($options.handleFileUpload(field)),
2356
+ type: "file"
2357
+ }, null, 42 /* CLASS, PROPS, HYDRATE_EVENTS */, _hoisted_10$2))
2358
+ : vue.createCommentVNode("v-if", true),
2359
+ ($options.getFieldType(field) === 'numeric')
2360
+ ? vue.withDirectives((vue.openBlock(), vue.createElementBlock("input", {
2361
+ key: 2,
2362
+ "data-cy": field,
2363
+ placeholder: _ctx.allPlaceHolders[field] ? _ctx.allPlaceHolders[field] : '',
2364
+ name: field,
2365
+ onFocus: $event => ($options.removeErrors(field)),
2366
+ class: vue.normalizeClass([_ctx.form_errors[field] == null ? ' field_' + field:'is-invalid ' + field, "form-control"]),
2367
+ "onUpdate:modelValue": $event => ((_ctx.form_elements[field]) = $event),
2368
+ type: "number"
2369
+ }, null, 42 /* CLASS, PROPS, HYDRATE_EVENTS */, _hoisted_11$2)), [
2370
+ [vue.vModelText, _ctx.form_elements[field]]
2371
+ ])
2372
+ : vue.createCommentVNode("v-if", true),
2373
+ ($options.getFieldType(field) === 'password')
2374
+ ? vue.withDirectives((vue.openBlock(), vue.createElementBlock("input", {
2375
+ key: 3,
2376
+ "data-cy": field,
2377
+ placeholder: _ctx.allPlaceHolders[field] ? _ctx.allPlaceHolders[field] : '',
2378
+ name: field,
2379
+ onFocus: $event => ($options.removeErrors(field)),
2380
+ class: vue.normalizeClass([_ctx.form_errors[field] == null ? ' field_' + field:'is-invalid ' + field, "form-control"]),
2381
+ "onUpdate:modelValue": $event => ((_ctx.form_elements[field]) = $event),
2382
+ type: "password"
2383
+ }, null, 42 /* CLASS, PROPS, HYDRATE_EVENTS */, _hoisted_12$2)), [
2384
+ [vue.vModelText, _ctx.form_elements[field]]
2385
+ ])
2386
+ : vue.createCommentVNode("v-if", true),
2387
+ ($options.getFieldType(field) === 'email')
2388
+ ? vue.withDirectives((vue.openBlock(), vue.createElementBlock("input", {
2389
+ key: 4,
2390
+ "data-cy": field,
2391
+ placeholder: _ctx.allPlaceHolders[field] ? _ctx.allPlaceHolders[field] : '',
2392
+ name: field,
2393
+ onFocus: $event => ($options.removeErrors(field)),
2394
+ class: vue.normalizeClass([_ctx.form_errors[field] == null ? ' field_' + field:'is-invalid ' + field, "form-control"]),
2395
+ "onUpdate:modelValue": $event => ((_ctx.form_elements[field]) = $event),
2396
+ type: "email",
2397
+ required: ""
2398
+ }, null, 42 /* CLASS, PROPS, HYDRATE_EVENTS */, _hoisted_13$2)), [
2399
+ [vue.vModelText, _ctx.form_elements[field]]
2400
+ ])
2401
+ : vue.createCommentVNode("v-if", true),
2402
+ ($options.getFieldType(field) === 'datepicker' && $options.isDisabled(field) === false)
2403
+ ? vue.withDirectives((vue.openBlock(), vue.createElementBlock("input", {
2404
+ key: 5,
2405
+ "data-cy": field,
2406
+ type: "datetime-local",
2407
+ name: field,
2408
+ onFocus: $event => ($options.removeErrors(field)),
2409
+ class: vue.normalizeClass([_ctx.form_errors[field] == null ? ' field_' + field:'is-invalid ' + field, "form-control active"]),
2410
+ "onUpdate:modelValue": $event => ((_ctx.form_elements[field]) = $event)
2411
+ }, null, 42 /* CLASS, PROPS, HYDRATE_EVENTS */, _hoisted_14$2)), [
2412
+ [vue.vModelText, _ctx.form_elements[field]]
2413
+ ])
2414
+ : vue.createCommentVNode("v-if", true),
2415
+ ($options.getFieldType(field) === 'phone')
2416
+ ? (vue.openBlock(), vue.createBlock(_component_ShPhone, {
2417
+ key: 6,
2418
+ country_code: $props.country_code,
2419
+ placeholder: _ctx.allPlaceHolders[field] ? _ctx.allPlaceHolders[field] : '',
2420
+ name: field,
2421
+ onFocus: $event => ($options.removeErrors(field)),
2422
+ class: vue.normalizeClass([_ctx.form_errors[field] == null ? ' field_' + field:'is-invalid ' + field, "form-control"]),
2423
+ modelValue: _ctx.form_elements[field],
2424
+ "onUpdate:modelValue": $event => ((_ctx.form_elements[field]) = $event),
2425
+ required: ""
2426
+ }, null, 8 /* PROPS */, ["country_code", "placeholder", "name", "onFocus", "class", "modelValue", "onUpdate:modelValue"]))
2427
+ : vue.createCommentVNode("v-if", true),
2428
+ ($options.getFieldType(field) === 'suggest')
2429
+ ? (vue.openBlock(), vue.createBlock(_component_ShSuggest, {
2430
+ key: 7,
2431
+ "select-data": _ctx.selectData[field],
2432
+ "fill-selects": $props.fillSelects[field],
2433
+ class: vue.normalizeClass(_ctx.form_errors[field] == null ? ' field_' + field:'is-invalid ' + field),
2434
+ modelValue: _ctx.form_elements[field],
2435
+ "onUpdate:modelValue": $event => ((_ctx.form_elements[field]) = $event)
2436
+ }, null, 8 /* PROPS */, ["select-data", "fill-selects", "class", "modelValue", "onUpdate:modelValue"]))
2437
+ : vue.createCommentVNode("v-if", true),
2438
+ ($options.getFieldType(field) === 'editor')
2439
+ ? (vue.openBlock(), vue.createBlock(_component_ShEditor, {
2440
+ key: 8,
2441
+ placeholder: _ctx.allPlaceHolders[field] ? _ctx.allPlaceHolders[field] : '',
2442
+ name: field,
2443
+ onFocus: $event => ($options.removeErrors(field)),
2444
+ class: vue.normalizeClass([_ctx.form_errors[field] == null ? ' field_' + field:'is-invalid ' + field, "form-control"]),
2445
+ modelValue: _ctx.form_elements[field],
2446
+ "onUpdate:modelValue": $event => ((_ctx.form_elements[field]) = $event)
2447
+ }, null, 8 /* PROPS */, ["placeholder", "name", "onFocus", "class", "modelValue", "onUpdate:modelValue"]))
2448
+ : vue.createCommentVNode("v-if", true),
2449
+ ($options.getFieldType(field) === 'text')
2450
+ ? vue.withDirectives((vue.openBlock(), vue.createElementBlock("input", {
2451
+ key: 9,
2452
+ disabled: $options.isDisabled(field),
2453
+ placeholder: field === 'phone_number' ? 'e.g 0712 345 678':'',
2454
+ name: field,
2455
+ onFocus: $event => ($options.removeErrors(field)),
2456
+ class: vue.normalizeClass([_ctx.form_errors[field] == null ? ' field_' + field:'is-invalid ' + field, "form-control"]),
2457
+ "onUpdate:modelValue": $event => ((_ctx.form_elements[field]) = $event),
2458
+ type: "text"
2459
+ }, null, 42 /* CLASS, PROPS, HYDRATE_EVENTS */, _hoisted_15$2)), [
2460
+ [vue.vModelText, _ctx.form_elements[field]]
2461
+ ])
2462
+ : vue.createCommentVNode("v-if", true),
2463
+ ($options.getFieldType(field) === 'textarea')
2464
+ ? vue.withDirectives((vue.openBlock(), vue.createElementBlock("textarea", {
2465
+ key: 10,
2466
+ name: field,
2467
+ onFocus: $event => ($options.removeErrors(field)),
2468
+ class: vue.normalizeClass([_ctx.form_errors[field] == null ? ' field_' + field:'is-invalid ' + field, "form-control"]),
2469
+ "onUpdate:modelValue": $event => ((_ctx.form_elements[field]) = $event)
2470
+ }, null, 42 /* CLASS, PROPS, HYDRATE_EVENTS */, _hoisted_16$2)), [
2471
+ [vue.vModelText, _ctx.form_elements[field]]
2472
+ ])
2473
+ : vue.createCommentVNode("v-if", true),
2474
+ ($options.getFieldType(field) === 'select' && _ctx.selectData[field] != null)
2475
+ ? vue.withDirectives((vue.openBlock(), vue.createElementBlock("select", {
2476
+ key: 11,
2477
+ name: field,
2478
+ onFocus: $event => ($options.removeErrors(field)),
2479
+ class: vue.normalizeClass([_ctx.form_errors[field] == null ? ' field_' + field:'is-invalid ' + field, "form-control"]),
2480
+ "onUpdate:modelValue": $event => ((_ctx.form_elements[field]) = $event)
2481
+ }, [
2482
+ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(_ctx.selectData[field], (item) => {
2483
+ return (vue.openBlock(), vue.createElementBlock("option", {
2484
+ key: item.id,
2485
+ value: item.id
2486
+ }, vue.toDisplayString(item.name), 9 /* TEXT, PROPS */, _hoisted_18$2))
2487
+ }), 128 /* KEYED_FRAGMENT */))
2488
+ ], 42 /* CLASS, PROPS, HYDRATE_EVENTS */, _hoisted_17$2)), [
2489
+ [vue.vModelSelect, _ctx.form_elements[field]]
2490
+ ])
2491
+ : vue.createCommentVNode("v-if", true),
2492
+ (_ctx.form_errors[field] != null )
2493
+ ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_19$2, vue.toDisplayString(_ctx.form_errors[field][0]), 1 /* TEXT */))
2494
+ : vue.createCommentVNode("v-if", true)
2495
+ ])
2496
+ ], 2 /* CLASS */))
2497
+ }), 128 /* KEYED_FRAGMENT */))
2498
+ ]),
2499
+ ($props.hasTerms)
2500
+ ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_20$2, _hoisted_23$1))
2501
+ : vue.createCommentVNode("v-if", true),
2502
+ (_ctx.form_status == 1)
2503
+ ? (vue.openBlock(), vue.createElementBlock("button", {
2504
+ key: 2,
2505
+ class: vue.normalizeClass(["btn btn-primary", $options.getSubmitBtnClass()]),
2506
+ type: "button",
2507
+ disabled: ""
2508
+ }, [
2509
+ _hoisted_24$1,
2510
+ vue.createTextVNode(" Processing... ")
2511
+ ], 2 /* CLASS */))
2512
+ : (vue.openBlock(), vue.createElementBlock("button", {
2513
+ key: 3,
2514
+ "data-cy": "sh_form_submit",
2515
+ class: vue.normalizeClass(["mb-2 form-submit-btn", $options.getSubmitBtnClass()]),
2516
+ type: "button",
2517
+ onClick: _cache[1] || (_cache[1] = (...args) => ($options.submitForm && $options.submitForm(...args)))
2518
+ }, vue.toDisplayString($props.actionLabel ? $props.actionLabel:'Submit'), 3 /* TEXT, CLASS */))
2519
+ ], 512 /* NEED_PATCH */)
2520
+ ], 64 /* STABLE_FRAGMENT */))
2516
2521
  }
2517
2522
 
2518
2523
  script$9.render = render$5;
package/dist/library.mjs CHANGED
@@ -2158,6 +2158,7 @@ var script$9 = {
2158
2158
  console.log(reason,message);
2159
2159
  if (reason.status === 422) { // change this to 422 validation error response as received from laravel
2160
2160
  this.form_errors = reason.data.errors;
2161
+ this.errorText = 'Fill all the details correctly';
2161
2162
  } else {
2162
2163
  this.errorText = message;
2163
2164
  }
@@ -2228,40 +2229,41 @@ var script$9 = {
2228
2229
  }
2229
2230
  };
2230
2231
 
2231
- const _hoisted_1$9 = {
2232
+ const _hoisted_1$9 = /*#__PURE__*/createElementVNode("h5", { class: "d-none" }, null, -1 /* HOISTED */);
2233
+ const _hoisted_2$9 = {
2232
2234
  ref: "ShAutoForm",
2233
2235
  class: "sh-form"
2234
2236
  };
2235
- const _hoisted_2$9 = {
2237
+ const _hoisted_3$9 = {
2236
2238
  key: 0,
2237
2239
  class: "alert alert-danger alert-dismissible fade show sh-form-submission-error",
2238
2240
  role: "alert"
2239
2241
  };
2240
- const _hoisted_3$9 = /*#__PURE__*/createElementVNode("i", { class: "bi-exclamation-triangle-fill me-1" }, null, -1 /* HOISTED */);
2241
- const _hoisted_4$9 = { key: 0 };
2242
- const _hoisted_5$5 = { key: 1 };
2243
- const _hoisted_6$4 = { class: "row" };
2244
- const _hoisted_7$3 = { class: "fg-label control-label text-capitalize control-bel col-md-12 request-form-label mb-2" };
2245
- const _hoisted_8$2 = { class: "col-md-12" };
2246
- const _hoisted_9$3 = ["data-cy", "placeholder", "name", "onFocus", "onChange"];
2247
- const _hoisted_10$2 = ["data-cy", "placeholder", "name", "onFocus", "onUpdate:modelValue"];
2242
+ const _hoisted_4$9 = /*#__PURE__*/createElementVNode("i", { class: "bi-exclamation-triangle-fill me-1" }, null, -1 /* HOISTED */);
2243
+ const _hoisted_5$5 = { key: 0 };
2244
+ const _hoisted_6$4 = { key: 1 };
2245
+ const _hoisted_7$3 = { class: "row" };
2246
+ const _hoisted_8$2 = { class: "fg-label control-label text-capitalize control-bel col-md-12 request-form-label mb-2" };
2247
+ const _hoisted_9$3 = { class: "col-md-12" };
2248
+ const _hoisted_10$2 = ["data-cy", "placeholder", "name", "onFocus", "onChange"];
2248
2249
  const _hoisted_11$2 = ["data-cy", "placeholder", "name", "onFocus", "onUpdate:modelValue"];
2249
2250
  const _hoisted_12$2 = ["data-cy", "placeholder", "name", "onFocus", "onUpdate:modelValue"];
2250
- const _hoisted_13$2 = ["data-cy", "name", "onFocus", "onUpdate:modelValue"];
2251
- const _hoisted_14$2 = ["disabled", "placeholder", "name", "onFocus", "onUpdate:modelValue"];
2252
- const _hoisted_15$2 = ["name", "onFocus", "onUpdate:modelValue"];
2251
+ const _hoisted_13$2 = ["data-cy", "placeholder", "name", "onFocus", "onUpdate:modelValue"];
2252
+ const _hoisted_14$2 = ["data-cy", "name", "onFocus", "onUpdate:modelValue"];
2253
+ const _hoisted_15$2 = ["disabled", "placeholder", "name", "onFocus", "onUpdate:modelValue"];
2253
2254
  const _hoisted_16$2 = ["name", "onFocus", "onUpdate:modelValue"];
2254
- const _hoisted_17$2 = ["value"];
2255
- const _hoisted_18$2 = {
2255
+ const _hoisted_17$2 = ["name", "onFocus", "onUpdate:modelValue"];
2256
+ const _hoisted_18$2 = ["value"];
2257
+ const _hoisted_19$2 = {
2256
2258
  key: 12,
2257
2259
  class: "invalid-feedback"
2258
2260
  };
2259
- const _hoisted_19$2 = {
2261
+ const _hoisted_20$2 = {
2260
2262
  key: 1,
2261
2263
  class: "row"
2262
2264
  };
2263
- const _hoisted_20$2 = /*#__PURE__*/createElementVNode("h5", null, "Confirm and Submit", -1 /* HOISTED */);
2264
- const _hoisted_21$2 = /*#__PURE__*/createElementVNode("p", null, [
2265
+ const _hoisted_21$2 = /*#__PURE__*/createElementVNode("h5", null, "Confirm and Submit", -1 /* HOISTED */);
2266
+ const _hoisted_22$2 = /*#__PURE__*/createElementVNode("p", null, [
2265
2267
  /*#__PURE__*/createTextVNode("By clicking submit, you agree to our "),
2266
2268
  /*#__PURE__*/createElementVNode("a", {
2267
2269
  target: "_blank",
@@ -2273,11 +2275,11 @@ const _hoisted_21$2 = /*#__PURE__*/createElementVNode("p", null, [
2273
2275
  href: "https://hauzisha.co.ke/privacy-policy"
2274
2276
  }, "privacy policy")
2275
2277
  ], -1 /* HOISTED */);
2276
- const _hoisted_22$2 = [
2277
- _hoisted_20$2,
2278
- _hoisted_21$2
2278
+ const _hoisted_23$1 = [
2279
+ _hoisted_21$2,
2280
+ _hoisted_22$2
2279
2281
  ];
2280
- const _hoisted_23$1 = /*#__PURE__*/createElementVNode("span", {
2282
+ const _hoisted_24$1 = /*#__PURE__*/createElementVNode("span", {
2281
2283
  class: "spinner-border spinner-border-sm",
2282
2284
  role: "status",
2283
2285
  "aria-hidden": "true"
@@ -2288,219 +2290,222 @@ function render$5(_ctx, _cache, $props, $setup, $data, $options) {
2288
2290
  const _component_ShSuggest = resolveComponent("ShSuggest");
2289
2291
  const _component_ShEditor = resolveComponent("ShEditor");
2290
2292
 
2291
- return (openBlock(), createElementBlock("form", _hoisted_1$9, [
2292
- createCommentVNode(" <div v-if=\"form_status == 1\" class=\"alert alert-info\">Processing...</div>"),
2293
- createCommentVNode(" <div v-if=\"form_status == 2\" class=\"alert alert-success\">Success</div>"),
2294
- (_ctx.form_status == 3)
2295
- ? (openBlock(), createElementBlock("div", _hoisted_2$9, [
2296
- _hoisted_3$9,
2297
- (_ctx.errorText)
2298
- ? (openBlock(), createElementBlock("span", _hoisted_4$9, toDisplayString(_ctx.errorText), 1 /* TEXT */))
2299
- : (openBlock(), createElementBlock("span", _hoisted_5$5, "Unexpected Error Occurred")),
2300
- createCommentVNode(" <button @click=\"hideError\" type=\"button\" class=\"btn-close\" aria-label=\"Close\"></button>")
2301
- ]))
2302
- : createCommentVNode("v-if", true),
2303
- withDirectives(createElementVNode("input", {
2304
- type: "hidden",
2305
- "onUpdate:modelValue": _cache[0] || (_cache[0] = $event => ((_ctx.form_elements['id']) = $event))
2306
- }, null, 512 /* NEED_PATCH */), [
2307
- [vModelText, _ctx.form_elements['id']]
2308
- ]),
2309
- createElementVNode("div", _hoisted_6$4, [
2310
- (openBlock(true), createElementBlock(Fragment, null, renderList($props.fields, (field) => {
2311
- return (openBlock(), createElementBlock("div", {
2312
- class: normalizeClass(["form-group", 'col-md-' + $options.getColumns()]),
2313
- key: field
2314
- }, [
2315
- createElementVNode("label", _hoisted_7$3, toDisplayString($options.getLabel(field)), 1 /* TEXT */),
2316
- createElementVNode("div", _hoisted_8$2, [
2317
- ($options.getFieldType(field) === 'component')
2318
- ? (openBlock(), createBlock(resolveDynamicComponent($props.customComponent[field]), {
2319
- key: 0,
2320
- "data-cy": field,
2321
- placeholder: _ctx.allPlaceHolders[field] ? _ctx.allPlaceHolders[field] : '',
2322
- name: field,
2323
- onFocus: $event => ($options.removeErrors(field)),
2324
- class: normalizeClass([_ctx.form_errors[field] == null ? ' field_' + field:'is-invalid ' + field, "form-control"]),
2325
- modelValue: _ctx.form_elements[field],
2326
- "onUpdate:modelValue": $event => ((_ctx.form_elements[field]) = $event)
2327
- }, null, 40 /* PROPS, HYDRATE_EVENTS */, ["data-cy", "placeholder", "name", "onFocus", "class", "modelValue", "onUpdate:modelValue"]))
2328
- : createCommentVNode("v-if", true),
2329
- ($options.getFieldType(field) === 'file')
2330
- ? (openBlock(), createElementBlock("input", {
2331
- key: 1,
2332
- "data-cy": field,
2333
- placeholder: _ctx.allPlaceHolders[field] ? _ctx.allPlaceHolders[field] : '',
2334
- name: field,
2335
- onFocus: $event => ($options.removeErrors(field)),
2336
- class: normalizeClass([_ctx.form_errors[field] == null ? ' field_' + field:'is-invalid ' + field, "form-control"]),
2337
- ref_for: true,
2338
- ref: 'file_'+field,
2339
- onChange: $event => ($options.handleFileUpload(field)),
2340
- type: "file"
2341
- }, null, 42 /* CLASS, PROPS, HYDRATE_EVENTS */, _hoisted_9$3))
2342
- : createCommentVNode("v-if", true),
2343
- ($options.getFieldType(field) === 'numeric')
2344
- ? withDirectives((openBlock(), createElementBlock("input", {
2345
- key: 2,
2346
- "data-cy": field,
2347
- placeholder: _ctx.allPlaceHolders[field] ? _ctx.allPlaceHolders[field] : '',
2348
- name: field,
2349
- onFocus: $event => ($options.removeErrors(field)),
2350
- class: normalizeClass([_ctx.form_errors[field] == null ? ' field_' + field:'is-invalid ' + field, "form-control"]),
2351
- "onUpdate:modelValue": $event => ((_ctx.form_elements[field]) = $event),
2352
- type: "number"
2353
- }, null, 42 /* CLASS, PROPS, HYDRATE_EVENTS */, _hoisted_10$2)), [
2354
- [vModelText, _ctx.form_elements[field]]
2355
- ])
2356
- : createCommentVNode("v-if", true),
2357
- ($options.getFieldType(field) === 'password')
2358
- ? withDirectives((openBlock(), createElementBlock("input", {
2359
- key: 3,
2360
- "data-cy": field,
2361
- placeholder: _ctx.allPlaceHolders[field] ? _ctx.allPlaceHolders[field] : '',
2362
- name: field,
2363
- onFocus: $event => ($options.removeErrors(field)),
2364
- class: normalizeClass([_ctx.form_errors[field] == null ? ' field_' + field:'is-invalid ' + field, "form-control"]),
2365
- "onUpdate:modelValue": $event => ((_ctx.form_elements[field]) = $event),
2366
- type: "password"
2367
- }, null, 42 /* CLASS, PROPS, HYDRATE_EVENTS */, _hoisted_11$2)), [
2368
- [vModelText, _ctx.form_elements[field]]
2369
- ])
2370
- : createCommentVNode("v-if", true),
2371
- ($options.getFieldType(field) === 'email')
2372
- ? withDirectives((openBlock(), createElementBlock("input", {
2373
- key: 4,
2374
- "data-cy": field,
2375
- placeholder: _ctx.allPlaceHolders[field] ? _ctx.allPlaceHolders[field] : '',
2376
- name: field,
2377
- onFocus: $event => ($options.removeErrors(field)),
2378
- class: normalizeClass([_ctx.form_errors[field] == null ? ' field_' + field:'is-invalid ' + field, "form-control"]),
2379
- "onUpdate:modelValue": $event => ((_ctx.form_elements[field]) = $event),
2380
- type: "email",
2381
- required: ""
2382
- }, null, 42 /* CLASS, PROPS, HYDRATE_EVENTS */, _hoisted_12$2)), [
2383
- [vModelText, _ctx.form_elements[field]]
2384
- ])
2385
- : createCommentVNode("v-if", true),
2386
- ($options.getFieldType(field) === 'datepicker' && $options.isDisabled(field) === false)
2387
- ? withDirectives((openBlock(), createElementBlock("input", {
2388
- key: 5,
2389
- "data-cy": field,
2390
- type: "datetime-local",
2391
- name: field,
2392
- onFocus: $event => ($options.removeErrors(field)),
2393
- class: normalizeClass([_ctx.form_errors[field] == null ? ' field_' + field:'is-invalid ' + field, "form-control active"]),
2394
- "onUpdate:modelValue": $event => ((_ctx.form_elements[field]) = $event)
2395
- }, null, 42 /* CLASS, PROPS, HYDRATE_EVENTS */, _hoisted_13$2)), [
2396
- [vModelText, _ctx.form_elements[field]]
2397
- ])
2398
- : createCommentVNode("v-if", true),
2399
- ($options.getFieldType(field) === 'phone')
2400
- ? (openBlock(), createBlock(_component_ShPhone, {
2401
- key: 6,
2402
- country_code: $props.country_code,
2403
- placeholder: _ctx.allPlaceHolders[field] ? _ctx.allPlaceHolders[field] : '',
2404
- name: field,
2405
- onFocus: $event => ($options.removeErrors(field)),
2406
- class: normalizeClass([_ctx.form_errors[field] == null ? ' field_' + field:'is-invalid ' + field, "form-control"]),
2407
- modelValue: _ctx.form_elements[field],
2408
- "onUpdate:modelValue": $event => ((_ctx.form_elements[field]) = $event),
2409
- required: ""
2410
- }, null, 8 /* PROPS */, ["country_code", "placeholder", "name", "onFocus", "class", "modelValue", "onUpdate:modelValue"]))
2411
- : createCommentVNode("v-if", true),
2412
- ($options.getFieldType(field) === 'suggest')
2413
- ? (openBlock(), createBlock(_component_ShSuggest, {
2414
- key: 7,
2415
- "select-data": _ctx.selectData[field],
2416
- "fill-selects": $props.fillSelects[field],
2417
- class: normalizeClass(_ctx.form_errors[field] == null ? ' field_' + field:'is-invalid ' + field),
2418
- modelValue: _ctx.form_elements[field],
2419
- "onUpdate:modelValue": $event => ((_ctx.form_elements[field]) = $event)
2420
- }, null, 8 /* PROPS */, ["select-data", "fill-selects", "class", "modelValue", "onUpdate:modelValue"]))
2421
- : createCommentVNode("v-if", true),
2422
- ($options.getFieldType(field) === 'editor')
2423
- ? (openBlock(), createBlock(_component_ShEditor, {
2424
- key: 8,
2425
- placeholder: _ctx.allPlaceHolders[field] ? _ctx.allPlaceHolders[field] : '',
2426
- name: field,
2427
- onFocus: $event => ($options.removeErrors(field)),
2428
- class: normalizeClass([_ctx.form_errors[field] == null ? ' field_' + field:'is-invalid ' + field, "form-control"]),
2429
- modelValue: _ctx.form_elements[field],
2430
- "onUpdate:modelValue": $event => ((_ctx.form_elements[field]) = $event)
2431
- }, null, 8 /* PROPS */, ["placeholder", "name", "onFocus", "class", "modelValue", "onUpdate:modelValue"]))
2432
- : createCommentVNode("v-if", true),
2433
- ($options.getFieldType(field) === 'text')
2434
- ? withDirectives((openBlock(), createElementBlock("input", {
2435
- key: 9,
2436
- disabled: $options.isDisabled(field),
2437
- placeholder: field === 'phone_number' ? 'e.g 0712 345 678':'',
2438
- name: field,
2439
- onFocus: $event => ($options.removeErrors(field)),
2440
- class: normalizeClass([_ctx.form_errors[field] == null ? ' field_' + field:'is-invalid ' + field, "form-control"]),
2441
- "onUpdate:modelValue": $event => ((_ctx.form_elements[field]) = $event),
2442
- type: "text"
2443
- }, null, 42 /* CLASS, PROPS, HYDRATE_EVENTS */, _hoisted_14$2)), [
2444
- [vModelText, _ctx.form_elements[field]]
2445
- ])
2446
- : createCommentVNode("v-if", true),
2447
- ($options.getFieldType(field) === 'textarea')
2448
- ? withDirectives((openBlock(), createElementBlock("textarea", {
2449
- key: 10,
2450
- name: field,
2451
- onFocus: $event => ($options.removeErrors(field)),
2452
- class: normalizeClass([_ctx.form_errors[field] == null ? ' field_' + field:'is-invalid ' + field, "form-control"]),
2453
- "onUpdate:modelValue": $event => ((_ctx.form_elements[field]) = $event)
2454
- }, null, 42 /* CLASS, PROPS, HYDRATE_EVENTS */, _hoisted_15$2)), [
2455
- [vModelText, _ctx.form_elements[field]]
2456
- ])
2457
- : createCommentVNode("v-if", true),
2458
- ($options.getFieldType(field) === 'select' && _ctx.selectData[field] != null)
2459
- ? withDirectives((openBlock(), createElementBlock("select", {
2460
- key: 11,
2461
- name: field,
2462
- onFocus: $event => ($options.removeErrors(field)),
2463
- class: normalizeClass([_ctx.form_errors[field] == null ? ' field_' + field:'is-invalid ' + field, "form-control"]),
2464
- "onUpdate:modelValue": $event => ((_ctx.form_elements[field]) = $event)
2465
- }, [
2466
- (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.selectData[field], (item) => {
2467
- return (openBlock(), createElementBlock("option", {
2468
- key: item.id,
2469
- value: item.id
2470
- }, toDisplayString(item.name), 9 /* TEXT, PROPS */, _hoisted_17$2))
2471
- }), 128 /* KEYED_FRAGMENT */))
2472
- ], 42 /* CLASS, PROPS, HYDRATE_EVENTS */, _hoisted_16$2)), [
2473
- [vModelSelect, _ctx.form_elements[field]]
2474
- ])
2475
- : createCommentVNode("v-if", true),
2476
- (_ctx.form_errors[field] != null )
2477
- ? (openBlock(), createElementBlock("div", _hoisted_18$2, toDisplayString(_ctx.form_errors[field][0]), 1 /* TEXT */))
2478
- : createCommentVNode("v-if", true)
2479
- ])
2480
- ], 2 /* CLASS */))
2481
- }), 128 /* KEYED_FRAGMENT */))
2482
- ]),
2483
- ($props.hasTerms)
2484
- ? (openBlock(), createElementBlock("div", _hoisted_19$2, _hoisted_22$2))
2485
- : createCommentVNode("v-if", true),
2486
- (_ctx.form_status == 1)
2487
- ? (openBlock(), createElementBlock("button", {
2488
- key: 2,
2489
- class: normalizeClass(["btn btn-primary", $options.getSubmitBtnClass()]),
2490
- type: "button",
2491
- disabled: ""
2492
- }, [
2493
- _hoisted_23$1,
2494
- createTextVNode(" Processing... ")
2495
- ], 2 /* CLASS */))
2496
- : (openBlock(), createElementBlock("button", {
2497
- key: 3,
2498
- "data-cy": "sh_form_submit",
2499
- class: normalizeClass(["mb-2 form-submit-btn", $options.getSubmitBtnClass()]),
2500
- type: "button",
2501
- onClick: _cache[1] || (_cache[1] = (...args) => ($options.submitForm && $options.submitForm(...args)))
2502
- }, toDisplayString($props.actionLabel ? $props.actionLabel:'Submit'), 3 /* TEXT, CLASS */))
2503
- ], 512 /* NEED_PATCH */))
2293
+ return (openBlock(), createElementBlock(Fragment, null, [
2294
+ _hoisted_1$9,
2295
+ createElementVNode("form", _hoisted_2$9, [
2296
+ createCommentVNode(" <div v-if=\"form_status == 1\" class=\"alert alert-info\">Processing...</div>"),
2297
+ createCommentVNode(" <div v-if=\"form_status == 2\" class=\"alert alert-success\">Success</div>"),
2298
+ (_ctx.form_status == 3)
2299
+ ? (openBlock(), createElementBlock("div", _hoisted_3$9, [
2300
+ _hoisted_4$9,
2301
+ (_ctx.errorText)
2302
+ ? (openBlock(), createElementBlock("span", _hoisted_5$5, toDisplayString(_ctx.errorText), 1 /* TEXT */))
2303
+ : (openBlock(), createElementBlock("span", _hoisted_6$4, "Unexpected Error Occurred")),
2304
+ createCommentVNode(" <button @click=\"hideError\" type=\"button\" class=\"btn-close\" aria-label=\"Close\"></button>")
2305
+ ]))
2306
+ : createCommentVNode("v-if", true),
2307
+ withDirectives(createElementVNode("input", {
2308
+ type: "hidden",
2309
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = $event => ((_ctx.form_elements['id']) = $event))
2310
+ }, null, 512 /* NEED_PATCH */), [
2311
+ [vModelText, _ctx.form_elements['id']]
2312
+ ]),
2313
+ createElementVNode("div", _hoisted_7$3, [
2314
+ (openBlock(true), createElementBlock(Fragment, null, renderList($props.fields, (field) => {
2315
+ return (openBlock(), createElementBlock("div", {
2316
+ class: normalizeClass(["form-group", 'col-md-' + $options.getColumns()]),
2317
+ key: field
2318
+ }, [
2319
+ createElementVNode("label", _hoisted_8$2, toDisplayString($options.getLabel(field)), 1 /* TEXT */),
2320
+ createElementVNode("div", _hoisted_9$3, [
2321
+ ($options.getFieldType(field) === 'component')
2322
+ ? (openBlock(), createBlock(resolveDynamicComponent($props.customComponent[field]), {
2323
+ key: 0,
2324
+ "data-cy": field,
2325
+ placeholder: _ctx.allPlaceHolders[field] ? _ctx.allPlaceHolders[field] : '',
2326
+ name: field,
2327
+ onFocus: $event => ($options.removeErrors(field)),
2328
+ class: normalizeClass([_ctx.form_errors[field] == null ? ' field_' + field:'is-invalid ' + field, "form-control"]),
2329
+ modelValue: _ctx.form_elements[field],
2330
+ "onUpdate:modelValue": $event => ((_ctx.form_elements[field]) = $event)
2331
+ }, null, 40 /* PROPS, HYDRATE_EVENTS */, ["data-cy", "placeholder", "name", "onFocus", "class", "modelValue", "onUpdate:modelValue"]))
2332
+ : createCommentVNode("v-if", true),
2333
+ ($options.getFieldType(field) === 'file')
2334
+ ? (openBlock(), createElementBlock("input", {
2335
+ key: 1,
2336
+ "data-cy": field,
2337
+ placeholder: _ctx.allPlaceHolders[field] ? _ctx.allPlaceHolders[field] : '',
2338
+ name: field,
2339
+ onFocus: $event => ($options.removeErrors(field)),
2340
+ class: normalizeClass([_ctx.form_errors[field] == null ? ' field_' + field:'is-invalid ' + field, "form-control"]),
2341
+ ref_for: true,
2342
+ ref: 'file_'+field,
2343
+ onChange: $event => ($options.handleFileUpload(field)),
2344
+ type: "file"
2345
+ }, null, 42 /* CLASS, PROPS, HYDRATE_EVENTS */, _hoisted_10$2))
2346
+ : createCommentVNode("v-if", true),
2347
+ ($options.getFieldType(field) === 'numeric')
2348
+ ? withDirectives((openBlock(), createElementBlock("input", {
2349
+ key: 2,
2350
+ "data-cy": field,
2351
+ placeholder: _ctx.allPlaceHolders[field] ? _ctx.allPlaceHolders[field] : '',
2352
+ name: field,
2353
+ onFocus: $event => ($options.removeErrors(field)),
2354
+ class: normalizeClass([_ctx.form_errors[field] == null ? ' field_' + field:'is-invalid ' + field, "form-control"]),
2355
+ "onUpdate:modelValue": $event => ((_ctx.form_elements[field]) = $event),
2356
+ type: "number"
2357
+ }, null, 42 /* CLASS, PROPS, HYDRATE_EVENTS */, _hoisted_11$2)), [
2358
+ [vModelText, _ctx.form_elements[field]]
2359
+ ])
2360
+ : createCommentVNode("v-if", true),
2361
+ ($options.getFieldType(field) === 'password')
2362
+ ? withDirectives((openBlock(), createElementBlock("input", {
2363
+ key: 3,
2364
+ "data-cy": field,
2365
+ placeholder: _ctx.allPlaceHolders[field] ? _ctx.allPlaceHolders[field] : '',
2366
+ name: field,
2367
+ onFocus: $event => ($options.removeErrors(field)),
2368
+ class: normalizeClass([_ctx.form_errors[field] == null ? ' field_' + field:'is-invalid ' + field, "form-control"]),
2369
+ "onUpdate:modelValue": $event => ((_ctx.form_elements[field]) = $event),
2370
+ type: "password"
2371
+ }, null, 42 /* CLASS, PROPS, HYDRATE_EVENTS */, _hoisted_12$2)), [
2372
+ [vModelText, _ctx.form_elements[field]]
2373
+ ])
2374
+ : createCommentVNode("v-if", true),
2375
+ ($options.getFieldType(field) === 'email')
2376
+ ? withDirectives((openBlock(), createElementBlock("input", {
2377
+ key: 4,
2378
+ "data-cy": field,
2379
+ placeholder: _ctx.allPlaceHolders[field] ? _ctx.allPlaceHolders[field] : '',
2380
+ name: field,
2381
+ onFocus: $event => ($options.removeErrors(field)),
2382
+ class: normalizeClass([_ctx.form_errors[field] == null ? ' field_' + field:'is-invalid ' + field, "form-control"]),
2383
+ "onUpdate:modelValue": $event => ((_ctx.form_elements[field]) = $event),
2384
+ type: "email",
2385
+ required: ""
2386
+ }, null, 42 /* CLASS, PROPS, HYDRATE_EVENTS */, _hoisted_13$2)), [
2387
+ [vModelText, _ctx.form_elements[field]]
2388
+ ])
2389
+ : createCommentVNode("v-if", true),
2390
+ ($options.getFieldType(field) === 'datepicker' && $options.isDisabled(field) === false)
2391
+ ? withDirectives((openBlock(), createElementBlock("input", {
2392
+ key: 5,
2393
+ "data-cy": field,
2394
+ type: "datetime-local",
2395
+ name: field,
2396
+ onFocus: $event => ($options.removeErrors(field)),
2397
+ class: normalizeClass([_ctx.form_errors[field] == null ? ' field_' + field:'is-invalid ' + field, "form-control active"]),
2398
+ "onUpdate:modelValue": $event => ((_ctx.form_elements[field]) = $event)
2399
+ }, null, 42 /* CLASS, PROPS, HYDRATE_EVENTS */, _hoisted_14$2)), [
2400
+ [vModelText, _ctx.form_elements[field]]
2401
+ ])
2402
+ : createCommentVNode("v-if", true),
2403
+ ($options.getFieldType(field) === 'phone')
2404
+ ? (openBlock(), createBlock(_component_ShPhone, {
2405
+ key: 6,
2406
+ country_code: $props.country_code,
2407
+ placeholder: _ctx.allPlaceHolders[field] ? _ctx.allPlaceHolders[field] : '',
2408
+ name: field,
2409
+ onFocus: $event => ($options.removeErrors(field)),
2410
+ class: normalizeClass([_ctx.form_errors[field] == null ? ' field_' + field:'is-invalid ' + field, "form-control"]),
2411
+ modelValue: _ctx.form_elements[field],
2412
+ "onUpdate:modelValue": $event => ((_ctx.form_elements[field]) = $event),
2413
+ required: ""
2414
+ }, null, 8 /* PROPS */, ["country_code", "placeholder", "name", "onFocus", "class", "modelValue", "onUpdate:modelValue"]))
2415
+ : createCommentVNode("v-if", true),
2416
+ ($options.getFieldType(field) === 'suggest')
2417
+ ? (openBlock(), createBlock(_component_ShSuggest, {
2418
+ key: 7,
2419
+ "select-data": _ctx.selectData[field],
2420
+ "fill-selects": $props.fillSelects[field],
2421
+ class: normalizeClass(_ctx.form_errors[field] == null ? ' field_' + field:'is-invalid ' + field),
2422
+ modelValue: _ctx.form_elements[field],
2423
+ "onUpdate:modelValue": $event => ((_ctx.form_elements[field]) = $event)
2424
+ }, null, 8 /* PROPS */, ["select-data", "fill-selects", "class", "modelValue", "onUpdate:modelValue"]))
2425
+ : createCommentVNode("v-if", true),
2426
+ ($options.getFieldType(field) === 'editor')
2427
+ ? (openBlock(), createBlock(_component_ShEditor, {
2428
+ key: 8,
2429
+ placeholder: _ctx.allPlaceHolders[field] ? _ctx.allPlaceHolders[field] : '',
2430
+ name: field,
2431
+ onFocus: $event => ($options.removeErrors(field)),
2432
+ class: normalizeClass([_ctx.form_errors[field] == null ? ' field_' + field:'is-invalid ' + field, "form-control"]),
2433
+ modelValue: _ctx.form_elements[field],
2434
+ "onUpdate:modelValue": $event => ((_ctx.form_elements[field]) = $event)
2435
+ }, null, 8 /* PROPS */, ["placeholder", "name", "onFocus", "class", "modelValue", "onUpdate:modelValue"]))
2436
+ : createCommentVNode("v-if", true),
2437
+ ($options.getFieldType(field) === 'text')
2438
+ ? withDirectives((openBlock(), createElementBlock("input", {
2439
+ key: 9,
2440
+ disabled: $options.isDisabled(field),
2441
+ placeholder: field === 'phone_number' ? 'e.g 0712 345 678':'',
2442
+ name: field,
2443
+ onFocus: $event => ($options.removeErrors(field)),
2444
+ class: normalizeClass([_ctx.form_errors[field] == null ? ' field_' + field:'is-invalid ' + field, "form-control"]),
2445
+ "onUpdate:modelValue": $event => ((_ctx.form_elements[field]) = $event),
2446
+ type: "text"
2447
+ }, null, 42 /* CLASS, PROPS, HYDRATE_EVENTS */, _hoisted_15$2)), [
2448
+ [vModelText, _ctx.form_elements[field]]
2449
+ ])
2450
+ : createCommentVNode("v-if", true),
2451
+ ($options.getFieldType(field) === 'textarea')
2452
+ ? withDirectives((openBlock(), createElementBlock("textarea", {
2453
+ key: 10,
2454
+ name: field,
2455
+ onFocus: $event => ($options.removeErrors(field)),
2456
+ class: normalizeClass([_ctx.form_errors[field] == null ? ' field_' + field:'is-invalid ' + field, "form-control"]),
2457
+ "onUpdate:modelValue": $event => ((_ctx.form_elements[field]) = $event)
2458
+ }, null, 42 /* CLASS, PROPS, HYDRATE_EVENTS */, _hoisted_16$2)), [
2459
+ [vModelText, _ctx.form_elements[field]]
2460
+ ])
2461
+ : createCommentVNode("v-if", true),
2462
+ ($options.getFieldType(field) === 'select' && _ctx.selectData[field] != null)
2463
+ ? withDirectives((openBlock(), createElementBlock("select", {
2464
+ key: 11,
2465
+ name: field,
2466
+ onFocus: $event => ($options.removeErrors(field)),
2467
+ class: normalizeClass([_ctx.form_errors[field] == null ? ' field_' + field:'is-invalid ' + field, "form-control"]),
2468
+ "onUpdate:modelValue": $event => ((_ctx.form_elements[field]) = $event)
2469
+ }, [
2470
+ (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.selectData[field], (item) => {
2471
+ return (openBlock(), createElementBlock("option", {
2472
+ key: item.id,
2473
+ value: item.id
2474
+ }, toDisplayString(item.name), 9 /* TEXT, PROPS */, _hoisted_18$2))
2475
+ }), 128 /* KEYED_FRAGMENT */))
2476
+ ], 42 /* CLASS, PROPS, HYDRATE_EVENTS */, _hoisted_17$2)), [
2477
+ [vModelSelect, _ctx.form_elements[field]]
2478
+ ])
2479
+ : createCommentVNode("v-if", true),
2480
+ (_ctx.form_errors[field] != null )
2481
+ ? (openBlock(), createElementBlock("div", _hoisted_19$2, toDisplayString(_ctx.form_errors[field][0]), 1 /* TEXT */))
2482
+ : createCommentVNode("v-if", true)
2483
+ ])
2484
+ ], 2 /* CLASS */))
2485
+ }), 128 /* KEYED_FRAGMENT */))
2486
+ ]),
2487
+ ($props.hasTerms)
2488
+ ? (openBlock(), createElementBlock("div", _hoisted_20$2, _hoisted_23$1))
2489
+ : createCommentVNode("v-if", true),
2490
+ (_ctx.form_status == 1)
2491
+ ? (openBlock(), createElementBlock("button", {
2492
+ key: 2,
2493
+ class: normalizeClass(["btn btn-primary", $options.getSubmitBtnClass()]),
2494
+ type: "button",
2495
+ disabled: ""
2496
+ }, [
2497
+ _hoisted_24$1,
2498
+ createTextVNode(" Processing... ")
2499
+ ], 2 /* CLASS */))
2500
+ : (openBlock(), createElementBlock("button", {
2501
+ key: 3,
2502
+ "data-cy": "sh_form_submit",
2503
+ class: normalizeClass(["mb-2 form-submit-btn", $options.getSubmitBtnClass()]),
2504
+ type: "button",
2505
+ onClick: _cache[1] || (_cache[1] = (...args) => ($options.submitForm && $options.submitForm(...args)))
2506
+ }, toDisplayString($props.actionLabel ? $props.actionLabel:'Submit'), 3 /* TEXT, CLASS */))
2507
+ ], 512 /* NEED_PATCH */)
2508
+ ], 64 /* STABLE_FRAGMENT */))
2504
2509
  }
2505
2510
 
2506
2511
  script$9.render = render$5;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@iankibetsh/shframework",
3
- "version": "0.7.9",
3
+ "version": "0.8.2",
4
4
  "description": "Vue library for handling laravel backend",
5
5
  "main": "dist/library.js",
6
6
  "module": "dist/library.mjs",