vueless 0.0.50 → 0.0.52
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/adatper.locale/locales/en.js +2 -0
- package/composable.breakpoint/index.js +93 -0
- package/index.js +9 -0
- package/package.json +4 -6
- package/service.ui/index.js +1 -0
- package/ui.button/composables/attrs.composable.js +9 -2
- package/ui.button-link/composables/attrs.composable.js +23 -3
- package/ui.button-toggle/configs/default.config.js +1 -0
- package/ui.container-card/composable/attrs.composable.js +2 -2
- package/ui.container-card/index.vue +3 -6
- package/ui.container-modal/composables/attrs.composable.js +5 -8
- package/ui.container-modal-confirm/composable/attrs.composable.js +55 -5
- package/ui.container-page/composables/attrs.composable.js +3 -3
- package/ui.container-page/index.vue +4 -6
- package/ui.form-calendar/configs/default.config.js +21 -21
- package/ui.form-color-picker/composables/attrs.composable.js +2 -9
- package/ui.form-date-picker/configs/default.config.js +1 -1
- package/ui.form-date-picker-range/configs/default.config.js +16 -16
- package/ui.form-date-picker-range/index.vue +3 -4
- package/ui.form-input/configs/default.config.js +2 -2
- package/ui.form-radio-card/composables/attrs.composable.js +2 -2
- package/ui.form-radio-card/index.vue +6 -10
- package/ui.form-select/configs/default.config.js +2 -2
- package/ui.form-textarea/configs/default.config.js +1 -1
- package/ui.loader-rendering/composables/useLoaderRendering.js +19 -0
- package/ui.loader-rendering/index.vue +15 -16
- package/ui.navigation-pagination/configs/default.config.js +2 -2
- package/ui.notify/Docs.mdx +84 -0
- package/ui.notify/composables/attrs.composable.js +30 -0
- package/ui.notify/configs/default.config.js +47 -0
- package/ui.notify/constants/index.js +19 -0
- package/ui.notify/index.stories.js +77 -0
- package/ui.notify/index.vue +196 -214
- package/ui.notify/services/index.js +65 -63
- package/ui.other-loader-top/composables/useLoaderTop.js +57 -0
- package/ui.other-loader-top/index.vue +12 -13
- package/ui.text-alert/composables/attrs.composable.js +1 -1
- package/web-types.json +21 -16
- package/ui.loader-rendering/store/index.js +0 -17
- package/ui.notify/index.sto_ries.js +0 -102
- package/ui.other-loader-top/store/index.js +0 -59
- package/ui.viewport/index.vue +0 -78
- package/ui.viewport/store/index.js +0 -47
|
@@ -8,6 +8,7 @@ import calendarConfig from "../../ui.form-calendar/configs/default.config";
|
|
|
8
8
|
import datepickerConfig from "../../ui.form-date-picker/configs/default.config";
|
|
9
9
|
import datepickerRangeConfig from "../../ui.form-date-picker-range/configs/default.config";
|
|
10
10
|
import dataListConfig from "../../ui.data-list/configs/default.config";
|
|
11
|
+
import notifyDefaultConfig from "../../ui.notify/configs/default.config";
|
|
11
12
|
|
|
12
13
|
export default {
|
|
13
14
|
USelect: selectConfig.i18n,
|
|
@@ -20,4 +21,5 @@ export default {
|
|
|
20
21
|
UDatePicker: datepickerConfig.i18n,
|
|
21
22
|
UDatePickerRange: datepickerRangeConfig.i18n,
|
|
22
23
|
UDataList: dataListConfig.i18n,
|
|
24
|
+
UNotify: notifyDefaultConfig.i18n,
|
|
23
25
|
};
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { onMounted, ref, watch, computed } from "vue";
|
|
2
|
+
|
|
3
|
+
const BREAKPOINT_NAME = {
|
|
4
|
+
xs: "xs",
|
|
5
|
+
sm: "sm",
|
|
6
|
+
md: "md",
|
|
7
|
+
lg: "lg",
|
|
8
|
+
xl: "xl",
|
|
9
|
+
"2xl": "2xl",
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
const BREAKPOINT = {
|
|
13
|
+
xs: 0,
|
|
14
|
+
sm: 640,
|
|
15
|
+
md: 768,
|
|
16
|
+
lg: 1024,
|
|
17
|
+
xl: 1280,
|
|
18
|
+
"2xl": 1536,
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
const mobileDevices = ["xs", "sm"];
|
|
22
|
+
const portableDevices = ["xs", "sm", "md"];
|
|
23
|
+
|
|
24
|
+
export default function useBreakpoint() {
|
|
25
|
+
let timeout;
|
|
26
|
+
|
|
27
|
+
const windowWidth = ref(undefined);
|
|
28
|
+
const currentBreakpoint = ref(BREAKPOINT_NAME.xs);
|
|
29
|
+
|
|
30
|
+
const isMobileBreakpoint = computed(() => {
|
|
31
|
+
return mobileDevices.includes(currentBreakpoint.value);
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
const isTabletBreakpoint = computed(() => {
|
|
35
|
+
return mobileDevices.includes(currentBreakpoint.value);
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
const isLaptopBreakpoint = computed(() => {
|
|
39
|
+
return currentBreakpoint.value === BREAKPOINT_NAME.lg;
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
const isPortableBreakpoint = computed(() => {
|
|
43
|
+
return portableDevices.includes(currentBreakpoint.value);
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
const elementSize = computed(() => {
|
|
47
|
+
return isMobileBreakpoint.value ? BREAKPOINT_NAME.md : BREAKPOINT_NAME.lg;
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
onMounted(() => {
|
|
51
|
+
windowWidth.value = window.innerWidth;
|
|
52
|
+
|
|
53
|
+
window.addEventListener(resizeListener, { passive: true });
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
watch(windowWidth, setBreakpoint, { immediate: true });
|
|
57
|
+
|
|
58
|
+
function resizeListener() {
|
|
59
|
+
if (timeout) {
|
|
60
|
+
window.cancelAnimationFrame(timeout);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
timeout = window.requestAnimationFrame(() => {
|
|
64
|
+
windowWidth.value = window.innerWidth;
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
function setBreakpoint(newWindowWidth) {
|
|
69
|
+
if (newWindowWidth === undefined) return;
|
|
70
|
+
|
|
71
|
+
currentBreakpoint.value = "xs";
|
|
72
|
+
|
|
73
|
+
if (newWindowWidth >= BREAKPOINT.sm && newWindowWidth < BREAKPOINT.smd) {
|
|
74
|
+
currentBreakpoint.value = "sm";
|
|
75
|
+
} else if (newWindowWidth >= BREAKPOINT.md && newWindowWidth < BREAKPOINT.lg) {
|
|
76
|
+
currentBreakpoint.value = "md";
|
|
77
|
+
} else if (newWindowWidth >= BREAKPOINT.lg && newWindowWidth < BREAKPOINT.xl) {
|
|
78
|
+
currentBreakpoint.value = "lg";
|
|
79
|
+
} else if (newWindowWidth >= BREAKPOINT.xl && newWindowWidth < BREAKPOINT["2xl"]) {
|
|
80
|
+
currentBreakpoint.value = "xl";
|
|
81
|
+
} else if (newWindowWidth >= BREAKPOINT["2xl"]) {
|
|
82
|
+
currentBreakpoint.value = "2xl";
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
return {
|
|
87
|
+
isLaptopBreakpoint,
|
|
88
|
+
isTabletBreakpoint,
|
|
89
|
+
isMobileBreakpoint,
|
|
90
|
+
isPortableBreakpoint,
|
|
91
|
+
elementSize,
|
|
92
|
+
};
|
|
93
|
+
}
|
package/index.js
CHANGED
|
@@ -2,6 +2,15 @@ import { createLocale, LocaleSymbol } from "./composable.locale";
|
|
|
2
2
|
|
|
3
3
|
export { default as createVueI18nAdapter } from "./adatper.locale/vue-i18n";
|
|
4
4
|
export { default as defaultEnLocale } from "./adatper.locale/locales/en";
|
|
5
|
+
export {
|
|
6
|
+
notify,
|
|
7
|
+
notifySuccess,
|
|
8
|
+
notifyWarning,
|
|
9
|
+
notifyError,
|
|
10
|
+
clearAllNotifications,
|
|
11
|
+
setDelayedNotify,
|
|
12
|
+
getDelayedNotify,
|
|
13
|
+
} from "./ui.notify/services";
|
|
5
14
|
|
|
6
15
|
export function createVueless(options = {}) {
|
|
7
16
|
const locale = createLocale(options.locale);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vueless",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.52",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "Vue Styleless Component Framework.",
|
|
6
6
|
"homepage": "https://vueless.com",
|
|
@@ -11,8 +11,8 @@
|
|
|
11
11
|
"access": "public"
|
|
12
12
|
},
|
|
13
13
|
"scripts": {
|
|
14
|
-
"lint": "eslint --ext .vue,.js,.ts --no-fix --ignore-path .eslintignore src/ .storybook/
|
|
15
|
-
"lint:fix": "eslint --ext .vue,.js,.ts --fix --ignore-path .eslintignore src/ .storybook/
|
|
14
|
+
"lint": "eslint --ext .vue,.js,.ts --no-fix --ignore-path .eslintignore src/ .storybook/",
|
|
15
|
+
"lint:fix": "eslint --ext .vue,.js,.ts --fix --ignore-path .eslintignore src/ .storybook/",
|
|
16
16
|
"lint:ci": "eslint --ext .vue,.js,.ts --no-fix --ignore-path .eslintignore --max-warnings=0",
|
|
17
17
|
"release:patch": "release-it patch --ci --npm.publish",
|
|
18
18
|
"release:minor": "release-it minor --ci --npm.publish --git.tag --github.release",
|
|
@@ -24,7 +24,6 @@
|
|
|
24
24
|
"package:prepare": "node src/gen.web-types && rm -rf dist && mkdir -p dist && cp -r src/. package.json LICENSE web-types.json README.md dist/ && rm -rf dist/assets && node dist.prepare"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@kyvg/vue3-notification": "^3.2.1",
|
|
28
27
|
"@material-symbols/svg-500": "^0.17.3",
|
|
29
28
|
"@tailwindcss/forms": "^0.5.7",
|
|
30
29
|
"@uppy/core": "^3.10.1",
|
|
@@ -35,8 +34,7 @@
|
|
|
35
34
|
"tailwind-merge": "^2.3.0",
|
|
36
35
|
"tailwindcss": "^3.4.3",
|
|
37
36
|
"vue-tippy": "^6.0.0-beta.0",
|
|
38
|
-
"vuedraggable": "^4.1.0"
|
|
39
|
-
"vuex": "^4.1.0"
|
|
37
|
+
"vuedraggable": "^4.1.0"
|
|
40
38
|
},
|
|
41
39
|
"devDependencies": {
|
|
42
40
|
"@release-it/bumper": "^6.0.1",
|
package/service.ui/index.js
CHANGED
|
@@ -102,6 +102,7 @@ export default class UIServiceDefault {
|
|
|
102
102
|
return color.length === 6 || color.length === 3 ? `${r}, ${g}, ${b}` : "";
|
|
103
103
|
}
|
|
104
104
|
|
|
105
|
+
// TODO: This should be rewrote to support all set of brand colors (not only one).
|
|
105
106
|
setBrandColor(brandColor) {
|
|
106
107
|
function getBrandColor(color, grayColor, brandColors) {
|
|
107
108
|
if (color === "grayscale") {
|
|
@@ -6,7 +6,7 @@ import defaultConfig from "../configs/default.config";
|
|
|
6
6
|
|
|
7
7
|
export function useAttrs(props) {
|
|
8
8
|
const { config, getAttrs, setColor } = useUI(defaultConfig, () => props.config);
|
|
9
|
-
const { button } = config.value;
|
|
9
|
+
const { button, text } = config.value;
|
|
10
10
|
|
|
11
11
|
const cvaButton = cva({
|
|
12
12
|
base: button.base,
|
|
@@ -14,6 +14,12 @@ export function useAttrs(props) {
|
|
|
14
14
|
compoundVariants: button.compoundVariants,
|
|
15
15
|
});
|
|
16
16
|
|
|
17
|
+
const cvaText = cva({
|
|
18
|
+
base: text.base,
|
|
19
|
+
variants: text.variants,
|
|
20
|
+
compoundVariants: text.compoundVariants,
|
|
21
|
+
});
|
|
22
|
+
|
|
17
23
|
const buttonClasses = computed(() =>
|
|
18
24
|
setColor(
|
|
19
25
|
cvaButton({
|
|
@@ -31,8 +37,9 @@ export function useAttrs(props) {
|
|
|
31
37
|
),
|
|
32
38
|
);
|
|
33
39
|
|
|
40
|
+
const textClasses = computed(() => setColor(cvaText({ color: props.color }), props.color));
|
|
34
41
|
const buttonAttrs = getAttrs("button", { classes: buttonClasses });
|
|
35
|
-
const textAttrs = getAttrs("text");
|
|
42
|
+
const textAttrs = getAttrs("text", { classes: textClasses });
|
|
36
43
|
|
|
37
44
|
return {
|
|
38
45
|
textAttrs,
|
|
@@ -9,7 +9,7 @@ export function useAttrs(props) {
|
|
|
9
9
|
const slots = useSlots();
|
|
10
10
|
|
|
11
11
|
const { config, getAttrs, hasSlotContent, setColor } = useUI(defaultConfig, () => props.config);
|
|
12
|
-
const { wrapper, link, text } = config.value;
|
|
12
|
+
const { wrapper, link, text, rightSlot, leftSlot } = config.value;
|
|
13
13
|
|
|
14
14
|
const cvaWrapper = cva({
|
|
15
15
|
base: wrapper.base,
|
|
@@ -29,6 +29,18 @@ export function useAttrs(props) {
|
|
|
29
29
|
compoundVariants: text.compoundVariants,
|
|
30
30
|
});
|
|
31
31
|
|
|
32
|
+
const cvaRightSlot = cva({
|
|
33
|
+
base: rightSlot.base,
|
|
34
|
+
variants: rightSlot.variants,
|
|
35
|
+
compoundVariants: rightSlot.compoundVariants,
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
const cvaLeftSlot = cva({
|
|
39
|
+
base: leftSlot.base,
|
|
40
|
+
variants: leftSlot.variants,
|
|
41
|
+
compoundVariants: leftSlot.compoundVariants,
|
|
42
|
+
});
|
|
43
|
+
|
|
32
44
|
const wrapperClasses = computed(() =>
|
|
33
45
|
setColor(
|
|
34
46
|
cvaWrapper({
|
|
@@ -56,6 +68,14 @@ export function useAttrs(props) {
|
|
|
56
68
|
|
|
57
69
|
const textClasses = computed(() => setColor(cvaText({ color: props.color }), props.color));
|
|
58
70
|
|
|
71
|
+
const rightSlotClasses = computed(() =>
|
|
72
|
+
setColor(cvaRightSlot({ color: props.color }), props.color),
|
|
73
|
+
);
|
|
74
|
+
|
|
75
|
+
const leftSlotClasses = computed(() =>
|
|
76
|
+
setColor(cvaLeftSlot({ color: props.color }), props.color),
|
|
77
|
+
);
|
|
78
|
+
|
|
59
79
|
const wrapperAttrsRaw = getAttrs("wrapper", { classes: wrapperClasses });
|
|
60
80
|
|
|
61
81
|
const wrapperAttrs = computed(() => {
|
|
@@ -83,8 +103,8 @@ export function useAttrs(props) {
|
|
|
83
103
|
};
|
|
84
104
|
});
|
|
85
105
|
|
|
86
|
-
const rightSlotAttrs = getAttrs("rightSlot");
|
|
87
|
-
const leftSlotAttrs = getAttrs("leftSlot");
|
|
106
|
+
const rightSlotAttrs = getAttrs("rightSlot", { classes: rightSlotClasses });
|
|
107
|
+
const leftSlotAttrs = getAttrs("leftSlot", { classes: leftSlotClasses });
|
|
88
108
|
const textAttrs = getAttrs("text", { classes: textClasses });
|
|
89
109
|
|
|
90
110
|
return {
|
|
@@ -4,6 +4,7 @@ export default /*tw*/ {
|
|
|
4
4
|
[&>*:first-child]:rounded-l-lg [&>*:first-child]:rounded-r-none [&>*:first-child]:overflow-hidden
|
|
5
5
|
[&>*:last-child]:rounded-r-lg [&>*:last-child]:rounded-l-none [&>*:last-child]:overflow-hidden
|
|
6
6
|
`,
|
|
7
|
+
toggleItem: "",
|
|
7
8
|
defaultVariants: {
|
|
8
9
|
size: "md",
|
|
9
10
|
block: false,
|
|
@@ -4,7 +4,7 @@ import { cva, cx } from "../../service.ui";
|
|
|
4
4
|
import defaultConfig from "../configs/default.config";
|
|
5
5
|
import { computed } from "vue";
|
|
6
6
|
|
|
7
|
-
export function useAttrs(props, {
|
|
7
|
+
export function useAttrs(props, { isMobileBreakpoint }) {
|
|
8
8
|
const { config, getAttrs, hasSlotContent } = useUI(defaultConfig, () => props.config);
|
|
9
9
|
const { wrapper } = config.value;
|
|
10
10
|
|
|
@@ -33,7 +33,7 @@ export function useAttrs(props, { isMobileDevice }) {
|
|
|
33
33
|
|
|
34
34
|
const footerAttrs = computed(() => {
|
|
35
35
|
const footerMobileReverseClasses =
|
|
36
|
-
props.mobileFooterReverse &&
|
|
36
|
+
props.mobileFooterReverse && isMobileBreakpoint.value && config.value.footerMobileReverse;
|
|
37
37
|
|
|
38
38
|
return {
|
|
39
39
|
...footerAttrsRaw.value,
|
|
@@ -40,7 +40,6 @@
|
|
|
40
40
|
|
|
41
41
|
<script setup>
|
|
42
42
|
import { computed, useSlots } from "vue";
|
|
43
|
-
import { useStore } from "vuex";
|
|
44
43
|
|
|
45
44
|
import UIService from "../service.ui";
|
|
46
45
|
import UHeader from "../ui.text-header";
|
|
@@ -49,11 +48,11 @@ import UDivider from "../ui.container-divider";
|
|
|
49
48
|
import { UCard } from "./constants";
|
|
50
49
|
import defaultConfig from "./configs/default.config";
|
|
51
50
|
import { useAttrs } from "./composable/attrs.composable";
|
|
51
|
+
import useBreakpoint from "../composable.breakpoint";
|
|
52
52
|
|
|
53
53
|
/* Should be a string for correct web-types gen */
|
|
54
54
|
defineOptions({ name: "UCard", inheritAttrs: false });
|
|
55
55
|
|
|
56
|
-
const store = useStore();
|
|
57
56
|
const slots = useSlots();
|
|
58
57
|
|
|
59
58
|
const props = defineProps({
|
|
@@ -127,9 +126,7 @@ const isShownFooter = computed(() => {
|
|
|
127
126
|
return hasSlotContent(slots["footer-left"]) || hasSlotContent(slots["footer-right"]);
|
|
128
127
|
});
|
|
129
128
|
|
|
130
|
-
const
|
|
131
|
-
return store.getters["breakpoint/isMobileDevice"];
|
|
132
|
-
});
|
|
129
|
+
const { isMobileBreakpoint } = useBreakpoint();
|
|
133
130
|
|
|
134
131
|
const {
|
|
135
132
|
hasSlotContent,
|
|
@@ -142,5 +139,5 @@ const {
|
|
|
142
139
|
descriptionAttrs,
|
|
143
140
|
contentAttrs,
|
|
144
141
|
footerAttrs,
|
|
145
|
-
} = useAttrs(props, {
|
|
142
|
+
} = useAttrs(props, { isMobileBreakpoint });
|
|
146
143
|
</script>
|
|
@@ -2,13 +2,14 @@ import useUI from "../../composable.ui";
|
|
|
2
2
|
import { cva, cx } from "../../service.ui";
|
|
3
3
|
|
|
4
4
|
import defaultConfig from "../configs/default.config";
|
|
5
|
-
import { useStore } from "vuex";
|
|
6
5
|
import { computed } from "vue";
|
|
7
6
|
|
|
7
|
+
import useBreakpoint from "../../composable.breakpoint";
|
|
8
|
+
|
|
8
9
|
export function useAttrs(props) {
|
|
9
|
-
const store = useStore();
|
|
10
10
|
const { config, getAttrs, hasSlotContent } = useUI(defaultConfig, () => props.config, "wrapper");
|
|
11
11
|
const { modal } = config.value;
|
|
12
|
+
const { isMobileBreakpoint } = useBreakpoint();
|
|
12
13
|
|
|
13
14
|
const cvaModal = cva({
|
|
14
15
|
base: modal.base,
|
|
@@ -44,9 +45,7 @@ export function useAttrs(props) {
|
|
|
44
45
|
...headerAttrsRaw.value,
|
|
45
46
|
class: cx([
|
|
46
47
|
headerAttrsRaw.value.class,
|
|
47
|
-
props.mobileFooterReverse &&
|
|
48
|
-
store.getters["breakpoint/isMobileDevice"] &&
|
|
49
|
-
config.value.footerMobileReverse,
|
|
48
|
+
props.mobileFooterReverse && isMobileBreakpoint.value && config.value.footerMobileReverse,
|
|
50
49
|
]),
|
|
51
50
|
}));
|
|
52
51
|
|
|
@@ -54,9 +53,7 @@ export function useAttrs(props) {
|
|
|
54
53
|
...footerAttrsRaw.value,
|
|
55
54
|
class: cx([
|
|
56
55
|
footerAttrsRaw.value.class,
|
|
57
|
-
props.mobileFooterReverse &&
|
|
58
|
-
store.getters["breakpoint/isMobileDevice"] &&
|
|
59
|
-
config.value.footerMobileReverse,
|
|
56
|
+
props.mobileFooterReverse && isMobileBreakpoint.value && config.value.footerMobileReverse,
|
|
60
57
|
]),
|
|
61
58
|
}));
|
|
62
59
|
|
|
@@ -1,13 +1,63 @@
|
|
|
1
1
|
import useUI from "../../composable.ui";
|
|
2
2
|
import defaultConfig from "../configs/default.config";
|
|
3
|
+
import { cva } from "../../service.ui/index.js";
|
|
4
|
+
import { computed } from "vue";
|
|
3
5
|
|
|
4
6
|
export function useAttrs(props) {
|
|
5
|
-
const { config, getAttrs, hasSlotContent } = useUI(defaultConfig, () => props.config);
|
|
7
|
+
const { config, getAttrs, hasSlotContent, setColor } = useUI(defaultConfig, () => props.config);
|
|
8
|
+
const { modal, footerLeftFallback, confirmButton, cancelButton } = config.value;
|
|
6
9
|
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
10
|
+
const cvaModal = cva({
|
|
11
|
+
base: modal.base,
|
|
12
|
+
variants: modal.variants,
|
|
13
|
+
compoundVariants: modal.compoundVariants,
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
const cvaFooterLeftFallback = cva({
|
|
17
|
+
base: footerLeftFallback.base,
|
|
18
|
+
variants: footerLeftFallback.variants,
|
|
19
|
+
compoundVariants: footerLeftFallback.compoundVariants,
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
const cvaConfirmButton = cva({
|
|
23
|
+
base: confirmButton.base,
|
|
24
|
+
variants: confirmButton.variants,
|
|
25
|
+
compoundVariants: confirmButton.compoundVariants,
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
const cvaCancelButton = cva({
|
|
29
|
+
base: cancelButton.base,
|
|
30
|
+
variants: cancelButton.variants,
|
|
31
|
+
compoundVariants: cancelButton.compoundVariants,
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
const modalClasses = computed(() => setColor(cvaModal({ color: props.color }), props.color));
|
|
35
|
+
|
|
36
|
+
const footerLeftFallbackClasses = computed(() =>
|
|
37
|
+
setColor(cvaFooterLeftFallback({ color: props.color }), props.color),
|
|
38
|
+
);
|
|
39
|
+
|
|
40
|
+
const confirmButtonClasses = computed(() => cvaConfirmButton({ color: props.color }));
|
|
41
|
+
|
|
42
|
+
const cancelButtonClasses = computed(() => cvaCancelButton({ color: props.color }));
|
|
43
|
+
|
|
44
|
+
const modalAttrsRaw = getAttrs("modal", { isComponent: true, classes: modalClasses });
|
|
45
|
+
const footerLeftFallbackAttrs = getAttrs("footerLeftFallback", {
|
|
46
|
+
classes: footerLeftFallbackClasses,
|
|
47
|
+
});
|
|
48
|
+
const confirmButtonAttrs = getAttrs("confirmButton", {
|
|
49
|
+
isComponent: true,
|
|
50
|
+
classes: confirmButtonClasses,
|
|
51
|
+
});
|
|
52
|
+
const cancelButtonAttrs = getAttrs("cancelButton", {
|
|
53
|
+
isComponent: true,
|
|
54
|
+
classes: cancelButtonClasses,
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
const modalAttrs = computed(() => ({
|
|
58
|
+
...modalAttrsRaw.value,
|
|
59
|
+
class: setColor(modalAttrsRaw.value.class, props.color),
|
|
60
|
+
}));
|
|
11
61
|
|
|
12
62
|
return {
|
|
13
63
|
config,
|
|
@@ -4,7 +4,7 @@ import { cva, cx, isMobileApp } from "../../service.ui";
|
|
|
4
4
|
import defaultConfig from "../configs/default.config";
|
|
5
5
|
import { computed } from "vue";
|
|
6
6
|
|
|
7
|
-
export function useAttrs(props, {
|
|
7
|
+
export function useAttrs(props, { isMobileBreakpoint }) {
|
|
8
8
|
const { config, getAttrs, hasSlotContent } = useUI(defaultConfig, () => props.config);
|
|
9
9
|
const { wrapper, page, rightRounding } = config.value;
|
|
10
10
|
|
|
@@ -62,7 +62,7 @@ export function useAttrs(props, { isMobileDevice }) {
|
|
|
62
62
|
...wrapperAttrsRaw.value,
|
|
63
63
|
class: cx([
|
|
64
64
|
wrapperAttrsRaw.value.class,
|
|
65
|
-
|
|
65
|
+
isMobileBreakpoint.value && !isMobileApp && config.value.wrapperMobile,
|
|
66
66
|
]),
|
|
67
67
|
}));
|
|
68
68
|
|
|
@@ -70,7 +70,7 @@ export function useAttrs(props, { isMobileDevice }) {
|
|
|
70
70
|
...footerAttrsRaw.value,
|
|
71
71
|
class: cx([
|
|
72
72
|
footerAttrsRaw.value.class,
|
|
73
|
-
props.mobileFooterReverse &&
|
|
73
|
+
props.mobileFooterReverse && isMobileBreakpoint.value && config.value.footerMobileReverse,
|
|
74
74
|
]),
|
|
75
75
|
}));
|
|
76
76
|
|
|
@@ -66,7 +66,8 @@
|
|
|
66
66
|
|
|
67
67
|
<script setup>
|
|
68
68
|
import { computed, useSlots, onMounted } from "vue";
|
|
69
|
-
|
|
69
|
+
|
|
70
|
+
import useBreakpoint from "../composable.breakpoint";
|
|
70
71
|
|
|
71
72
|
import ULink from "../ui.button-link/index.vue";
|
|
72
73
|
import UIcon from "../ui.image-icon/index.vue";
|
|
@@ -79,7 +80,6 @@ import { UPage } from "./constants";
|
|
|
79
80
|
import { useAttrs } from "./composables/attrs.composable";
|
|
80
81
|
|
|
81
82
|
const slots = useSlots();
|
|
82
|
-
const store = useStore();
|
|
83
83
|
|
|
84
84
|
/* Should be a string for correct web-types gen */
|
|
85
85
|
defineOptions({ name: "UPage", inheritAttrs: false });
|
|
@@ -168,9 +168,7 @@ const props = defineProps({
|
|
|
168
168
|
},
|
|
169
169
|
});
|
|
170
170
|
|
|
171
|
-
const
|
|
172
|
-
return store.getters["breakpoint/isMobileDevice"];
|
|
173
|
-
});
|
|
171
|
+
const { isMobileBreakpoint } = useBreakpoint();
|
|
174
172
|
|
|
175
173
|
const {
|
|
176
174
|
config,
|
|
@@ -190,7 +188,7 @@ const {
|
|
|
190
188
|
footerRightAttrs,
|
|
191
189
|
rightRoundingWrapperAttrs,
|
|
192
190
|
hasSlotContent,
|
|
193
|
-
} = useAttrs(props, {
|
|
191
|
+
} = useAttrs(props, { isMobileBreakpoint });
|
|
194
192
|
|
|
195
193
|
const isShownHeader = computed(() => {
|
|
196
194
|
const isHeaderLeftSlot = hasSlotContent(slots["header-left"]);
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
export default /*tw*/ {
|
|
2
|
-
wrapper: "w-fit overflow-hidden rounded-lg border focus:outline-none border-
|
|
2
|
+
wrapper: "w-fit overflow-hidden rounded-lg border focus:outline-none border-brand-300 bg-white px-1 pb-4 shadow",
|
|
3
3
|
navigation: "flex items-center justify-between px-3 pt-2",
|
|
4
4
|
navigationSwitchViewButton: "",
|
|
5
5
|
dayViewSwitchLabel: "flex gap-1",
|
|
6
|
-
dayViewSwitchLabelMonth: "text-
|
|
6
|
+
dayViewSwitchLabelMonth: "text-brand-900",
|
|
7
7
|
dayViewSwitchLabelIcon: "",
|
|
8
8
|
dayViewSwitchLabelIconName: "keyboard_arrow_right",
|
|
9
9
|
nextPrevWrapper: {
|
|
@@ -21,35 +21,35 @@ export default /*tw*/ {
|
|
|
21
21
|
prevIconName: "keyboard_arrow_left",
|
|
22
22
|
dayViewWrapper: "w-64 px-3 pt-2",
|
|
23
23
|
weekDaysWrapper: "grid grid-cols-7",
|
|
24
|
-
weekDay: "flex size-8 items-center justify-center text-xs uppercase text-
|
|
24
|
+
weekDay: "flex size-8 items-center justify-center text-xs uppercase text-brand-500",
|
|
25
25
|
daysWrapper: "grid grid-cols-7",
|
|
26
|
-
day: "mx-auto size-8 rounded-lg text-sm hover:bg-
|
|
27
|
-
activeDay: "bg-
|
|
28
|
-
inRangeFirstDay: "rounded-none rounded-l-lg bg-
|
|
29
|
-
inRangeLastDay: "rounded-none rounded-r-lg bg-
|
|
30
|
-
inRangeDay: "bg-
|
|
31
|
-
selectedDay: "bg-
|
|
32
|
-
currentDay: "hover:bg-
|
|
33
|
-
anotherMonthDay: "hover:bg-
|
|
26
|
+
day: "mx-auto size-8 rounded-lg text-sm hover:bg-brand-100 disabled:opacity-50 disabled:cursor-not-allowed",
|
|
27
|
+
activeDay: "bg-brand-100 hover:bg-brand-100",
|
|
28
|
+
inRangeFirstDay: "rounded-none rounded-l-lg bg-brand-200 text-brand-900 hover:bg-brand-200",
|
|
29
|
+
inRangeLastDay: "rounded-none rounded-r-lg bg-brand-200 text-brand-900 hover:bg-brand-200",
|
|
30
|
+
inRangeDay: "bg-brand-100 text-brand-900 hover:!bg-brand-200 rounded-none",
|
|
31
|
+
selectedDay: "bg-brand-900 text-white hover:bg-brand-900",
|
|
32
|
+
currentDay: "hover:bg-brand-100 border-2 border-brand-900",
|
|
33
|
+
anotherMonthDay: "hover:bg-brand-100 text-brand-400",
|
|
34
34
|
monthViewWrapper: "grid w-64 grid-cols-4 items-center justify-center px-3 pt-2",
|
|
35
35
|
month: `
|
|
36
|
-
mx-auto flex h-12 w-full items-center justify-center rounded-lg text-sm hover:cursor-pointer hover:bg-
|
|
36
|
+
mx-auto flex h-12 w-full items-center justify-center rounded-lg text-sm hover:cursor-pointer hover:bg-brand-100
|
|
37
37
|
disabled:opacity-50 disabled:cursor-not-allowed
|
|
38
38
|
`,
|
|
39
|
-
selectedMonth: "bg-
|
|
40
|
-
activeMonth: "bg-
|
|
39
|
+
selectedMonth: "bg-brand-900 hover:bg-brand-900 text-white",
|
|
40
|
+
activeMonth: "bg-brand-100",
|
|
41
41
|
yearViewWrapper: "grid w-64 grid-cols-4 items-center justify-center px-3 pt-2",
|
|
42
42
|
year: `
|
|
43
|
-
mx-auto flex h-12 w-full items-center justify-center rounded-lg text-sm hover:cursor-pointer hover:bg-
|
|
43
|
+
mx-auto flex h-12 w-full items-center justify-center rounded-lg text-sm hover:cursor-pointer hover:bg-brand-100
|
|
44
44
|
disabled:opacity-50 disabled:cursor-not-allowed
|
|
45
45
|
`,
|
|
46
|
-
selectedYear: "bg-
|
|
47
|
-
activeYear: "bg-
|
|
46
|
+
selectedYear: "bg-brand-900 hover:bg-brand-900 text-white",
|
|
47
|
+
activeYear: "bg-brand-100",
|
|
48
48
|
timepickerWrapper: `
|
|
49
|
-
|
|
49
|
+
mx-2 -mb-1 mt-2 flex items-center justify-between gap-2 border-t border-brand-200 pl-2 pr-1 pt-3 text-sm
|
|
50
50
|
`,
|
|
51
51
|
timepickerLabel: "w-full",
|
|
52
|
-
timepickerInputWrapper: "flex items-center gap-px rounded-lg border border-
|
|
52
|
+
timepickerInputWrapper: "flex items-center gap-px rounded-lg border border-brand-300",
|
|
53
53
|
timepickerLeftInput: `
|
|
54
54
|
w-11 rounded-l-lg border-none px-2.5 py-1.5 text-center text-sm focus:border-none focus:outline-none
|
|
55
55
|
`,
|
|
@@ -57,8 +57,8 @@ export default /*tw*/ {
|
|
|
57
57
|
w-11 rounded-r-lg border-none px-2.5 py-1.5 text-center text-sm focus:border-none focus:outline-none
|
|
58
58
|
`,
|
|
59
59
|
submitButton: `
|
|
60
|
-
rounded-lg border-none bg-
|
|
61
|
-
focus:ring-0 hover:bg-
|
|
60
|
+
rounded-lg border-none bg-brand-900/10 px-2.5 py-1.5 text-sm font-normal text-brand-900 outline-none
|
|
61
|
+
focus:ring-0 hover:bg-brand-900/10
|
|
62
62
|
`,
|
|
63
63
|
i18n: {
|
|
64
64
|
weekdays: {
|
|
@@ -5,7 +5,7 @@ import { cva } from "../../service.ui";
|
|
|
5
5
|
import { computed } from "vue";
|
|
6
6
|
|
|
7
7
|
export function useAttrs(props) {
|
|
8
|
-
const { config, getAttrs
|
|
8
|
+
const { config, getAttrs } = useUI(defaultConfig, () => props.config);
|
|
9
9
|
const { radio } = config.value;
|
|
10
10
|
|
|
11
11
|
const cvaRadio = cva({
|
|
@@ -14,14 +14,7 @@ export function useAttrs(props) {
|
|
|
14
14
|
compoundVariants: radio.compoundVariants,
|
|
15
15
|
});
|
|
16
16
|
|
|
17
|
-
const radioClasses = computed(() =>
|
|
18
|
-
setColor(
|
|
19
|
-
cvaRadio({
|
|
20
|
-
color: props.color,
|
|
21
|
-
}),
|
|
22
|
-
props.color,
|
|
23
|
-
),
|
|
24
|
-
);
|
|
17
|
+
const radioClasses = computed(() => cvaRadio({ color: props.color }));
|
|
25
18
|
|
|
26
19
|
const wrapperAttrs = getAttrs("wrapper");
|
|
27
20
|
const listAttrs = getAttrs("listAttrs");
|