@studio-west/component-sw 0.13.10 → 0.13.16
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.
- package/LICENSE +201 -21
- package/README.md +159 -54
- package/dist/{SwButton-mr7jdXoz.js → SwButton-DBj7jzhd.js} +12 -10
- package/dist/{SwDatePicker-FT-rT4rV.js → SwDatePicker-BwgaZLnR.js} +49 -49
- package/dist/{SwDropdown-BTADCvrN.js → SwDropdown-D5nIZEAM.js} +40 -23
- package/dist/SwDropdownItem-09XdzVHh.js +43 -0
- package/dist/{SwFile-BBIqUoFG.js → SwFile-BTNWhEX-.js} +2 -2
- package/dist/SwFormItem-SuqNvXBQ.js +59 -0
- package/dist/SwGide-BScP5PoP.js +134 -0
- package/dist/{SwIcon-C4RHAbK1.js → SwIcon-Ce_Lj65y.js} +2 -2
- package/dist/{SwInput-0Eph7P-m.js → SwInput-D5cZvb4H.js} +2 -2
- package/dist/SwMessage-BRYFF_qT.js +63 -0
- package/dist/SwSection-Ck1GYU_A.js +36 -0
- package/dist/{SwSelect-DwxIlRFI.js → SwSelect-Bo9kUY7P.js} +617 -494
- package/dist/SwSlider-Cl9pwY6h.js +197 -0
- package/dist/component-sw.css +1 -1
- package/dist/index.cjs +6 -6
- package/dist/index.js +92 -68
- package/dist/{utils-DwvFrrWs.js → utils-qzwUfWRX.js} +17 -2
- package/package.json +4 -1
- package/types/components.d.ts +0 -2
- package/types/index.d.ts +8 -2
- package/dist/SwDropdownItem-oQKFG36T.js +0 -36
- package/dist/SwDropdownNew-BuCIN-iv.js +0 -107
- package/dist/SwFormItem-DgFaNwe9.js +0 -24
- package/dist/SwGide-BYRlBr9D.js +0 -125
- package/dist/SwMessage-CUTW1YCi.js +0 -55
- package/dist/SwSection-DG9jX0Yc.js +0 -32
- package/dist/SwSlider-DkgJH6Bh.js +0 -179
package/LICENSE
CHANGED
|
@@ -1,21 +1,201 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright [yyyy] [name of copyright owner]
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
package/README.md
CHANGED
|
@@ -41,6 +41,8 @@ Interactive playground of the latest version with live examples, demonstration o
|
|
|
41
41
|
|
|
42
42
|
- [SwFile](#swfile)
|
|
43
43
|
|
|
44
|
+
- [SwFormItem](#swformitem)
|
|
45
|
+
|
|
44
46
|
- [SwIcon](#swicon)
|
|
45
47
|
|
|
46
48
|
- [SwGide](#swgide)
|
|
@@ -131,20 +133,24 @@ const darkMode = () => {
|
|
|
131
133
|
|
|
132
134
|
## SwAlert
|
|
133
135
|
|
|
134
|
-
Функция
|
|
136
|
+
Функция `Alert()` — система всплывающих сообщений. Несколько алертов стекаются; позиция и порядок задаются параметрами `placement` / `align`.
|
|
135
137
|
|
|
138
|
+
The `Alert()` function shows toast messages. Multiple alerts stack; position and order are controlled by `placement` / `align`.
|
|
136
139
|
|
|
137
140
|
### Свойства / Properties
|
|
138
141
|
|
|
139
|
-
| Имя
|
|
140
|
-
|
|
141
|
-
| `class`
|
|
142
|
-
| `size`
|
|
143
|
-
| `type`
|
|
144
|
-
| `message`
|
|
145
|
-
| `duration`
|
|
146
|
-
| `
|
|
147
|
-
| `
|
|
142
|
+
| Имя | Тип | по умолчанию | Значения/Описание |
|
|
143
|
+
|-------------|---------|-------------------|-----------------------------------------------------------------------------------|
|
|
144
|
+
| `class` | `String` | `` | Добавляет пользовательский CSS-класс к компоненту. |
|
|
145
|
+
| `size` | `String` | `` | Размер сообщения: `'large'`, `'small'`. |
|
|
146
|
+
| `type` | `String` | `info` | `'primary'`, `'success'`, `'info'`, `'warning'`, `'danger'` (алиас `'error'` → `danger`). |
|
|
147
|
+
| `message` | `String` | `Default message` | Текст сообщения. |
|
|
148
|
+
| `duration` | `Number` | `6000` | Время отображения в миллисекундах. |
|
|
149
|
+
| `placement` | `String` | `top` | Вертикаль: `'top'` — старые сверху, новые ниже; `'bottom'` — свежие сверху стека у низа экрана. |
|
|
150
|
+
| `align` | `String` | `center` | Горизонталь: `'left'`, `'center'`, `'right'`. |
|
|
151
|
+
| `before` | `String` | `` | Иконка в начале: имя из SVG-спрайта или URL. См. [SwIcon](#swicon). |
|
|
152
|
+
| `after` | `String` | `` | Иконка в конце (закрыть): имя из спрайта или URL. См. [SwIcon](#swicon). |
|
|
153
|
+
| `onClose` | `Function` | — | Колбэк после закрытия. |
|
|
148
154
|
|
|
149
155
|
### Слоты / Slots
|
|
150
156
|
|
|
@@ -154,7 +160,7 @@ Default - Текст описания или модуль / модули
|
|
|
154
160
|
|
|
155
161
|
#suffix - Вставка после текста (если не передан `after`)
|
|
156
162
|
|
|
157
|
-
#footer - Нижний блок
|
|
163
|
+
#footer - Нижний блок (рендерится только если слот передан)
|
|
158
164
|
|
|
159
165
|
### Пример использования / Example Usage
|
|
160
166
|
|
|
@@ -162,16 +168,30 @@ Default - Текст описания или модуль / модули
|
|
|
162
168
|
// .js addons
|
|
163
169
|
import { Alert, components } from "@studio-west/component-sw"
|
|
164
170
|
import { h } from 'vue'
|
|
165
|
-
Alert({
|
|
171
|
+
Alert({
|
|
172
|
+
message: 'Message',
|
|
173
|
+
type: 'danger',
|
|
174
|
+
duration: 10000,
|
|
175
|
+
placement: 'bottom',
|
|
176
|
+
align: 'right',
|
|
177
|
+
before: 'https://cdn.jsdelivr.net/npm/@tabler/icons@3.19.0/icons/outline/bell.svg',
|
|
178
|
+
footer: h(components.SwButton, { onClick: () => console.log('Клик по кнопке в футере') }, () => 'OK')
|
|
179
|
+
})
|
|
166
180
|
|
|
167
|
-
// Composition API
|
|
181
|
+
// Composition API / <script setup>:
|
|
168
182
|
import { inject, h } from "vue"
|
|
169
183
|
import { components } from "@studio-west/component-sw"
|
|
170
184
|
const Alert = inject('Alert')
|
|
171
|
-
Alert({
|
|
185
|
+
Alert({
|
|
186
|
+
message: 'Alarm!',
|
|
187
|
+
type: 'warning',
|
|
188
|
+
placement: 'top',
|
|
189
|
+
align: 'center',
|
|
190
|
+
suffix: h(components.SwIcon, { iconClass: 'https://cdn.jsdelivr.net/npm/@tabler/icons@3.19.0/icons/outline/info-circle.svg' })
|
|
191
|
+
})
|
|
172
192
|
|
|
173
|
-
//Options API:
|
|
174
|
-
this.$Alert({message: 'Welcome!', type: 'success', prefix: 'Дополнительная информация'})
|
|
193
|
+
// Options API:
|
|
194
|
+
this.$Alert({ message: 'Welcome!', type: 'success', prefix: 'Дополнительная информация' })
|
|
175
195
|
```
|
|
176
196
|
---
|
|
177
197
|
|
|
@@ -399,18 +419,20 @@ const datePickerLimitation = ref([
|
|
|
399
419
|
|
|
400
420
|
## SwDropdown
|
|
401
421
|
|
|
402
|
-
Компонент `SwDropdown`
|
|
422
|
+
Компонент `SwDropdown` — всплывающее меню с настройкой места открытия и типа триггера. У попапа есть **уголок**, который указывает на триггер; сторона и смещение считаются по фактической позиции (с учётом flip у края экрана). `z-index` попапа = z-index ближайшего предка + 3 (`Teleport` в `body`).
|
|
423
|
+
|
|
424
|
+
The `SwDropdown` popup shows a caret pointing at the trigger; side/offset follow the real placement after edge flip. Popup `z-index` is ancestor z-index + 3.
|
|
403
425
|
|
|
404
426
|
### Свойства / Properties
|
|
405
427
|
|
|
406
428
|
| Имя | Тип | По умолчанию | Значения/Описание |
|
|
407
429
|
|-------------|-----------|---------------|-------------------------------------------------------------------------------------------------------------------------------------------------------|
|
|
408
|
-
| `class` | `String` |
|
|
409
|
-
| `size` | `String` | `` |
|
|
410
|
-
| `type` | `String` |
|
|
411
|
-
| `trigger` | `String` | `click` | Способ открытия: `'click'
|
|
412
|
-
| `placement` | `String` | `bottom-left` |
|
|
413
|
-
| `maxWidth` | `Number` | `0` | Максимальная ширина меню в
|
|
430
|
+
| `class` | `String` | `` | CSS-класс попапа (например `gide` для онбординга). |
|
|
431
|
+
| `size` | `String` | `` | Размер: `'large'`, `'small'`. |
|
|
432
|
+
| `type` | `String` | `` | `'primary'`, `'success'`, `'info'`, `'warning'`, `'danger'`. |
|
|
433
|
+
| `trigger` | `String` | `click` | Способ открытия: `'click'`, `'hover'`, `'context'`, `'none'` — только через `model`. |
|
|
434
|
+
| `placement` | `String` | `bottom-left` | `'bottom-left'`, `'bottom'`, `'bottom-right'`, `'top-left'`, `'top'`, `'top-right'`, `'left'`, `'right'`. |
|
|
435
|
+
| `maxWidth` | `Number` | `0` | Максимальная ширина меню в px. `0` — без ограничений. |
|
|
414
436
|
|
|
415
437
|
### Слоты / Slots
|
|
416
438
|
|
|
@@ -425,7 +447,7 @@ model - состояние меню, булевое значение откры
|
|
|
425
447
|
### Пример использования / Example Usage
|
|
426
448
|
|
|
427
449
|
```html
|
|
428
|
-
<sw-dropdown class="custom-class" :max-width="250">
|
|
450
|
+
<sw-dropdown class="custom-class" placement="bottom" :max-width="250">
|
|
429
451
|
<sw-button label="Меню" type="primary" />
|
|
430
452
|
<template #dropdown>
|
|
431
453
|
<sw-dropdown-item>содержание / context</sw-dropdown-item>
|
|
@@ -591,6 +613,39 @@ const documentFiles = ref([])
|
|
|
591
613
|
|
|
592
614
|
---
|
|
593
615
|
|
|
616
|
+
## SwFormItem
|
|
617
|
+
|
|
618
|
+
Компонент `SwFormItem` — **подписи к полям формы** (не обёртка контрола): строка с подписью слева и текстом справа (подсказка / ошибка). Выравнивание через `justify`, цвет текста через `type`.
|
|
619
|
+
|
|
620
|
+
`SwFormItem` is a **form caption row** (not a field wrapper): label on the left, hint/error on the right. Use `justify` for alignment and `type` for text color.
|
|
621
|
+
|
|
622
|
+
### Свойства / Properties
|
|
623
|
+
|
|
624
|
+
| Имя | Тип | По умолчанию | Значения/Описание |
|
|
625
|
+
|-----------|----------|--------------|-----------------------------------------------------------------------------------|
|
|
626
|
+
| `label` | `String` | `` | Подпись слева. |
|
|
627
|
+
| `type` | `String` | `` | Цвет текста: `'primary'`, `'success'`, `'info'`, `'warning'`, `'danger'` (`'error'` → `danger`). Без фонов кнопок. |
|
|
628
|
+
| `justify` | `String` | `` | Выравнивание: `''` → `space-between`; `'start'`, `'end'`, `'around'`, `'center'`. |
|
|
629
|
+
| `class` | `String` | `` | Дополнительный CSS-класс. |
|
|
630
|
+
|
|
631
|
+
### Слоты / Slots
|
|
632
|
+
|
|
633
|
+
#label — подпись слева (если не передан `label`)
|
|
634
|
+
|
|
635
|
+
Default — текст справа (подсказка / ошибка)
|
|
636
|
+
|
|
637
|
+
#before / #after — дополнительные вставки
|
|
638
|
+
|
|
639
|
+
### Пример использования / Example Usage
|
|
640
|
+
|
|
641
|
+
```html
|
|
642
|
+
<sw-form-item label="Пароль" type="danger">слишком короткий</sw-form-item>
|
|
643
|
+
<sw-input v-model="pass" name="pass" label="Пароль" />
|
|
644
|
+
|
|
645
|
+
<sw-form-item justify="start" type="info">Подсказка под полем</sw-form-item>
|
|
646
|
+
```
|
|
647
|
+
---
|
|
648
|
+
|
|
594
649
|
## SwIcon
|
|
595
650
|
|
|
596
651
|
Компонент `SwIcon` отображает SVG-иконку из встроенного спрайта или по-внешнему URL.
|
|
@@ -621,16 +676,18 @@ const documentFiles = ref([])
|
|
|
621
676
|
|
|
622
677
|
## SwGide
|
|
623
678
|
|
|
624
|
-
Компонент `SwGide`
|
|
679
|
+
Компонент `SwGide` создаёт затемнение вокруг блока по селектору и показывает [SwDropdown](#swdropdown) с шагами из `steps`. `z-index` гида динамический: выше контента страницы (в т.ч. тултипов слайдера), ниже алертов (`9999`).
|
|
680
|
+
|
|
681
|
+
`SwGide` dims the page around a selector and shows a [SwDropdown](#swdropdown) for `steps`. Overlay `z-index` is dynamic: above page content, below alerts (`9999`).
|
|
625
682
|
|
|
626
683
|
### Свойства / Properties
|
|
627
684
|
|
|
628
685
|
| Имя | Тип | По умолчанию | Значения/Описание |
|
|
629
686
|
|--------------|-----------|--------------|--------------------------------------------------------------------------------------------------------------------------------------------------------|
|
|
630
|
-
| `steps` | `Array` | `() => []` | Массив
|
|
687
|
+
| `steps` | `Array` | `() => []` | Массив шагов: `[{ header, text, tag, placement, img }]`. |
|
|
631
688
|
| `after` | `String` | `` | Иконка закрытия: имя из спрайта или URL. См. [SwIcon](#swicon). |
|
|
632
689
|
| `iconClose` | `String` | `` | **Deprecated** (удалить в major) — используйте `after`. |
|
|
633
|
-
| `maxWidth` | `Number` | `250` | Ширина всплывающего окна в px (без картинки).
|
|
690
|
+
| `maxWidth` | `Number` | `250` | Ширина всплывающего окна в px (без картинки). |
|
|
634
691
|
|
|
635
692
|
### Слоты / Slots
|
|
636
693
|
|
|
@@ -1048,15 +1105,17 @@ const complexMenu = {
|
|
|
1048
1105
|
|
|
1049
1106
|
## SwMessage
|
|
1050
1107
|
|
|
1051
|
-
Компонент `SwMessage`
|
|
1108
|
+
Компонент `SwMessage` — модальное окно по центру (`<dialog>`). При открытии блокирует прокрутку страницы (`body.overflow = hidden`).
|
|
1109
|
+
|
|
1110
|
+
`SwMessage` is a centered modal (`<dialog>`). While open it locks page scroll.
|
|
1052
1111
|
|
|
1053
1112
|
### Свойства / Properties
|
|
1054
1113
|
|
|
1055
1114
|
| Имя | Тип | По умолчанию | Значения/Описание |
|
|
1056
1115
|
|-------------|-----------|--------------|-----------------------------------------------------------------------------------------|
|
|
1057
|
-
| `name` | `String` | `` |
|
|
1058
|
-
| `class` | `String` |
|
|
1059
|
-
| `after` | `String` | `` | Иконка кнопки
|
|
1116
|
+
| `name` | `String` | `` | Текстовый заголовок; при отсутствии — слот `"header"`. |
|
|
1117
|
+
| `class` | `String` | `` | Пользовательский CSS-класс. |
|
|
1118
|
+
| `after` | `String` | `` | Иконка кнопки закрытия: имя из спрайта или URL. См. [SwIcon](#swicon). |
|
|
1060
1119
|
| `iconAfter` | `String` | `` | **Deprecated** (удалить в major) — используйте `after`. |
|
|
1061
1120
|
|
|
1062
1121
|
### Слоты / Slots
|
|
@@ -1223,47 +1282,51 @@ Default - Содержимое
|
|
|
1223
1282
|
|
|
1224
1283
|
## SwSlider
|
|
1225
1284
|
|
|
1226
|
-
Компонент `SwSlider`
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
- Адаптивное позиционирование подсказок в зависимости от доступного пространства
|
|
1230
|
-
- Поддержка сенсорных устройств (touch events)
|
|
1285
|
+
Компонент `SwSlider` — слайдер с одним или несколькими ползунками: число → 1 бегунок, массив из n чисел → n бегунков. Значения в массиве **сортируются** при перетаскивании; тултип следует за тянущимся ползунком при перескоке. Без CSS-lag на `left`/`top` во время drag.
|
|
1286
|
+
|
|
1287
|
+
`SwSlider` supports one value or an array of n thumbs. Array values are **sorted** while dragging; the value tooltip follows the active thumb across swaps.
|
|
1231
1288
|
|
|
1232
1289
|
### Свойства / Properties
|
|
1233
1290
|
|
|
1234
1291
|
| Имя | Тип | По умолчанию | Значения/Описание |
|
|
1235
1292
|
|--------------|-----------|--------------|----------------------------------------------------|
|
|
1236
|
-
| `vertical` | `Boolean` | `false` | Вертикальная
|
|
1237
|
-
| `class` | `String` |
|
|
1238
|
-
| `size` | `String` |
|
|
1239
|
-
| `min` | `Number` | `0` |
|
|
1240
|
-
| `max` | `Number` | `100` |
|
|
1241
|
-
| `step` | `Number` | `1` |
|
|
1242
|
-
| `show-value` | `Boolean` | `false` |
|
|
1293
|
+
| `vertical` | `Boolean` | `false` | Вертикальная ориентация. |
|
|
1294
|
+
| `class` | `String` | `` | Пользовательский CSS-класс. |
|
|
1295
|
+
| `size` | `String` | `` | Размер бегунка: `'large'`, `'small'`. |
|
|
1296
|
+
| `min` | `Number` | `0` | Минимум. |
|
|
1297
|
+
| `max` | `Number` | `100` | Максимум. |
|
|
1298
|
+
| `step` | `Number` | `1` | Шаг. |
|
|
1299
|
+
| `show-value` | `Boolean` | `false` | Всплывающее значение при наведении / drag. |
|
|
1243
1300
|
|
|
1244
1301
|
### Слоты / Slots
|
|
1245
1302
|
|
|
1246
|
-
Default -
|
|
1303
|
+
Default - содержимое бегунка (`index`, `value` в слот-пропсах).
|
|
1247
1304
|
|
|
1248
1305
|
### Модель / Model
|
|
1249
1306
|
|
|
1250
|
-
model
|
|
1307
|
+
`v-model` — `Number` или `Number[]`
|
|
1251
1308
|
|
|
1252
1309
|
### Пример использования / Example Usage
|
|
1253
1310
|
|
|
1254
1311
|
```html
|
|
1312
|
+
<!-- один ползунок -->
|
|
1313
|
+
<sw-slider v-model="value" :min="0" :max="100" show-value />
|
|
1255
1314
|
|
|
1256
|
-
|
|
1257
|
-
<
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1315
|
+
<!-- несколько ползунков -->
|
|
1316
|
+
<script setup>
|
|
1317
|
+
import { ref } from 'vue'
|
|
1318
|
+
const multi = ref([15, 35, 60, 85])
|
|
1319
|
+
</script>
|
|
1320
|
+
<sw-slider
|
|
1321
|
+
v-model="multi"
|
|
1322
|
+
:min="0"
|
|
1323
|
+
:max="100"
|
|
1324
|
+
:step="1"
|
|
1262
1325
|
show-value
|
|
1263
|
-
class="custom-class"
|
|
1264
|
-
vertical
|
|
1265
1326
|
>
|
|
1266
|
-
|
|
1327
|
+
<template #default="{ value }">
|
|
1328
|
+
<!-- опционально: иконка внутри бегунка -->
|
|
1329
|
+
</template>
|
|
1267
1330
|
</sw-slider>
|
|
1268
1331
|
```
|
|
1269
1332
|
---
|
|
@@ -1678,6 +1741,48 @@ Default - для вкладок
|
|
|
1678
1741
|
|
|
1679
1742
|
## Изменения / Changelog
|
|
1680
1743
|
|
|
1744
|
+
### 0.13.11
|
|
1745
|
+
|
|
1746
|
+
**Alert**
|
|
1747
|
+
|
|
1748
|
+
- Параметры позиции: `placement` (`top` | `bottom`), `align` (`left` | `center` | `right`).
|
|
1749
|
+
- Стек: `top` — старые сверху; `bottom` — свежие сверху у нижнего края.
|
|
1750
|
+
- `type: 'error'` → класс `danger`; пустой `#footer` не рендерится.
|
|
1751
|
+
|
|
1752
|
+
**SwDropdown**
|
|
1753
|
+
|
|
1754
|
+
- Уголок к триггеру; сторона/смещение по фактическому placement (после flip).
|
|
1755
|
+
- Динамический `z-index` попапа: z предка + 3.
|
|
1756
|
+
- Удалён `SwDropdownNew`.
|
|
1757
|
+
|
|
1758
|
+
**SwFormItem**
|
|
1759
|
+
|
|
1760
|
+
- Подписи к полям: `label`, `type` (цвет текста), `justify`, слоты `#label` / default / `#before` / `#after`.
|
|
1761
|
+
|
|
1762
|
+
**SwGide**
|
|
1763
|
+
|
|
1764
|
+
- Динамический `z-index` оверлея (выше слайдеров/тултипов, ниже алертов).
|
|
1765
|
+
|
|
1766
|
+
**SwSlider**
|
|
1767
|
+
|
|
1768
|
+
- Без лага ползунка при drag (transition только на `transform`).
|
|
1769
|
+
- Сортировка значений массива при перетаскивании; тултип следует за активным бегунком.
|
|
1770
|
+
|
|
1771
|
+
**SwMessage**
|
|
1772
|
+
|
|
1773
|
+
- Блокировка прокрутки страницы при открытии.
|
|
1774
|
+
|
|
1775
|
+
---
|
|
1776
|
+
|
|
1777
|
+
- Alert: `placement` / `align` stacking; `error` → `danger`.
|
|
1778
|
+
- SwDropdown: caret toward trigger; dynamic popup z-index; removed `SwDropdownNew`.
|
|
1779
|
+
- SwFormItem: form captions (`label`, `type`, `justify`).
|
|
1780
|
+
- SwGide: dynamic overlay z-index.
|
|
1781
|
+
- SwSlider: no drag lag; array sort while dragging; tooltip follows active thumb.
|
|
1782
|
+
- SwMessage: lock body scroll while open.
|
|
1783
|
+
|
|
1784
|
+
---
|
|
1785
|
+
|
|
1681
1786
|
### 0.13.9
|
|
1682
1787
|
|
|
1683
1788
|
**Иконки: унификация `before` / `after`**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as e } from "./SwSelect-
|
|
1
|
+
import { t as e } from "./SwSelect-Bo9kUY7P.js";
|
|
2
2
|
import { computed as t, createBlock as n, createCommentVNode as r, createElementBlock as i, createTextVNode as a, defineComponent as o, normalizeClass as s, openBlock as c, renderSlot as l, resolveComponent as u, toDisplayString as d } from "vue";
|
|
3
3
|
//#region src/components/SwButton.vue?vue&type=script&setup=true&lang.ts
|
|
4
4
|
var f = /*@__PURE__*/ o({
|
|
@@ -25,33 +25,35 @@ var f = /*@__PURE__*/ o({
|
|
|
25
25
|
default: !1
|
|
26
26
|
},
|
|
27
27
|
label: { default: "" },
|
|
28
|
+
before: { default: "" },
|
|
29
|
+
after: { default: "" },
|
|
28
30
|
prefix: { default: "" },
|
|
29
31
|
postfix: { default: "" }
|
|
30
32
|
},
|
|
31
33
|
setup(e) {
|
|
32
|
-
let o = e, f = () => {
|
|
34
|
+
let o = e, f = t(() => o.before || o.prefix), p = t(() => o.after || o.postfix), m = () => {
|
|
33
35
|
if (o.href.length > 0) {
|
|
34
36
|
let e = document.createElement("a");
|
|
35
37
|
e.setAttribute("href", o.href), e.setAttribute("target", "_blank"), o.disabled || e.click();
|
|
36
38
|
}
|
|
37
|
-
},
|
|
39
|
+
}, h = t(() => {
|
|
38
40
|
let e = ["sw-button"];
|
|
39
41
|
return o.size.length > 0 && e.push("sw-" + o.size), o.type.length > 0 && e.push("sw-" + o.type), o.round && e.push("sw-round"), o.text && e.push("sw-text"), o.link && e.push("sw-link"), o.disabled && e.push("sw-disabled"), o.class.length > 0 && e.push(o.class), e;
|
|
40
42
|
});
|
|
41
43
|
return (t, o) => {
|
|
42
|
-
let
|
|
44
|
+
let g = u("sw-icon");
|
|
43
45
|
return c(), i("button", {
|
|
44
|
-
class: s(
|
|
45
|
-
onClick:
|
|
46
|
+
class: s(h.value),
|
|
47
|
+
onClick: m
|
|
46
48
|
}, [l(t.$slots, "default", {}, () => [
|
|
47
|
-
|
|
49
|
+
f.value ? (c(), n(g, {
|
|
48
50
|
key: 0,
|
|
49
|
-
iconClass:
|
|
51
|
+
iconClass: f.value
|
|
50
52
|
}, null, 8, ["iconClass"])) : r("", !0),
|
|
51
53
|
a(d(e.label), 1),
|
|
52
|
-
|
|
54
|
+
p.value ? (c(), n(g, {
|
|
53
55
|
key: 1,
|
|
54
|
-
iconClass:
|
|
56
|
+
iconClass: p.value
|
|
55
57
|
}, null, 8, ["iconClass"])) : r("", !0)
|
|
56
58
|
])], 2);
|
|
57
59
|
};
|