@cloudparker/moldex.js 0.0.7 → 0.0.8
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/actions/ripple.d.ts +0 -1
- package/dist/actions/ripple.js +1 -3
- package/dist/button/components/button/button.svelte +22 -16
- package/dist/date/index.d.ts +1 -0
- package/dist/date/index.js +1 -0
- package/dist/date/services/date-service.d.ts +51 -0
- package/dist/date/services/date-service.js +205 -0
- package/dist/dialog/components/dialog/dialog.svelte +6 -5
- package/dist/dialog/components/dialog/dialog.svelte.d.ts +3 -3
- package/dist/drawer/index.d.ts +2 -0
- package/dist/drawer/index.js +2 -0
- package/dist/icon/components/icon/icon.svelte +2 -2
- package/dist/icon/services/icon-path-service.d.ts +8 -5
- package/dist/icon/services/icon-path-service.js +8 -5
- package/dist/index.d.ts +8 -1
- package/dist/index.js +8 -1
- package/dist/navbar/index.d.ts +2 -0
- package/dist/navbar/index.js +2 -0
- package/dist/{common/components/vertical-rule/verticcal-rule.svelte.d.ts → ruler/components/vertical-ruler/verticcal-ruler.svelte.d.ts} +3 -3
- package/dist/ruler/index.d.ts +2 -0
- package/dist/ruler/index.js +2 -0
- package/dist/spinner/index.d.ts +2 -0
- package/dist/spinner/index.js +2 -0
- package/dist/tailwind.css +1 -1
- package/dist/text/components/text-await/text-await.svelte +9 -0
- package/dist/text/components/text-await/text-await.svelte.d.ts +22 -0
- package/dist/text/components/text-copy/text-copy.svelte +30 -0
- package/dist/text/components/text-copy/text-copy.svelte.d.ts +24 -0
- package/dist/text/components/text-country/text-country.svelte +37 -0
- package/dist/text/components/text-country/text-country.svelte.d.ts +20 -0
- package/dist/text/components/text-country-state/text-country-state.svelte +39 -0
- package/dist/text/components/text-country-state/text-country-state.svelte.d.ts +20 -0
- package/dist/text/components/text-currency/text-currency.svelte +20 -0
- package/dist/text/components/text-currency/text-currency.svelte.d.ts +22 -0
- package/dist/text/components/text-date/text-date.svelte +25 -0
- package/dist/text/components/text-date/text-date.svelte.d.ts +24 -0
- package/dist/text/components/text-email/text-email.svelte +14 -0
- package/dist/text/components/text-email/text-email.svelte.d.ts +23 -0
- package/dist/text/components/text-html/text-html.svelte +6 -0
- package/dist/text/components/text-html/text-html.svelte.d.ts +20 -0
- package/dist/text/components/text-phone/text-phone.svelte +13 -0
- package/dist/text/components/text-phone/text-phone.svelte.d.ts +23 -0
- package/dist/text/index.d.ts +10 -0
- package/dist/text/index.js +10 -0
- package/dist/toast/components/toast/toast.svelte +42 -0
- package/dist/toast/components/toast/toast.svelte.d.ts +29 -0
- package/dist/toast/index.d.ts +3 -0
- package/dist/toast/index.js +2 -0
- package/dist/toast/services/toast-service.d.ts +5 -0
- package/dist/toast/services/toast-service.js +26 -0
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.js +1 -0
- package/dist/utils/services/utils-service.d.ts +72 -0
- package/dist/utils/services/utils-service.js +370 -0
- package/package.json +4 -2
- package/dist/common/index.d.ts +0 -5
- package/dist/common/index.js +0 -5
- /package/dist/{common → drawer}/components/drawer/drawer.svelte +0 -0
- /package/dist/{common → drawer}/components/drawer/drawer.svelte.d.ts +0 -0
- /package/dist/{common → navbar}/components/navbar/navbar.svelte +0 -0
- /package/dist/{common → navbar}/components/navbar/navbar.svelte.d.ts +0 -0
- /package/dist/{common/components/vertical-rule/verticcal-rule.svelte → ruler/components/vertical-ruler/verticcal-ruler.svelte} +0 -0
- /package/dist/{common → spinner}/components/spinner/spinner.svelte +0 -0
- /package/dist/{common → spinner}/components/spinner/spinner.svelte.d.ts +0 -0
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
2
|
+
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
3
|
+
$$bindings?: Bindings;
|
|
4
|
+
} & Exports;
|
|
5
|
+
(internal: unknown, props: Props & {
|
|
6
|
+
$$events?: Events;
|
|
7
|
+
$$slots?: Slots;
|
|
8
|
+
}): Exports & {
|
|
9
|
+
$set?: any;
|
|
10
|
+
$on?: any;
|
|
11
|
+
};
|
|
12
|
+
z_$$bindings?: Bindings;
|
|
13
|
+
}
|
|
14
|
+
declare const TextAwait: $$__sveltets_2_IsomorphicComponent<{
|
|
15
|
+
input?: Promise<any | null> | undefined;
|
|
16
|
+
key?: string;
|
|
17
|
+
hasTitle?: string;
|
|
18
|
+
}, {
|
|
19
|
+
[evt: string]: CustomEvent<any>;
|
|
20
|
+
}, {}, {}, "">;
|
|
21
|
+
type TextAwait = InstanceType<typeof TextAwait>;
|
|
22
|
+
export default TextAwait;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
<script lang="ts">import Button from "../../../button/components/button/button.svelte";
|
|
2
|
+
import { mdiContentCopy } from "../../../icon/index.js";
|
|
3
|
+
import { showToast } from "../../../toast/index.js";
|
|
4
|
+
import { copyText } from "../../../utils/index.js";
|
|
5
|
+
let {
|
|
6
|
+
input,
|
|
7
|
+
containerClassName = "",
|
|
8
|
+
buttonClassName = "",
|
|
9
|
+
iconClassName = "",
|
|
10
|
+
iconPath = mdiContentCopy
|
|
11
|
+
} = $props();
|
|
12
|
+
function handleCopy() {
|
|
13
|
+
if (input) {
|
|
14
|
+
copyText(input);
|
|
15
|
+
showToast("Copied!");
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
</script>
|
|
19
|
+
|
|
20
|
+
<span class="flex items-center {containerClassName}">
|
|
21
|
+
<span>{input || ''}</span>
|
|
22
|
+
{#if input}
|
|
23
|
+
<Button
|
|
24
|
+
onclick={handleCopy}
|
|
25
|
+
className="ms-1 p-1 rounded text-gray-500 hover:text-gray-700 hover:bg-gray-100 {buttonClassName}"
|
|
26
|
+
iconClassName="w-4 h-4 {iconClassName}"
|
|
27
|
+
{iconPath}
|
|
28
|
+
/>
|
|
29
|
+
{/if}
|
|
30
|
+
</span>
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
2
|
+
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
3
|
+
$$bindings?: Bindings;
|
|
4
|
+
} & Exports;
|
|
5
|
+
(internal: unknown, props: Props & {
|
|
6
|
+
$$events?: Events;
|
|
7
|
+
$$slots?: Slots;
|
|
8
|
+
}): Exports & {
|
|
9
|
+
$set?: any;
|
|
10
|
+
$on?: any;
|
|
11
|
+
};
|
|
12
|
+
z_$$bindings?: Bindings;
|
|
13
|
+
}
|
|
14
|
+
declare const TextCopy: $$__sveltets_2_IsomorphicComponent<{
|
|
15
|
+
input: string;
|
|
16
|
+
containerClassName?: string;
|
|
17
|
+
buttonClassName?: string;
|
|
18
|
+
iconClassName?: string;
|
|
19
|
+
iconPath?: string;
|
|
20
|
+
}, {
|
|
21
|
+
[evt: string]: CustomEvent<any>;
|
|
22
|
+
}, {}, {}, "">;
|
|
23
|
+
type TextCopy = InstanceType<typeof TextCopy>;
|
|
24
|
+
export default TextCopy;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
<script lang="ts">import EasyScriptLoader from "@cloudparker/easy-script-loader-svelte";
|
|
2
|
+
import { BROWSER } from "esm-env";
|
|
3
|
+
let { input } = $props();
|
|
4
|
+
let countries = $state([]);
|
|
5
|
+
let country = $state(null);
|
|
6
|
+
let EasyCountryData;
|
|
7
|
+
async function init() {
|
|
8
|
+
if (EasyCountryData) {
|
|
9
|
+
countries = EasyCountryData.getCountries();
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
function handleScriptLoad(lib) {
|
|
13
|
+
EasyCountryData = lib;
|
|
14
|
+
init();
|
|
15
|
+
}
|
|
16
|
+
async function prepare(..._) {
|
|
17
|
+
if (input) {
|
|
18
|
+
if (countries?.length) {
|
|
19
|
+
country = countries.find((o) => o.isoCode == input);
|
|
20
|
+
}
|
|
21
|
+
} else {
|
|
22
|
+
country = null;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
$effect(() => {
|
|
26
|
+
BROWSER && prepare(input, countries);
|
|
27
|
+
});
|
|
28
|
+
</script>
|
|
29
|
+
|
|
30
|
+
<EasyScriptLoader
|
|
31
|
+
scriptName="EasyCountryData"
|
|
32
|
+
scriptUrl="https://cdn.jsdelivr.net/gh/paramanandapradhan/easy-countrydata@main/dist/index.js"
|
|
33
|
+
onload={handleScriptLoad}
|
|
34
|
+
/>
|
|
35
|
+
{#if country}
|
|
36
|
+
<span> {country?.name || ''} </span>
|
|
37
|
+
{/if}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
2
|
+
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
3
|
+
$$bindings?: Bindings;
|
|
4
|
+
} & Exports;
|
|
5
|
+
(internal: unknown, props: Props & {
|
|
6
|
+
$$events?: Events;
|
|
7
|
+
$$slots?: Slots;
|
|
8
|
+
}): Exports & {
|
|
9
|
+
$set?: any;
|
|
10
|
+
$on?: any;
|
|
11
|
+
};
|
|
12
|
+
z_$$bindings?: Bindings;
|
|
13
|
+
}
|
|
14
|
+
declare const TextCountry: $$__sveltets_2_IsomorphicComponent<{
|
|
15
|
+
input?: string;
|
|
16
|
+
}, {
|
|
17
|
+
[evt: string]: CustomEvent<any>;
|
|
18
|
+
}, {}, {}, "">;
|
|
19
|
+
type TextCountry = InstanceType<typeof TextCountry>;
|
|
20
|
+
export default TextCountry;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
<script lang="ts">import EasyScriptLoader from "@cloudparker/easy-script-loader-svelte";
|
|
2
|
+
import { BROWSER } from "esm-env";
|
|
3
|
+
let { input } = $props();
|
|
4
|
+
let states = $state([]);
|
|
5
|
+
let state = $state(null);
|
|
6
|
+
let EasyCountryStateData;
|
|
7
|
+
async function init() {
|
|
8
|
+
if (EasyCountryStateData) {
|
|
9
|
+
states = EasyCountryStateData.getStates() || [];
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
async function prepare(..._) {
|
|
13
|
+
if (input) {
|
|
14
|
+
await init();
|
|
15
|
+
if (states?.length) {
|
|
16
|
+
state = states.find((o) => o._id == input);
|
|
17
|
+
}
|
|
18
|
+
} else {
|
|
19
|
+
state = null;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
function handleScriptLoad(ev) {
|
|
23
|
+
EasyCountryStateData = ev.detail;
|
|
24
|
+
init();
|
|
25
|
+
}
|
|
26
|
+
$effect(() => {
|
|
27
|
+
BROWSER && prepare(input, states);
|
|
28
|
+
});
|
|
29
|
+
</script>
|
|
30
|
+
|
|
31
|
+
<EasyScriptLoader
|
|
32
|
+
scriptName="EasyCountryStateData"
|
|
33
|
+
scriptUrl="https://cdn.jsdelivr.net/gh/paramanandapradhan/easy-country-state-data@main/dist/index.js"
|
|
34
|
+
on:load={handleScriptLoad}
|
|
35
|
+
/>
|
|
36
|
+
|
|
37
|
+
{#if state}
|
|
38
|
+
<span> {state?.name || ''} </span>
|
|
39
|
+
{/if}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
2
|
+
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
3
|
+
$$bindings?: Bindings;
|
|
4
|
+
} & Exports;
|
|
5
|
+
(internal: unknown, props: Props & {
|
|
6
|
+
$$events?: Events;
|
|
7
|
+
$$slots?: Slots;
|
|
8
|
+
}): Exports & {
|
|
9
|
+
$set?: any;
|
|
10
|
+
$on?: any;
|
|
11
|
+
};
|
|
12
|
+
z_$$bindings?: Bindings;
|
|
13
|
+
}
|
|
14
|
+
declare const TextCountryState: $$__sveltets_2_IsomorphicComponent<{
|
|
15
|
+
input: string;
|
|
16
|
+
}, {
|
|
17
|
+
[evt: string]: CustomEvent<any>;
|
|
18
|
+
}, {}, {}, "">;
|
|
19
|
+
type TextCountryState = InstanceType<typeof TextCountryState>;
|
|
20
|
+
export default TextCountryState;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
<script lang="ts">import { BROWSER } from "esm-env";
|
|
2
|
+
let { input, symbol = "$", hasSymbol = true } = $props();
|
|
3
|
+
let value = $state("");
|
|
4
|
+
function prepare(..._) {
|
|
5
|
+
value = Math.abs(input || 0).toFixed(2);
|
|
6
|
+
}
|
|
7
|
+
$effect(() => {
|
|
8
|
+
BROWSER && prepare(input);
|
|
9
|
+
});
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<span>
|
|
13
|
+
{#if (input || 0) < 0}
|
|
14
|
+
{'-'}
|
|
15
|
+
{/if}
|
|
16
|
+
{#if hasSymbol}
|
|
17
|
+
{symbol || ''}
|
|
18
|
+
{/if}
|
|
19
|
+
{value || ''}
|
|
20
|
+
</span>
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
2
|
+
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
3
|
+
$$bindings?: Bindings;
|
|
4
|
+
} & Exports;
|
|
5
|
+
(internal: unknown, props: Props & {
|
|
6
|
+
$$events?: Events;
|
|
7
|
+
$$slots?: Slots;
|
|
8
|
+
}): Exports & {
|
|
9
|
+
$set?: any;
|
|
10
|
+
$on?: any;
|
|
11
|
+
};
|
|
12
|
+
z_$$bindings?: Bindings;
|
|
13
|
+
}
|
|
14
|
+
declare const TextCurrency: $$__sveltets_2_IsomorphicComponent<{
|
|
15
|
+
input: number;
|
|
16
|
+
symbol: string;
|
|
17
|
+
hasSymbol: boolean;
|
|
18
|
+
}, {
|
|
19
|
+
[evt: string]: CustomEvent<any>;
|
|
20
|
+
}, {}, {}, "">;
|
|
21
|
+
type TextCurrency = InstanceType<typeof TextCurrency>;
|
|
22
|
+
export default TextCurrency;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
<script lang="ts">import { dateFormat, dateToAgo, toDate } from "../../../date";
|
|
2
|
+
import { BROWSER } from "esm-env";
|
|
3
|
+
let { input, format = "DD-MM-YYYY hh:mm a" } = $props();
|
|
4
|
+
let dateString = $state("");
|
|
5
|
+
function prepareDate(..._) {
|
|
6
|
+
let date;
|
|
7
|
+
if (input) {
|
|
8
|
+
date = toDate(input);
|
|
9
|
+
}
|
|
10
|
+
if (date) {
|
|
11
|
+
if (format == "ago") {
|
|
12
|
+
dateString = dateToAgo(date);
|
|
13
|
+
} else {
|
|
14
|
+
dateString = dateFormat(date, format);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
$effect(() => {
|
|
19
|
+
BROWSER && prepareDate(input);
|
|
20
|
+
});
|
|
21
|
+
</script>
|
|
22
|
+
|
|
23
|
+
<span>
|
|
24
|
+
{dateString || ''}
|
|
25
|
+
</span>
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
2
|
+
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
3
|
+
$$bindings?: Bindings;
|
|
4
|
+
} & Exports;
|
|
5
|
+
(internal: unknown, props: Props & {
|
|
6
|
+
$$events?: Events;
|
|
7
|
+
$$slots?: Slots;
|
|
8
|
+
}): Exports & {
|
|
9
|
+
$set?: any;
|
|
10
|
+
$on?: any;
|
|
11
|
+
};
|
|
12
|
+
z_$$bindings?: Bindings;
|
|
13
|
+
}
|
|
14
|
+
declare const TextDate: $$__sveltets_2_IsomorphicComponent<{
|
|
15
|
+
input: Date | number | string | {
|
|
16
|
+
seconds: number;
|
|
17
|
+
nanoseconds: number;
|
|
18
|
+
};
|
|
19
|
+
format?: "ago" | string;
|
|
20
|
+
}, {
|
|
21
|
+
[evt: string]: CustomEvent<any>;
|
|
22
|
+
}, {}, {}, "">;
|
|
23
|
+
type TextDate = InstanceType<typeof TextDate>;
|
|
24
|
+
export default TextDate;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
<script lang="ts">import { ripple } from "../../../actions";
|
|
2
|
+
import { mdiEmailOutline } from "../../../icon";
|
|
3
|
+
import Icon from "../../../icon/components/icon/icon.svelte";
|
|
4
|
+
let { input, buttonClassName, iconClassName, iconPath = mdiEmailOutline } = $props();
|
|
5
|
+
</script>
|
|
6
|
+
|
|
7
|
+
<span class="flex items-center">
|
|
8
|
+
<span>{input || ''}</span>
|
|
9
|
+
{#if input}
|
|
10
|
+
<a class="ms-1 p-1 rounded text-gray-500 hover:text-gray-700 hover:bg-gray-100 {buttonClassName}" href="mailto:{input}" use:ripple>
|
|
11
|
+
<Icon path={iconPath} className="w-4 h-4 {iconClassName}" />
|
|
12
|
+
</a>
|
|
13
|
+
{/if}
|
|
14
|
+
</span>
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
2
|
+
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
3
|
+
$$bindings?: Bindings;
|
|
4
|
+
} & Exports;
|
|
5
|
+
(internal: unknown, props: Props & {
|
|
6
|
+
$$events?: Events;
|
|
7
|
+
$$slots?: Slots;
|
|
8
|
+
}): Exports & {
|
|
9
|
+
$set?: any;
|
|
10
|
+
$on?: any;
|
|
11
|
+
};
|
|
12
|
+
z_$$bindings?: Bindings;
|
|
13
|
+
}
|
|
14
|
+
declare const TextEmail: $$__sveltets_2_IsomorphicComponent<{
|
|
15
|
+
input: string;
|
|
16
|
+
buttonClassName?: string;
|
|
17
|
+
iconPath?: string;
|
|
18
|
+
iconClassName?: string;
|
|
19
|
+
}, {
|
|
20
|
+
[evt: string]: CustomEvent<any>;
|
|
21
|
+
}, {}, {}, "">;
|
|
22
|
+
type TextEmail = InstanceType<typeof TextEmail>;
|
|
23
|
+
export default TextEmail;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
2
|
+
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
3
|
+
$$bindings?: Bindings;
|
|
4
|
+
} & Exports;
|
|
5
|
+
(internal: unknown, props: Props & {
|
|
6
|
+
$$events?: Events;
|
|
7
|
+
$$slots?: Slots;
|
|
8
|
+
}): Exports & {
|
|
9
|
+
$set?: any;
|
|
10
|
+
$on?: any;
|
|
11
|
+
};
|
|
12
|
+
z_$$bindings?: Bindings;
|
|
13
|
+
}
|
|
14
|
+
declare const TextHtml: $$__sveltets_2_IsomorphicComponent<{
|
|
15
|
+
input: string;
|
|
16
|
+
}, {
|
|
17
|
+
[evt: string]: CustomEvent<any>;
|
|
18
|
+
}, {}, {}, "">;
|
|
19
|
+
type TextHtml = InstanceType<typeof TextHtml>;
|
|
20
|
+
export default TextHtml;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<script lang="ts">import { mdiPhone } from "../../../icon";
|
|
2
|
+
import Icon from "../../../icon/components/icon/icon.svelte";
|
|
3
|
+
let { input, buttonClassName, iconClassName, iconPath = mdiPhone } = $props();
|
|
4
|
+
</script>
|
|
5
|
+
|
|
6
|
+
<span class="flex items-center">
|
|
7
|
+
<span>{input || ''}</span>
|
|
8
|
+
{#if input}
|
|
9
|
+
<a class="ms-1 p-1 rounded text-gray-500 hover:text-gray-700 hover:bg-gray-100 {buttonClassName}" href="tel:{input}">
|
|
10
|
+
<Icon path={iconPath} className="w-4 h-4 {iconClassName} " />
|
|
11
|
+
</a>
|
|
12
|
+
{/if}
|
|
13
|
+
</span>
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
2
|
+
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
3
|
+
$$bindings?: Bindings;
|
|
4
|
+
} & Exports;
|
|
5
|
+
(internal: unknown, props: Props & {
|
|
6
|
+
$$events?: Events;
|
|
7
|
+
$$slots?: Slots;
|
|
8
|
+
}): Exports & {
|
|
9
|
+
$set?: any;
|
|
10
|
+
$on?: any;
|
|
11
|
+
};
|
|
12
|
+
z_$$bindings?: Bindings;
|
|
13
|
+
}
|
|
14
|
+
declare const TextPhone: $$__sveltets_2_IsomorphicComponent<{
|
|
15
|
+
input: string;
|
|
16
|
+
buttonClassName?: string;
|
|
17
|
+
iconPath?: string;
|
|
18
|
+
iconClassName?: string;
|
|
19
|
+
}, {
|
|
20
|
+
[evt: string]: CustomEvent<any>;
|
|
21
|
+
}, {}, {}, "">;
|
|
22
|
+
type TextPhone = InstanceType<typeof TextPhone>;
|
|
23
|
+
export default TextPhone;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import TextAwait from "./components/text-await/text-await.svelte";
|
|
2
|
+
import TextCopy from "./components/text-copy/text-copy.svelte";
|
|
3
|
+
import TextCountry from "./components/text-country/text-country.svelte";
|
|
4
|
+
import TextCountryState from "./components/text-country-state/text-country-state.svelte";
|
|
5
|
+
import TextCurrency from "./components/text-currency/text-currency.svelte";
|
|
6
|
+
import TextDate from "./components/text-date/text-date.svelte";
|
|
7
|
+
import TextEmail from "./components/text-email/text-email.svelte";
|
|
8
|
+
import TextHtml from "./components/text-html/text-html.svelte";
|
|
9
|
+
import TextPhone from "./components/text-phone/text-phone.svelte";
|
|
10
|
+
export { TextAwait, TextCopy, TextCountry, TextCountryState, TextCurrency, TextDate, TextEmail, TextHtml, TextPhone, };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import TextAwait from "./components/text-await/text-await.svelte";
|
|
2
|
+
import TextCopy from "./components/text-copy/text-copy.svelte";
|
|
3
|
+
import TextCountry from "./components/text-country/text-country.svelte";
|
|
4
|
+
import TextCountryState from "./components/text-country-state/text-country-state.svelte";
|
|
5
|
+
import TextCurrency from "./components/text-currency/text-currency.svelte";
|
|
6
|
+
import TextDate from "./components/text-date/text-date.svelte";
|
|
7
|
+
import TextEmail from "./components/text-email/text-email.svelte";
|
|
8
|
+
import TextHtml from "./components/text-html/text-html.svelte";
|
|
9
|
+
import TextPhone from "./components/text-phone/text-phone.svelte";
|
|
10
|
+
export { TextAwait, TextCopy, TextCountry, TextCountryState, TextCurrency, TextDate, TextEmail, TextHtml, TextPhone, };
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
<script context="module" lang="ts"></script>
|
|
2
|
+
|
|
3
|
+
<script lang="ts">let isPlaced = $state(false);
|
|
4
|
+
let isOpened = $state(false);
|
|
5
|
+
let { id, msg, duration = 3e3, className, children } = $props();
|
|
6
|
+
export function openToast() {
|
|
7
|
+
isPlaced = true;
|
|
8
|
+
setTimeout(() => {
|
|
9
|
+
isOpened = true;
|
|
10
|
+
setTimeout(() => {
|
|
11
|
+
closeClose();
|
|
12
|
+
}, duration);
|
|
13
|
+
}, 0);
|
|
14
|
+
}
|
|
15
|
+
export function closeClose() {
|
|
16
|
+
isOpened = false;
|
|
17
|
+
setTimeout(() => {
|
|
18
|
+
isPlaced = false;
|
|
19
|
+
}, 300);
|
|
20
|
+
}
|
|
21
|
+
</script>
|
|
22
|
+
|
|
23
|
+
{#if isPlaced}
|
|
24
|
+
<div
|
|
25
|
+
{id}
|
|
26
|
+
class="fixed bottom-20 left-1/2 transform -translate-x-1/2 p-3 px-6 max-w-full text-gray-700 bg-white shadow-xl rounded-full transition-opacity duration-300 {isOpened
|
|
27
|
+
? 'opacity-100'
|
|
28
|
+
: 'opacity-0'} toast {className}"
|
|
29
|
+
>
|
|
30
|
+
{#if children}
|
|
31
|
+
{@render children()}
|
|
32
|
+
{:else}
|
|
33
|
+
{@html msg}
|
|
34
|
+
{/if}
|
|
35
|
+
</div>
|
|
36
|
+
{/if}
|
|
37
|
+
|
|
38
|
+
<style>
|
|
39
|
+
.toast {
|
|
40
|
+
z-index: 1000;
|
|
41
|
+
}
|
|
42
|
+
</style>
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { Snippet } from 'svelte';
|
|
2
|
+
export type ToastPropsType = {
|
|
3
|
+
id?: string;
|
|
4
|
+
msg: string;
|
|
5
|
+
duration?: number;
|
|
6
|
+
className?: string;
|
|
7
|
+
children?: Snippet;
|
|
8
|
+
};
|
|
9
|
+
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
10
|
+
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
11
|
+
$$bindings?: Bindings;
|
|
12
|
+
} & Exports;
|
|
13
|
+
(internal: unknown, props: Props & {
|
|
14
|
+
$$events?: Events;
|
|
15
|
+
$$slots?: Slots;
|
|
16
|
+
}): Exports & {
|
|
17
|
+
$set?: any;
|
|
18
|
+
$on?: any;
|
|
19
|
+
};
|
|
20
|
+
z_$$bindings?: Bindings;
|
|
21
|
+
}
|
|
22
|
+
declare const Toast: $$__sveltets_2_IsomorphicComponent<ToastPropsType, {
|
|
23
|
+
[evt: string]: CustomEvent<any>;
|
|
24
|
+
}, {}, {
|
|
25
|
+
openToast: () => void;
|
|
26
|
+
closeClose: () => void;
|
|
27
|
+
}, "">;
|
|
28
|
+
type Toast = InstanceType<typeof Toast>;
|
|
29
|
+
export default Toast;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { type ToastPropsType } from "../components/toast/toast.svelte";
|
|
2
|
+
export declare function showToast(props: ToastPropsType | string): void;
|
|
3
|
+
export declare function showSuccessToast(): void;
|
|
4
|
+
export declare function showFailedToast(): void;
|
|
5
|
+
export declare function showErrorToast(): void;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { mount } from "svelte";
|
|
2
|
+
import Toast, {} from "../components/toast/toast.svelte";
|
|
3
|
+
function addToast(props) {
|
|
4
|
+
const toast = mount(Toast, { target: document.getElementsByTagName('body')[0], props });
|
|
5
|
+
toast.openToast();
|
|
6
|
+
return toast;
|
|
7
|
+
}
|
|
8
|
+
export function showToast(props) {
|
|
9
|
+
let newProps = { msg: 'Ok' };
|
|
10
|
+
if (typeof props === 'string') {
|
|
11
|
+
newProps.msg = props;
|
|
12
|
+
}
|
|
13
|
+
else {
|
|
14
|
+
newProps = props;
|
|
15
|
+
}
|
|
16
|
+
addToast(newProps);
|
|
17
|
+
}
|
|
18
|
+
export function showSuccessToast() {
|
|
19
|
+
showToast('Success');
|
|
20
|
+
}
|
|
21
|
+
export function showFailedToast() {
|
|
22
|
+
showToast('Failed');
|
|
23
|
+
}
|
|
24
|
+
export function showErrorToast() {
|
|
25
|
+
showToast('Error');
|
|
26
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './services/utils-service.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './services/utils-service.js';
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
export declare const FILE_VIEWER_HOST = "https://viewer.cloudparker.com";
|
|
2
|
+
export declare const CODE_FILE_EXTENTIONS: string[];
|
|
3
|
+
export declare const ACCEPT_IMAGE_FILES: string;
|
|
4
|
+
export declare function random(min: number, max: number): number;
|
|
5
|
+
export declare function openFilePicker(opt: {
|
|
6
|
+
accept?: string;
|
|
7
|
+
multiple?: boolean;
|
|
8
|
+
}): Promise<File | File[]>;
|
|
9
|
+
/**
|
|
10
|
+
* Default quality 1.0
|
|
11
|
+
* @param opt
|
|
12
|
+
* @returns
|
|
13
|
+
*/
|
|
14
|
+
export declare function resizeImage(opt: {
|
|
15
|
+
file: File;
|
|
16
|
+
width: number;
|
|
17
|
+
height?: number;
|
|
18
|
+
fileName?: string;
|
|
19
|
+
quality?: number;
|
|
20
|
+
type?: string;
|
|
21
|
+
}): Promise<File>;
|
|
22
|
+
export declare function downloadURI(uri: string, name: string): Promise<void>;
|
|
23
|
+
export declare function downloadFile(file: File): Promise<void>;
|
|
24
|
+
export declare function downloadBlob(blob: Blob, name: string): Promise<void>;
|
|
25
|
+
export declare function fileToDataURL(file: File): Promise<string>;
|
|
26
|
+
export declare function fileToText(file: File): Promise<string>;
|
|
27
|
+
export declare function fileToBuffer(file: File): Promise<ArrayBuffer>;
|
|
28
|
+
export declare function fileToImage(file: File): Promise<HTMLImageElement>;
|
|
29
|
+
export declare function dataUrlToImage(base64: string): Promise<any>;
|
|
30
|
+
export declare function stripBase64(data: string): string;
|
|
31
|
+
/**
|
|
32
|
+
* Function to download content from a given URL and convert it to a Base64-encoded string.
|
|
33
|
+
* @param url - The URL to download the content from.
|
|
34
|
+
* @returns A promise that resolves to the Base64-encoded string of the downloaded content.
|
|
35
|
+
*/
|
|
36
|
+
export declare function urlToBase64(url: string): Promise<string>;
|
|
37
|
+
export declare function urlToFile(url: string, givenFileName?: string, givenMimeType?: string): Promise<File>;
|
|
38
|
+
export declare function dataUrlToFile(url: string, givenFileName?: string, givenMimeType?: string): Promise<File>;
|
|
39
|
+
export declare function bufferToFile(buffer: ArrayBuffer, filename: string, mimeType: string): Promise<File>;
|
|
40
|
+
export declare function postData(url?: string, data?: {}): Promise<any>;
|
|
41
|
+
export declare function fileNameAndExt(filename: string): {
|
|
42
|
+
name: string;
|
|
43
|
+
ext: string | undefined;
|
|
44
|
+
};
|
|
45
|
+
export declare function isValidateEmail(email: string): boolean;
|
|
46
|
+
export declare function isValidURL(str: string): boolean;
|
|
47
|
+
export declare function mailto({ to, body, subject }: {
|
|
48
|
+
to: string;
|
|
49
|
+
body: string;
|
|
50
|
+
subject: string;
|
|
51
|
+
}): void;
|
|
52
|
+
export declare function copyText(str: string): void;
|
|
53
|
+
export declare function copyRichText(node: HTMLElement): void;
|
|
54
|
+
export declare function download(data: string, filename: string, type: string): void;
|
|
55
|
+
export declare function formatString(str: string, ...args: any[]): string;
|
|
56
|
+
export declare function fileSizeString(size: number): string;
|
|
57
|
+
export declare function delay(mills?: number): Promise<unknown>;
|
|
58
|
+
export declare function sort<T>({ array, field, desc, isDate }: {
|
|
59
|
+
array: T[];
|
|
60
|
+
field?: string;
|
|
61
|
+
desc?: boolean;
|
|
62
|
+
isDate?: boolean;
|
|
63
|
+
}): T[];
|
|
64
|
+
export declare function vibrate(value?: number | number[]): void;
|
|
65
|
+
export declare function playClickEffect(): void;
|
|
66
|
+
export declare function toArrayByKey(key: string, obj?: any): any[];
|
|
67
|
+
export declare function convertNumToAlphabates(num: number): string;
|
|
68
|
+
export declare function fetchText(url: string): Promise<string>;
|
|
69
|
+
export declare function isTouchDevice(): any;
|
|
70
|
+
export declare function toCurrency(value?: number, symbol?: string): string;
|
|
71
|
+
export declare function inchToPixel(inches: number): number;
|
|
72
|
+
export declare function pixelToInch(pixels: number): number;
|