nuxt-hs-ui 2.12.7 → 4.0.0
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 +202 -14
- package/dist/module.d.mts +3 -4
- package/dist/module.json +9 -6
- package/dist/module.mjs +109 -99
- package/dist/runtime/assets/flatpickr-dark.css +1 -1
- package/dist/runtime/assets/main.css +1 -0
- package/dist/runtime/assets/tabulator-custom.css +1 -1
- package/dist/runtime/components/form/_select/hidden-item-toggle.vue +28 -0
- package/dist/runtime/components/form/_select/hidden-item-toggle.vue.d.ts +10 -0
- package/dist/runtime/components/form/_select/item-container.vue +63 -0
- package/dist/runtime/components/form/_select/item-container.vue.d.ts +19 -0
- package/dist/runtime/components/form/_select/item-label.vue +31 -0
- package/dist/runtime/components/form/_select/item-label.vue.d.ts +13 -0
- package/dist/runtime/components/form/_select/item-row.vue +62 -0
- package/dist/runtime/components/form/_select/item-row.vue.d.ts +34 -0
- package/dist/runtime/components/form/btn-line-loading.vue +62 -81
- package/dist/runtime/components/form/btn-line-loading.vue.d.ts +14 -0
- package/dist/runtime/components/form/btn.vue +411 -494
- package/dist/runtime/components/form/btn.vue.d.ts +0 -0
- package/dist/runtime/components/form/check-box.vue +200 -315
- package/dist/runtime/components/form/check-box.vue.d.ts +71 -0
- package/dist/runtime/components/form/check-list.vue +234 -364
- package/dist/runtime/components/form/check-list.vue.d.ts +99 -0
- package/dist/runtime/components/form/combo-box.vue +340 -0
- package/dist/runtime/components/form/combo-box.vue.d.ts +69 -0
- package/dist/runtime/components/form/datepicker.vue +717 -883
- package/dist/runtime/components/form/datepicker.vue.d.ts +122 -0
- package/dist/runtime/components/form/input-frame.vue +174 -258
- package/dist/runtime/components/form/input-frame.vue.d.ts +88 -0
- package/dist/runtime/components/form/radio.vue +451 -614
- package/dist/runtime/components/form/radio.vue.d.ts +62 -0
- package/dist/runtime/components/form/select-img-icon.vue +38 -53
- package/dist/runtime/components/form/select-img-icon.vue.d.ts +15 -0
- package/dist/runtime/components/form/select.vue +733 -579
- package/dist/runtime/components/form/select.vue.d.ts +63 -0
- package/dist/runtime/components/form/text-box.vue +266 -365
- package/dist/runtime/components/form/text-box.vue.d.ts +105 -0
- package/dist/runtime/components/form/textarea.vue +338 -421
- package/dist/runtime/components/form/textarea.vue.d.ts +98 -0
- package/dist/runtime/components/form/value-box.vue +512 -641
- package/dist/runtime/components/form/value-box.vue.d.ts +128 -0
- package/dist/runtime/components/interactive/alert.vue +49 -113
- package/dist/runtime/components/interactive/alert.vue.d.ts +30 -0
- package/dist/runtime/components/interactive/block-loading.vue +91 -119
- package/dist/runtime/components/interactive/block-loading.vue.d.ts +22 -0
- package/dist/runtime/components/interactive/dialog.vue +252 -407
- package/dist/runtime/components/interactive/dialog.vue.d.ts +3 -0
- package/dist/runtime/components/interactive/modal-bg.vue +72 -82
- package/dist/runtime/components/interactive/modal-bg.vue.d.ts +11 -0
- package/dist/runtime/components/interactive/modal.vue +121 -169
- package/dist/runtime/components/interactive/modal.vue.d.ts +38 -0
- package/dist/runtime/components/interactive/toast.vue +164 -206
- package/dist/runtime/components/interactive/toast.vue.d.ts +3 -0
- package/dist/runtime/components/interactive/window-loader.vue +61 -84
- package/dist/runtime/components/interactive/window-loader.vue.d.ts +3 -0
- package/dist/runtime/components/layout/accordion-down.vue +72 -0
- package/dist/runtime/components/layout/accordion-down.vue.d.ts +26 -0
- package/dist/runtime/components/layout/accordion.vue +47 -78
- package/dist/runtime/components/layout/accordion.vue.d.ts +22 -0
- package/dist/runtime/components/layout/aspect-box.vue +29 -58
- package/dist/runtime/components/layout/aspect-box.vue.d.ts +29 -0
- package/dist/runtime/components/layout/card-item.vue +148 -193
- package/dist/runtime/components/layout/card-item.vue.d.ts +0 -0
- package/dist/runtime/components/layout/card.vue +27 -42
- package/dist/runtime/components/layout/card.vue.d.ts +23 -0
- package/dist/runtime/components/layout/container.vue +25 -40
- package/dist/runtime/components/layout/container.vue.d.ts +35 -0
- package/dist/runtime/components/layout/divider-h.vue +30 -50
- package/dist/runtime/components/layout/divider-h.vue.d.ts +18 -0
- package/dist/runtime/components/misc/breadcrumb.vue +47 -95
- package/dist/runtime/components/misc/breadcrumb.vue.d.ts +22 -0
- package/dist/runtime/components/misc/tabulator.vue +122 -190
- package/dist/runtime/components/misc/tabulator.vue.d.ts +28 -0
- package/dist/runtime/components/misc/view-name-display.vue +53 -68
- package/dist/runtime/components/misc/view-name-display.vue.d.ts +14 -0
- package/dist/runtime/components/test.vue +13 -0
- package/dist/runtime/components/test.vue.d.ts +3 -0
- package/dist/runtime/composables/test.d.ts +8 -0
- package/dist/runtime/composables/test.js +12 -0
- package/dist/runtime/composables/use-hs-dialog.d.ts +3 -20
- package/dist/runtime/composables/use-hs-dialog.js +3 -9
- package/dist/runtime/composables/use-hs-is-mobile.d.ts +8 -2
- package/dist/runtime/composables/use-hs-is-mobile.js +43 -25
- package/dist/runtime/composables/use-hs-misc.d.ts +8 -38
- package/dist/runtime/composables/use-hs-misc.js +9 -61
- package/dist/runtime/composables/use-hs-modal.js +1 -3
- package/dist/runtime/composables/use-hs-multi-lang.d.ts +23 -40
- package/dist/runtime/composables/use-hs-multi-lang.js +30 -74
- package/dist/runtime/composables/use-hs-scroll-lock.d.ts +1 -1
- package/dist/runtime/composables/use-hs-scroll-lock.js +2 -1
- package/dist/runtime/composables/use-hs-toast.d.ts +2 -2
- package/dist/runtime/composables/use-hs-toast.js +12 -4
- package/dist/runtime/composables/use-pinia.d.ts +1 -0
- package/dist/runtime/composables/use-pinia.js +2 -0
- package/dist/runtime/plugin.d.ts +2 -0
- package/dist/runtime/plugin.js +4 -0
- package/dist/runtime/server/tsconfig.json +3 -3
- package/dist/runtime/types/dialog.d.ts +11 -20
- package/dist/runtime/types/dialog.js +2 -1
- package/dist/runtime/types/flatpickr/default.js +2 -23
- package/dist/runtime/types/flatpickr/ja.js +3 -37
- package/dist/runtime/types/toast.d.ts +1 -1
- package/dist/runtime/utils/dayjs.d.ts +8 -6
- package/dist/runtime/utils/dayjs.js +12 -5
- package/dist/runtime/utils/modal.d.ts +9 -28
- package/dist/runtime/utils/modal.js +7 -36
- package/dist/runtime/utils/multi-lang-object.d.ts +2 -2
- package/dist/runtime/utils/multi-lang-object.js +1 -5
- package/dist/runtime/utils/multi-lang.js +12 -22
- package/dist/runtime/utils/object.js +1 -1
- package/dist/runtime/utils/select-item.d.ts +3 -1
- package/dist/runtime/utils/stop-watch.js +6 -4
- package/dist/runtime/utils/string.js +4 -4
- package/dist/runtime/utils/tabulator.d.ts +1 -42
- package/dist/runtime/utils/tabulator.js +2 -99
- package/dist/runtime/utils/theme.d.ts +20 -20
- package/dist/runtime/utils/theme.js +180 -30
- package/dist/runtime/utils/tv.d.ts +1 -101
- package/dist/runtime/utils/tv.js +0 -22
- package/dist/types.d.mts +3 -1
- package/package.json +61 -119
- package/dist/module.cjs +0 -5
- package/dist/module.d.ts +0 -16
- package/dist/runtime/assets/vue-select.css +0 -1
- package/dist/runtime/components/misc/view-name-display-target.vue +0 -39
- package/dist/runtime/plugin/v-select.d.ts +0 -2
- package/dist/runtime/plugin/v-select.js +0 -5
- package/dist/runtime/style.css +0 -22
- package/dist/runtime/tailwind.css +0 -78
- package/dist/runtime/types/app.config.d.ts +0 -5
- package/dist/types.d.ts +0 -1
|
@@ -1,190 +1,122 @@
|
|
|
1
|
-
<script setup
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
import {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
"
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
);
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
() =>
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
const
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
() =>
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
}
|
|
103
|
-
);
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
tabulator.value
|
|
115
|
-
tabulator.value.
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
tabulator.value.on("tableBuilding", () => (isInit.value = false));
|
|
124
|
-
const beforeRows = option.data.length;
|
|
125
|
-
let buildingFlag = true;
|
|
126
|
-
tabulator.value.on("tableBuilt", () => {
|
|
127
|
-
// console.log(ct, 'tableBuilt');
|
|
128
|
-
const afterRows = props.rows.length;
|
|
129
|
-
if (buildingFlag && beforeRows !== afterRows) {
|
|
130
|
-
buildingFlag = false;
|
|
131
|
-
tabulator.value.replaceData(props.rows as any);
|
|
132
|
-
}
|
|
133
|
-
isInit.value = true;
|
|
134
|
-
});
|
|
135
|
-
tabulator.value.on("tableDestroyed", () => (isInit.value = false));
|
|
136
|
-
|
|
137
|
-
// 親コントロールへtableを伝達
|
|
138
|
-
emit("tabulator", tabulator.value);
|
|
139
|
-
// ----------------------------------------
|
|
140
|
-
|
|
141
|
-
/** 意図的にテーブルを再描画する */
|
|
142
|
-
const reBuild = () => {
|
|
143
|
-
// console.log(ct, 'reBuild');
|
|
144
|
-
if (tabulator.value === null || isInit.value === false) return;
|
|
145
|
-
tabulator.value.destroy();
|
|
146
|
-
tabulator.value = null;
|
|
147
|
-
initTabulator();
|
|
148
|
-
};
|
|
149
|
-
emit("table-rebuild", reBuild);
|
|
150
|
-
// ----------------------------------------
|
|
151
|
-
|
|
152
|
-
/** 意図的にテーブルを再描画する */
|
|
153
|
-
const redraw = () => {
|
|
154
|
-
if (tabulator.value === null || isInit.value === false) return;
|
|
155
|
-
tabulator.value.redraw(true);
|
|
156
|
-
};
|
|
157
|
-
emit("table-redraw", redraw);
|
|
158
|
-
// ----------------------------------------
|
|
159
|
-
|
|
160
|
-
const tableRefreshStopToggle = (flag: boolean) => {
|
|
161
|
-
// console.log('tableRefreshStopToggle', flag);
|
|
162
|
-
refreshStopFlag.value = flag;
|
|
163
|
-
};
|
|
164
|
-
emit("table-refresh-stop-toggle", tableRefreshStopToggle);
|
|
165
|
-
|
|
166
|
-
/** 意図的にテーブルデータをリフレッシュする */
|
|
167
|
-
const refresh = async () => {
|
|
168
|
-
if (tabulator.value === null || isInit.value === false) return;
|
|
169
|
-
await tabulator.value.replaceData(data.value as any);
|
|
170
|
-
};
|
|
171
|
-
emit("table-refresh", refresh);
|
|
172
|
-
};
|
|
173
|
-
// ----------------------------------------
|
|
174
|
-
|
|
175
|
-
onMounted(() => {
|
|
176
|
-
initTabulator();
|
|
177
|
-
});
|
|
178
|
-
|
|
179
|
-
onBeforeUnmount(() => {
|
|
180
|
-
// console.log("onBeforeUnmount");
|
|
181
|
-
if (tabulator.value === null) return;
|
|
182
|
-
tabulator.value.destroy();
|
|
183
|
-
tabulator.value = null;
|
|
184
|
-
});
|
|
185
|
-
// ----------------------------------------------------------------------------
|
|
186
|
-
</script>
|
|
187
|
-
|
|
188
|
-
<template>
|
|
189
|
-
<div ref="table"></div>
|
|
190
|
-
</template>
|
|
1
|
+
<script setup>
|
|
2
|
+
import { TabulatorFull as Tabulator } from "tabulator-tables";
|
|
3
|
+
import {
|
|
4
|
+
ref,
|
|
5
|
+
watch,
|
|
6
|
+
computed,
|
|
7
|
+
onMounted,
|
|
8
|
+
onBeforeUnmount
|
|
9
|
+
} from "#imports";
|
|
10
|
+
import { Option } from "../../utils/tabulator";
|
|
11
|
+
import { useHsMultiLang } from "../../composables/use-hs-multi-lang";
|
|
12
|
+
import { useHsPinia } from "../../composables/use-pinia";
|
|
13
|
+
const multiLang = useHsMultiLang(useHsPinia());
|
|
14
|
+
const props = defineProps({
|
|
15
|
+
columns: { type: Array, required: true },
|
|
16
|
+
rows: { type: Array, required: true },
|
|
17
|
+
option: { type: null, required: false, default: () => Option() }
|
|
18
|
+
});
|
|
19
|
+
const emit = defineEmits(["row-click", "row-dbl-click", "init", "tabulator", "table-rebuild", "table-redraw", "table-refresh", "table-refresh-stop-toggle"]);
|
|
20
|
+
const table = ref(null);
|
|
21
|
+
const tabulator = ref(null);
|
|
22
|
+
const data = computed(() => {
|
|
23
|
+
return props.rows;
|
|
24
|
+
});
|
|
25
|
+
const refreshStopFlag = ref(false);
|
|
26
|
+
watch(
|
|
27
|
+
() => props.rows,
|
|
28
|
+
() => {
|
|
29
|
+
if (table.value === null) return;
|
|
30
|
+
if (isInit.value && tabulator.value !== null && !refreshStopFlag.value) {
|
|
31
|
+
tabulator.value.replaceData(data.value);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
// // { deep: true }
|
|
35
|
+
);
|
|
36
|
+
watch(
|
|
37
|
+
() => multiLang.lang,
|
|
38
|
+
() => {
|
|
39
|
+
if (table.value === null) return;
|
|
40
|
+
tabulator.value.setLocale(multiLang.lang);
|
|
41
|
+
tabulator.value.redraw(true);
|
|
42
|
+
}
|
|
43
|
+
);
|
|
44
|
+
Tabulator.extendModule("localize", "langs", Option().langs);
|
|
45
|
+
const isInit = ref(false);
|
|
46
|
+
watch(isInit, (value) => {
|
|
47
|
+
emit("init", value);
|
|
48
|
+
});
|
|
49
|
+
watch(
|
|
50
|
+
() => props.columns,
|
|
51
|
+
() => {
|
|
52
|
+
if (table.value === null) return;
|
|
53
|
+
if (isInit.value) {
|
|
54
|
+
tabulator.value.setColumns(props.columns);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
);
|
|
58
|
+
const initTabulator = () => {
|
|
59
|
+
if (table.value === null) return;
|
|
60
|
+
const option = {
|
|
61
|
+
reactiveData: true,
|
|
62
|
+
...props.option,
|
|
63
|
+
columns: props.columns,
|
|
64
|
+
data: data.value
|
|
65
|
+
};
|
|
66
|
+
tabulator.value = new Tabulator(table.value, option);
|
|
67
|
+
tabulator.value.on("rowClick", (e, row) => {
|
|
68
|
+
emit("row-click", row._row.data);
|
|
69
|
+
e.stopPropagation();
|
|
70
|
+
});
|
|
71
|
+
tabulator.value.on("rowDblClick", (e, row) => {
|
|
72
|
+
emit("row-dbl-click", row._row.data);
|
|
73
|
+
e.stopPropagation();
|
|
74
|
+
});
|
|
75
|
+
tabulator.value.on("tableBuilding", () => isInit.value = false);
|
|
76
|
+
const beforeRows = option.data.length;
|
|
77
|
+
let buildingFlag = true;
|
|
78
|
+
tabulator.value.on("tableBuilt", () => {
|
|
79
|
+
const afterRows = props.rows.length;
|
|
80
|
+
if (buildingFlag && beforeRows !== afterRows) {
|
|
81
|
+
buildingFlag = false;
|
|
82
|
+
tabulator.value.replaceData(props.rows);
|
|
83
|
+
}
|
|
84
|
+
isInit.value = true;
|
|
85
|
+
});
|
|
86
|
+
tabulator.value.on("tableDestroyed", () => isInit.value = false);
|
|
87
|
+
emit("tabulator", tabulator.value);
|
|
88
|
+
const reBuild = () => {
|
|
89
|
+
if (tabulator.value === null || isInit.value === false) return;
|
|
90
|
+
tabulator.value.destroy();
|
|
91
|
+
tabulator.value = null;
|
|
92
|
+
initTabulator();
|
|
93
|
+
};
|
|
94
|
+
emit("table-rebuild", reBuild);
|
|
95
|
+
const redraw = () => {
|
|
96
|
+
if (tabulator.value === null || isInit.value === false) return;
|
|
97
|
+
tabulator.value.redraw(true);
|
|
98
|
+
};
|
|
99
|
+
emit("table-redraw", redraw);
|
|
100
|
+
const tableRefreshStopToggle = (flag) => {
|
|
101
|
+
refreshStopFlag.value = flag;
|
|
102
|
+
};
|
|
103
|
+
emit("table-refresh-stop-toggle", tableRefreshStopToggle);
|
|
104
|
+
const refresh = async () => {
|
|
105
|
+
if (tabulator.value === null || isInit.value === false) return;
|
|
106
|
+
await tabulator.value.replaceData(data.value);
|
|
107
|
+
};
|
|
108
|
+
emit("table-refresh", refresh);
|
|
109
|
+
};
|
|
110
|
+
onMounted(() => {
|
|
111
|
+
initTabulator();
|
|
112
|
+
});
|
|
113
|
+
onBeforeUnmount(() => {
|
|
114
|
+
if (tabulator.value === null) return;
|
|
115
|
+
tabulator.value.destroy();
|
|
116
|
+
tabulator.value = null;
|
|
117
|
+
});
|
|
118
|
+
</script>
|
|
119
|
+
|
|
120
|
+
<template>
|
|
121
|
+
<div ref="table"></div>
|
|
122
|
+
</template>
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
type Props = {
|
|
2
|
+
columns: any[];
|
|
3
|
+
rows: any[];
|
|
4
|
+
option?: any;
|
|
5
|
+
};
|
|
6
|
+
declare const __VLS_export: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
7
|
+
init: (flag: boolean) => any;
|
|
8
|
+
"row-click": (data: any) => any;
|
|
9
|
+
"row-dbl-click": (data: any) => any;
|
|
10
|
+
tabulator: (tabulator: any) => any;
|
|
11
|
+
"table-rebuild": (func: () => void) => any;
|
|
12
|
+
"table-redraw": (func: () => void) => any;
|
|
13
|
+
"table-refresh": (func: () => void) => any;
|
|
14
|
+
"table-refresh-stop-toggle": (func: (flag: boolean) => void) => any;
|
|
15
|
+
}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{
|
|
16
|
+
onInit?: ((flag: boolean) => any) | undefined;
|
|
17
|
+
"onRow-click"?: ((data: any) => any) | undefined;
|
|
18
|
+
"onRow-dbl-click"?: ((data: any) => any) | undefined;
|
|
19
|
+
onTabulator?: ((tabulator: any) => any) | undefined;
|
|
20
|
+
"onTable-rebuild"?: ((func: () => void) => any) | undefined;
|
|
21
|
+
"onTable-redraw"?: ((func: () => void) => any) | undefined;
|
|
22
|
+
"onTable-refresh"?: ((func: () => void) => any) | undefined;
|
|
23
|
+
"onTable-refresh-stop-toggle"?: ((func: (flag: boolean) => void) => any) | undefined;
|
|
24
|
+
}>, {
|
|
25
|
+
option: any;
|
|
26
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
27
|
+
declare const _default: typeof __VLS_export;
|
|
28
|
+
export default _default;
|
|
@@ -1,69 +1,58 @@
|
|
|
1
|
-
<script setup
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
</
|
|
51
|
-
|
|
52
|
-
<template>
|
|
53
|
-
<div
|
|
54
|
-
class="view-name-display flex-cc"
|
|
55
|
-
:class="{ isShow: !targetIsVisible && isMounted }"
|
|
56
|
-
>
|
|
57
|
-
<div class="view-name elevation-4" @click.stop="scroll()">
|
|
58
|
-
{{ tx(props.componentName).value }}
|
|
59
|
-
</div>
|
|
60
|
-
</div>
|
|
61
|
-
</template>
|
|
62
|
-
|
|
1
|
+
<script setup>
|
|
2
|
+
import { ref, computed, onMounted, watch } from "#imports";
|
|
3
|
+
import { useElementVisibility } from "@vueuse/core";
|
|
4
|
+
import { useHsMultiLang } from "../../composables/use-hs-multi-lang";
|
|
5
|
+
import { useHsPinia } from "../../composables/use-pinia";
|
|
6
|
+
const props = defineProps({
|
|
7
|
+
label: { type: [String, Object], required: true },
|
|
8
|
+
offset: { type: Number, required: false, default: 10 }
|
|
9
|
+
});
|
|
10
|
+
const emit = defineEmits(["ref"]);
|
|
11
|
+
const hsMultiLang = useHsMultiLang(useHsPinia());
|
|
12
|
+
const tx = hsMultiLang.tx;
|
|
13
|
+
const targetScrollElm = ref(null);
|
|
14
|
+
watch(targetScrollElm, (e) => () => {
|
|
15
|
+
if (!e) return;
|
|
16
|
+
emit("ref", e);
|
|
17
|
+
});
|
|
18
|
+
const targetVisibleElm = ref(null);
|
|
19
|
+
const targetIsVisible = useElementVisibility(targetVisibleElm);
|
|
20
|
+
const isMounted = ref(false);
|
|
21
|
+
onMounted(() => {
|
|
22
|
+
setTimeout(() => {
|
|
23
|
+
isMounted.value = true;
|
|
24
|
+
}, 1e3);
|
|
25
|
+
});
|
|
26
|
+
const scroll = () => {
|
|
27
|
+
if (targetScrollElm.value === null) return;
|
|
28
|
+
targetScrollElm.value.scrollIntoView({ behavior: "smooth" });
|
|
29
|
+
};
|
|
30
|
+
const styleScrollTarget = computed(() => {
|
|
31
|
+
return `margin-top:-${props.offset}px;`;
|
|
32
|
+
});
|
|
33
|
+
const styleVisibleTarget = computed(() => {
|
|
34
|
+
return `margin-top:-${props.offset - 10}px;`;
|
|
35
|
+
});
|
|
36
|
+
</script>
|
|
37
|
+
|
|
38
|
+
<template>
|
|
39
|
+
<div class="absolute">
|
|
40
|
+
<div ref="targetScrollElm" class="absolute top-0 pointer-events-none" :style="styleScrollTarget"></div>
|
|
41
|
+
<div ref="targetVisibleElm" class="absolute top-0 pointer-events-none" :style="styleVisibleTarget"></div>
|
|
42
|
+
<div class="view-name-display flex items-center justify-center" :class="{ isShow: !targetIsVisible && isMounted }">
|
|
43
|
+
<div class="view-name elevation-4 cursor-pointer bg-white" @click.stop="scroll()">
|
|
44
|
+
<div class="hover:bg-orange-700/10 min-h-full min-w-full px-2 py-1">
|
|
45
|
+
{{ tx(props.label).value }}
|
|
46
|
+
</div>
|
|
47
|
+
</div>
|
|
48
|
+
</div>
|
|
49
|
+
</div>
|
|
50
|
+
</template>
|
|
51
|
+
|
|
63
52
|
<style scoped>
|
|
64
53
|
.view-name-display {
|
|
65
54
|
position: fixed;
|
|
66
|
-
top:
|
|
55
|
+
top: 4px;
|
|
67
56
|
left: 0;
|
|
68
57
|
right: 0;
|
|
69
58
|
z-index: 1;
|
|
@@ -76,15 +65,11 @@ const scroll = () => {
|
|
|
76
65
|
}
|
|
77
66
|
.view-name-display .view-name {
|
|
78
67
|
font-size: 0.8rem;
|
|
79
|
-
padding: 2px 10px;
|
|
80
|
-
background-color: white;
|
|
81
68
|
border: solid 2px #eb6600;
|
|
82
69
|
color: #eb6600;
|
|
83
|
-
border: solid 2px #1c03a2;
|
|
84
|
-
color: #1c03a2;
|
|
85
70
|
pointer-events: all;
|
|
86
71
|
}
|
|
87
72
|
.view-name-display .view-name {
|
|
88
73
|
font-size: 0.8rem;
|
|
89
74
|
}
|
|
90
|
-
</style>
|
|
75
|
+
</style>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { MultiLang } from '../../utils/multi-lang.js';
|
|
2
|
+
interface Props {
|
|
3
|
+
label: MultiLang;
|
|
4
|
+
offset?: number;
|
|
5
|
+
}
|
|
6
|
+
declare const __VLS_export: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
7
|
+
ref: (element: HTMLElement) => any;
|
|
8
|
+
}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{
|
|
9
|
+
onRef?: ((element: HTMLElement) => any) | undefined;
|
|
10
|
+
}>, {
|
|
11
|
+
offset: number;
|
|
12
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
13
|
+
declare const _default: typeof __VLS_export;
|
|
14
|
+
export default _default;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
|
|
3
|
+
</script>
|
|
4
|
+
|
|
5
|
+
<template>
|
|
6
|
+
<div class="">
|
|
7
|
+
<UAlert title="src" color="info" />
|
|
8
|
+
<div class="bg-green-400 py-8">FormTest bg-green-400 py-8</div>
|
|
9
|
+
<!-- <div class="bg-main1">{{ GetColorCode('main3') }}</div> -->
|
|
10
|
+
<!-- <div class="bg-red-500 1000:bg-green-400">red -> 1000 -> green</div> -->
|
|
11
|
+
<!-- <div class="bg-main2 @1000:bg-green-400">main2 -> @1000 -> green</div> -->
|
|
12
|
+
</div>
|
|
13
|
+
</template>
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
declare const __VLS_export: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
2
|
+
declare const _default: typeof __VLS_export;
|
|
3
|
+
export default _default;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { ThemeColor } from '../../runtime/utils/theme.js';
|
|
2
|
+
export declare const useStore: import("pinia").StoreDefinition<"store", Pick<{
|
|
3
|
+
theme: import("vue").Ref<ThemeColor, ThemeColor>;
|
|
4
|
+
}, "theme">, Pick<{
|
|
5
|
+
theme: import("vue").Ref<ThemeColor, ThemeColor>;
|
|
6
|
+
}, never>, Pick<{
|
|
7
|
+
theme: import("vue").Ref<ThemeColor, ThemeColor>;
|
|
8
|
+
}, never>>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { MultiLang } from
|
|
2
|
-
import { DialogItem, DialogResult, type DialogOption } from
|
|
1
|
+
import type { MultiLang } from '../utils/multi-lang.js';
|
|
2
|
+
import { DialogItem, DialogResult, type DialogOption } from '../types/dialog.js';
|
|
3
3
|
interface State {
|
|
4
4
|
state: {
|
|
5
5
|
id: number;
|
|
@@ -10,24 +10,7 @@ interface State {
|
|
|
10
10
|
};
|
|
11
11
|
}
|
|
12
12
|
export declare const useHsDialog: import("pinia").StoreDefinition<"HsDialog", State, {
|
|
13
|
-
Themes: () =>
|
|
14
|
-
readonly main0: "main0";
|
|
15
|
-
readonly main1: "main1";
|
|
16
|
-
readonly main2: "main2";
|
|
17
|
-
readonly main3: "main3";
|
|
18
|
-
readonly accent1: "accent1";
|
|
19
|
-
readonly accent2: "accent2";
|
|
20
|
-
readonly info: "info";
|
|
21
|
-
readonly link: "link";
|
|
22
|
-
readonly download: "download";
|
|
23
|
-
readonly success: "success";
|
|
24
|
-
readonly warn: "warn";
|
|
25
|
-
readonly error: "error";
|
|
26
|
-
readonly white: "white";
|
|
27
|
-
readonly black: "black";
|
|
28
|
-
readonly dark: "dark";
|
|
29
|
-
readonly back: "back";
|
|
30
|
-
};
|
|
13
|
+
Themes: () => Record<import("../utils/theme.js").ThemeColor, import("../utils/theme.js").ThemeColor>;
|
|
31
14
|
InitOption: () => () => DialogOption;
|
|
32
15
|
Result: () => {
|
|
33
16
|
readonly left: "left";
|
|
@@ -1,12 +1,8 @@
|
|
|
1
|
-
import dayjs from "dayjs/esm/index";
|
|
2
1
|
import { defineStore } from "pinia";
|
|
3
2
|
import { GenerateUniqeKey } from "../utils/com.js";
|
|
4
3
|
import { Theme } from "../utils/theme.js";
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
InitDialogOption,
|
|
8
|
-
DialogResult
|
|
9
|
-
} from "../types/dialog.js";
|
|
4
|
+
import { dayjs } from "../utils/dayjs.js";
|
|
5
|
+
import { DialogItem, InitDialogOption, DialogResult } from "../types/dialog.js";
|
|
10
6
|
export const useHsDialog = defineStore("HsDialog", {
|
|
11
7
|
state: () => {
|
|
12
8
|
return {
|
|
@@ -38,9 +34,7 @@ export const useHsDialog = defineStore("HsDialog", {
|
|
|
38
34
|
data: item
|
|
39
35
|
});
|
|
40
36
|
const ret = await item.show();
|
|
41
|
-
this.state.pendingList = this.state.pendingList.filter(
|
|
42
|
-
(row) => row.ts !== ts
|
|
43
|
-
);
|
|
37
|
+
this.state.pendingList = this.state.pendingList.filter((row) => row.ts !== ts);
|
|
44
38
|
return ret;
|
|
45
39
|
}
|
|
46
40
|
// ---------------------------------------------------
|
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
export declare const useHsIsMobile: import("pinia").StoreDefinition<"HsIsMobile", Pick<{
|
|
2
2
|
isMobile: import("vue").Ref<boolean | null, boolean | null>;
|
|
3
|
-
|
|
3
|
+
init: () => void;
|
|
4
|
+
isIPhone: import("vue").Ref<boolean | null, boolean | null>;
|
|
5
|
+
}, "isMobile" | "isIPhone">, Pick<{
|
|
4
6
|
isMobile: import("vue").Ref<boolean | null, boolean | null>;
|
|
7
|
+
init: () => void;
|
|
8
|
+
isIPhone: import("vue").Ref<boolean | null, boolean | null>;
|
|
5
9
|
}, never>, Pick<{
|
|
6
10
|
isMobile: import("vue").Ref<boolean | null, boolean | null>;
|
|
7
|
-
|
|
11
|
+
init: () => void;
|
|
12
|
+
isIPhone: import("vue").Ref<boolean | null, boolean | null>;
|
|
13
|
+
}, "init">>;
|