@ldmjs/ui 1.0.13 → 1.0.14

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.
@@ -0,0 +1,207 @@
1
+ body {
2
+ .v-dialog {
3
+ display: flex;
4
+ transition: none;
5
+
6
+ .v-overlay__content {
7
+ contain: none;
8
+
9
+ & > .v-card {
10
+ flex-grow: 1;
11
+ border: 1px solid var(--primary);
12
+ border-radius: var(--toolbar-border-radius);
13
+ box-shadow: var(--shadow-4);
14
+
15
+ & > .v-card-title {
16
+ height: var(--toolbar-height);
17
+ padding: 0 20px;
18
+ }
19
+
20
+ & > .v-card-text {
21
+ padding: 0 20px 20px 20px;
22
+ }
23
+ }
24
+ }
25
+ }
26
+
27
+ .minimized-dialogs {
28
+ position: absolute;
29
+ right: 25px;
30
+ bottom: 17px;
31
+ z-index: 999;
32
+ }
33
+
34
+ .minimize-btn {
35
+ width: 300px;
36
+ height: var(--input-height);
37
+ font-size: var(--font-size);
38
+ transition: background 0.2s;
39
+ background-color: var(--primary-l-2);
40
+ border-radius: var(--border-radius);
41
+
42
+ &:hover {
43
+ background-color: var(--primary-l-1);
44
+ }
45
+ }
46
+ }
47
+
48
+ .ld-dialog-content {
49
+ .card {
50
+ display: flex;
51
+ flex-direction: column;
52
+
53
+ .v-card-title {
54
+ display: flex;
55
+ flex-wrap: nowrap;
56
+ position: relative;
57
+ flex-shrink: 0;
58
+ padding: 0 20px !important;
59
+ z-index: 1;
60
+ box-shadow: none;
61
+ font-weight: 700;
62
+
63
+ &--dark {
64
+ background-color: var(--primary);
65
+ color: var(--white);
66
+ box-shadow: var(--shadow-2);
67
+ }
68
+
69
+ &.modal-title {
70
+ display: flex;
71
+ align-items: center;
72
+ flex-wrap: nowrap !important;
73
+ font-size: var(--font-size-2);
74
+ padding-top: 0;
75
+ padding-left: 10px;
76
+ padding-right: 10px;
77
+
78
+ & > span {
79
+ display: block;
80
+ white-space: nowrap;
81
+ overflow: hidden;
82
+ text-overflow: ellipsis;
83
+ }
84
+ }
85
+ }
86
+
87
+ .v-card-text {
88
+ position: relative;
89
+ display: flex;
90
+ flex-direction: column;
91
+ height: auto;
92
+ flex-basis: 100%;
93
+ overflow-x: hidden;
94
+ overflow-y: auto;
95
+ padding: 0 20px 20px 20px !important;
96
+
97
+ &.content {
98
+ height: 100%;
99
+ overflow-y: auto;
100
+ overflow-x: hidden;
101
+ font-size: var(--font-size) !important;
102
+ }
103
+ }
104
+
105
+ .v-card-actions {
106
+ flex-shrink: 0;
107
+ padding: 8px 20px 20px 20px;
108
+ min-height: unset;
109
+ }
110
+
111
+ &--simple {
112
+ padding: 0 !important;
113
+ .v-card-title {
114
+ padding-top: 5px !important;
115
+ height: 40px !important;
116
+ }
117
+ .v-card-text {
118
+ padding: 0 20px 0px !important;
119
+ }
120
+
121
+ .v-card-actions {
122
+ padding: 20px 20px 17px !important;
123
+ }
124
+ }
125
+
126
+ &--mobile {
127
+ display: grid !important;
128
+ grid-template-rows: 44px 1fr;
129
+ height: 100%;
130
+ &.not-select-dialog {
131
+ min-height: 115px;
132
+ max-height: 100%;
133
+ // .mobile-container {
134
+ // .v-card-text {
135
+ // font-size: var(--font-size);
136
+ // padding: 10px !important;
137
+ // }
138
+ // }
139
+ .v-card-actions {
140
+ padding: 10px 0;
141
+ }
142
+ }
143
+
144
+ // .mobile-container {
145
+ // position: relative;
146
+ // min-height: 100%;
147
+ // max-height: 100%;
148
+ // overflow-y: auto;
149
+
150
+ // .v-card-text {
151
+ // height: 100%;
152
+ // }
153
+ // }
154
+
155
+ // .modal-header {
156
+ // z-index: 1;
157
+ // height: $modal-header-height !important;
158
+ // border-radius: 0 !important;
159
+ // background-color: var(--white);
160
+
161
+ // & .v-toolbar__content {
162
+ // height: 100% !important;
163
+ // display: flex;
164
+ // justify-content: space-between;
165
+ // & .v-toolbar-title {
166
+ // margin-inline-start: 12px !important;
167
+ // }
168
+ // }
169
+ // }
170
+ // .v-toolbar__title {
171
+ // font-size: var(--font-size) !important;
172
+ // margin-inline-start: 12px !important;
173
+ // }
174
+ // .v-card-actions {
175
+ // background: var(--white);
176
+ // padding: 10px 0;
177
+ // }
178
+
179
+ // .v-toolbar__content {
180
+ // // margin: 0 10px;
181
+ // padding: 0;
182
+ // }
183
+
184
+ .v-card-text {
185
+ height: 100%;
186
+ padding: 0 12px 20px 12px;
187
+ }
188
+ }
189
+ }
190
+
191
+ &.Info,
192
+ &.Select,
193
+ &.CreateEdit {
194
+ .card {
195
+ .v-card-text {
196
+ &.content {
197
+ min-height: 55px;
198
+ }
199
+ }
200
+ }
201
+ }
202
+
203
+ &--hidden {
204
+ visibility: hidden !important;
205
+ opacity: 0 !important;
206
+ }
207
+ }
@@ -2,6 +2,8 @@ $font-size: 12px !default; // основной шрифт приложения
2
2
  $input-height: 28px !default; // высота атомарного элемента ui (button, input)
3
3
  $border-radius: 4px !default; // радиус скругления атомарного элемента ui
4
4
  $chip-height: 20px !default; // высота элемента chip
5
+ $toolbar-height: 44px !default; // высота тулбара
6
+ $toolbar-border-radius: 8px !default; // радиус скругления тулбара
5
7
 
6
8
  $ld-tab-height: $input-height + 10px; // высота элемента ld-tab
7
9
 
@@ -18,6 +20,8 @@ $shadow-4: 0px 16px 20px 0px rgba(0, 0, 0, 0.20);
18
20
  --border-radius: #{$border-radius};
19
21
  --chip-height: #{$chip-height};
20
22
  --ld-tab-height: #{$ld-tab-height};
23
+ --toolbar-height: #{$toolbar-height};
24
+ --toolbar-border-radius: #{$toolbar-border-radius};
21
25
  --shadow-1: #{$shadow-1};
22
26
  --shadow-2: #{$shadow-2};
23
27
  --shadow-3: #{$shadow-3};
@@ -9,3 +9,4 @@
9
9
  @import 'toolbar';
10
10
  @import 'multiselect';
11
11
  @import 'toasted';
12
+ @import 'dialogs';
@@ -0,0 +1,259 @@
1
+ export interface IViewModel<T> {
2
+ id: T;
3
+ name: string;
4
+ title?: string;
5
+ }
6
+
7
+ export interface IHostObject {
8
+ contentType: unknown;
9
+ id: number | string;
10
+ kind: unknown;
11
+ }
12
+
13
+ export interface IModalResult<T> {
14
+ button: ModalButton;
15
+ data: T;
16
+ }
17
+
18
+ export interface IModalData<T> {
19
+ component: string;
20
+ componentProps: T
21
+ }
22
+
23
+ export interface IModalInfo {
24
+ title: string;
25
+ type: ModalType;
26
+ description?: string | (() => string);
27
+ processingDescription?: string | (() => string);
28
+ el?: HTMLElement;
29
+ hostObject?: IHostObject;
30
+ /**
31
+ * Окно немодальное - это начит окно отображается поверх контента страницы и не ограничивает пользователя
32
+ * во взатмодействии со страницей.
33
+ * Окно модальное - это значит окно отображается поверх контента страницы, возможно с затемненным фоном,
34
+ * ограничивая пользователя в действиях, пока окно не будет закрыто
35
+ */
36
+ noModal?: boolean;
37
+ darkTitle?: boolean;
38
+ content?: string;
39
+ loading?: boolean;
40
+ component?: string;
41
+ componentProps?: Record<string, unknown>;
42
+ selectAsOk?: boolean;
43
+ okTitle?: string;
44
+ cancelTitle?: string;
45
+ okResult?: number | string | boolean | IModalResult<IViewModel<number | string>>;
46
+ cancelResult?: number | string | boolean | IModalResult<IViewModel<number | string>>;
47
+ hideFooter?: boolean;
48
+ width?: number | string;
49
+ height?: number | string;
50
+ fullHeight?: boolean;
51
+ closable?: boolean;
52
+ expandable?: boolean;
53
+ minimizable?: boolean;
54
+ expanded?: boolean;
55
+ minimized?: boolean;
56
+ collapsedSize?: {
57
+ width: string | number;
58
+ height: string | number;
59
+ noModal?: boolean;
60
+ };
61
+ expandedSize?: {
62
+ width: string | number;
63
+ height: string | number;
64
+ noModal?: boolean;
65
+ };
66
+ resolveFunction?: (data?: any) => void;
67
+ /**
68
+ * ф-ция, вызываемая для определения того, были ли изменения в диалоге
69
+ */
70
+ isChanged?: () => boolean;
71
+ }
72
+
73
+ export interface IModalWindow<T> extends IModalInfo {
74
+ id: number;
75
+ type: ModalType;
76
+ show: boolean;
77
+ component?: string;
78
+ componentInstance?: {
79
+ save?(): void;
80
+ onClose?(): void | Promise<boolean>;
81
+ };
82
+ okLoading: boolean;
83
+ okOnly: boolean;
84
+ okDisabled: boolean;
85
+ resolved: boolean;
86
+ retainFocus: boolean;
87
+ okTitle: string;
88
+ }
89
+
90
+ export type ModalWindow = IModalWindow<IViewModel<number | string>>;
91
+
92
+ export class Dialog {
93
+ constructor(public title: string, public content?: string);
94
+ }
95
+
96
+ export class AlertDialog extends Dialog {
97
+ constructor(data: { title: string; text: string });
98
+ }
99
+
100
+ export class PromptDialog extends Dialog {
101
+ title: string;
102
+ width?: string;
103
+ constructor(data: { title: string; width?: string });
104
+ }
105
+
106
+ export class ConfirmDialog extends Dialog {
107
+ title: string;
108
+ text: string;
109
+ okTitle?: string;
110
+ cancelTitle?: string;
111
+ okResult?: number | string | boolean;
112
+ cancelResult?: number | string | boolean;
113
+ constructor(data: {
114
+ title: string;
115
+ text: string;
116
+ okTitle?: string;
117
+ cancelTitle?: string;
118
+ okResult?: number | string | boolean;
119
+ cancelResult?: number | string | boolean;
120
+ });
121
+ }
122
+
123
+ export class InfoDialog extends Dialog {
124
+ title: string;
125
+ component: string;
126
+ componentProps: Record<string, unknown>;
127
+ width?: string;
128
+ height?: string;
129
+ fullHeight?: boolean;
130
+ loading?: boolean;
131
+ closable?: boolean;
132
+ hideFooter?: boolean;
133
+ minimizable?: boolean;
134
+ description?: string;
135
+ constructor(data: {
136
+ title: string;
137
+ component: string;
138
+ componentProps: Record<string, unknown>;
139
+ width?: string;
140
+ height?: string;
141
+ fullHeight?: boolean;
142
+ loading?: boolean;
143
+ closable?: boolean;
144
+ hideFooter?: boolean;
145
+ minimizable?: boolean;
146
+ description?: string;
147
+ });
148
+ }
149
+
150
+ export class SelectDialog<T> {
151
+ title: string;
152
+ component: string;
153
+ componentProps: {
154
+ disabledItems: Array<T | number | string>;
155
+ selectedItems: Array<T | number | string>;
156
+ /**
157
+ * Активирует возможность поиска по списку
158
+ */
159
+ searchable?: boolean;
160
+ /**
161
+ * Массив полей, по которым необходим поиск
162
+ * в случае searchable = true, наличие массива обязательно
163
+ */
164
+ searchFields?: string[];
165
+ isTree?: boolean;
166
+ multiselect?: boolean;
167
+ [key: string]: unknown;
168
+ };
169
+ loading?: boolean;
170
+ fullHeight?: boolean;
171
+ width?: string | number;
172
+ height?: string | number;
173
+ selectAsOk?: boolean;
174
+ constructor(data: {
175
+ title: string;
176
+ component: string;
177
+ componentProps: {
178
+ disabledItems: Array<T | number | string>;
179
+ selectedItems: Array<T | number | string>;
180
+ searchable?: boolean;
181
+ searchFields?: Array<string>;
182
+ isTree?: boolean;
183
+ multiselect?: boolean;
184
+ [key: string]: unknown;
185
+ };
186
+ loading?: boolean;
187
+ fullHeight?: boolean;
188
+ width?: string | number;
189
+ height?: string | number;
190
+ selectAsOk?: boolean;
191
+ });
192
+ }
193
+
194
+ export class CreateEditDialog<T> {
195
+ title: string;
196
+ component: string;
197
+ componentProps: {
198
+ model: T;
199
+ [key: string]: unknown;
200
+ };
201
+ hostObject?: IHostObject;
202
+ loading?: boolean;
203
+ fullHeight?: boolean;
204
+ width?: string | number;
205
+ height?: string | number;
206
+ hideFooter?: boolean;
207
+ darkTitle?: boolean;
208
+ closable?: boolean;
209
+ expandable?: boolean;
210
+ minimizable?: boolean;
211
+ collapsedSize?: {
212
+ width: string | number;
213
+ height: string | number;
214
+ noModal?: boolean;
215
+ };
216
+ expandedSize?: {
217
+ width: string | number;
218
+ height: string | number;
219
+ noModal?: boolean;
220
+ };
221
+ expanded?: boolean;
222
+ description?: string;
223
+ noModal?: boolean;
224
+ okTitle?: string;
225
+ cancelTitle?: string;
226
+ constructor(data: {
227
+ title: string;
228
+ component: string;
229
+ componentProps: {
230
+ model: T;
231
+ [key: string]: unknown;
232
+ };
233
+ hostObject?: IHostObject;
234
+ loading?: boolean;
235
+ fullHeight?: boolean;
236
+ width?: string | number;
237
+ height?: string | number;
238
+ hideFooter?: boolean;
239
+ darkTitle?: boolean;
240
+ closable?: boolean;
241
+ expandable?: boolean;
242
+ minimizable?: boolean;
243
+ collapsedSize?: {
244
+ width: string | number;
245
+ height: string | number;
246
+ noModal?: boolean;
247
+ };
248
+ expandedSize?: {
249
+ width: string | number;
250
+ height: string | number;
251
+ noModal?: boolean;
252
+ };
253
+ expanded?: boolean;
254
+ description?: string;
255
+ noModal?: boolean;
256
+ okTitle?: string;
257
+ cancelTitle?: string;
258
+ });
259
+ }
@@ -23,6 +23,7 @@ export interface ldmuiOptions {
23
23
  'ld-edit-masked-text'?: string;
24
24
  'ld-text-markup'?: string;
25
25
  'ld-switch'?: string;
26
+ 'ld-dialog'?: string;
26
27
  },
27
28
  viewport?: {
28
29
  isMobile: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ldmjs/ui",
3
- "version": "1.0.13",
3
+ "version": "1.0.14",
4
4
  "description": "ldm ui",
5
5
  "main": "dist/index.js",
6
6
  "engines": {
@@ -92,7 +92,7 @@
92
92
  "vue-screen-utils": "1.0.0-beta.13",
93
93
  "vue-toastification": "2.0.0-rc.5",
94
94
  "vuetify": "3.6.8",
95
- "webpack": "5.92.0",
95
+ "webpack": "5.92.1",
96
96
  "webpack-cli": "5.1.4",
97
97
  "webpack-dev-server": "4.15.1",
98
98
  "webpack-plugin-vuetify": "2.0.1"