1.47.3 • Published 8 months ago

@pie-api/pie-element-extensions v1.47.3

Weekly downloads
787
License
-
Repository
github
Last release
8 months ago

pie-element-extensions

This is a set of Custom Elements and ES Modules that extend the capabilties of @pie-framework/elements in the context of pie-api service. They are intended to be deployed for use in a browser with ES imports.

Initially, the Elements will include:

Cell - an element to render a user response in a small form factor that can be displayed in a table/spreadsheet cell

Response - an element to rendder more complete user response, in a larger form factor than Cell but without necessarily rendering the actual question

Future Elements:

Aggregate - display a PIE with aggreate information about a set of responses

Modules:

This lib may also export modules & functions that are not Custom Elements. e.g.: aggregateResponses([session]) - do a map reduce to get aggregate data about user responses.

Under R&D:

pie-api will support extending the capabilities of 'installed' pies with these extensions through a definition that defines the module urls for the extension's modules. See src/multiple-choice/pie.config.js

Installation

yarn add @pie-api/pie-element-extensions/
npm i @pie-api/pie-element-extensions/

Usage

<script type="module">
  import '@pie-api/pie-element-extensions/pie-element-extensions.js';
</script>
<!-- use one of the elements exported by the above import-->
<multiple-choice-cell></multiple-choice-cell>

Development

Quick Start

yarn  
yarn test

Adding new Elements

  • Add element source in src/pie-name directory.
  • Export a class that extends LitElement from the element module file. Also export this as default.
  • Add jsdoc @element tag-name in comments for the element class
  • Add jsdoc @prop {Type} name - description in coments for the element class
  • Add tests in src/pie-name/test
  • Add stories in stories/element-name/[pie-name].stories.js

Testing

To run the suite of karma tests, run

yarn test

To run the tests in watch mode (for TDD, for example), run

yarn test:watch

And open the URL that will be logged to consoleon test-server-start

Demoing with Storybook

To run a local instance of Storybook for the components, run

yarn storybook

To build a production version of Storybook, run

yarn storybook:build

Linting with ESLint, Prettier

To scan the project for linting errors, run

yarn lint

You can lint with ESLint and Prettier individually as well

yarn lint:eslint
yarn lint:prettier

To automatically fix many linting errors, run

yarn format

You can format using ESLint and Prettier individually as well

yarn format:eslint
yarn format:prettier

Local Demo with es-dev-server

yarn start

To run a local development server that serves the basic demo located in demo/index.html

1.47.3

8 months ago

1.47.1

9 months ago

1.47.2

8 months ago

1.46.0

9 months ago

1.47.0

9 months ago

1.45.0

9 months ago

1.44.4

1 year ago

1.44.5

1 year ago

1.44.3

1 year ago

1.44.2

1 year ago

1.44.1

1 year ago

1.44.0

1 year ago

1.43.0

1 year ago

1.41.0

4 years ago

1.42.2

3 years ago

1.42.1

3 years ago

1.40.0

4 years ago

1.40.1

4 years ago

1.39.2

4 years ago

1.39.1

4 years ago

1.39.0

4 years ago

1.38.0

4 years ago

1.37.1

4 years ago

1.37.0

4 years ago

1.35.0

4 years ago

1.36.0

4 years ago

1.34.6

4 years ago

1.34.7

4 years ago

1.34.5

4 years ago

1.34.4

4 years ago

1.34.3

4 years ago

1.34.2

4 years ago

1.34.0

4 years ago

1.34.1

4 years ago

1.32.5

4 years ago

1.32.6

4 years ago

1.33.0

4 years ago

1.32.4

4 years ago

1.32.2

4 years ago

1.32.3

4 years ago

1.32.1

4 years ago

1.32.0

4 years ago

1.31.13

4 years ago

1.31.12

4 years ago

1.31.9

4 years ago

1.31.10

4 years ago

1.31.11

4 years ago

1.31.6

4 years ago

1.31.7

4 years ago

1.31.8

4 years ago

1.31.5

4 years ago

1.31.3

4 years ago

1.31.4

4 years ago

1.31.1

4 years ago

1.31.2

4 years ago

1.31.0

4 years ago

1.30.0

4 years ago

1.29.0

4 years ago

1.28.0

4 years ago

1.27.6

4 years ago

1.27.4

4 years ago

1.27.5

4 years ago

1.27.2

4 years ago

1.27.3

4 years ago

1.27.0

4 years ago

1.27.1

4 years ago

1.25.0

4 years ago

1.24.1

4 years ago

1.26.0

4 years ago

1.24.0

4 years ago

1.23.0

4 years ago

1.22.0

4 years ago

1.21.0

4 years ago

1.20.0

4 years ago

1.19.1

4 years ago

1.19.0

5 years ago

1.18.1

5 years ago

1.18.0

5 years ago

1.17.0

5 years ago

1.16.0

5 years ago

1.15.0

5 years ago

1.14.0

5 years ago

1.13.0

5 years ago

1.12.0

5 years ago

1.11.3

5 years ago

1.11.2

5 years ago

1.11.1

5 years ago

1.11.0

5 years ago

1.10.1

5 years ago

1.10.0

5 years ago

1.9.0

5 years ago

1.8.0

5 years ago

1.7.1

5 years ago

1.7.0

5 years ago

1.6.9

5 years ago

1.6.8

5 years ago

1.6.7

5 years ago

1.6.6

5 years ago

1.6.4

5 years ago

1.6.5

5 years ago

1.6.3

5 years ago

1.6.2

5 years ago

1.6.1

5 years ago

1.6.0

5 years ago

1.5.3

5 years ago

1.5.2

5 years ago

1.5.1

5 years ago

1.5.0

5 years ago

1.4.0

5 years ago

1.3.2

5 years ago

1.3.1

5 years ago

1.3.0

5 years ago

1.2.1

5 years ago

1.2.0

5 years ago

1.1.2

5 years ago

1.1.1

5 years ago

1.1.0

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago