### Create New Project using CLI Source: https://context7.com/may529/kqdoc/llms.txt Installs and bootstraps a new application using the command-line interface. It prompts the user to select the project type (e.g., Admin) and then starts the development server. ```bash # Create a new admin application yarn create kqinfo-app my-app # Select project type when prompted > Admin # Start development server cd my-app && yarn start ``` -------------------------------- ### Install kqui and Configure Babel for Tree Shaking and Theming Source: https://context7.com/may529/kqdoc/llms.txt Installs the kqui UI library and the babel-plugin-import for on-demand component loading and theme customization. The babel configuration enables tree-shaking for efficient bundle sizes. ```bash # Install the library yarn add @kqinfo/ui # Install babel plugin for on-demand loading yarn add babel-plugin-import -D ``` ```javascript // babel.config.js - Configure on-demand loading module.exports = { plugins: [ [ 'import', { libraryDirectory: 'es', libraryName: '@kqinfo/ui' }, '@kqinfo/ui' ] ] }; // app.tsx - Configure theme colors import { ConfigProvider } from '@kqinfo/ui'; const App = (props) => { return ( {props.children} ); }; ``` -------------------------------- ### Business Logic Utilities (JavaScript) Source: https://github.com/may529/kqdoc/blob/main/kqui/llms.txt Utility functions that encapsulate specific business logic. Includes AES encryption/decryption, form validation rules, getting address options, creating animations, and converting pixel units to responsive units (rpx). These help maintain consistent business rules across the application. ```JavaScript import { AES } from '@kq-ui/utils/business/a-e-s'; import { formRules } from '@kq-ui/utils/business/form-rules'; import { getAddressOptions } from '@kq-ui/utils/business/get-address-options'; import { createAnimation } from '@kq-ui/utils/business/create-animation'; import { pxToRpx } from '@kq-ui/utils/business/px-to-rpx'; import { switchVariable } from '@kq-ui/utils/business/switch-variable'; // Example usage: const encrypted = AES.encrypt('sensitive data', 'key'); const decrypted = AES.decrypt(encrypted, 'key'); const rules = formRules.email; const addressData = getAddressOptions(); const animation = createAnimation().opacity(0.5).step(); const rpxValue = pxToRpx(100); const switchResult = switchVariable('option1', { option1: 'Result A', option2: 'Result B' }); ``` -------------------------------- ### Local Storage Operations (JavaScript) Source: https://github.com/may529/kqdoc/blob/main/kqui/llms.txt Provides functions for synchronous operations on local storage. Includes methods to get, set, remove, and clear data. These functions are essential for managing user data and application state locally. ```JavaScript import { getStorageSync, setStorageSync, removeStorageSync, clearStorageSync } from '@kq-ui/utils/one/storage-sync'; // Example usage: const data = getStorageSync('user_info'); setStorageSync('theme', 'dark'); removeStorageSync('session_id'); clearStorageSync(); ``` -------------------------------- ### Get Current Page Information Source: https://github.com/may529/kqdoc/blob/main/kqui/llms.txt The getCurrentPage function retrieves information about the current browser page. This utility is likely used to access route parameters, query strings, or other navigational details. It has no explicit dependencies beyond the browser environment. ```javascript import { getCurrentPage } from 'kq-ui/utils/one/get-current-page'; const pageInfo = getCurrentPage(); console.log(pageInfo); // e.g., { path: '/users/123', query: { sort: 'asc' } } ``` -------------------------------- ### Platform and Version Information (JavaScript) Source: https://github.com/may529/kqdoc/blob/main/kqui/llms.txt Provides utilities to retrieve information about the current platform and application version. Functions like `getPlatform`, `getVersion`, and `getAccountInfoSync` are useful for analytics, feature flagging, and debugging. ```JavaScript import { getPlatform, getVersion, getAccountInfoSync } from '@kq-ui/utils/business/info-utils'; // Example usage: const platform = getPlatform(); const version = getVersion(); const accountInfo = getAccountInfoSync(); console.log(`Running on ${platform}, version: ${version}`); ``` -------------------------------- ### Navigation and Routing Utilities (JavaScript) Source: https://github.com/may529/kqdoc/blob/main/kqui/llms.txt Functions for navigating between different parts of the application. Includes navigating to mini programs, showing or hiding the tab bar, and controlling the app's home button. These are essential for managing user flow and app structure. ```JavaScript import { navigateToMiniProgram, hideTabBar, showTabBar, hideAppHomeButton } from '@kq-ui/utils/one/navigation-utils'; // Example usage: navigateToMiniProgram({ appId: 'wx123', path: 'pages/index/index' }); hideTabBar(); showTabBar(); hideAppHomeButton(); ``` -------------------------------- ### System Information Hook (TypeScript) Source: https://github.com/may529/kqdoc/blob/main/kqui/llms.txt A React hook for fetching system information synchronously. It returns an object containing details about the device and runtime environment. This is useful for adapting UI or logic based on platform specifics. ```TypeScript import { useGetSystemInfoSync } from 'src/use-get-system-info-sync'; function SystemInfoDisplay() { const systemInfo = useGetSystemInfoSync(); return (

System: {systemInfo.system}

Model: {systemInfo.model}

Platform: {systemInfo.platform}

); } ``` -------------------------------- ### Layout and Navigation Components (JavaScript) Source: https://github.com/may529/kqdoc/blob/main/kqui/llms.txt Components for structuring the application layout and enabling navigation. Includes scrollable views and swipeable actions. These components are fundamental for building responsive and interactive user interfaces. ```JavaScript import ScrollView from '@kq-ui/components/layout/scroll-view'; import SwipeAction from '@kq-ui/components/navigation/swipe-action'; // Example usage: {/* Content */} {/* Item content */} ``` -------------------------------- ### Fetch Data with useQuery Hook Source: https://github.com/may529/kqdoc/blob/main/kqui/llms.txt The useQuery hook facilitates data fetching in your application, likely integrating with a state management or caching solution. It abstracts away the complexities of making API requests and handling loading and error states. Input is typically a query key and a fetcher function. ```javascript import { useQuery } from 'kq-ui/utils/hooks/use-query'; function DataDisplay() { const { data, isLoading, error } = useQuery('myData', fetchDataFunction); if (isLoading) return 'Loading...'; if (error) return 'Error'; return (
{/* Render data */}
); } ``` -------------------------------- ### User Authorization and Authentication (JavaScript) Source: https://github.com/may529/kqdoc/blob/main/kqui/llms.txt Includes utilities for handling user authentication and authorization, such as requesting message subscriptions and performing user authorization checks. The `login` function is a core part of the authentication flow. ```JavaScript import { login, requestSubscribeMessage } from '@kq-ui/utils/business/auth-utils'; // Example usage: login().then(res => console.log('Login success:', res)); requestSubscribeMessage(['templateId1', 'templateId2']).then(res => console.log('Subscription result:', res)); ``` -------------------------------- ### Feedback and Display Components (JavaScript) Source: https://github.com/may529/kqdoc/blob/main/kqui/llms.txt UI components used for providing feedback to the user or displaying dynamic information. Includes features like image previews, jigsaws for verification, modals, skeleton loaders, and frequent action modals. These components improve user experience and interaction. ```JavaScript import PreviewImage from '@kq-ui/components/data-display/preview-image'; import Jigsaw from '@kq-ui/components/feedback/jigsaw'; import ShowFrequentModal from '@kq-ui/components/feedback/show-frequent-modal'; import Skeleton from '@kq-ui/components/feedback/skeleton'; import AffirmSheet from '@kq-ui/components/feedback/affirm-sheet'; // Example usage: console.log('Verified:', isValid)} /> ``` -------------------------------- ### Input License Key with LicenseKeyBoard Component Source: https://github.com/may529/kqdoc/blob/main/kqui/llms.txt The LicenseKeyBoard component provides a specialized keyboard interface for entering license keys. It may offer specific formatting or validation rules suitable for license key input. Input is character by character, output is the formatted key. ```javascript import LicenseKeyBoard from 'kq-ui/components/data-entry/license-key-board'; function LicenseEntry() { const handleLicenseChange = (key) => { console.log('Entered License Key:', key); }; return ( ); } ``` -------------------------------- ### General Purpose Components (JavaScript) Source: https://github.com/may529/kqdoc/blob/main/kqui/llms.txt Reusable UI components for common application elements. Includes platform-specific components, modals for user interaction, and image display components. These simplify the development of consistent UI patterns. ```JavaScript import Platform from '@kq-ui/components/general/platform'; import Modal from '@kq-ui/components/general/modal'; import Image from '@kq-ui/components/data-display/image'; // Assuming Image is also general import OpenWeapp from '@kq-ui/components/general/open-weapp'; // Example usage: setModalVisible(false)}>Content ``` -------------------------------- ### Input License Key with InputLicenseKeyBoard Component Source: https://github.com/may529/kqdoc/blob/main/kqui/llms.txt The InputLicenseKeyBoard component combines an input field with a custom keyboard for license key entry. It likely handles focus management and ensures that only valid characters for a license key are accepted. Input is typed characters, output is the license key string. ```javascript import InputLicenseKeyBoard from 'kq-ui/components/data-entry/input-license-key-board'; function LicenseInputForm() { const [licenseKey, setLicenseKey] = React.useState(''); return ( setLicenseKey(e.target.value)} placeholder="Enter License Key" /> ); } ``` -------------------------------- ### Image Handling Utilities (JavaScript) Source: https://github.com/may529/kqdoc/blob/main/kqui/llms.txt A collection of JavaScript functions for image manipulation and display. Includes utilities for previewing images, choosing images from the device, uploading images, and saving images to the photo album. These are crucial for user-generated content and media display. ```JavaScript import { previewImage, chooseImage, uploadFile, saveImageToPhotosAlbum } from '@kq-ui/utils/one/image-utils'; // Example usage: previewImage(['url1', 'url2']); chooseImage({ count: 9 }).then(res => console.log(res.tempFilePaths)); uploadFile({ url: '/upload', filePath: 'path/to/image.jpg' }); saveImageToPhotosAlbum({ filePath: 'path/to/saved/image.jpg' }); ``` -------------------------------- ### Interact with Browser Window Object Source: https://github.com/may529/kqdoc/blob/main/kqui/llms.txt The 'window' utility provides a safe and potentially abstracted way to interact with the global browser window object. It might offer methods or properties that are commonly used, ensuring compatibility or providing additional functionality. Direct use of the window object is its primary input. ```javascript import { window } from 'kq-ui/utils/one/window'; const currentUrl = window.location.href; console.log('Current URL:', currentUrl); ``` -------------------------------- ### Miscellaneous Utilities (JavaScript) Source: https://github.com/may529/kqdoc/blob/main/kqui/llms.txt A collection of various utility functions for common tasks. Includes debugging tools, location retrieval, QR code scanning, and managing interactive elements like action sheets. These provide essential support for app functionality. ```JavaScript import { debug } from '@kq-ui/utils/one/debug'; import { getLocation } from '@kq-ui/utils/one/get-location'; import { scanCode } from '@kq-ui/utils/one/scan-code'; import { showActionSheet } from '@kq-ui/utils/one/show-action-sheet'; import { setNavigationBarColor, setNavigationBarTitle } from '@kq-ui/utils/one/navigation-bar-utils'; // Example usage: debug.log('Debugging message'); getLocation().then(location => console.log('Location:', location)); scanCode().then(res => console.log('Scanned:', res.result)); showActionSheet({ itemList: ['Option 1', 'Option 2'], success: res => console.log('Selected:', res.tapIndex) }); setNavigationBarColor({ backgroundColor: '#ffffff' }); setNavigationBarTitle({ title: 'New Title' }); ``` -------------------------------- ### Implement Pagination with Pagination Component Source: https://github.com/may529/kqdoc/blob/main/kqui/llms.txt The Pagination component provides UI elements for navigating through paginated data. It typically includes page number buttons, previous/next controls, and possibly items per page selectors. Input includes current page and total pages. ```javascript import Pagination from 'kq-ui/components/data-display/pagination'; function PaginatedList() { const [currentPage, setCurrentPage] = React.useState(1); const totalPages = 10; const handlePageChange = (page) => { setCurrentPage(page); // Fetch data for the new page }; return (
{/* List items */}
); } ``` -------------------------------- ### Establish WebSocket Connection with useWebSocket Hook Source: https://github.com/may529/kqdoc/blob/main/kqui/llms.txt The useWebSocket hook simplifies the integration of real-time communication using WebSockets. It handles connection management, message sending, and receiving. Dependencies include the WebSocket server URL. Outputs are connection status and received messages. ```javascript import { useWebSocket } from 'kq-ui/utils/hooks/use-web-socket'; function ChatComponent() { const { sendMessage, lastMessage, readyState } = useWebSocket('wss://your-websocket-server.com'); // Use sendMessage, lastMessage, readyState return (
Status: {readyState}

Last Message: {lastMessage?.data}

); } ``` -------------------------------- ### Utility Functions Source: https://github.com/may529/kqdoc/blob/main/kqui/llms.txt This section details various utility functions available for common tasks such as encryption, storage management, device information retrieval, and more. ```APIDOC ## Utility Functions ### AES Encryption Provides functionality for AES encryption. **Endpoint**: `/may529/kqdoc/utils/business/a-e-s` ### Preview Image Component for displaying preview images. **Endpoint**: `/may529/kqdoc/components/data-display/preview-image` ### Get Location Retrieves the current location. **Endpoint**: `/may529/kqdoc/utils/one/get-location` ### Storage Synchronization Utilities Provides utilities for synchronizing data with local storage. **Endpoints**: - `getStorageSync`: Retrieves data from storage. - `setStorageSync`: Sets data in storage. - `removeStorageSync`: Removes data from storage. - `clearStorageSync`: Clears all data from storage. **Paths**: `/may529/kqdoc/utils/one/get-storage-sync`, `/may529/kqdoc/utils/one/set-storage-sync`, `/may529/kqdoc/utils/one/remove-storage-sync`, `/may529/kqdoc/utils/one/clear-storage-sync` ### User Login Handles user authentication and login processes. **Endpoint**: `/may529/kqdoc/utils/business/login` ### Map Utilities Provides utilities for map integration and interaction. **Endpoints**: - `Map`: Component for displaying maps. - `createMapContext`: Creates a map context for interaction. **Paths**: `/may529/kqdoc/components/data-display/map`, `/may529/kqdoc/utils/one/create-map-context` ### Subscription Message Requests subscription messages from the user. **Endpoint**: `/may529/kqdoc/utils/one/request-subscribe-message` ### Platform Information Provides information about the current platform. **Endpoints**: - `Platform`: Component for platform-specific elements. - `getPlatform`: Retrieves the current platform. **Paths**: `/may529/kqdoc/components/general/platform`, `/may529/kqdoc/utils/business/get-platform` ### Debugging Utilities Includes debugging functionalities. **Endpoint**: `/may529/kqdoc/utils/one/debug` ### Version Information Retrieves application version details. **Endpoint**: `/may529/kqdoc/utils/business/get-version` ### Account Information Retrieves synchronous account information. **Endpoint**: `/may529/kqdoc/utils/one/get-account-info-sync` ### Form Validation Rules Provides predefined rules for form validation. **Endpoint**: `/may529/kqdoc/utils/business/form-rules` ### Feedback Components Components for user feedback mechanisms. **Endpoints**: - `Jigsaw`: Jigsaw puzzle component. - `showFrequentModal`: Displays a modal for frequent actions. - `Skeleton`: Skeleton screen component for loading states. **Paths**: `/may529/kqdoc/components/feedback/jigsaw`, `/may529/kqdoc/components/feedback/show-frequent-modal`, `/may529/kqdoc/components/feedback/skeleton` ### Layout Components Components for structuring the user interface. **Endpoint**: `ScrollView` - A scrollable view component. **Path**: `/may529/kqdoc/components/layout/scroll-view` ### Data Entry Components Components for user data input. **Endpoints**: - `UploadImg`: Component for image uploads. - `selectFiles`: Allows selection of files. - `uploadFile`: Handles file uploads. - `Del`: Component for deletion actions. **Paths**: `/may529/kqdoc/components/data-entry/upload-img`, `/may529/kqdoc/components/data-entry/select-files`, `/may529/kqdoc/components/data-entry/upload-file`, `/may529/kqdoc/components/data-entry/del` ### Data Display Components Components for presenting data to the user. **Endpoints**: - `Image`: Displays images. - `Indexes`: Component for displaying indexes. - `WaterMark`: Adds a watermark to content. - `Tile`: A tile-based display component. - `Price`: Displays pricing information. - `TimeLine`: Component for displaying timelines. **Paths**: `/may529/kqdoc/components/data-display/image`, `/may529/kqdoc/components/data-display/indexes`, `/may529/kqdoc/components/data-display/water-mark`, `/may529/kqdoc/components/data-display/tile`, `/may529/kqdoc/components/data-display/price`, `/may529/kqdoc/components/data-display/time-line` ### General Components Miscellaneous general-purpose components. **Endpoints**: - `OpenWeapp`: Component for opening mini-programs. - `Modal`: Displays modal dialogs. **Paths**: `/may529/kqdoc/components/general/open-weapp`, `/may529/kqdoc/components/general/modal` ### Scanning and Clipboard Utilities Utilities for interacting with device scanners and clipboard. **Endpoints**: - `scanCode`: Scans QR codes or other barcodes. - `setClipboardData`: Sets data to the clipboard. - `getClipboardData`: Retrieves data from the clipboard. **Paths**: `/may529/kqdoc/utils/one/scan-code`, `/may529/kqdoc/utils/one/set-clipboard-data`, `/may529/kqdoc/utils/one/get-clipboard-data` ### Image Selection and Saving Utilities for selecting and saving images. **Endpoints**: - `chooseImage`: Allows the user to choose images. - `saveImageToPhotosAlbum`: Saves an image to the device's photo album. **Paths**: `/may529/kqdoc/utils/one/choose-image`, `/may529/kqdoc/utils/one/save-image-to-photos-album` ### OCR (Optical Character Recognition) Performs OCR on images to extract text. **Endpoint**: `/may529/kqdoc/utils/business/o-c-r` ### Version Management Utilities for managing version-related information. **Endpoint**: `versionVariable` - A variable related to versioning. **Path**: `/may529/kqdoc/utils/business/version-variable` ### Business and User Components Components related to business logic and user interactions. **Endpoints**: - `UserAuthorization`: Handles user authorization. - `AffirmSheet`: A confirmation sheet component. - `createAnimation`: Utility for creating animations. - `getAddressOptions`: Retrieves address options. - `PatientCard`: Displays patient information. - `HealthCard`: Displays health-related information. - `pxToRpx`: Converts pixel units to responsive pixels. - `switchVariable`: A variable for switching states. **Paths**: `/may529/kqdoc/components/business/user-authorization`, `/may529/kqdoc/components/feedback/affirm-sheet`, `/may529/kqdoc/utils/business/create-animation`, `/may529/kqdoc/utils/business/get-address-options`, `/may529/kqdoc/components/business/patient-card`, `/may529/kqdoc/components/business/health-card`, `/may529/kqdoc/utils/business/px-to-rpx`, `/may529/kqdoc/utils/business/switch-variable` ### Navigation and Tab Bar Utilities Utilities for controlling navigation and tab bar visibility. **Endpoints**: - `hideTabBar`: Hides the tab bar. - `showTabBar`: Shows the tab bar. - `hideAppHomeButton`: Hides the application home button. - `navigateToMiniProgram`: Navigates to another mini-program. **Paths**: `/may529/kqdoc/utils/one/hide-tab-bar`, `/may529/kqdoc/utils/one/show-tab-bar`, `/may529/kqdoc/utils/one/hide-app-home-button`, `/may529/kqdoc/utils/one/navigate-to-mini-program` ### Hook Utilities Custom hooks for specific functionalities. **Endpoints**: - `useTTS`: Text-to-speech hook. - `useFaceVerify`: Face verification hook. - `useGetSystemInfoSync`: Hook to get system information synchronously. - `useSafeArea`: Hook for safe area calculations. **Paths**: `/may529/kqdoc/utils/hooks/use-t-t-s`, `/may529/kqdoc/utils/hooks/use-face-verify`, `src/use-get-system-info-sync/index.tsx`, `/may529/kqdoc/utils/hooks/use-safe-area` ### Face Verification Component Component for performing face verification. **Endpoint**: `/may529/kqdoc/components/business/face-verify` ### Navigation Bar Utilities Utilities for customizing the navigation bar. **Endpoints**: - `setNavigationBarColor`: Sets the color of the navigation bar. - `setNavigationBarTitle`: Sets the title of the navigation bar. **Paths**: `/may529/kqdoc/utils/one/set-navigation-bar-color`, `/may529/kqdoc/utils/one/set-navigation-bar-title` ### Navigation Components Components for navigation elements. **Endpoint**: `SwipeAction` - A swipeable action component. **Path**: `/may529/kqdoc/components/navigation/swipe-action` ### Action Sheet Displays an action sheet to the user. **Endpoint**: `/may529/kqdoc/utils/one/show-action-sheet` ``` -------------------------------- ### Hook Utilities (JavaScript) Source: https://github.com/may529/kqdoc/blob/main/kqui/llms.txt Custom React hooks for managing specific functionalities. Includes hooks for text-to-speech (TTS) synthesis, safe area detection, and face verification processes. These hooks abstract complex logic into reusable components. ```JavaScript import { useTTS } from '@kq-ui/utils/hooks/use-t-t-s'; import { useSafeArea } from '@kq-ui/utils/hooks/use-safe-area'; import { useFaceVerify } from '@kq-ui/utils/hooks/use-face-verify'; // Example usage: const { speak, cancel } = useTTS(); const safeAreaInsets = useSafeArea(); const { startVerification, result } = useFaceVerify(); // speak('Hello world'); // console.log('Safe area:', safeAreaInsets); // startVerification(); ``` -------------------------------- ### Map Context Creation (JavaScript) Source: https://github.com/may529/kqdoc/blob/main/kqui/llms.txt Utility function to create a map context instance. This is used to control map components, such as setting the map's region, adding markers, or listening to map events. It requires a map component ID to be associated with. ```JavaScript import { createMapContext } from '@kq-ui/utils/one/create-map-context'; const mapContext = createMapContext('myMap'); // Example usage: mapContext.moveToLocation(); mapContext.addMarkers({ markers: [{ id: 1, latitude: 30, longitude: 120 }] }); ``` -------------------------------- ### Business Components (JavaScript) Source: https://github.com/may529/kqdoc/blob/main/kqui/llms.txt Components tailored for specific business functionalities. Includes user authorization interfaces, face verification modules, and health card displays. These components streamline the implementation of business-specific features. ```JavaScript import UserAuthorization from '@kq-ui/components/business/user-authorization'; import FaceVerify from '@kq-ui/components/business/face-verify'; import HealthCard from '@kq-ui/components/business/health-card'; import PatientCard from '@kq-ui/components/business/patient-card'; // Example usage: console.log('Verification successful')} /> ``` -------------------------------- ### Embed Video Content with Video Component Source: https://github.com/may529/kqdoc/blob/main/kqui/llms.txt The Video component is used for embedding and displaying video content within your application. It likely supports various video sources and formats, offering props for controlling playback, aspect ratio, and other video-specific settings. A video source URL is a key input. ```javascript import Video from 'kq-ui/components/data-display/video'; function VideoPlayer() { return (