@nebula.js/stardust 5.8.0 → 5.8.1

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/core/esm/dev.js CHANGED
@@ -1,11 +1,11 @@
1
1
  /*
2
- * @nebula.js/stardust v5.8.0
2
+ * @nebula.js/stardust v5.8.1
3
3
  * Copyright (c) 2024 QlikTech International AB
4
4
  * Released under the MIT license.
5
5
  */
6
6
 
7
7
  import * as React from 'react';
8
- import React__default, { useState as useState$1, useEffect as useEffect$1, forwardRef, useMemo as useMemo$1, useImperativeHandle as useImperativeHandle$1, useContext, useReducer, useCallback, useLayoutEffect as useLayoutEffect$1, PureComponent, useRef, createElement, Component } from 'react';
8
+ import React__default, { useState as useState$1, useEffect as useEffect$1, forwardRef, useMemo as useMemo$1, useImperativeHandle as useImperativeHandle$1, useContext, useReducer, useCallback, useLayoutEffect as useLayoutEffect$1, PureComponent, useRef as useRef$1, createElement, Component } from 'react';
9
9
  import ReactDOM$1 from 'react-dom';
10
10
  import { CacheProvider, Global, ThemeContext as ThemeContext$1, css, keyframes } from '@emotion/react';
11
11
  import { Checkbox, Radio, Typography, FormControlLabel, Box, Grid, Tooltip, Paper, IconButton, styled as styled$3, Popover, MenuList, MenuItem, ListItemIcon, Divider, OutlinedInput, InputAdornment, Badge, List, ListItem, Button, ButtonBase, CircularProgress, Icon } from '@mui/material';
@@ -10772,7 +10772,7 @@ function create$3(definition) {
10772
10772
  return cache[key];
10773
10773
  }
10774
10774
 
10775
- const NEBULA_VERSION_HASH = "18d6";
10775
+ const NEBULA_VERSION_HASH = "c2a3";
10776
10776
  ClassNameGenerator.configure(componentName => {
10777
10777
  return "njs-".concat(NEBULA_VERSION_HASH, "-").concat(componentName.replace('Mui', ''));
10778
10778
  });
@@ -11004,7 +11004,7 @@ function boot(_ref2) {
11004
11004
  const appRef = React__default.createRef();
11005
11005
  const element = document.createElement('div');
11006
11006
  element.style.display = 'none';
11007
- element.setAttribute('data-nebulajs-version', "5.8.0");
11007
+ element.setAttribute('data-nebulajs-version', "5.8.1");
11008
11008
  element.setAttribute('data-app-id', app.id);
11009
11009
  document.body.appendChild(element);
11010
11010
  if (context) {
@@ -11827,7 +11827,7 @@ function useSelectionsInteractions(_ref) {
11827
11827
  doc = document,
11828
11828
  loaderRef
11829
11829
  } = _ref;
11830
- const currentSelect = useRef({
11830
+ const currentSelect = useRef$1({
11831
11831
  startElemNumber: undefined,
11832
11832
  elemNumbers: [],
11833
11833
  isRange: false,
@@ -16341,13 +16341,13 @@ function ListBox(_ref) {
16341
16341
  checkboxes = checkboxOption,
16342
16342
  histogram
16343
16343
  } = layout !== null && layout !== void 0 ? layout : {};
16344
- const loaderRef = useRef(null);
16345
- const local = useRef({
16344
+ const loaderRef = useRef$1(null);
16345
+ const local = useRef$1({
16346
16346
  queue: [],
16347
16347
  validPages: false,
16348
16348
  dataOffset: 0
16349
16349
  });
16350
- const listData = useRef({
16350
+ const listData = useRef$1({
16351
16351
  pages: []
16352
16352
  });
16353
16353
 
@@ -17171,8 +17171,8 @@ function ActionsToolbar(_ref3) {
17171
17171
  vertical: 12,
17172
17172
  horizontal: ((_popover$anchorEl$cli = (_popover$anchorEl = popover.anchorEl) === null || _popover$anchorEl === void 0 ? void 0 : _popover$anchorEl.clientWidth) !== null && _popover$anchorEl$cli !== void 0 ? _popover$anchorEl$cli : 0) - 7
17173
17173
  };
17174
- const actionsRef = useRef();
17175
- const moreRef = useRef();
17174
+ const actionsRef = useRef$1();
17175
+ const moreRef = useRef$1();
17176
17176
  const theme = useTheme$1();
17177
17177
  const dividerStyle = useMemo$1(() => ({
17178
17178
  margin: theme.spacing(0.5, 0)
@@ -17402,8 +17402,8 @@ function ListBoxSearch(_ref2, ref) {
17402
17402
  } = useContext(InstanceContext);
17403
17403
  const [value, setValue] = useState$1('');
17404
17404
  const [wildcardOn, setWildcardOn] = useState$1(false);
17405
- const inputRef = useRef();
17406
- const clearSearchRef = useRef();
17405
+ const inputRef = useRef$1();
17406
+ const clearSearchRef = useRef$1();
17407
17407
  const clearSearchText = translator.get('Listbox.Clear.Search');
17408
17408
  const {
17409
17409
  getStoreValue,
@@ -18562,7 +18562,7 @@ function ListBoxPopover(_ref) {
18562
18562
  const open = show && Boolean(alignTo.current);
18563
18563
  const [listCount, setListCount] = useState$1(0);
18564
18564
  const theme = useTheme$1();
18565
- const searchInputRef = useRef();
18565
+ const searchInputRef = useRef$1();
18566
18566
  const [model] = useSessionModel({
18567
18567
  qInfo: {
18568
18568
  qType: 'njsListbox'
@@ -18594,8 +18594,8 @@ function ListBoxPopover(_ref) {
18594
18594
  themeApi,
18595
18595
  keyboardNavigation
18596
18596
  } = useContext(InstanceContext);
18597
- const moreAlignTo = useRef();
18598
- const containerRef = useRef();
18597
+ const moreAlignTo = useRef$1();
18598
+ const containerRef = useRef$1();
18599
18599
  const [selections] = useObjectSelections(app, model, containerRef);
18600
18600
  const [layout] = useLayout$1(model);
18601
18601
  const [selectionState$1] = useState$1(() => selectionState({
@@ -18756,7 +18756,7 @@ function OneField(_ref) {
18756
18756
  const {
18757
18757
  translator
18758
18758
  } = useContext(InstanceContext);
18759
- const alignTo = moreAlignTo || useRef();
18759
+ const alignTo = moreAlignTo || useRef$1();
18760
18760
  const theme = useTheme$1();
18761
18761
  const [showListBoxPopover, setShowListBoxPopover] = useState$1(false);
18762
18762
  const handleShowListBoxPopover = e => {
@@ -18953,7 +18953,7 @@ function MultiState(_ref2) {
18953
18953
  const [showStateIx, setShowStateIx] = useState$1(-1);
18954
18954
  // If originated from the `more` item align it
18955
18955
  const [anchorEl, setAnchorEl] = useState$1(moreAlignTo ? moreAlignTo.current : null);
18956
- const alignTo = moreAlignTo || useRef();
18956
+ const alignTo = moreAlignTo || useRef$1();
18957
18957
  const {
18958
18958
  translator
18959
18959
  } = useContext(InstanceContext);
@@ -19118,7 +19118,7 @@ function More(_ref2) {
19118
19118
  const [showMoreItems, setShowMoreItems] = useState$1(false);
19119
19119
  const [showItemIx, setShowItemIx] = useState$1(-1);
19120
19120
  const [anchorEl, setAnchorEl] = useState$1(null);
19121
- const alignTo = useRef();
19121
+ const alignTo = useRef$1();
19122
19122
  const handleShowMoreItems = e => {
19123
19123
  if (e.currentTarget.contains(e.target)) {
19124
19124
  // because click in popover will propagate to parent
@@ -20459,7 +20459,7 @@ function ListBoxHeader(_ref2) {
20459
20459
  var _layout$qListObject2;
20460
20460
  setLocked(layout === null || layout === void 0 || (_layout$qListObject2 = layout.qListObject) === null || _layout$qListObject2 === void 0 || (_layout$qListObject2 = _layout$qListObject2.qDimensionInfo) === null || _layout$qListObject2 === void 0 ? void 0 : _layout$qListObject2.qLocked);
20461
20461
  }, [layout === null || layout === void 0 || (_layout$qListObject3 = layout.qListObject) === null || _layout$qListObject3 === void 0 || (_layout$qListObject3 = _layout$qListObject3.qDimensionInfo) === null || _layout$qListObject3 === void 0 ? void 0 : _layout$qListObject3.qLocked]);
20462
- const titleRef = useRef(null);
20462
+ const titleRef = useRef$1(null);
20463
20463
  const iconData = iconUtils.createDimensionIconData({
20464
20464
  dimInfo: layout === null || layout === void 0 || (_layout$qListObject4 = layout.qListObject) === null || _layout$qListObject4 === void 0 ? void 0 : _layout$qListObject4.qDimensionInfo,
20465
20465
  app,
@@ -20704,12 +20704,12 @@ function ListBoxInline(_ref3) {
20704
20704
  const isDirectQuery = isDirectQueryEnabled({
20705
20705
  appLayout: app === null || app === void 0 ? void 0 : app.layout
20706
20706
  });
20707
- const containerRef = useRef();
20708
- const searchInputRef = useRef();
20707
+ const containerRef = useRef$1();
20708
+ const searchInputRef = useRef$1();
20709
20709
  const [containerRectRef, containerRect] = useRect$1();
20710
20710
  const [showToolbar, setShowToolbar] = useState$1(false);
20711
20711
  const [showSearch, setShowSearch] = useState$1(false);
20712
- const hovering = useRef(false);
20712
+ const hovering = useRef$1(false);
20713
20713
  const [keyScroll, setKeyScroll] = useState$1({
20714
20714
  down: 0,
20715
20715
  up: 0,
@@ -21260,7 +21260,7 @@ function useOnTheFlyModel(_ref) {
21260
21260
  maxRows: 1
21261
21261
  };
21262
21262
  }
21263
- const id = useRef();
21263
+ const id = useRef$1();
21264
21264
  if (!id.current) {
21265
21265
  id.current = uid();
21266
21266
  }
@@ -21429,7 +21429,7 @@ function ListBoxWrapper(_ref) {
21429
21429
  stateName,
21430
21430
  options
21431
21431
  });
21432
- const elementRef = useRef(element);
21432
+ const elementRef = useRef$1(element);
21433
21433
  const selections = hasExternalSelectionsApi ? options.selectionsApi : useObjectSelections(app, model, [elementRef, '.njs-action-toolbar-more', '.njs-action-toolbar-popover'], options)[0];
21434
21434
  const opts = useMemo$1(() => _objectSpread2(_objectSpread2({}, options), {}, {
21435
21435
  selections,
@@ -23760,7 +23760,7 @@ const Cell = forwardRef((_ref6, ref) => {
23760
23760
  const cellElementId = "njs-cell-".concat(currentId);
23761
23761
  const [selections] = useObjectSelections(app, model, ["#".concat(cellElementId), '.njs-action-toolbar-popover']); // elements which will not trigger the click out listener
23762
23762
  const [hovering, setHover] = useState$1(false);
23763
- const hoveringDebouncer = useRef({
23763
+ const hoveringDebouncer = useRef$1({
23764
23764
  enter: null,
23765
23765
  leave: null
23766
23766
  });
@@ -23772,7 +23772,7 @@ const Cell = forwardRef((_ref6, ref) => {
23772
23772
  borderRadius,
23773
23773
  boxShadow
23774
23774
  } = useStyling(layout, halo.public.theme, halo.app, themeName);
23775
- const focusHandler = useRef({
23775
+ const focusHandler = useRef$1({
23776
23776
  focusToolbarButton(last) {
23777
23777
  // eslint-disable-next-line react/no-this-in-sfc
23778
23778
  this.emit(last ? 'focus_toolbar_last' : 'focus_toolbar_first');
@@ -24933,6 +24933,42 @@ function useMemo(fn, deps) {
24933
24933
  return h.value[1];
24934
24934
  }
24935
24935
 
24936
+ /**
24937
+ * Reference object returned from useRef
24938
+ * @interface Ref
24939
+ * @template R
24940
+ * @property {R} current Current value
24941
+ */
24942
+
24943
+ /**
24944
+ * Creates a reference to a value not needed for rendering
24945
+ *
24946
+ * While Nebula does not have a virtual DOM, it is still useful
24947
+ * to have a reference to an object that is retained across
24948
+ * renders and in it self does not trigger a render.
24949
+ * @entry
24950
+ * @template R
24951
+ * @param {R} initialValue - The initial value.
24952
+ * @returns {Ref<R>} An object with the current value
24953
+ * @example
24954
+ * import { useRef } from '@nebula.js/stardust';
24955
+ * // ...
24956
+ * // initiate with simple value
24957
+ * const timesRendered = useRef(0);
24958
+ *
24959
+ * useEffect(() => {
24960
+ * render(layout);
24961
+ * // increments the render counter, a useState would trigger another render
24962
+ * timesRendered.current += 1;
24963
+ * },[layout]);
24964
+ *
24965
+ */
24966
+ function useRef(initialValue) {
24967
+ return useMemo(() => ({
24968
+ current: initialValue
24969
+ }), []);
24970
+ }
24971
+
24936
24972
  /**
24937
24973
  * Runs a callback function when a dependent changes.
24938
24974
  *
@@ -30063,5 +30099,5 @@ const __DO_NOT_USE__ = {
30063
30099
  locale
30064
30100
  };
30065
30101
 
30066
- export { mocker as EnigmaMocker, __DO_NOT_USE__, conversion, index as embed, onContextMenu, onTakeSnapshot, useAction, useApp, useAppLayout, useConstraints, useDeviceType, useEffect, useElement, useEmbed, useEmitter, useGlobal, useImperativeHandle, useInteractionState, useKeyboard, useLayout, useMemo, useModel, useNavigation, useOptions, usePlugins, usePromise, useRect, useRenderState, useSelections, useStaleLayout, useState, useTheme, useTranslator };
30102
+ export { mocker as EnigmaMocker, __DO_NOT_USE__, conversion, index as embed, onContextMenu, onTakeSnapshot, useAction, useApp, useAppLayout, useConstraints, useDeviceType, useEffect, useElement, useEmbed, useEmitter, useGlobal, useImperativeHandle, useInteractionState, useKeyboard, useLayout, useMemo, useModel, useNavigation, useOptions, usePlugins, usePromise, useRect, useRef, useRenderState, useSelections, useStaleLayout, useState, useTheme, useTranslator };
30067
30103
  //# sourceMappingURL=dev.js.map