intelliwaketssveltekitv25 1.0.9 → 1.0.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.
@@ -14,6 +14,7 @@
14
14
  setCookieName,
15
15
  invalidate,
16
16
  allowCustom = true,
17
+ onchange,
17
18
  show = $bindable(false),
18
19
  fyMonthsAdjust
19
20
  }: {
@@ -25,6 +26,7 @@
25
26
  setCookieName?: string
26
27
  invalidate?: string | string[] | 'All' | 'app:All' | null
27
28
  allowCustom?: boolean
29
+ onchange?: (dateRange: TDateRangeString) => void
28
30
  show?: boolean,
29
31
  fyMonthsAdjust?: number | null
30
32
  } = $props()
@@ -41,6 +43,9 @@
41
43
  if (setCookieName) {
42
44
  CookieCreate(setCookieName, JSON.stringify(dr))
43
45
  }
46
+ if (onchange) {
47
+ onchange(dr)
48
+ }
44
49
  for (const inv of ToArray(invalidate)) {
45
50
  if (inv === 'All' || inv === 'app:All') {
46
51
  invalidateAll()
@@ -124,6 +129,9 @@
124
129
  if (setCookieName) {
125
130
  CookieCreate(setCookieName, JSON.stringify(customDateRange))
126
131
  }
132
+ if (onchange) {
133
+ onchange(customDateRange)
134
+ }
127
135
  for (const inv of ToArray(invalidate)) {
128
136
  if (inv === 'All' || inv === 'app:All') {
129
137
  await invalidateAll()
@@ -142,4 +150,4 @@
142
150
  {/if}
143
151
  </div>
144
152
  {/snippet}
145
- </DropDownControl>
153
+ </DropDownControl>
@@ -8,6 +8,7 @@ type $$ComponentProps = {
8
8
  setCookieName?: string;
9
9
  invalidate?: string | string[] | 'All' | 'app:All' | null;
10
10
  allowCustom?: boolean;
11
+ onchange?: (dateRange: TDateRangeString) => void;
11
12
  show?: boolean;
12
13
  fyMonthsAdjust?: number | null;
13
14
  };
@@ -1,5 +1,5 @@
1
1
  <!--suppress JSDeprecatedSymbols -->
2
- <script lang='ts'>
2
+ <script lang='ts' generics="T extends TGenericMultiSelect">
3
3
  import { DeepEqual, SearchRows } from '@solidbasisventures/intelliwaketsfoundation'
4
4
  import DropDownControl from './DropDownControl.svelte'
5
5
  import { onMount, tick } from 'svelte'
@@ -7,9 +7,6 @@
7
7
  import DisplayHTML from './DisplayHTML.svelte'
8
8
  import { type ActionArray, useActions } from './useActions'
9
9
 
10
- type T = $$Generic<TGenericMultiSelect>
11
-
12
- // eslint-useDisabled-next-line no-undef
13
10
  let {
14
11
  id = undefined,
15
12
  show = $bindable(false),
@@ -89,11 +86,11 @@
89
86
  inputClass?: string
90
87
  parentDivElement?: HTMLDivElement | null
91
88
  form?: string | undefined,
92
- onadd?: (item: T) => void,
93
- onselect?: (item: T) => void,
89
+ onadd?: (id: string | number) => void,
90
+ onselect?: (id: string | number) => void,
94
91
  oncreate?: (item: string) => void,
95
92
  onchange?: (items: T[]) => void,
96
- onclear?: (item: T) => void,
93
+ onclear?: (id: string | number) => void,
97
94
  onclearall?: () => void
98
95
  } = $props()
99
96
 
@@ -38,11 +38,11 @@ declare function $$render<T extends TGenericMultiSelect>(): {
38
38
  inputClass?: string;
39
39
  parentDivElement?: HTMLDivElement | null;
40
40
  form?: string | undefined;
41
- onadd?: (item: T) => void;
42
- onselect?: (item: T) => void;
41
+ onadd?: (id: string | number) => void;
42
+ onselect?: (id: string | number) => void;
43
43
  oncreate?: (item: string) => void;
44
44
  onchange?: (items: T[]) => void;
45
- onclear?: (item: T) => void;
45
+ onclear?: (id: string | number) => void;
46
46
  onclearall?: () => void;
47
47
  };
48
48
  exports: {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "intelliwaketssveltekitv25",
3
- "version": "1.0.9",
3
+ "version": "1.0.11",
4
4
  "exports": {
5
5
  ".": {
6
6
  "types": "./dist/index.d.ts",