@cloudparker/moldex.js 0.0.29 → 0.0.31

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.
Files changed (57) hide show
  1. package/dist/tailwind.css +1 -1
  2. package/dist/views/core/button/components/button/button.svelte +54 -33
  3. package/dist/views/core/button/components/button-back/button-back.svelte +26 -14
  4. package/dist/views/core/button/components/button-close/button-close.svelte +4 -2
  5. package/dist/views/core/button/components/button-close-icon/button-close-icon.svelte +29 -15
  6. package/dist/views/core/button/components/button-list-item/button-list-item.svelte +78 -30
  7. package/dist/views/core/button/components/button-menu/button-menu.svelte +143 -90
  8. package/dist/views/core/button/components/button-ok/button-ok.svelte +4 -2
  9. package/dist/views/core/dialog/components/dialog/dialog.svelte +245 -158
  10. package/dist/views/core/dialog/components/dialog/dialog.svelte.d.ts +2 -7
  11. package/dist/views/core/dialog/components/list-dialog/list-picker-dialog.svelte +152 -108
  12. package/dist/views/core/dialog/components/msg-dialog/msg-dialog.svelte +22 -13
  13. package/dist/views/core/dialog/index.d.ts +4 -2
  14. package/dist/views/core/dialog/index.js +2 -2
  15. package/dist/views/core/drawer/components/drawer/drawer.svelte +52 -34
  16. package/dist/views/core/icon/components/icon/icon.svelte +24 -13
  17. package/dist/views/core/input/components/color-field/color-field.svelte +71 -61
  18. package/dist/views/core/input/components/combobox-field/combobox-field.svelte +330 -248
  19. package/dist/views/core/input/components/combobox-field/combobox-field.svelte.d.ts +1 -1
  20. package/dist/views/core/input/components/date-field/date-field.svelte +10 -6
  21. package/dist/views/core/input/components/datetime-field/datetime-field.svelte +10 -6
  22. package/dist/views/core/input/components/email-field/email-field.svelte +9 -6
  23. package/dist/views/core/input/components/file-field/file-field.svelte +69 -57
  24. package/dist/views/core/input/components/input-field/input-field.svelte +251 -151
  25. package/dist/views/core/input/components/label/label.svelte +24 -10
  26. package/dist/views/core/input/components/number-field/number-field.svelte +10 -6
  27. package/dist/views/core/input/components/password-field/password-field.svelte +59 -48
  28. package/dist/views/core/input/components/phone-field/phone-field.svelte +62 -48
  29. package/dist/views/core/input/components/radio-field/radio-field.svelte +120 -0
  30. package/dist/views/core/input/components/radio-field/radio-field.svelte.d.ts +45 -0
  31. package/dist/views/core/input/components/range-field/range-field.svelte +51 -32
  32. package/dist/views/core/input/components/search-field/search-field.svelte +52 -38
  33. package/dist/views/core/input/components/text-field/text-field.svelte +9 -6
  34. package/dist/views/core/input/components/textarea-field/textarea-field.svelte +9 -6
  35. package/dist/views/core/input/components/time-field/time-field.svelte +9 -6
  36. package/dist/views/core/input/index.d.ts +4 -2
  37. package/dist/views/core/input/index.js +2 -2
  38. package/dist/views/core/navbar/components/navbar/navbar.svelte +63 -31
  39. package/dist/views/core/no-data/components/no-data/no-data.svelte +37 -20
  40. package/dist/views/core/no-data/components/no-data/no-data.svelte.d.ts +1 -1
  41. package/dist/views/core/pagination/components/pagination/pagination.svelte +100 -71
  42. package/dist/views/core/progressbar/components/progressbar/progressbar.svelte +37 -23
  43. package/dist/views/core/referrer/components/referrer.svelte +15 -13
  44. package/dist/views/core/ruler/components/vertical-ruler/verticcal-ruler.svelte +6 -2
  45. package/dist/views/core/screen-detector/components/screen-detector.svelte +13 -9
  46. package/dist/views/core/spinner/components/spinner/spinner.svelte +7 -2
  47. package/dist/views/core/text/components/text-await/text-await.svelte +8 -2
  48. package/dist/views/core/text/components/text-copy/text-copy.svelte +28 -17
  49. package/dist/views/core/text/components/text-country/text-country.svelte +41 -29
  50. package/dist/views/core/text/components/text-country-state/text-country-state.svelte +37 -29
  51. package/dist/views/core/text/components/text-currency/text-currency.svelte +21 -10
  52. package/dist/views/core/text/components/text-date/text-date.svelte +33 -21
  53. package/dist/views/core/text/components/text-email/text-email.svelte +13 -4
  54. package/dist/views/core/text/components/text-html/text-html.svelte +3 -2
  55. package/dist/views/core/text/components/text-phone/text-phone.svelte +13 -4
  56. package/dist/views/core/toast/components/toast/toast.svelte +44 -21
  57. package/package.json +1 -1
@@ -1,32 +1,40 @@
1
- <script lang="ts">import "../../../../../tailwind.css";
2
- import EasyScriptLoader from "@cloudparker/easy-script-loader-svelte";
3
- import { BROWSER } from "esm-env";
4
- let { input } = $props();
5
- let states = $state([]);
6
- let state = $state(null);
7
- let EasyCountryStateData;
8
- async function init() {
9
- if (EasyCountryStateData) {
10
- states = EasyCountryStateData.getStates() || [];
11
- }
12
- }
13
- async function prepare(..._) {
14
- if (input) {
15
- await init();
16
- if (states?.length) {
17
- state = states.find((o) => o._id == input);
18
- }
19
- } else {
20
- state = null;
21
- }
22
- }
23
- function handleScriptLoad(ev) {
24
- EasyCountryStateData = ev.detail;
25
- init();
26
- }
27
- $effect(() => {
28
- BROWSER && prepare(input, states);
29
- });
1
+ <script lang="ts">
2
+ import '../../../../../tailwind.css';
3
+ import EasyScriptLoader from '@cloudparker/easy-script-loader-svelte';
4
+ import { BROWSER } from 'esm-env';
5
+
6
+ let { input }: { input: string } = $props();
7
+
8
+ let states: any[] = $state([]);
9
+ let state: any | null = $state(null);
10
+
11
+ let EasyCountryStateData: any;
12
+
13
+ async function init() {
14
+ if (EasyCountryStateData) {
15
+ states = EasyCountryStateData.getStates() || [];
16
+ }
17
+ }
18
+
19
+ async function prepare(..._: any) {
20
+ if (input) {
21
+ await init();
22
+ if (states?.length) {
23
+ state = states.find((o) => o._id == input);
24
+ }
25
+ } else {
26
+ state = null;
27
+ }
28
+ }
29
+
30
+ function handleScriptLoad(ev: CustomEvent) {
31
+ EasyCountryStateData = ev.detail;
32
+ init();
33
+ }
34
+
35
+ $effect(() => {
36
+ BROWSER && prepare(input, states);
37
+ });
30
38
  </script>
31
39
 
32
40
  <EasyScriptLoader
@@ -1,13 +1,24 @@
1
- <script lang="ts">import "../../../../../tailwind.css";
2
- import { BROWSER } from "esm-env";
3
- let { input, symbol = "$", hasSymbol = true } = $props();
4
- let value = $state("");
5
- function prepare(..._) {
6
- value = Math.abs(input || 0).toFixed(2);
7
- }
8
- $effect(() => {
9
- BROWSER && prepare(input);
10
- });
1
+ <script lang="ts">
2
+ import '../../../../../tailwind.css';
3
+ import { BROWSER } from 'esm-env';
4
+
5
+ type PropsType = {
6
+ input: number;
7
+ symbol: string;
8
+ hasSymbol: boolean;
9
+ };
10
+
11
+ let { input, symbol = '$', hasSymbol = true }: PropsType = $props();
12
+
13
+ let value: string = $state('');
14
+
15
+ function prepare(..._: any) {
16
+ value = Math.abs(input || 0).toFixed(2);
17
+ }
18
+
19
+ $effect(() => {
20
+ BROWSER && prepare(input);
21
+ });
11
22
  </script>
12
23
 
13
24
  <span>
@@ -1,24 +1,36 @@
1
- <script lang="ts">import "../../../../../tailwind.css";
2
- import { dateFormat, dateToAgo, toDate } from "../../../../../services";
3
- import { BROWSER } from "esm-env";
4
- let { input, format = "DD-MM-YYYY hh:mm a" } = $props();
5
- let dateString = $state("");
6
- function prepareDate(..._) {
7
- let date;
8
- if (input) {
9
- date = toDate(input);
10
- }
11
- if (date) {
12
- if (format == "ago") {
13
- dateString = dateToAgo(date);
14
- } else {
15
- dateString = dateFormat(date, format);
16
- }
17
- }
18
- }
19
- $effect(() => {
20
- BROWSER && prepareDate(input);
21
- });
1
+ <script lang="ts">
2
+ import '../../../../../tailwind.css';
3
+ import { dateFormat, dateToAgo, toDate } from '../../../../../services';
4
+
5
+ import { BROWSER } from 'esm-env';
6
+
7
+ type PropsType = {
8
+ input: Date | number | string | { seconds: number; nanoseconds: number };
9
+ format?: 'ago' | string;
10
+ };
11
+
12
+ let { input, format = 'DD-MM-YYYY hh:mm a' }: PropsType = $props();
13
+
14
+ let dateString: string = $state('');
15
+
16
+ function prepareDate(..._: any) {
17
+ // console.log('date data', data);
18
+ let date: Date | undefined;
19
+ if (input) {
20
+ date = toDate(input);
21
+ }
22
+ if (date) {
23
+ if (format == 'ago') {
24
+ dateString = dateToAgo(date)!;
25
+ } else {
26
+ dateString = dateFormat(date, format)!;
27
+ }
28
+ }
29
+ }
30
+
31
+ $effect(() => {
32
+ BROWSER && prepareDate(input);
33
+ });
22
34
  </script>
23
35
 
24
36
  <span>
@@ -1,7 +1,16 @@
1
- <script lang="ts">import "../../../../../tailwind.css";
2
- import { ripple } from "../../../../../actions";
3
- import { Icon, mdiEmailOutline } from "../../../icon";
4
- let { input, buttonClassName, iconClassName, iconPath = mdiEmailOutline } = $props();
1
+ <script lang="ts">
2
+ import '../../../../../tailwind.css';
3
+ import { ripple } from '../../../../../actions';
4
+ import { Icon, mdiEmailOutline } from '../../../icon';
5
+
6
+ type PropsType = {
7
+ input: string;
8
+ buttonClassName?: string;
9
+ iconPath?: string;
10
+ iconClassName?: string;
11
+ };
12
+
13
+ let { input, buttonClassName, iconClassName, iconPath = mdiEmailOutline }: PropsType = $props();
5
14
  </script>
6
15
 
7
16
  <span class="flex items-center">
@@ -1,5 +1,6 @@
1
- <script lang="ts">import "../../../../../tailwind.css";
2
- let { input } = $props();
1
+ <script lang="ts">
2
+ import '../../../../../tailwind.css';
3
+ let { input }: { input: string } = $props();
3
4
  </script>
4
5
 
5
6
  <span>
@@ -1,7 +1,16 @@
1
- <script lang="ts">import { mdiPhone } from "../../../icon";
2
- import Icon from "../../../icon/components/icon/icon.svelte";
3
- import "../../../../../tailwind.css";
4
- let { input, buttonClassName, iconClassName, iconPath = mdiPhone } = $props();
1
+ <script lang="ts">
2
+ import { mdiPhone } from '../../../icon';
3
+ import Icon from '../../../icon/components/icon/icon.svelte';
4
+ import '../../../../../tailwind.css';
5
+
6
+ type PropsType = {
7
+ input: string;
8
+ buttonClassName?: string;
9
+ iconPath?: string;
10
+ iconClassName?: string;
11
+ };
12
+
13
+ let { input, buttonClassName, iconClassName, iconPath = mdiPhone }: PropsType = $props();
5
14
  </script>
6
15
 
7
16
  <span class="flex items-center">
@@ -1,24 +1,47 @@
1
- <script module lang="ts"></script>
2
-
3
- <script lang="ts">import "../../../../../tailwind.css";
4
- let isPlaced = $state(false);
5
- let isOpened = $state(false);
6
- let { id, msg, duration = 3e3, className, children } = $props();
7
- export function openToast() {
8
- isPlaced = true;
9
- setTimeout(() => {
10
- isOpened = true;
11
- setTimeout(() => {
12
- closeClose();
13
- }, duration);
14
- }, 0);
15
- }
16
- export function closeClose() {
17
- isOpened = false;
18
- setTimeout(() => {
19
- isPlaced = false;
20
- }, 300);
21
- }
1
+ <script module lang="ts">
2
+ import type { Snippet } from 'svelte';
3
+
4
+ export type ToastPropsType = {
5
+ id?: string;
6
+ msg: string;
7
+ duration?: number;
8
+ className?: string;
9
+ children?: Snippet;
10
+ };
11
+ </script>
12
+
13
+ <script lang="ts">
14
+ import '../../../../../tailwind.css';
15
+
16
+ let isPlaced: boolean = $state(false);
17
+ let isOpened: boolean = $state(false);
18
+
19
+ let { id, msg, duration = 3000, className, children }: ToastPropsType = $props();
20
+
21
+ // export function toggleDialog() {
22
+ // if (isOpened) {
23
+ // closeDialog();
24
+ // } else {
25
+ // openDialog();
26
+ // }
27
+ // }
28
+
29
+ export function openToast() {
30
+ isPlaced = true;
31
+ setTimeout(() => {
32
+ isOpened = true;
33
+ setTimeout(() => {
34
+ closeClose();
35
+ }, duration);
36
+ }, 0);
37
+ }
38
+
39
+ export function closeClose() {
40
+ isOpened = false;
41
+ setTimeout(() => {
42
+ isPlaced = false;
43
+ }, 300);
44
+ }
22
45
  </script>
23
46
 
24
47
  {#if isPlaced}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cloudparker/moldex.js",
3
- "version": "0.0.29",
3
+ "version": "0.0.31",
4
4
  "author": "cloudparker.com",
5
5
  "license": "MIT",
6
6
  "keywords": [