playbook_ui 14.5.0.pre.alpha.PLAY1548intltelinputupdatelatest4028 → 14.5.0.pre.alpha.PLAY1548intltelinputupdatelatest4037
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_phone_number_input/_phone_number_input.scss +16 -1
- data/app/pb_kits/playbook/pb_phone_number_input/_phone_number_input.tsx +10 -3
- data/app/pb_kits/playbook/pb_phone_number_input/docs/_phone_number_input_preferred_countries.md +1 -1
- data/app/pb_kits/playbook/pb_phone_number_input/intlTelInput.scss +2 -0
- data/app/pb_kits/playbook/pb_phone_number_input/types.d.ts +4 -1
- data/dist/chunks/{_typeahead-BgSfpf21.js → _typeahead-CvmA5XOD.js} +1 -1
- data/dist/chunks/{_weekday_stacked-CU-r3k4h.js → _weekday_stacked-BxOdmCPF.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/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a06ad76a5b0490f9a83f4327fd8a9dd388d2ed6fa1ee83dc72d6ca6a5071ae5c
|
4
|
+
data.tar.gz: 42bfb4eb362d27094685c06ad868c9c5bfb8ebb70960b50df06da156125b9fc1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4bafbfe0895af6e9f6548d7cced94e4c0b341f6a68957d81ea1d47c31ee00fd27b72e90e9028c27a23f6a990dbdc528651aca7e71fd81d0bcd996cc44537adbc
|
7
|
+
data.tar.gz: e632b6fc5da05678aed09cd65a0cc4a6e772e1dcfc5d556546dbd5356644813da9210ac1ab2765bec1f4a38efc9187d7b9a1969cbf9d19ed410004041190dbfb
|
@@ -18,6 +18,18 @@ $flag-min-resolution: 192dpi;
|
|
18
18
|
display: none;
|
19
19
|
}
|
20
20
|
|
21
|
+
.iti__selected-dial-code {
|
22
|
+
font-family: $font_family_base;
|
23
|
+
font-size: $font_base;
|
24
|
+
line-height: 1.5;
|
25
|
+
letter-spacing: $lspace_normal;
|
26
|
+
font-weight: $regular;
|
27
|
+
font-style: normal;
|
28
|
+
text-rendering: optimizeLegibility;
|
29
|
+
-moz-font-feature-settings: "liga" on;
|
30
|
+
color: $charcoal;
|
31
|
+
}
|
32
|
+
|
21
33
|
input::placeholder {
|
22
34
|
color: $focus_input_light;
|
23
35
|
}
|
@@ -46,6 +58,9 @@ $flag-min-resolution: 192dpi;
|
|
46
58
|
justify-content: center;
|
47
59
|
align-items: center;
|
48
60
|
margin-right: 10px;
|
61
|
+
.iti__flag {
|
62
|
+
margin-right: 0;
|
63
|
+
}
|
49
64
|
}
|
50
65
|
|
51
66
|
.iti__selected-country {
|
@@ -133,7 +148,7 @@ $flag-min-resolution: 192dpi;
|
|
133
148
|
|
134
149
|
.iti__arrow.iti__arrow--up::before {
|
135
150
|
transform: rotate(-($transform-rotate-deg/3));
|
136
|
-
top: $space_xs +
|
151
|
+
top: $space_xs + 1px;
|
137
152
|
color: $primary_action;
|
138
153
|
}
|
139
154
|
|
@@ -1,8 +1,7 @@
|
|
1
1
|
import React, { forwardRef, useEffect, useRef, useState, useImperativeHandle } from 'react'
|
2
2
|
import classnames from 'classnames'
|
3
3
|
|
4
|
-
import intlTelInput from 'intl-tel-input/intlTelInputWithUtils'
|
5
|
-
import 'intl-tel-input/build/js/utils.js'
|
4
|
+
import intlTelInput from 'intl-tel-input/build/js/intlTelInputWithUtils.js'
|
6
5
|
|
7
6
|
import { buildAriaProps, buildCss, buildDataProps, buildHtmlProps } from '../utilities/props'
|
8
7
|
import { globalProps } from '../utilities/globalProps'
|
@@ -214,16 +213,24 @@ const PhoneNumberInput = (props: PhoneNumberInputProps, ref?: React.MutableRefOb
|
|
214
213
|
// This also Fixes things for our react_component rendering on the Rails Side
|
215
214
|
useEffect(formatAllCountries, [])
|
216
215
|
|
216
|
+
// If an initial country is not specified, the "globe" icon will show
|
217
|
+
// Always set a country
|
218
|
+
const fallbackCountry =
|
219
|
+
preferredCountries.length > 0 ? preferredCountries[0] :
|
220
|
+
onlyCountries.length > 0 ? onlyCountries.sort()[0] :
|
221
|
+
"af";
|
222
|
+
|
217
223
|
useEffect(() => {
|
218
224
|
const telInputInit = intlTelInput(inputRef.current, {
|
219
225
|
separateDialCode: true,
|
220
226
|
countryOrder: preferredCountries,
|
221
227
|
allowDropdown: !disabled,
|
222
228
|
autoInsertDialCode: false,
|
223
|
-
initialCountry,
|
229
|
+
initialCountry: initialCountry || fallbackCountry,
|
224
230
|
onlyCountries,
|
225
231
|
countrySearch: false,
|
226
232
|
fixDropdownWidth: false,
|
233
|
+
formatAsYouType: false,
|
227
234
|
})
|
228
235
|
|
229
236
|
inputRef.current.addEventListener("countrychange", (evt: Event) => {
|
data/app/pb_kits/playbook/pb_phone_number_input/docs/_phone_number_input_preferred_countries.md
CHANGED
@@ -1 +1 @@
|
|
1
|
-
Preferred countries will display in the order they are listed with the first country preselected, and all non-preferred countries listed alphabetically below
|
1
|
+
Preferred countries will display in the order they are listed with the first country preselected, and all non-preferred countries listed alphabetically below in the remaining dropdown.
|