@biggive/components 202309061001.0.0 → 202309141628.0.0

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.
@@ -261,7 +261,7 @@ const BiggiveCampaignCard = class {
261
261
  this.primaryFigureAmount = undefined;
262
262
  this.secondaryFigureLabel = undefined;
263
263
  this.secondaryFigureAmount = undefined;
264
- this.progressBarCounter = 100;
264
+ this.progressBarCounter = undefined;
265
265
  this.donateButtonLabel = 'Donate now';
266
266
  this.donateButtonUrl = undefined;
267
267
  this.donateButtonColourScheme = 'primary';
@@ -272,8 +272,11 @@ const BiggiveCampaignCard = class {
272
272
  this.isPastCampaign = false;
273
273
  this.datetime = undefined;
274
274
  }
275
+ isEmpty(value) {
276
+ return value === undefined || value === null || value === '';
277
+ }
275
278
  render() {
276
- return (index.h("div", { class: 'container space-below-' + this.spaceBelow.toString() }, index.h("div", { class: "sleeve" }, index.h("div", { onClick: this.handleCardGeneralClick }, this.campaignType !== null ? (index.h("div", { class: "campaign-type" }, index.h("span", null, this.campaignType))) : null, this.banner !== null ? (index.h("div", { class: "image-wrap banner", role: "presentation", style: { 'background-image': 'url(' + this.banner + ')' } })) : (index.h("div", { class: "image-wrap banner" })), index.h("div", { class: "title-wrap" }, index.h("h3", null, this.campaignTitle), index.h("div", { class: "organisation-name" }, "By ", this.organisationName)), index.h("div", { class: "meta-wrap" }, index.h("div", { class: "meta-item" }, index.h("span", { class: "label" }, this.primaryFigureLabel), index.h("span", { class: "text" }, this.primaryFigureAmount)), index.h("div", { class: "meta-item" }, index.h("span", { class: "label" }, this.secondaryFigureLabel), index.h("span", { class: "text" }, this.secondaryFigureAmount))), index.h("div", { class: "progress-bar-wrap" }, index.h("biggive-progress-bar", { counter: this.progressBarCounter, "colour-scheme": "primary" }))), index.h("div", { class: "button-wrap" }, this.isFutureCampaign || this.isPastCampaign ? (index.h("div", { class: "msg-wrapper" }, index.h("biggive-misc-icon", { "background-colour": "white", "icon-colour": "black", icon: "Timer" }), this.isFutureCampaign ? index.h("p", null, "Launches ", this.datetime) : index.h("p", null, "Closed ", this.datetime))) : (index.h("biggive-button", { "full-width": "true", "colour-scheme": this.donateButtonColourScheme, url: this.donateButtonUrl, label: this.donateButtonLabel })), index.h("biggive-button", { "full-width": "true", "colour-scheme": this.moreInfoButtonColourScheme, url: this.moreInfoButtonUrl, label: this.moreInfoButtonLabel })))));
279
+ return (index.h("div", { class: 'container space-below-' + this.spaceBelow.toString() }, index.h("div", { class: "sleeve" }, index.h("div", { onClick: this.handleCardGeneralClick }, this.campaignType !== null ? (index.h("div", { class: "campaign-type" }, index.h("span", null, this.campaignType))) : null, this.banner !== null ? (index.h("div", { class: "image-wrap banner", role: "presentation", style: { 'background-image': 'url(' + this.banner + ')' } })) : (index.h("div", { class: "image-wrap banner" })), index.h("div", { class: "title-wrap" }, index.h("h3", null, this.campaignTitle), index.h("div", { class: "organisation-name" }, "By ", this.organisationName)), this.isEmpty(this.primaryFigureAmount) && this.isEmpty(this.secondaryFigureAmount) ? null : (index.h("div", { class: "meta-wrap" }, this.isEmpty(this.primaryFigureAmount) ? null : (index.h("div", { class: "meta-item" }, index.h("span", { class: "label" }, this.primaryFigureLabel), index.h("span", { class: "text" }, this.primaryFigureAmount))), this.isEmpty(this.secondaryFigureAmount) ? null : (index.h("div", { class: "meta-item" }, index.h("span", { class: "label" }, this.secondaryFigureLabel), index.h("span", { class: "text" }, this.secondaryFigureAmount))))), this.isEmpty(this.progressBarCounter) ? null : (index.h("div", { class: "progress-bar-wrap" }, index.h("biggive-progress-bar", { counter: this.progressBarCounter, "colour-scheme": "primary" })))), index.h("div", { class: "button-wrap" }, this.isFutureCampaign || this.isPastCampaign ? (index.h("div", { class: "msg-wrapper" }, index.h("biggive-misc-icon", { "background-colour": "white", "icon-colour": "black", icon: "Timer" }), this.isFutureCampaign ? index.h("p", null, "Launches ", this.datetime) : index.h("p", null, "Closed ", this.datetime))) : (index.h("biggive-button", { "full-width": "true", "colour-scheme": this.donateButtonColourScheme, url: this.donateButtonUrl, label: this.donateButtonLabel })), index.h("biggive-button", { "full-width": "true", "colour-scheme": this.moreInfoButtonColourScheme, url: this.moreInfoButtonUrl, label: this.moreInfoButtonLabel })))));
277
280
  }
278
281
  };
279
282
  BiggiveCampaignCard.style = biggiveCampaignCardCss;
@@ -1296,6 +1299,9 @@ const BiggiveProgressBar = class {
1296
1299
  this.counter = 100;
1297
1300
  }
1298
1301
  render() {
1302
+ if (this.counter === null || this.counter === undefined) {
1303
+ return null;
1304
+ }
1299
1305
  return (index.h("div", { class: 'progress-bar progress-bar-' + this.colourScheme + ' space-below-' + this.spaceBelow }, index.h("div", { class: "slider" }, index.h("div", { class: "progress", style: { width: `${Math.min(this.counter, 100)}%` } })), index.h("div", { class: "counter" }, this.counter, "%")));
1300
1306
  }
1301
1307
  };
@@ -13,7 +13,7 @@ export class BiggiveCampaignCard {
13
13
  this.primaryFigureAmount = undefined;
14
14
  this.secondaryFigureLabel = undefined;
15
15
  this.secondaryFigureAmount = undefined;
16
- this.progressBarCounter = 100;
16
+ this.progressBarCounter = undefined;
17
17
  this.donateButtonLabel = 'Donate now';
18
18
  this.donateButtonUrl = undefined;
19
19
  this.donateButtonColourScheme = 'primary';
@@ -24,8 +24,11 @@ export class BiggiveCampaignCard {
24
24
  this.isPastCampaign = false;
25
25
  this.datetime = undefined;
26
26
  }
27
+ isEmpty(value) {
28
+ return value === undefined || value === null || value === '';
29
+ }
27
30
  render() {
28
- return (h("div", { class: 'container space-below-' + this.spaceBelow.toString() }, h("div", { class: "sleeve" }, h("div", { onClick: this.handleCardGeneralClick }, this.campaignType !== null ? (h("div", { class: "campaign-type" }, h("span", null, this.campaignType))) : null, this.banner !== null ? (h("div", { class: "image-wrap banner", role: "presentation", style: { 'background-image': 'url(' + this.banner + ')' } })) : (h("div", { class: "image-wrap banner" })), h("div", { class: "title-wrap" }, h("h3", null, this.campaignTitle), h("div", { class: "organisation-name" }, "By ", this.organisationName)), h("div", { class: "meta-wrap" }, h("div", { class: "meta-item" }, h("span", { class: "label" }, this.primaryFigureLabel), h("span", { class: "text" }, this.primaryFigureAmount)), h("div", { class: "meta-item" }, h("span", { class: "label" }, this.secondaryFigureLabel), h("span", { class: "text" }, this.secondaryFigureAmount))), h("div", { class: "progress-bar-wrap" }, h("biggive-progress-bar", { counter: this.progressBarCounter, "colour-scheme": "primary" }))), h("div", { class: "button-wrap" }, this.isFutureCampaign || this.isPastCampaign ? (h("div", { class: "msg-wrapper" }, h("biggive-misc-icon", { "background-colour": "white", "icon-colour": "black", icon: "Timer" }), this.isFutureCampaign ? h("p", null, "Launches ", this.datetime) : h("p", null, "Closed ", this.datetime))) : (h("biggive-button", { "full-width": "true", "colour-scheme": this.donateButtonColourScheme, url: this.donateButtonUrl, label: this.donateButtonLabel })), h("biggive-button", { "full-width": "true", "colour-scheme": this.moreInfoButtonColourScheme, url: this.moreInfoButtonUrl, label: this.moreInfoButtonLabel })))));
31
+ return (h("div", { class: 'container space-below-' + this.spaceBelow.toString() }, h("div", { class: "sleeve" }, h("div", { onClick: this.handleCardGeneralClick }, this.campaignType !== null ? (h("div", { class: "campaign-type" }, h("span", null, this.campaignType))) : null, this.banner !== null ? (h("div", { class: "image-wrap banner", role: "presentation", style: { 'background-image': 'url(' + this.banner + ')' } })) : (h("div", { class: "image-wrap banner" })), h("div", { class: "title-wrap" }, h("h3", null, this.campaignTitle), h("div", { class: "organisation-name" }, "By ", this.organisationName)), this.isEmpty(this.primaryFigureAmount) && this.isEmpty(this.secondaryFigureAmount) ? null : (h("div", { class: "meta-wrap" }, this.isEmpty(this.primaryFigureAmount) ? null : (h("div", { class: "meta-item" }, h("span", { class: "label" }, this.primaryFigureLabel), h("span", { class: "text" }, this.primaryFigureAmount))), this.isEmpty(this.secondaryFigureAmount) ? null : (h("div", { class: "meta-item" }, h("span", { class: "label" }, this.secondaryFigureLabel), h("span", { class: "text" }, this.secondaryFigureAmount))))), this.isEmpty(this.progressBarCounter) ? null : (h("div", { class: "progress-bar-wrap" }, h("biggive-progress-bar", { counter: this.progressBarCounter, "colour-scheme": "primary" })))), h("div", { class: "button-wrap" }, this.isFutureCampaign || this.isPastCampaign ? (h("div", { class: "msg-wrapper" }, h("biggive-misc-icon", { "background-colour": "white", "icon-colour": "black", icon: "Timer" }), this.isFutureCampaign ? h("p", null, "Launches ", this.datetime) : h("p", null, "Closed ", this.datetime))) : (h("biggive-button", { "full-width": "true", "colour-scheme": this.donateButtonColourScheme, url: this.donateButtonUrl, label: this.donateButtonLabel })), h("biggive-button", { "full-width": "true", "colour-scheme": this.moreInfoButtonColourScheme, url: this.moreInfoButtonUrl, label: this.moreInfoButtonLabel })))));
29
32
  }
30
33
  static get is() { return "biggive-campaign-card"; }
31
34
  static get encapsulation() { return "shadow"; }
@@ -131,15 +134,15 @@ export class BiggiveCampaignCard {
131
134
  "type": "string",
132
135
  "mutable": false,
133
136
  "complexType": {
134
- "original": "string",
135
- "resolved": "string",
137
+ "original": "string | null",
138
+ "resolved": "null | string",
136
139
  "references": {}
137
140
  },
138
141
  "required": false,
139
142
  "optional": false,
140
143
  "docs": {
141
144
  "tags": [],
142
- "text": "Label for the primary figure"
145
+ "text": "Label for the primary figure \u2013 may be null or omitted for no label or if there's no figure."
143
146
  },
144
147
  "attribute": "primary-figure-label",
145
148
  "reflect": false
@@ -148,15 +151,15 @@ export class BiggiveCampaignCard {
148
151
  "type": "string",
149
152
  "mutable": false,
150
153
  "complexType": {
151
- "original": "string",
152
- "resolved": "string",
154
+ "original": "string | null",
155
+ "resolved": "null | string",
153
156
  "references": {}
154
157
  },
155
158
  "required": false,
156
159
  "optional": false,
157
160
  "docs": {
158
161
  "tags": [],
159
- "text": "Amount for the primary figure, formatted with currency symbol"
162
+ "text": "Amount for the primary figure, formatted with currency symbol \u2013 null or omit to hide the figure & label."
160
163
  },
161
164
  "attribute": "primary-figure-amount",
162
165
  "reflect": false
@@ -165,15 +168,15 @@ export class BiggiveCampaignCard {
165
168
  "type": "string",
166
169
  "mutable": false,
167
170
  "complexType": {
168
- "original": "string",
169
- "resolved": "string",
171
+ "original": "string | null",
172
+ "resolved": "null | string",
170
173
  "references": {}
171
174
  },
172
175
  "required": false,
173
176
  "optional": false,
174
177
  "docs": {
175
178
  "tags": [],
176
- "text": "Label for the secondary figure"
179
+ "text": "Label for the secondary figure \u2013 may be null or omitted for no label or if there's no figure."
177
180
  },
178
181
  "attribute": "secondary-figure-label",
179
182
  "reflect": false
@@ -182,15 +185,15 @@ export class BiggiveCampaignCard {
182
185
  "type": "string",
183
186
  "mutable": false,
184
187
  "complexType": {
185
- "original": "string",
186
- "resolved": "string",
188
+ "original": "string | null",
189
+ "resolved": "null | string",
187
190
  "references": {}
188
191
  },
189
192
  "required": false,
190
193
  "optional": false,
191
194
  "docs": {
192
195
  "tags": [],
193
- "text": "Amount for the secondary figure, formatted with currency symbol"
196
+ "text": "Amount for the secondary figure, formatted with currency symbol \u2013 null or omit to hide the figure & label."
194
197
  },
195
198
  "attribute": "secondary-figure-amount",
196
199
  "reflect": false
@@ -199,19 +202,18 @@ export class BiggiveCampaignCard {
199
202
  "type": "number",
200
203
  "mutable": false,
201
204
  "complexType": {
202
- "original": "number",
203
- "resolved": "number",
205
+ "original": "number | null",
206
+ "resolved": "null | number",
204
207
  "references": {}
205
208
  },
206
209
  "required": false,
207
210
  "optional": false,
208
211
  "docs": {
209
212
  "tags": [],
210
- "text": "Progress bar percentage"
213
+ "text": "Progress bar percentage \u2013 null or omit to hide the progress bar."
211
214
  },
212
215
  "attribute": "progress-bar-counter",
213
- "reflect": false,
214
- "defaultValue": "100"
216
+ "reflect": false
215
217
  },
216
218
  "donateButtonLabel": {
217
219
  "type": "string",
@@ -6,6 +6,9 @@ export class BiggiveProgressBar {
6
6
  this.counter = 100;
7
7
  }
8
8
  render() {
9
+ if (this.counter === null || this.counter === undefined) {
10
+ return null;
11
+ }
9
12
  return (h("div", { class: 'progress-bar progress-bar-' + this.colourScheme + ' space-below-' + this.spaceBelow }, h("div", { class: "slider" }, h("div", { class: "progress", style: { width: `${Math.min(this.counter, 100)}%` } })), h("div", { class: "counter" }, this.counter, "%")));
10
13
  }
11
14
  static get is() { return "biggive-progress-bar"; }
@@ -62,12 +65,12 @@ export class BiggiveProgressBar {
62
65
  "type": "number",
63
66
  "mutable": false,
64
67
  "complexType": {
65
- "original": "number",
66
- "resolved": "number",
68
+ "original": "number | null",
69
+ "resolved": "null | number | undefined",
67
70
  "references": {}
68
71
  },
69
72
  "required": false,
70
- "optional": false,
73
+ "optional": true,
71
74
  "docs": {
72
75
  "tags": [],
73
76
  "text": "Percentage to show + use for CSS width; round before input if desired"
@@ -23,7 +23,7 @@ const BiggiveCampaignCard$1 = /*@__PURE__*/ proxyCustomElement(class extends HTM
23
23
  this.primaryFigureAmount = undefined;
24
24
  this.secondaryFigureLabel = undefined;
25
25
  this.secondaryFigureAmount = undefined;
26
- this.progressBarCounter = 100;
26
+ this.progressBarCounter = undefined;
27
27
  this.donateButtonLabel = 'Donate now';
28
28
  this.donateButtonUrl = undefined;
29
29
  this.donateButtonColourScheme = 'primary';
@@ -34,8 +34,11 @@ const BiggiveCampaignCard$1 = /*@__PURE__*/ proxyCustomElement(class extends HTM
34
34
  this.isPastCampaign = false;
35
35
  this.datetime = undefined;
36
36
  }
37
+ isEmpty(value) {
38
+ return value === undefined || value === null || value === '';
39
+ }
37
40
  render() {
38
- return (h("div", { class: 'container space-below-' + this.spaceBelow.toString() }, h("div", { class: "sleeve" }, h("div", { onClick: this.handleCardGeneralClick }, this.campaignType !== null ? (h("div", { class: "campaign-type" }, h("span", null, this.campaignType))) : null, this.banner !== null ? (h("div", { class: "image-wrap banner", role: "presentation", style: { 'background-image': 'url(' + this.banner + ')' } })) : (h("div", { class: "image-wrap banner" })), h("div", { class: "title-wrap" }, h("h3", null, this.campaignTitle), h("div", { class: "organisation-name" }, "By ", this.organisationName)), h("div", { class: "meta-wrap" }, h("div", { class: "meta-item" }, h("span", { class: "label" }, this.primaryFigureLabel), h("span", { class: "text" }, this.primaryFigureAmount)), h("div", { class: "meta-item" }, h("span", { class: "label" }, this.secondaryFigureLabel), h("span", { class: "text" }, this.secondaryFigureAmount))), h("div", { class: "progress-bar-wrap" }, h("biggive-progress-bar", { counter: this.progressBarCounter, "colour-scheme": "primary" }))), h("div", { class: "button-wrap" }, this.isFutureCampaign || this.isPastCampaign ? (h("div", { class: "msg-wrapper" }, h("biggive-misc-icon", { "background-colour": "white", "icon-colour": "black", icon: "Timer" }), this.isFutureCampaign ? h("p", null, "Launches ", this.datetime) : h("p", null, "Closed ", this.datetime))) : (h("biggive-button", { "full-width": "true", "colour-scheme": this.donateButtonColourScheme, url: this.donateButtonUrl, label: this.donateButtonLabel })), h("biggive-button", { "full-width": "true", "colour-scheme": this.moreInfoButtonColourScheme, url: this.moreInfoButtonUrl, label: this.moreInfoButtonLabel })))));
41
+ return (h("div", { class: 'container space-below-' + this.spaceBelow.toString() }, h("div", { class: "sleeve" }, h("div", { onClick: this.handleCardGeneralClick }, this.campaignType !== null ? (h("div", { class: "campaign-type" }, h("span", null, this.campaignType))) : null, this.banner !== null ? (h("div", { class: "image-wrap banner", role: "presentation", style: { 'background-image': 'url(' + this.banner + ')' } })) : (h("div", { class: "image-wrap banner" })), h("div", { class: "title-wrap" }, h("h3", null, this.campaignTitle), h("div", { class: "organisation-name" }, "By ", this.organisationName)), this.isEmpty(this.primaryFigureAmount) && this.isEmpty(this.secondaryFigureAmount) ? null : (h("div", { class: "meta-wrap" }, this.isEmpty(this.primaryFigureAmount) ? null : (h("div", { class: "meta-item" }, h("span", { class: "label" }, this.primaryFigureLabel), h("span", { class: "text" }, this.primaryFigureAmount))), this.isEmpty(this.secondaryFigureAmount) ? null : (h("div", { class: "meta-item" }, h("span", { class: "label" }, this.secondaryFigureLabel), h("span", { class: "text" }, this.secondaryFigureAmount))))), this.isEmpty(this.progressBarCounter) ? null : (h("div", { class: "progress-bar-wrap" }, h("biggive-progress-bar", { counter: this.progressBarCounter, "colour-scheme": "primary" })))), h("div", { class: "button-wrap" }, this.isFutureCampaign || this.isPastCampaign ? (h("div", { class: "msg-wrapper" }, h("biggive-misc-icon", { "background-colour": "white", "icon-colour": "black", icon: "Timer" }), this.isFutureCampaign ? h("p", null, "Launches ", this.datetime) : h("p", null, "Closed ", this.datetime))) : (h("biggive-button", { "full-width": "true", "colour-scheme": this.donateButtonColourScheme, url: this.donateButtonUrl, label: this.donateButtonLabel })), h("biggive-button", { "full-width": "true", "colour-scheme": this.moreInfoButtonColourScheme, url: this.moreInfoButtonUrl, label: this.moreInfoButtonLabel })))));
39
42
  }
40
43
  static get style() { return biggiveCampaignCardCss; }
41
44
  }, [1, "biggive-campaign-card", {
@@ -12,6 +12,9 @@ const BiggiveProgressBar = /*@__PURE__*/ proxyCustomElement(class extends HTMLEl
12
12
  this.counter = 100;
13
13
  }
14
14
  render() {
15
+ if (this.counter === null || this.counter === undefined) {
16
+ return null;
17
+ }
15
18
  return (h("div", { class: 'progress-bar progress-bar-' + this.colourScheme + ' space-below-' + this.spaceBelow }, h("div", { class: "slider" }, h("div", { class: "progress", style: { width: `${Math.min(this.counter, 100)}%` } })), h("div", { class: "counter" }, this.counter, "%")));
16
19
  }
17
20
  static get style() { return biggiveProgressBarCss; }
@@ -257,7 +257,7 @@ const BiggiveCampaignCard = class {
257
257
  this.primaryFigureAmount = undefined;
258
258
  this.secondaryFigureLabel = undefined;
259
259
  this.secondaryFigureAmount = undefined;
260
- this.progressBarCounter = 100;
260
+ this.progressBarCounter = undefined;
261
261
  this.donateButtonLabel = 'Donate now';
262
262
  this.donateButtonUrl = undefined;
263
263
  this.donateButtonColourScheme = 'primary';
@@ -268,8 +268,11 @@ const BiggiveCampaignCard = class {
268
268
  this.isPastCampaign = false;
269
269
  this.datetime = undefined;
270
270
  }
271
+ isEmpty(value) {
272
+ return value === undefined || value === null || value === '';
273
+ }
271
274
  render() {
272
- return (h("div", { class: 'container space-below-' + this.spaceBelow.toString() }, h("div", { class: "sleeve" }, h("div", { onClick: this.handleCardGeneralClick }, this.campaignType !== null ? (h("div", { class: "campaign-type" }, h("span", null, this.campaignType))) : null, this.banner !== null ? (h("div", { class: "image-wrap banner", role: "presentation", style: { 'background-image': 'url(' + this.banner + ')' } })) : (h("div", { class: "image-wrap banner" })), h("div", { class: "title-wrap" }, h("h3", null, this.campaignTitle), h("div", { class: "organisation-name" }, "By ", this.organisationName)), h("div", { class: "meta-wrap" }, h("div", { class: "meta-item" }, h("span", { class: "label" }, this.primaryFigureLabel), h("span", { class: "text" }, this.primaryFigureAmount)), h("div", { class: "meta-item" }, h("span", { class: "label" }, this.secondaryFigureLabel), h("span", { class: "text" }, this.secondaryFigureAmount))), h("div", { class: "progress-bar-wrap" }, h("biggive-progress-bar", { counter: this.progressBarCounter, "colour-scheme": "primary" }))), h("div", { class: "button-wrap" }, this.isFutureCampaign || this.isPastCampaign ? (h("div", { class: "msg-wrapper" }, h("biggive-misc-icon", { "background-colour": "white", "icon-colour": "black", icon: "Timer" }), this.isFutureCampaign ? h("p", null, "Launches ", this.datetime) : h("p", null, "Closed ", this.datetime))) : (h("biggive-button", { "full-width": "true", "colour-scheme": this.donateButtonColourScheme, url: this.donateButtonUrl, label: this.donateButtonLabel })), h("biggive-button", { "full-width": "true", "colour-scheme": this.moreInfoButtonColourScheme, url: this.moreInfoButtonUrl, label: this.moreInfoButtonLabel })))));
275
+ return (h("div", { class: 'container space-below-' + this.spaceBelow.toString() }, h("div", { class: "sleeve" }, h("div", { onClick: this.handleCardGeneralClick }, this.campaignType !== null ? (h("div", { class: "campaign-type" }, h("span", null, this.campaignType))) : null, this.banner !== null ? (h("div", { class: "image-wrap banner", role: "presentation", style: { 'background-image': 'url(' + this.banner + ')' } })) : (h("div", { class: "image-wrap banner" })), h("div", { class: "title-wrap" }, h("h3", null, this.campaignTitle), h("div", { class: "organisation-name" }, "By ", this.organisationName)), this.isEmpty(this.primaryFigureAmount) && this.isEmpty(this.secondaryFigureAmount) ? null : (h("div", { class: "meta-wrap" }, this.isEmpty(this.primaryFigureAmount) ? null : (h("div", { class: "meta-item" }, h("span", { class: "label" }, this.primaryFigureLabel), h("span", { class: "text" }, this.primaryFigureAmount))), this.isEmpty(this.secondaryFigureAmount) ? null : (h("div", { class: "meta-item" }, h("span", { class: "label" }, this.secondaryFigureLabel), h("span", { class: "text" }, this.secondaryFigureAmount))))), this.isEmpty(this.progressBarCounter) ? null : (h("div", { class: "progress-bar-wrap" }, h("biggive-progress-bar", { counter: this.progressBarCounter, "colour-scheme": "primary" })))), h("div", { class: "button-wrap" }, this.isFutureCampaign || this.isPastCampaign ? (h("div", { class: "msg-wrapper" }, h("biggive-misc-icon", { "background-colour": "white", "icon-colour": "black", icon: "Timer" }), this.isFutureCampaign ? h("p", null, "Launches ", this.datetime) : h("p", null, "Closed ", this.datetime))) : (h("biggive-button", { "full-width": "true", "colour-scheme": this.donateButtonColourScheme, url: this.donateButtonUrl, label: this.donateButtonLabel })), h("biggive-button", { "full-width": "true", "colour-scheme": this.moreInfoButtonColourScheme, url: this.moreInfoButtonUrl, label: this.moreInfoButtonLabel })))));
273
276
  }
274
277
  };
275
278
  BiggiveCampaignCard.style = biggiveCampaignCardCss;
@@ -1292,6 +1295,9 @@ const BiggiveProgressBar = class {
1292
1295
  this.counter = 100;
1293
1296
  }
1294
1297
  render() {
1298
+ if (this.counter === null || this.counter === undefined) {
1299
+ return null;
1300
+ }
1295
1301
  return (h("div", { class: 'progress-bar progress-bar-' + this.colourScheme + ' space-below-' + this.spaceBelow }, h("div", { class: "slider" }, h("div", { class: "progress", style: { width: `${Math.min(this.counter, 100)}%` } })), h("div", { class: "counter" }, this.counter, "%")));
1296
1302
  }
1297
1303
  };
@@ -25,25 +25,25 @@ export declare class BiggiveCampaignCard {
25
25
  */
26
26
  organisationName: string;
27
27
  /**
28
- * Label for the primary figure
28
+ * Label for the primary figure – may be null or omitted for no label or if there's no figure.
29
29
  */
30
- primaryFigureLabel: string;
30
+ primaryFigureLabel: string | null;
31
31
  /**
32
- * Amount for the primary figure, formatted with currency symbol
32
+ * Amount for the primary figure, formatted with currency symbol – null or omit to hide the figure & label.
33
33
  */
34
- primaryFigureAmount: string;
34
+ primaryFigureAmount: string | null;
35
35
  /**
36
- * Label for the secondary figure
36
+ * Label for the secondary figure – may be null or omitted for no label or if there's no figure.
37
37
  */
38
- secondaryFigureLabel: string;
38
+ secondaryFigureLabel: string | null;
39
39
  /**
40
- * Amount for the secondary figure, formatted with currency symbol
40
+ * Amount for the secondary figure, formatted with currency symbol – null or omit to hide the figure & label.
41
41
  */
42
- secondaryFigureAmount: string;
42
+ secondaryFigureAmount: string | null;
43
43
  /**
44
- * Progress bar percentage
44
+ * Progress bar percentage – null or omit to hide the progress bar.
45
45
  */
46
- progressBarCounter: number;
46
+ progressBarCounter: number | null;
47
47
  /**
48
48
  * Donate button label
49
49
  */
@@ -83,6 +83,7 @@ export declare class BiggiveCampaignCard {
83
83
  * DON-661.
84
84
  */
85
85
  datetime: string;
86
+ private isEmpty;
86
87
  private handleCardGeneralClick;
87
88
  render(): any;
88
89
  }
@@ -10,6 +10,6 @@ export declare class BiggiveProgressBar {
10
10
  /**
11
11
  * Percentage to show + use for CSS width; round before input if desired
12
12
  */
13
- counter: number;
13
+ counter?: number | null;
14
14
  render(): any;
15
15
  }
@@ -333,25 +333,25 @@ export namespace Components {
333
333
  */
334
334
  "organisationName": string;
335
335
  /**
336
- * Amount for the primary figure, formatted with currency symbol
336
+ * Amount for the primary figure, formatted with currency symbol – null or omit to hide the figure & label.
337
337
  */
338
- "primaryFigureAmount": string;
338
+ "primaryFigureAmount": string | null;
339
339
  /**
340
- * Label for the primary figure
340
+ * Label for the primary figure – may be null or omitted for no label or if there's no figure.
341
341
  */
342
- "primaryFigureLabel": string;
342
+ "primaryFigureLabel": string | null;
343
343
  /**
344
- * Progress bar percentage
344
+ * Progress bar percentage – null or omit to hide the progress bar.
345
345
  */
346
- "progressBarCounter": number;
346
+ "progressBarCounter": number | null;
347
347
  /**
348
- * Amount for the secondary figure, formatted with currency symbol
348
+ * Amount for the secondary figure, formatted with currency symbol – null or omit to hide the figure & label.
349
349
  */
350
- "secondaryFigureAmount": string;
350
+ "secondaryFigureAmount": string | null;
351
351
  /**
352
- * Label for the secondary figure
352
+ * Label for the secondary figure – may be null or omitted for no label or if there's no figure.
353
353
  */
354
- "secondaryFigureLabel": string;
354
+ "secondaryFigureLabel": string | null;
355
355
  /**
356
356
  * Space below component
357
357
  */
@@ -914,7 +914,7 @@ export namespace Components {
914
914
  /**
915
915
  * Percentage to show + use for CSS width; round before input if desired
916
916
  */
917
- "counter": number;
917
+ "counter"?: number | null;
918
918
  /**
919
919
  * Space below component
920
920
  */
@@ -1863,25 +1863,25 @@ declare namespace LocalJSX {
1863
1863
  */
1864
1864
  "organisationName"?: string;
1865
1865
  /**
1866
- * Amount for the primary figure, formatted with currency symbol
1866
+ * Amount for the primary figure, formatted with currency symbol – null or omit to hide the figure & label.
1867
1867
  */
1868
- "primaryFigureAmount"?: string;
1868
+ "primaryFigureAmount"?: string | null;
1869
1869
  /**
1870
- * Label for the primary figure
1870
+ * Label for the primary figure – may be null or omitted for no label or if there's no figure.
1871
1871
  */
1872
- "primaryFigureLabel"?: string;
1872
+ "primaryFigureLabel"?: string | null;
1873
1873
  /**
1874
- * Progress bar percentage
1874
+ * Progress bar percentage – null or omit to hide the progress bar.
1875
1875
  */
1876
- "progressBarCounter"?: number;
1876
+ "progressBarCounter"?: number | null;
1877
1877
  /**
1878
- * Amount for the secondary figure, formatted with currency symbol
1878
+ * Amount for the secondary figure, formatted with currency symbol – null or omit to hide the figure & label.
1879
1879
  */
1880
- "secondaryFigureAmount"?: string;
1880
+ "secondaryFigureAmount"?: string | null;
1881
1881
  /**
1882
- * Label for the secondary figure
1882
+ * Label for the secondary figure – may be null or omitted for no label or if there's no figure.
1883
1883
  */
1884
- "secondaryFigureLabel"?: string;
1884
+ "secondaryFigureLabel"?: string | null;
1885
1885
  /**
1886
1886
  * Space below component
1887
1887
  */
@@ -2461,7 +2461,7 @@ declare namespace LocalJSX {
2461
2461
  /**
2462
2462
  * Percentage to show + use for CSS width; round before input if desired
2463
2463
  */
2464
- "counter"?: number;
2464
+ "counter"?: number | null;
2465
2465
  /**
2466
2466
  * Space below component
2467
2467
  */
package/hydrate/index.js CHANGED
@@ -6730,7 +6730,7 @@ class BiggiveCampaignCard {
6730
6730
  this.primaryFigureAmount = undefined;
6731
6731
  this.secondaryFigureLabel = undefined;
6732
6732
  this.secondaryFigureAmount = undefined;
6733
- this.progressBarCounter = 100;
6733
+ this.progressBarCounter = undefined;
6734
6734
  this.donateButtonLabel = 'Donate now';
6735
6735
  this.donateButtonUrl = undefined;
6736
6736
  this.donateButtonColourScheme = 'primary';
@@ -6741,8 +6741,11 @@ class BiggiveCampaignCard {
6741
6741
  this.isPastCampaign = false;
6742
6742
  this.datetime = undefined;
6743
6743
  }
6744
+ isEmpty(value) {
6745
+ return value === undefined || value === null || value === '';
6746
+ }
6744
6747
  render() {
6745
- return (hAsync("div", { class: 'container space-below-' + this.spaceBelow.toString() }, hAsync("div", { class: "sleeve" }, hAsync("div", { onClick: this.handleCardGeneralClick }, this.campaignType !== null ? (hAsync("div", { class: "campaign-type" }, hAsync("span", null, this.campaignType))) : null, this.banner !== null ? (hAsync("div", { class: "image-wrap banner", role: "presentation", style: { 'background-image': 'url(' + this.banner + ')' } })) : (hAsync("div", { class: "image-wrap banner" })), hAsync("div", { class: "title-wrap" }, hAsync("h3", null, this.campaignTitle), hAsync("div", { class: "organisation-name" }, "By ", this.organisationName)), hAsync("div", { class: "meta-wrap" }, hAsync("div", { class: "meta-item" }, hAsync("span", { class: "label" }, this.primaryFigureLabel), hAsync("span", { class: "text" }, this.primaryFigureAmount)), hAsync("div", { class: "meta-item" }, hAsync("span", { class: "label" }, this.secondaryFigureLabel), hAsync("span", { class: "text" }, this.secondaryFigureAmount))), hAsync("div", { class: "progress-bar-wrap" }, hAsync("biggive-progress-bar", { counter: this.progressBarCounter, "colour-scheme": "primary" }))), hAsync("div", { class: "button-wrap" }, this.isFutureCampaign || this.isPastCampaign ? (hAsync("div", { class: "msg-wrapper" }, hAsync("biggive-misc-icon", { "background-colour": "white", "icon-colour": "black", icon: "Timer" }), this.isFutureCampaign ? hAsync("p", null, "Launches ", this.datetime) : hAsync("p", null, "Closed ", this.datetime))) : (hAsync("biggive-button", { "full-width": "true", "colour-scheme": this.donateButtonColourScheme, url: this.donateButtonUrl, label: this.donateButtonLabel })), hAsync("biggive-button", { "full-width": "true", "colour-scheme": this.moreInfoButtonColourScheme, url: this.moreInfoButtonUrl, label: this.moreInfoButtonLabel })))));
6748
+ return (hAsync("div", { class: 'container space-below-' + this.spaceBelow.toString() }, hAsync("div", { class: "sleeve" }, hAsync("div", { onClick: this.handleCardGeneralClick }, this.campaignType !== null ? (hAsync("div", { class: "campaign-type" }, hAsync("span", null, this.campaignType))) : null, this.banner !== null ? (hAsync("div", { class: "image-wrap banner", role: "presentation", style: { 'background-image': 'url(' + this.banner + ')' } })) : (hAsync("div", { class: "image-wrap banner" })), hAsync("div", { class: "title-wrap" }, hAsync("h3", null, this.campaignTitle), hAsync("div", { class: "organisation-name" }, "By ", this.organisationName)), this.isEmpty(this.primaryFigureAmount) && this.isEmpty(this.secondaryFigureAmount) ? null : (hAsync("div", { class: "meta-wrap" }, this.isEmpty(this.primaryFigureAmount) ? null : (hAsync("div", { class: "meta-item" }, hAsync("span", { class: "label" }, this.primaryFigureLabel), hAsync("span", { class: "text" }, this.primaryFigureAmount))), this.isEmpty(this.secondaryFigureAmount) ? null : (hAsync("div", { class: "meta-item" }, hAsync("span", { class: "label" }, this.secondaryFigureLabel), hAsync("span", { class: "text" }, this.secondaryFigureAmount))))), this.isEmpty(this.progressBarCounter) ? null : (hAsync("div", { class: "progress-bar-wrap" }, hAsync("biggive-progress-bar", { counter: this.progressBarCounter, "colour-scheme": "primary" })))), hAsync("div", { class: "button-wrap" }, this.isFutureCampaign || this.isPastCampaign ? (hAsync("div", { class: "msg-wrapper" }, hAsync("biggive-misc-icon", { "background-colour": "white", "icon-colour": "black", icon: "Timer" }), this.isFutureCampaign ? hAsync("p", null, "Launches ", this.datetime) : hAsync("p", null, "Closed ", this.datetime))) : (hAsync("biggive-button", { "full-width": "true", "colour-scheme": this.donateButtonColourScheme, url: this.donateButtonUrl, label: this.donateButtonLabel })), hAsync("biggive-button", { "full-width": "true", "colour-scheme": this.moreInfoButtonColourScheme, url: this.moreInfoButtonUrl, label: this.moreInfoButtonLabel })))));
6746
6749
  }
6747
6750
  static get style() { return biggiveCampaignCardCss; }
6748
6751
  static get cmpMeta() { return {
@@ -8346,6 +8349,9 @@ class BiggiveProgressBar {
8346
8349
  this.counter = 100;
8347
8350
  }
8348
8351
  render() {
8352
+ if (this.counter === null || this.counter === undefined) {
8353
+ return null;
8354
+ }
8349
8355
  return (hAsync("div", { class: 'progress-bar progress-bar-' + this.colourScheme + ' space-below-' + this.spaceBelow }, hAsync("div", { class: "slider" }, hAsync("div", { class: "progress", style: { width: `${Math.min(this.counter, 100)}%` } })), hAsync("div", { class: "counter" }, this.counter, "%")));
8350
8356
  }
8351
8357
  static get style() { return biggiveProgressBarCss; }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@biggive/components",
3
3
  "_comment": "Version number below is automatically replaced during CircleCI build.",
4
- "version": "202309061001.0.0",
4
+ "version": "202309141628.0.0",
5
5
  "description": "Big Give Components",
6
6
  "main": "dist/index.cjs.js",
7
7
  "module": "dist/index.js",