@leaflink/stash 50.12.0 → 50.12.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Accordion.js +14 -14
- package/dist/ActionsDropdown.js +2 -2
- package/dist/AddressSelect.js +2 -2
- package/dist/Alert.js +6 -6
- package/dist/AppNavigationItem.js +8 -8
- package/dist/AppSidebar.js +8 -8
- package/dist/AppTopbar.js +3 -3
- package/dist/Avatar.js +3 -3
- package/dist/Backdrop.js +2 -2
- package/dist/Badge.js +2 -2
- package/dist/Box.js +1 -1
- package/dist/{Box.vue_vue_type_script_setup_true_lang-DgJHq-09.js → Box.vue_vue_type_script_setup_true_lang-rFnvwLVY.js} +3 -3
- package/dist/{Box.vue_vue_type_script_setup_true_lang-DgJHq-09.js.map → Box.vue_vue_type_script_setup_true_lang-rFnvwLVY.js.map} +1 -1
- package/dist/Button.js +3 -3
- package/dist/ButtonGroup.js +4 -4
- package/dist/Card.js +7 -7
- package/dist/CardContent.js +2 -2
- package/dist/CardFooter.js +2 -2
- package/dist/CardHeader.js +4 -4
- package/dist/CardMedia.js +6 -6
- package/dist/Carousel.js +33 -33
- package/dist/Carousel.js.map +1 -1
- package/dist/Checkbox.js +7 -7
- package/dist/ChevronToggle.js +1 -1
- package/dist/{ChevronToggle.vue_vue_type_script_setup_true_lang-DuvluoTi.js → ChevronToggle.vue_vue_type_script_setup_true_lang-Ce_qOXfR.js} +3 -3
- package/dist/{ChevronToggle.vue_vue_type_script_setup_true_lang-DuvluoTi.js.map → ChevronToggle.vue_vue_type_script_setup_true_lang-Ce_qOXfR.js.map} +1 -1
- package/dist/Chip.js +7 -7
- package/dist/ConfirmationCodeInput.js +6 -6
- package/dist/ContextSwitcher.js +1 -1
- package/dist/Copy.js +1 -1
- package/dist/CurrencyInput.js +115 -111
- package/dist/CurrencyInput.js.map +1 -1
- package/dist/DataView.js +3 -3
- package/dist/DataView.keys-aSOnA4AD.js.map +1 -1
- package/dist/DataViewFilters.js +3 -3
- package/dist/DataViewSortButton.js +10 -10
- package/dist/DataViewToolbar.js +1 -1
- package/dist/DatePicker.js +1080 -1037
- package/dist/DatePicker.js.map +1 -1
- package/dist/DescriptionList.js +2 -2
- package/dist/DescriptionListDetail.js +2 -2
- package/dist/DescriptionListGroup.js +2 -2
- package/dist/DescriptionListTerm.js +3 -3
- package/dist/Dialog.js +1 -1
- package/dist/Divider.js +2 -2
- package/dist/Dropdown.js +9 -9
- package/dist/EmptyState.js +2 -2
- package/dist/Expand.js +1 -1
- package/dist/{Expand.vue_vue_type_script_setup_true_lang-D0fSAtHr.js → Expand.vue_vue_type_script_setup_true_lang-CiONJfAp.js} +5 -5
- package/dist/{Expand.vue_vue_type_script_setup_true_lang-D0fSAtHr.js.map → Expand.vue_vue_type_script_setup_true_lang-CiONJfAp.js.map} +1 -1
- package/dist/Field.js +1 -1
- package/dist/{Field.vue_vue_type_script_setup_true_lang-DEizIcDo.js → Field.vue_vue_type_script_setup_true_lang-DRaKs9Lm.js} +6 -6
- package/dist/{Field.vue_vue_type_script_setup_true_lang-DEizIcDo.js.map → Field.vue_vue_type_script_setup_true_lang-DRaKs9Lm.js.map} +1 -1
- package/dist/FileUpload.js +7 -7
- package/dist/FilterChip.js +1 -1
- package/dist/FilterDrawerItem.js +9 -9
- package/dist/FilterDropdown.js +1 -1
- package/dist/FilterSelect.js +4 -4
- package/dist/Filters.js +18 -18
- package/dist/HttpError.js +9 -9
- package/dist/Icon.js +2 -2
- package/dist/IconLabel.js +2 -2
- package/dist/Illustration.js +2 -2
- package/dist/{Illustration.vue_vue_type_script_setup_true_lang-CYddAFtS.js → Illustration.vue_vue_type_script_setup_true_lang-BBqgoJO8.js} +3 -3
- package/dist/{Illustration.vue_vue_type_script_setup_true_lang-CYddAFtS.js.map → Illustration.vue_vue_type_script_setup_true_lang-BBqgoJO8.js.map} +1 -1
- package/dist/Image.js +2 -2
- package/dist/{Image.vue_vue_type_script_setup_true_lang-YUNunj71.js → Image.vue_vue_type_script_setup_true_lang-D5u4av0_.js} +3 -3
- package/dist/{Image.vue_vue_type_script_setup_true_lang-YUNunj71.js.map → Image.vue_vue_type_script_setup_true_lang-D5u4av0_.js.map} +1 -1
- package/dist/InlineEdit.js +5 -5
- package/dist/Input.js +2 -2
- package/dist/InputOptions.js +2 -2
- package/dist/IntegrationIcon.js +2 -2
- package/dist/Label.js +1 -1
- package/dist/{Label.vue_vue_type_script_setup_true_lang-C4JKdqvC.js → Label.vue_vue_type_script_setup_true_lang-DPnNUfc6.js} +3 -3
- package/dist/{Label.vue_vue_type_script_setup_true_lang-C4JKdqvC.js.map → Label.vue_vue_type_script_setup_true_lang-DPnNUfc6.js.map} +1 -1
- package/dist/LicenseChip.js +2 -2
- package/dist/ListItem.js +1 -1
- package/dist/ListItemCell.js +2 -2
- package/dist/ListView.js +11 -11
- package/dist/Loading.js +2 -2
- package/dist/Logo.js +1 -1
- package/dist/{Logo.vue_vue_type_script_setup_true_lang-BfUU9J9O.js → Logo.vue_vue_type_script_setup_true_lang-Dz8c98sc.js} +4 -4
- package/dist/{Logo.vue_vue_type_script_setup_true_lang-BfUU9J9O.js.map → Logo.vue_vue_type_script_setup_true_lang-Dz8c98sc.js.map} +1 -1
- package/dist/Menu.js +2 -2
- package/dist/MenuItem.js +2 -2
- package/dist/Metric.js +5 -5
- package/dist/Modal.js +20 -20
- package/dist/Modals.js +6 -6
- package/dist/Module.js +3 -3
- package/dist/ModuleContent.js +3 -3
- package/dist/ModuleFooter.js +2 -2
- package/dist/ModuleHeader.js +2 -2
- package/dist/ModuleHeader.js.map +1 -1
- package/dist/ObfuscateText.js +7 -7
- package/dist/PageContent.js +3 -3
- package/dist/PageHeader.js +6 -6
- package/dist/PageNavigation.js +1 -1
- package/dist/Paginate.js +6 -6
- package/dist/PlaidLink.js +2 -2
- package/dist/QuickAction.js +2 -2
- package/dist/Radio.js +2 -2
- package/dist/RadioGroup.js +2 -2
- package/dist/RadioNew.js +1 -1
- package/dist/RangeInput.js +2 -2
- package/dist/SearchBar.js +3 -3
- package/dist/Select.js +4 -4
- package/dist/Select.js.map +1 -1
- package/dist/SelectStatus.js +7 -7
- package/dist/Skeleton.js +4 -4
- package/dist/Step.js +6 -6
- package/dist/Stepper.js +9 -9
- package/dist/Switch.js +7 -7
- package/dist/Tab.js +4 -4
- package/dist/TabPanel.js +2 -2
- package/dist/Table.js +1 -1
- package/dist/TableCell.js +5 -5
- package/dist/TableHeaderCell.js +2 -2
- package/dist/TableHeaderRow.js +4 -4
- package/dist/TableRow.js +4 -4
- package/dist/TableRow.js.map +1 -1
- package/dist/TableRow.vue.d.ts +12 -8
- package/dist/Tabs.js +2 -2
- package/dist/{Tabs.vue_vue_type_script_setup_true_lang-NZm1OrRT.js → Tabs.vue_vue_type_script_setup_true_lang-CmnBP4i1.js} +4 -4
- package/dist/{Tabs.vue_vue_type_script_setup_true_lang-NZm1OrRT.js.map → Tabs.vue_vue_type_script_setup_true_lang-CmnBP4i1.js.map} +1 -1
- package/dist/TextEditor.js +3313 -3291
- package/dist/TextEditor.js.map +1 -1
- package/dist/Textarea.js +3 -3
- package/dist/Thumbnail.js +7 -7
- package/dist/Thumbnail.js.map +1 -1
- package/dist/ThumbnailEmpty.js +3 -3
- package/dist/ThumbnailGroup.js +6 -6
- package/dist/ThumbnailGroup.js.map +1 -1
- package/dist/{ThumbnailGroup.keys-D6WL5xQ5.js → ThumbnailGroup.keys-EJ4qFNhx.js} +2 -2
- package/dist/{ThumbnailGroup.keys-D6WL5xQ5.js.map → ThumbnailGroup.keys-EJ4qFNhx.js.map} +1 -1
- package/dist/Timeline.js +2 -2
- package/dist/TimelineItem.js +3 -3
- package/dist/Toast.js +277 -280
- package/dist/Toast.js.map +1 -1
- package/dist/Toasts.js +1 -1
- package/dist/Tooltip.js +1 -1
- package/dist/components.css +1 -1
- package/dist/{formatDateTime-C8CYECpd.js → formatDateTime-Dz8bXV0R.js} +98 -12
- package/dist/{formatDateTime-C8CYECpd.js.map → formatDateTime-Dz8bXV0R.js.map} +1 -1
- package/dist/index.js +2 -2
- package/dist/searchFuzzy-DRasJ33G.js +409 -0
- package/dist/{searchFuzzy-DKooyZM8.js.map → searchFuzzy-DRasJ33G.js.map} +1 -1
- package/dist/storage.js +3 -3
- package/dist/{toTimeZone-CVE1ZmsS.js → toTimeZone-Coq1oPTt.js} +7 -9
- package/dist/{toTimeZone-CVE1ZmsS.js.map → toTimeZone-Coq1oPTt.js.map} +1 -1
- package/dist/useSearch.js +1 -1
- package/dist/utils/formatDateTime.js +2 -2
- package/dist/utils/searchFuzzy.js +1 -1
- package/dist/utils/toTimeZone.js +1 -1
- package/package.json +16 -16
- package/dist/searchFuzzy-DKooyZM8.js +0 -407
package/dist/Chip.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as f, useCssModule as b,
|
|
1
|
+
import { defineComponent as f, useCssModule as b, createElementBlock as r, openBlock as d, normalizeClass as n, unref as a, renderSlot as u, createCommentVNode as v, withModifiers as m, withKeys as _, createVNode as w } from "vue";
|
|
2
2
|
import C from "./utils/colorScheme.js";
|
|
3
3
|
import y from "./Icon.js";
|
|
4
4
|
import { _ as $ } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
@@ -32,7 +32,7 @@ const z = ["disabled"], k = /* @__PURE__ */ f({
|
|
|
32
32
|
"tw-bg-ice-500 tw-text-white": e.disabled
|
|
33
33
|
};
|
|
34
34
|
}
|
|
35
|
-
return (o, t) => (
|
|
35
|
+
return (o, t) => (d(), r("span", {
|
|
36
36
|
class: n(["stash-chip tw-relative tw-inline-flex tw-items-center", [
|
|
37
37
|
`stash-chip--radius-${e.radius}`,
|
|
38
38
|
`stash-chip--size-${e.size}`,
|
|
@@ -45,27 +45,27 @@ const z = ["disabled"], k = /* @__PURE__ */ f({
|
|
|
45
45
|
"data-test": "stash-chip",
|
|
46
46
|
onClick: t[2] || (t[2] = (l) => i("click"))
|
|
47
47
|
}, [
|
|
48
|
-
o.isRemovable ? (
|
|
48
|
+
o.isRemovable ? (d(), r("span", {
|
|
49
49
|
key: 0,
|
|
50
50
|
class: n([{ "tw-mr-6 tw-truncate": e.isRemovable }])
|
|
51
51
|
}, [
|
|
52
52
|
u(o.$slots, "default")
|
|
53
53
|
], 2)) : u(o.$slots, "default", { key: 1 }),
|
|
54
|
-
e.isRemovable ? (
|
|
54
|
+
e.isRemovable ? (d(), r("button", {
|
|
55
55
|
key: 2,
|
|
56
56
|
tabindex: "-1",
|
|
57
57
|
class: n(["stash-chip__remove-button", ["tw-absolute", a(s)["remove-button"]]]),
|
|
58
58
|
"data-test": "stash-chip|remove-button",
|
|
59
59
|
disabled: e.disabled,
|
|
60
|
-
onKeypress: t[0] || (t[0] =
|
|
60
|
+
onKeypress: t[0] || (t[0] = _(m((l) => i("remove"), ["prevent"]), ["enter"])),
|
|
61
61
|
onMousedown: t[1] || (t[1] = m((l) => i("remove"), ["prevent", "stop"]))
|
|
62
62
|
}, [
|
|
63
|
-
|
|
63
|
+
w(y, {
|
|
64
64
|
"data-test": "icon|close",
|
|
65
65
|
name: "close",
|
|
66
66
|
size: "small"
|
|
67
67
|
})
|
|
68
|
-
], 42, z)) :
|
|
68
|
+
], 42, z)) : v("", !0)
|
|
69
69
|
], 2));
|
|
70
70
|
}
|
|
71
71
|
}), x = "_root_1u8h2_2", g = {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as I, useCssVars as v, useCssModule as E, ref as V, onMounted as B, watch as P,
|
|
1
|
+
import { defineComponent as I, useCssVars as v, useCssModule as E, ref as V, onMounted as B, watch as P, createElementBlock as a, openBlock as r, normalizeClass as x, unref as l, createElementVNode as z, createCommentVNode as p, Fragment as A, renderList as M, toDisplayString as f } from "vue";
|
|
2
2
|
import { _ as F } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
3
3
|
const K = { class: "tw-mb-3 tw-flex tw-gap-6" }, S = ["value", "onInput"], U = {
|
|
4
4
|
key: 0,
|
|
@@ -103,12 +103,12 @@ const K = { class: "tw-mb-3 tw-flex tw-gap-6" }, S = ["value", "onInput"], U = {
|
|
|
103
103
|
(t) => {
|
|
104
104
|
s.value = t ? t.split("") : new Array(o.digitCount);
|
|
105
105
|
}
|
|
106
|
-
), (t, e) => (
|
|
106
|
+
), (t, e) => (r(), a("div", {
|
|
107
107
|
class: x(["stash-confirmation-code-input tw-inline-block", [l(c)["stash-confirmation-code-input-container"]]]),
|
|
108
108
|
"data-test": "stash-confirmation-code-input"
|
|
109
109
|
}, [
|
|
110
110
|
z("div", K, [
|
|
111
|
-
(
|
|
111
|
+
(r(!0), a(A, null, M(o.digitCount, (n) => (r(), a("input", {
|
|
112
112
|
key: n,
|
|
113
113
|
"data-test": "stash-confirmation-code-input__otp",
|
|
114
114
|
class: x(["tw-border tw-bg-white tw-p-2 tw-text-center tw-text-base tw-font-medium tw-text-ice-900 focus:tw-border-blue-500", [
|
|
@@ -129,9 +129,9 @@ const K = { class: "tw-mb-3 tw-flex tw-gap-6" }, S = ["value", "onInput"], U = {
|
|
|
129
129
|
onBlur: y
|
|
130
130
|
}, null, 42, S))), 128))
|
|
131
131
|
]),
|
|
132
|
-
o.errorText ? (
|
|
133
|
-
o.successText ? (
|
|
134
|
-
o.hintText ? (
|
|
132
|
+
o.errorText ? (r(), a("small", U, f(o.errorText), 1)) : p("", !0),
|
|
133
|
+
o.successText ? (r(), a("small", j, f(o.successText), 1)) : p("", !0),
|
|
134
|
+
o.hintText ? (r(), a("small", L, f(o.hintText), 1)) : p("", !0)
|
|
135
135
|
], 2));
|
|
136
136
|
}
|
|
137
137
|
}), $ = {
|
package/dist/ContextSwitcher.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as _, computed as C, resolveComponent as g,
|
|
1
|
+
import { defineComponent as _, computed as C, resolveComponent as g, createElementBlock as l, openBlock as s, Fragment as u, renderList as x, createBlock as E, normalizeClass as d, toDisplayString as f, withCtx as S, createTextVNode as b } from "vue";
|
|
2
2
|
import { APPS as a } from "./constants.js";
|
|
3
3
|
import { setPersistentItem as T, getPersistentItem as v, removePersistentItem as R } from "./utils/storage.js";
|
|
4
4
|
const N = {
|
package/dist/Copy.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as m, useCssModule as _, ref as f, computed as h,
|
|
1
|
+
import { defineComponent as m, useCssModule as _, ref as f, computed as h, createElementBlock as p, openBlock as e, normalizeClass as i, unref as s, renderSlot as v, withDirectives as x, createBlock as c, withCtx as C, createTextVNode as k, toDisplayString as w } from "vue";
|
|
2
2
|
import { UI_TIMEOUT as T } from "./constants.js";
|
|
3
3
|
import b from "./directives/tooltip.js";
|
|
4
4
|
import { t as n } from "./locale.js";
|
package/dist/CurrencyInput.js
CHANGED
|
@@ -1,47 +1,47 @@
|
|
|
1
|
-
import { ref as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
1
|
+
import { ref as D, getCurrentInstance as R, version as P, computed as O, watch as S, defineComponent as C, useAttrs as M, createBlock as $, openBlock as A, mergeProps as L, withCtx as T, createVNode as G } from "vue";
|
|
2
|
+
import w from "lodash-es/isEmpty";
|
|
3
|
+
import k from "./Icon.js";
|
|
4
|
+
import B from "./Input.js";
|
|
5
5
|
/**
|
|
6
6
|
* Vue Currency Input 3.1.0
|
|
7
7
|
* (c) 2018-2024 Matthias Stiller
|
|
8
8
|
* @license MIT
|
|
9
9
|
*/
|
|
10
|
+
var y;
|
|
11
|
+
(function(r) {
|
|
12
|
+
r.symbol = "symbol", r.narrowSymbol = "narrowSymbol", r.code = "code", r.name = "name", r.hidden = "hidden";
|
|
13
|
+
})(y || (y = {}));
|
|
10
14
|
var v;
|
|
11
|
-
(function(
|
|
12
|
-
|
|
15
|
+
(function(r) {
|
|
16
|
+
r.precision = "precision", r.thousands = "thousands", r.millions = "millions", r.billions = "billions";
|
|
13
17
|
})(v || (v = {}));
|
|
14
|
-
|
|
15
|
-
(function(s) {
|
|
16
|
-
s.precision = "precision", s.thousands = "thousands", s.millions = "millions", s.billions = "billions";
|
|
17
|
-
})(F || (F = {}));
|
|
18
|
-
const D = (s) => s.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), N = (s) => s.replace(/^0+(0$|[^0])/, "$1"), O = (s, i) => (s.match(new RegExp(D(i), "g")) || []).length, j = (s, i) => s.substring(0, s.indexOf(i)), R = [
|
|
18
|
+
const x = (r) => r.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), I = (r) => r.replace(/^0+(0$|[^0])/, "$1"), V = (r, i) => (r.match(new RegExp(x(i), "g")) || []).length, W = (r, i) => r.substring(0, r.indexOf(i)), _ = [
|
|
19
19
|
",",
|
|
20
20
|
".",
|
|
21
21
|
"٫",
|
|
22
22
|
"。"
|
|
23
|
-
],
|
|
24
|
-
class
|
|
23
|
+
], E = "(0|[1-9]\\d*)";
|
|
24
|
+
class z {
|
|
25
25
|
constructor(i) {
|
|
26
|
-
var t, e, n, d, a,
|
|
27
|
-
const { currency: m, currencyDisplay:
|
|
28
|
-
this.locale =
|
|
26
|
+
var t, e, n, d, a, l;
|
|
27
|
+
const { currency: m, currencyDisplay: g, locale: o, precision: u, accountingSign: h, useGrouping: c } = i;
|
|
28
|
+
this.locale = o, this.options = {
|
|
29
29
|
currency: m,
|
|
30
|
-
useGrouping:
|
|
30
|
+
useGrouping: c,
|
|
31
31
|
style: "currency",
|
|
32
32
|
currencySign: h ? "accounting" : void 0,
|
|
33
|
-
currencyDisplay:
|
|
33
|
+
currencyDisplay: g !== y.hidden ? g : void 0
|
|
34
34
|
};
|
|
35
|
-
const
|
|
36
|
-
this.currency = (t =
|
|
37
|
-
const
|
|
38
|
-
this.prefix =
|
|
35
|
+
const s = new Intl.NumberFormat(o, this.options), f = s.formatToParts(123456);
|
|
36
|
+
this.currency = (t = f.find(({ type: p }) => p === "currency")) === null || t === void 0 ? void 0 : t.value, this.digits = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9].map((p) => p.toLocaleString(o)), this.decimalSymbol = (e = f.find(({ type: p }) => p === "decimal")) === null || e === void 0 ? void 0 : e.value, this.groupingSymbol = (n = f.find(({ type: p }) => p === "group")) === null || n === void 0 ? void 0 : n.value, this.minusSign = (d = s.formatToParts(-1).find(({ type: p }) => p === "minusSign")) === null || d === void 0 ? void 0 : d.value, this.decimalSymbol === void 0 ? this.minimumFractionDigits = this.maximumFractionDigits = 0 : typeof u == "number" ? this.minimumFractionDigits = this.maximumFractionDigits = u : (this.minimumFractionDigits = (a = u == null ? void 0 : u.min) !== null && a !== void 0 ? a : s.resolvedOptions().minimumFractionDigits, this.maximumFractionDigits = (l = u == null ? void 0 : u.max) !== null && l !== void 0 ? l : s.resolvedOptions().maximumFractionDigits);
|
|
37
|
+
const b = (p) => W(p, this.digits[1]), F = (p) => p.substring(p.lastIndexOf(this.decimalSymbol ? this.digits[0] : this.digits[1]) + 1);
|
|
38
|
+
this.prefix = b(s.format(1)), this.suffix = F(s.format(1)), this.negativePrefix = b(s.format(-1)), this.negativeSuffix = F(s.format(-1));
|
|
39
39
|
}
|
|
40
40
|
parse(i) {
|
|
41
41
|
if (i) {
|
|
42
42
|
const t = this.isNegative(i);
|
|
43
43
|
i = this.normalizeDigits(i), i = this.stripCurrency(i, t), i = this.stripSignLiterals(i);
|
|
44
|
-
const e = this.decimalSymbol ? `(?:${
|
|
44
|
+
const e = this.decimalSymbol ? `(?:${x(this.decimalSymbol)}(\\d*))?` : "", n = this.stripGroupingSeparator(i).match(new RegExp(`^${E}${e}$`));
|
|
45
45
|
if (n && this.isValidIntegerFormat(this.decimalSymbol ? i.split(this.decimalSymbol)[0] : i, Number(n[1])))
|
|
46
46
|
return +`${t ? "-" : ""}${this.onlyDigits(n[1])}.${this.onlyDigits(n[2] || "")}`;
|
|
47
47
|
}
|
|
@@ -64,7 +64,7 @@ class X {
|
|
|
64
64
|
return `${this.digits[0]}${this.decimalSymbol}${this.onlyLocaleDigits(i.substring(1)).substring(0, this.maximumFractionDigits)}`;
|
|
65
65
|
}
|
|
66
66
|
isFractionIncomplete(i) {
|
|
67
|
-
return !!this.normalizeDigits(this.stripGroupingSeparator(i)).match(new RegExp(`^${
|
|
67
|
+
return !!this.normalizeDigits(this.stripGroupingSeparator(i)).match(new RegExp(`^${E}${x(this.decimalSymbol)}$`));
|
|
68
68
|
}
|
|
69
69
|
isNegative(i) {
|
|
70
70
|
return i.startsWith(this.negativePrefix) || this.minusSign === void 0 && (i.startsWith("(") || i.startsWith("-")) || this.minusSign !== void 0 && i.replace("-", this.minusSign).startsWith(this.minusSign);
|
|
@@ -73,7 +73,7 @@ class X {
|
|
|
73
73
|
return `${t ? this.negativePrefix : this.prefix}${i}${t ? this.negativeSuffix : this.suffix}`;
|
|
74
74
|
}
|
|
75
75
|
stripGroupingSeparator(i) {
|
|
76
|
-
return this.groupingSymbol !== void 0 ? i.replace(new RegExp(
|
|
76
|
+
return this.groupingSymbol !== void 0 ? i.replace(new RegExp(x(this.groupingSymbol), "g"), "") : i;
|
|
77
77
|
}
|
|
78
78
|
stripSignLiterals(i) {
|
|
79
79
|
return this.minusSign !== void 0 ? i.replace("-", this.minusSign).replace(this.minusSign, "") : i.replace(/[-()]/g, "");
|
|
@@ -82,7 +82,7 @@ class X {
|
|
|
82
82
|
return i.replace(t ? this.negativePrefix : this.prefix, "").replace(t ? this.negativeSuffix : this.suffix, "");
|
|
83
83
|
}
|
|
84
84
|
normalizeDecimalSeparator(i, t) {
|
|
85
|
-
return
|
|
85
|
+
return _.forEach((e) => {
|
|
86
86
|
i = i.substring(0, t) + i.substring(t).replace(e, this.decimalSymbol);
|
|
87
87
|
}), i;
|
|
88
88
|
}
|
|
@@ -98,48 +98,48 @@ class X {
|
|
|
98
98
|
return i.replace(new RegExp(`[^${this.digits.join("")}]*`, "g"), "");
|
|
99
99
|
}
|
|
100
100
|
}
|
|
101
|
-
class
|
|
101
|
+
class N {
|
|
102
102
|
constructor(i) {
|
|
103
103
|
this.currencyFormat = i;
|
|
104
104
|
}
|
|
105
105
|
}
|
|
106
|
-
class
|
|
106
|
+
class j extends N {
|
|
107
107
|
conformToMask(i, t = "") {
|
|
108
|
-
const e = this.currencyFormat.isNegative(i), n = (
|
|
109
|
-
if (n(
|
|
108
|
+
const e = this.currencyFormat.isNegative(i), n = (s) => s === "" && e && !(this.currencyFormat.minusSign === void 0 ? t === this.currencyFormat.negativePrefix + this.currencyFormat.negativeSuffix : t === this.currencyFormat.negativePrefix), d = (s) => {
|
|
109
|
+
if (n(s))
|
|
110
110
|
return "";
|
|
111
111
|
if (this.currencyFormat.maximumFractionDigits > 0) {
|
|
112
|
-
if (this.currencyFormat.isFractionIncomplete(
|
|
113
|
-
return
|
|
114
|
-
if (
|
|
115
|
-
return this.currencyFormat.toFraction(
|
|
112
|
+
if (this.currencyFormat.isFractionIncomplete(s))
|
|
113
|
+
return s;
|
|
114
|
+
if (s.startsWith(this.currencyFormat.decimalSymbol))
|
|
115
|
+
return this.currencyFormat.toFraction(s);
|
|
116
116
|
}
|
|
117
117
|
return null;
|
|
118
118
|
};
|
|
119
119
|
let a = i;
|
|
120
120
|
a = this.currencyFormat.stripCurrency(a, e), a = this.currencyFormat.stripSignLiterals(a);
|
|
121
|
-
const
|
|
122
|
-
if (
|
|
123
|
-
return this.currencyFormat.insertCurrency(
|
|
124
|
-
const [m, ...
|
|
125
|
-
return h ||
|
|
126
|
-
numberValue: +`${e ? "-" : ""}${
|
|
121
|
+
const l = d(a);
|
|
122
|
+
if (l != null)
|
|
123
|
+
return this.currencyFormat.insertCurrency(l, e);
|
|
124
|
+
const [m, ...g] = a.split(this.currencyFormat.decimalSymbol), o = I(this.currencyFormat.onlyDigits(m)), u = this.currencyFormat.onlyDigits(g.join("")).substring(0, this.currencyFormat.maximumFractionDigits), h = g.length > 0 && u.length === 0, c = o === "" && e && (this.currencyFormat.minusSign === void 0 ? t === i.slice(0, -2) + this.currencyFormat.negativeSuffix : t === i.slice(0, -1));
|
|
125
|
+
return h || c || n(o) ? t : o.match(/\d+/) ? {
|
|
126
|
+
numberValue: +`${e ? "-" : ""}${o}.${u}`,
|
|
127
127
|
fractionDigits: u
|
|
128
128
|
} : "";
|
|
129
129
|
}
|
|
130
130
|
}
|
|
131
|
-
class
|
|
131
|
+
class X extends N {
|
|
132
132
|
conformToMask(i, t = "") {
|
|
133
133
|
if (i === "" || this.currencyFormat.parse(t) === 0 && this.currencyFormat.stripCurrency(t, !0).slice(0, -1) === this.currencyFormat.stripCurrency(i, !0))
|
|
134
134
|
return "";
|
|
135
|
-
const e = this.currencyFormat.isNegative(i), n = this.currencyFormat.stripSignLiterals(i) === "" ? -0 : +`${e ? "-" : ""}${
|
|
135
|
+
const e = this.currencyFormat.isNegative(i), n = this.currencyFormat.stripSignLiterals(i) === "" ? -0 : +`${e ? "-" : ""}${I(this.currencyFormat.onlyDigits(i))}` / Math.pow(10, this.currencyFormat.maximumFractionDigits);
|
|
136
136
|
return {
|
|
137
137
|
numberValue: n,
|
|
138
138
|
fractionDigits: n.toFixed(this.currencyFormat.maximumFractionDigits).slice(-this.currencyFormat.maximumFractionDigits)
|
|
139
139
|
};
|
|
140
140
|
}
|
|
141
141
|
}
|
|
142
|
-
const
|
|
142
|
+
const U = {
|
|
143
143
|
locale: void 0,
|
|
144
144
|
currency: void 0,
|
|
145
145
|
currencyDisplay: void 0,
|
|
@@ -152,7 +152,7 @@ const Y = {
|
|
|
152
152
|
useGrouping: void 0,
|
|
153
153
|
valueScaling: void 0
|
|
154
154
|
};
|
|
155
|
-
class
|
|
155
|
+
class q {
|
|
156
156
|
constructor(i) {
|
|
157
157
|
this.el = i.el, this.onInput = i.onInput, this.onChange = i.onChange, this.addEventListener(), this.init(i.options);
|
|
158
158
|
}
|
|
@@ -168,16 +168,16 @@ class Z {
|
|
|
168
168
|
}
|
|
169
169
|
init(i) {
|
|
170
170
|
this.options = {
|
|
171
|
-
...
|
|
171
|
+
...U,
|
|
172
172
|
...i
|
|
173
|
-
}, this.options.autoDecimalDigits && (this.options.hideNegligibleDecimalDigitsOnFocus = !1), this.el.getAttribute("inputmode") || this.el.setAttribute("inputmode", this.options.autoDecimalDigits ? "numeric" : "decimal"), this.currencyFormat = new
|
|
173
|
+
}, this.options.autoDecimalDigits && (this.options.hideNegligibleDecimalDigitsOnFocus = !1), this.el.getAttribute("inputmode") || this.el.setAttribute("inputmode", this.options.autoDecimalDigits ? "numeric" : "decimal"), this.currencyFormat = new z(this.options), this.numberMask = this.options.autoDecimalDigits ? new X(this.currencyFormat) : new j(this.currencyFormat);
|
|
174
174
|
const t = {
|
|
175
|
-
[
|
|
176
|
-
[
|
|
177
|
-
[
|
|
178
|
-
[
|
|
175
|
+
[v.precision]: this.currencyFormat.maximumFractionDigits,
|
|
176
|
+
[v.thousands]: 3,
|
|
177
|
+
[v.millions]: 6,
|
|
178
|
+
[v.billions]: 9
|
|
179
179
|
};
|
|
180
|
-
this.valueScaling = this.options.valueScaling ? t[this.options.valueScaling] : void 0, this.valueScalingFractionDigits = this.valueScaling !== void 0 && this.options.valueScaling !==
|
|
180
|
+
this.valueScaling = this.options.valueScaling ? t[this.options.valueScaling] : void 0, this.valueScalingFractionDigits = this.valueScaling !== void 0 && this.options.valueScaling !== v.precision ? this.valueScaling + this.currencyFormat.maximumFractionDigits : this.currencyFormat.maximumFractionDigits, this.minValue = this.getMinValue(), this.maxValue = this.getMaxValue();
|
|
181
181
|
}
|
|
182
182
|
getMinValue() {
|
|
183
183
|
var i, t;
|
|
@@ -205,15 +205,15 @@ class Z {
|
|
|
205
205
|
let n;
|
|
206
206
|
if (typeof e == "object") {
|
|
207
207
|
const { numberValue: d, fractionDigits: a } = e;
|
|
208
|
-
let { maximumFractionDigits:
|
|
209
|
-
this.focus ? m = t ? a.replace(/0+$/, "").length : Math.min(
|
|
208
|
+
let { maximumFractionDigits: l, minimumFractionDigits: m } = this.currencyFormat;
|
|
209
|
+
this.focus ? m = t ? a.replace(/0+$/, "").length : Math.min(l, a.length) : Number.isInteger(d) && !this.options.autoDecimalDigits && (this.options.precision === void 0 || m === 0) && (m = l = 0), n = this.toInteger(Math.abs(d)) > Number.MAX_SAFE_INTEGER ? this.formattedValue : this.currencyFormat.format(d, {
|
|
210
210
|
useGrouping: this.options.useGrouping !== !1 && !(this.focus && this.options.hideGroupingSeparatorOnFocus),
|
|
211
211
|
minimumFractionDigits: m,
|
|
212
|
-
maximumFractionDigits:
|
|
212
|
+
maximumFractionDigits: l
|
|
213
213
|
});
|
|
214
214
|
} else
|
|
215
215
|
n = e;
|
|
216
|
-
this.maxValue <= 0 && !this.currencyFormat.isNegative(n) && this.currencyFormat.parse(n) !== 0 && (n = n.replace(this.currencyFormat.prefix, this.currencyFormat.negativePrefix)), this.minValue >= 0 && (n = n.replace(this.currencyFormat.negativePrefix, this.currencyFormat.prefix)), (this.options.currencyDisplay ===
|
|
216
|
+
this.maxValue <= 0 && !this.currencyFormat.isNegative(n) && this.currencyFormat.parse(n) !== 0 && (n = n.replace(this.currencyFormat.prefix, this.currencyFormat.negativePrefix)), this.minValue >= 0 && (n = n.replace(this.currencyFormat.negativePrefix, this.currencyFormat.prefix)), (this.options.currencyDisplay === y.hidden || this.focus && this.options.hideCurrencySymbolOnFocus) && (n = n.replace(this.currencyFormat.negativePrefix, this.currencyFormat.minusSign !== void 0 ? this.currencyFormat.minusSign : "(").replace(this.currencyFormat.negativeSuffix, this.currencyFormat.minusSign !== void 0 ? "" : ")").replace(this.currencyFormat.prefix, "").replace(this.currencyFormat.suffix, "")), this.el.value = n, this.numberValue = this.currencyFormat.parse(n);
|
|
217
217
|
} else
|
|
218
218
|
this.el.value = "", this.numberValue = null;
|
|
219
219
|
this.formattedValue = this.el.value, this.onInput(this.getValue());
|
|
@@ -221,24 +221,24 @@ class Z {
|
|
|
221
221
|
addEventListener() {
|
|
222
222
|
this.el.addEventListener("input", (i) => {
|
|
223
223
|
const { value: t, selectionStart: e } = this.el, n = i;
|
|
224
|
-
if (e && n.data &&
|
|
224
|
+
if (e && n.data && _.includes(n.data) && (this.decimalSymbolInsertedAt = e - 1), this.format(t), this.focus && e != null) {
|
|
225
225
|
const d = () => {
|
|
226
|
-
const { prefix: a, suffix:
|
|
226
|
+
const { prefix: a, suffix: l, decimalSymbol: m, maximumFractionDigits: g, groupingSymbol: o } = this.currencyFormat;
|
|
227
227
|
let u = t.length - e;
|
|
228
228
|
const h = this.formattedValue.length;
|
|
229
229
|
if (this.currencyFormat.minusSign === void 0 && (t.startsWith("(") || t.startsWith("-")) && !t.endsWith(")"))
|
|
230
230
|
return h - this.currencyFormat.negativeSuffix.length > 1 ? this.formattedValue.substring(e).length : 1;
|
|
231
|
-
if (this.formattedValue.substring(e, 1) ===
|
|
231
|
+
if (this.formattedValue.substring(e, 1) === o && V(this.formattedValue, o) === V(t, o) + 1)
|
|
232
232
|
return h - u - 1;
|
|
233
233
|
if (h < u)
|
|
234
234
|
return e;
|
|
235
235
|
if (m !== void 0 && t.indexOf(m) !== -1) {
|
|
236
|
-
const
|
|
237
|
-
if (Math.abs(h - t.length) > 1 && e <=
|
|
236
|
+
const c = t.indexOf(m) + 1;
|
|
237
|
+
if (Math.abs(h - t.length) > 1 && e <= c)
|
|
238
238
|
return this.formattedValue.indexOf(m) + 1;
|
|
239
|
-
!this.options.autoDecimalDigits && e >
|
|
239
|
+
!this.options.autoDecimalDigits && e > c && this.currencyFormat.onlyDigits(t.substring(c)).length - 1 === g && (u -= 1);
|
|
240
240
|
}
|
|
241
|
-
return this.options.hideCurrencySymbolOnFocus || this.options.currencyDisplay ===
|
|
241
|
+
return this.options.hideCurrencySymbolOnFocus || this.options.currencyDisplay === y.hidden ? h - u : Math.max(h - Math.max(u, l.length), a.length);
|
|
242
242
|
};
|
|
243
243
|
this.setCaretPosition(d());
|
|
244
244
|
}
|
|
@@ -259,57 +259,61 @@ class Z {
|
|
|
259
259
|
getCaretPositionOnFocus(i, t) {
|
|
260
260
|
if (this.numberValue == null)
|
|
261
261
|
return t;
|
|
262
|
-
const { prefix: e, negativePrefix: n, suffix: d, negativeSuffix: a, groupingSymbol:
|
|
263
|
-
if (this.options.hideCurrencySymbolOnFocus || this.options.currencyDisplay ===
|
|
264
|
-
if (
|
|
262
|
+
const { prefix: e, negativePrefix: n, suffix: d, negativeSuffix: a, groupingSymbol: l, currency: m } = this.currencyFormat, g = this.numberValue < 0, o = g ? n : e, u = o.length;
|
|
263
|
+
if (this.options.hideCurrencySymbolOnFocus || this.options.currencyDisplay === y.hidden) {
|
|
264
|
+
if (g) {
|
|
265
265
|
if (t <= 1)
|
|
266
266
|
return 1;
|
|
267
267
|
if (i.endsWith(")") && t > i.indexOf(")"))
|
|
268
268
|
return this.formattedValue.length - 1;
|
|
269
269
|
}
|
|
270
270
|
} else {
|
|
271
|
-
const
|
|
272
|
-
if (t >= i.length -
|
|
273
|
-
return this.formattedValue.length -
|
|
271
|
+
const c = g ? a.length : d.length;
|
|
272
|
+
if (t >= i.length - c)
|
|
273
|
+
return this.formattedValue.length - c;
|
|
274
274
|
if (t < u)
|
|
275
275
|
return u;
|
|
276
276
|
}
|
|
277
277
|
let h = t;
|
|
278
|
-
return this.options.hideCurrencySymbolOnFocus && this.options.currencyDisplay !==
|
|
278
|
+
return this.options.hideCurrencySymbolOnFocus && this.options.currencyDisplay !== y.hidden && t >= u && m !== void 0 && o.includes(m) && (h -= u, g && (h += 1)), this.options.hideGroupingSeparatorOnFocus && l !== void 0 && (h -= V(i.substring(0, t), l)), h;
|
|
279
279
|
}
|
|
280
280
|
setCaretPosition(i, t = i) {
|
|
281
281
|
this.el.setSelectionRange(i, t);
|
|
282
282
|
}
|
|
283
283
|
}
|
|
284
|
-
const
|
|
285
|
-
function
|
|
284
|
+
const Y = (r) => r != null && r.matches("input") ? r : r == null ? void 0 : r.querySelector("input");
|
|
285
|
+
function Z(r, i) {
|
|
286
286
|
var t, e, n, d;
|
|
287
287
|
let a;
|
|
288
|
-
const
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
288
|
+
const l = D(null), m = D(null), g = D(null), o = R();
|
|
289
|
+
o != null && o.emit || ((e = (t = o == null ? void 0 : o.proxy) === null || t === void 0 ? void 0 : t.$emit) === null || e === void 0 || e.bind(o == null ? void 0 : o.proxy));
|
|
290
|
+
const u = (o == null ? void 0 : o.props) || ((n = o == null ? void 0 : o.proxy) === null || n === void 0 ? void 0 : n.$props), h = P.startsWith("3");
|
|
291
|
+
h && ((d = o == null ? void 0 : o.attrs.modelModifiers) === null || d === void 0 || d.lazy);
|
|
292
|
+
const c = O(() => u == null ? void 0 : u[h ? "modelValue" : "value"]);
|
|
293
|
+
return S(l, (s) => {
|
|
294
|
+
var f;
|
|
295
|
+
if (s) {
|
|
296
|
+
const b = Y((f = s == null ? void 0 : s.$el) !== null && f !== void 0 ? f : s);
|
|
297
|
+
b ? (a = new q({
|
|
298
|
+
el: b,
|
|
299
|
+
options: r,
|
|
300
|
+
onInput: (F) => {
|
|
301
|
+
g.value = F.number, m.value = F.formatted;
|
|
298
302
|
},
|
|
299
|
-
onChange: (
|
|
303
|
+
onChange: (F) => {
|
|
300
304
|
}
|
|
301
|
-
}), a.setValue(
|
|
305
|
+
}), a.setValue(c.value)) : console.error('No input element found. Please make sure that the "inputRef" template ref is properly assigned.');
|
|
302
306
|
} else
|
|
303
307
|
a = null;
|
|
304
308
|
}), {
|
|
305
|
-
inputRef:
|
|
306
|
-
numberValue:
|
|
309
|
+
inputRef: l,
|
|
310
|
+
numberValue: g,
|
|
307
311
|
formattedValue: m,
|
|
308
|
-
setValue: (
|
|
309
|
-
setOptions: (
|
|
312
|
+
setValue: (s) => a == null ? void 0 : a.setValue(s),
|
|
313
|
+
setOptions: (s) => a == null ? void 0 : a.setOptions(s)
|
|
310
314
|
};
|
|
311
315
|
}
|
|
312
|
-
const
|
|
316
|
+
const ii = /* @__PURE__ */ C({
|
|
313
317
|
__name: "CurrencyInput",
|
|
314
318
|
props: {
|
|
315
319
|
inputOptions: { default: void 0 },
|
|
@@ -331,10 +335,10 @@ const ei = /* @__PURE__ */ $({
|
|
|
331
335
|
disabled: { type: Boolean }
|
|
332
336
|
},
|
|
333
337
|
emits: ["update:model-value"],
|
|
334
|
-
setup(
|
|
338
|
+
setup(r, { expose: i, emit: t }) {
|
|
335
339
|
const e = {
|
|
336
340
|
currency: "USD",
|
|
337
|
-
currencyDisplay:
|
|
341
|
+
currencyDisplay: y.hidden,
|
|
338
342
|
precision: 2,
|
|
339
343
|
hideCurrencySymbolOnFocus: !0,
|
|
340
344
|
hideGroupingSeparatorOnFocus: !0,
|
|
@@ -342,34 +346,34 @@ const ei = /* @__PURE__ */ $({
|
|
|
342
346
|
autoDecimalDigits: !0,
|
|
343
347
|
useGrouping: !0,
|
|
344
348
|
accountingSign: !1
|
|
345
|
-
}, n =
|
|
349
|
+
}, n = r, d = t, a = M(), l = O(() => ({
|
|
346
350
|
...e,
|
|
347
|
-
...
|
|
348
|
-
})), { inputRef: m, setOptions:
|
|
349
|
-
i({ inputEl: m }),
|
|
351
|
+
...w(n.inputOptions) ? {} : n.inputOptions
|
|
352
|
+
})), { inputRef: m, setOptions: g, setValue: o, numberValue: u } = Z(l.value);
|
|
353
|
+
i({ inputEl: m }), S(
|
|
350
354
|
() => u.value,
|
|
351
|
-
(
|
|
352
|
-
var
|
|
353
|
-
let
|
|
354
|
-
Object.is(
|
|
355
|
+
(c) => {
|
|
356
|
+
var f;
|
|
357
|
+
let s;
|
|
358
|
+
Object.is(c, -0) ? typeof l.value.precision == "number" ? s = "-0." + "0".repeat(l.value.precision) : s = "-0." + "0".repeat(((f = l.value.precision) == null ? void 0 : f.min) || 0) : s = typeof c == "number" ? c.toFixed(2) : c, d("update:model-value", s);
|
|
355
359
|
}
|
|
356
|
-
),
|
|
360
|
+
), S(
|
|
357
361
|
() => n.modelValue,
|
|
358
|
-
(
|
|
359
|
-
let
|
|
360
|
-
typeof
|
|
362
|
+
(c) => {
|
|
363
|
+
let s;
|
|
364
|
+
typeof c == "string" ? s = parseFloat(c || "0") : s = c, o(s);
|
|
361
365
|
}
|
|
362
|
-
),
|
|
366
|
+
), S(
|
|
363
367
|
() => n.inputOptions,
|
|
364
368
|
() => {
|
|
365
|
-
|
|
369
|
+
g(l.value);
|
|
366
370
|
}
|
|
367
371
|
);
|
|
368
|
-
const h =
|
|
369
|
-
const { inputOptions:
|
|
370
|
-
return { ...
|
|
372
|
+
const h = O(() => {
|
|
373
|
+
const { inputOptions: c, ...s } = n;
|
|
374
|
+
return { ...s, ...a };
|
|
371
375
|
});
|
|
372
|
-
return (
|
|
376
|
+
return (c, s) => (A(), $(B, L(h.value, {
|
|
373
377
|
ref_key: "inputEl",
|
|
374
378
|
ref: m,
|
|
375
379
|
class: "stash-currency-input",
|
|
@@ -377,14 +381,14 @@ const ei = /* @__PURE__ */ $({
|
|
|
377
381
|
"data-test": "stash-currency-input",
|
|
378
382
|
inputmode: "decimal"
|
|
379
383
|
}), {
|
|
380
|
-
prepend:
|
|
381
|
-
k
|
|
384
|
+
prepend: T(() => [
|
|
385
|
+
G(k, { name: "sign-dollar" })
|
|
382
386
|
]),
|
|
383
387
|
_: 1
|
|
384
388
|
}, 16));
|
|
385
389
|
}
|
|
386
390
|
});
|
|
387
391
|
export {
|
|
388
|
-
|
|
392
|
+
ii as default
|
|
389
393
|
};
|
|
390
394
|
//# sourceMappingURL=CurrencyInput.js.map
|