paket-ui 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +72 -0
- package/dist/module.d.mts +10 -0
- package/dist/module.json +13 -0
- package/dist/module.mjs +46 -0
- package/dist/runtime/components/ProgressIndicator/ProgressBase.vue +36 -0
- package/dist/runtime/components/ProgressIndicator/ProgressBase.vue.d.ts +8 -0
- package/dist/runtime/components/ProgressIndicator/ProgressIndicator.vue +46 -0
- package/dist/runtime/components/ProgressIndicator/ProgressIndicator.vue.d.ts +9 -0
- package/dist/runtime/components/Recorder/RecorderAudio.vue +136 -0
- package/dist/runtime/components/Recorder/RecorderAudio.vue.d.ts +11 -0
- package/dist/runtime/components/alert/AlertHelperForm.vue +22 -0
- package/dist/runtime/components/alert/AlertHelperForm.vue.d.ts +13 -0
- package/dist/runtime/components/alert/AlertPinLocation.vue +57 -0
- package/dist/runtime/components/alert/AlertPinLocation.vue.d.ts +13 -0
- package/dist/runtime/components/alert/BaseAlert.vue +54 -0
- package/dist/runtime/components/alert/BaseAlert.vue.d.ts +34 -0
- package/dist/runtime/components/alert/index.d.ts +20 -0
- package/dist/runtime/components/alert/index.js +20 -0
- package/dist/runtime/components/attachment/BaseAttachment.vue +52 -0
- package/dist/runtime/components/attachment/BaseAttachment.vue.d.ts +24 -0
- package/dist/runtime/components/attachment/ChipAttachment.vue +57 -0
- package/dist/runtime/components/attachment/ChipAttachment.vue.d.ts +28 -0
- package/dist/runtime/components/attachment/index.d.ts +15 -0
- package/dist/runtime/components/attachment/index.js +15 -0
- package/dist/runtime/components/avatar/BaseAvatar.vue +41 -0
- package/dist/runtime/components/avatar/BaseAvatar.vue.d.ts +31 -0
- package/dist/runtime/components/avatar/IconAvatar.vue +28 -0
- package/dist/runtime/components/avatar/IconAvatar.vue.d.ts +18 -0
- package/dist/runtime/components/avatar/index.d.ts +27 -0
- package/dist/runtime/components/avatar/index.js +27 -0
- package/dist/runtime/components/badge/BaseBadge.vue +26 -0
- package/dist/runtime/components/badge/BaseBadge.vue.d.ts +17 -0
- package/dist/runtime/components/badge/IconBadge.vue +37 -0
- package/dist/runtime/components/badge/IconBadge.vue.d.ts +23 -0
- package/dist/runtime/components/badge/index.d.ts +45 -0
- package/dist/runtime/components/badge/index.js +45 -0
- package/dist/runtime/components/badge/location.vue +18 -0
- package/dist/runtime/components/badge/location.vue.d.ts +5 -0
- package/dist/runtime/components/button/BaseButton.vue +32 -0
- package/dist/runtime/components/button/BaseButton.vue.d.ts +16 -0
- package/dist/runtime/components/button/ButtonApplyVoucher.vue +32 -0
- package/dist/runtime/components/button/ButtonApplyVoucher.vue.d.ts +11 -0
- package/dist/runtime/components/button/IconButton.vue +44 -0
- package/dist/runtime/components/button/IconButton.vue.d.ts +27 -0
- package/dist/runtime/components/button/LinkButton.vue +40 -0
- package/dist/runtime/components/button/LinkButton.vue.d.ts +23 -0
- package/dist/runtime/components/button/box.vue +14 -0
- package/dist/runtime/components/button/box.vue.d.ts +6 -0
- package/dist/runtime/components/button/index.d.ts +28 -0
- package/dist/runtime/components/button/index.js +28 -0
- package/dist/runtime/components/card/BaseCard.vue +26 -0
- package/dist/runtime/components/card/BaseCard.vue.d.ts +18 -0
- package/dist/runtime/components/card/CardBalanceEstimation.vue +29 -0
- package/dist/runtime/components/card/CardBalanceEstimation.vue.d.ts +11 -0
- package/dist/runtime/components/card/CardBalanceSummary.vue +24 -0
- package/dist/runtime/components/card/CardBalanceSummary.vue.d.ts +8 -0
- package/dist/runtime/components/card/CardStatistic.vue +96 -0
- package/dist/runtime/components/card/CardStatistic.vue.d.ts +46 -0
- package/dist/runtime/components/card/CreditCard.vue +106 -0
- package/dist/runtime/components/card/CreditCard.vue.d.ts +16 -0
- package/dist/runtime/components/card/ExpandableCard.vue +51 -0
- package/dist/runtime/components/card/ExpandableCard.vue.d.ts +20 -0
- package/dist/runtime/components/card/NeedPinLocation.vue +27 -0
- package/dist/runtime/components/card/NeedPinLocation.vue.d.ts +8 -0
- package/dist/runtime/components/card/OriginEmpty.vue +13 -0
- package/dist/runtime/components/card/OriginEmpty.vue.d.ts +2 -0
- package/dist/runtime/components/card/OriginItem.vue +76 -0
- package/dist/runtime/components/card/OriginItem.vue.d.ts +25 -0
- package/dist/runtime/components/card/OriginItemDeleted.vue +40 -0
- package/dist/runtime/components/card/OriginItemDeleted.vue.d.ts +15 -0
- package/dist/runtime/components/card/index.vue +17 -0
- package/dist/runtime/components/card/index.vue.d.ts +16 -0
- package/dist/runtime/components/card/origin.vue +42 -0
- package/dist/runtime/components/card/origin.vue.d.ts +39 -0
- package/dist/runtime/components/chart/BarChart.vue +85 -0
- package/dist/runtime/components/chart/BarChart.vue.d.ts +14 -0
- package/dist/runtime/components/chart/ChartHorizontal.vue +123 -0
- package/dist/runtime/components/chart/ChartHorizontal.vue.d.ts +29 -0
- package/dist/runtime/components/chart/GaugeChart.vue +108 -0
- package/dist/runtime/components/chart/GaugeChart.vue.d.ts +28 -0
- package/dist/runtime/components/chart/PieChart.vue +35 -0
- package/dist/runtime/components/chart/PieChart.vue.d.ts +13 -0
- package/dist/runtime/components/chat/Reply.vue +157 -0
- package/dist/runtime/components/chat/Reply.vue.d.ts +60 -0
- package/dist/runtime/components/checkbox/Checkbox.vue +59 -0
- package/dist/runtime/components/checkbox/Checkbox.vue.d.ts +16 -0
- package/dist/runtime/components/checkbox/CheckboxBase.vue +46 -0
- package/dist/runtime/components/checkbox/CheckboxBase.vue.d.ts +15 -0
- package/dist/runtime/components/chip/ChipBase.vue +44 -0
- package/dist/runtime/components/chip/ChipBase.vue.d.ts +26 -0
- package/dist/runtime/components/chip/index.d.ts +4 -0
- package/dist/runtime/components/chip/index.js +4 -0
- package/dist/runtime/components/collapsible/CollapsibleBase.vue +34 -0
- package/dist/runtime/components/collapsible/CollapsibleBase.vue.d.ts +22 -0
- package/dist/runtime/components/combobox/Combobox.vue +171 -0
- package/dist/runtime/components/combobox/Combobox.vue.d.ts +44 -0
- package/dist/runtime/components/combobox/ComboboxInput.vue +13 -0
- package/dist/runtime/components/combobox/ComboboxInput.vue.d.ts +2 -0
- package/dist/runtime/components/combobox/_index.d.ts +1 -0
- package/dist/runtime/components/combobox/_index.js +0 -0
- package/dist/runtime/components/container/ContainerWrapper.vue +11 -0
- package/dist/runtime/components/container/ContainerWrapper.vue.d.ts +16 -0
- package/dist/runtime/components/container/FloatActionWrapper.vue +29 -0
- package/dist/runtime/components/container/FloatActionWrapper.vue.d.ts +20 -0
- package/dist/runtime/components/context-menu/ContextMenuBase.vue +37 -0
- package/dist/runtime/components/context-menu/ContextMenuBase.vue.d.ts +21 -0
- package/dist/runtime/components/cropper/CropperImage.vue +82 -0
- package/dist/runtime/components/cropper/CropperImage.vue.d.ts +18 -0
- package/dist/runtime/components/datepicker/DatepickerBase.vue +55 -0
- package/dist/runtime/components/datepicker/DatepickerBase.vue.d.ts +26 -0
- package/dist/runtime/components/datepicker/DatepickerBody.vue +139 -0
- package/dist/runtime/components/datepicker/DatepickerBody.vue.d.ts +11 -0
- package/dist/runtime/components/dialog/DialogConfirmation.vue +56 -0
- package/dist/runtime/components/dialog/DialogConfirmation.vue.d.ts +44 -0
- package/dist/runtime/components/dialog/DialogConfirmationSingle.vue +108 -0
- package/dist/runtime/components/dialog/DialogConfirmationSingle.vue.d.ts +59 -0
- package/dist/runtime/components/dialog/DialogFloatAction.vue +51 -0
- package/dist/runtime/components/dialog/DialogFloatAction.vue.d.ts +39 -0
- package/dist/runtime/components/dialog/RootDialog.vue +56 -0
- package/dist/runtime/components/dialog/RootDialog.vue.d.ts +19 -0
- package/dist/runtime/components/dialog/aside.vue +80 -0
- package/dist/runtime/components/dialog/aside.vue.d.ts +26 -0
- package/dist/runtime/components/dialog/help.vue +37 -0
- package/dist/runtime/components/dialog/help.vue.d.ts +2 -0
- package/dist/runtime/components/dialog-reka/DialogContent.vue +48 -0
- package/dist/runtime/components/dialog-reka/DialogContent.vue.d.ts +26 -0
- package/dist/runtime/components/dialog-reka/DialogPreviewerImage.vue +177 -0
- package/dist/runtime/components/dialog-reka/DialogPreviewerImage.vue.d.ts +14 -0
- package/dist/runtime/components/dialog-reka/DialogPreviewerVideo.vue +44 -0
- package/dist/runtime/components/dialog-reka/DialogPreviewerVideo.vue.d.ts +13 -0
- package/dist/runtime/components/dialog-reka/DialogRoot.vue +42 -0
- package/dist/runtime/components/dialog-reka/DialogRoot.vue.d.ts +28 -0
- package/dist/runtime/components/divider/DividerBase.vue +35 -0
- package/dist/runtime/components/divider/DividerBase.vue.d.ts +12 -0
- package/dist/runtime/components/divider/DividerDash.vue +43 -0
- package/dist/runtime/components/divider/DividerDash.vue.d.ts +14 -0
- package/dist/runtime/components/dropdown/Dropdown.vue +96 -0
- package/dist/runtime/components/dropdown/Dropdown.vue.d.ts +52 -0
- package/dist/runtime/components/dropdown/DropdownItem.vue +52 -0
- package/dist/runtime/components/dropdown/DropdownItem.vue.d.ts +35 -0
- package/dist/runtime/components/file/AddFile.vue +16 -0
- package/dist/runtime/components/file/AddFile.vue.d.ts +7 -0
- package/dist/runtime/components/file/DropAreaFile.vue +141 -0
- package/dist/runtime/components/file/DropAreaFile.vue.d.ts +28 -0
- package/dist/runtime/components/file/ViewFile.vue +70 -0
- package/dist/runtime/components/file/ViewFile.vue.d.ts +12 -0
- package/dist/runtime/components/filter/FilterChip.vue +39 -0
- package/dist/runtime/components/filter/FilterChip.vue.d.ts +19 -0
- package/dist/runtime/components/filter/FilterStatus.vue +28 -0
- package/dist/runtime/components/filter/FilterStatus.vue.d.ts +16 -0
- package/dist/runtime/components/image/ImageLoader.vue +61 -0
- package/dist/runtime/components/image/ImageLoader.vue.d.ts +11 -0
- package/dist/runtime/components/input/ButtonFileInput.vue +77 -0
- package/dist/runtime/components/input/ButtonFileInput.vue.d.ts +27 -0
- package/dist/runtime/components/input/IconButtonFileInput.vue +80 -0
- package/dist/runtime/components/input/IconButtonFileInput.vue.d.ts +33 -0
- package/dist/runtime/components/input/InputCheckbox.vue +38 -0
- package/dist/runtime/components/input/InputCheckbox.vue.d.ts +16 -0
- package/dist/runtime/components/input/InputControl.vue +11 -0
- package/dist/runtime/components/input/InputControl.vue.d.ts +16 -0
- package/dist/runtime/components/input/InputField.vue +86 -0
- package/dist/runtime/components/input/InputField.vue.d.ts +28 -0
- package/dist/runtime/components/input/InputFieldPassword.vue +47 -0
- package/dist/runtime/components/input/InputFieldPassword.vue.d.ts +18 -0
- package/dist/runtime/components/input/InputFieldPhone.vue +71 -0
- package/dist/runtime/components/input/InputFieldPhone.vue.d.ts +34 -0
- package/dist/runtime/components/input/InputFieldWithOption.vue +69 -0
- package/dist/runtime/components/input/InputFieldWithOption.vue.d.ts +37 -0
- package/dist/runtime/components/input/InputFileDropable.vue +162 -0
- package/dist/runtime/components/input/InputFileDropable.vue.d.ts +33 -0
- package/dist/runtime/components/input/InputGroup.vue +18 -0
- package/dist/runtime/components/input/InputGroup.vue.d.ts +18 -0
- package/dist/runtime/components/input/InputImageDropable.vue +170 -0
- package/dist/runtime/components/input/InputImageDropable.vue.d.ts +24 -0
- package/dist/runtime/components/input/InputNumber.vue +53 -0
- package/dist/runtime/components/input/InputNumber.vue.d.ts +13 -0
- package/dist/runtime/components/input/InputOtp.vue +66 -0
- package/dist/runtime/components/input/InputOtp.vue.d.ts +20 -0
- package/dist/runtime/components/input/InputRadio.vue +49 -0
- package/dist/runtime/components/input/InputRadio.vue.d.ts +22 -0
- package/dist/runtime/components/input/InputText.vue +94 -0
- package/dist/runtime/components/input/InputText.vue.d.ts +50 -0
- package/dist/runtime/components/input/TextArea.vue +75 -0
- package/dist/runtime/components/input/TextArea.vue.d.ts +26 -0
- package/dist/runtime/components/input/index.d.ts +36 -0
- package/dist/runtime/components/input/index.js +60 -0
- package/dist/runtime/components/label/BaseLabel.vue +18 -0
- package/dist/runtime/components/label/BaseLabel.vue.d.ts +9 -0
- package/dist/runtime/components/label/ErrorLabel.vue +13 -0
- package/dist/runtime/components/label/ErrorLabel.vue.d.ts +10 -0
- package/dist/runtime/components/label/Form.vue +16 -0
- package/dist/runtime/components/label/Form.vue.d.ts +7 -0
- package/dist/runtime/components/label/HintLabel.vue +23 -0
- package/dist/runtime/components/label/HintLabel.vue.d.ts +10 -0
- package/dist/runtime/components/label/LabelSection.vue +39 -0
- package/dist/runtime/components/label/LabelSection.vue.d.ts +20 -0
- package/dist/runtime/components/listbox/Listbox.vue +17 -0
- package/dist/runtime/components/listbox/Listbox.vue.d.ts +17 -0
- package/dist/runtime/components/listbox/ListboxItem.vue +34 -0
- package/dist/runtime/components/listbox/ListboxItem.vue.d.ts +20 -0
- package/dist/runtime/components/loading/BounceLoading.vue +19 -0
- package/dist/runtime/components/loading/BounceLoading.vue.d.ts +6 -0
- package/dist/runtime/components/loading/LoadingCircular.vue +46 -0
- package/dist/runtime/components/loading/LoadingCircular.vue.d.ts +10 -0
- package/dist/runtime/components/loading/LoadingIndicator.d.ts +60 -0
- package/dist/runtime/components/loading/LoadingIndicator.js +66 -0
- package/dist/runtime/components/loading/SpinnerLoading.vue +11 -0
- package/dist/runtime/components/loading/SpinnerLoading.vue.d.ts +6 -0
- package/dist/runtime/components/player/Audio.vue +104 -0
- package/dist/runtime/components/player/Audio.vue.d.ts +15 -0
- package/dist/runtime/components/player/Scrubber.vue +48 -0
- package/dist/runtime/components/player/Scrubber.vue.d.ts +44 -0
- package/dist/runtime/components/player/Video.vue +163 -0
- package/dist/runtime/components/player/Video.vue.d.ts +11 -0
- package/dist/runtime/components/popover/Popover.vue +30 -0
- package/dist/runtime/components/popover/Popover.vue.d.ts +18 -0
- package/dist/runtime/components/popover/WhatsAppChecker.vue +61 -0
- package/dist/runtime/components/popover/WhatsAppChecker.vue.d.ts +13 -0
- package/dist/runtime/components/radio/Courier.vue +195 -0
- package/dist/runtime/components/radio/Courier.vue.d.ts +54 -0
- package/dist/runtime/components/radio/Decoration.vue +43 -0
- package/dist/runtime/components/radio/Decoration.vue.d.ts +5 -0
- package/dist/runtime/components/radio/RadioCourierBadge.vue +68 -0
- package/dist/runtime/components/radio/RadioCourierBadge.vue.d.ts +11 -0
- package/dist/runtime/components/radio/ThemeDecoration.vue +40 -0
- package/dist/runtime/components/radio/ThemeDecoration.vue.d.ts +2 -0
- package/dist/runtime/components/radio-group/ButtonRadio.vue +106 -0
- package/dist/runtime/components/radio-group/ButtonRadio.vue.d.ts +47 -0
- package/dist/runtime/components/range-picker/RangePicker.vue +77 -0
- package/dist/runtime/components/range-picker/RangePicker.vue.d.ts +20 -0
- package/dist/runtime/components/range-picker/RangePickerBody.vue +270 -0
- package/dist/runtime/components/range-picker/RangePickerBody.vue.d.ts +24 -0
- package/dist/runtime/components/range-picker/index.d.ts +5 -0
- package/dist/runtime/components/scroll-area/ScrollAreaBase.vue +57 -0
- package/dist/runtime/components/scroll-area/ScrollAreaBase.vue.d.ts +20 -0
- package/dist/runtime/components/select/SelectBase.vue +137 -0
- package/dist/runtime/components/select/SelectBase.vue.d.ts +50 -0
- package/dist/runtime/components/select/SelectMultiple.vue +119 -0
- package/dist/runtime/components/select/SelectMultiple.vue.d.ts +45 -0
- package/dist/runtime/components/select/SelectOption.vue +96 -0
- package/dist/runtime/components/select/SelectOption.vue.d.ts +21 -0
- package/dist/runtime/components/select/SelectWithInput.vue +46 -0
- package/dist/runtime/components/select/SelectWithInput.vue.d.ts +21 -0
- package/dist/runtime/components/stepper/Stepper.vue +99 -0
- package/dist/runtime/components/stepper/Stepper.vue.d.ts +23 -0
- package/dist/runtime/components/switch/Switch.vue +42 -0
- package/dist/runtime/components/switch/Switch.vue.d.ts +28 -0
- package/dist/runtime/components/table/TableWrapper.vue +61 -0
- package/dist/runtime/components/table/TableWrapper.vue.d.ts +15 -0
- package/dist/runtime/components/tabs/TabBase.vue +77 -0
- package/dist/runtime/components/tabs/TabBase.vue.d.ts +32 -0
- package/dist/runtime/components/tags-input/TagsInput.vue +131 -0
- package/dist/runtime/components/tags-input/TagsInput.vue.d.ts +48 -0
- package/dist/runtime/components/tags-input/TagsInputWithOption.vue +95 -0
- package/dist/runtime/components/tags-input/TagsInputWithOption.vue.d.ts +26 -0
- package/dist/runtime/components/time-picker/TimePicker.vue +84 -0
- package/dist/runtime/components/time-picker/TimePicker.vue.d.ts +17 -0
- package/dist/runtime/components/time-picker/TimePickerBody.vue +178 -0
- package/dist/runtime/components/time-picker/TimePickerBody.vue.d.ts +21 -0
- package/dist/runtime/components/toast/ToastCard.vue +36 -0
- package/dist/runtime/components/toast/ToastCard.vue.d.ts +16 -0
- package/dist/runtime/components/toast/ToastContainer.vue +15 -0
- package/dist/runtime/components/toast/ToastContainer.vue.d.ts +2 -0
- package/dist/runtime/components/toast/ToastNetwork.vue +109 -0
- package/dist/runtime/components/toast/ToastNetwork.vue.d.ts +2 -0
- package/dist/runtime/components/toast/index.d.ts +16 -0
- package/dist/runtime/components/toast/index.js +16 -0
- package/dist/runtime/components/toggle-group/MultiSelect.vue +45 -0
- package/dist/runtime/components/toggle-group/MultiSelect.vue.d.ts +38 -0
- package/dist/runtime/components/toggle-group/ToggleGroup.vue +59 -0
- package/dist/runtime/components/toggle-group/ToggleGroup.vue.d.ts +41 -0
- package/dist/runtime/components/tooltip/MiniTooltip.vue +58 -0
- package/dist/runtime/components/tooltip/MiniTooltip.vue.d.ts +21 -0
- package/dist/runtime/components/tooltip/Tooltip.vue +50 -0
- package/dist/runtime/components/tooltip/Tooltip.vue.d.ts +21 -0
- package/dist/runtime/plugin.d.ts +2 -0
- package/dist/runtime/plugin.js +4 -0
- package/dist/runtime/server/tsconfig.json +3 -0
- package/dist/runtime/utils/cn.d.ts +5 -0
- package/dist/runtime/utils/cn.js +5 -0
- package/dist/runtime/utils/formatNumber.d.ts +2 -0
- package/dist/runtime/utils/formatNumber.js +12 -0
- package/dist/types.d.mts +3 -0
- package/package.json +63 -0
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { type HTMLAttributes } from 'vue';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
class?: HTMLAttributes['class'];
|
|
4
|
+
triggerClass?: HTMLAttributes['class'];
|
|
5
|
+
openOnMount?: boolean;
|
|
6
|
+
};
|
|
7
|
+
declare var __VLS_10: {
|
|
8
|
+
isOpen: boolean;
|
|
9
|
+
}, __VLS_16: {};
|
|
10
|
+
type __VLS_Slots = {} & {
|
|
11
|
+
trigger?: (props: typeof __VLS_10) => any;
|
|
12
|
+
} & {
|
|
13
|
+
default?: (props: typeof __VLS_16) => any;
|
|
14
|
+
};
|
|
15
|
+
declare const __VLS_component: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
16
|
+
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
17
|
+
export default _default;
|
|
18
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
19
|
+
new (): {
|
|
20
|
+
$slots: S;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { useElementVisibility, useVModel } from "@vueuse/core";
|
|
3
|
+
import {
|
|
4
|
+
ComboboxAnchor,
|
|
5
|
+
ComboboxContent,
|
|
6
|
+
ComboboxEmpty,
|
|
7
|
+
ComboboxItem,
|
|
8
|
+
ComboboxItemIndicator,
|
|
9
|
+
ComboboxRoot,
|
|
10
|
+
ComboboxTrigger,
|
|
11
|
+
ComboboxViewport
|
|
12
|
+
} from "reka-ui";
|
|
13
|
+
import { BASE_CLASS, BASE_INVALID_CLASS } from "../input";
|
|
14
|
+
const props = defineProps({
|
|
15
|
+
placeholder: { type: String, required: false, default: "Cari di sini..." },
|
|
16
|
+
icon: { type: String, required: false, default: "material-symbols:keyboard-arrow-down" },
|
|
17
|
+
modelValue: { type: [String, Number, Object, null], required: false, default: void 0 },
|
|
18
|
+
nullable: { type: Boolean, required: false },
|
|
19
|
+
loadingIcon: { type: String, required: false, default: "svg-spinners:90-ring-with-bg" },
|
|
20
|
+
valueKey: { type: null, required: false, default: () => "id" },
|
|
21
|
+
title: { type: String, required: false, default: void 0 },
|
|
22
|
+
invalid: { type: Boolean, required: false },
|
|
23
|
+
class: { type: null, required: false, default: void 0 },
|
|
24
|
+
labelKey: { type: null, required: false, default: () => "name" },
|
|
25
|
+
options: { type: Array, required: false, default: void 0 },
|
|
26
|
+
search: { type: Function, required: false, default: void 0 },
|
|
27
|
+
isLoading: { type: Boolean, required: false }
|
|
28
|
+
});
|
|
29
|
+
const emit = defineEmits(["update:modelValue", "update:isLoading"]);
|
|
30
|
+
const list = ref(props.options ?? []);
|
|
31
|
+
const content = useVModel(props, "modelValue", emit);
|
|
32
|
+
const query = ref(props.title ?? "");
|
|
33
|
+
const nextPage = ref();
|
|
34
|
+
const loadingNextPage = ref(false);
|
|
35
|
+
const loading = useVModel(props, "isLoading", emit, {
|
|
36
|
+
defaultValue: false,
|
|
37
|
+
passive: true
|
|
38
|
+
});
|
|
39
|
+
const debounce = ref(null);
|
|
40
|
+
const onSearch = async (searchQuery, isNextPage = false) => {
|
|
41
|
+
if (!props.search) return;
|
|
42
|
+
if (!isNextPage) list.value = [];
|
|
43
|
+
if (isNextPage) loadingNextPage.value = true;
|
|
44
|
+
else loading.value = true;
|
|
45
|
+
if (debounce.value) {
|
|
46
|
+
clearTimeout(debounce.value);
|
|
47
|
+
}
|
|
48
|
+
debounce.value = setTimeout(async () => {
|
|
49
|
+
if (!props.search) return;
|
|
50
|
+
try {
|
|
51
|
+
const fetchList = await props.search(searchQuery, nextPage.value);
|
|
52
|
+
nextPage.value = fetchList?.meta?.nextPage || void 0;
|
|
53
|
+
list.value = isNextPage ? [...list.value, ...fetchList?.data ?? []] : fetchList?.data ?? [];
|
|
54
|
+
} catch (error) {
|
|
55
|
+
console.error("Search error:", error);
|
|
56
|
+
nextPage.value = void 0;
|
|
57
|
+
list.value = [];
|
|
58
|
+
} finally {
|
|
59
|
+
if (isNextPage) loadingNextPage.value = false;
|
|
60
|
+
else loading.value = false;
|
|
61
|
+
}
|
|
62
|
+
}, 500);
|
|
63
|
+
};
|
|
64
|
+
const displayValue = (value) => {
|
|
65
|
+
const selected = list.value.find((item) => item[props.valueKey] === value);
|
|
66
|
+
return selected ? selected[props.labelKey]?.toString() ?? props.title ?? "" : props.title ?? "";
|
|
67
|
+
};
|
|
68
|
+
watch(
|
|
69
|
+
() => props.options,
|
|
70
|
+
(newOptions) => {
|
|
71
|
+
if (props.search) return onSearch(query.value);
|
|
72
|
+
list.value = newOptions ?? [];
|
|
73
|
+
},
|
|
74
|
+
{ immediate: !!props.search }
|
|
75
|
+
);
|
|
76
|
+
const bottomOfListRef = useTemplateRef("bottomOfListRef");
|
|
77
|
+
const bottomOfListVisible = useElementVisibility(bottomOfListRef);
|
|
78
|
+
watch(
|
|
79
|
+
bottomOfListVisible,
|
|
80
|
+
(visible) => {
|
|
81
|
+
if (visible) onSearch(query.value, true);
|
|
82
|
+
},
|
|
83
|
+
{ immediate: true }
|
|
84
|
+
);
|
|
85
|
+
</script>
|
|
86
|
+
|
|
87
|
+
<template>
|
|
88
|
+
<ComboboxRoot
|
|
89
|
+
v-model="content"
|
|
90
|
+
:ignore-filter="!!props.search"
|
|
91
|
+
class="relative"
|
|
92
|
+
>
|
|
93
|
+
<ComboboxAnchor
|
|
94
|
+
class="w-full inline-flex items-center justify-between text-sm relative"
|
|
95
|
+
>
|
|
96
|
+
<UiComboboxInput
|
|
97
|
+
v-model="query"
|
|
98
|
+
:display-value="displayValue"
|
|
99
|
+
:class="
|
|
100
|
+
cn(BASE_CLASS, props.invalid ? BASE_INVALID_CLASS : '', props.class)
|
|
101
|
+
"
|
|
102
|
+
:placeholder="props.placeholder"
|
|
103
|
+
@input="onSearch(query)"
|
|
104
|
+
/>
|
|
105
|
+
<ComboboxTrigger
|
|
106
|
+
class="absolute text-flux-primary right-2 top-1/2 -translate-y-1/2"
|
|
107
|
+
>
|
|
108
|
+
<Icon :name="loading ? loadingIcon : props.icon" size="24px" />
|
|
109
|
+
</ComboboxTrigger>
|
|
110
|
+
</ComboboxAnchor>
|
|
111
|
+
|
|
112
|
+
<ComboboxContent
|
|
113
|
+
class="absolute z-30 w-full max-h-60 transition-all shadow overflow-auto mt-1 bg-background rounded-lg border border-outline-variant"
|
|
114
|
+
>
|
|
115
|
+
<ComboboxViewport class="p-1 space-y-1">
|
|
116
|
+
<ComboboxEmpty
|
|
117
|
+
class="text-sm font-medium flex gap-3 p-0.5 items-center"
|
|
118
|
+
:class="{
|
|
119
|
+
'text-flux-primary animate-pulse': loading,
|
|
120
|
+
'text-flux-error': !loading,
|
|
121
|
+
'text-flux-info': query == ''
|
|
122
|
+
}"
|
|
123
|
+
>
|
|
124
|
+
<Icon
|
|
125
|
+
size="20px"
|
|
126
|
+
:name="
|
|
127
|
+
loading ? loadingIcon : query === '' ? 'material-symbols:info' : 'material-symbols:close'
|
|
128
|
+
"
|
|
129
|
+
/>
|
|
130
|
+
{{
|
|
131
|
+
loading ? "Mencari data..." : query === "" ? "Min. 3 karakter untuk melakukan pencarian" : "Tidak ada hasil ditemukan"
|
|
132
|
+
}}
|
|
133
|
+
</ComboboxEmpty>
|
|
134
|
+
|
|
135
|
+
<ComboboxItem
|
|
136
|
+
v-for="(option, index) in props.nullable ? [
|
|
137
|
+
{
|
|
138
|
+
[props.valueKey]: null,
|
|
139
|
+
[props.labelKey]: 'Semua Pilihan'
|
|
140
|
+
},
|
|
141
|
+
...list
|
|
142
|
+
] : list"
|
|
143
|
+
:key="`option-${index}`"
|
|
144
|
+
:value="option[props.valueKey] || '-'"
|
|
145
|
+
class="rounded data-[highlighted]:bg-primary-container data-[state='checked']:bg-primary-container data-[state='checked']:text-flux-primary flex items-center py-2 text-sm hover:bg-surface-container-low pl-8 cursor-pointer pr-2.5 relative select-none"
|
|
146
|
+
>
|
|
147
|
+
<ComboboxItemIndicator class="absolute left-1.5">
|
|
148
|
+
<Icon name="material-symbols:check" size="20px" />
|
|
149
|
+
</ComboboxItemIndicator>
|
|
150
|
+
<slot :item="option">
|
|
151
|
+
<span>
|
|
152
|
+
{{ option[props.labelKey] }}
|
|
153
|
+
</span>
|
|
154
|
+
</slot>
|
|
155
|
+
</ComboboxItem>
|
|
156
|
+
|
|
157
|
+
<div
|
|
158
|
+
v-if="nextPage && !loading"
|
|
159
|
+
ref="bottomOfListRef"
|
|
160
|
+
class="w-full h-2"
|
|
161
|
+
></div>
|
|
162
|
+
<div
|
|
163
|
+
v-if="loadingNextPage"
|
|
164
|
+
class="flex justify-center items-center text-outline pb-2"
|
|
165
|
+
>
|
|
166
|
+
<Icon name="svg-spinners:90-ring-with-bg" size="24px" />
|
|
167
|
+
</div>
|
|
168
|
+
</ComboboxViewport>
|
|
169
|
+
</ComboboxContent>
|
|
170
|
+
</ComboboxRoot>
|
|
171
|
+
</template>
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { type AcceptableValue } from 'reka-ui';
|
|
2
|
+
import type { HTMLAttributes } from 'vue';
|
|
3
|
+
declare const _default: <T extends Record<string, AcceptableValue | boolean | undefined>, U extends keyof T>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
4
|
+
props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{
|
|
5
|
+
readonly "onUpdate:modelValue"?: ((value: number) => any) | undefined;
|
|
6
|
+
readonly "onUpdate:isLoading"?: ((value?: boolean | undefined) => any) | undefined;
|
|
7
|
+
} & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, never>, "onUpdate:modelValue" | "onUpdate:isLoading"> & {
|
|
8
|
+
placeholder?: string;
|
|
9
|
+
icon?: string;
|
|
10
|
+
modelValue?: AcceptableValue;
|
|
11
|
+
nullable?: boolean;
|
|
12
|
+
loadingIcon?: string;
|
|
13
|
+
valueKey?: U;
|
|
14
|
+
title?: string;
|
|
15
|
+
invalid?: boolean;
|
|
16
|
+
class?: HTMLAttributes["class"];
|
|
17
|
+
labelKey?: U;
|
|
18
|
+
options?: T[];
|
|
19
|
+
search?: (query: string, nextPage?: number) => Promise<{
|
|
20
|
+
data: T[] | undefined;
|
|
21
|
+
meta?: {
|
|
22
|
+
nextPage?: number;
|
|
23
|
+
};
|
|
24
|
+
}>;
|
|
25
|
+
isLoading?: boolean;
|
|
26
|
+
} & Partial<{}>> & import("vue").PublicProps;
|
|
27
|
+
expose(exposed: import("vue").ShallowUnwrapRef<{}>): void;
|
|
28
|
+
attrs: any;
|
|
29
|
+
slots: {
|
|
30
|
+
default?: (props: {
|
|
31
|
+
item: any;
|
|
32
|
+
}) => any;
|
|
33
|
+
};
|
|
34
|
+
emit: {
|
|
35
|
+
(e: "update:modelValue", value: number): void;
|
|
36
|
+
(e: "update:isLoading", value?: boolean): void;
|
|
37
|
+
};
|
|
38
|
+
}>) => import("vue").VNode & {
|
|
39
|
+
__ctx?: Awaited<typeof __VLS_setup>;
|
|
40
|
+
};
|
|
41
|
+
export default _default;
|
|
42
|
+
type __VLS_PrettifyLocal<T> = {
|
|
43
|
+
[K in keyof T]: T[K];
|
|
44
|
+
} & {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { ComboboxInput, injectComboboxRootContext } from "reka-ui";
|
|
3
|
+
const ctx = injectComboboxRootContext();
|
|
4
|
+
const handleFocus = () => {
|
|
5
|
+
if (!ctx.open.value) {
|
|
6
|
+
ctx.onOpenChange(true);
|
|
7
|
+
}
|
|
8
|
+
};
|
|
9
|
+
</script>
|
|
10
|
+
|
|
11
|
+
<template>
|
|
12
|
+
<ComboboxInput ref="input" @click="handleFocus" />
|
|
13
|
+
</template>
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
2
|
+
export default _default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
File without changes
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { HTMLAttributes } from 'vue';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
class?: HTMLAttributes['class'];
|
|
4
|
+
};
|
|
5
|
+
declare var __VLS_6: {};
|
|
6
|
+
type __VLS_Slots = {} & {
|
|
7
|
+
default?: (props: typeof __VLS_6) => any;
|
|
8
|
+
};
|
|
9
|
+
declare const __VLS_component: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
10
|
+
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
11
|
+
export default _default;
|
|
12
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
13
|
+
new (): {
|
|
14
|
+
$slots: S;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<Transition
|
|
3
|
+
enter-active-class="transition duration-100 ease-out"
|
|
4
|
+
enter-from-class="transform scale-95 opacity-0"
|
|
5
|
+
enter-to-class="transform scale-100 opacity-100"
|
|
6
|
+
leave-active-class="transition duration-75 ease-in"
|
|
7
|
+
leave-from-class="transform scale-100 opacity-100"
|
|
8
|
+
leave-to-class="transform scale-95 opacity-0"
|
|
9
|
+
>
|
|
10
|
+
<div
|
|
11
|
+
v-if="show"
|
|
12
|
+
:class="
|
|
13
|
+
cn([
|
|
14
|
+
'fixed bottom-5 left-1/2 -translate-x-1/2 transition-all z-30 rounded-xl p-3 bg-background dark:bg-surface-container-high border border-outline-variant shadow-lg',
|
|
15
|
+
props.class
|
|
16
|
+
])
|
|
17
|
+
"
|
|
18
|
+
>
|
|
19
|
+
<slot />
|
|
20
|
+
</div>
|
|
21
|
+
</Transition>
|
|
22
|
+
</template>
|
|
23
|
+
|
|
24
|
+
<script setup>
|
|
25
|
+
const props = defineProps({
|
|
26
|
+
class: { type: null, required: false, default: void 0 },
|
|
27
|
+
show: { type: Boolean, required: false, default: false }
|
|
28
|
+
});
|
|
29
|
+
</script>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { HTMLAttributes } from 'vue';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
class?: HTMLAttributes['class'];
|
|
4
|
+
show?: boolean;
|
|
5
|
+
};
|
|
6
|
+
declare var __VLS_5: {};
|
|
7
|
+
type __VLS_Slots = {} & {
|
|
8
|
+
default?: (props: typeof __VLS_5) => any;
|
|
9
|
+
};
|
|
10
|
+
declare const __VLS_component: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
11
|
+
class: HTMLAttributes["class"];
|
|
12
|
+
show: boolean;
|
|
13
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
14
|
+
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
15
|
+
export default _default;
|
|
16
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
17
|
+
new (): {
|
|
18
|
+
$slots: S;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import {
|
|
3
|
+
ContextMenuContent,
|
|
4
|
+
ContextMenuItem,
|
|
5
|
+
ContextMenuPortal,
|
|
6
|
+
ContextMenuRoot,
|
|
7
|
+
ContextMenuTrigger
|
|
8
|
+
} from "reka-ui";
|
|
9
|
+
defineProps({
|
|
10
|
+
disabled: { type: Boolean, required: false },
|
|
11
|
+
actions: { type: Array, required: true }
|
|
12
|
+
});
|
|
13
|
+
</script>
|
|
14
|
+
|
|
15
|
+
<template>
|
|
16
|
+
<ContextMenuRoot>
|
|
17
|
+
<ContextMenuTrigger :disabled="disabled" as-child>
|
|
18
|
+
<slot />
|
|
19
|
+
</ContextMenuTrigger>
|
|
20
|
+
<ContextMenuPortal>
|
|
21
|
+
<ContextMenuContent
|
|
22
|
+
class="min-w-40 z-30 bg-background dark:bg-surface-container dark:border dark:border-outline-variant outline-none rounded-lg p-1.5 shadow-xl"
|
|
23
|
+
>
|
|
24
|
+
<ContextMenuItem
|
|
25
|
+
v-for="(action, index) in actions"
|
|
26
|
+
:key="index"
|
|
27
|
+
:value="action.value"
|
|
28
|
+
class="text-xs rounded-md flex items-center gap-2 p-2 relative select-none outline-none data-[disabled]:text-outline-variant data-[disabled]:pointer-events-none data-[highlighted]:bg-surface-container-low"
|
|
29
|
+
@click="action.onClick"
|
|
30
|
+
>
|
|
31
|
+
<Icon v-if="action.icon" :name="action.icon" size="16px" />
|
|
32
|
+
<span>{{ action.label }}</span>
|
|
33
|
+
</ContextMenuItem>
|
|
34
|
+
</ContextMenuContent>
|
|
35
|
+
</ContextMenuPortal>
|
|
36
|
+
</ContextMenuRoot>
|
|
37
|
+
</template>
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
disabled?: boolean;
|
|
3
|
+
actions: {
|
|
4
|
+
value: string;
|
|
5
|
+
label: string;
|
|
6
|
+
icon?: string;
|
|
7
|
+
onClick: () => void;
|
|
8
|
+
}[];
|
|
9
|
+
};
|
|
10
|
+
declare var __VLS_10: {};
|
|
11
|
+
type __VLS_Slots = {} & {
|
|
12
|
+
default?: (props: typeof __VLS_10) => any;
|
|
13
|
+
};
|
|
14
|
+
declare const __VLS_component: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
15
|
+
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
16
|
+
export default _default;
|
|
17
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
18
|
+
new (): {
|
|
19
|
+
$slots: S;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { Cropper } from "vue-advanced-cropper";
|
|
3
|
+
import "vue-advanced-cropper/dist/style.css";
|
|
4
|
+
const props = defineProps({
|
|
5
|
+
show: { type: Boolean, required: true },
|
|
6
|
+
url: { type: String, required: true },
|
|
7
|
+
title: { type: String, required: false, default: "Sesuaikan Rasio Gambar" },
|
|
8
|
+
aspectRatio: { type: Number, required: false, default: 5 / 3 }
|
|
9
|
+
});
|
|
10
|
+
const emits = defineEmits(["close", "onChange"]);
|
|
11
|
+
const cropper = useTemplateRef("cropper");
|
|
12
|
+
const onSave = () => {
|
|
13
|
+
const canvas = cropper.value?.getCanvas();
|
|
14
|
+
if (canvas) {
|
|
15
|
+
canvas.toBlob((blob) => {
|
|
16
|
+
nextTick(async () => {
|
|
17
|
+
const file = new File([blob], "image");
|
|
18
|
+
emits("onChange", file);
|
|
19
|
+
emits("close");
|
|
20
|
+
});
|
|
21
|
+
}, "image/jpeg");
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
</script>
|
|
25
|
+
|
|
26
|
+
<template>
|
|
27
|
+
<DialogGeneral :title="title" :show="show" @close="emits('close')">
|
|
28
|
+
<div class="pb-4 px-4 flex flex-col gap-3">
|
|
29
|
+
<div
|
|
30
|
+
class="rounded-xl overflow-hidden h-96 bg-surfaceContainerLow box-center"
|
|
31
|
+
>
|
|
32
|
+
<Cropper
|
|
33
|
+
ref="cropper"
|
|
34
|
+
class="transform transition duration-300"
|
|
35
|
+
:src="url"
|
|
36
|
+
:auto-zoom="true"
|
|
37
|
+
:min-height="192"
|
|
38
|
+
:min-width="320"
|
|
39
|
+
:stencil-props="{
|
|
40
|
+
aspectRatio: props.aspectRatio,
|
|
41
|
+
resizable: true
|
|
42
|
+
}"
|
|
43
|
+
/>
|
|
44
|
+
</div>
|
|
45
|
+
|
|
46
|
+
<div class="flex flex-col md:flex-row box-between gap-3">
|
|
47
|
+
<div class="flex flex-row gap-3">
|
|
48
|
+
<UiButtonIconButton
|
|
49
|
+
class="p-2 rounded-lg"
|
|
50
|
+
variant="outline"
|
|
51
|
+
icon-size="lg"
|
|
52
|
+
icon-name="material-symbols:rotate-left"
|
|
53
|
+
@click="cropper?.rotate(-90)"
|
|
54
|
+
/>
|
|
55
|
+
<UiButtonIconButton
|
|
56
|
+
class="p-2 rounded-lg"
|
|
57
|
+
variant="outline"
|
|
58
|
+
icon-size="lg"
|
|
59
|
+
icon-name="material-symbols:rotate-right"
|
|
60
|
+
@click="cropper?.rotate(90)"
|
|
61
|
+
/>
|
|
62
|
+
<UiButtonIconButton
|
|
63
|
+
class="p-2 rounded-lg"
|
|
64
|
+
variant="outline"
|
|
65
|
+
icon-size="lg"
|
|
66
|
+
icon-name="material-symbols:zoom-out"
|
|
67
|
+
@click="cropper?.zoom(0.7)"
|
|
68
|
+
/>
|
|
69
|
+
<UiButtonIconButton
|
|
70
|
+
class="p-2 rounded-lg"
|
|
71
|
+
variant="outline"
|
|
72
|
+
icon-size="lg"
|
|
73
|
+
icon-name="material-symbols:zoom-in"
|
|
74
|
+
@click="cropper?.zoom(1.3)"
|
|
75
|
+
/>
|
|
76
|
+
</div>
|
|
77
|
+
|
|
78
|
+
<UiButtonBaseButton label="Simpan Gambar" @click="onSave" />
|
|
79
|
+
</div>
|
|
80
|
+
</div>
|
|
81
|
+
</DialogGeneral>
|
|
82
|
+
</template>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import 'vue-advanced-cropper/dist/style.css';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
show: boolean;
|
|
4
|
+
url: string;
|
|
5
|
+
title?: string;
|
|
6
|
+
aspectRatio?: number;
|
|
7
|
+
};
|
|
8
|
+
declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
9
|
+
close: () => any;
|
|
10
|
+
onChange: (payload: File) => any;
|
|
11
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
12
|
+
onClose?: (() => any) | undefined;
|
|
13
|
+
onOnChange?: ((payload: File) => any) | undefined;
|
|
14
|
+
}>, {
|
|
15
|
+
title: string;
|
|
16
|
+
aspectRatio: number;
|
|
17
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
18
|
+
export default _default;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { useVModel } from "@vueuse/core";
|
|
3
|
+
const props = defineProps({
|
|
4
|
+
class: { type: null, required: false, default: void 0 },
|
|
5
|
+
invalid: { type: Boolean, required: false },
|
|
6
|
+
disabled: { type: Boolean, required: false },
|
|
7
|
+
placeholder: { type: String, required: false, default: "Pilih tanggal" },
|
|
8
|
+
defaultValue: { type: Date, required: false, default: void 0 },
|
|
9
|
+
modelValue: { type: Date, required: false, default: void 0 },
|
|
10
|
+
yearRange: { type: Array, required: false, default: () => [2020, (/* @__PURE__ */ new Date()).getFullYear()] },
|
|
11
|
+
maxDate: { type: Date, required: false, default: () => /* @__PURE__ */ new Date() },
|
|
12
|
+
minDate: { type: Date, required: false, default: void 0 }
|
|
13
|
+
});
|
|
14
|
+
const emits = defineEmits(["update:modelValue"]);
|
|
15
|
+
const modelValue = useVModel(props, "modelValue", emits, {
|
|
16
|
+
passive: true,
|
|
17
|
+
defaultValue: props.defaultValue
|
|
18
|
+
});
|
|
19
|
+
const renderedRange = computed(() => {
|
|
20
|
+
if (!modelValue.value) return void 0;
|
|
21
|
+
return formatDateLongMonth(modelValue.value.toString());
|
|
22
|
+
});
|
|
23
|
+
const showPicker = ref(false);
|
|
24
|
+
</script>
|
|
25
|
+
|
|
26
|
+
<template>
|
|
27
|
+
<UiDropdown
|
|
28
|
+
v-model="showPicker"
|
|
29
|
+
:class="
|
|
30
|
+
cn(
|
|
31
|
+
'rounded-lg min-w-64 relative transition-all font-normal inline-flex justify-between bg-background dark:bg-surface-container-high gap-3 text-sm py-2 px-2.5 items-center border border-outline-variant outline-none focus:ring-1 focus:border-flux-primary focus:ring-flux-primary',
|
|
32
|
+
props.class
|
|
33
|
+
)
|
|
34
|
+
"
|
|
35
|
+
>
|
|
36
|
+
<span
|
|
37
|
+
:class="{
|
|
38
|
+
'text-flux-outline': !renderedRange
|
|
39
|
+
}"
|
|
40
|
+
>{{ renderedRange ?? placeholder }}</span
|
|
41
|
+
>
|
|
42
|
+
<Icon
|
|
43
|
+
name="material-symbols:calendar-month-outline-rounded"
|
|
44
|
+
size="24px"
|
|
45
|
+
class="text-flux-primary absolute right-2 top-1/2 -translate-y-1/2"
|
|
46
|
+
/>
|
|
47
|
+
<template #content>
|
|
48
|
+
<UiDatepickerBody
|
|
49
|
+
v-model:date="modelValue"
|
|
50
|
+
:min-date="props.minDate"
|
|
51
|
+
:max-date="props.maxDate"
|
|
52
|
+
/>
|
|
53
|
+
</template>
|
|
54
|
+
</UiDropdown>
|
|
55
|
+
</template>
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { HTMLAttributes } from 'vue';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
class?: HTMLAttributes['class'];
|
|
4
|
+
invalid?: boolean;
|
|
5
|
+
disabled?: boolean;
|
|
6
|
+
placeholder?: string;
|
|
7
|
+
defaultValue?: Date;
|
|
8
|
+
modelValue?: Date;
|
|
9
|
+
yearRange?: [number, number];
|
|
10
|
+
maxDate?: Date;
|
|
11
|
+
minDate?: Date;
|
|
12
|
+
};
|
|
13
|
+
declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
14
|
+
"update:modelValue": (payload?: Date | undefined) => any;
|
|
15
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
16
|
+
"onUpdate:modelValue"?: ((payload?: Date | undefined) => any) | undefined;
|
|
17
|
+
}>, {
|
|
18
|
+
class: HTMLAttributes["class"];
|
|
19
|
+
modelValue: Date;
|
|
20
|
+
placeholder: string;
|
|
21
|
+
defaultValue: Date;
|
|
22
|
+
yearRange: [number, number];
|
|
23
|
+
maxDate: Date;
|
|
24
|
+
minDate: Date;
|
|
25
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
26
|
+
export default _default;
|