@descope/web-components-ui 3.5.1 → 3.7.0
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/index.cjs.js +58 -7
- package/dist/cjs/index.cjs.js.map +1 -1
- package/dist/index.esm.js +58 -7
- package/dist/index.esm.js.map +1 -1
- package/dist/umd/DescopeDev.js +1 -1
- package/dist/umd/DescopeDev.js.map +1 -1
- package/dist/umd/descope-user-attribute-index-js.js +4 -4
- package/dist/umd/descope-user-attribute-index-js.js.map +1 -1
- package/dist/umd/index.js +1 -1
- package/package.json +34 -33
- package/src/components/descope-user-attribute/UserAttributeClass.js +58 -7
- package/src/theme/components/userAttribute.js +1 -0
- package/stories/commonControls.js +359 -0
- package/stories/descope-alert.stories.js +102 -0
- package/stories/descope-button-multi-selection-group.stories.js +130 -0
- package/stories/descope-button-selection-group.stories.js +131 -0
- package/stories/descope-calendar.stories.js +115 -0
- package/stories/descope-checkbox.stories.js +74 -0
- package/stories/descope-code-snippet.stories.js +118 -0
- package/stories/descope-container.stories.js +96 -0
- package/stories/descope-date-field.stories.js +169 -0
- package/stories/descope-divider.stories.js +43 -0
- package/stories/descope-email-field.stories.js +109 -0
- package/stories/descope-grid.stories.js +218 -0
- package/stories/descope-hcaptcha.stories.js +29 -0
- package/stories/descope-hybrid-field.stories.js +151 -0
- package/stories/descope-loader-linear.stories.js +29 -0
- package/stories/descope-loader-radial.stories.js +29 -0
- package/stories/descope-logo.stories.js +40 -0
- package/stories/descope-mappings-field.stories.js +108 -0
- package/stories/descope-modal.stories.js +48 -0
- package/stories/descope-multi-select-combo-box.stories.js +183 -0
- package/stories/descope-new-password.stories.js +206 -0
- package/stories/descope-notification.stories.js +81 -0
- package/stories/descope-notp-image.stories.js +29 -0
- package/stories/descope-number-field.stories.js +83 -0
- package/stories/descope-passcode.stories.js +89 -0
- package/stories/descope-password.stories.js +89 -0
- package/stories/descope-phone-field.stories.js +137 -0
- package/stories/descope-phone-input-box-field.stories.js +128 -0
- package/stories/descope-policy-validation.stories.js +92 -0
- package/stories/descope-radio-group.stories.js +142 -0
- package/stories/descope-recaptcha.stories.js +38 -0
- package/stories/descope-saml-group-mappings.stories.js +109 -0
- package/stories/descope-scopes-list.stories.js +81 -0
- package/stories/descope-security-questions-setup.stories.js +125 -0
- package/stories/descope-security-questions-verify.stories.js +111 -0
- package/stories/descope-switch-toggle.stories.js +74 -0
- package/stories/descope-text-area.stories.js +77 -0
- package/stories/descope-text-field.stories.js +98 -0
- package/stories/descope-third-party-app-logo.stories.js +42 -0
- package/stories/descope-totp-image.stories.js +29 -0
- package/stories/descope-upload-file.stories.js +113 -0
- package/stories/descope-user-attribute.stories.js +103 -0
- package/stories/descope-user-auth-method.stories.js +77 -0
- package/stories/helpers.js +86 -0
- package/stories/icons/alert.svg +9 -0
- package/stories/icons/apple.svg +10 -0
- package/stories/icons/base64png.js +1 -0
- package/stories/icons/base64svg.js +1 -0
- package/stories/icons/button-icon.svg +3 -0
- package/stories/icons/errorMessageIconBase64.js +1 -0
- package/stories/icons/fulfilled-button-icon.svg +3 -0
- package/stories/icons/google.svg +25 -0
- package/stories/icons/method-icon.svg +3 -0
- package/stories/images/150x200.jpg +0 -0
- package/stories/images/800x150.jpg +0 -0
- package/stories/images/avatar.jpeg +0 -0
- package/stories/images/demo.jpg +0 -0
- package/stories/images/game.png +0 -0
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
import { componentName } from '../src/components/phone-fields/descope-phone-field';
|
|
2
|
+
import CountryCodes from '../src/components/phone-fields/CountryCodes';
|
|
3
|
+
import { toggleDefaultErrorMessageValueMissingDecorator, withForm } from './helpers';
|
|
4
|
+
import {
|
|
5
|
+
labelControl,
|
|
6
|
+
sizeControl,
|
|
7
|
+
fullWidthControl,
|
|
8
|
+
directionControl,
|
|
9
|
+
disabledControl,
|
|
10
|
+
readOnlyControl,
|
|
11
|
+
requiredControl,
|
|
12
|
+
borderedControl,
|
|
13
|
+
minLengthControl,
|
|
14
|
+
maxLengthControl,
|
|
15
|
+
errorMissingValueControl,
|
|
16
|
+
inputLabelTypeControl,
|
|
17
|
+
errorMessageIconAttrs,
|
|
18
|
+
errorMessageIconControl,
|
|
19
|
+
defaultValueMissingControl,
|
|
20
|
+
} from './commonControls';
|
|
21
|
+
|
|
22
|
+
const Template = ({
|
|
23
|
+
label,
|
|
24
|
+
'default-code': defaultCode,
|
|
25
|
+
size,
|
|
26
|
+
bordered,
|
|
27
|
+
'country-input-label': countryInputLabel,
|
|
28
|
+
'phone-input-placeholder': phoneInputPlaceholder,
|
|
29
|
+
'country-input-placeholder': countryInputPlaceholder,
|
|
30
|
+
'full-width': fullWidth,
|
|
31
|
+
minlength,
|
|
32
|
+
maxlength,
|
|
33
|
+
readonly,
|
|
34
|
+
direction,
|
|
35
|
+
required,
|
|
36
|
+
disabled,
|
|
37
|
+
'restrict-countries': restrictCountries,
|
|
38
|
+
'data-errormessage-value-missing': customErrorMissingValue,
|
|
39
|
+
'label-type': labelType,
|
|
40
|
+
'allow-alphanumeric-input': allowAlphanumericInput,
|
|
41
|
+
'format-value': formatValue,
|
|
42
|
+
'strict-validation': strictValidation,
|
|
43
|
+
errorMsgIcon,
|
|
44
|
+
'phone-input-type': phoneInputType,
|
|
45
|
+
}) =>
|
|
46
|
+
`<descope-phone-field
|
|
47
|
+
size="${size}"
|
|
48
|
+
bordered="${bordered}"
|
|
49
|
+
label="${label || ''}"
|
|
50
|
+
required="${required || false}"
|
|
51
|
+
country-input-label="${countryInputLabel || ''}"
|
|
52
|
+
country-input-placeholder="${countryInputPlaceholder || ''}"
|
|
53
|
+
phone-input-placeholder="${phoneInputPlaceholder || ''}"
|
|
54
|
+
default-code="${defaultCode || ''}"
|
|
55
|
+
full-width="${fullWidth || false}"
|
|
56
|
+
readonly="${readonly || false}"
|
|
57
|
+
disabled="${disabled || false}"
|
|
58
|
+
minlength="${minlength}"
|
|
59
|
+
maxlength="${maxlength}"
|
|
60
|
+
restrict-countries="${restrictCountries || ''}"
|
|
61
|
+
data-errormessage-value-missing="${customErrorMissingValue || ''}"
|
|
62
|
+
st-host-direction="${direction ?? ''}"
|
|
63
|
+
label-type="${labelType || ''}"
|
|
64
|
+
allow-alphanumeric-input="${allowAlphanumericInput || false}"
|
|
65
|
+
format-value="${formatValue || false}"
|
|
66
|
+
strict-validation="${strictValidation || false}"
|
|
67
|
+
${errorMsgIcon ? errorMessageIconAttrs : ''}
|
|
68
|
+
phone-input-type="${phoneInputType ?? ''}"
|
|
69
|
+
></descope-phone-field>
|
|
70
|
+
`;
|
|
71
|
+
export default {
|
|
72
|
+
component: componentName,
|
|
73
|
+
title: 'descope-phone-field',
|
|
74
|
+
decorators: [toggleDefaultErrorMessageValueMissingDecorator, withForm],
|
|
75
|
+
argTypes: {
|
|
76
|
+
...labelControl,
|
|
77
|
+
...sizeControl,
|
|
78
|
+
...inputLabelTypeControl,
|
|
79
|
+
...fullWidthControl,
|
|
80
|
+
...disabledControl,
|
|
81
|
+
...readOnlyControl,
|
|
82
|
+
...requiredControl,
|
|
83
|
+
...borderedControl,
|
|
84
|
+
...minLengthControl,
|
|
85
|
+
...maxLengthControl,
|
|
86
|
+
...errorMissingValueControl,
|
|
87
|
+
...directionControl,
|
|
88
|
+
...errorMessageIconControl,
|
|
89
|
+
...defaultValueMissingControl,
|
|
90
|
+
'country-input-label': {
|
|
91
|
+
name: 'Code Label',
|
|
92
|
+
control: { type: 'text' },
|
|
93
|
+
},
|
|
94
|
+
'country-input-placeholder': {
|
|
95
|
+
name: 'Code Placeholder',
|
|
96
|
+
control: { type: 'text' },
|
|
97
|
+
},
|
|
98
|
+
'phone-input-placeholder': {
|
|
99
|
+
name: 'Phone Placeholder',
|
|
100
|
+
control: { type: 'text' },
|
|
101
|
+
},
|
|
102
|
+
'default-code': {
|
|
103
|
+
name: 'Default Code',
|
|
104
|
+
options: [''].concat(CountryCodes.map((c) => c.code)),
|
|
105
|
+
control: { type: 'select' },
|
|
106
|
+
},
|
|
107
|
+
'restrict-countries': {
|
|
108
|
+
name: 'Allowed Countries',
|
|
109
|
+
control: { type: 'text' },
|
|
110
|
+
},
|
|
111
|
+
'allow-alphanumeric-input': {
|
|
112
|
+
control: { type: 'boolean' },
|
|
113
|
+
},
|
|
114
|
+
'format-value': {
|
|
115
|
+
name: 'Format Value',
|
|
116
|
+
control: { type: 'boolean' },
|
|
117
|
+
},
|
|
118
|
+
'strict-validation': {
|
|
119
|
+
name: 'Strict Validation',
|
|
120
|
+
control: { type: 'boolean' },
|
|
121
|
+
},
|
|
122
|
+
'phone-input-type': {
|
|
123
|
+
name: 'Phone Input Type',
|
|
124
|
+
control: { type: 'select' },
|
|
125
|
+
options: ['tel', 'text'],
|
|
126
|
+
},
|
|
127
|
+
},
|
|
128
|
+
};
|
|
129
|
+
|
|
130
|
+
export const Default = Template.bind({});
|
|
131
|
+
|
|
132
|
+
Default.args = {
|
|
133
|
+
size: 'md',
|
|
134
|
+
bordered: true,
|
|
135
|
+
'restrict-countries': 'IL,US', // for test purposes, as Storybook cannot load preview url with comma separted values
|
|
136
|
+
'data-errormessage-value-missing': 'Please fill out this field.',
|
|
137
|
+
};
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import { componentName } from '../src/components/phone-fields/descope-phone-input-box-field';
|
|
2
|
+
import CountryCodes from '../src/components/phone-fields/CountryCodes';
|
|
3
|
+
import { toggleDefaultErrorMessageValueMissingDecorator, withForm } from './helpers';
|
|
4
|
+
import {
|
|
5
|
+
labelControl,
|
|
6
|
+
sizeControl,
|
|
7
|
+
fullWidthControl,
|
|
8
|
+
directionControl,
|
|
9
|
+
disabledControl,
|
|
10
|
+
readOnlyControl,
|
|
11
|
+
requiredControl,
|
|
12
|
+
borderedControl,
|
|
13
|
+
minLengthControl,
|
|
14
|
+
maxLengthControl,
|
|
15
|
+
errorMissingValueControl,
|
|
16
|
+
inputLabelTypeControl,
|
|
17
|
+
errorMessageIconControl,
|
|
18
|
+
errorMessageIconAttrs,
|
|
19
|
+
errorPatternMismatchControl,
|
|
20
|
+
defaultValueMissingControl,
|
|
21
|
+
} from './commonControls';
|
|
22
|
+
|
|
23
|
+
const Template = ({
|
|
24
|
+
label,
|
|
25
|
+
size,
|
|
26
|
+
bordered,
|
|
27
|
+
direction,
|
|
28
|
+
'phone-input-placeholder': placeholder,
|
|
29
|
+
minlength,
|
|
30
|
+
maxlength,
|
|
31
|
+
readonly,
|
|
32
|
+
required,
|
|
33
|
+
disabled,
|
|
34
|
+
'default-code': defaultCode,
|
|
35
|
+
'full-width': fullWidth,
|
|
36
|
+
'restrict-countries': restrictCountries,
|
|
37
|
+
'data-errormessage-value-missing': customErrorMissingValue,
|
|
38
|
+
'data-errormessage-pattern-mismatch': customPatternMismatch,
|
|
39
|
+
'label-type': labelType,
|
|
40
|
+
'allow-alphanumeric-input': allowAlphanumericInput,
|
|
41
|
+
'format-value': formatValue,
|
|
42
|
+
'strict-validation': strictValidation,
|
|
43
|
+
errorMsgIcon,
|
|
44
|
+
'phone-input-type': phoneInputType,
|
|
45
|
+
}) =>
|
|
46
|
+
`<descope-phone-input-box-field
|
|
47
|
+
size="${size}"
|
|
48
|
+
bordered="${bordered}"
|
|
49
|
+
label="${label || ''}"
|
|
50
|
+
required="${required || false}"
|
|
51
|
+
phone-input-placeholder="${placeholder || ''}"
|
|
52
|
+
default-code="${defaultCode || ''}"
|
|
53
|
+
full-width="${fullWidth || false}"
|
|
54
|
+
readonly="${readonly || false}"
|
|
55
|
+
disabled="${disabled || false}"
|
|
56
|
+
minlength="${minlength}"
|
|
57
|
+
maxlength="${maxlength}"
|
|
58
|
+
restrict-countries="${restrictCountries || ''}"
|
|
59
|
+
data-errormessage-value-missing="${customErrorMissingValue || ''}"
|
|
60
|
+
data-errormessage-pattern-mismatch="${customPatternMismatch || ''}"
|
|
61
|
+
allow-alphanumeric-input="${allowAlphanumericInput ? 'true' : 'false'}"
|
|
62
|
+
st-host-direction="${direction ?? ''}"
|
|
63
|
+
label-type="${labelType || ''}"
|
|
64
|
+
format-value="${formatValue || false}"
|
|
65
|
+
strict-validation="${strictValidation || false}"
|
|
66
|
+
${errorMsgIcon ? errorMessageIconAttrs : ''}
|
|
67
|
+
phone-input-type="${phoneInputType ?? ''}"
|
|
68
|
+
></descope-phone-input-box-field>`;
|
|
69
|
+
export default {
|
|
70
|
+
component: componentName,
|
|
71
|
+
title: 'descope-phone-input-box-field',
|
|
72
|
+
decorators: [toggleDefaultErrorMessageValueMissingDecorator, withForm],
|
|
73
|
+
argTypes: {
|
|
74
|
+
...labelControl,
|
|
75
|
+
...sizeControl,
|
|
76
|
+
...inputLabelTypeControl,
|
|
77
|
+
...fullWidthControl,
|
|
78
|
+
...disabledControl,
|
|
79
|
+
...readOnlyControl,
|
|
80
|
+
...requiredControl,
|
|
81
|
+
...borderedControl,
|
|
82
|
+
...minLengthControl,
|
|
83
|
+
...maxLengthControl,
|
|
84
|
+
...errorMissingValueControl,
|
|
85
|
+
...errorPatternMismatchControl,
|
|
86
|
+
...directionControl,
|
|
87
|
+
...errorMessageIconControl,
|
|
88
|
+
...defaultValueMissingControl,
|
|
89
|
+
'phone-input-placeholder': {
|
|
90
|
+
name: 'Phone Placeholder',
|
|
91
|
+
control: { type: 'text' },
|
|
92
|
+
},
|
|
93
|
+
'default-code': {
|
|
94
|
+
name: 'Default Code',
|
|
95
|
+
options: [''].concat(CountryCodes.map((c) => c.code)),
|
|
96
|
+
control: { type: 'select' },
|
|
97
|
+
},
|
|
98
|
+
'restrict-countries': {
|
|
99
|
+
name: 'Allowed Countries',
|
|
100
|
+
control: { type: 'text' },
|
|
101
|
+
},
|
|
102
|
+
'allow-alphanumeric-input': {
|
|
103
|
+
control: { type: 'boolean' },
|
|
104
|
+
},
|
|
105
|
+
'format-value': {
|
|
106
|
+
name: 'Format Value',
|
|
107
|
+
control: { type: 'boolean' },
|
|
108
|
+
},
|
|
109
|
+
'strict-validation': {
|
|
110
|
+
name: 'Strict Validation',
|
|
111
|
+
control: { type: 'boolean' },
|
|
112
|
+
},
|
|
113
|
+
'phone-input-type': {
|
|
114
|
+
name: 'Phone Input Type',
|
|
115
|
+
control: { type: 'select' },
|
|
116
|
+
options: ['tel', 'text'],
|
|
117
|
+
},
|
|
118
|
+
},
|
|
119
|
+
};
|
|
120
|
+
|
|
121
|
+
export const Default = Template.bind({});
|
|
122
|
+
|
|
123
|
+
Default.args = {
|
|
124
|
+
size: 'md',
|
|
125
|
+
bordered: true,
|
|
126
|
+
'data-errormessage-value-missing': 'Please fill out this field.',
|
|
127
|
+
'data-errormessage-pattern-mismatch': 'Please match the requested format.',
|
|
128
|
+
};
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { componentName } from '../src/components/descope-policy-validation';
|
|
2
|
+
import { directionControl } from './commonControls';
|
|
3
|
+
|
|
4
|
+
const availablePolicies = [
|
|
5
|
+
{
|
|
6
|
+
id: 'minlength',
|
|
7
|
+
message: 'At least {{value}} characters',
|
|
8
|
+
pattern: '^.{{{value}},}$',
|
|
9
|
+
data: {
|
|
10
|
+
value: 8,
|
|
11
|
+
},
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
id: 'lowercase',
|
|
15
|
+
message: '1 lowercase letter',
|
|
16
|
+
pattern: '[a-z]',
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
id: 'uppercase',
|
|
20
|
+
message: '1 uppercase letter',
|
|
21
|
+
pattern: '[A-Z]',
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
id: 'number',
|
|
25
|
+
message: '1 number',
|
|
26
|
+
pattern: '\\d',
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
id: 'nonalphanumeric',
|
|
30
|
+
message: '1 symbol',
|
|
31
|
+
pattern: '[^a-zA-Z0-9]',
|
|
32
|
+
},
|
|
33
|
+
];
|
|
34
|
+
|
|
35
|
+
const Template = ({
|
|
36
|
+
value,
|
|
37
|
+
label,
|
|
38
|
+
data,
|
|
39
|
+
direction,
|
|
40
|
+
useNumber,
|
|
41
|
+
useLowercase,
|
|
42
|
+
useUppercase,
|
|
43
|
+
useSymbol,
|
|
44
|
+
useMinLength,
|
|
45
|
+
minLengthValue,
|
|
46
|
+
}) => {
|
|
47
|
+
const policies = [
|
|
48
|
+
useMinLength ? 'minlength' : null,
|
|
49
|
+
useLowercase ? 'lowercase' : null,
|
|
50
|
+
useUppercase ? 'uppercase' : null,
|
|
51
|
+
useNumber ? 'number' : null,
|
|
52
|
+
useSymbol ? 'nonalphanumeric' : null,
|
|
53
|
+
].filter(Boolean);
|
|
54
|
+
|
|
55
|
+
return `
|
|
56
|
+
<descope-policy-validation
|
|
57
|
+
label="${label}"
|
|
58
|
+
value="${value}"
|
|
59
|
+
data='${JSON.stringify(data) || ''}'
|
|
60
|
+
active-policies="${policies || ''}"
|
|
61
|
+
data-password-policy-value-minlength="${minLengthValue || ''}"
|
|
62
|
+
st-host-direction="${direction ?? ''}"
|
|
63
|
+
></descope-policy-validation>
|
|
64
|
+
`;
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
export default {
|
|
68
|
+
component: componentName,
|
|
69
|
+
title: 'descope-policy-validation',
|
|
70
|
+
parameters: {
|
|
71
|
+
panelPosition: 'right',
|
|
72
|
+
controls: { expanded: true },
|
|
73
|
+
},
|
|
74
|
+
argTypes: {
|
|
75
|
+
...directionControl,
|
|
76
|
+
},
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
export const Default = Template.bind({});
|
|
80
|
+
|
|
81
|
+
Default.args = {
|
|
82
|
+
value: '',
|
|
83
|
+
label: 'Policy Validation',
|
|
84
|
+
data: availablePolicies,
|
|
85
|
+
'active-policies': [],
|
|
86
|
+
useNumber: false,
|
|
87
|
+
useLowercase: false,
|
|
88
|
+
useUppercase: false,
|
|
89
|
+
useSymbol: false,
|
|
90
|
+
useMinLength: false,
|
|
91
|
+
minLengthValue: undefined,
|
|
92
|
+
};
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
import { componentName } from '../src/components/descope-radio-group';
|
|
2
|
+
import {
|
|
3
|
+
sizeControl,
|
|
4
|
+
labelControl,
|
|
5
|
+
requiredControl,
|
|
6
|
+
readOnlyControl,
|
|
7
|
+
helperTextControl,
|
|
8
|
+
disabledControl,
|
|
9
|
+
errorMissingValueControl,
|
|
10
|
+
fullWidthControl,
|
|
11
|
+
directionControl,
|
|
12
|
+
overrideRenderItemControl,
|
|
13
|
+
itemsSourceControl,
|
|
14
|
+
errorMessageIconAttrs,
|
|
15
|
+
errorMessageIconControl,
|
|
16
|
+
defaultValueMissingControl,
|
|
17
|
+
} from './commonControls';
|
|
18
|
+
import { toggleDefaultErrorMessageValueMissingDecorator, withForm } from './helpers';
|
|
19
|
+
|
|
20
|
+
const Template = ({
|
|
21
|
+
size,
|
|
22
|
+
label,
|
|
23
|
+
required,
|
|
24
|
+
readonly,
|
|
25
|
+
'full-width': fullWidth,
|
|
26
|
+
direction,
|
|
27
|
+
disabled,
|
|
28
|
+
'helper-text': helperText,
|
|
29
|
+
'default-value': defaultValue,
|
|
30
|
+
'data-errormessage-value-missing': customErrorMissingValue,
|
|
31
|
+
data,
|
|
32
|
+
itemsSource,
|
|
33
|
+
'allow-deselect': allowDeselect,
|
|
34
|
+
layout,
|
|
35
|
+
buttonsRowGap,
|
|
36
|
+
buttonsColumnGap,
|
|
37
|
+
errorMsgIcon,
|
|
38
|
+
}) => {
|
|
39
|
+
let serializedData;
|
|
40
|
+
|
|
41
|
+
try {
|
|
42
|
+
serializedData = JSON.stringify(data);
|
|
43
|
+
} catch (e) {
|
|
44
|
+
// do nothing
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
return `
|
|
48
|
+
<descope-radio-group
|
|
49
|
+
layout="${layout || ''}"
|
|
50
|
+
data='${(itemsSource === 'attr' && serializedData) || ''}'
|
|
51
|
+
full-width="${fullWidth || false}"
|
|
52
|
+
size="${size || ''}"
|
|
53
|
+
label="${label || ''}"
|
|
54
|
+
helper-text="${helperText || ''}"
|
|
55
|
+
default-value="${defaultValue || ''}"
|
|
56
|
+
required="${required || false}"
|
|
57
|
+
readonly="${readonly || false}"
|
|
58
|
+
disabled="${disabled || false}"
|
|
59
|
+
allow-deselect="${allowDeselect || false}"
|
|
60
|
+
data-errormessage-value-missing="${customErrorMissingValue || ''}"
|
|
61
|
+
st-host-direction="${direction ?? ''}"
|
|
62
|
+
st-buttons-row-gap="${buttonsRowGap || ''}"
|
|
63
|
+
st-buttons-column-gap="${buttonsColumnGap || ''}"
|
|
64
|
+
${errorMsgIcon ? errorMessageIconAttrs : ''}
|
|
65
|
+
>
|
|
66
|
+
<descope-radio-button value="a" label="A">item1</descope-radio-button>
|
|
67
|
+
<descope-radio-button value="b" label="B">test test test test test test test test</descope-radio-button>
|
|
68
|
+
<descope-radio-button value="c" label="C">item2</descope-radio-button>
|
|
69
|
+
<descope-radio-button value="d" label="D">another item</descope-radio-button>
|
|
70
|
+
</descope-radio-group>
|
|
71
|
+
`;
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
export default {
|
|
75
|
+
component: componentName,
|
|
76
|
+
title: 'descope-radio-group',
|
|
77
|
+
decorators: [
|
|
78
|
+
(story, { args }) => {
|
|
79
|
+
setTimeout(() => {
|
|
80
|
+
const ele = document.querySelector('descope-radio-group');
|
|
81
|
+
if (args.itemSource === 'prop') {
|
|
82
|
+
ele.data = args.data;
|
|
83
|
+
}
|
|
84
|
+
});
|
|
85
|
+
return story();
|
|
86
|
+
},
|
|
87
|
+
toggleDefaultErrorMessageValueMissingDecorator,
|
|
88
|
+
withForm,
|
|
89
|
+
],
|
|
90
|
+
argTypes: {
|
|
91
|
+
...sizeControl,
|
|
92
|
+
...labelControl,
|
|
93
|
+
...readOnlyControl,
|
|
94
|
+
...requiredControl,
|
|
95
|
+
...helperTextControl,
|
|
96
|
+
...disabledControl,
|
|
97
|
+
...errorMissingValueControl,
|
|
98
|
+
...fullWidthControl,
|
|
99
|
+
'default-value': {
|
|
100
|
+
name: 'Default Value',
|
|
101
|
+
control: { type: 'text' },
|
|
102
|
+
},
|
|
103
|
+
'allow-deselect': {
|
|
104
|
+
name: 'Allow Deselect',
|
|
105
|
+
control: { type: 'boolean' },
|
|
106
|
+
},
|
|
107
|
+
readonly: {
|
|
108
|
+
name: 'Read Only',
|
|
109
|
+
control: { type: 'boolean' },
|
|
110
|
+
},
|
|
111
|
+
buttonsRowGap: {
|
|
112
|
+
name: 'Vertical gap between items',
|
|
113
|
+
control: { type: 'text' },
|
|
114
|
+
},
|
|
115
|
+
buttonsColumnGap: {
|
|
116
|
+
name: 'Horizontal gap between items',
|
|
117
|
+
control: { type: 'text' },
|
|
118
|
+
},
|
|
119
|
+
layout: {
|
|
120
|
+
name: 'Layout',
|
|
121
|
+
options: ['vertical', 'horizontal'],
|
|
122
|
+
control: { type: 'radio' },
|
|
123
|
+
},
|
|
124
|
+
...itemsSourceControl,
|
|
125
|
+
...directionControl,
|
|
126
|
+
...errorMessageIconControl,
|
|
127
|
+
...defaultValueMissingControl,
|
|
128
|
+
},
|
|
129
|
+
};
|
|
130
|
+
|
|
131
|
+
export const Default = Template.bind({});
|
|
132
|
+
|
|
133
|
+
Default.args = {
|
|
134
|
+
data: [
|
|
135
|
+
{ value: 'a', label: 'data item 1' },
|
|
136
|
+
{ value: 'b', label: 'data item 2' },
|
|
137
|
+
{ value: 'c', label: 'data item 3' },
|
|
138
|
+
{ value: 'd', label: 'data item 4' },
|
|
139
|
+
],
|
|
140
|
+
itemsSource: 'children',
|
|
141
|
+
'data-errormessage-value-missing': 'Please fill out this field.',
|
|
142
|
+
};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { componentName } from '../src/components/descope-recaptcha';
|
|
2
|
+
|
|
3
|
+
const Template = ({ enterprise, enabled, 'site-key': siteKey, variant, 'full-width': fullWidth }) =>
|
|
4
|
+
`
|
|
5
|
+
<descope-recaptcha
|
|
6
|
+
enterprise="${enterprise}"
|
|
7
|
+
site-key="${siteKey}"
|
|
8
|
+
enabled="${enabled}"
|
|
9
|
+
full-width="${fullWidth}"
|
|
10
|
+
${variant && variant !== 'none' ? `variant="${variant}"` : ''}
|
|
11
|
+
>
|
|
12
|
+
${
|
|
13
|
+
variant === 'text'
|
|
14
|
+
? `<descope-enriched-text variant="body1" mode="primary">This site is protected by reCAPTCHA</descope-enriched-text>`
|
|
15
|
+
: ''
|
|
16
|
+
}
|
|
17
|
+
</descope-recaptcha>
|
|
18
|
+
`;
|
|
19
|
+
|
|
20
|
+
export default {
|
|
21
|
+
component: componentName,
|
|
22
|
+
title: 'descope-recaptcha',
|
|
23
|
+
argTypes: {
|
|
24
|
+
variant: {
|
|
25
|
+
control: { type: 'select' },
|
|
26
|
+
options: ['none', 'text', 'widget'],
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
export const Default = Template.bind({});
|
|
32
|
+
|
|
33
|
+
Default.args = {
|
|
34
|
+
enabled: false,
|
|
35
|
+
'site-key': '',
|
|
36
|
+
enterprise: false,
|
|
37
|
+
'full-width': false,
|
|
38
|
+
};
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { componentName } from '../src/components/mapping-fields/descope-saml-group-mappings';
|
|
2
|
+
import { withForm } from './helpers';
|
|
3
|
+
import {
|
|
4
|
+
sizeControl,
|
|
5
|
+
fullWidthControl,
|
|
6
|
+
disabledControl,
|
|
7
|
+
directionControl,
|
|
8
|
+
readOnlyControl,
|
|
9
|
+
errorPatternMismatchControl,
|
|
10
|
+
errorMessageIconAttrs,
|
|
11
|
+
errorMessageIconControl,
|
|
12
|
+
} from './commonControls';
|
|
13
|
+
|
|
14
|
+
const Template = ({
|
|
15
|
+
size,
|
|
16
|
+
variant,
|
|
17
|
+
'full-width': fullWidth,
|
|
18
|
+
disabled,
|
|
19
|
+
direction,
|
|
20
|
+
'label-group': labelGroup,
|
|
21
|
+
'label-value': labelValue,
|
|
22
|
+
'label-attr': labelAttr,
|
|
23
|
+
'button-label': buttonLabel,
|
|
24
|
+
separator,
|
|
25
|
+
options,
|
|
26
|
+
readonly,
|
|
27
|
+
'data-errormessage-pattern-mismatch': customErrorPatternMismatch,
|
|
28
|
+
errorMsgIcon,
|
|
29
|
+
}) => {
|
|
30
|
+
let serializedOptions;
|
|
31
|
+
|
|
32
|
+
try {
|
|
33
|
+
serializedOptions = JSON.stringify(options);
|
|
34
|
+
} catch (e) {
|
|
35
|
+
// do nothing
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
return `
|
|
39
|
+
<descope-saml-group-mappings
|
|
40
|
+
size="${size}"
|
|
41
|
+
variant="${variant}"
|
|
42
|
+
disabled="${disabled || false}"
|
|
43
|
+
readonly="${readonly || false}"
|
|
44
|
+
full-width="${fullWidth || false}"
|
|
45
|
+
st-host-direction="${direction ?? ''}"
|
|
46
|
+
options='${serializedOptions || ''}'
|
|
47
|
+
button-label="${buttonLabel}"
|
|
48
|
+
separator="${separator}"
|
|
49
|
+
label-group="${labelGroup}"
|
|
50
|
+
label-value="${labelValue}"
|
|
51
|
+
label-attr="${labelAttr}"
|
|
52
|
+
data-errormessage-pattern-mismatch="${customErrorPatternMismatch || ''}"
|
|
53
|
+
${errorMsgIcon ? errorMessageIconAttrs : ''}
|
|
54
|
+
>
|
|
55
|
+
</descope-saml-group-mappings>`;
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
export default {
|
|
59
|
+
component: componentName,
|
|
60
|
+
title: 'descope-saml-group-mappings',
|
|
61
|
+
decorators: [withForm],
|
|
62
|
+
argTypes: {
|
|
63
|
+
'label-group': {
|
|
64
|
+
name: 'Label Group Value',
|
|
65
|
+
control: { type: 'text' },
|
|
66
|
+
},
|
|
67
|
+
'label-value': {
|
|
68
|
+
name: 'Label Value',
|
|
69
|
+
control: { type: 'text' },
|
|
70
|
+
},
|
|
71
|
+
'label-attr': {
|
|
72
|
+
name: 'Label Attribute',
|
|
73
|
+
control: { type: 'text' },
|
|
74
|
+
},
|
|
75
|
+
'button-label': {
|
|
76
|
+
name: 'Button Label',
|
|
77
|
+
control: { type: 'text' },
|
|
78
|
+
},
|
|
79
|
+
separator: {
|
|
80
|
+
name: 'Separator',
|
|
81
|
+
control: { type: 'text' },
|
|
82
|
+
},
|
|
83
|
+
...sizeControl,
|
|
84
|
+
...fullWidthControl,
|
|
85
|
+
...disabledControl,
|
|
86
|
+
...readOnlyControl,
|
|
87
|
+
...directionControl,
|
|
88
|
+
...errorPatternMismatchControl,
|
|
89
|
+
...errorMessageIconControl,
|
|
90
|
+
},
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
export const Default = Template.bind({});
|
|
94
|
+
|
|
95
|
+
Default.args = {
|
|
96
|
+
size: 'md',
|
|
97
|
+
'full-width': false,
|
|
98
|
+
'label-group': 'Group Attribute Name',
|
|
99
|
+
'label-value': 'IdP Group Name',
|
|
100
|
+
'label-attr': 'Role',
|
|
101
|
+
'button-label': 'Add group mapping',
|
|
102
|
+
separator: 'map to',
|
|
103
|
+
options: [
|
|
104
|
+
{ value: 'itemId1', label: 'item 1' },
|
|
105
|
+
{ value: 'itemId2', label: 'item 2' },
|
|
106
|
+
{ value: 'itemId3', label: 'item 3' },
|
|
107
|
+
{ value: 'itemId4', label: 'item 4' },
|
|
108
|
+
],
|
|
109
|
+
};
|