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.
Files changed (131) hide show
  1. package/README.md +202 -14
  2. package/dist/module.d.mts +3 -4
  3. package/dist/module.json +9 -6
  4. package/dist/module.mjs +109 -99
  5. package/dist/runtime/assets/flatpickr-dark.css +1 -1
  6. package/dist/runtime/assets/main.css +1 -0
  7. package/dist/runtime/assets/tabulator-custom.css +1 -1
  8. package/dist/runtime/components/form/_select/hidden-item-toggle.vue +28 -0
  9. package/dist/runtime/components/form/_select/hidden-item-toggle.vue.d.ts +10 -0
  10. package/dist/runtime/components/form/_select/item-container.vue +63 -0
  11. package/dist/runtime/components/form/_select/item-container.vue.d.ts +19 -0
  12. package/dist/runtime/components/form/_select/item-label.vue +31 -0
  13. package/dist/runtime/components/form/_select/item-label.vue.d.ts +13 -0
  14. package/dist/runtime/components/form/_select/item-row.vue +62 -0
  15. package/dist/runtime/components/form/_select/item-row.vue.d.ts +34 -0
  16. package/dist/runtime/components/form/btn-line-loading.vue +62 -81
  17. package/dist/runtime/components/form/btn-line-loading.vue.d.ts +14 -0
  18. package/dist/runtime/components/form/btn.vue +411 -494
  19. package/dist/runtime/components/form/btn.vue.d.ts +0 -0
  20. package/dist/runtime/components/form/check-box.vue +200 -315
  21. package/dist/runtime/components/form/check-box.vue.d.ts +71 -0
  22. package/dist/runtime/components/form/check-list.vue +234 -364
  23. package/dist/runtime/components/form/check-list.vue.d.ts +99 -0
  24. package/dist/runtime/components/form/combo-box.vue +340 -0
  25. package/dist/runtime/components/form/combo-box.vue.d.ts +69 -0
  26. package/dist/runtime/components/form/datepicker.vue +717 -883
  27. package/dist/runtime/components/form/datepicker.vue.d.ts +122 -0
  28. package/dist/runtime/components/form/input-frame.vue +174 -258
  29. package/dist/runtime/components/form/input-frame.vue.d.ts +88 -0
  30. package/dist/runtime/components/form/radio.vue +451 -614
  31. package/dist/runtime/components/form/radio.vue.d.ts +62 -0
  32. package/dist/runtime/components/form/select-img-icon.vue +38 -53
  33. package/dist/runtime/components/form/select-img-icon.vue.d.ts +15 -0
  34. package/dist/runtime/components/form/select.vue +733 -579
  35. package/dist/runtime/components/form/select.vue.d.ts +63 -0
  36. package/dist/runtime/components/form/text-box.vue +266 -365
  37. package/dist/runtime/components/form/text-box.vue.d.ts +105 -0
  38. package/dist/runtime/components/form/textarea.vue +338 -421
  39. package/dist/runtime/components/form/textarea.vue.d.ts +98 -0
  40. package/dist/runtime/components/form/value-box.vue +512 -641
  41. package/dist/runtime/components/form/value-box.vue.d.ts +128 -0
  42. package/dist/runtime/components/interactive/alert.vue +49 -113
  43. package/dist/runtime/components/interactive/alert.vue.d.ts +30 -0
  44. package/dist/runtime/components/interactive/block-loading.vue +91 -119
  45. package/dist/runtime/components/interactive/block-loading.vue.d.ts +22 -0
  46. package/dist/runtime/components/interactive/dialog.vue +252 -407
  47. package/dist/runtime/components/interactive/dialog.vue.d.ts +3 -0
  48. package/dist/runtime/components/interactive/modal-bg.vue +72 -82
  49. package/dist/runtime/components/interactive/modal-bg.vue.d.ts +11 -0
  50. package/dist/runtime/components/interactive/modal.vue +121 -169
  51. package/dist/runtime/components/interactive/modal.vue.d.ts +38 -0
  52. package/dist/runtime/components/interactive/toast.vue +164 -206
  53. package/dist/runtime/components/interactive/toast.vue.d.ts +3 -0
  54. package/dist/runtime/components/interactive/window-loader.vue +61 -84
  55. package/dist/runtime/components/interactive/window-loader.vue.d.ts +3 -0
  56. package/dist/runtime/components/layout/accordion-down.vue +72 -0
  57. package/dist/runtime/components/layout/accordion-down.vue.d.ts +26 -0
  58. package/dist/runtime/components/layout/accordion.vue +47 -78
  59. package/dist/runtime/components/layout/accordion.vue.d.ts +22 -0
  60. package/dist/runtime/components/layout/aspect-box.vue +29 -58
  61. package/dist/runtime/components/layout/aspect-box.vue.d.ts +29 -0
  62. package/dist/runtime/components/layout/card-item.vue +148 -193
  63. package/dist/runtime/components/layout/card-item.vue.d.ts +0 -0
  64. package/dist/runtime/components/layout/card.vue +27 -42
  65. package/dist/runtime/components/layout/card.vue.d.ts +23 -0
  66. package/dist/runtime/components/layout/container.vue +25 -40
  67. package/dist/runtime/components/layout/container.vue.d.ts +35 -0
  68. package/dist/runtime/components/layout/divider-h.vue +30 -50
  69. package/dist/runtime/components/layout/divider-h.vue.d.ts +18 -0
  70. package/dist/runtime/components/misc/breadcrumb.vue +47 -95
  71. package/dist/runtime/components/misc/breadcrumb.vue.d.ts +22 -0
  72. package/dist/runtime/components/misc/tabulator.vue +122 -190
  73. package/dist/runtime/components/misc/tabulator.vue.d.ts +28 -0
  74. package/dist/runtime/components/misc/view-name-display.vue +53 -68
  75. package/dist/runtime/components/misc/view-name-display.vue.d.ts +14 -0
  76. package/dist/runtime/components/test.vue +13 -0
  77. package/dist/runtime/components/test.vue.d.ts +3 -0
  78. package/dist/runtime/composables/test.d.ts +8 -0
  79. package/dist/runtime/composables/test.js +12 -0
  80. package/dist/runtime/composables/use-hs-dialog.d.ts +3 -20
  81. package/dist/runtime/composables/use-hs-dialog.js +3 -9
  82. package/dist/runtime/composables/use-hs-is-mobile.d.ts +8 -2
  83. package/dist/runtime/composables/use-hs-is-mobile.js +43 -25
  84. package/dist/runtime/composables/use-hs-misc.d.ts +8 -38
  85. package/dist/runtime/composables/use-hs-misc.js +9 -61
  86. package/dist/runtime/composables/use-hs-modal.js +1 -3
  87. package/dist/runtime/composables/use-hs-multi-lang.d.ts +23 -40
  88. package/dist/runtime/composables/use-hs-multi-lang.js +30 -74
  89. package/dist/runtime/composables/use-hs-scroll-lock.d.ts +1 -1
  90. package/dist/runtime/composables/use-hs-scroll-lock.js +2 -1
  91. package/dist/runtime/composables/use-hs-toast.d.ts +2 -2
  92. package/dist/runtime/composables/use-hs-toast.js +12 -4
  93. package/dist/runtime/composables/use-pinia.d.ts +1 -0
  94. package/dist/runtime/composables/use-pinia.js +2 -0
  95. package/dist/runtime/plugin.d.ts +2 -0
  96. package/dist/runtime/plugin.js +4 -0
  97. package/dist/runtime/server/tsconfig.json +3 -3
  98. package/dist/runtime/types/dialog.d.ts +11 -20
  99. package/dist/runtime/types/dialog.js +2 -1
  100. package/dist/runtime/types/flatpickr/default.js +2 -23
  101. package/dist/runtime/types/flatpickr/ja.js +3 -37
  102. package/dist/runtime/types/toast.d.ts +1 -1
  103. package/dist/runtime/utils/dayjs.d.ts +8 -6
  104. package/dist/runtime/utils/dayjs.js +12 -5
  105. package/dist/runtime/utils/modal.d.ts +9 -28
  106. package/dist/runtime/utils/modal.js +7 -36
  107. package/dist/runtime/utils/multi-lang-object.d.ts +2 -2
  108. package/dist/runtime/utils/multi-lang-object.js +1 -5
  109. package/dist/runtime/utils/multi-lang.js +12 -22
  110. package/dist/runtime/utils/object.js +1 -1
  111. package/dist/runtime/utils/select-item.d.ts +3 -1
  112. package/dist/runtime/utils/stop-watch.js +6 -4
  113. package/dist/runtime/utils/string.js +4 -4
  114. package/dist/runtime/utils/tabulator.d.ts +1 -42
  115. package/dist/runtime/utils/tabulator.js +2 -99
  116. package/dist/runtime/utils/theme.d.ts +20 -20
  117. package/dist/runtime/utils/theme.js +180 -30
  118. package/dist/runtime/utils/tv.d.ts +1 -101
  119. package/dist/runtime/utils/tv.js +0 -22
  120. package/dist/types.d.mts +3 -1
  121. package/package.json +61 -119
  122. package/dist/module.cjs +0 -5
  123. package/dist/module.d.ts +0 -16
  124. package/dist/runtime/assets/vue-select.css +0 -1
  125. package/dist/runtime/components/misc/view-name-display-target.vue +0 -39
  126. package/dist/runtime/plugin/v-select.d.ts +0 -2
  127. package/dist/runtime/plugin/v-select.js +0 -5
  128. package/dist/runtime/style.css +0 -22
  129. package/dist/runtime/tailwind.css +0 -78
  130. package/dist/runtime/types/app.config.d.ts +0 -5
  131. package/dist/types.d.ts +0 -1
@@ -1,190 +1,122 @@
1
- <script setup lang="ts">
2
- /* ----------------------------------------------------------------------------
3
- // src\runtime\components\misc\tabulator.vue
4
- // ----------------------------------------------------------------------------
5
- // Tabulator
6
- // TabulatorTabulator
7
- ----------------------------------------------------------------------------- */
8
-
9
- // ----------------------------------------------------------------------------
10
- // [ node_modules ]
11
- import { TabulatorFull as Tabulator } from "tabulator-tables";
12
- // [ NUXT ]
13
- import {
14
- ref,
15
- watch,
16
- computed,
17
- onMounted,
18
- // onUnmounted,
19
- onBeforeUnmount,
20
- } from "#imports";
21
- // ----------------------------------------------------------------------------
22
- // [ utils ]
23
- import { Option } from "../../utils/tabulator";
24
- // [ composables ]
25
- import { useHsMultiLang } from "../../composables/use-hs-multi-lang";
26
- // ----------------------------------------------------------------------------
27
- // ----------------------------------------------------------------------------
28
- const multiLang = useHsMultiLang();
29
- // ----------------------------------------------------------------------------
30
- // [ Props ]
31
- type Props = {
32
- columns: any[];
33
- rows: any[];
34
- option?: any;
35
- };
36
- const props = withDefaults(defineProps<Props>(), {
37
- // rowCountHeight: 0,
38
- option: () => Option(),
39
- });
40
- // [ emit ]
41
- type Emits = {
42
- "row-click": [data: any];
43
- "row-dbl-click": [data: any];
44
- init: [flag: boolean];
45
- tabulator: [tabulator: any];
46
- "table-rebuild": [func: () => void];
47
- "table-redraw": [func: () => void];
48
- "table-refresh": [func: () => void];
49
- "table-refresh-stop-toggle": [func: (flag: boolean) => void];
50
- };
51
- const emit = defineEmits<Emits>();
52
- // [ reactive ]
53
- const table = ref<HTMLElement | null>(null); // reference to your table element
54
- const tabulator = ref<any>(null); // variable to hold your table
55
-
56
- const data = computed(() => {
57
- return props.rows;
58
- });
59
- // ----------------------------------------------------------------------------
60
-
61
- const refreshStopFlag = ref(false);
62
- watch(
63
- () => props.rows,
64
- () => {
65
- // console.log("watch rows", props.rows);
66
- if (table.value === null) return;
67
- if (isInit.value && tabulator.value !== null && !refreshStopFlag.value) {
68
- tabulator.value.replaceData(data.value as any);
69
- }
70
- }
71
- // // { deep: true }
72
- );
73
-
74
- watch(
75
- () => multiLang.state.lang,
76
- () => {
77
- // console.log(ct, 'watch multiLang', multiLang.lang);
78
- if (table.value === null) return;
79
- // console.log('watch > prop.lang', tabulator.value);
80
- tabulator.value.setLocale(multiLang.state.lang);
81
- // console.log('watch > prop.lang', tabulator.value.redraw);
82
- tabulator.value.redraw(true);
83
- }
84
- );
85
-
86
- // [▼ 初期化 ▼]
87
- Tabulator.extendModule("localize", "langs", Option().langs);
88
- const isInit = ref(false);
89
-
90
- watch(isInit, (value) => {
91
- emit("init", value);
92
- });
93
-
94
- watch(
95
- () => props.columns,
96
- () => {
97
- // console.log(ct, 'watch columns', value);
98
- if (table.value === null) return;
99
- if (isInit.value) {
100
- tabulator.value.setColumns(props.columns);
101
- }
102
- }
103
- );
104
-
105
- const initTabulator = () => {
106
- // console.log(ct, 'initTabulator');
107
- if (table.value === null) return;
108
- const option = {
109
- reactiveData: true,
110
- ...props.option,
111
- columns: props.columns,
112
- data: data.value,
113
- };
114
- tabulator.value = new Tabulator(table.value, option);
115
- tabulator.value.on("rowClick", (e: any, row: any) => {
116
- emit("row-click", row._row.data);
117
- e.stopPropagation();
118
- });
119
- tabulator.value.on("rowDblClick", (e: any, row: any) => {
120
- emit("row-dbl-click", row._row.data);
121
- e.stopPropagation();
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 lang="ts">
2
- /* ----------------------------------------------------------------------------
3
- // src\runtime\components\misc\view-name-display.vue
4
- // ----------------------------------------------------------------------------
5
- // ViewNameDisplay
6
- // ViewNameDisplayViewNameDisplay
7
- ----------------------------------------------------------------------------- */
8
-
9
- // [ NUXT ]
10
- import { ref, watch, onMounted, type Ref } from "#imports";
11
- // [ vueuse ]
12
- import { useElementVisibility } from "@vueuse/core";
13
- // ----------------------------------------------------------------------------
14
- // [ utils ]
15
- import type { MultiLang } from "../../utils/multi-lang";
16
- // [ composables ]
17
- import { useHsMultiLang } from "../../composables/use-hs-multi-lang";
18
- // ----------------------------------------------------------------------------
19
- // [ Props ]
20
- interface Props {
21
- // isShow: boolean;
22
- componentName: MultiLang;
23
- headerElm: HTMLElement | null;
24
- }
25
- const props = defineProps<Props>();
26
- // ----------------------------------------------------------------------------
27
- // [ MultiLang ]
28
- const hsMultiLang = useHsMultiLang();
29
- const tx = hsMultiLang.tx;
30
- // ----------------------------------------------------------------------------
31
- let targetIsVisible: false | Ref<boolean> = false;
32
- watch(
33
- () => props.headerElm,
34
- () => {
35
- targetIsVisible = useElementVisibility(props.headerElm);
36
- }
37
- );
38
-
39
- const isMounted = ref(false);
40
- onMounted(() => {
41
- setTimeout(() => {
42
- isMounted.value = true;
43
- }, 1000);
44
- });
45
-
46
- const scroll = () => {
47
- if (props.headerElm === null) return;
48
- props.headerElm.scrollIntoView({ behavior: "smooth" });
49
- };
50
- </script>
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: 20px;
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>>;
@@ -0,0 +1,12 @@
1
+ import { defineStore } from "pinia";
2
+ import { ref } from "vue";
3
+ export const useStore = defineStore(
4
+ "store",
5
+ () => {
6
+ const theme = ref("main1");
7
+ return { theme };
8
+ },
9
+ {
10
+ persist: true
11
+ }
12
+ );
@@ -1,5 +1,5 @@
1
- import type { MultiLang } from "../utils/multi-lang.js";
2
- import { DialogItem, DialogResult, type DialogOption } from "../types/dialog.js";
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
- DialogItem,
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
- }, "isMobile">, Pick<{
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
- }, never>>;
11
+ init: () => void;
12
+ isIPhone: import("vue").Ref<boolean | null, boolean | null>;
13
+ }, "init">>;