1.0.7 • Published 9 months ago

@pyncho-wc/p-trim-text v1.0.7

Weekly downloads
-
License
MIT
Repository
github
Last release
9 months ago

\

Component that allows to trim text with replacer. And show full text with native description (title and aria-label) on hover

Published on webcomponents.org npm (scoped) NPM npm package minimized gzipped size (select exports) skypack cdn download link

This webcomponent follows the open-wc recommendation.

<p-trim-text></p-trim-text>

Installation

CDN

Inside script:

import 'https://cdn.skypack.dev/@pyncho-wc/p-trim-text';

Or in html:

<script
  type="module"
  src="https://cdn.skypack.dev/@pyncho-wc/p-trim-text">
</script>

With builders like webpack, vite etc:

npm i @pyncho-wc/p-trim-text

If you need to change tag name:

import PTrimText from '@pyncho-wc/p-trim-text/index.js';
customElements.define('custom-trim-text', PTrimText);

Usage

<p-trim-text
  letters-to-trim="5"
  replacer='---'>
  Lorem ipsum dolor sit amet consectetur adipisicing elit.
</p-trim-text>

<!-- RESULT: -->
<!-- Lorem--- -->

Linting and formatting

To scan the project for linting and formatting errors, run

npm run lint

To automatically fix linting and formatting errors, run

npm run format

Testing with Web Test Runner

To execute a single test run:

npm run test

To run the tests in interactive watch mode run:

npm run test:watch

Tooling configs

For most of the tools, the configuration is in the package.json to minimize the amount of files in your project.

If you customize the configuration a lot, you can consider moving them to individual files.


Local Demo with web-dev-server

npm start

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

1.0.7

9 months ago

1.0.6

9 months ago

1.0.5

9 months ago

1.0.4

9 months ago

1.0.3

9 months ago

1.0.1

9 months ago

1.0.0

9 months ago