@ims360/svelte-ivory 0.4.9 → 0.4.11

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.
@@ -47,14 +47,14 @@ class ThemeController {
47
47
  /** Add to hook sequence to enable correct prerendering ot the theme */
48
48
  handle = ({ event, resolve }) => {
49
49
  const theme = event.cookies.get(COOKIE_THEME_KEY);
50
- let isDark = false;
50
+ let dark;
51
51
  if (theme !== undefined && theme !== 'system') {
52
- isDark = theme === 'dark';
52
+ dark = theme === 'dark';
53
53
  }
54
54
  else {
55
- isDark = event.request.headers.get('sec-ch-prefers-color-scheme') === 'dark';
55
+ dark = event.request.headers.get('sec-ch-prefers-color-scheme') === 'dark';
56
56
  }
57
- if (!isDark)
57
+ if (!dark)
58
58
  return resolve(event);
59
59
  return resolve(event, {
60
60
  transformPageChunk: ({ html }) => html.replace('class="', 'class="dark ')
@@ -21,6 +21,7 @@
21
21
  }
22
22
 
23
23
  $effect(() => {
24
+ // eslint-disable-next-line @typescript-eslint/no-unused-expressions
24
25
  value;
25
26
  autoResize();
26
27
  });
@@ -1 +1 @@
1
- {"version":3,"file":"Textarea.svelte.d.ts","sourceRoot":"","sources":["../../../src/lib/components/basic/Textarea.svelte.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAG9D,UAAU,KAAM,SAAQ,cAAc,CAAC,mBAAmB,CAAC;IACvD,KAAK,CAAC,EAAE,UAAU,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,MAAM,CAAC;CACjB;AAqCL,QAAA,MAAM,QAAQ;;;WAAwC,CAAC;AACvD,KAAK,QAAQ,GAAG,UAAU,CAAC,OAAO,QAAQ,CAAC,CAAC;AAC5C,eAAe,QAAQ,CAAC"}
1
+ {"version":3,"file":"Textarea.svelte.d.ts","sourceRoot":"","sources":["../../../src/lib/components/basic/Textarea.svelte.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAG9D,UAAU,KAAM,SAAQ,cAAc,CAAC,mBAAmB,CAAC;IACvD,KAAK,CAAC,EAAE,UAAU,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,MAAM,CAAC;CACjB;AAsCL,QAAA,MAAM,QAAQ;;;WAAwC,CAAC;AACvD,KAAK,QAAQ,GAAG,UAAU,CAAC,OAAO,QAAQ,CAAC,CAAC;AAC5C,eAAe,QAAQ,CAAC"}
@@ -30,7 +30,7 @@
30
30
  </script>
31
31
 
32
32
  <div class={merge('border-surface-300-700 grid grid-cols-3 rounded-full border', clazz)}>
33
- {#each options as { value, icon: Icon, ariaLabel }}
33
+ {#each options as { value, icon: Icon, ariaLabel }, index (index)}
34
34
  {@const selected = value === ColorTheme.theme}
35
35
  <button
36
36
  type="button"
@@ -12,7 +12,7 @@
12
12
 
13
13
  <Input {...props}>
14
14
  {#snippet children(inputProps)}
15
- {@const { name } = props.form.as?.('text')}
15
+ {@const { name } = props.form.as('text')}
16
16
  <TextArea
17
17
  {...inputProps}
18
18
  {name}
@@ -58,7 +58,7 @@
58
58
  oncancel={requestClose}
59
59
  onclose={close}
60
60
  class={merge(
61
- 'backdrop:bg-surface-800-200/30 h-full max-h-none w-screen max-w-full bg-transparent',
61
+ 'backdrop:bg-surface-800-200/30 h-full max-h-none w-screen max-w-full overflow-hidden bg-transparent',
62
62
  theme.current.dialog?.class,
63
63
  clazz
64
64
  )}
@@ -58,17 +58,17 @@
58
58
  onclose={() => {
59
59
  if (closeOnOutsideClick) close();
60
60
  }}
61
+ class={[
62
+ 'flex flex-row justify-start overflow-visible',
63
+ placement === 'left' && '',
64
+ placement === 'right' && 'justify-end'
65
+ ]}
61
66
  >
62
67
  <div
63
- class={merge([
64
- 'bg-surface-50-950 absolute top-0 flex h-full flex-col gap-4 p-4',
65
- placement === 'left' && 'left-0',
66
- placement === 'right' && 'right-0',
67
- clazz
68
- ])}
68
+ class={merge(['bg-surface-50-950 flex h-full flex-col gap-4 p-4', clazz])}
69
69
  onclick={(e) => e.stopPropagation()}
70
- in:inTransition
71
- out:outTransition
70
+ in:inTransition|global
71
+ out:outTransition|global
72
72
  {...rest}
73
73
  >
74
74
  {#if inner}
@@ -1 +1 @@
1
- {"version":3,"file":"Drawer.svelte.d.ts","sourceRoot":"","sources":["../../../../src/lib/components/layout/drawer/Drawer.svelte.ts"],"names":[],"mappings":"AAGI,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAGlD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AAKtC,MAAM,MAAM,eAAe,GAAG,MAAM,GAAG,OAAO,CAAC;AAE/C,MAAM,MAAM,WAAW,GAAG,eAAe,GAAG;IACxC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IACzB,QAAQ,EAAE,OAAO,CAAC;IAClB,SAAS,CAAC,EAAE,eAAe,CAAC;IAC5B,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,8CAA8C;IAC9C,KAAK,CAAC,EAAE,OAAO,CAAC;CACnB,CAAC;AAwEN,QAAA,MAAM,MAAM;;;;;MAAwC,CAAC;AACrD,KAAK,MAAM,GAAG,UAAU,CAAC,OAAO,MAAM,CAAC,CAAC;AACxC,eAAe,MAAM,CAAC"}
1
+ {"version":3,"file":"Drawer.svelte.d.ts","sourceRoot":"","sources":["../../../../src/lib/components/layout/drawer/Drawer.svelte.ts"],"names":[],"mappings":"AAGI,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAGlD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AAKtC,MAAM,MAAM,eAAe,GAAG,MAAM,GAAG,OAAO,CAAC;AAE/C,MAAM,MAAM,WAAW,GAAG,eAAe,GAAG;IACxC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IACzB,QAAQ,EAAE,OAAO,CAAC;IAClB,SAAS,CAAC,EAAE,eAAe,CAAC;IAC5B,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,8CAA8C;IAC9C,KAAK,CAAC,EAAE,OAAO,CAAC;CACnB,CAAC;AAuEN,QAAA,MAAM,MAAM;;;;;MAAwC,CAAC;AACrD,KAAK,MAAM,GAAG,UAAU,CAAC,OAAO,MAAM,CAAC,CAAC;AACxC,eAAe,MAAM,CAAC"}
@@ -1,4 +1,4 @@
1
- import type { Snippet } from 'svelte';
1
+ import { type Snippet } from 'svelte';
2
2
  export declare const MINIMAL_WIDTH_MULTIPLIER = 0.5;
3
3
  export interface ColumnConfig {
4
4
  id: string;
@@ -1 +1 @@
1
- {"version":3,"file":"columnController.svelte.d.ts","sourceRoot":"","sources":["../../../src/lib/components/table/columnController.svelte.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AAGtC,eAAO,MAAM,wBAAwB,MAAM,CAAC;AAE5C,MAAM,WAAW,YAAY;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,MAAM,EAAE,OAAO,GAAG,MAAM,CAAC;CAC5B;AAED,qBAAa,gBAAgB;IACzB,EAAE,SAAc;IAChB,MAAM,uBAAgC;IAGtC,KAAK,qBAAoB;IACzB,QAAQ,SAAyB;IACjC,QAAQ,UAAiB;IACzB,SAAS,UAAiB;IAC1B,QAAQ,UAAiB;gBAEb,IAAI,EAAE,YAAY;IAS9B,YAAY,CAAC,IAAI,EAAE,YAAY;IAmB/B,MAAM,CAAC,QAAQ,CAAC,EAAE,MAAM;CAQ3B"}
1
+ {"version":3,"file":"columnController.svelte.d.ts","sourceRoot":"","sources":["../../../src/lib/components/table/columnController.svelte.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,QAAQ,CAAC;AAGtC,eAAO,MAAM,wBAAwB,MAAM,CAAC;AAE5C,MAAM,WAAW,YAAY;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,MAAM,EAAE,OAAO,GAAG,MAAM,CAAC;CAC5B;AAED,qBAAa,gBAAgB;IACzB,EAAE,SAAc;IAChB,MAAM,uBAAgC;IAGtC,KAAK,qBAAoB;IACzB,QAAQ,SAAyB;IACjC,QAAQ,UAAiB;IACzB,SAAS,UAAiB;IAC1B,QAAQ,UAAiB;gBAEb,IAAI,EAAE,YAAY;IAS9B,YAAY,CAAC,IAAI,EAAE,YAAY;IAmB/B,MAAM,CAAC,QAAQ,CAAC,EAAE,MAAM;CAQ3B"}
@@ -1,3 +1,4 @@
1
+ import {} from 'svelte';
1
2
  const DEFAULT_WIDTH = 250;
2
3
  export const MINIMAL_WIDTH_MULTIPLIER = 0.5;
3
4
  export class ColumnController {
@@ -23,8 +24,8 @@ export class ColumnController {
23
24
  const newWidth = typeof conf.width === 'undefined' ? DEFAULT_WIDTH : conf.width;
24
25
  this.width = newWidth;
25
26
  }
26
- else {
27
- this.width = conf.width ?? this.width;
27
+ else if (!this.resizable) {
28
+ this.width = typeof conf.width === 'number' ? conf.width : this.width;
28
29
  }
29
30
  if (typeof conf.minWidth !== 'undefined') {
30
31
  this.minWidth = conf.minWidth;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ims360/svelte-ivory",
3
- "version": "0.4.9",
3
+ "version": "0.4.11",
4
4
  "keywords": [
5
5
  "svelte"
6
6
  ],
@@ -119,4 +119,4 @@
119
119
  "@sveltejs/kit": "^2.49.5",
120
120
  "svelte": "^5.46.4"
121
121
  }
122
- }
122
+ }
@@ -50,14 +50,14 @@ class ThemeController {
50
50
  /** Add to hook sequence to enable correct prerendering ot the theme */
51
51
  handle: Handle = ({ event, resolve }) => {
52
52
  const theme = event.cookies.get(COOKIE_THEME_KEY);
53
- let isDark = false;
53
+ let dark;
54
54
  if (theme !== undefined && (theme as ColorThemePreference) !== 'system') {
55
- isDark = theme === 'dark';
55
+ dark = theme === 'dark';
56
56
  } else {
57
- isDark = event.request.headers.get('sec-ch-prefers-color-scheme') === 'dark';
57
+ dark = event.request.headers.get('sec-ch-prefers-color-scheme') === 'dark';
58
58
  }
59
59
 
60
- if (!isDark) return resolve(event);
60
+ if (!dark) return resolve(event);
61
61
 
62
62
  return resolve(event, {
63
63
  transformPageChunk: ({ html }) => html.replace('class="', 'class="dark ')
@@ -21,6 +21,7 @@
21
21
  }
22
22
 
23
23
  $effect(() => {
24
+ // eslint-disable-next-line @typescript-eslint/no-unused-expressions
24
25
  value;
25
26
  autoResize();
26
27
  });
@@ -30,7 +30,7 @@
30
30
  </script>
31
31
 
32
32
  <div class={merge('border-surface-300-700 grid grid-cols-3 rounded-full border', clazz)}>
33
- {#each options as { value, icon: Icon, ariaLabel }}
33
+ {#each options as { value, icon: Icon, ariaLabel }, index (index)}
34
34
  {@const selected = value === ColorTheme.theme}
35
35
  <button
36
36
  type="button"
@@ -12,7 +12,7 @@
12
12
 
13
13
  <Input {...props}>
14
14
  {#snippet children(inputProps)}
15
- {@const { name } = props.form.as?.('text')}
15
+ {@const { name } = props.form.as('text')}
16
16
  <TextArea
17
17
  {...inputProps}
18
18
  {name}
@@ -58,7 +58,7 @@
58
58
  oncancel={requestClose}
59
59
  onclose={close}
60
60
  class={merge(
61
- 'backdrop:bg-surface-800-200/30 h-full max-h-none w-screen max-w-full bg-transparent',
61
+ 'backdrop:bg-surface-800-200/30 h-full max-h-none w-screen max-w-full overflow-hidden bg-transparent',
62
62
  theme.current.dialog?.class,
63
63
  clazz
64
64
  )}
@@ -58,17 +58,17 @@
58
58
  onclose={() => {
59
59
  if (closeOnOutsideClick) close();
60
60
  }}
61
+ class={[
62
+ 'flex flex-row justify-start overflow-visible',
63
+ placement === 'left' && '',
64
+ placement === 'right' && 'justify-end'
65
+ ]}
61
66
  >
62
67
  <div
63
- class={merge([
64
- 'bg-surface-50-950 absolute top-0 flex h-full flex-col gap-4 p-4',
65
- placement === 'left' && 'left-0',
66
- placement === 'right' && 'right-0',
67
- clazz
68
- ])}
68
+ class={merge(['bg-surface-50-950 flex h-full flex-col gap-4 p-4', clazz])}
69
69
  onclick={(e) => e.stopPropagation()}
70
- in:inTransition
71
- out:outTransition
70
+ in:inTransition|global
71
+ out:outTransition|global
72
72
  {...rest}
73
73
  >
74
74
  {#if inner}
@@ -1,4 +1,4 @@
1
- import type { Snippet } from 'svelte';
1
+ import { type Snippet } from 'svelte';
2
2
 
3
3
  const DEFAULT_WIDTH = 250;
4
4
  export const MINIMAL_WIDTH_MULTIPLIER = 0.5;
@@ -36,8 +36,8 @@ export class ColumnController {
36
36
  if (typeof this.width === 'undefined') {
37
37
  const newWidth = typeof conf.width === 'undefined' ? DEFAULT_WIDTH : conf.width;
38
38
  this.width = newWidth;
39
- } else {
40
- this.width = conf.width ?? this.width;
39
+ } else if (!this.resizable) {
40
+ this.width = typeof conf.width === 'number' ? conf.width : this.width;
41
41
  }
42
42
  if (typeof conf.minWidth !== 'undefined') {
43
43
  this.minWidth = conf.minWidth;