@ptcwebops/ptcw-design 6.3.65-beta → 6.3.66-beta

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.
@@ -3634,20 +3634,28 @@ ptc-link, ptc-square-card,
3634
3634
  }
3635
3635
  .ptc-text-field .mdc-text-field--outlined:not(.mdc-text-field--disabled).mdc-text-field--focused.mouse-focus .mdc-notched-outline__leading,
3636
3636
  .ptc-text-field .mdc-text-field--outlined:not(.mdc-text-field--disabled).mdc-text-field--focused.mouse-focus .mdc-notched-outline__notch,
3637
- .ptc-text-field .mdc-text-field--outlined:not(.mdc-text-field--disabled).mdc-text-field--focused.mouse-focus .mdc-notched-outline__trailing {
3637
+ .ptc-text-field .mdc-text-field--outlined:not(.mdc-text-field--disabled).mdc-text-field--focused.mouse-focus .mdc-notched-outline__trailing,
3638
+ .ptc-text-field .mdc-text-field--outlined.mouse-focus .mdc-notched-outline__leading,
3639
+ .ptc-text-field .mdc-text-field--outlined.mouse-focus .mdc-notched-outline__notch,
3640
+ .ptc-text-field .mdc-text-field--outlined.mouse-focus .mdc-notched-outline__trailing {
3638
3641
  border-color: var(--color-blue-07);
3639
3642
  }
3640
3643
  .ptc-text-field .mdc-text-field--outlined:not(.mdc-text-field--disabled).mdc-text-field--focused.keyboard-focus .mdc-notched-outline__leading,
3641
3644
  .ptc-text-field .mdc-text-field--outlined:not(.mdc-text-field--disabled).mdc-text-field--focused.keyboard-focus .mdc-notched-outline__notch,
3642
- .ptc-text-field .mdc-text-field--outlined:not(.mdc-text-field--disabled).mdc-text-field--focused.keyboard-focus .mdc-notched-outline__trailing {
3645
+ .ptc-text-field .mdc-text-field--outlined:not(.mdc-text-field--disabled).mdc-text-field--focused.keyboard-focus .mdc-notched-outline__trailing,
3646
+ .ptc-text-field .mdc-text-field--outlined.keyboard-focus .mdc-notched-outline__leading,
3647
+ .ptc-text-field .mdc-text-field--outlined.keyboard-focus .mdc-notched-outline__notch,
3648
+ .ptc-text-field .mdc-text-field--outlined.keyboard-focus .mdc-notched-outline__trailing {
3643
3649
  border-color: var(--keyboard-nav-outline);
3644
3650
  border-width: 5px;
3645
3651
  }
3646
- .ptc-text-field .mdc-text-field--outlined:not(.mdc-text-field--disabled).mdc-text-field--focused.keyboard-focus .mdc-notched-outline__leading {
3652
+ .ptc-text-field .mdc-text-field--outlined:not(.mdc-text-field--disabled).mdc-text-field--focused.keyboard-focus .mdc-notched-outline__leading,
3653
+ .ptc-text-field .mdc-text-field--outlined.keyboard-focus .mdc-notched-outline__leading {
3647
3654
  border-top-left-radius: var(--ptc-border-radius-standard) !important;
3648
3655
  border-bottom-left-radius: var(--ptc-border-radius-standard) !important;
3649
3656
  }
3650
- .ptc-text-field .mdc-text-field--outlined:not(.mdc-text-field--disabled).mdc-text-field--focused.keyboard-focus .mdc-notched-outline__trailing {
3657
+ .ptc-text-field .mdc-text-field--outlined:not(.mdc-text-field--disabled).mdc-text-field--focused.keyboard-focus .mdc-notched-outline__trailing,
3658
+ .ptc-text-field .mdc-text-field--outlined.keyboard-focus .mdc-notched-outline__trailing {
3651
3659
  border-top-right-radius: var(--ptc-border-radius-standard) !important;
3652
3660
  border-bottom-right-radius: var(--ptc-border-radius-standard) !important;
3653
3661
  }
@@ -3823,6 +3831,8 @@ ptc-link, ptc-square-card,
3823
3831
  margin: 0;
3824
3832
  position: static;
3825
3833
  padding-right: 8px;
3834
+ padding-top: 8px;
3835
+ padding-bottom: 8px;
3826
3836
  line-height: var(--ptc-font-size-small);
3827
3837
  }
3828
3838
  .ptc-text-field .mdc-text-field--outlined {
@@ -3848,4 +3858,21 @@ ptc-link, ptc-square-card,
3848
3858
  padding-right: 1px;
3849
3859
  padding-top: 2px;
3850
3860
  padding-bottom: 2px;
3861
+ }
3862
+ .ptc-text-field .mdc-text-field--with-internal-counter textarea.mdc-text-field__input {
3863
+ padding-bottom: 32px;
3864
+ overflow-y: auto;
3865
+ word-break: break-word;
3866
+ }
3867
+ .ptc-text-field .textarea-wrapper {
3868
+ position: relative;
3869
+ z-index: 9;
3870
+ padding-bottom: 20px;
3871
+ }
3872
+ .ptc-text-field .textarea-wrapper .mdc-text-field-character-counter {
3873
+ position: absolute;
3874
+ top: unset;
3875
+ bottom: -28px;
3876
+ right: 0;
3877
+ z-index: 9;
3851
3878
  }
@@ -224,6 +224,7 @@ export class PtcTextfield {
224
224
  const textFields = document.querySelectorAll('.mdc-text-field');
225
225
  textFields.forEach((textField) => {
226
226
  const input = textField.querySelector('input');
227
+ const textArea = textField.querySelector('textarea');
227
228
  if (input) {
228
229
  input.addEventListener('focus', () => {
229
230
  if (this.lastInteraction === 'keyboard') {
@@ -239,6 +240,21 @@ export class PtcTextfield {
239
240
  textField.classList.remove('keyboard-focus', 'mouse-focus');
240
241
  });
241
242
  }
243
+ if (textArea) {
244
+ textArea.addEventListener('focus', () => {
245
+ if (this.lastInteraction === 'keyboard') {
246
+ textField.classList.add('keyboard-focus');
247
+ textField.classList.remove('mouse-focus');
248
+ }
249
+ else {
250
+ textField.classList.add('mouse-focus');
251
+ textField.classList.remove('keyboard-focus');
252
+ }
253
+ });
254
+ textArea.addEventListener('blur', () => {
255
+ textField.classList.remove('keyboard-focus', 'mouse-focus');
256
+ });
257
+ }
242
258
  });
243
259
  }
244
260
  render() {
@@ -249,13 +265,13 @@ export class PtcTextfield {
249
265
  h("div", { class: `mdc-text-field mdc-text-field--outlined mdc-text-field--no-label
250
266
  ${this.fieldId === 'contact-phone' ? 'intl-phone-adjustments' : ''}`, ref: mdcTextfield => {
251
267
  this.mdcTextfield = mdcTextfield;
252
- } }, h("span", { class: "mdc-notched-outline ptc-textfield-outline" }, h("span", { class: "mdc-notched-outline__leading" }), h("span", { class: "mdc-notched-outline__trailing" })), this.type === 'textarea' ? (h("textarea", Object.assign({}, (this.disabled ? { disabled: true } : null), { ref: customInput => {
268
+ } }, h("span", { class: "mdc-notched-outline ptc-textfield-outline" }, h("span", { class: "mdc-notched-outline__leading" }), h("span", { class: "mdc-notched-outline__trailing" })), this.type === 'textarea' ? (h("div", { class: "textarea-wrapper" }, h("textarea", Object.assign({ ref: customInput => {
253
269
  this.customInput = customInput;
254
- }, id: this.fieldId, class: this.getInputClassName() }, (this.required ? { required: true } : null), (this.ptcMaxLength ? { maxLength: this.ptcMaxLength } : null), { "aria-controls": this.fieldName, "aria-describedby": this.fieldName, "data-eloqua-name": this.ptcDataEloquaName, "data-target-eloqua-name": this.ptcDataTargetEloquaName, value: this.inputValue, name: this.fieldName, placeholder: this.placeholderText }, (this.getValidationPattern() ? { pattern: this.getValidationPattern() } : null), (this.ignoreBlindSubmit ? { ignoreBlindSubmit: true } : null), { onInput: e => this.handleInput(e) }))) : (h("input", Object.assign({}, (this.disabled ? { disabled: true } : null), { ref: customInput => {
270
+ }, id: this.fieldId, class: this.getInputClassName() }, (this.required ? { required: true } : null), (this.ptcMaxLength ? { maxLength: this.ptcMaxLength } : null), { "aria-controls": this.fieldName, "aria-describedby": this.fieldName, "data-eloqua-name": this.ptcDataEloquaName, "data-target-eloqua-name": this.ptcDataTargetEloquaName, value: this.inputValue, name: this.fieldName, placeholder: this.placeholderText }, (this.getValidationPattern() ? { pattern: this.getValidationPattern() } : null), (this.ignoreBlindSubmit ? { ignoreBlindSubmit: true } : null), { onInput: e => this.handleInput(e) })), this.ptcMaxLength ? (h("div", { class: "mdc-text-field-character-counter" }, this.inputValue.length, " / ", this.ptcMaxLength)) : null)) : (h("input", Object.assign({ ref: customInput => {
255
271
  this.customInput = customInput;
256
272
  }, id: this.fieldId }, (this.getInputClassName() ? { class: this.getInputClassName() } : null), { type: this.type }, (this.required ? { required: true } : null), (this.ptcMaxLength ? { maxLength: this.ptcMaxLength } : null), { "aria-controls": this.fieldName, "aria-describedby": this.fieldName, "data-eloqua-name": this.ptcDataEloquaName, "data-target-eloqua-name": this.ptcDataTargetEloquaName, value: this.inputValue, name: this.fieldName }, (this.getValidationPattern() ? { pattern: this.getValidationPattern() } : null), (this.ignoreBlindSubmit ? { ignoreBlindSubmit: true } : null), { placeholder: this.placeholderText })))),
257
273
  h("div", { class: `mdc-text-field-helper-line
258
- ${!!this.ptcMaxLength ? 'field-with-counter' : ''}` }, h("div", { class: "mdc-text-field-helper-text mdc-text-field-helper-text--validation-msg", id: this.fieldName }, h("svg", { class: "input-error-svg", width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, h("g", { "clip-path": "url(#clip0_12_1424)" }, h("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M11.3156 0L16 4.68444V11.3156L11.3156 16H4.68444L0 11.3156V4.68444L4.68444 0H11.3156ZM8 10.4C7.36 10.4 6.84444 10.9156 6.84444 11.5556C6.84444 12.1956 7.36 12.7111 8 12.7111C8.64 12.7111 9.15556 12.1956 9.15556 11.5556C9.15556 10.9156 8.64 10.4 8 10.4ZM8.88889 3.55556H7.11111V8.88889H8.88889V3.55556Z", fill: "#AF3231" })), h("defs", null, h("clipPath", { id: "clip0_12_1424" }, h("rect", { width: "16", height: "16", fill: "white" })))), this.helpertext), this.infoText ? h("div", { class: "mdc-text-field-helper-text mdc-text-field-helper-text--info-msg" }, this.infoText) : null, this.ptcMaxLength ? (h("div", { class: "mdc-text-field-character-counter" }, this.inputValue.length, " / ", this.ptcMaxLength)) : null),
274
+ ${!!this.ptcMaxLength ? 'field-with-counter' : ''}` }, h("div", { class: "mdc-text-field-helper-text mdc-text-field-helper-text--validation-msg", id: this.fieldName }, h("svg", { class: "input-error-svg", width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, h("g", { "clip-path": "url(#clip0_12_1424)" }, h("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M11.3156 0L16 4.68444V11.3156L11.3156 16H4.68444L0 11.3156V4.68444L4.68444 0H11.3156ZM8 10.4C7.36 10.4 6.84444 10.9156 6.84444 11.5556C6.84444 12.1956 7.36 12.7111 8 12.7111C8.64 12.7111 9.15556 12.1956 9.15556 11.5556C9.15556 10.9156 8.64 10.4 8 10.4ZM8.88889 3.55556H7.11111V8.88889H8.88889V3.55556Z", fill: "#AF3231" })), h("defs", null, h("clipPath", { id: "clip0_12_1424" }, h("rect", { width: "16", height: "16", fill: "white" })))), this.helpertext), this.infoText ? h("div", { class: "mdc-text-field-helper-text mdc-text-field-helper-text--info-msg" }, this.infoText) : null, (this.ptcMaxLength && this.type === 'text') ? (h("div", { class: "mdc-text-field-character-counter" }, this.inputValue.length, " / ", this.ptcMaxLength)) : null),
259
275
  /* Alert message */
260
276
  h("div", { class: "ptc-text-field-alert-line" }, !!this.alertText ? (h("div", { class: "mdc-text-field-helper-text--alert-msg" }, h("svg", { class: "alert-msg-svg", width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, h("g", { id: "Info", "clip-path": "url(#clip0_227_7670)" }, h("path", { id: "Vector", "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M16 8C16 12.4183 12.4183 16 8 16C3.58172 16 0 12.4183 0 8C0 3.58172 3.58172 0 8 0C12.4183 0 16 3.58172 16 8ZM9 6V13H7V6H9ZM8 5C8.55229 5 9 4.55228 9 4C9 3.44772 8.55229 3 8 3C7.44772 3 7 3.44772 7 4C7 4.55228 7.44772 5 8 5Z", fill: "#197BC0" })), h("defs", null, h("clipPath", { id: "clip0_227_7670" }, h("rect", { width: "16", height: "16", fill: "white" })))), this.alertText)) : null, !!this.alertText && this.alertTextContent ? h("div", { class: "mdc-text-field-helper-text--alert-content-msg" }, this.alertTextContent) : null),
261
277
  ]) : (h("input", { id: this.fieldId, name: this.fieldName, type: "hidden", "data-eloqua-name": this.ptcDataEloquaName, value: this.inputValue }))));