### Example Responsive Grid Setup Source: https://docs.svar.dev/react/grid/api/properties/responsive Demonstrates how to import Grid, define data and columns, and configure a responsive object to adjust columns and sizes at a 1000px breakpoint. This example shows how to hide a column and set flex grow properties. ```javascript import { Grid } from "@svar-ui/react-grid"; import { getData } from "../data"; const Example = () => { const { data } = getData(); const columns = [ { id: "id", header: "ID" }, { id: "firstName", header: "First Name" }, { id: "lastName", header: "Last Name" }, { id: "email", header: "Email" }, ]; const responsive = { 1000: { columns: [ { id: "id", header: "ID", flexgrow: 1 }, { id: "firstName", header: "First Name", flexgrow: 1 }, { id: "lastName", header: "Last Name", flexgrow: 1 }, { id: "email", header: "Email", hidden: true, flexgrow: 1 }, ], sizes: { rowHeight: 40, columnWidth: 160, headerHeight: 40, footerHeight: 40, }, } }; return (
); }; export default Example; ``` -------------------------------- ### Example MultiCombo Dropdown Setup Source: https://docs.svar.dev/react/core/multicombo/api/props/dropdown Demonstrates how to apply dropdown configurations to a MultiCombo component. This example sets the position to 'bottom', alignment to 'start', and enables scroll tracking. ```jsx ``` -------------------------------- ### Run Sample Locally with npm Source: https://docs.svar.dev/react/grid/getting_started Commands to navigate to the project directory, install dependencies, and start the development server for local testing. ```bash # navigate to the root folder cd react-grid # install dependencies npm install # start dev server npm run dev ``` -------------------------------- ### Run sample locally with yarn/npm Source: https://docs.svar.dev/svelte/grid/getting_started Navigate to the project directory, install dependencies using yarn or npm, and start the development server to run the sample locally. ```bash // navigate to the root folder cd svelte-grid // install dependencies yarn install //or npm install // start dev server yarn dev //or npm run dev ``` -------------------------------- ### Example Radio Button Group Setup Source: https://docs.svar.dev/vue/core/radiogroup/api/props/options Demonstrates how to set up an array of options and pass them to a RadioButtonGroup component in Vue.js. ```vue ``` -------------------------------- ### Svar UI Grid Component Setup Source: https://docs.svar.dev/svelte/grid/api/properties/columns This example demonstrates the basic setup of the Svar UI Grid component in Svelte. It includes importing necessary components and data, defining column configurations, and rendering the grid. ```javascript ``` -------------------------------- ### Run Sample Locally Source: https://docs.svar.dev/vue/grid/getting_started Commands to run the Vue application locally after installing dependencies. Navigate to the project folder and start the development server. ```bash // navigate to the root folder cd vue-grid // install dependencies yarn install //or npm install // start dev server yarn dev //or npm run dev ``` -------------------------------- ### Configure Toolbar Items Example Source: https://docs.svar.dev/vue/grid/helpers/components/toolbar Example demonstrating how to import and configure the Toolbar component with custom items. This setup requires importing Grid and Toolbar from '@svar-ui/vue-grid' and passing the api and items props. ```javascript import { getData } from "./common/data"; import { Grid, Toolbar } from "@svar-ui/vue-grid"; import { ref } from "vue"; const api = ref(); const { data, columns } = getData(); const items = [ { id: "add-row", comp: "button", icon: "wxi-plus", text: "Add row", }, { id: "delete-row", comp: "button", icon: "wxi-delete", text: "Delete", }, { comp: "spacer" }, { id: "copy-row", comp: "icon", icon: "wxi-content-copy", }, ]; ``` ```html ``` -------------------------------- ### Initialize Button Control in Vue Source: https://docs.svar.dev/vue/core/guides/initialization Example of initializing a Button control using the core library in a Vue 3 setup script. ```vue ``` -------------------------------- ### Action Menu Example with Options Source: https://docs.svar.dev/vue/core/menu/actionmenu/api/props/options Demonstrates how to define and pass options to the ActionMenu component using Vue's script setup. Each option includes text, an icon, and a handler. ```vue ``` -------------------------------- ### Get Task Data Example Source: https://docs.svar.dev/react/gantt/helpers/rest_routes/get_tasks_id This example shows the expected JSON response when retrieving data for a specific task using the GET /tasks/{taskId} endpoint. The response includes details such as task ID, text, start and end dates, duration, progress, parent ID, type, and lazy loading status. ```json [ { "id": 2, "text": "[2] Mini p task 2.1", "start": "2024-06-14 00:00:00", "end": "2024-06-16 00:00:00", "duration": 0, "progress": 0, "parent": 10, "type": "task", "lazy": false }, { "id": 6, "text": "[6] Mini p task 2.2", "start": "2024-06-15 00:00:00", "end": "2024-06-19 00:00:00", "duration": 0, "progress": 0, "parent": 10, "type": "task", "lazy": false } ] ``` -------------------------------- ### Integrating HeaderMenu with Gantt Chart Source: https://docs.svar.dev/react/gantt/helpers/header_menu Example demonstrating how to integrate the HeaderMenu component with the Gantt chart. This setup allows hiding specific columns like 'start' and 'duration' by passing a columns object to HeaderMenu. ```jsx import { useRef } from "react"; import { getData } from "../data"; import { Gantt, HeaderMenu } from "@svar-ui/react-gantt"; function App() { const data = getData(); const columns = { start: true, duration: true }; const apiRef = useRef(null); return ( ); } export default App; ``` -------------------------------- ### Full Toolbar and Gantt Integration Example Source: https://docs.svar.dev/svelte/gantt/helpers/toolbar_component Example demonstrating how to import and use the Toolbar and Gantt components together. It includes setting up the API object and defining toolbar items. ```svelte ``` -------------------------------- ### Example Checkbox Group Usage Source: https://docs.svar.dev/vue/core/checkboxgroup/api/props/options This example demonstrates how to pass an array of options to a CheckboxGroup component in a Vue.js setup. ```vue ``` -------------------------------- ### Examples Source: https://docs.svar.dev/svelte/core/comments/api/props/value Various examples demonstrating how to initialize and use the Comments widget. ```APIDOC ## Examples ### Initializing comments widget with data and embedded authors ```javascript ``` ### Initializing comments widget with data and list of users ```javascript ``` ### Initializing empty comments widget ```javascript ``` ### Initializing widget and loading comments ```javascript {#await value} {/await} ``` ``` -------------------------------- ### Use FilterQuery with Placeholder Example Source: https://docs.svar.dev/react/filter/api/filterquery/properties/placeholder Example of how to implement the placeholder property in a FilterQuery component to guide user input. ```jsx ``` -------------------------------- ### Example: Fetching and Providing Branch Data Source: https://docs.svar.dev/react/gantt/api/actions/provide-data This example demonstrates listening for the 'request-data' action, fetching data from a server, and then using the 'provide-data' action to send it. Ensure the server endpoints are correctly configured. ```javascript import { useState, useEffect } from "react"; import { Gantt } from "@svar-ui/react-gantt"; const server = "https://some-server"; export default function App() { const [tasks, setTasks] = useState([]); const [links, setLinks] = useState([]); useEffect(() => { Promise.all([ fetch(server + "/tasks").then(res => res.json()), fetch(server + "/links").then(res => res.json()), ]).then(([t, l]) => { setTasks(t); setLinks(l); }); }, []); function init(api) { api.on("request-data", ev => { Promise.all([ fetch(`${server}/tasks/${ev.id}`).then(res => res.json()), fetch(`${server}/links/${ev.id}`).then(res => res.json()), ]).then(([tasks, links]) => { api.exec("provide-data", { id: ev.id, data: { tasks, links, }, }); }); }); } return ; } ``` -------------------------------- ### GET /{url} Response Example Source: https://docs.svar.dev/react/grid/helpers/restdataprovider/routes/get_data This is an example of the JSON array returned by the GET /{url} endpoint. It contains objects representing rows of data from the requested table. The HTTP status code indicates success (200) or failure (500). ```json [ { "id": 5, "name": "Kwan123", "year": 10, "votes": 0 } ] ``` -------------------------------- ### Install Valtio Source: https://docs.svar.dev/react/gantt/integration-guides/integration-valtio Install Valtio using npm. This is the first step to integrate Valtio into your project. ```bash npm install valtio ``` -------------------------------- ### Combo Dropdown Example Source: https://docs.svar.dev/react/core/combo/api/props/dropdown Example of how to configure the dropdown for a Combo component. This sets the position to bottom, alignment to start, and enables scroll tracking. ```jsx ``` -------------------------------- ### MultiCombo Dropdown Example Source: https://docs.svar.dev/vue/core/multicombo/api/props/dropdown Example of how to apply dropdown configuration to a MultiCombo component. This sets the dropdown to appear below the input, aligned to the start, and to close on scroll. ```html ``` -------------------------------- ### Example Grid Data Initialization Source: https://docs.svar.dev/svelte/grid/api/properties/data Demonstrates how to import the Grid component and initialize data for it. This example shows setting up an array of objects, each with an 'id' and various properties like 'city', 'country', and 'firstName', to be displayed in the grid. ```javascript import { Grid } from "@svar-ui/svelte-grid"; import { getData } from "./common/data"; const { columns } = getData(); const data = [ { id: 1, city: "Amieshire", country: 6, email: "Leora13@yahoo.com", firstName: "Ernest", lastName: "Schuppe", street: "Ratke Port", zipCode: "17026-3154", date: new Date("2016-09-23T07:57:40.195Z"), companyName: "Lebsack - Nicolas", stars: 820, followers: 70, newsletter: true, checked: 1, }, { id: 2, city: "Gust", country: 4, email: "Mose_Gerhold51@yahoo.com", firstName: "Janis", lastName: "Vandervort", street: "Dickinson Keys", zipCode: "43767", date: new Date("2017-03-06T09:59:12.551Z"), companyName: "Glover - Hermiston", stars: 1200, followers: 170, checked: 1, }, ]; ``` -------------------------------- ### MenuBar Initialization and Usage Source: https://docs.svar.dev/react/core/menu/menubar/api Demonstrates how to import and initialize the MenuBar component with options. ```APIDOC ## MenuBar Initialization ### Description Initializes the MenuBar component with a set of options. ### Method Component Usage ### Endpoint N/A ### Parameters #### Request Body - **options** (Array) - Optional. Specifies a set of options for the Menu Bar. - **css** (string) - Optional. Adds a custom style to the menu item. - **menuCss** (string) - Optional. Adds a custom CSS class to the Menu. ### Request Example ```javascript import { MenuBar } from "@svar-ui/react-menu"; import { getOptions } from "./data"; const options = getOptions(); ``` ### Response #### Success Response (200) N/A (Component rendering) #### Response Example N/A ``` -------------------------------- ### DateRangePicker Dropdown Example Source: https://docs.svar.dev/vue/core/daterangepicker/api/props/dropdown Example of how to apply dropdown configurations to a DateRangePicker component. This sets the position to bottom, alignment to start, and enables scroll tracking. ```html ``` -------------------------------- ### Context Menu Initialization Source: https://docs.svar.dev/react/core/menu/contextmenu/api Example of how to initialize and use the Context Menu component with provided options. ```APIDOC ## Initialization ```javascript import { useState } from "react"; import { ContextMenu } from "@svar-ui/react-menu"; import { getOptions } from "./data"; export default function Example() { const [options] = useState(() => getOptions()); return ; } ``` ``` -------------------------------- ### RichSelect Dropdown Example Source: https://docs.svar.dev/react/core/richselect/api/props/dropdown Example of how to configure a RichSelect component's dropdown. This sets the position to 'bottom', alignment to 'start', and enables scroll tracking. ```jsx ``` -------------------------------- ### CheckboxGroup Usage Example Source: https://docs.svar.dev/vue/core/checkboxgroup/api/props/type Demonstrates how to use the CheckboxGroup component with the 'type' prop set to 'inline'. This example shows the setup of options and their rendering in a single row. ```vue ``` -------------------------------- ### Basic Vue Grid Setup Source: https://docs.svar.dev/vue/grid/api/properties/columns Demonstrates the basic setup for the Vue Grid component, including importing necessary modules, fetching data, and defining columns. Ensure the 'getData' function is correctly implemented and imported. ```vue ``` -------------------------------- ### Get Task Data Source: https://docs.svar.dev/react/gantt/helpers/rest_routes/get_tasks This example shows the expected JSON response when making a GET request to the /tasks endpoint. It includes details for multiple tasks and summary items. ```json [ { "id": 20, "text": "New Task", "start": "2024-06-21 00:00:00", "end": "2024-06-22 00:00:00", "duration": 1, "progress": 2, "parent": 0, "type": "task", "lazy": false }, { "id": 47, "text": "[1] Master project", "start": "2024-06-10 00:00:00", "end": "2024-06-18 00:00:00", "duration": 8, "progress": 0, "parent": 0, "type": "summary", "lazy": true }, { "id": 21, "text": "New Task", "start": "2024-06-13 00:00:00", "end": "2024-06-14 00:00:00", "duration": 1, "progress": 0, "parent": 20, "type": "task", "lazy": false } ] ``` -------------------------------- ### MenuBar Initialization Source: https://docs.svar.dev/svelte/core/menu/menubar/api Demonstrates how to initialize and use the MenuBar component with provided options. ```APIDOC ## MenuBar Initialization ### Description Initializes the MenuBar component by importing it and passing an options array. ### Method Svelte Component Initialization ### Endpoint N/A ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```html ``` ### Response #### Success Response (200) N/A #### Response Example N/A ``` -------------------------------- ### Example: Outputting DataStore to Console Source: https://docs.svar.dev/svelte/grid/api/methods/getstores This Svelte component example demonstrates how to initialize the Grid with data and columns, and then use the api.getStores() method within the 'init' function to log the DataStore to the console. ```javascript ``` -------------------------------- ### Example TimePicker with Dropdown Configuration Source: https://docs.svar.dev/vue/core/timepicker/api/props/dropdown Demonstrates how to apply dropdown settings to a TimePicker component. This example sets the dropdown position to 'bottom', alignment to 'start', and enables scroll tracking. ```vue ``` -------------------------------- ### RichSelect Dropdown Example Source: https://docs.svar.dev/vue/core/richselect/api/props/dropdown Demonstrates how to apply dropdown configuration options within a Vue template. This example sets the position to 'bottom', alignment to 'start', and enables scroll tracking. ```html ``` -------------------------------- ### Select Component Initialization Source: https://docs.svar.dev/react/core/select/api Example of how to initialize and use the Select component with options. ```APIDOC ## Select Component Initialization ### Description This section shows how to import and use the Select component in your React application. ### Code Example ```javascript import { Select } from "@svar-ui/react-core"; const dataset = [ { id: 1, label: "First option" }, { id: 2, label: "Second option" }, { id: 3, label: "Third option" } ]; export default function App() { return