@scripso-homepad/ui 0.4.9 → 0.4.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +245 -127
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +4 -2
- package/dist/index.d.ts +4 -2
- package/dist/index.js +247 -129
- package/dist/index.js.map +1 -1
- package/dist/web/index.cjs +451 -48
- package/dist/web/index.cjs.map +1 -1
- package/dist/web/index.css +161 -0
- package/dist/web/index.css.map +1 -1
- package/dist/web/index.d.cts +50 -2
- package/dist/web/index.d.ts +50 -2
- package/dist/web/index.js +444 -49
- package/dist/web/index.js.map +1 -1
- package/package.json +10 -3
- package/src/components/Calendar.tsx +10 -2
- package/src/components/DatePicker.tsx +40 -6
- package/src/components/Select.tsx +133 -38
- package/src/theme/select.ts +1 -1
- package/src/utils/calendarDays.ts +15 -6
- package/src/web/components/Badge.tsx +1 -1
- package/src/web/components/ConfirmModal.tsx +2 -2
- package/src/web/components/Drawer.stories.tsx +234 -0
- package/src/web/components/Drawer.tsx +169 -0
- package/src/web/components/HistoryTimeline.tsx +46 -0
- package/src/web/components/Modal.stories.tsx +1 -1
- package/src/web/components/Modal.tsx +30 -13
- package/src/web/components/Pagination.tsx +2 -2
- package/src/web/components/TableActionButton.tsx +4 -4
- package/src/web/components/TableActionsMenu.tsx +1 -1
- package/src/web/components/TableIconText.tsx +1 -1
- package/src/web/components/Toaster.stories.tsx +106 -0
- package/src/web/components/Toaster.tsx +92 -0
- package/src/web/components/ToasterProvider.tsx +6 -0
- package/src/web/components/drawer-scroll.css +41 -0
- package/src/web/components/sonner-toast.css +141 -0
- package/src/web/components/table/constants.ts +2 -2
- package/src/web/icons/TimelineCheckIcon.tsx +24 -0
- package/src/web/icons/ToastIcons.tsx +119 -0
- package/src/web/index.ts +20 -0
- package/src/web/layout/AppHeader.tsx +1 -1
- package/src/web/layout/BuildingSelect.tsx +2 -2
- package/src/web/layout/DashboardLayout.stories.tsx +1 -1
- package/src/web/layout/SidebarNavItem.tsx +1 -1
- package/src/web/layout/SidebarUserCard.tsx +3 -3
- package/src/web/mutation-toast.ts +33 -0
- package/src/web/styles/typography.css +99 -0
- package/src/web/toast.ts +1 -0
package/dist/index.d.cts
CHANGED
|
@@ -164,12 +164,12 @@ type CalendarBaseProps = {
|
|
|
164
164
|
type CalendarSingleProps = CalendarBaseProps & {
|
|
165
165
|
mode?: "single";
|
|
166
166
|
value?: Date;
|
|
167
|
-
onChange?: (date: Date) => void;
|
|
167
|
+
onChange?: (date: Date | undefined) => void;
|
|
168
168
|
};
|
|
169
169
|
type CalendarRangeProps = CalendarBaseProps & {
|
|
170
170
|
mode: "range";
|
|
171
171
|
value?: DateRange;
|
|
172
|
-
onChange?: (range: DateRange) => void;
|
|
172
|
+
onChange?: (range: DateRange | undefined) => void;
|
|
173
173
|
};
|
|
174
174
|
type CalendarProps = CalendarSingleProps | CalendarRangeProps;
|
|
175
175
|
declare function Calendar(props: CalendarProps): react.JSX.Element;
|
|
@@ -191,6 +191,8 @@ type DatePickerFieldProps = {
|
|
|
191
191
|
containerStyle?: StyleProp<ViewStyle>;
|
|
192
192
|
className?: string;
|
|
193
193
|
fieldClassName?: string;
|
|
194
|
+
fieldStyle?: StyleProp<ViewStyle>;
|
|
195
|
+
fieldOutlineStyle?: StyleProp<ViewStyle>;
|
|
194
196
|
panelClassName?: string;
|
|
195
197
|
labelClassName?: string;
|
|
196
198
|
errorClassName?: string;
|
package/dist/index.d.ts
CHANGED
|
@@ -164,12 +164,12 @@ type CalendarBaseProps = {
|
|
|
164
164
|
type CalendarSingleProps = CalendarBaseProps & {
|
|
165
165
|
mode?: "single";
|
|
166
166
|
value?: Date;
|
|
167
|
-
onChange?: (date: Date) => void;
|
|
167
|
+
onChange?: (date: Date | undefined) => void;
|
|
168
168
|
};
|
|
169
169
|
type CalendarRangeProps = CalendarBaseProps & {
|
|
170
170
|
mode: "range";
|
|
171
171
|
value?: DateRange;
|
|
172
|
-
onChange?: (range: DateRange) => void;
|
|
172
|
+
onChange?: (range: DateRange | undefined) => void;
|
|
173
173
|
};
|
|
174
174
|
type CalendarProps = CalendarSingleProps | CalendarRangeProps;
|
|
175
175
|
declare function Calendar(props: CalendarProps): react.JSX.Element;
|
|
@@ -191,6 +191,8 @@ type DatePickerFieldProps = {
|
|
|
191
191
|
containerStyle?: StyleProp<ViewStyle>;
|
|
192
192
|
className?: string;
|
|
193
193
|
fieldClassName?: string;
|
|
194
|
+
fieldStyle?: StyleProp<ViewStyle>;
|
|
195
|
+
fieldOutlineStyle?: StyleProp<ViewStyle>;
|
|
194
196
|
panelClassName?: string;
|
|
195
197
|
labelClassName?: string;
|
|
196
198
|
errorClassName?: string;
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { spacing, colors,
|
|
1
|
+
import { spacing, colors, fontWeight, fontSize, fonts, radii, INPUT_ICON_GAP, useApplyWebClassName, resolveInputVisualState, Label, getInputFieldStyles, inputFieldMetrics } from './chunk-YSDLHEJ7.js';
|
|
2
2
|
export { Button, Input, Label, brand, buttonTypography, colors, emeraldGreen, fontSize, fontWeight, fonts, labelTypography, navy, radii, rubyRed, shadows, spacing, stormGray } from './chunk-YSDLHEJ7.js';
|
|
3
3
|
import { createContext, useRef, useState, useMemo, useEffect, useLayoutEffect, useContext, isValidElement, cloneElement } from 'react';
|
|
4
|
-
import { Platform, StyleSheet, Animated, Easing, Pressable, Text,
|
|
4
|
+
import { Platform, StyleSheet, Animated, Easing, View, Pressable, Text, Modal, ScrollView, TextInput, Dimensions } from 'react-native';
|
|
5
5
|
import Svg2, { Path } from 'react-native-svg';
|
|
6
6
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
7
7
|
|
|
@@ -53,7 +53,7 @@ var selectLabelTypography = {
|
|
|
53
53
|
fontFamily: fonts.sans,
|
|
54
54
|
fontSize: fontSize.sm,
|
|
55
55
|
fontWeight: fontWeight.medium,
|
|
56
|
-
lineHeight:
|
|
56
|
+
lineHeight: 16,
|
|
57
57
|
letterSpacing: 0,
|
|
58
58
|
color: colors.slateBlue
|
|
59
59
|
};
|
|
@@ -373,6 +373,86 @@ function renderSelectIcon(icon, color) {
|
|
|
373
373
|
}
|
|
374
374
|
return icon;
|
|
375
375
|
}
|
|
376
|
+
function resolveWebTextNode(ref) {
|
|
377
|
+
if (Platform.OS !== "web") {
|
|
378
|
+
return null;
|
|
379
|
+
}
|
|
380
|
+
const node = ref.current;
|
|
381
|
+
return node instanceof HTMLElement ? node : null;
|
|
382
|
+
}
|
|
383
|
+
function syncTruncatedNativeTitle(ref, label) {
|
|
384
|
+
const element = resolveWebTextNode(ref);
|
|
385
|
+
if (!element) {
|
|
386
|
+
return;
|
|
387
|
+
}
|
|
388
|
+
if (element.scrollWidth > element.clientWidth) {
|
|
389
|
+
element.setAttribute("title", label);
|
|
390
|
+
return;
|
|
391
|
+
}
|
|
392
|
+
element.removeAttribute("title");
|
|
393
|
+
}
|
|
394
|
+
function clearNativeTitle(ref) {
|
|
395
|
+
resolveWebTextNode(ref)?.removeAttribute("title");
|
|
396
|
+
}
|
|
397
|
+
function SelectOptionItem({
|
|
398
|
+
option,
|
|
399
|
+
compact,
|
|
400
|
+
optionHeight,
|
|
401
|
+
isSelected,
|
|
402
|
+
isHighlighted,
|
|
403
|
+
isLast,
|
|
404
|
+
selectableIndex,
|
|
405
|
+
onHighlight,
|
|
406
|
+
onSelect
|
|
407
|
+
}) {
|
|
408
|
+
const labelRef = useRef(null);
|
|
409
|
+
return /* @__PURE__ */ jsx(
|
|
410
|
+
Pressable,
|
|
411
|
+
{
|
|
412
|
+
accessibilityRole: "button",
|
|
413
|
+
accessibilityState: { disabled: option.disabled, selected: isSelected },
|
|
414
|
+
disabled: option.disabled,
|
|
415
|
+
onPress: () => {
|
|
416
|
+
if (!option.disabled) {
|
|
417
|
+
onSelect(option.value);
|
|
418
|
+
}
|
|
419
|
+
},
|
|
420
|
+
onHoverIn: () => {
|
|
421
|
+
if (!option.disabled && selectableIndex >= 0) {
|
|
422
|
+
onHighlight(selectableIndex);
|
|
423
|
+
}
|
|
424
|
+
syncTruncatedNativeTitle(labelRef, option.label);
|
|
425
|
+
},
|
|
426
|
+
onHoverOut: () => {
|
|
427
|
+
clearNativeTitle(labelRef);
|
|
428
|
+
},
|
|
429
|
+
style: [
|
|
430
|
+
selectDropdownMetrics.option,
|
|
431
|
+
compact && styles.optionCompact,
|
|
432
|
+
{ height: optionHeight, minHeight: optionHeight, maxHeight: optionHeight },
|
|
433
|
+
isSelected && selectDropdownMetrics.optionSelected,
|
|
434
|
+
compact && isSelected && styles.optionSelectedCompact,
|
|
435
|
+
isHighlighted && !isSelected && !option.disabled ? selectDropdownMetrics.optionHighlighted : null,
|
|
436
|
+
!isLast && styles.optionSpacing,
|
|
437
|
+
option.disabled && styles.optionDisabled
|
|
438
|
+
],
|
|
439
|
+
children: /* @__PURE__ */ jsx(
|
|
440
|
+
Text,
|
|
441
|
+
{
|
|
442
|
+
ref: labelRef,
|
|
443
|
+
style: [
|
|
444
|
+
selectDropdownMetrics.optionLabel,
|
|
445
|
+
styles.optionLabel,
|
|
446
|
+
isSelected && selectDropdownMetrics.optionLabelSelected,
|
|
447
|
+
option.disabled && styles.optionLabelDisabled
|
|
448
|
+
],
|
|
449
|
+
numberOfLines: 1,
|
|
450
|
+
children: option.label
|
|
451
|
+
}
|
|
452
|
+
)
|
|
453
|
+
}
|
|
454
|
+
);
|
|
455
|
+
}
|
|
376
456
|
var useIsomorphicLayoutEffect = typeof window === "undefined" ? useEffect : useLayoutEffect;
|
|
377
457
|
function normalizeSelectedValues(multiple, value) {
|
|
378
458
|
if (multiple) {
|
|
@@ -505,6 +585,11 @@ function Select({
|
|
|
505
585
|
onValueChange?.(nextValues);
|
|
506
586
|
return;
|
|
507
587
|
}
|
|
588
|
+
if (selectedValues.includes(nextValue)) {
|
|
589
|
+
onValueChange?.("");
|
|
590
|
+
closeMenu();
|
|
591
|
+
return;
|
|
592
|
+
}
|
|
508
593
|
onValueChange?.(nextValue);
|
|
509
594
|
closeMenu();
|
|
510
595
|
}
|
|
@@ -514,43 +599,17 @@ function Select({
|
|
|
514
599
|
const isHighlighted = selectableIndex === highlightedIndex;
|
|
515
600
|
const isLast = index === options.length - 1;
|
|
516
601
|
return /* @__PURE__ */ jsx(
|
|
517
|
-
|
|
602
|
+
SelectOptionItem,
|
|
518
603
|
{
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
if (!option.disabled && selectableIndex >= 0) {
|
|
529
|
-
setHighlightedIndex(selectableIndex);
|
|
530
|
-
}
|
|
531
|
-
},
|
|
532
|
-
style: [
|
|
533
|
-
selectDropdownMetrics.option,
|
|
534
|
-
compact && styles.optionCompact,
|
|
535
|
-
{ height: optionHeight, minHeight: optionHeight, maxHeight: optionHeight },
|
|
536
|
-
isSelected && selectDropdownMetrics.optionSelected,
|
|
537
|
-
compact && isSelected && styles.optionSelectedCompact,
|
|
538
|
-
isHighlighted && !isSelected && !option.disabled ? selectDropdownMetrics.optionHighlighted : null,
|
|
539
|
-
!isLast && styles.optionSpacing,
|
|
540
|
-
option.disabled && styles.optionDisabled
|
|
541
|
-
],
|
|
542
|
-
children: /* @__PURE__ */ jsx(
|
|
543
|
-
Text,
|
|
544
|
-
{
|
|
545
|
-
style: [
|
|
546
|
-
selectDropdownMetrics.optionLabel,
|
|
547
|
-
isSelected && selectDropdownMetrics.optionLabelSelected,
|
|
548
|
-
option.disabled && styles.optionLabelDisabled
|
|
549
|
-
],
|
|
550
|
-
numberOfLines: 1,
|
|
551
|
-
children: option.label
|
|
552
|
-
}
|
|
553
|
-
)
|
|
604
|
+
option,
|
|
605
|
+
compact,
|
|
606
|
+
optionHeight,
|
|
607
|
+
isSelected,
|
|
608
|
+
isHighlighted,
|
|
609
|
+
isLast,
|
|
610
|
+
selectableIndex,
|
|
611
|
+
onHighlight: setHighlightedIndex,
|
|
612
|
+
onSelect: handleSelect
|
|
554
613
|
},
|
|
555
614
|
option.value
|
|
556
615
|
);
|
|
@@ -685,6 +744,14 @@ var styles = StyleSheet.create({
|
|
|
685
744
|
optionDisabled: {
|
|
686
745
|
opacity: 0.5
|
|
687
746
|
},
|
|
747
|
+
optionLabel: {
|
|
748
|
+
minWidth: 0,
|
|
749
|
+
...Platform.OS === "web" ? {
|
|
750
|
+
overflow: "hidden",
|
|
751
|
+
textOverflow: "ellipsis",
|
|
752
|
+
whiteSpace: "nowrap"
|
|
753
|
+
} : null
|
|
754
|
+
},
|
|
688
755
|
optionLabelDisabled: {
|
|
689
756
|
color: colors.stormGray300
|
|
690
757
|
},
|
|
@@ -1513,17 +1580,24 @@ function isInDateRange(date, start, end) {
|
|
|
1513
1580
|
}
|
|
1514
1581
|
function selectRangeDate(clicked, current) {
|
|
1515
1582
|
const clickedDate = stripTime(clicked);
|
|
1516
|
-
if (!current?.start
|
|
1583
|
+
if (!current?.start) {
|
|
1517
1584
|
return { start: clickedDate };
|
|
1518
1585
|
}
|
|
1519
1586
|
const start = stripTime(current.start);
|
|
1520
|
-
|
|
1587
|
+
const end = current.end ? stripTime(current.end) : void 0;
|
|
1588
|
+
if (!end) {
|
|
1589
|
+
if (isSameDay(clickedDate, start)) {
|
|
1590
|
+
return void 0;
|
|
1591
|
+
}
|
|
1592
|
+
if (isBeforeDay(clickedDate, start)) {
|
|
1593
|
+
return { start: clickedDate };
|
|
1594
|
+
}
|
|
1521
1595
|
return { start, end: clickedDate };
|
|
1522
1596
|
}
|
|
1523
|
-
if (
|
|
1524
|
-
return
|
|
1597
|
+
if (isSameDay(clickedDate, end)) {
|
|
1598
|
+
return void 0;
|
|
1525
1599
|
}
|
|
1526
|
-
return { start
|
|
1600
|
+
return { start: clickedDate };
|
|
1527
1601
|
}
|
|
1528
1602
|
function isSameDay(left, right) {
|
|
1529
1603
|
return left.getFullYear() === right.getFullYear() && left.getMonth() === right.getMonth() && left.getDate() === right.getDate();
|
|
@@ -2015,6 +2089,11 @@ function Calendar(props) {
|
|
|
2015
2089
|
rangeProps.onChange?.(selectRangeDate(date, rangeProps.value));
|
|
2016
2090
|
return;
|
|
2017
2091
|
}
|
|
2092
|
+
const currentValue = singleProps?.value;
|
|
2093
|
+
if (currentValue && isSameDay(date, currentValue)) {
|
|
2094
|
+
singleProps?.onChange?.(void 0);
|
|
2095
|
+
return;
|
|
2096
|
+
}
|
|
2018
2097
|
singleProps?.onChange?.(date);
|
|
2019
2098
|
}
|
|
2020
2099
|
const headerIsPressable = pickerView === "days" || pickerView === "months";
|
|
@@ -2172,6 +2251,8 @@ function DatePicker(props) {
|
|
|
2172
2251
|
containerStyle,
|
|
2173
2252
|
className,
|
|
2174
2253
|
fieldClassName,
|
|
2254
|
+
fieldStyle,
|
|
2255
|
+
fieldOutlineStyle,
|
|
2175
2256
|
panelClassName,
|
|
2176
2257
|
labelClassName,
|
|
2177
2258
|
errorClassName,
|
|
@@ -2261,100 +2342,124 @@ function DatePicker(props) {
|
|
|
2261
2342
|
return;
|
|
2262
2343
|
}
|
|
2263
2344
|
props.onChange?.(range);
|
|
2264
|
-
if (closeOnRangeComplete && range
|
|
2345
|
+
if (closeOnRangeComplete && range?.end) {
|
|
2265
2346
|
closePicker();
|
|
2266
2347
|
}
|
|
2267
2348
|
}
|
|
2268
|
-
|
|
2269
|
-
|
|
2270
|
-
|
|
2271
|
-
|
|
2272
|
-
|
|
2273
|
-
|
|
2274
|
-
|
|
2275
|
-
|
|
2276
|
-
|
|
2277
|
-
|
|
2278
|
-
|
|
2279
|
-
|
|
2349
|
+
const isFluidField = Boolean(fieldStyle) || Boolean(fieldOutlineStyle);
|
|
2350
|
+
return /* @__PURE__ */ jsxs(
|
|
2351
|
+
View,
|
|
2352
|
+
{
|
|
2353
|
+
ref: wrapperRef,
|
|
2354
|
+
style: [styles4.wrapper, isFluidField && styles4.wrapperFluid, containerStyle],
|
|
2355
|
+
children: [
|
|
2356
|
+
label ? /* @__PURE__ */ jsx(Label, { disabled, style: styles4.label, className: labelClassName, children: label }) : null,
|
|
2357
|
+
/* @__PURE__ */ jsx(
|
|
2358
|
+
View,
|
|
2359
|
+
{
|
|
2360
|
+
style: [
|
|
2361
|
+
fieldStyles.outline,
|
|
2362
|
+
styles4.fieldOutline,
|
|
2363
|
+
isFluidField && styles4.fieldOutlineFluid,
|
|
2364
|
+
fieldOutlineStyle
|
|
2365
|
+
],
|
|
2366
|
+
children: /* @__PURE__ */ jsxs(
|
|
2367
|
+
Pressable,
|
|
2368
|
+
{
|
|
2369
|
+
ref: triggerRef,
|
|
2370
|
+
accessibilityRole: "button",
|
|
2371
|
+
accessibilityState: { disabled, expanded: open },
|
|
2372
|
+
disabled,
|
|
2373
|
+
onPress: openPicker,
|
|
2374
|
+
style: [
|
|
2375
|
+
calendarFieldMetrics.container,
|
|
2376
|
+
isFluidField && styles4.fieldContainerFluid,
|
|
2377
|
+
fieldStyles.container,
|
|
2378
|
+
fieldStyle
|
|
2379
|
+
],
|
|
2380
|
+
children: [
|
|
2381
|
+
/* @__PURE__ */ jsx(
|
|
2382
|
+
Text,
|
|
2383
|
+
{
|
|
2384
|
+
style: [calendarFieldMetrics.value, valueTextStyle],
|
|
2385
|
+
numberOfLines: 1,
|
|
2386
|
+
children: displayValue
|
|
2387
|
+
}
|
|
2388
|
+
),
|
|
2389
|
+
/* @__PURE__ */ jsx(View, { style: styles4.iconSlot, children: /* @__PURE__ */ jsx(
|
|
2390
|
+
CalendarIcon,
|
|
2391
|
+
{
|
|
2392
|
+
size: CALENDAR_FIELD_ICON_SIZE,
|
|
2393
|
+
color: disabled ? colors.stormGray200 : colors.stormGray150
|
|
2394
|
+
}
|
|
2395
|
+
) })
|
|
2396
|
+
]
|
|
2397
|
+
}
|
|
2398
|
+
)
|
|
2399
|
+
}
|
|
2400
|
+
),
|
|
2401
|
+
helperMessage ? /* @__PURE__ */ jsx(Text, { ref: helperRef, style: error ? styles4.error : styles4.hint, children: helperMessage }) : null,
|
|
2402
|
+
/* @__PURE__ */ jsx(Modal, { visible: open, transparent: true, animationType: "fade", onRequestClose: closePicker, children: /* @__PURE__ */ jsxs(View, { style: styles4.modalRoot, children: [
|
|
2280
2403
|
/* @__PURE__ */ jsx(
|
|
2281
|
-
|
|
2404
|
+
Pressable,
|
|
2282
2405
|
{
|
|
2283
|
-
style:
|
|
2284
|
-
|
|
2285
|
-
|
|
2406
|
+
style: styles4.backdrop,
|
|
2407
|
+
onPress: closePicker,
|
|
2408
|
+
accessibilityRole: "button",
|
|
2409
|
+
accessibilityLabel: labels?.closeCalendar ?? translations.closeCalendar
|
|
2286
2410
|
}
|
|
2287
2411
|
),
|
|
2288
|
-
|
|
2289
|
-
|
|
2290
|
-
{
|
|
2291
|
-
size: CALENDAR_FIELD_ICON_SIZE,
|
|
2292
|
-
color: disabled ? colors.stormGray200 : colors.stormGray150
|
|
2293
|
-
}
|
|
2294
|
-
) })
|
|
2295
|
-
]
|
|
2296
|
-
}
|
|
2297
|
-
) }),
|
|
2298
|
-
helperMessage ? /* @__PURE__ */ jsx(Text, { ref: helperRef, style: error ? styles4.error : styles4.hint, children: helperMessage }) : null,
|
|
2299
|
-
/* @__PURE__ */ jsx(Modal, { visible: open, transparent: true, animationType: "fade", onRequestClose: closePicker, children: /* @__PURE__ */ jsxs(View, { style: styles4.modalRoot, children: [
|
|
2300
|
-
/* @__PURE__ */ jsx(
|
|
2301
|
-
Pressable,
|
|
2302
|
-
{
|
|
2303
|
-
style: styles4.backdrop,
|
|
2304
|
-
onPress: closePicker,
|
|
2305
|
-
accessibilityRole: "button",
|
|
2306
|
-
accessibilityLabel: labels?.closeCalendar ?? translations.closeCalendar
|
|
2307
|
-
}
|
|
2308
|
-
),
|
|
2309
|
-
anchor ? /* @__PURE__ */ jsx(
|
|
2310
|
-
View,
|
|
2311
|
-
{
|
|
2312
|
-
style: [
|
|
2313
|
-
styles4.panelPosition,
|
|
2314
|
-
{
|
|
2315
|
-
top: dropdownTop,
|
|
2316
|
-
left: panelLeft,
|
|
2317
|
-
width: panelWidth,
|
|
2318
|
-
height: CALENDAR_PANEL_HEIGHT
|
|
2319
|
-
}
|
|
2320
|
-
],
|
|
2321
|
-
children: props.mode === "range" ? /* @__PURE__ */ jsx(
|
|
2322
|
-
Calendar,
|
|
2323
|
-
{
|
|
2324
|
-
mode: "range",
|
|
2325
|
-
value: props.value,
|
|
2326
|
-
onChange: handleRangeSelect,
|
|
2327
|
-
viewDate,
|
|
2328
|
-
defaultViewDate: resolvedDefaultViewDate,
|
|
2329
|
-
onViewDateChange,
|
|
2330
|
-
locale: resolvedLocale,
|
|
2331
|
-
labels,
|
|
2332
|
-
minDate,
|
|
2333
|
-
maxDate,
|
|
2334
|
-
today,
|
|
2335
|
-
className: panelClassName
|
|
2336
|
-
}
|
|
2337
|
-
) : /* @__PURE__ */ jsx(
|
|
2338
|
-
Calendar,
|
|
2412
|
+
anchor ? /* @__PURE__ */ jsx(
|
|
2413
|
+
View,
|
|
2339
2414
|
{
|
|
2340
|
-
|
|
2341
|
-
|
|
2342
|
-
|
|
2343
|
-
|
|
2344
|
-
|
|
2345
|
-
|
|
2346
|
-
|
|
2347
|
-
|
|
2348
|
-
|
|
2349
|
-
|
|
2350
|
-
|
|
2351
|
-
|
|
2415
|
+
style: [
|
|
2416
|
+
styles4.panelPosition,
|
|
2417
|
+
{
|
|
2418
|
+
top: dropdownTop,
|
|
2419
|
+
left: panelLeft,
|
|
2420
|
+
width: panelWidth,
|
|
2421
|
+
height: CALENDAR_PANEL_HEIGHT
|
|
2422
|
+
}
|
|
2423
|
+
],
|
|
2424
|
+
children: props.mode === "range" ? /* @__PURE__ */ jsx(
|
|
2425
|
+
Calendar,
|
|
2426
|
+
{
|
|
2427
|
+
mode: "range",
|
|
2428
|
+
value: props.value,
|
|
2429
|
+
onChange: handleRangeSelect,
|
|
2430
|
+
viewDate,
|
|
2431
|
+
defaultViewDate: resolvedDefaultViewDate,
|
|
2432
|
+
onViewDateChange,
|
|
2433
|
+
locale: resolvedLocale,
|
|
2434
|
+
labels,
|
|
2435
|
+
minDate,
|
|
2436
|
+
maxDate,
|
|
2437
|
+
today,
|
|
2438
|
+
className: panelClassName
|
|
2439
|
+
}
|
|
2440
|
+
) : /* @__PURE__ */ jsx(
|
|
2441
|
+
Calendar,
|
|
2442
|
+
{
|
|
2443
|
+
mode: "single",
|
|
2444
|
+
value: props.value,
|
|
2445
|
+
onChange: handleSingleSelect,
|
|
2446
|
+
viewDate,
|
|
2447
|
+
defaultViewDate: resolvedDefaultViewDate,
|
|
2448
|
+
onViewDateChange,
|
|
2449
|
+
locale: resolvedLocale,
|
|
2450
|
+
labels,
|
|
2451
|
+
minDate,
|
|
2452
|
+
maxDate,
|
|
2453
|
+
today,
|
|
2454
|
+
className: panelClassName
|
|
2455
|
+
}
|
|
2456
|
+
)
|
|
2352
2457
|
}
|
|
2353
|
-
)
|
|
2354
|
-
}
|
|
2355
|
-
|
|
2356
|
-
|
|
2357
|
-
|
|
2458
|
+
) : null
|
|
2459
|
+
] }) })
|
|
2460
|
+
]
|
|
2461
|
+
}
|
|
2462
|
+
);
|
|
2358
2463
|
}
|
|
2359
2464
|
var styles4 = StyleSheet.create({
|
|
2360
2465
|
wrapper: {
|
|
@@ -2362,11 +2467,24 @@ var styles4 = StyleSheet.create({
|
|
|
2362
2467
|
maxWidth: "100%",
|
|
2363
2468
|
gap: SELECT_LABEL_GAP
|
|
2364
2469
|
},
|
|
2470
|
+
wrapperFluid: {
|
|
2471
|
+
width: "100%"
|
|
2472
|
+
},
|
|
2365
2473
|
fieldOutline: {
|
|
2366
2474
|
width: CALENDAR_FIELD_WIDTH,
|
|
2367
2475
|
maxWidth: "100%",
|
|
2368
2476
|
alignSelf: "flex-start"
|
|
2369
2477
|
},
|
|
2478
|
+
fieldOutlineFluid: {
|
|
2479
|
+
width: "100%",
|
|
2480
|
+
alignSelf: "stretch"
|
|
2481
|
+
},
|
|
2482
|
+
fieldContainerFluid: {
|
|
2483
|
+
width: "100%",
|
|
2484
|
+
minWidth: 0,
|
|
2485
|
+
maxWidth: "100%",
|
|
2486
|
+
alignSelf: "stretch"
|
|
2487
|
+
},
|
|
2370
2488
|
label: {
|
|
2371
2489
|
...calendarLabelTypography
|
|
2372
2490
|
},
|