17 |
18 |
41 |
--------------------------------------------------------------------------------
/svelte/cypress/e2e/basic/collapse-overflow.cy.js:
--------------------------------------------------------------------------------
1 | context("Basic: overflow collapse behavior", () => {
2 | it("moves items into overflow menu when container width changes", () => {
3 | cy.visit("/index.html#/menu-groups/willow");
4 |
5 | cy.get(".wx-toolbar .wx-tb-element").then($elements => {
6 | const initialCount = $elements.length;
7 | cy.log(`Initial toolbar items: ${initialCount}`);
8 | });
9 |
10 | cy.get(".wx-menu").should("not.exist");
11 |
12 | cy.contains("button", "Change width").click();
13 |
14 | cy.get(".wx-toolbar .wx-tb-element").then($elements => {
15 | const afterFirstChange = $elements.length;
16 | cy.log(
17 | `Toolbar items after first width change: ${afterFirstChange}`
18 | );
19 | });
20 |
21 | cy.get(".wx-menu").should("exist");
22 |
23 | cy.get(".wx-menu button").first().click();
24 | cy.get(".wx-drop-menu").should("be.visible");
25 |
26 | cy.get(".wx-drop-menu .wx-tb-element").should("have.length", 2);
27 | });
28 | });
29 |
--------------------------------------------------------------------------------
/license.txt:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2025 XB Software Sp. z o.o.
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
--------------------------------------------------------------------------------
/svelte/license.txt:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2025 XB Software Sp. z o.o.
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
--------------------------------------------------------------------------------
/svelte/demos/common/Router.svelte:
--------------------------------------------------------------------------------
1 |
43 |
44 |
45 |
--------------------------------------------------------------------------------
/svelte/demos/cases/Values.svelte:
--------------------------------------------------------------------------------
1 |
14 |
15 |
{message}
16 |
17 |
18 |
Binding different values
19 |
29 | {JSON.stringify(values)}
30 |
31 |
34 |
35 |
36 |
Binding the same value
37 |
47 |
48 |
--------------------------------------------------------------------------------
/svelte/whatsnew.md:
--------------------------------------------------------------------------------
1 | ## 2.4.0
2 |
3 | - Using core@2.4.0
4 |
5 | ## 2.3.0
6 |
7 | ### New features
8 |
9 | - TypeScript definitions
10 |
11 | ### Fixes
12 |
13 | - item `menuText` property is not applied
14 |
15 | ## 2.2.1
16 |
17 | ### Fixes
18 |
19 | - Using in Salesforce environment
20 |
21 | ## 2.2.0
22 |
23 | - Using core@2.2.0
24 |
25 | ## 2.1.0
26 |
27 | - Using core@2.1.0
28 |
29 | ## 2.0.1
30 |
31 | ### New features
32 |
33 | - Svelte 5 support
34 |
35 | ## 1.3.0
36 |
37 | - Using core@1.3.0
38 |
39 | ## 1.2.3
40 |
41 | ### Fixes
42 |
43 | - Regression in overflow menu closing
44 | - Regression in dropdown rendering
45 |
46 | ## 1.2.1
47 |
48 | - Using core@1.2.0
49 |
50 | ## 1.2.1
51 |
52 | ### New features
53 |
54 | - Labels can be bound to data
55 |
56 | ## 1.2.0
57 |
58 | ### New features
59 |
60 | - Extra demo for the HeaderMenu scenario
61 | - Ability to use `spacer` on toolbar items
62 | - Ability to use `item` subtype for the drop-down menus
63 |
64 | ### Fixes
65 |
66 | - Separator rendering in drop-down menus
67 | - Names of css classes corrected
68 |
69 | ## 1.1.2
70 |
71 | ### Updates
72 |
73 | - Inner css classes renamed, "wx" prefix added
74 |
75 | ## 1.1.1
76 |
77 | - Migrated to vite based toolchain
78 |
79 | ### 1.1.0
80 |
81 | - Initial version
82 |
--------------------------------------------------------------------------------
/svelte/demos/cases/HeaderMenu.svelte:
--------------------------------------------------------------------------------
1 |
48 |
49 |
16 |
17 | **SVAR Toolbar** is a Svelte UI component for building flexible button panels, from simple button sets to complex structures with numerous buttons and select boxes. It provides an easy way to organize and display multiple toolbar items, with support for multiline layouts and collapsible item groups that can be shown on demand.
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 | ### How to Use
26 |
27 | To use the toolbar, simply import the package and include the component in your Svelte file:
28 |
29 | ```svelte
30 |
47 |
48 |
49 | ```
50 |
51 | ### Svelte 4 and Svelte 5 Versions
52 |
53 | There are two versions of the library: the 1.x version, designed to work with Svelte 4, and the 2.x version, created for Svelte 5.
54 |
55 | To use the SVAR Toolbar beta for Svelte 5, install it as follows:
56 |
57 | ```
58 | npm install @svar-ui/svelte-toolbar
59 | ```
60 |
61 | To use the SVAR Toolbar for Svelte 4:
62 |
63 | ```
64 | npm install wx-svelte-toolbar@1.3.0
65 | ```
66 |
67 | ### How to Modify
68 |
69 | Typically, you don't need to modify the code. However, if you wish to do so, follow these steps:
70 |
71 | 1. Run `yarn` to install dependencies. Note that this project is a monorepo using `yarn` workspaces, so npm will not work
72 | 2. Start the project in development mode with `yarn start`
73 |
74 | ### Run Tests
75 |
76 | To run the test:
77 |
78 | 1. Start the test examples with:
79 | ```sh
80 | yarn start:tests
81 | ```
82 | 2. In a separate console, run the end-to-end tests with:
83 | ```sh
84 | yarn test:cypress
85 | ```
86 |
--------------------------------------------------------------------------------
/svelte/demos/cases/OverflowMenuGroups.svelte:
--------------------------------------------------------------------------------
1 |
95 |
96 |