sprof 0.2.4 → 0.2.7

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 (63) hide show
  1. package/README.md +163 -11
  2. package/dist/{ExtractsList-CqMn_6Rp.js → ExtractsList-BNHHbmEu.js} +1 -1
  3. package/dist/core/components/CarouselImages.vue.d.ts +1 -1
  4. package/dist/core/components/GeneralItem.vue.d.ts +1 -1
  5. package/dist/core/components/GridContainer.vue.d.ts +1 -1
  6. package/dist/core/components/InfoItem.vue.d.ts +3 -3
  7. package/dist/core/components/atoms/PBadge/PBadge.stories.d.ts +471 -0
  8. package/dist/core/components/atoms/PBadge/PBadge.test.d.ts +1 -0
  9. package/dist/core/components/atoms/PBadge/PBadge.vue.d.ts +84 -0
  10. package/dist/core/components/atoms/PButton/PButton.stories.d.ts +6 -6
  11. package/dist/core/components/atoms/PButton/PButton.vue.d.ts +1 -1
  12. package/dist/core/components/atoms/PCheckbox/PCheckBox.stories.d.ts +2 -2
  13. package/dist/core/components/atoms/PCheckbox/PCheckBox.vue.d.ts +1 -1
  14. package/dist/core/components/atoms/PChip/PChip.stories.d.ts +639 -0
  15. package/dist/core/components/atoms/PChip/PChip.test.d.ts +1 -0
  16. package/dist/core/components/atoms/PChip/PChip.vue.d.ts +85 -0
  17. package/dist/core/components/atoms/PDatePicker/PDatePicker.stories.d.ts +469 -0
  18. package/dist/core/components/atoms/PDialog/PDialog.stories.d.ts +235 -0
  19. package/dist/core/components/atoms/PDialog/PDialog.test.d.ts +1 -0
  20. package/dist/core/components/atoms/PDialog/PDialog.vue.d.ts +62 -0
  21. package/dist/core/components/atoms/PFlex/PFlex.stories.d.ts +6 -6
  22. package/dist/core/components/atoms/PFlex/PFlex.vue.d.ts +1 -1
  23. package/dist/core/components/atoms/PInput/PInput.stories.d.ts +8 -14
  24. package/dist/core/components/atoms/PInput/PInput.vue.d.ts +3 -6
  25. package/dist/core/components/atoms/PInputDate/PInputDate.stories.d.ts +2 -2
  26. package/dist/core/components/atoms/PInputDate/PInputDate.vue.d.ts +1 -1
  27. package/dist/core/components/atoms/PLabelField/PLabelField.stories.d.ts +6 -6
  28. package/dist/core/components/atoms/PLabelField/PLabelField.vue.d.ts +1 -1
  29. package/dist/core/components/atoms/PList/PList.stories.d.ts +6 -6
  30. package/dist/core/components/atoms/PList/PList.vue.d.ts +1 -1
  31. package/dist/core/components/atoms/PRadio/PRadio.stories.d.ts +2 -2
  32. package/dist/core/components/atoms/PRadio/PRadio.vue.d.ts +1 -1
  33. package/dist/core/components/atoms/PSelect/PSelect.stories.d.ts +12 -52
  34. package/dist/core/components/atoms/PSelect/PSelect.vue.d.ts +4 -24
  35. package/dist/core/components/atoms/PString/PString.stories.d.ts +2 -2
  36. package/dist/core/components/atoms/PString/PString.vue.d.ts +1 -1
  37. package/dist/core/components/atoms/PTable/{PTable.storeis.d.ts → PTable.stories.d.ts} +8 -9
  38. package/dist/core/components/atoms/PTable/PTable.vue.d.ts +1 -1
  39. package/dist/core/components/atoms/PToggle/PToggle.stories.d.ts +248 -0
  40. package/dist/core/components/atoms/PToggle/PToggle.test.d.ts +1 -0
  41. package/dist/core/components/atoms/PToggle/PToggle.vue.d.ts +71 -0
  42. package/dist/core/components/atoms/__consumer__/consumer-render.test.d.ts +1 -0
  43. package/dist/core/components/atoms/__consumer__/q-imports.test.d.ts +1 -0
  44. package/dist/core/components/atoms/index.d.ts +5 -1
  45. package/dist/core/components/molecules/PAdd/PContainerStickyHead.vue.d.ts +1 -1
  46. package/dist/core/components/molecules/PModal/PModal.vue.d.ts +2 -2
  47. package/dist/core/components/organisms/PAuthForm/PAuthForm.stories.d.ts +16 -22
  48. package/dist/core/components/organisms/PAuthForm/PAuthForm.vue.d.ts +8 -11
  49. package/dist/core/components/organisms/PAuthModal/PAuthModal.stories.d.ts +2 -2
  50. package/dist/core/components/organisms/PAuthModal/PAuthModal.vue.d.ts +1 -1
  51. package/dist/core/components/organisms/PUploaderFile/PUploaderFile.stories.d.ts +9 -9
  52. package/dist/core/components/organisms/PUploaderFile/PUploaderFile.vue.d.ts +1 -1
  53. package/dist/global-components.d.ts +78 -0
  54. package/dist/{index-8p7UPAAQ.js → index-T6suvcZB.js} +4143 -3985
  55. package/dist/index.d.ts +6 -0
  56. package/dist/modules/forms/components/Fields/DateField.vue.d.ts +1 -1
  57. package/dist/modules/forms/components/Fields/FieldsComponentsMap.d.ts +1 -1
  58. package/dist/modules/forms/components/admin/AdminFormPage.vue.d.ts +1 -1
  59. package/dist/sprof.js +18 -13
  60. package/dist/sprof.umd.cjs +10 -10
  61. package/dist/style.css +1 -1
  62. package/dist/test-utils/quasar-minimal.d.ts +6 -0
  63. package/package.json +15 -16
package/README.md CHANGED
@@ -1,29 +1,181 @@
1
- # services front
1
+ # sprof — UI Kit & Platform Library (PF)
2
2
 
3
- <!-- ## Project setup
3
+ Библиотека UI-компонентов и платформенного ядра для проектов на **Vue 3 + Quasar 2**.
4
+ Используется в rdkb (map/hr/food/leiter), portal и pros.
4
5
 
6
+ - **P-компоненты** — обёртки над Quasar (полный проброс props/slots/events)
7
+ - **PF / PFM** — платформенное ядро: helpers, store (BaseStore), FTSP, UI (Notify/Dialog), auth,
8
+ модули (Buildings, Docs, Forms, Pages, Settings, Chats, Extracts, Menus)
9
+ - **installSprof** — регистрация всех P-компонентов + Quasar-плагинов одной строкой
10
+
11
+ ---
12
+
13
+ ## 📦 Установка
14
+
15
+ ```bash
16
+ npm install sprof
5
17
  ```
6
- npm install
18
+
19
+ ### Требования (peer dependencies)
20
+
21
+ | Пакет | Версия | Обязателен |
22
+ | --- | --- | --- |
23
+ | `vue` | ^3.4 | да |
24
+ | `quasar` | ^2.21 | да |
25
+ | `axios` | ^1.6 | нет (auth) |
26
+ | `vue-router` | ^4.3 | нет |
27
+
28
+ Приложение должно использовать **Quasar 2** — P-компоненты рендерят Q-компоненты напрямую
29
+ (импортируют их из `quasar`), поэтому Quasar CSS уже должен быть подключён.
30
+
31
+ ## 🚀 Подключение
32
+
33
+ ```ts
34
+ // main.ts (или boot-файл Quasar)
35
+ import { createApp } from 'vue';
36
+ import { installSprof } from 'sprof';
37
+
38
+ const app = createApp(App);
39
+ installSprof(app); // Quasar-плагины Notify+Dialog + все P-компоненты
40
+ app.mount('#app');
7
41
  ```
8
42
 
9
- ### Compiles and hot-reloads for development
43
+ Если Quasar уже настроен (Quasar CLI):
44
+
45
+ ```ts
46
+ import { installSprof } from 'sprof';
10
47
 
48
+ export default boot(({ app }) => {
49
+ installSprof(app, { quasarPlugins: false }); // плагины уже есть в quasar.config.ts
50
+ });
11
51
  ```
12
- npm run serve
52
+
53
+ ### Типы глобальных P-компонентов
54
+
55
+ Декларация генерируется из реестров (`scripts/gen-global-components.mjs`) и поставляется
56
+ в пакете. В проекте достаточно одного файла:
57
+
58
+ ```ts
59
+ // src/types/sprof-components.d.ts
60
+ import type {} from 'sprof';
61
+ export {};
13
62
  ```
14
63
 
15
- ### Compiles and minifies for production
64
+ Ничего вручную дописывать не нужно — все 69 P-компонентов (атомы, молекулы, организмы)
65
+ типизируются в шаблонах автоматически.
66
+
67
+ ---
68
+
69
+ ## 🧱 P-компоненты (обёртки над Quasar)
70
+
71
+ Общий принцип: **весь API Quasar работает как есть** — props/events передаются насквозь,
72
+ слоты пробрасываются, `:disable`/`color`/`size` и др. имеют приоритет над P-пропсами.
73
+
74
+ ### Атомы (24)
75
+
76
+ | Компонент | Обёртка над | Особенности |
77
+ | --- | --- | --- |
78
+ | `PButton` | QBtn | нативный click, `type=submit/reset`, attrs-приоритет, legacy `skin` |
79
+ | `PInput` | QInput | все слоты, `v-model` string/number/null, `rules`, `width` |
80
+ | `PSelect` | QSelect | все слоты, модель `any` |
81
+ | `PCheckBox` | QCheckbox | v-model boolean |
82
+ | `PToggle` | QToggle | v-model boolean, label, size |
83
+ | `PDialog` | QDialog | v-model boolean, persistent/maximized, слоты title/header/body/footer |
84
+ | `PChip` | QChip | label/color/outline/removable, слоты avatar/remove |
85
+ | `PBadge` | QBadge | label/color/outline/rounded/floating/multiLine |
86
+ | `PRadio` | QRadio | v-model, label, size |
87
+ | `PInputNumber` | QInput + QBtn | step/min/max, кнопки +/− |
88
+ | `PDatePicker` | QInput | дата (legacy, см. PInputDate) |
89
+ | `PInputDate` | QInput | дата |
90
+ | `PTextarea` | QInput | resize, mask |
91
+ | `PTooltip` | QTooltip | timeout, позиционирование, typeStyle |
92
+ | `PString` | QItemLabel | текст с цветом/размером, isHtml |
93
+ | `PLabelField` | QItemLabel | подпись с отступами |
94
+ | `PFlex` | div | flex-контейнер |
95
+ | `PList` / `PListItem` | QList / QItem | списки |
96
+ | `PLeftSlider` / `PRightSlider` / `PTopSlider` | QBtn | выдвижные панели |
97
+ | `PSticky` | div | sticky-обёртка |
98
+ | `PTable` | table (HTML) | простая таблица со слотами |
99
+
100
+ ### Молекулы/организмы (основные)
16
101
 
102
+ `PAdd`, `PDel`, `PModal`, `PContainer`, `PContainerStickyHead`, `PTabs`, `PUploaderFile`,
103
+ `PUploaderImage`, `PAuthForm`, `PAuthModal`, `PNameEdit`, `PNotify`, `PLoader`, `PPagination`,
104
+ `PAutocomplete`, `PhoneForm`, `DateInputRange`, `FilterSelect`, `SortList`, `ThemeWrapper`
105
+ и др. — полный список в реестрах `src/core/components/*/index.ts`.
106
+
107
+ ---
108
+
109
+ ## 🏛 PF — платформенное ядро
110
+
111
+ | Объект | Описание |
112
+ | --- | --- |
113
+ | `PF` | helpers, store (BaseStore), FTSP, UI (Notify/Dialog), auth, types |
114
+ | `PFM` | модули: Buildings, Docs, Forms, Pages, Settings, Chats, Extracts, Menus |
115
+
116
+ ```ts
117
+ import { PF, PFM } from 'sprof';
17
118
  ```
18
- npm run build
119
+
120
+ ---
121
+
122
+ ## 🔄 Миграция q-* → P-*
123
+
124
+ Зачем: единые обёртки (проброс всего API Quasar) + платформенные типы + точка расширения.
125
+
126
+ | Было | Стало | Примечание |
127
+ | --- | --- | --- |
128
+ | `<q-btn ...>` | `<PButton ...>` | attrs совместимы; `@click` нативный |
129
+ | `<q-input ...>` | `<PInput ...>` | все слоты/события работают |
130
+ | `<q-select ...>` | `<PSelect ...>` | модель any |
131
+ | `<q-checkbox ...>` | `<PCheckBox ...>` | |
132
+ | `<q-toggle ...>` | `<PToggle ...>` | |
133
+ | `<q-dialog ...>` | `<PDialog ...>` | |
134
+ | `<q-chip ...>` | `<PChip ...>` | |
135
+ | `<q-badge ...>` | `<PBadge ...>` | |
136
+
137
+ `q-icon` и низкоуровневые q-компоненты (q-card/q-item/q-td и т.п.) можно не переводить.
138
+
139
+ ⚠️ **Важно (баг 0.2.3/0.2.4)**: P-компоненты обязаны импортировать Q-компоненты из `quasar`
140
+ явно — без этого в клиентах с auto-import Quasar элементы «пропадают» (Vue рендерит пустые
141
+ `<pbutton>`/`<qbtn>`). Защита: тесты `src/core/components/atoms/__consumer__/` и
142
+ `npm run check:dist`.
143
+
144
+ ---
145
+
146
+ ## 🧪 Разработка
147
+
148
+ ```bash
149
+ npm run test # vitest (234 теста, 35 файлов)
150
+ npm run lint # eslint src --fix
151
+ npm run lint:check # eslint src (без мутаций, для CI)
152
+ npm run build # сборка dist (ESM + UMD + d.ts)
153
+ npm run check:dist # проверка бандла: нет resolveComponent("Q…")
154
+ npm run storybook # Storybook (документация компонентов)
19
155
  ```
20
156
 
21
- ### Lints and fixes files
157
+ ### Публикация
22
158
 
159
+ ```bash
160
+ ./publish.sh # bump patch + тесты + сборка + npm publish (2FA) + git tag
161
+ # или вручную: npm run test && npm run build && npm run check:dist && npm publish
23
162
  ```
24
- npm run lint
163
+
164
+ Либо GitHub Actions `publish.yml` (workflow_dispatch, OTP-инпут).
165
+
166
+ После публикации обновить клиентов: `npm i sprof@<версия> --save` в каждом клиенте
167
+ (rdkb ×4, portal, pros), `quasar build` ×6, `make deploy` ×3.
168
+
169
+ ### Генерация типов GlobalComponents
170
+
171
+ ```bash
172
+ node scripts/gen-global-components.mjs # после добавления/удаления P-компонентов
25
173
  ```
26
174
 
27
- ### Customize configuration
175
+ ---
176
+
177
+ ## 📋 Полезное
28
178
 
29
- See [Configuration Reference](https://cli.vuejs.org/config/). -->
179
+ - Реестр задач и роадмап — [`TASKS.md`](TASKS.md)
180
+ - История изменений — [`CHANGELOG.md`](CHANGELOG.md)
181
+ - Заметки для агентов — [`AGENT.md`](AGENT.md)
@@ -1,5 +1,5 @@
1
1
  import { defineComponent as d, resolveComponent as l, openBlock as i, createElementBlock as C, Fragment as P, createVNode as m, unref as o, ref as u, createBlock as E, withCtx as k, createCommentVNode as v } from "vue";
2
- import { _ as f, P as w } from "./index-8p7UPAAQ.js";
2
+ import { _ as f, P as w } from "./index-T6suvcZB.js";
3
3
  import "quasar";
4
4
  const B = /* @__PURE__ */ d({
5
5
  __name: "ExtractCreateForm",
@@ -55,8 +55,8 @@ declare const _default: import('vue').DefineComponent<globalThis.ExtractPropType
55
55
  }>> & Readonly<{
56
56
  onOpenModalWindow?: ((...args: any[]) => any) | undefined;
57
57
  }>, {
58
- height: string;
59
58
  maxHeight: string;
59
+ height: string;
60
60
  quantity: number;
61
61
  animationTime: number;
62
62
  startActiveGroupIndex: number;
@@ -102,8 +102,8 @@ declare const _default: __VLS_WithTemplateSlots<import('vue').DefineComponent<gl
102
102
  };
103
103
  }>> & Readonly<{}>, {
104
104
  padding: string;
105
- margin: string;
106
105
  width: string;
106
+ margin: string;
107
107
  height: string;
108
108
  fontSize: string;
109
109
  background: string;
@@ -81,8 +81,8 @@ declare const _default: __VLS_WithTemplateSlots<import('vue').DefineComponent<gl
81
81
  default: string;
82
82
  };
83
83
  }>> & Readonly<{}>, {
84
- margin: string;
85
84
  width: string;
85
+ margin: string;
86
86
  maxWidth: string;
87
87
  background: string;
88
88
  gridGap: string;
@@ -202,19 +202,19 @@ declare const _default: __VLS_WithTemplateSlots<import('vue').DefineComponent<gl
202
202
  padding: string;
203
203
  title: string;
204
204
  close: boolean;
205
- margin: string;
206
205
  width: string;
206
+ margin: string;
207
207
  height: string;
208
208
  maxWidth: string;
209
209
  minWidth: string;
210
210
  background: string;
211
211
  borderColor: string;
212
212
  customClass: string;
213
- withOpenWindow: boolean;
214
- withHover: boolean;
215
213
  openWidth: string;
216
214
  openHeight: string;
215
+ withOpenWindow: boolean;
217
216
  colorSelected: string;
217
+ withHover: boolean;
218
218
  baseBoxMargin: string;
219
219
  closeWindowOverflow: string;
220
220
  showSaveDialog: boolean;