@helpwave/hightide 0.9.3 → 0.9.5
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.d.mts +15 -11
- package/dist/index.d.ts +15 -11
- package/dist/index.js +630 -625
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +543 -538
- package/dist/index.mjs.map +1 -1
- package/dist/style/globals.css +54 -5
- package/dist/style/uncompiled/theme/components/property.css +39 -4
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -14643,40 +14643,40 @@ function isParameterValidForOperator(dataType, operator, parameter) {
|
|
|
14643
14643
|
}
|
|
14644
14644
|
switch (dataType) {
|
|
14645
14645
|
case "text": {
|
|
14646
|
-
return typeof parameter.
|
|
14646
|
+
return typeof parameter.stringValue === "string";
|
|
14647
14647
|
}
|
|
14648
14648
|
case "number": {
|
|
14649
14649
|
if (operator === "between" || operator === "notBetween") {
|
|
14650
|
-
const min = parameter.
|
|
14651
|
-
const max = parameter.
|
|
14650
|
+
const min = parameter.numberMin;
|
|
14651
|
+
const max = parameter.numberMax;
|
|
14652
14652
|
return typeof min === "number" && !Number.isNaN(min) && typeof max === "number" && !Number.isNaN(max) && min <= max;
|
|
14653
14653
|
}
|
|
14654
|
-
const v = parameter.
|
|
14654
|
+
const v = parameter.numberValue;
|
|
14655
14655
|
return typeof v === "number" && !Number.isNaN(v);
|
|
14656
14656
|
}
|
|
14657
14657
|
case "date":
|
|
14658
14658
|
case "dateTime": {
|
|
14659
14659
|
if (operator === "between" || operator === "notBetween") {
|
|
14660
|
-
const minDate = DateUtils.tryParseDate(parameter.
|
|
14661
|
-
const maxDate = DateUtils.tryParseDate(parameter.
|
|
14660
|
+
const minDate = DateUtils.tryParseDate(parameter.dateMin);
|
|
14661
|
+
const maxDate = DateUtils.tryParseDate(parameter.dateMax);
|
|
14662
14662
|
if (!minDate || !maxDate) return false;
|
|
14663
14663
|
const minNorm = dataType === "date" ? DateUtils.toOnlyDate(minDate).getTime() : DateUtils.toDateTimeOnly(minDate).getTime();
|
|
14664
14664
|
const maxNorm = dataType === "date" ? DateUtils.toOnlyDate(maxDate).getTime() : DateUtils.toDateTimeOnly(maxDate).getTime();
|
|
14665
14665
|
return minNorm <= maxNorm;
|
|
14666
14666
|
}
|
|
14667
|
-
return DateUtils.tryParseDate(parameter.
|
|
14667
|
+
return DateUtils.tryParseDate(parameter.dateValue) != null;
|
|
14668
14668
|
}
|
|
14669
14669
|
case "boolean":
|
|
14670
14670
|
return true;
|
|
14671
14671
|
case "multiTags": {
|
|
14672
|
-
return Array.isArray(parameter.
|
|
14672
|
+
return Array.isArray(parameter.uuidValues);
|
|
14673
14673
|
}
|
|
14674
14674
|
case "singleTag": {
|
|
14675
14675
|
if (operator === "contains" || operator === "notContains") {
|
|
14676
|
-
return Array.isArray(parameter.
|
|
14676
|
+
return Array.isArray(parameter.uuidValues);
|
|
14677
14677
|
}
|
|
14678
14678
|
if (operator === "equals" || operator === "notEquals") {
|
|
14679
|
-
return typeof parameter.
|
|
14679
|
+
return typeof parameter.uuidValue === "string";
|
|
14680
14680
|
}
|
|
14681
14681
|
return true;
|
|
14682
14682
|
}
|
|
@@ -14698,9 +14698,8 @@ var FilterValueUtils = {
|
|
|
14698
14698
|
isValid: isFilterValueValid
|
|
14699
14699
|
};
|
|
14700
14700
|
function filterText(value, operator, parameter) {
|
|
14701
|
-
const
|
|
14702
|
-
const
|
|
14703
|
-
const cellText = isCaseSensitive ? value?.toString() ?? "" : value?.toString().toLowerCase() ?? "";
|
|
14701
|
+
const searchText = parameter.stringValue ?? "";
|
|
14702
|
+
const cellText = value?.toString() ?? "";
|
|
14704
14703
|
switch (operator) {
|
|
14705
14704
|
case "equals":
|
|
14706
14705
|
return cellText === searchText;
|
|
@@ -14734,21 +14733,21 @@ function filterNumber(value, operator, parameter) {
|
|
|
14734
14733
|
}
|
|
14735
14734
|
switch (operator) {
|
|
14736
14735
|
case "equals":
|
|
14737
|
-
return value === parameter.
|
|
14736
|
+
return value === parameter.numberValue;
|
|
14738
14737
|
case "notEquals":
|
|
14739
|
-
return value !== parameter.
|
|
14738
|
+
return value !== parameter.numberValue;
|
|
14740
14739
|
case "greaterThan":
|
|
14741
|
-
return value > (parameter.
|
|
14740
|
+
return value > (parameter.numberValue ?? 0);
|
|
14742
14741
|
case "greaterThanOrEqual":
|
|
14743
|
-
return value >= (parameter.
|
|
14742
|
+
return value >= (parameter.numberValue ?? 0);
|
|
14744
14743
|
case "lessThan":
|
|
14745
|
-
return value < (parameter.
|
|
14744
|
+
return value < (parameter.numberValue ?? 0);
|
|
14746
14745
|
case "lessThanOrEqual":
|
|
14747
|
-
return value <= (parameter.
|
|
14746
|
+
return value <= (parameter.numberValue ?? 0);
|
|
14748
14747
|
case "between":
|
|
14749
|
-
return value >= (parameter.
|
|
14748
|
+
return value >= (parameter.numberMin ?? -Infinity) && value <= (parameter.numberMax ?? Infinity);
|
|
14750
14749
|
case "notBetween":
|
|
14751
|
-
return value < (parameter.
|
|
14750
|
+
return value < (parameter.numberMin ?? -Infinity) || value > (parameter.numberMax ?? Infinity);
|
|
14752
14751
|
case "isUndefined":
|
|
14753
14752
|
return value === void 0 || value === null;
|
|
14754
14753
|
case "isNotUndefined":
|
|
@@ -14771,44 +14770,44 @@ function filterDate(value, operator, parameter) {
|
|
|
14771
14770
|
const normalizedDate = DateUtils.toOnlyDate(date);
|
|
14772
14771
|
switch (operator) {
|
|
14773
14772
|
case "equals": {
|
|
14774
|
-
const filterDate2 = DateUtils.tryParseDate(parameter.
|
|
14773
|
+
const filterDate2 = DateUtils.tryParseDate(parameter.dateValue);
|
|
14775
14774
|
if (!filterDate2) return false;
|
|
14776
14775
|
return normalizedDate.getTime() === DateUtils.toOnlyDate(filterDate2).getTime();
|
|
14777
14776
|
}
|
|
14778
14777
|
case "notEquals": {
|
|
14779
|
-
const filterDate2 = DateUtils.tryParseDate(parameter.
|
|
14778
|
+
const filterDate2 = DateUtils.tryParseDate(parameter.dateValue);
|
|
14780
14779
|
if (!filterDate2) return false;
|
|
14781
14780
|
return normalizedDate.getTime() !== DateUtils.toOnlyDate(filterDate2).getTime();
|
|
14782
14781
|
}
|
|
14783
14782
|
case "greaterThan": {
|
|
14784
|
-
const filterDate2 = DateUtils.tryParseDate(parameter.
|
|
14783
|
+
const filterDate2 = DateUtils.tryParseDate(parameter.dateValue);
|
|
14785
14784
|
if (!filterDate2) return false;
|
|
14786
14785
|
return normalizedDate > DateUtils.toOnlyDate(filterDate2);
|
|
14787
14786
|
}
|
|
14788
14787
|
case "greaterThanOrEqual": {
|
|
14789
|
-
const filterDate2 = DateUtils.tryParseDate(parameter.
|
|
14788
|
+
const filterDate2 = DateUtils.tryParseDate(parameter.dateValue);
|
|
14790
14789
|
if (!filterDate2) return false;
|
|
14791
14790
|
return normalizedDate >= DateUtils.toOnlyDate(filterDate2);
|
|
14792
14791
|
}
|
|
14793
14792
|
case "lessThan": {
|
|
14794
|
-
const filterDate2 = DateUtils.tryParseDate(parameter.
|
|
14793
|
+
const filterDate2 = DateUtils.tryParseDate(parameter.dateValue);
|
|
14795
14794
|
if (!filterDate2) return false;
|
|
14796
14795
|
return normalizedDate < DateUtils.toOnlyDate(filterDate2);
|
|
14797
14796
|
}
|
|
14798
14797
|
case "lessThanOrEqual": {
|
|
14799
|
-
const filterDate2 = DateUtils.tryParseDate(parameter.
|
|
14798
|
+
const filterDate2 = DateUtils.tryParseDate(parameter.dateValue);
|
|
14800
14799
|
if (!filterDate2) return false;
|
|
14801
14800
|
return normalizedDate <= DateUtils.toOnlyDate(filterDate2);
|
|
14802
14801
|
}
|
|
14803
14802
|
case "between": {
|
|
14804
|
-
const minDate = DateUtils.tryParseDate(parameter.
|
|
14805
|
-
const maxDate = DateUtils.tryParseDate(parameter.
|
|
14803
|
+
const minDate = DateUtils.tryParseDate(parameter.dateMin);
|
|
14804
|
+
const maxDate = DateUtils.tryParseDate(parameter.dateMax);
|
|
14806
14805
|
if (!minDate || !maxDate) return false;
|
|
14807
14806
|
return normalizedDate >= DateUtils.toOnlyDate(minDate) && normalizedDate <= DateUtils.toOnlyDate(maxDate);
|
|
14808
14807
|
}
|
|
14809
14808
|
case "notBetween": {
|
|
14810
|
-
const minDate = DateUtils.tryParseDate(parameter.
|
|
14811
|
-
const maxDate = DateUtils.tryParseDate(parameter.
|
|
14809
|
+
const minDate = DateUtils.tryParseDate(parameter.dateMin);
|
|
14810
|
+
const maxDate = DateUtils.tryParseDate(parameter.dateMax);
|
|
14812
14811
|
if (!minDate || !maxDate) return false;
|
|
14813
14812
|
return normalizedDate < DateUtils.toOnlyDate(minDate) || normalizedDate > DateUtils.toOnlyDate(maxDate);
|
|
14814
14813
|
}
|
|
@@ -14830,44 +14829,44 @@ function filterDateTime(value, operator, parameter) {
|
|
|
14830
14829
|
const normalizedDatetime = DateUtils.toDateTimeOnly(dateTime);
|
|
14831
14830
|
switch (operator) {
|
|
14832
14831
|
case "equals": {
|
|
14833
|
-
const filterDatetime = DateUtils.tryParseDate(parameter.
|
|
14832
|
+
const filterDatetime = DateUtils.tryParseDate(parameter.dateValue);
|
|
14834
14833
|
if (!filterDatetime) return false;
|
|
14835
14834
|
return normalizedDatetime.getTime() === DateUtils.toDateTimeOnly(filterDatetime).getTime();
|
|
14836
14835
|
}
|
|
14837
14836
|
case "notEquals": {
|
|
14838
|
-
const filterDatetime = DateUtils.tryParseDate(parameter.
|
|
14837
|
+
const filterDatetime = DateUtils.tryParseDate(parameter.dateValue);
|
|
14839
14838
|
if (!filterDatetime) return false;
|
|
14840
14839
|
return normalizedDatetime.getTime() !== DateUtils.toDateTimeOnly(filterDatetime).getTime();
|
|
14841
14840
|
}
|
|
14842
14841
|
case "greaterThan": {
|
|
14843
|
-
const filterDatetime = DateUtils.tryParseDate(parameter.
|
|
14842
|
+
const filterDatetime = DateUtils.tryParseDate(parameter.dateValue);
|
|
14844
14843
|
if (!filterDatetime) return false;
|
|
14845
14844
|
return normalizedDatetime > DateUtils.toDateTimeOnly(filterDatetime);
|
|
14846
14845
|
}
|
|
14847
14846
|
case "greaterThanOrEqual": {
|
|
14848
|
-
const filterDatetime = DateUtils.tryParseDate(parameter.
|
|
14847
|
+
const filterDatetime = DateUtils.tryParseDate(parameter.dateValue);
|
|
14849
14848
|
if (!filterDatetime) return false;
|
|
14850
14849
|
return normalizedDatetime >= DateUtils.toDateTimeOnly(filterDatetime);
|
|
14851
14850
|
}
|
|
14852
14851
|
case "lessThan": {
|
|
14853
|
-
const filterDatetime = DateUtils.tryParseDate(parameter.
|
|
14852
|
+
const filterDatetime = DateUtils.tryParseDate(parameter.dateValue);
|
|
14854
14853
|
if (!filterDatetime) return false;
|
|
14855
14854
|
return normalizedDatetime < DateUtils.toDateTimeOnly(filterDatetime);
|
|
14856
14855
|
}
|
|
14857
14856
|
case "lessThanOrEqual": {
|
|
14858
|
-
const filterDatetime = DateUtils.tryParseDate(parameter.
|
|
14857
|
+
const filterDatetime = DateUtils.tryParseDate(parameter.dateValue);
|
|
14859
14858
|
if (!filterDatetime) return false;
|
|
14860
14859
|
return normalizedDatetime <= DateUtils.toDateTimeOnly(filterDatetime);
|
|
14861
14860
|
}
|
|
14862
14861
|
case "between": {
|
|
14863
|
-
const minDatetime = DateUtils.tryParseDate(parameter.
|
|
14864
|
-
const maxDatetime = DateUtils.tryParseDate(parameter.
|
|
14862
|
+
const minDatetime = DateUtils.tryParseDate(parameter.dateMin);
|
|
14863
|
+
const maxDatetime = DateUtils.tryParseDate(parameter.dateMax);
|
|
14865
14864
|
if (!minDatetime || !maxDatetime) return false;
|
|
14866
14865
|
return normalizedDatetime >= DateUtils.toDateTimeOnly(minDatetime) && normalizedDatetime <= DateUtils.toDateTimeOnly(maxDatetime);
|
|
14867
14866
|
}
|
|
14868
14867
|
case "notBetween": {
|
|
14869
|
-
const minDatetime = DateUtils.tryParseDate(parameter.
|
|
14870
|
-
const maxDatetime = DateUtils.tryParseDate(parameter.
|
|
14868
|
+
const minDatetime = DateUtils.tryParseDate(parameter.dateMin);
|
|
14869
|
+
const maxDatetime = DateUtils.tryParseDate(parameter.dateMax);
|
|
14871
14870
|
if (!minDatetime || !maxDatetime) return false;
|
|
14872
14871
|
return normalizedDatetime < DateUtils.toDateTimeOnly(minDatetime) || normalizedDatetime > DateUtils.toDateTimeOnly(maxDatetime);
|
|
14873
14872
|
}
|
|
@@ -14892,28 +14891,28 @@ function filterBoolean(value, operator) {
|
|
|
14892
14891
|
function filterMultiTags(value, operator, parameter) {
|
|
14893
14892
|
switch (operator) {
|
|
14894
14893
|
case "equals": {
|
|
14895
|
-
if (!Array.isArray(value) || !Array.isArray(parameter.
|
|
14896
|
-
if (value.length !== parameter.
|
|
14894
|
+
if (!Array.isArray(value) || !Array.isArray(parameter.uuidValues)) return false;
|
|
14895
|
+
if (value.length !== parameter.uuidValues.length) return false;
|
|
14897
14896
|
const valueSet = new Set(value);
|
|
14898
|
-
const searchTagsSet = new Set(parameter.
|
|
14897
|
+
const searchTagsSet = new Set(parameter.uuidValues);
|
|
14899
14898
|
if (valueSet.size !== searchTagsSet.size) return false;
|
|
14900
14899
|
return Array.from(valueSet).every((tag) => searchTagsSet.has(tag));
|
|
14901
14900
|
}
|
|
14902
14901
|
case "notEquals": {
|
|
14903
|
-
if (!Array.isArray(value) || !Array.isArray(parameter.
|
|
14904
|
-
if (value.length !== parameter.
|
|
14902
|
+
if (!Array.isArray(value) || !Array.isArray(parameter.uuidValues)) return true;
|
|
14903
|
+
if (value.length !== parameter.uuidValues.length) return true;
|
|
14905
14904
|
const valueSet = new Set(value);
|
|
14906
|
-
const searchTagsSet = new Set(parameter.
|
|
14905
|
+
const searchTagsSet = new Set(parameter.uuidValues);
|
|
14907
14906
|
if (valueSet.size !== searchTagsSet.size) return true;
|
|
14908
14907
|
return !Array.from(valueSet).every((tag) => searchTagsSet.has(tag));
|
|
14909
14908
|
}
|
|
14910
14909
|
case "contains": {
|
|
14911
|
-
if (!Array.isArray(value) || !Array.isArray(parameter.
|
|
14912
|
-
return parameter.
|
|
14910
|
+
if (!Array.isArray(value) || !Array.isArray(parameter.uuidValues)) return false;
|
|
14911
|
+
return parameter.uuidValues.every((tag) => value.includes(tag));
|
|
14913
14912
|
}
|
|
14914
14913
|
case "notContains": {
|
|
14915
|
-
if (!Array.isArray(value) || !Array.isArray(parameter.
|
|
14916
|
-
return !parameter.
|
|
14914
|
+
if (!Array.isArray(value) || !Array.isArray(parameter.uuidValues)) return true;
|
|
14915
|
+
return !parameter.uuidValues.every((tag) => value.includes(tag));
|
|
14917
14916
|
}
|
|
14918
14917
|
case "isUndefined":
|
|
14919
14918
|
return value === void 0 || value === null;
|
|
@@ -14926,13 +14925,13 @@ function filterMultiTags(value, operator, parameter) {
|
|
|
14926
14925
|
function filterSingleTag(value, operator, parameter) {
|
|
14927
14926
|
switch (operator) {
|
|
14928
14927
|
case "equals":
|
|
14929
|
-
return value === parameter.
|
|
14928
|
+
return value === parameter.uuidValue;
|
|
14930
14929
|
case "notEquals":
|
|
14931
|
-
return value !== parameter.
|
|
14930
|
+
return value !== parameter.uuidValue;
|
|
14932
14931
|
case "contains":
|
|
14933
|
-
return parameter.
|
|
14932
|
+
return parameter.uuidValues?.includes(value) ?? false;
|
|
14934
14933
|
case "notContains":
|
|
14935
|
-
return !(parameter.
|
|
14934
|
+
return !(parameter.uuidValues?.includes(value) ?? false);
|
|
14936
14935
|
case "isUndefined":
|
|
14937
14936
|
return value === void 0 || value === null;
|
|
14938
14937
|
case "isNotUndefined":
|
|
@@ -14980,81 +14979,81 @@ function useFilterValueTranslation() {
|
|
|
14980
14979
|
switch (value.operator) {
|
|
14981
14980
|
case "equals":
|
|
14982
14981
|
if (value.dataType === "date" || value.dataType === "dateTime") {
|
|
14983
|
-
return translation("rEquals", { value: formatDateParam(p.
|
|
14982
|
+
return translation("rEquals", { value: formatDateParam(p.dateValue, locale, dateFormat) ?? "-" });
|
|
14984
14983
|
}
|
|
14985
14984
|
if (value.dataType === "singleTag") {
|
|
14986
|
-
return translation("rEquals", { value: tagToLabel(tags, p.
|
|
14985
|
+
return translation("rEquals", { value: tagToLabel(tags, p.uuidValue) });
|
|
14987
14986
|
}
|
|
14988
14987
|
if (value.dataType === "multiTags") {
|
|
14989
|
-
const valueStr = (p.
|
|
14988
|
+
const valueStr = (p.uuidValues ?? []).map((v) => tagToLabel(tags, v)).join(", ");
|
|
14990
14989
|
return translation("rEquals", { value: valueStr });
|
|
14991
14990
|
}
|
|
14992
|
-
return translation("rEquals", { value: String(p.
|
|
14991
|
+
return translation("rEquals", { value: String(p.stringValue ?? p.numberValue ?? "") });
|
|
14993
14992
|
case "notEquals":
|
|
14994
14993
|
if (value.dataType === "date" || value.dataType === "dateTime") {
|
|
14995
|
-
return translation("rNotEquals", { value: formatDateParam(p.
|
|
14994
|
+
return translation("rNotEquals", { value: formatDateParam(p.dateValue, locale, dateFormat) });
|
|
14996
14995
|
}
|
|
14997
14996
|
if (value.dataType === "singleTag") {
|
|
14998
|
-
return translation("rNotEquals", { value: tagToLabel(tags, p.
|
|
14997
|
+
return translation("rNotEquals", { value: tagToLabel(tags, p.uuidValue) });
|
|
14999
14998
|
}
|
|
15000
14999
|
if (value.dataType === "multiTags") {
|
|
15001
|
-
const valueStr = (p.
|
|
15000
|
+
const valueStr = (p.uuidValues ?? []).map((v) => tagToLabel(tags, v)).join(", ");
|
|
15002
15001
|
return translation("rNotEquals", { value: valueStr });
|
|
15003
15002
|
}
|
|
15004
|
-
return translation("rNotEquals", { value: String(p.
|
|
15003
|
+
return translation("rNotEquals", { value: String(p.stringValue ?? p.numberValue ?? "") });
|
|
15005
15004
|
case "contains":
|
|
15006
15005
|
if (value.dataType === "multiTags" || value.dataType === "singleTag") {
|
|
15007
|
-
const valueStr = value.dataType === "singleTag" ? tagToLabel(tags, p.
|
|
15006
|
+
const valueStr = value.dataType === "singleTag" ? tagToLabel(tags, p.uuidValue) : (p.uuidValues ?? []).map((v) => tagToLabel(tags, v)).join(", ");
|
|
15008
15007
|
return translation("rContains", { value: valueStr });
|
|
15009
15008
|
}
|
|
15010
|
-
return translation("rContains", { value: String(p.
|
|
15009
|
+
return translation("rContains", { value: String(p.stringValue ?? "") });
|
|
15011
15010
|
case "notContains":
|
|
15012
15011
|
if (value.dataType === "multiTags" || value.dataType === "singleTag") {
|
|
15013
|
-
const valueStr = value.dataType === "singleTag" ? tagToLabel(tags, p.
|
|
15012
|
+
const valueStr = value.dataType === "singleTag" ? tagToLabel(tags, p.uuidValue) : (p.uuidValues ?? []).map((v) => tagToLabel(tags, v)).join(", ");
|
|
15014
15013
|
return translation("rNotContains", { value: valueStr });
|
|
15015
15014
|
}
|
|
15016
|
-
return translation("rNotContains", { value: `"${String(p.
|
|
15015
|
+
return translation("rNotContains", { value: `"${String(p.stringValue ?? "")}"` });
|
|
15017
15016
|
case "startsWith":
|
|
15018
|
-
return translation("rStartsWith", { value: `"${String(p.
|
|
15017
|
+
return translation("rStartsWith", { value: `"${String(p.stringValue ?? "")}"` });
|
|
15019
15018
|
case "endsWith":
|
|
15020
|
-
return translation("rEndsWith", { value: `"${String(p.
|
|
15019
|
+
return translation("rEndsWith", { value: `"${String(p.stringValue ?? "")}"` });
|
|
15021
15020
|
case "greaterThan":
|
|
15022
15021
|
return translation("rGreaterThan", {
|
|
15023
|
-
value: value.dataType === "date" || value.dataType === "dateTime" ? formatDateParam(p.
|
|
15022
|
+
value: value.dataType === "date" || value.dataType === "dateTime" ? formatDateParam(p.dateValue, locale, dateFormat) ?? "-" : String(p.numberValue ?? "-")
|
|
15024
15023
|
});
|
|
15025
15024
|
case "greaterThanOrEqual":
|
|
15026
15025
|
return translation("rGreaterThanOrEqual", {
|
|
15027
|
-
value: value.dataType === "date" || value.dataType === "dateTime" ? formatDateParam(p.
|
|
15026
|
+
value: value.dataType === "date" || value.dataType === "dateTime" ? formatDateParam(p.dateValue, locale, dateFormat) ?? "-" : String(p.numberValue ?? "-")
|
|
15028
15027
|
});
|
|
15029
15028
|
case "lessThan":
|
|
15030
15029
|
return translation("rLessThan", {
|
|
15031
|
-
value: value.dataType === "date" || value.dataType === "dateTime" ? formatDateParam(p.
|
|
15030
|
+
value: value.dataType === "date" || value.dataType === "dateTime" ? formatDateParam(p.dateValue, locale, dateFormat) ?? "-" : String(p.numberValue ?? "-")
|
|
15032
15031
|
});
|
|
15033
15032
|
case "lessThanOrEqual":
|
|
15034
15033
|
return translation("rLessThanOrEqual", {
|
|
15035
|
-
value: value.dataType === "date" || value.dataType === "dateTime" ? formatDateParam(p.
|
|
15034
|
+
value: value.dataType === "date" || value.dataType === "dateTime" ? formatDateParam(p.dateValue, locale, dateFormat) ?? "-" : String(p.numberValue ?? "-")
|
|
15036
15035
|
});
|
|
15037
15036
|
case "between":
|
|
15038
15037
|
if (value.dataType === "date" || value.dataType === "dateTime") {
|
|
15039
15038
|
return translation("rBetween", {
|
|
15040
|
-
value1: formatDateParam(p.
|
|
15041
|
-
value2: formatDateParam(p.
|
|
15039
|
+
value1: formatDateParam(p.dateMin, locale, dateFormat) ?? "-",
|
|
15040
|
+
value2: formatDateParam(p.dateMax, locale, dateFormat) ?? "-"
|
|
15042
15041
|
});
|
|
15043
15042
|
}
|
|
15044
15043
|
return translation("rBetween", {
|
|
15045
|
-
value1: String(p.
|
|
15046
|
-
value2: String(p.
|
|
15044
|
+
value1: String(p.numberMin ?? "-"),
|
|
15045
|
+
value2: String(p.numberMax ?? "-")
|
|
15047
15046
|
});
|
|
15048
15047
|
case "notBetween":
|
|
15049
15048
|
if (value.dataType === "date" || value.dataType === "dateTime") {
|
|
15050
15049
|
return translation("rNotBetween", {
|
|
15051
|
-
value1: formatDateParam(p.
|
|
15052
|
-
value2: formatDateParam(p.
|
|
15050
|
+
value1: formatDateParam(p.dateMin, locale, dateFormat) ?? "-",
|
|
15051
|
+
value2: formatDateParam(p.dateMax, locale, dateFormat) ?? "-"
|
|
15053
15052
|
});
|
|
15054
15053
|
}
|
|
15055
15054
|
return translation("rNotBetween", {
|
|
15056
|
-
value1: String(p.
|
|
15057
|
-
value2: String(p.
|
|
15055
|
+
value1: String(p.numberMin ?? "-"),
|
|
15056
|
+
value2: String(p.numberMax ?? "-")
|
|
15058
15057
|
});
|
|
15059
15058
|
case "isTrue":
|
|
15060
15059
|
return translation("isTrue");
|
|
@@ -15463,85 +15462,22 @@ var TableSortButton = ({
|
|
|
15463
15462
|
};
|
|
15464
15463
|
|
|
15465
15464
|
// src/components/layout/table/TableFilterButton.tsx
|
|
15466
|
-
var import_lucide_react21 = require("lucide-react");
|
|
15467
|
-
var import_react88 = require("react");
|
|
15468
|
-
var import_react_table3 = require("@tanstack/react-table");
|
|
15469
|
-
|
|
15470
|
-
// src/components/user-interaction/data/FilterPopUp.tsx
|
|
15471
15465
|
var import_lucide_react20 = require("lucide-react");
|
|
15472
15466
|
var import_react87 = require("react");
|
|
15467
|
+
var import_react_table3 = require("@tanstack/react-table");
|
|
15473
15468
|
|
|
15474
|
-
// src/components/user-interaction/
|
|
15475
|
-
var
|
|
15476
|
-
var
|
|
15477
|
-
var import_jsx_runtime62 = require("react/jsx-runtime");
|
|
15478
|
-
var Checkbox = ({
|
|
15479
|
-
value: controlledValue,
|
|
15480
|
-
initialValue = false,
|
|
15481
|
-
indeterminate,
|
|
15482
|
-
required = false,
|
|
15483
|
-
invalid = false,
|
|
15484
|
-
disabled = false,
|
|
15485
|
-
readOnly = false,
|
|
15486
|
-
onValueChange,
|
|
15487
|
-
onEditComplete,
|
|
15488
|
-
size = "md",
|
|
15489
|
-
alwaysShowCheckIcon = false,
|
|
15490
|
-
...props
|
|
15491
|
-
}) => {
|
|
15492
|
-
const onEditCompleteStable = useEventCallbackStabilizer(onEditComplete);
|
|
15493
|
-
const onValueChangeStable = useEventCallbackStabilizer(onValueChange);
|
|
15494
|
-
const onChangeWrapper = (0, import_react72.useCallback)((value2) => {
|
|
15495
|
-
onValueChangeStable(value2);
|
|
15496
|
-
onEditCompleteStable(value2);
|
|
15497
|
-
}, [onValueChangeStable, onEditCompleteStable]);
|
|
15498
|
-
const [value, setValue] = useControlledState({
|
|
15499
|
-
value: controlledValue,
|
|
15500
|
-
onValueChange: onChangeWrapper,
|
|
15501
|
-
defaultValue: initialValue
|
|
15502
|
-
});
|
|
15503
|
-
return /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)(
|
|
15504
|
-
"div",
|
|
15505
|
-
{
|
|
15506
|
-
...props,
|
|
15507
|
-
onClick: (event) => {
|
|
15508
|
-
if (!disabled) {
|
|
15509
|
-
setValue((prev) => !prev);
|
|
15510
|
-
}
|
|
15511
|
-
props.onClick?.(event);
|
|
15512
|
-
},
|
|
15513
|
-
onKeyDown: (event) => {
|
|
15514
|
-
if (disabled) return;
|
|
15515
|
-
if (event.key === " " || event.key === "Enter") {
|
|
15516
|
-
event.preventDefault();
|
|
15517
|
-
setValue((prev) => !prev);
|
|
15518
|
-
}
|
|
15519
|
-
props.onKeyDown?.(event);
|
|
15520
|
-
},
|
|
15521
|
-
"data-checked": !indeterminate ? value : "indeterminate",
|
|
15522
|
-
"data-size": size ?? void 0,
|
|
15523
|
-
...PropsUtil.dataAttributes.interactionStates({ disabled, invalid, readOnly, required }),
|
|
15524
|
-
role: "checkbox",
|
|
15525
|
-
tabIndex: disabled ? -1 : 0,
|
|
15526
|
-
"aria-checked": indeterminate ? "mixed" : value,
|
|
15527
|
-
...PropsUtil.aria.interactionStates({ disabled, invalid, readOnly, required }, props),
|
|
15528
|
-
"data-name": props["data-name"] ?? "checkbox",
|
|
15529
|
-
children: [
|
|
15530
|
-
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(Visibility, { isVisible: indeterminate, children: /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(import_lucide_react16.Minus, { "data-name": "checkbox-indicator", className: "checkbox-indicator", "aria-hidden": true }) }),
|
|
15531
|
-
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(Visibility, { isVisible: !indeterminate && (alwaysShowCheckIcon || value), children: /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(import_lucide_react16.Check, { "data-name": "checkbox-indicator", className: "checkbox-indicator", "aria-hidden": true }) })
|
|
15532
|
-
]
|
|
15533
|
-
}
|
|
15534
|
-
);
|
|
15535
|
-
};
|
|
15469
|
+
// src/components/user-interaction/data/FilterPopUp.tsx
|
|
15470
|
+
var import_lucide_react19 = require("lucide-react");
|
|
15471
|
+
var import_react86 = require("react");
|
|
15536
15472
|
|
|
15537
15473
|
// src/components/user-interaction/input/DateTimeInput.tsx
|
|
15538
|
-
var
|
|
15539
|
-
var
|
|
15474
|
+
var import_react77 = require("react");
|
|
15475
|
+
var import_lucide_react17 = require("lucide-react");
|
|
15540
15476
|
var import_clsx24 = __toESM(require("clsx"));
|
|
15541
15477
|
|
|
15542
15478
|
// src/components/user-interaction/date/TimePicker.tsx
|
|
15543
|
-
var
|
|
15544
|
-
var
|
|
15479
|
+
var import_react72 = require("react");
|
|
15480
|
+
var import_jsx_runtime62 = require("react/jsx-runtime");
|
|
15545
15481
|
var TimePicker = ({
|
|
15546
15482
|
value: controlledValue,
|
|
15547
15483
|
initialValue = /* @__PURE__ */ new Date(),
|
|
@@ -15559,11 +15495,11 @@ var TimePicker = ({
|
|
|
15559
15495
|
onValueChange,
|
|
15560
15496
|
defaultValue: initialValue
|
|
15561
15497
|
});
|
|
15562
|
-
const minuteRef = (0,
|
|
15563
|
-
const hourRef = (0,
|
|
15498
|
+
const minuteRef = (0, import_react72.useRef)(null);
|
|
15499
|
+
const hourRef = (0, import_react72.useRef)(null);
|
|
15564
15500
|
const isPM = value.getHours() > 11;
|
|
15565
15501
|
const hours = is24HourFormat ? range(24) : range(12);
|
|
15566
|
-
const minutes = (0,
|
|
15502
|
+
const minutes = (0, import_react72.useMemo)(() => {
|
|
15567
15503
|
const full = range(60);
|
|
15568
15504
|
switch (minuteIncrement) {
|
|
15569
15505
|
case "5min":
|
|
@@ -15576,7 +15512,7 @@ var TimePicker = ({
|
|
|
15576
15512
|
return full.filter((value2) => value2 % 30 === 0);
|
|
15577
15513
|
}
|
|
15578
15514
|
}, [minuteIncrement]);
|
|
15579
|
-
const seconds = (0,
|
|
15515
|
+
const seconds = (0, import_react72.useMemo)(() => {
|
|
15580
15516
|
const full = range(60);
|
|
15581
15517
|
switch (secondIncrement) {
|
|
15582
15518
|
case "1s":
|
|
@@ -15591,7 +15527,7 @@ var TimePicker = ({
|
|
|
15591
15527
|
return full.filter((value2) => value2 % 30 === 0);
|
|
15592
15528
|
}
|
|
15593
15529
|
}, [secondIncrement]);
|
|
15594
|
-
const milliseconds = (0,
|
|
15530
|
+
const milliseconds = (0, import_react72.useMemo)(() => {
|
|
15595
15531
|
const full = range(1e3);
|
|
15596
15532
|
switch (millisecondIncrement) {
|
|
15597
15533
|
case "1ms":
|
|
@@ -15612,17 +15548,17 @@ var TimePicker = ({
|
|
|
15612
15548
|
return full.filter((value2) => value2 % 500 === 0);
|
|
15613
15549
|
}
|
|
15614
15550
|
}, [millisecondIncrement]);
|
|
15615
|
-
const closestMinute = (0,
|
|
15616
|
-
const closestSecond = (0,
|
|
15617
|
-
const closestMillisecond = (0,
|
|
15551
|
+
const closestMinute = (0, import_react72.useMemo)(() => closestMatch(minutes, (item1, item2) => Math.abs(item1 - value.getMinutes()) < Math.abs(item2 - value.getMinutes())), [minutes, value]);
|
|
15552
|
+
const closestSecond = (0, import_react72.useMemo)(() => closestMatch(seconds, (item1, item2) => Math.abs(item1 - value.getSeconds()) < Math.abs(item2 - value.getSeconds())), [seconds, value]);
|
|
15553
|
+
const closestMillisecond = (0, import_react72.useMemo)(() => closestMatch(milliseconds, (item1, item2) => Math.abs(item1 - value.getMilliseconds()) < Math.abs(item2 - value.getMilliseconds())), [milliseconds, value]);
|
|
15618
15554
|
const hour = value.getHours();
|
|
15619
|
-
(0,
|
|
15555
|
+
(0, import_react72.useEffect)(() => {
|
|
15620
15556
|
minuteRef.current?.scrollIntoView({
|
|
15621
15557
|
behavior: "smooth",
|
|
15622
15558
|
block: "nearest"
|
|
15623
15559
|
});
|
|
15624
15560
|
}, [closestMinute]);
|
|
15625
|
-
(0,
|
|
15561
|
+
(0, import_react72.useEffect)(() => {
|
|
15626
15562
|
hourRef.current?.scrollIntoView({
|
|
15627
15563
|
behavior: "smooth",
|
|
15628
15564
|
block: "nearest"
|
|
@@ -15634,10 +15570,10 @@ var TimePicker = ({
|
|
|
15634
15570
|
setValue(newDate);
|
|
15635
15571
|
onEditComplete?.(newDate);
|
|
15636
15572
|
};
|
|
15637
|
-
return /* @__PURE__ */ (0,
|
|
15638
|
-
/* @__PURE__ */ (0,
|
|
15573
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("div", { "data-name": "time-picker-container", className, children: [
|
|
15574
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)("div", { "data-name": "time-picker-value-column", children: hours.map((hour2) => {
|
|
15639
15575
|
const isSelected = hour2 === value.getHours() - (!is24HourFormat && isPM ? 12 : 0);
|
|
15640
|
-
return /* @__PURE__ */ (0,
|
|
15576
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
15641
15577
|
Button,
|
|
15642
15578
|
{
|
|
15643
15579
|
size: "sm",
|
|
@@ -15650,9 +15586,9 @@ var TimePicker = ({
|
|
|
15650
15586
|
hour2
|
|
15651
15587
|
);
|
|
15652
15588
|
}) }),
|
|
15653
|
-
/* @__PURE__ */ (0,
|
|
15589
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)("div", { "data-name": "time-picker-value-column", children: minutes.map((minute) => {
|
|
15654
15590
|
const isSelected = minute === closestMinute;
|
|
15655
|
-
return /* @__PURE__ */ (0,
|
|
15591
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
15656
15592
|
Button,
|
|
15657
15593
|
{
|
|
15658
15594
|
size: "sm",
|
|
@@ -15665,9 +15601,9 @@ var TimePicker = ({
|
|
|
15665
15601
|
minute + minuteIncrement
|
|
15666
15602
|
);
|
|
15667
15603
|
}) }),
|
|
15668
|
-
/* @__PURE__ */ (0,
|
|
15604
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(Visibility, { isVisible: precision === "second" || precision === "millisecond", children: /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("div", { "data-name": "time-picker-value-column", children: seconds.map((second) => {
|
|
15669
15605
|
const isSelected = second === closestSecond;
|
|
15670
|
-
return /* @__PURE__ */ (0,
|
|
15606
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
15671
15607
|
Button,
|
|
15672
15608
|
{
|
|
15673
15609
|
size: "sm",
|
|
@@ -15680,9 +15616,9 @@ var TimePicker = ({
|
|
|
15680
15616
|
second + secondIncrement
|
|
15681
15617
|
);
|
|
15682
15618
|
}) }) }),
|
|
15683
|
-
/* @__PURE__ */ (0,
|
|
15619
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(Visibility, { isVisible: precision === "millisecond", children: /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("div", { "data-name": "time-picker-value-column", children: milliseconds.map((millisecond) => {
|
|
15684
15620
|
const isSelected = millisecond === closestMillisecond;
|
|
15685
|
-
return /* @__PURE__ */ (0,
|
|
15621
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
15686
15622
|
Button,
|
|
15687
15623
|
{
|
|
15688
15624
|
size: "sm",
|
|
@@ -15695,8 +15631,8 @@ var TimePicker = ({
|
|
|
15695
15631
|
millisecond + millisecondIncrement
|
|
15696
15632
|
);
|
|
15697
15633
|
}) }) }),
|
|
15698
|
-
!is24HourFormat && /* @__PURE__ */ (0,
|
|
15699
|
-
/* @__PURE__ */ (0,
|
|
15634
|
+
!is24HourFormat && /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("div", { "data-name": "time-picker-value-column", children: [
|
|
15635
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
15700
15636
|
Button,
|
|
15701
15637
|
{
|
|
15702
15638
|
size: "sm",
|
|
@@ -15706,7 +15642,7 @@ var TimePicker = ({
|
|
|
15706
15642
|
children: "AM"
|
|
15707
15643
|
}
|
|
15708
15644
|
),
|
|
15709
|
-
/* @__PURE__ */ (0,
|
|
15645
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
15710
15646
|
Button,
|
|
15711
15647
|
{
|
|
15712
15648
|
size: "sm",
|
|
@@ -15721,13 +15657,13 @@ var TimePicker = ({
|
|
|
15721
15657
|
};
|
|
15722
15658
|
|
|
15723
15659
|
// src/components/user-interaction/date/DatePicker.tsx
|
|
15724
|
-
var
|
|
15725
|
-
var
|
|
15660
|
+
var import_react75 = require("react");
|
|
15661
|
+
var import_lucide_react16 = require("lucide-react");
|
|
15726
15662
|
var import_clsx23 = __toESM(require("clsx"));
|
|
15727
15663
|
|
|
15728
15664
|
// src/components/user-interaction/date/DayPicker.tsx
|
|
15729
|
-
var
|
|
15730
|
-
var
|
|
15665
|
+
var import_react73 = require("react");
|
|
15666
|
+
var import_jsx_runtime63 = require("react/jsx-runtime");
|
|
15731
15667
|
var DayPicker = ({
|
|
15732
15668
|
displayedMonth: controlledDisplayedMonth,
|
|
15733
15669
|
initialDisplayedMonth,
|
|
@@ -15755,33 +15691,33 @@ var DayPicker = ({
|
|
|
15755
15691
|
});
|
|
15756
15692
|
const month = displayedMonth.getMonth();
|
|
15757
15693
|
const weeks = DateUtils.weeksForCalenderMonth(displayedMonth, weekStart);
|
|
15758
|
-
const selectedButtonRef = (0,
|
|
15759
|
-
const isValueInDisplayedWeeks = (0,
|
|
15694
|
+
const selectedButtonRef = (0, import_react73.useRef)(null);
|
|
15695
|
+
const isValueInDisplayedWeeks = (0, import_react73.useMemo)(
|
|
15760
15696
|
() => !!value && weeks.some((week) => week.some((d) => DateUtils.equalDate(value, d))),
|
|
15761
15697
|
[value, weeks]
|
|
15762
15698
|
);
|
|
15763
|
-
const firstDayOfMonth = (0,
|
|
15699
|
+
const firstDayOfMonth = (0, import_react73.useCallback)(
|
|
15764
15700
|
(date) => new Date(date.getFullYear(), date.getMonth(), 1),
|
|
15765
15701
|
[]
|
|
15766
15702
|
);
|
|
15767
15703
|
const focusTargetDate = value && isValueInDisplayedWeeks ? value : firstDayOfMonth(displayedMonth);
|
|
15768
|
-
(0,
|
|
15704
|
+
(0, import_react73.useEffect)(() => {
|
|
15769
15705
|
selectedButtonRef.current?.focus();
|
|
15770
15706
|
}, [focusTargetDate]);
|
|
15771
|
-
const end = (0,
|
|
15707
|
+
const end = (0, import_react73.useMemo)(() => {
|
|
15772
15708
|
if (!providedEnd) return;
|
|
15773
15709
|
return new Date(providedEnd.getFullYear(), providedEnd.getMonth(), providedEnd.getDate());
|
|
15774
15710
|
}, [providedEnd]);
|
|
15775
|
-
const start = (0,
|
|
15711
|
+
const start = (0, import_react73.useMemo)(() => {
|
|
15776
15712
|
if (!providedStart) return;
|
|
15777
15713
|
return new Date(providedStart.getFullYear(), providedStart.getMonth(), providedStart.getDate());
|
|
15778
15714
|
}, [providedStart]);
|
|
15779
|
-
const clampToRange = (0,
|
|
15715
|
+
const clampToRange = (0, import_react73.useCallback)((date) => {
|
|
15780
15716
|
if (start && date < start) return start;
|
|
15781
15717
|
if (end && date > end) return end;
|
|
15782
15718
|
return date;
|
|
15783
15719
|
}, [start, end]);
|
|
15784
|
-
const navigateTo = (0,
|
|
15720
|
+
const navigateTo = (0, import_react73.useCallback)((candidate) => {
|
|
15785
15721
|
const clamped = clampToRange(candidate);
|
|
15786
15722
|
if (!DateUtils.between(clamped, start, end)) return;
|
|
15787
15723
|
setValue(clamped);
|
|
@@ -15790,7 +15726,7 @@ var DayPicker = ({
|
|
|
15790
15726
|
setDisplayedMonth(firstDayOfMonth(clamped));
|
|
15791
15727
|
}
|
|
15792
15728
|
}, [clampToRange, start, end, setValue, onEditComplete, displayedMonth, setDisplayedMonth, firstDayOfMonth]);
|
|
15793
|
-
const onKeyDown = (0,
|
|
15729
|
+
const onKeyDown = (0, import_react73.useCallback)(
|
|
15794
15730
|
(event) => {
|
|
15795
15731
|
PropsUtil.aria.navigate({
|
|
15796
15732
|
left: () => focusTargetDate && navigateTo(DateUtils.subtractDuration(focusTargetDate, { days: 1 })),
|
|
@@ -15801,15 +15737,15 @@ var DayPicker = ({
|
|
|
15801
15737
|
},
|
|
15802
15738
|
[focusTargetDate, navigateTo]
|
|
15803
15739
|
);
|
|
15804
|
-
return /* @__PURE__ */ (0,
|
|
15805
|
-
/* @__PURE__ */ (0,
|
|
15806
|
-
weeks.map((week, index) => /* @__PURE__ */ (0,
|
|
15740
|
+
return /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("div", { "data-name": "day-picker-container", className, children: [
|
|
15741
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)("div", { "data-name": "day-picker-header-row", children: weeks[0].map((weekDay, index) => /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("div", { "data-name": "day-picker-header-item", children: new Intl.DateTimeFormat(locale, { weekday: "long" }).format(weekDay).substring(0, 2) }, index)) }),
|
|
15742
|
+
weeks.map((week, index) => /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("div", { "data-name": "day-picker-body-row", children: week.map((date) => {
|
|
15807
15743
|
const isSelected = !!value && DateUtils.equalDate(value, date);
|
|
15808
15744
|
const isFocused = !!focusTargetDate && DateUtils.equalDate(focusTargetDate, date);
|
|
15809
15745
|
const isToday = DateUtils.equalDate(/* @__PURE__ */ new Date(), date);
|
|
15810
15746
|
const isSameMonth = date.getMonth() === month;
|
|
15811
15747
|
const isDayValid = DateUtils.between(date, start, end);
|
|
15812
|
-
return /* @__PURE__ */ (0,
|
|
15748
|
+
return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
|
|
15813
15749
|
"div",
|
|
15814
15750
|
{
|
|
15815
15751
|
ref: isFocused ? selectedButtonRef : void 0,
|
|
@@ -15847,10 +15783,10 @@ var DayPicker = ({
|
|
|
15847
15783
|
};
|
|
15848
15784
|
|
|
15849
15785
|
// src/components/user-interaction/date/YearMonthPicker.tsx
|
|
15850
|
-
var
|
|
15786
|
+
var import_react74 = require("react");
|
|
15851
15787
|
var import_clsx22 = __toESM(require("clsx"));
|
|
15852
|
-
var
|
|
15853
|
-
var YearRow = (0,
|
|
15788
|
+
var import_jsx_runtime64 = require("react/jsx-runtime");
|
|
15789
|
+
var YearRow = (0, import_react74.memo)(function YearRow2({
|
|
15854
15790
|
year,
|
|
15855
15791
|
selectedMonthIndex,
|
|
15856
15792
|
minTimestamp,
|
|
@@ -15858,31 +15794,31 @@ var YearRow = (0, import_react75.memo)(function YearRow2({
|
|
|
15858
15794
|
monthNames,
|
|
15859
15795
|
onSelect
|
|
15860
15796
|
}) {
|
|
15861
|
-
const ref = (0,
|
|
15797
|
+
const ref = (0, import_react74.useRef)(null);
|
|
15862
15798
|
const isSelectedYear = selectedMonthIndex !== void 0;
|
|
15863
|
-
const [isExpanded, setIsExpanded] = (0,
|
|
15864
|
-
(0,
|
|
15799
|
+
const [isExpanded, setIsExpanded] = (0, import_react74.useState)(false);
|
|
15800
|
+
(0, import_react74.useEffect)(() => {
|
|
15865
15801
|
if (isSelectedYear) {
|
|
15866
15802
|
ref.current?.scrollIntoView({ behavior: "smooth", block: "nearest" });
|
|
15867
15803
|
}
|
|
15868
15804
|
}, [isSelectedYear]);
|
|
15869
|
-
const monthGrid = (0,
|
|
15870
|
-
return /* @__PURE__ */ (0,
|
|
15805
|
+
const monthGrid = (0, import_react74.useMemo)(() => equalSizeGroups([...DateUtils.monthsList], 3), []);
|
|
15806
|
+
return /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)(
|
|
15871
15807
|
ExpandableRoot,
|
|
15872
15808
|
{
|
|
15873
15809
|
ref: isSelectedYear ? ref : void 0,
|
|
15874
15810
|
isExpanded,
|
|
15875
15811
|
onExpandedChange: setIsExpanded,
|
|
15876
15812
|
children: [
|
|
15877
|
-
/* @__PURE__ */ (0,
|
|
15878
|
-
/* @__PURE__ */ (0,
|
|
15813
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)(ExpandableHeader, { className: (0, import_clsx22.default)("px-2", { "text-primary font-bold": isSelectedYear }), children: year }),
|
|
15814
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)(ExpandableContent, { className: "gap-y-1 px-2 expandable-content-h-43", children: isExpanded && monthGrid.map((group, groupIdx) => /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("div", { className: "flex-row-1", children: group.map((month) => {
|
|
15879
15815
|
const monthIndex = DateUtils.monthsList.indexOf(month);
|
|
15880
15816
|
const currentTimestamp = new Date(year, monthIndex).getTime();
|
|
15881
15817
|
const isAfterStart = minTimestamp === void 0 || currentTimestamp >= minTimestamp;
|
|
15882
15818
|
const isBeforeEnd = maxTimestamp === void 0 || currentTimestamp <= maxTimestamp;
|
|
15883
15819
|
const isValid = isAfterStart && isBeforeEnd;
|
|
15884
15820
|
const isSelectedMonth = monthIndex === selectedMonthIndex;
|
|
15885
|
-
return /* @__PURE__ */ (0,
|
|
15821
|
+
return /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
15886
15822
|
Button,
|
|
15887
15823
|
{
|
|
15888
15824
|
disabled: !isValid,
|
|
@@ -15921,27 +15857,27 @@ var YearMonthPicker = ({
|
|
|
15921
15857
|
defaultValue: initialValue
|
|
15922
15858
|
});
|
|
15923
15859
|
const onEditCompleteStable = useEventCallbackStabilizer(onEditComplete);
|
|
15924
|
-
const monthNames = (0,
|
|
15860
|
+
const monthNames = (0, import_react74.useMemo)(() => {
|
|
15925
15861
|
const formatter = new Intl.DateTimeFormat(locale, { month: "short" });
|
|
15926
15862
|
return Array.from({ length: 12 }, (_, i) => formatter.format(new Date(2e3, i, 1)));
|
|
15927
15863
|
}, [locale]);
|
|
15928
|
-
const years = (0,
|
|
15864
|
+
const years = (0, import_react74.useMemo)(
|
|
15929
15865
|
() => range([start.getFullYear(), end.getFullYear()], { exclusiveEnd: false }),
|
|
15930
15866
|
[start, end]
|
|
15931
15867
|
);
|
|
15932
|
-
const minTimestamp = (0,
|
|
15868
|
+
const minTimestamp = (0, import_react74.useMemo)(() => {
|
|
15933
15869
|
if (!start) return;
|
|
15934
15870
|
return new Date(start.getFullYear(), start.getMonth(), 1).getTime();
|
|
15935
15871
|
}, [start]);
|
|
15936
|
-
const maxTimestamp = (0,
|
|
15872
|
+
const maxTimestamp = (0, import_react74.useMemo)(() => {
|
|
15937
15873
|
if (!end) return;
|
|
15938
15874
|
return new Date(end.getFullYear(), end.getMonth() + 1, 0).getTime();
|
|
15939
15875
|
}, [end]);
|
|
15940
|
-
const handleSelect = (0,
|
|
15876
|
+
const handleSelect = (0, import_react74.useCallback)((newDate) => {
|
|
15941
15877
|
setValue(newDate);
|
|
15942
15878
|
onEditCompleteStable(newDate);
|
|
15943
15879
|
}, [onEditCompleteStable, setValue]);
|
|
15944
|
-
return /* @__PURE__ */ (0,
|
|
15880
|
+
return /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
15945
15881
|
InfiniteScroll,
|
|
15946
15882
|
{
|
|
15947
15883
|
itemCount: years.length,
|
|
@@ -15951,7 +15887,7 @@ var YearMonthPicker = ({
|
|
|
15951
15887
|
const year = years[index];
|
|
15952
15888
|
const isSelectedYear = value.getFullYear() === year;
|
|
15953
15889
|
const selectedMonthIndex = isSelectedYear ? value.getMonth() : void 0;
|
|
15954
|
-
return /* @__PURE__ */ (0,
|
|
15890
|
+
return /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
15955
15891
|
YearRow,
|
|
15956
15892
|
{
|
|
15957
15893
|
year,
|
|
@@ -15969,7 +15905,7 @@ var YearMonthPicker = ({
|
|
|
15969
15905
|
};
|
|
15970
15906
|
|
|
15971
15907
|
// src/components/user-interaction/date/DatePicker.tsx
|
|
15972
|
-
var
|
|
15908
|
+
var import_jsx_runtime65 = require("react/jsx-runtime");
|
|
15973
15909
|
var DatePicker = ({
|
|
15974
15910
|
value: controlledValue,
|
|
15975
15911
|
initialValue = /* @__PURE__ */ new Date(),
|
|
@@ -15990,11 +15926,11 @@ var DatePicker = ({
|
|
|
15990
15926
|
onValueChange,
|
|
15991
15927
|
defaultValue: initialValue
|
|
15992
15928
|
});
|
|
15993
|
-
const [displayedMonth, setDisplayedMonth] = (0,
|
|
15994
|
-
const [displayMode, setDisplayMode] = (0,
|
|
15995
|
-
return /* @__PURE__ */ (0,
|
|
15996
|
-
/* @__PURE__ */ (0,
|
|
15997
|
-
/* @__PURE__ */ (0,
|
|
15929
|
+
const [displayedMonth, setDisplayedMonth] = (0, import_react75.useState)(new Date(value.getFullYear(), value.getMonth(), 1));
|
|
15930
|
+
const [displayMode, setDisplayMode] = (0, import_react75.useState)(initialDisplay);
|
|
15931
|
+
return /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)("div", { className: (0, import_clsx23.default)("flex-col-3", className), children: [
|
|
15932
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsxs)("div", { className: "flex-row-2 items-center justify-between", children: [
|
|
15933
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsxs)(
|
|
15998
15934
|
Button,
|
|
15999
15935
|
{
|
|
16000
15936
|
size: "sm",
|
|
@@ -16005,12 +15941,12 @@ var DatePicker = ({
|
|
|
16005
15941
|
onClick: () => setDisplayMode(displayMode === "day" ? "yearMonth" : "day"),
|
|
16006
15942
|
children: [
|
|
16007
15943
|
`${new Intl.DateTimeFormat(LocalizationUtil.localToLanguage(locale), { month: "long" }).format(displayedMonth)} ${displayedMonth.getFullYear()}`,
|
|
16008
|
-
/* @__PURE__ */ (0,
|
|
15944
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)(import_lucide_react16.ChevronDown, { size: 16 })
|
|
16009
15945
|
]
|
|
16010
15946
|
}
|
|
16011
15947
|
),
|
|
16012
|
-
displayMode === "day" && /* @__PURE__ */ (0,
|
|
16013
|
-
/* @__PURE__ */ (0,
|
|
15948
|
+
displayMode === "day" && /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)("div", { className: "flex-row-2 justify-end", children: [
|
|
15949
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
16014
15950
|
IconButton,
|
|
16015
15951
|
{
|
|
16016
15952
|
tooltip: translation("time.today"),
|
|
@@ -16022,10 +15958,10 @@ var DatePicker = ({
|
|
|
16022
15958
|
setValue(newDate);
|
|
16023
15959
|
setDisplayedMonth(newDate);
|
|
16024
15960
|
},
|
|
16025
|
-
children: /* @__PURE__ */ (0,
|
|
15961
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(import_lucide_react16.Calendar, { className: "size-5" })
|
|
16026
15962
|
}
|
|
16027
15963
|
),
|
|
16028
|
-
/* @__PURE__ */ (0,
|
|
15964
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
16029
15965
|
IconButton,
|
|
16030
15966
|
{
|
|
16031
15967
|
tooltip: translation("time.previousMonth"),
|
|
@@ -16034,10 +15970,10 @@ var DatePicker = ({
|
|
|
16034
15970
|
onClick: () => {
|
|
16035
15971
|
setDisplayedMonth(DateUtils.subtractDuration(displayedMonth, { months: 1 }));
|
|
16036
15972
|
},
|
|
16037
|
-
children: /* @__PURE__ */ (0,
|
|
15973
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(import_lucide_react16.ArrowUp, { size: 20 })
|
|
16038
15974
|
}
|
|
16039
15975
|
),
|
|
16040
|
-
/* @__PURE__ */ (0,
|
|
15976
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
16041
15977
|
IconButton,
|
|
16042
15978
|
{
|
|
16043
15979
|
tooltip: translation("time.nextMonth"),
|
|
@@ -16046,12 +15982,12 @@ var DatePicker = ({
|
|
|
16046
15982
|
onClick: () => {
|
|
16047
15983
|
setDisplayedMonth(DateUtils.addDuration(displayedMonth, { months: 1 }));
|
|
16048
15984
|
},
|
|
16049
|
-
children: /* @__PURE__ */ (0,
|
|
15985
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(import_lucide_react16.ArrowDown, { size: 20 })
|
|
16050
15986
|
}
|
|
16051
15987
|
)
|
|
16052
15988
|
] })
|
|
16053
15989
|
] }),
|
|
16054
|
-
displayMode === "yearMonth" ? /* @__PURE__ */ (0,
|
|
15990
|
+
displayMode === "yearMonth" ? /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
16055
15991
|
YearMonthPicker,
|
|
16056
15992
|
{
|
|
16057
15993
|
...yearMonthPickerProps,
|
|
@@ -16068,7 +16004,7 @@ var DatePicker = ({
|
|
|
16068
16004
|
},
|
|
16069
16005
|
className: "h-60 max-h-60"
|
|
16070
16006
|
}
|
|
16071
|
-
) : /* @__PURE__ */ (0,
|
|
16007
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
16072
16008
|
DayPicker,
|
|
16073
16009
|
{
|
|
16074
16010
|
...dayPickerProps,
|
|
@@ -16087,7 +16023,7 @@ var DatePicker = ({
|
|
|
16087
16023
|
};
|
|
16088
16024
|
|
|
16089
16025
|
// src/components/user-interaction/date/DateTimePicker.tsx
|
|
16090
|
-
var
|
|
16026
|
+
var import_jsx_runtime66 = require("react/jsx-runtime");
|
|
16091
16027
|
var DateTimePicker = ({
|
|
16092
16028
|
value: controlledValue,
|
|
16093
16029
|
initialValue = /* @__PURE__ */ new Date(),
|
|
@@ -16115,7 +16051,7 @@ var DateTimePicker = ({
|
|
|
16115
16051
|
let dateDisplay;
|
|
16116
16052
|
let timeDisplay;
|
|
16117
16053
|
if (useDate) {
|
|
16118
|
-
dateDisplay = /* @__PURE__ */ (0,
|
|
16054
|
+
dateDisplay = /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
16119
16055
|
DatePicker,
|
|
16120
16056
|
{
|
|
16121
16057
|
...datePickerProps,
|
|
@@ -16131,7 +16067,7 @@ var DateTimePicker = ({
|
|
|
16131
16067
|
);
|
|
16132
16068
|
}
|
|
16133
16069
|
if (useTime) {
|
|
16134
|
-
timeDisplay = /* @__PURE__ */ (0,
|
|
16070
|
+
timeDisplay = /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
16135
16071
|
TimePicker,
|
|
16136
16072
|
{
|
|
16137
16073
|
...timePickerProps,
|
|
@@ -16146,15 +16082,15 @@ var DateTimePicker = ({
|
|
|
16146
16082
|
}
|
|
16147
16083
|
);
|
|
16148
16084
|
}
|
|
16149
|
-
return /* @__PURE__ */ (0,
|
|
16085
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)("div", { className: "flex-row-2 min-h-71 max-h-71", children: [
|
|
16150
16086
|
dateDisplay,
|
|
16151
16087
|
timeDisplay
|
|
16152
16088
|
] });
|
|
16153
16089
|
};
|
|
16154
16090
|
|
|
16155
16091
|
// src/components/user-interaction/date/DateTimePickerDialog.tsx
|
|
16156
|
-
var
|
|
16157
|
-
var
|
|
16092
|
+
var import_react76 = require("react");
|
|
16093
|
+
var import_jsx_runtime67 = require("react/jsx-runtime");
|
|
16158
16094
|
var DateTimePickerDialog = ({
|
|
16159
16095
|
initialValue = null,
|
|
16160
16096
|
value,
|
|
@@ -16181,12 +16117,12 @@ var DateTimePickerDialog = ({
|
|
|
16181
16117
|
onValueChange,
|
|
16182
16118
|
defaultValue: initialValue
|
|
16183
16119
|
});
|
|
16184
|
-
const [pickerState, setPickerState] = (0,
|
|
16185
|
-
(0,
|
|
16120
|
+
const [pickerState, setPickerState] = (0, import_react76.useState)(state ?? /* @__PURE__ */ new Date());
|
|
16121
|
+
(0, import_react76.useEffect)(() => {
|
|
16186
16122
|
setPickerState(state ?? /* @__PURE__ */ new Date());
|
|
16187
16123
|
}, [state]);
|
|
16188
|
-
return /* @__PURE__ */ (0,
|
|
16189
|
-
/* @__PURE__ */ (0,
|
|
16124
|
+
return /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)(import_jsx_runtime67.Fragment, { children: [
|
|
16125
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)("div", { className: "flex-row-2 justify-center w-full py-1", children: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
16190
16126
|
"span",
|
|
16191
16127
|
{
|
|
16192
16128
|
id: labelId,
|
|
@@ -16194,7 +16130,7 @@ var DateTimePickerDialog = ({
|
|
|
16194
16130
|
children: label ?? translation("sDateTimeSelect", { datetimeMode: mode })
|
|
16195
16131
|
}
|
|
16196
16132
|
) }),
|
|
16197
|
-
/* @__PURE__ */ (0,
|
|
16133
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
16198
16134
|
DateTimePicker,
|
|
16199
16135
|
{
|
|
16200
16136
|
...pickerProps,
|
|
@@ -16213,8 +16149,8 @@ var DateTimePickerDialog = ({
|
|
|
16213
16149
|
precision
|
|
16214
16150
|
}
|
|
16215
16151
|
),
|
|
16216
|
-
/* @__PURE__ */ (0,
|
|
16217
|
-
/* @__PURE__ */ (0,
|
|
16152
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsxs)("div", { className: "flex-row-2 justify-end", children: [
|
|
16153
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)(Visibility, { isVisible: allowRemove && !!state, children: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
16218
16154
|
Button,
|
|
16219
16155
|
{
|
|
16220
16156
|
size: "md",
|
|
@@ -16227,7 +16163,7 @@ var DateTimePickerDialog = ({
|
|
|
16227
16163
|
children: translation("clear")
|
|
16228
16164
|
}
|
|
16229
16165
|
) }),
|
|
16230
|
-
/* @__PURE__ */ (0,
|
|
16166
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)(Visibility, { isVisible: !state, children: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
16231
16167
|
Button,
|
|
16232
16168
|
{
|
|
16233
16169
|
size: "md",
|
|
@@ -16240,7 +16176,7 @@ var DateTimePickerDialog = ({
|
|
|
16240
16176
|
children: translation("cancel")
|
|
16241
16177
|
}
|
|
16242
16178
|
) }),
|
|
16243
|
-
/* @__PURE__ */ (0,
|
|
16179
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
16244
16180
|
Button,
|
|
16245
16181
|
{
|
|
16246
16182
|
size: "md",
|
|
@@ -16256,8 +16192,8 @@ var DateTimePickerDialog = ({
|
|
|
16256
16192
|
};
|
|
16257
16193
|
|
|
16258
16194
|
// src/components/user-interaction/input/DateTimeInput.tsx
|
|
16259
|
-
var
|
|
16260
|
-
var DateTimeInput = (0,
|
|
16195
|
+
var import_jsx_runtime68 = require("react/jsx-runtime");
|
|
16196
|
+
var DateTimeInput = (0, import_react77.forwardRef)(function DateTimeInput2({
|
|
16261
16197
|
id: inputId,
|
|
16262
16198
|
value,
|
|
16263
16199
|
initialValue = null,
|
|
@@ -16286,37 +16222,35 @@ var DateTimeInput = (0, import_react78.forwardRef)(function DateTimeInput2({
|
|
|
16286
16222
|
...props
|
|
16287
16223
|
}, forwardedRef) {
|
|
16288
16224
|
const translation = useHightideTranslation();
|
|
16289
|
-
const [isOpen, setIsOpen] = (0,
|
|
16225
|
+
const [isOpen, setIsOpen] = (0, import_react77.useState)(false);
|
|
16290
16226
|
const [state, setState] = useControlledState({
|
|
16291
16227
|
value,
|
|
16292
16228
|
onValueChange,
|
|
16293
16229
|
defaultValue: initialValue
|
|
16294
16230
|
});
|
|
16295
|
-
const [dialogValue, setDialogValue] = (0,
|
|
16296
|
-
const [stringInputState, setStringInputState] = (0,
|
|
16231
|
+
const [dialogValue, setDialogValue] = (0, import_react77.useState)(state);
|
|
16232
|
+
const [stringInputState, setStringInputState] = (0, import_react77.useState)({
|
|
16297
16233
|
state: state ? DateUtils.toInputString(state, mode, precision) : "",
|
|
16298
|
-
date: void 0
|
|
16234
|
+
date: void 0,
|
|
16235
|
+
mode
|
|
16299
16236
|
});
|
|
16300
|
-
(0,
|
|
16301
|
-
|
|
16302
|
-
|
|
16303
|
-
|
|
16304
|
-
|
|
16305
|
-
});
|
|
16306
|
-
}, [mode, state]);
|
|
16307
|
-
const changeOpenWrapper = (0, import_react78.useCallback)((isOpen2) => {
|
|
16237
|
+
const safeInputString = (0, import_react77.useMemo)(() => {
|
|
16238
|
+
if (!state) return "";
|
|
16239
|
+
return stringInputState.mode !== mode ? DateUtils.toInputString(state, mode, precision) : stringInputState.state;
|
|
16240
|
+
}, [stringInputState.mode, stringInputState.state, mode, state, precision]);
|
|
16241
|
+
const changeOpenWrapper = (0, import_react77.useCallback)((isOpen2) => {
|
|
16308
16242
|
onDialogOpeningChange?.(isOpen2);
|
|
16309
16243
|
setIsOpen(isOpen2);
|
|
16310
16244
|
}, [onDialogOpeningChange]);
|
|
16311
|
-
const generatedId = (0,
|
|
16312
|
-
const ids = (0,
|
|
16245
|
+
const generatedId = (0, import_react77.useId)();
|
|
16246
|
+
const ids = (0, import_react77.useMemo)(() => ({
|
|
16313
16247
|
input: inputId ?? `date-time-input-${generatedId}`,
|
|
16314
16248
|
popup: `date-time-input-popup-${generatedId}`,
|
|
16315
16249
|
label: `date-time-input-label-${generatedId}`
|
|
16316
16250
|
}), [generatedId, inputId]);
|
|
16317
|
-
const innerRef = (0,
|
|
16318
|
-
(0,
|
|
16319
|
-
(0,
|
|
16251
|
+
const innerRef = (0, import_react77.useRef)(null);
|
|
16252
|
+
(0, import_react77.useImperativeHandle)(forwardedRef, () => innerRef.current);
|
|
16253
|
+
(0, import_react77.useEffect)(() => {
|
|
16320
16254
|
if (readOnly || disabled) {
|
|
16321
16255
|
changeOpenWrapper(false);
|
|
16322
16256
|
}
|
|
@@ -16325,21 +16259,26 @@ var DateTimeInput = (0, import_react78.forwardRef)(function DateTimeInput2({
|
|
|
16325
16259
|
restartTimer,
|
|
16326
16260
|
clearTimer
|
|
16327
16261
|
} = useDelay({ delay: 2e3, disabled: disabled || readOnly });
|
|
16328
|
-
return /* @__PURE__ */ (0,
|
|
16329
|
-
/* @__PURE__ */ (0,
|
|
16330
|
-
/* @__PURE__ */ (0,
|
|
16262
|
+
return /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)(import_jsx_runtime68.Fragment, { children: [
|
|
16263
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsxs)("div", { ...containerProps, className: (0, import_clsx24.default)("relative w-full", containerProps?.className), children: [
|
|
16264
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
|
|
16331
16265
|
"input",
|
|
16332
16266
|
{
|
|
16333
16267
|
...props,
|
|
16334
16268
|
ref: innerRef,
|
|
16335
16269
|
id: ids.input,
|
|
16336
|
-
value:
|
|
16270
|
+
value: safeInputString,
|
|
16337
16271
|
onClick: (event) => {
|
|
16338
16272
|
event.preventDefault();
|
|
16339
16273
|
},
|
|
16340
16274
|
onFocus: (event) => {
|
|
16341
16275
|
event.preventDefault();
|
|
16342
16276
|
},
|
|
16277
|
+
onKeyDown: (event) => {
|
|
16278
|
+
if (event.key === " ") {
|
|
16279
|
+
event.preventDefault();
|
|
16280
|
+
}
|
|
16281
|
+
},
|
|
16343
16282
|
onChange: (event) => {
|
|
16344
16283
|
const date = new Date(event.target.value ?? "");
|
|
16345
16284
|
const isValid = !isNaN(date.getTime());
|
|
@@ -16354,7 +16293,8 @@ var DateTimeInput = (0, import_react78.forwardRef)(function DateTimeInput2({
|
|
|
16354
16293
|
}
|
|
16355
16294
|
setStringInputState({
|
|
16356
16295
|
state: event.target.value,
|
|
16357
|
-
date: isValid ? date : void 0
|
|
16296
|
+
date: isValid ? date : void 0,
|
|
16297
|
+
mode
|
|
16358
16298
|
});
|
|
16359
16299
|
},
|
|
16360
16300
|
onBlur: (event) => {
|
|
@@ -16369,7 +16309,8 @@ var DateTimeInput = (0, import_react78.forwardRef)(function DateTimeInput2({
|
|
|
16369
16309
|
}
|
|
16370
16310
|
setStringInputState({
|
|
16371
16311
|
state: state ? DateUtils.toInputString(state, mode) : "",
|
|
16372
|
-
date: void 0
|
|
16312
|
+
date: void 0,
|
|
16313
|
+
mode
|
|
16373
16314
|
});
|
|
16374
16315
|
}
|
|
16375
16316
|
},
|
|
@@ -16380,9 +16321,9 @@ var DateTimeInput = (0, import_react78.forwardRef)(function DateTimeInput2({
|
|
|
16380
16321
|
...PropsUtil.aria.interactionStates({ disabled, readOnly, invalid, required }, props)
|
|
16381
16322
|
}
|
|
16382
16323
|
),
|
|
16383
|
-
/* @__PURE__ */ (0,
|
|
16324
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsxs)("div", { className: "absolute right-1 top-1/2 -translate-y-1/2 flex-row-0", children: [
|
|
16384
16325
|
actions,
|
|
16385
|
-
/* @__PURE__ */ (0,
|
|
16326
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)(Visibility, { isVisible: !readOnly, children: /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
|
|
16386
16327
|
IconButton,
|
|
16387
16328
|
{
|
|
16388
16329
|
tooltip: translation("sDateTimeSelect", { datetimeMode: mode }),
|
|
@@ -16396,12 +16337,12 @@ var DateTimeInput = (0, import_react78.forwardRef)(function DateTimeInput2({
|
|
|
16396
16337
|
"aria-haspopup": "dialog",
|
|
16397
16338
|
"aria-expanded": isOpen,
|
|
16398
16339
|
"aria-controls": isOpen ? ids.popup : void 0,
|
|
16399
|
-
children: /* @__PURE__ */ (0,
|
|
16340
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(import_lucide_react17.CalendarIcon, { className: "size-5" })
|
|
16400
16341
|
}
|
|
16401
16342
|
) })
|
|
16402
16343
|
] })
|
|
16403
16344
|
] }),
|
|
16404
|
-
/* @__PURE__ */ (0,
|
|
16345
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
|
|
16405
16346
|
PopUp,
|
|
16406
16347
|
{
|
|
16407
16348
|
id: ids.popup,
|
|
@@ -16420,7 +16361,7 @@ var DateTimeInput = (0, import_react78.forwardRef)(function DateTimeInput2({
|
|
|
16420
16361
|
role: "dialog",
|
|
16421
16362
|
"aria-labelledby": ids.label,
|
|
16422
16363
|
className: "flex-col-2 p-2",
|
|
16423
|
-
children: /* @__PURE__ */ (0,
|
|
16364
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
|
|
16424
16365
|
DateTimePickerDialog,
|
|
16425
16366
|
{
|
|
16426
16367
|
value: dialogValue,
|
|
@@ -16450,25 +16391,25 @@ var DateTimeInput = (0, import_react78.forwardRef)(function DateTimeInput2({
|
|
|
16450
16391
|
});
|
|
16451
16392
|
|
|
16452
16393
|
// src/components/user-interaction/MultiSelect/MultiSelect.tsx
|
|
16453
|
-
var
|
|
16394
|
+
var import_react85 = require("react");
|
|
16454
16395
|
|
|
16455
16396
|
// src/components/user-interaction/MultiSelect/MultiSelectRoot.tsx
|
|
16456
|
-
var
|
|
16397
|
+
var import_react81 = require("react");
|
|
16457
16398
|
|
|
16458
16399
|
// src/components/user-interaction/MultiSelect/MultiSelectContext.tsx
|
|
16459
|
-
var
|
|
16460
|
-
var MultiSelectContext = (0,
|
|
16400
|
+
var import_react78 = require("react");
|
|
16401
|
+
var MultiSelectContext = (0, import_react78.createContext)(null);
|
|
16461
16402
|
function useMultiSelectContext() {
|
|
16462
|
-
const ctx = (0,
|
|
16403
|
+
const ctx = (0, import_react78.useContext)(MultiSelectContext);
|
|
16463
16404
|
if (!ctx) throw new Error("useMultiSelectContext must be used within MultiSelectRoot");
|
|
16464
16405
|
return ctx;
|
|
16465
16406
|
}
|
|
16466
16407
|
|
|
16467
16408
|
// src/components/user-interaction/MultiSelect/useMultiSelect.ts
|
|
16468
|
-
var
|
|
16409
|
+
var import_react80 = require("react");
|
|
16469
16410
|
|
|
16470
16411
|
// src/hooks/useMultiSelection.ts
|
|
16471
|
-
var
|
|
16412
|
+
var import_react79 = require("react");
|
|
16472
16413
|
function useMultiSelection({
|
|
16473
16414
|
options: optionsList,
|
|
16474
16415
|
value,
|
|
@@ -16482,8 +16423,8 @@ function useMultiSelection({
|
|
|
16482
16423
|
defaultValue: [...initialSelection],
|
|
16483
16424
|
isControlled
|
|
16484
16425
|
});
|
|
16485
|
-
const isSelected = (0,
|
|
16486
|
-
const toggleSelection = (0,
|
|
16426
|
+
const isSelected = (0, import_react79.useCallback)((id) => selection.includes(id), [selection]);
|
|
16427
|
+
const toggleSelection = (0, import_react79.useCallback)(
|
|
16487
16428
|
(id) => {
|
|
16488
16429
|
const option = optionsList.find((o) => o.id === id);
|
|
16489
16430
|
if (!option || option.disabled) return;
|
|
@@ -16491,11 +16432,11 @@ function useMultiSelection({
|
|
|
16491
16432
|
},
|
|
16492
16433
|
[optionsList, setSelection]
|
|
16493
16434
|
);
|
|
16494
|
-
const setSelectionValue = (0,
|
|
16435
|
+
const setSelectionValue = (0, import_react79.useCallback)(
|
|
16495
16436
|
(next) => setSelection(Array.from(next)),
|
|
16496
16437
|
[setSelection]
|
|
16497
16438
|
);
|
|
16498
|
-
return (0,
|
|
16439
|
+
return (0, import_react79.useMemo)(
|
|
16499
16440
|
() => ({
|
|
16500
16441
|
selection,
|
|
16501
16442
|
setSelection: setSelectionValue,
|
|
@@ -16517,9 +16458,9 @@ function useMultiSelect({
|
|
|
16517
16458
|
initialIsOpen = false,
|
|
16518
16459
|
typeAheadResetMs = 500
|
|
16519
16460
|
}) {
|
|
16520
|
-
const [isOpen, setIsOpen] = (0,
|
|
16521
|
-
const [searchQuery, setSearchQuery] = (0,
|
|
16522
|
-
const selectionOptions = (0,
|
|
16461
|
+
const [isOpen, setIsOpen] = (0, import_react80.useState)(initialIsOpen);
|
|
16462
|
+
const [searchQuery, setSearchQuery] = (0, import_react80.useState)("");
|
|
16463
|
+
const selectionOptions = (0, import_react80.useMemo)(
|
|
16523
16464
|
() => options.map((o) => ({ id: o.id, disabled: o.disabled })),
|
|
16524
16465
|
[options]
|
|
16525
16466
|
);
|
|
@@ -16535,13 +16476,13 @@ function useMultiSelect({
|
|
|
16535
16476
|
const { searchResult: visibleOptions } = useSearch({
|
|
16536
16477
|
items: options,
|
|
16537
16478
|
searchQuery,
|
|
16538
|
-
toTags: (0,
|
|
16479
|
+
toTags: (0, import_react80.useCallback)((o) => [o.label ?? ""], [])
|
|
16539
16480
|
});
|
|
16540
|
-
const visibleOptionIds = (0,
|
|
16481
|
+
const visibleOptionIds = (0, import_react80.useMemo)(
|
|
16541
16482
|
() => visibleOptions.map((o) => o.id),
|
|
16542
16483
|
[visibleOptions]
|
|
16543
16484
|
);
|
|
16544
|
-
const enabledOptions = (0,
|
|
16485
|
+
const enabledOptions = (0, import_react80.useMemo)(
|
|
16545
16486
|
() => visibleOptions.filter((o) => !o.disabled),
|
|
16546
16487
|
[visibleOptions]
|
|
16547
16488
|
);
|
|
@@ -16554,7 +16495,7 @@ function useMultiSelect({
|
|
|
16554
16495
|
options: enabledOptions,
|
|
16555
16496
|
resetTimer: typeAheadResetMs,
|
|
16556
16497
|
toString: (o) => o.label ?? "",
|
|
16557
|
-
onResultChange: (0,
|
|
16498
|
+
onResultChange: (0, import_react80.useCallback)(
|
|
16558
16499
|
(option) => {
|
|
16559
16500
|
if (option) listNav.highlight(option.id);
|
|
16560
16501
|
},
|
|
@@ -16562,14 +16503,14 @@ function useMultiSelect({
|
|
|
16562
16503
|
)
|
|
16563
16504
|
});
|
|
16564
16505
|
const { reset: typeAheadReset, addToTypeAhead } = typeAhead;
|
|
16565
|
-
(0,
|
|
16506
|
+
(0, import_react80.useEffect)(() => {
|
|
16566
16507
|
if (!isOpen) typeAheadReset();
|
|
16567
16508
|
}, [isOpen, typeAheadReset]);
|
|
16568
|
-
const highlightItem = (0,
|
|
16509
|
+
const highlightItem = (0, import_react80.useCallback)((id) => {
|
|
16569
16510
|
if (!enabledOptions.some((o) => o.id === id)) return;
|
|
16570
16511
|
listNavHighlight(id);
|
|
16571
16512
|
}, [enabledOptions, listNavHighlight]);
|
|
16572
|
-
const toggleSelectionValue = (0,
|
|
16513
|
+
const toggleSelectionValue = (0, import_react80.useCallback)((id, newIsSelected) => {
|
|
16573
16514
|
const next = newIsSelected ?? !isSelected(id);
|
|
16574
16515
|
if (next) {
|
|
16575
16516
|
toggleSelection(id);
|
|
@@ -16578,7 +16519,7 @@ function useMultiSelect({
|
|
|
16578
16519
|
}
|
|
16579
16520
|
highlightItem(id);
|
|
16580
16521
|
}, [toggleSelection, setSelection, highlightItem, isSelected, selection]);
|
|
16581
|
-
const setIsOpenWrapper = (0,
|
|
16522
|
+
const setIsOpenWrapper = (0, import_react80.useCallback)(
|
|
16582
16523
|
(open, behavior) => {
|
|
16583
16524
|
setIsOpen(open);
|
|
16584
16525
|
behavior = behavior ?? "first";
|
|
@@ -16609,13 +16550,13 @@ function useMultiSelect({
|
|
|
16609
16550
|
enabledOptions
|
|
16610
16551
|
]
|
|
16611
16552
|
);
|
|
16612
|
-
const toggleOpenWrapper = (0,
|
|
16553
|
+
const toggleOpenWrapper = (0, import_react80.useCallback)(
|
|
16613
16554
|
(behavior) => {
|
|
16614
16555
|
setIsOpenWrapper(!isOpen, behavior);
|
|
16615
16556
|
},
|
|
16616
16557
|
[isOpen, setIsOpenWrapper]
|
|
16617
16558
|
);
|
|
16618
|
-
const state = (0,
|
|
16559
|
+
const state = (0, import_react80.useMemo)(
|
|
16619
16560
|
() => ({
|
|
16620
16561
|
value: [...selection],
|
|
16621
16562
|
highlightedId: listNav.highlightedId,
|
|
@@ -16631,11 +16572,11 @@ function useMultiSelect({
|
|
|
16631
16572
|
options
|
|
16632
16573
|
]
|
|
16633
16574
|
);
|
|
16634
|
-
const computedState = (0,
|
|
16575
|
+
const computedState = (0, import_react80.useMemo)(
|
|
16635
16576
|
() => ({ visibleOptionIds }),
|
|
16636
16577
|
[visibleOptionIds]
|
|
16637
16578
|
);
|
|
16638
|
-
const actions = (0,
|
|
16579
|
+
const actions = (0, import_react80.useMemo)(
|
|
16639
16580
|
() => ({
|
|
16640
16581
|
setIsOpen: setIsOpenWrapper,
|
|
16641
16582
|
toggleOpen: toggleOpenWrapper,
|
|
@@ -16664,7 +16605,7 @@ function useMultiSelect({
|
|
|
16664
16605
|
addToTypeAhead
|
|
16665
16606
|
]
|
|
16666
16607
|
);
|
|
16667
|
-
return (0,
|
|
16608
|
+
return (0, import_react80.useMemo)(
|
|
16668
16609
|
() => ({
|
|
16669
16610
|
...state,
|
|
16670
16611
|
...computedState,
|
|
@@ -16675,7 +16616,7 @@ function useMultiSelect({
|
|
|
16675
16616
|
}
|
|
16676
16617
|
|
|
16677
16618
|
// src/components/user-interaction/MultiSelect/MultiSelectRoot.tsx
|
|
16678
|
-
var
|
|
16619
|
+
var import_jsx_runtime69 = require("react/jsx-runtime");
|
|
16679
16620
|
function MultiSelectRoot({
|
|
16680
16621
|
children,
|
|
16681
16622
|
value,
|
|
@@ -16692,16 +16633,16 @@ function MultiSelectRoot({
|
|
|
16692
16633
|
readOnly = false,
|
|
16693
16634
|
required = false
|
|
16694
16635
|
}) {
|
|
16695
|
-
const [triggerRef, setTriggerRef] = (0,
|
|
16696
|
-
const [options, setOptions] = (0,
|
|
16697
|
-
const generatedId = (0,
|
|
16698
|
-
const [ids, setIds] = (0,
|
|
16636
|
+
const [triggerRef, setTriggerRef] = (0, import_react81.useState)(null);
|
|
16637
|
+
const [options, setOptions] = (0, import_react81.useState)([]);
|
|
16638
|
+
const generatedId = (0, import_react81.useId)();
|
|
16639
|
+
const [ids, setIds] = (0, import_react81.useState)({
|
|
16699
16640
|
trigger: "multi-select-" + generatedId,
|
|
16700
16641
|
content: "multi-select-content-" + generatedId,
|
|
16701
16642
|
listbox: "multi-select-listbox-" + generatedId,
|
|
16702
16643
|
searchInput: "multi-select-search-" + generatedId
|
|
16703
16644
|
});
|
|
16704
|
-
const registerOption = (0,
|
|
16645
|
+
const registerOption = (0, import_react81.useCallback)((item) => {
|
|
16705
16646
|
setOptions((prev) => {
|
|
16706
16647
|
const next = prev.filter((o) => o.id !== item.id);
|
|
16707
16648
|
next.push(item);
|
|
@@ -16710,12 +16651,12 @@ function MultiSelectRoot({
|
|
|
16710
16651
|
});
|
|
16711
16652
|
return () => setOptions((prev) => prev.filter((o) => o.id !== item.id));
|
|
16712
16653
|
}, []);
|
|
16713
|
-
const registerTrigger = (0,
|
|
16654
|
+
const registerTrigger = (0, import_react81.useCallback)((ref) => {
|
|
16714
16655
|
setTriggerRef(ref);
|
|
16715
16656
|
return () => setTriggerRef(null);
|
|
16716
16657
|
}, []);
|
|
16717
|
-
const compare = (0,
|
|
16718
|
-
const idToOptionMap = (0,
|
|
16658
|
+
const compare = (0, import_react81.useMemo)(() => compareFunction ?? Object.is, [compareFunction]);
|
|
16659
|
+
const idToOptionMap = (0, import_react81.useMemo)(
|
|
16719
16660
|
() => options.reduce(
|
|
16720
16661
|
(acc, o) => {
|
|
16721
16662
|
acc[o.id] = o;
|
|
@@ -16725,22 +16666,22 @@ function MultiSelectRoot({
|
|
|
16725
16666
|
),
|
|
16726
16667
|
[options]
|
|
16727
16668
|
);
|
|
16728
|
-
const mappedValueIds = (0,
|
|
16669
|
+
const mappedValueIds = (0, import_react81.useMemo)(() => {
|
|
16729
16670
|
if (value == null) return void 0;
|
|
16730
16671
|
return value.map((v) => options.find((o) => compare(o.value, v))?.id).filter((id) => id !== void 0);
|
|
16731
16672
|
}, [options, value, compare]);
|
|
16732
|
-
const mappedInitialValueIds = (0,
|
|
16673
|
+
const mappedInitialValueIds = (0, import_react81.useMemo)(() => {
|
|
16733
16674
|
if (initialValue == null) return [];
|
|
16734
16675
|
return initialValue.map((v) => options.find((o) => compare(o.value, v))?.id).filter((id) => id !== void 0);
|
|
16735
16676
|
}, [options, initialValue, compare]);
|
|
16736
|
-
const onValueChangeStable = (0,
|
|
16677
|
+
const onValueChangeStable = (0, import_react81.useCallback)(
|
|
16737
16678
|
(ids2) => {
|
|
16738
16679
|
const values = ids2.map((id) => idToOptionMap[id]?.value).filter((v) => v != null);
|
|
16739
16680
|
onValueChange?.(values);
|
|
16740
16681
|
},
|
|
16741
16682
|
[idToOptionMap, onValueChange]
|
|
16742
16683
|
);
|
|
16743
|
-
const onEditCompleteStable = (0,
|
|
16684
|
+
const onEditCompleteStable = (0, import_react81.useCallback)(
|
|
16744
16685
|
(ids2) => {
|
|
16745
16686
|
const values = ids2.map((id) => idToOptionMap[id]?.value).filter((v) => v != null);
|
|
16746
16687
|
onEditComplete?.(values);
|
|
@@ -16757,12 +16698,12 @@ function MultiSelectRoot({
|
|
|
16757
16698
|
onClose
|
|
16758
16699
|
});
|
|
16759
16700
|
const { setSearchQuery } = state;
|
|
16760
|
-
(0,
|
|
16701
|
+
(0, import_react81.useEffect)(() => {
|
|
16761
16702
|
if (showSearch === false) {
|
|
16762
16703
|
setSearchQuery("");
|
|
16763
16704
|
}
|
|
16764
16705
|
}, [showSearch, setSearchQuery]);
|
|
16765
|
-
const contextValue = (0,
|
|
16706
|
+
const contextValue = (0, import_react81.useMemo)(() => {
|
|
16766
16707
|
const valueT = state.value.map((id) => idToOptionMap[id]?.value).filter((v) => v != null);
|
|
16767
16708
|
return {
|
|
16768
16709
|
invalid,
|
|
@@ -16816,7 +16757,7 @@ function MultiSelectRoot({
|
|
|
16816
16757
|
registerTrigger,
|
|
16817
16758
|
showSearch
|
|
16818
16759
|
]);
|
|
16819
|
-
return /* @__PURE__ */ (0,
|
|
16760
|
+
return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(MultiSelectContext.Provider, { value: contextValue, children: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
16820
16761
|
PopUpContext.Provider,
|
|
16821
16762
|
{
|
|
16822
16763
|
value: {
|
|
@@ -16833,16 +16774,16 @@ function MultiSelectRoot({
|
|
|
16833
16774
|
}
|
|
16834
16775
|
|
|
16835
16776
|
// src/components/user-interaction/MultiSelect/MultiSelectButton.tsx
|
|
16836
|
-
var
|
|
16777
|
+
var import_react83 = require("react");
|
|
16837
16778
|
|
|
16838
16779
|
// src/components/user-interaction/MultiSelect/MultiSelectOption.tsx
|
|
16839
16780
|
var import_clsx25 = __toESM(require("clsx"));
|
|
16840
|
-
var
|
|
16841
|
-
var
|
|
16842
|
-
var
|
|
16843
|
-
var MultiSelectOptionDisplayContext = (0,
|
|
16781
|
+
var import_lucide_react18 = require("lucide-react");
|
|
16782
|
+
var import_react82 = require("react");
|
|
16783
|
+
var import_jsx_runtime70 = require("react/jsx-runtime");
|
|
16784
|
+
var MultiSelectOptionDisplayContext = (0, import_react82.createContext)(null);
|
|
16844
16785
|
function useMultiSelectOptionDisplayLocation() {
|
|
16845
|
-
const context = (0,
|
|
16786
|
+
const context = (0, import_react82.useContext)(MultiSelectOptionDisplayContext);
|
|
16846
16787
|
if (!context) {
|
|
16847
16788
|
throw new Error(
|
|
16848
16789
|
"useMultiSelectOptionDisplayLocation must be used within a MultiSelectOptionDisplayContext"
|
|
@@ -16850,7 +16791,7 @@ function useMultiSelectOptionDisplayLocation() {
|
|
|
16850
16791
|
}
|
|
16851
16792
|
return context;
|
|
16852
16793
|
}
|
|
16853
|
-
var MultiSelectOption = (0,
|
|
16794
|
+
var MultiSelectOption = (0, import_react82.forwardRef)(function MultiSelectOption2({
|
|
16854
16795
|
children,
|
|
16855
16796
|
label,
|
|
16856
16797
|
value,
|
|
@@ -16860,12 +16801,12 @@ var MultiSelectOption = (0, import_react83.forwardRef)(function MultiSelectOptio
|
|
|
16860
16801
|
}, ref) {
|
|
16861
16802
|
const context = useMultiSelectContext();
|
|
16862
16803
|
const { registerOption } = context;
|
|
16863
|
-
const itemRef = (0,
|
|
16804
|
+
const itemRef = (0, import_react82.useRef)(null);
|
|
16864
16805
|
const display = children ?? label;
|
|
16865
16806
|
const iconAppearanceResolved = iconAppearance ?? context.config.iconAppearance;
|
|
16866
|
-
const generatedId = (0,
|
|
16807
|
+
const generatedId = (0, import_react82.useId)();
|
|
16867
16808
|
const optionId = props?.id ?? "multi-select-option-" + generatedId;
|
|
16868
|
-
(0,
|
|
16809
|
+
(0, import_react82.useEffect)(() => {
|
|
16869
16810
|
return registerOption({
|
|
16870
16811
|
id: optionId,
|
|
16871
16812
|
value,
|
|
@@ -16878,7 +16819,7 @@ var MultiSelectOption = (0, import_react83.forwardRef)(function MultiSelectOptio
|
|
|
16878
16819
|
const isHighlighted = context.highlightedId === optionId;
|
|
16879
16820
|
const isSelected = context.selectedIds.includes(optionId);
|
|
16880
16821
|
const isVisible = context.visibleOptionIds.includes(optionId);
|
|
16881
|
-
return /* @__PURE__ */ (0,
|
|
16822
|
+
return /* @__PURE__ */ (0, import_jsx_runtime70.jsxs)(
|
|
16882
16823
|
"li",
|
|
16883
16824
|
{
|
|
16884
16825
|
...props,
|
|
@@ -16911,16 +16852,16 @@ var MultiSelectOption = (0, import_react83.forwardRef)(function MultiSelectOptio
|
|
|
16911
16852
|
}
|
|
16912
16853
|
},
|
|
16913
16854
|
children: [
|
|
16914
|
-
iconAppearanceResolved === "left" && /* @__PURE__ */ (0,
|
|
16915
|
-
|
|
16855
|
+
iconAppearanceResolved === "left" && /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
|
|
16856
|
+
import_lucide_react18.CheckIcon,
|
|
16916
16857
|
{
|
|
16917
16858
|
className: (0, import_clsx25.default)("w-4 h-4", { "opacity-0": !isSelected || disabled }),
|
|
16918
16859
|
"aria-hidden": true
|
|
16919
16860
|
}
|
|
16920
16861
|
),
|
|
16921
|
-
/* @__PURE__ */ (0,
|
|
16922
|
-
iconAppearanceResolved === "right" && /* @__PURE__ */ (0,
|
|
16923
|
-
|
|
16862
|
+
/* @__PURE__ */ (0, import_jsx_runtime70.jsx)(MultiSelectOptionDisplayContext.Provider, { value: "list", children: display }),
|
|
16863
|
+
iconAppearanceResolved === "right" && /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
|
|
16864
|
+
import_lucide_react18.CheckIcon,
|
|
16924
16865
|
{
|
|
16925
16866
|
className: (0, import_clsx25.default)("w-4 h-4", { "opacity-0": !isSelected || disabled }),
|
|
16926
16867
|
"aria-hidden": true
|
|
@@ -16932,8 +16873,8 @@ var MultiSelectOption = (0, import_react83.forwardRef)(function MultiSelectOptio
|
|
|
16932
16873
|
});
|
|
16933
16874
|
|
|
16934
16875
|
// src/components/user-interaction/MultiSelect/MultiSelectButton.tsx
|
|
16935
|
-
var
|
|
16936
|
-
var MultiSelectButton = (0,
|
|
16876
|
+
var import_jsx_runtime71 = require("react/jsx-runtime");
|
|
16877
|
+
var MultiSelectButton = (0, import_react83.forwardRef)(function MultiSelectButton2({
|
|
16937
16878
|
id,
|
|
16938
16879
|
placeholder,
|
|
16939
16880
|
disabled: disabledOverride,
|
|
@@ -16946,12 +16887,12 @@ var MultiSelectButton = (0, import_react84.forwardRef)(function MultiSelectButto
|
|
|
16946
16887
|
const { config, layout } = context;
|
|
16947
16888
|
const { setIds } = config;
|
|
16948
16889
|
const { registerTrigger } = layout;
|
|
16949
|
-
(0,
|
|
16890
|
+
(0, import_react83.useEffect)(() => {
|
|
16950
16891
|
if (id) setIds((prev) => ({ ...prev, trigger: id }));
|
|
16951
16892
|
}, [id, setIds]);
|
|
16952
|
-
const innerRef = (0,
|
|
16953
|
-
(0,
|
|
16954
|
-
(0,
|
|
16893
|
+
const innerRef = (0, import_react83.useRef)(null);
|
|
16894
|
+
(0, import_react83.useImperativeHandle)(ref, () => innerRef.current);
|
|
16895
|
+
(0, import_react83.useEffect)(() => {
|
|
16955
16896
|
const unregister = registerTrigger(innerRef);
|
|
16956
16897
|
return () => unregister();
|
|
16957
16898
|
}, [registerTrigger]);
|
|
@@ -16959,7 +16900,7 @@ var MultiSelectButton = (0, import_react84.forwardRef)(function MultiSelectButto
|
|
|
16959
16900
|
const invalid = context.invalid;
|
|
16960
16901
|
const hasValue = context.value.length > 0;
|
|
16961
16902
|
const selectedOptions = context.selectedIds.map((id2) => context.idToOptionMap[id2]).filter(Boolean);
|
|
16962
|
-
return /* @__PURE__ */ (0,
|
|
16903
|
+
return /* @__PURE__ */ (0, import_jsx_runtime71.jsxs)(
|
|
16963
16904
|
"div",
|
|
16964
16905
|
{
|
|
16965
16906
|
...props,
|
|
@@ -17003,34 +16944,34 @@ var MultiSelectButton = (0, import_react84.forwardRef)(function MultiSelectButto
|
|
|
17003
16944
|
"aria-expanded": context.isOpen,
|
|
17004
16945
|
"aria-controls": context.isOpen ? context.config.ids.content : void 0,
|
|
17005
16946
|
children: [
|
|
17006
|
-
/* @__PURE__ */ (0,
|
|
16947
|
+
/* @__PURE__ */ (0, import_jsx_runtime71.jsx)(MultiSelectOptionDisplayContext.Provider, { value: "trigger", children: hasValue ? selectedDisplay?.(context.value) ?? /* @__PURE__ */ (0, import_jsx_runtime71.jsx)("div", { className: "flex flex-wrap gap-x-1 gap-y-2", children: selectedOptions.map((opt, index) => /* @__PURE__ */ (0, import_jsx_runtime71.jsxs)("span", { children: [
|
|
17007
16948
|
opt.display,
|
|
17008
|
-
index < selectedOptions.length - 1 && /* @__PURE__ */ (0,
|
|
16949
|
+
index < selectedOptions.length - 1 && /* @__PURE__ */ (0, import_jsx_runtime71.jsx)("span", { children: "," })
|
|
17009
16950
|
] }, opt.id)) }) : placeholder ?? translation("clickToSelect") }),
|
|
17010
|
-
!hideExpansionIcon && /* @__PURE__ */ (0,
|
|
16951
|
+
!hideExpansionIcon && /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(ExpansionIcon, { isExpanded: context.isOpen })
|
|
17011
16952
|
]
|
|
17012
16953
|
}
|
|
17013
16954
|
);
|
|
17014
16955
|
});
|
|
17015
16956
|
|
|
17016
16957
|
// src/components/user-interaction/MultiSelect/MultiSelectContent.tsx
|
|
17017
|
-
var
|
|
16958
|
+
var import_react84 = require("react");
|
|
17018
16959
|
var import_clsx26 = __toESM(require("clsx"));
|
|
17019
|
-
var
|
|
17020
|
-
var MultiSelectContent = (0,
|
|
16960
|
+
var import_jsx_runtime72 = require("react/jsx-runtime");
|
|
16961
|
+
var MultiSelectContent = (0, import_react84.forwardRef)(function MultiSelectContent2({ id, options, showSearch: showSearchOverride, searchInputProps, ...props }, ref) {
|
|
17021
16962
|
const translation = useHightideTranslation();
|
|
17022
|
-
const innerRef = (0,
|
|
17023
|
-
const searchInputRef = (0,
|
|
17024
|
-
(0,
|
|
16963
|
+
const innerRef = (0, import_react84.useRef)(null);
|
|
16964
|
+
const searchInputRef = (0, import_react84.useRef)(null);
|
|
16965
|
+
(0, import_react84.useImperativeHandle)(ref, () => innerRef.current);
|
|
17025
16966
|
const context = useMultiSelectContext();
|
|
17026
16967
|
const { config, highlightNext, highlightPrevious, highlightFirst, highlightLast, highlightedId, handleTypeaheadKey, toggleSelection } = context;
|
|
17027
16968
|
const { setIds } = config;
|
|
17028
|
-
(0,
|
|
16969
|
+
(0, import_react84.useEffect)(() => {
|
|
17029
16970
|
if (id) setIds((prev) => ({ ...prev, content: id }));
|
|
17030
16971
|
}, [id, setIds]);
|
|
17031
16972
|
const showSearch = showSearchOverride ?? context.search.hasSearch;
|
|
17032
16973
|
const listboxAriaLabel = showSearch ? translation("searchResults") : void 0;
|
|
17033
|
-
const keyHandler = (0,
|
|
16974
|
+
const keyHandler = (0, import_react84.useCallback)(
|
|
17034
16975
|
(event) => {
|
|
17035
16976
|
switch (event.key) {
|
|
17036
16977
|
case "ArrowDown":
|
|
@@ -17067,7 +17008,7 @@ var MultiSelectContent = (0, import_react85.forwardRef)(function MultiSelectCont
|
|
|
17067
17008
|
},
|
|
17068
17009
|
[showSearch, handleTypeaheadKey, toggleSelection, highlightedId, highlightNext, highlightPrevious, highlightFirst, highlightLast]
|
|
17069
17010
|
);
|
|
17070
|
-
return /* @__PURE__ */ (0,
|
|
17011
|
+
return /* @__PURE__ */ (0, import_jsx_runtime72.jsxs)(
|
|
17071
17012
|
PopUp,
|
|
17072
17013
|
{
|
|
17073
17014
|
...props,
|
|
@@ -17083,7 +17024,7 @@ var MultiSelectContent = (0, import_react85.forwardRef)(function MultiSelectCont
|
|
|
17083
17024
|
"aria-labelledby": context.config.ids.trigger,
|
|
17084
17025
|
className: (0, import_clsx26.default)("gap-y-1", props.className),
|
|
17085
17026
|
children: [
|
|
17086
|
-
showSearch && /* @__PURE__ */ (0,
|
|
17027
|
+
showSearch && /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(
|
|
17087
17028
|
Input,
|
|
17088
17029
|
{
|
|
17089
17030
|
...searchInputProps,
|
|
@@ -17102,7 +17043,7 @@ var MultiSelectContent = (0, import_react85.forwardRef)(function MultiSelectCont
|
|
|
17102
17043
|
className: (0, import_clsx26.default)("mx-2 mt-2 shrink-0", searchInputProps?.className)
|
|
17103
17044
|
}
|
|
17104
17045
|
),
|
|
17105
|
-
/* @__PURE__ */ (0,
|
|
17046
|
+
/* @__PURE__ */ (0, import_jsx_runtime72.jsxs)(
|
|
17106
17047
|
"ul",
|
|
17107
17048
|
{
|
|
17108
17049
|
ref: innerRef,
|
|
@@ -17117,7 +17058,7 @@ var MultiSelectContent = (0, import_react85.forwardRef)(function MultiSelectCont
|
|
|
17117
17058
|
className: (0, import_clsx26.default)("flex-col-1 p-2 overflow-auto"),
|
|
17118
17059
|
children: [
|
|
17119
17060
|
props.children,
|
|
17120
|
-
/* @__PURE__ */ (0,
|
|
17061
|
+
/* @__PURE__ */ (0, import_jsx_runtime72.jsx)(Visibility, { isVisible: showSearch, children: /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(
|
|
17121
17062
|
"li",
|
|
17122
17063
|
{
|
|
17123
17064
|
role: "option",
|
|
@@ -17143,12 +17084,12 @@ var MultiSelectContent = (0, import_react85.forwardRef)(function MultiSelectCont
|
|
|
17143
17084
|
});
|
|
17144
17085
|
|
|
17145
17086
|
// src/components/user-interaction/MultiSelect/MultiSelect.tsx
|
|
17146
|
-
var
|
|
17147
|
-
var MultiSelect = (0,
|
|
17087
|
+
var import_jsx_runtime73 = require("react/jsx-runtime");
|
|
17088
|
+
var MultiSelect = (0, import_react85.forwardRef)(
|
|
17148
17089
|
function MultiSelect2({ children, contentPanelProps, buttonProps, ...props }, ref) {
|
|
17149
|
-
return /* @__PURE__ */ (0,
|
|
17150
|
-
/* @__PURE__ */ (0,
|
|
17151
|
-
/* @__PURE__ */ (0,
|
|
17090
|
+
return /* @__PURE__ */ (0, import_jsx_runtime73.jsxs)(MultiSelectRoot, { ...props, children: [
|
|
17091
|
+
/* @__PURE__ */ (0, import_jsx_runtime73.jsx)(MultiSelectButton, { ref, ...buttonProps }),
|
|
17092
|
+
/* @__PURE__ */ (0, import_jsx_runtime73.jsx)(MultiSelectContent, { ...contentPanelProps, children })
|
|
17152
17093
|
] });
|
|
17153
17094
|
}
|
|
17154
17095
|
);
|
|
@@ -17157,41 +17098,51 @@ var MultiSelect = (0, import_react86.forwardRef)(
|
|
|
17157
17098
|
var import_clsx27 = __toESM(require("clsx"));
|
|
17158
17099
|
|
|
17159
17100
|
// src/components/user-interaction/data/FilterOperatorLabel.tsx
|
|
17160
|
-
var
|
|
17101
|
+
var import_jsx_runtime74 = require("react/jsx-runtime");
|
|
17161
17102
|
var FilterOperatorLabel = ({ operator }) => {
|
|
17162
17103
|
const translation = useHightideTranslation();
|
|
17163
17104
|
const { icon, translationKey } = FilterOperatorUtils.getInfo(operator);
|
|
17164
17105
|
const label = typeof translationKey === "string" ? translation(translationKey) : translationKey;
|
|
17165
|
-
return /* @__PURE__ */ (0,
|
|
17106
|
+
return /* @__PURE__ */ (0, import_jsx_runtime74.jsxs)("div", { className: "flex-row-1 items-center gap-2", children: [
|
|
17166
17107
|
icon,
|
|
17167
17108
|
label
|
|
17168
17109
|
] });
|
|
17169
17110
|
};
|
|
17170
17111
|
|
|
17171
17112
|
// src/components/user-interaction/data/FilterPopUp.tsx
|
|
17172
|
-
var
|
|
17173
|
-
var FilterBasePopUp = (0,
|
|
17113
|
+
var import_jsx_runtime75 = require("react/jsx-runtime");
|
|
17114
|
+
var FilterBasePopUp = (0, import_react86.forwardRef)(function FilterBasePopUp2({
|
|
17174
17115
|
children,
|
|
17175
17116
|
name,
|
|
17176
17117
|
operator,
|
|
17177
17118
|
onOperatorChange,
|
|
17178
17119
|
onRemove,
|
|
17179
17120
|
allowedOperators,
|
|
17121
|
+
operatorOverrides,
|
|
17180
17122
|
noParameterRequired = false,
|
|
17181
17123
|
...props
|
|
17182
17124
|
}, ref) {
|
|
17183
17125
|
const translation = useHightideTranslation();
|
|
17184
|
-
|
|
17126
|
+
const operators = (0, import_react86.useMemo)(() => {
|
|
17127
|
+
if (!operatorOverrides || operatorOverrides.length === 0) return allowedOperators;
|
|
17128
|
+
return allowedOperators.filter((op) => operatorOverrides.includes(op));
|
|
17129
|
+
}, [allowedOperators, operatorOverrides]);
|
|
17130
|
+
(0, import_react86.useEffect)(() => {
|
|
17131
|
+
if (operators.length === 0) {
|
|
17132
|
+
onRemove();
|
|
17133
|
+
}
|
|
17134
|
+
}, [operators, onRemove]);
|
|
17135
|
+
return /* @__PURE__ */ (0, import_jsx_runtime75.jsxs)(
|
|
17185
17136
|
PopUp,
|
|
17186
17137
|
{
|
|
17187
17138
|
ref,
|
|
17188
17139
|
...props,
|
|
17189
17140
|
className: (0, import_clsx27.default)("flex-col-3 p-3 relative min-w-64", props.className),
|
|
17190
17141
|
children: [
|
|
17191
|
-
/* @__PURE__ */ (0,
|
|
17192
|
-
/* @__PURE__ */ (0,
|
|
17193
|
-
/* @__PURE__ */ (0,
|
|
17194
|
-
/* @__PURE__ */ (0,
|
|
17142
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsxs)("div", { className: "flex-row-4 justify-between w-full", children: [
|
|
17143
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsxs)("div", { className: "flex-row-0.5 items-center", children: [
|
|
17144
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)("span", { className: "typography-label-sm text-description", children: name ?? translation("filter") }),
|
|
17145
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
|
|
17195
17146
|
Select,
|
|
17196
17147
|
{
|
|
17197
17148
|
value: operator,
|
|
@@ -17202,12 +17153,12 @@ var FilterBasePopUp = (0, import_react87.forwardRef)(function FilterBasePopUp2({
|
|
|
17202
17153
|
"selectedDisplay": (option) => option ? translation(FilterOperatorUtils.getInfo(option.value).translationKey) : ""
|
|
17203
17154
|
},
|
|
17204
17155
|
iconAppearance: "right",
|
|
17205
|
-
children:
|
|
17156
|
+
children: operators.map((op) => /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(SelectOption, { value: op, label: translation(FilterOperatorUtils.getInfo(op).translationKey), children: /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(FilterOperatorLabel, { operator: op }) }, op))
|
|
17206
17157
|
}
|
|
17207
17158
|
)
|
|
17208
17159
|
] }),
|
|
17209
|
-
/* @__PURE__ */ (0,
|
|
17210
|
-
/* @__PURE__ */ (0,
|
|
17160
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsxs)("div", { className: "flex-row-0 items-center", children: [
|
|
17161
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
|
|
17211
17162
|
IconButton,
|
|
17212
17163
|
{
|
|
17213
17164
|
tooltip: translation("removeFilter"),
|
|
@@ -17215,29 +17166,29 @@ var FilterBasePopUp = (0, import_react87.forwardRef)(function FilterBasePopUp2({
|
|
|
17215
17166
|
color: "negative",
|
|
17216
17167
|
coloringStyle: "text",
|
|
17217
17168
|
size: "sm",
|
|
17218
|
-
children: /* @__PURE__ */ (0,
|
|
17169
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(import_lucide_react19.TrashIcon, { className: "size-4" })
|
|
17219
17170
|
}
|
|
17220
17171
|
),
|
|
17221
|
-
/* @__PURE__ */ (0,
|
|
17172
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
|
|
17222
17173
|
IconButton,
|
|
17223
17174
|
{
|
|
17224
|
-
tooltip: translation("
|
|
17175
|
+
tooltip: translation("done"),
|
|
17225
17176
|
onClick: props.onClose,
|
|
17226
17177
|
color: "neutral",
|
|
17227
17178
|
coloringStyle: "text",
|
|
17228
17179
|
size: "sm",
|
|
17229
|
-
children: /* @__PURE__ */ (0,
|
|
17180
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(import_lucide_react19.Check, { className: "size-4" })
|
|
17230
17181
|
}
|
|
17231
17182
|
)
|
|
17232
17183
|
] })
|
|
17233
17184
|
] }),
|
|
17234
17185
|
children,
|
|
17235
|
-
/* @__PURE__ */ (0,
|
|
17186
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)(Visibility, { isVisible: noParameterRequired, children: /* @__PURE__ */ (0, import_jsx_runtime75.jsx)("div", { className: "flex-row-0 items-center text-sm text-description h-element-sm", children: translation("noParameterRequired") }) })
|
|
17236
17187
|
]
|
|
17237
17188
|
}
|
|
17238
17189
|
);
|
|
17239
17190
|
});
|
|
17240
|
-
var TextFilterPopUp = (0,
|
|
17191
|
+
var TextFilterPopUp = (0, import_react86.forwardRef)(function TextFilterPopUp2({
|
|
17241
17192
|
name,
|
|
17242
17193
|
value,
|
|
17243
17194
|
onValueChange,
|
|
@@ -17245,12 +17196,12 @@ var TextFilterPopUp = (0, import_react87.forwardRef)(function TextFilterPopUp2({
|
|
|
17245
17196
|
...props
|
|
17246
17197
|
}, ref) {
|
|
17247
17198
|
const translation = useHightideTranslation();
|
|
17248
|
-
const id = (0,
|
|
17199
|
+
const id = (0, import_react86.useId)();
|
|
17249
17200
|
const ids = {
|
|
17250
17201
|
search: `text-filter-search-${id}`,
|
|
17251
17202
|
caseSensitive: `text-filter-case-sensitive-${id}`
|
|
17252
17203
|
};
|
|
17253
|
-
const operator = (0,
|
|
17204
|
+
const operator = (0, import_react86.useMemo)(() => {
|
|
17254
17205
|
const suggestion = value?.operator ?? "contains";
|
|
17255
17206
|
if (!FilterOperatorUtils.typeCheck.text(suggestion)) {
|
|
17256
17207
|
return "contains";
|
|
@@ -17259,7 +17210,7 @@ var TextFilterPopUp = (0, import_react87.forwardRef)(function TextFilterPopUp2({
|
|
|
17259
17210
|
}, [value]);
|
|
17260
17211
|
const parameter = value?.parameter ?? {};
|
|
17261
17212
|
const needsParameterInput = operator !== "isUndefined" && operator !== "isNotUndefined";
|
|
17262
|
-
return /* @__PURE__ */ (0,
|
|
17213
|
+
return /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
|
|
17263
17214
|
FilterBasePopUp,
|
|
17264
17215
|
{
|
|
17265
17216
|
ref,
|
|
@@ -17270,48 +17221,29 @@ var TextFilterPopUp = (0, import_react87.forwardRef)(function TextFilterPopUp2({
|
|
|
17270
17221
|
onRemove,
|
|
17271
17222
|
allowedOperators: FilterOperatorUtils.operatorsByCategory.text,
|
|
17272
17223
|
noParameterRequired: !needsParameterInput,
|
|
17273
|
-
children: /* @__PURE__ */ (0,
|
|
17274
|
-
/* @__PURE__ */ (0,
|
|
17275
|
-
|
|
17276
|
-
|
|
17277
|
-
|
|
17278
|
-
|
|
17279
|
-
|
|
17280
|
-
|
|
17281
|
-
|
|
17282
|
-
onValueChange
|
|
17283
|
-
|
|
17284
|
-
|
|
17285
|
-
|
|
17286
|
-
|
|
17287
|
-
|
|
17288
|
-
|
|
17289
|
-
|
|
17290
|
-
|
|
17291
|
-
|
|
17292
|
-
] }),
|
|
17293
|
-
/* @__PURE__ */ (0, import_jsx_runtime76.jsxs)("div", { className: "flex-row-2 items-center mt-1", children: [
|
|
17294
|
-
/* @__PURE__ */ (0, import_jsx_runtime76.jsx)(
|
|
17295
|
-
Checkbox,
|
|
17296
|
-
{
|
|
17297
|
-
id: ids.caseSensitive,
|
|
17298
|
-
value: parameter.isCaseSensitive ?? false,
|
|
17299
|
-
onValueChange: (isCaseSensitive) => {
|
|
17300
|
-
onValueChange({
|
|
17301
|
-
dataType: "text",
|
|
17302
|
-
operator,
|
|
17303
|
-
parameter: { ...parameter, isCaseSensitive }
|
|
17304
|
-
});
|
|
17305
|
-
}
|
|
17306
|
-
}
|
|
17307
|
-
),
|
|
17308
|
-
/* @__PURE__ */ (0, import_jsx_runtime76.jsx)("label", { htmlFor: ids.caseSensitive, children: translation("caseSensitive") })
|
|
17309
|
-
] })
|
|
17310
|
-
] })
|
|
17224
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(Visibility, { isVisible: needsParameterInput, children: /* @__PURE__ */ (0, import_jsx_runtime75.jsxs)("div", { className: "flex-col-1", children: [
|
|
17225
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)("label", { htmlFor: ids.search, className: "typography-label-md", children: translation("search") }),
|
|
17226
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
|
|
17227
|
+
Input,
|
|
17228
|
+
{
|
|
17229
|
+
id: ids.search,
|
|
17230
|
+
value: parameter.stringValue ?? "",
|
|
17231
|
+
placeholder: translation("value"),
|
|
17232
|
+
onValueChange: (searchText) => {
|
|
17233
|
+
onValueChange({
|
|
17234
|
+
dataType: "text",
|
|
17235
|
+
operator,
|
|
17236
|
+
parameter: { ...parameter, stringValue: searchText }
|
|
17237
|
+
});
|
|
17238
|
+
},
|
|
17239
|
+
className: "min-w-64"
|
|
17240
|
+
}
|
|
17241
|
+
)
|
|
17242
|
+
] }) })
|
|
17311
17243
|
}
|
|
17312
17244
|
);
|
|
17313
17245
|
});
|
|
17314
|
-
var NumberFilterPopUp = (0,
|
|
17246
|
+
var NumberFilterPopUp = (0, import_react86.forwardRef)(function NumberFilterPopUp2({
|
|
17315
17247
|
name,
|
|
17316
17248
|
value,
|
|
17317
17249
|
onValueChange,
|
|
@@ -17319,13 +17251,13 @@ var NumberFilterPopUp = (0, import_react87.forwardRef)(function NumberFilterPopU
|
|
|
17319
17251
|
...props
|
|
17320
17252
|
}, ref) {
|
|
17321
17253
|
const translation = useHightideTranslation();
|
|
17322
|
-
const id = (0,
|
|
17254
|
+
const id = (0, import_react86.useId)();
|
|
17323
17255
|
const ids = {
|
|
17324
17256
|
min: `number-filter-min-${id}`,
|
|
17325
17257
|
max: `number-filter-max-${id}`,
|
|
17326
17258
|
compareValue: `number-filter-compare-value-${id}`
|
|
17327
17259
|
};
|
|
17328
|
-
const operator = (0,
|
|
17260
|
+
const operator = (0, import_react86.useMemo)(() => {
|
|
17329
17261
|
const suggestion = value?.operator ?? "between";
|
|
17330
17262
|
if (!FilterOperatorUtils.typeCheck.number(suggestion)) {
|
|
17331
17263
|
return "between";
|
|
@@ -17335,7 +17267,7 @@ var NumberFilterPopUp = (0, import_react87.forwardRef)(function NumberFilterPopU
|
|
|
17335
17267
|
const parameter = value?.parameter ?? {};
|
|
17336
17268
|
const needsRangeInput = operator === "between" || operator === "notBetween";
|
|
17337
17269
|
const needsParameterInput = operator !== "isUndefined" && operator !== "isNotUndefined";
|
|
17338
|
-
return /* @__PURE__ */ (0,
|
|
17270
|
+
return /* @__PURE__ */ (0, import_jsx_runtime75.jsxs)(
|
|
17339
17271
|
FilterBasePopUp,
|
|
17340
17272
|
{
|
|
17341
17273
|
ref,
|
|
@@ -17349,14 +17281,14 @@ var NumberFilterPopUp = (0, import_react87.forwardRef)(function NumberFilterPopU
|
|
|
17349
17281
|
allowedOperators: FilterOperatorUtils.operatorsByCategory.number,
|
|
17350
17282
|
noParameterRequired: !needsParameterInput,
|
|
17351
17283
|
children: [
|
|
17352
|
-
/* @__PURE__ */ (0,
|
|
17353
|
-
/* @__PURE__ */ (0,
|
|
17354
|
-
/* @__PURE__ */ (0,
|
|
17355
|
-
/* @__PURE__ */ (0,
|
|
17284
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsxs)(Visibility, { isVisible: needsRangeInput, children: [
|
|
17285
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsxs)("div", { className: "flex-col-1", children: [
|
|
17286
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)("label", { htmlFor: ids.min, className: "typography-label-md", children: translation("min") }),
|
|
17287
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
|
|
17356
17288
|
Input,
|
|
17357
17289
|
{
|
|
17358
17290
|
id: ids.min,
|
|
17359
|
-
value: parameter.
|
|
17291
|
+
value: parameter.numberMin?.toString() ?? "",
|
|
17360
17292
|
type: "number",
|
|
17361
17293
|
placeholder: "0",
|
|
17362
17294
|
onValueChange: (text) => {
|
|
@@ -17364,20 +17296,20 @@ var NumberFilterPopUp = (0, import_react87.forwardRef)(function NumberFilterPopU
|
|
|
17364
17296
|
onValueChange({
|
|
17365
17297
|
dataType: "number",
|
|
17366
17298
|
operator,
|
|
17367
|
-
parameter: { ...parameter,
|
|
17299
|
+
parameter: { ...parameter, numberMin: isNaN(num) ? void 0 : num }
|
|
17368
17300
|
});
|
|
17369
17301
|
},
|
|
17370
17302
|
className: "min-w-64"
|
|
17371
17303
|
}
|
|
17372
17304
|
)
|
|
17373
17305
|
] }),
|
|
17374
|
-
/* @__PURE__ */ (0,
|
|
17375
|
-
/* @__PURE__ */ (0,
|
|
17376
|
-
/* @__PURE__ */ (0,
|
|
17306
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsxs)("div", { className: "flex-col-1", children: [
|
|
17307
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)("label", { htmlFor: ids.max, className: "typography-label-md", children: translation("max") }),
|
|
17308
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
|
|
17377
17309
|
Input,
|
|
17378
17310
|
{
|
|
17379
17311
|
id: ids.max,
|
|
17380
|
-
value: parameter.
|
|
17312
|
+
value: parameter.numberMax?.toString() ?? "",
|
|
17381
17313
|
type: "number",
|
|
17382
17314
|
placeholder: "1",
|
|
17383
17315
|
onValueChange: (text) => {
|
|
@@ -17385,7 +17317,7 @@ var NumberFilterPopUp = (0, import_react87.forwardRef)(function NumberFilterPopU
|
|
|
17385
17317
|
onValueChange({
|
|
17386
17318
|
dataType: "number",
|
|
17387
17319
|
operator,
|
|
17388
|
-
parameter: { ...parameter,
|
|
17320
|
+
parameter: { ...parameter, numberMax: isNaN(num) ? void 0 : num }
|
|
17389
17321
|
});
|
|
17390
17322
|
},
|
|
17391
17323
|
className: "min-w-64"
|
|
@@ -17393,10 +17325,10 @@ var NumberFilterPopUp = (0, import_react87.forwardRef)(function NumberFilterPopU
|
|
|
17393
17325
|
)
|
|
17394
17326
|
] })
|
|
17395
17327
|
] }),
|
|
17396
|
-
/* @__PURE__ */ (0,
|
|
17328
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)(Visibility, { isVisible: !needsRangeInput && needsParameterInput, children: /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
|
|
17397
17329
|
Input,
|
|
17398
17330
|
{
|
|
17399
|
-
value: parameter.
|
|
17331
|
+
value: parameter.numberValue?.toString() ?? "",
|
|
17400
17332
|
type: "number",
|
|
17401
17333
|
placeholder: "0",
|
|
17402
17334
|
onValueChange: (text) => {
|
|
@@ -17404,7 +17336,7 @@ var NumberFilterPopUp = (0, import_react87.forwardRef)(function NumberFilterPopU
|
|
|
17404
17336
|
onValueChange({
|
|
17405
17337
|
dataType: "number",
|
|
17406
17338
|
operator,
|
|
17407
|
-
parameter: { ...parameter,
|
|
17339
|
+
parameter: { ...parameter, numberValue: isNaN(num) ? void 0 : num }
|
|
17408
17340
|
});
|
|
17409
17341
|
},
|
|
17410
17342
|
className: "min-w-64"
|
|
@@ -17414,7 +17346,7 @@ var NumberFilterPopUp = (0, import_react87.forwardRef)(function NumberFilterPopU
|
|
|
17414
17346
|
}
|
|
17415
17347
|
);
|
|
17416
17348
|
});
|
|
17417
|
-
var DateFilterPopUp = (0,
|
|
17349
|
+
var DateFilterPopUp = (0, import_react86.forwardRef)(function DateFilterPopUp2({
|
|
17418
17350
|
name,
|
|
17419
17351
|
value,
|
|
17420
17352
|
onValueChange,
|
|
@@ -17422,13 +17354,13 @@ var DateFilterPopUp = (0, import_react87.forwardRef)(function DateFilterPopUp2({
|
|
|
17422
17354
|
...props
|
|
17423
17355
|
}, ref) {
|
|
17424
17356
|
const translation = useHightideTranslation();
|
|
17425
|
-
const id = (0,
|
|
17357
|
+
const id = (0, import_react86.useId)();
|
|
17426
17358
|
const ids = {
|
|
17427
17359
|
startDate: `date-filter-start-date-${id}`,
|
|
17428
17360
|
endDate: `date-filter-end-date-${id}`,
|
|
17429
17361
|
compareDate: `date-filter-compare-date-${id}`
|
|
17430
17362
|
};
|
|
17431
|
-
const operator = (0,
|
|
17363
|
+
const operator = (0, import_react86.useMemo)(() => {
|
|
17432
17364
|
const suggestion = value?.operator ?? "between";
|
|
17433
17365
|
if (!FilterOperatorUtils.typeCheck.date(suggestion)) {
|
|
17434
17366
|
return "between";
|
|
@@ -17436,11 +17368,11 @@ var DateFilterPopUp = (0, import_react87.forwardRef)(function DateFilterPopUp2({
|
|
|
17436
17368
|
return suggestion;
|
|
17437
17369
|
}, [value]);
|
|
17438
17370
|
const parameter = value?.parameter ?? {};
|
|
17439
|
-
const [temporaryMinDateValue, setTemporaryMinDateValue] = (0,
|
|
17440
|
-
const [temporaryMaxDateValue, setTemporaryMaxDateValue] = (0,
|
|
17371
|
+
const [temporaryMinDateValue, setTemporaryMinDateValue] = (0, import_react86.useState)(null);
|
|
17372
|
+
const [temporaryMaxDateValue, setTemporaryMaxDateValue] = (0, import_react86.useState)(null);
|
|
17441
17373
|
const needsRangeInput = operator === "between" || operator === "notBetween";
|
|
17442
17374
|
const needsParameterInput = operator !== "isUndefined" && operator !== "isNotUndefined";
|
|
17443
|
-
return /* @__PURE__ */ (0,
|
|
17375
|
+
return /* @__PURE__ */ (0, import_jsx_runtime75.jsxs)(
|
|
17444
17376
|
FilterBasePopUp,
|
|
17445
17377
|
{
|
|
17446
17378
|
ref,
|
|
@@ -17452,36 +17384,36 @@ var DateFilterPopUp = (0, import_react87.forwardRef)(function DateFilterPopUp2({
|
|
|
17452
17384
|
allowedOperators: FilterOperatorUtils.operatorsByCategory.date,
|
|
17453
17385
|
noParameterRequired: !needsParameterInput,
|
|
17454
17386
|
children: [
|
|
17455
|
-
/* @__PURE__ */ (0,
|
|
17456
|
-
/* @__PURE__ */ (0,
|
|
17457
|
-
/* @__PURE__ */ (0,
|
|
17458
|
-
/* @__PURE__ */ (0,
|
|
17387
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsxs)(Visibility, { isVisible: needsRangeInput, children: [
|
|
17388
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsxs)("div", { className: "flex-col-1", children: [
|
|
17389
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)("label", { htmlFor: ids.startDate, className: "typography-label-md", children: translation("startDate") }),
|
|
17390
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
|
|
17459
17391
|
DateTimeInput,
|
|
17460
17392
|
{
|
|
17461
17393
|
id: ids.startDate,
|
|
17462
|
-
value: temporaryMinDateValue ?? parameter.
|
|
17394
|
+
value: temporaryMinDateValue ?? parameter.dateMin ?? null,
|
|
17463
17395
|
onValueChange: setTemporaryMinDateValue,
|
|
17464
17396
|
onEditComplete: (dateValue) => {
|
|
17465
|
-
if (dateValue && parameter.
|
|
17466
|
-
if (!parameter.
|
|
17397
|
+
if (dateValue && parameter.dateMax && dateValue > parameter.dateMax) {
|
|
17398
|
+
if (!parameter.dateMin) {
|
|
17467
17399
|
onValueChange({
|
|
17468
17400
|
dataType: "date",
|
|
17469
17401
|
operator,
|
|
17470
|
-
parameter: { ...parameter,
|
|
17402
|
+
parameter: { ...parameter, dateMin: parameter.dateMax, dateMax: dateValue }
|
|
17471
17403
|
});
|
|
17472
17404
|
} else {
|
|
17473
|
-
const diff = parameter.
|
|
17405
|
+
const diff = parameter.dateMax.getTime() - parameter.dateMin.getTime();
|
|
17474
17406
|
onValueChange({
|
|
17475
17407
|
dataType: "date",
|
|
17476
17408
|
operator,
|
|
17477
|
-
parameter: { ...parameter,
|
|
17409
|
+
parameter: { ...parameter, dateMin: dateValue, dateMax: new Date(dateValue.getTime() + diff) }
|
|
17478
17410
|
});
|
|
17479
17411
|
}
|
|
17480
17412
|
} else {
|
|
17481
17413
|
onValueChange({
|
|
17482
17414
|
dataType: "date",
|
|
17483
17415
|
operator,
|
|
17484
|
-
parameter: { ...parameter,
|
|
17416
|
+
parameter: { ...parameter, dateMin: dateValue }
|
|
17485
17417
|
});
|
|
17486
17418
|
}
|
|
17487
17419
|
setTemporaryMinDateValue(null);
|
|
@@ -17492,35 +17424,35 @@ var DateFilterPopUp = (0, import_react87.forwardRef)(function DateFilterPopUp2({
|
|
|
17492
17424
|
}
|
|
17493
17425
|
)
|
|
17494
17426
|
] }),
|
|
17495
|
-
/* @__PURE__ */ (0,
|
|
17496
|
-
/* @__PURE__ */ (0,
|
|
17497
|
-
/* @__PURE__ */ (0,
|
|
17427
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsxs)("div", { className: "flex-col-1", children: [
|
|
17428
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)("label", { htmlFor: ids.endDate, className: "typography-label-md", children: translation("endDate") }),
|
|
17429
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
|
|
17498
17430
|
DateTimeInput,
|
|
17499
17431
|
{
|
|
17500
17432
|
id: ids.endDate,
|
|
17501
|
-
value: temporaryMaxDateValue ?? parameter.
|
|
17433
|
+
value: temporaryMaxDateValue ?? parameter.dateMax ?? null,
|
|
17502
17434
|
onValueChange: setTemporaryMaxDateValue,
|
|
17503
17435
|
onEditComplete: (dateValue) => {
|
|
17504
|
-
if (dateValue && parameter.
|
|
17505
|
-
if (!parameter.
|
|
17436
|
+
if (dateValue && parameter.dateMin && dateValue < parameter.dateMin) {
|
|
17437
|
+
if (!parameter.dateMax) {
|
|
17506
17438
|
onValueChange({
|
|
17507
17439
|
dataType: "date",
|
|
17508
17440
|
operator,
|
|
17509
|
-
parameter: { ...parameter,
|
|
17441
|
+
parameter: { ...parameter, dateMin: dateValue, dateMax: parameter.dateMin }
|
|
17510
17442
|
});
|
|
17511
17443
|
} else {
|
|
17512
|
-
const diff = parameter.
|
|
17444
|
+
const diff = parameter.dateMax.getTime() - parameter.dateMin.getTime();
|
|
17513
17445
|
onValueChange({
|
|
17514
17446
|
dataType: "date",
|
|
17515
17447
|
operator,
|
|
17516
|
-
parameter: { ...parameter,
|
|
17448
|
+
parameter: { ...parameter, dateMin: new Date(dateValue.getTime() - diff), dateMax: dateValue }
|
|
17517
17449
|
});
|
|
17518
17450
|
}
|
|
17519
17451
|
} else {
|
|
17520
17452
|
onValueChange({
|
|
17521
17453
|
dataType: "date",
|
|
17522
17454
|
operator,
|
|
17523
|
-
parameter: { ...parameter,
|
|
17455
|
+
parameter: { ...parameter, dateMax: dateValue }
|
|
17524
17456
|
});
|
|
17525
17457
|
}
|
|
17526
17458
|
setTemporaryMaxDateValue(null);
|
|
@@ -17532,17 +17464,17 @@ var DateFilterPopUp = (0, import_react87.forwardRef)(function DateFilterPopUp2({
|
|
|
17532
17464
|
)
|
|
17533
17465
|
] })
|
|
17534
17466
|
] }),
|
|
17535
|
-
/* @__PURE__ */ (0,
|
|
17536
|
-
/* @__PURE__ */ (0,
|
|
17537
|
-
/* @__PURE__ */ (0,
|
|
17467
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsxs)(Visibility, { isVisible: !needsRangeInput && needsParameterInput, children: [
|
|
17468
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)("label", { htmlFor: ids.compareDate, className: "typography-label-md", children: translation("date") }),
|
|
17469
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
|
|
17538
17470
|
DateTimeInput,
|
|
17539
17471
|
{
|
|
17540
17472
|
id: ids.compareDate,
|
|
17541
|
-
value: parameter.
|
|
17473
|
+
value: parameter.dateValue ?? null,
|
|
17542
17474
|
onValueChange: (compareDate) => {
|
|
17543
17475
|
onValueChange({
|
|
17544
17476
|
...value,
|
|
17545
|
-
parameter: { ...parameter, compareDate }
|
|
17477
|
+
parameter: { ...parameter, dateValue: compareDate }
|
|
17546
17478
|
});
|
|
17547
17479
|
},
|
|
17548
17480
|
allowRemove: true,
|
|
@@ -17551,12 +17483,12 @@ var DateFilterPopUp = (0, import_react87.forwardRef)(function DateFilterPopUp2({
|
|
|
17551
17483
|
}
|
|
17552
17484
|
)
|
|
17553
17485
|
] }),
|
|
17554
|
-
/* @__PURE__ */ (0,
|
|
17486
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)(Visibility, { isVisible: !needsParameterInput, children: /* @__PURE__ */ (0, import_jsx_runtime75.jsx)("span", { className: "text-sm text-description h-10", children: translation("noParameterRequired") }) })
|
|
17555
17487
|
]
|
|
17556
17488
|
}
|
|
17557
17489
|
);
|
|
17558
17490
|
});
|
|
17559
|
-
var DatetimeFilterPopUp = (0,
|
|
17491
|
+
var DatetimeFilterPopUp = (0, import_react86.forwardRef)(function DatetimeFilterPopUp2({
|
|
17560
17492
|
name,
|
|
17561
17493
|
value,
|
|
17562
17494
|
onValueChange,
|
|
@@ -17564,13 +17496,13 @@ var DatetimeFilterPopUp = (0, import_react87.forwardRef)(function DatetimeFilter
|
|
|
17564
17496
|
...props
|
|
17565
17497
|
}, ref) {
|
|
17566
17498
|
const translation = useHightideTranslation();
|
|
17567
|
-
const id = (0,
|
|
17499
|
+
const id = (0, import_react86.useId)();
|
|
17568
17500
|
const ids = {
|
|
17569
17501
|
startDate: `datetime-filter-start-date-${id}`,
|
|
17570
17502
|
endDate: `datetime-filter-end-date-${id}`,
|
|
17571
17503
|
compareDate: `datetime-filter-compare-date-${id}`
|
|
17572
17504
|
};
|
|
17573
|
-
const operator = (0,
|
|
17505
|
+
const operator = (0, import_react86.useMemo)(() => {
|
|
17574
17506
|
const suggestion = value?.operator ?? "between";
|
|
17575
17507
|
if (!FilterOperatorUtils.typeCheck.datetime(suggestion)) {
|
|
17576
17508
|
return "between";
|
|
@@ -17578,11 +17510,11 @@ var DatetimeFilterPopUp = (0, import_react87.forwardRef)(function DatetimeFilter
|
|
|
17578
17510
|
return suggestion;
|
|
17579
17511
|
}, [value]);
|
|
17580
17512
|
const parameter = value?.parameter ?? {};
|
|
17581
|
-
const [temporaryMinDateValue, setTemporaryMinDateValue] = (0,
|
|
17582
|
-
const [temporaryMaxDateValue, setTemporaryMaxDateValue] = (0,
|
|
17513
|
+
const [temporaryMinDateValue, setTemporaryMinDateValue] = (0, import_react86.useState)(null);
|
|
17514
|
+
const [temporaryMaxDateValue, setTemporaryMaxDateValue] = (0, import_react86.useState)(null);
|
|
17583
17515
|
const needsRangeInput = operator === "between" || operator === "notBetween";
|
|
17584
17516
|
const needsParameterInput = operator !== "isUndefined" && operator !== "isNotUndefined";
|
|
17585
|
-
return /* @__PURE__ */ (0,
|
|
17517
|
+
return /* @__PURE__ */ (0, import_jsx_runtime75.jsxs)(
|
|
17586
17518
|
FilterBasePopUp,
|
|
17587
17519
|
{
|
|
17588
17520
|
ref,
|
|
@@ -17593,37 +17525,37 @@ var DatetimeFilterPopUp = (0, import_react87.forwardRef)(function DatetimeFilter
|
|
|
17593
17525
|
onRemove,
|
|
17594
17526
|
allowedOperators: FilterOperatorUtils.operatorsByCategory.dateTime,
|
|
17595
17527
|
children: [
|
|
17596
|
-
/* @__PURE__ */ (0,
|
|
17597
|
-
/* @__PURE__ */ (0,
|
|
17598
|
-
/* @__PURE__ */ (0,
|
|
17599
|
-
/* @__PURE__ */ (0,
|
|
17528
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)("span", { className: "typography-label-lg font-semibold", children: translation("parameter") }),
|
|
17529
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)(Visibility, { isVisible: needsRangeInput, children: /* @__PURE__ */ (0, import_jsx_runtime75.jsxs)("div", { className: "flex-col-2 gap-2", children: [
|
|
17530
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)("label", { htmlFor: ids.startDate, className: "typography-label-md", children: translation("startDate") }),
|
|
17531
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
|
|
17600
17532
|
DateTimeInput,
|
|
17601
17533
|
{
|
|
17602
17534
|
id: ids.startDate,
|
|
17603
17535
|
mode: "dateTime",
|
|
17604
|
-
value: temporaryMinDateValue ?? parameter.
|
|
17536
|
+
value: temporaryMinDateValue ?? parameter.dateMin ?? null,
|
|
17605
17537
|
onValueChange: setTemporaryMinDateValue,
|
|
17606
17538
|
onEditComplete: (dateValue) => {
|
|
17607
|
-
if (dateValue && parameter.
|
|
17608
|
-
if (!parameter.
|
|
17539
|
+
if (dateValue && parameter.dateMax && dateValue > parameter.dateMax) {
|
|
17540
|
+
if (!parameter.dateMin) {
|
|
17609
17541
|
onValueChange({
|
|
17610
17542
|
dataType: "dateTime",
|
|
17611
17543
|
operator,
|
|
17612
|
-
parameter: { ...parameter,
|
|
17544
|
+
parameter: { ...parameter, dateMin: parameter.dateMax, dateMax: dateValue }
|
|
17613
17545
|
});
|
|
17614
17546
|
} else {
|
|
17615
|
-
const diff = parameter.
|
|
17547
|
+
const diff = parameter.dateMax.getTime() - parameter.dateMin.getTime();
|
|
17616
17548
|
onValueChange({
|
|
17617
17549
|
dataType: "dateTime",
|
|
17618
17550
|
operator,
|
|
17619
|
-
parameter: { ...parameter,
|
|
17551
|
+
parameter: { ...parameter, dateMin: dateValue, dateMax: new Date(dateValue.getTime() + diff) }
|
|
17620
17552
|
});
|
|
17621
17553
|
}
|
|
17622
17554
|
} else {
|
|
17623
17555
|
onValueChange({
|
|
17624
17556
|
dataType: "dateTime",
|
|
17625
17557
|
operator,
|
|
17626
|
-
parameter: { ...parameter,
|
|
17558
|
+
parameter: { ...parameter, dateMin: dateValue }
|
|
17627
17559
|
});
|
|
17628
17560
|
}
|
|
17629
17561
|
setTemporaryMinDateValue(null);
|
|
@@ -17633,35 +17565,35 @@ var DatetimeFilterPopUp = (0, import_react87.forwardRef)(function DatetimeFilter
|
|
|
17633
17565
|
className: "min-w-64"
|
|
17634
17566
|
}
|
|
17635
17567
|
),
|
|
17636
|
-
/* @__PURE__ */ (0,
|
|
17637
|
-
/* @__PURE__ */ (0,
|
|
17568
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)("label", { htmlFor: ids.endDate, className: "typography-label-md", children: translation("endDate") }),
|
|
17569
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
|
|
17638
17570
|
DateTimeInput,
|
|
17639
17571
|
{
|
|
17640
17572
|
id: ids.endDate,
|
|
17641
17573
|
mode: "dateTime",
|
|
17642
|
-
value: temporaryMaxDateValue ?? parameter.
|
|
17574
|
+
value: temporaryMaxDateValue ?? parameter.dateMax ?? null,
|
|
17643
17575
|
onValueChange: setTemporaryMaxDateValue,
|
|
17644
17576
|
onEditComplete: (dateValue) => {
|
|
17645
|
-
if (dateValue && parameter.
|
|
17646
|
-
if (!parameter.
|
|
17577
|
+
if (dateValue && parameter.dateMin && dateValue < parameter.dateMin) {
|
|
17578
|
+
if (!parameter.dateMax) {
|
|
17647
17579
|
onValueChange({
|
|
17648
17580
|
dataType: "dateTime",
|
|
17649
17581
|
operator,
|
|
17650
|
-
parameter: { ...parameter,
|
|
17582
|
+
parameter: { ...parameter, dateMin: dateValue, dateMax: parameter.dateMin }
|
|
17651
17583
|
});
|
|
17652
17584
|
} else {
|
|
17653
|
-
const diff = parameter.
|
|
17585
|
+
const diff = parameter.dateMax.getTime() - parameter.dateMin.getTime();
|
|
17654
17586
|
onValueChange({
|
|
17655
17587
|
dataType: "dateTime",
|
|
17656
17588
|
operator,
|
|
17657
|
-
parameter: { ...parameter,
|
|
17589
|
+
parameter: { ...parameter, dateMin: new Date(dateValue.getTime() - diff), dateMax: dateValue }
|
|
17658
17590
|
});
|
|
17659
17591
|
}
|
|
17660
17592
|
} else {
|
|
17661
17593
|
onValueChange({
|
|
17662
17594
|
dataType: "dateTime",
|
|
17663
17595
|
operator,
|
|
17664
|
-
parameter: { ...parameter,
|
|
17596
|
+
parameter: { ...parameter, dateMax: dateValue }
|
|
17665
17597
|
});
|
|
17666
17598
|
}
|
|
17667
17599
|
setTemporaryMaxDateValue(null);
|
|
@@ -17672,19 +17604,19 @@ var DatetimeFilterPopUp = (0, import_react87.forwardRef)(function DatetimeFilter
|
|
|
17672
17604
|
}
|
|
17673
17605
|
)
|
|
17674
17606
|
] }) }),
|
|
17675
|
-
/* @__PURE__ */ (0,
|
|
17676
|
-
/* @__PURE__ */ (0,
|
|
17677
|
-
/* @__PURE__ */ (0,
|
|
17607
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsxs)(Visibility, { isVisible: !needsRangeInput && needsParameterInput, children: [
|
|
17608
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)("label", { htmlFor: ids.compareDate, className: "typography-label-md", children: translation("date") }),
|
|
17609
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
|
|
17678
17610
|
DateTimeInput,
|
|
17679
17611
|
{
|
|
17680
17612
|
id: ids.compareDate,
|
|
17681
17613
|
mode: "dateTime",
|
|
17682
|
-
value: parameter.
|
|
17614
|
+
value: parameter.dateValue ?? null,
|
|
17683
17615
|
onValueChange: (compareDate) => {
|
|
17684
17616
|
onValueChange({
|
|
17685
17617
|
dataType: "dateTime",
|
|
17686
17618
|
operator,
|
|
17687
|
-
parameter: { ...parameter, compareDate }
|
|
17619
|
+
parameter: { ...parameter, dateValue: compareDate }
|
|
17688
17620
|
});
|
|
17689
17621
|
},
|
|
17690
17622
|
allowRemove: true,
|
|
@@ -17693,19 +17625,19 @@ var DatetimeFilterPopUp = (0, import_react87.forwardRef)(function DatetimeFilter
|
|
|
17693
17625
|
}
|
|
17694
17626
|
)
|
|
17695
17627
|
] }),
|
|
17696
|
-
/* @__PURE__ */ (0,
|
|
17628
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)(Visibility, { isVisible: !needsParameterInput, children: /* @__PURE__ */ (0, import_jsx_runtime75.jsx)("span", { className: "text-sm text-description h-10", children: translation("noParameterRequired") }) })
|
|
17697
17629
|
]
|
|
17698
17630
|
}
|
|
17699
17631
|
);
|
|
17700
17632
|
});
|
|
17701
|
-
var BooleanFilterPopUp = (0,
|
|
17633
|
+
var BooleanFilterPopUp = (0, import_react86.forwardRef)(function BooleanFilterPopUp2({
|
|
17702
17634
|
name,
|
|
17703
17635
|
value,
|
|
17704
17636
|
onValueChange,
|
|
17705
17637
|
onRemove,
|
|
17706
17638
|
...props
|
|
17707
17639
|
}, ref) {
|
|
17708
|
-
const operator = (0,
|
|
17640
|
+
const operator = (0, import_react86.useMemo)(() => {
|
|
17709
17641
|
const suggestion = value?.operator ?? "isTrue";
|
|
17710
17642
|
if (!FilterOperatorUtils.typeCheck.boolean(suggestion)) {
|
|
17711
17643
|
return "isTrue";
|
|
@@ -17713,7 +17645,7 @@ var BooleanFilterPopUp = (0, import_react87.forwardRef)(function BooleanFilterPo
|
|
|
17713
17645
|
return suggestion;
|
|
17714
17646
|
}, [value]);
|
|
17715
17647
|
const parameter = value?.parameter ?? {};
|
|
17716
|
-
return /* @__PURE__ */ (0,
|
|
17648
|
+
return /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
|
|
17717
17649
|
FilterBasePopUp,
|
|
17718
17650
|
{
|
|
17719
17651
|
ref,
|
|
@@ -17726,7 +17658,7 @@ var BooleanFilterPopUp = (0, import_react87.forwardRef)(function BooleanFilterPo
|
|
|
17726
17658
|
}
|
|
17727
17659
|
);
|
|
17728
17660
|
});
|
|
17729
|
-
var TagsFilterPopUp = (0,
|
|
17661
|
+
var TagsFilterPopUp = (0, import_react86.forwardRef)(function TagsFilterPopUp2({
|
|
17730
17662
|
name,
|
|
17731
17663
|
value,
|
|
17732
17664
|
onValueChange,
|
|
@@ -17735,7 +17667,7 @@ var TagsFilterPopUp = (0, import_react87.forwardRef)(function TagsFilterPopUp2({
|
|
|
17735
17667
|
...props
|
|
17736
17668
|
}, ref) {
|
|
17737
17669
|
const translation = useHightideTranslation();
|
|
17738
|
-
const operator = (0,
|
|
17670
|
+
const operator = (0, import_react86.useMemo)(() => {
|
|
17739
17671
|
const suggestion = value?.operator ?? "contains";
|
|
17740
17672
|
if (!FilterOperatorUtils.typeCheck.tags(suggestion)) {
|
|
17741
17673
|
return "contains";
|
|
@@ -17743,12 +17675,12 @@ var TagsFilterPopUp = (0, import_react87.forwardRef)(function TagsFilterPopUp2({
|
|
|
17743
17675
|
return suggestion;
|
|
17744
17676
|
}, [value]);
|
|
17745
17677
|
const parameter = value?.parameter ?? {};
|
|
17746
|
-
const selectedTags = Array.isArray(parameter.
|
|
17678
|
+
const selectedTags = Array.isArray(parameter.uuidValues) ? parameter.uuidValues : [];
|
|
17747
17679
|
const needsParameterInput = operator !== "isUndefined" && operator !== "isNotUndefined";
|
|
17748
17680
|
if (availableTags.length === 0) {
|
|
17749
17681
|
return null;
|
|
17750
17682
|
}
|
|
17751
|
-
return /* @__PURE__ */ (0,
|
|
17683
|
+
return /* @__PURE__ */ (0, import_jsx_runtime75.jsxs)(
|
|
17752
17684
|
FilterBasePopUp,
|
|
17753
17685
|
{
|
|
17754
17686
|
ref,
|
|
@@ -17759,8 +17691,8 @@ var TagsFilterPopUp = (0, import_react87.forwardRef)(function TagsFilterPopUp2({
|
|
|
17759
17691
|
onRemove,
|
|
17760
17692
|
allowedOperators: FilterOperatorUtils.operatorsByCategory.multiTags,
|
|
17761
17693
|
children: [
|
|
17762
|
-
/* @__PURE__ */ (0,
|
|
17763
|
-
/* @__PURE__ */ (0,
|
|
17694
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)("span", { className: "typography-label-lg font-semibold", children: translation("parameter") }),
|
|
17695
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)(Visibility, { isVisible: needsParameterInput, children: /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
|
|
17764
17696
|
MultiSelect,
|
|
17765
17697
|
{
|
|
17766
17698
|
value: selectedTags,
|
|
@@ -17768,19 +17700,19 @@ var TagsFilterPopUp = (0, import_react87.forwardRef)(function TagsFilterPopUp2({
|
|
|
17768
17700
|
onValueChange({
|
|
17769
17701
|
dataType: "multiTags",
|
|
17770
17702
|
operator,
|
|
17771
|
-
parameter: { ...parameter,
|
|
17703
|
+
parameter: { ...parameter, uuidValues: selected.length > 0 ? selected : void 0 }
|
|
17772
17704
|
});
|
|
17773
17705
|
},
|
|
17774
17706
|
buttonProps: { className: "min-w-64" },
|
|
17775
|
-
children: availableTags.map(({ tag, label }) => /* @__PURE__ */ (0,
|
|
17707
|
+
children: availableTags.map(({ tag, label }) => /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(MultiSelectOption, { value: tag, label, children: label }, tag))
|
|
17776
17708
|
}
|
|
17777
17709
|
) }),
|
|
17778
|
-
/* @__PURE__ */ (0,
|
|
17710
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)(Visibility, { isVisible: !needsParameterInput, children: /* @__PURE__ */ (0, import_jsx_runtime75.jsx)("span", { className: "text-sm text-description h-10", children: translation("noParameterRequired") }) })
|
|
17779
17711
|
]
|
|
17780
17712
|
}
|
|
17781
17713
|
);
|
|
17782
17714
|
});
|
|
17783
|
-
var TagsSingleFilterPopUp = (0,
|
|
17715
|
+
var TagsSingleFilterPopUp = (0, import_react86.forwardRef)(function TagsSingleFilterPopUp2({
|
|
17784
17716
|
name,
|
|
17785
17717
|
value,
|
|
17786
17718
|
onValueChange,
|
|
@@ -17789,7 +17721,7 @@ var TagsSingleFilterPopUp = (0, import_react87.forwardRef)(function TagsSingleFi
|
|
|
17789
17721
|
...props
|
|
17790
17722
|
}, ref) {
|
|
17791
17723
|
const translation = useHightideTranslation();
|
|
17792
|
-
const operator = (0,
|
|
17724
|
+
const operator = (0, import_react86.useMemo)(() => {
|
|
17793
17725
|
const suggestion = value?.operator ?? "contains";
|
|
17794
17726
|
if (!FilterOperatorUtils.typeCheck.tagsSingle(suggestion)) {
|
|
17795
17727
|
return "contains";
|
|
@@ -17797,14 +17729,14 @@ var TagsSingleFilterPopUp = (0, import_react87.forwardRef)(function TagsSingleFi
|
|
|
17797
17729
|
return suggestion;
|
|
17798
17730
|
}, [value]);
|
|
17799
17731
|
const parameter = value?.parameter ?? {};
|
|
17800
|
-
const selectedTagsMulti = Array.isArray(parameter.
|
|
17801
|
-
const selectedTagSingle = parameter.
|
|
17732
|
+
const selectedTagsMulti = Array.isArray(parameter.uuidValues) ? parameter.uuidValues : [];
|
|
17733
|
+
const selectedTagSingle = parameter.uuidValue != null ? String(parameter.uuidValue) : void 0;
|
|
17802
17734
|
const needsParameterInput = operator !== "isUndefined" && operator !== "isNotUndefined";
|
|
17803
17735
|
const needsMultiSelect = operator === "contains" || operator === "notContains";
|
|
17804
17736
|
if (availableTags.length === 0) {
|
|
17805
17737
|
return null;
|
|
17806
17738
|
}
|
|
17807
|
-
return /* @__PURE__ */ (0,
|
|
17739
|
+
return /* @__PURE__ */ (0, import_jsx_runtime75.jsxs)(
|
|
17808
17740
|
FilterBasePopUp,
|
|
17809
17741
|
{
|
|
17810
17742
|
ref,
|
|
@@ -17815,8 +17747,8 @@ var TagsSingleFilterPopUp = (0, import_react87.forwardRef)(function TagsSingleFi
|
|
|
17815
17747
|
onRemove,
|
|
17816
17748
|
allowedOperators: FilterOperatorUtils.operatorsByCategory.singleTag,
|
|
17817
17749
|
children: [
|
|
17818
|
-
/* @__PURE__ */ (0,
|
|
17819
|
-
/* @__PURE__ */ (0,
|
|
17750
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)("span", { className: "typography-label-lg font-semibold", children: translation("parameter") }),
|
|
17751
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)(Visibility, { isVisible: needsParameterInput && needsMultiSelect, children: /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
|
|
17820
17752
|
MultiSelect,
|
|
17821
17753
|
{
|
|
17822
17754
|
value: selectedTagsMulti,
|
|
@@ -17824,14 +17756,14 @@ var TagsSingleFilterPopUp = (0, import_react87.forwardRef)(function TagsSingleFi
|
|
|
17824
17756
|
onValueChange({
|
|
17825
17757
|
dataType: "singleTag",
|
|
17826
17758
|
operator,
|
|
17827
|
-
parameter: { ...parameter,
|
|
17759
|
+
parameter: { ...parameter, uuidValues: selected.length > 0 ? selected : void 0 }
|
|
17828
17760
|
});
|
|
17829
17761
|
},
|
|
17830
17762
|
buttonProps: { className: "min-w-64" },
|
|
17831
|
-
children: availableTags.map(({ tag, label }) => /* @__PURE__ */ (0,
|
|
17763
|
+
children: availableTags.map(({ tag, label }) => /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(MultiSelectOption, { value: tag, label }, tag))
|
|
17832
17764
|
}
|
|
17833
17765
|
) }),
|
|
17834
|
-
/* @__PURE__ */ (0,
|
|
17766
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)(Visibility, { isVisible: needsParameterInput && !needsMultiSelect, children: /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
|
|
17835
17767
|
Select,
|
|
17836
17768
|
{
|
|
17837
17769
|
value: selectedTagSingle,
|
|
@@ -17839,27 +17771,27 @@ var TagsSingleFilterPopUp = (0, import_react87.forwardRef)(function TagsSingleFi
|
|
|
17839
17771
|
onValueChange({
|
|
17840
17772
|
dataType: "singleTag",
|
|
17841
17773
|
operator,
|
|
17842
|
-
parameter: { ...parameter,
|
|
17774
|
+
parameter: { ...parameter, uuidValue: selectedTag ?? void 0 }
|
|
17843
17775
|
});
|
|
17844
17776
|
},
|
|
17845
17777
|
buttonProps: { className: "min-w-64" },
|
|
17846
|
-
children: availableTags.map(({ tag, label }) => /* @__PURE__ */ (0,
|
|
17778
|
+
children: availableTags.map(({ tag, label }) => /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(SelectOption, { value: tag, label }, tag))
|
|
17847
17779
|
}
|
|
17848
17780
|
) }),
|
|
17849
|
-
/* @__PURE__ */ (0,
|
|
17781
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)(Visibility, { isVisible: !needsParameterInput, children: /* @__PURE__ */ (0, import_jsx_runtime75.jsx)("span", { className: "text-sm text-description h-10", children: translation("noParameterRequired") }) })
|
|
17850
17782
|
]
|
|
17851
17783
|
}
|
|
17852
17784
|
);
|
|
17853
17785
|
});
|
|
17854
|
-
var GenericFilterPopUp = (0,
|
|
17855
|
-
const operator = (0,
|
|
17786
|
+
var GenericFilterPopUp = (0, import_react86.forwardRef)(function GenericFilterPopUp2({ name, value, onValueChange, ...props }, ref) {
|
|
17787
|
+
const operator = (0, import_react86.useMemo)(() => {
|
|
17856
17788
|
const suggestion = value?.operator ?? "isNotUndefined";
|
|
17857
17789
|
if (!FilterOperatorUtils.typeCheck.unknownType(suggestion)) {
|
|
17858
17790
|
return "isNotUndefined";
|
|
17859
17791
|
}
|
|
17860
17792
|
return suggestion;
|
|
17861
17793
|
}, [value]);
|
|
17862
|
-
return /* @__PURE__ */ (0,
|
|
17794
|
+
return /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
|
|
17863
17795
|
FilterBasePopUp,
|
|
17864
17796
|
{
|
|
17865
17797
|
ref,
|
|
@@ -17872,7 +17804,7 @@ var GenericFilterPopUp = (0, import_react87.forwardRef)(function GenericFilterPo
|
|
|
17872
17804
|
}
|
|
17873
17805
|
);
|
|
17874
17806
|
});
|
|
17875
|
-
var FilterPopUp = (0,
|
|
17807
|
+
var FilterPopUp = (0, import_react86.forwardRef)(function FilterPopUp2({
|
|
17876
17808
|
name,
|
|
17877
17809
|
value,
|
|
17878
17810
|
onValueChange,
|
|
@@ -17882,26 +17814,26 @@ var FilterPopUp = (0, import_react87.forwardRef)(function FilterPopUp2({
|
|
|
17882
17814
|
}, ref) {
|
|
17883
17815
|
switch (dataType) {
|
|
17884
17816
|
case "text":
|
|
17885
|
-
return /* @__PURE__ */ (0,
|
|
17817
|
+
return /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(TextFilterPopUp, { ref, name, value, onValueChange, ...props });
|
|
17886
17818
|
case "number":
|
|
17887
|
-
return /* @__PURE__ */ (0,
|
|
17819
|
+
return /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(NumberFilterPopUp, { ref, name, value, onValueChange, ...props });
|
|
17888
17820
|
case "date":
|
|
17889
|
-
return /* @__PURE__ */ (0,
|
|
17821
|
+
return /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(DateFilterPopUp, { ref, name, value, onValueChange, ...props });
|
|
17890
17822
|
case "dateTime":
|
|
17891
|
-
return /* @__PURE__ */ (0,
|
|
17823
|
+
return /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(DatetimeFilterPopUp, { ref, name, value, onValueChange, ...props });
|
|
17892
17824
|
case "boolean":
|
|
17893
|
-
return /* @__PURE__ */ (0,
|
|
17825
|
+
return /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(BooleanFilterPopUp, { ref, name, value, onValueChange, ...props });
|
|
17894
17826
|
case "multiTags":
|
|
17895
|
-
return /* @__PURE__ */ (0,
|
|
17827
|
+
return /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(TagsFilterPopUp, { ref, name, value, onValueChange, tags, ...props });
|
|
17896
17828
|
case "singleTag":
|
|
17897
|
-
return /* @__PURE__ */ (0,
|
|
17829
|
+
return /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(TagsSingleFilterPopUp, { ref, name, value, onValueChange, tags, ...props });
|
|
17898
17830
|
case "unknownType":
|
|
17899
|
-
return /* @__PURE__ */ (0,
|
|
17831
|
+
return /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(GenericFilterPopUp, { ref, name, value, onValueChange, ...props });
|
|
17900
17832
|
}
|
|
17901
17833
|
});
|
|
17902
17834
|
|
|
17903
17835
|
// src/components/layout/table/TableFilterButton.tsx
|
|
17904
|
-
var
|
|
17836
|
+
var import_jsx_runtime76 = require("react/jsx-runtime");
|
|
17905
17837
|
var TableFilterButton = ({
|
|
17906
17838
|
filterType,
|
|
17907
17839
|
header
|
|
@@ -17909,18 +17841,18 @@ var TableFilterButton = ({
|
|
|
17909
17841
|
const translation = useHightideTranslation();
|
|
17910
17842
|
const column = header.column;
|
|
17911
17843
|
const columnFilterValue = column.getFilterValue();
|
|
17912
|
-
const [filterValue, setFilterValue] = (0,
|
|
17844
|
+
const [filterValue, setFilterValue] = (0, import_react87.useState)(columnFilterValue);
|
|
17913
17845
|
const hasFilter = !!filterValue;
|
|
17914
|
-
const anchorRef = (0,
|
|
17915
|
-
const containerRef = (0,
|
|
17916
|
-
const [isOpen, setIsOpen] = (0,
|
|
17917
|
-
const id = (0,
|
|
17918
|
-
const ids = (0,
|
|
17846
|
+
const anchorRef = (0, import_react87.useRef)(null);
|
|
17847
|
+
const containerRef = (0, import_react87.useRef)(null);
|
|
17848
|
+
const [isOpen, setIsOpen] = (0, import_react87.useState)(false);
|
|
17849
|
+
const id = (0, import_react87.useId)();
|
|
17850
|
+
const ids = (0, import_react87.useMemo)(() => ({
|
|
17919
17851
|
button: `table-filter-button-${id}`,
|
|
17920
17852
|
popup: `table-filter-popup-${id}`,
|
|
17921
17853
|
label: `table-filter-label-${id}`
|
|
17922
17854
|
}), [id]);
|
|
17923
|
-
(0,
|
|
17855
|
+
(0, import_react87.useEffect)(() => {
|
|
17924
17856
|
setFilterValue(columnFilterValue);
|
|
17925
17857
|
}, [columnFilterValue]);
|
|
17926
17858
|
const isTagsFilter = filterType === "multiTags" || filterType === "singleTag";
|
|
@@ -17928,8 +17860,8 @@ var TableFilterButton = ({
|
|
|
17928
17860
|
if (isTagsFilter && !hasTagsMetaData) {
|
|
17929
17861
|
return null;
|
|
17930
17862
|
}
|
|
17931
|
-
return /* @__PURE__ */ (0,
|
|
17932
|
-
/* @__PURE__ */ (0,
|
|
17863
|
+
return /* @__PURE__ */ (0, import_jsx_runtime76.jsxs)(import_jsx_runtime76.Fragment, { children: [
|
|
17864
|
+
/* @__PURE__ */ (0, import_jsx_runtime76.jsxs)(
|
|
17933
17865
|
IconButton,
|
|
17934
17866
|
{
|
|
17935
17867
|
ref: anchorRef,
|
|
@@ -17945,12 +17877,12 @@ var TableFilterButton = ({
|
|
|
17945
17877
|
"aria-labelledby": ids.label,
|
|
17946
17878
|
className: "relative",
|
|
17947
17879
|
children: [
|
|
17948
|
-
/* @__PURE__ */ (0,
|
|
17949
|
-
/* @__PURE__ */ (0,
|
|
17880
|
+
/* @__PURE__ */ (0, import_jsx_runtime76.jsx)(import_lucide_react20.FilterIcon, { className: "size-4" }),
|
|
17881
|
+
/* @__PURE__ */ (0, import_jsx_runtime76.jsx)(Visibility, { isVisible: hasFilter, children: /* @__PURE__ */ (0, import_jsx_runtime76.jsx)("div", { className: "absolute -top-1 -right-1 w-2 h-2 rounded-full bg-primary" }) })
|
|
17950
17882
|
]
|
|
17951
17883
|
}
|
|
17952
17884
|
),
|
|
17953
|
-
/* @__PURE__ */ (0,
|
|
17885
|
+
/* @__PURE__ */ (0, import_jsx_runtime76.jsx)(
|
|
17954
17886
|
FilterPopUp,
|
|
17955
17887
|
{
|
|
17956
17888
|
ref: containerRef,
|
|
@@ -17981,11 +17913,11 @@ var TableFilterButton = ({
|
|
|
17981
17913
|
};
|
|
17982
17914
|
|
|
17983
17915
|
// src/components/layout/table/TableHeader.tsx
|
|
17984
|
-
var
|
|
17916
|
+
var import_react88 = require("react");
|
|
17985
17917
|
|
|
17986
17918
|
// src/components/user-interaction/data/data-types.tsx
|
|
17987
|
-
var
|
|
17988
|
-
var
|
|
17919
|
+
var import_lucide_react21 = require("lucide-react");
|
|
17920
|
+
var import_jsx_runtime77 = require("react/jsx-runtime");
|
|
17989
17921
|
var dataTypes = [
|
|
17990
17922
|
"text",
|
|
17991
17923
|
"number",
|
|
@@ -18018,21 +17950,21 @@ var getDefaultValue = (type, selectOptions) => {
|
|
|
18018
17950
|
function toIcon(type) {
|
|
18019
17951
|
switch (type) {
|
|
18020
17952
|
case "text":
|
|
18021
|
-
return /* @__PURE__ */ (0,
|
|
17953
|
+
return /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(import_lucide_react21.TextIcon, { className: "size-4" });
|
|
18022
17954
|
case "number":
|
|
18023
|
-
return /* @__PURE__ */ (0,
|
|
17955
|
+
return /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(import_lucide_react21.Binary, { className: "size-4" });
|
|
18024
17956
|
case "boolean":
|
|
18025
|
-
return /* @__PURE__ */ (0,
|
|
17957
|
+
return /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(import_lucide_react21.Check, { className: "size-4" });
|
|
18026
17958
|
case "date":
|
|
18027
|
-
return /* @__PURE__ */ (0,
|
|
17959
|
+
return /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(import_lucide_react21.Calendar, { className: "size-4" });
|
|
18028
17960
|
case "dateTime":
|
|
18029
|
-
return /* @__PURE__ */ (0,
|
|
17961
|
+
return /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(import_lucide_react21.CalendarClock, { className: "size-4" });
|
|
18030
17962
|
case "singleTag":
|
|
18031
|
-
return /* @__PURE__ */ (0,
|
|
17963
|
+
return /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(import_lucide_react21.Tag, { className: "size-4" });
|
|
18032
17964
|
case "multiTags":
|
|
18033
|
-
return /* @__PURE__ */ (0,
|
|
17965
|
+
return /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(import_lucide_react21.Tags, { className: "size-4" });
|
|
18034
17966
|
case "unknownType":
|
|
18035
|
-
return /* @__PURE__ */ (0,
|
|
17967
|
+
return /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(import_lucide_react21.Database, { className: "size-4" });
|
|
18036
17968
|
}
|
|
18037
17969
|
}
|
|
18038
17970
|
var DataTypeUtils = {
|
|
@@ -18042,10 +17974,10 @@ var DataTypeUtils = {
|
|
|
18042
17974
|
};
|
|
18043
17975
|
|
|
18044
17976
|
// src/components/layout/table/TableHeader.tsx
|
|
18045
|
-
var
|
|
17977
|
+
var import_jsx_runtime78 = require("react/jsx-runtime");
|
|
18046
17978
|
var TableHeader = ({ isSticky = false }) => {
|
|
18047
17979
|
const { table } = useTableStateWithoutSizingContext();
|
|
18048
|
-
const handleResizeMove = (0,
|
|
17980
|
+
const handleResizeMove = (0, import_react88.useCallback)((e) => {
|
|
18049
17981
|
if (!table.getState().columnSizingInfo.isResizingColumn) return;
|
|
18050
17982
|
const currentX = "touches" in e ? e.touches[0].clientX : e.clientX;
|
|
18051
17983
|
const deltaOffset = currentX - (table.getState().columnSizingInfo.startOffset ?? 0);
|
|
@@ -18061,7 +17993,7 @@ var TableHeader = ({ isSticky = false }) => {
|
|
|
18061
17993
|
deltaOffset
|
|
18062
17994
|
}));
|
|
18063
17995
|
}, [table]);
|
|
18064
|
-
const handleResizeEnd = (0,
|
|
17996
|
+
const handleResizeEnd = (0, import_react88.useCallback)(() => {
|
|
18065
17997
|
if (!table.getState().columnSizingInfo.isResizingColumn) return;
|
|
18066
17998
|
const newWidth = (table.getState().columnSizingInfo.startSize ?? 0) + (table.getState().columnSizingInfo.deltaOffset ?? 0);
|
|
18067
17999
|
table.setColumnSizing((prev) => {
|
|
@@ -18079,7 +18011,7 @@ var TableHeader = ({ isSticky = false }) => {
|
|
|
18079
18011
|
startSize: null
|
|
18080
18012
|
});
|
|
18081
18013
|
}, [table]);
|
|
18082
|
-
(0,
|
|
18014
|
+
(0, import_react88.useEffect)(() => {
|
|
18083
18015
|
window.addEventListener("pointermove", handleResizeMove);
|
|
18084
18016
|
window.addEventListener("pointerup", handleResizeEnd);
|
|
18085
18017
|
return () => {
|
|
@@ -18087,8 +18019,8 @@ var TableHeader = ({ isSticky = false }) => {
|
|
|
18087
18019
|
window.removeEventListener("pointerup", handleResizeEnd);
|
|
18088
18020
|
};
|
|
18089
18021
|
}, [handleResizeEnd, handleResizeMove, table]);
|
|
18090
|
-
return /* @__PURE__ */ (0,
|
|
18091
|
-
table.getHeaderGroups().map((headerGroup) => /* @__PURE__ */ (0,
|
|
18022
|
+
return /* @__PURE__ */ (0, import_jsx_runtime78.jsxs)(import_jsx_runtime78.Fragment, { children: [
|
|
18023
|
+
table.getHeaderGroups().map((headerGroup) => /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(TableStateContext.Consumer, { children: ({ sizeVars }) => /* @__PURE__ */ (0, import_jsx_runtime78.jsx)("colgroup", { style: sizeVars, children: headerGroup.headers.map((header) => /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
18092
18024
|
"col",
|
|
18093
18025
|
{
|
|
18094
18026
|
style: {
|
|
@@ -18099,8 +18031,8 @@ var TableHeader = ({ isSticky = false }) => {
|
|
|
18099
18031
|
},
|
|
18100
18032
|
header.id
|
|
18101
18033
|
)) }) }, headerGroup.id)),
|
|
18102
|
-
/* @__PURE__ */ (0,
|
|
18103
|
-
return /* @__PURE__ */ (0,
|
|
18034
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsx)("thead", { children: table.getHeaderGroups().map((headerGroup) => /* @__PURE__ */ (0, import_jsx_runtime78.jsx)("tr", { "data-name": "table-header-row", className: (0, import_clsx28.default)(table.options.meta?.headerRowClassName), children: headerGroup.headers.map((header) => {
|
|
18035
|
+
return /* @__PURE__ */ (0, import_jsx_runtime78.jsxs)(
|
|
18104
18036
|
"th",
|
|
18105
18037
|
{
|
|
18106
18038
|
colSpan: header.colSpan,
|
|
@@ -18108,8 +18040,8 @@ var TableHeader = ({ isSticky = false }) => {
|
|
|
18108
18040
|
"data-name": "table-header-cell",
|
|
18109
18041
|
className: (0, import_clsx28.default)("group/table-header-cell", header.column.columnDef.meta?.className),
|
|
18110
18042
|
children: [
|
|
18111
|
-
/* @__PURE__ */ (0,
|
|
18112
|
-
/* @__PURE__ */ (0,
|
|
18043
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsx)(Visibility, { isVisible: !header.isPlaceholder, children: /* @__PURE__ */ (0, import_jsx_runtime78.jsxs)("div", { className: "flex-row-1 items-center truncate", children: [
|
|
18044
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsx)(Visibility, { isVisible: header.column.getCanSort(), children: /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
18113
18045
|
TableSortButton,
|
|
18114
18046
|
{
|
|
18115
18047
|
sortDirection: header.column.getIsSorted(),
|
|
@@ -18135,7 +18067,7 @@ var TableHeader = ({ isSticky = false }) => {
|
|
|
18135
18067
|
}
|
|
18136
18068
|
}
|
|
18137
18069
|
) }),
|
|
18138
|
-
/* @__PURE__ */ (0,
|
|
18070
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsx)(Visibility, { isVisible: header.column.getCanFilter() && DataTypeUtils.types.includes(header.column.columnDef.filterFn), children: /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
18139
18071
|
TableFilterButton,
|
|
18140
18072
|
{
|
|
18141
18073
|
header,
|
|
@@ -18147,7 +18079,7 @@ var TableHeader = ({ isSticky = false }) => {
|
|
|
18147
18079
|
header.getContext()
|
|
18148
18080
|
)
|
|
18149
18081
|
] }) }),
|
|
18150
|
-
/* @__PURE__ */ (0,
|
|
18082
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsx)(Visibility, { isVisible: header.column.getCanResize(), children: /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
18151
18083
|
"div",
|
|
18152
18084
|
{
|
|
18153
18085
|
onPointerDown: (e) => {
|
|
@@ -18178,7 +18110,7 @@ var TableHeader = ({ isSticky = false }) => {
|
|
|
18178
18110
|
};
|
|
18179
18111
|
|
|
18180
18112
|
// src/components/layout/table/TableDisplay.tsx
|
|
18181
|
-
var
|
|
18113
|
+
var import_jsx_runtime79 = require("react/jsx-runtime");
|
|
18182
18114
|
var TableDisplay = ({
|
|
18183
18115
|
children,
|
|
18184
18116
|
containerProps,
|
|
@@ -18187,7 +18119,7 @@ var TableDisplay = ({
|
|
|
18187
18119
|
}) => {
|
|
18188
18120
|
const { table } = useTableStateContext();
|
|
18189
18121
|
const { containerRef } = useTableContainerContext();
|
|
18190
|
-
return /* @__PURE__ */ (0,
|
|
18122
|
+
return /* @__PURE__ */ (0, import_jsx_runtime79.jsx)("div", { ...containerProps, ref: containerRef, "data-name": containerProps?.["data-name"] ?? "table-container", children: /* @__PURE__ */ (0, import_jsx_runtime79.jsxs)(
|
|
18191
18123
|
"table",
|
|
18192
18124
|
{
|
|
18193
18125
|
...props,
|
|
@@ -18198,8 +18130,8 @@ var TableDisplay = ({
|
|
|
18198
18130
|
},
|
|
18199
18131
|
children: [
|
|
18200
18132
|
children,
|
|
18201
|
-
/* @__PURE__ */ (0,
|
|
18202
|
-
/* @__PURE__ */ (0,
|
|
18133
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)(TableHeader, { ...tableHeaderProps }),
|
|
18134
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)(TableBody, {})
|
|
18203
18135
|
]
|
|
18204
18136
|
}
|
|
18205
18137
|
) });
|
|
@@ -18207,10 +18139,10 @@ var TableDisplay = ({
|
|
|
18207
18139
|
|
|
18208
18140
|
// src/components/layout/table/TablePagination.tsx
|
|
18209
18141
|
var import_clsx29 = __toESM(require("clsx"));
|
|
18210
|
-
var
|
|
18142
|
+
var import_jsx_runtime80 = require("react/jsx-runtime");
|
|
18211
18143
|
var TablePaginationMenu = ({ ...props }) => {
|
|
18212
18144
|
const { table } = useTableStateWithoutSizingContext();
|
|
18213
|
-
return /* @__PURE__ */ (0,
|
|
18145
|
+
return /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(
|
|
18214
18146
|
Pagination,
|
|
18215
18147
|
{
|
|
18216
18148
|
...props,
|
|
@@ -18230,23 +18162,86 @@ var TablePageSizeSelect = ({
|
|
|
18230
18162
|
}) => {
|
|
18231
18163
|
const { table } = useTableStateWithoutSizingContext();
|
|
18232
18164
|
const currentPageSize = table.getState().pagination.pageSize;
|
|
18233
|
-
return /* @__PURE__ */ (0,
|
|
18165
|
+
return /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(
|
|
18234
18166
|
Select,
|
|
18235
18167
|
{
|
|
18236
18168
|
...props,
|
|
18237
18169
|
value: currentPageSize.toString(),
|
|
18238
18170
|
onValueChange: (value) => table.setPageSize(Number(value)),
|
|
18239
|
-
children: pageSizeOptions.map((size) => /* @__PURE__ */ (0,
|
|
18171
|
+
children: pageSizeOptions.map((size) => /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(SelectOption, { value: size.toString(), label: size.toString() }, size))
|
|
18240
18172
|
}
|
|
18241
18173
|
);
|
|
18242
18174
|
};
|
|
18243
18175
|
var TablePagination = ({ allowChangingPageSize = true, pageSizeOptions, ...props }) => {
|
|
18244
|
-
return /* @__PURE__ */ (0,
|
|
18245
|
-
/* @__PURE__ */ (0,
|
|
18246
|
-
/* @__PURE__ */ (0,
|
|
18176
|
+
return /* @__PURE__ */ (0, import_jsx_runtime80.jsxs)("div", { ...props, className: (0, import_clsx29.default)("container flex-col-2 sm:flex-row-8 items-center justify-center", props.className), children: [
|
|
18177
|
+
/* @__PURE__ */ (0, import_jsx_runtime80.jsx)(TablePaginationMenu, {}),
|
|
18178
|
+
/* @__PURE__ */ (0, import_jsx_runtime80.jsx)(Visibility, { isVisible: allowChangingPageSize, children: /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(TablePageSizeSelect, { pageSizeOptions, buttonProps: { className: "h-10 min-w-24 max-w-24" } }) })
|
|
18247
18179
|
] });
|
|
18248
18180
|
};
|
|
18249
18181
|
|
|
18182
|
+
// src/components/user-interaction/Checkbox.tsx
|
|
18183
|
+
var import_lucide_react22 = require("lucide-react");
|
|
18184
|
+
var import_react89 = require("react");
|
|
18185
|
+
var import_jsx_runtime81 = require("react/jsx-runtime");
|
|
18186
|
+
var Checkbox = ({
|
|
18187
|
+
value: controlledValue,
|
|
18188
|
+
initialValue = false,
|
|
18189
|
+
indeterminate,
|
|
18190
|
+
required = false,
|
|
18191
|
+
invalid = false,
|
|
18192
|
+
disabled = false,
|
|
18193
|
+
readOnly = false,
|
|
18194
|
+
onValueChange,
|
|
18195
|
+
onEditComplete,
|
|
18196
|
+
size = "md",
|
|
18197
|
+
alwaysShowCheckIcon = false,
|
|
18198
|
+
...props
|
|
18199
|
+
}) => {
|
|
18200
|
+
const onEditCompleteStable = useEventCallbackStabilizer(onEditComplete);
|
|
18201
|
+
const onValueChangeStable = useEventCallbackStabilizer(onValueChange);
|
|
18202
|
+
const onChangeWrapper = (0, import_react89.useCallback)((value2) => {
|
|
18203
|
+
onValueChangeStable(value2);
|
|
18204
|
+
onEditCompleteStable(value2);
|
|
18205
|
+
}, [onValueChangeStable, onEditCompleteStable]);
|
|
18206
|
+
const [value, setValue] = useControlledState({
|
|
18207
|
+
value: controlledValue,
|
|
18208
|
+
onValueChange: onChangeWrapper,
|
|
18209
|
+
defaultValue: initialValue
|
|
18210
|
+
});
|
|
18211
|
+
return /* @__PURE__ */ (0, import_jsx_runtime81.jsxs)(
|
|
18212
|
+
"div",
|
|
18213
|
+
{
|
|
18214
|
+
...props,
|
|
18215
|
+
onClick: (event) => {
|
|
18216
|
+
if (!disabled) {
|
|
18217
|
+
setValue((prev) => !prev);
|
|
18218
|
+
}
|
|
18219
|
+
props.onClick?.(event);
|
|
18220
|
+
},
|
|
18221
|
+
onKeyDown: (event) => {
|
|
18222
|
+
if (disabled) return;
|
|
18223
|
+
if (event.key === " " || event.key === "Enter") {
|
|
18224
|
+
event.preventDefault();
|
|
18225
|
+
setValue((prev) => !prev);
|
|
18226
|
+
}
|
|
18227
|
+
props.onKeyDown?.(event);
|
|
18228
|
+
},
|
|
18229
|
+
"data-checked": !indeterminate ? value : "indeterminate",
|
|
18230
|
+
"data-size": size ?? void 0,
|
|
18231
|
+
...PropsUtil.dataAttributes.interactionStates({ disabled, invalid, readOnly, required }),
|
|
18232
|
+
role: "checkbox",
|
|
18233
|
+
tabIndex: disabled ? -1 : 0,
|
|
18234
|
+
"aria-checked": indeterminate ? "mixed" : value,
|
|
18235
|
+
...PropsUtil.aria.interactionStates({ disabled, invalid, readOnly, required }, props),
|
|
18236
|
+
"data-name": props["data-name"] ?? "checkbox",
|
|
18237
|
+
children: [
|
|
18238
|
+
/* @__PURE__ */ (0, import_jsx_runtime81.jsx)(Visibility, { isVisible: indeterminate, children: /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(import_lucide_react22.Minus, { "data-name": "checkbox-indicator", className: "checkbox-indicator", "aria-hidden": true }) }),
|
|
18239
|
+
/* @__PURE__ */ (0, import_jsx_runtime81.jsx)(Visibility, { isVisible: !indeterminate && (alwaysShowCheckIcon || value), children: /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(import_lucide_react22.Check, { "data-name": "checkbox-indicator", className: "checkbox-indicator", "aria-hidden": true }) })
|
|
18240
|
+
]
|
|
18241
|
+
}
|
|
18242
|
+
);
|
|
18243
|
+
};
|
|
18244
|
+
|
|
18250
18245
|
// src/components/layout/table/TableWithSelectionProvider.tsx
|
|
18251
18246
|
var import_react90 = require("react");
|
|
18252
18247
|
var import_jsx_runtime82 = require("react/jsx-runtime");
|
|
@@ -19738,11 +19733,12 @@ var FilterList = ({ value, onValueChange, availableItems }) => {
|
|
|
19738
19733
|
onValueChange(value.filter((prevItem) => prevItem.id !== columnFilter.id));
|
|
19739
19734
|
setEditState(void 0);
|
|
19740
19735
|
},
|
|
19736
|
+
operatorOverrides: item.operatorOverrides,
|
|
19741
19737
|
dataType: item.dataType,
|
|
19742
19738
|
tags: item.tags,
|
|
19743
19739
|
name: item.label,
|
|
19744
19740
|
isOpen,
|
|
19745
|
-
|
|
19741
|
+
onClose: () => setIsOpen(false)
|
|
19746
19742
|
}) : /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(
|
|
19747
19743
|
FilterPopUp,
|
|
19748
19744
|
{
|
|
@@ -19750,6 +19746,7 @@ var FilterList = ({ value, onValueChange, availableItems }) => {
|
|
|
19750
19746
|
value: editState?.id === columnFilter.id ? editState.value : columnFilter.value,
|
|
19751
19747
|
dataType: item.dataType,
|
|
19752
19748
|
tags: item.tags,
|
|
19749
|
+
operatorOverrides: item.operatorOverrides,
|
|
19753
19750
|
onValueChange: (value2) => {
|
|
19754
19751
|
setEditState({ ...columnFilter, value: value2 });
|
|
19755
19752
|
},
|
|
@@ -19962,23 +19959,27 @@ var FlexibleDateTimeInput = (0, import_react108.forwardRef)(function FlexibleDat
|
|
|
19962
19959
|
onValueChange,
|
|
19963
19960
|
defaultValue: initialValue
|
|
19964
19961
|
});
|
|
19965
|
-
const fixedTime = (0, import_react108.useMemo)(() => fixedTimeOverride ?? new Date(23, 59, 59, 999), [fixedTimeOverride]);
|
|
19966
|
-
const [preferredMode, setPreferredMode] = (0, import_react108.useState)(
|
|
19967
|
-
|
|
19968
|
-
if (!value) return preferredMode;
|
|
19962
|
+
const fixedTime = (0, import_react108.useMemo)(() => fixedTimeOverride ?? new Date(1970, 0, 1, 23, 59, 59, 999), [fixedTimeOverride]);
|
|
19963
|
+
const [preferredMode, setPreferredMode] = (0, import_react108.useState)(() => {
|
|
19964
|
+
if (!value) return defaultMode;
|
|
19969
19965
|
if (DateUtils.sameTime(value, fixedTime, true, true)) {
|
|
19970
19966
|
return "date";
|
|
19971
19967
|
}
|
|
19972
19968
|
return "dateTime";
|
|
19973
|
-
}
|
|
19969
|
+
});
|
|
19974
19970
|
return /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(
|
|
19975
19971
|
DateTimeInput,
|
|
19976
19972
|
{
|
|
19977
19973
|
...props,
|
|
19978
19974
|
ref: forwardedRef,
|
|
19979
|
-
mode,
|
|
19975
|
+
mode: preferredMode,
|
|
19980
19976
|
value,
|
|
19981
|
-
onValueChange:
|
|
19977
|
+
onValueChange: (value2) => {
|
|
19978
|
+
if (preferredMode === "date")
|
|
19979
|
+
setValue(DateUtils.withTime(value2, fixedTime));
|
|
19980
|
+
else
|
|
19981
|
+
setValue(DateUtils.isLastMillisecondOfDay(value2) ? new Date(value2.getTime() - 1) : new Date(value2.getTime() + 1));
|
|
19982
|
+
},
|
|
19982
19983
|
actions: [
|
|
19983
19984
|
...actions,
|
|
19984
19985
|
/* @__PURE__ */ (0, import_jsx_runtime100.jsx)(
|
|
@@ -19990,7 +19991,6 @@ var FlexibleDateTimeInput = (0, import_react108.forwardRef)(function FlexibleDat
|
|
|
19990
19991
|
tooltip: preferredMode === "date" ? translation("addTime") : translation("withoutTime"),
|
|
19991
19992
|
onClick: () => {
|
|
19992
19993
|
const newMode = preferredMode === "date" ? "dateTime" : "date";
|
|
19993
|
-
setPreferredMode((prev) => prev === "date" ? "dateTime" : "date");
|
|
19994
19994
|
if (value) {
|
|
19995
19995
|
if (newMode === "date") {
|
|
19996
19996
|
setValue(DateUtils.withTime(value, fixedTime));
|
|
@@ -19998,6 +19998,7 @@ var FlexibleDateTimeInput = (0, import_react108.forwardRef)(function FlexibleDat
|
|
|
19998
19998
|
setValue(DateUtils.isLastMillisecondOfDay(value) ? new Date(value.getTime() - 1) : new Date(value.getTime() + 1));
|
|
19999
19999
|
}
|
|
20000
20000
|
}
|
|
20001
|
+
setPreferredMode(newMode);
|
|
20001
20002
|
},
|
|
20002
20003
|
children: preferredMode === "date" ? /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(import_lucide_react28.ClockPlus, { className: "size-5" }) : /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(import_lucide_react28.ClockFading, { className: "size-5" })
|
|
20003
20004
|
},
|
|
@@ -20198,24 +20199,52 @@ var PropertyBase = ({
|
|
|
20198
20199
|
const isClearEnabled = allowClear && !readOnly;
|
|
20199
20200
|
const isRemoveEnabled = allowRemove && !readOnly;
|
|
20200
20201
|
const showActionsContainer = isClearEnabled || isRemoveEnabled;
|
|
20201
|
-
|
|
20202
|
+
const renderActionButtons = () => /* @__PURE__ */ (0, import_jsx_runtime104.jsxs)(import_jsx_runtime104.Fragment, { children: [
|
|
20203
|
+
isClearEnabled && /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(
|
|
20204
|
+
IconButton,
|
|
20205
|
+
{
|
|
20206
|
+
tooltip: translation("clearValue"),
|
|
20207
|
+
onClick: onValueClear,
|
|
20208
|
+
disabled: !hasValue,
|
|
20209
|
+
color: "negative",
|
|
20210
|
+
coloringStyle: "text",
|
|
20211
|
+
size: "sm",
|
|
20212
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(import_lucide_react31.X, { className: "size-force-5" })
|
|
20213
|
+
}
|
|
20214
|
+
),
|
|
20215
|
+
isRemoveEnabled && /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(
|
|
20216
|
+
IconButton,
|
|
20217
|
+
{
|
|
20218
|
+
tooltip: translation("removeProperty"),
|
|
20219
|
+
onClick: onRemove,
|
|
20220
|
+
color: "negative",
|
|
20221
|
+
coloringStyle: "text",
|
|
20222
|
+
size: "sm",
|
|
20223
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(import_lucide_react31.Trash, { className: "size-force-5" })
|
|
20224
|
+
}
|
|
20225
|
+
)
|
|
20226
|
+
] });
|
|
20227
|
+
return /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(
|
|
20202
20228
|
"div",
|
|
20203
20229
|
{
|
|
20204
|
-
className: (0, import_clsx41.default)("group/property", className),
|
|
20230
|
+
className: (0, import_clsx41.default)("group/property min-w-0 w-full", className),
|
|
20205
20231
|
"data-name": "property-root",
|
|
20206
20232
|
"data-invalid": PropsUtil.dataAttributes.bool(invalid),
|
|
20207
|
-
children: [
|
|
20233
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime104.jsxs)("div", { "data-name": "property-inner", children: [
|
|
20208
20234
|
/* @__PURE__ */ (0, import_jsx_runtime104.jsxs)(
|
|
20209
20235
|
"div",
|
|
20210
20236
|
{
|
|
20211
20237
|
"data-name": "property-title",
|
|
20212
20238
|
"data-invalid": PropsUtil.dataAttributes.bool(invalid),
|
|
20213
20239
|
children: [
|
|
20214
|
-
/* @__PURE__ */ (0, import_jsx_runtime104.
|
|
20215
|
-
/* @__PURE__ */ (0, import_jsx_runtime104.jsx)(
|
|
20216
|
-
|
|
20217
|
-
|
|
20218
|
-
|
|
20240
|
+
/* @__PURE__ */ (0, import_jsx_runtime104.jsxs)("div", { className: "flex min-w-0 flex-1 flex-row items-center justify-between gap-2", children: [
|
|
20241
|
+
/* @__PURE__ */ (0, import_jsx_runtime104.jsx)(Tooltip, { tooltip: name, containerClassName: "min-w-0", children: /* @__PURE__ */ (0, import_jsx_runtime104.jsxs)("div", { className: "flex-row-1 items-center", children: [
|
|
20242
|
+
/* @__PURE__ */ (0, import_jsx_runtime104.jsx)("div", { "data-name": "property-title-icon", children: icon }),
|
|
20243
|
+
/* @__PURE__ */ (0, import_jsx_runtime104.jsx)("span", { "data-name": "property-title-text", children: name })
|
|
20244
|
+
] }) }),
|
|
20245
|
+
invalid && /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(import_lucide_react31.AlertTriangle, { className: "size-force-6 shrink-0" })
|
|
20246
|
+
] }),
|
|
20247
|
+
showActionsContainer && /* @__PURE__ */ (0, import_jsx_runtime104.jsx)("div", { "data-name": "property-title-actions", children: renderActionButtons() })
|
|
20219
20248
|
]
|
|
20220
20249
|
}
|
|
20221
20250
|
),
|
|
@@ -20226,35 +20255,11 @@ var PropertyBase = ({
|
|
|
20226
20255
|
"data-invalid": PropsUtil.dataAttributes.bool(invalid),
|
|
20227
20256
|
children: [
|
|
20228
20257
|
children({ required, hasValue, invalid }),
|
|
20229
|
-
showActionsContainer && /* @__PURE__ */ (0, import_jsx_runtime104.
|
|
20230
|
-
isClearEnabled && /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(
|
|
20231
|
-
IconButton,
|
|
20232
|
-
{
|
|
20233
|
-
tooltip: translation("clearValue"),
|
|
20234
|
-
onClick: onValueClear,
|
|
20235
|
-
disabled: !hasValue,
|
|
20236
|
-
color: "negative",
|
|
20237
|
-
coloringStyle: "text",
|
|
20238
|
-
size: "sm",
|
|
20239
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(import_lucide_react31.X, { className: "size-force-5" })
|
|
20240
|
-
}
|
|
20241
|
-
),
|
|
20242
|
-
isRemoveEnabled && /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(
|
|
20243
|
-
IconButton,
|
|
20244
|
-
{
|
|
20245
|
-
tooltip: translation("removeProperty"),
|
|
20246
|
-
onClick: onRemove,
|
|
20247
|
-
color: "negative",
|
|
20248
|
-
coloringStyle: "text",
|
|
20249
|
-
size: "sm",
|
|
20250
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(import_lucide_react31.Trash, { className: "size-force-5" })
|
|
20251
|
-
}
|
|
20252
|
-
)
|
|
20253
|
-
] })
|
|
20258
|
+
showActionsContainer && /* @__PURE__ */ (0, import_jsx_runtime104.jsx)("div", { "data-name": "property-actions", children: renderActionButtons() })
|
|
20254
20259
|
]
|
|
20255
20260
|
}
|
|
20256
20261
|
)
|
|
20257
|
-
]
|
|
20262
|
+
] })
|
|
20258
20263
|
}
|
|
20259
20264
|
);
|
|
20260
20265
|
};
|