@ambita/design-system 3.0.24-227.0 → 3.0.24-238.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -4803,6 +4803,7 @@ __webpack_require__.d(__webpack_exports__, "AuxCard", function() { return /* ree
4803
4803
  __webpack_require__.d(__webpack_exports__, "AuxToggle", function() { return /* reexport */ Toggle; });
4804
4804
  __webpack_require__.d(__webpack_exports__, "AuxPagination", function() { return /* reexport */ Pagination; });
4805
4805
  __webpack_require__.d(__webpack_exports__, "formatDate", function() { return /* reexport */ formatDate; });
4806
+ __webpack_require__.d(__webpack_exports__, "formatPrice", function() { return /* reexport */ formatPrice; });
4806
4807
 
4807
4808
  // CONCATENATED MODULE: ./node_modules/@vue/cli-service/lib/commands/build/setPublicPath.js
4808
4809
  // This file is imported into lib/wc client bundles.
@@ -7855,6 +7856,39 @@ function formatDate(date) {
7855
7856
  var format = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'dateAndTime';
7856
7857
  return format === 'dateAndTime' || format === 'dateAndTimeWithSeconds' ? getDateTime(date, format) : getFormatDate(date, format);
7857
7858
  }
7859
+ // CONCATENATED MODULE: ./src/helpers/formatAmount.ts
7860
+ var setThousandsSeparators = function setThousandsSeparators(amount, format) {
7861
+ var numberOfDecimals = format === 'decimals' ? 2 : 0;
7862
+ return new Intl.NumberFormat('nb-NB', {
7863
+ minimumFractionDigits: numberOfDecimals,
7864
+ maximumFractionDigits: numberOfDecimals
7865
+ }).format(amount);
7866
+ };
7867
+
7868
+ var addTaxLabel = function addTaxLabel(amount, taxFormat) {
7869
+ switch (taxFormat) {
7870
+ case 'excl':
7871
+ return "".concat(amount, " eks. mva");
7872
+
7873
+ case 'incl':
7874
+ return "".concat(amount, " inkl. mva");
7875
+
7876
+ default:
7877
+ return amount;
7878
+ }
7879
+ };
7880
+
7881
+ var addKrSymbol = function addKrSymbol(amount, format) {
7882
+ return format === 'rounded' ? "".concat(amount, ",-") : amount;
7883
+ };
7884
+
7885
+ function formatPrice(amount) {
7886
+ var format = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'decimals';
7887
+ var taxLabel = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'none';
7888
+ var amountThousandsSeparators = setThousandsSeparators(amount, format);
7889
+ var amountKrSymbol = addKrSymbol(amountThousandsSeparators, format);
7890
+ return addTaxLabel(amountKrSymbol, taxLabel);
7891
+ }
7858
7892
  // CONCATENATED MODULE: ./src/index.ts
7859
7893
 
7860
7894
 
@@ -7874,6 +7908,7 @@ function formatDate(date) {
7874
7908
 
7875
7909
 
7876
7910
 
7911
+
7877
7912
  // CONCATENATED MODULE: ./node_modules/@vue/cli-service/lib/commands/build/entry-lib-no-default.js
7878
7913
 
7879
7914