@solidstarters/solid-core-ui 1.1.84 → 1.1.85
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/components/common/useHandleCustomButtonClick.d.ts +2 -0
- package/dist/components/common/useHandleCustomButtonClick.d.ts.map +1 -0
- package/dist/components/common/useHandleCustomButtonClick.js +34 -0
- package/dist/components/common/useHandleCustomButtonClick.js.map +1 -0
- package/dist/resources/globals.css +2 -0
- package/package.json +1 -1
- package/src/resources/globals.css +2 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useHandleCustomButtonClick.d.ts","sourceRoot":"","sources":["../../../src/components/common/useHandleCustomButtonClick.ts"],"names":[],"mappings":"AAeA,eAAO,MAAM,0BAA0B,sBAGd,GAAG,SAAS,GAAG,SAkBvC,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
import { useDispatch } from "react-redux";
|
|
13
|
+
import { getExtensionFunction } from "../../helpers/registry";
|
|
14
|
+
import { openPopup } from "../../redux/features/popupSlice";
|
|
15
|
+
export var useHandleCustomButtonClick = function () {
|
|
16
|
+
var dispatch = useDispatch();
|
|
17
|
+
return function (buttonAttrs, event) {
|
|
18
|
+
var action = buttonAttrs.action, openInPopup = buttonAttrs.openInPopup;
|
|
19
|
+
if (openInPopup === true) {
|
|
20
|
+
var eventData = __assign(__assign({}, event), { action: action });
|
|
21
|
+
dispatch(openPopup(eventData));
|
|
22
|
+
}
|
|
23
|
+
else {
|
|
24
|
+
var eventData = __assign(__assign({}, event), { action: action });
|
|
25
|
+
var dynamicFunction = getExtensionFunction(action);
|
|
26
|
+
if (!dynamicFunction) {
|
|
27
|
+
console.error("Action function \"".concat(action, "\" not found."));
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
dynamicFunction(eventData);
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
//# sourceMappingURL=useHandleCustomButtonClick.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useHandleCustomButtonClick.js","sourceRoot":"","sources":["../../../src/components/common/useHandleCustomButtonClick.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAyB,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AACjF,OAAO,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAC;AAaxD,MAAM,CAAC,IAAM,0BAA0B,GAAG;IACtC,IAAM,QAAQ,GAAG,WAAW,EAAE,CAAC;IAE/B,OAAO,UAAC,WAAgB,EAAE,KAAU;QACxB,IAAA,MAAM,GAAoC,WAAW,OAA/C,EAAE,WAAW,GAAuB,WAAW,YAAlC,CAAmC;QAE9D,IAAI,WAAW,KAAK,IAAI,EAAE;YACtB,IAAM,SAAS,yBAAQ,KAAK,KAAE,MAAM,EAAE,MAAM,GAAE,CAAC;YAC/C,QAAQ,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC,CAAC;SAElC;aAAM;YACH,IAAM,SAAS,yBAAQ,KAAK,KAAE,MAAM,EAAE,MAAM,GAAE,CAAC;YAC/C,IAAM,eAAe,GAAG,oBAAoB,CAAC,MAAM,CAAC,CAAC;YACrD,IAAI,CAAC,eAAe,EAAE;gBAClB,OAAO,CAAC,KAAK,CAAC,4BAAoB,MAAM,kBAAc,CAAC,CAAC;gBACxD,OAAO;aACV;YACD,eAAe,CAAC,SAAS,CAAC,CAAC;SAC9B;IAEL,CAAC,CAAC;AACN,CAAC,CAAC"}
|
package/package.json
CHANGED