@helpwave/hightide 0.1.15 → 0.1.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/dialogs/ConfirmDialog.js +10 -0
- package/dist/components/dialogs/ConfirmDialog.js.map +1 -1
- package/dist/components/dialogs/ConfirmDialog.mjs +10 -0
- package/dist/components/dialogs/ConfirmDialog.mjs.map +1 -1
- package/dist/components/layout-and-navigation/Overlay.js +10 -0
- package/dist/components/layout-and-navigation/Overlay.js.map +1 -1
- package/dist/components/layout-and-navigation/Overlay.mjs +10 -0
- package/dist/components/layout-and-navigation/Overlay.mjs.map +1 -1
- package/dist/components/layout-and-navigation/Pagination.js +18 -4
- package/dist/components/layout-and-navigation/Pagination.js.map +1 -1
- package/dist/components/layout-and-navigation/Pagination.mjs +18 -4
- package/dist/components/layout-and-navigation/Pagination.mjs.map +1 -1
- package/dist/components/layout-and-navigation/SearchableList.js +18 -4
- package/dist/components/layout-and-navigation/SearchableList.js.map +1 -1
- package/dist/components/layout-and-navigation/SearchableList.mjs +18 -4
- package/dist/components/layout-and-navigation/SearchableList.mjs.map +1 -1
- package/dist/components/layout-and-navigation/StepperBar.js +10 -0
- package/dist/components/layout-and-navigation/StepperBar.js.map +1 -1
- package/dist/components/layout-and-navigation/StepperBar.mjs +10 -0
- package/dist/components/layout-and-navigation/StepperBar.mjs.map +1 -1
- package/dist/components/layout-and-navigation/TextImage.js +10 -0
- package/dist/components/layout-and-navigation/TextImage.js.map +1 -1
- package/dist/components/layout-and-navigation/TextImage.mjs +10 -0
- package/dist/components/layout-and-navigation/TextImage.mjs.map +1 -1
- package/dist/components/loading-states/LoadingAndErrorComponent.js +10 -0
- package/dist/components/loading-states/LoadingAndErrorComponent.js.map +1 -1
- package/dist/components/loading-states/LoadingAndErrorComponent.mjs +10 -0
- package/dist/components/loading-states/LoadingAndErrorComponent.mjs.map +1 -1
- package/dist/components/loading-states/LoadingAnimation.js +10 -0
- package/dist/components/loading-states/LoadingAnimation.js.map +1 -1
- package/dist/components/loading-states/LoadingAnimation.mjs +10 -0
- package/dist/components/loading-states/LoadingAnimation.mjs.map +1 -1
- package/dist/components/modals/ConfirmModal.js +10 -0
- package/dist/components/modals/ConfirmModal.js.map +1 -1
- package/dist/components/modals/ConfirmModal.mjs +10 -0
- package/dist/components/modals/ConfirmModal.mjs.map +1 -1
- package/dist/components/modals/DiscardChangesModal.js +10 -0
- package/dist/components/modals/DiscardChangesModal.js.map +1 -1
- package/dist/components/modals/DiscardChangesModal.mjs +10 -0
- package/dist/components/modals/DiscardChangesModal.mjs.map +1 -1
- package/dist/components/modals/InputModal.js +18 -4
- package/dist/components/modals/InputModal.js.map +1 -1
- package/dist/components/modals/InputModal.mjs +18 -4
- package/dist/components/modals/InputModal.mjs.map +1 -1
- package/dist/components/modals/LanguageModal.js +18 -4
- package/dist/components/modals/LanguageModal.js.map +1 -1
- package/dist/components/modals/LanguageModal.mjs +18 -4
- package/dist/components/modals/LanguageModal.mjs.map +1 -1
- package/dist/components/modals/ThemeModal.js +18 -4
- package/dist/components/modals/ThemeModal.js.map +1 -1
- package/dist/components/modals/ThemeModal.mjs +18 -4
- package/dist/components/modals/ThemeModal.mjs.map +1 -1
- package/dist/components/properties/CheckboxProperty.js +10 -0
- package/dist/components/properties/CheckboxProperty.js.map +1 -1
- package/dist/components/properties/CheckboxProperty.mjs +10 -0
- package/dist/components/properties/CheckboxProperty.mjs.map +1 -1
- package/dist/components/properties/DateProperty.js +18 -4
- package/dist/components/properties/DateProperty.js.map +1 -1
- package/dist/components/properties/DateProperty.mjs +18 -4
- package/dist/components/properties/DateProperty.mjs.map +1 -1
- package/dist/components/properties/MultiSelectProperty.js +18 -4
- package/dist/components/properties/MultiSelectProperty.js.map +1 -1
- package/dist/components/properties/MultiSelectProperty.mjs +18 -4
- package/dist/components/properties/MultiSelectProperty.mjs.map +1 -1
- package/dist/components/properties/NumberProperty.js +18 -4
- package/dist/components/properties/NumberProperty.js.map +1 -1
- package/dist/components/properties/NumberProperty.mjs +18 -4
- package/dist/components/properties/NumberProperty.mjs.map +1 -1
- package/dist/components/properties/PropertyBase.js +10 -0
- package/dist/components/properties/PropertyBase.js.map +1 -1
- package/dist/components/properties/PropertyBase.mjs +10 -0
- package/dist/components/properties/PropertyBase.mjs.map +1 -1
- package/dist/components/properties/SelectProperty.js +18 -4
- package/dist/components/properties/SelectProperty.js.map +1 -1
- package/dist/components/properties/SelectProperty.mjs +18 -4
- package/dist/components/properties/SelectProperty.mjs.map +1 -1
- package/dist/components/properties/TextProperty.js +18 -4
- package/dist/components/properties/TextProperty.js.map +1 -1
- package/dist/components/properties/TextProperty.mjs +18 -4
- package/dist/components/properties/TextProperty.mjs.map +1 -1
- package/dist/components/table/Table.d.mts +2 -1
- package/dist/components/table/Table.d.ts +2 -1
- package/dist/components/table/Table.js +27 -7
- package/dist/components/table/Table.js.map +1 -1
- package/dist/components/table/Table.mjs +27 -7
- package/dist/components/table/Table.mjs.map +1 -1
- package/dist/components/table/TableFilterButton.js +18 -4
- package/dist/components/table/TableFilterButton.js.map +1 -1
- package/dist/components/table/TableFilterButton.mjs +18 -4
- package/dist/components/table/TableFilterButton.mjs.map +1 -1
- package/dist/components/user-action/CopyToClipboardWrapper.d.mts +30 -0
- package/dist/components/user-action/CopyToClipboardWrapper.d.ts +30 -0
- package/dist/components/user-action/CopyToClipboardWrapper.js +324 -0
- package/dist/components/user-action/CopyToClipboardWrapper.js.map +1 -0
- package/dist/components/user-action/CopyToClipboardWrapper.mjs +300 -0
- package/dist/components/user-action/CopyToClipboardWrapper.mjs.map +1 -0
- package/dist/components/user-action/DateAndTimePicker.js +10 -0
- package/dist/components/user-action/DateAndTimePicker.js.map +1 -1
- package/dist/components/user-action/DateAndTimePicker.mjs +10 -0
- package/dist/components/user-action/DateAndTimePicker.mjs.map +1 -1
- package/dist/components/user-action/Input.js +8 -4
- package/dist/components/user-action/Input.js.map +1 -1
- package/dist/components/user-action/Input.mjs +8 -4
- package/dist/components/user-action/Input.mjs.map +1 -1
- package/dist/components/user-action/MultiSelect.js +18 -4
- package/dist/components/user-action/MultiSelect.js.map +1 -1
- package/dist/components/user-action/MultiSelect.mjs +18 -4
- package/dist/components/user-action/MultiSelect.mjs.map +1 -1
- package/dist/components/user-action/Select.js +18 -4
- package/dist/components/user-action/Select.js.map +1 -1
- package/dist/components/user-action/Select.mjs +18 -4
- package/dist/components/user-action/Select.mjs.map +1 -1
- package/dist/components/user-action/Textarea.js +8 -4
- package/dist/components/user-action/Textarea.js.map +1 -1
- package/dist/components/user-action/Textarea.mjs +8 -4
- package/dist/components/user-action/Textarea.mjs.map +1 -1
- package/dist/components/user-action/ToggleableInput.js +8 -4
- package/dist/components/user-action/ToggleableInput.js.map +1 -1
- package/dist/components/user-action/ToggleableInput.mjs +8 -4
- package/dist/components/user-action/ToggleableInput.mjs.map +1 -1
- package/dist/components/user-action/Tooltip.d.mts +1 -1
- package/dist/components/user-action/Tooltip.d.ts +1 -1
- package/dist/components/user-action/Tooltip.js.map +1 -1
- package/dist/components/user-action/Tooltip.mjs.map +1 -1
- package/dist/css/globals.css +18 -21
- package/dist/css/uncompiled/utitlity/animation.css +4 -28
- package/dist/hooks/useDelay.d.mts +1 -0
- package/dist/hooks/useDelay.d.ts +1 -0
- package/dist/hooks/useDelay.js +8 -4
- package/dist/hooks/useDelay.js.map +1 -1
- package/dist/hooks/useDelay.mjs +8 -4
- package/dist/hooks/useDelay.mjs.map +1 -1
- package/dist/index.d.mts +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +176 -54
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +163 -43
- package/dist/index.mjs.map +1 -1
- package/dist/localization/defaults/form.d.mts +5 -0
- package/dist/localization/defaults/form.d.ts +5 -0
- package/dist/localization/defaults/form.js +10 -0
- package/dist/localization/defaults/form.js.map +1 -1
- package/dist/localization/defaults/form.mjs +10 -0
- package/dist/localization/defaults/form.mjs.map +1 -1
- package/dist/util/writeToClipboard.d.mts +3 -0
- package/dist/util/writeToClipboard.d.ts +3 -0
- package/dist/util/writeToClipboard.js +32 -0
- package/dist/util/writeToClipboard.js.map +1 -0
- package/dist/util/writeToClipboard.mjs +8 -0
- package/dist/util/writeToClipboard.mjs.map +1 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2858,6 +2858,7 @@ __export(index_exports, {
|
|
|
2858
2858
|
Circle: () => Circle,
|
|
2859
2859
|
ConfirmDialog: () => ConfirmDialog,
|
|
2860
2860
|
ConfirmModal: () => ConfirmModal,
|
|
2861
|
+
CopyToClipboardWrapper: () => CopyToClipboardWrapper,
|
|
2861
2862
|
DatePicker: () => DatePicker,
|
|
2862
2863
|
DatePickerUncontrolled: () => DatePickerUncontrolled,
|
|
2863
2864
|
DateProperty: () => DateProperty,
|
|
@@ -2995,7 +2996,8 @@ __export(index_exports, {
|
|
|
2995
2996
|
useTheme: () => useTheme,
|
|
2996
2997
|
useTranslation: () => useTranslation,
|
|
2997
2998
|
validateEmail: () => validateEmail,
|
|
2998
|
-
weekDayList: () => weekDayList
|
|
2999
|
+
weekDayList: () => weekDayList,
|
|
3000
|
+
writeToClipboard: () => writeToClipboard
|
|
2999
3001
|
});
|
|
3000
3002
|
module.exports = __toCommonJS(index_exports);
|
|
3001
3003
|
|
|
@@ -4625,8 +4627,12 @@ var formTranslation = {
|
|
|
4625
4627
|
cancel: "Cancel",
|
|
4626
4628
|
change: "Change",
|
|
4627
4629
|
clear: "Clear",
|
|
4630
|
+
click: "Click",
|
|
4631
|
+
clickToCopy: "Click to Copy",
|
|
4628
4632
|
close: "Close",
|
|
4629
4633
|
confirm: "Confirm",
|
|
4634
|
+
copy: "Copy",
|
|
4635
|
+
copied: "Copied",
|
|
4630
4636
|
decline: "Decline",
|
|
4631
4637
|
delete: "Delete",
|
|
4632
4638
|
discard: "Discard",
|
|
@@ -4654,6 +4660,7 @@ var formTranslation = {
|
|
|
4654
4660
|
required: "Required",
|
|
4655
4661
|
reset: "Reset",
|
|
4656
4662
|
save: "Save",
|
|
4663
|
+
saved: "Saved",
|
|
4657
4664
|
search: "Search",
|
|
4658
4665
|
select: "Select",
|
|
4659
4666
|
selectOption: "Select an option",
|
|
@@ -4674,8 +4681,12 @@ var formTranslation = {
|
|
|
4674
4681
|
cancel: "Abbrechen",
|
|
4675
4682
|
change: "\xC4ndern",
|
|
4676
4683
|
clear: "L\xF6schen",
|
|
4684
|
+
click: "Klicken",
|
|
4685
|
+
clickToCopy: "Zum kopieren klicken",
|
|
4677
4686
|
close: "Schlie\xDFen",
|
|
4678
4687
|
confirm: "Best\xE4tigen",
|
|
4688
|
+
copy: "Kopieren",
|
|
4689
|
+
copied: "Kopiert",
|
|
4679
4690
|
decline: "Ablehnen",
|
|
4680
4691
|
delete: "L\xF6schen",
|
|
4681
4692
|
discard: "Verwerfen",
|
|
@@ -4703,6 +4714,7 @@ var formTranslation = {
|
|
|
4703
4714
|
required: "Erforderlich",
|
|
4704
4715
|
reset: "Zur\xFCcksetzen",
|
|
4705
4716
|
save: "Speichern",
|
|
4717
|
+
saved: "Gespeichert",
|
|
4706
4718
|
search: "Suche",
|
|
4707
4719
|
select: "Select",
|
|
4708
4720
|
selectOption: "Option ausw\xE4hlen",
|
|
@@ -6153,6 +6165,10 @@ function useDelay(options) {
|
|
|
6153
6165
|
...defaultOptions,
|
|
6154
6166
|
...options
|
|
6155
6167
|
};
|
|
6168
|
+
const clearTimer = () => {
|
|
6169
|
+
clearTimeout(timer);
|
|
6170
|
+
setTimer(void 0);
|
|
6171
|
+
};
|
|
6156
6172
|
const restartTimer = (onDelayFinish) => {
|
|
6157
6173
|
if (disabled) {
|
|
6158
6174
|
return;
|
|
@@ -6160,11 +6176,9 @@ function useDelay(options) {
|
|
|
6160
6176
|
clearTimeout(timer);
|
|
6161
6177
|
setTimer(setTimeout(() => {
|
|
6162
6178
|
onDelayFinish();
|
|
6179
|
+
setTimer(void 0);
|
|
6163
6180
|
}, delay));
|
|
6164
6181
|
};
|
|
6165
|
-
const clearTimer = () => {
|
|
6166
|
-
clearTimeout(timer);
|
|
6167
|
-
};
|
|
6168
6182
|
(0, import_react12.useEffect)(() => {
|
|
6169
6183
|
return () => {
|
|
6170
6184
|
clearTimeout(timer);
|
|
@@ -6173,9 +6187,11 @@ function useDelay(options) {
|
|
|
6173
6187
|
(0, import_react12.useEffect)(() => {
|
|
6174
6188
|
if (disabled) {
|
|
6175
6189
|
clearTimeout(timer);
|
|
6190
|
+
setTimer(void 0);
|
|
6176
6191
|
}
|
|
6177
6192
|
}, [disabled, timer]);
|
|
6178
|
-
|
|
6193
|
+
console.log(timer);
|
|
6194
|
+
return { restartTimer, clearTimer, hasActiveTimer: !!timer };
|
|
6179
6195
|
}
|
|
6180
6196
|
|
|
6181
6197
|
// src/components/user-action/Label.tsx
|
|
@@ -8653,6 +8669,7 @@ var TableWithSelection = ({
|
|
|
8653
8669
|
state,
|
|
8654
8670
|
fillerRow,
|
|
8655
8671
|
rowSelection,
|
|
8672
|
+
disableClickRowClickSelection = false,
|
|
8656
8673
|
selectionRowId = "selection",
|
|
8657
8674
|
onRowClick = noop,
|
|
8658
8675
|
meta,
|
|
@@ -8710,21 +8727,124 @@ var TableWithSelection = ({
|
|
|
8710
8727
|
...state
|
|
8711
8728
|
},
|
|
8712
8729
|
onRowClick: (row, table) => {
|
|
8713
|
-
|
|
8730
|
+
if (!disableClickRowClickSelection) {
|
|
8731
|
+
row.toggleSelected();
|
|
8732
|
+
}
|
|
8714
8733
|
onRowClick(row, table);
|
|
8715
8734
|
},
|
|
8716
8735
|
meta: {
|
|
8717
|
-
|
|
8718
|
-
|
|
8736
|
+
...meta,
|
|
8737
|
+
bodyRowClassName: (0, import_clsx45.default)(
|
|
8738
|
+
{ "cursor-pointer": !disableClickRowClickSelection },
|
|
8739
|
+
meta?.bodyRowClassName
|
|
8740
|
+
)
|
|
8719
8741
|
},
|
|
8720
8742
|
...props
|
|
8721
8743
|
}
|
|
8722
8744
|
);
|
|
8723
8745
|
};
|
|
8724
8746
|
|
|
8725
|
-
// src/components/user-action/
|
|
8726
|
-
var
|
|
8747
|
+
// src/components/user-action/CopyToClipboardWrapper.tsx
|
|
8748
|
+
var import_react30 = require("react");
|
|
8749
|
+
var import_clsx46 = require("clsx");
|
|
8750
|
+
|
|
8751
|
+
// src/util/writeToClipboard.ts
|
|
8752
|
+
var writeToClipboard = (text) => {
|
|
8753
|
+
return navigator.clipboard.writeText(text);
|
|
8754
|
+
};
|
|
8755
|
+
|
|
8756
|
+
// src/components/user-action/CopyToClipboardWrapper.tsx
|
|
8757
|
+
var import_lucide_react23 = require("lucide-react");
|
|
8727
8758
|
var import_jsx_runtime60 = require("react/jsx-runtime");
|
|
8759
|
+
var CopyToClipboardWrapper = ({
|
|
8760
|
+
children,
|
|
8761
|
+
textToCopy,
|
|
8762
|
+
tooltipClassName = "",
|
|
8763
|
+
containerClassName = "",
|
|
8764
|
+
position = "bottom",
|
|
8765
|
+
zIndex = 10
|
|
8766
|
+
}) => {
|
|
8767
|
+
const translation = useTranslation([formTranslation]);
|
|
8768
|
+
const [isShowingIndication, setIsShowingIndication] = (0, import_react30.useState)(false);
|
|
8769
|
+
const [isShowingConfirmation, setIsShowingConfirmation] = (0, import_react30.useState)(false);
|
|
8770
|
+
const positionClasses = {
|
|
8771
|
+
top: `bottom-full left-1/2 -translate-x-1/2 mb-[6px]`,
|
|
8772
|
+
bottom: `top-full left-1/2 -translate-x-1/2 mt-[6px]`,
|
|
8773
|
+
left: `right-full top-1/2 -translate-y-1/2 mr-[6px]`,
|
|
8774
|
+
right: `left-full top-1/2 -translate-y-1/2 ml-[6px]`
|
|
8775
|
+
};
|
|
8776
|
+
const triangleSize = 6;
|
|
8777
|
+
const triangleClasses = {
|
|
8778
|
+
top: `top-full left-1/2 -translate-x-1/2 border-t-tooltip-background border-l-transparent border-r-transparent`,
|
|
8779
|
+
bottom: `bottom-full left-1/2 -translate-x-1/2 border-b-tooltip-background border-l-transparent border-r-transparent`,
|
|
8780
|
+
left: `left-full top-1/2 -translate-y-1/2 border-l-tooltip-background border-t-transparent border-b-transparent`,
|
|
8781
|
+
right: `right-full top-1/2 -translate-y-1/2 border-r-tooltip-background border-t-transparent border-b-transparent`
|
|
8782
|
+
};
|
|
8783
|
+
const triangleStyle = {
|
|
8784
|
+
top: { borderWidth: `${triangleSize}px ${triangleSize}px 0 ${triangleSize}px` },
|
|
8785
|
+
bottom: { borderWidth: `0 ${triangleSize}px ${triangleSize}px ${triangleSize}px` },
|
|
8786
|
+
left: { borderWidth: `${triangleSize}px 0 ${triangleSize}px ${triangleSize}px` },
|
|
8787
|
+
right: { borderWidth: `${triangleSize}px ${triangleSize}px ${triangleSize}px 0` }
|
|
8788
|
+
};
|
|
8789
|
+
return /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(
|
|
8790
|
+
"div",
|
|
8791
|
+
{
|
|
8792
|
+
className: (0, import_clsx46.clsx)("relative inline-block cursor-copy", containerClassName),
|
|
8793
|
+
onMouseEnter: () => {
|
|
8794
|
+
setIsShowingIndication(true);
|
|
8795
|
+
},
|
|
8796
|
+
onMouseLeave: () => {
|
|
8797
|
+
setIsShowingIndication(false);
|
|
8798
|
+
setIsShowingConfirmation(false);
|
|
8799
|
+
},
|
|
8800
|
+
onClick: () => {
|
|
8801
|
+
writeToClipboard(textToCopy).catch(console.error);
|
|
8802
|
+
setIsShowingIndication(false);
|
|
8803
|
+
setIsShowingConfirmation(true);
|
|
8804
|
+
},
|
|
8805
|
+
children: [
|
|
8806
|
+
children,
|
|
8807
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(
|
|
8808
|
+
"div",
|
|
8809
|
+
{
|
|
8810
|
+
className: (0, import_clsx46.clsx)(
|
|
8811
|
+
`absolute text-xs font-semibold text-tooltip-text px-2 py-1 rounded whitespace-nowrap
|
|
8812
|
+
shadow-around-md bg-tooltip-background cursor-default pointer-events-none`,
|
|
8813
|
+
"transition-opacity duration-200",
|
|
8814
|
+
positionClasses[position],
|
|
8815
|
+
tooltipClassName
|
|
8816
|
+
),
|
|
8817
|
+
style: {
|
|
8818
|
+
zIndex,
|
|
8819
|
+
opacity: isShowingIndication || isShowingConfirmation ? 1 : 0
|
|
8820
|
+
},
|
|
8821
|
+
children: [
|
|
8822
|
+
isShowingConfirmation && /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("div", { className: "row gap-x-1", children: [
|
|
8823
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)(import_lucide_react23.CheckIcon, { size: 16, className: "text-positive" }),
|
|
8824
|
+
translation("copied")
|
|
8825
|
+
] }),
|
|
8826
|
+
isShowingIndication && /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("div", { className: "row gap-x-1 text-description", children: [
|
|
8827
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)(import_lucide_react23.Copy, { size: 16 }),
|
|
8828
|
+
translation("clickToCopy")
|
|
8829
|
+
] }),
|
|
8830
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
8831
|
+
"div",
|
|
8832
|
+
{
|
|
8833
|
+
className: (0, import_clsx46.clsx)(`absolute w-0 h-0`, triangleClasses[position]),
|
|
8834
|
+
style: { ...triangleStyle[position], zIndex: zIndex + 1 }
|
|
8835
|
+
}
|
|
8836
|
+
)
|
|
8837
|
+
]
|
|
8838
|
+
}
|
|
8839
|
+
)
|
|
8840
|
+
]
|
|
8841
|
+
}
|
|
8842
|
+
);
|
|
8843
|
+
};
|
|
8844
|
+
|
|
8845
|
+
// src/components/user-action/DateAndTimePicker.tsx
|
|
8846
|
+
var import_clsx47 = __toESM(require("clsx"));
|
|
8847
|
+
var import_jsx_runtime61 = require("react/jsx-runtime");
|
|
8728
8848
|
var DateTimePicker = ({
|
|
8729
8849
|
overwriteTranslation,
|
|
8730
8850
|
value = /* @__PURE__ */ new Date(),
|
|
@@ -8743,7 +8863,7 @@ var DateTimePicker = ({
|
|
|
8743
8863
|
let dateDisplay;
|
|
8744
8864
|
let timeDisplay;
|
|
8745
8865
|
if (useDate) {
|
|
8746
|
-
dateDisplay = /* @__PURE__ */ (0,
|
|
8866
|
+
dateDisplay = /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
8747
8867
|
DatePicker,
|
|
8748
8868
|
{
|
|
8749
8869
|
...datePickerProps,
|
|
@@ -8757,25 +8877,25 @@ var DateTimePicker = ({
|
|
|
8757
8877
|
);
|
|
8758
8878
|
}
|
|
8759
8879
|
if (useTime) {
|
|
8760
|
-
timeDisplay = /* @__PURE__ */ (0,
|
|
8880
|
+
timeDisplay = /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
8761
8881
|
TimePicker,
|
|
8762
8882
|
{
|
|
8763
8883
|
...timePickerProps,
|
|
8764
|
-
className: (0,
|
|
8884
|
+
className: (0, import_clsx47.default)("h-full", { "justify-between w-full": mode === "time" }),
|
|
8765
8885
|
maxHeight: 250,
|
|
8766
8886
|
time: value,
|
|
8767
8887
|
onChange
|
|
8768
8888
|
}
|
|
8769
8889
|
);
|
|
8770
8890
|
}
|
|
8771
|
-
return /* @__PURE__ */ (0,
|
|
8772
|
-
/* @__PURE__ */ (0,
|
|
8891
|
+
return /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("div", { className: "col w-fit", children: [
|
|
8892
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("div", { className: "row gap-x-4", children: [
|
|
8773
8893
|
dateDisplay,
|
|
8774
8894
|
timeDisplay
|
|
8775
8895
|
] }),
|
|
8776
|
-
/* @__PURE__ */ (0,
|
|
8777
|
-
/* @__PURE__ */ (0,
|
|
8778
|
-
/* @__PURE__ */ (0,
|
|
8896
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("div", { className: "row justify-end", children: /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("div", { className: "row gap-x-2 mt-1", children: [
|
|
8897
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)(SolidButton, { size: "medium", color: "negative", onClick: onRemove, children: translation("clear") }),
|
|
8898
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
8779
8899
|
SolidButton,
|
|
8780
8900
|
{
|
|
8781
8901
|
size: "medium",
|
|
@@ -8788,9 +8908,9 @@ var DateTimePicker = ({
|
|
|
8788
8908
|
};
|
|
8789
8909
|
|
|
8790
8910
|
// src/components/user-action/ScrollPicker.tsx
|
|
8791
|
-
var
|
|
8792
|
-
var
|
|
8793
|
-
var
|
|
8911
|
+
var import_react31 = require("react");
|
|
8912
|
+
var import_clsx48 = __toESM(require("clsx"));
|
|
8913
|
+
var import_jsx_runtime62 = require("react/jsx-runtime");
|
|
8794
8914
|
var up = 1;
|
|
8795
8915
|
var down = -1;
|
|
8796
8916
|
var ScrollPicker = ({
|
|
@@ -8809,7 +8929,7 @@ var ScrollPicker = ({
|
|
|
8809
8929
|
transition,
|
|
8810
8930
|
items,
|
|
8811
8931
|
lastTimeStamp
|
|
8812
|
-
}, setAnimation] = (0,
|
|
8932
|
+
}, setAnimation] = (0, import_react31.useState)({
|
|
8813
8933
|
targetIndex: selectedIndex,
|
|
8814
8934
|
currentIndex: disabled ? selectedIndex : 0,
|
|
8815
8935
|
velocity: 0,
|
|
@@ -8825,7 +8945,7 @@ var ScrollPicker = ({
|
|
|
8825
8945
|
const itemHeight = 40;
|
|
8826
8946
|
const distance = 8;
|
|
8827
8947
|
const containerHeight = itemHeight * (itemsShownCount - 2) + distance * (itemsShownCount - 2 + 1);
|
|
8828
|
-
const getDirection = (0,
|
|
8948
|
+
const getDirection = (0, import_react31.useCallback)((targetIndex, currentIndex2, transition2, length) => {
|
|
8829
8949
|
if (targetIndex === currentIndex2) {
|
|
8830
8950
|
return transition2 > 0 ? up : down;
|
|
8831
8951
|
}
|
|
@@ -8835,7 +8955,7 @@ var ScrollPicker = ({
|
|
|
8835
8955
|
}
|
|
8836
8956
|
return distanceForward >= length / 2 ? down : up;
|
|
8837
8957
|
}, []);
|
|
8838
|
-
const animate = (0,
|
|
8958
|
+
const animate = (0, import_react31.useCallback)((timestamp, startTime) => {
|
|
8839
8959
|
setAnimation((prevState) => {
|
|
8840
8960
|
const {
|
|
8841
8961
|
targetIndex,
|
|
@@ -8908,7 +9028,7 @@ var ScrollPicker = ({
|
|
|
8908
9028
|
};
|
|
8909
9029
|
});
|
|
8910
9030
|
}, [disabled, getDirection, onChange]);
|
|
8911
|
-
(0,
|
|
9031
|
+
(0, import_react31.useEffect)(() => {
|
|
8912
9032
|
requestAnimationFrame((timestamp) => animate(timestamp, lastTimeStamp));
|
|
8913
9033
|
});
|
|
8914
9034
|
const opacity = (transition2, index, itemsCount) => {
|
|
@@ -8929,7 +9049,7 @@ var ScrollPicker = ({
|
|
|
8929
9049
|
}
|
|
8930
9050
|
return clamp(1 - opacityValue / max);
|
|
8931
9051
|
};
|
|
8932
|
-
return /* @__PURE__ */ (0,
|
|
9052
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
8933
9053
|
"div",
|
|
8934
9054
|
{
|
|
8935
9055
|
className: "relative overflow-hidden",
|
|
@@ -8939,15 +9059,15 @@ var ScrollPicker = ({
|
|
|
8939
9059
|
setAnimation(({ velocity, ...animationData }) => ({ ...animationData, velocity: velocity + event.deltaY }));
|
|
8940
9060
|
}
|
|
8941
9061
|
},
|
|
8942
|
-
children: /* @__PURE__ */ (0,
|
|
8943
|
-
/* @__PURE__ */ (0,
|
|
9062
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("div", { className: "absolute top-1/2 -translate-y-1/2 -translate-x-1/2 left-1/2", children: [
|
|
9063
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
8944
9064
|
"div",
|
|
8945
9065
|
{
|
|
8946
9066
|
className: "absolute z-[1] top-1/2 -translate-y-1/2 -translate-x-1/2 left-1/2 w-full min-w-[40px] border border-divider/30 border-y-2 border-x-0 ",
|
|
8947
9067
|
style: { height: `${itemHeight}px` }
|
|
8948
9068
|
}
|
|
8949
9069
|
),
|
|
8950
|
-
/* @__PURE__ */ (0,
|
|
9070
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
8951
9071
|
"div",
|
|
8952
9072
|
{
|
|
8953
9073
|
className: "col select-none",
|
|
@@ -8955,10 +9075,10 @@ var ScrollPicker = ({
|
|
|
8955
9075
|
transform: `translateY(${-transition * (distance + itemHeight)}px)`,
|
|
8956
9076
|
columnGap: `${distance}px`
|
|
8957
9077
|
},
|
|
8958
|
-
children: shownItems.map(({ name, index }, arrayIndex) => /* @__PURE__ */ (0,
|
|
9078
|
+
children: shownItems.map(({ name, index }, arrayIndex) => /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
8959
9079
|
"div",
|
|
8960
9080
|
{
|
|
8961
|
-
className: (0,
|
|
9081
|
+
className: (0, import_clsx48.default)(
|
|
8962
9082
|
`col items-center justify-center rounded-md`,
|
|
8963
9083
|
{
|
|
8964
9084
|
"text-primary font-bold": currentIndex === index,
|
|
@@ -8985,10 +9105,10 @@ var ScrollPicker = ({
|
|
|
8985
9105
|
};
|
|
8986
9106
|
|
|
8987
9107
|
// src/components/user-action/ToggleableInput.tsx
|
|
8988
|
-
var
|
|
8989
|
-
var
|
|
8990
|
-
var
|
|
8991
|
-
var
|
|
9108
|
+
var import_react32 = require("react");
|
|
9109
|
+
var import_lucide_react24 = require("lucide-react");
|
|
9110
|
+
var import_clsx49 = __toESM(require("clsx"));
|
|
9111
|
+
var import_jsx_runtime63 = require("react/jsx-runtime");
|
|
8992
9112
|
var ToggleableInput = ({
|
|
8993
9113
|
type = "text",
|
|
8994
9114
|
value,
|
|
@@ -9003,26 +9123,26 @@ var ToggleableInput = ({
|
|
|
9003
9123
|
saveDelayOptions,
|
|
9004
9124
|
...restProps
|
|
9005
9125
|
}) => {
|
|
9006
|
-
const [isEditing, setIsEditing] = (0,
|
|
9126
|
+
const [isEditing, setIsEditing] = (0, import_react32.useState)(initialState !== "display");
|
|
9007
9127
|
const { restartTimer, clearTimer } = useDelay(saveDelayOptions);
|
|
9008
|
-
const ref = (0,
|
|
9128
|
+
const ref = (0, import_react32.useRef)(null);
|
|
9009
9129
|
const onEditCompletedWrapper = (text) => {
|
|
9010
9130
|
onEditCompleted(text);
|
|
9011
9131
|
clearTimer();
|
|
9012
9132
|
};
|
|
9013
|
-
(0,
|
|
9133
|
+
(0, import_react32.useEffect)(() => {
|
|
9014
9134
|
if (isEditing) {
|
|
9015
9135
|
ref.current?.focus();
|
|
9016
9136
|
}
|
|
9017
9137
|
}, [isEditing]);
|
|
9018
|
-
return /* @__PURE__ */ (0,
|
|
9019
|
-
/* @__PURE__ */ (0,
|
|
9138
|
+
return /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("div", { children: [
|
|
9139
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsxs)(
|
|
9020
9140
|
"div",
|
|
9021
9141
|
{
|
|
9022
|
-
className: (0,
|
|
9142
|
+
className: (0, import_clsx49.default)("row items-center w-full gap-x-2 overflow-hidden", { "cursor-pointer": !isEditing }),
|
|
9023
9143
|
onClick: () => !isEditing ? setIsEditing(!isEditing) : void 0,
|
|
9024
9144
|
children: [
|
|
9025
|
-
/* @__PURE__ */ (0,
|
|
9145
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)("div", { className: (0, import_clsx49.default)("row overflow-hidden", { "flex-1": isEditing }), children: isEditing ? /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
|
|
9026
9146
|
"input",
|
|
9027
9147
|
{
|
|
9028
9148
|
ref,
|
|
@@ -9050,16 +9170,16 @@ var ToggleableInput = ({
|
|
|
9050
9170
|
onEditCompletedWrapper(value);
|
|
9051
9171
|
}
|
|
9052
9172
|
},
|
|
9053
|
-
className: (0,
|
|
9173
|
+
className: (0, import_clsx49.default)(`w-full border-none rounded-none ring-0 outline-0 text-inherit bg-inherit shadow-transparent decoration-primary p-0 underline-offset-4`, {
|
|
9054
9174
|
underline: isEditing
|
|
9055
9175
|
}, labelClassName),
|
|
9056
9176
|
onFocus: (event) => event.target.select()
|
|
9057
9177
|
}
|
|
9058
|
-
) : /* @__PURE__ */ (0,
|
|
9059
|
-
/* @__PURE__ */ (0,
|
|
9060
|
-
|
|
9178
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("span", { className: (0, import_clsx49.default)("max-w-xs break-words overflow-hidden", labelClassName), children: value }) }),
|
|
9179
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
|
|
9180
|
+
import_lucide_react24.Pencil,
|
|
9061
9181
|
{
|
|
9062
|
-
className: (0,
|
|
9182
|
+
className: (0, import_clsx49.default)(`cursor-pointer`, { "text-transparent": isEditing }),
|
|
9063
9183
|
size,
|
|
9064
9184
|
style: { minWidth: `${size}px` }
|
|
9065
9185
|
}
|
|
@@ -9067,7 +9187,7 @@ var ToggleableInput = ({
|
|
|
9067
9187
|
]
|
|
9068
9188
|
}
|
|
9069
9189
|
),
|
|
9070
|
-
isEditing && disclaimer && /* @__PURE__ */ (0,
|
|
9190
|
+
isEditing && disclaimer && /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("label", { className: "text-negative", children: disclaimer })
|
|
9071
9191
|
] });
|
|
9072
9192
|
};
|
|
9073
9193
|
var ToggleableInputUncontrolled = ({
|
|
@@ -9075,11 +9195,11 @@ var ToggleableInputUncontrolled = ({
|
|
|
9075
9195
|
onChangeText = noop,
|
|
9076
9196
|
...restProps
|
|
9077
9197
|
}) => {
|
|
9078
|
-
const [value, setValue] = (0,
|
|
9079
|
-
(0,
|
|
9198
|
+
const [value, setValue] = (0, import_react32.useState)(initialValue);
|
|
9199
|
+
(0, import_react32.useEffect)(() => {
|
|
9080
9200
|
setValue(initialValue);
|
|
9081
9201
|
}, [initialValue]);
|
|
9082
|
-
return /* @__PURE__ */ (0,
|
|
9202
|
+
return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
|
|
9083
9203
|
ToggleableInput,
|
|
9084
9204
|
{
|
|
9085
9205
|
value,
|
|
@@ -9093,9 +9213,9 @@ var ToggleableInputUncontrolled = ({
|
|
|
9093
9213
|
};
|
|
9094
9214
|
|
|
9095
9215
|
// src/hooks/useRerender.ts
|
|
9096
|
-
var
|
|
9216
|
+
var import_react33 = require("react");
|
|
9097
9217
|
var useRerender = () => {
|
|
9098
|
-
return (0,
|
|
9218
|
+
return (0, import_react33.useReducer)(() => ({}), {})[1];
|
|
9099
9219
|
};
|
|
9100
9220
|
|
|
9101
9221
|
// src/util/builder.ts
|
|
@@ -9161,6 +9281,7 @@ function resolveSetState(action, prev) {
|
|
|
9161
9281
|
Circle,
|
|
9162
9282
|
ConfirmDialog,
|
|
9163
9283
|
ConfirmModal,
|
|
9284
|
+
CopyToClipboardWrapper,
|
|
9164
9285
|
DatePicker,
|
|
9165
9286
|
DatePickerUncontrolled,
|
|
9166
9287
|
DateProperty,
|
|
@@ -9298,6 +9419,7 @@ function resolveSetState(action, prev) {
|
|
|
9298
9419
|
useTheme,
|
|
9299
9420
|
useTranslation,
|
|
9300
9421
|
validateEmail,
|
|
9301
|
-
weekDayList
|
|
9422
|
+
weekDayList,
|
|
9423
|
+
writeToClipboard
|
|
9302
9424
|
});
|
|
9303
9425
|
//# sourceMappingURL=index.js.map
|