@vc-shell/framework 1.0.46 → 1.0.48

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 (62) hide show
  1. package/core/plugins/index.ts +2 -1
  2. package/core/plugins/moment/humanize.ts +77 -0
  3. package/core/plugins/moment/index.ts +1 -0
  4. package/core/plugins/moment/moment.ts +29 -0
  5. package/core/types/index.ts +10 -5
  6. package/dist/core/plugins/index.d.ts +2 -1
  7. package/dist/core/plugins/index.d.ts.map +1 -1
  8. package/dist/core/plugins/moment/humanize.d.ts +3 -0
  9. package/dist/core/plugins/moment/humanize.d.ts.map +1 -0
  10. package/dist/core/plugins/moment/index.d.ts +2 -0
  11. package/dist/core/plugins/moment/index.d.ts.map +1 -0
  12. package/dist/core/plugins/moment/moment.d.ts +13 -0
  13. package/dist/core/plugins/moment/moment.d.ts.map +1 -0
  14. package/dist/core/types/index.d.ts +12 -6
  15. package/dist/core/types/index.d.ts.map +1 -1
  16. package/dist/framework.js +96 -81
  17. package/dist/index.d.ts +1 -1
  18. package/dist/index.d.ts.map +1 -1
  19. package/dist/style.css +1 -1
  20. package/dist/tsconfig.tsbuildinfo +1 -1
  21. package/dist/ui/components/index.d.ts +0 -1
  22. package/dist/ui/components/index.d.ts.map +1 -1
  23. package/dist/ui/components/molecules/vc-input/index.d.ts +1 -1
  24. package/dist/ui/components/molecules/vc-input/index.d.ts.map +1 -1
  25. package/dist/ui/components/molecules/vc-input/vc-input-model.d.ts +1 -5
  26. package/dist/ui/components/molecules/vc-input/vc-input-model.d.ts.map +1 -1
  27. package/dist/ui/components/molecules/vc-input-currency/vc-input-currency-model.d.ts +4 -10
  28. package/dist/ui/components/molecules/vc-input-currency/vc-input-currency-model.d.ts.map +1 -1
  29. package/dist/ui/components/molecules/vc-select/index.d.ts.map +1 -1
  30. package/dist/ui/components/molecules/vc-select/vc-select-model.d.ts +5 -12
  31. package/dist/ui/components/molecules/vc-select/vc-select-model.d.ts.map +1 -1
  32. package/dist/ui/types/index.d.ts +6 -6
  33. package/dist/ui/types/index.d.ts.map +1 -1
  34. package/dist/ui/types/ts-helpers.d.ts +4 -5
  35. package/dist/ui/types/ts-helpers.d.ts.map +1 -1
  36. package/dist/vite.config.d.ts.map +1 -1
  37. package/package.json +4 -4
  38. package/ui/components/atoms/vc-icon/vc-icon.vue +1 -1
  39. package/ui/components/index.ts +0 -1
  40. package/ui/components/molecules/vc-input/index.ts +1 -1
  41. package/ui/components/molecules/vc-input/vc-input-model.ts +2 -5
  42. package/ui/components/molecules/vc-input/vc-input.vue +2 -2
  43. package/ui/components/molecules/vc-input-currency/vc-input-currency-model.ts +4 -10
  44. package/ui/components/molecules/vc-input-currency/vc-input-currency.vue +2 -5
  45. package/ui/components/molecules/vc-select/index.ts +1 -0
  46. package/ui/components/molecules/vc-select/vc-select-model.ts +6 -13
  47. package/ui/components/molecules/vc-select/vc-select.vue +3 -2
  48. package/ui/components/molecules/vc-slider/vc-slider.vue +7 -3
  49. package/ui/components/organisms/vc-app/_internal/vc-app-bar/vc-app-bar.vue +1 -1
  50. package/ui/components/organisms/vc-app/_internal/vc-app-menu/_internal/vc-app-menu-item/vc-app-menu-item.vue +6 -8
  51. package/ui/components/organisms/vc-app/_internal/vc-app-menu/vc-app-menu.vue +2 -0
  52. package/ui/components/organisms/vc-app/vc-app.vue +5 -1
  53. package/ui/components/organisms/vc-blade/_internal/vc-blade-toolbar/_internal/vc-blade-toolbar-button/vc-blade-toolbar-button.vue +22 -36
  54. package/ui/components/organisms/vc-blade/_internal/vc-blade-toolbar/vc-blade-toolbar.vue +7 -5
  55. package/ui/components/organisms/vc-dynamic-property/vc-dynamic-property.vue +9 -4
  56. package/ui/components/organisms/vc-gallery/_internal/vc-gallery-preview/vc-gallery-preview.vue +2 -5
  57. package/ui/components/organisms/vc-table/vc-table.vue +80 -133
  58. package/ui/types/index.ts +5 -17
  59. package/ui/types/ts-helpers.ts +7 -21
  60. package/dist/framework.js.map +0 -1
  61. package/ui/components/molecules/vc-currency-input/vc-input.vue +0 -436
  62. package/ui/components/molecules/vc-multivalue/vc-multivalue.vue +0 -447
@@ -24,14 +24,16 @@
24
24
  </template>
25
25
 
26
26
  <script lang="ts" setup>
27
+ import { IBladeToolbar } from "@/core/types";
27
28
  import { ref } from "vue";
28
29
  import VcBladeToolbarButton from "./_internal/vc-blade-toolbar-button/vc-blade-toolbar-button.vue";
29
30
 
30
- const props = defineProps({
31
- items: {
32
- type: Array,
33
- default: () => [],
34
- },
31
+ export interface Props {
32
+ items: IBladeToolbar[];
33
+ }
34
+
35
+ const props = withDefaults(defineProps<Props>(), {
36
+ items: () => [],
35
37
  });
36
38
 
37
39
  const isExpanded = ref(true);
@@ -122,14 +122,13 @@
122
122
 
123
123
  <Field
124
124
  v-else-if="property.valueType === 'Number' && property.multivalue"
125
- v-slot="{ errorMessage, handleChange }"
125
+ v-slot="{ errorMessage, handleChange, errors }"
126
126
  :name="property.name"
127
127
  :modelValue="property.values"
128
128
  :rules="rules"
129
129
  >
130
- <VcMultivalue
130
+ <VcSelect
131
131
  v-bind="$attrs"
132
- :error-message="errorMessage"
133
132
  :label="handleDisplayName"
134
133
  :modelValue="property.values"
135
134
  @update:modelValue="
@@ -142,7 +141,13 @@
142
141
  :required="property.required || property.isRequired"
143
142
  placeholder="Add value"
144
143
  :disabled="disabled"
145
- ></VcMultivalue>
144
+ :error="!!errors.length"
145
+ :error-message="errorMessage"
146
+ :options="items"
147
+ option-value="id"
148
+ :option-label="handleDisplayProperty"
149
+ multiple
150
+ ></VcSelect>
146
151
  </Field>
147
152
 
148
153
  <Field
@@ -57,13 +57,10 @@
57
57
  <script lang="ts" setup>
58
58
  import { computed, ref } from "vue";
59
59
  import { VcPopup } from "@/ui/components";
60
+ import { IImage } from "@/core/types";
60
61
 
61
62
  export interface Props {
62
- images?: {
63
- title: string;
64
- name: string;
65
- url: string;
66
- }[];
63
+ images?: IImage[];
67
64
  index: number;
68
65
  }
69
66
 
@@ -192,7 +192,7 @@
192
192
  <button
193
193
  class="tw-text-[#319ed4] tw-cursor-pointer tw-border-none tw-bg-transparent disabled:tw-text-[gray]"
194
194
  @click.stop="showActions(item, item.id)"
195
- :ref="(el) => setActionToggleRefs(el, item.id)"
195
+ :ref="(el: Element) => setActionToggleRefs(el, item.id)"
196
196
  aria-describedby="tooltip"
197
197
  :disabled="!(itemActions && itemActions.length)"
198
198
  >
@@ -202,7 +202,7 @@
202
202
  class="vc-table__body-tooltip tw-bg-white tw-rounded-l-[4px] tw-p-[15px] tw-z-0 tw-absolute tw-right-0 tw-drop-shadow-[1px_3px_14px_rgba(111,122,131,0.25)]"
203
203
  v-show="selectedRow === item.id"
204
204
  @mouseleave="closeActions"
205
- :ref="(el) => setTooltipRefs(el, item.id)"
205
+ :ref="(el: Element) => setTooltipRefs(el, item.id)"
206
206
  role="tooltip"
207
207
  >
208
208
  <div
@@ -312,129 +312,72 @@ import VcTableFilter from "./_internal/vc-table-filter/vc-table-filter.vue";
312
312
  import VcTableMobileItem from "./_internal/vc-table-mobile-item/vc-table-mobile-item.vue";
313
313
  import VcTableCell from "./_internal/vc-table-cell/vc-table-cell.vue";
314
314
  import { createPopper, Instance } from "@popperjs/core";
315
- import { IActionBuilderResult } from "@/core/types";
315
+ import { IActionBuilderResult, ITableColumns } from "@/core/types";
316
+
317
+ export interface Props {
318
+ columns: ITableColumns[];
319
+ items: { id: string }[];
320
+ itemActionBuilder?: (item: { id: string }) => IActionBuilderResult[];
321
+ sort?: string;
322
+ multiselect?: boolean;
323
+ expanded?: boolean;
324
+ totalLabel?: string;
325
+ totalCount?: number;
326
+ pages?: number;
327
+ currentPage?: number;
328
+ searchPlaceholder?: string;
329
+ searchValue?: string;
330
+ loading?: boolean;
331
+ empty?: StatusImage;
332
+ notfound?: StatusImage;
333
+ header?: boolean;
334
+ footer?: boolean;
335
+ activeFilterCount?: number;
336
+ selectedItemId?: string;
337
+ scrolling?: boolean;
338
+ onItemClick?: () => void;
339
+ }
316
340
 
317
- interface ITableItemRef {
318
- element: HTMLDivElement;
319
- id: string;
341
+ export interface StatusImage {
342
+ image?: string;
343
+ text: string;
344
+ action?: boolean;
345
+ clickHandler?: () => void;
320
346
  }
321
347
 
322
- const props = defineProps({
323
- columns: {
324
- type: Array,
325
- default: () => [],
326
- },
327
-
328
- items: {
329
- type: Array as PropType<{ id: string }[]>,
330
- default: () => [],
331
- },
332
-
333
- filterItems: {
334
- type: Array,
335
- default: () => [],
336
- },
337
-
338
- itemActionBuilder: {
339
- type: Function,
340
- default: undefined,
341
- },
342
-
343
- sort: {
344
- type: String,
345
- default: undefined,
346
- },
347
-
348
- multiselect: {
349
- type: Boolean,
350
- default: false,
351
- },
352
-
353
- expanded: {
354
- type: Boolean,
355
- default: false,
356
- },
357
-
358
- totalLabel: {
359
- type: String,
360
- default: "Totals:",
361
- },
362
-
363
- totalCount: {
364
- type: Number,
365
- default: 0,
366
- },
367
-
368
- pages: {
369
- type: Number,
370
- default: 0,
371
- },
372
-
373
- currentPage: {
374
- type: Number,
375
- default: 0,
376
- },
377
-
378
- searchPlaceholder: {
379
- type: String,
380
- default: "Search...",
381
- },
382
-
383
- searchValue: {
384
- type: String,
385
- default: undefined,
386
- },
387
-
388
- loading: {
389
- type: Boolean,
390
- default: false,
391
- },
392
-
393
- empty: {
394
- type: Object,
395
- default: () => ({
396
- text: "List is empty.",
397
- }),
398
- },
399
-
400
- notfound: {
401
- type: Object,
402
- default: () => ({
403
- text: "Nothing found.",
404
- }),
405
- },
406
-
407
- header: {
408
- type: Boolean,
409
- default: true,
410
- },
411
-
412
- footer: {
413
- type: Boolean,
414
- default: true,
415
- },
416
-
417
- activeFilterCount: {
418
- type: Number,
419
- default: 0,
420
- },
421
-
422
- selectedItemId: {
423
- type: String,
424
- default: undefined,
425
- },
426
-
427
- scrolling: {
428
- type: Boolean,
429
- default: false,
430
- },
431
-
432
- onItemClick: {
433
- type: Function,
434
- default: undefined,
435
- },
348
+ const props = withDefaults(defineProps<Props>(), {
349
+ columns: () => [],
350
+ items: () => [],
351
+ itemActionBuilder: undefined,
352
+ sort: undefined,
353
+ multiselect: false,
354
+ expanded: false,
355
+ totalLabel: "Totals:",
356
+ totalCount: 0,
357
+ pages: 0,
358
+ currentPage: 0,
359
+ searchPlaceholder: "Search...",
360
+ searchValue: undefined,
361
+ loading: false,
362
+ empty: () => ({
363
+ text: "List is empty.",
364
+ }),
365
+ notfound: () => ({
366
+ text: "Nothing found.",
367
+ }),
368
+ header: true,
369
+ footer: true,
370
+ activeFilterCount: 0,
371
+ selectedItemId: undefined,
372
+ scrolling: false,
373
+ onItemClick: undefined,
436
374
  });
437
375
 
376
+ interface ITableItemRef {
377
+ element: Element;
378
+ id: string;
379
+ }
380
+
438
381
  const emit = defineEmits([
439
382
  "paginationClick",
440
383
  "selectionChanged",
@@ -490,7 +433,7 @@ watch(
490
433
  }
491
434
  );
492
435
 
493
- function setTooltipRefs(el: HTMLDivElement, id: string) {
436
+ function setTooltipRefs(el: Element, id: string) {
494
437
  if (el) {
495
438
  const isExists = tooltipRefs.value.some((item) => item.id === id);
496
439
  if (!isExists) {
@@ -499,7 +442,7 @@ function setTooltipRefs(el: HTMLDivElement, id: string) {
499
442
  }
500
443
  }
501
444
 
502
- function setActionToggleRefs(el: HTMLDivElement, id: string) {
445
+ function setActionToggleRefs(el: Element, id: string) {
503
446
  if (el) {
504
447
  const isExists = actionToggleRefs.value.some((item) => item.id === id);
505
448
  if (!isExists) {
@@ -529,18 +472,22 @@ function showActions(item: { id: string }, index: string) {
529
472
 
530
473
  if (toggleRef && tooltipRef) {
531
474
  nextTick(() => {
532
- tooltip.value = createPopper(toggleRef.element, tooltipRef.element, {
533
- placement: "bottom",
534
- onFirstUpdate: () => tooltip.value?.update(),
535
- modifiers: [
536
- {
537
- name: "offset",
538
- options: {
539
- offset: [-15, 15],
475
+ tooltip.value = createPopper(
476
+ toggleRef.element,
477
+ tooltipRef.element as HTMLElement,
478
+ {
479
+ placement: "bottom",
480
+ onFirstUpdate: () => tooltip.value?.update(),
481
+ modifiers: [
482
+ {
483
+ name: "offset",
484
+ options: {
485
+ offset: [-15, 15],
486
+ },
540
487
  },
541
- },
542
- ],
543
- });
488
+ ],
489
+ }
490
+ );
544
491
  });
545
492
  }
546
493
  }
package/ui/types/index.ts CHANGED
@@ -1,38 +1,26 @@
1
1
  import { GlobalComponentConstructor } from "./ts-helpers";
2
2
  import {
3
- VcInputEmits,
4
3
  VcInputProps,
5
4
  VcInputSlots,
6
5
  } from "../components/molecules/vc-input/vc-input-model";
7
6
  import {
8
- VcSelectEmits,
9
7
  VcSelectProps,
10
8
  VcSelectSlots,
11
9
  } from "../components/molecules/vc-select/vc-select-model";
12
10
  import {
13
11
  VcInputCurrencyProps,
14
- VcInputCurrencyEmits,
15
12
  VcInputCurrencySlots,
16
- } from "@/ui/components/molecules/vc-input-currency/vc-input-currency-model";
13
+ } from "../components/molecules/vc-input-currency/vc-input-currency-model";
17
14
 
18
15
  declare module "@vue/runtime-core" {
19
16
  interface GlobalComponents {
20
- VcInput: GlobalComponentConstructor<
21
- VcInputProps,
22
- VcInputSlots,
23
- VcInputEmits
24
- >;
17
+ VcInput: GlobalComponentConstructor<VcInputProps, VcInputSlots>;
25
18
  VcInputCurrency: GlobalComponentConstructor<
26
19
  VcInputCurrencyProps,
27
- VcInputCurrencySlots,
28
- VcInputCurrencyEmits
29
- >;
30
- VcSelect: GlobalComponentConstructor<
31
- VcSelectProps,
32
- VcSelectSlots,
33
- VcSelectEmits
20
+ VcInputCurrencySlots
34
21
  >;
22
+ VcSelect: GlobalComponentConstructor<VcSelectProps, VcSelectSlots>;
35
23
  }
36
24
  }
37
25
 
38
- export {};
26
+ export { };
@@ -3,7 +3,6 @@ import {
3
3
  ComponentOptions,
4
4
  ComponentPublicInstance,
5
5
  ComputedOptions,
6
- EmitsOptions,
7
6
  MethodOptions,
8
7
  VNodeProps,
9
8
  } from "vue";
@@ -16,31 +15,18 @@ export type ComponentConstructor<
16
15
  RawBindings,
17
16
  D,
18
17
  C,
19
- M,
20
- E
18
+ M
21
19
  > = ComponentPublicInstance<any>,
22
20
  Props = any,
23
21
  RawBindings = any,
24
22
  D = any,
25
23
  C extends ComputedOptions = ComputedOptions,
26
24
  M extends MethodOptions = MethodOptions,
27
- E extends EmitsOptions = EmitsOptions
28
- > = { new (): Component } & ComponentOptions<
29
- Props,
30
- RawBindings,
31
- D,
32
- C,
33
- M,
34
- any,
35
- any,
36
- E
37
- >;
25
+ > = { new (): Component } & ComponentOptions<Props, RawBindings, D, C, M>;
38
26
 
39
-
40
- export type GlobalComponentConstructor<Props = {}, Slots = {}, Emits = {}> = {
41
- new (): {
42
- $props: PublicProps & Props;
43
- $slots: Slots;
44
- $emit: EmitsOptions & Emits;
45
- };
27
+ export type GlobalComponentConstructor<Props = {}, Slots = {}> = {
28
+ new (): {
29
+ $props: PublicProps & Props;
30
+ $slots: Slots;
31
+ }
46
32
  };