@rio-cloud/rio-uikit 2.4.2 → 2.5.0
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/CountedInput.d.ts +2 -0
- package/CountedInput.js +5 -0
- package/CountedInput.js.map +1 -0
- package/TabbedPanel.d.ts +2 -0
- package/TabbedPanel.js +5 -0
- package/TabbedPanel.js.map +1 -0
- package/components/applicationHeader/NavItems.js +58 -46
- package/components/applicationHeader/NavItems.js.map +1 -1
- package/components/applicationLayout/ApplicationLayoutBody.d.ts +1 -1
- package/components/applicationLayout/ApplicationLayoutBody.js +29 -29
- package/components/applicationLayout/ApplicationLayoutBody.js.map +1 -1
- package/components/applicationLayout/ApplicationLayoutHeader.js +22 -7
- package/components/applicationLayout/ApplicationLayoutHeader.js.map +1 -1
- package/components/assetTree/useTreeHeight.js.map +1 -1
- package/components/button/Button.d.ts +11 -3
- package/components/button/Button.js.map +1 -1
- package/components/clearableInput/ClearableInput.d.ts +4 -0
- package/components/clearableInput/ClearableInput.js.map +1 -1
- package/components/countedInput/CountedInput.d.ts +91 -0
- package/components/countedInput/CountedInput.js +65 -0
- package/components/countedInput/CountedInput.js.map +1 -0
- package/components/datepicker/DayPicker.js +3 -2
- package/components/datepicker/DayPicker.js.map +1 -1
- package/components/datepicker/DayPickerInput.d.ts +1 -1
- package/components/datepicker/DayPickerInput.js.map +1 -1
- package/components/datepicker/dayPickerTypes.d.ts +3 -2
- package/components/datepicker/dayPickerTypes.js.map +1 -1
- package/components/datepicker/dayPickerUtils.d.ts +1 -1
- package/components/datepicker/dayPickerUtils.js +45 -22
- package/components/datepicker/dayPickerUtils.js.map +1 -1
- package/components/datepicker/useDayPickerInputState.d.ts +1 -1
- package/components/dialog/ConfirmationDialog.d.ts +17 -0
- package/components/dialog/ConfirmationDialog.js +43 -19
- package/components/dialog/ConfirmationDialog.js.map +1 -1
- package/components/dialog/DialogHeader.js +20 -19
- package/components/dialog/DialogHeader.js.map +1 -1
- package/components/dropdown/ButtonDropdown.d.ts +5 -0
- package/components/dropdown/ButtonDropdown.js +63 -61
- package/components/dropdown/ButtonDropdown.js.map +1 -1
- package/components/dropdown/DropdownToggleButton.d.ts +2 -0
- package/components/dropdown/DropdownToggleButton.js +39 -35
- package/components/dropdown/DropdownToggleButton.js.map +1 -1
- package/components/map/components/features/settings/builtinSettings/MapTypeSettings.js +103 -105
- package/components/map/components/features/settings/builtinSettings/MapTypeSettings.js.map +1 -1
- package/components/map/utils/eventHandling.js.map +1 -1
- package/components/map/utils/mapTypes.d.ts +7 -0
- package/components/map/utils/mapTypes.js.map +1 -1
- package/components/map/utils/rendering.js +5 -5
- package/components/numberControl/NumberControl.js.map +1 -1
- package/components/page/Page.d.ts +2 -0
- package/components/page/Page.js.map +1 -1
- package/components/rioglyph/Rioglyph.d.ts +8 -2
- package/components/rioglyph/Rioglyph.js.map +1 -1
- package/components/rioglyph/RioglyphIconType.d.ts +1 -1
- package/components/selects/BaseSelectDropdown.d.ts +8 -0
- package/components/selects/BaseSelectDropdown.js +76 -60
- package/components/selects/BaseSelectDropdown.js.map +1 -1
- package/components/selects/Multiselect.d.ts +5 -0
- package/components/selects/Multiselect.js +60 -58
- package/components/selects/Multiselect.js.map +1 -1
- package/components/selects/Select.d.ts +5 -0
- package/components/selects/Select.js +60 -58
- package/components/selects/Select.js.map +1 -1
- package/components/sidebars/Sidebar.js +40 -40
- package/components/sidebars/Sidebar.js.map +1 -1
- package/components/sidebars/SidebarCloseButton.d.ts +3 -1
- package/components/sidebars/SidebarCloseButton.js +19 -5
- package/components/sidebars/SidebarCloseButton.js.map +1 -1
- package/components/states/CustomState.d.ts +7 -1
- package/components/states/CustomState.js.map +1 -1
- package/components/states/StateButton.d.ts +11 -1
- package/components/states/StateButton.js +46 -10
- package/components/states/StateButton.js.map +1 -1
- package/components/statsWidget/StatsWidgetNumber.d.ts +16 -1
- package/components/statsWidget/StatsWidgetNumber.js +29 -12
- package/components/statsWidget/StatsWidgetNumber.js.map +1 -1
- package/components/tabbedPanel/TabbedPanel.d.ts +99 -0
- package/components/tabbedPanel/TabbedPanel.js +119 -0
- package/components/tabbedPanel/TabbedPanel.js.map +1 -0
- package/components/table/Table.types.d.ts +9 -1
- package/components/table/TableColumn.js +20 -19
- package/components/table/TableColumn.js.map +1 -1
- package/components/table/TableHeaderColumn.d.ts +4 -0
- package/components/table/TableHeaderColumn.js +50 -53
- package/components/table/TableHeaderColumn.js.map +1 -1
- package/components/table/TableToolbar.d.ts +4 -0
- package/components/table/TableToolbar.js.map +1 -1
- package/components/table/TableToolbarColumn.d.ts +3 -0
- package/components/table/TableToolbarColumn.js.map +1 -1
- package/components/table/render/header/resolveHeaderCellStyle.d.ts +87 -55
- package/components/timepicker/TimePicker.d.ts +6 -0
- package/components/timepicker/TimePicker.js +57 -56
- package/components/timepicker/TimePicker.js.map +1 -1
- package/hooks/useClickOutside.js +3 -3
- package/hooks/useClipboard.js.map +1 -1
- package/hooks/useScrollPosition.js.map +1 -1
- package/package.json +4 -4
- package/themes/Volkswagen/components/applicationHeader/VolkswagenApplicationHeader.js +23 -22
- package/themes/Volkswagen/components/applicationHeader/VolkswagenApplicationHeader.js.map +1 -1
- package/utils/analytics/getTrackingLabelFromNode.d.ts +2 -0
- package/utils/analytics/getTrackingLabelFromNode.js +24 -0
- package/utils/analytics/getTrackingLabelFromNode.js.map +1 -0
- package/utils/analytics/googleAnalyticsUtils.js +21 -28
- package/utils/analytics/googleAnalyticsUtils.js.map +1 -1
- package/utils/getNodeTextContent.d.ts +2 -0
- package/utils/getNodeTextContent.js +22 -0
- package/utils/getNodeTextContent.js.map +1 -0
- package/utils/init/initCSS.js +5 -5
- package/utils/init/initCSS.js.map +1 -1
- package/utils/init/initConfig.js +4 -7
- package/utils/init/initConfig.js.map +1 -1
- package/utils/init/initDocumentBootstrapping.js +14 -14
- package/utils/init/initDocumentBootstrapping.js.map +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.js.map +1 -1
- package/DayPickerPrototype.d.ts +0 -2
- package/DayPickerPrototype.js +0 -5
- package/DayPickerPrototype.js.map +0 -1
- package/TableNext.d.ts +0 -2
- package/TableNext.js +0 -25
- package/TableNext.js.map +0 -1
- package/components/datepicker/DayPickerPrototype.d.ts +0 -53
- package/components/datepicker/DayPickerPrototype.js +0 -285
- package/components/datepicker/DayPickerPrototype.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"eventHandling.js","sources":["../../../../src/components/map/utils/eventHandling.ts"],"sourcesContent":["import type { MapEvent } from './mapTypes';\n\nexport type EventListenerMap = {\n [key: string]: Function;\n};\n\ntype MapTimeGuard = {\n delayTime: number;\n timer:
|
|
1
|
+
{"version":3,"file":"eventHandling.js","sources":["../../../../src/components/map/utils/eventHandling.ts"],"sourcesContent":["import type { MapEvent } from './mapTypes';\n\nexport type EventListenerMap = {\n [key: string]: Function;\n};\n\ntype MapTimeGuard = {\n delayTime: number;\n timer: number | undefined;\n delay(callback: Function, ...args: any[]): void;\n cancel(): void;\n};\n\nconst createMapTimeGuard = (delay = 250): MapTimeGuard => {\n let timer: number | undefined;\n\n const delayFunc = <T>(callback: Function, ...args: T[]): void => {\n cancelFunc();\n timer = setTimeout(() => callback(...args), delay);\n };\n\n const cancelFunc = (): void => {\n clearTimeout(timer);\n };\n\n return {\n delayTime: delay,\n timer,\n delay: delayFunc,\n cancel: cancelFunc,\n };\n};\n\ntype EnhancedMapEvent = {\n viewportX: number;\n viewportY: number;\n map: H.Map;\n calculateGeoCoords(): H.geo.Point;\n};\n\nexport const createEnhancedMapEvent = (\n event: H.mapevents.Event | null,\n mapApi: H.Map\n): EnhancedMapEvent | { map: H.Map } => {\n if (!event || !event.currentPointer) {\n return {\n map: mapApi,\n };\n }\n\n const viewportX = event.currentPointer.viewportX;\n const viewportY = event.currentPointer.viewportY;\n\n const calculateGeoCoords = (): H.geo.Point => mapApi.screenToGeo(viewportX, viewportY);\n\n return {\n viewportX,\n viewportY,\n map: mapApi,\n calculateGeoCoords,\n };\n};\n\nexport const createEnhancedListener = (listener: Function, mapApi: H.Map) => (event: H.mapevents.Event) =>\n listener(event, createEnhancedMapEvent(event, mapApi));\n\nexport type RioEventTarget = H.util.EventTarget & {\n rioMapRemoveEvents?: Function;\n};\n\nexport const addEventListenerMap = (\n eventTarget: RioEventTarget,\n eventListenerMap: EventListenerMap | undefined,\n mapApi: H.Map\n) => {\n if (!eventListenerMap) {\n return;\n }\n\n const enhancedMap: Record<string, any> = {};\n\n Object.keys(eventListenerMap).forEach(key => {\n const enhancedListener = createEnhancedListener(eventListenerMap[key], mapApi);\n eventTarget.addEventListener(key, enhancedListener as any);\n enhancedMap[key] = enhancedListener;\n });\n\n eventTarget.rioMapRemoveEvents = () => {\n Object.keys(enhancedMap).forEach(key => {\n eventTarget.removeEventListener(key, enhancedMap[key]);\n });\n\n delete eventTarget.rioMapRemoveEvents;\n\n return mapApi;\n };\n};\n\nexport const removeEventListenerMap = (eventTarget: RioEventTarget) => {\n if (eventTarget.rioMapRemoveEvents) {\n return eventTarget.rioMapRemoveEvents();\n }\n};\n\nexport const createTapOnDblTapPreventer = (\n eventListenerMap: EventListenerMap,\n delayBetweenTaps = 300\n): EventListenerMap => {\n const result = { ...eventListenerMap };\n if (!eventListenerMap[EventUtils.TAP] || !eventListenerMap[EventUtils.DBL_TAP]) {\n return result;\n }\n\n const guard = createMapTimeGuard(delayBetweenTaps);\n\n result[EventUtils.TAP] = <T>(...args: T[]) => {\n guard.delay(eventListenerMap[EventUtils.TAP], ...args);\n };\n\n result[EventUtils.DBL_TAP] = <T>(...args: T[]) => {\n guard.cancel();\n eventListenerMap[EventUtils.DBL_TAP](...args);\n };\n\n return result;\n};\n\nexport const getMouseButton = (event: MapEvent): number =>\n (event.originalEvent as unknown as H.mapevents.Pointer).button;\n\nexport const isRightClick = (event: MapEvent): boolean => getMouseButton(event) === EventUtils.MOUSE_BUTTONS.RIGHT;\n\nexport const EventUtils = {\n MOUSE_BUTTONS: {\n LEFT: 0,\n MIDDLE: 1,\n RIGHT: 2,\n },\n\n POINTER_DOWN: 'pointerdown',\n POINTER_UP: 'pointerup',\n POINTER_MOVE: 'pointermove',\n POINTER_ENTER: 'pointerenter',\n POINTER_LEAVE: 'pointerleave',\n POINTER_CANCEL: 'pointercancel',\n\n DRAG_START: 'dragstart',\n DRAG: 'drag',\n DRAG_END: 'dragend',\n TAP: 'tap',\n DBL_TAP: 'dbltap',\n LONGPRESS: 'longpress',\n\n CONTEXTMENU: 'contextmenu',\n CONTEXTMENU_CLOSE: 'contextmenuclose',\n\n MAP_VIEW_CHANGE_START: 'mapviewchangestart',\n MAP_VIEW_CHANGE: 'mapviewchange',\n MAP_VIEW_CHANGE_END: 'mapviewchangeend',\n\n BASE_LAYER_CHANGE: 'baselayerchange',\n ENGINE_CHANGE: 'enginechange',\n\n createTapOnDblTapPreventer,\n getMouseButton,\n isRightClick,\n};\n\nexport default EventUtils;\n"],"names":["createMapTimeGuard","delay","timer","delayFunc","callback","args","cancelFunc","createEnhancedMapEvent","event","mapApi","viewportX","viewportY","createEnhancedListener","listener","addEventListenerMap","eventTarget","eventListenerMap","enhancedMap","key","enhancedListener","removeEventListenerMap","createTapOnDblTapPreventer","delayBetweenTaps","result","EventUtils","guard","getMouseButton","isRightClick"],"mappings":"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"}
|
|
@@ -45,11 +45,18 @@ export type MapLayer = ObjectValues<typeof MapLayerMap>;
|
|
|
45
45
|
export type MapCredentials = {
|
|
46
46
|
app_id?: string;
|
|
47
47
|
app_code?: string;
|
|
48
|
+
/**
|
|
49
|
+
* HERE Maps API key. Production map views require project-specific HERE credentials.
|
|
50
|
+
*/
|
|
48
51
|
apikey?: string;
|
|
49
52
|
};
|
|
50
53
|
export type MapProps = {
|
|
51
54
|
/**
|
|
52
55
|
* HERE credentials used to initialize the map platform.
|
|
56
|
+
*
|
|
57
|
+
* Production map views require a valid HERE API key. Read the Map - Getting started
|
|
58
|
+
* documentation before using Map and pass project-specific
|
|
59
|
+
* credentials, for example `{ apikey: '...' }`.
|
|
53
60
|
*/
|
|
54
61
|
credentials: MapCredentials;
|
|
55
62
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mapTypes.js","sources":["../../../../src/components/map/utils/mapTypes.ts"],"sourcesContent":["import type { ObjectValues } from '../../../utils/ObjectValues';\nimport type { MapUtils } from './mapUtils';\nimport type { EventListenerMap } from './eventHandling';\n\nexport type Point = H.geo.Point;\n\nexport type NoisePoint = H.clustering.INoisePoint;\nexport type DataPoint = H.clustering.DataPoint;\n\nexport type MapEvent = H.mapevents.Event & {};\n\nexport type MapContextMenuEvent = H.mapevents.ContextMenuEvent;\n\nexport type MapInfoBubble = H.ui.InfoBubble;\n\nexport type MapUtilEvent = H.util.Event;\n\nexport type Position = {\n lat: number;\n lng: number;\n};\n\nexport type BoundingBox = {\n top: number;\n bottom: number;\n left: number;\n right: number;\n};\n\nexport type MapBoundingBox = {\n topLeft: {\n lng: number | undefined;\n lat: number | undefined;\n };\n bottomRight: {\n lng: number | undefined;\n lat: number | undefined;\n };\n};\n\nexport const MapTypeMap = {\n TYPE_DEFAULT: 'DEFAULT',\n TYPE_FLEET_STYLE: 'FLEET_STYLE',\n TYPE_SATELLITE: 'SATELLITE',\n TYPE_TERRAIN: 'TERRAIN',\n TYPE_NIGHT: 'NIGHT',\n} as const;\n\nexport type MapType = ObjectValues<typeof MapTypeMap>;\n\nexport const MapLayerMap = {\n MAP_LAYER_INCIDENTS: 'INCIDENTS',\n MAP_LAYER_TRAFFIC: 'TRAFFIC',\n MAP_LAYER_ROAD_RESTRICTIONS: 'ROAD_RESTRICTIONS',\n} as const;\n\nexport type MapLayer = ObjectValues<typeof MapLayerMap>;\n\nexport type MapCredentials = {\n app_id?: string;\n app_code?: string;\n apikey?: string;\n};\n\nexport type MapProps = {\n /**\n * HERE credentials used to initialize the map platform.\n */\n credentials: MapCredentials;\n\n /**\n * Height of the map container.\n */\n height?: number;\n\n /**\n * Width of the map container.\n */\n width?: number;\n\n /**\n * Language used for HERE map labels and controls.\n *\n * @default 'en'\n */\n language?: string;\n\n /**\n * Initial center position of the map.\n */\n center?: Position;\n\n /**\n * Initial or controlled zoom level of the map.\n */\n zoom?: number;\n\n /**\n * Bounding box that should be fitted by the map view.\n */\n boundingBox?: BoundingBox;\n\n /**\n * Disables HERE map events entirely.\n */\n disableMapEvents?: boolean;\n\n /**\n * Disables the default HERE map behavior such as pan and zoom interaction.\n *\n * @default false\n */\n disableBehavior?: boolean;\n\n /**\n * Disables HERE zoom momentum to reduce scroll inertia on zoom.\n *\n * @default true\n */\n disableZoomMomentum?: boolean;\n\n /**\n * Event listeners attached to the HERE map instance.\n */\n eventListenerMap?: EventListenerMap;\n\n /**\n * Legacy prop for hiding map settings.\n */\n hideMapSettings?: boolean;\n\n /**\n * Hides the cluster settings entry in the map settings UI.\n *\n * @default false\n */\n hideClusterSettings?: boolean;\n\n /**\n * Hides the map layer settings entry in the map settings UI.\n *\n * @default false\n */\n hideMapLayerSettings?: boolean;\n\n /**\n * Base map type to render.\n *\n * @default Map.TYPE_DEFAULT\n */\n mapType?: MapType;\n\n /**\n * Active overlay layers such as traffic or incidents.\n *\n * @default []\n */\n mapLayer?: MapLayer[];\n\n /**\n * Controls whether marker clustering is enabled.\n *\n * @default true\n */\n showCluster?: boolean;\n\n /**\n * Shows the HERE scale bar.\n *\n * @default false\n */\n showScaleBar?: boolean;\n\n /**\n * Callback fired when the map type changes.\n */\n onMapTypeChange?: (type: MapType, previousType?: MapType) => void;\n\n /**\n * Callback fired when the active map layers change.\n */\n onMapLayerChange?: (activeLayer: MapLayer[], previousLayer?: MapLayer[]) => void;\n\n /**\n * Callback fired when the cluster visibility changes.\n */\n onShowClusterChange?: (show: boolean) => void;\n\n /**\n * Callback fired when zooming in via the built-in zoom controls.\n */\n onZoomIn?: (zoom: number) => void;\n\n /**\n * Callback fired when zooming out via the built-in zoom controls.\n */\n onZoomOut?: (zoom: number) => void;\n\n /**\n * Callback used by incidents overlays to report fetched incidents.\n */\n onIncidentsChange?: (incidentsResult: MapIncidents) => void;\n\n /**\n * Tooltip content for the map settings entry.\n */\n mapSettingsTooltip?: string | React.ReactNode;\n\n /**\n * Custom settings UI rendered on top of the map.\n */\n mapSettings?: React.ReactNode;\n\n /**\n * Enables animation when zoom or center changes are applied programmatically.\n *\n * @default false\n */\n zoomAnimation?: boolean;\n\n /**\n * Maximum number of previous map viewports stored for viewport history.\n *\n * @default 5\n */\n maxViewportHistoryEntries?: number;\n\n /**\n * Enables the WebGL/HARP rendering engine where supported.\n *\n * @default true\n */\n enableWebGL?: boolean;\n\n /**\n * Uses `window.devicePixelRatio` for map rendering.\n *\n * @default true\n */\n enableDevicePixelRatio?: boolean;\n\n /**\n * Enables caching for generated marker icons.\n *\n * @default true\n */\n enableMarkerIconCache?: boolean;\n\n /**\n * Keeps HERE fractional zoom enabled for smoother trackpad and wheel zoom interaction.\n *\n * @default false\n */\n enableFractionalZoom?: boolean;\n\n /**\n * Temporarily disables marker pointer events during zoom interactions to reduce DOM hit-testing overhead.\n *\n * @default false\n */\n disableMarkerPointerEventsWhileZooming?: boolean;\n\n /**\n * Fallback pixel ratio used when device pixel ratio support is disabled.\n */\n pixelRatio?: number;\n\n /**\n * Minimum allowed zoom level.\n */\n minZoom?: number;\n\n /**\n * Maximum allowed zoom level.\n */\n maxZoom?: number;\n\n /**\n * Map content or a render function receiving the map API.\n */\n children?: React.ReactNode | ((api: MapApi, incidents?: MapIncidents) => React.ReactNode);\n};\n\nexport type MapApi = {\n credentials?: MapCredentials;\n defaultLayers?: H.service.DefaultLayers;\n map?: H.Map;\n mapEvents?: false | H.mapevents.MapEvents;\n behavior?: false | H.mapevents.Behavior;\n platform?: H.service.Platform;\n ui?: H.ui.UI;\n utils?: MapUtils;\n group?: H.map.Group;\n settings?: {\n enableWebGL?: boolean;\n baseLayer?: MapType;\n activeLayers?: MapLayer[];\n showCluster?: boolean;\n minZoom?: number;\n maxZoom?: number;\n };\n};\n\nexport type MapIncidents = {\n sourceUpdated: string;\n results: IncidentDataPoint[];\n};\n\nexport type Incidents = {\n sourceUpdated: string;\n results: Incident[];\n};\n\nexport type IncidentLocationPoint = {\n length: number;\n points: Position[];\n};\n\nexport type IncidentLocationShape = {\n links: IncidentLocationPoint[];\n};\n\nexport type Incident = {\n incidentDetails: IncidentDetails;\n location: {\n length: number;\n shape: IncidentLocationShape;\n };\n};\n\nexport type IncidentDetails = {\n id: string;\n hrn: string;\n originalId: string;\n originalHrn: string;\n startTime: string;\n endTime: string;\n entryTime: string;\n roadClosed: boolean;\n criticality: 'minor' | 'major' | 'critical';\n type: 'roadClosure' | 'construction' | 'roadHazard' | 'other';\n codes: number[];\n comment: string | undefined;\n description: {\n value: string;\n language?: string;\n };\n summary: {\n value: string;\n language?: string;\n };\n junctionTraversability: string;\n};\n\n// https://www.here.com/docs/bundle/traffic-api-developer-guide-v7/page/topics/concepts/incidents.html#incidents\nexport type IncidentDataPoint = {\n id: string;\n tooltipContent: string;\n criticality: 'low' | 'minor' | 'major' | 'critical';\n description: {\n value: string;\n language?: string;\n };\n summary: {\n value: string;\n language?: string;\n };\n comment: string | undefined;\n type:\n | 'accident'\n | 'construction'\n | 'congestion'\n | 'roadHazard'\n | 'roadClosure'\n | 'disabledVehicle'\n | 'massTransit'\n | 'plannedEvent'\n | 'weather'\n | 'laneRestriction'\n | 'other';\n startTime: string;\n endTime: string;\n roadClosed: boolean;\n position: Position;\n};\n\nexport const markerColorOptions = [\n 'bg-map-marker-asset',\n 'bg-map-marker-poi',\n 'bg-map-marker-geofence',\n 'bg-map-marker-route',\n 'bg-map-marker-info',\n 'bg-map-marker-success',\n 'bg-map-marker-warning',\n 'bg-map-marker-danger',\n 'bg-map-marker-restrictions',\n] as const;\n\nexport type MarkerColor = (typeof markerColorOptions)[number];\n\nexport const markerColorMapping: Record<MarkerColor, string> = {\n 'bg-map-marker-asset': '--color-map-marker-asset',\n 'bg-map-marker-poi': '--color-map-marker-poi',\n 'bg-map-marker-geofence': '--color-map-marker-geofence',\n 'bg-map-marker-route': '--color-map-marker-route',\n 'bg-map-marker-info': '--color-map-marker-info',\n 'bg-map-marker-success': '--color-map-marker-success',\n 'bg-map-marker-warning': '--color-map-marker-warning',\n 'bg-map-marker-danger': '--color-map-marker-danger',\n 'bg-map-marker-restrictions': '--color-map-marker-restrictions',\n};\n"],"names":["MapTypeMap","MapLayerMap","markerColorOptions","markerColorMapping"],"mappings":"AAwCO,MAAMA,IAAa;AAAA,EACtB,cAAc;AAAA,EACd,kBAAkB;AAAA,EAClB,gBAAgB;AAAA,EAChB,cAAc;AAAA,EACd,YAAY;AAChB,GAIaC,IAAc;AAAA,EACvB,qBAAqB;AAAA,EACrB,mBAAmB;AAAA,EACnB,6BAA6B;AACjC,GA4UaC,IAAqB;AAAA,EAC9B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACJ,GAIaC,IAAkD;AAAA,EAC3D,uBAAuB;AAAA,EACvB,qBAAqB;AAAA,EACrB,0BAA0B;AAAA,EAC1B,uBAAuB;AAAA,EACvB,sBAAsB;AAAA,EACtB,yBAAyB;AAAA,EACzB,yBAAyB;AAAA,EACzB,wBAAwB;AAAA,EACxB,8BAA8B;AAClC;"}
|
|
1
|
+
{"version":3,"file":"mapTypes.js","sources":["../../../../src/components/map/utils/mapTypes.ts"],"sourcesContent":["import type { ObjectValues } from '../../../utils/ObjectValues';\nimport type { MapUtils } from './mapUtils';\nimport type { EventListenerMap } from './eventHandling';\n\nexport type Point = H.geo.Point;\n\nexport type NoisePoint = H.clustering.INoisePoint;\nexport type DataPoint = H.clustering.DataPoint;\n\nexport type MapEvent = H.mapevents.Event & {};\n\nexport type MapContextMenuEvent = H.mapevents.ContextMenuEvent;\n\nexport type MapInfoBubble = H.ui.InfoBubble;\n\nexport type MapUtilEvent = H.util.Event;\n\nexport type Position = {\n lat: number;\n lng: number;\n};\n\nexport type BoundingBox = {\n top: number;\n bottom: number;\n left: number;\n right: number;\n};\n\nexport type MapBoundingBox = {\n topLeft: {\n lng: number | undefined;\n lat: number | undefined;\n };\n bottomRight: {\n lng: number | undefined;\n lat: number | undefined;\n };\n};\n\nexport const MapTypeMap = {\n TYPE_DEFAULT: 'DEFAULT',\n TYPE_FLEET_STYLE: 'FLEET_STYLE',\n TYPE_SATELLITE: 'SATELLITE',\n TYPE_TERRAIN: 'TERRAIN',\n TYPE_NIGHT: 'NIGHT',\n} as const;\n\nexport type MapType = ObjectValues<typeof MapTypeMap>;\n\nexport const MapLayerMap = {\n MAP_LAYER_INCIDENTS: 'INCIDENTS',\n MAP_LAYER_TRAFFIC: 'TRAFFIC',\n MAP_LAYER_ROAD_RESTRICTIONS: 'ROAD_RESTRICTIONS',\n} as const;\n\nexport type MapLayer = ObjectValues<typeof MapLayerMap>;\n\nexport type MapCredentials = {\n app_id?: string;\n app_code?: string;\n /**\n * HERE Maps API key. Production map views require project-specific HERE credentials.\n */\n apikey?: string;\n};\n\nexport type MapProps = {\n /**\n * HERE credentials used to initialize the map platform.\n *\n * Production map views require a valid HERE API key. Read the Map - Getting started\n * documentation before using Map and pass project-specific\n * credentials, for example `{ apikey: '...' }`.\n */\n credentials: MapCredentials;\n\n /**\n * Height of the map container.\n */\n height?: number;\n\n /**\n * Width of the map container.\n */\n width?: number;\n\n /**\n * Language used for HERE map labels and controls.\n *\n * @default 'en'\n */\n language?: string;\n\n /**\n * Initial center position of the map.\n */\n center?: Position;\n\n /**\n * Initial or controlled zoom level of the map.\n */\n zoom?: number;\n\n /**\n * Bounding box that should be fitted by the map view.\n */\n boundingBox?: BoundingBox;\n\n /**\n * Disables HERE map events entirely.\n */\n disableMapEvents?: boolean;\n\n /**\n * Disables the default HERE map behavior such as pan and zoom interaction.\n *\n * @default false\n */\n disableBehavior?: boolean;\n\n /**\n * Disables HERE zoom momentum to reduce scroll inertia on zoom.\n *\n * @default true\n */\n disableZoomMomentum?: boolean;\n\n /**\n * Event listeners attached to the HERE map instance.\n */\n eventListenerMap?: EventListenerMap;\n\n /**\n * Legacy prop for hiding map settings.\n */\n hideMapSettings?: boolean;\n\n /**\n * Hides the cluster settings entry in the map settings UI.\n *\n * @default false\n */\n hideClusterSettings?: boolean;\n\n /**\n * Hides the map layer settings entry in the map settings UI.\n *\n * @default false\n */\n hideMapLayerSettings?: boolean;\n\n /**\n * Base map type to render.\n *\n * @default Map.TYPE_DEFAULT\n */\n mapType?: MapType;\n\n /**\n * Active overlay layers such as traffic or incidents.\n *\n * @default []\n */\n mapLayer?: MapLayer[];\n\n /**\n * Controls whether marker clustering is enabled.\n *\n * @default true\n */\n showCluster?: boolean;\n\n /**\n * Shows the HERE scale bar.\n *\n * @default false\n */\n showScaleBar?: boolean;\n\n /**\n * Callback fired when the map type changes.\n */\n onMapTypeChange?: (type: MapType, previousType?: MapType) => void;\n\n /**\n * Callback fired when the active map layers change.\n */\n onMapLayerChange?: (activeLayer: MapLayer[], previousLayer?: MapLayer[]) => void;\n\n /**\n * Callback fired when the cluster visibility changes.\n */\n onShowClusterChange?: (show: boolean) => void;\n\n /**\n * Callback fired when zooming in via the built-in zoom controls.\n */\n onZoomIn?: (zoom: number) => void;\n\n /**\n * Callback fired when zooming out via the built-in zoom controls.\n */\n onZoomOut?: (zoom: number) => void;\n\n /**\n * Callback used by incidents overlays to report fetched incidents.\n */\n onIncidentsChange?: (incidentsResult: MapIncidents) => void;\n\n /**\n * Tooltip content for the map settings entry.\n */\n mapSettingsTooltip?: string | React.ReactNode;\n\n /**\n * Custom settings UI rendered on top of the map.\n */\n mapSettings?: React.ReactNode;\n\n /**\n * Enables animation when zoom or center changes are applied programmatically.\n *\n * @default false\n */\n zoomAnimation?: boolean;\n\n /**\n * Maximum number of previous map viewports stored for viewport history.\n *\n * @default 5\n */\n maxViewportHistoryEntries?: number;\n\n /**\n * Enables the WebGL/HARP rendering engine where supported.\n *\n * @default true\n */\n enableWebGL?: boolean;\n\n /**\n * Uses `window.devicePixelRatio` for map rendering.\n *\n * @default true\n */\n enableDevicePixelRatio?: boolean;\n\n /**\n * Enables caching for generated marker icons.\n *\n * @default true\n */\n enableMarkerIconCache?: boolean;\n\n /**\n * Keeps HERE fractional zoom enabled for smoother trackpad and wheel zoom interaction.\n *\n * @default false\n */\n enableFractionalZoom?: boolean;\n\n /**\n * Temporarily disables marker pointer events during zoom interactions to reduce DOM hit-testing overhead.\n *\n * @default false\n */\n disableMarkerPointerEventsWhileZooming?: boolean;\n\n /**\n * Fallback pixel ratio used when device pixel ratio support is disabled.\n */\n pixelRatio?: number;\n\n /**\n * Minimum allowed zoom level.\n */\n minZoom?: number;\n\n /**\n * Maximum allowed zoom level.\n */\n maxZoom?: number;\n\n /**\n * Map content or a render function receiving the map API.\n */\n children?: React.ReactNode | ((api: MapApi, incidents?: MapIncidents) => React.ReactNode);\n};\n\nexport type MapApi = {\n credentials?: MapCredentials;\n defaultLayers?: H.service.DefaultLayers;\n map?: H.Map;\n mapEvents?: false | H.mapevents.MapEvents;\n behavior?: false | H.mapevents.Behavior;\n platform?: H.service.Platform;\n ui?: H.ui.UI;\n utils?: MapUtils;\n group?: H.map.Group;\n settings?: {\n enableWebGL?: boolean;\n baseLayer?: MapType;\n activeLayers?: MapLayer[];\n showCluster?: boolean;\n minZoom?: number;\n maxZoom?: number;\n };\n};\n\nexport type MapIncidents = {\n sourceUpdated: string;\n results: IncidentDataPoint[];\n};\n\nexport type Incidents = {\n sourceUpdated: string;\n results: Incident[];\n};\n\nexport type IncidentLocationPoint = {\n length: number;\n points: Position[];\n};\n\nexport type IncidentLocationShape = {\n links: IncidentLocationPoint[];\n};\n\nexport type Incident = {\n incidentDetails: IncidentDetails;\n location: {\n length: number;\n shape: IncidentLocationShape;\n };\n};\n\nexport type IncidentDetails = {\n id: string;\n hrn: string;\n originalId: string;\n originalHrn: string;\n startTime: string;\n endTime: string;\n entryTime: string;\n roadClosed: boolean;\n criticality: 'minor' | 'major' | 'critical';\n type: 'roadClosure' | 'construction' | 'roadHazard' | 'other';\n codes: number[];\n comment: string | undefined;\n description: {\n value: string;\n language?: string;\n };\n summary: {\n value: string;\n language?: string;\n };\n junctionTraversability: string;\n};\n\n// https://www.here.com/docs/bundle/traffic-api-developer-guide-v7/page/topics/concepts/incidents.html#incidents\nexport type IncidentDataPoint = {\n id: string;\n tooltipContent: string;\n criticality: 'low' | 'minor' | 'major' | 'critical';\n description: {\n value: string;\n language?: string;\n };\n summary: {\n value: string;\n language?: string;\n };\n comment: string | undefined;\n type:\n | 'accident'\n | 'construction'\n | 'congestion'\n | 'roadHazard'\n | 'roadClosure'\n | 'disabledVehicle'\n | 'massTransit'\n | 'plannedEvent'\n | 'weather'\n | 'laneRestriction'\n | 'other';\n startTime: string;\n endTime: string;\n roadClosed: boolean;\n position: Position;\n};\n\nexport const markerColorOptions = [\n 'bg-map-marker-asset',\n 'bg-map-marker-poi',\n 'bg-map-marker-geofence',\n 'bg-map-marker-route',\n 'bg-map-marker-info',\n 'bg-map-marker-success',\n 'bg-map-marker-warning',\n 'bg-map-marker-danger',\n 'bg-map-marker-restrictions',\n] as const;\n\nexport type MarkerColor = (typeof markerColorOptions)[number];\n\nexport const markerColorMapping: Record<MarkerColor, string> = {\n 'bg-map-marker-asset': '--color-map-marker-asset',\n 'bg-map-marker-poi': '--color-map-marker-poi',\n 'bg-map-marker-geofence': '--color-map-marker-geofence',\n 'bg-map-marker-route': '--color-map-marker-route',\n 'bg-map-marker-info': '--color-map-marker-info',\n 'bg-map-marker-success': '--color-map-marker-success',\n 'bg-map-marker-warning': '--color-map-marker-warning',\n 'bg-map-marker-danger': '--color-map-marker-danger',\n 'bg-map-marker-restrictions': '--color-map-marker-restrictions',\n};\n"],"names":["MapTypeMap","MapLayerMap","markerColorOptions","markerColorMapping"],"mappings":"AAwCO,MAAMA,IAAa;AAAA,EACtB,cAAc;AAAA,EACd,kBAAkB;AAAA,EAClB,gBAAgB;AAAA,EAChB,cAAc;AAAA,EACd,YAAY;AAChB,GAIaC,IAAc;AAAA,EACvB,qBAAqB;AAAA,EACrB,mBAAmB;AAAA,EACnB,6BAA6B;AACjC,GAmVaC,IAAqB;AAAA,EAC9B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACJ,GAIaC,IAAkD;AAAA,EAC3D,uBAAuB;AAAA,EACvB,qBAAqB;AAAA,EACrB,0BAA0B;AAAA,EAC1B,uBAAuB;AAAA,EACvB,sBAAsB;AAAA,EACtB,yBAAyB;AAAA,EACzB,yBAAyB;AAAA,EACzB,wBAAwB;AAAA,EACxB,8BAA8B;AAClC;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
const h = () => window.devicePixelRatio >= 1.7 ? 200 : 100, u = (r, e) => r && e !==
|
|
1
|
+
import { MAP_TYPE_DEFAULT as M, MAP_TYPE_NIGHT as p, MAP_TYPE_FLEET_STYLE as _, MAP_TYPE_TERRAIN as v, MAP_TYPE_SATELLITE as A, ENGINE_TYPE_HARP as d, ENGINE_TYPE_P2D as l, DEFAULT_RASTER_LAYER_FORMAT as L } from "../components/constants.js";
|
|
2
|
+
const h = () => window.devicePixelRatio >= 1.7 ? 200 : 100, u = (r, e) => r && e !== v && e !== _, w = (r) => (
|
|
3
3
|
// Initiate and authenticate your connection to the HERE platform:
|
|
4
4
|
new H.service.Platform({
|
|
5
5
|
apikey: r.apikey ?? "",
|
|
@@ -22,8 +22,8 @@ const h = () => window.devicePixelRatio >= 1.7 ? 200 : 100, u = (r, e) => r && e
|
|
|
22
22
|
}
|
|
23
23
|
}), S = (r, e) => {
|
|
24
24
|
switch (r) {
|
|
25
|
-
case v:
|
|
26
25
|
case _:
|
|
26
|
+
case v:
|
|
27
27
|
return l;
|
|
28
28
|
default:
|
|
29
29
|
return e ? d : l;
|
|
@@ -71,7 +71,7 @@ const h = () => window.devicePixelRatio >= 1.7 ? 200 : 100, u = (r, e) => r && e
|
|
|
71
71
|
)
|
|
72
72
|
};
|
|
73
73
|
}
|
|
74
|
-
case
|
|
74
|
+
case v:
|
|
75
75
|
return {
|
|
76
76
|
baseLayer: P(
|
|
77
77
|
E(t, "topo.day", T, s),
|
|
@@ -80,7 +80,7 @@ const h = () => window.devicePixelRatio >= 1.7 ? 200 : 100, u = (r, e) => r && e
|
|
|
80
80
|
c
|
|
81
81
|
)
|
|
82
82
|
};
|
|
83
|
-
case
|
|
83
|
+
case _:
|
|
84
84
|
return {
|
|
85
85
|
baseLayer: P(
|
|
86
86
|
E(t, "logistics.day", T, s),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NumberControl.js","sources":["../../../src/components/numberControl/NumberControl.tsx"],"sourcesContent":["import { useState, useRef, useEffect, forwardRef, type ForwardedRef } from 'react';\nimport { noop } from 'es-toolkit/function';\n\nimport classNames from '../../utils/classNames';\nimport NumberInput, {\n DEFAULT_STEP,\n DEFAULT_MIN,\n DEFAULT_MAX,\n DEFAULT_VALUE,\n convertNonIntegerToDefault,\n type NumberInputProps,\n} from '../numberInput/NumberInput';\n\nconst INITIAL_TICK = 700;\nconst TICK_TIME = 50;\n\nconst DEFAULT_DIGIT_PRECISION = 3;\n\nexport type NumberControlProps = NumberInputProps;\n\nconst NumberControl = forwardRef((props: NumberControlProps, ref: ForwardedRef<HTMLInputElement>) => {\n const {\n id,\n min = DEFAULT_MIN,\n max = DEFAULT_MAX,\n step = DEFAULT_STEP,\n value,\n onChange,\n onKeyDown = noop,\n disabled,\n bsSize,\n className,\n unit,\n inputAddon,\n errorMessage,\n warningMessage,\n messageWhiteSpace,\n digitPrecision = DEFAULT_DIGIT_PRECISION,\n placeholder,\n noDefault,\n ...remainingProps\n } = props;\n\n const timeout = useRef<NodeJS.Timeout | null>(null);\n\n const [isHoldingDownInc, setIsHoldingDownInc] = useState(false);\n const [isHoldingDownDec, setIsHoldingDownDec] = useState(false);\n const [internalValue, setInternalValue] = useState(value);\n\n const initialTimeout = (callbackFn: VoidFunction) => {\n if (timeout.current !== null) {\n clearTimeout(timeout.current);\n }\n timeout.current = setTimeout(() => {\n callbackFn();\n }, INITIAL_TICK);\n };\n\n const recursiveTimeout = (callbackFn: VoidFunction) => {\n timeout.current = setTimeout(() => {\n callbackFn();\n }, TICK_TIME);\n };\n\n // Update internal state if external value has changed\n useEffect(() => {\n if (internalValue !== value) {\n setInternalValue(value);\n }\n }, [value]);\n\n // Notify external component if internal value has changed\n useEffect(() => {\n if (internalValue !== value && onChange) {\n onChange(internalValue);\n }\n }, [internalValue]);\n\n useEffect(() => {\n // Call increment function for a loop when button is holding down\n if (isHoldingDownInc && !disabled) {\n initialTimeout(incrementRecursively);\n }\n\n // Call decrement function for a loop when button is holding down\n if (isHoldingDownDec && !disabled) {\n initialTimeout(decrementRecursively);\n }\n }, [isHoldingDownInc, isHoldingDownDec]);\n\n const incrementInternalValue = () => {\n setInternalValue(val => {\n const currentValue = convertNonIntegerToDefault(val, DEFAULT_VALUE);\n const newValue = Number((currentValue + step).toFixed(digitPrecision));\n const newValueLimited = newValue <= max ? newValue : val;\n return newValueLimited;\n });\n };\n\n const decrementInternalValue = () => {\n setInternalValue(val => {\n const currentValue = convertNonIntegerToDefault(val, DEFAULT_VALUE);\n const newValue = Number((currentValue - step).toFixed(digitPrecision));\n const newValueLimited = newValue >= min ? newValue : val;\n return newValueLimited;\n });\n };\n\n const incrementRecursively = () => {\n incrementInternalValue();\n recursiveTimeout(incrementRecursively);\n };\n\n const decrementRecursively = () => {\n decrementInternalValue();\n recursiveTimeout(decrementRecursively);\n };\n\n const handleMouseDownOnIncrement = () => {\n if (disabled) {\n return;\n }\n setIsHoldingDownInc(true);\n\n // increment for first click\n incrementInternalValue();\n };\n\n const handleMouseDownOnDecrement = () => {\n if (disabled) {\n return;\n }\n setIsHoldingDownDec(true);\n\n // decrement for first click\n decrementInternalValue();\n };\n\n const handleStopHolding = () => {\n if (timeout.current !== null) {\n clearTimeout(timeout.current);\n }\n setIsHoldingDownInc(false);\n setIsHoldingDownDec(false);\n };\n\n const handleUpdatedNumberInputValue = (newValue: number | undefined) => {\n // Set the internal value when the value of the actual input has changed,\n // for instance the user has typed in a number manually and to\n // use this number as base to increase or decrease from.\n // Ignore empty value in case the user has removed it\n if (newValue !== undefined && !(isHoldingDownDec && isHoldingDownInc)) {\n setInternalValue(Number(newValue));\n }\n onChange?.(newValue);\n };\n\n const classes = classNames('NumberControl', className);\n\n const controls = (\n <div className='display-flex padding-left-10' onMouseOut={handleStopHolding} onBlur={handleStopHolding}>\n <div\n onMouseDown={handleMouseDownOnDecrement}\n onMouseUp={handleStopHolding}\n role='button'\n aria-label='decrement-button'\n className='decrementButton display-flex align-items-center text-color-gray hover-text-color-dark cursor-pointer'\n >\n <div className='rioglyph rioglyph-minus scale-90' />\n </div>\n <div\n onMouseDown={handleMouseDownOnIncrement}\n onMouseUp={handleStopHolding}\n role='button'\n aria-label='increment-button'\n className='incrementButton display-flex align-items-center text-color-gray hover-text-color-dark cursor-pointer margin-left-5'\n >\n <div className='rioglyph rioglyph-plus scale-90' />\n </div>\n </div>\n );\n\n return (\n <div {...remainingProps} className={classes}>\n <NumberInput\n id={id}\n ref={ref}\n min={min}\n max={max}\n value={internalValue}\n step={step}\n bsSize={bsSize}\n disabled={disabled}\n inputAddon={inputAddon}\n errorMessage={errorMessage}\n warningMessage={warningMessage}\n messageWhiteSpace={messageWhiteSpace}\n controls={controls}\n unit={unit}\n onChange={handleUpdatedNumberInputValue}\n onKeyDown={onKeyDown}\n digitPrecision={digitPrecision}\n placeholder={placeholder}\n noDefault={noDefault}\n />\n </div>\n );\n});\n\nexport default NumberControl;\n"],"names":["INITIAL_TICK","TICK_TIME","DEFAULT_DIGIT_PRECISION","NumberControl","forwardRef","props","ref","id","min","DEFAULT_MIN","max","DEFAULT_MAX","step","DEFAULT_STEP","value","onChange","onKeyDown","noop","disabled","bsSize","className","unit","inputAddon","errorMessage","warningMessage","messageWhiteSpace","digitPrecision","placeholder","noDefault","remainingProps","timeout","useRef","isHoldingDownInc","setIsHoldingDownInc","useState","isHoldingDownDec","setIsHoldingDownDec","internalValue","setInternalValue","initialTimeout","callbackFn","recursiveTimeout","useEffect","incrementRecursively","decrementRecursively","incrementInternalValue","val","currentValue","convertNonIntegerToDefault","DEFAULT_VALUE","newValue","decrementInternalValue","handleMouseDownOnIncrement","handleMouseDownOnDecrement","handleStopHolding","handleUpdatedNumberInputValue","classes","classNames","jsx","NumberInput"],"mappings":"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"}
|
|
1
|
+
{"version":3,"file":"NumberControl.js","sources":["../../../src/components/numberControl/NumberControl.tsx"],"sourcesContent":["import { useState, useRef, useEffect, forwardRef, type ForwardedRef } from 'react';\nimport { noop } from 'es-toolkit/function';\n\nimport classNames from '../../utils/classNames';\nimport NumberInput, {\n DEFAULT_STEP,\n DEFAULT_MIN,\n DEFAULT_MAX,\n DEFAULT_VALUE,\n convertNonIntegerToDefault,\n type NumberInputProps,\n} from '../numberInput/NumberInput';\n\nconst INITIAL_TICK = 700;\nconst TICK_TIME = 50;\n\nconst DEFAULT_DIGIT_PRECISION = 3;\n\nexport type NumberControlProps = NumberInputProps;\n\nconst NumberControl = forwardRef((props: NumberControlProps, ref: ForwardedRef<HTMLInputElement>) => {\n const {\n id,\n min = DEFAULT_MIN,\n max = DEFAULT_MAX,\n step = DEFAULT_STEP,\n value,\n onChange,\n onKeyDown = noop,\n disabled,\n bsSize,\n className,\n unit,\n inputAddon,\n errorMessage,\n warningMessage,\n messageWhiteSpace,\n digitPrecision = DEFAULT_DIGIT_PRECISION,\n placeholder,\n noDefault,\n ...remainingProps\n } = props;\n\n const timeout = useRef<number | null>(null);\n\n const [isHoldingDownInc, setIsHoldingDownInc] = useState(false);\n const [isHoldingDownDec, setIsHoldingDownDec] = useState(false);\n const [internalValue, setInternalValue] = useState(value);\n\n const initialTimeout = (callbackFn: VoidFunction) => {\n if (timeout.current !== null) {\n clearTimeout(timeout.current);\n }\n timeout.current = setTimeout(() => {\n callbackFn();\n }, INITIAL_TICK);\n };\n\n const recursiveTimeout = (callbackFn: VoidFunction) => {\n timeout.current = setTimeout(() => {\n callbackFn();\n }, TICK_TIME);\n };\n\n // Update internal state if external value has changed\n useEffect(() => {\n if (internalValue !== value) {\n setInternalValue(value);\n }\n }, [value]);\n\n // Notify external component if internal value has changed\n useEffect(() => {\n if (internalValue !== value && onChange) {\n onChange(internalValue);\n }\n }, [internalValue]);\n\n useEffect(() => {\n // Call increment function for a loop when button is holding down\n if (isHoldingDownInc && !disabled) {\n initialTimeout(incrementRecursively);\n }\n\n // Call decrement function for a loop when button is holding down\n if (isHoldingDownDec && !disabled) {\n initialTimeout(decrementRecursively);\n }\n }, [isHoldingDownInc, isHoldingDownDec]);\n\n const incrementInternalValue = () => {\n setInternalValue(val => {\n const currentValue = convertNonIntegerToDefault(val, DEFAULT_VALUE);\n const newValue = Number((currentValue + step).toFixed(digitPrecision));\n const newValueLimited = newValue <= max ? newValue : val;\n return newValueLimited;\n });\n };\n\n const decrementInternalValue = () => {\n setInternalValue(val => {\n const currentValue = convertNonIntegerToDefault(val, DEFAULT_VALUE);\n const newValue = Number((currentValue - step).toFixed(digitPrecision));\n const newValueLimited = newValue >= min ? newValue : val;\n return newValueLimited;\n });\n };\n\n const incrementRecursively = () => {\n incrementInternalValue();\n recursiveTimeout(incrementRecursively);\n };\n\n const decrementRecursively = () => {\n decrementInternalValue();\n recursiveTimeout(decrementRecursively);\n };\n\n const handleMouseDownOnIncrement = () => {\n if (disabled) {\n return;\n }\n setIsHoldingDownInc(true);\n\n // increment for first click\n incrementInternalValue();\n };\n\n const handleMouseDownOnDecrement = () => {\n if (disabled) {\n return;\n }\n setIsHoldingDownDec(true);\n\n // decrement for first click\n decrementInternalValue();\n };\n\n const handleStopHolding = () => {\n if (timeout.current !== null) {\n clearTimeout(timeout.current);\n }\n setIsHoldingDownInc(false);\n setIsHoldingDownDec(false);\n };\n\n const handleUpdatedNumberInputValue = (newValue: number | undefined) => {\n // Set the internal value when the value of the actual input has changed,\n // for instance the user has typed in a number manually and to\n // use this number as base to increase or decrease from.\n // Ignore empty value in case the user has removed it\n if (newValue !== undefined && !(isHoldingDownDec && isHoldingDownInc)) {\n setInternalValue(Number(newValue));\n }\n onChange?.(newValue);\n };\n\n const classes = classNames('NumberControl', className);\n\n const controls = (\n <div className='display-flex padding-left-10' onMouseOut={handleStopHolding} onBlur={handleStopHolding}>\n <div\n onMouseDown={handleMouseDownOnDecrement}\n onMouseUp={handleStopHolding}\n role='button'\n aria-label='decrement-button'\n className='decrementButton display-flex align-items-center text-color-gray hover-text-color-dark cursor-pointer'\n >\n <div className='rioglyph rioglyph-minus scale-90' />\n </div>\n <div\n onMouseDown={handleMouseDownOnIncrement}\n onMouseUp={handleStopHolding}\n role='button'\n aria-label='increment-button'\n className='incrementButton display-flex align-items-center text-color-gray hover-text-color-dark cursor-pointer margin-left-5'\n >\n <div className='rioglyph rioglyph-plus scale-90' />\n </div>\n </div>\n );\n\n return (\n <div {...remainingProps} className={classes}>\n <NumberInput\n id={id}\n ref={ref}\n min={min}\n max={max}\n value={internalValue}\n step={step}\n bsSize={bsSize}\n disabled={disabled}\n inputAddon={inputAddon}\n errorMessage={errorMessage}\n warningMessage={warningMessage}\n messageWhiteSpace={messageWhiteSpace}\n controls={controls}\n unit={unit}\n onChange={handleUpdatedNumberInputValue}\n onKeyDown={onKeyDown}\n digitPrecision={digitPrecision}\n placeholder={placeholder}\n noDefault={noDefault}\n />\n </div>\n );\n});\n\nexport default NumberControl;\n"],"names":["INITIAL_TICK","TICK_TIME","DEFAULT_DIGIT_PRECISION","NumberControl","forwardRef","props","ref","id","min","DEFAULT_MIN","max","DEFAULT_MAX","step","DEFAULT_STEP","value","onChange","onKeyDown","noop","disabled","bsSize","className","unit","inputAddon","errorMessage","warningMessage","messageWhiteSpace","digitPrecision","placeholder","noDefault","remainingProps","timeout","useRef","isHoldingDownInc","setIsHoldingDownInc","useState","isHoldingDownDec","setIsHoldingDownDec","internalValue","setInternalValue","initialTimeout","callbackFn","recursiveTimeout","useEffect","incrementRecursively","decrementRecursively","incrementInternalValue","val","currentValue","convertNonIntegerToDefault","DEFAULT_VALUE","newValue","decrementInternalValue","handleMouseDownOnIncrement","handleMouseDownOnDecrement","handleStopHolding","handleUpdatedNumberInputValue","classes","classNames","jsx","NumberInput"],"mappings":"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"}
|
|
@@ -3,6 +3,8 @@ export type PageProps = {
|
|
|
3
3
|
/**
|
|
4
4
|
* Defines the width in pixel of the page. In landscape mode, the width is set as height.
|
|
5
5
|
* The component uses internally the aspect-ratio of a standard DIN A4 page.
|
|
6
|
+
* Use Page for UI that should visually resemble a real document sheet, such as an invoice,
|
|
7
|
+
* delivery note, shipping document, certificate or print preview.
|
|
6
8
|
* Please make sure the element does not get stretched when using flexbox.
|
|
7
9
|
*/
|
|
8
10
|
width: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Page.js","sources":["../../../src/components/page/Page.tsx"],"sourcesContent":["import type React from 'react';\nimport type { PropsWithChildren } from 'react';\n\nimport classNames from '../../utils/classNames';\n\nexport type PageProps = {\n /**\n * Defines the width in pixel of the page. In landscape mode, the width is set as height.\n * The component uses internally the aspect-ratio of a standard DIN A4 page.\n * Please make sure the element does not get stretched when using flexbox.\n */\n width: number;\n\n /**\n * Defines the layout of the page\n *\n * @default 'portrait'\n */\n orientation?: 'portrait' | 'landscape';\n\n /**\n * Defines to use a pre-defined shadow style. May be disabled on white background.\n *\n * @default true\n */\n shadow?: boolean;\n\n /**\n * Defines to use a pre-defined border style. This may be used to render\n * the page on a white background of as part of another element like a panel.\n */\n border?: boolean;\n\n /**\n * Additional classes to be set on the wrapper element\n */\n className?: string;\n};\n\nconst Page = (props: PropsWithChildren<PageProps>) => {\n const { className, width, orientation = 'portrait', shadow = true, border = false, children } = props;\n\n const wrapperClassNames = classNames(\n 'Page',\n orientation,\n shadow && 'shadow-hard',\n border && 'border border-width-2',\n className\n );\n\n const isPortrait = orientation === 'portrait';\n\n const style: React.CSSProperties = {};\n\n if (width && isPortrait) {\n style.width = `${width}px`;\n }\n\n if (width && !isPortrait) {\n style.height = `${width}px`;\n }\n\n return (\n <div className={wrapperClassNames} style={style}>\n {children}\n </div>\n );\n};\n\nexport default Page;\n"],"names":["Page","props","className","width","orientation","shadow","border","children","wrapperClassNames","classNames","isPortrait","style","jsx"],"mappings":";;
|
|
1
|
+
{"version":3,"file":"Page.js","sources":["../../../src/components/page/Page.tsx"],"sourcesContent":["import type React from 'react';\nimport type { PropsWithChildren } from 'react';\n\nimport classNames from '../../utils/classNames';\n\nexport type PageProps = {\n /**\n * Defines the width in pixel of the page. In landscape mode, the width is set as height.\n * The component uses internally the aspect-ratio of a standard DIN A4 page.\n * Use Page for UI that should visually resemble a real document sheet, such as an invoice,\n * delivery note, shipping document, certificate or print preview.\n * Please make sure the element does not get stretched when using flexbox.\n */\n width: number;\n\n /**\n * Defines the layout of the page\n *\n * @default 'portrait'\n */\n orientation?: 'portrait' | 'landscape';\n\n /**\n * Defines to use a pre-defined shadow style. May be disabled on white background.\n *\n * @default true\n */\n shadow?: boolean;\n\n /**\n * Defines to use a pre-defined border style. This may be used to render\n * the page on a white background of as part of another element like a panel.\n */\n border?: boolean;\n\n /**\n * Additional classes to be set on the wrapper element\n */\n className?: string;\n};\n\nconst Page = (props: PropsWithChildren<PageProps>) => {\n const { className, width, orientation = 'portrait', shadow = true, border = false, children } = props;\n\n const wrapperClassNames = classNames(\n 'Page',\n orientation,\n shadow && 'shadow-hard',\n border && 'border border-width-2',\n className\n );\n\n const isPortrait = orientation === 'portrait';\n\n const style: React.CSSProperties = {};\n\n if (width && isPortrait) {\n style.width = `${width}px`;\n }\n\n if (width && !isPortrait) {\n style.height = `${width}px`;\n }\n\n return (\n <div className={wrapperClassNames} style={style}>\n {children}\n </div>\n );\n};\n\nexport default Page;\n"],"names":["Page","props","className","width","orientation","shadow","border","children","wrapperClassNames","classNames","isPortrait","style","jsx"],"mappings":";;AAyCA,MAAMA,IAAO,CAACC,MAAwC;AAClD,QAAM,EAAE,WAAAC,GAAW,OAAAC,GAAO,aAAAC,IAAc,YAAY,QAAAC,IAAS,IAAM,QAAAC,IAAS,IAAO,UAAAC,EAAA,IAAaN,GAE1FO,IAAoBC;AAAA,IACtB;AAAA,IACAL;AAAA,IACAC,KAAU;AAAA,IACVC,KAAU;AAAA,IACVJ;AAAA,EAAA,GAGEQ,IAAaN,MAAgB,YAE7BO,IAA6B,CAAA;AAEnC,SAAIR,KAASO,MACTC,EAAM,QAAQ,GAAGR,CAAK,OAGtBA,KAAS,CAACO,MACVC,EAAM,SAAS,GAAGR,CAAK,OAIvB,gBAAAS,EAAC,OAAA,EAAI,WAAWJ,GAAmB,OAAAG,GAC9B,UAAAJ,GACL;AAER;"}
|
|
@@ -2,7 +2,10 @@ import { RioglyphIconType } from './RioglyphIconType';
|
|
|
2
2
|
export type IconType = RioglyphIconType;
|
|
3
3
|
export type RioglyphProps = {
|
|
4
4
|
/**
|
|
5
|
-
* The
|
|
5
|
+
* The RIOglyph icon class name OR an external .svg link.
|
|
6
|
+
*
|
|
7
|
+
* Use only exact existing `rioglyph-*` classes from the generated UIKIT icon contract.
|
|
8
|
+
* Do not compose or guess semantic icon names; an unknown icon class renders as a filled rectangle.
|
|
6
9
|
*/
|
|
7
10
|
icon: IconType | string;
|
|
8
11
|
/**
|
|
@@ -50,7 +53,10 @@ export type RioglyphProps = {
|
|
|
50
53
|
*/
|
|
51
54
|
disabledInverse?: boolean;
|
|
52
55
|
/**
|
|
53
|
-
* The
|
|
56
|
+
* The RIOglyph icon class name OR an external .svg link.
|
|
57
|
+
*
|
|
58
|
+
* Use only exact existing `rioglyph-*` classes from the generated UIKIT icon contract.
|
|
59
|
+
* Do not compose or guess semantic icon names; an unknown icon class renders as a filled rectangle.
|
|
54
60
|
*/
|
|
55
61
|
pairIcon?: IconType | string;
|
|
56
62
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Rioglyph.js","sources":["../../../src/components/rioglyph/Rioglyph.tsx"],"sourcesContent":["import classNames from '../../utils/classNames';\nimport type { RioglyphIconType } from './RioglyphIconType';\n\nexport type IconType = RioglyphIconType;\n\nexport type RioglyphProps = {\n /**\n * The
|
|
1
|
+
{"version":3,"file":"Rioglyph.js","sources":["../../../src/components/rioglyph/Rioglyph.tsx"],"sourcesContent":["import classNames from '../../utils/classNames';\nimport type { RioglyphIconType } from './RioglyphIconType';\n\nexport type IconType = RioglyphIconType;\n\nexport type RioglyphProps = {\n /**\n * The RIOglyph icon class name OR an external .svg link.\n *\n * Use only exact existing `rioglyph-*` classes from the generated UIKIT icon contract.\n * Do not compose or guess semantic icon names; an unknown icon class renders as a filled rectangle.\n */\n icon: IconType | string;\n\n /**\n * Additional classes set to the icon span.\n */\n iconClassName?: string;\n\n /**\n * The size (text-size) of the icon\n */\n size?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | '10' | '11' | '12' | '14' | '16' | '18' | '20';\n\n /**\n * Spinning animation.\n * \n * @default false\n */\n spinning?: boolean;\n\n /**\n * Pulsing animation.\n * \n * @default false\n */\n pulsing?: boolean;\n\n /**\n * Filled style.\n * \n * @default false\n */\n filled?: boolean;\n\n /**\n * Add a disabled line\n * \n * @default false\n */\n disabled?: boolean;\n\n /**\n * Recolor the disabled line to the danger color.\n * \n * @default false\n */\n disabledDanger?: boolean;\n\n /**\n * Flip the disabled line.\n * \n * @default false\n */\n disabledInverse?: boolean;\n\n /**\n * The RIOglyph icon class name OR an external .svg link.\n *\n * Use only exact existing `rioglyph-*` classes from the generated UIKIT icon contract.\n * Do not compose or guess semantic icon names; an unknown icon class renders as a filled rectangle.\n */\n pairIcon?: IconType | string;\n\n /**\n * Additional classes set to the pairIcon span.\n */\n pairIconClassName?: string;\n};\n\nconst Rioglyph = (props: RioglyphProps) => {\n const {\n icon,\n iconClassName = '',\n pairIcon,\n pairIconClassName = '',\n size,\n spinning = false,\n pulsing = false,\n filled = false,\n disabled = false,\n disabledDanger = false,\n disabledInverse = false,\n } = props;\n\n const spinningClass = spinning ? 'spinning' : '';\n const pulsingClass = pulsing ? 'pulsing' : '';\n const filledClass = filled ? 'rioglyph-filled' : '';\n const disabledClass = disabled ? 'rioglyph-disabled' : '';\n const disabledDangerClass = disabledDanger ? 'rioglyph-disabled rioglyph-disabled-danger' : '';\n const disabledInverseClass = disabledInverse ? 'rioglyph-disabled rioglyph-disabled-inverse' : '';\n\n let iconStyle: React.CSSProperties | undefined;\n if (icon.includes('.svg')) {\n iconStyle = { '--i': `url(${icon})` } as React.CSSProperties;\n }\n\n if (pairIcon) {\n const wrapperClasses = classNames('rioglyph-icon-pair', size && `text-size-${size}`);\n const iconClasses = classNames('rioglyph', !icon.includes('.svg') && icon, iconClassName);\n const pairIconClasses = classNames(\n 'rioglyph',\n !pairIcon.includes('.svg') && pairIcon,\n pairIconClassName,\n spinningClass,\n pulsingClass\n );\n\n let pairIconStyle: React.CSSProperties | undefined;\n if (pairIcon?.includes('.svg')) {\n pairIconStyle = { '--i': `url(${pairIcon})` } as React.CSSProperties;\n }\n\n return (\n <span className={wrapperClasses}>\n <span className={iconClasses} style={iconStyle} />\n <span className={pairIconClasses} style={pairIconStyle} />\n </span>\n );\n }\n\n const iconClasses = classNames(\n 'rioglyph',\n !icon.includes('.svg') && icon,\n size && `text-size-${size}`,\n disabledClass,\n disabledDangerClass,\n disabledInverseClass,\n iconClassName,\n spinningClass,\n pulsingClass,\n filledClass\n );\n\n return <span className={iconClasses} style={iconStyle} />;\n};\n\nexport default Rioglyph;\n"],"names":["Rioglyph","props","icon","iconClassName","pairIcon","pairIconClassName","size","spinning","pulsing","filled","disabled","disabledDanger","disabledInverse","spinningClass","pulsingClass","filledClass","disabledClass","disabledDangerClass","disabledInverseClass","iconStyle","wrapperClasses","classNames","iconClasses","pairIconClasses","pairIconStyle","jsxs","jsx"],"mappings":";;AAgFA,MAAMA,IAAW,CAACC,MAAyB;AACvC,QAAM;AAAA,IACF,MAAAC;AAAA,IACA,eAAAC,IAAgB;AAAA,IAChB,UAAAC;AAAA,IACA,mBAAAC,IAAoB;AAAA,IACpB,MAAAC;AAAA,IACA,UAAAC,IAAW;AAAA,IACX,SAAAC,IAAU;AAAA,IACV,QAAAC,IAAS;AAAA,IACT,UAAAC,IAAW;AAAA,IACX,gBAAAC,IAAiB;AAAA,IACjB,iBAAAC,IAAkB;AAAA,EAAA,IAClBX,GAEEY,IAAgBN,IAAW,aAAa,IACxCO,IAAeN,IAAU,YAAY,IACrCO,IAAcN,IAAS,oBAAoB,IAC3CO,IAAgBN,IAAW,sBAAsB,IACjDO,IAAsBN,IAAiB,+CAA+C,IACtFO,IAAuBN,IAAkB,gDAAgD;AAE/F,MAAIO;AAKJ,MAJIjB,EAAK,SAAS,MAAM,MACpBiB,IAAY,EAAE,OAAO,OAAOjB,CAAI,IAAA,IAGhCE,GAAU;AACV,UAAMgB,IAAiBC,EAAW,sBAAsBf,KAAQ,aAAaA,CAAI,EAAE,GAC7EgB,IAAcD,EAAW,YAAY,CAACnB,EAAK,SAAS,MAAM,KAAKA,GAAMC,CAAa,GAClFoB,IAAkBF;AAAA,MACpB;AAAA,MACA,CAACjB,EAAS,SAAS,MAAM,KAAKA;AAAA,MAC9BC;AAAA,MACAQ;AAAA,MACAC;AAAA,IAAA;AAGJ,QAAIU;AACJ,WAAIpB,GAAU,SAAS,MAAM,MACzBoB,IAAgB,EAAE,OAAO,OAAOpB,CAAQ,IAAA,IAIxC,gBAAAqB,EAAC,QAAA,EAAK,WAAWL,GACb,UAAA;AAAA,MAAA,gBAAAM,EAAC,QAAA,EAAK,WAAWJ,GAAa,OAAOH,GAAW;AAAA,MAChD,gBAAAO,EAAC,QAAA,EAAK,WAAWH,GAAiB,OAAOC,EAAA,CAAe;AAAA,IAAA,GAC5D;AAAA,EAER;AAEA,QAAMF,IAAcD;AAAA,IAChB;AAAA,IACA,CAACnB,EAAK,SAAS,MAAM,KAAKA;AAAA,IAC1BI,KAAQ,aAAaA,CAAI;AAAA,IACzBU;AAAA,IACAC;AAAA,IACAC;AAAA,IACAf;AAAA,IACAU;AAAA,IACAC;AAAA,IACAC;AAAA,EAAA;AAGJ,SAAO,gBAAAW,EAAC,QAAA,EAAK,WAAWJ,GAAa,OAAOH,GAAW;AAC3D;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export type RioglyphIconType = 'rioglyph-academic-cap' | 'rioglyph-addressbook' | 'rioglyph-ai' | 'rioglyph-air-pay' | 'rioglyph-am' | 'rioglyph-angle-double-down' | 'rioglyph-angle-double-left' | 'rioglyph-angle-double-right' | 'rioglyph-angle-double-up' | 'rioglyph-antenna' | 'rioglyph-api' | 'rioglyph-archive' | 'rioglyph-area-chart' | 'rioglyph-area-in' | 'rioglyph-area-out' | 'rioglyph-arrow-down' | 'rioglyph-arrow-left' | 'rioglyph-arrow-right' | 'rioglyph-arrow-up' | 'rioglyph-arrows-collapse' | 'rioglyph-arrows-combine' | 'rioglyph-arrows-expand' | 'rioglyph-arrows-horizontal' | 'rioglyph-arrows-split' | 'rioglyph-assigned' | 'rioglyph-axis-x' | 'rioglyph-axis-y' | 'rioglyph-axis-z' | 'rioglyph-axle' | 'rioglyph-ban-circle' | 'rioglyph-bar-chart-box' | 'rioglyph-battery-charging' | 'rioglyph-battery-level-empty' | 'rioglyph-battery-level-full' | 'rioglyph-battery-level-low' | 'rioglyph-beacon' | 'rioglyph-big-bag' | 'rioglyph-book' | 'rioglyph-bookable-poi' | 'rioglyph-bookmark-square' | 'rioglyph-bookmark' | 'rioglyph-border-crossing' | 'rioglyph-box-open' | 'rioglyph-box' | 'rioglyph-brain' | 'rioglyph-brake' | 'rioglyph-branch-horizontal' | 'rioglyph-branch-remove' | 'rioglyph-branch-vertical' | 'rioglyph-broadcast' | 'rioglyph-building' | 'rioglyph-bulb' | 'rioglyph-bulk-container' | 'rioglyph-bus-baseline' | 'rioglyph-bus-breakdown' | 'rioglyph-bus' | 'rioglyph-businessman' | 'rioglyph-calendar-parking' | 'rioglyph-calendar-plus' | 'rioglyph-calendar-today' | 'rioglyph-calendar' | 'rioglyph-camera' | 'rioglyph-car-baseline' | 'rioglyph-car-wash' | 'rioglyph-car' | 'rioglyph-card-hotel' | 'rioglyph-card-reader' | 'rioglyph-cards-add' | 'rioglyph-cards-grid' | 'rioglyph-cards-list' | 'rioglyph-cards-table' | 'rioglyph-cargo' | 'rioglyph-carrier' | 'rioglyph-chat' | 'rioglyph-check-badge' | 'rioglyph-check-shield' | 'rioglyph-checkbox-checked' | 'rioglyph-checkbox' | 'rioglyph-checkboxes' | 'rioglyph-chevron-down' | 'rioglyph-chevron-left' | 'rioglyph-chevron-right' | 'rioglyph-chevron-up' | 'rioglyph-chip' | 'rioglyph-circle-dashed' | 'rioglyph-circle-stack' | 'rioglyph-click' | 'rioglyph-climate-control' | 'rioglyph-clipboard' | 'rioglyph-cloud-download' | 'rioglyph-cloud-not-saved' | 'rioglyph-cloud-progress' | 'rioglyph-cloud-upload' | 'rioglyph-cloud' | 'rioglyph-coasting' | 'rioglyph-code-braces' | 'rioglyph-code-brackets' | 'rioglyph-coffee' | 'rioglyph-cog' | 'rioglyph-coil' | 'rioglyph-color-swatch' | 'rioglyph-comment' | 'rioglyph-compare' | 'rioglyph-compass' | 'rioglyph-component-custom-recurrent' | 'rioglyph-component-custom' | 'rioglyph-component' | 'rioglyph-construction' | 'rioglyph-convert' | 'rioglyph-conveyor-belt' | 'rioglyph-cookie' | 'rioglyph-cooling' | 'rioglyph-cost-efficency' | 'rioglyph-cost-efficiency' | 'rioglyph-crown' | 'rioglyph-cruise-control' | 'rioglyph-csv' | 'rioglyph-cube-dashed' | 'rioglyph-cube' | 'rioglyph-currency-euro' | 'rioglyph-damages' | 'rioglyph-dangerousgoods' | 'rioglyph-dashboard-view' | 'rioglyph-dashboard' | 'rioglyph-delivery-completed' | 'rioglyph-delivery-error' | 'rioglyph-delivery-late' | 'rioglyph-delivery-on-track' | 'rioglyph-delivery-warning' | 'rioglyph-delivery' | 'rioglyph-design' | 'rioglyph-desktop' | 'rioglyph-detail-view-info' | 'rioglyph-detail-view' | 'rioglyph-direction' | 'rioglyph-discount-badge' | 'rioglyph-document-out' | 'rioglyph-document' | 'rioglyph-download' | 'rioglyph-drag-n-drop' | 'rioglyph-drive-history' | 'rioglyph-driver-card' | 'rioglyph-driver-off' | 'rioglyph-driver' | 'rioglyph-drivercard-in' | 'rioglyph-drivercard-out' | 'rioglyph-duplicate' | 'rioglyph-earphone' | 'rioglyph-emergency-stop' | 'rioglyph-empty' | 'rioglyph-engine' | 'rioglyph-envelope-indicator' | 'rioglyph-envelope-open' | 'rioglyph-envelope' | 'rioglyph-erase' | 'rioglyph-error-sign' | 'rioglyph-euro-note' | 'rioglyph-exclamation-sign' | 'rioglyph-exclamation' | 'rioglyph-eye-close' | 'rioglyph-eye-closed' | 'rioglyph-eye-open' | 'rioglyph-eye-option' | 'rioglyph-face-frown' | 'rioglyph-face-neutral' | 'rioglyph-face-smile' | 'rioglyph-facetime-video' | 'rioglyph-factory' | 'rioglyph-file-signature' | 'rioglyph-files' | 'rioglyph-fill' | 'rioglyph-filling-e-station' | 'rioglyph-filling-station' | 'rioglyph-filter-active' | 'rioglyph-filter-reset' | 'rioglyph-filter' | 'rioglyph-fingerprint' | 'rioglyph-finish' | 'rioglyph-fire' | 'rioglyph-flag' | 'rioglyph-flash' | 'rioglyph-folder-closed' | 'rioglyph-folder-open' | 'rioglyph-fuel-diesel' | 'rioglyph-fuel-electric' | 'rioglyph-fuel-gas' | 'rioglyph-fuel-hydrogen' | 'rioglyph-fuel-liquid' | 'rioglyph-fuel-mix' | 'rioglyph-fullscreen' | 'rioglyph-geofence' | 'rioglyph-get' | 'rioglyph-give' | 'rioglyph-globe-alt' | 'rioglyph-globe' | 'rioglyph-group-blocks' | 'rioglyph-group' | 'rioglyph-hand-down' | 'rioglyph-hand-left' | 'rioglyph-hand-right' | 'rioglyph-hand-up' | 'rioglyph-handshake' | 'rioglyph-hash' | 'rioglyph-heart' | 'rioglyph-heating' | 'rioglyph-hierarchy' | 'rioglyph-history' | 'rioglyph-home-sign' | 'rioglyph-home' | 'rioglyph-hour-glass' | 'rioglyph-id' | 'rioglyph-inbox-in' | 'rioglyph-inbox-out' | 'rioglyph-inbox-stack' | 'rioglyph-inbox' | 'rioglyph-info-sign' | 'rioglyph-info' | 'rioglyph-insert' | 'rioglyph-issue-tracking' | 'rioglyph-key' | 'rioglyph-kickdown' | 'rioglyph-language' | 'rioglyph-layer-pois' | 'rioglyph-layer' | 'rioglyph-leafs' | 'rioglyph-light-bulb' | 'rioglyph-line-chart' | 'rioglyph-link' | 'rioglyph-load-unload' | 'rioglyph-load' | 'rioglyph-location-arrow' | 'rioglyph-lock-open' | 'rioglyph-lock' | 'rioglyph-log-in' | 'rioglyph-logout' | 'rioglyph-looking-glass-man' | 'rioglyph-looking-glass' | 'rioglyph-magic-wand' | 'rioglyph-maintenance-components' | 'rioglyph-map-location' | 'rioglyph-map-marker' | 'rioglyph-map' | 'rioglyph-megaphone' | 'rioglyph-menu-hamburger' | 'rioglyph-merge' | 'rioglyph-mesh-box' | 'rioglyph-migrate' | 'rioglyph-milage' | 'rioglyph-minus-light' | 'rioglyph-minus-sign' | 'rioglyph-minus' | 'rioglyph-missing' | 'rioglyph-mode-dark-light' | 'rioglyph-more' | 'rioglyph-new-window' | 'rioglyph-newspaper' | 'rioglyph-note' | 'rioglyph-notification' | 'rioglyph-number-1' | 'rioglyph-number-2' | 'rioglyph-number-3' | 'rioglyph-off' | 'rioglyph-oil-can' | 'rioglyph-ok-circle' | 'rioglyph-ok-dashed' | 'rioglyph-ok-sign' | 'rioglyph-ok' | 'rioglyph-onboarding' | 'rioglyph-ongoing' | 'rioglyph-option-horizontal' | 'rioglyph-option-vertical' | 'rioglyph-order' | 'rioglyph-palette-broken' | 'rioglyph-palette-empty' | 'rioglyph-palette' | 'rioglyph-paper-clip' | 'rioglyph-parcel-broken' | 'rioglyph-parcel' | 'rioglyph-parking' | 'rioglyph-pause-circle' | 'rioglyph-pause' | 'rioglyph-pdf-file' | 'rioglyph-pencil-square' | 'rioglyph-pencil' | 'rioglyph-phone' | 'rioglyph-pictures' | 'rioglyph-pin-range' | 'rioglyph-pin' | 'rioglyph-play-circle' | 'rioglyph-play' | 'rioglyph-plugged-off' | 'rioglyph-plugged-on' | 'rioglyph-plus-light' | 'rioglyph-plus-sign' | 'rioglyph-plus' | 'rioglyph-pm' | 'rioglyph-poi' | 'rioglyph-polygon' | 'rioglyph-position' | 'rioglyph-print' | 'rioglyph-progress-ongoing' | 'rioglyph-progress-remaining' | 'rioglyph-progression' | 'rioglyph-prompt' | 'rioglyph-pto-off' | 'rioglyph-pto-on' | 'rioglyph-pushpin' | 'rioglyph-puzzle' | 'rioglyph-pylon' | 'rioglyph-qr-code' | 'rioglyph-question-sign' | 'rioglyph-question' | 'rioglyph-record' | 'rioglyph-recycle' | 'rioglyph-refresh' | 'rioglyph-remove-circle' | 'rioglyph-remove-sign' | 'rioglyph-remove' | 'rioglyph-repeat-square' | 'rioglyph-repeat' | 'rioglyph-resize-full' | 'rioglyph-resize-horizontal' | 'rioglyph-resize-small' | 'rioglyph-resize-vertical' | 'rioglyph-retrofit' | 'rioglyph-retweet' | 'rioglyph-revert' | 'rioglyph-rio-marker' | 'rioglyph-rio' | 'rioglyph-road-restrictions' | 'rioglyph-road' | 'rioglyph-robot' | 'rioglyph-rocket' | 'rioglyph-role-management' | 'rioglyph-roll-container' | 'rioglyph-route-option' | 'rioglyph-route-view' | 'rioglyph-route' | 'rioglyph-ruler' | 'rioglyph-satellite-radar' | 'rioglyph-save' | 'rioglyph-scale' | 'rioglyph-scan' | 'rioglyph-scissors' | 'rioglyph-search-list' | 'rioglyph-search-truck' | 'rioglyph-search' | 'rioglyph-send' | 'rioglyph-series' | 'rioglyph-server-stack' | 'rioglyph-settings' | 'rioglyph-share-alt' | 'rioglyph-share-nodes' | 'rioglyph-share' | 'rioglyph-shelve-empty' | 'rioglyph-shelve' | 'rioglyph-ship' | 'rioglyph-shopping-bag' | 'rioglyph-shopping-cart' | 'rioglyph-signature' | 'rioglyph-slope-down-max' | 'rioglyph-slope-down-min' | 'rioglyph-slope-up-max' | 'rioglyph-slope-up-min' | 'rioglyph-sort-by-attributes-alt' | 'rioglyph-sort-by-attributes' | 'rioglyph-sort' | 'rioglyph-sparkles' | 'rioglyph-speed' | 'rioglyph-sphere' | 'rioglyph-spinner' | 'rioglyph-split-view' | 'rioglyph-square-dashed' | 'rioglyph-stack-add' | 'rioglyph-stack-iso' | 'rioglyph-stack' | 'rioglyph-star-empty' | 'rioglyph-star' | 'rioglyph-stars' | 'rioglyph-start' | 'rioglyph-stats-high' | 'rioglyph-stats-line-dots' | 'rioglyph-stats-low' | 'rioglyph-stats-medium' | 'rioglyph-stats' | 'rioglyph-status-available' | 'rioglyph-status-change-horizontal' | 'rioglyph-status-change' | 'rioglyph-status-driving' | 'rioglyph-status-resting' | 'rioglyph-status-working' | 'rioglyph-steering-wheel' | 'rioglyph-stillage' | 'rioglyph-stopover' | 'rioglyph-support' | 'rioglyph-table-view' | 'rioglyph-tachograph-download' | 'rioglyph-tachograph' | 'rioglyph-tag' | 'rioglyph-tasks' | 'rioglyph-temperature' | 'rioglyph-th-list' | 'rioglyph-thumbs-down' | 'rioglyph-thumbs-up' | 'rioglyph-tickets' | 'rioglyph-time-alt' | 'rioglyph-time-cancle' | 'rioglyph-time-incomplete' | 'rioglyph-time' | 'rioglyph-tire' | 'rioglyph-tms' | 'rioglyph-to-bottom' | 'rioglyph-to-left' | 'rioglyph-to-right' | 'rioglyph-to-top' | 'rioglyph-tracking-package' | 'rioglyph-traffic-lights' | 'rioglyph-trailer-baseline' | 'rioglyph-trailer-liquid' | 'rioglyph-trailer-standard' | 'rioglyph-trailer-tipping' | 'rioglyph-trailer' | 'rioglyph-trailerposition' | 'rioglyph-train' | 'rioglyph-transfer' | 'rioglyph-transition-push-right' | 'rioglyph-transition-right' | 'rioglyph-trash' | 'rioglyph-triangle-bottom' | 'rioglyph-triangle-left' | 'rioglyph-triangle-right' | 'rioglyph-triangle-top' | 'rioglyph-trophy' | 'rioglyph-truck-baseline' | 'rioglyph-truck-breakdown' | 'rioglyph-truck-unit' | 'rioglyph-truck' | 'rioglyph-unassigned' | 'rioglyph-unavailable' | 'rioglyph-unlink' | 'rioglyph-upload' | 'rioglyph-user-add' | 'rioglyph-user-group' | 'rioglyph-user-ok' | 'rioglyph-user-remove' | 'rioglyph-user-sign-off' | 'rioglyph-user-sign' | 'rioglyph-user' | 'rioglyph-van-baseline' | 'rioglyph-van' | 'rioglyph-variable' | 'rioglyph-video-off' | 'rioglyph-video' | 'rioglyph-volume' | 'rioglyph-wallet' | 'rioglyph-warehouse' | 'rioglyph-warning-sign' | 'rioglyph-weather-cloudy' | 'rioglyph-weather-icy' | 'rioglyph-weather-overcast' | 'rioglyph-weather-raining' | 'rioglyph-weather-snowing' | 'rioglyph-weather-stormy' | 'rioglyph-weather-sunny' | 'rioglyph-weather-thundering' | 'rioglyph-weather-windy' | 'rioglyph-weight' | 'rioglyph-width' | 'rioglyph-wifi-off' | 'rioglyph-wifi' | 'rioglyph-window' | 'rioglyph-workflow-step' | 'rioglyph-workflow' | 'rioglyph-workshop' | 'rioglyph-wrench' | 'rioglyph-xmas-raindeer' | 'rioglyph-xmas-santa';
|
|
1
|
+
export type RioglyphIconType = 'rioglyph-academic-cap' | 'rioglyph-addressbook' | 'rioglyph-ai' | 'rioglyph-air-pay' | 'rioglyph-am' | 'rioglyph-angle-double-down' | 'rioglyph-angle-double-left' | 'rioglyph-angle-double-right' | 'rioglyph-angle-double-up' | 'rioglyph-antenna' | 'rioglyph-api' | 'rioglyph-archive' | 'rioglyph-area-chart' | 'rioglyph-area-in' | 'rioglyph-area-out' | 'rioglyph-arrow-down' | 'rioglyph-arrow-left' | 'rioglyph-arrow-right' | 'rioglyph-arrow-up' | 'rioglyph-arrows-collapse' | 'rioglyph-arrows-combine' | 'rioglyph-arrows-expand' | 'rioglyph-arrows-horizontal' | 'rioglyph-arrows-split' | 'rioglyph-assigned' | 'rioglyph-axis-x' | 'rioglyph-axis-y' | 'rioglyph-axis-z' | 'rioglyph-axle' | 'rioglyph-ban-circle' | 'rioglyph-bar-chart-box' | 'rioglyph-battery-charging' | 'rioglyph-battery-level-empty' | 'rioglyph-battery-level-full' | 'rioglyph-battery-level-low' | 'rioglyph-beacon' | 'rioglyph-big-bag' | 'rioglyph-book' | 'rioglyph-bookable-poi' | 'rioglyph-bookmark-square' | 'rioglyph-bookmark' | 'rioglyph-border-crossing' | 'rioglyph-box-open' | 'rioglyph-box' | 'rioglyph-brain' | 'rioglyph-brake' | 'rioglyph-branch-horizontal' | 'rioglyph-branch-remove' | 'rioglyph-branch-vertical' | 'rioglyph-broadcast' | 'rioglyph-building' | 'rioglyph-bulb' | 'rioglyph-bulk-container' | 'rioglyph-bus-baseline' | 'rioglyph-bus-breakdown' | 'rioglyph-bus' | 'rioglyph-businessman' | 'rioglyph-calendar-parking' | 'rioglyph-calendar-plus' | 'rioglyph-calendar-today' | 'rioglyph-calendar' | 'rioglyph-camera' | 'rioglyph-car-baseline' | 'rioglyph-car-wash' | 'rioglyph-car' | 'rioglyph-card-hotel' | 'rioglyph-card-reader' | 'rioglyph-cards-add' | 'rioglyph-cards-grid' | 'rioglyph-cards-list' | 'rioglyph-cards-table' | 'rioglyph-cargo' | 'rioglyph-carrier' | 'rioglyph-chat' | 'rioglyph-check-badge' | 'rioglyph-check-shield' | 'rioglyph-checkbox-checked' | 'rioglyph-checkbox' | 'rioglyph-checkboxes' | 'rioglyph-chevron-down' | 'rioglyph-chevron-left' | 'rioglyph-chevron-right' | 'rioglyph-chevron-up' | 'rioglyph-chip' | 'rioglyph-circle-dashed' | 'rioglyph-circle-stack' | 'rioglyph-click' | 'rioglyph-climate-control' | 'rioglyph-clipboard' | 'rioglyph-cloud-download' | 'rioglyph-cloud-not-saved' | 'rioglyph-cloud-progress' | 'rioglyph-cloud-upload' | 'rioglyph-cloud' | 'rioglyph-coasting' | 'rioglyph-code-braces' | 'rioglyph-code-brackets' | 'rioglyph-coffee' | 'rioglyph-cog' | 'rioglyph-coil' | 'rioglyph-color-swatch' | 'rioglyph-comment' | 'rioglyph-compare' | 'rioglyph-compass' | 'rioglyph-component-custom-recurrent' | 'rioglyph-component-custom' | 'rioglyph-component' | 'rioglyph-construction' | 'rioglyph-convert' | 'rioglyph-conveyor-belt' | 'rioglyph-cookie' | 'rioglyph-cooling' | 'rioglyph-cost-efficency' | 'rioglyph-cost-efficiency' | 'rioglyph-crown' | 'rioglyph-cruise-control' | 'rioglyph-css' | 'rioglyph-csv' | 'rioglyph-cube-dashed' | 'rioglyph-cube' | 'rioglyph-currency-euro' | 'rioglyph-damages' | 'rioglyph-dangerousgoods' | 'rioglyph-dashboard-view' | 'rioglyph-dashboard' | 'rioglyph-delivery-completed' | 'rioglyph-delivery-error' | 'rioglyph-delivery-late' | 'rioglyph-delivery-on-track' | 'rioglyph-delivery-warning' | 'rioglyph-delivery' | 'rioglyph-design' | 'rioglyph-desktop' | 'rioglyph-detail-view-info' | 'rioglyph-detail-view' | 'rioglyph-direction' | 'rioglyph-discount-badge' | 'rioglyph-document-out' | 'rioglyph-document' | 'rioglyph-download' | 'rioglyph-drag-n-drop' | 'rioglyph-drive-history' | 'rioglyph-driver-card' | 'rioglyph-driver-off' | 'rioglyph-driver' | 'rioglyph-drivercard-in' | 'rioglyph-drivercard-out' | 'rioglyph-duplicate' | 'rioglyph-earphone' | 'rioglyph-emergency-stop' | 'rioglyph-empty' | 'rioglyph-engine' | 'rioglyph-envelope-indicator' | 'rioglyph-envelope-open' | 'rioglyph-envelope' | 'rioglyph-erase' | 'rioglyph-error-sign' | 'rioglyph-euro-note' | 'rioglyph-exclamation-sign' | 'rioglyph-exclamation' | 'rioglyph-eye-close' | 'rioglyph-eye-closed' | 'rioglyph-eye-open' | 'rioglyph-eye-option' | 'rioglyph-face-frown' | 'rioglyph-face-neutral' | 'rioglyph-face-smile' | 'rioglyph-facetime-video' | 'rioglyph-factory' | 'rioglyph-file-signature' | 'rioglyph-files' | 'rioglyph-fill' | 'rioglyph-filling-e-station' | 'rioglyph-filling-station' | 'rioglyph-filter-active' | 'rioglyph-filter-reset' | 'rioglyph-filter' | 'rioglyph-fingerprint' | 'rioglyph-finish' | 'rioglyph-fire' | 'rioglyph-flag' | 'rioglyph-flash' | 'rioglyph-folder-closed' | 'rioglyph-folder-open' | 'rioglyph-fuel-diesel' | 'rioglyph-fuel-electric' | 'rioglyph-fuel-gas' | 'rioglyph-fuel-hydrogen' | 'rioglyph-fuel-liquid' | 'rioglyph-fuel-mix' | 'rioglyph-fullscreen' | 'rioglyph-geofence' | 'rioglyph-get' | 'rioglyph-give' | 'rioglyph-globe-alt' | 'rioglyph-globe' | 'rioglyph-group-blocks' | 'rioglyph-group' | 'rioglyph-hand-down' | 'rioglyph-hand-left' | 'rioglyph-hand-right' | 'rioglyph-hand-up' | 'rioglyph-handshake' | 'rioglyph-hash' | 'rioglyph-heart' | 'rioglyph-heating' | 'rioglyph-hierarchy' | 'rioglyph-history' | 'rioglyph-home-sign' | 'rioglyph-home' | 'rioglyph-hour-glass' | 'rioglyph-id' | 'rioglyph-inbox-in' | 'rioglyph-inbox-out' | 'rioglyph-inbox-stack' | 'rioglyph-inbox' | 'rioglyph-info-sign' | 'rioglyph-info' | 'rioglyph-insert' | 'rioglyph-issue-tracking' | 'rioglyph-key' | 'rioglyph-kickdown' | 'rioglyph-language' | 'rioglyph-layer-pois' | 'rioglyph-layer' | 'rioglyph-leafs' | 'rioglyph-light-bulb' | 'rioglyph-line-chart' | 'rioglyph-link' | 'rioglyph-load-unload' | 'rioglyph-load' | 'rioglyph-location-arrow' | 'rioglyph-lock-open' | 'rioglyph-lock' | 'rioglyph-log-in' | 'rioglyph-logout' | 'rioglyph-looking-glass-man' | 'rioglyph-looking-glass' | 'rioglyph-magic-wand' | 'rioglyph-maintenance-components' | 'rioglyph-map-location' | 'rioglyph-map-marker' | 'rioglyph-map' | 'rioglyph-megaphone' | 'rioglyph-menu-hamburger' | 'rioglyph-merge' | 'rioglyph-mesh-box' | 'rioglyph-migrate' | 'rioglyph-milage' | 'rioglyph-minus-light' | 'rioglyph-minus-sign' | 'rioglyph-minus' | 'rioglyph-missing' | 'rioglyph-mode-dark-light' | 'rioglyph-more' | 'rioglyph-new-window' | 'rioglyph-newspaper' | 'rioglyph-note' | 'rioglyph-notification' | 'rioglyph-number-1' | 'rioglyph-number-2' | 'rioglyph-number-3' | 'rioglyph-off' | 'rioglyph-oil-can' | 'rioglyph-ok-circle' | 'rioglyph-ok-dashed' | 'rioglyph-ok-sign' | 'rioglyph-ok' | 'rioglyph-onboarding' | 'rioglyph-ongoing' | 'rioglyph-option-horizontal' | 'rioglyph-option-vertical' | 'rioglyph-order' | 'rioglyph-palette-broken' | 'rioglyph-palette-empty' | 'rioglyph-palette' | 'rioglyph-paper-clip' | 'rioglyph-parcel-broken' | 'rioglyph-parcel' | 'rioglyph-parking' | 'rioglyph-pause-circle' | 'rioglyph-pause' | 'rioglyph-pdf-file' | 'rioglyph-pencil-square' | 'rioglyph-pencil' | 'rioglyph-phone' | 'rioglyph-pictures' | 'rioglyph-pin-range' | 'rioglyph-pin' | 'rioglyph-play-circle' | 'rioglyph-play' | 'rioglyph-plugged-off' | 'rioglyph-plugged-on' | 'rioglyph-plus-light' | 'rioglyph-plus-sign' | 'rioglyph-plus' | 'rioglyph-pm' | 'rioglyph-poi' | 'rioglyph-polygon' | 'rioglyph-position' | 'rioglyph-print' | 'rioglyph-progress-ongoing' | 'rioglyph-progress-remaining' | 'rioglyph-progression' | 'rioglyph-prompt' | 'rioglyph-pto-off' | 'rioglyph-pto-on' | 'rioglyph-pushpin' | 'rioglyph-puzzle' | 'rioglyph-pylon' | 'rioglyph-qr-code' | 'rioglyph-question-sign' | 'rioglyph-question' | 'rioglyph-record' | 'rioglyph-recycle' | 'rioglyph-refresh' | 'rioglyph-remove-circle' | 'rioglyph-remove-sign' | 'rioglyph-remove' | 'rioglyph-repeat-square' | 'rioglyph-repeat' | 'rioglyph-resize-full' | 'rioglyph-resize-horizontal' | 'rioglyph-resize-small' | 'rioglyph-resize-vertical' | 'rioglyph-retrofit' | 'rioglyph-retweet' | 'rioglyph-revert' | 'rioglyph-rio-marker' | 'rioglyph-rio' | 'rioglyph-road-restrictions' | 'rioglyph-road' | 'rioglyph-robot' | 'rioglyph-rocket' | 'rioglyph-role-management' | 'rioglyph-roll-container' | 'rioglyph-route-option' | 'rioglyph-route-view' | 'rioglyph-route' | 'rioglyph-ruler' | 'rioglyph-satellite-radar' | 'rioglyph-save' | 'rioglyph-scale' | 'rioglyph-scan' | 'rioglyph-scissors' | 'rioglyph-search-list' | 'rioglyph-search-truck' | 'rioglyph-search' | 'rioglyph-send' | 'rioglyph-series' | 'rioglyph-server-stack' | 'rioglyph-settings' | 'rioglyph-share-alt' | 'rioglyph-share-nodes' | 'rioglyph-share' | 'rioglyph-shelve-empty' | 'rioglyph-shelve' | 'rioglyph-ship' | 'rioglyph-shopping-bag' | 'rioglyph-shopping-cart' | 'rioglyph-signature' | 'rioglyph-slope-down-max' | 'rioglyph-slope-down-min' | 'rioglyph-slope-up-max' | 'rioglyph-slope-up-min' | 'rioglyph-sort-by-attributes-alt' | 'rioglyph-sort-by-attributes' | 'rioglyph-sort' | 'rioglyph-sparkles' | 'rioglyph-speed' | 'rioglyph-sphere' | 'rioglyph-spinner' | 'rioglyph-split-view' | 'rioglyph-square-dashed' | 'rioglyph-stack-add' | 'rioglyph-stack-iso' | 'rioglyph-stack' | 'rioglyph-star-empty' | 'rioglyph-star' | 'rioglyph-stars' | 'rioglyph-start' | 'rioglyph-stats-high' | 'rioglyph-stats-line-dots' | 'rioglyph-stats-low' | 'rioglyph-stats-medium' | 'rioglyph-stats' | 'rioglyph-status-available' | 'rioglyph-status-change-horizontal' | 'rioglyph-status-change' | 'rioglyph-status-driving' | 'rioglyph-status-resting' | 'rioglyph-status-working' | 'rioglyph-steering-wheel' | 'rioglyph-stillage' | 'rioglyph-stopover' | 'rioglyph-support' | 'rioglyph-table-view' | 'rioglyph-tachograph-download' | 'rioglyph-tachograph' | 'rioglyph-tag' | 'rioglyph-tasks' | 'rioglyph-temperature' | 'rioglyph-th-list' | 'rioglyph-thumbs-down' | 'rioglyph-thumbs-up' | 'rioglyph-tickets' | 'rioglyph-time-alt' | 'rioglyph-time-cancle' | 'rioglyph-time-incomplete' | 'rioglyph-time' | 'rioglyph-tire' | 'rioglyph-tms' | 'rioglyph-to-bottom' | 'rioglyph-to-left' | 'rioglyph-to-right' | 'rioglyph-to-top' | 'rioglyph-tracking-package' | 'rioglyph-traffic-lights' | 'rioglyph-trailer-baseline' | 'rioglyph-trailer-liquid' | 'rioglyph-trailer-standard' | 'rioglyph-trailer-tipping' | 'rioglyph-trailer' | 'rioglyph-trailerposition' | 'rioglyph-train' | 'rioglyph-transfer' | 'rioglyph-transition-push-right' | 'rioglyph-transition-right' | 'rioglyph-trash' | 'rioglyph-triangle-bottom' | 'rioglyph-triangle-left' | 'rioglyph-triangle-right' | 'rioglyph-triangle-top' | 'rioglyph-trophy' | 'rioglyph-truck-baseline' | 'rioglyph-truck-breakdown' | 'rioglyph-truck-unit' | 'rioglyph-truck' | 'rioglyph-unassigned' | 'rioglyph-unavailable' | 'rioglyph-unlink' | 'rioglyph-upload' | 'rioglyph-user-add' | 'rioglyph-user-group' | 'rioglyph-user-ok' | 'rioglyph-user-remove' | 'rioglyph-user-sign-off' | 'rioglyph-user-sign' | 'rioglyph-user' | 'rioglyph-van-baseline' | 'rioglyph-van' | 'rioglyph-variable' | 'rioglyph-video-off' | 'rioglyph-video' | 'rioglyph-volume' | 'rioglyph-wallet' | 'rioglyph-warehouse' | 'rioglyph-warning-sign' | 'rioglyph-weather-cloudy' | 'rioglyph-weather-icy' | 'rioglyph-weather-overcast' | 'rioglyph-weather-raining' | 'rioglyph-weather-snowing' | 'rioglyph-weather-stormy' | 'rioglyph-weather-sunny' | 'rioglyph-weather-thundering' | 'rioglyph-weather-windy' | 'rioglyph-weight' | 'rioglyph-width' | 'rioglyph-wifi-off' | 'rioglyph-wifi' | 'rioglyph-window' | 'rioglyph-workflow-step' | 'rioglyph-workflow' | 'rioglyph-workshop' | 'rioglyph-wrench' | 'rioglyph-xmas-raindeer' | 'rioglyph-xmas-santa';
|
|
@@ -12,6 +12,14 @@ export type SelectOption = {
|
|
|
12
12
|
* The option item text.
|
|
13
13
|
*/
|
|
14
14
|
label: string | React.ReactNode;
|
|
15
|
+
/**
|
|
16
|
+
* Optional description shown below the option item text.
|
|
17
|
+
*/
|
|
18
|
+
description?: string | React.ReactNode;
|
|
19
|
+
/**
|
|
20
|
+
* Additional classes to be set on the dropdown menu item.
|
|
21
|
+
*/
|
|
22
|
+
dropdownItemClassName?: string;
|
|
15
23
|
/**
|
|
16
24
|
* Icon to be displayed in front of the label.
|
|
17
25
|
*/
|
|
@@ -1,62 +1,62 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useState as E, useRef as R, useEffect as
|
|
1
|
+
import { jsx as a, jsxs as l, Fragment as Q } from "react/jsx-runtime";
|
|
2
|
+
import { useState as E, useRef as R, useEffect as b, useLayoutEffect as Y } from "react";
|
|
3
3
|
import { isEmpty as _ } from "es-toolkit/compat";
|
|
4
|
-
import { noop as
|
|
5
|
-
import
|
|
4
|
+
import { noop as D } from "es-toolkit/function";
|
|
5
|
+
import h from "../../utils/classNames.js";
|
|
6
6
|
import { useDropDirection as Z } from "../../utils/useDropDirection.js";
|
|
7
|
-
import { DOWN as
|
|
7
|
+
import { DOWN as w, scrollItemIntoView as T, UP as g } from "../../utils/scrollItemIntoView.js";
|
|
8
8
|
import $ from "../../hooks/useKey.js";
|
|
9
9
|
import ee from "./DropdownHeader.js";
|
|
10
10
|
import te from "./NoItemMessage.js";
|
|
11
11
|
import se from "../spinner/Spinner.js";
|
|
12
|
-
const B = "data-item-id", re = 0, H = "focus", L =
|
|
12
|
+
const B = "data-item-id", re = 0, H = "focus", L = w, Ie = (O) => {
|
|
13
13
|
const {
|
|
14
14
|
isOpen: s = !1,
|
|
15
|
-
isLoading:
|
|
16
|
-
updateDOMValues:
|
|
17
|
-
onOpen:
|
|
18
|
-
onSelect: u =
|
|
19
|
-
onClose:
|
|
15
|
+
isLoading: p = !1,
|
|
16
|
+
updateDOMValues: x = D,
|
|
17
|
+
onOpen: d = D,
|
|
18
|
+
onSelect: u = D,
|
|
19
|
+
onClose: y = D,
|
|
20
20
|
options: n = [],
|
|
21
21
|
autoDropDirection: V = !0,
|
|
22
22
|
dropup: j = !1,
|
|
23
23
|
pullRight: K = !1,
|
|
24
24
|
useActiveClass: G = !1,
|
|
25
|
-
focusedItemIndex:
|
|
26
|
-
keyboardUsed:
|
|
25
|
+
focusedItemIndex: m,
|
|
26
|
+
keyboardUsed: f,
|
|
27
27
|
noItemMessage: P,
|
|
28
28
|
dropdownClassName: W
|
|
29
|
-
} =
|
|
30
|
-
|
|
29
|
+
} = O, [o, k] = E(m || re), [X, A] = E(f), C = R(L), r = R(null);
|
|
30
|
+
b(() => {
|
|
31
31
|
s && r.current && (r.current.scrollTop = 0);
|
|
32
|
-
}, [s]),
|
|
33
|
-
typeof
|
|
34
|
-
}, [
|
|
35
|
-
const
|
|
32
|
+
}, [s]), b(() => {
|
|
33
|
+
typeof m == "number" && k(m), typeof f == "boolean" && A(f), s || (C.current = L);
|
|
34
|
+
}, [m, f, s]);
|
|
35
|
+
const I = Z({ pullRight: K, dropup: j, autoDropDirection: V, dropdownMenuRef: r }, [s]);
|
|
36
36
|
Y(() => {
|
|
37
37
|
if (r.current) {
|
|
38
38
|
const e = r.current.parentElement;
|
|
39
|
-
|
|
39
|
+
I.dropup ? e?.classList.add("dropup") : e?.classList.remove("dropup");
|
|
40
40
|
}
|
|
41
|
-
}, [
|
|
42
|
-
|
|
43
|
-
}, [n]),
|
|
41
|
+
}, [I, r]), b(() => {
|
|
42
|
+
x(q());
|
|
43
|
+
}, [n]), b(() => {
|
|
44
44
|
s && T(
|
|
45
|
-
|
|
45
|
+
C.current || L,
|
|
46
46
|
r.current,
|
|
47
|
-
|
|
47
|
+
N()
|
|
48
48
|
);
|
|
49
49
|
}, [o, s]);
|
|
50
50
|
const [v, U] = E(s);
|
|
51
|
-
s && !v ? (
|
|
51
|
+
s && !v ? (d(I.dropup), U(s)) : !s && v && (y(), U(s)), $((e) => {
|
|
52
52
|
if (s)
|
|
53
53
|
switch (e.key) {
|
|
54
54
|
case "Escape": {
|
|
55
|
-
|
|
55
|
+
y();
|
|
56
56
|
break;
|
|
57
57
|
}
|
|
58
58
|
case "Tab": {
|
|
59
|
-
|
|
59
|
+
y();
|
|
60
60
|
break;
|
|
61
61
|
}
|
|
62
62
|
case "Enter": {
|
|
@@ -64,11 +64,11 @@ const B = "data-item-id", re = 0, H = "focus", L = g, Ie = (h) => {
|
|
|
64
64
|
break;
|
|
65
65
|
}
|
|
66
66
|
case "ArrowUp": {
|
|
67
|
-
e.preventDefault(), S(
|
|
67
|
+
e.preventDefault(), S(g), T(g, r.current, N());
|
|
68
68
|
break;
|
|
69
69
|
}
|
|
70
70
|
case "ArrowDown": {
|
|
71
|
-
e.preventDefault(), S(
|
|
71
|
+
e.preventDefault(), S(w), T(w, r.current, N());
|
|
72
72
|
break;
|
|
73
73
|
}
|
|
74
74
|
}
|
|
@@ -76,18 +76,18 @@ const B = "data-item-id", re = 0, H = "focus", L = g, Ie = (h) => {
|
|
|
76
76
|
const S = (e) => {
|
|
77
77
|
let t = 0;
|
|
78
78
|
switch (e) {
|
|
79
|
-
case
|
|
79
|
+
case g: {
|
|
80
80
|
t = o <= 0 ? o : o - 1;
|
|
81
81
|
break;
|
|
82
82
|
}
|
|
83
|
-
case
|
|
83
|
+
case w: {
|
|
84
84
|
t = o === n.length - 1 ? o : o + 1;
|
|
85
85
|
break;
|
|
86
86
|
}
|
|
87
87
|
}
|
|
88
|
-
|
|
89
|
-
const
|
|
90
|
-
k(t < 0 ?
|
|
88
|
+
C.current = e;
|
|
89
|
+
const c = e === g ? n.length - 1 : 0;
|
|
90
|
+
k(t < 0 ? c : t), A(!0);
|
|
91
91
|
}, F = () => r.current?.getElementsByTagName("a") || [], q = () => {
|
|
92
92
|
if (r.current)
|
|
93
93
|
return [...F()].map(
|
|
@@ -96,57 +96,73 @@ const B = "data-item-id", re = 0, H = "focus", L = g, Ie = (h) => {
|
|
|
96
96
|
text: t.textContent
|
|
97
97
|
})
|
|
98
98
|
);
|
|
99
|
-
},
|
|
99
|
+
}, N = () => [...F()].find((t) => t.className.includes(H)), z = (e) => {
|
|
100
100
|
if (e.preventDefault(), _(n))
|
|
101
101
|
return;
|
|
102
|
-
const t =
|
|
102
|
+
const t = N();
|
|
103
103
|
if (t) {
|
|
104
|
-
const
|
|
105
|
-
u(
|
|
104
|
+
const c = n.find((i) => i.id === t.getAttribute(B));
|
|
105
|
+
u(c);
|
|
106
106
|
}
|
|
107
107
|
}, J = (e) => {
|
|
108
108
|
e.preventDefault();
|
|
109
|
-
const t = e.currentTarget.getElementsByTagName("input")[0].value,
|
|
110
|
-
u(
|
|
111
|
-
}, M =
|
|
112
|
-
return _(n) ? /* @__PURE__ */
|
|
113
|
-
|
|
114
|
-
!
|
|
109
|
+
const t = e.currentTarget.getElementsByTagName("input")[0].value, c = n.find((i) => i.id === t);
|
|
110
|
+
u(c);
|
|
111
|
+
}, M = h("dropdown-menu", I.pullRight && "pull-right", W);
|
|
112
|
+
return _(n) ? /* @__PURE__ */ a(te, { noItemMessage: P, className: M }) : /* @__PURE__ */ l("ul", { className: M, ref: r, role: "menu", children: [
|
|
113
|
+
p && /* @__PURE__ */ a("div", { className: "display-flex justify-content-center padding-10", children: /* @__PURE__ */ a(se, {}) }),
|
|
114
|
+
!p && n.map((e, t) => {
|
|
115
115
|
if (e.header)
|
|
116
|
-
return /* @__PURE__ */
|
|
117
|
-
const
|
|
116
|
+
return /* @__PURE__ */ a(ee, { icon: e.icon, label: e.label }, e.id);
|
|
117
|
+
const c = h(
|
|
118
118
|
X && o === t ? H : "",
|
|
119
119
|
e.disabled && "pointer-events-none",
|
|
120
|
-
"display-flex align-items-center gap-3"
|
|
121
|
-
|
|
120
|
+
"display-flex align-items-center gap-3",
|
|
121
|
+
e.dropdownItemClassName
|
|
122
|
+
), i = h(
|
|
122
123
|
e.disabled && "disabled",
|
|
123
124
|
G && e.selected && "active"
|
|
124
125
|
);
|
|
125
|
-
return /* @__PURE__ */
|
|
126
|
+
return /* @__PURE__ */ a("li", { className: i, role: "listitem", children: /* @__PURE__ */ l(
|
|
126
127
|
"a",
|
|
127
128
|
{
|
|
128
129
|
role: "menuitem",
|
|
129
|
-
className:
|
|
130
|
+
className: c,
|
|
130
131
|
"data-item-id": e.id,
|
|
131
132
|
"data-item-index": t,
|
|
132
133
|
onClick: e.disabled ? void 0 : J,
|
|
133
134
|
children: [
|
|
134
|
-
/* @__PURE__ */
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
135
|
+
/* @__PURE__ */ l(
|
|
136
|
+
"span",
|
|
137
|
+
{
|
|
138
|
+
className: h(
|
|
139
|
+
"selected-option-dropdown-item",
|
|
140
|
+
e.description && "selected-option-dropdown-item-with-description"
|
|
141
|
+
),
|
|
142
|
+
children: [
|
|
143
|
+
e.icon && /* @__PURE__ */ a(Q, { children: e.icon }),
|
|
144
|
+
e.description ? /* @__PURE__ */ l("span", { className: "selected-option-dropdown-text", children: [
|
|
145
|
+
/* @__PURE__ */ a("span", { className: "selected-option-dropdown-label", children: e.label }),
|
|
146
|
+
/* @__PURE__ */ l("span", { className: "selected-option-dropdown-description", children: [
|
|
147
|
+
" ",
|
|
148
|
+
e.description
|
|
149
|
+
] })
|
|
150
|
+
] }) : e.label
|
|
151
|
+
]
|
|
152
|
+
}
|
|
153
|
+
),
|
|
154
|
+
/* @__PURE__ */ a("input", { type: "hidden", value: e.id })
|
|
139
155
|
]
|
|
140
156
|
}
|
|
141
157
|
) }, e.id);
|
|
142
158
|
})
|
|
143
159
|
] });
|
|
144
|
-
},
|
|
145
|
-
const
|
|
146
|
-
return
|
|
160
|
+
}, Ne = (O, s, p) => {
|
|
161
|
+
const x = O.filter((d) => d.text.toLowerCase().includes(s.toLowerCase()));
|
|
162
|
+
return p.filter((d) => x.find((u) => u.id === d.id));
|
|
147
163
|
};
|
|
148
164
|
export {
|
|
149
165
|
Ie as default,
|
|
150
|
-
|
|
166
|
+
Ne as filterOptions
|
|
151
167
|
};
|
|
152
168
|
//# sourceMappingURL=BaseSelectDropdown.js.map
|