openproject-primer_view_components 0.54.0 → 0.54.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +12 -0
- data/app/assets/javascripts/components/primer/open_project/danger_dialog_form_helper.d.ts +1 -0
- data/app/assets/javascripts/primer_view_components.js +1 -1
- data/app/assets/javascripts/primer_view_components.js.map +1 -1
- data/app/components/primer/open_project/danger_dialog.rb +4 -0
- data/app/components/primer/open_project/danger_dialog_form_helper.d.ts +1 -0
- data/app/components/primer/open_project/danger_dialog_form_helper.js +8 -3
- data/app/components/primer/open_project/danger_dialog_form_helper.ts +9 -3
- data/app/components/primer/open_project/feedback_dialog.rb +2 -0
- data/lib/primer/view_components/version.rb +1 -1
- metadata +2 -2
@@ -20,6 +20,7 @@ module Primer
|
|
20
20
|
# @param system_arguments [Hash] <%= link_to_system_arguments_docs %>
|
21
21
|
renders_one :confirmation_message, lambda { |icon_arguments: {}, **system_arguments|
|
22
22
|
system_arguments[:border] = false
|
23
|
+
system_arguments[:id] = "#{dialog_id}-description"
|
23
24
|
|
24
25
|
icon_arguments[:icon] ||= :"alert"
|
25
26
|
icon_arguments[:color] ||= :danger
|
@@ -82,12 +83,15 @@ module Primer
|
|
82
83
|
@confirm_button_text = confirm_button_text
|
83
84
|
@cancel_button_text = cancel_button_text
|
84
85
|
|
86
|
+
deny_single_argument(:role, "`role` will always be set to `alertdialog`.", **system_arguments)
|
87
|
+
|
85
88
|
@system_arguments = system_arguments
|
86
89
|
@system_arguments[:id] = @dialog_id
|
87
90
|
@system_arguments[:classes] = class_names(
|
88
91
|
system_arguments[:classes],
|
89
92
|
"DangerDialog"
|
90
93
|
)
|
94
|
+
@system_arguments[:role] = "alertdialog"
|
91
95
|
|
92
96
|
@dialog = Primer::Alpha::Dialog.new(title: title, subtitle: nil, visually_hide_title: true, **@system_arguments)
|
93
97
|
end
|
@@ -17,11 +17,19 @@ let DangerDialogFormHelperElement = class DangerDialogFormHelperElement extends
|
|
17
17
|
super(...arguments);
|
18
18
|
_DangerDialogFormHelperElement_instances.add(this);
|
19
19
|
}
|
20
|
+
get form() {
|
21
|
+
return this.querySelector('form');
|
22
|
+
}
|
20
23
|
get submitButton() {
|
21
24
|
return this.querySelector(SUBMIT_BUTTON_SELECTOR);
|
22
25
|
}
|
23
26
|
connectedCallback() {
|
27
|
+
// makes the custom element behave as if it doesn't exist in the DOM structure, passing all
|
28
|
+
// styles directly to its children.
|
24
29
|
this.style.display = 'contents';
|
30
|
+
if (this.form) {
|
31
|
+
this.form.style.display = 'contents';
|
32
|
+
}
|
25
33
|
__classPrivateFieldGet(this, _DangerDialogFormHelperElement_instances, "m", _DangerDialogFormHelperElement_reset).call(this);
|
26
34
|
}
|
27
35
|
toggle() {
|
@@ -32,9 +40,6 @@ let DangerDialogFormHelperElement = class DangerDialogFormHelperElement extends
|
|
32
40
|
};
|
33
41
|
_DangerDialogFormHelperElement_instances = new WeakSet();
|
34
42
|
_DangerDialogFormHelperElement_reset = function _DangerDialogFormHelperElement_reset() {
|
35
|
-
if (this.checkbox) {
|
36
|
-
this.checkbox.disabled = false;
|
37
|
-
}
|
38
43
|
this.toggle();
|
39
44
|
};
|
40
45
|
__decorate([
|
@@ -6,12 +6,21 @@ const SUBMIT_BUTTON_SELECTOR = 'input[type=submit],button[type=submit],button[da
|
|
6
6
|
class DangerDialogFormHelperElement extends HTMLElement {
|
7
7
|
@target checkbox: HTMLInputElement | undefined
|
8
8
|
|
9
|
+
get form() {
|
10
|
+
return this.querySelector('form')
|
11
|
+
}
|
12
|
+
|
9
13
|
get submitButton() {
|
10
14
|
return this.querySelector<HTMLInputElement | HTMLButtonElement>(SUBMIT_BUTTON_SELECTOR)!
|
11
15
|
}
|
12
16
|
|
13
17
|
connectedCallback() {
|
18
|
+
// makes the custom element behave as if it doesn't exist in the DOM structure, passing all
|
19
|
+
// styles directly to its children.
|
14
20
|
this.style.display = 'contents'
|
21
|
+
if (this.form) {
|
22
|
+
this.form.style.display = 'contents'
|
23
|
+
}
|
15
24
|
this.#reset()
|
16
25
|
}
|
17
26
|
|
@@ -22,9 +31,6 @@ class DangerDialogFormHelperElement extends HTMLElement {
|
|
22
31
|
}
|
23
32
|
|
24
33
|
#reset(): void {
|
25
|
-
if (this.checkbox) {
|
26
|
-
this.checkbox.disabled = false
|
27
|
-
}
|
28
34
|
this.toggle()
|
29
35
|
}
|
30
36
|
}
|
@@ -16,6 +16,8 @@ module Primer
|
|
16
16
|
# @param system_arguments [Hash] <%= link_to_system_arguments_docs %>
|
17
17
|
renders_one :feedback_message, lambda { |icon_arguments: {}, **system_arguments|
|
18
18
|
system_arguments[:border] = false
|
19
|
+
system_arguments[:id] = "#{@system_arguments[:id]}-description"
|
20
|
+
|
19
21
|
Primer::OpenProject::FeedbackMessage.new(icon_arguments: icon_arguments, **system_arguments)
|
20
22
|
}
|
21
23
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: openproject-primer_view_components
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.54.
|
4
|
+
version: 0.54.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- GitHub Open Source
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2025-02-
|
12
|
+
date: 2025-02-20 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: actionview
|