@ebertjendustries/cswrapper 1.0.14 → 1.0.16
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 +3 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +15 -3
- package/dist/index.mjs +15 -3
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -296,6 +296,7 @@ interface CSReadOnlyFormProps {
|
|
|
296
296
|
* this with the localiser prop.
|
|
297
297
|
*/
|
|
298
298
|
formField?: FormFieldProps;
|
|
299
|
+
secondaryControl?: React.ReactNode;
|
|
299
300
|
customRef?: any;
|
|
300
301
|
}
|
|
301
302
|
/**
|
|
@@ -677,7 +678,8 @@ interface CSToggleProps extends CSFormProps, ToggleProps {
|
|
|
677
678
|
*/
|
|
678
679
|
declare function CSToggle(props: CSToggleProps): react_jsx_runtime.JSX.Element;
|
|
679
680
|
|
|
680
|
-
interface CSCopyToClipboardProps extends CSReadOnlyFormProps, CopyToClipboardProps {
|
|
681
|
+
interface CSCopyToClipboardProps extends CSReadOnlyFormProps, Partial<CopyToClipboardProps> {
|
|
682
|
+
textToCopy: string;
|
|
681
683
|
}
|
|
682
684
|
/**
|
|
683
685
|
* Represents a {@link CopyToClipboard} with extra features.
|
package/dist/index.d.ts
CHANGED
|
@@ -296,6 +296,7 @@ interface CSReadOnlyFormProps {
|
|
|
296
296
|
* this with the localiser prop.
|
|
297
297
|
*/
|
|
298
298
|
formField?: FormFieldProps;
|
|
299
|
+
secondaryControl?: React.ReactNode;
|
|
299
300
|
customRef?: any;
|
|
300
301
|
}
|
|
301
302
|
/**
|
|
@@ -677,7 +678,8 @@ interface CSToggleProps extends CSFormProps, ToggleProps {
|
|
|
677
678
|
*/
|
|
678
679
|
declare function CSToggle(props: CSToggleProps): react_jsx_runtime.JSX.Element;
|
|
679
680
|
|
|
680
|
-
interface CSCopyToClipboardProps extends CSReadOnlyFormProps, CopyToClipboardProps {
|
|
681
|
+
interface CSCopyToClipboardProps extends CSReadOnlyFormProps, Partial<CopyToClipboardProps> {
|
|
682
|
+
textToCopy: string;
|
|
681
683
|
}
|
|
682
684
|
/**
|
|
683
685
|
* Represents a {@link CopyToClipboard} with extra features.
|
package/dist/index.js
CHANGED
|
@@ -121,7 +121,7 @@ FromPropsHelper.getBasicProps = (props) => {
|
|
|
121
121
|
};
|
|
122
122
|
FromPropsHelper.usesFormField = (props) => {
|
|
123
123
|
const localisation = props.localiser.localiseField(props.fieldSpec.getLocalisationKey(), props.localisationVariables, props.alternateNs);
|
|
124
|
-
return props.formField !== void 0 || (localisation == null ? void 0 : localisation.formField) !== void 0;
|
|
124
|
+
return props.formField !== void 0 || (localisation == null ? void 0 : localisation.formField) !== void 0 || props.secondaryControl !== void 0;
|
|
125
125
|
};
|
|
126
126
|
FromPropsHelper.getLocalisedErrorText = (props, value, localiseValidity) => {
|
|
127
127
|
var _a, _b;
|
|
@@ -153,7 +153,16 @@ function CSFormField(props) {
|
|
|
153
153
|
if (!FromPropsHelper.usesFormField(props)) {
|
|
154
154
|
return props.children;
|
|
155
155
|
}
|
|
156
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
156
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
157
|
+
import_components.FormField,
|
|
158
|
+
{
|
|
159
|
+
"data-testid": formFieldId,
|
|
160
|
+
...localisationObject == null ? void 0 : localisationObject.formField,
|
|
161
|
+
...props.formField,
|
|
162
|
+
secondaryControl: props.secondaryControl,
|
|
163
|
+
children: props.children
|
|
164
|
+
}
|
|
165
|
+
);
|
|
157
166
|
}
|
|
158
167
|
|
|
159
168
|
// src/components/ChildUtils.tsx
|
|
@@ -656,8 +665,8 @@ function CSTextarea(props) {
|
|
|
656
665
|
"data-testid": uniqueId,
|
|
657
666
|
controlId: uniqueId,
|
|
658
667
|
onChange: ({ detail }) => props.onChangeValue(props.fieldSpec.key, detail.value),
|
|
659
|
-
...props,
|
|
660
668
|
...localisationObject,
|
|
669
|
+
...props,
|
|
661
670
|
value: sanitizedValue
|
|
662
671
|
}
|
|
663
672
|
) });
|
|
@@ -708,6 +717,7 @@ function CSToggle(props) {
|
|
|
708
717
|
var import_components20 = require("@cloudscape-design/components");
|
|
709
718
|
var import_jsx_runtime24 = require("react/jsx-runtime");
|
|
710
719
|
function CSCopyToClipboard(props) {
|
|
720
|
+
var _a, _b;
|
|
711
721
|
const { localisationObject, uniqueId } = FromPropsHelper.getBasicProps(props);
|
|
712
722
|
const { formProps } = ChildUtils.getChildren(props, localisationObject);
|
|
713
723
|
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(CSFormField, { ...formProps, children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
@@ -715,6 +725,8 @@ function CSCopyToClipboard(props) {
|
|
|
715
725
|
{
|
|
716
726
|
"data-testid": uniqueId,
|
|
717
727
|
...props,
|
|
728
|
+
copySuccessText: (_a = props.copySuccessText) != null ? _a : "",
|
|
729
|
+
copyErrorText: (_b = props.copyErrorText) != null ? _b : "",
|
|
718
730
|
...localisationObject
|
|
719
731
|
}
|
|
720
732
|
) });
|
package/dist/index.mjs
CHANGED
|
@@ -11,7 +11,7 @@ FromPropsHelper.getBasicProps = (props) => {
|
|
|
11
11
|
};
|
|
12
12
|
FromPropsHelper.usesFormField = (props) => {
|
|
13
13
|
const localisation = props.localiser.localiseField(props.fieldSpec.getLocalisationKey(), props.localisationVariables, props.alternateNs);
|
|
14
|
-
return props.formField !== void 0 || (localisation == null ? void 0 : localisation.formField) !== void 0;
|
|
14
|
+
return props.formField !== void 0 || (localisation == null ? void 0 : localisation.formField) !== void 0 || props.secondaryControl !== void 0;
|
|
15
15
|
};
|
|
16
16
|
FromPropsHelper.getLocalisedErrorText = (props, value, localiseValidity) => {
|
|
17
17
|
var _a, _b;
|
|
@@ -42,7 +42,16 @@ function CSFormField(props) {
|
|
|
42
42
|
// IMPORTANT: Order of props determines which one "wins". You can override Elements that are present in the
|
|
43
43
|
// localisation texts via the additional props. For instance, you can pass in
|
|
44
44
|
// non-static localisations that require variable values dynamically.
|
|
45
|
-
/* @__PURE__ */ jsx(
|
|
45
|
+
/* @__PURE__ */ jsx(
|
|
46
|
+
FormField,
|
|
47
|
+
{
|
|
48
|
+
"data-testid": formFieldId,
|
|
49
|
+
...localisationObject == null ? void 0 : localisationObject.formField,
|
|
50
|
+
...props.formField,
|
|
51
|
+
secondaryControl: props.secondaryControl,
|
|
52
|
+
children: props.children
|
|
53
|
+
}
|
|
54
|
+
)
|
|
46
55
|
);
|
|
47
56
|
}
|
|
48
57
|
|
|
@@ -546,8 +555,8 @@ function CSTextarea(props) {
|
|
|
546
555
|
"data-testid": uniqueId,
|
|
547
556
|
controlId: uniqueId,
|
|
548
557
|
onChange: ({ detail }) => props.onChangeValue(props.fieldSpec.key, detail.value),
|
|
549
|
-
...props,
|
|
550
558
|
...localisationObject,
|
|
559
|
+
...props,
|
|
551
560
|
value: sanitizedValue
|
|
552
561
|
}
|
|
553
562
|
) });
|
|
@@ -598,6 +607,7 @@ function CSToggle(props) {
|
|
|
598
607
|
import { CopyToClipboard } from "@cloudscape-design/components";
|
|
599
608
|
import { jsx as jsx24 } from "react/jsx-runtime";
|
|
600
609
|
function CSCopyToClipboard(props) {
|
|
610
|
+
var _a, _b;
|
|
601
611
|
const { localisationObject, uniqueId } = FromPropsHelper.getBasicProps(props);
|
|
602
612
|
const { formProps } = ChildUtils.getChildren(props, localisationObject);
|
|
603
613
|
return /* @__PURE__ */ jsx24(CSFormField, { ...formProps, children: /* @__PURE__ */ jsx24(
|
|
@@ -605,6 +615,8 @@ function CSCopyToClipboard(props) {
|
|
|
605
615
|
{
|
|
606
616
|
"data-testid": uniqueId,
|
|
607
617
|
...props,
|
|
618
|
+
copySuccessText: (_a = props.copySuccessText) != null ? _a : "",
|
|
619
|
+
copyErrorText: (_b = props.copyErrorText) != null ? _b : "",
|
|
608
620
|
...localisationObject
|
|
609
621
|
}
|
|
610
622
|
) });
|