@rt-tools/ui-kit-v2 0.14.0 → 0.16.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.
- package/fesm2022/rt-tools-ui-kit-v2-rich-editor.mjs +49 -7
- package/fesm2022/rt-tools-ui-kit-v2-rich-editor.mjs.map +1 -1
- package/fesm2022/rt-tools-ui-kit-v2.mjs +5885 -2414
- package/fesm2022/rt-tools-ui-kit-v2.mjs.map +1 -1
- package/package.json +1 -1
- package/rt-tools-ui-kit-v2-0.16.0.tgz +0 -0
- package/src/assets/icons/chat-error.svg +9 -0
- package/src/assets/icons/fork-spoon.svg +9 -0
- package/src/assets/icons/fullscreen.svg +9 -0
- package/src/assets/icons/home.svg +9 -0
- package/src/assets/icons/layers.svg +9 -0
- package/src/assets/icons/pin.svg +5 -0
- package/src/assets/icons/troubleshoot.svg +9 -0
- package/src/assets/icons-material/chart-bar.fill.svg +5 -0
- package/src/assets/icons-material/chart-bar.svg +5 -0
- package/src/assets/icons-material/chart-line.fill.svg +5 -0
- package/src/assets/icons-material/chart-line.svg +5 -0
- package/src/assets/icons-material/chat-error.fill.svg +5 -0
- package/src/assets/icons-material/chat-error.svg +5 -0
- package/src/assets/icons-material/comment.fill.svg +5 -0
- package/src/assets/icons-material/comment.svg +5 -0
- package/src/assets/icons-material/fork-spoon.fill.svg +5 -0
- package/src/assets/icons-material/fork-spoon.svg +5 -0
- package/src/assets/icons-material/fullscreen.fill.svg +5 -0
- package/src/assets/icons-material/fullscreen.svg +5 -0
- package/src/assets/icons-material/home.fill.svg +3 -0
- package/src/assets/icons-material/home.svg +5 -0
- package/src/assets/icons-material/ico-exit.fill.svg +5 -0
- package/src/assets/icons-material/ico-exit.svg +5 -0
- package/src/assets/icons-material/ico-sun.fill.svg +5 -0
- package/src/assets/icons-material/ico-sun.svg +5 -0
- package/src/assets/icons-material/ico-user.fill.svg +5 -0
- package/src/assets/icons-material/ico-user.svg +5 -0
- package/src/assets/icons-material/layers.fill.svg +3 -0
- package/src/assets/icons-material/layers.svg +5 -0
- package/src/assets/icons-material/minus.fill.svg +3 -0
- package/src/assets/icons-material/minus.svg +3 -0
- package/src/assets/icons-material/moon.fill.svg +5 -0
- package/src/assets/icons-material/moon.svg +5 -0
- package/src/assets/icons-material/pin.fill.svg +3 -0
- package/src/assets/icons-material/pin.svg +5 -0
- package/src/assets/icons-material/search-plus.fill.svg +5 -0
- package/src/assets/icons-material/search-plus.svg +5 -0
- package/src/assets/icons-material/th-large.fill.svg +3 -0
- package/src/assets/icons-material/th-large.svg +5 -0
- package/src/assets/icons-material/troubleshoot.fill.svg +5 -0
- package/src/assets/icons-material/troubleshoot.svg +5 -0
- package/src/lib/components/CONTEXT.md +1 -1
- package/src/lib/components/aside/CONTEXT.md +9 -0
- package/src/lib/components/aside/error-box/rt-aside-error-box.component.scss +37 -0
- package/src/lib/components/aside/rt-aside.component.scss +14 -2
- package/src/lib/components/dynamic-selector/CONTEXT.md +44 -0
- package/src/lib/components/dynamic-selector/dynamic-input/rt-dynamic-input.component.scss +19 -0
- package/src/lib/components/dynamic-selector/list/rt-dynamic-selector-list.component.scss +108 -0
- package/src/lib/components/dynamic-selector/popup/rt-dynamic-selector-popup.component.scss +170 -0
- package/src/lib/components/dynamic-selector/rt-dynamic-selector.component.scss +23 -0
- package/src/lib/components/dynamic-selector/stories/component/test-dynamic-selector-matrix.component.scss +8 -0
- package/src/lib/components/dynamic-selector/stories/component/test-dynamic-selector.component.scss +7 -0
- package/src/lib/components/empty-state/CONTEXT.md +3 -0
- package/src/lib/components/empty-state/rt-empty-state.component.scss +9 -0
- package/src/lib/components/expansion-panel/CONTEXT.md +45 -0
- package/src/lib/components/expansion-panel/rt-expansion-panel.component.scss +134 -0
- package/src/lib/components/expansion-panel/stories/component/test-expansion-panel-matrix.component.scss +31 -0
- package/src/lib/components/image-cropper/CONTEXT.md +54 -0
- package/src/lib/components/image-cropper/rt-image-cropper.component.scss +220 -0
- package/src/lib/components/image-upload/CONTEXT.md +65 -0
- package/src/lib/components/image-upload/rt-image-upload.component.scss +77 -0
- package/src/lib/components/menu/CONTEXT.md +27 -0
- package/src/lib/components/menu/rt-menu-item.component.scss +42 -0
- package/src/lib/components/side-menu/CONTEXT.md +38 -0
- package/src/lib/components/side-menu/favorites/rt-side-menu-favorites.component.scss +126 -0
- package/src/lib/components/side-menu/rt-side-menu.component.scss +303 -0
- package/src/lib/components/side-menu/stories/component/test-side-menu-cell.component.scss +27 -0
- package/src/lib/components/side-menu/stories/component/test-side-menu.component.scss +39 -0
- package/src/lib/components/side-menu/sub-item/rt-side-menu-sub-item.component.scss +203 -0
- package/src/lib/components/table/CONTEXT.md +6 -0
- package/src/lib/components/table/rt-table.component.scss +4 -2
- package/src/lib/components/tooltip/CONTEXT.md +7 -4
- package/src/rich-editor/lib/components/message-composer/CONTEXT.md +15 -1
- package/src/styles/_color-scheme.scss +50 -0
- package/types/rt-tools-ui-kit-v2-rich-editor.d.ts +22 -2
- package/types/rt-tools-ui-kit-v2.d.ts +1236 -13
- package/rt-tools-ui-kit-v2-0.14.0.tgz +0 -0
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
@use 'sass:map';
|
|
2
|
+
@use 'sass:list';
|
|
3
|
+
@use 'sass:meta';
|
|
4
|
+
|
|
5
|
+
/* A colour scheme — the brand ramp under its own name, switched on by `data-rt-scheme` on `<html>`,
|
|
6
|
+
as in the first kit.
|
|
7
|
+
|
|
8
|
+
The scheme rewrites the steps, not the assignments: the accent of the own set derives from
|
|
9
|
+
`--rt-brand-*`, the accent of the material set from `--rt-mat-blue-100`, and the dark theme refers to
|
|
10
|
+
the same steps. So one ramp repaints every look the kit is drawn in, and the names the components
|
|
11
|
+
read stay untouched.
|
|
12
|
+
|
|
13
|
+
The scheme answers on the root only. A value referring to a step is resolved where it is declared,
|
|
14
|
+
and the assignments are declared on the root: a scheme on an inner node would change the steps under
|
|
15
|
+
assignments already resolved, and the piece would keep the old accent.
|
|
16
|
+
|
|
17
|
+
A Material theme of the application wins over the scheme in the material set: its `--mat-sys-primary`
|
|
18
|
+
stands in front of the step in that set's assignments.
|
|
19
|
+
|
|
20
|
+
Usage:
|
|
21
|
+
@use '@rt-tools/ui-kit-v2/styles/color-scheme' as rt;
|
|
22
|
+
@include rt.rt-color-scheme('teal', (50: #e6f4f3, …, 500: #008582, …, 950: #00201f));
|
|
23
|
+
*/
|
|
24
|
+
|
|
25
|
+
$brand-steps: (50, 100, 200, 300, 400, 500, 600, 700, 800, 900, 950);
|
|
26
|
+
|
|
27
|
+
@mixin rt-color-scheme($name, $ramp) {
|
|
28
|
+
@if meta.type-of($name) != 'string' {
|
|
29
|
+
@error 'rt-color-scheme: the name must be a string, got #{meta.type-of($name)}.';
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
@if meta.type-of($ramp) != 'map' or not map.has-key($ramp, 500) {
|
|
33
|
+
@error 'rt-color-scheme("#{$name}"): the ramp is a map of (step: colour) and holds at least the step 500 — the brand colour.';
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
@each $step, $value in $ramp {
|
|
37
|
+
@if not list.index($brand-steps, $step) {
|
|
38
|
+
@error 'rt-color-scheme("#{$name}"): unknown step #{$step}. Allowed: #{$brand-steps}.';
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/* `:root[…]` (0,2,0) outranks the steps on `:root` (0,1,0) whatever the order of the sources. */
|
|
43
|
+
:root[data-rt-scheme='#{$name}'] {
|
|
44
|
+
@each $step, $value in $ramp {
|
|
45
|
+
--rt-brand-#{$step}: #{$value};
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
--rt-mat-blue-100: #{map.get($ramp, 500)};
|
|
49
|
+
}
|
|
50
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { AfterViewInit, OnDestroy, Signal, ElementRef, WritableSignal, InputSignal, OutputEmitterRef, InputSignalWithTransform, TemplateRef, PipeTransform } from '@angular/core';
|
|
2
|
+
import { AfterViewInit, OnDestroy, Signal, ElementRef, WritableSignal, InputSignal, OutputEmitterRef, InputSignalWithTransform, ModelSignal, TemplateRef, PipeTransform } from '@angular/core';
|
|
3
3
|
import { RtFormControlBase, IQuillDelta, TRtKitLabelMap } from '@rt-tools/ui-kit-v2';
|
|
4
4
|
import { BooleanInput, NumberInput } from '@angular/cdk/coercion';
|
|
5
5
|
import { FormGroup, FormControl } from '@angular/forms';
|
|
@@ -32,6 +32,8 @@ declare class RtRichEditorComponent extends RtFormControlBase<IQuillDelta | null
|
|
|
32
32
|
readonly enterPressed: OutputEmitterRef<void>;
|
|
33
33
|
readonly displayText: Signal<string>;
|
|
34
34
|
ngAfterViewInit(): Promise<void>;
|
|
35
|
+
/** Ставит фокус в редактор; до загрузки Quill ничего не делает. */
|
|
36
|
+
focus(): void;
|
|
35
37
|
ngOnDestroy(): void;
|
|
36
38
|
writeValue(value: IQuillDelta | null): void;
|
|
37
39
|
setDisabledState(isDisabled: boolean): void;
|
|
@@ -70,6 +72,9 @@ interface IComposerFormShape {
|
|
|
70
72
|
*
|
|
71
73
|
* Отправка — `Enter` (без Shift) или клик по иконке; `Shift+Enter` — перенос
|
|
72
74
|
* строки. Кнопка отправки активна, пока есть непустой текст или вложения.
|
|
75
|
+
*
|
|
76
|
+
* Со `stoppable` во время `sending` вместо стрелки стоит кнопка «Стоп», а поле
|
|
77
|
+
* остаётся открытым: следующий вопрос набирается, пока идёт ответ.
|
|
73
78
|
*/
|
|
74
79
|
declare class RtMessageComposerComponent {
|
|
75
80
|
#private;
|
|
@@ -77,12 +82,15 @@ declare class RtMessageComposerComponent {
|
|
|
77
82
|
protected readonly placeholderText: Signal<string>;
|
|
78
83
|
protected readonly fileInput: Signal<ElementRef<HTMLInputElement> | undefined>;
|
|
79
84
|
protected readonly textInput: Signal<ElementRef<HTMLTextAreaElement> | undefined>;
|
|
85
|
+
protected readonly richEditor: Signal<RtRichEditorComponent | undefined>;
|
|
80
86
|
protected readonly form: FormGroup<IComposerFormShape>;
|
|
81
87
|
protected readonly files: Signal<readonly File[]>;
|
|
82
88
|
/** Отправка доступна: есть контент (текст/delta/файлы), композер не занят. */
|
|
83
89
|
protected readonly canSend: Signal<boolean>;
|
|
84
90
|
/** Капсула выше одной строки: перенос текста, вложения или режим форматирования. */
|
|
85
91
|
protected readonly tall: Signal<boolean>;
|
|
92
|
+
/** Идёт ответ, который можно остановить: вместо стрелки — «Стоп», поле открыто. */
|
|
93
|
+
protected readonly isStoppable: Signal<boolean>;
|
|
86
94
|
protected readonly capsuleMods: Signal<Record<string, boolean>>;
|
|
87
95
|
/** Текст-подсказка textarea. Пусто — берётся переведённое умолчание. */
|
|
88
96
|
readonly placeholder: InputSignal<string>;
|
|
@@ -94,6 +102,11 @@ declare class RtMessageComposerComponent {
|
|
|
94
102
|
readonly attachments: InputSignalWithTransform<boolean, BooleanInput>;
|
|
95
103
|
/** Отправка в процессе — блокирует submit, кнопка отправки крутит индикатор. */
|
|
96
104
|
readonly sending: InputSignalWithTransform<boolean, BooleanInput>;
|
|
105
|
+
/**
|
|
106
|
+
* Ответ на сообщение можно остановить. Во время `sending` стрелку сменяет кнопка
|
|
107
|
+
* «Стоп», а поле не блокируется; без входа `sending` блокирует поле, как раньше.
|
|
108
|
+
*/
|
|
109
|
+
readonly stoppable: InputSignalWithTransform<boolean, BooleanInput>;
|
|
97
110
|
/** Полная блокировка композера. */
|
|
98
111
|
readonly disabled: InputSignalWithTransform<boolean, BooleanInput>;
|
|
99
112
|
/** Rich-режим: вместо textarea — Quill-редактор, отправка уходит delta-каналом. */
|
|
@@ -112,14 +125,21 @@ declare class RtMessageComposerComponent {
|
|
|
112
125
|
readonly droppedFiles: InputSignal<File[] | null>;
|
|
113
126
|
/** Отправка сообщения: текст + файлы (последние — только при `attachments`). */
|
|
114
127
|
readonly submitted: OutputEmitterRef<IRtMessageComposer.SubmitPayload>;
|
|
128
|
+
/** Черновик поля без форматирования: задаётся снаружи, правки уходят наружу, после отправки пуст. */
|
|
129
|
+
readonly text: ModelSignal<string>;
|
|
130
|
+
/** Клик по кнопке «Стоп» во время ответа, который можно остановить. */
|
|
131
|
+
readonly stopped: OutputEmitterRef<void>;
|
|
115
132
|
constructor();
|
|
133
|
+
/** Ставит фокус в поле: в textarea, а в режиме форматирования — в rich-редактор. */
|
|
134
|
+
focus(): void;
|
|
116
135
|
protected onKeydown(event: KeyboardEvent): void;
|
|
136
|
+
protected stop(): void;
|
|
117
137
|
protected openPicker(): void;
|
|
118
138
|
protected onFilesPicked(event: Event): void;
|
|
119
139
|
protected removeFile(index: number): void;
|
|
120
140
|
protected submit(): void;
|
|
121
141
|
static ɵfac: i0.ɵɵFactoryDeclaration<RtMessageComposerComponent, never>;
|
|
122
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<RtMessageComposerComponent, "rt-message-composer", never, { "placeholder": { "alias": "placeholder"; "required": false; "isSignal": true; }; "accept": { "alias": "accept"; "required": false; "isSignal": true; }; "hint": { "alias": "hint"; "required": false; "isSignal": true; }; "attachments": { "alias": "attachments"; "required": false; "isSignal": true; }; "sending": { "alias": "sending"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "formatting": { "alias": "formatting"; "required": false; "isSignal": true; }; "toolbar": { "alias": "toolbar"; "required": false; "isSignal": true; }; "minRows": { "alias": "minRows"; "required": false; "isSignal": true; }; "maxRows": { "alias": "maxRows"; "required": false; "isSignal": true; }; "droppedFiles": { "alias": "droppedFiles"; "required": false; "isSignal": true; }; }, { "submitted": "submitted"; }, never, never, true, never>;
|
|
142
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<RtMessageComposerComponent, "rt-message-composer", never, { "placeholder": { "alias": "placeholder"; "required": false; "isSignal": true; }; "accept": { "alias": "accept"; "required": false; "isSignal": true; }; "hint": { "alias": "hint"; "required": false; "isSignal": true; }; "attachments": { "alias": "attachments"; "required": false; "isSignal": true; }; "sending": { "alias": "sending"; "required": false; "isSignal": true; }; "stoppable": { "alias": "stoppable"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "formatting": { "alias": "formatting"; "required": false; "isSignal": true; }; "toolbar": { "alias": "toolbar"; "required": false; "isSignal": true; }; "minRows": { "alias": "minRows"; "required": false; "isSignal": true; }; "maxRows": { "alias": "maxRows"; "required": false; "isSignal": true; }; "droppedFiles": { "alias": "droppedFiles"; "required": false; "isSignal": true; }; "text": { "alias": "text"; "required": false; "isSignal": true; }; }, { "submitted": "submitted"; "text": "textChange"; "stopped": "stopped"; }, never, never, true, never>;
|
|
123
143
|
}
|
|
124
144
|
|
|
125
145
|
/**
|