quasar-ui-danx 0.0.11 → 0.0.13

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 (84) hide show
  1. package/dist/index.css +5 -0
  2. package/dist/index.min.css +5 -0
  3. package/dist/index.rtl.css +5 -0
  4. package/dist/index.rtl.min.css +5 -0
  5. package/package.json +6 -1
  6. package/src/components/ActionTable/ActionTable.vue +49 -41
  7. package/src/components/ActionTable/BatchActionMenu.vue +20 -20
  8. package/src/components/ActionTable/EmptyTableState.vue +5 -5
  9. package/src/components/ActionTable/Filters/CollapsableFiltersSidebar.vue +11 -11
  10. package/src/components/ActionTable/Filters/FilterGroupItem.vue +7 -7
  11. package/src/components/ActionTable/Filters/FilterGroupList.vue +29 -29
  12. package/src/components/ActionTable/Filters/FilterListToggle.vue +15 -15
  13. package/src/components/ActionTable/Filters/FilterableField.vue +82 -80
  14. package/src/components/ActionTable/Filters/index.ts +5 -0
  15. package/src/components/ActionTable/Form/Fields/BooleanField.vue +13 -13
  16. package/src/components/ActionTable/Form/Fields/ConfirmPasswordField.vue +11 -11
  17. package/src/components/ActionTable/Form/Fields/DateField.vue +13 -13
  18. package/src/components/ActionTable/Form/Fields/DateRangeField.vue +25 -25
  19. package/src/components/ActionTable/Form/Fields/DateTimeField.vue +21 -21
  20. package/src/components/ActionTable/Form/Fields/DateTimePicker.vue +23 -23
  21. package/src/components/ActionTable/Form/Fields/FileUploadButton.vue +31 -31
  22. package/src/components/ActionTable/Form/Fields/InlineDateTimeField.vue +19 -19
  23. package/src/components/ActionTable/Form/Fields/IntegerField.vue +7 -7
  24. package/src/components/ActionTable/Form/Fields/LabelValueBlock.vue +22 -0
  25. package/src/components/ActionTable/Form/Fields/LabeledInput.vue +19 -19
  26. package/src/components/ActionTable/Form/Fields/MultiFileField.vue +40 -40
  27. package/src/components/ActionTable/Form/Fields/MultiKeywordField.vue +23 -23
  28. package/src/components/ActionTable/Form/Fields/NewPasswordField.vue +10 -10
  29. package/src/components/ActionTable/Form/Fields/NumberField.vue +29 -29
  30. package/src/components/ActionTable/Form/Fields/NumberRangeField.vue +33 -33
  31. package/src/components/ActionTable/Form/Fields/SelectDrawer.vue +36 -36
  32. package/src/components/ActionTable/Form/Fields/SelectField.vue +66 -66
  33. package/src/components/ActionTable/Form/Fields/SelectWithChildrenField.vue +23 -23
  34. package/src/components/ActionTable/Form/Fields/SingleFileField.vue +32 -32
  35. package/src/components/ActionTable/Form/Fields/TextField.vue +36 -36
  36. package/src/components/ActionTable/Form/Fields/WysiwygField.vue +16 -16
  37. package/src/components/ActionTable/Form/Fields/index.ts +23 -23
  38. package/src/components/ActionTable/Form/RenderedForm.vue +27 -25
  39. package/src/components/ActionTable/Form/index.ts +2 -0
  40. package/src/components/ActionTable/TableSummaryRow.vue +33 -33
  41. package/src/components/ActionTable/index.ts +8 -13
  42. package/src/components/ActionTable/listActions.ts +340 -339
  43. package/src/components/ActionTable/listHelpers.ts +74 -0
  44. package/src/components/ActionTable/tableColumns.ts +56 -56
  45. package/src/components/DragAndDrop/HandleDraggable.vue +29 -29
  46. package/src/components/DragAndDrop/ListItemDraggable.vue +10 -10
  47. package/src/components/DragAndDrop/index.ts +0 -1
  48. package/src/components/DragAndDrop/listDragAndDrop.ts +1 -1
  49. package/src/components/Utility/CollapsableSidebar.vue +35 -35
  50. package/src/components/Utility/ContentDrawer.vue +20 -20
  51. package/src/components/Utility/Dialogs/ConfirmDialog.vue +55 -55
  52. package/src/components/Utility/Dialogs/FullScreenDialog.vue +18 -18
  53. package/src/components/Utility/Dialogs/FullscreenCarouselDialog.vue +105 -0
  54. package/src/components/Utility/Dialogs/InfoDialog.vue +10 -10
  55. package/src/components/Utility/Dialogs/InputDialog.vue +13 -13
  56. package/src/components/Utility/ImagePreview.vue +192 -0
  57. package/src/components/Utility/Popover/PopoverMenu.vue +64 -0
  58. package/src/components/Utility/Transitions/StaggeredListTransition.vue +15 -15
  59. package/src/components/Utility/index.ts +11 -9
  60. package/src/components/index.ts +1 -1
  61. package/src/helpers/FileUpload.ts +274 -273
  62. package/src/helpers/compatibility.ts +45 -45
  63. package/src/helpers/date.ts +2 -2
  64. package/src/helpers/download.ts +166 -158
  65. package/src/helpers/downloadPdf.ts +48 -48
  66. package/src/helpers/files.ts +42 -42
  67. package/src/helpers/index.ts +2 -0
  68. package/src/helpers/multiFileUpload.ts +56 -56
  69. package/src/helpers/singleFileUpload.ts +49 -49
  70. package/src/index.esm.js +3 -4
  71. package/src/svg/FilterIcon.svg +7 -0
  72. package/src/svg/ImageIcon.svg +30 -0
  73. package/src/svg/PdfIcon.svg +21 -0
  74. package/src/svg/PercentIcon.svg +13 -0
  75. package/src/svg/TrashIcon.svg +15 -0
  76. package/src/svg/XIcon.svg +18 -0
  77. package/src/svg/index.ts +8 -0
  78. package/src/vendor/tinymce-config.ts +1 -0
  79. package/src/vue-plugin.js +7 -4
  80. package/tsconfig.json +18 -14
  81. package/src/components/ActionTable/tableHelpers.ts +0 -83
  82. package/src/components/DragAndDrop/Icons/index.ts +0 -2
  83. /package/src/{components/DragAndDrop/Icons → svg}/DragHandleDotsIcon.svg +0 -0
  84. /package/src/{components/DragAndDrop/Icons → svg}/DragHandleIcon.svg +0 -0
package/dist/index.css ADDED
@@ -0,0 +1,5 @@
1
+ /*!
2
+ * quasar-ui-danx v0.0.12
3
+ * (c) 2024 Dan <dan@flytedesk.com>
4
+ * Released under the MIT License.
5
+ */
@@ -0,0 +1,5 @@
1
+ /*!
2
+ * quasar-ui-danx v0.0.12
3
+ * (c) 2024 Dan <dan@flytedesk.com>
4
+ * Released under the MIT License.
5
+ */
@@ -0,0 +1,5 @@
1
+ /*!
2
+ * quasar-ui-danx v0.0.12
3
+ * (c) 2024 Dan <dan@flytedesk.com>
4
+ * Released under the MIT License.
5
+ */
@@ -0,0 +1,5 @@
1
+ /*!
2
+ * quasar-ui-danx v0.0.12
3
+ * (c) 2024 Dan <dan@flytedesk.com>
4
+ * Released under the MIT License.
5
+ */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "quasar-ui-danx",
3
- "version": "0.0.11",
3
+ "version": "0.0.13",
4
4
  "author": "Dan <dan@flytedesk.com>",
5
5
  "description": "DanX Vue / Quasar component library",
6
6
  "license": "MIT",
@@ -62,7 +62,12 @@
62
62
  "last 4 iOS versions"
63
63
  ],
64
64
  "dependencies": {
65
+ "@heroicons/vue": "v1",
66
+ "@tinymce/tinymce-vue": "^5.1.1",
65
67
  "@vueuse/core": "^10.7.2",
68
+ "exifreader": "^4.21.1",
69
+ "gsap": "^3.12.5",
70
+ "luxon": "^3.4.4",
66
71
  "tailwindcss": "^3.4.1"
67
72
  }
68
73
  }
@@ -1,19 +1,18 @@
1
- <!--suppress VueUnrecognizedSlot -->
2
1
  <template>
3
- <QTable
4
- ref="actionTable"
5
- :selected="selectedRows"
6
- :pagination="quasarPagination"
7
- :columns="columns"
8
- :loading="isLoadingList"
9
- :rows="pagedItems?.data || []"
10
- selection="multiple"
11
- :rows-per-page-options="[25,50,100]"
12
- class="sticky-column sticky-header w-full !border-0"
13
- color="blue-base"
14
- @update:selected="$emit('update:selected-rows', $event)"
15
- @update:pagination="() => {}"
16
- @request="$emit('update:quasar-pagination', $event.pagination)"
2
+ <q-table
3
+ ref="actionTable"
4
+ :selected="selectedRows"
5
+ :pagination="quasarPagination"
6
+ :columns="columns"
7
+ :loading="isLoadingList"
8
+ :rows="pagedItems?.data || []"
9
+ selection="multiple"
10
+ :rows-per-page-options="rowsPerPageOptions"
11
+ class="sticky-column sticky-header w-full !border-0"
12
+ color="blue-base"
13
+ @update:selected="$emit('update:selected-rows', $event)"
14
+ @update:pagination="() => {}"
15
+ @request="$emit('update:quasar-pagination', $event.pagination)"
17
16
  >
18
17
  <template #no-data>
19
18
  <slot name="empty">
@@ -22,38 +21,38 @@
22
21
  </template>
23
22
  <template #top-row>
24
23
  <TableSummaryRow
25
- :label="label"
26
- :item-count="summary?.count || 0"
27
- :selected-count="selectedRows.length"
28
- :loading="isLoadingSummary"
29
- :summary="summary"
30
- :columns="columns"
31
- @clear="$emit('update:selected-rows', [])"
24
+ :label="label"
25
+ :item-count="summary?.count || 0"
26
+ :selected-count="selectedRows.length"
27
+ :loading="isLoadingSummary"
28
+ :summary="summary"
29
+ :columns="columns"
30
+ @clear="$emit('update:selected-rows', [])"
32
31
  />
33
32
  </template>
34
33
  <template #header-cell="rowProps">
35
- <QTh
36
- :key="rowProps.key"
37
- :props="rowProps"
38
- :data-drop-zone="`resize-column-` + rowProps.col.name"
34
+ <q-th
35
+ :key="rowProps.key"
36
+ :props="rowProps"
37
+ :data-drop-zone="`resize-column-` + rowProps.col.name"
39
38
  >
40
39
  {{ rowProps.col.label }}
41
40
  <HandleDraggable
42
- v-if="rowProps.col.resizeable"
43
- :drop-zone="`resize-column-` + rowProps.col.name"
44
- class="resize-handle"
45
- @resize="rowProps.col.onResize"
41
+ v-if="rowProps.col.resizeable"
42
+ :drop-zone="`resize-column-` + rowProps.col.name"
43
+ class="resize-handle"
44
+ @resize="rowProps.col.onResize"
46
45
  >
47
46
  <RowResizeIcon class="w-4 text-neutral-base" />
48
47
  </HandleDraggable>
49
- </QTh>
48
+ </q-th>
50
49
  </template>
51
50
  <template #body-cell="rowProps">
52
- <QTd :key="rowProps.key" :props="rowProps">
51
+ <q-td :key="rowProps.key" :props="rowProps">
53
52
  <template v-if="rowProps.col.component">
54
53
  <RenderComponentColumn
55
- :row-props="rowProps"
56
- @action="$emit('action', $event)"
54
+ :row-props="rowProps"
55
+ @action="$emit('action', $event)"
57
56
  />
58
57
  </template>
59
58
  <template v-else-if="rowProps.col.fieldList">
@@ -71,18 +70,23 @@
71
70
  {{ rowProps.value }}
72
71
  </slot>
73
72
  </template>
74
- </QTd>
73
+ </q-td>
75
74
  </template>
76
- </QTable>
75
+ </q-table>
77
76
  </template>
78
77
 
79
78
  <script setup>
80
- import { DragHandleIcon as RowResizeIcon } from "@/svg";
81
- import { EmptyTableState, registerStickyScrolling, RenderComponentColumn, TableSummaryRow } from "danx/src/components";
82
- import { HandleDraggable } from "quasar-ui-danx/src";
83
- import { ref } from "vue";
79
+ import {
80
+ EmptyTableState,
81
+ HandleDraggable,
82
+ registerStickyScrolling,
83
+ RenderComponentColumn,
84
+ TableSummaryRow
85
+ } from '@ui/components';
86
+ import { DragHandleIcon as RowResizeIcon } from '@ui/svg';
87
+ import { ref } from 'vue';
84
88
 
85
- defineEmits(["action", "filter", "update:quasar-pagination", "update:selected-rows"]);
89
+ defineEmits(['action', 'filter', 'update:quasar-pagination', 'update:selected-rows']);
86
90
  defineProps({
87
91
  label: {
88
92
  type: String,
@@ -109,6 +113,10 @@ defineProps({
109
113
  columns: {
110
114
  type: Array,
111
115
  required: true
116
+ },
117
+ rowsPerPageOptions: {
118
+ type: Array,
119
+ default: () => [10, 25, 50, 100]
112
120
  }
113
121
  });
114
122
  const actionTable = ref(null);
@@ -1,31 +1,31 @@
1
1
  <template>
2
2
  <div>
3
3
  <PopoverMenu
4
- class="bg-neutral-plus-6 px-4 h-full flex"
5
- :items="items"
6
- :disabled="selectedRows.length === 0"
7
- @action="onAction"
4
+ class="bg-neutral-plus-6 px-4 h-full flex"
5
+ :items="items"
6
+ :disabled="selectedRows.length === 0"
7
+ @action="onAction"
8
8
  />
9
- <QTooltip v-if="selectedRows.length === 0">
9
+ <q-tooltip v-if="selectedRows.length === 0">
10
10
  Batch actions require a selection
11
- </QTooltip>
12
- <slot>
13
- <Component
14
- :is="activeComponent.is"
15
- v-if="activeComponent"
16
- v-bind="activeComponent.props"
17
- :is-saving="isSaving"
18
- @close="activeAction = false"
19
- @confirm="onConfirmAction"
20
- />
21
- </slot>
11
+ </q-tooltip>
12
+ <slot>
13
+ <Component
14
+ :is="activeComponent.is"
15
+ v-if="activeComponent"
16
+ v-bind="activeComponent.props"
17
+ :is-saving="isSaving"
18
+ @close="activeAction = false"
19
+ @confirm="onConfirmAction"
20
+ />
21
+ </slot>
22
22
  </div>
23
23
  </template>
24
24
  <script setup>
25
- import PopoverMenu from "components/Common/Menu/PopoverMenu";
26
- import { computed, ref } from "vue";
25
+ import PopoverMenu from '@ui/components/Utility/Popover/PopoverMenu';
26
+ import { computed, ref } from 'vue';
27
27
 
28
- const emit = defineEmits(["action"]);
28
+ const emit = defineEmits(['action']);
29
29
  const props = defineProps({
30
30
  items: {
31
31
  type: Array,
@@ -48,7 +48,7 @@ const activeComponent = computed(() => (props.items.find(i => i.action === activ
48
48
 
49
49
  function onAction(action) {
50
50
  activeAction.value = action;
51
- emit("action", action);
51
+ emit('action', action);
52
52
  }
53
53
  async function onConfirmAction(input) {
54
54
  const result = await props.applyBatchAction(input || activeComponent.value.input());
@@ -2,12 +2,12 @@
2
2
  <div class="flex items-center justify-center text-sm py-14 w-full">
3
3
  <div v-if="loading">
4
4
  <slot name="loading">{{ loadingText }}
5
- <QSpinnerBall class="w-4 ml-2" />
5
+ <q-spinner-ball class="w-4 ml-2" />
6
6
  </slot>
7
7
  </div>
8
8
  <div v-if="saving">
9
9
  <slot name="saving">{{ savingText }}
10
- <QSpinnerBall class="w-4 ml-2" />
10
+ <q-spinner-ball class="w-4 ml-2" />
11
11
  </slot>
12
12
  </div>
13
13
  <slot>{{ text }}</slot>
@@ -19,15 +19,15 @@ defineProps({
19
19
  saving: Boolean,
20
20
  text: {
21
21
  type: String,
22
- default: "No records found"
22
+ default: 'No records found'
23
23
  },
24
24
  loadingText: {
25
25
  type: String,
26
- default: "Loading..."
26
+ default: 'Loading...'
27
27
  },
28
28
  savingText: {
29
29
  type: String,
30
- default: "Saving..."
30
+ default: 'Saving...'
31
31
  }
32
32
  });
33
33
  </script>
@@ -1,23 +1,23 @@
1
1
  <template>
2
2
  <CollapsableSidebar
3
- :collapse="!showFilters"
4
- disabled
5
- min-width="0"
6
- max-width="18rem"
7
- name="admin-ads"
8
- @update:collapse="$emit('update:show-filters', !$event)"
3
+ :collapse="!showFilters"
4
+ disabled
5
+ min-width="0"
6
+ max-width="18rem"
7
+ name="admin-ads"
8
+ @update:collapse="$emit('update:show-filters', !$event)"
9
9
  >
10
10
  <FilterGroupList
11
- :filter="filter"
12
- :filter-groups="filterGroups"
13
- @update:filter="$emit('update:filter', $event)"
11
+ :filter="filter"
12
+ :filter-groups="filterGroups"
13
+ @update:filter="$emit('update:filter', $event)"
14
14
  />
15
15
  </CollapsableSidebar>
16
16
  </template>
17
17
  <script setup>
18
- import { CollapsableSidebar, FilterGroupList } from "danx/src/components";
18
+ import { CollapsableSidebar, FilterGroupList } from '@ui/components';
19
19
 
20
- defineEmits(["update:filter", "update:show-filters"]);
20
+ defineEmits(['update:filter', 'update:show-filters']);
21
21
  defineProps({
22
22
  name: {
23
23
  type: String,
@@ -1,18 +1,18 @@
1
1
  <template>
2
- <QExpansionItem>
2
+ <q-expansion-item>
3
3
  <template #header>
4
4
  <div class="flex items-center flex-nowrap flex-grow">
5
5
  <div class="whitespace-nowrap flex-grow text-left text-sm font-bold">{{ name }}</div>
6
- <QBadge
7
- :label="count"
8
- rounded
9
- class="ml-2 transition-all"
10
- :class="{'bg-gray-base': !count, 'bg-blue-base': count}"
6
+ <q-badge
7
+ :label="count"
8
+ rounded
9
+ class="ml-2 transition-all"
10
+ :class="{'bg-gray-base': !count, 'bg-blue-base': count}"
11
11
  />
12
12
  </div>
13
13
  </template>
14
14
  <slot />
15
- </QExpansionItem>
15
+ </q-expansion-item>
16
16
  </template>
17
17
  <script setup>
18
18
  defineProps({
@@ -1,52 +1,52 @@
1
1
  <template>
2
- <QList>
2
+ <q-list>
3
3
  <div class="px-4 py-2 max-w-full">
4
4
  <template
5
- v-for="(group, index) in filterGroups"
6
- :key="'group-' + group.name"
5
+ v-for="(group, index) in filterGroups"
6
+ :key="'group-' + group.name"
7
7
  >
8
8
  <template v-if="group.flat">
9
9
  <FilterableField
10
- v-for="field in group.fields"
11
- :key="'field-' + field.name"
12
- :model-value="field.calcValue ? field.calcValue(filter) : filter[field.name]"
13
- :field="field"
14
- :loading="loading"
15
- class="mb-4"
16
- @update:model-value="updateFilter(field, $event)"
10
+ v-for="field in group.fields"
11
+ :key="'field-' + field.name"
12
+ :model-value="field.calcValue ? field.calcValue(filter) : filter[field.name]"
13
+ :field="field"
14
+ :loading="loading"
15
+ class="mb-4"
16
+ @update:model-value="updateFilter(field, $event)"
17
17
  />
18
18
  </template>
19
19
 
20
20
  <FilterGroupItem
21
- v-else
22
- :name="group.name"
23
- :count="activeCountByGroup[group.name]"
21
+ v-else
22
+ :name="group.name"
23
+ :count="activeCountByGroup[group.name]"
24
24
  >
25
25
  <FilterableField
26
- v-for="field in group.fields"
27
- :key="'field-' + field.name"
28
- :model-value="field.calcValue ? field.calcValue(filter) : filter[field.name]"
29
- :field="field"
30
- :loading="loading"
31
- class="mb-4"
32
- @update:model-value="updateFilter(field, $event)"
26
+ v-for="field in group.fields"
27
+ :key="'field-' + field.name"
28
+ :model-value="field.calcValue ? field.calcValue(filter) : filter[field.name]"
29
+ :field="field"
30
+ :loading="loading"
31
+ class="mb-4"
32
+ @update:model-value="updateFilter(field, $event)"
33
33
  />
34
34
  </FilterGroupItem>
35
35
 
36
- <QSeparator
37
- v-if="index < (filterGroups.length - 1)"
38
- class="my-2"
36
+ <q-separator
37
+ v-if="index < (filterGroups.length - 1)"
38
+ class="my-2"
39
39
  />
40
40
  </template>
41
41
  </div>
42
- </QList>
42
+ </q-list>
43
43
  </template>
44
44
  <script setup>
45
- import FilterableField from "danx/src/components/ActionTable/Filters/FilterableField";
46
- import FilterGroupItem from "danx/src/components/ActionTable/Filters/FilterGroupItem";
47
- import { computed } from "vue";
45
+ import { computed } from 'vue';
46
+ import FilterableField from './FilterableField';
47
+ import FilterGroupItem from './FilterGroupItem';
48
48
 
49
- const emit = defineEmits(["update:filter"]);
49
+ const emit = defineEmits(['update:filter']);
50
50
  const props = defineProps({
51
51
  filterGroups: {
52
52
  type: Array,
@@ -71,6 +71,6 @@ function updateFilter(field, value) {
71
71
  if (field.filterBy) {
72
72
  fieldFilter = field.filterBy(value);
73
73
  }
74
- emit("update:filter", { ...props.filter, ...fieldFilter });
74
+ emit('update:filter', { ...props.filter, ...fieldFilter });
75
75
  }
76
76
  </script>
@@ -1,31 +1,31 @@
1
1
  <template>
2
2
  <div class="flex items-center" :class="{'w-72': showFilters}">
3
3
  <div class="flex-grow">
4
- <QBtn
5
- class="btn-blue-highlight"
6
- :class="{'highlighted': showFilters}"
7
- @click="$emit('update:show-filters', !showFilters)"
4
+ <q-btn
5
+ class="btn-blue-highlight"
6
+ :class="{'highlighted': showFilters}"
7
+ @click="$emit('update:show-filters', !showFilters)"
8
8
  >
9
9
  <FilterIcon class="w-5 mr-2" />
10
- <QBadge
11
- :label="'' + activeCount"
12
- rounded
13
- :color="activeCount > 0 ? 'blue-base' : 'gray-base'"
10
+ <q-badge
11
+ :label="'' + activeCount"
12
+ rounded
13
+ :color="activeCount > 0 ? 'blue-base' : 'gray-base'"
14
14
  />
15
- </QBtn>
15
+ </q-btn>
16
16
  </div>
17
17
  <a
18
- v-if="activeCount > 0"
19
- class="text-blue-base hover:text-blue-plus-1 text-sm ml-4"
20
- @click="$emit('update:filter', {})"
18
+ v-if="activeCount > 0"
19
+ class="text-blue-base hover:text-blue-plus-1 text-sm ml-4"
20
+ @click="$emit('update:filter', {})"
21
21
  >Clear All</a>
22
22
  </div>
23
23
  </template>
24
24
  <script setup>
25
- import { FilterIcon } from "@/svg";
26
- import { computed } from "vue";
25
+ import { FilterIcon } from '@ui/svg';
26
+ import { computed } from 'vue';
27
27
 
28
- defineEmits(["update:show-filters", "update:filter"]);
28
+ defineEmits(['update:show-filters', 'update:filter']);
29
29
  const props = defineProps({
30
30
  filter: {
31
31
  type: Object,