@rotki/ui-library 2.12.1 → 2.12.2
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/accordions/accordion/RuiAccordion.vue.js +1 -1
- package/dist/components/accordions/accordions/RuiAccordions.vue.js +1 -1
- package/dist/components/alerts/RuiAlert.vue.d.ts +2 -2
- package/dist/components/alerts/RuiAlert.vue2.js +1 -1
- package/dist/components/buttons/button/RuiButton.vue2.js +1 -1
- package/dist/components/buttons/button-group/RuiButtonGroup.vue2.js +1 -1
- package/dist/components/calendar/RuiCalendar.vue.js +1 -1
- package/dist/components/calendar/RuiCalendarGrid.vue2.js +1 -1
- package/dist/components/calendar/RuiCalendarHeader.vue2.js +1 -1
- package/dist/components/calendar/RuiCalendarMenu.vue2.js +1 -1
- package/dist/components/cards/RuiCard.vue.d.ts +1 -1
- package/dist/components/cards/RuiCard.vue2.js +1 -1
- package/dist/components/cards/RuiCardHeader.vue2.js +1 -1
- package/dist/components/chips/RuiChip.vue.d.ts +1 -1
- package/dist/components/chips/RuiChip.vue2.js +1 -1
- package/dist/components/color-picker/RuiColorBoard.vue2.js +6 -2
- package/dist/components/color-picker/RuiColorBoard.vue2.js.map +1 -1
- package/dist/components/color-picker/RuiColorDisplay.vue.js +1 -1
- package/dist/components/color-picker/RuiColorHue.vue2.js +8 -2
- package/dist/components/color-picker/RuiColorHue.vue2.js.map +1 -1
- package/dist/components/color-picker/RuiColorInput.vue.js +1 -1
- package/dist/components/color-picker/RuiColorPicker.vue.js +6 -2
- package/dist/components/color-picker/RuiColorPicker.vue.js.map +1 -1
- package/dist/components/date-time-picker/RuiDateTimePicker.vue.d.ts +4 -4
- package/dist/components/date-time-picker/RuiDateTimePicker.vue2.js +5 -5
- package/dist/components/date-time-picker/RuiDateTimePicker.vue2.js.map +1 -1
- package/dist/components/date-time-picker/RuiDateTimePickerMenu.vue.js +1 -1
- package/dist/components/divider/RuiDivider.vue.js +6 -3
- package/dist/components/divider/RuiDivider.vue.js.map +1 -1
- package/dist/components/forms/auto-complete/RuiAutoComplete.vue.d.ts +17 -34
- package/dist/components/forms/auto-complete/RuiAutoComplete.vue2.js +18 -9
- package/dist/components/forms/auto-complete/RuiAutoComplete.vue2.js.map +1 -1
- package/dist/components/forms/checkbox/RuiCheckbox.vue.d.ts +2 -2
- package/dist/components/forms/checkbox/RuiCheckbox.vue2.js +2 -2
- package/dist/components/forms/checkbox/RuiCheckbox.vue2.js.map +1 -1
- package/dist/components/forms/radio-button/radio/RuiRadio.vue.d.ts +1 -1
- package/dist/components/forms/radio-button/radio/RuiRadio.vue2.js +2 -2
- package/dist/components/forms/radio-button/radio/RuiRadio.vue2.js.map +1 -1
- package/dist/components/forms/radio-button/radio-group/RuiRadioGroup.vue.d.ts +1 -1
- package/dist/components/forms/radio-button/radio-group/RuiRadioGroup.vue2.js +2 -2
- package/dist/components/forms/radio-button/radio-group/RuiRadioGroup.vue2.js.map +1 -1
- package/dist/components/forms/revealable-text-field/RuiRevealableTextField.vue.d.ts +3 -3
- package/dist/components/forms/revealable-text-field/RuiRevealableTextField.vue.js +4 -2
- package/dist/components/forms/revealable-text-field/RuiRevealableTextField.vue.js.map +1 -1
- package/dist/components/forms/select/RuiMenuSelect.vue.d.ts +17 -17
- package/dist/components/forms/select/RuiMenuSelect.vue2.js +14 -7
- package/dist/components/forms/select/RuiMenuSelect.vue2.js.map +1 -1
- package/dist/components/forms/select/RuiSimpleSelect.vue.d.ts +3 -1
- package/dist/components/forms/select/RuiSimpleSelect.vue2.js +8 -4
- package/dist/components/forms/select/RuiSimpleSelect.vue2.js.map +1 -1
- package/dist/components/forms/slider/RuiSlider.vue.d.ts +2 -2
- package/dist/components/forms/slider/RuiSlider.vue2.js +10 -8
- package/dist/components/forms/slider/RuiSlider.vue2.js.map +1 -1
- package/dist/components/forms/switch/RuiSwitch.vue.d.ts +1 -1
- package/dist/components/forms/switch/RuiSwitch.vue2.js +2 -2
- package/dist/components/forms/switch/RuiSwitch.vue2.js.map +1 -1
- package/dist/components/forms/text-area/RuiTextArea.vue.d.ts +3 -3
- package/dist/components/forms/text-area/RuiTextArea.vue2.js +8 -8
- package/dist/components/forms/text-area/RuiTextArea.vue2.js.map +1 -1
- package/dist/components/forms/text-field/RuiTextField.vue.d.ts +6 -6
- package/dist/components/forms/text-field/RuiTextField.vue2.js +5 -5
- package/dist/components/forms/text-field/RuiTextField.vue2.js.map +1 -1
- package/dist/components/helpers/RuiFormTextDetail.vue.js +1 -1
- package/dist/components/helpers/RuiFormTextDetail.vue.js.map +1 -1
- package/dist/components/icons/RuiIcon.vue2.js +3 -6
- package/dist/components/icons/RuiIcon.vue2.js.map +1 -1
- package/dist/components/index.d.ts +2 -2
- package/dist/components/loaders/RuiSkeletonBase.vue2.js +1 -1
- package/dist/components/loaders/RuiSkeletonLoader.vue2.js +1 -1
- package/dist/components/logos/RuiLogo.vue.js +3 -1
- package/dist/components/logos/RuiLogo.vue.js.map +1 -1
- package/dist/components/overlays/badge/RuiBadge.vue.d.ts +3 -3
- package/dist/components/overlays/badge/RuiBadge.vue2.js +1 -1
- package/dist/components/overlays/bottom-sheet/RuiBottomSheet.vue.js +1 -1
- package/dist/components/overlays/dialog/RuiDialog.vue.d.ts +4 -3
- package/dist/components/overlays/dialog/RuiDialog.vue2.js +11 -5
- package/dist/components/overlays/dialog/RuiDialog.vue2.js.map +1 -1
- package/dist/components/overlays/menu/RuiMenu.vue.d.ts +1 -1
- package/dist/components/overlays/menu/RuiMenu.vue2.js +6 -4
- package/dist/components/overlays/menu/RuiMenu.vue2.js.map +1 -1
- package/dist/components/overlays/navigation-drawer/RuiNavigationDrawer.vue.d.ts +4 -3
- package/dist/components/overlays/navigation-drawer/RuiNavigationDrawer.vue2.js +9 -4
- package/dist/components/overlays/navigation-drawer/RuiNavigationDrawer.vue2.js.map +1 -1
- package/dist/components/overlays/notification/RuiNotification.vue.d.ts +1 -1
- package/dist/components/overlays/notification/RuiNotification.vue.js +3 -1
- package/dist/components/overlays/notification/RuiNotification.vue.js.map +1 -1
- package/dist/components/overlays/tooltip/RuiTooltip.vue.d.ts +1 -1
- package/dist/components/overlays/tooltip/RuiTooltip.vue2.js +7 -3
- package/dist/components/overlays/tooltip/RuiTooltip.vue2.js.map +1 -1
- package/dist/components/progress/RuiProgress.vue.d.ts +1 -1
- package/dist/components/progress/RuiProgress.vue2.js +1 -1
- package/dist/components/steppers/RuiFooterStepper.vue2.js +15 -8
- package/dist/components/steppers/RuiFooterStepper.vue2.js.map +1 -1
- package/dist/components/steppers/RuiStepper.vue.d.ts +1 -1
- package/dist/components/steppers/RuiStepper.vue2.js +9 -4
- package/dist/components/steppers/RuiStepper.vue2.js.map +1 -1
- package/dist/components/steppers/RuiStepperCustomIcon.vue2.js +1 -1
- package/dist/components/steppers/RuiStepperIcon.vue2.js +1 -1
- package/dist/components/tables/RuiDataTable.vue2.js +28 -24
- package/dist/components/tables/RuiDataTable.vue2.js.map +1 -1
- package/dist/components/tables/RuiExpandButton.vue2.js +3 -2
- package/dist/components/tables/RuiExpandButton.vue2.js.map +1 -1
- package/dist/components/tables/RuiTableHead.vue2.js +1 -1
- package/dist/components/tables/RuiTablePagination.vue.d.ts +1 -1
- package/dist/components/tables/RuiTablePagination.vue2.js +12 -5
- package/dist/components/tables/RuiTablePagination.vue2.js.map +1 -1
- package/dist/components/tabs/tab/RuiTab.vue.d.ts +2 -2
- package/dist/components/tabs/tab/RuiTab.vue2.js +9 -6
- package/dist/components/tabs/tab/RuiTab.vue2.js.map +1 -1
- package/dist/components/tabs/tab-item/RuiTabItem.vue.d.ts +1 -1
- package/dist/components/tabs/tab-item/RuiTabItem.vue2.js +2 -1
- package/dist/components/tabs/tab-item/RuiTabItem.vue2.js.map +1 -1
- package/dist/components/tabs/tab-items/RuiTabItems.vue.d.ts +1 -1
- package/dist/components/tabs/tab-items/RuiTabItems.vue2.js +1 -1
- package/dist/components/tabs/tabs/RuiTabs.vue.d.ts +1 -1
- package/dist/components/tabs/tabs/RuiTabs.vue2.js +1 -1
- package/dist/components/time-picker/RuiTimePicker.vue2.js +21 -4
- package/dist/components/time-picker/RuiTimePicker.vue2.js.map +1 -1
- package/dist/composables/icons.js +1 -1
- package/dist/composables/icons.js.map +1 -1
- package/dist/composables/popper.js +3 -3
- package/dist/composables/popper.js.map +1 -1
- package/dist/composables/theme.js +7 -4
- package/dist/composables/theme.js.map +1 -1
- package/dist/icons/icons_1.d.ts +15 -15
- package/dist/icons/icons_1.js +96 -96
- package/dist/icons/icons_1.js.map +1 -1
- package/dist/icons/icons_2.d.ts +38 -38
- package/dist/icons/icons_2.js +255 -255
- package/dist/icons/icons_2.js.map +1 -1
- package/dist/icons/icons_3.d.ts +26 -26
- package/dist/icons/icons_3.js +153 -153
- package/dist/icons/icons_3.js.map +1 -1
- package/dist/icons/icons_4.d.ts +37 -2
- package/dist/icons/icons_4.js +192 -17
- package/dist/icons/icons_4.js.map +1 -1
- package/dist/icons/index.d.ts +1 -1
- package/dist/icons/index.js +1 -1
- package/dist/icons/index.js.map +1 -1
- package/dist/index.js +65 -30
- package/dist/style.css +26 -26
- package/dist/vite-plugin/index.js +4 -4
- package/dist/vite-plugin/index.js.map +1 -1
- package/dist/vite-plugin/scanner.js +3 -3
- package/dist/vite-plugin/scanner.js.map +1 -1
- package/dist/web-types.json +43 -24
- package/package.json +28 -34
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import { defineComponent, toRefs,
|
|
1
|
+
import { defineComponent, toRefs, openBlock, createElementBlock, normalizeClass, Fragment, renderList, unref, createBlock, createSlots, withCtx, createVNode, createCommentVNode, toDisplayString } from "vue";
|
|
2
2
|
import RuiButton from "../buttons/button/RuiButton.vue.js";
|
|
3
3
|
import RuiIcon from "../icons/RuiIcon.vue.js";
|
|
4
4
|
import RuiProgress from "../progress/RuiProgress.vue.js";
|
|
5
5
|
import { get } from "@vueuse/shared";
|
|
6
|
-
const _hoisted_1 =
|
|
7
|
-
const _hoisted_2 =
|
|
8
|
-
const _hoisted_3 =
|
|
6
|
+
const _hoisted_1 = ["aria-current"];
|
|
7
|
+
const _hoisted_2 = { key: 0 };
|
|
8
|
+
const _hoisted_3 = ["aria-current", "onClick"];
|
|
9
|
+
const _hoisted_4 = { key: 0 };
|
|
9
10
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
10
11
|
...{
|
|
11
12
|
name: "RuiFooterStepper"
|
|
@@ -41,6 +42,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
41
42
|
}
|
|
42
43
|
return (_ctx, _cache) => {
|
|
43
44
|
return openBlock(), createElementBlock("div", {
|
|
45
|
+
role: "navigation",
|
|
46
|
+
"aria-label": "Step navigation",
|
|
44
47
|
class: normalizeClass([_ctx.$style["footer-stepper"], _ctx.$style[__props.variant ?? ""]])
|
|
45
48
|
}, [
|
|
46
49
|
__props.variant === "pill" ? (openBlock(), createElementBlock("div", {
|
|
@@ -50,12 +53,14 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
50
53
|
(openBlock(true), createElementBlock(Fragment, null, renderList(unref(pages), (i) => {
|
|
51
54
|
return openBlock(), createElementBlock("span", {
|
|
52
55
|
key: i,
|
|
56
|
+
"aria-current": unref(modelValue) === i ? "step" : void 0,
|
|
53
57
|
class: normalizeClass([_ctx.$style.pill, { [_ctx.$style.active]: unref(modelValue) === i }])
|
|
54
|
-
}, null,
|
|
58
|
+
}, null, 10, _hoisted_1);
|
|
55
59
|
}), 128))
|
|
56
60
|
], 2)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
57
61
|
!__props.hideButtons ? (openBlock(), createBlock(RuiButton, {
|
|
58
62
|
key: 0,
|
|
63
|
+
"aria-label": "Previous",
|
|
59
64
|
class: normalizeClass({ [_ctx.$style.arrow__button]: __props.arrowButtons }),
|
|
60
65
|
disabled: unref(modelValue) <= 1,
|
|
61
66
|
icon: __props.arrowButtons,
|
|
@@ -64,7 +69,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
64
69
|
onClick: _cache[0] || (_cache[0] = ($event) => onPrev())
|
|
65
70
|
}, createSlots({
|
|
66
71
|
default: withCtx(() => [
|
|
67
|
-
!__props.arrowButtons ? (openBlock(), createElementBlock("span",
|
|
72
|
+
!__props.arrowButtons ? (openBlock(), createElementBlock("span", _hoisted_2, "Back")) : (openBlock(), createBlock(RuiIcon, {
|
|
68
73
|
key: 1,
|
|
69
74
|
size: 24,
|
|
70
75
|
name: "lu-arrow-left"
|
|
@@ -93,9 +98,10 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
93
98
|
(openBlock(true), createElementBlock(Fragment, null, renderList(unref(pages), (i) => {
|
|
94
99
|
return openBlock(), createElementBlock("span", {
|
|
95
100
|
key: i,
|
|
101
|
+
"aria-current": unref(modelValue) === i ? "step" : void 0,
|
|
96
102
|
class: normalizeClass([_ctx.$style.bullet, { [_ctx.$style.active]: unref(modelValue) === i }]),
|
|
97
103
|
onClick: ($event) => onClick(i)
|
|
98
|
-
}, null, 10,
|
|
104
|
+
}, null, 10, _hoisted_3);
|
|
99
105
|
}), 128))
|
|
100
106
|
], 2)) : __props.variant === "progress" ? (openBlock(), createBlock(RuiProgress, {
|
|
101
107
|
key: 3,
|
|
@@ -105,6 +111,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
105
111
|
}, null, 8, ["class", "value"])) : createCommentVNode("", true),
|
|
106
112
|
!__props.hideButtons ? (openBlock(), createBlock(RuiButton, {
|
|
107
113
|
key: 4,
|
|
114
|
+
"aria-label": "Next",
|
|
108
115
|
class: normalizeClass({ [_ctx.$style.arrow__button]: __props.arrowButtons }),
|
|
109
116
|
disabled: unref(modelValue) >= unref(pages),
|
|
110
117
|
icon: __props.arrowButtons,
|
|
@@ -113,7 +120,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
113
120
|
onClick: _cache[1] || (_cache[1] = ($event) => onNext())
|
|
114
121
|
}, createSlots({
|
|
115
122
|
default: withCtx(() => [
|
|
116
|
-
!__props.arrowButtons ? (openBlock(), createElementBlock("span",
|
|
123
|
+
!__props.arrowButtons ? (openBlock(), createElementBlock("span", _hoisted_4, "Next")) : (openBlock(), createBlock(RuiIcon, {
|
|
117
124
|
key: 1,
|
|
118
125
|
size: 24,
|
|
119
126
|
name: "lu-arrow-right"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RuiFooterStepper.vue2.js","sources":["../../../src/components/steppers/RuiFooterStepper.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport RuiButton from '@/components/buttons/button/RuiButton.vue';\nimport RuiIcon from '@/components/icons/RuiIcon.vue';\nimport RuiProgress from '@/components/progress/RuiProgress.vue';\n\nexport interface Props {\n pages: number;\n modelValue?: number;\n variant?: 'numeric' | 'bullet' | 'progress' | 'pill';\n arrowButtons?: boolean;\n hideButtons?: boolean;\n}\n\ndefineOptions({\n name: 'RuiFooterStepper',\n});\n\nconst props = withDefaults(defineProps<Props>(), {\n modelValue: 1,\n variant: 'numeric',\n arrowButtons: false,\n hideButtons: false,\n});\n\nconst emit = defineEmits<{\n (event: 'update:modelValue', modelValue: number): void;\n}>();\n\nconst { modelValue, pages } = toRefs(props);\n\nfunction onChange(delta: number) {\n emit('update:modelValue', get(modelValue) + delta);\n}\n\nfunction onPrev() {\n const value = get(modelValue);\n if (value)\n onChange(-1);\n}\n\nfunction onNext() {\n const value = get(modelValue);\n if (value < get(pages))\n onChange(1);\n}\n\nfunction onClick(index: number) {\n onChange(index - get(modelValue));\n}\n</script>\n\n<template>\n <div :class=\"[$style['footer-stepper'], $style[variant ?? '']]\">\n <template v-if=\"variant === 'pill'\">\n <div :class=\"$style.pills\">\n <span\n v-for=\"i in pages\"\n :key=\"i\"\n :class=\"[$style.pill, { [$style.active]: modelValue === i }]\"\n />\n </div>\n </template>\n <template v-else>\n <RuiButton\n v-if=\"!hideButtons\"\n :class=\"{ [$style.arrow__button]: arrowButtons }\"\n :disabled=\"modelValue <= 1\"\n :icon=\"arrowButtons\"\n :variant=\"arrowButtons ? 'outlined' : 'text'\"\n color=\"primary\"\n @click=\"onPrev()\"\n >\n <template\n v-if=\"!arrowButtons\"\n #prepend\n >\n <RuiIcon\n :size=\"18\"\n name=\"lu-chevron-left\"\n />\n </template>\n <span v-if=\"!arrowButtons\">Back</span>\n <RuiIcon\n v-else\n :size=\"24\"\n name=\"lu-arrow-left\"\n />\n </RuiButton>\n <span\n v-if=\"variant === 'numeric'\"\n :class=\"$style.numeric\"\n >\n {{ modelValue }}/{{ pages }}\n </span>\n <div\n v-else-if=\"variant === 'bullet'\"\n :class=\"$style.bullets\"\n >\n <span\n v-for=\"i in pages\"\n :key=\"i\"\n :class=\"[$style.bullet, { [$style.active]: modelValue === i }]\"\n @click=\"onClick(i)\"\n />\n </div>\n <RuiProgress\n v-else-if=\"variant === 'progress'\"\n :class=\"$style.progress\"\n color=\"primary\"\n :value=\"(modelValue / pages) * 100\"\n />\n <RuiButton\n v-if=\"!hideButtons\"\n :class=\"{ [$style.arrow__button]: arrowButtons }\"\n :disabled=\"modelValue >= pages\"\n :icon=\"arrowButtons\"\n :variant=\"arrowButtons ? 'outlined' : 'text'\"\n color=\"primary\"\n @click=\"onNext()\"\n >\n <span v-if=\"!arrowButtons\">Next</span>\n <RuiIcon\n v-else\n :size=\"24\"\n name=\"lu-arrow-right\"\n />\n <template\n v-if=\"!arrowButtons\"\n #append\n >\n <RuiIcon\n :size=\"18\"\n name=\"lu-chevron-right\"\n />\n </template>\n </RuiButton>\n </template>\n </div>\n</template>\n\n<style lang=\"scss\" module>\n.footer-stepper {\n @apply flex items-center justify-between gap-x-4 transition-all duration-150;\n\n .numeric {\n @apply text-rui-text;\n }\n\n .bullets,\n .pills {\n @apply flex;\n\n .bullet,\n .pill {\n @apply rounded-full h-2 bg-black/[0.26] transition-colors;\n\n &.active {\n @apply bg-rui-primary;\n }\n }\n\n .bullet {\n @apply hover:bg-rui-grey-300 cursor-pointer;\n\n &.active {\n @apply hover:bg-rui-primary;\n }\n }\n\n .pill {\n @apply bg-rui-grey-200;\n }\n }\n\n .bullets {\n @apply gap-x-1;\n\n .bullet {\n @apply w-2;\n }\n }\n\n .pills {\n @apply w-full gap-x-3;\n\n .pill {\n @apply w-full;\n }\n }\n\n .progress {\n @apply max-w-[60%];\n }\n\n .arrow__button {\n @apply bg-white disabled:bg-white/60 #{!important};\n }\n}\n\n:global(.dark) {\n .footer-stepper {\n .bullets,\n .pills {\n .bullet,\n .pill {\n @apply bg-rui-grey-300;\n\n &.active {\n @apply bg-rui-primary;\n }\n }\n\n .bullet {\n @apply hover:bg-rui-grey-400;\n\n &.active {\n @apply hover:bg-rui-primary;\n }\n }\n }\n\n .bullets {\n .bullet {\n @apply bg-white/30;\n }\n }\n\n .arrow__button {\n @apply disabled:bg-[rgb(50,50,50)] #{!important};\n }\n }\n}\n</style>\n"],"names":["_createElementBlock","_normalizeClass","$style","_Fragment","_renderList","_unref","_createBlock","_openBlock","_createVNode","_toDisplayString"],"mappings":"
|
|
1
|
+
{"version":3,"file":"RuiFooterStepper.vue2.js","sources":["../../../src/components/steppers/RuiFooterStepper.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport RuiButton from '@/components/buttons/button/RuiButton.vue';\nimport RuiIcon from '@/components/icons/RuiIcon.vue';\nimport RuiProgress from '@/components/progress/RuiProgress.vue';\n\nexport interface Props {\n pages: number;\n modelValue?: number;\n variant?: 'numeric' | 'bullet' | 'progress' | 'pill';\n arrowButtons?: boolean;\n hideButtons?: boolean;\n}\n\ndefineOptions({\n name: 'RuiFooterStepper',\n});\n\nconst props = withDefaults(defineProps<Props>(), {\n modelValue: 1,\n variant: 'numeric',\n arrowButtons: false,\n hideButtons: false,\n});\n\nconst emit = defineEmits<{\n (event: 'update:modelValue', modelValue: number): void;\n}>();\n\nconst { modelValue, pages } = toRefs(props);\n\nfunction onChange(delta: number) {\n emit('update:modelValue', get(modelValue) + delta);\n}\n\nfunction onPrev() {\n const value = get(modelValue);\n if (value)\n onChange(-1);\n}\n\nfunction onNext() {\n const value = get(modelValue);\n if (value < get(pages))\n onChange(1);\n}\n\nfunction onClick(index: number) {\n onChange(index - get(modelValue));\n}\n</script>\n\n<template>\n <div\n role=\"navigation\"\n aria-label=\"Step navigation\"\n :class=\"[$style['footer-stepper'], $style[variant ?? '']]\"\n >\n <template v-if=\"variant === 'pill'\">\n <div :class=\"$style.pills\">\n <span\n v-for=\"i in pages\"\n :key=\"i\"\n :aria-current=\"modelValue === i ? 'step' : undefined\"\n :class=\"[$style.pill, { [$style.active]: modelValue === i }]\"\n />\n </div>\n </template>\n <template v-else>\n <RuiButton\n v-if=\"!hideButtons\"\n aria-label=\"Previous\"\n :class=\"{ [$style.arrow__button]: arrowButtons }\"\n :disabled=\"modelValue <= 1\"\n :icon=\"arrowButtons\"\n :variant=\"arrowButtons ? 'outlined' : 'text'\"\n color=\"primary\"\n @click=\"onPrev()\"\n >\n <template\n v-if=\"!arrowButtons\"\n #prepend\n >\n <RuiIcon\n :size=\"18\"\n name=\"lu-chevron-left\"\n />\n </template>\n <span v-if=\"!arrowButtons\">Back</span>\n <RuiIcon\n v-else\n :size=\"24\"\n name=\"lu-arrow-left\"\n />\n </RuiButton>\n <span\n v-if=\"variant === 'numeric'\"\n :class=\"$style.numeric\"\n >\n {{ modelValue }}/{{ pages }}\n </span>\n <div\n v-else-if=\"variant === 'bullet'\"\n :class=\"$style.bullets\"\n >\n <span\n v-for=\"i in pages\"\n :key=\"i\"\n :aria-current=\"modelValue === i ? 'step' : undefined\"\n :class=\"[$style.bullet, { [$style.active]: modelValue === i }]\"\n @click=\"onClick(i)\"\n />\n </div>\n <RuiProgress\n v-else-if=\"variant === 'progress'\"\n :class=\"$style.progress\"\n color=\"primary\"\n :value=\"(modelValue / pages) * 100\"\n />\n <RuiButton\n v-if=\"!hideButtons\"\n aria-label=\"Next\"\n :class=\"{ [$style.arrow__button]: arrowButtons }\"\n :disabled=\"modelValue >= pages\"\n :icon=\"arrowButtons\"\n :variant=\"arrowButtons ? 'outlined' : 'text'\"\n color=\"primary\"\n @click=\"onNext()\"\n >\n <span v-if=\"!arrowButtons\">Next</span>\n <RuiIcon\n v-else\n :size=\"24\"\n name=\"lu-arrow-right\"\n />\n <template\n v-if=\"!arrowButtons\"\n #append\n >\n <RuiIcon\n :size=\"18\"\n name=\"lu-chevron-right\"\n />\n </template>\n </RuiButton>\n </template>\n </div>\n</template>\n\n<style lang=\"scss\" module>\n.footer-stepper {\n @apply flex items-center justify-between gap-x-4 transition-all duration-150;\n\n .numeric {\n @apply text-rui-text;\n }\n\n .bullets,\n .pills {\n @apply flex;\n\n .bullet,\n .pill {\n @apply rounded-full h-2 bg-black/[0.26] transition-colors;\n\n &.active {\n @apply bg-rui-primary;\n }\n }\n\n .bullet {\n @apply hover:bg-rui-grey-300 cursor-pointer;\n\n &.active {\n @apply hover:bg-rui-primary;\n }\n }\n\n .pill {\n @apply bg-rui-grey-200;\n }\n }\n\n .bullets {\n @apply gap-x-1;\n\n .bullet {\n @apply w-2;\n }\n }\n\n .pills {\n @apply w-full gap-x-3;\n\n .pill {\n @apply w-full;\n }\n }\n\n .progress {\n @apply max-w-[60%];\n }\n\n .arrow__button {\n @apply bg-white disabled:bg-white/60 #{!important};\n }\n}\n\n:global(.dark) {\n .footer-stepper {\n .bullets,\n .pills {\n .bullet,\n .pill {\n @apply bg-rui-grey-300;\n\n &.active {\n @apply bg-rui-primary;\n }\n }\n\n .bullet {\n @apply hover:bg-rui-grey-400;\n\n &.active {\n @apply hover:bg-rui-primary;\n }\n }\n }\n\n .bullets {\n .bullet {\n @apply bg-white/30;\n }\n }\n\n .arrow__button {\n @apply disabled:bg-[rgb(50,50,50)] #{!important};\n }\n }\n}\n</style>\n"],"names":["_createElementBlock","_normalizeClass","$style","_Fragment","_renderList","_unref","_createBlock","_openBlock","_createVNode","_toDisplayString"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAiBA,UAAM,QAAQ;AAOd,UAAM,OAAO;AAIb,UAAM,EAAE,YA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AAA,YAC7C,UAAUG,MAAA,UAAA,KAAcA,MAAA,KAAA;AAAA,YACxB,MAAM,QAAA;AAAA,YACN,SAAS,QAAA,eAAY,aAAA;AAAA,YACtB,OAAM;AAAA,YACL,+CAAO,OAAA;AAAA,UAAM;6BAEd,MAAsC;AAAA,eAAzB,QAAA,gBAAbE,UAAA,GAAAP,mBAAsC,oBAAX,MAAI,mBAC/BM,YAIE,SAAA;AAAA;gBAFC,MAAM;AAAA,gBACP,MAAK;AAAA,cAAA;;;;aAGE,QAAA;oBACN;AAAA,0BAED,MAGE;AAAA,gBAHFE,YAGE,SAAA;AAAA,kBAFC,MAAM;AAAA,kBACP,MAAK;AAAA,gBAAA;;;;;;;;;;"}
|
|
@@ -17,12 +17,12 @@ type __VLS_Slots = {} & {
|
|
|
17
17
|
icon?: (props: typeof __VLS_1) => any;
|
|
18
18
|
};
|
|
19
19
|
declare const __VLS_base: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{}>, {
|
|
20
|
-
orientation: StepperOrientation;
|
|
21
20
|
step: number;
|
|
22
21
|
custom: boolean;
|
|
23
22
|
iconTop: boolean;
|
|
24
23
|
titleClass: string;
|
|
25
24
|
subtitleClass: string;
|
|
25
|
+
orientation: StepperOrientation;
|
|
26
26
|
keepActiveVisible: boolean;
|
|
27
27
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
28
28
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import { defineComponent, toRefs, computed, ref, watch, nextTick,
|
|
1
|
+
import { defineComponent, toRefs, computed, ref, watch, nextTick, openBlock, createElementBlock, normalizeClass, unref, Fragment, renderList, createCommentVNode, createElementVNode, renderSlot, mergeProps, createBlock, toDisplayString } from "vue";
|
|
2
2
|
import RuiProgress from "../progress/RuiProgress.vue.js";
|
|
3
3
|
import RuiStepperCustomIcon from "./RuiStepperCustomIcon.vue.js";
|
|
4
4
|
import RuiStepperIcon from "./RuiStepperIcon.vue.js";
|
|
5
5
|
import { StepperOrientation, StepperState } from "../../types/stepper.js";
|
|
6
6
|
import { get } from "@vueuse/shared";
|
|
7
7
|
import { isDefined } from "@vueuse/core";
|
|
8
|
-
const _hoisted_1 =
|
|
8
|
+
const _hoisted_1 = ["aria-current"];
|
|
9
|
+
const _hoisted_2 = { class: "relative flex py-2" };
|
|
9
10
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
10
11
|
...{
|
|
11
12
|
name: "RuiStepper"
|
|
@@ -61,6 +62,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
61
62
|
return openBlock(), createElementBlock("div", {
|
|
62
63
|
ref_key: "wrapperRef",
|
|
63
64
|
ref: wrapperRef,
|
|
65
|
+
role: "list",
|
|
66
|
+
"aria-label": "Progress steps",
|
|
64
67
|
class: normalizeClass([[
|
|
65
68
|
_ctx.$style.stepper,
|
|
66
69
|
_ctx.$style[unref(orientation) ?? ""],
|
|
@@ -74,6 +77,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
74
77
|
class: normalizeClass(_ctx.$style.divider)
|
|
75
78
|
}, null, 2)) : createCommentVNode("", true),
|
|
76
79
|
createElementVNode("div", {
|
|
80
|
+
role: "listitem",
|
|
81
|
+
"aria-current": state === unref(StepperState).active ? "step" : void 0,
|
|
77
82
|
class: normalizeClass([
|
|
78
83
|
_ctx.$style.step,
|
|
79
84
|
_ctx.$style[state ?? unref(StepperState).inactive],
|
|
@@ -83,7 +88,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
83
88
|
])
|
|
84
89
|
}, [
|
|
85
90
|
renderSlot(_ctx.$slots, "icon", mergeProps({ ref_for: true }, { state, index: index + 1 }), () => [
|
|
86
|
-
createElementVNode("div",
|
|
91
|
+
createElementVNode("div", _hoisted_2, [
|
|
87
92
|
unref(custom) ? (openBlock(), createBlock(RuiStepperCustomIcon, {
|
|
88
93
|
key: 0,
|
|
89
94
|
index: index + 1,
|
|
@@ -117,7 +122,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
117
122
|
class: normalizeClass([[_ctx.$style.subtitle, { [__props.subtitleClass]: unref(custom) }], "text-caption"])
|
|
118
123
|
}, toDisplayString(description), 3)) : createCommentVNode("", true)
|
|
119
124
|
], 2)) : createCommentVNode("", true)
|
|
120
|
-
],
|
|
125
|
+
], 10, _hoisted_1)
|
|
121
126
|
], 64);
|
|
122
127
|
}), 128))
|
|
123
128
|
], 2);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RuiStepper.vue2.js","sources":["../../../src/components/steppers/RuiStepper.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport RuiProgress from '@/components/progress/RuiProgress.vue';\nimport RuiStepperCustomIcon from '@/components/steppers/RuiStepperCustomIcon.vue';\nimport RuiStepperIcon from '@/components/steppers/RuiStepperIcon.vue';\nimport {\n StepperOrientation,\n StepperState,\n type StepperStep,\n} from '@/types/stepper';\n\nexport interface Props {\n step?: number;\n steps: StepperStep[];\n iconTop?: boolean;\n custom?: boolean;\n titleClass?: string;\n subtitleClass?: string;\n orientation?: StepperOrientation;\n keepActiveVisible?: boolean;\n}\n\ndefineOptions({\n name: 'RuiStepper',\n});\n\nconst props = withDefaults(defineProps<Props>(), {\n step: undefined,\n iconTop: false,\n custom: false,\n titleClass: '',\n subtitleClass: '',\n orientation: StepperOrientation.horizontal,\n keepActiveVisible: true,\n});\n\nconst { custom, steps, step, orientation, keepActiveVisible } = toRefs(props);\n\n// automatically set step state to stepper.\nconst renderedStep = computed(() => {\n const currentStep = get(step);\n const stepsVal = get(steps);\n\n if (!isDefined(currentStep))\n return stepsVal;\n\n return stepsVal.map((text, index) => {\n let stepStatus: StepperState = StepperState.inactive;\n\n if (index + 1 === currentStep)\n stepStatus = StepperState.active;\n\n if (index + 1 < currentStep)\n stepStatus = StepperState.done;\n\n return {\n ...text,\n state: stepStatus,\n };\n });\n});\n\nconst wrapperRef = ref<HTMLDivElement>();\n\nwatch(step, () => {\n if (\n !get(keepActiveVisible)\n || get(orientation) !== StepperOrientation.horizontal\n ) {\n return;\n }\n\n nextTick(() => {\n const elem = get(wrapperRef);\n if (elem) {\n const activeStep = elem.querySelector('.active-step');\n activeStep?.scrollIntoView?.({\n behavior: 'smooth',\n inline: 'center',\n });\n }\n });\n});\n</script>\n\n<template>\n <div\n ref=\"wrapperRef\"\n :class=\"[\n $style.stepper,\n $style[orientation ?? ''],\n { [$style['icon-top']]: iconTop, [$style.custom]: custom },\n ]\"\n class=\"no-scrollbar overflow-auto\"\n >\n <template\n v-for=\"({ title, description, state, loading }, index) in renderedStep\"\n :key=\"index\"\n >\n <hr\n v-if=\"index > 0\"\n :class=\"$style.divider\"\n />\n <div\n :class=\"[\n $style.step,\n $style[state ?? StepperState.inactive],\n {\n 'active-step': state === StepperState.active,\n },\n ]\"\n >\n <slot\n name=\"icon\"\n v-bind=\"{ state, index: index + 1 }\"\n >\n <div class=\"relative flex py-2\">\n <RuiStepperCustomIcon\n v-if=\"custom\"\n :index=\"index + 1\"\n :state=\"state\"\n />\n <RuiStepperIcon\n v-else\n :index=\"index + 1\"\n :state=\"state\"\n />\n <RuiProgress\n v-if=\"loading\"\n class=\"absolute left-1/2 top-1/2 transform -translate-x-1/2 -translate-y-1/2\"\n size=\"32\"\n variant=\"indeterminate\"\n circular\n thickness=\"2\"\n color=\"primary\"\n />\n </div>\n </slot>\n <div\n v-if=\"title || description\"\n :class=\"$style.label\"\n >\n <span\n v-if=\"title\"\n :class=\"[$style.title, { [titleClass]: custom }]\"\n class=\"text-subtitle-2\"\n >\n {{ title }}\n </span>\n <span\n v-if=\"description\"\n :class=\"[$style.subtitle, { [subtitleClass]: custom }]\"\n class=\"text-caption\"\n >\n {{ description }}\n </span>\n </div>\n </div>\n </template>\n </div>\n</template>\n\n<style lang=\"scss\" module>\n$colors: 'error', 'warning', 'info', 'success';\n.stepper {\n @apply flex;\n\n &.horizontal {\n @apply whitespace-nowrap lg:whitespace-normal;\n }\n\n &.vertical {\n @apply flex-col inline-flex;\n\n .step {\n @apply px-0 py-6;\n }\n\n .divider {\n @apply block min-h-[3rem] min-w-0 max-h-full h-full self-start -my-4 mx-3 border-l border-rui-grey-400;\n }\n\n &.custom {\n .divider {\n @apply mx-5;\n }\n }\n\n &.icon-top {\n .divider {\n @apply self-center mx-auto;\n }\n }\n }\n\n .step {\n @apply flex items-center px-6 relative;\n\n .indicator {\n @apply inline-flex items-center justify-center rounded-full h-6 w-6 min-w-[1.5rem];\n }\n\n .label {\n @apply flex flex-col items-start text-left ml-2;\n }\n\n &.inactive {\n @apply text-rui-text-disabled;\n\n .title {\n @apply text-rui-text-secondary;\n }\n\n .subtitle {\n @apply text-rui-text;\n }\n }\n\n &.active,\n &.done {\n @apply text-rui-text;\n\n .subtitle {\n @apply text-rui-text-secondary;\n }\n }\n\n @each $color in $colors {\n &.#{$color} {\n @apply text-rui-#{$color};\n }\n }\n }\n\n &.icon-top {\n .step {\n @apply flex-col;\n\n .label {\n @apply ml-0 mt-4 items-center text-center;\n }\n }\n }\n\n .divider {\n @apply block max-w-full min-w-[1rem] h-0 max-h-0 self-center -mx-4 my-0 border-t border-rui-grey-400;\n flex: 1 1 0;\n }\n\n &.custom {\n .step {\n .divider {\n @apply border-rui-primary-lighter;\n }\n\n &.inactive {\n @apply text-rui-text;\n }\n }\n }\n}\n</style>\n"],"names":["_createElementBlock","_normalizeClass","$style","_unref","_Fragment","_renderList","_createElementVNode","_renderSlot","_mergeProps","_createBlock"],"mappings":"
|
|
1
|
+
{"version":3,"file":"RuiStepper.vue2.js","sources":["../../../src/components/steppers/RuiStepper.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport RuiProgress from '@/components/progress/RuiProgress.vue';\nimport RuiStepperCustomIcon from '@/components/steppers/RuiStepperCustomIcon.vue';\nimport RuiStepperIcon from '@/components/steppers/RuiStepperIcon.vue';\nimport {\n StepperOrientation,\n StepperState,\n type StepperStep,\n} from '@/types/stepper';\n\nexport interface Props {\n step?: number;\n steps: StepperStep[];\n iconTop?: boolean;\n custom?: boolean;\n titleClass?: string;\n subtitleClass?: string;\n orientation?: StepperOrientation;\n keepActiveVisible?: boolean;\n}\n\ndefineOptions({\n name: 'RuiStepper',\n});\n\nconst props = withDefaults(defineProps<Props>(), {\n step: undefined,\n iconTop: false,\n custom: false,\n titleClass: '',\n subtitleClass: '',\n orientation: StepperOrientation.horizontal,\n keepActiveVisible: true,\n});\n\nconst { custom, steps, step, orientation, keepActiveVisible } = toRefs(props);\n\n// automatically set step state to stepper.\nconst renderedStep = computed(() => {\n const currentStep = get(step);\n const stepsVal = get(steps);\n\n if (!isDefined(currentStep))\n return stepsVal;\n\n return stepsVal.map((text, index) => {\n let stepStatus: StepperState = StepperState.inactive;\n\n if (index + 1 === currentStep)\n stepStatus = StepperState.active;\n\n if (index + 1 < currentStep)\n stepStatus = StepperState.done;\n\n return {\n ...text,\n state: stepStatus,\n };\n });\n});\n\nconst wrapperRef = ref<HTMLDivElement>();\n\nwatch(step, () => {\n if (\n !get(keepActiveVisible)\n || get(orientation) !== StepperOrientation.horizontal\n ) {\n return;\n }\n\n nextTick(() => {\n const elem = get(wrapperRef);\n if (elem) {\n const activeStep = elem.querySelector('.active-step');\n activeStep?.scrollIntoView?.({\n behavior: 'smooth',\n inline: 'center',\n });\n }\n });\n});\n</script>\n\n<template>\n <div\n ref=\"wrapperRef\"\n role=\"list\"\n aria-label=\"Progress steps\"\n :class=\"[\n $style.stepper,\n $style[orientation ?? ''],\n { [$style['icon-top']]: iconTop, [$style.custom]: custom },\n ]\"\n class=\"no-scrollbar overflow-auto\"\n >\n <template\n v-for=\"({ title, description, state, loading }, index) in renderedStep\"\n :key=\"index\"\n >\n <hr\n v-if=\"index > 0\"\n :class=\"$style.divider\"\n />\n <div\n role=\"listitem\"\n :aria-current=\"state === StepperState.active ? 'step' : undefined\"\n :class=\"[\n $style.step,\n $style[state ?? StepperState.inactive],\n {\n 'active-step': state === StepperState.active,\n },\n ]\"\n >\n <slot\n name=\"icon\"\n v-bind=\"{ state, index: index + 1 }\"\n >\n <div class=\"relative flex py-2\">\n <RuiStepperCustomIcon\n v-if=\"custom\"\n :index=\"index + 1\"\n :state=\"state\"\n />\n <RuiStepperIcon\n v-else\n :index=\"index + 1\"\n :state=\"state\"\n />\n <RuiProgress\n v-if=\"loading\"\n class=\"absolute left-1/2 top-1/2 transform -translate-x-1/2 -translate-y-1/2\"\n size=\"32\"\n variant=\"indeterminate\"\n circular\n thickness=\"2\"\n color=\"primary\"\n />\n </div>\n </slot>\n <div\n v-if=\"title || description\"\n :class=\"$style.label\"\n >\n <span\n v-if=\"title\"\n :class=\"[$style.title, { [titleClass]: custom }]\"\n class=\"text-subtitle-2\"\n >\n {{ title }}\n </span>\n <span\n v-if=\"description\"\n :class=\"[$style.subtitle, { [subtitleClass]: custom }]\"\n class=\"text-caption\"\n >\n {{ description }}\n </span>\n </div>\n </div>\n </template>\n </div>\n</template>\n\n<style lang=\"scss\" module>\n$colors: 'error', 'warning', 'info', 'success';\n.stepper {\n @apply flex;\n\n &.horizontal {\n @apply whitespace-nowrap lg:whitespace-normal;\n }\n\n &.vertical {\n @apply flex-col inline-flex;\n\n .step {\n @apply px-0 py-6;\n }\n\n .divider {\n @apply block min-h-[3rem] min-w-0 max-h-full h-full self-start -my-4 mx-3 border-l border-rui-grey-400;\n }\n\n &.custom {\n .divider {\n @apply mx-5;\n }\n }\n\n &.icon-top {\n .divider {\n @apply self-center mx-auto;\n }\n }\n }\n\n .step {\n @apply flex items-center px-6 relative;\n\n .indicator {\n @apply inline-flex items-center justify-center rounded-full h-6 w-6 min-w-[1.5rem];\n }\n\n .label {\n @apply flex flex-col items-start text-left ml-2;\n }\n\n &.inactive {\n @apply text-rui-text-disabled;\n\n .title {\n @apply text-rui-text-secondary;\n }\n\n .subtitle {\n @apply text-rui-text;\n }\n }\n\n &.active,\n &.done {\n @apply text-rui-text;\n\n .subtitle {\n @apply text-rui-text-secondary;\n }\n }\n\n @each $color in $colors {\n &.#{$color} {\n @apply text-rui-#{$color};\n }\n }\n }\n\n &.icon-top {\n .step {\n @apply flex-col;\n\n .label {\n @apply ml-0 mt-4 items-center text-center;\n }\n }\n }\n\n .divider {\n @apply block max-w-full min-w-[1rem] h-0 max-h-0 self-center -mx-4 my-0 border-t border-rui-grey-400;\n flex: 1 1 0;\n }\n\n &.custom {\n .step {\n .divider {\n @apply border-rui-primary-lighter;\n }\n\n &.inactive {\n @apply text-rui-text;\n }\n }\n }\n}\n</style>\n"],"names":["_createElementBlock","_normalizeClass","$style","_unref","_Fragment","_renderList","_createElementVNode","_renderSlot","_mergeProps","_createBlock"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAyBA,UAAM,QAAQ;AAUd,UAAM,EAAE,QAAQ,OAAO,MAAM,aAAa,kBAAA,IAAsB,OAAO,KAAK;AAG5E,UAAM,eAAe,SAAS,MAAM;AAClC,YAAM,cAAc,IAAI,IAAI;AAC5B,YAAM,WAAW,IAAI,KAAK;AAE1B,UAAI,CAAC,UAAU,WAAW;AACxB,eAAO;AAET,aAAO,SAAS,IAAI,CAAC,MAAM,UAAU;AACnC,YAAI,aAA2B,aAAa;AAE5C,YAAI,QAAQ,MAAM;AAChB,uBAAa,aAAa;AAE5B,YAAI,QAAQ,IAAI;AACd,uBAAa,aAAa;AAE5B,eAAO;AAAA,UACL,GAAG;AAAA,UACH,OAAO;AAAA,QAAA;AAAA,MAEX,CAAC;AAAA,IACH,CAAC;AAED,UAAM,aAAa,IAAA;AAEnB,UAAM,MAAM,MAAM;AAChB,UACE,CAAC,IAAI,iBAAiB,KACnB,IAAI,WAAW,MAAM,mBAAmB,YAC3C;AACA;AAAA,MACF;AAEA,eAAS,MAAM;AACb,cAAM,OAAO,IAAI,UAAU;AAC3B,YAAI,MAAM;AACR,gBAAM,aA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AAK;AAAA,oBACZ;AAAA,kBAAA;kBAGK,wBADRA,YAQE,aAAA;AAAA;oBANA,OAAM;AAAA,oBACN,MAAK;AAAA,oBACL,SAAQ;AAAA,oBACR,UAAA;AAAA,oBACA,WAAU;AAAA,oBACV,OAAM;AAAA,kBAAA;;;cAKJ,SAAS,4BADjBT,mBAkBM,OAAA;AAAA;gBAhBH,OAAKC,eAAEC,KAAAA,OAAO,KAAK;AAAA,cAAA;gBAGZ,sBADRF,mBAMO,QAAA;AAAA;kBAJJ,OAAKC,eAAA,CAAA,CAAGC,YAAO,UAAU,QAAA,UAAU,GAAGC,MAAA,MAAA,GAAM,GACvC,iBAAiB,CAAA;AAAA,gBAAA,mBAEpB,KAAK,GAAA,CAAA;gBAGF,4BADRH,mBAMO,QAAA;AAAA;kBAJJ,OAAKC,eAAA,CAAA,CAAGC,YAAO,aAAa,QAAA,aAAa,GAAGC,MAAA,MAAA,GAAM,GAC7C,cAAc,CAAA;AAAA,gBAAA,mBAEjB,WAAW,GAAA,CAAA;;;;;;;;;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent,
|
|
1
|
+
import { defineComponent, openBlock, createElementBlock, normalizeClass, unref, toDisplayString, createBlock } from "vue";
|
|
2
2
|
import RuiIcon from "../icons/RuiIcon.vue.js";
|
|
3
3
|
import { StepperState } from "../../types/stepper.js";
|
|
4
4
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent,
|
|
1
|
+
import { defineComponent, openBlock, createElementBlock, normalizeClass, unref, toDisplayString, createBlock, createCommentVNode } from "vue";
|
|
2
2
|
import RuiIcon from "../icons/RuiIcon.vue.js";
|
|
3
3
|
import { StepperState } from "../../types/stepper.js";
|
|
4
4
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent, useSlots, toRefs, computed, ref, watch, onMounted,
|
|
1
|
+
import { defineComponent, useSlots, toRefs, computed, ref, watch, onMounted, openBlock, createElementBlock, normalizeClass, unref, createBlock, isRef, createCommentVNode, createElementVNode, createVNode, createSlots, renderList, withCtx, renderSlot, normalizeProps, guardReactiveProps, Fragment, toDisplayString, createTextVNode, Transition } from "vue";
|
|
2
2
|
import RuiButton from "../buttons/button/RuiButton.vue.js";
|
|
3
3
|
import RuiCheckbox from "../forms/checkbox/RuiCheckbox.vue.js";
|
|
4
4
|
import RuiIcon from "../icons/RuiIcon.vue.js";
|
|
@@ -9,21 +9,22 @@ import RuiTableHead from "./RuiTableHead.vue.js";
|
|
|
9
9
|
import RuiTablePagination from "./RuiTablePagination.vue.js";
|
|
10
10
|
import noDataPlaceholder from "./table_no_data_placeholder.svg.js";
|
|
11
11
|
import noDataPlaceholderDark from "./table_no_data_placeholder_dark.svg.js";
|
|
12
|
-
import { assert } from "../../utils/assert.js";
|
|
13
12
|
import { useTable } from "../../composables/defaults/table.js";
|
|
14
|
-
import { watchImmediate, isDefined } from "@vueuse/core";
|
|
15
|
-
import "scule";
|
|
16
|
-
import { get, set } from "@vueuse/shared";
|
|
17
|
-
import { useRotkiTheme } from "../../composables/theme.js";
|
|
18
13
|
import { useStickyTableHeader } from "../../composables/sticky-header.js";
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
const
|
|
14
|
+
import { useRotkiTheme } from "../../composables/theme.js";
|
|
15
|
+
import { assert } from "../../utils/assert.js";
|
|
16
|
+
import { get, set } from "@vueuse/shared";
|
|
17
|
+
import { watchImmediate, isDefined } from "@vueuse/core";
|
|
18
|
+
const _hoisted_1 = ["aria-busy"];
|
|
19
|
+
const _hoisted_2 = ["colspan"];
|
|
20
|
+
const _hoisted_3 = { class: "flex items-center gap-2" };
|
|
21
|
+
const _hoisted_4 = ["aria-selected"];
|
|
22
|
+
const _hoisted_5 = ["colspan", "rowspan"];
|
|
24
23
|
const _hoisted_6 = ["colspan"];
|
|
25
|
-
const _hoisted_7 =
|
|
26
|
-
const _hoisted_8 = ["
|
|
24
|
+
const _hoisted_7 = { key: 1 };
|
|
25
|
+
const _hoisted_8 = ["colspan"];
|
|
26
|
+
const _hoisted_9 = ["colspan"];
|
|
27
|
+
const _hoisted_10 = ["src", "alt"];
|
|
27
28
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
28
29
|
...{
|
|
29
30
|
name: "RuiDataTable"
|
|
@@ -645,6 +646,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
645
646
|
ref_key: "table",
|
|
646
647
|
ref: table,
|
|
647
648
|
class: normalizeClass([_ctx.$style.table, { [_ctx.$style.dense]: __props.dense }]),
|
|
649
|
+
"aria-busy": __props.loading,
|
|
648
650
|
"aria-label": ""
|
|
649
651
|
}, [
|
|
650
652
|
createVNode(RuiTableHead, {
|
|
@@ -722,7 +724,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
722
724
|
class: normalizeClass([[_ctx.$style.td], "!p-2"]),
|
|
723
725
|
colspan: unref(colspan)
|
|
724
726
|
}, [
|
|
725
|
-
createElementVNode("div",
|
|
727
|
+
createElementVNode("div", _hoisted_3, [
|
|
726
728
|
__props.groupExpandButtonPosition === "start" ? (openBlock(), createBlock(RuiExpandButton, {
|
|
727
729
|
key: 0,
|
|
728
730
|
expanded: isExpandedGroup(row.group),
|
|
@@ -737,6 +739,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
737
739
|
size: "sm",
|
|
738
740
|
variant: "text",
|
|
739
741
|
icon: "",
|
|
742
|
+
"data-cy": "group-copy-button",
|
|
740
743
|
onClick: ($event) => onCopyGroup({ key: unref(groupKey), value: row.group })
|
|
741
744
|
}, {
|
|
742
745
|
default: withCtx(() => [
|
|
@@ -779,7 +782,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
779
782
|
onClick: ($event) => onToggleExpandGroup(row.group, row.identifier)
|
|
780
783
|
}, null, 8, ["expanded", "onClick"])) : createCommentVNode("", true)
|
|
781
784
|
])
|
|
782
|
-
], 10,
|
|
785
|
+
], 10, _hoisted_2)
|
|
783
786
|
])
|
|
784
787
|
], 2)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
785
788
|
(openBlock(), createElementBlock("tr", {
|
|
@@ -788,7 +791,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
788
791
|
_ctx.$style.tr,
|
|
789
792
|
{ [_ctx.$style.tr__selected ?? ""]: isSelected(row[unref(rowIdentifier)]) },
|
|
790
793
|
typeof __props.itemClass === "string" ? __props.itemClass : __props.itemClass(row)
|
|
791
|
-
])
|
|
794
|
+
]),
|
|
795
|
+
"aria-selected": unref(selectedData) ? isSelected(row[unref(rowIdentifier)]) : void 0
|
|
792
796
|
}, [
|
|
793
797
|
unref(selectedData) ? (openBlock(), createElementBlock("td", {
|
|
794
798
|
key: 0,
|
|
@@ -838,9 +842,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
838
842
|
}, () => [
|
|
839
843
|
createTextVNode(toDisplayString(cellValue(row, column.key)), 1)
|
|
840
844
|
])
|
|
841
|
-
], 10,
|
|
845
|
+
], 10, _hoisted_5);
|
|
842
846
|
}), 128))
|
|
843
|
-
],
|
|
847
|
+
], 10, _hoisted_4)),
|
|
844
848
|
unref(expandable) && isExpanded(row[unref(rowIdentifier)]) ? (openBlock(), createElementBlock("tr", {
|
|
845
849
|
key: `row-expand-${index}`,
|
|
846
850
|
class: normalizeClass([_ctx.$style.tr, _ctx.$style.tr__expandable])
|
|
@@ -853,12 +857,12 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
853
857
|
row,
|
|
854
858
|
index
|
|
855
859
|
})
|
|
856
|
-
], 10,
|
|
860
|
+
], 10, _hoisted_6)
|
|
857
861
|
], 2)) : createCommentVNode("", true)
|
|
858
862
|
], 64))
|
|
859
863
|
], 64);
|
|
860
864
|
}), 256)),
|
|
861
|
-
__props.loading && unref(noData) ? (openBlock(), createElementBlock("tr",
|
|
865
|
+
__props.loading && unref(noData) ? (openBlock(), createElementBlock("tr", _hoisted_7, [
|
|
862
866
|
createElementVNode("td", {
|
|
863
867
|
class: normalizeClass(_ctx.$style.tbody__loader),
|
|
864
868
|
colspan: unref(colspan)
|
|
@@ -868,7 +872,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
868
872
|
variant: "indeterminate",
|
|
869
873
|
circular: ""
|
|
870
874
|
})
|
|
871
|
-
], 10,
|
|
875
|
+
], 10, _hoisted_8)
|
|
872
876
|
])) : createCommentVNode("", true),
|
|
873
877
|
unref(noData) && __props.empty && !__props.loading ? (openBlock(), createElementBlock("tr", {
|
|
874
878
|
key: 2,
|
|
@@ -896,7 +900,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
896
900
|
src: unref(isDark) ? unref(noDataPlaceholderDark) : unref(noDataPlaceholder),
|
|
897
901
|
alt: __props.empty.label,
|
|
898
902
|
class: "h-32"
|
|
899
|
-
}, null, 8,
|
|
903
|
+
}, null, 8, _hoisted_10),
|
|
900
904
|
__props.empty.label ? (openBlock(), createElementBlock("p", {
|
|
901
905
|
key: 0,
|
|
902
906
|
class: normalizeClass(_ctx.$style.empty__label)
|
|
@@ -909,7 +913,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
909
913
|
])
|
|
910
914
|
], 2)
|
|
911
915
|
])
|
|
912
|
-
], 10,
|
|
916
|
+
], 10, _hoisted_9)
|
|
913
917
|
]),
|
|
914
918
|
_: 3
|
|
915
919
|
})
|
|
@@ -922,7 +926,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
922
926
|
createElementVNode("tfoot", null, [
|
|
923
927
|
renderSlot(_ctx.$slots, "tfoot")
|
|
924
928
|
])
|
|
925
|
-
],
|
|
929
|
+
], 10, _hoisted_1)
|
|
926
930
|
], 2),
|
|
927
931
|
unref(paginationData) && !__props.hideDefaultFooter ? (openBlock(), createBlock(RuiTablePagination, {
|
|
928
932
|
key: 1,
|