@zohodesk/dot 1.0.0-temp-109 → 1.0.0-temp-111
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/README.md +15 -0
- package/es/ActionButton/ActionButton.js +12 -5
- package/es/Drawer/Drawer.js +23 -9
- package/es/Drawer/Drawer.module.css +1 -1
- package/es/Drawer/props/defaultProps.js +2 -1
- package/es/Drawer/props/propTypes.js +2 -1
- package/es/alert/AlertLookup/AlertLookup.js +5 -53
- package/es/dropdown/ToggleDropDown/ToggleDropDown.js +15 -13
- package/es/form/fields/CheckBoxField/CheckBoxField.js +3 -2
- package/es/form/fields/CurrencyField/CurrencyField.js +43 -8
- package/es/form/fields/CurrencyField/props/defaultProps.js +1 -0
- package/es/form/fields/DateField/DateField.js +93 -8
- package/es/form/fields/DateField/props/defaultProps.js +1 -0
- package/es/form/fields/Fields.module.css +65 -0
- package/es/form/fields/MultiSelectField/MultiSelectField.js +91 -9
- package/es/form/fields/MultiSelectField/props/defaultProps.js +1 -0
- package/es/form/fields/PhoneField/PhoneField.js +3 -1
- package/es/form/fields/PhoneField/props/defaultProps.js +2 -1
- package/es/form/fields/RadioField/RadioField.js +1 -1
- package/es/form/fields/SelectField/SelectField.js +99 -12
- package/es/form/fields/SelectField/props/defaultProps.js +1 -0
- package/es/form/fields/TagsMultiSelectField/TagsMultiSelectField.js +3 -1
- package/es/form/fields/TextBoxField/TextBoxField.js +59 -8
- package/es/form/fields/TextBoxField/props/defaultProps.js +1 -0
- package/es/form/fields/TextareaField/TextareaField.js +58 -12
- package/es/form/fields/TextareaField/props/defaultProps.js +1 -0
- package/es/list/Icons/DeleteIcon.js +2 -1
- package/es/list/Icons/SmartIcon.js +0 -1
- package/es/lookup/Lookup/Lookup.js +24 -12
- package/es/lookup/Lookup/props/defaultProps.js +2 -1
- package/es/lookup/Lookup/props/propTypes.js +2 -1
- package/es/lookup/header/Search/Search.js +5 -0
- package/es/version2/GlobalNotification/GlobalNotification.js +2 -1
- package/es/version2/lookup/AlertLookup/AlertLookup.js +42 -52
- package/lib/ActionButton/ActionButton.js +15 -6
- package/lib/AlphabeticList/AlphabeticList.js +3 -1
- package/lib/Attachment/Attachment.js +3 -1
- package/lib/AttachmentViewer/AttachmentImage.js +3 -1
- package/lib/AttachmentViewer/AttachmentViewer.js +3 -1
- package/lib/AttachmentViewer/utils.js +4 -1
- package/lib/ChannelIcon/ChannelIcon.js +3 -1
- package/lib/Drawer/Drawer.js +26 -10
- package/lib/Drawer/Drawer.module.css +1 -1
- package/lib/Drawer/props/defaultProps.js +2 -1
- package/lib/Drawer/props/propTypes.js +2 -1
- package/lib/ExternalLink/ExternalLink.js +3 -1
- package/lib/FlipCard/FlipCard.js +3 -1
- package/lib/FormAction/FormAction.js +3 -1
- package/lib/FreezeLayer/FreezeLayer.js +3 -1
- package/lib/IconButton/IconButton.js +3 -1
- package/lib/IconButton/props/propTypes.js +4 -1
- package/lib/Image/Image.js +3 -1
- package/lib/ImportantNotes/ImportantNotes.js +3 -1
- package/lib/Link/Link.js +3 -1
- package/lib/Loader/Loader.js +3 -1
- package/lib/Message/Message.js +3 -1
- package/lib/MessageBanner/MessageBanner.js +3 -1
- package/lib/NewStar/NewStar.js +3 -1
- package/lib/PlusIcon/PlusIcon.js +3 -1
- package/lib/ToastMessage/ToastMessage.js +1 -1
- package/lib/Upload/Upload.js +3 -1
- package/lib/actions/AutoClose.js +1 -1
- package/lib/alert/AlertHeader/AlertHeader.js +3 -1
- package/lib/alert/AlertLookup/AlertLookup.js +35 -83
- package/lib/avatar/AvatarClose/AvatarClose.js +3 -1
- package/lib/avatar/AvatarCollision/AvatarCollision.js +3 -1
- package/lib/avatar/AvatarIcon/AvatarIcon.js +3 -1
- package/lib/avatar/AvatarStatus/AvatarStatus.js +3 -1
- package/lib/avatar/AvatarThread/AvatarThread.js +3 -1
- package/lib/avatar/AvatarUser/AvatarUser.js +5 -2
- package/lib/avatar/AvatarWithTeam/AvatarWithTeam.js +3 -1
- package/lib/deprecated/SelectDropdown/SelectDropdown.js +3 -1
- package/lib/deprecated/utils/KeyboardApi.js +4 -1
- package/lib/dropdown/ToggleDropDown/ToggleDropDown.js +19 -15
- package/lib/emptystate/CommonEmptyState/CommonEmptyState.js +3 -1
- package/lib/emptystate/EditionPage/EditionPage.js +3 -1
- package/lib/errorstate/Inconvenience/Inconvenience.js +3 -1
- package/lib/errorstate/LinkText/LinkText.js +3 -1
- package/lib/errorstate/NoRequestFound/NoRequestFound.js +3 -1
- package/lib/errorstate/PermissionPlay/PermissionPlay.js +3 -1
- package/lib/errorstate/RequestUrlNotFound/RequestUrlNotFound.js +3 -1
- package/lib/errorstate/UnableToProcess/UnableToProcess.js +3 -1
- package/lib/errorstate/UnauthorizedLogin/UnauthorizedLogin.js +3 -1
- package/lib/errorstate/WillBack/WillBack.js +3 -1
- package/lib/form/fields/CheckBoxField/CheckBoxField.js +6 -3
- package/lib/form/fields/CheckBoxField/props/defaultProps.js +4 -1
- package/lib/form/fields/CheckBoxField/props/propTypes.js +4 -1
- package/lib/form/fields/CurrencyField/CurrencyField.js +79 -42
- package/lib/form/fields/CurrencyField/props/defaultProps.js +5 -1
- package/lib/form/fields/CurrencyField/props/propTypes.js +4 -1
- package/lib/form/fields/DateField/DateField.js +131 -41
- package/lib/form/fields/DateField/props/defaultProps.js +4 -1
- package/lib/form/fields/DateField/props/propTypes.js +4 -1
- package/lib/form/fields/FieldContainer/FieldContainer.js +3 -1
- package/lib/form/fields/FieldContainer/props/defaultProps.js +4 -1
- package/lib/form/fields/FieldContainer/props/propTypes.js +4 -1
- package/lib/form/fields/Fields.module.css +65 -0
- package/lib/form/fields/MultiSelectField/MultiSelectField.js +138 -53
- package/lib/form/fields/MultiSelectField/props/defaultProps.js +4 -1
- package/lib/form/fields/MultiSelectField/props/propTypes.js +4 -1
- package/lib/form/fields/PhoneField/PhoneField.js +6 -2
- package/lib/form/fields/PhoneField/props/defaultProps.js +2 -1
- package/lib/form/fields/RadioField/RadioField.js +4 -2
- package/lib/form/fields/SelectField/SelectField.js +153 -61
- package/lib/form/fields/SelectField/props/defaultProps.js +6 -2
- package/lib/form/fields/SelectField/props/propTypes.js +4 -1
- package/lib/form/fields/TagsMultiSelect/TagsMultiSelect.js +3 -1
- package/lib/form/fields/TagsMultiSelectField/TagsMultiSelectField.js +4 -2
- package/lib/form/fields/TagsMultiSelectField/props/defaultProps.js +4 -1
- package/lib/form/fields/TagsMultiSelectField/props/propTypes.js +4 -1
- package/lib/form/fields/TextBoxField/TextBoxField.js +97 -44
- package/lib/form/fields/TextBoxField/props/defaultProps.js +6 -2
- package/lib/form/fields/TextBoxField/props/propTypes.js +4 -1
- package/lib/form/fields/TextEditor/TextEditor.js +4 -2
- package/lib/form/fields/TextEditorField/TextEditorField.js +3 -1
- package/lib/form/fields/TextEditorField/props/defaultProps.js +4 -1
- package/lib/form/fields/TextEditorField/props/propTypes.js +4 -1
- package/lib/form/fields/TextEditorWrapper/TextEditorWrapper.js +5 -2
- package/lib/form/fields/TextareaField/TextareaField.js +92 -45
- package/lib/form/fields/TextareaField/props/defaultProps.js +4 -1
- package/lib/form/fields/TextareaField/props/propTypes.js +4 -1
- package/lib/form/fields/ValidationMessage/ValidationMessage.js +3 -1
- package/lib/form/layout/Field/Field.js +3 -1
- package/lib/form/layout/Section/Section.js +3 -1
- package/lib/layout/SetupDetailLayout/SetupDetailLayout.js +3 -1
- package/lib/layout/SubtabLayout/SubtabLayout.js +3 -1
- package/lib/list/AvatarFlip/AvatarFlip.js +3 -1
- package/lib/list/BluePrintStatus/BluePrintStatus.js +3 -1
- package/lib/list/Comment/Comment.js +3 -1
- package/lib/list/DepartmentDropDown/DepartmentDropDown.js +3 -1
- package/lib/list/DepartmentDropDown/props/propTypes.js +4 -1
- package/lib/list/Dot/Dot.js +3 -1
- package/lib/list/DotNew/DotNew.js +3 -1
- package/lib/list/GridStencils/GridStencils.js +3 -1
- package/lib/list/Icons/AddNewIcon.js +3 -1
- package/lib/list/Icons/CompleteIcon.js +3 -1
- package/lib/list/Icons/DeleteIcon.js +5 -2
- package/lib/list/Icons/EditIcon.js +3 -1
- package/lib/list/Icons/FloatingIcons.js +3 -1
- package/lib/list/Icons/ReadUnreadIcon.js +3 -1
- package/lib/list/Icons/SmartIcon.js +3 -2
- package/lib/list/ListLayout/ListLayout.js +3 -1
- package/lib/list/ListLayout/props/propTypes.js +4 -1
- package/lib/list/ListStencils/ListStencils.js +3 -1
- package/lib/list/SecondaryText/AccountName.js +3 -1
- package/lib/list/SecondaryText/ContactName.js +3 -1
- package/lib/list/SecondaryText/DepartmentText.js +3 -1
- package/lib/list/SecondaryText/Email.js +3 -1
- package/lib/list/SecondaryText/HappinessRating.js +3 -1
- package/lib/list/SecondaryText/PhoneNumber.js +3 -1
- package/lib/list/SecondaryText/PriorityText.js +3 -1
- package/lib/list/SecondaryText/SecondaryText.js +3 -1
- package/lib/list/SecondaryText/StatusText.js +3 -1
- package/lib/list/SecondaryText/TicketId.js +3 -1
- package/lib/list/SecondaryText/Website.js +3 -1
- package/lib/list/SecondryPanel/SecondryPanel.js +3 -1
- package/lib/list/SentimentStatus/SentimentStatus.js +3 -1
- package/lib/list/Subject/Subject.js +3 -1
- package/lib/list/TagNew/TagNew.js +3 -1
- package/lib/list/Thread/Thread.js +3 -1
- package/lib/list/UserTime/UserTime.js +3 -1
- package/lib/list/status/StatusDropdown/StatusDropdown.js +3 -1
- package/lib/list/status/StatusDropdown/props/propTypes.js +4 -1
- package/lib/list/status/StatusListItem/StatusListItem.js +3 -1
- package/lib/lookup/EmptyPage/EmptyPage.js +3 -1
- package/lib/lookup/Lookup/Lookup.js +29 -13
- package/lib/lookup/Lookup/props/defaultProps.js +2 -1
- package/lib/lookup/Lookup/props/propTypes.js +2 -1
- package/lib/lookup/Section/Section.js +3 -1
- package/lib/lookup/header/Close/Close.js +3 -1
- package/lib/lookup/header/ModuleHeader/ModuleHeader.js +5 -2
- package/lib/lookup/header/Search/Search.js +8 -1
- package/lib/lookup/header/TicketHeader/TicketHeader.js +5 -2
- package/lib/lookup/header/Title/Title.js +3 -1
- package/lib/lookup/header/ViewDropDown/ViewDropDown.js +3 -1
- package/lib/setup/header/Button/Button.js +3 -1
- package/lib/setup/header/Link/Link.js +3 -1
- package/lib/setup/header/Search/Search.js +3 -1
- package/lib/setup/header/Views/Views.js +3 -1
- package/lib/setup/helptips/Description/Description.js +3 -1
- package/lib/setup/helptips/Link/Link.js +3 -1
- package/lib/setup/helptips/ListGroup/ListGroup.js +3 -1
- package/lib/setup/helptips/Title/Title.js +3 -1
- package/lib/setup/table/Table/Table.js +3 -1
- package/lib/setup/table/TableBody/TableBody.js +3 -1
- package/lib/setup/table/TableData/TableData.js +3 -1
- package/lib/setup/table/TableHead/TableHead.js +3 -1
- package/lib/setup/table/TableRow/TableRow.js +3 -1
- package/lib/setup/table/Text/Text.js +3 -1
- package/lib/svg/PlusIcon.js +3 -1
- package/lib/svg/SnippetIcon.js +3 -1
- package/lib/svg/TemplateIcon.js +3 -1
- package/lib/version2/AlertClose/AlertClose.js +3 -1
- package/lib/version2/GlobalNotification/GlobalNotification.js +5 -2
- package/lib/version2/alertIcons/AlarmAlertIcon.js +3 -1
- package/lib/version2/alertIcons/AlertIcons.js +3 -1
- package/lib/version2/alertIcons/DangerAlertIcon.js +3 -1
- package/lib/version2/alertIcons/ErrorAlertIcon.js +3 -1
- package/lib/version2/alertIcons/InfoAlertIcon.js +3 -1
- package/lib/version2/alertIcons/NotificationAlertIcon.js +3 -1
- package/lib/version2/alertIcons/SuccessAlertIcon.js +3 -1
- package/lib/version2/alertIcons/WarningAlertIcon.js +3 -1
- package/lib/version2/errorstate/Inconvenience/Inconvenience.js +3 -1
- package/lib/version2/errorstate/OopsSomethingMiss/OopsSomethingMiss.js +3 -1
- package/lib/version2/errorstate/UnableToProcessRequest/UnableToProcessRequest.js +3 -1
- package/lib/version2/errorstate/UnauthorizedLogin/UnauthorizedLogin.js +3 -1
- package/lib/version2/errorstate/UrlNotFound/UrlNotFound.js +3 -1
- package/lib/version2/errorstate/WillBeRightBack/WillBeRightBack.js +3 -1
- package/lib/version2/lookup/AlertHeader/AlertHeader.js +3 -1
- package/lib/version2/lookup/AlertLookup/AlertLookup.js +70 -83
- package/lib/version2/notification/DesktopNotificationHeader/DesktopNotificationHeader.js +3 -1
- package/package.json +10 -8
|
@@ -13,14 +13,17 @@ var _Select = _interopRequireDefault(require("@zohodesk/components/lib/Select/Se
|
|
|
13
13
|
var _ValidationMessage = _interopRequireDefault(require("../ValidationMessage/ValidationMessage"));
|
|
14
14
|
var _IdProvider = require("@zohodesk/components/lib/Provider/IdProvider");
|
|
15
15
|
var _FieldContainer = _interopRequireDefault(require("../FieldContainer/FieldContainer"));
|
|
16
|
+
var _RippleEffect = _interopRequireDefault(require("@zohodesk/components/lib/RippleEffect/RippleEffect"));
|
|
16
17
|
var _FieldsModule = _interopRequireDefault(require("../Fields.module.css"));
|
|
17
18
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
18
19
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
19
20
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
20
21
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
21
22
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
22
|
-
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
23
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
23
24
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
25
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
26
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
24
27
|
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
25
28
|
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
26
29
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
@@ -39,6 +42,17 @@ var SelectField = /*#__PURE__*/function (_PureComponent) {
|
|
|
39
42
|
_this.handleGetRef = _this.handleGetRef.bind(_assertThisInitialized(_this));
|
|
40
43
|
// this.handleLabelClick = this.handleLabelClick.bind(this);
|
|
41
44
|
_this.getNextId = (0, _IdProvider.getUniqueId)(_assertThisInitialized(_this));
|
|
45
|
+
_this.handleParentClick = _this.handleParentClick.bind(_assertThisInitialized(_this));
|
|
46
|
+
_this.handleFocusToggle = _this.handleFocusToggle.bind(_assertThisInitialized(_this));
|
|
47
|
+
_this.handleFocus = _this.handleFocus.bind(_assertThisInitialized(_this));
|
|
48
|
+
_this.handleBlur = _this.handleBlur.bind(_assertThisInitialized(_this));
|
|
49
|
+
_this.getPopupHandlers = _this.getPopupHandlers.bind(_assertThisInitialized(_this));
|
|
50
|
+
_this.handleDropBoxOpen = _this.handleDropBoxOpen.bind(_assertThisInitialized(_this));
|
|
51
|
+
_this.handleDropBoxClose = _this.handleDropBoxClose.bind(_assertThisInitialized(_this));
|
|
52
|
+
_this.state = {
|
|
53
|
+
isFocused: false,
|
|
54
|
+
isPopupOpen: false
|
|
55
|
+
};
|
|
42
56
|
return _this;
|
|
43
57
|
}
|
|
44
58
|
_createClass(SelectField, [{
|
|
@@ -56,9 +70,69 @@ var SelectField = /*#__PURE__*/function (_PureComponent) {
|
|
|
56
70
|
var _this$props2 = this.props,
|
|
57
71
|
getRef = _this$props2.getRef,
|
|
58
72
|
id = _this$props2.id;
|
|
59
|
-
this.
|
|
73
|
+
this.textBox = el;
|
|
60
74
|
getRef && getRef(el, id);
|
|
61
75
|
}
|
|
76
|
+
}, {
|
|
77
|
+
key: "handleParentClick",
|
|
78
|
+
value: function handleParentClick(e) {
|
|
79
|
+
var needFieldStyle = this.props.needFieldStyle;
|
|
80
|
+
if (needFieldStyle) {
|
|
81
|
+
this.textBox.focus();
|
|
82
|
+
this.togglePopup(e);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}, {
|
|
86
|
+
key: "handleFocusToggle",
|
|
87
|
+
value: function handleFocusToggle(value) {
|
|
88
|
+
this.setState({
|
|
89
|
+
isFocused: value
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
}, {
|
|
93
|
+
key: "handleFocus",
|
|
94
|
+
value: function handleFocus(e) {
|
|
95
|
+
var _this$props3 = this.props,
|
|
96
|
+
onFocus = _this$props3.onFocus,
|
|
97
|
+
needFieldStyle = _this$props3.needFieldStyle;
|
|
98
|
+
needFieldStyle && this.handleFocusToggle(true);
|
|
99
|
+
onFocus && onFocus(e);
|
|
100
|
+
}
|
|
101
|
+
}, {
|
|
102
|
+
key: "handleBlur",
|
|
103
|
+
value: function handleBlur(e) {
|
|
104
|
+
var _this$props4 = this.props,
|
|
105
|
+
onBlur = _this$props4.onBlur,
|
|
106
|
+
needFieldStyle = _this$props4.needFieldStyle;
|
|
107
|
+
needFieldStyle && this.handleFocusToggle(false);
|
|
108
|
+
onBlur && onBlur(e);
|
|
109
|
+
}
|
|
110
|
+
}, {
|
|
111
|
+
key: "getPopupHandlers",
|
|
112
|
+
value: function getPopupHandlers(methods) {
|
|
113
|
+
var togglePopup = methods.togglePopup;
|
|
114
|
+
this.togglePopup = togglePopup;
|
|
115
|
+
}
|
|
116
|
+
}, {
|
|
117
|
+
key: "handleDropBoxOpen",
|
|
118
|
+
value: function handleDropBoxOpen() {
|
|
119
|
+
var isPopupOpen = this.state.isPopupOpen;
|
|
120
|
+
if (isPopupOpen == false) {
|
|
121
|
+
this.setState({
|
|
122
|
+
isPopupOpen: true
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
}, {
|
|
127
|
+
key: "handleDropBoxClose",
|
|
128
|
+
value: function handleDropBoxClose() {
|
|
129
|
+
var isPopupOpen = this.state.isPopupOpen;
|
|
130
|
+
if (isPopupOpen) {
|
|
131
|
+
this.setState({
|
|
132
|
+
isPopupOpen: false
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
}
|
|
62
136
|
|
|
63
137
|
// handleLabelClick() {
|
|
64
138
|
// let { isFocusOnLabelClick } = this.props;
|
|
@@ -69,54 +143,56 @@ var SelectField = /*#__PURE__*/function (_PureComponent) {
|
|
|
69
143
|
}, {
|
|
70
144
|
key: "render",
|
|
71
145
|
value: function render() {
|
|
72
|
-
var _this$
|
|
73
|
-
labelName = _this$
|
|
74
|
-
id = _this$
|
|
75
|
-
isMandatory = _this$
|
|
76
|
-
options = _this$
|
|
77
|
-
selectedValue = _this$
|
|
78
|
-
needSearch = _this$
|
|
79
|
-
emptyMessage = _this$
|
|
80
|
-
animationStyle = _this$
|
|
81
|
-
textBoxSize = _this$
|
|
82
|
-
textBoxVariant = _this$
|
|
83
|
-
searchBoxSize = _this$
|
|
84
|
-
searchBoxPlaceHolder = _this$
|
|
85
|
-
validationMessage = _this$
|
|
86
|
-
validationPalette = _this$
|
|
87
|
-
isReadOnly = _this$
|
|
88
|
-
valueField = _this$
|
|
89
|
-
textField = _this$
|
|
90
|
-
excludeOptions = _this$
|
|
91
|
-
errorType = _this$
|
|
92
|
-
isDisabled = _this$
|
|
93
|
-
title = _this$
|
|
94
|
-
dataId = _this$
|
|
95
|
-
fieldClass = _this$
|
|
96
|
-
validationRuleMessage = _this$
|
|
97
|
-
validationRulePalette = _this$
|
|
98
|
-
onKeyDown = _this$
|
|
99
|
-
infoText = _this$
|
|
100
|
-
isLocked = _this$
|
|
101
|
-
lockedInfoText = _this$
|
|
102
|
-
borderColor = _this$
|
|
103
|
-
fieldSize = _this$
|
|
104
|
-
isNextOptions = _this$
|
|
105
|
-
getNextOptions = _this$
|
|
106
|
-
popupGroup = _this$
|
|
107
|
-
onSearch = _this$
|
|
108
|
-
labelPalette = _this$
|
|
109
|
-
labelCustomClass = _this$
|
|
110
|
-
htmlId = _this$
|
|
111
|
-
needLocalSearch = _this$
|
|
112
|
-
isDefaultSelectValue = _this$
|
|
113
|
-
placeHolder = _this$
|
|
114
|
-
children = _this$
|
|
115
|
-
onFocus = _this$
|
|
116
|
-
iconOnHover = _this$
|
|
117
|
-
customProps = _this$
|
|
118
|
-
renderLabelProps = _this$
|
|
119
|
-
|
|
146
|
+
var _this$props5 = this.props,
|
|
147
|
+
labelName = _this$props5.labelName,
|
|
148
|
+
id = _this$props5.id,
|
|
149
|
+
isMandatory = _this$props5.isMandatory,
|
|
150
|
+
options = _this$props5.options,
|
|
151
|
+
selectedValue = _this$props5.selectedValue,
|
|
152
|
+
needSearch = _this$props5.needSearch,
|
|
153
|
+
emptyMessage = _this$props5.emptyMessage,
|
|
154
|
+
animationStyle = _this$props5.animationStyle,
|
|
155
|
+
textBoxSize = _this$props5.textBoxSize,
|
|
156
|
+
textBoxVariant = _this$props5.textBoxVariant,
|
|
157
|
+
searchBoxSize = _this$props5.searchBoxSize,
|
|
158
|
+
searchBoxPlaceHolder = _this$props5.searchBoxPlaceHolder,
|
|
159
|
+
validationMessage = _this$props5.validationMessage,
|
|
160
|
+
validationPalette = _this$props5.validationPalette,
|
|
161
|
+
isReadOnly = _this$props5.isReadOnly,
|
|
162
|
+
valueField = _this$props5.valueField,
|
|
163
|
+
textField = _this$props5.textField,
|
|
164
|
+
excludeOptions = _this$props5.excludeOptions,
|
|
165
|
+
errorType = _this$props5.errorType,
|
|
166
|
+
isDisabled = _this$props5.isDisabled,
|
|
167
|
+
title = _this$props5.title,
|
|
168
|
+
dataId = _this$props5.dataId,
|
|
169
|
+
fieldClass = _this$props5.fieldClass,
|
|
170
|
+
validationRuleMessage = _this$props5.validationRuleMessage,
|
|
171
|
+
validationRulePalette = _this$props5.validationRulePalette,
|
|
172
|
+
onKeyDown = _this$props5.onKeyDown,
|
|
173
|
+
infoText = _this$props5.infoText,
|
|
174
|
+
isLocked = _this$props5.isLocked,
|
|
175
|
+
lockedInfoText = _this$props5.lockedInfoText,
|
|
176
|
+
borderColor = _this$props5.borderColor,
|
|
177
|
+
fieldSize = _this$props5.fieldSize,
|
|
178
|
+
isNextOptions = _this$props5.isNextOptions,
|
|
179
|
+
getNextOptions = _this$props5.getNextOptions,
|
|
180
|
+
popupGroup = _this$props5.popupGroup,
|
|
181
|
+
onSearch = _this$props5.onSearch,
|
|
182
|
+
labelPalette = _this$props5.labelPalette,
|
|
183
|
+
labelCustomClass = _this$props5.labelCustomClass,
|
|
184
|
+
htmlId = _this$props5.htmlId,
|
|
185
|
+
needLocalSearch = _this$props5.needLocalSearch,
|
|
186
|
+
isDefaultSelectValue = _this$props5.isDefaultSelectValue,
|
|
187
|
+
placeHolder = _this$props5.placeHolder,
|
|
188
|
+
children = _this$props5.children,
|
|
189
|
+
onFocus = _this$props5.onFocus,
|
|
190
|
+
iconOnHover = _this$props5.iconOnHover,
|
|
191
|
+
customProps = _this$props5.customProps,
|
|
192
|
+
renderLabelProps = _this$props5.renderLabelProps,
|
|
193
|
+
handleDropBoxOpen = _this$props5.handleDropBoxOpen,
|
|
194
|
+
needFieldStyle = _this$props5.needFieldStyle,
|
|
195
|
+
ariaLabelledby = _this$props5.ariaLabelledby;
|
|
120
196
|
var _customProps$LabelPro = customProps.LabelProps,
|
|
121
197
|
LabelProps = _customProps$LabelPro === void 0 ? {} : _customProps$LabelPro,
|
|
122
198
|
_customProps$SelectPr = customProps.SelectProps,
|
|
@@ -126,9 +202,18 @@ var SelectField = /*#__PURE__*/function (_PureComponent) {
|
|
|
126
202
|
_customProps$Validati2 = customProps.ValidationMessageProps2,
|
|
127
203
|
ValidationMessageProps2 = _customProps$Validati2 === void 0 ? {} : _customProps$Validati2;
|
|
128
204
|
var uniqueId = htmlId ? htmlId : this.getNextId();
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
205
|
+
var _this$state = this.state,
|
|
206
|
+
isFocused = _this$state.isFocused,
|
|
207
|
+
isPopupOpen = _this$state.isPopupOpen;
|
|
208
|
+
var isActive = isPopupOpen || isFocused;
|
|
209
|
+
return /*#__PURE__*/_react["default"].createElement(_RippleEffect["default"], {
|
|
210
|
+
hoverType: "bg",
|
|
211
|
+
isActive: isActive,
|
|
212
|
+
isNeedEffect: !isReadOnly && !isDisabled && needFieldStyle ? true : false
|
|
213
|
+
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
214
|
+
className: "".concat(_FieldsModule["default"].container, " ").concat(needFieldStyle ? _FieldsModule["default"].highlightSpace : '', " ").concat(isDisabled ? _FieldsModule["default"].disabled : isReadOnly ? _FieldsModule["default"].readonly : ''),
|
|
215
|
+
"data-title": isDisabled ? title : null,
|
|
216
|
+
onClick: this.handleParentClick
|
|
132
217
|
}, labelName && /*#__PURE__*/_react["default"].createElement(_FieldContainer["default"], {
|
|
133
218
|
infoText: infoText,
|
|
134
219
|
isLocked: isLocked,
|
|
@@ -138,18 +223,20 @@ var SelectField = /*#__PURE__*/function (_PureComponent) {
|
|
|
138
223
|
text: labelName,
|
|
139
224
|
size: fieldSize === 'small' ? 'small' : 'medium',
|
|
140
225
|
palette: isMandatory ? 'mandatory' : isDisabled ? 'primary' : labelPalette,
|
|
141
|
-
customClass: "".concat(_FieldsModule["default"].fieldLabel, " ").concat(labelCustomClass, " ").concat(isMandatory ? _FieldsModule["default"].labelMandatory : '')
|
|
142
|
-
htmlFor
|
|
226
|
+
customClass: "".concat(_FieldsModule["default"].fieldLabel, " ").concat(labelCustomClass, " ").concat(isMandatory ? _FieldsModule["default"].labelMandatory : '', " ").concat(_FieldsModule["default"].labelindex)
|
|
227
|
+
// htmlFor={uniqueId}
|
|
228
|
+
,
|
|
143
229
|
dataId: isDisabled ? "".concat(dataId, "_label_disabled") : isMandatory ? "".concat(dataId, "_label_mandatory") : "".concat(dataId, "_label")
|
|
144
230
|
}, LabelProps, {
|
|
145
231
|
id: uniqueId
|
|
146
232
|
}))), /*#__PURE__*/_react["default"].createElement("div", {
|
|
147
|
-
className: "".concat(_FieldsModule["default"].fieldContainer, " ").concat(labelName ? _FieldsModule["default"]["fieldMargin_".concat(fieldSize)] : '', " ").concat(fieldClass ? fieldClass : '')
|
|
233
|
+
className: "".concat(needFieldStyle ? _FieldsModule["default"].highlightPosition : _FieldsModule["default"].fieldContainer, " ").concat(labelName ? _FieldsModule["default"]["fieldMargin_".concat(fieldSize)] : '', " ").concat(fieldClass ? fieldClass : '')
|
|
148
234
|
}, /*#__PURE__*/_react["default"].createElement(_Select["default"], _extends({
|
|
149
235
|
options: options,
|
|
150
236
|
selectedValue: selectedValue,
|
|
151
237
|
onChange: this.handleChange,
|
|
152
|
-
onFocus:
|
|
238
|
+
onFocus: this.handleFocus,
|
|
239
|
+
onBlur: this.handleBlur,
|
|
153
240
|
getRef: this.handleGetRef,
|
|
154
241
|
needSearch: needSearch,
|
|
155
242
|
emptyMessage: emptyMessage,
|
|
@@ -169,12 +256,17 @@ var SelectField = /*#__PURE__*/function (_PureComponent) {
|
|
|
169
256
|
isNextOptions: isNextOptions,
|
|
170
257
|
getNextOptions: getNextOptions,
|
|
171
258
|
popupGroup: popupGroup,
|
|
172
|
-
onSearch: onSearch
|
|
173
|
-
htmlId
|
|
259
|
+
onSearch: onSearch
|
|
260
|
+
// htmlId={uniqueId}
|
|
261
|
+
,
|
|
174
262
|
needLocalSearch: needLocalSearch,
|
|
175
263
|
isDefaultSelectValue: isDefaultSelectValue,
|
|
176
264
|
placeHolder: placeHolder,
|
|
177
|
-
iconOnHover: iconOnHover
|
|
265
|
+
iconOnHover: iconOnHover,
|
|
266
|
+
needPosition: needFieldStyle ? true : false,
|
|
267
|
+
getPopupHandlers: this.getPopupHandlers,
|
|
268
|
+
onDropBoxOpen: this.handleDropBoxOpen,
|
|
269
|
+
onDropBoxClose: this.handleDropBoxClose
|
|
178
270
|
}, SelectProps, {
|
|
179
271
|
ariaLabelledby: uniqueId
|
|
180
272
|
}), children ? children : null)), validationMessage && /*#__PURE__*/_react["default"].createElement(_ValidationMessage["default"], _extends({
|
|
@@ -189,7 +281,7 @@ var SelectField = /*#__PURE__*/function (_PureComponent) {
|
|
|
189
281
|
type: errorType,
|
|
190
282
|
htmlFor: uniqueId,
|
|
191
283
|
dataId: "".concat(dataId, "_ValidationRuleMessage")
|
|
192
|
-
}, ValidationMessageProps2)));
|
|
284
|
+
}, ValidationMessageProps2))));
|
|
193
285
|
}
|
|
194
286
|
}]);
|
|
195
287
|
return SelectField;
|
|
@@ -5,9 +5,12 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.defaultProps = void 0;
|
|
7
7
|
var _FieldCommonDefaultProps = require("../../props/FieldCommonDefaultProps");
|
|
8
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
8
9
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
9
10
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
10
|
-
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
11
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
12
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
13
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
11
14
|
var defaultProps = _objectSpread({
|
|
12
15
|
errorType: 'primary',
|
|
13
16
|
needSearch: false,
|
|
@@ -21,6 +24,7 @@ var defaultProps = _objectSpread({
|
|
|
21
24
|
labelCustomClass: '',
|
|
22
25
|
isDefaultSelectValue: true,
|
|
23
26
|
placeHolder: '',
|
|
24
|
-
customProps: {}
|
|
27
|
+
customProps: {},
|
|
28
|
+
needFieldStyle: false
|
|
25
29
|
}, (0, _FieldCommonDefaultProps.FieldCommonDefaultProps)());
|
|
26
30
|
exports.defaultProps = defaultProps;
|
|
@@ -7,9 +7,12 @@ exports.propTypes = void 0;
|
|
|
7
7
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
8
8
|
var _FieldCommonPropTypes = require("../../props/FieldCommonPropTypes");
|
|
9
9
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
10
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
10
11
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
11
12
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
12
|
-
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
13
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
14
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
15
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
13
16
|
var propTypes = _objectSpread({
|
|
14
17
|
animationStyle: _propTypes["default"].string,
|
|
15
18
|
borderColor: _propTypes["default"].oneOf(['transparent', 'default']),
|
|
@@ -23,8 +23,10 @@ var _Common = require("@zohodesk/components/lib/utils/Common.js");
|
|
|
23
23
|
var _TagsMultiSelectModule = _interopRequireDefault(require("./TagsMultiSelect.module.css"));
|
|
24
24
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
25
25
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
26
|
-
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
26
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
27
27
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
28
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
29
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
28
30
|
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
29
31
|
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
30
32
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
@@ -24,7 +24,7 @@ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArra
|
|
|
24
24
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
25
25
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
26
26
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
27
|
-
function _iterableToArrayLimit(arr, i) { var _i =
|
|
27
|
+
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0) { ; } } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
28
28
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
29
29
|
var TagsMultiSelectField = function TagsMultiSelectField(props) {
|
|
30
30
|
var _useState = (0, _react.useState)(0),
|
|
@@ -182,7 +182,9 @@ var TagsMultiSelectField = function TagsMultiSelectField(props) {
|
|
|
182
182
|
};
|
|
183
183
|
}, []);
|
|
184
184
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
185
|
-
className: "".concat(isDisabled ? _FieldsModule["default"].disabled : isReadOnly ? _FieldsModule["default"].readonly : '')
|
|
185
|
+
className: "".concat(isDisabled ? _FieldsModule["default"].disabled : isReadOnly ? _FieldsModule["default"].readonly : ''),
|
|
186
|
+
tabIndex: "0",
|
|
187
|
+
"aria-label": "".concat(labelName)
|
|
186
188
|
}, labelName && /*#__PURE__*/_react["default"].createElement(_FieldContainer["default"], {
|
|
187
189
|
ePhiData: ePhiData,
|
|
188
190
|
alignContainer: "baseline",
|
|
@@ -5,9 +5,12 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.defaultProps = void 0;
|
|
7
7
|
var _FieldCommonDefaultProps = require("../../props/FieldCommonDefaultProps");
|
|
8
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
8
9
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
9
10
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
10
|
-
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
11
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
12
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
13
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
11
14
|
var defaultProps = _objectSpread({
|
|
12
15
|
fieldProperties: {
|
|
13
16
|
isDisabled: false,
|
|
@@ -7,9 +7,12 @@ exports.propTypes = void 0;
|
|
|
7
7
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
8
8
|
var _FieldCommonPropTypes = require("../../props/FieldCommonPropTypes");
|
|
9
9
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
10
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
10
11
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
11
12
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
12
|
-
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
13
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
14
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
15
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
13
16
|
var propTypes = _objectSpread({
|
|
14
17
|
fieldProperties: _propTypes["default"].shape({
|
|
15
18
|
id: _propTypes["default"].string.isRequired,
|
|
@@ -13,14 +13,17 @@ var _TextBoxIcon = _interopRequireDefault(require("@zohodesk/components/lib/Text
|
|
|
13
13
|
var _ValidationMessage = _interopRequireDefault(require("../ValidationMessage/ValidationMessage"));
|
|
14
14
|
var _IdProvider = require("@zohodesk/components/lib/Provider/IdProvider");
|
|
15
15
|
var _FieldContainer = _interopRequireDefault(require("../FieldContainer/FieldContainer"));
|
|
16
|
+
var _RippleEffect = _interopRequireDefault(require("@zohodesk/components/lib/RippleEffect/RippleEffect"));
|
|
16
17
|
var _FieldsModule = _interopRequireDefault(require("../Fields.module.css"));
|
|
17
18
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
18
19
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
19
20
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
20
21
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
21
22
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
22
|
-
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
23
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
23
24
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
25
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
26
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
24
27
|
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
25
28
|
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
26
29
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
@@ -39,6 +42,13 @@ var TextBoxField = /*#__PURE__*/function (_PureComponent) {
|
|
|
39
42
|
_this.handleGetRef = _this.handleGetRef.bind(_assertThisInitialized(_this));
|
|
40
43
|
// this.handleLabelClick = this.handleLabelClick.bind(this);
|
|
41
44
|
_this.getNextId = (0, _IdProvider.getUniqueId)(_assertThisInitialized(_this));
|
|
45
|
+
_this.handleParentClick = _this.handleParentClick.bind(_assertThisInitialized(_this));
|
|
46
|
+
_this.handleFocusToggle = _this.handleFocusToggle.bind(_assertThisInitialized(_this));
|
|
47
|
+
_this.handleFocus = _this.handleFocus.bind(_assertThisInitialized(_this));
|
|
48
|
+
_this.handleBlur = _this.handleBlur.bind(_assertThisInitialized(_this));
|
|
49
|
+
_this.state = {
|
|
50
|
+
isFocused: false
|
|
51
|
+
};
|
|
42
52
|
return _this;
|
|
43
53
|
}
|
|
44
54
|
_createClass(TextBoxField, [{
|
|
@@ -66,44 +76,81 @@ var TextBoxField = /*#__PURE__*/function (_PureComponent) {
|
|
|
66
76
|
// // }
|
|
67
77
|
// }
|
|
68
78
|
}, {
|
|
69
|
-
key: "
|
|
70
|
-
value: function
|
|
79
|
+
key: "handleParentClick",
|
|
80
|
+
value: function handleParentClick() {
|
|
81
|
+
var needFieldStyle = this.props.needFieldStyle;
|
|
82
|
+
if (needFieldStyle) {
|
|
83
|
+
this.textBox.focus();
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}, {
|
|
87
|
+
key: "handleFocusToggle",
|
|
88
|
+
value: function handleFocusToggle(value) {
|
|
89
|
+
var needFieldStyle = this.props.needFieldStyle;
|
|
90
|
+
if (needFieldStyle) {
|
|
91
|
+
this.setState({
|
|
92
|
+
isFocused: value
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
}, {
|
|
97
|
+
key: "handleFocus",
|
|
98
|
+
value: function handleFocus(e) {
|
|
71
99
|
var _this$props3 = this.props,
|
|
72
|
-
labelName = _this$props3.labelName,
|
|
73
|
-
id = _this$props3.id,
|
|
74
|
-
textBoxSize = _this$props3.textBoxSize,
|
|
75
|
-
textBoxVariant = _this$props3.textBoxVariant,
|
|
76
|
-
textBoxType = _this$props3.textBoxType,
|
|
77
|
-
isMandatory = _this$props3.isMandatory,
|
|
78
|
-
validationMessage = _this$props3.validationMessage,
|
|
79
|
-
validationPalette = _this$props3.validationPalette,
|
|
80
|
-
maxLength = _this$props3.maxLength,
|
|
81
|
-
isReadOnly = _this$props3.isReadOnly,
|
|
82
|
-
value = _this$props3.value,
|
|
83
|
-
errorType = _this$props3.errorType,
|
|
84
|
-
isDisabled = _this$props3.isDisabled,
|
|
85
|
-
title = _this$props3.title,
|
|
86
|
-
onBlur = _this$props3.onBlur,
|
|
87
|
-
dataId = _this$props3.dataId,
|
|
88
|
-
validationRuleMessage = _this$props3.validationRuleMessage,
|
|
89
|
-
validationRulePalette = _this$props3.validationRulePalette,
|
|
90
|
-
onKeyDown = _this$props3.onKeyDown,
|
|
91
|
-
placeHolder = _this$props3.placeHolder,
|
|
92
|
-
infoText = _this$props3.infoText,
|
|
93
|
-
borderColor = _this$props3.borderColor,
|
|
94
|
-
fieldSize = _this$props3.fieldSize,
|
|
95
|
-
labelPalette = _this$props3.labelPalette,
|
|
96
|
-
labelCustomClass = _this$props3.labelCustomClass,
|
|
97
|
-
htmlId = _this$props3.htmlId,
|
|
98
|
-
lockedInfoText = _this$props3.lockedInfoText,
|
|
99
|
-
isLocked = _this$props3.isLocked,
|
|
100
|
-
needReadOnlyStyle = _this$props3.needReadOnlyStyle,
|
|
101
|
-
isClickable = _this$props3.isClickable,
|
|
102
100
|
onFocus = _this$props3.onFocus,
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
101
|
+
needFieldStyle = _this$props3.needFieldStyle;
|
|
102
|
+
needFieldStyle && this.handleFocusToggle(true);
|
|
103
|
+
onFocus && onFocus(e);
|
|
104
|
+
}
|
|
105
|
+
}, {
|
|
106
|
+
key: "handleBlur",
|
|
107
|
+
value: function handleBlur(e) {
|
|
108
|
+
var _this$props4 = this.props,
|
|
109
|
+
onBlur = _this$props4.onBlur,
|
|
110
|
+
needFieldStyle = _this$props4.needFieldStyle;
|
|
111
|
+
needFieldStyle && this.handleFocusToggle(false);
|
|
112
|
+
onBlur && onBlur(e);
|
|
113
|
+
}
|
|
114
|
+
}, {
|
|
115
|
+
key: "render",
|
|
116
|
+
value: function render() {
|
|
117
|
+
var _this$props5 = this.props,
|
|
118
|
+
labelName = _this$props5.labelName,
|
|
119
|
+
id = _this$props5.id,
|
|
120
|
+
textBoxSize = _this$props5.textBoxSize,
|
|
121
|
+
textBoxVariant = _this$props5.textBoxVariant,
|
|
122
|
+
textBoxType = _this$props5.textBoxType,
|
|
123
|
+
isMandatory = _this$props5.isMandatory,
|
|
124
|
+
validationMessage = _this$props5.validationMessage,
|
|
125
|
+
validationPalette = _this$props5.validationPalette,
|
|
126
|
+
maxLength = _this$props5.maxLength,
|
|
127
|
+
isReadOnly = _this$props5.isReadOnly,
|
|
128
|
+
value = _this$props5.value,
|
|
129
|
+
errorType = _this$props5.errorType,
|
|
130
|
+
isDisabled = _this$props5.isDisabled,
|
|
131
|
+
title = _this$props5.title,
|
|
132
|
+
onBlur = _this$props5.onBlur,
|
|
133
|
+
dataId = _this$props5.dataId,
|
|
134
|
+
validationRuleMessage = _this$props5.validationRuleMessage,
|
|
135
|
+
validationRulePalette = _this$props5.validationRulePalette,
|
|
136
|
+
onKeyDown = _this$props5.onKeyDown,
|
|
137
|
+
placeHolder = _this$props5.placeHolder,
|
|
138
|
+
infoText = _this$props5.infoText,
|
|
139
|
+
borderColor = _this$props5.borderColor,
|
|
140
|
+
fieldSize = _this$props5.fieldSize,
|
|
141
|
+
labelPalette = _this$props5.labelPalette,
|
|
142
|
+
labelCustomClass = _this$props5.labelCustomClass,
|
|
143
|
+
htmlId = _this$props5.htmlId,
|
|
144
|
+
lockedInfoText = _this$props5.lockedInfoText,
|
|
145
|
+
isLocked = _this$props5.isLocked,
|
|
146
|
+
needReadOnlyStyle = _this$props5.needReadOnlyStyle,
|
|
147
|
+
isClickable = _this$props5.isClickable,
|
|
148
|
+
onFocus = _this$props5.onFocus,
|
|
149
|
+
ePhiData = _this$props5.ePhiData,
|
|
150
|
+
children = _this$props5.children,
|
|
151
|
+
customProps = _this$props5.customProps,
|
|
152
|
+
renderLabelProps = _this$props5.renderLabelProps,
|
|
153
|
+
needFieldStyle = _this$props5.needFieldStyle;
|
|
107
154
|
var _customProps$LabelPro = customProps.LabelProps,
|
|
108
155
|
LabelProps = _customProps$LabelPro === void 0 ? {} : _customProps$LabelPro,
|
|
109
156
|
_customProps$TextBoxI = customProps.TextBoxIconProps,
|
|
@@ -113,9 +160,15 @@ var TextBoxField = /*#__PURE__*/function (_PureComponent) {
|
|
|
113
160
|
_customProps$Validati2 = customProps.ValidationMessageProps2,
|
|
114
161
|
ValidationMessageProps2 = _customProps$Validati2 === void 0 ? {} : _customProps$Validati2;
|
|
115
162
|
var uniqueId = htmlId ? htmlId : this.getNextId();
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
"
|
|
163
|
+
var isFocused = this.state.isFocused;
|
|
164
|
+
return /*#__PURE__*/_react["default"].createElement(_RippleEffect["default"], {
|
|
165
|
+
hoverType: "bg",
|
|
166
|
+
isActive: isFocused,
|
|
167
|
+
isNeedEffect: !isReadOnly && !isDisabled && needFieldStyle ? true : false
|
|
168
|
+
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
169
|
+
className: "".concat(_FieldsModule["default"].container, " ").concat(needFieldStyle ? _FieldsModule["default"].highlightSpace : '', " ").concat(isDisabled ? _FieldsModule["default"].disabled : isReadOnly ? _FieldsModule["default"].readonly : ''),
|
|
170
|
+
"data-title": isDisabled ? title : null,
|
|
171
|
+
onClick: this.handleParentClick
|
|
119
172
|
}, labelName && /*#__PURE__*/_react["default"].createElement(_FieldContainer["default"], {
|
|
120
173
|
infoText: infoText,
|
|
121
174
|
isLocked: isLocked,
|
|
@@ -127,7 +180,7 @@ var TextBoxField = /*#__PURE__*/function (_PureComponent) {
|
|
|
127
180
|
text: labelName,
|
|
128
181
|
size: fieldSize === 'small' ? 'small' : 'medium',
|
|
129
182
|
palette: isMandatory ? 'mandatory' : isDisabled ? 'primary' : labelPalette,
|
|
130
|
-
customClass: "".concat(_FieldsModule["default"].fieldLabel, " ").concat(labelCustomClass, " ").concat(isMandatory ? _FieldsModule["default"].labelMandatory : ''),
|
|
183
|
+
customClass: "".concat(_FieldsModule["default"].fieldLabel, " ").concat(labelCustomClass, " ").concat(isMandatory ? _FieldsModule["default"].labelMandatory : '', " ").concat(_FieldsModule["default"].labelindex),
|
|
131
184
|
htmlFor: uniqueId,
|
|
132
185
|
dataId: isDisabled ? "".concat(dataId, "_label_disabled") : isMandatory ? "".concat(dataId, "_label_mandatory") : "".concat(dataId, "_label")
|
|
133
186
|
}, LabelProps, {
|
|
@@ -146,11 +199,11 @@ var TextBoxField = /*#__PURE__*/function (_PureComponent) {
|
|
|
146
199
|
value: value,
|
|
147
200
|
onChange: this.handleChange,
|
|
148
201
|
dataId: dataId,
|
|
149
|
-
onBlur:
|
|
202
|
+
onBlur: this.handleBlur,
|
|
150
203
|
onKeyDown: onKeyDown,
|
|
151
204
|
placeHolder: placeHolder,
|
|
152
205
|
borderColor: borderColor,
|
|
153
|
-
onFocus:
|
|
206
|
+
onFocus: this.handleFocus,
|
|
154
207
|
isDisabled: isDisabled,
|
|
155
208
|
needEffect: isReadOnly || isDisabled ? false : true,
|
|
156
209
|
isClickable: isClickable,
|
|
@@ -171,7 +224,7 @@ var TextBoxField = /*#__PURE__*/function (_PureComponent) {
|
|
|
171
224
|
type: errorType,
|
|
172
225
|
htmlFor: uniqueId,
|
|
173
226
|
dataId: "".concat(dataId, "_ValidationRuleMessage")
|
|
174
|
-
}, ValidationMessageProps2))));
|
|
227
|
+
}, ValidationMessageProps2)))));
|
|
175
228
|
}
|
|
176
229
|
}]);
|
|
177
230
|
return TextBoxField;
|