podo-ui 1.0.0 → 1.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/cdn/podo-datepicker.css +1 -1
- package/cdn/podo-datepicker.js +1 -1
- package/cdn/podo-datepicker.min.css +1 -1
- package/cdn/podo-datepicker.min.js +1 -1
- package/cdn/podo-ui.css +4 -1
- package/cdn/podo-ui.min.css +1 -1
- package/dist/react/atom/editor.d.ts.map +1 -1
- package/dist/react/atom/editor.js +94 -2
- package/dist/svelte/atom/Avatar.svelte +3 -1
- package/dist/svelte/atom/Avatar.svelte.d.ts +2 -1
- package/dist/svelte/atom/Chip.svelte +3 -2
- package/dist/svelte/atom/Chip.svelte.d.ts +2 -1
- package/dist/svelte/atom/Editor.svelte +1314 -0
- package/dist/svelte/atom/Editor.svelte.d.ts +30 -0
- package/dist/svelte/atom/Radio.svelte +4 -2
- package/dist/svelte/atom/Tooltip.svelte +3 -1
- package/dist/svelte/atom/Tooltip.svelte.d.ts +2 -1
- package/dist/svelte/index.d.ts +2 -0
- package/dist/svelte/index.js +2 -0
- package/dist/svelte/molecule/DatePicker.svelte +986 -0
- package/dist/svelte/molecule/DatePicker.svelte.d.ts +71 -0
- package/dist/svelte/molecule/Field.svelte +5 -3
- package/dist/svelte/molecule/Field.svelte.d.ts +2 -1
- package/dist/svelte/molecule/Pagination.svelte +3 -2
- package/dist/svelte/molecule/Pagination.svelte.d.ts +2 -1
- package/dist/svelte/molecule/Tab.svelte +3 -2
- package/dist/svelte/molecule/Tab.svelte.d.ts +2 -1
- package/dist/svelte/molecule/Table.svelte +3 -2
- package/dist/svelte/molecule/Table.svelte.d.ts +1 -1
- package/dist/svelte/molecule/Toast.svelte +3 -2
- package/dist/svelte/molecule/Toast.svelte.d.ts +2 -1
- package/global.scss +1 -0
- package/package.json +1 -1
- package/vite-fonts.scss +1 -1
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
export type DatePickerMode = 'instant' | 'period';
|
|
2
|
+
export type DatePickerType = 'date' | 'time' | 'datetime';
|
|
3
|
+
export interface TimeValue {
|
|
4
|
+
hour: number;
|
|
5
|
+
minute: number;
|
|
6
|
+
}
|
|
7
|
+
export interface DatePickerValue {
|
|
8
|
+
date?: Date;
|
|
9
|
+
time?: TimeValue;
|
|
10
|
+
endDate?: Date;
|
|
11
|
+
endTime?: TimeValue;
|
|
12
|
+
}
|
|
13
|
+
export interface DateRange {
|
|
14
|
+
from: Date;
|
|
15
|
+
to: Date;
|
|
16
|
+
}
|
|
17
|
+
export type DateCondition = Date | DateRange | ((date: Date) => boolean);
|
|
18
|
+
export interface DateTimeLimit {
|
|
19
|
+
date: Date;
|
|
20
|
+
time?: TimeValue;
|
|
21
|
+
}
|
|
22
|
+
export type MinuteStep = 1 | 5 | 10 | 15 | 20 | 30;
|
|
23
|
+
export interface YearRange {
|
|
24
|
+
min?: number;
|
|
25
|
+
max?: number;
|
|
26
|
+
}
|
|
27
|
+
export type CalendarInitial = 'now' | 'prevMonth' | 'nextMonth' | Date;
|
|
28
|
+
export interface InitialCalendar {
|
|
29
|
+
start?: CalendarInitial;
|
|
30
|
+
end?: CalendarInitial;
|
|
31
|
+
}
|
|
32
|
+
interface Props {
|
|
33
|
+
/** Selection mode: instant | period */
|
|
34
|
+
mode?: DatePickerMode;
|
|
35
|
+
/** Value type: date | time | datetime */
|
|
36
|
+
type?: DatePickerType;
|
|
37
|
+
/** Selected value */
|
|
38
|
+
value?: DatePickerValue;
|
|
39
|
+
/** Value change handler */
|
|
40
|
+
onchange?: (value: DatePickerValue) => void;
|
|
41
|
+
/** Placeholder */
|
|
42
|
+
placeholder?: string;
|
|
43
|
+
/** Disabled state */
|
|
44
|
+
disabled?: boolean;
|
|
45
|
+
/** Show action buttons (default true for period mode) */
|
|
46
|
+
showActions?: boolean;
|
|
47
|
+
/** Dropdown alignment */
|
|
48
|
+
align?: 'left' | 'right';
|
|
49
|
+
/** Additional class name */
|
|
50
|
+
class?: string;
|
|
51
|
+
/** Disabled date conditions */
|
|
52
|
+
disable?: DateCondition[];
|
|
53
|
+
/** Enabled date conditions (only these dates are selectable) */
|
|
54
|
+
enable?: DateCondition[];
|
|
55
|
+
/** Minimum selectable date */
|
|
56
|
+
minDate?: Date | DateTimeLimit;
|
|
57
|
+
/** Maximum selectable date */
|
|
58
|
+
maxDate?: Date | DateTimeLimit;
|
|
59
|
+
/** Minute selection step */
|
|
60
|
+
minuteStep?: MinuteStep;
|
|
61
|
+
/** Date/time format pattern */
|
|
62
|
+
format?: string;
|
|
63
|
+
/** Initial calendar display month for period mode */
|
|
64
|
+
initialCalendar?: InitialCalendar;
|
|
65
|
+
/** Year selection range */
|
|
66
|
+
yearRange?: YearRange;
|
|
67
|
+
}
|
|
68
|
+
type $$ComponentProps = Props & Record<string, unknown>;
|
|
69
|
+
declare const DatePicker: import("svelte").Component<$$ComponentProps, {}, "value">;
|
|
70
|
+
type DatePicker = ReturnType<typeof DatePicker>;
|
|
71
|
+
export default DatePicker;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import type { Snippet } from 'svelte';
|
|
3
3
|
import type { z } from 'zod';
|
|
4
|
+
import { ZodError } from 'zod';
|
|
4
5
|
import styles from './field.module.scss';
|
|
5
6
|
|
|
6
7
|
interface Props {
|
|
@@ -34,7 +35,8 @@
|
|
|
34
35
|
validator,
|
|
35
36
|
value = '',
|
|
36
37
|
class: className = '',
|
|
37
|
-
|
|
38
|
+
...rest
|
|
39
|
+
}: Props & Record<string, unknown> = $props();
|
|
38
40
|
|
|
39
41
|
let message = $state('');
|
|
40
42
|
let statusClass = $state('');
|
|
@@ -48,7 +50,7 @@
|
|
|
48
50
|
validator.parse(value);
|
|
49
51
|
statusClass = 'success';
|
|
50
52
|
} catch (e) {
|
|
51
|
-
if (e instanceof
|
|
53
|
+
if (e instanceof ZodError) {
|
|
52
54
|
message = e.errors[0].message;
|
|
53
55
|
statusClass = 'danger';
|
|
54
56
|
}
|
|
@@ -57,7 +59,7 @@
|
|
|
57
59
|
});
|
|
58
60
|
</script>
|
|
59
61
|
|
|
60
|
-
<div class="{styles.style} {className}">
|
|
62
|
+
<div class="{styles.style} {className}" {...rest}>
|
|
61
63
|
{#if label}
|
|
62
64
|
<label class={labelClass}>
|
|
63
65
|
{label}
|
|
@@ -20,6 +20,7 @@ interface Props {
|
|
|
20
20
|
/** Additional class name */
|
|
21
21
|
class?: string;
|
|
22
22
|
}
|
|
23
|
-
|
|
23
|
+
type $$ComponentProps = Props & Record<string, unknown>;
|
|
24
|
+
declare const Field: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
24
25
|
type Field = ReturnType<typeof Field>;
|
|
25
26
|
export default Field;
|
|
@@ -17,7 +17,8 @@
|
|
|
17
17
|
totalPages,
|
|
18
18
|
onpagechange,
|
|
19
19
|
maxVisiblePages = 5,
|
|
20
|
-
|
|
20
|
+
...rest
|
|
21
|
+
}: Props & Record<string, unknown> = $props();
|
|
21
22
|
|
|
22
23
|
function getPageNumbers(): number[] {
|
|
23
24
|
const pages: number[] = [];
|
|
@@ -55,7 +56,7 @@
|
|
|
55
56
|
</script>
|
|
56
57
|
|
|
57
58
|
{#if totalPages > 0}
|
|
58
|
-
<div class={styles.pagination}>
|
|
59
|
+
<div class={styles.pagination} {...rest}>
|
|
59
60
|
{#if currentPage > 1}
|
|
60
61
|
<button
|
|
61
62
|
onclick={handlePrevious}
|
|
@@ -8,6 +8,7 @@ interface Props {
|
|
|
8
8
|
/** Maximum visible page numbers */
|
|
9
9
|
maxVisiblePages?: number;
|
|
10
10
|
}
|
|
11
|
-
|
|
11
|
+
type $$ComponentProps = Props & Record<string, unknown>;
|
|
12
|
+
declare const Pagination: import("svelte").Component<$$ComponentProps, {}, "currentPage">;
|
|
12
13
|
type Pagination = ReturnType<typeof Pagination>;
|
|
13
14
|
export default Pagination;
|
|
@@ -32,7 +32,8 @@
|
|
|
32
32
|
fill = false,
|
|
33
33
|
onchange,
|
|
34
34
|
class: className = '',
|
|
35
|
-
|
|
35
|
+
...rest
|
|
36
|
+
}: Props & Record<string, unknown> = $props();
|
|
36
37
|
|
|
37
38
|
let internalActiveKey = $state(defaultActiveKey || items[0]?.key);
|
|
38
39
|
|
|
@@ -49,7 +50,7 @@
|
|
|
49
50
|
);
|
|
50
51
|
</script>
|
|
51
52
|
|
|
52
|
-
<ul class={tabsClass}>
|
|
53
|
+
<ul class={tabsClass} {...rest}>
|
|
53
54
|
{#each items as item (item.key)}
|
|
54
55
|
<li class={activeKey === item.key ? 'on' : undefined}>
|
|
55
56
|
<a
|
|
@@ -20,6 +20,7 @@ interface Props {
|
|
|
20
20
|
/** Additional class name */
|
|
21
21
|
class?: string;
|
|
22
22
|
}
|
|
23
|
-
|
|
23
|
+
type $$ComponentProps = Props & Record<string, unknown>;
|
|
24
|
+
declare const Tab: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
24
25
|
type Tab = ReturnType<typeof Tab>;
|
|
25
26
|
export default Tab;
|
|
@@ -44,7 +44,8 @@
|
|
|
44
44
|
fill = false,
|
|
45
45
|
onrowclick,
|
|
46
46
|
class: className = '',
|
|
47
|
-
|
|
47
|
+
...rest
|
|
48
|
+
}: Props & Record<string, unknown> = $props();
|
|
48
49
|
|
|
49
50
|
function getRowKey(record: T, index: number): string {
|
|
50
51
|
if (typeof rowKey === 'function') {
|
|
@@ -71,7 +72,7 @@
|
|
|
71
72
|
);
|
|
72
73
|
</script>
|
|
73
74
|
|
|
74
|
-
<table class={tableClass || undefined}>
|
|
75
|
+
<table class={tableClass || undefined} {...rest}>
|
|
75
76
|
<thead>
|
|
76
77
|
<tr>
|
|
77
78
|
{#each columns as col (col.key)}
|
|
@@ -35,7 +35,8 @@
|
|
|
35
35
|
duration = 3000,
|
|
36
36
|
width,
|
|
37
37
|
onclose,
|
|
38
|
-
|
|
38
|
+
...rest
|
|
39
|
+
}: Props & Record<string, unknown> = $props();
|
|
39
40
|
|
|
40
41
|
let isVisible = $state(false);
|
|
41
42
|
let isClosing = $state(false);
|
|
@@ -98,7 +99,7 @@
|
|
|
98
99
|
}
|
|
99
100
|
</script>
|
|
100
101
|
|
|
101
|
-
<div class={toastClasses} style={toastStyle}>
|
|
102
|
+
<div class={toastClasses} style={toastStyle} {...rest}>
|
|
102
103
|
<i class={getIcon()}></i>
|
|
103
104
|
<div class="toast-content">
|
|
104
105
|
{#if header && !long}
|
|
@@ -19,6 +19,7 @@ interface Props {
|
|
|
19
19
|
/** Close callback */
|
|
20
20
|
onclose: (id: string) => void;
|
|
21
21
|
}
|
|
22
|
-
|
|
22
|
+
type $$ComponentProps = Props & Record<string, unknown>;
|
|
23
|
+
declare const Toast: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
23
24
|
type Toast = ReturnType<typeof Toast>;
|
|
24
25
|
export default Toast;
|
package/global.scss
CHANGED
package/package.json
CHANGED