@plitzi/sdk-elements 0.38.5 → 0.38.7
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/CHANGELOG.md +226 -0
- package/dist/Element/hooks/useRscData.d.ts +1 -1
- package/dist/components/MarkdownDocument/MarkdownDocument.d.ts +32 -0
- package/dist/components/MarkdownDocument/MarkdownDocument.mjs +32 -0
- package/dist/components/MarkdownDocument/components/CodeBlock/CodeBlock.d.ts +14 -0
- package/dist/components/MarkdownDocument/components/CodeBlock/CodeBlock.mjs +34 -0
- package/dist/components/MarkdownDocument/components/CodeBlock/index.d.ts +3 -0
- package/dist/components/MarkdownDocument/components/CodeBlock/index.mjs +5 -0
- package/dist/components/MarkdownDocument/helpers/hastText.d.ts +10 -0
- package/dist/components/MarkdownDocument/helpers/hastText.mjs +4 -0
- package/dist/components/MarkdownDocument/helpers/markdownComponents.d.ts +10 -0
- package/dist/components/MarkdownDocument/helpers/markdownComponents.mjs +89 -0
- package/dist/components/MarkdownDocument/helpers/markdownParts.d.ts +16 -0
- package/dist/components/MarkdownDocument/helpers/markdownParts.mjs +4 -0
- package/dist/components/MarkdownDocument/helpers/rehypeHeadingAnchors.d.ts +8 -0
- package/dist/components/MarkdownDocument/helpers/rehypeHeadingAnchors.mjs +20 -0
- package/dist/components/MarkdownDocument/helpers/syntaxHighlighter.d.ts +3 -0
- package/dist/components/MarkdownDocument/helpers/syntaxHighlighter.mjs +24 -0
- package/dist/components/MarkdownDocument/index.d.ts +5 -0
- package/dist/components/MarkdownDocument/index.mjs +6 -0
- package/dist/dataSource/GlobalSources.mjs +101 -113
- package/dist/elements/advanced/Custom/declaration.d.ts +5 -1
- package/dist/elements/advanced/Custom/declaration.mjs +5 -1
- package/dist/elements/advanced/Custom/index.d.ts +5 -1
- package/dist/elements/basic/Button/declaration.d.ts +46 -34
- package/dist/elements/basic/Button/declaration.mjs +18 -42
- package/dist/elements/basic/Button/index.d.ts +46 -34
- package/dist/elements/basic/Dropdown/DropdownPopup/declaration.d.ts +2 -0
- package/dist/elements/basic/Dropdown/DropdownPopup/declaration.mjs +2 -0
- package/dist/elements/basic/Dropdown/DropdownPopup/index.d.ts +2 -0
- package/dist/elements/basic/Dropdown/index.d.ts +2 -0
- package/dist/elements/basic/Heading/declaration.d.ts +5 -1
- package/dist/elements/basic/Heading/declaration.mjs +5 -1
- package/dist/elements/basic/Heading/index.d.ts +5 -1
- package/dist/elements/basic/Link/Link.d.ts +7 -1
- package/dist/elements/basic/Link/Link.mjs +27 -27
- package/dist/elements/basic/Link/Settings.d.ts +2 -1
- package/dist/elements/basic/Link/Settings.mjs +42 -29
- package/dist/elements/basic/Link/ariaCurrent.d.ts +12 -0
- package/dist/elements/basic/Link/ariaCurrent.mjs +11 -0
- package/dist/elements/basic/Link/declaration.d.ts +5 -1
- package/dist/elements/basic/Link/declaration.mjs +7 -4
- package/dist/elements/basic/Link/index.d.ts +5 -1
- package/dist/elements/basic/Markdown/Markdown.d.ts +6 -1
- package/dist/elements/basic/Markdown/Markdown.mjs +19 -15
- package/dist/elements/basic/Markdown/Settings.d.ts +2 -1
- package/dist/elements/basic/Markdown/Settings.mjs +16 -10
- package/dist/elements/basic/Markdown/declaration.d.ts +32 -5
- package/dist/elements/basic/Markdown/declaration.mjs +37 -7
- package/dist/elements/basic/Markdown/hooks/useMarkdownClassNames.d.ts +7 -0
- package/dist/elements/basic/Markdown/hooks/useMarkdownClassNames.mjs +13 -0
- package/dist/elements/basic/Markdown/index.d.ts +32 -5
- package/dist/elements/basic/RichText/RichText.mjs +27 -20
- package/dist/elements/basic/RichText/classHtmlParts.d.ts +14 -0
- package/dist/elements/basic/RichText/classHtmlParts.mjs +48 -0
- package/dist/elements/basic/RichText/declaration.d.ts +28 -1
- package/dist/elements/basic/RichText/declaration.mjs +31 -2
- package/dist/elements/basic/RichText/index.d.ts +28 -1
- package/dist/elements/basic/Text/declaration.d.ts +0 -2
- package/dist/elements/basic/Text/declaration.mjs +1 -5
- package/dist/elements/basic/Text/index.d.ts +0 -2
- package/dist/elements/basic/ThemeToggle/ThemeToggle.mjs +20 -18
- package/dist/elements/basic/ThemeToggle/declaration.d.ts +48 -4
- package/dist/elements/basic/ThemeToggle/declaration.mjs +32 -8
- package/dist/elements/basic/ThemeToggle/index.d.ts +48 -4
- package/dist/elements/declarations/index.d.ts +781 -318
- package/dist/elements/form/FormControl/FormControl.mjs +51 -53
- package/dist/elements/form/FormControl/Settings.mjs +4 -0
- package/dist/elements/form/FormControl/components/Label.d.ts +3 -1
- package/dist/elements/form/FormControl/components/Label.mjs +5 -5
- package/dist/elements/form/FormControl/declaration.d.ts +479 -233
- package/dist/elements/form/FormControl/declaration.mjs +142 -76
- package/dist/elements/form/FormControl/helpers/isChecked.d.ts +8 -0
- package/dist/elements/form/FormControl/helpers/isChecked.mjs +4 -0
- package/dist/elements/form/FormControl/hocs/withFieldValue.mjs +2 -6
- package/dist/elements/form/FormControl/index.d.ts +479 -233
- package/dist/elements/form/FormControl/inputs/Checkbox.d.ts +7 -3
- package/dist/elements/form/FormControl/inputs/Checkbox.mjs +7 -6
- package/dist/elements/form/FormControl/inputs/Input.d.ts +6 -1
- package/dist/elements/form/FormControl/inputs/Input.mjs +29 -29
- package/dist/elements/form/FormControl/inputs/Select.d.ts +4 -1
- package/dist/elements/form/FormControl/inputs/Select.mjs +15 -15
- package/dist/elements/internal/NotFound/declaration.d.ts +5 -1
- package/dist/elements/internal/NotFound/declaration.mjs +5 -1
- package/dist/elements/internal/NotFound/index.d.ts +5 -1
- package/dist/elements/internal/Page/declaration.d.ts +1 -2
- package/dist/elements/internal/Page/declaration.mjs +2 -3
- package/dist/elements/internal/Page/index.d.ts +1 -2
- package/dist/elements/media/Image/declaration.d.ts +3 -2
- package/dist/elements/media/Image/declaration.mjs +3 -2
- package/dist/elements/media/Image/index.d.ts +3 -2
- package/dist/elements/provider/ApiContainer/ApiContainer.mjs +89 -80
- package/dist/elements/provider/ApiContainer/hooks/useApi.mjs +23 -23
- package/dist/elements/provider/ApiContainer/hooks/useProviderWrite.mjs +5 -5
- package/dist/elements/structure/Carousel/CarouselTrack/declaration.d.ts +4 -1
- package/dist/elements/structure/Carousel/CarouselTrack/declaration.mjs +4 -1
- package/dist/elements/structure/Carousel/CarouselTrack/index.d.ts +4 -1
- package/dist/elements/structure/Carousel/index.d.ts +4 -1
- package/dist/elements/structure/DialogContainer/DialogContainer.mjs +2 -2
- package/dist/elements/structure/DialogContainer/declaration.d.ts +72 -12
- package/dist/elements/structure/DialogContainer/declaration.mjs +58 -17
- package/dist/elements/structure/DialogContainer/index.d.ts +72 -12
- package/dist/elements/structure/List/declaration.d.ts +5 -1
- package/dist/elements/structure/List/declaration.mjs +5 -1
- package/dist/elements/structure/List/index.d.ts +5 -1
- package/dist/elements/structure/ModalContainer/declaration.d.ts +36 -16
- package/dist/elements/structure/ModalContainer/declaration.mjs +42 -24
- package/dist/elements/structure/ModalContainer/index.d.ts +36 -16
- package/dist/elements/structure/Pagination/Pagination.mjs +23 -23
- package/dist/elements/structure/Pagination/declaration.d.ts +5 -1
- package/dist/elements/structure/Pagination/declaration.mjs +8 -2
- package/dist/elements/structure/Pagination/index.d.ts +5 -1
- package/dist/elements/structure/TabContainer/TabContainerItem/TabContainerItem.mjs +2 -1
- package/dist/index.d.ts +781 -318
- package/package.json +77 -13
- package/dist/elements/basic/Link/isCurrentPage.d.ts +0 -5
- package/dist/elements/basic/Link/isCurrentPage.mjs +0 -12
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
import { ChangeEvent } from 'react';
|
|
2
2
|
export type CheckboxProps = {
|
|
3
3
|
className?: string;
|
|
4
|
+
/**
|
|
5
|
+
* How the box is offered: `switch` is the same checkbox announced as an on/off switch (`role="switch"`) and drawn as
|
|
6
|
+
* a track with a thumb — for a setting that takes effect at once, where a checkbox reads as a choice to submit.
|
|
7
|
+
*/
|
|
8
|
+
variant?: 'checkbox' | 'switch';
|
|
4
9
|
id?: string;
|
|
5
10
|
name?: string;
|
|
6
|
-
|
|
7
|
-
value?: string;
|
|
11
|
+
checked?: boolean;
|
|
8
12
|
required?: boolean;
|
|
9
13
|
disabled?: boolean;
|
|
10
14
|
onChange?: (e: ChangeEvent<HTMLInputElement>) => void;
|
|
@@ -15,5 +19,5 @@ export type CheckboxProps = {
|
|
|
15
19
|
*/
|
|
16
20
|
errorId?: string;
|
|
17
21
|
};
|
|
18
|
-
declare const Checkbox: ({ className, id, name,
|
|
22
|
+
declare const Checkbox: ({ className, variant, id, name, checked, required, disabled, onChange, onValidate, errorId }: CheckboxProps) => import('react').JSX.Element;
|
|
19
23
|
export default Checkbox;
|
|
@@ -2,17 +2,18 @@ import { useCallback as e } from "react";
|
|
|
2
2
|
import { jsx as t } from "react/jsx-runtime";
|
|
3
3
|
import n from "clsx";
|
|
4
4
|
//#region src/elements/form/FormControl/inputs/Checkbox.tsx
|
|
5
|
-
var r = ({ className: r = "",
|
|
5
|
+
var r = ({ className: r = "", variant: i = "checkbox", id: a = "", name: o = "", checked: s = !1, required: c = !0, disabled: l = !1, onChange: u, onValidate: d, errorId: f }) => {
|
|
6
6
|
let p = e(() => d?.(), [d]);
|
|
7
7
|
return /* @__PURE__ */ t("input", {
|
|
8
|
-
className: n(
|
|
9
|
-
id:
|
|
8
|
+
className: n(`form-control__${i}-container`, r),
|
|
9
|
+
id: a,
|
|
10
|
+
role: i === "switch" ? "switch" : void 0,
|
|
10
11
|
"aria-invalid": f ? !0 : void 0,
|
|
11
12
|
"aria-describedby": f,
|
|
12
|
-
name:
|
|
13
|
+
name: o,
|
|
13
14
|
type: "checkbox",
|
|
14
|
-
|
|
15
|
-
|
|
15
|
+
value: "true",
|
|
16
|
+
checked: s,
|
|
16
17
|
required: c,
|
|
17
18
|
disabled: l,
|
|
18
19
|
onChange: u,
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
export type InputProps = {
|
|
2
|
+
/** The box the field is drawn in — the `input` slot. */
|
|
2
3
|
className?: string;
|
|
4
|
+
/** The `<input>` inside the box — the `field` slot. */
|
|
5
|
+
fieldClassName?: string;
|
|
6
|
+
/** A password's show/hide button — the `icon` slot. */
|
|
7
|
+
iconClassName?: string;
|
|
3
8
|
id?: string;
|
|
4
9
|
name?: string;
|
|
5
10
|
placeholder?: string;
|
|
@@ -21,5 +26,5 @@ export type InputProps = {
|
|
|
21
26
|
*/
|
|
22
27
|
errorId?: string;
|
|
23
28
|
};
|
|
24
|
-
declare const Input: ({ className, id, name, placeholder, value, type, autoComplete, autoFocus, required, maxLength, disabled, readOnly, onChange, onValidate, errorId }: InputProps) => import('react').JSX.Element;
|
|
29
|
+
declare const Input: ({ className, fieldClassName, iconClassName, id, name, placeholder, value, type, autoComplete, autoFocus, required, maxLength, disabled, readOnly, onChange, onValidate, errorId }: InputProps) => import('react').JSX.Element;
|
|
25
30
|
export default Input;
|
|
@@ -3,43 +3,43 @@ import { useCallback as t, useRef as n, useState as r } from "react";
|
|
|
3
3
|
import { jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
4
4
|
import o from "clsx";
|
|
5
5
|
//#region src/elements/form/FormControl/inputs/Input.tsx
|
|
6
|
-
var s = ({ className: s = "",
|
|
7
|
-
let [
|
|
8
|
-
e(
|
|
9
|
-
let
|
|
10
|
-
let t =
|
|
11
|
-
if (t?.focus(),
|
|
6
|
+
var s = ({ className: s = "", fieldClassName: c, iconClassName: l, id: u = "", name: d = "", placeholder: f = "", value: p = "", type: m = "text", autoComplete: h = !1, autoFocus: g = !1, required: _ = !0, maxLength: v = 0, disabled: y = !1, readOnly: b = !1, onChange: x, onValidate: S, errorId: C }) => {
|
|
7
|
+
let [w, T] = r(!1), E = n(null);
|
|
8
|
+
e(E, g);
|
|
9
|
+
let D = t(() => T((e) => !e), [T]), O = t((e) => {
|
|
10
|
+
let t = E.current;
|
|
11
|
+
if (t?.focus(), m === "color" && t && e.target !== t) try {
|
|
12
12
|
t.showPicker();
|
|
13
13
|
} catch {}
|
|
14
|
-
}, [
|
|
14
|
+
}, [E, m]), k = t(() => S?.(), [S]);
|
|
15
15
|
return /* @__PURE__ */ a("div", {
|
|
16
16
|
className: o("form-control__input-container", s),
|
|
17
|
-
onClick:
|
|
17
|
+
onClick: O,
|
|
18
18
|
children: [/* @__PURE__ */ i("input", {
|
|
19
|
-
ref:
|
|
20
|
-
className: "input-container__input",
|
|
21
|
-
id:
|
|
22
|
-
"aria-invalid":
|
|
23
|
-
"aria-describedby":
|
|
24
|
-
name:
|
|
25
|
-
type:
|
|
26
|
-
placeholder:
|
|
27
|
-
value:
|
|
28
|
-
required:
|
|
29
|
-
maxLength:
|
|
30
|
-
autoComplete:
|
|
31
|
-
disabled:
|
|
32
|
-
readOnly:
|
|
33
|
-
onChange:
|
|
34
|
-
onBlur:
|
|
35
|
-
}),
|
|
19
|
+
ref: E,
|
|
20
|
+
className: o("input-container__input", c),
|
|
21
|
+
id: u,
|
|
22
|
+
"aria-invalid": C ? !0 : void 0,
|
|
23
|
+
"aria-describedby": C,
|
|
24
|
+
name: d,
|
|
25
|
+
type: m === "password" && w ? "text" : m,
|
|
26
|
+
placeholder: f,
|
|
27
|
+
value: p,
|
|
28
|
+
required: _,
|
|
29
|
+
maxLength: v > 0 ? v : void 0,
|
|
30
|
+
autoComplete: h ? "on" : "off",
|
|
31
|
+
disabled: y,
|
|
32
|
+
readOnly: b,
|
|
33
|
+
onChange: x,
|
|
34
|
+
onBlur: k
|
|
35
|
+
}), m === "password" && /* @__PURE__ */ i("button", {
|
|
36
36
|
type: "button",
|
|
37
|
-
className: "form-input__icon",
|
|
38
|
-
"aria-pressed":
|
|
37
|
+
className: o("form-input__icon", l),
|
|
38
|
+
"aria-pressed": w,
|
|
39
39
|
title: "Show password",
|
|
40
|
-
onClick:
|
|
40
|
+
onClick: D,
|
|
41
41
|
children: /* @__PURE__ */ i("i", {
|
|
42
|
-
className:
|
|
42
|
+
className: w ? "fa-solid fa-eye-slash" : "fa-solid fa-eye",
|
|
43
43
|
"aria-hidden": "true"
|
|
44
44
|
})
|
|
45
45
|
})]
|
|
@@ -8,7 +8,10 @@ export type SelectProps = {
|
|
|
8
8
|
} | string)[];
|
|
9
9
|
placeholder?: string;
|
|
10
10
|
value?: string;
|
|
11
|
+
/** The box the select is drawn in — the `input` slot. */
|
|
11
12
|
className?: string;
|
|
13
|
+
/** The `<select>` inside the box — the `field` slot. */
|
|
14
|
+
fieldClassName?: string;
|
|
12
15
|
disabled?: boolean;
|
|
13
16
|
onChange?: (e: ChangeEvent<HTMLSelectElement>) => void;
|
|
14
17
|
onValidate?: () => void;
|
|
@@ -18,5 +21,5 @@ export type SelectProps = {
|
|
|
18
21
|
*/
|
|
19
22
|
errorId?: string;
|
|
20
23
|
};
|
|
21
|
-
declare const Select: ({ id, name, options, placeholder, value, className, disabled, onChange, onValidate, errorId }: SelectProps) => import('react').JSX.Element;
|
|
24
|
+
declare const Select: ({ id, name, options, placeholder, value, className, fieldClassName, disabled, onChange, onValidate, errorId }: SelectProps) => import('react').JSX.Element;
|
|
22
25
|
export default Select;
|
|
@@ -2,12 +2,12 @@ import { useCallback as e, useMemo as t, useRef as n } from "react";
|
|
|
2
2
|
import { jsx as r, jsxs as i } from "react/jsx-runtime";
|
|
3
3
|
import a from "clsx";
|
|
4
4
|
//#region src/elements/form/FormControl/inputs/Select.tsx
|
|
5
|
-
var o = ({ id: o = "", name: s, options: c = [], placeholder: l = "", value: u = "", className: d = "",
|
|
6
|
-
let
|
|
7
|
-
|
|
8
|
-
}, [
|
|
5
|
+
var o = ({ id: o = "", name: s, options: c = [], placeholder: l = "", value: u = "", className: d = "", fieldClassName: f, disabled: p = !1, onChange: m, onValidate: h, errorId: g }) => {
|
|
6
|
+
let _ = n(null), v = e(() => {
|
|
7
|
+
_.current?.click();
|
|
8
|
+
}, [_]), y = e((e) => {
|
|
9
9
|
e.stopPropagation();
|
|
10
|
-
}, []),
|
|
10
|
+
}, []), b = e(() => h?.(), [h]), x = t(() => Array.isArray(c) ? c.map((e) => {
|
|
11
11
|
if (typeof e == "string") return {
|
|
12
12
|
value: e,
|
|
13
13
|
label: e
|
|
@@ -26,23 +26,23 @@ var o = ({ id: o = "", name: s, options: c = [], placeholder: l = "", value: u =
|
|
|
26
26
|
}) : [], [c]);
|
|
27
27
|
return /* @__PURE__ */ r("div", {
|
|
28
28
|
className: a("form-control__select-container", d),
|
|
29
|
-
onClick:
|
|
29
|
+
onClick: v,
|
|
30
30
|
children: /* @__PURE__ */ i("select", {
|
|
31
|
-
ref:
|
|
31
|
+
ref: _,
|
|
32
32
|
id: o,
|
|
33
|
-
"aria-invalid":
|
|
34
|
-
"aria-describedby":
|
|
33
|
+
"aria-invalid": g ? !0 : void 0,
|
|
34
|
+
"aria-describedby": g,
|
|
35
35
|
name: s,
|
|
36
|
-
onChange:
|
|
36
|
+
onChange: m,
|
|
37
37
|
value: u,
|
|
38
|
-
className: "select-container__select",
|
|
39
|
-
disabled:
|
|
40
|
-
onClick:
|
|
41
|
-
onBlur:
|
|
38
|
+
className: a("select-container__select", f),
|
|
39
|
+
disabled: p,
|
|
40
|
+
onClick: y,
|
|
41
|
+
onBlur: b,
|
|
42
42
|
children: [l && /* @__PURE__ */ r("option", {
|
|
43
43
|
value: "",
|
|
44
44
|
children: l
|
|
45
|
-
}),
|
|
45
|
+
}), x.map((e, t) => /* @__PURE__ */ r("option", {
|
|
46
46
|
value: e.value,
|
|
47
47
|
children: e.label
|
|
48
48
|
}, t))]
|
|
@@ -41,7 +41,11 @@ declare const declaration: {
|
|
|
41
41
|
readonly displayMode: "desktop";
|
|
42
42
|
readonly style: {
|
|
43
43
|
readonly base: {
|
|
44
|
-
readonly default: {
|
|
44
|
+
readonly default: {
|
|
45
|
+
readonly display: "flex";
|
|
46
|
+
readonly 'justify-content': "center";
|
|
47
|
+
readonly 'align-items': "center";
|
|
48
|
+
};
|
|
45
49
|
};
|
|
46
50
|
};
|
|
47
51
|
};
|
|
@@ -33,7 +33,11 @@ var t = e()({
|
|
|
33
33
|
defaultStyle: {
|
|
34
34
|
name: "Not Found",
|
|
35
35
|
displayMode: "desktop",
|
|
36
|
-
style: { base: { default: {
|
|
36
|
+
style: { base: { default: {
|
|
37
|
+
display: "flex",
|
|
38
|
+
"justify-content": "center",
|
|
39
|
+
"align-items": "center"
|
|
40
|
+
} } }
|
|
37
41
|
},
|
|
38
42
|
settings: {}
|
|
39
43
|
}
|
|
@@ -40,7 +40,11 @@ declare const NotFound: {
|
|
|
40
40
|
readonly displayMode: "desktop";
|
|
41
41
|
readonly style: {
|
|
42
42
|
readonly base: {
|
|
43
|
-
readonly default: {
|
|
43
|
+
readonly default: {
|
|
44
|
+
readonly display: "flex";
|
|
45
|
+
readonly 'justify-content': "center";
|
|
46
|
+
readonly 'align-items': "center";
|
|
47
|
+
};
|
|
44
48
|
};
|
|
45
49
|
};
|
|
46
50
|
};
|
|
@@ -71,12 +71,11 @@ declare const declaration: {
|
|
|
71
71
|
readonly 'min-height': "100%";
|
|
72
72
|
readonly 'min-width': "100%";
|
|
73
73
|
readonly 'font-family': "Arial";
|
|
74
|
-
readonly color: "#333";
|
|
74
|
+
readonly color: "light-dark(#333, oklch(0.92 0.004 286.32))";
|
|
75
75
|
readonly 'font-size': "14px";
|
|
76
76
|
readonly 'font-weight': 400;
|
|
77
77
|
readonly 'line-height': "16px";
|
|
78
78
|
readonly 'text-align': "left";
|
|
79
|
-
readonly 'background-color': "#ffffff";
|
|
80
79
|
};
|
|
81
80
|
};
|
|
82
81
|
};
|
|
@@ -61,12 +61,11 @@ var t = e()({
|
|
|
61
61
|
"min-height": "100%",
|
|
62
62
|
"min-width": "100%",
|
|
63
63
|
"font-family": "Arial",
|
|
64
|
-
color: "#333",
|
|
64
|
+
color: "light-dark(#333, oklch(0.92 0.004 286.32))",
|
|
65
65
|
"font-size": "14px",
|
|
66
66
|
"font-weight": 400,
|
|
67
67
|
"line-height": "16px",
|
|
68
|
-
"text-align": "left"
|
|
69
|
-
"background-color": "#ffffff"
|
|
68
|
+
"text-align": "left"
|
|
70
69
|
} } }
|
|
71
70
|
},
|
|
72
71
|
settings: {}
|
|
@@ -70,12 +70,11 @@ declare const Page: {
|
|
|
70
70
|
readonly 'min-height': "100%";
|
|
71
71
|
readonly 'min-width': "100%";
|
|
72
72
|
readonly 'font-family': "Arial";
|
|
73
|
-
readonly color: "#333";
|
|
73
|
+
readonly color: "light-dark(#333, oklch(0.92 0.004 286.32))";
|
|
74
74
|
readonly 'font-size': "14px";
|
|
75
75
|
readonly 'font-weight': 400;
|
|
76
76
|
readonly 'line-height': "16px";
|
|
77
77
|
readonly 'text-align': "left";
|
|
78
|
-
readonly 'background-color': "#ffffff";
|
|
79
78
|
};
|
|
80
79
|
};
|
|
81
80
|
};
|
|
@@ -19,7 +19,7 @@ declare const declaration: {
|
|
|
19
19
|
readonly definition: {
|
|
20
20
|
readonly label: "Image";
|
|
21
21
|
readonly type: "image";
|
|
22
|
-
readonly description:
|
|
22
|
+
readonly description: string;
|
|
23
23
|
readonly bindings: {};
|
|
24
24
|
readonly styleSelectors: {
|
|
25
25
|
readonly base: "";
|
|
@@ -54,7 +54,8 @@ declare const declaration: {
|
|
|
54
54
|
readonly default: {
|
|
55
55
|
readonly display: "block";
|
|
56
56
|
readonly width: "140px";
|
|
57
|
-
readonly height: "
|
|
57
|
+
readonly height: "auto";
|
|
58
|
+
readonly 'max-width': "100%";
|
|
58
59
|
};
|
|
59
60
|
};
|
|
60
61
|
};
|
|
@@ -25,7 +25,7 @@ var n = e()({
|
|
|
25
25
|
definition: {
|
|
26
26
|
label: "Image",
|
|
27
27
|
type: "image",
|
|
28
|
-
description: "Displays an image from a URL.",
|
|
28
|
+
description: "Displays an image from a URL. It starts 140px wide and as tall as the picture is for that width (`height: auto`, never wider than where it sits): a class that sets only a `width` or an `aspect-ratio` is obeyed, and `object-fit` decides how the picture fills a box that sets both.",
|
|
29
29
|
bindings: {},
|
|
30
30
|
styleSelectors: { base: "" },
|
|
31
31
|
initialState: { visibility: !0 }
|
|
@@ -54,7 +54,8 @@ var n = e()({
|
|
|
54
54
|
style: { base: { default: {
|
|
55
55
|
display: "block",
|
|
56
56
|
width: "140px",
|
|
57
|
-
height: "
|
|
57
|
+
height: "auto",
|
|
58
|
+
"max-width": "100%"
|
|
58
59
|
} } }
|
|
59
60
|
},
|
|
60
61
|
settings: {}
|
|
@@ -18,7 +18,7 @@ declare const Image: {
|
|
|
18
18
|
readonly definition: {
|
|
19
19
|
readonly label: "Image";
|
|
20
20
|
readonly type: "image";
|
|
21
|
-
readonly description:
|
|
21
|
+
readonly description: string;
|
|
22
22
|
readonly bindings: {};
|
|
23
23
|
readonly styleSelectors: {
|
|
24
24
|
readonly base: "";
|
|
@@ -53,7 +53,8 @@ declare const Image: {
|
|
|
53
53
|
readonly default: {
|
|
54
54
|
readonly display: "block";
|
|
55
55
|
readonly width: "140px";
|
|
56
|
-
readonly height: "
|
|
56
|
+
readonly height: "auto";
|
|
57
|
+
readonly 'max-width': "100%";
|
|
57
58
|
};
|
|
58
59
|
};
|
|
59
60
|
};
|
|
@@ -25,13 +25,14 @@ import be from "clsx";
|
|
|
25
25
|
import xe from "@plitzi/sdk-shared/dataSource/helpers/getSourceName";
|
|
26
26
|
import Se from "@plitzi/sdk-shared/dataSource/hooks/useRegisterSource";
|
|
27
27
|
import { QueryBuilderEvaluator as Ce } from "@plitzi/plitzi-ui/QueryBuilder";
|
|
28
|
+
import { useServerQuery as we } from "@plitzi/sdk-shared/queries";
|
|
28
29
|
//#region src/elements/provider/ApiContainer/ApiContainer.tsx
|
|
29
|
-
var c = ({ ref: e, className: c = "", children: l, query: u = "", method: d = "get", accessToken: f = "", when: p = o, headers: m = o, mockData: h = "{}", subType:
|
|
30
|
-
let { id: v, visible: y, definition: { label: b = "Api Container", runtime:
|
|
30
|
+
var c = ({ ref: e, className: c = "", children: l, query: u = "", method: d = "get", accessToken: f = "", when: p = o, headers: m = o, mockData: h = "{}", subType: Te = "", credentials: Ee = "same-origin", singleRecord: g = !1, pagination: De = "none", pageParam: Oe = "page", renderWhileLoading: ke = !1, loadingSlot: _ = "", cache: Ae = !1, staleTime: je = 30, gcTime: Me = 300, refreshSeconds: Ne = 0, connector: Pe = "", action: Fe = "", input: Ie }) => {
|
|
31
|
+
let { id: v, visible: y, definition: { label: b = "Api Container", runtime: Le, items: Re } } = t(), x = Le === "server", { loaded: S, stale: C, location: w, elementData: T, refreshing: ze, refresh: E, cancel: D } = ee(), O = xe(n.sourceType, v), { settings: { previewMode: k }, contexts: { InteractionsContext: Be } } = he(), { interactionsManager: A } = pe(Be), [[j, M, Ve]] = _e([
|
|
31
32
|
"navigation.routeParams",
|
|
32
33
|
"navigation.queryParams",
|
|
33
34
|
"navigation.navigate"
|
|
34
|
-
]),
|
|
35
|
+
]), He = i(() => f ? {
|
|
35
36
|
...m,
|
|
36
37
|
Authorization: `Bearer ${f}`
|
|
37
38
|
} : m, [m, f]), N = i(() => x || !y ? !1 : !!(k && u && (p === o || Ce(p, {
|
|
@@ -46,147 +47,155 @@ var c = ({ ref: e, className: c = "", children: l, query: u = "", method: d = "g
|
|
|
46
47
|
j,
|
|
47
48
|
M,
|
|
48
49
|
h
|
|
49
|
-
]),
|
|
50
|
+
]), Ue = i(() => [v], [v]), { isLoading: We, isFetching: Ge, data: Ke, refetch: qe, cancel: P, isSuccess: Je, isError: Ye } = se({
|
|
50
51
|
url: u,
|
|
51
52
|
method: d,
|
|
52
|
-
credentials:
|
|
53
|
+
credentials: Ee,
|
|
53
54
|
mock: k ? void 0 : h,
|
|
54
|
-
customHeaders:
|
|
55
|
+
customHeaders: He,
|
|
55
56
|
enabled: N,
|
|
56
|
-
cache:
|
|
57
|
-
staleTime:
|
|
58
|
-
gcTime:
|
|
59
|
-
tags:
|
|
60
|
-
}),
|
|
57
|
+
cache: Ae,
|
|
58
|
+
staleTime: je,
|
|
59
|
+
gcTime: Me,
|
|
60
|
+
tags: Ue
|
|
61
|
+
}), F = x && !!w && w !== ye(), I = x && S && !F && T === null, L = x && !Pe && !Fe, R = i(() => x ? T || (S ? o : oe(h, L)) : Ke ?? o, [
|
|
61
62
|
x,
|
|
62
|
-
|
|
63
|
+
Ke,
|
|
63
64
|
T,
|
|
64
65
|
S,
|
|
65
66
|
h,
|
|
66
|
-
|
|
67
|
-
]),
|
|
68
|
-
...
|
|
67
|
+
L
|
|
68
|
+
]), z = x ? F || ze : Ge, B = x ? F : We, V = a({}), Xe = r((e, t) => E(e, {
|
|
69
|
+
...V.current,
|
|
69
70
|
...t
|
|
70
|
-
}), [E]),
|
|
71
|
+
}), [E]), H = r(async (e) => {
|
|
71
72
|
if (!x) {
|
|
72
|
-
|
|
73
|
+
qe();
|
|
73
74
|
return;
|
|
74
75
|
}
|
|
75
|
-
await
|
|
76
|
+
await E([v], V.current, { fresh: e });
|
|
76
77
|
}, [
|
|
77
78
|
x,
|
|
78
|
-
|
|
79
|
-
|
|
79
|
+
qe,
|
|
80
|
+
E,
|
|
80
81
|
v
|
|
81
|
-
]),
|
|
82
|
+
]), U = r(() => H(!0), [H]), Ze = r(() => H(!1), [H]);
|
|
83
|
+
we({
|
|
84
|
+
id: v,
|
|
85
|
+
url: L && u ? u : void 0,
|
|
86
|
+
enabled: x && S,
|
|
87
|
+
active: y,
|
|
88
|
+
refresh: U
|
|
89
|
+
});
|
|
90
|
+
let W = r(async ({ input: e } = {}) => {
|
|
82
91
|
let t = ae(e);
|
|
83
|
-
t && (
|
|
84
|
-
}, [
|
|
92
|
+
t && (V.current = t), await U();
|
|
93
|
+
}, [U]), G = r(() => {
|
|
85
94
|
if (x) {
|
|
86
95
|
D();
|
|
87
96
|
return;
|
|
88
97
|
}
|
|
89
|
-
|
|
98
|
+
P();
|
|
90
99
|
}, [
|
|
91
100
|
x,
|
|
92
101
|
D,
|
|
93
|
-
|
|
94
|
-
]), [
|
|
102
|
+
P
|
|
103
|
+
]), [Qe] = ge(`schema.flat.${v}.attributes.input`, { mode: "mount" });
|
|
95
104
|
le({
|
|
96
105
|
enabled: x && S,
|
|
97
|
-
input:
|
|
98
|
-
savedInput:
|
|
99
|
-
performQuery:
|
|
106
|
+
input: Ie,
|
|
107
|
+
savedInput: Qe,
|
|
108
|
+
performQuery: W
|
|
100
109
|
}), ce({
|
|
101
|
-
seconds:
|
|
102
|
-
enabled: y && (x ? S && !
|
|
103
|
-
refresh:
|
|
110
|
+
seconds: Ne,
|
|
111
|
+
enabled: y && (x ? S && !F : N),
|
|
112
|
+
refresh: Ze
|
|
104
113
|
});
|
|
105
|
-
let
|
|
114
|
+
let K = R, $e = i(() => Array.isArray(K.records) ? K.records : [], [K.records]), { records: q, isLoadingMore: J, goToPage: Y, loadMore: et } = ue({
|
|
106
115
|
elementId: v,
|
|
107
|
-
mode:
|
|
108
|
-
pageParam:
|
|
109
|
-
records:
|
|
110
|
-
page:
|
|
111
|
-
refresh:
|
|
112
|
-
navigate:
|
|
116
|
+
mode: De,
|
|
117
|
+
pageParam: Oe,
|
|
118
|
+
records: $e,
|
|
119
|
+
page: K.pageInfo?.page ?? 1,
|
|
120
|
+
refresh: Xe,
|
|
121
|
+
navigate: Ve
|
|
113
122
|
}), X = ie({
|
|
114
123
|
serverMode: x,
|
|
115
|
-
isSuccess:
|
|
116
|
-
isError:
|
|
124
|
+
isSuccess: Je,
|
|
125
|
+
isError: Ye,
|
|
117
126
|
rscResolved: S,
|
|
118
|
-
rscPending:
|
|
127
|
+
rscPending: F,
|
|
119
128
|
elementData: T
|
|
120
129
|
}), Z = a(void 0);
|
|
121
130
|
me(() => {
|
|
122
|
-
!
|
|
123
|
-
data:
|
|
131
|
+
!z && v && X && (Z.current?.data !== R || Z.current.outcome !== X) && (Z.current = {
|
|
132
|
+
data: R,
|
|
124
133
|
outcome: X
|
|
125
134
|
}, A.interactionTrigger(v, X === "success" ? "onApiSuccess" : "onApiError", {
|
|
126
135
|
url: u,
|
|
127
136
|
method: d,
|
|
128
|
-
...
|
|
137
|
+
...R
|
|
129
138
|
}));
|
|
130
139
|
}, [
|
|
131
|
-
|
|
140
|
+
R,
|
|
132
141
|
v,
|
|
133
142
|
A,
|
|
134
|
-
|
|
143
|
+
z,
|
|
135
144
|
d,
|
|
136
145
|
X,
|
|
137
146
|
u
|
|
138
147
|
]);
|
|
139
148
|
let Q = i(() => ({
|
|
140
|
-
...
|
|
141
|
-
...Array.isArray(
|
|
142
|
-
isLoading:
|
|
143
|
-
isEmpty: ne(
|
|
144
|
-
hasError:
|
|
145
|
-
errorMessage:
|
|
149
|
+
...R,
|
|
150
|
+
...Array.isArray(K.records) ? { records: q } : o,
|
|
151
|
+
isLoading: z || J,
|
|
152
|
+
isEmpty: ne(K, q, g),
|
|
153
|
+
hasError: I,
|
|
154
|
+
errorMessage: I ? "The data provider could not be reached" : "",
|
|
146
155
|
isStale: x && C
|
|
147
156
|
}), [
|
|
148
|
-
B,
|
|
149
|
-
J.records,
|
|
150
|
-
J.record,
|
|
151
|
-
Y,
|
|
152
|
-
V,
|
|
153
|
-
Ye,
|
|
154
|
-
g,
|
|
155
157
|
R,
|
|
158
|
+
K.records,
|
|
159
|
+
K.record,
|
|
160
|
+
q,
|
|
161
|
+
z,
|
|
162
|
+
J,
|
|
163
|
+
g,
|
|
164
|
+
I,
|
|
156
165
|
x,
|
|
157
166
|
C
|
|
158
|
-
]),
|
|
167
|
+
]), tt = r(() => fe(Q), [Q]);
|
|
159
168
|
Se({
|
|
160
169
|
id: v,
|
|
161
170
|
source: O,
|
|
162
171
|
name: b || `API - ${v}`,
|
|
163
|
-
fields:
|
|
172
|
+
fields: tt
|
|
164
173
|
});
|
|
165
174
|
let { writeRecord: $ } = de({
|
|
166
175
|
elementId: v,
|
|
167
176
|
enabled: x,
|
|
168
|
-
onDone:
|
|
169
|
-
}),
|
|
177
|
+
onDone: U
|
|
178
|
+
}), nt = i(() => {
|
|
170
179
|
let e = {
|
|
171
180
|
performQuery: {
|
|
172
181
|
...n.callbacks.performQuery,
|
|
173
182
|
title: `Perform Query ${b}`,
|
|
174
|
-
callback:
|
|
183
|
+
callback: W
|
|
175
184
|
},
|
|
176
185
|
cancelQuery: {
|
|
177
186
|
...n.callbacks.cancelQuery,
|
|
178
187
|
title: `Cancel Query ${b}`,
|
|
179
|
-
callback:
|
|
188
|
+
callback: G
|
|
180
189
|
},
|
|
181
190
|
loadMore: {
|
|
182
191
|
...n.callbacks.loadMore,
|
|
183
192
|
title: `Load More ${b}`,
|
|
184
|
-
callback:
|
|
193
|
+
callback: et
|
|
185
194
|
},
|
|
186
195
|
goToPage: {
|
|
187
196
|
...n.callbacks.goToPage,
|
|
188
197
|
title: `Go To Page ${b}`,
|
|
189
|
-
callback: ({ page: e }) =>
|
|
198
|
+
callback: ({ page: e }) => Y(Number(e) || 1)
|
|
190
199
|
}
|
|
191
200
|
};
|
|
192
201
|
return x && (e.writeRecord = {
|
|
@@ -196,29 +205,29 @@ var c = ({ ref: e, className: c = "", children: l, query: u = "", method: d = "g
|
|
|
196
205
|
}), e;
|
|
197
206
|
}, [
|
|
198
207
|
b,
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
208
|
+
W,
|
|
209
|
+
G,
|
|
210
|
+
et,
|
|
211
|
+
Y,
|
|
203
212
|
x,
|
|
204
213
|
$
|
|
205
|
-
]),
|
|
214
|
+
]), rt = i(() => _ && k ? re(l, _, B) : l, [
|
|
206
215
|
l,
|
|
207
|
-
|
|
216
|
+
B,
|
|
208
217
|
_,
|
|
209
218
|
k
|
|
210
|
-
]),
|
|
219
|
+
]), it = i(() => O ? { runtime: { sources: { [O]: Q } } } : o, [Q, O]);
|
|
211
220
|
return /* @__PURE__ */ s(te, {
|
|
212
221
|
ref: e,
|
|
213
|
-
tag: !k && !
|
|
222
|
+
tag: !k && !Re?.length ? "div" : Te,
|
|
214
223
|
className: be("plitzi-component__api-container", c),
|
|
215
224
|
interactionTriggers: n.triggers,
|
|
216
|
-
interactionCallbacks:
|
|
217
|
-
children: (!
|
|
225
|
+
interactionCallbacks: nt,
|
|
226
|
+
children: (!B || ke || _) && /* @__PURE__ */ s(ve, {
|
|
218
227
|
inherit: "live",
|
|
219
228
|
name: `Api:${v}`,
|
|
220
|
-
value:
|
|
221
|
-
children:
|
|
229
|
+
value: it,
|
|
230
|
+
children: rt
|
|
222
231
|
})
|
|
223
232
|
});
|
|
224
233
|
}, l = e(c);
|