playbook_ui 15.1.0.pre.alpha.PLAY2468phonenuminputvalidation11082 → 15.1.0.pre.alpha.PLAY2468phonenuminputvalidation11148

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.
@@ -2,5 +2,5 @@
2
2
 
3
3
  module Playbook
4
4
  PREVIOUS_VERSION = "15.1.0"
5
- VERSION = "15.1.0.pre.alpha.PLAY2468phonenuminputvalidation11082"
5
+ VERSION = "15.1.0.pre.alpha.PLAY2468phonenuminputvalidation11148"
6
6
  end
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: 15.1.0.pre.alpha.PLAY2468phonenuminputvalidation11082
4
+ version: 15.1.0.pre.alpha.PLAY2468phonenuminputvalidation11148
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: 2025-10-06 00:00:00.000000000 Z
12
+ date: 2025-10-07 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: actionpack
@@ -3708,13 +3708,13 @@ files:
3708
3708
  - app/pb_kits/playbook/utilities/test/globalProps/truncate.test.js
3709
3709
  - app/pb_kits/playbook/utilities/text.ts
3710
3710
  - app/pb_kits/playbook/utilities/validEmojiChecker.ts
3711
- - dist/chunks/_line_graph-Cw2C1Nuk.js
3712
- - dist/chunks/_typeahead-DslCE4I8.js
3713
- - dist/chunks/_weekday_stacked-Cs0EoUlF.js
3711
+ - dist/chunks/_line_graph-ghx4wYQu.js
3712
+ - dist/chunks/_typeahead-DUcfjQGg.js
3713
+ - dist/chunks/_weekday_stacked-tkzbOLCo.js
3714
3714
  - dist/chunks/componentRegistry-DzmmLR2x.js
3715
3715
  - dist/chunks/lazysizes-B7xYodB-.js
3716
3716
  - dist/chunks/lib-QZuu1ltS.js
3717
- - dist/chunks/pb_form_validation-D1VURgVg.js
3717
+ - dist/chunks/pb_form_validation-CleM960_.js
3718
3718
  - dist/chunks/vendor.js
3719
3719
  - dist/menu.yml
3720
3720
  - dist/playbook-doc.js
@@ -1 +0,0 @@
1
- import{P as PbEnhancedElement,d as debounce}from"./lib-QZuu1ltS.js";const KIT_SELECTOR='[class^="pb_"][class*="_kit"]';const ERROR_MESSAGE_SELECTOR=".pb_body_kit_negative";const FORM_SELECTOR='form[data-pb-form-validation="true"]';const REQUIRED_FIELDS_SELECTOR="input[required],textarea[required],select[required]";const PHONE_NUMBER_VALIDATION_ERROR_SELECTOR='[data-pb-phone-validation-error="true"]';const FIELD_EVENTS=["change","valid","invalid"];class PbFormValidation extends PbEnhancedElement{static get selector(){return FORM_SELECTOR}connect(){this.formValidationFields.forEach((field=>{const isPhoneNumberInput=field.closest(".pb_phone_number_input");if(isPhoneNumberInput)return;FIELD_EVENTS.forEach((e=>{field.addEventListener(e,debounce((event=>{this.validateFormField(event)}),250),false)}))}));this.element.addEventListener("submit",(event=>{if(this.hasPhoneNumberValidationErrors()){event.preventDefault();return false}}))}validateFormField(event){event.preventDefault();const{target:target}=event;target.setCustomValidity("");const isValid=event.target.validity.valid;if(isValid){this.clearError(target)}else{this.showValidationMessage(target)}}showValidationMessage(target){const{parentElement:parentElement}=target;const kitElement=parentElement.closest(KIT_SELECTOR);const isPhoneNumberInput=kitElement&&kitElement.classList.contains("pb_phone_number_input");this.clearError(target);kitElement.classList.add("error");if(!isPhoneNumberInput){const errorMessageContainer=this.errorMessageContainer;if(target.dataset.message)target.setCustomValidity(target.dataset.message);errorMessageContainer.innerHTML=target.validationMessage;parentElement.appendChild(errorMessageContainer)}}clearError(target){const{parentElement:parentElement}=target;parentElement.closest(KIT_SELECTOR).classList.remove("error");const errorMessageContainer=parentElement.querySelector(ERROR_MESSAGE_SELECTOR);if(errorMessageContainer)errorMessageContainer.remove()}hasPhoneNumberValidationErrors(){const phoneNumberErrors=this.element.querySelectorAll(PHONE_NUMBER_VALIDATION_ERROR_SELECTOR);return phoneNumberErrors.length>0}get errorMessageContainer(){const errorContainer=document.createElement("div");const kitClassName=ERROR_MESSAGE_SELECTOR.replace(/\./,"");errorContainer.classList.add(kitClassName);return errorContainer}get formValidationFields(){return this._formValidationFields=this._formValidationFields||this.element.querySelectorAll(REQUIRED_FIELDS_SELECTOR)}}window.PbFormValidation=PbFormValidation;