@raystack/apsara 0.13.0 → 0.14.1
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/calendar/calendar.d.ts.map +1 -1
- package/dist/calendar/date-picker.d.ts +13 -0
- package/dist/calendar/date-picker.d.ts.map +1 -0
- package/dist/calendar/index.d.ts +2 -0
- package/dist/calendar/index.d.ts.map +1 -1
- package/dist/calendar/range-picker.d.ts +15 -0
- package/dist/calendar/range-picker.d.ts.map +1 -0
- package/dist/errorstate/errorstate.d.ts +2 -1
- package/dist/errorstate/errorstate.d.ts.map +1 -1
- package/dist/index.cjs +350 -57
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +37 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +349 -58
- package/dist/index.js.map +1 -1
- package/dist/popover/popover.d.ts.map +1 -1
- package/dist/sidebar/sidebar.d.ts +2 -0
- package/dist/sidebar/sidebar.d.ts.map +1 -1
- package/dist/table/FilteredChip.d.ts.map +1 -1
- package/dist/table/datatable.d.ts +4 -3
- package/dist/table/datatable.d.ts.map +1 -1
- package/dist/table/datatables.types.d.ts +11 -5
- package/dist/table/datatables.types.d.ts.map +1 -1
- package/dist/table/filterFns.d.ts +2 -1
- package/dist/table/filterFns.d.ts.map +1 -1
- package/dist/textfield/textfield.d.ts +15 -2
- package/dist/textfield/textfield.d.ts.map +1 -1
- package/package.json +3 -1
package/dist/index.js
CHANGED
|
@@ -3,6 +3,8 @@ import React__default, { createContext, useMemo, createElement, useContext, useC
|
|
|
3
3
|
import * as $7SXl2$reactdom from 'react-dom';
|
|
4
4
|
import $7SXl2$reactdom__default, { flushSync, createPortal } from 'react-dom';
|
|
5
5
|
|
|
6
|
+
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
7
|
+
|
|
6
8
|
function getDefaultExportFromCjs (x) {
|
|
7
9
|
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
|
8
10
|
}
|
|
@@ -2382,11 +2384,33 @@ function _objectWithoutPropertiesLoose$1(source, excluded) {
|
|
|
2382
2384
|
return target;
|
|
2383
2385
|
}
|
|
2384
2386
|
|
|
2385
|
-
var _excluded$
|
|
2386
|
-
var
|
|
2387
|
+
var _excluded$I = ["color"];
|
|
2388
|
+
var CalendarIcon = /*#__PURE__*/forwardRef(function (_ref, forwardedRef) {
|
|
2389
|
+
var _ref$color = _ref.color,
|
|
2390
|
+
color = _ref$color === void 0 ? 'currentColor' : _ref$color,
|
|
2391
|
+
props = _objectWithoutPropertiesLoose$1(_ref, _excluded$I);
|
|
2392
|
+
|
|
2393
|
+
return createElement("svg", Object.assign({
|
|
2394
|
+
width: "15",
|
|
2395
|
+
height: "15",
|
|
2396
|
+
viewBox: "0 0 15 15",
|
|
2397
|
+
fill: "none",
|
|
2398
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
2399
|
+
}, props, {
|
|
2400
|
+
ref: forwardedRef
|
|
2401
|
+
}), createElement("path", {
|
|
2402
|
+
d: "M4.5 1C4.77614 1 5 1.22386 5 1.5V2H10V1.5C10 1.22386 10.2239 1 10.5 1C10.7761 1 11 1.22386 11 1.5V2H12.5C13.3284 2 14 2.67157 14 3.5V12.5C14 13.3284 13.3284 14 12.5 14H2.5C1.67157 14 1 13.3284 1 12.5V3.5C1 2.67157 1.67157 2 2.5 2H4V1.5C4 1.22386 4.22386 1 4.5 1ZM10 3V3.5C10 3.77614 10.2239 4 10.5 4C10.7761 4 11 3.77614 11 3.5V3H12.5C12.7761 3 13 3.22386 13 3.5V5H2V3.5C2 3.22386 2.22386 3 2.5 3H4V3.5C4 3.77614 4.22386 4 4.5 4C4.77614 4 5 3.77614 5 3.5V3H10ZM2 6V12.5C2 12.7761 2.22386 13 2.5 13H12.5C12.7761 13 13 12.7761 13 12.5V6H2ZM7 7.5C7 7.22386 7.22386 7 7.5 7C7.77614 7 8 7.22386 8 7.5C8 7.77614 7.77614 8 7.5 8C7.22386 8 7 7.77614 7 7.5ZM9.5 7C9.22386 7 9 7.22386 9 7.5C9 7.77614 9.22386 8 9.5 8C9.77614 8 10 7.77614 10 7.5C10 7.22386 9.77614 7 9.5 7ZM11 7.5C11 7.22386 11.2239 7 11.5 7C11.7761 7 12 7.22386 12 7.5C12 7.77614 11.7761 8 11.5 8C11.2239 8 11 7.77614 11 7.5ZM11.5 9C11.2239 9 11 9.22386 11 9.5C11 9.77614 11.2239 10 11.5 10C11.7761 10 12 9.77614 12 9.5C12 9.22386 11.7761 9 11.5 9ZM9 9.5C9 9.22386 9.22386 9 9.5 9C9.77614 9 10 9.22386 10 9.5C10 9.77614 9.77614 10 9.5 10C9.22386 10 9 9.77614 9 9.5ZM7.5 9C7.22386 9 7 9.22386 7 9.5C7 9.77614 7.22386 10 7.5 10C7.77614 10 8 9.77614 8 9.5C8 9.22386 7.77614 9 7.5 9ZM5 9.5C5 9.22386 5.22386 9 5.5 9C5.77614 9 6 9.22386 6 9.5C6 9.77614 5.77614 10 5.5 10C5.22386 10 5 9.77614 5 9.5ZM3.5 9C3.22386 9 3 9.22386 3 9.5C3 9.77614 3.22386 10 3.5 10C3.77614 10 4 9.77614 4 9.5C4 9.22386 3.77614 9 3.5 9ZM3 11.5C3 11.2239 3.22386 11 3.5 11C3.77614 11 4 11.2239 4 11.5C4 11.7761 3.77614 12 3.5 12C3.22386 12 3 11.7761 3 11.5ZM5.5 11C5.22386 11 5 11.2239 5 11.5C5 11.7761 5.22386 12 5.5 12C5.77614 12 6 11.7761 6 11.5C6 11.2239 5.77614 11 5.5 11ZM7 11.5C7 11.2239 7.22386 11 7.5 11C7.77614 11 8 11.2239 8 11.5C8 11.7761 7.77614 12 7.5 12C7.22386 12 7 11.7761 7 11.5ZM9.5 11C9.22386 11 9 11.2239 9 11.5C9 11.7761 9.22386 12 9.5 12C9.77614 12 10 11.7761 10 11.5C10 11.2239 9.77614 11 9.5 11Z",
|
|
2403
|
+
fill: color,
|
|
2404
|
+
fillRule: "evenodd",
|
|
2405
|
+
clipRule: "evenodd"
|
|
2406
|
+
}));
|
|
2407
|
+
});
|
|
2408
|
+
|
|
2409
|
+
var _excluded$N = ["color"];
|
|
2410
|
+
var CaretDownIcon = /*#__PURE__*/forwardRef(function (_ref, forwardedRef) {
|
|
2387
2411
|
var _ref$color = _ref.color,
|
|
2388
2412
|
color = _ref$color === void 0 ? 'currentColor' : _ref$color,
|
|
2389
|
-
props = _objectWithoutPropertiesLoose$1(_ref, _excluded$
|
|
2413
|
+
props = _objectWithoutPropertiesLoose$1(_ref, _excluded$N);
|
|
2390
2414
|
|
|
2391
2415
|
return createElement("svg", Object.assign({
|
|
2392
2416
|
width: "15",
|
|
@@ -2397,18 +2421,18 @@ var ArrowDownIcon = /*#__PURE__*/forwardRef(function (_ref, forwardedRef) {
|
|
|
2397
2421
|
}, props, {
|
|
2398
2422
|
ref: forwardedRef
|
|
2399
2423
|
}), createElement("path", {
|
|
2400
|
-
d: "
|
|
2424
|
+
d: "M4.18179 6.18181C4.35753 6.00608 4.64245 6.00608 4.81819 6.18181L7.49999 8.86362L10.1818 6.18181C10.3575 6.00608 10.6424 6.00608 10.8182 6.18181C10.9939 6.35755 10.9939 6.64247 10.8182 6.81821L7.81819 9.81821C7.73379 9.9026 7.61934 9.95001 7.49999 9.95001C7.38064 9.95001 7.26618 9.9026 7.18179 9.81821L4.18179 6.81821C4.00605 6.64247 4.00605 6.35755 4.18179 6.18181Z",
|
|
2401
2425
|
fill: color,
|
|
2402
2426
|
fillRule: "evenodd",
|
|
2403
2427
|
clipRule: "evenodd"
|
|
2404
2428
|
}));
|
|
2405
2429
|
});
|
|
2406
2430
|
|
|
2407
|
-
var _excluded$
|
|
2408
|
-
var
|
|
2431
|
+
var _excluded$Q = ["color"];
|
|
2432
|
+
var CaretSortIcon = /*#__PURE__*/forwardRef(function (_ref, forwardedRef) {
|
|
2409
2433
|
var _ref$color = _ref.color,
|
|
2410
2434
|
color = _ref$color === void 0 ? 'currentColor' : _ref$color,
|
|
2411
|
-
props = _objectWithoutPropertiesLoose$1(_ref, _excluded$
|
|
2435
|
+
props = _objectWithoutPropertiesLoose$1(_ref, _excluded$Q);
|
|
2412
2436
|
|
|
2413
2437
|
return createElement("svg", Object.assign({
|
|
2414
2438
|
width: "15",
|
|
@@ -2419,7 +2443,29 @@ var ArrowUpIcon = /*#__PURE__*/forwardRef(function (_ref, forwardedRef) {
|
|
|
2419
2443
|
}, props, {
|
|
2420
2444
|
ref: forwardedRef
|
|
2421
2445
|
}), createElement("path", {
|
|
2422
|
-
d: "
|
|
2446
|
+
d: "M4.93179 5.43179C4.75605 5.60753 4.75605 5.89245 4.93179 6.06819C5.10753 6.24392 5.39245 6.24392 5.56819 6.06819L7.49999 4.13638L9.43179 6.06819C9.60753 6.24392 9.89245 6.24392 10.0682 6.06819C10.2439 5.89245 10.2439 5.60753 10.0682 5.43179L7.81819 3.18179C7.73379 3.0974 7.61933 3.04999 7.49999 3.04999C7.38064 3.04999 7.26618 3.0974 7.18179 3.18179L4.93179 5.43179ZM10.0682 9.56819C10.2439 9.39245 10.2439 9.10753 10.0682 8.93179C9.89245 8.75606 9.60753 8.75606 9.43179 8.93179L7.49999 10.8636L5.56819 8.93179C5.39245 8.75606 5.10753 8.75606 4.93179 8.93179C4.75605 9.10753 4.75605 9.39245 4.93179 9.56819L7.18179 11.8182C7.35753 11.9939 7.64245 11.9939 7.81819 11.8182L10.0682 9.56819Z",
|
|
2447
|
+
fill: color,
|
|
2448
|
+
fillRule: "evenodd",
|
|
2449
|
+
clipRule: "evenodd"
|
|
2450
|
+
}));
|
|
2451
|
+
});
|
|
2452
|
+
|
|
2453
|
+
var _excluded$R = ["color"];
|
|
2454
|
+
var CaretUpIcon = /*#__PURE__*/forwardRef(function (_ref, forwardedRef) {
|
|
2455
|
+
var _ref$color = _ref.color,
|
|
2456
|
+
color = _ref$color === void 0 ? 'currentColor' : _ref$color,
|
|
2457
|
+
props = _objectWithoutPropertiesLoose$1(_ref, _excluded$R);
|
|
2458
|
+
|
|
2459
|
+
return createElement("svg", Object.assign({
|
|
2460
|
+
width: "15",
|
|
2461
|
+
height: "15",
|
|
2462
|
+
viewBox: "0 0 15 15",
|
|
2463
|
+
fill: "none",
|
|
2464
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
2465
|
+
}, props, {
|
|
2466
|
+
ref: forwardedRef
|
|
2467
|
+
}), createElement("path", {
|
|
2468
|
+
d: "M4.18179 8.81819C4.00605 8.64245 4.00605 8.35753 4.18179 8.18179L7.18179 5.18179C7.26618 5.0974 7.38064 5.04999 7.49999 5.04999C7.61933 5.04999 7.73379 5.0974 7.81819 5.18179L10.8182 8.18179C10.9939 8.35753 10.9939 8.64245 10.8182 8.81819C10.6424 8.99392 10.3575 8.99392 10.1818 8.81819L7.49999 6.13638L4.81819 8.81819C4.64245 8.99392 4.35753 8.99392 4.18179 8.81819Z",
|
|
2423
2469
|
fill: color,
|
|
2424
2470
|
fillRule: "evenodd",
|
|
2425
2471
|
clipRule: "evenodd"
|
|
@@ -9699,8 +9745,8 @@ const getHeadline = (status = "Something gone wrong") => {
|
|
|
9699
9745
|
}
|
|
9700
9746
|
};
|
|
9701
9747
|
const errorstate = cva(styles$n.errorstate);
|
|
9702
|
-
function ErrorState({ children, className, status, icon, ...props }) {
|
|
9703
|
-
return (jsxRuntimeExports$1.jsx(Flex, { justify: "center", style: { width: "100%", height: "100%" }, children: jsxRuntimeExports$1.jsxs(Flex, { direction: "column", gap: "large", align: "center", justify: "center", className: errorstate({ className }), style: { textAlign: "center", maxWidth: "400px" }, ...props, children: [icon ? icon : getIcon(status), jsxRuntimeExports$1.jsxs(Flex, { direction: "column", gap: "medium", children: [jsxRuntimeExports$1.jsx(Headline, { size: "large", children: getHeadline(status) }), jsxRuntimeExports$1.jsx(Body, { size: "large", children: getMessage(status) })] })] }) }));
|
|
9748
|
+
function ErrorState({ children, className, status, icon, message, ...props }) {
|
|
9749
|
+
return (jsxRuntimeExports$1.jsx(Flex, { justify: "center", style: { width: "100%", height: "100%" }, children: jsxRuntimeExports$1.jsxs(Flex, { direction: "column", gap: "large", align: "center", justify: "center", className: errorstate({ className }), style: { textAlign: "center", maxWidth: "400px" }, ...props, children: [icon ? icon : getIcon(status), jsxRuntimeExports$1.jsxs(Flex, { direction: "column", gap: "medium", children: [jsxRuntimeExports$1.jsx(Headline, { size: "large", children: getHeadline(status) }), jsxRuntimeExports$1.jsx(Body, { size: "large", children: message ? message : getMessage(status) })] })] }) }));
|
|
9704
9750
|
}
|
|
9705
9751
|
|
|
9706
9752
|
var styles$m = {"grid":"grid-module_grid__UQeew","align-start":"grid-module_align-start__Z7pvl","align-center":"grid-module_align-center__Rwlbt","align-end":"grid-module_align-end__nuXn1","align-stretch":"grid-module_align-stretch__6SP1w","align-baseline":"grid-module_align-baseline__ajEPv","justify-start":"grid-module_justify-start__hRYMn","justify-center":"grid-module_justify-center__zQ7Ym","justify-end":"grid-module_justify-end__92x6b","justify-between":"grid-module_justify-between__vQXi3","flow-row":"grid-module_flow-row__bI9DV","flow-column":"grid-module_flow-column__lsmAV","flow-dense":"grid-module_flow-dense__rAnOn","flow-rowDense":"grid-module_flow-rowDense__vvLwD","flow-columnDense":"grid-module_flow-columnDense__HnI7j","columns-1":"grid-module_columns-1__ISyE5","columns-2":"grid-module_columns-2__nAJXX","columns-3":"grid-module_columns-3__jSanv","columns-4":"grid-module_columns-4__TPrmV","gap-xs":"grid-module_gap-xs__jJXAg","gap-sm":"grid-module_gap-sm__lSOTF","gap-md":"grid-module_gap-md__d44tx","gap-lg":"grid-module_gap-lg__QxI9L","gap-xl":"grid-module_gap-xl__0VXE9","gapX-xs":"grid-module_gapX-xs__vCzot","gapX-sm":"grid-module_gapX-sm__3p68N","gapX-md":"grid-module_gapX-md__JPO3S","gapX-lg":"grid-module_gapX-lg__qFCBX","gapX-xl":"grid-module_gapX-xl__J141F","gapY-xs":"grid-module_gapY-xs__yx6Mm","gapY-sm":"grid-module_gapY-sm__uopNl","gapY-md":"grid-module_gapY-md__4XBeo","gapY-lg":"grid-module_gapY-lg__QrF6Z","gapY-xl":"grid-module_gapY-xl__Y6SHF"};
|
|
@@ -10015,7 +10061,8 @@ const $cb5cc270b50c6fcd$export$7c6e2c02157bb7d2 = $cb5cc270b50c6fcd$export$d7e1f
|
|
|
10015
10061
|
|
|
10016
10062
|
var styles$i = {"popover":"popover-module_popover__Jh8Hg"};
|
|
10017
10063
|
|
|
10018
|
-
const
|
|
10064
|
+
const popoverContent = cva(styles$i.popover);
|
|
10065
|
+
const PopoverContent = React__default.forwardRef(({ className, align = "center", sideOffset = 4, ...props }, ref) => (jsxRuntimeExports$1.jsx($cb5cc270b50c6fcd$export$602eac185826482c, { children: jsxRuntimeExports$1.jsx($cb5cc270b50c6fcd$export$7c6e2c02157bb7d2, { ref: ref, align: align, sideOffset: sideOffset, className: popoverContent({ className }), ...props }) })));
|
|
10019
10066
|
PopoverContent.displayName = $cb5cc270b50c6fcd$export$7c6e2c02157bb7d2.displayName;
|
|
10020
10067
|
const Popover = Object.assign($cb5cc270b50c6fcd$export$be92b6f5f03c0fe9, {
|
|
10021
10068
|
Trigger: $cb5cc270b50c6fcd$export$41fb9f06171c75f4,
|
|
@@ -28101,7 +28148,7 @@ function DayPicker(props) {
|
|
|
28101
28148
|
return (jsxRuntimeExports.jsx(RootProvider, __assign({}, props, { children: jsxRuntimeExports.jsx(Root, { initialProps: props }) })));
|
|
28102
28149
|
}
|
|
28103
28150
|
|
|
28104
|
-
var styles$6 = {"calendarRoot":"calendar-module_calendarRoot__KnBz-","caption":"calendar-module_caption__KH06I","caption_label":"calendar-module_caption_label__C5Ys7","nav_button":"calendar-module_nav_button__8W5py","nav_button_previous":"calendar-module_nav_button_previous__lWJYm","nav_button_next":"calendar-module_nav_button_next__1MzRT","head":"calendar-module_head__EIxyS","head_cell":"calendar-module_head_cell__z8NlN","cell":"calendar-module_cell__TTpcD","day_today":"calendar-module_day_today__P35-i","day_range_middle":"calendar-module_day_range_middle__3yKS1","day_range_start":"calendar-module_day_range_start__Qyhit","day_range_end":"calendar-module_day_range_end__YF0ad","row":"calendar-module_row__cjS3G","day":"calendar-module_day__rQFGK","day_outside":"calendar-module_day_outside__WN68B"};
|
|
28151
|
+
var styles$6 = {"calendarRoot":"calendar-module_calendarRoot__KnBz-","caption":"calendar-module_caption__KH06I","caption_label":"calendar-module_caption_label__C5Ys7","nav_button":"calendar-module_nav_button__8W5py","nav_button_previous":"calendar-module_nav_button_previous__lWJYm","nav_button_next":"calendar-module_nav_button_next__1MzRT","head":"calendar-module_head__EIxyS","head_cell":"calendar-module_head_cell__z8NlN","cell":"calendar-module_cell__TTpcD","day_today":"calendar-module_day_today__P35-i","day_range_middle":"calendar-module_day_range_middle__3yKS1","day_range_start":"calendar-module_day_range_start__Qyhit","day_range_end":"calendar-module_day_range_end__YF0ad","row":"calendar-module_row__cjS3G","day":"calendar-module_day__rQFGK","day_outside":"calendar-module_day_outside__WN68B","months":"calendar-module_months__IN75k","calendarPopover":"calendar-module_calendarPopover__PY4sa","datePickerInput":"calendar-module_datePickerInput__aOnRQ"};
|
|
28105
28152
|
|
|
28106
28153
|
const root$1 = cva(styles$6.calendarRoot);
|
|
28107
28154
|
const Calendar = function ({ className, classNames, showOutsideDays = true, ...props }) {
|
|
@@ -28125,10 +28172,100 @@ const Calendar = function ({ className, classNames, showOutsideDays = true, ...p
|
|
|
28125
28172
|
day_range_middle: styles$6.day_range_middle,
|
|
28126
28173
|
day_range_end: styles$6.day_range_end,
|
|
28127
28174
|
day_range_start: styles$6.day_range_start,
|
|
28175
|
+
months: styles$6.months,
|
|
28128
28176
|
...classNames,
|
|
28129
28177
|
}, className: root$1({ className }), ...props }));
|
|
28130
28178
|
};
|
|
28131
28179
|
|
|
28180
|
+
var styles$5 = {"textfield":"textfield-module_textfield__u4AGg","textfield-sm":"textfield-module_textfield-sm__OKPic","textfield-md":"textfield-module_textfield-md__e2ayW","textfield-invlid":"textfield-module_textfield-invlid__zo9MF","textfield-valid":"textfield-module_textfield-valid__6rMM9","textfield-leading":"textfield-module_textfield-leading__AE-ld","textfield-trailing":"textfield-module_textfield-trailing__Hj2jX"};
|
|
28181
|
+
|
|
28182
|
+
const textfield = cva(styles$5.textfield, {
|
|
28183
|
+
variants: {
|
|
28184
|
+
size: {
|
|
28185
|
+
small: styles$5["textfield-sm"],
|
|
28186
|
+
medium: styles$5["textfield-md"],
|
|
28187
|
+
},
|
|
28188
|
+
state: {
|
|
28189
|
+
invalid: styles$5["textfield-invalid"],
|
|
28190
|
+
valid: styles$5["textfield-valid"],
|
|
28191
|
+
},
|
|
28192
|
+
hasLeadingElement: {
|
|
28193
|
+
true: styles$5["textfield-leading"],
|
|
28194
|
+
},
|
|
28195
|
+
hasTrailingElement: {
|
|
28196
|
+
true: styles$5["textfield-trailing"],
|
|
28197
|
+
},
|
|
28198
|
+
},
|
|
28199
|
+
defaultVariants: {
|
|
28200
|
+
size: "small",
|
|
28201
|
+
},
|
|
28202
|
+
});
|
|
28203
|
+
const TextField = forwardRef(({ leading, trailing, className, src, size, state, style, ...props }, ref) => {
|
|
28204
|
+
const hasLeadingElement = Boolean(leading);
|
|
28205
|
+
const hasTrailingElement = Boolean(trailing);
|
|
28206
|
+
return (jsxRuntimeExports$1.jsxs(Flex, { align: "center", style: { position: "relative", width: "100%" }, children: [hasLeadingElement ? (jsxRuntimeExports$1.jsx(Flex, { style: { position: "absolute", left: "8px" }, children: leading })) : null, jsxRuntimeExports$1.jsx("input", { className: cx(textfield({
|
|
28207
|
+
size,
|
|
28208
|
+
state,
|
|
28209
|
+
className,
|
|
28210
|
+
hasLeadingElement,
|
|
28211
|
+
hasTrailingElement,
|
|
28212
|
+
})), ...props, ref: ref }), hasTrailingElement ? (jsxRuntimeExports$1.jsx(Flex, { style: { position: "absolute", right: "8px" }, children: trailing })) : null] }));
|
|
28213
|
+
});
|
|
28214
|
+
TextField.displayName = "TextField";
|
|
28215
|
+
|
|
28216
|
+
var dayjs_min = {exports: {}};
|
|
28217
|
+
|
|
28218
|
+
(function (module, exports) {
|
|
28219
|
+
!function(t,e){module.exports=e();}(commonjsGlobal,(function(){var t=1e3,e=6e4,n=36e5,r="millisecond",i="second",s="minute",u="hour",a="day",o="week",c="month",f="quarter",h="year",d="date",l="Invalid Date",$=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,y=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,M={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(t){var e=["th","st","nd","rd"],n=t%100;return "["+t+(e[(n-20)%10]||e[n]||e[0])+"]"}},m=function(t,e,n){var r=String(t);return !r||r.length>=e?t:""+Array(e+1-r.length).join(n)+t},v={s:m,z:function(t){var e=-t.utcOffset(),n=Math.abs(e),r=Math.floor(n/60),i=n%60;return (e<=0?"+":"-")+m(r,2,"0")+":"+m(i,2,"0")},m:function t(e,n){if(e.date()<n.date())return -t(n,e);var r=12*(n.year()-e.year())+(n.month()-e.month()),i=e.clone().add(r,c),s=n-i<0,u=e.clone().add(r+(s?-1:1),c);return +(-(r+(n-i)/(s?i-u:u-i))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(t){return {M:c,y:h,w:o,d:a,D:d,h:u,m:s,s:i,ms:r,Q:f}[t]||String(t||"").toLowerCase().replace(/s$/,"")},u:function(t){return void 0===t}},g="en",D={};D[g]=M;var p="$isDayjsObject",S=function(t){return t instanceof _||!(!t||!t[p])},w=function t(e,n,r){var i;if(!e)return g;if("string"==typeof e){var s=e.toLowerCase();D[s]&&(i=s),n&&(D[s]=n,i=s);var u=e.split("-");if(!i&&u.length>1)return t(u[0])}else {var a=e.name;D[a]=e,i=a;}return !r&&i&&(g=i),i||!r&&g},O=function(t,e){if(S(t))return t.clone();var n="object"==typeof e?e:{};return n.date=t,n.args=arguments,new _(n)},b=v;b.l=w,b.i=S,b.w=function(t,e){return O(t,{locale:e.$L,utc:e.$u,x:e.$x,$offset:e.$offset})};var _=function(){function M(t){this.$L=w(t.locale,null,!0),this.parse(t),this.$x=this.$x||t.x||{},this[p]=!0;}var m=M.prototype;return m.parse=function(t){this.$d=function(t){var e=t.date,n=t.utc;if(null===e)return new Date(NaN);if(b.u(e))return new Date;if(e instanceof Date)return new Date(e);if("string"==typeof e&&!/Z$/i.test(e)){var r=e.match($);if(r){var i=r[2]-1||0,s=(r[7]||"0").substring(0,3);return n?new Date(Date.UTC(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)):new Date(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)}}return new Date(e)}(t),this.init();},m.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds();},m.$utils=function(){return b},m.isValid=function(){return !(this.$d.toString()===l)},m.isSame=function(t,e){var n=O(t);return this.startOf(e)<=n&&n<=this.endOf(e)},m.isAfter=function(t,e){return O(t)<this.startOf(e)},m.isBefore=function(t,e){return this.endOf(e)<O(t)},m.$g=function(t,e,n){return b.u(t)?this[e]:this.set(n,t)},m.unix=function(){return Math.floor(this.valueOf()/1e3)},m.valueOf=function(){return this.$d.getTime()},m.startOf=function(t,e){var n=this,r=!!b.u(e)||e,f=b.p(t),l=function(t,e){var i=b.w(n.$u?Date.UTC(n.$y,e,t):new Date(n.$y,e,t),n);return r?i:i.endOf(a)},$=function(t,e){return b.w(n.toDate()[t].apply(n.toDate("s"),(r?[0,0,0,0]:[23,59,59,999]).slice(e)),n)},y=this.$W,M=this.$M,m=this.$D,v="set"+(this.$u?"UTC":"");switch(f){case h:return r?l(1,0):l(31,11);case c:return r?l(1,M):l(0,M+1);case o:var g=this.$locale().weekStart||0,D=(y<g?y+7:y)-g;return l(r?m-D:m+(6-D),M);case a:case d:return $(v+"Hours",0);case u:return $(v+"Minutes",1);case s:return $(v+"Seconds",2);case i:return $(v+"Milliseconds",3);default:return this.clone()}},m.endOf=function(t){return this.startOf(t,!1)},m.$set=function(t,e){var n,o=b.p(t),f="set"+(this.$u?"UTC":""),l=(n={},n[a]=f+"Date",n[d]=f+"Date",n[c]=f+"Month",n[h]=f+"FullYear",n[u]=f+"Hours",n[s]=f+"Minutes",n[i]=f+"Seconds",n[r]=f+"Milliseconds",n)[o],$=o===a?this.$D+(e-this.$W):e;if(o===c||o===h){var y=this.clone().set(d,1);y.$d[l]($),y.init(),this.$d=y.set(d,Math.min(this.$D,y.daysInMonth())).$d;}else l&&this.$d[l]($);return this.init(),this},m.set=function(t,e){return this.clone().$set(t,e)},m.get=function(t){return this[b.p(t)]()},m.add=function(r,f){var d,l=this;r=Number(r);var $=b.p(f),y=function(t){var e=O(l);return b.w(e.date(e.date()+Math.round(t*r)),l)};if($===c)return this.set(c,this.$M+r);if($===h)return this.set(h,this.$y+r);if($===a)return y(1);if($===o)return y(7);var M=(d={},d[s]=e,d[u]=n,d[i]=t,d)[$]||1,m=this.$d.getTime()+r*M;return b.w(m,this)},m.subtract=function(t,e){return this.add(-1*t,e)},m.format=function(t){var e=this,n=this.$locale();if(!this.isValid())return n.invalidDate||l;var r=t||"YYYY-MM-DDTHH:mm:ssZ",i=b.z(this),s=this.$H,u=this.$m,a=this.$M,o=n.weekdays,c=n.months,f=n.meridiem,h=function(t,n,i,s){return t&&(t[n]||t(e,r))||i[n].slice(0,s)},d=function(t){return b.s(s%12||12,t,"0")},$=f||function(t,e,n){var r=t<12?"AM":"PM";return n?r.toLowerCase():r};return r.replace(y,(function(t,r){return r||function(t){switch(t){case"YY":return String(e.$y).slice(-2);case"YYYY":return b.s(e.$y,4,"0");case"M":return a+1;case"MM":return b.s(a+1,2,"0");case"MMM":return h(n.monthsShort,a,c,3);case"MMMM":return h(c,a);case"D":return e.$D;case"DD":return b.s(e.$D,2,"0");case"d":return String(e.$W);case"dd":return h(n.weekdaysMin,e.$W,o,2);case"ddd":return h(n.weekdaysShort,e.$W,o,3);case"dddd":return o[e.$W];case"H":return String(s);case"HH":return b.s(s,2,"0");case"h":return d(1);case"hh":return d(2);case"a":return $(s,u,!0);case"A":return $(s,u,!1);case"m":return String(u);case"mm":return b.s(u,2,"0");case"s":return String(e.$s);case"ss":return b.s(e.$s,2,"0");case"SSS":return b.s(e.$ms,3,"0");case"Z":return i}return null}(t)||i.replace(":","")}))},m.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},m.diff=function(r,d,l){var $,y=this,M=b.p(d),m=O(r),v=(m.utcOffset()-this.utcOffset())*e,g=this-m,D=function(){return b.m(y,m)};switch(M){case h:$=D()/12;break;case c:$=D();break;case f:$=D()/3;break;case o:$=(g-v)/6048e5;break;case a:$=(g-v)/864e5;break;case u:$=g/n;break;case s:$=g/e;break;case i:$=g/t;break;default:$=g;}return l?$:b.a($)},m.daysInMonth=function(){return this.endOf(c).$D},m.$locale=function(){return D[this.$L]},m.locale=function(t,e){if(!t)return this.$L;var n=this.clone(),r=w(t,e,!0);return r&&(n.$L=r),n},m.clone=function(){return b.w(this.$d,this)},m.toDate=function(){return new Date(this.valueOf())},m.toJSON=function(){return this.isValid()?this.toISOString():null},m.toISOString=function(){return this.$d.toISOString()},m.toString=function(){return this.$d.toUTCString()},M}(),k=_.prototype;return O.prototype=k,[["$ms",r],["$s",i],["$m",s],["$H",u],["$W",a],["$M",c],["$y",h],["$D",d]].forEach((function(t){k[t[1]]=function(e){return this.$g(e,t[0],t[1])};})),O.extend=function(t,e){return t.$i||(t(e,_,O),t.$i=!0),O},O.locale=w,O.isDayjs=S,O.unix=function(t){return O(1e3*t)},O.en=D[g],O.Ls=D,O.p={},O}));
|
|
28220
|
+
} (dayjs_min));
|
|
28221
|
+
|
|
28222
|
+
var dayjs_minExports = dayjs_min.exports;
|
|
28223
|
+
var dayjs = /*@__PURE__*/getDefaultExportFromCjs(dayjs_minExports);
|
|
28224
|
+
|
|
28225
|
+
function DatePicker({ side = "top", dateFormat = "DD/MM/YYYY", textFieldProps, calendarProps, value = new Date(), onSelect = () => { }, }) {
|
|
28226
|
+
const [showCalendar, setShowCalendar] = useState(false);
|
|
28227
|
+
const dateValue = dayjs(value).format(dateFormat);
|
|
28228
|
+
const handleSelect = (day, selectedDay) => {
|
|
28229
|
+
const selected = day || selectedDay;
|
|
28230
|
+
onSelect(selected);
|
|
28231
|
+
setShowCalendar(false);
|
|
28232
|
+
};
|
|
28233
|
+
function onOpenChange(open) {
|
|
28234
|
+
setShowCalendar(Boolean(open));
|
|
28235
|
+
}
|
|
28236
|
+
return (jsxRuntimeExports$1.jsxs(Popover, { open: showCalendar, onOpenChange: onOpenChange, children: [jsxRuntimeExports$1.jsx(Popover.Trigger, { asChild: true, children: jsxRuntimeExports$1.jsx(TextField, { value: dateValue, trailing: jsxRuntimeExports$1.jsx(CalendarIcon, {}), className: styles$6.datePickerInput, readOnly: true, ...textFieldProps }) }), jsxRuntimeExports$1.jsx(Popover.Content, { side: side, className: styles$6.calendarPopover, children: jsxRuntimeExports$1.jsx(Calendar, { ...calendarProps, mode: "single", selected: value, defaultMonth: value, onSelect: handleSelect }) })] }));
|
|
28237
|
+
}
|
|
28238
|
+
|
|
28239
|
+
function RangePicker({ side = "top", dateFormat = "DD/MM/YYYY", textFieldProps, calendarProps, onSelect = () => { }, value = {
|
|
28240
|
+
to: new Date(),
|
|
28241
|
+
from: new Date(),
|
|
28242
|
+
}, pickerGroupClassName, }) {
|
|
28243
|
+
const [showCalendar, setShowCalendar] = useState(false);
|
|
28244
|
+
const [currentRangeField, setCurrentRangeField] = useState("from");
|
|
28245
|
+
const startDate = dayjs(value.from).format(dateFormat);
|
|
28246
|
+
const endDate = dayjs(value.to).format(dateFormat);
|
|
28247
|
+
// 1st click will select the start date.
|
|
28248
|
+
// 2nd click will select the end date.
|
|
28249
|
+
// 3rd click will select the start date again.
|
|
28250
|
+
const handleSelect = (range, selectedDay) => {
|
|
28251
|
+
const from = value?.from || range?.from;
|
|
28252
|
+
if (currentRangeField === "to" && dayjs(selectedDay).isAfter(dayjs(from))) {
|
|
28253
|
+
// update the end date
|
|
28254
|
+
onSelect({ from, to: selectedDay });
|
|
28255
|
+
setCurrentRangeField("from");
|
|
28256
|
+
}
|
|
28257
|
+
else {
|
|
28258
|
+
// reset the range and select start day
|
|
28259
|
+
onSelect({ from: selectedDay });
|
|
28260
|
+
setCurrentRangeField("to");
|
|
28261
|
+
}
|
|
28262
|
+
};
|
|
28263
|
+
function onOpenChange(open) {
|
|
28264
|
+
setShowCalendar(Boolean(open));
|
|
28265
|
+
}
|
|
28266
|
+
return (jsxRuntimeExports$1.jsxs(Popover, { open: showCalendar, onOpenChange: onOpenChange, children: [jsxRuntimeExports$1.jsx(Popover.Trigger, { asChild: true, children: jsxRuntimeExports$1.jsxs(Flex, { gap: "medium", className: pickerGroupClassName, children: [jsxRuntimeExports$1.jsx(TextField, { value: startDate, trailing: jsxRuntimeExports$1.jsx(CalendarIcon, {}), className: styles$6.datePickerInput, readOnly: true, ...textFieldProps }), jsxRuntimeExports$1.jsx(TextField, { value: endDate, trailing: jsxRuntimeExports$1.jsx(CalendarIcon, {}), className: styles$6.datePickerInput, readOnly: true, ...textFieldProps })] }) }), jsxRuntimeExports$1.jsx(Popover.Content, { side: side, className: styles$6.calendarPopover, children: jsxRuntimeExports$1.jsx(Calendar, { showOutsideDays: false, numberOfMonths: 2, defaultMonth: value.from, ...calendarProps, mode: "range", selected: value, onSelect: handleSelect }) })] }));
|
|
28267
|
+
}
|
|
28268
|
+
|
|
28132
28269
|
/**
|
|
28133
28270
|
* table-core
|
|
28134
28271
|
*
|
|
@@ -31607,43 +31744,41 @@ function DataTableFilterOptions({ children, ...props }) {
|
|
|
31607
31744
|
})] })) : null] }));
|
|
31608
31745
|
}
|
|
31609
31746
|
|
|
31610
|
-
var styles$
|
|
31611
|
-
|
|
31612
|
-
const textfield = cva(styles$5.textfield, {
|
|
31613
|
-
variants: {
|
|
31614
|
-
size: {
|
|
31615
|
-
small: styles$5["textfield-sm"],
|
|
31616
|
-
medium: styles$5["textfield-md"],
|
|
31617
|
-
},
|
|
31618
|
-
state: {
|
|
31619
|
-
invalid: styles$5["textfield-invalid"],
|
|
31620
|
-
valid: styles$5["textfield-valid"],
|
|
31621
|
-
},
|
|
31622
|
-
leading: {
|
|
31623
|
-
true: styles$5["textfield-leading"],
|
|
31624
|
-
},
|
|
31625
|
-
},
|
|
31626
|
-
defaultVariants: {
|
|
31627
|
-
size: "small",
|
|
31628
|
-
},
|
|
31629
|
-
});
|
|
31630
|
-
const TextField = forwardRef(({ leading, className, src, size, state, style, ...props }, ref) => {
|
|
31631
|
-
return (jsxRuntimeExports$1.jsxs(Flex, { align: "center", style: { position: "relative", width: "100%" }, children: [leading ? (jsxRuntimeExports$1.jsx(Flex, { style: { position: "absolute", left: "8px" }, children: leading })) : null, jsxRuntimeExports$1.jsx("input", { className: cx(textfield({ size, state, className, leading })), style: leading ? { paddingLeft: "32px" } : {}, ...props, ref: ref })] }));
|
|
31632
|
-
});
|
|
31633
|
-
TextField.displayName = "TextField";
|
|
31634
|
-
|
|
31635
|
-
var styles$4 = {"wrapper":"datatable-module_wrapper__Sxg2d","datatable":"datatable-module_datatable__z-Th2","table":"datatable-module_table__x2IkY","head":"datatable-module_head__zCfCW","toolbar":"datatable-module_toolbar__lO-aI","chip":"datatable-module_chip__IiwTD","chipWrapper":"datatable-module_chipWrapper__iz69x","filterOperator":"datatable-module_filterOperator__qtDsH"};
|
|
31747
|
+
var styles$4 = {"wrapper":"datatable-module_wrapper__Sxg2d","datatable":"datatable-module_datatable__z-Th2","table":"datatable-module_table__x2IkY","head":"datatable-module_head__zCfCW","toolbar":"datatable-module_toolbar__lO-aI","chip":"datatable-module_chip__IiwTD","chipWrapper":"datatable-module_chipWrapper__iz69x","filterOperator":"datatable-module_filterOperator__qtDsH","filterText":"datatable-module_filterText__w00L8","flex1":"datatable-module_flex1__fA-kQ"};
|
|
31636
31748
|
|
|
31637
31749
|
const columnTypesMap = {
|
|
31638
31750
|
select: "select",
|
|
31639
31751
|
number: "number",
|
|
31640
31752
|
text: "text",
|
|
31753
|
+
date: "date",
|
|
31641
31754
|
};
|
|
31642
31755
|
const filterValueTypeMap = {
|
|
31643
31756
|
select: "select",
|
|
31644
31757
|
text: "text",
|
|
31758
|
+
datePicker: "datePicker",
|
|
31759
|
+
rangePicker: "rangePicker",
|
|
31645
31760
|
};
|
|
31646
31761
|
|
|
31762
|
+
var isSameOrAfter$1 = {exports: {}};
|
|
31763
|
+
|
|
31764
|
+
(function (module, exports) {
|
|
31765
|
+
!function(e,t){module.exports=t();}(commonjsGlobal,(function(){return function(e,t){t.prototype.isSameOrAfter=function(e,t){return this.isSame(e,t)||this.isAfter(e,t)};}}));
|
|
31766
|
+
} (isSameOrAfter$1));
|
|
31767
|
+
|
|
31768
|
+
var isSameOrAfterExports = isSameOrAfter$1.exports;
|
|
31769
|
+
var isSameOrAfter = /*@__PURE__*/getDefaultExportFromCjs(isSameOrAfterExports);
|
|
31770
|
+
|
|
31771
|
+
var isSameOrBefore$1 = {exports: {}};
|
|
31772
|
+
|
|
31773
|
+
(function (module, exports) {
|
|
31774
|
+
!function(e,i){module.exports=i();}(commonjsGlobal,(function(){return function(e,i){i.prototype.isSameOrBefore=function(e,i){return this.isSame(e,i)||this.isBefore(e,i)};}}));
|
|
31775
|
+
} (isSameOrBefore$1));
|
|
31776
|
+
|
|
31777
|
+
var isSameOrBeforeExports = isSameOrBefore$1.exports;
|
|
31778
|
+
var isSameOrBefore = /*@__PURE__*/getDefaultExportFromCjs(isSameOrBeforeExports);
|
|
31779
|
+
|
|
31780
|
+
dayjs.extend(isSameOrAfter);
|
|
31781
|
+
dayjs.extend(isSameOrBefore);
|
|
31647
31782
|
const operationsOptions = {
|
|
31648
31783
|
[columnTypesMap.select]: [
|
|
31649
31784
|
{
|
|
@@ -31759,25 +31894,85 @@ const operationsOptions = {
|
|
|
31759
31894
|
hideValueField: true,
|
|
31760
31895
|
},
|
|
31761
31896
|
],
|
|
31897
|
+
[columnTypesMap.date]: [
|
|
31898
|
+
{
|
|
31899
|
+
label: "is",
|
|
31900
|
+
value: "is",
|
|
31901
|
+
fn: (row, columnId, filterValue) => {
|
|
31902
|
+
return dayjs(row.getValue(columnId)).isSame(dayjs(filterValue.date), "day");
|
|
31903
|
+
},
|
|
31904
|
+
},
|
|
31905
|
+
{
|
|
31906
|
+
label: "is before",
|
|
31907
|
+
value: "is before",
|
|
31908
|
+
fn: (row, columnId, filterValue) => {
|
|
31909
|
+
return dayjs(row.getValue(columnId)).isBefore(dayjs(filterValue.date), "day");
|
|
31910
|
+
},
|
|
31911
|
+
},
|
|
31912
|
+
{
|
|
31913
|
+
label: "is after",
|
|
31914
|
+
value: "is after",
|
|
31915
|
+
fn: (row, columnId, filterValue) => {
|
|
31916
|
+
return dayjs(row.getValue(columnId)).isAfter(dayjs(filterValue.date), "day");
|
|
31917
|
+
},
|
|
31918
|
+
},
|
|
31919
|
+
{
|
|
31920
|
+
label: "is between",
|
|
31921
|
+
value: "is between",
|
|
31922
|
+
fn: (row, columnId, filterValue) => {
|
|
31923
|
+
return (dayjs(row.getValue(columnId)).isSameOrAfter(dayjs(filterValue.dateRange?.from), "day") &&
|
|
31924
|
+
dayjs(row.getValue(columnId)).isSameOrBefore(dayjs(filterValue.dateRange?.to), "day"));
|
|
31925
|
+
},
|
|
31926
|
+
component: "rangePicker",
|
|
31927
|
+
},
|
|
31928
|
+
],
|
|
31762
31929
|
};
|
|
31763
31930
|
|
|
31764
|
-
const
|
|
31765
|
-
|
|
31766
|
-
|
|
31767
|
-
|
|
31768
|
-
|
|
31931
|
+
const getFilterValueType = ({ filterOperation, columnType, }) => {
|
|
31932
|
+
if (filterOperation?.component) {
|
|
31933
|
+
return filterOperation?.component;
|
|
31934
|
+
}
|
|
31935
|
+
else if (columnType === columnTypesMap.date) {
|
|
31936
|
+
return filterValueTypeMap.datePicker;
|
|
31937
|
+
}
|
|
31938
|
+
else if (columnType === columnTypesMap.select) {
|
|
31939
|
+
return filterValueTypeMap.select;
|
|
31940
|
+
}
|
|
31941
|
+
else {
|
|
31942
|
+
return filterValueTypeMap.text;
|
|
31943
|
+
}
|
|
31944
|
+
};
|
|
31945
|
+
const FilterValues = ({ columnType = filterValueTypeMap.text, options = [], onValueChange, filterOperation, ...props }) => {
|
|
31946
|
+
const [value, setValue] = useState({
|
|
31947
|
+
value: "",
|
|
31948
|
+
date: new Date(),
|
|
31949
|
+
dateRange: {
|
|
31950
|
+
to: new Date(),
|
|
31951
|
+
from: new Date(),
|
|
31952
|
+
},
|
|
31953
|
+
});
|
|
31954
|
+
const valueType = getFilterValueType({ filterOperation, columnType });
|
|
31769
31955
|
useEffect(() => {
|
|
31770
|
-
if (
|
|
31771
|
-
onValueChange(
|
|
31956
|
+
if (onValueChange) {
|
|
31957
|
+
onValueChange(value);
|
|
31772
31958
|
}
|
|
31773
31959
|
}, [value]);
|
|
31774
|
-
|
|
31775
|
-
|
|
31776
|
-
|
|
31960
|
+
switch (valueType) {
|
|
31961
|
+
case filterValueTypeMap.select:
|
|
31962
|
+
return (jsxRuntimeExports$1.jsxs(Select, { value: value.value, onValueChange: (value) => setValue({ value }), children: [jsxRuntimeExports$1.jsx(Select.Trigger, { children: jsxRuntimeExports$1.jsx(Select.Value, { placeholder: "Select value" }) }), jsxRuntimeExports$1.jsx(Select.Content, { children: options.map((opt) => {
|
|
31963
|
+
return (jsxRuntimeExports$1.jsx(Select.Item, { value: opt.value, children: opt.label || opt.value }, opt.key));
|
|
31964
|
+
}) })] }));
|
|
31965
|
+
case filterValueTypeMap.datePicker:
|
|
31966
|
+
return (jsxRuntimeExports$1.jsx(DatePicker, { onSelect: (date) => setValue({ date }), value: value.date }));
|
|
31967
|
+
case filterValueTypeMap.rangePicker:
|
|
31968
|
+
return (jsxRuntimeExports$1.jsx(RangePicker, { onSelect: (dateRange) => setValue({ dateRange }), value: value.dateRange }));
|
|
31969
|
+
default:
|
|
31970
|
+
return (jsxRuntimeExports$1.jsx(TextField, { value: value.value, onChange: (e) => setValue({ value: e.target.value }) }));
|
|
31971
|
+
}
|
|
31777
31972
|
};
|
|
31778
31973
|
const Operation = ({ columnType = columnTypesMap.text, onOperationSelect, }) => {
|
|
31779
31974
|
const options = operationsOptions[columnType] || [];
|
|
31780
|
-
const [value, setValue] = useState(options?.[0]
|
|
31975
|
+
const [value, setValue] = useState(options?.[0]?.value);
|
|
31781
31976
|
useEffect(() => {
|
|
31782
31977
|
const selectedOption = options.find((o) => o.value === value);
|
|
31783
31978
|
if (selectedOption) {
|
|
@@ -31809,7 +32004,7 @@ const FilteredChip = ({ column, updateColumnCustomFilter, }) => {
|
|
|
31809
32004
|
setFilterOperation(undefined);
|
|
31810
32005
|
setFilterValue({});
|
|
31811
32006
|
}
|
|
31812
|
-
return (jsxRuntimeExports$1.jsxs(Box, { className: styles$4.chip, children: [jsxRuntimeExports$1.jsx(Text, { children: columnName }), jsxRuntimeExports$1.jsx(Operation, { columnType: filterVariant, onOperationSelect: setFilterOperation }), filterOperation?.hideValueField ? null : (jsxRuntimeExports$1.jsx(FilterValues, { columnType: filterVariant, options: options, onValueChange: setFilterValue })), jsxRuntimeExports$1.jsx(Flex, { children: jsxRuntimeExports$1.jsx(Cross1Icon, { height: "12", width: "12", onClick: removeFilter }) })] }));
|
|
32007
|
+
return (jsxRuntimeExports$1.jsxs(Box, { className: styles$4.chip, children: [jsxRuntimeExports$1.jsx(Text, { className: styles$4.filterText, children: columnName }), jsxRuntimeExports$1.jsx(Operation, { columnType: filterVariant, onOperationSelect: setFilterOperation }), filterOperation?.hideValueField ? null : (jsxRuntimeExports$1.jsx(FilterValues, { columnType: filterVariant, options: options, onValueChange: setFilterValue, filterOperation: filterOperation })), jsxRuntimeExports$1.jsx(Flex, { children: jsxRuntimeExports$1.jsx(Cross1Icon, { height: "12", width: "12", onClick: removeFilter }) })] }));
|
|
31813
32008
|
};
|
|
31814
32009
|
|
|
31815
32010
|
function DataTableFilterChips(props) {
|
|
@@ -31915,7 +32110,98 @@ const Table = Object.assign(TableRoot, {
|
|
|
31915
32110
|
Caption: TableCaption,
|
|
31916
32111
|
});
|
|
31917
32112
|
|
|
31918
|
-
|
|
32113
|
+
/**
|
|
32114
|
+
* @internal
|
|
32115
|
+
*/
|
|
32116
|
+
const SkeletonThemeContext = React__default.createContext({});
|
|
32117
|
+
|
|
32118
|
+
/* eslint-disable react/no-array-index-key */
|
|
32119
|
+
const defaultEnableAnimation = true;
|
|
32120
|
+
// For performance & cleanliness, don't add any inline styles unless we have to
|
|
32121
|
+
function styleOptionsToCssProperties({ baseColor, highlightColor, width, height, borderRadius, circle, direction, duration, enableAnimation = defaultEnableAnimation, }) {
|
|
32122
|
+
const style = {};
|
|
32123
|
+
if (direction === 'rtl')
|
|
32124
|
+
style['--animation-direction'] = 'reverse';
|
|
32125
|
+
if (typeof duration === 'number')
|
|
32126
|
+
style['--animation-duration'] = `${duration}s`;
|
|
32127
|
+
if (!enableAnimation)
|
|
32128
|
+
style['--pseudo-element-display'] = 'none';
|
|
32129
|
+
if (typeof width === 'string' || typeof width === 'number')
|
|
32130
|
+
style.width = width;
|
|
32131
|
+
if (typeof height === 'string' || typeof height === 'number')
|
|
32132
|
+
style.height = height;
|
|
32133
|
+
if (typeof borderRadius === 'string' || typeof borderRadius === 'number')
|
|
32134
|
+
style.borderRadius = borderRadius;
|
|
32135
|
+
if (circle)
|
|
32136
|
+
style.borderRadius = '50%';
|
|
32137
|
+
if (typeof baseColor !== 'undefined')
|
|
32138
|
+
style['--base-color'] = baseColor;
|
|
32139
|
+
if (typeof highlightColor !== 'undefined')
|
|
32140
|
+
style['--highlight-color'] = highlightColor;
|
|
32141
|
+
return style;
|
|
32142
|
+
}
|
|
32143
|
+
function Skeleton({ count = 1, wrapper: Wrapper, className: customClassName, containerClassName, containerTestId, circle = false, style: styleProp, ...originalPropsStyleOptions }) {
|
|
32144
|
+
var _a, _b, _c;
|
|
32145
|
+
const contextStyleOptions = React__default.useContext(SkeletonThemeContext);
|
|
32146
|
+
const propsStyleOptions = { ...originalPropsStyleOptions };
|
|
32147
|
+
// DO NOT overwrite style options from the context if `propsStyleOptions`
|
|
32148
|
+
// has properties explicity set to undefined
|
|
32149
|
+
for (const [key, value] of Object.entries(originalPropsStyleOptions)) {
|
|
32150
|
+
if (typeof value === 'undefined') {
|
|
32151
|
+
delete propsStyleOptions[key];
|
|
32152
|
+
}
|
|
32153
|
+
}
|
|
32154
|
+
// Props take priority over context
|
|
32155
|
+
const styleOptions = {
|
|
32156
|
+
...contextStyleOptions,
|
|
32157
|
+
...propsStyleOptions,
|
|
32158
|
+
circle,
|
|
32159
|
+
};
|
|
32160
|
+
// `styleProp` has the least priority out of everything
|
|
32161
|
+
const style = {
|
|
32162
|
+
...styleProp,
|
|
32163
|
+
...styleOptionsToCssProperties(styleOptions),
|
|
32164
|
+
};
|
|
32165
|
+
let className = 'react-loading-skeleton';
|
|
32166
|
+
if (customClassName)
|
|
32167
|
+
className += ` ${customClassName}`;
|
|
32168
|
+
const inline = (_a = styleOptions.inline) !== null && _a !== void 0 ? _a : false;
|
|
32169
|
+
const elements = [];
|
|
32170
|
+
const countCeil = Math.ceil(count);
|
|
32171
|
+
for (let i = 0; i < countCeil; i++) {
|
|
32172
|
+
let thisStyle = style;
|
|
32173
|
+
if (countCeil > count && i === countCeil - 1) {
|
|
32174
|
+
// count is not an integer and we've reached the last iteration of
|
|
32175
|
+
// the loop, so add a "fractional" skeleton.
|
|
32176
|
+
//
|
|
32177
|
+
// For example, if count is 3.5, we've already added 3 full
|
|
32178
|
+
// skeletons, so now we add one more skeleton that is 0.5 times the
|
|
32179
|
+
// original width.
|
|
32180
|
+
const width = (_b = thisStyle.width) !== null && _b !== void 0 ? _b : '100%'; // 100% is the default since that's what's in the CSS
|
|
32181
|
+
const fractionalPart = count % 1;
|
|
32182
|
+
const fractionalWidth = typeof width === 'number'
|
|
32183
|
+
? width * fractionalPart
|
|
32184
|
+
: `calc(${width} * ${fractionalPart})`;
|
|
32185
|
+
thisStyle = { ...thisStyle, width: fractionalWidth };
|
|
32186
|
+
}
|
|
32187
|
+
const skeletonSpan = (React__default.createElement("span", { className: className, style: thisStyle, key: i }, "\u200C"));
|
|
32188
|
+
if (inline) {
|
|
32189
|
+
elements.push(skeletonSpan);
|
|
32190
|
+
}
|
|
32191
|
+
else {
|
|
32192
|
+
// Without the <br />, the skeleton lines will all run together if
|
|
32193
|
+
// `width` is specified
|
|
32194
|
+
elements.push(React__default.createElement(React__default.Fragment, { key: i },
|
|
32195
|
+
skeletonSpan,
|
|
32196
|
+
React__default.createElement("br", null)));
|
|
32197
|
+
}
|
|
32198
|
+
}
|
|
32199
|
+
return (React__default.createElement("span", { className: containerClassName, "data-testid": containerTestId, "aria-live": "polite", "aria-busy": (_c = styleOptions.enableAnimation) !== null && _c !== void 0 ? _c : defaultEnableAnimation }, Wrapper
|
|
32200
|
+
? elements.map((el, i) => React__default.createElement(Wrapper, { key: i }, el))
|
|
32201
|
+
: elements));
|
|
32202
|
+
}
|
|
32203
|
+
|
|
32204
|
+
function DataTableRoot({ columns, data, emptyState, children, parentStyle, isLoading = false, ShouldShowHeader = true, ...props }) {
|
|
31919
32205
|
const [tableCustomFilter, setTableCustomFilter] = React__default.useState({});
|
|
31920
32206
|
const convertedChildren = Children.toArray(children);
|
|
31921
32207
|
const header = convertedChildren.find((child) => child.type === DataTableToolbar) || null;
|
|
@@ -31934,6 +32220,9 @@ function DataTableRoot({ columns, data, emptyState, children, parentStyle, Shoul
|
|
|
31934
32220
|
if (colId && tableCustomFilter.hasOwnProperty(colId)) {
|
|
31935
32221
|
col.filterFn = tableCustomFilter[colId];
|
|
31936
32222
|
}
|
|
32223
|
+
col.cell = isLoading
|
|
32224
|
+
? () => (jsxRuntimeExports$1.jsx(Skeleton, { containerClassName: styles$4.flex1, highlightColor: "var(--background-base)", baseColor: "var(--background-base-hover)" }))
|
|
32225
|
+
: col.cell;
|
|
31937
32226
|
return col;
|
|
31938
32227
|
});
|
|
31939
32228
|
const updateColumnCustomFilter = (id, filterFn) => {
|
|
@@ -31982,14 +32271,16 @@ function DataTableRoot({ columns, data, emptyState, children, parentStyle, Shoul
|
|
|
31982
32271
|
}, children: [jsxRuntimeExports$1.jsxs(Flex, { direction: "column", className: styles$4.datatable, children: [header, jsxRuntimeExports$1.jsxs(Flex, { className: styles$4.tableContainer, style: parentStyle, children: [jsxRuntimeExports$1.jsxs(Table, { ...props, style: tableStyle, children: [jsxRuntimeExports$1.jsx(Table.Header, { children: ShouldShowHeader
|
|
31983
32272
|
? table.getHeaderGroups().map((headerGroup) => (jsxRuntimeExports$1.jsx(Table.Row, { children: headerGroup.headers.map((header, index) => {
|
|
31984
32273
|
return (jsxRuntimeExports$1.jsx(Table.Head, { style: {
|
|
32274
|
+
cursor: "pointer",
|
|
31985
32275
|
...(header.column.columnDef?.meta?.style ?? {}),
|
|
31986
|
-
}, children: jsxRuntimeExports$1.jsxs(Text, { className: styles$4.head, children: [header.isPlaceholder
|
|
32276
|
+
}, onClick: header.column.getToggleSortingHandler(), children: jsxRuntimeExports$1.jsxs(Text, { className: styles$4.head, children: [header.isPlaceholder
|
|
31987
32277
|
? null
|
|
31988
|
-
: flexRender(header.column.columnDef.header, header.getContext()),
|
|
31989
|
-
|
|
31990
|
-
|
|
31991
|
-
|
|
31992
|
-
|
|
32278
|
+
: flexRender(header.column.columnDef.header, header.getContext()), header.column.getCanSort()
|
|
32279
|
+
? {
|
|
32280
|
+
asc: jsxRuntimeExports$1.jsx(CaretUpIcon, {}),
|
|
32281
|
+
desc: jsxRuntimeExports$1.jsx(CaretDownIcon, {}),
|
|
32282
|
+
}[header.column.getIsSorted()] ?? jsxRuntimeExports$1.jsx(CaretSortIcon, {})
|
|
32283
|
+
: null] }) }, `${header.id}_${index}`));
|
|
31993
32284
|
}) }, headerGroup.id)))
|
|
31994
32285
|
: null }), jsxRuntimeExports$1.jsx(Table.Body, { children: table.getRowModel().rows?.length ? (table.getRowModel().rows.map((row) => (jsxRuntimeExports$1.jsx(Table.Row, { "data-state": row.getIsSelected() && "selected", children: row.getVisibleCells().map((cell, index) => (jsxRuntimeExports$1.jsx(Table.Cell, { style: {
|
|
31995
32286
|
...(cell.column.columnDef?.meta?.style ?? {}),
|
|
@@ -32456,5 +32747,5 @@ function Title({ children, className, size, ...props }) {
|
|
|
32456
32747
|
return (jsxRuntimeExports$1.jsx("span", { className: title({ size, className }), ...props, children: children }));
|
|
32457
32748
|
}
|
|
32458
32749
|
|
|
32459
|
-
export { Accordion, Avatar, badge$1 as Badge, Body, Box, Button$1 as Button, Calendar, Checkbox, Command, Container, DataTable, Dialog, Display, DropdownMenu, EmptyState, ErrorState, Flex, Grid, Headline, Image, InputField, Label, Link, Popover, RSelect, Radio, ScrollArea, Select, Separator, Sheet, Sidebar, Switch, Table, Tabs, Text, TextField, Textarea, ThemeProvider, ThemeSwitcher, Title, ToggleGroup, Tooltip, useTable, useTheme };
|
|
32750
|
+
export { Accordion, Avatar, badge$1 as Badge, Body, Box, Button$1 as Button, Calendar, Checkbox, Command, Container, DataTable, DatePicker, Dialog, Display, DropdownMenu, EmptyState, ErrorState, Flex, Grid, Headline, Image, InputField, Label, Link, Popover, RSelect, Radio, RangePicker, ScrollArea, Select, Separator, Sheet, Sidebar, Switch, Table, Tabs, Text, TextField, Textarea, ThemeProvider, ThemeSwitcher, Title, ToggleGroup, Tooltip, useTable, useTheme };
|
|
32460
32751
|
//# sourceMappingURL=index.js.map
|