@cloudparker/moldex.js 0.0.29 → 0.0.30

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 (50) hide show
  1. package/dist/views/core/button/components/button/button.svelte +54 -33
  2. package/dist/views/core/button/components/button-back/button-back.svelte +26 -14
  3. package/dist/views/core/button/components/button-close/button-close.svelte +4 -2
  4. package/dist/views/core/button/components/button-close-icon/button-close-icon.svelte +29 -15
  5. package/dist/views/core/button/components/button-list-item/button-list-item.svelte +78 -30
  6. package/dist/views/core/button/components/button-menu/button-menu.svelte +143 -90
  7. package/dist/views/core/button/components/button-ok/button-ok.svelte +4 -2
  8. package/dist/views/core/dialog/components/dialog/dialog.svelte +245 -158
  9. package/dist/views/core/dialog/components/dialog/dialog.svelte.d.ts +2 -7
  10. package/dist/views/core/dialog/components/list-dialog/list-picker-dialog.svelte +152 -108
  11. package/dist/views/core/dialog/components/msg-dialog/msg-dialog.svelte +22 -13
  12. package/dist/views/core/dialog/index.d.ts +4 -2
  13. package/dist/views/core/dialog/index.js +2 -2
  14. package/dist/views/core/drawer/components/drawer/drawer.svelte +52 -34
  15. package/dist/views/core/icon/components/icon/icon.svelte +24 -13
  16. package/dist/views/core/input/components/color-field/color-field.svelte +71 -61
  17. package/dist/views/core/input/components/combobox-field/combobox-field.svelte +330 -248
  18. package/dist/views/core/input/components/date-field/date-field.svelte +10 -6
  19. package/dist/views/core/input/components/datetime-field/datetime-field.svelte +10 -6
  20. package/dist/views/core/input/components/email-field/email-field.svelte +9 -6
  21. package/dist/views/core/input/components/file-field/file-field.svelte +69 -57
  22. package/dist/views/core/input/components/input-field/input-field.svelte +251 -151
  23. package/dist/views/core/input/components/label/label.svelte +24 -10
  24. package/dist/views/core/input/components/number-field/number-field.svelte +10 -6
  25. package/dist/views/core/input/components/password-field/password-field.svelte +59 -48
  26. package/dist/views/core/input/components/phone-field/phone-field.svelte +62 -48
  27. package/dist/views/core/input/components/range-field/range-field.svelte +51 -32
  28. package/dist/views/core/input/components/search-field/search-field.svelte +52 -38
  29. package/dist/views/core/input/components/text-field/text-field.svelte +9 -6
  30. package/dist/views/core/input/components/textarea-field/textarea-field.svelte +9 -6
  31. package/dist/views/core/input/components/time-field/time-field.svelte +9 -6
  32. package/dist/views/core/navbar/components/navbar/navbar.svelte +63 -31
  33. package/dist/views/core/no-data/components/no-data/no-data.svelte +37 -20
  34. package/dist/views/core/pagination/components/pagination/pagination.svelte +100 -71
  35. package/dist/views/core/progressbar/components/progressbar/progressbar.svelte +37 -23
  36. package/dist/views/core/referrer/components/referrer.svelte +15 -13
  37. package/dist/views/core/ruler/components/vertical-ruler/verticcal-ruler.svelte +6 -2
  38. package/dist/views/core/screen-detector/components/screen-detector.svelte +13 -9
  39. package/dist/views/core/spinner/components/spinner/spinner.svelte +7 -2
  40. package/dist/views/core/text/components/text-await/text-await.svelte +8 -2
  41. package/dist/views/core/text/components/text-copy/text-copy.svelte +28 -17
  42. package/dist/views/core/text/components/text-country/text-country.svelte +41 -29
  43. package/dist/views/core/text/components/text-country-state/text-country-state.svelte +37 -29
  44. package/dist/views/core/text/components/text-currency/text-currency.svelte +21 -10
  45. package/dist/views/core/text/components/text-date/text-date.svelte +33 -21
  46. package/dist/views/core/text/components/text-email/text-email.svelte +13 -4
  47. package/dist/views/core/text/components/text-html/text-html.svelte +3 -2
  48. package/dist/views/core/text/components/text-phone/text-phone.svelte +13 -4
  49. package/dist/views/core/toast/components/toast/toast.svelte +44 -21
  50. package/package.json +1 -1
@@ -1,37 +1,58 @@
1
- <script module lang="ts"></script>
1
+ <script module lang="ts">
2
+ export type ButtonPropsType = {
3
+ id?: string;
4
+ type?: 'button' | 'submit' | 'reset';
5
+ form?: string | null;
6
+ className?: string;
7
+ iconPath?: string;
8
+ iconClassName?: string;
9
+ label?: string;
10
+ rightIconPath?: string;
11
+ rightIconClassName?: string;
12
+ spinner?: boolean;
13
+ disabled?: boolean;
14
+ spinnerClassName?: string;
15
+ onlySpinner?: boolean;
16
+ children?: Snippet;
17
+ useRipple?: boolean;
18
+ onClick?: (ev: MouseEvent) => void;
19
+ };
20
+ </script>
21
+
22
+ <script lang="ts">
23
+ import '../../../../../tailwind.css';
24
+ import { ripple, type RipplePropsType } from '../../../../../actions/ripple.js';
25
+ import type { Snippet } from 'svelte';
26
+ import { Spinner } from '../../../spinner';
27
+ import { Icon } from '../../../icon';
28
+
29
+ let {
30
+ id = '',
31
+ form = undefined,
32
+ type = 'button',
33
+ label = '',
34
+ className = '',
35
+ iconPath = '',
36
+ iconClassName = '',
37
+ rightIconPath = '',
38
+ rightIconClassName = '',
39
+ spinner = false,
40
+ disabled = false,
41
+ spinnerClassName = '',
42
+ onlySpinner = false,
43
+ children,
44
+ useRipple = true,
45
+ onClick = (ev: MouseEvent) => {}
46
+ }: ButtonPropsType = $props();
2
47
 
3
- <script lang="ts">import "../../../../../tailwind.css";
4
- import { ripple } from "../../../../../actions/ripple.js";
5
- import { Spinner } from "../../../spinner";
6
- import { Icon } from "../../../icon";
7
- let {
8
- id = "",
9
- form = void 0,
10
- type = "button",
11
- label = "",
12
- className = "",
13
- iconPath = "",
14
- iconClassName = "",
15
- rightIconPath = "",
16
- rightIconClassName = "",
17
- spinner = false,
18
- disabled = false,
19
- spinnerClassName = "",
20
- onlySpinner = false,
21
- children,
22
- useRipple = true,
23
- onClick = (ev) => {
24
- }
25
- } = $props();
26
- function maybeRipple(node, options) {
27
- if (useRipple) {
28
- return ripple(node, options);
29
- }
30
- return {
31
- destroy() {
32
- }
33
- };
34
- }
48
+ function maybeRipple(node: HTMLElement, options?: RipplePropsType) {
49
+ if (useRipple) {
50
+ return ripple(node, options);
51
+ }
52
+ return {
53
+ destroy() {}
54
+ };
55
+ }
35
56
  </script>
36
57
 
37
58
  {#snippet buttonContent()}
@@ -1,17 +1,29 @@
1
- <script lang="ts">import { isSmallScreen } from "../../../../../services";
2
- import { mdiArrowLeft, mdiChevronRight } from "../../../icon";
3
- import Button from "../button/button.svelte";
4
- let {
5
- iconPath = mdiArrowLeft,
6
- iconClassName = "",
7
- className = "",
8
- onlyMobile,
9
- onClick
10
- } = $props();
11
- let isMobileScreen = $state(false);
12
- $effect(() => {
13
- isMobileScreen = isSmallScreen();
14
- });
1
+ <script lang="ts">
2
+ import { isSmallScreen } from '../../../../../services';
3
+ import { mdiArrowLeft, mdiChevronRight } from '../../../icon';
4
+ import Button from '../button/button.svelte';
5
+
6
+ type PropsType = {
7
+ iconPath?: string;
8
+ iconClassName?: string;
9
+ className?: string;
10
+ onlyMobile?: boolean;
11
+ onClick?: (ev: MouseEvent) => void;
12
+ };
13
+
14
+ let {
15
+ iconPath = mdiArrowLeft,
16
+ iconClassName = '',
17
+ className = '',
18
+ onlyMobile,
19
+ onClick
20
+ }: PropsType = $props();
21
+
22
+ let isMobileScreen = $state(false);
23
+
24
+ $effect(() => {
25
+ isMobileScreen = isSmallScreen();
26
+ });
15
27
  </script>
16
28
 
17
29
  {#snippet button()}
@@ -1,5 +1,7 @@
1
- <script lang="ts">import Button, {} from "../button/button.svelte";
2
- let { className, ...props } = $props();
1
+ <script lang="ts">
2
+ import Button, { type ButtonPropsType } from '../button/button.svelte';
3
+
4
+ let { className, ...props }: ButtonPropsType = $props();
3
5
  </script>
4
6
 
5
7
  <Button {...props} className="bg-gray-100 focus:bg-gray-200 p-2 px-4 {className}" />
@@ -1,18 +1,32 @@
1
- <script lang="ts">import { isSmallScreen } from "../../../../../services";
2
- import { mdiArrowLeft, mdiChevronRight, mdiClose } from "../../../icon";
3
- import Button from "../button/button.svelte";
4
- let {
5
- label = "Close",
6
- iconPath = mdiClose,
7
- iconClassName = "",
8
- className = "",
9
- onlyWeb,
10
- onClick
11
- } = $props();
12
- let isMobileScreen = $state(false);
13
- $effect(() => {
14
- isMobileScreen = isSmallScreen();
15
- });
1
+ <script lang="ts">
2
+ import { isSmallScreen } from '../../../../../services';
3
+ import { mdiArrowLeft, mdiChevronRight, mdiClose } from '../../../icon';
4
+ import Button from '../button/button.svelte';
5
+
6
+ type PropsType = {
7
+ label?: string;
8
+ iconPath?: string;
9
+ iconClassName?: string;
10
+ className?: string;
11
+ onlyWeb?: boolean;
12
+
13
+ onClick?: (ev: MouseEvent) => void;
14
+ };
15
+
16
+ let {
17
+ label = 'Close',
18
+ iconPath = mdiClose,
19
+ iconClassName = '',
20
+ className = '',
21
+ onlyWeb,
22
+ onClick
23
+ }: PropsType = $props();
24
+
25
+ let isMobileScreen = $state(false);
26
+
27
+ $effect(() => {
28
+ isMobileScreen = isSmallScreen();
29
+ });
16
30
  </script>
17
31
 
18
32
  {#snippet button()}
@@ -1,34 +1,82 @@
1
- <script module lang="ts"></script>
1
+ <script module lang="ts">
2
+ export type ListItemType = {
3
+ id?: string;
4
+ title?: string;
5
+ subtitle?: string;
6
+ titleClassName?: string;
7
+ subtitleClassName?: string;
8
+ url?: string;
9
+ disabled?: boolean;
10
+ iconPath?: string;
11
+ iconClassName?: string;
12
+ imgSrc?: string;
13
+ imgClassName?: string;
14
+ className?: string;
15
+ openInNewWindow?: boolean;
16
+ divider?: boolean;
17
+ hasArrow?: boolean;
18
+ arrowIconPath?: string;
19
+ arrowClassName?: string;
20
+ isChecked?: boolean;
21
+ onclick?: (ev: MouseEvent, item: ListItemType) => void;
22
+ };
23
+ </script>
24
+
25
+ <script lang="ts">
26
+ import '../../../../../tailwind.css';
27
+ import { ripple } from '../../../../../actions/ripple.js';
28
+
29
+ import type { Snippet } from 'svelte';
30
+ import {
31
+ Icon,
32
+ mdiCheckCircle,
33
+ mdiCheckCircleOutline,
34
+ mdiChevronRight
35
+ } from '../../../icon';
36
+
37
+ type PropsType = {
38
+ item: ListItemType;
39
+ index: number;
40
+ id?: string;
41
+ className?: string;
42
+ hasCheckbox?: boolean;
43
+ checkIconPath?: string;
44
+ uncheckIconPath?: string;
45
+ checkIconClassName?: string;
46
+ uncheckIconClassName?: string;
47
+ checkClassName?: string;
48
+ iconClassName?: string;
49
+ imgClassName?: string;
50
+ titleClassName?: string;
51
+ subtitleClassName?: string;
52
+ hasArrow?: boolean;
53
+ arrowIconPath?: string;
54
+ arrowClassName?: string;
55
+ onClick?: (ev: MouseEvent, item: ListItemType, index: number) => void;
56
+ children?: Snippet<[ListItemType, number]>;
57
+ };
2
58
 
3
- <script lang="ts">import "../../../../../tailwind.css";
4
- import { ripple } from "../../../../../actions/ripple.js";
5
- import {
6
- Icon,
7
- mdiCheckCircle,
8
- mdiCheckCircleOutline,
9
- mdiChevronRight
10
- } from "../../../icon";
11
- let {
12
- item,
13
- index,
14
- id = "",
15
- className = "",
16
- hasCheckbox = false,
17
- uncheckIconPath = mdiCheckCircleOutline,
18
- checkIconPath = mdiCheckCircle,
19
- checkIconClassName = "",
20
- uncheckIconClassName = "",
21
- iconClassName = "",
22
- imgClassName = "",
23
- titleClassName = "",
24
- subtitleClassName = "",
25
- checkClassName = "",
26
- hasArrow = false,
27
- arrowIconPath = mdiChevronRight,
28
- arrowClassName = "",
29
- onClick,
30
- children
31
- } = $props();
59
+ let {
60
+ item,
61
+ index,
62
+ id = '',
63
+ className = '',
64
+ hasCheckbox = false,
65
+ uncheckIconPath = mdiCheckCircleOutline,
66
+ checkIconPath = mdiCheckCircle,
67
+ checkIconClassName = '',
68
+ uncheckIconClassName = '',
69
+ iconClassName = '',
70
+ imgClassName = '',
71
+ titleClassName = '',
72
+ subtitleClassName = '',
73
+ checkClassName = '',
74
+ hasArrow = false,
75
+ arrowIconPath = mdiChevronRight,
76
+ arrowClassName = '',
77
+ onClick,
78
+ children
79
+ }: PropsType = $props();
32
80
  </script>
33
81
 
34
82
  {#snippet itemInternal()}
@@ -1,93 +1,146 @@
1
- <script lang="ts">import "../../../../../tailwind.css";
2
- import { ripple } from "../../../../../actions/ripple.js";
3
- import { Icon, mdiCheckCircle, mdiCheckCircleOutline, mdiChevronDown } from "../../../icon";
4
- import ButtonListItem from "../button-list-item/button-list-item.svelte";
5
- var MenuStateEnum = /* @__PURE__ */ ((MenuStateEnum2) => {
6
- MenuStateEnum2[MenuStateEnum2["OPENED"] = 0] = "OPENED";
7
- MenuStateEnum2[MenuStateEnum2["CLOSED"] = 1] = "CLOSED";
8
- return MenuStateEnum2;
9
- })(MenuStateEnum || {});
10
- let {
11
- id = "menu",
12
- className = "",
13
- screenOnlyDesc = "Menu",
14
- style = "",
15
- imgSrc = "",
16
- imgClassName = "",
17
- imgAlt = "Menu",
18
- leftIconPath = "",
19
- leftIconClassName = "",
20
- rightIconPath = "",
21
- rightIconClassName = "",
22
- dropIconPath = mdiChevronDown,
23
- dropIconClassName = "",
24
- titleClassName = "",
25
- title = "Button",
26
- dropdownStyle = "",
27
- dropdownClassName = "",
28
- hasCheck = false,
29
- uncheckIconPath = mdiCheckCircleOutline,
30
- checkIconPath = mdiCheckCircle,
31
- checkIconClassName = "",
32
- containerClassName = "",
33
- backgropClassName = "",
34
- menus = [],
35
- menuItemClassName = "",
36
- uncheckIconClassName = "",
37
- dropdownOpenClassName = "",
38
- dropdownCloseClassName = "",
39
- checkClassName = "",
40
- listIconClassName = "",
41
- listImgClassName = "",
42
- listTitleClassName = "",
43
- listSubtitleClassName = "",
44
- dividerClassName = "",
45
- onmenuclick = (ev, item, index) => {
46
- },
47
- children,
48
- buttonSnippet,
49
- menuItemSnippet,
50
- menuItemInnerSnippet
51
- } = $props();
52
- let expanded = $state(false);
53
- let dropdownState = $state(1 /* CLOSED */);
54
- let options = $state([]);
55
- let selectedMenu = $state(null);
56
- function hendleToggleDropdown(ev) {
57
- ev && ev.stopPropagation();
58
- if (dropdownState == 1 /* CLOSED */) {
59
- dropdownState = 0 /* OPENED */;
60
- } else {
61
- dropdownState = 1 /* CLOSED */;
62
- }
63
- }
64
- function handlemenuItemClick(ev, menu, index) {
65
- hendleToggleDropdown(ev);
66
- if (onmenuclick) {
67
- let item = menus[index];
68
- if (item) {
69
- onmenuclick(ev, item, index);
70
- }
71
- selectedMenu = menu;
72
- }
73
- }
74
- $effect(() => {
75
- if (menus?.length) {
76
- let item = menus[0];
77
- if (typeof item == "string") {
78
- options = menus.map((str) => {
79
- if (str == "-" || str == "") {
80
- return { divider: true };
81
- } else {
82
- return { label: str };
83
- }
84
- });
85
- } else {
86
- }
87
- } else {
88
- options = [];
89
- }
90
- });
1
+ <script lang="ts">
2
+ import '../../../../../tailwind.css';
3
+
4
+ import { ripple } from '../../../../../actions/ripple.js';
5
+
6
+ import { Icon, mdiCheckCircle, mdiCheckCircleOutline, mdiChevronDown } from '../../../icon';
7
+ import type { Snippet } from 'svelte';
8
+ import type { ListItemType } from '../button-list-item/button-list-item.svelte';
9
+ import ButtonListItem from '../button-list-item/button-list-item.svelte';
10
+
11
+ enum MenuStateEnum {
12
+ OPENED,
13
+ CLOSED
14
+ }
15
+
16
+ type PropsType = {
17
+ id?: string;
18
+ className?: string;
19
+ screenOnlyDesc?: string;
20
+ style?: string;
21
+ disabled?: boolean | undefined | null;
22
+ imgSrc?:string;
23
+ imgClassName?: string;
24
+ imgAlt?: string;
25
+ leftIconPath?: string;
26
+ leftIconClassName?: string;
27
+ rightIconPath?: string;
28
+ rightIconClassName?: string;
29
+ title?: string | any;
30
+ titleClassName?: string;
31
+ dropdownClassName?: string;
32
+ dropdownStyle?: string;
33
+ hasCheck?: boolean;
34
+ checkIconPath?: string;
35
+ checkIconClassName?: string;
36
+ menus?: string[] | ListItemType[];
37
+ containerClassName?: string;
38
+ backgropClassName?: string;
39
+ menuItemClassName?: string;
40
+ uncheckIconPath?: string;
41
+ uncheckIconClassName?: string;
42
+ dropdownOpenClassName?: string;
43
+ dropdownCloseClassName?: string;
44
+ checkClassName?: string;
45
+ listIconClassName?: string;
46
+ listImgClassName?: string;
47
+ listTitleClassName?: string;
48
+ listSubtitleClassName?: string;
49
+ dividerClassName?: string;
50
+ dropIconPath?: string;
51
+ dropIconClassName?: string;
52
+ onmenuclick?: (ev: MouseEvent, item: string | ListItemType, index: number) => void;
53
+ children?: Snippet;
54
+ buttonSnippet?: Snippet;
55
+ menuItemSnippet?: Snippet<[ListItemType, number]>;
56
+ menuItemInnerSnippet?: Snippet<[ListItemType, number]>;
57
+ };
58
+
59
+ let {
60
+ id = 'menu',
61
+ className = '',
62
+ screenOnlyDesc = 'Menu',
63
+ style = '',
64
+ imgSrc = '',
65
+ imgClassName = '',
66
+ imgAlt = 'Menu',
67
+ leftIconPath = '',
68
+ leftIconClassName = '',
69
+ rightIconPath = '',
70
+ rightIconClassName = '',
71
+ dropIconPath = mdiChevronDown,
72
+ dropIconClassName = '',
73
+ titleClassName = '',
74
+ title = 'Button',
75
+ dropdownStyle = '',
76
+ dropdownClassName = '',
77
+ hasCheck = false,
78
+ uncheckIconPath = mdiCheckCircleOutline,
79
+ checkIconPath = mdiCheckCircle,
80
+ checkIconClassName = '',
81
+ containerClassName = '',
82
+ backgropClassName = '',
83
+ menus = [],
84
+ menuItemClassName = '',
85
+ uncheckIconClassName = '',
86
+ dropdownOpenClassName = '',
87
+ dropdownCloseClassName = '',
88
+ checkClassName = '',
89
+ listIconClassName = '',
90
+ listImgClassName = '',
91
+ listTitleClassName = '',
92
+ listSubtitleClassName = '',
93
+ dividerClassName = '',
94
+ onmenuclick = (ev: MouseEvent, item: string | ListItemType, index: number) => {},
95
+ children,
96
+ buttonSnippet,
97
+ menuItemSnippet,
98
+ menuItemInnerSnippet
99
+ }: PropsType = $props();
100
+
101
+ let expanded = $state(false);
102
+ let dropdownState: MenuStateEnum = $state(MenuStateEnum.CLOSED);
103
+ let options: ListItemType[] = $state([]);
104
+ let selectedMenu: ListItemType | null | undefined = $state(null);
105
+
106
+ function hendleToggleDropdown(ev: MouseEvent) {
107
+ ev && ev.stopPropagation();
108
+ if (dropdownState == MenuStateEnum.CLOSED) {
109
+ dropdownState = MenuStateEnum.OPENED;
110
+ } else {
111
+ dropdownState = MenuStateEnum.CLOSED;
112
+ }
113
+ }
114
+
115
+ function handlemenuItemClick(ev: MouseEvent, menu: ListItemType, index: number) {
116
+ hendleToggleDropdown(ev);
117
+ if (onmenuclick) {
118
+ let item = menus[index];
119
+
120
+ if (item) {
121
+ onmenuclick(ev, item, index);
122
+ }
123
+ selectedMenu = menu;
124
+ }
125
+ }
126
+
127
+ $effect(() => {
128
+ if (menus?.length) {
129
+ let item = menus[0];
130
+ if (typeof item == 'string') {
131
+ options = menus.map((str) => {
132
+ if (str == '-' || str == '') {
133
+ return { divider: true } as ListItemType;
134
+ } else {
135
+ return { label: str } as ListItemType;
136
+ }
137
+ });
138
+ } else {
139
+ }
140
+ } else {
141
+ options = [];
142
+ }
143
+ });
91
144
  </script>
92
145
 
93
146
  <div class="relative min-h-max {containerClassName}">
@@ -1,5 +1,7 @@
1
- <script lang="ts">import Button, {} from "../button/button.svelte";
2
- let { className, ...props } = $props();
1
+ <script lang="ts">
2
+ import Button, { type ButtonPropsType } from '../button/button.svelte';
3
+
4
+ let { className, ...props }: ButtonPropsType = $props();
3
5
  </script>
4
6
 
5
7
  <Button {...props} className="bg-indigo-600 focus:bg-indigo-700 text-white p-2 px-4 {className}" />