1.4.2 • Published 3 months ago

@local-logic/elements-js v1.4.2

Weekly downloads
-
License
-
Repository
-
Last release
3 months ago

Local Logic Elements JS (Alpha)

⚠️ This package is in active development and is not production-ready.

Local Logic Elements JS is a lightweight wrapper module which provides vanilla JS bindings for Local Logic Elements React. It can be used to Local Logic's UI components library.

Getting started

Installation

First, install with yarn, pnpm, or npm:

yarn add @local-logic/elements-js
pnpm add @local-logic/elements-js
npm i --save @local-logic/elements-js

The script is also available in UMD and EMS format from the Local Logic CDN: https://sdk.locallogic.co/elements-js///index.min.js

Note: Using the CDN approach in production is discouraged. The CDN requires the client download the entire elements library, regardless of which elements are used.

Usage

You can now import the initializer LocalLogicJS and create an instance:

import { LocalLogicJS } from "@local-logic/elements-js";

const ll = LocalLogicJS("<YOUR_TOKEN>");

ℹ️ <YOUR_TOKEN> should be provided to you by a Local Logic team member.

Next, import an Element and pass it to the first argument of the LocalLogicJS instance create method. Pass an options object as the second argument.

import { Scores } from "@local-logic/elements-js";

const node = document.createElement("div");
document.body.appendChild(node);

const scoresList = ll.create(Scores, node, {
  lat: 45.53297,
  lng: -73.585602,
});

API

LocalLogicJS

Options

NameRequiredTypeDefaultDescription
apiKeytruestringAuth apiKey required for making requests to the Local Logic API.
options.appearancefalseAppearanceAPIThe appearance option provides theme and variable support customizing the look and feel of Local Logic Elements.
options.localefalse"en" \| "fr""en"The locale option specifies the language of the scores and the UI interface.

Returns

NameTypeDescription
create(component: ElementType, node: HTMLElement, options: ElementTypeOptions) => ElementCreates an Element instance.

Returns

Promise<void>

Element.update

Options

NameRequiredTypeDefaultDescription
optionstrueElementTypeOptionsUpdate the ElementTypeOptions of the Element.

Returns

Promise<void>

Element.on

Options

NameRequiredTypeDefaultDescription
eventTypetruestringUpdate the ElementTypeOptions of the Element.
callbacktrue(data) => voidTrigger a callback when the eventType occurs.

Returns

Promise<void>

ℹ️ For ElementTypeOptions for every Element, refer to the documentation for Local Logic Elements React.

TypeScript Support

Local Logic Elements JS comes packaged with TypeScript declarations.

1.4.2

3 months ago

1.4.1

7 months ago

1.4.0

7 months ago

1.3.1

9 months ago

1.3.0

9 months ago

1.2.27

10 months ago

1.2.26

10 months ago

1.2.12

12 months ago

1.2.13

12 months ago

1.2.11

1 year ago

1.2.16

12 months ago

1.2.17

12 months ago

1.2.14

12 months ago

1.2.15

12 months ago

1.2.18

12 months ago

1.2.19

12 months ago

1.2.20

11 months ago

1.2.23

11 months ago

1.2.24

11 months ago

1.2.21

11 months ago

1.2.25

11 months ago

1.2.0

1 year ago

1.2.8

1 year ago

1.2.7

1 year ago

1.0.9

1 year ago

1.2.6

1 year ago

1.2.5

1 year ago

1.2.4

1 year ago

1.2.3

1 year ago

1.2.2

1 year ago

1.2.1

1 year ago

1.2.10

1 year ago

1.1.0

1 year ago

1.2.9

1 year ago

1.0.11

1 year ago

1.0.10

1 year ago

1.0.15

1 year ago

1.0.14

1 year ago

1.0.13

1 year ago

1.0.12

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago

1.0.8

1 year ago

1.0.7

1 year ago

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.0-beta.51

1 year ago

1.0.0-beta.50

1 year ago

1.0.0-beta.48

1 year ago

1.0.0-beta.49

1 year ago

1.0.0-beta.46

2 years ago

1.0.0-beta.47

1 year ago

1.0.0-beta.44

2 years ago

1.0.0-beta.45

2 years ago

1.0.0-beta.42

2 years ago

1.0.0-beta.43

2 years ago

1.0.0-beta.40

2 years ago

1.0.0-beta.41

2 years ago

1.0.0-beta.39

2 years ago

1.0.0-beta.28

2 years ago

1.0.0-beta.29

2 years ago

1.0.0-beta.27

2 years ago

1.0.0-beta.33

2 years ago

1.0.0-beta.34

2 years ago

1.0.0-beta.31

2 years ago

1.0.0-beta.32

2 years ago

1.0.0-beta.30

2 years ago

1.0.0-beta.37

2 years ago

1.0.0-beta.38

2 years ago

1.0.0-beta.35

2 years ago

1.0.0-beta.36

2 years ago

1.0.0-beta.22

2 years ago

1.0.0-beta.23

2 years ago

1.0.0-beta.20

2 years ago

1.0.0-beta.21

2 years ago

1.0.0-alpha.3

2 years ago

1.0.0-alpha.2

2 years ago

1.0.0-alpha.1

2 years ago

1.0.0-beta.26

2 years ago

1.0.0-beta.24

2 years ago

1.0.0-beta.25

2 years ago

1.0.0-beta.4

2 years ago

1.0.0-beta.5

2 years ago

1.0.0-beta.11

2 years ago

1.0.0-beta.12

2 years ago

1.0.0-beta.10

2 years ago

1.0.0-beta.6

2 years ago

1.0.0-beta.7

2 years ago

1.0.0-beta.8

2 years ago

1.0.0-beta.9

2 years ago

1.0.0-beta.19

2 years ago

1.0.0-beta.17

2 years ago

1.0.0-beta.18

2 years ago

1.0.0-beta.15

2 years ago

1.0.0-beta.16

2 years ago

1.0.0-beta.13

2 years ago

1.0.0-beta.14

2 years ago

0.3.0

2 years ago

0.2.0

2 years ago

0.3.5

2 years ago

0.3.2

2 years ago

0.3.1

2 years ago

0.3.4

2 years ago

0.3.3

2 years ago

0.1.1

2 years ago

0.1.0

2 years ago