UNPKG

@spartacus/cart

Version:

`@spartacus/cart` is a package that you can include in your application, which allows you to use various cart features.

102 lines (95 loc) 3.81 kB
import * as i0 from '@angular/core'; import { Injectable, NgModule } from '@angular/core'; import { Config, provideDefaultConfig } from '@spartacus/core'; import { OrderEntriesSource } from '@spartacus/storefront'; class ImportExportConfig { } ImportExportConfig.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.0.5", ngImport: i0, type: ImportExportConfig, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); ImportExportConfig.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.0.5", ngImport: i0, type: ImportExportConfig, providedIn: 'root', useExisting: Config }); i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.5", ngImport: i0, type: ImportExportConfig, decorators: [{ type: Injectable, args: [{ providedIn: 'root', useExisting: Config, }] }] }); /** * Indicates from which source the new saved cart name * should be taken. */ var CartNameSource; (function (CartNameSource) { CartNameSource["FILE_NAME"] = "fileName"; CartNameSource["DATE_TIME"] = "dateTime"; })(CartNameSource || (CartNameSource = {})); const defaultImportExportConfig = { cartImportExport: { file: { separator: ',', }, import: { fileValidity: { maxSize: 1, maxEntries: { [OrderEntriesSource.NEW_SAVED_CART]: 100, [OrderEntriesSource.SAVED_CART]: 100, [OrderEntriesSource.ACTIVE_CART]: 10, [OrderEntriesSource.QUICK_ORDER]: 10, }, allowedTypes: [ 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', 'application/vnd.ms-excel', 'text/csv', '.csv', ], }, cartNameGeneration: { source: CartNameSource.FILE_NAME, }, }, export: { additionalColumns: [ { name: { key: 'name', }, value: 'product.name', }, { name: { key: 'price', }, value: 'totalPrice.formattedValue', }, ], messageEnabled: true, downloadDelay: 1000, maxEntries: 1000, fileOptions: { fileName: 'cart', extension: 'csv', type: 'text/csv', }, }, }, }; class ImportExportCoreModule { static forRoot() { return { ngModule: ImportExportCoreModule, providers: [provideDefaultConfig(defaultImportExportConfig)], }; } } ImportExportCoreModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.0.5", ngImport: i0, type: ImportExportCoreModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); ImportExportCoreModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.0.5", ngImport: i0, type: ImportExportCoreModule }); ImportExportCoreModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.0.5", ngImport: i0, type: ImportExportCoreModule }); i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.5", ngImport: i0, type: ImportExportCoreModule, decorators: [{ type: NgModule, args: [{}] }] }); /** * Generated bundle index. Do not edit. */ export { CartNameSource, ImportExportConfig, ImportExportCoreModule, defaultImportExportConfig }; //# sourceMappingURL=spartacus-cart-import-export-core.js.map