@itwin/core-react 3.0.0-dev.98 → 3.1.0-dev.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.
Files changed (152) hide show
  1. package/CHANGELOG.md +78 -1
  2. package/ContributeGuidelines.md +1 -1
  3. package/LICENSE.md +1 -1
  4. package/lib/cjs/core-react/UiCore.d.ts +1 -1
  5. package/lib/cjs/core-react/UiCore.d.ts.map +1 -1
  6. package/lib/cjs/core-react/UiCore.js.map +1 -1
  7. package/lib/cjs/core-react/contextmenu/PopupContextMenu.js +1 -1
  8. package/lib/cjs/core-react/contextmenu/PopupContextMenu.js.map +1 -1
  9. package/lib/cjs/core-react/dialog/DialogButtonDef.d.ts +3 -3
  10. package/lib/cjs/core-react/dialog/DialogButtonDef.js +2 -2
  11. package/lib/cjs/core-react/dialog/DialogButtonDef.js.map +1 -1
  12. package/lib/cjs/core-react/expandable/ExpandableList.scss +0 -3
  13. package/lib/cjs/core-react/form/Field.d.ts +2 -2
  14. package/lib/cjs/core-react/form/Field.d.ts.map +1 -1
  15. package/lib/cjs/core-react/form/Field.js +4 -3
  16. package/lib/cjs/core-react/form/Field.js.map +1 -1
  17. package/lib/cjs/core-react/form/Form.d.ts +7 -7
  18. package/lib/cjs/core-react/form/Form.d.ts.map +1 -1
  19. package/lib/cjs/core-react/form/Form.js +3 -2
  20. package/lib/cjs/core-react/form/Form.js.map +1 -1
  21. package/lib/cjs/core-react/icons/IconComponent.scss +5 -0
  22. package/lib/cjs/core-react/inputs/numberinput/NumberInput.d.ts.map +1 -1
  23. package/lib/cjs/core-react/inputs/numberinput/NumberInput.js +3 -2
  24. package/lib/cjs/core-react/inputs/numberinput/NumberInput.js.map +1 -1
  25. package/lib/cjs/core-react/inputs/numberinput/NumberInput.scss +13 -0
  26. package/lib/cjs/core-react/messagebox/MessageBox.d.ts.map +1 -1
  27. package/lib/cjs/core-react/messagebox/MessageBox.js +3 -0
  28. package/lib/cjs/core-react/messagebox/MessageBox.js.map +1 -1
  29. package/lib/cjs/core-react/messagebox/MessageBox.scss +2 -0
  30. package/lib/cjs/core-react/messagebox/MessageSeverity.d.ts +1 -1
  31. package/lib/cjs/core-react/messagebox/MessageSeverity.js +1 -1
  32. package/lib/cjs/core-react/messagebox/MessageSeverity.js.map +1 -1
  33. package/lib/cjs/core-react/popup/Popup.d.ts +6 -1
  34. package/lib/cjs/core-react/popup/Popup.d.ts.map +1 -1
  35. package/lib/cjs/core-react/popup/Popup.js +13 -4
  36. package/lib/cjs/core-react/popup/Popup.js.map +1 -1
  37. package/lib/cjs/core-react/popup/Popup.scss +11 -2
  38. package/lib/cjs/core-react/select/ThemedSelect.d.ts +1 -1
  39. package/lib/cjs/core-react/select/ThemedSelect.js +1 -1
  40. package/lib/cjs/core-react/select/ThemedSelect.js.map +1 -1
  41. package/lib/cjs/core-react/style/itwinui-overrides.scss +0 -68
  42. package/lib/cjs/core-react/tree/Node.d.ts.map +1 -1
  43. package/lib/cjs/core-react/tree/Node.js +1 -3
  44. package/lib/cjs/core-react/tree/Node.js.map +1 -1
  45. package/lib/cjs/core-react/tree/Node.scss +14 -7
  46. package/lib/cjs/core-react/uistate/LocalStateStorage.d.ts +17 -0
  47. package/lib/cjs/core-react/uistate/LocalStateStorage.d.ts.map +1 -0
  48. package/lib/cjs/core-react/{uisettings/LocalSettingsStorage.js → uistate/LocalStateStorage.js} +14 -20
  49. package/lib/cjs/core-react/uistate/LocalStateStorage.js.map +1 -0
  50. package/lib/{esm/core-react/uisettings/UiSetting.d.ts → cjs/core-react/uistate/UiStateEntry.d.ts} +15 -15
  51. package/lib/cjs/core-react/uistate/UiStateEntry.d.ts.map +1 -0
  52. package/lib/cjs/core-react/{uisettings/UiSetting.js → uistate/UiStateEntry.js} +16 -16
  53. package/lib/cjs/core-react/uistate/UiStateEntry.js.map +1 -0
  54. package/lib/cjs/core-react/uistate/UiStateStorage.d.ts +29 -0
  55. package/lib/cjs/core-react/uistate/UiStateStorage.d.ts.map +1 -0
  56. package/lib/cjs/core-react/uistate/UiStateStorage.js +22 -0
  57. package/lib/cjs/core-react/uistate/UiStateStorage.js.map +1 -0
  58. package/lib/cjs/core-react/utils/UiEvent.d.ts +2 -2
  59. package/lib/cjs/core-react/utils/UiEvent.js +2 -2
  60. package/lib/cjs/core-react/utils/UiEvent.js.map +1 -1
  61. package/lib/cjs/core-react.d.ts +4 -5
  62. package/lib/cjs/core-react.d.ts.map +1 -1
  63. package/lib/cjs/core-react.js +4 -5
  64. package/lib/cjs/core-react.js.map +1 -1
  65. package/lib/esm/core-react/UiCore.d.ts +1 -1
  66. package/lib/esm/core-react/UiCore.d.ts.map +1 -1
  67. package/lib/esm/core-react/UiCore.js.map +1 -1
  68. package/lib/esm/core-react/contextmenu/PopupContextMenu.js +1 -1
  69. package/lib/esm/core-react/contextmenu/PopupContextMenu.js.map +1 -1
  70. package/lib/esm/core-react/dialog/DialogButtonDef.d.ts +3 -3
  71. package/lib/esm/core-react/dialog/DialogButtonDef.js +2 -2
  72. package/lib/esm/core-react/dialog/DialogButtonDef.js.map +1 -1
  73. package/lib/esm/core-react/expandable/ExpandableList.scss +0 -3
  74. package/lib/esm/core-react/form/Field.d.ts +2 -2
  75. package/lib/esm/core-react/form/Field.d.ts.map +1 -1
  76. package/lib/esm/core-react/form/Field.js +4 -3
  77. package/lib/esm/core-react/form/Field.js.map +1 -1
  78. package/lib/esm/core-react/form/Form.d.ts +7 -7
  79. package/lib/esm/core-react/form/Form.d.ts.map +1 -1
  80. package/lib/esm/core-react/form/Form.js +3 -2
  81. package/lib/esm/core-react/form/Form.js.map +1 -1
  82. package/lib/esm/core-react/icons/IconComponent.scss +5 -0
  83. package/lib/esm/core-react/inputs/numberinput/NumberInput.d.ts.map +1 -1
  84. package/lib/esm/core-react/inputs/numberinput/NumberInput.js +3 -2
  85. package/lib/esm/core-react/inputs/numberinput/NumberInput.js.map +1 -1
  86. package/lib/esm/core-react/inputs/numberinput/NumberInput.scss +13 -0
  87. package/lib/esm/core-react/messagebox/MessageBox.d.ts.map +1 -1
  88. package/lib/esm/core-react/messagebox/MessageBox.js +3 -0
  89. package/lib/esm/core-react/messagebox/MessageBox.js.map +1 -1
  90. package/lib/esm/core-react/messagebox/MessageBox.scss +2 -0
  91. package/lib/esm/core-react/messagebox/MessageSeverity.d.ts +1 -1
  92. package/lib/esm/core-react/messagebox/MessageSeverity.js +1 -1
  93. package/lib/esm/core-react/messagebox/MessageSeverity.js.map +1 -1
  94. package/lib/esm/core-react/popup/Popup.d.ts +6 -1
  95. package/lib/esm/core-react/popup/Popup.d.ts.map +1 -1
  96. package/lib/esm/core-react/popup/Popup.js +13 -4
  97. package/lib/esm/core-react/popup/Popup.js.map +1 -1
  98. package/lib/esm/core-react/popup/Popup.scss +11 -2
  99. package/lib/esm/core-react/select/ThemedSelect.d.ts +1 -1
  100. package/lib/esm/core-react/select/ThemedSelect.js +1 -1
  101. package/lib/esm/core-react/select/ThemedSelect.js.map +1 -1
  102. package/lib/esm/core-react/style/itwinui-overrides.scss +0 -68
  103. package/lib/esm/core-react/tree/Node.d.ts.map +1 -1
  104. package/lib/esm/core-react/tree/Node.js +1 -3
  105. package/lib/esm/core-react/tree/Node.js.map +1 -1
  106. package/lib/esm/core-react/tree/Node.scss +14 -7
  107. package/lib/esm/core-react/uistate/LocalStateStorage.d.ts +17 -0
  108. package/lib/esm/core-react/uistate/LocalStateStorage.d.ts.map +1 -0
  109. package/lib/esm/core-react/{uisettings/LocalSettingsStorage.js → uistate/LocalStateStorage.js} +12 -17
  110. package/lib/esm/core-react/uistate/LocalStateStorage.js.map +1 -0
  111. package/lib/{cjs/core-react/uisettings/UiSetting.d.ts → esm/core-react/uistate/UiStateEntry.d.ts} +15 -15
  112. package/lib/esm/core-react/uistate/UiStateEntry.d.ts.map +1 -0
  113. package/lib/esm/core-react/{uisettings/UiSetting.js → uistate/UiStateEntry.js} +14 -14
  114. package/lib/esm/core-react/uistate/UiStateEntry.js.map +1 -0
  115. package/lib/esm/core-react/uistate/UiStateStorage.d.ts +29 -0
  116. package/lib/esm/core-react/uistate/UiStateStorage.d.ts.map +1 -0
  117. package/lib/esm/core-react/uistate/UiStateStorage.js +19 -0
  118. package/lib/esm/core-react/uistate/UiStateStorage.js.map +1 -0
  119. package/lib/esm/core-react/utils/UiEvent.d.ts +2 -2
  120. package/lib/esm/core-react/utils/UiEvent.js +2 -2
  121. package/lib/esm/core-react/utils/UiEvent.js.map +1 -1
  122. package/lib/esm/core-react.d.ts +4 -5
  123. package/lib/esm/core-react.d.ts.map +1 -1
  124. package/lib/esm/core-react.js +4 -5
  125. package/lib/esm/core-react.js.map +1 -1
  126. package/package.json +20 -22
  127. package/lib/cjs/core-react/uisettings/LocalSettingsStorage.d.ts +0 -24
  128. package/lib/cjs/core-react/uisettings/LocalSettingsStorage.d.ts.map +0 -1
  129. package/lib/cjs/core-react/uisettings/LocalSettingsStorage.js.map +0 -1
  130. package/lib/cjs/core-react/uisettings/SessionSettingsStorage.d.ts +0 -24
  131. package/lib/cjs/core-react/uisettings/SessionSettingsStorage.d.ts.map +0 -1
  132. package/lib/cjs/core-react/uisettings/SessionSettingsStorage.js +0 -56
  133. package/lib/cjs/core-react/uisettings/SessionSettingsStorage.js.map +0 -1
  134. package/lib/cjs/core-react/uisettings/UiSetting.d.ts.map +0 -1
  135. package/lib/cjs/core-react/uisettings/UiSetting.js.map +0 -1
  136. package/lib/cjs/core-react/uisettings/UiSettingsStorage.d.ts +0 -33
  137. package/lib/cjs/core-react/uisettings/UiSettingsStorage.d.ts.map +0 -1
  138. package/lib/cjs/core-react/uisettings/UiSettingsStorage.js +0 -22
  139. package/lib/cjs/core-react/uisettings/UiSettingsStorage.js.map +0 -1
  140. package/lib/esm/core-react/uisettings/LocalSettingsStorage.d.ts +0 -24
  141. package/lib/esm/core-react/uisettings/LocalSettingsStorage.d.ts.map +0 -1
  142. package/lib/esm/core-react/uisettings/LocalSettingsStorage.js.map +0 -1
  143. package/lib/esm/core-react/uisettings/SessionSettingsStorage.d.ts +0 -24
  144. package/lib/esm/core-react/uisettings/SessionSettingsStorage.d.ts.map +0 -1
  145. package/lib/esm/core-react/uisettings/SessionSettingsStorage.js +0 -51
  146. package/lib/esm/core-react/uisettings/SessionSettingsStorage.js.map +0 -1
  147. package/lib/esm/core-react/uisettings/UiSetting.d.ts.map +0 -1
  148. package/lib/esm/core-react/uisettings/UiSetting.js.map +0 -1
  149. package/lib/esm/core-react/uisettings/UiSettingsStorage.d.ts +0 -33
  150. package/lib/esm/core-react/uisettings/UiSettingsStorage.d.ts.map +0 -1
  151. package/lib/esm/core-react/uisettings/UiSettingsStorage.js +0 -19
  152. package/lib/esm/core-react/uisettings/UiSettingsStorage.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"ThemedSelect.js","sourceRoot":"","sources":["../../../../src/core-react/select/ThemedSelect.tsx"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F,4CAA4C;AAC5C;;GAEG;;;AAEH,gCAA8B;AAC9B,2CAAoC;AACpC,+BAA+B;AAC/B,+CAAqD;AAKrD,sCAAmC;AACnC,4DAAiE;AACjE,+CAAkD;AAqLlD,MAAM,UAAU,GAAG,CAAC,KAAqB,EAAE,EAAE;IAC3C,OAAO,CACL,6BAAK,SAAS,EAAC,uBAAuB;QACpC,oBAAC,yBAAU,CAAC,IAAI,OAAK,KAAK,GAAI,CAC1B,CACP,CAAC;AACJ,CAAC,CAAC;AACF;;;GAGG;AACH,gEAAgE;AAChE,SAAgB,YAAY,CAAC,KAAwB;;IACnD,MAAM,aAAa,GAAG,KAAK,CAAC,MAAM,EAAsB,CAAC;IACzD,MAAM,oBAAoB,GAAG,KAAK,CAAC,WAAW,CAAC,GAAG,EAAE;QAClD,IAAI,CAAC,aAAa,CAAC,OAAO,EAAE;YAC1B,aAAa,CAAC,OAAO,GAAG,eAAM,CAAC,SAAS,CAAC,2BAA2B,CAAC,CAAC;SACvE;QACD,OAAO,aAAa,CAAC,OAAO,CAAC;IAC/B,CAAC,EAAE,CAAC,aAAa,CAAC,CAAC,CAAC;IACpB,MAAM,gBAAgB,GAAG,MAAA,KAAK,CAAC,gBAAgB,mCAAI,oBAAoB,CAAC;IACxE,MAAM,eAAe,GAAG,IAAA,oBAAU,EAAC,uBAAuB,EAAE,KAAK,CAAC,SAAS,CAAC,CAAC;IAC7E,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,IAAA,+BAAiB,GAAE,CAAC;IAC3E,MAAM;IACJ,6DAA6D;IAC7D,eAAe,EAAE,SAAS,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,GAAG;IAC5G,wCAAwC;IACxC,GAAG,UAAU,CAAC,qBAAqB;MACpC,GAAG,KAAY,CAAC;IACjB,MAAM,YAAY,GAAG;QACnB,GAAG,KAAK,CAAC,MAAM;QACf,UAAU,EAAE,CAAC,IAAyB,EAAE,EAAE,CAAC,CAAC,EAAE,GAAG,IAAI,EAAE,MAAM,EAAE,CAAC;KACjE,CAAC;IAEF,MAAM,MAAM,GAAG,IAAA,uCAAsB,EAAC,+BAA+B,CAAC,CAAC;IACvE,OAAO,CACL,6BAAK,SAAS,EAAE,eAAe,EAAE,GAAG,EAAE,MAAM;QAC1C,oBAAC,sBAAS,IACR,GAAG,EAAE,GAAG,EACR,eAAe,EAAC,cAAc,EAC9B,gBAAgB,EAAE,gBAAgB,EAClC,gBAAgB,EAAE,YAAY,EAC9B,MAAM,EAAE,YAAY;YACpB,gEAAgE;YAChE,UAAU,EAAE,EAAE,IAAI,EAAE,UAAU,EAAE,GAAG,KAAK,CAAC,UAAU,EAAE,KACjD,UAAU,GACd,CACE,CACP,CAAC;AACJ,CAAC;AArCD,oCAqCC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/* eslint-disable deprecation/deprecation */\r\n/** @packageDocumentation\r\n * @module Select\r\n */\r\n\r\nimport \"./themed-select.scss\";\r\nimport classnames from \"classnames\";\r\nimport * as React from \"react\";\r\nimport Component, { components } from \"react-select\";\r\nimport { formatGroupLabel, getOptionLabel, getOptionValue } from \"react-select/src/builtins\";\r\nimport { SelectComponentsConfig } from \"react-select/src/components/index\";\r\nimport { MenuProps } from \"react-select/src/components/Menu\";\r\nimport { ActionMeta, FocusEventHandler, InputActionMeta, KeyboardEventHandler, ValueType } from \"react-select/src/types\";\r\nimport { UiCore } from \"../UiCore\";\r\nimport { getCssVariableAsNumber } from \"../utils/getCssVariable\";\r\nimport { getParentSelector } from \"./modalHelper\";\r\n\r\n// cspell:ignore reactselect builtins\r\n\r\n/* eslint-disable @typescript-eslint/no-shadow, @typescript-eslint/consistent-type-definitions, @typescript-eslint/array-type */\r\ntype FormatOptionLabelContext = \"menu\" | \"value\";\r\ntype FormatOptionLabelMeta = {\r\n context: FormatOptionLabelContext;\r\n inputValue: string;\r\n selectValue: ValueType<OptionType>;\r\n};\r\n\r\n/** OptionType for react-select 2.0 and above. which only accepts pairs of value & label strings\r\n * @beta\r\n * @deprecated use Select from @itwin/itwinui-react\r\n */\r\nexport interface OptionType {\r\n value: any;\r\n label: string;\r\n}\r\n/** OptionsType to match label/value pair OptionType\r\n * @beta\r\n * @deprecated use Select from @itwin/itwinui-react\r\n*/\r\nexport type OptionsType = Array<OptionType>;\r\n\r\n/** ThemedSelectProps to control specific features of ThemedSelect\r\n * @beta\r\n * @deprecated use Select from @itwin/itwinui-react\r\n */\r\nexport type ThemedSelectProps = {\r\n /* Aria label (for assistive tech) */\r\n \"aria-label\"?: string;\r\n /* HTML ID of an element that should be used as the label (for assistive tech) */\r\n \"aria-labelledby\"?: string;\r\n /* Focus the control when it is mounted */\r\n autoFocus?: boolean;\r\n /* Remove the currently focused option when the user presses backspace */\r\n backspaceRemovesValue?: boolean;\r\n /* Remove focus from the input when the user selects an option (handy for dismissing the keyboard on touch devices) */\r\n blurInputOnSelect?: boolean;\r\n /* When the user reaches the top/bottom of the menu, prevent scroll on the scroll-parent */\r\n captureMenuScroll?: boolean;\r\n /* Sets a className attribute on the outer component */\r\n className?: string;\r\n /* Close the select menu when the user selects an option */\r\n closeMenuOnSelect?: boolean;\r\n /*\r\n If `true`, close the select menu when the user scrolls the document/body.\r\n\r\n If a function, takes a standard javascript `ScrollEvent` you return a boolean:\r\n\r\n `true` => The menu closes\r\n\r\n `false` => The menu stays open\r\n\r\n This is useful when you have a scrollable modal and want to portal the menu out,\r\n but want to avoid graphical issues.\r\n */\r\n closeMenuOnScroll?: boolean | EventListener;\r\n /*\r\n This complex object includes all the compositional components that are used\r\n in `react-select`. If you wish to overwrite a component, pass in an object\r\n with the appropriate namespace.\r\n\r\n If you only wish to restyle a component, we recommend using the `styles` prop\r\n instead. For a list of the components that can be passed in, and the shape\r\n that will be passed to them, see [the components docs](/components)\r\n */\r\n components?: SelectComponentsConfig<OptionType>;\r\n /* Whether the value of the select, e.g. SingleValue, should be displayed in the control. */\r\n controlShouldRenderValue?: boolean;\r\n /* Ff true, the menu is open immediately */\r\n defaultMenuIsOpen?: boolean;\r\n /* Value set in the control by default */\r\n defaultValue?: ValueType<OptionType>;\r\n /** Provides ability to return reference to the outer HTMLDivElement */\r\n divRef?: React.Ref<HTMLDivElement>;\r\n /* Clear all values when the user presses escape AND the menu is closed */\r\n escapeClearsValue?: boolean;\r\n /* Custom method to filter whether an option should be displayed in the menu */\r\n filterOption?: ((\r\n option: OptionType,\r\n rawInput: string,\r\n ) => boolean) | null;\r\n /*\r\n Formats group labels in the menu as React components\r\n\r\n An example can be found in the [Replacing builtins](/advanced#replacing-builtins) documentation.\r\n*/\r\n formatGroupLabel?: typeof formatGroupLabel;\r\n /* Formats option labels in the menu and control as React components */\r\n formatOptionLabel?: (optionType: OptionType, formatLabelMeta: FormatOptionLabelMeta) => React.ReactNode;\r\n /* Resolves option data to a string to be displayed as the label by components */\r\n getOptionLabel?: typeof getOptionLabel;\r\n /* Resolves option data to a string to compare options and specify value attributes */\r\n getOptionValue?: typeof getOptionValue;\r\n /* Hide the selected option from the menu */\r\n hideSelectedOptions?: boolean;\r\n /* The id to set on the SelectContainer component. */\r\n id?: string;\r\n /* The value of the search input */\r\n inputValue?: string;\r\n /* The id of the search input */\r\n inputId?: string;\r\n /* Define an id prefix for the select components e.g. {your-id}-value */\r\n instanceId?: number | string;\r\n /* Is the select value clearable */\r\n isClearable?: boolean;\r\n /* Is the select disabled */\r\n isDisabled?: boolean;\r\n /* Is the select in a state of loading (async) */\r\n isLoading?: boolean;\r\n /*\r\n Override the built-in logic to detect whether an option is disabled\r\n\r\n An example can be found in the [Replacing builtins](/advanced#replacing-builtins) documentation.\r\n */\r\n isOptionDisabled?: (option: OptionType, options: OptionsType) => boolean | false;\r\n /* Support multiple selected options */\r\n isMulti?: boolean;\r\n /* If true, menu will not be opened in a portal */\r\n isMenuFixed?: boolean;\r\n /* Is the select direction right-to-left */\r\n isRtl?: boolean;\r\n /* Whether to enable search functionality */\r\n isSearchable?: boolean;\r\n /* Minimum height of the menu before flipping */\r\n minMenuHeight?: number;\r\n /* Maximum height of the menu before scrolling */\r\n maxMenuHeight?: number;\r\n /* Whether the menu is open */\r\n menuIsOpen?: boolean;\r\n /* Whether to block scroll events when the menu is open */\r\n menuShouldBlockScroll?: boolean;\r\n /* Whether the menu should be scrolled into view when it opens */\r\n menuShouldScrollIntoView?: boolean;\r\n /* Name of the HTML Input (optional - without this, no input will be rendered) */\r\n name?: string;\r\n /* Text to display when there are no options */\r\n noOptionsMessage?: (obj: { inputValue: string }) => string | null;\r\n /* Handle blur events on the control */\r\n onBlur?: FocusEventHandler;\r\n /* Handle change events on the select */\r\n onChange?: (value: ValueType<OptionType>, action: ActionMeta<OptionType>) => void;\r\n /* Handle focus events on the control */\r\n onFocus?: FocusEventHandler;\r\n /* Handle change events on the input */\r\n onInputChange?: (newValue: string, actionMeta?: InputActionMeta) => void;\r\n /* Handle key down events on the select */\r\n onKeyDown?: KeyboardEventHandler;\r\n /* Handle the menu opening */\r\n onMenuOpen?: () => void;\r\n /* Handle the menu closing */\r\n onMenuClose?: () => void;\r\n /* Fired when the user scrolls to the top of the menu */\r\n onMenuScrollToTop?: (e: React.SyntheticEvent<HTMLElement>) => void;\r\n /* Fired when the user scrolls to the bottom of the menu */\r\n onMenuScrollToBottom?: (e: React.SyntheticEvent<HTMLElement>) => void;\r\n /* Allows control of whether the menu is opened when the Select is focused */\r\n openMenuOnFocus?: boolean;\r\n /* Allows control of whether the menu is opened when the Select is clicked */\r\n openMenuOnClick?: boolean;\r\n /* Array of options that populate the select menu */\r\n options: OptionsType;\r\n /* Number of options to jump in menu when page{up|down} keys are used */\r\n pageSize?: number;\r\n /* Placeholder for the select value */\r\n placeholder?: string;\r\n /** Provides ability to return reference to the ThemedSelect */\r\n ref?: React.Ref<Component>;\r\n /* Sets additional styling */\r\n styles?: React.CSSProperties;\r\n /* Sets the tabIndex attribute on the input */\r\n tabIndex?: string;\r\n /* Select the currently focused option when the user presses tab */\r\n tabSelectsValue?: boolean;\r\n /* The value of the select; reflected by the selected option */\r\n value?: ValueType<OptionType>;\r\n};\r\n\r\nconst ThemedMenu = (props: MenuProps<any>) => { // eslint-disable-line @typescript-eslint/naming-convention\r\n return (\r\n <div className=\"uicore-reactSelectTop\">\r\n <components.Menu {...props} />\r\n </div>\r\n );\r\n};\r\n/** ThemedSelect is a wrapper for react-select with iModel.js UI theming applied\r\n * @beta\r\n * @deprecated use Select from @itwin/itwinui-react\r\n */\r\n// eslint-disable-next-line @typescript-eslint/naming-convention\r\nexport function ThemedSelect(props: ThemedSelectProps) {\r\n const noOptionLabel = React.useRef<string | undefined>();\r\n const defaultOptionMessage = React.useCallback(() => {\r\n if (!noOptionLabel.current) {\r\n noOptionLabel.current = UiCore.translate(\"reactelect.noSelectOption\");\r\n }\r\n return noOptionLabel.current;\r\n }, [noOptionLabel]);\r\n const noOptionFunction = props.noOptionsMessage ?? defaultOptionMessage;\r\n const selectClassName = classnames(\"uicore-reactSelectTop\", props.className);\r\n const portalTarget = !!props.isMenuFixed ? undefined : getParentSelector();\r\n const {\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n classNamePrefix, className, noOptionsMessage, menuPortalTarget, isMenuFixed, styles, components, divRef, ref,\r\n // eslint-disable-next-line comma-dangle\r\n ...otherProps // pass-through props\r\n } = props as any;\r\n const selectStyles = {\r\n ...props.styles,\r\n menuPortal: (base: React.CSSProperties) => ({ ...base, zIndex }),\r\n };\r\n\r\n const zIndex = getCssVariableAsNumber(\"--uicore-z-index-dialog-popup\");\r\n return (\r\n <div className={selectClassName} ref={divRef}>\r\n <Component\r\n ref={ref}\r\n classNamePrefix=\"react-select\"\r\n noOptionsMessage={noOptionFunction}\r\n menuPortalTarget={portalTarget}\r\n styles={selectStyles}\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n components={{ Menu: ThemedMenu, ...props.components }}\r\n {...otherProps}\r\n />\r\n </div>\r\n );\r\n}\r\n"]}
1
+ {"version":3,"file":"ThemedSelect.js","sourceRoot":"","sources":["../../../../src/core-react/select/ThemedSelect.tsx"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F,4CAA4C;AAC5C;;GAEG;;;AAEH,gCAA8B;AAC9B,2CAAoC;AACpC,+BAA+B;AAC/B,+CAAqD;AAKrD,sCAAmC;AACnC,4DAAiE;AACjE,+CAAkD;AAqLlD,MAAM,UAAU,GAAG,CAAC,KAAqB,EAAE,EAAE;IAC3C,OAAO,CACL,6BAAK,SAAS,EAAC,uBAAuB;QACpC,oBAAC,yBAAU,CAAC,IAAI,OAAK,KAAK,GAAI,CAC1B,CACP,CAAC;AACJ,CAAC,CAAC;AACF;;;GAGG;AACH,gEAAgE;AAChE,SAAgB,YAAY,CAAC,KAAwB;;IACnD,MAAM,aAAa,GAAG,KAAK,CAAC,MAAM,EAAsB,CAAC;IAC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UAAU,EAAE,EAAE,IAAI,EAAE,UAAU,EAAE,GAAG,KAAK,CAAC,UAAU,EAAE,KACjD,UAAU,GACd,CACE,CACP,CAAC;AACJ,CAAC;AArCD,oCAqCC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/* eslint-disable deprecation/deprecation */\r\n/** @packageDocumentation\r\n * @module Select\r\n */\r\n\r\nimport \"./themed-select.scss\";\r\nimport classnames from \"classnames\";\r\nimport * as React from \"react\";\r\nimport Component, { components } from \"react-select\";\r\nimport { formatGroupLabel, getOptionLabel, getOptionValue } from \"react-select/src/builtins\";\r\nimport { SelectComponentsConfig } from \"react-select/src/components/index\";\r\nimport { MenuProps } from \"react-select/src/components/Menu\";\r\nimport { ActionMeta, FocusEventHandler, InputActionMeta, KeyboardEventHandler, ValueType } from \"react-select/src/types\";\r\nimport { UiCore } from \"../UiCore\";\r\nimport { getCssVariableAsNumber } from \"../utils/getCssVariable\";\r\nimport { getParentSelector } from \"./modalHelper\";\r\n\r\n// cspell:ignore reactselect builtins\r\n\r\n/* eslint-disable @typescript-eslint/no-shadow, @typescript-eslint/consistent-type-definitions, @typescript-eslint/array-type */\r\ntype FormatOptionLabelContext = \"menu\" | \"value\";\r\ntype FormatOptionLabelMeta = {\r\n context: FormatOptionLabelContext;\r\n inputValue: string;\r\n selectValue: ValueType<OptionType>;\r\n};\r\n\r\n/** OptionType for react-select 2.0 and above. which only accepts pairs of value & label strings\r\n * @beta\r\n * @deprecated use Select from @itwin/itwinui-react\r\n */\r\nexport interface OptionType {\r\n value: any;\r\n label: string;\r\n}\r\n/** OptionsType to match label/value pair OptionType\r\n * @beta\r\n * @deprecated use Select from @itwin/itwinui-react\r\n*/\r\nexport type OptionsType = Array<OptionType>;\r\n\r\n/** ThemedSelectProps to control specific features of ThemedSelect\r\n * @beta\r\n * @deprecated use Select from @itwin/itwinui-react\r\n */\r\nexport type ThemedSelectProps = {\r\n /* Aria label (for assistive tech) */\r\n \"aria-label\"?: string;\r\n /* HTML ID of an element that should be used as the label (for assistive tech) */\r\n \"aria-labelledby\"?: string;\r\n /* Focus the control when it is mounted */\r\n autoFocus?: boolean;\r\n /* Remove the currently focused option when the user presses backspace */\r\n backspaceRemovesValue?: boolean;\r\n /* Remove focus from the input when the user selects an option (handy for dismissing the keyboard on touch devices) */\r\n blurInputOnSelect?: boolean;\r\n /* When the user reaches the top/bottom of the menu, prevent scroll on the scroll-parent */\r\n captureMenuScroll?: boolean;\r\n /* Sets a className attribute on the outer component */\r\n className?: string;\r\n /* Close the select menu when the user selects an option */\r\n closeMenuOnSelect?: boolean;\r\n /*\r\n If `true`, close the select menu when the user scrolls the document/body.\r\n\r\n If a function, takes a standard javascript `ScrollEvent` you return a boolean:\r\n\r\n `true` => The menu closes\r\n\r\n `false` => The menu stays open\r\n\r\n This is useful when you have a scrollable modal and want to portal the menu out,\r\n but want to avoid graphical issues.\r\n */\r\n closeMenuOnScroll?: boolean | EventListener;\r\n /*\r\n This complex object includes all the compositional components that are used\r\n in `react-select`. If you wish to overwrite a component, pass in an object\r\n with the appropriate namespace.\r\n\r\n If you only wish to restyle a component, we recommend using the `styles` prop\r\n instead. For a list of the components that can be passed in, and the shape\r\n that will be passed to them, see [the components docs](/components)\r\n */\r\n components?: SelectComponentsConfig<OptionType>;\r\n /* Whether the value of the select, e.g. SingleValue, should be displayed in the control. */\r\n controlShouldRenderValue?: boolean;\r\n /* Ff true, the menu is open immediately */\r\n defaultMenuIsOpen?: boolean;\r\n /* Value set in the control by default */\r\n defaultValue?: ValueType<OptionType>;\r\n /** Provides ability to return reference to the outer HTMLDivElement */\r\n divRef?: React.Ref<HTMLDivElement>;\r\n /* Clear all values when the user presses escape AND the menu is closed */\r\n escapeClearsValue?: boolean;\r\n /* Custom method to filter whether an option should be displayed in the menu */\r\n filterOption?: ((\r\n option: OptionType,\r\n rawInput: string,\r\n ) => boolean) | null;\r\n /*\r\n Formats group labels in the menu as React components\r\n\r\n An example can be found in the [Replacing builtins](/advanced#replacing-builtins) documentation.\r\n*/\r\n formatGroupLabel?: typeof formatGroupLabel;\r\n /* Formats option labels in the menu and control as React components */\r\n formatOptionLabel?: (optionType: OptionType, formatLabelMeta: FormatOptionLabelMeta) => React.ReactNode;\r\n /* Resolves option data to a string to be displayed as the label by components */\r\n getOptionLabel?: typeof getOptionLabel;\r\n /* Resolves option data to a string to compare options and specify value attributes */\r\n getOptionValue?: typeof getOptionValue;\r\n /* Hide the selected option from the menu */\r\n hideSelectedOptions?: boolean;\r\n /* The id to set on the SelectContainer component. */\r\n id?: string;\r\n /* The value of the search input */\r\n inputValue?: string;\r\n /* The id of the search input */\r\n inputId?: string;\r\n /* Define an id prefix for the select components e.g. {your-id}-value */\r\n instanceId?: number | string;\r\n /* Is the select value clearable */\r\n isClearable?: boolean;\r\n /* Is the select disabled */\r\n isDisabled?: boolean;\r\n /* Is the select in a state of loading (async) */\r\n isLoading?: boolean;\r\n /*\r\n Override the built-in logic to detect whether an option is disabled\r\n\r\n An example can be found in the [Replacing builtins](/advanced#replacing-builtins) documentation.\r\n */\r\n isOptionDisabled?: (option: OptionType, options: OptionsType) => boolean | false;\r\n /* Support multiple selected options */\r\n isMulti?: boolean;\r\n /* If true, menu will not be opened in a portal */\r\n isMenuFixed?: boolean;\r\n /* Is the select direction right-to-left */\r\n isRtl?: boolean;\r\n /* Whether to enable search functionality */\r\n isSearchable?: boolean;\r\n /* Minimum height of the menu before flipping */\r\n minMenuHeight?: number;\r\n /* Maximum height of the menu before scrolling */\r\n maxMenuHeight?: number;\r\n /* Whether the menu is open */\r\n menuIsOpen?: boolean;\r\n /* Whether to block scroll events when the menu is open */\r\n menuShouldBlockScroll?: boolean;\r\n /* Whether the menu should be scrolled into view when it opens */\r\n menuShouldScrollIntoView?: boolean;\r\n /* Name of the HTML Input (optional - without this, no input will be rendered) */\r\n name?: string;\r\n /* Text to display when there are no options */\r\n noOptionsMessage?: (obj: { inputValue: string }) => string | null;\r\n /* Handle blur events on the control */\r\n onBlur?: FocusEventHandler;\r\n /* Handle change events on the select */\r\n onChange?: (value: ValueType<OptionType>, action: ActionMeta<OptionType>) => void;\r\n /* Handle focus events on the control */\r\n onFocus?: FocusEventHandler;\r\n /* Handle change events on the input */\r\n onInputChange?: (newValue: string, actionMeta?: InputActionMeta) => void;\r\n /* Handle key down events on the select */\r\n onKeyDown?: KeyboardEventHandler;\r\n /* Handle the menu opening */\r\n onMenuOpen?: () => void;\r\n /* Handle the menu closing */\r\n onMenuClose?: () => void;\r\n /* Fired when the user scrolls to the top of the menu */\r\n onMenuScrollToTop?: (e: React.SyntheticEvent<HTMLElement>) => void;\r\n /* Fired when the user scrolls to the bottom of the menu */\r\n onMenuScrollToBottom?: (e: React.SyntheticEvent<HTMLElement>) => void;\r\n /* Allows control of whether the menu is opened when the Select is focused */\r\n openMenuOnFocus?: boolean;\r\n /* Allows control of whether the menu is opened when the Select is clicked */\r\n openMenuOnClick?: boolean;\r\n /* Array of options that populate the select menu */\r\n options: OptionsType;\r\n /* Number of options to jump in menu when page{up|down} keys are used */\r\n pageSize?: number;\r\n /* Placeholder for the select value */\r\n placeholder?: string;\r\n /** Provides ability to return reference to the ThemedSelect */\r\n ref?: React.Ref<Component>;\r\n /* Sets additional styling */\r\n styles?: React.CSSProperties;\r\n /* Sets the tabIndex attribute on the input */\r\n tabIndex?: string;\r\n /* Select the currently focused option when the user presses tab */\r\n tabSelectsValue?: boolean;\r\n /* The value of the select; reflected by the selected option */\r\n value?: ValueType<OptionType>;\r\n};\r\n\r\nconst ThemedMenu = (props: MenuProps<any>) => { // eslint-disable-line @typescript-eslint/naming-convention\r\n return (\r\n <div className=\"uicore-reactSelectTop\">\r\n <components.Menu {...props} />\r\n </div>\r\n );\r\n};\r\n/** ThemedSelect is a wrapper for react-select with iTwin.js UI theming applied\r\n * @beta\r\n * @deprecated use Select from @itwin/itwinui-react\r\n */\r\n// eslint-disable-next-line @typescript-eslint/naming-convention\r\nexport function ThemedSelect(props: ThemedSelectProps) {\r\n const noOptionLabel = React.useRef<string | undefined>();\r\n const defaultOptionMessage = React.useCallback(() => {\r\n if (!noOptionLabel.current) {\r\n noOptionLabel.current = UiCore.translate(\"reactelect.noSelectOption\");\r\n }\r\n return noOptionLabel.current;\r\n }, [noOptionLabel]);\r\n const noOptionFunction = props.noOptionsMessage ?? defaultOptionMessage;\r\n const selectClassName = classnames(\"uicore-reactSelectTop\", props.className);\r\n const portalTarget = !!props.isMenuFixed ? undefined : getParentSelector();\r\n const {\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n classNamePrefix, className, noOptionsMessage, menuPortalTarget, isMenuFixed, styles, components, divRef, ref,\r\n // eslint-disable-next-line comma-dangle\r\n ...otherProps // pass-through props\r\n } = props as any;\r\n const selectStyles = {\r\n ...props.styles,\r\n menuPortal: (base: React.CSSProperties) => ({ ...base, zIndex }),\r\n };\r\n\r\n const zIndex = getCssVariableAsNumber(\"--uicore-z-index-dialog-popup\");\r\n return (\r\n <div className={selectClassName} ref={divRef}>\r\n <Component\r\n ref={ref}\r\n classNamePrefix=\"react-select\"\r\n noOptionsMessage={noOptionFunction}\r\n menuPortalTarget={portalTarget}\r\n styles={selectStyles}\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n components={{ Menu: ThemedMenu, ...props.components }}\r\n {...otherProps}\r\n />\r\n </div>\r\n );\r\n}\r\n"]}
@@ -10,32 +10,6 @@
10
10
 
11
11
  // Override some iTwinUI-css padding and minimums for iTwin.js applications
12
12
 
13
- @mixin small-itwinui-input {
14
-
15
- .iui-input {
16
- min-height: $uicore-component-height-normal !important;
17
- padding: $uicore-iui-input-padding !important;
18
- }
19
-
20
- }
21
-
22
- @mixin small-itwinui-select {
23
-
24
- .iui-select {
25
- >.iui-select-button {
26
- min-height: $uicore-component-height-normal !important;
27
- padding-top: 2px !important;
28
- padding-bottom: 2px !important;
29
- padding-right: 24px !important;
30
- }
31
-
32
- >.iui-select-button::after {
33
- right: 6px !important;
34
- }
35
- }
36
-
37
- }
38
-
39
13
  @mixin small-itwinui-toggle-switch {
40
14
 
41
15
  .iui-toggle-switch {
@@ -44,50 +18,8 @@
44
18
 
45
19
  }
46
20
 
47
- @mixin small-itwinui-expandable-block {
48
-
49
- $small-space: 5px;
50
-
51
- .iui-expandable-block {
52
- >.iui-header {
53
- padding: $small-space $small-space !important;
54
-
55
- >.iui-icon {
56
- width: $uicore-icons-x-small !important;
57
- height: $uicore-icons-x-small !important;
58
-
59
- margin-left: $iui-xs !important;
60
- }
61
-
62
- >.iui-expandable-block-label {
63
- margin-left: 8px;
64
- }
65
- }
66
-
67
- &.iui-expanded {
68
- >.iui-content {
69
- padding: 0 !important;
70
- }
71
- }
72
- }
73
-
74
- }
75
-
76
- @mixin adjust-itwinui-toast {
77
-
78
- .iui-toast {
79
- margin: 0 !important;
80
- width: 100% !important;
81
- }
82
-
83
- }
84
-
85
21
  @mixin itwinui-style-overrides {
86
22
 
87
- @include small-itwinui-input;
88
- @include small-itwinui-select;
89
23
  @include small-itwinui-toggle-switch;
90
- @include small-itwinui-expandable-block;
91
- @include adjust-itwinui-toast;
92
24
 
93
25
  }
@@ -1 +1 @@
1
- {"version":3,"file":"Node.d.ts","sourceRoot":"","sources":["../../../../src/core-react/tree/Node.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,aAAa,CAAC;AAErB,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAY,aAAa,EAAkB,MAAM,sBAAsB,CAAC;AAC/E,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAG1C;;GAEG;AACH,oBAAY,uBAAuB,GAAG,IAAI,CAAC,aAAa,EAAE,UAAU,GAAG,SA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CAAC,EAAE,KAAK,CAAC,UAAU,KAAK,IAAI,CAAC;IAC5C,SAAS,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,KAAK,IAAI,CAAC;IAC1C,sBAAsB,CAAC,EAAE,MAAM,IAAI,CAAC;IACpC,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAE3B,4EAA4E;IAC5E,eAAe,CAAC,EAAE;QAChB,6EAA6E;QAC7E,cAAc,CAAC,EAAE,oBAAoB,CAAC;KACvC,CAAC;IACF,CAAC,aAAa,CAAC,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED;;GAEG;AACH,qBAAa,QAAS,SAAQ,KAAK,CAAC,SAAS,CAAC,aAAa,CAAC;gBAC9C,KAAK,EAAE,aAAa;IAIhB,MAAM;IA0EtB,OAAO,CAAC,wBAAwB;IAMhC,OAAO,CAAC,iBAAiB,CAGvB;IAEF,OAAO,CAAC,gBAAgB,CAEtB;IAEF,OAAO,CAAC,uBAAuB,CAI7B;IAEF,OAAO,CAAC,QAAQ,CAId;CACH"}
@@ -48,8 +48,6 @@ class TreeNode extends React.Component {
48
48
  let offset = this.props.level * exports.LEVEL_OFFSET;
49
49
  if (!this.props.isLoading && this.props.isLeaf)
50
50
  offset += EXPANSION_TOGGLE_WIDTH; // Add expansion toggle/loader width if they're not rendered
51
- const loader = this.props.isLoading ? (React.createElement("div", { className: "loader" },
52
- React.createElement(itwinui_react_1.ProgressRadial, { size: "x-small", indeterminate: true }))) : undefined;
53
51
  let checkbox;
54
52
  if (this.props.checkboxProps) {
55
53
  const props = {
@@ -74,7 +72,7 @@ class TreeNode extends React.Component {
74
72
  // eslint-disable-next-line jsx-a11y/click-events-have-key-events
75
73
  React.createElement("div", { className: className, style: this.props.style, "data-testid": this.props["data-testid"], onClick: this._onClick, onContextMenu: this.props.onContextMenu, onMouseDown: this.props.onMouseDown, onMouseUp: this.props.onMouseUp, onMouseMove: this.props.onMouseMove, role: "treeitem", tabIndex: -1 },
76
74
  React.createElement("div", { className: "contents", style: { marginLeft: offset }, "data-testid": this.createSubComponentTestId("contents") },
77
- loader,
75
+ this.props.isLoading && React.createElement(itwinui_react_1.ProgressRadial, { size: "x-small", indeterminate: true }),
78
76
  toggle,
79
77
  checkbox,
80
78
  icon,
@@ -1 +1 @@
1
- {"version":3,"file":"Node.js","sourceRoot":"","sources":["../../../../src/core-react/tree/Node.tsx"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,uBAAqB;AACrB,2CAAoC;AACpC,+BAA+B;AAC/B,wDAA+E;AAC/E,0DAAuD;AAGvD,uDAAoD;AAepD;;GAEG;AACU,QAAA,YAAY,GAAG,EAAE,CAAC;AAE/B,MAAM,sBAAsB,GAAG,EAAE,CAAC;AAgDlC;;GAEG;AACH,MAAa,QAAS,SAAQ,KAAK,CAAC,SAAwB;IAC1D,YAAY,KAAoB;QAC9B,KAAK,CAAC,KAAK,CAAC,CAAC;QAqFP,sBAAiB,GAAG,CAAC,OAAgB,EAAE,EAAE;YAC/C,IAAI,IAAI,CAAC,KAAK,CAAC,aAAa,IAAI,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,OAAO,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,UAAU;gBACtG,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,6BAAa,CAAC,EAAE,CAAC,CAAC,CAAC,6BAAa,CAAC,GAAG,CAAC,CAAC;QACrF,CAAC,CAAC;QAEM,qBAAgB,GAAG,CAAC,CAAmB,EAAE,EAAE;YACjD,CAAC,CAAC,eAAe,EAAE,CAAC;QACtB,CAAC,CAAC;QAEM,4BAAuB,GAAG,CAAC,CAAmC,EAAE,EAAE;YACxE,CAAC,CAAC,eAAe,EAAE,CAAC;YACpB,IAAI,IAAI,CAAC,KAAK,CAAC,sBAAsB;gBACnC,IAAI,CAAC,KAAK,CAAC,sBAAsB,EAAE,CAAC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E,IAAI,CAAC,KAAK,CAAC,KAAK,iBACV,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,EACtC,OAAO,EAAE,IAAI,CAAC,QAAQ,EACtB,aAAa,EAAE,IAAI,CAAC,KAAK,CAAC,aAAa,EACvC,WAAW,EAAE,IAAI,CAAC,KAAK,CAAC,WAAW,EACnC,SAAS,EAAE,IAAI,CAAC,KAAK,CAAC,SAAS,EAC/B,WAAW,EAAE,IAAI,CAAC,KAAK,CAAC,WAAW,EACnC,IAAI,EAAC,UAAU,EACf,QAAQ,EAAE,CAAC,CAAC;YAEZ,6BACE,SAAS,EAAC,UAAU,EACpB,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,EAAE,iBAChB,IAAI,CAAC,wBAAwB,CAAC,UAAU,CAAC;gBAErD,MAAM;gBACN,MAAM;gBACN,QAAQ;gBACR,IAAI;gBACJ,IAAI,CAAC,KAAK,CAAC,KAAK,CACb;YACL,IAAI,CAAC,KAAK,CAAC,QAAQ,CAChB,CACP,CAAC;IACJ,CAAC;IAEO,wBAAwB,CAAC,KAAa;QAC5C,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC;YAC5B,OAAO,SAAS,CAAC;QACnB,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,IAAI,KAAK,EAAE,CAAC;IACjD,CAAC;CAsBF;AA3GD,4BA2GC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Tree\r\n */\r\n\r\nimport \"./Node.scss\";\r\nimport classnames from \"classnames\";\r\nimport * as React from \"react\";\r\nimport { Checkbox, CheckboxProps, ProgressRadial } from \"@itwin/itwinui-react\";\r\nimport { CheckBoxState } from \"../enums/CheckBoxState\";\r\nimport { CommonProps } from \"../utils/Props\";\r\nimport { Omit } from \"../utils/typeUtils\";\r\nimport { ExpansionToggle } from \"./ExpansionToggle\";\r\n\r\n/** Props for node Checkbox renderer\r\n * @public\r\n */\r\nexport type NodeCheckboxRenderProps = Omit<CheckboxProps, \"onChange\" | \"onClick\"> & {\r\n onChange: (checked: boolean) => void;\r\n onClick: (e: React.MouseEvent) => void;\r\n};\r\n\r\n/** Type for node Checkbox renderer\r\n * @public\r\n */\r\nexport type NodeCheckboxRenderer = (props: NodeCheckboxRenderProps) => React.ReactNode;\r\n\r\n/** Number of pixels the node gets offset per each hierarchy level\r\n * @internal\r\n */\r\nexport const LEVEL_OFFSET = 20;\r\n\r\nconst EXPANSION_TOGGLE_WIDTH = 24;\r\n\r\n/** Properties for Tree Node CheckBox\r\n * @public\r\n */\r\nexport interface NodeCheckboxProps {\r\n /** State of the checkbox */\r\n state?: CheckBoxState;\r\n /** Click event callback */\r\n onClick?: (newState: CheckBoxState) => void;\r\n /** Indicates whether checkbox is disabled */\r\n isDisabled?: boolean;\r\n /** Tooltip to be displayed when mouse is hovered over checkbox */\r\n tooltip?: string;\r\n}\r\n\r\n/** Properties for the [[TreeNode]] React component\r\n * @public\r\n */\r\nexport interface TreeNodeProps extends CommonProps {\r\n label: React.ReactNode;\r\n level: number;\r\n icon?: React.ReactChild;\r\n /** Properties for the checkbox.\r\n * @public */\r\n checkboxProps?: NodeCheckboxProps;\r\n isLeaf?: boolean;\r\n isLoading?: boolean;\r\n isExpanded?: boolean;\r\n isFocused?: boolean;\r\n isSelected?: boolean;\r\n isHoverDisabled?: boolean;\r\n onClick?: (e: React.MouseEvent) => void;\r\n onContextMenu?: (e: React.MouseEvent) => void;\r\n onMouseMove?: (e: React.MouseEvent) => void;\r\n onMouseDown?: (e: React.MouseEvent) => void;\r\n onMouseUp?: (e: React.MouseEvent) => void;\r\n onClickExpansionToggle?: () => void;\r\n children?: React.ReactNode;\r\n\r\n /** Contains render overrides for different pieces of the node component. */\r\n renderOverrides?: {\r\n /** Callback to render a checkbox. Only called when checkbox is displayed. */\r\n renderCheckbox?: NodeCheckboxRenderer;\r\n };\r\n [\"data-testid\"]?: string;\r\n}\r\n\r\n/** Presentation React component for a Tree node\r\n * @public\r\n */\r\nexport class TreeNode extends React.Component<TreeNodeProps> {\r\n constructor(props: TreeNodeProps) {\r\n super(props);\r\n }\r\n\r\n public override render() {\r\n const className = classnames(\r\n \"core-tree-node\",\r\n this.props.isFocused && \"is-focused\",\r\n this.props.isSelected && \"is-selected\",\r\n this.props.isHoverDisabled && \"is-hover-disabled\",\r\n this.props.className);\r\n let offset = this.props.level * LEVEL_OFFSET;\r\n if (!this.props.isLoading && this.props.isLeaf)\r\n offset += EXPANSION_TOGGLE_WIDTH; // Add expansion toggle/loader width if they're not rendered\r\n\r\n const loader = this.props.isLoading ? (<div className=\"loader\"><ProgressRadial size=\"x-small\" indeterminate /></div>) : undefined;\r\n\r\n let checkbox: React.ReactNode;\r\n if (this.props.checkboxProps) {\r\n const props: NodeCheckboxRenderProps = {\r\n label: \"\",\r\n checked: this.props.checkboxProps.state === CheckBoxState.On,\r\n indeterminate: this.props.checkboxProps.state === CheckBoxState.Partial,\r\n disabled: this.props.checkboxProps.isDisabled,\r\n title: this.props.checkboxProps.tooltip,\r\n onClick: this._onCheckboxClick,\r\n onChange: this._onCheckboxChange,\r\n };\r\n if (this.props.renderOverrides && this.props.renderOverrides.renderCheckbox) {\r\n checkbox = this.props.renderOverrides.renderCheckbox(props);\r\n } else {\r\n checkbox = (\r\n <Checkbox {...props}\r\n onChange={(e: React.ChangeEvent<HTMLInputElement>) => this._onCheckboxChange(e.target.checked)} data-testid={this.createSubComponentTestId(\"checkbox\")}\r\n />\r\n );\r\n }\r\n }\r\n\r\n const icon = this.props.icon ? (<div className=\"core-tree-node-icon\">{this.props.icon}</div>) : undefined;\r\n\r\n const toggle = (this.props.isLoading || this.props.isLeaf) ? undefined : (\r\n <ExpansionToggle\r\n className=\"expansion-toggle\"\r\n data-testid={this.createSubComponentTestId(\"expansion-toggle\")}\r\n onClick={this._onClickExpansionToggle}\r\n isExpanded={this.props.isExpanded}\r\n />\r\n );\r\n\r\n return (\r\n // eslint-disable-next-line jsx-a11y/click-events-have-key-events\r\n <div\r\n className={className}\r\n style={this.props.style}\r\n data-testid={this.props[\"data-testid\"]}\r\n onClick={this._onClick}\r\n onContextMenu={this.props.onContextMenu}\r\n onMouseDown={this.props.onMouseDown}\r\n onMouseUp={this.props.onMouseUp}\r\n onMouseMove={this.props.onMouseMove}\r\n role=\"treeitem\"\r\n tabIndex={-1}\r\n >\r\n <div\r\n className=\"contents\"\r\n style={{ marginLeft: offset }}\r\n data-testid={this.createSubComponentTestId(\"contents\")}\r\n >\r\n {loader}\r\n {toggle}\r\n {checkbox}\r\n {icon}\r\n {this.props.label}\r\n </div>\r\n {this.props.children}\r\n </div>\r\n );\r\n }\r\n\r\n private createSubComponentTestId(subId: string): string | undefined {\r\n if (!this.props[\"data-testid\"])\r\n return undefined;\r\n return `${this.props[\"data-testid\"]}-${subId}`;\r\n }\r\n\r\n private _onCheckboxChange = (checked: boolean) => {\r\n if (this.props.checkboxProps && this.props.checkboxProps.onClick && !this.props.checkboxProps.isDisabled)\r\n this.props.checkboxProps.onClick(checked ? CheckBoxState.On : CheckBoxState.Off);\r\n };\r\n\r\n private _onCheckboxClick = (e: React.MouseEvent) => {\r\n e.stopPropagation();\r\n };\r\n\r\n private _onClickExpansionToggle = (e: React.MouseEvent<HTMLDivElement>) => {\r\n e.stopPropagation();\r\n if (this.props.onClickExpansionToggle)\r\n this.props.onClickExpansionToggle();\r\n };\r\n\r\n private _onClick = (e: React.MouseEvent<HTMLDivElement>) => {\r\n e.stopPropagation();\r\n if (this.props.onClick)\r\n this.props.onClick(e);\r\n };\r\n}\r\n"]}
1
+ {"version":3,"file":"Node.js","sourceRoot":"","sources":["../../../../src/core-react/tree/Node.tsx"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,uBAAqB;AACrB,2CAAoC;AACpC,+BAA+B;AAC/B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AAS,EAAC,aAAa,SAAG;gBACvE,MAAM;gBACN,QAAQ;gBACR,IAAI;gBACJ,IAAI,CAAC,KAAK,CAAC,KAAK,CACb;YACL,IAAI,CAAC,KAAK,CAAC,QAAQ,CAChB,CACP,CAAC;IACJ,CAAC;IAEO,wBAAwB,CAAC,KAAa;QAC5C,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC;YAC5B,OAAO,SAAS,CAAC;QACnB,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,IAAI,KAAK,EAAE,CAAC;IACjD,CAAC;CAsBF;AAzGD,4BAyGC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Tree\r\n */\r\n\r\nimport \"./Node.scss\";\r\nimport classnames from \"classnames\";\r\nimport * as React from \"react\";\r\nimport { Checkbox, CheckboxProps, ProgressRadial } from \"@itwin/itwinui-react\";\r\nimport { CheckBoxState } from \"../enums/CheckBoxState\";\r\nimport { CommonProps } from \"../utils/Props\";\r\nimport { Omit } from \"../utils/typeUtils\";\r\nimport { ExpansionToggle } from \"./ExpansionToggle\";\r\n\r\n/** Props for node Checkbox renderer\r\n * @public\r\n */\r\nexport type NodeCheckboxRenderProps = Omit<CheckboxProps, \"onChange\" | \"onClick\"> & {\r\n onChange: (checked: boolean) => void;\r\n onClick: (e: React.MouseEvent) => void;\r\n};\r\n\r\n/** Type for node Checkbox renderer\r\n * @public\r\n */\r\nexport type NodeCheckboxRenderer = (props: NodeCheckboxRenderProps) => React.ReactNode;\r\n\r\n/** Number of pixels the node gets offset per each hierarchy level\r\n * @internal\r\n */\r\nexport const LEVEL_OFFSET = 20;\r\n\r\nconst EXPANSION_TOGGLE_WIDTH = 24;\r\n\r\n/** Properties for Tree Node CheckBox\r\n * @public\r\n */\r\nexport interface NodeCheckboxProps {\r\n /** State of the checkbox */\r\n state?: CheckBoxState;\r\n /** Click event callback */\r\n onClick?: (newState: CheckBoxState) => void;\r\n /** Indicates whether checkbox is disabled */\r\n isDisabled?: boolean;\r\n /** Tooltip to be displayed when mouse is hovered over checkbox */\r\n tooltip?: string;\r\n}\r\n\r\n/** Properties for the [[TreeNode]] React component\r\n * @public\r\n */\r\nexport interface TreeNodeProps extends CommonProps {\r\n label: React.ReactNode;\r\n level: number;\r\n icon?: React.ReactChild;\r\n /** Properties for the checkbox.\r\n * @public */\r\n checkboxProps?: NodeCheckboxProps;\r\n isLeaf?: boolean;\r\n isLoading?: boolean;\r\n isExpanded?: boolean;\r\n isFocused?: boolean;\r\n isSelected?: boolean;\r\n isHoverDisabled?: boolean;\r\n onClick?: (e: React.MouseEvent) => void;\r\n onContextMenu?: (e: React.MouseEvent) => void;\r\n onMouseMove?: (e: React.MouseEvent) => void;\r\n onMouseDown?: (e: React.MouseEvent) => void;\r\n onMouseUp?: (e: React.MouseEvent) => void;\r\n onClickExpansionToggle?: () => void;\r\n children?: React.ReactNode;\r\n\r\n /** Contains render overrides for different pieces of the node component. */\r\n renderOverrides?: {\r\n /** Callback to render a checkbox. Only called when checkbox is displayed. */\r\n renderCheckbox?: NodeCheckboxRenderer;\r\n };\r\n [\"data-testid\"]?: string;\r\n}\r\n\r\n/** Presentation React component for a Tree node\r\n * @public\r\n */\r\nexport class TreeNode extends React.Component<TreeNodeProps> {\r\n constructor(props: TreeNodeProps) {\r\n super(props);\r\n }\r\n\r\n public override render() {\r\n const className = classnames(\r\n \"core-tree-node\",\r\n this.props.isFocused && \"is-focused\",\r\n this.props.isSelected && \"is-selected\",\r\n this.props.isHoverDisabled && \"is-hover-disabled\",\r\n this.props.className);\r\n let offset = this.props.level * LEVEL_OFFSET;\r\n if (!this.props.isLoading && this.props.isLeaf)\r\n offset += EXPANSION_TOGGLE_WIDTH; // Add expansion toggle/loader width if they're not rendered\r\n\r\n let checkbox: React.ReactNode;\r\n if (this.props.checkboxProps) {\r\n const props: NodeCheckboxRenderProps = {\r\n label: \"\",\r\n checked: this.props.checkboxProps.state === CheckBoxState.On,\r\n indeterminate: this.props.checkboxProps.state === CheckBoxState.Partial,\r\n disabled: this.props.checkboxProps.isDisabled,\r\n title: this.props.checkboxProps.tooltip,\r\n onClick: this._onCheckboxClick,\r\n onChange: this._onCheckboxChange,\r\n };\r\n if (this.props.renderOverrides && this.props.renderOverrides.renderCheckbox) {\r\n checkbox = this.props.renderOverrides.renderCheckbox(props);\r\n } else {\r\n checkbox = (\r\n <Checkbox {...props}\r\n onChange={(e: React.ChangeEvent<HTMLInputElement>) => this._onCheckboxChange(e.target.checked)} data-testid={this.createSubComponentTestId(\"checkbox\")}\r\n />\r\n );\r\n }\r\n }\r\n\r\n const icon = this.props.icon ? (<div className=\"core-tree-node-icon\">{this.props.icon}</div>) : undefined;\r\n\r\n const toggle = (this.props.isLoading || this.props.isLeaf) ? undefined : (\r\n <ExpansionToggle\r\n className=\"expansion-toggle\"\r\n data-testid={this.createSubComponentTestId(\"expansion-toggle\")}\r\n onClick={this._onClickExpansionToggle}\r\n isExpanded={this.props.isExpanded}\r\n />\r\n );\r\n\r\n return (\r\n // eslint-disable-next-line jsx-a11y/click-events-have-key-events\r\n <div\r\n className={className}\r\n style={this.props.style}\r\n data-testid={this.props[\"data-testid\"]}\r\n onClick={this._onClick}\r\n onContextMenu={this.props.onContextMenu}\r\n onMouseDown={this.props.onMouseDown}\r\n onMouseUp={this.props.onMouseUp}\r\n onMouseMove={this.props.onMouseMove}\r\n role=\"treeitem\"\r\n tabIndex={-1}\r\n >\r\n <div\r\n className=\"contents\"\r\n style={{ marginLeft: offset }}\r\n data-testid={this.createSubComponentTestId(\"contents\")}\r\n >\r\n {this.props.isLoading && <ProgressRadial size=\"x-small\" indeterminate />}\r\n {toggle}\r\n {checkbox}\r\n {icon}\r\n {this.props.label}\r\n </div>\r\n {this.props.children}\r\n </div>\r\n );\r\n }\r\n\r\n private createSubComponentTestId(subId: string): string | undefined {\r\n if (!this.props[\"data-testid\"])\r\n return undefined;\r\n return `${this.props[\"data-testid\"]}-${subId}`;\r\n }\r\n\r\n private _onCheckboxChange = (checked: boolean) => {\r\n if (this.props.checkboxProps && this.props.checkboxProps.onClick && !this.props.checkboxProps.isDisabled)\r\n this.props.checkboxProps.onClick(checked ? CheckBoxState.On : CheckBoxState.Off);\r\n };\r\n\r\n private _onCheckboxClick = (e: React.MouseEvent) => {\r\n e.stopPropagation();\r\n };\r\n\r\n private _onClickExpansionToggle = (e: React.MouseEvent<HTMLDivElement>) => {\r\n e.stopPropagation();\r\n if (this.props.onClickExpansionToggle)\r\n this.props.onClickExpansionToggle();\r\n };\r\n\r\n private _onClick = (e: React.MouseEvent<HTMLDivElement>) => {\r\n e.stopPropagation();\r\n if (this.props.onClick)\r\n this.props.onClick(e);\r\n };\r\n}\r\n"]}
@@ -26,8 +26,8 @@ $node-font-size: $iui-font-size;
26
26
  align-items: center;
27
27
  width: 100%;
28
28
 
29
- > .loader {
30
- margin: auto 4px;
29
+ > .iui-progress-indicator-radial {
30
+ margin: 0 4px;
31
31
  }
32
32
 
33
33
  > .expansion-toggle {
@@ -50,15 +50,22 @@ $node-font-size: $iui-font-size;
50
50
  line-height: unset;
51
51
  }
52
52
  }
53
+
54
+ > .core-image-checkbox {
55
+ top: -1px;
56
+ }
53
57
  }
54
58
 
55
59
  &-icon {
56
60
  width: 16px;
57
- height: 24px;
58
- display: inline-block;
59
- box-sizing: border-box;
60
- padding: 5px 0;
61
- margin-right: 5px;
61
+ margin: 0 5px;
62
+
63
+ > .bui-webfont-icon {
64
+ display: inline-block;
65
+ width: 16px;
66
+ text-align: center;
67
+ vertical-align: middle;
68
+ }
62
69
  }
63
70
 
64
71
  &.is-focused, &:focus {
@@ -0,0 +1,17 @@
1
+ /** @packageDocumentation
2
+ * @module UiStateStorage
3
+ */
4
+ import { UiStateStorage, UiStateStorageResult } from "./UiStateStorage";
5
+ /**
6
+ * Implementation of [[UiStateStorage]] using Window.localStorage.
7
+ * @public
8
+ */
9
+ export declare class LocalStateStorage implements UiStateStorage {
10
+ w: Window;
11
+ constructor(w?: Window);
12
+ getSetting(settingNamespace: string, settingName: string): Promise<UiStateStorageResult>;
13
+ saveSetting(settingNamespace: string, settingName: string, setting: any): Promise<UiStateStorageResult>;
14
+ hasSetting(settingNamespace: string, settingName: string): Promise<boolean>;
15
+ deleteSetting(settingNamespace: string, settingName: string): Promise<UiStateStorageResult>;
16
+ }
17
+ //# sourceMappingURL=LocalStateStorage.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LocalStateStorage.d.ts","sourceRoot":"","sources":["../../../../src/core-react/uistate/LocalStateStorage.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,cAAc,EAAE,oBAAoB,EAAwB,MAAM,kBAAkB,CAAC;AAK9F;;;GAGG;AACH,qBAAa,iBAAkB,YAAW,cAAc;IAEnC,CAAC,EAAE,MAAM;gBAAT,CAAC,GAAE,MAAe;IAExB,UAAU,CAAC,gBAAgB,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,oBAAoB,CAAC;IAQxF,WAAW,CAAC,gBAAgB,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG,GAAG,OAAO,CAAC,oBAAoB,CAAC;IAKvG,UAAU,CAAC,gBAAgB,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAQ3E,aAAa,CAAC,gBAAgB,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,oBAAoB,CAAC;CAQzG"}
@@ -4,29 +4,31 @@
4
4
  * See LICENSE.md in the project root for license terms and full copyright notice.
5
5
  *--------------------------------------------------------------------------------------------*/
6
6
  /** @packageDocumentation
7
- * @module UiSettings
7
+ * @module UiStateStorage
8
8
  */
9
9
  Object.defineProperty(exports, "__esModule", { value: true });
10
- exports.LocalUiSettings = exports.LocalSettingsStorage = void 0;
11
- const UiSettingsStorage_1 = require("./UiSettingsStorage");
10
+ exports.LocalStateStorage = void 0;
11
+ const UiStateStorage_1 = require("./UiStateStorage");
12
+ // All of the Settings APIs that are available in core-react should be fully deprecated. However, some of the usage and implementation
13
+ // of it from AppUI will continue to be supported there.
12
14
  /**
13
- * Implementation of [[UiSettingsStorage]] using Window.localStorage.
15
+ * Implementation of [[UiStateStorage]] using Window.localStorage.
14
16
  * @public
15
17
  */
16
- class LocalSettingsStorage {
18
+ class LocalStateStorage {
17
19
  constructor(w = window) {
18
20
  this.w = w;
19
21
  }
20
22
  async getSetting(settingNamespace, settingName) {
21
23
  const setting = this.w.localStorage.getItem(`${settingNamespace}.${settingName}`);
22
24
  if (setting !== null)
23
- return { status: UiSettingsStorage_1.UiSettingsStatus.Success, setting: JSON.parse(setting) };
25
+ return { status: UiStateStorage_1.UiStateStorageStatus.Success, setting: JSON.parse(setting) };
24
26
  else
25
- return { status: UiSettingsStorage_1.UiSettingsStatus.NotFound };
27
+ return { status: UiStateStorage_1.UiStateStorageStatus.NotFound };
26
28
  }
27
29
  async saveSetting(settingNamespace, settingName, setting) {
28
30
  this.w.localStorage.setItem(`${settingNamespace}.${settingName}`, JSON.stringify(setting));
29
- return { status: UiSettingsStorage_1.UiSettingsStatus.Success };
31
+ return { status: UiStateStorage_1.UiStateStorageStatus.Success };
30
32
  }
31
33
  async hasSetting(settingNamespace, settingName) {
32
34
  const name = `${settingNamespace}.${settingName}`;
@@ -39,18 +41,10 @@ class LocalSettingsStorage {
39
41
  const name = `${settingNamespace}.${settingName}`;
40
42
  const setting = this.w.localStorage.getItem(name);
41
43
  if (setting === null)
42
- return { status: UiSettingsStorage_1.UiSettingsStatus.NotFound };
44
+ return { status: UiStateStorage_1.UiStateStorageStatus.NotFound };
43
45
  this.w.localStorage.removeItem(name);
44
- return { status: UiSettingsStorage_1.UiSettingsStatus.Success };
46
+ return { status: UiStateStorage_1.UiStateStorageStatus.Success };
45
47
  }
46
48
  }
47
- exports.LocalSettingsStorage = LocalSettingsStorage;
48
- /** Alias for [[LocalSettingsStorage]]
49
- * @beta
50
- * @deprecated use [LocalSettingsStorage]($core-react) instead
51
- */
52
- class LocalUiSettings extends LocalSettingsStorage {
53
- constructor(w = window) { super(w); }
54
- }
55
- exports.LocalUiSettings = LocalUiSettings;
56
- //# sourceMappingURL=LocalSettingsStorage.js.map
49
+ exports.LocalStateStorage = LocalStateStorage;
50
+ //# sourceMappingURL=LocalStateStorage.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LocalStateStorage.js","sourceRoot":"","sources":["../../../../src/core-react/uistate/LocalStateStorage.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,qDAA8F;AAE9F,sIAAsI;AACtI,wDAAwD;AAExD;;;GAGG;AACH,MAAa,iBAAiB;IAE5B,YAAmB,IAAY,MAAM;QAAlB,MAAC,GAAD,CAAC,CAAiB;IAAI,CAAC;IAEnC,KAAK,CAAC,UAAU,CAAC,gBAAwB,EAAE,WAAmB;QACnE,MAAM,OAAO,GAAG,IAAI,CAAC,CAAC,CAAC,YAAY,CAAC,OAAO,CAAC,GAAG,gBAAgB,IAAI,WAAW,EAAE,CAAC,CAAC;QAClF,IAAI,OAAO,KAAK,IAAI;YAClB,OAAO,EAAE,MAAM,EAAE,qCAAoB,CAAC,OAAO,EAAE,OAAO,EAAE,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,EAAE,CAAC;;YAE9E,OAAO,EAAE,MAAM,EAAE,qCAAoB,CAAC,QAAQ,EAAE,CAAC;IACrD,CAAC;IAEM,KAAK,CAAC,WAAW,CAAC,gBAAwB,EAAE,WAAmB,EAAE,OAAY;QAClF,IAAI,CAAC,CAAC,CAAC,YAAY,CAAC,OAAO,CAAC,GAAG,gBAAgB,IAAI,WAAW,EAAE,EAAE,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,CAAC;QAC3F,OAAO,EAAE,MAAM,EAAE,qCAAoB,CAAC,OAAO,EAAE,CAAC;IAClD,CAAC;IAEM,KAAK,CAAC,UAAU,CAAC,gBAAwB,EAAE,WAAmB;QACnE,MAAM,IAAI,GAAG,GAAG,gBAAgB,IAAI,WAAW,EAAE,CAAC;QAClD,MAAM,OAAO,GAAG,IAAI,CAAC,CAAC,CAAC,YAAY,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QAClD,IAAI,OAAO,KAAK,IAAI;YAClB,OAAO,KAAK,CAAC;QACf,OAAO,IAAI,CAAC;IACd,CAAC;IAEM,KAAK,CAAC,aAAa,CAAC,gBAAwB,EAAE,WAAmB;QACtE,MAAM,IAAI,GAAG,GAAG,gBAAgB,IAAI,WAAW,EAAE,CAAC;QAClD,MAAM,OAAO,GAAG,IAAI,CAAC,CAAC,CAAC,YAAY,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QAClD,IAAI,OAAO,KAAK,IAAI;YAClB,OAAO,EAAE,MAAM,EAAE,qCAAoB,CAAC,QAAQ,EAAE,CAAC;QACnD,IAAI,CAAC,CAAC,CAAC,YAAY,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;QACrC,OAAO,EAAE,MAAM,EAAE,qCAAoB,CAAC,OAAO,EAAE,CAAC;IAClD,CAAC;CACF;AAjCD,8CAiCC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module UiStateStorage\r\n */\r\n\r\nimport { UiStateStorage, UiStateStorageResult, UiStateStorageStatus } from \"./UiStateStorage\";\r\n\r\n// All of the Settings APIs that are available in core-react should be fully deprecated. However, some of the usage and implementation\r\n// of it from AppUI will continue to be supported there.\r\n\r\n/**\r\n * Implementation of [[UiStateStorage]] using Window.localStorage.\r\n * @public\r\n */\r\nexport class LocalStateStorage implements UiStateStorage {\r\n\r\n constructor(public w: Window = window) { }\r\n\r\n public async getSetting(settingNamespace: string, settingName: string): Promise<UiStateStorageResult> {\r\n const setting = this.w.localStorage.getItem(`${settingNamespace}.${settingName}`);\r\n if (setting !== null)\r\n return { status: UiStateStorageStatus.Success, setting: JSON.parse(setting) };\r\n else\r\n return { status: UiStateStorageStatus.NotFound };\r\n }\r\n\r\n public async saveSetting(settingNamespace: string, settingName: string, setting: any): Promise<UiStateStorageResult> {\r\n this.w.localStorage.setItem(`${settingNamespace}.${settingName}`, JSON.stringify(setting));\r\n return { status: UiStateStorageStatus.Success };\r\n }\r\n\r\n public async hasSetting(settingNamespace: string, settingName: string): Promise<boolean> {\r\n const name = `${settingNamespace}.${settingName}`;\r\n const setting = this.w.localStorage.getItem(name);\r\n if (setting === null)\r\n return false;\r\n return true;\r\n }\r\n\r\n public async deleteSetting(settingNamespace: string, settingName: string): Promise<UiStateStorageResult> {\r\n const name = `${settingNamespace}.${settingName}`;\r\n const setting = this.w.localStorage.getItem(name);\r\n if (setting === null)\r\n return { status: UiStateStorageStatus.NotFound };\r\n this.w.localStorage.removeItem(name);\r\n return { status: UiStateStorageStatus.Success };\r\n }\r\n}\r\n"]}
@@ -1,31 +1,31 @@
1
1
  /** @packageDocumentation
2
- * @module UiSettings
2
+ * @module UiStateStorage
3
3
  */
4
- import { UiSettingsResult, UiSettingsStorage } from "./UiSettingsStorage";
5
- /** A Ui Setting with namespace and setting name.
4
+ import { UiStateStorage, UiStateStorageResult } from "./UiStateStorage";
5
+ /** A single UI State enter that is identified by namespace and setting name.
6
6
  * @public
7
7
  */
8
- export declare class UiSetting<T> {
8
+ export declare class UiStateEntry<T> {
9
9
  settingNamespace: string;
10
10
  settingName: string;
11
11
  getValue: () => T;
12
12
  applyValue?: ((v: T) => void) | undefined;
13
13
  defaultValue?: T | undefined;
14
14
  /** Constructor
15
- * @param settingNamespace Namespace for the setting, passed to UiSettings.
16
- * @param settingName Name for the setting, passed to UiSettings.
15
+ * @param settingNamespace Namespace for the setting, passed to UiStateStorage.
16
+ * @param settingName Name for the setting, passed to UiStateStorage.
17
17
  * @param getValue Function for getting the value from the application.
18
18
  * @param applyValue Function for applying the setting value to the application.
19
19
  * @param defaultValue Optional default value if not already stored.
20
20
  */
21
21
  constructor(settingNamespace: string, settingName: string, getValue: () => T, applyValue?: ((v: T) => void) | undefined, defaultValue?: T | undefined);
22
- /** Gets the setting from [[UiSettingsStorage]] */
23
- getSetting(storage: UiSettingsStorage): Promise<UiSettingsResult>;
24
- /** Saves the setting value from the `getValue` function to UiSettings */
25
- saveSetting(storage: UiSettingsStorage): Promise<UiSettingsResult>;
26
- /** Deletes the setting from UiSettings */
27
- deleteSetting(storage: UiSettingsStorage): Promise<UiSettingsResult>;
28
- /** Gets the setting from UiSettings and applies the value using the `applyValue` function */
29
- getSettingAndApplyValue(storage: UiSettingsStorage): Promise<UiSettingsResult>;
22
+ /** Gets the setting from [[UiStateStorage]] */
23
+ getSetting(storage: UiStateStorage): Promise<UiStateStorageResult>;
24
+ /** Saves the setting value from the `getValue` function to UiStateStorage */
25
+ saveSetting(storage: UiStateStorage): Promise<UiStateStorageResult>;
26
+ /** Deletes the setting from UiStateStorage */
27
+ deleteSetting(storage: UiStateStorage): Promise<UiStateStorageResult>;
28
+ /** Gets the setting from UiStateStorage and applies the value using the `applyValue` function */
29
+ getSettingAndApplyValue(storage: UiStateStorage): Promise<UiStateStorageResult>;
30
30
  }
31
- //# sourceMappingURL=UiSetting.d.ts.map
31
+ //# sourceMappingURL=UiStateEntry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"UiStateEntry.d.ts","sourceRoot":"","sources":["../../../../src/core-react/uistate/UiStateEntry.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,cAAc,EAAE,oBAAoB,EAAwB,MAAM,kBAAkB,CAAC;AAE9F;;GAEG;AACH,qBAAa,YAAY,CAAC,CAAC;IAQC,gBAAgB,EAAE,MAAM;IAAS,WAAW,EAAE,MAAM;IAAS,QAAQ,EAAE,MAAM,CAAC;IAAS,UAAU,CAAC,OAAM,CAAC,KAAK,IAAI;IAAS,YAAY,CAAC;IAPlK;;;;;;OAMG;gBACuB,gBAAgB,EAAE,MAAM,EAAS,WAAW,EAAE,MAAM,EAAS,QAAQ,EAAE,MAAM,CAAC,EAAS,UAAU,CAAC,OAAM,CAAC,KAAK,IAAI,aAAA,EAAS,YAAY,CAAC,eAAG;IAGrK,+CAA+C;IAClC,UAAU,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,oBAAoB,CAAC;IAI/E,6EAA6E;IAChE,WAAW,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,oBAAoB,CAAC;IAIhF,8CAA8C;IACjC,aAAa,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,oBAAoB,CAAC;IAIlF,iGAAiG;IACpF,uBAAuB,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,oBAAoB,CAAC;CAc7F"}
@@ -4,18 +4,18 @@
4
4
  * See LICENSE.md in the project root for license terms and full copyright notice.
5
5
  *--------------------------------------------------------------------------------------------*/
6
6
  /** @packageDocumentation
7
- * @module UiSettings
7
+ * @module UiStateStorage
8
8
  */
9
9
  Object.defineProperty(exports, "__esModule", { value: true });
10
- exports.UiSetting = void 0;
11
- const UiSettingsStorage_1 = require("./UiSettingsStorage");
12
- /** A Ui Setting with namespace and setting name.
10
+ exports.UiStateEntry = void 0;
11
+ const UiStateStorage_1 = require("./UiStateStorage");
12
+ /** A single UI State enter that is identified by namespace and setting name.
13
13
  * @public
14
14
  */
15
- class UiSetting {
15
+ class UiStateEntry {
16
16
  /** Constructor
17
- * @param settingNamespace Namespace for the setting, passed to UiSettings.
18
- * @param settingName Name for the setting, passed to UiSettings.
17
+ * @param settingNamespace Namespace for the setting, passed to UiStateStorage.
18
+ * @param settingName Name for the setting, passed to UiStateStorage.
19
19
  * @param getValue Function for getting the value from the application.
20
20
  * @param applyValue Function for applying the setting value to the application.
21
21
  * @param defaultValue Optional default value if not already stored.
@@ -27,34 +27,34 @@ class UiSetting {
27
27
  this.applyValue = applyValue;
28
28
  this.defaultValue = defaultValue;
29
29
  }
30
- /** Gets the setting from [[UiSettingsStorage]] */
30
+ /** Gets the setting from [[UiStateStorage]] */
31
31
  async getSetting(storage) {
32
32
  return storage.getSetting(this.settingNamespace, this.settingName);
33
33
  }
34
- /** Saves the setting value from the `getValue` function to UiSettings */
34
+ /** Saves the setting value from the `getValue` function to UiStateStorage */
35
35
  async saveSetting(storage) {
36
36
  return storage.saveSetting(this.settingNamespace, this.settingName, this.getValue());
37
37
  }
38
- /** Deletes the setting from UiSettings */
38
+ /** Deletes the setting from UiStateStorage */
39
39
  async deleteSetting(storage) {
40
40
  return storage.deleteSetting(this.settingNamespace, this.settingName);
41
41
  }
42
- /** Gets the setting from UiSettings and applies the value using the `applyValue` function */
42
+ /** Gets the setting from UiStateStorage and applies the value using the `applyValue` function */
43
43
  async getSettingAndApplyValue(storage) {
44
44
  if (this.applyValue) {
45
45
  const result = await this.getSetting(storage);
46
- if (result.status === UiSettingsStorage_1.UiSettingsStatus.Success) {
46
+ if (result.status === UiStateStorage_1.UiStateStorageStatus.Success) {
47
47
  this.applyValue(result.setting);
48
48
  }
49
49
  else if (undefined !== this.defaultValue) {
50
50
  this.applyValue(this.defaultValue);
51
51
  result.setting = this.defaultValue;
52
- result.status = UiSettingsStorage_1.UiSettingsStatus.Success;
52
+ result.status = UiStateStorage_1.UiStateStorageStatus.Success;
53
53
  }
54
54
  return result;
55
55
  }
56
- return { status: UiSettingsStorage_1.UiSettingsStatus.Uninitialized };
56
+ return { status: UiStateStorage_1.UiStateStorageStatus.Uninitialized };
57
57
  }
58
58
  }
59
- exports.UiSetting = UiSetting;
60
- //# sourceMappingURL=UiSetting.js.map
59
+ exports.UiStateEntry = UiStateEntry;
60
+ //# sourceMappingURL=UiStateEntry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"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,SAAS,KAAK,IAAI,CAAC,YAAY,EAAE;gBAC1C,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;gBACnC,MAAM,CAAC,OAAO,GAAG,IAAI,CAAC,YAAY,CAAC;gBACnC,MAAM,CAAC,MAAM,GAAG,qCAAoB,CAAC,OAAO,CAAC;aAC9C;YACD,OAAO,MAAM,CAAC;SACf;QACD,OAAO,EAAE,MAAM,EAAE,qCAAoB,CAAC,aAAa,EAAE,CAAC;IACxD,CAAC;CACF;AAzCD,oCAyCC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module UiStateStorage\r\n */\r\n\r\nimport { UiStateStorage, UiStateStorageResult, UiStateStorageStatus } from \"./UiStateStorage\";\r\n\r\n/** A single UI State enter that is identified by namespace and setting name.\r\n * @public\r\n */\r\nexport class UiStateEntry<T> {\r\n /** Constructor\r\n * @param settingNamespace Namespace for the setting, passed to UiStateStorage.\r\n * @param settingName Name for the setting, passed to UiStateStorage.\r\n * @param getValue Function for getting the value from the application.\r\n * @param applyValue Function for applying the setting value to the application.\r\n * @param defaultValue Optional default value if not already stored.\r\n */\r\n public constructor(public settingNamespace: string, public settingName: string, public getValue: () => T, public applyValue?: (v: T) => void, public defaultValue?: T) {\r\n }\r\n\r\n /** Gets the setting from [[UiStateStorage]] */\r\n public async getSetting(storage: UiStateStorage): Promise<UiStateStorageResult> {\r\n return storage.getSetting(this.settingNamespace, this.settingName);\r\n }\r\n\r\n /** Saves the setting value from the `getValue` function to UiStateStorage */\r\n public async saveSetting(storage: UiStateStorage): Promise<UiStateStorageResult> {\r\n return storage.saveSetting(this.settingNamespace, this.settingName, this.getValue());\r\n }\r\n\r\n /** Deletes the setting from UiStateStorage */\r\n public async deleteSetting(storage: UiStateStorage): Promise<UiStateStorageResult> {\r\n return storage.deleteSetting(this.settingNamespace, this.settingName);\r\n }\r\n\r\n /** Gets the setting from UiStateStorage and applies the value using the `applyValue` function */\r\n public async getSettingAndApplyValue(storage: UiStateStorage): Promise<UiStateStorageResult> {\r\n if (this.applyValue) {\r\n const result = await this.getSetting(storage);\r\n if (result.status === UiStateStorageStatus.Success) {\r\n this.applyValue(result.setting);\r\n } else if (undefined !== this.defaultValue) {\r\n this.applyValue(this.defaultValue);\r\n result.setting = this.defaultValue;\r\n result.status = UiStateStorageStatus.Success;\r\n }\r\n return result;\r\n }\r\n return { status: UiStateStorageStatus.Uninitialized };\r\n }\r\n}\r\n"]}
@@ -0,0 +1,29 @@
1
+ /** @packageDocumentation
2
+ * @module UiStateStorage
3
+ */
4
+ /** Interface for getting, saving and deleting settings.
5
+ * @public
6
+ */
7
+ export interface UiStateStorage {
8
+ getSetting(settingNamespace: string, settingName: string): Promise<UiStateStorageResult>;
9
+ saveSetting(settingNamespace: string, settingName: string, setting: any): Promise<UiStateStorageResult>;
10
+ deleteSetting(settingNamespace: string, settingName: string): Promise<UiStateStorageResult>;
11
+ }
12
+ /** Enum for [[UiStateStorage]] status.
13
+ * @public
14
+ */
15
+ export declare enum UiStateStorageStatus {
16
+ Success = 0,
17
+ NotFound = 1,
18
+ UnknownError = 2,
19
+ Uninitialized = 3,
20
+ AuthorizationError = 4
21
+ }
22
+ /** Interface for result of accessing UI state setting in [[UiStateStorage]].
23
+ * @public
24
+ */
25
+ export interface UiStateStorageResult {
26
+ status: UiStateStorageStatus;
27
+ setting?: any;
28
+ }
29
+ //# sourceMappingURL=UiStateStorage.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"UiStateStorage.d.ts","sourceRoot":"","sources":["../../../../src/core-react/uistate/UiStateStorage.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,UAAU,CAAC,gBAAgB,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAAC;IACzF,WAAW,CAAC,gBAAgB,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAAC;IACxG,aAAa,CAAC,gBAAgB,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAAC;CAC7F;AAED;;GAEG;AACH,oBAAY,oBAAoB;IAC9B,OAAO,IAAI;IACX,QAAQ,IAAI;IACZ,YAAY,IAAI;IAChB,aAAa,IAAI;IACjB,kBAAkB,IAAI;CACvB;AAED;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,MAAM,EAAE,oBAAoB,CAAC;IAC7B,OAAO,CAAC,EAAE,GAAG,CAAC;CACf"}
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ /*---------------------------------------------------------------------------------------------
3
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
4
+ * See LICENSE.md in the project root for license terms and full copyright notice.
5
+ *--------------------------------------------------------------------------------------------*/
6
+ /** @packageDocumentation
7
+ * @module UiStateStorage
8
+ */
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ exports.UiStateStorageStatus = void 0;
11
+ /** Enum for [[UiStateStorage]] status.
12
+ * @public
13
+ */
14
+ var UiStateStorageStatus;
15
+ (function (UiStateStorageStatus) {
16
+ UiStateStorageStatus[UiStateStorageStatus["Success"] = 0] = "Success";
17
+ UiStateStorageStatus[UiStateStorageStatus["NotFound"] = 1] = "NotFound";
18
+ UiStateStorageStatus[UiStateStorageStatus["UnknownError"] = 2] = "UnknownError";
19
+ UiStateStorageStatus[UiStateStorageStatus["Uninitialized"] = 3] = "Uninitialized";
20
+ UiStateStorageStatus[UiStateStorageStatus["AuthorizationError"] = 4] = "AuthorizationError";
21
+ })(UiStateStorageStatus = exports.UiStateStorageStatus || (exports.UiStateStorageStatus = {}));
22
+ //# sourceMappingURL=UiStateStorage.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"UiStateStorage.js","sourceRoot":"","sources":["../../../../src/core-react/uistate/UiStateStorage.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAWH;;GAEG;AACH,IAAY,oBAMX;AAND,WAAY,oBAAoB;IAC9B,qEAAW,CAAA;IACX,uEAAY,CAAA;IACZ,+EAAgB,CAAA;IAChB,iFAAiB,CAAA;IACjB,2FAAsB,CAAA;AACxB,CAAC,EANW,oBAAoB,GAApB,4BAAoB,KAApB,4BAAoB,QAM/B","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module UiStateStorage\r\n */\r\n\r\n/** Interface for getting, saving and deleting settings.\r\n * @public\r\n */\r\nexport interface UiStateStorage {\r\n getSetting(settingNamespace: string, settingName: string): Promise<UiStateStorageResult>;\r\n saveSetting(settingNamespace: string, settingName: string, setting: any): Promise<UiStateStorageResult>;\r\n deleteSetting(settingNamespace: string, settingName: string): Promise<UiStateStorageResult>;\r\n}\r\n\r\n/** Enum for [[UiStateStorage]] status.\r\n * @public\r\n */\r\nexport enum UiStateStorageStatus {\r\n Success = 0,\r\n NotFound = 1,\r\n UnknownError = 2,\r\n Uninitialized = 3,\r\n AuthorizationError = 4,\r\n}\r\n\r\n/** Interface for result of accessing UI state setting in [[UiStateStorage]].\r\n * @public\r\n */\r\nexport interface UiStateStorageResult {\r\n status: UiStateStorageStatus;\r\n setting?: any;\r\n}\r\n"]}
@@ -2,8 +2,8 @@
2
2
  * @module Utilities
3
3
  */
4
4
  import { BeUiEvent } from "@itwin/core-bentley";
5
- /** iModel.js UI UiEvent class is a subclass of BeEvent with argument type safety.
6
- * @public
5
+ /** iTwin.js UI UiEvent class is a subclass of BeEvent with argument type safety.
6
+ * @public @deprecated Use UiEvent in appui-abstract instead
7
7
  */
8
8
  export declare class UiEvent<TEventArgs> extends BeUiEvent<TEventArgs> {
9
9
  }
@@ -9,8 +9,8 @@
9
9
  Object.defineProperty(exports, "__esModule", { value: true });
10
10
  exports.UiEvent = void 0;
11
11
  const core_bentley_1 = require("@itwin/core-bentley");
12
- /** iModel.js UI UiEvent class is a subclass of BeEvent with argument type safety.
13
- * @public
12
+ /** iTwin.js UI UiEvent class is a subclass of BeEvent with argument type safety.
13
+ * @public @deprecated Use UiEvent in appui-abstract instead
14
14
  */
15
15
  class UiEvent extends core_bentley_1.BeUiEvent {
16
16
  }
@@ -1 +1 @@
1
- {"version":3,"file":"UiEvent.js","sourceRoot":"","sources":["../../../../src/core-react/utils/UiEvent.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAAgD;AAEhD;;GAEG;AACH,MAAa,OAAoB,SAAQ,wBAAqB;CAAI;AAAlE,0BAAkE","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Utilities\r\n */\r\n\r\nimport { BeUiEvent } from \"@itwin/core-bentley\";\r\n\r\n/** iModel.js UI UiEvent class is a subclass of BeEvent with argument type safety.\r\n * @public\r\n */\r\nexport class UiEvent<TEventArgs> extends BeUiEvent<TEventArgs> { }\r\n"]}
1
+ {"version":3,"file":"UiEvent.js","sourceRoot":"","sources":["../../../../src/core-react/utils/UiEvent.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAAgD;AAEhD;;GAEG;AACH,MAAa,OAAoB,SAAQ,wBAAqB;CAAI;AAAlE,0BAAkE","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Utilities\r\n */\r\n\r\nimport { BeUiEvent } from \"@itwin/core-bentley\";\r\n\r\n/** iTwin.js UI UiEvent class is a subclass of BeEvent with argument type safety.\r\n * @public @deprecated Use UiEvent in appui-abstract instead\r\n */\r\nexport class UiEvent<TEventArgs> extends BeUiEvent<TEventArgs> { }\r\n"]}