Add support for placeholder attribute to component
	
		
			
	
		
	
	
		
	
		
			All checks were successful
		
		
	
	
		
			
				
	
				continuous-integration/drone/push Build is passing
				
			
		
		
	
	
				
					
				
			
		
			All checks were successful
		
		
	
	continuous-integration/drone/push Build is passing
				
			This commit is contained in:
		
							parent
							
								
									40b34d0935
								
							
						
					
					
						commit
						fff6dea100
					
				@ -6,6 +6,7 @@
 | 
			
		||||
    ) do %>
 | 
			
		||||
  <%= method("#{@type}_field").call :setting, @key,
 | 
			
		||||
    value: Setting.public_send(@key),
 | 
			
		||||
    placeholder: @placeholder,
 | 
			
		||||
    data: {
 | 
			
		||||
      :'default-value' => Setting.get_field(@key)[:default]
 | 
			
		||||
    },
 | 
			
		||||
 | 
			
		||||
@ -2,7 +2,7 @@
 | 
			
		||||
 | 
			
		||||
module FormElements
 | 
			
		||||
  class FieldsetResettableSettingComponent < ViewComponent::Base
 | 
			
		||||
    def initialize(tag: "li", key:, type: :text, title:, description: nil)
 | 
			
		||||
    def initialize(tag: "li", key:, type: :text, title:, description: nil, placeholder: nil)
 | 
			
		||||
      @tag         = tag
 | 
			
		||||
      @positioning = :vertical
 | 
			
		||||
      @title       = title
 | 
			
		||||
@ -10,6 +10,7 @@ module FormElements
 | 
			
		||||
      @key         = key.to_sym
 | 
			
		||||
      @type        = type
 | 
			
		||||
      @resettable  = is_resettable?(@key)
 | 
			
		||||
      @placeholder = placeholder
 | 
			
		||||
    end
 | 
			
		||||
 | 
			
		||||
    def is_resettable?(key)
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user