@cloudparker/moldex.js 0.0.124 → 4.1.1

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 (69) hide show
  1. package/dist/types.d.ts +6 -0
  2. package/dist/types.js +7 -0
  3. package/dist/views/core/button/components/button/button.svelte +135 -83
  4. package/dist/views/core/button/components/button-back/button-back.svelte +28 -15
  5. package/dist/views/core/button/components/button-close/button-close.svelte +4 -2
  6. package/dist/views/core/button/components/button-close-icon/button-close-icon.svelte +29 -15
  7. package/dist/views/core/button/components/button-dropdown/button-dropdown.svelte +96 -72
  8. package/dist/views/core/button/components/button-dropdown/button-dropdown.svelte.d.ts +1 -1
  9. package/dist/views/core/button/components/button-list-item/button-list-item.svelte +98 -52
  10. package/dist/views/core/button/components/button-menu/button-menu.svelte +79 -43
  11. package/dist/views/core/button/components/button-ok/button-ok.svelte +4 -2
  12. package/dist/views/core/button/components/button-search/button-search.svelte +45 -21
  13. package/dist/views/core/button/components/switch/switch.svelte +50 -37
  14. package/dist/views/core/common/components/content-area/content-area.svelte +40 -27
  15. package/dist/views/core/common/components/loading/loading.svelte +9 -2
  16. package/dist/views/core/common/components/virtual-scrolling/virtual-scrolling-list.svelte +37 -20
  17. package/dist/views/core/dialog/components/cropper-dialog/cropper-dialog.svelte +52 -36
  18. package/dist/views/core/dialog/components/dialog/dialog.svelte +298 -177
  19. package/dist/views/core/dialog/components/loading-dialog/loading-dialog.svelte +30 -18
  20. package/dist/views/core/dialog/components/msg-dialog/msg-dialog.svelte +17 -7
  21. package/dist/views/core/dialog/components/number-field-dialog/number-field-dialog.svelte +41 -26
  22. package/dist/views/core/dialog/components/picker-dialog/picker-dialog.svelte +150 -105
  23. package/dist/views/core/dialog/components/text-field-dialog/text-field-dialog.svelte +40 -25
  24. package/dist/views/core/dialog/components/textarea-field-dialog/textarea-field-dialog.svelte +40 -25
  25. package/dist/views/core/drawer/components/drawer/drawer.svelte +58 -36
  26. package/dist/views/core/icon/components/icon/icon.svelte +24 -12
  27. package/dist/views/core/icon/components/icon-circle/icon-circle.svelte +10 -2
  28. package/dist/views/core/input/components/checkbox-field/checkbox-field.svelte +44 -25
  29. package/dist/views/core/input/components/color-field/color-field.svelte +81 -69
  30. package/dist/views/core/input/components/combobox-field/combobox-field.svelte +359 -269
  31. package/dist/views/core/input/components/date-field/date-field.svelte +39 -30
  32. package/dist/views/core/input/components/datetime-field/datetime-field.svelte +18 -12
  33. package/dist/views/core/input/components/email-field/email-field.svelte +17 -12
  34. package/dist/views/core/input/components/file-field/file-field.svelte +78 -64
  35. package/dist/views/core/input/components/input-field/input-field.svelte +267 -164
  36. package/dist/views/core/input/components/label/label.svelte +24 -10
  37. package/dist/views/core/input/components/number-field/number-field.svelte +18 -12
  38. package/dist/views/core/input/components/password-field/password-field.svelte +70 -57
  39. package/dist/views/core/input/components/phone-field/phone-field.svelte +155 -104
  40. package/dist/views/core/input/components/radio-field/radio-field.svelte +83 -52
  41. package/dist/views/core/input/components/range-field/range-field.svelte +67 -44
  42. package/dist/views/core/input/components/search-field/search-field.svelte +62 -45
  43. package/dist/views/core/input/components/text-field/text-field.svelte +21 -16
  44. package/dist/views/core/input/components/textarea-field/textarea-field.svelte +17 -12
  45. package/dist/views/core/input/components/time-field/time-field.svelte +17 -12
  46. package/dist/views/core/navbar/components/navbar/navbar.svelte +76 -38
  47. package/dist/views/core/no-data/components/no-data/no-data.svelte +36 -19
  48. package/dist/views/core/pagination/components/pagination/pagination.svelte +90 -66
  49. package/dist/views/core/progressbar/components/progressbar/progressbar.svelte +36 -22
  50. package/dist/views/core/ruler/components/vertical-ruler/verticcal-ruler.svelte +5 -1
  51. package/dist/views/core/screen-detector/components/screen-detector.svelte +13 -9
  52. package/dist/views/core/sidebar/components/sidebar.svelte +36 -23
  53. package/dist/views/core/spinner/components/spinner/spinner.svelte +6 -1
  54. package/dist/views/core/text/components/text-await/text-await.svelte +9 -1
  55. package/dist/views/core/text/components/text-copy/text-copy.svelte +27 -16
  56. package/dist/views/core/text/components/text-currency/text-currency.svelte +13 -2
  57. package/dist/views/core/text/components/text-date/text-date.svelte +32 -20
  58. package/dist/views/core/text/components/text-email/text-email.svelte +12 -3
  59. package/dist/views/core/text/components/text-html/text-html.svelte +2 -1
  60. package/dist/views/core/text/components/text-phone/text-phone.svelte +12 -3
  61. package/dist/views/core/toast/components/toast/toast.svelte +43 -20
  62. package/dist/views/extra/fields/country-combobox-field.svelte +23 -15
  63. package/dist/views/extra/loaders/country-loader.svelte +33 -15
  64. package/dist/views/extra/texts/text-country-state.svelte +36 -28
  65. package/dist/views/extra/texts/text-country.svelte +16 -8
  66. package/package.json +3 -12
  67. package/readme.md +57 -2
  68. package/dist/tailwind.css +0 -1
  69. package/dist/theme.css +0 -27
@@ -1,28 +1,47 @@
1
- <script lang="ts">let {
2
- className,
3
- containerClassName,
4
- desc,
5
- descClassName,
6
- id,
7
- label,
8
- labelClassName,
9
- name,
10
- onChange,
11
- position = "left",
12
- value = $bindable(false)
13
- } = $props();
14
- let inputRef = $state(null);
15
- export function getElement() {
16
- return inputRef;
17
- }
18
- export function select() {
19
- return inputRef && inputRef.select();
20
- }
21
- function handleChange(ev) {
22
- if (onChange) {
23
- onChange(value);
24
- }
25
- }
1
+ <script lang="ts">
2
+ type CheckboxPropsType = {
3
+ className?: string;
4
+ containerClassName?: string;
5
+ desc?: string;
6
+ descClassName?: string;
7
+ id?: string;
8
+ label?: string;
9
+ labelClassName?: string;
10
+ name?: string;
11
+ onChange?: (value: boolean) => void;
12
+ position?: 'left' | 'right';
13
+ value?: boolean;
14
+ };
15
+
16
+ let {
17
+ className,
18
+ containerClassName,
19
+ desc,
20
+ descClassName,
21
+ id,
22
+ label,
23
+ labelClassName,
24
+ name,
25
+ onChange,
26
+ position = 'left',
27
+ value = $bindable(false)
28
+ }: CheckboxPropsType = $props();
29
+
30
+ let inputRef: HTMLInputElement | null = $state(null);
31
+
32
+ export function getElement() {
33
+ return inputRef;
34
+ }
35
+
36
+ export function select() {
37
+ return inputRef && (inputRef as HTMLInputElement).select();
38
+ }
39
+
40
+ function handleChange(ev: Event) {
41
+ if (onChange) {
42
+ onChange(value);
43
+ }
44
+ }
26
45
  </script>
27
46
 
28
47
  {#snippet labelSnippet()}
@@ -1,72 +1,84 @@
1
- <script lang="ts">import { ripple } from "../../../../../actions";
2
- import { colorToHex, isValidHexColor } from "../../../../../services";
3
- import { mdiSquare } from "../../../icon";
4
- import Icon from "../../../icon/components/icon/icon.svelte";
5
- import InputField, {} from "../input-field/input-field.svelte";
6
- let {
7
- id,
8
- name,
9
- size,
10
- appearance,
11
- value = $bindable("#000000"),
12
- ...props
13
- } = $props();
14
- let colorRef;
15
- let btnIconSizeClassName = $state("");
16
- let btnRoundedClassName = $state("");
17
- let colorValue = $state("#000000");
18
- let inputRef = $state(null);
19
- export function focus() {
20
- inputRef?.focus();
21
- }
22
- export function getElement() {
23
- return inputRef;
24
- }
25
- export function select() {
26
- return inputRef && inputRef.select();
27
- }
28
- function handleColorBtnClick() {
29
- if (colorRef) {
30
- colorRef.click();
31
- }
32
- }
33
- function handleColorPickerChange(ev) {
34
- let input = ev?.target;
35
- if (input) {
36
- value = input.value;
37
- }
38
- }
39
- $effect(() => {
40
- if (isValidHexColor(value)) {
41
- colorValue = value;
42
- if (colorRef) {
43
- colorRef.value = colorToHex(value);
44
- }
45
- }
46
- });
47
- $effect(() => {
48
- if (size) {
49
- switch (size) {
50
- case "lg":
51
- btnIconSizeClassName = "!h-7 !w-7";
52
- break;
53
- case "md":
54
- btnIconSizeClassName = "!h-6 !w-6";
55
- break;
56
- case "sm":
57
- btnIconSizeClassName = "!h-5 !w-5";
58
- break;
59
- case "xs":
60
- btnIconSizeClassName = "!h-4 !w-4";
61
- break;
62
- }
63
- }
64
- });
65
- $effect(() => {
66
- if (!appearance || appearance == "normal") {
67
- btnRoundedClassName = "rounded-tr-lg rounded-br-lg";
68
- }
69
- });
1
+ <script lang="ts">
2
+ import { ripple } from '../../../../../actions';
3
+ import { colorToHex, isValidHexColor } from '../../../../../services';
4
+ import { mdiSquare } from '../../../icon';
5
+ import Icon from '../../../icon/components/icon/icon.svelte';
6
+ import InputField, { type InputFieldProps } from '../input-field/input-field.svelte';
7
+
8
+ let {
9
+ id,
10
+ name,
11
+ size,
12
+ appearance,
13
+ value = $bindable('#000000'),
14
+ ...props
15
+ }: InputFieldProps & { value?: string } = $props();
16
+
17
+ let colorRef: HTMLInputElement;
18
+ let btnIconSizeClassName: string = $state('');
19
+ let btnRoundedClassName: string = $state('');
20
+ let colorValue: string = $state('#000000');
21
+
22
+ let inputRef: any | null = $state(null);
23
+
24
+ export function focus() {
25
+ inputRef?.focus();
26
+ }
27
+
28
+ export function getElement() {
29
+ return inputRef;
30
+ }
31
+
32
+ export function select() {
33
+ return inputRef && inputRef.select();
34
+ }
35
+
36
+ function handleColorBtnClick() {
37
+ if (colorRef) {
38
+ colorRef.click();
39
+ }
40
+ }
41
+
42
+ function handleColorPickerChange(ev: any) {
43
+ let input: HTMLInputElement = ev?.target;
44
+ if (input) {
45
+ value = input.value;
46
+ }
47
+ }
48
+
49
+ $effect(() => {
50
+ if (isValidHexColor(value)) {
51
+ colorValue = value;
52
+ if (colorRef) {
53
+ colorRef.value = colorToHex(value);
54
+ }
55
+ }
56
+ });
57
+
58
+ $effect(() => {
59
+ if (size) {
60
+ switch (size) {
61
+ case 'lg':
62
+ btnIconSizeClassName = '!h-7 !w-7';
63
+ break;
64
+ case 'md':
65
+ btnIconSizeClassName = '!h-6 !w-6';
66
+ break;
67
+ case 'sm':
68
+ btnIconSizeClassName = '!h-5 !w-5';
69
+ break;
70
+ case 'xs':
71
+ btnIconSizeClassName = '!h-4 !w-4';
72
+ break;
73
+ }
74
+ }
75
+ });
76
+
77
+ $effect(() => {
78
+ if (!appearance || appearance == 'normal') {
79
+ btnRoundedClassName = 'rounded-tr-lg rounded-br-lg';
80
+ }
81
+ });
70
82
  </script>
71
83
 
72
84
  {#snippet colorButton()}