@php $datalistOptions = $getDatalistOptions(); $extraAlpineAttributes = $getExtraAlpineAttributes(); $id = $getId(); $isConcealed = $isConcealed(); $isDisabled = $isDisabled(); $isPrefixInline = $isPrefixInline(); $isSuffixInline = $isSuffixInline(); $mask = $getMask(); $prefixActions = $getPrefixActions(); $prefixIcon = $getPrefixIcon(); $prefixLabel = $getPrefixLabel(); $suffixActions = $getSuffixActions(); $suffixIcon = $getSuffixIcon(); $suffixLabel = $getSuffixLabel(); $statePath = $getStatePath(); $stylecode = ''; $x = 0; if ($isRevealable() || $isGeneratable() || $isCopyable()) { $x += $isRevealable() ? 2 : 0; $x += $isGeneratable() ? 2 : 0; $x += $isCopyable() ? 2 : 0; $stylecode = 'isRtl ? \'padding-left: '.$x.'rem\' : \'padding-right: '.$x.'rem\''; } $generatePassword = ' let chars = \''. $getPasswChars().'\'; let minLen = '. $getPasswLength(). '; let password = []; while(password.length <= minLen){ password.push(chars.charAt(Math.floor(Math.random() * 26))); password.push(chars.charAt(Math.floor(Math.random() * 26) +26)); if(chars.length > 52 && password.length > 4){ password.push(chars.charAt(Math.floor(Math.random() * 10) +52)); } if(chars.length > 62 && password.length > 4){ password.push(chars.charAt(Math.floor(Math.random() * 10) +62)); } } password = password.slice(0, minLen).sort(() => Math.random() - 0.5).join(\'\') $wire.set(\'' . $getStatePath() . '\', password); '; if($shouldNotifyOnGenerate()){ $generatePassword .= 'new FilamentNotification() .title(\'' . $getGenerateText() . '\') .seconds(3) .success() .send();'; } $copyPassword = ' copyPassword: function() { navigator.clipboard.writeText( $wire.get(\'' . $getStatePath() . '\')); '; if($shouldNotifyOnCopy() || true) { $copyPassword .= "new FilamentNotification() .title('" . $getCopyText() . "') .seconds(3) .success() .send();"; } $copyPassword .= '}'; $xdata = '{ show: true, isRtl: false, generatePasswd: function() { ' . $generatePassword . ' }, ' . $copyPassword . ' }'; @endphp @if ($isRevealable() || $isGeneratable() || $isCopyable())
@if ($isRevealable()) @endif @if ($isGeneratable()) @endif @if ($isCopyable()) @endif
@endif
@if ($datalistOptions) @foreach ($datalistOptions as $option) @endif