@reni-corp/reni-2c-ui 0.2.10 → 0.2.12

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.
@@ -0,0 +1,70 @@
1
+ var l = Object.defineProperty;
2
+ var i = (e, r, t) => r in e ? l(e, r, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[r] = t;
3
+ var a = (e, r, t) => (i(e, typeof r != "symbol" ? r + "" : r, t), t);
4
+ class o {
5
+ constructor(r) {
6
+ a(this, "_value");
7
+ this._value = s(r), this.init();
8
+ }
9
+ init() {
10
+ }
11
+ get value() {
12
+ return this._value;
13
+ }
14
+ toString() {
15
+ return String(this.value);
16
+ }
17
+ toJSON() {
18
+ return this.value;
19
+ }
20
+ }
21
+ function s(e) {
22
+ return e instanceof o ? e.value : e;
23
+ }
24
+ const h = "ja-JP", m = "JPY";
25
+ class v extends o {
26
+ constructor(t, {
27
+ locale: n = h,
28
+ currency: u = m
29
+ } = {}) {
30
+ super(t);
31
+ a(this, "locale");
32
+ a(this, "currency");
33
+ this.locale = n, this.currency = u;
34
+ }
35
+ toString() {
36
+ return new Intl.NumberFormat(this.locale, {
37
+ style: "currency",
38
+ currency: this.currency
39
+ }).format(this.value);
40
+ }
41
+ }
42
+ const f = "ja-JP";
43
+ class c extends o {
44
+ constructor(t, { locale: n = f } = {}) {
45
+ super(t);
46
+ a(this, "locale");
47
+ this.locale = n;
48
+ }
49
+ add(t) {
50
+ return new c(this.value + s(t));
51
+ }
52
+ subtract(t) {
53
+ return new c(this.value - s(t));
54
+ }
55
+ toString() {
56
+ return new Intl.NumberFormat(this.locale).format(this.value);
57
+ }
58
+ toPercentageString() {
59
+ return new Intl.NumberFormat(this.locale, {
60
+ style: "percent",
61
+ maximumSignificantDigits: 3
62
+ }).format(this.value);
63
+ }
64
+ }
65
+ export {
66
+ v as C,
67
+ c as N,
68
+ o as V,
69
+ s as g
70
+ };
@@ -0,0 +1,5 @@
1
+ import { C as a, N as u } from "./valueObjects-94fc347b.js";
2
+ export {
3
+ a as CurrencyValue,
4
+ u as NumberValue
5
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reni-corp/reni-2c-ui",
3
- "version": "0.2.10",
3
+ "version": "0.2.12",
4
4
  "type": "module",
5
5
  "main": "./dist/script.umd.js",
6
6
  "module": "./dist/index.es.js",
@@ -23,7 +23,7 @@
23
23
  ],
24
24
  "scripts": {
25
25
  "dev": "vite",
26
- "build": "npm run build:lib && npm run build:cdn",
26
+ "build": "npm run build:cdn && npm run build:lib",
27
27
  "build:lib": "BUILD_TARGET=lib vite build",
28
28
  "build:cdn": "BUILD_TARGET=cdn vite build",
29
29
  "preview": "vite preview",