linear-react-components-ui 1.1.23 → 1.1.24-beta.0
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/@types/ColorStyles.d.ts +2 -1
- package/lib/@types/Position.d.ts +2 -1
- package/lib/BaseMask-3d5d581d.d.ts +24 -0
- package/lib/BaseNumber-797088d7.d.ts +23 -0
- package/lib/Cnpj-1602be21.d.ts +18 -0
- package/lib/Cpf-4d6b9079.d.ts +18 -0
- package/lib/Currency-b33d3a22.d.ts +18 -0
- package/lib/Decimal-55e836d5.d.ts +13 -0
- package/lib/Number-9c6aceff.d.ts +20 -0
- package/lib/Phone-79e5e3b4.d.ts +18 -0
- package/lib/ZipCode-8c2e9d8b.d.ts +13 -0
- package/lib/assets/styles/checkbox2.scss +199 -0
- package/lib/assets/styles/colorpicker.scss +1 -6
- package/lib/assets/styles/colors.scss +48 -12
- package/lib/assets/styles/datepicker2.scss +338 -0
- package/lib/assets/styles/selectfield.scss +409 -0
- package/lib/assets/styles/slot.scss +34 -0
- package/lib/assets/styles/textfield.scss +148 -0
- package/lib/buttons/ActivateButton.d.ts +1 -0
- package/lib/buttons/AddButton.d.ts +1 -0
- package/lib/buttons/Button.d.ts +1 -0
- package/lib/buttons/CancelButton.d.ts +1 -0
- package/lib/buttons/DangerButton.d.ts +1 -0
- package/lib/buttons/DefaultButton.d.ts +1 -0
- package/lib/buttons/DefaultButton.js +16 -11
- package/lib/buttons/DestroyButton.d.ts +1 -0
- package/lib/buttons/EditButton.d.ts +1 -0
- package/lib/buttons/InactivateButton.d.ts +1 -0
- package/lib/buttons/InfoButton.d.ts +1 -0
- package/lib/buttons/PrimaryButton.d.ts +1 -0
- package/lib/buttons/RestoreButton.d.ts +1 -0
- package/lib/buttons/SaveButton.d.ts +1 -0
- package/lib/buttons/SuccessButton.d.ts +1 -0
- package/lib/buttons/WarningButton.d.ts +1 -0
- package/lib/buttons/index.d.ts +1 -0
- package/lib/buttons/split_button/index.d.ts +1 -0
- package/lib/buttons/types.d.ts +2 -5
- package/lib/form/Field.d.ts +1 -1
- package/lib/form/FieldArray.d.ts +1 -1
- package/lib/form/FieldNumber.d.ts +1 -1
- package/lib/form/FieldPeriod.d.ts +1 -1
- package/lib/form/helpers.d.ts +1 -1
- package/lib/form/index.d.ts +1 -1
- package/lib/form/types.d.ts +1 -1
- package/lib/form/withFieldHOC.d.ts +1 -1
- package/lib/form/withFormSecurity.d.ts +1 -1
- package/lib/form2/helpers.d.ts +8 -0
- package/lib/form2/helpers.js +41 -0
- package/lib/form2/index.d.ts +9 -0
- package/lib/form2/index.js +36 -0
- package/lib/form2/types.d.ts +125 -0
- package/lib/form2/types.js +5 -0
- package/lib/form2/useForm/index.d.ts +5 -0
- package/lib/form2/useForm/index.js +203 -0
- package/lib/icons/helper.d.ts +4 -0
- package/lib/icons/helper.js +4 -0
- package/lib/icons/index.d.ts +4 -6
- package/lib/icons/index.js +14 -9
- package/lib/icons/types.d.ts +3 -6
- package/lib/index-18a64236.d.ts +23 -0
- package/lib/index-368f781f.d.ts +15 -0
- package/lib/index-43ad8140.d.ts +41 -0
- package/lib/index-772f9f1a.d.ts +44 -0
- package/lib/index-8a59cf4b.d.ts +23 -0
- package/lib/index-c9247c1f.d.ts +15 -0
- package/lib/index.d.ts +1 -0
- package/lib/inputs/base/InputTextBase.d.ts +1 -1
- package/lib/inputs/base/InputTextBase.js +18 -8
- package/lib/inputs/base/helpers.d.ts +1 -1
- package/lib/inputs/base/types.d.ts +5 -16
- package/lib/inputs/color/index.js +1 -1
- package/lib/inputs/color/types.d.ts +1 -1
- package/lib/inputs/date/Dialog.d.ts +1 -1
- package/lib/inputs/date/Dropdown.d.ts +1 -1
- package/lib/inputs/date/index.d.ts +1 -1
- package/lib/inputs/date/types.d.ts +2 -2
- package/lib/inputs/errorMessage/index.d.ts +1 -1
- package/lib/inputs/file/DefaultFile.d.ts +1 -1
- package/lib/inputs/file/DefaultFile.js +1 -1
- package/lib/inputs/file/DragDropFile.d.ts +1 -1
- package/lib/inputs/file/File.d.ts +1 -1
- package/lib/inputs/file/FileButtonSettings.d.ts +1 -1
- package/lib/inputs/file/helpers.d.ts +1 -1
- package/lib/inputs/file/index.d.ts +1 -1
- package/lib/inputs/file/types.d.ts +1 -1
- package/lib/inputs/inputHOC.d.ts +1 -1
- package/lib/inputs/mask/BaseMask.d.ts +1 -1
- package/lib/inputs/mask/Cnpj.d.ts +1 -1
- package/lib/inputs/mask/Cpf.d.ts +1 -1
- package/lib/inputs/mask/Phone.d.ts +1 -1
- package/lib/inputs/mask/ZipCode.d.ts +1 -1
- package/lib/inputs/mask/helpers.d.ts +1 -1
- package/lib/inputs/mask/index.d.ts +1 -1
- package/lib/inputs/mask/types.d.ts +2 -2
- package/lib/inputs/multiSelect/ActionButtons.d.ts +1 -1
- package/lib/inputs/multiSelect/Dropdown.d.ts +1 -1
- package/lib/inputs/multiSelect/helper.d.ts +1 -1
- package/lib/inputs/multiSelect/index.d.ts +1 -1
- package/lib/inputs/multiSelect/types.d.ts +2 -2
- package/lib/inputs/number/BaseNumber.d.ts +1 -1
- package/lib/inputs/number/Currency.d.ts +1 -1
- package/lib/inputs/number/Decimal.d.ts +1 -1
- package/lib/inputs/number/index.d.ts +1 -1
- package/lib/inputs/number/types.d.ts +3 -3
- package/lib/inputs/period/Dialog.d.ts +1 -1
- package/lib/inputs/period/Dropdown.d.ts +1 -1
- package/lib/inputs/period/PeriodList.d.ts +1 -1
- package/lib/inputs/period/helper.d.ts +1 -1
- package/lib/inputs/period/index.d.ts +1 -1
- package/lib/inputs/period/index.js +8 -10
- package/lib/inputs/period/types.d.ts +2 -5
- package/lib/inputs/search/index.d.ts +1 -1
- package/lib/inputs/select/ActionButtons.d.ts +1 -1
- package/lib/inputs/select/Dropdown.d.ts +1 -1
- package/lib/inputs/select/helper.d.ts +1 -1
- package/lib/inputs/select/index.d.ts +1 -1
- package/lib/inputs/select/multiple/Selecteds.d.ts +1 -1
- package/lib/inputs/select/multiple/index.d.ts +1 -1
- package/lib/inputs/select/simple/index.d.ts +1 -1
- package/lib/inputs/select/types.d.ts +1 -1
- package/lib/inputs/text/index.d.ts +1 -1
- package/lib/inputs/text/types.d.ts +2 -3
- package/lib/inputs/textarea/index.d.ts +1 -1
- package/lib/inputs/textarea/types.d.ts +1 -1
- package/lib/inputs/types.d.ts +1 -1
- package/lib/inputs2/checkboxfield/index.d.ts +7 -0
- package/lib/inputs2/checkboxfield/index.js +146 -0
- package/lib/inputs2/colorfield/index.d.ts +9 -0
- package/lib/inputs2/colorfield/index.js +119 -0
- package/lib/inputs2/date/base/constants.d.ts +7 -0
- package/lib/inputs2/date/base/constants.js +43 -0
- package/lib/inputs2/date/base/index.d.ts +12 -0
- package/lib/inputs2/date/base/index.js +179 -0
- package/lib/inputs2/date/datefield/calendarbox.d.ts +7 -0
- package/lib/inputs2/date/datefield/calendarbox.js +115 -0
- package/lib/inputs2/date/datefield/context.d.ts +13 -0
- package/lib/inputs2/date/datefield/context.js +15 -0
- package/lib/inputs2/date/datefield/index.d.ts +9 -0
- package/lib/inputs2/date/datefield/index.js +334 -0
- package/lib/inputs2/date/datefield/triggers.d.ts +8 -0
- package/lib/inputs2/date/datefield/triggers.js +47 -0
- package/lib/inputs2/date/datefield/types.d.ts +61 -0
- package/lib/inputs2/date/datefield/types.js +5 -0
- package/lib/inputs2/date/dateperiodfield/calendarbox.d.ts +7 -0
- package/lib/inputs2/date/dateperiodfield/calendarbox.js +136 -0
- package/lib/inputs2/date/dateperiodfield/context.d.ts +13 -0
- package/lib/inputs2/date/dateperiodfield/context.js +17 -0
- package/lib/inputs2/date/dateperiodfield/index.d.ts +9 -0
- package/lib/inputs2/date/dateperiodfield/index.js +592 -0
- package/lib/inputs2/date/dateperiodfield/triggers.d.ts +6 -0
- package/lib/inputs2/date/dateperiodfield/triggers.js +120 -0
- package/lib/inputs2/date/dateperiodfield/types.d.ts +99 -0
- package/lib/inputs2/date/dateperiodfield/types.js +19 -0
- package/lib/inputs2/date/helpers.d.ts +20 -0
- package/lib/inputs2/date/helpers.js +62 -0
- package/lib/inputs2/date/types.d.ts +59 -0
- package/lib/inputs2/date/types.js +19 -0
- package/lib/inputs2/index.d.ts +29 -0
- package/lib/inputs2/index.js +38 -0
- package/lib/inputs2/mask/BaseMask.d.ts +10 -0
- package/lib/inputs2/mask/BaseMask.js +95 -0
- package/lib/inputs2/mask/Cnpj.d.ts +11 -0
- package/lib/inputs2/mask/Cnpj.js +57 -0
- package/lib/inputs2/mask/Cpf.d.ts +11 -0
- package/lib/inputs2/mask/Cpf.js +53 -0
- package/lib/inputs2/mask/Phone.d.ts +11 -0
- package/lib/inputs2/mask/Phone.js +26 -0
- package/lib/inputs2/mask/ZipCode.d.ts +11 -0
- package/lib/inputs2/mask/ZipCode.js +23 -0
- package/lib/inputs2/mask/helpers.d.ts +4 -0
- package/lib/inputs2/mask/helpers.js +57 -0
- package/lib/inputs2/number/BaseNumber.d.ts +10 -0
- package/lib/inputs2/number/BaseNumber.js +86 -0
- package/lib/inputs2/number/Currency.d.ts +11 -0
- package/lib/inputs2/number/Currency.js +47 -0
- package/lib/inputs2/number/Decimal.d.ts +11 -0
- package/lib/inputs2/number/Decimal.js +36 -0
- package/lib/inputs2/number/Number.d.ts +9 -0
- package/lib/inputs2/number/Number.js +49 -0
- package/lib/inputs2/number/format_number.d.ts +5 -0
- package/lib/inputs2/number/format_number.js +29 -0
- package/lib/inputs2/selectfield/context.d.ts +38 -0
- package/lib/inputs2/selectfield/context.js +15 -0
- package/lib/inputs2/selectfield/helpers.d.ts +6 -0
- package/lib/inputs2/selectfield/helpers.js +25 -0
- package/lib/inputs2/selectfield/index.d.ts +10 -0
- package/lib/inputs2/selectfield/index.js +491 -0
- package/lib/inputs2/selectfield/item.d.ts +11 -0
- package/lib/inputs2/selectfield/item.js +85 -0
- package/lib/inputs2/selectfield/listbox.d.ts +7 -0
- package/lib/inputs2/selectfield/listbox.js +103 -0
- package/lib/inputs2/selectfield/search.d.ts +7 -0
- package/lib/inputs2/selectfield/search.js +71 -0
- package/lib/inputs2/selectfield/selections.d.ts +10 -0
- package/lib/inputs2/selectfield/selections.js +86 -0
- package/lib/inputs2/selectfield/triggers.d.ts +8 -0
- package/lib/inputs2/selectfield/triggers.js +100 -0
- package/lib/inputs2/selectfield/types.d.ts +55 -0
- package/lib/inputs2/selectfield/types.js +21 -0
- package/lib/inputs2/slot/index.d.ts +14 -0
- package/lib/inputs2/slot/index.js +47 -0
- package/lib/inputs2/textfield/index.d.ts +8 -0
- package/lib/inputs2/textfield/index.js +159 -0
- package/lib/internals/types.d.ts +1 -17
- package/lib/labels/DangerLabel.d.ts +1 -0
- package/lib/labels/DefaultLabel.d.ts +3 -5
- package/lib/labels/DefaultLabel.js +15 -7
- package/lib/labels/InfoLabel.d.ts +1 -0
- package/lib/labels/PrimaryLabel.d.ts +1 -0
- package/lib/labels/SuccessLabel.d.ts +1 -0
- package/lib/labels/WarningLabel.d.ts +1 -0
- package/lib/labels/index.d.ts +3 -2
- package/lib/labels/types.d.ts +2 -5
- package/lib/list/Header.d.ts +1 -0
- package/lib/list/Item.d.ts +3 -5
- package/lib/list/Item.js +17 -12
- package/lib/list/helpers.d.ts +1 -0
- package/lib/list/index.d.ts +1 -0
- package/lib/list/types.d.ts +4 -6
- package/lib/menus/sidenav/ExpandMenu.d.ts +2 -2
- package/lib/menus/sidenav/MenuLink.d.ts +4 -7
- package/lib/menus/sidenav/MenuLink.js +20 -11
- package/lib/menus/sidenav/NavMenuGroup.d.ts +2 -2
- package/lib/menus/sidenav/NavMenuItem.d.ts +4 -7
- package/lib/menus/sidenav/NavMenuItem.js +16 -12
- package/lib/menus/sidenav/NavSubMenuItem.d.ts +2 -2
- package/lib/menus/sidenav/helpers.d.ts +2 -2
- package/lib/menus/sidenav/index.d.ts +2 -2
- package/lib/menus/sidenav/popup_menu_search/EmptyList.d.ts +2 -2
- package/lib/menus/sidenav/popup_menu_search/index.d.ts +2 -2
- package/lib/menus/sidenav/types.d.ts +6 -6
- package/lib/popover/PopoverText.js +11 -2
- package/lib/popover/types.d.ts +1 -0
- package/lib/textContent/index.d.ts +6 -11
- package/lib/textContent/index.js +20 -11
- package/lib/tooltip/TooltipContent.d.ts +7 -0
- package/lib/tooltip/TooltipContent.js +65 -0
- package/lib/tooltip/index.d.ts +4 -3
- package/lib/tooltip/index.js +36 -53
- package/lib/tooltip/types.d.ts +25 -3
- package/lib/tooltip/useTooltip.d.ts +30 -0
- package/lib/tooltip/useTooltip.js +128 -0
- package/package.json +3 -2
- package/lib/inputs/base/Label.d.ts +0 -14
- package/lib/inputs/base/Label.js +0 -35
- package/lib/internals/withTooltip.d.ts +0 -12
- package/lib/internals/withTooltip.js +0 -172
|
@@ -43,9 +43,7 @@ const PeriodPicker = props => {
|
|
|
43
43
|
hintPosition = 'below',
|
|
44
44
|
themePopover = 'light',
|
|
45
45
|
popoverAlign = 'left',
|
|
46
|
-
gridLayout
|
|
47
|
-
nameDateInitial = 'valueInitial',
|
|
48
|
-
nameDateFinal = 'valueFinal'
|
|
46
|
+
gridLayout
|
|
49
47
|
} = props;
|
|
50
48
|
const idValueInitial = (0, _react.useId)();
|
|
51
49
|
const idValueFinal = (0, _react.useId)();
|
|
@@ -246,7 +244,7 @@ const PeriodPicker = props => {
|
|
|
246
244
|
name: changingAux
|
|
247
245
|
} = event.target;
|
|
248
246
|
if (value && value.replace(/\D/g, '').trim().length !== 0) {
|
|
249
|
-
if (changingAux ===
|
|
247
|
+
if (changingAux === 'valueInitial') {
|
|
250
248
|
setValueInitial(undefined);
|
|
251
249
|
} else {
|
|
252
250
|
setValueFinal(undefined);
|
|
@@ -270,21 +268,21 @@ const PeriodPicker = props => {
|
|
|
270
268
|
const dateObj = (0, _moment.default)(value, 'DD/MM/YYYY');
|
|
271
269
|
if (showCalendarValueInitial) inputInitialRef.current?.focus();
|
|
272
270
|
if (showCalendarValueFinal) inputFinalRef.current?.focus();
|
|
273
|
-
if (valueDateName ===
|
|
271
|
+
if (valueDateName === 'valueFinal' && valueInitial && dateObj.isBefore(valueInitial)) {
|
|
274
272
|
setValueInitial(dateObj);
|
|
275
273
|
setValueFinal(valueInitial);
|
|
276
274
|
onDateChange({
|
|
277
275
|
initial: dateObj,
|
|
278
276
|
final: valueInitial
|
|
279
277
|
});
|
|
280
|
-
} else if (valueDateName ===
|
|
278
|
+
} else if (valueDateName === 'valueInitial' && valueFinal && dateObj.isAfter(valueFinal)) {
|
|
281
279
|
setValueInitial(valueFinal);
|
|
282
280
|
setValueFinal(dateObj);
|
|
283
281
|
onDateChange({
|
|
284
282
|
initial: valueFinal,
|
|
285
283
|
final: dateObj
|
|
286
284
|
});
|
|
287
|
-
} else if (valueDateName ===
|
|
285
|
+
} else if (valueDateName === 'valueInitial') {
|
|
288
286
|
setValueInitial(dateObj);
|
|
289
287
|
onDateChange({
|
|
290
288
|
initial: dateObj,
|
|
@@ -297,7 +295,7 @@ const PeriodPicker = props => {
|
|
|
297
295
|
final: dateObj
|
|
298
296
|
});
|
|
299
297
|
}
|
|
300
|
-
if (valueDateName ===
|
|
298
|
+
if (valueDateName === 'valueInitial' && !valueFinal && shouldOpenDropdown) {
|
|
301
299
|
inputFinalRef.current?.focus();
|
|
302
300
|
setTimeout(() => setShowCalendarValueFinal(true), 100);
|
|
303
301
|
}
|
|
@@ -407,7 +405,7 @@ const PeriodPicker = props => {
|
|
|
407
405
|
handlerClose: () => onCloseDateDialog('valueInitial'),
|
|
408
406
|
dialogSize: dialogSize,
|
|
409
407
|
onOpenChange: setShowCalendarValueInitial
|
|
410
|
-
}, getCalendar(valueInitial, calendarColorStyle,
|
|
408
|
+
}, getCalendar(valueInitial, calendarColorStyle, 'valueInitial'));
|
|
411
409
|
}
|
|
412
410
|
return /*#__PURE__*/_react.default.createElement(_Dropdown.default, {
|
|
413
411
|
containerRef: wrapperBaseInputPeriodRef,
|
|
@@ -426,7 +424,7 @@ const PeriodPicker = props => {
|
|
|
426
424
|
handlerClose: () => onCloseDateDialog('valueFinal'),
|
|
427
425
|
dialogSize: dialogSize,
|
|
428
426
|
onOpenChange: setShowCalendarValueFinal
|
|
429
|
-
}, getCalendar(valueFinal, calendarColorStyle,
|
|
427
|
+
}, getCalendar(valueFinal, calendarColorStyle, 'valueFinal'));
|
|
430
428
|
}
|
|
431
429
|
return /*#__PURE__*/_react.default.createElement(_Dropdown.default, {
|
|
432
430
|
containerRef: wrapperBaseInputPeriodRef,
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { Moment } from 'moment';
|
|
2
|
-
import { ReactNode, RefObject
|
|
2
|
+
import { ReactNode, RefObject } from 'react';
|
|
3
3
|
import { ColorStyles } from '../../@types/ColorStyles.js';
|
|
4
4
|
import { Period } from '../../@types/Period.js';
|
|
5
5
|
import { PermissionAttr } from '../../@types/PermissionAttr.js';
|
|
6
6
|
import { CustomInputEvent } from '../base/types.js';
|
|
7
7
|
import '../../@types/Align.js';
|
|
8
|
-
import '../../
|
|
8
|
+
import '../../tooltip/types.js';
|
|
9
9
|
import '../../@types/Position.js';
|
|
10
10
|
|
|
11
11
|
type DateTypes = 'today' | 'week' | 'lastweek' | 'last15' | 'month' | 'lastmonth';
|
|
@@ -55,14 +55,11 @@ interface IPeriodPickerProps {
|
|
|
55
55
|
calendarColorStyle?: ColorStyles;
|
|
56
56
|
required?: boolean;
|
|
57
57
|
onChange?: (event?: CustomInputEvent, maskValue?: string, date?: Period) => void;
|
|
58
|
-
onClick?: (event?: MouseEvent) => void;
|
|
59
58
|
disabled?: boolean;
|
|
60
59
|
permissionAttr?: PermissionAttr;
|
|
61
60
|
errorMessages?: string[];
|
|
62
61
|
name?: string;
|
|
63
62
|
hint?: string;
|
|
64
|
-
nameDateInitial?: string;
|
|
65
|
-
nameDateFinal?: string;
|
|
66
63
|
hintPosition?: 'below' | 'onLabelRight';
|
|
67
64
|
onBlur?: (e: CustomInputEvent) => void;
|
|
68
65
|
onFocus?: (e: CustomInputEvent) => void;
|
|
@@ -5,7 +5,7 @@ import '../../@types/DataCombo.js';
|
|
|
5
5
|
import '../base/types.js';
|
|
6
6
|
import '../../@types/Align.js';
|
|
7
7
|
import '../../@types/Period.js';
|
|
8
|
-
import '../../
|
|
8
|
+
import '../../tooltip/types.js';
|
|
9
9
|
import '../../@types/Position.js';
|
|
10
10
|
import '../../drawer/types.js';
|
|
11
11
|
import '../../@types/Icon.js';
|
|
@@ -5,7 +5,7 @@ import '../../@types/DataCombo.js';
|
|
|
5
5
|
import '../base/types.js';
|
|
6
6
|
import '../../@types/Align.js';
|
|
7
7
|
import '../../@types/Period.js';
|
|
8
|
-
import '../../
|
|
8
|
+
import '../../tooltip/types.js';
|
|
9
9
|
import '../../@types/Position.js';
|
|
10
10
|
import '../../drawer/types.js';
|
|
11
11
|
import '../../@types/Icon.js';
|
|
@@ -5,7 +5,7 @@ import '../../@types/DataCombo.js';
|
|
|
5
5
|
import '../base/types.js';
|
|
6
6
|
import '../../@types/Align.js';
|
|
7
7
|
import '../../@types/Period.js';
|
|
8
|
-
import '../../
|
|
8
|
+
import '../../tooltip/types.js';
|
|
9
9
|
import '../../@types/Position.js';
|
|
10
10
|
import '../../drawer/types.js';
|
|
11
11
|
import '../../@types/Icon.js';
|
|
@@ -6,7 +6,7 @@ import '../../@types/DataCombo.js';
|
|
|
6
6
|
import '../base/types.js';
|
|
7
7
|
import '../../@types/Align.js';
|
|
8
8
|
import '../../@types/Period.js';
|
|
9
|
-
import '../../
|
|
9
|
+
import '../../tooltip/types.js';
|
|
10
10
|
import '../../@types/Position.js';
|
|
11
11
|
import '../../drawer/types.js';
|
|
12
12
|
import '../../@types/Icon.js';
|
|
@@ -5,7 +5,7 @@ import '../../@types/PermissionAttr.js';
|
|
|
5
5
|
import '../base/types.js';
|
|
6
6
|
import 'react';
|
|
7
7
|
import '../../@types/Period.js';
|
|
8
|
-
import '../../
|
|
8
|
+
import '../../tooltip/types.js';
|
|
9
9
|
import '../../@types/Position.js';
|
|
10
10
|
|
|
11
11
|
declare const SelectField: (props: ISelectFieldProps) => JSX.Element;
|
|
@@ -5,7 +5,7 @@ import '../../../@types/PermissionAttr.js';
|
|
|
5
5
|
import '../../base/types.js';
|
|
6
6
|
import 'react';
|
|
7
7
|
import '../../../@types/Period.js';
|
|
8
|
-
import '../../../
|
|
8
|
+
import '../../../tooltip/types.js';
|
|
9
9
|
import '../../../@types/Position.js';
|
|
10
10
|
|
|
11
11
|
declare const Selecteds: ({ currents, descriptionKey, idKey, disabled, handlerOnUnselect, }: ISelectedsMultipleProps) => JSX.Element;
|
|
@@ -5,7 +5,7 @@ import '../../../@types/PermissionAttr.js';
|
|
|
5
5
|
import '../../base/types.js';
|
|
6
6
|
import 'react';
|
|
7
7
|
import '../../../@types/Period.js';
|
|
8
|
-
import '../../../
|
|
8
|
+
import '../../../tooltip/types.js';
|
|
9
9
|
import '../../../@types/Position.js';
|
|
10
10
|
|
|
11
11
|
declare const MultipleSelect: (props: IMultipleSelectProps) => JSX.Element;
|
|
@@ -5,7 +5,7 @@ import '../../../@types/PermissionAttr.js';
|
|
|
5
5
|
import '../../base/types.js';
|
|
6
6
|
import 'react';
|
|
7
7
|
import '../../../@types/Period.js';
|
|
8
|
-
import '../../../
|
|
8
|
+
import '../../../tooltip/types.js';
|
|
9
9
|
import '../../../@types/Position.js';
|
|
10
10
|
|
|
11
11
|
declare const SimpleSelect: (props: ISimpleSelectProps) => JSX.Element;
|
|
@@ -4,7 +4,7 @@ import { PermissionAttr } from '../../@types/PermissionAttr.js';
|
|
|
4
4
|
import { CustomInputEvent } from '../base/types.js';
|
|
5
5
|
import { MutableRefObject } from 'react';
|
|
6
6
|
import '../../@types/Period.js';
|
|
7
|
-
import '../../
|
|
7
|
+
import '../../tooltip/types.js';
|
|
8
8
|
import '../../@types/Position.js';
|
|
9
9
|
|
|
10
10
|
type AllOptions = {
|
|
@@ -4,7 +4,7 @@ import '../../@types/PermissionAttr.js';
|
|
|
4
4
|
import '../base/types.js';
|
|
5
5
|
import 'react';
|
|
6
6
|
import '../../@types/Align.js';
|
|
7
|
-
import '../../
|
|
7
|
+
import '../../tooltip/types.js';
|
|
8
8
|
import '../../@types/Position.js';
|
|
9
9
|
|
|
10
10
|
declare const TextField: (props: ITextField) => JSX.Element;
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import { Period } from '../../@types/Period.js';
|
|
2
2
|
import { PermissionAttr } from '../../@types/PermissionAttr.js';
|
|
3
3
|
import { IBaseProps, CustomInputEvent } from '../base/types.js';
|
|
4
|
-
import { WithTooltipProps } from '../../internals/types.js';
|
|
5
4
|
import 'react';
|
|
6
5
|
import '../../@types/Align.js';
|
|
6
|
+
import '../../tooltip/types.js';
|
|
7
7
|
import '../../@types/Position.js';
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
interface ITextField extends IBaseProps, CommonProperties {
|
|
9
|
+
interface ITextField extends IBaseProps {
|
|
11
10
|
value?: string | string[];
|
|
12
11
|
required?: boolean;
|
|
13
12
|
name?: string;
|
|
@@ -4,7 +4,7 @@ import 'react';
|
|
|
4
4
|
import '../../@types/Align.js';
|
|
5
5
|
import '../../@types/Period.js';
|
|
6
6
|
import '../../@types/PermissionAttr.js';
|
|
7
|
-
import '../../
|
|
7
|
+
import '../../tooltip/types.js';
|
|
8
8
|
import '../../@types/Position.js';
|
|
9
9
|
|
|
10
10
|
declare const TextArea: (props: ITextAreaProps) => JSX.Element;
|
|
@@ -3,7 +3,7 @@ import 'react';
|
|
|
3
3
|
import '../../@types/Align.js';
|
|
4
4
|
import '../../@types/Period.js';
|
|
5
5
|
import '../../@types/PermissionAttr.js';
|
|
6
|
-
import '../../
|
|
6
|
+
import '../../tooltip/types.js';
|
|
7
7
|
import '../../@types/Position.js';
|
|
8
8
|
|
|
9
9
|
interface ITextAreaProps extends IBaseProps {
|
package/lib/inputs/types.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ import { IBaseProps, CustomInputEvent } from './base/types.js';
|
|
|
5
5
|
import { IDrawerProps } from '../drawer/types.js';
|
|
6
6
|
import { TextAlign } from '../@types/Align.js';
|
|
7
7
|
import '../@types/Period.js';
|
|
8
|
-
import '../
|
|
8
|
+
import '../tooltip/types.js';
|
|
9
9
|
import '../@types/Position.js';
|
|
10
10
|
import '../@types/Icon.js';
|
|
11
11
|
import '../icons/helper.js';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import 'react';
|
|
2
|
+
import '../../@types/Size.js';
|
|
3
|
+
import '../../@types/ColorStyles.js';
|
|
4
|
+
import '../../tooltip/types.js';
|
|
5
|
+
import '../../@types/Position.js';
|
|
6
|
+
import '../../@types/PermissionAttr.js';
|
|
7
|
+
export { C as CheckboxFieldInputProps, I as Input } from '../../index-43ad8140.js';
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.Input = void 0;
|
|
7
|
+
require("../../assets/styles/checkbox2.scss");
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
var _lodash = _interopRequireDefault(require("lodash"));
|
|
10
|
+
var _hint = _interopRequireDefault(require("../../hint"));
|
|
11
|
+
var _icons = _interopRequireDefault(require("../../icons"));
|
|
12
|
+
var _gridlayout = _interopRequireDefault(require("../../gridlayout"));
|
|
13
|
+
var _popover = _interopRequireWildcard(require("../../popover"));
|
|
14
|
+
var _tooltip = require("../../tooltip");
|
|
15
|
+
var _permissionValidations = require("../../permissionValidations");
|
|
16
|
+
const _excluded = ["name", "label", "errors", "onChange", "size", "onDeniedActions", "permissionAttr", "variant", "customClass", "customClassLabel", "customClassWrapper", "labelUppercase", "rounded", "customClassInputContainer", "skeletonize", "hintPosition", "gridLayout", "themePopover", "popoverAlign", "tooltip", "tooltipPosition", "tooltipWidth"];
|
|
17
|
+
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); }
|
|
18
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
19
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
20
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
21
|
+
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
22
|
+
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
23
|
+
const options = [_permissionValidations.OPTIONS_ON_DENIED.disabled, _permissionValidations.OPTIONS_ON_DENIED.unvisible, _permissionValidations.OPTIONS_ON_DENIED.readOnly, _permissionValidations.OPTIONS_ON_DENIED.hideContent];
|
|
24
|
+
const Input = exports.Input = /*#__PURE__*/_react.default.forwardRef((props, ref) => {
|
|
25
|
+
const {
|
|
26
|
+
name,
|
|
27
|
+
label,
|
|
28
|
+
errors,
|
|
29
|
+
onChange,
|
|
30
|
+
size = 'default',
|
|
31
|
+
onDeniedActions = undefined,
|
|
32
|
+
permissionAttr = undefined,
|
|
33
|
+
variant = 'default',
|
|
34
|
+
customClass = '',
|
|
35
|
+
customClassLabel = '',
|
|
36
|
+
customClassWrapper = '',
|
|
37
|
+
labelUppercase = false,
|
|
38
|
+
rounded = false,
|
|
39
|
+
customClassInputContainer = '',
|
|
40
|
+
skeletonize = false,
|
|
41
|
+
hintPosition = 'below',
|
|
42
|
+
gridLayout = undefined,
|
|
43
|
+
themePopover = 'light',
|
|
44
|
+
popoverAlign = 'left',
|
|
45
|
+
tooltip,
|
|
46
|
+
tooltipPosition,
|
|
47
|
+
tooltipWidth
|
|
48
|
+
} = props,
|
|
49
|
+
rest = _objectWithoutProperties(props, _excluded);
|
|
50
|
+
const onDenied = _react.default.useMemo(() => {
|
|
51
|
+
return onDeniedActions || (0, _permissionValidations.actionsOnPermissionDenied)(options, permissionAttr);
|
|
52
|
+
}, [onDeniedActions, permissionAttr]);
|
|
53
|
+
const {
|
|
54
|
+
hideContent,
|
|
55
|
+
unvisible
|
|
56
|
+
} = onDenied;
|
|
57
|
+
const inputId = _react.default.useMemo(() => props.id || `checkboxfield-${name}`, [props.id, name]);
|
|
58
|
+
const inputRootRef = _react.default.useRef(null);
|
|
59
|
+
const isChecked = props.checked ?? Boolean(props.value);
|
|
60
|
+
const hasLabel = !_lodash.default.isEmpty(props?.label);
|
|
61
|
+
const isReadOnly = Boolean(props.readOnly || onDenied.readOnly);
|
|
62
|
+
const isDisabled = Boolean(props.disabled || onDenied.disabled);
|
|
63
|
+
const hasHintMessages = Boolean(props.hint?.length);
|
|
64
|
+
const hasValidationErrors = Boolean(errors?.length);
|
|
65
|
+
const handleOnChange = _react.default.useCallback(event => {
|
|
66
|
+
if (isReadOnly || isDisabled) return;
|
|
67
|
+
Object.defineProperty(event.target, 'value', {
|
|
68
|
+
value: event.target.checked,
|
|
69
|
+
writable: true,
|
|
70
|
+
enumerable: true,
|
|
71
|
+
configurable: true
|
|
72
|
+
});
|
|
73
|
+
onChange?.(event);
|
|
74
|
+
}, [isReadOnly, isDisabled, onChange]);
|
|
75
|
+
if (unvisible || hideContent) return null;
|
|
76
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_gridlayout.default, {
|
|
77
|
+
cols: gridLayout
|
|
78
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
79
|
+
ref: inputRootRef,
|
|
80
|
+
className: `checkbox-field-root ${customClassWrapper}`,
|
|
81
|
+
"data-state-error": hasValidationErrors
|
|
82
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
83
|
+
"data-state-skeletonize": skeletonize,
|
|
84
|
+
className: `container ${customClassInputContainer}`
|
|
85
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
86
|
+
className: "input-root"
|
|
87
|
+
}, /*#__PURE__*/_react.default.createElement("input", _extends({
|
|
88
|
+
ref: ref,
|
|
89
|
+
id: inputId,
|
|
90
|
+
name: name,
|
|
91
|
+
readOnly: isReadOnly,
|
|
92
|
+
disabled: isDisabled,
|
|
93
|
+
className: `input ${customClass}`,
|
|
94
|
+
tabIndex: !isReadOnly ? 0 : -1,
|
|
95
|
+
"data-state-size": size,
|
|
96
|
+
"data-state-error": hasValidationErrors,
|
|
97
|
+
"data-state-variant": variant,
|
|
98
|
+
"data-state-rounded": rounded,
|
|
99
|
+
"data-state-read-only": isReadOnly,
|
|
100
|
+
"data-state-skeletonize": skeletonize
|
|
101
|
+
}, rest, {
|
|
102
|
+
type: "checkbox",
|
|
103
|
+
checked: isChecked,
|
|
104
|
+
onChange: handleOnChange
|
|
105
|
+
})), /*#__PURE__*/_react.default.createElement(_icons.default, {
|
|
106
|
+
customClass: "checkmark",
|
|
107
|
+
name: "checkmark",
|
|
108
|
+
colorStyle: "default"
|
|
109
|
+
})), hasLabel && /*#__PURE__*/_react.default.createElement("label", {
|
|
110
|
+
className: `label ${customClassLabel}`,
|
|
111
|
+
title: label,
|
|
112
|
+
htmlFor: inputId,
|
|
113
|
+
"aria-readonly": isReadOnly,
|
|
114
|
+
"aria-disabled": isDisabled,
|
|
115
|
+
"data-state-skeletonize": skeletonize,
|
|
116
|
+
"data-state-disabled": isDisabled,
|
|
117
|
+
"data-state-read-only": isReadOnly,
|
|
118
|
+
"data-state-uppercase": labelUppercase,
|
|
119
|
+
"data-state-input-required": props.required
|
|
120
|
+
}, label), hasLabel && hasHintMessages && hintPosition === 'onLabelRight' && !skeletonize && /*#__PURE__*/_react.default.createElement(_popover.default, {
|
|
121
|
+
customClass: "label-popover",
|
|
122
|
+
theme: themePopover,
|
|
123
|
+
align: popoverAlign,
|
|
124
|
+
iconColor: "#03bde2"
|
|
125
|
+
}, /*#__PURE__*/_react.default.createElement(_popover.PopoverText, {
|
|
126
|
+
text: props?.hint
|
|
127
|
+
}))), hintPosition === 'below' && /*#__PURE__*/_react.default.createElement(_hint.default, {
|
|
128
|
+
customClass: "hint",
|
|
129
|
+
description: props.hint,
|
|
130
|
+
disabled: isDisabled,
|
|
131
|
+
skeletonize: skeletonize,
|
|
132
|
+
visible: hasHintMessages
|
|
133
|
+
}), hasValidationErrors && /*#__PURE__*/_react.default.createElement("span", {
|
|
134
|
+
className: "error",
|
|
135
|
+
"data-state-skeletonize": skeletonize,
|
|
136
|
+
"aria-describedby": String(name).concat('-errors')
|
|
137
|
+
}, errors?.map((error, index) => /*#__PURE__*/_react.default.createElement(_react.default.Fragment, {
|
|
138
|
+
key: `${index + 1}-${error}`
|
|
139
|
+
}, error, "\xA0"))))), /*#__PURE__*/_react.default.createElement(_tooltip.Tooltip, {
|
|
140
|
+
targetRef: inputRootRef,
|
|
141
|
+
text: tooltip,
|
|
142
|
+
width: tooltipWidth,
|
|
143
|
+
position: tooltipPosition
|
|
144
|
+
}));
|
|
145
|
+
});
|
|
146
|
+
Input.displayName = 'CheckboxFieldInput';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import 'react';
|
|
2
|
+
export { LeftSlot, RightSlot } from '../slot/index.js';
|
|
3
|
+
import '../../index-772f9f1a.js';
|
|
4
|
+
export { C as ColorFieldInputProps, I as Input } from '../../index-8a59cf4b.js';
|
|
5
|
+
import '../../@types/Align.js';
|
|
6
|
+
import '../../@types/ColorStyles.js';
|
|
7
|
+
import '../../@types/Position.js';
|
|
8
|
+
import '../../@types/PermissionAttr.js';
|
|
9
|
+
import '../../tooltip/types.js';
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.Input = void 0;
|
|
7
|
+
Object.defineProperty(exports, "LeftSlot", {
|
|
8
|
+
enumerable: true,
|
|
9
|
+
get: function () {
|
|
10
|
+
return _slot.LeftSlot;
|
|
11
|
+
}
|
|
12
|
+
});
|
|
13
|
+
Object.defineProperty(exports, "RightSlot", {
|
|
14
|
+
enumerable: true,
|
|
15
|
+
get: function () {
|
|
16
|
+
return _slot.RightSlot;
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
require("../../assets/styles/colorpicker.scss");
|
|
20
|
+
var _react = _interopRequireDefault(require("react"));
|
|
21
|
+
var _slot = require("../slot");
|
|
22
|
+
var TextField = _interopRequireWildcard(require("../textfield"));
|
|
23
|
+
var _buttons = _interopRequireDefault(require("../../../lib/buttons"));
|
|
24
|
+
var _permissionValidations = require("../../../lib/permissionValidations");
|
|
25
|
+
const _excluded = ["name", "isTypeText", "defaultValue", "onChange", "permissionAttr", "onDeniedActions"];
|
|
26
|
+
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); }
|
|
27
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
28
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
29
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
30
|
+
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
31
|
+
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
32
|
+
const options = [_permissionValidations.OPTIONS_ON_DENIED.disabled, _permissionValidations.OPTIONS_ON_DENIED.unvisible, _permissionValidations.OPTIONS_ON_DENIED.readOnly, _permissionValidations.OPTIONS_ON_DENIED.hideContent];
|
|
33
|
+
const Input = exports.Input = /*#__PURE__*/_react.default.forwardRef((props, ref) => {
|
|
34
|
+
const {
|
|
35
|
+
name,
|
|
36
|
+
isTypeText = true,
|
|
37
|
+
defaultValue = '',
|
|
38
|
+
onChange,
|
|
39
|
+
permissionAttr = undefined,
|
|
40
|
+
onDeniedActions = undefined
|
|
41
|
+
} = props,
|
|
42
|
+
restProps = _objectWithoutProperties(props, _excluded);
|
|
43
|
+
const inputRefText = _react.default.useRef(null);
|
|
44
|
+
const inputRefColor = _react.default.useRef(null);
|
|
45
|
+
const mirrorRef = _react.default.useRef(null);
|
|
46
|
+
const onDenied = _react.default.useMemo(() => {
|
|
47
|
+
return onDeniedActions || (0, _permissionValidations.actionsOnPermissionDenied)(options, permissionAttr);
|
|
48
|
+
}, [onDeniedActions, permissionAttr]);
|
|
49
|
+
const {
|
|
50
|
+
hideContent,
|
|
51
|
+
unvisible
|
|
52
|
+
} = onDenied;
|
|
53
|
+
const syncColorValues = _react.default.useCallback(value => {
|
|
54
|
+
if (mirrorRef.current) {
|
|
55
|
+
mirrorRef.current.style.backgroundColor = value;
|
|
56
|
+
}
|
|
57
|
+
if (inputRefText.current && inputRefText.current.value !== value) {
|
|
58
|
+
inputRefText.current.value = value;
|
|
59
|
+
}
|
|
60
|
+
if (inputRefColor.current && inputRefColor.current.value !== value) {
|
|
61
|
+
inputRefColor.current.value = value;
|
|
62
|
+
}
|
|
63
|
+
}, []);
|
|
64
|
+
const handleTextInputChange = e => {
|
|
65
|
+
const newValue = e.target.value;
|
|
66
|
+
syncColorValues(newValue);
|
|
67
|
+
onChange?.(e);
|
|
68
|
+
};
|
|
69
|
+
const handleColorInputChange = e => {
|
|
70
|
+
const newValue = e.target.value;
|
|
71
|
+
syncColorValues(newValue);
|
|
72
|
+
onChange?.(e);
|
|
73
|
+
};
|
|
74
|
+
const onPaletteButtonClick = () => {
|
|
75
|
+
inputRefColor.current?.click();
|
|
76
|
+
};
|
|
77
|
+
_react.default.useLayoutEffect(() => {
|
|
78
|
+
syncColorValues(String(defaultValue));
|
|
79
|
+
}, [defaultValue, syncColorValues]);
|
|
80
|
+
if (unvisible || hideContent) return null;
|
|
81
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(TextField.Input, _extends({}, restProps, {
|
|
82
|
+
ref: ref,
|
|
83
|
+
name: name,
|
|
84
|
+
type: isTypeText ? 'text' : 'color',
|
|
85
|
+
defaultValue: String(defaultValue),
|
|
86
|
+
style: {
|
|
87
|
+
borderLeft: '1px solid #eeee'
|
|
88
|
+
},
|
|
89
|
+
onChange: handleTextInputChange
|
|
90
|
+
}), isTypeText && /*#__PURE__*/_react.default.createElement(_slot.LeftSlot, null, /*#__PURE__*/_react.default.createElement("div", {
|
|
91
|
+
style: {
|
|
92
|
+
backgroundColor: String(defaultValue)
|
|
93
|
+
},
|
|
94
|
+
ref: mirrorRef,
|
|
95
|
+
className: "colorpicker-colormirror"
|
|
96
|
+
})), isTypeText && /*#__PURE__*/_react.default.createElement(_slot.RightSlot, null, /*#__PURE__*/_react.default.createElement(_buttons.default, {
|
|
97
|
+
className: "colorpicker-palettebutton",
|
|
98
|
+
onClick: onPaletteButtonClick,
|
|
99
|
+
onKeyDown: e => {
|
|
100
|
+
if (e.code === 'Space' || e.key === ' ') {
|
|
101
|
+
e.preventDefault();
|
|
102
|
+
onPaletteButtonClick();
|
|
103
|
+
}
|
|
104
|
+
},
|
|
105
|
+
iconName: "pallete"
|
|
106
|
+
}))), isTypeText && /*#__PURE__*/_react.default.createElement("input", {
|
|
107
|
+
ref: inputRefColor,
|
|
108
|
+
type: "color",
|
|
109
|
+
style: {
|
|
110
|
+
position: 'absolute',
|
|
111
|
+
opacity: 0,
|
|
112
|
+
pointerEvents: 'none'
|
|
113
|
+
},
|
|
114
|
+
defaultValue: String(defaultValue),
|
|
115
|
+
onChange: handleColorInputChange,
|
|
116
|
+
tabIndex: -1
|
|
117
|
+
}));
|
|
118
|
+
});
|
|
119
|
+
Input.displayName = 'ColorFieldInput';
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.useCalendarPosition = void 0;
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
9
|
+
const useCalendarPosition = (calendarBoxOpen, containerRef) => {
|
|
10
|
+
const [calendarBoxStyles, setCalendarBoxStyles] = _react.default.useState({});
|
|
11
|
+
_react.default.useEffect(() => {
|
|
12
|
+
const updatePosition = () => {
|
|
13
|
+
const selectPositionOnScreen = containerRef.current?.getBoundingClientRect();
|
|
14
|
+
if (selectPositionOnScreen) {
|
|
15
|
+
const {
|
|
16
|
+
top,
|
|
17
|
+
left,
|
|
18
|
+
width,
|
|
19
|
+
height
|
|
20
|
+
} = selectPositionOnScreen;
|
|
21
|
+
setCalendarBoxStyles({
|
|
22
|
+
top: top + height + window.scrollY,
|
|
23
|
+
left: left + window.scrollX,
|
|
24
|
+
width: width,
|
|
25
|
+
position: 'absolute'
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
if (calendarBoxOpen) {
|
|
30
|
+
updatePosition();
|
|
31
|
+
window.addEventListener('resize', updatePosition);
|
|
32
|
+
window.addEventListener('scroll', updatePosition, true);
|
|
33
|
+
}
|
|
34
|
+
return () => {
|
|
35
|
+
window.removeEventListener('resize', updatePosition);
|
|
36
|
+
window.removeEventListener('scroll', updatePosition, true);
|
|
37
|
+
};
|
|
38
|
+
}, [calendarBoxOpen, containerRef]);
|
|
39
|
+
return {
|
|
40
|
+
calendarBoxStyles
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
exports.useCalendarPosition = useCalendarPosition;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React__default from 'react';
|
|
2
|
+
import { BaseDateInputRootProps, BaseDateInputLabelProps, BaseDateInputContainerProps, BaseDateInputProps, BaseDateInputTriggersProps } from '../types.js';
|
|
3
|
+
import '../../../@types/ColorStyles.js';
|
|
4
|
+
import '../../../@types/Position.js';
|
|
5
|
+
|
|
6
|
+
declare const Root: React__default.ForwardRefExoticComponent<BaseDateInputRootProps & React__default.RefAttributes<HTMLDivElement>>;
|
|
7
|
+
declare const Label: React__default.ForwardRefExoticComponent<BaseDateInputLabelProps & React__default.RefAttributes<HTMLSpanElement>>;
|
|
8
|
+
declare const Container: React__default.ForwardRefExoticComponent<BaseDateInputContainerProps & React__default.RefAttributes<HTMLDivElement>>;
|
|
9
|
+
declare const Input: React__default.ForwardRefExoticComponent<BaseDateInputProps & React__default.RefAttributes<HTMLInputElement>>;
|
|
10
|
+
declare const Triggers: React__default.ForwardRefExoticComponent<BaseDateInputTriggersProps & React__default.RefAttributes<HTMLDivElement>>;
|
|
11
|
+
|
|
12
|
+
export { Container, Input, Label, Root, Triggers };
|