pixel-react 1.10.11 → 1.10.13
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/lib/StyleGuide/ColorPalette/ColorPalette.stories.d.ts +6 -0
- package/lib/StyleGuide/Typography/Typography.stories.d.ts +6 -0
- package/lib/components/Accordion/Accordion.stories.d.ts +6 -0
- package/lib/components/AddResourceButton/AddButton.stories.d.ts +8 -0
- package/lib/components/Button/Button.stories.d.ts +12 -0
- package/lib/components/Charts/DonutChart/DonutChart.stories.d.ts +6 -0
- package/lib/components/Charts/RadialChart/RadialChart.stories.d.ts +6 -0
- package/lib/components/Checkbox/Checkbox.stories.d.ts +8 -0
- package/lib/components/Chip/Chip.stories.d.ts +14 -0
- package/lib/components/DatePicker/DatePicker.stories.d.ts +9 -0
- package/lib/components/DragAndDrop/DragAndDrop.stories.d.ts +6 -0
- package/lib/components/Drawer/Drawer.stories.d.ts +7 -0
- package/lib/components/ExpandableMenu/ExpandableMenu.stories.d.ts +7 -0
- package/lib/components/FileDropzone/FileDropzone.stories.d.ts +8 -0
- package/lib/components/Form/Form.stories.d.ts +6 -0
- package/lib/components/GridLayout/GridLayout.stories.d.ts +8 -0
- package/lib/components/HighlightText/HighlightText.stories.d.ts +6 -0
- package/lib/components/Icon/Icon.stories.d.ts +7 -0
- package/lib/components/IconButton/IconButton.stories.d.ts +6 -0
- package/lib/components/Input/Input.stories.d.ts +9 -0
- package/lib/components/InputWithDropdown/InputWithDropdown.stories.d.ts +9 -0
- package/lib/components/LazyLoad/LazyLoad.stories.d.ts +6 -0
- package/lib/components/MenuOption/MenuOption.stories.d.ts +15 -0
- package/lib/components/MiniModal/MiniModal.stories.d.ts +9 -0
- package/lib/components/Modal/Modal.stories.d.ts +7 -0
- package/lib/components/MultiSelect/MultiSelect.stories.d.ts +9 -0
- package/lib/components/RadioButton/RadioButton.stories.d.ts +10 -0
- package/lib/components/RadioGroup/RadioGroup.stories.d.ts +8 -0
- package/lib/components/Search/Search.stories.d.ts +6 -0
- package/lib/components/Select/Select.stories.d.ts +13 -0
- package/lib/components/Select/components/Dropdown/Dropdown.d.ts +4 -0
- package/lib/components/Select/components/Dropdown/dropdownTypes.d.ts +15 -0
- package/lib/components/SequentialConnectingBranch/components/AddBrowserModal/AddBrowserModal.d.ts +4 -0
- package/lib/components/SequentialConnectingBranch/components/AddBrowserModal/types.d.ts +3 -0
- package/lib/components/SequentialConnectingBranch/components/DatasetListModal/DatasetListModal.d.ts +4 -0
- package/lib/components/SequentialConnectingBranch/components/DatasetListModal/types.d.ts +3 -0
- package/lib/components/StateDropdown/StateDropdown.stories.d.ts +10 -0
- package/lib/components/StatusButton/StatusButton.stories.d.ts +14 -0
- package/lib/components/Table/Table.stories.d.ts +11 -0
- package/lib/components/TableTree/TableTree.stories.d.ts +7 -0
- package/lib/components/Tabs/Tabs.stories.d.ts +9 -0
- package/lib/components/TextArea/Textarea.stories.d.ts +9 -0
- package/lib/components/ThemeProvider/CustomThemeProvider.d.ts +8 -0
- package/lib/components/Toast/Toast.stories.d.ts +6 -0
- package/lib/components/Toggle/Toggle.stories.d.ts +12 -0
- package/lib/components/Tooltip/Tooltip.stories.d.ts +15 -0
- package/lib/components/Typography/Typography.stories.d.ts +10 -0
- package/lib/hooks/useCustomThemeProvider.d.ts +11 -0
- package/lib/index.esm.js +222 -382
- package/lib/index.esm.js.map +1 -1
- package/lib/index.js +222 -382
- package/lib/index.js.map +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/lib/utils/checkEmpty/checkEmpty.stories.d.ts +6 -0
- package/lib/utils/compareArrays/compareArrays.stories.d.ts +6 -0
- package/lib/utils/compareObjects/compareObjects.stories.d.ts +6 -0
- package/lib/utils/debounce/debounce.stories.d.ts +6 -0
- package/lib/utils/ffID/ffID.stories.d.ts +6 -0
- package/lib/utils/find/findAndInsert.d.ts +7 -0
- package/lib/utils/find/findAndInsert.stories.d.ts +7 -0
- package/lib/utils/getExtension/getExtension.stories.d.ts +6 -0
- package/lib/utils/throttle/throttle.stories.d.ts +6 -0
- package/lib/utils/truncateText/truncateText.stories.d.ts +6 -0
- package/package.json +1 -1
- package/src/components/Charts/MultiRadialChart/MultiRadialChart.tsx +1 -1
- package/src/components/TableTree/Components/TableCell.tsx +1 -1
- package/src/components/TableTree/TableTree.scss +11 -0
package/lib/index.esm.js
CHANGED
@@ -4029,8 +4029,6 @@ function LiveRegion(_ref) {
|
|
4029
4029
|
// Hide element visually but keep it readable by screen readers
|
4030
4030
|
const visuallyHidden = {
|
4031
4031
|
position: 'fixed',
|
4032
|
-
top: 0,
|
4033
|
-
left: 0,
|
4034
4032
|
width: 1,
|
4035
4033
|
height: 1,
|
4036
4034
|
margin: -1,
|
@@ -5020,12 +5018,11 @@ var KeyboardCode;
|
|
5020
5018
|
KeyboardCode["Up"] = "ArrowUp";
|
5021
5019
|
KeyboardCode["Esc"] = "Escape";
|
5022
5020
|
KeyboardCode["Enter"] = "Enter";
|
5023
|
-
KeyboardCode["Tab"] = "Tab";
|
5024
5021
|
})(KeyboardCode || (KeyboardCode = {}));
|
5025
5022
|
const defaultKeyboardCodes = {
|
5026
5023
|
start: [KeyboardCode.Space, KeyboardCode.Enter],
|
5027
5024
|
cancel: [KeyboardCode.Esc],
|
5028
|
-
end: [KeyboardCode.Space, KeyboardCode.Enter
|
5025
|
+
end: [KeyboardCode.Space, KeyboardCode.Enter]
|
5029
5026
|
};
|
5030
5027
|
const defaultKeyboardCoordinateGetter = (event, _ref) => {
|
5031
5028
|
let {
|
@@ -5324,9 +5321,6 @@ class AbstractPointerSensor {
|
|
5324
5321
|
passive: false
|
5325
5322
|
});
|
5326
5323
|
this.listeners.add(events.end.name, this.handleEnd);
|
5327
|
-
if (events.cancel) {
|
5328
|
-
this.listeners.add(events.cancel.name, this.handleCancel);
|
5329
|
-
}
|
5330
5324
|
this.windowListeners.add(EventName.Resize, this.handleCancel);
|
5331
5325
|
this.windowListeners.add(EventName.DragStart, preventDefault);
|
5332
5326
|
this.windowListeners.add(EventName.VisibilityChange, this.handleCancel);
|
@@ -5342,11 +5336,9 @@ class AbstractPointerSensor {
|
|
5342
5336
|
}
|
5343
5337
|
if (isDelayConstraint(activationConstraint)) {
|
5344
5338
|
this.timeoutId = setTimeout(this.handleStart, activationConstraint.delay);
|
5345
|
-
this.handlePending(activationConstraint);
|
5346
5339
|
return;
|
5347
5340
|
}
|
5348
5341
|
if (isDistanceConstraint(activationConstraint)) {
|
5349
|
-
this.handlePending(activationConstraint);
|
5350
5342
|
return;
|
5351
5343
|
}
|
5352
5344
|
}
|
@@ -5363,13 +5355,6 @@ class AbstractPointerSensor {
|
|
5363
5355
|
this.timeoutId = null;
|
5364
5356
|
}
|
5365
5357
|
}
|
5366
|
-
handlePending(constraint, offset) {
|
5367
|
-
const {
|
5368
|
-
active,
|
5369
|
-
onPending
|
5370
|
-
} = this.props;
|
5371
|
-
onPending(active, constraint, this.initialCoordinates, offset);
|
5372
|
-
}
|
5373
5358
|
handleStart() {
|
5374
5359
|
const {
|
5375
5360
|
initialCoordinates
|
@@ -5423,7 +5408,6 @@ class AbstractPointerSensor {
|
|
5423
5408
|
return this.handleCancel();
|
5424
5409
|
}
|
5425
5410
|
}
|
5426
|
-
this.handlePending(activationConstraint, delta);
|
5427
5411
|
return;
|
5428
5412
|
}
|
5429
5413
|
if (event.cancelable) {
|
@@ -5433,24 +5417,16 @@ class AbstractPointerSensor {
|
|
5433
5417
|
}
|
5434
5418
|
handleEnd() {
|
5435
5419
|
const {
|
5436
|
-
onAbort,
|
5437
5420
|
onEnd
|
5438
5421
|
} = this.props;
|
5439
5422
|
this.detach();
|
5440
|
-
if (!this.activated) {
|
5441
|
-
onAbort(this.props.active);
|
5442
|
-
}
|
5443
5423
|
onEnd();
|
5444
5424
|
}
|
5445
5425
|
handleCancel() {
|
5446
5426
|
const {
|
5447
|
-
onAbort,
|
5448
5427
|
onCancel
|
5449
5428
|
} = this.props;
|
5450
5429
|
this.detach();
|
5451
|
-
if (!this.activated) {
|
5452
|
-
onAbort(this.props.active);
|
5453
|
-
}
|
5454
5430
|
onCancel();
|
5455
5431
|
}
|
5456
5432
|
handleKeydown(event) {
|
@@ -5464,9 +5440,6 @@ class AbstractPointerSensor {
|
|
5464
5440
|
}
|
5465
5441
|
}
|
5466
5442
|
const events = {
|
5467
|
-
cancel: {
|
5468
|
-
name: 'pointercancel'
|
5469
|
-
},
|
5470
5443
|
move: {
|
5471
5444
|
name: 'pointermove'
|
5472
5445
|
},
|
@@ -5539,9 +5512,6 @@ MouseSensor.activators = [{
|
|
5539
5512
|
}
|
5540
5513
|
}];
|
5541
5514
|
const events$2 = {
|
5542
|
-
cancel: {
|
5543
|
-
name: 'touchcancel'
|
5544
|
-
},
|
5545
5515
|
move: {
|
5546
5516
|
name: 'touchmove'
|
5547
5517
|
},
|
@@ -5743,11 +5713,11 @@ function useScrollIntent(_ref2) {
|
|
5743
5713
|
}, [disabled, delta, previousDelta]);
|
5744
5714
|
}
|
5745
5715
|
function useCachedNode(draggableNodes, id) {
|
5746
|
-
const draggableNode = id
|
5716
|
+
const draggableNode = id !== null ? draggableNodes.get(id) : undefined;
|
5747
5717
|
const node = draggableNode ? draggableNode.node.current : null;
|
5748
5718
|
return useLazyMemo(cachedNode => {
|
5749
5719
|
var _ref;
|
5750
|
-
if (id
|
5720
|
+
if (id === null) {
|
5751
5721
|
return null;
|
5752
5722
|
} // In some cases, the draggable node can unmount while dragging
|
5753
5723
|
// This is the case for virtualized lists. In those situations,
|
@@ -5955,26 +5925,7 @@ function useRect(element, measure, fallbackRect) {
|
|
5955
5925
|
if (measure === void 0) {
|
5956
5926
|
measure = defaultMeasure;
|
5957
5927
|
}
|
5958
|
-
const [rect,
|
5959
|
-
function measureRect() {
|
5960
|
-
setRect(currentRect => {
|
5961
|
-
if (!element) {
|
5962
|
-
return null;
|
5963
|
-
}
|
5964
|
-
if (element.isConnected === false) {
|
5965
|
-
var _ref;
|
5966
|
-
|
5967
|
-
// Fall back to last rect we measured if the element is
|
5968
|
-
// no longer connected to the DOM.
|
5969
|
-
return (_ref = currentRect != null ? currentRect : fallbackRect) != null ? _ref : null;
|
5970
|
-
}
|
5971
|
-
const newRect = measure(element);
|
5972
|
-
if (JSON.stringify(currentRect) === JSON.stringify(newRect)) {
|
5973
|
-
return currentRect;
|
5974
|
-
}
|
5975
|
-
return newRect;
|
5976
|
-
});
|
5977
|
-
}
|
5928
|
+
const [rect, measureRect] = useReducer(reducer, null);
|
5978
5929
|
const mutationObserver = useMutationObserver({
|
5979
5930
|
callback(records) {
|
5980
5931
|
if (!element) {
|
@@ -6009,6 +5960,23 @@ function useRect(element, measure, fallbackRect) {
|
|
6009
5960
|
}
|
6010
5961
|
}, [element]);
|
6011
5962
|
return rect;
|
5963
|
+
function reducer(currentRect) {
|
5964
|
+
if (!element) {
|
5965
|
+
return null;
|
5966
|
+
}
|
5967
|
+
if (element.isConnected === false) {
|
5968
|
+
var _ref;
|
5969
|
+
|
5970
|
+
// Fall back to last rect we measured if the element is
|
5971
|
+
// no longer connected to the DOM.
|
5972
|
+
return (_ref = currentRect != null ? currentRect : fallbackRect) != null ? _ref : null;
|
5973
|
+
}
|
5974
|
+
const newRect = measure(element);
|
5975
|
+
if (JSON.stringify(currentRect) === JSON.stringify(newRect)) {
|
5976
|
+
return currentRect;
|
5977
|
+
}
|
5978
|
+
return newRect;
|
5979
|
+
}
|
6012
5980
|
}
|
6013
5981
|
function useRectDelta(rect) {
|
6014
5982
|
const initialRect = useInitialValue(rect);
|
@@ -6154,24 +6122,28 @@ function useRects(elements, measure) {
|
|
6154
6122
|
}
|
6155
6123
|
const [firstElement] = elements;
|
6156
6124
|
const windowRect = useWindowRect(firstElement ? getWindow(firstElement) : null);
|
6157
|
-
const [rects,
|
6158
|
-
function measureRects() {
|
6159
|
-
setRects(() => {
|
6160
|
-
if (!elements.length) {
|
6161
|
-
return defaultValue$2;
|
6162
|
-
}
|
6163
|
-
return elements.map(element => isDocumentScrollingElement(element) ? windowRect : new Rect(measure(element), element));
|
6164
|
-
});
|
6165
|
-
}
|
6125
|
+
const [rects, measureRects] = useReducer(reducer, defaultValue$2);
|
6166
6126
|
const resizeObserver = useResizeObserver({
|
6167
6127
|
callback: measureRects
|
6168
6128
|
});
|
6169
|
-
|
6170
|
-
resizeObserver == null ? void 0 : resizeObserver.disconnect();
|
6129
|
+
if (elements.length > 0 && rects === defaultValue$2) {
|
6171
6130
|
measureRects();
|
6172
|
-
|
6131
|
+
}
|
6132
|
+
useIsomorphicLayoutEffect$1(() => {
|
6133
|
+
if (elements.length) {
|
6134
|
+
elements.forEach(element => resizeObserver == null ? void 0 : resizeObserver.observe(element));
|
6135
|
+
} else {
|
6136
|
+
resizeObserver == null ? void 0 : resizeObserver.disconnect();
|
6137
|
+
measureRects();
|
6138
|
+
}
|
6173
6139
|
}, [elements]);
|
6174
6140
|
return rects;
|
6141
|
+
function reducer() {
|
6142
|
+
if (!elements.length) {
|
6143
|
+
return defaultValue$2;
|
6144
|
+
}
|
6145
|
+
return elements.map(element => isDocumentScrollingElement(element) ? windowRect : new Rect(measure(element), element));
|
6146
|
+
}
|
6175
6147
|
}
|
6176
6148
|
function getMeasurableNode(node) {
|
6177
6149
|
if (!node) {
|
@@ -6338,7 +6310,7 @@ function reducer$1(state, action) {
|
|
6338
6310
|
}
|
6339
6311
|
};
|
6340
6312
|
case Action.DragMove:
|
6341
|
-
if (state.draggable.active
|
6313
|
+
if (!state.draggable.active) {
|
6342
6314
|
return state;
|
6343
6315
|
}
|
6344
6316
|
return {
|
@@ -6610,7 +6582,7 @@ const DndContext = /*#__PURE__*/memo(function DndContext(_ref) {
|
|
6610
6582
|
containers: droppableContainers
|
6611
6583
|
}
|
6612
6584
|
} = state;
|
6613
|
-
const node = activeId
|
6585
|
+
const node = activeId ? draggableNodes.get(activeId) : null;
|
6614
6586
|
const activeRects = useRef({
|
6615
6587
|
initial: null,
|
6616
6588
|
translated: null
|
@@ -6645,7 +6617,7 @@ const DndContext = /*#__PURE__*/memo(function DndContext(_ref) {
|
|
6645
6617
|
const autoScrollOptions = getAutoScrollerOptions();
|
6646
6618
|
const initialActiveNodeRect = useInitialRect(activeNode, measuringConfiguration.draggable.measure);
|
6647
6619
|
useLayoutShiftScrollCompensation({
|
6648
|
-
activeNode: activeId
|
6620
|
+
activeNode: activeId ? draggableNodes.get(activeId) : null,
|
6649
6621
|
config: autoScrollOptions.layoutShiftCompensation,
|
6650
6622
|
initialRect: initialActiveNodeRect,
|
6651
6623
|
measure: measuringConfiguration.draggable.measure
|
@@ -6723,7 +6695,6 @@ const DndContext = /*#__PURE__*/memo(function DndContext(_ref) {
|
|
6723
6695
|
|
6724
6696
|
const appliedTranslate = usesDragOverlay ? modifiedTranslate : add(modifiedTranslate, activeNodeScrollDelta);
|
6725
6697
|
const transform = adjustScale(appliedTranslate, (_over$rect = over == null ? void 0 : over.rect) != null ? _over$rect : null, activeNodeRect);
|
6726
|
-
const activeSensorRef = useRef(null);
|
6727
6698
|
const instantiateSensor = useCallback((event, _ref2) => {
|
6728
6699
|
let {
|
6729
6700
|
sensor: Sensor,
|
@@ -6745,43 +6716,6 @@ const DndContext = /*#__PURE__*/memo(function DndContext(_ref) {
|
|
6745
6716
|
// Sensors need to be instantiated with refs for arguments that change over time
|
6746
6717
|
// otherwise they are frozen in time with the stale arguments
|
6747
6718
|
context: sensorContext,
|
6748
|
-
onAbort(id) {
|
6749
|
-
const draggableNode = draggableNodes.get(id);
|
6750
|
-
if (!draggableNode) {
|
6751
|
-
return;
|
6752
|
-
}
|
6753
|
-
const {
|
6754
|
-
onDragAbort
|
6755
|
-
} = latestProps.current;
|
6756
|
-
const event = {
|
6757
|
-
id
|
6758
|
-
};
|
6759
|
-
onDragAbort == null ? void 0 : onDragAbort(event);
|
6760
|
-
dispatchMonitorEvent({
|
6761
|
-
type: 'onDragAbort',
|
6762
|
-
event
|
6763
|
-
});
|
6764
|
-
},
|
6765
|
-
onPending(id, constraint, initialCoordinates, offset) {
|
6766
|
-
const draggableNode = draggableNodes.get(id);
|
6767
|
-
if (!draggableNode) {
|
6768
|
-
return;
|
6769
|
-
}
|
6770
|
-
const {
|
6771
|
-
onDragPending
|
6772
|
-
} = latestProps.current;
|
6773
|
-
const event = {
|
6774
|
-
id,
|
6775
|
-
constraint,
|
6776
|
-
initialCoordinates,
|
6777
|
-
offset
|
6778
|
-
};
|
6779
|
-
onDragPending == null ? void 0 : onDragPending(event);
|
6780
|
-
dispatchMonitorEvent({
|
6781
|
-
type: 'onDragPending',
|
6782
|
-
event
|
6783
|
-
});
|
6784
|
-
},
|
6785
6719
|
onStart(initialCoordinates) {
|
6786
6720
|
const id = activeRef.current;
|
6787
6721
|
if (id == null) {
|
@@ -6795,7 +6729,6 @@ const DndContext = /*#__PURE__*/memo(function DndContext(_ref) {
|
|
6795
6729
|
onDragStart
|
6796
6730
|
} = latestProps.current;
|
6797
6731
|
const event = {
|
6798
|
-
activatorEvent,
|
6799
6732
|
active: {
|
6800
6733
|
id,
|
6801
6734
|
data: draggableNode.data,
|
@@ -6814,8 +6747,6 @@ const DndContext = /*#__PURE__*/memo(function DndContext(_ref) {
|
|
6814
6747
|
type: 'onDragStart',
|
6815
6748
|
event
|
6816
6749
|
});
|
6817
|
-
setActiveSensor(activeSensorRef.current);
|
6818
|
-
setActivatorEvent(activatorEvent);
|
6819
6750
|
});
|
6820
6751
|
},
|
6821
6752
|
onMove(coordinates) {
|
@@ -6827,7 +6758,10 @@ const DndContext = /*#__PURE__*/memo(function DndContext(_ref) {
|
|
6827
6758
|
onEnd: createHandler(Action.DragEnd),
|
6828
6759
|
onCancel: createHandler(Action.DragCancel)
|
6829
6760
|
});
|
6830
|
-
|
6761
|
+
unstable_batchedUpdates(() => {
|
6762
|
+
setActiveSensor(sensorInstance);
|
6763
|
+
setActivatorEvent(event.nativeEvent);
|
6764
|
+
});
|
6831
6765
|
function createHandler(type) {
|
6832
6766
|
return async function handler() {
|
6833
6767
|
const {
|
@@ -6864,7 +6798,6 @@ const DndContext = /*#__PURE__*/memo(function DndContext(_ref) {
|
|
6864
6798
|
setOver(null);
|
6865
6799
|
setActiveSensor(null);
|
6866
6800
|
setActivatorEvent(null);
|
6867
|
-
activeSensorRef.current = null;
|
6868
6801
|
const eventName = type === Action.DragEnd ? 'onDragEnd' : 'onDragCancel';
|
6869
6802
|
if (event) {
|
6870
6803
|
const handler = latestProps.current[eventName];
|
@@ -7086,7 +7019,7 @@ const DndContext = /*#__PURE__*/memo(function DndContext(_ref) {
|
|
7086
7019
|
});
|
7087
7020
|
const NullContext = /*#__PURE__*/createContext$1(null);
|
7088
7021
|
const defaultRole = 'button';
|
7089
|
-
const ID_PREFIX$1 = '
|
7022
|
+
const ID_PREFIX$1 = 'Droppable';
|
7090
7023
|
function useDraggable(_ref) {
|
7091
7024
|
let {
|
7092
7025
|
id,
|
@@ -7233,7 +7166,7 @@ function useDroppable(_ref) {
|
|
7233
7166
|
resizeObserverConnected.current = false;
|
7234
7167
|
resizeObserver.observe(nodeRef.current);
|
7235
7168
|
}, [nodeRef, resizeObserver]);
|
7236
|
-
|
7169
|
+
useIsomorphicLayoutEffect$1(() => {
|
7237
7170
|
dispatch({
|
7238
7171
|
type: Action.RegisterDroppable,
|
7239
7172
|
element: {
|
@@ -7648,7 +7581,6 @@ var DNDCore = /*#__PURE__*/Object.freeze({
|
|
7648
7581
|
defaultCoordinates: defaultCoordinates,
|
7649
7582
|
defaultDropAnimation: defaultDropAnimationConfiguration,
|
7650
7583
|
defaultDropAnimationSideEffects: defaultDropAnimationSideEffects,
|
7651
|
-
defaultKeyboardCoordinateGetter: defaultKeyboardCoordinateGetter,
|
7652
7584
|
defaultScreenReaderInstructions: defaultScreenReaderInstructions,
|
7653
7585
|
getClientRect: getClientRect,
|
7654
7586
|
getFirstCollision: getFirstCollision,
|
@@ -11486,14 +11418,13 @@ var isWeb = typeof window !== 'undefined' &&
|
|
11486
11418
|
function cloneObject(data) {
|
11487
11419
|
let copy;
|
11488
11420
|
const isArray = Array.isArray(data);
|
11489
|
-
const isFileListInstance = typeof FileList !== 'undefined' ? data instanceof FileList : false;
|
11490
11421
|
if (data instanceof Date) {
|
11491
11422
|
copy = new Date(data);
|
11492
11423
|
}
|
11493
11424
|
else if (data instanceof Set) {
|
11494
11425
|
copy = new Set(data);
|
11495
11426
|
}
|
11496
|
-
else if (!(isWeb && (data instanceof Blob ||
|
11427
|
+
else if (!(isWeb && (data instanceof Blob || data instanceof FileList)) &&
|
11497
11428
|
(isArray || isObject$2(data))) {
|
11498
11429
|
copy = isArray ? [] : {};
|
11499
11430
|
if (!isArray && !isPlainObject(data)) {
|
@@ -11552,7 +11483,7 @@ var set$1 = (object, path, value) => {
|
|
11552
11483
|
? []
|
11553
11484
|
: {};
|
11554
11485
|
}
|
11555
|
-
if (key === '__proto__'
|
11486
|
+
if (key === '__proto__') {
|
11556
11487
|
return;
|
11557
11488
|
}
|
11558
11489
|
object[key] = newValue;
|
@@ -11771,7 +11702,7 @@ function useFormState(props) {
|
|
11771
11702
|
_mounted.current = false;
|
11772
11703
|
};
|
11773
11704
|
}, [control]);
|
11774
|
-
return
|
11705
|
+
return getProxyFormState(formState, control, _localProxyFormState.current, false);
|
11775
11706
|
}
|
11776
11707
|
|
11777
11708
|
var isString = (value) => typeof value === 'string';
|
@@ -11867,67 +11798,6 @@ function useController(props) {
|
|
11867
11798
|
value,
|
11868
11799
|
...(isBoolean(props.disabled) ? { disabled: props.disabled } : {}),
|
11869
11800
|
}));
|
11870
|
-
const fieldState = React__default.useMemo(() => Object.defineProperties({}, {
|
11871
|
-
invalid: {
|
11872
|
-
enumerable: true,
|
11873
|
-
get: () => !!get$1(formState.errors, name),
|
11874
|
-
},
|
11875
|
-
isDirty: {
|
11876
|
-
enumerable: true,
|
11877
|
-
get: () => !!get$1(formState.dirtyFields, name),
|
11878
|
-
},
|
11879
|
-
isTouched: {
|
11880
|
-
enumerable: true,
|
11881
|
-
get: () => !!get$1(formState.touchedFields, name),
|
11882
|
-
},
|
11883
|
-
isValidating: {
|
11884
|
-
enumerable: true,
|
11885
|
-
get: () => !!get$1(formState.validatingFields, name),
|
11886
|
-
},
|
11887
|
-
error: {
|
11888
|
-
enumerable: true,
|
11889
|
-
get: () => get$1(formState.errors, name),
|
11890
|
-
},
|
11891
|
-
}), [formState, name]);
|
11892
|
-
const field = React__default.useMemo(() => ({
|
11893
|
-
name,
|
11894
|
-
value,
|
11895
|
-
...(isBoolean(disabled) || formState.disabled
|
11896
|
-
? { disabled: formState.disabled || disabled }
|
11897
|
-
: {}),
|
11898
|
-
onChange: (event) => _registerProps.current.onChange({
|
11899
|
-
target: {
|
11900
|
-
value: getEventValue(event),
|
11901
|
-
name: name,
|
11902
|
-
},
|
11903
|
-
type: EVENTS.CHANGE,
|
11904
|
-
}),
|
11905
|
-
onBlur: () => _registerProps.current.onBlur({
|
11906
|
-
target: {
|
11907
|
-
value: get$1(control._formValues, name),
|
11908
|
-
name: name,
|
11909
|
-
},
|
11910
|
-
type: EVENTS.BLUR,
|
11911
|
-
}),
|
11912
|
-
ref: (elm) => {
|
11913
|
-
const field = get$1(control._fields, name);
|
11914
|
-
if (field && elm) {
|
11915
|
-
field._f.ref = {
|
11916
|
-
focus: () => elm.focus(),
|
11917
|
-
select: () => elm.select(),
|
11918
|
-
setCustomValidity: (message) => elm.setCustomValidity(message),
|
11919
|
-
reportValidity: () => elm.reportValidity(),
|
11920
|
-
};
|
11921
|
-
}
|
11922
|
-
},
|
11923
|
-
}), [
|
11924
|
-
name,
|
11925
|
-
control._formValues,
|
11926
|
-
disabled,
|
11927
|
-
formState.disabled,
|
11928
|
-
value,
|
11929
|
-
control._fields,
|
11930
|
-
]);
|
11931
11801
|
React__default.useEffect(() => {
|
11932
11802
|
const _shouldUnregisterField = control._options.shouldUnregister || shouldUnregister;
|
11933
11803
|
const updateMounted = (name, value) => {
|
@@ -11953,7 +11823,7 @@ function useController(props) {
|
|
11953
11823
|
};
|
11954
11824
|
}, [name, control, isArrayField, shouldUnregister]);
|
11955
11825
|
React__default.useEffect(() => {
|
11956
|
-
if (
|
11826
|
+
if (get$1(control._fields, name)) {
|
11957
11827
|
control._updateDisabledField({
|
11958
11828
|
disabled,
|
11959
11829
|
fields: control._fields,
|
@@ -11962,11 +11832,63 @@ function useController(props) {
|
|
11962
11832
|
});
|
11963
11833
|
}
|
11964
11834
|
}, [disabled, name, control]);
|
11965
|
-
return
|
11966
|
-
field
|
11835
|
+
return {
|
11836
|
+
field: {
|
11837
|
+
name,
|
11838
|
+
value,
|
11839
|
+
...(isBoolean(disabled) || formState.disabled
|
11840
|
+
? { disabled: formState.disabled || disabled }
|
11841
|
+
: {}),
|
11842
|
+
onChange: React__default.useCallback((event) => _registerProps.current.onChange({
|
11843
|
+
target: {
|
11844
|
+
value: getEventValue(event),
|
11845
|
+
name: name,
|
11846
|
+
},
|
11847
|
+
type: EVENTS.CHANGE,
|
11848
|
+
}), [name]),
|
11849
|
+
onBlur: React__default.useCallback(() => _registerProps.current.onBlur({
|
11850
|
+
target: {
|
11851
|
+
value: get$1(control._formValues, name),
|
11852
|
+
name: name,
|
11853
|
+
},
|
11854
|
+
type: EVENTS.BLUR,
|
11855
|
+
}), [name, control]),
|
11856
|
+
ref: React__default.useCallback((elm) => {
|
11857
|
+
const field = get$1(control._fields, name);
|
11858
|
+
if (field && elm) {
|
11859
|
+
field._f.ref = {
|
11860
|
+
focus: () => elm.focus(),
|
11861
|
+
select: () => elm.select(),
|
11862
|
+
setCustomValidity: (message) => elm.setCustomValidity(message),
|
11863
|
+
reportValidity: () => elm.reportValidity(),
|
11864
|
+
};
|
11865
|
+
}
|
11866
|
+
}, [control._fields, name]),
|
11867
|
+
},
|
11967
11868
|
formState,
|
11968
|
-
fieldState,
|
11969
|
-
|
11869
|
+
fieldState: Object.defineProperties({}, {
|
11870
|
+
invalid: {
|
11871
|
+
enumerable: true,
|
11872
|
+
get: () => !!get$1(formState.errors, name),
|
11873
|
+
},
|
11874
|
+
isDirty: {
|
11875
|
+
enumerable: true,
|
11876
|
+
get: () => !!get$1(formState.dirtyFields, name),
|
11877
|
+
},
|
11878
|
+
isTouched: {
|
11879
|
+
enumerable: true,
|
11880
|
+
get: () => !!get$1(formState.touchedFields, name),
|
11881
|
+
},
|
11882
|
+
isValidating: {
|
11883
|
+
enumerable: true,
|
11884
|
+
get: () => !!get$1(formState.validatingFields, name),
|
11885
|
+
},
|
11886
|
+
error: {
|
11887
|
+
enumerable: true,
|
11888
|
+
get: () => get$1(formState.errors, name),
|
11889
|
+
},
|
11890
|
+
}),
|
11891
|
+
};
|
11970
11892
|
}
|
11971
11893
|
|
11972
11894
|
/**
|
@@ -12016,7 +11938,7 @@ const Controller = (props) => props.render(useController(props));
|
|
12016
11938
|
const flatten = (obj) => {
|
12017
11939
|
const output = {};
|
12018
11940
|
for (const key of Object.keys(obj)) {
|
12019
|
-
if (isObjectType(obj[key])
|
11941
|
+
if (isObjectType(obj[key])) {
|
12020
11942
|
const nested = flatten(obj[key]);
|
12021
11943
|
for (const nestedKey of Object.keys(nested)) {
|
12022
11944
|
output[`${key}.${nestedKey}`] = nested[nestedKey];
|
@@ -12085,7 +12007,7 @@ function Form(props) {
|
|
12085
12007
|
headers && headers['Content-Type'],
|
12086
12008
|
encType,
|
12087
12009
|
].some((value) => value && value.includes('json'));
|
12088
|
-
const response = await fetch(
|
12010
|
+
const response = await fetch(action, {
|
12089
12011
|
method,
|
12090
12012
|
headers: {
|
12091
12013
|
...headers,
|
@@ -12583,7 +12505,7 @@ var updateAt = (fieldValues, index, value) => {
|
|
12583
12505
|
*/
|
12584
12506
|
function useFieldArray(props) {
|
12585
12507
|
const methods = useFormContext();
|
12586
|
-
const { control = methods.control, name, keyName = 'id', shouldUnregister,
|
12508
|
+
const { control = methods.control, name, keyName = 'id', shouldUnregister, } = props;
|
12587
12509
|
const [fields, setFields] = React__default.useState(control._getFieldArray(name));
|
12588
12510
|
const ids = React__default.useRef(control._getFieldArray(name).map(generateId));
|
12589
12511
|
const _fieldIds = React__default.useRef(fields);
|
@@ -12592,8 +12514,8 @@ function useFieldArray(props) {
|
|
12592
12514
|
_name.current = name;
|
12593
12515
|
_fieldIds.current = fields;
|
12594
12516
|
control._names.array.add(name);
|
12595
|
-
rules &&
|
12596
|
-
control.register(name, rules);
|
12517
|
+
props.rules &&
|
12518
|
+
control.register(name, props.rules);
|
12597
12519
|
useSubscribe({
|
12598
12520
|
next: ({ values, name: fieldArrayName, }) => {
|
12599
12521
|
if (fieldArrayName === _name.current || !fieldArrayName) {
|
@@ -12637,8 +12559,6 @@ function useFieldArray(props) {
|
|
12637
12559
|
ids.current = removeArrayAt(ids.current, index);
|
12638
12560
|
updateValues(updatedFieldArrayValues);
|
12639
12561
|
setFields(updatedFieldArrayValues);
|
12640
|
-
!Array.isArray(get$1(control._fields, name)) &&
|
12641
|
-
set$1(control._fields, name, undefined);
|
12642
12562
|
control._updateFieldArray(name, updatedFieldArrayValues, removeArrayAt, {
|
12643
12563
|
argA: index,
|
12644
12564
|
});
|
@@ -12953,8 +12873,7 @@ var getRuleValue = (rule) => isUndefined(rule)
|
|
12953
12873
|
: rule;
|
12954
12874
|
|
12955
12875
|
const ASYNC_FUNCTION = 'AsyncFunction';
|
12956
|
-
var hasPromiseValidation = (fieldReference) =>
|
12957
|
-
!!fieldReference.validate &&
|
12876
|
+
var hasPromiseValidation = (fieldReference) => (!fieldReference || !fieldReference.validate) &&
|
12958
12877
|
!!((isFunction$1(fieldReference.validate) &&
|
12959
12878
|
fieldReference.validate.constructor.name === ASYNC_FUNCTION) ||
|
12960
12879
|
(isObject$2(fieldReference.validate) &&
|
@@ -13083,7 +13002,7 @@ function createFormControl(props = {}) {
|
|
13083
13002
|
timer = setTimeout(callback, wait);
|
13084
13003
|
};
|
13085
13004
|
const _updateValid = async (shouldUpdateValid) => {
|
13086
|
-
if (!
|
13005
|
+
if (!props.disabled && (_proxyFormState.isValid || shouldUpdateValid)) {
|
13087
13006
|
const isValid = _options.resolver
|
13088
13007
|
? isEmptyObject((await _executeSchema()).errors)
|
13089
13008
|
: await executeBuiltInValidation(_fields, true);
|
@@ -13095,7 +13014,7 @@ function createFormControl(props = {}) {
|
|
13095
13014
|
}
|
13096
13015
|
};
|
13097
13016
|
const _updateIsValidating = (names, isValidating) => {
|
13098
|
-
if (!
|
13017
|
+
if (!props.disabled &&
|
13099
13018
|
(_proxyFormState.isValidating || _proxyFormState.validatingFields)) {
|
13100
13019
|
(names || Array.from(_names.mount)).forEach((name) => {
|
13101
13020
|
if (name) {
|
@@ -13111,7 +13030,7 @@ function createFormControl(props = {}) {
|
|
13111
13030
|
}
|
13112
13031
|
};
|
13113
13032
|
const _updateFieldArray = (name, values = [], method, args, shouldSetValues = true, shouldUpdateFieldsAndState = true) => {
|
13114
|
-
if (args && method && !
|
13033
|
+
if (args && method && !props.disabled) {
|
13115
13034
|
_state.action = true;
|
13116
13035
|
if (shouldUpdateFieldsAndState && Array.isArray(get$1(_fields, name))) {
|
13117
13036
|
const fieldValues = method(get$1(_fields, name), args.argA, args.argB);
|
@@ -13175,7 +13094,7 @@ function createFormControl(props = {}) {
|
|
13175
13094
|
const output = {
|
13176
13095
|
name,
|
13177
13096
|
};
|
13178
|
-
if (!
|
13097
|
+
if (!props.disabled) {
|
13179
13098
|
const disabledField = !!(get$1(_fields, name) &&
|
13180
13099
|
get$1(_fields, name)._f &&
|
13181
13100
|
get$1(_fields, name)._f.disabled);
|
@@ -13216,9 +13135,9 @@ function createFormControl(props = {}) {
|
|
13216
13135
|
const shouldUpdateValid = _proxyFormState.isValid &&
|
13217
13136
|
isBoolean(isValid) &&
|
13218
13137
|
_formState.isValid !== isValid;
|
13219
|
-
if (
|
13138
|
+
if (props.delayError && error) {
|
13220
13139
|
delayErrorCallback = debounce(() => updateErrors(name, error));
|
13221
|
-
delayErrorCallback(
|
13140
|
+
delayErrorCallback(props.delayError);
|
13222
13141
|
}
|
13223
13142
|
else {
|
13224
13143
|
clearTimeout(timer);
|
@@ -13311,7 +13230,7 @@ function createFormControl(props = {}) {
|
|
13311
13230
|
}
|
13312
13231
|
_names.unMount = new Set();
|
13313
13232
|
};
|
13314
|
-
const _getDirty = (name, data) => !
|
13233
|
+
const _getDirty = (name, data) => !props.disabled &&
|
13315
13234
|
(name && data && set$1(_formValues, name, data),
|
13316
13235
|
!deepEqual(getValues(), _defaultValues));
|
13317
13236
|
const _getWatch = (names, defaultValue, isGlobal) => generateWatchOutput(names, _names, {
|
@@ -13323,7 +13242,7 @@ function createFormControl(props = {}) {
|
|
13323
13242
|
? { [names]: defaultValue }
|
13324
13243
|
: defaultValue),
|
13325
13244
|
}, isGlobal, defaultValue);
|
13326
|
-
const _getFieldArray = (name) => compact(get$1(_state.mount ? _formValues : _defaultValues, name,
|
13245
|
+
const _getFieldArray = (name) => compact(get$1(_state.mount ? _formValues : _defaultValues, name, props.shouldUnregister ? get$1(_defaultValues, name, []) : []));
|
13327
13246
|
const setFieldValue = (name, value, options = {}) => {
|
13328
13247
|
const field = get$1(_fields, name);
|
13329
13248
|
let fieldValue = value;
|
@@ -13456,7 +13375,7 @@ function createFormControl(props = {}) {
|
|
13456
13375
|
});
|
13457
13376
|
if (shouldSkipValidation) {
|
13458
13377
|
if (_proxyFormState.isValid) {
|
13459
|
-
if (
|
13378
|
+
if (props.mode === 'onBlur') {
|
13460
13379
|
if (isBlurEvent) {
|
13461
13380
|
_updateValid();
|
13462
13381
|
}
|
@@ -13621,15 +13540,13 @@ function createFormControl(props = {}) {
|
|
13621
13540
|
: isUndefined(value)
|
13622
13541
|
? getFieldValue(field ? field._f : get$1(fields, name)._f)
|
13623
13542
|
: value;
|
13624
|
-
|
13625
|
-
set$1(_formValues, name, inputValue);
|
13626
|
-
}
|
13543
|
+
set$1(_formValues, name, inputValue);
|
13627
13544
|
updateTouchAndDirty(name, inputValue, false, false, true);
|
13628
13545
|
}
|
13629
13546
|
};
|
13630
13547
|
const register = (name, options = {}) => {
|
13631
13548
|
let field = get$1(_fields, name);
|
13632
|
-
const disabledIsDefined = isBoolean(options.disabled) || isBoolean(
|
13549
|
+
const disabledIsDefined = isBoolean(options.disabled) || isBoolean(props.disabled);
|
13633
13550
|
set$1(_fields, name, {
|
13634
13551
|
...(field || {}),
|
13635
13552
|
_f: {
|
@@ -13645,7 +13562,7 @@ function createFormControl(props = {}) {
|
|
13645
13562
|
field,
|
13646
13563
|
disabled: isBoolean(options.disabled)
|
13647
13564
|
? options.disabled
|
13648
|
-
:
|
13565
|
+
: props.disabled,
|
13649
13566
|
name,
|
13650
13567
|
value: options.value,
|
13651
13568
|
});
|
@@ -13655,7 +13572,7 @@ function createFormControl(props = {}) {
|
|
13655
13572
|
}
|
13656
13573
|
return {
|
13657
13574
|
...(disabledIsDefined
|
13658
|
-
? { disabled: options.disabled ||
|
13575
|
+
? { disabled: options.disabled || props.disabled }
|
13659
13576
|
: {}),
|
13660
13577
|
...(_options.progressive
|
13661
13578
|
? {
|
@@ -13739,12 +13656,6 @@ function createFormControl(props = {}) {
|
|
13739
13656
|
e.preventDefault && e.preventDefault();
|
13740
13657
|
e.persist && e.persist();
|
13741
13658
|
}
|
13742
|
-
if (_options.disabled) {
|
13743
|
-
if (onInvalid) {
|
13744
|
-
await onInvalid({ ..._formState.errors }, e);
|
13745
|
-
}
|
13746
|
-
return;
|
13747
|
-
}
|
13748
13659
|
let fieldValues = cloneObject(_formValues);
|
13749
13660
|
_subjects.state.next({
|
13750
13661
|
isSubmitting: true,
|
@@ -13852,7 +13763,7 @@ function createFormControl(props = {}) {
|
|
13852
13763
|
}
|
13853
13764
|
_fields = {};
|
13854
13765
|
}
|
13855
|
-
_formValues =
|
13766
|
+
_formValues = props.shouldUnregister
|
13856
13767
|
? keepStateOptions.keepDefaultValues
|
13857
13768
|
? cloneObject(_defaultValues)
|
13858
13769
|
: {}
|
@@ -13876,7 +13787,7 @@ function createFormControl(props = {}) {
|
|
13876
13787
|
!_proxyFormState.isValid ||
|
13877
13788
|
!!keepStateOptions.keepIsValid ||
|
13878
13789
|
!!keepStateOptions.keepDirtyValues;
|
13879
|
-
_state.watch = !!
|
13790
|
+
_state.watch = !!props.shouldUnregister;
|
13880
13791
|
_subjects.state.next({
|
13881
13792
|
submitCount: keepStateOptions.keepSubmitCount
|
13882
13793
|
? _formState.submitCount
|
@@ -13923,9 +13834,7 @@ function createFormControl(props = {}) {
|
|
13923
13834
|
: fieldReference.ref;
|
13924
13835
|
if (fieldRef.focus) {
|
13925
13836
|
fieldRef.focus();
|
13926
|
-
options.shouldSelect &&
|
13927
|
-
isFunction$1(fieldRef.select) &&
|
13928
|
-
fieldRef.select();
|
13837
|
+
options.shouldSelect && fieldRef.select();
|
13929
13838
|
}
|
13930
13839
|
}
|
13931
13840
|
};
|
@@ -14047,8 +13956,8 @@ function createFormControl(props = {}) {
|
|
14047
13956
|
* ```
|
14048
13957
|
*/
|
14049
13958
|
function useForm(props = {}) {
|
14050
|
-
const _formControl = React__default.useRef(
|
14051
|
-
const _values = React__default.useRef(
|
13959
|
+
const _formControl = React__default.useRef();
|
13960
|
+
const _values = React__default.useRef();
|
14052
13961
|
const [formState, updateFormState] = React__default.useState({
|
14053
13962
|
isDirty: false,
|
14054
13963
|
isValidating: false,
|
@@ -14126,6 +14035,11 @@ function useForm(props = {}) {
|
|
14126
14035
|
values: control._getWatch(),
|
14127
14036
|
});
|
14128
14037
|
}, [props.shouldUnregister, control]);
|
14038
|
+
React__default.useEffect(() => {
|
14039
|
+
if (_formControl.current) {
|
14040
|
+
_formControl.current.watch = _formControl.current.watch.bind({});
|
14041
|
+
}
|
14042
|
+
}, [formState]);
|
14129
14043
|
_formControl.current.formState = getProxyFormState(formState, control);
|
14130
14044
|
return _formControl.current;
|
14131
14045
|
}
|
@@ -14567,7 +14481,7 @@ const MiniModal = /*#__PURE__*/forwardRef(({
|
|
14567
14481
|
}), document.body);
|
14568
14482
|
});
|
14569
14483
|
|
14570
|
-
var css_248z$R = ":root {\n --table-height: auto;\n}\n\n.tree-table-space-block {\n display: inline-block;\n width: 20px;\n height: 16px;\n text-align: center;\n line-height: 16px;\n vertical-align: top;\n font-size: 19px;\n position: relative;\n box-sizing: border-box;\n border-radius: 50%;\n /* Hover background for all elements of the same level */\n}\n.tree-table-space-block.btn-toggle {\n position: relative;\n cursor: pointer;\n width: 22px;\n height: 18px;\n z-index: 12;\n}\n.tree-table-space-block.btn-toggle::before {\n display: none;\n}\n.tree-table-space-block.last-block::after, .tree-table-space-block.no-folder::after {\n position: absolute;\n content: \"\";\n height: 1px;\n background: var(--tree-connecting-lines-color);\n top: 50%;\n margin-top: -1px;\n}\n.tree-table-space-block.last-block::after {\n width: 12px;\n left: -10px;\n}\n.tree-table-space-block.no-folder {\n width: 8px;\n}\n.tree-table-space-block.no-folder::after {\n width: 22px;\n left: -10px;\n}\n.tree-table-space-block:not(.last-block, .no-lines, .last-node)::before {\n position: absolute;\n content: \"\";\n width: 1px;\n height: 40px;\n background: var(--tree-connecting-lines-color);\n left: 50%;\n top: -4px;\n z-index: 99;\n}\n.tree-table-space-block.last-node::before {\n position: absolute;\n content: \"\";\n width: 1px;\n height: 12px;\n background: var(--tree-connecting-lines-color);\n left: 50%;\n top: -4px;\n z-index: -1;\n}\n.tree-table-space-block.folder.last-node::before {\n height: 13px;\n}\n.tree-table-space-block.tree-table-hovered::before, .tree-table-space-block.tree-table-hovered::after {\n background-color: var(--brand-color);\n}\n\n.tree-title-container .tree-table-space-block {\n width: 16px;\n}\n\n.hidden {\n display: none;\n}\n\n.show {\n display: table-row;\n visibility: visible;\n}\n\n.btn-toggle {\n cursor: pointer;\n}\n.btn-toggle.is-close {\n background: #f1f1f1;\n border: 1px solid transparent;\n box-shadow: 0 0 5px rgba(0, 0, 0, 0.1);\n}\n.btn-toggle::before, .btn-toggle::after {\n display: none;\n}\n\n.tree-table-wrap {\n width: 100%;\n padding-left: 4px;\n overflow: hidden;\n overflow-x: auto;\n}\n\n.table-scrollable {\n height: var(--table-height);\n /* Adjust height as needed */\n overflow-y: auto;\n position: relative;\n}\n\n.ff-table-tree-body {\n overflow: scroll;\n}\n\n.tree-table {\n table-layout: fixed;\n width: 100%;\n border-collapse: collapse;\n overflow: scroll;\n}\n.tree-table .ff-table-tree-head {\n position: sticky;\n top: 0;\n z-index: 2;\n}\n.tree-table .ff-table-tree-row:hover,\n.tree-table .ff-table-tree-row.hover {\n background-color: var(--hover-color);\n}\n.tree-table .ff-table-tree-row:hover .ff-table-tree-td:first-child,\n.tree-table .ff-table-tree-row.hover .ff-table-tree-td:first-child {\n background-color: var(--hover-color);\n}\n.tree-table .ff-table-tree-row:hover .table-tree-row-action,\n.tree-table .ff-table-tree-row.hover .table-tree-row-action {\n display: inline-flex;\n align-items: center;\n}\n.tree-table .ff-table-tree-row:hover .table-tree-row-action svg,\n.tree-table .ff-table-tree-row.hover .table-tree-row-action svg {\n height: 14px;\n width: 14px;\n}\n.tree-table .ff-table-tree-row {\n background-color: var(--base-bg-color);\n}\n.tree-table .ff-table-tree-row .table-tree-row-action {\n display: none;\n}\n.tree-table .ff-table-tree-row .table-row-add-button {\n display: inline-flex;\n z-index: 9999;\n align-items: center;\n}\n.tree-table .ff-table-tree-row::after {\n content: \"\";\n display: block;\n visibility: hidden;\n clear: both;\n}\n.tree-table .ff-table-tree-th,\n.tree-table .ff-table-tree-td {\n text-align: left;\n white-space: nowrap;\n text-overflow: ellipsis;\n overflow: hidden;\n}\n.tree-table .ff-table-tree-th {\n color: var(--table-header-text-color);\n background: var(--border-color);\n font-size: 12px;\n font-weight: 600;\n width: 400px;\n height: 32px;\n box-sizing: border-box;\n}\n.tree-table .ff-table-tree-th:first-child {\n width: 600px !important;\n position: sticky;\n left: 0;\n padding-left: 8px;\n}\n.tree-table .ff-table-tree-td {\n font-size: 12px;\n color: var(--nlp-color);\n height: 18px;\n}\n.tree-table .ff-table-tree-td:first-child {\n overflow: initial;\n position: sticky;\n left: 0;\n background-color: white;\n}\n.tree-table .ff-table-tree-td:first-child .tree-table-default-content {\n margin-left: 8px;\n}\n.tree-table .ff-table-tree-td:first-child .tree-table-td-content {\n padding-left: 4px;\n}\n.tree-table .ff-table-tree-td:first-child .tree-table-td-content .tree-table-td-content-text {\n margin-left: 4px;\n}\n.tree-table .ff-table-tree-td:first-child .tree-table-default-content {\n font-weight: 700;\n}\n.tree-table .ff-table-tree-td.folder {\n height: 28px;\n}\n\n.tree-table-td-content {\n display: inline-flex;\n align-items: center;\n font-size: 12px;\n font-family: \"Poppins\", sans-serif;\n}\n.tree-table-td-content.folder {\n font-weight: 600;\n}\n\n.tree-row-expanded span svg,\n.tree-row-collapsed span svg {\n height: 12px;\n width: 12px;\n transition: transform 0.3s ease;\n cursor: pointer;\n}\n.tree-row-expanded span svg path,\n.tree-row-collapsed span svg path {\n fill: var(--brand-color);\n}\n\n.tree-row-collapsed svg {\n transform: rotate(-90deg);\n transition: transform 0.3s ease;\n}\n\n.tree-table-space-container {\n display: inline-flex;\n}\n\n.tree-title-container {\n display: inline-flex;\n align-items: center;\n}";
|
14484
|
+
var css_248z$R = ":root {\n --table-height: auto;\n}\n\n.tree-table-space-block {\n display: inline-block;\n width: 20px;\n height: 16px;\n text-align: center;\n line-height: 16px;\n vertical-align: top;\n font-size: 19px;\n position: relative;\n box-sizing: border-box;\n border-radius: 50%;\n /* Hover background for all elements of the same level */\n}\n.tree-table-space-block.btn-toggle {\n position: relative;\n cursor: pointer;\n width: 22px;\n height: 18px;\n z-index: 12;\n}\n.tree-table-space-block.btn-toggle::before {\n display: none;\n}\n.tree-table-space-block.last-block::after, .tree-table-space-block.no-folder::after {\n position: absolute;\n content: \"\";\n height: 1px;\n background: var(--tree-connecting-lines-color);\n top: 50%;\n margin-top: -1px;\n}\n.tree-table-space-block.last-block::after {\n width: 12px;\n left: -10px;\n}\n.tree-table-space-block.no-folder {\n width: 8px;\n}\n.tree-table-space-block.no-folder::after {\n width: 22px;\n left: -10px;\n}\n.tree-table-space-block:not(.last-block, .no-lines, .last-node)::before {\n position: absolute;\n content: \"\";\n width: 1px;\n height: 40px;\n background: var(--tree-connecting-lines-color);\n left: 50%;\n top: -4px;\n z-index: 99;\n}\n.tree-table-space-block.last-node::before {\n position: absolute;\n content: \"\";\n width: 1px;\n height: 12px;\n background: var(--tree-connecting-lines-color);\n left: 50%;\n top: -4px;\n z-index: -1;\n}\n.tree-table-space-block.folder.last-node::before {\n height: 13px;\n}\n.tree-table-space-block.tree-table-hovered::before, .tree-table-space-block.tree-table-hovered::after {\n background-color: var(--brand-color);\n}\n\n.tree-title-container .tree-table-space-block {\n width: 16px;\n}\n\n.hidden {\n display: none;\n}\n\n.show {\n display: table-row;\n visibility: visible;\n}\n\n.btn-toggle {\n cursor: pointer;\n}\n.btn-toggle.is-close {\n background: #f1f1f1;\n border: 1px solid transparent;\n box-shadow: 0 0 5px rgba(0, 0, 0, 0.1);\n}\n.btn-toggle::before, .btn-toggle::after {\n display: none;\n}\n\n.tree-table-wrap {\n width: 100%;\n padding-left: 4px;\n overflow: hidden;\n overflow-x: auto;\n}\n\n.table-scrollable {\n height: var(--table-height);\n /* Adjust height as needed */\n overflow-y: auto;\n position: relative;\n}\n\n.ff-table-tree-body {\n overflow: scroll;\n}\n\n.tree-table {\n table-layout: fixed;\n width: 100%;\n border-collapse: collapse;\n overflow: scroll;\n}\n.tree-table .ff-table-tree-head {\n position: sticky;\n top: 0;\n z-index: 2;\n}\n.tree-table .ff-table-tree-row:hover,\n.tree-table .ff-table-tree-row.hover {\n background-color: var(--hover-color);\n}\n.tree-table .ff-table-tree-row:hover .ff-table-tree-td:first-child,\n.tree-table .ff-table-tree-row.hover .ff-table-tree-td:first-child {\n background-color: var(--hover-color);\n}\n.tree-table .ff-table-tree-row:hover .table-tree-row-action,\n.tree-table .ff-table-tree-row.hover .table-tree-row-action {\n display: inline-flex;\n align-items: center;\n}\n.tree-table .ff-table-tree-row:hover .table-tree-row-action svg,\n.tree-table .ff-table-tree-row.hover .table-tree-row-action svg {\n height: 14px;\n width: 14px;\n}\n.tree-table .ff-table-tree-row {\n background-color: var(--base-bg-color);\n}\n.tree-table .ff-table-tree-row .table-tree-row-action {\n display: none;\n}\n.tree-table .ff-table-tree-row .table-tree-row-action .ff-icon-container {\n height: 14px !important;\n width: 14px !important;\n padding: 2px 4px;\n}\n.tree-table .ff-table-tree-row .table-tree-row-action .ff-add-button-container {\n height: 20px;\n width: 22px;\n}\n.tree-table .ff-table-tree-row .table-row-add-button {\n display: inline-flex;\n z-index: 9999;\n align-items: center;\n}\n.tree-table .ff-table-tree-row::after {\n content: \"\";\n display: block;\n visibility: hidden;\n clear: both;\n}\n.tree-table .ff-table-tree-th,\n.tree-table .ff-table-tree-td {\n text-align: left;\n white-space: nowrap;\n text-overflow: ellipsis;\n overflow: hidden;\n}\n.tree-table .ff-table-tree-th {\n color: var(--table-header-text-color);\n background: var(--border-color);\n font-size: 12px;\n font-weight: 600;\n width: 400px;\n height: 32px;\n box-sizing: border-box;\n}\n.tree-table .ff-table-tree-th:first-child {\n width: 600px !important;\n position: sticky;\n left: 0;\n padding-left: 8px;\n}\n.tree-table .ff-table-tree-td {\n font-size: 12px;\n color: var(--nlp-color);\n height: 18px;\n}\n.tree-table .ff-table-tree-td:first-child {\n overflow: initial;\n position: sticky;\n left: 0;\n background-color: white;\n}\n.tree-table .ff-table-tree-td:first-child .tree-table-default-content {\n margin-left: 8px;\n}\n.tree-table .ff-table-tree-td:first-child .tree-table-td-content {\n padding-left: 4px;\n}\n.tree-table .ff-table-tree-td:first-child .tree-table-td-content .tree-table-td-content-text {\n margin-left: 4px;\n}\n.tree-table .ff-table-tree-td:first-child .tree-table-default-content {\n font-weight: 700;\n}\n.tree-table .ff-table-tree-td.folder {\n height: 28px;\n}\n\n.tree-table-td-content {\n display: inline-flex;\n align-items: center;\n font-size: 12px;\n font-family: \"Poppins\", sans-serif;\n}\n.tree-table-td-content.folder {\n font-weight: 600;\n}\n\n.tree-row-expanded span svg,\n.tree-row-collapsed span svg {\n height: 12px;\n width: 12px;\n transition: transform 0.3s ease;\n cursor: pointer;\n}\n.tree-row-expanded span svg path,\n.tree-row-collapsed span svg path {\n fill: var(--brand-color);\n}\n\n.tree-row-collapsed svg {\n transform: rotate(-90deg);\n transition: transform 0.3s ease;\n}\n\n.tree-table-space-container {\n display: inline-flex;\n}\n\n.tree-title-container {\n display: inline-flex;\n align-items: center;\n}";
|
14571
14485
|
styleInject(css_248z$R);
|
14572
14486
|
|
14573
14487
|
const TableHead = /*#__PURE__*/React__default.memo(({
|
@@ -14676,7 +14590,7 @@ const renderSpaces = (level, parentSiblings = [], isLast, isContainer) => {
|
|
14676
14590
|
if (checkEmpty(parentSiblings)) {
|
14677
14591
|
isLastNode = false;
|
14678
14592
|
if (!isNaN(level)) {
|
14679
|
-
siblingsArray = Array(level
|
14593
|
+
siblingsArray = Array(level).fill(true);
|
14680
14594
|
}
|
14681
14595
|
}
|
14682
14596
|
return jsx("div", {
|
@@ -18720,53 +18634,6 @@ function setYear(date, year, options) {
|
|
18720
18634
|
return date_;
|
18721
18635
|
}
|
18722
18636
|
|
18723
|
-
const FIVE_WEEKS = 5;
|
18724
|
-
const FOUR_WEEKS = 4;
|
18725
|
-
/**
|
18726
|
-
* Return the number of weeks to display in the broadcast calendar.
|
18727
|
-
*
|
18728
|
-
* @since 9.4.0
|
18729
|
-
*/
|
18730
|
-
function getBroadcastWeeksInMonth(month, dateLib) {
|
18731
|
-
// Get the first day of the month
|
18732
|
-
const firstDayOfMonth = dateLib.startOfMonth(month);
|
18733
|
-
// Get the day of the week for the first day of the month (1-7, where 1 is Monday)
|
18734
|
-
const firstDayOfWeek = firstDayOfMonth.getDay() > 0 ? firstDayOfMonth.getDay() : 7;
|
18735
|
-
const broadcastStartDate = dateLib.addDays(month, -firstDayOfWeek + 1);
|
18736
|
-
const lastDateOfLastWeek = dateLib.addDays(broadcastStartDate, FIVE_WEEKS * 7 - 1);
|
18737
|
-
const numberOfWeeks = month.getMonth() === lastDateOfLastWeek.getMonth() ? FIVE_WEEKS : FOUR_WEEKS;
|
18738
|
-
return numberOfWeeks;
|
18739
|
-
}
|
18740
|
-
|
18741
|
-
/**
|
18742
|
-
* Return the start date of the week in the broadcast calendar.
|
18743
|
-
*
|
18744
|
-
* @since 9.4.0
|
18745
|
-
*/
|
18746
|
-
function startOfBroadcastWeek(date, dateLib) {
|
18747
|
-
const firstOfMonth = dateLib.startOfMonth(date);
|
18748
|
-
const dayOfWeek = firstOfMonth.getDay();
|
18749
|
-
if (dayOfWeek === 1) {
|
18750
|
-
return firstOfMonth;
|
18751
|
-
} else if (dayOfWeek === 0) {
|
18752
|
-
return dateLib.addDays(firstOfMonth, -1 * 6);
|
18753
|
-
} else {
|
18754
|
-
return dateLib.addDays(firstOfMonth, -1 * (dayOfWeek - 1));
|
18755
|
-
}
|
18756
|
-
}
|
18757
|
-
|
18758
|
-
/**
|
18759
|
-
* Return the end date of the week in the broadcast calendar.
|
18760
|
-
*
|
18761
|
-
* @since 9.4.0
|
18762
|
-
*/
|
18763
|
-
function endOfBroadcastWeek(date, dateLib) {
|
18764
|
-
const startDate = startOfBroadcastWeek(date, dateLib);
|
18765
|
-
const numberOfWeeks = getBroadcastWeeksInMonth(date, dateLib);
|
18766
|
-
const endDate = dateLib.addDays(startDate, numberOfWeeks * 7 - 1);
|
18767
|
-
return endDate;
|
18768
|
-
}
|
18769
|
-
|
18770
18637
|
/**
|
18771
18638
|
* A wrapper class around [date-fns](http://date-fns.org) sharing the same
|
18772
18639
|
* options. Methods of this class can be overridden using the
|
@@ -18847,15 +18714,6 @@ class DateLib {
|
|
18847
18714
|
this.differenceInCalendarMonths = (dateLeft, dateRight) => {
|
18848
18715
|
return this.overrides?.differenceInCalendarMonths ? this.overrides.differenceInCalendarMonths(dateLeft, dateRight) : differenceInCalendarMonths(dateLeft, dateRight);
|
18849
18716
|
};
|
18850
|
-
/**
|
18851
|
-
* Returns the end of the broadcast week for the given date.
|
18852
|
-
*
|
18853
|
-
* @param date The original date.
|
18854
|
-
* @returns The end of the broadcast week.
|
18855
|
-
*/
|
18856
|
-
this.endOfBroadcastWeek = date => {
|
18857
|
-
return this.overrides?.endOfBroadcastWeek ? this.overrides.endOfBroadcastWeek(date, this) : endOfBroadcastWeek(date, this);
|
18858
|
-
};
|
18859
18717
|
/**
|
18860
18718
|
* Returns the end of the ISO week for the given date.
|
18861
18719
|
*
|
@@ -19017,15 +18875,6 @@ class DateLib {
|
|
19017
18875
|
this.setYear = (date, year) => {
|
19018
18876
|
return this.overrides?.setYear ? this.overrides.setYear(date, year) : setYear(date, year);
|
19019
18877
|
};
|
19020
|
-
/**
|
19021
|
-
* Returns the start of the broadcast week for the given date.
|
19022
|
-
*
|
19023
|
-
* @param date The original date.
|
19024
|
-
* @returns The start of the broadcast week.
|
19025
|
-
*/
|
19026
|
-
this.startOfBroadcastWeek = date => {
|
19027
|
-
return this.overrides?.startOfBroadcastWeek ? this.overrides.startOfBroadcastWeek(date, this) : startOfBroadcastWeek(date, this);
|
19028
|
-
};
|
19029
18878
|
/**
|
19030
18879
|
* Returns the start of the day for the given date.
|
19031
18880
|
*
|
@@ -19508,9 +19357,7 @@ function Weekday(props) {
|
|
19508
19357
|
* @see https://daypicker.dev/guides/custom-components
|
19509
19358
|
*/
|
19510
19359
|
function Weekdays(props) {
|
19511
|
-
return /*#__PURE__*/React__default.createElement("thead", {
|
19512
|
-
"aria-hidden": true
|
19513
|
-
}, /*#__PURE__*/React__default.createElement("tr", {
|
19360
|
+
return /*#__PURE__*/React__default.createElement("thead", null, /*#__PURE__*/React__default.createElement("tr", {
|
19514
19361
|
...props
|
19515
19362
|
}));
|
19516
19363
|
}
|
@@ -19613,8 +19460,7 @@ function getDataAttributes(props) {
|
|
19613
19460
|
"data-mode": props.mode ?? undefined,
|
19614
19461
|
"data-required": "required" in props ? props.required : undefined,
|
19615
19462
|
"data-multiple-months": props.numberOfMonths && props.numberOfMonths > 1 || undefined,
|
19616
|
-
"data-week-numbers": props.showWeekNumber || undefined
|
19617
|
-
"data-broadcast-calendar": props.broadcastCalendar || undefined
|
19463
|
+
"data-week-numbers": props.showWeekNumber || undefined
|
19618
19464
|
};
|
19619
19465
|
Object.entries(props).forEach(([key, val]) => {
|
19620
19466
|
if (key.startsWith("data-")) {
|
@@ -19680,7 +19526,7 @@ function formatDay(date, options, dateLib) {
|
|
19680
19526
|
*/
|
19681
19527
|
function formatMonthDropdown(/** The month number to format. */
|
19682
19528
|
monthNumber, /** The locale to use for formatting. */
|
19683
|
-
locale) {
|
19529
|
+
locale = enUS$1) {
|
19684
19530
|
return locale.localize?.month(monthNumber);
|
19685
19531
|
}
|
19686
19532
|
|
@@ -19770,12 +19616,13 @@ function getMonthOptions(displayMonth, navStart, navEnd, formatters, dateLib) {
|
|
19770
19616
|
if (!navEnd) return undefined;
|
19771
19617
|
const {
|
19772
19618
|
addMonths,
|
19773
|
-
startOfMonth
|
19619
|
+
startOfMonth,
|
19620
|
+
isBefore
|
19774
19621
|
} = dateLib;
|
19775
19622
|
const year = displayMonth.getFullYear();
|
19776
19623
|
const months = [];
|
19777
19624
|
let month = navStart;
|
19778
|
-
while (months.length < 12) {
|
19625
|
+
while (months.length < 12 && isBefore(month, addMonths(navEnd, 1))) {
|
19779
19626
|
months.push(month.getMonth());
|
19780
19627
|
month = addMonths(month, 1);
|
19781
19628
|
}
|
@@ -19783,7 +19630,7 @@ function getMonthOptions(displayMonth, navStart, navEnd, formatters, dateLib) {
|
|
19783
19630
|
return a - b;
|
19784
19631
|
});
|
19785
19632
|
const options = sortedMonths.map(value => {
|
19786
|
-
const label = formatters.formatMonthDropdown(value, dateLib.options.locale
|
19633
|
+
const label = formatters.formatMonthDropdown(value, dateLib.options.locale);
|
19787
19634
|
const month = dateLib.Date ? new dateLib.Date(year, value) : new Date(year, value);
|
19788
19635
|
const disabled = navStart && month < startOfMonth(navStart) || navEnd && month > startOfMonth(navEnd) || false;
|
19789
19636
|
return {
|
@@ -20158,8 +20005,7 @@ function tzName(tz, date) {
|
|
20158
20005
|
*/
|
20159
20006
|
function getWeekdays(/** The date library. */
|
20160
20007
|
dateLib, /** Use ISOWeek instead of locale/ */
|
20161
|
-
ISOWeek, timeZone
|
20162
|
-
broadcastCalendar) {
|
20008
|
+
ISOWeek, timeZone) {
|
20163
20009
|
const date = timeZone ? TZDate.tz(timeZone) : dateLib.Date ? new dateLib.Date() : new Date();
|
20164
20010
|
const start = ISOWeek ? dateLib.startOfISOWeek(date) : dateLib.startOfWeek(date);
|
20165
20011
|
const days = [];
|
@@ -20171,18 +20017,20 @@ broadcastCalendar) {
|
|
20171
20017
|
}
|
20172
20018
|
|
20173
20019
|
/** Return the years to show in the dropdown. */
|
20174
|
-
function getYearOptions(
|
20175
|
-
if (!
|
20176
|
-
if (!
|
20020
|
+
function getYearOptions(displayMonth, calendarStart, calendarEnd, formatters, dateLib) {
|
20021
|
+
if (!calendarStart) return undefined;
|
20022
|
+
if (!calendarEnd) return undefined;
|
20177
20023
|
const {
|
20024
|
+
startOfMonth,
|
20178
20025
|
startOfYear,
|
20179
20026
|
endOfYear,
|
20180
20027
|
addYears,
|
20181
20028
|
isBefore,
|
20182
20029
|
isSameYear
|
20183
20030
|
} = dateLib;
|
20184
|
-
const
|
20185
|
-
const
|
20031
|
+
const month = displayMonth.getMonth();
|
20032
|
+
const firstNavYear = startOfYear(calendarStart);
|
20033
|
+
const lastNavYear = endOfYear(calendarEnd);
|
20186
20034
|
const years = [];
|
20187
20035
|
let year = firstNavYear;
|
20188
20036
|
while (isBefore(year, lastNavYear) || isSameYear(year, lastNavYear)) {
|
@@ -20190,11 +20038,13 @@ function getYearOptions(navStart, navEnd, formatters, dateLib) {
|
|
20190
20038
|
year = addYears(year, 1);
|
20191
20039
|
}
|
20192
20040
|
return years.map(value => {
|
20041
|
+
const year = dateLib.Date ? new dateLib.Date(value, month) : new Date(value, month);
|
20042
|
+
const disabled = calendarStart && year < startOfMonth(calendarStart) || month && calendarEnd && year > startOfMonth(calendarEnd) || false;
|
20193
20043
|
const label = formatters.formatYearDropdown(value);
|
20194
20044
|
return {
|
20195
20045
|
value,
|
20196
20046
|
label,
|
20197
|
-
disabled
|
20047
|
+
disabled
|
20198
20048
|
};
|
20199
20049
|
});
|
20200
20050
|
}
|
@@ -20358,30 +20208,29 @@ var defaultLabels = /*#__PURE__*/Object.freeze({
|
|
20358
20208
|
labelYearDropdown: labelYearDropdown
|
20359
20209
|
});
|
20360
20210
|
|
20211
|
+
/** The number of days in a month when having 6 weeks. */
|
20212
|
+
const NrOfDaysWithFixedWeeks = 42;
|
20361
20213
|
/** Return all the dates to display in the calendar. */
|
20362
20214
|
function getDates(displayMonths, maxDate, props, dateLib) {
|
20363
20215
|
const firstMonth = displayMonths[0];
|
20364
20216
|
const lastMonth = displayMonths[displayMonths.length - 1];
|
20365
20217
|
const {
|
20366
20218
|
ISOWeek,
|
20367
|
-
fixedWeeks
|
20368
|
-
broadcastCalendar
|
20219
|
+
fixedWeeks
|
20369
20220
|
} = props ?? {};
|
20370
20221
|
const {
|
20222
|
+
startOfWeek,
|
20223
|
+
endOfWeek,
|
20224
|
+
startOfISOWeek,
|
20225
|
+
endOfISOWeek,
|
20371
20226
|
addDays,
|
20372
20227
|
differenceInCalendarDays,
|
20373
20228
|
differenceInCalendarMonths,
|
20374
|
-
endOfBroadcastWeek,
|
20375
|
-
endOfISOWeek,
|
20376
|
-
endOfMonth,
|
20377
|
-
endOfWeek,
|
20378
20229
|
isAfter,
|
20379
|
-
|
20380
|
-
startOfISOWeek,
|
20381
|
-
startOfWeek
|
20230
|
+
endOfMonth
|
20382
20231
|
} = dateLib;
|
20383
|
-
const startWeekFirstDate =
|
20384
|
-
const endWeekLastDate =
|
20232
|
+
const startWeekFirstDate = ISOWeek ? startOfISOWeek(firstMonth) : startOfWeek(firstMonth);
|
20233
|
+
const endWeekLastDate = ISOWeek ? endOfISOWeek(endOfMonth(lastMonth)) : endOfWeek(endOfMonth(lastMonth));
|
20385
20234
|
const nOfDays = differenceInCalendarDays(endWeekLastDate, startWeekFirstDate);
|
20386
20235
|
const nOfMonths = differenceInCalendarMonths(lastMonth, firstMonth) + 1;
|
20387
20236
|
const dates = [];
|
@@ -20393,11 +20242,9 @@ function getDates(displayMonths, maxDate, props, dateLib) {
|
|
20393
20242
|
dates.push(date);
|
20394
20243
|
}
|
20395
20244
|
// If fixed weeks is enabled, add the extra dates to the array
|
20396
|
-
const
|
20397
|
-
const extraDates = nrOfDaysWithFixedWeeks * nOfMonths;
|
20245
|
+
const extraDates = NrOfDaysWithFixedWeeks * nOfMonths;
|
20398
20246
|
if (fixedWeeks && dates.length < extraDates) {
|
20399
|
-
|
20400
|
-
for (let i = 0; i < daysToAdd; i++) {
|
20247
|
+
for (let i = 0; i < 7; i++) {
|
20401
20248
|
const date = addDays(dates[dates.length - 1], 1);
|
20402
20249
|
dates.push(date);
|
20403
20250
|
}
|
@@ -20508,29 +20355,25 @@ displayMonths, /** The dates to display in the calendar. */
|
|
20508
20355
|
dates, /** Options from the props context. */
|
20509
20356
|
props, dateLib) {
|
20510
20357
|
const {
|
20511
|
-
|
20512
|
-
|
20358
|
+
startOfWeek,
|
20359
|
+
endOfWeek,
|
20360
|
+
startOfISOWeek,
|
20513
20361
|
endOfISOWeek,
|
20514
20362
|
endOfMonth,
|
20515
|
-
|
20516
|
-
getISOWeek,
|
20363
|
+
addDays,
|
20517
20364
|
getWeek,
|
20518
|
-
|
20519
|
-
startOfISOWeek,
|
20520
|
-
startOfWeek
|
20365
|
+
getISOWeek
|
20521
20366
|
} = dateLib;
|
20522
20367
|
const dayPickerMonths = displayMonths.reduce((months, month) => {
|
20523
|
-
const firstDateOfFirstWeek = props.
|
20524
|
-
const lastDateOfLastWeek = props.
|
20368
|
+
const firstDateOfFirstWeek = props.ISOWeek ? startOfISOWeek(month) : startOfWeek(month);
|
20369
|
+
const lastDateOfLastWeek = props.ISOWeek ? endOfISOWeek(endOfMonth(month)) : endOfWeek(endOfMonth(month));
|
20525
20370
|
/** The dates to display in the month. */
|
20526
20371
|
const monthDates = dates.filter(date => {
|
20527
20372
|
return date >= firstDateOfFirstWeek && date <= lastDateOfLastWeek;
|
20528
20373
|
});
|
20529
|
-
|
20530
|
-
if (props.fixedWeeks && monthDates.length < nrOfDaysWithFixedWeeks) {
|
20374
|
+
if (props.fixedWeeks && monthDates.length < 42) {
|
20531
20375
|
const extraDates = dates.filter(date => {
|
20532
|
-
|
20533
|
-
return date > lastDateOfLastWeek && date <= addDays(lastDateOfLastWeek, daysToAdd);
|
20376
|
+
return date > lastDateOfLastWeek && date <= addDays(lastDateOfLastWeek, 7);
|
20534
20377
|
});
|
20535
20378
|
monthDates.push(...extraDates);
|
20536
20379
|
}
|
@@ -20968,30 +20811,27 @@ function dateMatchModifiers(date, matchers, dateLib = defaultDateLib) {
|
|
20968
20811
|
/** Return the next date that should be focused. */
|
20969
20812
|
function getFocusableDate(moveBy, moveDir, refDate, navStart, navEnd, props, dateLib) {
|
20970
20813
|
const {
|
20971
|
-
ISOWeek
|
20972
|
-
broadcastCalendar
|
20814
|
+
ISOWeek
|
20973
20815
|
} = props;
|
20974
20816
|
const {
|
20975
20817
|
addDays,
|
20976
20818
|
addMonths,
|
20977
|
-
addWeeks,
|
20978
20819
|
addYears,
|
20979
|
-
|
20820
|
+
addWeeks,
|
20821
|
+
startOfISOWeek,
|
20980
20822
|
endOfISOWeek,
|
20823
|
+
startOfWeek,
|
20981
20824
|
endOfWeek,
|
20982
20825
|
max,
|
20983
|
-
min
|
20984
|
-
startOfBroadcastWeek,
|
20985
|
-
startOfISOWeek,
|
20986
|
-
startOfWeek
|
20826
|
+
min
|
20987
20827
|
} = dateLib;
|
20988
20828
|
const moveFns = {
|
20989
20829
|
day: addDays,
|
20990
20830
|
week: addWeeks,
|
20991
20831
|
month: addMonths,
|
20992
20832
|
year: addYears,
|
20993
|
-
startOfWeek: date =>
|
20994
|
-
endOfWeek: date =>
|
20833
|
+
startOfWeek: date => ISOWeek ? startOfISOWeek(date) : startOfWeek(date),
|
20834
|
+
endOfWeek: date => ISOWeek ? endOfISOWeek(date) : endOfWeek(date)
|
20995
20835
|
};
|
20996
20836
|
let focusableDate = moveFns[moveBy](refDate, moveDir === "after" ? 1 : -1);
|
20997
20837
|
if (moveDir === "before" && navStart) {
|
@@ -21057,8 +20897,6 @@ function useFocus(props, calendar, getModifiers, isSelected, dateLib) {
|
|
21057
20897
|
/**
|
21058
20898
|
* Return a function to get the modifiers for a given day.
|
21059
20899
|
*
|
21060
|
-
* NOTE: this is not an hook, but a factory for `getModifiers`.
|
21061
|
-
*
|
21062
20900
|
* @private
|
21063
20901
|
*/
|
21064
20902
|
function useGetModifiers(days, props, dateLib) {
|
@@ -21067,19 +20905,12 @@ function useGetModifiers(days, props, dateLib) {
|
|
21067
20905
|
hidden,
|
21068
20906
|
modifiers,
|
21069
20907
|
showOutsideDays,
|
21070
|
-
broadcastCalendar,
|
21071
20908
|
today
|
21072
20909
|
} = props;
|
21073
20910
|
const {
|
21074
20911
|
isSameDay,
|
21075
|
-
isSameMonth
|
21076
|
-
startOfMonth,
|
21077
|
-
isBefore,
|
21078
|
-
endOfMonth,
|
21079
|
-
isAfter
|
20912
|
+
isSameMonth
|
21080
20913
|
} = dateLib;
|
21081
|
-
const startMonth = props.startMonth && startOfMonth(props.startMonth);
|
21082
|
-
const endMonth = props.endMonth && endOfMonth(props.endMonth);
|
21083
20914
|
const internalModifiersMap = {
|
21084
20915
|
[DayFlag.focused]: [],
|
21085
20916
|
[DayFlag.outside]: [],
|
@@ -21088,18 +20919,20 @@ function useGetModifiers(days, props, dateLib) {
|
|
21088
20919
|
[DayFlag.today]: []
|
21089
20920
|
};
|
21090
20921
|
const customModifiersMap = {};
|
20922
|
+
const selectionModifiersMap = {
|
20923
|
+
[SelectionState.range_end]: [],
|
20924
|
+
[SelectionState.range_middle]: [],
|
20925
|
+
[SelectionState.range_start]: [],
|
20926
|
+
[SelectionState.selected]: []
|
20927
|
+
};
|
21091
20928
|
for (const day of days) {
|
21092
20929
|
const {
|
21093
20930
|
date,
|
21094
20931
|
displayMonth
|
21095
20932
|
} = day;
|
21096
20933
|
const isOutside = Boolean(displayMonth && !isSameMonth(date, displayMonth));
|
21097
|
-
const isBeforeStartMonth = Boolean(startMonth && isBefore(date, startMonth));
|
21098
|
-
const isAfterEndMonth = Boolean(endMonth && isAfter(date, endMonth));
|
21099
20934
|
const isDisabled = Boolean(disabled && dateMatchModifiers(date, disabled, dateLib));
|
21100
|
-
const isHidden = Boolean(hidden && dateMatchModifiers(date, hidden, dateLib)) ||
|
21101
|
-
// Broadcast calendar will show outside days as default
|
21102
|
-
!broadcastCalendar && !showOutsideDays && isOutside || broadcastCalendar && showOutsideDays === false && isOutside;
|
20935
|
+
const isHidden = Boolean(hidden && dateMatchModifiers(date, hidden, dateLib)) || !showOutsideDays && isOutside;
|
21103
20936
|
const isToday = isSameDay(date, today ?? (props.timeZone ? TZDate.tz(props.timeZone) : dateLib.Date ? new dateLib.Date() : new Date()));
|
21104
20937
|
if (isOutside) internalModifiersMap.outside.push(day);
|
21105
20938
|
if (isDisabled) internalModifiersMap.disabled.push(day);
|
@@ -21128,16 +20961,27 @@ function useGetModifiers(days, props, dateLib) {
|
|
21128
20961
|
[DayFlag.outside]: false,
|
21129
20962
|
[DayFlag.today]: false
|
21130
20963
|
};
|
20964
|
+
const selectionStates = {
|
20965
|
+
[SelectionState.range_end]: false,
|
20966
|
+
[SelectionState.range_middle]: false,
|
20967
|
+
[SelectionState.range_start]: false,
|
20968
|
+
[SelectionState.selected]: false
|
20969
|
+
};
|
21131
20970
|
const customModifiers = {};
|
21132
20971
|
// Find the modifiers for the given day
|
21133
20972
|
for (const name in internalModifiersMap) {
|
21134
20973
|
const days = internalModifiersMap[name];
|
21135
20974
|
dayFlags[name] = days.some(d => d === day);
|
21136
20975
|
}
|
20976
|
+
for (const name in selectionModifiersMap) {
|
20977
|
+
const days = selectionModifiersMap[name];
|
20978
|
+
selectionStates[name] = days.some(d => d === day);
|
20979
|
+
}
|
21137
20980
|
for (const name in customModifiersMap) {
|
21138
20981
|
customModifiers[name] = customModifiersMap[name].some(d => d === day);
|
21139
20982
|
}
|
21140
20983
|
return {
|
20984
|
+
...selectionStates,
|
21141
20985
|
...dayFlags,
|
21142
20986
|
// custom modifiers should override all the previous ones
|
21143
20987
|
...customModifiers
|
@@ -21542,7 +21386,7 @@ function DayPicker(props) {
|
|
21542
21386
|
};
|
21543
21387
|
const dateLib = new DateLib({
|
21544
21388
|
locale,
|
21545
|
-
weekStartsOn: props.
|
21389
|
+
weekStartsOn: props.weekStartsOn,
|
21546
21390
|
firstWeekContainsDate: props.firstWeekContainsDate,
|
21547
21391
|
useAdditionalWeekYearTokens: props.useAdditionalWeekYearTokens,
|
21548
21392
|
useAdditionalDayOfYearTokens: props.useAdditionalDayOfYearTokens
|
@@ -21561,7 +21405,7 @@ function DayPicker(props) {
|
|
21561
21405
|
...props.classNames
|
21562
21406
|
}
|
21563
21407
|
};
|
21564
|
-
}, [props.classNames, props.components, props.dateLib, props.firstWeekContainsDate, props.formatters, props.labels, props.locale, props.useAdditionalDayOfYearTokens, props.useAdditionalWeekYearTokens, props.weekStartsOn
|
21408
|
+
}, [props.classNames, props.components, props.dateLib, props.firstWeekContainsDate, props.formatters, props.labels, props.locale, props.useAdditionalDayOfYearTokens, props.useAdditionalWeekYearTokens, props.weekStartsOn]);
|
21565
21409
|
const {
|
21566
21410
|
captionLayout,
|
21567
21411
|
mode,
|
@@ -21671,16 +21515,6 @@ function DayPicker(props) {
|
|
21671
21515
|
const handleDayMouseLeave = useCallback((day, modifiers) => e => {
|
21672
21516
|
onDayMouseLeave?.(day.date, modifiers, e);
|
21673
21517
|
}, [onDayMouseLeave]);
|
21674
|
-
const handleMonthChange = useCallback(date => e => {
|
21675
|
-
const selectedMonth = Number(e.target.value);
|
21676
|
-
const month = dateLib.setMonth(dateLib.startOfMonth(date), selectedMonth);
|
21677
|
-
goToMonth(month);
|
21678
|
-
}, [dateLib, goToMonth]);
|
21679
|
-
const handleYearChange = useCallback(date => e => {
|
21680
|
-
const selectedYear = Number(e.target.value);
|
21681
|
-
const month = dateLib.setYear(dateLib.startOfMonth(date), selectedYear);
|
21682
|
-
goToMonth(month);
|
21683
|
-
}, [dateLib, goToMonth]);
|
21684
21518
|
const {
|
21685
21519
|
className,
|
21686
21520
|
style
|
@@ -21718,8 +21552,6 @@ function DayPicker(props) {
|
|
21718
21552
|
lang: props.lang,
|
21719
21553
|
nonce: props.nonce,
|
21720
21554
|
title: props.title,
|
21721
|
-
role: props.role,
|
21722
|
-
"aria-label": props["aria-label"],
|
21723
21555
|
...dataAttributes
|
21724
21556
|
}, /*#__PURE__*/React__default.createElement(components.Months, {
|
21725
21557
|
className: classNames[UI.Months],
|
@@ -21733,8 +21565,17 @@ function DayPicker(props) {
|
|
21733
21565
|
previousMonth: previousMonth,
|
21734
21566
|
nextMonth: nextMonth
|
21735
21567
|
})), months.map((calendarMonth, displayIndex) => {
|
21568
|
+
const handleMonthChange = e => {
|
21569
|
+
const selectedMonth = Number(e.target.value);
|
21570
|
+
const month = dateLib.setMonth(dateLib.startOfMonth(calendarMonth.date), selectedMonth);
|
21571
|
+
goToMonth(month);
|
21572
|
+
};
|
21573
|
+
const handleYearChange = e => {
|
21574
|
+
const month = dateLib.setYear(dateLib.startOfMonth(calendarMonth.date), Number(e.target.value));
|
21575
|
+
goToMonth(month);
|
21576
|
+
};
|
21736
21577
|
const dropdownMonths = getMonthOptions(calendarMonth.date, navStart, navEnd, formatters, dateLib);
|
21737
|
-
const dropdownYears = getYearOptions(navStart, navEnd, formatters, dateLib);
|
21578
|
+
const dropdownYears = getYearOptions(months[0].date, navStart, navEnd, formatters, dateLib);
|
21738
21579
|
return /*#__PURE__*/React__default.createElement(components.Month, {
|
21739
21580
|
className: classNames[UI.Month],
|
21740
21581
|
style: styles?.[UI.Month],
|
@@ -21755,7 +21596,7 @@ function DayPicker(props) {
|
|
21755
21596
|
classNames: classNames,
|
21756
21597
|
components: components,
|
21757
21598
|
disabled: Boolean(props.disableNavigation),
|
21758
|
-
onChange: handleMonthChange
|
21599
|
+
onChange: handleMonthChange,
|
21759
21600
|
options: dropdownMonths,
|
21760
21601
|
style: styles?.[UI.Dropdown],
|
21761
21602
|
value: calendarMonth.date.getMonth()
|
@@ -21768,7 +21609,7 @@ function DayPicker(props) {
|
|
21768
21609
|
classNames: classNames,
|
21769
21610
|
components: components,
|
21770
21611
|
disabled: Boolean(props.disableNavigation),
|
21771
|
-
onChange: handleYearChange
|
21612
|
+
onChange: handleYearChange,
|
21772
21613
|
options: dropdownYears,
|
21773
21614
|
style: styles?.[UI.Dropdown],
|
21774
21615
|
value: calendarMonth.date.getFullYear()
|
@@ -21815,8 +21656,7 @@ function DayPicker(props) {
|
|
21815
21656
|
locale
|
21816
21657
|
}),
|
21817
21658
|
className: classNames[UI.WeekNumber],
|
21818
|
-
scope: "row"
|
21819
|
-
role: "rowheader"
|
21659
|
+
scope: "row"
|
21820
21660
|
}, formatWeekNumber(week.weekNumber))), week.days.map(day => {
|
21821
21661
|
const {
|
21822
21662
|
date
|
@@ -21836,14 +21676,14 @@ function DayPicker(props) {
|
|
21836
21676
|
}
|
21837
21677
|
const style = getStyleForModifiers(modifiers, styles, props.modifiersStyles);
|
21838
21678
|
const className = getClassNamesForModifiers(modifiers, classNames, props.modifiersClassNames);
|
21839
|
-
const ariaLabel = !isInteractive
|
21679
|
+
const ariaLabel = !isInteractive ? labelGridcell(date, modifiers, dateLib.options, dateLib) : undefined;
|
21840
21680
|
return /*#__PURE__*/React__default.createElement(components.Day, {
|
21841
21681
|
key: `${dateLib.format(date, "yyyy-MM-dd")}_${dateLib.format(day.displayMonth, "yyyy-MM")}`,
|
21842
21682
|
day: day,
|
21843
21683
|
modifiers: modifiers,
|
21844
21684
|
className: className.join(" "),
|
21845
21685
|
style: style,
|
21846
|
-
|
21686
|
+
"aria-hidden": modifiers.hidden || undefined,
|
21847
21687
|
"aria-selected": modifiers.selected || undefined,
|
21848
21688
|
"aria-label": ariaLabel,
|
21849
21689
|
"data-day": dateLib.format(date, "yyyy-MM-dd"),
|
@@ -21854,7 +21694,7 @@ function DayPicker(props) {
|
|
21854
21694
|
"data-outside": day.outside || undefined,
|
21855
21695
|
"data-focused": modifiers.focused || undefined,
|
21856
21696
|
"data-today": modifiers.today || undefined
|
21857
|
-
},
|
21697
|
+
}, isInteractive ? (/*#__PURE__*/React__default.createElement(components.DayButton, {
|
21858
21698
|
className: classNames[UI.DayButton],
|
21859
21699
|
style: styles?.[UI.DayButton],
|
21860
21700
|
type: "button",
|
@@ -21869,7 +21709,7 @@ function DayPicker(props) {
|
|
21869
21709
|
onKeyDown: handleDayKeyDown(day, modifiers),
|
21870
21710
|
onMouseEnter: handleDayMouseEnter(day, modifiers),
|
21871
21711
|
onMouseLeave: handleDayMouseLeave(day, modifiers)
|
21872
|
-
}, formatDay(date, dateLib.options, dateLib))) :
|
21712
|
+
}, formatDay(date, dateLib.options, dateLib))) : formatDay(day.date, dateLib.options, dateLib));
|
21873
21713
|
}));
|
21874
21714
|
}))));
|
21875
21715
|
})), props.footer && (/*#__PURE__*/React__default.createElement(components.Footer, {
|
@@ -44791,7 +44631,7 @@ const MultiRadialChart = ({
|
|
44791
44631
|
}), isLegendDetails && renderLegend(barValues.map(value => ({
|
44792
44632
|
...value,
|
44793
44633
|
label: value?.barLabel,
|
44794
|
-
key: value.value
|
44634
|
+
key: value.value?.toString()
|
44795
44635
|
})), legendType)]
|
44796
44636
|
});
|
44797
44637
|
};
|