@elliemae/ds-wysiwygeditor 2.2.0-alpha.2 → 2.2.0-beta.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/cjs/DSWYSIWYGEditor.js +72 -83
- package/cjs/components/CustomImageUploader.js +94 -92
- package/cjs/components/CustomToolbar.js +193 -172
- package/cjs/components/DSWYSIWYGEditorImpl.js +185 -147
- package/cjs/components/ImageLibraryModal.js +55 -75
- package/cjs/components/InsertFieldModal.js +142 -109
- package/cjs/components/TippedButton.js +54 -56
- package/cjs/components/TippedSelect.js +39 -50
- package/cjs/components/colors.js +21 -41
- package/cjs/components/customFields.js +47 -66
- package/cjs/constants.js +38 -112
- package/cjs/index.js +21 -39
- package/cjs/quillMatchers/clipboardLinkWithTagMatcher.js +22 -37
- package/cjs/quillOverrides/IndentStyle.js +19 -41
- package/cjs/quillOverrides/LinkFormat.js +39 -57
- package/cjs/quillOverrides/PlainClipboard.js +21 -41
- package/cjs/utils.js +18 -41
- package/esm/DSWYSIWYGEditor.js +58 -50
- package/esm/components/CustomImageUploader.js +81 -60
- package/esm/components/CustomToolbar.js +184 -145
- package/esm/components/DSWYSIWYGEditorImpl.js +169 -113
- package/esm/components/ImageLibraryModal.js +47 -46
- package/esm/components/InsertFieldModal.js +124 -72
- package/esm/components/TippedButton.js +44 -27
- package/esm/components/TippedSelect.js +31 -21
- package/esm/components/colors.js +17 -12
- package/esm/components/customFields.js +40 -38
- package/esm/constants.js +30 -83
- package/esm/index.js +4 -10
- package/esm/quillMatchers/clipboardLinkWithTagMatcher.js +18 -8
- package/esm/quillOverrides/IndentStyle.js +17 -12
- package/esm/quillOverrides/LinkFormat.js +37 -28
- package/esm/quillOverrides/PlainClipboard.js +19 -12
- package/esm/utils.js +14 -12
- package/package.json +9 -9
- package/types/DSWYSIWYGEditor.d.ts +1 -12
- package/cjs/DSWYSIWYGEditor.js.map +0 -7
- package/cjs/components/CustomImageUploader.js.map +0 -7
- package/cjs/components/CustomToolbar.js.map +0 -7
- package/cjs/components/DSWYSIWYGEditorImpl.js.map +0 -7
- package/cjs/components/ImageLibraryModal.js.map +0 -7
- package/cjs/components/InsertFieldModal.js.map +0 -7
- package/cjs/components/TippedButton.js.map +0 -7
- package/cjs/components/TippedSelect.js.map +0 -7
- package/cjs/components/colors.js.map +0 -7
- package/cjs/components/customFields.js.map +0 -7
- package/cjs/constants.js.map +0 -7
- package/cjs/index.js.map +0 -7
- package/cjs/quillMatchers/clipboardLinkWithTagMatcher.js.map +0 -7
- package/cjs/quillOverrides/IndentStyle.js.map +0 -7
- package/cjs/quillOverrides/LinkFormat.js.map +0 -7
- package/cjs/quillOverrides/PlainClipboard.js.map +0 -7
- package/cjs/utils.js.map +0 -7
- package/esm/DSWYSIWYGEditor.js.map +0 -7
- package/esm/components/CustomImageUploader.js.map +0 -7
- package/esm/components/CustomToolbar.js.map +0 -7
- package/esm/components/DSWYSIWYGEditorImpl.js.map +0 -7
- package/esm/components/ImageLibraryModal.js.map +0 -7
- package/esm/components/InsertFieldModal.js.map +0 -7
- package/esm/components/TippedButton.js.map +0 -7
- package/esm/components/TippedSelect.js.map +0 -7
- package/esm/components/colors.js.map +0 -7
- package/esm/components/customFields.js.map +0 -7
- package/esm/constants.js.map +0 -7
- package/esm/index.js.map +0 -7
- package/esm/quillMatchers/clipboardLinkWithTagMatcher.js.map +0 -7
- package/esm/quillOverrides/IndentStyle.js.map +0 -7
- package/esm/quillOverrides/LinkFormat.js.map +0 -7
- package/esm/quillOverrides/PlainClipboard.js.map +0 -7
- package/esm/utils.js.map +0 -7
|
@@ -1,156 +1,208 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
1
|
+
import _objectWithoutProperties from '@babel/runtime/helpers/esm/objectWithoutProperties';
|
|
2
|
+
import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
|
|
3
|
+
import _jsx from '@babel/runtime/helpers/esm/jsx';
|
|
4
|
+
import 'core-js/modules/esnext.async-iterator.map.js';
|
|
5
|
+
import 'core-js/modules/esnext.iterator.map.js';
|
|
6
|
+
import 'core-js/modules/esnext.async-iterator.filter.js';
|
|
7
|
+
import 'core-js/modules/esnext.iterator.constructor.js';
|
|
8
|
+
import 'core-js/modules/esnext.iterator.filter.js';
|
|
9
|
+
import 'core-js/modules/esnext.async-iterator.for-each.js';
|
|
10
|
+
import 'core-js/modules/esnext.iterator.for-each.js';
|
|
11
|
+
import React from 'react';
|
|
12
|
+
import DSModal, { MODAL_TYPE } from '@elliemae/ds-modal';
|
|
13
|
+
import { sizeOptions } from '@elliemae/ds-shared/constants';
|
|
14
|
+
import { includes } from 'lodash';
|
|
15
|
+
import { getFieldCode, getFieldName, fields } from './customFields.js';
|
|
16
|
+
import { jsx } from 'react/jsx-runtime';
|
|
17
|
+
|
|
18
|
+
const _excluded = ["customFields", "onSelect"];
|
|
19
|
+
|
|
20
|
+
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; }
|
|
21
|
+
|
|
22
|
+
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; }
|
|
8
23
|
const modalTypes = Object.values(MODAL_TYPE);
|
|
9
|
-
const elementClassName =
|
|
10
|
-
class InsertFieldModal extends
|
|
24
|
+
const elementClassName = 'insertfieldmodal-element';
|
|
25
|
+
class InsertFieldModal extends React.PureComponent {
|
|
11
26
|
constructor(props) {
|
|
12
27
|
super(props);
|
|
28
|
+
|
|
13
29
|
this.onConfirm = () => {
|
|
14
|
-
const {
|
|
15
|
-
|
|
30
|
+
const {
|
|
31
|
+
onConfirm,
|
|
32
|
+
onClose
|
|
33
|
+
} = this.props;
|
|
34
|
+
const {
|
|
35
|
+
selectedFieldCode
|
|
36
|
+
} = this.state;
|
|
16
37
|
onConfirm(selectedFieldCode);
|
|
17
38
|
onClose();
|
|
18
39
|
};
|
|
40
|
+
|
|
19
41
|
this.onReject = () => {
|
|
20
|
-
const {
|
|
42
|
+
const {
|
|
43
|
+
onReject,
|
|
44
|
+
onClose
|
|
45
|
+
} = this.props;
|
|
46
|
+
|
|
21
47
|
if (onReject) {
|
|
22
48
|
onReject();
|
|
23
49
|
} else {
|
|
24
50
|
onClose();
|
|
25
51
|
}
|
|
26
52
|
};
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
53
|
+
|
|
54
|
+
this.drawDiv = (className, content, content2) => /*#__PURE__*/_jsx("div", {
|
|
55
|
+
className: className
|
|
56
|
+
}, void 0, /*#__PURE__*/_jsx("span", {}, void 0, content), /*#__PURE__*/_jsx("span", {}, void 0, content2));
|
|
57
|
+
|
|
58
|
+
this.drawLabel = (className, label, value) => /*#__PURE__*/_jsx("div", {
|
|
59
|
+
className: className
|
|
60
|
+
}, void 0, /*#__PURE__*/_jsx("span", {
|
|
33
61
|
className: "label"
|
|
34
|
-
}, label),
|
|
62
|
+
}, void 0, label), /*#__PURE__*/_jsx("span", {
|
|
35
63
|
className: "value"
|
|
36
|
-
}, value));
|
|
64
|
+
}, void 0, value));
|
|
65
|
+
|
|
37
66
|
this.handleElementClick = (e, selectedFieldCode) => {
|
|
38
|
-
if (e.key && e.key !==
|
|
67
|
+
if (e.key && e.key !== ' ') {
|
|
39
68
|
return;
|
|
40
69
|
}
|
|
41
|
-
|
|
42
|
-
const {
|
|
70
|
+
|
|
71
|
+
const {
|
|
72
|
+
selectedFieldCode: fCode
|
|
73
|
+
} = this.state;
|
|
74
|
+
const {
|
|
75
|
+
disableDoubleClick
|
|
76
|
+
} = this.props;
|
|
77
|
+
|
|
43
78
|
if (selectedFieldCode === fCode && !disableDoubleClick) {
|
|
44
79
|
this.onConfirm();
|
|
45
80
|
return;
|
|
46
81
|
}
|
|
82
|
+
|
|
47
83
|
this.setState({
|
|
48
84
|
selectedFieldCode
|
|
49
85
|
});
|
|
50
|
-
const {
|
|
86
|
+
const {
|
|
87
|
+
onSelect
|
|
88
|
+
} = this.props;
|
|
89
|
+
|
|
51
90
|
if (onSelect) {
|
|
52
91
|
onSelect(selectedFieldCode);
|
|
53
92
|
}
|
|
54
93
|
};
|
|
94
|
+
|
|
55
95
|
this.preventSpacebarScroll = () => {
|
|
56
|
-
document.onkeypress = function(e) {
|
|
96
|
+
document.onkeypress = function (e) {
|
|
57
97
|
if (!includes(e.target.className, elementClassName)) {
|
|
58
98
|
return true;
|
|
59
99
|
}
|
|
100
|
+
|
|
60
101
|
e = e || window.event;
|
|
61
102
|
const charCode = e.keyCode || e.which;
|
|
103
|
+
|
|
62
104
|
if (charCode === 32) {
|
|
63
105
|
e.preventDefault();
|
|
64
106
|
return false;
|
|
65
107
|
}
|
|
108
|
+
|
|
66
109
|
return true;
|
|
67
110
|
};
|
|
68
111
|
};
|
|
112
|
+
|
|
69
113
|
this.renderElements = () => {
|
|
70
|
-
const {
|
|
114
|
+
const {
|
|
115
|
+
customFields
|
|
116
|
+
} = this.props;
|
|
117
|
+
|
|
71
118
|
if (!customFields) {
|
|
72
|
-
return
|
|
119
|
+
return 'Empty';
|
|
73
120
|
}
|
|
74
|
-
|
|
121
|
+
|
|
122
|
+
const {
|
|
123
|
+
selectedFieldCode
|
|
124
|
+
} = this.state;
|
|
75
125
|
return customFields.map((customField, idx) => {
|
|
76
126
|
const extras = {};
|
|
77
127
|
const fieldCode = getFieldCode(customField);
|
|
128
|
+
|
|
78
129
|
if (this.focusFirst && idx === 0) {
|
|
79
|
-
extras.ref =
|
|
80
|
-
|
|
130
|
+
extras.ref = element => element && element.focus();
|
|
131
|
+
|
|
132
|
+
this.focusFirst = undefined;
|
|
81
133
|
} else if (fieldCode === selectedFieldCode) {
|
|
82
|
-
extras.ref =
|
|
134
|
+
extras.ref = element => element && element.focus();
|
|
83
135
|
}
|
|
84
|
-
|
|
85
|
-
|
|
136
|
+
|
|
137
|
+
return /*#__PURE__*/jsx("div", _objectSpread(_objectSpread({
|
|
86
138
|
className: elementClassName,
|
|
87
|
-
onClick:
|
|
88
|
-
onKeyUp:
|
|
139
|
+
onClick: e => this.handleElementClick(e, fieldCode),
|
|
140
|
+
onKeyUp: e => this.handleElementClick(e, fieldCode),
|
|
89
141
|
role: "button",
|
|
90
|
-
tabIndex: 0
|
|
91
|
-
|
|
92
|
-
|
|
142
|
+
tabIndex: 0
|
|
143
|
+
}, extras), {}, {
|
|
144
|
+
children: this.drawLabel('content', getFieldName(customField), fieldCode)
|
|
145
|
+
}), fieldCode);
|
|
93
146
|
});
|
|
94
147
|
};
|
|
148
|
+
|
|
95
149
|
this.state = {
|
|
96
150
|
selectedFieldCode: getFieldCode(fields[0])
|
|
97
151
|
};
|
|
98
152
|
this.preventSpacebarScroll();
|
|
99
153
|
}
|
|
154
|
+
|
|
100
155
|
componentDidMount() {
|
|
101
|
-
const {
|
|
156
|
+
const {
|
|
157
|
+
customFields
|
|
158
|
+
} = this.props;
|
|
159
|
+
|
|
102
160
|
if (customFields) {
|
|
103
161
|
this.handleElementClick({}, customFields[0]);
|
|
104
162
|
this.focusFirst = true;
|
|
105
163
|
}
|
|
106
164
|
}
|
|
165
|
+
|
|
107
166
|
getDerivedStateFromProps(nextProps) {
|
|
108
|
-
const {
|
|
167
|
+
const {
|
|
168
|
+
customFields
|
|
169
|
+
} = this.props;
|
|
170
|
+
|
|
109
171
|
if (!customFields && nextProps.customFields) {
|
|
110
|
-
this.setState({
|
|
172
|
+
this.setState({
|
|
173
|
+
selectedFieldCode: customFields[0]
|
|
174
|
+
});
|
|
111
175
|
}
|
|
112
176
|
}
|
|
177
|
+
|
|
113
178
|
render() {
|
|
114
|
-
const
|
|
115
|
-
|
|
116
|
-
|
|
179
|
+
const _this$props = this.props,
|
|
180
|
+
modalProps = _objectWithoutProperties(_this$props, _excluded);
|
|
181
|
+
|
|
182
|
+
return /*#__PURE__*/jsx(DSModal, _objectSpread(_objectSpread({}, modalProps), {}, {
|
|
117
183
|
className: "insert-field-modal",
|
|
118
184
|
onConfirm: this.onConfirm,
|
|
119
|
-
onReject: this.onReject
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
185
|
+
onReject: this.onReject,
|
|
186
|
+
children: /*#__PURE__*/_jsx("div", {
|
|
187
|
+
className: "wrapper"
|
|
188
|
+
}, void 0, /*#__PURE__*/_jsx("div", {
|
|
189
|
+
className: "col-1"
|
|
190
|
+
}, void 0, this.drawDiv('title', 'Field Name', '« Field ID »'), this.renderElements()))
|
|
191
|
+
}));
|
|
125
192
|
}
|
|
193
|
+
|
|
126
194
|
}
|
|
127
|
-
InsertFieldModal.propTypes = {
|
|
128
|
-
onConfirm: PropTypes.func.isRequired,
|
|
129
|
-
onClose: PropTypes.func.isRequired,
|
|
130
|
-
confirmLabel: PropTypes.string,
|
|
131
|
-
customFields: PropTypes.arrayOf(PropTypes.string),
|
|
132
|
-
disableDoubleClick: PropTypes.bool,
|
|
133
|
-
isOpen: PropTypes.bool,
|
|
134
|
-
modalTitle: PropTypes.string,
|
|
135
|
-
modalType: PropTypes.string,
|
|
136
|
-
rejectLabel: PropTypes.string,
|
|
137
|
-
shouldCloseOnOverlayClick: PropTypes.bool,
|
|
138
|
-
size: PropTypes.string,
|
|
139
|
-
onSelect: PropTypes.func
|
|
140
|
-
};
|
|
141
195
|
InsertFieldModal.defaultProps = {
|
|
142
|
-
confirmLabel:
|
|
196
|
+
confirmLabel: 'Add',
|
|
143
197
|
customFields: fields,
|
|
144
198
|
disableDoubleClick: false,
|
|
145
199
|
isOpen: true,
|
|
146
|
-
modalTitle:
|
|
200
|
+
modalTitle: 'Add Field',
|
|
147
201
|
modalType: modalTypes[1],
|
|
148
|
-
rejectLabel:
|
|
202
|
+
rejectLabel: 'Cancel',
|
|
149
203
|
shouldCloseOnOverlayClick: true,
|
|
150
204
|
size: sizeOptions[1],
|
|
151
|
-
onSelect:
|
|
152
|
-
};
|
|
153
|
-
export {
|
|
154
|
-
InsertFieldModal as default
|
|
205
|
+
onSelect: undefined
|
|
155
206
|
};
|
|
156
|
-
|
|
207
|
+
|
|
208
|
+
export { InsertFieldModal as default };
|
|
@@ -1,28 +1,45 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
1
|
+
import 'core-js/modules/esnext.async-iterator.filter.js';
|
|
2
|
+
import 'core-js/modules/esnext.iterator.constructor.js';
|
|
3
|
+
import 'core-js/modules/esnext.iterator.filter.js';
|
|
4
|
+
import 'core-js/modules/esnext.async-iterator.for-each.js';
|
|
5
|
+
import 'core-js/modules/esnext.iterator.for-each.js';
|
|
6
|
+
import _jsx from '@babel/runtime/helpers/esm/jsx';
|
|
7
|
+
import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
|
|
8
|
+
import _objectWithoutProperties from '@babel/runtime/helpers/esm/objectWithoutProperties';
|
|
9
|
+
import 'react';
|
|
10
|
+
import { DSTooltipV3 } from '@elliemae/ds-tooltip';
|
|
11
|
+
import { jsx } from 'react/jsx-runtime';
|
|
12
|
+
|
|
13
|
+
const _excluded = ["className", "tip", "children", "onClick", "zIndex"];
|
|
14
|
+
|
|
15
|
+
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; }
|
|
16
|
+
|
|
17
|
+
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; }
|
|
18
|
+
const TippedButton = _ref => {
|
|
19
|
+
let {
|
|
20
|
+
className,
|
|
21
|
+
tip,
|
|
22
|
+
children,
|
|
23
|
+
onClick = () => null,
|
|
24
|
+
zIndex = 1
|
|
25
|
+
} = _ref,
|
|
26
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
27
|
+
|
|
28
|
+
return /*#__PURE__*/_jsx("div", {
|
|
29
|
+
className: "tooltip"
|
|
30
|
+
}, void 0, /*#__PURE__*/_jsx(DSTooltipV3, {
|
|
31
|
+
text: tip,
|
|
32
|
+
zIndex: zIndex
|
|
33
|
+
}, void 0, /*#__PURE__*/jsx("button", _objectSpread(_objectSpread({
|
|
34
|
+
type: "button",
|
|
35
|
+
className: className,
|
|
36
|
+
onClick: e => {
|
|
37
|
+
e.preventDefault();
|
|
38
|
+
onClick(e);
|
|
39
|
+
}
|
|
40
|
+
}, rest), {}, {
|
|
41
|
+
children: children
|
|
42
|
+
}))));
|
|
27
43
|
};
|
|
28
|
-
|
|
44
|
+
|
|
45
|
+
export { TippedButton };
|
|
@@ -1,27 +1,37 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
import _jsx from '@babel/runtime/helpers/esm/jsx';
|
|
2
|
+
import 'core-js/modules/web.dom-collections.iterator.js';
|
|
3
|
+
import 'core-js/modules/esnext.async-iterator.map.js';
|
|
4
|
+
import 'core-js/modules/esnext.iterator.map.js';
|
|
5
|
+
import 'react';
|
|
6
|
+
import { DSTooltipV3 } from '@elliemae/ds-tooltip';
|
|
7
|
+
|
|
8
|
+
const TippedSelect = props => {
|
|
9
|
+
const {
|
|
10
|
+
tip,
|
|
11
|
+
onChange = () => null,
|
|
12
|
+
className,
|
|
13
|
+
options,
|
|
14
|
+
defaultValue = '',
|
|
15
|
+
values,
|
|
16
|
+
zIndex,
|
|
17
|
+
children
|
|
18
|
+
} = props;
|
|
19
|
+
const fallBackChildren = values && values.map((value, index) => /*#__PURE__*/_jsx("option", {
|
|
20
|
+
value: value === 'normal' ? '' : value
|
|
21
|
+
}, value, options ? options[index] : null));
|
|
22
|
+
return /*#__PURE__*/_jsx("div", {
|
|
11
23
|
className: "tooltip"
|
|
12
|
-
},
|
|
24
|
+
}, void 0, /*#__PURE__*/_jsx(DSTooltipV3, {
|
|
13
25
|
text: tip,
|
|
14
|
-
zIndex
|
|
15
|
-
},
|
|
16
|
-
className,
|
|
17
|
-
defaultValue,
|
|
18
|
-
onChange:
|
|
26
|
+
zIndex: zIndex
|
|
27
|
+
}, void 0, /*#__PURE__*/_jsx("div", {}, void 0, /*#__PURE__*/_jsx("select", {
|
|
28
|
+
className: className,
|
|
29
|
+
defaultValue: defaultValue,
|
|
30
|
+
onChange: e => {
|
|
19
31
|
e.persist();
|
|
20
32
|
onChange(e);
|
|
21
33
|
}
|
|
22
|
-
}, children || fallBackChildren))));
|
|
23
|
-
};
|
|
24
|
-
export {
|
|
25
|
-
TippedSelect
|
|
34
|
+
}, void 0, children || fallBackChildren))));
|
|
26
35
|
};
|
|
27
|
-
|
|
36
|
+
|
|
37
|
+
export { TippedSelect };
|
package/esm/components/colors.js
CHANGED
|
@@ -1,21 +1,26 @@
|
|
|
1
|
-
import
|
|
1
|
+
import 'core-js/modules/esnext.async-iterator.map.js';
|
|
2
|
+
import 'core-js/modules/esnext.iterator.map.js';
|
|
3
|
+
|
|
2
4
|
function sinToHex(i, size, phase) {
|
|
3
5
|
const sin = Math.sin(Math.PI / size * 2 * i + phase);
|
|
4
6
|
const int = Math.floor(sin * 127) + 128;
|
|
5
7
|
const hex = int.toString(16);
|
|
6
|
-
return hex.length === 1 ?
|
|
8
|
+
return hex.length === 1 ? "0".concat(hex) : hex;
|
|
7
9
|
}
|
|
8
|
-
|
|
9
|
-
|
|
10
|
+
|
|
11
|
+
function getRainbowColors() {
|
|
12
|
+
let size = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 28;
|
|
13
|
+
const colors = new Array(size).fill(undefined);
|
|
10
14
|
return colors.map((color, idx) => {
|
|
11
|
-
const red = sinToHex(idx, size, 0 * Math.PI * 2 / 3);
|
|
12
|
-
|
|
13
|
-
const
|
|
14
|
-
|
|
15
|
+
const red = sinToHex(idx, size, 0 * Math.PI * 2 / 3); // 0 deg
|
|
16
|
+
|
|
17
|
+
const blue = sinToHex(idx, size, 1 * Math.PI * 2 / 3); // 120 deg
|
|
18
|
+
|
|
19
|
+
const green = sinToHex(idx, size, 2 * Math.PI * 2 / 3); // 240 deg
|
|
20
|
+
|
|
21
|
+
color = "#".concat(red).concat(green).concat(blue);
|
|
15
22
|
return color;
|
|
16
23
|
});
|
|
17
24
|
}
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
};
|
|
21
|
-
//# sourceMappingURL=colors.js.map
|
|
25
|
+
|
|
26
|
+
export { getRainbowColors };
|
|
@@ -1,47 +1,49 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
1
|
+
import 'core-js/modules/esnext.async-iterator.map.js';
|
|
2
|
+
import 'core-js/modules/esnext.iterator.map.js';
|
|
3
|
+
|
|
4
|
+
var _this = undefined;
|
|
5
|
+
const fields = ['Lender Name «315»', 'Lender Address «319»', 'Lender City «313»', 'Lender State «321»', 'Lender Zip «323»', 'Borrower First Name «4000»', 'Borrower Last Name «4002»', 'Total Loan Amount «2»', 'Loan Term «4»', 'Loan to Value «976»', 'Monthly Payment «912»', 'Interest Rate «3»', 'Loan Originator Name «1612»', 'Loan Originator Email «3968»', 'Loan Originator Phone «1823»', 'NMLS Loan Originator ID «3238»'];
|
|
6
|
+
/**
|
|
7
|
+
* Returns the fields names
|
|
8
|
+
*
|
|
9
|
+
* @param customFields
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
const getFields = function () {
|
|
13
|
+
let customFields = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : fields;
|
|
14
|
+
return customFields.map((opt, index) => ({
|
|
15
|
+
id: "".concat(opt, "_").concat(index),
|
|
16
|
+
// icon: 'ADD',
|
|
17
|
+
label: "".concat(opt),
|
|
18
|
+
onClick: opt.indexOf('«') !== -1 ? () => _this.onOptionClick(_this.getFieldCode(opt)) : null,
|
|
19
|
+
type: opt === '' ? 'separator' : null
|
|
20
|
+
}));
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* Returns a field's name
|
|
24
|
+
*
|
|
25
|
+
* @param field
|
|
26
|
+
*/
|
|
27
|
+
|
|
28
|
+
const getFieldName = field => {
|
|
29
|
+
const codeIndex = field.indexOf('«');
|
|
28
30
|
return field.substring(0, codeIndex);
|
|
29
31
|
};
|
|
30
|
-
|
|
31
|
-
|
|
32
|
+
/**
|
|
33
|
+
* Returns a field's id. E.g: «456»
|
|
34
|
+
*
|
|
35
|
+
* @param field
|
|
36
|
+
*/
|
|
37
|
+
|
|
38
|
+
const getFieldCode = field => {
|
|
39
|
+
const codeIndex = field.indexOf('«');
|
|
32
40
|
return field.substring(codeIndex);
|
|
33
41
|
};
|
|
34
|
-
var
|
|
42
|
+
var customFields = {
|
|
35
43
|
fields,
|
|
36
44
|
getFields,
|
|
37
45
|
getFieldName,
|
|
38
46
|
getFieldCode
|
|
39
47
|
};
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
fields,
|
|
43
|
-
getFieldCode,
|
|
44
|
-
getFieldName,
|
|
45
|
-
getFields
|
|
46
|
-
};
|
|
47
|
-
//# sourceMappingURL=customFields.js.map
|
|
48
|
+
|
|
49
|
+
export { customFields as default, fields, getFieldCode, getFieldName, getFields };
|
package/esm/constants.js
CHANGED
|
@@ -1,85 +1,32 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { getRainbowColors } from
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
"#0066cc",
|
|
10
|
-
"#9933ff",
|
|
11
|
-
"#ffffff",
|
|
12
|
-
"#facccc",
|
|
13
|
-
"#ffebcc",
|
|
14
|
-
"#ffffcc",
|
|
15
|
-
"#cce8cc",
|
|
16
|
-
"#cce0f5",
|
|
17
|
-
"#ebd6ff",
|
|
18
|
-
"#bbbbbb",
|
|
19
|
-
"#f06666",
|
|
20
|
-
"#ffc266",
|
|
21
|
-
"#ffff66",
|
|
22
|
-
"#66b966",
|
|
23
|
-
"#66a3e0",
|
|
24
|
-
"#c285ff",
|
|
25
|
-
"#888888",
|
|
26
|
-
"#a10000",
|
|
27
|
-
"#b26b00",
|
|
28
|
-
"#b2b200",
|
|
29
|
-
"#006100",
|
|
30
|
-
"#0047b2",
|
|
31
|
-
"#6b24b2",
|
|
32
|
-
"#444444",
|
|
33
|
-
"#5c0000",
|
|
34
|
-
"#663d00",
|
|
35
|
-
"#666600",
|
|
36
|
-
"#003700",
|
|
37
|
-
"#002966",
|
|
38
|
-
"#3d1466",
|
|
39
|
-
...getRainbowColors(28)
|
|
40
|
-
];
|
|
41
|
-
const fonts = [
|
|
42
|
-
"Sans Serif",
|
|
43
|
-
"Serif",
|
|
44
|
-
"Monospace",
|
|
45
|
-
"Arial",
|
|
46
|
-
"Georgia",
|
|
47
|
-
"Helvetica"
|
|
48
|
-
];
|
|
49
|
-
const sizes = ["Small", "Normal", "Large", "Huge"];
|
|
50
|
-
const sizesReal = [
|
|
51
|
-
"X-Small",
|
|
52
|
-
"Normal",
|
|
53
|
-
"Large",
|
|
54
|
-
"X-Large"
|
|
55
|
-
];
|
|
1
|
+
import 'core-js/modules/web.dom-collections.iterator.js';
|
|
2
|
+
import { getRainbowColors } from './components/colors.js';
|
|
3
|
+
|
|
4
|
+
const colors = ['#000000', '#e60000', '#ff9900', '#ffff00', '#008A00', '#0066cc', '#9933ff', '#ffffff', '#facccc', '#ffebcc', '#ffffcc', '#cce8cc', '#cce0f5', '#ebd6ff', '#bbbbbb', '#f06666', '#ffc266', '#ffff66', '#66b966', '#66a3e0', '#c285ff', '#888888', '#a10000', '#b26b00', '#b2b200', '#006100', '#0047b2', '#6b24b2', '#444444', '#5c0000', '#663d00', '#666600', '#003700', '#002966', '#3d1466', ...getRainbowColors(28)];
|
|
5
|
+
const fonts = ['Sans Serif', 'Serif', 'Monospace', 'Arial', 'Georgia', 'Helvetica'];
|
|
6
|
+
const sizes = ['Small', 'Normal', 'Large', 'Huge'];
|
|
7
|
+
const sizesReal = [// https://www.w3schools.com/cssref/pr_font_font-size.asp
|
|
8
|
+
'X-Small', 'Normal', 'Large', 'X-Large'];
|
|
56
9
|
const defaultItems = {
|
|
57
|
-
HEADER:
|
|
58
|
-
FONT:
|
|
59
|
-
FONT_SIZE:
|
|
60
|
-
BOLD:
|
|
61
|
-
ITALIC:
|
|
62
|
-
UNDERLINE:
|
|
63
|
-
STRIKE:
|
|
64
|
-
SUB:
|
|
65
|
-
SUPER:
|
|
66
|
-
ORDERED_LIST:
|
|
67
|
-
BULLET_LIST:
|
|
68
|
-
INDENT_MINUS_ONE:
|
|
69
|
-
INDENT_PLUS_ONE:
|
|
70
|
-
ALIGN:
|
|
71
|
-
FONT_COLOR:
|
|
72
|
-
FONT_BACKGROUND_COLOR:
|
|
73
|
-
HYPERLINK:
|
|
74
|
-
IMAGE:
|
|
75
|
-
CLEAR_FORMAT:
|
|
76
|
-
SHOW_HTML:
|
|
10
|
+
HEADER: 'header',
|
|
11
|
+
FONT: 'font',
|
|
12
|
+
FONT_SIZE: 'size',
|
|
13
|
+
BOLD: 'bold',
|
|
14
|
+
ITALIC: 'italic',
|
|
15
|
+
UNDERLINE: 'underline',
|
|
16
|
+
STRIKE: 'strike',
|
|
17
|
+
SUB: 'sub',
|
|
18
|
+
SUPER: 'super',
|
|
19
|
+
ORDERED_LIST: 'ordered list',
|
|
20
|
+
BULLET_LIST: 'bullet list',
|
|
21
|
+
INDENT_MINUS_ONE: 'indent -1',
|
|
22
|
+
INDENT_PLUS_ONE: 'indent +1',
|
|
23
|
+
ALIGN: 'align',
|
|
24
|
+
FONT_COLOR: 'font color',
|
|
25
|
+
FONT_BACKGROUND_COLOR: 'font background color',
|
|
26
|
+
HYPERLINK: 'hyperlink',
|
|
27
|
+
IMAGE: 'image',
|
|
28
|
+
CLEAR_FORMAT: 'clear format',
|
|
29
|
+
SHOW_HTML: 'show html'
|
|
77
30
|
};
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
defaultItems,
|
|
81
|
-
fonts,
|
|
82
|
-
sizes,
|
|
83
|
-
sizesReal
|
|
84
|
-
};
|
|
85
|
-
//# sourceMappingURL=constants.js.map
|
|
31
|
+
|
|
32
|
+
export { colors, defaultItems, fonts, sizes, sizesReal };
|