@get-set/gs-sortable 0.0.36 → 0.0.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/README.md +99 -1
- package/actions/afterAllImagesLoad.ts +36 -0
- package/actions/calculate.ts +155 -0
- package/actions/calculateOnSort.ts +270 -0
- package/actions/checkItemInContainer.ts +22 -0
- package/actions/destroy.ts +30 -0
- package/actions/general.ts +72 -0
- package/actions/getCurrentParams.ts +32 -0
- package/actions/init.ts +31 -0
- package/actions/initDraggable.ts +85 -0
- package/actions/initMouseMove.ts +120 -0
- package/actions/initScroll.ts +21 -0
- package/actions/initSortEnd.ts +87 -0
- package/components/GSSortable.tsx +160 -0
- package/components/styles/GSSortable.css +39 -0
- package/components/styles/GSSortable.scss +38 -0
- package/components/styles/GSSortableCSS.ts +41 -0
- package/constants/constParams.ts +5 -0
- package/constants/defaultParams.ts +20 -0
- package/constants/types.ts +7 -0
- package/dist/GSSortable.d.ts +2 -0
- package/dist/actions/afterAllImagesLoad.d.ts +4 -0
- package/dist/actions/afterAllImagesLoad.d.ts.map +1 -0
- package/dist/actions/afterAllImagesLoad.js +35 -0
- package/dist/actions/afterAllImagesLoad.js.map +1 -0
- package/dist/actions/calculate.d.ts +3 -2
- package/dist/actions/calculate.d.ts.map +1 -0
- package/dist/actions/calculate.js +13 -18
- package/dist/actions/calculate.js.map +1 -1
- package/dist/actions/calculateOnSort.d.ts +3 -2
- package/dist/actions/calculateOnSort.d.ts.map +1 -0
- package/dist/actions/calculateOnSort.js +51 -70
- package/dist/actions/calculateOnSort.js.map +1 -1
- package/dist/actions/checkItemInContainer.d.ts +1 -0
- package/dist/actions/checkItemInContainer.d.ts.map +1 -0
- package/dist/actions/checkItemInContainer.js +8 -17
- package/dist/actions/checkItemInContainer.js.map +1 -1
- package/dist/actions/destroy.d.ts +3 -8
- package/dist/actions/destroy.d.ts.map +1 -0
- package/dist/actions/destroy.js +7 -9
- package/dist/actions/destroy.js.map +1 -1
- package/dist/actions/general.d.ts +1 -0
- package/dist/actions/general.d.ts.map +1 -0
- package/dist/actions/general.js +5 -12
- package/dist/actions/general.js.map +1 -1
- package/dist/actions/getCurrentParams.d.ts +4 -9
- package/dist/actions/getCurrentParams.d.ts.map +1 -0
- package/dist/actions/getCurrentParams.js +15 -18
- package/dist/actions/getCurrentParams.js.map +1 -1
- package/dist/actions/init.d.ts +3 -2
- package/dist/actions/init.d.ts.map +1 -0
- package/dist/actions/init.js +13 -16
- package/dist/actions/init.js.map +1 -1
- package/dist/actions/initDraggable.d.ts +3 -2
- package/dist/actions/initDraggable.d.ts.map +1 -0
- package/dist/actions/initDraggable.js +14 -22
- package/dist/actions/initDraggable.js.map +1 -1
- package/dist/actions/initMouseMove.d.ts +1 -0
- package/dist/actions/initMouseMove.d.ts.map +1 -0
- package/dist/actions/initMouseMove.js +40 -53
- package/dist/actions/initMouseMove.js.map +1 -1
- package/dist/actions/initScroll.d.ts +1 -0
- package/dist/actions/initScroll.d.ts.map +1 -0
- package/dist/actions/initScroll.js +7 -15
- package/dist/actions/initScroll.js.map +1 -1
- package/dist/actions/initSortEnd.d.ts +2 -1
- package/dist/actions/initSortEnd.d.ts.map +1 -0
- package/dist/actions/initSortEnd.js +62 -71
- package/dist/actions/initSortEnd.js.map +1 -1
- package/dist/components/GSSortable.d.ts +4 -19
- package/dist/components/GSSortable.d.ts.map +1 -0
- package/dist/components/GSSortable.js +72 -105
- package/dist/components/GSSortable.js.map +1 -1
- package/dist/components/styles/GSSortableCSS.d.ts +2 -1
- package/dist/components/styles/GSSortableCSS.d.ts.map +1 -0
- package/dist/components/styles/GSSortableCSS.js +3 -4
- package/dist/components/styles/GSSortableCSS.js.map +1 -1
- package/dist/constants/constParams.d.ts +4 -3
- package/dist/constants/constParams.d.ts.map +1 -0
- package/dist/constants/constParams.js +2 -4
- package/dist/constants/constParams.js.map +1 -1
- package/dist/constants/defaultParams.d.ts +3 -2
- package/dist/constants/defaultParams.d.ts.map +1 -0
- package/dist/constants/defaultParams.js +3 -8
- package/dist/constants/defaultParams.js.map +1 -1
- package/dist/constants/types.d.ts +1 -0
- package/dist/constants/types.d.ts.map +1 -0
- package/dist/constants/types.js +1 -3
- package/dist/constants/types.js.map +1 -1
- package/dist/helpers/uihelpers.d.ts +2 -1
- package/dist/helpers/uihelpers.d.ts.map +1 -0
- package/dist/helpers/uihelpers.js +9 -23
- package/dist/helpers/uihelpers.js.map +1 -1
- package/dist/types/params.d.ts +23 -0
- package/dist/types/params.d.ts.map +1 -0
- package/dist/types/params.js +2 -0
- package/dist/types/params.js.map +1 -0
- package/dist/types/ref.d.ts +41 -0
- package/dist/types/ref.d.ts.map +1 -0
- package/dist/types/ref.js +2 -0
- package/dist/types/ref.js.map +1 -0
- package/dist-js/bundle.js +1181 -0
- package/helpers/uihelpers.ts +44 -0
- package/package.json +71 -43
- package/styles/GSSortable.css +39 -0
- package/styles/GSSortable.scss +38 -0
- package/types/global.d.ts +19 -0
- package/types/params.ts +24 -0
- package/types/ref.ts +41 -0
- package/index.js +0 -3
|
@@ -1,76 +1,67 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
}
|
|
23
|
-
info.ref.isAddjusting = true;
|
|
24
|
-
const $el = info.$el;
|
|
25
|
-
const placeholder = info.placeholder;
|
|
26
|
-
info.$el.classList.remove('gs-sortable-item-inmove');
|
|
27
|
-
info.ref.grid.classList.remove('gs-sortable-active');
|
|
28
|
-
const activeParent = info.ref.grid.closest('.gs-sortable-item-active-parent');
|
|
29
|
-
if (activeParent) {
|
|
30
|
-
activeParent.classList.remove('gs-sortable-item-active-parent');
|
|
31
|
-
}
|
|
32
|
-
info.$el.classList.add('gs-sortable-item-addjusting');
|
|
33
|
-
window.GSSortableConfigue.draggableInfo = undefined;
|
|
34
|
-
info.$el.style.top = `${info.newTop + containerDifY}px`;
|
|
35
|
-
info.$el.style.left = `${info.newLeft + containerDifX}px`;
|
|
36
|
-
info.$el.style.removeProperty('transform');
|
|
37
|
-
setTimeout(() => {
|
|
38
|
-
var _a, _b, _c, _d, _e, _f;
|
|
39
|
-
$el.classList.remove('gs-sortable-item-addjusting');
|
|
40
|
-
if (info.ref.currentParams.reference ===
|
|
41
|
-
window.GSSortableConfigue.takeFrom.currentParams.reference &&
|
|
42
|
-
window.GSSortableConfigue.takeFrom.currentParams.takeClone) {
|
|
43
|
-
info.$el.remove();
|
|
44
|
-
}
|
|
45
|
-
else {
|
|
46
|
-
if (info.index != undefined) {
|
|
47
|
-
(0, general_1.moveChildToIndex)(info.ref.grid, info.$el, info.index);
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
placeholder.remove();
|
|
51
|
-
if (info.ref.currentParams.reference !==
|
|
52
|
-
window.GSSortableConfigue.takeFrom.currentParams.reference) {
|
|
53
|
-
(_b = (_a = window.GSSortableConfigue.takeFrom.currentParams).afterSort) === null || _b === void 0 ? void 0 : _b.call(_a, window.GSSortableConfigue.takeFrom.grid.querySelectorAll('.gs-sortable-item'));
|
|
54
|
-
(_d = (_c = info.ref.currentParams).afterSort) === null || _d === void 0 ? void 0 : _d.call(_c, info.ref.grid.querySelectorAll('.gs-sortable-item'));
|
|
55
|
-
window.GSSortableConfigue.takeFrom.refresh();
|
|
56
|
-
info.ref.refresh();
|
|
57
|
-
}
|
|
58
|
-
else {
|
|
59
|
-
(0, calculate_1.default)(info.ref);
|
|
60
|
-
(_f = (_e = info.ref.currentParams).afterSort) === null || _f === void 0 ? void 0 : _f.call(_e, info.ref.grid.querySelectorAll('.gs-sortable-item'));
|
|
61
|
-
}
|
|
62
|
-
info.ref.isAddjusting = false;
|
|
63
|
-
}, constParams_1.default.animationSpeed);
|
|
1
|
+
import constParams from '../constants/constParams';
|
|
2
|
+
import calculate from './calculate';
|
|
3
|
+
import { getOffsetFromBody, moveChildToIndex } from './general';
|
|
4
|
+
const initSortEnd = (_event) => {
|
|
5
|
+
if (window.GSSortableConfigue?.draggableInfo === undefined)
|
|
6
|
+
return;
|
|
7
|
+
// Capture all needed values before clearing the global — prevents a second
|
|
8
|
+
// mousedown during the animation from reading stale isAdjusting state.
|
|
9
|
+
const draggableInfo = window.GSSortableConfigue.draggableInfo;
|
|
10
|
+
const { $el, ref, placeholder, moved, newTop, newLeft, index } = draggableInfo;
|
|
11
|
+
const takeFrom = window.GSSortableConfigue.takeFrom;
|
|
12
|
+
// Clear global immediately so new drags are not blocked
|
|
13
|
+
window.GSSortableConfigue.draggableInfo = undefined;
|
|
14
|
+
if (moved) {
|
|
15
|
+
let containerDifX = 0;
|
|
16
|
+
let containerDifY = 0;
|
|
17
|
+
if (ref.currentParams.reference !== takeFrom.currentParams.reference) {
|
|
18
|
+
const fromCoord = getOffsetFromBody(takeFrom.grid);
|
|
19
|
+
const toCoord = getOffsetFromBody(ref.grid);
|
|
20
|
+
containerDifY = toCoord.top - fromCoord.top;
|
|
21
|
+
containerDifX = toCoord.left - fromCoord.left;
|
|
64
22
|
}
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
window.GSSortableConfigue.draggableInfo = undefined;
|
|
23
|
+
ref.isAdjusting = true;
|
|
24
|
+
$el.classList.remove('gs-sortable-item-inmove');
|
|
25
|
+
ref.grid.classList.remove('gs-sortable-active');
|
|
26
|
+
const activeParent = ref.grid.closest('.gs-sortable-item-active-parent');
|
|
27
|
+
if (activeParent) {
|
|
28
|
+
activeParent.classList.remove('gs-sortable-item-active-parent');
|
|
72
29
|
}
|
|
30
|
+
$el.classList.add('gs-sortable-item-adjusting');
|
|
31
|
+
$el.style.top = `${newTop + containerDifY}px`;
|
|
32
|
+
$el.style.left = `${newLeft + containerDifX}px`;
|
|
33
|
+
$el.style.removeProperty('transform');
|
|
34
|
+
setTimeout(() => {
|
|
35
|
+
$el.classList.remove('gs-sortable-item-adjusting');
|
|
36
|
+
if (ref.currentParams.reference === takeFrom.currentParams.reference &&
|
|
37
|
+
takeFrom.currentParams.takeClone) {
|
|
38
|
+
$el.remove();
|
|
39
|
+
}
|
|
40
|
+
else {
|
|
41
|
+
if (index !== undefined) {
|
|
42
|
+
moveChildToIndex(ref.grid, $el, index);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
placeholder?.remove();
|
|
46
|
+
if (ref.currentParams.reference !== takeFrom.currentParams.reference) {
|
|
47
|
+
takeFrom.currentParams.afterSort?.(takeFrom.grid.querySelectorAll('.gs-sortable-item'));
|
|
48
|
+
ref.currentParams.afterSort?.(ref.grid.querySelectorAll('.gs-sortable-item'));
|
|
49
|
+
takeFrom.refresh();
|
|
50
|
+
ref.refresh();
|
|
51
|
+
}
|
|
52
|
+
else {
|
|
53
|
+
calculate(ref);
|
|
54
|
+
ref.currentParams.afterSort?.(ref.grid.querySelectorAll('.gs-sortable-item'));
|
|
55
|
+
}
|
|
56
|
+
ref.isAdjusting = false;
|
|
57
|
+
}, constParams.animationSpeed);
|
|
58
|
+
}
|
|
59
|
+
else {
|
|
60
|
+
$el.style.top = `${newTop}px`;
|
|
61
|
+
$el.style.left = `${newLeft}px`;
|
|
62
|
+
$el.style.removeProperty('transform');
|
|
63
|
+
placeholder?.remove();
|
|
73
64
|
}
|
|
74
65
|
};
|
|
75
|
-
|
|
66
|
+
export default initSortEnd;
|
|
76
67
|
//# sourceMappingURL=initSortEnd.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"initSortEnd.js","sourceRoot":"","sources":["../../
|
|
1
|
+
{"version":3,"file":"initSortEnd.js","sourceRoot":"","sources":["../../actions/initSortEnd.ts"],"names":[],"mappings":"AAAA,OAAO,WAAW,MAAM,0BA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,CAAC,mBAAmB,CAAC,CAC/C,CAAC;gBACF,QAAQ,CAAC,OAAO,EAAE,CAAC;gBACnB,GAAG,CAAC,OAAO,EAAE,CAAC;YAChB,CAAC;iBAAM,CAAC;gBACN,SAAS,CAAC,GAAG,CAAC,CAAC;gBACf,GAAG,CAAC,aAAa,CAAC,SAAS,EAAE,CAC3B,GAAG,CAAC,IAAI,CAAC,gBAAgB,CAAC,mBAAmB,CAAC,CAC/C,CAAC;YACJ,CAAC;YAED,GAAG,CAAC,WAAW,GAAG,KAAK,CAAC;QAC1B,CAAC,EAAE,WAAW,CAAC,cAAc,CAAC,CAAC;IACjC,CAAC;SAAM,CAAC;QACN,GAAG,CAAC,KAAK,CAAC,GAAG,GAAG,GAAG,MAAM,IAAI,CAAC;QAC9B,GAAG,CAAC,KAAK,CAAC,IAAI,GAAG,GAAG,OAAO,IAAI,CAAC;QAChC,GAAG,CAAC,KAAK,CAAC,cAAc,CAAC,WAAW,CAAC,CAAC;QACtC,WAAW,EAAE,MAAM,EAAE,CAAC;IACxB,CAAC;AACH,CAAC,CAAC;AAEF,eAAe,WAAW,CAAC"}
|
|
@@ -1,23 +1,8 @@
|
|
|
1
|
-
import React, { ReactNode
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
export interface GSSortableProps {
|
|
5
|
-
reference?: string;
|
|
6
|
-
handler?: string;
|
|
7
|
-
className?: string;
|
|
8
|
-
width?: string;
|
|
9
|
-
takeClone?: boolean;
|
|
10
|
-
afterSort?: () => void;
|
|
11
|
-
gsx?: CSSProperties;
|
|
12
|
-
gap?: string;
|
|
13
|
-
allowOutOfBox?: boolean;
|
|
14
|
-
count?: number;
|
|
15
|
-
type?: 'row' | 'column' | 'grid';
|
|
16
|
-
acceptFrom?: Array<GSSortableRef>;
|
|
17
|
-
responsive?: ResponsiveOption[];
|
|
1
|
+
import React, { ReactNode } from 'react';
|
|
2
|
+
import { Params } from '../types/params';
|
|
3
|
+
export interface GSSortableProps extends Params {
|
|
18
4
|
children?: ReactNode;
|
|
19
|
-
beforeInit?: () => void;
|
|
20
|
-
afterInit?: () => void;
|
|
21
5
|
}
|
|
22
6
|
declare const GSSortable: React.FC<GSSortableProps>;
|
|
23
7
|
export default GSSortable;
|
|
8
|
+
//# sourceMappingURL=GSSortable.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GSSortable.d.ts","sourceRoot":"","sources":["../../components/GSSortable.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAA+B,SAAS,EAAiB,MAAM,OAAO,CAAC;AAgBrF,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAGzC,MAAM,WAAW,eAAgB,SAAQ,MAAM;IAC7C,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED,QAAA,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CAoIzC,CAAC;AAIF,eAAe,UAAU,CAAC"}
|
|
@@ -1,144 +1,111 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
26
|
-
var t = {};
|
|
27
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
28
|
-
t[p] = s[p];
|
|
29
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
30
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
31
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
32
|
-
t[p[i]] = s[p[i]];
|
|
33
|
-
}
|
|
34
|
-
return t;
|
|
35
|
-
};
|
|
36
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
37
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
38
|
-
};
|
|
39
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
40
|
-
const react_1 = __importStar(require("react"));
|
|
41
|
-
const getCurrentParams_1 = __importDefault(require("../actions/getCurrentParams"));
|
|
42
|
-
const init_1 = __importDefault(require("../actions/init"));
|
|
43
|
-
const destroy_1 = __importDefault(require("../actions/destroy"));
|
|
44
|
-
const defaultParams_1 = __importDefault(require("../constants/defaultParams"));
|
|
45
|
-
const initMouseMove_1 = __importDefault(require("../actions/initMouseMove"));
|
|
46
|
-
const initSortEnd_1 = __importDefault(require("../actions/initSortEnd"));
|
|
47
|
-
const initScroll_1 = __importDefault(require("../actions/initScroll"));
|
|
48
|
-
const uihelpers_1 = require("../helpers/uihelpers");
|
|
49
|
-
const GSSortableCSS_1 = __importDefault(require("./styles/GSSortableCSS"));
|
|
50
|
-
const GSSortable = (_a) => {
|
|
51
|
-
var { children } = _a, rest = __rest(_a, ["children"]);
|
|
52
|
-
const params = Object.assign({}, rest);
|
|
53
|
-
const [componentKey, setComponentKey] = (0, react_1.useState)(null);
|
|
54
|
-
const gridRef = (0, react_1.useRef)(null);
|
|
55
|
-
(0, react_1.useEffect)(() => {
|
|
56
|
-
const styleId = 'gs-sortable-styles';
|
|
57
|
-
if (!document.getElementById(styleId)) {
|
|
58
|
-
const style = document.createElement('style');
|
|
59
|
-
style.id = styleId;
|
|
60
|
-
style.textContent = GSSortableCSS_1.default;
|
|
61
|
-
document.head.appendChild(style);
|
|
62
|
-
}
|
|
63
|
-
}, []);
|
|
64
|
-
(0, react_1.useEffect)(() => {
|
|
65
|
-
var _a;
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useRef, useState } from 'react';
|
|
3
|
+
import getCurrentParams from '../actions/getCurrentParams';
|
|
4
|
+
import init from '../actions/init';
|
|
5
|
+
import destroy from '../actions/destroy';
|
|
6
|
+
import afterAllImagesLoad from '../actions/afterAllImagesLoad';
|
|
7
|
+
import defaultParams from '../constants/defaultParams';
|
|
8
|
+
import initMouseMove from '../actions/initMouseMove';
|
|
9
|
+
import initSortEnd from '../actions/initSortEnd';
|
|
10
|
+
import initScroll from '../actions/initScroll';
|
|
11
|
+
import { NewGuid, convertScssToCss, injectCssToHead, removeCssFromHead, } from '../helpers/uihelpers';
|
|
12
|
+
import cssContent from './styles/GSSortableCSS';
|
|
13
|
+
const GSSortable = ({ children, ...rest }) => {
|
|
14
|
+
const params = { ...rest };
|
|
15
|
+
const [componentKey, setComponentKey] = useState(null);
|
|
16
|
+
const gridRef = useRef(null);
|
|
17
|
+
const initializedRef = useRef(false);
|
|
18
|
+
useEffect(() => {
|
|
66
19
|
if (componentKey != null) {
|
|
20
|
+
// Inject CSS once — no external import needed by the consumer
|
|
21
|
+
const styleId = 'gs-sortable-styles';
|
|
22
|
+
if (!document.getElementById(styleId)) {
|
|
23
|
+
const style = document.createElement('style');
|
|
24
|
+
style.id = styleId;
|
|
25
|
+
style.textContent = cssContent;
|
|
26
|
+
document.head.appendChild(style);
|
|
27
|
+
}
|
|
28
|
+
// Initialise global registry and window event listeners once
|
|
67
29
|
if (typeof window.GSSortableConfigue === 'undefined') {
|
|
68
30
|
window.GSSortableConfigue = {
|
|
69
31
|
references: [],
|
|
70
32
|
instance: (ref) => {
|
|
71
|
-
var _a;
|
|
72
33
|
if (ref) {
|
|
73
|
-
const instance =
|
|
74
|
-
if (instance)
|
|
34
|
+
const instance = window.GSSortableConfigue?.references.find((x) => x.key === ref);
|
|
35
|
+
if (instance)
|
|
75
36
|
return instance.ref;
|
|
76
|
-
}
|
|
77
37
|
}
|
|
78
38
|
},
|
|
79
39
|
};
|
|
80
|
-
window.addEventListener('mousemove', e =>
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
window.addEventListener('mouseup', e => {
|
|
84
|
-
(0, initSortEnd_1.default)(e);
|
|
85
|
-
});
|
|
86
|
-
window.addEventListener('scroll', () => {
|
|
87
|
-
(0, initScroll_1.default)();
|
|
88
|
-
});
|
|
40
|
+
window.addEventListener('mousemove', (e) => initMouseMove(e));
|
|
41
|
+
window.addEventListener('mouseup', (e) => initSortEnd(e));
|
|
42
|
+
window.addEventListener('scroll', () => initScroll());
|
|
89
43
|
}
|
|
90
|
-
if (window.GSSortableConfigue.references.find(x => x.key === componentKey) === undefined) {
|
|
91
|
-
const currentParams = (
|
|
44
|
+
if (window.GSSortableConfigue.references.find((x) => x.key === componentKey) === undefined) {
|
|
45
|
+
const currentParams = getCurrentParams({
|
|
46
|
+
...params,
|
|
47
|
+
reference: componentKey,
|
|
48
|
+
});
|
|
92
49
|
window.GSSortableConfigue.references.push({
|
|
93
50
|
key: componentKey,
|
|
94
51
|
ref: {
|
|
95
|
-
|
|
52
|
+
isAdjusting: false,
|
|
96
53
|
grid: gridRef.current,
|
|
97
|
-
currentParams:
|
|
54
|
+
currentParams: { ...currentParams, reference: componentKey },
|
|
55
|
+
itemResizeObservers: [],
|
|
98
56
|
destroy: () => {
|
|
99
|
-
|
|
100
|
-
(0, destroy_1.default)((_a = window.GSSortableConfigue) === null || _a === void 0 ? void 0 : _a.instance(componentKey));
|
|
57
|
+
destroy(window.GSSortableConfigue?.instance(componentKey));
|
|
101
58
|
},
|
|
102
59
|
refresh: () => {
|
|
103
|
-
|
|
104
|
-
(
|
|
105
|
-
(
|
|
60
|
+
const ref = window.GSSortableConfigue?.instance(componentKey);
|
|
61
|
+
destroy(ref);
|
|
62
|
+
init(ref);
|
|
106
63
|
},
|
|
107
64
|
},
|
|
108
65
|
});
|
|
109
|
-
const currentRef =
|
|
110
|
-
if (params.gsx) {
|
|
66
|
+
const currentRef = window.GSSortableConfigue.references.find((x) => x.key === componentKey)?.ref;
|
|
67
|
+
if (params.gsx && currentRef) {
|
|
111
68
|
const scss = {};
|
|
112
|
-
scss[`[data-key='${componentKey}']`] =
|
|
113
|
-
const style =
|
|
114
|
-
|
|
69
|
+
scss[`[data-key='${componentKey}']`] = { ...params.gsx };
|
|
70
|
+
const style = convertScssToCss(scss);
|
|
71
|
+
injectCssToHead(style, componentKey);
|
|
115
72
|
}
|
|
116
73
|
if (currentRef) {
|
|
117
|
-
(
|
|
74
|
+
init(currentRef);
|
|
75
|
+
afterAllImagesLoad(currentRef);
|
|
76
|
+
initializedRef.current = true;
|
|
118
77
|
}
|
|
119
78
|
}
|
|
120
79
|
return () => {
|
|
80
|
+
const ref = window.GSSortableConfigue?.instance(componentKey);
|
|
81
|
+
if (ref) {
|
|
82
|
+
ref.itemResizeObservers?.forEach((obs) => obs.disconnect());
|
|
83
|
+
ref.itemResizeObservers = [];
|
|
84
|
+
}
|
|
121
85
|
if (window.GSSortableConfigue) {
|
|
122
86
|
window.GSSortableConfigue.references =
|
|
123
|
-
window.GSSortableConfigue.references.filter(x => x.key !== componentKey);
|
|
87
|
+
window.GSSortableConfigue.references.filter((x) => x.key !== componentKey);
|
|
124
88
|
}
|
|
125
|
-
(
|
|
89
|
+
removeCssFromHead(componentKey);
|
|
126
90
|
};
|
|
127
91
|
}
|
|
128
92
|
}, [componentKey]);
|
|
129
|
-
(
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
var _a;
|
|
134
|
-
if (componentKey != null) {
|
|
135
|
-
const ref = (_a = window.GSSortableConfigue) === null || _a === void 0 ? void 0 : _a.instance(componentKey);
|
|
93
|
+
// Re-init when children change (items added/removed) — but only after first init
|
|
94
|
+
useEffect(() => {
|
|
95
|
+
if (componentKey != null && initializedRef.current) {
|
|
96
|
+
const ref = window.GSSortableConfigue?.instance(componentKey);
|
|
136
97
|
if (ref) {
|
|
137
|
-
ref
|
|
98
|
+
destroy(ref);
|
|
99
|
+
init(ref);
|
|
100
|
+
afterAllImagesLoad(ref);
|
|
138
101
|
}
|
|
139
102
|
}
|
|
140
103
|
}, [children]);
|
|
141
|
-
|
|
104
|
+
useEffect(() => {
|
|
105
|
+
setComponentKey(params.reference || NewGuid());
|
|
106
|
+
}, []);
|
|
107
|
+
return (_jsx(_Fragment, { children: componentKey != null ? (_jsx("div", { className: `gs-sortable-instance gs-sortable-${params.type ?? 'column'} ${rest.className || ''}`, ref: gridRef, "data-key": componentKey, ...Object.fromEntries(Object.entries(rest).filter(([key]) => !(key in defaultParams))), children: children })) : null }));
|
|
142
108
|
};
|
|
143
|
-
|
|
109
|
+
GSSortable.displayName = 'GSSortable';
|
|
110
|
+
export default GSSortable;
|
|
144
111
|
//# sourceMappingURL=GSSortable.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GSSortable.js","sourceRoot":"","sources":["../../
|
|
1
|
+
{"version":3,"file":"GSSortable.js","sourceRoot":"","sources":["../../components/GSSortable.tsx"],"names":[],"mappings":";AAAA,OAAc,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAA4B,MAAM,OAAO,CAAC;AACrF,OAAO,gBAAgB,MAAM,6BAA6B,CAAC;AAC3D,OAAO,IAAI,MAAM,iBAAiB,CAAC;AACnC,OAAO,OAAO,MAAM,oBAAoB,CAAC;AACzC,OAAO,kBAAkB,MAAM,+BAA+B,CAAC;AAC/D,OAAO,aAAa,MAAM,4BAA4B,CAAC;AACvD,OAAO,aAAa,MAAM,0BAA0B,CAAC;AACrD,OAAO,WAAW,MAAM,wBAAwB,CAAC;AACjD,OAAO,UAAU,MAAM,uBAAuB,CAAC;AAC/C,OAAO,EACL,OAAO,EACP,gBAAgB,EAChB,eAAe,EACf,iBAAiB,GAClB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,UAAU,MAAM,wBAAwB,C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CAAC;IAEnB,iFAAiF;IACjF,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,YAAY,IAAI,IAAI,IAAI,cAAc,CAAC,OAAO,EAAE,CAAC;YACnD,MAAM,GAAG,GAAG,MAAM,CAAC,kBAAkB,EAAE,QAAQ,CAAC,YAAY,CAAC,CAAC;YAC9D,IAAI,GAAG,EAAE,CAAC;gBACR,OAAO,CAAC,GAAG,CAAC,CAAC;gBACb,IAAI,CAAC,GAAG,CAAC,CAAC;gBACV,kBAAkB,CAAC,GAAG,CAAC,CAAC;YAC1B,CAAC;QACH,CAAC;IACH,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC;IAEf,SAAS,CAAC,GAAG,EAAE;QACb,eAAe,CAAC,MAAM,CAAC,SAAS,IAAI,OAAO,EAAE,CAAC,CAAC;IACjD,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,OAAO,CACL,4BACG,YAAY,IAAI,IAAI,CAAC,CAAC,CAAC,CACtB,cACE,SAAS,EAAE,oCAAoC,MAAM,CAAC,IAAI,IAAI,QAAQ,IACpE,IAAI,CAAC,SAAS,IAAI,EACpB,EAAE,EACF,GAAG,EAAE,OAAO,cACF,YAAY,KAClB,MAAM,CAAC,WAAW,CACpB,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,GAAG,IAAI,aAAa,CAAC,CAAC,CAChE,YAEA,QAAQ,GACL,CACP,CAAC,CAAC,CAAC,IAAI,GACP,CACJ,CAAC;AACJ,CAAC,CAAC;AAEF,UAAU,CAAC,WAAW,GAAG,YAAY,CAAC;AAEtC,eAAe,UAAU,CAAC"}
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
declare const _default: "\n.gs-sortable-instance {\n box-sizing: border-box;\n -webkit-user-select: none !important;\n -moz-user-select: none !important;\n user-select: none !important;\n transition: 0.4s;\n z-index: 1;\n}\n.gs-sortable-instance.gs-sortable-active {\n z-index: 2;\n}\n.gs-sortable-instance * {\n -webkit-user-select: none !important;\n -moz-user-select: none !important;\n user-select: none !important;\n}\n.gs-sortable-instance .gs-sortable-placeholder {\n position: absolute;\n background-color: #f1f1f1;\n border: 1px solid;\n z-index: 1;\n}\n.gs-sortable-instance .gs-sortable-item {\n z-index: 2;\n}\n.gs-sortable-instance .gs-sortable-item.gs-sortable-item-active-parent {\n z-index: 3;\n}\n.gs-sortable-instance .gs-sortable-item-inmove {\n transition: none !important;\n z-index: 99999;\n}\n.gs-sortable-instance .gs-sortable-item-addjusting {\n z-index: 99999;\n}\n.gs-sortable-instance.gs-sortable-row .gs-sortable-item {\n width: -moz-max-content;\n width: max-content;\n}";
|
|
1
|
+
declare const _default: "\n.gs-sortable-instance {\n box-sizing: border-box;\n -webkit-user-select: none !important;\n -moz-user-select: none !important;\n user-select: none !important;\n transition: 0.4s;\n z-index: 1;\n}\n.gs-sortable-instance.gs-sortable-active {\n z-index: 2;\n}\n.gs-sortable-instance * {\n -webkit-user-select: none !important;\n -moz-user-select: none !important;\n user-select: none !important;\n}\n.gs-sortable-instance .gs-sortable-placeholder {\n position: absolute;\n background-color: #f1f1f1;\n border: 1px solid;\n z-index: 1;\n}\n.gs-sortable-instance .gs-sortable-item {\n z-index: 2;\n}\n.gs-sortable-instance .gs-sortable-item.gs-sortable-item-active-parent {\n z-index: 3;\n}\n.gs-sortable-instance .gs-sortable-item-inmove {\n transition: none !important;\n z-index: 99999;\n}\n.gs-sortable-instance .gs-sortable-item-addjusting {\n z-index: 99999;\n}\n.gs-sortable-instance.gs-sortable-row .gs-sortable-item {\n width: -moz-max-content;\n width: max-content;\n}/*# sourceMappingURL=GSSortable.css.map */\n";
|
|
2
2
|
export default _default;
|
|
3
|
+
//# sourceMappingURL=GSSortableCSS.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GSSortableCSS.d.ts","sourceRoot":"","sources":["../../../components/styles/GSSortableCSS.ts"],"names":[],"mappings":";AAAA,wBAwCE"}
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.default = `
|
|
1
|
+
export default `
|
|
4
2
|
.gs-sortable-instance {
|
|
5
3
|
box-sizing: border-box;
|
|
6
4
|
-webkit-user-select: none !important;
|
|
@@ -39,5 +37,6 @@ exports.default = `
|
|
|
39
37
|
.gs-sortable-instance.gs-sortable-row .gs-sortable-item {
|
|
40
38
|
width: -moz-max-content;
|
|
41
39
|
width: max-content;
|
|
42
|
-
}
|
|
40
|
+
}/*# sourceMappingURL=GSSortable.css.map */
|
|
41
|
+
`;
|
|
43
42
|
//# sourceMappingURL=GSSortableCSS.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GSSortableCSS.js","sourceRoot":"","sources":["../../../
|
|
1
|
+
{"version":3,"file":"GSSortableCSS.js","sourceRoot":"","sources":["../../../components/styles/GSSortableCSS.ts"],"names":[],"mappings":"AAAA,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwCd,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constParams.d.ts","sourceRoot":"","sources":["../../constants/constParams.ts"],"names":[],"mappings":";;;AAIA,wBAA0C"}
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
1
|
const constParams = {
|
|
4
|
-
animationSpeed: 400,
|
|
2
|
+
animationSpeed: 400,
|
|
5
3
|
};
|
|
6
|
-
|
|
4
|
+
export default Object.freeze(constParams);
|
|
7
5
|
//# sourceMappingURL=constParams.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constParams.js","sourceRoot":"","sources":["../../
|
|
1
|
+
{"version":3,"file":"constParams.js","sourceRoot":"","sources":["../../constants/constParams.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,GAAG;IAClB,cAAc,EAAE,GAAG;CACX,CAAC;AAEX,eAAe,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
declare const _default: Readonly<
|
|
1
|
+
import { Params } from '../types/params';
|
|
2
|
+
declare const _default: Readonly<Params>;
|
|
3
3
|
export default _default;
|
|
4
|
+
//# sourceMappingURL=defaultParams.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"defaultParams.d.ts","sourceRoot":"","sources":["../../constants/defaultParams.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;;AAkBzC,wBAA4C"}
|
|
@@ -1,9 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const types_1 = __importDefault(require("./types"));
|
|
1
|
+
import types from './types';
|
|
7
2
|
const defaultParams = {
|
|
8
3
|
acceptFrom: [],
|
|
9
4
|
className: '',
|
|
@@ -14,10 +9,10 @@ const defaultParams = {
|
|
|
14
9
|
gsx: undefined,
|
|
15
10
|
handler: '',
|
|
16
11
|
width: 'auto',
|
|
17
|
-
type:
|
|
12
|
+
type: types.column,
|
|
18
13
|
allowOutOfBox: true,
|
|
19
14
|
responsive: [],
|
|
20
15
|
afterSort: () => { },
|
|
21
16
|
};
|
|
22
|
-
|
|
17
|
+
export default Object.freeze(defaultParams);
|
|
23
18
|
//# sourceMappingURL=defaultParams.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"defaultParams.js","sourceRoot":"","sources":["../../
|
|
1
|
+
{"version":3,"file":"defaultParams.js","sourceRoot":"","sources":["../../constants/defaultParams.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,SAAS,CAAC;AAG5B,MAAM,aAAa,GAAW;IAC5B,UAAU,EAAE,EAAE;IACd,SAAS,EAAE,EAAE;IACb,SAAS,EAAE,KAAK;IAChB,SAAS,EAAE,EAAE;IACb,KAAK,EAAE,CAAC;IACR,GAAG,EAAE,EAAE;IACP,GAAG,EAAE,SAAS;IACd,OAAO,EAAE,EAAE;IACX,KAAK,EAAE,MAAM;IACb,IAAI,EAAE,KAAK,CAAC,MAAM;IAClB,aAAa,EAAE,IAAI;IACnB,UAAU,EAAE,EAAE;IACd,SAAS,EAAE,GAAG,EAAE,GAAE,CAAC;CACpB,CAAC;AAEF,eAAe,MAAM,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../constants/types.ts"],"names":[],"mappings":";;;;;AAMA,wBAAoC"}
|
package/dist/constants/types.js
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
1
|
const types = {
|
|
4
2
|
row: 'row',
|
|
5
3
|
column: 'column',
|
|
6
4
|
grid: 'grid',
|
|
7
5
|
};
|
|
8
|
-
|
|
6
|
+
export default Object.freeze(types);
|
|
9
7
|
//# sourceMappingURL=types.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../constants/types.ts"],"names":[],"mappings":"AAAA,MAAM,KAAK,GAAG;IACZ,GAAG,EAAE,KAAc;IACnB,MAAM,EAAE,QAAiB;IACzB,IAAI,EAAE,MAAe;CACtB,CAAC;AAEF,eAAe,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export declare const NewGuid: () => string;
|
|
2
|
-
export declare const
|
|
2
|
+
export declare const removeCssFromHead: (key: string) => void;
|
|
3
3
|
export declare const injectCssToHead: (css: string, key: string) => void;
|
|
4
4
|
export declare const convertScssToCss: (scssObj: Record<string, any>) => string;
|
|
5
|
+
//# sourceMappingURL=uihelpers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"uihelpers.d.ts","sourceRoot":"","sources":["../../helpers/uihelpers.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO,QAAO,MAM1B,CAAC;AAEF,eAAO,MAAM,iBAAiB,GAAI,KAAK,MAAM,KAAG,IAK/C,CAAC;AAEF,eAAO,MAAM,eAAe,GAAI,KAAK,MAAM,EAAE,KAAK,MAAM,KAAG,IAK1D,CAAC;AAKF,eAAO,MAAM,gBAAgB,GAAI,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,KAAG,MAkB/D,CAAC"}
|