@onepercentio/one-ui 1.0.6 → 1.0.8
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/dist/components/CurrencyInput/CurrencyInput.d.ts +1 -1
- package/dist/components/CurrencyInput/CurrencyInput.hook.d.ts +2 -1
- package/dist/components/CurrencyInput/CurrencyInput.hook.js +3 -4
- package/dist/components/CurrencyInput/CurrencyInput.js +5 -3
- package/dist/components/EmailInput/EmailInput.d.ts +1 -1
- package/dist/components/Form/Form.d.ts +10 -0
- package/dist/components/Form/Form.js +44 -24
- package/dist/components/Form/FormField/Extensions/DateField/DateField.d.ts +2 -2
- package/dist/components/Form/FormField/Extensions/DateField/DateField.js +12 -8
- package/dist/components/Form/FormField/FormField.js +7 -2
- package/dist/components/Input/Input.d.ts +3 -3
- package/dist/components/Input/Input.js +5 -3
- package/dist/components/NumberInput/NumberInput.d.ts +7 -0
- package/dist/components/NumberInput/NumberInput.js +45 -0
- package/dist/components/NumberInput/index.d.ts +2 -0
- package/dist/components/NumberInput/index.js +26 -0
- package/dist/components/PasswordInput/PasswordInput.d.ts +1 -1
- package/dist/context/OneUIProvider.d.ts +5 -0
- package/dist/context/OneUIProvider.js +1 -1
- package/dist/hooks/usePooling.js +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.js +53 -34
- package/dist/utils/formatters.d.ts +4 -0
- package/dist/utils/formatters.js +19 -2
- package/dist-ts/components/CurrencyInput/CurrencyInput.d.ts +1 -1
- package/dist-ts/components/CurrencyInput/CurrencyInput.hook.d.ts +2 -1
- package/dist-ts/components/CurrencyInput/CurrencyInput.hook.js +2 -3
- package/dist-ts/components/CurrencyInput/CurrencyInput.hook.js.map +1 -1
- package/dist-ts/components/CurrencyInput/CurrencyInput.js +4 -3
- package/dist-ts/components/CurrencyInput/CurrencyInput.js.map +1 -1
- package/dist-ts/components/EmailInput/EmailInput.d.ts +1 -1
- package/dist-ts/components/Form/Form.d.ts +10 -0
- package/dist-ts/components/Form/Form.js +21 -13
- package/dist-ts/components/Form/Form.js.map +1 -1
- package/dist-ts/components/Form/FormField/Extensions/DateField/DateField.d.ts +2 -2
- package/dist-ts/components/Form/FormField/Extensions/DateField/DateField.js +12 -7
- package/dist-ts/components/Form/FormField/Extensions/DateField/DateField.js.map +1 -1
- package/dist-ts/components/Form/FormField/FormField.js +3 -1
- package/dist-ts/components/Form/FormField/FormField.js.map +1 -1
- package/dist-ts/components/Input/Input.d.ts +3 -3
- package/dist-ts/components/Input/Input.js +2 -1
- package/dist-ts/components/Input/Input.js.map +1 -1
- package/dist-ts/components/NumberInput/NumberInput.d.ts +7 -0
- package/dist-ts/components/NumberInput/NumberInput.js +37 -0
- package/dist-ts/components/NumberInput/NumberInput.js.map +1 -0
- package/dist-ts/components/NumberInput/index.d.ts +2 -0
- package/dist-ts/components/NumberInput/index.js +3 -0
- package/dist-ts/components/NumberInput/index.js.map +1 -0
- package/dist-ts/components/PasswordInput/PasswordInput.d.ts +1 -1
- package/dist-ts/context/OneUIProvider.d.ts +5 -0
- package/dist-ts/context/OneUIProvider.js.map +1 -1
- package/dist-ts/hooks/usePooling.js.map +1 -1
- package/dist-ts/index.d.ts +2 -0
- package/dist-ts/index.js +2 -0
- package/dist-ts/index.js.map +1 -1
- package/dist-ts/utils/formatters.d.ts +4 -0
- package/dist-ts/utils/formatters.js +17 -0
- package/dist-ts/utils/formatters.js.map +1 -1
- package/package.json +1 -1
- package/tsconfig.json +1 -1
- package/tsconfig.prod.json +1 -1
|
@@ -15,3 +15,7 @@ export declare const currencyFormatterFactory: (langCode: string, currency?: str
|
|
|
15
15
|
value: string | undefined;
|
|
16
16
|
}[];
|
|
17
17
|
};
|
|
18
|
+
export declare const decimalFormatterFactory: (langCode: string) => Intl.NumberFormat | {
|
|
19
|
+
format: (num: number) => string;
|
|
20
|
+
formatToParts: (num: number) => Intl.NumberFormatPart[];
|
|
21
|
+
};
|
|
@@ -30,4 +30,21 @@ export const currencyFormatterFactory = (langCode, currency) => {
|
|
|
30
30
|
};
|
|
31
31
|
}
|
|
32
32
|
};
|
|
33
|
+
export const decimalFormatterFactory = (langCode) => {
|
|
34
|
+
try {
|
|
35
|
+
return new Intl.NumberFormat(langCode, {
|
|
36
|
+
style: "decimal",
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
catch (e) {
|
|
40
|
+
const f = new Intl.NumberFormat(langCode, {
|
|
41
|
+
minimumFractionDigits: 2,
|
|
42
|
+
maximumFractionDigits: 2,
|
|
43
|
+
});
|
|
44
|
+
return {
|
|
45
|
+
format: (num) => `${currencyNumberFormatter(num)}`,
|
|
46
|
+
formatToParts: (num) => [...f.formatToParts(num)],
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
};
|
|
33
50
|
//# sourceMappingURL=formatters.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"formatters.js","sourceRoot":"","sources":["../../src/utils/formatters.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,IAAI,IAAI,CAAC,YAAY,CAAC,OAAO,EAAE;IACpE,qBAAqB,EAAE,CAAC;IACxB,qBAAqB,EAAE,CAAC;CACzB,CAAC,CAAC,MAAM,CAAC;AAEV;;GAEG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,CACtC,QAAgB,EAChB,QAAiB,EACjB,EAAE;IACF,IAAI,CAAC;QACH,OAAO,IAAI,IAAI,CAAC,YAAY,CAAC,QAAQ,EAAE;YACrC,KAAK,EAAE,UAAU;YACjB,QAAQ,EAAE,QAAQ;SACnB,CAAC,CAAC;IACL,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,MAAM,CAAC,GAAG,IAAI,IAAI,CAAC,YAAY,CAAC,QAAQ,EAAE;YACxC,qBAAqB,EAAE,CAAC;YACxB,qBAAqB,EAAE,CAAC;SACzB,CAAC,CAAC;QAEH,OAAO;YACL,MAAM,EAAE,CAAC,GAAW,EAAE,EAAE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,EAAE,SAAS,EAAE,KAAK,EAAE,GAAG,EAAE;gBAC/B,GAAG,CAAC,CAAC,aAAa,CAAC,GAAG,CAAC;aACxB;SACF,CAAC;IACJ,CAAC;AACH,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,QAAgB,EAAE,EAAE;IAC1D,IAAI,CAAC;QACH,OAAO,IAAI,IAAI,CAAC,YAAY,CAAC,QAAQ,EAAE;YACrC,KAAK,EAAE,SAAS;SACjB,CAAC,CAAC;IACL,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,MAAM,CAAC,GAAG,IAAI,IAAI,CAAC,YAAY,CAAC,QAAQ,EAAE;YACxC,qBAAqB,EAAE,CAAC;YACxB,qBAAqB,EAAE,CAAC;SACzB,CAAC,CAAC;QAEH,OAAO;YACL,MAAM,EAAE,CAAC,GAAW,EAAE,EAAE,CAAC,GAAG,uBAAuB,CAAC,GAAG,CAAC,EAAE;YAC1D,aAAa,EAAE,CAAC,GAAW,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC;SAC1D,CAAC;IACJ,CAAC;AACH,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@onepercentio/one-ui",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.8",
|
|
4
4
|
"description": "A set of reusable components created through the development of Onepercent projects",
|
|
5
5
|
"repository": "git@github.com:onepercentio/one-ui.git",
|
|
6
6
|
"author": "Murilo Oliveira de Araujo <murilo.araujo@onepercent.io>",
|
package/tsconfig.json
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"target": "ES2015" /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */,
|
|
15
15
|
"lib": [
|
|
16
16
|
"DOM",
|
|
17
|
-
"
|
|
17
|
+
"ES2021"
|
|
18
18
|
] /* Specify a set of bundled library declaration files that describe the target runtime environment. */,
|
|
19
19
|
"jsx": "react-jsx" /* Specify what JSX code is generated. */,
|
|
20
20
|
// "experimentalDecorators": true, /* Enable experimental support for TC39 stage 2 draft decorators. */
|
package/tsconfig.prod.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"target": "esnext" /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */,
|
|
5
5
|
"lib": [
|
|
6
6
|
"DOM",
|
|
7
|
-
"
|
|
7
|
+
"ES2021"
|
|
8
8
|
] /* Specify a set of bundled library declaration files that describe the target runtime environment. */,
|
|
9
9
|
"jsx": "react-jsx" /* Specify what JSX code is generated. */,
|
|
10
10
|
/* Modules */
|