@postnord/pn-marketweb-components 2.4.27 → 2.4.29
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/cjs/index-4199ff85.js +20 -4
- package/cjs/loader.cjs.js +1 -1
- package/cjs/pn-cta-block.cjs.entry.js +33 -0
- package/cjs/pn-dropdown-with-multi-input-rows-row.cjs.entry.js +183 -0
- package/cjs/pn-dropdown-with-multi-input-rows.cjs.entry.js +309 -0
- package/cjs/pn-market-web-components.cjs.js +1 -1
- package/cjs/pn-multiple-input.cjs.entry.js +105 -0
- package/collection/collection-manifest.json +4 -0
- package/collection/components/cta/pn-cta-block/cta-block.stories.js +252 -0
- package/collection/components/cta/pn-cta-block/pn-cta-block.css +187 -0
- package/collection/components/cta/pn-cta-block/pn-cta-block.js +169 -0
- package/collection/components/input/pn-dropdown-with-multi-input-rows/pn-dropdown-with-multi-input-rows-row.css +27 -0
- package/collection/components/input/pn-dropdown-with-multi-input-rows/pn-dropdown-with-multi-input-rows-row.js +673 -0
- package/collection/components/input/pn-dropdown-with-multi-input-rows/pn-dropdown-with-multi-input-rows.css +26 -0
- package/collection/components/input/pn-dropdown-with-multi-input-rows/pn-dropdown-with-multi-input-rows.js +970 -0
- package/collection/components/input/pn-dropdown-with-multi-input-rows/pn-dropdown-with-multi-input-rows.stories.js +86 -0
- package/collection/components/input/pn-dropdown-with-multi-input-rows/types.js +1 -0
- package/collection/components/input/pn-multiple-input/pn-multiple-input.css +16 -0
- package/collection/components/input/pn-multiple-input/pn-multiple-input.js +185 -0
- package/collection/components/input/pn-multiple-input/pn-multiple-input.stories.js +24 -0
- package/collection/components/input/pn-multiple-input/types.js +1 -0
- package/components/index.d.ts +4 -0
- package/components/index.js +4 -0
- package/components/pn-cta-block.d.ts +11 -0
- package/components/pn-cta-block.js +57 -0
- package/components/pn-dropdown-with-multi-input-rows-row.d.ts +11 -0
- package/components/pn-dropdown-with-multi-input-rows-row.js +6 -0
- package/components/pn-dropdown-with-multi-input-rows-row2.js +232 -0
- package/components/pn-dropdown-with-multi-input-rows.d.ts +11 -0
- package/components/pn-dropdown-with-multi-input-rows.js +379 -0
- package/components/pn-multiple-input.d.ts +11 -0
- package/components/pn-multiple-input.js +130 -0
- package/esm/index-ee44c065.js +20 -4
- package/esm/loader.js +1 -1
- package/esm/pn-cta-block.entry.js +29 -0
- package/esm/pn-dropdown-with-multi-input-rows-row.entry.js +179 -0
- package/esm/pn-dropdown-with-multi-input-rows.entry.js +305 -0
- package/esm/pn-market-web-components.js +1 -1
- package/esm/pn-multiple-input.entry.js +101 -0
- package/esm-es5/index-ee44c065.js +1 -1
- package/esm-es5/loader.js +1 -1
- package/esm-es5/pn-cta-block.entry.js +1 -0
- package/esm-es5/pn-dropdown-with-multi-input-rows-row.entry.js +1 -0
- package/esm-es5/pn-dropdown-with-multi-input-rows.entry.js +1 -0
- package/esm-es5/pn-market-web-components.js +1 -1
- package/esm-es5/pn-multiple-input.entry.js +1 -0
- package/package.json +1 -1
- package/pn-market-web-components/p-313658e7.entry.js +1 -0
- package/pn-market-web-components/p-47239bce.system.entry.js +1 -0
- package/pn-market-web-components/p-52e8d0ec.system.entry.js +1 -0
- package/pn-market-web-components/p-71740e7e.system.entry.js +1 -0
- package/pn-market-web-components/p-7787ca3b.entry.js +1 -0
- package/pn-market-web-components/p-ad952e14.system.entry.js +1 -0
- package/pn-market-web-components/p-e05b6e0c.entry.js +1 -0
- package/pn-market-web-components/p-f02617fc.entry.js +1 -0
- package/pn-market-web-components/p-fcdb7381.system.js +1 -1
- package/pn-market-web-components/pn-market-web-components.esm.js +1 -1
- package/types/components/cta/pn-cta-block/pn-cta-block.d.ts +14 -0
- package/types/components/input/pn-dropdown-with-multi-input-rows/pn-dropdown-with-multi-input-rows-row.d.ts +59 -0
- package/types/components/input/pn-dropdown-with-multi-input-rows/pn-dropdown-with-multi-input-rows.d.ts +77 -0
- package/types/components/input/pn-dropdown-with-multi-input-rows/types.d.ts +18 -0
- package/types/components/input/pn-multiple-input/pn-multiple-input.d.ts +22 -0
- package/types/components/input/pn-multiple-input/types.d.ts +11 -0
- package/types/components.d.ts +207 -6
- package/umd/modules/@postnord/web-components/package.json +32 -62
- package/umd/modules/@webcomponents/custom-elements/package.json +23 -58
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import readme from './readme.md';
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
title: 'input/Dropdown with Multi Input Rows',
|
|
5
|
+
parameters: {
|
|
6
|
+
notes: readme,
|
|
7
|
+
},
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
const Template = ({ ...args }) => {
|
|
11
|
+
return `
|
|
12
|
+
<pn-dropdown-with-multi-input-rows
|
|
13
|
+
dropdown-data='${args.dropdownData}'
|
|
14
|
+
language-code='${args.languageCode}'
|
|
15
|
+
first-dropdown-label='${args.firstDropdownLabel}'
|
|
16
|
+
first-dropdown-helper-text='${args.firstDropdownHelperText}'
|
|
17
|
+
second-dropdown-label='${args.secondDropdownLabel}'
|
|
18
|
+
second-dropdown-helper-text='${args.secondDropdownHelperText}'
|
|
19
|
+
second-dropdown-max='${args.secondDropdownMax}'
|
|
20
|
+
delete-multiple-rows-warning-text='${args.deleteMultipleRowsWarningText}'
|
|
21
|
+
confirm-delete-button-text='${args.confirmDeleteButtonText}'
|
|
22
|
+
abort-delete-button-text='${args.abortDeleteButtonText}'
|
|
23
|
+
frist-input-label='${args.fristInputLabel}'
|
|
24
|
+
frist-input-placeholder='${args.fristInputPlaceholder}'
|
|
25
|
+
first-input-min='${args.firstInputMin}'
|
|
26
|
+
first-input-max='${args.firstInputMax}'
|
|
27
|
+
first-input-warning='${args.firstInputWarning}'
|
|
28
|
+
first-input-warning-text='${args.firstInputWarningText}'
|
|
29
|
+
first-input-low-error-text='${args.firstInputLowErrorText}'
|
|
30
|
+
first-input-high-error-text='${args.firstInputHighErrorText}'
|
|
31
|
+
second-input-label='${args.secondInputLabel}'
|
|
32
|
+
second-input-placeholder='${args.secondInputPlaceholder}'
|
|
33
|
+
second-input-min='${args.secondInputMin}'
|
|
34
|
+
second-input-max='${args.secondInputMax}'
|
|
35
|
+
second-input-warning='${args.secondInputWarning}'
|
|
36
|
+
second-input-warning-text='${args.secondInputWarningText}'
|
|
37
|
+
second-input-low-error-text='${args.secondInputLowErrorText}'
|
|
38
|
+
second-input-high-error-text='${args.secondInputHighErrorText}'
|
|
39
|
+
date-label='${args.dateLabel}'
|
|
40
|
+
date-placeholder='${args.datePlaceholder}'
|
|
41
|
+
date-days-from-today='${args.dateDaysFromToday}'
|
|
42
|
+
years-to-add-to-end-date='${args.yearsToAddToEndDate}'
|
|
43
|
+
sum-field-label='${args.sumFieldLabel}'
|
|
44
|
+
add-row-text='${args.addRowText}'
|
|
45
|
+
element-helper-text='${args.elementHelperText}'
|
|
46
|
+
>
|
|
47
|
+
</pn-dropdown-with-multi-input-rows>
|
|
48
|
+
`;
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
export const Primary = Template.bind({});
|
|
52
|
+
Primary.args = {
|
|
53
|
+
dropdownData: '[{"caption": "Option1", "value": 4, "checked": false}, {"caption": "Option2", "value": 8, "checked": false}]',
|
|
54
|
+
languageCode: 'en',
|
|
55
|
+
firstDropdownLabel: 'dropdown1',
|
|
56
|
+
firstDropdownHelperText: 'dropdown1 help',
|
|
57
|
+
secondDropdownLabel: 'dropdown2',
|
|
58
|
+
secondDropdownHelperText: 'dropdown2 help',
|
|
59
|
+
secondDropdownMax: 53,
|
|
60
|
+
deleteMultipleRowsWarningText: 'Når du ændrer Antal Udgivelser til et lavere antal end først valgt, skal du være opmærksom på at allerede indtastede indleveringer slettes',
|
|
61
|
+
confirmDeleteButtonText: 'Slet',
|
|
62
|
+
abortDeleteButtonText: 'Fortryd',
|
|
63
|
+
fristInputLabel: 'first input',
|
|
64
|
+
fristInputPlaceholder: 'amount',
|
|
65
|
+
firstInputMin: 500,
|
|
66
|
+
firstInputMax: 2000000,
|
|
67
|
+
firstInputWarning: 1500,
|
|
68
|
+
firstInputWarningText: 'Antal er pr indlevering skal være på minimum 1500 stk. eller der skal betales op til minimum',
|
|
69
|
+
firstInputLowErrorText: 'Du kan ikke indlevere under 500 stk.',
|
|
70
|
+
firstInputHighErrorText: 'Du kan ikke indlevere over 2000000 stk.',
|
|
71
|
+
secondInputLabel: 'second input',
|
|
72
|
+
secondInputPlaceholder: 'amount',
|
|
73
|
+
secondInputMin: 0,
|
|
74
|
+
secondInputMax: 2000,
|
|
75
|
+
secondInputWarning: 60,
|
|
76
|
+
secondInputWarningText: 'Bemærk der betales for mindst 60 gram, uanset vægt',
|
|
77
|
+
secondInputLowErrorText: '',
|
|
78
|
+
secondInputHighErrorText: 'Forkert vægt max. 2000',
|
|
79
|
+
dateLabel: 'date',
|
|
80
|
+
datePlaceholder: 'YYYY-MM-DD',
|
|
81
|
+
dateDaysFromToday: 1,
|
|
82
|
+
yearsToAddToEndDate: 2,
|
|
83
|
+
sumFieldLabel: 'Sum',
|
|
84
|
+
addRowText: 'Add Row',
|
|
85
|
+
elementHelperText: 'Helpful text',
|
|
86
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
pn-multiple-input .multiple-input-generated-row,
|
|
2
|
+
pn-multiple-input .multiple-input-row {
|
|
3
|
+
display: flex;
|
|
4
|
+
gap: 1rem;
|
|
5
|
+
}
|
|
6
|
+
pn-multiple-input .multiple-input-generated-row pn-marketweb-input,
|
|
7
|
+
pn-multiple-input .multiple-input-row pn-marketweb-input {
|
|
8
|
+
width: 100%;
|
|
9
|
+
}
|
|
10
|
+
pn-multiple-input .multiple-input-slot {
|
|
11
|
+
display: flex;
|
|
12
|
+
gap: 1rem;
|
|
13
|
+
flex-direction: column;
|
|
14
|
+
margin-top: 1rem;
|
|
15
|
+
margin-bottom: 1rem;
|
|
16
|
+
}
|
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
import { h, Host } from '@stencil/core';
|
|
2
|
+
import { v4 as uuidv4 } from 'uuid';
|
|
3
|
+
import { debounce } from 'debounce';
|
|
4
|
+
export class PnMultipleInput {
|
|
5
|
+
constructor() {
|
|
6
|
+
this.pnSlotElement = null;
|
|
7
|
+
this._formValues = [];
|
|
8
|
+
this.label = null;
|
|
9
|
+
this.placeholder = null;
|
|
10
|
+
this.addRowButtonText = null;
|
|
11
|
+
this.rowData = [];
|
|
12
|
+
}
|
|
13
|
+
componentWillLoad() {
|
|
14
|
+
const elemtnId = this.generateUniqueId();
|
|
15
|
+
const newRow = { id: elemtnId, input: '' };
|
|
16
|
+
this.rowData = [...this.rowData, newRow];
|
|
17
|
+
}
|
|
18
|
+
componentDidLoad() {
|
|
19
|
+
this.addEventHandlers();
|
|
20
|
+
}
|
|
21
|
+
componentDidUpdate() {
|
|
22
|
+
this.addEventHandlers();
|
|
23
|
+
}
|
|
24
|
+
addEventHandlers() {
|
|
25
|
+
const rows = this.pnSlotElement.querySelectorAll('pn-marketweb-input');
|
|
26
|
+
rows.forEach(element => {
|
|
27
|
+
element.addEventListener('keyup', debounce(this.handleInput.bind(this), 500));
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
generateUniqueId() {
|
|
31
|
+
return uuidv4();
|
|
32
|
+
}
|
|
33
|
+
deleteRow(indexToRemove) {
|
|
34
|
+
if (indexToRemove < 0) {
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
this.rowData.splice(indexToRemove, 1);
|
|
38
|
+
this.rowData = [...this.rowData];
|
|
39
|
+
this.emitValues();
|
|
40
|
+
}
|
|
41
|
+
addRow() {
|
|
42
|
+
const newRow = { id: this.generateUniqueId(), input: '' };
|
|
43
|
+
this.rowData = [...this.rowData, newRow];
|
|
44
|
+
this.emitValues();
|
|
45
|
+
}
|
|
46
|
+
handleInput(e) {
|
|
47
|
+
const target = e.target;
|
|
48
|
+
const inputElm = target.closest('pn-marketweb-input');
|
|
49
|
+
if (!inputElm) {
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
const inputElmId = inputElm.id;
|
|
53
|
+
const value = target.value;
|
|
54
|
+
const index = this.rowData.findIndex(item => item.id === inputElmId);
|
|
55
|
+
if (index < 0) {
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
this.rowData[index] = Object.assign(Object.assign({}, this.rowData[index]), { input: value });
|
|
59
|
+
this.emitValues();
|
|
60
|
+
}
|
|
61
|
+
emitValues() {
|
|
62
|
+
this._formValues = [];
|
|
63
|
+
const label = this.label ? this.label : 'InputField';
|
|
64
|
+
this.rowData.forEach(item => {
|
|
65
|
+
const rowValue = { row: [] };
|
|
66
|
+
if (item.input) {
|
|
67
|
+
const dropDownValue = { name: label, value: item.input };
|
|
68
|
+
rowValue.row.push(dropDownValue);
|
|
69
|
+
}
|
|
70
|
+
if (rowValue.row.length === 1) {
|
|
71
|
+
this._formValues.push(rowValue);
|
|
72
|
+
}
|
|
73
|
+
});
|
|
74
|
+
if (this._formValues.length === this.rowData.length) {
|
|
75
|
+
const valueJsonString = JSON.stringify(this._formValues);
|
|
76
|
+
this.allFormValues.emit(valueJsonString);
|
|
77
|
+
}
|
|
78
|
+
else {
|
|
79
|
+
this.allFormValues.emit('');
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
render() {
|
|
83
|
+
var _a;
|
|
84
|
+
return (h(Host, null, h("div", { ref: el => (this.pnSlotElement = el), class: "multiple-input-slot" }, (_a = this.rowData) === null || _a === void 0 ? void 0 : _a.map((data, i) => {
|
|
85
|
+
return (h("div", { class: "multiple-input-generated-row" }, h("pn-marketweb-input", { label: this.label, type: "text", placeholder: this.placeholder, value: data.input, id: data.id }), i > 0 ? (h("pn-button", { "icon-only": true, "aria-label": "Delete", icon: "minus", appearance: "warning", onClick: () => {
|
|
86
|
+
this.deleteRow(i);
|
|
87
|
+
}, index: i, id: data.id }, "Delete")) : null));
|
|
88
|
+
})), h("dvi", { class: "multiple-input-row" }, h("pn-button", { "icon-only": this.addRowButtonText ? false : true, "left-icon": "true", "aria-label": "Add", icon: "plus", appearance: "light", variant: "borderless", class: "connected-dropdown__button-right", onClick: () => {
|
|
89
|
+
this.addRow();
|
|
90
|
+
} }, this.addRowButtonText))));
|
|
91
|
+
}
|
|
92
|
+
static get is() { return "pn-multiple-input"; }
|
|
93
|
+
static get originalStyleUrls() {
|
|
94
|
+
return {
|
|
95
|
+
"$": ["pn-multiple-input.scss"]
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
static get styleUrls() {
|
|
99
|
+
return {
|
|
100
|
+
"$": ["pn-multiple-input.css"]
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
static get properties() {
|
|
104
|
+
return {
|
|
105
|
+
"label": {
|
|
106
|
+
"type": "string",
|
|
107
|
+
"mutable": false,
|
|
108
|
+
"complexType": {
|
|
109
|
+
"original": "string",
|
|
110
|
+
"resolved": "string",
|
|
111
|
+
"references": {}
|
|
112
|
+
},
|
|
113
|
+
"required": false,
|
|
114
|
+
"optional": false,
|
|
115
|
+
"docs": {
|
|
116
|
+
"tags": [],
|
|
117
|
+
"text": ""
|
|
118
|
+
},
|
|
119
|
+
"attribute": "label",
|
|
120
|
+
"reflect": false,
|
|
121
|
+
"defaultValue": "null"
|
|
122
|
+
},
|
|
123
|
+
"placeholder": {
|
|
124
|
+
"type": "string",
|
|
125
|
+
"mutable": false,
|
|
126
|
+
"complexType": {
|
|
127
|
+
"original": "string",
|
|
128
|
+
"resolved": "string",
|
|
129
|
+
"references": {}
|
|
130
|
+
},
|
|
131
|
+
"required": false,
|
|
132
|
+
"optional": false,
|
|
133
|
+
"docs": {
|
|
134
|
+
"tags": [],
|
|
135
|
+
"text": ""
|
|
136
|
+
},
|
|
137
|
+
"attribute": "placeholder",
|
|
138
|
+
"reflect": false,
|
|
139
|
+
"defaultValue": "null"
|
|
140
|
+
},
|
|
141
|
+
"addRowButtonText": {
|
|
142
|
+
"type": "string",
|
|
143
|
+
"mutable": false,
|
|
144
|
+
"complexType": {
|
|
145
|
+
"original": "string",
|
|
146
|
+
"resolved": "string",
|
|
147
|
+
"references": {}
|
|
148
|
+
},
|
|
149
|
+
"required": false,
|
|
150
|
+
"optional": false,
|
|
151
|
+
"docs": {
|
|
152
|
+
"tags": [],
|
|
153
|
+
"text": ""
|
|
154
|
+
},
|
|
155
|
+
"attribute": "add-row-button-text",
|
|
156
|
+
"reflect": false,
|
|
157
|
+
"defaultValue": "null"
|
|
158
|
+
}
|
|
159
|
+
};
|
|
160
|
+
}
|
|
161
|
+
static get states() {
|
|
162
|
+
return {
|
|
163
|
+
"rowData": {}
|
|
164
|
+
};
|
|
165
|
+
}
|
|
166
|
+
static get events() {
|
|
167
|
+
return [{
|
|
168
|
+
"method": "allFormValues",
|
|
169
|
+
"name": "allFormValues",
|
|
170
|
+
"bubbles": true,
|
|
171
|
+
"cancelable": true,
|
|
172
|
+
"composed": true,
|
|
173
|
+
"docs": {
|
|
174
|
+
"tags": [],
|
|
175
|
+
"text": ""
|
|
176
|
+
},
|
|
177
|
+
"complexType": {
|
|
178
|
+
"original": "string",
|
|
179
|
+
"resolved": "string",
|
|
180
|
+
"references": {}
|
|
181
|
+
}
|
|
182
|
+
}];
|
|
183
|
+
}
|
|
184
|
+
static get elementRef() { return "hostElement"; }
|
|
185
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import readme from './readme.md';
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
title: 'input/Multiple Input',
|
|
5
|
+
parameters: {
|
|
6
|
+
notes: readme,
|
|
7
|
+
},
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
const Template = ({ ...args }) => {
|
|
11
|
+
return `<pn-multiple-input
|
|
12
|
+
label='${args.label}'
|
|
13
|
+
placeholder='${args.placeholder}'
|
|
14
|
+
add-row-button-text='${args.addRowButtonText}'
|
|
15
|
+
>
|
|
16
|
+
</pn-multiple-input>`;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export const Primary = Template.bind({});
|
|
20
|
+
Primary.args = {
|
|
21
|
+
label: 'label',
|
|
22
|
+
placeholder: 'placeholder',
|
|
23
|
+
addRowButtonText: 'add',
|
|
24
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/components/index.d.ts
CHANGED
|
@@ -8,10 +8,13 @@ export { PnBreakpoints as PnBreakpoints } from '../types/components/utilities/pn
|
|
|
8
8
|
export { PnChart as PnChart } from '../types/components/charts/pn-chart/pn-chart';
|
|
9
9
|
export { PnChartsCard as PnChartsCard } from '../types/components/charts/pn-charts-card/pn-charts-card';
|
|
10
10
|
export { PnChoiceButton as PnChoiceButton } from '../types/components/input/pn-choice-button/pn-choice-button';
|
|
11
|
+
export { PnCtaBlock as PnCtaBlock } from '../types/components/cta/pn-cta-block/pn-cta-block';
|
|
11
12
|
export { PnCustomernumberSelector as PnCustomernumberSelector } from '../types/components/profile/pn-customernumber-selector/pn-customernumber-selector';
|
|
12
13
|
export { PnProfileSelectorOption as PnCustomernumberSelectorOption } from '../types/components/profile/pn-customernumber-selector/pn-customernumber-selector-option';
|
|
13
14
|
export { PnDateAndTime as PnDateAndTime } from '../types/components/input/pn-date-and-time/pn-date-and-time';
|
|
14
15
|
export { pnDropdownChoiceAddsRow as PnDropdownChoiceAddsRow } from '../types/components/input/pn-dropdown-choice-adds-row/pn-dropdown-choice-adds-row';
|
|
16
|
+
export { PnDropdownWithMultiInputRows as PnDropdownWithMultiInputRows } from '../types/components/input/pn-dropdown-with-multi-input-rows/pn-dropdown-with-multi-input-rows';
|
|
17
|
+
export { PnDropdownWithMultiInputRowsRow as PnDropdownWithMultiInputRowsRow } from '../types/components/input/pn-dropdown-with-multi-input-rows/pn-dropdown-with-multi-input-rows-row';
|
|
15
18
|
export { PnFilterCheckbox as PnFilterCheckbox } from '../types/components/input/pn-filter-checkbox/pn-filter-checkbox';
|
|
16
19
|
export { PnfindPrice as PnFindPrice } from '../types/components/widgets/pn-find-price/pn-find-price';
|
|
17
20
|
export { PnfindPriceResult as PnFindPriceResult } from '../types/components/widgets/pn-find-price/pn-find-price-result';
|
|
@@ -39,6 +42,7 @@ export { PnMarketwebSiteheaderUnifiedLogin as PnMarketwebSiteheaderUnifiedLogin
|
|
|
39
42
|
export { PnMultiFormField as PnMultiFormfield } from '../types/components/input/pn-multi-formfield/pn-multi-formfield';
|
|
40
43
|
export { PnMultiRowConnectedDropdown as PnMultiRowConnectedDropdown } from '../types/components/input/pn-multi-row-connected-dropdown/pn-multi-row-connected-dropdown';
|
|
41
44
|
export { PnMultiRowConnectedDropdownRow as PnMultiRowConnectedDropdownRow } from '../types/components/input/pn-multi-row-connected-dropdown/pn-multi-row-connected-dropdown-row';
|
|
45
|
+
export { PnMultipleInput as PnMultipleInput } from '../types/components/input/pn-multiple-input/pn-multiple-input';
|
|
42
46
|
export { PnSpotlight as PnParcelTracker } from '../types/components/cta/pn-parcel-tracker/pn-parcel-tracker';
|
|
43
47
|
export { PnPexPricefinder as PnPexPricefinder } from '../types/components/widgets/pn-pex-pricefinder/pn-pex-pricefinder';
|
|
44
48
|
export { PnPlayOnScroll as PnPlayOnScroll } from '../types/components/animation/pn-play-on-scroll/pn-play-on-scroll';
|
package/components/index.js
CHANGED
|
@@ -8,10 +8,13 @@ export { PnBreakpoints, defineCustomElement as defineCustomElementPnBreakpoints
|
|
|
8
8
|
export { PnChart, defineCustomElement as defineCustomElementPnChart } from './pn-chart.js';
|
|
9
9
|
export { PnChartsCard, defineCustomElement as defineCustomElementPnChartsCard } from './pn-charts-card.js';
|
|
10
10
|
export { PnChoiceButton, defineCustomElement as defineCustomElementPnChoiceButton } from './pn-choice-button.js';
|
|
11
|
+
export { PnCtaBlock, defineCustomElement as defineCustomElementPnCtaBlock } from './pn-cta-block.js';
|
|
11
12
|
export { PnCustomernumberSelector, defineCustomElement as defineCustomElementPnCustomernumberSelector } from './pn-customernumber-selector.js';
|
|
12
13
|
export { PnCustomernumberSelectorOption, defineCustomElement as defineCustomElementPnCustomernumberSelectorOption } from './pn-customernumber-selector-option.js';
|
|
13
14
|
export { PnDateAndTime, defineCustomElement as defineCustomElementPnDateAndTime } from './pn-date-and-time.js';
|
|
14
15
|
export { PnDropdownChoiceAddsRow, defineCustomElement as defineCustomElementPnDropdownChoiceAddsRow } from './pn-dropdown-choice-adds-row.js';
|
|
16
|
+
export { PnDropdownWithMultiInputRows, defineCustomElement as defineCustomElementPnDropdownWithMultiInputRows } from './pn-dropdown-with-multi-input-rows.js';
|
|
17
|
+
export { PnDropdownWithMultiInputRowsRow, defineCustomElement as defineCustomElementPnDropdownWithMultiInputRowsRow } from './pn-dropdown-with-multi-input-rows-row.js';
|
|
15
18
|
export { PnFilterCheckbox, defineCustomElement as defineCustomElementPnFilterCheckbox } from './pn-filter-checkbox.js';
|
|
16
19
|
export { PnFindPrice, defineCustomElement as defineCustomElementPnFindPrice } from './pn-find-price.js';
|
|
17
20
|
export { PnFindPriceResult, defineCustomElement as defineCustomElementPnFindPriceResult } from './pn-find-price-result.js';
|
|
@@ -39,6 +42,7 @@ export { PnMarketwebSiteheaderUnifiedLogin, defineCustomElement as defineCustomE
|
|
|
39
42
|
export { PnMultiFormfield, defineCustomElement as defineCustomElementPnMultiFormfield } from './pn-multi-formfield.js';
|
|
40
43
|
export { PnMultiRowConnectedDropdown, defineCustomElement as defineCustomElementPnMultiRowConnectedDropdown } from './pn-multi-row-connected-dropdown.js';
|
|
41
44
|
export { PnMultiRowConnectedDropdownRow, defineCustomElement as defineCustomElementPnMultiRowConnectedDropdownRow } from './pn-multi-row-connected-dropdown-row.js';
|
|
45
|
+
export { PnMultipleInput, defineCustomElement as defineCustomElementPnMultipleInput } from './pn-multiple-input.js';
|
|
42
46
|
export { PnParcelTracker, defineCustomElement as defineCustomElementPnParcelTracker } from './pn-parcel-tracker.js';
|
|
43
47
|
export { PnPexPricefinder, defineCustomElement as defineCustomElementPnPexPricefinder } from './pn-pex-pricefinder.js';
|
|
44
48
|
export { PnPlayOnScroll, defineCustomElement as defineCustomElementPnPlayOnScroll } from './pn-play-on-scroll.js';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface PnCtaBlock extends Components.PnCtaBlock, HTMLElement {}
|
|
4
|
+
export const PnCtaBlock: {
|
|
5
|
+
prototype: PnCtaBlock;
|
|
6
|
+
new (): PnCtaBlock;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
|
|
2
|
+
|
|
3
|
+
const pnCtaBlockCss = "pn-cta-block .cta-block{display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;-ms-flex-direction:column;flex-direction:column;border-radius:2.4rem;padding:3.2rem 2.4rem;width:100%}@media screen and (min-width: 768px){pn-cta-block .cta-block{-ms-flex-direction:row;flex-direction:row;padding:2.4rem}}@media screen and (min-width: 1140px){pn-cta-block .cta-block{margin-right:auto;margin-left:auto;max-width:95%}}@media screen and (min-width: 1440px){pn-cta-block .cta-block{max-width:90%}}pn-cta-block .cta-block[pn-background-color=blue25]{background-color:#EFFBFF}pn-cta-block .cta-block[pn-background-color=coral50]{background-color:#FDEFEE}pn-cta-block .cta-block[pn-background-color=gray25]{background-color:#F9F8F8}pn-cta-block .cta-block[pn-background-color=green25]{background-color:#EDFBF3}pn-cta-block .cta-block--content-top .cta-block__content{-ms-flex-pack:start;justify-content:flex-start}@media screen and (min-width: 768px){pn-cta-block .cta-block--large .cta-block__heading{font-size:3.6rem}}@media screen and (min-width: 768px){pn-cta-block .cta-block--large .cta-block__text{font-size:2rem}}pn-cta-block .cta-block--small{margin-right:auto;margin-left:auto;width:auto}@media screen and (min-width: 992px){pn-cta-block .cta-block--small{max-width:75%}}pn-cta-block .cta-block--center{-ms-flex-align:center;align-items:center;-ms-flex-direction:column;flex-direction:column;gap:1.6rem;padding:3.2rem 2.4rem;text-align:center}@media screen and (min-width: 768px){pn-cta-block .cta-block--center .cta-block__content{max-width:74rem;padding:0}}pn-cta-block .cta-block--center .cta-block__action{margin-top:0.8rem}pn-cta-block .cta-block--center .cta-block__action>[slot=cta-button]{gap:0.8rem}@media screen and (min-width: 768px){pn-cta-block .cta-block--center .cta-block__action{-ms-flex-direction:row;flex-direction:row;gap:2.4rem;margin-top:1.6rem}pn-cta-block .cta-block--center .cta-block__action.cta-block__button{margin-bottom:0}pn-cta-block .cta-block--center .cta-block__action>[slot=cta-button]{-ms-flex-direction:row;flex-direction:row;gap:2.4rem}}@media screen and (min-width: 768px){pn-cta-block .cta-block--center .cta-block__image-wrapper{display:block}}pn-cta-block .cta-block--center .cta-block__image-wrapper>[slot=illustration]{padding-right:0}pn-cta-block .cta-block__image-wrapper{margin-bottom:1.6rem}pn-cta-block .cta-block__image-wrapper>[slot=illustration]>picture>img{border-radius:0.8rem;max-width:100%}@media screen and (min-width: 768px){pn-cta-block .cta-block__image-wrapper{display:none;max-width:20%}}@media screen and (min-width: 992px){pn-cta-block .cta-block__image-wrapper{display:block;margin-bottom:0}pn-cta-block .cta-block__image-wrapper>[slot=illustration]{padding-right:3.2rem}}pn-cta-block .cta-block__content{display:-ms-flexbox;display:flex;-ms-flex:1;flex:1;-ms-flex-direction:column;flex-direction:column;-ms-flex-pack:center;justify-content:center}@media screen and (min-width: 768px){pn-cta-block .cta-block__content{padding-right:2.4rem}}@media screen and (min-width: 768px){pn-cta-block .cta-block__content .cta-block__heading{max-width:74rem}}pn-cta-block .cta-block__content .cta-block__text{margin-bottom:2.4rem}@media screen and (min-width: 768px){pn-cta-block .cta-block__content .cta-block__text{max-width:74rem}}pn-cta-block .cta-block__heading{margin-bottom:0.8rem}pn-cta-block .cta-block__action{display:-ms-flexbox;display:flex}pn-cta-block .cta-block__action>[slot=cta-button]{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-direction:column;flex-direction:column;-ms-flex-pack:center;justify-content:center;row-gap:1.6rem}@media screen and (min-width: 768px){pn-cta-block .cta-block__action>[slot=cta-button]{gap:1.6rem;margin-top:0}}pn-cta-block .cta-block__action>[slot=cta-button]>a{color:#005D92;font-weight:500;font-size:1.6rem;padding:0.1rem;text-decoration:none}pn-cta-block .cta-block__action>[slot=cta-button]>a pn-icon svg{-webkit-transition:-webkit-transform 0.3s ease-in-out;transition:-webkit-transform 0.3s ease-in-out;transition:transform 0.3s ease-in-out;transition:transform 0.3s ease-in-out, -webkit-transform 0.3s ease-in-out}pn-cta-block .cta-block__action>[slot=cta-button]>a pn-icon svg path{fill:#005D92}pn-cta-block .cta-block__action>[slot=cta-button]>a:hover pn-icon svg{-webkit-transition:-webkit-transform 0.3s ease-in-out;transition:-webkit-transform 0.3s ease-in-out;transition:transform 0.3s ease-in-out;transition:transform 0.3s ease-in-out, -webkit-transform 0.3s ease-in-out;-webkit-transform:translateX(0.3rem);transform:translateX(0.3rem)}pn-cta-block .cta-block__action>[slot=cta-button]>a:hover pn-icon svg path{fill:#005D92}";
|
|
4
|
+
|
|
5
|
+
const PnCtaBlock$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
6
|
+
constructor() {
|
|
7
|
+
super();
|
|
8
|
+
this.__registerHost();
|
|
9
|
+
this.heading = null;
|
|
10
|
+
this.bodyText = null;
|
|
11
|
+
this.pnBackgroundColor = null;
|
|
12
|
+
this.isLarge = false;
|
|
13
|
+
this.isCentered = false;
|
|
14
|
+
this.isSmall = false;
|
|
15
|
+
this.contentTop = false;
|
|
16
|
+
this.hasIllustrationSlot = true;
|
|
17
|
+
this.hasButtonSlot = true;
|
|
18
|
+
}
|
|
19
|
+
componentWillLoad() {
|
|
20
|
+
this.hasIllustrationSlot = !!this.hostElement.querySelector('[slot="illustration"]');
|
|
21
|
+
this.hasButtonSlot = !!this.hostElement.querySelector('[slot="cta-button"]');
|
|
22
|
+
}
|
|
23
|
+
render() {
|
|
24
|
+
return (h(Host, null, h("div", { "pn-background-color": this.pnBackgroundColor, class: `cta-block ${this.isLarge ? 'cta-block--large' : ''} ${this.isCentered ? 'cta-block--center' : ''} ${(this.isSmall ? 'cta-block--small' : '')} ${this.contentTop ? 'cta-block--content-top' : ''}` }, h("div", { class: "cta-block__image-wrapper" }, h("slot", { name: "illustration" })), h("div", { class: "cta-block__content" }, h("h2", { class: "cta-block__heading" }, this.heading), h("p", { class: "cta-block__text" }, this.bodyText)), h("div", { class: "cta-block__action" }, h("slot", { name: "cta-button" })))));
|
|
25
|
+
}
|
|
26
|
+
get hostElement() { return this; }
|
|
27
|
+
static get style() { return pnCtaBlockCss; }
|
|
28
|
+
}, [4, "pn-cta-block", {
|
|
29
|
+
"heading": [1],
|
|
30
|
+
"bodyText": [1, "body-text"],
|
|
31
|
+
"pnBackgroundColor": [1, "pn-background-color"],
|
|
32
|
+
"isLarge": [4, "is-large"],
|
|
33
|
+
"isCentered": [4, "is-centered"],
|
|
34
|
+
"isSmall": [4, "is-small"],
|
|
35
|
+
"contentTop": [4, "content-top"],
|
|
36
|
+
"hasIllustrationSlot": [32],
|
|
37
|
+
"hasButtonSlot": [32]
|
|
38
|
+
}]);
|
|
39
|
+
function defineCustomElement$1() {
|
|
40
|
+
if (typeof customElements === "undefined") {
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
const components = ["pn-cta-block"];
|
|
44
|
+
components.forEach(tagName => { switch (tagName) {
|
|
45
|
+
case "pn-cta-block":
|
|
46
|
+
if (!customElements.get(tagName)) {
|
|
47
|
+
customElements.define(tagName, PnCtaBlock$1);
|
|
48
|
+
}
|
|
49
|
+
break;
|
|
50
|
+
} });
|
|
51
|
+
}
|
|
52
|
+
defineCustomElement$1();
|
|
53
|
+
|
|
54
|
+
const PnCtaBlock = PnCtaBlock$1;
|
|
55
|
+
const defineCustomElement = defineCustomElement$1;
|
|
56
|
+
|
|
57
|
+
export { PnCtaBlock, defineCustomElement };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface PnDropdownWithMultiInputRowsRow extends Components.PnDropdownWithMultiInputRowsRow, HTMLElement {}
|
|
4
|
+
export const PnDropdownWithMultiInputRowsRow: {
|
|
5
|
+
prototype: PnDropdownWithMultiInputRowsRow;
|
|
6
|
+
new (): PnDropdownWithMultiInputRowsRow;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { P as PnDropdownWithMultiInputRowsRow$1, d as defineCustomElement$1 } from './pn-dropdown-with-multi-input-rows-row2.js';
|
|
2
|
+
|
|
3
|
+
const PnDropdownWithMultiInputRowsRow = PnDropdownWithMultiInputRowsRow$1;
|
|
4
|
+
const defineCustomElement = defineCustomElement$1;
|
|
5
|
+
|
|
6
|
+
export { PnDropdownWithMultiInputRowsRow, defineCustomElement };
|