elcrm 1.1.21 → 1.1.22
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/dist/index.js
CHANGED
|
@@ -3899,16 +3899,23 @@ function isMainComponentDoc(doc) {
|
|
|
3899
3899
|
return false;
|
|
3900
3900
|
return doc.length > 72;
|
|
3901
3901
|
}
|
|
3902
|
-
function
|
|
3902
|
+
function componentDocs(content, slug) {
|
|
3903
3903
|
const fnAnchor = "export declare function " + slug;
|
|
3904
3904
|
const propsAnchor = "export type " + slug + "Props";
|
|
3905
3905
|
const fnDoc = leadingDoc(content, fnAnchor);
|
|
3906
3906
|
const propsDoc = leadingDoc(content, propsAnchor);
|
|
3907
|
-
|
|
3908
|
-
|
|
3909
|
-
if (
|
|
3910
|
-
|
|
3911
|
-
|
|
3907
|
+
const examplesDoc = fnDoc.includes("@example") ? fnDoc : propsDoc.includes("@example") ? propsDoc : fnDoc || propsDoc;
|
|
3908
|
+
let descriptionDoc = fnDoc || propsDoc;
|
|
3909
|
+
if (propsDoc.includes("@example")) {
|
|
3910
|
+
descriptionDoc = propsDoc;
|
|
3911
|
+
} else if (isMainComponentDoc(propsDoc) && propsDoc.length > fnDoc.length) {
|
|
3912
|
+
descriptionDoc = propsDoc;
|
|
3913
|
+
} else if (isMainComponentDoc(fnDoc)) {
|
|
3914
|
+
descriptionDoc = fnDoc;
|
|
3915
|
+
} else if (isMainComponentDoc(propsDoc)) {
|
|
3916
|
+
descriptionDoc = propsDoc;
|
|
3917
|
+
}
|
|
3918
|
+
return { descriptionDoc, examplesDoc };
|
|
3912
3919
|
}
|
|
3913
3920
|
function leadingDoc(content, anchor) {
|
|
3914
3921
|
const idx = content.indexOf(anchor);
|
|
@@ -3976,15 +3983,15 @@ function parseComponentDts(content, slug) {
|
|
|
3976
3983
|
if (!new RegExp("export declare function " + slug + "\\b").test(content)) {
|
|
3977
3984
|
return null;
|
|
3978
3985
|
}
|
|
3979
|
-
const
|
|
3986
|
+
const { descriptionDoc, examplesDoc } = componentDocs(content, slug);
|
|
3980
3987
|
const propsMatch = content.match(new RegExp("export type " + slug + "Props\\s*=\\s*([\\s\\S]*?);\\s*(?:export|$)"));
|
|
3981
3988
|
const propsBlock = propsMatch?.[1] ?? "";
|
|
3982
3989
|
return {
|
|
3983
3990
|
slug,
|
|
3984
3991
|
title: slug,
|
|
3985
|
-
description: descriptionFromDoc(
|
|
3992
|
+
description: descriptionFromDoc(descriptionDoc) || slug,
|
|
3986
3993
|
importFrom: "@elcrm/components",
|
|
3987
|
-
examples: examplesFromDoc(
|
|
3994
|
+
examples: examplesFromDoc(examplesDoc),
|
|
3988
3995
|
props: propsFromPropsBlock(propsBlock)
|
|
3989
3996
|
};
|
|
3990
3997
|
}
|
package/package.json
CHANGED
|
@@ -14,7 +14,7 @@ Shell UI: оболочка, шапка, секции, списки, Dropdown / R
|
|
|
14
14
|
import {
|
|
15
15
|
Layout, Header, Footer, Brand, Avatar, AvatarName, AvatarGroup, Badge,
|
|
16
16
|
Menu, Dropdown, Section, NavSections, TabSections, Breadcrumb, Stack,
|
|
17
|
-
Card, Stat, ActionGroup, TextGroup, ItemColumn, List, Item, PageHead, PageShell, ChatList, ChatMessages, ChatSplit, Sidebar, Popover,
|
|
17
|
+
Card, Stat, ActionGroup, Toolbar, TextGroup, ItemColumn, List, Item, PageHead, PageShell, ChatList, ChatMessages, ChatSplit, Sidebar, Popover,
|
|
18
18
|
Healthmap, PanelInfo,
|
|
19
19
|
Loading, EmptyState, RadioGroup, PricingGroup, PricingTable,
|
|
20
20
|
createLazyResolver,
|
|
@@ -37,7 +37,8 @@ import type { PricingPlan, HealthmapData } from "@elcrm/components";
|
|
|
37
37
|
- **Stat** — метрика: `label` + `value`, `tone` как у Badge, `labelMuted`. Не собирать из `span` в приложении.
|
|
38
38
|
- **Healthmap** — теплокарта дней (`data.days`). Данные грузит приложение; слоты `brandName` / `brandSub` / `unit` / `hint`. Токены `--healthmap-cell`, `--healthmap-gap`, `--healthmap-l0`…`l4`.
|
|
39
39
|
- **PanelInfo** — выезд справа (шапка / body / footer). На узком экране — оверлей. Слоты: `children`, `footer`, `headerExtra`, `close`. Токены `--panel-info-width`, `--panel-info-width-min`, `--panel-info-overlay-max`, `--panel-info-backdrop`.
|
|
40
|
-
- **ActionGroup** —
|
|
40
|
+
- **ActionGroup** — ряд иконок в карточке / строке: `label` + `items` и/или `children`. Кнопки — `@elcrm/button`.
|
|
41
|
+
- **Toolbar** — фильтры над списком. `size` (`s`/`m`/`l`, по умолчанию `s`) наследуют вложенные `*Field`, `Search`, `Button`, `Dropdown` (свой `size` важнее). `align`: `start` / `center` / `end` / `between`. `width`: `l` (100%, по умолчанию) или `s` (по контенту, не растягивать). Токены `--toolbar-gap`. Не `ActionGroup`.
|
|
41
42
|
- **TextGroup** — две строки: `title` + `description` (без аватара; с аватаром — AvatarName).
|
|
42
43
|
- **Item** — строка списка. `as` button/a/li, `active`. `variant="card"` — рамка и muted-фон (идеи / тикеты / inbox). Не дублировать `.desk-row` в приложении.
|
|
43
44
|
- **ItemColumn** — внутри Item: `icon` слева, столбик `title` / `description` / `footer` или `meta`, `extra` — бейджи справа сверху, `aside` — колонка справа. `unread` — жирный title. Title: `--item-column-title-size` / `--item-column-title-line` (в console = `--button-size-s` / `--button-line-height`).
|
|
@@ -45,7 +46,7 @@ import type { PricingPlan, HealthmapData } from "@elcrm/components";
|
|
|
45
46
|
## Меню
|
|
46
47
|
|
|
47
48
|
- **Menu** — inline-навигация в шапке. `items`: `value` + `label` + `badge` (`0` не показываем, иначе `Badge` size s). `variant="line"` — вкладки с чертой снизу (не ломать pill селекторами страницы).
|
|
48
|
-
- **Dropdown** — выпадающее меню по `items`/`groups` (portal). `placement="auto"|"top"|"bottom"` — куда открывать панель (футер Sidebar — `top`).
|
|
49
|
+
- **Dropdown** — выпадающее меню по `items`/`groups` (portal). `placement="auto"|"top"|"bottom"` — куда открывать панель (футер Sidebar — `top`). `size` — высота триггера; в `Toolbar` берётся сам.
|
|
49
50
|
- **Popover** — свой попап в portal (якорь + `children`). z-index: `acquireOverlayZIndex` (тот же стек, что у form). Не `@elcrm/overlay` `Menu`. `placement` как у Dropdown: позиция по **реальной** высоте панели, не по `maxHeight` 420.
|
|
50
51
|
|
|
51
52
|
## Avatar
|
|
@@ -65,6 +66,7 @@ import type { PricingPlan, HealthmapData } from "@elcrm/components";
|
|
|
65
66
|
- `--layout-padding` / `--layout-margin` / `--layout-max-width` — отступы и макс. ширина корня Layout (`0` / `none` = на весь вьюпорт).
|
|
66
67
|
- `--header-border` — рамка Header (shorthand: все стороны и толщина). Только снизу: `none` + линия через `--header-shadow`.
|
|
67
68
|
- `--header-nav-justify` — выравнивание `nav` в шапке (`flex-start` / `center` / `flex-end`).
|
|
69
|
+
- `<Toolbar size="s" width="l" align="start">` — один размер для Search / `*Field` / Button / Dropdown. `width="s"` — ряд по контенту. Свой `size` у ребёнка важнее.
|
|
68
70
|
- Узкие токены (`--chat-*`, `--sidebar-*`, `--item-column-*`) по умолчанию = `--shell-*`. Переопределяй только отличие.
|
|
69
71
|
- Задать `--shell-color` / `--shell-padding` / `--shell-radius` один раз — большинство компонентов подхватят.
|
|
70
72
|
- `--popup-shadow` общий с `@elcrm/form`.
|
|
@@ -23,7 +23,8 @@ const form = useForm({ login: "", password: "" });
|
|
|
23
23
|
|
|
24
24
|
Канонические поля: `StringField`, `PasswordField`, `TextareaField`, `NumberField`, `PercentField`, `MoneyField`, `MaskField`, `PhoneField`, `EmailField`, `UrlField`, `DateField`, `TimeField`, `SelectField`, `OptionsField`, `ModalField`, `RangeField`, `CheckField`, `RadioField`, `TagsField`, `RatingField`, `CodeField`, `FileField`, `DragDropField`, `RichTextField`, `ColorField`, `HiddenField`, `DisplayField`, `SearchField`, `TabsField`.
|
|
25
25
|
|
|
26
|
-
`disabled`, `size` (`"s"` | `"m"` | `"l"`) — у всех видимых `*Field` (кроме `HiddenField`).
|
|
26
|
+
`disabled`, `size` (`"s"` | `"m"` | `"l"`) — у всех видимых `*Field` (кроме `HiddenField`).
|
|
27
|
+
В ряду фильтров — `<Toolbar size="s">` из `@elcrm/components`: вложенные поля/Search/Button берут этот `size`.
|
|
27
28
|
|
|
28
29
|
`PasswordField`: `generate` — кнопка случайного пароля. `true` → `Az09#` (A–Z, a–z, 0–9, символы). `generate="A"` только заглавные, `"59"` цифры 5–9, `"#"` только символы. Длина — `maxLength` или 12.
|
|
29
30
|
|
|
@@ -134,6 +134,7 @@
|
|
|
134
134
|
--item-column-title-line: 1.3;
|
|
135
135
|
--stat-value-size: 1.75rem;
|
|
136
136
|
--action-group-gap: var(--shell-gap-sm);
|
|
137
|
+
--toolbar-gap: var(--shell-gap-sm);
|
|
137
138
|
--sidebar-width: 260px;
|
|
138
139
|
--sidebar-pad-x: var(--shell-gap);
|
|
139
140
|
--sidebar-pad-y: var(--shell-gap-lg);
|
|
@@ -145,6 +145,7 @@
|
|
|
145
145
|
--item-column-title-line: 1.3;
|
|
146
146
|
--stat-value-size: 1.75rem;
|
|
147
147
|
--action-group-gap: var(--shell-gap-sm);
|
|
148
|
+
--toolbar-gap: var(--shell-gap-sm);
|
|
148
149
|
--sidebar-width: 248px;
|
|
149
150
|
--sidebar-pad-x: var(--shell-gap);
|
|
150
151
|
--sidebar-pad-y: var(--shell-gap-lg);
|