playbook_ui 11.11.0.pre.alpha.dialog1 → 11.11.0.pre.alpha.dialog2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 75154344c3369be789e9fdeb6a2140baecde97c1a8f817008348c5635ce0b8dd
4
- data.tar.gz: f9a48fef542601d8a685b3198c2f8bfe3342a47351cbf8c602cfe83917821928
3
+ metadata.gz: 6aefa801028f30170ea5d693cc2062bb8898282475fcc32c5437ac6e23a7a9cb
4
+ data.tar.gz: 8460114464053ed808a1c32d8d11a0adb458bddf5e5c12e35c0bf1b5b5db4408
5
5
  SHA512:
6
- metadata.gz: 6bb37ea63470119137bcb870cf1aa00a35aba2c8d345011ee138f07bf7cd60ebb5007affdb89e81d3b8934fe1e0dc826873300b1f1ee67d27da04b5fcf5ad512
7
- data.tar.gz: 1cbc92c01f4028755ceb6b68ea9cdb996d9d1cc6cc48758e5cfd5774c9d1128f4f71b61d5412c44cf18ba7481ee33416a42d87651970f4fd17182981963fdf96
6
+ metadata.gz: 0e44b3ebdbe70354baf021f710b215b757ad39c179d3c7548909f51af6387f0a95adf4058c058afe4247e696d32a692a9b417f780992abfa3cbdb9433bcbaf54
7
+ data.tar.gz: 92fcfdd0bf79e370b8aabeb42a1ef3f52502d05bee52e8f7ecd62a5db02f3e555e491ce7a73e3e2704e68a73d7a42c58b6cc2abae308fdc77894bd39d1fdd91b
@@ -80,7 +80,6 @@
80
80
  animation-duration: $animation-duration;
81
81
  outline: none;
82
82
  animation-timing-function: $easeInOutQuint;
83
- margin: auto;
84
83
 
85
84
  &[class*="_status_size"] {
86
85
  width: $status_size;
@@ -178,6 +177,12 @@
178
177
  }
179
178
 
180
179
  .pb_dialog_wrapper_rails {
180
+ .pb_dialog_rails {
181
+ top: 0 !important;
182
+ padding: unset !important;
183
+ margin: auto;
184
+
185
+ }
181
186
  dialog::backdrop {
182
187
  position: fixed;
183
188
  top: 0;
@@ -19,4 +19,10 @@
19
19
  <% end %>
20
20
  <%= content %>
21
21
  <% end %>
22
- </div>
22
+ </div>
23
+
24
+ <%= javascript_tag do %>
25
+ window.addEventListener("DOMContentLoaded", () => {
26
+ dialogHelper()
27
+ })
28
+ <% end %>
@@ -12,7 +12,7 @@ module Playbook
12
12
  prop :cancel_button
13
13
 
14
14
  def classname
15
- generate_classname("pb_dialog pb_dialog_#{size}")
15
+ generate_classname("pb_dialog pb_dialog_rails pb_dialog_#{size}")
16
16
  end
17
17
  end
18
18
  end
@@ -1,16 +1,21 @@
1
- document.addEventListener("DOMContentLoaded", function () {
2
- const openTrigger = document.querySelectorAll('[data-open-dialog]');
3
- const closeTrigger = document.querySelectorAll('[data-close-dialog]');
1
+ const dialogHelper = () => {
2
+ const openTrigger = document.querySelectorAll("[data-open-dialog]");
3
+ const closeTrigger = document.querySelectorAll("[data-close-dialog]");
4
+
4
5
  openTrigger.forEach((open) => {
5
6
  open.addEventListener("click", () => {
6
- var openTriggerData = open.dataset.openDialog
7
- document.getElementById(openTriggerData).showModal()
7
+ var openTriggerData = open.dataset.openDialog;
8
+ if (document.getElementById(openTriggerData).open) return;
9
+ document.getElementById(openTriggerData).showModal();
8
10
  });
9
- })
11
+ });
12
+
10
13
  closeTrigger.forEach((close) => {
11
14
  close.addEventListener("click", () => {
12
- var closeTriggerData = close.dataset.closeDialog
13
- document.getElementById(closeTriggerData).close()
14
- })
15
- })
16
- });
15
+ var closeTriggerData = close.dataset.closeDialog;
16
+ document.getElementById(closeTriggerData).close();
17
+ });
18
+ });
19
+ };
20
+
21
+ export default dialogHelper;
@@ -6,7 +6,7 @@
6
6
  <%= pb_rails("button", props: { type: "submit", id: object.confirm_button_id }) do %>
7
7
  <%= object.confirm_button %>
8
8
  <% end %>
9
- <%= pb_rails("button", props: { data: {"close-dialog": "#{object.id}" }, id: object.cancel_button_id}) do %>
9
+ <%= pb_rails("button", props: { data: {"close-dialog": "#{object.id}" }, id: object.cancel_button_id, variant: "link"}) do %>
10
10
  <%= object.cancel_button %>
11
11
  <% end %>
12
12
  <% end %>
@@ -2,7 +2,7 @@
2
2
  id: object.id,
3
3
  data: object.data,
4
4
  aria: object.aria) do %>
5
- <%= pb_rails("flex", props: {classname:object.classname, spacing:"between", padding:"sm"}) do %>
5
+ <%= pb_rails("flex", props: {classname:object.classname, spacing:"between", padding:"sm", align:"center"}) do %>
6
6
  <%= content.presence || object.title %>
7
7
 
8
8
  <button class="dialog-button-class" data-close-dialog= <%= object.id %> >
@@ -2,5 +2,5 @@
2
2
 
3
3
  module Playbook
4
4
  PREVIOUS_VERSION = "11.11.0"
5
- VERSION = "11.11.0.pre.alpha.dialog1"
5
+ VERSION = "11.11.0.pre.alpha.dialog2"
6
6
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: playbook_ui
3
3
  version: !ruby/object:Gem::Version
4
- version: 11.11.0.pre.alpha.dialog1
4
+ version: 11.11.0.pre.alpha.dialog2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Power UX
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2022-11-08 00:00:00.000000000 Z
12
+ date: 2022-11-11 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: actionpack