@agnos-ui/svelte-bootstrap 0.4.3 → 0.5.0-next.0
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.
- package/README.md +2 -2
- package/components/accordion/Accordion.svelte +20 -18
- package/components/accordion/Accordion.svelte.d.ts +8 -23
- package/components/accordion/Item.svelte +40 -44
- package/components/accordion/Item.svelte.d.ts +5 -20
- package/components/accordion/ItemDefaultStructure.svelte +17 -27
- package/components/accordion/ItemDefaultStructure.svelte.d.ts +3 -17
- package/components/accordion/accordion.d.ts +11 -6
- package/components/accordion/accordion.gen.d.ts +37 -9
- package/components/accordion/accordion.js +10 -0
- package/components/alert/Alert.svelte +36 -40
- package/components/alert/Alert.svelte.d.ts +5 -21
- package/components/alert/AlertDefaultStructure.svelte +8 -12
- package/components/alert/AlertDefaultStructure.svelte.d.ts +3 -17
- package/components/alert/alert.gen.d.ts +21 -2
- package/components/alert/index.d.ts +1 -1
- package/components/alert/index.js +1 -1
- package/components/collapse/Collapse.svelte +33 -0
- package/components/collapse/Collapse.svelte.d.ts +8 -0
- package/components/collapse/collapse.gen.d.ts +146 -0
- package/components/collapse/collapse.gen.js +14 -0
- package/components/collapse/index.d.ts +3 -0
- package/components/collapse/index.js +3 -0
- package/components/modal/Modal.svelte +45 -47
- package/components/modal/Modal.svelte.d.ts +16 -14
- package/components/modal/ModalDefaultHeader.svelte +10 -17
- package/components/modal/ModalDefaultHeader.svelte.d.ts +15 -12
- package/components/modal/ModalDefaultStructure.svelte +10 -36
- package/components/modal/ModalDefaultStructure.svelte.d.ts +15 -12
- package/components/modal/index.d.ts +1 -1
- package/components/modal/index.js +1 -1
- package/components/modal/modal.gen.d.ts +35 -18
- package/components/modal/modalService.d.ts +19 -1
- package/components/modal/modalService.js +21 -2
- package/components/pagination/Pagination.svelte +39 -47
- package/components/pagination/Pagination.svelte.d.ts +3 -21
- package/components/pagination/PaginationDefaultPages.svelte +13 -43
- package/components/pagination/PaginationDefaultPages.svelte.d.ts +3 -17
- package/components/pagination/PaginationDefaultStructure.svelte +18 -89
- package/components/pagination/PaginationDefaultStructure.svelte.d.ts +3 -17
- package/components/pagination/index.d.ts +1 -1
- package/components/pagination/index.js +1 -1
- package/components/pagination/pagination.gen.d.ts +49 -29
- package/components/progressbar/Progressbar.svelte +28 -31
- package/components/progressbar/Progressbar.svelte.d.ts +3 -21
- package/components/progressbar/ProgressbarDefaultStructure.svelte +6 -11
- package/components/progressbar/ProgressbarDefaultStructure.svelte.d.ts +3 -17
- package/components/progressbar/index.d.ts +1 -1
- package/components/progressbar/index.js +1 -1
- package/components/progressbar/progressbar.gen.d.ts +21 -4
- package/components/rating/Rating.svelte +33 -27
- package/components/rating/Rating.svelte.d.ts +3 -18
- package/components/rating/index.d.ts +1 -1
- package/components/rating/index.js +1 -1
- package/components/rating/rating.gen.d.ts +25 -17
- package/components/select/Select.svelte +57 -81
- package/components/select/Select.svelte.d.ts +16 -14
- package/components/select/index.d.ts +1 -1
- package/components/select/index.js +1 -1
- package/components/select/select.gen.d.ts +41 -25
- package/components/slider/Slider.svelte +39 -40
- package/components/slider/Slider.svelte.d.ts +3 -21
- package/components/slider/SliderDefaultHandle.svelte +7 -4
- package/components/slider/SliderDefaultHandle.svelte.d.ts +3 -17
- package/components/slider/SliderDefaultStructure.svelte +21 -75
- package/components/slider/SliderDefaultStructure.svelte.d.ts +3 -17
- package/components/slider/index.d.ts +1 -1
- package/components/slider/index.js +1 -1
- package/components/slider/slider.gen.d.ts +54 -33
- package/components/toast/Toast.svelte +43 -40
- package/components/toast/Toast.svelte.d.ts +5 -21
- package/components/toast/ToastDefaultStructure.svelte +13 -23
- package/components/toast/ToastDefaultStructure.svelte.d.ts +3 -17
- package/components/toast/index.d.ts +1 -1
- package/components/toast/index.js +1 -1
- package/components/toast/toast.gen.d.ts +22 -2
- package/config.d.ts +1 -12
- package/config.gen.d.ts +5 -0
- package/generated/index.d.ts +1 -1
- package/generated/index.js +1 -1
- package/generated/utils/widget.svelte.d.ts +1 -0
- package/generated/utils/widget.svelte.js +1 -0
- package/index.d.ts +1 -0
- package/index.js +1 -0
- package/package.json +8 -7
- package/components/alert/alert.d.ts +0 -5
- package/components/alert/alert.js +0 -1
- package/components/modal/modal.d.ts +0 -5
- package/components/modal/modal.js +0 -1
- package/components/pagination/pagination.d.ts +0 -5
- package/components/pagination/pagination.js +0 -1
- package/components/progressbar/progressbar.d.ts +0 -5
- package/components/progressbar/progressbar.js +0 -1
- package/components/rating/rating.d.ts +0 -5
- package/components/rating/rating.js +0 -1
- package/components/select/select.d.ts +0 -5
- package/components/select/select.js +0 -1
- package/components/slider/slider.d.ts +0 -5
- package/components/slider/slider.js +0 -1
- package/components/toast/toast.d.ts +0 -5
- package/components/toast/toast.js +0 -1
- package/generated/utils/widget.d.ts +0 -1
- package/generated/utils/widget.js +0 -1
|
@@ -5,13 +5,35 @@ import type { WidgetSlotContext, SlotContent, Widget, WidgetFactory, Directive }
|
|
|
5
5
|
*/
|
|
6
6
|
declare const export_getSliderDefaultConfig: () => SliderProps;
|
|
7
7
|
export { export_getSliderDefaultConfig as getSliderDefaultConfig };
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
/**
|
|
9
|
+
* Represents the context for a Slider component.
|
|
10
|
+
* This type is an alias for `WidgetSlotContext<SliderWidget>`.
|
|
11
|
+
*/
|
|
12
|
+
export interface SliderContext extends WidgetSlotContext<SliderWidget> {
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Represents the context for a slider slot label, extending the base `SliderContext`
|
|
16
|
+
* with an additional `value` property.
|
|
17
|
+
*/
|
|
18
|
+
export interface SliderSlotLabelContext extends SliderContext {
|
|
19
|
+
/**
|
|
20
|
+
* the value of the handle the label is attached to
|
|
21
|
+
*/
|
|
10
22
|
value: number;
|
|
11
|
-
}
|
|
12
|
-
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Represents the context for a slider slot handle.
|
|
26
|
+
* This type extends the `SliderContext` and includes an additional `item` property of type `SliderHandle`.
|
|
27
|
+
*/
|
|
28
|
+
export interface SliderSlotHandleContext extends SliderContext {
|
|
29
|
+
/**
|
|
30
|
+
* the handle context
|
|
31
|
+
*/
|
|
13
32
|
item: SliderHandle;
|
|
14
|
-
}
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Represents the state of a slider component.
|
|
36
|
+
*/
|
|
15
37
|
export interface SliderState {
|
|
16
38
|
/**
|
|
17
39
|
* Sorted slider values
|
|
@@ -137,6 +159,9 @@ export interface SliderState {
|
|
|
137
159
|
*/
|
|
138
160
|
handle: SlotContent<SliderSlotHandleContext>;
|
|
139
161
|
}
|
|
162
|
+
/**
|
|
163
|
+
* Represents the properties for the Slider component.
|
|
164
|
+
*/
|
|
140
165
|
export interface SliderProps {
|
|
141
166
|
/**
|
|
142
167
|
* Return the value for the 'aria-label' attribute for the handle
|
|
@@ -257,7 +282,10 @@ export interface SliderProps {
|
|
|
257
282
|
*/
|
|
258
283
|
handle: SlotContent<SliderSlotHandleContext>;
|
|
259
284
|
}
|
|
260
|
-
|
|
285
|
+
/**
|
|
286
|
+
* Represents a slider widget component.
|
|
287
|
+
*/
|
|
288
|
+
export type SliderWidget = Widget<SliderProps, SliderState, object, SliderDirectives>;
|
|
261
289
|
/**
|
|
262
290
|
* Create a Slider with given config props
|
|
263
291
|
* @param config - an optional slider config
|
|
@@ -265,6 +293,9 @@ export type SliderWidget = Widget<SliderProps, SliderState, SliderApi, SliderAct
|
|
|
265
293
|
*/
|
|
266
294
|
declare const export_createSlider: WidgetFactory<SliderWidget>;
|
|
267
295
|
export { export_createSlider as createSlider };
|
|
296
|
+
/**
|
|
297
|
+
* Options for displaying progress in a slider component.
|
|
298
|
+
*/
|
|
268
299
|
export interface ProgressDisplayOptions {
|
|
269
300
|
/**
|
|
270
301
|
* Right offset of the progress in %
|
|
@@ -291,6 +322,9 @@ export interface ProgressDisplayOptions {
|
|
|
291
322
|
*/
|
|
292
323
|
height: number;
|
|
293
324
|
}
|
|
325
|
+
/**
|
|
326
|
+
* Options for displaying a handle in a slider component.
|
|
327
|
+
*/
|
|
294
328
|
export interface HandleDisplayOptions {
|
|
295
329
|
/**
|
|
296
330
|
* Left offset of the handle in %
|
|
@@ -301,6 +335,9 @@ export interface HandleDisplayOptions {
|
|
|
301
335
|
*/
|
|
302
336
|
top: number | null;
|
|
303
337
|
}
|
|
338
|
+
/**
|
|
339
|
+
* Represents a handle in a slider component.
|
|
340
|
+
*/
|
|
304
341
|
export interface SliderHandle {
|
|
305
342
|
/**
|
|
306
343
|
* Value of the handle
|
|
@@ -319,8 +356,9 @@ export interface SliderHandle {
|
|
|
319
356
|
*/
|
|
320
357
|
ariaValueText: string;
|
|
321
358
|
}
|
|
322
|
-
|
|
323
|
-
|
|
359
|
+
/**
|
|
360
|
+
* Interface representing various directives used in the slider component.
|
|
361
|
+
*/
|
|
324
362
|
export interface SliderDirectives {
|
|
325
363
|
/**
|
|
326
364
|
* Directive to get the slider component elementRef
|
|
@@ -336,6 +374,14 @@ export interface SliderDirectives {
|
|
|
336
374
|
* Directive to apply to the slider clickable area, to directly move the handle to a given specific position
|
|
337
375
|
*/
|
|
338
376
|
clickableAreaDirective: Directive;
|
|
377
|
+
/**
|
|
378
|
+
* Directive to apply handle events handlers
|
|
379
|
+
*/
|
|
380
|
+
handleEventsDirective: Directive<{
|
|
381
|
+
item: {
|
|
382
|
+
id: number;
|
|
383
|
+
};
|
|
384
|
+
}>;
|
|
339
385
|
/**
|
|
340
386
|
* Directive to apply to the slider handle if any
|
|
341
387
|
*/
|
|
@@ -361,28 +407,3 @@ export interface SliderDirectives {
|
|
|
361
407
|
index: number;
|
|
362
408
|
}>;
|
|
363
409
|
}
|
|
364
|
-
export interface SliderActions {
|
|
365
|
-
/**
|
|
366
|
-
* Method to handle click on the slider
|
|
367
|
-
* @param event - mouse event
|
|
368
|
-
*/
|
|
369
|
-
click(event: MouseEvent): void;
|
|
370
|
-
/**
|
|
371
|
-
* Method to process the keyboard event
|
|
372
|
-
* @param event - keyboard event object
|
|
373
|
-
* @param handleNumber - id of the modified handle
|
|
374
|
-
*/
|
|
375
|
-
keydown(event: KeyboardEvent, handleNumber: number): void;
|
|
376
|
-
/**
|
|
377
|
-
* Method describing the behavior of the slider handle on mouse down event
|
|
378
|
-
* @param event - mouse event
|
|
379
|
-
* @param handleId - numeric id of the handle
|
|
380
|
-
*/
|
|
381
|
-
mouseDown(event: MouseEvent, handleId: number): void;
|
|
382
|
-
/**
|
|
383
|
-
* Method describing the behavior of the slider handle on touch start event
|
|
384
|
-
* @param event - touch event
|
|
385
|
-
* @param handleId - number id of the handle
|
|
386
|
-
*/
|
|
387
|
-
touchStart(event: TouchEvent, handleId: number): void;
|
|
388
|
-
}
|
|
@@ -1,47 +1,50 @@
|
|
|
1
|
-
<script
|
|
1
|
+
<script lang="ts">
|
|
2
2
|
import {ssrAttributes as __AgnosUISveltePreprocess__ssrAttributes, classDirective as __AgnosUISveltePreprocess__classDirective} from '@agnos-ui/svelte-headless/utils/directive';
|
|
3
3
|
import {BROWSER as __AgnosUISveltePreprocess__BROWSER} from 'esm-env';
|
|
4
|
-
import { Slot } from "@agnos-ui/svelte-headless/slot";
|
|
5
|
-
import { createToast } from "./toast";
|
|
6
|
-
import { callWidgetFactory } from "../../config";
|
|
7
|
-
import ToastDefaultStructure from "./ToastDefaultStructure.svelte";
|
|
8
|
-
const defaultConfig = {
|
|
9
|
-
structure: ToastDefaultStructure
|
|
10
|
-
};
|
|
11
|
-
</script>
|
|
12
4
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
5
|
+
import type {ToastApi, ToastContext, ToastProps} from './toast.gen';
|
|
6
|
+
import {Slot} from '@agnos-ui/svelte-headless/slot';
|
|
7
|
+
import {createToast} from './toast.gen';
|
|
8
|
+
import {callWidgetFactory} from '../../config';
|
|
9
|
+
import ToastDefaultStructure from './ToastDefaultStructure.svelte';
|
|
10
|
+
|
|
11
|
+
let {visible = $bindable(), ...props}: Partial<ToastProps> = $props();
|
|
12
|
+
|
|
13
|
+
const widget = callWidgetFactory({
|
|
14
|
+
factory: createToast,
|
|
15
|
+
widgetName: 'toast',
|
|
16
|
+
get props() {
|
|
17
|
+
return {...props, visible};
|
|
18
|
+
},
|
|
19
|
+
enablePatchChanged: true,
|
|
20
|
+
defaultConfig: {structure},
|
|
21
|
+
events: {
|
|
22
|
+
onVisibleChange: (event) => {
|
|
23
|
+
visible = event;
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
});
|
|
27
|
+
export const api: ToastApi = widget.api;
|
|
28
|
+
|
|
29
|
+
const {
|
|
30
|
+
state,
|
|
31
|
+
directives: {transitionDirective, autoHideDirective, bodyDirective},
|
|
32
|
+
} = widget;
|
|
34
33
|
</script>
|
|
35
34
|
|
|
36
|
-
{#
|
|
37
|
-
<
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
35
|
+
{#snippet structure(props: ToastContext)}
|
|
36
|
+
<ToastDefaultStructure {...props} />
|
|
37
|
+
{/snippet}
|
|
38
|
+
|
|
39
|
+
{#if !state.hidden}
|
|
40
|
+
<div
|
|
41
|
+
use:__AgnosUISveltePreprocess__classDirective={"toast"}
|
|
42
|
+
class:toast-dismissible={state.dismissible}
|
|
43
|
+
class:d-flex={!state.header}
|
|
44
|
+
use:transitionDirective
|
|
45
|
+
use:autoHideDirective
|
|
46
|
+
use:bodyDirective {...__AgnosUISveltePreprocess__BROWSER ? {} : __AgnosUISveltePreprocess__ssrAttributes(transitionDirective, autoHideDirective, bodyDirective, [__AgnosUISveltePreprocess__classDirective, "toast"])}
|
|
47
|
+
>
|
|
48
|
+
<Slot content={state.structure} props={widget} />
|
|
46
49
|
</div>
|
|
47
50
|
{/if}
|
|
@@ -1,21 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
} & Partial<ToastProps>;
|
|
7
|
-
events: {
|
|
8
|
-
[evt: string]: CustomEvent<any>;
|
|
9
|
-
};
|
|
10
|
-
slots: ToastSlots;
|
|
11
|
-
exports?: {} | undefined;
|
|
12
|
-
bindings?: string | undefined;
|
|
13
|
-
};
|
|
14
|
-
type ToastProps_ = typeof __propDef.props;
|
|
15
|
-
export { ToastProps_ as ToastProps };
|
|
16
|
-
export type ToastEvents = typeof __propDef.events;
|
|
17
|
-
type ToastSlots_ = typeof __propDef.slots;
|
|
18
|
-
export { ToastSlots_ as ToastSlots };
|
|
19
|
-
export default class Toast extends SvelteComponent<ToastProps_, ToastEvents, ToastSlots_> {
|
|
20
|
-
get api(): ToastApi;
|
|
21
|
-
}
|
|
1
|
+
import type { ToastApi, ToastProps } from './toast.gen';
|
|
2
|
+
declare const Toast: import("svelte").Component<Partial<ToastProps>, {
|
|
3
|
+
api: ToastApi;
|
|
4
|
+
}, "visible">;
|
|
5
|
+
export default Toast;
|
|
@@ -1,38 +1,28 @@
|
|
|
1
|
-
<script>
|
|
1
|
+
<script lang="ts">
|
|
2
2
|
import {ssrAttributes as __AgnosUISveltePreprocess__ssrAttributes, classDirective as __AgnosUISveltePreprocess__classDirective} from '@agnos-ui/svelte-headless/utils/directive';
|
|
3
3
|
import {BROWSER as __AgnosUISveltePreprocess__BROWSER} from 'esm-env';
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
|
|
5
|
+
import type {ToastContext} from './toast.gen';
|
|
6
|
+
import {Slot} from '@agnos-ui/svelte-headless/slot';
|
|
7
|
+
|
|
8
|
+
let widget: ToastContext = $props();
|
|
9
|
+
let state = widget.state;
|
|
8
10
|
</script>
|
|
9
11
|
|
|
10
12
|
{#if state.header}
|
|
11
13
|
<div class="toast-header">
|
|
12
|
-
<Slot
|
|
13
|
-
<svelte:fragment slot="slot" let:props><slot name="header" {...props} /></svelte:fragment>
|
|
14
|
-
<svelte:component this={component} {...props}>
|
|
15
|
-
<svelte:fragment let:state let:widget><slot {state} {widget} /></svelte:fragment>
|
|
16
|
-
<svelte:fragment slot="header" let:state let:widget><slot name="header" {state} {widget} /></svelte:fragment>
|
|
17
|
-
<svelte:fragment slot="structure" let:state let:widget><slot name="structure" {state} {widget} /></svelte:fragment>
|
|
18
|
-
</svelte:component>
|
|
19
|
-
</Slot>
|
|
14
|
+
<Slot content={state.header} props={widget} />
|
|
20
15
|
{#if state.dismissible}
|
|
21
|
-
|
|
16
|
+
<!-- svelte-ignore a11y_consider_explicit_label -->
|
|
17
|
+
<button use:__AgnosUISveltePreprocess__classDirective={"btn-close me-0 ms-auto"} use:widget.directives.closeButtonDirective {...__AgnosUISveltePreprocess__BROWSER ? {} : __AgnosUISveltePreprocess__ssrAttributes(widget.directives.closeButtonDirective, [__AgnosUISveltePreprocess__classDirective, "btn-close me-0 ms-auto"])}></button>
|
|
22
18
|
{/if}
|
|
23
19
|
</div>
|
|
24
20
|
{/if}
|
|
25
21
|
|
|
26
22
|
<div class="toast-body">
|
|
27
|
-
<Slot
|
|
28
|
-
<svelte:fragment slot="slot" let:props><slot {...props} /></svelte:fragment>
|
|
29
|
-
<svelte:component this={component} {...props}>
|
|
30
|
-
<svelte:fragment let:state let:widget><slot {state} {widget} /></svelte:fragment>
|
|
31
|
-
<svelte:fragment slot="header" let:state let:widget><slot name="header" {state} {widget} /></svelte:fragment>
|
|
32
|
-
<svelte:fragment slot="structure" let:state let:widget><slot name="structure" {state} {widget} /></svelte:fragment>
|
|
33
|
-
</svelte:component>
|
|
34
|
-
</Slot>
|
|
23
|
+
<Slot content={state.children} props={widget} />
|
|
35
24
|
</div>
|
|
36
25
|
{#if state.dismissible && !state.header}
|
|
37
|
-
|
|
26
|
+
<!-- svelte-ignore a11y_consider_explicit_label -->
|
|
27
|
+
<button use:__AgnosUISveltePreprocess__classDirective={"btn-close btn-close-white me-2 m-auto"} use:widget.directives.closeButtonDirective {...__AgnosUISveltePreprocess__BROWSER ? {} : __AgnosUISveltePreprocess__ssrAttributes(widget.directives.closeButtonDirective, [__AgnosUISveltePreprocess__classDirective, "btn-close btn-close-white me-2 m-auto"])}></button>
|
|
38
28
|
{/if}
|
|
@@ -1,17 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
props: WidgetSlotContext<Widget<import("./toast.gen").ToastProps, import("./toast.gen").ToastState, import("./toast.gen").ToastApi, object, import("./toast.gen").ToastDirectives>>;
|
|
5
|
-
events: {
|
|
6
|
-
[evt: string]: CustomEvent<any>;
|
|
7
|
-
};
|
|
8
|
-
slots: ToastSlots;
|
|
9
|
-
exports?: {} | undefined;
|
|
10
|
-
bindings?: string | undefined;
|
|
11
|
-
};
|
|
12
|
-
export type ToastDefaultStructureProps = typeof __propDef.props;
|
|
13
|
-
export type ToastDefaultStructureEvents = typeof __propDef.events;
|
|
14
|
-
export type ToastDefaultStructureSlots = typeof __propDef.slots;
|
|
15
|
-
export default class ToastDefaultStructure extends SvelteComponent<ToastDefaultStructureProps, ToastDefaultStructureEvents, ToastDefaultStructureSlots> {
|
|
16
|
-
}
|
|
17
|
-
export {};
|
|
1
|
+
import type { ToastContext } from './toast.gen';
|
|
2
|
+
declare const ToastDefaultStructure: import("svelte").Component<ToastContext, {}, "">;
|
|
3
|
+
export default ToastDefaultStructure;
|
|
@@ -6,7 +6,15 @@ import type { TransitionFn } from '@agnos-ui/svelte-headless/services/transition
|
|
|
6
6
|
*/
|
|
7
7
|
declare const export_getToastDefaultConfig: () => ToastProps;
|
|
8
8
|
export { export_getToastDefaultConfig as getToastDefaultConfig };
|
|
9
|
-
|
|
9
|
+
/**
|
|
10
|
+
* Represents the context for a Toast widget.
|
|
11
|
+
* This interface is an alias for `WidgetSlotContext<ToastWidget>`.
|
|
12
|
+
*/
|
|
13
|
+
export interface ToastContext extends WidgetSlotContext<ToastWidget> {
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Represents the state of a Toast component.
|
|
17
|
+
*/
|
|
10
18
|
export interface ToastState {
|
|
11
19
|
/**
|
|
12
20
|
* Is `true` when the alert is hidden. Compared to `visible`, this is updated after the transition is executed.
|
|
@@ -62,6 +70,9 @@ export interface ToastState {
|
|
|
62
70
|
*/
|
|
63
71
|
header: SlotContent<ToastContext>;
|
|
64
72
|
}
|
|
73
|
+
/**
|
|
74
|
+
* Interface representing the properties for the Toast component.
|
|
75
|
+
*/
|
|
65
76
|
export interface ToastProps {
|
|
66
77
|
/**
|
|
67
78
|
* The transition function will be executed when the alert is displayed or hidden.
|
|
@@ -166,7 +177,10 @@ export interface ToastProps {
|
|
|
166
177
|
*/
|
|
167
178
|
header: SlotContent<ToastContext>;
|
|
168
179
|
}
|
|
169
|
-
|
|
180
|
+
/**
|
|
181
|
+
* Represents a Toast widget component.
|
|
182
|
+
*/
|
|
183
|
+
export type ToastWidget = Widget<ToastProps, ToastState, ToastApi, ToastDirectives>;
|
|
170
184
|
/**
|
|
171
185
|
* Create an ToastWidget with given config props
|
|
172
186
|
* @param config - an optional alert config
|
|
@@ -174,6 +188,9 @@ export type ToastWidget = Widget<ToastProps, ToastState, ToastApi, object, Toast
|
|
|
174
188
|
*/
|
|
175
189
|
declare const export_createToast: WidgetFactory<ToastWidget>;
|
|
176
190
|
export { export_createToast as createToast };
|
|
191
|
+
/**
|
|
192
|
+
* Represents the API for the toast component.
|
|
193
|
+
*/
|
|
177
194
|
export interface ToastApi {
|
|
178
195
|
/**
|
|
179
196
|
* Triggers alert closing programmatically (same as clicking on the close button (×)).
|
|
@@ -184,6 +201,9 @@ export interface ToastApi {
|
|
|
184
201
|
*/
|
|
185
202
|
open(): void;
|
|
186
203
|
}
|
|
204
|
+
/**
|
|
205
|
+
* Interface representing the directives for a toast component.
|
|
206
|
+
*/
|
|
187
207
|
export interface ToastDirectives {
|
|
188
208
|
/**
|
|
189
209
|
* the transition directive, piloting what is the visual effect of going from hidden to visible
|
package/config.d.ts
CHANGED
|
@@ -1,19 +1,8 @@
|
|
|
1
1
|
import type { Partial2Levels, WidgetsConfigStore } from '@agnos-ui/svelte-headless/config';
|
|
2
|
-
import type { SlotsPresent, Widget, WidgetFactory, WidgetProps } from '@agnos-ui/svelte-headless/types';
|
|
3
2
|
import type { ReadableSignal } from '@amadeus-it-group/tansu';
|
|
4
3
|
export * from '@agnos-ui/svelte-headless/config';
|
|
5
4
|
import type { WidgetsConfig } from './config.gen';
|
|
6
5
|
export type { WidgetsConfig };
|
|
7
|
-
type WidgetFactoryInput<W extends Widget> = {
|
|
8
|
-
factory: WidgetFactory<W>;
|
|
9
|
-
widgetName?: null | keyof WidgetsConfig;
|
|
10
|
-
$$slots: SlotsPresent<WidgetProps<W>>;
|
|
11
|
-
defaultConfig?: Partial<WidgetProps<W>> | ReadableSignal<Partial<WidgetProps<W>> | undefined>;
|
|
12
|
-
events: Pick<WidgetProps<W>, keyof WidgetProps<W> & `on${string}Change`>;
|
|
13
|
-
$$props: Partial<WidgetProps<W>>;
|
|
14
|
-
};
|
|
15
6
|
type AdaptParentConfig = (config: Partial2Levels<WidgetsConfig>) => Partial2Levels<WidgetsConfig>;
|
|
16
7
|
type CreateWidgetsDefaultConfig = (adaptParentConfig?: AdaptParentConfig) => WidgetsConfigStore<WidgetsConfig>;
|
|
17
|
-
export declare const widgetsDefaultConfigKey: symbol, createWidgetsDefaultConfig: CreateWidgetsDefaultConfig, getContextWidgetConfig: <N extends keyof WidgetsConfig>(widgetName: N) => ReadableSignal<Partial<WidgetsConfig[N]> | undefined>, callWidgetFactory:
|
|
18
|
-
patchChangedProps: W["patch"];
|
|
19
|
-
};
|
|
8
|
+
export declare const widgetsDefaultConfigKey: symbol, createWidgetsDefaultConfig: CreateWidgetsDefaultConfig, getContextWidgetConfig: <N extends keyof WidgetsConfig>(widgetName: N) => ReadableSignal<Partial<WidgetsConfig[N]> | undefined>, callWidgetFactory: any;
|
package/config.gen.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { AccordionProps } from './components/accordion';
|
|
2
2
|
import type { AlertProps } from './components/alert';
|
|
3
|
+
import type { CollapseProps } from './components/collapse';
|
|
3
4
|
import type { ModalProps } from './components/modal';
|
|
4
5
|
import type { PaginationProps } from './components/pagination';
|
|
5
6
|
import type { ProgressbarProps } from './components/progressbar';
|
|
@@ -16,6 +17,10 @@ export type WidgetsConfig = {
|
|
|
16
17
|
* the alert widget config
|
|
17
18
|
*/
|
|
18
19
|
alert: AlertProps;
|
|
20
|
+
/**
|
|
21
|
+
* the collapse widget config
|
|
22
|
+
*/
|
|
23
|
+
collapse: CollapseProps;
|
|
19
24
|
/**
|
|
20
25
|
* the modal widget config
|
|
21
26
|
*/
|
package/generated/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ export * from './types';
|
|
|
2
2
|
export * from './slot';
|
|
3
3
|
export * from './index';
|
|
4
4
|
export * from './config';
|
|
5
|
-
export * from './utils/widget';
|
|
5
|
+
export * from './utils/widget.svelte';
|
|
6
6
|
export * from './utils/writables';
|
|
7
7
|
export * from './utils/stores';
|
|
8
8
|
export * from './utils/directive';
|
package/generated/index.js
CHANGED
|
@@ -2,7 +2,7 @@ export * from './types';
|
|
|
2
2
|
export * from './slot';
|
|
3
3
|
export * from './index';
|
|
4
4
|
export * from './config';
|
|
5
|
-
export * from './utils/widget';
|
|
5
|
+
export * from './utils/widget.svelte';
|
|
6
6
|
export * from './utils/writables';
|
|
7
7
|
export * from './utils/stores';
|
|
8
8
|
export * from './utils/directive';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@agnos-ui/svelte-headless/utils/widget.svelte';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@agnos-ui/svelte-headless/utils/widget.svelte';
|
package/index.d.ts
CHANGED
package/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agnos-ui/svelte-bootstrap",
|
|
3
|
-
"description": "Bootstrap-based
|
|
4
|
-
"version": "0.
|
|
3
|
+
"description": "Bootstrap-based component library for Svelte.",
|
|
4
|
+
"version": "0.5.0-next.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./index.js",
|
|
7
7
|
"module": "./index.js",
|
|
@@ -49,16 +49,16 @@
|
|
|
49
49
|
}
|
|
50
50
|
},
|
|
51
51
|
"dependencies": {
|
|
52
|
-
"@agnos-ui/core-bootstrap": "0.
|
|
53
|
-
"@agnos-ui/svelte-headless": "0.
|
|
52
|
+
"@agnos-ui/core-bootstrap": "0.5.0-next.0",
|
|
53
|
+
"@agnos-ui/svelte-headless": "0.5.0-next.0"
|
|
54
54
|
},
|
|
55
55
|
"peerDependencies": {
|
|
56
56
|
"@amadeus-it-group/tansu": "^1.0.0",
|
|
57
|
-
"esm-env": "^1.
|
|
58
|
-
"svelte": "^
|
|
57
|
+
"esm-env": "^1.1.4",
|
|
58
|
+
"svelte": "^5.1.4"
|
|
59
59
|
},
|
|
60
60
|
"sideEffects": false,
|
|
61
|
-
"homepage": "https://
|
|
61
|
+
"homepage": "https://www.agnosui.dev/latest/",
|
|
62
62
|
"bugs": "https://github.com/AmadeusITGroup/AgnosUI/issues",
|
|
63
63
|
"license": "MIT",
|
|
64
64
|
"repository": {
|
|
@@ -72,6 +72,7 @@
|
|
|
72
72
|
"accordion",
|
|
73
73
|
"AgnosUI",
|
|
74
74
|
"alert",
|
|
75
|
+
"collapse",
|
|
75
76
|
"components",
|
|
76
77
|
"modal",
|
|
77
78
|
"pagination",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './alert.gen';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './modal.gen';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './pagination.gen';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './progressbar.gen';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './rating.gen';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './select.gen';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './slider.gen';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './toast.gen';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from '@agnos-ui/svelte-headless/utils/widget';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from '@agnos-ui/svelte-headless/utils/widget';
|