@mythpe/quasar-ui-qui 0.2.53 → 0.2.55

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 (50) hide show
  1. package/package.json +1 -1
  2. package/src/components/datatable/MDatatable.vue +84 -175
  3. package/src/components/datatable/MDtBtn.vue +1 -1
  4. package/src/components/datatable/MDtColorColumn.vue +46 -0
  5. package/src/components/datatable/MDtCopyColumn.vue +55 -0
  6. package/src/components/datatable/MDtImageColumn.vue +79 -0
  7. package/src/components/datatable/MDtSarColumn.vue +32 -0
  8. package/src/components/datatable/MDtUrlColumn.vue +43 -0
  9. package/src/components/datatable/index.ts +14 -1
  10. package/src/components/form/MAvatarViewer.vue +2 -2
  11. package/src/components/form/MCheckbox.vue +2 -2
  12. package/src/components/form/MCkeditor.vue +2 -2
  13. package/src/components/form/MColor.vue +1 -1
  14. package/src/components/form/MEditor.vue +2 -2
  15. package/src/components/form/MField.vue +2 -2
  16. package/src/components/form/MFile.vue +2 -2
  17. package/src/components/form/MForm.vue +2 -2
  18. package/src/components/form/MHidden.vue +1 -1
  19. package/src/components/form/MInput.vue +7 -7
  20. package/src/components/form/MInputLabel.vue +3 -3
  21. package/src/components/form/MOptions.vue +4 -4
  22. package/src/components/form/MPicker.vue +4 -4
  23. package/src/components/form/MRadio.vue +2 -2
  24. package/src/components/form/MSelect.vue +3 -3
  25. package/src/components/form/MSignaturePad.vue +1 -1
  26. package/src/components/form/MToggle.vue +2 -2
  27. package/src/components/form/MUploader.vue +1 -1
  28. package/src/components/form/__MCkeditor.vue +2 -2
  29. package/src/components/form/__MOptions.vue +4 -4
  30. package/src/components/grid/MBlock.vue +1 -1
  31. package/src/components/grid/MCol.vue +1 -1
  32. package/src/components/grid/MColumn.vue +1 -1
  33. package/src/components/grid/MContainer.vue +3 -3
  34. package/src/components/grid/MHelpRow.vue +1 -1
  35. package/src/components/grid/MRow.vue +1 -1
  36. package/src/components/modal/MModalMenu.vue +1 -1
  37. package/src/components/modal/MTooltip.vue +1 -1
  38. package/src/components/parials/MUploaderItem.vue +2 -2
  39. package/src/components/sar/MSarString.vue +1 -1
  40. package/src/composable/useMyth.ts +4 -4
  41. package/src/plugin/defineAsyncComponents.ts +5 -0
  42. package/src/style/m-container.sass +4 -4
  43. package/src/style/m-dt.sass +23 -16
  44. package/src/style/m-help-row.sass +1 -1
  45. package/src/style/m-input.sass +8 -8
  46. package/src/style/m-picker.sass +2 -2
  47. package/src/style/m-select.sass +3 -3
  48. package/src/style/main.sass +6 -6
  49. package/src/types/components.d.ts +25 -1
  50. package/src/types/m-datatable.d.ts +77 -16
@@ -44,7 +44,7 @@ defineOptions({
44
44
  v-model="modelValue"
45
45
  :position="position"
46
46
  allow-focus-outside
47
- class="m--modal_menu"
47
+ class="m-modal_menu"
48
48
  maximized
49
49
  no-backdrop-dismiss
50
50
  no-shake
@@ -29,7 +29,7 @@ const { props: pluginOptions } = useMyth()
29
29
 
30
30
  <template>
31
31
  <q-tooltip
32
- class="m--dt-btn-tooltip"
32
+ class="m-dt-btn-tooltip"
33
33
  transition-hide="scale"
34
34
  transition-show="scale"
35
35
  v-bind="{...pluginOptions.tooltip,...$attrs}"
@@ -278,7 +278,7 @@ defineOptions({
278
278
  target="_blank"
279
279
  v-bind="pluginOptions.uploaderOptions?.downloadBtnProps"
280
280
  >
281
- <q-tooltip class="m--dt-btn-tooltip">
281
+ <q-tooltip class="m-dt-btn-tooltip">
282
282
  {{ __('myth.titles.download') }}
283
283
  </q-tooltip>
284
284
  </q-btn>
@@ -291,7 +291,7 @@ defineOptions({
291
291
  v-bind="pluginOptions.uploaderOptions?.removeBtnProps"
292
292
  @click="onClickDeleteAttachment()"
293
293
  >
294
- <q-tooltip class="m--dt-btn-tooltip">
294
+ <q-tooltip class="m-dt-btn-tooltip">
295
295
  {{ __(mediaProp.id ? 'myth.uploader.deleteMedia' : 'myth.uploader.removeMedia') }}
296
296
  </q-tooltip>
297
297
  </q-btn>
@@ -48,7 +48,7 @@ defineOptions({
48
48
 
49
49
  <template>
50
50
  <div
51
- class="m--sar-col"
51
+ class="m-sar-col"
52
52
  v-bind="$attrs"
53
53
  >
54
54
  <span>
@@ -189,7 +189,7 @@ export const useMyth = () => {
189
189
  if (controlStyle && !item.style) {
190
190
  item.style = controlStyle + (item.style ? ` ${item.style}` : '')
191
191
  }
192
- item.headerClasses = (item.headerClasses ? item.headerClasses : '') + ' m--control-header'
192
+ item.headerClasses = (item.headerClasses ? item.headerClasses : '') + ' m-control-header'
193
193
  item.headerClasses = item.headerClasses.trim()
194
194
  item.sortable = !1
195
195
  if (!item.align) {
@@ -198,9 +198,9 @@ export const useMyth = () => {
198
198
  // opts.classes = opts.classes || ''
199
199
  if (typeof opts.classes === 'function') {
200
200
  const callback = opts.classes
201
- opts.classes = (item) => (callback(item) || '') + ' m--control-cell'
201
+ opts.classes = (item) => (callback(item) || '') + ' m-control-cell'
202
202
  } else if (typeof opts.classes === 'string') {
203
- opts.classes += ' m--control-cell'
203
+ opts.classes += ' m-control-cell'
204
204
  opts.classes = opts.classes.trim()
205
205
  }
206
206
  }
@@ -247,7 +247,7 @@ export const useMyth = () => {
247
247
  const dialogProps = pluginOptions.value.confirmDialog || {} as any
248
248
  dialogProps.transitionShow = dialogProps.transitionShow || 'jump-down'
249
249
  dialogProps.transitionHide = dialogProps.transitionHide || 'jump-up'
250
- dialogProps.class = ('m--confirm ') + (dialogProps.class || '')
250
+ dialogProps.class = ('m-confirm ') + (dialogProps.class || '')
251
251
  return q.dialog({
252
252
  title,
253
253
  message,
@@ -55,7 +55,12 @@ export const defineAsyncComponents = function (app: App) {
55
55
  app.component('MDatatable', defineAsyncComponent(() => import('../components/datatable/MDatatable.vue')))
56
56
  app.component('MDtAvatar', defineAsyncComponent(() => import('../components/datatable/MDtAvatar.vue')))
57
57
  app.component('MDtBtn', defineAsyncComponent(() => import('../components/datatable/MDtBtn.vue')))
58
+ app.component('MDtColorColumn', defineAsyncComponent(() => import('../components/datatable/MDtColorColumn.vue')))
58
59
  app.component('MDtContextmenuItems', defineAsyncComponent(() => import('../components/datatable/MDtContextmenuItems.vue')))
60
+ app.component('MDtCopyColumn', defineAsyncComponent(() => import('../components/datatable/MDtCopyColumn.vue')))
61
+ app.component('MDtImageColumn', defineAsyncComponent(() => import('../components/datatable/MDtImageColumn.vue')))
62
+ app.component('MDtSarColumn', defineAsyncComponent(() => import('../components/datatable/MDtSarColumn.vue')))
63
+ app.component('MDtUrlColumn', defineAsyncComponent(() => import('../components/datatable/MDtUrlColumn.vue')))
59
64
 
60
65
  // Utils.
61
66
  app.component('MSarIcon', defineAsyncComponent(() => import('../components/sar/MSarIcon.vue')))
@@ -1,12 +1,12 @@
1
1
 
2
- $m--container-padding: $space-base !default
3
- $m--container-fluid-width: 1440px !default
2
+ $m-container-padding: $space-base !default
3
+ $m-container-fluid-width: 1440px !default
4
4
 
5
- .m--container
5
+ .m-container
6
6
  &__dense
7
7
  padding: 0
8
8
 
9
9
  &__fluid
10
- max-width: $m--container-fluid-width
10
+ max-width: $m-container-fluid-width
11
11
  margin-left: auto
12
12
  margin-right: auto
@@ -1,26 +1,27 @@
1
- $control-max-width: 200px !default
2
- $fixed-dt-height: 80vh !default
1
+ $m-control-max-width: 200px !default
2
+ $m-dt-fixed-height: 80vh !default
3
+ $m-dt-desc-width: 150px !default
3
4
 
4
5
  .touch
5
- .m--datatable-fab-tooltip
6
+ .m-datatable-fab-tooltip
6
7
  display: none
7
8
 
8
9
  .body--light
9
- .m--datatable
10
+ .m-datatable
10
11
  .q-table__top,
11
12
  .q-table__bottom,
12
13
  thead tr:first-child th
13
14
  background: #fff
14
15
 
15
16
  .body--dark
16
- .m--datatable
17
+ .m-datatable
17
18
  .q-table__top,
18
19
  .q-table__bottom,
19
20
  thead tr:first-child th
20
21
  background: var(--q-dark-page)
21
22
 
22
- .m--datatable-component
23
- .m--datatable.m--datatable-grid
23
+ .m-datatable-component
24
+ .m-datatable.m-datatable-grid
24
25
  .q-table__top
25
26
  padding-left: 0
26
27
  padding-right: 0
@@ -36,14 +37,14 @@ $fixed-dt-height: 80vh !default
36
37
  thead tr:first-child th
37
38
  top: 0
38
39
 
39
- .m--datatable:not(.m--datatable-grid)
40
- max-height: $fixed-dt-height
40
+ .m-datatable:not(.m-datatable-grid)
41
+ max-height: $m-dt-fixed-height
41
42
 
42
- .m--datatable:not(.m--datatable-grid).q-table--dense
43
+ .m-datatable:not(.m-datatable-grid).q-table--dense
43
44
  &.q-table--loading thead tr:last-child th
44
45
  top: 26px
45
46
 
46
- .m--datatable:not(.m--datatable-grid):not(.q-table--dense)
47
+ .m-datatable:not(.m-datatable-grid):not(.q-table--dense)
47
48
  &.q-table--loading thead tr:last-child th
48
49
  top: 55px
49
50
 
@@ -67,7 +68,7 @@ $fixed-dt-height: 80vh !default
67
68
  min-width: 0
68
69
  max-width: 100%
69
70
 
70
- .m--dialog-card
71
+ .m-dialog-card
71
72
  .q-card__actions
72
73
  .q-btn
73
74
  padding: 4px 16px !important
@@ -77,9 +78,15 @@ $fixed-dt-height: 80vh !default
77
78
 
78
79
  .screen--xs,
79
80
  .screen--sm
80
- .m--dt-btn-tooltip
81
+ .m-dt-btn-tooltip
81
82
  display: none
82
83
 
83
- .m--control-cell,
84
- .m--control-header
85
- width: $control-max-width
84
+ .m-control-cell,
85
+ .m-control-header
86
+ width: $m-control-max-width
87
+
88
+ .m-dt__max_desc
89
+ max-width: $m-dt-desc-width
90
+ text-overflow: ellipsis
91
+ white-space: nowrap
92
+ overflow: hidden
@@ -1,4 +1,4 @@
1
1
  $m-help-row-margin-top: 4px !default
2
2
 
3
- .m--help-row
3
+ .m-help-row
4
4
  margin-top: $m-help-row-margin-top
@@ -1,28 +1,28 @@
1
- $m--input-helpers-margin: 5px !default
1
+ $m-input-helpers-margin: 5px !default
2
2
  $radius-value: $generic-border-radius !default
3
3
 
4
- [data-input-name].m--input__error
4
+ [data-input-name].m-input__error
5
5
  > .q-field
6
6
  &:not(.q-field--disabled)
7
7
  .q-field__label::after
8
8
  color: var(--q-negative)
9
9
 
10
- .m--input__top-label__content
10
+ .m-input__top-label__content
11
11
  color: var(--q-negative)
12
12
 
13
13
 
14
- [data-input-name].m--input__required
15
- &:not(.m--input__is-top-label)
14
+ [data-input-name].m-input__required
15
+ &:not(.m-input__is-top-label)
16
16
  > .q-field
17
17
  &:not(.q-field--disabled)
18
18
  .q-field__label::after
19
19
  content: ' *'
20
20
 
21
- .m--input__top-label__content::after
21
+ .m-input__top-label__content::after
22
22
  content: ' *'
23
23
  color: var(--q-negative)
24
24
 
25
- .m--input
25
+ .m-input
26
26
  &__color-preview
27
27
  border: 1px solid var(--q-brand)
28
28
  border-radius: $radius-value
@@ -30,7 +30,7 @@ $radius-value: $generic-border-radius !default
30
30
  &__top-label,
31
31
  &__hint,
32
32
  &__caption
33
- margin-bottom: $m--input-helpers-margin
33
+ margin-bottom: $m-input-helpers-margin
34
34
 
35
35
  //&__caption
36
36
  //font-size: 0.75rem
@@ -1,5 +1,5 @@
1
- .m--date__picker,
2
- .m--time__picker
1
+ .m-date__picker,
2
+ .m-time__picker
3
3
  .q-date__calendar-item
4
4
  > div
5
5
  text-overflow: ellipsis
@@ -1,4 +1,4 @@
1
- $m--select__popup-content: 300px !default
1
+ $m-select__popup-content: 300px !default
2
2
 
3
- .m--select__popup-content
4
- max-height: $m--select__popup-content
3
+ .m-select__popup-content
4
+ max-height: $m-select__popup-content
@@ -1,6 +1,6 @@
1
1
  @use 'sass:map'
2
2
 
3
- $m--row-margin-top: 1rem !default
3
+ $m-row-margin-top: 1rem !default
4
4
 
5
5
  // Flex.
6
6
  .flex-break
@@ -17,8 +17,8 @@ $m--row-margin-top: 1rem !default
17
17
  width: 0 !important
18
18
 
19
19
 
20
- .m--row + .m--row
21
- margin-top: $m--row-margin-top
20
+ .m-row + .m-row
21
+ margin-top: $m-row-margin-top
22
22
 
23
23
 
24
24
  // Directions.
@@ -52,14 +52,14 @@ $maxes: ('width', 'height') !default
52
52
  .max-#{$max}
53
53
  max-#{$max}: 100% !important
54
54
 
55
- $m--bordered-color: var(--q-body) !default
55
+ $m-bordered-color: var(--q-body) !default
56
56
  $alignsX: ('top', 'bottom') !default
57
57
  $alignsY: ('left', 'right') !default
58
58
  $radius-class-name: 'border-rounded' !default
59
59
  $radius-value: $generic-border-radius !default
60
60
  $bordered-class-name: 'bordered' !default
61
61
  $bordered-size: 1px !default
62
- $bordered-style: $bordered-size solid $m--bordered-color !default
62
+ $bordered-style: $bordered-size solid $m-bordered-color !default
63
63
 
64
64
 
65
65
  .#{$radius-class-name}
@@ -100,6 +100,6 @@ $bordered-style: $bordered-size solid $m--bordered-color !default
100
100
  pre
101
101
  max-width: 100%
102
102
 
103
- .m--confirm.actions-between
103
+ .m-confirm.actions-between
104
104
  .q-card__actions
105
105
  justify-content: space-between !important
@@ -8,7 +8,26 @@
8
8
 
9
9
  import type { GlobalComponentConstructor } from 'quasar'
10
10
  import type { ApiInterface } from './api-helpers'
11
- import type { MDatatableProps, MDatatableSlots, MDtAvatarProps, MDtAvatarSlots, MDtBtnProps, MDtBtnSlots, MDtContextmenuItemsProps, MDtContextmenuItemsSlots } from './m-datatable'
11
+ import type {
12
+ MDatatableProps,
13
+ MDatatableSlots,
14
+ MDtAvatarProps,
15
+ MDtAvatarSlots,
16
+ MDtBtnProps,
17
+ MDtBtnSlots,
18
+ MDtColorColumnProps,
19
+ MDtColorColumnSlots,
20
+ MDtContextmenuItemsProps,
21
+ MDtContextmenuItemsSlots,
22
+ MDtCopyColumnProps,
23
+ MDtCopyColumnSlots,
24
+ MDtImageColumnProps,
25
+ MDtImageColumnSlots,
26
+ MDtSarColumnProps,
27
+ MDtSarColumnSlots,
28
+ MDtUrlColumnProps,
29
+ MDtUrlColumnSlots
30
+ } from './m-datatable'
12
31
  import type { MAvatarViewerProps, MAvatarViewerSlots } from './api/MAvatarViewer'
13
32
  import type { MTransitionGroupProps, MTransitionProps, MTransitionsSlots } from './api/MTransition'
14
33
  import type { MAxiosProps, MAxiosSlots } from './api/MAxios'
@@ -103,7 +122,12 @@ declare module '@vue/runtime-core' {
103
122
  MDatatable: GlobalComponentConstructor<MDatatableProps, MDatatableSlots>;
104
123
  MDtAvatar: GlobalComponentConstructor<MDtAvatarProps, MDtAvatarSlots>;
105
124
  MDtBtn: GlobalComponentConstructor<MDtBtnProps, MDtBtnSlots>;
125
+ MDtColorColumn: GlobalComponentConstructor<MDtColorColumnProps, MDtColorColumnSlots>;
106
126
  MDtContextmenuItems: GlobalComponentConstructor<MDtContextmenuItemsProps, MDtContextmenuItemsSlots>;
127
+ MDtCopyColumn: GlobalComponentConstructor<MDtCopyColumnProps, MDtCopyColumnSlots>;
128
+ MDtImageColumn: GlobalComponentConstructor<MDtImageColumnProps, MDtImageColumnSlots>;
129
+ MDtSarColumn: GlobalComponentConstructor<MDtSarColumnProps, MDtSarColumnSlots>;
130
+ MDtUrlColumn: GlobalComponentConstructor<MDtUrlColumnProps, MDtUrlColumnSlots>;
107
131
 
108
132
  // Utils.
109
133
  MSarIcon: GlobalComponentConstructor<MSarIconProps, MSarIconSlots>;
@@ -182,24 +182,22 @@ type MDatatableMainScope = {
182
182
  form: MDatatableFormScope,
183
183
  }
184
184
 
185
- export interface MDatatableSlots extends Omit<QTableSlots, `body-cell-${string}` | 'top'> {
186
- tools: ((scope: { dt: MDatatableScope, }) => VNode[]);
185
+ type MDatatableSlotFn<T = any> = (scope: T) => VNode[];
187
186
 
188
- selection: ((scope: { dt: MDatatableScope, }) => VNode[]);
187
+ export interface MDatatableSlots extends Omit<QTableSlots, 'top'> {
188
+ tools: MDatatableSlotFn<{ dt: MDatatableScope }>;
189
+ selection: MDatatableSlotFn<{ dt: MDatatableScope }>;
190
+ filter: MDatatableSlotFn<{ filter: MDatatableFilterForm } & MDatatableMainScope>;
191
+ show: MDatatableSlotFn<MDatatableMainScope>;
192
+ form: MDatatableSlotFn<MDatatableMainScope>;
193
+ 'form-actions': MDatatableSlotFn<MDatatableMainScope>;
194
+ title: MDatatableSlotFn<MDatatableMainScope>;
195
+ 'top-search': MDatatableSlotFn<MDatatableMainScope>;
196
+ 'bottom-search': MDatatableSlotFn<MDatatableMainScope>;
189
197
 
190
- filter: ((scope: { filter: MDatatableFilterForm } & MDatatableMainScope) => VNode[]);
191
-
192
- show: ((scope: MDatatableMainScope) => VNode[]);
193
-
194
- form: ((scope: MDatatableMainScope) => VNode[]);
195
-
196
- 'form-actions': ((scope: MDatatableMainScope) => VNode[]);
197
-
198
- title: ((scope: MDatatableMainScope) => VNode[]);
199
- 'top-search': ((scope: MDatatableMainScope) => VNode[]);
200
- 'bottom-search': ((scope: MDatatableMainScope) => VNode[]);
201
-
202
- [K: `body-cell-${string}`]: ((scope: Parameters<QTableSlots['body-cell']>[0] & { dt: MDatatableScope }) => VNode[]);
198
+ [key: `body-cell-${string}`]: MDatatableSlotFn<
199
+ Parameters<QTableSlots['body-cell']>[0] & { dt: MDatatableScope }
200
+ >;
203
201
  }
204
202
 
205
203
  export type MDtServiceNameCallbackProp = (() => Record<string, (() => Promise<AxiosResponse>)>)
@@ -310,6 +308,10 @@ export type MDatatableProps<I extends GenericFormValues = GenericFormValues> = O
310
308
  * Names of SAR columns in the table.
311
309
  */
312
310
  sarColumns?: MaybeRefOrGetter<string[]>;
311
+ /**
312
+ * Names of a text want to show copy btn
313
+ */
314
+ copyColumns?: MaybeRefOrGetter<string[]>;
313
315
  }
314
316
 
315
317
  export interface MDtAvatarProps extends QAvatarProps {
@@ -338,3 +340,62 @@ export interface MDtContextmenuItemsSlots {
338
340
  */
339
341
  default: () => VNode[];
340
342
  }
343
+
344
+ export interface MDtColorColumnProps {
345
+ value?: any;
346
+ size?: string | number;
347
+ }
348
+
349
+ export interface MDtColorColumnSlots {
350
+ /**
351
+ * Default slot can be used for captions. See examples
352
+ */
353
+ default: () => VNode[];
354
+ }
355
+
356
+ export interface MDtCopyColumnProps {
357
+ value?: any;
358
+ width?: string | number;
359
+ }
360
+
361
+ export interface MDtCopyColumnSlots {
362
+ /**
363
+ * Default slot can be used for captions. See examples
364
+ */
365
+ default: () => VNode[];
366
+ }
367
+
368
+ export interface MDtImageColumnProps {
369
+ imageMode?: MDatatableProps['imageMode'];
370
+ imageSize?: MDatatableProps['imageSize'];
371
+ value: any;
372
+ }
373
+
374
+ export interface MDtImageColumnSlots {
375
+ /**
376
+ * Default slot can be used for captions. See examples
377
+ */
378
+ default: () => VNode[];
379
+ }
380
+
381
+ export interface MDtSarColumnProps {
382
+ value?: any;
383
+ }
384
+
385
+ export interface MDtSarColumnSlots {
386
+ /**
387
+ * Default slot can be used for captions. See examples
388
+ */
389
+ default: () => VNode[];
390
+ }
391
+
392
+ export interface MDtUrlColumnProps {
393
+ value?: any;
394
+ }
395
+
396
+ export interface MDtUrlColumnSlots {
397
+ /**
398
+ * Default slot can be used for captions. See examples
399
+ */
400
+ default: () => VNode[];
401
+ }