@studio-west/component-sw 0.13.9 → 0.13.10

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/README.md CHANGED
@@ -192,12 +192,14 @@ this.$Alert({message: 'Welcome!', type: 'success', prefix: 'Дополнител
192
192
  | `href` | `String` | `` | URL, на который будет перенаправлен пользователь при клике (если `link=true`). |
193
193
  | `disabled` | `Boolean` | `false` | Блокирует кнопку, делая её неактивной. |
194
194
  | `label` | `String` | `` | Текст кнопки (альтернатива содержимому слота). |
195
- | `prefix` | `String` | `` | Иконка перед текстом: имя из SVG-спрайта или URL (`https://…`). См. [SwIcon](#swicon). |
196
- | `postfix` | `String` | `` | Иконка после текста: имя из спрайта или URL. См. [SwIcon](#swicon). |
195
+ | `before` | `String` | `` | Иконка перед текстом: имя из SVG-спрайта или URL (`https://…`). См. [SwIcon](#swicon). |
196
+ | `after` | `String` | `` | Иконка после текста: имя из спрайта или URL. См. [SwIcon](#swicon). |
197
+ | `prefix` | `String` | `` | **Deprecated** (удалить в major) — используйте `before`. |
198
+ | `postfix` | `String` | `` | **Deprecated** (удалить в major) — используйте `after`. |
197
199
 
198
200
  ### Слоты / Slots
199
201
 
200
- Default - содержимое кнопки (текст, иконки или другие элементы). Если не указано, используется `label`, `prefix` и `postfix`.
202
+ Default - содержимое кнопки (текст, иконки или другие элементы). Если не указано, используется `label`, `before` и `after`.
201
203
 
202
204
  ### Пример использования / Example Usage
203
205
 
@@ -222,8 +224,8 @@ Default - содержимое кнопки (текст, иконки или д
222
224
  ```html
223
225
  <sw-button
224
226
  label="Сохранить"
225
- prefix="https://cdn.jsdelivr.net/npm/@tabler/icons@3.19.0/icons/outline/device-floppy.svg"
226
- postfix="https://cdn.jsdelivr.net/npm/@tabler/icons@3.19.0/icons/outline/arrow-right.svg"
227
+ before="https://cdn.jsdelivr.net/npm/@tabler/icons@3.19.0/icons/outline/device-floppy.svg"
228
+ after="https://cdn.jsdelivr.net/npm/@tabler/icons@3.19.0/icons/outline/arrow-right.svg"
227
229
  type="success"
228
230
  />
229
231
  ```
@@ -325,7 +327,7 @@ const open = ref(true)
325
327
 
326
328
  | Имя | Тип | По умолчанию | Значения/Описание |
327
329
  |--------------|------------------|--------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
328
- | `data` | `Object` | `new Date()` | Начальные данные - диапазон ( при `'solid'` - используется только `'startDate'`) изначальных выбранных дат {firstDate: '01-04-2025', endDate: '14-04-2025', startDate:'30-03-2025', holiday: { preholidays: ["2020-03-30"], holidays: ["2020-03-30"], holiday: ["2020-03-30"], nowork: ["2020-03-30"] }}, ограничение не более 2х месяцев. firstDate - выбор месяца календаря при отсутствии startDate |
330
+ | `data` | `Object` | `new Date()` | Начальные данные — диапазон (при `'solid'` только `'startDate'`): `{ firstDate, startDate, endDate, holiday: { weekend, preholiday, holiday, nowork } }`. `firstDate` — месяц при отсутствии `startDate`. **Deprecated** в `holiday` (удалить в major): `holidays` → `weekend`, `preholidays` → `preholiday`. |
329
331
  | `limitation` | `Boolean, Array` | `false` | Ограничения недоступных дат. Элементы работают по-разному: только `endDate` — всё ≤ даты; только `startDate` — всё ≥ даты; оба поля — закрытый диапазон (или инвертированный, если `endDate` < `startDate`). Пример: `[{ endDate: '14-04-2025' }, { startDate: '01-09-2025' }, { startDate: '30-03-2025', endDate: '14-04-2025' }]`. |
330
332
  | `range` | `String` | `solid` | Тип календаря: `'decades'`,`'year'`,`'range'`, `'solid'`. |
331
333
 
@@ -443,7 +445,8 @@ model - состояние меню, булевое значение откры
443
445
  | `class` | `String` | `sw-dropdown-item` | Добавляет пользовательский CSS-класс к компоненту. |
444
446
  | `size` | `String` | `` | Размер поля: `'large'`, `'small'`. |
445
447
  | `type` | `String` | `info` | `'primary'`, `'success'`, `'info'`, `'warning'`, `'danger'`. |
446
- | `iconBefore` | `String` | `` | Иконка в начале: имя из спрайта или URL. См. [SwIcon](#swicon). |
448
+ | `before` | `String` | `` | Иконка в начале: имя из спрайта или URL. См. [SwIcon](#swicon). |
449
+ | `iconBefore` | `String` | `` | **Deprecated** (удалить в major) — используйте `before`. |
447
450
 
448
451
  ### Слоты / Slots
449
452
 
@@ -455,7 +458,7 @@ Default - текст названия или модуль
455
458
  <sw-dropdown class="custom-class" :max-width="250">
456
459
  <sw-button label="Меню" type="primary" />
457
460
  <template #dropdown>
458
- <sw-dropdown-item icon-before="https://cdn.jsdelivr.net/npm/@tabler/icons@3.19.0/icons/outline/files.svg">содержание / context</sw-dropdown-item>
461
+ <sw-dropdown-item before="https://cdn.jsdelivr.net/npm/@tabler/icons@3.19.0/icons/outline/files.svg">содержание / context</sw-dropdown-item>
459
462
  </template>
460
463
  </sw-dropdown>
461
464
  ```
@@ -594,7 +597,7 @@ const documentFiles = ref([])
594
597
 
595
598
  Если `iconClass` начинается с `http://`, `https://`, иконка загружается как внешний SVG через CSS `mask` (класс `sw-external-icon`). Иначе используется символ из спрайта: `#prefix-iconClass`.
596
599
 
597
- Компонент используется внутри SwButton (`prefix`, `postfix`), SwInput и SwAlert (`before`, `after`), SwDropdownItem (`iconBefore`), SwSection и SwMessage (`iconAfter`) — во всех этих props можно передавать как имя из спрайта, так и полный URL.
600
+ Компонент используется внутри SwButton, SwInput, SwAlert, SwDropdownItem, SwSection, SwMessage, SwGide (`before` / `after`) — во всех этих props можно передавать как имя из спрайта, так и полный URL. Старые имена (`prefix`/`postfix`, `iconBefore`, `iconAfter`, `iconClose`) пока работают, будут удалены в major.
598
601
 
599
602
  ### Свойства / Properties
600
603
 
@@ -625,7 +628,8 @@ const documentFiles = ref([])
625
628
  | Имя | Тип | По умолчанию | Значения/Описание |
626
629
  |--------------|-----------|--------------|--------------------------------------------------------------------------------------------------------------------------------------------------------|
627
630
  | `steps` | `Array` | `() => []` | Массив шагов обучения. [{header: 'заголовок',text: 'текст сообщения',tag: 'тег,якорь или класс', placement: 'место всплытия', img: 'src картинки' }], |
628
- | `iconClose` | `String` | `` | Иконка закрытия: имя из спрайта или URL. См. [SwIcon](#swicon). |
631
+ | `after` | `String` | `` | Иконка закрытия: имя из спрайта или URL. См. [SwIcon](#swicon). |
632
+ | `iconClose` | `String` | `` | **Deprecated** (удалить в major) — используйте `after`. |
629
633
  | `maxWidth` | `Number` | `250` | Ширина всплывающего окна в px (без картинки). по умолчанию 250 |
630
634
 
631
635
  ### Слоты / Slots
@@ -657,7 +661,7 @@ const steps = ref([
657
661
  }
658
662
  ])
659
663
  </script>
660
- <sw-gide v-if="settings.gide" :steps="steps" v-model="step" @close="settings.gide=false" icon-close="https://cdn.jsdelivr.net/npm/@tabler/icons@3.19.0/icons/outline/x.svg">
664
+ <sw-gide v-if="settings.gide" :steps="steps" v-model="step" @close="settings.gide=false" after="https://cdn.jsdelivr.net/npm/@tabler/icons@3.19.0/icons/outline/x.svg">
661
665
  <template #header>
662
666
  Блок {{ steps[step].header }}
663
667
  <sw-button type="primary" link @click="settings.gide=false"><sw-icon icon-class="https://cdn.jsdelivr.net/npm/@tabler/icons@3.19.0/icons/outline/x.svg" /></sw-button>
@@ -853,7 +857,7 @@ const menuConfig = {
853
857
  'SwButton': {
854
858
  label: 'Нажми меня',
855
859
  type: 'primary',
856
- prefix: 'https://cdn.jsdelivr.net/npm/@tabler/icons@3.19.0/icons/outline/star.svg'
860
+ before: 'https://cdn.jsdelivr.net/npm/@tabler/icons@3.19.0/icons/outline/star.svg'
857
861
  },
858
862
  'SwSwitch': [
859
863
  {
@@ -960,19 +964,19 @@ const dropdownMenu = {
960
964
  'SwButton': {
961
965
  label: 'Меню',
962
966
  type: 'primary',
963
- postfix: 'https://cdn.jsdelivr.net/npm/@tabler/icons@3.19.0/icons/outline/chevron-down.svg'
967
+ after: 'https://cdn.jsdelivr.net/npm/@tabler/icons@3.19.0/icons/outline/chevron-down.svg'
964
968
  }
965
969
  },
966
970
  'slot.dropdown': [
967
971
  {
968
972
  'SwDropdownItem': {
969
- iconBefore: 'https://cdn.jsdelivr.net/npm/@tabler/icons@3.19.0/icons/outline/user.svg',
973
+ before: 'https://cdn.jsdelivr.net/npm/@tabler/icons@3.19.0/icons/outline/user.svg',
970
974
  slot: 'Профиль'
971
975
  }
972
976
  },
973
977
  {
974
978
  'SwDropdownItem': {
975
- iconBefore: 'https://cdn.jsdelivr.net/npm/@tabler/icons@3.19.0/icons/outline/settings.svg',
979
+ before: 'https://cdn.jsdelivr.net/npm/@tabler/icons@3.19.0/icons/outline/settings.svg',
976
980
  slot: 'Настройки'
977
981
  }
978
982
  }
@@ -1004,7 +1008,7 @@ import { components } from '@studio-west/component-sw'
1004
1008
  const complexMenu = {
1005
1009
  'SwSection': {
1006
1010
  name: 'Панель управления',
1007
- iconAfter: 'https://cdn.jsdelivr.net/npm/@tabler/icons@3.19.0/icons/outline/chevron-down.svg',
1011
+ after: 'https://cdn.jsdelivr.net/npm/@tabler/icons@3.19.0/icons/outline/chevron-down.svg',
1008
1012
  slot: 'Основное содержимое секции',
1009
1013
  'slot.footer': {
1010
1014
  'SwButtonGroup': {
@@ -1052,7 +1056,8 @@ const complexMenu = {
1052
1056
  |-------------|-----------|--------------|-----------------------------------------------------------------------------------------|
1053
1057
  | `name` | `String` | `` | Добавляет текстовый заголовок, при отсутствии реализован слот `"header"`. |
1054
1058
  | `class` | `String` | `sw-section` | Добавляет пользовательский CSS-класс к компоненту. |
1055
- | `iconAfter` | `String` | `` | Иконка кнопки закрытия (при заголовке): имя из спрайта или URL. См. [SwIcon](#swicon). |
1059
+ | `after` | `String` | `` | Иконка кнопки закрытия (при заголовке): имя из спрайта или URL. См. [SwIcon](#swicon). |
1060
+ | `iconAfter` | `String` | `` | **Deprecated** (удалить в major) — используйте `after`. |
1056
1061
 
1057
1062
  ### Слоты / Slots
1058
1063
 
@@ -1077,7 +1082,7 @@ model - состояние компонента булевое значение,
1077
1082
  v-model="model"
1078
1083
  name="Message"
1079
1084
  class="custom-class"
1080
- icon-after="https://cdn.jsdelivr.net/npm/@tabler/icons@3.19.0/icons/outline/x.svg"
1085
+ after="https://cdn.jsdelivr.net/npm/@tabler/icons@3.19.0/icons/outline/x.svg"
1081
1086
  >
1082
1087
  <p>Описание / Description</p>
1083
1088
  </sw-message>
@@ -1094,7 +1099,8 @@ model - состояние компонента булевое значение,
1094
1099
  |-------------|-----------|--------------|---------------------------------------------------------------------|
1095
1100
  | `name` | `String` | `` | Добавляет заголовок в секцию. |
1096
1101
  | `class` | `String` | `sw-section` | Добавляет пользовательский CSS-класс к компоненту. |
1097
- | `iconAfter` | `String` | `` | Иконка в заголовке: имя из спрайта или URL. См. [SwIcon](#swicon). |
1102
+ | `after` | `String` | `` | Иконка в заголовке: имя из спрайта или URL. См. [SwIcon](#swicon). |
1103
+ | `iconAfter` | `String` | `` | **Deprecated** (удалить в major) — используйте `after`. |
1098
1104
 
1099
1105
  ### Слоты / Slots
1100
1106
 
@@ -1114,7 +1120,7 @@ header - клик по всему Header
1114
1120
  <sw-section
1115
1121
  name="section"
1116
1122
  class="custom-class"
1117
- icon-after="https://cdn.jsdelivr.net/npm/@tabler/icons@3.19.0/icons/outline/x.svg"
1123
+ after="https://cdn.jsdelivr.net/npm/@tabler/icons@3.19.0/icons/outline/x.svg"
1118
1124
  >
1119
1125
  <p>Содержимое / Content</p>
1120
1126
  <template #footer>
@@ -1672,6 +1678,25 @@ Default - для вкладок
1672
1678
 
1673
1679
  ## Изменения / Changelog
1674
1680
 
1681
+ ### 0.13.9
1682
+
1683
+ **Иконки: унификация `before` / `after`**
1684
+
1685
+ - Единые пропсы иконок: `before` (слева) и `after` (справа) в `SwButton`, `SwDropdownItem`, `SwMessage`, `SwSection`, `SwGide`, `Alert`.
1686
+ - Старые имена сохранены и помечены **Deprecated** (удалить в major): `prefix`/`postfix` (SwButton), `iconBefore`, `iconAfter`, `iconClose`.
1687
+
1688
+ **SwDatePicker**
1689
+
1690
+ - В `data.holiday`: `weekend` вместо `holidays`, `preholiday` вместо `preholidays` (старые ключи — **Deprecated**, удалить в major).
1691
+
1692
+ ---
1693
+
1694
+ - Unified icon props: `before` / `after` across `SwButton`, `SwDropdownItem`, `SwMessage`, `SwSection`, `SwGide`, `Alert`.
1695
+ - Legacy names kept and marked **Deprecated** (remove in major): `prefix`/`postfix` (SwButton), `iconBefore`, `iconAfter`, `iconClose`.
1696
+ - `SwDatePicker` `data.holiday`: `weekend` / `preholiday` (legacy `holidays` / `preholidays` deprecated).
1697
+
1698
+ ---
1699
+
1675
1700
  ### 0.13.4
1676
1701
 
1677
1702
  **SwFile**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@studio-west/component-sw",
3
- "version": "0.13.9",
3
+ "version": "0.13.10",
4
4
  "description": "Vue components of Component-SW collection.",
5
5
  "type": "module",
6
6
  "keywords": [
package/types/index.d.ts CHANGED
@@ -15,7 +15,11 @@ export interface AlertOptions {
15
15
  duration?: number
16
16
  showClose?: boolean
17
17
  onClose?: () => void
18
+ before?: string
19
+ after?: string
20
+ /** Слот #prefix (для иконки — `before`) */
18
21
  prefix?: string | (() => any)
22
+ /** Слот #suffix (для иконки — `after`) */
19
23
  suffix?: string | (() => any)
20
24
  footer?: string | (() => any)
21
25
  }
@@ -34,6 +38,13 @@ export interface SwButtonProps {
34
38
  link?: boolean
35
39
  href?: string
36
40
  disabled?: boolean
41
+ label?: string
42
+ before?: string
43
+ after?: string
44
+ /** @deprecated удалить в major — используйте `before` */
45
+ prefix?: string
46
+ /** @deprecated удалить в major — используйте `after` */
47
+ postfix?: string
37
48
  }
38
49
 
39
50
  export interface SwInputProps {