@agnos-ui/svelte-bootstrap 0.10.0-next.2 → 0.10.0-next.3
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/drawer/Drawer.svelte +7 -9
- package/components/drawer/Drawer.svelte.d.ts +1 -1
- package/components/drawer/DrawerDefaultStructure.svelte +8 -12
- package/components/drawer/drawer.gen.d.ts +39 -21
- package/components/slider/SliderDefaultHandle.svelte +1 -1
- package/components/slider/SliderDefaultStructure.svelte +1 -1
- package/generated/index.d.ts +1 -0
- package/generated/index.js +1 -0
- package/generated/services/pointerdownPosition.d.ts +1 -0
- package/generated/services/pointerdownPosition.js +1 -0
- package/package.json +3 -3
|
@@ -8,27 +8,21 @@ import {BROWSER as __AgnosUISveltePreprocess__BROWSER} from 'esm-env';
|
|
|
8
8
|
import {createDrawer} from './drawer.gen';
|
|
9
9
|
import DrawerDefaultStructure from './DrawerDefaultStructure.svelte';
|
|
10
10
|
|
|
11
|
-
let {
|
|
11
|
+
let {visible = $bindable(), ...props}: Partial<DrawerProps> = $props();
|
|
12
12
|
|
|
13
13
|
const widget = callWidgetFactory(createDrawer, {
|
|
14
14
|
get props() {
|
|
15
|
-
return {...props,
|
|
15
|
+
return {...props, visible};
|
|
16
16
|
},
|
|
17
17
|
defaultConfig: {structure},
|
|
18
18
|
events: {
|
|
19
|
-
onWidthChange: (value: number) => {
|
|
20
|
-
width = value;
|
|
21
|
-
},
|
|
22
|
-
onHeightChange: (value: number) => {
|
|
23
|
-
height = value;
|
|
24
|
-
},
|
|
25
19
|
onVisibleChange: (event) => {
|
|
26
20
|
visible = event;
|
|
27
21
|
},
|
|
28
22
|
},
|
|
29
23
|
});
|
|
30
24
|
const {
|
|
31
|
-
directives: {backdropDirective, backdropPortalDirective, drawerDirective, drawerPortalDirective, containerDirective},
|
|
25
|
+
directives: {backdropDirective, backdropPortalDirective, drawerDirective, drawerPortalDirective, containerDirective, splitterDirective},
|
|
32
26
|
state,
|
|
33
27
|
} = widget;
|
|
34
28
|
|
|
@@ -44,6 +38,10 @@ import {BROWSER as __AgnosUISveltePreprocess__BROWSER} from 'esm-env';
|
|
|
44
38
|
<div use:containerDirective {...__AgnosUISveltePreprocess__BROWSER ? {} : __AgnosUISveltePreprocess__ssrAttributes(containerDirective)}>
|
|
45
39
|
<Slot content={state.structure} props={widget} />
|
|
46
40
|
</div>
|
|
41
|
+
{#if state.resizable}
|
|
42
|
+
<!-- svelte-ignore a11y_no_noninteractive_tabindex -->
|
|
43
|
+
<div use:splitterDirective tabindex="0" {...__AgnosUISveltePreprocess__BROWSER ? {} : __AgnosUISveltePreprocess__ssrAttributes(splitterDirective)}></div>
|
|
44
|
+
{/if}
|
|
47
45
|
</div>
|
|
48
46
|
{/if}
|
|
49
47
|
{#if !state.backdropHidden}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { DrawerApi, DrawerProps } from './drawer.gen';
|
|
2
2
|
declare const Drawer: import("svelte").Component<Partial<DrawerProps>, {
|
|
3
3
|
api: DrawerApi;
|
|
4
|
-
}, "visible"
|
|
4
|
+
}, "visible">;
|
|
5
5
|
type Drawer = ReturnType<typeof Drawer>;
|
|
6
6
|
export default Drawer;
|
|
@@ -1,20 +1,16 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import {ssrAttributes as __AgnosUISveltePreprocess__ssrAttributes} from '@agnos-ui/svelte-headless/utils/directive';
|
|
3
|
-
import {BROWSER as __AgnosUISveltePreprocess__BROWSER} from 'esm-env';
|
|
4
|
-
|
|
5
2
|
import {Slot} from '@agnos-ui/svelte-headless/slot';
|
|
6
3
|
import type {DrawerContext} from './drawer.gen';
|
|
7
4
|
|
|
8
5
|
let widget: DrawerContext = $props();
|
|
9
|
-
let {state
|
|
6
|
+
let {state} = widget;
|
|
10
7
|
</script>
|
|
11
8
|
|
|
12
|
-
<div class="au-drawer-
|
|
13
|
-
<
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
<
|
|
9
|
+
<div class="au-drawer-content">
|
|
10
|
+
<div class="au-drawer-header">
|
|
11
|
+
<Slot content={state.header} props={widget} />
|
|
12
|
+
</div>
|
|
13
|
+
<div class="au-drawer-body">
|
|
14
|
+
<Slot content={state.children} props={widget} />
|
|
15
|
+
</div>
|
|
17
16
|
</div>
|
|
18
|
-
{#if state.resizable}
|
|
19
|
-
<div use:directives.splitterDirective {...__AgnosUISveltePreprocess__BROWSER ? {} : __AgnosUISveltePreprocess__ssrAttributes(directives.splitterDirective)}></div>
|
|
20
|
-
{/if}
|
|
@@ -59,6 +59,13 @@ export interface DrawerState {
|
|
|
59
59
|
* @defaultValue `false`
|
|
60
60
|
*/
|
|
61
61
|
resizable: boolean;
|
|
62
|
+
/**
|
|
63
|
+
* Size of the drawer in pixel once the user start interacting.
|
|
64
|
+
* It corresponds to the height or the width depending on the drawer orientation
|
|
65
|
+
*
|
|
66
|
+
* @defaultValue `null`
|
|
67
|
+
*/
|
|
68
|
+
size: number | null;
|
|
62
69
|
/**
|
|
63
70
|
* Global template for the drawer component
|
|
64
71
|
*/
|
|
@@ -118,18 +125,6 @@ export interface DrawerProps {
|
|
|
118
125
|
* @defaultValue `''`
|
|
119
126
|
*/
|
|
120
127
|
ariaDescribedBy: string;
|
|
121
|
-
/**
|
|
122
|
-
* The width of the drawer in pixels.
|
|
123
|
-
*
|
|
124
|
-
* @defaultValue `200`
|
|
125
|
-
*/
|
|
126
|
-
width: number;
|
|
127
|
-
/**
|
|
128
|
-
* The height of the drawer in pixels.
|
|
129
|
-
*
|
|
130
|
-
* @defaultValue `200`
|
|
131
|
-
*/
|
|
132
|
-
height: number;
|
|
133
128
|
/**
|
|
134
129
|
* If `true` displays the backdrop element and disables the body scrolling, otherwise the body of the document is navigable
|
|
135
130
|
*
|
|
@@ -161,38 +156,54 @@ export interface DrawerProps {
|
|
|
161
156
|
*/
|
|
162
157
|
onShown: () => void;
|
|
163
158
|
/**
|
|
164
|
-
* An event emitted when the width
|
|
159
|
+
* An event emitted when the drawer size changes (width or height depending on the orientation).
|
|
165
160
|
*
|
|
166
|
-
* Event payload is equal to the newly selected width.
|
|
161
|
+
* Event payload is equal to the newly selected width or height.
|
|
167
162
|
*
|
|
168
163
|
* @defaultValue
|
|
169
164
|
* ```ts
|
|
170
165
|
* () => {}
|
|
171
166
|
* ```
|
|
172
167
|
*/
|
|
173
|
-
|
|
168
|
+
onSizeChange: (size: number | null) => void;
|
|
174
169
|
/**
|
|
175
|
-
*
|
|
170
|
+
* Event to be triggered when the visible property changes.
|
|
176
171
|
*
|
|
177
|
-
*
|
|
172
|
+
* @param visible - new value of the visible propery
|
|
178
173
|
*
|
|
179
174
|
* @defaultValue
|
|
180
175
|
* ```ts
|
|
181
176
|
* () => {}
|
|
182
177
|
* ```
|
|
183
178
|
*/
|
|
184
|
-
|
|
179
|
+
onVisibleChange: (visible: boolean) => void;
|
|
185
180
|
/**
|
|
186
|
-
* Event to be triggered when the
|
|
181
|
+
* Event to be triggered when the minimized state changes.
|
|
187
182
|
*
|
|
188
|
-
* @
|
|
183
|
+
* @defaultValue
|
|
184
|
+
* ```ts
|
|
185
|
+
* () => {}
|
|
186
|
+
* ```
|
|
187
|
+
*/
|
|
188
|
+
onMinimizedChange: (isMinimized: boolean) => void;
|
|
189
|
+
/**
|
|
190
|
+
* Event to be triggered when the maximized state changes.
|
|
189
191
|
*
|
|
190
192
|
* @defaultValue
|
|
191
193
|
* ```ts
|
|
192
194
|
* () => {}
|
|
193
195
|
* ```
|
|
194
196
|
*/
|
|
195
|
-
|
|
197
|
+
onMaximizedChange: (isMaximized: boolean) => void;
|
|
198
|
+
/**
|
|
199
|
+
* Event to be triggered when the user starts or stops resizing the drawer.
|
|
200
|
+
*
|
|
201
|
+
* @defaultValue
|
|
202
|
+
* ```ts
|
|
203
|
+
* () => {}
|
|
204
|
+
* ```
|
|
205
|
+
*/
|
|
206
|
+
onResizingChange: (isResizing: boolean) => void;
|
|
196
207
|
/**
|
|
197
208
|
* CSS classes to be applied on the widget main container
|
|
198
209
|
*
|
|
@@ -228,6 +239,13 @@ export interface DrawerProps {
|
|
|
228
239
|
* @defaultValue `false`
|
|
229
240
|
*/
|
|
230
241
|
resizable: boolean;
|
|
242
|
+
/**
|
|
243
|
+
* Size of the drawer in pixel once the user start interacting.
|
|
244
|
+
* It corresponds to the height or the width depending on the drawer orientation
|
|
245
|
+
*
|
|
246
|
+
* @defaultValue `null`
|
|
247
|
+
*/
|
|
248
|
+
size: number | null;
|
|
231
249
|
/**
|
|
232
250
|
* Global template for the drawer component
|
|
233
251
|
*/
|
|
@@ -7,7 +7,7 @@ import {BROWSER as __AgnosUISveltePreprocess__BROWSER} from 'esm-env';
|
|
|
7
7
|
let {item, directives}: SliderSlotHandleContext = $props();
|
|
8
8
|
|
|
9
9
|
let refocusElement: HTMLElement | undefined = $state(undefined);
|
|
10
|
-
let updateTimeout:
|
|
10
|
+
let updateTimeout: ReturnType<typeof setTimeout>;
|
|
11
11
|
|
|
12
12
|
// Manually keep focus as scheduling goal elements are re-ordered.
|
|
13
13
|
// Svelte currently does not retain focus as elements are moved, even when keyed.
|
|
@@ -37,7 +37,7 @@ import {BROWSER as __AgnosUISveltePreprocess__BROWSER} from 'esm-env';
|
|
|
37
37
|
{/each}
|
|
38
38
|
{#each state.sortedHandles as item, i (item.id)}
|
|
39
39
|
<Slot content={state.handle} props={{item, ...widget}} />
|
|
40
|
-
{#if state.showValueLabels
|
|
40
|
+
{#if state.showValueLabels}
|
|
41
41
|
<div use:directives.handleLabelDisplayDirective={{index: i}} {...__AgnosUISveltePreprocess__BROWSER ? {} : __AgnosUISveltePreprocess__ssrAttributes([directives.handleLabelDisplayDirective, {index: i}])}>
|
|
42
42
|
<Slot content={state.label} props={{value: state.values[i], ...widget}} />
|
|
43
43
|
</div>
|
package/generated/index.d.ts
CHANGED
|
@@ -11,6 +11,7 @@ export * from './utils/directive';
|
|
|
11
11
|
export * from './services/siblingsInert';
|
|
12
12
|
export * from './services/resizeObserver';
|
|
13
13
|
export * from './services/portal';
|
|
14
|
+
export * from './services/pointerdownPosition';
|
|
14
15
|
export * from './services/navManager';
|
|
15
16
|
export * from './services/matchMedia';
|
|
16
17
|
export * from './services/intersection';
|
package/generated/index.js
CHANGED
|
@@ -11,6 +11,7 @@ export * from './utils/directive';
|
|
|
11
11
|
export * from './services/siblingsInert';
|
|
12
12
|
export * from './services/resizeObserver';
|
|
13
13
|
export * from './services/portal';
|
|
14
|
+
export * from './services/pointerdownPosition';
|
|
14
15
|
export * from './services/navManager';
|
|
15
16
|
export * from './services/matchMedia';
|
|
16
17
|
export * from './services/intersection';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@agnos-ui/svelte-headless/services/pointerdownPosition';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@agnos-ui/svelte-headless/services/pointerdownPosition';
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agnos-ui/svelte-bootstrap",
|
|
3
3
|
"description": "Bootstrap-based component library for Svelte.",
|
|
4
|
-
"version": "0.10.0-next.
|
|
4
|
+
"version": "0.10.0-next.3",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./index.js",
|
|
7
7
|
"module": "./index.js",
|
|
@@ -49,8 +49,8 @@
|
|
|
49
49
|
}
|
|
50
50
|
},
|
|
51
51
|
"dependencies": {
|
|
52
|
-
"@agnos-ui/core-bootstrap": "0.10.0-next.
|
|
53
|
-
"@agnos-ui/svelte-headless": "0.10.0-next.
|
|
52
|
+
"@agnos-ui/core-bootstrap": "0.10.0-next.3",
|
|
53
|
+
"@agnos-ui/svelte-headless": "0.10.0-next.3"
|
|
54
54
|
},
|
|
55
55
|
"peerDependencies": {
|
|
56
56
|
"@amadeus-it-group/tansu": "^2.0.0",
|