bfg-common 1.3.353 → 1.3.355

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.
@@ -11,7 +11,7 @@
11
11
  @click.capture="onClickDiagram"
12
12
  >
13
13
  <common-diagram-main-switch
14
- :networks-count="networksCount"
14
+ :networks-count="props.networksCount"
15
15
  :main-rect-height="props.mainRectHeight"
16
16
  :main-switch-line="props.mainSwitchLine"
17
17
  :selected-main-line="props.selectedMainLine"
@@ -19,7 +19,7 @@
19
19
  :is-selected-linked-with-adapter="isSelectedLinkedWithAdapter"
20
20
  />
21
21
  <common-diagram-main-adapter
22
- :networks-count="networksCount"
22
+ :networks-count="props.networksCount"
23
23
  :adapters-with-positions="props.adaptersWithPositions"
24
24
  :selected-main-line="props.selectedMainLine"
25
25
  :selected-port="props.selectedPort"
@@ -92,6 +92,7 @@ const props = defineProps<{
92
92
  selectedNetwork: string
93
93
  selectedSwitchLineY: UI_I_SwitchLine
94
94
  isDarkMode: boolean
95
+ networksCount: number
95
96
  }>()
96
97
 
97
98
  const emits = defineEmits<{
@@ -182,15 +183,6 @@ const isSelectedLinkedWithAdapter = computed<boolean>(() => {
182
183
  return false
183
184
  })
184
185
 
185
- const networksCount = computed<number>(
186
- () =>
187
- props.networksWithPositions.filter(
188
- (networkWithPositions: UI_I_NetworksWithPositions) =>
189
- networkWithPositions.activeAdapters.length > 0 &&
190
- networkWithPositions.state.state !== 3
191
- ).length
192
- )
193
-
194
186
  const onClickDiagram = (ev: MouseEvent) => emits('click-diagram', ev)
195
187
  const onToggleAdapters = () => emits('toggle-adapters')
196
188
  const onSelectAdapter = (adapterId: string) =>
@@ -26,6 +26,7 @@
26
26
  :selected-network="selectedNetwork"
27
27
  :selected-switch-line-y="selectedSwitchLineY"
28
28
  :is-dark-mode="props.isDarkMode"
29
+ :networks-count="networksCount"
29
30
  @click-diagram="onClickDiagram"
30
31
  @toggle-adapters="onToggleAdapters"
31
32
  @select-adapter="onSelectAdapter"
@@ -619,6 +620,15 @@ const adaptersWithPositions = computed<UI_I_AdaptersWithPositions>(() => {
619
620
  return countAdaptersPositions()
620
621
  })
621
622
 
623
+ const networksCount = computed<number>(
624
+ () =>
625
+ networksWithPositions.value.filter(
626
+ (networkWithPositions: UI_I_NetworksWithPositions) =>
627
+ networkWithPositions.activeAdapters.length > 0 &&
628
+ networkWithPositions.state.state !== 3
629
+ ).length
630
+ )
631
+
622
632
  watch(
623
633
  () => props.diagramData?.networks,
624
634
  (newValue: UI_I_Network[] | null) => {
@@ -630,14 +640,24 @@ watch(
630
640
  onSelectAdapter(selectedAdapter.value.adapterId)
631
641
  return
632
642
  }
643
+
633
644
  if (selectedPort.value.portId !== '-1') {
634
645
  onSelectPort(selectedPort.value.networkId, selectedPort.value.portId)
635
646
  return
636
647
  }
648
+
637
649
  if (selectedNetwork.value !== '-1') {
638
650
  onSelectNetwork(selectedNetwork.value)
639
651
  return
640
652
  }
653
+
654
+ if (selectedMainLine.value && networksCount.value === 0) {
655
+ selectedMainLine.value = false
656
+ return
657
+ }
658
+
659
+ if (selectedMainLine.value) return
660
+
641
661
  resetSelection()
642
662
  },
643
663
  { deep: true }
@@ -6,14 +6,12 @@
6
6
  shape-rendering="geometricprecision"
7
7
  x="16.5"
8
8
  y="17.5"
9
- fill="#fff"
10
- stroke="#888"
9
+ class="panel"
11
10
  ></rect>
12
11
  <path
13
12
  d="M 313.5 17.5 H 333.5 V 55.5 H 313.5 "
14
13
  shape-rendering="geometricprecision"
15
- fill="#fff"
16
- stroke="#888"
14
+ class="panel"
17
15
  ></path>
18
16
  <text
19
17
  dy="14px"
@@ -40,6 +38,11 @@ const localization = computed<UI_I_Localization>(() => useLocal())
40
38
  .diagram__heading {
41
39
  fill: #c1cdd4;
42
40
  }
41
+
42
+ .panel {
43
+ fill: #1b2a32;
44
+ stroke: #adbbc4;
45
+ }
43
46
  }
44
47
 
45
48
  .diagram {
@@ -50,4 +53,9 @@ const localization = computed<UI_I_Localization>(() => useLocal())
50
53
  line-height: 1.2rem;
51
54
  }
52
55
  }
56
+
57
+ .panel {
58
+ fill: #fff;
59
+ stroke: #888;
60
+ }
53
61
  </style>
@@ -1,4 +1,4 @@
1
- interface UI_I_TreeNodeDuplicate extends UI_I_TreeNode {}
1
+ export interface UI_I_TreeNodeDuplicate extends UI_I_TreeNode {}
2
2
 
3
3
  export interface UI_I_TreeNodeShort<T = string> {
4
4
  id: string | number
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "bfg-common",
3
3
  "private": false,
4
- "version": "1.3.353",
4
+ "version": "1.3.355",
5
5
  "scripts": {
6
6
  "build": "nuxt build",
7
7
  "dev": "nuxt dev --port=3002",