@biggive/components 202309211700.0.0 → 202309271411.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.
package/hydrate/index.js CHANGED
@@ -5936,7 +5936,7 @@ class BiggiveBasicCard {
5936
5936
  ' clip-top-right-corner-' +
5937
5937
  this.clipTopRightCorner +
5938
5938
  ' add-animation-' +
5939
- this.addAnimation, style: { 'background-image': "url('" + this.backgroundImageUrl + "')" } }, hAsync("a", { href: this.buttonUrl }, hAsync("div", { class: 'sleeve background-colour-' + this.cardColour + ' text-colour-' + this.textColour }, hAsync("div", { class: "content-wrap" }, this.icon == true ? (hAsync("div", { class: "icon" }, hAsync("svg", { width: "53", height: "39", viewBox: "0 0 53 39", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, hAsync("path", { d: "M38.7009 13.6572L52.3535 38.6959H25.0386L38.7009 13.6572Z", class: "fill-black" }), hAsync("path", { d: "M20.4789 36.4199L6.36785e-06 5.89713e-05L40.9724 6.61352e-05L20.4789 36.4199Z", class: 'fill-' + this.iconColour })))) : null, this.mainImageUrl != '' ? (hAsync("div", { class: "main-image-container" }, hAsync("div", { class: "image-wrap" }, hAsync("img", { src: this.mainImageUrl, alt: this.mainImageAltText, title: this.mainImageAltText })))) : null, hAsync(HeadingTag, { class: "title" }, this.mainTitle), hAsync("div", { class: "subtitle" }, this.subtitle), hAsync("div", { class: "teaser" }, this.teaser), this.buttonLabel != null && this.buttonUrl != null && this.buttonUrl != '' ? (hAsync("div", { class: 'button-wrap align-' + this.buttonAlign }, hAsync("biggive-button", { "colour-scheme": this.buttonColourScheme, label: this.buttonLabel }))) : null)))));
5939
+ this.addAnimation, style: { 'background-image': "url('" + this.backgroundImageUrl + "')" } }, hAsync("a", { href: this.buttonUrl }, hAsync("div", { class: 'sleeve background-colour-' + this.cardColour + ' text-colour-' + this.textColour }, hAsync("div", { class: "content-wrap" }, this.icon == true ? (hAsync("div", { class: "icon" }, hAsync("svg", { width: "53", height: "39", viewBox: "0 0 53 39", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, hAsync("path", { d: "M38.7009 13.6572L52.3535 38.6959H25.0386L38.7009 13.6572Z", class: "fill-black" }), hAsync("path", { d: "M20.4789 36.4199L6.36785e-06 5.89713e-05L40.9724 6.61352e-05L20.4789 36.4199Z", class: 'fill-' + this.iconColour })))) : null, this.mainImageUrl != '' ? (hAsync("div", { class: "main-image-container" }, hAsync("div", { class: "image-wrap" }, hAsync("img", { src: this.mainImageUrl, alt: this.mainImageAltText, title: this.mainImageAltText })))) : null, hAsync(HeadingTag, { class: "title" }, this.mainTitle), hAsync("div", { class: "subtitle" }, this.subtitle), hAsync("div", { class: "teaser" }, this.teaser), this.buttonLabel != null && this.buttonUrl != null && this.buttonUrl != '' ? (hAsync("div", { class: 'button-wrap align-' + this.buttonAlign }, hAsync("biggive-button", { "colour-scheme": this.buttonColourScheme, url: this.buttonUrl, label: this.buttonLabel }))) : null)))));
5940
5940
  }
5941
5941
  static get style() { return biggiveBasicCardCss; }
5942
5942
  static get cmpMeta() { return {
@@ -6969,7 +6969,19 @@ class BiggiveCampaignCardFilterGrid {
6969
6969
  }
6970
6970
  render() {
6971
6971
  var _a;
6972
- return (hAsync("div", { class: 'container space-below-' + this.spaceBelow }, hAsync("div", { class: "sleeve" }, hAsync("div", { class: "search-wrap" }, hAsync("h4", null, this.intro), hAsync("div", { class: "field-wrap" }, hAsync("div", { class: "input-wrap" }, hAsync("svg", { xmlns: "http://www.w3.org/2000/svg", class: "icon", viewBox: "0 0 512 512" }, hAsync("path", { d: faMagnifyingGlass.icon[4].toString() })), hAsync("input", { type: "text", value: (_a = this.searchText) !== null && _a !== void 0 ? _a : '', class: "input-text", placeholder: this.placeholderText, onInput: this.handleSearchTextChanged, onKeyDown: this.handleEnterPressed })), hAsync("biggive-button", { onClick: this.handleSearchButtonPressed, label: this.buttonText }))), hAsync("div", { class: "sort-filter-wrap" }, hAsync("div", { class: "filter-wrap" }, hAsync("biggive-button", { class: "filter", colourScheme: "primary", onClick: this.handleFilterButtonClick, label: "Filter", fullWidth: true, "space-below": "0" }), hAsync("biggive-popup", { id: "filter-popup" }, hAsync("h4", { class: "space-above-0 space-below-3 text-colour-primary" }, "Filters"), hAsync("div", { class: "select-wrapper-1" }, hAsync("biggive-form-field-select", { backgroundColour: "white", prompt: "Category", placeholder: this.categoriesPlaceHolderText, selectedLabel: this.selectedFilterCategory, options: this.categoryOptions, selectionChanged: this.categoryFilterSelectionChanged, id: "categories", "space-below": "2" })), hAsync("div", { class: "select-wrapper-2" }, hAsync("biggive-form-field-select", { backgroundColour: "white", prompt: "Beneficiary", placeholder: this.beneficiariesPlaceHolderText, selectedLabel: this.selectedFilterBeneficiary, options: this.beneficiaryOptions, selectionChanged: this.beneficiarySelectionChanged, id: "beneficiaries", "space-below": "2" })), hAsync("div", { class: "select-wrapper-3" }, hAsync("biggive-form-field-select", { backgroundColour: "white", prompt: "Location", placeholder: this.locationsPlaceHolderText, selectedLabel: this.selectedFilterLocation, options: this.locationOptions, selectionChanged: this.locationSelectionChanged, id: "locations", "space-below": "2" })), hAsync("div", { class: "select-wrapper-4" }, hAsync("biggive-form-field-select", { backgroundColour: "white", prompt: "Funding", placeholder: this.fundingPlaceHolderText, selectedLabel: this.selectedFilterFunding, options: this.fundingOptions, selectionChanged: this.fundingSelectionChanged, id: "funding", "space-below": "2" })), hAsync("div", { class: "align-right" }, hAsync("biggive-button", { label: "Apply filters", onClick: this.handleApplyFilterButtonClick })))), hAsync("div", { class: "sort-wrap" }, hAsync("biggive-form-field-select", { options: { amountRaised: 'Most raised', matchFundsRemaining: 'Match funds remaining' }, prompt: null, "select-style": "underlined", placeholder: this.sortByPlaceholderText, selectedLabel: this.selectedSortByOption, selectionChanged: this.sortBySelectionChanged, id: "sort-by" }, hAsync("biggive-form-field-select-option", { value: "amountRaised", label: "Most raised" }), hAsync("biggive-form-field-select-option", { value: "matchFundsRemaining", label: "Match funds remaining" }), (this.searchText || '').length > 0 ? hAsync("biggive-form-field-select-option", { value: "Relevance", label: "Relevance" }) : null))), hAsync("div", { class: "selected-filter-wrap" }, hAsync("div", { class: "selected-filters" }), hAsync("div", { class: "clear-all" }, hAsync("a", { onClick: this.handleClearAll }, "Clear all"))), hAsync("div", { class: "campaign-grid" }, hAsync("slot", { name: "campaign-grid" })))));
6972
+ return (hAsync("div", { class: 'container space-below-' + this.spaceBelow }, hAsync("div", { class: "sleeve" }, hAsync("div", { class: "search-wrap" }, hAsync("h4", null, this.intro), hAsync("div", { class: "field-wrap" }, hAsync("div", { class: "input-wrap" }, hAsync("svg", { xmlns: "http://www.w3.org/2000/svg", class: "icon", viewBox: "0 0 512 512" }, hAsync("path", { d: faMagnifyingGlass.icon[4].toString() })), hAsync("input", { type: "text", value: (_a = this.searchText) !== null && _a !== void 0 ? _a : '', class: "input-text", placeholder: this.placeholderText, onInput: this.handleSearchTextChanged, onKeyDown: this.handleEnterPressed })), hAsync("biggive-button", { onClick: this.handleSearchButtonPressed, label: this.buttonText }))), hAsync("div", { class: "sort-filter-wrap" }, hAsync("div", { class: "filter-wrap" }, hAsync("biggive-button", { class: "filter", colourScheme: "primary", onClick: this.handleFilterButtonClick, label: "Filter", fullWidth: true, "space-below": "0" }), hAsync("biggive-popup", { id: "filter-popup" }, hAsync("h4", { class: "space-above-0 space-below-3 text-colour-primary" }, "Filters"), hAsync("div", { class: "select-wrapper-1" }, hAsync("biggive-form-field-select", { backgroundColour: "white", prompt: "Category", placeholder: this.categoriesPlaceHolderText, selectedLabel: this.selectedFilterCategory, options: this.optionsToArray(this.categoryOptions || []), selectionChanged: this.categoryFilterSelectionChanged, id: "categories", "space-below": "2" })), hAsync("div", { class: "select-wrapper-2" }, hAsync("biggive-form-field-select", { backgroundColour: "white", prompt: "Beneficiary", placeholder: this.beneficiariesPlaceHolderText, selectedLabel: this.selectedFilterBeneficiary, options: this.optionsToArray(this.beneficiaryOptions || []), selectionChanged: this.beneficiarySelectionChanged, id: "beneficiaries", "space-below": "2" })), hAsync("div", { class: "select-wrapper-3" }, hAsync("biggive-form-field-select", { backgroundColour: "white", prompt: "Location", placeholder: this.locationsPlaceHolderText, selectedLabel: this.selectedFilterLocation, options: this.optionsToArray(this.locationOptions || []), selectionChanged: this.locationSelectionChanged, id: "locations", "space-below": "2" })), hAsync("div", { class: "select-wrapper-4" }, hAsync("biggive-form-field-select", { backgroundColour: "white", prompt: "Funding", placeholder: this.fundingPlaceHolderText, selectedLabel: this.selectedFilterFunding, options: this.optionsToArray(this.fundingOptions || []), selectionChanged: this.fundingSelectionChanged, id: "funding", "space-below": "2" })), hAsync("div", { class: "align-right" }, hAsync("biggive-button", { label: "Apply filters", onClick: this.handleApplyFilterButtonClick })))), hAsync("div", { class: "sort-wrap" }, hAsync("biggive-form-field-select", { options: [
6973
+ { value: 'amountRaised', label: 'Most raised' },
6974
+ { value: 'matchFundsRemaining', label: 'Match funds remaining' },
6975
+ ], prompt: null, "select-style": "underlined", placeholder: this.sortByPlaceholderText, selectedLabel: this.selectedSortByOption, selectionChanged: this.sortBySelectionChanged, id: "sort-by" }, hAsync("biggive-form-field-select-option", { value: "amountRaised", label: "Most raised" }), hAsync("biggive-form-field-select-option", { value: "matchFundsRemaining", label: "Match funds remaining" }), (this.searchText || '').length > 0 ? hAsync("biggive-form-field-select-option", { value: "Relevance", label: "Relevance" }) : null))), hAsync("div", { class: "selected-filter-wrap" }, hAsync("div", { class: "selected-filters" }), hAsync("div", { class: "clear-all" }, hAsync("a", { onClick: this.handleClearAll }, "Clear all"))), hAsync("div", { class: "campaign-grid" }, hAsync("slot", { name: "campaign-grid" })))));
6976
+ }
6977
+ optionsToArray(options) {
6978
+ if (typeof options === 'string') {
6979
+ options = JSON.parse(options);
6980
+ }
6981
+ if (Array.isArray(options)) {
6982
+ return options.map((option) => ({ value: option, label: option }));
6983
+ }
6984
+ return Object.entries(options).map(entry => ({ value: entry[0], label: entry[1] }));
6973
6985
  }
6974
6986
  get el() { return getElement(this); }
6975
6987
  static get style() { return biggiveCampaignCardFilterGridCss; }
@@ -7424,23 +7436,28 @@ class BiggiveFormFieldSelect {
7424
7436
  const greyIfRequired = this.backgroundColour === 'grey' ? ' grey' : '';
7425
7437
  let options;
7426
7438
  if (typeof this.options === 'string') {
7427
- options = JSON.parse(this.options);
7439
+ let parsed = JSON.parse(this.options);
7440
+ if (!Array.isArray(parsed)) {
7441
+ throw new Error('Options should be an Array<{ label: string; value: string }>');
7442
+ }
7443
+ options = parsed;
7428
7444
  }
7429
7445
  else {
7430
7446
  options = this.options;
7431
7447
  }
7432
- if (Array.isArray(options)) {
7433
- options = Object.fromEntries(options.map((value) => [value, value]));
7434
- }
7435
7448
  if (typeof this.placeholder === 'string' && typeof this.selectedValue !== 'string') {
7436
- options = Object.assign({ __placeholder__: this.placeholder }, options);
7449
+ options = [{ value: '__placeholder__', label: this.placeholder }, ...options];
7450
+ }
7451
+ if (typeof options === 'undefined') {
7452
+ console.error('options undefined');
7453
+ options = [];
7437
7454
  }
7438
7455
  return (hAsync("div", { class: "selectWrapper" }, hAsync("label", { class: greyIfRequired }, hAsync("div", { class: 'prompt' + greyIfRequired }, this.prompt), hAsync("div", { class: 'dropdown space-below-' +
7439
7456
  this.spaceBelow +
7440
7457
  ' select-style-' +
7441
7458
  this.selectStyle +
7442
7459
  (this.prompt === null ? ' noprompt' : '') +
7443
- (this.selectedOptionColour === 'inherit' ? ' inherit-colour' : '') }, hAsync("div", { class: "sleeve" }, hAsync("select", { class: greyIfRequired, onChange: this.doOptionSelectCompletedHandler }, Object.entries(options).map((value) => (hAsync("option", { selected: this.selectedValue === value[0], value: value[0] }, value[1])))), hAsync("div", { class: "arrow" }))))));
7460
+ (this.selectedOptionColour === 'inherit' ? ' inherit-colour' : '') }, hAsync("div", { class: "sleeve" }, hAsync("select", { class: greyIfRequired, onChange: this.doOptionSelectCompletedHandler }, options.map(option => (hAsync("option", { selected: this.selectedValue === option.value, value: option.value }, option.label)))), hAsync("div", { class: "arrow" }))))));
7444
7461
  }
7445
7462
  get el() { return getElement(this); }
7446
7463
  static get style() { return biggiveFormFieldSelectCss; }
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": "202309211700.0.0",
4
+ "version": "202309271411.0.0",
5
5
  "description": "Big Give Components",
6
6
  "main": "dist/index.cjs.js",
7
7
  "module": "dist/index.js",