@ptcwebops/ptcw-design 4.1.9 → 4.2.2

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.
Files changed (53) hide show
  1. package/dist/cjs/{component-4dd13907.js → component-06dda623.js} +1494 -3305
  2. package/dist/cjs/component-5b5b6a98.js +1819 -0
  3. package/dist/cjs/loader.cjs.js +1 -1
  4. package/dist/cjs/ptc-accordion.cjs.entry.js +38 -3
  5. package/dist/cjs/ptc-data-lookup.cjs.entry.js +14 -11
  6. package/dist/cjs/{ptc-form-checkbox_3.cjs.entry.js → ptc-form-checkbox_2.cjs.entry.js} +1 -329
  7. package/dist/cjs/ptc-media-card.cjs.entry.js +1 -1
  8. package/dist/cjs/ptc-multi-select_2.cjs.entry.js +428 -0
  9. package/dist/cjs/ptcw-design.cjs.js +1 -1
  10. package/dist/collection/collection-manifest.json +0 -1
  11. package/dist/collection/components/ptc-accordion/ptc-accordion.css +28 -0
  12. package/dist/collection/components/ptc-accordion/ptc-accordion.js +37 -2
  13. package/dist/collection/components/ptc-data-lookup/ptc-data-lookup.js +1 -0
  14. package/dist/collection/components/ptc-media-card/ptc-media-card.css +5 -0
  15. package/dist/collection/media/svg-imgs/collapse.svg +8 -0
  16. package/dist/collection/media/svg-imgs/expand.svg +8 -0
  17. package/dist/collection/utils/elq-lib.js +11 -10
  18. package/dist/custom-elements/index.d.ts +0 -6
  19. package/dist/custom-elements/index.js +53 -101
  20. package/dist/esm/{component-9c921cc6.js → component-274da230.js} +1482 -3281
  21. package/dist/esm/component-341e4eaa.js +1802 -0
  22. package/dist/esm/loader.js +1 -1
  23. package/dist/esm/ptc-accordion.entry.js +38 -3
  24. package/dist/esm/ptc-data-lookup.entry.js +14 -11
  25. package/dist/esm/{ptc-form-checkbox_3.entry.js → ptc-form-checkbox_2.entry.js} +2 -329
  26. package/dist/esm/ptc-media-card.entry.js +1 -1
  27. package/dist/esm/ptc-multi-select_2.entry.js +423 -0
  28. package/dist/esm/ptcw-design.js +1 -1
  29. package/dist/ptcw-design/p-1b458d58.entry.js +1 -0
  30. package/dist/ptcw-design/{p-d87e7a4d.entry.js → p-480d4d18.entry.js} +1 -1
  31. package/dist/ptcw-design/p-8e266d2b.entry.js +68 -0
  32. package/dist/ptcw-design/p-ad90f926.entry.js +1 -0
  33. package/dist/ptcw-design/p-be533f0d.js +134 -0
  34. package/dist/ptcw-design/p-c1513c3f.js +203 -0
  35. package/dist/ptcw-design/p-c9c99539.entry.js +1 -0
  36. package/dist/ptcw-design/ptcw-design.esm.js +1 -1
  37. package/dist/types/components/ptc-accordion/ptc-accordion.d.ts +3 -0
  38. package/dist/types/components.d.ts +2 -13
  39. package/package.json +1 -1
  40. package/readme.md +1 -1
  41. package/dist/cjs/generic-form.cjs.entry.js +0 -89
  42. package/dist/cjs/ptc-multi-select.cjs.entry.js +0 -98
  43. package/dist/collection/components/organism-bundles/form/generic-form/generic-form-test.css +0 -84
  44. package/dist/collection/components/organism-bundles/form/generic-form/generic-form-test.js +0 -94
  45. package/dist/esm/generic-form.entry.js +0 -85
  46. package/dist/esm/ptc-multi-select.entry.js +0 -94
  47. package/dist/ptcw-design/p-21bf093a.entry.js +0 -1
  48. package/dist/ptcw-design/p-2cabc5f2.entry.js +0 -1
  49. package/dist/ptcw-design/p-81885909.entry.js +0 -68
  50. package/dist/ptcw-design/p-bcab66bf.js +0 -336
  51. package/dist/ptcw-design/p-cfa95c83.entry.js +0 -1
  52. package/dist/ptcw-design/p-d219aaf8.entry.js +0 -1
  53. package/dist/types/components/organism-bundles/form/generic-form/generic-form-test.d.ts +0 -25
@@ -1,94 +0,0 @@
1
- import { Host, h } from '@stencil/core';
2
- export class GenericForm {
3
- constructor() {
4
- this.formData = {
5
- email: '',
6
- firstName: '',
7
- lastName: '',
8
- company: '',
9
- country: '',
10
- phone: '',
11
- inquiryReason: '',
12
- howhearselfreport: '',
13
- policyChecked: false,
14
- };
15
- }
16
- // private countryEle: HTMLPtcSelectElement;
17
- // private inquiryreasonEle: HTMLPtcTextfieldElement;
18
- // private howhearselfreport: HTMLPtcTextfieldElement;
19
- componentDidLoad() {
20
- this.formButton = this.el.querySelector('.form-submit');
21
- this.formButton.addEventListener('click', this.handleSubmit.bind(this));
22
- //get Email
23
- this.emailEle = this.el.querySelector('ptc-textfield[field-id="contact-email"]');
24
- this.firstNameEle = this.el.querySelector('ptc-textfield[field-id="contact-firstname"]');
25
- this.lastNameEle = this.el.querySelector('ptc-textfield[field-id="contact-lastname"]');
26
- this.companyEle = this.el.querySelector('ptc-textfield[field-id="company"]');
27
- this.phoneEle = this.el.querySelector('ptc-textfield[field-id="contact-phone"]');
28
- // this.countryEle = this.el.querySelector('ptc-select[field-id="contact-country"]')
29
- // this.inquiryreasonEle = this.el.querySelector('ptc-textfield[field-id="contact-inquiry"]')
30
- // this.howhearselfreport = this.el.querySelector('ptc-textfield[field-id="self-reporting"]')
31
- }
32
- handleInputChange(field, value) {
33
- this.formData = Object.assign(Object.assign({}, this.formData), { [field]: value });
34
- }
35
- handleSubmit(event) {
36
- event.preventDefault();
37
- this.formData.email = this.emailEle.inputValue;
38
- this.formData.firstName = this.firstNameEle.inputValue;
39
- this.formData.lastName = this.lastNameEle.inputValue;
40
- this.formData.company = this.companyEle.inputValue;
41
- this.formData.phone = this.phoneEle.inputValue;
42
- // this.formData.country = this.countryEle.inputValue;
43
- // this.formData.inquiryReason= this.inquiryreasonEle.inputValue;
44
- // this.formData.howhearselfreport = this.howhearselfreport.inputValue;
45
- // console.log("get form Data: " + this.formData.email)
46
- if (this.isValid()) {
47
- const formSubmitEvent = new CustomEvent('formSubmit', {
48
- detail: this.formData,
49
- bubbles: true,
50
- });
51
- this.el.dispatchEvent(formSubmitEvent);
52
- console.log('Form Submitted: ' + this.formData);
53
- }
54
- else {
55
- console.log('Form validation failed');
56
- console.log('Form Submitted: ' + this.formData.email, this.formData.firstName, this.formData.lastName, this.formData.company, this.formData.phone);
57
- }
58
- }
59
- isValid() {
60
- const { email, firstName, lastName, company, country, phone, inquiryReason, howhearselfreport, policyChecked } = this.formData;
61
- const invalidLength = document.querySelectorAll('.invalid-field').length;
62
- // console.log('invalid fields length: ' + invalidLength), check the select field
63
- return (email !== '' &&
64
- phone !== '' &&
65
- firstName !== '' &&
66
- lastName !== '' &&
67
- company !== '' &&
68
- country !== '' &&
69
- inquiryReason !== '' &&
70
- howhearselfreport != '' &&
71
- policyChecked &&
72
- invalidLength === 0);
73
- }
74
- render() {
75
- return (h(Host, null, h("div", { class: "ptc-container ptc-section-standard u-flex u-flex-justify-center" }, h("div", { class: "form-wrapper" }, h("max-width-container", { "max-width": "277", breakpoint: 480 }, h("ptc-title", { type: "h2", "text-align": "center", "title-size": "x-small", "title-color": "gray", upperline: "no-upperline", "title-display": "inline-block", "title-height": "densest", "title-margin": "margin-flush", "title-weight": "w-6", "is-plm-hub": "false" }, "Please fill out the form and a PTC sales representative will be in touch."), h("ptc-spacer", { breakpoint: "x-small", size: "medium" }), h("ptc-spacer", { breakpoint: "x-small", size: "medium" }), h("ptc-spacer", { breakpoint: "small", size: "small" }), h("ptc-spacer", { breakpoint: "small", size: "small" })), h("form", { onSubmit: event => this.handleSubmit(event) }, h("ptc-textfield", { "field-id": "contact-firstname", "label-text": "First Name*", type: "text", "ptc-data-eloqua-name": "C_FirstName", "field-name": "firstname" }), h("ptc-textfield", { "field-id": "contact-lastname", "label-text": "Last Name*", type: "text", "ptc-data-eloqua-name": "C_LastName", "field-name": "lastname" }), h("ptc-textfield", { "field-id": "contact-email", "label-text": "Email*", type: "email", "alert-text": "Minimum Age Required", "alert-text-content": "If you are under the age of 14 years old, you must use your parent/guardian email address.", "ptc-data-eloqua-name": "C_EmailAddress", "field-name": "email" }), h("ptc-textfield", { "field-id": "confirm-email", "label-text": "Confirm your Email*", type: "email", "ptc-data-eloqua-name": "emailconfirmation", "field-name": "confirm-email", "custom-validation": "Email addresses must match." }), h("ptc-textfield", { "field-id": "contact-phone", "label-text": "Phone*", type: "tel", "ptc-data-eloqua-name": "C_BusPhone", "field-name": "phone" }), h("ptc-textfield", { "field-id": "contact-city", "label-text": "City*", type: "text", "ptc-data-eloqua-name": "C_City", "field-name": "contact-city" }), h("ptc-textfield", { "field-id": "contact-zipcode", "label-text": "Zip Code*", type: "text", "ptc-data-eloqua-name": "C_Zip_Postal", "field-name": "zipcode-field" }), h("ptc-select", { "field-id": "contact-country", label: "Country*", "ptc-data-eloqua-name": "C_Country", "field-name": "country" }, h("ul", { class: "mdc-list" }, h("li", { class: "mdc-list-item", "data-value": "" }, h("span", { class: "mdc-list-item__ripple" })), h("li", { class: "mdc-list-item", "data-value": "USA" }, h("span", { class: "mdc-list-item__ripple" }), h("span", { class: "mdc-list-item__text" }, "USA")), h("li", { class: "mdc-list-item", "data-value": "Canada" }, h("span", { class: "mdc-list-item__ripple" }), h("span", { class: "mdc-list-item__text" }, "Canada")), h("li", { class: "mdc-list-item", "data-value": "China" }, h("span", { class: "mdc-list-item__ripple" }), h("span", { class: "mdc-list-item__text" }, "China")))), h("ptc-textfield", { "field-id": "contact-city", "label-text": "Purpose of use*", type: "text", "ptc-data-eloqua-name": "C_City", "field-name": "contact-city" }), h("ptc-form-checkbox", { label: "I acknowledge that my personal details will be processed in accordance with PTC\u2019s privacy policy and that they may be shared with PTC Inc\u2019s subsidiaries for\r\n the promotion of PTC\u2019s products and associated services. ", "checkbox-id": "test" }), h("ptc-button", { class: "form-submit", color: "ptc-quaternary", type: "submit", styles: ":host{align-self:flex-end; margin-top: 48px; display:block; float: right; width: fit-content;}" }, "Submit"))))));
76
- }
77
- static get is() { return "generic-form"; }
78
- static get originalStyleUrls() {
79
- return {
80
- "$": ["generic-form-test.scss"]
81
- };
82
- }
83
- static get styleUrls() {
84
- return {
85
- "$": ["generic-form-test.css"]
86
- };
87
- }
88
- static get states() {
89
- return {
90
- "formData": {}
91
- };
92
- }
93
- static get elementRef() { return "el"; }
94
- }
@@ -1,85 +0,0 @@
1
- import { r as registerInstance, h, H as Host, g as getElement } from './index-c83db688.js';
2
-
3
- const genericFormTestCss = "h1,h2,h3,h4,h5,h6,p,ul,li,ptc-subnav,ptc-tab-list,ptc-link,ptc-square-card{word-break:break-word;hyphens:manual;-webkit-hyphens:manual;-moz-hyphens:manual;-ms-hyphens:manual}@supports (hyphenate-limit-chars: 12 3 3){h1,h2,h3,h4,h5,h6,p,ul,li,ptc-subnav,ptc-tab-list,ptc-link,ptc-square-card{hyphens:auto;-webkit-hyphenate-limit-before:3;-webkit-hyphenate-limit-after:3;hyphenate-limit-chars:12 3 3;hyphenate-limit-lines:2;hyphenate-limit-last:always;hyphenate-limit-zone:6%;-webkit-hyphens:auto;-webkit-hyphenate-limit-before:3;-webkit-hyphenate-limit-after:3;-webkit-hyphenate-limit-chars:12 3 3;-webkit-hyphenate-limit-lines:2;-moz-hyphens:auto;-moz-hyphenate-limit-chars:12 3 3;-moz-hyphenate-limit-lines:2;-ms-hyphens:auto;-ms-hyphenate-limit-chars:12 3 3;-ms-hyphenate-limit-lines:2}}:host{display:block}.form-wrapper{width:337px;display:flex;border-radius:3px;background:#FFF;box-shadow:0px 2px 6px 0px rgba(0, 0, 0, 0.16);flex-direction:column;align-items:center;padding:24px 0px}.form-wrapper>form{max-width:277px}.form-wrapper>ptc-button{align-items:center}.form-wrapper .ptc-label{display:block;font-size:var(--ptc-font-size-x-small);font-weight:var(--ptc-font-weight-bold);line-height:normal;margin-bottom:var(--ptc-element-spacing-04);position:relative;z-index:1;color:var(--color-gray-13)}";
4
-
5
- const GenericForm = class {
6
- constructor(hostRef) {
7
- registerInstance(this, hostRef);
8
- this.formData = {
9
- email: '',
10
- firstName: '',
11
- lastName: '',
12
- company: '',
13
- country: '',
14
- phone: '',
15
- inquiryReason: '',
16
- howhearselfreport: '',
17
- policyChecked: false,
18
- };
19
- }
20
- // private countryEle: HTMLPtcSelectElement;
21
- // private inquiryreasonEle: HTMLPtcTextfieldElement;
22
- // private howhearselfreport: HTMLPtcTextfieldElement;
23
- componentDidLoad() {
24
- this.formButton = this.el.querySelector('.form-submit');
25
- this.formButton.addEventListener('click', this.handleSubmit.bind(this));
26
- //get Email
27
- this.emailEle = this.el.querySelector('ptc-textfield[field-id="contact-email"]');
28
- this.firstNameEle = this.el.querySelector('ptc-textfield[field-id="contact-firstname"]');
29
- this.lastNameEle = this.el.querySelector('ptc-textfield[field-id="contact-lastname"]');
30
- this.companyEle = this.el.querySelector('ptc-textfield[field-id="company"]');
31
- this.phoneEle = this.el.querySelector('ptc-textfield[field-id="contact-phone"]');
32
- // this.countryEle = this.el.querySelector('ptc-select[field-id="contact-country"]')
33
- // this.inquiryreasonEle = this.el.querySelector('ptc-textfield[field-id="contact-inquiry"]')
34
- // this.howhearselfreport = this.el.querySelector('ptc-textfield[field-id="self-reporting"]')
35
- }
36
- handleInputChange(field, value) {
37
- this.formData = Object.assign(Object.assign({}, this.formData), { [field]: value });
38
- }
39
- handleSubmit(event) {
40
- event.preventDefault();
41
- this.formData.email = this.emailEle.inputValue;
42
- this.formData.firstName = this.firstNameEle.inputValue;
43
- this.formData.lastName = this.lastNameEle.inputValue;
44
- this.formData.company = this.companyEle.inputValue;
45
- this.formData.phone = this.phoneEle.inputValue;
46
- // this.formData.country = this.countryEle.inputValue;
47
- // this.formData.inquiryReason= this.inquiryreasonEle.inputValue;
48
- // this.formData.howhearselfreport = this.howhearselfreport.inputValue;
49
- // console.log("get form Data: " + this.formData.email)
50
- if (this.isValid()) {
51
- const formSubmitEvent = new CustomEvent('formSubmit', {
52
- detail: this.formData,
53
- bubbles: true,
54
- });
55
- this.el.dispatchEvent(formSubmitEvent);
56
- console.log('Form Submitted: ' + this.formData);
57
- }
58
- else {
59
- console.log('Form validation failed');
60
- console.log('Form Submitted: ' + this.formData.email, this.formData.firstName, this.formData.lastName, this.formData.company, this.formData.phone);
61
- }
62
- }
63
- isValid() {
64
- const { email, firstName, lastName, company, country, phone, inquiryReason, howhearselfreport, policyChecked } = this.formData;
65
- const invalidLength = document.querySelectorAll('.invalid-field').length;
66
- // console.log('invalid fields length: ' + invalidLength), check the select field
67
- return (email !== '' &&
68
- phone !== '' &&
69
- firstName !== '' &&
70
- lastName !== '' &&
71
- company !== '' &&
72
- country !== '' &&
73
- inquiryReason !== '' &&
74
- howhearselfreport != '' &&
75
- policyChecked &&
76
- invalidLength === 0);
77
- }
78
- render() {
79
- return (h(Host, null, h("div", { class: "ptc-container ptc-section-standard u-flex u-flex-justify-center" }, h("div", { class: "form-wrapper" }, h("max-width-container", { "max-width": "277", breakpoint: 480 }, h("ptc-title", { type: "h2", "text-align": "center", "title-size": "x-small", "title-color": "gray", upperline: "no-upperline", "title-display": "inline-block", "title-height": "densest", "title-margin": "margin-flush", "title-weight": "w-6", "is-plm-hub": "false" }, "Please fill out the form and a PTC sales representative will be in touch."), h("ptc-spacer", { breakpoint: "x-small", size: "medium" }), h("ptc-spacer", { breakpoint: "x-small", size: "medium" }), h("ptc-spacer", { breakpoint: "small", size: "small" }), h("ptc-spacer", { breakpoint: "small", size: "small" })), h("form", { onSubmit: event => this.handleSubmit(event) }, h("ptc-textfield", { "field-id": "contact-firstname", "label-text": "First Name*", type: "text", "ptc-data-eloqua-name": "C_FirstName", "field-name": "firstname" }), h("ptc-textfield", { "field-id": "contact-lastname", "label-text": "Last Name*", type: "text", "ptc-data-eloqua-name": "C_LastName", "field-name": "lastname" }), h("ptc-textfield", { "field-id": "contact-email", "label-text": "Email*", type: "email", "alert-text": "Minimum Age Required", "alert-text-content": "If you are under the age of 14 years old, you must use your parent/guardian email address.", "ptc-data-eloqua-name": "C_EmailAddress", "field-name": "email" }), h("ptc-textfield", { "field-id": "confirm-email", "label-text": "Confirm your Email*", type: "email", "ptc-data-eloqua-name": "emailconfirmation", "field-name": "confirm-email", "custom-validation": "Email addresses must match." }), h("ptc-textfield", { "field-id": "contact-phone", "label-text": "Phone*", type: "tel", "ptc-data-eloqua-name": "C_BusPhone", "field-name": "phone" }), h("ptc-textfield", { "field-id": "contact-city", "label-text": "City*", type: "text", "ptc-data-eloqua-name": "C_City", "field-name": "contact-city" }), h("ptc-textfield", { "field-id": "contact-zipcode", "label-text": "Zip Code*", type: "text", "ptc-data-eloqua-name": "C_Zip_Postal", "field-name": "zipcode-field" }), h("ptc-select", { "field-id": "contact-country", label: "Country*", "ptc-data-eloqua-name": "C_Country", "field-name": "country" }, h("ul", { class: "mdc-list" }, h("li", { class: "mdc-list-item", "data-value": "" }, h("span", { class: "mdc-list-item__ripple" })), h("li", { class: "mdc-list-item", "data-value": "USA" }, h("span", { class: "mdc-list-item__ripple" }), h("span", { class: "mdc-list-item__text" }, "USA")), h("li", { class: "mdc-list-item", "data-value": "Canada" }, h("span", { class: "mdc-list-item__ripple" }), h("span", { class: "mdc-list-item__text" }, "Canada")), h("li", { class: "mdc-list-item", "data-value": "China" }, h("span", { class: "mdc-list-item__ripple" }), h("span", { class: "mdc-list-item__text" }, "China")))), h("ptc-textfield", { "field-id": "contact-city", "label-text": "Purpose of use*", type: "text", "ptc-data-eloqua-name": "C_City", "field-name": "contact-city" }), h("ptc-form-checkbox", { label: "I acknowledge that my personal details will be processed in accordance with PTC\u2019s privacy policy and that they may be shared with PTC Inc\u2019s subsidiaries for\r\n the promotion of PTC\u2019s products and associated services. ", "checkbox-id": "test" }), h("ptc-button", { class: "form-submit", color: "ptc-quaternary", type: "submit", styles: ":host{align-self:flex-end; margin-top: 48px; display:block; float: right; width: fit-content;}" }, "Submit"))))));
80
- }
81
- get el() { return getElement(this); }
82
- };
83
- GenericForm.style = genericFormTestCss;
84
-
85
- export { GenericForm as generic_form };
@@ -1,94 +0,0 @@
1
- import { r as registerInstance, h, H as Host, g as getElement } from './index-c83db688.js';
2
- import { V as ValidationMessages } from './validation-messages-ffe89594.js';
3
- import { c as getLanguageFromURL } from './utils-2595f251.js';
4
-
5
- const ptcMultiSelectCss = "h1,h2,h3,h4,h5,h6,p,ul,li,ptc-subnav,ptc-tab-list,ptc-link,ptc-square-card{word-break:break-word;hyphens:manual;-webkit-hyphens:manual;-moz-hyphens:manual;-ms-hyphens:manual}@supports (hyphenate-limit-chars: 12 3 3){h1,h2,h3,h4,h5,h6,p,ul,li,ptc-subnav,ptc-tab-list,ptc-link,ptc-square-card{hyphens:auto;-webkit-hyphenate-limit-before:3;-webkit-hyphenate-limit-after:3;hyphenate-limit-chars:12 3 3;hyphenate-limit-lines:2;hyphenate-limit-last:always;hyphenate-limit-zone:6%;-webkit-hyphens:auto;-webkit-hyphenate-limit-before:3;-webkit-hyphenate-limit-after:3;-webkit-hyphenate-limit-chars:12 3 3;-webkit-hyphenate-limit-lines:2;-moz-hyphens:auto;-moz-hyphenate-limit-chars:12 3 3;-moz-hyphenate-limit-lines:2;-ms-hyphens:auto;-ms-hyphenate-limit-chars:12 3 3;-ms-hyphenate-limit-lines:2}}.ptc-multi-select{position:relative;display:block;margin-bottom:var(--ptc-element-spacing-04)}.ptc-multi-select.invalid::before{content:\"\";position:absolute;width:calc(100% + 16px);height:calc(100% + 8px);background:#FEF3F3;display:flex;flex-direction:column;justify-content:center;z-index:0;left:50%;top:50%;transform:translate(-50%, -50%)}.ptc-multi-select.invalid .mdc-select-helper-text--validation-msg{z-index:2;opacity:1;position:relative;color:#AF3231;font-family:var(--ptc-font-latin);font-size:var(--ptc-font-size-xx-small);font-style:normal;font-weight:var(--ptc-font-weight-semibold);line-height:var(--ptc-line-height-densest);opacity:1;height:auto;margin-left:8px;margin-top:var(--ptc-element-spacing-02)}.ptc-multi-select.invalid .mdc-select-helper-text--validation-msg svg{transform:translate(-8px, 3px)}.ptc-multi-select .multi-select-label{display:block;font-size:var(--ptc-font-size-xx-small);font-weight:var(--ptc-font-weight-semibold);line-height:normal;margin-bottom:var(--ptc-element-spacing-01);z-index:1;position:relative;color:#40434A}.ptc-multi-select .selected-items{cursor:pointer;background-color:#fff;border:1px solid rgba(0, 0, 0, 0.38);padding:8px;border-radius:0px;position:relative;user-select:none;color:rgba(0, 0, 0, 0.87);font-weight:400;font-size:16px;font-family:var(--mdc-typography-subtitle1-font-family, var(--mdc-typography-font-family, Roboto, sans-serif))}.ptc-multi-select .multi-select-icon{fill:rgba(0, 0, 0, 0.54);position:absolute;right:var(--ptc-element-spacing-03)}.ptc-multi-select .dropdown{display:block;list-style:none;padding:0;margin:0;border:1px solid #ccc;max-height:200px;overflow-y:auto;position:absolute;width:100%;background-color:#fff;z-index:1000;}.ptc-multi-select .dropdown li{display:flex;align-items:center;padding:8px 10px;cursor:pointer}.ptc-multi-select .dropdown li:hover{background-color:var(--color-gray-02)}.ptc-multi-select .dropdown li.selected{background-color:var(--color-gray-02)}.ptc-multi-select .dropdown li.selected:hover{background-color:var(--color-gray-04)}.ptc-multi-select .dropdown li label{margin-left:8px;font-size:var(--ptc-font-size-xx-small);position:relative;padding-left:25px;cursor:pointer}.ptc-multi-select .dropdown li:last-child{border-bottom:none}.ptc-multi-select .dropdown input[type=checkbox]{position:absolute;opacity:0;cursor:pointer}.ptc-multi-select .dropdown input[type=checkbox]:checked{background-color:var(--color-green-07)}.ptc-multi-select .dropdown label::before{content:\"\";position:absolute;left:0;top:0;width:14px;height:14px;background-color:#fff;border:1px solid #ccc;box-sizing:border-box}.ptc-multi-select .dropdown input[type=checkbox]:checked+label::before{background-color:var(--color-green-07);border-color:var(--color-green-07)}.ptc-multi-select .dropdown input[type=checkbox]:checked+label::after{content:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='white' viewBox='0 0 16 16'%3E%3Cpath fill-rule='evenodd' d='M13.78 4.22a.75.75 0 0 1 0 1.06l-7.25 7.25a.75.75 0 0 1-1.06 0L2.22 9.28a.75.75 0 1 1 1.06-1.06L6 10.94l6.72-6.72a.75.75 0 0 1 1.06 0z'/%3E%3C/svg%3E\");position:absolute;left:1px;top:1px;font-size:var(--ptc-font-size-xxx-small);color:white}.ptc-multi-select button.ddl-click-text{all:unset;cursor:pointer;color:var(--color-gray-7);padding-left:8px;text-decoration:underline;font-size:var(--ptc-font-size-xx-small);font-weight:var(--ptc-font-weight-semibold)}";
6
-
7
- const PtcMultiSelect = class {
8
- constructor(hostRef) {
9
- registerInstance(this, hostRef);
10
- this.handleBlur = () => {
11
- this.updateValidity();
12
- };
13
- this.updateValidity = () => {
14
- if (this.isRequired) {
15
- this.isValid = this.selectedItemsCount > 0;
16
- }
17
- else {
18
- this.isValid = true;
19
- }
20
- };
21
- this.selectAllItems = (event) => {
22
- event.preventDefault();
23
- event.stopPropagation();
24
- this.items = this.items.map(item => (Object.assign(Object.assign({}, item), { selected: true })));
25
- // this.selectedItemsCount = this.items.filter(item => item.selected).length;
26
- // this.updateValidity();
27
- };
28
- this.clearSelectedItems = (event) => {
29
- event.preventDefault();
30
- event.stopPropagation();
31
- this.items = this.items.map(item => (Object.assign(Object.assign({}, item), { selected: false })));
32
- // this.selectedItemsCount = this.items.filter(item => item.selected).length;
33
- // this.updateValidity();
34
- };
35
- this.items = [
36
- // Initialize with your items, setting 'selected' to false
37
- { text: 'Lorem Ipsum dolor sit amet', selected: false, ptcDataEloquaName: 'data-elqua-name', ptcDataTargetEloquaName: 'data-target-eloqua-name' },
38
- ];
39
- this.label = 'label';
40
- this.selectAllText = 'Select All';
41
- this.clearAllText = 'Clear Selected Items';
42
- this.isRequired = false;
43
- this.helpertext = 'This field is required';
44
- this.showDropdown = false;
45
- this.language = 'en';
46
- this.isValid = true;
47
- this.selectedItemsCount = 0;
48
- }
49
- componentWillLoad() {
50
- this.language = getLanguageFromURL();
51
- // this.selectedItemsCount = this.items.filter(item => item.selected).length;
52
- // this.updateValidity();
53
- }
54
- handleDocumentClick(event) {
55
- const clickedInside = this.el.contains(event.target);
56
- if (!clickedInside) {
57
- this.showDropdown = false;
58
- this.selectedItemsCount = this.items.filter(item => item.selected).length;
59
- this.updateValidity();
60
- }
61
- }
62
- toggleDropdown() {
63
- this.showDropdown = !this.showDropdown;
64
- }
65
- toggleItemSelection(index) {
66
- this.items = [...this.items.slice(0, index), Object.assign(Object.assign({}, this.items[index]), { selected: !this.items[index].selected }), ...this.items.slice(index + 1)];
67
- // this.selectedItemsCount = this.items.filter(item => item.selected).length;
68
- // this.updateValidity();
69
- }
70
- getValidationMessage(type) {
71
- return ValidationMessages[this.language][type];
72
- }
73
- setHelperText() {
74
- this.helpertext = this.getValidationMessage('required');
75
- }
76
- render() {
77
- const selectedItems = this.items.filter(item => item.selected);
78
- const selectedItemsCount = selectedItems.length;
79
- const buttonLabel = selectedItemsCount > 0 ? this.clearAllText : this.selectAllText;
80
- const buttonAction = selectedItemsCount > 0 ? this.clearSelectedItems : this.selectAllItems;
81
- let displayText = `${selectedItemsCount} selected`;
82
- if (selectedItemsCount === 1) {
83
- displayText = selectedItems[0].text;
84
- }
85
- return (h(Host, { class: { 'ptc-multi-select': true, 'invalid': !this.isValid } }, h("label", { class: "multi-select-label" }, this.label), h("div", { class: "selected-items", onClick: () => this.toggleDropdown() }, displayText, h("span", { class: "multi-select-icon" }, h("svg", { class: "", width: "20", height: "12", viewBox: "0 0 10 10", xmlns: "http://www.w3.org/2000/svg" }, h("path", { d: "M1.375 1.875L5 5.5L8.625 1.875L9.9375 3.1875L5 8.125L0.0625 3.1875L1.375 1.875Z" })))), this.showDropdown && (h("ul", { class: "dropdown" }, h("li", null, h("button", { onClick: event => buttonAction(event), class: "ddl-click-text" }, buttonLabel)), this.items.map((item, index) => (h("li", { key: index, class: { selected: item.selected } }, h("input", { class: "multi-checkbox", type: "checkbox", id: `checkbox-${index}`, checked: item.selected, "data-eloqua-name": item.ptcDataEloquaName, "data-target-eloqua-name": item.ptcDataTargetEloquaName, required: this.isRequired, onClick: event => {
86
- event.stopPropagation(); // Prevents the dropdown from closing
87
- this.toggleItemSelection(index);
88
- } }), h("label", { htmlFor: `checkbox-${index}` }, item.text)))))), h("div", { id: "tbd", class: "mdc-select-helper-text mdc-select-helper-text--validation-msg" }, h("svg", { class: "select-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)));
89
- }
90
- get el() { return getElement(this); }
91
- };
92
- PtcMultiSelect.style = ptcMultiSelectCss;
93
-
94
- export { PtcMultiSelect as ptc_multi_select };
@@ -1 +0,0 @@
1
- import{r as t,h,H as e,g as i}from"./p-ac75c7ad.js";const s=class{constructor(h){t(this,h),this.multiple=!1,this.theme="standard"}componentWillLoad(){this.items=this.el.querySelectorAll(":scope > ptc-accordion-item"),this.items.forEach((t=>{t.setAttribute("theme",this.theme)})),this.multiple||(this.activeItem=this.el.querySelector(":scope > ptc-accordion-item[active]"),this.activeItem&&this.activeItem.open(),this.closeNonActive())}openHandler(t){t.stopPropagation(),this.multiple||(this.activeItem=t.target,this.closeNonActive())}closeNonActive(){this.items.forEach((t=>{t.isEqualNode(this.activeItem)||t.close()}))}render(){return h(e,null,h("slot",null))}get el(){return i(this)}};s.style="h1,h2,h3,h4,h5,h6,p,ul,li,ptc-subnav,ptc-tab-list,ptc-link,ptc-square-card{word-break:break-word;hyphens:manual;-webkit-hyphens:manual;-moz-hyphens:manual;-ms-hyphens:manual}@supports (hyphenate-limit-chars: 12 3 3){h1,h2,h3,h4,h5,h6,p,ul,li,ptc-subnav,ptc-tab-list,ptc-link,ptc-square-card{hyphens:auto;-webkit-hyphenate-limit-before:3;-webkit-hyphenate-limit-after:3;hyphenate-limit-chars:12 3 3;hyphenate-limit-lines:2;hyphenate-limit-last:always;hyphenate-limit-zone:6%;-webkit-hyphens:auto;-webkit-hyphenate-limit-before:3;-webkit-hyphenate-limit-after:3;-webkit-hyphenate-limit-chars:12 3 3;-webkit-hyphenate-limit-lines:2;-moz-hyphens:auto;-moz-hyphenate-limit-chars:12 3 3;-moz-hyphenate-limit-lines:2;-ms-hyphens:auto;-ms-hyphenate-limit-chars:12 3 3;-ms-hyphenate-limit-lines:2}}:host{--ptc-accordion-item-body-max-height:100vh}";export{s as ptc_accordion}
@@ -1 +0,0 @@
1
- import{r as t,h as e,H as i,g as l}from"./p-ac75c7ad.js";import{V as o}from"./p-af3bb40d.js";import{c as s}from"./p-515f6adb.js";const a=class{constructor(e){t(this,e),this.handleBlur=()=>{this.updateValidity()},this.updateValidity=()=>{this.isValid=!this.isRequired||this.selectedItemsCount>0},this.selectAllItems=t=>{t.preventDefault(),t.stopPropagation(),this.items=this.items.map((t=>Object.assign(Object.assign({},t),{selected:!0})))},this.clearSelectedItems=t=>{t.preventDefault(),t.stopPropagation(),this.items=this.items.map((t=>Object.assign(Object.assign({},t),{selected:!1})))},this.items=[{text:"Lorem Ipsum dolor sit amet",selected:!1,ptcDataEloquaName:"data-elqua-name",ptcDataTargetEloquaName:"data-target-eloqua-name"}],this.label="label",this.selectAllText="Select All",this.clearAllText="Clear Selected Items",this.isRequired=!1,this.helpertext="This field is required",this.showDropdown=!1,this.language="en",this.isValid=!0,this.selectedItemsCount=0}componentWillLoad(){this.language=s()}handleDocumentClick(t){this.el.contains(t.target)||(this.showDropdown=!1,this.selectedItemsCount=this.items.filter((t=>t.selected)).length,this.updateValidity())}toggleDropdown(){this.showDropdown=!this.showDropdown}toggleItemSelection(t){this.items=[...this.items.slice(0,t),Object.assign(Object.assign({},this.items[t]),{selected:!this.items[t].selected}),...this.items.slice(t+1)]}getValidationMessage(t){return o[this.language][t]}setHelperText(){this.helpertext=this.getValidationMessage("required")}render(){const t=this.items.filter((t=>t.selected)),l=t.length,o=l>0?this.clearAllText:this.selectAllText,s=l>0?this.clearSelectedItems:this.selectAllItems;let a=`${l} selected`;return 1===l&&(a=t[0].text),e(i,{class:{"ptc-multi-select":!0,invalid:!this.isValid}},e("label",{class:"multi-select-label"},this.label),e("div",{class:"selected-items",onClick:()=>this.toggleDropdown()},a,e("span",{class:"multi-select-icon"},e("svg",{class:"",width:"20",height:"12",viewBox:"0 0 10 10",xmlns:"http://www.w3.org/2000/svg"},e("path",{d:"M1.375 1.875L5 5.5L8.625 1.875L9.9375 3.1875L5 8.125L0.0625 3.1875L1.375 1.875Z"})))),this.showDropdown&&e("ul",{class:"dropdown"},e("li",null,e("button",{onClick:t=>s(t),class:"ddl-click-text"},o)),this.items.map(((t,i)=>e("li",{key:i,class:{selected:t.selected}},e("input",{class:"multi-checkbox",type:"checkbox",id:`checkbox-${i}`,checked:t.selected,"data-eloqua-name":t.ptcDataEloquaName,"data-target-eloqua-name":t.ptcDataTargetEloquaName,required:this.isRequired,onClick:t=>{t.stopPropagation(),this.toggleItemSelection(i)}}),e("label",{htmlFor:`checkbox-${i}`},t.text))))),e("div",{id:"tbd",class:"mdc-select-helper-text mdc-select-helper-text--validation-msg"},e("svg",{class:"select-error-svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e("g",{"clip-path":"url(#clip0_12_1424)"},e("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"})),e("defs",null,e("clipPath",{id:"clip0_12_1424"},e("rect",{width:"16",height:"16",fill:"white"})))),this.helpertext))}get el(){return l(this)}};a.style="h1,h2,h3,h4,h5,h6,p,ul,li,ptc-subnav,ptc-tab-list,ptc-link,ptc-square-card{word-break:break-word;hyphens:manual;-webkit-hyphens:manual;-moz-hyphens:manual;-ms-hyphens:manual}@supports (hyphenate-limit-chars: 12 3 3){h1,h2,h3,h4,h5,h6,p,ul,li,ptc-subnav,ptc-tab-list,ptc-link,ptc-square-card{hyphens:auto;-webkit-hyphenate-limit-before:3;-webkit-hyphenate-limit-after:3;hyphenate-limit-chars:12 3 3;hyphenate-limit-lines:2;hyphenate-limit-last:always;hyphenate-limit-zone:6%;-webkit-hyphens:auto;-webkit-hyphenate-limit-before:3;-webkit-hyphenate-limit-after:3;-webkit-hyphenate-limit-chars:12 3 3;-webkit-hyphenate-limit-lines:2;-moz-hyphens:auto;-moz-hyphenate-limit-chars:12 3 3;-moz-hyphenate-limit-lines:2;-ms-hyphens:auto;-ms-hyphenate-limit-chars:12 3 3;-ms-hyphenate-limit-lines:2}}.ptc-multi-select{position:relative;display:block;margin-bottom:var(--ptc-element-spacing-04)}.ptc-multi-select.invalid::before{content:\"\";position:absolute;width:calc(100% + 16px);height:calc(100% + 8px);background:#FEF3F3;display:flex;flex-direction:column;justify-content:center;z-index:0;left:50%;top:50%;transform:translate(-50%, -50%)}.ptc-multi-select.invalid .mdc-select-helper-text--validation-msg{z-index:2;opacity:1;position:relative;color:#AF3231;font-family:var(--ptc-font-latin);font-size:var(--ptc-font-size-xx-small);font-style:normal;font-weight:var(--ptc-font-weight-semibold);line-height:var(--ptc-line-height-densest);opacity:1;height:auto;margin-left:8px;margin-top:var(--ptc-element-spacing-02)}.ptc-multi-select.invalid .mdc-select-helper-text--validation-msg svg{transform:translate(-8px, 3px)}.ptc-multi-select .multi-select-label{display:block;font-size:var(--ptc-font-size-xx-small);font-weight:var(--ptc-font-weight-semibold);line-height:normal;margin-bottom:var(--ptc-element-spacing-01);z-index:1;position:relative;color:#40434A}.ptc-multi-select .selected-items{cursor:pointer;background-color:#fff;border:1px solid rgba(0, 0, 0, 0.38);padding:8px;border-radius:0px;position:relative;user-select:none;color:rgba(0, 0, 0, 0.87);font-weight:400;font-size:16px;font-family:var(--mdc-typography-subtitle1-font-family, var(--mdc-typography-font-family, Roboto, sans-serif))}.ptc-multi-select .multi-select-icon{fill:rgba(0, 0, 0, 0.54);position:absolute;right:var(--ptc-element-spacing-03)}.ptc-multi-select .dropdown{display:block;list-style:none;padding:0;margin:0;border:1px solid #ccc;max-height:200px;overflow-y:auto;position:absolute;width:100%;background-color:#fff;z-index:1000;}.ptc-multi-select .dropdown li{display:flex;align-items:center;padding:8px 10px;cursor:pointer}.ptc-multi-select .dropdown li:hover{background-color:var(--color-gray-02)}.ptc-multi-select .dropdown li.selected{background-color:var(--color-gray-02)}.ptc-multi-select .dropdown li.selected:hover{background-color:var(--color-gray-04)}.ptc-multi-select .dropdown li label{margin-left:8px;font-size:var(--ptc-font-size-xx-small);position:relative;padding-left:25px;cursor:pointer}.ptc-multi-select .dropdown li:last-child{border-bottom:none}.ptc-multi-select .dropdown input[type=checkbox]{position:absolute;opacity:0;cursor:pointer}.ptc-multi-select .dropdown input[type=checkbox]:checked{background-color:var(--color-green-07)}.ptc-multi-select .dropdown label::before{content:\"\";position:absolute;left:0;top:0;width:14px;height:14px;background-color:#fff;border:1px solid #ccc;box-sizing:border-box}.ptc-multi-select .dropdown input[type=checkbox]:checked+label::before{background-color:var(--color-green-07);border-color:var(--color-green-07)}.ptc-multi-select .dropdown input[type=checkbox]:checked+label::after{content:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='white' viewBox='0 0 16 16'%3E%3Cpath fill-rule='evenodd' d='M13.78 4.22a.75.75 0 0 1 0 1.06l-7.25 7.25a.75.75 0 0 1-1.06 0L2.22 9.28a.75.75 0 1 1 1.06-1.06L6 10.94l6.72-6.72a.75.75 0 0 1 1.06 0z'/%3E%3C/svg%3E\");position:absolute;left:1px;top:1px;font-size:var(--ptc-font-size-xxx-small);color:white}.ptc-multi-select button.ddl-click-text{all:unset;cursor:pointer;color:var(--color-gray-7);padding-left:8px;text-decoration:underline;font-size:var(--ptc-font-size-xx-small);font-weight:var(--ptc-font-weight-semibold)}";export{a as ptc_multi_select}