@marketplaces.inc-ui/mpc-grid
v0.0.6
Published
A grid to display cards in
Readme
src/Grid.js:
class: Grid, mpc-grid
Superclass
| Name | Module | Package |
| ------------ | ------ | ------- |
| LitElement | | lit |
Fields
| Name | Privacy | Type | Default | Description | Inherited From |
| ----------------- | ------- | --------- | ------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------- |
| loading | public | boolean | false | Show the loading state | |
| autoFetch | public | boolean | false | When true, autofetch data from the MPC API and apply it. See `autoFetchConfig` for more info. | |
| autoFetchConfig | public | object | {} | Auto fetch data for the grid when required params are supplied<br/>
`{`<br/>
`providerId,`<br/>
`entityType,`<br/>
`marketplaceId,`<br/>
`marketplaceBaseUrl,`<br/>
`apiKey,`<br/>
`apiBaseUrl,`<br/>
`queryParams,`<br/>
`}`
<br/><br/>
`entityType` options are: `listings` <br/><br/>
`queryParams` accepts any supported `mpc` API param | |
| mpcCardConfig | public | object | {} | A `<mpc-card>` config object. See the `Card` component for info on the props supported below.<br/>
`{`<br/>
`target,`<br/>
`darkMode,`<br/>
`}` | |
| maxCols | public | number | 4 | The maximum responsive cols to show. `1-6` are supported | |
| gap | public | number | 6 | The gap size between items. `1-8` are supported | |
| _autoFetchData | public | array | [] | Loaded data from auto fetch config. | |
Methods
| Name | Privacy | Description | Parameters | Return | Inherited From |
| --------------------------------- | ------- | ----------- | ------------------ | ------ | -------------- |
| loadingTemplateMaybe | | | | | |
| loadingTemplate | | | | | |
| autoFetchContentTemplate | | | | | |
| _handleAutoFetch | | | autoFetch | | |
| _handleAutoFetchResponse | | | data, entityType | | |
| _handleSetPropertiesForListings | | | data | | |
| _getGridClassName | | | | | |
Attributes
| Name | Field | Inherited From |
| ----------------- | --------------- | -------------- |
| gap | gap | |
| maxCols | maxCols | |
| loading | loading | |
| autoFetch | autoFetch | |
| autoFetchConfig | autoFetchConfig | |
| mpcCardConfig | mpcCardConfig | |
| _autoFetchData | _autoFetchData | |
Exports
| Kind | Name | Declaration | Module | Package |
| ---- | ------ | ----------- | ----------- | ------- |
| js | Grid | Grid | src/Grid.js | |
mpc-grid.js:
Exports
| Kind | Name | Declaration | Module | Package |
| --------------------------- | ---------- | ----------- | ------------ | ------- |
| custom-element-definition | mpc-grid | Grid | /src/Grid.js | |
