@povio/ui 3.3.0-rc.3 → 3.3.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/README.md +15 -1
- package/dist/components/Breadcrumbs/Breadcrumbs.js +55 -206
- package/dist/components/buttons/Button/button.cva.d.ts +1 -1
- package/dist/components/buttons/InlineIconButton/InlineIconButton.js +9 -34
- package/dist/components/buttons/shared/ButtonContent.js +22 -80
- package/dist/components/inputs/Checkbox/CheckboxCheckmark.js +10 -24
- package/dist/components/inputs/Checkbox/CheckboxGroup.d.ts +5 -1
- package/dist/components/inputs/Checkbox/CheckboxGroup.js +234 -201
- package/dist/components/inputs/DateTime/DatePicker/DatePicker.js +93 -227
- package/dist/components/inputs/DateTime/DateRangePicker/DateRangePicker.d.ts +1 -0
- package/dist/components/inputs/DateTime/DateRangePicker/DateRangePicker.js +170 -273
- package/dist/components/inputs/DateTime/DateTimePicker/DateTimePicker.js +60 -147
- package/dist/components/inputs/DateTime/shared/Calendar.js +139 -339
- package/dist/components/inputs/DateTime/shared/CalendarCell.js +114 -308
- package/dist/components/inputs/DateTime/shared/CalendarGrid.js +35 -150
- package/dist/components/inputs/DateTime/shared/CalendarHeader.js +95 -229
- package/dist/components/inputs/DateTime/shared/CalendarSelectHeader.js +115 -296
- package/dist/components/inputs/DateTime/shared/DateField.js +135 -301
- package/dist/components/inputs/DateTime/shared/DatePickerInput.js +142 -338
- package/dist/components/inputs/DateTime/shared/DateTimeDialogFooter.js +10 -59
- package/dist/components/inputs/DateTime/shared/TimePickerInput.js +144 -134
- package/dist/components/inputs/DateTime/shared/useFirefoxDateSegmentSelectionGuard.d.ts +2 -0
- package/dist/components/inputs/DateTime/shared/useFirefoxDateSegmentSelectionGuard.js +33 -0
- package/dist/components/inputs/File/FileUpload.js +1 -1
- package/dist/components/inputs/File/InputUpload.js +65 -261
- package/dist/components/inputs/File/shared/FileUploadContentEmpty.js +48 -180
- package/dist/components/inputs/File/shared/FileUploadContentError.js +95 -265
- package/dist/components/inputs/File/shared/FileUploadContentFilled.js +99 -261
- package/dist/components/inputs/File/shared/FileUploadContentLoading.js +56 -234
- package/dist/components/inputs/File/shared/ProgressBar.js +15 -102
- package/dist/components/inputs/FormField/FormField.js +34 -47
- package/dist/components/inputs/Input/NumberInput/NumberInput.js +2 -1
- package/dist/components/inputs/Input/NumberRangeInput/NumberRangeInput.js +77 -314
- package/dist/components/inputs/Selection/Autocomplete/Autocomplete.js +23 -83
- package/dist/components/inputs/Selection/Autocomplete/QueryAutocomplete.js +56 -2
- package/dist/components/inputs/Selection/Select/QuerySelect.js +82 -94
- package/dist/components/inputs/Selection/Select/Select.js +3 -3
- package/dist/components/inputs/Selection/shared/SelectInput.js +1 -0
- package/dist/components/inputs/Selection/shared/SelectListBox.js +51 -163
- package/dist/components/inputs/Selection/shared/querySelect.utils.d.ts +1 -0
- package/dist/components/inputs/Selection/shared/querySelect.utils.js +1 -0
- package/dist/components/inputs/Selection/shared/select.context.js +19 -9
- package/dist/components/inputs/Selection/shared/useSelectItems.js +48 -108
- package/dist/components/inputs/Skeleton/InputFrame.js +177 -552
- package/dist/components/inputs/TextEditor/TextEditor.js +87 -389
- package/dist/components/inputs/shared/InputClear.js +24 -40
- package/dist/components/inputs/shared/input.cva.js +1 -1
- package/dist/components/navigation/Accordion/Accordion.js +22 -69
- package/dist/components/navigation/Accordion/AccordionItem.js +41 -86
- package/dist/components/navigation/Stepper/Stepper.js +22 -67
- package/dist/components/overlays/ActionModal/ActionModal.js +35 -169
- package/dist/components/overlays/ResponsivePopover/ResponsivePopover.js +29 -110
- package/dist/components/shared/pagination/Pagination.js +22 -108
- package/dist/components/shared/pagination/minWidth.cva.d.ts +1 -1
- package/dist/components/status/Alert/Alert.js +30 -97
- package/dist/components/table/InfiniteTable.js +16 -67
- package/dist/components/table/Table.d.ts +2 -8
- package/dist/components/table/Table.js +33 -55
- package/dist/components/text/Typography/Typography.js +8 -23
- package/dist/config/confirmation.context.js +1 -1
- package/dist/config/theme.context.js +45 -98
- package/dist/config/uiConfig.context.d.ts +1 -0
- package/dist/config/uiConfig.context.js +10 -40
- package/dist/config/uiOverrides.context.d.ts +0 -1
- package/dist/helpers/dynamicColumns.js +2 -1
- package/dist/hooks/useDebounceCallback.js +17 -51
- package/dist/hooks/useFormAutosave.js +33 -120
- package/dist/hooks/useLongPressRepeat.js +20 -55
- package/dist/index.d.ts +1 -1
- package/dist/index.js +2 -2
- package/dist/utils/date-time.utils.d.ts +0 -1
- package/dist/utils/date-time.utils.js +21 -45
- package/dist/utils/intl.utils.d.ts +7 -0
- package/dist/utils/intl.utils.js +38 -0
- package/dist/utils/intl.utils.spec.d.ts +1 -0
- package/package.json +2 -2
- package/dist/components/inputs/FormField/formField.cva.d.ts +0 -11
- package/dist/components/inputs/FormField/formField.cva.js +0 -16
- package/dist/components/table/TableColumnFilterInput.d.ts +0 -9
- package/dist/components/table/TableColumnFilterInput.js +0 -108
- package/dist/components/table/TableColumnFilterPlaceholder.d.ts +0 -5
- package/dist/components/table/TableColumnFilterPlaceholder.js +0 -41
- package/dist/components/table/TableColumnFilterRow.d.ts +0 -16
- package/dist/components/table/TableColumnFilterRow.js +0 -68
|
@@ -13,7 +13,6 @@ import { TooltipWrapper } from "../../shared/TooltipWrapper.js";
|
|
|
13
13
|
import { InputFrame } from "../../Skeleton/InputFrame.js";
|
|
14
14
|
import { useStaticInputHandoff } from "../../shared/useStaticInputHandoff.js";
|
|
15
15
|
import { useDebounceCallback } from "../../../../hooks/useDebounceCallback.js";
|
|
16
|
-
import { c } from "react/compiler-runtime";
|
|
17
16
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
18
17
|
import { clsx } from "clsx";
|
|
19
18
|
import { useEffect, useImperativeHandle, useMemo, useRef, useState } from "react";
|
|
@@ -157,24 +156,25 @@ var DateTimePickerBase = (props) => {
|
|
|
157
156
|
dialogState.setValue(null);
|
|
158
157
|
if (fireBlurOnChange) handleBlur(null);
|
|
159
158
|
};
|
|
160
|
-
const
|
|
161
|
-
state.
|
|
162
|
-
calendarState.setFocusedDate(state.value || today(effectiveTimeZone));
|
|
163
|
-
if (!isOpen) dialogState.setValue(state.value);
|
|
164
|
-
};
|
|
165
|
-
const onInputBlur = (e) => {
|
|
166
|
-
if (!isTimeOptional) return;
|
|
159
|
+
const syncDialogFromControlledValue = () => {
|
|
160
|
+
dialogState.setValue(state.value);
|
|
167
161
|
if (state.value) {
|
|
168
|
-
|
|
162
|
+
calendarState.setFocusedDate(state.value);
|
|
169
163
|
return;
|
|
170
164
|
}
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
165
|
+
calendarState.setFocusedDate(today(effectiveTimeZone));
|
|
166
|
+
};
|
|
167
|
+
useEffect(() => {
|
|
168
|
+
if (!state.isOpen) return;
|
|
169
|
+
syncDialogFromControlledValue();
|
|
170
|
+
}, [state.isOpen]);
|
|
171
|
+
const onOpenChange = (_isOpen) => {
|
|
172
|
+
state.toggle();
|
|
173
|
+
syncDialogFromControlledValue();
|
|
174
|
+
};
|
|
175
|
+
const onOpenDropdown = () => {
|
|
176
|
+
syncDialogFromControlledValue();
|
|
177
|
+
state.toggle();
|
|
178
178
|
};
|
|
179
179
|
return /* @__PURE__ */ jsx(TooltipWrapper, {
|
|
180
180
|
as,
|
|
@@ -192,10 +192,9 @@ var DateTimePickerBase = (props) => {
|
|
|
192
192
|
groupProps,
|
|
193
193
|
fieldProps: {
|
|
194
194
|
...fieldProps,
|
|
195
|
-
onBlur: (
|
|
196
|
-
fieldProps.onBlur?.(
|
|
195
|
+
onBlur: (e) => {
|
|
196
|
+
fieldProps.onBlur?.(e);
|
|
197
197
|
handleBlur(state.value);
|
|
198
|
-
onInputBlur(e_0);
|
|
199
198
|
}
|
|
200
199
|
},
|
|
201
200
|
fieldValue: normalizedValue,
|
|
@@ -220,7 +219,7 @@ var DateTimePickerBase = (props) => {
|
|
|
220
219
|
disableManualEntry,
|
|
221
220
|
autoFixYear,
|
|
222
221
|
placeholder,
|
|
223
|
-
onOpenDropdown
|
|
222
|
+
onOpenDropdown,
|
|
224
223
|
className: inputClassName,
|
|
225
224
|
timeZone: effectiveTimeZone,
|
|
226
225
|
isTimeOptional,
|
|
@@ -254,9 +253,7 @@ var DateTimePickerBase = (props) => {
|
|
|
254
253
|
})
|
|
255
254
|
});
|
|
256
255
|
};
|
|
257
|
-
var DateTimePickerInner = (
|
|
258
|
-
const $ = c(9);
|
|
259
|
-
const { fullIso: t1, renderStaticInput, isFormControlDisabled, ...props } = t0;
|
|
256
|
+
var DateTimePickerInner = ({ fullIso: _fullIso = true, renderStaticInput, isFormControlDisabled, ...props }) => {
|
|
260
257
|
const ui = UIConfig.useConfig();
|
|
261
258
|
const datePickerInputContentRowCva = UIOverrides.useCva("datePickerInput.contentRowCva", datePickerInputContentRowDefinition);
|
|
262
259
|
const { locale } = useLocale();
|
|
@@ -267,8 +264,15 @@ var DateTimePickerInner = (t0) => {
|
|
|
267
264
|
inputRef,
|
|
268
265
|
renderInput,
|
|
269
266
|
setRenderInput,
|
|
270
|
-
getFocusTarget:
|
|
271
|
-
|
|
267
|
+
getFocusTarget: (input, staticTarget) => {
|
|
268
|
+
const container = input.getContainer?.() ?? input;
|
|
269
|
+
return container instanceof HTMLElement ? getStaticDateTimeFocusTarget(container, staticTarget) : null;
|
|
270
|
+
},
|
|
271
|
+
getPressTarget: (input_0) => {
|
|
272
|
+
const container_0 = input_0.getContainer?.() ?? input_0;
|
|
273
|
+
if (!(container_0 instanceof HTMLElement)) return null;
|
|
274
|
+
return container_0.querySelector("[data-static-press-action]");
|
|
275
|
+
}
|
|
272
276
|
});
|
|
273
277
|
const normalizedValue = props.value ?? null;
|
|
274
278
|
const timeZone = props.timeZone ?? ui.dateInput.timeZone;
|
|
@@ -338,137 +342,46 @@ var DateTimePickerInner = (t0) => {
|
|
|
338
342
|
trailingClassName: "py-0! pl-0!",
|
|
339
343
|
action: showDropdown ? {
|
|
340
344
|
icon: ui.dateInput.dateTimeIcon,
|
|
341
|
-
onClick:
|
|
345
|
+
onClick: () => {},
|
|
342
346
|
altText: ""
|
|
343
347
|
} : void 0,
|
|
344
348
|
children: staticSegments
|
|
345
349
|
});
|
|
346
350
|
}
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
$[0] = formatDateValue;
|
|
354
|
-
$[1] = props;
|
|
355
|
-
$[2] = t4;
|
|
356
|
-
} else t4 = $[2];
|
|
357
|
-
let t5;
|
|
358
|
-
if ($[3] !== T0 || $[4] !== props || $[5] !== t2 || $[6] !== t3 || $[7] !== t4) {
|
|
359
|
-
t5 = /* @__PURE__ */ jsx(T0, {
|
|
360
|
-
...props,
|
|
361
|
-
ref: t2,
|
|
362
|
-
value: t3,
|
|
363
|
-
onChange: t4
|
|
364
|
-
});
|
|
365
|
-
$[3] = T0;
|
|
366
|
-
$[4] = props;
|
|
367
|
-
$[5] = t2;
|
|
368
|
-
$[6] = t3;
|
|
369
|
-
$[7] = t4;
|
|
370
|
-
$[8] = t5;
|
|
371
|
-
} else t5 = $[8];
|
|
372
|
-
return t5;
|
|
351
|
+
return /* @__PURE__ */ jsx(DateTimePickerBase, {
|
|
352
|
+
...props,
|
|
353
|
+
ref: mergeRefs(props.ref, inputRef),
|
|
354
|
+
value: parseDateValue(normalizedValue),
|
|
355
|
+
onChange: (value) => props.onChange?.(formatDateValue(value))
|
|
356
|
+
});
|
|
373
357
|
};
|
|
374
|
-
var DateTimePicker = (
|
|
375
|
-
const $ = c(24);
|
|
376
|
-
let props;
|
|
377
|
-
let renderStaticInput;
|
|
378
|
-
let t1;
|
|
379
|
-
if ($[0] !== t0) {
|
|
380
|
-
({fullIso: t1, renderStaticInput, ...props} = t0);
|
|
381
|
-
$[0] = t0;
|
|
382
|
-
$[1] = props;
|
|
383
|
-
$[2] = renderStaticInput;
|
|
384
|
-
$[3] = t1;
|
|
385
|
-
} else {
|
|
386
|
-
props = $[1];
|
|
387
|
-
renderStaticInput = $[2];
|
|
388
|
-
t1 = $[3];
|
|
389
|
-
}
|
|
390
|
-
const fullIso = t1 === void 0 ? true : t1;
|
|
358
|
+
var DateTimePicker = ({ fullIso = true, renderStaticInput, ...props }) => {
|
|
391
359
|
if ("formControl" in props && props.formControl) {
|
|
392
|
-
|
|
393
|
-
let innerProps;
|
|
394
|
-
let ref;
|
|
395
|
-
if ($[4] !== props) {
|
|
396
|
-
({formControl, ref, ...innerProps} = props);
|
|
397
|
-
$[4] = props;
|
|
398
|
-
$[5] = formControl;
|
|
399
|
-
$[6] = innerProps;
|
|
400
|
-
$[7] = ref;
|
|
401
|
-
} else {
|
|
402
|
-
formControl = $[5];
|
|
403
|
-
innerProps = $[6];
|
|
404
|
-
ref = $[7];
|
|
405
|
-
}
|
|
360
|
+
const { formControl, ref, ...innerProps } = props;
|
|
406
361
|
const controlWithOptions = formControl.control;
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
renderStaticInput
|
|
424
|
-
});
|
|
425
|
-
};
|
|
426
|
-
$[8] = controlWithOptions._options?.disabled;
|
|
427
|
-
$[9] = fullIso;
|
|
428
|
-
$[10] = innerProps;
|
|
429
|
-
$[11] = props.error;
|
|
430
|
-
$[12] = props.isDisabled;
|
|
431
|
-
$[13] = ref;
|
|
432
|
-
$[14] = renderStaticInput;
|
|
433
|
-
$[15] = t2;
|
|
434
|
-
} else t2 = $[15];
|
|
435
|
-
let t3;
|
|
436
|
-
if ($[16] !== formControl.control || $[17] !== formControl.name || $[18] !== t2) {
|
|
437
|
-
t3 = /* @__PURE__ */ jsx(Controller, {
|
|
438
|
-
control: formControl.control,
|
|
439
|
-
name: formControl.name,
|
|
440
|
-
render: t2
|
|
441
|
-
});
|
|
442
|
-
$[16] = formControl.control;
|
|
443
|
-
$[17] = formControl.name;
|
|
444
|
-
$[18] = t2;
|
|
445
|
-
$[19] = t3;
|
|
446
|
-
} else t3 = $[19];
|
|
447
|
-
return t3;
|
|
448
|
-
}
|
|
449
|
-
let t2;
|
|
450
|
-
if ($[20] !== fullIso || $[21] !== props || $[22] !== renderStaticInput) {
|
|
451
|
-
t2 = /* @__PURE__ */ jsx(DateTimePickerInner, {
|
|
452
|
-
...props,
|
|
453
|
-
fullIso,
|
|
454
|
-
renderStaticInput
|
|
362
|
+
return /* @__PURE__ */ jsx(Controller, {
|
|
363
|
+
control: formControl.control,
|
|
364
|
+
name: formControl.name,
|
|
365
|
+
render: ({ field, fieldState: { error, isDirty } }) => /* @__PURE__ */ jsx(DateTimePickerInner, {
|
|
366
|
+
...innerProps,
|
|
367
|
+
ref: mergeRefs(ref, field.ref),
|
|
368
|
+
value: field.value ?? null,
|
|
369
|
+
onChange: field.onChange,
|
|
370
|
+
onBlur: field.onBlur,
|
|
371
|
+
isDirty,
|
|
372
|
+
isDisabled: field.disabled || props.isDisabled,
|
|
373
|
+
isFormControlDisabled: !!controlWithOptions._options?.disabled,
|
|
374
|
+
error: props.error ?? error?.message,
|
|
375
|
+
fullIso,
|
|
376
|
+
renderStaticInput
|
|
377
|
+
})
|
|
455
378
|
});
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
379
|
+
}
|
|
380
|
+
return /* @__PURE__ */ jsx(DateTimePickerInner, {
|
|
381
|
+
...props,
|
|
382
|
+
fullIso,
|
|
383
|
+
renderStaticInput
|
|
384
|
+
});
|
|
462
385
|
};
|
|
463
|
-
function _temp(input, staticTarget) {
|
|
464
|
-
const container = input.getContainer?.() ?? input;
|
|
465
|
-
return container instanceof HTMLElement ? getStaticDateTimeFocusTarget(container, staticTarget) : null;
|
|
466
|
-
}
|
|
467
|
-
function _temp2(input_0) {
|
|
468
|
-
const container_0 = input_0.getContainer?.() ?? input_0;
|
|
469
|
-
if (!(container_0 instanceof HTMLElement)) return null;
|
|
470
|
-
return container_0.querySelector("[data-static-press-action]");
|
|
471
|
-
}
|
|
472
|
-
function _temp3() {}
|
|
473
386
|
//#endregion
|
|
474
387
|
export { DateTimePicker };
|