@nebula.js/stardust 3.1.3 → 3.2.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,5 +1,5 @@
1
1
  /*
2
- * @nebula.js/stardust v3.1.3
2
+ * @nebula.js/stardust v3.2.1
3
3
  * Copyright (c) 2023 QlikTech International AB
4
4
  * Released under the MIT license.
5
5
  */
@@ -953,6 +953,46 @@ var CurrentSelections_Of = {
953
953
  "zh-TW": "{0}/ {1}"
954
954
  }
955
955
  };
956
+ var Listbox_Dismiss = {
957
+ id: "Listbox.Dismiss",
958
+ locale: {
959
+ "de-DE": "Schließen",
960
+ "en-US": "Dismiss",
961
+ "es-ES": "Descartar",
962
+ "fr-FR": "Ignorer",
963
+ "it-IT": "Ignora",
964
+ "ja-JP": "却下",
965
+ "ko-KR": "해제",
966
+ "nl-NL": "Overslaan",
967
+ "pl-PL": "Zamknij",
968
+ "pt-BR": "Ignorar",
969
+ "ru-RU": "Пропустить",
970
+ "sv-SE": "Hoppa över",
971
+ "tr-TR": "Kapat",
972
+ "zh-CN": "离开",
973
+ "zh-TW": "解除"
974
+ }
975
+ };
976
+ var Listbox_ItemsOverflow = {
977
+ id: "Listbox.ItemsOverflow",
978
+ locale: {
979
+ "de-DE": "Derzeit wird ein eingeschränkter Datensatz angezeigt, verwenden Sie die Suche, um die Größe zu reduzieren",
980
+ "en-US": "Currently showing a limited data set, use search to reduce the size",
981
+ "es-ES": "Actualmente se muestra un conjunto de datos limitado, utilice la búsqueda para reducir el tamaño",
982
+ "fr-FR": "Ensemble de données limité actuellement affiché. Utilisez la rechercher pour réduire la taille.",
983
+ "it-IT": "Attualmente visualizzato un set di dati limitato; utilizzare la ricerca per ridurre le dimensioni",
984
+ "ja-JP": "現在表示されているデータ セットは制限されているため、検索を使ってサイズを縮小してください",
985
+ "ko-KR": "현재 제한된 데이터 집합이 표시되고 있습니다. 검색을 사용하여 크기를 줄이십시오.",
986
+ "nl-NL": "Er wordt momenteel een beperkte gegevensverzameling getoond, gebruik Zoeken om de omvang te verkleinen",
987
+ "pl-PL": "Wyświetlany jest ograniczony zestaw danych. Użyj wyszukiwania, aby zmniejszyć rozmiar.",
988
+ "pt-BR": "Atualmente mostrando um conjunto de dados limitado, use a pesquisa para reduzir o tamanho",
989
+ "ru-RU": "Сейчас отображается ограниченный набор данных. Используйте поиск, чтобы уменьшить размер.",
990
+ "sv-SE": "En begränsad datauppsättning visas. Använd sök för att minska storleken",
991
+ "tr-TR": "Şu anda sınırlı bir veri kümesi gösteriliyor. Boyutu azaltmak için arama işlevini kullanın",
992
+ "zh-CN": "目前显示有限的数据集,使用搜索来减少大小",
993
+ "zh-TW": "目前顯示有限資料集,請使用搜尋減少大小"
994
+ }
995
+ };
956
996
  var Listbox_Lock = {
957
997
  id: "Listbox.Lock",
958
998
  locale: {
@@ -973,6 +1013,26 @@ var Listbox_Lock = {
973
1013
  "zh-TW": "鎖定選項"
974
1014
  }
975
1015
  };
1016
+ var Listbox_NoMatchesForYourTerms = {
1017
+ id: "Listbox.NoMatchesForYourTerms",
1018
+ locale: {
1019
+ "de-DE": "Für Ihre Suche wurden keine Übereinstimmungen gefunden.",
1020
+ "en-US": "There are no matches for your search.",
1021
+ "es-ES": "No hay resultados para su búsqueda.",
1022
+ "fr-FR": "Aucun résultat ne correspond à votre recherche.",
1023
+ "it-IT": "Non è stata trovata alcuna corrispondenza per questa ricerca.",
1024
+ "ja-JP": "検索に一致するものがありません。",
1025
+ "ko-KR": "검색에 대해 일치하는 항목이 없습니다.",
1026
+ "nl-NL": "Er zijn geen overeenkomsten voor uw zoekopdracht.",
1027
+ "pl-PL": "Brak dopasowań dla tego wyszukiwania.",
1028
+ "pt-BR": "Não há correspondências para sua pesquisa.",
1029
+ "ru-RU": "Нет совпадений по вашему поисковому запросу.",
1030
+ "sv-SE": "Det finns inga matchningar för din sökning.",
1031
+ "tr-TR": "Aramanızla eşleşen sonuç yok.",
1032
+ "zh-CN": "您的搜索条件没有任何匹配结果。",
1033
+ "zh-TW": "沒有與您搜尋相符的項目。"
1034
+ }
1035
+ };
976
1036
  var Listbox_ResultFilterLabel = {
977
1037
  id: "Listbox.ResultFilterLabel",
978
1038
  locale: {
@@ -993,26 +1053,6 @@ var Listbox_ResultFilterLabel = {
993
1053
  "zh-TW": "搜尋結果篩選"
994
1054
  }
995
1055
  };
996
- var Listbox_NoMatchesForYourTerms = {
997
- id: "Listbox.NoMatchesForYourTerms",
998
- locale: {
999
- "de-DE": "Für Ihre Suche wurden keine Übereinstimmungen gefunden.",
1000
- "en-US": "There are no matches for your search.",
1001
- "es-ES": "No hay resultados para su búsqueda.",
1002
- "fr-FR": "Aucun résultat ne correspond à votre recherche.",
1003
- "it-IT": "Non esistono corrispondenze per la ricerca.",
1004
- "ja-JP": "検索に一致するものがありません。",
1005
- "ko-KR": "검색에 대해 일치하는 항목이 없습니다.",
1006
- "nl-NL": "Er zijn geen overeenkomsten voor uw zoekopdracht.",
1007
- "pl-PL": "Brak dopasowań dla tego wyszukiwania.",
1008
- "pt-BR": "Não há correspondências para sua pesquisa.",
1009
- "ru-RU": "Нет совпадений для искомого текста.",
1010
- "sv-SE": "Det finns inga matchningar för din sökning.",
1011
- "tr-TR": "Aramanızla eşleşen sonuç yok.",
1012
- "zh-CN": "您的搜索条件没有任何匹配结果。",
1013
- "zh-TW": "沒有與您搜尋相符的項目。"
1014
- }
1015
- };
1016
1056
  var Listbox_ScreenReaderInstructions = {
1017
1057
  id: "Listbox.ScreenReaderInstructions",
1018
1058
  locale: {
@@ -1573,25 +1613,15 @@ var Visualization_UnfulfilledCalculationCondition = {
1573
1613
  "zh-TW": "不符計算條件"
1574
1614
  }
1575
1615
  };
1576
- var Listbox_ItemsOverflow = {
1577
- id: "Listbox.ItemsOverflow",
1578
- locale: {
1579
- "en-US": "Currently showing a limited data set, use search to reduce the size"
1580
- }
1581
- };
1582
- var Listbox_Dismiss = {
1583
- id: "Listbox.Dismiss",
1584
- locale: {
1585
- "en-US": "Dismiss"
1586
- }
1587
- };
1588
1616
  var all = {
1589
1617
  Cancel: Cancel$1,
1590
1618
  CurrentSelections_All: CurrentSelections_All,
1591
1619
  CurrentSelections_Of: CurrentSelections_Of,
1620
+ Listbox_Dismiss: Listbox_Dismiss,
1621
+ Listbox_ItemsOverflow: Listbox_ItemsOverflow,
1592
1622
  Listbox_Lock: Listbox_Lock,
1593
- Listbox_ResultFilterLabel: Listbox_ResultFilterLabel,
1594
1623
  Listbox_NoMatchesForYourTerms: Listbox_NoMatchesForYourTerms,
1624
+ Listbox_ResultFilterLabel: Listbox_ResultFilterLabel,
1595
1625
  Listbox_ScreenReaderInstructions: Listbox_ScreenReaderInstructions,
1596
1626
  Listbox_Search: Listbox_Search,
1597
1627
  Listbox_Search_ScreenReaderInstructions: Listbox_Search_ScreenReaderInstructions,
@@ -1619,9 +1649,7 @@ var all = {
1619
1649
  Visualization_Invalid_Dimension: Visualization_Invalid_Dimension,
1620
1650
  Visualization_Invalid_Measure: Visualization_Invalid_Measure,
1621
1651
  Visualization_LayoutError: Visualization_LayoutError,
1622
- Visualization_UnfulfilledCalculationCondition: Visualization_UnfulfilledCalculationCondition,
1623
- Listbox_ItemsOverflow: Listbox_ItemsOverflow,
1624
- Listbox_Dismiss: Listbox_Dismiss
1652
+ Visualization_UnfulfilledCalculationCondition: Visualization_UnfulfilledCalculationCondition
1625
1653
  };
1626
1654
 
1627
1655
  function appLocaleFn(language) {
@@ -7940,7 +7968,7 @@ function create$3(definition) {
7940
7968
  return cache[key];
7941
7969
  }
7942
7970
 
7943
- const NEBULA_VERSION_HASH = "b117" ;
7971
+ const NEBULA_VERSION_HASH = "f2f8" ;
7944
7972
  ClassNameGenerator$1.configure(componentName => {
7945
7973
  return "njs-".concat(NEBULA_VERSION_HASH, "-").concat(componentName.replace('Mui', ''));
7946
7974
  });
@@ -8459,7 +8487,7 @@ function boot(_ref2) {
8459
8487
  const appRef = React__default.createRef();
8460
8488
  const element = document.createElement('div');
8461
8489
  element.style.display = 'none';
8462
- element.setAttribute('data-nebulajs-version', "3.1.3" );
8490
+ element.setAttribute('data-nebulajs-version', "3.2.1" );
8463
8491
  element.setAttribute('data-app-id', app.id);
8464
8492
  document.body.appendChild(element);
8465
8493
  ReactDOM.render( /*#__PURE__*/React__default.createElement(NebulaApp, {
@@ -9963,7 +9991,8 @@ function RowColumn(_ref3) {
9963
9991
  };
9964
9992
  const iconStyles = {
9965
9993
  alignItems: 'center',
9966
- display: 'flex'
9994
+ display: 'flex',
9995
+ fontSize: '8px'
9967
9996
  };
9968
9997
  const showLock = isSelected && isLocked;
9969
9998
  const showTick = !checkboxes && isSelected && !isLocked;
@@ -13219,7 +13248,8 @@ function ListBoxSearch(_ref3) {
13219
13248
  keyboard,
13220
13249
  dense = false,
13221
13250
  visible = true,
13222
- wildCardSearch = true
13251
+ wildCardSearch = true,
13252
+ searchEnabled
13223
13253
  } = _ref3;
13224
13254
  const {
13225
13255
  translator
@@ -13305,7 +13335,7 @@ function ListBoxSearch(_ref3) {
13305
13335
  }
13306
13336
  return response;
13307
13337
  };
13308
- if (!visible) {
13338
+ if (!visible || searchEnabled === false) {
13309
13339
  return null;
13310
13340
  }
13311
13341
  return /*#__PURE__*/React__default.createElement(StyledOutlinedInput, {
@@ -13536,7 +13566,8 @@ const createObjectSelections = _ref2 => {
13536
13566
  const getClickOutFuncs = _ref3 => {
13537
13567
  let {
13538
13568
  elements,
13539
- objectSelections
13569
+ objectSelections,
13570
+ options
13540
13571
  } = _ref3;
13541
13572
  const handler = createHandler({
13542
13573
  elements,
@@ -13544,14 +13575,18 @@ const getClickOutFuncs = _ref3 => {
13544
13575
  });
13545
13576
  return {
13546
13577
  activateClickOut() {
13578
+ var _options$onSelectionA;
13547
13579
  document.addEventListener('mousedown', handler);
13580
+ (_options$onSelectionA = options.onSelectionActivated) === null || _options$onSelectionA === void 0 ? void 0 : _options$onSelectionA.call(options);
13548
13581
  },
13549
13582
  deactivateClickOut() {
13583
+ var _options$onSelectionD;
13550
13584
  document.removeEventListener('mousedown', handler);
13585
+ (_options$onSelectionD = options.onSelectionDeactivated) === null || _options$onSelectionD === void 0 ? void 0 : _options$onSelectionD.call(options);
13551
13586
  }
13552
13587
  };
13553
13588
  };
13554
- function useObjectSelections(app, model, elements) {
13589
+ function useObjectSelections(app, model, elements, options) {
13555
13590
  const elementsArr = Array.isArray(elements) ? elements : [elements];
13556
13591
  const [appSelections] = useAppSelections(app);
13557
13592
  const [layout] = useLayout$1(model);
@@ -13577,7 +13612,8 @@ function useObjectSelections(app, model, elements) {
13577
13612
  deactivateClickOut
13578
13613
  } = getClickOutFuncs({
13579
13614
  elements: elementsArr,
13580
- objectSelections
13615
+ objectSelections,
13616
+ options
13581
13617
  });
13582
13618
  objectSelections.addListener('activated', activateClickOut);
13583
13619
  objectSelections.addListener('deactivated', deactivateClickOut);
@@ -15035,7 +15071,6 @@ function ListBoxInline(_ref3) {
15035
15071
  checkboxes,
15036
15072
  search = true,
15037
15073
  focusSearch = false,
15038
- toolbar = true,
15039
15074
  rangeSelect = true,
15040
15075
  model,
15041
15076
  selections,
@@ -15047,6 +15082,9 @@ function ListBoxInline(_ref3) {
15047
15082
  showGray = true,
15048
15083
  scrollState = undefined
15049
15084
  } = options;
15085
+ let {
15086
+ toolbar = true
15087
+ } = options;
15050
15088
 
15051
15089
  // Hook that will trigger update when used in useEffects.
15052
15090
  // Modified from: https://medium.com/@teh_builder/ref-objects-inside-useeffect-hooks-eb7c15198780
@@ -15060,9 +15098,6 @@ function ListBoxInline(_ref3) {
15060
15098
  return [ref, setRef];
15061
15099
  };
15062
15100
  const theme = useTheme$1();
15063
- const lock = useCallback(() => {
15064
- model.lock('/qListObjectDef');
15065
- }, [model]);
15066
15101
  const unlock = useCallback(() => {
15067
15102
  model.unlock('/qListObjectDef');
15068
15103
  }, [model]);
@@ -15088,13 +15123,19 @@ function ListBoxInline(_ref3) {
15088
15123
  // this will be static until we can access the useKeyboard hook
15089
15124
  active: keyboardActive
15090
15125
  };
15126
+ if ((layout === null || layout === void 0 ? void 0 : layout.toolbar) !== undefined) {
15127
+ toolbar = layout.toolbar;
15128
+ }
15091
15129
  useEffect$1(() => {
15092
15130
  const show = () => {
15093
15131
  setShowToolbar(true);
15132
+ if (search === 'inSelection') {
15133
+ setShowSearch(true);
15134
+ }
15094
15135
  };
15095
15136
  const hide = () => {
15096
15137
  setShowToolbar(false);
15097
- if (search === 'toggle') {
15138
+ if (search === 'toggle' || search === 'inSelection') {
15098
15139
  setShowSearch(false);
15099
15140
  }
15100
15141
  };
@@ -15131,31 +15172,19 @@ function ListBoxInline(_ref3) {
15131
15172
  model,
15132
15173
  translator
15133
15174
  }) : [];
15134
- const hasSelections$1 = hasSelections(layout);
15135
- const searchVisible = (search === true || search === 'toggle' && showSearch) && !selectDisabled();
15175
+ const searchVisible = (search === true || (search === 'toggle' || search === 'inSelection') && showSearch) && !selectDisabled();
15136
15176
  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;
15137
15177
  const searchHeight = dense ? 27 : 40;
15138
15178
  const extraheight = dense ? 39 : 49;
15139
15179
  const minHeight = 49 + (searchVisible ? searchHeight : 0) + extraheight;
15140
- const wildCardSearch = layout === null || layout === void 0 ? void 0 : layout.wildCardSearch;
15180
+ const {
15181
+ wildCardSearch,
15182
+ searchEnabled
15183
+ } = layout;
15141
15184
  const onShowSearch = () => {
15142
15185
  const newValue = !showSearch;
15143
15186
  setShowSearch(newValue);
15144
15187
  };
15145
- const getSearchOrUnlock = () => {
15146
- const showSearchIcon = search === 'toggle' && !hasSelections$1;
15147
- return showSearchIcon ? /*#__PURE__*/React__default.createElement(IconButton, {
15148
- onClick: onShowSearch,
15149
- tabIndex: -1,
15150
- title: translator.get('Listbox.Search'),
15151
- size: "large"
15152
- }, /*#__PURE__*/React__default.createElement(SearchIcon, null)) : /*#__PURE__*/React__default.createElement(IconButton, {
15153
- onClick: lock,
15154
- tabIndex: -1,
15155
- disabled: !hasSelections$1,
15156
- size: "large"
15157
- }, /*#__PURE__*/React__default.createElement(Unlock, null));
15158
- };
15159
15188
  return /*#__PURE__*/React__default.createElement(StyledGrid$3, {
15160
15189
  className: "listbox-container",
15161
15190
  container: true,
@@ -15168,28 +15197,44 @@ function ListBoxInline(_ref3) {
15168
15197
  flexFlow: 'column nowrap'
15169
15198
  },
15170
15199
  onKeyDown: handleKeyDown
15171
- }, toolbar && /*#__PURE__*/React__default.createElement(Grid, {
15200
+ }, toolbar && layout.title && /*#__PURE__*/React__default.createElement(Grid, {
15172
15201
  item: true,
15173
15202
  container: true,
15174
15203
  style: {
15175
15204
  padding: theme.spacing(1)
15176
15205
  }
15177
15206
  }, /*#__PURE__*/React__default.createElement(Grid, {
15178
- item: true
15207
+ item: true,
15208
+ sx: {
15209
+ display: 'flex',
15210
+ alignItems: 'center'
15211
+ }
15179
15212
  }, isLocked ? /*#__PURE__*/React__default.createElement(IconButton, {
15180
15213
  tabIndex: -1,
15181
15214
  onClick: unlock,
15182
15215
  disabled: !isLocked,
15183
15216
  size: "large"
15184
15217
  }, /*#__PURE__*/React__default.createElement(Lock, {
15185
- title: translator.get('Listbox.Unlock')
15186
- })) : getSearchOrUnlock()), /*#__PURE__*/React__default.createElement(Grid, {
15218
+ title: translator.get('Listbox.Unlock'),
15219
+ style: {
15220
+ fontSize: '12px'
15221
+ }
15222
+ })) : searchEnabled !== false && /*#__PURE__*/React__default.createElement(IconButton, {
15223
+ onClick: onShowSearch,
15224
+ tabIndex: -1,
15225
+ title: translator.get('Listbox.Search'),
15226
+ size: "large"
15227
+ }, /*#__PURE__*/React__default.createElement(SearchIcon, {
15228
+ style: {
15229
+ fontSize: '12px'
15230
+ }
15231
+ }))), /*#__PURE__*/React__default.createElement(Grid, {
15187
15232
  item: true,
15188
15233
  className: classes$4.listBoxHeader
15189
15234
  }, /*#__PURE__*/React__default.createElement(Title, {
15190
15235
  variant: "h6",
15191
15236
  noWrap: true
15192
- }, layout.title || layout.qListObject.qDimensionInfo.qFallbackTitle)), /*#__PURE__*/React__default.createElement(Grid, {
15237
+ }, layout.title)), /*#__PURE__*/React__default.createElement(Grid, {
15193
15238
  item: true,
15194
15239
  xs: true
15195
15240
  }), /*#__PURE__*/React__default.createElement(Grid, {
@@ -15235,7 +15280,8 @@ function ListBoxInline(_ref3) {
15235
15280
  keyboard: keyboard,
15236
15281
  visible: searchVisible,
15237
15282
  searchContainerRef: searchContainerRef,
15238
- wildCardSearch: wildCardSearch
15283
+ wildCardSearch: wildCardSearch,
15284
+ searchEnabled: searchEnabled
15239
15285
  })), /*#__PURE__*/React__default.createElement(Grid, {
15240
15286
  item: true,
15241
15287
  xs: true
@@ -15521,7 +15567,7 @@ function ListBoxWrapper(_ref) {
15521
15567
  options
15522
15568
  });
15523
15569
  const elementRef = useRef(element);
15524
- const selections = hasExternalSelectionsApi ? options.selectionsApi : useObjectSelections(app, model, elementRef)[0];
15570
+ const selections = hasExternalSelectionsApi ? options.selectionsApi : useObjectSelections(app, model, elementRef, options)[0];
15525
15571
  if (!selections || !model) {
15526
15572
  return null;
15527
15573
  }
@@ -22369,9 +22415,9 @@ function create(_ref) {
22369
22415
  version
22370
22416
  } = typeInfo;
22371
22417
  if (!tc[name]) {
22372
- // Fall back to existing version
22418
+ // Chart not registered, so we'll do that now.
22373
22419
  {
22374
- console.warn("Visualization ".concat(name, " is not registered.")); // eslint-disable-line no-console
22420
+ console.warn("Visualization ".concat(name, " is not registered. Adding it now.")); // eslint-disable-line no-console
22375
22421
  }
22376
22422
 
22377
22423
  this.register({
@@ -22402,26 +22448,6 @@ function create(_ref) {
22402
22448
  };
22403
22449
  }
22404
22450
 
22405
- /**
22406
- * @interface Context
22407
- * @property {boolean=} keyboardNavigation
22408
- * @property {object=} constraints
22409
- * @property {boolean=} constraints.active
22410
- * @property {boolean=} constraints.passive
22411
- * @property {boolean=} constraints.select
22412
- */
22413
- const DEFAULT_CONTEXT = /** @lends Context */{
22414
- /** @type {string=} */
22415
- theme: 'light',
22416
- /** @type {string=} */
22417
- language: 'en-US',
22418
- /** @type {string=} */
22419
- deviceType: 'auto',
22420
- constraints: {},
22421
- keyboardNavigation: false,
22422
- disableCellPadding: false
22423
- };
22424
-
22425
22451
  /**
22426
22452
  * @interface SnapshotConfiguration
22427
22453
  * @private
@@ -22451,30 +22477,68 @@ const DEFAULT_SNAPSHOT_CONFIG = /** @lends SnapshotConfiguration */{
22451
22477
 
22452
22478
  /**
22453
22479
  * @interface Configuration
22480
+ * @property {LoadType=} load Fallback load function for missing types
22481
+ * @property {Context=} context Settings for the rendering instance
22482
+ * @property {Array<TypeInfo>=} types Visualization types to register
22483
+ * @property {Array<ThemeInfo>=} themes Themes to register
22484
+ * @property {object=} anything
22485
+ * @example
22486
+ * import { embed } from '@nebula.js/stardust'
22487
+ * n = embed(app, {
22488
+ * context: {
22489
+ * keyboardNavigation: true,
22490
+ * theme: 'purple',
22491
+ * },
22492
+ * load: ({ name, version }) => {
22493
+ * if (name === 'linechart') {
22494
+ * return Promise.resolve(line);
22495
+ * }
22496
+ * },
22497
+ * types: [
22498
+ * {
22499
+ * name: 'bar',
22500
+ * load: () => Promise.resolve(bar),
22501
+ * },
22502
+ * ],
22503
+ * themes: [
22504
+ * {
22505
+ * id: 'purple',
22506
+ * load: () => Promise.resolve(purpleThemeJson),
22507
+ * },
22508
+ * ],
22509
+ * });
22454
22510
  */
22455
- const DEFAULT_CONFIG = /** @lends Configuration */{
22456
- /**
22457
- * @type {Context=}
22458
- */
22459
- context: DEFAULT_CONTEXT,
22511
+
22512
+ const DEFAULT_CONFIG = {
22513
+ context: {},
22460
22514
  load: () => undefined,
22461
- /**
22462
- * @type {(TypeInfo[])=}
22463
- */
22464
22515
  types: [],
22465
- /**
22466
- * @type {(ThemeInfo[])=}
22467
- */
22468
22516
  themes: [],
22469
- /** @type {object=} */
22470
22517
  anything: {},
22471
- /**
22472
- * @type {SnapshotConfiguration=}
22473
- * @private
22474
- */
22475
22518
  snapshot: DEFAULT_SNAPSHOT_CONFIG
22476
22519
  };
22477
22520
 
22521
+ /**
22522
+ * @interface Context
22523
+ * @property {boolean=} keyboardNavigation
22524
+ * @property {object=} constraints
22525
+ * @property {boolean=} constraints.active
22526
+ * @property {boolean=} constraints.passive
22527
+ * @property {boolean=} constraints.select
22528
+ */
22529
+ const DEFAULT_CONTEXT = /** @lends Context */{
22530
+ /** @type {string=} */
22531
+ theme: 'light',
22532
+ /** @type {string=} */
22533
+ language: 'en-US',
22534
+ /** @type {string=} */
22535
+ deviceType: 'auto',
22536
+ constraints: {},
22537
+ keyboardNavigation: false,
22538
+ disableCellPadding: false
22539
+ };
22540
+ DEFAULT_CONFIG.context = DEFAULT_CONTEXT;
22541
+
22478
22542
  /**
22479
22543
  * @interface Galaxy
22480
22544
  */
@@ -22747,7 +22811,34 @@ function nuked() {
22747
22811
  */
22748
22812
 
22749
22813
  /**
22750
- * @typedef { boolean | 'toggle' } SearchMode
22814
+ * @typedef { boolean | 'toggle' | 'inSelection' } SearchMode
22815
+ */
22816
+
22817
+ /**
22818
+ * @typedef { 'selectionActivated' | 'selectionDeactivated' } FieldEventTypes
22819
+ */
22820
+
22821
+ /**
22822
+ * Event listener function on instance
22823
+ *
22824
+ * @method
22825
+ * @name FieldInstance#on
22826
+ * @param {FieldEventTypes} eventType event type that function needs to listen
22827
+ * @param {Function} callback a callback function to run when event emits
22828
+ * @example
22829
+ * const handleSomeEvent () => {...};
22830
+ * fieldInstance.on('someEvent', handleSomeEvent);
22831
+ * ...
22832
+ * fieldInstance.removeListener('someEvent', handleSomeEvent);
22833
+ */
22834
+
22835
+ /**
22836
+ * Remove listener on instance
22837
+ *
22838
+ * @method
22839
+ * @name FieldInstance#removeListener
22840
+ * @param {FieldEventTypes} eventType event type
22841
+ * @param {Function} callback handler
22751
22842
  */
22752
22843
 
22753
22844
  /**
@@ -22766,7 +22857,7 @@ function nuked() {
22766
22857
  * @param {ListLayout=} [options.listLayout=vertical] Layout direction vertical|horizontal (not applicable for existing objects)
22767
22858
  * @param {FrequencyMode=} [options.frequencyMode=none] Show frequency none|value|percent|relative
22768
22859
  * @param {boolean=} [options.histogram=false] Show histogram bar (not applicable for existing objects)
22769
- * @param {SearchMode=} [options.search=true] Show the search bar permanently or using the toggle button: false|true|toggle|toggleShow
22860
+ * @param {SearchMode=} [options.search=true] Show the search bar permanently, using the toggle button or when in selection: false|true|toggle|inSelection
22770
22861
  * @param {boolean=} [options.toolbar=true] Show the toolbar
22771
22862
  * @param {boolean=} [options.checkboxes=false] Show values as checkboxes instead of as fields (not applicable for existing objects)
22772
22863
  * @param {boolean=} [options.dense=false] Reduces padding and text size (not applicable for existing objects)
@@ -22786,12 +22877,17 @@ function nuked() {
22786
22877
  if (this._instance) {
22787
22878
  throw new Error("Field or object ".concat(fieldName || qId, " already mounted"));
22788
22879
  }
22880
+ const onSelectionActivated = () => fieldSels.emit('selectionActivated');
22881
+ const onSelectionDeactivated = () => fieldSels.emit('selectionDeactivated');
22789
22882
  this._instance = ListBoxPortal({
22790
22883
  element,
22791
22884
  app,
22792
22885
  fieldIdentifier,
22793
22886
  qId,
22794
- options: getOptions$1(options),
22887
+ options: getOptions$1(_objectSpread2({
22888
+ onSelectionActivated,
22889
+ onSelectionDeactivated
22890
+ }, options)),
22795
22891
  stateName: options.stateName || '$'
22796
22892
  });
22797
22893
  root.add(this._instance);
@@ -22810,6 +22906,7 @@ function nuked() {
22810
22906
  }
22811
22907
  }
22812
22908
  };
22909
+ eventmixin(fieldSels);
22813
22910
  return fieldSels;
22814
22911
  },
22815
22912
  /**