@itwin/frontend-devtools 4.10.0-dev.31 → 4.10.0-dev.33

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 (53) hide show
  1. package/lib/cjs/ClipboardUtilities.js +2 -3
  2. package/lib/cjs/ClipboardUtilities.js.map +1 -1
  3. package/lib/cjs/effects/EffectTools.js +2 -2
  4. package/lib/cjs/effects/EffectTools.js.map +1 -1
  5. package/lib/cjs/effects/Random.js +5 -6
  6. package/lib/cjs/effects/Random.js.map +1 -1
  7. package/lib/cjs/tools/ProjectExtents.js +2 -2
  8. package/lib/cjs/tools/ProjectExtents.js.map +1 -1
  9. package/lib/cjs/tools/SavedViews.js +3 -3
  10. package/lib/cjs/tools/SavedViews.js.map +1 -1
  11. package/lib/cjs/tools/ScheduleScriptTools.js +1 -1
  12. package/lib/cjs/tools/ScheduleScriptTools.js.map +1 -1
  13. package/lib/cjs/tools/parseArgs.js +1 -2
  14. package/lib/cjs/tools/parseArgs.js.map +1 -1
  15. package/lib/cjs/tools/parseBoolean.js +1 -2
  16. package/lib/cjs/tools/parseBoolean.js.map +1 -1
  17. package/lib/cjs/tools/parseToggle.js +1 -2
  18. package/lib/cjs/tools/parseToggle.js.map +1 -1
  19. package/lib/cjs/ui/Button.js +1 -2
  20. package/lib/cjs/ui/Button.js.map +1 -1
  21. package/lib/cjs/ui/CheckBox.js +1 -2
  22. package/lib/cjs/ui/CheckBox.js.map +1 -1
  23. package/lib/cjs/ui/ColorInput.js +3 -4
  24. package/lib/cjs/ui/ColorInput.js.map +1 -1
  25. package/lib/cjs/ui/ComboBox.js +1 -2
  26. package/lib/cjs/ui/ComboBox.js.map +1 -1
  27. package/lib/cjs/ui/DataList.js +2 -3
  28. package/lib/cjs/ui/DataList.js.map +1 -1
  29. package/lib/cjs/ui/NestedMenu.js +1 -2
  30. package/lib/cjs/ui/NestedMenu.js.map +1 -1
  31. package/lib/cjs/ui/NumericInput.js +3 -4
  32. package/lib/cjs/ui/NumericInput.js.map +1 -1
  33. package/lib/cjs/ui/RadioBox.js +3 -4
  34. package/lib/cjs/ui/RadioBox.js.map +1 -1
  35. package/lib/cjs/ui/Slider.js +2 -3
  36. package/lib/cjs/ui/Slider.js.map +1 -1
  37. package/lib/cjs/ui/TextBox.js +2 -3
  38. package/lib/cjs/ui/TextBox.js.map +1 -1
  39. package/lib/cjs/widgets/MemoryTracker.js +2 -2
  40. package/lib/cjs/widgets/MemoryTracker.js.map +1 -1
  41. package/lib/esm/ClipboardUtilities.js +1 -1
  42. package/lib/esm/ClipboardUtilities.js.map +1 -1
  43. package/lib/esm/tools/ScheduleScriptTools.js +1 -1
  44. package/lib/esm/tools/ScheduleScriptTools.js.map +1 -1
  45. package/lib/esm/ui/ColorInput.js +1 -1
  46. package/lib/esm/ui/ColorInput.js.map +1 -1
  47. package/lib/esm/ui/NumericInput.js +1 -1
  48. package/lib/esm/ui/NumericInput.js.map +1 -1
  49. package/lib/esm/ui/RadioBox.js +2 -2
  50. package/lib/esm/ui/RadioBox.js.map +1 -1
  51. package/lib/esm/ui/TextBox.js +1 -1
  52. package/lib/esm/ui/TextBox.js.map +1 -1
  53. package/package.json +10 -10
@@ -1 +1 @@
1
- {"version":3,"file":"NumericInput.js","sourceRoot":"","sources":["../../../src/ui/NumericInput.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAwB/F,aAAa;AACb,MAAM,UAAU,kBAAkB,CAAC,KAAwB,EAAE,WAAoB,KAAK;IACpF,MAAM,KAAK,GAAG,QAAQ,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;IAC9C,KAAK,CAAC,IAAI,GAAG,QAAQ,CAAC;IACtB,KAAK,CAAC,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC;IAErC,KAAK,CAAC,QAAQ,GAAG,GAAG,EAAE;QACpB,IAAI,CAAC;YACH,MAAM,KAAK,GAAG,QAAQ,CAAC,CAAC,CAAC,UAAU,CAAC,KAA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+B;IACvE,MAAM,GAAG,GAAG,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;IAC1C,IAAI,KAAK,CAAC,UAAU;QAClB,GAAG,CAAC,KAAK,CAAC,OAAO,GAAG,KAAK,CAAC,UAAU,CAAC;IAEvC,MAAM,KAAK,GAAG,QAAQ,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;IAC9C,KAAK,CAAC,OAAO,GAAG,KAAK,CAAC,EAAE,CAAC;IACzB,KAAK,CAAC,SAAS,GAAG,KAAK,CAAC,IAAI,CAAC;IAC7B,GAAG,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;IAEvB,MAAM,UAAU,GAAG,EAAE,GAAG,KAAK,EAAE,CAAC;IAChC,UAAU,CAAC,MAAM,GAAG,GAAG,CAAC;IACxB,UAAU,CAAC,OAAO,GAAG,QAAQ,CAAC;IAC9B,MAAM,KAAK,GAAG,kBAAkB,CAAC,UAAU,EAAE,IAAI,KAAK,KAAK,CAAC,YAAY,CAAC,CAAC;IAE1E,IAAI,SAAS,KAAK,KAAK,CAAC,MAAM;QAC5B,KAAK,CAAC,MAAM,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;IAEhC,IAAI,SAAS,KAAK,KAAK,CAAC,OAAO;QAC7B,GAAG,CAAC,KAAK,GAAG,KAAK,CAAC,OAAO,CAAC;IAE5B,OAAO,EAAE,KAAK,EAAE,GAAG,EAAE,KAAK,EAAE,CAAC;AAC/B,CAAC","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\r\n/** @packageDocumentation\r\n * @module Controls\r\n */\r\n\r\n/** @alpha */\r\nexport type NumericInputHandler = (value: number, input: HTMLInputElement) => void;\r\n\r\n/** @alpha */\r\nexport interface NumericInputProps {\r\n handler: NumericInputHandler;\r\n id?: string;\r\n parent?: HTMLElement;\r\n value: number;\r\n display?: \"inline\" | \"none\" | \"block\";\r\n disabled?: boolean;\r\n min?: number;\r\n max?: number;\r\n step?: number;\r\n tooltip?: string;\r\n parseAsFloat?: true;\r\n}\r\n\r\n/** @alpha */\r\nexport function createNumericInput(props: NumericInputProps, useFloat: boolean = false): HTMLInputElement {\r\n const input = document.createElement(\"input\");\r\n input.type = \"number\";\r\n input.value = props.value.toString();\r\n\r\n input.onchange = () => {\r\n try {\r\n const value = useFloat ? parseFloat(input.value) : parseInt(input.value, 10);\r\n if (!Number.isNaN(value))\r\n props.handler(value, input);\r\n } catch (_ex) {\r\n //\r\n }\r\n };\r\n\r\n if (undefined !== props.id)\r\n input.id = props.id;\r\n if (undefined !== props.display)\r\n input.style.display = props.display;\r\n if (undefined !== props.min)\r\n input.min = props.min.toString();\r\n if (undefined !== props.max)\r\n input.max = props.max.toString();\r\n if (undefined !== props.step)\r\n input.step = props.step.toString();\r\n if (undefined !== props.tooltip)\r\n input.title = props.tooltip;\r\n if (undefined !== props.disabled)\r\n input.disabled = props.disabled;\r\n if (undefined !== props.parent)\r\n props.parent.appendChild(input);\r\n\r\n return input;\r\n}\r\n\r\n/** @alpha */\r\nexport interface LabeledNumericInputProps extends NumericInputProps {\r\n name: string;\r\n id: string;\r\n divDisplay?: \"block\" | \"none\" | \"inline\";\r\n}\r\n\r\n/** @alpha */\r\nexport interface LabeledNumericInput {\r\n input: HTMLInputElement;\r\n div: HTMLDivElement;\r\n label: HTMLLabelElement;\r\n}\r\n\r\n/** @alpha */\r\nexport function createLabeledNumericInput(props: LabeledNumericInputProps): LabeledNumericInput {\r\n const div = document.createElement(\"div\");\r\n if (props.divDisplay)\r\n div.style.display = props.divDisplay;\r\n\r\n const label = document.createElement(\"label\");\r\n label.htmlFor = props.id;\r\n label.innerText = props.name;\r\n div.appendChild(label);\r\n\r\n const inputProps = { ...props };\r\n inputProps.parent = div;\r\n inputProps.display = \"inline\";\r\n const input = createNumericInput(inputProps, true === props.parseAsFloat);\r\n\r\n if (undefined !== props.parent)\r\n props.parent.appendChild(div);\r\n\r\n if (undefined !== props.tooltip)\r\n div.title = props.tooltip;\r\n\r\n return { label, div, input };\r\n}\r\n"]}
1
+ {"version":3,"file":"NumericInput.js","sourceRoot":"","sources":["../../../src/ui/NumericInput.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAwB/F,aAAa;AACb,MAAM,UAAU,kBAAkB,CAAC,KAAwB,EAAE,WAAoB,KAAK;IACpF,MAAM,KAAK,GAAG,QAAQ,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;IAC9C,KAAK,CAAC,IAAI,GAAG,QAAQ,CAAC;IACtB,KAAK,CAAC,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC;IAErC,KAAK,CAAC,QAAQ,GAAG,GAAG,EAAE;QACpB,IAAI,CAAC;YACH,MAAM,KAAK,GAAG,QAAQ,CAAC,CAAC,CAAC,UAAU,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;YAC7E,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC;gBACtB,KAAK,CAAC,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;QAChC,CAAC;QAAC,MAAM,CAAC;YACP,EAAE;QACJ,CAAC;IACH,CAAC,CAAC;IAEF,IAAI,SAAS,KAAK,KAAK,CAAC,EAAE;QACxB,KAAK,CAAC,EAAE,GAAG,KAAK,CAAC,EAAE,CAAC;IACtB,IAAI,SAAS,KAAK,KAAK,CAAC,OAAO;QAC7B,KAAK,CAAC,KAAK,CAAC,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC;IACtC,IAAI,SAAS,KAAK,KAAK,CAAC,GAAG;QACzB,KAAK,CAAC,GAAG,GAAG,KAAK,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC;IACnC,IAAI,SAAS,KAAK,KAAK,CAAC,GA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AK,KAAK,CAAC,MAAM;QAC5B,KAAK,CAAC,MAAM,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;IAEhC,IAAI,SAAS,KAAK,KAAK,CAAC,OAAO;QAC7B,GAAG,CAAC,KAAK,GAAG,KAAK,CAAC,OAAO,CAAC;IAE5B,OAAO,EAAE,KAAK,EAAE,GAAG,EAAE,KAAK,EAAE,CAAC;AAC/B,CAAC","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\r\n/** @packageDocumentation\r\n * @module Controls\r\n */\r\n\r\n/** @alpha */\r\nexport type NumericInputHandler = (value: number, input: HTMLInputElement) => void;\r\n\r\n/** @alpha */\r\nexport interface NumericInputProps {\r\n handler: NumericInputHandler;\r\n id?: string;\r\n parent?: HTMLElement;\r\n value: number;\r\n display?: \"inline\" | \"none\" | \"block\";\r\n disabled?: boolean;\r\n min?: number;\r\n max?: number;\r\n step?: number;\r\n tooltip?: string;\r\n parseAsFloat?: true;\r\n}\r\n\r\n/** @alpha */\r\nexport function createNumericInput(props: NumericInputProps, useFloat: boolean = false): HTMLInputElement {\r\n const input = document.createElement(\"input\");\r\n input.type = \"number\";\r\n input.value = props.value.toString();\r\n\r\n input.onchange = () => {\r\n try {\r\n const value = useFloat ? parseFloat(input.value) : parseInt(input.value, 10);\r\n if (!Number.isNaN(value))\r\n props.handler(value, input);\r\n } catch {\r\n //\r\n }\r\n };\r\n\r\n if (undefined !== props.id)\r\n input.id = props.id;\r\n if (undefined !== props.display)\r\n input.style.display = props.display;\r\n if (undefined !== props.min)\r\n input.min = props.min.toString();\r\n if (undefined !== props.max)\r\n input.max = props.max.toString();\r\n if (undefined !== props.step)\r\n input.step = props.step.toString();\r\n if (undefined !== props.tooltip)\r\n input.title = props.tooltip;\r\n if (undefined !== props.disabled)\r\n input.disabled = props.disabled;\r\n if (undefined !== props.parent)\r\n props.parent.appendChild(input);\r\n\r\n return input;\r\n}\r\n\r\n/** @alpha */\r\nexport interface LabeledNumericInputProps extends NumericInputProps {\r\n name: string;\r\n id: string;\r\n divDisplay?: \"block\" | \"none\" | \"inline\";\r\n}\r\n\r\n/** @alpha */\r\nexport interface LabeledNumericInput {\r\n input: HTMLInputElement;\r\n div: HTMLDivElement;\r\n label: HTMLLabelElement;\r\n}\r\n\r\n/** @alpha */\r\nexport function createLabeledNumericInput(props: LabeledNumericInputProps): LabeledNumericInput {\r\n const div = document.createElement(\"div\");\r\n if (props.divDisplay)\r\n div.style.display = props.divDisplay;\r\n\r\n const label = document.createElement(\"label\");\r\n label.htmlFor = props.id;\r\n label.innerText = props.name;\r\n div.appendChild(label);\r\n\r\n const inputProps = { ...props };\r\n inputProps.parent = div;\r\n inputProps.display = \"inline\";\r\n const input = createNumericInput(inputProps, true === props.parseAsFloat);\r\n\r\n if (undefined !== props.parent)\r\n props.parent.appendChild(div);\r\n\r\n if (undefined !== props.tooltip)\r\n div.title = props.tooltip;\r\n\r\n return { label, div, input };\r\n}\r\n"]}
@@ -28,7 +28,7 @@ export function createRadioBox(props) {
28
28
  const value = input.value;
29
29
  props.handler(value, form);
30
30
  }
31
- catch (_ex) {
31
+ catch {
32
32
  //
33
33
  }
34
34
  };
@@ -37,7 +37,7 @@ export function createRadioBox(props) {
37
37
  const value = input.value;
38
38
  props.handler(value, form);
39
39
  }
40
- catch (_ex) {
40
+ catch {
41
41
  //
42
42
  }
43
43
  };
@@ -1 +1 @@
1
- {"version":3,"file":"RadioBox.js","sourceRoot":"","sources":["../../../src/ui/RadioBox.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAkC/F,aAAa;AACb,MAAM,UAAU,cAAc,CAAC,KAAoB;IACjD,MAAM,GAAG,GAAG,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;IAE1C,IAAI,KAAmC,CAAC;IACxC,IAAI,SAAS,KAAK,KAAK,CAAC,IA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,CAAC,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC;QACzF,IAAI,UAAU,EAAE,CAAC;YACf,UAAU,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,OAAO,GAAG,KAAK,CAAC,KAAK,KAAK,WAAW,CAAC,CAAC;YAC3E,KAAK,CAAC,OAAO,CAAC,WAAW,EAAE,IAAI,CAAC,CAAC;QACnC,CAAC;QACD,OAAO,UAAU,CAAC;IACpB,CAAC,CAAC;IAEF,OAAO,EAAE,GAAG,EAAE,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;AACxC,CAAC","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\r\n/** @packageDocumentation\r\n * @module Controls\r\n */\r\n\r\n/** @alpha */\r\nexport interface RadioBoxEntry {\r\n value: number | string | undefined;\r\n label: string;\r\n}\r\n\r\n/** @alpha */\r\nexport type RadioBoxHandler = (value: string, form: HTMLFormElement) => void;\r\n\r\n/** @alpha */\r\nexport interface RadioBoxProps {\r\n id: string;\r\n entries: RadioBoxEntry[];\r\n handler: RadioBoxHandler;\r\n name?: string;\r\n parent?: HTMLElement;\r\n defaultValue?: number | string;\r\n vertical?: boolean;\r\n}\r\n\r\n/** @alpha */\r\nexport interface RadioBox {\r\n label?: HTMLLabelElement;\r\n setValue: (newValue: number | string) => boolean;\r\n div: HTMLDivElement;\r\n form: HTMLFormElement;\r\n}\r\n\r\n/** @alpha */\r\nexport function createRadioBox(props: RadioBoxProps): RadioBox {\r\n const div = document.createElement(\"div\");\r\n\r\n let label: HTMLLabelElement | undefined;\r\n if (undefined !== props.name) {\r\n label = document.createElement(\"label\");\r\n label.htmlFor = props.id;\r\n label.innerText = props.name;\r\n div.appendChild(label);\r\n }\r\n\r\n const form = document.createElement(\"form\");\r\n form.id = props.id;\r\n\r\n const radioBoxes: HTMLInputElement[] = [];\r\n\r\n for (const entry of props.entries) {\r\n const input = document.createElement(\"input\");\r\n input.type = \"radio\";\r\n input.name = props.name ? props.name : props.id;\r\n\r\n input.value = (undefined !== entry.value) ? entry.value.toString() : \"\";\r\n\r\n const inputLabel: HTMLLabelElement = document.createElement(\"label\");\r\n inputLabel.innerText = entry.label;\r\n\r\n inputLabel.onclick = () => {\r\n try {\r\n input.checked = true;\r\n const value = input.value;\r\n props.handler(value, form);\r\n } catch (_ex) {\r\n //\r\n }\r\n };\r\n\r\n input.onchange = () => {\r\n try {\r\n const value = input.value;\r\n props.handler(value, form);\r\n } catch (_ex) {\r\n //\r\n }\r\n };\r\n if (props.defaultValue === entry.value) {\r\n input.checked = true;\r\n }\r\n\r\n radioBoxes.push(input);\r\n\r\n if (props.vertical) {\r\n const container = document.createElement(\"div\");\r\n container.appendChild(input);\r\n container.appendChild(inputLabel);\r\n form.appendChild(container);\r\n } else {\r\n form.appendChild(input);\r\n form.appendChild(inputLabel);\r\n }\r\n }\r\n\r\n div.appendChild(form);\r\n if (undefined !== props.parent)\r\n props.parent.appendChild(div);\r\n\r\n const setValue = (value: number | string): boolean => {\r\n const stringValue = value.toString();\r\n const validValue: boolean = radioBoxes.map((input) => input.value).includes(stringValue);\r\n if (validValue) {\r\n radioBoxes.forEach((input) => input.checked = input.value === stringValue);\r\n props.handler(stringValue, form);\r\n }\r\n return validValue;\r\n };\r\n\r\n return { div, label, setValue, form };\r\n}\r\n"]}
1
+ {"version":3,"file":"RadioBox.js","sourceRoot":"","sources":["../../../src/ui/RadioBox.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAkC/F,aAAa;AACb,MAAM,UAAU,cAAc,CAAC,KAAoB;IACjD,MAAM,GAAG,GAAG,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;IAE1C,IAAI,KAAmC,CAAC;IACxC,IAAI,SAAS,KAAK,KAAK,CAAC,IAAI,EAAE,CAAC;QA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C;QACzF,IAAI,UAAU,EAAE,CAAC;YACf,UAAU,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,OAAO,GAAG,KAAK,CAAC,KAAK,KAAK,WAAW,CAAC,CAAC;YAC3E,KAAK,CAAC,OAAO,CAAC,WAAW,EAAE,IAAI,CAAC,CAAC;QACnC,CAAC;QACD,OAAO,UAAU,CAAC;IACpB,CAAC,CAAC;IAEF,OAAO,EAAE,GAAG,EAAE,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;AACxC,CAAC","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\r\n/** @packageDocumentation\r\n * @module Controls\r\n */\r\n\r\n/** @alpha */\r\nexport interface RadioBoxEntry {\r\n value: number | string | undefined;\r\n label: string;\r\n}\r\n\r\n/** @alpha */\r\nexport type RadioBoxHandler = (value: string, form: HTMLFormElement) => void;\r\n\r\n/** @alpha */\r\nexport interface RadioBoxProps {\r\n id: string;\r\n entries: RadioBoxEntry[];\r\n handler: RadioBoxHandler;\r\n name?: string;\r\n parent?: HTMLElement;\r\n defaultValue?: number | string;\r\n vertical?: boolean;\r\n}\r\n\r\n/** @alpha */\r\nexport interface RadioBox {\r\n label?: HTMLLabelElement;\r\n setValue: (newValue: number | string) => boolean;\r\n div: HTMLDivElement;\r\n form: HTMLFormElement;\r\n}\r\n\r\n/** @alpha */\r\nexport function createRadioBox(props: RadioBoxProps): RadioBox {\r\n const div = document.createElement(\"div\");\r\n\r\n let label: HTMLLabelElement | undefined;\r\n if (undefined !== props.name) {\r\n label = document.createElement(\"label\");\r\n label.htmlFor = props.id;\r\n label.innerText = props.name;\r\n div.appendChild(label);\r\n }\r\n\r\n const form = document.createElement(\"form\");\r\n form.id = props.id;\r\n\r\n const radioBoxes: HTMLInputElement[] = [];\r\n\r\n for (const entry of props.entries) {\r\n const input = document.createElement(\"input\");\r\n input.type = \"radio\";\r\n input.name = props.name ? props.name : props.id;\r\n\r\n input.value = (undefined !== entry.value) ? entry.value.toString() : \"\";\r\n\r\n const inputLabel: HTMLLabelElement = document.createElement(\"label\");\r\n inputLabel.innerText = entry.label;\r\n\r\n inputLabel.onclick = () => {\r\n try {\r\n input.checked = true;\r\n const value = input.value;\r\n props.handler(value, form);\r\n } catch {\r\n //\r\n }\r\n };\r\n\r\n input.onchange = () => {\r\n try {\r\n const value = input.value;\r\n props.handler(value, form);\r\n } catch {\r\n //\r\n }\r\n };\r\n if (props.defaultValue === entry.value) {\r\n input.checked = true;\r\n }\r\n\r\n radioBoxes.push(input);\r\n\r\n if (props.vertical) {\r\n const container = document.createElement(\"div\");\r\n container.appendChild(input);\r\n container.appendChild(inputLabel);\r\n form.appendChild(container);\r\n } else {\r\n form.appendChild(input);\r\n form.appendChild(inputLabel);\r\n }\r\n }\r\n\r\n div.appendChild(form);\r\n if (undefined !== props.parent)\r\n props.parent.appendChild(div);\r\n\r\n const setValue = (value: number | string): boolean => {\r\n const stringValue = value.toString();\r\n const validValue: boolean = radioBoxes.map((input) => input.value).includes(stringValue);\r\n if (validValue) {\r\n radioBoxes.forEach((input) => input.checked = input.value === stringValue);\r\n props.handler(stringValue, form);\r\n }\r\n return validValue;\r\n };\r\n\r\n return { div, label, setValue, form };\r\n}\r\n"]}
@@ -37,7 +37,7 @@ export function createTextBox(props) {
37
37
  };
38
38
  }
39
39
  else {
40
- textbox.onkeypress = stopPropagation; // eslint-disable-line deprecation/deprecation
40
+ textbox.onkeypress = stopPropagation; // eslint-disable-line @typescript-eslint/no-deprecated
41
41
  }
42
42
  const focushandler = props.focushandler;
43
43
  if (undefined !== focushandler) {
@@ -1 +1 @@
1
- {"version":3,"file":"TextBox.js","sourceRoot":"","sources":["../../../src/ui/TextBox.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAqC/F,aAAa;AACb,MAAM,UA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O,GAAG,eAAe,CAAC;IACtD,MAAM,eAAe,GAAG,KAAK,CAAC,eAAe,CAAC;IAC9C,IAAI,SAAS,KAAK,eAAe,EAAE,CAAC;QAClC,OAAO,CAAC,UAAU,GAAG,CAAC,EAAiB,EAAE,EAAE;YACzC,eAAe,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;YAC7B,EAAE,CAAC,eAAe,EAAE,CAAC;QACvB,CAAC,CAAC;IACJ,CAAC;SAAM,CAAC;QACN,OAAO,CAAC,UAAU,GAAG,eAAe,CAAC,CAAC,8CAA8C;IACtF,CAAC;IAED,MAAM,YAAY,GAAG,KAAK,CAAC,YAAY,CAAC;IACxC,IAAI,SAAS,KAAK,YAAY,EAAE,CAAC;QAC/B,OAAO,CAAC,OAAO,GAAG,GAAG,EAAE,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC;IAChD,CAAC;IAED,IAAI,SAAS,KAAK,KAAK,CAAC,IAAI,EAAE,CAAC;QAC7B,OAAO,CAAC,YAAY,CAAC,MAAM,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC;IAC3C,CAAC;IAED,IAAI,SAAS,KAAK,KAAK,CAAC,OAAO;QAC7B,GAAG,CAAC,KAAK,GAAG,KAAK,CAAC,OAAO,CAAC;IAE5B,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC;AACjC,CAAC","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\r\n/** @packageDocumentation\r\n * @module Controls\r\n */\r\n\r\n/** Wraps an HTML text input field.\r\n * @beta\r\n */\r\nexport interface TextBox {\r\n /** The label, if the text box has one. */\r\n label?: HTMLLabelElement;\r\n /** The text input element. */\r\n textbox: HTMLInputElement;\r\n /** The div containing the text box. */\r\n div: HTMLDivElement;\r\n}\r\n\r\n/** @alpha */\r\nexport type TextBoxHandler = (textbox: HTMLInputElement) => void;\r\n\r\n/** @alpha */\r\nexport type TextBoxKeyPressHandler = (textbox: HTMLInputElement, ev: KeyboardEvent) => void;\r\n\r\n/** @alpha */\r\nexport interface TextBoxProps {\r\n label?: string;\r\n id?: string;\r\n parent?: HTMLElement;\r\n handler?: TextBoxHandler;\r\n keypresshandler?: TextBoxKeyPressHandler;\r\n focushandler?: TextBoxHandler;\r\n tooltip?: string;\r\n inline?: boolean;\r\n list?: string; // if defined, contains the id of a datalist to bind to this textbox for autocompletion\r\n}\r\n\r\n/** @alpha */\r\nexport function createTextBox(props: TextBoxProps): TextBox {\r\n const div = document.createElement(\"div\");\r\n if (true === props.inline)\r\n div.style.display = \"inline\";\r\n\r\n let label;\r\n if (undefined !== props.label) {\r\n label = document.createElement(\"label\");\r\n label.innerText = props.label;\r\n if (undefined !== props.id)\r\n label.htmlFor = props.id;\r\n\r\n div.appendChild(label);\r\n }\r\n\r\n const textbox = document.createElement(\"input\");\r\n textbox.type = \"text\";\r\n if (undefined !== props.id)\r\n textbox.id = props.id;\r\n\r\n div.appendChild(textbox);\r\n\r\n if (undefined !== props.parent)\r\n props.parent.appendChild(div);\r\n\r\n const handler = props.handler;\r\n if (undefined !== handler) {\r\n textbox.onchange = () => handler(textbox);\r\n }\r\n\r\n // Don't want the document's listeners intepreting keypresses as keyboard shortcuts...\r\n const stopPropagation = (ev: KeyboardEvent) => ev.stopPropagation();\r\n textbox.onkeydown = textbox.onkeyup = stopPropagation;\r\n const keypresshandler = props.keypresshandler;\r\n if (undefined !== keypresshandler) {\r\n textbox.onkeypress = (ev: KeyboardEvent) => { // eslint-disable-line deprecation/deprecation\r\n keypresshandler(textbox, ev);\r\n ev.stopPropagation();\r\n };\r\n } else {\r\n textbox.onkeypress = stopPropagation; // eslint-disable-line deprecation/deprecation\r\n }\r\n\r\n const focushandler = props.focushandler;\r\n if (undefined !== focushandler) {\r\n textbox.onfocus = () => focushandler(textbox);\r\n }\r\n\r\n if (undefined !== props.list) {\r\n textbox.setAttribute(\"list\", props.list);\r\n }\r\n\r\n if (undefined !== props.tooltip)\r\n div.title = props.tooltip;\r\n\r\n return { label, textbox, div };\r\n}\r\n"]}
1
+ {"version":3,"file":"TextBox.js","sourceRoot":"","sources":["../../../src/ui/TextBox.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAqC/F,aAAa;AACb,MAAM,UAAU,aAAa,CAAC,KAAmB;IAC/C,MAAM,GAAG,GAAG,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;IAC1C,IAAI,IAAI,KAAK,KAAK,CAAC,MAAM;QACvB,GAAG,CAAC,KAAK,CAAC,OAAO,GAAG,QAAQ,CAAC;IAE/B,IAAI,KAAK,CAAC;IACV,IAAI,SAAS,KAAK,KAAK,CAAC,KAAK,EAAE,CAAC;QAC9B,KAAK,GAAG,QAAQ,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;QACxC,KAAK,CAAC,SAAS,GAAG,KAAK,CAAC,KAAK,CAAC;QAC9B,IAAI,SAAS,KAAK,KAAK,CAAC,EAAE;YACxB,KAAK,CAAC,OAAO,GAAG,KAAK,CAAC,EAAE,CAAC;QAE3B,GAAG,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;IACzB,CAAC;IAED,MAAM,OAAO,GAAG,QAAQ,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;IAChD,OAAO,CAAC,IAAI,GAAG,MAAM,CAAC;IACtB,IAAI,SAAS,KAAK,KAAK,CAAC,EAAE;QACxB,OAAO,CAAC,EAAE,GAAG,KAAK,CAAC,EAAE,CAAC;IAExB,GAAG,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;IAEzB,IAAI,SAAS,KAAK,KAAK,CAAC,MAAM;QAC5B,KAAK,CAAC,MAAM,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;IAEhC,MAAM,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC;IAC9B,IAAI,SAAS,KAAK,OAAO,EAAE,CAAC;QAC1B,OAAO,CAAC,QAAQ,GAAG,GAAG,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;IAC5C,CAAC;IAED,sFAAsF;IACtF,MAAM,eAAe,GAAG,CAAC,EAAiB,EAAE,EAAE,CAAC,EAAE,CAAC,eAAe,EAAE,CAAC;IACpE,OAAO,CAAC,SAAS,GAAG,OAAO,CAAC,OAAO,GAAG,eAAe,CAAC;IACtD,MAAM,eAAe,GAAG,KAAK,CAAC,eAAe,CAAC;IAC9C,IAAI,SAAS,KAAK,eAAe,EAAE,CAAC;QAClC,OAAO,CAAC,UAAU,GAAG,CAAC,EAAiB,EAAE,EAAE;YACzC,eAAe,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;YAC7B,EAAE,CAAC,eAAe,EAAE,CAAC;QACvB,CAAC,CAAC;IACJ,CAAC;SAAM,CAAC;QACN,OAAO,CAAC,UAAU,GAAG,eAAe,CAAC,CAAC,uDAAuD;IAC/F,CAAC;IAED,MAAM,YAAY,GAAG,KAAK,CAAC,YAAY,CAAC;IACxC,IAAI,SAAS,KAAK,YAAY,EAAE,CAAC;QAC/B,OAAO,CAAC,OAAO,GAAG,GAAG,EAAE,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC;IAChD,CAAC;IAED,IAAI,SAAS,KAAK,KAAK,CAAC,IAAI,EAAE,CAAC;QAC7B,OAAO,CAAC,YAAY,CAAC,MAAM,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC;IAC3C,CAAC;IAED,IAAI,SAAS,KAAK,KAAK,CAAC,OAAO;QAC7B,GAAG,CAAC,KAAK,GAAG,KAAK,CAAC,OAAO,CAAC;IAE5B,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC;AACjC,CAAC","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\r\n/** @packageDocumentation\r\n * @module Controls\r\n */\r\n\r\n/** Wraps an HTML text input field.\r\n * @beta\r\n */\r\nexport interface TextBox {\r\n /** The label, if the text box has one. */\r\n label?: HTMLLabelElement;\r\n /** The text input element. */\r\n textbox: HTMLInputElement;\r\n /** The div containing the text box. */\r\n div: HTMLDivElement;\r\n}\r\n\r\n/** @alpha */\r\nexport type TextBoxHandler = (textbox: HTMLInputElement) => void;\r\n\r\n/** @alpha */\r\nexport type TextBoxKeyPressHandler = (textbox: HTMLInputElement, ev: KeyboardEvent) => void;\r\n\r\n/** @alpha */\r\nexport interface TextBoxProps {\r\n label?: string;\r\n id?: string;\r\n parent?: HTMLElement;\r\n handler?: TextBoxHandler;\r\n keypresshandler?: TextBoxKeyPressHandler;\r\n focushandler?: TextBoxHandler;\r\n tooltip?: string;\r\n inline?: boolean;\r\n list?: string; // if defined, contains the id of a datalist to bind to this textbox for autocompletion\r\n}\r\n\r\n/** @alpha */\r\nexport function createTextBox(props: TextBoxProps): TextBox {\r\n const div = document.createElement(\"div\");\r\n if (true === props.inline)\r\n div.style.display = \"inline\";\r\n\r\n let label;\r\n if (undefined !== props.label) {\r\n label = document.createElement(\"label\");\r\n label.innerText = props.label;\r\n if (undefined !== props.id)\r\n label.htmlFor = props.id;\r\n\r\n div.appendChild(label);\r\n }\r\n\r\n const textbox = document.createElement(\"input\");\r\n textbox.type = \"text\";\r\n if (undefined !== props.id)\r\n textbox.id = props.id;\r\n\r\n div.appendChild(textbox);\r\n\r\n if (undefined !== props.parent)\r\n props.parent.appendChild(div);\r\n\r\n const handler = props.handler;\r\n if (undefined !== handler) {\r\n textbox.onchange = () => handler(textbox);\r\n }\r\n\r\n // Don't want the document's listeners intepreting keypresses as keyboard shortcuts...\r\n const stopPropagation = (ev: KeyboardEvent) => ev.stopPropagation();\r\n textbox.onkeydown = textbox.onkeyup = stopPropagation;\r\n const keypresshandler = props.keypresshandler;\r\n if (undefined !== keypresshandler) {\r\n textbox.onkeypress = (ev: KeyboardEvent) => { // eslint-disable-line @typescript-eslint/no-deprecated\r\n keypresshandler(textbox, ev);\r\n ev.stopPropagation();\r\n };\r\n } else {\r\n textbox.onkeypress = stopPropagation; // eslint-disable-line @typescript-eslint/no-deprecated\r\n }\r\n\r\n const focushandler = props.focushandler;\r\n if (undefined !== focushandler) {\r\n textbox.onfocus = () => focushandler(textbox);\r\n }\r\n\r\n if (undefined !== props.list) {\r\n textbox.setAttribute(\"list\", props.list);\r\n }\r\n\r\n if (undefined !== props.tooltip)\r\n div.title = props.tooltip;\r\n\r\n return { label, textbox, div };\r\n}\r\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@itwin/frontend-devtools",
3
- "version": "4.10.0-dev.31",
3
+ "version": "4.10.0-dev.33",
4
4
  "description": "Debug menu and supporting UI widgets",
5
5
  "main": "lib/cjs/frontend-devtools.js",
6
6
  "module": "lib/esm/frontend-devtools.js",
@@ -24,19 +24,19 @@
24
24
  },
25
25
  "dependencies": {
26
26
  "file-saver": "^2.0.2",
27
- "@itwin/core-bentley": "4.10.0-dev.31",
28
- "@itwin/core-common": "4.10.0-dev.31",
29
- "@itwin/core-frontend": "4.10.0-dev.31",
30
- "@itwin/core-geometry": "4.10.0-dev.31"
27
+ "@itwin/core-bentley": "4.10.0-dev.33",
28
+ "@itwin/core-common": "4.10.0-dev.33",
29
+ "@itwin/core-frontend": "4.10.0-dev.33",
30
+ "@itwin/core-geometry": "4.10.0-dev.33"
31
31
  },
32
32
  "devDependencies": {
33
- "@itwin/eslint-plugin": "^4.0.2",
33
+ "@itwin/eslint-plugin": "5.0.0-dev.1",
34
34
  "@types/file-saver": "^2.0.1",
35
35
  "cpx2": "^3.0.0",
36
- "eslint": "^8.56.0",
36
+ "eslint": "^9.13.0",
37
37
  "rimraf": "^3.0.2",
38
- "typescript": "~5.3.3",
39
- "@itwin/build-tools": "4.10.0-dev.31"
38
+ "typescript": "~5.6.2",
39
+ "@itwin/build-tools": "4.10.0-dev.33"
40
40
  },
41
41
  "scripts": {
42
42
  "build": "npm run -s copy:public && npm run -s build:cjs && npm run -s build:esm",
@@ -46,7 +46,7 @@
46
46
  "clean": "rimraf lib .rush/temp/package-deps*.json",
47
47
  "docs": "betools docs --includes=../../generated-docs/extract --json=../../generated-docs/core/frontend-devtools/file.json --tsIndexFile=./frontend-devtools.ts --onlyJson",
48
48
  "extract-api": "betools extract-api --entry=frontend-devtools",
49
- "lint": "eslint -f visualstudio \"./src/**/*.ts\" 1>&2",
49
+ "lint": "eslint \"./src/**/*.ts\" 1>&2",
50
50
  "test": "",
51
51
  "cover": ""
52
52
  }