@nebula.js/stardust 3.1.2 → 3.2.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.
@@ -1,5 +1,5 @@
1
1
  /*
2
- * @nebula.js/stardust v3.1.2
2
+ * @nebula.js/stardust v3.2.0
3
3
  * Copyright (c) 2023 QlikTech International AB
4
4
  * Released under the MIT license.
5
5
  */
@@ -1020,6 +1020,46 @@
1020
1020
  "zh-TW": "{0}/ {1}"
1021
1021
  }
1022
1022
  };
1023
+ var Listbox_Dismiss = {
1024
+ id: "Listbox.Dismiss",
1025
+ locale: {
1026
+ "de-DE": "Schließen",
1027
+ "en-US": "Dismiss",
1028
+ "es-ES": "Descartar",
1029
+ "fr-FR": "Ignorer",
1030
+ "it-IT": "Ignora",
1031
+ "ja-JP": "却下",
1032
+ "ko-KR": "해제",
1033
+ "nl-NL": "Overslaan",
1034
+ "pl-PL": "Zamknij",
1035
+ "pt-BR": "Ignorar",
1036
+ "ru-RU": "Пропустить",
1037
+ "sv-SE": "Hoppa över",
1038
+ "tr-TR": "Kapat",
1039
+ "zh-CN": "离开",
1040
+ "zh-TW": "解除"
1041
+ }
1042
+ };
1043
+ var Listbox_ItemsOverflow = {
1044
+ id: "Listbox.ItemsOverflow",
1045
+ locale: {
1046
+ "de-DE": "Derzeit wird ein eingeschränkter Datensatz angezeigt, verwenden Sie die Suche, um die Größe zu reduzieren",
1047
+ "en-US": "Currently showing a limited data set, use search to reduce the size",
1048
+ "es-ES": "Actualmente se muestra un conjunto de datos limitado, utilice la búsqueda para reducir el tamaño",
1049
+ "fr-FR": "Ensemble de données limité actuellement affiché. Utilisez la rechercher pour réduire la taille.",
1050
+ "it-IT": "Attualmente visualizzato un set di dati limitato; utilizzare la ricerca per ridurre le dimensioni",
1051
+ "ja-JP": "現在表示されているデータ セットは制限されているため、検索を使ってサイズを縮小してください",
1052
+ "ko-KR": "현재 제한된 데이터 집합이 표시되고 있습니다. 검색을 사용하여 크기를 줄이십시오.",
1053
+ "nl-NL": "Er wordt momenteel een beperkte gegevensverzameling getoond, gebruik Zoeken om de omvang te verkleinen",
1054
+ "pl-PL": "Wyświetlany jest ograniczony zestaw danych. Użyj wyszukiwania, aby zmniejszyć rozmiar.",
1055
+ "pt-BR": "Atualmente mostrando um conjunto de dados limitado, use a pesquisa para reduzir o tamanho",
1056
+ "ru-RU": "Сейчас отображается ограниченный набор данных. Используйте поиск, чтобы уменьшить размер.",
1057
+ "sv-SE": "En begränsad datauppsättning visas. Använd sök för att minska storleken",
1058
+ "tr-TR": "Şu anda sınırlı bir veri kümesi gösteriliyor. Boyutu azaltmak için arama işlevini kullanın",
1059
+ "zh-CN": "目前显示有限的数据集,使用搜索来减少大小",
1060
+ "zh-TW": "目前顯示有限資料集,請使用搜尋減少大小"
1061
+ }
1062
+ };
1023
1063
  var Listbox_Lock = {
1024
1064
  id: "Listbox.Lock",
1025
1065
  locale: {
@@ -1040,6 +1080,26 @@
1040
1080
  "zh-TW": "鎖定選項"
1041
1081
  }
1042
1082
  };
1083
+ var Listbox_NoMatchesForYourTerms = {
1084
+ id: "Listbox.NoMatchesForYourTerms",
1085
+ locale: {
1086
+ "de-DE": "Für Ihre Suche wurden keine Übereinstimmungen gefunden.",
1087
+ "en-US": "There are no matches for your search.",
1088
+ "es-ES": "No hay resultados para su búsqueda.",
1089
+ "fr-FR": "Aucun résultat ne correspond à votre recherche.",
1090
+ "it-IT": "Non è stata trovata alcuna corrispondenza per questa ricerca.",
1091
+ "ja-JP": "検索に一致するものがありません。",
1092
+ "ko-KR": "검색에 대해 일치하는 항목이 없습니다.",
1093
+ "nl-NL": "Er zijn geen overeenkomsten voor uw zoekopdracht.",
1094
+ "pl-PL": "Brak dopasowań dla tego wyszukiwania.",
1095
+ "pt-BR": "Não há correspondências para sua pesquisa.",
1096
+ "ru-RU": "Нет совпадений по вашему поисковому запросу.",
1097
+ "sv-SE": "Det finns inga matchningar för din sökning.",
1098
+ "tr-TR": "Aramanızla eşleşen sonuç yok.",
1099
+ "zh-CN": "您的搜索条件没有任何匹配结果。",
1100
+ "zh-TW": "沒有與您搜尋相符的項目。"
1101
+ }
1102
+ };
1043
1103
  var Listbox_ResultFilterLabel = {
1044
1104
  id: "Listbox.ResultFilterLabel",
1045
1105
  locale: {
@@ -1060,26 +1120,6 @@
1060
1120
  "zh-TW": "搜尋結果篩選"
1061
1121
  }
1062
1122
  };
1063
- var Listbox_NoMatchesForYourTerms = {
1064
- id: "Listbox.NoMatchesForYourTerms",
1065
- locale: {
1066
- "de-DE": "Für Ihre Suche wurden keine Übereinstimmungen gefunden.",
1067
- "en-US": "There are no matches for your search.",
1068
- "es-ES": "No hay resultados para su búsqueda.",
1069
- "fr-FR": "Aucun résultat ne correspond à votre recherche.",
1070
- "it-IT": "Non esistono corrispondenze per la ricerca.",
1071
- "ja-JP": "検索に一致するものがありません。",
1072
- "ko-KR": "검색에 대해 일치하는 항목이 없습니다.",
1073
- "nl-NL": "Er zijn geen overeenkomsten voor uw zoekopdracht.",
1074
- "pl-PL": "Brak dopasowań dla tego wyszukiwania.",
1075
- "pt-BR": "Não há correspondências para sua pesquisa.",
1076
- "ru-RU": "Нет совпадений для искомого текста.",
1077
- "sv-SE": "Det finns inga matchningar för din sökning.",
1078
- "tr-TR": "Aramanızla eşleşen sonuç yok.",
1079
- "zh-CN": "您的搜索条件没有任何匹配结果。",
1080
- "zh-TW": "沒有與您搜尋相符的項目。"
1081
- }
1082
- };
1083
1123
  var Listbox_ScreenReaderInstructions = {
1084
1124
  id: "Listbox.ScreenReaderInstructions",
1085
1125
  locale: {
@@ -1640,25 +1680,15 @@
1640
1680
  "zh-TW": "不符計算條件"
1641
1681
  }
1642
1682
  };
1643
- var Listbox_ItemsOverflow = {
1644
- id: "Listbox.ItemsOverflow",
1645
- locale: {
1646
- "en-US": "Currently showing a limited data set, use search to reduce the size"
1647
- }
1648
- };
1649
- var Listbox_Dismiss = {
1650
- id: "Listbox.Dismiss",
1651
- locale: {
1652
- "en-US": "Dismiss"
1653
- }
1654
- };
1655
1683
  var all = {
1656
1684
  Cancel: Cancel$1,
1657
1685
  CurrentSelections_All: CurrentSelections_All,
1658
1686
  CurrentSelections_Of: CurrentSelections_Of,
1687
+ Listbox_Dismiss: Listbox_Dismiss,
1688
+ Listbox_ItemsOverflow: Listbox_ItemsOverflow,
1659
1689
  Listbox_Lock: Listbox_Lock,
1660
- Listbox_ResultFilterLabel: Listbox_ResultFilterLabel,
1661
1690
  Listbox_NoMatchesForYourTerms: Listbox_NoMatchesForYourTerms,
1691
+ Listbox_ResultFilterLabel: Listbox_ResultFilterLabel,
1662
1692
  Listbox_ScreenReaderInstructions: Listbox_ScreenReaderInstructions,
1663
1693
  Listbox_Search: Listbox_Search,
1664
1694
  Listbox_Search_ScreenReaderInstructions: Listbox_Search_ScreenReaderInstructions,
@@ -1686,9 +1716,7 @@
1686
1716
  Visualization_Invalid_Dimension: Visualization_Invalid_Dimension,
1687
1717
  Visualization_Invalid_Measure: Visualization_Invalid_Measure,
1688
1718
  Visualization_LayoutError: Visualization_LayoutError,
1689
- Visualization_UnfulfilledCalculationCondition: Visualization_UnfulfilledCalculationCondition,
1690
- Listbox_ItemsOverflow: Listbox_ItemsOverflow,
1691
- Listbox_Dismiss: Listbox_Dismiss
1719
+ Visualization_UnfulfilledCalculationCondition: Visualization_UnfulfilledCalculationCondition
1692
1720
  };
1693
1721
 
1694
1722
  function appLocaleFn(language) {
@@ -9542,7 +9570,7 @@
9542
9570
  }
9543
9571
 
9544
9572
  // Make sure the next tab starts from the right place.
9545
- // doc.activeElement referes to the origin.
9573
+ // doc.activeElement refers to the origin.
9546
9574
  if (doc.activeElement === rootRef.current && nativeEvent.shiftKey) {
9547
9575
  // We need to ignore the next contain as
9548
9576
  // it will try to move the focus back to the rootRef element.
@@ -13889,8 +13917,6 @@
13889
13917
  color: (theme.vars || theme).palette.action.disabled
13890
13918
  }, ownerState.variant === 'outlined' && {
13891
13919
  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
13920
  }, ownerState.variant === 'contained' && {
13895
13921
  color: (theme.vars || theme).palette.action.disabled,
13896
13922
  boxShadow: (theme.vars || theme).shadows[0],
@@ -14362,7 +14388,7 @@
14362
14388
  return cache[key];
14363
14389
  }
14364
14390
 
14365
- const NEBULA_VERSION_HASH = "1f4e" ;
14391
+ const NEBULA_VERSION_HASH = "070a" ;
14366
14392
  ClassNameGenerator$1.configure(componentName => {
14367
14393
  return "njs-".concat(NEBULA_VERSION_HASH, "-").concat(componentName.replace('Mui', ''));
14368
14394
  });
@@ -14881,7 +14907,7 @@
14881
14907
  const appRef = React.createRef();
14882
14908
  const element = document.createElement('div');
14883
14909
  element.style.display = 'none';
14884
- element.setAttribute('data-nebulajs-version', "3.1.2" );
14910
+ element.setAttribute('data-nebulajs-version', "3.2.0" );
14885
14911
  element.setAttribute('data-app-id', app.id);
14886
14912
  document.body.appendChild(element);
14887
14913
  ReactDOM.render( /*#__PURE__*/React.createElement(NebulaApp, {
@@ -16490,7 +16516,7 @@
16490
16516
  onChange,
16491
16517
  onFocus,
16492
16518
  readOnly,
16493
- required,
16519
+ required = false,
16494
16520
  tabIndex,
16495
16521
  type,
16496
16522
  value
@@ -17324,7 +17350,7 @@
17324
17350
  ...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
17351
 
17326
17352
  const _excluded$j = ["className", "columns", "columnSpacing", "component", "container", "direction", "item", "rowSpacing", "spacing", "wrap", "zeroMinWidth"];
17327
- function getOffset(val) {
17353
+ function getOffset$1(val) {
17328
17354
  const parse = parseFloat(val);
17329
17355
  return `${parse}${String(val).replace(String(parse), '') || 'px'}`;
17330
17356
  }
@@ -17372,7 +17398,7 @@
17372
17398
  if (ownerState.container && ownerState.item && ownerState.columnSpacing !== 0) {
17373
17399
  const themeSpacing = theme.spacing(ownerState.columnSpacing);
17374
17400
  if (themeSpacing !== '0px') {
17375
- const fullWidth = `calc(${width} + ${getOffset(themeSpacing)})`;
17401
+ const fullWidth = `calc(${width} + ${getOffset$1(themeSpacing)})`;
17376
17402
  more = {
17377
17403
  flexBasis: fullWidth,
17378
17404
  maxWidth: fullWidth
@@ -17472,9 +17498,9 @@
17472
17498
  const themeSpacing = theme.spacing(propValue);
17473
17499
  if (themeSpacing !== '0px') {
17474
17500
  return {
17475
- marginTop: `-${getOffset(themeSpacing)}`,
17501
+ marginTop: `-${getOffset$1(themeSpacing)}`,
17476
17502
  [`& > .${gridClasses.item}`]: {
17477
- paddingTop: getOffset(themeSpacing)
17503
+ paddingTop: getOffset$1(themeSpacing)
17478
17504
  }
17479
17505
  };
17480
17506
  }
@@ -17519,10 +17545,10 @@
17519
17545
  const themeSpacing = theme.spacing(propValue);
17520
17546
  if (themeSpacing !== '0px') {
17521
17547
  return {
17522
- width: `calc(100% + ${getOffset(themeSpacing)})`,
17523
- marginLeft: `-${getOffset(themeSpacing)}`,
17548
+ width: `calc(100% + ${getOffset$1(themeSpacing)})`,
17549
+ marginLeft: `-${getOffset$1(themeSpacing)}`,
17524
17550
  [`& > .${gridClasses.item}`]: {
17525
- paddingLeft: getOffset(themeSpacing)
17551
+ paddingLeft: getOffset$1(themeSpacing)
17526
17552
  }
17527
17553
  };
17528
17554
  }
@@ -19854,6 +19880,10 @@
19854
19880
  }));
19855
19881
  let hystersisOpen = false;
19856
19882
  let hystersisTimer = null;
19883
+ let cursorPosition = {
19884
+ x: 0,
19885
+ y: 0
19886
+ };
19857
19887
  function composeEventHandler(handler, eventHandler) {
19858
19888
  return event => {
19859
19889
  if (eventHandler) {
@@ -20078,17 +20108,13 @@
20078
20108
  if (!title && title !== 0) {
20079
20109
  open = false;
20080
20110
  }
20081
- const positionRef = reactExports.useRef({
20082
- x: 0,
20083
- y: 0
20084
- });
20085
20111
  const popperRef = reactExports.useRef();
20086
20112
  const handleMouseMove = event => {
20087
20113
  const childrenProps = children.props;
20088
20114
  if (childrenProps.onMouseMove) {
20089
20115
  childrenProps.onMouseMove(event);
20090
20116
  }
20091
- positionRef.current = {
20117
+ cursorPosition = {
20092
20118
  x: event.clientX,
20093
20119
  y: event.clientY
20094
20120
  };
@@ -20179,10 +20205,10 @@
20179
20205
  placement: placement,
20180
20206
  anchorEl: followCursor ? {
20181
20207
  getBoundingClientRect: () => ({
20182
- top: positionRef.current.y,
20183
- left: positionRef.current.x,
20184
- right: positionRef.current.x,
20185
- bottom: positionRef.current.y,
20208
+ top: cursorPosition.y,
20209
+ left: cursorPosition.x,
20210
+ right: cursorPosition.x,
20211
+ bottom: cursorPosition.y,
20186
20212
  width: 0,
20187
20213
  height: 0
20188
20214
  })
@@ -21114,7 +21140,9 @@
21114
21140
  let {
21115
21141
  select,
21116
21142
  confirm,
21117
- cancel
21143
+ cancel,
21144
+ setScrollPosition,
21145
+ focusListItems
21118
21146
  } = _ref;
21119
21147
  const getElement = function (elm) {
21120
21148
  let next = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
@@ -21129,7 +21157,8 @@
21129
21157
  let elementToFocus;
21130
21158
  const {
21131
21159
  keyCode,
21132
- shiftKey = false
21160
+ shiftKey = false,
21161
+ ctrlKey = false
21133
21162
  } = event.nativeEvent;
21134
21163
  switch (keyCode) {
21135
21164
  case KEYS.SHIFT:
@@ -21168,6 +21197,22 @@
21168
21197
  cancel();
21169
21198
  return;
21170
21199
  // let it propagate to top-level
21200
+ case KEYS.HOME:
21201
+ focusListItems.setFirst(true);
21202
+ if (ctrlKey) {
21203
+ setScrollPosition === null || setScrollPosition === void 0 ? void 0 : setScrollPosition('overflowStart');
21204
+ break;
21205
+ }
21206
+ setScrollPosition === null || setScrollPosition === void 0 ? void 0 : setScrollPosition('start');
21207
+ break;
21208
+ case KEYS.END:
21209
+ focusListItems.setLast(true);
21210
+ if (ctrlKey) {
21211
+ setScrollPosition === null || setScrollPosition === void 0 ? void 0 : setScrollPosition('overflowEnd');
21212
+ break;
21213
+ }
21214
+ setScrollPosition === null || setScrollPosition === void 0 ? void 0 : setScrollPosition('end');
21215
+ break;
21171
21216
  default:
21172
21217
  return;
21173
21218
  // don't stop propagation since we want to outsource keydown to other handlers.
@@ -21445,15 +21490,26 @@
21445
21490
  showGray = true,
21446
21491
  columnCount = 1,
21447
21492
  rowCount = 1,
21448
- layoutOrder
21493
+ layoutOrder,
21494
+ dataOffset,
21495
+ focusListItems,
21496
+ listCount
21449
21497
  } = data;
21450
21498
  let cellIndex;
21451
21499
  let styles;
21500
+ const count = {
21501
+ max: null,
21502
+ currentIndex: null
21503
+ };
21452
21504
  if (typeof rowIndex === 'number' && typeof columnIndex === 'number') {
21453
21505
  if (layoutOrder === 'row') {
21454
21506
  cellIndex = rowIndex * columnCount + columnIndex;
21507
+ count.max = rowCount;
21508
+ count.currentIndex = rowIndex;
21455
21509
  } else {
21456
21510
  cellIndex = columnIndex * rowCount + rowIndex;
21511
+ count.max = columnCount;
21512
+ count.currentIndex = columnIndex;
21457
21513
  }
21458
21514
  const padding = 0;
21459
21515
  styles = _objectSpread2(_objectSpread2({}, style), {}, {
@@ -21463,9 +21519,27 @@
21463
21519
  });
21464
21520
  } else {
21465
21521
  cellIndex = index;
21522
+ count.max = listCount;
21523
+ count.currentIndex = index;
21466
21524
  styles = _objectSpread2({}, style);
21467
21525
  }
21468
- const handleKeyDownCallback = reactExports.useCallback(getFieldKeyboardNavigation(actions), [actions]);
21526
+ cellIndex += dataOffset;
21527
+ const rowRef = reactExports.useRef(null);
21528
+ reactExports.useEffect(() => {
21529
+ if (rowRef.current !== null) {
21530
+ if (count.currentIndex === 0 && focusListItems.first) {
21531
+ rowRef.current.focus();
21532
+ focusListItems.setFirst(false);
21533
+ }
21534
+ if (count.currentIndex === count.max - 1 && focusListItems.last) {
21535
+ rowRef.current.focus();
21536
+ focusListItems.setLast(false);
21537
+ }
21538
+ }
21539
+ }, [rowRef.current]);
21540
+ const handleKeyDownCallback = reactExports.useCallback(getFieldKeyboardNavigation(_objectSpread2(_objectSpread2({}, actions), {}, {
21541
+ focusListItems
21542
+ })), [actions]);
21469
21543
  const [isSelected, setSelected] = reactExports.useState(false);
21470
21544
  const [cell, setCell] = reactExports.useState();
21471
21545
  const [classArr, setClassArr] = reactExports.useState([]);
@@ -21612,7 +21686,8 @@
21612
21686
  };
21613
21687
  const iconStyles = {
21614
21688
  alignItems: 'center',
21615
- display: 'flex'
21689
+ display: 'flex',
21690
+ fontSize: '8px'
21616
21691
  };
21617
21692
  const showLock = isSelected && isLocked;
21618
21693
  const showTick = !checkboxes && isSelected && !isLocked;
@@ -21640,6 +21715,7 @@
21640
21715
  flexBasisProp: flexBasisVal,
21641
21716
  dense: dense
21642
21717
  }, /*#__PURE__*/React.createElement(Grid$1, {
21718
+ ref: rowRef,
21643
21719
  container: true,
21644
21720
  gap: 0,
21645
21721
  className: joinClassNames(['value', ...classArr]),
@@ -23219,11 +23295,18 @@
23219
23295
  }
23220
23296
 
23221
23297
  const getIndex = (renderProps, isColumnLayout) => {
23222
- if (renderProps !== null && renderProps !== void 0 && renderProps.visibleRowStopIndex || renderProps.visibleColumnStopIndex) {
23298
+ if ((renderProps === null || renderProps === void 0 ? void 0 : renderProps.visibleRowStopIndex) !== undefined || renderProps.visibleColumnStopIndex !== undefined) {
23223
23299
  return isColumnLayout ? renderProps.visibleColumnStopIndex : renderProps.visibleRowStopIndex;
23224
23300
  }
23225
23301
  return renderProps.visibleStopIndex;
23226
23302
  };
23303
+ const getIsScrollTop = (renderProps, isColumnLayout) => {
23304
+ if ((renderProps === null || renderProps === void 0 ? void 0 : renderProps.visibleRowStartIndex) !== undefined || renderProps.visibleColumnStartIndex !== undefined) {
23305
+ return isColumnLayout ? renderProps.visibleColumnStartIndex === 0 : renderProps.visibleRowStartIndex === 0;
23306
+ }
23307
+ return renderProps.visibleStartIndex === 0;
23308
+ };
23309
+ const getIsEndOfData = (qCardinal, index, count, dataOffset) => qCardinal === index * count + dataOffset + count;
23227
23310
  function handleSetOverflowDisclaimer(_ref) {
23228
23311
  let {
23229
23312
  renderProps,
@@ -23231,14 +23314,18 @@
23231
23314
  maxCount,
23232
23315
  columnCount,
23233
23316
  rowCount,
23234
- overflowDisclaimer
23317
+ overflowDisclaimer,
23318
+ qCardinal,
23319
+ dataOffset
23235
23320
  } = _ref;
23236
23321
  const isColumnLayout = (layoutOptions === null || layoutOptions === void 0 ? void 0 : layoutOptions.layoutOrder) === 'column' && layoutOptions.dataLayout !== 'singleColumn';
23237
23322
  const index = getIndex(renderProps, isColumnLayout);
23238
23323
  const stopIndex = isColumnLayout ? maxCount.column : maxCount.row;
23239
23324
  const count = isColumnLayout ? columnCount : rowCount;
23240
23325
  const overflowPossible = count >= stopIndex;
23241
- const show = overflowPossible && index >= stopIndex - 1 || overflowDisclaimer.state.show;
23326
+ const isEndOfData = getIsEndOfData(qCardinal, index, isColumnLayout ? rowCount : columnCount, dataOffset);
23327
+ const isTopOfOverflowData = !!dataOffset && getIsScrollTop(renderProps, isColumnLayout);
23328
+ const show = overflowPossible && !isEndOfData && index >= stopIndex - 1 || isTopOfOverflowData || overflowDisclaimer.state.show; // If its shown once, the user have to dismiss to hide it.
23242
23329
  overflowDisclaimer.set(show);
23243
23330
  }
23244
23331
 
@@ -23269,7 +23356,9 @@
23269
23356
  listLayout,
23270
23357
  sizes,
23271
23358
  listCount,
23272
- overflowDisclaimer
23359
+ overflowDisclaimer,
23360
+ setScrollPosition,
23361
+ focusListItems
23273
23362
  } = _ref;
23274
23363
  const {
23275
23364
  layoutOptions = {},
@@ -23312,12 +23401,15 @@
23312
23401
  actions: {
23313
23402
  select,
23314
23403
  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)
23404
+ cancel: () => selections === null || selections === void 0 ? void 0 : selections.cancel.call(selections),
23405
+ setScrollPosition
23316
23406
  },
23317
23407
  frequencyMax,
23318
23408
  histogram,
23319
23409
  keyboard,
23320
- showGray
23410
+ showGray,
23411
+ dataOffset: local.current.dataOffset,
23412
+ focusListItems
23321
23413
  });
23322
23414
  const List = _ref2 => {
23323
23415
  let {
@@ -23334,9 +23426,12 @@
23334
23426
  width: width,
23335
23427
  itemCount: listCount,
23336
23428
  layout: listLayout,
23337
- itemData: _objectSpread2({}, commonItemData),
23429
+ itemData: _objectSpread2(_objectSpread2({}, commonItemData), {}, {
23430
+ listCount
23431
+ }),
23338
23432
  itemSize: itemSize,
23339
23433
  onItemsRendered: renderProps => {
23434
+ var _layout$qListObject, _layout$qListObject$q;
23340
23435
  if (scrollState) {
23341
23436
  scrollState.setScrollPos(renderProps.visibleStopIndex);
23342
23437
  }
@@ -23346,7 +23441,9 @@
23346
23441
  maxCount: sizes.maxCount,
23347
23442
  columnCount,
23348
23443
  rowCount,
23349
- overflowDisclaimer
23444
+ overflowDisclaimer,
23445
+ 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,
23446
+ dataOffset: local.current.dataOffset
23350
23447
  });
23351
23448
  onItemsRendered(_objectSpread2({}, renderProps));
23352
23449
  },
@@ -23370,6 +23467,7 @@
23370
23467
  // eslint-disable-next-line no-param-reassign
23371
23468
  local.current.listRef = ref;
23372
23469
  const handleGridItemsRendered = renderProps => {
23470
+ var _layout$qListObject2, _layout$qListObject2$;
23373
23471
  const renderOptions = deriveRenderOptions({
23374
23472
  renderProps,
23375
23473
  scrollState,
@@ -23383,7 +23481,9 @@
23383
23481
  maxCount: sizes.maxCount,
23384
23482
  columnCount,
23385
23483
  rowCount,
23386
- overflowDisclaimer
23484
+ overflowDisclaimer,
23485
+ 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,
23486
+ dataOffset: local.current.dataOffset
23387
23487
  });
23388
23488
  onItemsRendered(renderOptions);
23389
23489
  };
@@ -23554,9 +23654,10 @@
23554
23654
  const [pages, setPages] = reactExports.useState([]);
23555
23655
  let [minimumBatchSize] = reactExports.useState(0);
23556
23656
  const loadMoreItems = (startIndex, stopIndex) => {
23657
+ const offset = local.current.dataOffset;
23557
23658
  local.current.queue.push({
23558
- start: startIndex,
23559
- stop: stopIndex
23659
+ start: startIndex + offset,
23660
+ stop: stopIndex + offset
23560
23661
  });
23561
23662
  const isScrolling = loaderRef.current ?
23562
23663
  // eslint-disable-next-line no-underscore-dangle
@@ -23799,6 +23900,47 @@
23799
23900
  }, /*#__PURE__*/React.createElement(SmallCloseIcon, null))));
23800
23901
  }
23801
23902
 
23903
+ const getOffset = (layout, listCount) => {
23904
+ const totalLength = layout.qListObject.qDimensionInfo.qCardinal;
23905
+ const offset = totalLength - listCount;
23906
+ return offset;
23907
+ };
23908
+ function getScrollIndex(_ref) {
23909
+ let {
23910
+ position,
23911
+ isRow,
23912
+ sizes,
23913
+ layout,
23914
+ offset
23915
+ } = _ref;
23916
+ let scrollIndex;
23917
+ let triggerRerender = false;
23918
+ let newOffset = offset !== null && offset !== void 0 ? offset : 0;
23919
+ switch (position) {
23920
+ case 'start':
23921
+ scrollIndex = 0;
23922
+ break;
23923
+ case 'end':
23924
+ scrollIndex = isRow ? sizes.rowCount : sizes.columnCount;
23925
+ break;
23926
+ case 'overflowStart':
23927
+ newOffset = 0;
23928
+ scrollIndex = 0;
23929
+ triggerRerender = true;
23930
+ break;
23931
+ case 'overflowEnd':
23932
+ newOffset = getOffset(layout, sizes.listCount);
23933
+ scrollIndex = layout.qListObject.qDimensionInfo.qCardinal;
23934
+ triggerRerender = true;
23935
+ break;
23936
+ }
23937
+ return {
23938
+ scrollIndex,
23939
+ offset: newOffset,
23940
+ triggerRerender
23941
+ };
23942
+ }
23943
+
23802
23944
  const _excluded$4 = ["isLoadingData"];
23803
23945
  const DEFAULT_MIN_BATCH_SIZE = 100;
23804
23946
  function ListBox(_ref) {
@@ -23831,7 +23973,8 @@
23831
23973
  const loaderRef = reactExports.useRef(null);
23832
23974
  const local = reactExports.useRef({
23833
23975
  queue: [],
23834
- validPages: false
23976
+ validPages: false,
23977
+ dataOffset: 0
23835
23978
  });
23836
23979
  const listData = reactExports.useRef({
23837
23980
  pages: []
@@ -23889,6 +24032,23 @@
23889
24032
  doc: document,
23890
24033
  isSingleSelect
23891
24034
  });
24035
+ const {
24036
+ layoutOptions = {}
24037
+ } = layout || {};
24038
+ let isRow = true;
24039
+ if (layoutOptions.dataLayout) {
24040
+ isRow = layoutOptions.dataLayout === 'singleColumn' ? true : (layoutOptions === null || layoutOptions === void 0 ? void 0 : layoutOptions.layoutOrder) === 'row';
24041
+ }
24042
+ const isGrid = (layoutOptions === null || layoutOptions === void 0 ? void 0 : layoutOptions.dataLayout) === 'grid';
24043
+ const scrollToIndex = index => {
24044
+ const gridIndex = _objectSpread2({}, isRow ? {
24045
+ rowIndex: index
24046
+ } : {
24047
+ columnIndex: index
24048
+ });
24049
+ const scrollIndex = isGrid ? gridIndex : index;
24050
+ loaderRef.current._listRef.scrollToItem(scrollIndex);
24051
+ };
23892
24052
  const fetchData = () => {
23893
24053
  local.current.queue = [];
23894
24054
  local.current.validPages = false;
@@ -23898,7 +24058,8 @@
23898
24058
  if (layout && layout.qSelectionInfo.qInSelections) {
23899
24059
  return;
23900
24060
  }
23901
- loaderRef.current._listRef.scrollToItem(0);
24061
+ local.current.dataOffset = 0;
24062
+ scrollToIndex(0);
23902
24063
  }
23903
24064
  };
23904
24065
  if (update) {
@@ -23919,14 +24080,11 @@
23919
24080
  }, [loaderRef.current]);
23920
24081
  reactExports.useEffect(() => {
23921
24082
  fetchData();
23922
- }, [layout]);
24083
+ }, [layout, local.current.dataOffset]);
23923
24084
  const textWidth = useTextWidth({
23924
24085
  text: getMeasureText(layout),
23925
24086
  font: '14px Source sans pro'
23926
24087
  });
23927
- const {
23928
- layoutOptions = {}
23929
- } = layout || {};
23930
24088
  let minimumBatchSize = DEFAULT_MIN_BATCH_SIZE;
23931
24089
  const isVertical = layoutOptions.dataLayout ? layoutOptions.dataLayout === 'singleColumn' : listLayout !== 'horizontal';
23932
24090
  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 +24108,41 @@
23950
24108
  listCount
23951
24109
  } = sizes;
23952
24110
  setStoreValue('listCount', listCount);
24111
+ const setScrollPosition = position => {
24112
+ const {
24113
+ scrollIndex,
24114
+ offset,
24115
+ triggerRerender
24116
+ } = getScrollIndex({
24117
+ position,
24118
+ isRow,
24119
+ sizes,
24120
+ layout,
24121
+ offset: local.current.dataOffset
24122
+ });
24123
+ local.current.dataOffset = offset;
24124
+ if (triggerRerender) {
24125
+ setPages(currentPages => [...currentPages]);
24126
+ }
24127
+ scrollToIndex(scrollIndex);
24128
+ };
23953
24129
  const {
23954
24130
  textAlign
23955
24131
  } = (layout === null || layout === void 0 ? void 0 : layout.qListObject.qDimensionInfo) || {};
24132
+ const [focusListItem, setFocusListItem] = reactExports.useState({
24133
+ first: false,
24134
+ last: false
24135
+ });
24136
+ const getFocusState = () => ({
24137
+ first: focusListItem.first,
24138
+ setFirst: first => setFocusListItem(prevState => _objectSpread2(_objectSpread2({}, prevState), {}, {
24139
+ first
24140
+ })),
24141
+ last: focusListItem.last,
24142
+ setLast: last => setFocusListItem(prevState => _objectSpread2(_objectSpread2({}, prevState), {}, {
24143
+ last
24144
+ }))
24145
+ });
23956
24146
  const {
23957
24147
  List,
23958
24148
  Grid
@@ -23981,7 +24171,9 @@
23981
24171
  overflowDisclaimer: {
23982
24172
  state: overflowDisclaimer,
23983
24173
  set: showOverflowDisclaimer
23984
- }
24174
+ },
24175
+ setScrollPosition,
24176
+ focusListItems: getFocusState()
23985
24177
  });
23986
24178
  const {
23987
24179
  columnWidth,
@@ -24579,6 +24771,7 @@
24579
24771
  var SearchIcon = (props => SvgIcon(search(props)));
24580
24772
 
24581
24773
  const TREE_PATH = '/qListObjectDef';
24774
+ const WILDCARD = '**';
24582
24775
  const StyledInputAdornment = styled$1(InputAdornment$1)(_ref => {
24583
24776
  var _theme$listBox, _theme$listBox$conten;
24584
24777
  let {
@@ -24603,12 +24796,16 @@
24603
24796
  model,
24604
24797
  keyboard,
24605
24798
  dense = false,
24606
- visible = true
24799
+ visible = true,
24800
+ wildCardSearch = true,
24801
+ searchEnabled
24607
24802
  } = _ref3;
24608
24803
  const {
24609
24804
  translator
24610
24805
  } = reactExports.useContext(InstanceContext);
24611
24806
  const [value, setValue] = reactExports.useState('');
24807
+ const [wildcardOn, setWildcardOn] = reactExports.useState(false);
24808
+ const inputRef = reactExports.useRef();
24612
24809
  const theme = useTheme$1();
24613
24810
  const {
24614
24811
  getStoreValue
@@ -24635,6 +24832,13 @@
24635
24832
  selections.removeListener && selections.removeListener('deactivated', abortSearch);
24636
24833
  };
24637
24834
  }, []);
24835
+ reactExports.useEffect(() => {
24836
+ if (wildcardOn && inputRef.current) {
24837
+ const cursorPos = value.length - 1;
24838
+ inputRef.current.setSelectionRange(cursorPos, cursorPos); // place the cursor in the wildcard
24839
+ setWildcardOn(false);
24840
+ }
24841
+ }, [wildcardOn, inputRef.current]);
24638
24842
  const onChange = async e => {
24639
24843
  setValue(e.target.value);
24640
24844
  if (!e.target.value.length) {
@@ -24643,6 +24847,10 @@
24643
24847
  return model.searchListObjectFor(TREE_PATH, e.target.value);
24644
24848
  };
24645
24849
  const handleFocus = () => {
24850
+ if (wildCardSearch) {
24851
+ setValue(WILDCARD);
24852
+ setWildcardOn(true);
24853
+ }
24646
24854
  if (!selections.isModal()) {
24647
24855
  selections.begin(['/qListObjectDef']);
24648
24856
  }
@@ -24676,7 +24884,7 @@
24676
24884
  }
24677
24885
  return response;
24678
24886
  };
24679
- if (!visible) {
24887
+ if (!visible || searchEnabled === false) {
24680
24888
  return null;
24681
24889
  }
24682
24890
  return /*#__PURE__*/React.createElement(StyledOutlinedInput, {
@@ -24706,6 +24914,7 @@
24706
24914
  paddingBottom: '5px'
24707
24915
  }
24708
24916
  }],
24917
+ inputRef: inputRef,
24709
24918
  size: "small",
24710
24919
  fullWidth: true,
24711
24920
  placeholder: translator.get('Listbox.Search'),
@@ -24906,7 +25115,8 @@
24906
25115
  const getClickOutFuncs = _ref3 => {
24907
25116
  let {
24908
25117
  elements,
24909
- objectSelections
25118
+ objectSelections,
25119
+ options
24910
25120
  } = _ref3;
24911
25121
  const handler = createHandler({
24912
25122
  elements,
@@ -24914,14 +25124,18 @@
24914
25124
  });
24915
25125
  return {
24916
25126
  activateClickOut() {
25127
+ var _options$onSelectionA;
24917
25128
  document.addEventListener('mousedown', handler);
25129
+ (_options$onSelectionA = options.onSelectionActivated) === null || _options$onSelectionA === void 0 ? void 0 : _options$onSelectionA.call(options);
24918
25130
  },
24919
25131
  deactivateClickOut() {
25132
+ var _options$onSelectionD;
24920
25133
  document.removeEventListener('mousedown', handler);
25134
+ (_options$onSelectionD = options.onSelectionDeactivated) === null || _options$onSelectionD === void 0 ? void 0 : _options$onSelectionD.call(options);
24921
25135
  }
24922
25136
  };
24923
25137
  };
24924
- function useObjectSelections(app, model, elements) {
25138
+ function useObjectSelections(app, model, elements, options) {
24925
25139
  const elementsArr = Array.isArray(elements) ? elements : [elements];
24926
25140
  const [appSelections] = useAppSelections(app);
24927
25141
  const [layout] = useLayout$1(model);
@@ -24947,7 +25161,8 @@
24947
25161
  deactivateClickOut
24948
25162
  } = getClickOutFuncs({
24949
25163
  elements: elementsArr,
24950
- objectSelections
25164
+ objectSelections,
25165
+ options
24951
25166
  });
24952
25167
  objectSelections.addListener('activated', activateClickOut);
24953
25168
  objectSelections.addListener('deactivated', deactivateClickOut);
@@ -26405,7 +26620,6 @@
26405
26620
  checkboxes,
26406
26621
  search = true,
26407
26622
  focusSearch = false,
26408
- toolbar = true,
26409
26623
  rangeSelect = true,
26410
26624
  model,
26411
26625
  selections,
@@ -26417,6 +26631,9 @@
26417
26631
  showGray = true,
26418
26632
  scrollState = undefined
26419
26633
  } = options;
26634
+ let {
26635
+ toolbar = true
26636
+ } = options;
26420
26637
 
26421
26638
  // Hook that will trigger update when used in useEffects.
26422
26639
  // Modified from: https://medium.com/@teh_builder/ref-objects-inside-useeffect-hooks-eb7c15198780
@@ -26430,9 +26647,6 @@
26430
26647
  return [ref, setRef];
26431
26648
  };
26432
26649
  const theme = useTheme$1();
26433
- const lock = reactExports.useCallback(() => {
26434
- model.lock('/qListObjectDef');
26435
- }, [model]);
26436
26650
  const unlock = reactExports.useCallback(() => {
26437
26651
  model.unlock('/qListObjectDef');
26438
26652
  }, [model]);
@@ -26458,13 +26672,19 @@
26458
26672
  // this will be static until we can access the useKeyboard hook
26459
26673
  active: keyboardActive
26460
26674
  };
26675
+ if ((layout === null || layout === void 0 ? void 0 : layout.toolbar) !== undefined) {
26676
+ toolbar = layout.toolbar;
26677
+ }
26461
26678
  reactExports.useEffect(() => {
26462
26679
  const show = () => {
26463
26680
  setShowToolbar(true);
26681
+ if (search === 'inSelection') {
26682
+ setShowSearch(true);
26683
+ }
26464
26684
  };
26465
26685
  const hide = () => {
26466
26686
  setShowToolbar(false);
26467
- if (search === 'toggle') {
26687
+ if (search === 'toggle' || search === 'inSelection') {
26468
26688
  setShowSearch(false);
26469
26689
  }
26470
26690
  };
@@ -26501,30 +26721,19 @@
26501
26721
  model,
26502
26722
  translator
26503
26723
  }) : [];
26504
- const hasSelections$1 = hasSelections(layout);
26505
- const searchVisible = (search === true || search === 'toggle' && showSearch) && !selectDisabled();
26724
+ const searchVisible = (search === true || (search === 'toggle' || search === 'inSelection') && showSearch) && !selectDisabled();
26506
26725
  const dense = (_layout$layoutOptions = (_layout$layoutOptions2 = layout.layoutOptions) === null || _layout$layoutOptions2 === void 0 ? void 0 : _layout$layoutOptions2.dense) !== null && _layout$layoutOptions !== void 0 ? _layout$layoutOptions : false;
26507
26726
  const searchHeight = dense ? 27 : 40;
26508
26727
  const extraheight = dense ? 39 : 49;
26509
26728
  const minHeight = 49 + (searchVisible ? searchHeight : 0) + extraheight;
26729
+ const {
26730
+ wildCardSearch,
26731
+ searchEnabled
26732
+ } = layout;
26510
26733
  const onShowSearch = () => {
26511
26734
  const newValue = !showSearch;
26512
26735
  setShowSearch(newValue);
26513
26736
  };
26514
- const getSearchOrUnlock = () => {
26515
- const showSearchIcon = search === 'toggle' && !hasSelections$1;
26516
- return showSearchIcon ? /*#__PURE__*/React.createElement(IconButton$1, {
26517
- onClick: onShowSearch,
26518
- tabIndex: -1,
26519
- title: translator.get('Listbox.Search'),
26520
- size: "large"
26521
- }, /*#__PURE__*/React.createElement(SearchIcon, null)) : /*#__PURE__*/React.createElement(IconButton$1, {
26522
- onClick: lock,
26523
- tabIndex: -1,
26524
- disabled: !hasSelections$1,
26525
- size: "large"
26526
- }, /*#__PURE__*/React.createElement(Unlock, null));
26527
- };
26528
26737
  return /*#__PURE__*/React.createElement(StyledGrid$3, {
26529
26738
  className: "listbox-container",
26530
26739
  container: true,
@@ -26537,28 +26746,44 @@
26537
26746
  flexFlow: 'column nowrap'
26538
26747
  },
26539
26748
  onKeyDown: handleKeyDown
26540
- }, toolbar && /*#__PURE__*/React.createElement(Grid$1, {
26749
+ }, toolbar && layout.title && /*#__PURE__*/React.createElement(Grid$1, {
26541
26750
  item: true,
26542
26751
  container: true,
26543
26752
  style: {
26544
26753
  padding: theme.spacing(1)
26545
26754
  }
26546
26755
  }, /*#__PURE__*/React.createElement(Grid$1, {
26547
- item: true
26756
+ item: true,
26757
+ sx: {
26758
+ display: 'flex',
26759
+ alignItems: 'center'
26760
+ }
26548
26761
  }, isLocked ? /*#__PURE__*/React.createElement(IconButton$1, {
26549
26762
  tabIndex: -1,
26550
26763
  onClick: unlock,
26551
26764
  disabled: !isLocked,
26552
26765
  size: "large"
26553
26766
  }, /*#__PURE__*/React.createElement(Lock, {
26554
- title: translator.get('Listbox.Unlock')
26555
- })) : getSearchOrUnlock()), /*#__PURE__*/React.createElement(Grid$1, {
26767
+ title: translator.get('Listbox.Unlock'),
26768
+ style: {
26769
+ fontSize: '12px'
26770
+ }
26771
+ })) : searchEnabled !== false && /*#__PURE__*/React.createElement(IconButton$1, {
26772
+ onClick: onShowSearch,
26773
+ tabIndex: -1,
26774
+ title: translator.get('Listbox.Search'),
26775
+ size: "large"
26776
+ }, /*#__PURE__*/React.createElement(SearchIcon, {
26777
+ style: {
26778
+ fontSize: '12px'
26779
+ }
26780
+ }))), /*#__PURE__*/React.createElement(Grid$1, {
26556
26781
  item: true,
26557
26782
  className: classes$4.listBoxHeader
26558
26783
  }, /*#__PURE__*/React.createElement(Title, {
26559
26784
  variant: "h6",
26560
26785
  noWrap: true
26561
- }, layout.title || layout.qListObject.qDimensionInfo.qFallbackTitle)), /*#__PURE__*/React.createElement(Grid$1, {
26786
+ }, layout.title)), /*#__PURE__*/React.createElement(Grid$1, {
26562
26787
  item: true,
26563
26788
  xs: true
26564
26789
  }), /*#__PURE__*/React.createElement(Grid$1, {
@@ -26603,7 +26828,9 @@
26603
26828
  dense: dense,
26604
26829
  keyboard: keyboard,
26605
26830
  visible: searchVisible,
26606
- searchContainerRef: searchContainerRef
26831
+ searchContainerRef: searchContainerRef,
26832
+ wildCardSearch: wildCardSearch,
26833
+ searchEnabled: searchEnabled
26607
26834
  })), /*#__PURE__*/React.createElement(Grid$1, {
26608
26835
  item: true,
26609
26836
  xs: true
@@ -26889,7 +27116,7 @@
26889
27116
  options
26890
27117
  });
26891
27118
  const elementRef = reactExports.useRef(element);
26892
- const selections = hasExternalSelectionsApi ? options.selectionsApi : useObjectSelections(app, model, elementRef)[0];
27119
+ const selections = hasExternalSelectionsApi ? options.selectionsApi : useObjectSelections(app, model, elementRef, options)[0];
26893
27120
  if (!selections || !model) {
26894
27121
  return null;
26895
27122
  }
@@ -26948,6 +27175,9 @@
26948
27175
  const [showState, setShowstate] = reactExports.useState(!!options.show);
26949
27176
  const handleCloseShowState = () => {
26950
27177
  setShowstate(false);
27178
+ if (options.onPopoverClose) {
27179
+ options.onPopoverClose();
27180
+ }
26951
27181
  };
26952
27182
  return /*#__PURE__*/React.createElement(ListBoxPopover, {
26953
27183
  show: showState,
@@ -33734,9 +33964,9 @@
33734
33964
  version
33735
33965
  } = typeInfo;
33736
33966
  if (!tc[name]) {
33737
- // Fall back to existing version
33967
+ // Chart not registered, so we'll do that now.
33738
33968
  {
33739
- console.warn("Visualization ".concat(name, " is not registered.")); // eslint-disable-line no-console
33969
+ console.warn("Visualization ".concat(name, " is not registered. Adding it now.")); // eslint-disable-line no-console
33740
33970
  }
33741
33971
 
33742
33972
  this.register({
@@ -33767,26 +33997,6 @@
33767
33997
  };
33768
33998
  }
33769
33999
 
33770
- /**
33771
- * @interface Context
33772
- * @property {boolean=} keyboardNavigation
33773
- * @property {object=} constraints
33774
- * @property {boolean=} constraints.active
33775
- * @property {boolean=} constraints.passive
33776
- * @property {boolean=} constraints.select
33777
- */
33778
- const DEFAULT_CONTEXT = /** @lends Context */{
33779
- /** @type {string=} */
33780
- theme: 'light',
33781
- /** @type {string=} */
33782
- language: 'en-US',
33783
- /** @type {string=} */
33784
- deviceType: 'auto',
33785
- constraints: {},
33786
- keyboardNavigation: false,
33787
- disableCellPadding: false
33788
- };
33789
-
33790
34000
  /**
33791
34001
  * @interface SnapshotConfiguration
33792
34002
  * @private
@@ -33816,30 +34026,68 @@
33816
34026
 
33817
34027
  /**
33818
34028
  * @interface Configuration
34029
+ * @property {LoadType=} load Fallback load function for missing types
34030
+ * @property {Context=} context Settings for the rendering instance
34031
+ * @property {Array<TypeInfo>=} types Visualization types to register
34032
+ * @property {Array<ThemeInfo>=} themes Themes to register
34033
+ * @property {object=} anything
34034
+ * @example
34035
+ * import { embed } from '@nebula.js/stardust'
34036
+ * n = embed(app, {
34037
+ * context: {
34038
+ * keyboardNavigation: true,
34039
+ * theme: 'purple',
34040
+ * },
34041
+ * load: ({ name, version }) => {
34042
+ * if (name === 'linechart') {
34043
+ * return Promise.resolve(line);
34044
+ * }
34045
+ * },
34046
+ * types: [
34047
+ * {
34048
+ * name: 'bar',
34049
+ * load: () => Promise.resolve(bar),
34050
+ * },
34051
+ * ],
34052
+ * themes: [
34053
+ * {
34054
+ * id: 'purple',
34055
+ * load: () => Promise.resolve(purpleThemeJson),
34056
+ * },
34057
+ * ],
34058
+ * });
33819
34059
  */
33820
- const DEFAULT_CONFIG = /** @lends Configuration */{
33821
- /**
33822
- * @type {Context=}
33823
- */
33824
- context: DEFAULT_CONTEXT,
34060
+
34061
+ const DEFAULT_CONFIG = {
34062
+ context: {},
33825
34063
  load: () => undefined,
33826
- /**
33827
- * @type {(TypeInfo[])=}
33828
- */
33829
34064
  types: [],
33830
- /**
33831
- * @type {(ThemeInfo[])=}
33832
- */
33833
34065
  themes: [],
33834
- /** @type {object=} */
33835
34066
  anything: {},
33836
- /**
33837
- * @type {SnapshotConfiguration=}
33838
- * @private
33839
- */
33840
34067
  snapshot: DEFAULT_SNAPSHOT_CONFIG
33841
34068
  };
33842
34069
 
34070
+ /**
34071
+ * @interface Context
34072
+ * @property {boolean=} keyboardNavigation
34073
+ * @property {object=} constraints
34074
+ * @property {boolean=} constraints.active
34075
+ * @property {boolean=} constraints.passive
34076
+ * @property {boolean=} constraints.select
34077
+ */
34078
+ const DEFAULT_CONTEXT = /** @lends Context */{
34079
+ /** @type {string=} */
34080
+ theme: 'light',
34081
+ /** @type {string=} */
34082
+ language: 'en-US',
34083
+ /** @type {string=} */
34084
+ deviceType: 'auto',
34085
+ constraints: {},
34086
+ keyboardNavigation: false,
34087
+ disableCellPadding: false
34088
+ };
34089
+ DEFAULT_CONFIG.context = DEFAULT_CONTEXT;
34090
+
33843
34091
  /**
33844
34092
  * @interface Galaxy
33845
34093
  */
@@ -33948,6 +34196,23 @@
33948
34196
  let selectionsApi = null;
33949
34197
  let selectionsComponentReference = null;
33950
34198
 
34199
+ /**
34200
+ * @ignore
34201
+ * @typedef { 'fieldPopoverClose' } EmbedEventTypes
34202
+ */
34203
+
34204
+ /**
34205
+ * Event listener function on instance
34206
+ *
34207
+ * @ignore
34208
+ * @method
34209
+ * @name Embed#on
34210
+ * @param {EmbedEventTypes} eventType event type that function needs to listen
34211
+ * @param {Function} callback a callback function to run when event emits
34212
+ * @example
34213
+ * api.on('someEvent', () => {...});
34214
+ */
34215
+
33951
34216
  /**
33952
34217
  * @class
33953
34218
  * @alias Embed
@@ -34095,7 +34360,34 @@
34095
34360
  */
34096
34361
 
34097
34362
  /**
34098
- * @typedef { boolean | 'toggle' } SearchMode
34363
+ * @typedef { boolean | 'toggle' | 'inSelection' } SearchMode
34364
+ */
34365
+
34366
+ /**
34367
+ * @typedef { 'selectionActivated' | 'selectionDeactivated' } FieldEventTypes
34368
+ */
34369
+
34370
+ /**
34371
+ * Event listener function on instance
34372
+ *
34373
+ * @method
34374
+ * @name FieldInstance#on
34375
+ * @param {FieldEventTypes} eventType event type that function needs to listen
34376
+ * @param {Function} callback a callback function to run when event emits
34377
+ * @example
34378
+ * const handleSomeEvent () => {...};
34379
+ * fieldInstance.on('someEvent', handleSomeEvent);
34380
+ * ...
34381
+ * fieldInstance.removeListener('someEvent', handleSomeEvent);
34382
+ */
34383
+
34384
+ /**
34385
+ * Remove listener on instance
34386
+ *
34387
+ * @method
34388
+ * @name FieldInstance#removeListener
34389
+ * @param {FieldEventTypes} eventType event type
34390
+ * @param {Function} callback handler
34099
34391
  */
34100
34392
 
34101
34393
  /**
@@ -34114,7 +34406,7 @@
34114
34406
  * @param {ListLayout=} [options.listLayout=vertical] Layout direction vertical|horizontal (not applicable for existing objects)
34115
34407
  * @param {FrequencyMode=} [options.frequencyMode=none] Show frequency none|value|percent|relative
34116
34408
  * @param {boolean=} [options.histogram=false] Show histogram bar (not applicable for existing objects)
34117
- * @param {SearchMode=} [options.search=true] Show the search bar permanently or using the toggle button: false|true|toggle|toggleShow
34409
+ * @param {SearchMode=} [options.search=true] Show the search bar permanently, using the toggle button or when in selection: false|true|toggle|inSelection
34118
34410
  * @param {boolean=} [options.toolbar=true] Show the toolbar
34119
34411
  * @param {boolean=} [options.checkboxes=false] Show values as checkboxes instead of as fields (not applicable for existing objects)
34120
34412
  * @param {boolean=} [options.dense=false] Reduces padding and text size (not applicable for existing objects)
@@ -34134,12 +34426,17 @@
34134
34426
  if (this._instance) {
34135
34427
  throw new Error("Field or object ".concat(fieldName || qId, " already mounted"));
34136
34428
  }
34429
+ const onSelectionActivated = () => fieldSels.emit('selectionActivated');
34430
+ const onSelectionDeactivated = () => fieldSels.emit('selectionDeactivated');
34137
34431
  this._instance = ListBoxPortal({
34138
34432
  element,
34139
34433
  app,
34140
34434
  fieldIdentifier,
34141
34435
  qId,
34142
- options: getOptions$1(options),
34436
+ options: getOptions$1(_objectSpread2({
34437
+ onSelectionActivated,
34438
+ onSelectionDeactivated
34439
+ }, options)),
34143
34440
  stateName: options.stateName || '$'
34144
34441
  });
34145
34442
  root.add(this._instance);
@@ -34158,6 +34455,7 @@
34158
34455
  }
34159
34456
  }
34160
34457
  };
34458
+ eventmixin(fieldSels);
34161
34459
  return fieldSels;
34162
34460
  },
34163
34461
  /**
@@ -34182,7 +34480,10 @@
34182
34480
  root.remove(api._popoverInstance);
34183
34481
  api._popoverInstance = null;
34184
34482
  }
34185
- const opts = getOptions(options);
34483
+ const onPopoverClose = () => api.emit('fieldPopoverClose');
34484
+ const opts = getOptions(_objectSpread2({
34485
+ onPopoverClose
34486
+ }, options));
34186
34487
  api._popoverInstance = React.createElement(ListBoxPopoverWrapper, {
34187
34488
  element: anchorElement,
34188
34489
  key: uid(),
@@ -34197,6 +34498,7 @@
34197
34498
  };
34198
34499
  halo.public.nebbie = api;
34199
34500
  halo.types = types;
34501
+ eventmixin(api);
34200
34502
  return api;
34201
34503
  }
34202
34504