@m4l/components 0.1.36 → 0.1.37
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/dist/{commonjs.bcc6b707.js → commonjs.565e6834.js} +0 -1
- package/dist/components/CommonActions/components/ActionCancel/{index.4b36950f.js → index.9230c57b.js} +1 -1
- package/dist/components/CommonActions/components/ActionFormCancel/{index.945e9887.js → index.ab514bd9.js} +9 -7
- package/dist/components/CommonActions/components/ActionIntro/{index.35a0d240.js → index.a0a341c7.js} +1 -1
- package/dist/components/CommonActions/components/Actions/index.d3e1f36e.js +54 -0
- package/dist/components/DataGrid/{index.156cc30c.js → index.67260455.js} +663 -15
- package/dist/components/DynamicFilter/{index.32f84995.js → index.071aa795.js} +92 -18
- package/dist/components/Icon/{index.1dbd3e58.js → index.8d754623.js} +62 -5
- package/dist/components/LanguagePopover/index.cbc4b282.js +144 -0
- package/dist/components/Loadable/{index.8c6006be.js → index.117eaced.js} +1 -1
- package/dist/components/ModalDialog/{index.91777582.js → index.a684827f.js} +5 -5
- package/dist/components/ObjectLogs/{index.9d3fc2ae.js → index.4a859658.js} +12 -10
- package/dist/components/PaperForm/{index.218a6c4b.js → index.c5948756.js} +1 -1
- package/dist/components/Period/{index.74f35862.js → index.abe445bd.js} +9 -7
- package/dist/components/Resizeable/{index.44a0dd46.js → index.c96c0f09.js} +1 -1
- package/dist/components/SplitLayout/{index.81fc4750.js → index.5a8355d8.js} +1 -1
- package/dist/components/animate/PropagateLoader/index.be5b02c3.js +30 -0
- package/dist/components/areas/components/AreasAdmin/index.6794b22f.js +112 -0
- package/dist/components/areas/components/AreasContainer/index.a2f8899b.js +43 -0
- package/dist/components/areas/components/GridLayout/index.b9c1e846.js +92 -0
- package/dist/components/areas/components/Window/index.252fbf4e.js +646 -0
- package/dist/components/areas/components/WindowPopUp/index.214cf099.js +120 -0
- package/dist/components/areas/components/index.7d6cd649.js +67 -0
- package/dist/components/areas/contexts/AreaContext/index.4894cf23.js +286 -0
- package/dist/components/areas/contexts/AreasContext/index.cd8e4bee.js +158 -0
- package/dist/components/areas/contexts/DynamicMFParmsContext/index.668bc2e2.js +17 -0
- package/dist/components/areas/contexts/index.f9196fb2.js +1 -0
- package/dist/components/areas/hooks/useArea/index.9b85ce24.js +19 -0
- package/dist/components/areas/hooks/useDynamicMFParameters/index.e6a44ae3.js +11 -0
- package/dist/components/areas/index.d1bf612c.js +16 -0
- package/dist/components/formatters/BooleanFormatter/{index.efc8ffc2.js → index.3a9b16c8.js} +1 -1
- package/dist/components/formatters/{index.c3f4b687.js → index.0b5f95d0.js} +1 -1
- package/dist/components/hook-form/RHFPeriod/{index.2b8e63a2.js → index.3772295b.js} +1 -1
- package/dist/components/hook-form/RHFTextField/{index.7feaec71.js → index.b17d68f4.js} +1 -1
- package/dist/components/modal/WindowBase.04439b8e.js +120 -0
- package/dist/components/modal/WindowConfirm.0b8a6818.js +115 -0
- package/dist/components/modal/index.8387e90e.js +18 -0
- package/dist/components/mui_extended/Accordion/{index.8e123c57.js → index.a541c71c.js} +2 -2
- package/dist/components/mui_extended/Button/index.86a155a2.js +101 -0
- package/dist/components/mui_extended/IconButton/{index.e3adaa33.js → index.82f16572.js} +5 -62
- package/dist/components/mui_extended/MenuActions/index.ee17bddd.js +112 -0
- package/dist/components/mui_extended/Pager/{index.d245f821.js → index.74d3f5fc.js} +66 -1
- package/dist/components/mui_extended/Popover/index.53c77d23.js +137 -0
- package/dist/components/mui_extended/index.85dfadf1.js +16 -0
- package/dist/contexts/ModalContext/{index.0797eb17.js → index.b90eec94.js} +1 -1
- package/dist/hooks/useModal/{index.32da4dcb.js → index.d14edee3.js} +1 -1
- package/dist/index.js +128 -1691
- package/dist/{components/animate/PropagateLoader/index.eb401503.js → node_modules.416f1da3.js} +59 -28
- package/dist/package.json +2 -1
- package/dist/{react-draggable.3b5b6680.js → react-draggable.84d6b038.js} +1 -1
- package/dist/{react-json-view.03ae95f5.js → react-json-view.57125fcf.js} +1 -1
- package/dist/{react-resizable.6eae0397.js → react-resizable.1d00271d.js} +3 -4
- package/dist/{react-splitter-layout.873aece3.js → react-splitter-layout.8b1655c8.js} +1 -1
- package/dist/style.css +0 -114
- package/dist/utils/{index.9dce2e2f.js → index.899eb67b.js} +28 -460
- package/package.json +3 -1
- package/vite.config.ts +201 -129
- package/dist/components/CommonActions/components/Actions/index.ba86f72f.js +0 -868
- package/dist/components/mui_extended/Button/index.55fc70dc.js +0 -178
- package/dist/components/mui_extended/Popover/index.97cf3a3e.js +0 -275
- package/dist/node_modules.e0b84fac.js +0 -2154
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
import React__default from "react";
|
|
2
|
-
import require$$0 from "lodash.isequal";
|
|
3
|
-
import { f as fastRGLPropsEqual$1 } from "../node_modules.e0b84fac.js";
|
|
4
2
|
var domFns = {};
|
|
5
3
|
var shims = {};
|
|
6
4
|
Object.defineProperty(shims, "__esModule", {
|
|
@@ -148,7 +146,7 @@ function _interopRequireWildcard(obj, nodeInterop) {
|
|
|
148
146
|
}
|
|
149
147
|
return newObj;
|
|
150
148
|
}
|
|
151
|
-
function ownKeys$
|
|
149
|
+
function ownKeys$1(object, enumerableOnly) {
|
|
152
150
|
var keys = Object.keys(object);
|
|
153
151
|
if (Object.getOwnPropertySymbols) {
|
|
154
152
|
var symbols = Object.getOwnPropertySymbols(object);
|
|
@@ -158,18 +156,18 @@ function ownKeys$2(object, enumerableOnly) {
|
|
|
158
156
|
}
|
|
159
157
|
return keys;
|
|
160
158
|
}
|
|
161
|
-
function _objectSpread$
|
|
159
|
+
function _objectSpread$1(target) {
|
|
162
160
|
for (var i = 1; i < arguments.length; i++) {
|
|
163
161
|
var source = null != arguments[i] ? arguments[i] : {};
|
|
164
|
-
i % 2 ? ownKeys$
|
|
165
|
-
_defineProperty$
|
|
166
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$
|
|
162
|
+
i % 2 ? ownKeys$1(Object(source), true).forEach(function(key) {
|
|
163
|
+
_defineProperty$1(target, key, source[key]);
|
|
164
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$1(Object(source)).forEach(function(key) {
|
|
167
165
|
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
168
166
|
});
|
|
169
167
|
}
|
|
170
168
|
return target;
|
|
171
169
|
}
|
|
172
|
-
function _defineProperty$
|
|
170
|
+
function _defineProperty$1(obj, key, value) {
|
|
173
171
|
if (key in obj) {
|
|
174
172
|
Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
|
|
175
173
|
} else {
|
|
@@ -202,7 +200,7 @@ function matchesSelectorAndParentsTo(el, selector, baseNode) {
|
|
|
202
200
|
function addEvent(el, event, handler, inputOptions) {
|
|
203
201
|
if (!el)
|
|
204
202
|
return;
|
|
205
|
-
var options = _objectSpread$
|
|
203
|
+
var options = _objectSpread$1({
|
|
206
204
|
capture: true
|
|
207
205
|
}, inputOptions);
|
|
208
206
|
if (el.addEventListener) {
|
|
@@ -216,7 +214,7 @@ function addEvent(el, event, handler, inputOptions) {
|
|
|
216
214
|
function removeEvent(el, event, handler, inputOptions) {
|
|
217
215
|
if (!el)
|
|
218
216
|
return;
|
|
219
|
-
var options = _objectSpread$
|
|
217
|
+
var options = _objectSpread$1({
|
|
220
218
|
capture: true
|
|
221
219
|
}, inputOptions);
|
|
222
220
|
if (el.removeEventListener) {
|
|
@@ -270,7 +268,7 @@ function offsetXYFromParent(evt, offsetParent, scale) {
|
|
|
270
268
|
}
|
|
271
269
|
function createCSSTransform(controlPos, positionOffset) {
|
|
272
270
|
var translation = getTranslation(controlPos, positionOffset, "px");
|
|
273
|
-
return _defineProperty$
|
|
271
|
+
return _defineProperty$1({}, (0, _getPrefix.browserPrefixToKey)("transform", _getPrefix.default), translation);
|
|
274
272
|
}
|
|
275
273
|
function createSVGTransform(controlPos, positionOffset) {
|
|
276
274
|
var translation = getTranslation(controlPos, positionOffset, "");
|
|
@@ -470,12 +468,12 @@ function findDOMNode(draggable) {
|
|
|
470
468
|
}
|
|
471
469
|
return node;
|
|
472
470
|
}
|
|
473
|
-
var log$
|
|
474
|
-
Object.defineProperty(log$
|
|
471
|
+
var log$1 = {};
|
|
472
|
+
Object.defineProperty(log$1, "__esModule", {
|
|
475
473
|
value: true
|
|
476
474
|
});
|
|
477
|
-
log$
|
|
478
|
-
function log
|
|
475
|
+
log$1.default = log;
|
|
476
|
+
function log() {
|
|
479
477
|
}
|
|
480
478
|
const getPaletteColor = function(palette, s) {
|
|
481
479
|
s = s.replace(/\[(\w+)\]/g, ".$1");
|
|
@@ -517,14 +515,14 @@ const getThemeVariantColor = (theme, variant) => {
|
|
|
517
515
|
}
|
|
518
516
|
return theme.palette.text.primary;
|
|
519
517
|
};
|
|
520
|
-
var utils
|
|
521
|
-
utils
|
|
522
|
-
utils
|
|
523
|
-
var _react
|
|
524
|
-
function _interopRequireDefault
|
|
518
|
+
var utils = {};
|
|
519
|
+
utils.__esModule = true;
|
|
520
|
+
utils.cloneElement = cloneElement;
|
|
521
|
+
var _react = _interopRequireDefault(React__default);
|
|
522
|
+
function _interopRequireDefault(obj) {
|
|
525
523
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
526
524
|
}
|
|
527
|
-
function ownKeys
|
|
525
|
+
function ownKeys(object, enumerableOnly) {
|
|
528
526
|
var keys = Object.keys(object);
|
|
529
527
|
if (Object.getOwnPropertySymbols) {
|
|
530
528
|
var symbols = Object.getOwnPropertySymbols(object);
|
|
@@ -537,24 +535,24 @@ function ownKeys$1(object, enumerableOnly) {
|
|
|
537
535
|
}
|
|
538
536
|
return keys;
|
|
539
537
|
}
|
|
540
|
-
function _objectSpread
|
|
538
|
+
function _objectSpread(target) {
|
|
541
539
|
for (var i = 1; i < arguments.length; i++) {
|
|
542
540
|
var source = arguments[i] != null ? arguments[i] : {};
|
|
543
541
|
if (i % 2) {
|
|
544
|
-
ownKeys
|
|
545
|
-
_defineProperty
|
|
542
|
+
ownKeys(Object(source), true).forEach(function(key) {
|
|
543
|
+
_defineProperty(target, key, source[key]);
|
|
546
544
|
});
|
|
547
545
|
} else if (Object.getOwnPropertyDescriptors) {
|
|
548
546
|
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
549
547
|
} else {
|
|
550
|
-
ownKeys
|
|
548
|
+
ownKeys(Object(source)).forEach(function(key) {
|
|
551
549
|
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
552
550
|
});
|
|
553
551
|
}
|
|
554
552
|
}
|
|
555
553
|
return target;
|
|
556
554
|
}
|
|
557
|
-
function _defineProperty
|
|
555
|
+
function _defineProperty(obj, key, value) {
|
|
558
556
|
if (key in obj) {
|
|
559
557
|
Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
|
|
560
558
|
} else {
|
|
@@ -564,449 +562,19 @@ function _defineProperty$1(obj, key, value) {
|
|
|
564
562
|
}
|
|
565
563
|
function cloneElement(element, props) {
|
|
566
564
|
if (props.style && element.props.style) {
|
|
567
|
-
props.style = _objectSpread
|
|
565
|
+
props.style = _objectSpread(_objectSpread({}, element.props.style), props.style);
|
|
568
566
|
}
|
|
569
567
|
if (props.className && element.props.className) {
|
|
570
568
|
props.className = element.props.className + " " + props.className;
|
|
571
569
|
}
|
|
572
|
-
return /* @__PURE__ */ _react
|
|
570
|
+
return /* @__PURE__ */ _react.default.cloneElement(element, props);
|
|
573
571
|
}
|
|
574
|
-
var utils = {};
|
|
575
|
-
Object.defineProperty(utils, "__esModule", {
|
|
576
|
-
value: true
|
|
577
|
-
});
|
|
578
|
-
utils.bottom = bottom;
|
|
579
|
-
utils.childrenEqual = childrenEqual;
|
|
580
|
-
utils.cloneLayout = cloneLayout;
|
|
581
|
-
utils.cloneLayoutItem = cloneLayoutItem;
|
|
582
|
-
utils.collides = collides;
|
|
583
|
-
utils.compact = compact;
|
|
584
|
-
utils.compactItem = compactItem;
|
|
585
|
-
utils.compactType = compactType;
|
|
586
|
-
utils.correctBounds = correctBounds;
|
|
587
|
-
utils.fastPositionEqual = fastPositionEqual;
|
|
588
|
-
utils.fastRGLPropsEqual = void 0;
|
|
589
|
-
utils.getAllCollisions = getAllCollisions;
|
|
590
|
-
utils.getFirstCollision = getFirstCollision;
|
|
591
|
-
utils.getLayoutItem = getLayoutItem;
|
|
592
|
-
utils.getStatics = getStatics;
|
|
593
|
-
utils.modifyLayout = modifyLayout;
|
|
594
|
-
utils.moveElement = moveElement;
|
|
595
|
-
utils.moveElementAwayFromCollision = moveElementAwayFromCollision;
|
|
596
|
-
utils.noop = void 0;
|
|
597
|
-
utils.perc = perc;
|
|
598
|
-
utils.setTopLeft = setTopLeft;
|
|
599
|
-
utils.setTransform = setTransform;
|
|
600
|
-
utils.sortLayoutItems = sortLayoutItems;
|
|
601
|
-
utils.sortLayoutItemsByColRow = sortLayoutItemsByColRow;
|
|
602
|
-
utils.sortLayoutItemsByRowCol = sortLayoutItemsByRowCol;
|
|
603
|
-
utils.synchronizeLayoutWithChildren = synchronizeLayoutWithChildren;
|
|
604
|
-
utils.validateLayout = validateLayout;
|
|
605
|
-
utils.withLayoutItem = withLayoutItem;
|
|
606
|
-
var _lodash = _interopRequireDefault(require$$0);
|
|
607
|
-
var _react = _interopRequireDefault(React__default);
|
|
608
|
-
function _interopRequireDefault(obj) {
|
|
609
|
-
return obj && obj.__esModule ? obj : { default: obj };
|
|
610
|
-
}
|
|
611
|
-
function ownKeys(object, enumerableOnly) {
|
|
612
|
-
var keys = Object.keys(object);
|
|
613
|
-
if (Object.getOwnPropertySymbols) {
|
|
614
|
-
var symbols = Object.getOwnPropertySymbols(object);
|
|
615
|
-
enumerableOnly && (symbols = symbols.filter(function(sym) {
|
|
616
|
-
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
617
|
-
})), keys.push.apply(keys, symbols);
|
|
618
|
-
}
|
|
619
|
-
return keys;
|
|
620
|
-
}
|
|
621
|
-
function _objectSpread(target) {
|
|
622
|
-
for (var i = 1; i < arguments.length; i++) {
|
|
623
|
-
var source = null != arguments[i] ? arguments[i] : {};
|
|
624
|
-
i % 2 ? ownKeys(Object(source), true).forEach(function(key) {
|
|
625
|
-
_defineProperty(target, key, source[key]);
|
|
626
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function(key) {
|
|
627
|
-
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
628
|
-
});
|
|
629
|
-
}
|
|
630
|
-
return target;
|
|
631
|
-
}
|
|
632
|
-
function _defineProperty(obj, key, value) {
|
|
633
|
-
if (key in obj) {
|
|
634
|
-
Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
|
|
635
|
-
} else {
|
|
636
|
-
obj[key] = value;
|
|
637
|
-
}
|
|
638
|
-
return obj;
|
|
639
|
-
}
|
|
640
|
-
var isProduction = process.env.NODE_ENV === "production";
|
|
641
|
-
function bottom(layout) {
|
|
642
|
-
var max = 0, bottomY;
|
|
643
|
-
for (var i = 0, len = layout.length; i < len; i++) {
|
|
644
|
-
bottomY = layout[i].y + layout[i].h;
|
|
645
|
-
if (bottomY > max)
|
|
646
|
-
max = bottomY;
|
|
647
|
-
}
|
|
648
|
-
return max;
|
|
649
|
-
}
|
|
650
|
-
function cloneLayout(layout) {
|
|
651
|
-
var newLayout = Array(layout.length);
|
|
652
|
-
for (var i = 0, len = layout.length; i < len; i++) {
|
|
653
|
-
newLayout[i] = cloneLayoutItem(layout[i]);
|
|
654
|
-
}
|
|
655
|
-
return newLayout;
|
|
656
|
-
}
|
|
657
|
-
function modifyLayout(layout, layoutItem) {
|
|
658
|
-
var newLayout = Array(layout.length);
|
|
659
|
-
for (var i = 0, len = layout.length; i < len; i++) {
|
|
660
|
-
if (layoutItem.i === layout[i].i) {
|
|
661
|
-
newLayout[i] = layoutItem;
|
|
662
|
-
} else {
|
|
663
|
-
newLayout[i] = layout[i];
|
|
664
|
-
}
|
|
665
|
-
}
|
|
666
|
-
return newLayout;
|
|
667
|
-
}
|
|
668
|
-
function withLayoutItem(layout, itemKey, cb) {
|
|
669
|
-
var item = getLayoutItem(layout, itemKey);
|
|
670
|
-
if (!item)
|
|
671
|
-
return [layout, null];
|
|
672
|
-
item = cb(cloneLayoutItem(item));
|
|
673
|
-
layout = modifyLayout(layout, item);
|
|
674
|
-
return [layout, item];
|
|
675
|
-
}
|
|
676
|
-
function cloneLayoutItem(layoutItem) {
|
|
677
|
-
return {
|
|
678
|
-
w: layoutItem.w,
|
|
679
|
-
h: layoutItem.h,
|
|
680
|
-
x: layoutItem.x,
|
|
681
|
-
y: layoutItem.y,
|
|
682
|
-
i: layoutItem.i,
|
|
683
|
-
minW: layoutItem.minW,
|
|
684
|
-
maxW: layoutItem.maxW,
|
|
685
|
-
minH: layoutItem.minH,
|
|
686
|
-
maxH: layoutItem.maxH,
|
|
687
|
-
moved: Boolean(layoutItem.moved),
|
|
688
|
-
static: Boolean(layoutItem.static),
|
|
689
|
-
isDraggable: layoutItem.isDraggable,
|
|
690
|
-
isResizable: layoutItem.isResizable,
|
|
691
|
-
resizeHandles: layoutItem.resizeHandles,
|
|
692
|
-
isBounded: layoutItem.isBounded
|
|
693
|
-
};
|
|
694
|
-
}
|
|
695
|
-
function childrenEqual(a, b) {
|
|
696
|
-
return (0, _lodash.default)(_react.default.Children.map(a, function(c) {
|
|
697
|
-
return c === null || c === void 0 ? void 0 : c.key;
|
|
698
|
-
}), _react.default.Children.map(b, function(c) {
|
|
699
|
-
return c === null || c === void 0 ? void 0 : c.key;
|
|
700
|
-
}));
|
|
701
|
-
}
|
|
702
|
-
var fastRGLPropsEqual = fastRGLPropsEqual$1;
|
|
703
|
-
utils.fastRGLPropsEqual = fastRGLPropsEqual;
|
|
704
|
-
function fastPositionEqual(a, b) {
|
|
705
|
-
return a.left === b.left && a.top === b.top && a.width === b.width && a.height === b.height;
|
|
706
|
-
}
|
|
707
|
-
function collides(l1, l2) {
|
|
708
|
-
if (l1.i === l2.i)
|
|
709
|
-
return false;
|
|
710
|
-
if (l1.x + l1.w <= l2.x)
|
|
711
|
-
return false;
|
|
712
|
-
if (l1.x >= l2.x + l2.w)
|
|
713
|
-
return false;
|
|
714
|
-
if (l1.y + l1.h <= l2.y)
|
|
715
|
-
return false;
|
|
716
|
-
if (l1.y >= l2.y + l2.h)
|
|
717
|
-
return false;
|
|
718
|
-
return true;
|
|
719
|
-
}
|
|
720
|
-
function compact(layout, compactType2, cols) {
|
|
721
|
-
var compareWith = getStatics(layout);
|
|
722
|
-
var sorted = sortLayoutItems(layout, compactType2);
|
|
723
|
-
var out = Array(layout.length);
|
|
724
|
-
for (var i = 0, len = sorted.length; i < len; i++) {
|
|
725
|
-
var l = cloneLayoutItem(sorted[i]);
|
|
726
|
-
if (!l.static) {
|
|
727
|
-
l = compactItem(compareWith, l, compactType2, cols, sorted);
|
|
728
|
-
compareWith.push(l);
|
|
729
|
-
}
|
|
730
|
-
out[layout.indexOf(sorted[i])] = l;
|
|
731
|
-
l.moved = false;
|
|
732
|
-
}
|
|
733
|
-
return out;
|
|
734
|
-
}
|
|
735
|
-
var heightWidth = {
|
|
736
|
-
x: "w",
|
|
737
|
-
y: "h"
|
|
738
|
-
};
|
|
739
|
-
function resolveCompactionCollision(layout, item, moveToCoord, axis) {
|
|
740
|
-
var sizeProp = heightWidth[axis];
|
|
741
|
-
item[axis] += 1;
|
|
742
|
-
var itemIndex = layout.map(function(layoutItem) {
|
|
743
|
-
return layoutItem.i;
|
|
744
|
-
}).indexOf(item.i);
|
|
745
|
-
for (var i = itemIndex + 1; i < layout.length; i++) {
|
|
746
|
-
var otherItem = layout[i];
|
|
747
|
-
if (otherItem.static)
|
|
748
|
-
continue;
|
|
749
|
-
if (otherItem.y > item.y + item.h)
|
|
750
|
-
break;
|
|
751
|
-
if (collides(item, otherItem)) {
|
|
752
|
-
resolveCompactionCollision(layout, otherItem, moveToCoord + item[sizeProp], axis);
|
|
753
|
-
}
|
|
754
|
-
}
|
|
755
|
-
item[axis] = moveToCoord;
|
|
756
|
-
}
|
|
757
|
-
function compactItem(compareWith, l, compactType2, cols, fullLayout) {
|
|
758
|
-
var compactV = compactType2 === "vertical";
|
|
759
|
-
var compactH = compactType2 === "horizontal";
|
|
760
|
-
if (compactV) {
|
|
761
|
-
l.y = Math.min(bottom(compareWith), l.y);
|
|
762
|
-
while (l.y > 0 && !getFirstCollision(compareWith, l)) {
|
|
763
|
-
l.y--;
|
|
764
|
-
}
|
|
765
|
-
} else if (compactH) {
|
|
766
|
-
while (l.x > 0 && !getFirstCollision(compareWith, l)) {
|
|
767
|
-
l.x--;
|
|
768
|
-
}
|
|
769
|
-
}
|
|
770
|
-
var collides2;
|
|
771
|
-
while (collides2 = getFirstCollision(compareWith, l)) {
|
|
772
|
-
if (compactH) {
|
|
773
|
-
resolveCompactionCollision(fullLayout, l, collides2.x + collides2.w, "x");
|
|
774
|
-
} else {
|
|
775
|
-
resolveCompactionCollision(fullLayout, l, collides2.y + collides2.h, "y");
|
|
776
|
-
}
|
|
777
|
-
if (compactH && l.x + l.w > cols) {
|
|
778
|
-
l.x = cols - l.w;
|
|
779
|
-
l.y++;
|
|
780
|
-
}
|
|
781
|
-
}
|
|
782
|
-
l.y = Math.max(l.y, 0);
|
|
783
|
-
l.x = Math.max(l.x, 0);
|
|
784
|
-
return l;
|
|
785
|
-
}
|
|
786
|
-
function correctBounds(layout, bounds) {
|
|
787
|
-
var collidesWith = getStatics(layout);
|
|
788
|
-
for (var i = 0, len = layout.length; i < len; i++) {
|
|
789
|
-
var l = layout[i];
|
|
790
|
-
if (l.x + l.w > bounds.cols)
|
|
791
|
-
l.x = bounds.cols - l.w;
|
|
792
|
-
if (l.x < 0) {
|
|
793
|
-
l.x = 0;
|
|
794
|
-
l.w = bounds.cols;
|
|
795
|
-
}
|
|
796
|
-
if (!l.static)
|
|
797
|
-
collidesWith.push(l);
|
|
798
|
-
else {
|
|
799
|
-
while (getFirstCollision(collidesWith, l)) {
|
|
800
|
-
l.y++;
|
|
801
|
-
}
|
|
802
|
-
}
|
|
803
|
-
}
|
|
804
|
-
return layout;
|
|
805
|
-
}
|
|
806
|
-
function getLayoutItem(layout, id) {
|
|
807
|
-
for (var i = 0, len = layout.length; i < len; i++) {
|
|
808
|
-
if (layout[i].i === id)
|
|
809
|
-
return layout[i];
|
|
810
|
-
}
|
|
811
|
-
}
|
|
812
|
-
function getFirstCollision(layout, layoutItem) {
|
|
813
|
-
for (var i = 0, len = layout.length; i < len; i++) {
|
|
814
|
-
if (collides(layout[i], layoutItem))
|
|
815
|
-
return layout[i];
|
|
816
|
-
}
|
|
817
|
-
}
|
|
818
|
-
function getAllCollisions(layout, layoutItem) {
|
|
819
|
-
return layout.filter(function(l) {
|
|
820
|
-
return collides(l, layoutItem);
|
|
821
|
-
});
|
|
822
|
-
}
|
|
823
|
-
function getStatics(layout) {
|
|
824
|
-
return layout.filter(function(l) {
|
|
825
|
-
return l.static;
|
|
826
|
-
});
|
|
827
|
-
}
|
|
828
|
-
function moveElement(layout, l, x, y, isUserAction, preventCollision, compactType2, cols, allowOverlap) {
|
|
829
|
-
if (l.static && l.isDraggable !== true)
|
|
830
|
-
return layout;
|
|
831
|
-
if (l.y === y && l.x === x)
|
|
832
|
-
return layout;
|
|
833
|
-
log("Moving element ".concat(l.i, " to [").concat(String(x), ",").concat(String(y), "] from [").concat(l.x, ",").concat(l.y, "]"));
|
|
834
|
-
var oldX = l.x;
|
|
835
|
-
var oldY = l.y;
|
|
836
|
-
if (typeof x === "number")
|
|
837
|
-
l.x = x;
|
|
838
|
-
if (typeof y === "number")
|
|
839
|
-
l.y = y;
|
|
840
|
-
l.moved = true;
|
|
841
|
-
var sorted = sortLayoutItems(layout, compactType2);
|
|
842
|
-
var movingUp = compactType2 === "vertical" && typeof y === "number" ? oldY >= y : compactType2 === "horizontal" && typeof x === "number" ? oldX >= x : false;
|
|
843
|
-
if (movingUp)
|
|
844
|
-
sorted = sorted.reverse();
|
|
845
|
-
var collisions = getAllCollisions(sorted, l);
|
|
846
|
-
var hasCollisions = collisions.length > 0;
|
|
847
|
-
if (hasCollisions && allowOverlap) {
|
|
848
|
-
return cloneLayout(layout);
|
|
849
|
-
} else if (hasCollisions && preventCollision) {
|
|
850
|
-
log("Collision prevented on ".concat(l.i, ", reverting."));
|
|
851
|
-
l.x = oldX;
|
|
852
|
-
l.y = oldY;
|
|
853
|
-
l.moved = false;
|
|
854
|
-
return layout;
|
|
855
|
-
}
|
|
856
|
-
for (var i = 0, len = collisions.length; i < len; i++) {
|
|
857
|
-
var collision = collisions[i];
|
|
858
|
-
log("Resolving collision between ".concat(l.i, " at [").concat(l.x, ",").concat(l.y, "] and ").concat(collision.i, " at [").concat(collision.x, ",").concat(collision.y, "]"));
|
|
859
|
-
if (collision.moved)
|
|
860
|
-
continue;
|
|
861
|
-
if (collision.static) {
|
|
862
|
-
layout = moveElementAwayFromCollision(layout, collision, l, isUserAction, compactType2);
|
|
863
|
-
} else {
|
|
864
|
-
layout = moveElementAwayFromCollision(layout, l, collision, isUserAction, compactType2);
|
|
865
|
-
}
|
|
866
|
-
}
|
|
867
|
-
return layout;
|
|
868
|
-
}
|
|
869
|
-
function moveElementAwayFromCollision(layout, collidesWith, itemToMove, isUserAction, compactType2, cols) {
|
|
870
|
-
var compactH = compactType2 === "horizontal";
|
|
871
|
-
var compactV = compactType2 !== "horizontal";
|
|
872
|
-
var preventCollision = collidesWith.static;
|
|
873
|
-
if (isUserAction) {
|
|
874
|
-
isUserAction = false;
|
|
875
|
-
var fakeItem = {
|
|
876
|
-
x: compactH ? Math.max(collidesWith.x - itemToMove.w, 0) : itemToMove.x,
|
|
877
|
-
y: compactV ? Math.max(collidesWith.y - itemToMove.h, 0) : itemToMove.y,
|
|
878
|
-
w: itemToMove.w,
|
|
879
|
-
h: itemToMove.h,
|
|
880
|
-
i: "-1"
|
|
881
|
-
};
|
|
882
|
-
if (!getFirstCollision(layout, fakeItem)) {
|
|
883
|
-
log("Doing reverse collision on ".concat(itemToMove.i, " up to [").concat(fakeItem.x, ",").concat(fakeItem.y, "]."));
|
|
884
|
-
return moveElement(layout, itemToMove, compactH ? fakeItem.x : void 0, compactV ? fakeItem.y : void 0, isUserAction, preventCollision, compactType2);
|
|
885
|
-
}
|
|
886
|
-
}
|
|
887
|
-
return moveElement(layout, itemToMove, compactH ? itemToMove.x + 1 : void 0, compactV ? itemToMove.y + 1 : void 0, isUserAction, preventCollision, compactType2);
|
|
888
|
-
}
|
|
889
|
-
function perc(num) {
|
|
890
|
-
return num * 100 + "%";
|
|
891
|
-
}
|
|
892
|
-
function setTransform(_ref) {
|
|
893
|
-
var top = _ref.top, left = _ref.left, width = _ref.width, height = _ref.height;
|
|
894
|
-
var translate = "translate(".concat(left, "px,").concat(top, "px)");
|
|
895
|
-
return {
|
|
896
|
-
transform: translate,
|
|
897
|
-
WebkitTransform: translate,
|
|
898
|
-
MozTransform: translate,
|
|
899
|
-
msTransform: translate,
|
|
900
|
-
OTransform: translate,
|
|
901
|
-
width: "".concat(width, "px"),
|
|
902
|
-
height: "".concat(height, "px"),
|
|
903
|
-
position: "absolute"
|
|
904
|
-
};
|
|
905
|
-
}
|
|
906
|
-
function setTopLeft(_ref2) {
|
|
907
|
-
var top = _ref2.top, left = _ref2.left, width = _ref2.width, height = _ref2.height;
|
|
908
|
-
return {
|
|
909
|
-
top: "".concat(top, "px"),
|
|
910
|
-
left: "".concat(left, "px"),
|
|
911
|
-
width: "".concat(width, "px"),
|
|
912
|
-
height: "".concat(height, "px"),
|
|
913
|
-
position: "absolute"
|
|
914
|
-
};
|
|
915
|
-
}
|
|
916
|
-
function sortLayoutItems(layout, compactType2) {
|
|
917
|
-
if (compactType2 === "horizontal")
|
|
918
|
-
return sortLayoutItemsByColRow(layout);
|
|
919
|
-
if (compactType2 === "vertical")
|
|
920
|
-
return sortLayoutItemsByRowCol(layout);
|
|
921
|
-
else
|
|
922
|
-
return layout;
|
|
923
|
-
}
|
|
924
|
-
function sortLayoutItemsByRowCol(layout) {
|
|
925
|
-
return layout.slice(0).sort(function(a, b) {
|
|
926
|
-
if (a.y > b.y || a.y === b.y && a.x > b.x) {
|
|
927
|
-
return 1;
|
|
928
|
-
} else if (a.y === b.y && a.x === b.x) {
|
|
929
|
-
return 0;
|
|
930
|
-
}
|
|
931
|
-
return -1;
|
|
932
|
-
});
|
|
933
|
-
}
|
|
934
|
-
function sortLayoutItemsByColRow(layout) {
|
|
935
|
-
return layout.slice(0).sort(function(a, b) {
|
|
936
|
-
if (a.x > b.x || a.x === b.x && a.y > b.y) {
|
|
937
|
-
return 1;
|
|
938
|
-
}
|
|
939
|
-
return -1;
|
|
940
|
-
});
|
|
941
|
-
}
|
|
942
|
-
function synchronizeLayoutWithChildren(initialLayout, children, cols, compactType2, allowOverlap) {
|
|
943
|
-
initialLayout = initialLayout || [];
|
|
944
|
-
var layout = [];
|
|
945
|
-
_react.default.Children.forEach(children, function(child) {
|
|
946
|
-
if ((child === null || child === void 0 ? void 0 : child.key) == null)
|
|
947
|
-
return;
|
|
948
|
-
var exists = getLayoutItem(initialLayout, String(child.key));
|
|
949
|
-
if (exists) {
|
|
950
|
-
layout.push(cloneLayoutItem(exists));
|
|
951
|
-
} else {
|
|
952
|
-
if (!isProduction && child.props._grid) {
|
|
953
|
-
console.warn("`_grid` properties on children have been deprecated as of React 15.2. Please use `data-grid` or add your properties directly to the `layout`.");
|
|
954
|
-
}
|
|
955
|
-
var g = child.props["data-grid"] || child.props._grid;
|
|
956
|
-
if (g) {
|
|
957
|
-
if (!isProduction) {
|
|
958
|
-
validateLayout([g], "ReactGridLayout.children");
|
|
959
|
-
}
|
|
960
|
-
layout.push(cloneLayoutItem(_objectSpread(_objectSpread({}, g), {}, {
|
|
961
|
-
i: child.key
|
|
962
|
-
})));
|
|
963
|
-
} else {
|
|
964
|
-
layout.push(cloneLayoutItem({
|
|
965
|
-
w: 1,
|
|
966
|
-
h: 1,
|
|
967
|
-
x: 0,
|
|
968
|
-
y: bottom(layout),
|
|
969
|
-
i: String(child.key)
|
|
970
|
-
}));
|
|
971
|
-
}
|
|
972
|
-
}
|
|
973
|
-
});
|
|
974
|
-
var correctedLayout = correctBounds(layout, {
|
|
975
|
-
cols
|
|
976
|
-
});
|
|
977
|
-
return allowOverlap ? correctedLayout : compact(correctedLayout, compactType2, cols);
|
|
978
|
-
}
|
|
979
|
-
function validateLayout(layout) {
|
|
980
|
-
var contextName = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "Layout";
|
|
981
|
-
var subProps = ["x", "y", "w", "h"];
|
|
982
|
-
if (!Array.isArray(layout))
|
|
983
|
-
throw new Error(contextName + " must be an array!");
|
|
984
|
-
for (var i = 0, len = layout.length; i < len; i++) {
|
|
985
|
-
var item = layout[i];
|
|
986
|
-
for (var j = 0; j < subProps.length; j++) {
|
|
987
|
-
if (typeof item[subProps[j]] !== "number") {
|
|
988
|
-
throw new Error("ReactGridLayout: " + contextName + "[" + i + "]." + subProps[j] + " must be a number!");
|
|
989
|
-
}
|
|
990
|
-
}
|
|
991
|
-
}
|
|
992
|
-
}
|
|
993
|
-
function compactType(props) {
|
|
994
|
-
var _ref3 = props || {}, verticalCompact = _ref3.verticalCompact, compactType2 = _ref3.compactType;
|
|
995
|
-
return verticalCompact === false ? null : compactType2;
|
|
996
|
-
}
|
|
997
|
-
function log() {
|
|
998
|
-
return;
|
|
999
|
-
}
|
|
1000
|
-
var noop = function noop2() {
|
|
1001
|
-
};
|
|
1002
|
-
utils.noop = noop;
|
|
1003
572
|
export {
|
|
1004
573
|
getThemeVariantColor as a,
|
|
1005
|
-
|
|
1006
|
-
getVariantColor as c,
|
|
574
|
+
getVariantColor as b,
|
|
1007
575
|
domFns as d,
|
|
1008
576
|
getPaletteColor as g,
|
|
1009
|
-
log$
|
|
577
|
+
log$1 as l,
|
|
1010
578
|
positionFns as p,
|
|
1011
579
|
shims as s,
|
|
1012
580
|
utils as u
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@m4l/components",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.37",
|
|
4
4
|
"license": "UNLICENSED",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"typescript": "tsc",
|
|
@@ -21,6 +21,7 @@
|
|
|
21
21
|
"@m4l/graphics": "*",
|
|
22
22
|
"lodash.debounce": "^4.0.8",
|
|
23
23
|
"lodash.throttle": "^4.1.1",
|
|
24
|
+
"react-grid-layout": "^1.3.4",
|
|
24
25
|
"react-helmet-async": "^1.3.0",
|
|
25
26
|
"react-hook-form": "^7.33.1",
|
|
26
27
|
"react-router-dom": "6.3.0",
|
|
@@ -56,6 +57,7 @@
|
|
|
56
57
|
"@types/node": "^16.7.10",
|
|
57
58
|
"@types/react": "^18.0.0",
|
|
58
59
|
"@types/react-dom": "^18.0.0",
|
|
60
|
+
"@types/react-grid-layout": "^1.3.2",
|
|
59
61
|
"@types/react-lazy-load-image-component": "^1.5.2",
|
|
60
62
|
"@types/react-resizable": "^3.0.1",
|
|
61
63
|
"@types/react-splitter-layout": "^3.0.2",
|