Skip to content

Commit

Permalink
style issues
Browse files Browse the repository at this point in the history
  • Loading branch information
MuchQuak committed Dec 18, 2024
1 parent 302e3a3 commit 3ca41e5
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 10 deletions.
1 change: 1 addition & 0 deletions app/Http/Controllers/OccurrenceController.php
Original file line number Diff line number Diff line change
Expand Up @@ -442,6 +442,7 @@ public function delete($id, Request $request) {
* operationId="skeletalImport",
* description="If an existing record can be located within target collection based on matching the input identifier, empty (null) target fields will be updated with Skeletal Data.
* tags={""},
*
* @OA\Parameter(
* name="apiToken",
* in="query",
Expand Down
4 changes: 2 additions & 2 deletions app/Providers/AppServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ public function boot(): void {
}

// Helper Macro to Progate Apline binds from parent component to subcomponent within blade. This May be required if you have dynamic names from generated input fields.
Blade::directive('bind', function($expression) {
return '<?php echo $attributes["x-bind:" . "'. $expression.'"] ? \'x-bind:\'. "' . $expression . '" . \'="\' . $attributes["x-bind:" . "'. $expression.'"] . \'"\': "" ?>';
Blade::directive('bind', function ($expression) {
return '<?php echo $attributes["x-bind:" . "' . $expression . '"] ? \'x-bind:\'. "' . $expression . '" . \'="\' . $attributes["x-bind:" . "' . $expression . '"] . \'"\': "" ?>';
});

Event::listen(function (\SocialiteProviders\Manager\SocialiteWasCalled $event) {
Expand Down
5 changes: 2 additions & 3 deletions resources/views/core/pages/collections/table.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ class="float-right mr-2 mt-2 hover:ring-4 focus:outline-none focus:ring-4 rounde
]"/>
--}}
<x-occurrence-attribute-select x-bind:name="'q_customfield' + (index + 1)" class="min-w-72" :select_text="'Select Field Name'" />
<x-select class="min-w-72" x-bind:value="data && data[index]? data[index].type:'EQUALS'" x-on:change='data[index].type = $event.target.type;' x-bind:name="'q_customtype' + (index + 1)" :items="[
<x-select class="min-w-72" defaultValue='d.type' x-on:change='data[index].value = $event.target.value' onChange="console.log($event); data[index].type = $event.target.value" x-bind:name="'q_customtype' + (index + 1)" x-bind:id="'q_customtype' + (index + 1)" :items="[
['title'=> 'EQUALS', 'value' => 'EQUALS', 'disabled' => false ],
['title'=> 'NOT EQUALS', 'value' => 'NOT_EQUALS', 'disabled' => false ],
['title'=> 'STARTS WITH', 'value' => 'STARTS_WITH', 'disabled' => false ],
Expand All @@ -170,7 +170,6 @@ class="float-right mr-2 mt-2 hover:ring-4 focus:outline-none focus:ring-4 rounde
['title'=> 'IS NOT NULL', 'value' => 'NOT_NULL', 'disabled' => false ],
]"/>
<x-input x-bind:name="'q_customvalue' + (index + 1)" x-bind:value="data && data[index]? data[index].value: ''" x-on:change='data[index].value = $event.target.value;'/>

{{--
<x-select x-bind:name="'q_customclosedparen' + (index + 1)" :default="0" :items="[
['title' => '---', 'value' => null, 'disabled' => false],
Expand All @@ -186,7 +185,7 @@ class="float-right mr-2 mt-2 hover:ring-4 focus:outline-none focus:ring-4 rounde
</div>
</div>
</template>
<x-button type="button" @click="if(data.length < 10) data.push([{type: 'EQUALS', field: null, value: ''}])">
<x-button type="button" @click="if(data.length < 10) data.push({type: 'EQUALS', field: null, value: 'sdfsdfs'})">
<i class="fa fa-plus"></i> Add Custom Field
</x-button>
</div>
Expand Down
14 changes: 12 additions & 2 deletions resources/views/core/select.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
'name' => null,
'label' => null,
'default' => null,
'onChange' => null,
'defaultValue' => null,
'id' => uniqid(),
'bind_id' => false,
Expand All @@ -17,7 +18,6 @@
$default = $i;
break;
}
echo $item['value'];
}
}
@endphp
Expand All @@ -31,6 +31,7 @@
selectedItem: {{ ($default !== null && $default >= 0 && $items && $items[$default])? json_encode($items[$default]) : "''"}},
selectableItems: {{ json_encode($items) }},
selectableItemActive: null,
defaultValue: {{ $defaultValue && !$default? $defaultValue: 'null'}},
selectId: $id('select'),
selectKeydownValue: '',
selectKeydownTimeout: 1000,
Expand Down Expand Up @@ -122,6 +123,15 @@
selectPositionUpdate();
window.addEventListener('resize', (event) => { selectPositionUpdate(); });
});
$watch('selectedItem', function() {
if(selectedItem) {
let input = $el.querySelector('input');
input.value = selectedItem.value;
input.dispatchEvent(new Event('change'));
}
});
"
@keydown.escape="if(selectOpen){ selectOpen=false; }"
@keydown.down="if(selectOpen){ selectableItemActiveNext(); } else { selectOpen=true; } event.preventDefault();"
Expand All @@ -139,7 +149,7 @@
<span class="absolute inset-y-0 right-0 flex items-center pr-2 pointer-events-none">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true" class="w-5 h-5 text-base-content/50"><path fill-rule="evenodd" d="M10 3a.75.75 0 01.55.24l3.25 3.5a.75.75 0 11-1.1 1.02L10 4.852 7.3 7.76a.75.75 0 01-1.1-1.02l3.25-3.5A.75.75 0 0110 3zm-3.76 9.2a.75.75 0 011.06.04l2.7 2.908 2.7-2.908a.75.75 0 111.1 1.02l-3.25 3.5a.75.75 0 01-1.1 0l-3.25-3.5a.75.75 0 01.04-1.06z" clip-rule="evenodd"></path></svg>
</span>
<input id="{{ $id }}" type="hidden" name="{{ $name ?? $id }}" x-bind:value="selectedItem ? selectedItem.value: null" @bind(id) @bind(name) x-on:change=""/>
<input id="{{ $id }}" type="hidden" name="{{ $name ?? $id }}" x-on:change="{{$onChange ?? ''}}" @bind(id) @bind(name)/>
</button>

<ul x-show="selectOpen"
Expand Down
8 changes: 5 additions & 3 deletions routes/web.php
Original file line number Diff line number Diff line change
Expand Up @@ -147,12 +147,14 @@
}
}

for ($i=1; $i < 10; $i++) {
for ($i = 1; $i < 10; $i++) {
$custom_field = $request->query('q_customfield' . $i);
$type = $request->query('q_customtype' . $i);
$value= $request->query('q_customvalue' . $i);
$value = $request->query('q_customvalue' . $i);

if(!$custom_field) continue;
if (! $custom_field) {
continue;
}

if (($idx = array_search($custom_field, $sortables)) > 0) {
switch ($type) {
Expand Down

0 comments on commit 3ca41e5

Please sign in to comment.