Files

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

59 lines
3.2 KiB
Plaintext
Raw Permalink Normal View History

2024-12-17 16:57:13 +02:00
<%#-- copyright
OpenProject is an open source project management software.
Copyright (C) the OpenProject GmbH
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License version 3.
OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows:
Copyright (C) 2006-2013 Jean-Philippe Lang
Copyright (C) 2010-2013 the ChiliProject Team
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
See COPYRIGHT and LICENSE files for more details.
++#%>
<%= render(FormControl.new(input: @input, tag: :"primer-datepicker-field")) do %>
<%= content_tag(:div, **@field_wrap_arguments) do %>
<%# leading spinner implies a leading visual %>
<% if @input.leading_visual || @input.leading_spinner? %>
<span class="FormControl-input-leadingVisualWrap">
<%= render(Primer::Beta::Octicon.new(**@input.leading_visual, data: { target: "primer-text-field.leadingVisual" })) %>
<% if @input.leading_spinner? %>
<%= render(Primer::Beta::Spinner.new(size: :small, hidden: true, data: { target: "primer-text-field.leadingSpinner" })) %>
<% end %>
</span>
<% end %>
<%= render Primer::ConditionalWrapper.new(condition: @input.auto_check_src, tag: "auto-check", csrf: auto_check_authenticity_token, src: @input.auto_check_src) do %>
<%= angular_component_tag @datepicker_options.fetch(:component),
data: {
targets: @input.input_arguments.dig(:data, :targets),
"multi-input-name": @input.input_arguments.dig(:data, :name)
}.compact,
2025-02-06 18:00:11 +01:00
inputs: @datepicker_options.merge(
id: @datepicker_options.fetch(:id) { builder.field_id(@input.name) },
2025-02-06 18:00:11 +01:00
name: @datepicker_options.fetch(:name) { builder.field_name(@input.name) },
value: @datepicker_options.fetch(:value) { @input.input_arguments[:value] || builder.object&.send(@input.name) },
inputClassNames: @datepicker_options.fetch(:class) { @input.input_arguments[:class] },
2026-02-08 16:25:35 -03:00
dataAction: @datepicker_options.fetch(:data, {}).fetch(:action, nil),
inputAttrs: @datepicker_options.fetch(:input_attributes, nil),
2026-02-08 16:25:35 -03:00
placeholder: @input.input_arguments.fetch(:placeholder, "")
2025-02-06 18:00:11 +01:00
) %>
<% end %>
<% end %>
<% end %>