mirror of
				https://github.com/siyuan-note/plugin-sample-vite-svelte.git
				synced 2025-11-03 21:30:51 +00:00 
			
		
		
		
	✨ feat: Add input number element in setting-utils
This commit is contained in:
		
							parent
							
								
									50a2286d43
								
							
						
					
					
						commit
						c179519f95
					
				
					 2 changed files with 9 additions and 2 deletions
				
			
		
							
								
								
									
										2
									
								
								src/libs/index.d.ts
									
										
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								src/libs/index.d.ts
									
										
									
									
										vendored
									
									
								
							| 
						 | 
					@ -1,4 +1,4 @@
 | 
				
			||||||
type TSettingItemType = "checkbox" | "select" | "textinput" | "textarea" | "slider" | "button";
 | 
					type TSettingItemType = "checkbox" | "select" | "textinput" | "textarea" | "number" | "slider" | "button";
 | 
				
			||||||
interface ISettingItem {
 | 
					interface ISettingItem {
 | 
				
			||||||
    key: string;
 | 
					    key: string;
 | 
				
			||||||
    value: any;
 | 
					    value: any;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -3,7 +3,7 @@
 | 
				
			||||||
 * @Author       : frostime
 | 
					 * @Author       : frostime
 | 
				
			||||||
 * @Date         : 2023-09-16 18:05:00
 | 
					 * @Date         : 2023-09-16 18:05:00
 | 
				
			||||||
 * @FilePath     : /src/libs/setting-utils.ts
 | 
					 * @FilePath     : /src/libs/setting-utils.ts
 | 
				
			||||||
 * @LastEditTime : 2023-11-28 21:46:29
 | 
					 * @LastEditTime : 2023-12-28 18:10:12
 | 
				
			||||||
 * @Description  : A utility for siyuan plugin settings
 | 
					 * @Description  : A utility for siyuan plugin settings
 | 
				
			||||||
 */
 | 
					 */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -130,6 +130,13 @@ export class SettingUtils {
 | 
				
			||||||
                textareaElement.value = item.value;
 | 
					                textareaElement.value = item.value;
 | 
				
			||||||
                itemElement = textareaElement;
 | 
					                itemElement = textareaElement;
 | 
				
			||||||
                break;
 | 
					                break;
 | 
				
			||||||
 | 
					            case 'number':
 | 
				
			||||||
 | 
					                let numberElement: HTMLInputElement = document.createElement('input');
 | 
				
			||||||
 | 
					                numberElement.type = 'number';
 | 
				
			||||||
 | 
					                numberElement.className = 'b3-text-field fn__flex-center fn__size200';
 | 
				
			||||||
 | 
					                numberElement.value = item.value;
 | 
				
			||||||
 | 
					                itemElement = numberElement;
 | 
				
			||||||
 | 
					                break;
 | 
				
			||||||
            case 'button':
 | 
					            case 'button':
 | 
				
			||||||
                let buttonElement: HTMLButtonElement = document.createElement('button');
 | 
					                let buttonElement: HTMLButtonElement = document.createElement('button');
 | 
				
			||||||
                buttonElement.className = "b3-button b3-button--outline fn__flex-center fn__size200";
 | 
					                buttonElement.className = "b3-button b3-button--outline fn__flex-center fn__size200";
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue