@cloudparker/moldex.js 0.0.113 → 0.0.115
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/services/dialog/dialog-service.d.ts +1 -1
- package/dist/services/dialog/dialog-service.js +6 -6
- package/dist/services/utils/currency-service.d.ts +45 -0
- package/dist/services/utils/currency-service.js +46 -0
- package/dist/views/core/dialog/components/dialog/dialog.svelte +2 -2
- package/dist/views/core/dialog/components/dialog/dialog.svelte.d.ts +1 -1
- package/dist/views/core/pagination/components/pagination/pagination.svelte +10 -10
- package/dist/views/core/pagination/components/pagination/pagination.svelte.d.ts +1 -1
- package/dist/views/core/text/components/text-currency/text-currency.svelte +4 -11
- package/dist/views/core/text/components/text-currency/text-currency.svelte.d.ts +7 -4
- package/package.json +1 -1
|
@@ -32,7 +32,7 @@ export declare function openConfirmDialog(params?: DialogProps & {
|
|
|
32
32
|
export declare function openAlertDialog(params?: DialogProps & {
|
|
33
33
|
msg?: string;
|
|
34
34
|
}): Promise<unknown>;
|
|
35
|
-
export declare function openDeleteConfirmDialog({ msg, title,
|
|
35
|
+
export declare function openDeleteConfirmDialog({ msg, title, footerOkButtonLabel, footerOkButtonClassName, ...params }?: DialogProps & {
|
|
36
36
|
msg?: string;
|
|
37
37
|
}): Promise<unknown>;
|
|
38
38
|
export declare function openPickerDialog<R>({ items, value, multiple, hasCheckbox, hasArrow, maxlength, maxlengthMsg, identityFieldName, titleFieldName, searchFieldName, subtitleFieldName, hasIcon, iconPath, iconClassName, isCircularIcon, circularIconClassName, itemTileSnippet, ...params }: DialogProps & PickerDialogProps): Promise<R>;
|
|
@@ -44,7 +44,7 @@ export async function openDialog(props = {}) {
|
|
|
44
44
|
export async function openConfirmDialog(params = {}) {
|
|
45
45
|
let msg = params.msg || 'Are you sure?';
|
|
46
46
|
params.title = params.title || 'Confirm';
|
|
47
|
-
params.
|
|
47
|
+
params.footerOkButtonLabel = params.footerOkButtonLabel || 'Confirm';
|
|
48
48
|
return await openDialog({
|
|
49
49
|
bodyComponent: MsgDialog,
|
|
50
50
|
props: { msg },
|
|
@@ -59,7 +59,7 @@ export async function openConfirmDialog(params = {}) {
|
|
|
59
59
|
export async function openAlertDialog(params = {}) {
|
|
60
60
|
let msg = params.msg || 'Alert Information?';
|
|
61
61
|
params.title = params.title || 'Alert';
|
|
62
|
-
params.
|
|
62
|
+
params.footerOkButtonLabel = params.footerOkButtonLabel || 'Confirm';
|
|
63
63
|
return await openDialog({
|
|
64
64
|
bodyComponent: MsgDialog,
|
|
65
65
|
props: { msg },
|
|
@@ -72,11 +72,11 @@ export async function openAlertDialog(params = {}) {
|
|
|
72
72
|
footerCloseButtonLabel: 'OK'
|
|
73
73
|
});
|
|
74
74
|
}
|
|
75
|
-
export async function openDeleteConfirmDialog({ msg = 'Are you sure to delete?', title = 'Delete',
|
|
75
|
+
export async function openDeleteConfirmDialog({ msg = 'Are you sure to delete?', title = 'Delete', footerOkButtonLabel = 'Delete', footerOkButtonClassName = 'bg-red-500 hover:bg-red-700 focus:bg-red-700', ...params } = {}) {
|
|
76
76
|
return await openConfirmDialog({
|
|
77
77
|
msg,
|
|
78
78
|
title,
|
|
79
|
-
|
|
79
|
+
footerOkButtonLabel,
|
|
80
80
|
footerOkButtonClassName,
|
|
81
81
|
...params,
|
|
82
82
|
size: DialogSizeEnum.SM,
|
|
@@ -112,7 +112,7 @@ export async function openPickerDialog({ items, value, multiple, hasCheckbox = t
|
|
|
112
112
|
hasTitle: true,
|
|
113
113
|
hasHeaderBack: isMobileScreen(),
|
|
114
114
|
hasHeaderClose: !isMobileScreen(),
|
|
115
|
-
|
|
115
|
+
footerOkButtonLabel: 'Select',
|
|
116
116
|
footerClassName: 'border-t',
|
|
117
117
|
title: 'Pick',
|
|
118
118
|
...params,
|
|
@@ -210,7 +210,7 @@ export async function openCropperDialog({ outputWidth, outputFormat = OutputImag
|
|
|
210
210
|
hasFooter: true,
|
|
211
211
|
hasFooterOkButton: true,
|
|
212
212
|
hasFooterCloseButton: true,
|
|
213
|
-
|
|
213
|
+
footerOkButtonLabel: params.footerOkButtonLabel || 'CROP',
|
|
214
214
|
hasTitle: true,
|
|
215
215
|
title: params.title || 'Crop Image',
|
|
216
216
|
hasHeaderBack: isMobileScreen(),
|
|
@@ -1,3 +1,48 @@
|
|
|
1
|
+
export declare enum CurrencySymbols {
|
|
2
|
+
AED = "\u062F.\u0625",
|
|
3
|
+
AUD = "$",
|
|
4
|
+
BDT = "\u09F3",
|
|
5
|
+
BHD = ".\u062F.\u0628",
|
|
6
|
+
BRL = "R$",
|
|
7
|
+
CAD = "$",
|
|
8
|
+
CHF = "CHF",
|
|
9
|
+
CNY = "\u00A5",
|
|
10
|
+
CZK = "K\u010D",
|
|
11
|
+
DKK = "kr",
|
|
12
|
+
EGP = "\u00A3",
|
|
13
|
+
EUR = "\u20AC",
|
|
14
|
+
GBP = "\u00A3",
|
|
15
|
+
HKD = "$",
|
|
16
|
+
HUF = "Ft",
|
|
17
|
+
IDR = "Rp",
|
|
18
|
+
ILS = "\u20AA",
|
|
19
|
+
INR = "\u20B9",
|
|
20
|
+
JOD = "\u062F.\u0627",
|
|
21
|
+
JPY = "\u00A5",
|
|
22
|
+
KRW = "\u20A9",
|
|
23
|
+
KWD = "\u062F.\u0643",
|
|
24
|
+
LKR = "Rs",
|
|
25
|
+
MXN = "$",
|
|
26
|
+
MYR = "RM",
|
|
27
|
+
NGN = "\u20A6",
|
|
28
|
+
NOK = "kr",
|
|
29
|
+
NPR = "\u20A8",
|
|
30
|
+
NZD = "$",
|
|
31
|
+
OMR = "\u0631.\u0639.",
|
|
32
|
+
PHP = "\u20B1",
|
|
33
|
+
PKR = "\u20A8",
|
|
34
|
+
PLN = "z\u0142",
|
|
35
|
+
QAR = "\u0631.\u0642",
|
|
36
|
+
RUB = "\u20BD",
|
|
37
|
+
SAR = "\uFDFC",
|
|
38
|
+
SEK = "kr",
|
|
39
|
+
SGD = "$",
|
|
40
|
+
THB = "\u0E3F",
|
|
41
|
+
TRY = "\u20BA",
|
|
42
|
+
USD = "$",
|
|
43
|
+
VND = "\u20AB",
|
|
44
|
+
ZAR = "R"
|
|
45
|
+
}
|
|
1
46
|
/**
|
|
2
47
|
* Converts a number into words based on the Indian numbering system.
|
|
3
48
|
* Supports up to Crore level and works for numbers up to 99 Crore.
|
|
@@ -1,6 +1,52 @@
|
|
|
1
1
|
const belowTwenty = ["", "One", "Two", "Three", "Four", "Five", "Six", "Seven", "Eight", "Nine", "Ten", "Eleven", "Twelve", "Thirteen", "Fourteen", "Fifteen", "Sixteen", "Seventeen", "Eighteen", "Nineteen"];
|
|
2
2
|
const tens = ["", "", "Twenty", "Thirty", "Forty", "Fifty", "Sixty", "Seventy", "Eighty", "Ninety"];
|
|
3
3
|
const scales = ["", "Thousand", "Lakh", "Crore"];
|
|
4
|
+
export var CurrencySymbols;
|
|
5
|
+
(function (CurrencySymbols) {
|
|
6
|
+
CurrencySymbols["AED"] = "\u062F.\u0625";
|
|
7
|
+
CurrencySymbols["AUD"] = "$";
|
|
8
|
+
CurrencySymbols["BDT"] = "\u09F3";
|
|
9
|
+
CurrencySymbols["BHD"] = ".\u062F.\u0628";
|
|
10
|
+
CurrencySymbols["BRL"] = "R$";
|
|
11
|
+
CurrencySymbols["CAD"] = "$";
|
|
12
|
+
CurrencySymbols["CHF"] = "CHF";
|
|
13
|
+
CurrencySymbols["CNY"] = "\u00A5";
|
|
14
|
+
CurrencySymbols["CZK"] = "K\u010D";
|
|
15
|
+
CurrencySymbols["DKK"] = "kr";
|
|
16
|
+
CurrencySymbols["EGP"] = "\u00A3";
|
|
17
|
+
CurrencySymbols["EUR"] = "\u20AC";
|
|
18
|
+
CurrencySymbols["GBP"] = "\u00A3";
|
|
19
|
+
CurrencySymbols["HKD"] = "$";
|
|
20
|
+
CurrencySymbols["HUF"] = "Ft";
|
|
21
|
+
CurrencySymbols["IDR"] = "Rp";
|
|
22
|
+
CurrencySymbols["ILS"] = "\u20AA";
|
|
23
|
+
CurrencySymbols["INR"] = "\u20B9";
|
|
24
|
+
CurrencySymbols["JOD"] = "\u062F.\u0627";
|
|
25
|
+
CurrencySymbols["JPY"] = "\u00A5";
|
|
26
|
+
CurrencySymbols["KRW"] = "\u20A9";
|
|
27
|
+
CurrencySymbols["KWD"] = "\u062F.\u0643";
|
|
28
|
+
CurrencySymbols["LKR"] = "Rs";
|
|
29
|
+
CurrencySymbols["MXN"] = "$";
|
|
30
|
+
CurrencySymbols["MYR"] = "RM";
|
|
31
|
+
CurrencySymbols["NGN"] = "\u20A6";
|
|
32
|
+
CurrencySymbols["NOK"] = "kr";
|
|
33
|
+
CurrencySymbols["NPR"] = "\u20A8";
|
|
34
|
+
CurrencySymbols["NZD"] = "$";
|
|
35
|
+
CurrencySymbols["OMR"] = "\u0631.\u0639.";
|
|
36
|
+
CurrencySymbols["PHP"] = "\u20B1";
|
|
37
|
+
CurrencySymbols["PKR"] = "\u20A8";
|
|
38
|
+
CurrencySymbols["PLN"] = "z\u0142";
|
|
39
|
+
CurrencySymbols["QAR"] = "\u0631.\u0642";
|
|
40
|
+
CurrencySymbols["RUB"] = "\u20BD";
|
|
41
|
+
CurrencySymbols["SAR"] = "\uFDFC";
|
|
42
|
+
CurrencySymbols["SEK"] = "kr";
|
|
43
|
+
CurrencySymbols["SGD"] = "$";
|
|
44
|
+
CurrencySymbols["THB"] = "\u0E3F";
|
|
45
|
+
CurrencySymbols["TRY"] = "\u20BA";
|
|
46
|
+
CurrencySymbols["USD"] = "$";
|
|
47
|
+
CurrencySymbols["VND"] = "\u20AB";
|
|
48
|
+
CurrencySymbols["ZAR"] = "R";
|
|
49
|
+
})(CurrencySymbols || (CurrencySymbols = {}));
|
|
4
50
|
/**
|
|
5
51
|
* Converts a number into words based on the Indian numbering system.
|
|
6
52
|
* Supports up to Crore level and works for numbers up to 99 Crore.
|
|
@@ -23,7 +23,7 @@ let {
|
|
|
23
23
|
footerOkButtonEnabled = true,
|
|
24
24
|
footerOkButtonSpinner = false,
|
|
25
25
|
footerOkButtonType = "button",
|
|
26
|
-
|
|
26
|
+
footerOkButtonLabel = "Save",
|
|
27
27
|
hasFooter = false,
|
|
28
28
|
hasFooterCloseButton = false,
|
|
29
29
|
hasFooterOkButton = false,
|
|
@@ -274,7 +274,7 @@ function handleOkClick(event) {
|
|
|
274
274
|
type={targetFormId ? 'submit' : footerOkButtonType}
|
|
275
275
|
appearance="primary"
|
|
276
276
|
className=" {footerOkButtonClassName}"
|
|
277
|
-
label={
|
|
277
|
+
label={footerOkButtonLabel}
|
|
278
278
|
disabled={!footerOkButtonEnabled}
|
|
279
279
|
spinner={footerOkButtonSpinner}
|
|
280
280
|
spinnerClassName="text-white w-4 h-4"
|
|
@@ -22,7 +22,7 @@ export type DialogProps = {
|
|
|
22
22
|
footerOkButtonEnabled?: boolean;
|
|
23
23
|
footerOkButtonSpinner?: boolean;
|
|
24
24
|
footerOkButtonType?: 'button' | 'submit' | 'reset';
|
|
25
|
-
|
|
25
|
+
footerOkButtonLabel?: string;
|
|
26
26
|
hasFooter?: boolean;
|
|
27
27
|
hasFooterCloseButton?: boolean;
|
|
28
28
|
hasFooterOkButton?: boolean;
|
|
@@ -15,7 +15,7 @@ let {
|
|
|
15
15
|
itemsText = "Items",
|
|
16
16
|
pageSizeText = "Page Size",
|
|
17
17
|
pageText = "Page",
|
|
18
|
-
|
|
18
|
+
disableSizeMenuButton,
|
|
19
19
|
onPageSizeChange,
|
|
20
20
|
onPageIndexChange
|
|
21
21
|
} = $props();
|
|
@@ -26,7 +26,10 @@ let hasLast = $derived(pageIndex < pageCount - 1);
|
|
|
26
26
|
let hasNext = $derived(pageIndex < pageCount - 1);
|
|
27
27
|
const handlePageSize = (size) => {
|
|
28
28
|
pageIndex = 0;
|
|
29
|
-
pageSize
|
|
29
|
+
if (pageSize != size) {
|
|
30
|
+
pageSize = size;
|
|
31
|
+
onPageSizeChange?.(pageSize);
|
|
32
|
+
}
|
|
30
33
|
};
|
|
31
34
|
const handlePage = (type) => {
|
|
32
35
|
let index = 0;
|
|
@@ -48,7 +51,10 @@ const handlePage = (type) => {
|
|
|
48
51
|
}
|
|
49
52
|
if (index <= 0) index = 0;
|
|
50
53
|
if (index >= pageCount) index = pageCount - 1;
|
|
51
|
-
pageIndex
|
|
54
|
+
if (pageIndex != index) {
|
|
55
|
+
pageIndex = index;
|
|
56
|
+
onPageIndexChange?.(pageIndex);
|
|
57
|
+
}
|
|
52
58
|
};
|
|
53
59
|
function handlePageSizeMenu(ev, menu) {
|
|
54
60
|
try {
|
|
@@ -57,12 +63,6 @@ function handlePageSizeMenu(ev, menu) {
|
|
|
57
63
|
} catch (error) {
|
|
58
64
|
}
|
|
59
65
|
}
|
|
60
|
-
$effect(() => {
|
|
61
|
-
onPageSizeChange && onPageSizeChange(pageSize);
|
|
62
|
-
});
|
|
63
|
-
$effect(() => {
|
|
64
|
-
onPageIndexChange && onPageIndexChange(pageIndex);
|
|
65
|
-
});
|
|
66
66
|
</script>
|
|
67
67
|
|
|
68
68
|
{#snippet pageButton({ onClick, disabled, icon }: any)}
|
|
@@ -75,7 +75,7 @@ $effect(() => {
|
|
|
75
75
|
<div>{pageSizeText}</div>
|
|
76
76
|
<div class="">
|
|
77
77
|
<ButtonMenu
|
|
78
|
-
disabled={
|
|
78
|
+
disabled={disableSizeMenuButton}
|
|
79
79
|
iconPath={mdiChevronDown}
|
|
80
80
|
label={'' + pageSize}
|
|
81
81
|
menus={pageSizeOptions.map((o) => '' + o)}
|
|
@@ -1,17 +1,10 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
let
|
|
3
|
-
let value = $state("");
|
|
4
|
-
function prepare(..._) {
|
|
5
|
-
value = Math.abs(input || 0).toFixed(2);
|
|
6
|
-
}
|
|
7
|
-
$effect(() => {
|
|
8
|
-
BROWSER && prepare(input);
|
|
9
|
-
});
|
|
1
|
+
<script lang="ts">let { input, symbol = "$", hasSymbol = true, empty = "-", decimal = 2 } = $props();
|
|
2
|
+
let value = $derived(Math.abs(input || 0).toFixed(decimal));
|
|
10
3
|
</script>
|
|
11
4
|
|
|
12
|
-
<span>
|
|
5
|
+
<span class="text-nowrap">
|
|
13
6
|
{#if (input || 0) < 0}
|
|
14
|
-
{
|
|
7
|
+
{empty}
|
|
15
8
|
{/if}
|
|
16
9
|
{#if hasSymbol}
|
|
17
10
|
{symbol || ''}
|
|
@@ -1,8 +1,11 @@
|
|
|
1
|
-
type
|
|
1
|
+
import type { CurrencySymbols } from '../../../../../services';
|
|
2
|
+
type Props = {
|
|
2
3
|
input: number;
|
|
3
|
-
symbol
|
|
4
|
-
hasSymbol
|
|
4
|
+
symbol?: CurrencySymbols | string;
|
|
5
|
+
hasSymbol?: boolean;
|
|
6
|
+
empty?: string;
|
|
7
|
+
decimal?: number;
|
|
5
8
|
};
|
|
6
|
-
declare const TextCurrency: import("svelte").Component<
|
|
9
|
+
declare const TextCurrency: import("svelte").Component<Props, {}, "">;
|
|
7
10
|
type TextCurrency = ReturnType<typeof TextCurrency>;
|
|
8
11
|
export default TextCurrency;
|