@teselagen/ui 0.4.7 → 0.4.8
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/index.cjs.js +243 -258
- package/index.es.js +243 -258
- package/package.json +1 -1
- package/src/TgSelect/index.js +37 -4
- package/src/TgSelect/style.css +20 -0
- package/src/style.css +12 -4
- package/style.css +33 -4
package/package.json
CHANGED
package/src/TgSelect/index.js
CHANGED
|
@@ -223,8 +223,9 @@ class TgSelect extends React.Component {
|
|
|
223
223
|
};
|
|
224
224
|
|
|
225
225
|
render() {
|
|
226
|
-
|
|
226
|
+
let {
|
|
227
227
|
multi,
|
|
228
|
+
asTag,
|
|
228
229
|
options,
|
|
229
230
|
unfilteredOptions,
|
|
230
231
|
value,
|
|
@@ -237,6 +238,10 @@ class TgSelect extends React.Component {
|
|
|
237
238
|
noResultsText,
|
|
238
239
|
noResults: _noResults,
|
|
239
240
|
inputProps,
|
|
241
|
+
backgroundColor,
|
|
242
|
+
doNotFillWidth,
|
|
243
|
+
noToggle,
|
|
244
|
+
small,
|
|
240
245
|
placeholder,
|
|
241
246
|
isLoading,
|
|
242
247
|
disallowClear,
|
|
@@ -248,6 +253,14 @@ class TgSelect extends React.Component {
|
|
|
248
253
|
renderCreateNewOption: _renderCreateNewOption = renderCreateNewOption,
|
|
249
254
|
...rest
|
|
250
255
|
} = this.props;
|
|
256
|
+
if (asTag) {
|
|
257
|
+
small = true;
|
|
258
|
+
placeholder = " ";
|
|
259
|
+
backgroundColor = "red";
|
|
260
|
+
disallowClear = true;
|
|
261
|
+
doNotFillWidth = true;
|
|
262
|
+
noToggle = true;
|
|
263
|
+
}
|
|
251
264
|
let noResults = _noResults;
|
|
252
265
|
|
|
253
266
|
// Null is also a valid value for a React Component, noResultsDefault should only be appplied when noResults is undefined
|
|
@@ -270,7 +283,7 @@ class TgSelect extends React.Component {
|
|
|
270
283
|
onClick={this.handleClear}
|
|
271
284
|
/>
|
|
272
285
|
)}
|
|
273
|
-
{noResults !== null && (
|
|
286
|
+
{noResults !== null && !noToggle && (
|
|
274
287
|
<Button
|
|
275
288
|
onClick={e => {
|
|
276
289
|
if (this.state.isOpen) {
|
|
@@ -301,7 +314,7 @@ class TgSelect extends React.Component {
|
|
|
301
314
|
opt => opt && opt.value === ((value && value.value) || value)
|
|
302
315
|
);
|
|
303
316
|
});
|
|
304
|
-
|
|
317
|
+
const toRet = (
|
|
305
318
|
<MultiSelect
|
|
306
319
|
onActiveItemChange={this.handleActiveItemChange}
|
|
307
320
|
closeOnSelect={!multi}
|
|
@@ -318,7 +331,10 @@ class TgSelect extends React.Component {
|
|
|
318
331
|
captureDismiss: true,
|
|
319
332
|
minimal: true,
|
|
320
333
|
className: classNames("tg-select", "tg-stop-dialog-form-enter", {
|
|
321
|
-
"tg-single-select": !multi
|
|
334
|
+
"tg-single-select": !multi,
|
|
335
|
+
"tg-select-as-tag": asTag,
|
|
336
|
+
"do-not-fill-width": doNotFillWidth,
|
|
337
|
+
"tg-small": small
|
|
322
338
|
}),
|
|
323
339
|
wrapperTagName: "div",
|
|
324
340
|
canEscapeKeyClose: true,
|
|
@@ -387,6 +403,23 @@ class TgSelect extends React.Component {
|
|
|
387
403
|
{...rest}
|
|
388
404
|
/>
|
|
389
405
|
);
|
|
406
|
+
if (backgroundColor) {
|
|
407
|
+
return (
|
|
408
|
+
<div
|
|
409
|
+
style={{
|
|
410
|
+
backgroundColor: backgroundColor,
|
|
411
|
+
borderRadius: "4px 4px 4px 4px",
|
|
412
|
+
overflow: "hidden",
|
|
413
|
+
width: "fit-content",
|
|
414
|
+
color: "white",
|
|
415
|
+
border: "2px solid white"
|
|
416
|
+
}}
|
|
417
|
+
>
|
|
418
|
+
{toRet}
|
|
419
|
+
</div>
|
|
420
|
+
);
|
|
421
|
+
}
|
|
422
|
+
return toRet;
|
|
390
423
|
}
|
|
391
424
|
}
|
|
392
425
|
|
package/src/TgSelect/style.css
CHANGED
|
@@ -2,6 +2,26 @@
|
|
|
2
2
|
width: 100%;
|
|
3
3
|
min-width: 170px;
|
|
4
4
|
}
|
|
5
|
+
.tg-select.tg-select-as-tag .bp3-tag.bp3-minimal.bp3-intent-primary {
|
|
6
|
+
color: white !important;
|
|
7
|
+
}
|
|
8
|
+
.tg-select.do-not-fill-width {
|
|
9
|
+
width: auto;
|
|
10
|
+
min-width: 50px;
|
|
11
|
+
}
|
|
12
|
+
.tg-select.tg-small .bp3-input {
|
|
13
|
+
min-height: 25px;
|
|
14
|
+
height: 25px;
|
|
15
|
+
}
|
|
16
|
+
.tg-select.tg-small input {
|
|
17
|
+
line-height: 10.5px;
|
|
18
|
+
}
|
|
19
|
+
.tg-select.tg-small .bp3-tag-input .bp3-input-ghost {
|
|
20
|
+
line-height: 10.5px;
|
|
21
|
+
}
|
|
22
|
+
.tg-select.tg-small .bp3-tag-input .bp3-tag-input-values {
|
|
23
|
+
margin-top: 2px;
|
|
24
|
+
}
|
|
5
25
|
.tg-select input {
|
|
6
26
|
font-size: 14px;
|
|
7
27
|
}
|
package/src/style.css
CHANGED
|
@@ -248,7 +248,15 @@ button:not(:disabled):active {
|
|
|
248
248
|
}
|
|
249
249
|
|
|
250
250
|
/* to fix tooltip styling issue - https://github.com/palantir/blueprint/issues/3430 */
|
|
251
|
-
.bp3-popover[style*="transform-origin"][style*="bottom"] .bp3-popover-arrow {
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
.bp3-popover[style*="transform-origin"][style*="
|
|
251
|
+
.bp3-popover[style*="transform-origin"][style*="bottom"] .bp3-popover-arrow {
|
|
252
|
+
transform: translate(0, -0.5px);
|
|
253
|
+
}
|
|
254
|
+
.bp3-popover[style*="transform-origin"][style*="left"] .bp3-popover-arrow {
|
|
255
|
+
transform: translate(0.5px, 0);
|
|
256
|
+
}
|
|
257
|
+
.bp3-popover[style*="transform-origin"][style*="top"] .bp3-popover-arrow {
|
|
258
|
+
transform: translate(0, 0.5px);
|
|
259
|
+
}
|
|
260
|
+
.bp3-popover[style*="transform-origin"][style*="right"] .bp3-popover-arrow {
|
|
261
|
+
transform: translate(-0.5px, 0);
|
|
262
|
+
}
|
package/style.css
CHANGED
|
@@ -9066,10 +9066,19 @@ button:not(:disabled):active {
|
|
|
9066
9066
|
}
|
|
9067
9067
|
|
|
9068
9068
|
/* to fix tooltip styling issue - https://github.com/palantir/blueprint/issues/3430 */
|
|
9069
|
-
.bp3-popover[style*="transform-origin"][style*="bottom"] .bp3-popover-arrow {
|
|
9070
|
-
|
|
9071
|
-
|
|
9072
|
-
.bp3-popover[style*="transform-origin"][style*="
|
|
9069
|
+
.bp3-popover[style*="transform-origin"][style*="bottom"] .bp3-popover-arrow {
|
|
9070
|
+
transform: translate(0, -0.5px);
|
|
9071
|
+
}
|
|
9072
|
+
.bp3-popover[style*="transform-origin"][style*="left"] .bp3-popover-arrow {
|
|
9073
|
+
transform: translate(0.5px, 0);
|
|
9074
|
+
}
|
|
9075
|
+
.bp3-popover[style*="transform-origin"][style*="top"] .bp3-popover-arrow {
|
|
9076
|
+
transform: translate(0, 0.5px);
|
|
9077
|
+
}
|
|
9078
|
+
.bp3-popover[style*="transform-origin"][style*="right"] .bp3-popover-arrow {
|
|
9079
|
+
transform: translate(-0.5px, 0);
|
|
9080
|
+
}
|
|
9081
|
+
.tippy-box[data-animation=fade][data-state=hidden]{opacity:0}[data-tippy-root]{max-width:calc(100vw - 10px)}.tippy-box{position:relative;background-color:#333;color:#fff;border-radius:4px;font-size:14px;line-height:1.4;white-space:normal;outline:0;transition-property:transform,visibility,opacity}.tippy-box[data-placement^=top]>.tippy-arrow{bottom:0}.tippy-box[data-placement^=top]>.tippy-arrow:before{bottom:-7px;left:0;border-width:8px 8px 0;border-top-color:initial;transform-origin:center top}.tippy-box[data-placement^=bottom]>.tippy-arrow{top:0}.tippy-box[data-placement^=bottom]>.tippy-arrow:before{top:-7px;left:0;border-width:0 8px 8px;border-bottom-color:initial;transform-origin:center bottom}.tippy-box[data-placement^=left]>.tippy-arrow{right:0}.tippy-box[data-placement^=left]>.tippy-arrow:before{border-width:8px 0 8px 8px;border-left-color:initial;right:-7px;transform-origin:center left}.tippy-box[data-placement^=right]>.tippy-arrow{left:0}.tippy-box[data-placement^=right]>.tippy-arrow:before{left:-7px;border-width:8px 8px 8px 0;border-right-color:initial;transform-origin:center right}.tippy-box[data-inertia][data-state=visible]{transition-timing-function:cubic-bezier(.54,1.5,.38,1.11)}.tippy-arrow{width:16px;height:16px;color:#333}.tippy-arrow:before{content:"";position:absolute;border-color:transparent;border-style:solid}.tippy-content{position:relative;padding:5px 9px;z-index:1}.rg-celleditor-input,
|
|
9073
9082
|
.rg-celleditor input {
|
|
9074
9083
|
border: none;
|
|
9075
9084
|
}
|
|
@@ -9077,6 +9086,26 @@ button:not(:disabled):active {
|
|
|
9077
9086
|
width: 100%;
|
|
9078
9087
|
min-width: 170px;
|
|
9079
9088
|
}
|
|
9089
|
+
.tg-select.tg-select-as-tag .bp3-tag.bp3-minimal.bp3-intent-primary {
|
|
9090
|
+
color: white !important;
|
|
9091
|
+
}
|
|
9092
|
+
.tg-select.do-not-fill-width {
|
|
9093
|
+
width: auto;
|
|
9094
|
+
min-width: 50px;
|
|
9095
|
+
}
|
|
9096
|
+
.tg-select.tg-small .bp3-input {
|
|
9097
|
+
min-height: 25px;
|
|
9098
|
+
height: 25px;
|
|
9099
|
+
}
|
|
9100
|
+
.tg-select.tg-small input {
|
|
9101
|
+
line-height: 10.5px;
|
|
9102
|
+
}
|
|
9103
|
+
.tg-select.tg-small .bp3-tag-input .bp3-input-ghost {
|
|
9104
|
+
line-height: 10.5px;
|
|
9105
|
+
}
|
|
9106
|
+
.tg-select.tg-small .bp3-tag-input .bp3-tag-input-values {
|
|
9107
|
+
margin-top: 2px;
|
|
9108
|
+
}
|
|
9080
9109
|
.tg-select input {
|
|
9081
9110
|
font-size: 14px;
|
|
9082
9111
|
}
|