@ptcwebops/ptcw-design 0.2.2 → 0.2.4

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 (129) hide show
  1. package/dist/cjs/icon-asset.cjs.entry.js +64 -0
  2. package/dist/cjs/{index-ac192914.js → index-0b899fc6.js} +158 -87
  3. package/dist/cjs/list-item.cjs.entry.js +2 -2
  4. package/dist/cjs/loader.cjs.js +3 -3
  5. package/dist/cjs/lottie-player.cjs.entry.js +2 -2
  6. package/dist/cjs/my-component.cjs.entry.js +3 -3
  7. package/dist/cjs/ptc-announcement.cjs.entry.js +35 -0
  8. package/dist/cjs/ptc-avatar.cjs.entry.js +2 -2
  9. package/dist/cjs/ptc-button_2.cjs.entry.js +97 -0
  10. package/dist/cjs/ptc-card.cjs.entry.js +2 -2
  11. package/dist/cjs/ptc-countdown.cjs.entry.js +2 -2
  12. package/dist/cjs/ptc-date.cjs.entry.js +2 -2
  13. package/dist/cjs/ptc-footer.cjs.entry.js +2 -2
  14. package/dist/cjs/ptc-form_3.cjs.entry.js +171 -0
  15. package/dist/cjs/ptc-img.cjs.entry.js +2 -2
  16. package/dist/cjs/ptc-link.cjs.entry.js +2 -2
  17. package/dist/cjs/ptc-list.cjs.entry.js +2 -2
  18. package/dist/cjs/ptc-lottie.cjs.entry.js +2 -2
  19. package/dist/cjs/ptc-nav-item.cjs.entry.js +2 -2
  20. package/dist/cjs/ptc-nav.cjs.entry.js +2 -2
  21. package/dist/cjs/ptc-overlay.cjs.entry.js +2 -2
  22. package/dist/cjs/ptc-para.cjs.entry.js +40 -0
  23. package/dist/cjs/ptc-picture.cjs.entry.js +2 -2
  24. package/dist/cjs/ptc-spacer.cjs.entry.js +2 -2
  25. package/dist/cjs/ptc-span.cjs.entry.js +2 -2
  26. package/dist/cjs/ptc-title.cjs.entry.js +3 -3
  27. package/dist/cjs/ptcw-design.cjs.js +3 -3
  28. package/dist/collection/collection-manifest.json +5 -2
  29. package/dist/collection/components/my-component/my-component.js +2 -3
  30. package/dist/collection/components/ptc-announcement/ptc-announcement.js +2 -2
  31. package/dist/collection/components/ptc-button/ptc-button.js +2 -2
  32. package/dist/collection/components/ptc-form/ptc-form.css +3 -0
  33. package/dist/collection/components/ptc-form/ptc-form.js +118 -0
  34. package/dist/collection/components/ptc-form/validation/FormValidation.full.min.js +1 -0
  35. package/dist/collection/components/ptc-form/validation/FormValidation.js +4234 -0
  36. package/dist/collection/components/ptc-input/ptc-input.css +47 -0
  37. package/dist/collection/components/ptc-input/ptc-input.js +133 -80
  38. package/dist/collection/components/ptc-select/ptc-select.css +22 -0
  39. package/dist/collection/components/ptc-select/ptc-select.js +105 -0
  40. package/dist/collection/components/ptc-title/ptc-title.js +1 -1
  41. package/dist/custom-elements/index.d.ts +19 -1
  42. package/dist/custom-elements/index.js +220 -50
  43. package/dist/esm/icon-asset.entry.js +60 -0
  44. package/dist/esm/{index-7a3883ee.js → index-eb8ce23d.js} +159 -88
  45. package/dist/esm/list-item.entry.js +2 -2
  46. package/dist/esm/loader.js +3 -3
  47. package/dist/esm/lottie-player.entry.js +2 -2
  48. package/dist/esm/my-component.entry.js +3 -3
  49. package/dist/esm/ptc-announcement.entry.js +31 -0
  50. package/dist/esm/ptc-avatar.entry.js +2 -2
  51. package/dist/esm/ptc-button_2.entry.js +92 -0
  52. package/dist/esm/ptc-card.entry.js +2 -2
  53. package/dist/esm/ptc-countdown.entry.js +2 -2
  54. package/dist/esm/ptc-date.entry.js +2 -2
  55. package/dist/esm/ptc-footer.entry.js +2 -2
  56. package/dist/esm/ptc-form_3.entry.js +165 -0
  57. package/dist/esm/ptc-img.entry.js +2 -2
  58. package/dist/esm/ptc-link.entry.js +2 -2
  59. package/dist/esm/ptc-list.entry.js +2 -2
  60. package/dist/esm/ptc-lottie.entry.js +2 -2
  61. package/dist/esm/ptc-nav-item.entry.js +2 -2
  62. package/dist/esm/ptc-nav.entry.js +2 -2
  63. package/dist/esm/ptc-overlay.entry.js +2 -2
  64. package/dist/esm/ptc-para.entry.js +36 -0
  65. package/dist/esm/ptc-picture.entry.js +2 -2
  66. package/dist/esm/ptc-spacer.entry.js +2 -2
  67. package/dist/esm/ptc-span.entry.js +2 -2
  68. package/dist/esm/ptc-title.entry.js +3 -3
  69. package/dist/esm/ptcw-design.js +3 -3
  70. package/dist/ptcw-design/p-01243ce4.entry.js +1 -0
  71. package/dist/ptcw-design/p-01f4bf71.entry.js +1 -0
  72. package/dist/ptcw-design/p-1b3b0193.entry.js +1 -0
  73. package/dist/ptcw-design/p-22fd400f.entry.js +1 -0
  74. package/dist/ptcw-design/p-23d07898.entry.js +1 -0
  75. package/dist/ptcw-design/p-2b59ce7a.entry.js +1 -0
  76. package/dist/ptcw-design/p-2ca3c085.js +1 -0
  77. package/dist/ptcw-design/p-389a5670.entry.js +1 -0
  78. package/dist/ptcw-design/p-3f42afb6.entry.js +1 -0
  79. package/dist/ptcw-design/p-51443fbb.entry.js +1 -0
  80. package/dist/ptcw-design/p-54794e45.entry.js +1 -0
  81. package/dist/ptcw-design/p-5ae43421.entry.js +1 -0
  82. package/dist/ptcw-design/p-63b55aba.entry.js +1 -0
  83. package/dist/ptcw-design/p-6b5c0d9d.entry.js +1 -0
  84. package/dist/ptcw-design/p-7076b32f.entry.js +1 -0
  85. package/dist/ptcw-design/{p-51a3e9e6.entry.js → p-75dc7328.entry.js} +1 -1
  86. package/dist/ptcw-design/p-945f5a15.entry.js +1 -0
  87. package/dist/ptcw-design/p-a86452af.entry.js +1 -0
  88. package/dist/ptcw-design/p-cf3d92e0.entry.js +1 -0
  89. package/dist/ptcw-design/p-d3f9852f.entry.js +1 -0
  90. package/dist/ptcw-design/p-d80b24c9.entry.js +1 -0
  91. package/dist/ptcw-design/p-e4b96b46.entry.js +1 -0
  92. package/dist/ptcw-design/p-eda0500f.entry.js +1 -0
  93. package/dist/ptcw-design/p-ef6acb81.entry.js +1 -0
  94. package/dist/ptcw-design/p-fd29d9dd.entry.js +1 -0
  95. package/dist/ptcw-design/ptcw-design.css +1 -1
  96. package/dist/ptcw-design/ptcw-design.esm.js +1 -1
  97. package/dist/ptcw-design/validation/FormValidation.full.min.js +1 -0
  98. package/dist/ptcw-design/validation/FormValidation.js +4234 -0
  99. package/dist/types/components/ptc-form/ptc-form.d.ts +11 -0
  100. package/dist/types/components/ptc-input/ptc-input.d.ts +19 -0
  101. package/dist/types/components/ptc-select/ptc-select.d.ts +9 -0
  102. package/dist/types/components.d.ts +63 -0
  103. package/dist/types/global.d.ts +1072 -0
  104. package/dist/types/stencil-public-runtime.d.ts +189 -186
  105. package/loader/index.d.ts +0 -1
  106. package/package.json +6 -2
  107. package/readme.md +1 -1
  108. package/dist/cjs/icon-asset_5.cjs.entry.js +0 -218
  109. package/dist/esm/icon-asset_5.entry.js +0 -210
  110. package/dist/ptcw-design/p-0c8df906.entry.js +0 -1
  111. package/dist/ptcw-design/p-186beb2c.entry.js +0 -1
  112. package/dist/ptcw-design/p-2d5f8cff.entry.js +0 -1
  113. package/dist/ptcw-design/p-50923c9a.js +0 -1
  114. package/dist/ptcw-design/p-62706e4e.entry.js +0 -1
  115. package/dist/ptcw-design/p-66ffa30c.entry.js +0 -1
  116. package/dist/ptcw-design/p-6b1a35e1.entry.js +0 -1
  117. package/dist/ptcw-design/p-73e2418e.entry.js +0 -1
  118. package/dist/ptcw-design/p-796b8287.entry.js +0 -1
  119. package/dist/ptcw-design/p-8edac972.entry.js +0 -1
  120. package/dist/ptcw-design/p-90402319.entry.js +0 -1
  121. package/dist/ptcw-design/p-919311d2.entry.js +0 -1
  122. package/dist/ptcw-design/p-ac449734.entry.js +0 -1
  123. package/dist/ptcw-design/p-d17b386a.entry.js +0 -1
  124. package/dist/ptcw-design/p-d44c44e6.entry.js +0 -1
  125. package/dist/ptcw-design/p-d6553853.entry.js +0 -1
  126. package/dist/ptcw-design/p-ef250898.entry.js +0 -1
  127. package/dist/ptcw-design/p-f694e46a.entry.js +0 -1
  128. package/dist/ptcw-design/p-f80152dc.entry.js +0 -1
  129. package/dist/ptcw-design/p-ff28ce2d.entry.js +0 -1
@@ -0,0 +1,47 @@
1
+ :host {
2
+ display: block;
3
+ }
4
+
5
+ .form-group {
6
+ position: relative;
7
+ }
8
+
9
+ .ptc-input {
10
+ width: -webkit-fill-available;
11
+ width: -moz-available;
12
+ width: stretch;
13
+ display: block;
14
+ padding: 6px 12px;
15
+ border: none;
16
+ border-bottom: 1px solid #3b4550;
17
+ padding-left: 20px;
18
+ box-shadow: 1px 1px 25px 0 rgba(0, 0, 0, 0.16);
19
+ border-top-left-radius: 5px;
20
+ border-top-right-radius: 5px;
21
+ border-bottom-left-radius: 0;
22
+ border-bottom-right-radius: 0;
23
+ font-size: 16px;
24
+ color: #707070;
25
+ padding-top: 14px;
26
+ background: #fff;
27
+ }
28
+
29
+ .floating-label {
30
+ position: absolute;
31
+ left: 0;
32
+ bottom: 0;
33
+ transform: translate(20px, -10px);
34
+ font-family: Raleway;
35
+ font-size: 16px;
36
+ font-weight: 500;
37
+ line-height: 1.07;
38
+ text-align: left;
39
+ transition: all 0.4s ease-in-out;
40
+ }
41
+
42
+ .focused + .floating-label {
43
+ font-size: 10px;
44
+ font-weight: 700;
45
+ line-height: 1.5;
46
+ transform: translate(20px, -24px);
47
+ }
@@ -1,80 +1,133 @@
1
- // import { Component, Host, h, Prop, Event, EventEmitter, State } from '@stencil/core';
2
- // @Component({
3
- // tag: 'ptc-input',
4
- // styleUrl: 'ptc-input.scss',
5
- // shadow: true,
6
- // })
7
- // export class PtcInput {
8
- // /**
9
- // * The type of control to display. The default type is text.
10
- // */
11
- // @Prop() type: string = 'text';
12
- // /**
13
- // * The name of the control, which is submitted with the form data.
14
- // */
15
- // @Prop() name: string = '';
16
- // /**
17
- // * If `true`, the user must fill in a value before submitting a form.
18
- // */
19
- // @Prop() required = false;
20
- // /**
21
- // * The value of the input.
22
- // */
23
- // @Prop({ mutable: true }) value?: string | null = '';
24
- // /**
25
- // * Takes the entire width of the row
26
- // */
27
- // @Prop() block?: boolean = false;
28
- // /**
29
- // * Label for input
30
- // */
31
- // @Prop() label?: string;
32
- // @State() error: string = '';
33
- // /**
34
- // * Emitted when a keyboard input occurred.
35
- // */
36
- // @Event() inputEvent!: EventEmitter<KeyboardEvent>;
37
- // /**
38
- // * Emitted when the value has changed.
39
- // */
40
- // @Event() changeEvent!: EventEmitter<any>;
41
- // /**
42
- // * Emitted when the input loses focus.
43
- // */
44
- // @Event() blurEvent!: EventEmitter<void>;
45
- // /**
46
- // * Emitted when the input has focus.
47
- // */
48
- // @Event() focusEvent!: EventEmitter<void>;
49
- // /**
50
- // * Emitted when a key is pressed down
51
- // */
52
- // @Event() keyDownEvent: EventEmitter<void>;
53
- // render() {
54
- // return (
55
- // <Host>
56
- // <label>
57
- // Name:
58
- // <input type={this.type} value={this.value} onInput={this.onInput} />
59
- // </label>
60
- // </Host>
61
- // );
62
- // }
63
- // private onInput = (ev: Event) => {
64
- // const input = ev.target as HTMLInputElement | null;
65
- // if (input) {
66
- // this.value = input.value || '';
67
- // }
68
- // for (var key in input.validity) {
69
- // if (input.validity[key]) {
70
- // if (key === 'valid') {
71
- // this.error = '';
72
- // break;
73
- // }
74
- // //this.error = validityMessages(this)[key] || '' // "" catch all
75
- // break;
76
- // }
77
- // }
78
- // this.inputEvent.emit(ev as KeyboardEvent);
79
- // };
80
- // }
1
+ import { Component, h, Prop, Event, State } from '@stencil/core';
2
+ export class PtcInput {
3
+ constructor() {
4
+ this.focused = false;
5
+ this.onBlur = () => {
6
+ this.blurEvent.emit();
7
+ this.focused = false;
8
+ };
9
+ this.onFocus = () => {
10
+ this.focusEvent.emit();
11
+ this.focused = true;
12
+ };
13
+ }
14
+ render() {
15
+ const focusState = this.focused ? ' focused' : '';
16
+ return (h("div", { class: "form-group" },
17
+ h("input", { type: this.type, id: this.inputId, class: `ptc-input form-control${focusState}`, "data-eloqua-name": this.dataEloquaName, name: this.inputName, onBlur: this.onBlur, onFocus: this.onFocus }),
18
+ h("label", { htmlFor: this.inputId, class: "floating-label" },
19
+ h("slot", null))));
20
+ }
21
+ static get is() { return "ptc-input"; }
22
+ static get encapsulation() { return "scoped"; }
23
+ static get originalStyleUrls() { return {
24
+ "$": ["ptc-input.scss"]
25
+ }; }
26
+ static get styleUrls() { return {
27
+ "$": ["ptc-input.css"]
28
+ }; }
29
+ static get properties() { return {
30
+ "type": {
31
+ "type": "string",
32
+ "mutable": false,
33
+ "complexType": {
34
+ "original": "string",
35
+ "resolved": "string",
36
+ "references": {}
37
+ },
38
+ "required": false,
39
+ "optional": false,
40
+ "docs": {
41
+ "tags": [],
42
+ "text": ""
43
+ },
44
+ "attribute": "type",
45
+ "reflect": false
46
+ },
47
+ "dataEloquaName": {
48
+ "type": "string",
49
+ "mutable": false,
50
+ "complexType": {
51
+ "original": "string",
52
+ "resolved": "string",
53
+ "references": {}
54
+ },
55
+ "required": false,
56
+ "optional": false,
57
+ "docs": {
58
+ "tags": [],
59
+ "text": ""
60
+ },
61
+ "attribute": "data-eloqua-name",
62
+ "reflect": false
63
+ },
64
+ "inputId": {
65
+ "type": "string",
66
+ "mutable": false,
67
+ "complexType": {
68
+ "original": "string",
69
+ "resolved": "string",
70
+ "references": {}
71
+ },
72
+ "required": false,
73
+ "optional": false,
74
+ "docs": {
75
+ "tags": [],
76
+ "text": ""
77
+ },
78
+ "attribute": "input-id",
79
+ "reflect": false
80
+ },
81
+ "inputName": {
82
+ "type": "string",
83
+ "mutable": false,
84
+ "complexType": {
85
+ "original": "string",
86
+ "resolved": "string",
87
+ "references": {}
88
+ },
89
+ "required": false,
90
+ "optional": false,
91
+ "docs": {
92
+ "tags": [],
93
+ "text": ""
94
+ },
95
+ "attribute": "input-name",
96
+ "reflect": false
97
+ }
98
+ }; }
99
+ static get states() { return {
100
+ "focused": {}
101
+ }; }
102
+ static get events() { return [{
103
+ "method": "blurEvent",
104
+ "name": "blurEvent",
105
+ "bubbles": true,
106
+ "cancelable": true,
107
+ "composed": true,
108
+ "docs": {
109
+ "tags": [],
110
+ "text": "Emitted when the input loses focus."
111
+ },
112
+ "complexType": {
113
+ "original": "void",
114
+ "resolved": "void",
115
+ "references": {}
116
+ }
117
+ }, {
118
+ "method": "focusEvent",
119
+ "name": "focusEvent",
120
+ "bubbles": true,
121
+ "cancelable": true,
122
+ "composed": true,
123
+ "docs": {
124
+ "tags": [],
125
+ "text": "Emitted when the input has focus."
126
+ },
127
+ "complexType": {
128
+ "original": "void",
129
+ "resolved": "void",
130
+ "references": {}
131
+ }
132
+ }]; }
133
+ }
@@ -0,0 +1,22 @@
1
+ :host {
2
+ display: block;
3
+ }
4
+
5
+ .ptc-select {
6
+ display: block;
7
+ width: 100%;
8
+ padding: 6px 12px;
9
+ border: none;
10
+ border-bottom: 1px solid #3b4550;
11
+ padding-left: 20px;
12
+ -webkit-box-shadow: 1px 1px 25px 0 rgba(0, 0, 0, 0.16);
13
+ box-shadow: 1px 1px 25px 0 rgba(0, 0, 0, 0.16);
14
+ border-top-left-radius: 5px;
15
+ border-top-right-radius: 5px;
16
+ border-bottom-left-radius: 0;
17
+ border-bottom-right-radius: 0;
18
+ font-size: 16px;
19
+ color: #707070;
20
+ padding-top: 14px;
21
+ background: #fff;
22
+ }
@@ -0,0 +1,105 @@
1
+ import { Component, h, Prop, Element } from '@stencil/core';
2
+ export class PtcSelect {
3
+ constructor() {
4
+ this.valueOptions = [];
5
+ }
6
+ componentWillLoad() {
7
+ const BASE_URL = 'https://countriesnow.space/api/v0.1/countries/iso';
8
+ async () => { };
9
+ return fetch(`${BASE_URL}`)
10
+ .then(response => response.json())
11
+ .then(data => {
12
+ this.valueOptions = data.data;
13
+ console.log(this.valueOptions);
14
+ });
15
+ }
16
+ render() {
17
+ if (this.selectId == 'contact-country') {
18
+ console.log('country field exist');
19
+ }
20
+ return (h("div", null,
21
+ h("select", { id: this.selectId, class: "ptc-select", "data-eloqua-name": this.dataEloquaName, name: this.name }, this.selectId === 'contact-country'
22
+ ? this.valueOptions.map(recipient => h("option", { value: recipient.Iso2 }, recipient.name))
23
+ : this.valueOptions.map(recipient => h("option", { value: recipient.Iso3 }, recipient.name))),
24
+ h("label", { htmlFor: this.selectId, class: "floating-label" },
25
+ h("slot", null))));
26
+ }
27
+ static get is() { return "ptc-select"; }
28
+ static get encapsulation() { return "scoped"; }
29
+ static get originalStyleUrls() { return {
30
+ "$": ["ptc-select.scss"]
31
+ }; }
32
+ static get styleUrls() { return {
33
+ "$": ["ptc-select.css"]
34
+ }; }
35
+ static get properties() { return {
36
+ "dataEloquaName": {
37
+ "type": "string",
38
+ "mutable": false,
39
+ "complexType": {
40
+ "original": "string",
41
+ "resolved": "string",
42
+ "references": {}
43
+ },
44
+ "required": false,
45
+ "optional": false,
46
+ "docs": {
47
+ "tags": [],
48
+ "text": ""
49
+ },
50
+ "attribute": "data-eloqua-name",
51
+ "reflect": false
52
+ },
53
+ "selectId": {
54
+ "type": "string",
55
+ "mutable": false,
56
+ "complexType": {
57
+ "original": "string",
58
+ "resolved": "string",
59
+ "references": {}
60
+ },
61
+ "required": false,
62
+ "optional": false,
63
+ "docs": {
64
+ "tags": [],
65
+ "text": ""
66
+ },
67
+ "attribute": "select-id",
68
+ "reflect": false
69
+ },
70
+ "name": {
71
+ "type": "string",
72
+ "mutable": false,
73
+ "complexType": {
74
+ "original": "string",
75
+ "resolved": "string",
76
+ "references": {}
77
+ },
78
+ "required": false,
79
+ "optional": false,
80
+ "docs": {
81
+ "tags": [],
82
+ "text": ""
83
+ },
84
+ "attribute": "name",
85
+ "reflect": false
86
+ },
87
+ "valueOptions": {
88
+ "type": "unknown",
89
+ "mutable": true,
90
+ "complexType": {
91
+ "original": "any[]",
92
+ "resolved": "any[]",
93
+ "references": {}
94
+ },
95
+ "required": false,
96
+ "optional": false,
97
+ "docs": {
98
+ "tags": [],
99
+ "text": ""
100
+ },
101
+ "defaultValue": "[]"
102
+ }
103
+ }; }
104
+ static get elementRef() { return "el"; }
105
+ }
@@ -39,7 +39,7 @@ export class PtcTitle {
39
39
  };
40
40
  }
41
41
  static get is() { return "ptc-title"; }
42
- static get encapsulation() { return "shadow"; }
42
+ static get encapsulation() { return "scoped"; }
43
43
  static get originalStyleUrls() { return {
44
44
  "$": ["ptc-title.scss"]
45
45
  }; }
@@ -1,6 +1,6 @@
1
1
  /* PtcwDesign custom elements bundle */
2
2
 
3
- import type { Components, JSX } from "../types/components";
3
+ import type { Components, JSX } from "../types/global";
4
4
 
5
5
  interface IconAsset extends Components.IconAsset, HTMLElement {}
6
6
  export const IconAsset: {
@@ -62,12 +62,24 @@ export const PtcFooter: {
62
62
  new (): PtcFooter;
63
63
  };
64
64
 
65
+ interface PtcForm extends Components.PtcForm, HTMLElement {}
66
+ export const PtcForm: {
67
+ prototype: PtcForm;
68
+ new (): PtcForm;
69
+ };
70
+
65
71
  interface PtcImg extends Components.PtcImg, HTMLElement {}
66
72
  export const PtcImg: {
67
73
  prototype: PtcImg;
68
74
  new (): PtcImg;
69
75
  };
70
76
 
77
+ interface PtcInput extends Components.PtcInput, HTMLElement {}
78
+ export const PtcInput: {
79
+ prototype: PtcInput;
80
+ new (): PtcInput;
81
+ };
82
+
71
83
  interface PtcLink extends Components.PtcLink, HTMLElement {}
72
84
  export const PtcLink: {
73
85
  prototype: PtcLink;
@@ -116,6 +128,12 @@ export const PtcPicture: {
116
128
  new (): PtcPicture;
117
129
  };
118
130
 
131
+ interface PtcSelect extends Components.PtcSelect, HTMLElement {}
132
+ export const PtcSelect: {
133
+ prototype: PtcSelect;
134
+ new (): PtcSelect;
135
+ };
136
+
119
137
  interface PtcSpacer extends Components.PtcSpacer, HTMLElement {}
120
138
  export const PtcSpacer: {
121
139
  prototype: PtcSpacer;