update-input-width

WebJar for update-input-width

Лицензия

Лицензия

MIT
Группа

Группа

org.webjars.npm
Идентификатор

Идентификатор

update-input-width
Последняя версия

Последняя версия

1.1.1
Дата

Дата

Тип

Тип

jar
Описание

Описание

update-input-width
WebJar for update-input-width
Ссылка на сайт

Ссылка на сайт

http://webjars.org
Система контроля версий

Система контроля версий

https://github.com/wojtekmaj/update-input-width

Скачать update-input-width

Как подключить последнюю версию

<!-- https://jarcasting.com/artifacts/org.webjars.npm/update-input-width/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>update-input-width</artifactId>
    <version>1.1.1</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/update-input-width/
implementation 'org.webjars.npm:update-input-width:1.1.1'
// https://jarcasting.com/artifacts/org.webjars.npm/update-input-width/
implementation ("org.webjars.npm:update-input-width:1.1.1")
'org.webjars.npm:update-input-width:jar:1.1.1'
<dependency org="org.webjars.npm" name="update-input-width" rev="1.1.1">
  <artifact name="update-input-width" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='update-input-width', version='1.1.1')
)
libraryDependencies += "org.webjars.npm" % "update-input-width" % "1.1.1"
[org.webjars.npm/update-input-width "1.1.1"]

Зависимости

Библиотека не имеет зависимостей. Это самодостаточное приложение, которое не зависит ни от каких других библиотек.

Модули Проекта

Данный проект не имеет модулей.

npm downloads CI dependencies dev dependencies tested with jest

Update-Input-Width

A function that given an input element, updates its width to fit its content.

tl;dr

  • Install by executing npm install update-input-width or yarn add update-input-width.
  • Import by adding import updateInputWidth from 'update-input-width'.
  • Pass input element to it. Forget.

User guide

updateInputWidth(element: HTMLInputElement)

A function that given an input element, updates its width to fit its content by setting inline width CSS property.

Sample result

42

Usage

import updateInputWidth from 'update-input-width';

or

import { updateInputWidth } from 'update-input-width';

getFontShorthand(element: HTMLElement)

A function that given HTML element returns font CSS shorthand property. Equal to Chrome-only code:

window.getComputedStyle(element).font

Sample result

"normal normal 600 normal 20px / 25px Arial, sans-serif"

Usage

import { getFontShorthand } from 'update-input-width';

measureText(text: string, font: string)

A function that given text and font CSS shorthand property returns text width in pixels.

Sample result

42

Usage

import { measureText } from 'update-input-width';

License

The MIT License.

Author

Wojciech Maj
kontakt@wojtekmaj.pl
http://wojtekmaj.pl

Версии библиотеки

Версия
1.1.1