@nebula.js/stardust 3.1.2 → 3.1.3

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "module": "esm/index.js",
3
3
  "peerDependencies": {
4
- "@mui/material": "^5.11.4",
4
+ "@mui/material": "^5.11.7",
5
5
  "@mui/icons-material": "^5.11.0",
6
6
  "@emotion/react": "^11.10.5",
7
7
  "@emotion/styled": "^11.10.5",
@@ -1,5 +1,5 @@
1
1
  /*
2
- * @nebula.js/stardust v3.1.2
2
+ * @nebula.js/stardust v3.1.3
3
3
  * Copyright (c) 2023 QlikTech International AB
4
4
  * Released under the MIT license.
5
5
  */
@@ -9542,7 +9542,7 @@
9542
9542
  }
9543
9543
 
9544
9544
  // Make sure the next tab starts from the right place.
9545
- // doc.activeElement referes to the origin.
9545
+ // doc.activeElement refers to the origin.
9546
9546
  if (doc.activeElement === rootRef.current && nativeEvent.shiftKey) {
9547
9547
  // We need to ignore the next contain as
9548
9548
  // it will try to move the focus back to the rootRef element.
@@ -13889,8 +13889,6 @@
13889
13889
  color: (theme.vars || theme).palette.action.disabled
13890
13890
  }, ownerState.variant === 'outlined' && {
13891
13891
  border: `1px solid ${(theme.vars || theme).palette.action.disabledBackground}`
13892
- }, ownerState.variant === 'outlined' && ownerState.color === 'secondary' && {
13893
- border: `1px solid ${(theme.vars || theme).palette.action.disabled}`
13894
13892
  }, ownerState.variant === 'contained' && {
13895
13893
  color: (theme.vars || theme).palette.action.disabled,
13896
13894
  boxShadow: (theme.vars || theme).shadows[0],
@@ -14362,7 +14360,7 @@
14362
14360
  return cache[key];
14363
14361
  }
14364
14362
 
14365
- const NEBULA_VERSION_HASH = "1f4e" ;
14363
+ const NEBULA_VERSION_HASH = "b117" ;
14366
14364
  ClassNameGenerator$1.configure(componentName => {
14367
14365
  return "njs-".concat(NEBULA_VERSION_HASH, "-").concat(componentName.replace('Mui', ''));
14368
14366
  });
@@ -14881,7 +14879,7 @@
14881
14879
  const appRef = React.createRef();
14882
14880
  const element = document.createElement('div');
14883
14881
  element.style.display = 'none';
14884
- element.setAttribute('data-nebulajs-version', "3.1.2" );
14882
+ element.setAttribute('data-nebulajs-version', "3.1.3" );
14885
14883
  element.setAttribute('data-app-id', app.id);
14886
14884
  document.body.appendChild(element);
14887
14885
  ReactDOM.render( /*#__PURE__*/React.createElement(NebulaApp, {
@@ -16490,7 +16488,7 @@
16490
16488
  onChange,
16491
16489
  onFocus,
16492
16490
  readOnly,
16493
- required,
16491
+ required = false,
16494
16492
  tabIndex,
16495
16493
  type,
16496
16494
  value
@@ -17324,7 +17322,7 @@
17324
17322
  ...GRID_SIZES.map(size => `grid-xs-${size}`), ...GRID_SIZES.map(size => `grid-sm-${size}`), ...GRID_SIZES.map(size => `grid-md-${size}`), ...GRID_SIZES.map(size => `grid-lg-${size}`), ...GRID_SIZES.map(size => `grid-xl-${size}`)]);
17325
17323
 
17326
17324
  const _excluded$j = ["className", "columns", "columnSpacing", "component", "container", "direction", "item", "rowSpacing", "spacing", "wrap", "zeroMinWidth"];
17327
- function getOffset(val) {
17325
+ function getOffset$1(val) {
17328
17326
  const parse = parseFloat(val);
17329
17327
  return `${parse}${String(val).replace(String(parse), '') || 'px'}`;
17330
17328
  }
@@ -17372,7 +17370,7 @@
17372
17370
  if (ownerState.container && ownerState.item && ownerState.columnSpacing !== 0) {
17373
17371
  const themeSpacing = theme.spacing(ownerState.columnSpacing);
17374
17372
  if (themeSpacing !== '0px') {
17375
- const fullWidth = `calc(${width} + ${getOffset(themeSpacing)})`;
17373
+ const fullWidth = `calc(${width} + ${getOffset$1(themeSpacing)})`;
17376
17374
  more = {
17377
17375
  flexBasis: fullWidth,
17378
17376
  maxWidth: fullWidth
@@ -17472,9 +17470,9 @@
17472
17470
  const themeSpacing = theme.spacing(propValue);
17473
17471
  if (themeSpacing !== '0px') {
17474
17472
  return {
17475
- marginTop: `-${getOffset(themeSpacing)}`,
17473
+ marginTop: `-${getOffset$1(themeSpacing)}`,
17476
17474
  [`& > .${gridClasses.item}`]: {
17477
- paddingTop: getOffset(themeSpacing)
17475
+ paddingTop: getOffset$1(themeSpacing)
17478
17476
  }
17479
17477
  };
17480
17478
  }
@@ -17519,10 +17517,10 @@
17519
17517
  const themeSpacing = theme.spacing(propValue);
17520
17518
  if (themeSpacing !== '0px') {
17521
17519
  return {
17522
- width: `calc(100% + ${getOffset(themeSpacing)})`,
17523
- marginLeft: `-${getOffset(themeSpacing)}`,
17520
+ width: `calc(100% + ${getOffset$1(themeSpacing)})`,
17521
+ marginLeft: `-${getOffset$1(themeSpacing)}`,
17524
17522
  [`& > .${gridClasses.item}`]: {
17525
- paddingLeft: getOffset(themeSpacing)
17523
+ paddingLeft: getOffset$1(themeSpacing)
17526
17524
  }
17527
17525
  };
17528
17526
  }
@@ -19854,6 +19852,10 @@
19854
19852
  }));
19855
19853
  let hystersisOpen = false;
19856
19854
  let hystersisTimer = null;
19855
+ let cursorPosition = {
19856
+ x: 0,
19857
+ y: 0
19858
+ };
19857
19859
  function composeEventHandler(handler, eventHandler) {
19858
19860
  return event => {
19859
19861
  if (eventHandler) {
@@ -20078,17 +20080,13 @@
20078
20080
  if (!title && title !== 0) {
20079
20081
  open = false;
20080
20082
  }
20081
- const positionRef = reactExports.useRef({
20082
- x: 0,
20083
- y: 0
20084
- });
20085
20083
  const popperRef = reactExports.useRef();
20086
20084
  const handleMouseMove = event => {
20087
20085
  const childrenProps = children.props;
20088
20086
  if (childrenProps.onMouseMove) {
20089
20087
  childrenProps.onMouseMove(event);
20090
20088
  }
20091
- positionRef.current = {
20089
+ cursorPosition = {
20092
20090
  x: event.clientX,
20093
20091
  y: event.clientY
20094
20092
  };
@@ -20179,10 +20177,10 @@
20179
20177
  placement: placement,
20180
20178
  anchorEl: followCursor ? {
20181
20179
  getBoundingClientRect: () => ({
20182
- top: positionRef.current.y,
20183
- left: positionRef.current.x,
20184
- right: positionRef.current.x,
20185
- bottom: positionRef.current.y,
20180
+ top: cursorPosition.y,
20181
+ left: cursorPosition.x,
20182
+ right: cursorPosition.x,
20183
+ bottom: cursorPosition.y,
20186
20184
  width: 0,
20187
20185
  height: 0
20188
20186
  })
@@ -21114,7 +21112,9 @@
21114
21112
  let {
21115
21113
  select,
21116
21114
  confirm,
21117
- cancel
21115
+ cancel,
21116
+ setScrollPosition,
21117
+ focusListItems
21118
21118
  } = _ref;
21119
21119
  const getElement = function (elm) {
21120
21120
  let next = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
@@ -21129,7 +21129,8 @@
21129
21129
  let elementToFocus;
21130
21130
  const {
21131
21131
  keyCode,
21132
- shiftKey = false
21132
+ shiftKey = false,
21133
+ ctrlKey = false
21133
21134
  } = event.nativeEvent;
21134
21135
  switch (keyCode) {
21135
21136
  case KEYS.SHIFT:
@@ -21168,6 +21169,22 @@
21168
21169
  cancel();
21169
21170
  return;
21170
21171
  // let it propagate to top-level
21172
+ case KEYS.HOME:
21173
+ focusListItems.setFirst(true);
21174
+ if (ctrlKey) {
21175
+ setScrollPosition === null || setScrollPosition === void 0 ? void 0 : setScrollPosition('overflowStart');
21176
+ break;
21177
+ }
21178
+ setScrollPosition === null || setScrollPosition === void 0 ? void 0 : setScrollPosition('start');
21179
+ break;
21180
+ case KEYS.END:
21181
+ focusListItems.setLast(true);
21182
+ if (ctrlKey) {
21183
+ setScrollPosition === null || setScrollPosition === void 0 ? void 0 : setScrollPosition('overflowEnd');
21184
+ break;
21185
+ }
21186
+ setScrollPosition === null || setScrollPosition === void 0 ? void 0 : setScrollPosition('end');
21187
+ break;
21171
21188
  default:
21172
21189
  return;
21173
21190
  // don't stop propagation since we want to outsource keydown to other handlers.
@@ -21445,15 +21462,26 @@
21445
21462
  showGray = true,
21446
21463
  columnCount = 1,
21447
21464
  rowCount = 1,
21448
- layoutOrder
21465
+ layoutOrder,
21466
+ dataOffset,
21467
+ focusListItems,
21468
+ listCount
21449
21469
  } = data;
21450
21470
  let cellIndex;
21451
21471
  let styles;
21472
+ const count = {
21473
+ max: null,
21474
+ currentIndex: null
21475
+ };
21452
21476
  if (typeof rowIndex === 'number' && typeof columnIndex === 'number') {
21453
21477
  if (layoutOrder === 'row') {
21454
21478
  cellIndex = rowIndex * columnCount + columnIndex;
21479
+ count.max = rowCount;
21480
+ count.currentIndex = rowIndex;
21455
21481
  } else {
21456
21482
  cellIndex = columnIndex * rowCount + rowIndex;
21483
+ count.max = columnCount;
21484
+ count.currentIndex = columnIndex;
21457
21485
  }
21458
21486
  const padding = 0;
21459
21487
  styles = _objectSpread2(_objectSpread2({}, style), {}, {
@@ -21463,9 +21491,27 @@
21463
21491
  });
21464
21492
  } else {
21465
21493
  cellIndex = index;
21494
+ count.max = listCount;
21495
+ count.currentIndex = index;
21466
21496
  styles = _objectSpread2({}, style);
21467
21497
  }
21468
- const handleKeyDownCallback = reactExports.useCallback(getFieldKeyboardNavigation(actions), [actions]);
21498
+ cellIndex += dataOffset;
21499
+ const rowRef = reactExports.useRef(null);
21500
+ reactExports.useEffect(() => {
21501
+ if (rowRef.current !== null) {
21502
+ if (count.currentIndex === 0 && focusListItems.first) {
21503
+ rowRef.current.focus();
21504
+ focusListItems.setFirst(false);
21505
+ }
21506
+ if (count.currentIndex === count.max - 1 && focusListItems.last) {
21507
+ rowRef.current.focus();
21508
+ focusListItems.setLast(false);
21509
+ }
21510
+ }
21511
+ }, [rowRef.current]);
21512
+ const handleKeyDownCallback = reactExports.useCallback(getFieldKeyboardNavigation(_objectSpread2(_objectSpread2({}, actions), {}, {
21513
+ focusListItems
21514
+ })), [actions]);
21469
21515
  const [isSelected, setSelected] = reactExports.useState(false);
21470
21516
  const [cell, setCell] = reactExports.useState();
21471
21517
  const [classArr, setClassArr] = reactExports.useState([]);
@@ -21640,6 +21686,7 @@
21640
21686
  flexBasisProp: flexBasisVal,
21641
21687
  dense: dense
21642
21688
  }, /*#__PURE__*/React.createElement(Grid$1, {
21689
+ ref: rowRef,
21643
21690
  container: true,
21644
21691
  gap: 0,
21645
21692
  className: joinClassNames(['value', ...classArr]),
@@ -23219,11 +23266,18 @@
23219
23266
  }
23220
23267
 
23221
23268
  const getIndex = (renderProps, isColumnLayout) => {
23222
- if (renderProps !== null && renderProps !== void 0 && renderProps.visibleRowStopIndex || renderProps.visibleColumnStopIndex) {
23269
+ if ((renderProps === null || renderProps === void 0 ? void 0 : renderProps.visibleRowStopIndex) !== undefined || renderProps.visibleColumnStopIndex !== undefined) {
23223
23270
  return isColumnLayout ? renderProps.visibleColumnStopIndex : renderProps.visibleRowStopIndex;
23224
23271
  }
23225
23272
  return renderProps.visibleStopIndex;
23226
23273
  };
23274
+ const getIsScrollTop = (renderProps, isColumnLayout) => {
23275
+ if ((renderProps === null || renderProps === void 0 ? void 0 : renderProps.visibleRowStartIndex) !== undefined || renderProps.visibleColumnStartIndex !== undefined) {
23276
+ return isColumnLayout ? renderProps.visibleColumnStartIndex === 0 : renderProps.visibleRowStartIndex === 0;
23277
+ }
23278
+ return renderProps.visibleStartIndex === 0;
23279
+ };
23280
+ const getIsEndOfData = (qCardinal, index, count, dataOffset) => qCardinal === index * count + dataOffset + count;
23227
23281
  function handleSetOverflowDisclaimer(_ref) {
23228
23282
  let {
23229
23283
  renderProps,
@@ -23231,14 +23285,18 @@
23231
23285
  maxCount,
23232
23286
  columnCount,
23233
23287
  rowCount,
23234
- overflowDisclaimer
23288
+ overflowDisclaimer,
23289
+ qCardinal,
23290
+ dataOffset
23235
23291
  } = _ref;
23236
23292
  const isColumnLayout = (layoutOptions === null || layoutOptions === void 0 ? void 0 : layoutOptions.layoutOrder) === 'column' && layoutOptions.dataLayout !== 'singleColumn';
23237
23293
  const index = getIndex(renderProps, isColumnLayout);
23238
23294
  const stopIndex = isColumnLayout ? maxCount.column : maxCount.row;
23239
23295
  const count = isColumnLayout ? columnCount : rowCount;
23240
23296
  const overflowPossible = count >= stopIndex;
23241
- const show = overflowPossible && index >= stopIndex - 1 || overflowDisclaimer.state.show;
23297
+ const isEndOfData = getIsEndOfData(qCardinal, index, isColumnLayout ? rowCount : columnCount, dataOffset);
23298
+ const isTopOfOverflowData = !!dataOffset && getIsScrollTop(renderProps, isColumnLayout);
23299
+ const show = overflowPossible && !isEndOfData && index >= stopIndex - 1 || isTopOfOverflowData || overflowDisclaimer.state.show; // If its shown once, the user have to dismiss to hide it.
23242
23300
  overflowDisclaimer.set(show);
23243
23301
  }
23244
23302
 
@@ -23269,7 +23327,9 @@
23269
23327
  listLayout,
23270
23328
  sizes,
23271
23329
  listCount,
23272
- overflowDisclaimer
23330
+ overflowDisclaimer,
23331
+ setScrollPosition,
23332
+ focusListItems
23273
23333
  } = _ref;
23274
23334
  const {
23275
23335
  layoutOptions = {},
@@ -23312,12 +23372,15 @@
23312
23372
  actions: {
23313
23373
  select,
23314
23374
  confirm: () => selections === null || selections === void 0 ? void 0 : selections.confirm.call(selections),
23315
- cancel: () => selections === null || selections === void 0 ? void 0 : selections.cancel.call(selections)
23375
+ cancel: () => selections === null || selections === void 0 ? void 0 : selections.cancel.call(selections),
23376
+ setScrollPosition
23316
23377
  },
23317
23378
  frequencyMax,
23318
23379
  histogram,
23319
23380
  keyboard,
23320
- showGray
23381
+ showGray,
23382
+ dataOffset: local.current.dataOffset,
23383
+ focusListItems
23321
23384
  });
23322
23385
  const List = _ref2 => {
23323
23386
  let {
@@ -23334,9 +23397,12 @@
23334
23397
  width: width,
23335
23398
  itemCount: listCount,
23336
23399
  layout: listLayout,
23337
- itemData: _objectSpread2({}, commonItemData),
23400
+ itemData: _objectSpread2(_objectSpread2({}, commonItemData), {}, {
23401
+ listCount
23402
+ }),
23338
23403
  itemSize: itemSize,
23339
23404
  onItemsRendered: renderProps => {
23405
+ var _layout$qListObject, _layout$qListObject$q;
23340
23406
  if (scrollState) {
23341
23407
  scrollState.setScrollPos(renderProps.visibleStopIndex);
23342
23408
  }
@@ -23346,7 +23412,9 @@
23346
23412
  maxCount: sizes.maxCount,
23347
23413
  columnCount,
23348
23414
  rowCount,
23349
- overflowDisclaimer
23415
+ overflowDisclaimer,
23416
+ qCardinal: layout === null || layout === void 0 ? void 0 : (_layout$qListObject = layout.qListObject) === null || _layout$qListObject === void 0 ? void 0 : (_layout$qListObject$q = _layout$qListObject.qDimensionInfo) === null || _layout$qListObject$q === void 0 ? void 0 : _layout$qListObject$q.qCardinal,
23417
+ dataOffset: local.current.dataOffset
23350
23418
  });
23351
23419
  onItemsRendered(_objectSpread2({}, renderProps));
23352
23420
  },
@@ -23370,6 +23438,7 @@
23370
23438
  // eslint-disable-next-line no-param-reassign
23371
23439
  local.current.listRef = ref;
23372
23440
  const handleGridItemsRendered = renderProps => {
23441
+ var _layout$qListObject2, _layout$qListObject2$;
23373
23442
  const renderOptions = deriveRenderOptions({
23374
23443
  renderProps,
23375
23444
  scrollState,
@@ -23383,7 +23452,9 @@
23383
23452
  maxCount: sizes.maxCount,
23384
23453
  columnCount,
23385
23454
  rowCount,
23386
- overflowDisclaimer
23455
+ overflowDisclaimer,
23456
+ qCardinal: layout === null || layout === void 0 ? void 0 : (_layout$qListObject2 = layout.qListObject) === null || _layout$qListObject2 === void 0 ? void 0 : (_layout$qListObject2$ = _layout$qListObject2.qDimensionInfo) === null || _layout$qListObject2$ === void 0 ? void 0 : _layout$qListObject2$.qCardinal,
23457
+ dataOffset: local.current.dataOffset
23387
23458
  });
23388
23459
  onItemsRendered(renderOptions);
23389
23460
  };
@@ -23554,9 +23625,10 @@
23554
23625
  const [pages, setPages] = reactExports.useState([]);
23555
23626
  let [minimumBatchSize] = reactExports.useState(0);
23556
23627
  const loadMoreItems = (startIndex, stopIndex) => {
23628
+ const offset = local.current.dataOffset;
23557
23629
  local.current.queue.push({
23558
- start: startIndex,
23559
- stop: stopIndex
23630
+ start: startIndex + offset,
23631
+ stop: stopIndex + offset
23560
23632
  });
23561
23633
  const isScrolling = loaderRef.current ?
23562
23634
  // eslint-disable-next-line no-underscore-dangle
@@ -23799,6 +23871,47 @@
23799
23871
  }, /*#__PURE__*/React.createElement(SmallCloseIcon, null))));
23800
23872
  }
23801
23873
 
23874
+ const getOffset = (layout, listCount) => {
23875
+ const totalLength = layout.qListObject.qDimensionInfo.qCardinal;
23876
+ const offset = totalLength - listCount;
23877
+ return offset;
23878
+ };
23879
+ function getScrollIndex(_ref) {
23880
+ let {
23881
+ position,
23882
+ isRow,
23883
+ sizes,
23884
+ layout,
23885
+ offset
23886
+ } = _ref;
23887
+ let scrollIndex;
23888
+ let triggerRerender = false;
23889
+ let newOffset = offset !== null && offset !== void 0 ? offset : 0;
23890
+ switch (position) {
23891
+ case 'start':
23892
+ scrollIndex = 0;
23893
+ break;
23894
+ case 'end':
23895
+ scrollIndex = isRow ? sizes.rowCount : sizes.columnCount;
23896
+ break;
23897
+ case 'overflowStart':
23898
+ newOffset = 0;
23899
+ scrollIndex = 0;
23900
+ triggerRerender = true;
23901
+ break;
23902
+ case 'overflowEnd':
23903
+ newOffset = getOffset(layout, sizes.listCount);
23904
+ scrollIndex = layout.qListObject.qDimensionInfo.qCardinal;
23905
+ triggerRerender = true;
23906
+ break;
23907
+ }
23908
+ return {
23909
+ scrollIndex,
23910
+ offset: newOffset,
23911
+ triggerRerender
23912
+ };
23913
+ }
23914
+
23802
23915
  const _excluded$4 = ["isLoadingData"];
23803
23916
  const DEFAULT_MIN_BATCH_SIZE = 100;
23804
23917
  function ListBox(_ref) {
@@ -23831,7 +23944,8 @@
23831
23944
  const loaderRef = reactExports.useRef(null);
23832
23945
  const local = reactExports.useRef({
23833
23946
  queue: [],
23834
- validPages: false
23947
+ validPages: false,
23948
+ dataOffset: 0
23835
23949
  });
23836
23950
  const listData = reactExports.useRef({
23837
23951
  pages: []
@@ -23889,6 +24003,23 @@
23889
24003
  doc: document,
23890
24004
  isSingleSelect
23891
24005
  });
24006
+ const {
24007
+ layoutOptions = {}
24008
+ } = layout || {};
24009
+ let isRow = true;
24010
+ if (layoutOptions.dataLayout) {
24011
+ isRow = layoutOptions.dataLayout === 'singleColumn' ? true : (layoutOptions === null || layoutOptions === void 0 ? void 0 : layoutOptions.layoutOrder) === 'row';
24012
+ }
24013
+ const isGrid = (layoutOptions === null || layoutOptions === void 0 ? void 0 : layoutOptions.dataLayout) === 'grid';
24014
+ const scrollToIndex = index => {
24015
+ const gridIndex = _objectSpread2({}, isRow ? {
24016
+ rowIndex: index
24017
+ } : {
24018
+ columnIndex: index
24019
+ });
24020
+ const scrollIndex = isGrid ? gridIndex : index;
24021
+ loaderRef.current._listRef.scrollToItem(scrollIndex);
24022
+ };
23892
24023
  const fetchData = () => {
23893
24024
  local.current.queue = [];
23894
24025
  local.current.validPages = false;
@@ -23898,7 +24029,8 @@
23898
24029
  if (layout && layout.qSelectionInfo.qInSelections) {
23899
24030
  return;
23900
24031
  }
23901
- loaderRef.current._listRef.scrollToItem(0);
24032
+ local.current.dataOffset = 0;
24033
+ scrollToIndex(0);
23902
24034
  }
23903
24035
  };
23904
24036
  if (update) {
@@ -23919,14 +24051,11 @@
23919
24051
  }, [loaderRef.current]);
23920
24052
  reactExports.useEffect(() => {
23921
24053
  fetchData();
23922
- }, [layout]);
24054
+ }, [layout, local.current.dataOffset]);
23923
24055
  const textWidth = useTextWidth({
23924
24056
  text: getMeasureText(layout),
23925
24057
  font: '14px Source sans pro'
23926
24058
  });
23927
- const {
23928
- layoutOptions = {}
23929
- } = layout || {};
23930
24059
  let minimumBatchSize = DEFAULT_MIN_BATCH_SIZE;
23931
24060
  const isVertical = layoutOptions.dataLayout ? layoutOptions.dataLayout === 'singleColumn' : listLayout !== 'horizontal';
23932
24061
  const count = layout === null || layout === void 0 ? void 0 : (_layout$qListObject$q = layout.qListObject.qSize) === null || _layout$qListObject$q === void 0 ? void 0 : _layout$qListObject$q.qcy;
@@ -23950,9 +24079,41 @@
23950
24079
  listCount
23951
24080
  } = sizes;
23952
24081
  setStoreValue('listCount', listCount);
24082
+ const setScrollPosition = position => {
24083
+ const {
24084
+ scrollIndex,
24085
+ offset,
24086
+ triggerRerender
24087
+ } = getScrollIndex({
24088
+ position,
24089
+ isRow,
24090
+ sizes,
24091
+ layout,
24092
+ offset: local.current.dataOffset
24093
+ });
24094
+ local.current.dataOffset = offset;
24095
+ if (triggerRerender) {
24096
+ setPages(currentPages => [...currentPages]);
24097
+ }
24098
+ scrollToIndex(scrollIndex);
24099
+ };
23953
24100
  const {
23954
24101
  textAlign
23955
24102
  } = (layout === null || layout === void 0 ? void 0 : layout.qListObject.qDimensionInfo) || {};
24103
+ const [focusListItem, setFocusListItem] = reactExports.useState({
24104
+ first: false,
24105
+ last: false
24106
+ });
24107
+ const getFocusState = () => ({
24108
+ first: focusListItem.first,
24109
+ setFirst: first => setFocusListItem(prevState => _objectSpread2(_objectSpread2({}, prevState), {}, {
24110
+ first
24111
+ })),
24112
+ last: focusListItem.last,
24113
+ setLast: last => setFocusListItem(prevState => _objectSpread2(_objectSpread2({}, prevState), {}, {
24114
+ last
24115
+ }))
24116
+ });
23956
24117
  const {
23957
24118
  List,
23958
24119
  Grid
@@ -23981,7 +24142,9 @@
23981
24142
  overflowDisclaimer: {
23982
24143
  state: overflowDisclaimer,
23983
24144
  set: showOverflowDisclaimer
23984
- }
24145
+ },
24146
+ setScrollPosition,
24147
+ focusListItems: getFocusState()
23985
24148
  });
23986
24149
  const {
23987
24150
  columnWidth,
@@ -24579,6 +24742,7 @@
24579
24742
  var SearchIcon = (props => SvgIcon(search(props)));
24580
24743
 
24581
24744
  const TREE_PATH = '/qListObjectDef';
24745
+ const WILDCARD = '**';
24582
24746
  const StyledInputAdornment = styled$1(InputAdornment$1)(_ref => {
24583
24747
  var _theme$listBox, _theme$listBox$conten;
24584
24748
  let {
@@ -24603,12 +24767,15 @@
24603
24767
  model,
24604
24768
  keyboard,
24605
24769
  dense = false,
24606
- visible = true
24770
+ visible = true,
24771
+ wildCardSearch = true
24607
24772
  } = _ref3;
24608
24773
  const {
24609
24774
  translator
24610
24775
  } = reactExports.useContext(InstanceContext);
24611
24776
  const [value, setValue] = reactExports.useState('');
24777
+ const [wildcardOn, setWildcardOn] = reactExports.useState(false);
24778
+ const inputRef = reactExports.useRef();
24612
24779
  const theme = useTheme$1();
24613
24780
  const {
24614
24781
  getStoreValue
@@ -24635,6 +24802,13 @@
24635
24802
  selections.removeListener && selections.removeListener('deactivated', abortSearch);
24636
24803
  };
24637
24804
  }, []);
24805
+ reactExports.useEffect(() => {
24806
+ if (wildcardOn && inputRef.current) {
24807
+ const cursorPos = value.length - 1;
24808
+ inputRef.current.setSelectionRange(cursorPos, cursorPos); // place the cursor in the wildcard
24809
+ setWildcardOn(false);
24810
+ }
24811
+ }, [wildcardOn, inputRef.current]);
24638
24812
  const onChange = async e => {
24639
24813
  setValue(e.target.value);
24640
24814
  if (!e.target.value.length) {
@@ -24643,6 +24817,10 @@
24643
24817
  return model.searchListObjectFor(TREE_PATH, e.target.value);
24644
24818
  };
24645
24819
  const handleFocus = () => {
24820
+ if (wildCardSearch) {
24821
+ setValue(WILDCARD);
24822
+ setWildcardOn(true);
24823
+ }
24646
24824
  if (!selections.isModal()) {
24647
24825
  selections.begin(['/qListObjectDef']);
24648
24826
  }
@@ -24706,6 +24884,7 @@
24706
24884
  paddingBottom: '5px'
24707
24885
  }
24708
24886
  }],
24887
+ inputRef: inputRef,
24709
24888
  size: "small",
24710
24889
  fullWidth: true,
24711
24890
  placeholder: translator.get('Listbox.Search'),
@@ -26507,6 +26686,7 @@
26507
26686
  const searchHeight = dense ? 27 : 40;
26508
26687
  const extraheight = dense ? 39 : 49;
26509
26688
  const minHeight = 49 + (searchVisible ? searchHeight : 0) + extraheight;
26689
+ const wildCardSearch = layout === null || layout === void 0 ? void 0 : layout.wildCardSearch;
26510
26690
  const onShowSearch = () => {
26511
26691
  const newValue = !showSearch;
26512
26692
  setShowSearch(newValue);
@@ -26603,7 +26783,8 @@
26603
26783
  dense: dense,
26604
26784
  keyboard: keyboard,
26605
26785
  visible: searchVisible,
26606
- searchContainerRef: searchContainerRef
26786
+ searchContainerRef: searchContainerRef,
26787
+ wildCardSearch: wildCardSearch
26607
26788
  })), /*#__PURE__*/React.createElement(Grid$1, {
26608
26789
  item: true,
26609
26790
  xs: true
@@ -26948,6 +27129,9 @@
26948
27129
  const [showState, setShowstate] = reactExports.useState(!!options.show);
26949
27130
  const handleCloseShowState = () => {
26950
27131
  setShowstate(false);
27132
+ if (options.onPopoverClose) {
27133
+ options.onPopoverClose();
27134
+ }
26951
27135
  };
26952
27136
  return /*#__PURE__*/React.createElement(ListBoxPopover, {
26953
27137
  show: showState,
@@ -33948,6 +34132,23 @@
33948
34132
  let selectionsApi = null;
33949
34133
  let selectionsComponentReference = null;
33950
34134
 
34135
+ /**
34136
+ * @ignore
34137
+ * @typedef { 'fieldPopoverClose' } EmbedEventTypes
34138
+ */
34139
+
34140
+ /**
34141
+ * Event listener function on instance
34142
+ *
34143
+ * @ignore
34144
+ * @method
34145
+ * @name Embed#on
34146
+ * @param {EmbedEventTypes} eventType event type that function needs to listen
34147
+ * @param {Function} callback a callback function to run when event emits
34148
+ * @example
34149
+ * api.on('someEvent', () => {...});
34150
+ */
34151
+
33951
34152
  /**
33952
34153
  * @class
33953
34154
  * @alias Embed
@@ -34182,7 +34383,10 @@
34182
34383
  root.remove(api._popoverInstance);
34183
34384
  api._popoverInstance = null;
34184
34385
  }
34185
- const opts = getOptions(options);
34386
+ const onPopoverClose = () => api.emit('fieldPopoverClose');
34387
+ const opts = getOptions(_objectSpread2({
34388
+ onPopoverClose
34389
+ }, options));
34186
34390
  api._popoverInstance = React.createElement(ListBoxPopoverWrapper, {
34187
34391
  element: anchorElement,
34188
34392
  key: uid(),
@@ -34197,6 +34401,7 @@
34197
34401
  };
34198
34402
  halo.public.nebbie = api;
34199
34403
  halo.types = types;
34404
+ eventmixin(api);
34200
34405
  return api;
34201
34406
  }
34202
34407