@saasquatch/mint-components 2.1.8-2 → 2.1.8-4
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-f5a79b05.js} +377 -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 +201 -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-491b58b8.js} +378 -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-491b58b8.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-17be8df0.entry.js +9 -0
- package/dist/mint-components/p-296fda71.system.entry.js +1 -0
- package/dist/mint-components/p-75520f1a.js +500 -0
- package/dist/mint-components/{p-7ee8f2ed.entry.js → p-8465e839.entry.js} +20 -20
- package/dist/mint-components/p-aa226140.system.entry.js +1 -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-cd24ecfc.system.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
|
@@ -3,7 +3,7 @@ import { useState, withHooks } from "@saasquatch/stencil-hooks";
|
|
|
3
3
|
import { Component, Prop, h } from "@stencil/core";
|
|
4
4
|
import deepmerge from "deepmerge";
|
|
5
5
|
import { getProps } from "../../utils/utils";
|
|
6
|
-
import {
|
|
6
|
+
import { ShareLinkView } from "./sqm-share-link-view";
|
|
7
7
|
import { useShareLink } from "./useShareLink";
|
|
8
8
|
/**
|
|
9
9
|
* @uiName Share Link
|
|
@@ -58,6 +58,111 @@ export class ShareLink {
|
|
|
58
58
|
* @uiGroup Style
|
|
59
59
|
*/
|
|
60
60
|
this.buttonStyle = "icon";
|
|
61
|
+
/**
|
|
62
|
+
* Enable users to customize their referral link
|
|
63
|
+
*
|
|
64
|
+
* @uiName Customize URL
|
|
65
|
+
* @uiType boolean
|
|
66
|
+
*/
|
|
67
|
+
this.customizeUrl = false;
|
|
68
|
+
/**
|
|
69
|
+
* Text shown below the share link input to trigger customization
|
|
70
|
+
*
|
|
71
|
+
* @uiName Customize link label
|
|
72
|
+
* @uiType string
|
|
73
|
+
*/
|
|
74
|
+
this.customizeLinkLabel = "Customize Link";
|
|
75
|
+
/**
|
|
76
|
+
* Text for the save button in editing mode
|
|
77
|
+
*
|
|
78
|
+
* @uiName Save button label
|
|
79
|
+
* @uiType string
|
|
80
|
+
*/
|
|
81
|
+
this.saveLabelText = "Save";
|
|
82
|
+
/**
|
|
83
|
+
* Text for the cancel button in editing mode
|
|
84
|
+
*
|
|
85
|
+
* @uiName Cancel button label
|
|
86
|
+
* @uiType string
|
|
87
|
+
*/
|
|
88
|
+
this.cancelLabelText = "Cancel";
|
|
89
|
+
/**
|
|
90
|
+
* Message shown briefly after successfully saving a custom link
|
|
91
|
+
*
|
|
92
|
+
* @uiName Success message
|
|
93
|
+
* @uiType string
|
|
94
|
+
*/
|
|
95
|
+
this.successMessage = "Link updated successfully";
|
|
96
|
+
/**
|
|
97
|
+
* Title text shown when the custom link is already taken
|
|
98
|
+
*
|
|
99
|
+
* @uiName Link taken error title
|
|
100
|
+
* @uiType string
|
|
101
|
+
*/
|
|
102
|
+
this.linkTakenErrorTitle = "This link is already taken";
|
|
103
|
+
/**
|
|
104
|
+
* Description text shown when the custom link is already taken
|
|
105
|
+
*
|
|
106
|
+
* @uiName Link taken error description
|
|
107
|
+
* @uiType string
|
|
108
|
+
*/
|
|
109
|
+
this.linkTakenErrorDescription = "Try adding numbers, a dash or underscore to create a unique link.";
|
|
110
|
+
/**
|
|
111
|
+
* Title text shown when the link contains invalid symbols
|
|
112
|
+
*
|
|
113
|
+
* @uiName Invalid symbols error title
|
|
114
|
+
* @uiType string
|
|
115
|
+
*/
|
|
116
|
+
this.invalidSymbolsErrorTitle = "Please use only letters, numbers, dashes and underscores";
|
|
117
|
+
/**
|
|
118
|
+
* Description text shown when the link contains invalid symbols
|
|
119
|
+
*
|
|
120
|
+
* @uiName Invalid symbols error description
|
|
121
|
+
* @uiType string
|
|
122
|
+
*/
|
|
123
|
+
this.invalidSymbolsErrorDescription = "Special symbols can break the link when sharing.";
|
|
124
|
+
/**
|
|
125
|
+
* Title text shown when the link contains a restricted word
|
|
126
|
+
*
|
|
127
|
+
* @uiName Restricted word error title
|
|
128
|
+
* @uiType string
|
|
129
|
+
*/
|
|
130
|
+
this.restrictedWordErrorTitle = "Please try a different link";
|
|
131
|
+
/**
|
|
132
|
+
* Description text shown when the link contains a restricted word
|
|
133
|
+
*
|
|
134
|
+
* @uiName Restricted word error description
|
|
135
|
+
* @uiType string
|
|
136
|
+
*/
|
|
137
|
+
this.restrictedWordErrorDescription = "This link contains a restricted word.";
|
|
138
|
+
/**
|
|
139
|
+
* Text describing the edit limit
|
|
140
|
+
*
|
|
141
|
+
* @uiName Edit limit text
|
|
142
|
+
* @uiType string
|
|
143
|
+
*/
|
|
144
|
+
this.editLimitText = "You can edit your link up to 5 times.";
|
|
145
|
+
/**
|
|
146
|
+
* Message shown when the edit limit has been reached. Use {supportLink} as a placeholder for the support link.
|
|
147
|
+
*
|
|
148
|
+
* @uiName Edit limit reached text
|
|
149
|
+
* @uiType string
|
|
150
|
+
*/
|
|
151
|
+
this.editLimitReachedText = "5 edit limit reached. To make more changes, please contact {supportLink}.";
|
|
152
|
+
/**
|
|
153
|
+
* Display text for the support link in the edit limit reached message
|
|
154
|
+
*
|
|
155
|
+
* @uiName Support link text
|
|
156
|
+
* @uiType string
|
|
157
|
+
*/
|
|
158
|
+
this.supportLinkText = "Support";
|
|
159
|
+
/**
|
|
160
|
+
* Tooltip text shown when link customization is disabled
|
|
161
|
+
*
|
|
162
|
+
* @uiName Customize disabled tooltip
|
|
163
|
+
* @uiType string
|
|
164
|
+
*/
|
|
165
|
+
this.customizeDisabledTooltip = "Link customization is not available.";
|
|
61
166
|
withHooks(this);
|
|
62
167
|
}
|
|
63
168
|
disconnectedCallback() { }
|
|
@@ -66,7 +171,7 @@ export class ShareLink {
|
|
|
66
171
|
const props = isDemo()
|
|
67
172
|
? useDemoShareLink(thisProps)
|
|
68
173
|
: useShareLink(thisProps);
|
|
69
|
-
return h(
|
|
174
|
+
return h(ShareLinkView, Object.assign({}, props));
|
|
70
175
|
}
|
|
71
176
|
static get is() { return "sqm-share-link"; }
|
|
72
177
|
static get encapsulation() { return "shadow"; }
|
|
@@ -369,20 +474,380 @@ export class ShareLink {
|
|
|
369
474
|
"reflect": false,
|
|
370
475
|
"defaultValue": "\"icon\""
|
|
371
476
|
},
|
|
477
|
+
"customizeUrl": {
|
|
478
|
+
"type": "boolean",
|
|
479
|
+
"mutable": false,
|
|
480
|
+
"complexType": {
|
|
481
|
+
"original": "boolean",
|
|
482
|
+
"resolved": "boolean",
|
|
483
|
+
"references": {}
|
|
484
|
+
},
|
|
485
|
+
"required": false,
|
|
486
|
+
"optional": true,
|
|
487
|
+
"docs": {
|
|
488
|
+
"tags": [{
|
|
489
|
+
"text": "Customize URL",
|
|
490
|
+
"name": "uiName"
|
|
491
|
+
}, {
|
|
492
|
+
"text": "boolean",
|
|
493
|
+
"name": "uiType"
|
|
494
|
+
}],
|
|
495
|
+
"text": "Enable users to customize their referral link"
|
|
496
|
+
},
|
|
497
|
+
"attribute": "customize-url",
|
|
498
|
+
"reflect": false,
|
|
499
|
+
"defaultValue": "false"
|
|
500
|
+
},
|
|
501
|
+
"customizeLinkLabel": {
|
|
502
|
+
"type": "string",
|
|
503
|
+
"mutable": false,
|
|
504
|
+
"complexType": {
|
|
505
|
+
"original": "string",
|
|
506
|
+
"resolved": "string",
|
|
507
|
+
"references": {}
|
|
508
|
+
},
|
|
509
|
+
"required": false,
|
|
510
|
+
"optional": true,
|
|
511
|
+
"docs": {
|
|
512
|
+
"tags": [{
|
|
513
|
+
"text": "Customize link label",
|
|
514
|
+
"name": "uiName"
|
|
515
|
+
}, {
|
|
516
|
+
"text": "string",
|
|
517
|
+
"name": "uiType"
|
|
518
|
+
}],
|
|
519
|
+
"text": "Text shown below the share link input to trigger customization"
|
|
520
|
+
},
|
|
521
|
+
"attribute": "customize-link-label",
|
|
522
|
+
"reflect": false,
|
|
523
|
+
"defaultValue": "\"Customize Link\""
|
|
524
|
+
},
|
|
525
|
+
"saveLabelText": {
|
|
526
|
+
"type": "string",
|
|
527
|
+
"mutable": false,
|
|
528
|
+
"complexType": {
|
|
529
|
+
"original": "string",
|
|
530
|
+
"resolved": "string",
|
|
531
|
+
"references": {}
|
|
532
|
+
},
|
|
533
|
+
"required": false,
|
|
534
|
+
"optional": true,
|
|
535
|
+
"docs": {
|
|
536
|
+
"tags": [{
|
|
537
|
+
"text": "Save button label",
|
|
538
|
+
"name": "uiName"
|
|
539
|
+
}, {
|
|
540
|
+
"text": "string",
|
|
541
|
+
"name": "uiType"
|
|
542
|
+
}],
|
|
543
|
+
"text": "Text for the save button in editing mode"
|
|
544
|
+
},
|
|
545
|
+
"attribute": "save-label-text",
|
|
546
|
+
"reflect": false,
|
|
547
|
+
"defaultValue": "\"Save\""
|
|
548
|
+
},
|
|
549
|
+
"cancelLabelText": {
|
|
550
|
+
"type": "string",
|
|
551
|
+
"mutable": false,
|
|
552
|
+
"complexType": {
|
|
553
|
+
"original": "string",
|
|
554
|
+
"resolved": "string",
|
|
555
|
+
"references": {}
|
|
556
|
+
},
|
|
557
|
+
"required": false,
|
|
558
|
+
"optional": true,
|
|
559
|
+
"docs": {
|
|
560
|
+
"tags": [{
|
|
561
|
+
"text": "Cancel button label",
|
|
562
|
+
"name": "uiName"
|
|
563
|
+
}, {
|
|
564
|
+
"text": "string",
|
|
565
|
+
"name": "uiType"
|
|
566
|
+
}],
|
|
567
|
+
"text": "Text for the cancel button in editing mode"
|
|
568
|
+
},
|
|
569
|
+
"attribute": "cancel-label-text",
|
|
570
|
+
"reflect": false,
|
|
571
|
+
"defaultValue": "\"Cancel\""
|
|
572
|
+
},
|
|
573
|
+
"successMessage": {
|
|
574
|
+
"type": "string",
|
|
575
|
+
"mutable": false,
|
|
576
|
+
"complexType": {
|
|
577
|
+
"original": "string",
|
|
578
|
+
"resolved": "string",
|
|
579
|
+
"references": {}
|
|
580
|
+
},
|
|
581
|
+
"required": false,
|
|
582
|
+
"optional": true,
|
|
583
|
+
"docs": {
|
|
584
|
+
"tags": [{
|
|
585
|
+
"text": "Success message",
|
|
586
|
+
"name": "uiName"
|
|
587
|
+
}, {
|
|
588
|
+
"text": "string",
|
|
589
|
+
"name": "uiType"
|
|
590
|
+
}],
|
|
591
|
+
"text": "Message shown briefly after successfully saving a custom link"
|
|
592
|
+
},
|
|
593
|
+
"attribute": "success-message",
|
|
594
|
+
"reflect": false,
|
|
595
|
+
"defaultValue": "\"Link updated successfully\""
|
|
596
|
+
},
|
|
597
|
+
"linkTakenErrorTitle": {
|
|
598
|
+
"type": "string",
|
|
599
|
+
"mutable": false,
|
|
600
|
+
"complexType": {
|
|
601
|
+
"original": "string",
|
|
602
|
+
"resolved": "string",
|
|
603
|
+
"references": {}
|
|
604
|
+
},
|
|
605
|
+
"required": false,
|
|
606
|
+
"optional": true,
|
|
607
|
+
"docs": {
|
|
608
|
+
"tags": [{
|
|
609
|
+
"text": "Link taken error title",
|
|
610
|
+
"name": "uiName"
|
|
611
|
+
}, {
|
|
612
|
+
"text": "string",
|
|
613
|
+
"name": "uiType"
|
|
614
|
+
}],
|
|
615
|
+
"text": "Title text shown when the custom link is already taken"
|
|
616
|
+
},
|
|
617
|
+
"attribute": "link-taken-error-title",
|
|
618
|
+
"reflect": false,
|
|
619
|
+
"defaultValue": "\"This link is already taken\""
|
|
620
|
+
},
|
|
621
|
+
"linkTakenErrorDescription": {
|
|
622
|
+
"type": "string",
|
|
623
|
+
"mutable": false,
|
|
624
|
+
"complexType": {
|
|
625
|
+
"original": "string",
|
|
626
|
+
"resolved": "string",
|
|
627
|
+
"references": {}
|
|
628
|
+
},
|
|
629
|
+
"required": false,
|
|
630
|
+
"optional": true,
|
|
631
|
+
"docs": {
|
|
632
|
+
"tags": [{
|
|
633
|
+
"text": "Link taken error description",
|
|
634
|
+
"name": "uiName"
|
|
635
|
+
}, {
|
|
636
|
+
"text": "string",
|
|
637
|
+
"name": "uiType"
|
|
638
|
+
}],
|
|
639
|
+
"text": "Description text shown when the custom link is already taken"
|
|
640
|
+
},
|
|
641
|
+
"attribute": "link-taken-error-description",
|
|
642
|
+
"reflect": false,
|
|
643
|
+
"defaultValue": "\"Try adding numbers, a dash or underscore to create a unique link.\""
|
|
644
|
+
},
|
|
645
|
+
"invalidSymbolsErrorTitle": {
|
|
646
|
+
"type": "string",
|
|
647
|
+
"mutable": false,
|
|
648
|
+
"complexType": {
|
|
649
|
+
"original": "string",
|
|
650
|
+
"resolved": "string",
|
|
651
|
+
"references": {}
|
|
652
|
+
},
|
|
653
|
+
"required": false,
|
|
654
|
+
"optional": true,
|
|
655
|
+
"docs": {
|
|
656
|
+
"tags": [{
|
|
657
|
+
"text": "Invalid symbols error title",
|
|
658
|
+
"name": "uiName"
|
|
659
|
+
}, {
|
|
660
|
+
"text": "string",
|
|
661
|
+
"name": "uiType"
|
|
662
|
+
}],
|
|
663
|
+
"text": "Title text shown when the link contains invalid symbols"
|
|
664
|
+
},
|
|
665
|
+
"attribute": "invalid-symbols-error-title",
|
|
666
|
+
"reflect": false,
|
|
667
|
+
"defaultValue": "\"Please use only letters, numbers, dashes and underscores\""
|
|
668
|
+
},
|
|
669
|
+
"invalidSymbolsErrorDescription": {
|
|
670
|
+
"type": "string",
|
|
671
|
+
"mutable": false,
|
|
672
|
+
"complexType": {
|
|
673
|
+
"original": "string",
|
|
674
|
+
"resolved": "string",
|
|
675
|
+
"references": {}
|
|
676
|
+
},
|
|
677
|
+
"required": false,
|
|
678
|
+
"optional": true,
|
|
679
|
+
"docs": {
|
|
680
|
+
"tags": [{
|
|
681
|
+
"text": "Invalid symbols error description",
|
|
682
|
+
"name": "uiName"
|
|
683
|
+
}, {
|
|
684
|
+
"text": "string",
|
|
685
|
+
"name": "uiType"
|
|
686
|
+
}],
|
|
687
|
+
"text": "Description text shown when the link contains invalid symbols"
|
|
688
|
+
},
|
|
689
|
+
"attribute": "invalid-symbols-error-description",
|
|
690
|
+
"reflect": false,
|
|
691
|
+
"defaultValue": "\"Special symbols can break the link when sharing.\""
|
|
692
|
+
},
|
|
693
|
+
"restrictedWordErrorTitle": {
|
|
694
|
+
"type": "string",
|
|
695
|
+
"mutable": false,
|
|
696
|
+
"complexType": {
|
|
697
|
+
"original": "string",
|
|
698
|
+
"resolved": "string",
|
|
699
|
+
"references": {}
|
|
700
|
+
},
|
|
701
|
+
"required": false,
|
|
702
|
+
"optional": true,
|
|
703
|
+
"docs": {
|
|
704
|
+
"tags": [{
|
|
705
|
+
"text": "Restricted word error title",
|
|
706
|
+
"name": "uiName"
|
|
707
|
+
}, {
|
|
708
|
+
"text": "string",
|
|
709
|
+
"name": "uiType"
|
|
710
|
+
}],
|
|
711
|
+
"text": "Title text shown when the link contains a restricted word"
|
|
712
|
+
},
|
|
713
|
+
"attribute": "restricted-word-error-title",
|
|
714
|
+
"reflect": false,
|
|
715
|
+
"defaultValue": "\"Please try a different link\""
|
|
716
|
+
},
|
|
717
|
+
"restrictedWordErrorDescription": {
|
|
718
|
+
"type": "string",
|
|
719
|
+
"mutable": false,
|
|
720
|
+
"complexType": {
|
|
721
|
+
"original": "string",
|
|
722
|
+
"resolved": "string",
|
|
723
|
+
"references": {}
|
|
724
|
+
},
|
|
725
|
+
"required": false,
|
|
726
|
+
"optional": true,
|
|
727
|
+
"docs": {
|
|
728
|
+
"tags": [{
|
|
729
|
+
"text": "Restricted word error description",
|
|
730
|
+
"name": "uiName"
|
|
731
|
+
}, {
|
|
732
|
+
"text": "string",
|
|
733
|
+
"name": "uiType"
|
|
734
|
+
}],
|
|
735
|
+
"text": "Description text shown when the link contains a restricted word"
|
|
736
|
+
},
|
|
737
|
+
"attribute": "restricted-word-error-description",
|
|
738
|
+
"reflect": false,
|
|
739
|
+
"defaultValue": "\"This link contains a restricted word.\""
|
|
740
|
+
},
|
|
741
|
+
"editLimitText": {
|
|
742
|
+
"type": "string",
|
|
743
|
+
"mutable": false,
|
|
744
|
+
"complexType": {
|
|
745
|
+
"original": "string",
|
|
746
|
+
"resolved": "string",
|
|
747
|
+
"references": {}
|
|
748
|
+
},
|
|
749
|
+
"required": false,
|
|
750
|
+
"optional": true,
|
|
751
|
+
"docs": {
|
|
752
|
+
"tags": [{
|
|
753
|
+
"text": "Edit limit text",
|
|
754
|
+
"name": "uiName"
|
|
755
|
+
}, {
|
|
756
|
+
"text": "string",
|
|
757
|
+
"name": "uiType"
|
|
758
|
+
}],
|
|
759
|
+
"text": "Text describing the edit limit"
|
|
760
|
+
},
|
|
761
|
+
"attribute": "edit-limit-text",
|
|
762
|
+
"reflect": false,
|
|
763
|
+
"defaultValue": "\"You can edit your link up to 5 times.\""
|
|
764
|
+
},
|
|
765
|
+
"editLimitReachedText": {
|
|
766
|
+
"type": "string",
|
|
767
|
+
"mutable": false,
|
|
768
|
+
"complexType": {
|
|
769
|
+
"original": "string",
|
|
770
|
+
"resolved": "string",
|
|
771
|
+
"references": {}
|
|
772
|
+
},
|
|
773
|
+
"required": false,
|
|
774
|
+
"optional": true,
|
|
775
|
+
"docs": {
|
|
776
|
+
"tags": [{
|
|
777
|
+
"text": "Edit limit reached text",
|
|
778
|
+
"name": "uiName"
|
|
779
|
+
}, {
|
|
780
|
+
"text": "string",
|
|
781
|
+
"name": "uiType"
|
|
782
|
+
}],
|
|
783
|
+
"text": "Message shown when the edit limit has been reached. Use {supportLink} as a placeholder for the support link."
|
|
784
|
+
},
|
|
785
|
+
"attribute": "edit-limit-reached-text",
|
|
786
|
+
"reflect": false,
|
|
787
|
+
"defaultValue": "\"5 edit limit reached. To make more changes, please contact {supportLink}.\""
|
|
788
|
+
},
|
|
789
|
+
"supportLinkText": {
|
|
790
|
+
"type": "string",
|
|
791
|
+
"mutable": false,
|
|
792
|
+
"complexType": {
|
|
793
|
+
"original": "string",
|
|
794
|
+
"resolved": "string",
|
|
795
|
+
"references": {}
|
|
796
|
+
},
|
|
797
|
+
"required": false,
|
|
798
|
+
"optional": true,
|
|
799
|
+
"docs": {
|
|
800
|
+
"tags": [{
|
|
801
|
+
"text": "Support link text",
|
|
802
|
+
"name": "uiName"
|
|
803
|
+
}, {
|
|
804
|
+
"text": "string",
|
|
805
|
+
"name": "uiType"
|
|
806
|
+
}],
|
|
807
|
+
"text": "Display text for the support link in the edit limit reached message"
|
|
808
|
+
},
|
|
809
|
+
"attribute": "support-link-text",
|
|
810
|
+
"reflect": false,
|
|
811
|
+
"defaultValue": "\"Support\""
|
|
812
|
+
},
|
|
813
|
+
"customizeDisabledTooltip": {
|
|
814
|
+
"type": "string",
|
|
815
|
+
"mutable": false,
|
|
816
|
+
"complexType": {
|
|
817
|
+
"original": "string",
|
|
818
|
+
"resolved": "string",
|
|
819
|
+
"references": {}
|
|
820
|
+
},
|
|
821
|
+
"required": false,
|
|
822
|
+
"optional": true,
|
|
823
|
+
"docs": {
|
|
824
|
+
"tags": [{
|
|
825
|
+
"text": "Customize disabled tooltip",
|
|
826
|
+
"name": "uiName"
|
|
827
|
+
}, {
|
|
828
|
+
"text": "string",
|
|
829
|
+
"name": "uiType"
|
|
830
|
+
}],
|
|
831
|
+
"text": "Tooltip text shown when link customization is disabled"
|
|
832
|
+
},
|
|
833
|
+
"attribute": "customize-disabled-tooltip",
|
|
834
|
+
"reflect": false,
|
|
835
|
+
"defaultValue": "\"Link customization is not available.\""
|
|
836
|
+
},
|
|
372
837
|
"demoData": {
|
|
373
838
|
"type": "unknown",
|
|
374
839
|
"mutable": false,
|
|
375
840
|
"complexType": {
|
|
376
|
-
"original": "DemoData<
|
|
377
|
-
"resolved": "{
|
|
841
|
+
"original": "DemoData<ShareLinkViewProps>",
|
|
842
|
+
"resolved": "{ copyTextViewProps?: CopyTextViewProps; customizeUrl?: boolean; customizeLinkLabel?: string; saveLabelText?: string; cancelLabelText?: string; successMessage?: string; isEditing?: boolean; editValue?: string; domainPrefix?: string; editsRemaining?: number; maxEdits?: number; limitReached?: boolean; validationError?: ValidationErrorInfo; isValidating?: boolean; isSaving?: boolean; showSuccess?: boolean; characterLimit?: number; charactersRemaining?: number; editLimitText?: string; editLimitReachedText?: string; supportLinkText?: string; customizeDisabled?: boolean; customizeDisabledTooltip?: string; onCustomizeClick?: () => void; onEditValueChange?: (value: string) => void; onSave?: () => void; onCancel?: () => void; }",
|
|
378
843
|
"references": {
|
|
379
844
|
"DemoData": {
|
|
380
845
|
"location": "import",
|
|
381
846
|
"path": "../../global/demo"
|
|
382
847
|
},
|
|
383
|
-
"
|
|
848
|
+
"ShareLinkViewProps": {
|
|
384
849
|
"location": "import",
|
|
385
|
-
"path": "
|
|
850
|
+
"path": "./sqm-share-link-view"
|
|
386
851
|
}
|
|
387
852
|
}
|
|
388
853
|
},
|
|
@@ -402,27 +867,72 @@ export class ShareLink {
|
|
|
402
867
|
}; }
|
|
403
868
|
}
|
|
404
869
|
function useDemoShareLink(props) {
|
|
870
|
+
var _a;
|
|
405
871
|
const [open, setOpen] = useState(false);
|
|
872
|
+
const [isEditing, setIsEditing] = useState(false);
|
|
873
|
+
const [editValue, setEditValue] = useState("");
|
|
874
|
+
const [showSuccess, setShowSuccess] = useState(false);
|
|
406
875
|
const copyString = "https://www.example.com/sharelink/abc";
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
876
|
+
const domainPrefix = "https://www.example.com/";
|
|
877
|
+
const baseProps = {
|
|
878
|
+
copyTextViewProps: {
|
|
879
|
+
copyString,
|
|
880
|
+
tooltiptext: props.tooltiptext,
|
|
881
|
+
textAlign: props.textAlign,
|
|
882
|
+
buttonStyle: props.buttonStyle,
|
|
883
|
+
backgroundColor: props.backgroundColor,
|
|
884
|
+
textColor: props.textColor,
|
|
885
|
+
borderRadius: props.borderRadius,
|
|
886
|
+
buttonType: props.buttonType,
|
|
887
|
+
copyButtonLabel: props.copyButtonLabel,
|
|
888
|
+
borderColor: props.borderColor,
|
|
889
|
+
open,
|
|
890
|
+
onClick: () => {
|
|
891
|
+
navigator.clipboard.writeText(copyString);
|
|
892
|
+
setOpen(true);
|
|
893
|
+
setTimeout(() => setOpen(false), props.tooltiplifespan);
|
|
894
|
+
},
|
|
895
|
+
},
|
|
896
|
+
customizeUrl: props.customizeUrl,
|
|
897
|
+
customizeLinkLabel: props.customizeLinkLabel,
|
|
898
|
+
saveLabelText: props.saveLabelText,
|
|
899
|
+
cancelLabelText: props.cancelLabelText,
|
|
900
|
+
successMessage: props.successMessage,
|
|
901
|
+
isEditing,
|
|
902
|
+
editValue,
|
|
903
|
+
domainPrefix,
|
|
904
|
+
editsRemaining: 5,
|
|
905
|
+
maxEdits: 5,
|
|
906
|
+
limitReached: false,
|
|
907
|
+
validationError: null,
|
|
908
|
+
isValidating: false,
|
|
909
|
+
isSaving: false,
|
|
910
|
+
showSuccess,
|
|
911
|
+
characterLimit: 15,
|
|
912
|
+
charactersRemaining: 15 - editValue.length,
|
|
913
|
+
editLimitText: props.editLimitText,
|
|
914
|
+
editLimitReachedText: props.editLimitReachedText,
|
|
915
|
+
supportLinkText: props.supportLinkText,
|
|
916
|
+
customizeDisabled: false,
|
|
917
|
+
customizeDisabledTooltip: (_a = props.customizeDisabledTooltip) !== null && _a !== void 0 ? _a : "Link customization is not available.",
|
|
918
|
+
onCustomizeClick: () => {
|
|
919
|
+
setIsEditing(true);
|
|
920
|
+
setEditValue("");
|
|
921
|
+
},
|
|
922
|
+
onEditValueChange: (value) => {
|
|
923
|
+
setEditValue(value);
|
|
924
|
+
},
|
|
925
|
+
onSave: () => {
|
|
926
|
+
setIsEditing(false);
|
|
927
|
+
setShowSuccess(true);
|
|
928
|
+
setTimeout(() => setShowSuccess(false), 3000);
|
|
929
|
+
},
|
|
930
|
+
onCancel: () => {
|
|
931
|
+
setIsEditing(false);
|
|
932
|
+
setEditValue("");
|
|
426
933
|
},
|
|
427
|
-
}
|
|
934
|
+
};
|
|
935
|
+
return deepmerge(baseProps, props.demoData || {}, {
|
|
936
|
+
arrayMerge: (_, a) => a,
|
|
937
|
+
});
|
|
428
938
|
}
|