@indielayer/ui 1.0.9 → 1.0.10
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 +1 -1
- package/README.md +2 -2
- package/{lib/nuxt.js → exports/nuxt.mjs} +1 -1
- package/{src/exports → exports}/nuxt.plugin.js +1 -1
- package/lib/components/alert/Alert.vue.d.ts +11 -2
- package/lib/components/avatar/Avatar.vue.d.ts +9 -2
- package/lib/components/badge/Badge.vue.d.ts +10 -2
- package/lib/components/breadcrumbs/Breadcrumbs.vue.d.ts +2 -2
- package/lib/components/button/Button.vue.d.ts +9 -2
- package/lib/components/button/ButtonGroup.vue.d.ts +9 -2
- package/lib/components/card/Card.vue.d.ts +8 -1
- package/lib/components/checkbox/Checkbox.vue.d.ts +12 -4
- package/lib/components/collapse/Collapse.vue.d.ts +15 -1
- package/lib/components/container/Container.vue.d.ts +8 -1
- package/lib/components/divider/Divider.vue.d.ts +1 -1
- package/lib/components/drawer/Drawer.vue.d.ts +11 -2
- package/lib/components/form/Form.vue.d.ts +10 -3
- package/lib/components/helpers/InputError.d.ts +2 -2
- package/lib/components/icon/Icon.vue.d.ts +1 -1
- package/lib/components/image/Image.vue.d.ts +1 -1
- package/lib/components/input/Input.vue.d.ts +4 -4
- package/lib/components/link/Link.vue.d.ts +8 -1
- package/lib/components/menu/Menu.vue.d.ts +1 -1
- package/lib/components/menu/MenuItem.vue.d.ts +11 -2
- package/lib/components/modal/Modal.vue.d.ts +11 -1
- package/lib/components/notifications/Notifications.vue.d.ts +13 -6
- package/lib/components/pagination/Pagination.vue.d.ts +1 -1
- package/lib/components/pagination/PaginationItem.vue.d.ts +1 -1
- package/lib/components/popover/Popover.vue.d.ts +11 -3
- package/lib/components/popover/PopoverContainer.vue.d.ts +8 -1
- package/lib/components/progress/Progress.theme.d.ts +3 -1
- package/lib/components/progress/Progress.vue.d.ts +2 -2
- package/lib/components/radio/Radio.vue.d.ts +11 -4
- package/lib/components/scroll/Scroll.vue.d.ts +8 -1
- package/lib/components/select/Select.vue.d.ts +11 -4
- package/lib/components/skeleton/Skeleton.vue.d.ts +1 -1
- package/lib/components/slider/Slider.vue.d.ts +16 -4
- package/lib/components/spacer/Spacer.d.ts +1 -1
- package/lib/components/spinner/Spinner.vue.d.ts +1 -1
- package/lib/components/tab/Tab.vue.d.ts +14 -1
- package/lib/components/tab/TabGroup.vue.d.ts +8 -1
- package/lib/components/table/Table.vue.d.ts +12 -5
- package/lib/components/table/TableBody.d.ts +1 -1
- package/lib/components/table/TableCell.vue.d.ts +8 -1
- package/lib/components/table/TableHead.d.ts +1 -1
- package/lib/components/table/TableHeader.vue.d.ts +10 -3
- package/lib/components/table/TableRow.vue.d.ts +8 -1
- package/lib/components/tag/Tag.vue.d.ts +9 -2
- package/lib/components/textarea/Textarea.vue.d.ts +3 -3
- package/lib/components/toggle/Toggle.vue.d.ts +4 -4
- package/lib/components/tooltip/Tooltip.vue.d.ts +9 -1
- package/lib/composables/colors.d.ts +4 -3
- package/lib/composables/common.d.ts +1 -1
- package/lib/composables/css.d.ts +1 -1
- package/lib/composables/notifications.d.ts +1 -1
- package/lib/composables/theme.d.ts +1 -1
- package/lib/create.d.ts +1 -1
- package/lib/index.cjs.js +1 -1
- package/lib/index.es.js +3959 -5956
- package/lib/version.d.ts +1 -1
- package/package.json +51 -51
- package/src/components/alert/Alert.vue +2 -1
- package/src/components/avatar/Avatar.vue +2 -1
- package/src/components/breadcrumbs/Breadcrumbs.vue +7 -7
- package/src/components/button/Button.theme.ts +5 -11
- package/src/components/button/Button.vue +2 -1
- package/src/components/button/ButtonGroup.vue +4 -4
- package/src/components/checkbox/Checkbox.vue +1 -1
- package/src/components/collapse/Collapse.vue +12 -12
- package/src/components/drawer/Drawer.vue +24 -24
- package/src/components/form/Form.vue +8 -9
- package/src/components/input/Input.vue +2 -2
- package/src/components/link/Link.vue +4 -1
- package/src/components/menu/MenuItem.vue +11 -6
- package/src/components/modal/Modal.vue +1 -1
- package/src/components/notifications/Notifications.vue +16 -16
- package/src/components/popover/Popover.vue +31 -27
- package/src/components/radio/Radio.vue +3 -2
- package/src/components/scroll/Scroll.vue +23 -16
- package/src/components/select/Select.vue +3 -4
- package/src/components/table/Table.vue +6 -6
- package/src/components/table/TableCell.vue +2 -2
- package/src/components/table/TableHeader.vue +2 -2
- package/src/components/table/TableRow.vue +1 -1
- package/src/components/textarea/Textarea.vue +0 -0
- package/src/composables/colors-utils.ts +3 -268
- package/src/composables/colors.ts +16 -14
- package/src/composables/css.ts +4 -4
- package/src/composables/inputtable.ts +4 -4
- package/src/composables/interactive.ts +2 -2
- package/src/composables/theme.ts +6 -6
- package/src/create.ts +5 -5
- package/src/version.ts +1 -1
- package/volar.d.ts +1 -3
- package/lib/nuxt.plugin.js +0 -8
- package/src/exports/nuxt.js +0 -33
- package/src/exports/tailwind.preset.js +0 -55
- /package/{lib → exports}/tailwind.preset.js +0 -0
package/lib/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: "1.0.
|
|
1
|
+
declare const _default: "1.0.10";
|
|
2
2
|
export default _default;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@indielayer/ui",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.10",
|
|
4
4
|
"description": "Indielayer UI Components with Tailwind CSS build for Vue 3",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "João Teixeira",
|
|
@@ -21,74 +21,60 @@
|
|
|
21
21
|
"lib",
|
|
22
22
|
"src",
|
|
23
23
|
"*.d.ts",
|
|
24
|
+
"exports",
|
|
24
25
|
"README.md"
|
|
25
26
|
],
|
|
26
27
|
"main": "lib/index.cjs.js",
|
|
27
28
|
"module": "lib/index.es.js",
|
|
28
|
-
"
|
|
29
|
+
"types": "lib/index.d.ts",
|
|
29
30
|
"exports": {
|
|
30
31
|
".": {
|
|
31
32
|
"import": "./lib/index.es.js",
|
|
32
|
-
"require": "./lib/index.cjs.js"
|
|
33
|
+
"require": "./lib/index.cjs.js",
|
|
34
|
+
"types": "./lib/index.d.ts"
|
|
33
35
|
},
|
|
34
|
-
"./nuxt": "./
|
|
35
|
-
"./
|
|
36
|
-
"./
|
|
37
|
-
"./
|
|
38
|
-
"./
|
|
39
|
-
"./tailwind.preset": "./lib/tailwind.preset.js",
|
|
40
|
-
"./tailwind.preset.js": "./lib/tailwind.preset.js"
|
|
36
|
+
"./nuxt": "./exports/nuxt.mjs",
|
|
37
|
+
"./nuxt.plugin": "./exports/nuxt.plugin.js",
|
|
38
|
+
"./nuxt.plugin.js": "./exports/nuxt.plugin.js",
|
|
39
|
+
"./tailwind.preset": "./exports/tailwind.preset.js",
|
|
40
|
+
"./tailwind.preset.js": "./exports/tailwind.preset.js"
|
|
41
41
|
},
|
|
42
42
|
"sideEffects": false,
|
|
43
|
-
"scripts": {
|
|
44
|
-
"dev": "vite build --watch",
|
|
45
|
-
"dev2": "pnpm build-only && chokidar \"./src/**\" -c \"pnpm build-only\"",
|
|
46
|
-
"build": "pnpm generate && vite build",
|
|
47
|
-
"build-prod": "pnpm build && pnpm gen-types",
|
|
48
|
-
"build-only": "vite build",
|
|
49
|
-
"generate": "pnpm gen-version",
|
|
50
|
-
"gen-types": "vue-tsc --declaration --emitDeclarationOnly -p tsconfig.vitest.json --composite false",
|
|
51
|
-
"gen-version": "node .scripts/gen-version.js",
|
|
52
|
-
"test": "pnpm test:unit",
|
|
53
|
-
"test:unit": "vitest --environment jsdom",
|
|
54
|
-
"test:e2e": "start-server-and-test preview http://127.0.0.1:5050/ 'cypress open'",
|
|
55
|
-
"test:e2e:ci": "start-server-and-test preview http://127.0.0.1:5050/ 'cypress run'",
|
|
56
|
-
"typecheck": "vue-tsc --noEmit -p tsconfig.vitest.json --composite false",
|
|
57
|
-
"prepublish": "pnpm build-prod"
|
|
58
|
-
},
|
|
59
43
|
"peerDependencies": {
|
|
60
44
|
"tailwindcss": "^3.0.0",
|
|
61
45
|
"vue": "^3.0.0"
|
|
62
46
|
},
|
|
63
47
|
"devDependencies": {
|
|
64
|
-
"@cypress/vite-dev-server": "^
|
|
65
|
-
"@cypress/vue": "^
|
|
66
|
-
"@
|
|
67
|
-
"@
|
|
68
|
-
"@
|
|
69
|
-
"@types/
|
|
70
|
-
"@
|
|
71
|
-
"@
|
|
72
|
-
"@
|
|
73
|
-
"@vue
|
|
74
|
-
"@
|
|
48
|
+
"@cypress/vite-dev-server": "^5.0.5",
|
|
49
|
+
"@cypress/vue": "^5.0.5",
|
|
50
|
+
"@indielayer/stylelint-config": "^1.0.0",
|
|
51
|
+
"@rushstack/eslint-patch": "^1.3.2",
|
|
52
|
+
"@tsconfig/node18": "^2.0.1",
|
|
53
|
+
"@types/jsdom": "^21.1.1",
|
|
54
|
+
"@types/node": "^18.16.18",
|
|
55
|
+
"@types/ramda": "^0.29.2",
|
|
56
|
+
"@vitejs/plugin-vue": "^4.2.3",
|
|
57
|
+
"@vitejs/plugin-vue-jsx": "^3.0.1",
|
|
58
|
+
"@vue/test-utils": "^2.4.0",
|
|
59
|
+
"@vue/tsconfig": "^0.4.0",
|
|
60
|
+
"@vueuse/core": "^10.2.0",
|
|
75
61
|
"autoprefixer": "^10.4.0",
|
|
76
62
|
"c8": "^7.12.0",
|
|
77
|
-
"chokidar-cli": "^3.0.0",
|
|
78
63
|
"clean-css": "^5.3.0",
|
|
79
|
-
"cypress": "^
|
|
80
|
-
"eslint": "^8.
|
|
81
|
-
"eslint-plugin-cypress": "^2.
|
|
82
|
-
"jsdom": "^
|
|
64
|
+
"cypress": "^12.16.0",
|
|
65
|
+
"eslint": "^8.43.0",
|
|
66
|
+
"eslint-plugin-cypress": "^2.13.3",
|
|
67
|
+
"jsdom": "^22.1.0",
|
|
83
68
|
"postcss": "^8.4.4",
|
|
84
|
-
"ramda": "^0.
|
|
69
|
+
"ramda": "^0.29.0",
|
|
85
70
|
"start-server-and-test": "^1.14.0",
|
|
86
|
-
"
|
|
87
|
-
"
|
|
88
|
-
"
|
|
89
|
-
"
|
|
90
|
-
"
|
|
91
|
-
"vue
|
|
71
|
+
"stylelint": "^14.16.1",
|
|
72
|
+
"tailwindcss": "^3.3.2",
|
|
73
|
+
"typescript": "^5.2.2",
|
|
74
|
+
"vite": "^4.3.9",
|
|
75
|
+
"vitest": "^0.32.2",
|
|
76
|
+
"vue": "^3.3.4",
|
|
77
|
+
"vue-tsc": "^1.8.2"
|
|
92
78
|
},
|
|
93
79
|
"browserslist": [
|
|
94
80
|
"> 1%",
|
|
@@ -107,5 +93,19 @@
|
|
|
107
93
|
"publishConfig": {
|
|
108
94
|
"access": "public"
|
|
109
95
|
},
|
|
110
|
-
"
|
|
111
|
-
|
|
96
|
+
"scripts": {
|
|
97
|
+
"dev": "pnpm generate && vite build --watch",
|
|
98
|
+
"build": "pnpm generate && vite build",
|
|
99
|
+
"build:prod": "pnpm build && pnpm gen-types",
|
|
100
|
+
"build:only": "vite build",
|
|
101
|
+
"generate": "pnpm gen-version",
|
|
102
|
+
"gen-types": "vue-tsc --declaration --emitDeclarationOnly -p tsconfig.vitest.json --composite false",
|
|
103
|
+
"gen-version": "node .scripts/gen-version.js",
|
|
104
|
+
"test": "pnpm test:unit",
|
|
105
|
+
"test:unit": "vitest --environment jsdom",
|
|
106
|
+
"test:e2e": "start-server-and-test preview http://127.0.0.1:5050/ 'cypress open'",
|
|
107
|
+
"test:e2e:ci": "start-server-and-test preview http://127.0.0.1:5050/ 'cypress run'",
|
|
108
|
+
"typecheck": "vue-tsc --noEmit -p tsconfig.vitest.json --composite false",
|
|
109
|
+
"stylelint": "stylelint \"**/*.{css,vue,postcss,scss,sass}\" --ignore-path .gitignore"
|
|
110
|
+
}
|
|
111
|
+
}
|
|
@@ -79,7 +79,8 @@ const { styles, classes, className } = useTheme('alert', theme, props)
|
|
|
79
79
|
box-shadow: 0 0 #000, 0 0 #000, 0 10px 15px -3px var(--x-alert-glow), 0 4px 6px -4px var(--x-alert-glow);
|
|
80
80
|
}
|
|
81
81
|
|
|
82
|
-
:global(.dark) &,
|
|
82
|
+
:global(.dark) &,
|
|
83
|
+
&:global(.dark) {
|
|
83
84
|
color: var(--x-alert-dark-text, var(--x-alert-text));
|
|
84
85
|
background-color: var(--x-alert-dark-bg, var(--x-alert-bg));
|
|
85
86
|
border-color: var(--x-alert-dark-border, var(--x-alert-border));
|
|
@@ -92,7 +92,8 @@ const { styles, classes, className } = useTheme('avatar', theme, props, { source
|
|
|
92
92
|
background-color: var(--x-avatar-bg);
|
|
93
93
|
border-color: var(--x-avatar-border);
|
|
94
94
|
|
|
95
|
-
:global(.dark) &,
|
|
95
|
+
:global(.dark) &,
|
|
96
|
+
&:global(.dark) {
|
|
96
97
|
color: var(--x-avatar-dark-text, var(--x-avatar-text));
|
|
97
98
|
background-color: var(--x-avatar-dark-bg, var(--x-avatar-bg));
|
|
98
99
|
border-color: var(--x-avatar-dark-border, var(--x-avatar-border));
|
|
@@ -14,13 +14,13 @@ import XLink from '../../components/link/Link.vue'
|
|
|
14
14
|
import theme from './Breadcrumbs.theme'
|
|
15
15
|
|
|
16
16
|
export type BreadcrumbItem = {
|
|
17
|
-
label: string
|
|
18
|
-
to?: string | object
|
|
19
|
-
href?: string
|
|
20
|
-
color?: string
|
|
21
|
-
icon?: string
|
|
22
|
-
shadow?: boolean
|
|
23
|
-
underline?: boolean
|
|
17
|
+
label: string;
|
|
18
|
+
to?: string | object;
|
|
19
|
+
href?: string;
|
|
20
|
+
color?: string;
|
|
21
|
+
icon?: string;
|
|
22
|
+
shadow?: boolean;
|
|
23
|
+
underline?: boolean;
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
const props = defineProps({
|
|
@@ -70,10 +70,8 @@ export default {
|
|
|
70
70
|
},
|
|
71
71
|
}))
|
|
72
72
|
}
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
// light
|
|
76
|
-
else if (isLight) {
|
|
73
|
+
} else if (isLight) {
|
|
74
|
+
// light
|
|
77
75
|
if (!props.outlined || props.disabled) vars.push(css.get('border', 'transparent'))
|
|
78
76
|
|
|
79
77
|
if (props.disabled) {
|
|
@@ -103,10 +101,8 @@ export default {
|
|
|
103
101
|
},
|
|
104
102
|
}))
|
|
105
103
|
}
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
// ghost
|
|
109
|
-
else if (props.ghost) {
|
|
104
|
+
} else if (props.ghost) {
|
|
105
|
+
// ghost
|
|
110
106
|
if (!props.outlined) vars.push(css.get('border', 'transparent'))
|
|
111
107
|
|
|
112
108
|
if (props.color) {
|
|
@@ -162,9 +158,7 @@ export default {
|
|
|
162
158
|
}
|
|
163
159
|
}
|
|
164
160
|
}
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
else {
|
|
161
|
+
} else {
|
|
168
162
|
// outlined
|
|
169
163
|
if (props.outlined) {
|
|
170
164
|
if (props.disabled) {
|
|
@@ -150,7 +150,8 @@ defineExpose({ focus, blur })
|
|
|
150
150
|
border-color: var(--x-button-border-active, var(--x-button-border));
|
|
151
151
|
}
|
|
152
152
|
|
|
153
|
-
:global(.dark) &,
|
|
153
|
+
:global(.dark) &,
|
|
154
|
+
&:global(.dark) {
|
|
154
155
|
color: var(--x-button-dark-text, var(--x-button-text));
|
|
155
156
|
background-color: var(--x-button-dark-bg, var(--x-button-bg));
|
|
156
157
|
border-color: var(--x-button-dark-border, var(--x-button-border));
|
|
@@ -53,21 +53,21 @@ const { className, classes, styles } = useTheme('button-group', theme, props)
|
|
|
53
53
|
.button-group {
|
|
54
54
|
&:not(&--rounded) {
|
|
55
55
|
> :first-child {
|
|
56
|
-
@apply rounded-l-md
|
|
56
|
+
@apply rounded-l-md;
|
|
57
57
|
}
|
|
58
58
|
|
|
59
59
|
> :last-child {
|
|
60
|
-
@apply rounded-r-md
|
|
60
|
+
@apply rounded-r-md;
|
|
61
61
|
}
|
|
62
62
|
}
|
|
63
63
|
|
|
64
64
|
&--rounded {
|
|
65
65
|
> :first-of-type {
|
|
66
|
-
@apply rounded-l-full
|
|
66
|
+
@apply rounded-l-full;
|
|
67
67
|
}
|
|
68
68
|
|
|
69
69
|
> :last-child {
|
|
70
|
-
@apply rounded-r-full
|
|
70
|
+
@apply rounded-r-full;
|
|
71
71
|
}
|
|
72
72
|
}
|
|
73
73
|
}
|
|
@@ -112,7 +112,7 @@ defineExpose({ focus, blur, toggle, reset, validate, setError })
|
|
|
112
112
|
<style lang="postcss" module>
|
|
113
113
|
.checkbox {
|
|
114
114
|
&--glow {
|
|
115
|
-
box-shadow: 0 0 #000, 0 0 #000, 0 10px 15px -3px var(--x-checkbox-glow),0 4px 6px -4px var(--x-checkbox-glow);
|
|
115
|
+
box-shadow: 0 0 #000, 0 0 #000, 0 10px 15px -3px var(--x-checkbox-glow), 0 4px 6px -4px var(--x-checkbox-glow);
|
|
116
116
|
}
|
|
117
117
|
}
|
|
118
118
|
</style>
|
|
@@ -32,48 +32,48 @@ watch(() => props.expanded, () => {
|
|
|
32
32
|
collapsed.value = !props.expanded
|
|
33
33
|
})
|
|
34
34
|
|
|
35
|
-
function onBeforeEnter(el:
|
|
36
|
-
if (animated.value) el.style.height = '0px'
|
|
35
|
+
function onBeforeEnter(el: Element) {
|
|
36
|
+
if (animated.value) (el as HTMLElement).style.height = '0px'
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
-
function onEnter(el:
|
|
39
|
+
function onEnter(el: Element, done: () => void) {
|
|
40
40
|
if (!animated.value) done()
|
|
41
41
|
else {
|
|
42
42
|
el.addEventListener('transitionend', done)
|
|
43
43
|
setTimeout(() => {
|
|
44
|
-
el.style.height = `${el.scrollHeight}px`
|
|
44
|
+
(el as HTMLElement).style.height = `${el.scrollHeight}px`
|
|
45
45
|
}, 1)
|
|
46
46
|
}
|
|
47
47
|
}
|
|
48
48
|
|
|
49
|
-
function onAfterEnter(el:
|
|
49
|
+
function onAfterEnter(el: Element) {
|
|
50
50
|
if (!animated.value) {
|
|
51
51
|
animated.value = true
|
|
52
52
|
} else {
|
|
53
|
-
el.style.removeProperty('height')
|
|
53
|
+
(el as HTMLElement).style.removeProperty('height')
|
|
54
54
|
}
|
|
55
55
|
}
|
|
56
56
|
|
|
57
|
-
function onBeforeLeave(el:
|
|
57
|
+
function onBeforeLeave(el: Element) {
|
|
58
58
|
if (!animated.value) return
|
|
59
|
-
el.style.height = `${el.scrollHeight}px`
|
|
59
|
+
(el as HTMLElement).style.height = `${el.scrollHeight}px`
|
|
60
60
|
}
|
|
61
61
|
|
|
62
|
-
function onLeave(el:
|
|
62
|
+
function onLeave(el: Element, done: () => void) {
|
|
63
63
|
if (!animated.value) done()
|
|
64
64
|
else {
|
|
65
65
|
el.addEventListener('transitionend', done)
|
|
66
66
|
setTimeout(() => {
|
|
67
|
-
el.style.height = '0px'
|
|
67
|
+
(el as HTMLElement).style.height = '0px'
|
|
68
68
|
}, 1)
|
|
69
69
|
}
|
|
70
70
|
}
|
|
71
71
|
|
|
72
|
-
function onAfterLeave(el:
|
|
72
|
+
function onAfterLeave(el: Element) {
|
|
73
73
|
if (!animated.value) {
|
|
74
74
|
animated.value = true
|
|
75
75
|
} else {
|
|
76
|
-
el.style.removeProperty('height')
|
|
76
|
+
(el as HTMLElement).style.removeProperty('height')
|
|
77
77
|
}
|
|
78
78
|
}
|
|
79
79
|
|
|
@@ -7,7 +7,7 @@ export default {
|
|
|
7
7
|
|
|
8
8
|
<script setup lang="ts">
|
|
9
9
|
import { computed, onMounted, ref, watch, watchEffect, type PropType } from 'vue'
|
|
10
|
-
import { breakpointsTailwind,
|
|
10
|
+
import { breakpointsTailwind, useBreakpoints, useEventListener, useSwipe, type Breakpoints, type UseSwipeDirection } from '@vueuse/core'
|
|
11
11
|
import { useTheme } from '../../composables/theme'
|
|
12
12
|
|
|
13
13
|
import XScroll from '../../components/scroll/Scroll.vue'
|
|
@@ -86,20 +86,20 @@ const { lengthX, lengthY } = useSwipe(drawerRef, {
|
|
|
86
86
|
// left.value = '0'
|
|
87
87
|
// }
|
|
88
88
|
// },
|
|
89
|
-
// onSwipeEnd(e: TouchEvent, direction:
|
|
89
|
+
// onSwipeEnd(e: TouchEvent, direction: UseSwipeDirection) {
|
|
90
90
|
// if (lengthX.value < 0 && props.width && (Math.abs(lengthX.value) / props.width) >= 0.5) {
|
|
91
91
|
// left.value = '100%'
|
|
92
92
|
// } else {
|
|
93
93
|
// left.value = '0'
|
|
94
94
|
// }
|
|
95
95
|
// },
|
|
96
|
-
onSwipeEnd(e: TouchEvent, direction:
|
|
96
|
+
onSwipeEnd(e: TouchEvent, direction: UseSwipeDirection) {
|
|
97
97
|
if (detached.value) {
|
|
98
98
|
if (
|
|
99
|
-
(props.position === 'left' && direction === '
|
|
100
|
-
(props.position === 'right' && direction === '
|
|
101
|
-
(props.position === 'top' && direction === '
|
|
102
|
-
(props.position === 'bottom' && direction === '
|
|
99
|
+
(props.position === 'left' && direction === 'left') ||
|
|
100
|
+
(props.position === 'right' && direction === 'right') ||
|
|
101
|
+
(props.position === 'top' && direction === 'up') ||
|
|
102
|
+
(props.position === 'bottom' && direction === 'down')
|
|
103
103
|
) close()
|
|
104
104
|
}
|
|
105
105
|
},
|
|
@@ -129,15 +129,15 @@ const autoClasses = computed(() => {
|
|
|
129
129
|
return c
|
|
130
130
|
})
|
|
131
131
|
|
|
132
|
-
function onBeforeEnter(el:
|
|
132
|
+
function onBeforeEnter(el: Element) {
|
|
133
133
|
el.classList.add('inset-0')
|
|
134
|
-
if (props.position === 'top') el.style.top = `-${props.height}px`
|
|
135
|
-
else if (props.position === 'bottom') el.style.bottom = `-${props.height}px`
|
|
136
|
-
else if (props.position === 'left') el.style.left = `-${props.width}px`
|
|
137
|
-
else if (props.position === 'right') el.style.right = `-${props.width}px`
|
|
134
|
+
if (props.position === 'top') (el as HTMLElement).style.top = `-${props.height}px`
|
|
135
|
+
else if (props.position === 'bottom') (el as HTMLElement).style.bottom = `-${props.height}px`
|
|
136
|
+
else if (props.position === 'left') (el as HTMLElement).style.left = `-${props.width}px`
|
|
137
|
+
else if (props.position === 'right') (el as HTMLElement).style.right = `-${props.width}px`
|
|
138
138
|
}
|
|
139
139
|
|
|
140
|
-
function onEnter(el:
|
|
140
|
+
function onEnter(el: Element, done: () => void) {
|
|
141
141
|
if (!detached.value) {
|
|
142
142
|
done()
|
|
143
143
|
|
|
@@ -146,27 +146,27 @@ function onEnter(el: HTMLElement, done: ()=> void) {
|
|
|
146
146
|
el.addEventListener('transitionend', done)
|
|
147
147
|
setTimeout(() => {
|
|
148
148
|
if (props.backdrop) el.classList.add('bg-gray-500/30')
|
|
149
|
-
if (props.position === 'top') el.style.top = '0'
|
|
150
|
-
else if (props.position === 'bottom') el.style.bottom = '0'
|
|
151
|
-
else if (props.position === 'left') el.style.left = '0'
|
|
152
|
-
else if (props.position === 'right') el.style.right = '0'
|
|
149
|
+
if (props.position === 'top') (el as HTMLElement).style.top = '0'
|
|
150
|
+
else if (props.position === 'bottom') (el as HTMLElement).style.bottom = '0'
|
|
151
|
+
else if (props.position === 'left') (el as HTMLElement).style.left = '0'
|
|
152
|
+
else if (props.position === 'right') (el as HTMLElement).style.right = '0'
|
|
153
153
|
}, 1)
|
|
154
154
|
}
|
|
155
155
|
|
|
156
|
-
function onBeforeLeave(el:
|
|
156
|
+
function onBeforeLeave(el: Element) {}
|
|
157
157
|
|
|
158
|
-
function onLeave(el:
|
|
158
|
+
function onLeave(el: Element, done: () => void) {
|
|
159
159
|
el.addEventListener('transitionend', done)
|
|
160
160
|
setTimeout(() => {
|
|
161
161
|
if (props.backdrop) el.classList.remove('bg-gray-500/30')
|
|
162
|
-
if (props.position === 'top') el.style.top = `-${props.height}px`
|
|
163
|
-
else if (props.position === 'bottom') el.style.bottom = `-${props.height}px`
|
|
164
|
-
else if (props.position === 'left') el.style.left = `-${props.width}px`
|
|
165
|
-
else if (props.position === 'right') el.style.right = `-${props.width}px`
|
|
162
|
+
if (props.position === 'top') (el as HTMLElement).style.top = `-${props.height}px`
|
|
163
|
+
else if (props.position === 'bottom') (el as HTMLElement).style.bottom = `-${props.height}px`
|
|
164
|
+
else if (props.position === 'left') (el as HTMLElement).style.left = `-${props.width}px`
|
|
165
|
+
else if (props.position === 'right') (el as HTMLElement).style.right = `-${props.width}px`
|
|
166
166
|
}, 1)
|
|
167
167
|
}
|
|
168
168
|
|
|
169
|
-
function onAfterLeave(el:
|
|
169
|
+
function onAfterLeave(el: Element) {
|
|
170
170
|
el.classList.remove('inset-0')
|
|
171
171
|
}
|
|
172
172
|
|
|
@@ -13,15 +13,15 @@ import { useTheme } from '../../composables/theme'
|
|
|
13
13
|
import theme from './Form.theme'
|
|
14
14
|
|
|
15
15
|
export type FormError = {
|
|
16
|
-
field: string
|
|
17
|
-
msg: string
|
|
16
|
+
field: string;
|
|
17
|
+
msg: string;
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
export type Form = {
|
|
21
|
-
name: string
|
|
22
|
-
focus: ()=> void
|
|
23
|
-
validate: ()=> boolean
|
|
24
|
-
setError: (val: string)=> void
|
|
21
|
+
name: string;
|
|
22
|
+
focus: () => void;
|
|
23
|
+
validate: () => boolean;
|
|
24
|
+
setError: (val: string) => void;
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
const props = defineProps({
|
|
@@ -45,15 +45,14 @@ const emit = defineEmits(['submit'])
|
|
|
45
45
|
const inputs: Form[] = []
|
|
46
46
|
|
|
47
47
|
provide(injectFormKey, {
|
|
48
|
-
registerInput: (name: string, focus: ()=> void, validate: ()=> boolean, setError: (val: string)=> void) => {
|
|
48
|
+
registerInput: (name: string, focus: () => void, validate: () => boolean, setError: (val: string) => void) => {
|
|
49
49
|
const exists = inputs.find((i) => i.name === name)
|
|
50
50
|
|
|
51
51
|
if (exists) {
|
|
52
52
|
exists.focus = focus
|
|
53
53
|
exists.validate = validate
|
|
54
54
|
exists.setError = setError
|
|
55
|
-
}
|
|
56
|
-
else inputs.push({ name, focus, validate, setError })
|
|
55
|
+
} else inputs.push({ name, focus, validate, setError })
|
|
57
56
|
},
|
|
58
57
|
unregisterInput: (name: string) => {
|
|
59
58
|
const index = inputs.findIndex((i) => i.name === name)
|
|
@@ -60,11 +60,11 @@ function onChange(e: Event) {
|
|
|
60
60
|
const value = Number(target.value)
|
|
61
61
|
|
|
62
62
|
if (typeof props.min !== 'undefined') {
|
|
63
|
-
if (value < props.min) target.value = props.min.toString()
|
|
63
|
+
if (value < Number(props.min)) target.value = props.min.toString()
|
|
64
64
|
}
|
|
65
65
|
|
|
66
66
|
if (typeof props.max !== 'undefined') {
|
|
67
|
-
if (value > props.max) target.value = props.max.toString()
|
|
67
|
+
if (value > Number(props.max)) target.value = props.max.toString()
|
|
68
68
|
}
|
|
69
69
|
}
|
|
70
70
|
}
|
|
@@ -62,12 +62,14 @@ const { styles, classes, className } = useTheme('link', theme, props)
|
|
|
62
62
|
|
|
63
63
|
&--shadow {
|
|
64
64
|
box-shadow: inset 0 -0.315em 0 0 var(--x-link-shadow);
|
|
65
|
+
|
|
65
66
|
&:hover {
|
|
66
67
|
box-shadow: inset 0 -1.325em 0 0 var(--x-link-shadow);
|
|
67
68
|
}
|
|
68
69
|
}
|
|
69
70
|
|
|
70
|
-
:global(.dark) &,
|
|
71
|
+
:global(.dark) &,
|
|
72
|
+
&:global(.dark) {
|
|
71
73
|
color: var(--x-link-dark-text);
|
|
72
74
|
|
|
73
75
|
&:hover {
|
|
@@ -76,6 +78,7 @@ const { styles, classes, className } = useTheme('link', theme, props)
|
|
|
76
78
|
|
|
77
79
|
&--shadow {
|
|
78
80
|
box-shadow: inset 0 -0.315em 0 0 var(--x-link-dark-shadow);
|
|
81
|
+
|
|
79
82
|
&:hover {
|
|
80
83
|
box-shadow: inset 0 -1.325em 0 0 var(--x-link-dark-shadow);
|
|
81
84
|
}
|
|
@@ -29,7 +29,7 @@ const props = defineProps({
|
|
|
29
29
|
},
|
|
30
30
|
onClick: Function,
|
|
31
31
|
inactive: Boolean,
|
|
32
|
-
value: [Number,String],
|
|
32
|
+
value: [Number, String],
|
|
33
33
|
to: String,
|
|
34
34
|
exact: Boolean,
|
|
35
35
|
href: String,
|
|
@@ -155,12 +155,13 @@ const { styles, classes, className } = useTheme('menu-item', theme, computedProp
|
|
|
155
155
|
</template>
|
|
156
156
|
|
|
157
157
|
<style lang="postcss" module scoped>
|
|
158
|
-
.menu-item,
|
|
158
|
+
.menu-item,
|
|
159
|
+
.menu-item.x-link {
|
|
159
160
|
color: var(--x-menu-item-text);
|
|
160
161
|
background-color: var(--x-menu-item-bg);
|
|
161
162
|
|
|
162
|
-
|
|
163
|
-
content:
|
|
163
|
+
&::before {
|
|
164
|
+
content: "";
|
|
164
165
|
position: absolute;
|
|
165
166
|
left: -1px;
|
|
166
167
|
height: 100%;
|
|
@@ -173,9 +174,11 @@ const { styles, classes, className } = useTheme('menu-item', theme, computedProp
|
|
|
173
174
|
background-color: var(--x-menu-item-bg-hover, var(--x-menu-item-bg));
|
|
174
175
|
}
|
|
175
176
|
|
|
176
|
-
:global(.dark) &,
|
|
177
|
+
:global(.dark) &,
|
|
178
|
+
&:global(.dark) {
|
|
177
179
|
color: var(--x-menu-item-dark-text);
|
|
178
180
|
background: var(--x-menu-item-dark-bg);
|
|
181
|
+
|
|
179
182
|
&:hover {
|
|
180
183
|
color: var(--x-menu-item-dark-text-hover, var(--x-menu-item-dark-text));
|
|
181
184
|
background-color: var(--x-menu-item-dark-bg-hover, var(--x-menu-item-dark-bg));
|
|
@@ -184,8 +187,10 @@ const { styles, classes, className } = useTheme('menu-item', theme, computedProp
|
|
|
184
187
|
}
|
|
185
188
|
|
|
186
189
|
:global(.x-menu-inner) {
|
|
190
|
+
/* stylelint-disable-next-line no-descending-specificity */
|
|
187
191
|
.menu-item {
|
|
188
|
-
&:hover
|
|
192
|
+
&:hover::before,
|
|
193
|
+
&--active::before {
|
|
189
194
|
background-color: var(--x-menu-item-border-hover);
|
|
190
195
|
}
|
|
191
196
|
}
|
|
@@ -29,7 +29,7 @@ const value = ref(props.modelValue)
|
|
|
29
29
|
const visible = ref(false)
|
|
30
30
|
const modalRef = ref<HTMLElement | null>(null)
|
|
31
31
|
|
|
32
|
-
let stopClickOutside: undefined | (()=> void) = undefined
|
|
32
|
+
let stopClickOutside: undefined | (() => void) = undefined
|
|
33
33
|
|
|
34
34
|
watch(value, (val) => {
|
|
35
35
|
if (stopClickOutside) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
const validators = {
|
|
3
|
-
align: ['left','right'],
|
|
4
|
-
position: ['bottom','top'],
|
|
3
|
+
align: ['left', 'right'],
|
|
4
|
+
position: ['bottom', 'top'],
|
|
5
5
|
}
|
|
6
6
|
|
|
7
7
|
export default {
|
|
@@ -26,22 +26,22 @@ import theme from './Notifications.theme'
|
|
|
26
26
|
export type NotificationAlign = 'left' | 'right'
|
|
27
27
|
export type NotificationPosition = 'bottom' | 'top'
|
|
28
28
|
export type NotificationAction = {
|
|
29
|
-
onClick: ()=> void
|
|
30
|
-
label: string
|
|
31
|
-
color?: string
|
|
29
|
+
onClick: () => void;
|
|
30
|
+
label: string;
|
|
31
|
+
color?: string;
|
|
32
32
|
}
|
|
33
33
|
export type NotificationEvent = {
|
|
34
|
-
id?: number
|
|
35
|
-
icon?: string
|
|
36
|
-
action?: NotificationAction
|
|
37
|
-
iconColor?: string
|
|
38
|
-
title?: string
|
|
39
|
-
style?: string
|
|
40
|
-
message?: string
|
|
41
|
-
timeout?: number
|
|
42
|
-
removable?: boolean
|
|
43
|
-
align?: NotificationAlign
|
|
44
|
-
position?: NotificationPosition
|
|
34
|
+
id?: number;
|
|
35
|
+
icon?: string;
|
|
36
|
+
action?: NotificationAction;
|
|
37
|
+
iconColor?: string;
|
|
38
|
+
title?: string;
|
|
39
|
+
style?: string;
|
|
40
|
+
message?: string;
|
|
41
|
+
timeout?: number;
|
|
42
|
+
removable?: boolean;
|
|
43
|
+
align?: NotificationAlign;
|
|
44
|
+
position?: NotificationPosition;
|
|
45
45
|
}
|
|
46
46
|
|
|
47
47
|
const props = defineProps({
|