3.11.4 • Published 3 months ago

@baloise/web-app-pipes v3.11.4

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
3 months ago

@baloise/web-app-pipes

Continuous Release npm npm bundle size npm GitHub GitHub issues

Installation

npm install @baloise/web-app-pipes

Usage

Use pipe function to transform any kind of data to a display format. The pipe are simple functions which always return a string. Just import the function and use it to transform data in to readable strings.

import { balCapitalize } from '@baloise/web-app-pipes'

balCapitalize('baloise')
// returns 'Baloise'

API

balBlobToUrl

balBlobToUrl(value: Blob) => string

Transforms the given blob parameter to object URL string.

For more information look up the documentation about URL.createObjectURL

balCapitalize

balCapitalize(value: any) => string

Transforms the given string parameter to capitalize string.

balCapitalize('baloise') // Baloise

balClaimNumber

balClaimNumber(value: any) => string

Transforms the given string into the correct claim-number format.

balClaimNumber('73001217169') // 73/001217/16.9

balContractNumber

balContractNumber(value: any) => string

Transforms the given string into the correct police-number format.

balContractNumber('501222333') // 50/1.222.333

balCurrency

balCurrency(value: any, currencySign: any, showZero: any, decimalLength: any) => string

Formats the number into a human readable currency string.

balCurrency(1234567.89) // 1'234'567.89

balDateString

balDateString(value: any) => string

Transforms the given string parameter to capitalize string.

balDateString(new Date(2022, 11, 31)) // '2022-12-31'

balDefaultString

balDefaultString(value: any, defaultString: any) => string

If the value is empty it shows a dash ('-').

balDefaultString('') // -\n
balDefaultString('text') // text

balFileSize

balFileSize(value: number) => string

Transforms the filesize in human readable string.

balFileSize(86956565) // 82.9 MB

balHighlight

balHighlight(value: string, search: string, cssClass: any) => string

Transforms the given text into a highlighted html content.

balHighlight('Some Text') // <span class="bal-highlight">Some Text</span>

balHighlightStartsWith

balHighlightStartsWith(value: string, search: string, cssClass: any) => string

Transforms the given text into a highlighted html content.

balHighlightStartsWith('Some Text', 'Some') // <span class="bal-highlight">Some</span> Text

balJoinArray

balJoinArray(value: any, delimiter: any) => string

Transforms the given string array in to a string.

balJoinArray(['Apple', 'Potato', 'Bacon']) // Apple, Potato, Bacon

balLimit

balLimit(value: any, limit: any) => string

Limits the input string.

balLimit('Some string that is ways to long to be rendered') // Some string that is ...

balOfferNumber

balOfferNumber(value: any, varianteNr: string) => string

Transforms the input string into a offer number.

balOfferNumber('987654321') // 98/7.654.321

balPhoneNumber

balPhoneNumber(value: any) => string

Formats the given phone.

balPhoneNumber('41,41564410808') // +41 56 441 08 08
balPhoneNumber({ countryCode: '41', phoneNumber: '564410808' }) // +41 56 441 08 08
3.11.4

3 months ago

3.11.3

4 months ago

3.11.2

8 months ago

3.10.1

1 year ago

3.10.0

1 year ago

3.11.0

1 year ago

3.11.1

1 year ago

3.9.0

1 year ago

3.7.1-beta.302

1 year ago

3.7.1-beta.304

1 year ago

3.7.1-beta.303

1 year ago

3.7.1-beta.305

1 year ago

3.7.3

1 year ago

3.7.2

1 year ago

3.8.0

1 year ago

3.6.4

2 years ago

3.6.3

2 years ago

3.7.2-beta.1

1 year ago

3.7.1

1 year ago

3.7.0

1 year ago

3.3.2-beta.4

2 years ago

3.3.2-beta.7

2 years ago

3.3.2-beta.8

2 years ago

3.3.2-beta.5

2 years ago

3.3.2-beta.6

2 years ago

3.3.2-beta.9

2 years ago

3.3.2-beta.20

2 years ago

3.3.2-beta.22

2 years ago

3.3.2-beta.24

2 years ago

3.3.2-beta.23

2 years ago

3.6.2

2 years ago

3.6.1

2 years ago

3.6.0

2 years ago

3.3.2-beta.14

2 years ago

3.3.2-beta.17

2 years ago

3.3.2-beta.16

2 years ago

3.3.2-beta.19

2 years ago

3.3.2-beta.18

2 years ago

3.3.2-beta.13

2 years ago

3.5.0

2 years ago

3.4.0

2 years ago

3.3.1

2 years ago

3.3.0

2 years ago

3.2.1

2 years ago

3.3.3

2 years ago

3.3.2

2 years ago

3.1.0

2 years ago

3.0.1

2 years ago

3.0.0

2 years ago

2.0.15

2 years ago

2.0.16

2 years ago

2.0.13

2 years ago

2.0.14

2 years ago

2.0.11

2 years ago

2.0.12

2 years ago

2.0.9

2 years ago

2.0.10

2 years ago

2.0.8

2 years ago

2.0.7

2 years ago

2.0.6

2 years ago

2.0.5

2 years ago

2.0.4

2 years ago

2.0.3

2 years ago

2.0.2

2 years ago

2.0.2-beta.3

2 years ago

2.0.1

2 years ago

2.0.0

2 years ago

0.0.1

2 years ago