@agnos-ui/svelte-bootstrap 0.3.0 → 0.4.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/components/accordion/Accordion.svelte +2 -8
- package/components/accordion/Accordion.svelte.d.ts +4 -2
- package/components/accordion/Item.svelte +14 -16
- package/components/accordion/Item.svelte.d.ts +6 -4
- package/components/accordion/ItemDefaultStructure.svelte +12 -14
- package/components/accordion/ItemDefaultStructure.svelte.d.ts +7 -5
- package/components/accordion/accordion.d.ts +7 -21
- package/components/accordion/accordion.gen.d.ts +343 -0
- package/components/accordion/accordion.gen.js +1 -0
- package/components/accordion/accordion.js +3 -3
- package/components/alert/Alert.svelte +5 -7
- package/components/alert/Alert.svelte.d.ts +4 -2
- package/components/alert/AlertDefaultStructure.svelte +2 -3
- package/components/alert/AlertDefaultStructure.svelte.d.ts +6 -4
- package/components/alert/alert.d.ts +5 -14
- package/components/alert/alert.gen.d.ts +119 -0
- package/components/alert/alert.gen.js +1 -0
- package/components/alert/alert.js +2 -3
- package/components/modal/Modal.svelte +2 -4
- package/components/modal/Modal.svelte.d.ts +3 -3
- package/components/modal/ModalDefaultHeader.svelte +1 -2
- package/components/modal/ModalDefaultHeader.svelte.d.ts +5 -5
- package/components/modal/ModalDefaultStructure.svelte +2 -3
- package/components/modal/ModalDefaultStructure.svelte.d.ts +5 -5
- package/components/modal/modal.d.ts +7 -15
- package/components/modal/modal.gen.d.ts +239 -0
- package/components/modal/modal.gen.js +1 -0
- package/components/modal/modal.js +3 -3
- package/components/pagination/Pagination.svelte +2 -4
- package/components/pagination/Pagination.svelte.d.ts +4 -2
- package/components/pagination/PaginationDefaultPages.svelte.d.ts +6 -4
- package/components/pagination/PaginationDefaultStructure.svelte +2 -4
- package/components/pagination/PaginationDefaultStructure.svelte.d.ts +6 -4
- package/components/pagination/pagination.d.ts +5 -16
- package/components/pagination/pagination.gen.d.ts +394 -0
- package/components/pagination/pagination.gen.js +1 -0
- package/components/pagination/pagination.js +2 -3
- package/components/progressbar/Progressbar.svelte +2 -4
- package/components/progressbar/Progressbar.svelte.d.ts +4 -2
- package/components/progressbar/ProgressbarDefaultStructure.svelte +2 -3
- package/components/progressbar/ProgressbarDefaultStructure.svelte.d.ts +6 -4
- package/components/progressbar/progressbar.d.ts +5 -14
- package/components/progressbar/progressbar.gen.d.ts +126 -0
- package/components/progressbar/progressbar.gen.js +1 -0
- package/components/progressbar/progressbar.js +2 -3
- package/components/rating/Rating.svelte +3 -5
- package/components/rating/Rating.svelte.d.ts +6 -7
- package/components/rating/rating.d.ts +5 -12
- package/components/rating/rating.gen.d.ts +179 -0
- package/components/rating/rating.gen.js +1 -0
- package/components/rating/rating.js +2 -3
- package/components/select/Select.svelte +11 -8
- package/components/select/Select.svelte.d.ts +2 -2
- package/components/select/select.d.ts +5 -16
- package/components/select/select.gen.d.ts +293 -0
- package/components/select/select.gen.js +1 -0
- package/components/select/select.js +2 -3
- package/components/slider/Slider.svelte +6 -8
- package/components/slider/Slider.svelte.d.ts +4 -2
- package/components/slider/SliderDefaultHandle.svelte.d.ts +6 -4
- package/components/slider/SliderDefaultStructure.svelte +9 -10
- package/components/slider/SliderDefaultStructure.svelte.d.ts +6 -4
- package/components/slider/slider.d.ts +5 -18
- package/components/slider/slider.gen.d.ts +293 -0
- package/components/slider/slider.gen.js +1 -0
- package/components/slider/slider.js +2 -3
- package/components/toast/Toast.svelte +6 -15
- package/components/toast/Toast.svelte.d.ts +4 -2
- package/components/toast/ToastDefaultStructure.svelte +5 -6
- package/components/toast/ToastDefaultStructure.svelte.d.ts +6 -4
- package/components/toast/toast.d.ts +5 -14
- package/components/toast/toast.gen.d.ts +146 -0
- package/components/toast/toast.gen.js +1 -0
- package/components/toast/toast.js +2 -3
- package/config.d.ts +4 -6
- package/config.gen.d.ts +47 -0
- package/config.gen.js +1 -0
- package/generated/index.d.ts +0 -1
- package/generated/index.js +0 -1
- package/package.json +6 -6
- package/generated/Slot.svelte.d.ts +0 -1
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
import type { WidgetSlotContext, SlotContent, Widget, Directive } from '@agnos-ui/svelte-headless/types';
|
|
2
|
+
import type { TransitionFn } from '@agnos-ui/svelte-headless/services/transitions/baseTransitions';
|
|
3
|
+
export type ToastContext = WidgetSlotContext<ToastWidget>;
|
|
4
|
+
export interface ToastState {
|
|
5
|
+
/**
|
|
6
|
+
* Is `true` when the alert is hidden. Compared to `visible`, this is updated after the transition is executed.
|
|
7
|
+
*/
|
|
8
|
+
hidden: boolean;
|
|
9
|
+
/**
|
|
10
|
+
* If `true`, alert can be dismissed by the user.
|
|
11
|
+
* The close button (×) will be displayed and you can be notified of the event with the (close) output.
|
|
12
|
+
*/
|
|
13
|
+
dismissible: boolean;
|
|
14
|
+
/**
|
|
15
|
+
* If `true` the alert is visible to the user
|
|
16
|
+
*/
|
|
17
|
+
visible: boolean;
|
|
18
|
+
/**
|
|
19
|
+
* Accessibility close button label
|
|
20
|
+
*/
|
|
21
|
+
ariaCloseButtonLabel: string;
|
|
22
|
+
/**
|
|
23
|
+
* CSS classes to be applied on the widget main container
|
|
24
|
+
*/
|
|
25
|
+
className: string;
|
|
26
|
+
/**
|
|
27
|
+
* If `true` automatically hides the toast after the delay.
|
|
28
|
+
*/
|
|
29
|
+
autoHide: boolean;
|
|
30
|
+
/**
|
|
31
|
+
* Delay in milliseconds before hiding the toast.
|
|
32
|
+
*/
|
|
33
|
+
delay: number;
|
|
34
|
+
/**
|
|
35
|
+
* Global template for the toast component
|
|
36
|
+
*/
|
|
37
|
+
structure: SlotContent<ToastContext>;
|
|
38
|
+
/**
|
|
39
|
+
* Template for the toast content
|
|
40
|
+
*/
|
|
41
|
+
children: SlotContent<ToastContext>;
|
|
42
|
+
/**
|
|
43
|
+
* Header template for the toast component
|
|
44
|
+
*/
|
|
45
|
+
header: SlotContent<ToastContext>;
|
|
46
|
+
}
|
|
47
|
+
export interface ToastProps {
|
|
48
|
+
/**
|
|
49
|
+
* Callback called when the alert visibility changed.
|
|
50
|
+
*/
|
|
51
|
+
onVisibleChange: (visible: boolean) => void;
|
|
52
|
+
/**
|
|
53
|
+
* Callback called when the alert is hidden.
|
|
54
|
+
*/
|
|
55
|
+
onHidden: () => void;
|
|
56
|
+
/**
|
|
57
|
+
* Callback called when the alert is shown.
|
|
58
|
+
*/
|
|
59
|
+
onShown: () => void;
|
|
60
|
+
/**
|
|
61
|
+
* The transition function will be executed when the alert is displayed or hidden.
|
|
62
|
+
*
|
|
63
|
+
* Depending on the value of `animatedOnInit`, the animation can be optionally skipped during the showing process.
|
|
64
|
+
*/
|
|
65
|
+
transition: TransitionFn;
|
|
66
|
+
/**
|
|
67
|
+
* If `true`, alert opening will be animated.
|
|
68
|
+
*
|
|
69
|
+
* Animation is triggered when the `.open()` function is called
|
|
70
|
+
* or the visible prop is changed
|
|
71
|
+
*/
|
|
72
|
+
animatedOnInit: boolean;
|
|
73
|
+
/**
|
|
74
|
+
* If `true`, alert closing will be animated.
|
|
75
|
+
*
|
|
76
|
+
* Animation is triggered when clicked on the close button (×),
|
|
77
|
+
* via the `.close()` function or the visible prop is changed
|
|
78
|
+
*/
|
|
79
|
+
animated: boolean;
|
|
80
|
+
/**
|
|
81
|
+
* If `true`, alert can be dismissed by the user.
|
|
82
|
+
* The close button (×) will be displayed and you can be notified of the event with the (close) output.
|
|
83
|
+
*/
|
|
84
|
+
dismissible: boolean;
|
|
85
|
+
/**
|
|
86
|
+
* If `true` the alert is visible to the user
|
|
87
|
+
*/
|
|
88
|
+
visible: boolean;
|
|
89
|
+
/**
|
|
90
|
+
* Accessibility close button label
|
|
91
|
+
*/
|
|
92
|
+
ariaCloseButtonLabel: string;
|
|
93
|
+
/**
|
|
94
|
+
* CSS classes to be applied on the widget main container
|
|
95
|
+
*/
|
|
96
|
+
className: string;
|
|
97
|
+
/**
|
|
98
|
+
* If `true` automatically hides the toast after the delay.
|
|
99
|
+
*/
|
|
100
|
+
autoHide: boolean;
|
|
101
|
+
/**
|
|
102
|
+
* Delay in milliseconds before hiding the toast.
|
|
103
|
+
*/
|
|
104
|
+
delay: number;
|
|
105
|
+
/**
|
|
106
|
+
* Global template for the toast component
|
|
107
|
+
*/
|
|
108
|
+
structure: SlotContent<ToastContext>;
|
|
109
|
+
/**
|
|
110
|
+
* Template for the toast content
|
|
111
|
+
*/
|
|
112
|
+
children: SlotContent<ToastContext>;
|
|
113
|
+
/**
|
|
114
|
+
* Header template for the toast component
|
|
115
|
+
*/
|
|
116
|
+
header: SlotContent<ToastContext>;
|
|
117
|
+
}
|
|
118
|
+
export type ToastWidget = Widget<ToastProps, ToastState, ToastApi, object, ToastDirectives>;
|
|
119
|
+
export interface ToastApi {
|
|
120
|
+
/**
|
|
121
|
+
* Triggers alert closing programmatically (same as clicking on the close button (×)).
|
|
122
|
+
*/
|
|
123
|
+
close(): void;
|
|
124
|
+
/**
|
|
125
|
+
* Triggers the alert to be displayed for the user.
|
|
126
|
+
*/
|
|
127
|
+
open(): void;
|
|
128
|
+
}
|
|
129
|
+
export interface ToastDirectives {
|
|
130
|
+
/**
|
|
131
|
+
* the transition directive, piloting what is the visual effect of going from hidden to visible
|
|
132
|
+
*/
|
|
133
|
+
transitionDirective: Directive;
|
|
134
|
+
/**
|
|
135
|
+
* Directive that handles the autohide of the toast component
|
|
136
|
+
*/
|
|
137
|
+
autoHideDirective: Directive;
|
|
138
|
+
/**
|
|
139
|
+
* Directive that adds all the necessary attributes to the body
|
|
140
|
+
*/
|
|
141
|
+
bodyDirective: Directive;
|
|
142
|
+
/**
|
|
143
|
+
* Directive that adds all the necessary attributes to the close button depending on the presence of the header
|
|
144
|
+
*/
|
|
145
|
+
closeButtonDirective: Directive;
|
|
146
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
import { createToast as coreCreateToast } from '@agnos-ui/core-bootstrap/components/toast';
|
|
3
|
-
// factory
|
|
1
|
+
import { createToast as coreCreateToast, getToastDefaultConfig as coreGetToastDefaultConfig } from '@agnos-ui/core-bootstrap/components/toast';
|
|
4
2
|
export const createToast = coreCreateToast;
|
|
3
|
+
export const getToastDefaultConfig = coreGetToastDefaultConfig;
|
package/config.d.ts
CHANGED
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import type { Partial2Levels, WidgetsConfigStore } from '@agnos-ui/svelte-headless/config';
|
|
2
|
-
import type {
|
|
3
|
-
import type { BootstrapWidgetsConfig } from '@agnos-ui/core-bootstrap/config';
|
|
2
|
+
import type { SlotsPresent, Widget, WidgetFactory, WidgetProps } from '@agnos-ui/svelte-headless/types';
|
|
4
3
|
import type { ReadableSignal } from '@amadeus-it-group/tansu';
|
|
5
4
|
export * from '@agnos-ui/svelte-headless/config';
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
};
|
|
5
|
+
import type { WidgetsConfig } from './config.gen';
|
|
6
|
+
export type { WidgetsConfig };
|
|
9
7
|
type WidgetFactoryInput<W extends Widget> = {
|
|
10
8
|
factory: WidgetFactory<W>;
|
|
11
9
|
widgetName?: null | keyof WidgetsConfig;
|
|
@@ -16,6 +14,6 @@ type WidgetFactoryInput<W extends Widget> = {
|
|
|
16
14
|
};
|
|
17
15
|
type AdaptParentConfig = (config: Partial2Levels<WidgetsConfig>) => Partial2Levels<WidgetsConfig>;
|
|
18
16
|
type CreateWidgetsDefaultConfig = (adaptParentConfig?: AdaptParentConfig) => WidgetsConfigStore<WidgetsConfig>;
|
|
19
|
-
export declare const widgetsDefaultConfigKey: symbol, createWidgetsDefaultConfig: CreateWidgetsDefaultConfig, getContextWidgetConfig: <N extends
|
|
17
|
+
export declare const widgetsDefaultConfigKey: symbol, createWidgetsDefaultConfig: CreateWidgetsDefaultConfig, getContextWidgetConfig: <N extends keyof WidgetsConfig>(widgetName: N) => ReadableSignal<Partial<WidgetsConfig[N]> | undefined>, callWidgetFactory: <W extends Widget>({ factory, widgetName, $$slots, defaultConfig, events, $$props, }: WidgetFactoryInput<W>) => W & {
|
|
20
18
|
patchChangedProps: W['patch'];
|
|
21
19
|
};
|
package/config.gen.d.ts
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import type { AccordionProps } from './components/accordion';
|
|
2
|
+
import type { AlertProps } from './components/alert';
|
|
3
|
+
import type { ModalProps } from './components/modal';
|
|
4
|
+
import type { PaginationProps } from './components/pagination';
|
|
5
|
+
import type { ProgressbarProps } from './components/progressbar';
|
|
6
|
+
import type { RatingProps } from './components/rating';
|
|
7
|
+
import type { SelectProps } from './components/select';
|
|
8
|
+
import type { SliderProps } from './components/slider';
|
|
9
|
+
import type { ToastProps } from './components/toast';
|
|
10
|
+
export type WidgetsConfig = {
|
|
11
|
+
/**
|
|
12
|
+
* the accordion widget config
|
|
13
|
+
*/
|
|
14
|
+
accordion: AccordionProps;
|
|
15
|
+
/**
|
|
16
|
+
* the alert widget config
|
|
17
|
+
*/
|
|
18
|
+
alert: AlertProps;
|
|
19
|
+
/**
|
|
20
|
+
* the modal widget config
|
|
21
|
+
*/
|
|
22
|
+
modal: ModalProps<any>;
|
|
23
|
+
/**
|
|
24
|
+
* the pagination widget config
|
|
25
|
+
*/
|
|
26
|
+
pagination: PaginationProps;
|
|
27
|
+
/**
|
|
28
|
+
* the progressbar widget config
|
|
29
|
+
*/
|
|
30
|
+
progressbar: ProgressbarProps;
|
|
31
|
+
/**
|
|
32
|
+
* the rating widget config
|
|
33
|
+
*/
|
|
34
|
+
rating: RatingProps;
|
|
35
|
+
/**
|
|
36
|
+
* the select widget config
|
|
37
|
+
*/
|
|
38
|
+
select: SelectProps<any>;
|
|
39
|
+
/**
|
|
40
|
+
* the slider widget config
|
|
41
|
+
*/
|
|
42
|
+
slider: SliderProps;
|
|
43
|
+
/**
|
|
44
|
+
* the toast widget config
|
|
45
|
+
*/
|
|
46
|
+
toast: ToastProps;
|
|
47
|
+
};
|
package/config.gen.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/generated/index.d.ts
CHANGED
package/generated/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agnos-ui/svelte-bootstrap",
|
|
3
3
|
"description": "Bootstrap-based widget library for Svelte.",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.4.0-next.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./index.js",
|
|
7
7
|
"module": "./index.js",
|
|
@@ -49,13 +49,13 @@
|
|
|
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.4.0-next.0",
|
|
53
|
+
"@agnos-ui/svelte-headless": "0.4.0-next.0"
|
|
54
54
|
},
|
|
55
55
|
"peerDependencies": {
|
|
56
|
-
"@amadeus-it-group/tansu": "
|
|
57
|
-
"esm-env": "
|
|
58
|
-
"svelte": "
|
|
56
|
+
"@amadeus-it-group/tansu": "^1.0.0",
|
|
57
|
+
"esm-env": "^1.0.0",
|
|
58
|
+
"svelte": "^4.2.18"
|
|
59
59
|
},
|
|
60
60
|
"sideEffects": false,
|
|
61
61
|
"homepage": "https://amadeusitgroup.github.io/AgnosUI/latest/",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from '@agnos-ui/svelte-headless/Slot.svelte.d';
|