@lion/ui 0.11.6 → 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 +1 -1
- package/components/input-amount/src/parsers.js +1 -1
- package/components/input-amount/test/parsers.test.js +5 -0
- package/dist-types/tsconfig.tsbuildinfo +1 -1
- package/docs/components/checkbox-group/overview.md +2 -2
- package/docs/components/collapsible/overview.md +1 -1
- package/docs/components/combobox/overview.md +1 -1
- package/docs/components/combobox/use-cases.md +1 -1
- package/docs/components/dialog/overview.md +1 -1
- package/docs/components/fieldset/overview.md +5 -5
- package/docs/components/form/overview.md +3 -3
- package/docs/components/form/use-cases.md +2 -2
- package/docs/components/icon/use-cases.md +1 -1
- package/docs/components/input/overview.md +1 -1
- package/docs/components/input-amount/overview.md +3 -3
- package/docs/components/input-date/overview.md +3 -3
- package/docs/components/input-datepicker/overview.md +5 -5
- package/docs/components/input-email/overview.md +2 -2
- package/docs/components/input-file/overview.md +1 -1
- package/docs/components/input-iban/overview.md +2 -2
- package/docs/components/input-range/overview.md +2 -2
- package/docs/components/input-stepper/overview.md +1 -1
- package/docs/components/input-tel/overview.md +1 -1
- package/docs/components/input-tel/use-cases.md +6 -6
- package/docs/components/input-tel-dropdown/overview.md +1 -1
- package/docs/components/listbox/use-cases.md +1 -1
- package/docs/components/radio-group/overview.md +3 -3
- package/docs/components/select/use-cases.md +1 -1
- package/docs/components/select-rich/use-cases.md +1 -1
- package/docs/components/tabs/examples.md +1 -1
- package/docs/fundamentals/index.md +4 -4
- package/docs/fundamentals/node-tools/publish-docs/overview.md +3 -3
- package/docs/fundamentals/node-tools/rocket-preset-extend-lion-docs/overview.md +2 -2
- package/docs/fundamentals/rationales/accessibility.md +1 -1
- package/docs/fundamentals/systems/core/SlotMixin.md +1 -1
- package/docs/fundamentals/systems/core/overview.md +1 -1
- package/docs/fundamentals/systems/form/formatting-and-parsing.md +4 -4
- package/docs/fundamentals/systems/form/model-value.md +1 -1
- package/docs/fundamentals/systems/form/overview.md +28 -28
- package/docs/fundamentals/systems/form/validate.md +2 -2
- package/docs/fundamentals/systems/localize/overview.md +4 -4
- package/docs/fundamentals/systems/overlays/configuration.md +2 -2
- package/docs/fundamentals/systems/overlays/overview.md +5 -5
- package/docs/fundamentals/systems/overlays/use-cases.md +2 -2
- package/docs/fundamentals/tools/helpers/overview.md +1 -1
- package/docs/fundamentals/tools/singleton-manager/overview.md +4 -4
- package/docs/guides/how-to/create-a-custom-field.md +5 -5
- package/docs/guides/how-to/create-a-form.md +4 -4
- package/docs/guides/how-to/extend-a-native-input.md +2 -2
- package/docs/guides/index.md +8 -8
- package/docs/guides/principles/index.md +5 -5
- package/docs/guides/principles/styling.md +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -44,7 +44,7 @@ They provide an unopinionated, white-label layer that can be extended to your ow
|
|
|
44
44
|
- **High Performance:** Focused on great performance in all relevant browsers with a minimal number of dependencies.
|
|
45
45
|
- **Accessibility:** Aimed at compliance with the WCAG 2.2 AA standard to create components that are accessible for everybody.
|
|
46
46
|
- **Flexibility:** Provides solutions through Web Components and JavaScript classes which can be used, adopted and extended to fit all needs.
|
|
47
|
-
- **Modern Code:** Lion is distributed as pure
|
|
47
|
+
- **Modern Code:** Lion is distributed as pure ES modules.
|
|
48
48
|
- **Exposes functions/classes and Web Components:** Ships a functionality in its most appropriate form.
|
|
49
49
|
|
|
50
50
|
> Note: Our demo examples might look simple and not very stylish. This is on purpose. They are designed to be basic so you can easily add your own styles to them to match your intended design, without dealing with styles that are already there.
|
|
@@ -31,7 +31,7 @@ function round(value, decimals) {
|
|
|
31
31
|
* @param {FormatNumberOptions} [givenOptions] Locale Options
|
|
32
32
|
*/
|
|
33
33
|
export function parseAmount(value, givenOptions) {
|
|
34
|
-
const unmatchedInput = value.match(/[^0-9
|
|
34
|
+
const unmatchedInput = value.match(/[^0-9,.\-\u2212 ]/g);
|
|
35
35
|
// for the full paste behavior documentation:
|
|
36
36
|
// ./docs/components/input-amount/use-cases.md#paste-behavior
|
|
37
37
|
if (unmatchedInput && givenOptions?.mode !== 'pasted') {
|
|
@@ -71,4 +71,9 @@ describe('parseAmount()', async () => {
|
|
|
71
71
|
parseAmount('123.456,78', { mode: 'user-edited', viewValueStates: ['formatted'] }),
|
|
72
72
|
).to.equal(123456.78);
|
|
73
73
|
});
|
|
74
|
+
|
|
75
|
+
it('parses negative numbers', async () => {
|
|
76
|
+
expect(parseAmount('−15.00')).to.equal(-15);
|
|
77
|
+
expect(parseAmount('-333.33')).to.equal(-333.33);
|
|
78
|
+
});
|
|
74
79
|
});
|