2.6.0 • Published 23 hours ago

@packaged-ui/pagelets v2.6.0

Weekly downloads
67
License
MIT
Repository
-
Last release
23 hours ago

Pagelets

Upgrading from v1 to v2

Usage

Initialize

Initialize pagelet events (link clicks and form submissions)

Pagelets.init(options);

Options

PropertyTypeDefaultDescription
selectorstringa[data-uri],button[data-uri],[href][data-target]Which "click" event elements to react to
formSelectorstringform[data-uri],form[data-target]Which "submit" event elements to react to
defaultTargetstringdocument.bodyIf no data-target specified, which container to load the content into
allowPersistentTargetsbooleantrueIf a page has been reloaded, allow pagelets to load into containers of the same name
listenElementNodedocumentListen to links within this container only
minRefreshRateint500Minimum time to wait between pagelet refreshes
iteratorActionIteratornew ActionIterator()set the default iterator

Manual request

Manually make pagelet request

const req = new Pagelets.Request(options);
Pagelets.load(req)
        .then(({request, response}) =>
              {
                // process response (if necessary)
              })
        .catch((e) =>
               {
                 // error handling
               });

Pagelet Options

PropertyTypeDefaultDescription
url requiredStringURL of the resource to request
iteratorActionIteratoruses global optionsaction iterator to use when processing the response
sourceElementElementelement requesting the pagelet
targetElementElement/Stringelement to receive the default pagelet content
pushUrlStringURL to set in the address bar
headersObjectobject containing custom headers for the request
dataObjectobject containing post data
methodStringrequest method to use
withCredentialsBooleanfalseset withCredentials
2.6.0

23 hours ago

2.5.0

8 days ago

2.4.3

11 days ago

2.4.2

5 months ago

2.4.1

5 months ago

2.3.8

8 months ago

2.3.7

8 months ago

2.3.9

8 months ago

2.3.11

7 months ago

2.3.10

8 months ago

2.3.6

1 year ago

2.3.4

2 years ago

2.3.3

2 years ago

2.3.5

2 years ago

2.3.0

2 years ago

2.2.1

3 years ago

2.2.0

3 years ago

2.1.2

3 years ago

2.1.1

3 years ago

2.1.0

3 years ago

2.0.0

3 years ago

1.8.1

3 years ago

1.8.0

3 years ago

1.7.0

3 years ago

1.6.2

3 years ago

1.6.1

3 years ago

1.6.0

3 years ago

1.5.2

4 years ago

1.5.1

4 years ago

1.5.0

4 years ago

1.4.3

4 years ago

1.4.2

4 years ago

1.4.1

4 years ago

1.4.0

4 years ago

1.3.1

4 years ago

1.3.0

4 years ago

1.1.1

4 years ago

1.1.0

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.0

4 years ago

0.6.2

4 years ago

0.6.1

4 years ago

0.6.0

4 years ago

0.5.2

4 years ago

0.5.1

4 years ago

0.5.0

4 years ago

0.4.1

4 years ago

0.4.0

4 years ago

0.3.4

4 years ago

0.3.3

4 years ago

0.3.2

4 years ago

0.3.1

4 years ago

0.3.0

4 years ago

0.2.0

4 years ago

0.1.3

4 years ago

0.1.2

4 years ago

0.1.1

4 years ago

0.1.0

4 years ago

0.0.8

4 years ago

0.0.7

4 years ago

0.0.6

4 years ago

0.0.5

4 years ago

0.0.4

4 years ago

0.0.3

4 years ago

0.0.2

4 years ago

0.0.1

4 years ago