nuxt-hs-ui 1.0.10 → 2.0.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/README.md +11 -4
- package/dist/module.d.mts +10 -2
- package/dist/module.d.ts +10 -2
- package/dist/module.json +5 -2
- package/dist/module.mjs +90 -51
- package/dist/runtime/assets/flatpickr-dark.css +1 -0
- package/dist/runtime/assets/flatpickr-month-select-style.css +1 -0
- package/dist/runtime/assets/tabulator-custom.css +1 -0
- package/dist/runtime/assets/tabulator.css +1 -0
- package/dist/runtime/assets/vue-select.css +1 -0
- package/dist/runtime/components/{hs-fc/btn/line-loading.vue → form/btn-line-loading.vue} +28 -42
- package/dist/runtime/components/form/btn.vue +488 -0
- package/dist/runtime/components/form/check-box.vue +352 -0
- package/dist/runtime/components/form/check-list.vue +354 -0
- package/dist/runtime/components/form/datepicker copy.vue +770 -0
- package/dist/runtime/components/form/datepicker.vue +897 -0
- package/dist/runtime/components/form/input-frame.vue +272 -0
- package/dist/runtime/components/form/radio.vue +685 -0
- package/dist/runtime/components/form/select-img-icon.vue +53 -0
- package/dist/runtime/components/form/select.vue +438 -0
- package/dist/runtime/components/form/text-box.vue +375 -0
- package/dist/runtime/components/form/textarea.vue +466 -0
- package/dist/runtime/components/form/value-box.vue +681 -0
- package/dist/runtime/components/interactive/alert.vue +113 -0
- package/dist/runtime/components/{hs-ui → interactive}/block-loading.vue +42 -59
- package/dist/runtime/components/{hs-ui/dialog/index.vue → interactive/dialog.vue} +132 -127
- package/dist/runtime/components/interactive/modal-bg.vue +82 -0
- package/dist/runtime/components/interactive/modal.vue +143 -0
- package/dist/runtime/components/{hs-ui/toast/index.vue → interactive/toast.vue} +76 -109
- package/dist/runtime/components/{hs-ui → interactive}/window-loader.vue +12 -9
- package/dist/runtime/components/{hs-ui → layout}/accordion.vue +21 -30
- package/dist/runtime/components/layout/aspect-box.vue +71 -0
- package/dist/runtime/components/layout/card-item.vue +193 -0
- package/dist/runtime/components/layout/card.vue +42 -0
- package/dist/runtime/components/layout/container.vue +40 -0
- package/dist/runtime/components/misc/breadcrumb.vue +96 -0
- package/dist/runtime/components/misc/tabulator.vue +187 -0
- package/dist/runtime/components/misc/view-name-display-target.vue +39 -0
- package/dist/runtime/components/misc/view-name-display.vue +90 -0
- package/dist/runtime/composables/use-hs-dialog.d.ts +40 -0
- package/dist/runtime/composables/{use-hs-ui-dialog.js → use-hs-dialog.js} +15 -10
- package/dist/runtime/composables/{use-hs-form-focus.d.ts → use-hs-focus.d.ts} +1 -1
- package/dist/runtime/composables/{use-hs-form-focus.js → use-hs-focus.js} +2 -4
- package/dist/runtime/composables/use-hs-misc.d.ts +22 -0
- package/dist/runtime/composables/use-hs-misc.js +62 -0
- package/dist/runtime/composables/use-hs-modal.d.ts +31 -0
- package/dist/runtime/{components/hs-ui/modal/use-ui-modal.js → composables/use-hs-modal.js} +18 -16
- package/dist/runtime/composables/use-hs-multi-lang.d.ts +14 -6
- package/dist/runtime/composables/use-hs-multi-lang.js +44 -11
- package/dist/runtime/composables/{use-hs-ui-toast.d.ts → use-hs-toast.d.ts} +3 -3
- package/dist/runtime/composables/{use-hs-ui-toast.js → use-hs-toast.js} +4 -5
- package/dist/runtime/composables/{use-hs-ui-window-loader.d.ts → use-hs-window-loader.d.ts} +1 -1
- package/dist/runtime/composables/{use-hs-ui-window-loader.js → use-hs-window-loader.js} +1 -2
- package/dist/runtime/plugin/v-select.d.ts +2 -0
- package/dist/runtime/plugin/v-select.js +5 -0
- package/dist/runtime/style.css +22 -1
- package/dist/runtime/tailwind.css +78 -0
- package/dist/runtime/types/app.config.d.ts +5 -0
- package/dist/runtime/{components/hs-ui/dialog/index.type.d.ts → types/dialog.d.ts} +3 -3
- package/dist/runtime/{components/hs-ui/toast/index.type.d.ts → types/toast.d.ts} +1 -2
- package/dist/runtime/{components/hs-ui/toast/index.type.js → types/toast.js} +0 -1
- package/dist/runtime/utils/class-style.d.ts +6 -0
- package/dist/runtime/utils/class-style.js +27 -0
- package/dist/runtime/utils/com.d.ts +6 -0
- package/dist/runtime/{lib → utils}/com.js +1 -4
- package/dist/runtime/utils/dayjs.d.ts +53 -0
- package/dist/runtime/utils/dayjs.js +124 -0
- package/dist/runtime/utils/float.d.ts +2 -0
- package/dist/runtime/utils/float.js +35 -0
- package/dist/runtime/utils/multi-lang-object.d.ts +17 -0
- package/dist/runtime/utils/multi-lang-object.js +34 -0
- package/dist/runtime/{lib → utils}/multi-lang.d.ts +1 -1
- package/dist/runtime/{lib → utils}/multi-lang.js +31 -27
- package/dist/runtime/{lib → utils}/number.d.ts +2 -4
- package/dist/runtime/{lib → utils}/number.js +29 -69
- package/dist/runtime/utils/object.d.ts +46 -0
- package/dist/runtime/utils/object.js +107 -0
- package/dist/runtime/utils/select-item.d.ts +31 -0
- package/dist/runtime/utils/select.d.ts +14 -0
- package/dist/runtime/utils/select.js +36 -0
- package/dist/runtime/utils/string.d.ts +39 -0
- package/dist/runtime/utils/string.js +125 -0
- package/dist/runtime/utils/tabulator.d.ts +108 -0
- package/dist/runtime/utils/tabulator.js +296 -0
- package/dist/runtime/utils/theme.d.ts +21 -0
- package/dist/runtime/utils/theme.js +31 -0
- package/dist/runtime/utils/tv.d.ts +101 -0
- package/dist/runtime/utils/tv.js +26 -0
- package/dist/runtime/utils/wareki.d.ts +3 -0
- package/dist/runtime/utils/wareki.js +106 -0
- package/dist/types.d.mts +1 -17
- package/dist/types.d.ts +1 -17
- package/package.json +99 -37
- package/dist/runtime/components/hs-fc/btn/index.vue +0 -510
- package/dist/runtime/components/hs-ui/aspect-box.vue +0 -83
- package/dist/runtime/components/hs-ui/card-item.vue +0 -141
- package/dist/runtime/components/hs-ui/card.vue +0 -54
- package/dist/runtime/components/hs-ui/container.vue +0 -50
- package/dist/runtime/components/hs-ui/modal/bg.vue +0 -94
- package/dist/runtime/components/hs-ui/modal/index.vue +0 -206
- package/dist/runtime/components/hs-ui/modal/use-ui-modal.d.ts +0 -20
- package/dist/runtime/components/v-test.vue +0 -60
- package/dist/runtime/composables/use-hs-ui-dialog.d.ts +0 -22
- package/dist/runtime/lib/class-style.d.ts +0 -8
- package/dist/runtime/lib/class-style.js +0 -59
- package/dist/runtime/lib/com.d.ts +0 -14
- package/dist/runtime/lib/prefix.d.ts +0 -2
- package/dist/runtime/lib/prefix.js +0 -17
- package/dist/runtime/lib/theme.d.ts +0 -2
- package/dist/runtime/lib/theme.js +0 -21
- /package/dist/runtime/{components/hs-ui/dialog/index.type.js → types/dialog.js} +0 -0
- /package/dist/runtime/{components/hs-fc/hoge → utils/select-item.js} +0 -0
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nuxt-hs-ui",
|
|
3
|
-
"version": "
|
|
4
|
-
"description": "Nuxt
|
|
3
|
+
"version": "2.0.2",
|
|
4
|
+
"description": "My new Nuxt module",
|
|
5
5
|
"repository": "https://github.com/hare-systems-ryo/nuxt-hs-ui",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"author": {
|
|
@@ -15,15 +15,70 @@
|
|
|
15
15
|
"import": "./dist/module.mjs",
|
|
16
16
|
"require": "./dist/module.cjs"
|
|
17
17
|
},
|
|
18
|
-
"./
|
|
19
|
-
"types": "./dist/runtime/
|
|
20
|
-
"import": "./dist/runtime/
|
|
21
|
-
"require": "./dist/runtime/
|
|
18
|
+
"./utils/class-style": {
|
|
19
|
+
"types": "./dist/runtime/utils/class-style.d.ts",
|
|
20
|
+
"import": "./dist/runtime/utils/class-style.js",
|
|
21
|
+
"require": "./dist/runtime/utils/class-style.js"
|
|
22
22
|
},
|
|
23
|
-
"./
|
|
24
|
-
"types": "./dist/runtime/
|
|
25
|
-
"import": "./dist/runtime/
|
|
26
|
-
"require": "./dist/runtime/
|
|
23
|
+
"./utils/com": {
|
|
24
|
+
"types": "./dist/runtime/utils/com.d.ts",
|
|
25
|
+
"import": "./dist/runtime/utils/com.js",
|
|
26
|
+
"require": "./dist/runtime/utils/com.js"
|
|
27
|
+
},
|
|
28
|
+
"./utils/dayjs": {
|
|
29
|
+
"types": "./dist/runtime/utils/dayjs.d.ts",
|
|
30
|
+
"import": "./dist/runtime/utils/dayjs.js",
|
|
31
|
+
"require": "./dist/runtime/utils/dayjs.js"
|
|
32
|
+
},
|
|
33
|
+
"./utils/float": {
|
|
34
|
+
"types": "./dist/runtime/utils/float.d.ts",
|
|
35
|
+
"import": "./dist/runtime/utils/float.js",
|
|
36
|
+
"require": "./dist/runtime/utils/float.js"
|
|
37
|
+
},
|
|
38
|
+
"./utils/multi-lang-object": {
|
|
39
|
+
"types": "./dist/runtime/utils/multi-lang-object.d.ts",
|
|
40
|
+
"import": "./dist/runtime/utils/multi-lang-object.js",
|
|
41
|
+
"require": "./dist/runtime/utils/multi-lang-object.js"
|
|
42
|
+
},
|
|
43
|
+
"./utils/multi-lang": {
|
|
44
|
+
"types": "./dist/runtime/utils/multi-lang.d.ts",
|
|
45
|
+
"import": "./dist/runtime/utils/multi-lang.js",
|
|
46
|
+
"require": "./dist/runtime/utils/multi-lang.js"
|
|
47
|
+
},
|
|
48
|
+
"./utils/number": {
|
|
49
|
+
"types": "./dist/runtime/utils/number.d.ts",
|
|
50
|
+
"import": "./dist/runtime/utils/number.js",
|
|
51
|
+
"require": "./dist/runtime/utils/number.js"
|
|
52
|
+
},
|
|
53
|
+
"./utils/object": {
|
|
54
|
+
"types": "./dist/runtime/utils/object.d.ts",
|
|
55
|
+
"import": "./dist/runtime/utils/object.js",
|
|
56
|
+
"require": "./dist/runtime/utils/object.js"
|
|
57
|
+
},
|
|
58
|
+
"./utils/select-item": {
|
|
59
|
+
"types": "./dist/runtime/utils/select-item.d.ts",
|
|
60
|
+
"import": "./dist/runtime/utils/select-item.js",
|
|
61
|
+
"require": "./dist/runtime/utils/select-item.js"
|
|
62
|
+
},
|
|
63
|
+
"./utils/string": {
|
|
64
|
+
"types": "./dist/runtime/utils/string.d.ts",
|
|
65
|
+
"import": "./dist/runtime/utils/string.js",
|
|
66
|
+
"require": "./dist/runtime/utils/string.js"
|
|
67
|
+
},
|
|
68
|
+
"./utils/tabulator": {
|
|
69
|
+
"types": "./dist/runtime/utils/tabulator.d.ts",
|
|
70
|
+
"import": "./dist/runtime/utils/tabulator.js",
|
|
71
|
+
"require": "./dist/runtime/utils/tabulator.js"
|
|
72
|
+
},
|
|
73
|
+
"./utils/theme": {
|
|
74
|
+
"types": "./dist/runtime/utils/theme.d.ts",
|
|
75
|
+
"import": "./dist/runtime/utils/theme.js",
|
|
76
|
+
"require": "./dist/runtime/utils/theme.js"
|
|
77
|
+
},
|
|
78
|
+
"./utils/wareki": {
|
|
79
|
+
"types": "./dist/runtime/utils/wareki.d.ts",
|
|
80
|
+
"import": "./dist/runtime/utils/wareki.js",
|
|
81
|
+
"require": "./dist/runtime/utils/wareki.js"
|
|
27
82
|
}
|
|
28
83
|
},
|
|
29
84
|
"main": "./dist/module.cjs",
|
|
@@ -36,48 +91,55 @@
|
|
|
36
91
|
"npm": "10.5.2"
|
|
37
92
|
},
|
|
38
93
|
"scripts": {
|
|
94
|
+
"link": "npm run dev:prepare && npm link",
|
|
39
95
|
"prepack": "nuxt-module-build build",
|
|
40
96
|
"dev": "nuxi dev playground",
|
|
41
97
|
"dev:build": "nuxi build playground",
|
|
42
98
|
"dev:prepare": "nuxt-module-build build --stub && nuxt-module-build prepare && nuxi prepare playground",
|
|
43
|
-
"release": "npm run lint &&
|
|
99
|
+
"release": "npm run lint && npm run prepack && changelogen --release && npm publish && git push --follow-tags",
|
|
44
100
|
"lint": "eslint .",
|
|
45
|
-
"lint:fix": "eslint . --fix",
|
|
46
101
|
"test": "vitest run",
|
|
47
102
|
"test:watch": "vitest watch",
|
|
48
103
|
"test:types": "vue-tsc --noEmit && cd playground && vue-tsc --noEmit"
|
|
49
104
|
},
|
|
50
105
|
"dependencies": {
|
|
51
|
-
"@nuxt/kit": "^3.
|
|
52
|
-
"@
|
|
53
|
-
"@
|
|
54
|
-
"@
|
|
55
|
-
"@vueuse/
|
|
106
|
+
"@nuxt/kit": "^3.15.1",
|
|
107
|
+
"@nuxt/ui": "^2.21.0",
|
|
108
|
+
"@nuxtjs/tailwindcss": "^6.13.1",
|
|
109
|
+
"@pinia/nuxt": "^0.9.0",
|
|
110
|
+
"@vueuse/core": "^12.3.0",
|
|
111
|
+
"@vueuse/integrations": "^12.3.0",
|
|
112
|
+
"@vueuse/nuxt": "^12.3.0",
|
|
56
113
|
"bignumber.js": "^9.1.2",
|
|
57
114
|
"body-scroll-lock": "^4.0.0-beta.0",
|
|
58
|
-
"dayjs": "^1.11.
|
|
115
|
+
"dayjs": "^1.11.13",
|
|
59
116
|
"defu": "^6.1.4",
|
|
60
|
-
"
|
|
61
|
-
"
|
|
117
|
+
"flatpickr": "^4.6.13",
|
|
118
|
+
"focus-trap": "^7.6.2",
|
|
119
|
+
"pinia": "^2.3.0",
|
|
120
|
+
"tabulator-tables": "^6.3.0",
|
|
121
|
+
"tailwind-merge": "^2.6.0",
|
|
122
|
+
"tailwind-variants": "^0.3.0",
|
|
123
|
+
"vue-select": "^4.0.0-beta.6"
|
|
62
124
|
},
|
|
63
125
|
"devDependencies": {
|
|
64
|
-
"@nuxt/devtools": "^1.
|
|
65
|
-
"@nuxt/eslint-config": "^0.
|
|
66
|
-
"@nuxt/module-builder": "^0.
|
|
67
|
-
"@nuxt/schema": "^3.
|
|
68
|
-
"@nuxt/test-utils": "^3.
|
|
126
|
+
"@nuxt/devtools": "^1.7.0",
|
|
127
|
+
"@nuxt/eslint-config": "^0.7.5",
|
|
128
|
+
"@nuxt/module-builder": "^0.8.4",
|
|
129
|
+
"@nuxt/schema": "^3.15.1",
|
|
130
|
+
"@nuxt/test-utils": "^3.15.4",
|
|
69
131
|
"@types/body-scroll-lock": "^3.1.2",
|
|
70
|
-
"@types/node": "
|
|
71
|
-
"
|
|
72
|
-
"
|
|
73
|
-
"
|
|
74
|
-
"
|
|
75
|
-
"
|
|
76
|
-
"
|
|
77
|
-
"
|
|
78
|
-
"
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
"vue": "
|
|
132
|
+
"@types/node": "latest",
|
|
133
|
+
"@types/tabulator-tables": "^6.2.3",
|
|
134
|
+
"@types/vue-select": "^3.16.8",
|
|
135
|
+
"changelogen": "^0.5.7",
|
|
136
|
+
"eslint": "^9.18.0",
|
|
137
|
+
"nuxt": "^3.15.1",
|
|
138
|
+
"sass": "^1.83.4",
|
|
139
|
+
"tailwindcss": "^3.4.17",
|
|
140
|
+
"sass-embedded": "^1.83.4",
|
|
141
|
+
"typescript": "~5.7.3",
|
|
142
|
+
"vitest": "^2.1.8",
|
|
143
|
+
"vue-tsc": "^2.2.0"
|
|
82
144
|
}
|
|
83
145
|
}
|
|
@@ -1,510 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
/* ----------------------------------------------------------------------------
|
|
3
|
-
src\runtime\components\hs-fc\btn\index.vue
|
|
4
|
-
// ----------------------------------------------------------------------------
|
|
5
|
-
HsFcBtn
|
|
6
|
-
HsFcBtnHsFcBtn
|
|
7
|
-
----------------------------------------------------------------------------- */
|
|
8
|
-
|
|
9
|
-
// [ vue ]
|
|
10
|
-
import { computed, ref } from 'vue';
|
|
11
|
-
// [ NUXT ]
|
|
12
|
-
import { useId, useRuntimeConfig } from '#imports';
|
|
13
|
-
// [ vueuse ]
|
|
14
|
-
import { useHsFormFocus } from '../../../composables/use-hs-form-focus';
|
|
15
|
-
// ----------------------------------------------------------------------------
|
|
16
|
-
// [ tailwind ]
|
|
17
|
-
import { extendTailwindMerge } from 'tailwind-merge';
|
|
18
|
-
import { type ClassType, ClassTypeToString } from '../../../lib/class-style';
|
|
19
|
-
import { GetPrefix, RemovePrefix } from '../../../lib/prefix';
|
|
20
|
-
// ----------------------------------------------------------------------------
|
|
21
|
-
import type { Theme } from '../../../lib/theme';
|
|
22
|
-
// ----------------------------------------------------------------------------
|
|
23
|
-
const runtimeConfig: any = useRuntimeConfig();
|
|
24
|
-
const prefix = GetPrefix(runtimeConfig);
|
|
25
|
-
|
|
26
|
-
const twMerge = extendTailwindMerge({
|
|
27
|
-
prefix: prefix,
|
|
28
|
-
});
|
|
29
|
-
|
|
30
|
-
// ----------------------------------------------------------------------------
|
|
31
|
-
|
|
32
|
-
interface Props {
|
|
33
|
-
class?: ClassType;
|
|
34
|
-
classInner?: ClassType;
|
|
35
|
-
disabled?: boolean;
|
|
36
|
-
to?: string;
|
|
37
|
-
theme?: Theme;
|
|
38
|
-
variant?: 'outlined' | 'flat';
|
|
39
|
-
textWrap?: boolean;
|
|
40
|
-
textAlign?: 'left' | 'center' | 'right';
|
|
41
|
-
loading?: boolean;
|
|
42
|
-
}
|
|
43
|
-
const props = withDefaults(defineProps<Props>(), {
|
|
44
|
-
class: '',
|
|
45
|
-
classInner: '',
|
|
46
|
-
to: undefined,
|
|
47
|
-
theme: 'accent1',
|
|
48
|
-
variant: 'outlined',
|
|
49
|
-
disabled: false,
|
|
50
|
-
textWrap: false,
|
|
51
|
-
align: 'center',
|
|
52
|
-
loading: false,
|
|
53
|
-
textAlign: 'center',
|
|
54
|
-
});
|
|
55
|
-
|
|
56
|
-
type InputFocusEventArg = {
|
|
57
|
-
elm: HTMLElement;
|
|
58
|
-
id: string;
|
|
59
|
-
};
|
|
60
|
-
type Emits = {
|
|
61
|
-
id: [id: string];
|
|
62
|
-
ref: [element: HTMLElement];
|
|
63
|
-
focus: [e: InputFocusEventArg];
|
|
64
|
-
blur: [e: InputFocusEventArg];
|
|
65
|
-
};
|
|
66
|
-
const emit = defineEmits<Emits>();
|
|
67
|
-
// ----------------------------------------------------------------------------
|
|
68
|
-
const id = useId();
|
|
69
|
-
emit('id', id);
|
|
70
|
-
// ----------------------------------------------------------------------------
|
|
71
|
-
// ----------------------------------------------------------------------------
|
|
72
|
-
// Base Design
|
|
73
|
-
// -----
|
|
74
|
-
const baseClass = RemovePrefix(prefix, [
|
|
75
|
-
//
|
|
76
|
-
'relative',
|
|
77
|
-
'tw-relative',
|
|
78
|
-
'inline-flex',
|
|
79
|
-
'tw-inline-flex',
|
|
80
|
-
'items-center',
|
|
81
|
-
'tw-items-center',
|
|
82
|
-
'py-2',
|
|
83
|
-
'tw-py-2',
|
|
84
|
-
'px-3',
|
|
85
|
-
'tw-px-3',
|
|
86
|
-
'w-auto',
|
|
87
|
-
'leading-[1.2em]',
|
|
88
|
-
'tw-leading-[1.2em]',
|
|
89
|
-
'tw-w-auto',
|
|
90
|
-
'max-w-full',
|
|
91
|
-
'tw-max-w-full',
|
|
92
|
-
'text-ellipsis',
|
|
93
|
-
'tw-text-ellipsis',
|
|
94
|
-
'overflow-hidden',
|
|
95
|
-
'tw-overflow-hidden',
|
|
96
|
-
'disabled:opacity-50',
|
|
97
|
-
'tw-disabled:opacity-50',
|
|
98
|
-
'disabled:pointer-events-none',
|
|
99
|
-
'tw-disabled:pointer-events-none',
|
|
100
|
-
]);
|
|
101
|
-
const baseClassForm = RemovePrefix(prefix, [
|
|
102
|
-
//
|
|
103
|
-
'border',
|
|
104
|
-
'tw-border',
|
|
105
|
-
'border-[1px]',
|
|
106
|
-
'tw-border-[1px]',
|
|
107
|
-
'border-main1',
|
|
108
|
-
'tw-border-main1',
|
|
109
|
-
'min-h-[44px]',
|
|
110
|
-
'tw-min-h-[44px]',
|
|
111
|
-
'rounded',
|
|
112
|
-
'tw-rounded',
|
|
113
|
-
// `bg-transparent`,
|
|
114
|
-
// `tw-bg-transparent`,
|
|
115
|
-
]);
|
|
116
|
-
const variableStyle = computed(() => {
|
|
117
|
-
if (props.variant === 'outlined') {
|
|
118
|
-
return RemovePrefix(prefix, [
|
|
119
|
-
//
|
|
120
|
-
'border-[2px]',
|
|
121
|
-
'tw-border-[2px]',
|
|
122
|
-
'bg-white',
|
|
123
|
-
'tw-bg-white',
|
|
124
|
-
]);
|
|
125
|
-
}
|
|
126
|
-
return [];
|
|
127
|
-
});
|
|
128
|
-
const align = computed(() => {
|
|
129
|
-
if (props.textAlign === 'left') {
|
|
130
|
-
return RemovePrefix(prefix, [
|
|
131
|
-
//
|
|
132
|
-
'justify-start',
|
|
133
|
-
'tw-justify-start',
|
|
134
|
-
]);
|
|
135
|
-
}
|
|
136
|
-
if (props.textAlign === 'right') {
|
|
137
|
-
return RemovePrefix(prefix, [
|
|
138
|
-
//
|
|
139
|
-
'justify-end',
|
|
140
|
-
'tw-justify-end',
|
|
141
|
-
]);
|
|
142
|
-
}
|
|
143
|
-
return RemovePrefix(prefix, [
|
|
144
|
-
//
|
|
145
|
-
'justify-center',
|
|
146
|
-
'tw-justify-center',
|
|
147
|
-
]);
|
|
148
|
-
});
|
|
149
|
-
const classStyle = computed(() => {
|
|
150
|
-
return twMerge(baseClass, baseClassForm, ...variableStyle.value, ...align.value, ClassTypeToString(props.class));
|
|
151
|
-
});
|
|
152
|
-
// ----------------------------------------------------------------------------
|
|
153
|
-
// Innder Design
|
|
154
|
-
// -----
|
|
155
|
-
const textWrapClass = computed(() => {
|
|
156
|
-
if (props.textWrap) {
|
|
157
|
-
return 'break-all text-wrap';
|
|
158
|
-
}
|
|
159
|
-
return '';
|
|
160
|
-
});
|
|
161
|
-
const classThisInner = computed(() => {
|
|
162
|
-
return twMerge(
|
|
163
|
-
'max-h-full max-w-full text-ellipsis overflow-hidden',
|
|
164
|
-
textWrapClass.value,
|
|
165
|
-
ClassTypeToString(props.classInner)
|
|
166
|
-
);
|
|
167
|
-
});
|
|
168
|
-
// ----------------------------------------------------------------------------
|
|
169
|
-
// focus, blur Event
|
|
170
|
-
const vFormFocus = useHsFormFocus();
|
|
171
|
-
const imputElm = ref<HTMLElement | null>(null);
|
|
172
|
-
const setRef = (e: any) => {
|
|
173
|
-
imputElm.value = e;
|
|
174
|
-
emit('ref', e);
|
|
175
|
-
};
|
|
176
|
-
const onFocus = () => {
|
|
177
|
-
if (props.disabled) return;
|
|
178
|
-
const elm = imputElm.value;
|
|
179
|
-
if (elm === null) return;
|
|
180
|
-
vFormFocus.state.id = id;
|
|
181
|
-
emit('focus', { elm: elm, id: id });
|
|
182
|
-
};
|
|
183
|
-
const onBlur = () => {
|
|
184
|
-
if (props.disabled) return;
|
|
185
|
-
const elm = imputElm.value;
|
|
186
|
-
if (elm === null) return;
|
|
187
|
-
if (vFormFocus.state.id === id) {
|
|
188
|
-
vFormFocus.state.id = '';
|
|
189
|
-
}
|
|
190
|
-
emit('blur', { elm: elm, id: id });
|
|
191
|
-
};
|
|
192
|
-
// ----------------------------------------------------------------------------
|
|
193
|
-
// disabled
|
|
194
|
-
const disabled = computed(() => {
|
|
195
|
-
if (props.disabled) return true;
|
|
196
|
-
if (props.loading) return true;
|
|
197
|
-
return false;
|
|
198
|
-
});
|
|
199
|
-
// ----------------------------------------------------------------------------
|
|
200
|
-
</script>
|
|
201
|
-
<template>
|
|
202
|
-
<button
|
|
203
|
-
v-if="props.to === undefined"
|
|
204
|
-
:ref="(e:any)=>setRef(e)"
|
|
205
|
-
type="button"
|
|
206
|
-
class="HsFcBtn"
|
|
207
|
-
:class="[classStyle, `theme-${props.theme}`, `variant-${props.variant}`]"
|
|
208
|
-
:disabled="disabled"
|
|
209
|
-
ontouchstart=""
|
|
210
|
-
@focus="onFocus()"
|
|
211
|
-
@blur="onBlur()"
|
|
212
|
-
>
|
|
213
|
-
<div class="HsFcBtn--hover HsFcBtn--overlay" />
|
|
214
|
-
<div class="HsFcBtn--active HsFcBtn--overlay" />
|
|
215
|
-
<div class="HsFcBtn--border" :class="[{ show: vFormFocus.state.id === id }]" />
|
|
216
|
-
<div :class="classThisInner"><slot /></div>
|
|
217
|
-
<HsFcBtnLineLoading class="HsFcBtn--loading" :show="props.loading" />
|
|
218
|
-
</button>
|
|
219
|
-
<NuxtLink
|
|
220
|
-
v-else
|
|
221
|
-
:ref="(e:any)=>setRef(e)"
|
|
222
|
-
:to="props.to"
|
|
223
|
-
:disabled="disabled"
|
|
224
|
-
ontouchstart=""
|
|
225
|
-
class="HsFcBtn"
|
|
226
|
-
:class="[classStyle, `theme-${props.theme}`, `variant-${props.variant}`]"
|
|
227
|
-
@focus="onFocus()"
|
|
228
|
-
@blur="onBlur()"
|
|
229
|
-
>
|
|
230
|
-
<div class="HsFcBtn--hover HsFcBtn--overlay" />
|
|
231
|
-
<div class="HsFcBtn--active HsFcBtn--overlay" />
|
|
232
|
-
<div class="HsFcBtn--border" :class="[{ show: vFormFocus.state.id === id }]" />
|
|
233
|
-
<div :class="classThisInner"><slot /></div>
|
|
234
|
-
<HsFcBtnLineLoading class="HsFcBtn--loading" :show="props.loading" />
|
|
235
|
-
</NuxtLink>
|
|
236
|
-
</template>
|
|
237
|
-
<style scoped>
|
|
238
|
-
@charset "UTF-8";
|
|
239
|
-
.HsFcBtn {
|
|
240
|
-
touch-action: manipulation;
|
|
241
|
-
appearance: none;
|
|
242
|
-
-webkit-appearance: none;
|
|
243
|
-
position: relative;
|
|
244
|
-
-webkit-tap-highlight-color: transparent;
|
|
245
|
-
}
|
|
246
|
-
.HsFcBtn:focus {
|
|
247
|
-
outline: none;
|
|
248
|
-
}
|
|
249
|
-
.HsFcBtn .HsFcBtn--loading {
|
|
250
|
-
z-index: 2;
|
|
251
|
-
}
|
|
252
|
-
.HsFcBtn .HsFcBtn--border {
|
|
253
|
-
position: absolute;
|
|
254
|
-
inset: 2px 2px 2px 2px;
|
|
255
|
-
border-style: solid;
|
|
256
|
-
border-width: 1px;
|
|
257
|
-
border-radius: 5px;
|
|
258
|
-
opacity: 0;
|
|
259
|
-
background-color: transparent;
|
|
260
|
-
}
|
|
261
|
-
.HsFcBtn .HsFcBtn--border.show {
|
|
262
|
-
opacity: 1;
|
|
263
|
-
}
|
|
264
|
-
.HsFcBtn * {
|
|
265
|
-
pointer-events: none !important;
|
|
266
|
-
user-select: none;
|
|
267
|
-
}
|
|
268
|
-
.HsFcBtn .HsFcBtn--overlay {
|
|
269
|
-
position: absolute;
|
|
270
|
-
inset: 0;
|
|
271
|
-
opacity: 0;
|
|
272
|
-
z-index: 1;
|
|
273
|
-
}
|
|
274
|
-
.HsFcBtn.variant-outlined .HsFcBtn--hover {
|
|
275
|
-
mix-blend-mode: multiply;
|
|
276
|
-
}
|
|
277
|
-
.HsFcBtn.variant-outlined .HsFcBtn--active {
|
|
278
|
-
mix-blend-mode: multiply;
|
|
279
|
-
}
|
|
280
|
-
.HsFcBtn.variant-outlined .HsFcBtn--border {
|
|
281
|
-
border-color: inherit;
|
|
282
|
-
}
|
|
283
|
-
.HsFcBtn.variant-flat .HsFcBtn--hover {
|
|
284
|
-
background-color: inherit;
|
|
285
|
-
mix-blend-mode: screen;
|
|
286
|
-
}
|
|
287
|
-
.HsFcBtn.variant-flat .HsFcBtn--active {
|
|
288
|
-
background-color: inherit;
|
|
289
|
-
mix-blend-mode: multiply;
|
|
290
|
-
mix-blend-mode: screen;
|
|
291
|
-
}
|
|
292
|
-
.HsFcBtn.variant-flat .HsFcBtn--border {
|
|
293
|
-
border-color: white;
|
|
294
|
-
}
|
|
295
|
-
@media (hover: hover) {
|
|
296
|
-
.HsFcBtn {
|
|
297
|
-
/* hover指定できるPCを想定したスタイル */
|
|
298
|
-
}
|
|
299
|
-
.HsFcBtn:not(:active):hover.variant-outlined .HsFcBtn--hover {
|
|
300
|
-
opacity: 0.2;
|
|
301
|
-
}
|
|
302
|
-
.HsFcBtn:not(:active):hover.variant-flat .HsFcBtn--hover {
|
|
303
|
-
opacity: 0.8;
|
|
304
|
-
}
|
|
305
|
-
.HsFcBtn:active.variant-outlined .HsFcBtn--active {
|
|
306
|
-
opacity: 0.5;
|
|
307
|
-
}
|
|
308
|
-
.HsFcBtn:active.variant-flat .HsFcBtn--active {
|
|
309
|
-
opacity: 0.4;
|
|
310
|
-
}
|
|
311
|
-
}
|
|
312
|
-
@media (hover: none) {
|
|
313
|
-
.HsFcBtn {
|
|
314
|
-
/* hoverが使えないタッチ端末を想定した装飾 */
|
|
315
|
-
}
|
|
316
|
-
.HsFcBtn .HsFcBtn--hover {
|
|
317
|
-
opacity: 0;
|
|
318
|
-
}
|
|
319
|
-
.HsFcBtn:active.variant-outlined .HsFcBtn--active {
|
|
320
|
-
opacity: 0.4;
|
|
321
|
-
}
|
|
322
|
-
.HsFcBtn:active.variant-flat .HsFcBtn--active {
|
|
323
|
-
opacity: 0.8;
|
|
324
|
-
}
|
|
325
|
-
}
|
|
326
|
-
|
|
327
|
-
.variant-flat.theme-main0 {
|
|
328
|
-
background-color: theme("colors.main0");
|
|
329
|
-
color: theme("colors.white");
|
|
330
|
-
}
|
|
331
|
-
.variant-flat.theme-main1 {
|
|
332
|
-
background-color: theme("colors.main1");
|
|
333
|
-
color: theme("colors.white");
|
|
334
|
-
}
|
|
335
|
-
.variant-flat.theme-main2 {
|
|
336
|
-
background-color: theme("colors.main2");
|
|
337
|
-
color: theme("colors.white");
|
|
338
|
-
}
|
|
339
|
-
.variant-flat.theme-main3 {
|
|
340
|
-
background-color: theme("colors.main3");
|
|
341
|
-
color: theme("colors.white");
|
|
342
|
-
}
|
|
343
|
-
.variant-flat.theme-accent1 {
|
|
344
|
-
background-color: theme("colors.accent1");
|
|
345
|
-
color: theme("colors.white");
|
|
346
|
-
}
|
|
347
|
-
.variant-flat.theme-accent2 {
|
|
348
|
-
background-color: theme("colors.accent2");
|
|
349
|
-
color: theme("colors.white");
|
|
350
|
-
}
|
|
351
|
-
.variant-flat.theme-info {
|
|
352
|
-
background-color: theme("colors.info");
|
|
353
|
-
color: theme("colors.white");
|
|
354
|
-
}
|
|
355
|
-
.variant-flat.theme-link {
|
|
356
|
-
background-color: theme("colors.link");
|
|
357
|
-
color: theme("colors.white");
|
|
358
|
-
}
|
|
359
|
-
.variant-flat.theme-download {
|
|
360
|
-
background-color: theme("colors.download");
|
|
361
|
-
color: theme("colors.white");
|
|
362
|
-
}
|
|
363
|
-
.variant-flat.theme-success {
|
|
364
|
-
background-color: theme("colors.success");
|
|
365
|
-
color: theme("colors.white");
|
|
366
|
-
}
|
|
367
|
-
.variant-flat.theme-warn {
|
|
368
|
-
background-color: theme("colors.warn");
|
|
369
|
-
color: theme("colors.white");
|
|
370
|
-
}
|
|
371
|
-
.variant-flat.theme-error {
|
|
372
|
-
background-color: theme("colors.error");
|
|
373
|
-
color: theme("colors.white");
|
|
374
|
-
}
|
|
375
|
-
.variant-flat.theme-white {
|
|
376
|
-
background-color: theme("colors.white");
|
|
377
|
-
color: theme("colors.main1");
|
|
378
|
-
}
|
|
379
|
-
.variant-flat.theme-white .HsFcBtn--border {
|
|
380
|
-
border-color: theme("colors.gray.600");
|
|
381
|
-
}
|
|
382
|
-
.variant-flat.theme-black {
|
|
383
|
-
background-color: theme("colors.black");
|
|
384
|
-
color: theme("colors.white");
|
|
385
|
-
}
|
|
386
|
-
.variant-flat.theme-dark {
|
|
387
|
-
background-color: theme("colors.dark");
|
|
388
|
-
color: theme("colors.white");
|
|
389
|
-
}
|
|
390
|
-
.variant-flat.theme-back {
|
|
391
|
-
background-color: theme("colors.back");
|
|
392
|
-
color: theme("colors.main1");
|
|
393
|
-
}
|
|
394
|
-
.variant-flat.theme-back .HsFcBtn--border {
|
|
395
|
-
border-color: theme("colors.gray.600");
|
|
396
|
-
}
|
|
397
|
-
|
|
398
|
-
.variant-outlined.theme-main0 {
|
|
399
|
-
border-color: theme("colors.main0");
|
|
400
|
-
color: theme("colors.main0");
|
|
401
|
-
}
|
|
402
|
-
.variant-outlined.theme-main0 .HsFcBtn--overlay {
|
|
403
|
-
background-color: theme("colors.main0");
|
|
404
|
-
}
|
|
405
|
-
.variant-outlined.theme-main1 {
|
|
406
|
-
border-color: theme("colors.main1");
|
|
407
|
-
color: theme("colors.main1");
|
|
408
|
-
}
|
|
409
|
-
.variant-outlined.theme-main1 .HsFcBtn--overlay {
|
|
410
|
-
background-color: theme("colors.main1");
|
|
411
|
-
}
|
|
412
|
-
.variant-outlined.theme-main2 {
|
|
413
|
-
border-color: theme("colors.main2");
|
|
414
|
-
color: theme("colors.main2");
|
|
415
|
-
}
|
|
416
|
-
.variant-outlined.theme-main2 .HsFcBtn--overlay {
|
|
417
|
-
background-color: theme("colors.main2");
|
|
418
|
-
}
|
|
419
|
-
.variant-outlined.theme-main3 {
|
|
420
|
-
border-color: theme("colors.main3");
|
|
421
|
-
color: theme("colors.main3");
|
|
422
|
-
}
|
|
423
|
-
.variant-outlined.theme-main3 .HsFcBtn--overlay {
|
|
424
|
-
background-color: theme("colors.main3");
|
|
425
|
-
}
|
|
426
|
-
.variant-outlined.theme-accent1 {
|
|
427
|
-
border-color: theme("colors.accent1");
|
|
428
|
-
color: theme("colors.accent1");
|
|
429
|
-
}
|
|
430
|
-
.variant-outlined.theme-accent1 .HsFcBtn--overlay {
|
|
431
|
-
background-color: theme("colors.accent1");
|
|
432
|
-
}
|
|
433
|
-
.variant-outlined.theme-accent2 {
|
|
434
|
-
border-color: theme("colors.accent2");
|
|
435
|
-
color: theme("colors.accent2");
|
|
436
|
-
}
|
|
437
|
-
.variant-outlined.theme-accent2 .HsFcBtn--overlay {
|
|
438
|
-
background-color: theme("colors.accent2");
|
|
439
|
-
}
|
|
440
|
-
.variant-outlined.theme-info {
|
|
441
|
-
border-color: theme("colors.info");
|
|
442
|
-
color: theme("colors.info");
|
|
443
|
-
}
|
|
444
|
-
.variant-outlined.theme-info .HsFcBtn--hover {
|
|
445
|
-
background-color: theme("colors.info");
|
|
446
|
-
}
|
|
447
|
-
.variant-outlined.theme-link {
|
|
448
|
-
border-color: theme("colors.link");
|
|
449
|
-
color: theme("colors.link");
|
|
450
|
-
}
|
|
451
|
-
.variant-outlined.theme-link .HsFcBtn--overlay {
|
|
452
|
-
background-color: theme("colors.link");
|
|
453
|
-
}
|
|
454
|
-
.variant-outlined.theme-download {
|
|
455
|
-
border-color: theme("colors.download");
|
|
456
|
-
color: theme("colors.download");
|
|
457
|
-
}
|
|
458
|
-
.variant-outlined.theme-download .HsFcBtn--overlay {
|
|
459
|
-
background-color: theme("colors.download");
|
|
460
|
-
}
|
|
461
|
-
.variant-outlined.theme-success {
|
|
462
|
-
border-color: theme("colors.success");
|
|
463
|
-
color: theme("colors.success");
|
|
464
|
-
}
|
|
465
|
-
.variant-outlined.theme-success .HsFcBtn--overlay {
|
|
466
|
-
background-color: theme("colors.success");
|
|
467
|
-
}
|
|
468
|
-
.variant-outlined.theme-warn {
|
|
469
|
-
border-color: theme("colors.warn");
|
|
470
|
-
color: theme("colors.warn");
|
|
471
|
-
}
|
|
472
|
-
.variant-outlined.theme-warn .HsFcBtn--overlay {
|
|
473
|
-
background-color: theme("colors.warn");
|
|
474
|
-
}
|
|
475
|
-
.variant-outlined.theme-error {
|
|
476
|
-
border-color: theme("colors.error");
|
|
477
|
-
color: theme("colors.error");
|
|
478
|
-
}
|
|
479
|
-
.variant-outlined.theme-error .HsFcBtn--overlay {
|
|
480
|
-
background-color: theme("colors.error");
|
|
481
|
-
}
|
|
482
|
-
.variant-outlined.theme-white {
|
|
483
|
-
border-color: theme("colors.white");
|
|
484
|
-
color: theme("colors.white");
|
|
485
|
-
}
|
|
486
|
-
.variant-outlined.theme-white .HsFcBtn--overlay {
|
|
487
|
-
background-color: theme("colors.black");
|
|
488
|
-
}
|
|
489
|
-
.variant-outlined.theme-black {
|
|
490
|
-
border-color: theme("colors.black");
|
|
491
|
-
color: theme("colors.black");
|
|
492
|
-
}
|
|
493
|
-
.variant-outlined.theme-black .HsFcBtn--overlay {
|
|
494
|
-
background-color: theme("colors.white");
|
|
495
|
-
}
|
|
496
|
-
.variant-outlined.theme-dark {
|
|
497
|
-
border-color: theme("colors.dark");
|
|
498
|
-
color: theme("colors.dark");
|
|
499
|
-
}
|
|
500
|
-
.variant-outlined.theme-dark .HsFcBtn--overlay {
|
|
501
|
-
background-color: theme("colors.dark");
|
|
502
|
-
}
|
|
503
|
-
.variant-outlined.theme-back {
|
|
504
|
-
border-color: theme("colors.back");
|
|
505
|
-
color: theme("colors.back");
|
|
506
|
-
}
|
|
507
|
-
.variant-outlined.theme-back .HsFcBtn--overlay {
|
|
508
|
-
background-color: theme("colors.back");
|
|
509
|
-
}
|
|
510
|
-
</style>
|