uiconfig-blueprint 0.1.0-dev.1 → 0.1.0-dev.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +27 -1
- package/dist/ConfigObject.d.ts +2 -1
- package/dist/UiConfigRendererBlueprint.d.ts +6 -4
- package/dist/allPaths-DtaFoocb.js +23 -0
- package/dist/{allPaths-EYaH0Usv.js.map → allPaths-DtaFoocb.js.map} +1 -1
- package/dist/{allPathsLoader-UVZ15qNf.js → allPathsLoader-B5mUU0us.js} +5 -5
- package/dist/{allPathsLoader-UVZ15qNf.js.map → allPathsLoader-B5mUU0us.js.map} +1 -1
- package/dist/bpComponents/BPButtonComponent.d.ts +1 -0
- package/dist/bpComponents/BPColorInputComponent.d.ts +1 -0
- package/dist/bpComponents/BPComponent.d.ts +3 -1
- package/dist/bpComponents/BPContainerComponent.d.ts +1 -1
- package/dist/bpComponents/BPFileComponent.d.ts +8 -5
- package/dist/bpComponents/BPFolderComponent.d.ts +9 -1
- package/dist/bpComponents/BPInputComponent.d.ts +2 -1
- package/dist/bpComponents/BPNumberInputComponent.d.ts +3 -1
- package/dist/bpComponents/BPSliderInputComponent.d.ts +1 -0
- package/dist/bpComponents/BPTreeComponent.d.ts +20 -10
- package/dist/bpComponents/BPValueComponent.d.ts +4 -1
- package/dist/bpComponents/BPVectorInputComponent.d.ts +1 -0
- package/dist/bpComponents/GetNumberTransformFunctions.d.ts +4 -0
- package/dist/bpComponents/NumberUnits.d.ts +7 -0
- package/dist/components/DialogContext.d.ts +18 -10
- package/dist/components/DraggableIcon.d.ts +1 -0
- package/dist/components/ExtendedNumericInput.d.ts +13 -3
- package/dist/components/FileComponent.d.ts +3 -1
- package/dist/components/InspectorStackComponent.d.ts +2 -1
- package/dist/components/NumericInput.d.ts +76 -0
- package/dist/components/Tree2.d.ts +52 -0
- package/dist/components/TreeNode2.d.ts +43 -0
- package/dist/components/axesIcons.d.ts +7 -0
- package/dist/components/bpIconWrapper.d.ts +2 -2
- package/dist/components/iconMapping.d.ts +198 -0
- package/dist/components/loadingState.d.ts +4 -0
- package/dist/components/shapesIcons.d.ts +100 -0
- package/dist/components/treeTypes.d.ts +18 -0
- package/dist/index-BPcAfGYu.js +13583 -0
- package/dist/index-BPcAfGYu.js.map +1 -0
- package/dist/index-BsXaCp6n.js +671 -0
- package/dist/index-BsXaCp6n.js.map +1 -0
- package/dist/index-CIFbDQFr.js +671 -0
- package/dist/index-CIFbDQFr.js.map +1 -0
- package/dist/index.js +71 -36
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +3 -3
- package/dist/lib.d.ts +4 -1
- package/dist/{splitPathsBySizeLoader-GhF5umHk.js → splitPathsBySizeLoader-BGjtD8Dg.js} +6 -6
- package/dist/{splitPathsBySizeLoader-GhF5umHk.js.map → splitPathsBySizeLoader-BGjtD8Dg.js.map} +1 -1
- package/dist/utils.d.ts +1 -0
- package/docs/assets/highlight.css +45 -17
- package/docs/assets/navigation.js +1 -1
- package/docs/assets/search.js +1 -1
- package/docs/classes/UI.html +10 -5
- package/docs/classes/UiConfigRendererBlueprint.html +10 -5
- package/docs/index.html +16 -5
- package/lib/css/renderer.css +195 -23
- package/lib/css/renderer.css.map +1 -1
- package/lib/esm/ConfigObject.d.ts +2 -1
- package/lib/esm/ConfigObject.js +15 -9
- package/lib/esm/ConfigObject.js.map +1 -1
- package/lib/esm/UiConfigRendererBlueprint.d.ts +6 -4
- package/lib/esm/UiConfigRendererBlueprint.js +30 -17
- package/lib/esm/UiConfigRendererBlueprint.js.map +1 -1
- package/lib/esm/bpComponents/BPButtonComponent.d.ts +1 -0
- package/lib/esm/bpComponents/BPButtonComponent.js +4 -2
- package/lib/esm/bpComponents/BPButtonComponent.js.map +1 -1
- package/lib/esm/bpComponents/BPColorInputComponent.d.ts +1 -0
- package/lib/esm/bpComponents/BPColorInputComponent.js +5 -3
- package/lib/esm/bpComponents/BPColorInputComponent.js.map +1 -1
- package/lib/esm/bpComponents/BPComponent.d.ts +3 -1
- package/lib/esm/bpComponents/BPComponent.js +15 -2
- package/lib/esm/bpComponents/BPComponent.js.map +1 -1
- package/lib/esm/bpComponents/BPContainerComponent.d.ts +1 -1
- package/lib/esm/bpComponents/BPContainerComponent.js +12 -2
- package/lib/esm/bpComponents/BPContainerComponent.js.map +1 -1
- package/lib/esm/bpComponents/BPDropdownInputComponent.js +10 -5
- package/lib/esm/bpComponents/BPDropdownInputComponent.js.map +1 -1
- package/lib/esm/bpComponents/BPFileComponent.d.ts +8 -5
- package/lib/esm/bpComponents/BPFileComponent.js +18 -24
- package/lib/esm/bpComponents/BPFileComponent.js.map +1 -1
- package/lib/esm/bpComponents/BPFolderComponent.d.ts +9 -1
- package/lib/esm/bpComponents/BPFolderComponent.js +55 -12
- package/lib/esm/bpComponents/BPFolderComponent.js.map +1 -1
- package/lib/esm/bpComponents/BPInputComponent.d.ts +2 -1
- package/lib/esm/bpComponents/BPInputComponent.js +2 -1
- package/lib/esm/bpComponents/BPInputComponent.js.map +1 -1
- package/lib/esm/bpComponents/BPLabelledComponent.js +2 -1
- package/lib/esm/bpComponents/BPLabelledComponent.js.map +1 -1
- package/lib/esm/bpComponents/BPNumberInputComponent.d.ts +3 -1
- package/lib/esm/bpComponents/BPNumberInputComponent.js +6 -1
- package/lib/esm/bpComponents/BPNumberInputComponent.js.map +1 -1
- package/lib/esm/bpComponents/BPPanelComponent.js +1 -1
- package/lib/esm/bpComponents/BPPanelComponent.js.map +1 -1
- package/lib/esm/bpComponents/BPSliderInputComponent.d.ts +1 -0
- package/lib/esm/bpComponents/BPSliderInputComponent.js +18 -6
- package/lib/esm/bpComponents/BPSliderInputComponent.js.map +1 -1
- package/lib/esm/bpComponents/BPTextInputComponent.js +1 -1
- package/lib/esm/bpComponents/BPTextInputComponent.js.map +1 -1
- package/lib/esm/bpComponents/BPToggleInputComponent.js +3 -2
- package/lib/esm/bpComponents/BPToggleInputComponent.js.map +1 -1
- package/lib/esm/bpComponents/BPTreeComponent.d.ts +20 -10
- package/lib/esm/bpComponents/BPTreeComponent.js +120 -26
- package/lib/esm/bpComponents/BPTreeComponent.js.map +1 -1
- package/lib/esm/bpComponents/BPTreeFolderComponent.js +4 -3
- package/lib/esm/bpComponents/BPTreeFolderComponent.js.map +1 -1
- package/lib/esm/bpComponents/BPValueComponent.d.ts +4 -1
- package/lib/esm/bpComponents/BPValueComponent.js +19 -3
- package/lib/esm/bpComponents/BPValueComponent.js.map +1 -1
- package/lib/esm/bpComponents/BPVectorInputComponent.d.ts +1 -0
- package/lib/esm/bpComponents/BPVectorInputComponent.js +14 -8
- package/lib/esm/bpComponents/BPVectorInputComponent.js.map +1 -1
- package/lib/esm/bpComponents/GetNumberTransformFunctions.d.ts +4 -0
- package/lib/esm/bpComponents/GetNumberTransformFunctions.js +14 -0
- package/lib/esm/bpComponents/GetNumberTransformFunctions.js.map +1 -0
- package/lib/esm/bpComponents/NumberUnits.d.ts +7 -0
- package/lib/esm/bpComponents/NumberUnits.js +101 -0
- package/lib/esm/bpComponents/NumberUnits.js.map +1 -0
- package/lib/esm/components/AppToaster.js.map +1 -1
- package/lib/esm/components/ConfigurationPanelComponent.js +6 -1
- package/lib/esm/components/ConfigurationPanelComponent.js.map +1 -1
- package/lib/esm/components/DialogContext.d.ts +18 -10
- package/lib/esm/components/DialogContext.js +52 -33
- package/lib/esm/components/DialogContext.js.map +1 -1
- package/lib/esm/components/DraggableIcon.d.ts +1 -0
- package/lib/esm/components/DraggableIcon.js +7 -4
- package/lib/esm/components/DraggableIcon.js.map +1 -1
- package/lib/esm/components/ExtendedNumericInput.d.ts +13 -3
- package/lib/esm/components/ExtendedNumericInput.js +63 -18
- package/lib/esm/components/ExtendedNumericInput.js.map +1 -1
- package/lib/esm/components/FileComponent.d.ts +3 -1
- package/lib/esm/components/FileComponent.js +19 -19
- package/lib/esm/components/FileComponent.js.map +1 -1
- package/lib/esm/components/InspectorStackComponent.d.ts +2 -1
- package/lib/esm/components/InspectorStackComponent.js +2 -2
- package/lib/esm/components/InspectorStackComponent.js.map +1 -1
- package/lib/esm/components/NumericInput.d.ts +76 -0
- package/lib/esm/components/NumericInput.js +301 -0
- package/lib/esm/components/NumericInput.js.map +1 -0
- package/lib/esm/components/Tree2.d.ts +52 -0
- package/lib/esm/components/Tree2.js +177 -0
- package/lib/esm/components/Tree2.js.map +1 -0
- package/lib/esm/components/TreeNode2.d.ts +43 -0
- package/lib/esm/components/TreeNode2.js +111 -0
- package/lib/esm/components/TreeNode2.js.map +1 -0
- package/lib/esm/components/VisualStyleContext.js +9 -3
- package/lib/esm/components/VisualStyleContext.js.map +1 -1
- package/lib/esm/components/axesIcons.d.ts +7 -0
- package/lib/esm/components/axesIcons.js +10 -0
- package/lib/esm/components/axesIcons.js.map +1 -0
- package/lib/esm/components/bpIconWrapper.d.ts +2 -2
- package/lib/esm/components/bpIconWrapper.js +2 -2
- package/lib/esm/components/bpIconWrapper.js.map +1 -1
- package/lib/esm/components/iconMapping.d.ts +198 -0
- package/lib/esm/components/iconMapping.js +202 -0
- package/lib/esm/components/iconMapping.js.map +1 -0
- package/lib/esm/components/loadingState.d.ts +4 -0
- package/lib/esm/components/loadingState.js +10 -0
- package/lib/esm/components/loadingState.js.map +1 -1
- package/lib/esm/components/shapesIcons.d.ts +100 -0
- package/lib/esm/components/shapesIcons.js +102 -0
- package/lib/esm/components/shapesIcons.js.map +1 -0
- package/lib/esm/components/treeTypes.d.ts +18 -0
- package/lib/esm/components/treeTypes.js +2 -0
- package/lib/esm/components/treeTypes.js.map +1 -0
- package/lib/esm/lib.d.ts +4 -1
- package/lib/esm/lib.js +4 -1
- package/lib/esm/lib.js.map +1 -1
- package/lib/esm/renderer.css.js +1 -0
- package/lib/esm/utils.d.ts +1 -0
- package/lib/esm/utils.js +19 -0
- package/lib/esm/utils.js.map +1 -0
- package/package.json +69 -13
- package/src/ConfigObject.tsx +25 -11
- package/src/UiConfigRendererBlueprint.tsx +31 -20
- package/src/bpComponents/BPButtonComponent.scss +5 -1
- package/src/bpComponents/BPButtonComponent.tsx +10 -3
- package/src/bpComponents/BPColorInputComponent.tsx +9 -3
- package/src/bpComponents/BPComponent.tsx +17 -4
- package/src/bpComponents/BPContainerComponent.tsx +13 -1
- package/src/bpComponents/BPDropdownInputComponent.tsx +11 -4
- package/src/bpComponents/BPFileComponent.tsx +55 -27
- package/src/bpComponents/BPFolderComponent.scss +36 -6
- package/src/bpComponents/BPFolderComponent.tsx +109 -18
- package/src/bpComponents/BPInputComponent.tsx +6 -2
- package/src/bpComponents/BPLabelledComponent.tsx +2 -2
- package/src/bpComponents/BPNumberInputComponent.tsx +14 -2
- package/src/bpComponents/BPPanelComponent.tsx +1 -1
- package/src/bpComponents/BPSliderInputComponent.tsx +40 -20
- package/src/bpComponents/BPTextInputComponent.tsx +1 -0
- package/src/bpComponents/BPToggleInputComponent.tsx +6 -3
- package/src/bpComponents/BPTreeComponent.tsx +125 -25
- package/src/bpComponents/BPTreeFolderComponent.tsx +3 -3
- package/src/bpComponents/BPValueComponent.tsx +31 -4
- package/src/bpComponents/BPVectorInputComponent.tsx +23 -20
- package/src/bpComponents/GetNumberTransformFunctions.tsx +14 -0
- package/src/bpComponents/NumberUnits.tsx +123 -0
- package/src/components/AppToaster.tsx +20 -0
- package/src/components/ConfigurationPanelComponent.tsx +14 -3
- package/src/components/DialogContext.tsx +125 -65
- package/src/components/DraggableIcon.tsx +6 -5
- package/src/components/ExtendedNumericInput.tsx +71 -19
- package/src/components/FileComponent.tsx +48 -25
- package/src/components/InspectorStackComponent.tsx +2 -2
- package/src/components/NumericInput.tsx +679 -0
- package/src/components/Tree2.tsx +344 -0
- package/src/components/TreeNode2.tsx +192 -0
- package/src/components/VisualStyleContext.tsx +10 -2
- package/src/components/axesIcons.tsx +116 -0
- package/src/components/bpIconWrapper.tsx +5 -4
- package/src/components/common.scss +17 -0
- package/src/components/iconMapping.ts +354 -0
- package/src/components/loadingState.tsx +9 -0
- package/src/components/shapesIcons.tsx +980 -0
- package/src/components/tree2.scss +69 -0
- package/src/components/treeTypes.ts +97 -0
- package/src/lib.ts +4 -1
- package/src/renderer.scss +83 -12
- package/src/utils.ts +34 -0
- package/tsconfig.json +1 -0
- package/dist/allPaths-EYaH0Usv.js +0 -23
- package/dist/index-0vU2D25U.js +0 -604
- package/dist/index-0vU2D25U.js.map +0 -1
- package/dist/index-JBvBPdy9.js +0 -604
- package/dist/index-JBvBPdy9.js.map +0 -1
- package/dist/index-OyL-zObJ.js +0 -12765
- package/dist/index-OyL-zObJ.js.map +0 -1
- package/lib/cjs/ConfigObject.d.ts +0 -18
- package/lib/cjs/ConfigObject.js +0 -82
- package/lib/cjs/ConfigObject.js.map +0 -1
- package/lib/cjs/UiConfigRendererBlueprint.d.ts +0 -13
- package/lib/cjs/UiConfigRendererBlueprint.js +0 -56
- package/lib/cjs/UiConfigRendererBlueprint.js.map +0 -1
- package/lib/cjs/bpComponents/BPButtonComponent.d.ts +0 -8
- package/lib/cjs/bpComponents/BPButtonComponent.js +0 -19
- package/lib/cjs/bpComponents/BPButtonComponent.js.map +0 -1
- package/lib/cjs/bpComponents/BPColorInputComponent.d.ts +0 -24
- package/lib/cjs/bpComponents/BPColorInputComponent.js +0 -127
- package/lib/cjs/bpComponents/BPColorInputComponent.js.map +0 -1
- package/lib/cjs/bpComponents/BPComponent.d.ts +0 -29
- package/lib/cjs/bpComponents/BPComponent.js +0 -59
- package/lib/cjs/bpComponents/BPComponent.js.map +0 -1
- package/lib/cjs/bpComponents/BPContainerComponent.d.ts +0 -21
- package/lib/cjs/bpComponents/BPContainerComponent.js +0 -54
- package/lib/cjs/bpComponents/BPContainerComponent.js.map +0 -1
- package/lib/cjs/bpComponents/BPDropdownInputComponent.d.ts +0 -15
- package/lib/cjs/bpComponents/BPDropdownInputComponent.js +0 -43
- package/lib/cjs/bpComponents/BPDropdownInputComponent.js.map +0 -1
- package/lib/cjs/bpComponents/BPFileComponent.d.ts +0 -25
- package/lib/cjs/bpComponents/BPFileComponent.js +0 -69
- package/lib/cjs/bpComponents/BPFileComponent.js.map +0 -1
- package/lib/cjs/bpComponents/BPFolderComponent.d.ts +0 -16
- package/lib/cjs/bpComponents/BPFolderComponent.js +0 -39
- package/lib/cjs/bpComponents/BPFolderComponent.js.map +0 -1
- package/lib/cjs/bpComponents/BPInputComponent.d.ts +0 -11
- package/lib/cjs/bpComponents/BPInputComponent.js +0 -34
- package/lib/cjs/bpComponents/BPInputComponent.js.map +0 -1
- package/lib/cjs/bpComponents/BPLabelledComponent.d.ts +0 -8
- package/lib/cjs/bpComponents/BPLabelledComponent.js +0 -14
- package/lib/cjs/bpComponents/BPLabelledComponent.js.map +0 -1
- package/lib/cjs/bpComponents/BPNumberInputComponent.d.ts +0 -10
- package/lib/cjs/bpComponents/BPNumberInputComponent.js +0 -40
- package/lib/cjs/bpComponents/BPNumberInputComponent.js.map +0 -1
- package/lib/cjs/bpComponents/BPPanelComponent.d.ts +0 -16
- package/lib/cjs/bpComponents/BPPanelComponent.js +0 -35
- package/lib/cjs/bpComponents/BPPanelComponent.js.map +0 -1
- package/lib/cjs/bpComponents/BPSliderInputComponent.d.ts +0 -14
- package/lib/cjs/bpComponents/BPSliderInputComponent.js +0 -41
- package/lib/cjs/bpComponents/BPSliderInputComponent.js.map +0 -1
- package/lib/cjs/bpComponents/BPTextInputComponent.d.ts +0 -7
- package/lib/cjs/bpComponents/BPTextInputComponent.js +0 -19
- package/lib/cjs/bpComponents/BPTextInputComponent.js.map +0 -1
- package/lib/cjs/bpComponents/BPToggleInputComponent.d.ts +0 -8
- package/lib/cjs/bpComponents/BPToggleInputComponent.js +0 -22
- package/lib/cjs/bpComponents/BPToggleInputComponent.js.map +0 -1
- package/lib/cjs/bpComponents/BPTreeComponent.d.ts +0 -36
- package/lib/cjs/bpComponents/BPTreeComponent.js +0 -131
- package/lib/cjs/bpComponents/BPTreeComponent.js.map +0 -1
- package/lib/cjs/bpComponents/BPTreeFolderComponent.d.ts +0 -10
- package/lib/cjs/bpComponents/BPTreeFolderComponent.js +0 -40
- package/lib/cjs/bpComponents/BPTreeFolderComponent.js.map +0 -1
- package/lib/cjs/bpComponents/BPValueComponent.d.ts +0 -16
- package/lib/cjs/bpComponents/BPValueComponent.js +0 -46
- package/lib/cjs/bpComponents/BPValueComponent.js.map +0 -1
- package/lib/cjs/bpComponents/BPVectorInputComponent.d.ts +0 -19
- package/lib/cjs/bpComponents/BPVectorInputComponent.js +0 -110
- package/lib/cjs/bpComponents/BPVectorInputComponent.js.map +0 -1
- package/lib/cjs/components/ConfigurationPanelComponent.d.ts +0 -4
- package/lib/cjs/components/ConfigurationPanelComponent.js +0 -30
- package/lib/cjs/components/ConfigurationPanelComponent.js.map +0 -1
- package/lib/cjs/components/DialogContext.d.ts +0 -48
- package/lib/cjs/components/DialogContext.js +0 -79
- package/lib/cjs/components/DialogContext.js.map +0 -1
- package/lib/cjs/components/DraggableIcon.d.ts +0 -19
- package/lib/cjs/components/DraggableIcon.js +0 -70
- package/lib/cjs/components/DraggableIcon.js.map +0 -1
- package/lib/cjs/components/ExtendedNumericInput.d.ts +0 -25
- package/lib/cjs/components/ExtendedNumericInput.js +0 -174
- package/lib/cjs/components/ExtendedNumericInput.js.map +0 -1
- package/lib/cjs/components/FileComponent.d.ts +0 -7
- package/lib/cjs/components/FileComponent.js +0 -49
- package/lib/cjs/components/FileComponent.js.map +0 -1
- package/lib/cjs/components/FormGroupComponent.d.ts +0 -6
- package/lib/cjs/components/FormGroupComponent.js +0 -16
- package/lib/cjs/components/FormGroupComponent.js.map +0 -1
- package/lib/cjs/components/InspectorStackComponent.d.ts +0 -4
- package/lib/cjs/components/InspectorStackComponent.js +0 -27
- package/lib/cjs/components/InspectorStackComponent.js.map +0 -1
- package/lib/cjs/components/VisualStyleContext.d.ts +0 -119
- package/lib/cjs/components/VisualStyleContext.js +0 -60
- package/lib/cjs/components/VisualStyleContext.js.map +0 -1
- package/lib/cjs/components/bpIconWrapper.d.ts +0 -2
- package/lib/cjs/components/bpIconWrapper.js +0 -9
- package/lib/cjs/components/bpIconWrapper.js.map +0 -1
- package/lib/cjs/components/loadingState.d.ts +0 -4
- package/lib/cjs/components/loadingState.js +0 -16
- package/lib/cjs/components/loadingState.js.map +0 -1
- package/lib/cjs/components/variableIcons.d.ts +0 -40
- package/lib/cjs/components/variableIcons.js +0 -46
- package/lib/cjs/components/variableIcons.js.map +0 -1
- package/lib/cjs/contexts.d.ts +0 -1
- package/lib/cjs/contexts.js +0 -3
- package/lib/cjs/contexts.js.map +0 -1
- package/lib/cjs/index.d.ts +0 -4
- package/lib/cjs/index.js +0 -9
- package/lib/cjs/index.js.map +0 -1
- package/lib/cjs/lib.d.ts +0 -32
- package/lib/cjs/lib.js +0 -49
- package/lib/cjs/lib.js.map +0 -1
- package/lib/cjs/threejs.d.ts +0 -2
- package/lib/cjs/threejs.js +0 -3
- package/lib/cjs/threejs.js.map +0 -1
- package/lib/esnext/ConfigObject.d.ts +0 -18
- package/lib/esnext/ConfigObject.js +0 -75
- package/lib/esnext/ConfigObject.js.map +0 -1
- package/lib/esnext/UiConfigRendererBlueprint.d.ts +0 -13
- package/lib/esnext/UiConfigRendererBlueprint.js +0 -52
- package/lib/esnext/UiConfigRendererBlueprint.js.map +0 -1
- package/lib/esnext/bpComponents/BPButtonComponent.d.ts +0 -8
- package/lib/esnext/bpComponents/BPButtonComponent.js +0 -15
- package/lib/esnext/bpComponents/BPButtonComponent.js.map +0 -1
- package/lib/esnext/bpComponents/BPColorInputComponent.d.ts +0 -24
- package/lib/esnext/bpComponents/BPColorInputComponent.js +0 -110
- package/lib/esnext/bpComponents/BPColorInputComponent.js.map +0 -1
- package/lib/esnext/bpComponents/BPComponent.d.ts +0 -29
- package/lib/esnext/bpComponents/BPComponent.js +0 -46
- package/lib/esnext/bpComponents/BPComponent.js.map +0 -1
- package/lib/esnext/bpComponents/BPContainerComponent.d.ts +0 -21
- package/lib/esnext/bpComponents/BPContainerComponent.js +0 -51
- package/lib/esnext/bpComponents/BPContainerComponent.js.map +0 -1
- package/lib/esnext/bpComponents/BPDropdownInputComponent.d.ts +0 -15
- package/lib/esnext/bpComponents/BPDropdownInputComponent.js +0 -40
- package/lib/esnext/bpComponents/BPDropdownInputComponent.js.map +0 -1
- package/lib/esnext/bpComponents/BPFileComponent.d.ts +0 -25
- package/lib/esnext/bpComponents/BPFileComponent.js +0 -52
- package/lib/esnext/bpComponents/BPFileComponent.js.map +0 -1
- package/lib/esnext/bpComponents/BPFolderComponent.d.ts +0 -16
- package/lib/esnext/bpComponents/BPFolderComponent.js +0 -30
- package/lib/esnext/bpComponents/BPFolderComponent.js.map +0 -1
- package/lib/esnext/bpComponents/BPInputComponent.d.ts +0 -11
- package/lib/esnext/bpComponents/BPInputComponent.js +0 -19
- package/lib/esnext/bpComponents/BPInputComponent.js.map +0 -1
- package/lib/esnext/bpComponents/BPLabelledComponent.d.ts +0 -8
- package/lib/esnext/bpComponents/BPLabelledComponent.js +0 -13
- package/lib/esnext/bpComponents/BPLabelledComponent.js.map +0 -1
- package/lib/esnext/bpComponents/BPNumberInputComponent.d.ts +0 -10
- package/lib/esnext/bpComponents/BPNumberInputComponent.js +0 -21
- package/lib/esnext/bpComponents/BPNumberInputComponent.js.map +0 -1
- package/lib/esnext/bpComponents/BPPanelComponent.d.ts +0 -16
- package/lib/esnext/bpComponents/BPPanelComponent.js +0 -31
- package/lib/esnext/bpComponents/BPPanelComponent.js.map +0 -1
- package/lib/esnext/bpComponents/BPSliderInputComponent.d.ts +0 -14
- package/lib/esnext/bpComponents/BPSliderInputComponent.js +0 -39
- package/lib/esnext/bpComponents/BPSliderInputComponent.js.map +0 -1
- package/lib/esnext/bpComponents/BPTextInputComponent.d.ts +0 -7
- package/lib/esnext/bpComponents/BPTextInputComponent.js +0 -15
- package/lib/esnext/bpComponents/BPTextInputComponent.js.map +0 -1
- package/lib/esnext/bpComponents/BPToggleInputComponent.d.ts +0 -8
- package/lib/esnext/bpComponents/BPToggleInputComponent.js +0 -18
- package/lib/esnext/bpComponents/BPToggleInputComponent.js.map +0 -1
- package/lib/esnext/bpComponents/BPTreeComponent.d.ts +0 -36
- package/lib/esnext/bpComponents/BPTreeComponent.js +0 -111
- package/lib/esnext/bpComponents/BPTreeComponent.js.map +0 -1
- package/lib/esnext/bpComponents/BPTreeFolderComponent.d.ts +0 -10
- package/lib/esnext/bpComponents/BPTreeFolderComponent.js +0 -23
- package/lib/esnext/bpComponents/BPTreeFolderComponent.js.map +0 -1
- package/lib/esnext/bpComponents/BPValueComponent.d.ts +0 -16
- package/lib/esnext/bpComponents/BPValueComponent.js +0 -29
- package/lib/esnext/bpComponents/BPValueComponent.js.map +0 -1
- package/lib/esnext/bpComponents/BPVectorInputComponent.d.ts +0 -19
- package/lib/esnext/bpComponents/BPVectorInputComponent.js +0 -93
- package/lib/esnext/bpComponents/BPVectorInputComponent.js.map +0 -1
- package/lib/esnext/components/ConfigurationPanelComponent.d.ts +0 -4
- package/lib/esnext/components/ConfigurationPanelComponent.js +0 -26
- package/lib/esnext/components/ConfigurationPanelComponent.js.map +0 -1
- package/lib/esnext/components/DialogContext.d.ts +0 -48
- package/lib/esnext/components/DialogContext.js +0 -55
- package/lib/esnext/components/DialogContext.js.map +0 -1
- package/lib/esnext/components/DraggableIcon.d.ts +0 -19
- package/lib/esnext/components/DraggableIcon.js +0 -62
- package/lib/esnext/components/DraggableIcon.js.map +0 -1
- package/lib/esnext/components/ExtendedNumericInput.d.ts +0 -25
- package/lib/esnext/components/ExtendedNumericInput.js +0 -151
- package/lib/esnext/components/ExtendedNumericInput.js.map +0 -1
- package/lib/esnext/components/FileComponent.d.ts +0 -7
- package/lib/esnext/components/FileComponent.js +0 -42
- package/lib/esnext/components/FileComponent.js.map +0 -1
- package/lib/esnext/components/FormGroupComponent.d.ts +0 -6
- package/lib/esnext/components/FormGroupComponent.js +0 -11
- package/lib/esnext/components/FormGroupComponent.js.map +0 -1
- package/lib/esnext/components/InspectorStackComponent.d.ts +0 -4
- package/lib/esnext/components/InspectorStackComponent.js +0 -23
- package/lib/esnext/components/InspectorStackComponent.js.map +0 -1
- package/lib/esnext/components/VisualStyleContext.d.ts +0 -119
- package/lib/esnext/components/VisualStyleContext.js +0 -53
- package/lib/esnext/components/VisualStyleContext.js.map +0 -1
- package/lib/esnext/components/bpIconWrapper.d.ts +0 -2
- package/lib/esnext/components/bpIconWrapper.js +0 -5
- package/lib/esnext/components/bpIconWrapper.js.map +0 -1
- package/lib/esnext/components/loadingState.d.ts +0 -4
- package/lib/esnext/components/loadingState.js +0 -12
- package/lib/esnext/components/loadingState.js.map +0 -1
- package/lib/esnext/components/variableIcons.d.ts +0 -40
- package/lib/esnext/components/variableIcons.js +0 -43
- package/lib/esnext/components/variableIcons.js.map +0 -1
- package/lib/esnext/contexts.d.ts +0 -1
- package/lib/esnext/contexts.js +0 -2
- package/lib/esnext/contexts.js.map +0 -1
- package/lib/esnext/index.d.ts +0 -4
- package/lib/esnext/index.js +0 -5
- package/lib/esnext/index.js.map +0 -1
- package/lib/esnext/lib.d.ts +0 -32
- package/lib/esnext/lib.js +0 -33
- package/lib/esnext/lib.js.map +0 -1
- package/lib/esnext/threejs.d.ts +0 -2
- package/lib/esnext/threejs.js +0 -2
- package/lib/esnext/threejs.js.map +0 -1
|
@@ -1,15 +1,17 @@
|
|
|
1
|
+
import {Tree2} from "../components/Tree2";
|
|
1
2
|
import {BPComponent, BPComponentProps, BPComponentState, UiConfigRendererContextType} from "./BPComponent";
|
|
2
|
-
import {
|
|
3
|
+
import {TreeNodeInfo} from "@blueprintjs/core";
|
|
4
|
+
import React from "react";
|
|
3
5
|
|
|
4
6
|
export type BPTreeComponentState<T = {}> = BPComponentState & {
|
|
5
7
|
nodes: TreeNodeInfo<T>[]
|
|
6
8
|
}
|
|
7
9
|
|
|
8
10
|
// https://github.com/palantir/blueprint/blob/develop/packages/docs-app/src/examples/core-examples/treeExample.tsx
|
|
9
|
-
type NodePath = number[];
|
|
11
|
+
type NodePath = (string|number)[];
|
|
10
12
|
|
|
11
|
-
export abstract class BPTreeComponent<T = {}, TConfigVal = void> extends BPComponent<TConfigVal, BPTreeComponentState<T
|
|
12
|
-
constructor(props: BPComponentProps<TConfigVal
|
|
13
|
+
export abstract class BPTreeComponent<T = {}, TConfigVal extends any /*|PrimitiveVal|void*/ = void> extends BPComponent<TConfigVal, BPTreeComponentState<T>, BPComponentProps<TConfigVal> & {className: string}> {
|
|
14
|
+
constructor(props: BPComponentProps<TConfigVal> & {className: string}, context: UiConfigRendererContextType) {
|
|
13
15
|
super(props, context, {nodes: []});
|
|
14
16
|
}
|
|
15
17
|
|
|
@@ -32,10 +34,10 @@ export abstract class BPTreeComponent<T = {}, TConfigVal = void> extends BPCompo
|
|
|
32
34
|
|
|
33
35
|
protected abstract _getRootNodes(): T[]
|
|
34
36
|
|
|
35
|
-
protected async _onNodeClick(_id: string | number
|
|
37
|
+
protected async _onNodeClick(_id: string | number) {
|
|
36
38
|
}
|
|
37
39
|
|
|
38
|
-
protected async _onNodeDoubleClick(_id: string | number
|
|
40
|
+
protected async _onNodeDoubleClick(_id: string | number) {
|
|
39
41
|
}
|
|
40
42
|
|
|
41
43
|
protected _cloneNodes(callback?: (t:TreeNodeInfo<T>)=>void, state?: TreeNodeInfo<T>[]): TreeNodeInfo<T>[] {
|
|
@@ -50,30 +52,39 @@ export abstract class BPTreeComponent<T = {}, TConfigVal = void> extends BPCompo
|
|
|
50
52
|
})
|
|
51
53
|
}
|
|
52
54
|
|
|
53
|
-
protected
|
|
55
|
+
protected _getNodePath(id: string, nodes?: TreeNodeInfo<T>[]): NodePath {
|
|
56
|
+
let path1: NodePath|null = null
|
|
57
|
+
this._forEachNode(nodes ?? this.state.nodes, (node, path) => {
|
|
58
|
+
if (node.id === id) path1 = path
|
|
59
|
+
})
|
|
60
|
+
return path1 ?? []
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
protected _forEachNode<T>(nodes: TreeNodeInfo<T>[] | undefined, callback: (node: TreeNodeInfo<T>, path: NodePath) => void, path: NodePath = []) {
|
|
54
64
|
if (nodes === undefined) {
|
|
55
65
|
return nodes;
|
|
56
66
|
}
|
|
57
67
|
for (const node of nodes) {
|
|
58
|
-
callback(node);
|
|
59
|
-
this._forEachNode(node.childNodes, callback);
|
|
68
|
+
callback(node, path);
|
|
69
|
+
this._forEachNode(node.childNodes, callback, [...path, node.id]);
|
|
60
70
|
}
|
|
61
71
|
return nodes
|
|
62
72
|
}
|
|
63
|
-
protected _forNodeAtPath<T>(nodes: TreeNodeInfo<T>[], path: NodePath, callback: (node: TreeNodeInfo<T>) => void) {
|
|
64
|
-
callback(Tree.nodeFromPath(path, nodes));
|
|
65
|
-
}
|
|
66
73
|
|
|
67
|
-
protected
|
|
74
|
+
// protected _forNodeAtPath<T>(nodes: TreeNodeInfo<T>[], path: NodePath, callback: (node: TreeNodeInfo<T>) => void) {
|
|
75
|
+
// callback(Tree.nodeFromPath(path, nodes));
|
|
76
|
+
// }
|
|
77
|
+
|
|
78
|
+
protected async _onNodeExpandCollapse(_id: string | number, expanded?: boolean) {
|
|
68
79
|
const nodes = this._cloneNodes()
|
|
69
80
|
const node = this._infoMap.get(_id)
|
|
70
81
|
if (!node) return
|
|
71
|
-
node.isExpanded = !node.isExpanded
|
|
82
|
+
node.isExpanded = expanded ?? !node.isExpanded
|
|
72
83
|
// forNodeAtPath(nodes, _path, node => (node.isExpanded = !node.isExpanded));
|
|
73
84
|
await this.setStatePromise({...this.state, nodes})
|
|
74
85
|
}
|
|
75
86
|
|
|
76
|
-
protected async _onNodeContextMenu(_id: string | number
|
|
87
|
+
protected async _onNodeContextMenu(_id: string | number) {
|
|
77
88
|
}
|
|
78
89
|
|
|
79
90
|
protected buildData(data: TreeNodeInfo<T>[], obj: T, _?: any, _2?: any) {
|
|
@@ -103,8 +114,21 @@ export abstract class BPTreeComponent<T = {}, TConfigVal = void> extends BPCompo
|
|
|
103
114
|
return this.setStatePromise({...this.state, nodes})
|
|
104
115
|
}
|
|
105
116
|
|
|
106
|
-
async setSelected(id?: string) {
|
|
107
|
-
const nodes =
|
|
117
|
+
async setSelected(id?: string|string[], expand = false) {
|
|
118
|
+
const nodes =
|
|
119
|
+
Array.isArray(id) ?
|
|
120
|
+
this._cloneNodes(n => n.isSelected = id.includes(n.id as any)) :
|
|
121
|
+
this._cloneNodes(n => n.isSelected = n.id === id)
|
|
122
|
+
if(expand && id!==undefined){
|
|
123
|
+
const ids = Array.isArray(id) ? id : [id]
|
|
124
|
+
for (const id1 of ids) {
|
|
125
|
+
const parents = this._getNodePath(id1, nodes)
|
|
126
|
+
for (let i = 0; i < parents.length; i++) {
|
|
127
|
+
const node = this._infoMap.get(parents[i])
|
|
128
|
+
if(node) node.isExpanded = true
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
}
|
|
108
132
|
return this.setStatePromise({...this.state, nodes})
|
|
109
133
|
}
|
|
110
134
|
|
|
@@ -116,28 +140,104 @@ export abstract class BPTreeComponent<T = {}, TConfigVal = void> extends BPCompo
|
|
|
116
140
|
super.componentWillUnmount();
|
|
117
141
|
}
|
|
118
142
|
|
|
143
|
+
findSelectedNode(nodes?: TreeNodeInfo<T>[]): TreeNodeInfo<T> | undefined {
|
|
144
|
+
if (!nodes) nodes = this.state.nodes
|
|
145
|
+
for (const node of nodes) {
|
|
146
|
+
if (node.isSelected) return node
|
|
147
|
+
if (node.childNodes) {
|
|
148
|
+
const res = this.findSelectedNode(node.childNodes)
|
|
149
|
+
if (res) return res
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
getFlatNodes(onlyVisible = false, nodes?: TreeNodeInfo<T>[], res: TreeNodeInfo<T>[] = []): TreeNodeInfo<T>[] {
|
|
154
|
+
if (!nodes) nodes = this.state.nodes
|
|
155
|
+
for (const node of nodes) {
|
|
156
|
+
res.push(node)
|
|
157
|
+
if (node.childNodes && (!onlyVisible || node.isExpanded)) this.getFlatNodes(onlyVisible, node.childNodes, res)
|
|
158
|
+
}
|
|
159
|
+
return res
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
protected _handleKeyDown(e: React.KeyboardEvent) {
|
|
163
|
+
const nodes = this.getFlatNodes(true)
|
|
164
|
+
let current, next, previous;
|
|
165
|
+
for (let i = 0; i < nodes.length; i++) {
|
|
166
|
+
const node = nodes[i]
|
|
167
|
+
if (node.isSelected) {
|
|
168
|
+
current = node
|
|
169
|
+
next = i < nodes.length - 1 ? nodes[i + 1] : undefined
|
|
170
|
+
previous = i > 0 ? nodes[i - 1] : undefined
|
|
171
|
+
break
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
switch (e.key) {
|
|
175
|
+
case "ArrowUp":
|
|
176
|
+
if (previous) this._onNodeClick(previous.id)
|
|
177
|
+
break
|
|
178
|
+
case "ArrowDown":
|
|
179
|
+
if (next) this._onNodeClick(next.id)
|
|
180
|
+
break
|
|
181
|
+
case "ArrowRight":
|
|
182
|
+
if (current) this._onNodeExpandCollapse(current.id, true)
|
|
183
|
+
break
|
|
184
|
+
case "ArrowLeft":
|
|
185
|
+
if (current) this._onNodeExpandCollapse(current.id, false)
|
|
186
|
+
break
|
|
187
|
+
case "Escape":
|
|
188
|
+
if (current) this._onNodeClick(current.id)
|
|
189
|
+
break
|
|
190
|
+
case "Enter":
|
|
191
|
+
if (current) this._onNodeDoubleClick(current.id)
|
|
192
|
+
break
|
|
193
|
+
default:
|
|
194
|
+
return
|
|
195
|
+
}
|
|
196
|
+
e.preventDefault()
|
|
197
|
+
e.stopPropagation()
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
protected _canDropNode(_sourceNode: TreeNodeInfo<T>, _sourcePath: NodePath, _targetNode: TreeNodeInfo<T>, _targetPath: NodePath, _index?: number) {
|
|
201
|
+
return true
|
|
202
|
+
}
|
|
203
|
+
protected _onDropNode(_sourceNode: TreeNodeInfo<T>, _sourcePath: NodePath, _targetNode: TreeNodeInfo<T>, _targetPath: NodePath, _e?: React.DragEvent, _index?: number) {
|
|
204
|
+
return
|
|
205
|
+
}
|
|
206
|
+
|
|
119
207
|
render() {
|
|
120
|
-
const TreeT =
|
|
208
|
+
const TreeT = Tree2.ofType<T>()
|
|
121
209
|
return !this.state.hidden ? (
|
|
210
|
+
<div
|
|
211
|
+
style={{width: "100%", height: "100%"}}
|
|
212
|
+
onKeyDown={e => this._handleKeyDown(e)}
|
|
213
|
+
tabIndex={0}
|
|
214
|
+
>
|
|
122
215
|
<TreeT
|
|
123
216
|
contents={this.state.nodes}
|
|
124
|
-
className="folderContent"
|
|
217
|
+
className={"folderContent " + (this.props.className||'')}
|
|
218
|
+
canDropNode={(node, path, targetNode, targetPath, index) => {
|
|
219
|
+
return this._canDropNode(node, path, targetNode, targetPath, index)
|
|
220
|
+
}}
|
|
221
|
+
onNodeDrop={(node, path, targetNode, targetPath, e, index) => {
|
|
222
|
+
// console.log(node, path, targetNode, targetPath, e);
|
|
223
|
+
this._onDropNode(node, path, targetNode, targetPath, e, index)
|
|
224
|
+
}}
|
|
125
225
|
onNodeExpand={(node, _path, _e) => {
|
|
126
|
-
this._onNodeExpandCollapse(node.id
|
|
226
|
+
this._onNodeExpandCollapse(node.id)
|
|
127
227
|
}}
|
|
128
228
|
onNodeCollapse={(node, _path, _e) => {
|
|
129
|
-
this._onNodeExpandCollapse(node.id
|
|
229
|
+
this._onNodeExpandCollapse(node.id)
|
|
130
230
|
}}
|
|
131
231
|
onNodeClick={(node, _path, _e) => {
|
|
132
|
-
this._onNodeClick(node.id
|
|
232
|
+
this._onNodeClick(node.id)
|
|
133
233
|
}}
|
|
134
234
|
onNodeDoubleClick={(node, _path, _e) => {
|
|
135
|
-
this._onNodeDoubleClick(node.id
|
|
235
|
+
this._onNodeDoubleClick(node.id)
|
|
136
236
|
}}
|
|
137
237
|
onNodeContextMenu={(node, _path, _e) => {
|
|
138
|
-
this._onNodeContextMenu(node.id
|
|
238
|
+
this._onNodeContextMenu(node.id)
|
|
139
239
|
}}
|
|
140
|
-
|
|
240
|
+
/></div>
|
|
141
241
|
) : null
|
|
142
242
|
}
|
|
143
243
|
}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import {v4} from "uuid";
|
|
2
1
|
import {TreeNodeInfo} from "@blueprintjs/core";
|
|
3
2
|
import {BPTreeComponent} from "./BPTreeComponent";
|
|
4
3
|
import {UiObjectConfig} from 'uiconfig.js'
|
|
5
|
-
import {getOrCall} from 'ts-browser-helpers'
|
|
4
|
+
import {getOrCall, uuidV4} from 'ts-browser-helpers'
|
|
6
5
|
|
|
7
6
|
export class BPTreeFolderComponent extends BPTreeComponent<UiObjectConfig> {
|
|
8
7
|
|
|
9
8
|
protected _getNodeId(obj: UiObjectConfig) {
|
|
10
|
-
|
|
9
|
+
if(!obj.uuid) obj.uuid = uuidV4();
|
|
10
|
+
return obj.uuid;
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
protected _updateNodeInfo(node: TreeNodeInfo<UiObjectConfig>, obj: UiObjectConfig) {
|
|
@@ -1,30 +1,52 @@
|
|
|
1
1
|
import {BPComponentProps, UiConfigRendererContextType} from "./BPComponent";
|
|
2
2
|
import {BPLabelledComponent, BPLabelledComponentState} from "./BPLabelledComponent";
|
|
3
|
+
import {equalsPrimitive, PrimitiveVal} from "uiconfig.js";
|
|
3
4
|
|
|
4
5
|
export type BPValueComponentState<TStateValue> = BPLabelledComponentState & {
|
|
5
6
|
value: TStateValue
|
|
6
7
|
}
|
|
7
8
|
|
|
8
|
-
export abstract class BPValueComponent<TValue, TState extends BPValueComponentState<TStateValue>, TStateValue> extends BPLabelledComponent<TValue, TState> {
|
|
9
|
+
export abstract class BPValueComponent<TValue extends PrimitiveVal, TState extends BPValueComponentState<TStateValue>, TStateValue> extends BPLabelledComponent<TValue, TState> {
|
|
9
10
|
|
|
10
11
|
protected constructor(props: BPComponentProps<TValue>, context: UiConfigRendererContextType, state: TState) {
|
|
11
12
|
super(props, context, state);
|
|
13
|
+
this.setValue = this.setValue.bind(this)
|
|
12
14
|
}
|
|
13
15
|
|
|
14
16
|
abstract convertValueToState(value: TValue, state: TState): TState;
|
|
15
17
|
|
|
16
18
|
abstract convertStateToValue(state: TState): Promise<TValue>;
|
|
17
19
|
|
|
20
|
+
// this should be state.value ideally which is initialValue in parent component
|
|
21
|
+
// a separate variable is made here so that it can be undefined in the beginning.
|
|
22
|
+
private _lastValRef: TValue | undefined
|
|
23
|
+
|
|
18
24
|
getUpdatedState(state: TState): TState {
|
|
19
|
-
const val = this.context.methods.getValue(this.props.config)
|
|
25
|
+
const val = this.context.methods.getValue<TValue>(this.props.config, this._lastValRef, false) // this has to be false otherwise the children component will rerender everytime. like sliders
|
|
26
|
+
if(this._lastValRef !== undefined && val !== undefined){
|
|
27
|
+
// changed from outside, so we need to update the children
|
|
28
|
+
this.keyVersion++
|
|
29
|
+
}
|
|
30
|
+
this._lastValRef = val
|
|
31
|
+
// console.log('getUpdatedState', val);
|
|
20
32
|
state = super.getUpdatedState(state)
|
|
21
|
-
|
|
33
|
+
state = val !== undefined ? this.convertValueToState(val, state) : state
|
|
34
|
+
return state
|
|
22
35
|
}
|
|
23
36
|
|
|
24
37
|
protected _previousLast = false
|
|
25
38
|
|
|
39
|
+
// is this really required?
|
|
26
40
|
doesNeedRefresh(state: TState, _last?: boolean): boolean {
|
|
27
|
-
|
|
41
|
+
const needsRefresh = this._previousLast !== _last || !equals(this.state.value, state.value);
|
|
42
|
+
this._previousLast = _last ?? true;
|
|
43
|
+
// console.log('doesNeedRefresh', needsRefresh, this.state.value, state.value);
|
|
44
|
+
return needsRefresh;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
setState(state: TState, callback?: () => void) {
|
|
48
|
+
// this.keyVersion++ // dont in getUpdatedState
|
|
49
|
+
super.setState(state, callback);
|
|
28
50
|
}
|
|
29
51
|
|
|
30
52
|
async setValue(value: TStateValue, last?: boolean) {
|
|
@@ -39,8 +61,13 @@ export abstract class BPValueComponent<TValue, TState extends BPValueComponentSt
|
|
|
39
61
|
return
|
|
40
62
|
}
|
|
41
63
|
let val = await this.convertStateToValue(state)
|
|
64
|
+
this._lastValRef = val
|
|
42
65
|
await this.context.methods.setValue(this.props.config, val, {last}, this.forceOnChange)
|
|
43
66
|
await this.refreshConfigState(state)
|
|
44
67
|
}
|
|
45
68
|
|
|
46
69
|
}
|
|
70
|
+
|
|
71
|
+
function equals(a: any, b: any){
|
|
72
|
+
return equalsPrimitive(a, b)
|
|
73
|
+
}
|
|
@@ -6,12 +6,14 @@ import type {Vector2, Vector3, Vector4} from "three";
|
|
|
6
6
|
import {ExtendedNumericInput} from "../components/ExtendedNumericInput";
|
|
7
7
|
import {wIcon3, xIcon3, yIcon3, zIcon3} from "../components/variableIcons";
|
|
8
8
|
import {getOrCall} from 'ts-browser-helpers'
|
|
9
|
+
import {getNumberTransformFunctions} from "./GetNumberTransformFunctions";
|
|
9
10
|
|
|
10
11
|
export type BPVectorComponentState = BPValueComponentState<Vector2|Vector3|Vector4> & {
|
|
11
12
|
min: number,
|
|
12
13
|
max: number,
|
|
13
14
|
step: number,
|
|
14
15
|
components: 1|2|3|4,
|
|
16
|
+
unit?: string,
|
|
15
17
|
}
|
|
16
18
|
|
|
17
19
|
export class BPVectorInputComponent extends BPInputComponent<Vector2|Vector3|Vector4, BPVectorComponentState> {
|
|
@@ -73,21 +75,34 @@ export class BPVectorInputComponent extends BPInputComponent<Vector2|Vector3|Vec
|
|
|
73
75
|
let ret = []
|
|
74
76
|
if (!this.state.value) return <></>;
|
|
75
77
|
|
|
78
|
+
const unit = this.props.config.unit as string|undefined; // todo add to uiconfig, getOrCall
|
|
79
|
+
const unitType = this.props.config.unitType as string|undefined; // todo add to uiconfig, getOrCall
|
|
80
|
+
const targetUnit = this.state.unit || unit
|
|
81
|
+
const transformValue = getNumberTransformFunctions(unit, unitType, targetUnit);
|
|
82
|
+
|
|
83
|
+
const props = {
|
|
84
|
+
disabled: this.state.disabled,
|
|
85
|
+
readOnly: this.state.readOnly,
|
|
86
|
+
min: this.state.min,
|
|
87
|
+
max: this.state.max,
|
|
88
|
+
stepSize: this.state.step,
|
|
89
|
+
minorStepSize: this.state.step / 10,
|
|
90
|
+
majorStepSize: this.state.step * 10,
|
|
91
|
+
buttonPosition: "none",
|
|
92
|
+
...transformValue,
|
|
93
|
+
} as const
|
|
94
|
+
|
|
76
95
|
// console.warn(this.state.value)
|
|
77
96
|
if (this.state.components > 0) {
|
|
78
97
|
const x = (
|
|
79
98
|
<ExtendedNumericInput
|
|
80
99
|
style={{maxWidth: "8rem", minWidth: "2rem"}}
|
|
81
|
-
disabled={this.state.disabled} readOnly={this.state.readOnly}
|
|
82
100
|
// defaultValue={state}
|
|
83
101
|
leftIcon={xIcon3}
|
|
84
102
|
value={this.state.value.x}
|
|
85
103
|
key={this.props.config.uuid + '_x'}
|
|
86
104
|
ref={this._inputs[0]}
|
|
87
|
-
|
|
88
|
-
minorStepSize={this.state.step / 10}
|
|
89
|
-
majorStepSize={this.state.step * 10}
|
|
90
|
-
buttonPosition="none"
|
|
105
|
+
{...props}
|
|
91
106
|
onChange2={(v, last) => {
|
|
92
107
|
this.state.value.x = v
|
|
93
108
|
this.setValue(this.state.value, last) // todo: does need refresh?
|
|
@@ -100,15 +115,11 @@ export class BPVectorInputComponent extends BPInputComponent<Vector2|Vector3|Vec
|
|
|
100
115
|
<ExtendedNumericInput
|
|
101
116
|
style={{maxWidth: "8rem", minWidth: "2rem"}}
|
|
102
117
|
// defaultValue={state}
|
|
103
|
-
disabled={this.state.disabled} readOnly={this.state.readOnly}
|
|
104
118
|
value={this.state.value.y}
|
|
105
119
|
leftIcon={yIcon3}
|
|
106
120
|
key={this.props.config.uuid + '_y'}
|
|
107
121
|
ref={this._inputs[1]}
|
|
108
|
-
|
|
109
|
-
minorStepSize={this.state.step / 10}
|
|
110
|
-
majorStepSize={this.state.step * 10}
|
|
111
|
-
buttonPosition="none"
|
|
122
|
+
{...props}
|
|
112
123
|
onChange2={(v, last) => {
|
|
113
124
|
this.state.value.y = v
|
|
114
125
|
this.setValue(this.state.value, last) // todo: does need refresh?
|
|
@@ -121,15 +132,11 @@ export class BPVectorInputComponent extends BPInputComponent<Vector2|Vector3|Vec
|
|
|
121
132
|
<ExtendedNumericInput
|
|
122
133
|
style={{maxWidth: "8rem", minWidth: "2rem"}}
|
|
123
134
|
// defaultValue={state}
|
|
124
|
-
disabled={this.state.disabled} readOnly={this.state.readOnly}
|
|
125
135
|
value={(this.state.value as Vector3|Vector4).z}
|
|
126
136
|
key={this.props.config.uuid + '_z'}
|
|
127
137
|
leftIcon={zIcon3}
|
|
128
|
-
min={this.state.min} max={this.state.max} stepSize={this.state.step}
|
|
129
138
|
ref={this._inputs[2]}
|
|
130
|
-
|
|
131
|
-
majorStepSize={this.state.step * 10}
|
|
132
|
-
buttonPosition="none"
|
|
139
|
+
{...props}
|
|
133
140
|
onChange2={(v, last) => {
|
|
134
141
|
(this.state.value as Vector3 | Vector4).z = v
|
|
135
142
|
this.setValue(this.state.value, last) // todo: does need refresh?
|
|
@@ -142,15 +149,11 @@ export class BPVectorInputComponent extends BPInputComponent<Vector2|Vector3|Vec
|
|
|
142
149
|
<ExtendedNumericInput
|
|
143
150
|
style={{maxWidth: "8rem", minWidth: "2rem"}}
|
|
144
151
|
// defaultValue={state}
|
|
145
|
-
disabled={this.state.disabled} readOnly={this.state.readOnly}
|
|
146
152
|
value={(this.state.value as Vector4).w}
|
|
147
153
|
key={this.props.config.uuid + '_w'}
|
|
148
154
|
leftIcon={wIcon3}
|
|
149
155
|
ref={this._inputs[3]}
|
|
150
|
-
|
|
151
|
-
minorStepSize={this.state.step / 10}
|
|
152
|
-
majorStepSize={this.state.step * 10}
|
|
153
|
-
buttonPosition="none"
|
|
156
|
+
{...props}
|
|
154
157
|
onChange2={(v, last) => {
|
|
155
158
|
(this.state.value as Vector4).w = v
|
|
156
159
|
this.setValue(this.state.value, last) // todo: does need refresh?
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import {NumberUnits} from "./NumberUnits";
|
|
2
|
+
|
|
3
|
+
export function getNumberTransformFunctions(unit: string | undefined, unitType1: string | undefined, targetUnit: string | undefined) {
|
|
4
|
+
const unitType = unit ? Object.entries(NumberUnits).find(([k, v]) => !!v[unit] && (!unitType1 || k === unitType1)) : undefined
|
|
5
|
+
const target = targetUnit !== unit && unitType && targetUnit ? unitType[1][targetUnit] : undefined
|
|
6
|
+
const source = targetUnit !== unit && unitType && unit ? unitType[1][unit] : undefined
|
|
7
|
+
const transformValue = target && source ?
|
|
8
|
+
(v: number) => target.from(source.to(v)) :
|
|
9
|
+
undefined;
|
|
10
|
+
const invTransformValue = target && source ?
|
|
11
|
+
(v: number) => source.from(target.to(v)) :
|
|
12
|
+
undefined;
|
|
13
|
+
return {transformValue, invTransformValue};
|
|
14
|
+
}
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
export interface NumberUnit{
|
|
2
|
+
name: string;
|
|
3
|
+
symbol: string;
|
|
4
|
+
from: (value: number) => number;
|
|
5
|
+
to: (value: number) => number;
|
|
6
|
+
}
|
|
7
|
+
export const NumberUnits: Record<string, Record<string, NumberUnit>> = {
|
|
8
|
+
'distance': {
|
|
9
|
+
'm': {
|
|
10
|
+
'name': 'Meters',
|
|
11
|
+
'symbol': 'm',
|
|
12
|
+
from: (v: number) => v,
|
|
13
|
+
to: (v: number) => v,
|
|
14
|
+
},
|
|
15
|
+
'cm': {
|
|
16
|
+
'name': 'Centimeters',
|
|
17
|
+
'symbol': 'cm',
|
|
18
|
+
from: (v: number) => v / 100,
|
|
19
|
+
to: (v: number) => v * 100,
|
|
20
|
+
},
|
|
21
|
+
'mm': {
|
|
22
|
+
'name': 'Millimeters',
|
|
23
|
+
'symbol': 'mm',
|
|
24
|
+
from: (v: number) => v / 1000,
|
|
25
|
+
to: (v: number) => v * 1000,
|
|
26
|
+
},
|
|
27
|
+
'in': {
|
|
28
|
+
'name': 'Inches',
|
|
29
|
+
'symbol': 'in',
|
|
30
|
+
from: (v: number) => v * 0.0254,
|
|
31
|
+
to: (v: number) => v / 0.0254,
|
|
32
|
+
},
|
|
33
|
+
'ft': {
|
|
34
|
+
'name': 'Feet',
|
|
35
|
+
'symbol': 'ft',
|
|
36
|
+
from: (v: number) => v * 0.3048,
|
|
37
|
+
to: (v: number) => v / 0.3048,
|
|
38
|
+
},
|
|
39
|
+
'km': {
|
|
40
|
+
'name': 'Kilometers',
|
|
41
|
+
'symbol': 'km',
|
|
42
|
+
from: (v: number) => v * 1000,
|
|
43
|
+
to: (v: number) => v / 1000,
|
|
44
|
+
},
|
|
45
|
+
'mi': {
|
|
46
|
+
'name': 'Miles',
|
|
47
|
+
'symbol': 'mi',
|
|
48
|
+
from: (v: number) => v * 1609.34,
|
|
49
|
+
to: (v: number) => v / 1609.34,
|
|
50
|
+
},
|
|
51
|
+
},
|
|
52
|
+
'angle': {
|
|
53
|
+
'rad': {
|
|
54
|
+
'name': 'Radians',
|
|
55
|
+
'symbol': 'rad',
|
|
56
|
+
from: (v: number) => v,
|
|
57
|
+
to: (v: number) => v,
|
|
58
|
+
},
|
|
59
|
+
'deg': {
|
|
60
|
+
'name': 'Degrees',
|
|
61
|
+
'symbol': 'deg',
|
|
62
|
+
from: (v: number) => v * Math.PI / 180,
|
|
63
|
+
to: (v: number) => v * 180 / Math.PI,
|
|
64
|
+
},
|
|
65
|
+
'grad': {
|
|
66
|
+
'name': 'Gradians',
|
|
67
|
+
'symbol': 'grad',
|
|
68
|
+
from: (v: number) => v * Math.PI / 200,
|
|
69
|
+
to: (v: number) => v * 200 / Math.PI,
|
|
70
|
+
},
|
|
71
|
+
},
|
|
72
|
+
'temperature': {
|
|
73
|
+
'celsius': {
|
|
74
|
+
'name': 'Celsius',
|
|
75
|
+
'symbol': '°C',
|
|
76
|
+
from: (v: number) => v,
|
|
77
|
+
to: (v: number) => v,
|
|
78
|
+
},
|
|
79
|
+
'fahrenheit': {
|
|
80
|
+
'name': 'Fahrenheit',
|
|
81
|
+
'symbol': '°F',
|
|
82
|
+
from: (v: number) => (v - 32) * 5 / 9,
|
|
83
|
+
to: (v: number) => v * 9 / 5 + 32,
|
|
84
|
+
},
|
|
85
|
+
'kelvin': {
|
|
86
|
+
'name': 'Kelvin',
|
|
87
|
+
'symbol': 'K',
|
|
88
|
+
from: (v: number) => v - 273.15,
|
|
89
|
+
to: (v: number) => v + 273.15,
|
|
90
|
+
},
|
|
91
|
+
},
|
|
92
|
+
'pixel': {
|
|
93
|
+
'px': {
|
|
94
|
+
'name': 'Pixels',
|
|
95
|
+
'symbol': 'px',
|
|
96
|
+
from: (v: number) => v,
|
|
97
|
+
to: (v: number) => v,
|
|
98
|
+
},
|
|
99
|
+
'dp': {
|
|
100
|
+
'name': 'Density-independent Pixels',
|
|
101
|
+
'symbol': 'dp',
|
|
102
|
+
from: (v: number) => v * window.devicePixelRatio,
|
|
103
|
+
to: (v: number) => v / window.devicePixelRatio,
|
|
104
|
+
},
|
|
105
|
+
// todo
|
|
106
|
+
// 'sp': {
|
|
107
|
+
// 'name': 'Scale-independent Pixels',
|
|
108
|
+
// 'symbol': 'sp',
|
|
109
|
+
// from: (v: number) => {
|
|
110
|
+
// const fontSize = parseFloat(getComputedStyle(document.documentElement).fontSize) / 16;
|
|
111
|
+
// return v * fontSize * window.devicePixelRatio;
|
|
112
|
+
// }
|
|
113
|
+
// },
|
|
114
|
+
// 'rem': {
|
|
115
|
+
// 'name': 'Root em',
|
|
116
|
+
// 'symbol': 'rem',
|
|
117
|
+
// from: (v: number) => {
|
|
118
|
+
// const fontSize = parseFloat(getComputedStyle(document.documentElement).fontSize) / 16;
|
|
119
|
+
// return v * fontSize * window.devicePixelRatio;
|
|
120
|
+
// }
|
|
121
|
+
// }
|
|
122
|
+
}
|
|
123
|
+
}
|
|
@@ -8,6 +8,26 @@ import {OverlayToaster, Toaster} from "@blueprintjs/core";
|
|
|
8
8
|
|
|
9
9
|
// hack for blueprint 5, remove in blueprint 6
|
|
10
10
|
export const AppToasterRef = {ref: null as Toaster | null}
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Usage
|
|
14
|
+
* ```
|
|
15
|
+
* AppToaster().show({
|
|
16
|
+
* message: 'Message',
|
|
17
|
+
* intent: 'primary',
|
|
18
|
+
* icon: "tick",
|
|
19
|
+
* isCloseButtonShown: false,
|
|
20
|
+
* // action: {
|
|
21
|
+
* // onClick: () => {},
|
|
22
|
+
* // text: "Cancel",
|
|
23
|
+
* // },
|
|
24
|
+
* timeout: 5000,
|
|
25
|
+
* }, 'toast-id')
|
|
26
|
+
*
|
|
27
|
+
* AppToaster().dismiss('toast-id')
|
|
28
|
+
* ```
|
|
29
|
+
*
|
|
30
|
+
*/
|
|
11
31
|
export const AppToaster = ()=>AppToasterRef.ref ?? {show: ()=>{}, dismiss: ()=>{}} as any as Toaster
|
|
12
32
|
|
|
13
33
|
/**
|
|
@@ -31,6 +31,7 @@ export function ConfigurationPanelComponent({config}: { config: UiObjectConfig<a
|
|
|
31
31
|
} as Panel<{ config: UiObjectConfig }>
|
|
32
32
|
}, [config])
|
|
33
33
|
const [currentPanelStack, setCurrentPanelStack] = React.useState<Array<Panel<{ config: UiObjectConfig }>>>([stackItem()]);
|
|
34
|
+
const [isMinimized, setIsMinimized] = React.useState(false);
|
|
34
35
|
|
|
35
36
|
React.useEffect(() => {
|
|
36
37
|
setCurrentPanelStack([stackItem()])
|
|
@@ -40,7 +41,7 @@ export function ConfigurationPanelComponent({config}: { config: UiObjectConfig<a
|
|
|
40
41
|
|
|
41
42
|
return (
|
|
42
43
|
<VisualStyleContext.Provider value={{...defaultVisualStyle, ...style}}>
|
|
43
|
-
<Card
|
|
44
|
+
<Card className={`bpInspectorCard ${style.darkMode?Classes.DARK:""}`} style={{display: isMinimized ? 'none' : 'block'}}>
|
|
44
45
|
<PanelStack2 className="inspectorPanelStack"
|
|
45
46
|
showPanelHeader={true}
|
|
46
47
|
renderActivePanelOnly={true}
|
|
@@ -48,16 +49,26 @@ export function ConfigurationPanelComponent({config}: { config: UiObjectConfig<a
|
|
|
48
49
|
onClose={() => setCurrentPanelStack(currentPanelStack.slice(0, -1))}
|
|
49
50
|
stack={currentPanelStack}/>
|
|
50
51
|
<div className={"bpPanelStackHeaderOverlay " + Classes.PANEL_STACK2_HEADER}>
|
|
51
|
-
<Popover targetProps={{style: {position: "absolute", right: "
|
|
52
|
+
<Popover targetProps={{style: {position: "absolute", right: "30px"}}}
|
|
52
53
|
minimal={true}
|
|
53
54
|
targetTagName={"div"}
|
|
54
55
|
content={
|
|
55
56
|
<ThemeSettingsMenuComponent/>
|
|
56
57
|
} placement="bottom">
|
|
57
|
-
<Button icon="
|
|
58
|
+
<Button icon="more" small minimal text="" />
|
|
58
59
|
</Popover>
|
|
60
|
+
<Button icon="minus" small minimal text="" style={{position: "absolute", right: "5px"}}
|
|
61
|
+
onClick={() => {
|
|
62
|
+
setIsMinimized(!isMinimized);
|
|
63
|
+
}}
|
|
64
|
+
/>
|
|
59
65
|
</div>
|
|
60
66
|
</Card>
|
|
67
|
+
{isMinimized && <Button icon="cog" small text="Configuration" style={{position: "absolute", right: "5px"}}
|
|
68
|
+
onClick={() => {
|
|
69
|
+
setIsMinimized(!isMinimized);
|
|
70
|
+
}}
|
|
71
|
+
/>}
|
|
61
72
|
</VisualStyleContext.Provider>
|
|
62
73
|
)
|
|
63
74
|
}
|