@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.
148 lines (147 loc) • 8.45 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 { FacetField } from './interfaces/facet-field';
import { ComplexType, ContentSectionTitles, KnownFieldTypes } from '@progress/sitefinity-widget-designers-sdk/common';
import { ContentSection } from '@progress/sitefinity-widget-designers-sdk/decorators/content-section';
import { DefaultValue } from '@progress/sitefinity-widget-designers-sdk/decorators/default-value';
import { Description } from '@progress/sitefinity-widget-designers-sdk/decorators/description';
import { DisplayName } from '@progress/sitefinity-widget-designers-sdk/decorators/display-name';
import { DataModel, DataType } from '@progress/sitefinity-widget-designers-sdk/decorators/data-type';
import { Choice } from '@progress/sitefinity-widget-designers-sdk/decorators/choice';
import { Category, PropertyCategory } from '@progress/sitefinity-widget-designers-sdk/decorators/category';
import { WidgetEntity } from '@progress/sitefinity-widget-designers-sdk/decorators/widget-entity';
import { ViewSelector } from '@progress/sitefinity-widget-designers-sdk/decorators/view-selector';
import { TableView } from '@progress/sitefinity-widget-designers-sdk/decorators/table-view';
import { WidgetLabel } from '@progress/sitefinity-widget-designers-sdk/decorators/widget-label';
import { KeysValues } from '@progress/sitefinity-widget-designers-sdk/decorators/attributes';
import { Placeholder } from '@progress/sitefinity-widget-designers-sdk/decorators/placeholder';
import { Required } from '@progress/sitefinity-widget-designers-sdk/decorators/validations';
import { ConditionalVisibility } from '@progress/sitefinity-widget-designers-sdk/decorators/conditional-visibility';
import { Margins } from '@progress/sitefinity-widget-designers-sdk/decorators/margins';
import { LengthDependsOn } from '@progress/sitefinity-widget-designers-sdk/decorators/length-depends-on';
let SearchFacetsEntity = class SearchFacetsEntity {
IndexCatalogue = null;
SelectedFacets = [];
SortType;
DisplayItemCount = true;
IsShowMoreLessButtonActive = true;
SfViewName = 'Default';
Margins = null;
SfWidgetLabel = 'Search facets';
WidgetCssClass = null;
SearchFields = null;
FilterResultsLabel = 'Filter results';
AppliedFiltersLabel = 'Applied filters';
ClearAllLabel = 'Clear all';
ShowMoreLabel = 'Show more';
ShowLessLabel = 'Show less';
Attributes = null;
};
__decorate([
ContentSection('Search facets setup', 0),
DisplayName('Search index'),
Placeholder('Select search index'),
Required('Select search index'),
DataType(KnownFieldTypes.Choices),
Choice({
ServiceUrl: 'Default.GetFacetableIndexes',
ServiceWarningMessage: 'No search index with facetable fields has been created yet. To manage search indexes, go to Administration > Search indexes, or contact your administrator for assistance.'
}),
Description('[{"Type":1,"Chunks":[{"Value":"To display facetable fields on your site,","Presentation":[]},{"Value":"select the same search index as the one","Presentation":[]},{"Value":"selected in the Search box widget.","Presentation":[]}]}]')
], SearchFacetsEntity.prototype, "IndexCatalogue", void 0);
__decorate([
ContentSection('Search facets setup', 0),
TableView({ Reorderable: true, Selectable: false, MultipleSelect: false }),
DisplayName('Set facetable fields'),
ConditionalVisibility('{"conditions":[{"fieldName":"IndexCatalogue","operator":"NotEquals","value":null }]}'),
DataModel(FacetField),
DataType(ComplexType.Enumerable),
DefaultValue(null)
], SearchFacetsEntity.prototype, "SelectedFacets", void 0);
__decorate([
ContentSection('Search facets setup', 0),
DisplayName('Sort fields'),
DataType(KnownFieldTypes.Choices),
ConditionalVisibility('{"conditions":[{"fieldName":"IndexCatalogue","operator":"NotEquals","value":null }]}'),
Choice({ Choices: [{ 'Title': 'As set manually', 'Name': '0', 'Value': 0, 'Icon': 'ban' }, { 'Title': 'Alphabetically', 'Name': '2', 'Value': 2, 'Icon': null }] }),
DefaultValue(null)
], SearchFacetsEntity.prototype, "SortType", void 0);
__decorate([
ContentSection('Search facets setup', 1),
DisplayName('Display item count'),
DataType(KnownFieldTypes.ChipChoice),
Choice({ Choices: [{ 'Title': 'Yes', 'Name': 'Yes', 'Value': 'True', 'Icon': null }, { 'Title': 'No', 'Name': 'No', 'Value': 'False', 'Icon': null }] }),
ConditionalVisibility('{"conditions":[{"fieldName":"IndexCatalogue","operator":"NotEquals","value":null }]}')
], SearchFacetsEntity.prototype, "DisplayItemCount", void 0);
__decorate([
ContentSection('Search facets setup', 1),
DisplayName('Collapse large facet lists'),
DataType(KnownFieldTypes.ChipChoice),
Choice({ Choices: [{ 'Title': 'Yes', 'Name': 'Yes', 'Value': 'True', 'Icon': null }, { 'Title': 'No', 'Name': 'No', 'Value': 'False', 'Icon': null }] }),
ConditionalVisibility('{"conditions":[{"fieldName":"IndexCatalogue","operator":"NotEquals","value":null }]}'),
Description('[{"Type":1,"Chunks":[{"Value":"Specifies whether to collapse facet lists on","Presentation":[]}, {"Value":"your site with more than 10 entries. If \'No\'","Presentation":[2]}, {"Value":"is selected, all facets are displayed.","Presentation":[2]}]}]')
], SearchFacetsEntity.prototype, "IsShowMoreLessButtonActive", void 0);
__decorate([
ContentSection(ContentSectionTitles.DisplaySettings, 0),
ViewSelector([{ Title: 'Default', Name: 'Default', Value: 'Default', Icon: null }]),
DisplayName('Template')
], SearchFacetsEntity.prototype, "SfViewName", void 0);
__decorate([
ContentSection(ContentSectionTitles.DisplaySettings, 1),
Margins('Search facets')
], SearchFacetsEntity.prototype, "Margins", void 0);
__decorate([
WidgetLabel()
], SearchFacetsEntity.prototype, "SfWidgetLabel", void 0);
__decorate([
Category(PropertyCategory.Advanced),
DisplayName('CSS class'),
DataType('string')
], SearchFacetsEntity.prototype, "WidgetCssClass", void 0);
__decorate([
Category(PropertyCategory.Advanced),
DisplayName('Search fields'),
Description('[{"Type":1,"Chunks":[{"Value":"List of fields to be used in the search facets. These fields must be the same as those specified in the Search results widget.","Presentation":[]}]}]'),
DataType('string')
], SearchFacetsEntity.prototype, "SearchFields", void 0);
__decorate([
Category(PropertyCategory.Advanced),
ContentSection('Labels and messages', 0),
DisplayName('Search facets header')
], SearchFacetsEntity.prototype, "FilterResultsLabel", void 0);
__decorate([
Category(PropertyCategory.Advanced),
ContentSection('Labels and messages', 1),
DisplayName('Search facets label')
], SearchFacetsEntity.prototype, "AppliedFiltersLabel", void 0);
__decorate([
Category(PropertyCategory.Advanced),
ContentSection('Labels and messages', 2),
DisplayName('Clear facets link')
], SearchFacetsEntity.prototype, "ClearAllLabel", void 0);
__decorate([
Category(PropertyCategory.Advanced),
ContentSection('Labels and messages', 3),
DisplayName('Show more link')
], SearchFacetsEntity.prototype, "ShowMoreLabel", void 0);
__decorate([
Category(PropertyCategory.Advanced),
ContentSection('Labels and messages', 4),
DisplayName('Show less link')
], SearchFacetsEntity.prototype, "ShowLessLabel", void 0);
__decorate([
Category(PropertyCategory.Advanced),
ContentSection(ContentSectionTitles.Attributes, 0),
DisplayName('Data attributes for...'),
LengthDependsOn(null, '', '', '[{"Name": "SearchFacets", "Title": "Search facets"}]'),
DataType(KnownFieldTypes.Attributes),
DataModel(KeysValues)
], SearchFacetsEntity.prototype, "Attributes", void 0);
SearchFacetsEntity = __decorate([
WidgetEntity('SitefinityFacets', 'Search facets')
], SearchFacetsEntity);
export { SearchFacetsEntity };