y200subcontrols 0.1.353 → 0.1.354

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.
@@ -16,13 +16,15 @@ export let visible = true;
16
16
  export let numeric = false;
17
17
  export let allowZero = false;
18
18
  export let disabled = false;
19
+ export let hasIcon = false;
19
20
  const dispatch = createEventDispatcher();
20
21
  export let isValid = true;
21
22
  let inputCss = `
22
23
  border peer block w-full rounded shadow-sm bg-white text-neutral-900
23
24
  ${size === "sm" ? "py-1 px-2 text-sm" : ""}
24
25
  ${size === "md" ? "py-1.5 px-2 text-base" : ""}
25
- ${size === "lg" ? "py-2 px-2 text-lg" : ""}
26
+ ${size === "lg" ? "py-2 px-2 text-lg" : ""}
27
+ ${hasIcon ? "pr-10" : ""}
26
28
  focus:outline-none focus:ring
27
29
  read-only:bg-neutral-100
28
30
  dark:read-only:bg-neutral-800
@@ -89,7 +91,7 @@ onMount(() => {
89
91
  {/if}
90
92
  </label>
91
93
  {/if}
92
- <div bind:this={inputContainer}>
94
+ <div bind:this={inputContainer} class="relative">
93
95
  <slot>
94
96
  <input
95
97
  data-input="true"
@@ -123,6 +125,7 @@ onMount(() => {
123
125
  step={numeric ? 'any' : undefined}
124
126
  />
125
127
  </slot>
128
+ <slot name="icon"/>
126
129
  </div>
127
130
 
128
131
  {#if validationText && !isValid}
@@ -19,6 +19,7 @@ declare const __propDef: {
19
19
  numeric?: boolean;
20
20
  allowZero?: boolean;
21
21
  disabled?: boolean;
22
+ hasIcon?: boolean;
22
23
  isValid?: boolean;
23
24
  };
24
25
  events: {
@@ -31,6 +32,7 @@ declare const __propDef: {
31
32
  };
32
33
  slots: {
33
34
  default: {};
35
+ icon: {};
34
36
  };
35
37
  exports?: {} | undefined;
36
38
  bindings?: string | undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "y200subcontrols",
3
- "version": "0.1.353",
3
+ "version": "0.1.354",
4
4
  "scripts": {
5
5
  "dev": "vite dev",
6
6
  "build": "vite build && npm run package",