ariadne_view_components 0.0.51-arm64-darwin → 0.0.53-arm64-darwin
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/app/assets/javascripts/ariadne_view_components.js +1 -1
- data/app/assets/javascripts/ariadne_view_components.js.map +1 -1
- data/app/assets/javascripts/components/ariadne/options_controller/options_controller.d.ts +2 -3
- data/app/components/ariadne/options_controller/options_controller.d.ts +2 -3
- data/app/components/ariadne/options_controller/options_controller.js +4 -6
- data/app/components/ariadne/options_controller/options_controller.ts +5 -8
- data/app/components/ariadne/string_match_controller/string_match_controller.ts +1 -0
- data/app/lib/ariadne/fetch_or_fallback_helper.rb +2 -2
- data/lib/ariadne/view_components/linters/autocorrectable.rb +1 -1
- data/lib/ariadne/view_components/linters/base_linter.rb +2 -2
- data/lib/ariadne/view_components/version.rb +1 -1
- data/lib/rubocop/cop/ariadne/base_cop.rb +1 -1
- metadata +3 -3
@@ -30,10 +30,9 @@ export default class OptionsController extends SyncedBooleanAttributesController
|
|
30
30
|
activeOptionsValue: TActiveOptions;
|
31
31
|
readonly isMultiValue: boolean;
|
32
32
|
readonly toggleableValue: boolean;
|
33
|
-
optionTargetLookup: Map<Element, TOptionKey>;
|
34
33
|
select(event: Event, updateTo?: TOutletChangeData<TActiveOptions>): void;
|
35
|
-
|
36
|
-
getValueForElement(element: Element): boolean
|
34
|
+
optionTargetConnected(element: Element): void;
|
35
|
+
getValueForElement(element: Element): boolean;
|
37
36
|
getState(): TActiveOptions;
|
38
37
|
outletUpdate: (event: Event, updateTo?: TOutletChangeData<TActiveOptions>) => void;
|
39
38
|
}
|
@@ -30,10 +30,9 @@ export default class OptionsController extends SyncedBooleanAttributesController
|
|
30
30
|
activeOptionsValue: TActiveOptions;
|
31
31
|
readonly isMultiValue: boolean;
|
32
32
|
readonly toggleableValue: boolean;
|
33
|
-
optionTargetLookup: Map<Element, TOptionKey>;
|
34
33
|
select(event: Event, updateTo?: TOutletChangeData<TActiveOptions>): void;
|
35
|
-
|
36
|
-
getValueForElement(element: Element): boolean
|
34
|
+
optionTargetConnected(element: Element): void;
|
35
|
+
getValueForElement(element: Element): boolean;
|
37
36
|
getState(): TActiveOptions;
|
38
37
|
outletUpdate: (event: Event, updateTo?: TOutletChangeData<TActiveOptions>) => void;
|
39
38
|
}
|
@@ -9,7 +9,6 @@ class OptionsController extends SyncedBooleanAttributesController {
|
|
9
9
|
constructor() {
|
10
10
|
super(...arguments);
|
11
11
|
_OptionsController_instances.add(this);
|
12
|
-
this.optionTargetLookup = new Map();
|
13
12
|
this.outletUpdate = this.select;
|
14
13
|
}
|
15
14
|
select(event, updateTo = {}) {
|
@@ -31,20 +30,19 @@ class OptionsController extends SyncedBooleanAttributesController {
|
|
31
30
|
}
|
32
31
|
this.sendToOutlets(event, Object.assign(Object.assign({}, updateTo), { data: this.activeOptionsValue }));
|
33
32
|
}
|
34
|
-
|
33
|
+
optionTargetConnected(element) {
|
35
34
|
const key = __classPrivateFieldGet(this, _OptionsController_instances, "m", _OptionsController_getElementKey).call(this, element);
|
36
|
-
|
35
|
+
const isActive = this.activeOptionsValue[key] || this.doesElementHaveOnAttrs(element);
|
36
|
+
if (isActive) {
|
37
37
|
__classPrivateFieldGet(this, _OptionsController_instances, "m", _OptionsController_activateKey).call(this, key);
|
38
38
|
}
|
39
39
|
else {
|
40
40
|
__classPrivateFieldGet(this, _OptionsController_instances, "m", _OptionsController_deactivateKey).call(this, key);
|
41
41
|
}
|
42
|
+
this.updateAttributesForElement(element, isActive);
|
42
43
|
}
|
43
44
|
getValueForElement(element) {
|
44
45
|
var _a;
|
45
|
-
if (!this.optionTargetLookup.has(element)) {
|
46
|
-
return null;
|
47
|
-
}
|
48
46
|
const optionKey = __classPrivateFieldGet(this, _OptionsController_instances, "m", _OptionsController_getElementKey).call(this, element);
|
49
47
|
return (_a = this.activeOptionsValue[optionKey]) !== null && _a !== void 0 ? _a : false;
|
50
48
|
}
|
@@ -29,8 +29,6 @@ export default class OptionsController
|
|
29
29
|
declare readonly isMultiValue: boolean
|
30
30
|
declare readonly toggleableValue: boolean
|
31
31
|
|
32
|
-
optionTargetLookup: Map<Element, TOptionKey> = new Map()
|
33
|
-
|
34
32
|
select(event: Event, updateTo: TOutletChangeData<TActiveOptions> = {}) {
|
35
33
|
const activeOptions = updateTo.data
|
36
34
|
for (let index in this.optionTargets) {
|
@@ -53,13 +51,16 @@ export default class OptionsController
|
|
53
51
|
this.sendToOutlets(event, {...updateTo, data: this.activeOptionsValue})
|
54
52
|
}
|
55
53
|
|
56
|
-
|
54
|
+
optionTargetConnected(element: Element) {
|
57
55
|
const key = this.#getElementKey(element)
|
58
|
-
|
56
|
+
const isActive = this.activeOptionsValue[key] || this.doesElementHaveOnAttrs(element)
|
57
|
+
if (isActive) {
|
59
58
|
this.#activateKey(key)
|
60
59
|
} else {
|
61
60
|
this.#deactivateKey(key)
|
62
61
|
}
|
62
|
+
|
63
|
+
this.updateAttributesForElement(element, isActive)
|
63
64
|
}
|
64
65
|
|
65
66
|
#shouldChangeState(isCurrentlyActive: boolean, wasSelected: boolean) {
|
@@ -104,10 +105,6 @@ export default class OptionsController
|
|
104
105
|
}
|
105
106
|
|
106
107
|
getValueForElement(element: Element) {
|
107
|
-
if (!this.optionTargetLookup.has(element)) {
|
108
|
-
return null
|
109
|
-
}
|
110
|
-
|
111
108
|
const optionKey = this.#getElementKey(element)
|
112
109
|
return this.activeOptionsValue[optionKey] ?? false
|
113
110
|
}
|
@@ -59,7 +59,7 @@ module Ariadne
|
|
59
59
|
|
60
60
|
unless silence_warnings?
|
61
61
|
message = <<~MSG
|
62
|
-
Ariadne: note that `#{preferred_tag}` is the preferred tag
|
62
|
+
Ariadne: note that `#{preferred_tag}` is the preferred tag for `#{self.class.name}`;
|
63
63
|
you passed `#{given_tag}` (which will still be used)
|
64
64
|
MSG
|
65
65
|
|
@@ -75,7 +75,7 @@ module Ariadne
|
|
75
75
|
|
76
76
|
unless silence_warnings?
|
77
77
|
message = <<~MSG
|
78
|
-
Ariadne: note that `#{preferred_attribute}` is the preferred attribute
|
78
|
+
Ariadne: note that `#{preferred_attribute}` is the preferred attribute for `#{self.class.name}`;
|
79
79
|
you passed `#{given_attribute}` (which will still be used)
|
80
80
|
MSG
|
81
81
|
|
@@ -159,13 +159,13 @@ module ERBLint
|
|
159
159
|
# Unless explicitly set, we don't want to mark correctable offenses if the counter is correct.
|
160
160
|
if !@config.override_ignores_if_correctable? && expected_count == @total_offenses
|
161
161
|
clear_offenses
|
162
|
-
return
|
162
|
+
return false
|
163
163
|
end
|
164
164
|
|
165
165
|
if @offenses_not_corrected.zero?
|
166
166
|
# have to adjust to get `\n` so we delete the whole line
|
167
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
|
168
|
+
return false
|
169
169
|
end
|
170
170
|
|
171
171
|
first_offense = @offenses[0]
|
@@ -12,7 +12,7 @@ module RuboCop
|
|
12
12
|
# We only verify SystemArguments if it's a `.new` call on a component or
|
13
13
|
# a ViewHeleper call.
|
14
14
|
def valid_node?(node)
|
15
|
-
return if node.nil?
|
15
|
+
return false if node.nil?
|
16
16
|
|
17
17
|
view_helpers.include?(node.method_name) || (node.method_name == :new && !node.receiver.nil? && ::Ariadne::ViewComponents::STATUSES.key?(node.receiver.const_name))
|
18
18
|
end
|
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.
|
4
|
+
version: 0.0.53
|
5
5
|
platform: arm64-darwin
|
6
6
|
authors:
|
7
7
|
- Garen J. Torikian
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-07-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: tailwind_merge
|
@@ -342,7 +342,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
342
342
|
- !ruby/object:Gem::Version
|
343
343
|
version: '0'
|
344
344
|
requirements: []
|
345
|
-
rubygems_version: 3.4.
|
345
|
+
rubygems_version: 3.4.16
|
346
346
|
signing_key:
|
347
347
|
specification_version: 4
|
348
348
|
summary: ViewComponents for the Ariadne Design System
|