intelicoreact 1.4.9 → 1.4.11

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.
@@ -4,9 +4,12 @@
4
4
  position: relative;
5
5
 
6
6
  display: flex;
7
- flex-direction: column;
7
+ flex-wrap: nowrap;
8
+ flex-direction: row;
8
9
 
9
10
  width: 100%;
11
+ max-width: 500px;
12
+
10
13
 
11
14
  &__container {
12
15
  position: fixed;
@@ -35,12 +38,33 @@
35
38
  height: fit-content;
36
39
  min-height: 28px;
37
40
  padding: 1px 24px 1px 5px;
41
+ width: 100%;
38
42
 
39
43
  cursor: pointer;
40
44
 
41
45
  border: 1px solid #e2e5ec;
42
46
  border-radius: 3px;
43
47
  background: #fff;
48
+
49
+ &--with-actions {
50
+ border-top-right-radius: 0;
51
+ border-bottom-right-radius: 0;
52
+ }
53
+
54
+ .input__wrap {
55
+ border: none;
56
+
57
+ &_focus {
58
+ border: none;
59
+ filter: none;
60
+ }
61
+ }
62
+ }
63
+
64
+ &--focused &__trigger {
65
+
66
+ border-color: #6b81dd;
67
+ filter: drop-shadow(0 0 4px rgb(93 120 255 / 50%));
44
68
  }
45
69
 
46
70
  &__input {
@@ -48,12 +72,31 @@
48
72
  flex-grow: 1;
49
73
 
50
74
  height: 16px;
75
+ padding: 0;
51
76
  padding-right: 2px;
52
77
 
53
78
  text-overflow: ellipsis;
54
79
 
55
- border: none;
56
- background: none;
80
+ &:not(.tags-dropdown__input--in-list) {
81
+ border: none;
82
+ background: none;
83
+ }
84
+
85
+ &-list-wrapper {
86
+ padding: 8px 8px 4px;
87
+ }
88
+
89
+ &--in-list {
90
+ width: 100%;
91
+ box-sizing: border-box;
92
+ padding: 4px 8px;
93
+ height: 28px;
94
+
95
+ &:focus {
96
+ border-color: #6b81dd;
97
+ box-shadow: 0px 0px 4px 0px rgba(93, 120, 255, 0.50);
98
+ }
99
+ }
57
100
  }
58
101
 
59
102
  &__header,
@@ -79,6 +122,49 @@
79
122
  border-bottom: 1px solid #e8e9ec;
80
123
  }
81
124
 
125
+ &__creatable-helper {
126
+ color: var(--Text-Title, #9AA0B9);
127
+ font-family: Roboto;
128
+ font-size: 11px;
129
+ font-style: normal;
130
+ font-weight: 400;
131
+ line-height: 20px;
132
+ display: flex;
133
+ padding: 2px 4px;
134
+ align-items: center;
135
+ align-self: stretch;
136
+ }
137
+
138
+ &__create-option {
139
+ display: flex;
140
+ height: 24px;
141
+ padding: 2px 4px;
142
+ align-items: center;
143
+ gap: 3px;
144
+ align-self: stretch;
145
+ background: var(--Background-Form-Main, #F7FAFC);
146
+ color: var(--Text-Main, #1E1E2D);
147
+ font-family: Roboto;
148
+ font-size: 11px;
149
+ font-style: normal;
150
+ font-weight: 400;
151
+ line-height: 20px;
152
+ cursor: pointer;
153
+ }
154
+
155
+ &__no-options {
156
+ color: var(--Text-Title, #9AA0B9);
157
+ font-family: Roboto;
158
+ font-size: 14px;
159
+ font-style: normal;
160
+ font-weight: 400;
161
+ line-height: 20px;
162
+ display: flex;
163
+ padding: 2px 4px;
164
+ align-items: center;
165
+ align-self: stretch;
166
+ }
167
+
82
168
  &__selector-wrapper {
83
169
  position: relative;
84
170
 
@@ -92,6 +178,7 @@
92
178
  box-shadow: 0 4px 25px rgb(0 0 0 / 25%);
93
179
  max-height: 320px;
94
180
  }
181
+
95
182
 
96
183
  &__list {
97
184
  height: 100%;
@@ -102,7 +189,8 @@
102
189
 
103
190
  box-sizing: border-box;
104
191
  min-width: 100%;
105
- padding: 8px 0;
192
+ // padding: 8px 0;
193
+ padding: 2px 0;
106
194
 
107
195
  text-align: left;
108
196
 
@@ -129,12 +217,14 @@
129
217
  position: relative;
130
218
 
131
219
  display: flex;
132
- justify-content: flex-start;
220
+ justify-content: space-between;
133
221
  align-items: center;
134
222
 
135
223
  width: 100%;
224
+ min-width: 100%;
136
225
  min-height: 24px;
137
226
  padding-left: 35px;
227
+ padding-right: 4px;
138
228
 
139
229
  font-size: 13px;
140
230
  font-weight: 400;
@@ -144,8 +234,9 @@
144
234
  color: $color--dark;
145
235
 
146
236
  &:hover,
147
- &_active {
148
- background: $color--gray--gentle;
237
+ &_active,
238
+ &--editing {
239
+ background: #F7FAFC;//$color--gray--gentle;
149
240
  }
150
241
 
151
242
  &_disabled {
@@ -172,6 +263,35 @@
172
263
  color: #757f8c;
173
264
  }
174
265
 
266
+ &-edit-trigger {
267
+ display: inline-flex;
268
+ padding: 2px;
269
+ align-items: flex-start;
270
+ gap: 4px;
271
+
272
+ &:hover {
273
+ background-color: #EBEFF2;
274
+
275
+ svg {
276
+ color: #1E1E2D;
277
+ }
278
+ }
279
+
280
+ svg {
281
+ width: 16px;
282
+ height: 16px;
283
+ color: #9AA0B9;
284
+ }
285
+ }
286
+
287
+ &--editing &-edit-trigger {
288
+ background-color: #EBEFF2;
289
+
290
+ svg {
291
+ color: #1E1E2D;
292
+ }
293
+ }
294
+
175
295
  pre.inherit-styles {
176
296
  font: inherit!important;
177
297
  margin: 0;
@@ -196,6 +316,135 @@
196
316
  }
197
317
  }
198
318
 
319
+ &__actions {
320
+ display: flex;
321
+ align-items: center;
322
+ justify-content: center;
323
+ border: 1px solid var(--Border-Input, #E2E5EC);
324
+ border-left: none;
325
+ border-radius: 0px 2px 2px 0px;
326
+ overflow: hidden;
327
+
328
+ &-item {
329
+ height: 100%;
330
+ display: flex;
331
+ padding: 4px;
332
+ min-width: 24px;
333
+ justify-content: center;
334
+ align-items: center;
335
+ gap: 4px;
336
+ align-self: stretch;
337
+ background: var(--Background-Light-action, #F4F6FF);
338
+ box-sizing: border-box;
339
+ cursor: pointer;
340
+ border-right: 1px solid var(--Border-Input, #E2E5EC);
341
+
342
+ &:last-child {
343
+ border: none;
344
+ }
345
+ }
346
+
347
+ svg {
348
+ width: 16px;
349
+ height: 16px;
350
+ color: #1E1E2D;
351
+ }
352
+ }
353
+
354
+ &__edit-option-modal {
355
+ position: absolute;
356
+ display: flex;
357
+ width: 182px;
358
+ flex-direction: column;
359
+ align-items: flex-start;
360
+ gap: 4px;
361
+ border-radius: 4px;
362
+ background: var(--White, #FFF);
363
+ box-shadow: 0px 4px 25px 0px rgba(0, 0, 0, 0.25);
364
+ z-index: 3;
365
+
366
+ &-section {
367
+ display: flex;
368
+ flex-direction: column;
369
+ padding: 8px;
370
+ align-items: flex-start;
371
+ gap: 8px;
372
+ align-self: stretch;
373
+
374
+ button {
375
+ display: flex;
376
+ gap: 4px;
377
+ padding: 0;
378
+ height: auto;
379
+ box-sizing: border-box;
380
+ align-items: center;
381
+ color: var(--Text-Main, #1E1E2D);
382
+
383
+ .button__text {
384
+ margin: 0;
385
+ width: auto;
386
+ font-family: Roboto;
387
+ font-size: 13px;
388
+ font-style: normal;
389
+ font-weight: 400;
390
+ line-height: 20px;
391
+ }
392
+
393
+ svg {
394
+ display: block;
395
+ width: 16px;
396
+ height: 16px;
397
+ }
398
+ }
399
+
400
+ h3 {
401
+ color: var(--Text-Title, #9AA0B9);
402
+ font-family: Roboto;
403
+ font-size: 10px;
404
+ font-style: normal;
405
+ font-weight: 400;
406
+ line-height: 20px;
407
+ text-transform: uppercase;
408
+ margin: 0;
409
+ }
410
+
411
+ &-divider {
412
+ width: 100%;
413
+ height: 1px;
414
+ background: #E2E5EC;
415
+ }
416
+
417
+ &-colors {
418
+ display: flex;
419
+ gap: 8px;
420
+ flex-wrap: wrap;
421
+
422
+ .color-block {
423
+ display: flex;
424
+ width: 20px;
425
+ height: 20px;
426
+ padding: 2px;
427
+ align-items: flex-start;
428
+ gap: 4px;
429
+ border-radius: 3px;
430
+ box-sizing: border-box;
431
+ border: 1px solid rgba(0, 0, 0, 0.15);
432
+ cursor: pointer;
433
+
434
+ svg {
435
+ display: flex;
436
+ width: 16px;
437
+ height: 16px;
438
+ justify-content: center;
439
+ align-items: center;
440
+ flex-shrink: 0;
441
+ color: #1E1E2D;
442
+ }
443
+ }
444
+ }
445
+ }
446
+ }
447
+
199
448
  &__active-icon {
200
449
  position: absolute;
201
450
  top: 0;
@@ -16,11 +16,11 @@ const Tag = _ref => {
16
16
  let {
17
17
  value,
18
18
  className,
19
+ style,
19
20
  label,
20
21
  warning,
21
22
  removeItem,
22
23
  name,
23
- color,
24
24
  isPopup,
25
25
  popupInfo,
26
26
  popupInfoContent,
@@ -70,9 +70,7 @@ const Tag = _ref => {
70
70
  className: (0, _classnames.default)("tag", className, {
71
71
  "tag-warn": warning
72
72
  }),
73
- style: {
74
- background: color
75
- },
73
+ style: style !== null && style !== void 0 ? style : {},
76
74
  onClick: () => handle.onTagClick()
77
75
  }, warning && typeof warning === "string" && /*#__PURE__*/_react.default.createElement(_reactFeather.AlertTriangle, {
78
76
  className: "advanced-tags--warning-icon mr5"
@@ -7,7 +7,8 @@ Object.defineProperty(exports, "__esModule", {
7
7
  exports.default = void 0;
8
8
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
9
9
  var _react = _interopRequireWildcard(require("react"));
10
- var _utils = require("lib/src/Functions/utils");
10
+ var _reactFeather = require("react-feather");
11
+ var _utils = require("../../../Functions/utils");
11
12
  var _Tag = _interopRequireDefault(require("../Tag/Tag"));
12
13
  require("./TagList.scss");
13
14
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
@@ -22,6 +23,9 @@ const TagList = _ref => {
22
23
  disableShowMore = false,
23
24
  shownItemsCount = "auto",
24
25
  testId = "test-taglist",
26
+ refProp,
27
+ onEditClick,
28
+ onToggleRenderAll,
25
29
  isPopup,
26
30
  popupInfo,
27
31
  popupInfoContent
@@ -32,6 +36,10 @@ const TagList = _ref => {
32
36
  const [staticTagsCount, setStaticTagsCount] = (0, _react.useState)(-1);
33
37
  const [renderItemsCount, setRenderItemsCount] = (0, _react.useState)(-1);
34
38
  const [renderAll, setRenderAll] = (0, _react.useState)(!withToggle);
39
+ const setRenderAllInterceptor = v => {
40
+ setRenderAll(v);
41
+ onToggleRenderAll === null || onToggleRenderAll === void 0 || onToggleRenderAll(v);
42
+ };
35
43
  const [lastCheckTime, setLastCheckTime] = (0, _react.useState)(-1);
36
44
  const isTagsRefSet = () => {
37
45
  if (!tagList.length) return false;
@@ -79,6 +87,42 @@ const TagList = _ref => {
79
87
  e === null || e === void 0 || e.stopPropagation();
80
88
  cb(e);
81
89
  };
90
+ const renderTags = () => {
91
+ return tagList.map((item, i) => ({
92
+ ...item,
93
+ isHidden: renderItemsCount !== -1 ? i >= renderItemsCount : false
94
+ })).map(item => /*#__PURE__*/_react.default.createElement("div", {
95
+ className: "tag-list_wrapper_item ".concat(item.isHidden ? "tag-list_wrapper_item--hidden" : ""),
96
+ key: "tag-list-item-".concat(item.id),
97
+ ref: (0, _utils.checkedRef)(item === null || item === void 0 ? void 0 : item.itemRef)
98
+ }, /*#__PURE__*/_react.default.createElement(_Tag.default, (0, _extends2.default)({
99
+ testId: "test-taglist-item-".concat(item.id)
100
+ }, item, {
101
+ onClick: onTagClick,
102
+ removeItem: removeItem,
103
+ isPopup: isPopup,
104
+ popupInfo: popupInfo,
105
+ popupInfoContent: popupInfoContent
106
+ }))));
107
+ };
108
+ const renderMoreTags = () => {
109
+ if ((tagList === null || tagList === void 0 ? void 0 : tagList.length) < shownItemsCount || !(tagList !== null && tagList !== void 0 && tagList.length) || disableShowMore) return null;
110
+ const restItems = tagList.length - renderItemsCount;
111
+ if (restItems === 0 || !withToggle || staticTagsCount === -1) return null;
112
+ return /*#__PURE__*/_react.default.createElement(_Tag.default, {
113
+ label: "+".concat(restItems),
114
+ className: "tag-list_wrapper_render-more",
115
+ onClick: disableShowMore ? () => {} : e => cancelDefault(e, () => setRenderAllInterceptor(true))
116
+ });
117
+ };
118
+ const renderHideTags = () => {
119
+ if (renderItemsCount !== (tagList === null || tagList === void 0 ? void 0 : tagList.length) || !withToggle || staticTagsCount === -1 || staticTagsCount === (tagList === null || tagList === void 0 ? void 0 : tagList.length)) return null;
120
+ return /*#__PURE__*/_react.default.createElement(_Tag.default, {
121
+ label: "...",
122
+ className: "tag-list_wrapper_hide-more",
123
+ onClick: e => cancelDefault(e, () => setRenderAllInterceptor(false))
124
+ });
125
+ };
82
126
 
83
127
  // Set TagList Wrapper Width
84
128
  (0, _react.useLayoutEffect)(() => {
@@ -92,7 +136,7 @@ const TagList = _ref => {
92
136
  (0, _react.useEffect)(() => {
93
137
  setStaticTagsCount(-1);
94
138
  setRenderItemsCount(-1);
95
- setRenderAll(false);
139
+ setRenderAllInterceptor(false);
96
140
  setTagList(items.map(item => ({
97
141
  ...item,
98
142
  itemRef: /*#__PURE__*/(0, _react.createRef)()
@@ -119,45 +163,17 @@ const TagList = _ref => {
119
163
  (0, _react.useEffect)(() => {
120
164
  setRenderItemsCount(renderAll ? tagList === null || tagList === void 0 ? void 0 : tagList.length : staticTagsCount);
121
165
  }, [renderAll]);
122
- const renderTags = () => {
123
- return tagList.map((item, i) => ({
124
- ...item,
125
- isHidden: renderItemsCount !== -1 ? i >= renderItemsCount : false
126
- })).map(item => /*#__PURE__*/_react.default.createElement("div", {
127
- className: "tag-list_wrapper_item ".concat(item.isHidden ? "tag-list_wrapper_item--hidden" : ""),
128
- key: "tag-list-item-".concat(item.id),
129
- ref: (0, _utils.checkedRef)(item === null || item === void 0 ? void 0 : item.itemRef)
130
- }, /*#__PURE__*/_react.default.createElement(_Tag.default, (0, _extends2.default)({
131
- testId: "test-taglist-item-".concat(item.id)
132
- }, item, {
133
- onClick: onTagClick,
134
- removeItem: removeItem,
135
- isPopup: isPopup,
136
- popupInfo: popupInfo,
137
- popupInfoContent: popupInfoContent
138
- }))));
139
- };
140
- const renderMoreTags = () => {
141
- if ((tagList === null || tagList === void 0 ? void 0 : tagList.length) < shownItemsCount || !(tagList !== null && tagList !== void 0 && tagList.length) || disableShowMore) return null;
142
- const restItems = tagList.length - renderItemsCount;
143
- if (restItems === 0 || !withToggle || staticTagsCount === -1) return null;
144
- return /*#__PURE__*/_react.default.createElement(_Tag.default, {
145
- label: "+".concat(restItems),
146
- className: "tag-list_wrapper_render-more",
147
- onClick: disableShowMore ? () => {} : e => cancelDefault(e, () => setRenderAll(true))
148
- });
149
- };
150
- const renderHideTags = () => {
151
- if (renderItemsCount !== (tagList === null || tagList === void 0 ? void 0 : tagList.length) || !withToggle || staticTagsCount === -1 || staticTagsCount === (tagList === null || tagList === void 0 ? void 0 : tagList.length)) return null;
152
- return /*#__PURE__*/_react.default.createElement(_Tag.default, {
153
- label: "...",
154
- className: "tag-list_wrapper_hide-more",
155
- onClick: e => cancelDefault(e, () => setRenderAll(false))
156
- });
157
- };
166
+ (0, _react.useEffect)(() => {
167
+ // eslint-disable-next-line react-hooks/exhaustive-deps
168
+ if (wrapperRef !== null && wrapperRef !== void 0 && wrapperRef.current) refProp.current = wrapperRef === null || wrapperRef === void 0 ? void 0 : wrapperRef.current;
169
+ }, [wrapperRef === null || wrapperRef === void 0 ? void 0 : wrapperRef.current]);
158
170
  return /*#__PURE__*/_react.default.createElement("div", {
159
171
  className: "tag-list_wrapper ".concat(renderItemsCount !== (tagList === null || tagList === void 0 ? void 0 : tagList.length) || !withToggle || staticTagsCount === -1 || staticTagsCount === (tagList === null || tagList === void 0 ? void 0 : tagList.length) ? "tag-list_wrapper--only-static-items" : "tag-list_wrapper--all-items", " ").concat(className !== null && className !== void 0 ? className : ""),
160
172
  ref: wrapperRef
161
- }, renderTags(), renderMoreTags(), renderHideTags());
173
+ }, renderTags(), renderMoreTags(), renderHideTags(), typeof onEditClick === "function" && /*#__PURE__*/_react.default.createElement("div", {
174
+ className: "tag-list__edit-trigger"
175
+ }, /*#__PURE__*/_react.default.createElement(_reactFeather.Edit3, {
176
+ onClick: onEditClick
177
+ })));
162
178
  };
163
179
  var _default = exports.default = TagList;
@@ -33,3 +33,18 @@
33
33
  margin: 2px;
34
34
  }
35
35
  }
36
+
37
+ .tag-list__edit-trigger {
38
+ display: flex;
39
+ align-items: center;
40
+ align-self: stretch;
41
+ padding: 2px;
42
+ box-sizing: border-box;
43
+ cursor: pointer;
44
+
45
+ svg {
46
+ width: 16px;
47
+ height: 16px;
48
+ color: #6B81DD;
49
+ }
50
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "intelicoreact",
3
- "version": "1.4.9",
3
+ "version": "1.4.11",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "files": [