@saasquatch/mint-components 2.1.8-2 → 2.1.8-3
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/cjs/{ShadowViewAddon-a26deae6.js → ShadowViewAddon-3384ddc4.js} +376 -10
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/mint-components.cjs.js +1 -1
- package/dist/cjs/sqm-banking-info-form_10.cjs.entry.js +4 -4
- package/dist/cjs/sqm-big-stat_45.cjs.entry.js +175 -31
- package/dist/cjs/sqm-stencilbook.cjs.entry.js +168 -19
- package/dist/collection/components/sqm-referral-iframe/ReferralIframe.stories.js +0 -1
- package/dist/collection/components/sqm-referral-iframe/sqm-referral-iframe-view.js +1 -1
- package/dist/collection/components/sqm-referral-iframe/sqm-referral-iframe.js +1 -27
- package/dist/collection/components/sqm-share-code/sqm-share-code.js +0 -1
- package/dist/collection/components/sqm-share-link/ShareLink.stories.js +142 -11
- package/dist/collection/components/sqm-share-link/UseShareLink.stories.js +14 -5
- package/dist/collection/components/sqm-share-link/sqm-share-link-view.js +173 -0
- package/dist/collection/components/sqm-share-link/sqm-share-link.js +536 -26
- package/dist/collection/components/sqm-share-link/useShareLink.js +200 -5
- package/dist/collection/components/tax-and-cash/sqm-indirect-tax-form/sqm-indirect-tax-form.js +4 -4
- package/dist/collection/components/tax-and-cash/sqm-payout-details-card/sqm-payout-details-card.js +2 -2
- package/dist/collection/components/tax-and-cash/sqm-tax-and-cash/sqm-tax-and-cash.js +6 -6
- package/dist/collection/components/tax-and-cash/sqm-tax-and-cash-dashboard/sqm-tax-and-cash-dashboard.js +2 -2
- package/dist/esm/{ShadowViewAddon-47f1e579.js → ShadowViewAddon-c2f026c0.js} +377 -12
- package/dist/esm/loader.js +1 -1
- package/dist/esm/mint-components.js +1 -1
- package/dist/esm/sqm-banking-info-form_10.entry.js +4 -4
- package/dist/esm/sqm-big-stat_45.entry.js +175 -31
- package/dist/esm/sqm-stencilbook.entry.js +168 -19
- package/dist/esm-es5/ShadowViewAddon-c2f026c0.js +1 -0
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/mint-components.js +1 -1
- package/dist/esm-es5/sqm-banking-info-form_10.entry.js +1 -1
- package/dist/esm-es5/sqm-big-stat_45.entry.js +1 -1
- package/dist/esm-es5/sqm-stencilbook.entry.js +1 -1
- package/dist/mint-components/mint-components.esm.js +1 -1
- package/dist/mint-components/p-1ebdb2b3.js +500 -0
- package/dist/mint-components/p-87fb29a9.system.js +1 -0
- package/dist/mint-components/p-a01baeea.entry.js +9 -0
- package/dist/mint-components/p-ca098be1.system.js +1 -1
- package/dist/mint-components/{p-5492dd51.system.entry.js → p-cacb897d.system.entry.js} +1 -1
- package/dist/mint-components/{p-7ee8f2ed.entry.js → p-debc2b08.entry.js} +20 -20
- package/dist/mint-components/p-ea4cd12c.system.entry.js +1 -0
- package/dist/mint-components/p-f865d476.system.entry.js +1 -0
- package/dist/mint-components/{p-d4f332a7.entry.js → p-ff378015.entry.js} +7 -7
- package/dist/types/components/sqm-referral-iframe/sqm-referral-iframe-view.d.ts +0 -1
- package/dist/types/components/sqm-referral-iframe/sqm-referral-iframe.d.ts +0 -5
- package/dist/types/components/sqm-share-link/ShareLink.stories.d.ts +10 -0
- package/dist/types/components/sqm-share-link/UseShareLink.stories.d.ts +6 -0
- package/dist/types/components/sqm-share-link/sqm-share-link-view.d.ts +37 -0
- package/dist/types/components/sqm-share-link/sqm-share-link.d.ts +107 -2
- package/dist/types/components/sqm-share-link/useShareLink.d.ts +27 -4
- package/dist/types/components.d.ts +183 -12
- package/docs/docs.docx +0 -0
- package/docs/raisins.json +1 -1
- package/grapesjs/grapesjs.js +1 -1
- package/package.json +1 -1
- package/dist/esm-es5/ShadowViewAddon-47f1e579.js +0 -1
- package/dist/mint-components/p-0614dcbc.entry.js +0 -9
- package/dist/mint-components/p-217dedde.js +0 -463
- package/dist/mint-components/p-bf545082.system.entry.js +0 -1
- package/dist/mint-components/p-ce050888.system.js +0 -1
- package/dist/mint-components/p-de343dd0.system.entry.js +0 -1
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { h } from "@stencil/core";
|
|
2
2
|
import { CopyTextView } from "../views/copy-text-view";
|
|
3
|
+
import { ShareLinkView } from "./sqm-share-link-view";
|
|
3
4
|
import scenario from "./ShareLink.feature";
|
|
4
5
|
export default {
|
|
5
6
|
title: "Components/Share Link",
|
|
@@ -77,18 +78,148 @@ export const CustomStyles = () => {
|
|
|
77
78
|
return h(CopyTextView, Object.assign({}, props));
|
|
78
79
|
};
|
|
79
80
|
export const CustomStylesWithDemoHooks = () => {
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
81
|
+
return (h("sqm-share-link", { demoData: {
|
|
82
|
+
copyTextViewProps: {
|
|
83
|
+
copyString: "https://noah.example.com",
|
|
84
|
+
open: false,
|
|
85
|
+
tooltiptext: "Copied!",
|
|
86
|
+
backgroundColor: "#1ed760",
|
|
87
|
+
borderRadius: "30px",
|
|
88
|
+
textColor: "red",
|
|
89
|
+
buttonType: "primary",
|
|
90
|
+
borderColor: "#121212",
|
|
91
|
+
},
|
|
92
|
+
}, backgroundColor: "#1ed760" }));
|
|
91
93
|
};
|
|
92
94
|
export const FullStack = () => {
|
|
93
95
|
return h("sqm-share-link", null);
|
|
94
96
|
};
|
|
97
|
+
// Customize URL stories
|
|
98
|
+
const noopFn = () => { };
|
|
99
|
+
const defaultCustomizeProps = {
|
|
100
|
+
copyTextViewProps: {
|
|
101
|
+
copyString: "https://ssqt.co/abc123",
|
|
102
|
+
open: false,
|
|
103
|
+
tooltiptext: "Copied!",
|
|
104
|
+
},
|
|
105
|
+
customizeUrl: true,
|
|
106
|
+
customizeLinkLabel: "Customize Link",
|
|
107
|
+
saveLabelText: "Save",
|
|
108
|
+
cancelLabelText: "Cancel",
|
|
109
|
+
successMessage: "Link updated successfully",
|
|
110
|
+
isEditing: false,
|
|
111
|
+
editValue: "",
|
|
112
|
+
domainPrefix: "https://ssqt.co/",
|
|
113
|
+
editsRemaining: 3,
|
|
114
|
+
maxEdits: 5,
|
|
115
|
+
limitReached: false,
|
|
116
|
+
validationError: null,
|
|
117
|
+
isValidating: false,
|
|
118
|
+
isSaving: false,
|
|
119
|
+
showSuccess: false,
|
|
120
|
+
characterLimit: 15,
|
|
121
|
+
charactersRemaining: 15,
|
|
122
|
+
editLimitText: "You can edit your link up to 5 times.",
|
|
123
|
+
editLimitReachedText: "5 edit limit reached. To make more changes, please contact {supportLink}.",
|
|
124
|
+
supportLinkText: "Support",
|
|
125
|
+
customizeDisabled: false,
|
|
126
|
+
customizeDisabledTooltip: "Link customization is not available.",
|
|
127
|
+
onCustomizeClick: noopFn,
|
|
128
|
+
onEditValueChange: noopFn,
|
|
129
|
+
onSave: noopFn,
|
|
130
|
+
onCancel: noopFn,
|
|
131
|
+
};
|
|
132
|
+
export const CustomizeUrlDefault = () => {
|
|
133
|
+
return h(ShareLinkView, Object.assign({}, defaultCustomizeProps));
|
|
134
|
+
};
|
|
135
|
+
export const CustomizeUrlEditing = () => {
|
|
136
|
+
return (h(ShareLinkView, Object.assign({}, {
|
|
137
|
+
...defaultCustomizeProps,
|
|
138
|
+
isEditing: true,
|
|
139
|
+
editValue: "nvoiwb18",
|
|
140
|
+
charactersRemaining: 7,
|
|
141
|
+
})));
|
|
142
|
+
};
|
|
143
|
+
export const CustomizeUrlCustomized = () => {
|
|
144
|
+
return (h(ShareLinkView, Object.assign({}, {
|
|
145
|
+
...defaultCustomizeProps,
|
|
146
|
+
copyTextViewProps: {
|
|
147
|
+
...defaultCustomizeProps.copyTextViewProps,
|
|
148
|
+
copyString: "https://ssqt.co/bobtesterson",
|
|
149
|
+
},
|
|
150
|
+
})));
|
|
151
|
+
};
|
|
152
|
+
export const CustomizeUrlLimitReached = () => {
|
|
153
|
+
return (h(ShareLinkView, Object.assign({}, {
|
|
154
|
+
...defaultCustomizeProps,
|
|
155
|
+
copyTextViewProps: {
|
|
156
|
+
...defaultCustomizeProps.copyTextViewProps,
|
|
157
|
+
copyString: "https://ssqt.co/bobtesterson",
|
|
158
|
+
},
|
|
159
|
+
editsRemaining: 0,
|
|
160
|
+
limitReached: true,
|
|
161
|
+
})));
|
|
162
|
+
};
|
|
163
|
+
export const CustomizeUrlDisabled = () => {
|
|
164
|
+
return (h(ShareLinkView, Object.assign({}, {
|
|
165
|
+
...defaultCustomizeProps,
|
|
166
|
+
customizeDisabled: true,
|
|
167
|
+
})));
|
|
168
|
+
};
|
|
169
|
+
export const CustomizeUrlValidationError = () => {
|
|
170
|
+
return (h(ShareLinkView, Object.assign({}, {
|
|
171
|
+
...defaultCustomizeProps,
|
|
172
|
+
isEditing: true,
|
|
173
|
+
editValue: "nvoiwb18",
|
|
174
|
+
charactersRemaining: 7,
|
|
175
|
+
validationError: {
|
|
176
|
+
code: "LINK_TAKEN",
|
|
177
|
+
title: "This link is already taken",
|
|
178
|
+
description: "Try adding numbers, a dash or underscore to create a unique link.",
|
|
179
|
+
},
|
|
180
|
+
})));
|
|
181
|
+
};
|
|
182
|
+
export const CustomizeUrlInvalidSymbols = () => {
|
|
183
|
+
return (h(ShareLinkView, Object.assign({}, {
|
|
184
|
+
...defaultCustomizeProps,
|
|
185
|
+
isEditing: true,
|
|
186
|
+
editValue: "nvoiwb18",
|
|
187
|
+
charactersRemaining: 7,
|
|
188
|
+
validationError: {
|
|
189
|
+
code: "INVALID_SYMBOLS",
|
|
190
|
+
title: "Please use only letters, numbers, dashes and underscores",
|
|
191
|
+
description: "Special symbols can break the link when sharing.",
|
|
192
|
+
},
|
|
193
|
+
})));
|
|
194
|
+
};
|
|
195
|
+
export const CustomizeUrlRestrictedWord = () => {
|
|
196
|
+
return (h(ShareLinkView, Object.assign({}, {
|
|
197
|
+
...defaultCustomizeProps,
|
|
198
|
+
isEditing: true,
|
|
199
|
+
editValue: "nvoiwb18",
|
|
200
|
+
charactersRemaining: 7,
|
|
201
|
+
validationError: {
|
|
202
|
+
code: "RESTRICTED_WORD",
|
|
203
|
+
title: "Please try a different link",
|
|
204
|
+
description: "This link contains a restricted word.",
|
|
205
|
+
},
|
|
206
|
+
})));
|
|
207
|
+
};
|
|
208
|
+
export const CustomizeUrlSaving = () => {
|
|
209
|
+
return (h(ShareLinkView, Object.assign({}, {
|
|
210
|
+
...defaultCustomizeProps,
|
|
211
|
+
isEditing: true,
|
|
212
|
+
editValue: "bobtesterson",
|
|
213
|
+
isSaving: true,
|
|
214
|
+
})));
|
|
215
|
+
};
|
|
216
|
+
export const CustomizeUrlSuccess = () => {
|
|
217
|
+
return (h(ShareLinkView, Object.assign({}, {
|
|
218
|
+
...defaultCustomizeProps,
|
|
219
|
+
copyTextViewProps: {
|
|
220
|
+
...defaultCustomizeProps.copyTextViewProps,
|
|
221
|
+
copyString: "https://ssqt.co/bobtesterson",
|
|
222
|
+
},
|
|
223
|
+
showSuccess: true,
|
|
224
|
+
})));
|
|
225
|
+
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { setUserIdentity } from "@saasquatch/component-boilerplate";
|
|
2
2
|
import { useEffect } from "@saasquatch/universal-hooks";
|
|
3
3
|
import { h } from "@stencil/core";
|
|
4
|
-
import {
|
|
4
|
+
import { ShareLinkView } from "./sqm-share-link-view";
|
|
5
5
|
import { useShareLink } from "./useShareLink";
|
|
6
6
|
import { createHookStory } from "../sqm-stencilbook/HookStoryAddon";
|
|
7
7
|
export default {
|
|
@@ -39,11 +39,11 @@ export const BareBonesView = createHookStory(() => {
|
|
|
39
39
|
return (h("div", null,
|
|
40
40
|
"Sharelink:",
|
|
41
41
|
" ",
|
|
42
|
-
h("code", { style: { borderStyle: "solid", borderWidth: "1px", padding: "2px" } }, res.copyString)));
|
|
42
|
+
h("code", { style: { borderStyle: "solid", borderWidth: "1px", padding: "2px" } }, res.copyTextViewProps.copyString)));
|
|
43
43
|
});
|
|
44
44
|
export const RegularView = createHookStory(() => {
|
|
45
45
|
setupGraphQL();
|
|
46
|
-
return (h(
|
|
46
|
+
return (h(ShareLinkView, Object.assign({}, useShareLink({
|
|
47
47
|
programId: "klip-referral-program",
|
|
48
48
|
tooltiptext: "Copied to clipboard",
|
|
49
49
|
tooltiplifespan: 1000,
|
|
@@ -51,9 +51,18 @@ export const RegularView = createHookStory(() => {
|
|
|
51
51
|
});
|
|
52
52
|
export const FastTooltip = createHookStory(() => {
|
|
53
53
|
setupGraphQL();
|
|
54
|
-
return (h(
|
|
54
|
+
return (h(ShareLinkView, Object.assign({}, useShareLink({
|
|
55
55
|
programId: "klip-referral-program",
|
|
56
|
-
tooltiptext: "
|
|
56
|
+
tooltiptext: "Copied to clipboard",
|
|
57
57
|
tooltiplifespan: 500,
|
|
58
58
|
}))));
|
|
59
59
|
});
|
|
60
|
+
export const CustomizeUrlEnabled = createHookStory(() => {
|
|
61
|
+
setupGraphQL();
|
|
62
|
+
return (h(ShareLinkView, Object.assign({}, useShareLink({
|
|
63
|
+
programId: "klip-referral-program",
|
|
64
|
+
tooltiptext: "Copied to clipboard",
|
|
65
|
+
tooltiplifespan: 1000,
|
|
66
|
+
customizeUrl: true,
|
|
67
|
+
}))));
|
|
68
|
+
});
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
import { h } from "@stencil/core";
|
|
2
|
+
import { intl } from "../../global/global";
|
|
3
|
+
import { createStyleSheet } from "../../styling/JSS";
|
|
4
|
+
import { CopyTextView } from "../views/copy-text-view";
|
|
5
|
+
const vanillaStyle = `
|
|
6
|
+
:host {
|
|
7
|
+
display: block;
|
|
8
|
+
width: 100%;
|
|
9
|
+
}
|
|
10
|
+
`;
|
|
11
|
+
export function ShareLinkView(props) {
|
|
12
|
+
const { copyTextViewProps, customizeUrl, customizeLinkLabel, saveLabelText, cancelLabelText, successMessage, isEditing, editValue, domainPrefix, editsRemaining, maxEdits, limitReached, validationError, isValidating, isSaving, showSuccess, characterLimit, charactersRemaining, editLimitText, editLimitReachedText, supportLinkText, customizeDisabled, customizeDisabledTooltip, onCustomizeClick, onEditValueChange, onSave, onCancel, } = props;
|
|
13
|
+
const style = {
|
|
14
|
+
Container: {
|
|
15
|
+
display: "flex",
|
|
16
|
+
flexDirection: "column",
|
|
17
|
+
gap: "var(--sl-spacing-x-small)",
|
|
18
|
+
width: "100%",
|
|
19
|
+
},
|
|
20
|
+
CustomizeLinkText: {
|
|
21
|
+
margin: "0",
|
|
22
|
+
fontSize: "var(--sl-font-size-small)",
|
|
23
|
+
fontWeight: "600",
|
|
24
|
+
cursor: "pointer",
|
|
25
|
+
color: "var(--sl-color-neutral-900)",
|
|
26
|
+
textAlign: "left",
|
|
27
|
+
"&:hover": {
|
|
28
|
+
textDecoration: "underline",
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
CustomizeLinkDisabled: {
|
|
32
|
+
margin: "0",
|
|
33
|
+
fontSize: "var(--sl-font-size-small)",
|
|
34
|
+
fontWeight: "600",
|
|
35
|
+
color: "var(--sl-color-neutral-400)",
|
|
36
|
+
cursor: "default",
|
|
37
|
+
textAlign: "left",
|
|
38
|
+
},
|
|
39
|
+
EditContainer: {
|
|
40
|
+
display: "flex",
|
|
41
|
+
flexDirection: "column",
|
|
42
|
+
gap: "var(--sl-spacing-x-small)",
|
|
43
|
+
width: "100%",
|
|
44
|
+
},
|
|
45
|
+
EditInputWrapper: {
|
|
46
|
+
display: "flex",
|
|
47
|
+
alignItems: "center",
|
|
48
|
+
width: "100%",
|
|
49
|
+
border: "var(--sqm-border-thickness, 1px) solid var(--sqm-input-border-color, #d1d5db)",
|
|
50
|
+
borderRadius: "var(--sqm-border-radius-normal, 4px)",
|
|
51
|
+
background: "var(--sqm-input-background, #fff)",
|
|
52
|
+
overflow: "hidden",
|
|
53
|
+
"&:focus-within": {
|
|
54
|
+
borderColor: "#999999",
|
|
55
|
+
boxShadow: "0 0 0 var(--sl-focus-ring-width) var(--sl-input-focus-ring-color)",
|
|
56
|
+
},
|
|
57
|
+
},
|
|
58
|
+
DomainPrefix: {
|
|
59
|
+
padding: "0 0 0 var(--sl-spacing-medium)",
|
|
60
|
+
fontSize: "var(--sl-font-size-medium)",
|
|
61
|
+
color: "var(--sl-color-neutral-500)",
|
|
62
|
+
whiteSpace: "nowrap",
|
|
63
|
+
userSelect: "none",
|
|
64
|
+
lineHeight: "var(--sl-input-height-medium)",
|
|
65
|
+
},
|
|
66
|
+
EditInput: {
|
|
67
|
+
flex: "1",
|
|
68
|
+
border: "none",
|
|
69
|
+
outline: "none",
|
|
70
|
+
padding: "0 var(--sl-spacing-medium) 0 0",
|
|
71
|
+
fontSize: "var(--sl-font-size-medium)",
|
|
72
|
+
fontFamily: "var(--sl-font-sans)",
|
|
73
|
+
color: "var(--sl-input-color)",
|
|
74
|
+
background: "transparent",
|
|
75
|
+
lineHeight: "var(--sl-input-height-medium)",
|
|
76
|
+
minWidth: "0",
|
|
77
|
+
},
|
|
78
|
+
EditLabel: {
|
|
79
|
+
margin: "0",
|
|
80
|
+
fontSize: "var(--sl-font-size-small)",
|
|
81
|
+
color: "var(--sl-color-neutral-500)",
|
|
82
|
+
},
|
|
83
|
+
HelperText: {
|
|
84
|
+
margin: "0",
|
|
85
|
+
fontSize: "var(--sl-font-size-small)",
|
|
86
|
+
color: "var(--sl-color-neutral-500)",
|
|
87
|
+
},
|
|
88
|
+
ErrorText: {
|
|
89
|
+
margin: "0",
|
|
90
|
+
fontSize: "var(--sl-font-size-small)",
|
|
91
|
+
color: "var(--sqm-danger-color-text, #dc2626)",
|
|
92
|
+
},
|
|
93
|
+
SuccessText: {
|
|
94
|
+
margin: "0",
|
|
95
|
+
fontSize: "var(--sl-font-size-small)",
|
|
96
|
+
color: "var(--sl-color-success-600, #16a34a)",
|
|
97
|
+
},
|
|
98
|
+
ActionRow: {
|
|
99
|
+
display: "flex",
|
|
100
|
+
gap: "var(--sl-spacing-medium)",
|
|
101
|
+
alignItems: "center",
|
|
102
|
+
},
|
|
103
|
+
SaveButton: {
|
|
104
|
+
cursor: "pointer",
|
|
105
|
+
fontFamily: "var(--sl-font-sans)",
|
|
106
|
+
fontSize: "var(--sl-font-size-small)",
|
|
107
|
+
fontWeight: "600",
|
|
108
|
+
padding: "var(--sl-spacing-x-small) var(--sl-spacing-medium)",
|
|
109
|
+
borderRadius: "var(--sqm-border-radius-normal, 4px)",
|
|
110
|
+
border: "1px solid var(--sl-color-neutral-900)",
|
|
111
|
+
background: "var(--sl-color-neutral-900)",
|
|
112
|
+
color: "#fff",
|
|
113
|
+
"&:disabled": {
|
|
114
|
+
opacity: "0.5",
|
|
115
|
+
cursor: "default",
|
|
116
|
+
},
|
|
117
|
+
},
|
|
118
|
+
CancelButton: {
|
|
119
|
+
margin: "0",
|
|
120
|
+
fontSize: "var(--sl-font-size-small)",
|
|
121
|
+
fontWeight: "600",
|
|
122
|
+
cursor: "pointer",
|
|
123
|
+
background: "none",
|
|
124
|
+
border: "none",
|
|
125
|
+
padding: "0",
|
|
126
|
+
fontFamily: "var(--sl-font-sans)",
|
|
127
|
+
color: "var(--sl-color-neutral-500)",
|
|
128
|
+
},
|
|
129
|
+
};
|
|
130
|
+
const sheet = createStyleSheet(style);
|
|
131
|
+
const styleString = sheet.toString();
|
|
132
|
+
const errorMessageType = (validationError === null || validationError === void 0 ? void 0 : validationError.code) === "LINK_TAKEN" ? "info" : "warning";
|
|
133
|
+
const showCharactersRemaining = charactersRemaining <= 7;
|
|
134
|
+
// Editing state
|
|
135
|
+
if (isEditing) {
|
|
136
|
+
return (h("div", { class: sheet.classes.Container },
|
|
137
|
+
h("style", { type: "text/css" },
|
|
138
|
+
styleString,
|
|
139
|
+
vanillaStyle),
|
|
140
|
+
h("p", { class: sheet.classes.EditLabel }, "Enter your link"),
|
|
141
|
+
h("div", { class: sheet.classes.EditInputWrapper },
|
|
142
|
+
h("span", { class: sheet.classes.DomainPrefix }, domainPrefix),
|
|
143
|
+
h("input", { class: sheet.classes.EditInput, type: "text", value: editValue, onInput: (e) => onEditValueChange(e.target.value), disabled: isSaving, maxLength: characterLimit })),
|
|
144
|
+
h("p", { class: sheet.classes.HelperText },
|
|
145
|
+
editLimitText,
|
|
146
|
+
showCharactersRemaining &&
|
|
147
|
+
` Characters remaining: ${charactersRemaining}`),
|
|
148
|
+
validationError && (h("sqm-form-message", { type: errorMessageType },
|
|
149
|
+
h("p", { part: "alert-title" }, validationError.title),
|
|
150
|
+
validationError.description)),
|
|
151
|
+
isValidating && h("p", { class: sheet.classes.HelperText }, "Validating..."),
|
|
152
|
+
h("div", { class: sheet.classes.ActionRow },
|
|
153
|
+
h("button", { class: sheet.classes.SaveButton, onClick: onSave, disabled: isSaving || isValidating || !!validationError || !editValue }, isSaving ? "Saving..." : saveLabelText),
|
|
154
|
+
h("button", { class: sheet.classes.CancelButton, onClick: onCancel, disabled: isSaving }, cancelLabelText))));
|
|
155
|
+
}
|
|
156
|
+
// Default / Customized / Limit reached states
|
|
157
|
+
return (h("div", { class: sheet.classes.Container },
|
|
158
|
+
h("style", { type: "text/css" },
|
|
159
|
+
styleString,
|
|
160
|
+
vanillaStyle),
|
|
161
|
+
h(CopyTextView, Object.assign({}, copyTextViewProps)),
|
|
162
|
+
showSuccess && h("p", { class: sheet.classes.SuccessText }, successMessage),
|
|
163
|
+
customizeUrl && (customizeDisabled ? (h("sl-tooltip", { content: customizeDisabledTooltip },
|
|
164
|
+
h("p", { class: sheet.classes.CustomizeLinkDisabled }, customizeLinkLabel))) : (h("p", { class: limitReached
|
|
165
|
+
? sheet.classes.CustomizeLinkDisabled
|
|
166
|
+
: sheet.classes.CustomizeLinkText, onClick: limitReached ? undefined : onCustomizeClick }, customizeLinkLabel))),
|
|
167
|
+
customizeUrl && limitReached && (h("p", { class: sheet.classes.HelperText }, intl.formatMessage({
|
|
168
|
+
id: "editLimitReached",
|
|
169
|
+
defaultMessage: editLimitReachedText,
|
|
170
|
+
}, {
|
|
171
|
+
supportLink: (h("a", { target: "_blank", href: "https://example.com" }, supportLinkText)),
|
|
172
|
+
})))));
|
|
173
|
+
}
|