@softwareone/spi-sv5-library 0.0.1 → 0.0.2
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/Button/Button.svelte +1 -0
- package/dist/Modal/Modal.svelte +19 -22
- package/dist/Modal/Modal.svelte.d.ts +9 -8
- package/dist/Modal/ModalContent.svelte +15 -1
- package/dist/Modal/ModalContent.svelte.d.ts +6 -5
- package/dist/Modal/ModalFooter.svelte +6 -1
- package/dist/Modal/ModalFooter.svelte.d.ts +5 -4
- package/dist/Modal/ModalHeader.svelte +8 -2
- package/dist/Modal/ModalHeader.svelte.d.ts +4 -3
- package/package.json +2 -1
package/dist/Modal/Modal.svelte
CHANGED
|
@@ -3,33 +3,30 @@
|
|
|
3
3
|
import ModalFooter from './ModalFooter.svelte';
|
|
4
4
|
import ModalHeader from './ModalHeader.svelte';
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
interface ModalProps {
|
|
7
|
+
headerTitle?: string;
|
|
8
|
+
contentTitle?: string;
|
|
9
|
+
contentMessage?: string;
|
|
10
|
+
contentCodeMessage?: string;
|
|
11
|
+
cancelButton?: () => void;
|
|
12
|
+
okButton?: () => void;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
let {
|
|
16
|
+
headerTitle,
|
|
17
|
+
contentTitle,
|
|
18
|
+
contentMessage,
|
|
19
|
+
contentCodeMessage,
|
|
20
|
+
cancelButton,
|
|
21
|
+
okButton
|
|
22
|
+
}: ModalProps = $props();
|
|
8
23
|
|
|
9
|
-
headerTitle = headerTitle || 'Modal title';
|
|
10
|
-
contentTitle = contentTitle || 'Error title';
|
|
11
|
-
contentMessage =
|
|
12
|
-
contentMessage ||
|
|
13
|
-
'The text displayed here serves as a placeholder for the error modal content.';
|
|
14
|
-
contentCodeMessage =
|
|
15
|
-
contentCodeMessage ||
|
|
16
|
-
`Placeholder error code:# Handle specific error: invalid value error_message = f"Error: Invalid value - {ve}" return {'error': error_message, 'error_code': 400}`;
|
|
17
|
-
cancelButton =
|
|
18
|
-
cancelButton ||
|
|
19
|
-
function () {
|
|
20
|
-
console.log('cancelButton');
|
|
21
|
-
};
|
|
22
|
-
okButton =
|
|
23
|
-
okButton ||
|
|
24
|
-
function () {
|
|
25
|
-
console.log('okButton');
|
|
26
|
-
};
|
|
27
24
|
</script>
|
|
28
25
|
|
|
29
26
|
<div class="modal">
|
|
30
|
-
<ModalHeader {headerTitle}
|
|
27
|
+
<ModalHeader {headerTitle}/>
|
|
31
28
|
<ModalContent {contentTitle} {contentMessage} {contentCodeMessage} />
|
|
32
|
-
<ModalFooter {cancelButton} {okButton}
|
|
29
|
+
<ModalFooter {cancelButton} {okButton}/>
|
|
33
30
|
</div>
|
|
34
31
|
|
|
35
32
|
<style>
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
headerTitle
|
|
3
|
-
contentTitle
|
|
4
|
-
contentMessage
|
|
5
|
-
contentCodeMessage
|
|
6
|
-
cancelButton
|
|
7
|
-
okButton
|
|
8
|
-
}
|
|
1
|
+
interface ModalProps {
|
|
2
|
+
headerTitle?: string;
|
|
3
|
+
contentTitle?: string;
|
|
4
|
+
contentMessage?: string;
|
|
5
|
+
contentCodeMessage?: string;
|
|
6
|
+
cancelButton?: () => void;
|
|
7
|
+
okButton?: () => void;
|
|
8
|
+
}
|
|
9
|
+
declare const Modal: import("svelte").Component<ModalProps, {}, "">;
|
|
9
10
|
type Modal = ReturnType<typeof Modal>;
|
|
10
11
|
export default Modal;
|
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { Copy, Check } from 'lucide-svelte'
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
interface ModalContentProps {
|
|
5
|
+
contentTitle?: string;
|
|
6
|
+
contentMessage?: string;
|
|
7
|
+
contentCodeMessage?: string;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
let { contentTitle, contentMessage, contentCodeMessage }: ModalContentProps = $props();
|
|
5
11
|
|
|
6
12
|
let copyCodeContent = $state(contentCodeMessage);
|
|
7
13
|
let copyCodeState = $state(false);
|
|
@@ -10,6 +16,14 @@
|
|
|
10
16
|
navigator.clipboard.writeText(copyCodeContent);
|
|
11
17
|
copyCodeState = true;
|
|
12
18
|
}
|
|
19
|
+
|
|
20
|
+
contentTitle = contentTitle || 'Error title';
|
|
21
|
+
contentMessage =
|
|
22
|
+
contentMessage ||
|
|
23
|
+
'The text displayed here serves as a placeholder for the error modal content.';
|
|
24
|
+
contentCodeMessage =
|
|
25
|
+
contentCodeMessage ||
|
|
26
|
+
`Placeholder error code:# Handle specific error: invalid value error_message = f"Error: Invalid value - {ve}" return {'error': error_message, 'error_code': 400}`;
|
|
13
27
|
</script>
|
|
14
28
|
|
|
15
29
|
<div class="modal-content">
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
contentTitle
|
|
3
|
-
contentMessage
|
|
4
|
-
contentCodeMessage
|
|
5
|
-
}
|
|
1
|
+
interface ModalContentProps {
|
|
2
|
+
contentTitle?: string;
|
|
3
|
+
contentMessage?: string;
|
|
4
|
+
contentCodeMessage?: string;
|
|
5
|
+
}
|
|
6
|
+
declare const ModalContent: import("svelte").Component<ModalContentProps, {}, "">;
|
|
6
7
|
type ModalContent = ReturnType<typeof ModalContent>;
|
|
7
8
|
export default ModalContent;
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
+
|
|
3
|
+
interface ModalFooterProps {
|
|
4
|
+
cancelButton?: () => void;
|
|
5
|
+
okButton?: () => void;
|
|
6
|
+
}
|
|
2
7
|
|
|
3
|
-
let { cancelButton, okButton } = $props();
|
|
8
|
+
let { cancelButton, okButton }: ModalFooterProps = $props();
|
|
4
9
|
|
|
5
10
|
cancelButton =
|
|
6
11
|
cancelButton ||
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
cancelButton
|
|
3
|
-
okButton
|
|
4
|
-
}
|
|
1
|
+
interface ModalFooterProps {
|
|
2
|
+
cancelButton?: () => void;
|
|
3
|
+
okButton?: () => void;
|
|
4
|
+
}
|
|
5
|
+
declare const ModalFooter: import("svelte").Component<ModalFooterProps, {}, "">;
|
|
5
6
|
type ModalFooter = ReturnType<typeof ModalFooter>;
|
|
6
7
|
export default ModalFooter;
|
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import { OctagonAlert } from
|
|
2
|
+
import { OctagonAlert } from 'lucide-svelte';
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
interface ModalHeaderProps {
|
|
5
|
+
headerTitle?: string;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
let { headerTitle }: ModalHeaderProps = $props();
|
|
9
|
+
|
|
10
|
+
headerTitle = headerTitle || 'Modal title';
|
|
5
11
|
|
|
6
12
|
</script>
|
|
7
13
|
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
headerTitle
|
|
3
|
-
}
|
|
1
|
+
interface ModalHeaderProps {
|
|
2
|
+
headerTitle?: string;
|
|
3
|
+
}
|
|
4
|
+
declare const ModalHeader: import("svelte").Component<ModalHeaderProps, {}, "">;
|
|
4
5
|
type ModalHeader = ReturnType<typeof ModalHeader>;
|
|
5
6
|
export default ModalHeader;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@softwareone/spi-sv5-library",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.2",
|
|
4
4
|
"description": "Svelte components",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"svelte",
|
|
@@ -45,6 +45,7 @@
|
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
47
|
"@sveltejs/adapter-auto": "^4.0.0",
|
|
48
|
+
"@sveltejs/adapter-node": "^5.2.12",
|
|
48
49
|
"@sveltejs/kit": "^2.16.0",
|
|
49
50
|
"@sveltejs/package": "^2.0.0",
|
|
50
51
|
"@sveltejs/vite-plugin-svelte": "^5.0.0",
|