├── .editorconfig
├── .eslintrc.js
├── .gitignore
├── .husky
├── .gitignore
└── pre-commit
├── .prettierrc
├── eslint.config.mjs
├── license.txt
├── locales
├── index.js
├── locales
│ ├── cn.js
│ ├── de.js
│ ├── en.js
│ ├── es.js
│ ├── fr.js
│ ├── it.js
│ ├── ja.js
│ ├── pt.js
│ └── ru.js
└── package.json
├── package.json
├── readme.md
├── site
├── index.html
├── index.js
├── package.json
├── public
│ └── assets
│ │ ├── avatars
│ │ ├── avatar01.png
│ │ ├── avatar04.png
│ │ ├── avatar05.png
│ │ ├── avatar06.png
│ │ ├── avatar07.png
│ │ ├── avatar09.png
│ │ └── avatar10.png
│ │ └── icons
│ │ ├── Willow.svg
│ │ └── Willow_dark.svg
├── src
│ ├── CustomCoreWidgets.svelte
│ ├── Demo.svelte
│ ├── Main.svelte
│ ├── ThemeSelect.svelte
│ ├── components
│ │ ├── CalendarUploader.svelte
│ │ ├── CustomThemeSelect.svelte
│ │ ├── Form.svelte
│ │ ├── Icons
│ │ │ └── LockIcon.svelte
│ │ ├── RadioCheckboxes.svelte
│ │ ├── SearchList.svelte
│ │ └── Topbar.svelte
│ └── data
│ │ └── index.js
├── svelte.config.js
└── vite.config.js
├── svelte
├── .gitignore
├── cypress.config.js
├── cypress
│ ├── e2e
│ │ └── demos.cy.js
│ ├── fixtures
│ │ └── example.json
│ └── support
│ │ ├── commands.js
│ │ └── e2e.js
├── demos
│ ├── cases
│ │ ├── Area.svelte
│ │ ├── Basic.svelte
│ │ ├── Buttons.svelte
│ │ ├── Calendar.svelte
│ │ ├── Checkbox.svelte
│ │ ├── ColorPicker.svelte
│ │ ├── ColorSelect.svelte
│ │ ├── Combo.svelte
│ │ ├── Counter.svelte
│ │ ├── DatePicker.svelte
│ │ ├── DateRangePicker.svelte
│ │ ├── Field.svelte
│ │ ├── Icon.svelte
│ │ ├── Locales.svelte
│ │ ├── Messages.svelte
│ │ ├── ModalArea.svelte
│ │ ├── Month.svelte
│ │ ├── MultiCombo.svelte
│ │ ├── Pager.svelte
│ │ ├── Popup.svelte
│ │ ├── Radio.svelte
│ │ ├── RangeCalendar.svelte
│ │ ├── RichSelect.svelte
│ │ ├── Segmented.svelte
│ │ ├── Select.svelte
│ │ ├── SideArea.svelte
│ │ ├── Slider.svelte
│ │ ├── Switch.svelte
│ │ ├── Tabs.svelte
│ │ ├── Text.svelte
│ │ ├── TextArea.svelte
│ │ ├── TimePicker.svelte
│ │ ├── Timepicker.svelte
│ │ └── TwoState.svelte
│ ├── common
│ │ ├── Index.svelte
│ │ ├── Link.svelte
│ │ ├── Router.svelte
│ │ └── helpers.js
│ ├── custom
│ │ └── UserOption.svelte
│ ├── data
│ │ ├── icons.js
│ │ ├── roles.js
│ │ └── userlist.js
│ ├── index.js
│ └── routes.js
├── index.html
├── license.txt
├── package.json
├── postcss.config.js
├── readme.md
├── src
│ ├── Locale.svelte
│ ├── components
│ │ ├── Area.svelte
│ │ ├── Button.svelte
│ │ ├── Calendar.svelte
│ │ ├── Checkbox.svelte
│ │ ├── CheckboxGroup.svelte
│ │ ├── ColorBoard.svelte
│ │ ├── ColorPicker.svelte
│ │ ├── ColorSelect.svelte
│ │ ├── Combo.svelte
│ │ ├── Counter.svelte
│ │ ├── DatePicker.svelte
│ │ ├── DateRangePicker.svelte
│ │ ├── Dropdown.svelte
│ │ ├── Field.svelte
│ │ ├── Globals.svelte
│ │ ├── Icon.svelte
│ │ ├── Modal.svelte
│ │ ├── ModalArea.svelte
│ │ ├── MultiCombo.svelte
│ │ ├── Notice.svelte
│ │ ├── Notices.svelte
│ │ ├── Pager.svelte
│ │ ├── Popup.svelte
│ │ ├── Portal.svelte
│ │ ├── RadioButton.svelte
│ │ ├── RadioButtonGroup.svelte
│ │ ├── RangeCalendar.svelte
│ │ ├── RichSelect.svelte
│ │ ├── Segmented.svelte
│ │ ├── Select.svelte
│ │ ├── SideArea.svelte
│ │ ├── Slider.svelte
│ │ ├── Switch.svelte
│ │ ├── Tabs.svelte
│ │ ├── Text.svelte
│ │ ├── TextArea.svelte
│ │ ├── TimePicker.svelte
│ │ ├── Timepicker.svelte
│ │ ├── TwoState.svelte
│ │ ├── calendar
│ │ │ ├── Button.svelte
│ │ │ ├── Duodecade.svelte
│ │ │ ├── Header.svelte
│ │ │ ├── Month.svelte
│ │ │ ├── Panel.svelte
│ │ │ ├── Year.svelte
│ │ │ └── helpers.js
│ │ ├── helpers.js
│ │ └── helpers
│ │ │ ├── SuggestDropdown.svelte
│ │ │ ├── colorTransformator.js
│ │ │ ├── colorValidation.js
│ │ │ ├── listnav.js
│ │ │ └── sliderMove.js
│ ├── index.js
│ └── themes
│ │ ├── FontOpenSans.svelte
│ │ ├── FonttRoboto.svelte
│ │ ├── Material.svelte
│ │ ├── Willow.svelte
│ │ └── WillowDark.svelte
├── svelte.config.js
├── tests
│ ├── Index.svelte
│ ├── index.html
│ ├── index.js
│ └── routes.js
├── vite.config.js
└── whatsnew.md
└── yarn.lock
/.editorconfig:
--------------------------------------------------------------------------------
1 | root = true
2 |
3 | [*]
4 | indent_style = tab
5 | indent_size = 4
--------------------------------------------------------------------------------
/.eslintrc.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | root: true,
3 | env: {
4 | browser: true,
5 | node: true,
6 | es6: true,
7 | },
8 | extends: ["plugin:cypress/recommended", "eslint:recommended", "prettier"],
9 | parserOptions: {
10 | ecmaVersion: 2020,
11 | sourceType: "module",
12 | extraFileExtensions: [".svelte"],
13 | },
14 | plugins: ["svelte3"],
15 |
16 | overrides: [
17 | {
18 | files: ["*.svelte"],
19 | processor: "svelte3/svelte3",
20 | },
21 | ],
22 | settings: {
23 | // [todo] we can add stylelint for this
24 | "svelte3/ignore-styles": () => true,
25 | },
26 | rules: {
27 | "no-bitwise": ["error"],
28 | },
29 | };
30 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules
2 | package-lock.json
3 |
4 | *.zip
5 | .Ds_store
6 | *.tgz
7 | *.log
8 | .vscode
9 | .idea
10 | .env.local
--------------------------------------------------------------------------------
/.husky/.gitignore:
--------------------------------------------------------------------------------
1 | _
2 |
--------------------------------------------------------------------------------
/.husky/pre-commit:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | yarn run lint-staged
4 |
--------------------------------------------------------------------------------
/.prettierrc:
--------------------------------------------------------------------------------
1 | {
2 | "useTabs": true,
3 | "semi": true,
4 | "singleQuote": false,
5 | "quoteProps": "as-needed",
6 | "trailingComma": "es5",
7 | "bracketSpacing": true,
8 | "arrowParens": "avoid",
9 | "svelteSortOrder": "options-scripts-markup-styles",
10 | "plugins": [
11 | "prettier-plugin-svelte"
12 | ],
13 | "overrides": [
14 | {
15 | "files": "*.svelte",
16 | "options": {
17 | "parser": "svelte"
18 | }
19 | },
20 | {
21 | "files": "*.ts",
22 | "options": {
23 | "parser": "typescript"
24 | }
25 | }
26 | ]
27 | }
--------------------------------------------------------------------------------
/eslint.config.mjs:
--------------------------------------------------------------------------------
1 | import eslintConfigPrettier from "eslint-config-prettier";
2 | import eslintPluginSvelte from 'eslint-plugin-svelte';
3 | import * as svelteParser from 'svelte-eslint-parser';
4 | import tsLint from "typescript-eslint";
5 | import jsLint from "@eslint/js";
6 | import vitest from "eslint-plugin-vitest";
7 | import globals from "globals";
8 |
9 | export default [{
10 | ignores: ["node_modules/", "dist/", "build/", "coverage/", "public/", "svelte/vite.config.js"],
11 | },
12 | jsLint.configs.recommended,
13 | ...tsLint.configs.recommended,
14 | ...eslintPluginSvelte.configs['flat/recommended'],
15 | eslintConfigPrettier,
16 | vitest.configs.recommended,
17 | ...eslintPluginSvelte.configs["flat/prettier"],
18 | {
19 | rules: {
20 | "no-bitwise": ["error"],
21 | // there is a misconception between esLint and svelte compiler
22 | // rules that are necessary for compiler, throw errors in esLint
23 | // need to be revised with next version of toolchain
24 | "svelte/no-unused-svelte-ignore": "off",
25 | "svelte/valid-compile": "off",
26 | // Ignore unused vars starting with _
27 | // "@typescript-eslint/no-unused-vars": ["error", { argsIgnorePattern: "^_" }],
28 | // // Turn off the need for explicit function return types
29 | // "@typescript-eslint/explicit-function-return-type": "off",
30 | // // Warn when "any" type is used
31 | "@typescript-eslint/no-explicit-any": "off",
32 | // // Warn on @ts-ignore comments
33 | // "@typescript-eslint/ban-ts-comment": "warn",
34 | // // Public methods should have return types
35 | // "@typescript-eslint/explicit-module-boundary-types": "error",
36 | },
37 | },
38 | {
39 | languageOptions: {
40 | globals: { ...globals.browser, ...globals.es2022 },
41 | ecmaVersion: 2022,
42 | sourceType: "module",
43 | parserOptions: {
44 | extraFileExtensions: [".svelte"],
45 | warnOnUnsupportedTypeScriptVersion: false,
46 | tsconfigRootDir: import.meta.dirname,
47 | },
48 | },
49 |
50 | },
51 | {
52 |
53 | files: ["**/*.svelte"],
54 | rules: {
55 | "@typescript-eslint/no-unused-expressions": "off"
56 | }
57 | },
58 | {
59 | // temporarily ignore cypress folder
60 | ignores: [
61 | "**/cypress/"
62 | ]
63 | },
64 | {
65 |
66 | files: ["**/*.svelte.js"],
67 | languageOptions: {
68 | parser: svelteParser,
69 | }
70 | }
71 | ];
72 |
--------------------------------------------------------------------------------
/license.txt:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2023 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.
--------------------------------------------------------------------------------
/locales/index.js:
--------------------------------------------------------------------------------
1 | export { default as en } from "./locales/en.js";
2 | export { default as cn } from "./locales/cn.js";
3 | export { default as de } from "./locales/de.js";
4 | export { default as es } from "./locales/es.js";
5 | export { default as fr } from "./locales/fr.js";
6 | export { default as it } from "./locales/it.js";
7 | export { default as ja } from "./locales/ja.js";
8 | export { default as pt } from "./locales/pt.js";
9 | export { default as ru } from "./locales/ru.js";
10 |
--------------------------------------------------------------------------------
/locales/locales/cn.js:
--------------------------------------------------------------------------------
1 | const lang = "zh-CN";
2 |
3 | const calendar = {
4 | monthFull: [
5 | "一月",
6 | "二月",
7 | "三月",
8 | "四月",
9 | "五月",
10 | "六月",
11 | "七月",
12 | "八月",
13 | "九月",
14 | "十月",
15 | "十一月",
16 | "十二月",
17 | ],
18 | monthShort: [
19 | "一月",
20 | "二月",
21 | "三月",
22 | "四月",
23 | "五月",
24 | "六月",
25 | "七月",
26 | "八月",
27 | "九月",
28 | "十月",
29 | "十一月",
30 | "十二月",
31 | ],
32 | dayFull: [
33 | "星期日",
34 | "星期一",
35 | "星期二",
36 | "星期三",
37 | "星期四",
38 | "星期五",
39 | "星期六",
40 | ],
41 | dayShort: ["周日", "周一", "周二", "周三", "周四", "周五", "周六"],
42 | hours: "小时",
43 | minutes: "分钟",
44 | done: "完成",
45 | clear: "清除",
46 | today: "今天",
47 | am: ["", ""],
48 | pm: ["", ""],
49 |
50 | weekStart: 7,
51 | clockFormat: 24,
52 | };
53 |
54 | const core = {
55 | ok: "确定",
56 | cancel: "取消",
57 | select: "选择",
58 | "No data": "没有数据",
59 | };
60 |
61 | const formats = {
62 | timeFormat: "%H:%i",
63 | dateFormat: "%Y-%m-%d",
64 | monthYearFormat: "%F %Y",
65 | yearFormat: "%Y",
66 | };
67 |
68 | const data = {
69 | core,
70 | calendar,
71 | formats,
72 | lang,
73 | };
74 |
75 | export default data;
76 |
--------------------------------------------------------------------------------
/locales/locales/de.js:
--------------------------------------------------------------------------------
1 | const lang = "de-DE";
2 |
3 | const calendar = {
4 | monthFull: [
5 | "Januar",
6 | "Februar",
7 | "März",
8 | "April",
9 | "Mai",
10 | "Juni",
11 | "Juli",
12 | "August",
13 | "September",
14 | "Oktober",
15 | "November",
16 | "Dezember",
17 | ],
18 | monthShort: [
19 | "Jan",
20 | "Feb",
21 | "Mrz",
22 | "Apr",
23 | "Mai",
24 | "Jun",
25 | "Jul",
26 | "Aug",
27 | "Sep",
28 | "Okt",
29 | "Nov",
30 | "Dez",
31 | ],
32 | dayFull: [
33 | "Sonntag",
34 | "Montag",
35 | "Dienstag",
36 | "Mittwoch",
37 | "Donnerstag",
38 | "Freitag",
39 | "Samstag",
40 | ],
41 | dayShort: ["So", "Mo", "Di", "Mi", "Do", "Fr", "Sa"],
42 | hours: "Stunden",
43 | minutes: "Minuten",
44 | done: "Fertig",
45 | clear: "Entfernen",
46 | today: "Heute",
47 |
48 | weekStart: 1,
49 | clockFormat: 24,
50 | };
51 |
52 | const core = {
53 | ok: "OK",
54 | cancel: "Abbrechen",
55 | select: "Auswählen",
56 | "No data": "Keine Daten",
57 | };
58 |
59 | const formats = {
60 | timeFormat: "%H:%i",
61 | dateFormat: "%d.%m.%Y",
62 | monthYearFormat: "%F %Y",
63 | yearFormat: "%Y",
64 | };
65 |
66 | const data = {
67 | core,
68 | calendar,
69 | formats,
70 | lang,
71 | };
72 |
73 | export default data;
74 |
--------------------------------------------------------------------------------
/locales/locales/en.js:
--------------------------------------------------------------------------------
1 | const lang = "en-US";
2 |
3 | const calendar = {
4 | monthFull: [
5 | "January",
6 | "February",
7 | "March",
8 | "April",
9 | "May",
10 | "June",
11 | "July",
12 | "August",
13 | "September",
14 | "October",
15 | "November",
16 | "December",
17 | ],
18 | monthShort: [
19 | "Jan",
20 | "Feb",
21 | "Mar",
22 | "Apr",
23 | "May",
24 | "Jun",
25 | "Jul",
26 | "Aug",
27 | "Sep",
28 | "Oct",
29 | "Nov",
30 | "Dec",
31 | ],
32 | dayFull: [
33 | "Sunday",
34 | "Monday",
35 | "Tuesday",
36 | "Wednesday",
37 | "Thursday",
38 | "Friday",
39 | "Saturday",
40 | ],
41 | dayShort: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
42 | hours: "Hours",
43 | minutes: "Minutes",
44 | done: "Done",
45 | clear: "Clear",
46 | today: "Today",
47 | am: ["am", "AM"],
48 | pm: ["pm", "PM"],
49 |
50 | weekStart: 7,
51 | clockFormat: 24,
52 | };
53 |
54 | const core = {
55 | ok: "OK",
56 | cancel: "Cancel",
57 | select: "Select",
58 | "No data": "No data",
59 | };
60 |
61 | const formats = {
62 | timeFormat: "%H:%i",
63 | dateFormat: "%m/%d/%Y",
64 | monthYearFormat: "%F %Y",
65 | yearFormat: "%Y",
66 | };
67 |
68 | const data = {
69 | core,
70 | calendar,
71 | formats,
72 | lang,
73 | };
74 |
75 | export default data;
76 |
--------------------------------------------------------------------------------
/locales/locales/es.js:
--------------------------------------------------------------------------------
1 | const lang = "es-ES";
2 |
3 | const calendar = {
4 | monthFull: [
5 | "enero",
6 | "febrero",
7 | "marzo",
8 | "abril",
9 | "mayo",
10 | "junio",
11 | "julio",
12 | "agosto",
13 | "septiembre",
14 | "octubre",
15 | "noviembre",
16 | "diciembre",
17 | ],
18 | monthShort: [
19 | "ene",
20 | "feb",
21 | "mar",
22 | "abr",
23 | "may",
24 | "jun",
25 | "jul",
26 | "ago",
27 | "sep",
28 | "oct",
29 | "nov",
30 | "dic",
31 | ],
32 | dayFull: [
33 | "domingo",
34 | "lunes",
35 | "martes",
36 | "miércoles",
37 | "jueves",
38 | "viernes",
39 | "sábado",
40 | ],
41 | dayShort: ["dom", "lun", "mar", "mié", "jue", "vie", "sáb"],
42 | hours: "Horas",
43 | minutes: "Minutos",
44 | done: "Listo",
45 | clear: "Reinicio",
46 | today: "Hoy",
47 |
48 | weekStart: 1,
49 | clockFormat: 24,
50 | };
51 |
52 | const core = {
53 | ok: "OK",
54 | cancel: "Cancelar",
55 | select: "Seleccionar",
56 | "No data": "Sin datos",
57 | };
58 |
59 | const formats = {
60 | timeFormat: "%H:%i",
61 | dateFormat: "%d/%m/%Y",
62 | monthYearFormat: "%F %Y",
63 | yearFormat: "%Y",
64 | };
65 |
66 | const data = {
67 | core,
68 | calendar,
69 | formats,
70 | lang,
71 | };
72 |
73 | export default data;
74 |
--------------------------------------------------------------------------------
/locales/locales/fr.js:
--------------------------------------------------------------------------------
1 | const lang = "fr-FR";
2 |
3 | const calendar = {
4 | monthFull: [
5 | "Janvier",
6 | "Février",
7 | "Mars",
8 | "Avril",
9 | "Mai",
10 | "Juin",
11 | "Juillet",
12 | "Août",
13 | "Septembre",
14 | "Octobre",
15 | "Novembre",
16 | "Décembre",
17 | ],
18 | monthShort: [
19 | "Jan",
20 | "Fév",
21 | "Mar",
22 | "Avr",
23 | "Mai",
24 | "Juin",
25 | "Juil",
26 | "Aôu",
27 | "Sep",
28 | "Oct",
29 | "Nov",
30 | "Déc",
31 | ],
32 | dayFull: [
33 | "Dimanche",
34 | "Lundi",
35 | "Mardi",
36 | "Mercredi",
37 | "Jeudi",
38 | "Vendredi",
39 | "Samedi",
40 | ],
41 | dayShort: ["Dim", "Lun", "Mar", "Mer", "Jeu", "Ven", "Sam"],
42 | hours: "Heures",
43 | minutes: "Minutes",
44 | done: "Fini",
45 | clear: "Effacer",
46 | today: "Aujourd'hui",
47 |
48 | weekStart: 1,
49 | clockFormat: 24,
50 | };
51 |
52 | const core = {
53 | ok: "OK",
54 | cancel: "Annuler",
55 | select: "Sélectionner",
56 | "No data": "Pas de données",
57 | };
58 |
59 | const formats = {
60 | timeFormat: "%H:%i",
61 | dateFormat: "%d/%m/%Y",
62 | monthYearFormat: "%F %Y",
63 | yearFormat: "%Y",
64 | };
65 |
66 | const data = {
67 | core,
68 | calendar,
69 | formats,
70 | lang,
71 | };
72 |
73 | export default data;
74 |
--------------------------------------------------------------------------------
/locales/locales/it.js:
--------------------------------------------------------------------------------
1 | const lang = "it-IT";
2 |
3 | const calendar = {
4 | monthFull: [
5 | "gennaio",
6 | "febbraio",
7 | "marzo",
8 | "aprile",
9 | "maggio",
10 | "giugno",
11 | "luglio",
12 | "agosto",
13 | "settembre",
14 | "ottobre",
15 | "novembre",
16 | "dicembre",
17 | ],
18 | monthShort: [
19 | "gen",
20 | "feb",
21 | "mar",
22 | "apr",
23 | "mag",
24 | "giu",
25 | "lug",
26 | "ago",
27 | "set",
28 | "ott",
29 | "nov",
30 | "dic",
31 | ],
32 | dayFull: [
33 | "domenica",
34 | "lunedì",
35 | "martedì",
36 | "mercoledì",
37 | "giovedì",
38 | "venerdì",
39 | "sabato",
40 | ],
41 | dayShort: ["dom", "lun", "mar", "mer", "gio", "ven", "sab"],
42 | hours: "Orario",
43 | minutes: "Minuti",
44 | done: "Pronto",
45 | clear: "Pulisci",
46 | today: "Oggi",
47 |
48 | weekStart: 1,
49 | clockFormat: 24,
50 | };
51 |
52 | const core = {
53 | ok: "OK",
54 | cancel: "Annullare",
55 | select: "Seleziona",
56 | "No data": "Nessun dato",
57 | };
58 |
59 | const formats = {
60 | timeFormat: "%H:%i",
61 | dateFormat: "%d/%m/%Y",
62 | monthYearFormat: "%F %Y",
63 | yearFormat: "%Y",
64 | };
65 |
66 | const data = {
67 | core,
68 | calendar,
69 | formats,
70 | lang,
71 | };
72 |
73 | export default data;
74 |
--------------------------------------------------------------------------------
/locales/locales/ja.js:
--------------------------------------------------------------------------------
1 | const lang = "ja-JP";
2 |
3 | const calendar = {
4 | monthFull: [
5 | "1月",
6 | "2月",
7 | "3月",
8 | "4月",
9 | "5月",
10 | "6月",
11 | "7月",
12 | "8月",
13 | "9月",
14 | "10月",
15 | "11月",
16 | "12月",
17 | ],
18 | monthShort: [
19 | "1月",
20 | "2月",
21 | "3月",
22 | "4月",
23 | "5月",
24 | "6月",
25 | "7月",
26 | "8月",
27 | "9月",
28 | "10月",
29 | "11月",
30 | "12月",
31 | ],
32 | dayFull: [
33 | "日曜日",
34 | "月曜日",
35 | "火曜日",
36 | "水曜日",
37 | "木曜日",
38 | "金曜日",
39 | "土曜日",
40 | ],
41 | dayShort: ["日", "月", "火", "水", "木", "金", "土"],
42 | hours: "営業時間",
43 | minutes: "分",
44 | done: "レディー",
45 | clear: "削除する",
46 | today: "今日",
47 |
48 | weekStart: 1,
49 | clockFormat: 24,
50 | };
51 |
52 | const core = {
53 | ok: "OK",
54 | cancel: "取り消す",
55 | select: "選択",
56 | "No data": "データが見つかりませんでした",
57 | };
58 |
59 | const formats = {
60 | timeFormat: "%H:%i",
61 | dateFormat: "%Y年%m月%d日",
62 | monthYearFormat: "%m月%Y年",
63 | yearFormat: "%Y年",
64 | };
65 |
66 | const data = {
67 | core,
68 | calendar,
69 | formats,
70 | lang,
71 | };
72 |
73 | export default data;
74 |
--------------------------------------------------------------------------------
/locales/locales/pt.js:
--------------------------------------------------------------------------------
1 | const lang = "pt-PT";
2 |
3 | const calendar = {
4 | monthFull: [
5 | "Janeiro",
6 | "Fevereiro",
7 | "Março",
8 | "Abril",
9 | "Maio",
10 | "Junho",
11 | "Julho",
12 | "Agosto",
13 | "Setembro",
14 | "Outubro",
15 | "Novembro",
16 | "Dezembro",
17 | ],
18 | monthShort: [
19 | "Jan",
20 | "Fev",
21 | "Mar",
22 | "Abr",
23 | "Mai",
24 | "Jun",
25 | "Jul",
26 | "Ago",
27 | "Set",
28 | "Out",
29 | "Nov",
30 | "Dez",
31 | ],
32 | dayFull: [
33 | "Domingo",
34 | "Segunda-Feira",
35 | "Terça-Feira",
36 | "Quarta-Feira",
37 | "Quinta-Feira",
38 | "Sexta-Feira",
39 | "Sábado",
40 | ],
41 | dayShort: ["Dom", "Seg", "Ter", "Qua", "Qui", "Sex", "Sáb"],
42 | hours: "Horas",
43 | minutes: "Minutos",
44 | done: "Feito",
45 | clear: "Limpar",
46 | today: "Hoje",
47 |
48 | weekStart: 1,
49 | clockFormat: 24,
50 | };
51 |
52 | const core = {
53 | ok: "OK",
54 | cancel: "Cancelar",
55 | select: "Selecionar",
56 | "No data": "Sem dados",
57 | };
58 |
59 | const formats = {
60 | timeFormat: "%H:%i",
61 | dateFormat: "%d/%m/%Y",
62 | monthYearFormat: "%F %Y",
63 | yearFormat: "%Y",
64 | };
65 |
66 | const data = {
67 | core,
68 | calendar,
69 | formats,
70 | lang,
71 | };
72 |
73 | export default data;
74 |
--------------------------------------------------------------------------------
/locales/locales/ru.js:
--------------------------------------------------------------------------------
1 | const lang = "ru-RU";
2 |
3 | const calendar = {
4 | monthFull: [
5 | "Январь",
6 | "Февраль",
7 | "Март",
8 | "Апрель",
9 | "Maй",
10 | "Июнь",
11 | "Июль",
12 | "Август",
13 | "Сентябрь",
14 | "Oктябрь",
15 | "Ноябрь",
16 | "Декабрь",
17 | ],
18 | monthShort: [
19 | "Янв",
20 | "Фев",
21 | "Maр",
22 | "Aпр",
23 | "Maй",
24 | "Июн",
25 | "Июл",
26 | "Aвг",
27 | "Сен",
28 | "Окт",
29 | "Ноя",
30 | "Дек",
31 | ],
32 | dayFull: [
33 | "Воскресенье",
34 | "Понедельник",
35 | "Вторник",
36 | "Среда",
37 | "Четверг",
38 | "Пятница",
39 | "Суббота",
40 | ],
41 | dayShort: ["Вс", "Пн", "Вт", "Ср", "Чт", "Пт", "Сб"],
42 | hours: "Часы",
43 | minutes: "Минуты",
44 | done: "Гoтовo",
45 | clear: "Очистить",
46 | today: "Сегодня",
47 |
48 | weekStart: 1,
49 | clockFormat: 24,
50 | };
51 |
52 | const core = {
53 | ok: "OK",
54 | cancel: "Отмена",
55 | select: "Выбрать",
56 | "No data": "Нет данных",
57 | };
58 |
59 | const formats = {
60 | timeFormat: "%H:%i",
61 | dateFormat: "%d.%m.%Y",
62 | monthYearFormat: "%F %Y",
63 | yearFormat: "%Y",
64 | };
65 |
66 | const data = {
67 | core,
68 | calendar,
69 | formats,
70 | lang,
71 | };
72 |
73 | export default data;
74 |
--------------------------------------------------------------------------------
/locales/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "wx-core-locales",
3 | "version": "2.1.1",
4 | "description": "Locales for WX Core widgets",
5 | "type": "module",
6 | "main": "index.js",
7 | "scripts": {
8 | "build": "true",
9 | "test": "echo \"Error: no test specified\" && exit 1"
10 | },
11 | "keywords": [
12 | "wx",
13 | "locales"
14 | ],
15 | "author": "",
16 | "license": "MIT"
17 | }
18 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "private": true,
3 | "name": "wx-core",
4 | "workspaces": [
5 | "svelte",
6 | "locales",
7 | "site"
8 | ],
9 | "scripts": {
10 | "build:deps": "true",
11 | "build:site": "cd site && yarn build",
12 | "build:tests": "cd svelte && yarn build:tests",
13 | "build": "cd svelte && yarn build",
14 | "lint": "yarn eslint ./svelte/src ./svelte/demos ./locales",
15 | "prepare": "husky",
16 | "start:demos": "cd svelte && yarn start",
17 | "start:site": "cd site && yarn start",
18 | "start:tests": "cd svelte && yarn start:tests",
19 | "start": "cd svelte && yarn start",
20 | "test:cypress": "cd svelte && yarn test:cypress",
21 | "test": "true"
22 | },
23 | "devDependencies": {
24 | "@sveltejs/vite-plugin-svelte": "4.0.0",
25 | "@vitest/coverage-v8": "1.6.0",
26 | "wx-vite-tools": "1.0.5",
27 | "autoprefixer": "10.4.20",
28 | "cypress": "13.6.4",
29 | "eslint": "9.14.0",
30 | "eslint-config-prettier": "9.1.0",
31 | "eslint-plugin-cypress": "4.1.0",
32 | "eslint-plugin-svelte": "2.46.0",
33 | "eslint-plugin-vitest": "0.5.4",
34 | "husky": "9.1.6",
35 | "lint-staged": "15.2.10",
36 | "npm-run-all": "4.1.5",
37 | "postcss": "8.4.47",
38 | "prettier": "3.3.3",
39 | "prettier-plugin-svelte": "3.2.7",
40 | "rollup-plugin-visualizer": "5.12.0",
41 | "shx": "0.3.4",
42 | "svelte": "5.1.9",
43 | "svelte-spa-router": "4.0.1",
44 | "typescript-eslint": "8.13.0",
45 | "typescript": "5.6.3",
46 | "vite-plugin-conditional-compile": "1.4.5",
47 | "vite-plugin-dts": "3.7.2",
48 | "vite": "5.4.10",
49 | "vitest": "1.5.0"
50 | },
51 | "lint-staged": {
52 | "*.{ts,js,svelte}": [
53 | "eslint --fix --no-warn-ignored",
54 | "prettier --write"
55 | ],
56 | "*.{css,md,json}": [
57 | "prettier --write"
58 | ]
59 | }
60 | }
61 |
--------------------------------------------------------------------------------
/readme.md:
--------------------------------------------------------------------------------
1 |
2 |
3 | # SVAR Svelte Core | UI Library
4 |
5 |
6 |
7 |
8 |
9 | :globe_with_meridians: [Website](https://svar.dev/svelte/core/) • :bulb: [Getting Started](https://docs.svar.dev/svelte/core/getting_started/) • :eyes: [Demos](https://docs.svar.dev/svelte/core/samples/#/calendar/willow)
10 |
11 |
12 |
13 |
14 |
15 | [](https://www.npmjs.com/package/wx-svelte-core)
16 | [](https://github.com/svar-widgets/core/blob/main/license.txt)
17 | [](https://www.npmjs.com/package/wx-svelte-core)
18 |
19 |
20 |
21 | **SVAR Svelte Core** library offers a set of 20+ ready-made Svelte UI components: form controls, popups, date and time picker, toast notifications, and more.
22 | All components are lightweight, responsive, fast-performing, and available in light and dark skins.
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 | SVAR Core library includes the following components:
33 | - buttons & form controls,
34 | - calendar (datepicker),
35 | - popups,
36 | - notifications,
37 | - sliding sidebar,
38 | - tabs, and more.
39 |
40 |
41 | Additionally, you can use these SVAR Svelte components to build unified app interfaces:
42 | - [Menu](https://github.com/svar-widgets/menu) - helps you create basic menu bar, actions or context menu;
43 | - [Toolbar](https://github.com/svar-widgets/toolbar) - allows you to create button and icon panels with configurable layouts;
44 | - [Tasklist](https://github.com/svar-widgets/tasklist) - task list component to add, edit, check or delete tasks;
45 | - [Comments](https://github.com/svar-widgets/comments) - nice-looking comments section;
46 | - [File uploader](https://github.com/svar-widgets/uploader) - simple file uploader component.
47 |
48 | ### :hammer_and_wrench: How to Use
49 |
50 | To start using components from the **Core** package, simply import the package and include the desired component in your Svelte file:
51 |
52 | ```svelte
53 |
56 |
57 | Click me
58 | ```
59 |
60 | See the [getting started guide](https://docs.svar.dev/svelte/core/getting_started/) to quickly set up and begin using SVAR Core components in your Svelte projects.
61 |
62 | ### :computer: How to Modify
63 |
64 | Typically, you don't need to modify the code. However, if you wish to do so, follow these steps:
65 |
66 | 1. Run `yarn` to install dependencies. Note that this project is a monorepo using `yarn` workspaces, so npm will not work
67 | 2. Start the project in development mode with `yarn start`
68 |
69 | ### :white_check_mark: Run Tests
70 |
71 | To run the test:
72 |
73 | 1. Start the test examples with:
74 | ```sh
75 | yarn start:tests
76 | ```
77 | 2. In a separate console, run the end-to-end tests with:
78 | ```sh
79 | yarn test:cypress
80 | ```
81 |
82 | ### :speech_balloon: Need Help?
83 |
84 | [Post an Issue](https://github.com/svar-widgets/core/issues/) or use our [community forum](https://forum.svar.dev).
85 |
--------------------------------------------------------------------------------
/site/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Svelte Widgets
7 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/site/index.js:
--------------------------------------------------------------------------------
1 | import Demo from "./src/Demo.svelte";
2 | import { mount } from "svelte";
3 |
4 | mount(Demo, {
5 | target: document.querySelector("#wx_demo_area") || document.body,
6 | });
7 |
--------------------------------------------------------------------------------
/site/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "wx-site-svelte-core",
3 | "version": "2.1.1",
4 | "type": "module",
5 | "scripts": {
6 | "build": "vite build",
7 | "lint": "yarn eslint ./src",
8 | "start": "yarn vite --open"
9 | },
10 | "license": "MIT",
11 | "dependencies": {
12 | "wx-svelte-core": "2.1.1"
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/site/public/assets/avatars/avatar01.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/svar-widgets/core/1e09ae4e45180ebd91f69613ff078aa4a1364cb8/site/public/assets/avatars/avatar01.png
--------------------------------------------------------------------------------
/site/public/assets/avatars/avatar04.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/svar-widgets/core/1e09ae4e45180ebd91f69613ff078aa4a1364cb8/site/public/assets/avatars/avatar04.png
--------------------------------------------------------------------------------
/site/public/assets/avatars/avatar05.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/svar-widgets/core/1e09ae4e45180ebd91f69613ff078aa4a1364cb8/site/public/assets/avatars/avatar05.png
--------------------------------------------------------------------------------
/site/public/assets/avatars/avatar06.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/svar-widgets/core/1e09ae4e45180ebd91f69613ff078aa4a1364cb8/site/public/assets/avatars/avatar06.png
--------------------------------------------------------------------------------
/site/public/assets/avatars/avatar07.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/svar-widgets/core/1e09ae4e45180ebd91f69613ff078aa4a1364cb8/site/public/assets/avatars/avatar07.png
--------------------------------------------------------------------------------
/site/public/assets/avatars/avatar09.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/svar-widgets/core/1e09ae4e45180ebd91f69613ff078aa4a1364cb8/site/public/assets/avatars/avatar09.png
--------------------------------------------------------------------------------
/site/public/assets/avatars/avatar10.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/svar-widgets/core/1e09ae4e45180ebd91f69613ff078aa4a1364cb8/site/public/assets/avatars/avatar10.png
--------------------------------------------------------------------------------
/site/public/assets/icons/Willow.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/site/public/assets/icons/Willow_dark.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/site/src/CustomCoreWidgets.svelte:
--------------------------------------------------------------------------------
1 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
46 |
--------------------------------------------------------------------------------
/site/src/Demo.svelte:
--------------------------------------------------------------------------------
1 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 | {#if themeSelect}
25 |
36 | {:else}
37 |
38 | {/if}
39 |
40 |
41 |
42 |
43 |
76 |
--------------------------------------------------------------------------------
/site/src/Main.svelte:
--------------------------------------------------------------------------------
1 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
46 |
--------------------------------------------------------------------------------
/site/src/ThemeSelect.svelte:
--------------------------------------------------------------------------------
1 |
22 |
23 |
24 |
25 | {#snippet children(option)}
26 |
27 |
31 |
{option.label}
32 |
33 |
51 | {/snippet}
52 |
53 |
54 |
--------------------------------------------------------------------------------
/site/src/components/CalendarUploader.svelte:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
7 |
11 |
12 |
13 |
32 |
--------------------------------------------------------------------------------
/site/src/components/CustomThemeSelect.svelte:
--------------------------------------------------------------------------------
1 |
28 |
29 |
30 |
31 |
32 |
33 |
44 |
--------------------------------------------------------------------------------
/site/src/components/Icons/LockIcon.svelte:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
--------------------------------------------------------------------------------
/site/src/components/RadioCheckboxes.svelte:
--------------------------------------------------------------------------------
1 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
52 |
--------------------------------------------------------------------------------
/site/src/components/SearchList.svelte:
--------------------------------------------------------------------------------
1 |
19 |
20 |
21 |
27 |
28 | {#each employeesFiltered as employee (employee.id)}
29 |
30 |
31 | {#if employee.avatar}
32 |
33 | {:else}
34 |
35 | {employee.firstName[0]}
36 |
37 | {/if}
38 |
39 |
40 | {employee.firstName} {employee.lastName}
43 | {positions.find(p => p.id === employee.position)
45 | .name}
47 |
48 |
49 | {/each}
50 |
51 |
52 |
53 |
121 |
--------------------------------------------------------------------------------
/site/src/components/Topbar.svelte:
--------------------------------------------------------------------------------
1 |
16 |
17 |
18 |
19 |
20 |
21 |
26 | {#snippet children({ option })}
27 | {option.name}
28 | {/snippet}
29 |
30 |
31 |
32 | {#each employees.slice(0, 6) as employee (employee.id)}
33 | {#if employee.avatar}
34 |
35 |
36 |
37 | {/if}
38 | {/each}
39 |
+3
40 |
41 |
42 | Button
43 |
44 |
45 |
46 |
47 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
124 |
--------------------------------------------------------------------------------
/site/src/data/index.js:
--------------------------------------------------------------------------------
1 | export const getData = () => {
2 | const employees = [
3 | {
4 | id: 1,
5 | firstName: "Bethany",
6 | lastName: "Williams",
7 | avatar: "./assets/avatars/avatar04.png",
8 | position: 1,
9 | },
10 | {
11 | id: 2,
12 | firstName: "Alice",
13 | lastName: "Smith",
14 | avatar: "",
15 | position: 2,
16 | },
17 | {
18 | id: 3,
19 | firstName: "John",
20 | lastName: "Doe",
21 | avatar: "./assets/avatars/avatar09.png",
22 | position: 3,
23 | },
24 | {
25 | id: 4,
26 | firstName: "Mary",
27 | lastName: "Johnson",
28 | avatar: "./assets/avatars/avatar06.png",
29 | position: 4,
30 | },
31 | {
32 | id: 5,
33 | firstName: "Martha",
34 | lastName: "Cooper",
35 | avatar: "./assets/avatars/avatar05.png",
36 | position: 5,
37 | },
38 | {
39 | id: 6,
40 | firstName: "Daniel",
41 | lastName: "Clark",
42 | avatar: "./assets/avatars/avatar01.png",
43 | position: 6,
44 | },
45 | {
46 | id: 7,
47 | firstName: "Laura",
48 | lastName: "Turner",
49 | avatar: "./assets/avatars/avatar07.png",
50 | position: 7,
51 | },
52 | {
53 | id: 8,
54 | firstName: "Mary",
55 | lastName: "Turner",
56 | avatar: "./assets/avatars/avatar10.png",
57 | position: 8,
58 | },
59 | ];
60 |
61 | const positions = [
62 | {
63 | id: 1,
64 | name: "Database Analyst",
65 | },
66 | {
67 | id: 2,
68 | name: "Web Developer",
69 | },
70 | {
71 | id: 3,
72 | name: "Cyber Secuirity Specialist",
73 | },
74 | {
75 | id: 4,
76 | name: "Business Analyst",
77 | },
78 | {
79 | id: 5,
80 | name: "Tech Support",
81 | },
82 | {
83 | id: 6,
84 | name: "Database Analyst",
85 | },
86 | {
87 | id: 7,
88 | name: "Data Scientist",
89 | },
90 | {
91 | id: 8,
92 | name: "Product Manager",
93 | },
94 | ];
95 | const segmentedOptions = [
96 | { id: 1, name: "Basic info", icon: "wxi-account" },
97 | { id: 2, name: "Security" },
98 | ];
99 |
100 | const location = [
101 | { id: 1, name: "On-site" },
102 | { id: 2, name: "Hybrid" },
103 | { id: 3, name: "Remote" },
104 | ];
105 |
106 | const SVR = [
107 | { label: "React", id: 1 },
108 | { label: "Svelte", id: 2 },
109 | { label: "Vue", id: 3 },
110 | ];
111 |
112 | const core = [
113 | { id: 1, label: "Calendar" },
114 | { id: 2, label: "Input" },
115 | { id: 3, label: "Button" },
116 | { id: 4, label: "Uploader" },
117 | { id: 5, label: "Tabs" },
118 | { id: 6, label: "Notice" },
119 | { id: 7, label: "Timepicker" },
120 | { id: 8, label: "Slider" },
121 | ];
122 |
123 | const countries = [
124 | { id: 1, name: "Poland" },
125 | { id: 2, name: "Germany" },
126 | { id: 3, name: "United Stated" },
127 | { id: 4, name: "Great Britain" },
128 | { id: 5, name: "France" },
129 | { id: 6, name: "Italy" },
130 | ];
131 |
132 | return {
133 | employees,
134 | positions,
135 | segmentedOptions,
136 | location,
137 | SVR,
138 | core,
139 | countries,
140 | };
141 | };
142 |
--------------------------------------------------------------------------------
/site/svelte.config.js:
--------------------------------------------------------------------------------
1 | import { vitePreprocess } from "@sveltejs/vite-plugin-svelte";
2 |
3 | export default {
4 | // Consult https://svelte.dev/docs#compile-time-svelte-preprocess
5 | // for more information about preprocessors
6 | preprocess: vitePreprocess(),
7 | };
8 |
--------------------------------------------------------------------------------
/site/vite.config.js:
--------------------------------------------------------------------------------
1 | import { resolve } from "path";
2 | import { svelte } from "@sveltejs/vite-plugin-svelte";
3 |
4 | export default () => {
5 | let build,
6 | publicDir = resolve(__dirname, "public"),
7 | server = {},
8 | base = "",
9 | plugins = [svelte({})];
10 |
11 | build = {
12 | rollupOptions: {
13 | input: { index: resolve(__dirname, "index.html") },
14 | },
15 | };
16 |
17 | return {
18 | base,
19 | build,
20 | publicDir,
21 | resolve: { dedupe: ["svelte"] },
22 | plugins,
23 | server,
24 | };
25 | };
26 |
--------------------------------------------------------------------------------
/svelte/.gitignore:
--------------------------------------------------------------------------------
1 | dist
2 | cypress/screenshots
3 | cypress/videos
4 |
--------------------------------------------------------------------------------
/svelte/cypress.config.js:
--------------------------------------------------------------------------------
1 | import { defineConfig } from "cypress";
2 |
3 | export default defineConfig({
4 | video: false,
5 | e2e: {
6 | setupNodeEvents() {},
7 | },
8 | });
9 |
--------------------------------------------------------------------------------
/svelte/cypress/e2e/demos.cy.js:
--------------------------------------------------------------------------------
1 | const cases = [
2 | "/textarea/:skin",
3 | "/button/:skin",
4 | "/calendar/:skin",
5 | "/month/:skin",
6 | "/checkbox/:skin",
7 | "/colorpicker/:skin",
8 | "/colorselect/:skin",
9 | "/combo/:skin",
10 | "/datepicker/:skin",
11 | "/daterangepicker/:skin",
12 | "/field/:skin",
13 | "/locales/:skin",
14 | "/messages/:skin",
15 | "/multicombo/:skin",
16 | "/range/:skin",
17 | "/pager/:skin",
18 | "/popup/:skin",
19 | "/radio/:skin",
20 | "/richselect/:skin",
21 | "/segmented/:skin",
22 | "/select/:skin",
23 | "/slider/:skin",
24 | "/switch/:skin",
25 | "/tabs/:skin",
26 | "/inputs/:skin",
27 | "/timepicker/:skin",
28 | "/twostate/:skin",
29 | "/icon/:skin",
30 | "/sidearea/:skin",
31 | "/modalarea/:skin",
32 | ];
33 | const skins = ["material", "willow", "willow-dark"];
34 | const links = [];
35 |
36 | cases.forEach(w => {
37 | skins.forEach(s => {
38 | links.push(w.replace(":skin", s));
39 | });
40 | });
41 |
42 | context("Basic functionality", () => {
43 | it("widget", () => {
44 | links.forEach(w => {
45 | cy.visit(`/index.html#${w}`);
46 | cy.shot(w, { area: ".content" });
47 | });
48 | });
49 | });
50 |
--------------------------------------------------------------------------------
/svelte/cypress/fixtures/example.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "Using fixtures to represent data",
3 | "email": "hello@cypress.io",
4 | "body": "Fixtures are a great way to mock data for responses to routes"
5 | }
6 |
--------------------------------------------------------------------------------
/svelte/cypress/support/commands.js:
--------------------------------------------------------------------------------
1 | Cypress.Commands.add("shot", (...args) => {
2 | // eslint-disable-next-line cypress/no-unnecessary-waiting
3 | cy.wait(100);
4 |
5 | const name = args.filter(a => typeof a !== "object").join("-");
6 | const conf =
7 | typeof args[args.length - 1] === "object" ? args[args.length - 1] : {};
8 | const sconf = { ...conf, overwrite: true };
9 |
10 | if (conf.area) cy.get(conf.area).screenshot(name, sconf);
11 | else cy.screenshot(name, sconf);
12 | });
13 |
--------------------------------------------------------------------------------
/svelte/cypress/support/e2e.js:
--------------------------------------------------------------------------------
1 | // ***********************************************************
2 | // This example support/index.js is processed and
3 | // loaded automatically before your test files.
4 | //
5 | // This is a great place to put global configuration and
6 | // behavior that modifies Cypress.
7 | //
8 | // You can change the location of this file or turn off
9 | // automatically serving support files with the
10 | // 'supportFile' configuration option.
11 | //
12 | // You can read more here:
13 | // https://on.cypress.io/configuration
14 | // ***********************************************************
15 |
16 | // Import commands.js using ES2015 syntax:
17 | import "./commands";
18 |
19 | // Alternatively you can use CommonJS syntax:
20 | // require('./commands')
21 |
--------------------------------------------------------------------------------
/svelte/demos/cases/Area.svelte:
--------------------------------------------------------------------------------
1 |
5 |
6 |
7 |
Area with a top label
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
25 |
26 |
27 |
28 |
29 |
Area with a side label
30 |
31 |
32 |
33 |
34 |
--------------------------------------------------------------------------------
/svelte/demos/cases/Basic.svelte:
--------------------------------------------------------------------------------
1 |
13 |
14 |
15 |
Buttons
16 | Primary
17 | Secondary
18 | Danger
19 |
20 |
21 |
22 |
Segmented
23 |
31 |
32 |
33 |
34 |
Calendar
35 |
36 |
37 |
38 |
39 |
--------------------------------------------------------------------------------
/svelte/demos/cases/Buttons.svelte:
--------------------------------------------------------------------------------
1 |
13 |
14 |
15 |
Default button
16 | Click Me
17 | Click Me
18 |
19 |
20 |
21 |
Primary button
22 | Click Me
23 | Click Me
24 |
25 |
26 |
27 |
Secondary button
28 | Click Me
29 | Click Me
30 |
31 |
32 |
33 |
Danger button
34 | Click Me
35 | Click Me
36 |
37 |
38 |
39 |
Link button
40 |
41 | Click Me
42 |
43 |
44 | Click Me
45 |
46 |
47 | Click Me
48 |
49 |
50 |
51 |
52 |
Block buttons
53 |
54 | Click Me
55 |
56 |
57 | Click Me
58 |
59 |
60 | Click Me
61 |
62 | Click Me
63 |
64 |
65 |
66 |
67 |
Icon buttons
68 | With Icon
69 | With Icon
70 | With Icon
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
Multi-line button
80 |
81 | Click me a few times
82 |
83 |
84 |
--------------------------------------------------------------------------------
/svelte/demos/cases/Calendar.svelte:
--------------------------------------------------------------------------------
1 |
15 |
16 |
17 |
Calendar
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
Calendar with Locale and Format
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
Calendar without buttons
51 |
52 |
53 |
--------------------------------------------------------------------------------
/svelte/demos/cases/Checkbox.svelte:
--------------------------------------------------------------------------------
1 |
23 |
24 |
25 |
Checkbox
26 | Value:
27 | {v1}
28 |
29 |
30 |
31 | Value:
32 | {v2}
33 |
34 |
35 |
36 |
37 |
38 |
39 |
Checkbox with a side label
40 |
41 | {#snippet children({ id })}
42 |
43 | {/snippet}
44 |
45 |
46 | {#snippet children({ id })}
47 |
48 | {/snippet}
49 |
50 |
51 | {#snippet children({ id })}
52 |
53 | {/snippet}
54 |
55 |
56 |
57 |
58 |
Checkbox group: {print(valueGroup1)}
59 |
60 |
61 |
62 |
63 |
64 |
65 |
Checkbox group inline: {print(valueGroup2)}
66 |
67 |
68 |
69 |
70 |
71 |
72 |
Checkbox group grid: {print(valueGroup3)}
73 |
74 |
75 |
76 |
77 |
--------------------------------------------------------------------------------
/svelte/demos/cases/ColorPicker.svelte:
--------------------------------------------------------------------------------
1 |
7 |
8 |
9 |
The current color: {value || ""}
10 |
11 |
12 |
13 |
The selected form color: {selectedColor || ""}
14 |
15 |
16 |
17 |
18 |
19 |
20 |
Custom color select forms:
21 |
22 | {#snippet children({ id })}
23 |
24 | {/snippet}
25 |
26 |
27 | {#snippet children({ id })}
28 |
34 | {/snippet}
35 |
36 |
37 | {#snippet children({ id })}
38 |
39 | {/snippet}
40 |
41 |
42 | {#snippet children({ id })}
43 |
49 | {/snippet}
50 |
51 |
52 |
--------------------------------------------------------------------------------
/svelte/demos/cases/ColorSelect.svelte:
--------------------------------------------------------------------------------
1 |
6 |
7 |
8 |
The selected color: {color ? color : ""}
9 |
10 | {#snippet children({ id })}
11 |
16 | {/snippet}
17 |
18 |
19 |
20 |
21 |
Custom colors
22 |
23 | {#snippet children({ id })}
24 |
29 | {/snippet}
30 |
31 |
32 | {#snippet children({ id })}
33 |
40 | {/snippet}
41 |
42 |
43 | {#snippet children({ id })}
44 |
50 | {/snippet}
51 |
52 |
53 |
54 |
55 |
Clear icon
56 |
57 | {#snippet children({ id })}
58 |
64 | {/snippet}
65 |
66 |
67 |
--------------------------------------------------------------------------------
/svelte/demos/cases/Combo.svelte:
--------------------------------------------------------------------------------
1 |
28 |
29 |
30 |
Combo with a simple list
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
Combo with a dynamic value
43 |
44 | Change the value
45 |
46 |
47 |
48 |
49 |
50 |
51 |
Combo with a side label
52 |
53 | {#snippet children({ id })}
54 |
55 | {/snippet}
56 |
57 |
58 |
59 |
60 |
Combo with a template
61 |
62 |
63 | {#snippet children({ option })}
64 |
65 | {/snippet}
66 |
67 |
68 |
69 |
70 |
71 |
Combo with a custom "textField"
72 |
73 |
74 |
75 |
76 |
77 |
78 |
Combo without a value
79 |
80 |
81 |
82 |
83 |
84 |
85 |
Combo without options
86 |
87 |
88 |
89 |
90 |
91 |
92 |
Combo with clear button
93 |
94 |
95 |
96 |
97 |
98 |
99 |
Combo with hidden options
100 |
101 |
107 |
108 |
109 |
--------------------------------------------------------------------------------
/svelte/demos/cases/Counter.svelte:
--------------------------------------------------------------------------------
1 |
12 |
13 |
14 |
15 | {#snippet children({ id })}
16 |
17 | {/snippet}
18 |
19 |
20 |
21 | {#snippet children({ id })}
22 |
23 | The value is: {v1}
24 | {/snippet}
25 |
26 |
27 |
28 | {#snippet children({ id })}
29 |
30 | {/snippet}
31 |
32 |
33 |
34 | {#snippet children({ id })}
35 |
36 | {/snippet}
37 |
38 |
39 |
40 | {#snippet children({ id })}
41 |
42 | {/snippet}
43 |
44 |
45 |
46 | {#snippet children({ id })}
47 |
48 | The value is: {v4}
49 | {/snippet}
50 |
51 |
52 |
53 | {#snippet children({ id })}
54 |
55 | {/snippet}
56 |
57 |
58 |
59 | {#snippet children({ id })}
60 |
61 | {/snippet}
62 |
63 |
64 |
65 | {#snippet children({ id })}
66 |
67 | {/snippet}
68 |
69 |
70 |
--------------------------------------------------------------------------------
/svelte/demos/cases/DatePicker.svelte:
--------------------------------------------------------------------------------
1 |
16 |
17 |
18 |
Datepicker
19 |
20 | {#snippet children({ id })}
21 |
22 | {/snippet}
23 |
24 |
25 | {#snippet children({ id })}
26 |
27 | {/snippet}
28 |
29 |
30 | {#snippet children({ id })}
31 |
32 | {/snippet}
33 |
34 |
35 | {#snippet children({ id })}
36 |
37 | {/snippet}
38 |
39 |
40 | {#snippet children({ id })}
41 |
42 | {/snippet}
43 |
44 |
45 | {#snippet children({ id })}
46 |
47 | {/snippet}
48 |
49 |
50 | {#snippet children({ id })}
51 |
56 | {/snippet}
57 |
58 |
59 | {#snippet children({ id })}
60 |
61 | {/snippet}
62 |
63 |
64 | {#snippet children({ id })}
65 |
66 | {/snippet}
67 |
68 |
69 | {#snippet children({ id })}
70 |
71 | {/snippet}
72 |
73 |
74 | {#snippet children({ id })}
75 |
76 | {/snippet}
77 |
78 |
79 | {#snippet children({ id })}
80 |
81 | {/snippet}
82 |
83 |
84 |
--------------------------------------------------------------------------------
/svelte/demos/cases/DateRangePicker.svelte:
--------------------------------------------------------------------------------
1 |
22 |
23 |
24 |
DateRangePicker
25 |
26 | {#snippet children({ id })}
27 |
28 | {/snippet}
29 |
30 |
31 | {#snippet children({ id })}
32 |
33 | {/snippet}
34 |
35 |
36 | {#snippet children({ id })}
37 |
38 | {/snippet}
39 |
40 |
41 | {#snippet children({ id })}
42 |
43 | {/snippet}
44 |
45 |
46 | {#snippet children({ id })}
47 |
53 | {/snippet}
54 |
55 |
56 | {#snippet children({ id })}
57 |
58 | {/snippet}
59 |
60 |
61 |
62 | {#snippet children({ id })}
63 |
64 | {/snippet}
65 |
66 |
67 | {#snippet children({ id })}
68 |
69 | {/snippet}
70 |
71 |
72 | {#snippet children({ id })}
73 |
74 | {/snippet}
75 |
76 |
77 | {#snippet children({ id })}
78 |
79 | {/snippet}
80 |
81 |
82 |
--------------------------------------------------------------------------------
/svelte/demos/cases/Field.svelte:
--------------------------------------------------------------------------------
1 |
6 |
7 |
8 |
Top Fields
9 |
10 | {#snippet children({ id })}
11 |
12 | {/snippet}
13 |
14 |
15 | {#snippet children({ id })}
16 |
17 | {/snippet}
18 |
19 |
20 | {#snippet children({ id })}
21 |
22 | {/snippet}
23 |
24 |
25 |
26 |
27 |
Left Field
28 |
29 | {#snippet children({ id })}
30 |
31 | {/snippet}
32 |
33 |
34 | {#snippet children({ id })}
35 |
36 | {/snippet}
37 |
38 |
39 | {#snippet children({ id })}
40 |
41 | {/snippet}
42 |
43 |
44 |
--------------------------------------------------------------------------------
/svelte/demos/cases/Icon.svelte:
--------------------------------------------------------------------------------
1 |
11 |
12 |
13 |
Icons
14 | {#each arrs as subset}
15 |
16 | {#each subset as icon}
17 |
18 | {/each}
19 |
20 | {/each}
21 |
22 |
--------------------------------------------------------------------------------
/svelte/demos/cases/Locales.svelte:
--------------------------------------------------------------------------------
1 |
37 |
38 |
39 |
40 |
41 |
42 |
43 | {#key lang}
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 | {getFormattedNumber(lang, numValue)}
54 |
55 |
56 | {/key}
57 |
58 |
59 |
76 |
--------------------------------------------------------------------------------
/svelte/demos/cases/Messages.svelte:
--------------------------------------------------------------------------------
1 |
40 |
41 |
42 |
Notice
43 | notice("")}>Show Notice
44 | notice("info")}>Show Info
45 | notice("warning")}>Show Warning
46 | notice("success")}>Show Success
47 | notice("danger")}>Show Danger
48 |
50 | notice("info", "very long text goes here to show word wrap")}
51 | >
52 | Show Long message
53 |
54 |
55 |
56 |
57 |
Confirm / Alert
58 | Show Confirm
59 | Show Alert
60 |
61 |
62 |
63 |
Custom dialog
64 |
(custom1 = !custom1)}>
65 | Show Prompt
66 |
67 | {#if custom1}
68 |
69 |
70 |
71 |
72 |
73 | {/if}
74 |
75 |
(custom2 = !custom2)}>Show Dialog
76 | {#if custom2}
77 |
78 |
79 | Some text here
80 |
81 | {#snippet footer()}
82 |
83 | Yes
84 | No
85 | Maybe
86 |
87 | {/snippet}
88 |
89 |
90 | {/if}
91 |
92 |
93 |
98 |
--------------------------------------------------------------------------------
/svelte/demos/cases/ModalArea.svelte:
--------------------------------------------------------------------------------
1 |
5 |
6 |
7 |
Modal Area
8 |
Click button to show the modal area
9 |
(show = !show)}>Click me
10 | {#if show}
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
To close the modal, click the button below
19 |
(show = false)}>Close
20 |
21 |
22 | {/if}
23 |
24 |
25 |
33 |
--------------------------------------------------------------------------------
/svelte/demos/cases/Month.svelte:
--------------------------------------------------------------------------------
1 |
23 |
24 |
25 |
Month view
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
Calendar with custom size
41 |
42 |
43 |
44 |
68 |
--------------------------------------------------------------------------------
/svelte/demos/cases/MultiCombo.svelte:
--------------------------------------------------------------------------------
1 |
22 |
23 |
24 |
MultiCombo with a simple list
25 |
26 |
27 |
28 |
MultiCombo with checkboxes
29 |
30 |
31 |
32 |
33 |
MultiCombo with a side label
34 |
35 | {#snippet children({ id })}
36 |
37 | {/snippet}
38 |
39 |
40 | {#snippet children({ id })}
41 |
42 | {/snippet}
43 |
44 |
45 | {#snippet children({ id })}
46 |
53 | {/snippet}
54 |
55 |
56 |
57 |
58 |
MultiCombo with a template
59 |
60 | {#snippet children({ option })}
61 |
62 | {/snippet}
63 |
64 |
65 |
66 |
67 |
MultiCombo with a custom "textField"
68 |
69 |
70 |
71 |
72 |
MultiCombo without a value
73 |
74 |
75 |
76 |
77 |
MultiCombo without options
78 |
79 |
80 |
81 |
82 |
MultiCombo with hidden options
83 |
84 |
85 |
--------------------------------------------------------------------------------
/svelte/demos/cases/Pager.svelte:
--------------------------------------------------------------------------------
1 |
6 |
7 |
8 |
100 rows (active = {v1})
9 |
10 |
11 |
--------------------------------------------------------------------------------
/svelte/demos/cases/Popup.svelte:
--------------------------------------------------------------------------------
1 |
29 |
30 |
44 |
45 | {#if isOpen}
46 |
47 |
53 |
54 | {/if}
55 |
56 |
67 |
--------------------------------------------------------------------------------
/svelte/demos/cases/Radio.svelte:
--------------------------------------------------------------------------------
1 |
14 |
15 |
16 |
RadioButton
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
RadioButton with side label
25 |
26 | {#snippet children({ id })}
27 |
28 | {/snippet}
29 |
30 |
31 | {#snippet children({ id })}
32 |
33 | {/snippet}
34 |
35 |
36 | {#snippet children({ id })}
37 |
38 | {/snippet}
39 |
40 |
41 | {#snippet children({ id })}
42 |
43 | {/snippet}
44 |
45 |
46 |
47 |
48 |
RadioButton group ( {value} )
49 |
50 |
51 |
52 |
53 |
54 |
55 |
RadioButton group: inline
56 |
57 |
58 |
59 |
60 |
61 |
62 |
RadioButton group: grid
63 |
64 |
65 |
66 |
67 |
--------------------------------------------------------------------------------
/svelte/demos/cases/RangeCalendar.svelte:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
Range Calendar
7 |
8 |
9 |
10 |
11 |
12 |
13 |
Range Calendar without buttons
14 |
15 |
16 |
17 |
18 |
Single month
19 |
20 |
21 |
--------------------------------------------------------------------------------
/svelte/demos/cases/RichSelect.svelte:
--------------------------------------------------------------------------------
1 |
22 |
23 |
24 |
RichSelect with a simple list
25 |
26 |
27 |
28 |
29 |
30 |
31 |
RichSelect with a side label
32 |
33 | {#snippet children({ id })}
34 |
35 | {/snippet}
36 |
37 |
38 | {#snippet children({ id })}
39 |
40 | {/snippet}
41 |
42 |
43 | {#snippet children({ id })}
44 |
51 | {/snippet}
52 |
53 |
54 |
55 |
56 |
RichSelect overflow
57 |
58 |
59 |
60 |
61 | {#snippet children(option)}
62 | {option.label}
63 | {/snippet}
64 |
65 |
66 |
67 |
68 |
69 |
RichSelect with a template
70 |
71 |
72 | {#snippet children(option)}
73 |
74 | {/snippet}
75 |
76 |
77 |
78 |
79 |
80 |
RichSelect with a custom "textField"
81 |
82 |
83 |
84 |
85 |
86 |
87 |
RichSelect without a value
88 |
89 |
90 |
91 |
92 |
93 |
94 |
RichSelect without options
95 |
96 |
97 |
98 |
99 |
100 |
101 |
RichSelect with clear button
102 |
103 |
104 |
105 |
106 |
107 |
108 |
RichSelect with hidden options
109 |
110 |
111 |
112 |
113 |
--------------------------------------------------------------------------------
/svelte/demos/cases/Segmented.svelte:
--------------------------------------------------------------------------------
1 |
25 |
26 |
27 |
Default templates
28 |
29 | Segmented Button
30 |
31 |
32 | Segmented Button with icons
33 |
34 |
35 | Segmented Button with a mixed content
36 |
37 |
38 |
39 |
40 |
Custom templates
41 |
42 | Segmented Button
43 |
44 |
45 | Segmented Button with icons
46 |
47 | {#snippet children({ option })}
48 |
49 | {/snippet}
50 |
51 |
52 | Segmented Button with a mixed content
53 |
54 | {#snippet children({ option })}
55 |
56 | {option.label}
57 | {/snippet}
58 |
59 |
60 |
61 |
74 |
--------------------------------------------------------------------------------
/svelte/demos/cases/Select.svelte:
--------------------------------------------------------------------------------
1 |
8 |
9 |
10 |
Select with a top label
11 |
12 | {#snippet children({ id })}
13 |
14 | {/snippet}
15 |
16 |
17 |
18 |
19 |
Select with a side label
20 |
21 | {#snippet children({ id })}
22 |
23 | {/snippet}
24 |
25 |
26 | {#snippet children({ id })}
27 |
28 | {/snippet}
29 |
30 |
31 | {#snippet children({ id })}
32 |
33 | {/snippet}
34 |
35 |
36 |
--------------------------------------------------------------------------------
/svelte/demos/cases/SideArea.svelte:
--------------------------------------------------------------------------------
1 |
5 |
6 |
7 |
Side Area
8 |
Click button to show the side area
9 |
(show = !show)}>Click me
10 | {#if show}
11 |
(show = false)}>
12 |
13 |
Some content
14 |
15 |
16 |
17 |
18 |
19 | {/if}
20 |
21 |
22 |
29 |
--------------------------------------------------------------------------------
/svelte/demos/cases/Slider.svelte:
--------------------------------------------------------------------------------
1 |
21 |
22 |
23 |
Slider
24 |
25 | {#snippet children({ id })}
26 |
27 | {/snippet}
28 |
29 |
34 | {#snippet children({ id })}
35 |
41 | {/snippet}
42 |
43 |
44 | {#snippet children({ id })}
45 |
51 | {/snippet}
52 |
53 |
54 | {#snippet children({ id })}
55 |
56 | {/snippet}
57 |
58 |
59 | {#snippet children({ id })}
60 |
61 | {/snippet}
62 |
63 |
64 |
--------------------------------------------------------------------------------
/svelte/demos/cases/Switch.svelte:
--------------------------------------------------------------------------------
1 |
7 |
8 |
9 |
Switch Button
10 |
11 |
12 |
13 |
14 |
15 |
16 |
Switch Button with a side label
17 |
18 | {#snippet children({ id })}
19 |
20 | {/snippet}
21 |
22 |
23 | {#snippet children({ id })}
24 |
25 | {/snippet}
26 |
27 |
28 |
--------------------------------------------------------------------------------
/svelte/demos/cases/Tabs.svelte:
--------------------------------------------------------------------------------
1 |
25 |
26 |
27 |
Tabs
28 |
29 |
30 |
31 | {#if active === 0}
32 |
Info
33 | {:else if active === 1}
34 |
About
35 | {:else if active === 2}
36 |
Contact
37 | {:else}
38 |
Check
39 | {/if}
40 |
41 |
42 |
43 |
onchange
44 |
45 |
46 |
47 |
57 |
--------------------------------------------------------------------------------
/svelte/demos/cases/Text.svelte:
--------------------------------------------------------------------------------
1 |
7 |
8 |
9 |
Text with a top label
10 |
11 | {#snippet children({ id })}
12 |
13 | {/snippet}
14 |
15 |
16 | {#snippet children({ id })}
17 |
18 | {/snippet}
19 |
20 |
21 | {#snippet children({ id })}
22 |
23 | {/snippet}
24 |
25 |
26 | {#snippet children({ id })}
27 |
34 | {/snippet}
35 |
36 |
37 |
38 |
39 |
Text with a side label
40 |
41 | {#snippet children({ id })}
42 |
43 | {/snippet}
44 |
45 |
46 | {#snippet children({ id })}
47 |
48 | {/snippet}
49 |
50 |
51 |
52 |
53 |
Number input with a side label
54 |
55 | {#snippet children({ id })}
56 |
57 | {/snippet}
58 |
59 |
60 |
61 |
62 |
Password input with a side label
63 |
64 | {#snippet children({ id })}
65 |
66 | {/snippet}
67 |
68 |
69 |
70 |
71 |
Icon inside of the text control
72 |
73 | {#snippet children({ id })}
74 |
75 | {/snippet}
76 |
77 |
78 | {#snippet children({ id })}
79 |
80 | {/snippet}
81 |
82 |
83 |
84 |
85 |
Text control with clear button
86 |
87 | {#snippet children({ id })}
88 |
89 | {/snippet}
90 |
91 |
92 | {#snippet children({ id })}
93 |
94 | {/snippet}
95 |
96 |
97 | {#snippet children({ id })}
98 |
99 | {/snippet}
100 |
101 |
102 | {#snippet children({ id })}
103 |
110 | {/snippet}
111 |
112 |
113 | {#snippet children({ id })}
114 |
115 | {/snippet}
116 |
117 |
118 | {#snippet children({ id })}
119 |
120 | {/snippet}
121 |
122 |
123 |
--------------------------------------------------------------------------------
/svelte/demos/cases/TextArea.svelte:
--------------------------------------------------------------------------------
1 |
6 |
7 |
8 |
Area with a top label
9 |
10 | {#snippet children({ id })}
11 |
12 | {/snippet}
13 |
14 |
15 | {#snippet children({ id })}
16 |
17 | {/snippet}
18 |
19 |
20 | {#snippet children({ id })}
21 |
22 | {/snippet}
23 |
24 |
25 | {#snippet children({ id })}
26 |
33 | {/snippet}
34 |
35 |
36 |
37 |
38 |
Area with a side label
39 |
40 | {#snippet children({ id })}
41 |
42 | {/snippet}
43 |
44 |
45 |
--------------------------------------------------------------------------------
/svelte/demos/cases/TimePicker.svelte:
--------------------------------------------------------------------------------
1 |
7 |
8 |
9 |
TimePicker
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
TimePicker with a side label
20 |
21 | {#snippet children({ id })}
22 |
23 | {/snippet}
24 |
25 |
26 | {#snippet children({ id })}
27 |
28 | {/snippet}
29 |
30 |
31 | {#snippet children({ id })}
32 |
33 | {/snippet}
34 |
35 |
36 |
37 |
38 |
12-hour TimePicker
39 |
45 |
46 |
47 |
48 |
49 |
50 |
CN locale
51 |
52 |
53 |
54 |
55 |
--------------------------------------------------------------------------------
/svelte/demos/cases/Timepicker.svelte:
--------------------------------------------------------------------------------
1 |
7 |
8 |
9 |
TimePicker
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
TimePicker with a side label
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
12-hour TimePicker
33 |
39 |
40 |
41 |
42 |
43 |
44 |
CN locale
45 |
46 |
47 |
48 |
49 |
--------------------------------------------------------------------------------
/svelte/demos/cases/TwoState.svelte:
--------------------------------------------------------------------------------
1 |
13 |
14 |
15 |
Default TwoState Button
16 | {#snippet active()}
17 | Working...
18 | {/snippet}
19 | Click Me
20 | Click Me
21 |
22 |
23 |
24 |
Primary TwoState Button
25 | Click Me
26 | Click Me
27 |
28 |
29 |
30 |
Secondary TwoState Button
31 | Click Me
32 | Click Me
33 |
34 |
35 |
36 |
Danger TwoState Button
37 | Click Me
38 | Click Me
39 |
40 |
41 |
42 |
Icon TwoState Buttons
43 | With Icon
44 |
45 | With Icon
46 |
47 | With Icon
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
Inactive
57 |
58 | ev.preventDefault()}
62 | >
63 | Inactive
64 |
65 | ev.preventDefault()}
70 | >
71 | Inactive
72 |
73 |
74 |
75 | ev.preventDefault()}
80 | >
81 | Inactive
82 |
83 | ev.preventDefault()}
88 | >
89 | Inactive
90 |
91 |
92 |
93 |
--------------------------------------------------------------------------------
/svelte/demos/common/Link.svelte:
--------------------------------------------------------------------------------
1 |
7 |
8 |
9 | {data[1]}
10 |
11 |
12 |
33 |
--------------------------------------------------------------------------------
/svelte/demos/common/Router.svelte:
--------------------------------------------------------------------------------
1 |
33 |
34 |
35 |
--------------------------------------------------------------------------------
/svelte/demos/common/helpers.js:
--------------------------------------------------------------------------------
1 | import { push } from "svelte-spa-router";
2 | import { wrap } from "svelte-spa-router/wrap";
3 | import { links as raw } from "../routes";
4 |
5 | const routes = {
6 | "/": wrap({
7 | component: {},
8 | conditions: () => {
9 | push("/base/willow");
10 | return false;
11 | },
12 | }),
13 | };
14 |
15 | function getRoutes(skinSettings, cb) {
16 | raw.forEach(
17 | a =>
18 | (routes[a[0]] = wrap({
19 | component: a[2],
20 | userData: a,
21 | props: { ...skinSettings },
22 | conditions: x => {
23 | cb(x.location);
24 | return true;
25 | },
26 | }))
27 | );
28 |
29 | return routes;
30 | }
31 |
32 | function getLinks() {
33 | return raw;
34 | }
35 |
36 | export { push, getRoutes, getLinks };
37 |
--------------------------------------------------------------------------------
/svelte/demos/custom/UserOption.svelte:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
7 |
8 | {#if data.avatar}
9 |
10 | {/if}
11 |
12 |
13 |
14 |
{data.label}
15 |
{data.email || ""}
16 |
17 |
18 |
19 |
58 |
--------------------------------------------------------------------------------
/svelte/demos/data/icons.js:
--------------------------------------------------------------------------------
1 | export const icons = [
2 | "wxi-account",
3 | "wxi-alert",
4 | "wxi-angle-dbl-down",
5 | "wxi-angle-dbl-left",
6 | "wxi-angle-dbl-right",
7 | "wxi-angle-dbl-up",
8 | "wxi-angle-down",
9 | "wxi-angle-left",
10 | "wxi-angle-right",
11 | "wxi-angle-up",
12 | "wxi-arrow-down",
13 | "wxi-arrow-left",
14 | "wxi-arrow-right",
15 | "wxi-arrow-up",
16 | "wxi-arrows-h",
17 | "wxi-arrows-v",
18 | "wxi-asc",
19 | "wxi-assign",
20 | "wxi-bullhorn",
21 | "wxi-calendar",
22 | "wxi-camera",
23 | "wxi-cat",
24 | "wxi-check",
25 | "wxi-clock",
26 | "wxi-close",
27 | "wxi-content-copy",
28 | "wxi-content-cut",
29 | "wxi-content-paste",
30 | "wxi-convert",
31 | "wxi-currency-usd",
32 | "wxi-delete-outline",
33 | "wxi-delete",
34 | "wxi-desc",
35 | "wxi-dots-h",
36 | "wxi-dots-v",
37 | "wxi-download",
38 | "wxi-drag",
39 | "wxi-duplicate",
40 | "wxi-earth",
41 | "wxi-edit-outline",
42 | "wxi-edit",
43 | "wxi-emoticon-outline",
44 | "wxi-empty",
45 | "wxi-external",
46 | "wxi-eye",
47 | "wxi-file-multiple-outline",
48 | "wxi-file",
49 | "wxi-filter-check",
50 | "wxi-filter-multiple-outline",
51 | "wxi-filter-multiple",
52 | "wxi-filter-outline",
53 | "wxi-filter-plus-outline",
54 | "wxi-filter-plus",
55 | "wxi-folder",
56 | "wxi-food-fork-drink",
57 | "wxi-human-handsdown",
58 | "wxi-indent",
59 | "wxi-information-outline",
60 | "wxi-like",
61 | "wxi-loading",
62 | "wxi-map-marker-outline",
63 | "wxi-menu",
64 | "wxi-menu-down",
65 | "wxi-menu-right",
66 | "wxi-message-question-outline",
67 | "wxi-message",
68 | "wxi-paperclip",
69 | "wxi-paste",
70 | "wxi-pin-outline",
71 | "wxi-plus",
72 | "wxi-pound",
73 | "wxi-redo",
74 | "wxi-refresh",
75 | "wxi-rename",
76 | "wxi-search",
77 | "wxi-soccer",
78 | "wxi-sort",
79 | "wxi-split",
80 | "wxi-star-outline",
81 | "wxi-star",
82 | "wxi-subtask",
83 | "wxi-table-column-plus-after",
84 | "wxi-table-row-plus-after",
85 | "wxi-table-row-plus-before",
86 | "wxi-undo",
87 | "wxi-unindent",
88 | "wxi-upload",
89 | "wxi-view-column",
90 | "wxi-view-grid",
91 | "wxi-view-sequential",
92 | ];
93 |
--------------------------------------------------------------------------------
/svelte/demos/data/roles.js:
--------------------------------------------------------------------------------
1 | export const roles = [
2 | { id: 1, name: "Admin" },
3 | { id: 2, name: "Manager" },
4 | { id: 3, name: "Team Lead" },
5 | { id: 4, name: "Reporting" },
6 | { id: 5, name: "Guest" },
7 | ];
8 |
--------------------------------------------------------------------------------
/svelte/demos/data/userlist.js:
--------------------------------------------------------------------------------
1 | export const users = [
2 | {
3 | id: 87,
4 | label: "Berni Mayou",
5 | email: "bern.mayour@mail.com",
6 | avatar: "https://cdn.svar.dev/demos/assets/avatar/503723673.jpg",
7 | },
8 | {
9 | id: 97,
10 | label: "August Dvorak",
11 | email: "dvor.august@gmail.com",
12 | avatar: "https://cdn.svar.dev/demos/assets/avatar/375515968.jpg",
13 | },
14 | {
15 | id: 98,
16 | label: "Elly Soyer",
17 | email: "elly.soyer@example",
18 | avatar: "https://cdn.svar.dev/demos/assets/avatar/909471384.jpg",
19 | },
20 | {
21 | id: 101,
22 | label: "Patrick Roland",
23 | email: "roll.and@gmail.com",
24 | details: "Farmer",
25 | visited: "2020-06-01T14:58:05Z",
26 | registered: "2020-06-01T14:58:05Z",
27 | avatar: "https://cdn.svar.dev/demos/assets/avatar/092352563.jpg",
28 | },
29 | {
30 | id: 102,
31 | label: "Petyr Baelish",
32 | email: "big.finger@gmail.com",
33 | avatar: "https://cdn.svar.dev/demos/assets/avatar/898151818.jpg",
34 | },
35 | {
36 | id: 103,
37 | label: "Ned Stark",
38 | email: "winterhell@gmail.com",
39 | avatar: "https://cdn.svar.dev/demos/assets/avatar/491902305.jpg",
40 | },
41 | {
42 | id: 104,
43 | label: "Lord Varys",
44 | email: "little.birds@gmail.com",
45 | avatar: "https://cdn.svar.dev/demos/assets/avatar/005471511.jpg",
46 | },
47 | {
48 | id: 105,
49 | label: "Daenerys Stormborn Targaryen",
50 | email: "breaker.of.chains@gm.com",
51 | avatar: "https://cdn.svar.dev/demos/assets/avatar/096793420.jpg",
52 | },
53 | {
54 | id: 106,
55 | label: "Francis Bacon",
56 | email: "",
57 | avatar: "https://cdn.svar.dev/demos/assets/avatar/865831461.jpg",
58 | },
59 | {
60 | id: 107,
61 | label: "Jon Snow",
62 | email: "lord.crow@wall.com",
63 | avatar: "https://cdn.svar.dev/demos/assets/avatar/268122171.jpg",
64 | },
65 | {
66 | id: 108,
67 | label: "Tyrion Lannister",
68 | email: "80.y.o.in.bed@casterly",
69 | avatar: "https://cdn.svar.dev/demos/assets/avatar/932427870.jpg",
70 | },
71 | {
72 | id: 109,
73 | label: "Jason",
74 | email: "a.kosmovskiy@gmail.com",
75 | avatar: "",
76 | },
77 | ];
78 |
--------------------------------------------------------------------------------
/svelte/demos/index.js:
--------------------------------------------------------------------------------
1 | import { mount } from "svelte";
2 | import Demos from "./common/Index.svelte";
3 |
4 | mount(Demos, {
5 | target: document.querySelector("#wx_demo_area") || document.body,
6 | });
7 |
--------------------------------------------------------------------------------
/svelte/demos/routes.js:
--------------------------------------------------------------------------------
1 | import Basic from "./cases/Basic.svelte";
2 | import TextArea from "./cases/TextArea.svelte";
3 | import Buttons from "./cases/Buttons.svelte";
4 | import Calendar from "./cases/Calendar.svelte";
5 | import Month from "./cases/Month.svelte";
6 | import RangeCalendar from "./cases/RangeCalendar.svelte";
7 | import Checkbox from "./cases/Checkbox.svelte";
8 | import ColorSelect from "./cases/ColorSelect.svelte";
9 | import ColorPicker from "./cases/ColorPicker.svelte";
10 | import Combo from "./cases/Combo.svelte";
11 | import DatePicker from "./cases/DatePicker.svelte";
12 | import DateRangePicker from "./cases/DateRangePicker.svelte";
13 | import Locales from "./cases/Locales.svelte";
14 | import Messages from "./cases/Messages.svelte";
15 | import TwoState from "./cases/TwoState.svelte";
16 | import Text from "./cases/Text.svelte";
17 | import Counter from "./cases/Counter.svelte";
18 | import MultiCombo from "./cases/MultiCombo.svelte";
19 | import Popup from "./cases/Popup.svelte";
20 | import Radio from "./cases/Radio.svelte";
21 | import RichSelect from "./cases/RichSelect.svelte";
22 | import Select from "./cases/Select.svelte";
23 | import Slider from "./cases/Slider.svelte";
24 | import Tabs from "./cases/Tabs.svelte";
25 | import Switch from "./cases/Switch.svelte";
26 | import Pager from "./cases/Pager.svelte";
27 | import TimePicker from "./cases/TimePicker.svelte";
28 | import Field from "./cases/Field.svelte";
29 | import Segmented from "./cases/Segmented.svelte";
30 | import Icon from "./cases/Icon.svelte";
31 | import SideArea from "./cases/SideArea.svelte";
32 | import ModalArea from "./cases/ModalArea.svelte";
33 |
34 | export const links = [
35 | ["/base/:skin", "Basic UI", Basic],
36 | ["/button/:skin", "Button", Buttons],
37 | ["/calendar/:skin", "Calendar", Calendar],
38 | ["/month/:skin", "Month", Month],
39 | ["/checkbox/:skin", "Checkbox", Checkbox],
40 | ["/colorpicker/:skin", "ColorPicker", ColorPicker],
41 | ["/colorselect/:skin", "ColorSelect", ColorSelect],
42 | ["/combo/:skin", "Combo", Combo],
43 | ["/datepicker/:skin", "DatePicker", DatePicker],
44 | ["/daterangepicker/:skin", "DateRangePicker", DateRangePicker],
45 | ["/field/:skin", "Field", Field],
46 | ["/locales/:skin", "Locales", Locales],
47 | ["/messages/:skin", "Messages", Messages],
48 | ["/multicombo/:skin", "MultiCombo", MultiCombo],
49 | ["/range/:skin", "Range", RangeCalendar],
50 | ["/pager/:skin", "Pager", Pager],
51 | ["/popup/:skin", "Popup", Popup],
52 | ["/radio/:skin", "Radio", Radio],
53 | ["/richselect/:skin", "Rich Select", RichSelect],
54 | ["/segmented/:skin", "Segmented", Segmented],
55 | ["/select/:skin", "Select", Select],
56 | ["/slider/:skin", "Slider", Slider],
57 | ["/switch/:skin", "Switch", Switch],
58 | ["/tabs/:skin", "Tabs", Tabs],
59 | ["/inputs/:skin", "Text Inputs", Text],
60 | ["/textarea/:skin", "TextArea", TextArea],
61 | ["/counter/:skin", "Counter Input", Counter],
62 | ["/timepicker/:skin", "TimePicker", TimePicker],
63 | ["/twostate/:skin", "Two State", TwoState],
64 | ["/icon/:skin", "Icon", Icon],
65 | ["/sidearea/:skin", "Side Area", SideArea],
66 | ["/modalarea/:skin", "Modal Area", ModalArea],
67 | ];
68 |
--------------------------------------------------------------------------------
/svelte/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Svelte Widgets
7 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/svelte/license.txt:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2023 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/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "wx-svelte-core",
3 | "version": "2.1.1",
4 | "description": "SVAR Svelte Core library, a collection of form controls and UI components",
5 | "productTag": "core",
6 | "productTrial": false,
7 | "type": "module",
8 | "scripts": {
9 | "build": "vite build",
10 | "build:dist": "vite build --mode dist",
11 | "build:tests": "vite build --mode test",
12 | "lint": "yarn eslint ./demos ./src",
13 | "start": "vite --open",
14 | "start:tests": "vite --open=/tests/ --host 0.0.0.0 --port 5100 --mode test",
15 | "test": "true",
16 | "test:cypress": "cypress run -P ./ --config \"baseUrl=http://localhost:5100/tests\""
17 | },
18 | "svelte": "src/index.js",
19 | "exports": {
20 | ".": {
21 | "svelte": "./src/index.js"
22 | },
23 | "./package.json": "./package.json"
24 | },
25 | "license": "MIT",
26 | "repository": {
27 | "type": "git",
28 | "url": "https://github.com/svar-widgets/core.git"
29 | },
30 | "bugs": {
31 | "url": "https://forum.svar.dev"
32 | },
33 | "homepage": "https://svar.dev/svelte/core/",
34 | "dependencies": {
35 | "wx-core-locales": "2.1.1",
36 | "wx-lib-dom": "0.8.0",
37 | "wx-lib-svelte": "0.5.1"
38 | },
39 | "files": [
40 | "src",
41 | "readme.md",
42 | "whatsnew.md",
43 | "license.txt"
44 | ],
45 | "keywords": [
46 | "svelte",
47 | "svelte library",
48 | "svelte ui components",
49 | "svelte-ui-library",
50 | "component-library",
51 | "components library",
52 | "ui library",
53 | "ui-library",
54 | "ui components",
55 | "ui components",
56 | "svelte ui library",
57 | "svar widgets"
58 | ]
59 | }
60 |
--------------------------------------------------------------------------------
/svelte/postcss.config.js:
--------------------------------------------------------------------------------
1 | import autoprefixer from "autoprefixer";
2 |
3 | const plugins = [autoprefixer];
4 | export { plugins };
5 |
--------------------------------------------------------------------------------
/svelte/readme.md:
--------------------------------------------------------------------------------
1 |
2 |
3 | # SVAR Svelte Core | UI Library
4 |
5 |
6 |
7 |
8 |
9 | [Website](https://svar.dev/svelte/core/) • [Getting Started](https://docs.svar.dev/svelte/core/getting_started/) • [Demos](https://docs.svar.dev/svelte/core/samples/#/calendar/willow)
10 |
11 |
12 |
13 |
14 |
15 | [](https://www.npmjs.com/package/wx-svelte-core)
16 | [](https://github.com/svar-widgets/core/blob/main/license.txt)
17 | [](https://www.npmjs.com/package/wx-svelte-core)
18 |
19 |
20 |
21 | [SVAR Core library](https://svar.dev/svelte/core/) offers a set of 20+ ready-made Svelte UI components: form controls, popups, date and time picker, toast notifications, and more.
22 | All components are lightweight, responsive, fast-performing, and available in light and dark skins.
23 |
24 |
25 |
26 | In addition to the Core library, you can use the following SVAR components to build unified app UIs:
27 |
28 | - [Menu](https://www.npmjs.com/package/wx-svelte-menu)
29 | - [Toolbar](https://www.npmjs.com/package/wx-svelte-toolbar)
30 | - [File uploader](https://www.npmjs.com/package/wx-svelte-uploader)
31 | - [Comments](https://www.npmjs.com/package/wx-svelte-comments)
32 | - [Tasklist](https://www.npmjs.com/package/wx-svelte-tasklist)
33 |
34 | ### Svelte 4 and Svelte 5 versions
35 |
36 | 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. Please note that the 2.x version is in beta and may contain some instabilities.
37 |
38 | To use the SVAR Core beta for Svelte 5, install it as follows:
39 |
40 | ```
41 | npm install wx-svelte-core
42 | ```
43 |
44 | To use the SVAR Core for Svelte 4:
45 |
46 | ```
47 | npm install wx-svelte-core@1.3.0
48 | ```
49 |
50 | # :hammer_and_wrench: How to Use
51 |
52 | To use any of the Core components, simply import the package and include the desired component in your Svelte file:
53 |
54 | ```svelte
55 |
58 |
59 | Click me
60 | ```
61 |
62 | See the [getting started guide](https://docs.svar.dev/svelte/core/getting_started/) to quickly set up and begin using SVAR Core components in your Svelte projects.
63 |
64 | ### :computer: How to Modify
65 |
66 | Typically, you don't need to modify the code. However, if you wish to do so, follow these steps:
67 |
68 | 1. Run `yarn` to install dependencies. Note that this project is a monorepo using `yarn` workspaces, so npm will not work
69 | 2. Start the project in development mode with `yarn start`
70 |
71 | ### :white_check_mark: Run Tests
72 |
73 | To run the test:
74 |
75 | 1. Start the test examples with:
76 | ```sh
77 | yarn start:tests
78 | ```
79 | 2. In a separate console, run the end-to-end tests with:
80 | ```sh
81 | yarn test:cypress
82 | ```
83 |
84 | ### :speech_balloon: Need Help?
85 |
86 | Join our [community forum](https://forum.svar.dev) to get help or submit feature requests.
87 |
--------------------------------------------------------------------------------
/svelte/src/Locale.svelte:
--------------------------------------------------------------------------------
1 |
15 |
16 | {@render children?.()}
17 |
--------------------------------------------------------------------------------
/svelte/src/components/Area.svelte:
--------------------------------------------------------------------------------
1 |
15 |
16 |