react-restyle-components 0.1.89 → 0.1.91
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/package.json +7 -8
- package/package.json +7 -8
- package/lib/cjs/index.d.ts +0 -2
- package/lib/cjs/index.js +0 -18
- package/lib/cjs/src/App.d.ts +0 -4
- package/lib/cjs/src/App.js +0 -24
- package/lib/cjs/src/__mocks__/styleMock.d.ts +0 -1
- package/lib/cjs/src/__mocks__/styleMock.js +0 -2
- package/lib/cjs/src/core-components/atoms/buttons/button.stories.d.ts +0 -6
- package/lib/cjs/src/core-components/atoms/buttons/button.stories.js +0 -42
- package/lib/cjs/src/core-components/atoms/buttons/buttons.component.d.ts +0 -11
- package/lib/cjs/src/core-components/atoms/buttons/buttons.component.js +0 -15
- package/lib/cjs/src/core-components/atoms/check-box/checkBox.component.d.ts +0 -11
- package/lib/cjs/src/core-components/atoms/check-box/checkBox.component.js +0 -47
- package/lib/cjs/src/core-components/atoms/check-box/checkBox.stories.d.ts +0 -6
- package/lib/cjs/src/core-components/atoms/check-box/checkBox.stories.js +0 -26
- package/lib/cjs/src/core-components/atoms/date-picker/date-picker.component.d.ts +0 -13
- package/lib/cjs/src/core-components/atoms/date-picker/date-picker.component.js +0 -52
- package/lib/cjs/src/core-components/atoms/date-picker/date-picker.stories.d.ts +0 -6
- package/lib/cjs/src/core-components/atoms/date-picker/date-picker.stories.js +0 -24
- package/lib/cjs/src/core-components/atoms/form/form.component.d.ts +0 -102
- package/lib/cjs/src/core-components/atoms/form/form.component.js +0 -192
- package/lib/cjs/src/core-components/atoms/icons/icons.component.d.ts +0 -11
- package/lib/cjs/src/core-components/atoms/icons/icons.component.js +0 -66
- package/lib/cjs/src/core-components/atoms/icons/icons.stories.d.ts +0 -6
- package/lib/cjs/src/core-components/atoms/icons/icons.stories.js +0 -22
- package/lib/cjs/src/core-components/atoms/input/input-otp.component.d.ts +0 -15
- package/lib/cjs/src/core-components/atoms/input/input-otp.component.js +0 -88
- package/lib/cjs/src/core-components/atoms/input/input-pin.component.d.ts +0 -16
- package/lib/cjs/src/core-components/atoms/input/input-pin.component.js +0 -107
- package/lib/cjs/src/core-components/atoms/input/input-pin.stories.d.ts +0 -6
- package/lib/cjs/src/core-components/atoms/input/input-pin.stories.js +0 -23
- package/lib/cjs/src/core-components/atoms/input/input.component.d.ts +0 -19
- package/lib/cjs/src/core-components/atoms/input/input.component.js +0 -45
- package/lib/cjs/src/core-components/atoms/input/input.stories.d.ts +0 -6
- package/lib/cjs/src/core-components/atoms/input/input.stories.js +0 -24
- package/lib/cjs/src/core-components/atoms/input-dropdown/input-dropdown.component.d.ts +0 -11
- package/lib/cjs/src/core-components/atoms/input-dropdown/input-dropdown.component.js +0 -64
- package/lib/cjs/src/core-components/atoms/input-dropdown/input-dropdown.stories.d.ts +0 -6
- package/lib/cjs/src/core-components/atoms/input-dropdown/input-dropdown.stories.js +0 -20
- package/lib/cjs/src/core-components/atoms/loader/loader.component.d.ts +0 -4
- package/lib/cjs/src/core-components/atoms/loader/loader.component.js +0 -61
- package/lib/cjs/src/core-components/atoms/loader/loader.stories.d.ts +0 -6
- package/lib/cjs/src/core-components/atoms/loader/loader.stories.js +0 -16
- package/lib/cjs/src/core-components/atoms/radio/radio.component.d.ts +0 -10
- package/lib/cjs/src/core-components/atoms/radio/radio.component.js +0 -49
- package/lib/cjs/src/core-components/atoms/radio/radio.stories.d.ts +0 -6
- package/lib/cjs/src/core-components/atoms/radio/radio.stories.js +0 -25
- package/lib/cjs/src/core-components/atoms/stepper/stepper.component.d.ts +0 -10
- package/lib/cjs/src/core-components/atoms/stepper/stepper.component.js +0 -42
- package/lib/cjs/src/core-components/atoms/stepper/stepper.stories.d.ts +0 -6
- package/lib/cjs/src/core-components/atoms/stepper/stepper.stories.js +0 -21
- package/lib/cjs/src/core-components/atoms/tabs/tabs.component.d.ts +0 -11
- package/lib/cjs/src/core-components/atoms/tabs/tabs.component.js +0 -46
- package/lib/cjs/src/core-components/atoms/tabs/tabs.stories.d.ts +0 -6
- package/lib/cjs/src/core-components/atoms/tabs/tabs.stories.js +0 -25
- package/lib/cjs/src/core-components/atoms/timer/timer.component.d.ts +0 -7
- package/lib/cjs/src/core-components/atoms/timer/timer.component.js +0 -106
- package/lib/cjs/src/core-components/atoms/tooltip/tooltip.component.d.ts +0 -10
- package/lib/cjs/src/core-components/atoms/tooltip/tooltip.component.js +0 -56
- package/lib/cjs/src/core-components/atoms/tooltip/tooltip.stories.d.ts +0 -6
- package/lib/cjs/src/core-components/atoms/tooltip/tooltip.stories.js +0 -16
- package/lib/cjs/src/core-components/index.d.ts +0 -25
- package/lib/cjs/src/core-components/index.js +0 -54
- package/lib/cjs/src/core-components/molecules/auto-complete-filter-multiple-select-multiple-fields-display/auto-complete-filter-multiple-select-multiple-fields-display.component.d.ts +0 -18
- package/lib/cjs/src/core-components/molecules/auto-complete-filter-multiple-select-multiple-fields-display/auto-complete-filter-multiple-select-multiple-fields-display.component.js +0 -119
- package/lib/cjs/src/core-components/molecules/auto-complete-filter-multiple-select-multiple-fields-display/auto-complete-filter-multiple-select-multiple-fields-display.stories.d.ts +0 -6
- package/lib/cjs/src/core-components/molecules/auto-complete-filter-multiple-select-multiple-fields-display/auto-complete-filter-multiple-select-multiple-fields-display.stories.js +0 -48
- package/lib/cjs/src/core-components/molecules/auto-complete-filter-single-select-multiple-fields-display/auto-complete-filter-single-select-multiple-fields-display.component.d.ts +0 -17
- package/lib/cjs/src/core-components/molecules/auto-complete-filter-single-select-multiple-fields-display/auto-complete-filter-single-select-multiple-fields-display.component.js +0 -120
- package/lib/cjs/src/core-components/molecules/auto-complete-filter-single-select-multiple-fields-display/auto-complete-filter-single-select-multiple-fields-display.stories.d.ts +0 -6
- package/lib/cjs/src/core-components/molecules/auto-complete-filter-single-select-multiple-fields-display/auto-complete-filter-single-select-multiple-fields-display.stories.js +0 -31
- package/lib/cjs/src/core-components/molecules/auto-complete-group-by/auto-complete-group-by.component.d.ts +0 -10
- package/lib/cjs/src/core-components/molecules/auto-complete-group-by/auto-complete-group-by.component.js +0 -166
- package/lib/cjs/src/core-components/molecules/auto-complete-group-by/auto-complete-group-by.component.test.d.ts +0 -1
- package/lib/cjs/src/core-components/molecules/auto-complete-group-by/auto-complete-group-by.component.test.js +0 -14
- package/lib/cjs/src/core-components/molecules/auto-complete-group-by/auto-complete-group-by.stories.d.ts +0 -6
- package/lib/cjs/src/core-components/molecules/auto-complete-group-by/auto-complete-group-by.stories.js +0 -41
- package/lib/cjs/src/core-components/molecules/autocomplete/autocomplete.d.ts +0 -9
- package/lib/cjs/src/core-components/molecules/autocomplete/autocomplete.js +0 -146
- package/lib/cjs/src/core-components/molecules/autocomplete/autocomplete.spec.d.ts +0 -1
- package/lib/cjs/src/core-components/molecules/autocomplete/autocomplete.spec.js +0 -72
- package/lib/cjs/src/core-components/molecules/autocomplete/autocomplete.stories.d.ts +0 -6
- package/lib/cjs/src/core-components/molecules/autocomplete/autocomplete.stories.js +0 -20
- package/lib/cjs/src/core-components/molecules/css-multiline-input/css-multiline-input.component.d.ts +0 -12
- package/lib/cjs/src/core-components/molecules/css-multiline-input/css-multiline-input.component.js +0 -124
- package/lib/cjs/src/core-components/molecules/css-multiline-input/css-multiline-input.stories.d.ts +0 -6
- package/lib/cjs/src/core-components/molecules/css-multiline-input/css-multiline-input.stories.js +0 -16
- package/lib/cjs/src/core-components/molecules/css-multiline-input/css-properties.d.ts +0 -8931
- package/lib/cjs/src/core-components/molecules/css-multiline-input/css-properties.js +0 -164
- package/lib/cjs/src/core-components/molecules/modal-confirm/modal-confirm.component.d.ts +0 -12
- package/lib/cjs/src/core-components/molecules/modal-confirm/modal-confirm.component.js +0 -60
- package/lib/cjs/src/core-components/molecules/modal-confirm/modal-confirm.stories.d.ts +0 -6
- package/lib/cjs/src/core-components/molecules/modal-confirm/modal-confirm.stories.js +0 -23
- package/lib/cjs/src/core-components/molecules/multi-select/multi-select.component.d.ts +0 -9
- package/lib/cjs/src/core-components/molecules/multi-select/multi-select.component.js +0 -78
- package/lib/cjs/src/core-components/molecules/multi-select/multi-select.stories.d.ts +0 -6
- package/lib/cjs/src/core-components/molecules/multi-select/multi-select.stories.js +0 -22
- package/lib/cjs/src/core-components/molecules/multi-select-with-field/multi-select-with-field.component.d.ts +0 -10
- package/lib/cjs/src/core-components/molecules/multi-select-with-field/multi-select-with-field.component.js +0 -88
- package/lib/cjs/src/core-components/molecules/multi-select-with-field/multi-select-with-field.stories.d.ts +0 -6
- package/lib/cjs/src/core-components/molecules/multi-select-with-field/multi-select-with-field.stories.js +0 -23
- package/lib/cjs/src/core-utils/index.d.ts +0 -1
- package/lib/cjs/src/core-utils/index.js +0 -17
- package/lib/cjs/src/core-utils/unit-test.utils.d.ts +0 -4
- package/lib/cjs/src/core-utils/unit-test.utils.js +0 -16
- package/lib/cjs/src/index.d.ts +0 -1
- package/lib/cjs/src/index.js +0 -17
- package/lib/cjs/src/library/assets/svg/index.d.ts +0 -9
- package/lib/cjs/src/library/assets/svg/index.js +0 -40
- package/lib/cjs/src/reportWebVitals.d.ts +0 -3
- package/lib/cjs/src/reportWebVitals.js +0 -37
- package/lib/cjs/src/setupTests.d.ts +0 -1
- package/lib/cjs/src/setupTests.js +0 -7
|
@@ -1,166 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.AutocompleteGroupBy = void 0;
|
|
27
|
-
/* eslint-disable */
|
|
28
|
-
const react_1 = __importStar(require("react"));
|
|
29
|
-
const __1 = require("../..");
|
|
30
|
-
const AutocompleteGroupBy = (props) => {
|
|
31
|
-
//const [userRouter, setUserRouter] = useState<any>()
|
|
32
|
-
const [value, setValue] = (0, react_1.useState)(props.displayValue);
|
|
33
|
-
const [options, setOptions] = (0, react_1.useState)();
|
|
34
|
-
const [isListOpen, setIsListOpen] = (0, react_1.useState)(false);
|
|
35
|
-
const useOutsideAlerter = (ref) => {
|
|
36
|
-
(0, react_1.useEffect)(() => {
|
|
37
|
-
/**
|
|
38
|
-
* Alert if clicked on outside of element
|
|
39
|
-
*/
|
|
40
|
-
function handleClickOutside(event) {
|
|
41
|
-
if (ref.current && !ref.current.contains(event.target) && isListOpen) {
|
|
42
|
-
setIsListOpen(false);
|
|
43
|
-
setValue('');
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
// Bind the event listener
|
|
47
|
-
document.addEventListener('mousedown', handleClickOutside);
|
|
48
|
-
return () => {
|
|
49
|
-
// Unbind the event listener on clean up
|
|
50
|
-
document.removeEventListener('mousedown', handleClickOutside);
|
|
51
|
-
};
|
|
52
|
-
}, [ref, isListOpen]);
|
|
53
|
-
};
|
|
54
|
-
const wrapperRef = (0, react_1.useRef)(null);
|
|
55
|
-
useOutsideAlerter(wrapperRef);
|
|
56
|
-
(0, react_1.useEffect)(() => {
|
|
57
|
-
setValue(props.displayValue);
|
|
58
|
-
}, [props.displayValue]);
|
|
59
|
-
(0, react_1.useEffect)(() => {
|
|
60
|
-
setOptions(props.data || []);
|
|
61
|
-
}, [props]);
|
|
62
|
-
const uniqByKeepFirst = (a, key) => {
|
|
63
|
-
const seen = new Set();
|
|
64
|
-
return a.filter((item) => {
|
|
65
|
-
const k = key(item);
|
|
66
|
-
return seen.has(k) ? false : seen.add(k);
|
|
67
|
-
});
|
|
68
|
-
};
|
|
69
|
-
const filter = (search, data) => {
|
|
70
|
-
if (search !== '') {
|
|
71
|
-
let filterArray = [];
|
|
72
|
-
data.filter((item) => {
|
|
73
|
-
item.children.filter((children) => {
|
|
74
|
-
const childrenItem = children.title &&
|
|
75
|
-
children.title.toLowerCase().indexOf(search.toLowerCase()) > -1;
|
|
76
|
-
if (childrenItem) {
|
|
77
|
-
const isSameArray = filterArray.filter((filterItem, index) => {
|
|
78
|
-
if (filterItem.name === item.name) {
|
|
79
|
-
const newChildren = filterArray[index].children.concat(children);
|
|
80
|
-
filterArray[index] = {
|
|
81
|
-
...filterArray[index],
|
|
82
|
-
children: newChildren,
|
|
83
|
-
};
|
|
84
|
-
}
|
|
85
|
-
});
|
|
86
|
-
if (isSameArray.length < 1) {
|
|
87
|
-
filterArray.push({ ...item, children: [children] });
|
|
88
|
-
}
|
|
89
|
-
const uniqueChars = uniqByKeepFirst(filterArray, (it) => it.name);
|
|
90
|
-
filterArray = uniqueChars;
|
|
91
|
-
}
|
|
92
|
-
});
|
|
93
|
-
});
|
|
94
|
-
setOptions(filterArray);
|
|
95
|
-
}
|
|
96
|
-
else {
|
|
97
|
-
setOptions(data);
|
|
98
|
-
}
|
|
99
|
-
};
|
|
100
|
-
const onChange = (e) => {
|
|
101
|
-
const search = e.target.value;
|
|
102
|
-
setValue(search);
|
|
103
|
-
filter(search, props.data);
|
|
104
|
-
};
|
|
105
|
-
// const onKeyUp = e => {
|
|
106
|
-
// const charCode = e.which ? e.which : e.keyCode;
|
|
107
|
-
// if (charCode === 8) {
|
|
108
|
-
// const search = e.target.value;
|
|
109
|
-
// filter(search, data);
|
|
110
|
-
// }
|
|
111
|
-
// };
|
|
112
|
-
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
113
|
-
react_1.default.createElement("div", { ref: wrapperRef, className: "w-full relative" },
|
|
114
|
-
react_1.default.createElement("div", { className: `flex items-center leading-4 p-2 bg-white focus:outline-none focus:ring w-full shadow-sm sm:text-base border-2 ${props.hasError ? 'border-red ' : 'border-gray-300'} rounded-md` },
|
|
115
|
-
react_1.default.createElement("input", { placeholder: "Search...", value: !isListOpen ? value : value, className: "w-full focus:outline-none",
|
|
116
|
-
// onKeyUp={onKeyUp}
|
|
117
|
-
onChange: onChange, onClick: () => setIsListOpen(true), onKeyDown: (e) => {
|
|
118
|
-
if (e.key === 'Enter') {
|
|
119
|
-
e.preventDefault();
|
|
120
|
-
// Find the selected item and children
|
|
121
|
-
let selectedItem = null;
|
|
122
|
-
let selectedChildren = null;
|
|
123
|
-
for (const item of options) {
|
|
124
|
-
for (const children of item.children) {
|
|
125
|
-
if (children.title.toLowerCase() === value.toLowerCase() ||
|
|
126
|
-
item.title.toLowerCase() === value.toLowerCase()) {
|
|
127
|
-
selectedItem = item;
|
|
128
|
-
selectedChildren = children;
|
|
129
|
-
break;
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
if (selectedItem) {
|
|
133
|
-
break;
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
// Call props.onChange with the selected item and children
|
|
137
|
-
if (props.onChange && selectedItem && selectedChildren) {
|
|
138
|
-
props.onChange(selectedItem, selectedChildren);
|
|
139
|
-
}
|
|
140
|
-
setIsListOpen(false);
|
|
141
|
-
setValue(value); // Set the value to what the user entered
|
|
142
|
-
setOptions([]);
|
|
143
|
-
}
|
|
144
|
-
} }),
|
|
145
|
-
isListOpen ? (react_1.default.createElement(__1.Icon, { nameIcon: "FaChevronUp", propsIcon: {
|
|
146
|
-
color: '#000000',
|
|
147
|
-
size: 22,
|
|
148
|
-
} })) : (react_1.default.createElement(__1.Icon, { nameIcon: "FaChevronDown", propsIcon: {
|
|
149
|
-
color: '#000000',
|
|
150
|
-
size: 22,
|
|
151
|
-
} }))),
|
|
152
|
-
options && isListOpen
|
|
153
|
-
? options?.length > 0 && (react_1.default.createElement("div", { className: "mt-1 absolute z-50 border-gray-500 rounded-md bg-gray-200 w-100" },
|
|
154
|
-
react_1.default.createElement("ul", { className: "p-2 rounded-sm" },
|
|
155
|
-
react_1.default.createElement("div", { className: "", style: { height: 'auto', maxHeight: '350px' } }, options?.map((item, index) => (react_1.default.createElement(react_1.default.Fragment, null,
|
|
156
|
-
react_1.default.createElement("li", { key: index, className: "text-gray-400" }, item.title),
|
|
157
|
-
react_1.default.createElement("ul", { className: "ml-4" }, item?.children?.map((children, childrenIndex) => (react_1.default.createElement("li", { key: childrenIndex, className: "hover:bg-gray-200 focus:outline-none cursor-pointer", onClick: async () => {
|
|
158
|
-
props.onChange &&
|
|
159
|
-
props.onChange(item, children);
|
|
160
|
-
setIsListOpen(false);
|
|
161
|
-
setValue(children.title);
|
|
162
|
-
setOptions([]);
|
|
163
|
-
} }, children.title)))))))))))
|
|
164
|
-
: null)));
|
|
165
|
-
};
|
|
166
|
-
exports.AutocompleteGroupBy = AutocompleteGroupBy;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,14 +0,0 @@
|
|
|
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
|
-
const react_1 = __importDefault(require("react"));
|
|
7
|
-
const react_2 = require("@testing-library/react");
|
|
8
|
-
const auto_complete_group_by_component_1 = require("./auto-complete-group-by.component");
|
|
9
|
-
describe('AutocompleteGroupBy component', () => {
|
|
10
|
-
it('render autocompleteGroupBy correctly', () => {
|
|
11
|
-
const autocompleteGroupBy = (0, react_2.render)(react_1.default.createElement(auto_complete_group_by_component_1.AutocompleteGroupBy, { data: [] }));
|
|
12
|
-
expect(autocompleteGroupBy).toMatchSnapshot();
|
|
13
|
-
});
|
|
14
|
-
});
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
-
import { AutocompleteGroupBy } from './auto-complete-group-by.component';
|
|
3
|
-
declare const meta: Meta<typeof AutocompleteGroupBy>;
|
|
4
|
-
export default meta;
|
|
5
|
-
type Story = StoryObj<typeof AutocompleteGroupBy>;
|
|
6
|
-
export declare const Primary: Story;
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Primary = void 0;
|
|
4
|
-
const auto_complete_group_by_component_1 = require("./auto-complete-group-by.component");
|
|
5
|
-
const meta = {
|
|
6
|
-
title: 'Design System/Molecules/AutocompleteGroupBy',
|
|
7
|
-
component: auto_complete_group_by_component_1.AutocompleteGroupBy,
|
|
8
|
-
tags: ['autodocs'],
|
|
9
|
-
parameters: {
|
|
10
|
-
componentSubtitle: `import { AutocompleteGroupBy } from 'react-restyle-components'`,
|
|
11
|
-
// backgrounds: {
|
|
12
|
-
// default: 'light-gray',
|
|
13
|
-
// },
|
|
14
|
-
},
|
|
15
|
-
};
|
|
16
|
-
exports.default = meta;
|
|
17
|
-
exports.Primary = {
|
|
18
|
-
args: {
|
|
19
|
-
data: [
|
|
20
|
-
{
|
|
21
|
-
title: 'Country',
|
|
22
|
-
code: 'C',
|
|
23
|
-
children: [
|
|
24
|
-
{ title: 'India', code: 'I' },
|
|
25
|
-
{ title: 'United States', code: 'US' },
|
|
26
|
-
],
|
|
27
|
-
},
|
|
28
|
-
{
|
|
29
|
-
title: 'Social Media',
|
|
30
|
-
code: 'C',
|
|
31
|
-
children: [
|
|
32
|
-
{ title: 'Facebook', code: 'F' },
|
|
33
|
-
{ title: 'Instagram', code: 'I' },
|
|
34
|
-
],
|
|
35
|
-
},
|
|
36
|
-
],
|
|
37
|
-
hasError: true,
|
|
38
|
-
onChange: () => { },
|
|
39
|
-
onClose: () => { },
|
|
40
|
-
},
|
|
41
|
-
};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import './autocomplete.css';
|
|
3
|
-
interface AutocompleteProps {
|
|
4
|
-
value: string;
|
|
5
|
-
onValueChange: (value: string) => void;
|
|
6
|
-
options?: string[];
|
|
7
|
-
}
|
|
8
|
-
export declare const Autocomplete: ({ value, onValueChange, options, }: AutocompleteProps) => React.JSX.Element;
|
|
9
|
-
export {};
|
|
@@ -1,146 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.Autocomplete = void 0;
|
|
27
|
-
const react_1 = __importStar(require("react"));
|
|
28
|
-
require("./autocomplete.css");
|
|
29
|
-
const LI_ELEMENT_HEIGHT = 34;
|
|
30
|
-
const Autocomplete = ({ value = '', onValueChange, options = [], }) => {
|
|
31
|
-
const [activeOption, setActiveOption] = (0, react_1.useState)(value === '' || options.indexOf(value) === -1 ? 0 : options.indexOf(value));
|
|
32
|
-
const [filteredOptions, setFilteredOptions] = (0, react_1.useState)(options);
|
|
33
|
-
const [shouldShowList, setShouldShowList] = (0, react_1.useState)(false);
|
|
34
|
-
const [searchValue, setSearchValue] = (0, react_1.useState)(value);
|
|
35
|
-
const inputRef = (0, react_1.useRef)(null);
|
|
36
|
-
const listRef = (0, react_1.useRef)(null);
|
|
37
|
-
const onInputChange = (0, react_1.useCallback)((event) => {
|
|
38
|
-
const input = event.target.value;
|
|
39
|
-
if (input != '') {
|
|
40
|
-
const newFilteredOptions = options.filter((option) => option.toLowerCase().indexOf(input.toLowerCase()) > -1);
|
|
41
|
-
setFilteredOptions(newFilteredOptions);
|
|
42
|
-
}
|
|
43
|
-
else {
|
|
44
|
-
setFilteredOptions(options);
|
|
45
|
-
}
|
|
46
|
-
setActiveOption(0);
|
|
47
|
-
setShouldShowList(true);
|
|
48
|
-
setSearchValue(input);
|
|
49
|
-
}, [
|
|
50
|
-
setActiveOption,
|
|
51
|
-
setFilteredOptions,
|
|
52
|
-
setShouldShowList,
|
|
53
|
-
setSearchValue,
|
|
54
|
-
onValueChange,
|
|
55
|
-
]);
|
|
56
|
-
const onOptionClick = (0, react_1.useCallback)((event) => {
|
|
57
|
-
const symbol = event.currentTarget.innerText || event.currentTarget.textContent || '';
|
|
58
|
-
setShouldShowList(false);
|
|
59
|
-
setActiveOption(0);
|
|
60
|
-
setFilteredOptions([]);
|
|
61
|
-
setSearchValue(symbol);
|
|
62
|
-
onValueChange(symbol);
|
|
63
|
-
}, [
|
|
64
|
-
setShouldShowList,
|
|
65
|
-
setActiveOption,
|
|
66
|
-
setFilteredOptions,
|
|
67
|
-
setSearchValue,
|
|
68
|
-
onValueChange,
|
|
69
|
-
]);
|
|
70
|
-
const onKeyDown = (0, react_1.useCallback)((event) => {
|
|
71
|
-
let selectedItem = '';
|
|
72
|
-
if (event.keyCode === 38) {
|
|
73
|
-
// arrow up
|
|
74
|
-
event.preventDefault();
|
|
75
|
-
if (activeOption === 0) {
|
|
76
|
-
return;
|
|
77
|
-
}
|
|
78
|
-
else {
|
|
79
|
-
selectedItem = options[activeOption - 1];
|
|
80
|
-
setSearchValue(options[activeOption - 1]);
|
|
81
|
-
setActiveOption(activeOption - 1);
|
|
82
|
-
listRef.current?.scroll({
|
|
83
|
-
top: LI_ELEMENT_HEIGHT * (activeOption - 1),
|
|
84
|
-
});
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
else if (event.keyCode === 40) {
|
|
88
|
-
// arrow down
|
|
89
|
-
event.preventDefault();
|
|
90
|
-
if (activeOption === filteredOptions.length - 1) {
|
|
91
|
-
return;
|
|
92
|
-
}
|
|
93
|
-
else {
|
|
94
|
-
selectedItem = options[activeOption + 1];
|
|
95
|
-
setSearchValue(options[activeOption + 1]);
|
|
96
|
-
setActiveOption(activeOption + 1);
|
|
97
|
-
listRef.current?.scroll({
|
|
98
|
-
top: LI_ELEMENT_HEIGHT * (activeOption + 1),
|
|
99
|
-
});
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
if (Object.keys(selectedItem)?.length > 0) {
|
|
103
|
-
onValueChange(selectedItem);
|
|
104
|
-
}
|
|
105
|
-
}, [
|
|
106
|
-
setActiveOption,
|
|
107
|
-
setSearchValue,
|
|
108
|
-
filteredOptions,
|
|
109
|
-
activeOption,
|
|
110
|
-
onValueChange,
|
|
111
|
-
]);
|
|
112
|
-
const renderList = () => {
|
|
113
|
-
if (!options.length) {
|
|
114
|
-
return react_1.default.createElement(react_1.default.Fragment, null);
|
|
115
|
-
}
|
|
116
|
-
if (shouldShowList) {
|
|
117
|
-
if (filteredOptions.length) {
|
|
118
|
-
return (react_1.default.createElement("ul", { role: "list", className: "autocomplete-list", id: "list", ref: listRef }, filteredOptions?.map((option, index) => {
|
|
119
|
-
let className = '';
|
|
120
|
-
if (index === activeOption) {
|
|
121
|
-
className = 'active-option';
|
|
122
|
-
}
|
|
123
|
-
return (react_1.default.createElement("li", { className: className, role: "listitem", key: index, onClick: onOptionClick }, option));
|
|
124
|
-
})));
|
|
125
|
-
}
|
|
126
|
-
else {
|
|
127
|
-
return react_1.default.createElement("div", { className: "no-options" }, "No match");
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
return react_1.default.createElement(react_1.default.Fragment, null);
|
|
131
|
-
};
|
|
132
|
-
(0, react_1.useEffect)(() => {
|
|
133
|
-
// this only works on click when inside timeout
|
|
134
|
-
setTimeout(() => {
|
|
135
|
-
inputRef.current?.select();
|
|
136
|
-
}, 0);
|
|
137
|
-
options[0] && onValueChange(options[0]);
|
|
138
|
-
// setShouldShowList(true);
|
|
139
|
-
}, []);
|
|
140
|
-
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
141
|
-
react_1.default.createElement("input", { type: "text", role: "input", name: "autocomplete-input", onChange: onInputChange, onKeyDown: onKeyDown, value: searchValue, ref: inputRef, onClick: () => {
|
|
142
|
-
setShouldShowList(true);
|
|
143
|
-
} }),
|
|
144
|
-
renderList()));
|
|
145
|
-
};
|
|
146
|
-
exports.Autocomplete = Autocomplete;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import '@testing-library/jest-dom';
|
|
@@ -1,72 +0,0 @@
|
|
|
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
|
-
const react_1 = __importDefault(require("react"));
|
|
7
|
-
const react_2 = require("@testing-library/react");
|
|
8
|
-
require("@testing-library/jest-dom");
|
|
9
|
-
const autocomplete_1 = require("./autocomplete");
|
|
10
|
-
const TEST_OPTIONS = ['ONE', 'TWO', 'THREE', 'FOUR', 'FIVE'];
|
|
11
|
-
test('Render Autocomplete', () => {
|
|
12
|
-
(0, react_2.render)(react_1.default.createElement(autocomplete_1.Autocomplete, { value: "", onValueChange: () => { }, options: TEST_OPTIONS }));
|
|
13
|
-
expect(react_2.screen.getByRole('input')).toBeInTheDocument();
|
|
14
|
-
expect(react_2.screen.getByRole('list')).toBeInTheDocument();
|
|
15
|
-
});
|
|
16
|
-
test('Autocomplete with empty list', () => {
|
|
17
|
-
(0, react_2.render)(react_1.default.createElement(autocomplete_1.Autocomplete, { value: "", onValueChange: () => { }, options: [] }));
|
|
18
|
-
expect(react_2.screen.getByRole('input')).toBeInTheDocument();
|
|
19
|
-
expect(react_2.screen.queryByRole('list')).not.toBeInTheDocument();
|
|
20
|
-
});
|
|
21
|
-
test('Autocomplete list arrow navigation', () => {
|
|
22
|
-
const onValueChange = jest.fn();
|
|
23
|
-
window.HTMLElement.prototype.scroll = function () { };
|
|
24
|
-
(0, react_2.render)(react_1.default.createElement(autocomplete_1.Autocomplete, { value: "", onValueChange: onValueChange, options: TEST_OPTIONS }));
|
|
25
|
-
expect(onValueChange).toHaveBeenCalledWith('ONE');
|
|
26
|
-
react_2.fireEvent.keyDown(react_2.screen.getByRole('input'), { keyCode: 40 }); //down
|
|
27
|
-
expect(onValueChange).toHaveBeenCalledWith('TWO');
|
|
28
|
-
expect(react_2.screen.getByText('TWO')).toHaveClass('active-option');
|
|
29
|
-
expect(react_2.screen.getByText('THREE')).toBeInTheDocument();
|
|
30
|
-
react_2.fireEvent.keyDown(react_2.screen.getByRole('input'), { keyCode: 40 }); //down
|
|
31
|
-
expect(onValueChange).toHaveBeenCalledWith('THREE');
|
|
32
|
-
expect(react_2.screen.getByText('THREE')).toHaveClass('active-option');
|
|
33
|
-
});
|
|
34
|
-
test('Autocomplete list option click', () => {
|
|
35
|
-
const onValueChange = jest.fn();
|
|
36
|
-
(0, react_2.render)(react_1.default.createElement(autocomplete_1.Autocomplete, { value: "", onValueChange: onValueChange, options: TEST_OPTIONS }));
|
|
37
|
-
react_2.fireEvent.click(react_2.screen.getByText('FOUR'));
|
|
38
|
-
expect(react_2.screen.getByRole('input')).toHaveValue('FOUR');
|
|
39
|
-
expect(onValueChange).toHaveBeenCalledWith('FOUR');
|
|
40
|
-
expect(react_2.screen.queryByRole('list')).not.toBeInTheDocument();
|
|
41
|
-
});
|
|
42
|
-
test('Autocomplete search', () => {
|
|
43
|
-
const onValueChange = jest.fn();
|
|
44
|
-
(0, react_2.render)(react_1.default.createElement(autocomplete_1.Autocomplete, { value: "", onValueChange: onValueChange, options: TEST_OPTIONS }));
|
|
45
|
-
react_2.fireEvent.change(react_2.screen.getByRole('input'), { target: { value: 'f' } });
|
|
46
|
-
for (let option of TEST_OPTIONS) {
|
|
47
|
-
if (option.toLowerCase().indexOf('f') > -1) {
|
|
48
|
-
expect(react_2.screen.getAllByRole('listitem')).toHaveLength(2);
|
|
49
|
-
expect(react_2.screen.queryByText(option)).toBeInTheDocument();
|
|
50
|
-
}
|
|
51
|
-
else {
|
|
52
|
-
expect(react_2.screen.queryByText(option)).not.toBeInTheDocument();
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
});
|
|
56
|
-
test('Autocomplete search default value', () => {
|
|
57
|
-
const onValueChange = jest.fn();
|
|
58
|
-
(0, react_2.render)(react_1.default.createElement(autocomplete_1.Autocomplete, { value: "TWO", onValueChange: onValueChange, options: TEST_OPTIONS }));
|
|
59
|
-
expect(react_2.screen.getByText('TWO')).toHaveClass('active-option');
|
|
60
|
-
});
|
|
61
|
-
test('Autocomplete search no result', () => {
|
|
62
|
-
const onValueChange = jest.fn();
|
|
63
|
-
(0, react_2.render)(react_1.default.createElement(autocomplete_1.Autocomplete, { value: "", onValueChange: onValueChange, options: TEST_OPTIONS }));
|
|
64
|
-
react_2.fireEvent.change(react_2.screen.getByRole('input'), { target: { value: 'hello' } });
|
|
65
|
-
expect(react_2.screen.queryByRole('list')).not.toBeInTheDocument();
|
|
66
|
-
expect(react_2.screen.getByText('No match')).toBeInTheDocument();
|
|
67
|
-
});
|
|
68
|
-
test('Autocomplete with value not in list', () => {
|
|
69
|
-
(0, react_2.render)(react_1.default.createElement(autocomplete_1.Autocomplete, { value: "xxx", onValueChange: () => { }, options: TEST_OPTIONS }));
|
|
70
|
-
expect(react_2.screen.getByRole('input')).toBeInTheDocument();
|
|
71
|
-
expect(react_2.screen.getByText('ONE')).toHaveClass('active-option');
|
|
72
|
-
});
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Primary = void 0;
|
|
4
|
-
const autocomplete_1 = require("./autocomplete");
|
|
5
|
-
const meta = {
|
|
6
|
-
title: 'Design System/Molecules/Autocomplete',
|
|
7
|
-
component: autocomplete_1.Autocomplete,
|
|
8
|
-
tags: ['autodocs'],
|
|
9
|
-
parameters: {
|
|
10
|
-
componentSubtitle: `import { Autocomplete } from 'react-restyle-components'`,
|
|
11
|
-
},
|
|
12
|
-
};
|
|
13
|
-
exports.default = meta;
|
|
14
|
-
exports.Primary = {
|
|
15
|
-
args: {
|
|
16
|
-
value: '',
|
|
17
|
-
onValueChange: () => { },
|
|
18
|
-
options: ['One', 'Two', 'Three', 'Four'],
|
|
19
|
-
},
|
|
20
|
-
};
|
package/lib/cjs/src/core-components/molecules/css-multiline-input/css-multiline-input.component.d.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import '../../../tc.css';
|
|
3
|
-
interface CSSMultilineProps {
|
|
4
|
-
label?: string;
|
|
5
|
-
defaultValue?: string;
|
|
6
|
-
placeholder?: string;
|
|
7
|
-
className?: string;
|
|
8
|
-
style?: any;
|
|
9
|
-
onChange(item: any): void;
|
|
10
|
-
}
|
|
11
|
-
export declare const CSSMultiline: ({ label, defaultValue, className, style, placeholder, onChange, }: CSSMultilineProps) => React.JSX.Element;
|
|
12
|
-
export {};
|
package/lib/cjs/src/core-components/molecules/css-multiline-input/css-multiline-input.component.js
DELETED
|
@@ -1,124 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.CSSMultiline = void 0;
|
|
27
|
-
const react_1 = __importStar(require("react"));
|
|
28
|
-
const __1 = require("../..");
|
|
29
|
-
const css_properties_1 = require("./css-properties");
|
|
30
|
-
require("../../../tc.css");
|
|
31
|
-
const mapToArray = (arr) => {
|
|
32
|
-
const res = [];
|
|
33
|
-
arr.forEach(function (obj, index) {
|
|
34
|
-
const key = Object.keys(obj)[0];
|
|
35
|
-
const value = key;
|
|
36
|
-
res.push([value, obj[key]]);
|
|
37
|
-
});
|
|
38
|
-
return res;
|
|
39
|
-
};
|
|
40
|
-
const data = mapToArray(css_properties_1.properties);
|
|
41
|
-
const CSSMultiline = ({ label = 'Main Box CSS', defaultValue = '', className = '', style = {}, placeholder = "Like fontSize: 12,backgroundColor:'#000000',", onChange, }) => {
|
|
42
|
-
const value = (0, react_1.useRef)('');
|
|
43
|
-
const [properties, setProperties] = (0, react_1.useState)([]);
|
|
44
|
-
const [isListOpen, setIsListOpen] = (0, react_1.useState)(false);
|
|
45
|
-
(0, react_1.useEffect)(() => {
|
|
46
|
-
value.current = defaultValue;
|
|
47
|
-
setProperties(data);
|
|
48
|
-
}, [defaultValue]);
|
|
49
|
-
const useOutsideAlerter = (ref) => {
|
|
50
|
-
(0, react_1.useEffect)(() => {
|
|
51
|
-
function handleClickOutside(event) {
|
|
52
|
-
if (ref.current && !ref.current.contains(event.target)) {
|
|
53
|
-
setIsListOpen(false);
|
|
54
|
-
onChange(value.current);
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
document.addEventListener('mousedown', handleClickOutside);
|
|
58
|
-
return () => {
|
|
59
|
-
document.removeEventListener('mousedown', handleClickOutside);
|
|
60
|
-
};
|
|
61
|
-
}, [ref]);
|
|
62
|
-
};
|
|
63
|
-
const wrapperRef = (0, react_1.useRef)(null);
|
|
64
|
-
useOutsideAlerter(wrapperRef);
|
|
65
|
-
const list = [];
|
|
66
|
-
const filter = (css) => {
|
|
67
|
-
let matchString = css?.split(',');
|
|
68
|
-
matchString = matchString[matchString?.length - 1];
|
|
69
|
-
matchString = matchString?.split(':')[0];
|
|
70
|
-
matchString = matchString?.split("'")[0];
|
|
71
|
-
if (css?.length == 0)
|
|
72
|
-
return setProperties(data);
|
|
73
|
-
else {
|
|
74
|
-
data?.map((item) => {
|
|
75
|
-
const innerItem = [];
|
|
76
|
-
const isItems = item[0]?.startsWith(matchString);
|
|
77
|
-
if (isItems)
|
|
78
|
-
innerItem.push(item[0]);
|
|
79
|
-
if (innerItem?.length > 0)
|
|
80
|
-
list.push([item[0], item[1]]);
|
|
81
|
-
});
|
|
82
|
-
setProperties(list);
|
|
83
|
-
}
|
|
84
|
-
};
|
|
85
|
-
const onKeyUp = (e) => {
|
|
86
|
-
setIsListOpen(true);
|
|
87
|
-
};
|
|
88
|
-
return (react_1.default.createElement("div", { className: "flex flex-col w-full", ref: wrapperRef },
|
|
89
|
-
react_1.default.createElement(__1.Form.MultilineInput, { label: label, style: { color: '#ffffff', backgroundColor: '#000000', ...style }, placeholder: placeholder, value: value.current, className: className, onKeyUp: onKeyUp, onChange: (css) => {
|
|
90
|
-
value.current = css;
|
|
91
|
-
filter(css);
|
|
92
|
-
} }),
|
|
93
|
-
isListOpen && (react_1.default.createElement("div", { style: { marginTop: -10 } },
|
|
94
|
-
react_1.default.createElement("ul", { className: "flex flex-col max-h-40 bg-black m-2 text-white overflow-y-scroll " }, properties?.map((item, index) => (react_1.default.createElement("li", { key: index, className: "flex flex-col gap-4 p-2" },
|
|
95
|
-
react_1.default.createElement("span", { className: "underline" }, item[0]),
|
|
96
|
-
item[1]?.map((prop) => (react_1.default.createElement("li", { className: "flex -mt-2 px-2 h-8 bg-slate-800 rounded-md items-center cursor-pointer", onClick: () => {
|
|
97
|
-
let existsString = value.current?.split(',');
|
|
98
|
-
if (value.current.includes(',')) {
|
|
99
|
-
existsString = existsString.map((item) => {
|
|
100
|
-
if (item?.includes(':'))
|
|
101
|
-
return item;
|
|
102
|
-
});
|
|
103
|
-
if (prop != 'number')
|
|
104
|
-
existsString.push(`${item[0]}:'${prop}',`);
|
|
105
|
-
else
|
|
106
|
-
existsString.push(`${item[0]}:1,`);
|
|
107
|
-
value.current = existsString
|
|
108
|
-
.join(',')
|
|
109
|
-
.replaceAll(',,', ',');
|
|
110
|
-
}
|
|
111
|
-
else {
|
|
112
|
-
if (prop != 'number')
|
|
113
|
-
value.current = `${item[0]}:'${prop}',`;
|
|
114
|
-
else {
|
|
115
|
-
value.current = `${item[0]}:1,`;
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
filter(existsString.join(''));
|
|
119
|
-
} },
|
|
120
|
-
' ',
|
|
121
|
-
prop,
|
|
122
|
-
' ')))))))))));
|
|
123
|
-
};
|
|
124
|
-
exports.CSSMultiline = CSSMultiline;
|
package/lib/cjs/src/core-components/molecules/css-multiline-input/css-multiline-input.stories.d.ts
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
-
import { CSSMultiline } from './css-multiline-input.component';
|
|
3
|
-
declare const meta: Meta<typeof CSSMultiline>;
|
|
4
|
-
export default meta;
|
|
5
|
-
type Story = StoryObj<typeof CSSMultiline>;
|
|
6
|
-
export declare const Primary: Story;
|
package/lib/cjs/src/core-components/molecules/css-multiline-input/css-multiline-input.stories.js
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Primary = void 0;
|
|
4
|
-
const css_multiline_input_component_1 = require("./css-multiline-input.component");
|
|
5
|
-
const meta = {
|
|
6
|
-
title: 'Design System/Molecules/CSSMultiline',
|
|
7
|
-
component: css_multiline_input_component_1.CSSMultiline,
|
|
8
|
-
tags: ['autodocs'],
|
|
9
|
-
parameters: {
|
|
10
|
-
componentSubtitle: `import { CSSMultiline } from 'react-restyle-components'`,
|
|
11
|
-
},
|
|
12
|
-
};
|
|
13
|
-
exports.default = meta;
|
|
14
|
-
exports.Primary = {
|
|
15
|
-
args: {},
|
|
16
|
-
};
|