@autoafleveren/ui 1.4.0 → 1.4.3

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@autoafleveren/ui",
3
- "version": "1.4.0",
3
+ "version": "1.4.3",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist/*",
@@ -73,7 +73,9 @@
73
73
 
74
74
  await nextTick();
75
75
 
76
- setTimeout(activate, 300);
76
+ if (props.action.focusTrap !== false) {
77
+ setTimeout(activate, 300);
78
+ }
77
79
  }
78
80
 
79
81
  return;
@@ -18,6 +18,7 @@ export interface Action {
18
18
  resetSelection?: boolean;
19
19
  component?: Component | ActionComponent;
20
20
  componentProperties?: Record<string, unknown>;
21
+ focusTrap?: boolean;
21
22
  }
22
23
 
23
24
  export interface ActionItemProps {
@@ -1,7 +1,7 @@
1
1
  import type { Size, Type } from './index.d';
2
2
 
3
- export const types = ['plain', 'default', 'success', 'warning', 'error', 'info', 'inactive'] as const;
4
- export const sizes = ['medium', 'large'] as const;
3
+ export const types = ['plain', 'default', 'success', 'warning', 'error', 'info', 'inactive', 'counter'] as const;
4
+ export const sizes = ['small', 'medium', 'large'] as const;
5
5
 
6
6
  export const domClassesPerType: Record<Type, string[]> = {
7
7
  plain: [],
@@ -11,9 +11,11 @@ export const domClassesPerType: Record<Type, string[]> = {
11
11
  error: ['bg-red-200', 'text-red-600'],
12
12
  info: ['bg-sky-200', 'text-sky-600'],
13
13
  inactive: ['bg-orange-200', 'text-orange-500'],
14
+ counter: ['bg-red-600', 'text-white'],
14
15
  };
15
16
 
16
17
  export const domClassesPerSize: Record<Size, string[]> = {
18
+ small: ['px-2 py-1 text-xs'],
17
19
  medium: ['px-3 py-[3px] text-sm min-h-7'],
18
20
  large: ['px-3 py-2.5 text-sm'],
19
21
  };
@@ -26,4 +28,5 @@ export const domClassesPerTypeRounded: Record<Type, string[]> = {
26
28
  error: ['bg-error!'],
27
29
  info: ['bg-sky-600!'],
28
30
  inactive: ['bg-orange-600!'],
31
+ counter: ['bg-red-600!'],
29
32
  };
@@ -13,6 +13,7 @@
13
13
  loading: false,
14
14
  bordered: false,
15
15
  block: false,
16
+ round: false,
16
17
  });
17
18
  </script>
18
19
 
@@ -26,9 +27,10 @@
26
27
  ...(bordered ? domClassesPerColorBorderedType[colorType] : []),
27
28
  ...domClassesPerSize[size],
28
29
  ...(block ? ['w-full', 'justify-center'] : []),
30
+ ...(round ? ['rounded-full', 'justify-center'] : ['rounded-lg']),
29
31
  ]"
30
32
  class="app-button inline-flex cursor-pointer items-center whitespace-nowrap
31
- rounded-lg border text-base font-semibold transition-colors
33
+ border text-base font-semibold transition-colors
32
34
  focus:outline-hidden disabled:cursor-not-allowed disabled:select-none disabled:opacity-50"
33
35
  >
34
36
  <ButtonIconSlot
@@ -13,4 +13,5 @@ export interface Props {
13
13
  bordered?: boolean;
14
14
  block?: boolean;
15
15
  as?: string;
16
+ round?: boolean;
16
17
  }
@@ -6,7 +6,7 @@
6
6
  import { useActionBar, useContextMenu } from '~composables';
7
7
  import AppDataTableFooter from './AppDataTableFooter.vue';
8
8
 
9
- import type { ServerOptions } from 'vue3-easy-data-table';
9
+ import type { ServerOptions, UpdateSortArgument } from 'vue3-easy-data-table';
10
10
  import type { Props, DataTableInstance } from '.';
11
11
 
12
12
  const props = withDefaults(defineProps<Props<Item>>(), {
@@ -19,7 +19,7 @@
19
19
 
20
20
  const emit = defineEmits<{
21
21
  (event: 'update:modelValue', value: number[]): void;
22
- (event: 'update:sort', value: string | undefined): void;
22
+ (event: 'update:sort', value: UpdateSortArgument): void;
23
23
  (event: 'updatePage', value: number): void;
24
24
  (event: 'clickItem', value: Item): void;
25
25
  (event: 'contextMenuOpen', value: Item): void;
@@ -126,6 +126,10 @@
126
126
  sort.value = undefined;
127
127
  }
128
128
 
129
+ function onUpdateSort(value: UpdateSortArgument): void {
130
+ emit('update:sort', value);
131
+ }
132
+
129
133
  defineExpose({ dataTableInstance });
130
134
 
131
135
  defineOptions({ inheritAttrs: false });
@@ -158,6 +162,7 @@
158
162
  @click-row="clickRow"
159
163
  @contextmenu-row="contextMenu.open"
160
164
  @update:server-options="onUpdateServerOptions"
165
+ @update-sort="onUpdateSort"
161
166
  >
162
167
  <template #loading>
163
168
  <AppLoader size="medium" />
@@ -101,7 +101,7 @@
101
101
  <div class="absolute left-0 bottom-2 z-20 -ml-8 flex sm:-ml-5 sm:-translate-y-2.5 sm:pr-4">
102
102
  <button
103
103
  type="button"
104
- class="focus:outline-hidden cursor-pointer z-40 p-2 relative rounded-full bg-primary text-white drop-shadow-xs
104
+ class="focus:outline-hidden cursor-pointer z-40 py-2 px-2.5 relative rounded-full bg-primary text-white drop-shadow-xs
105
105
  hover:bg-primary-active"
106
106
  @click="close"
107
107
  >
@@ -1,5 +1,4 @@
1
1
  import * as Sentry from '@sentry/vue';
2
- import nlTranslation from './language/nl';
3
2
 
4
3
  import type { App } from 'vue';
5
4
  import type { Router } from 'vue-router';
@@ -22,23 +21,7 @@ export default function registerSentry(app: App, router: Router, options: Option
22
21
  },
23
22
 
24
23
  beforeSend(beforeEvent: ErrorEvent, hint: EventHint): ErrorEvent {
25
- const event = options?.beforeSend ? options.beforeSend(beforeEvent, hint) : beforeEvent;
26
-
27
- // Check if it is an exception, and if so, show the report dialog
28
- if (event.exception && options.reportDialog !== false) {
29
- Sentry.showReportDialog({
30
- eventId: event.event_id,
31
- ...nlTranslation,
32
- user: event?.user,
33
- onLoad: () => {
34
- document.querySelector('.sentry-error-embed-wrapper #id_name')?.setAttribute('placeholder', '');
35
- document.querySelector('.sentry-error-embed-wrapper #id_email')?.setAttribute('placeholder', '');
36
- document.querySelector('.sentry-error-embed-wrapper #id_comments')?.setAttribute('placeholder', '');
37
- },
38
- });
39
- }
40
-
41
- return event;
24
+ return options?.beforeSend ? options.beforeSend(beforeEvent, hint) : beforeEvent;
42
25
  },
43
26
 
44
27
  // Alternatively, use `process.env.npm_package_version` for a dynamic release version