generathor-laravel 1.0.0

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.
Files changed (92) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +419 -0
  3. package/dist/configuration.d.ts +25 -0
  4. package/dist/configuration.js +43 -0
  5. package/dist/helpers/handlebars.d.ts +3 -0
  6. package/dist/helpers/handlebars.js +20 -0
  7. package/dist/helpers/naming.d.ts +18 -0
  8. package/dist/helpers/naming.js +98 -0
  9. package/dist/helpers/string.d.ts +27 -0
  10. package/dist/helpers/string.js +120 -0
  11. package/dist/helpers/type.d.ts +4 -0
  12. package/dist/helpers/type.js +41 -0
  13. package/dist/index.d.ts +2 -0
  14. package/dist/index.js +18 -0
  15. package/dist/template.d.ts +20 -0
  16. package/dist/template.js +284 -0
  17. package/dist/transformers/collection/attachForm.d.ts +4 -0
  18. package/dist/transformers/collection/attachForm.js +55 -0
  19. package/dist/transformers/collection/attachRequest.d.ts +5 -0
  20. package/dist/transformers/collection/attachRequest.js +92 -0
  21. package/dist/transformers/collection/base.d.ts +20 -0
  22. package/dist/transformers/collection/base.js +54 -0
  23. package/dist/transformers/collection/baseController.d.ts +4 -0
  24. package/dist/transformers/collection/baseController.js +14 -0
  25. package/dist/transformers/collection/belongsToRelation.d.ts +5 -0
  26. package/dist/transformers/collection/belongsToRelation.js +86 -0
  27. package/dist/transformers/collection/controller.d.ts +8 -0
  28. package/dist/transformers/collection/controller.js +163 -0
  29. package/dist/transformers/collection/createRelationForm.d.ts +4 -0
  30. package/dist/transformers/collection/createRelationForm.js +163 -0
  31. package/dist/transformers/collection/filterRelationForm.d.ts +4 -0
  32. package/dist/transformers/collection/filterRelationForm.js +164 -0
  33. package/dist/transformers/collection/hasManyRelation.d.ts +5 -0
  34. package/dist/transformers/collection/hasManyRelation.js +91 -0
  35. package/dist/transformers/collection/menu.d.ts +4 -0
  36. package/dist/transformers/collection/menu.js +25 -0
  37. package/dist/transformers/collection/route.d.ts +5 -0
  38. package/dist/transformers/collection/route.js +123 -0
  39. package/dist/transformers/item/base.d.ts +19 -0
  40. package/dist/transformers/item/base.js +33 -0
  41. package/dist/transformers/item/edit.d.ts +4 -0
  42. package/dist/transformers/item/edit.js +21 -0
  43. package/dist/transformers/item/eloquent.d.ts +4 -0
  44. package/dist/transformers/item/eloquent.js +158 -0
  45. package/dist/transformers/item/filter.d.ts +5 -0
  46. package/dist/transformers/item/filter.js +41 -0
  47. package/dist/transformers/item/forms.d.ts +4 -0
  48. package/dist/transformers/item/forms.js +226 -0
  49. package/dist/transformers/item/laravel.d.ts +15 -0
  50. package/dist/transformers/item/laravel.js +36 -0
  51. package/dist/transformers/item/list.d.ts +4 -0
  52. package/dist/transformers/item/list.js +36 -0
  53. package/dist/transformers/item/requests.d.ts +4 -0
  54. package/dist/transformers/item/requests.js +125 -0
  55. package/dist/transformers/item/show.d.ts +5 -0
  56. package/dist/transformers/item/show.js +54 -0
  57. package/package.json +46 -0
  58. package/templates/eloquent/child.handlebars +13 -0
  59. package/templates/eloquent/filter.handlebars +88 -0
  60. package/templates/eloquent/parent.handlebars +64 -0
  61. package/templates/others/base-controller.handlebars +46 -0
  62. package/templates/others/controller.handlebars +185 -0
  63. package/templates/others/pk-trait.handlebars +157 -0
  64. package/templates/others/request.handlebars +32 -0
  65. package/templates/others/routes.handlebars +16 -0
  66. package/templates/views/breadcrumbs.handlebars +21 -0
  67. package/templates/views/edit.handlebars +41 -0
  68. package/templates/views/form.handlebars +103 -0
  69. package/templates/views/icons/check-circle.handlebars +3 -0
  70. package/templates/views/icons/chevron-down.handlebars +3 -0
  71. package/templates/views/icons/chevron-right.handlebars +3 -0
  72. package/templates/views/icons/computer.handlebars +3 -0
  73. package/templates/views/icons/eye.handlebars +4 -0
  74. package/templates/views/icons/funnel.handlebars +3 -0
  75. package/templates/views/icons/home.handlebars +3 -0
  76. package/templates/views/icons/link.handlebars +3 -0
  77. package/templates/views/icons/list-bullet.handlebars +3 -0
  78. package/templates/views/icons/pencil.handlebars +3 -0
  79. package/templates/views/icons/plus.handlebars +3 -0
  80. package/templates/views/icons/trash.handlebars +3 -0
  81. package/templates/views/icons/unlink.handlebars +3 -0
  82. package/templates/views/icons/x-circle.handlebars +3 -0
  83. package/templates/views/icons/x.handlebars +3 -0
  84. package/templates/views/index.handlebars +181 -0
  85. package/templates/views/loader.handlebars +6 -0
  86. package/templates/views/menu.handlebars +39 -0
  87. package/templates/views/modal.handlebars +36 -0
  88. package/templates/views/record-input.handlebars +90 -0
  89. package/templates/views/relation-item.handlebars +180 -0
  90. package/templates/views/relation-list.handlebars +199 -0
  91. package/templates/views/show.handlebars +134 -0
  92. package/templates/views/tabs.handlebars +16 -0
@@ -0,0 +1,103 @@
1
+ <form x-data="{
2
+ form: $form('{{method}}', '{{#if route}}\{{route('{{route}}'{{#if routeRecord}}, ['{{routeRecord}}' => ${{routeRecord}}->getRouteKey()]{{/if}})}}{{/if}}', {{concat '' '{'}}{{#each inputs}}
3
+ {{name}}: {{#if (eq type "checkbox")}}\{{ {{../getOld}}('{{name}}'{{#if ../record}}, ${{../record}}->{{name}}{{/if}}) == '1' ? 'true' : 'false' }}{{else}}'\{{ {{../getOld}}('{{name}}'{{#if ../record}}, ${{../record}}->{{name}}{{/if}}) }}'{{/if}},{{/each}}
4
+ }).setErrors(\{{ Js::from($errors->{{errorBag}}->messages()) }}),
5
+ }">
6
+ {{#if (not (eq method "get"))}} @csrf
7
+ {{/if}}{{#if (eq method "put")}} @method('PUT')
8
+ {{/if}}{{#each hiddenInputs}}{{#if (eq type "current_url")}} <input type="hidden" name="{{name}}" value="\{{ request()->fullUrl() }}" />
9
+ {{else if (eq type "query")}} <input type="hidden" name="{{name}}" value="\{{ request()->query('{{name}}') }}" />
10
+ {{else if (eq type "fixed")}} <input type="hidden" name="{{name}}" value="\{{ {{{data.value}}} }}" />
11
+ {{/if}}{{/each}} <div class="grid grid-cols-1 gap-4 sm:grid-cols-{{columns}}">{{#each inputs}}
12
+ <div>
13
+ {{#if (eq type "number")}}<label for="{{../prefix}}{{name}}" class="block mb-2 text-sm font-medium text-gray-900 dark:text-white">\{{ __('{{label}}') }}</label>
14
+ <input
15
+ type="text"
16
+ name="{{name}}"
17
+ id="{{../prefix}}{{name}}"
18
+ x-model="form.{{name}}"
19
+ x-mask:dynamic="$money($input, '.', '', {{data.decimals}})"
20
+ @change="form.validate('{{name}}')"
21
+ class="bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"
22
+ />{{else if (eq type "checkbox")}}<div class="flex items-center h-full">
23
+ <input
24
+ id="{{../prefix}}{{name}}"
25
+ name="{{name}}"
26
+ type="checkbox"
27
+ x-model="form.{{name}}"
28
+ @change="form.validate('{{name}}')"
29
+ value="1"
30
+ class="w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 rounded focus:ring-blue-500 dark:focus:ring-blue-600 dark:ring-offset-gray-800 focus:ring-2 dark:bg-gray-700 dark:border-gray-600"
31
+ />
32
+ <label for="{{../prefix}}{{name}}" class="ml-2 text-sm font-medium text-gray-900 dark:text-white">\{{ __('{{label}}') }}</label>
33
+ </div>{{else if (eq type "select")}}<label for="{{../prefix}}{{name}}" class="block mb-2 text-sm font-medium text-gray-900 dark:text-white">\{{ __('{{label}}') }}</label>
34
+ <select
35
+ id="{{../prefix}}{{name}}"
36
+ name="{{name}}"
37
+ x-model="form.{{name}}"
38
+ @change="form.validate('{{name}}')"
39
+ class="bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"
40
+ >{{#each data.options}}
41
+ <option value="{{value}}">\{{ __('{{label}}') }}</option>{{/each}}
42
+ </select>{{else if (eq type "record")}}<label for="{{../prefix}}{{name}}" class="block mb-2 text-sm font-medium text-gray-900 dark:text-white">\{{ __('{{label}}') }}</label>
43
+ <x-generathor.record-input
44
+ name="{{name}}"
45
+ id="{{../prefix}}{{name}}"
46
+ x-model="form.{{name}}"
47
+ term="\{{ {{../getOld}}('{{name}}_term', {{#if ../record}}${{../record}}->{{data.relationName}} ? ${{../record}}->{{data.relationName}}->getRecordLabel() : ''{{else}}''{{/if}}) }}"
48
+ @change="form.validate('{{name}}')"
49
+ url="\{{url()->route('generathor.{{data.context}}.search')}}"
50
+ class="bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"
51
+ />{{else if (eq type "datetime")}}<label for="{{../prefix}}{{name}}" class="block mb-2 text-sm font-medium text-gray-900 dark:text-white">\{{ __('{{label}}') }}</label>
52
+ <input
53
+ name="{{name}}"
54
+ id="{{../prefix}}{{name}}"
55
+ x-model="form.{{name}}"
56
+ @change="form.validate('{{name}}')"
57
+ class="input-datetime bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"
58
+ />{{else if (eq type "date")}}<label for="{{../prefix}}{{name}}" class="block mb-2 text-sm font-medium text-gray-900 dark:text-white">\{{ __('{{label}}') }}</label>
59
+ <input
60
+ name="{{name}}"
61
+ id="{{../prefix}}{{name}}"
62
+ x-model="form.{{name}}"
63
+ @change="form.validate('{{name}}')"
64
+ class="input-date bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"
65
+ />{{else if (eq type "time")}}<label for="{{../prefix}}{{name}}" class="block mb-2 text-sm font-medium text-gray-900 dark:text-white">\{{ __('{{label}}') }}</label>
66
+ <input
67
+ name="{{name}}"
68
+ id="{{../prefix}}{{name}}"
69
+ x-model="form.{{name}}"
70
+ @change="form.validate('{{name}}')"
71
+ class="input-time bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"
72
+ />{{else}}<label for="{{../prefix}}{{name}}" class="block mb-2 text-sm font-medium text-gray-900 dark:text-white">\{{ __('{{label}}') }}</label>
73
+ <input
74
+ type="text"
75
+ name="{{name}}"
76
+ id="{{../prefix}}{{name}}"
77
+ x-model="form.{{name}}"
78
+ @change="form.validate('{{name}}')"
79
+ class="bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"
80
+ />{{/if}}
81
+ <template x-if="form.invalid('{{name}}')">
82
+ <p class="mt-2 text-sm text-red-600 dark:text-red-500" x-text="form.errors.{{name}}"></p>
83
+ </template>
84
+ </div>{{/each}}
85
+ <div class="col-span-1 col-start-1 w-full sm:col-span-{{columns}}{{#if cancelLink}} space-y-2{{/if}}">
86
+ <button
87
+ class="w-full focus:outline-none text-white bg-{{buttonColor}}-700 hover:bg-{{buttonColor}}-800 focus:ring-4 focus:ring-{{buttonColor}}-300 font-medium rounded-lg text-sm px-5 py-2.5 dark:bg-{{buttonColor}}-600 dark:hover:bg-{{buttonColor}}-700 dark:focus:ring-{{buttonColor}}-800"
88
+ :class="{
89
+ 'cursor-not-allowed': form.hasErrors
90
+ }"
91
+ x-bind:disabled="form.hasErrors"
92
+ >
93
+ \{{ __('{{buttonLabel}}') }}
94
+ </button>{{#if cancelLink}}
95
+ <a href="\{{ {{{ cancelLink.route }}} }}" class="flex items-center justify-center space-x-1 rounded-lg border border-gray-300 bg-white px-5 py-2.5 text-sm font-medium text-gray-900 hover:bg-gray-100 focus:outline-none focus:ring-4 focus:ring-gray-100 dark:border-gray-600 dark:bg-gray-800 dark:text-white dark:hover:border-gray-600 dark:hover:bg-gray-700 dark:focus:ring-gray-700">
96
+ {{#if cancelLink.icon}}
97
+ {{{ cancelLink.icon }}}
98
+ {{/if}}
99
+ <span>\{{ __('{{ cancelLink.label }}') }}</span>
100
+ </a>{{/if}}
101
+ </div>
102
+ </div>
103
+ </form>
@@ -0,0 +1,3 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" {!! $attributes->merge(['class' => 'w-6 h-6 text-green-400']) !!}>
2
+ <path stroke-linecap="round" stroke-linejoin="round" d="M9 12.75L11.25 15 15 9.75M21 12a9 9 0 11-18 0 9 9 0 0118 0z" />
3
+ </svg>
@@ -0,0 +1,3 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" {!! $attributes->merge(['class' => 'h-4 w-4']) !!}>
2
+ <path stroke-linecap="round" stroke-linejoin="round" d="m19.5 8.25-7.5 7.5-7.5-7.5" />
3
+ </svg>
@@ -0,0 +1,3 @@
1
+ <svg aria-hidden="true" {!! $attributes->merge(['class' => 'w-6 h-6 text-gray-400']) !!} fill="currentColor" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg">
2
+ <path fill-rule="evenodd" d="M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z" clip-rule="evenodd"></path>
3
+ </svg>
@@ -0,0 +1,3 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" {!! $attributes->merge(['class' => 'w-4 h-4']) !!} fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor">
2
+ <path stroke-linecap="round" stroke-linejoin="round" d="M9 17.25v1.007a3 3 0 01-.879 2.122L7.5 21h9l-.621-.621A3 3 0 0115 18.257V17.25m6-12V15a2.25 2.25 0 01-2.25 2.25H5.25A2.25 2.25 0 013 15V5.25m18 0A2.25 2.25 0 0018.75 3H5.25A2.25 2.25 0 003 5.25m18 0V12a2.25 2.25 0 01-2.25 2.25H5.25A2.25 2.25 0 013 12V5.25" />
3
+ </svg>
@@ -0,0 +1,4 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" {!! $attributes->merge(['class' => 'w-6 h-6']) !!}>
2
+ <path stroke-linecap="round" stroke-linejoin="round" d="M2.036 12.322a1.012 1.012 0 010-.639C3.423 7.51 7.36 4.5 12 4.5c4.638 0 8.573 3.007 9.963 7.178.07.207.07.431 0 .639C20.577 16.49 16.64 19.5 12 19.5c-4.638 0-8.573-3.007-9.963-7.178z" />
3
+ <path stroke-linecap="round" stroke-linejoin="round" d="M15 12a3 3 0 11-6 0 3 3 0 016 0z" />
4
+ </svg>
@@ -0,0 +1,3 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" {!! $attributes->merge(['class' => 'h-4 w-4']) !!}>
2
+ <path stroke-linecap="round" stroke-linejoin="round" d="M12 3c2.755 0 5.455.232 8.083.678.533.09.917.556.917 1.096v1.044a2.25 2.25 0 0 1-.659 1.591l-5.432 5.432a2.25 2.25 0 0 0-.659 1.591v2.927a2.25 2.25 0 0 1-1.244 2.013L9.75 21v-6.568a2.25 2.25 0 0 0-.659-1.591L3.659 7.409A2.25 2.25 0 0 1 3 5.818V4.774c0-.54.384-1.006.917-1.096A48.32 48.32 0 0 1 12 3Z" />
3
+ </svg>
@@ -0,0 +1,3 @@
1
+ <svg aria-hidden="true" {!! $attributes->merge(['class' => 'w-4 h-4']) !!} fill="currentColor" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M10.707 2.293a1 1 0 00-1.414 0l-7 7a1 1 0 001.414 1.414L4 10.414V17a1 1 0 001 1h2a1 1 0 001-1v-2a1 1 0 011-1h2a1 1 0 011 1v2a1 1 0 001 1h2a1 1 0 001-1v-6.586l.293.293a1 1 0 001.414-1.414l-7-7z"></path>
3
+ </svg>
@@ -0,0 +1,3 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" {!! $attributes->merge(['class' => 'w-4 h-4']) !!}>
2
+ <path stroke-linecap="round" stroke-linejoin="round" d="M13.19 8.688a4.5 4.5 0 0 1 1.242 7.244l-4.5 4.5a4.5 4.5 0 0 1-6.364-6.364l1.757-1.757m13.35-.622 1.757-1.757a4.5 4.5 0 0 0-6.364-6.364l-4.5 4.5a4.5 4.5 0 0 0 1.242 7.244" />
3
+ </svg>
@@ -0,0 +1,3 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" {!! $attributes->merge(['class' => 'w-4 h-4']) !!}>
2
+ <path stroke-linecap="round" stroke-linejoin="round" d="M8.25 6.75h12M8.25 12h12m-12 5.25h12M3.75 6.75h.007v.008H3.75V6.75Zm.375 0a.375.375 0 1 1-.75 0 .375.375 0 0 1 .75 0ZM3.75 12h.007v.008H3.75V12Zm.375 0a.375.375 0 1 1-.75 0 .375.375 0 0 1 .75 0Zm-.375 5.25h.007v.008H3.75v-.008Zm.375 0a.375.375 0 1 1-.75 0 .375.375 0 0 1 .75 0Z" />
3
+ </svg>
@@ -0,0 +1,3 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" {!! $attributes->merge(['class' => 'w-6 h-6']) !!}>
2
+ <path stroke-linecap="round" stroke-linejoin="round" d="M16.862 4.487l1.687-1.688a1.875 1.875 0 112.652 2.652L6.832 19.82a4.5 4.5 0 01-1.897 1.13l-2.685.8.8-2.685a4.5 4.5 0 011.13-1.897L16.863 4.487zm0 0L19.5 7.125" />
3
+ </svg>
@@ -0,0 +1,3 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" {!! $attributes->merge(['class' => 'w-4 h-4']) !!} fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor">
2
+ <path stroke-linecap="round" stroke-linejoin="round" d="M12 4.5v15m7.5-7.5h-15" />
3
+ </svg>
@@ -0,0 +1,3 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" {!! $attributes->merge(['class' => 'w-6 h-6']) !!}>
2
+ <path stroke-linecap="round" stroke-linejoin="round" d="M14.74 9l-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 01-2.244 2.077H8.084a2.25 2.25 0 01-2.244-2.077L4.772 5.79m14.456 0a48.108 48.108 0 00-3.478-.397m-12 .562c.34-.059.68-.114 1.022-.165m0 0a48.11 48.11 0 013.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a51.964 51.964 0 00-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a48.667 48.667 0 00-7.5 0" />
3
+ </svg>
@@ -0,0 +1,3 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" {!! $attributes->merge(['class' => 'w-4 h-4']) !!}>
2
+ <path stroke-linecap="round" stroke-linejoin="round" d="M13.181 8.68a4.503 4.503 0 0 1 1.903 6.405m-9.768-2.782L3.56 14.06a4.5 4.5 0 0 0 6.364 6.365l3.129-3.129m5.614-5.615 1.757-1.757a4.5 4.5 0 0 0-6.364-6.365l-4.5 4.5c-.258.26-.479.541-.661.84m1.903 6.405a4.495 4.495 0 0 1-1.242-.88 4.483 4.483 0 0 1-1.062-1.683m6.587 2.345 5.907 5.907m-5.907-5.907L8.898 8.898M2.991 2.99 8.898 8.9" />
3
+ </svg>
@@ -0,0 +1,3 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" {!! $attributes->merge(['class' => 'w-6 h-6 text-red-400']) !!}>
2
+ <path stroke-linecap="round" stroke-linejoin="round" d="M9.75 9.75l4.5 4.5m0-4.5l-4.5 4.5M21 12a9 9 0 11-18 0 9 9 0 0118 0z" />
3
+ </svg>
@@ -0,0 +1,3 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" {!! $attributes->merge(['class' => 'w-4 h-4']) !!}>
2
+ <path stroke-linecap="round" stroke-linejoin="round" d="M6 18L18 6M6 6l12 12" />
3
+ </svg>
@@ -0,0 +1,181 @@
1
+ <x-{{layout}}>
2
+ <x-slot name="header">
3
+ <h2 class="font-semibold text-xl text-gray-800 dark:text-gray-200 leading-tight">
4
+ \{{__('{{header}}')}}
5
+ </h2>
6
+ </x-slot>
7
+ <div class="w-full bg-white dark:bg-gray-800 border-t border-gray-200 dark:border-gray-700">
8
+ <div class="max-w-7xl mx-auto overflow-hidden py-2">
9
+ <x-generathor.breadcrumbs :breadcrumbs="[
10
+ [
11
+ 'label' => __('Home'),
12
+ 'icon' => 'generathor.icon-home',
13
+ 'url' => route('{{homeRoute}}')
14
+ ],
15
+ [
16
+ 'label' => __('Manage'),
17
+ 'icon' => 'generathor.icon-computer',
18
+ 'url' => route('generathor.menu')
19
+ ],
20
+ [
21
+ 'label' => __('{{header}}'),
22
+ ]
23
+ ]" />
24
+ </div>
25
+ </div>
26
+ <div class="max-w-7xl py-12 mx-auto sm:px-6 lg:px-8">
27
+ <div class="bg-white dark:bg-gray-800 shadow-xl sm:rounded-lg">
28
+ <div class="p-6 lg:p-8 bg-white dark:bg-gray-800 dark:bg-gradient-to-bl dark:from-gray-700/50 dark:via-transparent border-b border-gray-200 dark:border-gray-700">
29
+ <div class="w-full flex justify-end">
30
+ <x-generathor.modal :opened="$errors->create->any()">
31
+ <x-slot name="trigger">
32
+ <div class="relative">
33
+ <button type="button" class="focus:outline-none text-white bg-green-700 hover:bg-green-800 focus:ring-4 focus:ring-green-300 font-medium rounded-lg text-sm p-2.5 dark:bg-green-600 dark:hover:bg-green-700 dark:focus:ring-green-800 peer">
34
+ <x-generathor.icon-plus />
35
+ </button>
36
+ <div class="absolute -top-9 left-1/2 -translate-x-1/2 z-10 opacity-0 transition-all ease-out peer-hover:opacity-100 px-3 py-2 text-xs font-medium text-white bg-gray-900 rounded-lg shadow-sm">\{{ __('New') }}</div>
37
+ </div>
38
+ </x-slot>
39
+ <div class="mb-4 text-center">
40
+ <span class="text-xl text-gray-900 dark:text-white">\{{ __('Create') }}</span>
41
+ </div>
42
+ <x-generathor.{{context}}.create-form />
43
+ </x-generathor.modal>
44
+ </div>
45
+ <div class="mt-4 shadow-md" x-data="{ expanded: \{{ $errors->filter->any() ? 'true' : 'false' }} }">
46
+ <button type="button" class="w-full bg-gray-50 px-6 py-3 text-left text-sm text-gray-700 dark:bg-gray-700 dark:text-gray-400" @click="expanded = !expanded">
47
+ <div class="flex items-center justify-between">
48
+ <div class="flex items-center gap-2">
49
+ <x-generathor.icon-funnel />
50
+ <span>\{{__('Filter')}}</span>
51
+ </div>
52
+ <x-generathor.icon-chevron-down />
53
+ </div>
54
+ </button>
55
+ <div x-cloak x-show="expanded" class="border border-gray-50 dark:border-gray-700" x-collapse>
56
+ <div class="p-4">
57
+ <x-generathor.{{context}}.filter-form />
58
+ </div>
59
+ </div>
60
+ </div>
61
+ <div class="overflow-x-auto shadow-md my-4 relative">
62
+ <table class="w-full text-sm text-left text-gray-500 dark:text-gray-400">
63
+ <thead class="text-xs text-gray-700 uppercase bg-gray-50 dark:bg-gray-700 dark:text-gray-400">
64
+ <tr>
65
+ {{#each columns}}
66
+ <th scope="col" class="px-6 py-3">
67
+ <div class="flex items-center space-x-1">
68
+ @sortablelink('{{name}}', __('{{label}}'))
69
+ </div>
70
+ </th>
71
+ {{/each}}
72
+ <th scope="col" class="px-6 py-3">
73
+ <div>
74
+ \{{ __('Actions') }}
75
+ </div>
76
+ </th>
77
+ </tr>
78
+ </thead>
79
+ <tbody>
80
+ @forelse($list->items() as $item)
81
+ <tr class="bg-white border-b dark:bg-gray-800 dark:border-gray-700 hover:bg-gray-50 dark:hover:bg-gray-600">
82
+ {{#each columns}}
83
+ <td class="px-6 py-4">
84
+ {{#if (eq type "bool")}}
85
+ {{#if nullable}}
86
+ @if(!isset($item->{{name}}))
87
+ <span class="text-red-400">\{{__('Not defined')}}</span>
88
+ @elseif($item->{{name}})
89
+ <x-generathor.icon-check-circle />
90
+ @else
91
+ <x-generathor.icon-x-circle />
92
+ @endif
93
+ {{else}}
94
+ @if($item->{{name}})
95
+ <x-generathor.icon-check-circle />
96
+ @else
97
+ <x-generathor.icon-x-circle />
98
+ @endif
99
+ {{/if}}
100
+ {{else if (eq type "record")}}
101
+ {{#if nullable}}
102
+ @if(isset($item->{{name}}))
103
+ <a href="\{{route('generathor.{{data.context}}.show' , ['{{data.routeRecordName}}' => $item->{{data.relationAttribute}}->getRouteKey()])}}" class="font-medium text-blue-600 dark:text-blue-500 hover:underline">\{{ $item->{{data.relationAttribute}}->getRouteKey() }} - \{{ $item->{{data.relationAttribute}}->getRecordLabel() }}</a>
104
+ @else
105
+ <span class="text-red-400">\{{__('Not defined')}}</span>
106
+ @endif
107
+ {{else}}
108
+ <a href="\{{route('generathor.{{data.context}}.show' , ['{{data.routeRecordName}}' => $item->{{data.relationAttribute}}->getRouteKey()])}}" class="font-medium text-blue-600 dark:text-blue-500 hover:underline">\{{ $item->{{data.relationAttribute}}->getRouteKey() }} - \{{ $item->{{data.relationAttribute}}->getRecordLabel() }}</a>
109
+ {{/if}}
110
+ {{else}}
111
+ {{#if nullable}}
112
+ @if(isset($item->{{name}}))
113
+ \{{ $item->{{name}} }}
114
+ @else
115
+ <span class="text-red-400">\{{__('Not defined')}}</span>
116
+ @endif
117
+ {{else}}
118
+ \{{ $item->{{name}} }}
119
+ {{/if}}
120
+ {{/if}}
121
+ </td>
122
+ {{/each}}
123
+ <td class="px-6 py-4">
124
+ <div class="w-full flex">
125
+ <div class="relative">
126
+ <a href="\{{route('generathor.{{context}}.show' , ['{{recordName}}' => $item->getRouteKey()])}}" class="peer">
127
+ <x-generathor.icon-eye />
128
+ </a>
129
+ <div class="absolute -top-9 left-1/2 -translate-x-1/2 z-10 opacity-0 transition-all ease-out peer-hover:opacity-100 px-3 py-2 text-xs font-medium text-white bg-gray-900 rounded-lg shadow-sm">\{{ __('Details') }}</div>
130
+ </div>
131
+ <div class="relative">
132
+ <a href="\{{route('generathor.{{context}}.edit' , ['{{recordName}}' => $item->getRouteKey()])}}" class="peer">
133
+ <x-generathor.icon-pencil />
134
+ </a>
135
+ <div class="absolute -top-9 left-1/2 -translate-x-1/2 z-10 opacity-0 transition-all ease-out peer-hover:opacity-100 px-3 py-2 text-xs font-medium text-white bg-gray-900 rounded-lg shadow-sm">\{{ __('Update') }}</div>
136
+ </div>
137
+ <form method="POST" action="\{{route('generathor.{{context}}.destroy' , ['{{recordName}}' => $item->getRouteKey()])}}" x-data="{
138
+ deleteAlert() {
139
+ return window.Swal.fire({
140
+ title: '\{{ __('Are you sure?') }}',
141
+ text: '\{{ __('You will not be able to revert this!') }}',
142
+ icon: 'warning',
143
+ showCancelButton: true,
144
+ confirmButtonText: '\{{ __('Yes') }}',
145
+ cancelButtonText: '\{{ __('Cancel') }}',
146
+ reverseButtons: true
147
+ });
148
+ },
149
+ deleteRecord: async function() {
150
+ const result = await this.deleteAlert();
151
+ if (result.isConfirmed) {
152
+ $root.submit();
153
+ window.showLoading();
154
+ }
155
+ }
156
+ }">
157
+ @method('DELETE')
158
+ @csrf
159
+ <div class="relative">
160
+ <button type="button" class="peer" @click="deleteRecord()">
161
+ <x-generathor.icon-trash />
162
+ </button>
163
+ <div class="absolute -top-9 left-1/2 -translate-x-1/2 z-10 opacity-0 transition-all ease-out peer-hover:opacity-100 px-3 py-2 text-xs font-medium text-white bg-gray-900 rounded-lg shadow-sm">\{{ __('Delete') }}</div>
164
+ </div>
165
+ </form>
166
+ </div>
167
+ </td>
168
+ </tr>
169
+ @empty
170
+ <tr class="bg-white border-b dark:bg-gray-800 dark:border-gray-700 hover:bg-gray-50 dark:hover:bg-gray-600">
171
+ <td class="px-6 py-4" colspan="100%">\{{ __('There are no records') }}</td>
172
+ </tr>
173
+ @endforelse
174
+ </tbody>
175
+ </table>
176
+ </div>
177
+ \{{ $list->appends(request()->query())->links() }}
178
+ </div>
179
+ </div>
180
+ </div>
181
+ </x-{{layout}}>
@@ -0,0 +1,6 @@
1
+ <div id="generathor-loader" class="fixed top-0 left-0 w-screen h-screen bg-gray-900 bg-opacity-50 hidden items-center justify-center z-50">
2
+ <svg aria-hidden="true" class="inline w-8 h-8 text-gray-200 animate-spin dark:text-gray-600 fill-gray-600 dark:fill-gray-300" viewBox="0 0 100 101" fill="none" xmlns="http://www.w3.org/2000/svg">
3
+ <path d="M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z" fill="currentColor"/>
4
+ <path d="M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z" fill="currentFill"/>
5
+ </svg>
6
+ </div>
@@ -0,0 +1,39 @@
1
+ <x-{{layout}}>
2
+ <x-slot name="header">
3
+ <h2 class="font-semibold text-xl text-gray-800 dark:text-gray-200 leading-tight">
4
+ \{{__('Manage')}}
5
+ </h2>
6
+ </x-slot>
7
+ <div class="w-full bg-white dark:bg-gray-800 border-t border-gray-200 dark:border-gray-700">
8
+ <div class="max-w-7xl mx-auto overflow-hidden py-2">
9
+ <nav class="flex px-4 sm:px-6 lg:px-8" aria-label="Breadcrumb">
10
+ <ol class="inline-flex items-center space-x-1">
11
+ <li class="inline-flex items-center">
12
+ <a href="\{{route('{{homeRoute}}')}}" class="inline-flex items-center text-sm font-medium text-gray-700 hover:text-blue-600 dark:text-gray-400 dark:hover:text-white">
13
+ <svg aria-hidden="true" class="w-4 h-4 mr-2" fill="currentColor" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M10.707 2.293a1 1 0 00-1.414 0l-7 7a1 1 0 001.414 1.414L4 10.414V17a1 1 0 001 1h2a1 1 0 001-1v-2a1 1 0 011-1h2a1 1 0 011 1v2a1 1 0 001 1h2a1 1 0 001-1v-6.586l.293.293a1 1 0 001.414-1.414l-7-7z"></path></svg>
14
+ \{{__('Home')}}
15
+ </a>
16
+ </li>
17
+ <li class="inline-flex items-center">
18
+ <svg aria-hidden="true" class="w-6 h-6 text-gray-400" fill="currentColor" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" d="M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z" clip-rule="evenodd"></path></svg>
19
+ <div class="inline-flex items-center text-sm font-medium text-gray-700 dark:text-gray-400">
20
+ <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-4 h-4 mr-2">
21
+ <path stroke-linecap="round" stroke-linejoin="round" d="M9 17.25v1.007a3 3 0 01-.879 2.122L7.5 21h9l-.621-.621A3 3 0 0115 18.257V17.25m6-12V15a2.25 2.25 0 01-2.25 2.25H5.25A2.25 2.25 0 013 15V5.25m18 0A2.25 2.25 0 0018.75 3H5.25A2.25 2.25 0 003 5.25m18 0V12a2.25 2.25 0 01-2.25 2.25H5.25A2.25 2.25 0 013 12V5.25" />
22
+ </svg>
23
+ \{{__('Manage')}}
24
+ </div>
25
+ </li>
26
+ </ol>
27
+ </nav>
28
+ </div>
29
+ </div>
30
+ <div class="max-w-7xl py-12 mx-auto sm:px-6 lg:px-8">
31
+ <div class="bg-white dark:bg-gray-800 shadow-xl sm:rounded-lg">
32
+ <div class="p-6 lg:p-8 bg-white dark:bg-gray-800 dark:bg-gradient-to-bl dark:from-gray-700/50 dark:via-transparent border-b border-gray-200 dark:border-gray-700">
33
+ <div class="grid grid-cols-2 md:grid-cols-4 gap-4">{{#each items}}
34
+ <a href="\{{route('generathor.{{context}}.index')}}" class="w-full rounded-lg border border-gray-200 bg-white px-5 py-2.5 text-sm font-medium text-gray-900 hover:bg-gray-100 hover:text-blue-700 focus:z-10 focus:outline-none focus:ring-4 focus:ring-gray-200 dark:border-gray-600 dark:bg-gray-800 dark:text-gray-400 dark:hover:bg-gray-700 dark:hover:text-white dark:focus:ring-gray-700">\{{__('{{label}}')}}</a>{{/each}}
35
+ </div>
36
+ </div>
37
+ </div>
38
+ </div>
39
+ </x-{{layout}}>
@@ -0,0 +1,36 @@
1
+ <div
2
+ x-data="{ fullscreenModal: \{{ $opened ? 'true' : 'false' }} }"
3
+ x-init="
4
+ $watch('fullscreenModal', function(value) {
5
+ if (value) {
6
+ document.body.classList.add('overflow-hidden');
7
+ } else {
8
+ document.body.classList.remove('overflow-hidden');
9
+ }
10
+ })
11
+ "
12
+ @keydown.escape="fullscreenModal=false"
13
+ >
14
+ <div @click="fullscreenModal=true">
15
+ \{{ $trigger }}
16
+ </div>
17
+ <div
18
+ x-show="fullscreenModal"
19
+ x-transition:enter="transition ease-out duration-300"
20
+ x-transition:enter-start="translate-y-full"
21
+ x-transition:enter-end="translate-y-0"
22
+ x-transition:leave="transition ease-in duration-300"
23
+ x-transition:leave-start="translate-y-0"
24
+ x-transition:leave-end="translate-y-full"
25
+ class="flex fixed inset-0 z-40 w-screen h-screen bg-white dark:bg-gray-800"
26
+ >
27
+ <button @click="fullscreenModal=false" type="button" class="absolute top-0 right-0 z-30 text-gray-900 bg-white border border-gray-300 focus:outline-none hover:bg-gray-100 focus:ring-4 focus:ring-gray-200 font-medium rounded-lg text-sm mt-6 mr-6 p-2 dark:bg-gray-800 dark:text-white dark:border-gray-600 dark:hover:bg-gray-700 dark:hover:border-gray-600 dark:focus:ring-gray-700">
28
+ <x-generathor.icon-x />
29
+ </button>
30
+ <div class="relative flex flex-wrap items-center w-full h-full overflow-y-auto px-8">
31
+ <div class="relative w-full max-w-4xl mx-auto lg:mb-0">
32
+ \{{ $slot }}
33
+ </div>
34
+ </div>
35
+ </div>
36
+ </div>
@@ -0,0 +1,90 @@
1
+ <div x-data="{
2
+ term: '',
3
+ reference: '',
4
+ loading: false,
5
+ options: [],
6
+ select(index) {
7
+ \{{$attributes->get('x-model')}} = this.options[index].id;
8
+ this.term = this.options[index].label;
9
+ this.options = [];
10
+ },
11
+ reset() {
12
+ \{{$attributes->get('x-model')}} = '';
13
+ this.term = '';
14
+ this.options = [];
15
+ },
16
+ closeOptions() {
17
+ this.options = [];
18
+ },
19
+ init(term) {
20
+ if (term) {
21
+ this.term = term;
22
+ }
23
+ $watch('\{{$attributes->get('x-model')}}', value => \{{$attributes->get('@change')}});
24
+ },
25
+ loadOptions() {
26
+ const reference = this.term + (new Date).getTime();
27
+ this.reference = reference;
28
+ this.loading = true;
29
+ if (!this.term) {
30
+ this.loading = false;
31
+ this.options = [];
32
+ }
33
+ window.axios.get('\{{$attributes->get('url')}}?term=' + this.term)
34
+ .then(response => {
35
+ if (this.reference === reference) {
36
+ this.options = response.data;
37
+ }
38
+
39
+ }).catch(error => {
40
+ if (this.reference === reference) {
41
+ this.options = [];
42
+ }
43
+ }).finally(() => {
44
+ this.loading = false;
45
+ });
46
+ }
47
+ }" x-init="init('\{{ $attributes->get('term', '') }}')" class="relative">
48
+ <input type="hidden" {!! $attributes->only(['name', 'x-model']) !!} />
49
+ <div class="relative flex w-full">
50
+ <span x-cloak x-show="loading" class="inline-flex items-center rounded-l-md border border-r-0 border-gray-300 bg-gray-200 px-3 text-sm text-gray-900 dark:border-gray-600 dark:bg-gray-600 dark:text-gray-400">
51
+ <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="h-4 w-4 animate-spin">
52
+ <path stroke-linecap="round" stroke-linejoin="round" d="M16.023 9.348h4.992v-.001M2.985 19.644v-4.992m0 0h4.992m-4.993 0l3.181 3.183a8.25 8.25 0 0013.803-3.7M4.031 9.865a8.25 8.25 0 0113.803-3.7l3.181 3.182m0-4.991v4.99" />
53
+ </svg>
54
+ </span>
55
+ <span x-cloak x-show="!loading && !\{{$attributes->get('x-model')}}" class="inline-flex items-center rounded-l-md border border-r-0 border-gray-300 bg-gray-200 px-3 text-sm text-gray-900 dark:border-gray-600 dark:bg-gray-600 dark:text-gray-400">
56
+ <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-4 h-4">
57
+ <path stroke-linecap="round" stroke-linejoin="round" d="M21 21l-5.197-5.197m0 0A7.5 7.5 0 105.196 5.196a7.5 7.5 0 0010.607 10.607z" />
58
+ </svg>
59
+ </span>
60
+ <span x-cloak x-show="!loading && \{{$attributes->get('x-model')}}" class="inline-flex items-center rounded-l-md border border-r-0 border-gray-300 bg-gray-200 px-3 text-sm text-gray-900 dark:border-gray-600 dark:bg-gray-600 dark:text-gray-400" x-text="\{{$attributes->get('x-model')}}"></span>
61
+ <input
62
+ {!! $attributes->only(['id']) !!}
63
+ x-model="term"
64
+ name="\{{ $attributes->get('name') . '_term' }}"
65
+ x-on:input.debounce="loadOptions()"
66
+ type="text"
67
+ autocomplete="off"
68
+ class="block w-full min-w-0 flex-1 rounded-none rounded-r-lg border border-gray-300 bg-gray-50 p-2.5 pr-7 text-sm text-gray-900 focus:border-blue-500 focus:ring-blue-500 dark:border-gray-600 dark:bg-gray-700 dark:text-white dark:placeholder-gray-400 dark:focus:border-blue-500 dark:focus:ring-blue-500"
69
+ />
70
+ <button x-show="!loading && \{{$attributes->get('x-model')}}" @click="reset()" type="button" class="absolute inset-y-0 right-0 flex items-center pr-3">
71
+ <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="h-4 w-4 text-gray-500 hover:text-gray-900 dark:text-gray-400 dark:hover:text-white">
72
+ <path stroke-linecap="round" stroke-linejoin="round" d="M6 18L18 6M6 6l12 12" />
73
+ </svg>
74
+ </button>
75
+ </div>
76
+ <template x-if="options.length">
77
+ <div class="absolute z-10 w-full rounded-lg border border-gray-100 bg-white pt-8 text-sm shadow-md dark:border-gray-700 dark:bg-gray-700">
78
+ <button @click="closeOptions()" type="button" class="float-right mr-1 -mt-6">
79
+ <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="h-4 w-4 text-gray-500 hover:text-gray-900 dark:text-gray-400 dark:hover:text-white">
80
+ <path stroke-linecap="round" stroke-linejoin="round" d="M6 18L18 6M6 6l12 12" />
81
+ </svg>
82
+ </button>
83
+ <ul class="w-full rounded-lg bg-white text-sm font-medium text-gray-900 dark:bg-gray-700 dark:text-white">
84
+ <template x-for="(option, index) in options" :key="option.id">
85
+ <li @click="select(index)" class="w-full cursor-pointer border-t border-gray-200 px-4 py-2 dark:border-gray-600" x-text="`${option.label} - (${option.id})`"></li>
86
+ </template>
87
+ </ul>
88
+ </div>
89
+ </template>
90
+ </div>