GithubHelp home page GithubHelp logo

Disable Error reports on fields. about wireui HOT 8 CLOSED

wireui avatar wireui commented on May 18, 2024
Disable Error reports on fields.

from wireui.

Comments (8)

itepifanio avatar itepifanio commented on May 18, 2024 1

I can work on this

from wireui.

PH7-Jack avatar PH7-Jack commented on May 18, 2024

Hello, what do you think about using "without-error", "errorless"? Has any suggestions?
In soon I'll implement it

from wireui.

greenspace10 avatar greenspace10 commented on May 18, 2024

I like either of those options. leaning more towards errorless,,, but that's just my opinion.

from wireui.

PH7-Jack avatar PH7-Jack commented on May 18, 2024

This feature is now done. Enjoy WireUI @greenspace10

from wireui.

donatiss avatar donatiss commented on May 18, 2024

will be this issue on radios/checkboxes?

from wireui.

gRoberts84 avatar gRoberts84 commented on May 18, 2024

Unfortunately as @donatiss has pointed out, this only appears to apply to the input component.

Easiest solution was to publish the view assets and then anywhere that used $errors->has($name) or similar, add !$attributes->has('errorless') && before, e.g.

<div>
        <label for="{{ $id }}" class="flex items-center {{ !$attributes->has('errorless') && $errors->has($name) ? 'text-negative-600':'' }}">
            <div class="relative flex items-start">
                @if ($leftLabel)
                    <div class="mr-2 text-sm text-right">
                        <x-dynamic-component
                            :component="WireUi::component('label')"
                            class=""
                            :for="$id"
                            :label="$leftLabel"
                            :has-error="!$attributes->has('errorless') && $errors->has($name)"
                        />
                        @if($description)
                            <div class="text-gray-500">{{ $description }}</div>
                        @endif
                    </div>
                @endif

                <div class="flex items-center h-5">
                    <input {{ $attributes->class([
                        $getClasses(!$attributes->has('errorless') && $errors->has($name)),
                    ])->merge([
                        'type'  => 'checkbox',
                    ]) }} />
                </div>

                @if ($label)
                    <div class="ml-2 text-sm">
                        <x-dynamic-component
                            :component="WireUi::component('label')"
                            class=""
                            :for="$id"
                            :label="$label"
                            :has-error="!$attributes->has('errorless') && $errors->has($name)"
                        />
                        @if($description)
                            <div id="{{ $id }} . comments-description" class="text-gray-500">{{ $description }}</div>
                        @endif
                    </div>
                @endif
            </div>
        </label>

    @if (!$attributes->has('errorless') && $name)
        <x-dynamic-component
            :component="WireUi::component('error')"
            :name="$name"
        />
    @endif
</div>

from wireui.

Uhasith avatar Uhasith commented on May 18, 2024

@itepifanio @greenspace10 Can anyone tell me this only applied for <x-input> ? For checkboxes and radio buttons it not working right?

from wireui.

Uhasith avatar Uhasith commented on May 18, 2024

Unfortunately as @donatiss has pointed out, this only appears to apply to the input component.

Easiest solution was to publish the view assets and then anywhere that used $errors->has($name) or similar, add !$attributes->has('errorless') && before, e.g.

<div>
        <label for="{{ $id }}" class="flex items-center {{ !$attributes->has('errorless') && $errors->has($name) ? 'text-negative-600':'' }}">
            <div class="relative flex items-start">
                @if ($leftLabel)
                    <div class="mr-2 text-sm text-right">
                        <x-dynamic-component
                            :component="WireUi::component('label')"
                            class=""
                            :for="$id"
                            :label="$leftLabel"
                            :has-error="!$attributes->has('errorless') && $errors->has($name)"
                        />
                        @if($description)
                            <div class="text-gray-500">{{ $description }}</div>
                        @endif
                    </div>
                @endif

                <div class="flex items-center h-5">
                    <input {{ $attributes->class([
                        $getClasses(!$attributes->has('errorless') && $errors->has($name)),
                    ])->merge([
                        'type'  => 'checkbox',
                    ]) }} />
                </div>

                @if ($label)
                    <div class="ml-2 text-sm">
                        <x-dynamic-component
                            :component="WireUi::component('label')"
                            class=""
                            :for="$id"
                            :label="$label"
                            :has-error="!$attributes->has('errorless') && $errors->has($name)"
                        />
                        @if($description)
                            <div id="{{ $id }} . comments-description" class="text-gray-500">{{ $description }}</div>
                        @endif
                    </div>
                @endif
            </div>
        </label>

    @if (!$attributes->has('errorless') && $name)
        <x-dynamic-component
            :component="WireUi::component('error')"
            :name="$name"
        />
    @endif
</div>

@gRoberts84 If i want to use this for checkboxes or radio buttons should i manually configure that erroless attribute for those inputs in published config files?

from wireui.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.