@14ch/svelte-ui 0.0.13 → 0.0.15
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/assets/styles/variables.scss +3 -7
- package/dist/components/Button.svelte +31 -5
- package/dist/components/Button.svelte.d.ts +5 -3
- package/dist/components/Checkbox.svelte +4 -4
- package/dist/components/Checkbox.svelte.d.ts +1 -1
- package/dist/components/CheckboxGroup.svelte +6 -3
- package/dist/components/CheckboxGroup.svelte.d.ts +1 -1
- package/dist/components/ColorPicker.svelte +18 -10
- package/dist/components/ColorPicker.svelte.d.ts +4 -4
- package/dist/components/Combobox.svelte +28 -8
- package/dist/components/Combobox.svelte.d.ts +1 -1
- package/dist/components/ConfirmDialog.svelte +3 -7
- package/dist/components/ConfirmDialog.svelte.d.ts +1 -1
- package/dist/components/Datepicker.svelte +88 -24
- package/dist/components/Datepicker.svelte.d.ts +4 -3
- package/dist/components/DatepickerCalendar.svelte +1 -1
- package/dist/components/DatepickerCalendar.svelte.d.ts +1 -1
- package/dist/components/Drawer.svelte +8 -4
- package/dist/components/Drawer.svelte.d.ts +1 -1
- package/dist/components/Fab.svelte +28 -11
- package/dist/components/Fab.svelte.d.ts +8 -4
- package/dist/components/FileUploader.svelte +1 -1
- package/dist/components/FileUploader.svelte.d.ts +1 -1
- package/dist/components/Icon.svelte +20 -24
- package/dist/components/Icon.svelte.d.ts +1 -1
- package/dist/components/IconButton.svelte +4 -3
- package/dist/components/IconButton.svelte.d.ts +4 -3
- package/dist/components/ImageUploader.svelte +1 -1
- package/dist/components/ImageUploader.svelte.d.ts +1 -1
- package/dist/components/Input.svelte +110 -99
- package/dist/components/Input.svelte.d.ts +5 -3
- package/dist/components/Popup.svelte +69 -82
- package/dist/components/Popup.svelte.d.ts +3 -3
- package/dist/components/PopupMenu.svelte +40 -56
- package/dist/components/PopupMenu.svelte.d.ts +3 -3
- package/dist/components/PopupMenuButton.svelte +10 -23
- package/dist/components/PopupMenuButton.svelte.d.ts +5 -4
- package/dist/components/Radio.svelte +3 -2
- package/dist/components/Radio.svelte.d.ts +1 -1
- package/dist/components/RadioGroup.svelte +1 -1
- package/dist/components/RadioGroup.svelte.d.ts +1 -1
- package/dist/components/SegmentedControl.svelte +4 -5
- package/dist/components/SegmentedControl.svelte.d.ts +1 -1
- package/dist/components/Select.svelte +2 -2
- package/dist/components/Select.svelte.d.ts +1 -1
- package/dist/components/Slider.svelte +2 -3
- package/dist/components/Slider.svelte.d.ts +1 -1
- package/dist/components/Snackbar.svelte +3 -2
- package/dist/components/Snackbar.svelte.d.ts +3 -2
- package/dist/components/SnackbarItem.svelte +4 -3
- package/dist/components/SnackbarItem.svelte.d.ts +4 -3
- package/dist/components/Switch.svelte +2 -4
- package/dist/components/Switch.svelte.d.ts +1 -1
- package/dist/components/Tab.svelte +1 -0
- package/dist/components/TabItem.svelte +24 -3
- package/dist/components/TabItem.svelte.d.ts +1 -0
- package/dist/components/Textarea.svelte +74 -38
- package/dist/components/Textarea.svelte.d.ts +4 -3
- package/dist/components/skeleton/SkeletonAvatar.svelte +22 -32
- package/dist/components/skeleton/SkeletonAvatar.svelte.d.ts +6 -2
- package/dist/components/skeleton/SkeletonButton.svelte +18 -16
- package/dist/components/skeleton/SkeletonButton.svelte.d.ts +5 -2
- package/dist/components/skeleton/SkeletonHeading.svelte +15 -18
- package/dist/components/skeleton/SkeletonHeading.svelte.d.ts +3 -2
- package/dist/components/skeleton/SkeletonMedia.svelte +29 -41
- package/dist/components/skeleton/SkeletonMedia.svelte.d.ts +8 -2
- package/dist/components/skeleton/SkeletonText.svelte +12 -14
- package/dist/components/skeleton/SkeletonText.svelte.d.ts +4 -2
- package/dist/i18n/index.d.ts +143 -6
- package/dist/i18n/index.js +18 -40
- package/dist/i18n/locales/de.d.ts +35 -0
- package/dist/i18n/locales/de.js +35 -0
- package/dist/i18n/locales/es.d.ts +35 -0
- package/dist/i18n/locales/es.js +35 -0
- package/dist/i18n/locales/fr.d.ts +35 -0
- package/dist/i18n/locales/fr.js +35 -0
- package/dist/i18n/locales/zh-cn.d.ts +35 -0
- package/dist/i18n/locales/zh-cn.js +35 -0
- package/dist/index.d.ts +5 -2
- package/dist/index.js +1 -0
- package/dist/types/menuItem.d.ts +1 -1
- package/dist/types/propOptions.d.ts +54 -0
- package/dist/types/propOptions.js +5 -0
- package/dist/utils/formatText.d.ts +2 -2
- package/dist/utils/formatText.js +2 -2
- package/dist/utils/popupManager.d.ts +26 -0
- package/dist/utils/popupManager.js +34 -0
- package/package.json +1 -1
- /package/dist/types/{eventHandlers.d.ts → callbackHandlers.d.ts} +0 -0
- /package/dist/types/{eventHandlers.js → callbackHandlers.js} +0 -0
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Common component prop types
|
|
3
|
+
* Exported types for component props with fixed string literal unions
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Popup position type
|
|
7
|
+
* Used by Popup, PopupMenu, PopupMenuButton components
|
|
8
|
+
*/
|
|
9
|
+
export type PopupPosition = 'top' | 'bottom' | 'left' | 'right' | 'top-left' | 'top-center' | 'top-right' | 'bottom-left' | 'bottom-center' | 'bottom-right' | 'left-top' | 'left-center' | 'left-bottom' | 'right-top' | 'right-center' | 'right-bottom' | 'auto';
|
|
10
|
+
/**
|
|
11
|
+
* Snackbar position type (top/bottom)
|
|
12
|
+
* Used by Snackbar, SnackbarItem components
|
|
13
|
+
*/
|
|
14
|
+
export type SnackbarPosition = 'top' | 'bottom';
|
|
15
|
+
/**
|
|
16
|
+
* Fab position type (left/center/right)
|
|
17
|
+
* Used by Fab component
|
|
18
|
+
*/
|
|
19
|
+
export type FabPosition = 'left' | 'center' | 'right';
|
|
20
|
+
/**
|
|
21
|
+
* Button variant type
|
|
22
|
+
* Used by Button, IconButton, Fab components
|
|
23
|
+
*/
|
|
24
|
+
export type ButtonVariant = 'ghost' | 'filled' | 'outlined' | 'glass';
|
|
25
|
+
/**
|
|
26
|
+
* Button size type
|
|
27
|
+
* Used by Button component
|
|
28
|
+
*/
|
|
29
|
+
export type ButtonSize = 'small' | 'medium' | 'large';
|
|
30
|
+
/**
|
|
31
|
+
* Snackbar type
|
|
32
|
+
* Used by SnackbarItem component
|
|
33
|
+
*/
|
|
34
|
+
export type SnackbarType = 'info' | 'success' | 'warning' | 'error' | 'default';
|
|
35
|
+
/**
|
|
36
|
+
* Snackbar variant type
|
|
37
|
+
* Used by SnackbarItem component
|
|
38
|
+
*/
|
|
39
|
+
export type SnackbarVariant = 'filled' | 'outlined';
|
|
40
|
+
/**
|
|
41
|
+
* Badge variant type
|
|
42
|
+
* Used by IconButton component
|
|
43
|
+
*/
|
|
44
|
+
export type BadgeVariant = 'dot' | 'count';
|
|
45
|
+
/**
|
|
46
|
+
* Datepicker mode type
|
|
47
|
+
* Used by Datepicker component
|
|
48
|
+
*/
|
|
49
|
+
export type DatepickerMode = 'single' | 'range';
|
|
50
|
+
/**
|
|
51
|
+
* Focus style type
|
|
52
|
+
* Used by Input, Textarea, Datepicker components
|
|
53
|
+
*/
|
|
54
|
+
export type FocusStyle = 'background' | 'outline' | 'none';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const convertToHtml: (value: string | number
|
|
1
|
+
export declare const convertToHtml: (value: string | number) => string;
|
|
2
2
|
export declare const convertToLink: (str: string) => string;
|
|
3
3
|
export declare const escapeHtml: (value: string) => string;
|
|
4
|
-
export declare const convertToHtmlWithLink: (value: string | number
|
|
4
|
+
export declare const convertToHtmlWithLink: (value: string | number) => string;
|
package/dist/utils/formatText.js
CHANGED
|
@@ -13,7 +13,7 @@ export const convertToHtml = (value) => {
|
|
|
13
13
|
return html;
|
|
14
14
|
}
|
|
15
15
|
else {
|
|
16
|
-
return value;
|
|
16
|
+
return String(value);
|
|
17
17
|
}
|
|
18
18
|
};
|
|
19
19
|
export const convertToLink = (str) => {
|
|
@@ -42,6 +42,6 @@ export const convertToHtmlWithLink = (value) => {
|
|
|
42
42
|
return htmlWithLink;
|
|
43
43
|
}
|
|
44
44
|
else {
|
|
45
|
-
return value;
|
|
45
|
+
return String(value);
|
|
46
46
|
}
|
|
47
47
|
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Popup Manager
|
|
3
|
+
* Manages global state for Popup components to ensure only one popup is open at a time.
|
|
4
|
+
*/
|
|
5
|
+
type PopupCloseFunction = () => void;
|
|
6
|
+
declare class PopupManager {
|
|
7
|
+
private openPopups;
|
|
8
|
+
/**
|
|
9
|
+
* Register a popup's close function
|
|
10
|
+
*/
|
|
11
|
+
register(closeFunction: PopupCloseFunction): void;
|
|
12
|
+
/**
|
|
13
|
+
* Unregister a popup's close function
|
|
14
|
+
*/
|
|
15
|
+
unregister(closeFunction: PopupCloseFunction): void;
|
|
16
|
+
/**
|
|
17
|
+
* Close all other popups except the specified one
|
|
18
|
+
*/
|
|
19
|
+
closeOthers(except: PopupCloseFunction): void;
|
|
20
|
+
/**
|
|
21
|
+
* Get the number of currently open popups
|
|
22
|
+
*/
|
|
23
|
+
getOpenCount(): number;
|
|
24
|
+
}
|
|
25
|
+
export declare const popupManager: PopupManager;
|
|
26
|
+
export {};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Popup Manager
|
|
3
|
+
* Manages global state for Popup components to ensure only one popup is open at a time.
|
|
4
|
+
*/
|
|
5
|
+
class PopupManager {
|
|
6
|
+
openPopups = new Set();
|
|
7
|
+
/**
|
|
8
|
+
* Register a popup's close function
|
|
9
|
+
*/
|
|
10
|
+
register(closeFunction) {
|
|
11
|
+
this.openPopups.add(closeFunction);
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Unregister a popup's close function
|
|
15
|
+
*/
|
|
16
|
+
unregister(closeFunction) {
|
|
17
|
+
this.openPopups.delete(closeFunction);
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Close all other popups except the specified one
|
|
21
|
+
*/
|
|
22
|
+
closeOthers(except) {
|
|
23
|
+
const others = Array.from(this.openPopups).filter((closeHandler) => closeHandler !== except);
|
|
24
|
+
others.forEach((closeHandler) => closeHandler());
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Get the number of currently open popups
|
|
28
|
+
*/
|
|
29
|
+
getOpenCount() {
|
|
30
|
+
return this.openPopups.size;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
// Global instance
|
|
34
|
+
export const popupManager = new PopupManager();
|
package/package.json
CHANGED
|
File without changes
|
|
File without changes
|