@vendorflow/components 2.0.95 → 2.0.97
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/lib/TempHooks.d.ts +9 -0
- package/lib/TempHooks.js +25 -0
- package/lib/components/InfiniteScroll/InfiniteScroll.d.ts +16 -0
- package/lib/components/InfiniteScroll/InfiniteScroll.js +159 -0
- package/lib/components/InfiniteScroll/index.d.ts +1 -0
- package/lib/components/InfiniteScroll/index.js +8 -0
- package/lib/components/blueprint/InputGroup/InputGroup.d.ts +20 -0
- package/lib/components/blueprint/InputGroup/InputGroup.js +13 -0
- package/lib/components/blueprint/InputGroup/InputGroup.story.d.ts +2 -0
- package/lib/components/blueprint/InputGroup/InputGroup.story.js +11 -0
- package/lib/components/blueprint/InputGroup/index.d.ts +1 -0
- package/lib/components/blueprint/InputGroup/index.js +4 -0
- package/lib/components/blueprint/InputSelect/InputSelect.d.ts +51 -0
- package/lib/components/blueprint/InputSelect/InputSelect.js +98 -0
- package/lib/components/blueprint/InputSelect/InputSelect.story.d.ts +3 -0
- package/lib/components/blueprint/InputSelect/InputSelect.story.js +19 -0
- package/lib/components/blueprint/InputSelect/index.d.ts +1 -0
- package/lib/components/blueprint/InputSelect/index.js +4 -0
- package/lib/components/blueprint/InputTime/InputTime.d.ts +24 -0
- package/lib/components/blueprint/InputTime/InputTime.js +28 -0
- package/lib/components/blueprint/InputTime/InputTime.story.d.ts +2 -0
- package/lib/components/blueprint/InputTime/InputTime.story.js +11 -0
- package/lib/components/blueprint/InputTime/index.d.ts +1 -0
- package/lib/components/blueprint/InputTime/index.js +4 -0
- package/lib/components/material-ui/ChatInterface/ActionsMenu.d.ts +4 -0
- package/lib/components/material-ui/ChatInterface/ActionsMenu.js +37 -0
- package/lib/components/material-ui/ChatInterface/ChatInterface.d.ts +33 -0
- package/lib/components/material-ui/ChatInterface/ChatInterface.js +109 -0
- package/lib/components/material-ui/ChatInterface/ChatInterface.story.d.ts +1 -0
- package/lib/components/material-ui/ChatInterface/ChatInterface.story.js +134 -0
- package/lib/components/material-ui/ChatInterface/MessageInput.d.ts +9 -0
- package/lib/components/material-ui/ChatInterface/MessageInput.js +53 -0
- package/lib/components/material-ui/ChatInterface/MessageItem.d.ts +8 -0
- package/lib/components/material-ui/ChatInterface/MessageItem.js +71 -0
- package/lib/components/material-ui/ChatInterface/MessageThread.d.ts +6 -0
- package/lib/components/material-ui/ChatInterface/MessageThread.js +119 -0
- package/lib/components/material-ui/ChatInterface/index.d.ts +1 -0
- package/lib/components/material-ui/ChatInterface/index.js +8 -0
- package/lib/components/material-ui/ColorPicker/styles.d.ts +1 -1
- package/lib/components/material-ui/DataTable/AppliedFilters.d.ts +12 -0
- package/lib/components/material-ui/DataTable/AppliedFilters.js +26 -0
- package/lib/components/material-ui/DataTable/GlobalSearchFilter.d.ts +10 -0
- package/lib/components/material-ui/DataTable/GlobalSearchFilter.js +49 -0
- package/lib/components/material-ui/DataTable/IndeterminateCheckbox.d.ts +4 -0
- package/lib/components/material-ui/DataTable/IndeterminateCheckbox.js +65 -0
- package/lib/components/material-ui/DataTable/SortIndicator.d.ts +10 -0
- package/lib/components/material-ui/DataTable/SortIndicator.js +33 -0
- package/lib/components/material-ui/DataTable/Toolbar.d.ts +24 -0
- package/lib/components/material-ui/DataTable/Toolbar.js +63 -0
- package/lib/components/material-ui/DataTable/Utils.d.ts +25 -0
- package/lib/components/material-ui/DataTable/Utils.js +119 -0
- package/lib/components/material-ui/DataTable/ViewColumnTool.d.ts +11 -0
- package/lib/components/material-ui/DataTable/ViewColumnTool.js +76 -0
- package/lib/components/material-ui/ErrorBoundary/ErrorBoundary.d.ts +7 -0
- package/lib/components/material-ui/ErrorBoundary/ErrorBoundary.js +20 -0
- package/lib/components/material-ui/ErrorBoundary/index.d.ts +1 -0
- package/lib/components/material-ui/ErrorBoundary/index.js +8 -0
- package/lib/components/material-ui/InputCheckboxGroup/InputCheckboxGroup.d.ts +1 -0
- package/lib/components/material-ui/InputCheckboxGroup/InputCheckboxGroup.js +3 -3
- package/lib/components/material-ui/InputRadioGroup/InputRadioGroup.d.ts +1 -0
- package/lib/components/material-ui/InputRadioGroup/InputRadioGroup.js +3 -3
- package/lib/components/material-ui/InputSearchDropdown/InputSearchDropdown.d.ts +2 -1
- package/lib/components/material-ui/InputSearchDropdown/InputSearchDropdown.js +2 -2
- package/lib/services/Select.service.d.ts +5 -0
- package/lib/services/Select.service.js +67 -0
- package/package.json +1 -1
|
@@ -55,7 +55,7 @@ var useStyles = (0, styles_1.makeStyles)({
|
|
|
55
55
|
},
|
|
56
56
|
});
|
|
57
57
|
function InputSearchDropdown(props) {
|
|
58
|
-
var _a = props.autoHighlight, autoHighlight = _a === void 0 ? true : _a, _b = props.clearOnEscape, clearOnEscape = _b === void 0 ? true : _b, count = props.count, disableFilter = props.disableFilter, error = props.error, errors = props.errors, filterOptions = props.filterOptions, _c = props.filterSelectedOptions, filterSelectedOptions = _c === void 0 ? true : _c, getKey = props.getKey, label = props.label, helperText = props.helperText, name = props.name, onChange = props.onChange, _d = props.openOnFocus, openOnFocus = _d === void 0 ? true : _d, _e = props.renderInput, renderInput = _e === void 0 ? null : _e, renderTags = props.renderTags, _f = props.selectOnFocus, selectOnFocus = _f === void 0 ? true : _f, _g = props.variant, variant = _g === void 0 ? 'outlined' : _g, multiple = props.multiple, max = props.max, autoFocus = props.autoFocus, _h = props.size, size = _h === void 0 ? 'small' : _h, restOfProps = __rest(props, ["autoHighlight", "clearOnEscape", "count", "disableFilter", "error", "errors", "filterOptions", "filterSelectedOptions", "getKey", "label", "helperText", "name", "onChange", "openOnFocus", "renderInput", "renderTags", "selectOnFocus", "variant", "multiple", "max", "autoFocus", "size"]);
|
|
58
|
+
var mRef = props.mRef, _a = props.autoHighlight, autoHighlight = _a === void 0 ? true : _a, _b = props.clearOnEscape, clearOnEscape = _b === void 0 ? true : _b, count = props.count, disableFilter = props.disableFilter, error = props.error, errors = props.errors, filterOptions = props.filterOptions, _c = props.filterSelectedOptions, filterSelectedOptions = _c === void 0 ? true : _c, getKey = props.getKey, label = props.label, helperText = props.helperText, name = props.name, onChange = props.onChange, _d = props.openOnFocus, openOnFocus = _d === void 0 ? true : _d, _e = props.renderInput, renderInput = _e === void 0 ? null : _e, renderTags = props.renderTags, _f = props.selectOnFocus, selectOnFocus = _f === void 0 ? true : _f, _g = props.variant, variant = _g === void 0 ? 'outlined' : _g, multiple = props.multiple, max = props.max, autoFocus = props.autoFocus, _h = props.size, size = _h === void 0 ? 'small' : _h, restOfProps = __rest(props, ["mRef", "autoHighlight", "clearOnEscape", "count", "disableFilter", "error", "errors", "filterOptions", "filterSelectedOptions", "getKey", "label", "helperText", "name", "onChange", "openOnFocus", "renderInput", "renderTags", "selectOnFocus", "variant", "multiple", "max", "autoFocus", "size"]);
|
|
59
59
|
var id = (0, react_2.useRef)((0, nanoid_1.nanoid)());
|
|
60
60
|
var _j = __read((0, react_2.useState)(null), 2), value = _j[0], setValue = _j[1];
|
|
61
61
|
var mainStyles = useStyles();
|
|
@@ -125,7 +125,7 @@ function InputSearchDropdown(props) {
|
|
|
125
125
|
return ((_a = value) === null || _a === void 0 ? void 0 : _a.length) || 0;
|
|
126
126
|
}
|
|
127
127
|
return ((0, react_1.jsx)("div", null,
|
|
128
|
-
(0, react_1.jsx)(material_1.Autocomplete, __assign({ id: id.current, css: (0, react_1.css)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n // TODO: this is due to a bug in MaterialUI clear up when resolve -- should file a PR ticket\n &&& .MuiInputBase-root {\n padding-right: 39px;\n }\n "], ["\n // TODO: this is due to a bug in MaterialUI clear up when resolve -- should file a PR ticket\n &&& .MuiInputBase-root {\n padding-right: 39px;\n }\n "]))), autoHighlight: autoHighlight, clearOnEscape: clearOnEscape, filterOptions: !disableFilter ? filterOptions || handleOptionFilter() : function (options) { return options; }, filterSelectedOptions: filterSelectedOptions, onChange: handleOnChange, openOnFocus: openOnFocus, renderInput: renderInput || renderDefaultInput, renderTags: renderTags || renderDefaultTags, selectOnFocus: selectOnFocus, multiple: multiple, classes: mainStyles, size: size }, restOfProps, { value: getValue() })),
|
|
128
|
+
(0, react_1.jsx)(material_1.Autocomplete, __assign({ id: id.current, css: (0, react_1.css)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n // TODO: this is due to a bug in MaterialUI clear up when resolve -- should file a PR ticket\n &&& .MuiInputBase-root {\n padding-right: 39px;\n }\n "], ["\n // TODO: this is due to a bug in MaterialUI clear up when resolve -- should file a PR ticket\n &&& .MuiInputBase-root {\n padding-right: 39px;\n }\n "]))), autoHighlight: autoHighlight, clearOnEscape: clearOnEscape, filterOptions: !disableFilter ? filterOptions || handleOptionFilter() : function (options) { return options; }, filterSelectedOptions: filterSelectedOptions, onChange: handleOnChange, openOnFocus: openOnFocus, renderInput: renderInput || renderDefaultInput, renderTags: renderTags || renderDefaultTags, selectOnFocus: selectOnFocus, multiple: multiple, classes: mainStyles, size: size }, restOfProps, { value: getValue(), ref: mRef })),
|
|
129
129
|
(0, react_1.jsx)("div", null,
|
|
130
130
|
helperText && ((0, react_1.jsx)(material_1.Typography, { css: (0, react_1.css)(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n float: left;\n margin-left: 14px;\n margin-top: 4px;\n color: ", ";\n width: calc(100% - 82px);\n "], ["\n float: left;\n margin-left: 14px;\n margin-top: 4px;\n color: ", ";\n width: calc(100% - 82px);\n "])), error ? 'red' : 'rgba(0, 0, 0, 0.54)'), variant: "caption" }, helperText)),
|
|
131
131
|
multiple && max && ((0, react_1.jsx)(material_1.Typography, { css: (0, react_1.css)(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n font-size: 0.75rem;\n text-align: right;\n float: right;\n margin-left: 14px;\n margin-right: 14px;\n margin-top: 4px;\n color: ", ";\n width: 40px;\n "], ["\n font-size: 0.75rem;\n text-align: right;\n float: right;\n margin-left: 14px;\n margin-right: 14px;\n margin-top: 4px;\n color: ", ";\n width: 40px;\n "])), error ? 'red' : 'rgba(0, 0, 0, 0.54)'), variant: "subtitle1" },
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { IItemRendererProps } from '@blueprintjs/select';
|
|
3
|
+
import { UniqueKey, InputValueRender } from 'types/Component.types';
|
|
4
|
+
export declare function getFilter<T>(inputValueRenderer: InputValueRender<T>): (query: string, item: T, index?: number | undefined, exactMatch?: boolean | undefined) => boolean;
|
|
5
|
+
export declare function getItemRenderer<T>(uniqueKey: UniqueKey<T>, inputValueRenderer: InputValueRender<T>, isItemSelected?: (item: T) => boolean): (item: T, { handleClick, modifiers, query }: IItemRendererProps) => JSX.Element | null;
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
var react_1 = __importDefault(require("react"));
|
|
7
|
+
var core_1 = require("@blueprintjs/core");
|
|
8
|
+
function escapeRegExpChars(text) {
|
|
9
|
+
return text.replace(/([.*+?^=!:${}()|[\]/\\])/g, '\\$1');
|
|
10
|
+
}
|
|
11
|
+
function highlightText(text, query) {
|
|
12
|
+
var lastIndex = 0;
|
|
13
|
+
var words = query
|
|
14
|
+
.split(/\s+/)
|
|
15
|
+
.filter(function (word) { return word.length > 0; })
|
|
16
|
+
.map(escapeRegExpChars);
|
|
17
|
+
if (words.length === 0) {
|
|
18
|
+
return [text];
|
|
19
|
+
}
|
|
20
|
+
var regexp = new RegExp(words.join('|'), 'gi');
|
|
21
|
+
var tokens = [];
|
|
22
|
+
while (true) {
|
|
23
|
+
var match = regexp.exec(text);
|
|
24
|
+
if (!match) {
|
|
25
|
+
break;
|
|
26
|
+
}
|
|
27
|
+
var length_1 = match[0].length;
|
|
28
|
+
var before = text.slice(lastIndex, regexp.lastIndex - length_1);
|
|
29
|
+
if (before.length > 0) {
|
|
30
|
+
tokens.push(before);
|
|
31
|
+
}
|
|
32
|
+
lastIndex = regexp.lastIndex;
|
|
33
|
+
tokens.push(react_1.default.createElement("strong", { key: lastIndex }, match[0]));
|
|
34
|
+
}
|
|
35
|
+
var rest = text.slice(lastIndex);
|
|
36
|
+
if (rest.length > 0) {
|
|
37
|
+
tokens.push(rest);
|
|
38
|
+
}
|
|
39
|
+
return tokens;
|
|
40
|
+
}
|
|
41
|
+
function getFilter(inputValueRenderer) {
|
|
42
|
+
return function filterItems(query, item, index, exactMatch) {
|
|
43
|
+
return exactMatch
|
|
44
|
+
? inputValueRenderer(item).toLowerCase() === query.toLowerCase()
|
|
45
|
+
: inputValueRenderer(item).toLowerCase().includes(query.toLowerCase());
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
exports.getFilter = getFilter;
|
|
49
|
+
function getItemRenderer(uniqueKey, inputValueRenderer, isItemSelected) {
|
|
50
|
+
return function renderItem(item, _a) {
|
|
51
|
+
var handleClick = _a.handleClick, modifiers = _a.modifiers, query = _a.query;
|
|
52
|
+
if (!modifiers.matchesPredicate) {
|
|
53
|
+
return null;
|
|
54
|
+
}
|
|
55
|
+
var text = inputValueRenderer(item);
|
|
56
|
+
var key = null;
|
|
57
|
+
if (typeof uniqueKey === 'string') {
|
|
58
|
+
// @ts-ignore
|
|
59
|
+
key = item[uniqueKey];
|
|
60
|
+
}
|
|
61
|
+
else if (typeof uniqueKey === 'function') {
|
|
62
|
+
key = uniqueKey(item);
|
|
63
|
+
}
|
|
64
|
+
return (react_1.default.createElement(core_1.MenuItem, { active: modifiers.active, icon: isItemSelected && isItemSelected(item) ? 'tick' : 'blank', disabled: modifiers.disabled, label: undefined, key: key, onClick: handleClick, text: highlightText(text, query) }));
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
exports.getItemRenderer = getItemRenderer;
|