@bryntum/gantt-react 7.1.2 → 7.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +12 -6
- package/lib/BryntumAIFilterField.d.ts +2 -2
- package/lib/BryntumAIFilterField.js.map +1 -1
- package/lib/BryntumAssignmentField.d.ts +2 -2
- package/lib/BryntumAssignmentField.js.map +1 -1
- package/lib/BryntumAssignmentGrid.d.ts +22 -10
- package/lib/BryntumAssignmentGrid.js +3 -0
- package/lib/BryntumAssignmentGrid.js.map +1 -1
- package/lib/BryntumAssignmentPicker.d.ts +254 -0
- package/lib/BryntumAssignmentPicker.js +183 -0
- package/lib/BryntumAssignmentPicker.js.map +1 -0
- package/lib/BryntumButton.d.ts +2 -2
- package/lib/BryntumButton.js.map +1 -1
- package/lib/BryntumButtonGroup.d.ts +1 -0
- package/lib/BryntumButtonGroup.js +1 -0
- package/lib/BryntumButtonGroup.js.map +1 -1
- package/lib/BryntumCalendarEditor.d.ts +3 -2
- package/lib/BryntumCalendarEditor.js +1 -0
- package/lib/BryntumCalendarEditor.js.map +1 -1
- package/lib/BryntumCalendarField.d.ts +2 -2
- package/lib/BryntumCalendarField.js.map +1 -1
- package/lib/BryntumCalendarPicker.d.ts +2 -2
- package/lib/BryntumCalendarPicker.js.map +1 -1
- package/lib/BryntumChatPanel.d.ts +3 -2
- package/lib/BryntumChatPanel.js +1 -0
- package/lib/BryntumChatPanel.js.map +1 -1
- package/lib/BryntumCheckboxGroup.d.ts +3 -2
- package/lib/BryntumCheckboxGroup.js +1 -0
- package/lib/BryntumCheckboxGroup.js.map +1 -1
- package/lib/BryntumChecklistFilterCombo.d.ts +2 -2
- package/lib/BryntumChecklistFilterCombo.js.map +1 -1
- package/lib/BryntumChipView.d.ts +2 -2
- package/lib/BryntumChipView.js +2 -2
- package/lib/BryntumChipView.js.map +1 -1
- package/lib/BryntumCodeEditor.d.ts +3 -2
- package/lib/BryntumCodeEditor.js +1 -0
- package/lib/BryntumCodeEditor.js.map +1 -1
- package/lib/BryntumCombo.d.ts +2 -2
- package/lib/BryntumCombo.js.map +1 -1
- package/lib/BryntumConstraintTypePicker.d.ts +2 -2
- package/lib/BryntumConstraintTypePicker.js.map +1 -1
- package/lib/BryntumContainer.d.ts +3 -2
- package/lib/BryntumContainer.js +1 -0
- package/lib/BryntumContainer.js.map +1 -1
- package/lib/BryntumCostAccrualField.d.ts +2 -2
- package/lib/BryntumCostAccrualField.js.map +1 -1
- package/lib/BryntumDateField.d.ts +3 -2
- package/lib/BryntumDateField.js +1 -0
- package/lib/BryntumDateField.js.map +1 -1
- package/lib/BryntumDatePicker.d.ts +3 -2
- package/lib/BryntumDatePicker.js +2 -1
- package/lib/BryntumDatePicker.js.map +1 -1
- package/lib/BryntumDateRangeField.d.ts +2 -2
- package/lib/BryntumDateRangeField.js.map +1 -1
- package/lib/BryntumDateTimeField.d.ts +2 -2
- package/lib/BryntumDateTimeField.js.map +1 -1
- package/lib/BryntumDemoCodeEditor.d.ts +3 -2
- package/lib/BryntumDemoCodeEditor.js +1 -0
- package/lib/BryntumDemoCodeEditor.js.map +1 -1
- package/lib/BryntumDependencyField.d.ts +2 -2
- package/lib/BryntumDependencyField.js.map +1 -1
- package/lib/BryntumDependencyTypePicker.d.ts +3 -2
- package/lib/BryntumDependencyTypePicker.js +1 -0
- package/lib/BryntumDependencyTypePicker.js.map +1 -1
- package/lib/BryntumDisplayField.d.ts +2 -2
- package/lib/BryntumDisplayField.js.map +1 -1
- package/lib/BryntumDurationField.d.ts +2 -2
- package/lib/BryntumDurationField.js.map +1 -1
- package/lib/BryntumEditor.d.ts +3 -2
- package/lib/BryntumEditor.js +1 -0
- package/lib/BryntumEditor.js.map +1 -1
- package/lib/BryntumEffortField.d.ts +2 -2
- package/lib/BryntumEffortField.js.map +1 -1
- package/lib/BryntumEndDateField.d.ts +3 -2
- package/lib/BryntumEndDateField.js +1 -0
- package/lib/BryntumEndDateField.js.map +1 -1
- package/lib/BryntumFieldFilterPicker.d.ts +3 -2
- package/lib/BryntumFieldFilterPicker.js +1 -0
- package/lib/BryntumFieldFilterPicker.js.map +1 -1
- package/lib/BryntumFieldFilterPickerGroup.d.ts +3 -2
- package/lib/BryntumFieldFilterPickerGroup.js +1 -0
- package/lib/BryntumFieldFilterPickerGroup.js.map +1 -1
- package/lib/BryntumFieldSet.d.ts +3 -2
- package/lib/BryntumFieldSet.js +1 -0
- package/lib/BryntumFieldSet.js.map +1 -1
- package/lib/BryntumFileField.d.ts +2 -2
- package/lib/BryntumFileField.js.map +1 -1
- package/lib/BryntumFilePicker.d.ts +3 -2
- package/lib/BryntumFilePicker.js +1 -0
- package/lib/BryntumFilePicker.js.map +1 -1
- package/lib/BryntumFilterField.d.ts +2 -2
- package/lib/BryntumFilterField.js.map +1 -1
- package/lib/BryntumGantt.d.ts +24 -11
- package/lib/BryntumGantt.js +5 -0
- package/lib/BryntumGantt.js.map +1 -1
- package/lib/BryntumGanttBase.d.ts +24 -11
- package/lib/BryntumGanttBase.js +5 -0
- package/lib/BryntumGanttBase.js.map +1 -1
- package/lib/BryntumGanttProjectModel.d.ts +1 -0
- package/lib/BryntumGanttProjectModel.js +1 -0
- package/lib/BryntumGanttProjectModel.js.map +1 -1
- package/lib/BryntumGrid.d.ts +22 -10
- package/lib/BryntumGrid.js +4 -0
- package/lib/BryntumGrid.js.map +1 -1
- package/lib/BryntumGridBase.d.ts +22 -10
- package/lib/BryntumGridBase.js +4 -0
- package/lib/BryntumGridBase.js.map +1 -1
- package/lib/BryntumGridChartDesigner.d.ts +2 -2
- package/lib/BryntumGridChartDesigner.js.map +1 -1
- package/lib/BryntumGridFieldFilterPicker.d.ts +3 -2
- package/lib/BryntumGridFieldFilterPicker.js +1 -0
- package/lib/BryntumGridFieldFilterPicker.js.map +1 -1
- package/lib/BryntumGridFieldFilterPickerGroup.d.ts +3 -2
- package/lib/BryntumGridFieldFilterPickerGroup.js +1 -0
- package/lib/BryntumGridFieldFilterPickerGroup.js.map +1 -1
- package/lib/BryntumGroupBar.d.ts +2 -2
- package/lib/BryntumGroupBar.js +2 -2
- package/lib/BryntumGroupBar.js.map +1 -1
- package/lib/BryntumHint.d.ts +3 -2
- package/lib/BryntumHint.js +1 -0
- package/lib/BryntumHint.js.map +1 -1
- package/lib/BryntumLabel.d.ts +2 -2
- package/lib/BryntumLabel.js.map +1 -1
- package/lib/BryntumList.d.ts +2 -2
- package/lib/BryntumList.js +2 -2
- package/lib/BryntumList.js.map +1 -1
- package/lib/BryntumMenu.d.ts +3 -2
- package/lib/BryntumMenu.js +1 -0
- package/lib/BryntumMenu.js.map +1 -1
- package/lib/BryntumModelCombo.d.ts +2 -2
- package/lib/BryntumModelCombo.js.map +1 -1
- package/lib/BryntumMonthPicker.d.ts +3 -2
- package/lib/BryntumMonthPicker.js +1 -0
- package/lib/BryntumMonthPicker.js.map +1 -1
- package/lib/BryntumNumberField.d.ts +2 -2
- package/lib/BryntumNumberField.js.map +1 -1
- package/lib/BryntumPagingToolbar.d.ts +3 -2
- package/lib/BryntumPagingToolbar.js +1 -0
- package/lib/BryntumPagingToolbar.js.map +1 -1
- package/lib/BryntumPanel.d.ts +3 -2
- package/lib/BryntumPanel.js +1 -0
- package/lib/BryntumPanel.js.map +1 -1
- package/lib/BryntumPasswordField.d.ts +2 -2
- package/lib/BryntumPasswordField.js.map +1 -1
- package/lib/BryntumProgressBar.d.ts +165 -0
- package/lib/BryntumProgressBar.js +130 -0
- package/lib/BryntumProgressBar.js.map +1 -0
- package/lib/BryntumProjectCombo.d.ts +2 -2
- package/lib/BryntumProjectCombo.js.map +1 -1
- package/lib/BryntumRadioGroup.d.ts +3 -2
- package/lib/BryntumRadioGroup.js +1 -0
- package/lib/BryntumRadioGroup.js.map +1 -1
- package/lib/BryntumRateTableField.d.ts +2 -2
- package/lib/BryntumRateTableField.js.map +1 -1
- package/lib/BryntumResourceCombo.d.ts +2 -2
- package/lib/BryntumResourceCombo.js.map +1 -1
- package/lib/BryntumResourceEditor.d.ts +3 -2
- package/lib/BryntumResourceEditor.js +1 -0
- package/lib/BryntumResourceEditor.js.map +1 -1
- package/lib/BryntumResourceFilter.d.ts +2 -2
- package/lib/BryntumResourceFilter.js +2 -2
- package/lib/BryntumResourceFilter.js.map +1 -1
- package/lib/BryntumResourceGrid.d.ts +22 -10
- package/lib/BryntumResourceGrid.js +3 -0
- package/lib/BryntumResourceGrid.js.map +1 -1
- package/lib/BryntumResourceHistogram.d.ts +23 -11
- package/lib/BryntumResourceHistogram.js +4 -0
- package/lib/BryntumResourceHistogram.js.map +1 -1
- package/lib/BryntumResourceTypeField.d.ts +2 -2
- package/lib/BryntumResourceTypeField.js.map +1 -1
- package/lib/BryntumResourceUtilization.d.ts +23 -11
- package/lib/BryntumResourceUtilization.js +4 -0
- package/lib/BryntumResourceUtilization.js.map +1 -1
- package/lib/BryntumScheduler.d.ts +75 -11
- package/lib/BryntumScheduler.js +12 -0
- package/lib/BryntumScheduler.js.map +1 -1
- package/lib/BryntumSchedulerBase.d.ts +75 -11
- package/lib/BryntumSchedulerBase.js +12 -0
- package/lib/BryntumSchedulerBase.js.map +1 -1
- package/lib/BryntumSchedulerDatePicker.d.ts +3 -2
- package/lib/BryntumSchedulerDatePicker.js +2 -1
- package/lib/BryntumSchedulerDatePicker.js.map +1 -1
- package/lib/BryntumSchedulerPro.d.ts +75 -11
- package/lib/BryntumSchedulerPro.js +12 -0
- package/lib/BryntumSchedulerPro.js.map +1 -1
- package/lib/BryntumSchedulerProBase.d.ts +75 -11
- package/lib/BryntumSchedulerProBase.js +12 -0
- package/lib/BryntumSchedulerProBase.js.map +1 -1
- package/lib/BryntumSchedulingDirectionPicker.d.ts +2 -2
- package/lib/BryntumSchedulingDirectionPicker.js.map +1 -1
- package/lib/BryntumSchedulingModePicker.d.ts +2 -2
- package/lib/BryntumSchedulingModePicker.js.map +1 -1
- package/lib/BryntumSlider.d.ts +2 -2
- package/lib/BryntumSlider.js.map +1 -1
- package/lib/BryntumSplitter.d.ts +2 -2
- package/lib/BryntumSplitter.js.map +1 -1
- package/lib/BryntumStartDateField.d.ts +3 -2
- package/lib/BryntumStartDateField.js +1 -0
- package/lib/BryntumStartDateField.js.map +1 -1
- package/lib/BryntumTabPanel.d.ts +3 -2
- package/lib/BryntumTabPanel.js +1 -0
- package/lib/BryntumTabPanel.js.map +1 -1
- package/lib/BryntumTextAreaField.d.ts +2 -2
- package/lib/BryntumTextAreaField.js.map +1 -1
- package/lib/BryntumTextAreaPickerField.d.ts +2 -2
- package/lib/BryntumTextAreaPickerField.js.map +1 -1
- package/lib/BryntumTextField.d.ts +2 -2
- package/lib/BryntumTextField.js.map +1 -1
- package/lib/BryntumTimeField.d.ts +3 -2
- package/lib/BryntumTimeField.js +1 -0
- package/lib/BryntumTimeField.js.map +1 -1
- package/lib/BryntumTimePicker.d.ts +3 -2
- package/lib/BryntumTimePicker.js +1 -0
- package/lib/BryntumTimePicker.js.map +1 -1
- package/lib/BryntumTimeline.d.ts +75 -11
- package/lib/BryntumTimeline.js +10 -0
- package/lib/BryntumTimeline.js.map +1 -1
- package/lib/BryntumTimelineHistogram.d.ts +23 -11
- package/lib/BryntumTimelineHistogram.js +4 -0
- package/lib/BryntumTimelineHistogram.js.map +1 -1
- package/lib/BryntumToolbar.d.ts +3 -2
- package/lib/BryntumToolbar.js +1 -0
- package/lib/BryntumToolbar.js.map +1 -1
- package/lib/BryntumTreeCombo.d.ts +2 -2
- package/lib/BryntumTreeCombo.js.map +1 -1
- package/lib/BryntumTreeGrid.d.ts +22 -10
- package/lib/BryntumTreeGrid.js +4 -0
- package/lib/BryntumTreeGrid.js.map +1 -1
- package/lib/BryntumUndoRedo.d.ts +1 -0
- package/lib/BryntumUndoRedo.js +1 -0
- package/lib/BryntumUndoRedo.js.map +1 -1
- package/lib/BryntumVersionGrid.d.ts +22 -10
- package/lib/BryntumVersionGrid.js +3 -0
- package/lib/BryntumVersionGrid.js.map +1 -1
- package/lib/BryntumViewPresetCombo.d.ts +2 -2
- package/lib/BryntumViewPresetCombo.js.map +1 -1
- package/lib/BryntumWidget.d.ts +2 -2
- package/lib/BryntumWidget.js.map +1 -1
- package/lib/BryntumYearPicker.d.ts +3 -2
- package/lib/BryntumYearPicker.js +1 -0
- package/lib/BryntumYearPicker.js.map +1 -1
- package/lib/WrapperHelper.js +46 -1
- package/lib/WrapperHelper.js.map +1 -1
- package/lib/index.d.ts +2 -0
- package/lib/index.js +2 -0
- package/lib/index.js.map +1 -1
- package/package.json +1 -1
- package/src/BryntumAIFilterField.tsx +2 -2
- package/src/BryntumAssignmentField.tsx +2 -2
- package/src/BryntumAssignmentGrid.tsx +56 -24
- package/src/BryntumAssignmentPicker.tsx +1114 -0
- package/src/BryntumButton.tsx +2 -2
- package/src/BryntumButtonGroup.tsx +5 -0
- package/src/BryntumCalendarEditor.tsx +7 -2
- package/src/BryntumCalendarField.tsx +2 -2
- package/src/BryntumCalendarPicker.tsx +2 -2
- package/src/BryntumChatPanel.tsx +7 -2
- package/src/BryntumCheckboxGroup.tsx +7 -2
- package/src/BryntumChecklistFilterCombo.tsx +2 -2
- package/src/BryntumChipView.tsx +4 -4
- package/src/BryntumCodeEditor.tsx +7 -2
- package/src/BryntumCombo.tsx +2 -2
- package/src/BryntumConstraintTypePicker.tsx +2 -2
- package/src/BryntumContainer.tsx +7 -2
- package/src/BryntumCostAccrualField.tsx +2 -2
- package/src/BryntumDateField.tsx +13 -3
- package/src/BryntumDatePicker.tsx +8 -3
- package/src/BryntumDateRangeField.tsx +2 -2
- package/src/BryntumDateTimeField.tsx +2 -2
- package/src/BryntumDemoCodeEditor.tsx +7 -2
- package/src/BryntumDependencyField.tsx +2 -2
- package/src/BryntumDependencyTypePicker.tsx +8 -2
- package/src/BryntumDisplayField.tsx +2 -2
- package/src/BryntumDurationField.tsx +2 -2
- package/src/BryntumEditor.tsx +7 -2
- package/src/BryntumEffortField.tsx +2 -2
- package/src/BryntumEndDateField.tsx +13 -3
- package/src/BryntumFieldFilterPicker.tsx +7 -2
- package/src/BryntumFieldFilterPickerGroup.tsx +7 -2
- package/src/BryntumFieldSet.tsx +7 -2
- package/src/BryntumFileField.tsx +2 -2
- package/src/BryntumFilePicker.tsx +7 -2
- package/src/BryntumFilterField.tsx +2 -2
- package/src/BryntumGantt.tsx +65 -26
- package/src/BryntumGanttBase.tsx +65 -26
- package/src/BryntumGanttProjectModel.tsx +9 -0
- package/src/BryntumGrid.tsx +57 -24
- package/src/BryntumGridBase.tsx +57 -24
- package/src/BryntumGridChartDesigner.tsx +2 -2
- package/src/BryntumGridFieldFilterPicker.tsx +7 -2
- package/src/BryntumGridFieldFilterPickerGroup.tsx +7 -2
- package/src/BryntumGroupBar.tsx +4 -4
- package/src/BryntumHint.tsx +7 -2
- package/src/BryntumLabel.tsx +2 -2
- package/src/BryntumList.tsx +4 -4
- package/src/BryntumMenu.tsx +7 -2
- package/src/BryntumModelCombo.tsx +2 -2
- package/src/BryntumMonthPicker.tsx +7 -2
- package/src/BryntumNumberField.tsx +2 -2
- package/src/BryntumPagingToolbar.tsx +7 -2
- package/src/BryntumPanel.tsx +7 -2
- package/src/BryntumPasswordField.tsx +2 -2
- package/src/BryntumProgressBar.tsx +742 -0
- package/src/BryntumProjectCombo.tsx +2 -2
- package/src/BryntumRadioGroup.tsx +7 -2
- package/src/BryntumRateTableField.tsx +2 -2
- package/src/BryntumResourceCombo.tsx +2 -2
- package/src/BryntumResourceEditor.tsx +7 -2
- package/src/BryntumResourceFilter.tsx +4 -4
- package/src/BryntumResourceGrid.tsx +56 -24
- package/src/BryntumResourceHistogram.tsx +58 -25
- package/src/BryntumResourceTypeField.tsx +2 -2
- package/src/BryntumResourceUtilization.tsx +58 -25
- package/src/BryntumScheduler.tsx +142 -25
- package/src/BryntumSchedulerBase.tsx +142 -25
- package/src/BryntumSchedulerDatePicker.tsx +8 -3
- package/src/BryntumSchedulerPro.tsx +142 -25
- package/src/BryntumSchedulerProBase.tsx +142 -25
- package/src/BryntumSchedulingDirectionPicker.tsx +2 -2
- package/src/BryntumSchedulingModePicker.tsx +2 -2
- package/src/BryntumSlider.tsx +2 -2
- package/src/BryntumSplitter.tsx +2 -2
- package/src/BryntumStartDateField.tsx +13 -3
- package/src/BryntumTabPanel.tsx +7 -2
- package/src/BryntumTextAreaField.tsx +2 -2
- package/src/BryntumTextAreaPickerField.tsx +2 -2
- package/src/BryntumTextField.tsx +2 -2
- package/src/BryntumTimeField.tsx +11 -2
- package/src/BryntumTimePicker.tsx +7 -2
- package/src/BryntumTimeline.tsx +140 -25
- package/src/BryntumTimelineHistogram.tsx +58 -25
- package/src/BryntumToolbar.tsx +7 -2
- package/src/BryntumTreeCombo.tsx +2 -2
- package/src/BryntumTreeGrid.tsx +57 -24
- package/src/BryntumUndoRedo.tsx +5 -0
- package/src/BryntumVersionGrid.tsx +56 -24
- package/src/BryntumViewPresetCombo.tsx +2 -2
- package/src/BryntumWidget.tsx +2 -2
- package/src/BryntumYearPicker.tsx +7 -2
- package/src/WrapperHelper.tsx +162 -35
- package/src/index.ts +2 -0
package/src/WrapperHelper.tsx
CHANGED
|
@@ -20,9 +20,43 @@ declare global {
|
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
/**
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
23
|
+
* Extends the standard React.ReactPortal type to include an optional `taskGeneration` property.
|
|
24
|
+
* This property can be used to track or associate a generation number with the portal,
|
|
25
|
+
* which may be useful for managing updates or synchronization tasks in complex React applications.
|
|
26
|
+
*
|
|
27
|
+
* @property {number} [taskGeneration] Optional generation number for task tracking or synchronization.
|
|
28
|
+
*/
|
|
29
|
+
type ReactPortalWithTaskGeneration = React.ReactPortal & { taskGeneration?: number };
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Represents the state for a React component that manages portals and their generation.
|
|
33
|
+
*
|
|
34
|
+
* @property {Map} portals A map associating unique string keys with `ReactPortalWithTaskGeneration` instances.
|
|
35
|
+
* @property {number} generation A numeric value indicating the current generation or version of the component state.
|
|
36
|
+
*/
|
|
37
|
+
type ReactComponentState = {
|
|
38
|
+
portals : Map<string, ReactPortalWithTaskGeneration>
|
|
39
|
+
generation : number
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Extends the standard HTMLElement to include additional optional properties
|
|
44
|
+
* used for managing element-specific data and state within the application.
|
|
45
|
+
*
|
|
46
|
+
* @property {any} [elementData] Arbitrary data associated with the element.
|
|
47
|
+
* @property {string|null} [lastPortalId] Identifier for the last portal rendered into this element, or null if none.
|
|
48
|
+
* @property {boolean} [didSetTextContent] Indicates whether the text content of the element has been set.
|
|
49
|
+
*/
|
|
50
|
+
type HTMLElementWithData = HTMLElement & {
|
|
51
|
+
elementData?: any
|
|
52
|
+
lastPortalId?: string | null
|
|
53
|
+
didSetTextContent?: boolean
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Development warning. Shown when environment is set to 'development'
|
|
58
|
+
* @param {string} clsName react component instance
|
|
59
|
+
* @param {string} msg console message
|
|
26
60
|
*/
|
|
27
61
|
function devWarning(clsName: string, msg: string): void {
|
|
28
62
|
// @ts-ignore
|
|
@@ -38,7 +72,7 @@ function devWarningContainer(clsName: string, containerParam: string): void {
|
|
|
38
72
|
devWarning(
|
|
39
73
|
clsName,
|
|
40
74
|
`Using "${containerParam}" parameter for configuration is not recommended.\n` +
|
|
41
|
-
|
|
75
|
+
'Widget is placed automatically inside its container element.\n' +
|
|
42
76
|
`Solution: remove "${containerParam}" parameter from configuration.`
|
|
43
77
|
);
|
|
44
78
|
}
|
|
@@ -62,14 +96,14 @@ function devWarningProjectProp(clsName: string): void {
|
|
|
62
96
|
/**
|
|
63
97
|
* Returns `true` if the provided element is an instance of React Element.
|
|
64
98
|
* All React elements require an additional $$typeof: Symbol.for('react.element') field declared on the object for security reasons.
|
|
65
|
-
* The object, which React.createElement()
|
|
99
|
+
* The object, which React.createElement() returns has $$typeof property equal to Symbol.for('react.element')
|
|
66
100
|
*
|
|
67
101
|
* Sources:
|
|
68
102
|
* https://reactjs.org/blog/2015/12/18/react-components-elements-and-instances.html
|
|
69
103
|
* https://github.com/facebook/react/pull/4832
|
|
70
104
|
*
|
|
71
|
-
* @param {*} element
|
|
72
|
-
* @returns {
|
|
105
|
+
* @param {*} element Element to check
|
|
106
|
+
* @returns {boolean} True if element is a React element
|
|
73
107
|
* @internal
|
|
74
108
|
*/
|
|
75
109
|
function isReactElement(element: any): boolean {
|
|
@@ -78,8 +112,8 @@ function isReactElement(element: any): boolean {
|
|
|
78
112
|
|
|
79
113
|
/**
|
|
80
114
|
* Creates bryntum component config from react component
|
|
81
|
-
* @param {
|
|
82
|
-
* @returns {
|
|
115
|
+
* @param {object} reactInstance react component instance
|
|
116
|
+
* @returns {object} config object
|
|
83
117
|
*/
|
|
84
118
|
function createConfig(reactInstance: any): object {
|
|
85
119
|
const
|
|
@@ -101,6 +135,7 @@ function createConfig(reactInstance: any): object {
|
|
|
101
135
|
processCellContent : isView ? processCellContent : undefined,
|
|
102
136
|
processCellEditor : isView ? processCellEditor : undefined,
|
|
103
137
|
processEventContent : isView ? processEventContent : undefined,
|
|
138
|
+
processTaskContent : isView ? processTaskContent : undefined,
|
|
104
139
|
processTaskItemContent : isView ? processTaskItemContent : undefined,
|
|
105
140
|
processResourceHeader : isView ? processResourceHeader : undefined
|
|
106
141
|
} as any;
|
|
@@ -178,10 +213,10 @@ function createConfig(reactInstance: any): object {
|
|
|
178
213
|
|
|
179
214
|
/**
|
|
180
215
|
* Applies property value to Bryntum config or instance.
|
|
181
|
-
* @param {
|
|
182
|
-
* @param {
|
|
183
|
-
* @param {
|
|
184
|
-
* @param {
|
|
216
|
+
* @param {object} configOrInstance target object
|
|
217
|
+
* @param {string} prop property name
|
|
218
|
+
* @param {object} value value
|
|
219
|
+
* @param {boolean} isConfig config setting mode
|
|
185
220
|
*/
|
|
186
221
|
function applyPropValue(configOrInstance: any, prop: string, value: any, isConfig = true): void {
|
|
187
222
|
// Assigning React wrapper component instance
|
|
@@ -270,9 +305,9 @@ function createWidget(component: any): any {
|
|
|
270
305
|
|
|
271
306
|
/**
|
|
272
307
|
* Calculates the portalId from passed ids
|
|
273
|
-
* @param {
|
|
274
|
-
* @param {
|
|
275
|
-
* @returns {
|
|
308
|
+
* @param {string|number} id Record id
|
|
309
|
+
* @param {string|number} columnId Column id
|
|
310
|
+
* @returns {string} portalId as `portal-${id}-${columnId}`
|
|
276
311
|
*/
|
|
277
312
|
function getPortalId(id: string | number, columnId: string | number): string {
|
|
278
313
|
return `portal-${id}-${columnId}`;
|
|
@@ -281,7 +316,7 @@ function getPortalId(id: string | number, columnId: string | number): string {
|
|
|
281
316
|
/**
|
|
282
317
|
* Delete portal and its container
|
|
283
318
|
* @param {*} component React Component, the wrapper itself
|
|
284
|
-
* @param {
|
|
319
|
+
* @param {string} portalId As returned from getPortalId function
|
|
285
320
|
*/
|
|
286
321
|
function deletePortal(component: any, portalId: string): void {
|
|
287
322
|
const portal = component.state.portals.get(portalId);
|
|
@@ -313,7 +348,7 @@ function releaseReactCell(component: any, cellElement: any): void {
|
|
|
313
348
|
/**
|
|
314
349
|
* Calls releaseReactCell that implements the cleanup
|
|
315
350
|
* @param {*} component React Component, the wrapper itself
|
|
316
|
-
* @param {
|
|
351
|
+
* @param {object} context Event context object
|
|
317
352
|
* @param {Core.data.Model[]} context.records Array of records that are going to be removed
|
|
318
353
|
*/
|
|
319
354
|
function beforeRemoveRecords(component: any, { records, removingAll }: { records: any[]; removingAll: boolean }): void {
|
|
@@ -361,9 +396,9 @@ function updateGeneration(component: any, thisTick = false, callback = () => {})
|
|
|
361
396
|
* Component about to be updated, from changing a prop using state.
|
|
362
397
|
* React to it depending on what changed and prevent react from re-rendering our component.
|
|
363
398
|
* @param {*} component react component instance
|
|
364
|
-
* @param nextProps
|
|
365
|
-
* @param nextState
|
|
366
|
-
* @returns {
|
|
399
|
+
* @param {object} nextProps Next props
|
|
400
|
+
* @param {object} nextState Next state
|
|
401
|
+
* @returns {boolean}
|
|
367
402
|
*/
|
|
368
403
|
function shouldComponentUpdate(component: any, nextProps: Readonly<any>, nextState: Readonly<any>): boolean {
|
|
369
404
|
const { props, instance, propertyNames } = component;
|
|
@@ -380,10 +415,10 @@ function shouldComponentUpdate(component: any, nextProps: Readonly<any>, nextSta
|
|
|
380
415
|
}
|
|
381
416
|
|
|
382
417
|
/**
|
|
383
|
-
*
|
|
384
|
-
* @param {
|
|
385
|
-
* @param {
|
|
386
|
-
* @returns {
|
|
418
|
+
* Checks if the cell content is a React element
|
|
419
|
+
* @param {object} context Renderer context object
|
|
420
|
+
* @param {*} context.cellContent Content to be rendered in cell (set by renderer)
|
|
421
|
+
* @returns {boolean} `true` if there is a React Renderer in this cell, `false` otherwise
|
|
387
422
|
*/
|
|
388
423
|
function hasFrameworkRenderer({ cellContent }: { cellContent: any }): boolean {
|
|
389
424
|
// @ts-ignore
|
|
@@ -393,9 +428,9 @@ function hasFrameworkRenderer({ cellContent }: { cellContent: any }): boolean {
|
|
|
393
428
|
/**
|
|
394
429
|
* Hook called by instance when rendering cells within
|
|
395
430
|
* Row::renderCell(), creates portals for JSX supplied by renderers
|
|
396
|
-
* @param {
|
|
397
|
-
* @param {
|
|
398
|
-
* @param {
|
|
431
|
+
* @param {object} context Renderer context object
|
|
432
|
+
* @param {object} context.rendererData Data passed from renderCell
|
|
433
|
+
* @param {object} context.cellElementData Data passed from renderCell
|
|
399
434
|
*/
|
|
400
435
|
function processCellContent(this: { reactComponent: any; isExporting: boolean; $isCollapsing: boolean; }, { rendererData, cellElementData, rendererHtml }: {
|
|
401
436
|
rendererData: any
|
|
@@ -793,10 +828,102 @@ function processCalendarEventContent(this: any, {
|
|
|
793
828
|
return returnValue;
|
|
794
829
|
}
|
|
795
830
|
|
|
831
|
+
function processTaskContent(this: any, {
|
|
832
|
+
jsx, // React element to render in portal
|
|
833
|
+
action, // Rendering action
|
|
834
|
+
targetElement, // DOM element to create portal in
|
|
835
|
+
reactComponent // the React wrapper component
|
|
836
|
+
}: {
|
|
837
|
+
jsx: ReactElement
|
|
838
|
+
action: string
|
|
839
|
+
targetElement: HTMLElementWithData
|
|
840
|
+
reactComponent: React.Component & { syncContent: (fn: () => unknown) => void }
|
|
841
|
+
}): boolean {
|
|
842
|
+
|
|
843
|
+
const { taskResize } = this.features;
|
|
844
|
+
|
|
845
|
+
if (
|
|
846
|
+
!reactComponent ||
|
|
847
|
+
action !== 'syncFwConfig' ||
|
|
848
|
+
(taskResize?.isResizing && !taskResize.dragging.completed)
|
|
849
|
+
) {
|
|
850
|
+
return false;
|
|
851
|
+
}
|
|
852
|
+
|
|
853
|
+
// Ensure we have the expected DOM structure and type safety
|
|
854
|
+
const wrap : HTMLElementWithData | null | undefined = targetElement.parentElement?.parentElement;
|
|
855
|
+
|
|
856
|
+
if (!wrap?.elementData) {
|
|
857
|
+
return false;
|
|
858
|
+
}
|
|
859
|
+
|
|
860
|
+
const
|
|
861
|
+
wrapData = wrap.elementData,
|
|
862
|
+
{ taskRecord } = wrapData,
|
|
863
|
+
state = reactComponent.state as ReactComponentState,
|
|
864
|
+
{ portals } = state,
|
|
865
|
+
portalId = `portal-task-${taskRecord.id}`;
|
|
866
|
+
|
|
867
|
+
if (taskRecord.isMilestone) {
|
|
868
|
+
deletePortal(reactComponent, portalId);
|
|
869
|
+
targetElement.innerHTML = '';
|
|
870
|
+
wrap.lastPortalId = null;
|
|
871
|
+
return false;
|
|
872
|
+
}
|
|
873
|
+
|
|
874
|
+
// Make this function available for testing. It is used for synchronizing task content, specifically
|
|
875
|
+
// for React portal rendering. It should only be called during event D&D drop operation.
|
|
876
|
+
reactComponent.syncContent = reactComponent.syncContent || function(fn: () => unknown) {
|
|
877
|
+
flushSync(fn);
|
|
878
|
+
};
|
|
879
|
+
|
|
880
|
+
const parent = wrap.querySelector('.b-gantt-task-content') as HTMLElement;
|
|
881
|
+
|
|
882
|
+
if (jsx) {
|
|
883
|
+
|
|
884
|
+
const
|
|
885
|
+
portal = portals.get(portalId),
|
|
886
|
+
updateContent = () => {
|
|
887
|
+
// Clean-up the content element
|
|
888
|
+
parent!.innerHTML = '';
|
|
889
|
+
const
|
|
890
|
+
jsxContainer = DomHelper.createElement({
|
|
891
|
+
className : 'b-jsx-container',
|
|
892
|
+
// As stated above, we are at the wrapper, but we should render the JSX inside the content element
|
|
893
|
+
parent,
|
|
894
|
+
// Signal DomSync to not remove React-controlled content
|
|
895
|
+
retainElement : true
|
|
896
|
+
}) as Element,
|
|
897
|
+
portal = ReactDOM.createPortal(jsx, jsxContainer) as ReactPortalWithTaskGeneration;
|
|
898
|
+
|
|
899
|
+
// Store taskGeneration on the portal to easily determine later if it needs to be updated
|
|
900
|
+
portal.taskGeneration = wrap.elementData.taskGeneration;
|
|
901
|
+
|
|
902
|
+
// Save portalId for later use
|
|
903
|
+
wrap.lastPortalId = portalId;
|
|
904
|
+
|
|
905
|
+
// Store portal in map in state, so that React can keep track of it
|
|
906
|
+
portals.set(portalId, portal);
|
|
907
|
+
updateGeneration(reactComponent, true);
|
|
908
|
+
|
|
909
|
+
targetElement.didSetTextContent = true;
|
|
910
|
+
};
|
|
911
|
+
|
|
912
|
+
// Recreate portal only if the underlying taskRecord has changed or is different from last used
|
|
913
|
+
if (!portal || portal.taskGeneration !== wrap.elementData.taskGeneration || wrap.lastPortalId !== portalId) {
|
|
914
|
+
// Delete the old portal if one exists
|
|
915
|
+
deletePortal(reactComponent, portalId);
|
|
916
|
+
updateContent();
|
|
917
|
+
}
|
|
918
|
+
}
|
|
919
|
+
|
|
920
|
+
return true;
|
|
921
|
+
}
|
|
922
|
+
|
|
796
923
|
/**
|
|
797
924
|
* Generate a unique portal ID for an event.
|
|
798
|
-
* @param {
|
|
799
|
-
* @param {
|
|
925
|
+
* @param {object} assignmentRecord The assignment record
|
|
926
|
+
* @param {object} [eventRecord] The event record
|
|
800
927
|
* @param {string} [segment] Segment identifier for split events
|
|
801
928
|
* @param {boolean} [isExporting] To check if exporting is in progress
|
|
802
929
|
* @returns {string} The generated portal ID
|
|
@@ -811,8 +938,8 @@ function generateEventPortalId(assignmentRecord: any, eventRecord?: any, segment
|
|
|
811
938
|
* DomSync only fires callback for it and not for children. The nested children are removed as part of
|
|
812
939
|
* removing the parent, so their callbacks don't fire individually. We must explicitly clean up their portals here.
|
|
813
940
|
* @param {*} component React Component, the wrapper itself
|
|
814
|
-
* @param {
|
|
815
|
-
* @param {
|
|
941
|
+
* @param {object} parentEventRecord The parent event record
|
|
942
|
+
* @param {object} resourceRecord The resource record (needed for assignment lookup)
|
|
816
943
|
* @param {boolean} isExporting Whether we're in export mode
|
|
817
944
|
*/
|
|
818
945
|
function deleteNestedEventPortals(component: any, parentEventRecord: any, resourceRecord: any, isExporting: boolean): void {
|
|
@@ -959,7 +1086,7 @@ function processEventContent(this: any, {
|
|
|
959
1086
|
generationUpdateFlag = true;
|
|
960
1087
|
}
|
|
961
1088
|
|
|
962
|
-
// If nestedEvents feature is enabled and this is
|
|
1089
|
+
// If nestedEvents feature is enabled and this is an event with nested children, need
|
|
963
1090
|
// to clean up their portals. Because DomSync only fires callback for the parent when it's released,
|
|
964
1091
|
// nested children are removed as part of removing the parent, so their callbacks don't fire.
|
|
965
1092
|
if (nestedEvents?.enabled && eventRecord.children?.length) {
|
|
@@ -1097,9 +1224,9 @@ function handleReactElement(widget: Widget, element: any): void {
|
|
|
1097
1224
|
/**
|
|
1098
1225
|
* Handles the React header element by processing JSX content within the widget.
|
|
1099
1226
|
*
|
|
1100
|
-
* @param {
|
|
1227
|
+
* @param {object} column Object containing grid and id properties
|
|
1101
1228
|
* @param {HTMLElement} headerElement The header element to be processed
|
|
1102
|
-
* @param {
|
|
1229
|
+
* @param {any} html JSX content to be processed
|
|
1103
1230
|
*/
|
|
1104
1231
|
function handleReactHeaderElement(column: { grid: any; id: string }, headerElement: HTMLElement, html: any): void {
|
|
1105
1232
|
const
|
package/src/index.ts
CHANGED
|
@@ -9,6 +9,7 @@ export * from './BryntumThemeCombo';
|
|
|
9
9
|
export * from './BryntumAIFilterField';
|
|
10
10
|
export * from './BryntumAssignmentField';
|
|
11
11
|
export * from './BryntumAssignmentGrid';
|
|
12
|
+
export * from './BryntumAssignmentPicker';
|
|
12
13
|
export * from './BryntumButton';
|
|
13
14
|
export * from './BryntumButtonGroup';
|
|
14
15
|
export * from './BryntumCalendarEditor';
|
|
@@ -62,6 +63,7 @@ export * from './BryntumNumberField';
|
|
|
62
63
|
export * from './BryntumPagingToolbar';
|
|
63
64
|
export * from './BryntumPanel';
|
|
64
65
|
export * from './BryntumPasswordField';
|
|
66
|
+
export * from './BryntumProgressBar';
|
|
65
67
|
export * from './BryntumProjectCombo';
|
|
66
68
|
export * from './BryntumGanttProjectModel';
|
|
67
69
|
export * from './BryntumRadio';
|