@likable-hair/svelte 0.0.44 → 0.0.48

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.
@@ -1,8 +1,10 @@
1
- <script >export let type = 'default', active = false, loading = false, icon = undefined, iconSize = 15, clazz = '', maxWidth = undefined, maxHeight = undefined, minWidth = undefined, minHeight = undefined, width = undefined, height = undefined, textAlign = "center", cursor = "pointer", padding = "5px", fontSize = undefined, color = undefined, display = undefined, justifyContent = undefined, alignItems = undefined, backgroundColor = undefined, hoverBackgroundColor = '#88888847', activeBackgroundColor = hoverBackgroundColor, borderRadius = undefined, border = undefined, boxShadow = undefined;
1
+ <script >export let type = 'default', active = false, loading = false, icon = undefined, iconSize = 15, clazz = '', maxWidth = undefined, maxHeight = undefined, minWidth = undefined, minHeight = undefined, width = undefined, height = undefined, textAlign = "center", cursor = "pointer", padding = "5px", fontSize = undefined, color = undefined, display = undefined, justifyContent = undefined, alignItems = undefined, backgroundColor = undefined, hoverBackgroundColor = '#88888847', activeBackgroundColor = hoverBackgroundColor, borderRadius = undefined, border = undefined, boxShadow = undefined, loaderHeight = undefined, loaderWidth = undefined, disabled = false;
2
2
  export { clazz as class };
3
3
  import { createEventDispatcher } from 'svelte';
4
4
  const dispatch = createEventDispatcher();
5
5
  function handleClick(event) {
6
+ if (disabled)
7
+ return;
6
8
  dispatch('click', {
7
9
  nativeEvent: event
8
10
  });
@@ -45,6 +47,8 @@ import CircularLoader from '../loaders/CircularLoader.svelte';
45
47
  {#if loading}
46
48
  <CircularLoader
47
49
  color={color}
50
+ height={loaderHeight}
51
+ width={loaderWidth}
48
52
  ></CircularLoader>
49
53
  {:else}
50
54
  {#if !!icon}
@@ -118,8 +122,8 @@ import CircularLoader from '../loaders/CircularLoader.svelte';
118
122
  .no-select {
119
123
  -webkit-touch-callout: none; /* iOS Safari */
120
124
  -webkit-user-select: none; /* Safari */
121
- -khtml-user-select: none; /* Konqueror HTML */
122
- -moz-user-select: none; /* Old versions of Firefox */
125
+ -khtml-user-select: none; /* Konqueror HTML */
126
+ -moz-user-select: none; /* Old versions of Firefox */
123
127
  -ms-user-select: none; /* Internet Explorer/Edge */
124
128
  user-select: none; /* Non-prefixed version, currently
125
129
  supported by Chrome, Edge, Opera and Firefox */
@@ -27,6 +27,9 @@ declare const __propDef: {
27
27
  borderRadius?: string;
28
28
  border?: string;
29
29
  boxShadow?: string;
30
+ loaderHeight?: string;
31
+ loaderWidth?: string;
32
+ disabled?: boolean;
30
33
  };
31
34
  events: {
32
35
  click: CustomEvent<{
@@ -1,13 +1,13 @@
1
1
  <script >import { v4 as uuidv4 } from 'uuid';
2
2
  import { fly } from 'svelte/transition';
3
- export let open = false, top = undefined, left = undefined, width, height, activator = undefined, anchor = 'bottom', closeOnClickOutside = false, inAnimation = fly, inAnimationConfig = {
3
+ export let open = false, top = undefined, left = undefined, width, height, maxHeight = undefined, overflow = "auto", refreshPosition = false, boxShadow = undefined, borderRadius = undefined, activator = undefined, anchor = 'bottom', closeOnClickOutside = false, inAnimation = fly, inAnimationConfig = {
4
4
  duration: 100,
5
5
  y: 10
6
6
  }, outAnimation = fly, outAnimationConfig = {
7
7
  duration: 100,
8
8
  y: 10
9
- };
10
- let zIndex = 50, menuElement, currentUid = uuidv4();
9
+ }, menuElement = undefined;
10
+ let zIndex = 50, currentUid = uuidv4();
11
11
  function calculateMenuPosition(params) {
12
12
  if (!!params.menuElement) {
13
13
  if (!!params.activator) {
@@ -58,6 +58,13 @@ $: if (open) {
58
58
  if (!!maxZIndex)
59
59
  zIndex = maxZIndex + 2;
60
60
  }
61
+ $: if (!!width) {
62
+ calculateMenuPosition({ activator, menuElement });
63
+ }
64
+ $: if (refreshPosition) {
65
+ calculateMenuPosition({ activator, menuElement });
66
+ refreshPosition = false;
67
+ }
61
68
  $: if (closeOnClickOutside && !!menuElement) {
62
69
  window.addEventListener('click', (event) => {
63
70
  open = false;
@@ -81,9 +88,13 @@ $: if (closeOnClickOutside && !!menuElement) {
81
88
  style:z-index={zIndex}
82
89
  style:position="absolute"
83
90
  style:top={top + "px"}
91
+ style:box-shadow={boxShadow}
92
+ style:border-radius={borderRadius}
84
93
  style:left={left + "px"}
85
94
  style:height={height}
95
+ style:max-height={maxHeight}
86
96
  style:width={width}
97
+ style:overflow={overflow}
87
98
  in:inAnimation={inAnimationConfig}
88
99
  out:outAnimation={outAnimationConfig}
89
100
  >
@@ -7,6 +7,11 @@ declare const __propDef: {
7
7
  left?: number;
8
8
  width: string;
9
9
  height: string;
10
+ maxHeight?: string;
11
+ overflow?: string;
12
+ refreshPosition?: boolean;
13
+ boxShadow?: string;
14
+ borderRadius?: string;
10
15
  activator?: HTMLElement;
11
16
  anchor?: 'bottom' | 'bottom-center';
12
17
  closeOnClickOutside?: boolean;
@@ -14,6 +19,7 @@ declare const __propDef: {
14
19
  inAnimationConfig?: SlideParams | FlyParams | FadeParams;
15
20
  outAnimation?: (node: Element, params?: SlideParams | FlyParams | FadeParams) => TransitionConfig;
16
21
  outAnimationConfig?: SlideParams | FlyParams | FadeParams;
22
+ menuElement?: HTMLElement;
17
23
  };
18
24
  events: {
19
25
  [evt: string]: CustomEvent<any>;
@@ -0,0 +1,219 @@
1
+ <script context="module" ></script>
2
+
3
+ <script >export let values = [], items, searchFunction = undefined, multiple = false, disabled = false, width = "auto", maxWidth = undefined,
4
+ // textfield
5
+ textFieldLabel = "", textFieldPlaceholder = "", textFieldColor = null, textFieldVariant = 'boxed', textFieldMaxWidth = "min(100px, 90%)", textFieldMinWidth = undefined, textFieldHeight = "auto", textFieldTextColor = "black", textFieldBorderWeight = "2px", textFieldBorderRadius = "5px", textFieldBorderColor = null, textFieldFocusBorderColor = null, textFieldFocusedBoxShadow = undefined, textFieldBackgroundColor = null, textFieldPadding = undefined, textFieldPaddingLeft = undefined, textFieldPaddingRight = undefined, textFieldPaddingBottom = undefined, textFieldPaddingTop = undefined, textFieldFontSize = undefined,
6
+ // menu
7
+ menuBackgroundColor = "#FFF", menuBoxShadow = "rgba(149, 157, 165, 0.2) 0px 8px 24px", menuBorderRadius = "5px", focusItemBackgroundColor = "#EEEEEE", selectedItemBackgroundColor = "#D0D0D0", border = '1px solid black', borderRadius = '5px', chipColor = "#D0D0D0", chipTextColor = "black", chipHeight = "30px";
8
+ function select(item) {
9
+ const alreadyPresent = values.findIndex((i) => i.value === item.value) != -1;
10
+ if (!alreadyPresent) {
11
+ if (multiple)
12
+ values = [...values, item];
13
+ else
14
+ values = [item];
15
+ refreshMenuWidth();
16
+ }
17
+ }
18
+ function unselect(item) {
19
+ values = values.filter((i) => i.value != item.value);
20
+ refreshMenuWidth();
21
+ }
22
+ function toggle(item) {
23
+ const alreadyPresent = values.findIndex((i) => i.value === item.value) != -1;
24
+ console.log(item, alreadyPresent);
25
+ if (alreadyPresent)
26
+ unselect(item);
27
+ else
28
+ select(item);
29
+ }
30
+ let menuWidth = undefined, menuHeight = "auto", menuOpened = false, refreshPosition = false;
31
+ function openMenu() {
32
+ refreshMenuWidth();
33
+ menuOpened = true;
34
+ }
35
+ function closeMenu() {
36
+ menuOpened = false;
37
+ }
38
+ function refreshMenuWidth() {
39
+ menuWidth = activator.offsetWidth + 'px';
40
+ refreshPosition = true;
41
+ }
42
+ let activator, focusedIndex = undefined;
43
+ function handleTextFieldFocus() {
44
+ focusedIndex = undefined;
45
+ openMenu();
46
+ }
47
+ function handleTextFieldBlur() {
48
+ // closeMenu()
49
+ }
50
+ let menuElement;
51
+ function handleWindowKeyDown(event) {
52
+ if (event.key == 'ArrowDown' && (focusedIndex < filteredItems.length - 1 || focusedIndex === undefined)) {
53
+ if (focusedIndex === undefined)
54
+ focusedIndex = 0;
55
+ else
56
+ focusedIndex += 1;
57
+ }
58
+ else if (event.key == 'ArrowUp' && (focusedIndex > 0 || focusedIndex === undefined)) {
59
+ if (focusedIndex === undefined)
60
+ focusedIndex = filteredItems.length - 1;
61
+ else
62
+ focusedIndex -= 1;
63
+ }
64
+ else if (event.key == 'Enter' && focusedIndex != undefined) {
65
+ toggle(filteredItems[focusedIndex]);
66
+ }
67
+ }
68
+ let input;
69
+ function handleContainerClick() {
70
+ if (!menuOpened)
71
+ input.focus();
72
+ }
73
+ let searchText, filteredItems = items;
74
+ $: if (!!searchText) {
75
+ focusedIndex = undefined;
76
+ filteredItems = items.filter((it) => {
77
+ if (!!searchFunction)
78
+ return searchFunction(it, searchText);
79
+ else
80
+ return it.label.toLowerCase().includes(searchText.toLowerCase());
81
+ });
82
+ }
83
+ else {
84
+ filteredItems = items;
85
+ }
86
+ import Textfield from "./Textfield.svelte";
87
+ import Chip from '../navigation/Chip.svelte';
88
+ import Menu from '../common/Menu.svelte';
89
+ </script>
90
+
91
+ <svelte:window></svelte:window>
92
+
93
+ <div
94
+ bind:this={activator}
95
+ style:width={width}
96
+ style:max-width={maxWidth}
97
+ style:opacity={disabled ? '50%' : '100%'}
98
+ on:click={handleContainerClick}
99
+ >
100
+ <slot name="selection-container">
101
+ <div
102
+ class="selection-container"
103
+ style:border={border}
104
+ style:border-radius={borderRadius}
105
+ >
106
+ {#each values as selection}
107
+ <slot name="selection" selection={selection}>
108
+ <div
109
+ style:height={chipHeight}
110
+ >
111
+ <Chip
112
+ color={chipColor}
113
+ textColor={chipTextColor}
114
+ close={true}
115
+ label={true}
116
+ on:close={() => unselect(selection)}
117
+ >{selection.label}</Chip>
118
+ </div>
119
+ </slot>
120
+ {/each}
121
+
122
+ <Textfield
123
+ label={textFieldLabel}
124
+ placeholder={textFieldPlaceholder}
125
+ color={textFieldColor}
126
+ bind:value={searchText}
127
+ variant={textFieldVariant}
128
+ maxWidth={textFieldMaxWidth}
129
+ minWidth={textFieldMinWidth}
130
+ textColor={textFieldTextColor}
131
+ borderWeight={textFieldBorderWeight}
132
+ borderRadius={textFieldBorderRadius}
133
+ borderColor={textFieldBorderColor}
134
+ focusBorderColor={textFieldFocusBorderColor}
135
+ focusedBoxShadow={textFieldFocusedBoxShadow}
136
+ backgroundColor={textFieldBackgroundColor}
137
+ padding={textFieldPadding}
138
+ paddingLeft={textFieldPaddingLeft}
139
+ paddingRight={textFieldPaddingRight}
140
+ paddingBottom={textFieldPaddingBottom}
141
+ paddingTop={textFieldPaddingTop}
142
+ fontSize={textFieldFontSize}
143
+ height={textFieldHeight}
144
+ disabled={disabled}
145
+ on:focus={handleTextFieldFocus}
146
+ on:blur={handleTextFieldBlur}
147
+ on:keydown={handleWindowKeyDown}
148
+ bind:inputElement={input}
149
+ ></Textfield>
150
+ </div>
151
+ </slot>
152
+ </div>
153
+
154
+ <slot name="menu">
155
+ <Menu
156
+ activator={activator}
157
+ width={menuWidth}
158
+ height={menuHeight}
159
+ maxHeight="300px"
160
+ boxShadow={menuBoxShadow}
161
+ borderRadius={menuBorderRadius}
162
+ bind:open={menuOpened}
163
+ anchor="bottom-center"
164
+ closeOnClickOutside
165
+ bind:refreshPosition={refreshPosition}
166
+ bind:menuElement={menuElement}
167
+ >
168
+ <div
169
+ style:background-color={menuBackgroundColor}
170
+ >
171
+ {#each filteredItems as item, index}
172
+ <slot
173
+ name="item"
174
+ item={item}
175
+ index={index}
176
+ selected={values.findIndex((i) => {
177
+ return i.value == item.value
178
+ }) != -1}
179
+ >
180
+ <div
181
+ style:--autocomplete-selected-item-background-color={selectedItemBackgroundColor}
182
+ style:--autocomplete-focus-item-background-color={focusItemBackgroundColor}
183
+ class:selection-item={true}
184
+ class:focused={index == focusedIndex}
185
+ class:selected={values.findIndex((i) => {
186
+ return i.value == item.value
187
+ }) != -1}
188
+ on:click={(event) => toggle(item)}
189
+ >{item.label}</div>
190
+ </slot>
191
+ {/each}
192
+ </div>
193
+ </Menu>
194
+ </slot>
195
+
196
+ <style>
197
+ .selection-container {
198
+ display: flex;
199
+ flex-wrap: wrap;
200
+ gap: 5px;
201
+ padding: 5px
202
+ }
203
+
204
+ .selection-item {
205
+ padding: 10px;
206
+ }
207
+
208
+ .selection-item.selected {
209
+ background-color: var(--autocomplete-selected-item-background-color);
210
+ }
211
+
212
+ .selection-item.focused {
213
+ background-color: var(--autocomplete-focus-item-background-color);
214
+ }
215
+
216
+ .selection-item:hover {
217
+ background-color: var(--autocomplete-focus-item-background-color);
218
+ }
219
+ </style>
@@ -0,0 +1,69 @@
1
+ import { SvelteComponentTyped } from "svelte";
2
+ export declare type Item = {
3
+ value: string;
4
+ label?: string;
5
+ data?: any;
6
+ };
7
+ import type { VariantOptions } from './Textfield.svelte';
8
+ declare const __propDef: {
9
+ props: {
10
+ values?: Item[];
11
+ items: Item[];
12
+ searchFunction?: (item: Item, searchText: string) => boolean;
13
+ multiple?: boolean;
14
+ disabled?: boolean;
15
+ width?: string;
16
+ maxWidth?: string;
17
+ textFieldLabel?: string;
18
+ textFieldPlaceholder?: string;
19
+ textFieldColor?: string;
20
+ textFieldVariant?: VariantOptions;
21
+ textFieldMaxWidth?: string;
22
+ textFieldMinWidth?: string;
23
+ textFieldHeight?: string;
24
+ textFieldTextColor?: string;
25
+ textFieldBorderWeight?: string;
26
+ textFieldBorderRadius?: string;
27
+ textFieldBorderColor?: string;
28
+ textFieldFocusBorderColor?: string;
29
+ textFieldFocusedBoxShadow?: string;
30
+ textFieldBackgroundColor?: string;
31
+ textFieldPadding?: string;
32
+ textFieldPaddingLeft?: string;
33
+ textFieldPaddingRight?: string;
34
+ textFieldPaddingBottom?: string;
35
+ textFieldPaddingTop?: string;
36
+ textFieldFontSize?: string;
37
+ menuBackgroundColor?: string;
38
+ menuBoxShadow?: string;
39
+ menuBorderRadius?: string;
40
+ focusItemBackgroundColor?: string;
41
+ selectedItemBackgroundColor?: string;
42
+ border?: string;
43
+ borderRadius?: string;
44
+ chipColor?: string;
45
+ chipTextColor?: string;
46
+ chipHeight?: string;
47
+ };
48
+ events: {
49
+ [evt: string]: CustomEvent<any>;
50
+ };
51
+ slots: {
52
+ 'selection-container': {};
53
+ selection: {
54
+ selection: Item;
55
+ };
56
+ menu: {};
57
+ item: {
58
+ item: Item;
59
+ index: any;
60
+ selected: boolean;
61
+ };
62
+ };
63
+ };
64
+ export declare type AutocompleteProps = typeof __propDef.props;
65
+ export declare type AutocompleteEvents = typeof __propDef.events;
66
+ export declare type AutocompleteSlots = typeof __propDef.slots;
67
+ export default class Autocomplete extends SvelteComponentTyped<AutocompleteProps, AutocompleteEvents, AutocompleteSlots> {
68
+ }
69
+ export {};
@@ -1,4 +1,6 @@
1
- <script >export let label = "", placeholder = "", color = null, value = "", variant = 'outlined', width = "100%", textColor = "black", borderWeight = "2px", borderRadius = "5px", borderColor = null, focusBorderColor = null, focusedBoxShadow = undefined, backgroundColor = null, padding = undefined, paddingLeft = undefined, paddingRight = undefined, paddingBottom = undefined, paddingTop = undefined, fontSize = undefined, type = 'text';
1
+ <script context="module"></script>
2
+
3
+ <script >export let label = "", placeholder = "", color = null, value = "", disabled = false, variant = 'outlined', width = "100%", height = "50px", maxWidth = undefined, minWidth = undefined, textColor = "black", borderWeight = "2px", borderRadius = "5px", borderColor = null, focusBorderColor = null, focusedBoxShadow = undefined, backgroundColor = null, padding = undefined, paddingLeft = undefined, paddingRight = undefined, paddingBottom = undefined, paddingTop = undefined, fontSize = undefined, type = 'text', inputElement = undefined;
2
4
  import { v4 as uuidv4 } from 'uuid';
3
5
  import { onMount } from 'svelte';
4
6
  let inputId = uuidv4(), focused = false, legendWidth = 0, labelElement = undefined;
@@ -20,7 +22,6 @@ $: if (!!labelElement) {
20
22
 
21
23
  <style>
22
24
  .input-container {
23
- height: 50px;
24
25
  position: relative;
25
26
  --textfield-final-color: var(--textfield-theme-color, --textfield-border-color, rgb(88, 88, 88));
26
27
  --textfield-final-border-color: var(--textfield-border-color, var(--textfield-final-color))
@@ -111,6 +112,9 @@ $: if (!!labelElement) {
111
112
 
112
113
  <div
113
114
  style:width={width}
115
+ style:min-width={minWidth}
116
+ style:max-width={maxWidth}
117
+ style:height={height}
114
118
  style:--textfield-theme-color={color}
115
119
  style:--textfield-border-color={borderColor}
116
120
  style:--textfield-border-weight={borderWeight}
@@ -161,6 +165,7 @@ $: if (!!labelElement) {
161
165
  class="input-outlined"
162
166
  type="password"
163
167
  placeholder={placeholder}
168
+ disabled={disabled}
164
169
  bind:value={value}
165
170
  on:change
166
171
  on:input
@@ -171,6 +176,7 @@ $: if (!!labelElement) {
171
176
  on:keydown
172
177
  on:keypress
173
178
  on:keyup
179
+ bind:this={inputElement}
174
180
  />
175
181
  {:else if type == 'text'}
176
182
  <input
@@ -181,6 +187,7 @@ $: if (!!labelElement) {
181
187
  class="input-outlined"
182
188
  type="text"
183
189
  placeholder={placeholder}
190
+ disabled={disabled}
184
191
  bind:value={value}
185
192
  on:change
186
193
  on:input
@@ -191,6 +198,7 @@ $: if (!!labelElement) {
191
198
  on:keydown
192
199
  on:keypress
193
200
  on:keyup
201
+ bind:this={inputElement}
194
202
  />
195
203
  {/if}
196
204
  <div>
@@ -213,6 +221,7 @@ $: if (!!labelElement) {
213
221
  class="input-boxed"
214
222
  type="password"
215
223
  placeholder={placeholder || label}
224
+ disabled={disabled}
216
225
  bind:value={value}
217
226
  on:change
218
227
  on:input
@@ -221,8 +230,9 @@ $: if (!!labelElement) {
221
230
  on:blur={handleBlur}
222
231
  on:blur
223
232
  on:keydown
224
- on:keypress
225
- on:keyup
233
+ on:keypress
234
+ on:keyup
235
+ bind:this={inputElement}
226
236
  />
227
237
  {:else if type == 'text'}
228
238
  <input
@@ -233,6 +243,7 @@ $: if (!!labelElement) {
233
243
  class="input-boxed"
234
244
  type="text"
235
245
  placeholder={placeholder || label}
246
+ disabled={disabled}
236
247
  bind:value={value}
237
248
  on:change
238
249
  on:input
@@ -243,6 +254,7 @@ $: if (!!labelElement) {
243
254
  on:keydown
244
255
  on:keypress
245
256
  on:keyup
257
+ bind:this={inputElement}
246
258
  />
247
259
  {/if}
248
260
  <div>
@@ -1,12 +1,17 @@
1
1
  import { SvelteComponentTyped } from "svelte";
2
+ export declare type VariantOptions = 'outlined' | 'boxed';
2
3
  declare const __propDef: {
3
4
  props: {
4
5
  label?: string;
5
6
  placeholder?: string;
6
7
  color?: string;
7
8
  value?: string;
8
- variant?: "outlined" | "boxed";
9
+ disabled?: boolean;
10
+ variant?: VariantOptions;
9
11
  width?: string;
12
+ height?: string;
13
+ maxWidth?: string;
14
+ minWidth?: string;
10
15
  textColor?: string;
11
16
  borderWeight?: string;
12
17
  borderRadius?: string;
@@ -21,6 +26,7 @@ declare const __propDef: {
21
26
  paddingTop?: string;
22
27
  fontSize?: string;
23
28
  type?: 'text' | 'password';
29
+ inputElement?: HTMLElement;
24
30
  };
25
31
  events: {
26
32
  change: Event;
@@ -1,4 +1,4 @@
1
- <script >export let src, alt = "", width = "40px", maxWidth = undefined, minWidth = undefined, height = "40px", maxHeight = undefined, minHeight = undefined, lazyLoaded = false, borderRadius = "50%";
1
+ <script >export let src, alt = "", width = "40px", maxWidth = undefined, minWidth = undefined, height = "40px", maxHeight = undefined, minHeight = undefined, lazyLoaded = false, referrerpolicy = "no-referrer", borderRadius = "50%";
2
2
  import Image from './Image.svelte';
3
3
  </script>
4
4
 
@@ -27,5 +27,6 @@ import Image from './Image.svelte';
27
27
  style:min-height={minHeight}
28
28
  style:border-radius={borderRadius}
29
29
  style:object-fit="cover"
30
+ referrerpolicy={referrerpolicy}
30
31
  />
31
32
  {/if}
@@ -10,6 +10,7 @@ declare const __propDef: {
10
10
  maxHeight?: string;
11
11
  minHeight?: string;
12
12
  lazyLoaded?: boolean;
13
+ referrerpolicy?: string;
13
14
  borderRadius?: string;
14
15
  };
15
16
  events: {
@@ -1,4 +1,4 @@
1
- <script >export let src, title = undefined, description = undefined, direction = 'row', reverse = false, avatarSpacing = '10px', width = undefined, maxWidth = undefined, minWidth = undefined, height = undefined, maxHeight = undefined, minHeight = undefined, lazyLoaded = false, borderRadius = "50%";
1
+ <script >export let src, title = undefined, description = undefined, direction = 'row', reverse = false, avatarSpacing = '10px', width = undefined, maxWidth = undefined, minWidth = undefined, height = undefined, maxHeight = undefined, minHeight = undefined, lazyLoaded = false, borderRadius = "50%", referrerpolicy = "no-referrer";
2
2
  let textAlignment;
3
3
  $: if (direction == 'column') {
4
4
  textAlignment = 'center';
@@ -53,6 +53,7 @@ import Avatar from "./Avatar.svelte";
53
53
  minHeight={minHeight}
54
54
  borderRadius={borderRadius}
55
55
  lazyLoaded={lazyLoaded}
56
+ referrerpolicy={referrerpolicy}
56
57
  ></Avatar>
57
58
  </div>
58
59
  <div
@@ -15,6 +15,7 @@ declare const __propDef: {
15
15
  minHeight?: string;
16
16
  lazyLoaded?: boolean;
17
17
  borderRadius?: string;
18
+ referrerpolicy?: string;
18
19
  };
19
20
  events: {
20
21
  [evt: string]: CustomEvent<any>;
@@ -1,56 +1,53 @@
1
1
  <script >import Icon from '../media/Icon.svelte';
2
2
  import Button from '../buttons/Button.svelte';
3
3
  import { createEventDispatcher } from 'svelte';
4
- export let active = true, close = false, closeIcon = "mdi-close-circle", color = "blue", textColor = "white", disabled = false, filter = false, filterIcon = "mdi-check", label = false, outlined = false, size = 12;
4
+ export let close = false, closeIcon = "mdi-close-circle", color = "blue", textColor = "white", disabled = false, filter = false, filterIcon = "mdi-check", label = false, outlined = false, size = 12;
5
5
  const dispatch = createEventDispatcher();
6
6
  function handleChipClick() {
7
7
  dispatch('click');
8
8
  }
9
9
  function handleCloseClick() {
10
- active = false;
11
10
  dispatch('close');
12
11
  }
13
12
  </script>
14
13
 
15
- {#if active}
16
- <div
17
- class="chip"
18
- style:border-radius={label?"5px":"100px"}
19
- style:background-color="{color}"
20
- style:color={outlined?color:textColor}
21
- class:label={label}
22
- class:outlined={outlined}
23
- class:disabled={disabled}
24
- on:click={handleChipClick}
14
+ <div
15
+ class="chip"
16
+ style:border-radius={label?"5px":"100px"}
17
+ style:background-color="{color}"
18
+ style:color={outlined?color:textColor}
19
+ class:label={label}
20
+ class:outlined={outlined}
21
+ class:disabled={disabled}
22
+ on:click={handleChipClick}
23
+ >
24
+ {#if filter}
25
+ <div class="icon-before">
26
+ <Icon
27
+ name={filterIcon}
28
+ size={size}
29
+ ></Icon>
30
+ </div>
31
+ {/if}
32
+ <div class="text"
33
+ style:font-size="{size}pt"
34
+ style:line-height="{size}pt"
25
35
  >
26
- {#if filter}
27
- <div class="icon-before">
28
- <Icon
29
- name={filterIcon}
30
- size={size}
31
- ></Icon>
32
- </div>
33
- {/if}
34
- <div class="text"
35
- style:font-size="{size}pt"
36
- style:line-height="{size}pt"
37
- >
38
- <slot></slot>
39
- </div>
40
- {#if close}
41
- <div class="icon-after">
42
- <Button
43
- icon={closeIcon}
44
- iconSize={size}
45
- type='icon'
46
- hoverBackgroundColor="none"
47
- on:click={handleCloseClick}
48
- >
49
- </Button>
50
- </div>
51
- {/if}
52
- </div>
53
- {/if}
36
+ <slot></slot>
37
+ </div>
38
+ {#if close}
39
+ <div class="icon-after">
40
+ <Button
41
+ icon={closeIcon}
42
+ iconSize={size}
43
+ type='icon'
44
+ hoverBackgroundColor="none"
45
+ on:click={handleCloseClick}
46
+ >
47
+ </Button>
48
+ </div>
49
+ {/if}
50
+ </div>
54
51
 
55
52
  <style>
56
53
  .chip {
@@ -1,7 +1,6 @@
1
1
  import { SvelteComponentTyped } from "svelte";
2
2
  declare const __propDef: {
3
3
  props: {
4
- active?: boolean;
5
4
  close?: boolean;
6
5
  closeIcon?: string;
7
6
  color?: string;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@likable-hair/svelte",
3
3
  "description": "A Svelte component for likablehair",
4
- "version": "0.0.44",
4
+ "version": "0.0.48",
5
5
  "devDependencies": {
6
6
  "@sveltejs/adapter-auto": "next",
7
7
  "@sveltejs/kit": "next",
@@ -80,6 +80,7 @@
80
80
  "./dates/YearSelector.svelte": "./dates/YearSelector.svelte",
81
81
  "./dates/utils": "./dates/utils.js",
82
82
  "./dialogs/Dialog.svelte": "./dialogs/Dialog.svelte",
83
+ "./forms/Autocomplete.svelte": "./forms/Autocomplete.svelte",
83
84
  "./forms/Checkbox.svelte": "./forms/Checkbox.svelte",
84
85
  "./forms/FileInput.svelte": "./forms/FileInput.svelte",
85
86
  "./forms/FileInputList.svelte": "./forms/FileInputList.svelte",