@acoustte-digital-services/digitalstore-controls-dev 0.8.1-dev.20260416042420 → 0.8.1-dev.20260416043825
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/index.d.mts +13 -1
- package/dist/index.d.ts +13 -1
- package/dist/index.js +87 -0
- package/dist/index.mjs +81 -0
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
3
|
|
|
3
4
|
interface ViewControlProps {
|
|
4
5
|
value?: any;
|
|
@@ -215,4 +216,15 @@ interface PageBodyRendererProps {
|
|
|
215
216
|
}
|
|
216
217
|
declare const PageBodyRenderer: React.FC<PageBodyRendererProps>;
|
|
217
218
|
|
|
218
|
-
|
|
219
|
+
declare const Toast: () => react_jsx_runtime.JSX.Element;
|
|
220
|
+
|
|
221
|
+
declare class ToastService {
|
|
222
|
+
private static showToast;
|
|
223
|
+
private static closeToast;
|
|
224
|
+
static initialize(showToast: (message: string, messageType: string) => void, closeToast: () => void): void;
|
|
225
|
+
static showError(message: string): void;
|
|
226
|
+
static showInfo(message: string): void;
|
|
227
|
+
static close(): void;
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
export { type ActionResponse, DataList, InputControl, type InputControlProps, InputControlType, PageBodyRenderer, Toast, ToastService, ViewControl, type ViewControlProps, ViewControlTypes };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
3
|
|
|
3
4
|
interface ViewControlProps {
|
|
4
5
|
value?: any;
|
|
@@ -215,4 +216,15 @@ interface PageBodyRendererProps {
|
|
|
215
216
|
}
|
|
216
217
|
declare const PageBodyRenderer: React.FC<PageBodyRendererProps>;
|
|
217
218
|
|
|
218
|
-
|
|
219
|
+
declare const Toast: () => react_jsx_runtime.JSX.Element;
|
|
220
|
+
|
|
221
|
+
declare class ToastService {
|
|
222
|
+
private static showToast;
|
|
223
|
+
private static closeToast;
|
|
224
|
+
static initialize(showToast: (message: string, messageType: string) => void, closeToast: () => void): void;
|
|
225
|
+
static showError(message: string): void;
|
|
226
|
+
static showInfo(message: string): void;
|
|
227
|
+
static close(): void;
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
export { type ActionResponse, DataList, InputControl, type InputControlProps, InputControlType, PageBodyRenderer, Toast, ToastService, ViewControl, type ViewControlProps, ViewControlTypes };
|
package/dist/index.js
CHANGED
|
@@ -35,6 +35,7 @@ var ToastService, ToastService_default;
|
|
|
35
35
|
var init_ToastService = __esm({
|
|
36
36
|
"src/components/ToastService.tsx"() {
|
|
37
37
|
"use strict";
|
|
38
|
+
"use client";
|
|
38
39
|
ToastService = class _ToastService {
|
|
39
40
|
static initialize(showToast, closeToast) {
|
|
40
41
|
_ToastService.showToast = showToast;
|
|
@@ -966,6 +967,8 @@ __export(index_exports, {
|
|
|
966
967
|
InputControl: () => InputControl_default,
|
|
967
968
|
InputControlType: () => InputControlType_default,
|
|
968
969
|
PageBodyRenderer: () => PageBodyRenderer_default,
|
|
970
|
+
Toast: () => Toast_default,
|
|
971
|
+
ToastService: () => ToastService_default,
|
|
969
972
|
ViewControl: () => ViewControl_default,
|
|
970
973
|
ViewControlTypes: () => ViewControlTypes_default
|
|
971
974
|
});
|
|
@@ -5625,12 +5628,96 @@ var PageBodyRenderer = (props) => {
|
|
|
5625
5628
|
}) });
|
|
5626
5629
|
};
|
|
5627
5630
|
var PageBodyRenderer_default = PageBodyRenderer;
|
|
5631
|
+
|
|
5632
|
+
// src/components/Toast.tsx
|
|
5633
|
+
var import_react52 = require("react");
|
|
5634
|
+
init_ToastService();
|
|
5635
|
+
var import_jsx_runtime70 = require("react/jsx-runtime");
|
|
5636
|
+
var Toast = () => {
|
|
5637
|
+
const [showToast, setShowToast] = (0, import_react52.useState)(false);
|
|
5638
|
+
const [message, setMessage] = (0, import_react52.useState)("");
|
|
5639
|
+
const [messageType, setMessageType] = (0, import_react52.useState)("error");
|
|
5640
|
+
ToastService_default.showError = function(message2) {
|
|
5641
|
+
setShowToast(true);
|
|
5642
|
+
setMessage(message2);
|
|
5643
|
+
setMessageType("error");
|
|
5644
|
+
};
|
|
5645
|
+
ToastService_default.showInfo = function(message2) {
|
|
5646
|
+
setShowToast(true);
|
|
5647
|
+
setMessage(message2);
|
|
5648
|
+
setMessageType("info");
|
|
5649
|
+
setTimeout(() => {
|
|
5650
|
+
setShowToast(false);
|
|
5651
|
+
}, 4e3);
|
|
5652
|
+
};
|
|
5653
|
+
ToastService_default.close = function() {
|
|
5654
|
+
setShowToast(false);
|
|
5655
|
+
};
|
|
5656
|
+
const closeToast = () => {
|
|
5657
|
+
setShowToast(false);
|
|
5658
|
+
};
|
|
5659
|
+
return /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(import_jsx_runtime70.Fragment, { children: showToast && /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
|
|
5660
|
+
"div",
|
|
5661
|
+
{
|
|
5662
|
+
className: "fixed top-2 flex justify-center w-1/2 left-1/2 -translate-x-1/2",
|
|
5663
|
+
style: { zIndex: 1e3 },
|
|
5664
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime70.jsxs)(
|
|
5665
|
+
"div",
|
|
5666
|
+
{
|
|
5667
|
+
className: `w-full items-center flex justify-between p-3 rounded-md relative ${messageType == "error" ? "bg-error" : "bg-success-soft"}`,
|
|
5668
|
+
children: [
|
|
5669
|
+
/* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
|
|
5670
|
+
"span",
|
|
5671
|
+
{
|
|
5672
|
+
className: "font-medium text-inherit text-sm",
|
|
5673
|
+
style: { whiteSpace: "pre-line" },
|
|
5674
|
+
children: message
|
|
5675
|
+
}
|
|
5676
|
+
),
|
|
5677
|
+
/* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
|
|
5678
|
+
"button",
|
|
5679
|
+
{
|
|
5680
|
+
className: "absolute right-2 top-2 ml-2 focus:outline-none",
|
|
5681
|
+
onClick: closeToast,
|
|
5682
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
|
|
5683
|
+
"svg",
|
|
5684
|
+
{
|
|
5685
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
5686
|
+
className: "h-4 w-4",
|
|
5687
|
+
fill: "none",
|
|
5688
|
+
viewBox: "0 0 24 24",
|
|
5689
|
+
stroke: "currentColor",
|
|
5690
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
|
|
5691
|
+
"path",
|
|
5692
|
+
{
|
|
5693
|
+
strokeLinecap: "round",
|
|
5694
|
+
strokeLinejoin: "round",
|
|
5695
|
+
strokeWidth: "2",
|
|
5696
|
+
d: "M6 18L18 6M6 6l12 12"
|
|
5697
|
+
}
|
|
5698
|
+
)
|
|
5699
|
+
}
|
|
5700
|
+
)
|
|
5701
|
+
}
|
|
5702
|
+
)
|
|
5703
|
+
]
|
|
5704
|
+
}
|
|
5705
|
+
)
|
|
5706
|
+
}
|
|
5707
|
+
) });
|
|
5708
|
+
};
|
|
5709
|
+
var Toast_default = Toast;
|
|
5710
|
+
|
|
5711
|
+
// src/index.ts
|
|
5712
|
+
init_ToastService();
|
|
5628
5713
|
// Annotate the CommonJS export names for ESM import in node:
|
|
5629
5714
|
0 && (module.exports = {
|
|
5630
5715
|
DataList,
|
|
5631
5716
|
InputControl,
|
|
5632
5717
|
InputControlType,
|
|
5633
5718
|
PageBodyRenderer,
|
|
5719
|
+
Toast,
|
|
5720
|
+
ToastService,
|
|
5634
5721
|
ViewControl,
|
|
5635
5722
|
ViewControlTypes
|
|
5636
5723
|
});
|
package/dist/index.mjs
CHANGED
|
@@ -4,6 +4,7 @@ import {
|
|
|
4
4
|
import {
|
|
5
5
|
Button_default,
|
|
6
6
|
ServiceClient_default,
|
|
7
|
+
ToastService_default,
|
|
7
8
|
buttonClasses
|
|
8
9
|
} from "./chunk-O5BPFXEO.mjs";
|
|
9
10
|
|
|
@@ -4657,11 +4658,91 @@ var PageBodyRenderer = (props) => {
|
|
|
4657
4658
|
}) });
|
|
4658
4659
|
};
|
|
4659
4660
|
var PageBodyRenderer_default = PageBodyRenderer;
|
|
4661
|
+
|
|
4662
|
+
// src/components/Toast.tsx
|
|
4663
|
+
import { useState as useState8 } from "react";
|
|
4664
|
+
import { Fragment as Fragment9, jsx as jsx61, jsxs as jsxs34 } from "react/jsx-runtime";
|
|
4665
|
+
var Toast = () => {
|
|
4666
|
+
const [showToast, setShowToast] = useState8(false);
|
|
4667
|
+
const [message, setMessage] = useState8("");
|
|
4668
|
+
const [messageType, setMessageType] = useState8("error");
|
|
4669
|
+
ToastService_default.showError = function(message2) {
|
|
4670
|
+
setShowToast(true);
|
|
4671
|
+
setMessage(message2);
|
|
4672
|
+
setMessageType("error");
|
|
4673
|
+
};
|
|
4674
|
+
ToastService_default.showInfo = function(message2) {
|
|
4675
|
+
setShowToast(true);
|
|
4676
|
+
setMessage(message2);
|
|
4677
|
+
setMessageType("info");
|
|
4678
|
+
setTimeout(() => {
|
|
4679
|
+
setShowToast(false);
|
|
4680
|
+
}, 4e3);
|
|
4681
|
+
};
|
|
4682
|
+
ToastService_default.close = function() {
|
|
4683
|
+
setShowToast(false);
|
|
4684
|
+
};
|
|
4685
|
+
const closeToast = () => {
|
|
4686
|
+
setShowToast(false);
|
|
4687
|
+
};
|
|
4688
|
+
return /* @__PURE__ */ jsx61(Fragment9, { children: showToast && /* @__PURE__ */ jsx61(
|
|
4689
|
+
"div",
|
|
4690
|
+
{
|
|
4691
|
+
className: "fixed top-2 flex justify-center w-1/2 left-1/2 -translate-x-1/2",
|
|
4692
|
+
style: { zIndex: 1e3 },
|
|
4693
|
+
children: /* @__PURE__ */ jsxs34(
|
|
4694
|
+
"div",
|
|
4695
|
+
{
|
|
4696
|
+
className: `w-full items-center flex justify-between p-3 rounded-md relative ${messageType == "error" ? "bg-error" : "bg-success-soft"}`,
|
|
4697
|
+
children: [
|
|
4698
|
+
/* @__PURE__ */ jsx61(
|
|
4699
|
+
"span",
|
|
4700
|
+
{
|
|
4701
|
+
className: "font-medium text-inherit text-sm",
|
|
4702
|
+
style: { whiteSpace: "pre-line" },
|
|
4703
|
+
children: message
|
|
4704
|
+
}
|
|
4705
|
+
),
|
|
4706
|
+
/* @__PURE__ */ jsx61(
|
|
4707
|
+
"button",
|
|
4708
|
+
{
|
|
4709
|
+
className: "absolute right-2 top-2 ml-2 focus:outline-none",
|
|
4710
|
+
onClick: closeToast,
|
|
4711
|
+
children: /* @__PURE__ */ jsx61(
|
|
4712
|
+
"svg",
|
|
4713
|
+
{
|
|
4714
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
4715
|
+
className: "h-4 w-4",
|
|
4716
|
+
fill: "none",
|
|
4717
|
+
viewBox: "0 0 24 24",
|
|
4718
|
+
stroke: "currentColor",
|
|
4719
|
+
children: /* @__PURE__ */ jsx61(
|
|
4720
|
+
"path",
|
|
4721
|
+
{
|
|
4722
|
+
strokeLinecap: "round",
|
|
4723
|
+
strokeLinejoin: "round",
|
|
4724
|
+
strokeWidth: "2",
|
|
4725
|
+
d: "M6 18L18 6M6 6l12 12"
|
|
4726
|
+
}
|
|
4727
|
+
)
|
|
4728
|
+
}
|
|
4729
|
+
)
|
|
4730
|
+
}
|
|
4731
|
+
)
|
|
4732
|
+
]
|
|
4733
|
+
}
|
|
4734
|
+
)
|
|
4735
|
+
}
|
|
4736
|
+
) });
|
|
4737
|
+
};
|
|
4738
|
+
var Toast_default = Toast;
|
|
4660
4739
|
export {
|
|
4661
4740
|
DataList_default as DataList,
|
|
4662
4741
|
InputControl_default as InputControl,
|
|
4663
4742
|
InputControlType_default as InputControlType,
|
|
4664
4743
|
PageBodyRenderer_default as PageBodyRenderer,
|
|
4744
|
+
Toast_default as Toast,
|
|
4745
|
+
ToastService_default as ToastService,
|
|
4665
4746
|
ViewControl_default as ViewControl,
|
|
4666
4747
|
ViewControlTypes_default as ViewControlTypes
|
|
4667
4748
|
};
|
package/package.json
CHANGED