Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MWPW-152411 raw md doc for web components & events #2903

Open
wants to merge 3 commits into
base: stage
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
129 changes: 129 additions & 0 deletions libs/deps/mas/doc.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
# a[is="checkout-link"]

HTML Checkout Link Anchor element, extends anchor
special member _onceSettled_ promise that either resolves or fail with web commerce information.


# span[is="inline-price"]

HTML Price Web Component, extends span.
special member _onceSettled_ promise that either resolves or fail with web commerce information.


# wcms-commerce

Custom web component to provide active instance of commerce service
to consumers, appended to the head section of current document.


# merch-card-collection

## Events

| Event | Type |
|----------------------------------|--------------------------------|
| `merch-card-collection:showmore` | `CustomEvent<any>` |
| `merch-card-collection:sort` | `CustomEvent<{ value: any; }>` |


# merch-card

## Events

| Event | Type |
|------------------------|--------------------------------------|
| `merch-card:ready` | `CustomEvent<any>` |
| `merch-storage:change` | `CustomEvent<{ offerSelect: any; }>` |


# merch-datasource

Custom element representing a MerchDataSource.


# merch-icon


# merch-mnemonic-list


# merch-offer-select

## Events

| Event | Type |
|----------------------------|---------------------|
| `merch-offer-select:ready` | `CustomEvent<any>` |
| `merch-offer:selected` | `CustomEvent<this>` |


# merch-offer

## Events

| Event | Type |
|---------------------|--------------------|
| `merch-offer:ready` | `CustomEvent<any>` |


# merch-quantity-select

## Events

| Event | Type |
|----------------------------------|------------------------------------|
| `merch-quantity-selector:change` | `CustomEvent<{ option: number; }>` |


# merch-search

## Events

| Event | Type |
|-----------------------|-------------------------------------------------|
| `merch-search:change` | `CustomEvent<{ type: string; value: string; }>` |


# merch-secure-transaction


# merch-stock

## Events

| Event | Type |
|----------------------|-------------------------------------------------|
| `merch-stock:change` | `CustomEvent<{ checked: any; planType: any; }>` |


# merch-subscription-panel


# merch-twp-d2p


# merch-whats-included

## Events

| Event | Type |
|--------------------------|--------------------|
| `hide-see-more-elements` | `CustomEvent<any>` |


# plans-modal


# merch-sidenav-checkbox-group


# merch-sidenav-list

## Events

| Event | Type |
|------------------------|--------------------------------------------------|
| `merch-sidenav:select` | `CustomEvent<{ type: string; value: any; elt: any; }>` |


# merch-sidenav
2,176 changes: 1,086 additions & 1,090 deletions libs/deps/mas/mas.js

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions libs/features/mas/commerce/src/checkout-link.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@ import { selectOffers, useService } from './utilities.js';
export const CLASS_NAME_DOWNLOAD = 'download';
export const CLASS_NAME_UPGRADE = 'upgrade';

/**
* HTML Checkout Link Anchor element, extends anchor
* special member _onceSettled_ promise that either resolves or fail with web commerce information.
*
* @element a[is="checkout-link"]
*/
export class HTMLCheckoutAnchorElement extends HTMLAnchorElement {
static is = 'checkout-link';
static tag = 'a';
Expand Down
7 changes: 6 additions & 1 deletion libs/features/mas/commerce/src/inline-price.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,12 @@ const DISPLAY_TAX_MAP = {
TEAM_EDU: [GeoMap.sea, GeoMap.kr], // school and uni
};

/** @type {Commerce.Price.PlaceholderConstructor} */
/**
* HTML Price Web Component, extends span.
* special member _onceSettled_ promise that either resolves or fail with web commerce information.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it always resolves actually. when it fails, it will add placeholder-failed class to the element.

*
* @element span[is="inline-price"]
**/
export class HTMLPriceSpanElement extends HTMLSpanElement {
static is = 'inline-price';
static tag = 'span';
Expand Down
Loading