@onehat/ui 0.4.70 → 0.4.72
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/package.json +2 -1
- package/src/Components/Accordion/Accordion.js +1 -0
- package/src/Components/Blank.js +1 -0
- package/src/Components/Buttons/BackButton.js +1 -0
- package/src/Components/Buttons/Button.js +18 -10
- package/src/Components/Buttons/CartButtonWithBadge.js +1 -0
- package/src/Components/Buttons/IconButton.js +9 -8
- package/src/Components/Buttons/PlusMinusButton.js +5 -4
- package/src/Components/Buttons/SquareButton.js +19 -18
- package/src/Components/Container/Container.js +1 -0
- package/src/Components/Container/ContainerColumn.js +4 -3
- package/src/Components/Container/ScreenContainer.js +14 -13
- package/src/Components/Container/Splitter.js +33 -28
- package/src/Components/Editor/InlineEditor.js +32 -30
- package/src/Components/Fab/DynamicFab.js +14 -13
- package/src/Components/Fab/FabWithTooltip.js +1 -0
- package/src/Components/Filter/DateRange.js +8 -7
- package/src/Components/Filter/NumberRange.js +8 -7
- package/src/Components/Form/Field/CKEditor/CKEditor.js +1 -0
- package/src/Components/Form/Field/Checkbox/CheckboxGroup.js +1 -0
- package/src/Components/Form/Field/Color.js +41 -40
- package/src/Components/Form/Field/Combo/Combo.js +173 -172
- package/src/Components/Form/Field/Combo/MeterTypesCombo.js +4 -2
- package/src/Components/Form/Field/Combo/PageSizeCombo.js +1 -0
- package/src/Components/Form/Field/Date.js +117 -116
- package/src/Components/Form/Field/DisplayField.js +6 -5
- package/src/Components/Form/Field/File.js +1 -0
- package/src/Components/Form/Field/FormikForm.js +1 -0
- package/src/Components/Form/Field/Input.js +20 -18
- package/src/Components/Form/Field/Json.js +7 -6
- package/src/Components/Form/Field/Number.js +31 -30
- package/src/Components/Form/Field/RadioGroup/RadioGroup.js +1 -0
- package/src/Components/Form/Field/Select/PageSizeSelect.js +1 -0
- package/src/Components/Form/Field/Select/Select.js +9 -8
- package/src/Components/Form/Field/Slider.js +15 -14
- package/src/Components/Form/Field/Tag/Tag.js +25 -24
- package/src/Components/Form/Field/Tag/ValueBox.js +32 -31
- package/src/Components/Form/Field/Text.js +9 -8
- package/src/Components/Form/Field/TextArea.js +9 -8
- package/src/Components/Form/Field/Toggle.js +16 -15
- package/src/Components/Form/FieldSet.js +27 -26
- package/src/Components/Form/Form.js +104 -103
- package/src/Components/Form/Label.js +15 -14
- package/src/Components/Grid/Grid.js +62 -52
- package/src/Components/Grid/GridHeaderRow.js +42 -40
- package/src/Components/Grid/GridRow.js +92 -90
- package/src/Components/Grid/HeaderColumnSelectorHandle.js +9 -8
- package/src/Components/Grid/HeaderReorderHandle.js +9 -8
- package/src/Components/Grid/HeaderResizeHandle.js +9 -8
- package/src/Components/Grid/NoRecordsFound.js +4 -3
- package/src/Components/Grid/RowDragHandle.js +26 -10
- package/src/Components/Grid/RowHandle.js +55 -0
- package/src/Components/Grid/RowSelectHandle.js +1 -0
- package/src/{Hooks → Components/Grid}/useAsyncRenderers.js +1 -1
- package/src/Components/Hoc/Secondary/withSecondaryData.js +2 -1
- package/src/Components/Hoc/Secondary/withSecondaryEditor.js +4 -3
- package/src/Components/Hoc/Secondary/withSecondarySelection.js +3 -2
- package/src/Components/Hoc/Secondary/withSecondaryValue.js +2 -1
- package/src/Components/Hoc/Secondary/withSecondaryWindowedEditor.js +6 -5
- package/src/Components/Hoc/withAlert.js +38 -35
- package/src/Components/Hoc/withCollapsible.js +9 -4
- package/src/Components/Hoc/withComponent.js +6 -0
- package/src/Components/Hoc/withContextMenu.js +33 -26
- package/src/Components/Hoc/withData.js +3 -2
- package/src/Components/Hoc/withDnd.js +17 -8
- package/src/Components/Hoc/withDraggable.js +21 -5
- package/src/Components/Hoc/withEditor.js +3 -2
- package/src/Components/Hoc/withEvents.js +11 -1
- package/src/Components/Hoc/withFilters.js +26 -20
- package/src/Components/Hoc/withModal.js +10 -8
- package/src/Components/Hoc/withPdfButtons.js +3 -2
- package/src/Components/Hoc/withPermissions.js +3 -2
- package/src/Components/Hoc/withPresetButtons.js +3 -2
- package/src/Components/Hoc/withSelection.js +2 -8
- package/src/Components/Hoc/withToast.js +5 -2
- package/src/Components/Hoc/withTooltip.js +10 -1
- package/src/Components/Hoc/withValue.js +3 -9
- package/src/Components/Hoc/withWindowedEditor.js +6 -5
- package/src/Components/Layout/AsyncOperation.js +1 -0
- package/src/Components/Layout/CenterBox.js +9 -8
- package/src/Components/Layout/Footer.js +11 -10
- package/src/Components/Layout/ScreenHeader.js +5 -4
- package/src/Components/Layout/TextWithTooltip.js +1 -0
- package/src/Components/Messages/ConfirmationMessage.js +6 -5
- package/src/Components/Messages/ErrorMessage.js +40 -39
- package/src/Components/Messages/GlobalModals.js +47 -0
- package/src/Components/Messages/Loading.js +1 -0
- package/src/Components/Messages/OkMessage.js +11 -10
- package/src/Components/Messages/Unauthorized.js +1 -0
- package/src/Components/Messages/WaitMessage.js +16 -15
- package/src/Components/Panel/AccordionGridPanel.js +1 -0
- package/src/Components/Panel/FormPanel.js +1 -0
- package/src/Components/Panel/Header.js +59 -58
- package/src/Components/Panel/Mask.js +1 -0
- package/src/Components/Panel/Panel.js +7 -6
- package/src/Components/Picker/Picker.js +1 -0
- package/src/Components/Report/Report.js +35 -34
- package/src/Components/Screens/Manager.js +1 -0
- package/src/Components/Screens/ReportsManager.js +1 -0
- package/src/Components/Tab/Tab.js +1 -0
- package/src/Components/Tab/TabBar.js +67 -66
- package/src/Components/Toolbar/FilterToolbar.js +14 -11
- package/src/Components/Toolbar/Pagination.js +26 -25
- package/src/Components/Toolbar/PaginationToolbar.js +13 -12
- package/src/Components/Toolbar/Toolbar.js +13 -12
- package/src/Components/Tooltip/Tooltip.js +1 -0
- package/src/Components/Tree/Tree.js +34 -17
- package/src/Components/Tree/TreeNode.js +30 -29
- package/src/Components/Tree/TreeNodeDragHandle.js +18 -13
- package/src/Components/Viewer/MeterTypeText.js +29 -8
- package/src/Components/Viewer/TextWithLinks.js +16 -15
- package/src/Components/Viewer/Viewer.js +23 -22
- package/src/Components/Window/UploadsDownloadsWindow.js +6 -5
- package/src/Components/index.js +1 -0
- package/src/Constants/MeterTypes.js +2 -0
- package/src/Functions/addIconProps.js +46 -0
- package/src/Functions/testProps.js +1 -1
- package/src/Hooks/useWhyDidYouUpdate.js +33 -0
- package/src/PlatformImports/Web/Attachments.js +1 -1
- package/src/Components/Hoc/withBlank.js +0 -10
|
@@ -8,6 +8,7 @@ import {
|
|
|
8
8
|
Pressable,
|
|
9
9
|
TextNative,
|
|
10
10
|
} from '@project-components/Gluestack';
|
|
11
|
+
import clsx from 'clsx';
|
|
11
12
|
import {
|
|
12
13
|
DATE,
|
|
13
14
|
TIME,
|
|
@@ -296,11 +297,11 @@ export const DateElement = forwardRef((props, ref) => {
|
|
|
296
297
|
}}
|
|
297
298
|
isDisabled={isDisabled}
|
|
298
299
|
onPress={onClearBtn}
|
|
299
|
-
className={
|
|
300
|
-
Date-xBtn
|
|
301
|
-
h-full
|
|
302
|
-
|
|
303
|
-
|
|
300
|
+
className={clsx(
|
|
301
|
+
'Date-xBtn',
|
|
302
|
+
'h-full',
|
|
303
|
+
styles.FORM_COMBO_TRIGGER_CLASSNAME,
|
|
304
|
+
)}
|
|
304
305
|
/>;
|
|
305
306
|
}
|
|
306
307
|
trigger = <IconButton
|
|
@@ -314,16 +315,16 @@ export const DateElement = forwardRef((props, ref) => {
|
|
|
314
315
|
onPress={onTriggerPress}
|
|
315
316
|
onBlur={onTriggerBlur}
|
|
316
317
|
isDisabled={isDisabled}
|
|
317
|
-
className={
|
|
318
|
-
Date-trigger
|
|
319
|
-
h-10
|
|
320
|
-
w-10
|
|
321
|
-
border
|
|
322
|
-
border-grey-400
|
|
323
|
-
rounded-l-md
|
|
324
|
-
rounded-r-none
|
|
325
|
-
|
|
326
|
-
|
|
318
|
+
className={clsx(
|
|
319
|
+
'Date-trigger',
|
|
320
|
+
'h-10',
|
|
321
|
+
'w-10',
|
|
322
|
+
'border',
|
|
323
|
+
'border-grey-400',
|
|
324
|
+
'rounded-l-md',
|
|
325
|
+
'rounded-r-none',
|
|
326
|
+
styles.FORM_DATE_TRIGGER_CLASSNAME,
|
|
327
|
+
)}
|
|
327
328
|
/>;
|
|
328
329
|
|
|
329
330
|
if (UiGlobals.mode === UI_MODE_WEB) {
|
|
@@ -337,20 +338,20 @@ export const DateElement = forwardRef((props, ref) => {
|
|
|
337
338
|
ref={inputRef}
|
|
338
339
|
numberOfLines={1}
|
|
339
340
|
ellipsizeMode="head"
|
|
340
|
-
className={
|
|
341
|
-
Date-TextNative
|
|
342
|
-
flex-1
|
|
343
|
-
h-full
|
|
344
|
-
m-0
|
|
345
|
-
p-2
|
|
346
|
-
border
|
|
347
|
-
border-grey-400
|
|
348
|
-
border-l-[0px]
|
|
349
|
-
rounded-l-none
|
|
350
|
-
rounded-r-md
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
341
|
+
className={clsx(
|
|
342
|
+
'Date-TextNative',
|
|
343
|
+
'flex-1',
|
|
344
|
+
'h-full',
|
|
345
|
+
'm-0',
|
|
346
|
+
'p-2',
|
|
347
|
+
'border',
|
|
348
|
+
'border-grey-400',
|
|
349
|
+
'border-l-[0px]',
|
|
350
|
+
'rounded-l-none',
|
|
351
|
+
'rounded-r-md',
|
|
352
|
+
_.isEmpty(textInputValue) ? 'text-grey-400' : 'text-black',
|
|
353
|
+
styles.FORM_DATE_INPUT_CLASSNAME,
|
|
354
|
+
)}
|
|
354
355
|
>{_.isEmpty(textInputValue) ? placeholder : textInputValue}</TextNative>
|
|
355
356
|
</Pressable> :
|
|
356
357
|
<Input
|
|
@@ -366,10 +367,10 @@ export const DateElement = forwardRef((props, ref) => {
|
|
|
366
367
|
isDisabled={isDisabled}
|
|
367
368
|
tooltip={tooltip}
|
|
368
369
|
tooltipPlacement={tooltipPlacement}
|
|
369
|
-
tooltipTriggerClassName={
|
|
370
|
-
flex-1
|
|
371
|
-
h-full
|
|
372
|
-
|
|
370
|
+
tooltipTriggerClassName={clsx(
|
|
371
|
+
'flex-1',
|
|
372
|
+
'h-full',
|
|
373
|
+
)}
|
|
373
374
|
// onLayout={(e) => {
|
|
374
375
|
// const {
|
|
375
376
|
// height,
|
|
@@ -378,15 +379,15 @@ export const DateElement = forwardRef((props, ref) => {
|
|
|
378
379
|
// setWidth(Math.round(width));
|
|
379
380
|
// setTop(Math.round(height));
|
|
380
381
|
// }}
|
|
381
|
-
className={
|
|
382
|
-
Date-Input
|
|
383
|
-
flex-1
|
|
384
|
-
h-full
|
|
385
|
-
m-0
|
|
386
|
-
rounded-r-lg
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
382
|
+
className={clsx(
|
|
383
|
+
'Date-Input',
|
|
384
|
+
'flex-1',
|
|
385
|
+
'h-full',
|
|
386
|
+
'm-0',
|
|
387
|
+
'rounded-r-lg',
|
|
388
|
+
styles.FORM_DATE_INPUT_CLASSNAME,
|
|
389
|
+
_.isEmpty(textInputValue) ? 'text-grey-400' : 'text-black',
|
|
390
|
+
)}
|
|
390
391
|
autoSubmitDelay={1000}
|
|
391
392
|
placeholder={placeholder}
|
|
392
393
|
textAlignIsCenter={true}
|
|
@@ -405,21 +406,21 @@ export const DateElement = forwardRef((props, ref) => {
|
|
|
405
406
|
<TextNative
|
|
406
407
|
numberOfLines={1}
|
|
407
408
|
ellipsizeMode="head"
|
|
408
|
-
className={
|
|
409
|
-
flex-1
|
|
410
|
-
h-full
|
|
411
|
-
m-0
|
|
412
|
-
p-2
|
|
413
|
-
border
|
|
414
|
-
border-grey-400
|
|
415
|
-
border-l-[0px]
|
|
416
|
-
rounded-l-none
|
|
417
|
-
rounded-r-md
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
409
|
+
className={clsx(
|
|
410
|
+
'flex-1',
|
|
411
|
+
'h-full',
|
|
412
|
+
'm-0',
|
|
413
|
+
'p-2',
|
|
414
|
+
'border',
|
|
415
|
+
'border-grey-400',
|
|
416
|
+
'border-l-[0px]',
|
|
417
|
+
'rounded-l-none',
|
|
418
|
+
'rounded-r-md',
|
|
419
|
+
_.isEmpty(textInputValue) ? 'text-grey-400' : 'text-black',
|
|
420
|
+
styles.FORM_DATE_READOUT_FONTSIZE,
|
|
421
|
+
styles.FORM_DATE_INPUT_CLASSNAME,
|
|
422
|
+
styles.FORM_DATE_INPUT_CLASSNAME_FOCUS,
|
|
423
|
+
)}
|
|
423
424
|
>{_.isEmpty(textInputValue) ? placeholder : textInputValue}</TextNative>
|
|
424
425
|
</Pressable>;
|
|
425
426
|
}
|
|
@@ -437,9 +438,9 @@ export const DateElement = forwardRef((props, ref) => {
|
|
|
437
438
|
<PopoverBackdrop className="PopoverBackdrop bg-[#000]" />
|
|
438
439
|
<PopoverContent
|
|
439
440
|
ref={pickerRef}
|
|
440
|
-
className={
|
|
441
|
-
Date-PopoverContent
|
|
442
|
-
|
|
441
|
+
className={clsx(
|
|
442
|
+
'Date-PopoverContent',
|
|
443
|
+
)}
|
|
443
444
|
style={{
|
|
444
445
|
top,
|
|
445
446
|
left,
|
|
@@ -449,10 +450,10 @@ export const DateElement = forwardRef((props, ref) => {
|
|
|
449
450
|
}}
|
|
450
451
|
>
|
|
451
452
|
<PopoverBody
|
|
452
|
-
className={
|
|
453
|
-
Date-PopoverBody
|
|
454
|
-
overflow-hidden
|
|
455
|
-
|
|
453
|
+
className={clsx(
|
|
454
|
+
'Date-PopoverBody',
|
|
455
|
+
'overflow-hidden',
|
|
456
|
+
)}
|
|
456
457
|
>
|
|
457
458
|
<Datetime
|
|
458
459
|
{...testProps('picker')}
|
|
@@ -468,9 +469,9 @@ export const DateElement = forwardRef((props, ref) => {
|
|
|
468
469
|
{...testProps('todayBtn')}
|
|
469
470
|
key="todayBtn"
|
|
470
471
|
onPress={onToday}
|
|
471
|
-
className={
|
|
472
|
-
mt-2
|
|
473
|
-
|
|
472
|
+
className={clsx(
|
|
473
|
+
'mt-2',
|
|
474
|
+
)}
|
|
474
475
|
text="Today"
|
|
475
476
|
/>
|
|
476
477
|
</PopoverBody>
|
|
@@ -489,34 +490,34 @@ export const DateElement = forwardRef((props, ref) => {
|
|
|
489
490
|
}}
|
|
490
491
|
isDisabled={isDisabled}
|
|
491
492
|
onPress={() => hidePicker()}
|
|
492
|
-
className={
|
|
493
|
-
h-full
|
|
494
|
-
w-10
|
|
495
|
-
border
|
|
496
|
-
border-grey-400
|
|
497
|
-
rounded-l-md
|
|
498
|
-
rounded-r-none
|
|
499
|
-
|
|
500
|
-
|
|
493
|
+
className={clsx(
|
|
494
|
+
'h-full',
|
|
495
|
+
'w-10',
|
|
496
|
+
'border',
|
|
497
|
+
'border-grey-400',
|
|
498
|
+
'rounded-l-md',
|
|
499
|
+
'rounded-r-none',
|
|
500
|
+
styles.FORM_DATE_TRIGGER_CLASSNAME,
|
|
501
|
+
)}
|
|
501
502
|
/>
|
|
502
503
|
{disableDirectEntry ?
|
|
503
504
|
<TextNative
|
|
504
505
|
ref={inputRef}
|
|
505
506
|
numberOfLines={1}
|
|
506
507
|
ellipsizeMode="head"
|
|
507
|
-
className={
|
|
508
|
-
flex-1
|
|
509
|
-
h-full
|
|
510
|
-
m-0
|
|
511
|
-
p-2
|
|
512
|
-
border
|
|
513
|
-
border-grey-400
|
|
514
|
-
border-l-0
|
|
515
|
-
rounded-l-none
|
|
516
|
-
rounded-r-md
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
508
|
+
className={clsx(
|
|
509
|
+
'flex-1',
|
|
510
|
+
'h-full',
|
|
511
|
+
'm-0',
|
|
512
|
+
'p-2',
|
|
513
|
+
'border',
|
|
514
|
+
'border-grey-400',
|
|
515
|
+
'border-l-0',
|
|
516
|
+
'rounded-l-none',
|
|
517
|
+
'rounded-r-md',
|
|
518
|
+
_.isEmpty(textInputValue) ? "text-grey-400" : "text-black",
|
|
519
|
+
styles.FORM_DATE_INPUT_CLASSNAME,
|
|
520
|
+
)}
|
|
520
521
|
>{textInputValue}</TextNative> :
|
|
521
522
|
<Input
|
|
522
523
|
{...testProps('input')}
|
|
@@ -532,19 +533,19 @@ export const DateElement = forwardRef((props, ref) => {
|
|
|
532
533
|
placeholder={placeholder}
|
|
533
534
|
tooltip={tooltip}
|
|
534
535
|
tooltipPlacement={tooltipPlacement}
|
|
535
|
-
tooltipClassName={
|
|
536
|
-
flex-1
|
|
537
|
-
h-full
|
|
538
|
-
|
|
539
|
-
className={
|
|
540
|
-
flex-1
|
|
541
|
-
h-full
|
|
542
|
-
m-0
|
|
543
|
-
rounded-tr-none
|
|
544
|
-
rounded-br-none
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
536
|
+
tooltipClassName={clsx(
|
|
537
|
+
'flex-1',
|
|
538
|
+
'h-full',
|
|
539
|
+
)}
|
|
540
|
+
className={clsx(
|
|
541
|
+
'flex-1',
|
|
542
|
+
'h-full',
|
|
543
|
+
'm-0',
|
|
544
|
+
'rounded-tr-none',
|
|
545
|
+
'rounded-br-none',
|
|
546
|
+
_.isEmpty(textInputValue) ? 'text-grey-400' : 'text-black',
|
|
547
|
+
styles.FORM_DATE_INPUT_CLASSNAME,
|
|
548
|
+
)}
|
|
548
549
|
{..._input}
|
|
549
550
|
/>}
|
|
550
551
|
</HStack>;
|
|
@@ -552,13 +553,13 @@ export const DateElement = forwardRef((props, ref) => {
|
|
|
552
553
|
isOpen={true}
|
|
553
554
|
safeAreaTop={true}
|
|
554
555
|
onClose={() => setIsPickerShown(false)}
|
|
555
|
-
className={
|
|
556
|
-
Date-Modal
|
|
557
|
-
my-auto
|
|
558
|
-
w-full
|
|
559
|
-
h-[400px]
|
|
560
|
-
p-3
|
|
561
|
-
|
|
556
|
+
className={clsx(
|
|
557
|
+
'Date-Modal',
|
|
558
|
+
'my-auto',
|
|
559
|
+
'w-full',
|
|
560
|
+
'h-[400px]',
|
|
561
|
+
'p-3',
|
|
562
|
+
)}
|
|
562
563
|
>
|
|
563
564
|
<ModalBackdrop />
|
|
564
565
|
<ModalContent>
|
|
@@ -591,13 +592,13 @@ export const DateElement = forwardRef((props, ref) => {
|
|
|
591
592
|
}
|
|
592
593
|
}
|
|
593
594
|
|
|
594
|
-
let className =
|
|
595
|
-
Date-HStackNative
|
|
596
|
-
flex-1
|
|
597
|
-
justify-center
|
|
598
|
-
items-center
|
|
599
|
-
|
|
600
|
-
|
|
595
|
+
let className = clsx(
|
|
596
|
+
'Date-HStackNative',
|
|
597
|
+
'flex-1',
|
|
598
|
+
'justify-center',
|
|
599
|
+
'items-center',
|
|
600
|
+
styles.FORM_DATE_CLASSNAME,
|
|
601
|
+
);
|
|
601
602
|
if (props.className) {
|
|
602
603
|
className += props.className;
|
|
603
604
|
}
|
|
@@ -2,6 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import {
|
|
3
3
|
Text,
|
|
4
4
|
} from '@project-components/Gluestack';
|
|
5
|
+
import clsx from 'clsx';
|
|
5
6
|
import UiGlobals from '../../../UiGlobals.js';
|
|
6
7
|
import withComponent from '../../Hoc/withComponent.js';
|
|
7
8
|
import withTooltip from '../../Hoc/withTooltip.js';
|
|
@@ -14,11 +15,11 @@ const
|
|
|
14
15
|
text = value,
|
|
15
16
|
} = props,
|
|
16
17
|
styles = UiGlobals.styles;
|
|
17
|
-
let className =
|
|
18
|
-
DisplayField
|
|
19
|
-
flex-1
|
|
20
|
-
|
|
21
|
-
|
|
18
|
+
let className = clsx(
|
|
19
|
+
'DisplayField',
|
|
20
|
+
'flex-1',
|
|
21
|
+
styles.TEXT_FONTSIZE,
|
|
22
|
+
);
|
|
22
23
|
if (props.className) {
|
|
23
24
|
className += ' ' + props.className;
|
|
24
25
|
}
|
|
@@ -2,11 +2,13 @@ import { cloneElement, forwardRef, isValidElement, useState, useEffect, useRef,
|
|
|
2
2
|
import {
|
|
3
3
|
Input, InputField, InputIcon, InputSlot,
|
|
4
4
|
} from '@project-components/Gluestack';
|
|
5
|
+
import clsx from 'clsx';
|
|
5
6
|
import {
|
|
6
7
|
hasWidth,
|
|
7
8
|
hasFlex,
|
|
8
9
|
} from '../../../Functions/tailwindFunctions.js';
|
|
9
10
|
import UiGlobals from '../../../UiGlobals.js';
|
|
11
|
+
import addIconProps from '../../../Functions/addIconProps.js';
|
|
10
12
|
import withComponent from '../../Hoc/withComponent.js';
|
|
11
13
|
import withTooltip from '../../Hoc/withTooltip.js';
|
|
12
14
|
import withValue from '../../Hoc/withValue.js';
|
|
@@ -112,20 +114,20 @@ const InputElement = forwardRef((props, ref) => {
|
|
|
112
114
|
if (!disableAutoFlex && !hasWidth(props) && !hasFlex(props)) {
|
|
113
115
|
style.flex = 1;
|
|
114
116
|
}
|
|
115
|
-
let inputClassName =
|
|
116
|
-
Input
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
inputFieldClassName =
|
|
120
|
-
InputField
|
|
121
|
-
self-stretch
|
|
122
|
-
h-auto
|
|
123
|
-
w-full
|
|
124
|
-
p-2
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
117
|
+
let inputClassName = clsx(
|
|
118
|
+
'Input',
|
|
119
|
+
styles.FORM_INPUT_CLASSNAME,
|
|
120
|
+
),
|
|
121
|
+
inputFieldClassName = clsx(
|
|
122
|
+
'InputField',
|
|
123
|
+
'self-stretch',
|
|
124
|
+
'h-auto',
|
|
125
|
+
'w-full',
|
|
126
|
+
'p-2',
|
|
127
|
+
textAlignIsCenter ? 'text-center' : 'text-left',
|
|
128
|
+
styles.FORM_INPUT_CLASSNAME,
|
|
129
|
+
styles.FORM_INPUT_FIELD_CLASSNAME,
|
|
130
|
+
);
|
|
129
131
|
if (className) {
|
|
130
132
|
inputClassName += className;
|
|
131
133
|
}
|
|
@@ -144,10 +146,10 @@ const InputElement = forwardRef((props, ref) => {
|
|
|
144
146
|
_leftIcon.className = 'leftInputIcon mr-2 ' + _leftIcon.className; // prepend the margin, so it can potentially be overridden
|
|
145
147
|
if (isValidElement(leftIcon)) {
|
|
146
148
|
if (_leftIcon) {
|
|
147
|
-
leftIcon = cloneElement(leftIcon, {
|
|
149
|
+
leftIcon = cloneElement(leftIcon, addIconProps(_leftIcon || {}));
|
|
148
150
|
}
|
|
149
151
|
} else {
|
|
150
|
-
leftIcon = <InputIcon as={leftIcon} {..._leftIcon} />;
|
|
152
|
+
leftIcon = <InputIcon as={leftIcon} {...addIconProps(_leftIcon || {})} />;
|
|
151
153
|
}
|
|
152
154
|
if (leftIconHandler) {
|
|
153
155
|
leftIcon = <InputSlot onPress={leftIconHandler} className="LeftInputSlot">
|
|
@@ -168,10 +170,10 @@ const InputElement = forwardRef((props, ref) => {
|
|
|
168
170
|
_rightIcon.className = 'rightInputIcon ml-2 ' + _rightIcon.className; // prepend the margin, so it can potentially be overridden
|
|
169
171
|
if (isValidElement(rightIcon)) {
|
|
170
172
|
if (_rightIcon) {
|
|
171
|
-
rightIcon = cloneElement(rightIcon, {
|
|
173
|
+
rightIcon = cloneElement(rightIcon, addIconProps(_rightIcon || {}));
|
|
172
174
|
}
|
|
173
175
|
} else {
|
|
174
|
-
rightIcon = <InputIcon as={rightIcon} {..._rightIcon} />;
|
|
176
|
+
rightIcon = <InputIcon as={rightIcon} {...addIconProps(_rightIcon || {})} />;
|
|
175
177
|
}
|
|
176
178
|
if (rightIconHandler) {
|
|
177
179
|
rightIcon = <InputSlot onPress={rightIconHandler} className="RightInputSlot">
|
|
@@ -2,6 +2,7 @@ import {
|
|
|
2
2
|
HStack,
|
|
3
3
|
Tooltip,
|
|
4
4
|
} from '@project-components/Gluestack';
|
|
5
|
+
import clsx from 'clsx';
|
|
5
6
|
import {
|
|
6
7
|
UI_MODE_NATIVE,
|
|
7
8
|
UI_MODE_WEB,
|
|
@@ -39,12 +40,12 @@ export function JsonElement(props) {
|
|
|
39
40
|
throw new Error('JsonElement not yet implemented for React Native');
|
|
40
41
|
}
|
|
41
42
|
|
|
42
|
-
let className =
|
|
43
|
-
Json
|
|
44
|
-
flex-1
|
|
45
|
-
justify-start
|
|
46
|
-
|
|
47
|
-
|
|
43
|
+
let className = clsx(
|
|
44
|
+
'Json',
|
|
45
|
+
'flex-1',
|
|
46
|
+
'justify-start',
|
|
47
|
+
testID,
|
|
48
|
+
);
|
|
48
49
|
if (props.className) {
|
|
49
50
|
className += ' ' + propsToPass.className;
|
|
50
51
|
}
|
|
@@ -3,6 +3,7 @@ import React, { useState, useEffect, useRef, } from 'react';
|
|
|
3
3
|
import {
|
|
4
4
|
HStack,
|
|
5
5
|
} from '@project-components/Gluestack';
|
|
6
|
+
import clsx from 'clsx';
|
|
6
7
|
import Decimal from 'decimal.js';
|
|
7
8
|
import UiGlobals from '../../../UiGlobals.js';
|
|
8
9
|
import IconButton from '../../Buttons/IconButton.js';
|
|
@@ -121,17 +122,17 @@ function NumberElement(props) {
|
|
|
121
122
|
isIncrementDisabled = typeof maxValue !== 'undefined' && value === maxValue,
|
|
122
123
|
isDecrementDisabled = typeof minValue !== 'undefined' && (value === minValue || (!value && minValue === 0));
|
|
123
124
|
|
|
124
|
-
let className =
|
|
125
|
-
Number
|
|
126
|
-
flex
|
|
127
|
-
h-full
|
|
128
|
-
items-center
|
|
129
|
-
max-h-[40px]
|
|
130
|
-
p-0
|
|
131
|
-
border
|
|
132
|
-
border-grey-400
|
|
133
|
-
rounded-[6px]
|
|
134
|
-
|
|
125
|
+
let className = clsx(
|
|
126
|
+
'Number',
|
|
127
|
+
'flex',
|
|
128
|
+
'h-full',
|
|
129
|
+
'items-center',
|
|
130
|
+
'max-h-[40px]',
|
|
131
|
+
'p-0',
|
|
132
|
+
'border',
|
|
133
|
+
'border-grey-400',
|
|
134
|
+
'rounded-[6px]',
|
|
135
|
+
);
|
|
135
136
|
if (props.className) {
|
|
136
137
|
className += ' ' + props.className;
|
|
137
138
|
}
|
|
@@ -147,11 +148,11 @@ function NumberElement(props) {
|
|
|
147
148
|
}}
|
|
148
149
|
onPress={onDecrement}
|
|
149
150
|
isDisabled={isDecrementDisabled || isDisabled}
|
|
150
|
-
className={
|
|
151
|
-
decrementBtn
|
|
152
|
-
h-full
|
|
153
|
-
rounded-r-none
|
|
154
|
-
|
|
151
|
+
className={clsx(
|
|
152
|
+
'decrementBtn',
|
|
153
|
+
'h-full',
|
|
154
|
+
'rounded-r-none',
|
|
155
|
+
)}
|
|
155
156
|
style={{
|
|
156
157
|
width: 40,
|
|
157
158
|
}}
|
|
@@ -164,15 +165,15 @@ function NumberElement(props) {
|
|
|
164
165
|
isDisabled={isDisabled}
|
|
165
166
|
tooltip={tooltip}
|
|
166
167
|
tooltipPlacement={tooltipPlacement}
|
|
167
|
-
tooltipTriggerClassName={
|
|
168
|
-
flex-1
|
|
169
|
-
h-full
|
|
170
|
-
|
|
171
|
-
className={
|
|
172
|
-
h-full
|
|
173
|
-
text-center
|
|
174
|
-
rounded-none
|
|
175
|
-
|
|
168
|
+
tooltipTriggerClassName={clsx(
|
|
169
|
+
'flex-1',
|
|
170
|
+
'h-full',
|
|
171
|
+
)}
|
|
172
|
+
className={clsx(
|
|
173
|
+
'h-full',
|
|
174
|
+
'text-center',
|
|
175
|
+
'rounded-none',
|
|
176
|
+
)}
|
|
176
177
|
textAlignIsCenter={true}
|
|
177
178
|
style={{
|
|
178
179
|
flex: 3
|
|
@@ -187,11 +188,11 @@ function NumberElement(props) {
|
|
|
187
188
|
}}
|
|
188
189
|
onPress={onIncrement}
|
|
189
190
|
isDisabled={isIncrementDisabled || isDisabled}
|
|
190
|
-
className={
|
|
191
|
-
incrementBtn
|
|
192
|
-
h-full
|
|
193
|
-
rounded-l-none
|
|
194
|
-
|
|
191
|
+
className={clsx(
|
|
192
|
+
'incrementBtn',
|
|
193
|
+
'h-full',
|
|
194
|
+
'rounded-l-none',
|
|
195
|
+
)}
|
|
195
196
|
style={{
|
|
196
197
|
width: 40,
|
|
197
198
|
}}
|
|
@@ -2,6 +2,7 @@ import React, { useState, useEffect, } from 'react';
|
|
|
2
2
|
import {
|
|
3
3
|
Radio, RadioGroup,
|
|
4
4
|
} from '@project-components/Gluestack';
|
|
5
|
+
import clsx from 'clsx';
|
|
5
6
|
import testProps from '../../../../Functions/testProps.js';
|
|
6
7
|
import withComponent from '../../../Hoc/withComponent.js';
|
|
7
8
|
import withData from '../../../Hoc/withData.js';
|
|
@@ -2,6 +2,7 @@ import { forwardRef, useState, useEffect, useRef, } from 'react';
|
|
|
2
2
|
import {
|
|
3
3
|
Select, SelectBackdrop, SelectContent, SelectDragIndicator, SelectDragIndicatorWrapper, SelectInput, SelectIcon, SelectItem, SelectPortal, SelectTrigger,
|
|
4
4
|
} from '@project-components/Gluestack';
|
|
5
|
+
import clsx from 'clsx';
|
|
5
6
|
import {
|
|
6
7
|
hasWidth,
|
|
7
8
|
hasFlex,
|
|
@@ -66,14 +67,14 @@ const SelectElement = forwardRef((props, ref) => {
|
|
|
66
67
|
if (!disableAutoFlex && !hasWidth(props) && !hasFlex(props)) {
|
|
67
68
|
style.flex = 1;
|
|
68
69
|
}
|
|
69
|
-
let className =
|
|
70
|
-
Select
|
|
71
|
-
min-h-[40px]
|
|
72
|
-
w-full
|
|
73
|
-
text-left
|
|
74
|
-
rounded-lg
|
|
75
|
-
|
|
76
|
-
|
|
70
|
+
let className = clsx(
|
|
71
|
+
'Select',
|
|
72
|
+
'min-h-[40px]',
|
|
73
|
+
'w-full',
|
|
74
|
+
'text-left',
|
|
75
|
+
'rounded-lg',
|
|
76
|
+
styles.FORM_SELECT_CLASSNAME,
|
|
77
|
+
);
|
|
77
78
|
if (props.className) {
|
|
78
79
|
className += props.className;
|
|
79
80
|
}
|
|
@@ -3,6 +3,7 @@ import {
|
|
|
3
3
|
HStack,
|
|
4
4
|
Text,
|
|
5
5
|
} from '@project-components/Gluestack';
|
|
6
|
+
import clsx from 'clsx';
|
|
6
7
|
import {
|
|
7
8
|
hasWidth,
|
|
8
9
|
hasFlex,
|
|
@@ -147,20 +148,20 @@ function SliderElement(props) {
|
|
|
147
148
|
sliderValue = FAKE_ZERO; // Slider doesn't like zero
|
|
148
149
|
}
|
|
149
150
|
|
|
150
|
-
let className =
|
|
151
|
-
Slider
|
|
152
|
-
w-full
|
|
153
|
-
items-center
|
|
154
|
-
|
|
155
|
-
inputClassName =
|
|
156
|
-
Input
|
|
157
|
-
h-full
|
|
158
|
-
w-[60px]
|
|
159
|
-
mr-4
|
|
160
|
-
text-center
|
|
161
|
-
rounded-md
|
|
162
|
-
|
|
163
|
-
|
|
151
|
+
let className = clsx(
|
|
152
|
+
'Slider',
|
|
153
|
+
'w-full',
|
|
154
|
+
'items-center',
|
|
155
|
+
),
|
|
156
|
+
inputClassName = clsx(
|
|
157
|
+
'Input',
|
|
158
|
+
'h-full',
|
|
159
|
+
'w-[60px]',
|
|
160
|
+
'mr-4',
|
|
161
|
+
'text-center',
|
|
162
|
+
'rounded-md',
|
|
163
|
+
styles.SLIDER_READOUT_FONTSIZE,
|
|
164
|
+
);
|
|
164
165
|
if (props.className) {
|
|
165
166
|
className += ' ' + props.className;
|
|
166
167
|
}
|