@descope/web-components-ui 1.0.232 → 1.0.234
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 +137 -16
- package/dist/cjs/index.cjs.js.map +1 -1
- package/dist/index.esm.js +219 -88
- package/dist/index.esm.js.map +1 -1
- package/dist/umd/2481.js +1 -1
- package/dist/umd/4201.js +1 -1
- package/dist/umd/4226.js +114 -0
- package/dist/umd/{1769.js.LICENSE.txt → 4226.js.LICENSE.txt} +0 -12
- package/dist/umd/446.js +92 -0
- package/dist/umd/446.js.LICENSE.txt +5 -0
- package/dist/umd/4803.js +1 -1
- package/dist/umd/7531.js +248 -0
- package/dist/umd/{4222.js.LICENSE.txt → 7531.js.LICENSE.txt} +18 -0
- package/dist/umd/9671.js +1 -1
- package/dist/umd/boolean-fields-descope-checkbox-index-js.js +1 -1
- package/dist/umd/boolean-fields-descope-switch-toggle-index-js.js +1 -1
- package/dist/umd/descope-button-index-js.js +1 -1
- package/dist/umd/descope-button-selection-group-descope-button-selection-group-item-index-js.js +1 -1
- package/dist/umd/descope-button-selection-group-index-js.js +1 -1
- package/dist/umd/descope-combo-box-index-js.js +1 -1
- package/dist/umd/descope-container-index-js.js +1 -1
- package/dist/umd/descope-divider-index-js.js +1 -1
- package/dist/umd/descope-email-field-index-js.js +1 -1
- package/dist/umd/descope-grid-descope-grid-status-column-index-js.js +1 -1
- package/dist/umd/descope-grid-descope-grid-text-column-index-js.js +1 -1
- package/dist/umd/descope-grid-index-js.js +1 -1
- package/dist/umd/descope-link-index-js.js +1 -1
- package/dist/umd/descope-new-password-descope-new-password-internal-index-js.js +1 -1
- package/dist/umd/descope-number-field-index-js.js +1 -1
- package/dist/umd/descope-passcode-descope-passcode-internal-index-js.js +1 -1
- package/dist/umd/descope-passcode-index-js.js +1 -1
- package/dist/umd/descope-text-area-index-js.js +1 -1
- package/dist/umd/descope-text-field-index-js.js +1 -1
- package/dist/umd/descope-text-index-js.js +1 -1
- package/dist/umd/descope-upload-file-index-js.js +1 -1
- package/dist/umd/index.js +1 -1
- package/dist/umd/phone-fields-descope-phone-field-index-js.js +1 -1
- package/dist/umd/phone-fields-descope-phone-input-box-field-index-js.js +1 -1
- package/package.json +1 -1
- package/src/components/boolean-fields/commonStyles.js +1 -1
- package/src/components/boolean-fields/descope-checkbox/CheckboxClass.js +7 -2
- package/src/components/boolean-fields/descope-switch-toggle/SwitchToggleClass.js +6 -1
- package/src/components/descope-button/ButtonClass.js +5 -1
- package/src/components/descope-button-selection-group/ButtonSelectionGroupClass.js +3 -0
- package/src/components/descope-button-selection-group/descope-button-selection-group-item/ButtonSelectionGroupItemClass.js +4 -0
- package/src/components/descope-combo-box/ComboBoxClass.js +14 -0
- package/src/components/descope-container/ContainerClass.js +1 -1
- package/src/components/descope-divider/DividerClass.js +4 -0
- package/src/components/descope-email-field/EmailFieldClass.js +3 -1
- package/src/components/descope-grid/GridClass.js +3 -0
- package/src/components/descope-grid/descope-grid-status-column/index.js +2 -2
- package/src/components/descope-grid/descope-grid-text-column/index.js +6 -2
- package/src/components/descope-link/LinkClass.js +1 -0
- package/src/components/descope-new-password/NewPasswordClass.js +10 -2
- package/src/components/descope-new-password/descope-new-password-internal/NewPasswordInternal.js +6 -1
- package/src/components/descope-number-field/NumberFieldClass.js +2 -0
- package/src/components/descope-passcode/PasscodeClass.js +3 -0
- package/src/components/descope-passcode/descope-passcode-internal/PasscodeInternal.js +5 -0
- package/src/components/descope-password/PasswordClass.js +8 -2
- package/src/components/descope-text/TextClass.js +1 -0
- package/src/components/descope-text-area/TextAreaClass.js +4 -1
- package/src/components/descope-text-field/TextFieldClass.js +3 -1
- package/src/components/descope-text-field/textFieldMappings.js +1 -0
- package/src/components/descope-upload-file/UploadFileClass.js +6 -0
- package/src/components/phone-fields/descope-phone-field/PhoneFieldClass.js +4 -2
- package/src/components/phone-fields/descope-phone-input-box-field/PhoneFieldInputBoxClass.js +4 -2
- package/src/helpers/themeHelpers/resetHelpers.js +28 -0
- package/src/theme/components/button.js +1 -0
- package/src/theme/components/buttonSelectionGroup/buttonSelectionGroup.js +1 -0
- package/src/theme/components/buttonSelectionGroup/buttonSelectionGroupItem.js +1 -0
- package/src/theme/components/checkbox.js +1 -0
- package/src/theme/components/comboBox.js +3 -0
- package/src/theme/components/divider.js +2 -0
- package/src/theme/components/emailField.js +1 -0
- package/src/theme/components/inputWrapper.js +2 -0
- package/src/theme/components/link.js +1 -0
- package/src/theme/components/newPassword.js +1 -0
- package/src/theme/components/numberField.js +1 -0
- package/src/theme/components/passcode.js +1 -0
- package/src/theme/components/password.js +1 -0
- package/src/theme/components/phoneField.js +1 -0
- package/src/theme/components/phoneInputBoxField.js +1 -0
- package/src/theme/components/switchToggle.js +1 -0
- package/src/theme/components/text.js +1 -0
- package/src/theme/components/textArea.js +1 -0
- package/src/theme/components/textField.js +1 -0
- package/src/theme/components/uploadFile.js +1 -0
- package/src/theme/globals.js +3 -0
- package/dist/umd/1769.js +0 -360
- package/dist/umd/4222.js +0 -2
- package/dist/umd/6551.js +0 -1
|
@@ -2,6 +2,7 @@ import { createStyleMixin, draggableMixin, componentNameValidationMixin } from '
|
|
|
2
2
|
import { createBaseClass } from '../../baseClasses/createBaseClass';
|
|
3
3
|
import { compose } from '../../helpers';
|
|
4
4
|
import { forwardAttrs, getComponentName } from '../../helpers/componentHelpers';
|
|
5
|
+
import { TextClass } from '../descope-text/TextClass';
|
|
5
6
|
|
|
6
7
|
export const componentName = getComponentName('divider');
|
|
7
8
|
class RawDivider extends createBaseClass({ componentName, baseSelector: ':host > div' }) {
|
|
@@ -49,6 +50,7 @@ class RawDivider extends createBaseClass({ componentName, baseSelector: ':host >
|
|
|
49
50
|
}
|
|
50
51
|
}
|
|
51
52
|
|
|
53
|
+
const textVars = TextClass.cssVarList;
|
|
52
54
|
const { host, before, after, text } = {
|
|
53
55
|
host: { selector: () => ':host' },
|
|
54
56
|
before: { selector: '::before' },
|
|
@@ -61,11 +63,13 @@ export const DividerClass = compose(
|
|
|
61
63
|
mappings: {
|
|
62
64
|
hostWidth: { ...host, property: 'width' },
|
|
63
65
|
hostPadding: { ...host, property: 'padding' },
|
|
66
|
+
hostDirection: { ...text, property: 'direction' },
|
|
64
67
|
|
|
65
68
|
minHeight: {},
|
|
66
69
|
alignItems: {},
|
|
67
70
|
alignSelf: {},
|
|
68
71
|
flexDirection: {},
|
|
72
|
+
textAlign: { ...text, property: textVars.textAlign },
|
|
69
73
|
|
|
70
74
|
labelTextWidth: { ...text, property: 'width' },
|
|
71
75
|
labelTextMaxWidth: { ...text, property: 'max-width' },
|
|
@@ -9,6 +9,7 @@ import textFieldMappings from '../descope-text-field/textFieldMappings';
|
|
|
9
9
|
import { compose } from '../../helpers';
|
|
10
10
|
import { getComponentName } from '../../helpers/componentHelpers';
|
|
11
11
|
import {
|
|
12
|
+
resetInputLabelPosition,
|
|
12
13
|
resetInputOverrides,
|
|
13
14
|
useHostExternalPadding,
|
|
14
15
|
} from '../../helpers/themeHelpers/resetHelpers';
|
|
@@ -41,8 +42,9 @@ export const EmailFieldClass = compose(
|
|
|
41
42
|
padding: calc(var(${EmailFieldClass.cssVarList.inputOutlineWidth}) + var(${
|
|
42
43
|
EmailFieldClass.cssVarList.inputOutlineOffset
|
|
43
44
|
}));
|
|
44
|
-
box-sizing: border-box;
|
|
45
|
+
box-sizing: border-box;
|
|
45
46
|
}
|
|
47
|
+
${resetInputLabelPosition('vaadin-email-field')}
|
|
46
48
|
${useHostExternalPadding(EmailFieldClass.cssVarList)}
|
|
47
49
|
${resetInputOverrides('vaadin-email-field', EmailFieldClass.cssVarList)}
|
|
48
50
|
`,
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/* eslint-disable no-param-reassign */
|
|
2
|
-
import {
|
|
2
|
+
import { GridSortColumn } from '@vaadin/grid/vaadin-grid-sort-column';
|
|
3
3
|
import { getComponentName } from '../../../helpers/componentHelpers';
|
|
4
4
|
|
|
5
5
|
export const componentName = getComponentName('grid-status-column');
|
|
6
|
-
class GridStatusColumnClass extends
|
|
6
|
+
class GridStatusColumnClass extends GridSortColumn {
|
|
7
7
|
_defaultRenderer(cell, _col, model) {
|
|
8
8
|
const contentAttr = this.getAttribute('status');
|
|
9
9
|
if (!contentAttr) {
|
|
@@ -1,10 +1,14 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { GridSortColumn } from '@vaadin/grid/vaadin-grid-sort-column';
|
|
2
|
+
|
|
3
|
+
// if we do not want the sort column, we should import this class
|
|
4
|
+
// import { GridColumn } from '@vaadin/grid/vaadin-grid-column';
|
|
5
|
+
|
|
2
6
|
import '../../descope-button';
|
|
3
7
|
import { getComponentName } from '../../../helpers/componentHelpers';
|
|
4
8
|
|
|
5
9
|
export const componentName = getComponentName('grid-text-column');
|
|
6
10
|
|
|
7
|
-
class GridTextColumnClass extends
|
|
11
|
+
class GridTextColumnClass extends GridSortColumn {}
|
|
8
12
|
|
|
9
13
|
customElements.define(componentName, GridTextColumnClass);
|
|
10
14
|
|
|
@@ -45,12 +45,13 @@ const customMixin = (superclass) =>
|
|
|
45
45
|
}
|
|
46
46
|
};
|
|
47
47
|
|
|
48
|
-
const { host, label, internalInputsWrapper, errorMessage, helperText } = {
|
|
48
|
+
const { host, label, internalInputsWrapper, errorMessage, helperText, passwordInput } = {
|
|
49
49
|
host: { selector: () => ':host' },
|
|
50
50
|
label: { selector: '::part(label)' },
|
|
51
51
|
internalInputsWrapper: { selector: 'descope-new-password-internal .wrapper' },
|
|
52
52
|
helperText: { selector: '::part(helper-text)' },
|
|
53
53
|
errorMessage: { selector: '::part(error-message)' },
|
|
54
|
+
passwordInput: { selector: 'descope-password' },
|
|
54
55
|
};
|
|
55
56
|
|
|
56
57
|
export const NewPasswordClass = compose(
|
|
@@ -68,6 +69,10 @@ export const NewPasswordClass = compose(
|
|
|
68
69
|
errorMessageTextColor: { ...errorMessage, property: 'color' },
|
|
69
70
|
hostWidth: { ...host, property: 'width' },
|
|
70
71
|
hostMinWidth: { ...host, property: 'min-width' },
|
|
72
|
+
hostDirection: [
|
|
73
|
+
{ ...host, property: 'direction' },
|
|
74
|
+
{ ...passwordInput, property: PasswordClass.cssVarList.hostDirection },
|
|
75
|
+
],
|
|
71
76
|
inputsRequiredIndicator: { ...host, property: 'content' },
|
|
72
77
|
spaceBetweenInputs: { ...internalInputsWrapper, property: 'gap' },
|
|
73
78
|
},
|
|
@@ -85,6 +90,9 @@ export const NewPasswordClass = compose(
|
|
|
85
90
|
max-width: 100%;
|
|
86
91
|
box-sizing: border-box;
|
|
87
92
|
}
|
|
93
|
+
:host ::part(error-message) {
|
|
94
|
+
direction: ltr;
|
|
95
|
+
}
|
|
88
96
|
${useHostExternalPadding(PasswordClass.cssVarList)}
|
|
89
97
|
vaadin-text-field {
|
|
90
98
|
padding: 0;
|
|
@@ -120,7 +128,7 @@ export const NewPasswordClass = compose(
|
|
|
120
128
|
}
|
|
121
129
|
descope-new-password-internal vaadin-password-field::before {
|
|
122
130
|
height: initial;
|
|
123
|
-
}
|
|
131
|
+
}
|
|
124
132
|
`,
|
|
125
133
|
excludeAttrsSync: ['tabindex'],
|
|
126
134
|
componentName,
|
package/src/components/descope-new-password/descope-new-password-internal/NewPasswordInternal.js
CHANGED
|
@@ -113,9 +113,14 @@ class NewPasswordInternal extends BaseInputClass {
|
|
|
113
113
|
this.inputs.forEach((input) => {
|
|
114
114
|
const styleTag = document.createElement('style');
|
|
115
115
|
styleTag.innerHTML = `
|
|
116
|
-
:host::part(required-indicator)::after {
|
|
116
|
+
:host ::part(required-indicator)::after {
|
|
117
117
|
content: var(${NewPasswordClass.cssVarList.inputsRequiredIndicator});
|
|
118
|
+
width: 1em;
|
|
119
|
+
text-align: center;
|
|
118
120
|
}
|
|
121
|
+
:host ::part(required-indicator) {
|
|
122
|
+
display: inline-flex;
|
|
123
|
+
}
|
|
119
124
|
`;
|
|
120
125
|
input?.shadowRoot.appendChild(styleTag);
|
|
121
126
|
});
|
|
@@ -9,6 +9,7 @@ import textFieldMappings from '../descope-text-field/textFieldMappings';
|
|
|
9
9
|
import { compose } from '../../helpers';
|
|
10
10
|
import { getComponentName } from '../../helpers/componentHelpers';
|
|
11
11
|
import {
|
|
12
|
+
resetInputLabelPosition,
|
|
12
13
|
resetInputOverrides,
|
|
13
14
|
useHostExternalPadding,
|
|
14
15
|
} from '../../helpers/themeHelpers/resetHelpers';
|
|
@@ -34,6 +35,7 @@ export const NumberFieldClass = compose(
|
|
|
34
35
|
NumberFieldClass.cssVarList.inputOutlineOffset
|
|
35
36
|
}));
|
|
36
37
|
}
|
|
38
|
+
${resetInputLabelPosition('vaadin-number-field')}
|
|
37
39
|
${useHostExternalPadding(NumberFieldClass.cssVarList)}
|
|
38
40
|
${resetInputOverrides('vaadin-number-field', NumberFieldClass.cssVarList)}
|
|
39
41
|
`,
|
|
@@ -11,6 +11,7 @@ import { compose } from '../../helpers';
|
|
|
11
11
|
import { forwardAttrs, getComponentName } from '../../helpers/componentHelpers';
|
|
12
12
|
import {
|
|
13
13
|
resetInputCursor,
|
|
14
|
+
resetInputLabelPosition,
|
|
14
15
|
resetInputFieldDefaultWidth,
|
|
15
16
|
} from '../../helpers/themeHelpers/resetHelpers';
|
|
16
17
|
|
|
@@ -82,6 +83,7 @@ export const PasscodeClass = compose(
|
|
|
82
83
|
mappings: {
|
|
83
84
|
fontSize: [{ ...digitField, property: textVars.fontSize }, host],
|
|
84
85
|
hostWidth: { property: 'width' },
|
|
86
|
+
hostDirection: { ...host, property: 'direction' },
|
|
85
87
|
fontFamily: [host, { ...label }],
|
|
86
88
|
labelTextColor: [
|
|
87
89
|
{ ...label, property: 'color' },
|
|
@@ -178,6 +180,7 @@ export const PasscodeClass = compose(
|
|
|
178
180
|
box-shadow: none;
|
|
179
181
|
}
|
|
180
182
|
|
|
183
|
+
${resetInputLabelPosition('vaadin-text-field')}
|
|
181
184
|
${resetInputCursor('vaadin-text-field')}
|
|
182
185
|
`,
|
|
183
186
|
excludeAttrsSync: ['tabindex'],
|
|
@@ -8,7 +8,11 @@ import {
|
|
|
8
8
|
import { compose } from '../../helpers';
|
|
9
9
|
import { getComponentName } from '../../helpers/componentHelpers';
|
|
10
10
|
import passwordDraggableMixin from './passwordDraggableMixin';
|
|
11
|
-
import {
|
|
11
|
+
import {
|
|
12
|
+
resetInputLabelPosition,
|
|
13
|
+
resetInputCursor,
|
|
14
|
+
useHostExternalPadding,
|
|
15
|
+
} from '../../helpers/themeHelpers/resetHelpers';
|
|
12
16
|
|
|
13
17
|
export const componentName = getComponentName('password');
|
|
14
18
|
|
|
@@ -41,6 +45,7 @@ export const PasswordClass = compose(
|
|
|
41
45
|
mappings: {
|
|
42
46
|
hostWidth: { ...host, property: 'width' },
|
|
43
47
|
hostMinWidth: { ...host, property: 'min-width' },
|
|
48
|
+
hostDirection: { ...host, property: 'direction' },
|
|
44
49
|
fontSize: [{}, host],
|
|
45
50
|
fontFamily: [label, inputField, errorMessage, helperText],
|
|
46
51
|
inputHeight: { ...inputField, property: 'height' },
|
|
@@ -93,10 +98,11 @@ export const PasswordClass = compose(
|
|
|
93
98
|
display: inline-block;
|
|
94
99
|
max-width: 100%;
|
|
95
100
|
min-width: 10em;
|
|
96
|
-
box-sizing: border-box;
|
|
101
|
+
box-sizing: border-box;
|
|
97
102
|
}
|
|
98
103
|
${useHostExternalPadding(PasswordClass.cssVarList)}
|
|
99
104
|
${resetInputCursor('vaadin-password-field')}
|
|
105
|
+
${resetInputLabelPosition('vaadin-password-field')}
|
|
100
106
|
|
|
101
107
|
vaadin-password-field {
|
|
102
108
|
width: 100%;
|
|
@@ -45,6 +45,7 @@ export const TextClass = compose(
|
|
|
45
45
|
createStyleMixin({
|
|
46
46
|
mappings: {
|
|
47
47
|
hostWidth: { selector: () => ':host', property: 'width' },
|
|
48
|
+
hostDirection: { selector: () => ':host', property: 'direction' },
|
|
48
49
|
fontSize: {},
|
|
49
50
|
textColor: { property: 'color' },
|
|
50
51
|
textLineHeight: { property: 'line-height' },
|
|
@@ -10,6 +10,7 @@ import { getComponentName } from '../../helpers/componentHelpers';
|
|
|
10
10
|
import {
|
|
11
11
|
resetInputContainer,
|
|
12
12
|
resetInputCursor,
|
|
13
|
+
resetInputLabelPosition,
|
|
13
14
|
resetInputField,
|
|
14
15
|
resetInputPlaceholder,
|
|
15
16
|
useHostExternalPadding,
|
|
@@ -42,6 +43,7 @@ export const TextAreaClass = compose(
|
|
|
42
43
|
mappings: {
|
|
43
44
|
hostWidth: { ...host, property: 'width' },
|
|
44
45
|
hostMinWidth: { ...host, property: 'min-width' },
|
|
46
|
+
hostDirection: { ...host, property: 'direction' },
|
|
45
47
|
fontSize: [host, textArea],
|
|
46
48
|
fontFamily: [label, inputField, helperText, errorMessage],
|
|
47
49
|
labelTextColor: [
|
|
@@ -76,11 +78,12 @@ export const TextAreaClass = compose(
|
|
|
76
78
|
:host {
|
|
77
79
|
display: inline-block;
|
|
78
80
|
max-width: 100%;
|
|
79
|
-
box-sizing: border-box;
|
|
81
|
+
box-sizing: border-box;
|
|
80
82
|
}
|
|
81
83
|
textarea {
|
|
82
84
|
height: 100%;
|
|
83
85
|
}
|
|
86
|
+
${resetInputLabelPosition('vaadin-text-area')}
|
|
84
87
|
${useHostExternalPadding(TextAreaClass.cssVarList)}
|
|
85
88
|
${resetInputContainer('vaadin-text-area')}
|
|
86
89
|
${resetInputField('vaadin-text-area')}
|
|
@@ -9,6 +9,7 @@ import textFieldMappings from './textFieldMappings';
|
|
|
9
9
|
import { compose } from '../../helpers';
|
|
10
10
|
import { getComponentName } from '../../helpers/componentHelpers';
|
|
11
11
|
import {
|
|
12
|
+
resetInputLabelPosition,
|
|
12
13
|
resetInputOverrides,
|
|
13
14
|
useHostExternalPadding,
|
|
14
15
|
} from '../../helpers/themeHelpers/resetHelpers';
|
|
@@ -56,8 +57,9 @@ export const TextFieldClass = compose(
|
|
|
56
57
|
padding: calc(var(${TextFieldClass.cssVarList.inputOutlineWidth}) + var(${
|
|
57
58
|
TextFieldClass.cssVarList.inputOutlineOffset
|
|
58
59
|
}));
|
|
59
|
-
box-sizing: border-box;
|
|
60
|
+
box-sizing: border-box;
|
|
60
61
|
}
|
|
62
|
+
${resetInputLabelPosition('vaadin-text-field')}
|
|
61
63
|
${useHostExternalPadding(TextFieldClass.cssVarList)}
|
|
62
64
|
${resetInputOverrides('vaadin-text-field', TextFieldClass.cssVarList)}
|
|
63
65
|
`,
|
|
@@ -2,6 +2,7 @@ import { createStyleMixin, draggableMixin, componentNameValidationMixin } from '
|
|
|
2
2
|
import { compose } from '../../helpers';
|
|
3
3
|
import { getComponentName } from '../../helpers/componentHelpers';
|
|
4
4
|
import { createBaseInputClass } from '../../baseClasses/createBaseInputClass';
|
|
5
|
+
import { ButtonClass } from '../descope-button/ButtonClass';
|
|
5
6
|
import { getFileBase64, getFilename } from './helpers';
|
|
6
7
|
|
|
7
8
|
export const componentName = getComponentName('upload-file');
|
|
@@ -190,6 +191,7 @@ class RawUploadFile extends BaseInputClass {
|
|
|
190
191
|
}
|
|
191
192
|
}
|
|
192
193
|
|
|
194
|
+
const buttonVars = ButtonClass.cssVarList;
|
|
193
195
|
const { host, wrapper, icon, title, description, requiredIndicator } = {
|
|
194
196
|
host: { selector: () => ':host' },
|
|
195
197
|
wrapper: { selector: () => ':host > div' },
|
|
@@ -212,6 +214,10 @@ export const UploadFileClass = compose(
|
|
|
212
214
|
hostHeight: { ...host, property: 'height' },
|
|
213
215
|
hostWidth: { ...host, property: 'width' },
|
|
214
216
|
hostPadding: { property: 'padding' },
|
|
217
|
+
hostDirection: [
|
|
218
|
+
{ ...host, property: 'direction' },
|
|
219
|
+
{ selector: () => ButtonClass.componentName, property: buttonVars.hostDirection },
|
|
220
|
+
],
|
|
215
221
|
gap: { ...wrapper },
|
|
216
222
|
lineHeight: { ...wrapper, property: 'line-height' },
|
|
217
223
|
titleFontSize: { ...title, property: 'font-size' },
|
|
@@ -7,6 +7,7 @@ import { ComboBoxClass } from '../../descope-combo-box/ComboBoxClass';
|
|
|
7
7
|
import CountryCodes from '../CountryCodes';
|
|
8
8
|
import {
|
|
9
9
|
resetInputCursor,
|
|
10
|
+
resetInputLabelPosition,
|
|
10
11
|
resetInputFieldDefaultWidth,
|
|
11
12
|
resetInputFieldInvalidBackgroundColor,
|
|
12
13
|
useHostExternalPadding,
|
|
@@ -107,6 +108,7 @@ export const PhoneFieldClass = compose(
|
|
|
107
108
|
{ ...phoneInput, property: 'width' },
|
|
108
109
|
{ ...countryCodeInput, property: '--vaadin-combo-box-overlay-width' },
|
|
109
110
|
],
|
|
111
|
+
hostDirection: { ...host, property: 'direction' },
|
|
110
112
|
|
|
111
113
|
inputBorderStyle: [
|
|
112
114
|
{ ...inputField, property: 'border-style' },
|
|
@@ -190,16 +192,15 @@ export const PhoneFieldClass = compose(
|
|
|
190
192
|
}
|
|
191
193
|
vaadin-text-field::part(input-field) {
|
|
192
194
|
padding: 0;
|
|
193
|
-
min-height: 0;
|
|
194
195
|
background: transparent;
|
|
195
196
|
overflow: hidden;
|
|
196
197
|
}
|
|
197
198
|
descope-phone-field-internal {
|
|
198
199
|
-webkit-mask-image: none;
|
|
199
200
|
padding: 0;
|
|
200
|
-
min-height: 0;
|
|
201
201
|
width: 100%;
|
|
202
202
|
height: 100%;
|
|
203
|
+
direction: ltr;
|
|
203
204
|
}
|
|
204
205
|
descope-phone-field-internal > div {
|
|
205
206
|
width: 100%;
|
|
@@ -230,6 +231,7 @@ export const PhoneFieldClass = compose(
|
|
|
230
231
|
vaadin-text-field::part(input-field)::after {
|
|
231
232
|
border: none;
|
|
232
233
|
}
|
|
234
|
+
${resetInputLabelPosition('vaadin-text-field')}
|
|
233
235
|
`,
|
|
234
236
|
excludeAttrsSync: ['tabindex'],
|
|
235
237
|
componentName,
|
package/src/components/phone-fields/descope-phone-input-box-field/PhoneFieldInputBoxClass.js
CHANGED
|
@@ -5,6 +5,7 @@ import { createProxy, createStyleMixin, draggableMixin, proxyInputMixin } from '
|
|
|
5
5
|
import { TextFieldClass } from '../../descope-text-field/TextFieldClass';
|
|
6
6
|
import CountryCodes from '../CountryCodes';
|
|
7
7
|
import {
|
|
8
|
+
resetInputLabelPosition,
|
|
8
9
|
resetInputCursor,
|
|
9
10
|
resetInputFieldDefaultWidth,
|
|
10
11
|
resetInputFieldInvalidBackgroundColor,
|
|
@@ -76,6 +77,7 @@ export const PhoneFieldInputBoxClass = compose(
|
|
|
76
77
|
fontFamily: [label, errorMessage, helperText],
|
|
77
78
|
hostWidth: { ...host, property: 'width' },
|
|
78
79
|
hostMinWidth: { ...host, property: 'min-width' },
|
|
80
|
+
hostDirection: { ...host, property: 'direction' },
|
|
79
81
|
|
|
80
82
|
inputBorderStyle: { ...inputField, property: 'border-style' },
|
|
81
83
|
inputBorderWidth: { ...inputField, property: 'border-width' },
|
|
@@ -131,7 +133,6 @@ export const PhoneFieldInputBoxClass = compose(
|
|
|
131
133
|
}
|
|
132
134
|
vaadin-text-field::part(input-field) {
|
|
133
135
|
padding: 0;
|
|
134
|
-
min-height: 0;
|
|
135
136
|
background: transparent;
|
|
136
137
|
overflow: hidden;
|
|
137
138
|
-webkit-mask-image: none;
|
|
@@ -139,7 +140,6 @@ export const PhoneFieldInputBoxClass = compose(
|
|
|
139
140
|
descope-phone-field-internal-input-box {
|
|
140
141
|
-webkit-mask-image: none;
|
|
141
142
|
padding: 0;
|
|
142
|
-
min-height: 0;
|
|
143
143
|
width: 100%;
|
|
144
144
|
height: 100%;
|
|
145
145
|
}
|
|
@@ -158,6 +158,7 @@ export const PhoneFieldInputBoxClass = compose(
|
|
|
158
158
|
${textVars.inputOutlineOffset}: 0;
|
|
159
159
|
${textVars.inputBorderWidth}: 0;
|
|
160
160
|
${textVars.inputBorderRadius}: 0;
|
|
161
|
+
direction: ltr;
|
|
161
162
|
}
|
|
162
163
|
vaadin-text-field[readonly] > input:placeholder-shown {
|
|
163
164
|
opacity: 1;
|
|
@@ -165,6 +166,7 @@ export const PhoneFieldInputBoxClass = compose(
|
|
|
165
166
|
vaadin-text-field::part(input-field)::after {
|
|
166
167
|
border: none;
|
|
167
168
|
}
|
|
169
|
+
${resetInputLabelPosition('vaadin-text-field')}
|
|
168
170
|
`,
|
|
169
171
|
excludeAttrsSync: ['tabindex'],
|
|
170
172
|
componentName,
|
|
@@ -98,3 +98,31 @@ export const resetInputOverrides = (name, cssVarList) => `
|
|
|
98
98
|
${resetInputElement(name)}
|
|
99
99
|
${resetInputFieldUnderlayingBorder(name)}
|
|
100
100
|
`;
|
|
101
|
+
|
|
102
|
+
// This function is used to support RTL correctly for input components.
|
|
103
|
+
// It also fixes the error message to be displayed LTR since we currently
|
|
104
|
+
// don't support RTL for error messages.
|
|
105
|
+
export const resetInputLabelPosition = (name) => `
|
|
106
|
+
:host ::part(error-message) {
|
|
107
|
+
direction: ltr;
|
|
108
|
+
}
|
|
109
|
+
:host([required]) ::part(required-indicator) {
|
|
110
|
+
width: 1em;
|
|
111
|
+
display: inline-flex;
|
|
112
|
+
}
|
|
113
|
+
:host([required]) ::part(required-indicator)::after {
|
|
114
|
+
position: static;
|
|
115
|
+
}
|
|
116
|
+
:host([has-label]) ::part(label) {
|
|
117
|
+
padding-right: 0;
|
|
118
|
+
padding-bottom: 0;
|
|
119
|
+
display: flex;
|
|
120
|
+
width: 100%;
|
|
121
|
+
}
|
|
122
|
+
${name} [slot="label"] {
|
|
123
|
+
max-width: calc(100% - 1em);
|
|
124
|
+
overflow: hidden;
|
|
125
|
+
text-overflow: ellipsis;
|
|
126
|
+
padding-bottom: 0.5em;
|
|
127
|
+
}
|
|
128
|
+
`;
|
|
@@ -23,6 +23,7 @@ const button = {
|
|
|
23
23
|
[compVars.cursor]: 'pointer',
|
|
24
24
|
[compVars.hostHeight]: '3em',
|
|
25
25
|
[compVars.hostWidth]: 'auto',
|
|
26
|
+
[compVars.hostDirection]: globalRefs.direction,
|
|
26
27
|
|
|
27
28
|
[compVars.borderRadius]: globalRefs.radius.sm,
|
|
28
29
|
[compVars.borderWidth]: globalRefs.border.xs,
|
|
@@ -7,6 +7,7 @@ const globalRefs = getThemeRefs(globals);
|
|
|
7
7
|
const vars = ButtonSelectionGroupClass.cssVarList;
|
|
8
8
|
|
|
9
9
|
const buttonSelectionGroup = {
|
|
10
|
+
[vars.hostDirection]: refs.direction,
|
|
10
11
|
[vars.fontFamily]: refs.fontFamily,
|
|
11
12
|
[vars.labelTextColor]: refs.labelTextColor,
|
|
12
13
|
[vars.labelRequiredIndicator]: refs.requiredIndicator,
|
|
@@ -7,6 +7,7 @@ const globalRefs = getThemeRefs(globals);
|
|
|
7
7
|
export const vars = ButtonSelectionGroupItemClass.cssVarList;
|
|
8
8
|
|
|
9
9
|
const buttonSelectionGroupItem = {
|
|
10
|
+
[vars.hostDirection]: 'inherit',
|
|
10
11
|
[vars.backgroundColor]: globalRefs.colors.surface.light,
|
|
11
12
|
[vars.labelTextColor]: globalRefs.colors.surface.contrast,
|
|
12
13
|
[vars.borderColor]: globalRefs.colors.surface.main,
|
|
@@ -8,6 +8,7 @@ const vars = ComboBoxClass.cssVarList;
|
|
|
8
8
|
|
|
9
9
|
export const comboBox = {
|
|
10
10
|
[vars.hostWidth]: refs.width,
|
|
11
|
+
[vars.hostDirection]: refs.direction,
|
|
11
12
|
[vars.fontSize]: refs.fontSize,
|
|
12
13
|
[vars.fontFamily]: refs.fontFamily,
|
|
13
14
|
[vars.labelTextColor]: refs.labelTextColor,
|
|
@@ -30,6 +31,8 @@ export const comboBox = {
|
|
|
30
31
|
[vars.inputDropdownButtonCursor]: 'pointer',
|
|
31
32
|
[vars.inputDropdownButtonSize]: refs.toggleButtonSize,
|
|
32
33
|
[vars.inputDropdownButtonOffset]: globalRefs.spacing.xs,
|
|
34
|
+
[vars.overlayItemPaddingInlineStart]: globalRefs.spacing.xs,
|
|
35
|
+
[vars.overlayItemPaddingInlineEnd]: globalRefs.spacing.lg,
|
|
33
36
|
|
|
34
37
|
_readonly: {
|
|
35
38
|
[vars.inputDropdownButtonCursor]: 'default',
|
|
@@ -16,6 +16,7 @@ const [helperTheme, helperRefs, helperVars] = createHelperVars(
|
|
|
16
16
|
const divider = {
|
|
17
17
|
...helperTheme,
|
|
18
18
|
|
|
19
|
+
[compVars.hostDirection]: globalRefs.direction,
|
|
19
20
|
[compVars.alignItems]: 'center',
|
|
20
21
|
[compVars.flexDirection]: 'row',
|
|
21
22
|
[compVars.alignSelf]: 'stretch',
|
|
@@ -26,6 +27,7 @@ const divider = {
|
|
|
26
27
|
[compVars.labelTextWidth]: 'fit-content',
|
|
27
28
|
[compVars.labelTextMaxWidth]: 'calc(100% - 100px)',
|
|
28
29
|
[compVars.labelTextHorizontalSpacing]: helperRefs.spacing,
|
|
30
|
+
[compVars.textAlign]: 'center',
|
|
29
31
|
|
|
30
32
|
_vertical: {
|
|
31
33
|
[compVars.minHeight]: '200px',
|
|
@@ -6,6 +6,7 @@ const vars = EmailFieldClass.cssVarList;
|
|
|
6
6
|
const emailField = {
|
|
7
7
|
[vars.hostWidth]: refs.width,
|
|
8
8
|
[vars.hostMinWidth]: refs.minWidth,
|
|
9
|
+
[vars.hostDirection]: refs.direction,
|
|
9
10
|
[vars.fontSize]: refs.fontSize,
|
|
10
11
|
[vars.fontFamily]: refs.fontFamily,
|
|
11
12
|
[vars.labelTextColor]: refs.labelTextColor,
|
|
@@ -6,6 +6,7 @@ const vars = NewPasswordClass.cssVarList;
|
|
|
6
6
|
const newPassword = {
|
|
7
7
|
[vars.hostWidth]: refs.width,
|
|
8
8
|
[vars.hostMinWidth]: refs.minWidth,
|
|
9
|
+
[vars.hostDirection]: refs.direction,
|
|
9
10
|
[vars.fontSize]: refs.fontSize,
|
|
10
11
|
[vars.fontFamily]: refs.fontFamily,
|
|
11
12
|
[vars.spaceBetweenInputs]: '1em',
|
|
@@ -6,6 +6,7 @@ const vars = NumberFieldClass.cssVarList;
|
|
|
6
6
|
const numberField = {
|
|
7
7
|
[vars.hostWidth]: refs.width,
|
|
8
8
|
[vars.hostMinWidth]: refs.minWidth,
|
|
9
|
+
[vars.hostDirection]: refs.direction,
|
|
9
10
|
[vars.fontSize]: refs.fontSize,
|
|
10
11
|
[vars.fontFamily]: refs.fontFamily,
|
|
11
12
|
[vars.labelTextColor]: refs.labelTextColor,
|
|
@@ -6,6 +6,7 @@ const vars = PhoneFieldInputBoxClass.cssVarList;
|
|
|
6
6
|
const phoneInputBoxField = {
|
|
7
7
|
[vars.hostWidth]: '16em',
|
|
8
8
|
[vars.hostMinWidth]: refs.minWidth,
|
|
9
|
+
[vars.hostDirection]: refs.direction,
|
|
9
10
|
[vars.fontSize]: refs.fontSize,
|
|
10
11
|
[vars.fontFamily]: refs.fontFamily,
|
|
11
12
|
[vars.labelTextColor]: refs.labelTextColor,
|
|
@@ -9,6 +9,7 @@ const vars = TextAreaClass.cssVarList;
|
|
|
9
9
|
const textArea = {
|
|
10
10
|
[vars.hostWidth]: refs.width,
|
|
11
11
|
[vars.hostMinWidth]: refs.minWidth,
|
|
12
|
+
[vars.hostDirection]: refs.direction,
|
|
12
13
|
[vars.fontSize]: refs.fontSize,
|
|
13
14
|
[vars.fontFamily]: refs.fontFamily,
|
|
14
15
|
[vars.labelTextColor]: refs.labelTextColor,
|
|
@@ -6,6 +6,7 @@ const vars = TextFieldClass.cssVarList;
|
|
|
6
6
|
export const textField = {
|
|
7
7
|
[vars.hostWidth]: refs.width,
|
|
8
8
|
[vars.hostMinWidth]: refs.minWidth,
|
|
9
|
+
[vars.hostDirection]: refs.direction,
|
|
9
10
|
[vars.fontSize]: refs.fontSize,
|
|
10
11
|
[vars.fontFamily]: refs.fontFamily,
|
|
11
12
|
[vars.labelTextColor]: refs.labelTextColor,
|