Merge pull request #2732 from brkcvn/master

Added new responsive class name for mobile compatibility
This commit is contained in:
Burak Civan 2022-11-07 18:42:32 +03:00 committed by GitHub
commit 9fb0a97b90
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 54 additions and 10 deletions

View File

@ -11,7 +11,7 @@ class File extends Form
public $formGroupClass = 'sm:col-span-3'; public $formGroupClass = 'sm:col-span-3';
public $custom_attributes = [ public $custom_attributes = [
'dropzone-class' => 'form-file dropzone-column w-1/2 h-32.5', 'dropzone-class' => 'form-file dropzone-column sm:w-1/2 h-32.5',
]; ];
/** /**

22
public/css/app.css vendored
View File

@ -51016,6 +51016,10 @@ body{
display: none; display: none;
} }
.sm\:min-h-500{
min-height: 500px;
}
.sm\:w-500{ .sm\:w-500{
width: 500px; width: 500px;
} }
@ -51052,6 +51056,10 @@ body{
width: 24rem; width: 24rem;
} }
.sm\:w-37{
width: 9.25rem;
}
.sm\:w-60{ .sm\:w-60{
width: 15rem; width: 15rem;
} }
@ -51282,6 +51290,12 @@ body{
display: flex; display: flex;
} }
.lg\:inline-flex{
display: -webkit-inline-box;
display: -ms-inline-flexbox;
display: inline-flex;
}
.lg\:hidden{ .lg\:hidden{
display: none; display: none;
} }
@ -51501,6 +51515,10 @@ body{
gap: 4rem; gap: 4rem;
} }
.lg\:gap-8{
gap: 2rem;
}
.lg\:space-x-16 > :not([hidden]) ~ :not([hidden]){ .lg\:space-x-16 > :not([hidden]) ~ :not([hidden]){
--tw-space-x-reverse: 0; --tw-space-x-reverse: 0;
margin-right: calc(4rem * var(--tw-space-x-reverse)); margin-right: calc(4rem * var(--tw-space-x-reverse));
@ -51582,6 +51600,10 @@ body{
padding-left: 1.5rem; padding-left: 1.5rem;
} }
.lg\:pr-12{
padding-right: 3rem;
}
.lg\:pl-12{ .lg\:pl-12{
padding-left: 3rem; padding-left: 3rem;
} }

View File

@ -1,5 +1,5 @@
<template> <template>
<div :id="'dropzone-' + _uid" class="dropzone dz-clickable" :class="[preview == 'single' ? 'dropzone-single': 'dropzone-multiple', singleWidthClasses ? 'w-full': 'w-37']"> <div :id="'dropzone-' + _uid" class="dropzone dz-clickable" :class="[preview == 'single' ? 'dropzone-single': 'dropzone-multiple', singleWidthClasses ? 'w-full': 'sm:w-37']">
<div class="fallback"> <div class="fallback">
<div class="custom-file"> <div class="custom-file">
<input type="file" class="custom-file-input" :id="'projectCoverUploads' + _uid" :multiple="multiple"> <input type="file" class="custom-file-input" :id="'projectCoverUploads' + _uid" :multiple="multiple">

View File

@ -50,7 +50,7 @@ const app = new Vue({
}, },
item_name_input: false, item_name_input: false,
price_name_input: false, price_name_input: false,
quantity_name_input: false quantity_name_input: false,
} }
}, },
@ -141,24 +141,41 @@ const app = new Vue({
}); });
}, },
onSmallWidthColumn(item) {
this.$refs[item].$el.classList.remove('sm:col-span-6');
this.$refs[item].$el.classList.add('sm:col-span-3');
},
onFullWidthColumn(item) {
this.$refs[item].$el.classList.add('sm:col-span-6');
this.$refs[item].$el.classList.remove('sm:col-span-3');
},
settingsInvoice() { settingsInvoice() {
if (this.form.item_name == 'custom') { if (this.form.item_name == 'custom') {
this.item_name_input = true; this.item_name_input = true;
this.onSmallWidthColumn("item_name");
} else { } else {
this.item_name_input = false; this.item_name_input = false;
this.onFullWidthColumn("item_name");
} }
if (this.form.price_name == 'custom') { if (this.form.price_name == 'custom') {
this.price_name_input = true; this.price_name_input = true;
this.onSmallWidthColumn("price_name");
} else { } else {
this.price_name_input = false; this.price_name_input = false;
this.onFullWidthColumn("price_name");
} }
if (this.form.quantity_name == 'custom') { if (this.form.quantity_name == 'custom') {
this.quantity_name_input = true; this.quantity_name_input = true;
this.onSmallWidthColumn("quantity_name");
} else { } else {
this.quantity_name_input = false; this.quantity_name_input = false;
this.onFullWidthColumn("quantity_name");
} }
}, },
// Change currency get money // Change currency get money

View File

@ -1,7 +1,7 @@
@stack($name . '_input_start') @stack($name . '_input_start')
<div <div
@class([ @class([
'grid sm:grid-cols-6 gap-8', 'grid sm:grid-cols-6 lg:gap-8',
$formGroupClass, $formGroupClass,
'required' => $required, 'required' => $required,
'readonly' => $readonly, 'readonly' => $readonly,
@ -25,6 +25,8 @@
'disabled' => $disabled, 'disabled' => $disabled,
]) ])
ref="{{ $name }}"
id="form-invoice-{{ $name }}" id="form-invoice-{{ $name }}"
@if (isset($attributes['v-show'])) @if (isset($attributes['v-show']))
@ -168,7 +170,8 @@
@foreach ($options as $option) @foreach ($options as $option)
@if ($option->id == 'custom') @if ($option->id == 'custom')
<div class="col-span-6 my-5" v-if="form.{{ $name }} == 'custom'"> <div class="col-span-3" v-if="{{ $attributes['input-name'] }}">
<div class="h-6"></div>
<x-form.group.text name="{{ $attributes['input-name'] }}" value="{{ $attributes['input-value'] }}" /> <x-form.group.text name="{{ $attributes['input-name'] }}" value="{{ $attributes['input-value'] }}" />
</div> </div>
@endif @endif

View File

@ -1,3 +1,3 @@
<div class="flex flex-col lg:flex-row items-center my-10"> <div class="flex flex-col lg:flex-row items-center space-y-8 lg:space-y-0 my-10">
{!! $slot !!} {!! $slot !!}
</div> </div>

View File

@ -1,4 +1,4 @@
<div class="w-full lg:w-5/12 flex items-center mb-10 sm:mb-0"> <div class="w-full lg:w-5/12 flex items-center">
@if (! empty($avatar) && $avatar->isNotEmpty()) @if (! empty($avatar) && $avatar->isNotEmpty())
<div class="w-12 h-12 flex items-center justify-center text-2xl font-regular border border-gray-300 rounded-full p-6"> <div class="w-12 h-12 flex items-center justify-center text-2xl font-regular border border-gray-300 rounded-full p-6">
{!! $avatar !!} {!! $avatar !!}

View File

@ -102,7 +102,7 @@
change="settingsInvoice" change="settingsInvoice"
input-name="item_name_input" input-name="item_name_input"
:input-value="setting('invoice.item_name_input')" :input-value="setting('invoice.item_name_input')"
form-group-class="sm:col-span-6 sm:gap-0" form-group-class="sm:col-span-6"
/> />
<x-form.group.invoice-text <x-form.group.invoice-text
@ -113,7 +113,7 @@
change="settingsInvoice" change="settingsInvoice"
input-name="price_name_input" input-name="price_name_input"
:input-value="setting('invoice.price_name_input')" :input-value="setting('invoice.price_name_input')"
form-group-class="sm:col-span-6 sm:gap-0" form-group-class="col-span-3 sm:col-span-6"
/> />
<x-form.group.invoice-text <x-form.group.invoice-text
@ -124,7 +124,7 @@
change="settingsInvoice" change="settingsInvoice"
input-name="quantity_name_input" input-name="quantity_name_input"
:input-value="setting('invoice.quantity_name_input')" :input-value="setting('invoice.quantity_name_input')"
form-group-class="sm:col-span-6 sm:gap-0" form-group-class="sm:col-span-6"
/> />
</div> </div>

View File

@ -16,6 +16,8 @@ lg:right-0
lg:justify-around lg:justify-around
lg:space-x-16 lg:space-x-16
lg:pr-12 lg:pr-12
lg:inline-flex
lg:space-y-0
sm:ltr:right-4 sm:ltr:right-4
sm:rtl:left-4 sm:rtl:left-4
sm:w-500 sm:w-500