@marianmeres/stuic 1.76.0 → 1.78.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/dist/components/AlertConfirmPrompt/AlertConfirmPrompt.svelte +8 -0
- package/dist/components/AlertConfirmPrompt/AlertConfirmPrompt.svelte.d.ts +8 -1
- package/dist/components/Button/Button.svelte +6 -2
- package/dist/components/Button/Button.svelte.d.ts +2 -0
- package/dist/components/Drawer/Drawer.svelte.d.ts +1 -1
- package/dist/components/Input/Field.svelte +24 -0
- package/dist/components/Input/Field.svelte.d.ts +13 -0
- package/dist/components/Notifications/Notifications.svelte +8 -1
- package/dist/components/Notifications/Notifications.svelte.d.ts +19 -2
- package/dist/index.d.ts +1 -1
- package/package.json +1 -1
|
@@ -6,8 +6,10 @@ import {
|
|
|
6
6
|
Button,
|
|
7
7
|
Field,
|
|
8
8
|
FieldSelect,
|
|
9
|
+
Notifications,
|
|
9
10
|
Thc,
|
|
10
11
|
createAlertConfirmPromptStore,
|
|
12
|
+
createNotificationsStore,
|
|
11
13
|
focusTrap
|
|
12
14
|
} from "../../index.js";
|
|
13
15
|
import { acpDefaultIcons } from "./acp-icons.js";
|
|
@@ -72,6 +74,8 @@ const _isFn = (v) => typeof v === "function";
|
|
|
72
74
|
|
|
73
75
|
<script>const { ALERT, CONFIRM, PROMPT } = AlertConfirmPromptType;
|
|
74
76
|
const clog = createClog("AlertConfirmPrompt");
|
|
77
|
+
export let notifications = void 0;
|
|
78
|
+
export let notificationsPositionConfig = {};
|
|
75
79
|
export let acp;
|
|
76
80
|
export let forceAsHtml = void 0;
|
|
77
81
|
export let defaultIcons = acpDefaultIcons;
|
|
@@ -334,6 +338,10 @@ $:
|
|
|
334
338
|
{/if}
|
|
335
339
|
</form>
|
|
336
340
|
{/if}
|
|
341
|
+
|
|
342
|
+
{#if notifications}
|
|
343
|
+
<Notifications {notifications} {...notificationsPositionConfig || {}} />
|
|
344
|
+
{/if}
|
|
337
345
|
</dialog>
|
|
338
346
|
|
|
339
347
|
<style>@keyframes -global-rotating-cw {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { SvelteComponent } from "svelte";
|
|
2
|
-
import { createAlertConfirmPromptStore } from '../../index.js';
|
|
2
|
+
import { createAlertConfirmPromptStore, createNotificationsStore, type NOTIFICATIONS_POSX, type NOTIFICATIONS_POSY } from '../../index.js';
|
|
3
3
|
import type { AlertConfirmPromptKnownClasses, AlertConfirmPromptVariant } from './alert-confirm-prompt.js';
|
|
4
4
|
export interface AlertConfirmPromptIcons extends Record<AlertConfirmPromptVariant, () => string> {
|
|
5
5
|
spinner: () => string;
|
|
@@ -71,6 +71,13 @@ export declare class AlertConfirmPromptConfig {
|
|
|
71
71
|
}
|
|
72
72
|
declare const __propDef: {
|
|
73
73
|
props: {
|
|
74
|
+
notifications?: ReturnType<typeof createNotificationsStore> | undefined;
|
|
75
|
+
notificationsPositionConfig?: Partial<{
|
|
76
|
+
posX: NOTIFICATIONS_POSX;
|
|
77
|
+
posXMobile: NOTIFICATIONS_POSX;
|
|
78
|
+
posY: NOTIFICATIONS_POSY;
|
|
79
|
+
posYMobile: NOTIFICATIONS_POSY;
|
|
80
|
+
}> | undefined;
|
|
74
81
|
acp: ReturnType<typeof createAlertConfirmPromptStore>;
|
|
75
82
|
forceAsHtml?: boolean | undefined;
|
|
76
83
|
defaultIcons?: Partial<AlertConfirmPromptIcons> | undefined;
|
|
@@ -108,11 +108,13 @@ $:
|
|
|
108
108
|
data-button-shadow={shadow}
|
|
109
109
|
data-button-rounded={rounded}
|
|
110
110
|
data-button-variant={variant}
|
|
111
|
+
on:focus
|
|
112
|
+
on:blur
|
|
111
113
|
on:click
|
|
112
114
|
on:change
|
|
113
115
|
on:keydown
|
|
114
116
|
on:keyup
|
|
115
|
-
on:touchstart
|
|
117
|
+
on:touchstart
|
|
116
118
|
on:touchend
|
|
117
119
|
on:touchcancel
|
|
118
120
|
on:mouseenter
|
|
@@ -131,11 +133,13 @@ $:
|
|
|
131
133
|
data-button-rounded={rounded}
|
|
132
134
|
data-button-variant={variant}
|
|
133
135
|
{...$$restProps}
|
|
136
|
+
on:focus
|
|
137
|
+
on:blur
|
|
134
138
|
on:click
|
|
135
139
|
on:change
|
|
136
140
|
on:keydown
|
|
137
141
|
on:keyup
|
|
138
|
-
on:touchstart
|
|
142
|
+
on:touchstart
|
|
139
143
|
on:touchend
|
|
140
144
|
on:touchcancel
|
|
141
145
|
on:mouseenter
|
|
@@ -4,7 +4,7 @@ export declare const createDrawerStore: (open?: boolean) => import("@marianmeres
|
|
|
4
4
|
declare const __propDef: {
|
|
5
5
|
props: {
|
|
6
6
|
drawer: import("@marianmeres/switch-store").SwitchStore<any>;
|
|
7
|
-
position?: "left" | "
|
|
7
|
+
position?: "left" | "right" | "top" | "bottom" | undefined;
|
|
8
8
|
class?: string | undefined;
|
|
9
9
|
backdropClass?: string | undefined;
|
|
10
10
|
labelledby?: string | undefined;
|
|
@@ -203,6 +203,18 @@ $:
|
|
|
203
203
|
? { ...(validate === true ? {} : validate), setValidationResult }
|
|
204
204
|
: undefined}
|
|
205
205
|
use:autogrow={{ allowed: textareaAutoEnlarge }}
|
|
206
|
+
on:blur
|
|
207
|
+
on:change
|
|
208
|
+
on:click
|
|
209
|
+
on:focus
|
|
210
|
+
on:input
|
|
211
|
+
on:keydown
|
|
212
|
+
on:keyup
|
|
213
|
+
on:touchstart
|
|
214
|
+
on:touchend
|
|
215
|
+
on:touchcancel
|
|
216
|
+
on:mouseenter
|
|
217
|
+
on:mouseleave
|
|
206
218
|
{...$$restProps}
|
|
207
219
|
/>
|
|
208
220
|
{:else}
|
|
@@ -231,6 +243,18 @@ $:
|
|
|
231
243
|
use:validateAction={validate
|
|
232
244
|
? { ...(validate === true ? {} : validate), setValidationResult }
|
|
233
245
|
: undefined}
|
|
246
|
+
on:blur
|
|
247
|
+
on:change
|
|
248
|
+
on:click
|
|
249
|
+
on:focus
|
|
250
|
+
on:input
|
|
251
|
+
on:keydown
|
|
252
|
+
on:keyup
|
|
253
|
+
on:touchstart
|
|
254
|
+
on:touchend
|
|
255
|
+
on:touchcancel
|
|
256
|
+
on:mouseenter
|
|
257
|
+
on:mouseleave
|
|
234
258
|
{...$$restProps}
|
|
235
259
|
/>
|
|
236
260
|
{/if}
|
|
@@ -57,6 +57,19 @@ declare const __propDef: {
|
|
|
57
57
|
showAsterixOnRequired?: boolean | undefined;
|
|
58
58
|
};
|
|
59
59
|
events: {
|
|
60
|
+
blur: FocusEvent;
|
|
61
|
+
change: Event;
|
|
62
|
+
click: MouseEvent;
|
|
63
|
+
focus: FocusEvent;
|
|
64
|
+
input: Event;
|
|
65
|
+
keydown: KeyboardEvent;
|
|
66
|
+
keyup: KeyboardEvent;
|
|
67
|
+
touchstart: TouchEvent;
|
|
68
|
+
touchend: TouchEvent;
|
|
69
|
+
touchcancel: TouchEvent;
|
|
70
|
+
mouseenter: MouseEvent;
|
|
71
|
+
mouseleave: MouseEvent;
|
|
72
|
+
} & {
|
|
60
73
|
[evt: string]: CustomEvent<any>;
|
|
61
74
|
};
|
|
62
75
|
slots: {
|
|
@@ -4,7 +4,6 @@ import { twMerge } from "tailwind-merge";
|
|
|
4
4
|
import Thc from "../Thc/Thc.svelte";
|
|
5
5
|
import X from "../X/X.svelte";
|
|
6
6
|
import { notificationsDefaultIcons } from "./notifications-icons.js";
|
|
7
|
-
import { disableScrollHandling } from "$app/navigation";
|
|
8
7
|
const X_POSITIONS = ["left", "center", "right"];
|
|
9
8
|
const Y_POSITIONS = ["top", "center", "bottom"];
|
|
10
9
|
const DEFAULT = {
|
|
@@ -89,6 +88,14 @@ export let posXMobile = DEFAULT.posXMobile;
|
|
|
89
88
|
export let posY = DEFAULT.posY;
|
|
90
89
|
export let posYMobile = DEFAULT.posYMobile;
|
|
91
90
|
let x, y, xMobile, yMobile;
|
|
91
|
+
export function getPositionConfig() {
|
|
92
|
+
return {
|
|
93
|
+
posX: x,
|
|
94
|
+
posY: y,
|
|
95
|
+
posXMobile: xMobile,
|
|
96
|
+
posYMobile: yMobile
|
|
97
|
+
};
|
|
98
|
+
}
|
|
92
99
|
$:
|
|
93
100
|
x = X_POSITIONS.includes(posX) ? posX : DEFAULT.posX;
|
|
94
101
|
$:
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import { SvelteComponent } from "svelte";
|
|
2
2
|
import type { NotificationKnownClasses, NotificationType, createNotificationsStore } from './notifications.js';
|
|
3
|
+
declare const X_POSITIONS: readonly ["left", "center", "right"];
|
|
4
|
+
declare const Y_POSITIONS: readonly ["top", "center", "bottom"];
|
|
5
|
+
type ArrayElement<T extends ReadonlyArray<unknown>> = T extends ReadonlyArray<infer ArrayElement> ? ArrayElement : never;
|
|
6
|
+
export type NOTIFICATIONS_POSX = ArrayElement<typeof X_POSITIONS>;
|
|
7
|
+
export type NOTIFICATIONS_POSY = ArrayElement<typeof Y_POSITIONS>;
|
|
3
8
|
export declare class NotificationsConfig {
|
|
4
9
|
static preset: {
|
|
5
10
|
wrap: string;
|
|
@@ -23,10 +28,16 @@ declare const __propDef: {
|
|
|
23
28
|
classes?: Partial<NotificationKnownClasses> | undefined;
|
|
24
29
|
classesByType?: Partial<Record<string, Partial<NotificationKnownClasses>>> | undefined;
|
|
25
30
|
ariaCloseLabel?: string | undefined;
|
|
26
|
-
posX?: "
|
|
27
|
-
posXMobile?: "
|
|
31
|
+
posX?: "left" | "center" | "right" | undefined;
|
|
32
|
+
posXMobile?: "left" | "center" | "right" | undefined;
|
|
28
33
|
posY?: "center" | "top" | "bottom" | undefined;
|
|
29
34
|
posYMobile?: "center" | "top" | "bottom" | undefined;
|
|
35
|
+
getPositionConfig?: (() => {
|
|
36
|
+
posX: "left" | "center" | "right";
|
|
37
|
+
posY: "center" | "top" | "bottom";
|
|
38
|
+
posXMobile: "left" | "center" | "right";
|
|
39
|
+
posYMobile: "center" | "top" | "bottom";
|
|
40
|
+
}) | undefined;
|
|
30
41
|
};
|
|
31
42
|
events: {
|
|
32
43
|
[evt: string]: CustomEvent<any>;
|
|
@@ -37,5 +48,11 @@ export type NotificationsProps = typeof __propDef.props;
|
|
|
37
48
|
export type NotificationsEvents = typeof __propDef.events;
|
|
38
49
|
export type NotificationsSlots = typeof __propDef.slots;
|
|
39
50
|
export default class Notifications extends SvelteComponent<NotificationsProps, NotificationsEvents, NotificationsSlots> {
|
|
51
|
+
get getPositionConfig(): () => {
|
|
52
|
+
posX: "left" | "center" | "right";
|
|
53
|
+
posY: "center" | "top" | "bottom";
|
|
54
|
+
posXMobile: "left" | "center" | "right";
|
|
55
|
+
posYMobile: "center" | "top" | "bottom";
|
|
56
|
+
};
|
|
40
57
|
}
|
|
41
58
|
export {};
|
package/dist/index.d.ts
CHANGED
|
@@ -16,7 +16,7 @@ export { default as FieldSelect, FieldSelectConfig, type FieldSelectConfigClasse
|
|
|
16
16
|
export { default as Fieldset, FieldsetConfig, type FieldsetConfigClasses, } from './components/Input/Fieldset.svelte';
|
|
17
17
|
export { default as ModalDialog, type ModalDialogAPI, } from './components/ModalDialog/ModalDialog.svelte';
|
|
18
18
|
export { createNotificationsStore, NOTIFICATION_EVENT, type NotiticationsCreateStoreOptions, type NotificationCreateParam, type Notification, type NotificationInput, type NotificationType, type NotificationOnEventHandler, type NotificationsSortOrder, type NotificationKnownClasses, } from './components/Notifications/notifications.js';
|
|
19
|
-
export { default as Notifications, NotificationsConfig, } from './components/Notifications/Notifications.svelte';
|
|
19
|
+
export { default as Notifications, NotificationsConfig, type NOTIFICATIONS_POSX, type NOTIFICATIONS_POSY, } from './components/Notifications/Notifications.svelte';
|
|
20
20
|
export { default as Popover } from './components/Popover/Popover.svelte';
|
|
21
21
|
export { default as Switch, SwitchConfig, type SwitchPreHook, } from './components/Switch/Switch.svelte';
|
|
22
22
|
export { default as Thc, type THC, isTHCNotEmpty } from './components/Thc/Thc.svelte';
|