wx-svelte-core 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (60) hide show
  1. package/license.txt +21 -0
  2. package/package.json +35 -0
  3. package/src/Locale.svelte +17 -0
  4. package/src/components/Area.svelte +70 -0
  5. package/src/components/Button.svelte +187 -0
  6. package/src/components/Calendar.svelte +42 -0
  7. package/src/components/Checkbox.svelte +132 -0
  8. package/src/components/CheckboxGroup.svelte +52 -0
  9. package/src/components/ColorBoard.svelte +311 -0
  10. package/src/components/ColorPicker.svelte +110 -0
  11. package/src/components/ColorSelect.svelte +204 -0
  12. package/src/components/Combo.svelte +228 -0
  13. package/src/components/Counter.svelte +178 -0
  14. package/src/components/DatePicker.svelte +115 -0
  15. package/src/components/DateRangePicker.svelte +138 -0
  16. package/src/components/Dropdown.svelte +125 -0
  17. package/src/components/Field.svelte +91 -0
  18. package/src/components/Globals.svelte +53 -0
  19. package/src/components/Icon.svelte +31 -0
  20. package/src/components/Modal.svelte +115 -0
  21. package/src/components/ModalArea.svelte +32 -0
  22. package/src/components/MultiCombo.svelte +279 -0
  23. package/src/components/Notice.svelte +145 -0
  24. package/src/components/Notices.svelte +20 -0
  25. package/src/components/Pager.svelte +131 -0
  26. package/src/components/Popup.svelte +53 -0
  27. package/src/components/Portal.svelte +42 -0
  28. package/src/components/RadioButton.svelte +129 -0
  29. package/src/components/RadioButtonGroup.svelte +50 -0
  30. package/src/components/RangeCalendar.svelte +134 -0
  31. package/src/components/RichSelect.svelte +149 -0
  32. package/src/components/Segmented.svelte +115 -0
  33. package/src/components/Select.svelte +124 -0
  34. package/src/components/SideArea.svelte +33 -0
  35. package/src/components/Slider.svelte +242 -0
  36. package/src/components/Switch.svelte +88 -0
  37. package/src/components/Tabs.svelte +163 -0
  38. package/src/components/Text.svelte +185 -0
  39. package/src/components/Timepicker.svelte +217 -0
  40. package/src/components/TwoState.svelte +60 -0
  41. package/src/components/calendar/Button.svelte +40 -0
  42. package/src/components/calendar/Duodecade.svelte +97 -0
  43. package/src/components/calendar/Header.svelte +105 -0
  44. package/src/components/calendar/Month.svelte +189 -0
  45. package/src/components/calendar/Panel.svelte +119 -0
  46. package/src/components/calendar/Year.svelte +89 -0
  47. package/src/components/calendar/helpers.js +56 -0
  48. package/src/components/helpers/SuggestDropdown.svelte +79 -0
  49. package/src/components/helpers/colorTransformator.js +146 -0
  50. package/src/components/helpers/colorValidation.js +21 -0
  51. package/src/components/helpers/listnav.js +85 -0
  52. package/src/components/helpers/sliderMove.js +42 -0
  53. package/src/components/helpers.js +6 -0
  54. package/src/index.js +50 -0
  55. package/src/themes/FontOpenSans.svelte +36 -0
  56. package/src/themes/FonttRoboto.svelte +19 -0
  57. package/src/themes/Material.svelte +321 -0
  58. package/src/themes/Willow.svelte +323 -0
  59. package/src/themes/WillowDark.svelte +320 -0
  60. package/whatsnew.md +97 -0
@@ -0,0 +1,320 @@
1
+ <script>
2
+ import { setContext } from "svelte";
3
+ import FontOpenSans from "./FontOpenSans.svelte";
4
+
5
+ export let fonts = true;
6
+ const SLOTS = $$props.$$slots;
7
+ setContext("wx-theme", "willow-dark");
8
+ </script>
9
+
10
+ {#if SLOTS && SLOTS.default}
11
+ <div class="wx-willow-dark-theme" style="height:100%">
12
+ <slot />
13
+ </div>
14
+ {/if}
15
+
16
+ <svelte:head>
17
+ {#if fonts}
18
+ <link rel="preconnect" href="https://cdn.svar.dev" crossorigin />
19
+ <FontOpenSans />
20
+ <link
21
+ rel="stylesheet"
22
+ href="https://cdn.svar.dev/fonts/wxi/wx-icons.css"
23
+ />
24
+ {/if}
25
+ </svelte:head>
26
+
27
+ <style>
28
+ :global(.wx-willow-dark-theme) {
29
+ /* base colors */
30
+ --wx-color-primary: #7a67eb;
31
+ --wx-color-primary-selected: rgba(122, 103, 235, 0.3);
32
+ --wx-color-primary-font: #fff;
33
+ --wx-color-secondary: transparent;
34
+ --wx-color-secondary-hover: rgba(122, 103, 235, 0.12);
35
+ --wx-color-secondary-font: var(--wx-color-primary);
36
+ --wx-color-secondary-font-hover: var(--wx-color-primary);
37
+ --wx-color-secondary-border: var(--wx-color-primary);
38
+ --wx-color-secondary-border-disabled: #9fa1ae;
39
+
40
+ --wx-color-success: #77d257;
41
+ --wx-color-warning: #fcba2e;
42
+ --wx-color-info: var(--wx-color-primary);
43
+ --wx-color-danger: #fe6158;
44
+ --wx-color-disabled: #384047;
45
+ --wx-color-disabled-alt: #44474a;
46
+
47
+ --wx-color-font: rgba(255, 255, 255, 0.9);
48
+ --wx-color-font-alt: #9fa1ae;
49
+ --wx-color-font-disabled: #9fa1ae;
50
+ --wx-color-link: var(--wx-color-primary);
51
+
52
+ --wx-background: #2a2b2d;
53
+ --wx-background-alt: #384047;
54
+ --wx-background-hover: #20262b;
55
+ /* end base colors */
56
+
57
+ /* font */
58
+ --wx-font-family: "Open Sans", Arial, Helvetica, sans-serif;
59
+ --wx-font-size: 14px;
60
+ --wx-line-height: 20px;
61
+ --wx-font-size-md: 14px;
62
+ --wx-line-height-md: 24px;
63
+ --wx-font-size-hd: 16px;
64
+ --wx-line-height-hd: 30px;
65
+ --wx-font-size-sm: 12px;
66
+ --wx-line-height-sm: 16px;
67
+ --wx-font-weight: 400;
68
+ --wx-font-weight-md: 600;
69
+ --wx-font-weight-b: 700;
70
+ /* end font */
71
+
72
+ /* icons */
73
+ --wx-icon-color: #c0c3ce;
74
+ --wx-icon-size: var(--wx-line-height);
75
+ /* end icons */
76
+
77
+ /* other */
78
+ --wx-border: 1px solid #384047;
79
+ --wx-border-radius: 3px;
80
+ --wx-radius-major: 6px;
81
+
82
+ --wx-border-light: 1px solid #384047;
83
+ --wx-border-medium: 1px solid #384047;
84
+
85
+ --wx-shadow-light: 0px 4px 20px 0px rgba(44, 47, 60, 0.12);
86
+ --wx-shadow-medium: none;
87
+ --wx-box-shadow: 0px 4px 48px rgba(44, 47, 60, 0.18);
88
+ --wx-box-shadow-strong: 0px 4px 48px rgba(44, 47, 60, 0.18),
89
+ 0px 4px 8px rgba(14, 14, 15, 0.3);
90
+
91
+ --wx-padding: 8px;
92
+ /* end other */
93
+
94
+ /* field */
95
+ --wx-field-gutter: 16px;
96
+ --wx-field-width: 400px;
97
+ /* end field */
98
+
99
+ /* input */
100
+ --wx-input-font-family: var(--wx-font-family);
101
+ --wx-input-font-size: var(--wx-font-size);
102
+ --wx-input-line-height: var(--wx-line-height);
103
+ --wx-input-font-weight: var(--wx-font-weight);
104
+ --wx-input-text-align: left;
105
+ --wx-input-font-color: var(--wx-color-font);
106
+ --wx-input-background: var(--wx-background);
107
+ --wx-input-background-disabled: var(--wx-color-disabled);
108
+ --wx-input-placeholder-color: var(--wx-color-font-alt);
109
+ --wx-input-border: var(--wx-border);
110
+ --wx-input-border-focus: 1px solid var(--wx-color-primary);
111
+ --wx-input-border-disabled: var(--wx-border);
112
+ --wx-input-border-radius: 3px;
113
+ --wx-input-height: 32px;
114
+ --wx-input-width: 100%;
115
+ --wx-input-padding: 5px 8px;
116
+ --wx-input-icon-indent: 6px;
117
+ --wx-input-icon-color: var(--wx-icon-color);
118
+ --wx-input-icon-size: var(--wx-icon-size);
119
+ /* end input */
120
+
121
+ /* multi combo */
122
+ --wx-multicombo-tag-gap: 3px;
123
+ --wx-multicombo-tag-border: none;
124
+ --wx-multicombo-tag-border-radius: var(--wx-input-border-radius);
125
+ --wx-multicombo-tag-pading: 2px 8px;
126
+ --wx-multicombo-tag-background: var(--wx-background-alt);
127
+ /* end multi combo */
128
+
129
+ /* checkbox and radio */
130
+ --wx-checkbox-height: var(--wx-line-height);
131
+ --wx-checkbox-size: var(--wx-checkbox-height);
132
+ --wx-checkbox-border-width: 2px;
133
+ --wx-checkbox-border-color: var(--wx-color-font-alt);
134
+ --wx-checkbox-border-color-disabled: var(--wx-color-disabled);
135
+ --wx-checkbox-border-radius: var(--wx-input-border-radius);
136
+ --wx-checkbox-font-family: var(--wx-font-family);
137
+ --wx-checkbox-font-size: var(--wx-font-size);
138
+ --wx-checkbox-line-height: var(--wx-line-height);
139
+ --wx-checkbox-font-weight: var(--wx-font-weight);
140
+ --wx-checkbox-font-color: var(--wx-color-font);
141
+ /* end checkbox and radio */
142
+
143
+ /* label */
144
+ --wx-label-width: 100px;
145
+ --wx-label-margin: 0 0 4px;
146
+ --wx-label-padding: 0;
147
+ --wx-label-font-family: var(--wx-font-family);
148
+ --wx-label-font-size: var(--wx-font-size);
149
+ --wx-label-line-height: var(--wx-line-height);
150
+ --wx-label-font-weight: var(--wx-font-weight-md);
151
+ --wx-label-font-color: var(--wx-color-font);
152
+ /* end label */
153
+
154
+ /* button */
155
+ --wx-button-font-family: var(--wx-font-family);
156
+ --wx-button-font-size: var(--wx-font-size-md);
157
+ --wx-button-line-height: var(--wx-line-height);
158
+ --wx-button-font-weight: var(--wx-font-weight-md);
159
+ --wx-button-text-transform: none;
160
+ --wx-button-background: var(--wx-background-alt);
161
+ --wx-button-font-color: var(--wx-color-font);
162
+ --wx-button-danger-font-color: #fff;
163
+ --wx-button-border: 1px solid transparent;
164
+ --wx-button-border-radius: var(--wx-border-radius);
165
+ --wx-button-height: 32px;
166
+ --wx-button-padding: 5px 16px;
167
+ --wx-button-icon-indent: 5px;
168
+ --wx-button-icon-size: 20px;
169
+ /* end button */
170
+
171
+ /* segmented */
172
+ --wx-segmented-background: var(--wx-background-alt);
173
+ --wx-segmented-background-hover: var(--wx-background-hover);
174
+ --wx-segmented-border: none;
175
+ --wx-segmented-border-radius: 6px;
176
+ --wx-segmented-padding: 0px;
177
+ /* end segmented */
178
+
179
+ /* tabs */
180
+ --wx-tabs-background: var(--wx-background);
181
+ --wx-tabs-background-hover: transparent;
182
+ --wx-tabs-hover-border: #9fa1ae;
183
+ --wx-tabs-border-width: 1px;
184
+ --wx-tabs-border-radius: var(--wx-border-radius);
185
+ --wx-tabs-divider-width: 1px;
186
+ --wx-tabs-divider-height: 60%;
187
+ --wx-tabs-divider-color: transparent;
188
+ --wx-tabs-cell-min-width: 100px;
189
+ --wx-tabs-active-background: transparent;
190
+ --wx-tabs-active-color: var(--wx-color-primary);
191
+ --wx-tabs-active-border: var(--wx-tabs-active-color);
192
+ /* end tabs */
193
+
194
+ /* slider */
195
+ --wx-slider-height: 14px;
196
+ --wx-slider-primary: var(--wx-color-primary);
197
+ --wx-slider-background: var(--wx-background-alt);
198
+ --wx-slider-track-height: 4px;
199
+ --wx-slider-track-border-radius: 2px;
200
+ --wx-slider-thumb-size: var(--wx-slider-height);
201
+ --wx-slider-thumb-border: none;
202
+ --wx-slider-thumb-border-disabled: 1px solid var(--wx-color-disabled);
203
+ --wx-slider-thumb-shadow: none;
204
+ --wx-slider-label-margin: 0 0 5px;
205
+ --wx-slider-label-font-family: var(--wx-font-family);
206
+ --wx-slider-label-font-size: var(--wx-font-size);
207
+ --wx-slider-label-line-height: var(--wx-line-height);
208
+ --wx-slider-label-font-weight: var(--wx-font-weight-md);
209
+ --wx-slider-label-font-color: var(--wx-color-font);
210
+ /* end slider */
211
+
212
+ /* switch */
213
+ --wx-switch-primary: var(--wx-color-primary);
214
+ --wx-switch-background: #384047;
215
+ --wx-switch-width: 48px;
216
+ --wx-switch-height: 24px;
217
+ --wx-switch-border-width: 0px;
218
+ --wx-switch-border-color: transparent;
219
+ --wx-switch-border-color-disabled: transparent;
220
+ --wx-switch-thumb-offset: 1px;
221
+ --wx-switch-thumb-border: none;
222
+ --wx-switch-thumb-border-disabled: 1px solid rgba(255, 255, 255, 0.7);
223
+ --wx-switch-thumb-background: rgba(255, 255, 255, 0.9);
224
+ --wx-switch-thumb-background-disabled: var(--wx-color-disabled);
225
+ --wx-switch-thumb-shadow: none;
226
+ /* end switch */
227
+
228
+ /* popup and dropdown */
229
+ --wx-popup-z-index: 100;
230
+ --wx-popup-background: var(--wx-background);
231
+ --wx-popup-shadow: var(--wx-shadow-light);
232
+ --wx-popup-border: 1px solid rgba(255, 255, 255, 0.26);
233
+ --wx-popup-border-radius: var(--wx-border-radius);
234
+ /* end popup and dropdown */
235
+
236
+ /* modal */
237
+ --wx-modal-z-index: 1000;
238
+ --wx-modal-background: var(--wx-background);
239
+ --wx-modal-shadow: var(--wx-shadow-medium);
240
+ --wx-modal-border: 1px solid #ffffff42;
241
+ --wx-modal-border-radius: var(--wx-border-radius);
242
+ --wx-modal-width: 280px;
243
+ --wx-modal-padding: 16px 20px;
244
+ --wx-modal-gutter: 14px;
245
+ --wx-modal-backdrop: rgba(108, 114, 131, 0.2);
246
+ --wx-modal-header-font-family: var(--wx-font-family);
247
+ --wx-modal-header-font-size: var(--wx-font-size-hd);
248
+ --wx-modal-header-line-height: var(--wx-line-height-hd);
249
+ --wx-modal-header-font-weight: var(--wx-font-weight-b);
250
+ --wx-modal-header-font-color: #fff;
251
+ /* end modal */
252
+
253
+ /* notice */
254
+ --wx-notice-z-index: 1010;
255
+ --wx-notice-background: var(--wx-background-alt);
256
+ --wx-notice-shadow: var(--wx-shadow-medium);
257
+ --wx-notice-border: none;
258
+ --wx-notice-border-radius: 0 var(--wx-border-radius)
259
+ var(--wx-border-radius) 0;
260
+ --wx-notice-margin: 6px 12px;
261
+ --wx-notice-font-family: var(--wx-font-family);
262
+ --wx-notice-font-size: var(--wx-font-size);
263
+ --wx-notice-line-height: var(--wx-line-height);
264
+ --wx-notice-font-weight: var(--wx-font-weight);
265
+ --wx-notice-font-color: var(--wx-color-font);
266
+ --wx-notice-padding: 14px;
267
+ --wx-notice-width: 240px;
268
+ --wx-notice-icon-size: var(--wx-icon-size);
269
+ --wx-notice-icon-color: var(--wx-icon-color);
270
+ --wx-notice-type-border-width: 4px;
271
+ --wx-notice-type-border-color: var(--wx-icon-color);
272
+ --wx-notice-type-font-color: var(--wx-color-font);
273
+ --wx-notice-type-icon-color: #9fa1ae;
274
+ --wx-notice-type-background-opacity: 0;
275
+ --wx-notice-type-close-hover-opacity: 1;
276
+ /* end notice */
277
+
278
+ /* calendar */
279
+ --wx-calendar-padding: 16px;
280
+ --wx-calendar-cell-size: 32px;
281
+ --wx-calendar-gap: 4px;
282
+ --wx-calendar-line-gap: 4px;
283
+ --wx-calendar-border-radius: var(--wx-border-radius);
284
+ --wx-calendar-font-family: var(--wx-font-family);
285
+ --wx-calendar-font-size: var(--wx-font-size);
286
+ --wx-calendar-line-height: var(--wx-line-height);
287
+ --wx-calendar-font-weight: var(--wx-font-weight);
288
+ --wx-calendar-font-color: var(--wx-color-font);
289
+ --wx-calendar-icon-color: var(--wx-icon-color);
290
+ --wx-calendar-icon-size: var(--wx-icon-size);
291
+ --wx-calendar-header-font-size: var(--wx-font-size);
292
+ --wx-calendar-header-line-height: var(--wx-line-height);
293
+ --wx-calendar-header-font-weight: var(--wx-font-weight-md);
294
+ --wx-calendar-controls-font-family: var(--wx-button-font-family);
295
+ --wx-calendar-controls-font-size: var(--wx-font-size);
296
+ --wx-calendar-controls-line-height: var(--wx-line-height);
297
+ --wx-calendar-controls-font-weight: var(--wx-font-weight);
298
+ --wx-calendar-controls-font-color: var(--wx-color-font);
299
+ /* end calendar */
300
+ }
301
+
302
+ :global(.wx-willow-dark-theme) {
303
+ font-family: var(--wx-font-family);
304
+ font-size: var(--wx-font-size);
305
+ line-height: var(--wx-line-height);
306
+ font-weight: var(--wx-font-weight);
307
+ font-style: normal;
308
+ letter-spacing: normal;
309
+ text-align: left;
310
+ color: var(--wx-color-font);
311
+ background: var(--wx-background);
312
+ }
313
+ :global(
314
+ .wx-willow-dark-theme *,
315
+ .wx-willow-dark-theme *:before,
316
+ .wx-willow-dark-theme *:after
317
+ ) {
318
+ box-sizing: border-box;
319
+ }
320
+ </style>
package/whatsnew.md ADDED
@@ -0,0 +1,97 @@
1
+ ### 1.3.0
2
+
3
+ - [update] improved popup positioning strategies
4
+
5
+ ### 1.2.3
6
+
7
+ - [fix] closing menu and popup when clicking on disabled control
8
+
9
+ ### 1.2.1
10
+
11
+ - [fix] regression in popup closing in some cases
12
+
13
+ ### 1.2.0
14
+
15
+ - [add] common logic for click-outside tracking for popup and side-area
16
+ - [add] counter widget added
17
+ - [update] css styles corrected ( wx prefixes, names of top classes for each widget, error state )
18
+ - [update] uploader removed ( @wx/svelte-uploader )
19
+ - [update] date formats used from locale
20
+ - [fix] change event in DatePicker / Calendar
21
+
22
+ ### 1.1.4
23
+
24
+ - [fix] compatibility with svelte-kit ( typescript )
25
+
26
+ ### 1.1.3
27
+
28
+ - [fix] input in editable datepicker trigger immediate value reset
29
+
30
+ ### 1.1.2
31
+
32
+ - [fix] partial combobox clearing after clicking the "clean" button
33
+
34
+ #### 1.0.0-rc34
35
+
36
+ - on:select event for datepicker
37
+
38
+ #### 1.0.0-rc25
39
+
40
+ - combo/multicombo/richselect and numeric string as item's IDs
41
+
42
+ #### 1.0.0-rc24
43
+
44
+ - fix in input focus after widget was already destroyed
45
+
46
+ #### 1.0.0-rc23
47
+
48
+ - styling of tabbar and messages
49
+
50
+ #### 1.0.0-rc22
51
+
52
+ - color of border in Willow theme corrected
53
+
54
+ #### 1.0.0-rc21
55
+
56
+ - fix for mutable "current" prop in Calendar/Range
57
+
58
+ #### 1.0.0-rc20
59
+
60
+ - Month view as separate widget
61
+
62
+ #### 1.0.0-rc19
63
+
64
+ - regression in date highlighting in the calendar widget
65
+
66
+ #### 1.0.0-rc18
67
+
68
+ - incorrect date navigation in daterangepicker
69
+
70
+ #### 1.0.0-rc17
71
+
72
+ - fix portal content cleaning
73
+
74
+ #### 1.0.0-rc16
75
+
76
+ - tabbar triggers change event
77
+
78
+ #### 1.0.0-rc15
79
+
80
+ - change in css naming scheme
81
+ - css includes default font
82
+ - locale helpers is exported
83
+
84
+ #### 1.0.0-rc14
85
+
86
+ - export locale helper
87
+ - richselect doesn't wrap text by default
88
+ - themes includes necessary fonts
89
+ - fixed navigation in the calendar
90
+ - checkbox in multicombo is optional now
91
+ - fix incorrect selection in the calendar when value has time part
92
+ - timepicker expects Date as value
93
+ - datepicker allows to disable buttons in the Calendar
94
+
95
+ #### 1.0.0-rc11
96
+
97
+ [fix] incorrect handling of Enter key in Modal, SVAR-580