@necrolab/dashboard 0.5.28 → 0.5.30

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 (39) hide show
  1. package/backend/api.js +7 -5
  2. package/backend/batching.js +59 -2
  3. package/backend/index.js +1 -1
  4. package/index.html +10 -23
  5. package/package.json +1 -1
  6. package/src/assets/css/base/scroll.scss +1 -1
  7. package/src/assets/css/main.scss +14 -14
  8. package/src/components/Console/ConsoleToolbar.vue +8 -8
  9. package/src/components/Editors/Account/Account.vue +9 -5
  10. package/src/components/Editors/Account/AccountView.vue +37 -18
  11. package/src/components/Editors/Account/CreateAccount.vue +38 -4
  12. package/src/components/Editors/Profile/CreateProfile.vue +29 -4
  13. package/src/components/Editors/Profile/Profile.vue +11 -6
  14. package/src/components/Editors/Profile/ProfileCountryChooser.vue +2 -2
  15. package/src/components/Editors/Profile/ProfileView.vue +37 -18
  16. package/src/components/Tasks/CreateTaskAXS.vue +16 -2
  17. package/src/components/Tasks/CreateTaskTM.vue +28 -5
  18. package/src/components/Tasks/QuickSettings.vue +77 -10
  19. package/src/components/Tasks/Task.vue +20 -7
  20. package/src/components/Tasks/TaskView.vue +144 -58
  21. package/src/components/Tasks/ViewTask.vue +17 -3
  22. package/src/components/ui/Modal.vue +1 -1
  23. package/src/components/ui/ReadonlyFieldsSection.vue +3 -3
  24. package/src/components/ui/StatusBadge.vue +1 -1
  25. package/src/components/ui/TaskToggle.vue +2 -3
  26. package/src/components/ui/controls/CountryChooser.vue +2 -2
  27. package/src/components/ui/controls/atomic/Dropdown.vue +2 -2
  28. package/src/components/ui/controls/atomic/MultiDropdown.vue +1 -1
  29. package/src/composables/useDynamicTableHeight.js +4 -4
  30. package/src/composables/useRowSelection.js +0 -1
  31. package/src/composables/useZoomPrevention.js +16 -55
  32. package/src/stores/connection.js +453 -68
  33. package/src/stores/sampleData.js +34 -24
  34. package/src/stores/ui.js +89 -100
  35. package/src/views/Accounts.vue +2 -5
  36. package/src/views/Console.vue +13 -14
  37. package/src/views/Profiles.vue +2 -5
  38. package/src/views/Tasks.vue +29 -1
  39. package/vite.config.js +4 -2
@@ -4,7 +4,7 @@
4
4
  :class="{ 'fade-in': !isClosing, 'fade-out': isClosing }"
5
5
  role="dialog"
6
6
  aria-modal="true"
7
- @touchmove.stop>
7
+ @touchmove.passive.stop>
8
8
  <div
9
9
  class="modal-content"
10
10
  :class="{ 'modal-slide-in': !isClosing, 'modal-slide-out': isClosing }"
@@ -9,9 +9,9 @@
9
9
  <div class="col-span-6">
10
10
  <label class="flex items-center mb-2 text-light-200 font-medium">Status</label>
11
11
  <div class="flex-gap-3 items-center h-10">
12
- <StatusBadge :enabled="data.enabled" size="large" />
13
- <span class="text-sm font-medium" :class="data.enabled ? 'text-green-400' : 'text-red-400'">
14
- {{ data.enabled ? 'Enabled' : 'Disabled' }}
12
+ <StatusBadge :enabled="Boolean(data.enabled)" size="large" />
13
+ <span class="text-sm font-medium" :class="Boolean(data.enabled) ? 'text-green-400' : 'text-red-400'">
14
+ {{ Boolean(data.enabled) ? 'Enabled' : 'Disabled' }}
15
15
  </span>
16
16
  </div>
17
17
  </div>
@@ -4,7 +4,7 @@ import { CheckmarkIcon, CloseXIcon } from "@/components/icons";
4
4
  defineProps({
5
5
  enabled: {
6
6
  type: Boolean,
7
- required: true
7
+ default: false
8
8
  },
9
9
  size: {
10
10
  type: String,
@@ -32,8 +32,7 @@ const props = defineProps({
32
32
  default: ""
33
33
  },
34
34
  modelValue: {
35
- type: Boolean,
36
- required: true
35
+ default: false
37
36
  },
38
37
  disabled: {
39
38
  type: Boolean,
@@ -48,7 +47,7 @@ const props = defineProps({
48
47
  const emit = defineEmits(["update:modelValue"]);
49
48
 
50
49
  const model = computed({
51
- get: () => props.modelValue,
50
+ get: () => Boolean(props.modelValue),
52
51
  set: (value) => emit("update:modelValue", value)
53
52
  });
54
53
  </script>
@@ -20,8 +20,8 @@
20
20
  class="bg-dark-400 border border-dark-650 rounded-lg shadow-2xl z-50 p-2 !max-h-52 !overflow-y-auto custom-scrollbar-y min-w-20 w-25"
21
21
  :style="menuStyle"
22
22
  @click.stop
23
- @wheel.stop
24
- @touchmove.stop
23
+ @wheel.passive.stop
24
+ @touchmove.passive.stop
25
25
  >
26
26
  <div class="country-header-item">TM</div>
27
27
  <div
@@ -25,7 +25,7 @@
25
25
  :style="menuStyle"
26
26
  role="listbox"
27
27
  @click.stop
28
- @wheel.stop>
28
+ @wheel.passive.stop>
29
29
  <button
30
30
  v-bind:key="f"
31
31
  class="dropdown-item"
@@ -133,7 +133,7 @@ const handleClickOutside = (event) => {
133
133
 
134
134
  onMounted(() => {
135
135
  document.addEventListener('mousedown', handleClickOutside);
136
- document.addEventListener('touchstart', handleClickOutside);
136
+ document.addEventListener('touchstart', handleClickOutside, { passive: true });
137
137
  });
138
138
 
139
139
  onUnmounted(() => {
@@ -18,7 +18,7 @@
18
18
  class="dropdown-menu-portal multi scrollable"
19
19
  :style="menuStyle"
20
20
  @click.stop
21
- @wheel.stop>
21
+ @wheel.passive.stop>
22
22
  <div class="option-list scrollable">
23
23
  <button
24
24
  v-for="(option, i) in props.options"
@@ -5,10 +5,10 @@ export function useDynamicTableHeight(options = {}) {
5
5
  const { windowHeight, windowWidth } = useWindowDimensions();
6
6
 
7
7
  const {
8
- topReservedSpace = 243,
9
- bottomBuffer = 16,
10
- rowHeight = 64,
11
- minRowsToShow = 2
8
+ topReservedSpace = options.TOP_RESERVED_SPACE ?? 243,
9
+ bottomBuffer = options.BOTTOM_BUFFER ?? 16,
10
+ rowHeight = options.ROW_HEIGHT ?? 64,
11
+ minRowsToShow = options.MIN_ROWS_TO_SHOW ?? 2
12
12
  } = options;
13
13
 
14
14
  const dynamicTableHeight = computed(() => {
@@ -24,7 +24,6 @@ export function useRowSelection(toggleCallback) {
24
24
 
25
25
  if (tapGap < DOUBLE_TAP_DELAY && tapGap > 0) {
26
26
  if (!event.target.closest('button') && !event.target.closest('.checkbox')) {
27
- event.preventDefault()
28
27
  toggleCallback()
29
28
  }
30
29
  }
@@ -9,40 +9,22 @@ export function useZoomPrevention() {
9
9
  MINUS: 189
10
10
  };
11
11
 
12
- // Prevent pinch-to-zoom gestures
13
- document.addEventListener('touchstart', (e) => {
14
- if (e.touches.length > 1) {
15
- e.preventDefault();
16
- }
17
- }, { passive: false });
18
-
19
- document.addEventListener('touchmove', (e) => {
20
- if (e.touches.length > 1) {
21
- e.preventDefault();
22
- }
23
- }, { passive: false });
24
-
25
- document.addEventListener('gesturestart', (e) => {
26
- e.preventDefault();
27
- }, { passive: false });
28
-
29
- document.addEventListener('gesturechange', (e) => {
30
- e.preventDefault();
31
- }, { passive: false });
32
-
33
- document.addEventListener('gestureend', (e) => {
34
- e.preventDefault();
35
- }, { passive: false });
36
-
37
- // Prevent double-tap zoom
38
- let lastTouchEnd = 0;
39
- document.addEventListener('touchend', (e) => {
40
- const now = Date.now();
41
- if (now - lastTouchEnd <= 300) {
42
- e.preventDefault();
43
- }
44
- lastTouchEnd = now;
45
- }, { passive: false });
12
+ const isIOSLikeDevice =
13
+ /iPad|iPhone|iPod/.test(navigator.userAgent) ||
14
+ (navigator.platform === "MacIntel" && navigator.maxTouchPoints > 1);
15
+ const hasTouch = typeof window !== "undefined" && "ontouchstart" in window;
16
+
17
+ if (isIOSLikeDevice || hasTouch) {
18
+ // Prevent double-tap zoom
19
+ let lastTouchEnd = 0;
20
+ document.addEventListener('touchend', (e) => {
21
+ const now = Date.now();
22
+ if (now - lastTouchEnd <= 300) {
23
+ e.preventDefault();
24
+ }
25
+ lastTouchEnd = now;
26
+ }, { passive: false });
27
+ }
46
28
 
47
29
  // Prevent ALL keyboard zoom combinations
48
30
  document.addEventListener("keydown", function (event) {
@@ -69,27 +51,6 @@ export function useZoomPrevention() {
69
51
  }
70
52
  }, { passive: false });
71
53
 
72
- // Prevent Ctrl/Cmd + Mouse wheel zoom (desktop)
73
- document.addEventListener("wheel", function (event) {
74
- if (event.ctrlKey || event.metaKey) {
75
- event.preventDefault();
76
- }
77
- }, { passive: false });
78
-
79
- // Also block mousewheel for older browsers
80
- document.addEventListener("mousewheel", function (event) {
81
- if (event.ctrlKey || event.metaKey) {
82
- event.preventDefault();
83
- }
84
- }, { passive: false });
85
-
86
- // Block DOMMouseScroll for Firefox
87
- document.addEventListener("DOMMouseScroll", function (event) {
88
- if (event.ctrlKey || event.metaKey) {
89
- event.preventDefault();
90
- }
91
- }, { passive: false });
92
-
93
54
  return {
94
55
  KEY_CODES
95
56
  };