@ldmjs/ui 1.0.0 → 1.0.2
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/LICENSE +21 -0
- package/README.md +417 -1
- package/dist/calendar.js +1 -0
- package/dist/css/calendar.css +29 -0
- package/dist/css/index.css +38 -0
- package/dist/css/root.css +86 -0
- package/dist/floating.js +1 -0
- package/dist/fonts/Roboto-Regular.ttf +0 -0
- package/dist/fonts/Roboto-Regular.woff +0 -0
- package/dist/fonts/Roboto-Regular.woff2 +0 -0
- package/dist/imask.js +1 -0
- package/dist/index.d.ts +51 -0
- package/dist/index.js +11319 -0
- package/dist/multiselect.js +1 -0
- package/dist/runtime-template.js +1 -0
- package/dist/scss/_breadcrumbs.scss +48 -0
- package/dist/scss/_buttons.scss +301 -0
- package/dist/scss/_calendar.scss +25 -0
- package/dist/scss/_chip.scss +68 -0
- package/dist/scss/_colors.scss +63 -0
- package/dist/scss/_fonts.scss +13 -0
- package/dist/scss/_inputs.scss +171 -0
- package/dist/scss/_multiselect.scss +164 -0
- package/dist/scss/_toolbar.scss +16 -0
- package/dist/scss/_variables.scss +25 -0
- package/dist/scss/index.scss +10 -0
- package/dist/types/breadcrumbs.d.ts +22 -0
- package/dist/types/options.d.ts +48 -0
- package/dist/types/validation.d.ts +16 -0
- package/package.json +83 -6
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (C) 2024 by ldmjs
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
|
13
|
+
all copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
21
|
+
THE SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1 +1,417 @@
|
|
|
1
|
-
|
|
1
|
+
# Dependencies
|
|
2
|
+
|
|
3
|
+
"vue": "3.4.21",
|
|
4
|
+
"vue-class-component": "8.0.0-rc.1",
|
|
5
|
+
"vue-property-decorator": "10.0.0-rc.3",
|
|
6
|
+
"vuetify": "3.6.8",
|
|
7
|
+
"vue-screen-utils": "1.0.0-beta.13",
|
|
8
|
+
"lodash-es": "4.17.21",
|
|
9
|
+
"md-editor-v3": "4.15.6",
|
|
10
|
+
|
|
11
|
+
# Installation
|
|
12
|
+
|
|
13
|
+
```cmd
|
|
14
|
+
npm i @ldmjs/ui@latest
|
|
15
|
+
```
|
|
16
|
+
OR
|
|
17
|
+
```cmd
|
|
18
|
+
yarn add @ldmjs/ui@latest
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
# Use
|
|
22
|
+
|
|
23
|
+
```js
|
|
24
|
+
import { createApp } from 'vue';
|
|
25
|
+
import '@ldmjs/ui/dist/css/index.css';
|
|
26
|
+
import '@ldmjs/ui/dist/css/root.css';
|
|
27
|
+
import '@ldmjs/ui/dist/css/calendar.css';
|
|
28
|
+
import '@ldmjs/ui/dist/scss';
|
|
29
|
+
import 'vuetify/styles';
|
|
30
|
+
import 'material-design-icons-iconfont/dist/material-design-icons.css';
|
|
31
|
+
import 'md-editor-v3/lib/style.css';
|
|
32
|
+
import ldmui from '@ldmjs/ui';
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
```js
|
|
36
|
+
const appComponent = createApp(App);
|
|
37
|
+
appComponent.use(ldmui); // or appComponent.use(ldmui, options);
|
|
38
|
+
appComponent.mount('#app');
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
tsconfig.json
|
|
42
|
+
```json
|
|
43
|
+
{
|
|
44
|
+
"compilerOptions": {
|
|
45
|
+
"include": ["node_modules/@ldmjs/ui/index.d.ts"]
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
# Library
|
|
51
|
+
|
|
52
|
+
## #ld-icon
|
|
53
|
+
|
|
54
|
+
### use icons
|
|
55
|
+
|
|
56
|
+
```js
|
|
57
|
+
appComponent.use(ldmui, {
|
|
58
|
+
LdIcon: {
|
|
59
|
+
path: 'path/to/icons',
|
|
60
|
+
map: {
|
|
61
|
+
icons: [
|
|
62
|
+
['user', 'user_icon_file_name']
|
|
63
|
+
]
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
```html
|
|
70
|
+
<ld-icon>user</ld-icon>
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
## #loader
|
|
74
|
+
|
|
75
|
+
### use loader
|
|
76
|
+
|
|
77
|
+
```html
|
|
78
|
+
<loader :options="{ transparent: false, global: true }" :visible="loading" />
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
## #vuetify aliases:
|
|
82
|
+
[
|
|
83
|
+
small-button,
|
|
84
|
+
square-button,
|
|
85
|
+
small-chip,
|
|
86
|
+
small-badge
|
|
87
|
+
]
|
|
88
|
+
|
|
89
|
+
### use vuetify aliases
|
|
90
|
+
|
|
91
|
+
```js
|
|
92
|
+
import 'vuetify/styles';
|
|
93
|
+
import 'material-design-icons-iconfont/dist/material-design-icons.css';
|
|
94
|
+
import { defaults, getAliases } from '@ldmjs/ui';
|
|
95
|
+
import { createVuetify } from 'vuetify';
|
|
96
|
+
import * as components from 'vuetify/components';
|
|
97
|
+
|
|
98
|
+
const vuetify = createVuetify({
|
|
99
|
+
aliases: {
|
|
100
|
+
...getAliases(components),
|
|
101
|
+
},
|
|
102
|
+
defaults: {
|
|
103
|
+
...defaults
|
|
104
|
+
}
|
|
105
|
+
})
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
## #ld-btn
|
|
109
|
+
|
|
110
|
+
### use responsive buttons
|
|
111
|
+
|
|
112
|
+
```js
|
|
113
|
+
appComponent.use(ldmui, {
|
|
114
|
+
viewport: {
|
|
115
|
+
isMobile: 'keyForGlobalMobileViewport',
|
|
116
|
+
isTablet: 'keyForGlobalTabletViewport',
|
|
117
|
+
isDesktop: 'keyForGlobalDesktopViewport'
|
|
118
|
+
}
|
|
119
|
+
});
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
```html
|
|
123
|
+
<ld-btn
|
|
124
|
+
variant="outlined" // text, flat
|
|
125
|
+
color="primary"
|
|
126
|
+
testid="test-id"
|
|
127
|
+
:disabled="false" // non required
|
|
128
|
+
:is-desktop-view="true" // non required
|
|
129
|
+
:is-tablet-view="false" // non required
|
|
130
|
+
:is-mobile-view="false" // non required
|
|
131
|
+
@click="func()" // click handler
|
|
132
|
+
>
|
|
133
|
+
<template #icon>
|
|
134
|
+
<ld-icon ... /> // some icon
|
|
135
|
+
</template>
|
|
136
|
+
<template #text>
|
|
137
|
+
button caption // some text
|
|
138
|
+
</template>
|
|
139
|
+
<template #hidden>
|
|
140
|
+
<div>...</div>
|
|
141
|
+
</template>
|
|
142
|
+
</ld-btn>
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
## #ld-splitter
|
|
146
|
+
|
|
147
|
+
### use splitter
|
|
148
|
+
|
|
149
|
+
```html
|
|
150
|
+
<ld-splitter>
|
|
151
|
+
<template #left-pane>
|
|
152
|
+
<div>Left Pane</div>
|
|
153
|
+
</template>
|
|
154
|
+
<template #right-pane>
|
|
155
|
+
<div>Right Pane</div>
|
|
156
|
+
</template>
|
|
157
|
+
</ld-splitter>
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
## #ld-toggle-buttons
|
|
161
|
+
|
|
162
|
+
### use toggle buttons
|
|
163
|
+
|
|
164
|
+
```html
|
|
165
|
+
<ld-toggle-btn
|
|
166
|
+
v-model="toggleModel"
|
|
167
|
+
:items="toggleItems"
|
|
168
|
+
/>
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
```js
|
|
172
|
+
toggleItems = [
|
|
173
|
+
{
|
|
174
|
+
id: 0,
|
|
175
|
+
tooltip: 'user',
|
|
176
|
+
icon: 'user',
|
|
177
|
+
},
|
|
178
|
+
{
|
|
179
|
+
id: 1,
|
|
180
|
+
tooltip: 'group',
|
|
181
|
+
icon: 'group',
|
|
182
|
+
}
|
|
183
|
+
]
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
## #ld-breadcrumbs
|
|
187
|
+
|
|
188
|
+
### use breadcrumbs
|
|
189
|
+
|
|
190
|
+
```js
|
|
191
|
+
appComponent.use(ldmui, {
|
|
192
|
+
LdBreadcrumbs: {
|
|
193
|
+
home: { // setup route for home page
|
|
194
|
+
name: 'home',
|
|
195
|
+
path: '/'
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
```html
|
|
201
|
+
<ld-breadcrumbs :breadcrumbs="items" />
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
```js
|
|
205
|
+
const items = [
|
|
206
|
+
{
|
|
207
|
+
text: 'Документы',
|
|
208
|
+
route: {
|
|
209
|
+
path: '/documents'
|
|
210
|
+
}
|
|
211
|
+
},
|
|
212
|
+
{
|
|
213
|
+
text: 'Входящая корреспонденция',
|
|
214
|
+
route: {
|
|
215
|
+
path: '/documents/123456'
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
]
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
## #ld-edit-text
|
|
222
|
+
|
|
223
|
+
### use edit text
|
|
224
|
+
|
|
225
|
+
```html
|
|
226
|
+
<ld-edit-text v-model="value" label="ФИО" />
|
|
227
|
+
<ld-edit-text v-model="value" :only-numbers="true" label="Номер" />
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
## #ld-datepicker
|
|
231
|
+
|
|
232
|
+
### use datepicker
|
|
233
|
+
|
|
234
|
+
```html
|
|
235
|
+
<ld-datepicker v-model="value" :dateonly="false" label="Ld datepicker" />
|
|
236
|
+
```
|
|
237
|
+
|
|
238
|
+
## #ld-tabs
|
|
239
|
+
|
|
240
|
+
### use tabs
|
|
241
|
+
|
|
242
|
+
```html
|
|
243
|
+
<ld-tabs v-model="value" :mobile="false">
|
|
244
|
+
<ld-tab index="0" heading="Tab 1">Content</ld-tab>
|
|
245
|
+
<ld-tab index="1" heading="Tab 1">Content</ld-tab>
|
|
246
|
+
</ld-tabs>
|
|
247
|
+
```
|
|
248
|
+
|
|
249
|
+
## #ld-page-toolbar
|
|
250
|
+
|
|
251
|
+
### use page toolbar
|
|
252
|
+
|
|
253
|
+
```html
|
|
254
|
+
<ld-page-toolbar :preview="isMobile">
|
|
255
|
+
<template #breadcrumbs>
|
|
256
|
+
<ld-breadcrumbs :breadcrumbs="breadcrumbs" />
|
|
257
|
+
</template>
|
|
258
|
+
<template #content>
|
|
259
|
+
<span>Header</span>
|
|
260
|
+
</template>
|
|
261
|
+
<template #action-panel>
|
|
262
|
+
<ld-button>Button</ld-button>
|
|
263
|
+
</template>
|
|
264
|
+
</ld-page-toolbar>
|
|
265
|
+
```
|
|
266
|
+
|
|
267
|
+
## #ld-select-list-box
|
|
268
|
+
|
|
269
|
+
### use select list box
|
|
270
|
+
|
|
271
|
+
```html
|
|
272
|
+
<ld-select-list-box
|
|
273
|
+
ref="selectListBox"
|
|
274
|
+
v-model="selectedValue"
|
|
275
|
+
v-model:modelItems="selectedItems"
|
|
276
|
+
:handlers="handlers"
|
|
277
|
+
:multiselect="multiselect"
|
|
278
|
+
:required="required"
|
|
279
|
+
label="Ld Select List Box"
|
|
280
|
+
:persistent-hint="persistentHint"
|
|
281
|
+
:option-hint="optionHint"
|
|
282
|
+
input-hint="Select Box Hint"
|
|
283
|
+
>
|
|
284
|
+
<template #tag="{ item, onRemove, canRemove }">
|
|
285
|
+
tag template
|
|
286
|
+
</template>
|
|
287
|
+
<template #option="{ item, isSelected }">
|
|
288
|
+
option template
|
|
289
|
+
</template>
|
|
290
|
+
<template #option-icon="{ item, isSelected }">
|
|
291
|
+
option icon
|
|
292
|
+
</template>
|
|
293
|
+
<template #option-hint="{ item }">
|
|
294
|
+
option hint
|
|
295
|
+
</template>
|
|
296
|
+
</ld-select-list-box>
|
|
297
|
+
```
|
|
298
|
+
|
|
299
|
+
```js
|
|
300
|
+
// methods for work with vacabularies
|
|
301
|
+
const handlers = {
|
|
302
|
+
fetchData: () => { return [] },
|
|
303
|
+
fetchItem: (ids) => { return [] },
|
|
304
|
+
serverSearch: (searchTerm) => { return [] },
|
|
305
|
+
select: () => { return [] },
|
|
306
|
+
}
|
|
307
|
+
```
|
|
308
|
+
## #ld-radiogroup
|
|
309
|
+
|
|
310
|
+
### use radio inputs
|
|
311
|
+
|
|
312
|
+
```html
|
|
313
|
+
<ld-radiogroup v-model="radioValue" label="Ld Radio Buttons">
|
|
314
|
+
<ld-radiobutton label="Radio Button 1" :value="0" />
|
|
315
|
+
<ld-radiobutton label="Radio Button 2" :value="1" />
|
|
316
|
+
</ld-radiogroup>
|
|
317
|
+
```
|
|
318
|
+
|
|
319
|
+
## #ld-textarea
|
|
320
|
+
|
|
321
|
+
### use textarea
|
|
322
|
+
|
|
323
|
+
```html
|
|
324
|
+
<ld-textarea v-model="commentValue" label="Ld Textarea" label-on-top :rows="4" />
|
|
325
|
+
```
|
|
326
|
+
|
|
327
|
+
## #ld-select
|
|
328
|
+
|
|
329
|
+
### use select
|
|
330
|
+
|
|
331
|
+
```html
|
|
332
|
+
<ld-select v-model="selectedElement" :items="elements" label="Ld select" />
|
|
333
|
+
```
|
|
334
|
+
|
|
335
|
+
## ld-combobox
|
|
336
|
+
|
|
337
|
+
### use combobox
|
|
338
|
+
|
|
339
|
+
```html
|
|
340
|
+
<ld-combobox
|
|
341
|
+
v-model="comboboxValue"
|
|
342
|
+
label="Ld Combobox"
|
|
343
|
+
:multiselect="false"
|
|
344
|
+
item-title="title"
|
|
345
|
+
:items="comboboxItems"
|
|
346
|
+
required
|
|
347
|
+
/>
|
|
348
|
+
```
|
|
349
|
+
|
|
350
|
+
```js
|
|
351
|
+
const comboboxItems = [
|
|
352
|
+
{
|
|
353
|
+
id: 1,
|
|
354
|
+
title: '1'
|
|
355
|
+
},
|
|
356
|
+
{
|
|
357
|
+
id: 2,
|
|
358
|
+
title: '2'
|
|
359
|
+
}
|
|
360
|
+
]
|
|
361
|
+
```
|
|
362
|
+
|
|
363
|
+
## ld-text-viewer
|
|
364
|
+
|
|
365
|
+
### use textviewer
|
|
366
|
+
|
|
367
|
+
```html
|
|
368
|
+
<ld-text-viewer :text="'Link http://yandex.ru'" active-links label="Ld TextViewer" />
|
|
369
|
+
```
|
|
370
|
+
|
|
371
|
+
## ld-timepicker
|
|
372
|
+
|
|
373
|
+
### use timepicker
|
|
374
|
+
|
|
375
|
+
```html
|
|
376
|
+
<ld-timepicker v-model="timeValue" label="Ld Timepicker" required />
|
|
377
|
+
```
|
|
378
|
+
|
|
379
|
+
## ld-edit-masked-text
|
|
380
|
+
|
|
381
|
+
### use masked text
|
|
382
|
+
|
|
383
|
+
```html
|
|
384
|
+
<ld-edit-masked-text v-model="maskedText" mask="000-000-000 00" label="Ld Edit Masked Text" />
|
|
385
|
+
```
|
|
386
|
+
## ld-text-markup
|
|
387
|
+
|
|
388
|
+
### use text markup
|
|
389
|
+
|
|
390
|
+
```html
|
|
391
|
+
<ld-text-markup v-model="textMarkup" required label="Ld Text Markup" />
|
|
392
|
+
```
|
|
393
|
+
|
|
394
|
+
## ld-switch
|
|
395
|
+
|
|
396
|
+
### use switch
|
|
397
|
+
|
|
398
|
+
```html
|
|
399
|
+
<ld-switch label="Ld Switch" v-model="toggle" />
|
|
400
|
+
```
|
|
401
|
+
|
|
402
|
+
# Utilities
|
|
403
|
+
|
|
404
|
+
- isDefined
|
|
405
|
+
- uidGen
|
|
406
|
+
- delay
|
|
407
|
+
- deepValueGetter
|
|
408
|
+
- isObjectEmpty
|
|
409
|
+
- datetime
|
|
410
|
+
|
|
411
|
+
# Directives
|
|
412
|
+
- v-active
|
|
413
|
+
|
|
414
|
+
# Mixins
|
|
415
|
+
|
|
416
|
+
- ValidateMixin // class-component style
|
|
417
|
+
- ValidateMixinOptions // options style
|