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.
Files changed (112) hide show
  1. package/README.md +11 -4
  2. package/dist/module.d.mts +10 -2
  3. package/dist/module.d.ts +10 -2
  4. package/dist/module.json +5 -2
  5. package/dist/module.mjs +90 -51
  6. package/dist/runtime/assets/flatpickr-dark.css +1 -0
  7. package/dist/runtime/assets/flatpickr-month-select-style.css +1 -0
  8. package/dist/runtime/assets/tabulator-custom.css +1 -0
  9. package/dist/runtime/assets/tabulator.css +1 -0
  10. package/dist/runtime/assets/vue-select.css +1 -0
  11. package/dist/runtime/components/{hs-fc/btn/line-loading.vue → form/btn-line-loading.vue} +28 -42
  12. package/dist/runtime/components/form/btn.vue +488 -0
  13. package/dist/runtime/components/form/check-box.vue +352 -0
  14. package/dist/runtime/components/form/check-list.vue +354 -0
  15. package/dist/runtime/components/form/datepicker copy.vue +770 -0
  16. package/dist/runtime/components/form/datepicker.vue +897 -0
  17. package/dist/runtime/components/form/input-frame.vue +272 -0
  18. package/dist/runtime/components/form/radio.vue +685 -0
  19. package/dist/runtime/components/form/select-img-icon.vue +53 -0
  20. package/dist/runtime/components/form/select.vue +438 -0
  21. package/dist/runtime/components/form/text-box.vue +375 -0
  22. package/dist/runtime/components/form/textarea.vue +466 -0
  23. package/dist/runtime/components/form/value-box.vue +681 -0
  24. package/dist/runtime/components/interactive/alert.vue +113 -0
  25. package/dist/runtime/components/{hs-ui → interactive}/block-loading.vue +42 -59
  26. package/dist/runtime/components/{hs-ui/dialog/index.vue → interactive/dialog.vue} +132 -127
  27. package/dist/runtime/components/interactive/modal-bg.vue +82 -0
  28. package/dist/runtime/components/interactive/modal.vue +143 -0
  29. package/dist/runtime/components/{hs-ui/toast/index.vue → interactive/toast.vue} +76 -109
  30. package/dist/runtime/components/{hs-ui → interactive}/window-loader.vue +12 -9
  31. package/dist/runtime/components/{hs-ui → layout}/accordion.vue +21 -30
  32. package/dist/runtime/components/layout/aspect-box.vue +71 -0
  33. package/dist/runtime/components/layout/card-item.vue +193 -0
  34. package/dist/runtime/components/layout/card.vue +42 -0
  35. package/dist/runtime/components/layout/container.vue +40 -0
  36. package/dist/runtime/components/misc/breadcrumb.vue +96 -0
  37. package/dist/runtime/components/misc/tabulator.vue +187 -0
  38. package/dist/runtime/components/misc/view-name-display-target.vue +39 -0
  39. package/dist/runtime/components/misc/view-name-display.vue +90 -0
  40. package/dist/runtime/composables/use-hs-dialog.d.ts +40 -0
  41. package/dist/runtime/composables/{use-hs-ui-dialog.js → use-hs-dialog.js} +15 -10
  42. package/dist/runtime/composables/{use-hs-form-focus.d.ts → use-hs-focus.d.ts} +1 -1
  43. package/dist/runtime/composables/{use-hs-form-focus.js → use-hs-focus.js} +2 -4
  44. package/dist/runtime/composables/use-hs-misc.d.ts +22 -0
  45. package/dist/runtime/composables/use-hs-misc.js +62 -0
  46. package/dist/runtime/composables/use-hs-modal.d.ts +31 -0
  47. package/dist/runtime/{components/hs-ui/modal/use-ui-modal.js → composables/use-hs-modal.js} +18 -16
  48. package/dist/runtime/composables/use-hs-multi-lang.d.ts +14 -6
  49. package/dist/runtime/composables/use-hs-multi-lang.js +44 -11
  50. package/dist/runtime/composables/{use-hs-ui-toast.d.ts → use-hs-toast.d.ts} +3 -3
  51. package/dist/runtime/composables/{use-hs-ui-toast.js → use-hs-toast.js} +4 -5
  52. package/dist/runtime/composables/{use-hs-ui-window-loader.d.ts → use-hs-window-loader.d.ts} +1 -1
  53. package/dist/runtime/composables/{use-hs-ui-window-loader.js → use-hs-window-loader.js} +1 -2
  54. package/dist/runtime/plugin/v-select.d.ts +2 -0
  55. package/dist/runtime/plugin/v-select.js +5 -0
  56. package/dist/runtime/style.css +22 -1
  57. package/dist/runtime/tailwind.css +78 -0
  58. package/dist/runtime/types/app.config.d.ts +5 -0
  59. package/dist/runtime/{components/hs-ui/dialog/index.type.d.ts → types/dialog.d.ts} +3 -3
  60. package/dist/runtime/{components/hs-ui/toast/index.type.d.ts → types/toast.d.ts} +1 -2
  61. package/dist/runtime/{components/hs-ui/toast/index.type.js → types/toast.js} +0 -1
  62. package/dist/runtime/utils/class-style.d.ts +6 -0
  63. package/dist/runtime/utils/class-style.js +27 -0
  64. package/dist/runtime/utils/com.d.ts +6 -0
  65. package/dist/runtime/{lib → utils}/com.js +1 -4
  66. package/dist/runtime/utils/dayjs.d.ts +53 -0
  67. package/dist/runtime/utils/dayjs.js +124 -0
  68. package/dist/runtime/utils/float.d.ts +2 -0
  69. package/dist/runtime/utils/float.js +35 -0
  70. package/dist/runtime/utils/multi-lang-object.d.ts +17 -0
  71. package/dist/runtime/utils/multi-lang-object.js +34 -0
  72. package/dist/runtime/{lib → utils}/multi-lang.d.ts +1 -1
  73. package/dist/runtime/{lib → utils}/multi-lang.js +31 -27
  74. package/dist/runtime/{lib → utils}/number.d.ts +2 -4
  75. package/dist/runtime/{lib → utils}/number.js +29 -69
  76. package/dist/runtime/utils/object.d.ts +46 -0
  77. package/dist/runtime/utils/object.js +107 -0
  78. package/dist/runtime/utils/select-item.d.ts +31 -0
  79. package/dist/runtime/utils/select.d.ts +14 -0
  80. package/dist/runtime/utils/select.js +36 -0
  81. package/dist/runtime/utils/string.d.ts +39 -0
  82. package/dist/runtime/utils/string.js +125 -0
  83. package/dist/runtime/utils/tabulator.d.ts +108 -0
  84. package/dist/runtime/utils/tabulator.js +296 -0
  85. package/dist/runtime/utils/theme.d.ts +21 -0
  86. package/dist/runtime/utils/theme.js +31 -0
  87. package/dist/runtime/utils/tv.d.ts +101 -0
  88. package/dist/runtime/utils/tv.js +26 -0
  89. package/dist/runtime/utils/wareki.d.ts +3 -0
  90. package/dist/runtime/utils/wareki.js +106 -0
  91. package/dist/types.d.mts +1 -17
  92. package/dist/types.d.ts +1 -17
  93. package/package.json +99 -37
  94. package/dist/runtime/components/hs-fc/btn/index.vue +0 -510
  95. package/dist/runtime/components/hs-ui/aspect-box.vue +0 -83
  96. package/dist/runtime/components/hs-ui/card-item.vue +0 -141
  97. package/dist/runtime/components/hs-ui/card.vue +0 -54
  98. package/dist/runtime/components/hs-ui/container.vue +0 -50
  99. package/dist/runtime/components/hs-ui/modal/bg.vue +0 -94
  100. package/dist/runtime/components/hs-ui/modal/index.vue +0 -206
  101. package/dist/runtime/components/hs-ui/modal/use-ui-modal.d.ts +0 -20
  102. package/dist/runtime/components/v-test.vue +0 -60
  103. package/dist/runtime/composables/use-hs-ui-dialog.d.ts +0 -22
  104. package/dist/runtime/lib/class-style.d.ts +0 -8
  105. package/dist/runtime/lib/class-style.js +0 -59
  106. package/dist/runtime/lib/com.d.ts +0 -14
  107. package/dist/runtime/lib/prefix.d.ts +0 -2
  108. package/dist/runtime/lib/prefix.js +0 -17
  109. package/dist/runtime/lib/theme.d.ts +0 -2
  110. package/dist/runtime/lib/theme.js +0 -21
  111. /package/dist/runtime/{components/hs-ui/dialog/index.type.js → types/dialog.js} +0 -0
  112. /package/dist/runtime/{components/hs-fc/hoge → utils/select-item.js} +0 -0
@@ -0,0 +1,272 @@
1
+ <script setup lang="ts">
2
+ /* ----------------------------------------------------------------------------
3
+ // src\runtime\components\form\input-frame.vue
4
+ // ----------------------------------------------------------------------------
5
+ // InputFrame
6
+ // InputFrameInputFrame
7
+ ----------------------------------------------------------------------------- */
8
+
9
+ // [ tailwind ]
10
+ import { twMerge } from "tailwind-merge";
11
+ // [ NUXT ]
12
+ import { computed, useSlots } from "#imports";
13
+ // [ utils ]
14
+ import { type ClassType, ClassTypeToString } from "../../utils/class-style";
15
+ // [ composables ]
16
+ import { useHsToast } from "../../composables/use-hs-toast";
17
+ // ----------------------------------------------------------------------------
18
+ // [ Props ]
19
+ type Props = {
20
+ class?: ClassType;
21
+ classHeader?: ClassType;
22
+ classInput?: ClassType;
23
+ // ----------------------------------------------------------------------------
24
+ // 状態
25
+ focus?: boolean;
26
+ focusColor?: string;
27
+ change?: boolean;
28
+ changeColor?: string;
29
+ error?: boolean;
30
+ errorColor?: string;
31
+ disabled?: boolean;
32
+ disabledColor?: string;
33
+ readonly?: boolean;
34
+ // ----------------------------------------------------------------------------
35
+
36
+ // 表示
37
+ label?: string;
38
+ // 表示-副情報
39
+ require?: boolean;
40
+ requireText?: string;
41
+ warn?: string;
42
+ warnTimeOut?: number;
43
+ // ----------------------------------------------------------------------------
44
+ // 設定
45
+ size?: "s" | "m" | "l";
46
+ };
47
+ const props = withDefaults(defineProps<Props>(), {
48
+ class: "",
49
+ classHeader: "",
50
+ classInput: "",
51
+ // ----------------------------------------------------------------------------
52
+ // 状態
53
+ focus: false,
54
+ focusColor: "shadow-[inset_0px_0px_1px_2px_#0d8ee4]",
55
+ change: false,
56
+ changeColor: "shadow-[inset_0px_0px_1px_2px_#fd9831be]",
57
+ error: false,
58
+ errorColor: "shadow-[inset_0px_0px_1px_2px_#d80000dc]",
59
+ disabled: false,
60
+ disabledColor: "",
61
+ readonly: false,
62
+ // ----------------------------------------------------------------------------
63
+ // 表示
64
+ label: "",
65
+ // 表示-副情報
66
+ require: false,
67
+ requireText: "必須",
68
+ warn: "",
69
+ warnTimeOut: 300,
70
+ // ----------------------------------------------------------------------------
71
+ // 設定
72
+ size: "m",
73
+ });
74
+
75
+ type Emits = {
76
+ // ----------------------------
77
+ "header-label-click": [];
78
+ // ----------------------------
79
+ };
80
+ const emit = defineEmits<Emits>();
81
+ // ----------------------------------------------------------------------------
82
+
83
+ const toast = useHsToast();
84
+
85
+ // ----------------------------------------------------------------------------
86
+ const baseClass = computed(() => {
87
+ return [
88
+ twMerge(
89
+ //
90
+ "flex max-w-full",
91
+ "border-[1px] border-main0",
92
+ "bg-white",
93
+ props.size === "s" ? "h-[44px]" : "",
94
+ props.size === "m" ? "h-[48px]" : "",
95
+ props.size === "l" ? "h-[60px]" : "",
96
+ props.change ? props.changeColor : "",
97
+ props.error ? props.errorColor : "",
98
+ props.warn ? props.errorColor : "",
99
+ props.focus ? props.focusColor : "",
100
+ props.disabled ? "shadow-none bg-slate-300" : "",
101
+ props.disabled ? props.disabledColor : "",
102
+ props.readonly ? "shadow-none bg-transparent " : "",
103
+ ClassTypeToString(props.class)
104
+ ),
105
+ props.disabled ? "disabled " : "",
106
+ props.readonly ? "readonly " : "",
107
+ ];
108
+ });
109
+
110
+ const headerClass = computed(() => {
111
+ return [
112
+ twMerge(
113
+ //
114
+ "px-1",
115
+ "overflow-hidden",
116
+ "text-[#996655]",
117
+ props.size === "s" ? "h-[18px] text-[12px]" : "",
118
+ props.size === "m" ? "h-[20px] text-[14px]" : "",
119
+ props.size === "l" ? "h-[22px] text-[15px]" : "",
120
+ ClassTypeToString(props.classHeader)
121
+ ),
122
+ ];
123
+ });
124
+
125
+ const headerIconClass = computed(() => {
126
+ return [
127
+ twMerge(
128
+ //
129
+ props.size === "s"
130
+ ? "text-[12px] rounded leading-[12px] px-[2px] py-[2px]"
131
+ : "",
132
+ props.size === "m"
133
+ ? "text-[13px] rounded leading-[13px] px-[2px] py-[2px]"
134
+ : "",
135
+ props.size === "l"
136
+ ? "text-[14px] rounded leading-[14px] px-[2px] py-[3px]"
137
+ : ""
138
+ ),
139
+ ];
140
+ });
141
+
142
+ const inputClass = computed(() => {
143
+ return [
144
+ twMerge(
145
+ "px-1",
146
+ "truncate",
147
+ //
148
+ "w-full",
149
+ // 'max-w-full max-h-full w-full',
150
+ props.size === "s" ? "text-[14px]" : "",
151
+ props.size === "m" ? "text-[16px]" : "",
152
+ props.size === "l" ? "text-[20px]" : "",
153
+ ClassTypeToString(props.classInput)
154
+ ),
155
+ ];
156
+ });
157
+ // ----------------------------------------------------------------------------
158
+ const iconDisabled = computed(() => {
159
+ if (props.disabled) return true;
160
+ if (props.readonly) return true;
161
+ return false;
162
+ });
163
+ // ----------------------------------------------------------------------------
164
+ const slots = useSlots();
165
+ const hasHeader = computed(() => {
166
+ if (props.label.length !== 0) return true;
167
+ if (props.require) return true;
168
+ if (props.readonly) return true;
169
+ // if (slots.label) return true;
170
+ if (slots["label-prepend"]) return true;
171
+ if (slots["label-append"]) return true;
172
+ if (slots["header-right"]) return true;
173
+ return false;
174
+ });
175
+ // ----------------------------------------------------------------------------
176
+ </script>
177
+
178
+ <template>
179
+ <div ref="el" class="hc-ui-input-frame" :class="baseClass">
180
+ <div
181
+ v-if="$slots['left-icons']"
182
+ class="icons left-icons flex-none"
183
+ :class="iconDisabled ? 'disabled' : ''"
184
+ >
185
+ <slot name="left-icons" :disabled="iconDisabled" />
186
+ </div>
187
+ <div class="flex-1 flex flex-col overflow-hidden justify-start">
188
+ <div
189
+ v-if="hasHeader"
190
+ class="flex-none flex items-end"
191
+ :class="headerClass"
192
+ >
193
+ <div
194
+ class="grow-0 shrink-1 truncate leading-[1.5em]"
195
+ :title="props.label"
196
+ @click.stop="emit('header-label-click')"
197
+ >
198
+ <slot name="label-prepend" />{{ props.label
199
+ }}<slot name="label-append" />
200
+ </div>
201
+ <div class="flex-1"></div>
202
+ <div class="flex-none flex gap-2">
203
+ <slot name="header-right" :default-class="headerIconClass" />
204
+ <!-- <div v-if="props.readonly" :class="headerIconClass" class="text-dark">
205
+ <span data-type="readonly">readonly</span>
206
+ </div> -->
207
+ <div
208
+ v-if="props.require && !props.readonly"
209
+ :class="headerIconClass"
210
+ class="text-white bg-error"
211
+ >
212
+ <span data-type="require">{{ props.requireText }}</span>
213
+ </div>
214
+ </div>
215
+ </div>
216
+ <div class="flex-1 flex flex-col justify-center">
217
+ <div :class="inputClass"><slot /></div>
218
+ </div>
219
+ </div>
220
+ <div
221
+ v-if="$slots['right-icons'] || props.warn"
222
+ class="icons right-icons flex-none"
223
+ :class="iconDisabled ? 'disabled' : ''"
224
+ >
225
+ <slot name="right-icons" :disabled="iconDisabled" />
226
+ <div
227
+ v-if="props.warn"
228
+ @click="toast.Warning(props.warn, '', props.warnTimeOut)"
229
+ >
230
+ <i
231
+ class="fa-solid fa-triangle-exclamation text-error cursor-pointer"
232
+ ></i>
233
+ </div>
234
+ </div>
235
+ <slot name="overlay"></slot>
236
+ </div>
237
+ </template>
238
+
239
+ <style scoped>
240
+ .icons {
241
+ display: flex;
242
+ }
243
+ .icons > * {
244
+ height: 100%;
245
+ min-width: 2em;
246
+ display: flex;
247
+ justify-content: center;
248
+ align-items: center;
249
+ color: theme("colors.accent1");
250
+ }
251
+ .icons > *::after {
252
+ content: "";
253
+ width: 1px;
254
+ position: absolute;
255
+ background-color: theme("colors.main0");
256
+ }
257
+ .icons.disabled > * {
258
+ color: theme("colors.dark");
259
+ }
260
+
261
+ .left-icons > *::after {
262
+ inset: 2px 0 2px auto;
263
+ }
264
+
265
+ .right-icons > *::after {
266
+ inset: 2px auto 2px 0;
267
+ }
268
+
269
+ .hc-ui-input-frame {
270
+ min-width: 100px;
271
+ }
272
+ </style>