@ceed/ads 1.8.0-next.10 → 1.8.0-next.3
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/components/DateRangePicker/DateRangePicker.d.ts +0 -10
- package/dist/components/FilterMenu/FilterMenu.d.ts +0 -10
- package/dist/components/FilterMenu/components/PercentageRange.d.ts +1 -1
- package/dist/components/FilterMenu/types.d.ts +2 -2
- package/dist/components/index.d.ts +0 -1
- package/dist/index.cjs +59 -210
- package/dist/index.d.ts +0 -1
- package/dist/index.js +70 -221
- package/framer/index.js +42 -42
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -4121,9 +4121,7 @@ var CalendarButton2 = styled13(IconButton_default, {
|
|
|
4121
4121
|
"&:focus": {
|
|
4122
4122
|
"--Icon-color": "currentColor",
|
|
4123
4123
|
outlineOffset: `${theme.getCssVar("focus-thickness")}`,
|
|
4124
|
-
outline: `${theme.getCssVar("focus-thickness")} solid ${theme.getCssVar(
|
|
4125
|
-
"palette-focusVisible"
|
|
4126
|
-
)}`
|
|
4124
|
+
outline: `${theme.getCssVar("focus-thickness")} solid ${theme.getCssVar("palette-focusVisible")}`
|
|
4127
4125
|
}
|
|
4128
4126
|
}));
|
|
4129
4127
|
var StyledPopper2 = styled13(Popper3, {
|
|
@@ -4149,32 +4147,6 @@ var DateRangePickerRoot = styled13("div", {
|
|
|
4149
4147
|
})({
|
|
4150
4148
|
width: "100%"
|
|
4151
4149
|
});
|
|
4152
|
-
var validValueFormat2 = (value, format) => {
|
|
4153
|
-
try {
|
|
4154
|
-
const [date1Str, date2Str] = value.split(" - ");
|
|
4155
|
-
if (!date1Str || !date2Str) {
|
|
4156
|
-
return false;
|
|
4157
|
-
}
|
|
4158
|
-
const parsedDate1 = parseDate2(date1Str, format);
|
|
4159
|
-
const parsedDate2 = parseDate2(date2Str, format);
|
|
4160
|
-
if (parsedDate1.toString() === "Invalid Date" || parsedDate2.toString() === "Invalid Date") {
|
|
4161
|
-
return false;
|
|
4162
|
-
}
|
|
4163
|
-
const formattedValue = formatValueString2(
|
|
4164
|
-
[parsedDate1, parsedDate2],
|
|
4165
|
-
format
|
|
4166
|
-
);
|
|
4167
|
-
if (value !== formattedValue) {
|
|
4168
|
-
return false;
|
|
4169
|
-
}
|
|
4170
|
-
const regex = new RegExp(
|
|
4171
|
-
`^${format.replace(/Y/g, "\\d").replace(/M/g, "\\d").replace(/D/g, "\\d")} - ${format.replace(/Y/g, "\\d").replace(/M/g, "\\d").replace(/D/g, "\\d")}$`
|
|
4172
|
-
);
|
|
4173
|
-
return regex.test(value);
|
|
4174
|
-
} catch (e) {
|
|
4175
|
-
return false;
|
|
4176
|
-
}
|
|
4177
|
-
};
|
|
4178
4150
|
var formatValueString2 = ([date1, date2], format) => {
|
|
4179
4151
|
const getStr = (date) => {
|
|
4180
4152
|
let day = `${date.getDate()}`;
|
|
@@ -4271,7 +4243,6 @@ var DateRangePicker = forwardRef8(
|
|
|
4271
4243
|
sx,
|
|
4272
4244
|
className,
|
|
4273
4245
|
format = "YYYY/MM/DD",
|
|
4274
|
-
displayFormat = "YYYY/MM/DD",
|
|
4275
4246
|
size,
|
|
4276
4247
|
inputReadOnly,
|
|
4277
4248
|
hideClearButton,
|
|
@@ -4288,27 +4259,12 @@ var DateRangePicker = forwardRef8(
|
|
|
4288
4259
|
[props.name, onChange]
|
|
4289
4260
|
)
|
|
4290
4261
|
);
|
|
4291
|
-
const [displayValue, setDisplayValue] = useState7(
|
|
4292
|
-
() => value ? formatValueString2(parseDates(value, format), displayFormat) : ""
|
|
4293
|
-
);
|
|
4294
4262
|
const [anchorEl, setAnchorEl] = useState7(null);
|
|
4295
4263
|
const open = Boolean(anchorEl);
|
|
4296
4264
|
const calendarValue = useMemo9(
|
|
4297
4265
|
() => value ? parseDates(value, format) : void 0,
|
|
4298
4266
|
[value, format]
|
|
4299
4267
|
);
|
|
4300
|
-
useEffect6(() => {
|
|
4301
|
-
if (value) {
|
|
4302
|
-
try {
|
|
4303
|
-
const dates = parseDates(value, format);
|
|
4304
|
-
const newDisplayValue = formatValueString2(dates, displayFormat);
|
|
4305
|
-
setDisplayValue(newDisplayValue);
|
|
4306
|
-
} catch (error2) {
|
|
4307
|
-
}
|
|
4308
|
-
} else {
|
|
4309
|
-
setDisplayValue("");
|
|
4310
|
-
}
|
|
4311
|
-
}, [displayFormat, value, format]);
|
|
4312
4268
|
useEffect6(() => {
|
|
4313
4269
|
if (!anchorEl) {
|
|
4314
4270
|
innerRef.current?.blur();
|
|
@@ -4319,41 +4275,9 @@ var DateRangePicker = forwardRef8(
|
|
|
4319
4275
|
]);
|
|
4320
4276
|
const handleChange = useCallback10(
|
|
4321
4277
|
(event) => {
|
|
4322
|
-
|
|
4323
|
-
setDisplayValue(
|
|
4324
|
-
value2 ? formatValueString2(parseDates(value2, format), displayFormat) : value2
|
|
4325
|
-
);
|
|
4326
|
-
setValue(value2);
|
|
4327
|
-
},
|
|
4328
|
-
[displayFormat, format, setValue]
|
|
4329
|
-
);
|
|
4330
|
-
const handleDisplayInputChange = useCallback10(
|
|
4331
|
-
(event) => {
|
|
4332
|
-
if (event.target.value === "") {
|
|
4333
|
-
handleChange({
|
|
4334
|
-
target: {
|
|
4335
|
-
name: props.name,
|
|
4336
|
-
value: ""
|
|
4337
|
-
}
|
|
4338
|
-
});
|
|
4339
|
-
return;
|
|
4340
|
-
}
|
|
4341
|
-
const isValidDisplayValue = validValueFormat2(
|
|
4342
|
-
event.target.value,
|
|
4343
|
-
displayFormat
|
|
4344
|
-
);
|
|
4345
|
-
if (isValidDisplayValue) {
|
|
4346
|
-
const dates = parseDates(event.target.value, displayFormat);
|
|
4347
|
-
const formattedValue = formatValueString2(dates, format);
|
|
4348
|
-
handleChange({
|
|
4349
|
-
target: {
|
|
4350
|
-
name: props.name,
|
|
4351
|
-
value: formattedValue
|
|
4352
|
-
}
|
|
4353
|
-
});
|
|
4354
|
-
}
|
|
4278
|
+
setValue(event.target.value);
|
|
4355
4279
|
},
|
|
4356
|
-
[
|
|
4280
|
+
[setValue]
|
|
4357
4281
|
);
|
|
4358
4282
|
const handleCalendarToggle = useCallback10(
|
|
4359
4283
|
(event) => {
|
|
@@ -4365,26 +4289,10 @@ var DateRangePicker = forwardRef8(
|
|
|
4365
4289
|
const handleCalendarChange = useCallback10(
|
|
4366
4290
|
([date1, date2]) => {
|
|
4367
4291
|
if (!date1 || !date2) return;
|
|
4368
|
-
|
|
4369
|
-
if (props.value !== void 0) {
|
|
4370
|
-
onChange?.({ target: { name: props.name, value: formattedValue } });
|
|
4371
|
-
} else {
|
|
4372
|
-
setDisplayValue(
|
|
4373
|
-
formatValueString2([date1, date2], displayFormat)
|
|
4374
|
-
);
|
|
4375
|
-
setValue(formattedValue);
|
|
4376
|
-
}
|
|
4292
|
+
setValue(formatValueString2([date1, date2], format));
|
|
4377
4293
|
setAnchorEl(null);
|
|
4378
4294
|
},
|
|
4379
|
-
[
|
|
4380
|
-
props.value,
|
|
4381
|
-
props.name,
|
|
4382
|
-
onChange,
|
|
4383
|
-
setValue,
|
|
4384
|
-
setAnchorEl,
|
|
4385
|
-
format,
|
|
4386
|
-
displayFormat
|
|
4387
|
-
]
|
|
4295
|
+
[setValue, setAnchorEl, format]
|
|
4388
4296
|
);
|
|
4389
4297
|
const handleInputMouseDown = useCallback10(
|
|
4390
4298
|
(event) => {
|
|
@@ -4402,21 +4310,17 @@ var DateRangePicker = forwardRef8(
|
|
|
4402
4310
|
color: error ? "danger" : innerProps.color,
|
|
4403
4311
|
ref,
|
|
4404
4312
|
size,
|
|
4405
|
-
value
|
|
4406
|
-
onChange:
|
|
4313
|
+
value,
|
|
4314
|
+
onChange: handleChange,
|
|
4407
4315
|
disabled,
|
|
4408
4316
|
required,
|
|
4409
|
-
placeholder: `${
|
|
4317
|
+
placeholder: `${format} - ${format}`,
|
|
4410
4318
|
slotProps: {
|
|
4411
4319
|
input: {
|
|
4412
4320
|
component: TextMaskAdapter5,
|
|
4413
4321
|
ref: innerRef,
|
|
4414
|
-
format
|
|
4415
|
-
sx: {
|
|
4416
|
-
"&:hover": {
|
|
4417
|
-
cursor: inputReadOnly || readOnly ? "default" : "text"
|
|
4418
|
-
}
|
|
4419
|
-
},
|
|
4322
|
+
format,
|
|
4323
|
+
sx: { "&:hover": { cursor: inputReadOnly || readOnly ? "default" : "text" } },
|
|
4420
4324
|
onMouseDown: handleInputMouseDown
|
|
4421
4325
|
}
|
|
4422
4326
|
},
|
|
@@ -4486,7 +4390,6 @@ var DateRangePicker = forwardRef8(
|
|
|
4486
4390
|
color: "neutral",
|
|
4487
4391
|
onClick: () => {
|
|
4488
4392
|
setValue("");
|
|
4489
|
-
setDisplayValue("");
|
|
4490
4393
|
setAnchorEl(null);
|
|
4491
4394
|
}
|
|
4492
4395
|
},
|
|
@@ -4649,7 +4552,7 @@ function CheckboxGroup(props) {
|
|
|
4649
4552
|
{
|
|
4650
4553
|
key: `${id}-${option.value}`,
|
|
4651
4554
|
label: option.label,
|
|
4652
|
-
checked: internalValue
|
|
4555
|
+
checked: internalValue.includes(option.value),
|
|
4653
4556
|
onChange: handleCheckboxChange(option.value)
|
|
4654
4557
|
}
|
|
4655
4558
|
)));
|
|
@@ -4719,7 +4622,7 @@ function RadioGroup2(props) {
|
|
|
4719
4622
|
RadioGroup2.displayName = "RadioGroup";
|
|
4720
4623
|
|
|
4721
4624
|
// src/components/FilterMenu/components/DateRange.tsx
|
|
4722
|
-
import React30, { useCallback as useCallback13, useMemo as useMemo10, useState as useState8
|
|
4625
|
+
import React30, { useCallback as useCallback13, useMemo as useMemo10, useState as useState8 } from "react";
|
|
4723
4626
|
import { Stack as Stack4 } from "@mui/joy";
|
|
4724
4627
|
function DateRange(props) {
|
|
4725
4628
|
const {
|
|
@@ -4733,7 +4636,6 @@ function DateRange(props) {
|
|
|
4733
4636
|
disableFuture,
|
|
4734
4637
|
disablePast,
|
|
4735
4638
|
format = "YYYY/MM/DD",
|
|
4736
|
-
displayFormat,
|
|
4737
4639
|
inputReadOnly,
|
|
4738
4640
|
hideClearButton
|
|
4739
4641
|
} = props;
|
|
@@ -4758,12 +4660,6 @@ function DateRange(props) {
|
|
|
4758
4660
|
const now = /* @__PURE__ */ new Date();
|
|
4759
4661
|
const currentYear = now.getFullYear();
|
|
4760
4662
|
const currentMonth = now.getMonth();
|
|
4761
|
-
const formatDate = (date) => {
|
|
4762
|
-
const year = date.getFullYear();
|
|
4763
|
-
const month = String(date.getMonth() + 1).padStart(2, "0");
|
|
4764
|
-
const day = String(date.getDate()).padStart(2, "0");
|
|
4765
|
-
return `${year}-${month}-${day}`;
|
|
4766
|
-
};
|
|
4767
4663
|
switch (option) {
|
|
4768
4664
|
case "all-time":
|
|
4769
4665
|
return null;
|
|
@@ -4771,26 +4667,24 @@ function DateRange(props) {
|
|
|
4771
4667
|
const startOfMonth = new Date(currentYear, currentMonth, 1);
|
|
4772
4668
|
const endOfMonth = new Date(currentYear, currentMonth + 1, 0);
|
|
4773
4669
|
return [
|
|
4774
|
-
|
|
4775
|
-
|
|
4670
|
+
startOfMonth.toISOString().split("T")[0],
|
|
4671
|
+
endOfMonth.toISOString().split("T")[0]
|
|
4776
4672
|
];
|
|
4777
4673
|
}
|
|
4778
4674
|
case "this-year": {
|
|
4779
4675
|
const startOfYear = new Date(currentYear, 0, 1);
|
|
4780
4676
|
const endOfYear = new Date(currentYear, 11, 31);
|
|
4781
4677
|
return [
|
|
4782
|
-
|
|
4783
|
-
|
|
4678
|
+
startOfYear.toISOString().split("T")[0],
|
|
4679
|
+
endOfYear.toISOString().split("T")[0]
|
|
4784
4680
|
];
|
|
4785
4681
|
}
|
|
4786
4682
|
case "last-month": {
|
|
4787
|
-
const
|
|
4788
|
-
const
|
|
4789
|
-
const startOfLastMonth = new Date(lastMonthYear, lastMonth, 1);
|
|
4790
|
-
const endOfLastMonth = new Date(lastMonthYear, lastMonth + 1, 0);
|
|
4683
|
+
const startOfLastMonth = new Date(currentYear, currentMonth - 1, 1);
|
|
4684
|
+
const endOfLastMonth = new Date(currentYear, currentMonth, 0);
|
|
4791
4685
|
return [
|
|
4792
|
-
|
|
4793
|
-
|
|
4686
|
+
startOfLastMonth.toISOString().split("T")[0],
|
|
4687
|
+
endOfLastMonth.toISOString().split("T")[0]
|
|
4794
4688
|
];
|
|
4795
4689
|
}
|
|
4796
4690
|
case "custom":
|
|
@@ -4801,32 +4695,12 @@ function DateRange(props) {
|
|
|
4801
4695
|
},
|
|
4802
4696
|
[internalValue]
|
|
4803
4697
|
);
|
|
4804
|
-
const determineOptionFromValue = useCallback13(
|
|
4805
|
-
(value2) => {
|
|
4806
|
-
if (!value2) {
|
|
4807
|
-
return "all-time";
|
|
4808
|
-
}
|
|
4809
|
-
const options = ["this-month", "this-year", "last-month"];
|
|
4810
|
-
for (const option of options) {
|
|
4811
|
-
const optionRange = getDateRangeForOption(option);
|
|
4812
|
-
if (optionRange && optionRange[0] === value2[0] && optionRange[1] === value2[1]) {
|
|
4813
|
-
return option;
|
|
4814
|
-
}
|
|
4815
|
-
}
|
|
4816
|
-
return "custom";
|
|
4817
|
-
},
|
|
4818
|
-
[getDateRangeForOption]
|
|
4819
|
-
);
|
|
4820
4698
|
const customDateRangeValue = useMemo10(() => {
|
|
4821
4699
|
if (selectedOption === "custom" && internalValue) {
|
|
4822
4700
|
return `${internalValue[0]} - ${internalValue[1]}`;
|
|
4823
4701
|
}
|
|
4824
4702
|
return "";
|
|
4825
4703
|
}, [selectedOption, internalValue]);
|
|
4826
|
-
useEffect7(() => {
|
|
4827
|
-
const newOption = determineOptionFromValue(internalValue);
|
|
4828
|
-
setSelectedOption(newOption);
|
|
4829
|
-
}, [internalValue, determineOptionFromValue]);
|
|
4830
4704
|
const handleOptionChange = useCallback13(
|
|
4831
4705
|
(event) => {
|
|
4832
4706
|
const newOption = event.target.value;
|
|
@@ -4888,7 +4762,6 @@ function DateRange(props) {
|
|
|
4888
4762
|
disableFuture,
|
|
4889
4763
|
disablePast,
|
|
4890
4764
|
format,
|
|
4891
|
-
displayFormat,
|
|
4892
4765
|
inputReadOnly,
|
|
4893
4766
|
hideClearButton
|
|
4894
4767
|
}
|
|
@@ -5220,15 +5093,21 @@ function PercentageRange(props) {
|
|
|
5220
5093
|
min,
|
|
5221
5094
|
max
|
|
5222
5095
|
} = props;
|
|
5223
|
-
const [internalValue, setInternalValue] = useControlledState(
|
|
5096
|
+
const [internalValue, setInternalValue] = useControlledState(
|
|
5097
|
+
value,
|
|
5098
|
+
null,
|
|
5099
|
+
onChange
|
|
5100
|
+
);
|
|
5224
5101
|
const minValue = internalValue?.[0];
|
|
5225
5102
|
const maxValue = internalValue?.[1];
|
|
5226
5103
|
const handleMinChange = useCallback17(
|
|
5227
5104
|
(event) => {
|
|
5228
5105
|
const newMinValue = event.target.value;
|
|
5229
5106
|
const currentMaxValue = maxValue;
|
|
5230
|
-
if (newMinValue !== void 0) {
|
|
5231
|
-
setInternalValue([newMinValue, currentMaxValue
|
|
5107
|
+
if (newMinValue !== void 0 && currentMaxValue !== void 0) {
|
|
5108
|
+
setInternalValue([newMinValue, currentMaxValue]);
|
|
5109
|
+
} else if (newMinValue !== void 0) {
|
|
5110
|
+
setInternalValue([newMinValue, newMinValue]);
|
|
5232
5111
|
} else {
|
|
5233
5112
|
setInternalValue(null);
|
|
5234
5113
|
}
|
|
@@ -5239,8 +5118,10 @@ function PercentageRange(props) {
|
|
|
5239
5118
|
(event) => {
|
|
5240
5119
|
const newMaxValue = event.target.value;
|
|
5241
5120
|
const currentMinValue = minValue;
|
|
5242
|
-
if (newMaxValue !== void 0) {
|
|
5243
|
-
setInternalValue([currentMinValue
|
|
5121
|
+
if (currentMinValue !== void 0 && newMaxValue !== void 0) {
|
|
5122
|
+
setInternalValue([currentMinValue, newMaxValue]);
|
|
5123
|
+
} else if (newMaxValue !== void 0) {
|
|
5124
|
+
setInternalValue([newMaxValue, newMaxValue]);
|
|
5244
5125
|
} else {
|
|
5245
5126
|
setInternalValue(null);
|
|
5246
5127
|
}
|
|
@@ -5263,7 +5144,7 @@ function PercentageRange(props) {
|
|
|
5263
5144
|
PercentageInput,
|
|
5264
5145
|
{
|
|
5265
5146
|
label: "Minimum",
|
|
5266
|
-
value: minValue
|
|
5147
|
+
value: minValue,
|
|
5267
5148
|
onChange: handleMinChange,
|
|
5268
5149
|
useMinorUnit,
|
|
5269
5150
|
maxDecimalScale,
|
|
@@ -5277,7 +5158,7 @@ function PercentageRange(props) {
|
|
|
5277
5158
|
PercentageInput,
|
|
5278
5159
|
{
|
|
5279
5160
|
label: "Maximum",
|
|
5280
|
-
value: maxValue
|
|
5161
|
+
value: maxValue,
|
|
5281
5162
|
onChange: handleMaxChange,
|
|
5282
5163
|
useMinorUnit,
|
|
5283
5164
|
maxDecimalScale,
|
|
@@ -5295,7 +5176,15 @@ PercentageRange.displayName = "PercentageRange";
|
|
|
5295
5176
|
import React36, { useCallback as useCallback18 } from "react";
|
|
5296
5177
|
import { Stack as Stack9 } from "@mui/joy";
|
|
5297
5178
|
function Autocomplete2(props) {
|
|
5298
|
-
const {
|
|
5179
|
+
const {
|
|
5180
|
+
id,
|
|
5181
|
+
label,
|
|
5182
|
+
value,
|
|
5183
|
+
onChange,
|
|
5184
|
+
options,
|
|
5185
|
+
multiple,
|
|
5186
|
+
hidden
|
|
5187
|
+
} = props;
|
|
5299
5188
|
const [internalValue, setInternalValue] = useControlledState(
|
|
5300
5189
|
value,
|
|
5301
5190
|
void 0,
|
|
@@ -5333,7 +5222,6 @@ function Autocomplete2(props) {
|
|
|
5333
5222
|
onChange: handleChange,
|
|
5334
5223
|
options,
|
|
5335
5224
|
multiple,
|
|
5336
|
-
placeholder,
|
|
5337
5225
|
"aria-labelledby": label ? id : void 0
|
|
5338
5226
|
}
|
|
5339
5227
|
));
|
|
@@ -5352,16 +5240,7 @@ var componentMap = {
|
|
|
5352
5240
|
autocomplete: Autocomplete2
|
|
5353
5241
|
};
|
|
5354
5242
|
function FilterMenu(props) {
|
|
5355
|
-
const {
|
|
5356
|
-
filters,
|
|
5357
|
-
values,
|
|
5358
|
-
defaultValues,
|
|
5359
|
-
resetValues = {},
|
|
5360
|
-
onChange,
|
|
5361
|
-
onClose,
|
|
5362
|
-
useClear,
|
|
5363
|
-
useReset
|
|
5364
|
-
} = props;
|
|
5243
|
+
const { filters, values, defaultValues, onChange, onClose } = props;
|
|
5365
5244
|
const [internalValues, setInternalValues] = useControlledState(
|
|
5366
5245
|
values,
|
|
5367
5246
|
defaultValues || {},
|
|
@@ -5382,62 +5261,32 @@ function FilterMenu(props) {
|
|
|
5382
5261
|
onClose?.();
|
|
5383
5262
|
}, [onChange, onClose, internalValues]);
|
|
5384
5263
|
const handleClear = useCallback19(() => {
|
|
5385
|
-
const clearedValues =
|
|
5264
|
+
const clearedValues = defaultValues || {};
|
|
5386
5265
|
setInternalValues(clearedValues);
|
|
5387
5266
|
onChange?.(clearedValues);
|
|
5388
5267
|
onClose?.();
|
|
5389
|
-
}, [
|
|
5390
|
-
return /* @__PURE__ */ React37.createElement(
|
|
5391
|
-
|
|
5392
|
-
|
|
5393
|
-
|
|
5394
|
-
position: "relative",
|
|
5395
|
-
transform: "none",
|
|
5396
|
-
left: "initial",
|
|
5397
|
-
top: "initial"
|
|
5398
|
-
}
|
|
5399
|
-
},
|
|
5400
|
-
/* @__PURE__ */ React37.createElement(DialogContent, { sx: { paddingTop: 5 } }, /* @__PURE__ */ React37.createElement(Stack10, { spacing: 6 }, filters?.map((filter) => {
|
|
5401
|
-
const FilterComponent = componentMap[filter.type];
|
|
5402
|
-
return FilterComponent ? /* @__PURE__ */ React37.createElement(
|
|
5403
|
-
FilterComponent,
|
|
5404
|
-
{
|
|
5405
|
-
key: filter.id,
|
|
5406
|
-
...filter,
|
|
5407
|
-
value: internalValues[filter.id],
|
|
5408
|
-
onChange: (value) => {
|
|
5409
|
-
handleFilterChange(filter.id, value);
|
|
5410
|
-
}
|
|
5411
|
-
}
|
|
5412
|
-
) : null;
|
|
5413
|
-
}))),
|
|
5414
|
-
/* @__PURE__ */ React37.createElement(DialogActions, { sx: { justifyContent: "space-between" } }, useClear && filters?.length === 1 && /* @__PURE__ */ React37.createElement(
|
|
5415
|
-
Button2,
|
|
5268
|
+
}, [defaultValues, setInternalValues, onChange, onClose]);
|
|
5269
|
+
return /* @__PURE__ */ React37.createElement(ModalDialog, null, /* @__PURE__ */ React37.createElement(DialogContent, { sx: { paddingTop: 5 } }, /* @__PURE__ */ React37.createElement(Stack10, { spacing: 6 }, filters?.map((filter) => {
|
|
5270
|
+
const FilterComponent = componentMap[filter.type];
|
|
5271
|
+
return FilterComponent ? /* @__PURE__ */ React37.createElement(
|
|
5272
|
+
FilterComponent,
|
|
5416
5273
|
{
|
|
5417
|
-
|
|
5418
|
-
|
|
5419
|
-
|
|
5420
|
-
|
|
5421
|
-
|
|
5422
|
-
|
|
5423
|
-
|
|
5424
|
-
|
|
5425
|
-
|
|
5426
|
-
variant: "plain",
|
|
5427
|
-
color: "neutral",
|
|
5428
|
-
size: "md",
|
|
5429
|
-
onClick: handleClear
|
|
5430
|
-
},
|
|
5431
|
-
"Reset"
|
|
5432
|
-
), /* @__PURE__ */ React37.createElement(Button2, { variant: "solid", color: "primary", size: "md", onClick: handleApply }, "Apply"))
|
|
5433
|
-
);
|
|
5274
|
+
key: filter.id,
|
|
5275
|
+
...filter,
|
|
5276
|
+
value: internalValues[filter.id],
|
|
5277
|
+
onChange: (value) => {
|
|
5278
|
+
handleFilterChange(filter.id, value);
|
|
5279
|
+
}
|
|
5280
|
+
}
|
|
5281
|
+
) : null;
|
|
5282
|
+
}))), /* @__PURE__ */ React37.createElement(DialogActions, { sx: { justifyContent: "space-between" } }, /* @__PURE__ */ React37.createElement(Button2, { variant: "plain", color: "neutral", size: "md", onClick: handleClear }, "Clear"), /* @__PURE__ */ React37.createElement(Button2, { variant: "solid", color: "primary", size: "md", onClick: handleApply }, "Apply")));
|
|
5434
5283
|
}
|
|
5435
5284
|
FilterMenu.displayName = "FilterMenu";
|
|
5436
5285
|
|
|
5437
5286
|
// src/components/Uploader/Uploader.tsx
|
|
5438
5287
|
import React38, {
|
|
5439
5288
|
useCallback as useCallback20,
|
|
5440
|
-
useEffect as
|
|
5289
|
+
useEffect as useEffect7,
|
|
5441
5290
|
useMemo as useMemo12,
|
|
5442
5291
|
useRef as useRef6,
|
|
5443
5292
|
useState as useState10
|
|
@@ -5739,7 +5588,7 @@ var Uploader = React38.memo(
|
|
|
5739
5588
|
onChange
|
|
5740
5589
|
]
|
|
5741
5590
|
);
|
|
5742
|
-
|
|
5591
|
+
useEffect7(() => {
|
|
5743
5592
|
if (!dropZoneRef.current || disabled) {
|
|
5744
5593
|
return;
|
|
5745
5594
|
}
|
|
@@ -5787,7 +5636,7 @@ var Uploader = React38.memo(
|
|
|
5787
5636
|
);
|
|
5788
5637
|
return () => cleanup?.();
|
|
5789
5638
|
}, [disabled, addFiles]);
|
|
5790
|
-
|
|
5639
|
+
useEffect7(() => {
|
|
5791
5640
|
if (inputRef.current && minCount) {
|
|
5792
5641
|
if (files.length < minCount) {
|
|
5793
5642
|
inputRef.current.setCustomValidity(
|
|
@@ -5952,14 +5801,14 @@ function IconMenuButton(props) {
|
|
|
5952
5801
|
IconMenuButton.displayName = "IconMenuButton";
|
|
5953
5802
|
|
|
5954
5803
|
// src/components/Markdown/Markdown.tsx
|
|
5955
|
-
import React40, { lazy, Suspense, useEffect as
|
|
5804
|
+
import React40, { lazy, Suspense, useEffect as useEffect8, useState as useState11 } from "react";
|
|
5956
5805
|
import { Skeleton } from "@mui/joy";
|
|
5957
5806
|
import { Link as Link2 } from "@mui/joy";
|
|
5958
5807
|
import remarkGfm from "remark-gfm";
|
|
5959
5808
|
var LazyReactMarkdown = lazy(() => import("react-markdown"));
|
|
5960
5809
|
var Markdown = (props) => {
|
|
5961
5810
|
const [rehypeAccent2, setRehypeAccent] = useState11(null);
|
|
5962
|
-
|
|
5811
|
+
useEffect8(() => {
|
|
5963
5812
|
const loadRehypeAccent = async () => {
|
|
5964
5813
|
const module = await Promise.resolve().then(() => (init_rehype_accent(), rehype_accent_exports));
|
|
5965
5814
|
setRehypeAccent(() => module.rehypeAccent);
|
|
@@ -6098,7 +5947,7 @@ MenuButton.displayName = "MenuButton";
|
|
|
6098
5947
|
import React42, {
|
|
6099
5948
|
forwardRef as forwardRef9,
|
|
6100
5949
|
useCallback as useCallback21,
|
|
6101
|
-
useEffect as
|
|
5950
|
+
useEffect as useEffect9,
|
|
6102
5951
|
useImperativeHandle as useImperativeHandle4,
|
|
6103
5952
|
useRef as useRef7,
|
|
6104
5953
|
useState as useState12
|
|
@@ -6215,7 +6064,7 @@ var MonthPicker = forwardRef9(
|
|
|
6215
6064
|
);
|
|
6216
6065
|
const [anchorEl, setAnchorEl] = useState12(null);
|
|
6217
6066
|
const open = Boolean(anchorEl);
|
|
6218
|
-
|
|
6067
|
+
useEffect9(() => {
|
|
6219
6068
|
if (!anchorEl) {
|
|
6220
6069
|
innerRef.current?.blur();
|
|
6221
6070
|
}
|
|
@@ -6223,7 +6072,7 @@ var MonthPicker = forwardRef9(
|
|
|
6223
6072
|
useImperativeHandle4(ref, () => innerRef.current, [
|
|
6224
6073
|
innerRef
|
|
6225
6074
|
]);
|
|
6226
|
-
|
|
6075
|
+
useEffect9(() => {
|
|
6227
6076
|
setDisplayValue(getFormattedDisplayValue(value));
|
|
6228
6077
|
}, [value, getFormattedDisplayValue]);
|
|
6229
6078
|
const handleChange = useCallback21(
|
|
@@ -6371,7 +6220,7 @@ var MonthPicker = forwardRef9(
|
|
|
6371
6220
|
import React43, {
|
|
6372
6221
|
forwardRef as forwardRef10,
|
|
6373
6222
|
useCallback as useCallback22,
|
|
6374
|
-
useEffect as
|
|
6223
|
+
useEffect as useEffect10,
|
|
6375
6224
|
useImperativeHandle as useImperativeHandle5,
|
|
6376
6225
|
useMemo as useMemo13,
|
|
6377
6226
|
useRef as useRef8,
|
|
@@ -6502,7 +6351,7 @@ var MonthRangePicker = forwardRef10(
|
|
|
6502
6351
|
() => value ? parseDates2(value) : void 0,
|
|
6503
6352
|
[value]
|
|
6504
6353
|
);
|
|
6505
|
-
|
|
6354
|
+
useEffect10(() => {
|
|
6506
6355
|
if (!anchorEl) {
|
|
6507
6356
|
innerRef.current?.blur();
|
|
6508
6357
|
}
|