playbook_ui 14.5.0.pre.alpha.PLAY1510railsformloading3977 → 14.5.0.pre.alpha.PLAY1548intltelinputupdatelatest4028
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/pb_kits/playbook/pb_dialog/docs/_dialog_loading.html.erb +7 -30
- data/app/pb_kits/playbook/pb_dialog/docs/_dialog_loading.md +2 -0
- data/app/pb_kits/playbook/pb_form/docs/example.yml +0 -1
- data/app/pb_kits/playbook/pb_form/form.rb +0 -2
- data/app/pb_kits/playbook/pb_multi_level_select/_multi_level_select.tsx +195 -228
- data/app/pb_kits/playbook/pb_multi_level_select/context/index.tsx +5 -0
- data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_default.jsx +1 -1
- data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_with_children.jsx +105 -0
- data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_with_children.md +1 -0
- data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_with_children_with_radios.jsx +106 -0
- data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_with_children_with_radios.md +1 -0
- data/app/pb_kits/playbook/pb_multi_level_select/docs/example.yml +3 -0
- data/app/pb_kits/playbook/pb_multi_level_select/docs/index.js +2 -0
- data/app/pb_kits/playbook/pb_multi_level_select/multi_level_select_options.tsx +149 -0
- data/app/pb_kits/playbook/pb_phone_number_input/_phone_number_input.scss +45 -11
- data/app/pb_kits/playbook/pb_phone_number_input/_phone_number_input.tsx +6 -4
- data/dist/chunks/_typeahead-BgSfpf21.js +22 -0
- data/dist/chunks/{_weekday_stacked-DnNh3oJT.js → _weekday_stacked-CU-r3k4h.js} +1 -1
- data/dist/chunks/{lib-C9Somihj.js → lib-CEpcaI8y.js} +1 -1
- data/dist/chunks/{pb_form_validation-C8U7gqcT.js → pb_form_validation-D9zkwt2b.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/dist/playbook.css +1 -1
- data/lib/playbook/pb_forms_helper.rb +1 -3
- data/lib/playbook/version.rb +1 -1
- metadata +12 -9
- data/app/pb_kits/playbook/pb_form/docs/_form_form_with_loading.html.erb +0 -8
- data/app/pb_kits/playbook/pb_form/docs/_form_form_with_loading.md +0 -1
- data/app/pb_kits/playbook/pb_form/formHelper.js +0 -39
- data/dist/chunks/_typeahead-CbSMQAjp.js +0 -22
@@ -22,10 +22,9 @@ module Playbook
|
|
22
22
|
# @param data [Hash] hash of data attributes
|
23
23
|
# @param validate [Boolean] whether validation should be triggered or not
|
24
24
|
# @see [#form_with] for other options
|
25
|
-
def pb_form_with(data: {}, validate: false,
|
25
|
+
def pb_form_with(data: {}, validate: false, **kwargs, &block)
|
26
26
|
data = data.merge("pb-form-validation" => validate)
|
27
27
|
classname = ["pb-form", kwargs[:class]].join(" ")
|
28
|
-
classname += " pb_form_loading" if loading
|
29
28
|
options = kwargs.merge(
|
30
29
|
class: classname,
|
31
30
|
data: data,
|
@@ -34,7 +33,6 @@ module Playbook
|
|
34
33
|
|
35
34
|
content_for(:pb_js, javascript_tag(<<~JS))
|
36
35
|
window.addEventListener("DOMContentLoaded", function() { PbFormValidation.start() })
|
37
|
-
window.addEventListener("DOMContentLoaded", () => formHelper())
|
38
36
|
JS
|
39
37
|
|
40
38
|
form_with(**options, &block)
|
data/lib/playbook/version.rb
CHANGED
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: 14.5.0.pre.alpha.
|
4
|
+
version: 14.5.0.pre.alpha.PLAY1548intltelinputupdatelatest4028
|
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: 2024-10-
|
12
|
+
date: 2024-10-11 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: actionpack
|
@@ -1320,13 +1320,10 @@ files:
|
|
1320
1320
|
- app/pb_kits/playbook/pb_form/docs/_description.md
|
1321
1321
|
- app/pb_kits/playbook/pb_form/docs/_footer.md
|
1322
1322
|
- app/pb_kits/playbook/pb_form/docs/_form_form_with.html.erb
|
1323
|
-
- app/pb_kits/playbook/pb_form/docs/_form_form_with_loading.html.erb
|
1324
|
-
- app/pb_kits/playbook/pb_form/docs/_form_form_with_loading.md
|
1325
1323
|
- app/pb_kits/playbook/pb_form/docs/_form_form_with_validate.html.erb
|
1326
1324
|
- app/pb_kits/playbook/pb_form/docs/_form_form_with_validate.md
|
1327
1325
|
- app/pb_kits/playbook/pb_form/docs/example.yml
|
1328
1326
|
- app/pb_kits/playbook/pb_form/form.rb
|
1329
|
-
- app/pb_kits/playbook/pb_form/formHelper.js
|
1330
1327
|
- app/pb_kits/playbook/pb_form/pb_form_validation.js
|
1331
1328
|
- app/pb_kits/playbook/pb_form_group/_form_group.scss
|
1332
1329
|
- app/pb_kits/playbook/pb_form_group/_form_group.tsx
|
@@ -1799,6 +1796,7 @@ files:
|
|
1799
1796
|
- app/pb_kits/playbook/pb_multi_level_select/_helper_functions.tsx
|
1800
1797
|
- app/pb_kits/playbook/pb_multi_level_select/_multi_level_select.scss
|
1801
1798
|
- app/pb_kits/playbook/pb_multi_level_select/_multi_level_select.tsx
|
1799
|
+
- app/pb_kits/playbook/pb_multi_level_select/context/index.tsx
|
1802
1800
|
- app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_color.html.erb
|
1803
1801
|
- app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_color.jsx
|
1804
1802
|
- app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_color_rails.md
|
@@ -1819,12 +1817,17 @@ files:
|
|
1819
1817
|
- app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_single_children_only.html.erb
|
1820
1818
|
- app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_single_children_only.jsx
|
1821
1819
|
- app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_single_children_only.md
|
1820
|
+
- app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_with_children.jsx
|
1821
|
+
- app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_with_children.md
|
1822
|
+
- app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_with_children_with_radios.jsx
|
1823
|
+
- app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_with_children_with_radios.md
|
1822
1824
|
- app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_with_form.html.erb
|
1823
1825
|
- app/pb_kits/playbook/pb_multi_level_select/docs/example.yml
|
1824
1826
|
- app/pb_kits/playbook/pb_multi_level_select/docs/index.js
|
1825
1827
|
- app/pb_kits/playbook/pb_multi_level_select/multi_level_select.html.erb
|
1826
1828
|
- app/pb_kits/playbook/pb_multi_level_select/multi_level_select.rb
|
1827
1829
|
- app/pb_kits/playbook/pb_multi_level_select/multi_level_select.test.jsx
|
1830
|
+
- app/pb_kits/playbook/pb_multi_level_select/multi_level_select_options.tsx
|
1828
1831
|
- app/pb_kits/playbook/pb_multiple_users/_multiple_users.scss
|
1829
1832
|
- app/pb_kits/playbook/pb_multiple_users/_multiple_users.tsx
|
1830
1833
|
- app/pb_kits/playbook/pb_multiple_users/docs/_description.md
|
@@ -3076,11 +3079,11 @@ files:
|
|
3076
3079
|
- app/pb_kits/playbook/utilities/test/globalProps/truncate.test.js
|
3077
3080
|
- app/pb_kits/playbook/utilities/text.ts
|
3078
3081
|
- app/pb_kits/playbook/utilities/validEmojiChecker.ts
|
3079
|
-
- dist/chunks/_typeahead-
|
3080
|
-
- dist/chunks/_weekday_stacked-
|
3082
|
+
- dist/chunks/_typeahead-BgSfpf21.js
|
3083
|
+
- dist/chunks/_weekday_stacked-CU-r3k4h.js
|
3081
3084
|
- dist/chunks/lazysizes-B7xYodB-.js
|
3082
|
-
- dist/chunks/lib-
|
3083
|
-
- dist/chunks/pb_form_validation-
|
3085
|
+
- dist/chunks/lib-CEpcaI8y.js
|
3086
|
+
- dist/chunks/pb_form_validation-D9zkwt2b.js
|
3084
3087
|
- dist/chunks/vendor.js
|
3085
3088
|
- dist/menu.yml
|
3086
3089
|
- dist/playbook-doc.js
|
@@ -1,8 +0,0 @@
|
|
1
|
-
<%= pb_form_with(scope: :example, url: "", method: :get, loading: true) do |form| %>
|
2
|
-
<%= form.text_field :example_text_field, props: { label: true } %>
|
3
|
-
|
4
|
-
<%= form.actions do |action| %>
|
5
|
-
<%= action.submit %>
|
6
|
-
<%= action.button props: { type: "reset", text: "Cancel", variant: "secondary" } %>
|
7
|
-
<% end %>
|
8
|
-
<% end %>
|
@@ -1 +0,0 @@
|
|
1
|
-
Pressing Submit will trigger a loading state where the button content is replaced by a spinner icon and the submit button will be disabled.
|
@@ -1,39 +0,0 @@
|
|
1
|
-
const formHelper = () => {
|
2
|
-
const loadingForm = document.querySelector(".pb_form_loading")
|
3
|
-
if (loadingForm) {
|
4
|
-
loadingForm.addEventListener("submit", function(event) {
|
5
|
-
const submitButton = event['submitter'];
|
6
|
-
const cancelButton = event['target'].querySelector('button[type="reset"]');
|
7
|
-
|
8
|
-
if (submitButton) {
|
9
|
-
let currentClass = submitButton.className;
|
10
|
-
let newClass = currentClass.replace("_enabled", "_disabled_loading");
|
11
|
-
|
12
|
-
let cancelClass = cancelButton ? cancelButton.className : "";
|
13
|
-
let newCancelClass = cancelClass.replace("_enabled", "_disabled");
|
14
|
-
|
15
|
-
submitButton.disabled = true;
|
16
|
-
submitButton.className = newClass;
|
17
|
-
|
18
|
-
if (cancelButton) {
|
19
|
-
cancelButton.disabled = true;
|
20
|
-
cancelButton.className = newCancelClass;
|
21
|
-
}
|
22
|
-
|
23
|
-
setTimeout(function() {
|
24
|
-
submitButton.disabled = false;
|
25
|
-
submitButton.className = currentClass;
|
26
|
-
|
27
|
-
if (cancelButton) {
|
28
|
-
cancelButton.disabled = false;
|
29
|
-
cancelButton.className = cancelClass;
|
30
|
-
}
|
31
|
-
}, 5000);
|
32
|
-
}
|
33
|
-
|
34
|
-
this.submit();
|
35
|
-
});
|
36
|
-
}
|
37
|
-
};
|
38
|
-
|
39
|
-
export default formHelper;
|