@dnb/eufemia 10.68.0 → 10.68.1
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/CHANGELOG.md +8 -0
- package/cjs/components/number-format/NumberUtils.js +2 -1
- package/cjs/components/number-format/NumberUtils.js.map +1 -1
- package/cjs/shared/Eufemia.d.ts +1 -1
- package/cjs/shared/Eufemia.js +2 -2
- package/cjs/shared/Eufemia.js.map +1 -1
- package/cjs/shared/Translation.js +5 -6
- package/cjs/shared/Translation.js.map +1 -1
- package/cjs/style/core/scopes.scss +1 -1
- package/cjs/style/dnb-ui-basis.css +1 -1
- package/cjs/style/dnb-ui-basis.min.css +1 -1
- package/cjs/style/dnb-ui-body.css +1 -1
- package/cjs/style/dnb-ui-body.min.css +1 -1
- package/cjs/style/dnb-ui-core.css +1 -1
- package/cjs/style/dnb-ui-core.min.css +1 -1
- package/components/number-format/NumberUtils.js +2 -1
- package/components/number-format/NumberUtils.js.map +1 -1
- package/es/components/number-format/NumberUtils.js +2 -1
- package/es/components/number-format/NumberUtils.js.map +1 -1
- package/es/shared/Eufemia.d.ts +1 -1
- package/es/shared/Eufemia.js +2 -2
- package/es/shared/Eufemia.js.map +1 -1
- package/es/shared/Translation.js +5 -4
- package/es/shared/Translation.js.map +1 -1
- package/es/style/core/scopes.scss +1 -1
- package/es/style/dnb-ui-basis.css +1 -1
- package/es/style/dnb-ui-basis.min.css +1 -1
- package/es/style/dnb-ui-body.css +1 -1
- package/es/style/dnb-ui-body.min.css +1 -1
- package/es/style/dnb-ui-core.css +1 -1
- package/es/style/dnb-ui-core.min.css +1 -1
- package/esm/dnb-ui-basis.min.mjs +1 -1
- package/esm/dnb-ui-components.min.mjs +1 -1
- package/esm/dnb-ui-elements.min.mjs +1 -1
- package/esm/dnb-ui-extensions.min.mjs +1 -1
- package/esm/dnb-ui-lib.min.mjs +1 -1
- package/package.json +2 -2
- package/shared/Eufemia.d.ts +1 -1
- package/shared/Eufemia.js +2 -2
- package/shared/Eufemia.js.map +1 -1
- package/shared/Translation.js +5 -4
- package/shared/Translation.js.map +1 -1
- package/style/core/scopes.scss +1 -1
- package/style/dnb-ui-basis.css +1 -1
- package/style/dnb-ui-basis.min.css +1 -1
- package/style/dnb-ui-body.css +1 -1
- package/style/dnb-ui-body.min.css +1 -1
- package/style/dnb-ui-core.css +1 -1
- package/style/dnb-ui-core.min.css +1 -1
- package/umd/dnb-ui-basis.min.js +1 -1
- package/umd/dnb-ui-components.min.js +1 -1
- package/umd/dnb-ui-elements.min.js +1 -1
- package/umd/dnb-ui-extensions.min.js +1 -1
- package/umd/dnb-ui-lib.min.js +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
@charset "UTF-8";html{-webkit-text-size-adjust:100%;-moz-text-size-adjust:100%;text-size-adjust:100%;cursor:default;font-family:system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,Cantarell,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;line-height:var(--line-height-basis);tab-size:4;word-break:break-word}body{margin:0}html{font-size:100%}html:not([data-visual-test]){scroll-behavior:smooth}@supports (-webkit-touch-callout:none){@supports (font:-apple-system-body){html{font:-apple-system-body}}}html[xmlns="http://www.w3.org/1999/xhtml"] .dnb-anchor--active{color:var(--color-mint-green)!important}html[xmlns="http://www.w3.org/1999/xhtml"] .dnb-anchor--contrast:not(:hover){color:var(--color-white)!important}html[xmlns="http://www.w3.org/1999/xhtml"] a.dnb-button--primary{color:var(--color-white)}html[xmlns="http://www.w3.org/1999/xhtml"] .dnb-ul{list-style:initial}html[xmlns="http://www.w3.org/1999/xhtml"] .dnb-p{background-color:initial;overflow:initial;text-align:inherit}html[xmlns="http://www.w3.org/1999/xhtml"] i{font-style:italic}html[xmlns="http://www.w3.org/1999/xhtml"] #column_left,html[xmlns="http://www.w3.org/1999/xhtml"] #root{width:100%}html[xmlns="http://www.w3.org/1999/xhtml"] body#dnbLayoutDefault #wrapper,html[xmlns="http://www.w3.org/1999/xhtml"] body#dnbLayoutDefaultStartPage #wrapper{padding:0;width:100%}html[xmlns="http://www.w3.org/1999/xhtml"] #column_content{box-shadow:none}.dnb-core-style,body{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;-webkit-tap-highlight-color:rgba(0,0,0,0);-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%;--eufemia-version:"10.68.0";color:var(--theme-color-body,var(--color-black-80,#333));font-family:var(--font-family-default);font-size:var(--font-size-small);font-style:normal;font-weight:var(--font-weight-basis);line-height:var(--line-height-basis);tab-size:4;-moz-tab-size:4;word-break:break-word}.dnb-core-style *,.dnb-core-style :after,.dnb-core-style :before,body *,body :after,body :before{background-repeat:no-repeat;box-sizing:border-box}.dnb-core-style :after,.dnb-core-style :before,body :after,body :before{text-decoration:inherit;vertical-align:inherit}.dnb-core-style hr,body hr{height:0;overflow:visible}.dnb-core-style main,body main{display:block}.dnb-core-style nav ol,.dnb-core-style nav ul,body nav ol,body nav ul{list-style:none}.dnb-core-style abbr[title],body abbr[title]{text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted}.dnb-core-style b,.dnb-core-style strong,body b,body strong{font-weight:bolder}.dnb-core-style code,.dnb-core-style kbd,.dnb-core-style pre,.dnb-core-style samp,body code,body kbd,body pre,body samp{font-family:var(--font-family-monospace)}.dnb-core-style ::selection,body ::selection{background-color:#b3d4fc;color:#000;text-shadow:none}.dnb-core-style audio,.dnb-core-style canvas,.dnb-core-style iframe,.dnb-core-style img,.dnb-core-style svg,.dnb-core-style video,body audio,body canvas,body iframe,body img,body svg,body video{vertical-align:middle}.dnb-core-style audio,.dnb-core-style video,body audio,body video{display:inline-block}.dnb-core-style audio:not([controls]),body audio:not([controls]){display:none;height:0}.dnb-core-style img,body img{border-style:none}.dnb-core-style svg:not([fill]),body svg:not([fill]){fill:currentcolor}.dnb-core-style svg:not(:root),body svg:not(:root){overflow:hidden}.dnb-core-style table,body table{border-collapse:collapse}.dnb-core-style button,.dnb-core-style input,.dnb-core-style select,.dnb-core-style textarea,body button,body input,body select,body textarea{font-family:inherit;font-size:inherit;line-height:inherit}.dnb-core-style button,.dnb-core-style figure,.dnb-core-style input,.dnb-core-style select,body button,body figure,body input,body select{margin:0}.dnb-core-style button,body button{overflow:visible;text-transform:none}.dnb-core-style input,body input{overflow:visible;word-break:normal}.dnb-core-style legend,body legend{color:inherit;display:table;max-width:100%;white-space:normal}.dnb-core-style progress,body progress{display:inline-block;vertical-align:baseline}.dnb-core-style select,body select{text-transform:none}.dnb-core-style textarea,body textarea{overflow:auto;resize:vertical}.dnb-core-style [type=checkbox],.dnb-core-style [type=radio],body [type=checkbox],body [type=radio]{padding:0}.dnb-core-style input[type=search],body input[type=search]{-webkit-appearance:textfield;appearance:textfield;outline-offset:-2px}.dnb-core-style ::-webkit-inner-spin-button,.dnb-core-style ::-webkit-outer-spin-button,body ::-webkit-inner-spin-button,body ::-webkit-outer-spin-button{height:auto}.dnb-core-style ::input-placeholder,body ::input-placeholder{color:inherit;opacity:.54}.dnb-core-style ::-webkit-search-decoration,body ::-webkit-search-decoration{-webkit-appearance:none;appearance:none}.dnb-core-style ::-webkit-file-upload-button,body ::-webkit-file-upload-button{background-color:transparent;border:none;font:inherit}.dnb-core-style ::-moz-focus-inner,body ::-moz-focus-inner{border-style:none;padding:0}.dnb-core-style details,body details{display:block}.dnb-core-style summary,body summary{display:list-item}.dnb-core-style canvas,body canvas{display:inline-block}.dnb-core-style template,body template{display:none}.dnb-core-style [tabindex],.dnb-core-style a,.dnb-core-style area,.dnb-core-style button,.dnb-core-style input,.dnb-core-style label,.dnb-core-style select,.dnb-core-style summary,.dnb-core-style textarea,body [tabindex],body a,body area,body button,body input,body label,body select,body summary,body textarea{touch-action:manipulation}.dnb-core-style [hidden],body [hidden]{display:none}.dnb-core-style [aria-busy=true],body [aria-busy=true]{cursor:progress}.dnb-core-style [aria-controls]:not(input),body [aria-controls]:not(input){cursor:pointer}.dnb-core-style [aria-disabled=true],.dnb-core-style [disabled],body [aria-disabled=true],body [disabled]{cursor:not-allowed}.dnb-core-style [aria-hidden=false][hidden]:not(:focus),body [aria-hidden=false][hidden]:not(:focus){clip:rect(0,0,0,0);display:inherit;position:absolute}@media print{.dnb-core-style,body{background-color:#fff;color:#000}}.dnb-core-style .eufemia-theme,body .eufemia-theme{color:var(--theme-color-body,var(--color-black-80,#333));font-family:var(--font-family-default);font-size:var(--font-size-small);font-style:normal;font-weight:var(--font-weight-basis);line-height:var(--line-height-basis)}.dnb-no-focus,.dnb-tab-focus,.dnb-tab-focus:focus{outline:none}html[data-whatinput=keyboard] .dnb-tab-focus:focus{--border-color:var(--focus-ring-color);--border-width:var(--focus-ring-width);border-color:transparent;box-shadow:0 0 0 var(--border-width) var(--border-color)}.dnb-mouse-focus,.dnb-mouse-focus:focus{outline:none}html[data-whatinput=mouse] .dnb-mouse-focus:focus{box-shadow:0 0 0 var(--border-width) var(--border-color)}.dnb-focus-ring,html[data-whatinput=mouse] .dnb-mouse-focus:focus{--border-color:var(--focus-ring-color);--border-width:var(--focus-ring-width);border-color:transparent}.dnb-focus-ring{box-shadow:0 0 0 var(--border-width) var(--border-color)!important}.dnb-scrollbar-appearance{-webkit-overflow-scrolling:touch;-ms-overflow-style:auto;scrollbar-color:var(--scrollbar-thumb-color,#888) transparent}@supports not (scrollbar-color:auto){.dnb-scrollbar-appearance::-webkit-scrollbar{background-color:var(--scrollbar-track-color,#eee);border-radius:var(--scrollbar-thumb-width,.5rem)}.dnb-scrollbar-appearance::-webkit-scrollbar:vertical{width:var(--scrollbar-track-width,.5rem)}.dnb-scrollbar-appearance::-webkit-scrollbar:horizontal{height:var(--scrollbar-track-width,.5rem)}.dnb-scrollbar-appearance::-webkit-scrollbar-thumb{background-color:var(--scrollbar-thumb-color,#888);border-radius:var(--scrollbar-thumb-width,.5rem)}.dnb-scrollbar-appearance::-webkit-scrollbar-thumb:hover{background-color:var(--scrollbar-thumb-hover-color,#666)}}.dnb-skip-link{opacity:.3;position:absolute;top:-100vh;transition:opacity .3s ease-out;z-index:0}.dnb-skip-link--active,.dnb-skip-link:focus{background-color:transparent;border:none;border-radius:0;box-shadow:none;color:var(--skip-link-color);font-size:var(--font-size-basis);left:40%;margin:0;outline:none;padding:.5rem 1rem;position:fixed;text-align:center;-webkit-text-decoration:none;text-decoration:none;top:5%;user-select:none;-webkit-user-select:none;white-space:nowrap;z-index:9999}.dnb-skip-link--active:after,.dnb-skip-link:focus:after{background-color:hsla(0,0%,100%,.85);box-shadow:150vw 150vh 0 0 hsla(0,0%,100%,.85);content:"";height:150vh;left:-200vw;position:absolute;top:-200vh;width:150vw;z-index:-2}.dnb-skip-link--active:before,.dnb-skip-link:focus:before{background-color:var(--skip-link-background);border-radius:1.5rem;content:"";height:100%;left:0;outline:none;position:absolute;top:0;width:100%;z-index:-1}html[data-whatinput=mouse] .dnb-skip-link--active:before,html[data-whatinput=mouse] .dnb-skip-link:focus:before{--border-color:var(--focus-ring-color);--border-width:var(--focus-ring-width);border-color:transparent;box-shadow:0 0 0 var(--border-width) var(--border-color)}.dnb-skip-link--active:hover:before,.dnb-skip-link:focus:hover:before{background-color:var(--skip-link-background--hover)}.dnb-skip-link--active:active:before,.dnb-skip-link:focus:active:before{background-color:var(--skip-link-background--active)}.dnb-skip-link--active:focus:not(:active):before,.dnb-skip-link:focus:focus:not(:active):before{outline:none}html[data-whatinput=keyboard] .dnb-skip-link--active:focus:not(:active):before,html[data-whatinput=keyboard] .dnb-skip-link:focus:focus:not(:active):before{--border-color:var(--focus-ring-color);--border-width:var(--focus-ring-width);border-color:transparent;box-shadow:0 0 0 var(--border-width) var(--border-color)}.dnb-skip-link--active:focus,.dnb-skip-link:focus:focus{opacity:1}.dnb-skip-link--active:hover,.dnb-skip-link:focus:hover{background-color:transparent;box-shadow:none;color:var(--skip-link-color--hover)}.dnb-skip-link--active:focus:not(:hover):not(:active),.dnb-skip-link:focus:focus:not(:hover):not(:active){background-color:transparent;box-shadow:none;color:var(--skip-link-color)}.dnb-skip-link--active:active,.dnb-skip-link:focus:active{background-color:transparent;color:var(--skip-link-color--active)}html[data-whatintent=touch] .dnb-skip-link{display:none}.dnb-alignment-helper,.dnb-alignment-helper:before{speak:none;display:inline-block;font-size:var(--font-size-small);height:0;width:0}.dnb-alignment-helper:before{content:""}.dnb-drop-shadow{box-shadow:var(--shadow-default)}.dnb-sr-only{-webkit-touch-callout:none!important;border:0!important;clip-path:inset(50%)!important;margin:0!important;max-height:1px!important;max-width:1px!important;overflow:hidden!important;padding:0!important;pointer-events:none!important;position:absolute!important;-webkit-user-select:none!important;user-select:none!important;white-space:nowrap!important}.dnb-suffix{font-size:var(--font-size-basis);line-height:var(--line-height-basis);padding-left:.5rem;word-break:normal}
|
|
1
|
+
@charset "UTF-8";html{-webkit-text-size-adjust:100%;-moz-text-size-adjust:100%;text-size-adjust:100%;cursor:default;font-family:system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,Cantarell,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;line-height:var(--line-height-basis);tab-size:4;word-break:break-word}body{margin:0}html{font-size:100%}html:not([data-visual-test]){scroll-behavior:smooth}@supports (-webkit-touch-callout:none){@supports (font:-apple-system-body){html{font:-apple-system-body}}}html[xmlns="http://www.w3.org/1999/xhtml"] .dnb-anchor--active{color:var(--color-mint-green)!important}html[xmlns="http://www.w3.org/1999/xhtml"] .dnb-anchor--contrast:not(:hover){color:var(--color-white)!important}html[xmlns="http://www.w3.org/1999/xhtml"] a.dnb-button--primary{color:var(--color-white)}html[xmlns="http://www.w3.org/1999/xhtml"] .dnb-ul{list-style:initial}html[xmlns="http://www.w3.org/1999/xhtml"] .dnb-p{background-color:initial;overflow:initial;text-align:inherit}html[xmlns="http://www.w3.org/1999/xhtml"] i{font-style:italic}html[xmlns="http://www.w3.org/1999/xhtml"] #column_left,html[xmlns="http://www.w3.org/1999/xhtml"] #root{width:100%}html[xmlns="http://www.w3.org/1999/xhtml"] body#dnbLayoutDefault #wrapper,html[xmlns="http://www.w3.org/1999/xhtml"] body#dnbLayoutDefaultStartPage #wrapper{padding:0;width:100%}html[xmlns="http://www.w3.org/1999/xhtml"] #column_content{box-shadow:none}.dnb-core-style,body{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;-webkit-tap-highlight-color:rgba(0,0,0,0);-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%;--eufemia-version:"10.68.1";color:var(--theme-color-body,var(--color-black-80,#333));font-family:var(--font-family-default);font-size:var(--font-size-small);font-style:normal;font-weight:var(--font-weight-basis);line-height:var(--line-height-basis);tab-size:4;-moz-tab-size:4;word-break:break-word}.dnb-core-style *,.dnb-core-style :after,.dnb-core-style :before,body *,body :after,body :before{background-repeat:no-repeat;box-sizing:border-box}.dnb-core-style :after,.dnb-core-style :before,body :after,body :before{text-decoration:inherit;vertical-align:inherit}.dnb-core-style hr,body hr{height:0;overflow:visible}.dnb-core-style main,body main{display:block}.dnb-core-style nav ol,.dnb-core-style nav ul,body nav ol,body nav ul{list-style:none}.dnb-core-style abbr[title],body abbr[title]{text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted}.dnb-core-style b,.dnb-core-style strong,body b,body strong{font-weight:bolder}.dnb-core-style code,.dnb-core-style kbd,.dnb-core-style pre,.dnb-core-style samp,body code,body kbd,body pre,body samp{font-family:var(--font-family-monospace)}.dnb-core-style ::selection,body ::selection{background-color:#b3d4fc;color:#000;text-shadow:none}.dnb-core-style audio,.dnb-core-style canvas,.dnb-core-style iframe,.dnb-core-style img,.dnb-core-style svg,.dnb-core-style video,body audio,body canvas,body iframe,body img,body svg,body video{vertical-align:middle}.dnb-core-style audio,.dnb-core-style video,body audio,body video{display:inline-block}.dnb-core-style audio:not([controls]),body audio:not([controls]){display:none;height:0}.dnb-core-style img,body img{border-style:none}.dnb-core-style svg:not([fill]),body svg:not([fill]){fill:currentcolor}.dnb-core-style svg:not(:root),body svg:not(:root){overflow:hidden}.dnb-core-style table,body table{border-collapse:collapse}.dnb-core-style button,.dnb-core-style input,.dnb-core-style select,.dnb-core-style textarea,body button,body input,body select,body textarea{font-family:inherit;font-size:inherit;line-height:inherit}.dnb-core-style button,.dnb-core-style figure,.dnb-core-style input,.dnb-core-style select,body button,body figure,body input,body select{margin:0}.dnb-core-style button,body button{overflow:visible;text-transform:none}.dnb-core-style input,body input{overflow:visible;word-break:normal}.dnb-core-style legend,body legend{color:inherit;display:table;max-width:100%;white-space:normal}.dnb-core-style progress,body progress{display:inline-block;vertical-align:baseline}.dnb-core-style select,body select{text-transform:none}.dnb-core-style textarea,body textarea{overflow:auto;resize:vertical}.dnb-core-style [type=checkbox],.dnb-core-style [type=radio],body [type=checkbox],body [type=radio]{padding:0}.dnb-core-style input[type=search],body input[type=search]{-webkit-appearance:textfield;appearance:textfield;outline-offset:-2px}.dnb-core-style ::-webkit-inner-spin-button,.dnb-core-style ::-webkit-outer-spin-button,body ::-webkit-inner-spin-button,body ::-webkit-outer-spin-button{height:auto}.dnb-core-style ::input-placeholder,body ::input-placeholder{color:inherit;opacity:.54}.dnb-core-style ::-webkit-search-decoration,body ::-webkit-search-decoration{-webkit-appearance:none;appearance:none}.dnb-core-style ::-webkit-file-upload-button,body ::-webkit-file-upload-button{background-color:transparent;border:none;font:inherit}.dnb-core-style ::-moz-focus-inner,body ::-moz-focus-inner{border-style:none;padding:0}.dnb-core-style details,body details{display:block}.dnb-core-style summary,body summary{display:list-item}.dnb-core-style canvas,body canvas{display:inline-block}.dnb-core-style template,body template{display:none}.dnb-core-style [tabindex],.dnb-core-style a,.dnb-core-style area,.dnb-core-style button,.dnb-core-style input,.dnb-core-style label,.dnb-core-style select,.dnb-core-style summary,.dnb-core-style textarea,body [tabindex],body a,body area,body button,body input,body label,body select,body summary,body textarea{touch-action:manipulation}.dnb-core-style [hidden],body [hidden]{display:none}.dnb-core-style [aria-busy=true],body [aria-busy=true]{cursor:progress}.dnb-core-style [aria-controls]:not(input),body [aria-controls]:not(input){cursor:pointer}.dnb-core-style [aria-disabled=true],.dnb-core-style [disabled],body [aria-disabled=true],body [disabled]{cursor:not-allowed}.dnb-core-style [aria-hidden=false][hidden]:not(:focus),body [aria-hidden=false][hidden]:not(:focus){clip:rect(0,0,0,0);display:inherit;position:absolute}@media print{.dnb-core-style,body{background-color:#fff;color:#000}}.dnb-core-style .eufemia-theme,body .eufemia-theme{color:var(--theme-color-body,var(--color-black-80,#333));font-family:var(--font-family-default);font-size:var(--font-size-small);font-style:normal;font-weight:var(--font-weight-basis);line-height:var(--line-height-basis)}.dnb-no-focus,.dnb-tab-focus,.dnb-tab-focus:focus{outline:none}html[data-whatinput=keyboard] .dnb-tab-focus:focus{--border-color:var(--focus-ring-color);--border-width:var(--focus-ring-width);border-color:transparent;box-shadow:0 0 0 var(--border-width) var(--border-color)}.dnb-mouse-focus,.dnb-mouse-focus:focus{outline:none}html[data-whatinput=mouse] .dnb-mouse-focus:focus{box-shadow:0 0 0 var(--border-width) var(--border-color)}.dnb-focus-ring,html[data-whatinput=mouse] .dnb-mouse-focus:focus{--border-color:var(--focus-ring-color);--border-width:var(--focus-ring-width);border-color:transparent}.dnb-focus-ring{box-shadow:0 0 0 var(--border-width) var(--border-color)!important}.dnb-scrollbar-appearance{-webkit-overflow-scrolling:touch;-ms-overflow-style:auto;scrollbar-color:var(--scrollbar-thumb-color,#888) transparent}@supports not (scrollbar-color:auto){.dnb-scrollbar-appearance::-webkit-scrollbar{background-color:var(--scrollbar-track-color,#eee);border-radius:var(--scrollbar-thumb-width,.5rem)}.dnb-scrollbar-appearance::-webkit-scrollbar:vertical{width:var(--scrollbar-track-width,.5rem)}.dnb-scrollbar-appearance::-webkit-scrollbar:horizontal{height:var(--scrollbar-track-width,.5rem)}.dnb-scrollbar-appearance::-webkit-scrollbar-thumb{background-color:var(--scrollbar-thumb-color,#888);border-radius:var(--scrollbar-thumb-width,.5rem)}.dnb-scrollbar-appearance::-webkit-scrollbar-thumb:hover{background-color:var(--scrollbar-thumb-hover-color,#666)}}.dnb-skip-link{opacity:.3;position:absolute;top:-100vh;transition:opacity .3s ease-out;z-index:0}.dnb-skip-link--active,.dnb-skip-link:focus{background-color:transparent;border:none;border-radius:0;box-shadow:none;color:var(--skip-link-color);font-size:var(--font-size-basis);left:40%;margin:0;outline:none;padding:.5rem 1rem;position:fixed;text-align:center;-webkit-text-decoration:none;text-decoration:none;top:5%;user-select:none;-webkit-user-select:none;white-space:nowrap;z-index:9999}.dnb-skip-link--active:after,.dnb-skip-link:focus:after{background-color:hsla(0,0%,100%,.85);box-shadow:150vw 150vh 0 0 hsla(0,0%,100%,.85);content:"";height:150vh;left:-200vw;position:absolute;top:-200vh;width:150vw;z-index:-2}.dnb-skip-link--active:before,.dnb-skip-link:focus:before{background-color:var(--skip-link-background);border-radius:1.5rem;content:"";height:100%;left:0;outline:none;position:absolute;top:0;width:100%;z-index:-1}html[data-whatinput=mouse] .dnb-skip-link--active:before,html[data-whatinput=mouse] .dnb-skip-link:focus:before{--border-color:var(--focus-ring-color);--border-width:var(--focus-ring-width);border-color:transparent;box-shadow:0 0 0 var(--border-width) var(--border-color)}.dnb-skip-link--active:hover:before,.dnb-skip-link:focus:hover:before{background-color:var(--skip-link-background--hover)}.dnb-skip-link--active:active:before,.dnb-skip-link:focus:active:before{background-color:var(--skip-link-background--active)}.dnb-skip-link--active:focus:not(:active):before,.dnb-skip-link:focus:focus:not(:active):before{outline:none}html[data-whatinput=keyboard] .dnb-skip-link--active:focus:not(:active):before,html[data-whatinput=keyboard] .dnb-skip-link:focus:focus:not(:active):before{--border-color:var(--focus-ring-color);--border-width:var(--focus-ring-width);border-color:transparent;box-shadow:0 0 0 var(--border-width) var(--border-color)}.dnb-skip-link--active:focus,.dnb-skip-link:focus:focus{opacity:1}.dnb-skip-link--active:hover,.dnb-skip-link:focus:hover{background-color:transparent;box-shadow:none;color:var(--skip-link-color--hover)}.dnb-skip-link--active:focus:not(:hover):not(:active),.dnb-skip-link:focus:focus:not(:hover):not(:active){background-color:transparent;box-shadow:none;color:var(--skip-link-color)}.dnb-skip-link--active:active,.dnb-skip-link:focus:active{background-color:transparent;color:var(--skip-link-color--active)}html[data-whatintent=touch] .dnb-skip-link{display:none}.dnb-alignment-helper,.dnb-alignment-helper:before{speak:none;display:inline-block;font-size:var(--font-size-small);height:0;width:0}.dnb-alignment-helper:before{content:""}.dnb-drop-shadow{box-shadow:var(--shadow-default)}.dnb-sr-only{-webkit-touch-callout:none!important;border:0!important;clip-path:inset(50%)!important;margin:0!important;max-height:1px!important;max-width:1px!important;overflow:hidden!important;padding:0!important;pointer-events:none!important;position:absolute!important;-webkit-user-select:none!important;user-select:none!important;white-space:nowrap!important}.dnb-suffix{font-size:var(--font-size-basis);line-height:var(--line-height-basis);padding-left:.5rem;word-break:normal}
|
|
@@ -211,7 +211,8 @@ export const format = function (value) {
|
|
|
211
211
|
cleanedValue = String(display).replace(new RegExp(`${thousandsSeparator}(?=\\d{3})`, 'g'), '');
|
|
212
212
|
}
|
|
213
213
|
if (value === 'invalid') {
|
|
214
|
-
|
|
214
|
+
var _locales$locale;
|
|
215
|
+
aria = ((_locales$locale = locales[locale]) === null || _locales$locale === void 0 ? void 0 : _locales$locale.NumberFormat.not_available) || 'N/A';
|
|
215
216
|
}
|
|
216
217
|
return {
|
|
217
218
|
value,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NumberUtils.js","names":["React","Context","LOCALE","CURRENCY","CURRENCY_DISPLAY","warn","isTrue","slugify","escapeRegexChars","getOffsetTop","getOffsetLeft","getSelectedElement","copyToClipboard","IS_MAC","IS_WIN","locales","NUMBER_CHARS","format","value","locale","clean","compact","phone","org","ban","nin","percent","currency","currency_display","currency_position","omit_currency_sign","clean_copy_value","decimals","omit_rounding","rounding","options","returnAria","arguments","length","undefined","display","aria","type","window","navigator","language","e","cleanNumber","opts","JSON","parse","parseFloat","formatDecimals","maximumFractionDigits","number","_number","_aria","formatPhone","formatBAN","formatNIN","formatORG","countDecimals","style","formatNumber","handleCompactBeforeDisplay","cleanedNumber","currencyDisplay","getFallbackCurrencyDisplay","minimumFractionDigits","String","indexOf","formatter","item","test","currencySuffix","currencyPositionFormatter","_ref","alignCurrencySymbol","trim","prepareMinus","handleCompactBeforeAria","_objectSpread","enhanceSR","cleanedValue","thousandsSeparator","getThousandsSeparator","replace","RegExp","NumberFormat","not_available","includes","decimalPlaces","factor","Math","pow","trunc","roundHalfEven","_String$split$","decimalSeparator","floor","valueOf","split","existingFormatter","callback","position","count","countCurrency","first","second","reg","output","abs","getGroupFormatter","formatToParts","map","reduce","acc","_ref2","Number","toLocaleString","stringify","replaceNaNWithDash","code","substring","codeAndNumber","match","filter","s","join","num","prefix","suffix","startsWith","endsWith","decimal","thousands","thousandReg","decimalReg","decimalBackup","runIOSSelectionFix","selection","getSelection","range","document","createRange","removeAllRanges","addRange","copyWithEffect","label","positionElement","success","fx","showSelectionNotice","run","_ref3","timeout","id","getElementById","elem","content","root","querySelector","createElement","setAttribute","arrow","appendChild","SelectionFx","remove","removeChild","hide","classList","add","pE","top","left","innerHTML","HTMLElement","width","offsetWidth","offsetHeight","setTimeout","useCopyWithNotice","translation","clipboard_copy","useContext","copy","getDecimalSeparator","_formatToParts$find","separator","find","_ref4","_formatToParts$map$fi","_ref5","getCurrencySymbol","_formatToParts$find2","_ref6","separatorSymbol","_ref7","Intl","inst","canHandleCompact","parseInt","notation","compactDisplay","maximumSignificantDigits","isNaN","ref","_ref8","_ref9","multiplier","adjustedNum","floored","diff","ceil"],"sources":["../../../../src/components/number-format/NumberUtils.js"],"sourcesContent":["import React from 'react'\nimport Context from '../../shared/Context'\n\n/**\n * Web NumberFormat Helpers\n *\n */\n\nimport { LOCALE, CURRENCY, CURRENCY_DISPLAY } from '../../shared/defaults'\nimport {\n warn,\n isTrue,\n slugify,\n escapeRegexChars,\n} from '../../shared/component-helper'\nimport {\n getOffsetTop,\n getOffsetLeft,\n getSelectedElement,\n copyToClipboard,\n IS_MAC,\n IS_WIN,\n} from '../../shared/helpers'\nimport locales from '../../shared/locales'\n\nconst NUMBER_CHARS = '\\\\-0-9,.'\n\n/**\n * Format a number to a streamlined format based on the given locale\n *\n * @param {string|number} value any number\n * @type {object} string or object { when: { min: 'small' } } that describes the media query\n * @property {string} locale - media queries\n * @property {boolean} clean - if true, clean the number for unwanted decimal separators\n * @property {string|boolean} compact - shortens any number or currency including an abbreviation. You can combine `compact` with `currency`. It gives you zero decimal by default `decimals={0}`. Use either a boolean, or a string with \"short\" or \"long\"\n * @property {boolean} phone - if true, it formats to a phone number\n * @property {boolean} org - if true, it formats to a Organization Number\n * @property {boolean} ban - if true, it formats to a Bank Account Number\n * @property {boolean} nin - if true, it formats to a National Identification Number\n * @property {boolean} percent - if true, it formats with a percent\n * @property {string|boolean} currency - currency code (ISO 4217) or `true` to use the default, `NOK`\n * @property {string} currency_display - use false or empty string to hide the sign or \"code\", \"name\", \"symbol\" or \"narrowSymbol\" – supports the API from number.toLocaleString\n * @property {string} currency_position - can be \"before\" or \"after\"\n * @property {string} omit_currency_sign - hides currency sign if true is given\n * @property {number} decimals - defines how many decimals should be added\n * @property {boolean} omit_rounding - @deprecated Use `rounding: \"omit\"` instead.\n * @property {string} rounding - if `omit`, the decimal will NOT be rounded. If `half-even`, the value will be rounded to the nearest even number. If set to `half-up`, the fractional part is 0.5 or greater, the number is rounded up. If the fractional part is less than 0.5, the number is rounded down. Defaults to `half-up`.\n * @property {object} options - accepts all number.toLocaleString API options\n * @property {boolean} returnAria - if true, this function returns an object that includes an aria property with a special aria formatting\n * @returns a formatted number as a string or as an object if \"returnAria\" is true\n */\nexport const format = (\n value,\n {\n locale = null, // can be \"auto\"\n clean = false,\n compact = null,\n phone = null,\n org = null,\n ban = null,\n nin = null,\n percent = null,\n currency = null,\n currency_display = null,\n currency_position = null,\n omit_currency_sign = null,\n clean_copy_value = null,\n decimals = null,\n omit_rounding = null, // @deprecated – can be removed in v11\n rounding = null,\n options = null,\n returnAria = false,\n } = {}\n) => {\n let display = value\n let aria = null\n let type = 'number'\n\n // because we are using context comparison\n if (!locale) {\n locale = LOCALE\n } else if (locale === 'auto') {\n try {\n locale = window.navigator.language\n } catch (e) {\n warn(e)\n }\n }\n\n if (isTrue(clean)) {\n value = cleanNumber(value)\n }\n\n const opts =\n (typeof options === 'string' && options[0] === '{'\n ? JSON.parse(options)\n : options) || {}\n\n if (parseFloat(decimals) >= 0) {\n value = formatDecimals(\n value,\n decimals,\n rounding ?? omit_rounding,\n opts\n )\n } else if (\n typeof opts.maximumFractionDigits === 'undefined' &&\n !isTrue(percent) &&\n !isTrue(currency)\n ) {\n // if no decimals are set, opts.maximumFractionDigits is set\n // why do we this? because the \".toLocaleString\" will else use 3 as the default\n opts.maximumFractionDigits = 20\n }\n\n if (isTrue(phone)) {\n type = 'phone'\n const { number: _number, aria: _aria } = formatPhone(value, locale)\n\n if (clean === null) {\n value = cleanNumber(value) // clean, because of +47 and ++47\n }\n display = _number\n aria = _aria\n } else if (isTrue(ban)) {\n type = 'ban' // Bank Account Number\n const { number: _number, aria: _aria } = formatBAN(value, locale)\n\n display = _number\n aria = _aria\n } else if (isTrue(nin)) {\n type = 'nin' // National Identification Number\n const { number: _number, aria: _aria } = formatNIN(value, locale)\n\n display = _number\n aria = _aria\n } else if (isTrue(org)) {\n type = 'org' // organization number\n\n const { number: _number, aria: _aria } = formatORG(value, locale)\n\n display = _number\n aria = _aria\n } else if (isTrue(percent)) {\n if (decimals === null) {\n if (typeof opts.maximumFractionDigits === 'undefined') {\n decimals = countDecimals(value)\n }\n value = formatDecimals(\n value,\n decimals,\n rounding ?? omit_rounding,\n opts\n )\n }\n\n if (!opts.style) {\n opts.style = 'percent'\n }\n\n display = formatNumber(value / 100, locale, opts)\n } else if (isTrue(currency) || typeof currency === 'string') {\n type = 'currency'\n\n opts.currency =\n opts.currency || (isTrue(currency) ? CURRENCY : currency)\n\n handleCompactBeforeDisplay({ value, locale, compact, decimals, opts })\n\n if (decimals === null) {\n decimals = 2\n value = formatDecimals(\n value,\n decimals,\n rounding ?? omit_rounding,\n opts\n )\n }\n\n // cleanup, but only if it not got cleaned up already\n let cleanedNumber =\n decimals >= 0 ? value : clean ? cleanNumber(value) : value\n\n if (currency_display === false || currency_display === '') {\n omit_currency_sign = true\n }\n\n opts.style = 'currency'\n opts.currencyDisplay = getFallbackCurrencyDisplay(\n locale,\n opts.currencyDisplay || currency_display\n )\n\n // if currency has no decimal, then go ahead and remove it\n if (\n typeof opts.minimumFractionDigits === 'undefined' &&\n String(value).indexOf('.') === -1 &&\n cleanedNumber % 1 === 0\n ) {\n opts.minimumFractionDigits = 0 // to enforce Norwegian style\n }\n\n let formatter = undefined\n\n if (isTrue(omit_currency_sign)) {\n formatter = (item) => {\n switch (item.type) {\n case 'literal':\n item.value = item.value === ' ' ? '' : item.value\n return item\n\n case 'currency':\n item.value = ''\n return item\n\n default:\n return item\n }\n }\n }\n\n /**\n * Make exception – if locale is Norwegian, and position is not defined, then use position \"after\"\n */\n if (!currency_position && locale && /(no|nb|nn)$/i.test(locale)) {\n currency_position = 'after'\n }\n\n let currencySuffix = null\n if (currency_position) {\n formatter = currencyPositionFormatter(\n formatter,\n ({ value }) => {\n return (currencySuffix = alignCurrencySymbol(\n value.trim(),\n currency_display\n ))\n },\n currency_position\n )\n }\n\n display = formatNumber(cleanedNumber, locale, opts, formatter)\n display = prepareMinus(display, locale)\n\n if (currency_position && currencySuffix) {\n if (currency_position === 'after') {\n display = `${display.trim()} ${currencySuffix}`\n } else if (currency_position === 'before') {\n display = `${currencySuffix} ${display.trim()}`\n }\n }\n\n handleCompactBeforeAria({ value, compact, opts })\n\n // aria options\n aria = formatNumber(cleanedNumber, locale, {\n minimumFractionDigits: 0,\n maximumFractionDigits: 2,\n ...opts,\n currencyDisplay: 'name',\n })\n aria = enhanceSR(cleanedNumber, aria, locale) // also calls prepareMinus\n } else {\n handleCompactBeforeDisplay({ value, locale, compact, decimals, opts })\n\n display = formatNumber(value, locale, opts)\n display = prepareMinus(display, locale)\n\n handleCompactBeforeAria({ value, compact, opts })\n\n // fix for NVDA to make sure we read the number, we add a minimum fraction digit (decimal)\n // NVDA fix\n aria = formatNumber(value, locale, opts)\n aria = enhanceSR(value, aria, locale) // also calls prepareMinus\n }\n\n if (aria === null) {\n aria = display\n }\n\n if (returnAria) {\n let cleanedValue\n\n if (clean_copy_value) {\n cleanedValue = formatNumber(\n opts.style === 'percent' ? value / 100 : value,\n locale,\n opts,\n (item) => {\n switch (item.type) {\n case 'group':\n case 'literal':\n case 'currency':\n case 'percentSign':\n item.value = ''\n return item\n default:\n return item\n }\n }\n )\n } else {\n const thousandsSeparator = getThousandsSeparator(locale)\n cleanedValue = String(display).replace(\n new RegExp(`${thousandsSeparator}(?=\\\\d{3})`, 'g'),\n ''\n )\n }\n\n if (value === 'invalid') {\n aria = locales[locale].NumberFormat.not_available || 'N/A'\n }\n\n // return \"locale\" as well value,l, since we have to \"auto\" option\n return { value, cleanedValue, number: display, aria, locale, type }\n }\n\n return display\n}\n\n/**\n * Fill format decimals\n *\n * @param {number|string} value\n * @param {number} decimals how many decimals\n * @param {boolean} defines what rounding method to use for decimals\n * @param {boolean} clean whether the value should be cleaned or not\n * @param {object} opts immutable object\n * @returns a decimal prepared number\n */\nexport const formatDecimals = (value, decimals, rounding, opts = {}) => {\n decimals = parseFloat(decimals)\n\n // Mutate the given options\n if (decimals >= 0) {\n opts.minimumFractionDigits = decimals\n opts.maximumFractionDigits = decimals\n }\n\n if (String(value).includes('.')) {\n const decimalPlaces = decimals || opts.maximumFractionDigits\n if (rounding === 'omit' || rounding === true) {\n const factor = Math.pow(10, decimalPlaces)\n value = Math.trunc(value * factor) / factor\n } else {\n switch (rounding) {\n case 'half-even': {\n value = roundHalfEven(value, decimalPlaces)\n\n break\n }\n }\n }\n }\n\n return value\n}\n\n/**\n * Find the amount of decimals\n *\n * @param {number|string} value any number\n * @param {string} decimalSeparator a dot or comma\n * @returns amount of decimals\n */\nexport const countDecimals = (value, decimalSeparator = '.') => {\n if (\n typeof value === 'number' &&\n Math.floor(value.valueOf()) === value.valueOf()\n ) {\n return 0\n }\n return String(value).split(decimalSeparator)[1]?.length || 0\n}\n\n/**\n * Changes the currency sign position\n *\n * For Norway, the position defaults to \"after\"\n *\n * @param {function} existingFormatter an existing number formatter or undefined\n * @param {function} callback function that will emitted with the currency\n * @param {string} position blank, before or after\n * @returns {function} number formatter\n */\nconst currencyPositionFormatter = (\n existingFormatter,\n callback,\n position = null\n) => {\n let count = 0\n let countCurrency = -1\n\n return (item) => {\n // Ensure we do not overwrite a given formatter, but run it as well\n if (typeof existingFormatter === 'function') {\n item = existingFormatter(item)\n }\n\n count++\n\n switch (item.type) {\n case 'currency': {\n if (position === 'after' || (position === 'before' && count > 2)) {\n countCurrency = count\n callback(item)\n item.value = ''\n }\n return item\n }\n\n case 'literal': {\n // Remove the literal after currency\n if (count === countCurrency + 1) {\n item.value = ''\n }\n return item\n }\n\n default:\n return item\n }\n }\n}\n\n/**\n * When e.g. a currency number is given with a minus,\n * this function transforms the minus to be moved before the number\n * instead of the symbol.\n *\n * It only cleans if locale is Norwegian\n *\n * form -NOK 1 234 to NOK -1 234\n *\n * @param {string} display currency number that includes either a minus or not\n * @param {string} locale locale as a string\n * @returns {string} number\n */\nconst prepareMinus = (display, locale) => {\n /**\n * Make exception – if locale is NOT Norwegian,\n * we skip the cleanup\n */\n if (!(locale && /(no|nb|nn)$/i.test(locale))) {\n return display\n }\n\n // check for first and second char\n const first = display[0]\n const second = display[1]\n\n // Seems to be the invalid replacement\n if (first === '-' && second === '-') {\n return display\n }\n\n // change the position of minus if it's first\n // check for two minus - −\n // check also for hyphen ‐\n // check also for dashes ‒ – — ―\n const reg = '^(-|−|‐|‒|–|—|―)'\n\n if (new RegExp(reg).test(first)) {\n // if second is number\n if (parseFloat(second) > 0) {\n // then do not swap\n display = display.replace(new RegExp(reg + '(.*)'), '-$2')\n } else {\n // then first has to be currency\n display = display.replace(new RegExp(reg + '([^0-9]+)(.*)'), '$2-$3')\n }\n }\n\n return display\n}\n\n/**\n * Aligns the currency symbol in the output based on the currency display option.\n * \"norske kroner\" (\"Norwegian kroner\") will be changed to \"kroner\" if the currency display option is set to \"name\".\n *\n * @param {string} output - The output string containing the currency symbol.\n * @param {string} currencyDisplay - The currency display option ('name' or 'symbol').\n * @returns {string} The aligned output string.\n */\nfunction alignCurrencySymbol(output, currencyDisplay) {\n if (typeof output === 'string' && currencyDisplay === 'name') {\n output = output.replace(/(nor[^\\s]+?)\\s(\\w+)/i, '$2')\n }\n return output\n}\n\n/**\n * Enhance VoiceOver support on mobile devices\n * Numbers under 99.999 are read out correctly, but only if we remove the spaces\n * Potential we could also check for locale: && /no|nb|nn/.test(locale)\n * but leave it for now without this extra check\n *\n * @param {string|number} value any number\n * @param {string} aria aria formatted number\n * @param {string} locale locale as a string\n * @returns aria number\n */\nconst enhanceSR = (value, aria, locale) => {\n if (IS_MAC && Math.abs(parseFloat(value)) <= 99999) {\n aria = String(aria).replace(/\\s([0-9])/g, '$1')\n }\n\n aria = prepareMinus(aria, locale)\n\n return aria\n}\n\n/**\n * The main number formatter function\n * This function is used to call the browsers/Node.js \"Intl.NumberFormat\" or \"Number.toLocaleString\" APIs\n *\n * @param {string|number} number any number\n * @param {string} locale locale as a string\n * @param {string} options formatting options based on the toLocaleString API\n * @param {string} formatter optional, a custom formatter can be given\n * @returns formatted number\n */\nexport const formatNumber = (\n number,\n locale,\n options = {},\n formatter = null\n) => {\n try {\n if (options.currencyDisplay) {\n options.currencyDisplay = getFallbackCurrencyDisplay(\n locale,\n options.currencyDisplay\n )\n }\n\n // remove unsupported decimals\n delete options.decimals\n\n if (locale && /(en|gb)$/i.test(locale)) {\n formatter = getGroupFormatter(locale, null, formatter)\n }\n\n if (formatter) {\n number = formatToParts({ number, locale, options })\n .map(formatter)\n .reduce((acc, { value }) => acc + value, '')\n } else if (\n typeof Number !== 'undefined' &&\n typeof Number.toLocaleString === 'function'\n ) {\n number = parseFloat(number).toLocaleString(locale, options)\n }\n if (number === '−0') {\n number = '0'\n }\n } catch (e) {\n warn(\n `Number could not be formatted: ${JSON.stringify([\n number,\n locale,\n options,\n ])}`,\n e\n )\n }\n\n return replaceNaNWithDash(\n alignCurrencySymbol(number, options.currencyDisplay)\n )\n}\n\nfunction replaceNaNWithDash(number) {\n return String(number).replace(/NaN/, '–')\n}\n\n/**\n * Use this function to format phone numbers\n *\n * @param {string|number} number a phone number\n * @param {string} locale locale as a string\n * @returns a formatted phone number\n */\nexport const formatPhone = (number, locale = null) => {\n let display = number\n let aria = null\n\n switch (locale) {\n default: {\n let code = ''\n number = String(number)\n // Edge case for when a Norwegian number is given without a space after the country code\n .replace(/^(00|\\+|)47([^\\s])/, '+47 $2')\n .replace(/^00/, '+')\n\n if (number.substring(0, 1) === '+') {\n const codeAndNumber = number.match(\n // Split the number into the country code and the rest of the number\n /^\\+([\\d-]{1,8})\\s{0,2}([\\d\\s-]{1,20})$/\n )\n if (codeAndNumber) {\n code = `+${codeAndNumber[1]} `\n number = codeAndNumber[2]\n }\n }\n\n number = number.replace(/[^+\\d]/g, '')\n const length = number.length\n\n // Get 800 22 222\n if (length === 8 && number.substring(0, 1) === '8') {\n display =\n code +\n number\n .split(/([\\d]{3})([\\d]{2})/)\n .filter((s) => s)\n .join(' ')\n } else {\n // Get 02000\n if (length < 6) {\n display = code + number\n } else {\n if (code.includes('-')) {\n // Convert +12-3456 to +12 (3456)\n code = code.replace(/(\\+[\\d]{1,2})-([\\d]{1,6})/, '$1 ($2)')\n }\n\n // Get 6 or 8 formatting\n display =\n code +\n number\n .split(\n length === 6\n ? /^(\\+[\\d]{2})|([\\d]{3})/\n : /^(\\+[\\d]{2})|([\\d]{2})/\n )\n .filter((s) => s)\n .join(' ')\n }\n }\n\n aria =\n code +\n number\n .split(/([\\d]{2})/)\n .filter((s) => s)\n .join(' ')\n }\n }\n\n if (aria === null) {\n aria = display\n }\n\n return { number: display, aria }\n}\n\n/**\n * Use this function to format Bank Account Numbers\n *\n * @param {string|number} number a Bank Account Number\n * @param {string} locale locale as a string\n * @returns a formatted Bank Account Number\n */\nexport const formatBAN = (number, locale = null) => {\n // cleanup\n number = String(number).replace(/[^0-9]/g, '')\n\n let display = number\n let aria = null\n\n switch (locale) {\n default: {\n // Get 2000 12 34567\n display = number\n .split(/([0-9]{4})([0-9]{2})([0-9]{1,})/)\n .filter((s) => s)\n .join(' ')\n\n aria = number\n .split(/([0-9]{2})/)\n .filter((s) => s)\n .join(' ')\n }\n }\n\n if (aria === null) {\n aria = display\n }\n\n return { number: display, aria }\n}\n\n/**\n * Use this function to format Organization Numbers\n *\n * @param {string|number} number a Organization Number\n * @param {string} locale locale as a string\n * @returns a formatted Organization Number\n */\nexport const formatORG = (number, locale = null) => {\n // cleanup\n number = String(number).replace(/[^0-9]/g, '')\n\n let display = number\n let aria = null\n\n switch (locale) {\n default: {\n // Get 123 456 789\n display = number\n .split(/([0-9]{3})/)\n .filter((s) => s)\n .join(' ')\n\n aria = number\n .split(/([0-9]{1})/)\n .filter((s) => s)\n .join(' ')\n }\n }\n\n if (aria === null) {\n aria = display\n }\n\n return { number: display, aria }\n}\n\n/**\n * Use this function to format National Identification Numbers\n *\n * @param {string|number} number a National Identification Number\n * @param {string} locale locale as a string\n * @returns a formatted National Identification Number\n */\nexport const formatNIN = (number, locale = null) => {\n // cleanup\n number = String(number).replace(/[^0-9]/g, '')\n\n let display = number\n let aria = null\n\n switch (locale) {\n default: {\n // Get 180892 12345\n display = number\n .split(/([0-9]{6})/)\n .filter((s) => s)\n .join(' ')\n\n // correct nin for screen readers\n aria = display\n .split(\n /([0-9]{2})([0-9]{2})([0-9]{2}) ([0-9]{1})([0-9]{1})([0-9]{1})([0-9]{1})([0-9]{1})/\n )\n .filter((s) => s)\n .join(IS_WIN ? '. ' : ' ') // NVDA fix with a dot to not read date on FF\n }\n }\n\n if (aria === null) {\n aria = display\n }\n\n return { number: display, aria }\n}\n\n/**\n * This function cleans numbers for separators\n * https://en.wikipedia.org/wiki/Decimal_separator\n *\n * @param {string|number} num any number\n * @returns a number that contains valid number separators\n */\nexport function cleanNumber(\n num,\n {\n decimalSeparator = null,\n thousandsSeparator = null,\n prefix = null,\n suffix = null,\n } = {}\n) {\n if (typeof num === 'number') {\n return num\n }\n\n num = String(num).trim()\n\n if (typeof prefix === 'string' && num.startsWith(prefix)) {\n num = num.substring(prefix.length, num.length)\n }\n if (typeof suffix === 'string' && num.endsWith(suffix)) {\n num = num.substring(0, num.length - suffix.length)\n }\n\n // 1. Remove invalid chars on the beginning (not a number)\n if (/^[^0-9-]/.test(num)) {\n num = num.replace(/^(^[^0-9-]+)/, '')\n }\n\n let decimal = decimalSeparator\n let thousands = thousandsSeparator\n\n // -12 345,678\n if (/(\\s)([0-9]{3})/.test(num)) {\n thousands = thousands || '\\\\s'\n decimal = decimal || ','\n }\n\n // -12.345,678\n else if (\n /(\\.)([0-9]{3})/.test(num) &&\n !/([,'][0-9]{3})(\\.)([0-9]{3})/.test(num) // just an additional check, for support with more\n ) {\n thousands = thousands || '\\\\.'\n decimal = decimal || \",|·|'\" // also support Spain and CH\n }\n\n // -1,234,567.891\n else if (/(,)([0-9]{3})/.test(num)) {\n thousands = thousands || ','\n decimal = decimal || '\\\\.|·' // also support Spain\n }\n\n // -1'234'567.891, only used in CH\n else if (/(')([0-9]{3})/.test(num)) {\n thousands = thousands || \"'\"\n decimal = decimal || '\\\\.|,'\n } else {\n thousands = ','\n decimal = '\\\\.'\n }\n\n // 3. Remove invalid thousand separators\n const thousandReg = thousandsSeparator\n ? new RegExp(\n `([0-9]|)(${escapeRegexChars(thousandsSeparator)})([0-9]{3})`,\n 'g'\n )\n : new RegExp(`([0-9]|)(${thousands})([0-9]{3})`, 'g')\n if (thousandReg.test(num)) {\n num = num.replace(thousandReg, '$1$3')\n }\n\n // 2. Rename invalid decimal separator\n // Make sure that there are only two digits after the comma, then we clean that up.\n // else we don't, because it can be a US number\n // therefore, check first, is there a chance of being a decimal?\n // const decimalReg = new RegExp(`(${decimal})([0-9]{1,2})`, 'g')\n const decimalReg = decimalSeparator\n ? new RegExp(`(${escapeRegexChars(decimalSeparator)})([0-9]{0,})`, 'g')\n : new RegExp(`(${decimal})([0-9]{1,2})`, 'g')\n if (decimalReg.test(num)) {\n num = num.replace(decimalReg, '.$2')\n }\n\n // Edge case, if we have more than 2 decimals, replace these decimals\n if (!decimalSeparator) {\n const decimalBackup = new RegExp(`(${decimal})([0-9]{3,})`, 'g')\n if (decimalBackup.test(num)) {\n num = num.replace(decimalBackup, '.$2')\n }\n }\n\n // Remove all invalid chars\n return num.replace(new RegExp(`([^${NUMBER_CHARS}])`, 'g'), '')\n}\n\n/**\n * So iOS v13 can select something on the first try, we run this add range trick.\n * NB: This hack may be removed in future iOS versions.\n */\nexport function runIOSSelectionFix() {\n try {\n const selection = window.getSelection()\n const range = document.createRange()\n selection.removeAllRanges()\n selection.addRange(range)\n } catch (e) {\n //\n }\n}\n\n/**\n * A function that tries to copy to the clipboard\n * at the same time it shows the copy result in a tooltip\n *\n * NB: This function is not documented.\n * It should not be used!\n *\n * @param {string} value any number\n * @param {*} label\n * @param {*} positionElement\n * @returns\n */\nexport async function copyWithEffect(\n value,\n label,\n positionElement = null\n) {\n let success = null\n\n if (value) {\n try {\n const fx = showSelectionNotice({ value, label })\n success = await copyToClipboard(value)\n if (success === true) {\n fx.run(positionElement)\n }\n } catch (e) {\n warn(e)\n success = e\n }\n }\n\n return success\n}\n\n/**\n * This function add a tooltip looking\n *\n * @type {object} object with property\n * @property {string} value any value\n * @property {string} label any additional label that gets added as a suffix\n * @property {number} timeout how long the tooltip should be visible (3 sec)\n * @returns {object} { run, hide, remove } call the \"run\" function when the effect should be shown\n */\nexport function showSelectionNotice({ value, label, timeout = 3e3 }) {\n const id = 'id-' + slugify(value)\n if (typeof document !== 'undefined' && document.getElementById(id)) {\n return { run: () => {} }\n }\n\n let elem, content, root\n\n try {\n root = document.querySelector('.dnb-tooltip__portal, body')\n\n // create that portal element\n elem = document.createElement('span')\n elem.setAttribute('id', id)\n elem.setAttribute('class', 'dnb-tooltip')\n elem.setAttribute('role', 'tooltip')\n\n const arrow = document.createElement('span')\n arrow.setAttribute(\n 'class',\n 'dnb-tooltip__arrow dnb-tooltip__arrow__position--top'\n )\n content = document.createElement('span')\n content.setAttribute('class', 'dnb-tooltip__content')\n content.setAttribute('aria-live', 'assertive')\n elem.appendChild(arrow)\n elem.appendChild(content)\n } catch (e) {\n warn(e)\n }\n\n return new (class SelectionFx {\n remove() {\n try {\n root.removeChild(elem)\n elem = null\n content = null\n } catch (e) {\n //\n }\n }\n hide() {\n try {\n elem.classList.add('dnb-tooltip--hide')\n } catch (e) {\n //\n }\n }\n run(pE = getSelectedElement()) {\n try {\n root.appendChild(elem)\n\n const top = getOffsetTop(pE)\n const left = getOffsetLeft(pE)\n\n content.innerHTML =\n String(label) +\n (pE instanceof HTMLElement\n ? `<span class=\"dnb-sr-only\">: ${\n (\n (pE &&\n pE.querySelector('.dnb-number-format__selection')) ||\n pE\n ).innerHTML\n }</span>`\n : '')\n\n const width =\n (\n (pE && pE.querySelector('.dnb-number-format__visible')) ||\n pE ||\n {}\n ).offsetWidth || 0\n\n elem.style.top = `${top - elem.offsetHeight}px`\n elem.style.left = `${left + width / 2 - elem.offsetWidth / 2}px`\n elem.classList.add('dnb-tooltip--active')\n\n setTimeout(this.hide, timeout)\n setTimeout(this.remove, timeout + 600)\n } catch (e) {\n warn(e)\n }\n }\n })()\n}\n\n/**\n * React Hook\n * It returns \"copyWithEffect\" but with a translated string\n *\n * @returns copyWithEffect function inside object { copy }\n */\nexport function useCopyWithNotice() {\n const {\n translation: {\n NumberFormat: { clipboard_copy },\n },\n } = React.useContext(Context)\n\n const copy = (value, positionElement) => {\n copyWithEffect(value, clipboard_copy, positionElement)\n }\n\n return { copy }\n}\n\n/**\n * Will return currency display value based on navigator/browser and locale\n *\n * @property {string} currencyDisplay (optional) code, name, symbol or narrowSymbol\n * @property {string} locale (optional) the locale to use, defaults to nb-NO\n * @returns {string} a separator symbol\n */\nexport function getFallbackCurrencyDisplay(\n locale = null,\n currencyDisplay = null\n) {\n // If currencyDisplay is not defined and locale is \"no\", use narrowSymbol\n if (!currencyDisplay && (!locale || /(no|nb|nn)$/i.test(locale))) {\n currencyDisplay = 'narrowSymbol'\n }\n\n return currencyDisplay || CURRENCY_DISPLAY // code, name, symbol\n}\n\n/**\n * This function returns a decimal separator symbol based on the given locale\n *\n * @property {string} locale (optional) the locale to use, defaults to nb-NO\n * @returns {string} a separator symbol\n */\nexport function getDecimalSeparator(locale = null) {\n const separator =\n formatToParts({\n number: 1.1,\n locale,\n }).find(({ type }) => type === 'decimal')?.value || ',' // defaults to nb-NO\n\n return separator\n}\n\n/**\n * This function returns a thousands separator symbol based on the given locale\n *\n * @property {string} locale (optional) the locale to use, defaults to nb-NO\n * @returns {string} a separator symbol\n */\nexport function getThousandsSeparator(locale = null) {\n const formatter = getGroupFormatter(locale)\n\n return (\n formatToParts({\n number: 1000,\n locale,\n })\n .map(formatter)\n .find(({ type }) => type === 'group')?.value || ' '\n ) // defaults to nb-NO\n}\n\n/**\n * This function returns a currency symbol based on the given locale\n *\n * @property {string} locale (optional) the locale to use, defaults to nb-NO\n * @property {string} currency (optional) a given currency\n * @property {string} display (optional) what currency display\n * @property {number} number (optional) only to define if it should be formatted in singular or plural\n * @returns {string} a currency symbol\n */\nexport function getCurrencySymbol(\n locale = null,\n currency = null,\n display = null,\n number = 2\n) {\n if (!currency) {\n currency = CURRENCY\n }\n\n const currencyDisplay = getFallbackCurrencyDisplay(locale, display)\n\n return alignCurrencySymbol(\n formatToParts({\n number,\n locale,\n options: {\n style: 'currency',\n currency,\n currencyDisplay,\n },\n }).find(({ type }) => type === 'currency')?.value || currency,\n currencyDisplay\n )\n}\n\nfunction getGroupFormatter(\n locale = null,\n separatorSymbol = null,\n existingFormatter = null\n) {\n /**\n * We change the thousand separator to be a non-breaking space\n *\n * Effected locales:\n * - en-GB\n * - en\n */\n if (locale && /(en|gb)$/i.test(locale)) {\n separatorSymbol = ' ' // non-breaking space\n }\n\n return (item) => {\n // Ensure we do not overwrite a given formatter, but run it as well\n if (typeof existingFormatter === 'function') {\n item = existingFormatter(item)\n }\n\n if (item.type === 'group') {\n item.value = separatorSymbol || item.value\n }\n\n return item\n }\n}\n\n/**\n * For internal usage\n *\n * @type {object}\n * @property {string} number - a number\n * @property {string} locale - locale as a string. Defaults to the global LOCALE constant\n * @property {object} options - NumberFormat options\n * @returns {array} that contains all the parts of the given number [{ value: x, type: 'type' }]\n */\nfunction formatToParts({ number, locale = null, options = null }) {\n if (\n typeof Intl !== 'undefined' &&\n typeof Intl.NumberFormat === 'function'\n ) {\n try {\n const inst = Intl.NumberFormat(locale || LOCALE, options || {})\n if (typeof inst.formatToParts === 'function') {\n return inst.formatToParts(number)\n } else {\n return [{ value: inst.format(number) }]\n }\n } catch (e) {\n warn(e)\n }\n }\n\n return [{ value: number }]\n}\n\n/**\n * Helper for getting a consistent compact format\n * Mutates a given \"opts\" object.\n *\n * @param {object}\n * @property {string} value any number\n * @property {string} locale a given locale\n * @property {string|boolean} compact \"short\" or \"long\" if true is given, \"short\" is used\n * @property {number} decimals the amount of decimals\n * @property {object} opts the options object – it gets mutated\n */\nfunction handleCompactBeforeDisplay({\n value,\n locale,\n compact,\n decimals = 0,\n opts,\n} = {}) {\n if (!canHandleCompact({ value, compact })) {\n return // stop here\n }\n\n value = parseInt(Math.abs(value))\n opts.notation = 'compact'\n\n // For numbers under 1M we do\n if (isTrue(compact) && locale && /(no|nb|nn)$/i.test(locale)) {\n opts.compactDisplay = Math.abs(value) < 1000000 ? 'long' : 'short'\n } else {\n opts.compactDisplay = !isTrue(compact) ? compact : 'short'\n }\n\n if (typeof opts.maximumSignificantDigits === 'undefined') {\n if (isNaN(parseFloat(decimals))) {\n decimals = 0\n } else {\n decimals = parseFloat(decimals)\n }\n\n // This formula ensures we always get the same amount decimals\n const ref = String(value).length % 3\n if (ref === 2) {\n decimals += 1\n } else if (ref === 0) {\n decimals += 2\n }\n\n // The result of this formula would be equal to this:\n // if (value >= 100000000000000) {\n // decimals += 2\n // } else if (value >= 10000000000000) {\n // decimals += 1\n // } else if (value >= 1000000000000) {\n // decimals += 0\n // } else if (value >= 100000000000) {\n // decimals += 2\n // } else if (value >= 10000000000) {\n // decimals += 1\n // } else if (value >= 1000000000) {\n // decimals += 0\n // } else if (value >= 100000000) {\n // decimals += 2\n // } else if (value >= 10000000) {\n // decimals += 1\n // } else if (value >= 1000000) {\n // decimals += 0\n // } else if (value >= 100000) {\n // decimals += 2\n // } else if (value >= 10000) {\n // decimals += 1\n // }\n\n // Firefox issue?\n // If we do not define \"maximumSignificantDigits\" Firefox does not show any decimals at all\n opts.maximumSignificantDigits = decimals + 1\n }\n}\n\n/**\n * Helper for getting a consistent compact format\n * Mutates a given \"opts\" object.\n *\n * @param {object}\n * @property {string|boolean} compact \"short\" or \"long\" if true is given, \"short\" is used\n * @property {object} opts the options object – it gets mutated\n */\nfunction handleCompactBeforeAria({ value, compact, opts }) {\n if (!canHandleCompact({ value, compact })) {\n return // stop here\n }\n\n opts.compactDisplay = 'long'\n}\n\n/**\n * Checks if we should/can handle the compact format\n *\n * @param {object}\n * @property {string|number} value any number\n * @property {string|boolean} compact \"short\" or \"long\" if true is given, \"short\" is used\n */\nfunction canHandleCompact({ value, compact }) {\n if (compact && Math.abs(value) >= 1000) {\n return true\n }\n\n return false\n}\n\n/**\n * Rounds the number to the nearest even number\n *\n * @param {number} num the number to round\n * @param {number} decimalPlaces the number of decimal places to round to\n * @returns {number} the rounded number\n */\nexport function roundHalfEven(num, decimalPlaces = 2) {\n const multiplier = Math.pow(10, decimalPlaces)\n const adjustedNum = num * multiplier\n const floored = Math.floor(adjustedNum)\n const diff = adjustedNum - floored\n\n if (diff > 0.5) {\n return Math.ceil(adjustedNum) / multiplier\n } else if (diff < 0.5) {\n return Math.floor(adjustedNum) / multiplier\n }\n\n // If exactly halfway, round to the nearest even number\n return floored % 2 === 0\n ? floored / multiplier\n :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,CAAC,CAAC,EAAE;IACzC;EACF;EAEA2B,IAAI,CAAC2J,cAAc,GAAG,MAAM;AAC9B;AASA,SAASH,gBAAgBA,CAAAQ,KAAA,EAAqB;EAAA,IAApB;IAAE9L,KAAK;IAAEG;EAAQ,CAAC,GAAA2L,KAAA;EAC1C,IAAI3L,OAAO,IAAIwE,IAAI,CAACkB,GAAG,CAAC7F,KAAK,CAAC,IAAI,IAAI,EAAE;IACtC,OAAO,IAAI;EACb;EAEA,OAAO,KAAK;AACd;AASA,OAAO,SAAS8E,aAAaA,CAACiC,GAAG,EAAqB;EAAA,IAAnBtC,aAAa,GAAAtD,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,CAAC;EAClD,MAAM4K,UAAU,GAAGpH,IAAI,CAACC,GAAG,CAAC,EAAE,EAAEH,aAAa,CAAC;EAC9C,MAAMuH,WAAW,GAAGjF,GAAG,GAAGgF,UAAU;EACpC,MAAME,OAAO,GAAGtH,IAAI,CAACM,KAAK,CAAC+G,WAAW,CAAC;EACvC,MAAME,IAAI,GAAGF,WAAW,GAAGC,OAAO;EAElC,IAAIC,IAAI,GAAG,GAAG,EAAE;IACd,OAAOvH,IAAI,CAACwH,IAAI,CAACH,WAAW,CAAC,GAAGD,UAAU;EAC5C,CAAC,MAAM,IAAIG,IAAI,GAAG,GAAG,EAAE;IACrB,OAAOvH,IAAI,CAACM,KAAK,CAAC+G,WAAW,CAAC,GAAGD,UAAU;EAC7C;EAGA,OAAOE,OAAO,GAAG,CAAC,KAAK,CAAC,GACpBA,OAAO,GAAGF,UAAU,GACpBpH,IAAI,CAACwH,IAAI,CAACH,WAAW,CAAC,GAAGD,UAAU;AACzC","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"NumberUtils.js","names":["React","Context","LOCALE","CURRENCY","CURRENCY_DISPLAY","warn","isTrue","slugify","escapeRegexChars","getOffsetTop","getOffsetLeft","getSelectedElement","copyToClipboard","IS_MAC","IS_WIN","locales","NUMBER_CHARS","format","value","locale","clean","compact","phone","org","ban","nin","percent","currency","currency_display","currency_position","omit_currency_sign","clean_copy_value","decimals","omit_rounding","rounding","options","returnAria","arguments","length","undefined","display","aria","type","window","navigator","language","e","cleanNumber","opts","JSON","parse","parseFloat","formatDecimals","maximumFractionDigits","number","_number","_aria","formatPhone","formatBAN","formatNIN","formatORG","countDecimals","style","formatNumber","handleCompactBeforeDisplay","cleanedNumber","currencyDisplay","getFallbackCurrencyDisplay","minimumFractionDigits","String","indexOf","formatter","item","test","currencySuffix","currencyPositionFormatter","_ref","alignCurrencySymbol","trim","prepareMinus","handleCompactBeforeAria","_objectSpread","enhanceSR","cleanedValue","thousandsSeparator","getThousandsSeparator","replace","RegExp","_locales$locale","NumberFormat","not_available","includes","decimalPlaces","factor","Math","pow","trunc","roundHalfEven","_String$split$","decimalSeparator","floor","valueOf","split","existingFormatter","callback","position","count","countCurrency","first","second","reg","output","abs","getGroupFormatter","formatToParts","map","reduce","acc","_ref2","Number","toLocaleString","stringify","replaceNaNWithDash","code","substring","codeAndNumber","match","filter","s","join","num","prefix","suffix","startsWith","endsWith","decimal","thousands","thousandReg","decimalReg","decimalBackup","runIOSSelectionFix","selection","getSelection","range","document","createRange","removeAllRanges","addRange","copyWithEffect","label","positionElement","success","fx","showSelectionNotice","run","_ref3","timeout","id","getElementById","elem","content","root","querySelector","createElement","setAttribute","arrow","appendChild","SelectionFx","remove","removeChild","hide","classList","add","pE","top","left","innerHTML","HTMLElement","width","offsetWidth","offsetHeight","setTimeout","useCopyWithNotice","translation","clipboard_copy","useContext","copy","getDecimalSeparator","_formatToParts$find","separator","find","_ref4","_formatToParts$map$fi","_ref5","getCurrencySymbol","_formatToParts$find2","_ref6","separatorSymbol","_ref7","Intl","inst","canHandleCompact","parseInt","notation","compactDisplay","maximumSignificantDigits","isNaN","ref","_ref8","_ref9","multiplier","adjustedNum","floored","diff","ceil"],"sources":["../../../../src/components/number-format/NumberUtils.js"],"sourcesContent":["import React from 'react'\nimport Context from '../../shared/Context'\n\n/**\n * Web NumberFormat Helpers\n *\n */\n\nimport { LOCALE, CURRENCY, CURRENCY_DISPLAY } from '../../shared/defaults'\nimport {\n warn,\n isTrue,\n slugify,\n escapeRegexChars,\n} from '../../shared/component-helper'\nimport {\n getOffsetTop,\n getOffsetLeft,\n getSelectedElement,\n copyToClipboard,\n IS_MAC,\n IS_WIN,\n} from '../../shared/helpers'\nimport locales from '../../shared/locales'\n\nconst NUMBER_CHARS = '\\\\-0-9,.'\n\n/**\n * Format a number to a streamlined format based on the given locale\n *\n * @param {string|number} value any number\n * @type {object} string or object { when: { min: 'small' } } that describes the media query\n * @property {string} locale - media queries\n * @property {boolean} clean - if true, clean the number for unwanted decimal separators\n * @property {string|boolean} compact - shortens any number or currency including an abbreviation. You can combine `compact` with `currency`. It gives you zero decimal by default `decimals={0}`. Use either a boolean, or a string with \"short\" or \"long\"\n * @property {boolean} phone - if true, it formats to a phone number\n * @property {boolean} org - if true, it formats to a Organization Number\n * @property {boolean} ban - if true, it formats to a Bank Account Number\n * @property {boolean} nin - if true, it formats to a National Identification Number\n * @property {boolean} percent - if true, it formats with a percent\n * @property {string|boolean} currency - currency code (ISO 4217) or `true` to use the default, `NOK`\n * @property {string} currency_display - use false or empty string to hide the sign or \"code\", \"name\", \"symbol\" or \"narrowSymbol\" – supports the API from number.toLocaleString\n * @property {string} currency_position - can be \"before\" or \"after\"\n * @property {string} omit_currency_sign - hides currency sign if true is given\n * @property {number} decimals - defines how many decimals should be added\n * @property {boolean} omit_rounding - @deprecated Use `rounding: \"omit\"` instead.\n * @property {string} rounding - if `omit`, the decimal will NOT be rounded. If `half-even`, the value will be rounded to the nearest even number. If set to `half-up`, the fractional part is 0.5 or greater, the number is rounded up. If the fractional part is less than 0.5, the number is rounded down. Defaults to `half-up`.\n * @property {object} options - accepts all number.toLocaleString API options\n * @property {boolean} returnAria - if true, this function returns an object that includes an aria property with a special aria formatting\n * @returns a formatted number as a string or as an object if \"returnAria\" is true\n */\nexport const format = (\n value,\n {\n locale = null, // can be \"auto\"\n clean = false,\n compact = null,\n phone = null,\n org = null,\n ban = null,\n nin = null,\n percent = null,\n currency = null,\n currency_display = null,\n currency_position = null,\n omit_currency_sign = null,\n clean_copy_value = null,\n decimals = null,\n omit_rounding = null, // @deprecated – can be removed in v11\n rounding = null,\n options = null,\n returnAria = false,\n } = {}\n) => {\n let display = value\n let aria = null\n let type = 'number'\n\n // because we are using context comparison\n if (!locale) {\n locale = LOCALE\n } else if (locale === 'auto') {\n try {\n locale = window.navigator.language\n } catch (e) {\n warn(e)\n }\n }\n\n if (isTrue(clean)) {\n value = cleanNumber(value)\n }\n\n const opts =\n (typeof options === 'string' && options[0] === '{'\n ? JSON.parse(options)\n : options) || {}\n\n if (parseFloat(decimals) >= 0) {\n value = formatDecimals(\n value,\n decimals,\n rounding ?? omit_rounding,\n opts\n )\n } else if (\n typeof opts.maximumFractionDigits === 'undefined' &&\n !isTrue(percent) &&\n !isTrue(currency)\n ) {\n // if no decimals are set, opts.maximumFractionDigits is set\n // why do we this? because the \".toLocaleString\" will else use 3 as the default\n opts.maximumFractionDigits = 20\n }\n\n if (isTrue(phone)) {\n type = 'phone'\n const { number: _number, aria: _aria } = formatPhone(value, locale)\n\n if (clean === null) {\n value = cleanNumber(value) // clean, because of +47 and ++47\n }\n display = _number\n aria = _aria\n } else if (isTrue(ban)) {\n type = 'ban' // Bank Account Number\n const { number: _number, aria: _aria } = formatBAN(value, locale)\n\n display = _number\n aria = _aria\n } else if (isTrue(nin)) {\n type = 'nin' // National Identification Number\n const { number: _number, aria: _aria } = formatNIN(value, locale)\n\n display = _number\n aria = _aria\n } else if (isTrue(org)) {\n type = 'org' // organization number\n\n const { number: _number, aria: _aria } = formatORG(value, locale)\n\n display = _number\n aria = _aria\n } else if (isTrue(percent)) {\n if (decimals === null) {\n if (typeof opts.maximumFractionDigits === 'undefined') {\n decimals = countDecimals(value)\n }\n value = formatDecimals(\n value,\n decimals,\n rounding ?? omit_rounding,\n opts\n )\n }\n\n if (!opts.style) {\n opts.style = 'percent'\n }\n\n display = formatNumber(value / 100, locale, opts)\n } else if (isTrue(currency) || typeof currency === 'string') {\n type = 'currency'\n\n opts.currency =\n opts.currency || (isTrue(currency) ? CURRENCY : currency)\n\n handleCompactBeforeDisplay({ value, locale, compact, decimals, opts })\n\n if (decimals === null) {\n decimals = 2\n value = formatDecimals(\n value,\n decimals,\n rounding ?? omit_rounding,\n opts\n )\n }\n\n // cleanup, but only if it not got cleaned up already\n let cleanedNumber =\n decimals >= 0 ? value : clean ? cleanNumber(value) : value\n\n if (currency_display === false || currency_display === '') {\n omit_currency_sign = true\n }\n\n opts.style = 'currency'\n opts.currencyDisplay = getFallbackCurrencyDisplay(\n locale,\n opts.currencyDisplay || currency_display\n )\n\n // if currency has no decimal, then go ahead and remove it\n if (\n typeof opts.minimumFractionDigits === 'undefined' &&\n String(value).indexOf('.') === -1 &&\n cleanedNumber % 1 === 0\n ) {\n opts.minimumFractionDigits = 0 // to enforce Norwegian style\n }\n\n let formatter = undefined\n\n if (isTrue(omit_currency_sign)) {\n formatter = (item) => {\n switch (item.type) {\n case 'literal':\n item.value = item.value === ' ' ? '' : item.value\n return item\n\n case 'currency':\n item.value = ''\n return item\n\n default:\n return item\n }\n }\n }\n\n /**\n * Make exception – if locale is Norwegian, and position is not defined, then use position \"after\"\n */\n if (!currency_position && locale && /(no|nb|nn)$/i.test(locale)) {\n currency_position = 'after'\n }\n\n let currencySuffix = null\n if (currency_position) {\n formatter = currencyPositionFormatter(\n formatter,\n ({ value }) => {\n return (currencySuffix = alignCurrencySymbol(\n value.trim(),\n currency_display\n ))\n },\n currency_position\n )\n }\n\n display = formatNumber(cleanedNumber, locale, opts, formatter)\n display = prepareMinus(display, locale)\n\n if (currency_position && currencySuffix) {\n if (currency_position === 'after') {\n display = `${display.trim()} ${currencySuffix}`\n } else if (currency_position === 'before') {\n display = `${currencySuffix} ${display.trim()}`\n }\n }\n\n handleCompactBeforeAria({ value, compact, opts })\n\n // aria options\n aria = formatNumber(cleanedNumber, locale, {\n minimumFractionDigits: 0,\n maximumFractionDigits: 2,\n ...opts,\n currencyDisplay: 'name',\n })\n aria = enhanceSR(cleanedNumber, aria, locale) // also calls prepareMinus\n } else {\n handleCompactBeforeDisplay({ value, locale, compact, decimals, opts })\n\n display = formatNumber(value, locale, opts)\n display = prepareMinus(display, locale)\n\n handleCompactBeforeAria({ value, compact, opts })\n\n // fix for NVDA to make sure we read the number, we add a minimum fraction digit (decimal)\n // NVDA fix\n aria = formatNumber(value, locale, opts)\n aria = enhanceSR(value, aria, locale) // also calls prepareMinus\n }\n\n if (aria === null) {\n aria = display\n }\n\n if (returnAria) {\n let cleanedValue\n\n if (clean_copy_value) {\n cleanedValue = formatNumber(\n opts.style === 'percent' ? value / 100 : value,\n locale,\n opts,\n (item) => {\n switch (item.type) {\n case 'group':\n case 'literal':\n case 'currency':\n case 'percentSign':\n item.value = ''\n return item\n default:\n return item\n }\n }\n )\n } else {\n const thousandsSeparator = getThousandsSeparator(locale)\n cleanedValue = String(display).replace(\n new RegExp(`${thousandsSeparator}(?=\\\\d{3})`, 'g'),\n ''\n )\n }\n\n if (value === 'invalid') {\n aria = locales[locale]?.NumberFormat.not_available || 'N/A'\n }\n\n // return \"locale\" as well value,l, since we have to \"auto\" option\n return { value, cleanedValue, number: display, aria, locale, type }\n }\n\n return display\n}\n\n/**\n * Fill format decimals\n *\n * @param {number|string} value\n * @param {number} decimals how many decimals\n * @param {boolean} defines what rounding method to use for decimals\n * @param {boolean} clean whether the value should be cleaned or not\n * @param {object} opts immutable object\n * @returns a decimal prepared number\n */\nexport const formatDecimals = (value, decimals, rounding, opts = {}) => {\n decimals = parseFloat(decimals)\n\n // Mutate the given options\n if (decimals >= 0) {\n opts.minimumFractionDigits = decimals\n opts.maximumFractionDigits = decimals\n }\n\n if (String(value).includes('.')) {\n const decimalPlaces = decimals || opts.maximumFractionDigits\n if (rounding === 'omit' || rounding === true) {\n const factor = Math.pow(10, decimalPlaces)\n value = Math.trunc(value * factor) / factor\n } else {\n switch (rounding) {\n case 'half-even': {\n value = roundHalfEven(value, decimalPlaces)\n\n break\n }\n }\n }\n }\n\n return value\n}\n\n/**\n * Find the amount of decimals\n *\n * @param {number|string} value any number\n * @param {string} decimalSeparator a dot or comma\n * @returns amount of decimals\n */\nexport const countDecimals = (value, decimalSeparator = '.') => {\n if (\n typeof value === 'number' &&\n Math.floor(value.valueOf()) === value.valueOf()\n ) {\n return 0\n }\n return String(value).split(decimalSeparator)[1]?.length || 0\n}\n\n/**\n * Changes the currency sign position\n *\n * For Norway, the position defaults to \"after\"\n *\n * @param {function} existingFormatter an existing number formatter or undefined\n * @param {function} callback function that will emitted with the currency\n * @param {string} position blank, before or after\n * @returns {function} number formatter\n */\nconst currencyPositionFormatter = (\n existingFormatter,\n callback,\n position = null\n) => {\n let count = 0\n let countCurrency = -1\n\n return (item) => {\n // Ensure we do not overwrite a given formatter, but run it as well\n if (typeof existingFormatter === 'function') {\n item = existingFormatter(item)\n }\n\n count++\n\n switch (item.type) {\n case 'currency': {\n if (position === 'after' || (position === 'before' && count > 2)) {\n countCurrency = count\n callback(item)\n item.value = ''\n }\n return item\n }\n\n case 'literal': {\n // Remove the literal after currency\n if (count === countCurrency + 1) {\n item.value = ''\n }\n return item\n }\n\n default:\n return item\n }\n }\n}\n\n/**\n * When e.g. a currency number is given with a minus,\n * this function transforms the minus to be moved before the number\n * instead of the symbol.\n *\n * It only cleans if locale is Norwegian\n *\n * form -NOK 1 234 to NOK -1 234\n *\n * @param {string} display currency number that includes either a minus or not\n * @param {string} locale locale as a string\n * @returns {string} number\n */\nconst prepareMinus = (display, locale) => {\n /**\n * Make exception – if locale is NOT Norwegian,\n * we skip the cleanup\n */\n if (!(locale && /(no|nb|nn)$/i.test(locale))) {\n return display\n }\n\n // check for first and second char\n const first = display[0]\n const second = display[1]\n\n // Seems to be the invalid replacement\n if (first === '-' && second === '-') {\n return display\n }\n\n // change the position of minus if it's first\n // check for two minus - −\n // check also for hyphen ‐\n // check also for dashes ‒ – — ―\n const reg = '^(-|−|‐|‒|–|—|―)'\n\n if (new RegExp(reg).test(first)) {\n // if second is number\n if (parseFloat(second) > 0) {\n // then do not swap\n display = display.replace(new RegExp(reg + '(.*)'), '-$2')\n } else {\n // then first has to be currency\n display = display.replace(new RegExp(reg + '([^0-9]+)(.*)'), '$2-$3')\n }\n }\n\n return display\n}\n\n/**\n * Aligns the currency symbol in the output based on the currency display option.\n * \"norske kroner\" (\"Norwegian kroner\") will be changed to \"kroner\" if the currency display option is set to \"name\".\n *\n * @param {string} output - The output string containing the currency symbol.\n * @param {string} currencyDisplay - The currency display option ('name' or 'symbol').\n * @returns {string} The aligned output string.\n */\nfunction alignCurrencySymbol(output, currencyDisplay) {\n if (typeof output === 'string' && currencyDisplay === 'name') {\n output = output.replace(/(nor[^\\s]+?)\\s(\\w+)/i, '$2')\n }\n return output\n}\n\n/**\n * Enhance VoiceOver support on mobile devices\n * Numbers under 99.999 are read out correctly, but only if we remove the spaces\n * Potential we could also check for locale: && /no|nb|nn/.test(locale)\n * but leave it for now without this extra check\n *\n * @param {string|number} value any number\n * @param {string} aria aria formatted number\n * @param {string} locale locale as a string\n * @returns aria number\n */\nconst enhanceSR = (value, aria, locale) => {\n if (IS_MAC && Math.abs(parseFloat(value)) <= 99999) {\n aria = String(aria).replace(/\\s([0-9])/g, '$1')\n }\n\n aria = prepareMinus(aria, locale)\n\n return aria\n}\n\n/**\n * The main number formatter function\n * This function is used to call the browsers/Node.js \"Intl.NumberFormat\" or \"Number.toLocaleString\" APIs\n *\n * @param {string|number} number any number\n * @param {string} locale locale as a string\n * @param {string} options formatting options based on the toLocaleString API\n * @param {string} formatter optional, a custom formatter can be given\n * @returns formatted number\n */\nexport const formatNumber = (\n number,\n locale,\n options = {},\n formatter = null\n) => {\n try {\n if (options.currencyDisplay) {\n options.currencyDisplay = getFallbackCurrencyDisplay(\n locale,\n options.currencyDisplay\n )\n }\n\n // remove unsupported decimals\n delete options.decimals\n\n if (locale && /(en|gb)$/i.test(locale)) {\n formatter = getGroupFormatter(locale, null, formatter)\n }\n\n if (formatter) {\n number = formatToParts({ number, locale, options })\n .map(formatter)\n .reduce((acc, { value }) => acc + value, '')\n } else if (\n typeof Number !== 'undefined' &&\n typeof Number.toLocaleString === 'function'\n ) {\n number = parseFloat(number).toLocaleString(locale, options)\n }\n if (number === '−0') {\n number = '0'\n }\n } catch (e) {\n warn(\n `Number could not be formatted: ${JSON.stringify([\n number,\n locale,\n options,\n ])}`,\n e\n )\n }\n\n return replaceNaNWithDash(\n alignCurrencySymbol(number, options.currencyDisplay)\n )\n}\n\nfunction replaceNaNWithDash(number) {\n return String(number).replace(/NaN/, '–')\n}\n\n/**\n * Use this function to format phone numbers\n *\n * @param {string|number} number a phone number\n * @param {string} locale locale as a string\n * @returns a formatted phone number\n */\nexport const formatPhone = (number, locale = null) => {\n let display = number\n let aria = null\n\n switch (locale) {\n default: {\n let code = ''\n number = String(number)\n // Edge case for when a Norwegian number is given without a space after the country code\n .replace(/^(00|\\+|)47([^\\s])/, '+47 $2')\n .replace(/^00/, '+')\n\n if (number.substring(0, 1) === '+') {\n const codeAndNumber = number.match(\n // Split the number into the country code and the rest of the number\n /^\\+([\\d-]{1,8})\\s{0,2}([\\d\\s-]{1,20})$/\n )\n if (codeAndNumber) {\n code = `+${codeAndNumber[1]} `\n number = codeAndNumber[2]\n }\n }\n\n number = number.replace(/[^+\\d]/g, '')\n const length = number.length\n\n // Get 800 22 222\n if (length === 8 && number.substring(0, 1) === '8') {\n display =\n code +\n number\n .split(/([\\d]{3})([\\d]{2})/)\n .filter((s) => s)\n .join(' ')\n } else {\n // Get 02000\n if (length < 6) {\n display = code + number\n } else {\n if (code.includes('-')) {\n // Convert +12-3456 to +12 (3456)\n code = code.replace(/(\\+[\\d]{1,2})-([\\d]{1,6})/, '$1 ($2)')\n }\n\n // Get 6 or 8 formatting\n display =\n code +\n number\n .split(\n length === 6\n ? /^(\\+[\\d]{2})|([\\d]{3})/\n : /^(\\+[\\d]{2})|([\\d]{2})/\n )\n .filter((s) => s)\n .join(' ')\n }\n }\n\n aria =\n code +\n number\n .split(/([\\d]{2})/)\n .filter((s) => s)\n .join(' ')\n }\n }\n\n if (aria === null) {\n aria = display\n }\n\n return { number: display, aria }\n}\n\n/**\n * Use this function to format Bank Account Numbers\n *\n * @param {string|number} number a Bank Account Number\n * @param {string} locale locale as a string\n * @returns a formatted Bank Account Number\n */\nexport const formatBAN = (number, locale = null) => {\n // cleanup\n number = String(number).replace(/[^0-9]/g, '')\n\n let display = number\n let aria = null\n\n switch (locale) {\n default: {\n // Get 2000 12 34567\n display = number\n .split(/([0-9]{4})([0-9]{2})([0-9]{1,})/)\n .filter((s) => s)\n .join(' ')\n\n aria = number\n .split(/([0-9]{2})/)\n .filter((s) => s)\n .join(' ')\n }\n }\n\n if (aria === null) {\n aria = display\n }\n\n return { number: display, aria }\n}\n\n/**\n * Use this function to format Organization Numbers\n *\n * @param {string|number} number a Organization Number\n * @param {string} locale locale as a string\n * @returns a formatted Organization Number\n */\nexport const formatORG = (number, locale = null) => {\n // cleanup\n number = String(number).replace(/[^0-9]/g, '')\n\n let display = number\n let aria = null\n\n switch (locale) {\n default: {\n // Get 123 456 789\n display = number\n .split(/([0-9]{3})/)\n .filter((s) => s)\n .join(' ')\n\n aria = number\n .split(/([0-9]{1})/)\n .filter((s) => s)\n .join(' ')\n }\n }\n\n if (aria === null) {\n aria = display\n }\n\n return { number: display, aria }\n}\n\n/**\n * Use this function to format National Identification Numbers\n *\n * @param {string|number} number a National Identification Number\n * @param {string} locale locale as a string\n * @returns a formatted National Identification Number\n */\nexport const formatNIN = (number, locale = null) => {\n // cleanup\n number = String(number).replace(/[^0-9]/g, '')\n\n let display = number\n let aria = null\n\n switch (locale) {\n default: {\n // Get 180892 12345\n display = number\n .split(/([0-9]{6})/)\n .filter((s) => s)\n .join(' ')\n\n // correct nin for screen readers\n aria = display\n .split(\n /([0-9]{2})([0-9]{2})([0-9]{2}) ([0-9]{1})([0-9]{1})([0-9]{1})([0-9]{1})([0-9]{1})/\n )\n .filter((s) => s)\n .join(IS_WIN ? '. ' : ' ') // NVDA fix with a dot to not read date on FF\n }\n }\n\n if (aria === null) {\n aria = display\n }\n\n return { number: display, aria }\n}\n\n/**\n * This function cleans numbers for separators\n * https://en.wikipedia.org/wiki/Decimal_separator\n *\n * @param {string|number} num any number\n * @returns a number that contains valid number separators\n */\nexport function cleanNumber(\n num,\n {\n decimalSeparator = null,\n thousandsSeparator = null,\n prefix = null,\n suffix = null,\n } = {}\n) {\n if (typeof num === 'number') {\n return num\n }\n\n num = String(num).trim()\n\n if (typeof prefix === 'string' && num.startsWith(prefix)) {\n num = num.substring(prefix.length, num.length)\n }\n if (typeof suffix === 'string' && num.endsWith(suffix)) {\n num = num.substring(0, num.length - suffix.length)\n }\n\n // 1. Remove invalid chars on the beginning (not a number)\n if (/^[^0-9-]/.test(num)) {\n num = num.replace(/^(^[^0-9-]+)/, '')\n }\n\n let decimal = decimalSeparator\n let thousands = thousandsSeparator\n\n // -12 345,678\n if (/(\\s)([0-9]{3})/.test(num)) {\n thousands = thousands || '\\\\s'\n decimal = decimal || ','\n }\n\n // -12.345,678\n else if (\n /(\\.)([0-9]{3})/.test(num) &&\n !/([,'][0-9]{3})(\\.)([0-9]{3})/.test(num) // just an additional check, for support with more\n ) {\n thousands = thousands || '\\\\.'\n decimal = decimal || \",|·|'\" // also support Spain and CH\n }\n\n // -1,234,567.891\n else if (/(,)([0-9]{3})/.test(num)) {\n thousands = thousands || ','\n decimal = decimal || '\\\\.|·' // also support Spain\n }\n\n // -1'234'567.891, only used in CH\n else if (/(')([0-9]{3})/.test(num)) {\n thousands = thousands || \"'\"\n decimal = decimal || '\\\\.|,'\n } else {\n thousands = ','\n decimal = '\\\\.'\n }\n\n // 3. Remove invalid thousand separators\n const thousandReg = thousandsSeparator\n ? new RegExp(\n `([0-9]|)(${escapeRegexChars(thousandsSeparator)})([0-9]{3})`,\n 'g'\n )\n : new RegExp(`([0-9]|)(${thousands})([0-9]{3})`, 'g')\n if (thousandReg.test(num)) {\n num = num.replace(thousandReg, '$1$3')\n }\n\n // 2. Rename invalid decimal separator\n // Make sure that there are only two digits after the comma, then we clean that up.\n // else we don't, because it can be a US number\n // therefore, check first, is there a chance of being a decimal?\n // const decimalReg = new RegExp(`(${decimal})([0-9]{1,2})`, 'g')\n const decimalReg = decimalSeparator\n ? new RegExp(`(${escapeRegexChars(decimalSeparator)})([0-9]{0,})`, 'g')\n : new RegExp(`(${decimal})([0-9]{1,2})`, 'g')\n if (decimalReg.test(num)) {\n num = num.replace(decimalReg, '.$2')\n }\n\n // Edge case, if we have more than 2 decimals, replace these decimals\n if (!decimalSeparator) {\n const decimalBackup = new RegExp(`(${decimal})([0-9]{3,})`, 'g')\n if (decimalBackup.test(num)) {\n num = num.replace(decimalBackup, '.$2')\n }\n }\n\n // Remove all invalid chars\n return num.replace(new RegExp(`([^${NUMBER_CHARS}])`, 'g'), '')\n}\n\n/**\n * So iOS v13 can select something on the first try, we run this add range trick.\n * NB: This hack may be removed in future iOS versions.\n */\nexport function runIOSSelectionFix() {\n try {\n const selection = window.getSelection()\n const range = document.createRange()\n selection.removeAllRanges()\n selection.addRange(range)\n } catch (e) {\n //\n }\n}\n\n/**\n * A function that tries to copy to the clipboard\n * at the same time it shows the copy result in a tooltip\n *\n * NB: This function is not documented.\n * It should not be used!\n *\n * @param {string} value any number\n * @param {*} label\n * @param {*} positionElement\n * @returns\n */\nexport async function copyWithEffect(\n value,\n label,\n positionElement = null\n) {\n let success = null\n\n if (value) {\n try {\n const fx = showSelectionNotice({ value, label })\n success = await copyToClipboard(value)\n if (success === true) {\n fx.run(positionElement)\n }\n } catch (e) {\n warn(e)\n success = e\n }\n }\n\n return success\n}\n\n/**\n * This function add a tooltip looking\n *\n * @type {object} object with property\n * @property {string} value any value\n * @property {string} label any additional label that gets added as a suffix\n * @property {number} timeout how long the tooltip should be visible (3 sec)\n * @returns {object} { run, hide, remove } call the \"run\" function when the effect should be shown\n */\nexport function showSelectionNotice({ value, label, timeout = 3e3 }) {\n const id = 'id-' + slugify(value)\n if (typeof document !== 'undefined' && document.getElementById(id)) {\n return { run: () => {} }\n }\n\n let elem, content, root\n\n try {\n root = document.querySelector('.dnb-tooltip__portal, body')\n\n // create that portal element\n elem = document.createElement('span')\n elem.setAttribute('id', id)\n elem.setAttribute('class', 'dnb-tooltip')\n elem.setAttribute('role', 'tooltip')\n\n const arrow = document.createElement('span')\n arrow.setAttribute(\n 'class',\n 'dnb-tooltip__arrow dnb-tooltip__arrow__position--top'\n )\n content = document.createElement('span')\n content.setAttribute('class', 'dnb-tooltip__content')\n content.setAttribute('aria-live', 'assertive')\n elem.appendChild(arrow)\n elem.appendChild(content)\n } catch (e) {\n warn(e)\n }\n\n return new (class SelectionFx {\n remove() {\n try {\n root.removeChild(elem)\n elem = null\n content = null\n } catch (e) {\n //\n }\n }\n hide() {\n try {\n elem.classList.add('dnb-tooltip--hide')\n } catch (e) {\n //\n }\n }\n run(pE = getSelectedElement()) {\n try {\n root.appendChild(elem)\n\n const top = getOffsetTop(pE)\n const left = getOffsetLeft(pE)\n\n content.innerHTML =\n String(label) +\n (pE instanceof HTMLElement\n ? `<span class=\"dnb-sr-only\">: ${\n (\n (pE &&\n pE.querySelector('.dnb-number-format__selection')) ||\n pE\n ).innerHTML\n }</span>`\n : '')\n\n const width =\n (\n (pE && pE.querySelector('.dnb-number-format__visible')) ||\n pE ||\n {}\n ).offsetWidth || 0\n\n elem.style.top = `${top - elem.offsetHeight}px`\n elem.style.left = `${left + width / 2 - elem.offsetWidth / 2}px`\n elem.classList.add('dnb-tooltip--active')\n\n setTimeout(this.hide, timeout)\n setTimeout(this.remove, timeout + 600)\n } catch (e) {\n warn(e)\n }\n }\n })()\n}\n\n/**\n * React Hook\n * It returns \"copyWithEffect\" but with a translated string\n *\n * @returns copyWithEffect function inside object { copy }\n */\nexport function useCopyWithNotice() {\n const {\n translation: {\n NumberFormat: { clipboard_copy },\n },\n } = React.useContext(Context)\n\n const copy = (value, positionElement) => {\n copyWithEffect(value, clipboard_copy, positionElement)\n }\n\n return { copy }\n}\n\n/**\n * Will return currency display value based on navigator/browser and locale\n *\n * @property {string} currencyDisplay (optional) code, name, symbol or narrowSymbol\n * @property {string} locale (optional) the locale to use, defaults to nb-NO\n * @returns {string} a separator symbol\n */\nexport function getFallbackCurrencyDisplay(\n locale = null,\n currencyDisplay = null\n) {\n // If currencyDisplay is not defined and locale is \"no\", use narrowSymbol\n if (!currencyDisplay && (!locale || /(no|nb|nn)$/i.test(locale))) {\n currencyDisplay = 'narrowSymbol'\n }\n\n return currencyDisplay || CURRENCY_DISPLAY // code, name, symbol\n}\n\n/**\n * This function returns a decimal separator symbol based on the given locale\n *\n * @property {string} locale (optional) the locale to use, defaults to nb-NO\n * @returns {string} a separator symbol\n */\nexport function getDecimalSeparator(locale = null) {\n const separator =\n formatToParts({\n number: 1.1,\n locale,\n }).find(({ type }) => type === 'decimal')?.value || ',' // defaults to nb-NO\n\n return separator\n}\n\n/**\n * This function returns a thousands separator symbol based on the given locale\n *\n * @property {string} locale (optional) the locale to use, defaults to nb-NO\n * @returns {string} a separator symbol\n */\nexport function getThousandsSeparator(locale = null) {\n const formatter = getGroupFormatter(locale)\n\n return (\n formatToParts({\n number: 1000,\n locale,\n })\n .map(formatter)\n .find(({ type }) => type === 'group')?.value || ' '\n ) // defaults to nb-NO\n}\n\n/**\n * This function returns a currency symbol based on the given locale\n *\n * @property {string} locale (optional) the locale to use, defaults to nb-NO\n * @property {string} currency (optional) a given currency\n * @property {string} display (optional) what currency display\n * @property {number} number (optional) only to define if it should be formatted in singular or plural\n * @returns {string} a currency symbol\n */\nexport function getCurrencySymbol(\n locale = null,\n currency = null,\n display = null,\n number = 2\n) {\n if (!currency) {\n currency = CURRENCY\n }\n\n const currencyDisplay = getFallbackCurrencyDisplay(locale, display)\n\n return alignCurrencySymbol(\n formatToParts({\n number,\n locale,\n options: {\n style: 'currency',\n currency,\n currencyDisplay,\n },\n }).find(({ type }) => type === 'currency')?.value || currency,\n currencyDisplay\n )\n}\n\nfunction getGroupFormatter(\n locale = null,\n separatorSymbol = null,\n existingFormatter = null\n) {\n /**\n * We change the thousand separator to be a non-breaking space\n *\n * Effected locales:\n * - en-GB\n * - en\n */\n if (locale && /(en|gb)$/i.test(locale)) {\n separatorSymbol = ' ' // non-breaking space\n }\n\n return (item) => {\n // Ensure we do not overwrite a given formatter, but run it as well\n if (typeof existingFormatter === 'function') {\n item = existingFormatter(item)\n }\n\n if (item.type === 'group') {\n item.value = separatorSymbol || item.value\n }\n\n return item\n }\n}\n\n/**\n * For internal usage\n *\n * @type {object}\n * @property {string} number - a number\n * @property {string} locale - locale as a string. Defaults to the global LOCALE constant\n * @property {object} options - NumberFormat options\n * @returns {array} that contains all the parts of the given number [{ value: x, type: 'type' }]\n */\nfunction formatToParts({ number, locale = null, options = null }) {\n if (\n typeof Intl !== 'undefined' &&\n typeof Intl.NumberFormat === 'function'\n ) {\n try {\n const inst = Intl.NumberFormat(locale || LOCALE, options || {})\n if (typeof inst.formatToParts === 'function') {\n return inst.formatToParts(number)\n } else {\n return [{ value: inst.format(number) }]\n }\n } catch (e) {\n warn(e)\n }\n }\n\n return [{ value: number }]\n}\n\n/**\n * Helper for getting a consistent compact format\n * Mutates a given \"opts\" object.\n *\n * @param {object}\n * @property {string} value any number\n * @property {string} locale a given locale\n * @property {string|boolean} compact \"short\" or \"long\" if true is given, \"short\" is used\n * @property {number} decimals the amount of decimals\n * @property {object} opts the options object – it gets mutated\n */\nfunction handleCompactBeforeDisplay({\n value,\n locale,\n compact,\n decimals = 0,\n opts,\n} = {}) {\n if (!canHandleCompact({ value, compact })) {\n return // stop here\n }\n\n value = parseInt(Math.abs(value))\n opts.notation = 'compact'\n\n // For numbers under 1M we do\n if (isTrue(compact) && locale && /(no|nb|nn)$/i.test(locale)) {\n opts.compactDisplay = Math.abs(value) < 1000000 ? 'long' : 'short'\n } else {\n opts.compactDisplay = !isTrue(compact) ? compact : 'short'\n }\n\n if (typeof opts.maximumSignificantDigits === 'undefined') {\n if (isNaN(parseFloat(decimals))) {\n decimals = 0\n } else {\n decimals = parseFloat(decimals)\n }\n\n // This formula ensures we always get the same amount decimals\n const ref = String(value).length % 3\n if (ref === 2) {\n decimals += 1\n } else if (ref === 0) {\n decimals += 2\n }\n\n // The result of this formula would be equal to this:\n // if (value >= 100000000000000) {\n // decimals += 2\n // } else if (value >= 10000000000000) {\n // decimals += 1\n // } else if (value >= 1000000000000) {\n // decimals += 0\n // } else if (value >= 100000000000) {\n // decimals += 2\n // } else if (value >= 10000000000) {\n // decimals += 1\n // } else if (value >= 1000000000) {\n // decimals += 0\n // } else if (value >= 100000000) {\n // decimals += 2\n // } else if (value >= 10000000) {\n // decimals += 1\n // } else if (value >= 1000000) {\n // decimals += 0\n // } else if (value >= 100000) {\n // decimals += 2\n // } else if (value >= 10000) {\n // decimals += 1\n // }\n\n // Firefox issue?\n // If we do not define \"maximumSignificantDigits\" Firefox does not show any decimals at all\n opts.maximumSignificantDigits = decimals + 1\n }\n}\n\n/**\n * Helper for getting a consistent compact format\n * Mutates a given \"opts\" object.\n *\n * @param {object}\n * @property {string|boolean} compact \"short\" or \"long\" if true is given, \"short\" is used\n * @property {object} opts the options object – it gets mutated\n */\nfunction handleCompactBeforeAria({ value, compact, opts }) {\n if (!canHandleCompact({ value, compact })) {\n return // stop here\n }\n\n opts.compactDisplay = 'long'\n}\n\n/**\n * Checks if we should/can handle the compact format\n *\n * @param {object}\n * @property {string|number} value any number\n * @property {string|boolean} compact \"short\" or \"long\" if true is given, \"short\" is used\n */\nfunction canHandleCompact({ value, compact }) {\n if (compact && Math.abs(value) >= 1000) {\n return true\n }\n\n return false\n}\n\n/**\n * Rounds the number to the nearest even number\n *\n * @param {number} num the number to round\n * @param {number} decimalPlaces the number of decimal places to round to\n * @returns {number} the rounded number\n */\nexport function roundHalfEven(num, decimalPlaces = 2) {\n const multiplier = Math.pow(10, decimalPlaces)\n const adjustedNum = num * multiplier\n const floored = Math.floor(adjustedNum)\n const diff = adjustedNum - floored\n\n if (diff > 0.5) {\n return Math.ceil(adjustedNum) / multiplier\n } else if (diff < 0.5) {\n return Math.floor(adjustedNum) / multiplier\n }\n\n // If exactly halfway, round to the nearest even number\n return floored % 2 === 0\n ? floored / multiplier\n : Math.ceil(adjustedNum) / multiplier\n}\n"],"mappings":";;;;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,OAAO,MAAM,sBAAsB;AAO1C,SAASC,MAAM,EAAEC,QAAQ,EAAEC,gBAAgB,QAAQ,uBAAuB;AAC1E,SACEC,IAAI,EACJC,MAAM,EACNC,OAAO,EACPC,gBAAgB,QACX,+BAA+B;AACtC,SACEC,YAAY,EACZC,aAAa,EACbC,kBAAkB,EAClBC,eAAe,EACfC,MAAM,EACNC,MAAM,QACD,sBAAsB;AAC7B,OAAOC,OAAO,MAAM,sBAAsB;AAE1C,MAAMC,YAAY,GAAG,UAAU;AA0B/B,OAAO,MAAMC,MAAM,GAAG,SAAAA,CACpBC,KAAK,EAqBF;EAAA,IApBH;IACEC,MAAM,GAAG,IAAI;IACbC,KAAK,GAAG,KAAK;IACbC,OAAO,GAAG,IAAI;IACdC,KAAK,GAAG,IAAI;IACZC,GAAG,GAAG,IAAI;IACVC,GAAG,GAAG,IAAI;IACVC,GAAG,GAAG,IAAI;IACVC,OAAO,GAAG,IAAI;IACdC,QAAQ,GAAG,IAAI;IACfC,gBAAgB,GAAG,IAAI;IACvBC,iBAAiB,GAAG,IAAI;IACxBC,kBAAkB,GAAG,IAAI;IACzBC,gBAAgB,GAAG,IAAI;IACvBC,QAAQ,GAAG,IAAI;IACfC,aAAa,GAAG,IAAI;IACpBC,QAAQ,GAAG,IAAI;IACfC,OAAO,GAAG,IAAI;IACdC,UAAU,GAAG;EACf,CAAC,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,G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AGA,OAAOE,OAAO,GAAG,CAAC,KAAK,CAAC,GACpBA,OAAO,GAAGF,UAAU,GACpBpH,IAAI,CAACwH,IAAI,CAACH,WAAW,CAAC,GAAGD,UAAU;AACzC","ignoreList":[]}
|
|
@@ -208,7 +208,8 @@ export const format = (value, {
|
|
|
208
208
|
cleanedValue = String(display).replace(new RegExp(`${thousandsSeparator}(?=\\d{3})`, 'g'), '');
|
|
209
209
|
}
|
|
210
210
|
if (value === 'invalid') {
|
|
211
|
-
|
|
211
|
+
var _locales$locale;
|
|
212
|
+
aria = ((_locales$locale = locales[locale]) === null || _locales$locale === void 0 ? void 0 : _locales$locale.NumberFormat.not_available) || 'N/A';
|
|
212
213
|
}
|
|
213
214
|
return {
|
|
214
215
|
value,
|