@oicl/openbridge-webcomponents-svelte 2.0.0-next.150 → 2.0.0-next.152
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/dist/NamedSlot.svelte +26 -0
- package/dist/NamedSlot.svelte.d.ts +11 -0
- package/dist/ar/building-blocks/poi-header/ObcPoiHeader.svelte +2 -3
- package/dist/ar/chart-object-vessel-button/ObcChartObjectVesselButton.svelte +5 -12
- package/dist/ar/poi/ObcPoi.svelte +3 -6
- package/dist/ar/poi/ObcPoiAton.svelte +2 -3
- package/dist/ar/poi/ObcPoiData.svelte +2 -3
- package/dist/ar/poi/ObcPoiVessel.svelte +4 -9
- package/dist/ar/poi-button/ObcPoiButton.svelte +3 -6
- package/dist/ar/poi-button/ObcPoiButtonAton.svelte +3 -6
- package/dist/ar/poi-button/ObcPoiButtonData.svelte +3 -6
- package/dist/ar/poi-button/ObcPoiButtonVessel.svelte +5 -12
- package/dist/ar/poi-card/ObcPoiCard.svelte +3 -6
- package/dist/ar/poi-card-header/ObcPoiCardHeader.svelte +3 -6
- package/dist/ar/poi-controller/ObcPoiController.svelte +3 -6
- package/dist/ar/poi-object/ObcPoiObjectVessel.svelte +3 -6
- package/dist/automation/automation-badge/ObcAutomationBadge.svelte +2 -3
- package/dist/automation/automation-button/ObcAutomationButton.svelte +10 -27
- package/dist/automation/automation-input-modal/ObcAutomationInputModal.svelte +5 -12
- package/dist/automation/automation-tank/ObcAutomationTank.svelte +11 -30
- package/dist/automation/gauge-generator/ObcGaugeGenerator.svelte +3 -6
- package/dist/automation/gauge-motors-and-pumps/ObcGaugeMotorsAndPumps.svelte +3 -6
- package/dist/automation/gauge-valve/ObcGaugeValve.svelte +2 -3
- package/dist/automation/heat-exchanger/ObcHeatExchanger.svelte +6 -15
- package/dist/automation/heat-pump/ObcHeatPump.svelte +6 -15
- package/dist/automation/hydraulic-separator/ObcHydraulicSeparator.svelte +6 -15
- package/dist/automation/indicator-battery/ObcIndicatorBattery.svelte +2 -3
- package/dist/automation/indicator-generator/ObcIndicatorGenerator.svelte +2 -3
- package/dist/automation/indicator-tank-atmospheric/ObcIndicatorTankAtmospheric.svelte +2 -3
- package/dist/automation/transmitter/ObcTransmitter.svelte +2 -3
- package/dist/automation/transmitter-button/ObcTransmitterButton.svelte +2 -3
- package/dist/bars-graphs/area-graph/ObcAreaGraph.svelte +14 -2
- package/dist/bars-graphs/area-graph/ObcAreaGraph.svelte.d.ts +15 -1
- package/dist/bars-graphs/line-graph/ObcLineGraph.svelte +14 -2
- package/dist/bars-graphs/line-graph/ObcLineGraph.svelte.d.ts +15 -1
- package/dist/building-blocks/alert-list/ObcAlertList.svelte +4 -9
- package/dist/building-blocks/bar-horizontal/ObcBarHorizontal.svelte +6 -0
- package/dist/building-blocks/bar-horizontal/ObcBarHorizontal.svelte.d.ts +6 -0
- package/dist/building-blocks/bar-vertical/ObcBarVertical.svelte +6 -0
- package/dist/building-blocks/bar-vertical/ObcBarVertical.svelte.d.ts +6 -0
- package/dist/building-blocks/chart-line/ObcChartLineBase.svelte +14 -2
- package/dist/building-blocks/chart-line/ObcChartLineBase.svelte.d.ts +15 -1
- package/dist/building-blocks/readout-block/ObcReadoutBlock.svelte +2 -3
- package/dist/components/accordion-card/ObcAccordionCard.svelte +6 -15
- package/dist/components/accordion-item/ObcAccordionItem.svelte +2 -3
- package/dist/components/advice-button/ObcAdviceButton.svelte +2 -3
- package/dist/components/advice-floating-item/ObcAdviceFloatingItem.svelte +8 -21
- package/dist/components/advice-menu-item/ObcAdviceMenuItem.svelte +2 -3
- package/dist/components/advice-message-item/ObcAdviceMessageItem.svelte +2 -3
- package/dist/components/alert-button/ObcAlertButton.svelte +4 -2
- package/dist/components/alert-button/ObcAlertButton.svelte.d.ts +4 -1
- package/dist/components/alert-floating-item/ObcAlertFloatingItem.svelte +8 -21
- package/dist/components/alert-frame/ObcAlertFrame.svelte +12 -13
- package/dist/components/alert-frame/ObcAlertFrame.svelte.d.ts +8 -2
- package/dist/components/alert-icon/ObcAlertIcon.svelte +5 -3
- package/dist/components/alert-icon/ObcAlertIcon.svelte.d.ts +4 -1
- package/dist/components/alert-menu/ObcAlertMenu.svelte +4 -9
- package/dist/components/alert-menu-item/ObcAlertMenuItem.svelte +5 -12
- package/dist/components/alert-subsystem-counter/ObcAlertSubsystemCounter.svelte +3 -6
- package/dist/components/app-button/ObcAppButton.svelte +2 -3
- package/dist/components/attachment-list-item/ObcAttachmentListItem.svelte +4 -9
- package/dist/components/badge/ObcBadge.svelte +2 -3
- package/dist/components/button/ObcButton.svelte +3 -6
- package/dist/components/card/ObcCard.svelte +4 -9
- package/dist/components/check-button/ObcCheckButton.svelte +4 -9
- package/dist/components/command-menu/ObcCommandMenu.svelte +10 -27
- package/dist/components/dropdown-button/ObcDropdownButton.svelte +2 -3
- package/dist/components/elevated-card/ObcElevatedCard.svelte +8 -21
- package/dist/components/floating-item/ObcFloatingItem.svelte +9 -24
- package/dist/components/form-container/ObcFormContainer.svelte +4 -9
- package/dist/components/form-group/ObcFormGroup.svelte +3 -6
- package/dist/components/form-item/ObcFormItem.svelte +2 -3
- package/dist/components/icon-button/ObcIconButton.svelte +2 -3
- package/dist/components/icon-check-button/ObcIconCheckButton.svelte +2 -3
- package/dist/components/keyboard-numeric/ObcKeyboardNumeric.svelte +2 -3
- package/dist/components/menu-button/ObcMenuButton.svelte +2 -3
- package/dist/components/message-menu-item/ObcMessageMenuItem.svelte +7 -18
- package/dist/components/modal-window/ObcModalWindow.svelte +7 -18
- package/dist/components/navigation-item/ObcNavigationItem.svelte +3 -6
- package/dist/components/navigation-item-group/ObcNavigationItemGroup.svelte +2 -3
- package/dist/components/navigation-menu/ObcNavigationMenu.svelte +4 -9
- package/dist/components/notification-button/ObcNotificationButton.svelte +2 -3
- package/dist/components/notification-floating-item/ObcNotificationFloatingItem.svelte +8 -21
- package/dist/components/notification-menu-item/ObcNotificationMenuItem.svelte +2 -3
- package/dist/components/notification-message-item/ObcNotificationMessageItem.svelte +2 -3
- package/dist/components/number-input-field/ObcNumberInputField.svelte +4 -9
- package/dist/components/pivot-item/ObcPivotItem.svelte +2 -3
- package/dist/components/progress-bar/ObcProgressBar.svelte +2 -3
- package/dist/components/progress-button/ObcProgressButton.svelte +4 -9
- package/dist/components/rich-button/ObcRichButton.svelte +3 -6
- package/dist/components/sequence-card/ObcSequenceCard.svelte +8 -21
- package/dist/components/sequence-item/ObcSequenceItem.svelte +5 -12
- package/dist/components/sequence-modal/ObcSequenceModal.svelte +2 -3
- package/dist/components/sequence-toolbar/ObcSequenceToolbar.svelte +5 -12
- package/dist/components/slide-button/ObcSlideButton.svelte +3 -6
- package/dist/components/slider/ObcSlider.svelte +3 -6
- package/dist/components/slider-double/ObcSliderDouble.svelte +3 -6
- package/dist/components/split-button/ObcSplitButton.svelte +2 -3
- package/dist/components/start-stop-switch/ObcStartStopSwitch.svelte +7 -18
- package/dist/components/system-menu/ObcSystemMenu.svelte +2 -3
- package/dist/components/tab-item/ObcTabItem.svelte +4 -9
- package/dist/components/tab-row/ObcTabRow.svelte +3 -6
- package/dist/components/tabbed-card/ObcTabbedCard.svelte +16 -45
- package/dist/components/table-header-item/ObcTableHeaderItem.svelte +2 -3
- package/dist/components/text-input-field/ObcTextInputField.svelte +4 -9
- package/dist/components/textarea-field/ObcTextareaField.svelte +2 -3
- package/dist/components/textbox/ObcTextbox.svelte +2 -3
- package/dist/components/title-container/ObcTitleContainer.svelte +5 -12
- package/dist/components/toggle-button-option/ObcToggleButtonOption.svelte +2 -3
- package/dist/components/toggle-button-vertical-option/ObcToggleButtonVerticalOption.svelte +2 -3
- package/dist/components/toggle-switch/ObcToggleSwitch.svelte +2 -3
- package/dist/components/toggletip/ObcToggletip.svelte +4 -9
- package/dist/components/tooltip/ObcTooltip.svelte +2 -3
- package/dist/components/top-bar/ObcTopBar.svelte +5 -12
- package/dist/components/topbar-message-item/ObcTopbarMessageItem.svelte +10 -27
- package/dist/components/tree-navigation-group/ObcTreeNavigationGroup.svelte +2 -3
- package/dist/components/tree-navigation-item/ObcTreeNavigationItem.svelte +2 -3
- package/dist/components/user-button/ObcUserButton.svelte +2 -3
- package/dist/components/user-menu/ObcUserMenu.svelte +2 -3
- package/dist/icons/ObiBipolarTransistor01.svelte +32 -0
- package/dist/icons/ObiBipolarTransistor01.svelte.d.ts +16 -0
- package/dist/icons/ObiBipolarTransistor02.svelte +32 -0
- package/dist/icons/ObiBipolarTransistor02.svelte.d.ts +16 -0
- package/dist/icons/ObiBipolarTransistor02Off.svelte +32 -0
- package/dist/icons/ObiBipolarTransistor02Off.svelte.d.ts +16 -0
- package/dist/icons/ObiBipolarTransistor02On.svelte +32 -0
- package/dist/icons/ObiBipolarTransistor02On.svelte.d.ts +16 -0
- package/dist/icons/ObiBipolarTransistor03.svelte +32 -0
- package/dist/icons/ObiBipolarTransistor03.svelte.d.ts +16 -0
- package/dist/icons/ObiBipolarTransistor03Flat.svelte +32 -0
- package/dist/icons/ObiBipolarTransistor03Flat.svelte.d.ts +16 -0
- package/dist/icons/ObiBipolarTransistor03Off.svelte +32 -0
- package/dist/icons/ObiBipolarTransistor03Off.svelte.d.ts +16 -0
- package/dist/icons/ObiBipolarTransistor03On.svelte +32 -0
- package/dist/icons/ObiBipolarTransistor03On.svelte.d.ts +16 -0
- package/dist/icons/ObiBipolarTransistor04.svelte +32 -0
- package/dist/icons/ObiBipolarTransistor04.svelte.d.ts +16 -0
- package/dist/icons/ObiBipolarTransistor04Flat.svelte +32 -0
- package/dist/icons/ObiBipolarTransistor04Flat.svelte.d.ts +16 -0
- package/dist/icons/ObiBipolarTransistor04Off.svelte +32 -0
- package/dist/icons/ObiBipolarTransistor04Off.svelte.d.ts +16 -0
- package/dist/icons/ObiBipolarTransistor04On.svelte +32 -0
- package/dist/icons/ObiBipolarTransistor04On.svelte.d.ts +16 -0
- package/dist/icons/ObiBipolarTransistorOff.svelte +32 -0
- package/dist/icons/ObiBipolarTransistorOff.svelte.d.ts +16 -0
- package/dist/icons/ObiBipolarTransistorOn.svelte +32 -0
- package/dist/icons/ObiBipolarTransistorOn.svelte.d.ts +16 -0
- package/dist/icons/ObiBypass.svelte +32 -0
- package/dist/icons/ObiBypass.svelte.d.ts +16 -0
- package/dist/icons/{ObiChevronTrippleLeft.svelte → ObiChevronTripleLeft.svelte} +3 -3
- package/dist/icons/{ObiChevronTrippleRight.svelte.d.ts → ObiChevronTripleLeft.svelte.d.ts} +4 -4
- package/dist/icons/{ObiChevronTrippleRight.svelte → ObiChevronTripleRight.svelte} +3 -3
- package/dist/icons/{ObiChevronTrippleLeft.svelte.d.ts → ObiChevronTripleRight.svelte.d.ts} +4 -4
- package/dist/icons/ObiHeatPumpBalance.svelte +32 -0
- package/dist/icons/ObiHeatPumpBalance.svelte.d.ts +16 -0
- package/dist/icons/ObiOutput.svelte +32 -0
- package/dist/icons/ObiOutput.svelte.d.ts +16 -0
- package/dist/icons/ObiPhase.svelte +32 -0
- package/dist/icons/ObiPhase.svelte.d.ts +16 -0
- package/dist/icons/ObiSensorWaterDewpoint.svelte +32 -0
- package/dist/icons/ObiSensorWaterDewpoint.svelte.d.ts +16 -0
- package/dist/icons/ObiSensorWaterHumidity.svelte +32 -0
- package/dist/icons/ObiSensorWaterHumidity.svelte.d.ts +16 -0
- package/dist/index.d.ts +22 -2
- package/dist/index.js +22 -2
- package/dist/integration-systems/integration-app-bar/ObcIntegrationAppBar.svelte +2 -3
- package/dist/integration-systems/integration-bar/ObcIntegrationBar.svelte +4 -9
- package/dist/integration-systems/integration-bar-dropdown/ObcIntegrationBarDropdown.svelte +9 -24
- package/dist/integration-systems/integration-button/ObcIntegrationButton.svelte +9 -24
- package/dist/integration-systems/integration-dropdown-button/ObcIntegrationDropdownButton.svelte +2 -3
- package/dist/integration-systems/integration-fleet-button/ObcIntegrationFleetButton.svelte +2 -3
- package/dist/integration-systems/integration-vessel-menu/ObcIntegrationVesselMenu.svelte +4 -9
- package/dist/integration-systems/integration-vessel-selector/ObcIntegrationVesselSelector.svelte +3 -6
- package/dist/navigation-instruments/gauge-proportional/ObcGaugeProportional.svelte +3 -6
- package/dist/navigation-instruments/gauge-radial-indicator/ObcGaugeRadialIndicator.svelte +2 -3
- package/dist/navigation-instruments/gauge-trend/ObcGaugeTrend.svelte +14 -2
- package/dist/navigation-instruments/gauge-trend/ObcGaugeTrend.svelte.d.ts +15 -1
- package/dist/navigation-instruments/instrument-field/ObcInstrumentField.svelte +2 -3
- package/dist/navigation-instruments/readout/ObcReadout.svelte +6 -15
- package/dist/navigation-instruments/readout-list-item/ObcReadoutListItem.svelte +5 -12
- package/dist/util.d.ts +20 -0
- package/dist/util.js +42 -0
- package/package.json +2 -2
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
import '@oicl/openbridge-webcomponents/dist/integration-systems/integration-bar-dropdown/integration-bar-dropdown.js';
|
|
5
5
|
import { setProperties, forwardEvents } from "../../util.js";
|
|
6
|
+
import NamedSlot from "../../NamedSlot.svelte";
|
|
6
7
|
|
|
7
8
|
import type { Snippet } from 'svelte';
|
|
8
9
|
|
|
@@ -120,50 +121,34 @@
|
|
|
120
121
|
use:forwardEvents={{'home-button-clicked': onHomeButtonClicked, 'link-button-clicked': onLinkButtonClicked, 'alert-button-clicked': onAlertButtonClicked, 'dimming-button-clicked': onDimmingButtonClicked, 'notification-button-clicked': onNotificationButtonClicked, 'screen-button-clicked': onScreenButtonClicked, 'user-button-clicked': onUserButtonClicked, 'system-button-clicked': onSystemButtonClicked}} >
|
|
121
122
|
|
|
122
123
|
{#if vesselSelector}
|
|
123
|
-
<
|
|
124
|
-
{@render vesselSelector()}
|
|
125
|
-
</div>
|
|
124
|
+
<NamedSlot name="vessel-selector" content={vesselSelector} />
|
|
126
125
|
{/if}
|
|
127
126
|
|
|
128
127
|
{#if statusLabel1}
|
|
129
|
-
<
|
|
130
|
-
{@render statusLabel1()}
|
|
131
|
-
</div>
|
|
128
|
+
<NamedSlot name="status-label-1" content={statusLabel1} />
|
|
132
129
|
{/if}
|
|
133
130
|
|
|
134
131
|
{#if statusIcon1}
|
|
135
|
-
<
|
|
136
|
-
{@render statusIcon1()}
|
|
137
|
-
</div>
|
|
132
|
+
<NamedSlot name="status-icon-1" content={statusIcon1} />
|
|
138
133
|
{/if}
|
|
139
134
|
|
|
140
135
|
{#if statusLabel2}
|
|
141
|
-
<
|
|
142
|
-
{@render statusLabel2()}
|
|
143
|
-
</div>
|
|
136
|
+
<NamedSlot name="status-label-2" content={statusLabel2} />
|
|
144
137
|
{/if}
|
|
145
138
|
|
|
146
139
|
{#if statusIcon2}
|
|
147
|
-
<
|
|
148
|
-
{@render statusIcon2()}
|
|
149
|
-
</div>
|
|
140
|
+
<NamedSlot name="status-icon-2" content={statusIcon2} />
|
|
150
141
|
{/if}
|
|
151
142
|
|
|
152
143
|
{#if statusLabel3}
|
|
153
|
-
<
|
|
154
|
-
{@render statusLabel3()}
|
|
155
|
-
</div>
|
|
144
|
+
<NamedSlot name="status-label-3" content={statusLabel3} />
|
|
156
145
|
{/if}
|
|
157
146
|
|
|
158
147
|
{#if statusIcon3}
|
|
159
|
-
<
|
|
160
|
-
{@render statusIcon3()}
|
|
161
|
-
</div>
|
|
148
|
+
<NamedSlot name="status-icon-3" content={statusIcon3} />
|
|
162
149
|
{/if}
|
|
163
150
|
|
|
164
151
|
{#if clock}
|
|
165
|
-
<
|
|
166
|
-
{@render clock()}
|
|
167
|
-
</div>
|
|
152
|
+
<NamedSlot name="clock" content={clock} />
|
|
168
153
|
{/if}
|
|
169
154
|
</obc-integration-bar-dropdown>
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
export type {IntegrationButtonReadout, IntegrationButtonVariant, IntegrationButtonType} from '@oicl/openbridge-webcomponents/dist/integration-systems/integration-button/integration-button.js';
|
|
4
4
|
import '@oicl/openbridge-webcomponents/dist/integration-systems/integration-button/integration-button.js';
|
|
5
5
|
import { setProperties, forwardEvents } from "../../util.js";
|
|
6
|
+
import NamedSlot from "../../NamedSlot.svelte";
|
|
6
7
|
import type {IntegrationButtonReadout, IntegrationButtonVariant, IntegrationButtonType} from '@oicl/openbridge-webcomponents/dist/integration-systems/integration-button/integration-button.js';
|
|
7
8
|
import type { Snippet } from 'svelte';
|
|
8
9
|
|
|
@@ -61,50 +62,34 @@
|
|
|
61
62
|
use:forwardEvents={{'click': onClick}} >
|
|
62
63
|
|
|
63
64
|
{#if leadingIcon}
|
|
64
|
-
<
|
|
65
|
-
{@render leadingIcon()}
|
|
66
|
-
</div>
|
|
65
|
+
<NamedSlot name="leading-icon" content={leadingIcon} />
|
|
67
66
|
{/if}
|
|
68
67
|
|
|
69
68
|
{#if trailingIcon}
|
|
70
|
-
<
|
|
71
|
-
{@render trailingIcon()}
|
|
72
|
-
</div>
|
|
69
|
+
<NamedSlot name="trailing-icon" content={trailingIcon} />
|
|
73
70
|
{/if}
|
|
74
71
|
|
|
75
72
|
{#if trailingIcon2}
|
|
76
|
-
<
|
|
77
|
-
{@render trailingIcon2()}
|
|
78
|
-
</div>
|
|
73
|
+
<NamedSlot name="trailing-icon2" content={trailingIcon2} />
|
|
79
74
|
{/if}
|
|
80
75
|
|
|
81
76
|
{#if label}
|
|
82
|
-
<
|
|
83
|
-
{@render label()}
|
|
84
|
-
</div>
|
|
77
|
+
<NamedSlot name="label" content={label} />
|
|
85
78
|
{/if}
|
|
86
79
|
|
|
87
80
|
{#if status}
|
|
88
|
-
<
|
|
89
|
-
{@render status()}
|
|
90
|
-
</div>
|
|
81
|
+
<NamedSlot name="status" content={status} />
|
|
91
82
|
{/if}
|
|
92
83
|
|
|
93
84
|
{#if infoLabel}
|
|
94
|
-
<
|
|
95
|
-
{@render infoLabel()}
|
|
96
|
-
</div>
|
|
85
|
+
<NamedSlot name="info-label" content={infoLabel} />
|
|
97
86
|
{/if}
|
|
98
87
|
|
|
99
88
|
{#if infoStatus}
|
|
100
|
-
<
|
|
101
|
-
{@render infoStatus()}
|
|
102
|
-
</div>
|
|
89
|
+
<NamedSlot name="info-status" content={infoStatus} />
|
|
103
90
|
{/if}
|
|
104
91
|
|
|
105
92
|
{#if integrationVesselMenu}
|
|
106
|
-
<
|
|
107
|
-
{@render integrationVesselMenu()}
|
|
108
|
-
</div>
|
|
93
|
+
<NamedSlot name="integration-vessel-menu" content={integrationVesselMenu} />
|
|
109
94
|
{/if}
|
|
110
95
|
</obc-integration-button>
|
package/dist/integration-systems/integration-dropdown-button/ObcIntegrationDropdownButton.svelte
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
export type {ObcIntegrationDropdownButtonChangeEvent, IntegrationDropdownOption} from '@oicl/openbridge-webcomponents/dist/integration-systems/integration-dropdown-button/integration-dropdown-button.js';
|
|
4
4
|
import '@oicl/openbridge-webcomponents/dist/integration-systems/integration-dropdown-button/integration-dropdown-button.js';
|
|
5
5
|
import { setProperties, forwardEvents } from "../../util.js";
|
|
6
|
+
import NamedSlot from "../../NamedSlot.svelte";
|
|
6
7
|
import type {ObcIntegrationDropdownButtonChangeEvent, IntegrationDropdownOption} from '@oicl/openbridge-webcomponents/dist/integration-systems/integration-dropdown-button/integration-dropdown-button.js';
|
|
7
8
|
import type { Snippet } from 'svelte';
|
|
8
9
|
|
|
@@ -44,8 +45,6 @@ options?: IntegrationDropdownOption[];
|
|
|
44
45
|
use:forwardEvents={{'change': onChange}} >
|
|
45
46
|
|
|
46
47
|
{#if fleet}
|
|
47
|
-
<
|
|
48
|
-
{@render fleet()}
|
|
49
|
-
</div>
|
|
48
|
+
<NamedSlot name="fleet" content={fleet} />
|
|
50
49
|
{/if}
|
|
51
50
|
</obc-integration-dropdown-button>
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
export type {IntegrationFleetButtonReadout} from '@oicl/openbridge-webcomponents/dist/integration-systems/integration-fleet-button/integration-fleet-button.js';
|
|
4
4
|
import '@oicl/openbridge-webcomponents/dist/integration-systems/integration-fleet-button/integration-fleet-button.js';
|
|
5
5
|
import { setProperties, forwardEvents } from "../../util.js";
|
|
6
|
+
import NamedSlot from "../../NamedSlot.svelte";
|
|
6
7
|
import type {IntegrationFleetButtonReadout} from '@oicl/openbridge-webcomponents/dist/integration-systems/integration-fleet-button/integration-fleet-button.js';
|
|
7
8
|
import type { Snippet } from 'svelte';
|
|
8
9
|
|
|
@@ -33,8 +34,6 @@
|
|
|
33
34
|
use:forwardEvents={{'click': onClick}} >
|
|
34
35
|
|
|
35
36
|
{#if alertTopicIcon}
|
|
36
|
-
<
|
|
37
|
-
{@render alertTopicIcon()}
|
|
38
|
-
</div>
|
|
37
|
+
<NamedSlot name="alert-topic-icon" content={alertTopicIcon} />
|
|
39
38
|
{/if}
|
|
40
39
|
</obc-integration-fleet-button>
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
import '@oicl/openbridge-webcomponents/dist/integration-systems/integration-vessel-menu/integration-vessel-menu.js';
|
|
5
5
|
import { setProperties } from "../../util.js";
|
|
6
|
+
import NamedSlot from "../../NamedSlot.svelte";
|
|
6
7
|
|
|
7
8
|
import type { Snippet } from 'svelte';
|
|
8
9
|
|
|
@@ -31,20 +32,14 @@
|
|
|
31
32
|
>
|
|
32
33
|
|
|
33
34
|
{#if buttons}
|
|
34
|
-
<
|
|
35
|
-
{@render buttons()}
|
|
36
|
-
</div>
|
|
35
|
+
<NamedSlot name="buttons" content={buttons} />
|
|
37
36
|
{/if}
|
|
38
37
|
|
|
39
38
|
{#if content}
|
|
40
|
-
<
|
|
41
|
-
{@render content()}
|
|
42
|
-
</div>
|
|
39
|
+
<NamedSlot name="content" content={content} />
|
|
43
40
|
{/if}
|
|
44
41
|
|
|
45
42
|
{#if alarms}
|
|
46
|
-
<
|
|
47
|
-
{@render alarms()}
|
|
48
|
-
</div>
|
|
43
|
+
<NamedSlot name="alarms" content={alarms} />
|
|
49
44
|
{/if}
|
|
50
45
|
</obc-integration-vessel-menu>
|
package/dist/integration-systems/integration-vessel-selector/ObcIntegrationVesselSelector.svelte
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
import '@oicl/openbridge-webcomponents/dist/integration-systems/integration-vessel-selector/integration-vessel-selector.js';
|
|
5
5
|
import { setProperties } from "../../util.js";
|
|
6
|
+
import NamedSlot from "../../NamedSlot.svelte";
|
|
6
7
|
|
|
7
8
|
import type { Snippet } from 'svelte';
|
|
8
9
|
|
|
@@ -34,14 +35,10 @@
|
|
|
34
35
|
{/if}
|
|
35
36
|
|
|
36
37
|
{#if fleet}
|
|
37
|
-
<
|
|
38
|
-
{@render fleet()}
|
|
39
|
-
</div>
|
|
38
|
+
<NamedSlot name="fleet" content={fleet} />
|
|
40
39
|
{/if}
|
|
41
40
|
|
|
42
41
|
{#if topbar}
|
|
43
|
-
<
|
|
44
|
-
{@render topbar()}
|
|
45
|
-
</div>
|
|
42
|
+
<NamedSlot name="topbar" content={topbar} />
|
|
46
43
|
{/if}
|
|
47
44
|
</obc-integration-vessel-selector>
|
|
@@ -5,6 +5,7 @@ export type {GaugeProportionalSector, GaugeProportionalAlignment, GaugeProportio
|
|
|
5
5
|
export type {TickmarkStyle} from '@oicl/openbridge-webcomponents/dist/navigation-instruments/watch/tickmark.js';
|
|
6
6
|
import '@oicl/openbridge-webcomponents/dist/navigation-instruments/gauge-proportional/gauge-proportional.js';
|
|
7
7
|
import { setProperties } from "../../util.js";
|
|
8
|
+
import NamedSlot from "../../NamedSlot.svelte";
|
|
8
9
|
import type {InstrumentState} from '@oicl/openbridge-webcomponents/dist/navigation-instruments/types.js';
|
|
9
10
|
import type {GaugeProportionalSector, GaugeProportionalAlignment, GaugeProportionalPriority, GaugeProportionalAdvice} from '@oicl/openbridge-webcomponents/dist/navigation-instruments/gauge-proportional/gauge-proportional.js';
|
|
10
11
|
import type {TickmarkStyle} from '@oicl/openbridge-webcomponents/dist/navigation-instruments/watch/tickmark.js';
|
|
@@ -113,14 +114,10 @@ animateSetpoint?: boolean;
|
|
|
113
114
|
>
|
|
114
115
|
|
|
115
116
|
{#if icon}
|
|
116
|
-
<
|
|
117
|
-
{@render icon()}
|
|
118
|
-
</div>
|
|
117
|
+
<NamedSlot name="icon" content={icon} />
|
|
119
118
|
{/if}
|
|
120
119
|
|
|
121
120
|
{#if secondaryIcon}
|
|
122
|
-
<
|
|
123
|
-
{@render secondaryIcon()}
|
|
124
|
-
</div>
|
|
121
|
+
<NamedSlot name="secondary-icon" content={secondaryIcon} />
|
|
125
122
|
{/if}
|
|
126
123
|
</obc-gauge-proportional>
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
export type {GaugeRadialIndicatorStyle} from '@oicl/openbridge-webcomponents/dist/navigation-instruments/gauge-radial-indicator/gauge-radial-indicator.js';
|
|
4
4
|
import '@oicl/openbridge-webcomponents/dist/navigation-instruments/gauge-radial-indicator/gauge-radial-indicator.js';
|
|
5
5
|
import { setProperties } from "../../util.js";
|
|
6
|
+
import NamedSlot from "../../NamedSlot.svelte";
|
|
6
7
|
import type {GaugeRadialIndicatorStyle} from '@oicl/openbridge-webcomponents/dist/navigation-instruments/gauge-radial-indicator/gauge-radial-indicator.js';
|
|
7
8
|
import type { Snippet } from 'svelte';
|
|
8
9
|
|
|
@@ -33,8 +34,6 @@
|
|
|
33
34
|
>
|
|
34
35
|
|
|
35
36
|
{#if iconSnippet}
|
|
36
|
-
<
|
|
37
|
-
{@render iconSnippet()}
|
|
38
|
-
</div>
|
|
37
|
+
<NamedSlot name="icon" content={iconSnippet} />
|
|
39
38
|
{/if}
|
|
40
39
|
</obc-gauge-radial-indicator>
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
|
|
2
2
|
<script lang="ts">
|
|
3
|
-
export type {ChartLineDataItem, ChartLinePoint, XAxisType, YAxisPosition, ChartLineYAxisConfig, LineMode, TimeDisplay} from '@oicl/openbridge-webcomponents/dist/building-blocks/chart-line/chart-line-base.js';
|
|
3
|
+
export type {ChartLineDataItem, ChartLinePoint, XAxisType, YAxisPosition, ChartLineYAxisConfig, ChartLineXAxisConfig, RangeLabels, LineMode, TimeDisplay} from '@oicl/openbridge-webcomponents/dist/building-blocks/chart-line/chart-line-base.js';
|
|
4
4
|
export type {ChartDataset} from 'chart.js';
|
|
5
5
|
export type {InstrumentState, Priority, FrameStyle, BorderRadiusPosition} from '@oicl/openbridge-webcomponents/dist/navigation-instruments/types.js';
|
|
6
6
|
export type {ScaleType, FillMode} from '@oicl/openbridge-webcomponents/dist/building-blocks/bar-vertical/bar-vertical.js';
|
|
7
7
|
export type {LinearAdvice} from '@oicl/openbridge-webcomponents/dist/building-blocks/instrument-linear/advice.js';
|
|
8
8
|
import '@oicl/openbridge-webcomponents/dist/navigation-instruments/gauge-trend/gauge-trend.js';
|
|
9
9
|
import { setProperties } from "../../util.js";
|
|
10
|
-
import type {ChartLineDataItem, ChartLinePoint, XAxisType, YAxisPosition, ChartLineYAxisConfig, LineMode, TimeDisplay} from '@oicl/openbridge-webcomponents/dist/building-blocks/chart-line/chart-line-base.js';
|
|
10
|
+
import type {ChartLineDataItem, ChartLinePoint, XAxisType, YAxisPosition, ChartLineYAxisConfig, ChartLineXAxisConfig, RangeLabels, LineMode, TimeDisplay} from '@oicl/openbridge-webcomponents/dist/building-blocks/chart-line/chart-line-base.js';
|
|
11
11
|
import type {ChartDataset} from 'chart.js';
|
|
12
12
|
import type {InstrumentState, Priority, FrameStyle, BorderRadiusPosition} from '@oicl/openbridge-webcomponents/dist/navigation-instruments/types.js';
|
|
13
13
|
import type {ScaleType, FillMode} from '@oicl/openbridge-webcomponents/dist/building-blocks/bar-vertical/bar-vertical.js';
|
|
@@ -64,6 +64,12 @@ animateSetpoint?: boolean;
|
|
|
64
64
|
yAxisPosition?: YAxisPosition;
|
|
65
65
|
/** Multiple y-axis definitions for complex multi-axis charts. */
|
|
66
66
|
yAxes?: ChartLineYAxisConfig[] | undefined;
|
|
67
|
+
/**
|
|
68
|
+
* Pinned x range (`min`/`max`) for time and number axes. Without it the axis spans exactly the data, so a window that is still filling stretches across the full width. In `minutes` display `max` is the `0min` reference.
|
|
69
|
+
*
|
|
70
|
+
* Available when `xAxisType!=category`.
|
|
71
|
+
*/
|
|
72
|
+
xAxis?: ChartLineXAxisConfig | undefined;
|
|
67
73
|
/** Show grid lines. */
|
|
68
74
|
showGrid?: boolean;
|
|
69
75
|
/**
|
|
@@ -96,6 +102,12 @@ and never wants to show axis labels (e.g. `obc-automation-tank`).
|
|
|
96
102
|
Defaults to `true` to preserve existing behavior. Declared with `attribute: false`
|
|
97
103
|
because a `true`-default boolean cannot work as an HTML boolean attribute. */
|
|
98
104
|
hasLabelPadding?: boolean;
|
|
105
|
+
/**
|
|
106
|
+
* Labels kept below the 192px threshold, where the axis labels are otherwise hidden: 'y' draws min, max and (inside the range) 0 in a gutter on the y-axis side; 'x' draws the first and last x value in a bottom gutter; 'xy' both. Ignored when `hasLabelPadding` is false.
|
|
107
|
+
*
|
|
108
|
+
* Available when `hasLabelPadding==true`.
|
|
109
|
+
*/
|
|
110
|
+
rangeLabels?: RangeLabels;
|
|
99
111
|
/** Show point markers on data points. Default: false. */
|
|
100
112
|
showPoints?: boolean;
|
|
101
113
|
/** Line drawing style: 'smooth' (curved), 'straight', or 'stepped'. */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import '@oicl/openbridge-webcomponents/dist/navigation-instruments/gauge-trend/gauge-trend.js';
|
|
2
|
-
import type { ChartLineDataItem, ChartLinePoint, XAxisType, YAxisPosition, ChartLineYAxisConfig, LineMode, TimeDisplay } from '@oicl/openbridge-webcomponents/dist/building-blocks/chart-line/chart-line-base.js';
|
|
2
|
+
import type { ChartLineDataItem, ChartLinePoint, XAxisType, YAxisPosition, ChartLineYAxisConfig, ChartLineXAxisConfig, RangeLabels, LineMode, TimeDisplay } from '@oicl/openbridge-webcomponents/dist/building-blocks/chart-line/chart-line-base.js';
|
|
3
3
|
import type { ChartDataset } from 'chart.js';
|
|
4
4
|
import type { InstrumentState, Priority, FrameStyle, BorderRadiusPosition } from '@oicl/openbridge-webcomponents/dist/navigation-instruments/types.js';
|
|
5
5
|
import type { ScaleType, FillMode } from '@oicl/openbridge-webcomponents/dist/building-blocks/bar-vertical/bar-vertical.js';
|
|
@@ -55,6 +55,12 @@ regardless of instrument state. */
|
|
|
55
55
|
yAxisPosition?: YAxisPosition;
|
|
56
56
|
/** Multiple y-axis definitions for complex multi-axis charts. */
|
|
57
57
|
yAxes?: ChartLineYAxisConfig[] | undefined;
|
|
58
|
+
/**
|
|
59
|
+
* Pinned x range (`min`/`max`) for time and number axes. Without it the axis spans exactly the data, so a window that is still filling stretches across the full width. In `minutes` display `max` is the `0min` reference.
|
|
60
|
+
*
|
|
61
|
+
* Available when `xAxisType!=category`.
|
|
62
|
+
*/
|
|
63
|
+
xAxis?: ChartLineXAxisConfig | undefined;
|
|
58
64
|
/** Show grid lines. */
|
|
59
65
|
showGrid?: boolean;
|
|
60
66
|
/**
|
|
@@ -87,6 +93,12 @@ and never wants to show axis labels (e.g. `obc-automation-tank`).
|
|
|
87
93
|
Defaults to `true` to preserve existing behavior. Declared with `attribute: false`
|
|
88
94
|
because a `true`-default boolean cannot work as an HTML boolean attribute. */
|
|
89
95
|
hasLabelPadding?: boolean;
|
|
96
|
+
/**
|
|
97
|
+
* Labels kept below the 192px threshold, where the axis labels are otherwise hidden: 'y' draws min, max and (inside the range) 0 in a gutter on the y-axis side; 'x' draws the first and last x value in a bottom gutter; 'xy' both. Ignored when `hasLabelPadding` is false.
|
|
98
|
+
*
|
|
99
|
+
* Available when `hasLabelPadding==true`.
|
|
100
|
+
*/
|
|
101
|
+
rangeLabels?: RangeLabels;
|
|
90
102
|
/** Show point markers on data points. Default: false. */
|
|
91
103
|
showPoints?: boolean;
|
|
92
104
|
/** Line drawing style: 'smooth' (curved), 'straight', or 'stepped'. */
|
|
@@ -213,6 +225,8 @@ declare const ObcGaugeTrend: import("svelte").Component<$$ComponentProps, {
|
|
|
213
225
|
XAxisType: typeof XAxisType;
|
|
214
226
|
YAxisPosition: typeof YAxisPosition;
|
|
215
227
|
ChartLineYAxisConfig: typeof ChartLineYAxisConfig;
|
|
228
|
+
ChartLineXAxisConfig: typeof ChartLineXAxisConfig;
|
|
229
|
+
RangeLabels: typeof RangeLabels;
|
|
216
230
|
LineMode: typeof LineMode;
|
|
217
231
|
TimeDisplay: typeof TimeDisplay;
|
|
218
232
|
ChartDataset: typeof ChartDataset;
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
export type {InstrumentFieldSize} from '@oicl/openbridge-webcomponents/dist/navigation-instruments/instrument-field/instrument-field.js';
|
|
4
4
|
import '@oicl/openbridge-webcomponents/dist/navigation-instruments/instrument-field/instrument-field.js';
|
|
5
5
|
import { setProperties } from "../../util.js";
|
|
6
|
+
import NamedSlot from "../../NamedSlot.svelte";
|
|
6
7
|
import type {InstrumentFieldSize} from '@oicl/openbridge-webcomponents/dist/navigation-instruments/instrument-field/instrument-field.js';
|
|
7
8
|
import type { Snippet } from 'svelte';
|
|
8
9
|
|
|
@@ -62,8 +63,6 @@
|
|
|
62
63
|
>
|
|
63
64
|
|
|
64
65
|
{#if offValue}
|
|
65
|
-
<
|
|
66
|
-
{@render offValue()}
|
|
67
|
-
</div>
|
|
66
|
+
<NamedSlot name="off-value" content={offValue} />
|
|
68
67
|
{/if}
|
|
69
68
|
</obc-instrument-field>
|
|
@@ -8,6 +8,7 @@ export type {AlertFrameConfig} from '@oicl/openbridge-webcomponents/dist/compone
|
|
|
8
8
|
export type {ReadoutValueOptions, ReadoutSetpointOptions, ReadoutAdviceOptions, ReadoutLabelOptions, ReadoutReserverOptions} from '@oicl/openbridge-webcomponents/dist/navigation-instruments/readout-list-item/readout-list-item.js';
|
|
9
9
|
import '@oicl/openbridge-webcomponents/dist/navigation-instruments/readout/readout.js';
|
|
10
10
|
import { setProperties, forwardEvents } from "../../util.js";
|
|
11
|
+
import NamedSlot from "../../NamedSlot.svelte";
|
|
11
12
|
import type {ReadoutValueType} from '@oicl/openbridge-webcomponents/dist/navigation-instruments/readout/readout-formatters.js';
|
|
12
13
|
import type {ReadoutBlockSize, ReadoutBlockDataQuality} from '@oicl/openbridge-webcomponents/dist/building-blocks/readout-block/readout-block.js';
|
|
13
14
|
import type {Priority} from '@oicl/openbridge-webcomponents/dist/navigation-instruments/types.js';
|
|
@@ -110,32 +111,22 @@ import type {ReadoutValueOptions, ReadoutSetpointOptions, ReadoutAdviceOptions,
|
|
|
110
111
|
use:forwardEvents={{'source-change': onSourceChange, 'source-flyout-click': onSourceFlyoutClick}} >
|
|
111
112
|
|
|
112
113
|
{#if leadingIcon}
|
|
113
|
-
<
|
|
114
|
-
{@render leadingIcon()}
|
|
115
|
-
</div>
|
|
114
|
+
<NamedSlot name="leading-icon" content={leadingIcon} />
|
|
116
115
|
{/if}
|
|
117
116
|
|
|
118
117
|
{#if valueIcon}
|
|
119
|
-
<
|
|
120
|
-
{@render valueIcon()}
|
|
121
|
-
</div>
|
|
118
|
+
<NamedSlot name="value-icon" content={valueIcon} />
|
|
122
119
|
{/if}
|
|
123
120
|
|
|
124
121
|
{#if setpointIcon}
|
|
125
|
-
<
|
|
126
|
-
{@render setpointIcon()}
|
|
127
|
-
</div>
|
|
122
|
+
<NamedSlot name="setpoint-icon" content={setpointIcon} />
|
|
128
123
|
{/if}
|
|
129
124
|
|
|
130
125
|
{#if adviceIcon}
|
|
131
|
-
<
|
|
132
|
-
{@render adviceIcon()}
|
|
133
|
-
</div>
|
|
126
|
+
<NamedSlot name="advice-icon" content={adviceIcon} />
|
|
134
127
|
{/if}
|
|
135
128
|
|
|
136
129
|
{#if srcPickerContent}
|
|
137
|
-
<
|
|
138
|
-
{@render srcPickerContent()}
|
|
139
|
-
</div>
|
|
130
|
+
<NamedSlot name="src-picker-content" content={srcPickerContent} />
|
|
140
131
|
{/if}
|
|
141
132
|
</obc-readout>
|
|
@@ -6,6 +6,7 @@ export type {ReadoutListItemPriority, ReadoutListItemStacking, ReadoutListItemCl
|
|
|
6
6
|
export type {AlertFrameConfig} from '@oicl/openbridge-webcomponents/dist/components/alert-frame/alert-frame.js';
|
|
7
7
|
import '@oicl/openbridge-webcomponents/dist/navigation-instruments/readout-list-item/readout-list-item.js';
|
|
8
8
|
import { setProperties, forwardEvents } from "../../util.js";
|
|
9
|
+
import NamedSlot from "../../NamedSlot.svelte";
|
|
9
10
|
import type {ReadoutValueType} from '@oicl/openbridge-webcomponents/dist/navigation-instruments/readout/readout-formatters.js';
|
|
10
11
|
import type {ReadoutBlockSize, ReadoutBlockDataQuality} from '@oicl/openbridge-webcomponents/dist/building-blocks/readout-block/readout-block.js';
|
|
11
12
|
import type {ReadoutListItemPriority, ReadoutListItemStacking, ReadoutListItemClickable, ReadoutValueOptions, ReadoutSetpointOptions, ReadoutAdviceOptions, ReadoutLabelOptions, ReadoutReserverOptions, ReadoutSrcOptions} from '@oicl/openbridge-webcomponents/dist/navigation-instruments/readout-list-item/readout-list-item.js';
|
|
@@ -87,26 +88,18 @@ import type {AlertFrameConfig} from '@oicl/openbridge-webcomponents/dist/compone
|
|
|
87
88
|
use:forwardEvents={{'click': onClick}} >
|
|
88
89
|
|
|
89
90
|
{#if leadingIcon}
|
|
90
|
-
<
|
|
91
|
-
{@render leadingIcon()}
|
|
92
|
-
</div>
|
|
91
|
+
<NamedSlot name="leading-icon" content={leadingIcon} />
|
|
93
92
|
{/if}
|
|
94
93
|
|
|
95
94
|
{#if valueIcon}
|
|
96
|
-
<
|
|
97
|
-
{@render valueIcon()}
|
|
98
|
-
</div>
|
|
95
|
+
<NamedSlot name="value-icon" content={valueIcon} />
|
|
99
96
|
{/if}
|
|
100
97
|
|
|
101
98
|
{#if setpointIcon}
|
|
102
|
-
<
|
|
103
|
-
{@render setpointIcon()}
|
|
104
|
-
</div>
|
|
99
|
+
<NamedSlot name="setpoint-icon" content={setpointIcon} />
|
|
105
100
|
{/if}
|
|
106
101
|
|
|
107
102
|
{#if adviceIcon}
|
|
108
|
-
<
|
|
109
|
-
{@render adviceIcon()}
|
|
110
|
-
</div>
|
|
103
|
+
<NamedSlot name="advice-icon" content={adviceIcon} />
|
|
111
104
|
{/if}
|
|
112
105
|
</obc-readout-list-item>
|
package/dist/util.d.ts
CHANGED
|
@@ -6,4 +6,24 @@ export declare function forwardEvents(node: HTMLElement, handlers: EventHandlers
|
|
|
6
6
|
update(handlers: EventHandlers): void;
|
|
7
7
|
destroy(): void;
|
|
8
8
|
};
|
|
9
|
+
/**
|
|
10
|
+
* `slot` value of the markers that delimit a NamedSlot region. It matches no
|
|
11
|
+
* real slot, so the markers stay unassigned and never affect layout.
|
|
12
|
+
*/
|
|
13
|
+
export declare const SLOT_MARKER = "svelte-slot-marker";
|
|
14
|
+
export interface AssignSlotOptions {
|
|
15
|
+
name: string;
|
|
16
|
+
/** Called when the region renders text, which cannot carry a `slot`. */
|
|
17
|
+
onText: () => void;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Assigns the elements rendered between this start marker and the next marker
|
|
21
|
+
* to a named slot by setting their `slot` attribute, so they slot natively
|
|
22
|
+
* like the web component's documented usage. Nodes are never moved: Svelte
|
|
23
|
+
* removes blocks by walking their sibling range.
|
|
24
|
+
*/
|
|
25
|
+
export declare function assignSlot(start: HTMLTemplateElement, options: AssignSlotOptions): {
|
|
26
|
+
update(options: AssignSlotOptions): void;
|
|
27
|
+
destroy(): void;
|
|
28
|
+
};
|
|
9
29
|
export {};
|
package/dist/util.js
CHANGED
|
@@ -39,3 +39,45 @@ export function forwardEvents(node, handlers) {
|
|
|
39
39
|
},
|
|
40
40
|
};
|
|
41
41
|
}
|
|
42
|
+
/**
|
|
43
|
+
* `slot` value of the markers that delimit a NamedSlot region. It matches no
|
|
44
|
+
* real slot, so the markers stay unassigned and never affect layout.
|
|
45
|
+
*/
|
|
46
|
+
export const SLOT_MARKER = "svelte-slot-marker";
|
|
47
|
+
const isMarker = (node) => node instanceof HTMLTemplateElement && node.slot === SLOT_MARKER;
|
|
48
|
+
/**
|
|
49
|
+
* Assigns the elements rendered between this start marker and the next marker
|
|
50
|
+
* to a named slot by setting their `slot` attribute, so they slot natively
|
|
51
|
+
* like the web component's documented usage. Nodes are never moved: Svelte
|
|
52
|
+
* removes blocks by walking their sibling range.
|
|
53
|
+
*/
|
|
54
|
+
export function assignSlot(start, options) {
|
|
55
|
+
let current = options;
|
|
56
|
+
const assign = () => {
|
|
57
|
+
for (let node = start.nextSibling; node && !isMarker(node); node = node.nextSibling) {
|
|
58
|
+
if (node instanceof Element) {
|
|
59
|
+
if (node.slot !== current.name)
|
|
60
|
+
node.slot = current.name;
|
|
61
|
+
}
|
|
62
|
+
else if (node.nodeType === Node.TEXT_NODE && node.textContent?.trim()) {
|
|
63
|
+
current.onText();
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
assign();
|
|
69
|
+
// Re-assign when the snippet's top-level nodes change, e.g. an `{#if}` at
|
|
70
|
+
// the snippet root. Mutation records are delivered before the next paint.
|
|
71
|
+
const observer = new MutationObserver(assign);
|
|
72
|
+
if (start.parentNode)
|
|
73
|
+
observer.observe(start.parentNode, { childList: true });
|
|
74
|
+
return {
|
|
75
|
+
update(options) {
|
|
76
|
+
current = options;
|
|
77
|
+
assign();
|
|
78
|
+
},
|
|
79
|
+
destroy() {
|
|
80
|
+
observer.disconnect();
|
|
81
|
+
},
|
|
82
|
+
};
|
|
83
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oicl/openbridge-webcomponents-svelte",
|
|
3
|
-
"version": "2.0.0-next.
|
|
3
|
+
"version": "2.0.0-next.152",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"dev": "vite dev",
|
|
6
6
|
"build": "vite build && npm run prepack",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
}
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@oicl/openbridge-webcomponents": "^2.0.0-next.
|
|
34
|
+
"@oicl/openbridge-webcomponents": "^2.0.0-next.152"
|
|
35
35
|
},
|
|
36
36
|
"peerDependencies": {
|
|
37
37
|
"svelte": "^5.0.0"
|