@progressive-development/pd-order 0.1.125 → 0.1.127

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 (52) hide show
  1. package/dist/locales/be.js +15 -0
  2. package/dist/locales/de.js +15 -0
  3. package/dist/locales/en.js +15 -0
  4. package/dist/node_modules/@progressive-development/pd-contact/pd-contact.js +2 -0
  5. package/dist/node_modules/@progressive-development/pd-contact/src/PdContact.js +566 -0
  6. package/dist/node_modules/@progressive-development/pd-content/pd-collapse.js +2 -0
  7. package/dist/node_modules/@progressive-development/pd-content/pd-edit-content.js +2 -0
  8. package/dist/node_modules/@progressive-development/pd-content/src/PdCollapse.js +135 -0
  9. package/dist/node_modules/@progressive-development/pd-content/src/PdEditContent.js +223 -0
  10. package/dist/node_modules/@progressive-development/pd-dialog/pd-popup.js +2 -0
  11. package/dist/node_modules/@progressive-development/pd-dialog/src/PdPopup.js +112 -0
  12. package/dist/node_modules/@progressive-development/pd-forms/pd-checkbox.js +2 -0
  13. package/dist/node_modules/@progressive-development/pd-forms/pd-form-container.js +2 -0
  14. package/dist/node_modules/@progressive-development/pd-forms/pd-form-row.js +2 -0
  15. package/dist/node_modules/@progressive-development/pd-forms/pd-hover-box.js +2 -0
  16. package/dist/node_modules/@progressive-development/pd-forms/pd-input.js +2 -0
  17. package/dist/node_modules/@progressive-development/pd-forms/pd-radio-group.js +2 -0
  18. package/dist/node_modules/@progressive-development/pd-forms/src/PdBaseInputElement.js +86 -0
  19. package/dist/node_modules/@progressive-development/pd-forms/src/PdBaseUi.js +33 -0
  20. package/dist/node_modules/@progressive-development/pd-forms/src/PdBaseUiInput.js +229 -0
  21. package/dist/node_modules/@progressive-development/pd-forms/src/PdCheckbox.js +230 -0
  22. package/dist/node_modules/@progressive-development/pd-forms/src/PdFormContainer.js +167 -0
  23. package/dist/node_modules/@progressive-development/pd-forms/src/PdFormRow.js +92 -0
  24. package/dist/node_modules/@progressive-development/pd-forms/src/PdHoverBox.js +108 -0
  25. package/dist/node_modules/@progressive-development/pd-forms/src/PdInput.js +79 -0
  26. package/dist/node_modules/@progressive-development/pd-forms/src/PdRadioGroup.js +72 -0
  27. package/dist/node_modules/@progressive-development/pd-forms/src/shared-input-field-styles.js +152 -0
  28. package/dist/node_modules/@progressive-development/pd-forms/src/shared-input-styles.js +64 -0
  29. package/dist/node_modules/@progressive-development/pd-icon/pd-icon.js +4 -0
  30. package/dist/node_modules/@progressive-development/pd-icon/src/PdIcon.js +595 -0
  31. package/dist/node_modules/@progressive-development/pd-price/pd-pricetable.js +2 -0
  32. package/dist/node_modules/@progressive-development/pd-price/src/PdPricetable.js +149 -0
  33. package/dist/node_modules/fecha/lib/fecha.js +200 -0
  34. package/dist/node_modules/lit/node_modules/lit-html/directive.js +27 -0
  35. package/dist/node_modules/lit/node_modules/lit-html/directives/class-map.js +36 -0
  36. package/dist/node_modules/lit/node_modules/lit-html/lit-html.js +242 -0
  37. package/dist/pd-order-contacts.js +2 -0
  38. package/dist/pd-order-summary.js +2 -0
  39. package/{src → dist/src}/PdOrderContacts.js +66 -88
  40. package/{src → dist/src}/PdOrderSummary.js +92 -126
  41. package/package.json +16 -5
  42. package/.editorconfig +0 -29
  43. package/.storybook/main.js +0 -3
  44. package/.storybook/server.mjs +0 -8
  45. package/demo/index.html +0 -29
  46. package/pd-order-contacts.js +0 -3
  47. package/pd-order-summary.js +0 -3
  48. package/stories/booking.stories.js +0 -26
  49. package/stories/index.stories.js +0 -17
  50. package/stories/order-contacts.stories.js +0 -105
  51. package/stories/order-summary.stories.js +0 -103
  52. package/vite.config.js +0 -25
@@ -1,25 +1,13 @@
1
- /* eslint-disable lit-a11y/click-events-have-key-events */
2
- /* eslint-disable lit-a11y/anchor-is-valid */
1
+ import { LitElement, css, html } from "lit";
2
+ import { msg } from "@lit/localize";
3
+ import "../node_modules/@progressive-development/pd-content/pd-collapse.js";
4
+ import "../node_modules/@progressive-development/pd-contact/pd-contact.js";
5
+ import { PDFontStyles } from "@progressive-development/pd-shared-styles";
3
6
  /**
4
7
  * @license
5
8
  * Copyright (c) 2021 PD Progressive Development UG. All rights reserved.
6
9
  */
7
-
8
- import { LitElement, html, css } from 'lit';
9
-
10
- import '@progressive-development/pd-content/pd-collapse.js';
11
- import '@progressive-development/pd-contact/pd-contact.js';
12
-
13
- import { PDFontStyles } from '@progressive-development/pd-shared-styles';
14
-
15
- /**
16
- * An example element.
17
- *
18
- * @slot - This element has a slot
19
- * @csspart button - The button
20
- */
21
- export class PdOrderContacts extends LitElement {
22
-
10
+ class PdOrderContacts extends LitElement {
23
11
  static get styles() {
24
12
  return [
25
13
  PDFontStyles,
@@ -59,69 +47,60 @@ export class PdOrderContacts extends LitElement {
59
47
  .first-contact {
60
48
  min-width: 200px;
61
49
  }
62
- `];
63
- }
64
-
65
- static get properties() {
66
- return {
50
+ `
51
+ ];
52
+ }
53
+ static get properties() {
54
+ return {
67
55
  /**
68
56
  * List with required contact fields, if not set use default (previous existing values to be consitent during update)
69
57
  */
70
58
  requiredFields: { type: Array },
71
- orderContact: { type: Object },
72
- billingContact: { type: Object },
73
- summary: { type: Boolean },
74
- withPayment: { type: Boolean },
75
- match: { type: Object },
76
- _ownBillingContact: { type: Boolean },
77
- };
78
- }
79
-
80
- constructor() {
81
- super();
82
- this._ownBillingContact = false;
83
- this.requiredFields = [];
84
- this.match = {};
85
- }
86
-
87
- connectedCallback() {
59
+ orderContact: { type: Object },
60
+ billingContact: { type: Object },
61
+ summary: { type: Boolean },
62
+ withPayment: { type: Boolean },
63
+ match: { type: Object },
64
+ _ownBillingContact: { type: Boolean }
65
+ };
66
+ }
67
+ constructor() {
68
+ super();
69
+ this._ownBillingContact = false;
70
+ this.requiredFields = [];
71
+ this.match = {};
72
+ }
73
+ connectedCallback() {
88
74
  super.connectedCallback();
89
- // add validation event listener
90
- this.addEventListener('validate-form', this._validateForm);
75
+ this.addEventListener("validate-form", this._validateForm);
91
76
  }
92
-
93
77
  disconnectedCallback() {
94
78
  super.connectedCallback();
95
- // add validation event listener
96
- this.removeEventListener('validate-form', this._validateForm);
79
+ this.removeEventListener("validate-form", this._validateForm);
97
80
  }
98
-
99
81
  firstUpdated() {
100
- // only one of the collapse shoud be open
101
- this.addEventListener('toggle-accordion', e => {
102
- const origin = e.composedPath()[0]; // Warum geht target nicht?
82
+ this.addEventListener("toggle-accordion", (e) => {
83
+ const origin = e.composedPath()[0];
103
84
  const collapsiblePanels = this.shadowRoot.querySelectorAll(
104
- 'pd-collapse'
85
+ "pd-collapse"
105
86
  );
106
- collapsiblePanels.forEach(panel => {
87
+ collapsiblePanels.forEach((panel) => {
107
88
  if (panel !== origin) {
108
89
  panel.close();
109
90
  }
110
91
  });
111
92
  });
112
- }
113
-
114
- render() {
115
- if (this.summary) {
116
- return this._renderSummary();
117
- }
118
- return this._renderEditContacts();
119
- }
120
-
121
- _renderEditContacts() {
122
- return html`
93
+ }
94
+ render() {
95
+ if (this.summary) {
96
+ return this._renderSummary();
97
+ }
98
+ return this._renderEditContacts();
99
+ }
100
+ _renderEditContacts() {
101
+ return html`
123
102
  <pd-collapse id="orderContactCollapseId" active>
124
- <div slot="header" class="header">Adres onderhoud</div>
103
+ <div slot="header" class="header">${msg("Adresse", { id: "pd.order.contacts.orderContact.inputHeader" })}</div>
125
104
  <pd-contact
126
105
  id="orderContactId"
127
106
  class="collapse-contact"
@@ -134,14 +113,15 @@ export class PdOrderContacts extends LitElement {
134
113
 
135
114
  ${this.withPayment ? html`
136
115
  <pd-collapse id="billingContactCollapseId">
137
- <div slot="header" class="header">Facturatieadres</div>
116
+ <div slot="header" class="header">${msg("Rechnungsadresse", { id: "pd.order.contacts.billingContact.inputHeader" })}</div>
138
117
  <div slot="content">
139
- ${this._ownBillingContact
140
- ? html`
118
+ ${this._ownBillingContact ? html`
141
119
  <p>
142
- <a @click="${() => {this._ownBillingContact = false;}}"
143
- >Gebruik adres onderhoud als facturatieadres</a
144
- >
120
+ <a @click="${() => {
121
+ this._ownBillingContact = false;
122
+ }}">
123
+ ${msg("Gleiche Rechnungsadresse", { id: "pd.order.contacts.billingContact.sameBillingLink" })}
124
+ </a>
145
125
  </p>
146
126
  <pd-contact
147
127
  id="billingContactId"
@@ -149,21 +129,22 @@ export class PdOrderContacts extends LitElement {
149
129
  .requiredField="${this.requiredFields}"
150
130
  .contact="${this.billingContact}"
151
131
  ></pd-contact>
152
- `
153
- : html`
154
- <p>Het adres waar het onderhoud plaatsvindt, wordt gebruikt als facturatieadres.</p>
132
+ ` : html`
133
+ <p>${msg("Die Adresse, wird auch als Rechnungsadresse verwendet.", { id: "pd.order.contacts.billingContact.sameBillingText" })}</p>
155
134
  <p>
156
135
  <a @click="${() => {
157
- this._ownBillingContact = true;}}">Creëer een ander facturatieadres.</a>
136
+ this._ownBillingContact = true;
137
+ }}">
138
+ ${msg("Andere Rechnungsadresse verwenden", { id: "pd.order.contacts.billingContact.otherBillingLink" })}
139
+ </a>
158
140
  </p>
159
141
  `}
160
142
  </div>
161
- </pd-collapse>`: ''}
143
+ </pd-collapse>` : ""}
162
144
  `;
163
- }
164
-
165
- _renderSummary() {
166
- return html`
145
+ }
146
+ _renderSummary() {
147
+ return html`
167
148
  <div class="summary-box">
168
149
  <pd-contact
169
150
  class="first-contact"
@@ -177,26 +158,21 @@ export class PdOrderContacts extends LitElement {
177
158
  addressRef="adres onderhoud"
178
159
  .contact="${this.billingContact}"
179
160
  summary
180
- ></pd-contact>` : ''}
161
+ ></pd-contact>` : ""}
181
162
  </div>
182
163
  `;
183
- }
184
-
164
+ }
185
165
  _validateForm(e) {
186
-
187
166
  if (e.detail && !e.detail.singleElement) {
188
167
  this.shadowRoot.getElementById("orderContactId").dispatchEvent(
189
168
  new CustomEvent("validate-form", {
190
169
  detail: e.detail
191
170
  })
192
171
  );
193
-
194
172
  const errorSize = e.detail.errorMap.size;
195
173
  if (errorSize > 0) {
196
- this.shadowRoot.getElementById('orderContactCollapseId').open();
174
+ this.shadowRoot.getElementById("orderContactCollapseId").open();
197
175
  }
198
-
199
- // if billing is set too
200
176
  if (this._ownBillingContact) {
201
177
  this.shadowRoot.getElementById("billingContactId").dispatchEvent(
202
178
  new CustomEvent("validate-form", {
@@ -204,10 +180,12 @@ export class PdOrderContacts extends LitElement {
204
180
  })
205
181
  );
206
182
  if (e.detail.errorMap.size > errorSize) {
207
- this.shadowRoot.getElementById('billingContactCollapseId').open();
183
+ this.shadowRoot.getElementById("billingContactCollapseId").open();
208
184
  }
209
185
  }
210
186
  }
211
187
  }
212
188
  }
213
-
189
+ export {
190
+ PdOrderContacts
191
+ };
@@ -1,40 +1,28 @@
1
- /* eslint-disable lit-a11y/anchor-is-valid */
1
+ import { LitElement, css, html } from "lit";
2
+ import { msg } from "@lit/localize";
3
+ import { format } from "../node_modules/fecha/lib/fecha.js";
4
+ import "../node_modules/@progressive-development/pd-forms/pd-checkbox.js";
5
+ import "../node_modules/@progressive-development/pd-forms/pd-radio-group.js";
6
+ import "../node_modules/@progressive-development/pd-content/pd-edit-content.js";
7
+ import "../node_modules/@progressive-development/pd-price/pd-pricetable.js";
8
+ import "../node_modules/@progressive-development/pd-dialog/pd-popup.js";
9
+ import "../node_modules/@progressive-development/pd-forms/pd-form-container.js";
10
+ import "../node_modules/@progressive-development/pd-forms/pd-form-row.js";
11
+ import { PDFontStyles, PDColorStyles } from "@progressive-development/pd-shared-styles";
12
+ import "../pd-order-contacts.js";
2
13
  /**
3
14
  * @license
4
15
  * Copyright (c) 2021 PD Progressive Development UG. All rights reserved.
5
16
  */
6
-
7
- import { LitElement, html, css } from 'lit';
8
- import { format } from 'fecha';
9
-
10
- import '@progressive-development/pd-forms/pd-checkbox.js';
11
- import '@progressive-development/pd-forms/pd-radio-group.js';
12
- import '@progressive-development/pd-content/pd-edit-content.js';
13
- import '@progressive-development/pd-price/pd-pricetable.js';
14
- import '@progressive-development/pd-dialog/pd-popup.js';
15
- import '@progressive-development/pd-forms/pd-form-container.js';
16
- import '@progressive-development/pd-forms/pd-form-row.js';
17
-
18
- import { PDFontStyles, PDColorStyles } from '@progressive-development/pd-shared-styles';
19
-
20
- import '../pd-order-contacts.js';
21
-
22
- /**
23
- * An example element.
24
- *
25
- * @slot - This element has a slot
26
- * @csspart button - The button
27
- */
28
- export class PdOrderSummary extends LitElement {
29
-
17
+ class PdOrderSummary extends LitElement {
30
18
  /**
31
19
  * @event go-to
32
20
  */
33
-
34
- static get styles() {
35
- return [
36
- PDFontStyles, PDColorStyles,
37
- css`
21
+ static get styles() {
22
+ return [
23
+ PDFontStyles,
24
+ PDColorStyles,
25
+ css`
38
26
  :host {
39
27
  display: block;
40
28
  }
@@ -93,58 +81,52 @@
93
81
  max-width: 5rem;
94
82
  }
95
83
  }
96
- `];
97
- }
98
-
99
- static get properties() {
100
- return {
101
- orderSteps: { type: Array },
102
- withPayment: { type: Boolean },
103
- withAgreement: { type: Boolean },
104
- order: { type: Object },
105
- };
106
- }
107
-
108
- constructor() {
109
- super();
110
- this.orderSteps = [];
111
- this.order = {};
112
- }
113
-
114
- firstUpdated() {
115
- this.addEventListener('edit-content', e => {
116
- this.dispatchEvent(
117
- new CustomEvent('go-to', {
118
- detail: {
119
- step: e.detail.step,
120
- },
121
- bubbles: true,
122
- composed: true,
123
- })
124
- );
125
- });
126
-
127
- this.addEventListener('validate-form', this._validateForm);
128
- }
129
-
130
- render() {
131
-
84
+ `
85
+ ];
86
+ }
87
+ static get properties() {
88
+ return {
89
+ orderSteps: { type: Array },
90
+ withPayment: { type: Boolean },
91
+ withAgreement: { type: Boolean },
92
+ order: { type: Object }
93
+ };
94
+ }
95
+ constructor() {
96
+ super();
97
+ this.orderSteps = [];
98
+ this.order = {};
99
+ }
100
+ firstUpdated() {
101
+ this.addEventListener("edit-content", (e) => {
102
+ this.dispatchEvent(
103
+ new CustomEvent("go-to", {
104
+ detail: {
105
+ step: e.detail.step
106
+ },
107
+ bubbles: true,
108
+ composed: true
109
+ })
110
+ );
111
+ });
112
+ this.addEventListener("validate-form", this._validateForm);
113
+ }
114
+ render() {
132
115
  if (!this.order) {
133
116
  return html`<p>No order is set</p>`;
134
117
  }
135
-
136
118
  return html`
137
- <h3>Overzicht</h3>
119
+ <h3>${msg("Übersicht", { id: "pd.order.summary.title" })}</h3>
138
120
  <div class="edit-summary-container">
139
121
  ${this.orderSteps.map((step, index) => {
140
- switch (step.key) {
141
- case 'zip':
142
- case 'booking':
143
- return this._getBookingSummary(index + 1, step);
144
- case 'contacts':
145
- return this._getContactsSummary(index + 1, step);
146
- default:
147
- return html`
122
+ switch (step.key) {
123
+ case "zip":
124
+ case "booking":
125
+ return this._getBookingSummary(index + 1, step);
126
+ case "contacts":
127
+ return this._getContactsSummary(index + 1, step);
128
+ default:
129
+ return html`
148
130
  <pd-edit-content
149
131
  contentTitle="${step.name}"
150
132
  stepNumber="${index + 1}"
@@ -153,13 +135,13 @@
153
135
  <slot name="${step.key}"></slot>
154
136
  </pd-edit-content>
155
137
  `;
156
- }
157
- })}
138
+ }
139
+ })}
158
140
  </div>
159
141
 
160
142
  ${this.order.priceData ? html`
161
143
  <div class="payment">
162
- <h3>Facturatie</h3>
144
+ <h3>${msg("Rechnung", { id: "pd.order.summary.billing" })}</h3>
163
145
  <!--
164
146
  <pd-radio-group id="paymentGroupId" style="--group-direction: column;">
165
147
  <pd-checkbox name="direct" value="false">
@@ -178,7 +160,7 @@
178
160
  .priceData="${this.order.priceData}"
179
161
  ></pd-pricetable>
180
162
  </div>
181
- ` : ''}
163
+ ` : ""}
182
164
 
183
165
  ${this.withAgreement ? html`
184
166
  <pd-form-container id="submitSummaryFormId">
@@ -188,14 +170,12 @@
188
170
  valueName="agreeId"
189
171
  class="agree-box"
190
172
  required
191
- requiredMsg="Ga akkoord met de algemene voorwaarden om uw order te bevestigen."
173
+ requiredMsg="${msg("Bitte stimmen Sie den Allgemeinen Geschäftsbedingungen zu, um fortzufahren.", { id: "pd.order.summary.agree.required" })}"
192
174
  >
193
- Ga akkoord met onze
194
- <a
195
- @click="${this._openTermsAndConditions}"
196
- @keypress="${this._openTermsAndConditions}"
197
- >algemene voorwaarden</a
198
- >
175
+ ${msg(
176
+ html`Stimmen Sie unseren <a @click="${this._openTermsAndConditions}" @keypress="${this._openTermsAndConditions}">Allgemeinen Geschäftsbedingungen</a> zu`,
177
+ { id: "pd.order.summary.agree.link" }
178
+ )}
199
179
  </pd-checkbox>
200
180
  </pd-form-row>
201
181
  </pd-form-container>
@@ -205,9 +185,8 @@
205
185
  </pd-popup>
206
186
  ` : ""}
207
187
  `;
208
- }
209
-
210
- _validateForm(e) {
188
+ }
189
+ _validateForm(e) {
211
190
  if (e.detail && !e.detail.singleElement && this.withAgreement) {
212
191
  this.shadowRoot.getElementById("submitSummaryFormId").dispatchEvent(
213
192
  new CustomEvent("validate-form", {
@@ -216,18 +195,16 @@
216
195
  );
217
196
  }
218
197
  }
219
-
220
- _getBookingSummary(index, step) {
221
- let date;
222
- if (this.order.selectedDate) {
223
- date = format(this.order.selectedDate, 'DD/MM/YYYY');
224
- }
225
- const bookingData = [{ name: 'Postcode:', val: this.order.zip }];
226
- if (date) {
227
- bookingData.push({ name: 'Datum van herstelling:', val: date });
228
- }
229
-
230
- return html`
198
+ _getBookingSummary(index, step) {
199
+ let date;
200
+ if (this.order.selectedDate) {
201
+ date = format(this.order.selectedDate, "DD/MM/YYYY");
202
+ }
203
+ const bookingData = [{ name: "Postcode:", val: this.order.zip }];
204
+ if (date) {
205
+ bookingData.push({ name: "Datum van herstelling:", val: date });
206
+ }
207
+ return html`
231
208
  <pd-edit-content
232
209
  contentTitle="${step.name}"
233
210
  stepNumber="${index}"
@@ -235,17 +212,15 @@
235
212
  >
236
213
  </pd-edit-content>
237
214
  `;
238
- }
239
-
240
- _getContactsSummary(index, step) {
241
- return html`
215
+ }
216
+ _getContactsSummary(index, step) {
217
+ return html`
242
218
  <pd-edit-content
243
219
  contentTitle="${step.name}"
244
220
  stepNumber="${index}"
245
221
  ?editDisabled="${this.order.withLogin}"
246
222
  >
247
- ${this.order.contacts
248
- ? html`
223
+ ${this.order.contacts ? html`
249
224
  <pd-order-contacts
250
225
  ?withPayment="${this.withPayment}"
251
226
  .orderContact="${this.order.contacts.orderContact}"
@@ -253,24 +228,15 @@
253
228
  summary
254
229
  >
255
230
  </pd-order-contacts>
256
- `
257
- : ''}
231
+ ` : ""}
258
232
  </pd-edit-content>
259
233
  `;
260
- }
261
-
262
-
263
- _openTermsAndConditions(e) {
264
- // TODO: [TIM-28] Bei key-pressed event => Auf enter prüfen...
265
-
266
- // Alternative über eigenen Link: window.open(url, '_blank').focus();
267
-
268
- // open popup
269
- this.shadowRoot.getElementById('agreePopupId').showPopup();
270
-
271
- // stop event, do not edit check-box, when link is clicked
272
- e.stopPropagation();
273
- }
274
-
234
+ }
235
+ _openTermsAndConditions(e) {
236
+ this.shadowRoot.getElementById("agreePopupId").showPopup();
237
+ e.stopPropagation();
238
+ }
275
239
  }
276
-
240
+ export {
241
+ PdOrderSummary
242
+ };
package/package.json CHANGED
@@ -3,14 +3,23 @@
3
3
  "description": "Progressive Development Order Component",
4
4
  "author": "PD Progressive Development",
5
5
  "license": "SEE LICENSE IN LICENSE",
6
- "version": "0.1.125",
6
+ "version": "0.1.127",
7
7
  "exports": {
8
8
  "./pd-order-contacts": "./dist/pd-order-contacts.js",
9
- "./pd-order-summary": "./dist/pd-order-summary.js"
9
+ "./pd-order-summary": "./dist/pd-order-summary.js",
10
+ "./locales/be": "./dist/generated/locales/be.js",
11
+ "./locales/de": "./dist/generated/locales/de.js",
12
+ "./locales/en": "./dist/generated/locales/en.js"
10
13
  },
14
+ "files": [
15
+ "dist/",
16
+ "package.json",
17
+ "README.md",
18
+ "LICENSE"
19
+ ],
11
20
  "scripts": {
12
21
  "analyze": "cem analyze --litelement",
13
- "dev": "vite",
22
+ "start": "vite",
14
23
  "build": "vite build",
15
24
  "preview": "vite preview",
16
25
  "lint": "eslint --ext .js,.html . --ignore-path .gitignore && prettier \"**/*.{js,html}\" --check --ignore-path .gitignore",
@@ -31,7 +40,8 @@
31
40
  "@progressive-development/pd-price": "^0.1.10",
32
41
  "@progressive-development/pd-shared-styles": "^0.1.1",
33
42
  "fecha": "^4.2.3",
34
- "lit": "^2.8.0"
43
+ "lit": "^2.8.0",
44
+ "@lit/localize": "^0.11.4"
35
45
  },
36
46
  "devDependencies": {
37
47
  "@custom-elements-manifest/analyzer": "^0.4.17",
@@ -48,7 +58,8 @@
48
58
  "lint-staged": "^10.5.4",
49
59
  "prettier": "^2.8.8",
50
60
  "storybook": "^7.6.4",
51
- "vite": "^5.4.11"
61
+ "vite": "^5.4.11",
62
+ "vitest": "^2.1.8"
52
63
  },
53
64
  "customElements": "custom-elements.json",
54
65
  "eslintConfig": {
package/.editorconfig DELETED
@@ -1,29 +0,0 @@
1
- # EditorConfig helps developers define and maintain consistent
2
- # coding styles between different editors and IDEs
3
- # editorconfig.org
4
-
5
- root = true
6
-
7
-
8
- [*]
9
-
10
- # Change these settings to your own preference
11
- indent_style = space
12
- indent_size = 2
13
-
14
- # We recommend you to keep these unchanged
15
- end_of_line = lf
16
- charset = utf-8
17
- trim_trailing_whitespace = true
18
- insert_final_newline = true
19
-
20
- [*.md]
21
- trim_trailing_whitespace = false
22
-
23
- [*.json]
24
- indent_size = 2
25
-
26
- [*.{html,js,md}]
27
- block_comment_start = /**
28
- block_comment = *
29
- block_comment_end = */
@@ -1,3 +0,0 @@
1
- module.exports = {
2
- stories: ['../stories/**/*.stories.{js,md,mdx}'],
3
- };
@@ -1,8 +0,0 @@
1
- import { storybookPlugin } from '@web/dev-server-storybook';
2
- import baseConfig from '../web-dev-server.config.mjs';
3
-
4
- export default /** @type {import('@web/dev-server').DevServerConfig} */ ({
5
- ...baseConfig,
6
- open: '/',
7
- plugins: [storybookPlugin({ type: 'web-components' }), ...baseConfig.plugins],
8
- });
package/demo/index.html DELETED
@@ -1,29 +0,0 @@
1
- <!doctype html>
2
- <html lang="en-GB">
3
- <head>
4
- <meta charset="utf-8">
5
- <style>
6
- body {
7
- background: #fafafa;
8
- }
9
- </style>
10
- </head>
11
- <body>
12
- <div id="demo"></div>
13
-
14
- <script type="module">
15
- import { html, render } from 'lit';
16
- import '../pd-order.js';
17
-
18
- const title = 'Hello owc World!';
19
- render(
20
- html`
21
- <pd-order .title=${title}>
22
- some light-dom
23
- </pd-order>
24
- `,
25
- document.querySelector('#demo')
26
- );
27
- </script>
28
- </body>
29
- </html>
@@ -1,3 +0,0 @@
1
- import { PdOrderContacts } from './src/PdOrderContacts.js';
2
-
3
- window.customElements.define('pd-order-contacts', PdOrderContacts);
@@ -1,3 +0,0 @@
1
- import { PdOrderSummary } from './src/PdOrderSummary.js';
2
-
3
- window.customElements.define('pd-order-summary', PdOrderSummary);