playbook_ui 14.2.0.pre.alpha.play1490railsdialogdatafix3649 → 14.2.1.pre.alpha.PBNTR431fixingduplicatingtextareaclassname3689
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/app/pb_kits/playbook/pb_circle_icon_button/_circle_icon_button.tsx +3 -0
- data/app/pb_kits/playbook/pb_circle_icon_button/circle_icon_button.html.erb +1 -1
- data/app/pb_kits/playbook/pb_circle_icon_button/circle_icon_button.rb +2 -0
- data/app/pb_kits/playbook/pb_circle_icon_button/circle_icon_button.test.js +15 -0
- data/app/pb_kits/playbook/pb_circle_icon_button/docs/_circle_icon_button_loading.html.erb +29 -0
- data/app/pb_kits/playbook/pb_circle_icon_button/docs/_circle_icon_button_loading.jsx +43 -0
- data/app/pb_kits/playbook/pb_circle_icon_button/docs/example.yml +2 -0
- data/app/pb_kits/playbook/pb_circle_icon_button/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_dialog/dialog.html.erb +1 -4
- data/app/pb_kits/playbook/pb_dialog/dialog.rb +0 -3
- data/app/pb_kits/playbook/pb_dialog/dialogHelper.js +0 -21
- data/app/pb_kits/playbook/pb_dialog/dialog_footer.html.erb +2 -4
- data/app/pb_kits/playbook/pb_dialog/dialog_footer.rb +1 -10
- data/app/pb_kits/playbook/pb_dialog/docs/example.yml +0 -1
- data/app/pb_kits/playbook/pb_textarea/_textarea.tsx +0 -1
- data/app/pb_kits/playbook/pb_textarea/textarea.html.erb +0 -1
- data/dist/chunks/{_typeahead-nSyn1ajB.js → _typeahead-KAYMhDNO.js} +2 -2
- data/dist/chunks/{_weekday_stacked-iq_X37be.js → _weekday_stacked-Bms5JW8f.js} +2 -2
- data/dist/chunks/{lib-D9uVVKnh.js → lib-DErGXNy3.js} +1 -1
- data/dist/chunks/{pb_form_validation-u2wnZ3oe.js → pb_form_validation-BC6kh7Hu.js} +1 -1
- data/dist/chunks/vendor.js +1 -1
- data/dist/playbook-doc.js +1 -1
- data/dist/playbook-rails-react-bindings.js +1 -1
- data/dist/playbook-rails.js +1 -1
- data/lib/playbook/version.rb +2 -2
- metadata +8 -8
- data/app/pb_kits/playbook/pb_dialog/docs/_dialog_loading.html.erb +0 -13
- data/app/pb_kits/playbook/pb_dialog/docs/_dialog_loading.md +0 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e5176e3600e405965bbf3825210db99f5e79045b2ab05ec5d9dd415b85029a7c
|
4
|
+
data.tar.gz: c7acd54ee584b58d4e7626f3988e03abc55c78d8eb897fa84601f42a6356bb19
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 49ca875dcc91d6e2beae3d93ff7ff9e741e8db0a4df9fb3a7c0561311a011fdf301308217f22c65708298ee6f5854015bb8929fc2f67e94820ffc64d1c50bd7e
|
7
|
+
data.tar.gz: 309f669294d766289d8b79a466d488107c69c243aa1725292b7c15c380ca87bd1f81a2d1c33d1c6c0395ad7a94f8df59f377e340c38342006dc8f0518ae12023
|
@@ -16,6 +16,7 @@ type CircleIconButtonProps = {
|
|
16
16
|
htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
|
17
17
|
id?: string,
|
18
18
|
link?: string,
|
19
|
+
loading?: boolean,
|
19
20
|
onClick?: React.MouseEventHandler<HTMLElement>,
|
20
21
|
newWindow?: boolean,
|
21
22
|
type?: 'button' | 'submit' | 'reset' | undefined,
|
@@ -32,6 +33,7 @@ const CircleIconButton = (props: CircleIconButtonProps): React.ReactElement => {
|
|
32
33
|
htmlOptions = {},
|
33
34
|
icon,
|
34
35
|
id,
|
36
|
+
loading = false,
|
35
37
|
onClick = noop,
|
36
38
|
type,
|
37
39
|
link,
|
@@ -61,6 +63,7 @@ const CircleIconButton = (props: CircleIconButtonProps): React.ReactElement => {
|
|
61
63
|
disabled={disabled}
|
62
64
|
htmlType={type}
|
63
65
|
link={link}
|
66
|
+
loading={loading}
|
64
67
|
newWindow={newWindow}
|
65
68
|
onClick={onClick}
|
66
69
|
text={null}
|
@@ -1,5 +1,5 @@
|
|
1
1
|
<%= pb_content_tag do %>
|
2
|
-
<%= pb_rails("button", props: {type: object.type, link: object.link, new_window:object.new_window, variant: object.variant, disabled: object.disabled, dark: object.dark}) do %>
|
2
|
+
<%= pb_rails("button", props: {type: object.type, loading: object.loading, link: object.link, new_window:object.new_window, variant: object.variant, disabled: object.disabled, dark: object.dark}) do %>
|
3
3
|
<%= pb_rails("icon", props: {icon: object.icon, fixed_width: true, dark: object.dark}) %>
|
4
4
|
<% end %>
|
5
5
|
<% end %>
|
@@ -12,6 +12,8 @@ module Playbook
|
|
12
12
|
prop :disabled, type: Playbook::Props::Boolean,
|
13
13
|
default: false
|
14
14
|
prop :icon, required: true
|
15
|
+
prop :loading, type: Playbook::Props::Boolean,
|
16
|
+
default: false
|
15
17
|
prop :link
|
16
18
|
prop :new_window, type: Playbook::Props::Boolean,
|
17
19
|
default: false
|
@@ -15,3 +15,18 @@ test('default test', () => {
|
|
15
15
|
|
16
16
|
expect(kit).toHaveClass('pb_circle_icon_button_kit')
|
17
17
|
})
|
18
|
+
|
19
|
+
test('passes loading prop to button', () => {
|
20
|
+
render(
|
21
|
+
<CircleIconButton
|
22
|
+
data={{ testid: 'loading-test' }}
|
23
|
+
icon="plus"
|
24
|
+
loading
|
25
|
+
/>
|
26
|
+
)
|
27
|
+
|
28
|
+
const kit = screen.getByTestId('loading-test')
|
29
|
+
const button = kit.querySelector('.pb_button_kit_primary_inline_enabled_loading')
|
30
|
+
|
31
|
+
expect(button).toBeInTheDocument()
|
32
|
+
})
|
@@ -0,0 +1,29 @@
|
|
1
|
+
<%= pb_rails("circle_icon_button", props: {
|
2
|
+
variant: "primary",
|
3
|
+
icon: "plus",
|
4
|
+
loading: true
|
5
|
+
}) %>
|
6
|
+
|
7
|
+
<br/>
|
8
|
+
|
9
|
+
<%= pb_rails("circle_icon_button", props: {
|
10
|
+
variant: "secondary",
|
11
|
+
icon: "pen",
|
12
|
+
loading: true
|
13
|
+
}) %>
|
14
|
+
|
15
|
+
<br/>
|
16
|
+
|
17
|
+
<%= pb_rails("circle_icon_button", props: {
|
18
|
+
disabled: true,
|
19
|
+
icon: "times",
|
20
|
+
loading: true
|
21
|
+
}) %>
|
22
|
+
|
23
|
+
<br/>
|
24
|
+
|
25
|
+
<%= pb_rails("circle_icon_button", props: {
|
26
|
+
variant: "link",
|
27
|
+
icon: "user",
|
28
|
+
loading: true
|
29
|
+
}) %>
|
@@ -0,0 +1,43 @@
|
|
1
|
+
import React from 'react'
|
2
|
+
|
3
|
+
import CircleIconButton from '../_circle_icon_button'
|
4
|
+
|
5
|
+
const CircleIconButtonLoading = (props) => (
|
6
|
+
<div>
|
7
|
+
<CircleIconButton
|
8
|
+
icon="plus"
|
9
|
+
loading
|
10
|
+
variant="primary"
|
11
|
+
{...props}
|
12
|
+
/>
|
13
|
+
|
14
|
+
<br />
|
15
|
+
|
16
|
+
<CircleIconButton
|
17
|
+
icon="pen"
|
18
|
+
loading
|
19
|
+
variant="secondary"
|
20
|
+
{...props}
|
21
|
+
/>
|
22
|
+
|
23
|
+
<br />
|
24
|
+
|
25
|
+
<CircleIconButton
|
26
|
+
disabled
|
27
|
+
icon="times"
|
28
|
+
loading
|
29
|
+
{...props}
|
30
|
+
/>
|
31
|
+
|
32
|
+
<br />
|
33
|
+
|
34
|
+
<CircleIconButton
|
35
|
+
icon="user"
|
36
|
+
loading
|
37
|
+
variant="link"
|
38
|
+
{...props}
|
39
|
+
/>
|
40
|
+
</div>
|
41
|
+
)
|
42
|
+
|
43
|
+
export default CircleIconButtonLoading
|
@@ -3,8 +3,10 @@ examples:
|
|
3
3
|
rails:
|
4
4
|
- circle_icon_button_default: Default
|
5
5
|
- circle_icon_button_link: Link
|
6
|
+
- circle_icon_button_loading: Loading
|
6
7
|
|
7
8
|
react:
|
8
9
|
- circle_icon_button_default: Default
|
9
10
|
- circle_icon_button_click: Click Handler
|
10
11
|
- circle_icon_button_link: Link
|
12
|
+
- circle_icon_button_loading: Loading
|
@@ -1,3 +1,4 @@
|
|
1
1
|
export { default as CircleIconButtonDefault } from './_circle_icon_button_default.jsx'
|
2
2
|
export { default as CircleIconButtonClick } from './_circle_icon_button_click.jsx'
|
3
3
|
export { default as CircleIconButtonLink } from './_circle_icon_button_link.jsx'
|
4
|
+
export { default as CircleIconButtonLoading } from './_circle_icon_button_loading.jsx'
|
@@ -22,11 +22,8 @@
|
|
22
22
|
<% if object.cancel_button && object.confirm_button %>
|
23
23
|
<%= pb_rails("dialog/dialog_footer", props: {
|
24
24
|
cancel_button: object.cancel_button,
|
25
|
-
cancel_button_id: object.cancel_button_id,
|
26
25
|
confirm_button: object.confirm_button,
|
27
|
-
|
28
|
-
id: object.id,
|
29
|
-
loading: object.loading
|
26
|
+
id: object.id
|
30
27
|
}) %>
|
31
28
|
<% end %>
|
32
29
|
|
@@ -13,11 +13,8 @@ module Playbook
|
|
13
13
|
prop :should_close_on_overlay_click, type: Playbook::Props::Boolean, default: true
|
14
14
|
prop :title
|
15
15
|
prop :text
|
16
|
-
prop :loading
|
17
16
|
prop :confirm_button
|
18
|
-
prop :confirm_button_id
|
19
17
|
prop :cancel_button
|
20
|
-
prop :cancel_button_id
|
21
18
|
prop :status, type: Playbook::Props::Enum,
|
22
19
|
values: ["info", "caution", "delete", "error", "success", "default", ""],
|
23
20
|
default: ""
|
@@ -3,27 +3,6 @@ const dialogHelper = () => {
|
|
3
3
|
const closeTrigger = document.querySelectorAll("[data-close-dialog]");
|
4
4
|
const dialogs = document.querySelectorAll(".pb_dialog_rails")
|
5
5
|
|
6
|
-
const loadingButton = document.querySelector('[data-disable-with="Loading"]');
|
7
|
-
if (loadingButton) {
|
8
|
-
loadingButton.addEventListener("click", function() {
|
9
|
-
const okayLoadingButton = document.querySelector('[data-disable-with="Loading"]');
|
10
|
-
const cancelButton = document.querySelector('[data-disable-cancel-with="Loading"]');
|
11
|
-
let currentClass = okayLoadingButton.className;
|
12
|
-
let cancelClass = cancelButton ? cancelButton.className : "";
|
13
|
-
|
14
|
-
let newClass = currentClass.replace("_enabled", "_disabled_loading");
|
15
|
-
let newCancelClass = cancelClass.replace("_enabled", "_disabled");
|
16
|
-
|
17
|
-
// Disable the buttons
|
18
|
-
okayLoadingButton.disabled = true;
|
19
|
-
if (cancelButton) cancelButton.disabled = true;
|
20
|
-
|
21
|
-
okayLoadingButton.className = newClass;
|
22
|
-
if (cancelButton) cancelButton.className = newCancelClass;
|
23
|
-
});
|
24
|
-
}
|
25
|
-
|
26
|
-
|
27
6
|
openTrigger.forEach((open) => {
|
28
7
|
open.addEventListener("click", () => {
|
29
8
|
var openTriggerData = open.dataset.openDialog;
|
@@ -3,12 +3,10 @@
|
|
3
3
|
<% if object.confirm_button && object.cancel_button %>
|
4
4
|
<div class="dialog-pseudo-footer"></div>
|
5
5
|
<%= pb_rails("flex", props: { classname:object.classname, spacing:"between", padding_x:"sm", padding:"sm", padding_bottom:"sm" }) do %>
|
6
|
-
|
7
|
-
<%= pb_rails("button", props: { type: "submit", id: object.confirm_button_id, data: loading_data,
|
8
|
-
}) do %>
|
6
|
+
<%= pb_rails("button", props: { type: "submit", id: object.confirm_button_id }) do %>
|
9
7
|
<%= object.confirm_button %>
|
10
8
|
<% end %>
|
11
|
-
<%= pb_rails("button", props: { type: "button", data: {"close-dialog": "#{object.id}"
|
9
|
+
<%= pb_rails("button", props: { type: "button", data: {"close-dialog": "#{object.id}" }, id: object.cancel_button_id, variant: "link"}) do %>
|
12
10
|
<%= object.cancel_button %>
|
13
11
|
<% end %>
|
14
12
|
<% end %>
|
@@ -4,22 +4,13 @@ module Playbook
|
|
4
4
|
module PbDialog
|
5
5
|
class DialogFooter < Playbook::KitBase
|
6
6
|
prop :cancel_button
|
7
|
-
prop :cancel_button_id
|
8
7
|
prop :confirm_button
|
9
8
|
prop :confirm_button_id
|
10
|
-
prop :
|
9
|
+
prop :cancel_button_id
|
11
10
|
|
12
11
|
def classname
|
13
12
|
generate_classname("dialog_footer")
|
14
13
|
end
|
15
|
-
|
16
|
-
def cancel_loading
|
17
|
-
loading ? "Loading" : ""
|
18
|
-
end
|
19
|
-
|
20
|
-
def loading_data
|
21
|
-
loading ? { disable_with: "Loading" } : {}
|
22
|
-
end
|
23
14
|
end
|
24
15
|
end
|
25
16
|
end
|