@progress/sitefinity-nextjs-sdk
Version:
Provides OOB widgets developed using the Next.js framework, which includes an abstraction layer for Sitefinity communication. Additionally, it offers an expanded API, typings, and tools for further development and integration.
129 lines (128 loc) • 5.83 kB
JavaScript
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
import { Attributes, Category, Choice, ContentSection, ContentSectionTitles, DataModel, DataType, DefaultValue, Description, DisplayName, KnownFieldTypes, TableView, ViewSelector, WidgetEntity, WidgetLabel } from '@progress/sitefinity-widget-designers-sdk';
import { OffsetStyle } from '../styling/offset-style';
import { ContentListSettings } from './content-list-settings';
import { SearchResultsSorting } from './interfaces/search-results-sorting';
let SearchResultsEntity = class SearchResultsEntity {
ListSettings = null;
Sorting = SearchResultsSorting.MostRelevantOnTop;
AllowUsersToSortResults = true;
SfViewName = 'Default';
Margins = null;
// Advanced
SfWidgetLabel = 'Search results';
CssClass = null;
SearchFields = null;
AdditionalResultFields = '';
HighlightedFields = null;
SearchResultsHeader = null;
NoResultsHeader = null;
ResultsNumberLabel = null;
LanguagesLabel = null;
SortByLabel = null;
Attributes = null;
};
__decorate([
DataType('resultsListSettings'),
DataModel(ContentListSettings),
ContentSection(ContentSectionTitles.ResultsListSettings, 1),
DisplayName('Number of list items')
], SearchResultsEntity.prototype, "ListSettings", void 0);
__decorate([
ContentSection(ContentSectionTitles.ResultsListSettings, 2),
DefaultValue(SearchResultsSorting.MostRelevantOnTop),
DisplayName('Sort results'),
DataType(KnownFieldTypes.Choices),
Choice([
{ Title: 'Most relevant on top', Value: SearchResultsSorting.MostRelevantOnTop },
{ Title: 'Newest first', Value: SearchResultsSorting.NewestFirst },
{ Title: 'Oldest first', Value: SearchResultsSorting.OldestFirst }
])
], SearchResultsEntity.prototype, "Sorting", void 0);
__decorate([
ContentSection(ContentSectionTitles.ResultsListSettings, 3),
DisplayName('Allow users to sort results'),
DataType(KnownFieldTypes.ChipChoice),
DefaultValue(1),
Choice({ Choices: [
{ Name: 'Yes', Value: 1 },
{ Name: 'No', Value: 0 }
]
})
], SearchResultsEntity.prototype, "AllowUsersToSortResults", void 0);
__decorate([
ContentSection(ContentSectionTitles.DisplaySettings, 1),
ViewSelector([{ Title: 'Default', Name: 'Default', Value: 'Default', Icon: null }]),
DisplayName('Search results template')
], SearchResultsEntity.prototype, "SfViewName", void 0);
__decorate([
ContentSection(ContentSectionTitles.DisplaySettings, 2),
DisplayName('Margins'),
DataModel(OffsetStyle),
TableView('Search results')
], SearchResultsEntity.prototype, "Margins", void 0);
__decorate([
WidgetLabel(),
Category('Advanced')
], SearchResultsEntity.prototype, "SfWidgetLabel", void 0);
__decorate([
Category('Advanced'),
DisplayName('CSS class')
], SearchResultsEntity.prototype, "CssClass", void 0);
__decorate([
Category('Advanced'),
DisplayName('Search fields'),
Description('List of fields to be used in the search results. These fields must be included in the search index. If left empty, all fields from the search index will be used.')
], SearchResultsEntity.prototype, "SearchFields", void 0);
__decorate([
Category('Advanced'),
DisplayName('Additional results fields'),
Description('List of additional fields to be used in the search results, besides the default ones. These fields must be included in the search index. Use asterisk (*) to include all fields from the index.')
], SearchResultsEntity.prototype, "AdditionalResultFields", void 0);
__decorate([
Category('Advanced'),
DisplayName('Highlighted fields'),
Description('List of fields to be highlighted in the search results. These fields must be included in the search index. If left empty, all search fields will be highlighted.')
], SearchResultsEntity.prototype, "HighlightedFields", void 0);
__decorate([
Category('Advanced'),
ContentSection('Labels and messages', 0),
DisplayName('Search results header'),
DefaultValue('Results for \"{0}\"')
], SearchResultsEntity.prototype, "SearchResultsHeader", void 0);
__decorate([
Category('Advanced'),
ContentSection('Labels and messages', 0),
DisplayName('No results header'),
DefaultValue('No search results for \"{0}\"')
], SearchResultsEntity.prototype, "NoResultsHeader", void 0);
__decorate([
Category('Advanced'),
ContentSection('Labels and messages', 0),
DisplayName('Results number label'),
DefaultValue('results')
], SearchResultsEntity.prototype, "ResultsNumberLabel", void 0);
__decorate([
Category('Advanced'),
ContentSection('Labels and messages', 0),
DisplayName('Languages label'),
DefaultValue('Show results in')
], SearchResultsEntity.prototype, "LanguagesLabel", void 0);
__decorate([
Category('Advanced'),
ContentSection('Labels and messages', 0),
DisplayName('Sort by label'),
DefaultValue('Sort by')
], SearchResultsEntity.prototype, "SortByLabel", void 0);
__decorate([
Attributes('SearchResults', 'Search results', 0)
], SearchResultsEntity.prototype, "Attributes", void 0);
SearchResultsEntity = __decorate([
WidgetEntity('SitefinitySearchResults', 'Search results')
], SearchResultsEntity);
export { SearchResultsEntity };