feat(docs): migrate and reorganize frontend guides for BP panel and file uploads
- Deleted outdated documentation files for BP panel list sorting and Filestore frontend guide. - Created new documentation files for BP panel list sorting and Filestore frontend guide in the client directory. - Updated the structure and content to enhance clarity and accessibility for frontend integration with file upload and profile image APIs. - Ensured consistency in documentation style and improved examples for better developer experience.
This commit is contained in:
@@ -6,6 +6,7 @@ import {
|
||||
normalizeToE164,
|
||||
PHONE_UI_MAX_LENGTH,
|
||||
splitE164ForEditing,
|
||||
toBestEffortE164,
|
||||
} from "@/lib/phone/e164";
|
||||
import {
|
||||
DEFAULT_PHONE_COUNTRY,
|
||||
@@ -80,8 +81,10 @@ export function PhoneNumberInput({
|
||||
|
||||
const emitE164 = useCallback(
|
||||
(nationalInput: string, countryCode: CountryCode) => {
|
||||
const e164 = normalizeToE164(nationalInput, countryCode);
|
||||
const next = e164 ?? "";
|
||||
// Preserve the user's input as best-effort E.164 instead of clearing it
|
||||
// to "" whenever it is not yet strictly valid — otherwise a typed number
|
||||
// can silently vanish from the submitted payload.
|
||||
const next = toBestEffortE164(nationalInput, countryCode);
|
||||
lastEmitted.current = next;
|
||||
onChange(next);
|
||||
},
|
||||
@@ -110,9 +113,12 @@ export function PhoneNumberInput({
|
||||
setNational(display.national);
|
||||
lastEmitted.current = e164;
|
||||
onChange(e164);
|
||||
} else if (!required) {
|
||||
lastEmitted.current = "";
|
||||
onChange("");
|
||||
} else {
|
||||
// Keep what the user typed (as best-effort E.164) so an invalid number is
|
||||
// surfaced by validation rather than silently discarded on blur.
|
||||
const next = toBestEffortE164(national, country);
|
||||
lastEmitted.current = next;
|
||||
onChange(next);
|
||||
}
|
||||
onBlur?.();
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user