@canutin/svelte-currency-input 0.11.5 → 0.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -64,8 +64,9 @@ value | `number` | `undefined` | Initial value. If left `unde
64
64
  locale | `string` | `en-US` | Overrides default locale. [Examples](https://gist.github.com/ncreated/9934896) |
65
65
  currency | `string` | `USD` | Overrides default currency. [Examples](https://www.xe.com/symbols/) |
66
66
  name | `string` | `total` | Applies the name to the [input fields](#how-it-works) for _unformatted_ (e.g `[name=total]`) and _formatted_ (e.g. `[name=formatted-total]`) values |
67
- required | `boolean` | `false` | Marks the inputs as required |
68
- disabled | `boolean` | `false` | Marks the inputs as disabled |
67
+ id | `string` | `undefined` | Sets the `id` attribute on the input |
68
+ required | `boolean` | `false` | Marks the input as required |
69
+ disabled | `boolean` | `false` | Marks the input as disabled |
69
70
  placeholder | `string` `number` `null` | `0` | A `string` will override the default placeholder. A `number` will override it by formatting it to the set currency. Setting it to `null` will not show a placeholder |
70
71
  isZeroNullish | `boolean` | `false` | If `true` and when the value is `0`, it will override the default placeholder and render the formatted value in the field like any other value. _Note: this option might become the default in future versions_ |
71
72
  autocomplete | `string` | `undefined` | Sets the autocomplete attribute. Accepts any valid HTML [autocomplete attribute values](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete#values) |
@@ -17,6 +17,7 @@ export let locale = DEFAULT_LOCALE;
17
17
  export let currency = DEFAULT_CURRENCY;
18
18
  export let fractionDigits = DEFAULT_FRACTION_DIGITS;
19
19
  export let name = DEFAULT_NAME;
20
+ export let id = void 0;
20
21
  export let required = false;
21
22
  export let disabled = false;
22
23
  export let placeholder = DEFAULT_VALUE;
@@ -142,6 +143,7 @@ function setFormattedValue() {
142
143
  placeholder={handlePlaceholder(placeholder)}
143
144
  {autocomplete}
144
145
  {disabled}
146
+ {id}
145
147
  bind:this={inputElement}
146
148
  bind:value={formattedValue}
147
149
  on:keydown={handleKeyDown}
@@ -7,6 +7,7 @@ declare const __propDef: {
7
7
  currency?: string | undefined;
8
8
  fractionDigits?: number | undefined;
9
9
  name?: string | undefined;
10
+ id?: string | undefined;
10
11
  required?: boolean | undefined;
11
12
  disabled?: boolean | undefined;
12
13
  placeholder?: string | number | null | undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@canutin/svelte-currency-input",
3
- "version": "0.11.5",
3
+ "version": "0.12.0",
4
4
  "scripts": {
5
5
  "dev": "vite dev",
6
6
  "build": "vite build",
@@ -25,9 +25,9 @@
25
25
  ],
26
26
  "devDependencies": {
27
27
  "@playwright/test": "^1.39.0",
28
- "@sveltejs/adapter-auto": "^3.2.0",
29
- "@sveltejs/adapter-cloudflare": "^4.4.0",
30
- "@sveltejs/kit": "^2.0.0",
28
+ "@sveltejs/adapter-auto": "^3.2.5",
29
+ "@sveltejs/adapter-cloudflare": "^4.7.3",
30
+ "@sveltejs/kit": "^2.7.1",
31
31
  "@sveltejs/package": "^2.2.2",
32
32
  "@sveltejs/vite-plugin-svelte": "^3.0.0",
33
33
  "@types/node": "^20.8.7",