ariadne_view_components 0.0.33-x86_64-linux → 0.0.36-x86_64-linux

Sign up to get free protection for your applications and to get access to all the features.
Files changed (74) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +70 -5
  3. data/README.md +2 -2
  4. data/app/components/ariadne/avatar_component.rb +1 -1
  5. data/app/components/ariadne/avatar_stack_component.rb +7 -7
  6. data/app/components/ariadne/base_button.rb +2 -2
  7. data/app/components/ariadne/base_component.rb +2 -2
  8. data/app/components/ariadne/blankslate_component.rb +9 -9
  9. data/app/components/ariadne/body_component.rb +1 -1
  10. data/app/components/ariadne/button_component.rb +8 -6
  11. data/app/components/ariadne/clipboard_copy_component.rb +1 -1
  12. data/app/components/ariadne/comment_component/comment_component.html.erb +6 -6
  13. data/app/components/ariadne/comment_component.rb +5 -5
  14. data/app/components/ariadne/component.rb +0 -1
  15. data/app/components/ariadne/container_component.rb +1 -1
  16. data/app/components/ariadne/counter_component.rb +1 -1
  17. data/app/components/ariadne/details_component.rb +10 -9
  18. data/app/components/ariadne/dropdown/menu_component.rb +3 -3
  19. data/app/components/ariadne/dropdown_component/dropdown_component.html.erb +2 -2
  20. data/app/components/ariadne/dropdown_component.rb +52 -52
  21. data/app/components/ariadne/flash_component.rb +5 -5
  22. data/app/components/ariadne/flex_component/flex_component.html.erb +5 -0
  23. data/app/components/ariadne/flex_component.rb +10 -3
  24. data/app/components/ariadne/footer_component.rb +2 -2
  25. data/app/components/ariadne/grid_component.rb +4 -8
  26. data/app/components/ariadne/header_component.rb +7 -7
  27. data/app/components/ariadne/heading_component.rb +1 -1
  28. data/app/components/ariadne/heroicon_component.rb +2 -2
  29. data/app/components/ariadne/inline_flex_component.rb +7 -7
  30. data/app/components/ariadne/link_component.rb +3 -3
  31. data/app/components/ariadne/list_component.rb +10 -4
  32. data/app/components/ariadne/narrow_container_component.rb +1 -1
  33. data/app/components/ariadne/panel_bar_component.rb +3 -3
  34. data/app/components/ariadne/pill_component.rb +1 -1
  35. data/app/components/ariadne/rich_text_area_component/rich-text-area-component.ts +4 -4
  36. data/app/components/ariadne/rich_text_area_component.rb +1 -1
  37. data/app/components/ariadne/slideover_component.rb +3 -3
  38. data/app/components/ariadne/tab_component.rb +1 -1
  39. data/app/components/ariadne/tab_container_component/tab-container-component.ts +1 -1
  40. data/app/components/ariadne/tab_container_component.rb +7 -7
  41. data/app/components/ariadne/tab_nav_component.rb +5 -5
  42. data/app/components/ariadne/table_nav_component.rb +42 -42
  43. data/app/components/ariadne/time_ago_component.rb +1 -1
  44. data/app/components/ariadne/timeline_component.rb +1 -1
  45. data/app/components/ariadne/tooltip_component/tooltip-component.ts +5 -5
  46. data/app/components/ariadne/tooltip_component.rb +1 -1
  47. data/app/lib/ariadne/action_view_extensions/form_helper.rb +1 -1
  48. data/app/lib/ariadne/class_name_helper.rb +1 -1
  49. data/app/lib/ariadne/form_builder.rb +15 -12
  50. data/lib/ariadne/view_components/linters/argument_mappers/conversion_error.rb +10 -0
  51. data/lib/ariadne/view_components/linters/autocorrectable.rb +32 -0
  52. data/lib/ariadne/view_components/linters/base_linter.rb +202 -0
  53. data/lib/ariadne/view_components/linters/tag_tree_helpers.rb +76 -0
  54. data/lib/ariadne/view_components/version.rb +2 -1
  55. data/lib/tasks/build.rake +6 -0
  56. data/lib/tasks/coverage.rake +4 -1
  57. data/lib/tasks/docs.rake +5 -1
  58. data/lib/tasks/test.rake +19 -0
  59. data/static/classes.yml +3 -1
  60. metadata +8 -16
  61. data/app/assets/javascripts/ariadne-form-with.d.ts +0 -20
  62. data/app/assets/javascripts/ariadne-form.d.ts +0 -22
  63. data/app/assets/javascripts/ariadne.d.ts +0 -2
  64. data/app/assets/javascripts/ariadne_view_components.js +0 -8
  65. data/app/assets/javascripts/ariadne_view_components.js.map +0 -1
  66. data/app/assets/javascripts/clipboard-copy-component.d.ts +0 -4
  67. data/app/assets/javascripts/comment-component.d.ts +0 -12
  68. data/app/assets/javascripts/rich-text-area-component.d.ts +0 -6
  69. data/app/assets/javascripts/slideover-component.d.ts +0 -9
  70. data/app/assets/javascripts/tab-container-component.d.ts +0 -1
  71. data/app/assets/javascripts/tab-nav-component.d.ts +0 -9
  72. data/app/assets/javascripts/time-ago-component.d.ts +0 -1
  73. data/app/assets/javascripts/time_ago_component.d.ts +0 -1
  74. data/app/assets/javascripts/tooltip-component.d.ts +0 -24
@@ -0,0 +1,202 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "json"
4
+ require "openssl"
5
+ require "ariadne/view_components/constants"
6
+
7
+ require_relative "tag_tree_helpers"
8
+
9
+ # :nocov:
10
+
11
+ module ERBLint
12
+ module Linters
13
+ # Provides the basic linter logic. When inherited, you should define:
14
+ # * `TAGS` - required - The HTML tags that the component supports. It will be used by the linter to match elements.
15
+ # * `MESSAGE` - required - The message shown when there's an offense.
16
+ # * `CLASSES` - optional - The CSS classes that the component needs. The linter will only match elements with one of those classes.
17
+ # * `REQUIRED_ARGUMENTS` - optional - A list of HTML attributes that are required by the component.
18
+ class BaseLinter < Linter
19
+ include TagTreeHelpers
20
+
21
+ DUMP_FILE = ".erblint-counter-ignore.json"
22
+ DISALLOWED_CLASSES = [].freeze
23
+ CLASSES = [].freeze
24
+ REQUIRED_ARGUMENTS = [].freeze
25
+
26
+ class ConfigSchema < LinterConfig # rubocop:disable Style/Documentation
27
+ property :override_ignores_if_correctable, accepts: [true, false], default: false, reader: :override_ignores_if_correctable?
28
+ end
29
+
30
+ class << self
31
+ def inherited(base)
32
+ super
33
+ base.include(ERBLint::LinterRegistry)
34
+ base.config_schema = ConfigSchema
35
+ end
36
+ end
37
+
38
+ def run(processed_source)
39
+ @total_offenses = 0
40
+ @offenses_not_corrected = 0
41
+ (tags, tag_tree) = build_tag_tree(processed_source)
42
+
43
+ tags.each do |tag|
44
+ next if tag.closing?
45
+ next if self.class::TAGS&.none?(tag.name)
46
+
47
+ classes = tag.attributes["class"]&.value&.split(" ") || []
48
+ tag_tree[tag][:offense] = false
49
+
50
+ next if classes.intersect?(self.class::DISALLOWED_CLASSES)
51
+ next unless self.class::CLASSES.blank? || classes.intersect?(self.class::CLASSES)
52
+
53
+ args = map_arguments(tag, tag_tree[tag])
54
+ correction = correction(args)
55
+
56
+ attributes = tag.attributes.each.map(&:name).join(" ")
57
+ matches_required_attributes = self.class::REQUIRED_ARGUMENTS.blank? || self.class::REQUIRED_ARGUMENTS.all? { |arg| attributes.match?(arg) }
58
+
59
+ tag_tree[tag][:offense] = true
60
+ tag_tree[tag][:correctable] = matches_required_attributes && !correction.nil?
61
+ tag_tree[tag][:message] = message(args, processed_source)
62
+ tag_tree[tag][:correction] = correction
63
+ end
64
+
65
+ tag_tree.each do |tag, h|
66
+ next unless h[:offense]
67
+
68
+ @total_offenses += 1
69
+ # We always fix the offenses using blocks. The closing tag corresponds to `<% end %>`.
70
+ if h[:correctable]
71
+ add_correction(tag, h)
72
+ else
73
+ @offenses_not_corrected += 1
74
+ generate_offense(self.class, processed_source, tag, h[:message])
75
+ end
76
+ end
77
+
78
+ counter_correct?(processed_source)
79
+
80
+ dump_data(processed_source) if ENV["DUMP_LINT_DATA"] == "1"
81
+ end
82
+
83
+ def autocorrect(processed_source, offense)
84
+ return unless offense.context
85
+
86
+ lambda do |corrector|
87
+ if offense.context.include?(counter_disable)
88
+ correct_counter(corrector, processed_source, offense)
89
+ else
90
+ corrector.replace(offense.source_range, offense.context)
91
+ end
92
+ end
93
+ end
94
+
95
+ private
96
+
97
+ def add_correction(tag, tag_tree)
98
+ add_offense(tag.loc, tag_tree[:message], tag_tree[:correction])
99
+ add_offense(tag_tree[:closing].loc, tag_tree[:message], "<% end %>")
100
+ end
101
+
102
+ # Override this function to convert the HTML element attributes to argument for a component.
103
+ #
104
+ # @return [Hash] if possible to map all attributes to arguments.
105
+ # @return [Nil] if cannot map to arguments.
106
+ def map_arguments(_tag, _tag_tree)
107
+ nil
108
+ end
109
+
110
+ # Override this function to define how to autocorrect an element to a component.
111
+ #
112
+ # @return [String] with the text to replace the HTML element if possible to correct.
113
+ # @return [Nil] if cannot correct element.
114
+ def correction(_tag)
115
+ nil
116
+ end
117
+
118
+ # Override this function to customize the linter message.
119
+ #
120
+ # @return [String] message to show on linter error.
121
+ def message(_tag, _processed_source)
122
+ self.class::MESSAGE
123
+ end
124
+
125
+ def counter_disable
126
+ "erblint:counter #{self.class.name.demodulize}"
127
+ end
128
+
129
+ def correct_counter(corrector, processed_source, offense)
130
+ if processed_source.file_content.include?(counter_disable)
131
+ # update the counter if exists
132
+ corrector.replace(offense.source_range, offense.context)
133
+ else
134
+ # add comment with counter if none
135
+ corrector.insert_before(processed_source.source_buffer.source_range, "#{offense.context}\n")
136
+ end
137
+ end
138
+
139
+ def tags(processed_source)
140
+ processed_source.parser.nodes_with_type(:tag).map { |tag_node| BetterHtml::Tree::Tag.from_node(tag_node) }
141
+ end
142
+
143
+ def counter_correct?(processed_source)
144
+ comment_node = nil
145
+ expected_count = 0
146
+ rule_name = self.class.name.match(/:?:?(\w+)\Z/)[1]
147
+
148
+ processed_source.parser.ast.descendants(:erb).each do |node|
149
+ indicator_node, _, code_node, = *node
150
+ indicator = indicator_node&.loc&.source
151
+ comment = code_node&.loc&.source&.strip
152
+
153
+ if indicator == "#" && comment.start_with?("erblint:count") && comment.match(rule_name)
154
+ comment_node = node
155
+ expected_count = comment.match(/\s(\d+)\s?$/)[1].to_i
156
+ end
157
+ end
158
+
159
+ # Unless explicitly set, we don't want to mark correctable offenses if the counter is correct.
160
+ if !@config.override_ignores_if_correctable? && expected_count == @total_offenses
161
+ clear_offenses
162
+ return
163
+ end
164
+
165
+ if @offenses_not_corrected.zero?
166
+ # have to adjust to get `\n` so we delete the whole line
167
+ add_offense(processed_source.to_source_range(comment_node.loc.adjust(end_pos: 1)), "Unused erblint:count comment for #{rule_name}", "") if comment_node
168
+ return
169
+ end
170
+
171
+ first_offense = @offenses[0]
172
+
173
+ if comment_node.nil?
174
+ add_offense(processed_source.to_source_range(first_offense.source_range), "#{rule_name}: If you must, add <%# erblint:counter #{rule_name} #{@offenses_not_corrected} %> to bypass this check.", "<%# erblint:counter #{rule_name} #{@offenses_not_corrected} %>")
175
+ elsif expected_count != @offenses_not_corrected
176
+ add_offense(processed_source.to_source_range(comment_node.loc), "Incorrect erblint:counter number for #{rule_name}. Expected: #{expected_count}, actual: #{@offenses_not_corrected}.", "<%# erblint:counter #{rule_name} #{@offenses_not_corrected} %>")
177
+ # the only offenses remaining are not autocorrectable, so we can ignore them
178
+ elsif expected_count == @offenses_not_corrected && @offenses.size == @offenses_not_corrected
179
+ clear_offenses
180
+ end
181
+ end
182
+
183
+ def generate_offense(klass, processed_source, tag, message = nil, replacement = nil)
184
+ message ||= klass::MESSAGE
185
+ klass_name = klass.name.demodulize
186
+ offense = ["#{klass_name}:#{message}", tag.node.loc.source].join("\n")
187
+ add_offense(processed_source.to_source_range(tag.loc), offense, replacement)
188
+ end
189
+
190
+ def dump_data(processed_source)
191
+ return if @total_offenses.zero?
192
+
193
+ data = File.exist?(DUMP_FILE) ? JSON.parse(File.read(DUMP_FILE)) : {}
194
+
195
+ data[processed_source.filename] ||= {}
196
+ data[processed_source.filename][self.class.name.demodulize] = @total_offenses
197
+
198
+ File.write(DUMP_FILE, JSON.pretty_generate(data))
199
+ end
200
+ end
201
+ end
202
+ end
@@ -0,0 +1,76 @@
1
+ # frozen_string_literal: true
2
+
3
+ module ERBLint
4
+ module Linters
5
+ # Helpers used by linters to organize HTML tags into abstract syntax trees.
6
+ module TagTreeHelpers
7
+ # from https://github.com/Shopify/erb-lint/blob/6179ee2d9d681a6ec4dd02351a1e30eefa748d3d/lib/erb_lint/linters/self_closing_tag.rb
8
+ SELF_CLOSING_TAGS = [
9
+ "area",
10
+ "base",
11
+ "br",
12
+ "col",
13
+ "command",
14
+ "embed",
15
+ "hr",
16
+ "input",
17
+ "keygen",
18
+ "link",
19
+ "menuitem",
20
+ "meta",
21
+ "param",
22
+ "source",
23
+ "track",
24
+ "wbr",
25
+ "img",
26
+ ].freeze
27
+
28
+ # This assumes that the AST provided represents valid HTML, where each tag has a corresponding closing tag.
29
+ # From the tags, we build a structured tree which represents the tag hierarchy.
30
+ # With this, we are able to know where the tags start and end.
31
+ def build_tag_tree(processed_source)
32
+ nodes = processed_source.ast.children
33
+ tag_tree = {}
34
+ tags = []
35
+ current_opened_tag = nil
36
+
37
+ nodes.each do |node|
38
+ if node.type == :tag
39
+ # get the tag from previously calculated list so the references are the same
40
+ tag = BetterHtml::Tree::Tag.from_node(node)
41
+ tags << tag
42
+
43
+ if tag.closing?
44
+ if current_opened_tag && tag.name == current_opened_tag.name
45
+ tag_tree[current_opened_tag][:closing] = tag
46
+ current_opened_tag = tag_tree[current_opened_tag][:parent]
47
+ end
48
+
49
+ next
50
+ end
51
+
52
+ self_closing = self_closing?(tag)
53
+
54
+ tag_tree[tag] = {
55
+ tag: tag,
56
+ closing: self_closing ? tag : nil,
57
+ parent: current_opened_tag,
58
+ children: [],
59
+ }
60
+
61
+ tag_tree[current_opened_tag][:children] << tag_tree[tag] if current_opened_tag
62
+ current_opened_tag = tag unless self_closing
63
+ elsif current_opened_tag
64
+ tag_tree[current_opened_tag][:children] << node
65
+ end
66
+ end
67
+
68
+ [tags, tag_tree]
69
+ end
70
+
71
+ def self_closing?(tag)
72
+ tag.self_closing? || SELF_CLOSING_TAGS.include?(tag.name)
73
+ end
74
+ end
75
+ end
76
+ end
@@ -1,7 +1,8 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ # :nocov:
3
4
  module Ariadne
4
5
  module ViewComponents
5
- VERSION = "0.0.33"
6
+ VERSION = "0.0.36"
6
7
  end
7
8
  end
data/lib/tasks/build.rake CHANGED
@@ -19,6 +19,12 @@ namespace :ariadne_view_components do
19
19
  puts command.inspect
20
20
  system(*command)
21
21
  end
22
+
23
+ desc "Prepares the project for release"
24
+ task :prepare do |_, _args|
25
+ FileUtils.rm_rf("app/assets/javascripts")
26
+ system("script/prepare")
27
+ end
22
28
  end
23
29
 
24
30
  Rake::Task["assets:precompile"].enhance(["ariadne_view_components:build"]) if Rake::Task.task_defined?("assets:precompile")
@@ -8,9 +8,12 @@ namespace :coverage do
8
8
 
9
9
  SimpleCov.minimum_coverage(100)
10
10
 
11
- SimpleCov.collate(Dir["simplecov-resultset-*/.resultset.json"], "rails") do
11
+ SimpleCov.collate(Dir["coverage/.resultset.json"], "rails") do
12
12
  formatter SimpleCov::Formatter::Console
13
13
 
14
+ minimum_coverage 90
15
+ maximum_coverage_drop 2
16
+
14
17
  add_group "Ignored Code" do |src_file|
15
18
  File.readlines(src_file.filename).grep(/:nocov:/).any?
16
19
  end
data/lib/tasks/docs.rake CHANGED
@@ -1,5 +1,9 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require "yard"
4
+ require "yard/renders_one_handler"
5
+ require "yard/renders_many_handler"
6
+
3
7
  require "active_support/inflector"
4
8
  require "fileutils"
5
9
 
@@ -301,7 +305,7 @@ namespace :docs do
301
305
  puts "Markdown compiled."
302
306
 
303
307
  if components_needing_docs.any?
304
- puts "\nThe following components need documentation. Can you add them? #{components_needing_docs.map(&:name).join(", ")}"
308
+ puts "\nThe following components need documentation. Could you add it to them? #{components_needing_docs.map(&:name).join(", ")}"
305
309
  end
306
310
  end
307
311
 
@@ -0,0 +1,19 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "rake/testtask"
4
+
5
+ Rake::TestTask.new(:test) do |t|
6
+ ENV["TZ"] = "Asia/Yerevan"
7
+
8
+ t.libs << "test"
9
+ t.libs << "lib"
10
+ t.warning = false
11
+ t.test_files = FileList[ENV["TESTS"] || "test/**/*_test.rb"]
12
+ end
13
+
14
+ Rake::TestTask.new(:bench) do |t|
15
+ t.libs << "test"
16
+ t.test_files = FileList["test/benchmarks/**/bench_*.rb"]
17
+ t.verbose = true
18
+ t.warning = false
19
+ end
data/static/classes.yml CHANGED
@@ -116,6 +116,8 @@
116
116
  - ".ariadne-ring-black"
117
117
  - ".ariadne-ring-opacity-5"
118
118
  - ".ariadne-text-gray-700"
119
+ - ".ariadne-ml-2"
120
+ - ".ariadne--mr-1"
119
121
  - ".ariadne-text-red-500"
120
122
  - ".ariadne-mt-0"
121
123
  - ".ariadne-text-slate-700"
@@ -137,7 +139,6 @@
137
139
  - ".ariadne-mt-4"
138
140
  - ".ariadne-pt-5"
139
141
  - ".ariadne--mx-2"
140
- - ".ariadne-flex-col"
141
142
  - ".ariadne-mt-6"
142
143
  - ".sm:ariadne-mt-0"
143
144
  - ".ariadne-grid"
@@ -159,6 +160,7 @@
159
160
  - ".md:ariadne-flex"
160
161
  - ".md:ariadne-divide-y-0"
161
162
  - ".ariadne-text-black"
163
+ - ".ariadne-flex-col"
162
164
  - ".ariadne-hidden"
163
165
  - ".ariadne-list-none"
164
166
  - ".ariadne-border-slate-600"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ariadne_view_components
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.33
4
+ version: 0.0.36
5
5
  platform: x86_64-linux
6
6
  authors:
7
7
  - Garen J. Torikian
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-03-21 00:00:00.000000000 Z
11
+ date: 2023-04-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: tailwind_merge
@@ -112,20 +112,6 @@ files:
112
112
  - LICENSE.txt
113
113
  - README.md
114
114
  - app/assets/config/manifest.js
115
- - app/assets/javascripts/ariadne-form-with.d.ts
116
- - app/assets/javascripts/ariadne-form.d.ts
117
- - app/assets/javascripts/ariadne.d.ts
118
- - app/assets/javascripts/ariadne_view_components.js
119
- - app/assets/javascripts/ariadne_view_components.js.map
120
- - app/assets/javascripts/clipboard-copy-component.d.ts
121
- - app/assets/javascripts/comment-component.d.ts
122
- - app/assets/javascripts/rich-text-area-component.d.ts
123
- - app/assets/javascripts/slideover-component.d.ts
124
- - app/assets/javascripts/tab-container-component.d.ts
125
- - app/assets/javascripts/tab-nav-component.d.ts
126
- - app/assets/javascripts/time-ago-component.d.ts
127
- - app/assets/javascripts/time_ago_component.d.ts
128
- - app/assets/javascripts/tooltip-component.d.ts
129
115
  - app/assets/stylesheets/ariadne_view_components.css
130
116
  - app/assets/stylesheets/dropdown.css
131
117
  - app/assets/stylesheets/prosemirror.css
@@ -162,6 +148,7 @@ files:
162
148
  - app/components/ariadne/flash_component.rb
163
149
  - app/components/ariadne/flash_component/flash_component.html.erb
164
150
  - app/components/ariadne/flex_component.rb
151
+ - app/components/ariadne/flex_component/flex_component.html.erb
165
152
  - app/components/ariadne/footer_component.rb
166
153
  - app/components/ariadne/footer_component/footer_component.html.erb
167
154
  - app/components/ariadne/grid_component.rb
@@ -224,6 +211,10 @@ files:
224
211
  - lib/ariadne/view_components/constants.rb
225
212
  - lib/ariadne/view_components/engine.rb
226
213
  - lib/ariadne/view_components/linters.rb
214
+ - lib/ariadne/view_components/linters/argument_mappers/conversion_error.rb
215
+ - lib/ariadne/view_components/linters/autocorrectable.rb
216
+ - lib/ariadne/view_components/linters/base_linter.rb
217
+ - lib/ariadne/view_components/linters/tag_tree_helpers.rb
227
218
  - lib/ariadne/view_components/statuses.rb
228
219
  - lib/ariadne/view_components/upstream.rb
229
220
  - lib/ariadne/view_components/version.rb
@@ -238,6 +229,7 @@ files:
238
229
  - lib/tasks/helpers/ast_processor.rb
239
230
  - lib/tasks/helpers/ast_traverser.rb
240
231
  - lib/tasks/static.rake
232
+ - lib/tasks/test.rake
241
233
  - lib/yard/docs_helper.rb
242
234
  - lib/yard/renders_many_handler.rb
243
235
  - lib/yard/renders_one_handler.rb
@@ -1,20 +0,0 @@
1
- import { Controller } from '@hotwired/stimulus';
2
- import { TemplateResult } from 'lit-html';
3
- declare type HTMLFormField = HTMLInputElement | HTMLButtonElement | HTMLSelectElement | HTMLTextAreaElement;
4
- export default class AriadneFormWith extends Controller {
5
- connect(): void;
6
- disconnect(): void;
7
- onBlur: (event: Event) => void;
8
- onSubmit: (event: Event) => void;
9
- validateForm(): boolean;
10
- validateField(field: HTMLFormField): boolean;
11
- shouldValidateField(field: HTMLFormField): boolean;
12
- refreshErrorForInvalidField(field: HTMLFormField, isValid: boolean): void;
13
- removeExistingErrorMessage(field: HTMLFormField): void;
14
- showErrorForInvalidField(field: HTMLFormField): void;
15
- buildFieldErrorHtml(field: HTMLFormField): string;
16
- get formFields(): HTMLFormField[];
17
- get firstInvalidField(): HTMLFormField | undefined;
18
- getRenderString: (data: TemplateResult) => string;
19
- }
20
- export {};
@@ -1,22 +0,0 @@
1
- import { Controller } from '@hotwired/stimulus';
2
- import type { TemplateResult } from 'lit-html';
3
- declare type HTMLFormField = HTMLInputElement | HTMLSelectElement | HTMLTextAreaElement;
4
- export default class AriadneFormWith extends Controller {
5
- static targets: string[];
6
- readonly formFieldTargets: [HTMLFormField];
7
- connect(): void;
8
- disconnect(): void;
9
- onBlur: (event: Event) => void;
10
- onSubmit: (event: Event) => void;
11
- validateForm(): boolean;
12
- validateField(field: HTMLFormField): boolean;
13
- shouldValidateField(field: HTMLFormField): boolean;
14
- refreshErrorForInvalidField(field: HTMLFormField, isValid: boolean): void;
15
- removeExistingErrorMessage(field: HTMLFormField): void;
16
- showErrorForInvalidField(field: HTMLFormField): void;
17
- buildFieldErrorHtml(field: HTMLFormField): string;
18
- get formFields(): HTMLFormField[];
19
- get firstInvalidField(): HTMLFormField | undefined;
20
- getRenderString: (data: TemplateResult) => string;
21
- }
22
- export {};
@@ -1,2 +0,0 @@
1
- import './tab-container-component';
2
- import './time-ago-component';