playbook_ui 14.15.0.pre.alpha.play1757pbcontenttag6644 → 14.15.0.pre.alpha.play1757pbcontenttag6658
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_form/docs/_form_form_with.html.erb +1 -1
- data/app/pb_kits/playbook/pb_form/docs/_form_form_with_validate.html.erb +1 -1
- data/app/pb_kits/playbook/pb_phone_number_input/_phone_number_input.tsx +6 -0
- data/app/pb_kits/playbook/pb_phone_number_input/docs/_phone_number_input_default.html.erb +1 -1
- data/app/pb_kits/playbook/pb_phone_number_input/docs/_phone_number_input_hidden_inputs.html.erb +5 -0
- data/app/pb_kits/playbook/pb_phone_number_input/docs/_phone_number_input_hidden_inputs.md +1 -0
- data/app/pb_kits/playbook/pb_phone_number_input/docs/example.yml +3 -1
- data/app/pb_kits/playbook/pb_phone_number_input/phone_number_input.rb +3 -0
- data/app/pb_kits/playbook/pb_title/title.html.erb +1 -1
- data/dist/chunks/{_typeahead-BJxRqzLy.js → _typeahead-B8f4HM8I.js} +1 -1
- data/dist/chunks/{_weekday_stacked-DA5vtWKi.js → _weekday_stacked-1q2eI-As.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 +1 -1
- metadata +6 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 917bb0bba320d982c1407a6c005841b97cf6a0004294a59b85fceb43a1db70c3
|
4
|
+
data.tar.gz: 16229f56b7b8758da60c47edb141fe76329760c3a547ffc336169ea399823ebc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ff12c3bcc7cf0b6e5238f2d701714f63b46e3111433bee69147d09f2e61b3d25a73616dfdbf0df96e6b9ec7cc88b83587c5437c047b9093dd9fe08cd6436eacf
|
7
|
+
data.tar.gz: 006d399e62e79ea2c1ce09e56bd2b3d93ce64a077d55a6f677eee2347d82514f0e00b81c503e051944fe0fffc0708149df8a1631a89e979e0b644ba5ae4b33f7
|
@@ -25,7 +25,7 @@
|
|
25
25
|
<%= pb_form_with(scope: :example, url: "", method: :get) do |form| %>
|
26
26
|
<%= form.typeahead :example_typeahead, props: { data: { typeahead_example1: true, user: {} }, label: true, placeholder: "Search for a user" } %>
|
27
27
|
<%= form.text_field :example_text_field, props: { label: true } %>
|
28
|
-
<%= form.phone_number_field :example_phone_number_field, props: { label: "Example phone field" } %>
|
28
|
+
<%= form.phone_number_field :example_phone_number_field, props: { label: "Example phone field", hidden_inputs: true } %>
|
29
29
|
<%= form.email_field :example_email_field, props: { label: true } %>
|
30
30
|
<%= form.number_field :example_number_field, props: { label: true } %>
|
31
31
|
<%= form.search_field :example_search_field, props: { label: true } %>
|
@@ -24,7 +24,7 @@
|
|
24
24
|
<%= pb_form_with(scope: :example, method: :get, url: "", validate: true) do |form| %>
|
25
25
|
<%= form.typeahead :example_typeahead_validation, props: { data: { typeahead_example2: true, user: {} }, label: true, placeholder: "Search for a user", required: true, validation: { message: "Please select a user." } } %>
|
26
26
|
<%= form.text_field :example_text_field_validation, props: { label: true, required: true } %>
|
27
|
-
<%= form.phone_number_field :example_phone_number_field_validation, props: { label: "Example phone field" } %>
|
27
|
+
<%= form.phone_number_field :example_phone_number_field_validation, props: { label: "Example phone field", hidden_inputs: true } %>
|
28
28
|
<%= form.email_field :example_email_field_validation, props: { label: true, required: true } %>
|
29
29
|
<%= form.number_field :example_number_field_validation, props: { label: true, required: true } %>
|
30
30
|
<%= form.search_field :example_project_number_validation, props: { label: true, required: true, validation: { pattern: "[0-9]{2}-[0-9]{5}", message: "Please enter a valid project number (example: 33-12345)." } } %>
|
@@ -23,6 +23,7 @@ type PhoneNumberInputProps = {
|
|
23
23
|
data?: { [key: string]: string },
|
24
24
|
disabled?: boolean,
|
25
25
|
error?: string,
|
26
|
+
hiddenInputs?: boolean,
|
26
27
|
htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
|
27
28
|
id?: string,
|
28
29
|
initialCountry?: string,
|
@@ -72,6 +73,7 @@ const PhoneNumberInput = (props: PhoneNumberInputProps, ref?: React.MutableRefOb
|
|
72
73
|
dark = false,
|
73
74
|
data = {},
|
74
75
|
disabled = false,
|
76
|
+
hiddenInputs = false,
|
75
77
|
htmlOptions = {},
|
76
78
|
id = "",
|
77
79
|
initialCountry = "",
|
@@ -243,6 +245,10 @@ const PhoneNumberInput = (props: PhoneNumberInputProps, ref?: React.MutableRefOb
|
|
243
245
|
countrySearch: false,
|
244
246
|
fixDropdownWidth: false,
|
245
247
|
formatAsYouType: formatAsYouType,
|
248
|
+
hiddenInput: hiddenInputs ? () => ({
|
249
|
+
phone: `${name}_full`,
|
250
|
+
country: `${name}_country_code`,
|
251
|
+
}) : null,
|
246
252
|
})
|
247
253
|
|
248
254
|
itiRef.current = telInputInit;
|
@@ -0,0 +1 @@
|
|
1
|
+
The `hidden_inputs` boolean prop generates two hidden input fields, {field_name}_full and {field_name}_country_code. The value passed when the form is submitted contains the full phone number including the country code. Because it requires the submission of a form to function, only use this prop on Rails phone number elements within html form tags `<form>/<form>` or [pb_forms](https://playbook.powerapp.cloud/kits/form). Read the [intl-tel-input](https://intl-tel-input.com/examples/hidden-input.html) docs for more information.
|
@@ -16,4 +16,6 @@ examples:
|
|
16
16
|
- phone_number_input_initial_country: Initial Country
|
17
17
|
- phone_number_input_only_countries: Limited Countries
|
18
18
|
- phone_number_input_validation: Form Validation
|
19
|
-
- phone_number_input_format: Format as You Type
|
19
|
+
- phone_number_input_format: Format as You Type
|
20
|
+
- phone_number_input_hidden_inputs: Hidden Inputs
|
21
|
+
|
@@ -23,6 +23,8 @@ module Playbook
|
|
23
23
|
default: ""
|
24
24
|
prop :format_as_you_type, type: Playbook::Props::Boolean,
|
25
25
|
default: false
|
26
|
+
prop :hidden_inputs, type: Playbook::Props::Boolean,
|
27
|
+
default: false
|
26
28
|
|
27
29
|
def classname
|
28
30
|
generate_classname("pb_phone_number_input")
|
@@ -35,6 +37,7 @@ module Playbook
|
|
35
37
|
disabled: disabled,
|
36
38
|
error: error,
|
37
39
|
formatAsYouType: format_as_you_type,
|
40
|
+
hiddenInputs: hidden_inputs,
|
38
41
|
initialCountry: initial_country,
|
39
42
|
label: label,
|
40
43
|
name: name,
|
@@ -1,2 +1,2 @@
|
|
1
|
-
<%= pb_content_tag do %><%= content.presence || object.text %><% end %>
|
1
|
+
<%= pb_content_tag(object.tag) do %><%= content.presence || object.text %><% end %>
|
2
2
|
|