@ptcwebops/ptcw-design 2.6.6 → 2.6.8
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.
- package/dist/cjs/embedded-form.cjs.entry.js +93 -0
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/ptc-form-checkbox_3.cjs.entry.js +10664 -0
- package/dist/cjs/ptc-form.cjs.entry.js +89 -0
- package/dist/cjs/ptc-nav-link.cjs.entry.js +8 -4
- package/dist/cjs/ptc-nav-slider.cjs.entry.js +2 -2
- package/dist/cjs/ptc-nav-submenu.cjs.entry.js +1 -1
- package/dist/cjs/ptc-subnav.cjs.entry.js +7 -3
- package/dist/cjs/ptc-text-copy-with-background.cjs.entry.js +1 -1
- package/dist/cjs/ptcw-design.cjs.js +1 -1
- package/dist/collection/collection-manifest.json +5 -0
- package/dist/collection/components/organism-bundles/form/embedded-form/embedded-form.css +29 -0
- package/dist/collection/components/organism-bundles/form/embedded-form/embedded-form.js +98 -0
- package/dist/collection/components/organism-bundles/form/ptc-form/ptc-form.css +14 -0
- package/dist/collection/components/organism-bundles/form/ptc-form/ptc-form.js +94 -0
- package/dist/collection/components/ptc-form-checkbox/ptc-form-checkbox.css +1083 -0
- package/dist/collection/components/ptc-form-checkbox/ptc-form-checkbox.js +209 -0
- package/dist/collection/components/ptc-select/ptc-select.css +6099 -0
- package/dist/collection/components/ptc-select/ptc-select.js +190 -0
- package/dist/collection/components/ptc-text-copy-with-background/ptc-text-copy-with-background.css +5 -2
- package/dist/collection/components/ptc-textfield/ptc-textfield.css +3590 -0
- package/dist/collection/components/ptc-textfield/ptc-textfield.js +351 -0
- package/dist/collection/components/subnav/ptc-nav-link/ptc-nav-link.css +2 -1
- package/dist/collection/components/subnav/ptc-nav-link/ptc-nav-link.js +24 -3
- package/dist/collection/components/subnav/ptc-nav-slider/ptc-nav-slider.js +2 -2
- package/dist/collection/components/subnav/ptc-nav-submenu/ptc-nav-submenu.css +8 -2
- package/dist/collection/components/subnav/ptc-subnav/ptc-subnav.css +8 -2
- package/dist/collection/components/subnav/ptc-subnav/ptc-subnav.js +12 -2
- package/dist/collection/stories/FormCheckbox.stories.js +58 -0
- package/dist/collection/stories/Select.stories.js +61 -0
- package/dist/collection/stories/Textfield.stories.js +82 -0
- package/dist/custom-elements/index.d.ts +31 -1
- package/dist/custom-elements/index.js +14325 -3479
- package/dist/esm/embedded-form.entry.js +89 -0
- package/dist/esm/loader.js +1 -1
- package/dist/esm/ptc-form-checkbox_3.entry.js +10658 -0
- package/dist/esm/ptc-form.entry.js +85 -0
- package/dist/esm/ptc-nav-link.entry.js +9 -5
- package/dist/esm/ptc-nav-slider.entry.js +2 -2
- package/dist/esm/ptc-nav-submenu.entry.js +1 -1
- package/dist/esm/ptc-subnav.entry.js +7 -3
- package/dist/esm/ptc-text-copy-with-background.entry.js +1 -1
- package/dist/esm/ptcw-design.js +1 -1
- package/dist/ptcw-design/p-018470e2.entry.js +1 -0
- package/dist/ptcw-design/p-0b1d5c21.entry.js +1 -0
- package/dist/ptcw-design/p-11582f1e.entry.js +359 -0
- package/dist/ptcw-design/p-2fb1e3d3.entry.js +1 -0
- package/dist/ptcw-design/{p-bf47669c.entry.js → p-3fa6d101.entry.js} +1 -1
- package/dist/ptcw-design/p-84090398.entry.js +1 -0
- package/dist/ptcw-design/p-d46fc3a3.entry.js +1 -0
- package/dist/ptcw-design/p-f245f1bd.entry.js +1 -0
- package/dist/ptcw-design/ptcw-design.css +1 -1
- package/dist/ptcw-design/ptcw-design.esm.js +1 -1
- package/dist/types/components/organism-bundles/form/embedded-form/embedded-form.d.ts +29 -0
- package/dist/types/components/organism-bundles/form/ptc-form/ptc-form.d.ts +25 -0
- package/dist/types/components/ptc-form-checkbox/ptc-form-checkbox.d.ts +20 -0
- package/dist/types/components/ptc-select/ptc-select.d.ts +18 -0
- package/dist/types/components/ptc-textfield/ptc-textfield.d.ts +27 -0
- package/dist/types/components/subnav/ptc-nav-link/ptc-nav-link.d.ts +6 -1
- package/dist/types/components/subnav/ptc-subnav/ptc-subnav.d.ts +1 -0
- package/dist/types/components.d.ts +136 -0
- package/package.json +7 -1
- package/readme.md +1 -1
- package/dist/ptcw-design/p-110cd4a4.entry.js +0 -1
- package/dist/ptcw-design/p-909d5ec8.entry.js +0 -1
- package/dist/ptcw-design/p-c249785a.entry.js +0 -1
- package/dist/ptcw-design/p-fd6d40c3.entry.js +0 -1
- package/dist/types/global.d.ts +0 -1072
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
import { h } from '@stencil/core';
|
|
2
|
+
import { MDCCheckbox } from '@material/checkbox';
|
|
3
|
+
import { MDCFormField } from '@material/form-field';
|
|
4
|
+
export class PtcFormCheckbox {
|
|
5
|
+
constructor() {
|
|
6
|
+
this.checkboxId = undefined;
|
|
7
|
+
this.label = undefined;
|
|
8
|
+
this.required = true;
|
|
9
|
+
this.isChecked = false;
|
|
10
|
+
this.name = undefined;
|
|
11
|
+
this.helpertext = 'This field is required';
|
|
12
|
+
this.hasError = false;
|
|
13
|
+
}
|
|
14
|
+
handleChange(event) {
|
|
15
|
+
const isCheckedStatus = event.target.checked;
|
|
16
|
+
this.checkboxChanged.emit(isCheckedStatus);
|
|
17
|
+
this.isChecked = isCheckedStatus;
|
|
18
|
+
this.validateCheckbox();
|
|
19
|
+
console.log('log: isChecked:' + this.isChecked);
|
|
20
|
+
}
|
|
21
|
+
componentDidLoad() {
|
|
22
|
+
this.mdcCheckboxComponent = MDCCheckbox.attachTo(this.mdcCheckbox);
|
|
23
|
+
this.mdcFormfieldComponent = MDCFormField.attachTo(this.mdcFormfield);
|
|
24
|
+
}
|
|
25
|
+
async validateCheckbox() {
|
|
26
|
+
// this.isCheckboxChecked = !this.isCheckboxChecked; // Toggle checkbox state
|
|
27
|
+
if (!this.checkboxInput.checked) {
|
|
28
|
+
this.hasError = true; // Set error state to true
|
|
29
|
+
}
|
|
30
|
+
else {
|
|
31
|
+
this.hasError = false; // Reset error state
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
render() {
|
|
35
|
+
return [
|
|
36
|
+
h("div", { class: `mdc-form-field ${this.hasError ? 'invalid-checkbox' : ''}`, ref: mdcFormfield => {
|
|
37
|
+
this.mdcFormfield = mdcFormfield;
|
|
38
|
+
} }, h("div", { class: "mdc-checkbox", ref: mdcCheckbox => {
|
|
39
|
+
this.mdcCheckbox = mdcCheckbox;
|
|
40
|
+
} }, h("input", Object.assign({ id: this.checkboxId, ref: checkboxInput => {
|
|
41
|
+
this.checkboxInput = checkboxInput;
|
|
42
|
+
}, type: "checkbox" }, (this.required ? { required: true } : {}), { class: "mdc-checkbox__native-control", onChange: this.handleChange.bind(this) })), h("div", { class: "mdc-checkbox__background" }, h("svg", { class: "mdc-checkbox__checkmark", viewBox: "0 0 24 24" }, h("path", { class: "mdc-checkbox__checkmark-path", fill: "none", d: "M1.73,12.91 8.1,19.28 22.79,4.59" })), h("div", { class: "mdc-checkbox__mixedmark" })), h("div", { class: "mdc-checkbox__ripple" })), h("label", { htmlFor: this.checkboxId }, this.label)),
|
|
43
|
+
this.hasError ? (h("div", { class: "checkbox-helper-wrapper" }, h("p", { id: this.name }, 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))) : null,
|
|
44
|
+
];
|
|
45
|
+
}
|
|
46
|
+
static get is() { return "ptc-form-checkbox"; }
|
|
47
|
+
static get originalStyleUrls() {
|
|
48
|
+
return {
|
|
49
|
+
"$": ["ptc-form-checkbox.scss"]
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
static get styleUrls() {
|
|
53
|
+
return {
|
|
54
|
+
"$": ["ptc-form-checkbox.css"]
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
static get properties() {
|
|
58
|
+
return {
|
|
59
|
+
"checkboxId": {
|
|
60
|
+
"type": "string",
|
|
61
|
+
"mutable": false,
|
|
62
|
+
"complexType": {
|
|
63
|
+
"original": "string",
|
|
64
|
+
"resolved": "string",
|
|
65
|
+
"references": {}
|
|
66
|
+
},
|
|
67
|
+
"required": false,
|
|
68
|
+
"optional": false,
|
|
69
|
+
"docs": {
|
|
70
|
+
"tags": [],
|
|
71
|
+
"text": ""
|
|
72
|
+
},
|
|
73
|
+
"attribute": "checkbox-id",
|
|
74
|
+
"reflect": false
|
|
75
|
+
},
|
|
76
|
+
"label": {
|
|
77
|
+
"type": "string",
|
|
78
|
+
"mutable": false,
|
|
79
|
+
"complexType": {
|
|
80
|
+
"original": "string",
|
|
81
|
+
"resolved": "string",
|
|
82
|
+
"references": {}
|
|
83
|
+
},
|
|
84
|
+
"required": false,
|
|
85
|
+
"optional": false,
|
|
86
|
+
"docs": {
|
|
87
|
+
"tags": [],
|
|
88
|
+
"text": ""
|
|
89
|
+
},
|
|
90
|
+
"attribute": "label",
|
|
91
|
+
"reflect": false
|
|
92
|
+
},
|
|
93
|
+
"required": {
|
|
94
|
+
"type": "boolean",
|
|
95
|
+
"mutable": false,
|
|
96
|
+
"complexType": {
|
|
97
|
+
"original": "boolean",
|
|
98
|
+
"resolved": "boolean",
|
|
99
|
+
"references": {}
|
|
100
|
+
},
|
|
101
|
+
"required": false,
|
|
102
|
+
"optional": false,
|
|
103
|
+
"docs": {
|
|
104
|
+
"tags": [],
|
|
105
|
+
"text": ""
|
|
106
|
+
},
|
|
107
|
+
"attribute": "required",
|
|
108
|
+
"reflect": false,
|
|
109
|
+
"defaultValue": "true"
|
|
110
|
+
},
|
|
111
|
+
"isChecked": {
|
|
112
|
+
"type": "boolean",
|
|
113
|
+
"mutable": true,
|
|
114
|
+
"complexType": {
|
|
115
|
+
"original": "boolean",
|
|
116
|
+
"resolved": "boolean",
|
|
117
|
+
"references": {}
|
|
118
|
+
},
|
|
119
|
+
"required": false,
|
|
120
|
+
"optional": false,
|
|
121
|
+
"docs": {
|
|
122
|
+
"tags": [],
|
|
123
|
+
"text": ""
|
|
124
|
+
},
|
|
125
|
+
"attribute": "is-checked",
|
|
126
|
+
"reflect": false,
|
|
127
|
+
"defaultValue": "false"
|
|
128
|
+
},
|
|
129
|
+
"name": {
|
|
130
|
+
"type": "string",
|
|
131
|
+
"mutable": false,
|
|
132
|
+
"complexType": {
|
|
133
|
+
"original": "string",
|
|
134
|
+
"resolved": "string",
|
|
135
|
+
"references": {}
|
|
136
|
+
},
|
|
137
|
+
"required": false,
|
|
138
|
+
"optional": false,
|
|
139
|
+
"docs": {
|
|
140
|
+
"tags": [],
|
|
141
|
+
"text": ""
|
|
142
|
+
},
|
|
143
|
+
"attribute": "name",
|
|
144
|
+
"reflect": false
|
|
145
|
+
},
|
|
146
|
+
"helpertext": {
|
|
147
|
+
"type": "string",
|
|
148
|
+
"mutable": false,
|
|
149
|
+
"complexType": {
|
|
150
|
+
"original": "string",
|
|
151
|
+
"resolved": "string",
|
|
152
|
+
"references": {}
|
|
153
|
+
},
|
|
154
|
+
"required": false,
|
|
155
|
+
"optional": false,
|
|
156
|
+
"docs": {
|
|
157
|
+
"tags": [],
|
|
158
|
+
"text": ""
|
|
159
|
+
},
|
|
160
|
+
"attribute": "helpertext",
|
|
161
|
+
"reflect": false,
|
|
162
|
+
"defaultValue": "'This field is required'"
|
|
163
|
+
}
|
|
164
|
+
};
|
|
165
|
+
}
|
|
166
|
+
static get states() {
|
|
167
|
+
return {
|
|
168
|
+
"hasError": {}
|
|
169
|
+
};
|
|
170
|
+
}
|
|
171
|
+
static get events() {
|
|
172
|
+
return [{
|
|
173
|
+
"method": "checkboxChanged",
|
|
174
|
+
"name": "checkboxChanged",
|
|
175
|
+
"bubbles": true,
|
|
176
|
+
"cancelable": true,
|
|
177
|
+
"composed": true,
|
|
178
|
+
"docs": {
|
|
179
|
+
"tags": [],
|
|
180
|
+
"text": ""
|
|
181
|
+
},
|
|
182
|
+
"complexType": {
|
|
183
|
+
"original": "boolean",
|
|
184
|
+
"resolved": "boolean",
|
|
185
|
+
"references": {}
|
|
186
|
+
}
|
|
187
|
+
}];
|
|
188
|
+
}
|
|
189
|
+
static get methods() {
|
|
190
|
+
return {
|
|
191
|
+
"validateCheckbox": {
|
|
192
|
+
"complexType": {
|
|
193
|
+
"signature": "() => Promise<void>",
|
|
194
|
+
"parameters": [],
|
|
195
|
+
"references": {
|
|
196
|
+
"Promise": {
|
|
197
|
+
"location": "global"
|
|
198
|
+
}
|
|
199
|
+
},
|
|
200
|
+
"return": "Promise<void>"
|
|
201
|
+
},
|
|
202
|
+
"docs": {
|
|
203
|
+
"text": "",
|
|
204
|
+
"tags": []
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
};
|
|
208
|
+
}
|
|
209
|
+
}
|