@intechstudio/grid-uikit 1.20240805.1340 → 1.20240813.1814

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.
@@ -8,8 +8,8 @@ export let suggestionTarget = void 0;
8
8
  export let validator = (text) => {
9
9
  return true;
10
10
  };
11
+ export let disabled = false;
11
12
  let isError = false;
12
- let disabled = false;
13
13
  let infoValue = "";
14
14
  let displayText;
15
15
  let focus;
@@ -17,9 +17,7 @@ function handleValueChange(value) {
17
17
  if (value !== displayText) {
18
18
  displayText = value;
19
19
  }
20
- infoValue = suggestions.find(
21
- (s) => String(s.value).trim() == String(value).trim()
22
- )?.info ?? "";
20
+ infoValue = suggestions.find((s) => String(s.value).trim() == String(value).trim())?.info ?? "";
23
21
  isError = !validator(displayText);
24
22
  dispatch("validator", { isError });
25
23
  }
@@ -56,54 +54,56 @@ function handleSuggestionSelected(e) {
56
54
  }
57
55
  let inputComponent;
58
56
  </script>
59
-
60
- <div class="{$$props.class} w-full relative">
61
- <input
62
- bind:this={inputComponent}
63
- {disabled}
64
- bind:value={displayText}
65
- on:focus={handleFocus}
66
- on:blur={handleBlur}
67
- on:suggestion-select={handleSuggestionSelected}
68
- type="text"
69
- {placeholder}
70
- class="{customClasses} w-full border
57
+
58
+ <div class="{$$props.class} w-full relative">
59
+ <input
60
+ bind:this={inputComponent}
61
+ {disabled}
62
+ bind:value={displayText}
63
+ on:focus={handleFocus}
64
+ on:blur={handleBlur}
65
+ on:suggestion-select={handleSuggestionSelected}
66
+ type="text"
67
+ {placeholder}
68
+ class="{customClasses} w-full border
71
69
  focus:neumorph focus:rounded-lg
72
70
  {isError
73
- ? 'border-error focus:outline-error'
74
- : 'focus:border-select border-secondary'} bg-secondary text-white py-0.5 pl-2 rounded-none"
75
- />
76
-
77
- <div class=" py-1">
78
- {#if !focus && infoValue !== undefined}
79
- <div class="{infoValue ? 'text-gray-500' : 'text-gray-600'} text-sm">
80
- {infoValue}
81
- </div>
82
- {/if}
83
- </div>
71
+ ? 'border-error focus:outline-error'
72
+ : 'focus:border-select border-secondary'} bg-secondary text-white py-0.5 pl-2 rounded-none"
73
+ class:text-opacity-75={disabled}
74
+ />
75
+
76
+ <div class=" py-1">
77
+ {#if !focus && infoValue !== undefined}
78
+ <div class="{infoValue ? 'text-gray-500' : 'text-gray-600'} text-sm">
79
+ {infoValue}
80
+ </div>
81
+ {/if}
84
82
  </div>
85
-
86
- <style>
87
- .neumorph {
88
- box-shadow: -2px -2px 10px #242c30, 2px 2px 10px #303c42;
89
- }
90
-
91
- ::-webkit-scrollbar {
92
- border-radius: 8px;
93
- height: 6px;
94
- width: 6px;
95
- background: #1e2628;
96
- }
97
-
98
- ::-webkit-scrollbar-thumb {
99
- background: #286787;
100
- border-radius: 8px;
101
- -webkit-box-shadow: 0px 1px 2px rgba(0, 0, 0, 0.75);
102
- }
103
-
104
- ::-webkit-scrollbar-corner {
105
- border-radius: 8px;
106
- background: #1e2628;
107
- }
108
- </style>
109
-
83
+ </div>
84
+
85
+ <style>
86
+ .neumorph {
87
+ box-shadow:
88
+ -2px -2px 10px #242c30,
89
+ 2px 2px 10px #303c42;
90
+ }
91
+
92
+ ::-webkit-scrollbar {
93
+ border-radius: 8px;
94
+ height: 6px;
95
+ width: 6px;
96
+ background: #1e2628;
97
+ }
98
+
99
+ ::-webkit-scrollbar-thumb {
100
+ background: #286787;
101
+ border-radius: 8px;
102
+ -webkit-box-shadow: 0px 1px 2px rgba(0, 0, 0, 0.75);
103
+ }
104
+
105
+ ::-webkit-scrollbar-corner {
106
+ border-radius: 8px;
107
+ background: #1e2628;
108
+ }
109
+ </style>
@@ -11,6 +11,7 @@ declare const __propDef: {
11
11
  placeholder?: string | undefined;
12
12
  suggestionTarget?: Element | undefined;
13
13
  validator?: ((text: string) => boolean) | undefined;
14
+ disabled?: boolean | undefined;
14
15
  };
15
16
  events: {
16
17
  validator: CustomEvent<any>;
@@ -1,18 +1,16 @@
1
- <script>export let iconPath = "";
1
+ <script>import iconMap from "./icons";
2
+ export let iconPath = "";
2
3
  export let width = 15;
3
4
  export let height = 15;
4
5
  export let fill = void 0;
5
- let rawSvg;
6
- importAsComponent(iconPath).then((res) => {
7
- rawSvg = res.default;
8
- });
9
- async function importAsComponent(path) {
10
- return await import(`./assets/icons/${path}.svg?raw`);
11
- }
12
6
  </script>
13
7
 
14
8
  <svg style="width: {width}px; height: {height}px; fill: {fill};">
15
9
  <g>
16
- {@html rawSvg}
10
+ {#if iconMap[iconPath]}
11
+ {@html iconMap[iconPath]}
12
+ {:else}
13
+ <text x="10" y="20">Icon not found: {iconPath}</text>
14
+ {/if}
17
15
  </g>
18
16
  </svg>
@@ -0,0 +1,5 @@
1
+ type IconMap = {
2
+ [key: string]: string;
3
+ };
4
+ declare const iconMap: IconMap;
5
+ export default iconMap;
package/dist/icons.js ADDED
@@ -0,0 +1,97 @@
1
+ import arrow_down from "./assets/icons/arrow_down.svg?raw";
2
+ import arrow_left from "./assets/icons/arrow_left.svg?raw";
3
+ import arrow_right from "./assets/icons/arrow_right.svg?raw";
4
+ import arrow_up from "./assets/icons/arrow_up.svg?raw";
5
+ import clear_element from "./assets/icons/clear_element.svg?raw";
6
+ import clear_from_device_01 from "./assets/icons/clear_from_device_01.svg?raw";
7
+ import clear_from_device_02 from "./assets/icons/clear_from_device_02.svg?raw";
8
+ import close from "./assets/icons/close.svg?raw";
9
+ import cloud from "./assets/icons/cloud.svg?raw";
10
+ import copy from "./assets/icons/copy.svg?raw";
11
+ import copy_all from "./assets/icons/copy_all.svg?raw";
12
+ import cut from "./assets/icons/cut.svg?raw";
13
+ import debug from "./assets/icons/debug.svg?raw";
14
+ import deleteIcon from "./assets/icons/delete.svg?raw";
15
+ import disabled from "./assets/icons/disabled.svg?raw";
16
+ import download from "./assets/icons/download.svg?raw";
17
+ import edit from "./assets/icons/edit.svg?raw";
18
+ import enabled from "./assets/icons/enabled.svg?raw";
19
+ import exportIcon from "./assets/icons/export.svg?raw";
20
+ import folder_control_element from "./assets/icons/folder_control_element.svg?raw";
21
+ import folder_profile from "./assets/icons/folder_profile.svg?raw";
22
+ import importIcon from "./assets/icons/import.svg?raw";
23
+ import info from "./assets/icons/info.svg?raw";
24
+ import merge_as_code from "./assets/icons/merge_as_code.svg?raw";
25
+ import midi from "./assets/icons/midi.svg?raw";
26
+ import move_to_cloud_01 from "./assets/icons/move_to_cloud_01.svg?raw";
27
+ import move_to_cloud_02 from "./assets/icons/move_to_cloud_02.svg?raw";
28
+ import move_to_cloud_03 from "./assets/icons/move_to_cloud_03.svg?raw";
29
+ import overlay_01 from "./assets/icons/overlay_01.svg?raw";
30
+ import overlay_02 from "./assets/icons/overlay_02.svg?raw";
31
+ import overwrite_control_element from "./assets/icons/overwrite_control_element.svg?raw";
32
+ import overwrite_profile from "./assets/icons/overwrite_profile.svg?raw";
33
+ import paste from "./assets/icons/paste.svg?raw";
34
+ import paste_all from "./assets/icons/paste_all.svg?raw";
35
+ import preferences from "./assets/icons/preferences.svg?raw";
36
+ import privateIcon from "./assets/icons/private.svg?raw";
37
+ import profile from "./assets/icons/profile.svg?raw";
38
+ import publicIcon from "./assets/icons/public.svg?raw";
39
+ import remove from "./assets/icons/remove.svg?raw";
40
+ import replace from "./assets/icons/replace.svg?raw";
41
+ import save_as_01 from "./assets/icons/save_as_01.svg?raw";
42
+ import save_as_02 from "./assets/icons/save_as_02.svg?raw";
43
+ import search from "./assets/icons/search.svg?raw";
44
+ import send_to_device from "./assets/icons/send_to_device.svg?raw";
45
+ import sort_by from "./assets/icons/sort_by.svg?raw";
46
+ import tick from "./assets/icons/tick.svg?raw";
47
+ import user_account_02 from "./assets/icons/user_account_02.svg?raw";
48
+ const iconMap = {
49
+ arrow_down,
50
+ arrow_left,
51
+ arrow_right,
52
+ arrow_up,
53
+ clear_element,
54
+ clear_from_device_01,
55
+ clear_from_device_02,
56
+ close,
57
+ cloud,
58
+ copy,
59
+ copy_all,
60
+ cut,
61
+ debug,
62
+ deleteIcon,
63
+ disabled,
64
+ download,
65
+ edit,
66
+ enabled,
67
+ exportIcon,
68
+ folder_control_element,
69
+ folder_profile,
70
+ importIcon,
71
+ info,
72
+ merge_as_code,
73
+ midi,
74
+ move_to_cloud_01,
75
+ move_to_cloud_02,
76
+ move_to_cloud_03,
77
+ overlay_01,
78
+ overlay_02,
79
+ overwrite_control_element,
80
+ overwrite_profile,
81
+ paste,
82
+ paste_all,
83
+ preferences,
84
+ privateIcon,
85
+ profile,
86
+ publicIcon,
87
+ remove,
88
+ replace,
89
+ save_as_01,
90
+ save_as_02,
91
+ search,
92
+ send_to_device,
93
+ sort_by,
94
+ tick,
95
+ user_account_02,
96
+ };
97
+ export default iconMap;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@intechstudio/grid-uikit",
3
- "version": "1.20240805.1340",
3
+ "version": "1.20240813.1814",
4
4
  "scripts": {
5
5
  "dev": "vite",
6
6
  "build": "vite build",