@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
|
@@ -7,8 +7,8 @@ import { callWidgetFactory } from "../../config";
|
|
|
7
7
|
import SliderDefaultStructure from "./SliderDefaultStructure.svelte";
|
|
8
8
|
import SliderDefaultHandle from "./SliderDefaultHandle.svelte";
|
|
9
9
|
const defaultConfig = {
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
structure: SliderDefaultStructure,
|
|
11
|
+
handle: SliderDefaultHandle
|
|
12
12
|
};
|
|
13
13
|
</script>
|
|
14
14
|
|
|
@@ -27,19 +27,17 @@ const widget = callWidgetFactory({
|
|
|
27
27
|
});
|
|
28
28
|
export const api = widget.api;
|
|
29
29
|
const {
|
|
30
|
-
stores: {
|
|
30
|
+
stores: { structure$ },
|
|
31
31
|
directives: { sliderDirective },
|
|
32
32
|
state$
|
|
33
33
|
} = widget;
|
|
34
|
-
$:
|
|
35
|
-
|
|
36
|
-
$:
|
|
37
|
-
slotContext = { widget, state: $state$ };
|
|
34
|
+
$: widget.patchChangedProps($$props);
|
|
35
|
+
$: slotContext = { widget, state: $state$ };
|
|
38
36
|
</script>
|
|
39
37
|
|
|
40
38
|
<!-- on:blur={onTouched} ?? -->
|
|
41
39
|
<div use:sliderDirective {...__AgnosUISveltePreprocess__BROWSER ? {} : __AgnosUISveltePreprocess__ssrAttributes(sliderDirective)}>
|
|
42
|
-
<Slot slotContent={$
|
|
40
|
+
<Slot slotContent={$structure$} props={slotContext} let:component let:props>
|
|
43
41
|
<svelte:fragment slot="slot" let:props><slot name="structure" {...props} /></svelte:fragment>
|
|
44
42
|
<svelte:component this={component} {...props}>
|
|
45
43
|
<svelte:fragment slot="handle" let:item let:state let:widget><slot name="handle" {item} {state} {widget} /></svelte:fragment>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { SvelteComponent } from "svelte";
|
|
2
2
|
import type { SliderApi, SliderProps, SliderSlots } from './slider';
|
|
3
3
|
declare const __propDef: {
|
|
4
4
|
props: {
|
|
@@ -8,12 +8,14 @@ declare const __propDef: {
|
|
|
8
8
|
[evt: string]: CustomEvent<any>;
|
|
9
9
|
};
|
|
10
10
|
slots: SliderSlots;
|
|
11
|
+
exports?: {} | undefined;
|
|
12
|
+
bindings?: string | undefined;
|
|
11
13
|
};
|
|
12
14
|
type SliderProps_ = typeof __propDef.props;
|
|
13
15
|
export { SliderProps_ as SliderProps };
|
|
14
16
|
export type SliderEvents = typeof __propDef.events;
|
|
15
17
|
type SliderSlots_ = typeof __propDef.slots;
|
|
16
18
|
export { SliderSlots_ as SliderSlots };
|
|
17
|
-
export default class Slider extends
|
|
19
|
+
export default class Slider extends SvelteComponent<SliderProps_, SliderEvents, SliderSlots_> {
|
|
18
20
|
get api(): SliderApi;
|
|
19
21
|
}
|
|
@@ -1,15 +1,17 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import type {
|
|
1
|
+
import { SvelteComponent } from "svelte";
|
|
2
|
+
import type { SliderSlots } from './slider';
|
|
3
3
|
declare const __propDef: {
|
|
4
|
-
props:
|
|
4
|
+
props: any;
|
|
5
5
|
events: {
|
|
6
6
|
[evt: string]: CustomEvent<any>;
|
|
7
7
|
};
|
|
8
8
|
slots: SliderSlots;
|
|
9
|
+
exports?: {} | undefined;
|
|
10
|
+
bindings?: string | undefined;
|
|
9
11
|
};
|
|
10
12
|
export type SliderDefaultHandleProps = typeof __propDef.props;
|
|
11
13
|
export type SliderDefaultHandleEvents = typeof __propDef.events;
|
|
12
14
|
export type SliderDefaultHandleSlots = typeof __propDef.slots;
|
|
13
|
-
export default class SliderDefaultHandle extends
|
|
15
|
+
export default class SliderDefaultHandle extends SvelteComponent<SliderDefaultHandleProps, SliderDefaultHandleEvents, SliderDefaultHandleSlots> {
|
|
14
16
|
}
|
|
15
17
|
export {};
|
|
@@ -4,8 +4,7 @@ import {BROWSER as __AgnosUISveltePreprocess__BROWSER} from 'esm-env';
|
|
|
4
4
|
import { Slot } from "@agnos-ui/svelte-headless/slot";
|
|
5
5
|
export let state;
|
|
6
6
|
export let widget;
|
|
7
|
-
$:
|
|
8
|
-
slotContext = { widget, state };
|
|
7
|
+
$: slotContext = { widget, state };
|
|
9
8
|
</script>
|
|
10
9
|
|
|
11
10
|
{#each state.progressDisplayOptions as option}
|
|
@@ -14,7 +13,7 @@ $:
|
|
|
14
13
|
<div use:widget.directives.clickableAreaDirective {...__AgnosUISveltePreprocess__BROWSER ? {} : __AgnosUISveltePreprocess__ssrAttributes(widget.directives.clickableAreaDirective)} />
|
|
15
14
|
{#if state.showMinMaxLabels}
|
|
16
15
|
<div use:widget.directives.minLabelDirective {...__AgnosUISveltePreprocess__BROWSER ? {} : __AgnosUISveltePreprocess__ssrAttributes(widget.directives.minLabelDirective)}>
|
|
17
|
-
<Slot slotContent={state.
|
|
16
|
+
<Slot slotContent={state.label} props={{value: state.min, ...slotContext}} let:component let:props>
|
|
18
17
|
<svelte:fragment slot="slot" let:props><slot name="label" {...props} /></svelte:fragment>
|
|
19
18
|
<svelte:component this={component} {...props}>
|
|
20
19
|
<svelte:fragment slot="handle" let:item let:state let:widget><slot name="handle" {item} {state} {widget} /></svelte:fragment>
|
|
@@ -24,7 +23,7 @@ $:
|
|
|
24
23
|
</Slot>
|
|
25
24
|
</div>
|
|
26
25
|
<div use:widget.directives.maxLabelDirective {...__AgnosUISveltePreprocess__BROWSER ? {} : __AgnosUISveltePreprocess__ssrAttributes(widget.directives.maxLabelDirective)}>
|
|
27
|
-
<Slot slotContent={state.
|
|
26
|
+
<Slot slotContent={state.label} props={{value: state.max, ...slotContext}} let:component let:props>
|
|
28
27
|
<svelte:fragment slot="slot" let:props><slot name="label" {...props} /></svelte:fragment>
|
|
29
28
|
<svelte:component this={component} {...props}>
|
|
30
29
|
<svelte:fragment slot="handle" let:item let:state let:widget><slot name="handle" {item} {state} {widget} /></svelte:fragment>
|
|
@@ -37,7 +36,7 @@ $:
|
|
|
37
36
|
{#if state.showValueLabels && state.combinedLabelDisplay}
|
|
38
37
|
<div use:widget.directives.combinedHandleLabelDisplayDirective {...__AgnosUISveltePreprocess__BROWSER ? {} : __AgnosUISveltePreprocess__ssrAttributes(widget.directives.combinedHandleLabelDisplayDirective)}>
|
|
39
38
|
{#if state.rtl}
|
|
40
|
-
<Slot slotContent={state.
|
|
39
|
+
<Slot slotContent={state.label} props={{value: state.sortedValues[1], ...slotContext}} let:component let:props>
|
|
41
40
|
<svelte:fragment slot="slot" let:props><slot name="label" {...props} /></svelte:fragment>
|
|
42
41
|
<svelte:component this={component} {...props}>
|
|
43
42
|
<svelte:fragment slot="handle" let:item let:state let:widget><slot name="handle" {item} {state} {widget} /></svelte:fragment>
|
|
@@ -45,7 +44,7 @@ $:
|
|
|
45
44
|
<svelte:fragment slot="structure" let:state let:widget><slot name="structure" {state} {widget} /></svelte:fragment>
|
|
46
45
|
</svelte:component>
|
|
47
46
|
</Slot> -
|
|
48
|
-
<Slot slotContent={state.
|
|
47
|
+
<Slot slotContent={state.label} props={{value: state.sortedValues[0], ...slotContext}} let:component let:props>
|
|
49
48
|
<svelte:fragment slot="slot" let:props><slot name="label" {...props} /></svelte:fragment>
|
|
50
49
|
<svelte:component this={component} {...props}>
|
|
51
50
|
<svelte:fragment slot="handle" let:item let:state let:widget><slot name="handle" {item} {state} {widget} /></svelte:fragment>
|
|
@@ -54,7 +53,7 @@ $:
|
|
|
54
53
|
</svelte:component>
|
|
55
54
|
</Slot>
|
|
56
55
|
{:else}
|
|
57
|
-
<Slot slotContent={state.
|
|
56
|
+
<Slot slotContent={state.label} props={{value: state.sortedValues[0], ...slotContext}} let:component let:props>
|
|
58
57
|
<svelte:fragment slot="slot" let:props><slot name="label" {...props} /></svelte:fragment>
|
|
59
58
|
<svelte:component this={component} {...props}>
|
|
60
59
|
<svelte:fragment slot="handle" let:item let:state let:widget><slot name="handle" {item} {state} {widget} /></svelte:fragment>
|
|
@@ -62,7 +61,7 @@ $:
|
|
|
62
61
|
<svelte:fragment slot="structure" let:state let:widget><slot name="structure" {state} {widget} /></svelte:fragment>
|
|
63
62
|
</svelte:component>
|
|
64
63
|
</Slot> -
|
|
65
|
-
<Slot slotContent={state.
|
|
64
|
+
<Slot slotContent={state.label} props={{value: state.sortedValues[1], ...slotContext}} let:component let:props>
|
|
66
65
|
<svelte:fragment slot="slot" let:props><slot name="label" {...props} /></svelte:fragment>
|
|
67
66
|
<svelte:component this={component} {...props}>
|
|
68
67
|
<svelte:fragment slot="handle" let:item let:state let:widget><slot name="handle" {item} {state} {widget} /></svelte:fragment>
|
|
@@ -74,7 +73,7 @@ $:
|
|
|
74
73
|
</div>
|
|
75
74
|
{/if}
|
|
76
75
|
{#each state.sortedHandles as item, i (item.id)}
|
|
77
|
-
<Slot slotContent={state.
|
|
76
|
+
<Slot slotContent={state.handle} props={{item, ...slotContext}} let:component let:props>
|
|
78
77
|
<svelte:fragment slot="slot" let:props><slot name="handle" {...props} /></svelte:fragment>
|
|
79
78
|
<svelte:component this={component} {...props}>
|
|
80
79
|
<svelte:fragment slot="handle" let:item let:state let:widget><slot name="handle" {item} {state} {widget} /></svelte:fragment>
|
|
@@ -84,7 +83,7 @@ $:
|
|
|
84
83
|
</Slot>
|
|
85
84
|
{#if state.showValueLabels && !state.combinedLabelDisplay}
|
|
86
85
|
<div use:widget.directives.handleLabelDisplayDirective={{index: i}} {...__AgnosUISveltePreprocess__BROWSER ? {} : __AgnosUISveltePreprocess__ssrAttributes([widget.directives.handleLabelDisplayDirective, {index: i}])}>
|
|
87
|
-
<Slot slotContent={state.
|
|
86
|
+
<Slot slotContent={state.label} props={{value: state.values[i], ...slotContext}} let:component let:props>
|
|
88
87
|
<svelte:fragment slot="slot" let:props><slot name="label" {...props} /></svelte:fragment>
|
|
89
88
|
<svelte:component this={component} {...props}>
|
|
90
89
|
<svelte:fragment slot="handle" let:item let:state let:widget><slot name="handle" {item} {state} {widget} /></svelte:fragment>
|
|
@@ -1,15 +1,17 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import type {
|
|
1
|
+
import { SvelteComponent } from "svelte";
|
|
2
|
+
import type { SliderSlots } from './slider';
|
|
3
3
|
declare const __propDef: {
|
|
4
|
-
props:
|
|
4
|
+
props: WidgetSlotContext<Widget<import("./slider.gen").SliderProps, import("./slider.gen").SliderState, import("./slider.gen").SliderApi, import("./slider.gen").SliderActions, import("./slider.gen").SliderDirectives>>;
|
|
5
5
|
events: {
|
|
6
6
|
[evt: string]: CustomEvent<any>;
|
|
7
7
|
};
|
|
8
8
|
slots: SliderSlots;
|
|
9
|
+
exports?: {} | undefined;
|
|
10
|
+
bindings?: string | undefined;
|
|
9
11
|
};
|
|
10
12
|
export type SliderDefaultStructureProps = typeof __propDef.props;
|
|
11
13
|
export type SliderDefaultStructureEvents = typeof __propDef.events;
|
|
12
14
|
export type SliderDefaultStructureSlots = typeof __propDef.slots;
|
|
13
|
-
export default class SliderDefaultStructure extends
|
|
15
|
+
export default class SliderDefaultStructure extends SvelteComponent<SliderDefaultStructureProps, SliderDefaultStructureEvents, SliderDefaultStructureSlots> {
|
|
14
16
|
}
|
|
15
17
|
export {};
|
|
@@ -1,20 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
import type {
|
|
3
|
-
|
|
4
|
-
export
|
|
5
|
-
|
|
6
|
-
export interface SliderProps extends WidgetProps<SliderWidget> {
|
|
7
|
-
}
|
|
8
|
-
export interface SliderState extends WidgetState<SliderWidget> {
|
|
9
|
-
}
|
|
10
|
-
export interface SliderApi extends PropType<SliderWidget, 'api'> {
|
|
11
|
-
}
|
|
1
|
+
import type { WidgetPropsSlots, WidgetFactory } from '@agnos-ui/svelte-headless/types';
|
|
2
|
+
import type { SliderWidget, SliderProps } from './slider.gen';
|
|
3
|
+
export type * from './slider.gen';
|
|
4
|
+
export declare const createSlider: WidgetFactory<SliderWidget>;
|
|
5
|
+
export declare const getSliderDefaultConfig: () => SliderProps;
|
|
12
6
|
export interface SliderSlots extends WidgetPropsSlots<SliderProps> {
|
|
13
7
|
}
|
|
14
|
-
export interface SliderContext extends AdaptSlotContentProps<CoreContext> {
|
|
15
|
-
}
|
|
16
|
-
export interface SliderSlotHandleContext extends AdaptSlotContentProps<CoreHandleContext> {
|
|
17
|
-
}
|
|
18
|
-
export interface SliderSlotLabelContext extends AdaptSlotContentProps<CoreLabelContext> {
|
|
19
|
-
}
|
|
20
|
-
export declare const createSlider: WidgetFactory<SliderWidget>;
|
|
@@ -0,0 +1,293 @@
|
|
|
1
|
+
import type { WidgetSlotContext, SlotContent, Widget, Directive } from '@agnos-ui/svelte-headless/types';
|
|
2
|
+
export type SliderContext = WidgetSlotContext<SliderWidget>;
|
|
3
|
+
export type SliderSlotLabelContext = SliderContext & {
|
|
4
|
+
value: number;
|
|
5
|
+
};
|
|
6
|
+
export type SliderSlotHandleContext = SliderContext & {
|
|
7
|
+
item: SliderHandle;
|
|
8
|
+
};
|
|
9
|
+
export interface SliderState {
|
|
10
|
+
/**
|
|
11
|
+
* Sorted slider values
|
|
12
|
+
*/
|
|
13
|
+
sortedValues: number[];
|
|
14
|
+
/**
|
|
15
|
+
* Combined label left offset in %
|
|
16
|
+
*/
|
|
17
|
+
combinedLabelPositionLeft: number;
|
|
18
|
+
/**
|
|
19
|
+
* Combined label top offset in %
|
|
20
|
+
*/
|
|
21
|
+
combinedLabelPositionTop: number;
|
|
22
|
+
/**
|
|
23
|
+
* If true, the minimum label will be visible
|
|
24
|
+
*/
|
|
25
|
+
minValueLabelDisplay: boolean;
|
|
26
|
+
/**
|
|
27
|
+
* If true, the maximum label will be visible
|
|
28
|
+
*/
|
|
29
|
+
maxValueLabelDisplay: boolean;
|
|
30
|
+
/**
|
|
31
|
+
* If true, the label when the handles are close is visible
|
|
32
|
+
*/
|
|
33
|
+
combinedLabelDisplay: boolean;
|
|
34
|
+
/**
|
|
35
|
+
* Array of the sorted handles to display
|
|
36
|
+
*/
|
|
37
|
+
sortedHandles: SliderHandle[];
|
|
38
|
+
/**
|
|
39
|
+
* Array of objects representing progress display options
|
|
40
|
+
*/
|
|
41
|
+
progressDisplayOptions: ProgressDisplayOptions[];
|
|
42
|
+
/**
|
|
43
|
+
* Array of objects representing handle display options
|
|
44
|
+
*/
|
|
45
|
+
handleDisplayOptions: HandleDisplayOptions[];
|
|
46
|
+
/**
|
|
47
|
+
* Check if the slider is interactive, meaning it is not disabled or readonly
|
|
48
|
+
*/
|
|
49
|
+
interactive: boolean;
|
|
50
|
+
/**
|
|
51
|
+
* Minimum value that can be assigned to the slider
|
|
52
|
+
*/
|
|
53
|
+
min: number;
|
|
54
|
+
/**
|
|
55
|
+
* Maximum value that can be assigned to the slider
|
|
56
|
+
*/
|
|
57
|
+
max: number;
|
|
58
|
+
/**
|
|
59
|
+
* Unit value between slider steps
|
|
60
|
+
*/
|
|
61
|
+
stepSize: number;
|
|
62
|
+
/**
|
|
63
|
+
* If `true` slider value cannot be changed but the slider is still focusable
|
|
64
|
+
*/
|
|
65
|
+
readonly: boolean;
|
|
66
|
+
/**
|
|
67
|
+
* If `true` slider value cannot be changed and the slider cannot be focused
|
|
68
|
+
*/
|
|
69
|
+
disabled: boolean;
|
|
70
|
+
/**
|
|
71
|
+
* If `true` is vertically positioned otherwise it is horizontal
|
|
72
|
+
*/
|
|
73
|
+
vertical: boolean;
|
|
74
|
+
/**
|
|
75
|
+
* Current slider values
|
|
76
|
+
*/
|
|
77
|
+
values: number[];
|
|
78
|
+
/**
|
|
79
|
+
* If `true` the value labels are displayed on the slider
|
|
80
|
+
*/
|
|
81
|
+
showValueLabels: boolean;
|
|
82
|
+
/**
|
|
83
|
+
* If `true` the min and max labels are displayed on the slider
|
|
84
|
+
*/
|
|
85
|
+
showMinMaxLabels: boolean;
|
|
86
|
+
/**
|
|
87
|
+
* It `true` slider display is inversed
|
|
88
|
+
*/
|
|
89
|
+
rtl: boolean;
|
|
90
|
+
/**
|
|
91
|
+
* CSS classes to be applied on the widget main container
|
|
92
|
+
*/
|
|
93
|
+
className: string;
|
|
94
|
+
/**
|
|
95
|
+
* Slot to change the default display of the slider
|
|
96
|
+
*/
|
|
97
|
+
structure: SlotContent<SliderContext>;
|
|
98
|
+
/**
|
|
99
|
+
* Slot to change the default labels of the slider
|
|
100
|
+
*/
|
|
101
|
+
label: SlotContent<SliderSlotLabelContext>;
|
|
102
|
+
/**
|
|
103
|
+
* Slot to change the handlers
|
|
104
|
+
*/
|
|
105
|
+
handle: SlotContent<SliderSlotHandleContext>;
|
|
106
|
+
}
|
|
107
|
+
export interface SliderProps {
|
|
108
|
+
/**
|
|
109
|
+
* Return the value for the 'aria-label' attribute for the handle
|
|
110
|
+
*/
|
|
111
|
+
ariaLabelHandle: (value: number, sortedIndex: number, index: number) => string;
|
|
112
|
+
/**
|
|
113
|
+
* Return the value for the 'aria-valuetext' attribute for the handle
|
|
114
|
+
*/
|
|
115
|
+
ariaValueText: (value: number, sortedIndex: number, index: number) => string;
|
|
116
|
+
/**
|
|
117
|
+
* An event emitted when slider values are changed
|
|
118
|
+
*
|
|
119
|
+
* Event payload equals to the updated slider values
|
|
120
|
+
*/
|
|
121
|
+
onValuesChange: (values: number[]) => void;
|
|
122
|
+
/**
|
|
123
|
+
* Minimum value that can be assigned to the slider
|
|
124
|
+
*/
|
|
125
|
+
min: number;
|
|
126
|
+
/**
|
|
127
|
+
* Maximum value that can be assigned to the slider
|
|
128
|
+
*/
|
|
129
|
+
max: number;
|
|
130
|
+
/**
|
|
131
|
+
* Unit value between slider steps
|
|
132
|
+
*/
|
|
133
|
+
stepSize: number;
|
|
134
|
+
/**
|
|
135
|
+
* If `true` slider value cannot be changed but the slider is still focusable
|
|
136
|
+
*/
|
|
137
|
+
readonly: boolean;
|
|
138
|
+
/**
|
|
139
|
+
* If `true` slider value cannot be changed and the slider cannot be focused
|
|
140
|
+
*/
|
|
141
|
+
disabled: boolean;
|
|
142
|
+
/**
|
|
143
|
+
* If `true` is vertically positioned otherwise it is horizontal
|
|
144
|
+
*/
|
|
145
|
+
vertical: boolean;
|
|
146
|
+
/**
|
|
147
|
+
* Current slider values
|
|
148
|
+
*/
|
|
149
|
+
values: number[];
|
|
150
|
+
/**
|
|
151
|
+
* If `true` the value labels are displayed on the slider
|
|
152
|
+
*/
|
|
153
|
+
showValueLabels: boolean;
|
|
154
|
+
/**
|
|
155
|
+
* If `true` the min and max labels are displayed on the slider
|
|
156
|
+
*/
|
|
157
|
+
showMinMaxLabels: boolean;
|
|
158
|
+
/**
|
|
159
|
+
* It `true` slider display is inversed
|
|
160
|
+
*/
|
|
161
|
+
rtl: boolean;
|
|
162
|
+
/**
|
|
163
|
+
* CSS classes to be applied on the widget main container
|
|
164
|
+
*/
|
|
165
|
+
className: string;
|
|
166
|
+
/**
|
|
167
|
+
* Slot to change the default display of the slider
|
|
168
|
+
*/
|
|
169
|
+
structure: SlotContent<SliderContext>;
|
|
170
|
+
/**
|
|
171
|
+
* Slot to change the default labels of the slider
|
|
172
|
+
*/
|
|
173
|
+
label: SlotContent<SliderSlotLabelContext>;
|
|
174
|
+
/**
|
|
175
|
+
* Slot to change the handlers
|
|
176
|
+
*/
|
|
177
|
+
handle: SlotContent<SliderSlotHandleContext>;
|
|
178
|
+
}
|
|
179
|
+
export type SliderWidget = Widget<SliderProps, SliderState, SliderApi, SliderActions, SliderDirectives>;
|
|
180
|
+
export interface ProgressDisplayOptions {
|
|
181
|
+
/**
|
|
182
|
+
* Right offset of the progress in %
|
|
183
|
+
*/
|
|
184
|
+
left: number | null;
|
|
185
|
+
/**
|
|
186
|
+
* Left offset of the progress in %
|
|
187
|
+
*/
|
|
188
|
+
right: number | null;
|
|
189
|
+
/**
|
|
190
|
+
* Top offset of the progress in %
|
|
191
|
+
*/
|
|
192
|
+
top: number | null;
|
|
193
|
+
/**
|
|
194
|
+
* Bottom offset of the progress in %
|
|
195
|
+
*/
|
|
196
|
+
bottom: number | null;
|
|
197
|
+
/**
|
|
198
|
+
* Width of the progress in %
|
|
199
|
+
*/
|
|
200
|
+
width: number;
|
|
201
|
+
/**
|
|
202
|
+
* Height of hte progress in %
|
|
203
|
+
*/
|
|
204
|
+
height: number;
|
|
205
|
+
}
|
|
206
|
+
export interface HandleDisplayOptions {
|
|
207
|
+
/**
|
|
208
|
+
* Left offset of the handle in %
|
|
209
|
+
*/
|
|
210
|
+
left: number | null;
|
|
211
|
+
/**
|
|
212
|
+
* Top offset of the handle in %
|
|
213
|
+
*/
|
|
214
|
+
top: number | null;
|
|
215
|
+
}
|
|
216
|
+
export interface SliderHandle {
|
|
217
|
+
/**
|
|
218
|
+
* Value of the handle
|
|
219
|
+
*/
|
|
220
|
+
value: number;
|
|
221
|
+
/**
|
|
222
|
+
* Handle id
|
|
223
|
+
*/
|
|
224
|
+
id: number;
|
|
225
|
+
/**
|
|
226
|
+
* ariaLabel of the handle
|
|
227
|
+
*/
|
|
228
|
+
ariaLabel: string;
|
|
229
|
+
/**
|
|
230
|
+
* ariaValueText of the handle
|
|
231
|
+
*/
|
|
232
|
+
ariaValueText: string;
|
|
233
|
+
}
|
|
234
|
+
export interface SliderApi {
|
|
235
|
+
}
|
|
236
|
+
export interface SliderDirectives {
|
|
237
|
+
/**
|
|
238
|
+
* Directive to get the slider component elementRef
|
|
239
|
+
*/
|
|
240
|
+
sliderDirective: Directive;
|
|
241
|
+
/**
|
|
242
|
+
* Directive used to style the progress display for each handle
|
|
243
|
+
*/
|
|
244
|
+
progressDisplayDirective: Directive<{
|
|
245
|
+
option: ProgressDisplayOptions;
|
|
246
|
+
}>;
|
|
247
|
+
/**
|
|
248
|
+
* Directive to apply to the slider clickable area, to directly move the handle to a given specific position
|
|
249
|
+
*/
|
|
250
|
+
clickableAreaDirective: Directive;
|
|
251
|
+
/**
|
|
252
|
+
* Directive to apply to the slider handle if any
|
|
253
|
+
*/
|
|
254
|
+
handleDirective: Directive<{
|
|
255
|
+
item: SliderHandle;
|
|
256
|
+
}>;
|
|
257
|
+
/**
|
|
258
|
+
* Directive to get the minLabel elementRef
|
|
259
|
+
*/
|
|
260
|
+
minLabelDirective: Directive;
|
|
261
|
+
/**
|
|
262
|
+
* Directive to get the maxLabel elementRef
|
|
263
|
+
*/
|
|
264
|
+
maxLabelDirective: Directive;
|
|
265
|
+
/**
|
|
266
|
+
* Directive to apply to the handle when combined label display is active
|
|
267
|
+
*/
|
|
268
|
+
combinedHandleLabelDisplayDirective: Directive;
|
|
269
|
+
/**
|
|
270
|
+
* Directive to apply to the handle when combined label display is not active
|
|
271
|
+
*/
|
|
272
|
+
handleLabelDisplayDirective: Directive<{
|
|
273
|
+
index: number;
|
|
274
|
+
}>;
|
|
275
|
+
}
|
|
276
|
+
export interface SliderActions {
|
|
277
|
+
/**
|
|
278
|
+
* Method to handle click on the slider
|
|
279
|
+
*/
|
|
280
|
+
click(event: MouseEvent): void;
|
|
281
|
+
/**
|
|
282
|
+
* Method to process the keyboard event
|
|
283
|
+
*/
|
|
284
|
+
keydown(event: KeyboardEvent, handleNumber: number): void;
|
|
285
|
+
/**
|
|
286
|
+
* Method describing the behavior of the slider handle on mouse down event
|
|
287
|
+
*/
|
|
288
|
+
mouseDown(event: MouseEvent, handleId: number): void;
|
|
289
|
+
/**
|
|
290
|
+
* Method describing the behavior of the slider handle on touch start event
|
|
291
|
+
*/
|
|
292
|
+
touchStart(event: TouchEvent, handleId: number): void;
|
|
293
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
import { createSlider as coreCreateSlider } from '@agnos-ui/core-bootstrap/components/slider';
|
|
3
|
-
// factory
|
|
1
|
+
import { createSlider as coreCreateSlider, getSliderDefaultConfig as coreGetSliderDefaultConfig } from '@agnos-ui/core-bootstrap/components/slider';
|
|
4
2
|
export const createSlider = coreCreateSlider;
|
|
3
|
+
export const getSliderDefaultConfig = coreGetSliderDefaultConfig;
|
|
@@ -6,7 +6,7 @@ import { createToast } from "./toast";
|
|
|
6
6
|
import { callWidgetFactory } from "../../config";
|
|
7
7
|
import ToastDefaultStructure from "./ToastDefaultStructure.svelte";
|
|
8
8
|
const defaultConfig = {
|
|
9
|
-
|
|
9
|
+
structure: ToastDefaultStructure
|
|
10
10
|
};
|
|
11
11
|
</script>
|
|
12
12
|
|
|
@@ -25,26 +25,17 @@ const defaultConfig = {
|
|
|
25
25
|
export let visible = void 0;
|
|
26
26
|
export const api = widget.api;
|
|
27
27
|
const {
|
|
28
|
-
stores: {
|
|
28
|
+
stores: { structure$, hidden$, header$, dismissible$ },
|
|
29
29
|
directives: { transitionDirective, autoHideDirective, bodyDirective },
|
|
30
30
|
state$
|
|
31
31
|
} = widget;
|
|
32
|
-
$:
|
|
33
|
-
|
|
34
|
-
$:
|
|
35
|
-
slotContext = { widget, state: $state$ };
|
|
32
|
+
$: widget.patchChangedProps($$props);
|
|
33
|
+
$: slotContext = { widget, state: $state$ };
|
|
36
34
|
</script>
|
|
37
35
|
|
|
38
36
|
{#if !$hidden$}
|
|
39
|
-
<div
|
|
40
|
-
|
|
41
|
-
class:toast-dismissible={$state$.dismissible}
|
|
42
|
-
class:d-flex={!$state$.slotHeader}
|
|
43
|
-
use:transitionDirective
|
|
44
|
-
use:autoHideDirective
|
|
45
|
-
use:bodyDirective {...__AgnosUISveltePreprocess__BROWSER ? {} : __AgnosUISveltePreprocess__ssrAttributes(transitionDirective, autoHideDirective, bodyDirective, [__AgnosUISveltePreprocess__classDirective, "toast"])}
|
|
46
|
-
>
|
|
47
|
-
<Slot slotContent={$slotStructure$} props={slotContext} let:component let:props>
|
|
37
|
+
<div use:__AgnosUISveltePreprocess__classDirective={"toast"} class:toast-dismissible={$dismissible$} class:d-flex={!$header$} use:transitionDirective use:autoHideDirective use:bodyDirective {...__AgnosUISveltePreprocess__BROWSER ? {} : __AgnosUISveltePreprocess__ssrAttributes(transitionDirective, autoHideDirective, bodyDirective, [__AgnosUISveltePreprocess__classDirective, "toast"])}>
|
|
38
|
+
<Slot slotContent={$structure$} props={slotContext} let:component let:props>
|
|
48
39
|
<svelte:fragment slot="slot" let:props><slot name="structure" {...props} /></svelte:fragment>
|
|
49
40
|
<svelte:component this={component} {...props}>
|
|
50
41
|
<svelte:fragment let:state let:widget><slot {state} {widget} /></svelte:fragment>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { SvelteComponent } from "svelte";
|
|
2
2
|
import type { ToastApi, ToastProps, ToastSlots } from './toast';
|
|
3
3
|
declare const __propDef: {
|
|
4
4
|
props: {
|
|
@@ -8,12 +8,14 @@ declare const __propDef: {
|
|
|
8
8
|
[evt: string]: CustomEvent<any>;
|
|
9
9
|
};
|
|
10
10
|
slots: ToastSlots;
|
|
11
|
+
exports?: {} | undefined;
|
|
12
|
+
bindings?: string | undefined;
|
|
11
13
|
};
|
|
12
14
|
type ToastProps_ = typeof __propDef.props;
|
|
13
15
|
export { ToastProps_ as ToastProps };
|
|
14
16
|
export type ToastEvents = typeof __propDef.events;
|
|
15
17
|
type ToastSlots_ = typeof __propDef.slots;
|
|
16
18
|
export { ToastSlots_ as ToastSlots };
|
|
17
|
-
export default class Toast extends
|
|
19
|
+
export default class Toast extends SvelteComponent<ToastProps_, ToastEvents, ToastSlots_> {
|
|
18
20
|
get api(): ToastApi;
|
|
19
21
|
}
|
|
@@ -4,13 +4,12 @@ import {BROWSER as __AgnosUISveltePreprocess__BROWSER} from 'esm-env';
|
|
|
4
4
|
import { Slot } from "@agnos-ui/svelte-headless/slot";
|
|
5
5
|
export let state;
|
|
6
6
|
export let widget;
|
|
7
|
-
$:
|
|
8
|
-
slotContext = { widget, state };
|
|
7
|
+
$: slotContext = { widget, state };
|
|
9
8
|
</script>
|
|
10
9
|
|
|
11
|
-
{#if state.
|
|
10
|
+
{#if state.header}
|
|
12
11
|
<div class="toast-header">
|
|
13
|
-
<Slot slotContent={state.
|
|
12
|
+
<Slot slotContent={state.header} props={slotContext} let:component let:props>
|
|
14
13
|
<svelte:fragment slot="slot" let:props><slot name="header" {...props} /></svelte:fragment>
|
|
15
14
|
<svelte:component this={component} {...props}>
|
|
16
15
|
<svelte:fragment let:state let:widget><slot {state} {widget} /></svelte:fragment>
|
|
@@ -25,7 +24,7 @@ $:
|
|
|
25
24
|
{/if}
|
|
26
25
|
|
|
27
26
|
<div class="toast-body">
|
|
28
|
-
<Slot slotContent={state.
|
|
27
|
+
<Slot slotContent={state.children} props={slotContext} let:component let:props>
|
|
29
28
|
<svelte:fragment slot="slot" let:props><slot {...props} /></svelte:fragment>
|
|
30
29
|
<svelte:component this={component} {...props}>
|
|
31
30
|
<svelte:fragment let:state let:widget><slot {state} {widget} /></svelte:fragment>
|
|
@@ -34,6 +33,6 @@ $:
|
|
|
34
33
|
</svelte:component>
|
|
35
34
|
</Slot>
|
|
36
35
|
</div>
|
|
37
|
-
{#if state.dismissible && !state.
|
|
36
|
+
{#if state.dismissible && !state.header}
|
|
38
37
|
<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"])} />
|
|
39
38
|
{/if}
|
|
@@ -1,15 +1,17 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import type {
|
|
1
|
+
import { SvelteComponent } from "svelte";
|
|
2
|
+
import type { ToastSlots } from './toast';
|
|
3
3
|
declare const __propDef: {
|
|
4
|
-
props:
|
|
4
|
+
props: WidgetSlotContext<Widget<import("./toast.gen").ToastProps, import("./toast.gen").ToastState, import("./toast.gen").ToastApi, object, import("./toast.gen").ToastDirectives>>;
|
|
5
5
|
events: {
|
|
6
6
|
[evt: string]: CustomEvent<any>;
|
|
7
7
|
};
|
|
8
8
|
slots: ToastSlots;
|
|
9
|
+
exports?: {} | undefined;
|
|
10
|
+
bindings?: string | undefined;
|
|
9
11
|
};
|
|
10
12
|
export type ToastDefaultStructureProps = typeof __propDef.props;
|
|
11
13
|
export type ToastDefaultStructureEvents = typeof __propDef.events;
|
|
12
14
|
export type ToastDefaultStructureSlots = typeof __propDef.slots;
|
|
13
|
-
export default class ToastDefaultStructure extends
|
|
15
|
+
export default class ToastDefaultStructure extends SvelteComponent<ToastDefaultStructureProps, ToastDefaultStructureEvents, ToastDefaultStructureSlots> {
|
|
14
16
|
}
|
|
15
17
|
export {};
|
|
@@ -1,16 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
import type {
|
|
3
|
-
|
|
4
|
-
export
|
|
5
|
-
|
|
6
|
-
export interface ToastProps extends WidgetProps<ToastWidget> {
|
|
7
|
-
}
|
|
8
|
-
export interface ToastState extends WidgetState<ToastWidget> {
|
|
9
|
-
}
|
|
10
|
-
export interface ToastApi extends PropType<ToastWidget, 'api'> {
|
|
11
|
-
}
|
|
1
|
+
import type { WidgetPropsSlots, WidgetFactory } from '@agnos-ui/svelte-headless/types';
|
|
2
|
+
import type { ToastWidget, ToastProps } from './toast.gen';
|
|
3
|
+
export type * from './toast.gen';
|
|
4
|
+
export declare const createToast: WidgetFactory<ToastWidget>;
|
|
5
|
+
export declare const getToastDefaultConfig: () => ToastProps;
|
|
12
6
|
export interface ToastSlots extends WidgetPropsSlots<ToastProps> {
|
|
13
7
|
}
|
|
14
|
-
export interface ToastContext extends AdaptSlotContentProps<CoreContext> {
|
|
15
|
-
}
|
|
16
|
-
export declare const createToast: WidgetFactory<ToastWidget>;
|