@qualtrics/ui-react 2.18.0 → 2.19.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +28 -0
- package/dist/__shared/cjs/{index-00992312.js → index-384184bd.js} +994 -1872
- package/dist/__shared/cjs/{index-615ed9b2.js → index-4a5425cc.js} +10 -7
- package/dist/components/Accordion/Accordion.js +1 -5
- package/dist/components/Accordion/Accordion2.js +3 -3
- package/dist/components/Accordion/AccordionHeader.js +4 -8
- package/dist/components/Accordion/AccordionPanel.js +3 -3
- package/dist/components/BreakpointSwitch/Breakpoint.js +0 -2
- package/dist/components/BreakpointSwitch/BreakpointSwitch.js +0 -3
- package/dist/components/Button/Button.js +3 -3
- package/dist/components/Button/Button2.js +2 -7
- package/dist/components/ButtonGroup/ButtonGroup.js +1 -2
- package/dist/components/ButtonGroup/ButtonGroup2.js +3 -3
- package/dist/components/Checkbox/Checkbox.js +11 -11
- package/dist/components/Checkbox/Checkbox2.js +3 -3
- package/dist/components/Checkbox/VisualCheckbox.js +1 -1
- package/dist/components/Checkbox/VisualCheckbox2.js +3 -3
- package/dist/components/ColorPicker/Alpha.js +9 -30
- package/dist/components/ColorPicker/ColorPicker.js +33 -42
- package/dist/components/ColorPicker/ColorPicker2.js +3 -3
- package/dist/components/ColorPicker/ColorPickerFlyout.js +2 -1
- package/dist/components/ColorPicker/ColorPickerFlyoutInputs.js +20 -23
- package/dist/components/ColorPicker/Hue.js +2 -19
- package/dist/components/ColorPicker/Palette.js +7 -27
- package/dist/components/ColorPicker/Saturation.js +8 -29
- package/dist/components/ColorPicker/utils/calculateTargetId.js +10 -20
- package/dist/components/ColorPicker/utils/getMousePosition.js +4 -3
- package/dist/components/ColorPicker/utils/hexToHsv.js +0 -5
- package/dist/components/ColorPicker/utils/hexToRgbaString.js +2 -4
- package/dist/components/ColorPicker/utils/hsvToHex.js +0 -3
- package/dist/components/ColorPicker/utils/rgbToHex.js +1 -1
- package/dist/components/ColorPicker/utils/validateHex.js +12 -19
- package/dist/components/Combobox/Combobox.js +57 -127
- package/dist/components/Combobox/Combobox2.js +3 -3
- package/dist/components/Combobox/ComboboxHeader.js +1 -1
- package/dist/components/Combobox/ComboboxIcon.js +2 -4
- package/dist/components/Combobox/ComboboxInput.js +4 -5
- package/dist/components/Combobox/ComboboxList.js +2 -2
- package/dist/components/ConfigPane/ConfigPane.js +0 -7
- package/dist/components/ConfigPane/ConfigPane2.js +3 -3
- package/dist/components/Divider/Divider2.js +3 -3
- package/dist/components/Dropdown/ChildIndexContext/index.js +0 -1
- package/dist/components/Dropdown/ChildIndexContext/reach-descendants.js +34 -30
- package/dist/components/Dropdown/Dropdown.js +17 -68
- package/dist/components/Dropdown/Dropdown2.js +3 -3
- package/dist/components/Dropdown/DropdownButton.js +23 -33
- package/dist/components/Dropdown/DropdownHeader.js +2 -1
- package/dist/components/Dropdown/DropdownList.js +8 -7
- package/dist/components/Dropdown/DropdownOption.js +3 -10
- package/dist/components/Dropdown/DropdownSearch.js +6 -24
- package/dist/components/FilePicker/FilePicker.js +15 -26
- package/dist/components/FilePicker/FilePicker2.js +3 -3
- package/dist/components/FormField/Caption.js +3 -3
- package/dist/components/FormField/FormField.js +2 -2
- package/dist/components/FormField/FormField2.js +3 -3
- package/dist/components/FormField/FormFieldContext.js +3 -6
- package/dist/components/FormField/ReadOnlyText.js +2 -1
- package/dist/components/FullScreenTakeover/FullScreenTakeover.js +5 -11
- package/dist/components/FullScreenTakeover/FullScreenTakeover2.js +3 -3
- package/dist/components/Icon/Icon.js +3 -6
- package/dist/components/Icon/IconTypes.js +1 -0
- package/dist/components/IconButton/IconButton.js +1 -6
- package/dist/components/IconButton/IconButton2.js +3 -3
- package/dist/components/InlineInput/InlineInput.js +16 -33
- package/dist/components/InlineInput/InlineInput2.js +3 -3
- package/dist/components/Input/Input.js +3 -2
- package/dist/components/Input/Input2.js +3 -3
- package/dist/components/Input/InputField.js +2 -5
- package/dist/components/InputGroup/InputGroup2.js +3 -3
- package/dist/components/InputGroup/InputGroupProvider.js +0 -2
- package/dist/components/Label/Label2.js +3 -3
- package/dist/components/Link/Link2.js +3 -3
- package/dist/components/LoadingSpinner/LoadingSpinner.js +1 -1
- package/dist/components/LoadingSpinner/LoadingSpinner2.js +3 -3
- package/dist/components/LogicEditor/ConditionContainer.js +0 -2
- package/dist/components/LogicEditor/ConditionSet.js +8 -25
- package/dist/components/LogicEditor/Controls.js +2 -2
- package/dist/components/LogicEditor/LogicEditor.js +3 -12
- package/dist/components/LogicEditor/LogicEditor2.js +3 -3
- package/dist/components/LogicEditor/utils.js +9 -34
- package/dist/components/Modal/Modal.js +22 -35
- package/dist/components/Modal/Modal2.js +3 -3
- package/dist/components/NewMenu/BaseMenu.js +43 -108
- package/dist/components/NewMenu/NewMenu.js +3 -3
- package/dist/components/NewMenu/SelectMenu/SelectMenu.js +2 -3
- package/dist/components/NewMenu/parts/ArrowNav/ArrowNav.js +20 -32
- package/dist/components/NewMenu/parts/MenuItem.js +2 -3
- package/dist/components/NewMenu/parts/MenuSearchBox.js +2 -1
- package/dist/components/NumberStepper/NumberStepper.js +29 -44
- package/dist/components/NumberStepper/NumberStepper2.js +3 -3
- package/dist/components/NumberStepper/NumberStepperDecrement.js +6 -5
- package/dist/components/NumberStepper/NumberStepperIncrement.js +6 -5
- package/dist/components/NumberStepper/NumberStepperInput.js +10 -12
- package/dist/components/PageLayout/PageLayout.js +3 -3
- package/dist/components/Pagination/Pagination.js +10 -6
- package/dist/components/Pagination/Pagination2.js +3 -3
- package/dist/components/Pagination/PaginationNextButton.js +8 -8
- package/dist/components/Pagination/PaginationPageInput.js +17 -22
- package/dist/components/Pagination/PaginationPreviousButton.js +8 -8
- package/dist/components/Popover/Popover.js +9 -18
- package/dist/components/Popover/Popover2.js +3 -3
- package/dist/components/QuickSearch/QuickSearch.js +3 -5
- package/dist/components/QuickSearch/QuickSearch2.js +3 -3
- package/dist/components/QuickSearch/QuickSearchInput.js +6 -23
- package/dist/components/Radio/Radio.js +11 -13
- package/dist/components/Radio/Radio2.js +3 -3
- package/dist/components/SearchInput/SearchInput.js +5 -11
- package/dist/components/SearchInput/SearchInput2.js +3 -3
- package/dist/components/SidebarNav/ExpandCollapseButton.js +0 -2
- package/dist/components/SidebarNav/SidebarNav.js +5 -4
- package/dist/components/SidebarNav/SidebarNav2.js +3 -3
- package/dist/components/SidebarNav/SidebarNavLink.js +1 -4
- package/dist/components/Slider/RangeSlider.js +8 -22
- package/dist/components/Slider/Slider.js +7 -26
- package/dist/components/Slider/Slider2.js +3 -3
- package/dist/components/Slider/SliderButton.js +7 -9
- package/dist/components/Switch/Switch.js +11 -11
- package/dist/components/Switch/Switch2.js +3 -3
- package/dist/components/Table/Table2.js +3 -3
- package/dist/components/Tabs/Tab.js +3 -3
- package/dist/components/Tabs/TabContextProvider.js +1 -1
- package/dist/components/Tabs/TabList.js +9 -17
- package/dist/components/Tabs/TabPanel.js +3 -3
- package/dist/components/Tabs/TabPanels.js +0 -2
- package/dist/components/Tabs/Tabs2.js +3 -3
- package/dist/components/Tooltip/Tooltip.js +12 -41
- package/dist/components/Tooltip/Tooltip2.js +3 -3
- package/dist/components/UIProvider/PortalTargetContext.js +0 -1
- package/dist/components/UIProvider/UIProvider.js +2 -2
- package/dist/components/deprecated_ColorPicker/Alpha.js +4 -11
- package/dist/components/deprecated_ColorPicker/Color.js +9 -66
- package/dist/components/deprecated_ColorPicker/ColorPicker.js +2 -8
- package/dist/components/deprecated_ColorPicker/ColorPicker2.js +3 -3
- package/dist/components/deprecated_ColorPicker/HexInput.js +1 -7
- package/dist/components/deprecated_ColorPicker/Hue.js +3 -10
- package/dist/components/deprecated_ColorPicker/Saturation.js +7 -14
- package/dist/components/deprecated_ColorPicker/Swatch.js +2 -6
- package/dist/components/deprecated_ColorPicker/useMouseDrag.js +0 -3
- package/dist/components/deprecated_NumberStepper/NumberStepper.js +14 -20
- package/dist/components/deprecated_NumberStepper/NumberStepper2.js +3 -3
- package/dist/components/deprecated_NumberStepper/NumberStepperDecrement.js +7 -6
- package/dist/components/deprecated_NumberStepper/NumberStepperIncrement.js +7 -6
- package/dist/components/deprecated_NumberStepper/NumberStepperInput.js +16 -17
- package/dist/components/deprecated_Tabs/Tabs.js +9 -25
- package/dist/components/deprecated_Tabs/Tabs2.js +3 -3
- package/dist/components/deprecated_Toolbar/Toolbar2.js +3 -3
- package/dist/components/deprecated_Toolbar/ToolbarPanel.js +3 -3
- package/dist/components/deprecated_Toolbar/ToolbarPanels.js +3 -17
- package/dist/components/deprecated_Toolbar/ToolbarTab.js +10 -26
- package/dist/components/deprecated_Toolbar/ToolbarTabs.js +6 -18
- package/dist/hooks/useBreakpoints/useBreakpoints.js +3 -4
- package/dist/hooks/useClickOutside/useClickOutside.js +2 -7
- package/dist/hooks/useClickOutsidePortals/useClickOutsidePortals.js +3 -6
- package/dist/hooks/useControllableState/useControllableState.js +5 -10
- package/dist/hooks/useDidUpdate/useDidUpdate.js +2 -4
- package/dist/hooks/useEventCallback/useEventCallback.js +2 -1
- package/dist/hooks/useEventListener/useEventListener.js +1 -4
- package/dist/hooks/useFocusSequence/useFocusSequence.js +10 -17
- package/dist/hooks/useId/useId.js +1 -2
- package/dist/hooks/useIsFocused/useIsFocused.js +0 -1
- package/dist/hooks/useIsHovered/useIsHovered.js +0 -1
- package/dist/hooks/useIsTruncated/useIsTruncated.js +4 -3
- package/dist/hooks/useLatest/useLatest.js +0 -1
- package/dist/hooks/useMounted/useMounted.js +0 -1
- package/dist/hooks/useMouseDrag/useMouseDrag.js +0 -4
- package/dist/hooks/useOverlay/useOverlay.js +4 -10
- package/dist/hooks/useOverlay/useOverlay2.js +3 -3
- package/dist/hooks/usePrevious/usePrevious.js +0 -1
- package/dist/hooks/useResponsiveValue/useResponsiveValue.js +1 -4
- package/dist/hooks/useScreenReaderAnnouncement/useScreenReaderAnnouncement.js +11 -16
- package/dist/hooks/useScreenReaderAnnouncement/useScreenReaderAnnouncement2.js +3 -3
- package/dist/icons/Icon.js +3 -3
- package/dist/icons/components/HeadsetIcon.js +6 -0
- package/dist/icons/components/PauseCircleIcon.js +1 -1
- package/dist/icons/createIconComponent.js +2 -3
- package/dist/icons/index.d.ts +2 -0
- package/dist/icons/index.es.js +1 -0
- package/dist/icons/index.js +2 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.es.js +4 -3
- package/dist/index.js +6 -5
- package/dist/next/AdvancedTable/AdvancedTable.js +82 -188
- package/dist/next/AdvancedTable/AdvancedTable2.js +3 -3
- package/dist/next/AdvancedTable/AdvancedTableCell.js +4 -14
- package/dist/next/AdvancedTable/AdvancedTableCheckbox.js +0 -1
- package/dist/next/AdvancedTable/AdvancedTableColumnHeader.js +11 -41
- package/dist/next/AdvancedTable/AdvancedTableColumnHeaderMenu.js +8 -14
- package/dist/next/AdvancedTable/AdvancedTableDragPreview.js +4 -6
- package/dist/next/AdvancedTable/AdvancedTablePagination.js +1 -4
- package/dist/next/AdvancedTable/AdvancedTableRowExpandButton.js +0 -1
- package/dist/next/AdvancedTable/AdvancedTableTypes.js +1 -3
- package/dist/next/AdvancedTable/useAdvancedTableDragAndDrop.js +8 -13
- package/dist/next/AdvancedTable/useComputedWidth.js +1 -1
- package/dist/next/CollapsibleSearchInput/CollapsibleSearchInput.js +5 -20
- package/dist/next/CollapsibleSearchInput/CollapsibleSearchInput2.js +3 -3
- package/dist/next/CollapsibleSearchInput/CollapsibleSearchInputIconButton.js +1 -1
- package/dist/next/Combobox/Combobox2.js +3 -3
- package/dist/next/Combobox/ComboboxFlyout.js +3 -3
- package/dist/next/Combobox/ComboboxGroup.js +1 -1
- package/dist/next/Combobox/ComboboxInput.js +7 -20
- package/dist/next/Combobox/ComboboxOption.js +5 -6
- package/dist/next/Combobox/hooks/useComboboxFilteredGroup/useComboboxFilteredGroup.js +4 -5
- package/dist/next/Combobox/hooks/useComboboxFocusSequence/useComboboxFocusSequence.js +37 -54
- package/dist/next/Combobox/hooks/useComboboxLoadingState/useComboboxLoadingState.js +4 -5
- package/dist/next/Combobox/hooks/useComboboxValue/useComboboxValue.js +5 -3
- package/dist/next/Combobox/hooks/useListboxFlyoutDimensions/useListboxFlyoutDimensions.js +10 -10
- package/dist/next/Combobox/hooks/useSelectedOptionScroll/useSelectedOptionScroll.js +1 -6
- package/dist/next/Combobox/hooks/useShouldRenderGroupHeader/useShouldRenderGroupHeader.js +6 -6
- package/dist/next/Combobox/utils/nodeRegistration/nodeRegistration.js +4 -6
- package/dist/next/Drawer/Drawer.js +5 -16
- package/dist/next/Drawer/Drawer2.js +3 -3
- package/dist/next/FilterAnchor/FilterAnchor.js +7 -5
- package/dist/next/FilterAnchor/FilterAnchor2.js +3 -3
- package/dist/next/Input/Input.js +5 -8
- package/dist/next/Input/Input2.js +3 -3
- package/dist/next/Menu/Menu.js +10 -23
- package/dist/next/Menu/Menu2.js +3 -3
- package/dist/next/Menu/MenuContext.js +0 -2
- package/dist/next/Menu/MenuItem.js +11 -15
- package/dist/next/Menu/MenuPane.js +11 -25
- package/dist/next/Menu/MenuSearch.js +15 -22
- package/dist/next/Menu/SubMenu.js +10 -27
- package/dist/next/Menu/usePaneSearch.js +2 -1
- package/dist/next/PhoneNumberInput/PhoneNumberInput.js +12 -19
- package/dist/next/PhoneNumberInput/PhoneNumberInput2.js +3 -3
- package/dist/next/SplitButton/SplitButton.js +6 -12
- package/dist/next/SplitButton/SplitButton2.js +3 -3
- package/dist/next/Stack/HStack.js +11 -0
- package/dist/next/Stack/Stack.js +95 -0
- package/dist/next/Stack/StackItem.js +37 -0
- package/dist/next/Stack/VStack.js +11 -0
- package/dist/next/Stack/index.js +3 -0
- package/dist/next/TimePicker/TimeDropdown.js +4 -5
- package/dist/next/TimePicker/TimeInput.js +4 -5
- package/dist/next/TimePicker/TimePicker.js +12 -30
- package/dist/next/TimePicker/TimePicker2.js +3 -3
- package/dist/next/TimePicker/TimePickerIcon.js +1 -3
- package/dist/next/TimePicker/utils.js +12 -52
- package/dist/next/ToggleButton/ToggleButton.js +0 -5
- package/dist/next/ToggleButton/ToggleButtonGroup.js +2 -1
- package/dist/next/ToggleButton/styles.js +3 -3
- package/dist/next/index.d.ts +82 -4
- package/dist/next/index.es.js +4 -0
- package/dist/next/index.js +514 -745
- package/dist/utils/Flyout/Flyout.js +4 -5
- package/dist/utils/Flyout/Flyout2.js +3 -3
- package/dist/utils/Popper/Popper.js +18 -25
- package/dist/utils/Portal/Portal.js +2 -1
- package/dist/utils/TextOverflowTooltip/TextOverflowTooltip.js +4 -4
- package/dist/utils/Translation/Translate.js +0 -4
- package/dist/utils/Translation/TranslationProvider.js +0 -1
- package/dist/utils/Translation/containsComponentOrElement.js +1 -5
- package/dist/utils/Translation/insertPlaceholders.js +0 -1
- package/dist/utils/Translation/useTranslation.js +7 -14
- package/dist/utils/concatIds/concatIds.js +0 -1
- package/dist/utils/constants.js +2 -2
- package/dist/utils/createContextUtilities/createContextUtilities.js +0 -4
- package/dist/utils/filterChildren/filterChildren.js +8 -17
- package/dist/utils/getSubDataTestId/getSubDataTestId.js +1 -2
- package/dist/utils/keyboardUser/keyboardUser.js +0 -1
- package/dist/utils/mediaQueryManager/mediaQueryManager.js +1 -12
- package/dist/utils/mergeRefs/mergeRefs.js +1 -2
- package/dist/utils/wrapAround/wrapAround.js +1 -2
- package/dist/utils/wrapEvent/wrapEvent.js +2 -4
- package/icons/package.json +3 -2
- package/next/package.json +6 -2
- package/package.json +10 -5
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import styleInject from './../../__node_modules/style-inject/dist/style-inject.es.js';
|
|
2
2
|
|
|
3
|
-
var css_248z = ".
|
|
4
|
-
var styles = {"input":"
|
|
5
|
-
var stylesheet=".
|
|
3
|
+
var css_248z = "._xirfn{display:inline-block;height:36px;min-height:36px;padding:8px 12px;line-height:20px;font-size:14px;color:#32363a;caret-color:#32363a;background-color:#fafafa;border:1px solid #898989;border-radius:4px;outline:none}._xirfn::-moz-placeholder{color:#515559;opacity:1}._xirfn::placeholder{color:#515559;opacity:1}._xirfn:hover{cursor:pointer;background-color:#f5f5f5}._xirfn:focus{box-shadow:0 0 0 2px #fff,0 0 0 4px #0a3f88;background-color:#fafafa;cursor:text;outline:none;border-color:transparent}._xirfn._tv5wn{border-color:#b00}._xirfn._tv5wn:focus{box-shadow:0 0 0 2px #fff,0 0 0 4px #900000;border-color:transparent}._xirfn:disabled{background-color:#fafafa;border-color:#e5e5e5;color:#9d9fa1;-webkit-text-fill-color:#9d9fa1;cursor:not-allowed}._xirfn:disabled::-moz-placeholder{color:#aaabad;-webkit-text-fill-color:#aaabad}._xirfn:disabled::placeholder{color:#aaabad;-webkit-text-fill-color:#aaabad}._xirfn._6R88b{height:auto}._xirfn._6R88b::-webkit-resizer{background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iOCIgaGVpZ2h0PSI4IiBmaWxsPSJub25lIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxwYXRoIGQ9Ik03IDF2M2EzIDMgMCAwMS0zIDNIMSIgc3Ryb2tlPSIjOTI5MjkyIiBzdHJva2Utd2lkdGg9IjIiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIvPjwvc3ZnPg==);background-size:8px 8px;background-repeat:no-repeat;background-position:50%}._xirfn._rLWcU{display:block;width:100%}._xirfn._ea-NX{padding:4px 8px}input._xirfn._ea-NX{height:26px;min-height:26px}[type=number]._xirfn{-moz-appearance:textfield}[type=number]._xirfn::-webkit-inner-spin-button,[type=number]._xirfn::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}._CVy4p{line-height:20px;color:#6a6d70;display:flex;flex-direction:column;align-items:flex-start}._CVy4p:hover{cursor:pointer}._CVy4p._CiKQA{color:#0b6ed0}._5C-1b{margin-top:4px}";
|
|
4
|
+
var styles = {"input":"_xirfn","invalid":"_tv5wn","multiline":"_6R88b","full":"_rLWcU","small":"_ea-NX","label":"_CVy4p","focused":"_CiKQA","wrappedInput":"_5C-1b"};
|
|
5
|
+
var stylesheet="._xirfn{display:inline-block;height:36px;min-height:36px;padding:8px 12px;line-height:20px;font-size:14px;color:#32363a;caret-color:#32363a;background-color:#fafafa;border:1px solid #898989;border-radius:4px;outline:none}._xirfn::-moz-placeholder{color:#515559;opacity:1}._xirfn::placeholder{color:#515559;opacity:1}._xirfn:hover{cursor:pointer;background-color:#f5f5f5}._xirfn:focus{box-shadow:0 0 0 2px #fff,0 0 0 4px #0a3f88;background-color:#fafafa;cursor:text;outline:none;border-color:transparent}._xirfn._tv5wn{border-color:#b00}._xirfn._tv5wn:focus{box-shadow:0 0 0 2px #fff,0 0 0 4px #900000;border-color:transparent}._xirfn:disabled{background-color:#fafafa;border-color:#e5e5e5;color:#9d9fa1;-webkit-text-fill-color:#9d9fa1;cursor:not-allowed}._xirfn:disabled::-moz-placeholder{color:#aaabad;-webkit-text-fill-color:#aaabad}._xirfn:disabled::placeholder{color:#aaabad;-webkit-text-fill-color:#aaabad}._xirfn._6R88b{height:auto}._xirfn._6R88b::-webkit-resizer{background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iOCIgaGVpZ2h0PSI4IiBmaWxsPSJub25lIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxwYXRoIGQ9Ik03IDF2M2EzIDMgMCAwMS0zIDNIMSIgc3Ryb2tlPSIjOTI5MjkyIiBzdHJva2Utd2lkdGg9IjIiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIvPjwvc3ZnPg==);background-size:8px 8px;background-repeat:no-repeat;background-position:50%}._xirfn._rLWcU{display:block;width:100%}._xirfn._ea-NX{padding:4px 8px}input._xirfn._ea-NX{height:26px;min-height:26px}[type=number]._xirfn{-moz-appearance:textfield}[type=number]._xirfn::-webkit-inner-spin-button,[type=number]._xirfn::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}._CVy4p{line-height:20px;color:#6a6d70;display:flex;flex-direction:column;align-items:flex-start}._CVy4p:hover{cursor:pointer}._CVy4p._CiKQA{color:#0b6ed0}._5C-1b{margin-top:4px}";
|
|
6
6
|
styleInject(css_248z);
|
|
7
7
|
|
|
8
8
|
export { styles as default, stylesheet };
|
|
@@ -30,17 +30,14 @@ const InputField = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
|
|
|
30
30
|
} = inputProps;
|
|
31
31
|
const [focused, setFocused] = useState(false);
|
|
32
32
|
useFormFieldType('input');
|
|
33
|
-
|
|
34
33
|
function handleFocus(e) {
|
|
35
34
|
setFocused(true);
|
|
36
|
-
onFocus
|
|
35
|
+
onFocus?.(e);
|
|
37
36
|
}
|
|
38
|
-
|
|
39
37
|
function handleBlur(e) {
|
|
40
38
|
setFocused(false);
|
|
41
|
-
onBlur
|
|
39
|
+
onBlur?.(e);
|
|
42
40
|
}
|
|
43
|
-
|
|
44
41
|
return /*#__PURE__*/React__default.createElement(Label, _extends({
|
|
45
42
|
htmlFor: id,
|
|
46
43
|
"data-testid": dataTestId,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import styleInject from './../../__node_modules/style-inject/dist/style-inject.es.js';
|
|
2
2
|
|
|
3
|
-
var css_248z = ".
|
|
4
|
-
var styles = {"addon":"
|
|
5
|
-
var stylesheet=".
|
|
3
|
+
var css_248z = "._ZQ1Pd{border:1px solid #898989;border-radius:4px;height:36px;min-height:36px;color:#6a6d70;fill:#6a6d70;background-color:#fafafa;font-size:14px;display:inline-flex;justify-content:center;align-items:center;line-height:1;padding:0 13px}._ZQ1Pd._g7n45{height:26px;min-height:26px;padding:5px 8px}._K5Qik{display:flex;align-items:stretch}._K5Qik._TqWCc{width:100%}._K5Qik ._DPNLz{margin:0;position:relative;flex-shrink:0;z-index:10}._K5Qik ._DPNLz:first-child{margin:0 -1px 0 0;border-top-left-radius:4px;border-bottom-left-radius:4px;border-top-right-radius:0;border-bottom-right-radius:0}._K5Qik ._DPNLz:not(:last-child):not(:first-child){margin:0 -1px 0 0;border-radius:0}._K5Qik ._DPNLz:last-child{border-top-left-radius:0;border-bottom-left-radius:0}._K5Qik ._DPNLz:last-child,._K5Qik ._DPNLz:only-child{margin:0;border-top-right-radius:4px;border-bottom-right-radius:4px}._K5Qik ._DPNLz:only-child{border-top-left-radius:4px;border-bottom-left-radius:4px}._K5Qik ._DPNLz._05XVu{flex-shrink:1;min-width:40px;z-index:0}._K5Qik ._DPNLz._05XVu._TqWCc{flex-grow:1}._K5Qik ._DPNLz:focus{z-index:20}";
|
|
4
|
+
var styles = {"addon":"_ZQ1Pd","small":"_g7n45","inputGroup":"_K5Qik","full":"_TqWCc","inputGroupElement":"_DPNLz","input":"_05XVu"};
|
|
5
|
+
var stylesheet="._ZQ1Pd{border:1px solid #898989;border-radius:4px;height:36px;min-height:36px;color:#6a6d70;fill:#6a6d70;background-color:#fafafa;font-size:14px;display:inline-flex;justify-content:center;align-items:center;line-height:1;padding:0 13px}._ZQ1Pd._g7n45{height:26px;min-height:26px;padding:5px 8px}._K5Qik{display:flex;align-items:stretch}._K5Qik._TqWCc{width:100%}._K5Qik ._DPNLz{margin:0;position:relative;flex-shrink:0;z-index:10}._K5Qik ._DPNLz:first-child{margin:0 -1px 0 0;border-top-left-radius:4px;border-bottom-left-radius:4px;border-top-right-radius:0;border-bottom-right-radius:0}._K5Qik ._DPNLz:not(:last-child):not(:first-child){margin:0 -1px 0 0;border-radius:0}._K5Qik ._DPNLz:last-child{border-top-left-radius:0;border-bottom-left-radius:0}._K5Qik ._DPNLz:last-child,._K5Qik ._DPNLz:only-child{margin:0;border-top-right-radius:4px;border-bottom-right-radius:4px}._K5Qik ._DPNLz:only-child{border-top-left-radius:4px;border-bottom-left-radius:4px}._K5Qik ._DPNLz._05XVu{flex-shrink:1;min-width:40px;z-index:0}._K5Qik ._DPNLz._05XVu._TqWCc{flex-grow:1}._K5Qik ._DPNLz:focus{z-index:20}";
|
|
6
6
|
styleInject(css_248z);
|
|
7
7
|
|
|
8
8
|
export { styles as default, stylesheet };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import styleInject from './../../__node_modules/style-inject/dist/style-inject.es.js';
|
|
2
2
|
|
|
3
|
-
var css_248z = ".
|
|
4
|
-
var styles = {"label":"
|
|
5
|
-
var stylesheet=".
|
|
3
|
+
var css_248z = "._wduwF{font-size:14px}._R48TU{color:#6a6d70;line-height:20px;display:inline-flex;flex-direction:column;align-items:flex-start}._uR-6y{color:#0b6ed0}";
|
|
4
|
+
var styles = {"label":"_wduwF","control":"_R48TU","focused":"_uR-6y"};
|
|
5
|
+
var stylesheet="._wduwF{font-size:14px}._R48TU{color:#6a6d70;line-height:20px;display:inline-flex;flex-direction:column;align-items:flex-start}._uR-6y{color:#0b6ed0}";
|
|
6
6
|
styleInject(css_248z);
|
|
7
7
|
|
|
8
8
|
export { styles as default, stylesheet };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import styleInject from './../../__node_modules/style-inject/dist/style-inject.es.js';
|
|
2
2
|
|
|
3
|
-
var css_248z = ".
|
|
4
|
-
var styles = {"link":"
|
|
5
|
-
var stylesheet=".
|
|
3
|
+
var css_248z = "._WRBye{color:#0b6ed0;cursor:pointer;text-decoration:underline;text-decoration-thickness:1px;-webkit-text-decoration-skip:ink;text-decoration-skip-ink:auto;text-underline-offset:3px;border-radius:1px}._WRBye:active:focus,._WRBye:focus{outline:none}._WRBye:visited{color:#0854a1}._WRBye:hover{color:#085caf}._WRBye:active{color:#0854a1}body.keyboard-user ._WRBye:active:focus,body.keyboard-user ._WRBye:focus{box-shadow:0 0 0 2px #fff,0 0 0 4px #0a3f88}";
|
|
4
|
+
var styles = {"link":"_WRBye"};
|
|
5
|
+
var stylesheet="._WRBye{color:#0b6ed0;cursor:pointer;text-decoration:underline;text-decoration-thickness:1px;-webkit-text-decoration-skip:ink;text-decoration-skip-ink:auto;text-underline-offset:3px;border-radius:1px}._WRBye:active:focus,._WRBye:focus{outline:none}._WRBye:visited{color:#0854a1}._WRBye:hover{color:#085caf}._WRBye:active{color:#0854a1}body.keyboard-user ._WRBye:active:focus,body.keyboard-user ._WRBye:focus{box-shadow:0 0 0 2px #fff,0 0 0 4px #0a3f88}";
|
|
6
6
|
styleInject(css_248z);
|
|
7
7
|
|
|
8
8
|
export { styles as default, stylesheet };
|
|
@@ -36,7 +36,7 @@ const LoadingSpinner = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
|
|
|
36
36
|
}),
|
|
37
37
|
"data-loadingspinner": show || undefined,
|
|
38
38
|
role: role,
|
|
39
|
-
"aria-label": ariaLabel
|
|
39
|
+
"aria-label": ariaLabel ?? (ariaLabelledby ? undefined : defaultAriaLabel),
|
|
40
40
|
"aria-labelledby": ariaLabelledby,
|
|
41
41
|
"aria-live": ariaLive,
|
|
42
42
|
"aria-hidden": ariaHidden
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import styleInject from './../../__node_modules/style-inject/dist/style-inject.es.js';
|
|
2
2
|
|
|
3
|
-
var css_248z = ".
|
|
4
|
-
var styles = {"spinnerContainer":"
|
|
5
|
-
var stylesheet=".
|
|
3
|
+
var css_248z = "._q2vOn{position:relative;display:inline-block}._q2vOn._Mbsuo{min-height:20px;min-width:20px}._q2vOn._T3uQ4{min-height:25px;min-width:25px}._q2vOn._GmT2j{min-height:40px;min-width:40px}._q2vOn._lds3D{min-height:64px;min-width:64px}._q2vOn ._gEaJH{display:inline-block;background-color:transparent;position:absolute;z-index:10;width:0;height:0;left:50%;bottom:50%;pointer-events:none}._q2vOn ._gEaJH._0Uj-8{visibility:hidden}._q2vOn ._gEaJH div{position:absolute;transform:rotate(20deg)}._q2vOn ._gEaJH div div:nth-child(-n+9){background-color:#fff;transform-origin:0 0;animation:_gEaJH .8s linear infinite}._q2vOn ._gEaJH div div:nth-child(-n+9):after{content:\" \";display:block;position:absolute;top:5px;left:-1px;width:2px;height:10px;border-radius:20%;background:#000}._q2vOn ._gEaJH div div:first-child{transform:rotate(20deg);animation-delay:-.8s}._q2vOn ._gEaJH div div:nth-child(2){transform:rotate(60deg);animation-delay:-.7s}._q2vOn ._gEaJH div div:nth-child(3){transform:rotate(100deg);animation-delay:-.6s}._q2vOn ._gEaJH div div:nth-child(4){transform:rotate(140deg);animation-delay:-.5s}._q2vOn ._gEaJH div div:nth-child(5){transform:rotate(180deg);animation-delay:-.4s}._q2vOn ._gEaJH div div:nth-child(6){transform:rotate(220deg);animation-delay:-.3s}._q2vOn ._gEaJH div div:nth-child(7){transform:rotate(260deg);animation-delay:-.2s}._q2vOn ._gEaJH div div:nth-child(8){transform:rotate(300deg);animation-delay:-.1s}._q2vOn ._gEaJH div div:nth-child(9){transform:rotate(340deg);animation-delay:0s}._q2vOn ._lds3D div div:nth-child(-n+9):after{top:10px;left:-2px;width:4px;height:18px}._q2vOn ._Mbsuo div div:nth-child(-n+9):after{top:2px;left:-1px;width:1.5px;height:6px}._q2vOn ._T3uQ4 div div:nth-child(-n+9):after{top:4px;left:-1px;width:2px;height:7px}._q2vOn ._M7Ba5 div div:nth-child(-n+9):after{background:#fff}._q2vOn ._uLzdY{width:100%;height:100%}._q2vOn ._uLzdY._SZhRC{pointer-events:none}._q2vOn ._uLzdY._0Uj-8{opacity:0}._q2vOn ._uLzdY._qQMOd{opacity:.5}@keyframes _gEaJH{0%{opacity:1}to{opacity:0}}";
|
|
4
|
+
var styles = {"spinnerContainer":"_q2vOn","xs":"_Mbsuo","small":"_T3uQ4","medium":"_GmT2j","large":"_lds3D","spinnerComponent":"_gEaJH","hide":"_0Uj-8","inverted":"_M7Ba5","spinnerContent":"_uLzdY","disablePointerEvents":"_SZhRC","fade":"_qQMOd"};
|
|
5
|
+
var stylesheet="._q2vOn{position:relative;display:inline-block}._q2vOn._Mbsuo{min-height:20px;min-width:20px}._q2vOn._T3uQ4{min-height:25px;min-width:25px}._q2vOn._GmT2j{min-height:40px;min-width:40px}._q2vOn._lds3D{min-height:64px;min-width:64px}._q2vOn ._gEaJH{display:inline-block;background-color:transparent;position:absolute;z-index:10;width:0;height:0;left:50%;bottom:50%;pointer-events:none}._q2vOn ._gEaJH._0Uj-8{visibility:hidden}._q2vOn ._gEaJH div{position:absolute;transform:rotate(20deg)}._q2vOn ._gEaJH div div:nth-child(-n+9){background-color:#fff;transform-origin:0 0;animation:_gEaJH .8s linear infinite}._q2vOn ._gEaJH div div:nth-child(-n+9):after{content:\" \";display:block;position:absolute;top:5px;left:-1px;width:2px;height:10px;border-radius:20%;background:#000}._q2vOn ._gEaJH div div:first-child{transform:rotate(20deg);animation-delay:-.8s}._q2vOn ._gEaJH div div:nth-child(2){transform:rotate(60deg);animation-delay:-.7s}._q2vOn ._gEaJH div div:nth-child(3){transform:rotate(100deg);animation-delay:-.6s}._q2vOn ._gEaJH div div:nth-child(4){transform:rotate(140deg);animation-delay:-.5s}._q2vOn ._gEaJH div div:nth-child(5){transform:rotate(180deg);animation-delay:-.4s}._q2vOn ._gEaJH div div:nth-child(6){transform:rotate(220deg);animation-delay:-.3s}._q2vOn ._gEaJH div div:nth-child(7){transform:rotate(260deg);animation-delay:-.2s}._q2vOn ._gEaJH div div:nth-child(8){transform:rotate(300deg);animation-delay:-.1s}._q2vOn ._gEaJH div div:nth-child(9){transform:rotate(340deg);animation-delay:0s}._q2vOn ._lds3D div div:nth-child(-n+9):after{top:10px;left:-2px;width:4px;height:18px}._q2vOn ._Mbsuo div div:nth-child(-n+9):after{top:2px;left:-1px;width:1.5px;height:6px}._q2vOn ._T3uQ4 div div:nth-child(-n+9):after{top:4px;left:-1px;width:2px;height:7px}._q2vOn ._M7Ba5 div div:nth-child(-n+9):after{background:#fff}._q2vOn ._uLzdY{width:100%;height:100%}._q2vOn ._uLzdY._SZhRC{pointer-events:none}._q2vOn ._uLzdY._0Uj-8{opacity:0}._q2vOn ._uLzdY._qQMOd{opacity:.5}@keyframes _gEaJH{0%{opacity:1}to{opacity:0}}";
|
|
6
6
|
styleInject(css_248z);
|
|
7
7
|
|
|
8
8
|
export { styles as default, stylesheet };
|
|
@@ -14,7 +14,6 @@ const ConditionContainer = function ConditionContainer(_ref) {
|
|
|
14
14
|
conditionTemplate: ConditionTemplate,
|
|
15
15
|
onConditionChange
|
|
16
16
|
} = useLogicEditorContext();
|
|
17
|
-
|
|
18
17
|
const handleChange = value => {
|
|
19
18
|
onConditionChange({
|
|
20
19
|
id: condition.id,
|
|
@@ -22,7 +21,6 @@ const ConditionContainer = function ConditionContainer(_ref) {
|
|
|
22
21
|
value
|
|
23
22
|
}, position);
|
|
24
23
|
};
|
|
25
|
-
|
|
26
24
|
return /*#__PURE__*/React__default.createElement("div", {
|
|
27
25
|
className: styles.condition
|
|
28
26
|
}, /*#__PURE__*/React__default.createElement(ConditionTemplate, {
|
|
@@ -38,7 +38,6 @@ const ConditionSet = function ConditionSet(_ref) {
|
|
|
38
38
|
const conditionRef = React__default.useRef(null);
|
|
39
39
|
const lastConnectionRef = React__default.useRef();
|
|
40
40
|
const lastItemRef = React__default.useRef();
|
|
41
|
-
|
|
42
41
|
function setupLastLine() {
|
|
43
42
|
if (lastConnectionRef.current && conditionRef.current && lastItemRef.current) {
|
|
44
43
|
let {
|
|
@@ -47,58 +46,49 @@ const ConditionSet = function ConditionSet(_ref) {
|
|
|
47
46
|
const {
|
|
48
47
|
height: lastItemHeight
|
|
49
48
|
} = lastItemRef.current.getBoundingClientRect();
|
|
50
|
-
|
|
51
49
|
if (lastItemHeight > 52) {
|
|
52
50
|
height -= lastItemHeight - 52;
|
|
53
|
-
|
|
54
51
|
if (fixedSet) {
|
|
55
52
|
height -= 18;
|
|
56
53
|
}
|
|
57
54
|
}
|
|
58
|
-
|
|
59
55
|
if (fixedSet) {
|
|
60
|
-
lastConnectionRef.current.style.height =
|
|
61
|
-
lastConnectionRef.current.style.top =
|
|
56
|
+
lastConnectionRef.current.style.height = `${height - 38}px`;
|
|
57
|
+
lastConnectionRef.current.style.top = `-${height - 56}px`;
|
|
62
58
|
} else {
|
|
63
|
-
lastConnectionRef.current.style.height =
|
|
64
|
-
lastConnectionRef.current.style.top =
|
|
59
|
+
lastConnectionRef.current.style.height = `${height - 18}px`;
|
|
60
|
+
lastConnectionRef.current.style.top = `-${height - 52}px`;
|
|
65
61
|
}
|
|
66
62
|
}
|
|
67
63
|
}
|
|
68
|
-
|
|
69
64
|
useEventListener(window, 'resize', setupLastLine);
|
|
70
65
|
React__default.useLayoutEffect(setupLastLine);
|
|
71
|
-
|
|
72
66
|
const handleNewLogicItem = (item, newItemIndex) => () => {
|
|
73
67
|
onNewLogicItem(item, {
|
|
74
68
|
parent: position,
|
|
75
69
|
index: newItemIndex
|
|
76
70
|
});
|
|
77
71
|
};
|
|
72
|
+
|
|
78
73
|
/**
|
|
79
74
|
* Returns a data-testid unique to the current position in the tree.
|
|
80
75
|
* @param prefix - A string that is injected between the root data-testid and the index list.
|
|
81
76
|
* @returns A `-` separated string of indices where the left-most number is the root index and the right-most number is the index of the current controls menu. The string is prefixed with the root data-testid and the string passed to `prefix`;
|
|
82
77
|
*/
|
|
83
|
-
|
|
84
|
-
|
|
85
78
|
const getDataTestId = useCallback((prefix, elementPosition) => {
|
|
86
79
|
const indices = [elementPosition.index];
|
|
87
80
|
let currentParent = elementPosition.parent;
|
|
88
|
-
|
|
89
81
|
while (currentParent) {
|
|
90
82
|
indices.unshift(currentParent.index);
|
|
91
83
|
currentParent = currentParent.parent;
|
|
92
|
-
}
|
|
93
|
-
|
|
84
|
+
}
|
|
94
85
|
|
|
86
|
+
// Fixed sets still include a root index (which would account for a set dropdown that doesn't actually exist) so the root index is removed from the list
|
|
95
87
|
if (fixedSet) {
|
|
96
88
|
indices.shift();
|
|
97
89
|
}
|
|
98
|
-
|
|
99
|
-
return getSubDataTestId(rootDataTestId, "".concat(prefix, "-").concat(indices.join('-')));
|
|
90
|
+
return getSubDataTestId(rootDataTestId, `${prefix}-${indices.join('-')}`);
|
|
100
91
|
}, [fixedSet, rootDataTestId]);
|
|
101
|
-
|
|
102
92
|
function renderControls(itemType, itemPosition, itemIndex, itemLevel, numberOfSetItems, itemId) {
|
|
103
93
|
return /*#__PURE__*/React__default.createElement(Controls, {
|
|
104
94
|
handleNewLogicItem: handleNewLogicItem,
|
|
@@ -112,22 +102,18 @@ const ConditionSet = function ConditionSet(_ref) {
|
|
|
112
102
|
"data-testid": getDataTestId('condition-actions', itemPosition)
|
|
113
103
|
});
|
|
114
104
|
}
|
|
115
|
-
|
|
116
105
|
const renderSetChildren = () => value.conditions.map((item, i, items) => {
|
|
117
106
|
let itemConnectionRef;
|
|
118
107
|
let itemRef;
|
|
119
|
-
|
|
120
108
|
if (i === items.length - 1) {
|
|
121
109
|
if (lastConnectionRef.current) {
|
|
122
110
|
// Remove previous last-line styles
|
|
123
111
|
lastConnectionRef.current.style.height = '';
|
|
124
112
|
lastConnectionRef.current.style.top = '';
|
|
125
113
|
}
|
|
126
|
-
|
|
127
114
|
itemConnectionRef = lastConnectionRef;
|
|
128
115
|
itemRef = lastItemRef;
|
|
129
116
|
}
|
|
130
|
-
|
|
131
117
|
if (item.logicType === LOGIC_TYPE_CONDITION) {
|
|
132
118
|
const conditionPosition = {
|
|
133
119
|
parent: position,
|
|
@@ -148,7 +134,6 @@ const ConditionSet = function ConditionSet(_ref) {
|
|
|
148
134
|
conditionControls: !readOnly ? renderControls(LOGIC_TYPE_CONDITION, conditionPosition, i + 1, level + 1, value.conditions.length, item.id) : undefined
|
|
149
135
|
}));
|
|
150
136
|
}
|
|
151
|
-
|
|
152
137
|
if (item.logicType === LOGIC_TYPE_SET) {
|
|
153
138
|
return /*#__PURE__*/React__default.createElement("div", {
|
|
154
139
|
key: item.id,
|
|
@@ -164,10 +149,8 @@ const ConditionSet = function ConditionSet(_ref) {
|
|
|
164
149
|
parent: position
|
|
165
150
|
}));
|
|
166
151
|
}
|
|
167
|
-
|
|
168
152
|
return undefined;
|
|
169
153
|
});
|
|
170
|
-
|
|
171
154
|
return /*#__PURE__*/React__default.createElement("div", {
|
|
172
155
|
className: classNames(styles.set, {
|
|
173
156
|
[styles.fixedSet]: !!fixedSet
|
|
@@ -69,10 +69,10 @@ const Controls = function Controls(_ref) {
|
|
|
69
69
|
}, translations.insertSetBelow)), (fixedSet && numberOfSetItems > 1 || !fixedSet && itemLevel > 0) && /*#__PURE__*/React__default.createElement(MenuItem, {
|
|
70
70
|
value: "delete",
|
|
71
71
|
onSelect: e => {
|
|
72
|
-
onDelete(itemPosition);
|
|
72
|
+
onDelete(itemPosition);
|
|
73
|
+
// We want to move focus to the previous control
|
|
73
74
|
// item when this one is deleted, so we need to
|
|
74
75
|
// prevent Menu's default focus behavior
|
|
75
|
-
|
|
76
76
|
e.preventDefault();
|
|
77
77
|
}
|
|
78
78
|
}, /*#__PURE__*/React__default.createElement(RemoveItemIcon, {
|
|
@@ -41,57 +41,48 @@ const LogicEditor = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
|
|
|
41
41
|
maxNestedSets
|
|
42
42
|
}));
|
|
43
43
|
const classes = classNames(className, styles.editor);
|
|
44
|
-
|
|
45
44
|
function update(newState) {
|
|
46
45
|
setState(newState);
|
|
47
|
-
onChange
|
|
46
|
+
onChange?.(newState);
|
|
48
47
|
}
|
|
49
|
-
|
|
50
48
|
const handleNewLogicItem = (item, position) => {
|
|
51
49
|
const newState = shallowCopy(state);
|
|
52
50
|
const parent = getParentSet(newState, position);
|
|
53
51
|
parent.conditions.splice(position.index, 0, item);
|
|
54
52
|
update(newState);
|
|
55
53
|
};
|
|
56
|
-
|
|
57
54
|
const handleSetChange = (newSetValue, position) => {
|
|
58
55
|
const rootState = shallowCopy(state);
|
|
59
56
|
const parent = getParentSet(rootState, position);
|
|
60
|
-
|
|
61
57
|
if (!position.parent) {
|
|
62
58
|
// root set
|
|
63
59
|
parent.value = newSetValue;
|
|
64
60
|
} else {
|
|
65
61
|
parent.conditions[position.index].value = newSetValue;
|
|
66
62
|
}
|
|
67
|
-
|
|
68
63
|
update(rootState);
|
|
69
64
|
};
|
|
70
|
-
|
|
71
65
|
const handleConditionChange = (newCondition, position) => {
|
|
72
66
|
const newState = shallowCopy(state);
|
|
73
67
|
const parent = getParentSet(newState, position);
|
|
74
68
|
parent.conditions[position.index] = newCondition;
|
|
75
69
|
update(newState);
|
|
76
70
|
};
|
|
77
|
-
|
|
78
71
|
const controlsRef = useRef({});
|
|
79
|
-
|
|
80
72
|
const handleDelete = position => {
|
|
81
73
|
let previousItemId = getPreviousItemId(state, position);
|
|
82
74
|
const newState = shallowCopy(state);
|
|
83
75
|
const parent = getParentSet(newState, position);
|
|
84
|
-
parent.conditions.splice(position.index, 1);
|
|
76
|
+
parent.conditions.splice(position.index, 1);
|
|
85
77
|
|
|
78
|
+
// If the last condition in a set was deleted, also delete the set.
|
|
86
79
|
if (parent.conditions.length === 0) {
|
|
87
80
|
previousItemId = getPreviousItemId(newState, position.parent);
|
|
88
81
|
getParentSet(newState, position.parent).conditions.splice(position.parent.index, 1);
|
|
89
82
|
}
|
|
90
|
-
|
|
91
83
|
controlsRef.current[previousItemId].focus();
|
|
92
84
|
update(newState);
|
|
93
85
|
};
|
|
94
|
-
|
|
95
86
|
return /*#__PURE__*/React__default.createElement("div", _extends({}, rest, {
|
|
96
87
|
role: "group",
|
|
97
88
|
className: classes,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import styleInject from './../../__node_modules/style-inject/dist/style-inject.es.js';
|
|
2
2
|
|
|
3
|
-
var css_248z = ".
|
|
4
|
-
var styles = {"set":"
|
|
5
|
-
var stylesheet=".
|
|
3
|
+
var css_248z = "._NeiC9{width:100%}._MOFlt{display:flex;align-items:center}._cjaP-{display:flex;flex-wrap:wrap;grid-gap:4px}._cjaP- :nth-last-child(2){margin-right:42px}._ZMpyC{position:relative;padding-left:32px;padding-top:16px;display:flex}._44yAg ._ZMpyC{padding-top:0;padding-left:16px}._44yAg ._ZMpyC+._ZMpyC{margin-top:16px}._Sq-u3{position:absolute;left:16px;top:0;height:34px;width:16px;border-left:1px solid #c2c2c2;border-bottom:1px solid #c2c2c2;border-bottom-left-radius:4px}._44yAg ._ZMpyC:first-of-type ._Sq-u3{top:16px;border-bottom:none;border-bottom-left-radius:0;border-top:1px solid #c2c2c2;border-top-left-radius:4px}._44yAg ._Sq-u3{top:-16px;left:0}._44yAg ._ZMpyC:not(:first-of-type):not(:last-of-type) ._Sq-u3{border-bottom-left-radius:0}._xqrcE{margin-left:-46px}._umbQ6{margin:0 2px 0 4px}body._gQJoW ._umbQ6{outline-width:2px}._fPWPS{margin-left:4px}";
|
|
4
|
+
var styles = {"set":"_NeiC9","setWrapper":"_MOFlt","condition":"_cjaP-","branch":"_ZMpyC","fixedSet":"_44yAg","connection":"_Sq-u3","conditionControlsContainer":"_xqrcE","controls":"_umbQ6","keyboard-user":"_gQJoW","controlMenuItem":"_fPWPS"};
|
|
5
|
+
var stylesheet="._NeiC9{width:100%}._MOFlt{display:flex;align-items:center}._cjaP-{display:flex;flex-wrap:wrap;grid-gap:4px}._cjaP- :nth-last-child(2){margin-right:42px}._ZMpyC{position:relative;padding-left:32px;padding-top:16px;display:flex}._44yAg ._ZMpyC{padding-top:0;padding-left:16px}._44yAg ._ZMpyC+._ZMpyC{margin-top:16px}._Sq-u3{position:absolute;left:16px;top:0;height:34px;width:16px;border-left:1px solid #c2c2c2;border-bottom:1px solid #c2c2c2;border-bottom-left-radius:4px}._44yAg ._ZMpyC:first-of-type ._Sq-u3{top:16px;border-bottom:none;border-bottom-left-radius:0;border-top:1px solid #c2c2c2;border-top-left-radius:4px}._44yAg ._Sq-u3{top:-16px;left:0}._44yAg ._ZMpyC:not(:first-of-type):not(:last-of-type) ._Sq-u3{border-bottom-left-radius:0}._xqrcE{margin-left:-46px}._umbQ6{margin:0 2px 0 4px}body._gQJoW ._umbQ6{outline-width:2px}._fPWPS{margin-left:4px}";
|
|
6
6
|
styleInject(css_248z);
|
|
7
7
|
|
|
8
8
|
export { styles as default, stylesheet };
|
|
@@ -11,38 +11,29 @@ function constructValidDefaultState(_ref) {
|
|
|
11
11
|
maxNestedSets
|
|
12
12
|
} = _ref;
|
|
13
13
|
let clone;
|
|
14
|
-
|
|
15
14
|
if (defaultValue) {
|
|
16
15
|
clone = deepCopy(defaultValue);
|
|
17
16
|
} else {
|
|
18
17
|
clone = newConditionSet(defaultSetValue);
|
|
19
18
|
}
|
|
20
|
-
|
|
21
19
|
let internalMaxNestedSets = maxNestedSets;
|
|
22
|
-
|
|
23
20
|
if (fixedSet) {
|
|
24
21
|
internalMaxNestedSets = 0;
|
|
25
22
|
}
|
|
26
|
-
|
|
27
23
|
ensureFixedSetHasOneCondition(clone, fixedSet);
|
|
28
24
|
pruneSets(clone, 0, internalMaxNestedSets);
|
|
29
25
|
assignIdentifiersAndSetValues(clone, defaultSetValue);
|
|
30
26
|
return clone;
|
|
31
27
|
}
|
|
32
|
-
|
|
33
28
|
function fixedSetHasNoConditions(defaultValue, fixedSet) {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
return fixedSet && defaultValue && (!(defaultValue !== null && defaultValue !== void 0 && defaultValue.conditions) || !((defaultValue === null || defaultValue === void 0 ? void 0 : (_defaultValue$conditi = defaultValue.conditions) === null || _defaultValue$conditi === void 0 ? void 0 : _defaultValue$conditi.length) >= 1));
|
|
29
|
+
return fixedSet && defaultValue && (!defaultValue?.conditions || !(defaultValue?.conditions?.length >= 1));
|
|
37
30
|
}
|
|
38
|
-
|
|
39
31
|
function ensureFixedSetHasOneCondition(defaultValue, fixedSet) {
|
|
40
32
|
if (fixedSetHasNoConditions(defaultValue, fixedSet)) {
|
|
41
33
|
// eslint-disable-next-line no-param-reassign
|
|
42
34
|
defaultValue.conditions = [newCondition()];
|
|
43
35
|
}
|
|
44
36
|
}
|
|
45
|
-
|
|
46
37
|
function pruneSets(set, level, maxNestedSets) {
|
|
47
38
|
if (level === maxNestedSets) {
|
|
48
39
|
// eslint-disable-next-line no-param-reassign
|
|
@@ -55,23 +46,21 @@ function pruneSets(set, level, maxNestedSets) {
|
|
|
55
46
|
});
|
|
56
47
|
}
|
|
57
48
|
}
|
|
58
|
-
|
|
59
49
|
function uuidv4() {
|
|
60
50
|
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, c => {
|
|
61
51
|
// eslint-disable-next-line no-bitwise
|
|
62
|
-
const r = Math.random() * 16 | 0;
|
|
63
|
-
|
|
52
|
+
const r = Math.random() * 16 | 0;
|
|
53
|
+
// eslint-disable-next-line no-bitwise
|
|
64
54
|
const v = c === 'x' ? r : r & 0x3 | 0x8;
|
|
65
55
|
return v.toString(16);
|
|
66
56
|
});
|
|
67
57
|
}
|
|
68
|
-
|
|
69
58
|
function deepCopy(object) {
|
|
70
59
|
return JSON.parse(JSON.stringify(object));
|
|
71
60
|
}
|
|
72
|
-
|
|
73
61
|
function shallowCopy(object) {
|
|
74
|
-
return {
|
|
62
|
+
return {
|
|
63
|
+
...object
|
|
75
64
|
};
|
|
76
65
|
}
|
|
77
66
|
function newCondition() {
|
|
@@ -91,73 +80,59 @@ function newConditionSet(value) {
|
|
|
91
80
|
function assignIdentifiersAndSetValues(tree, defaultSetValue) {
|
|
92
81
|
const queue = [];
|
|
93
82
|
queue.push(tree);
|
|
94
|
-
|
|
95
83
|
while (queue.length > 0) {
|
|
96
84
|
const node = queue.pop();
|
|
97
|
-
|
|
98
85
|
if (!node.id) {
|
|
99
86
|
node.id = uuidv4();
|
|
100
87
|
}
|
|
101
|
-
|
|
102
88
|
if (node.logicType === LOGIC_TYPE_SET && !node.value) {
|
|
103
89
|
node.value = defaultSetValue;
|
|
104
90
|
}
|
|
105
|
-
|
|
106
91
|
if (node.conditions) {
|
|
107
92
|
queue.push(...node.conditions);
|
|
108
93
|
}
|
|
109
94
|
}
|
|
110
|
-
|
|
111
95
|
return tree;
|
|
112
96
|
}
|
|
113
|
-
|
|
114
97
|
function walkToRoot(position) {
|
|
115
98
|
let root = {
|
|
116
99
|
level: position.level,
|
|
117
100
|
index: position.index
|
|
118
101
|
};
|
|
119
|
-
|
|
120
102
|
for (let current = position.parent; current; current = current.parent) {
|
|
121
103
|
root = {
|
|
122
104
|
level: current.level,
|
|
123
105
|
index: current.index,
|
|
124
|
-
child: {
|
|
106
|
+
child: {
|
|
107
|
+
...root
|
|
125
108
|
}
|
|
126
109
|
};
|
|
127
110
|
}
|
|
128
|
-
|
|
129
111
|
return root;
|
|
130
112
|
}
|
|
131
|
-
|
|
132
113
|
function getPreviousItemId(conditionRoot, position) {
|
|
133
114
|
const parentSet = getParentSet(conditionRoot, position);
|
|
134
|
-
|
|
135
115
|
if (position.index === 0) {
|
|
136
116
|
// The previous item is the parent
|
|
137
117
|
return parentSet.id;
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
|
|
118
|
+
}
|
|
119
|
+
// The previous item is the previous sibling's deepest child
|
|
141
120
|
let previousIndex = position.index - 1;
|
|
142
121
|
let previousItem = parentSet.conditions[previousIndex];
|
|
143
|
-
|
|
144
122
|
while (previousItem.conditions) {
|
|
145
123
|
previousIndex = previousItem.conditions.length - 1;
|
|
146
124
|
previousItem = previousItem.conditions[previousIndex];
|
|
147
125
|
}
|
|
148
|
-
|
|
149
126
|
return previousItem.id;
|
|
150
127
|
}
|
|
151
128
|
function getParentSet(conditionRoot, position) {
|
|
152
129
|
const positionFromRoot = walkToRoot(position);
|
|
153
130
|
let set = conditionRoot;
|
|
154
|
-
|
|
155
131
|
for (let {
|
|
156
132
|
child
|
|
157
133
|
} = positionFromRoot; child && child.child; child = child.child) {
|
|
158
134
|
set = set.conditions[child.index];
|
|
159
135
|
}
|
|
160
|
-
|
|
161
136
|
return set;
|
|
162
137
|
}
|
|
163
138
|
|