@digitalwalletcorp/vue-core 1.2.0 → 1.3.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 (188) hide show
  1. package/README.md +95 -8
  2. package/lib/accordion-fieldset.d.cts +14 -4
  3. package/lib/accordion-fieldset.d.ts +14 -4
  4. package/lib/accordion-section.d.cts +20 -10
  5. package/lib/accordion-section.d.ts +20 -10
  6. package/lib/components-2zQ2SZuY.js +26 -0
  7. package/lib/components-HaiHcseF.cjs +1 -0
  8. package/lib/components.d.cts +10 -0
  9. package/lib/components.d.ts +10 -0
  10. package/lib/copy-button.d.cts +34 -0
  11. package/lib/copy-button.d.ts +34 -0
  12. package/lib/dark-mode-selector.d.cts +32 -0
  13. package/lib/dark-mode-selector.d.ts +32 -0
  14. package/lib/data-table.d.cts +30 -0
  15. package/lib/data-table.d.ts +30 -0
  16. package/lib/help-button.d.cts +39 -0
  17. package/lib/help-button.d.ts +39 -0
  18. package/lib/help-popper.d.cts +39 -0
  19. package/lib/help-popper.d.ts +39 -0
  20. package/lib/helpers/data-table-csv.d.cts +17 -0
  21. package/lib/helpers/data-table-csv.d.ts +17 -0
  22. package/lib/helpers/show-floating-component.d.cts +82 -0
  23. package/lib/helpers/show-floating-component.d.ts +82 -0
  24. package/lib/helpers/show-modal-dialog.d.cts +73 -0
  25. package/lib/helpers/show-modal-dialog.d.ts +73 -0
  26. package/lib/helpers/show-overlay-box.d.cts +53 -0
  27. package/lib/helpers/show-overlay-box.d.ts +53 -0
  28. package/lib/helpers/show-screen-loading.d.cts +20 -0
  29. package/lib/helpers/show-screen-loading.d.ts +20 -0
  30. package/lib/helpers/show-snackbar.d.cts +47 -0
  31. package/lib/helpers/show-snackbar.d.ts +47 -0
  32. package/lib/hourglass-loading.d.cts +1 -1
  33. package/lib/hourglass-loading.d.ts +1 -1
  34. package/lib/index.cjs +1 -1
  35. package/lib/index.d.cts +34 -0
  36. package/lib/index.d.ts +34 -0
  37. package/lib/index.js +445 -18
  38. package/lib/internal/anchored-popover.d.cts +35 -0
  39. package/lib/internal/anchored-popover.d.ts +35 -0
  40. package/lib/internal/anchored-position.d.cts +50 -0
  41. package/lib/internal/anchored-position.d.ts +50 -0
  42. package/lib/internal/data-table-controls.d.cts +42 -0
  43. package/lib/internal/data-table-controls.d.ts +42 -0
  44. package/lib/internal/data-table-value.d.cts +32 -0
  45. package/lib/internal/data-table-value.d.ts +32 -0
  46. package/lib/internal/floating-component.d.cts +52 -0
  47. package/lib/internal/floating-component.d.ts +52 -0
  48. package/lib/internal/icon-popper.d.cts +32 -0
  49. package/lib/internal/icon-popper.d.ts +32 -0
  50. package/lib/internal/mount-window.d.cts +39 -0
  51. package/lib/internal/mount-window.d.ts +39 -0
  52. package/lib/internal/movable-window.d.cts +55 -0
  53. package/lib/internal/movable-window.d.ts +55 -0
  54. package/lib/internal/opened-overlay-boxes.d.cts +2 -0
  55. package/lib/internal/opened-overlay-boxes.d.ts +2 -0
  56. package/lib/internal/pagination.d.cts +22 -0
  57. package/lib/internal/pagination.d.ts +22 -0
  58. package/lib/internal/snackbar-container.d.cts +20 -0
  59. package/lib/internal/snackbar-container.d.ts +20 -0
  60. package/lib/internal/snackbar-item.d.cts +17 -0
  61. package/lib/internal/snackbar-item.d.ts +17 -0
  62. package/lib/internal/tab-group-context.d.cts +4 -2
  63. package/lib/internal/tab-group-context.d.ts +4 -2
  64. package/lib/internal/use-movable-window.d.cts +44 -0
  65. package/lib/internal/use-movable-window.d.ts +44 -0
  66. package/lib/internal/window-order.d.cts +6 -0
  67. package/lib/internal/window-order.d.ts +6 -0
  68. package/lib/intersection-lazy-component.d.cts +32 -0
  69. package/lib/intersection-lazy-component.d.ts +32 -0
  70. package/lib/label-button.d.cts +2 -2
  71. package/lib/label-button.d.ts +2 -2
  72. package/lib/label-icon.d.cts +2 -2
  73. package/lib/label-icon.d.ts +2 -2
  74. package/lib/modal-dialog.d.cts +67 -0
  75. package/lib/modal-dialog.d.ts +67 -0
  76. package/lib/nuxt.cjs +1 -1
  77. package/lib/nuxt.js +1 -1
  78. package/lib/overlay-box.d.cts +52 -0
  79. package/lib/overlay-box.d.ts +52 -0
  80. package/lib/page-section.d.cts +2 -2
  81. package/lib/page-section.d.ts +2 -2
  82. package/lib/page-title.d.cts +2 -2
  83. package/lib/page-title.d.ts +2 -2
  84. package/lib/register.cjs +1 -1
  85. package/lib/register.js +1 -1
  86. package/lib/screen-loading.d.cts +7 -0
  87. package/lib/screen-loading.d.ts +7 -0
  88. package/lib/style.css +1 -1
  89. package/lib/tab-content.d.cts +5 -5
  90. package/lib/tab-content.d.ts +5 -5
  91. package/lib/tab-group.d.cts +7 -10
  92. package/lib/tab-group.d.ts +7 -10
  93. package/lib/types/data-table.d.cts +185 -0
  94. package/lib/types/data-table.d.ts +185 -0
  95. package/lib/types/modal-dialog.d.cts +13 -0
  96. package/lib/types/modal-dialog.d.ts +13 -0
  97. package/lib/types/movable-window.d.cts +16 -0
  98. package/lib/types/movable-window.d.ts +16 -0
  99. package/lib/warning-popper.d.cts +39 -0
  100. package/lib/warning-popper.d.ts +39 -0
  101. package/lib/warning-popper.vue_vue_type_style_index_0_lang-CxVzqsbn.cjs +1 -0
  102. package/lib/warning-popper.vue_vue_type_style_index_0_lang-zt-jCsvz.js +1833 -0
  103. package/package.json +43 -16
  104. package/src/accordion-fieldset.vue +29 -19
  105. package/src/accordion-section.vue +41 -26
  106. package/src/components.ts +10 -0
  107. package/src/copy-button.vue +89 -0
  108. package/src/dark-mode-selector.vue +212 -0
  109. package/src/data-table.vue +643 -0
  110. package/src/help-button.vue +128 -0
  111. package/src/help-popper.vue +70 -0
  112. package/src/helpers/data-table-csv.ts +55 -0
  113. package/src/helpers/show-floating-component.ts +169 -0
  114. package/src/helpers/show-modal-dialog.ts +121 -0
  115. package/src/helpers/show-overlay-box.ts +106 -0
  116. package/src/helpers/show-screen-loading.ts +37 -0
  117. package/src/helpers/show-snackbar.ts +153 -0
  118. package/src/hourglass-loading.vue +1 -1
  119. package/src/index.ts +34 -0
  120. package/src/internal/anchored-popover.vue +192 -0
  121. package/src/internal/anchored-position.ts +135 -0
  122. package/src/internal/data-table-controls.vue +203 -0
  123. package/src/internal/data-table-value.ts +99 -0
  124. package/src/internal/floating-component.vue +202 -0
  125. package/src/internal/icon-popper.vue +185 -0
  126. package/src/internal/mount-window.ts +110 -0
  127. package/src/internal/movable-window.vue +315 -0
  128. package/src/internal/opened-overlay-boxes.ts +2 -0
  129. package/src/internal/pagination.vue +325 -0
  130. package/src/internal/snackbar-container.vue +258 -0
  131. package/src/internal/snackbar-item.ts +20 -0
  132. package/src/internal/tab-group-context.ts +4 -2
  133. package/src/internal/use-movable-window.ts +208 -0
  134. package/src/internal/window-order.ts +11 -0
  135. package/src/intersection-lazy-component.vue +84 -0
  136. package/src/label-button.vue +37 -3
  137. package/src/label-icon.vue +2 -2
  138. package/src/modal-dialog.vue +287 -0
  139. package/src/overlay-box.vue +218 -0
  140. package/src/page-section.vue +7 -7
  141. package/src/page-title.vue +5 -5
  142. package/src/screen-loading.vue +90 -0
  143. package/src/tab-content.vue +17 -16
  144. package/src/tab-group.vue +55 -46
  145. package/src/types/data-table.ts +196 -0
  146. package/src/types/modal-dialog.ts +16 -0
  147. package/src/types/movable-window.ts +18 -0
  148. package/src/warning-popper.vue +70 -0
  149. package/lib/accordion-fieldset.cjs +0 -1
  150. package/lib/accordion-fieldset.js +0 -4
  151. package/lib/accordion-fieldset.vue_vue_type_style_index_0_lang-n-IZxUiu.js +0 -66
  152. package/lib/accordion-fieldset.vue_vue_type_style_index_0_lang-t9NqmoZW.cjs +0 -1
  153. package/lib/accordion-section.cjs +0 -1
  154. package/lib/accordion-section.js +0 -4
  155. package/lib/accordion-section.vue_vue_type_style_index_0_lang-CFDdUEnn.cjs +0 -1
  156. package/lib/accordion-section.vue_vue_type_style_index_0_lang-Gvjjx02P.js +0 -78
  157. package/lib/components-CNOeuZPu.cjs +0 -1
  158. package/lib/components-DBK8NUBh.js +0 -24
  159. package/lib/hourglass-loading.cjs +0 -1
  160. package/lib/hourglass-loading.js +0 -4
  161. package/lib/hourglass-loading.vue_vue_type_style_index_0_lang-C72UVA9W.cjs +0 -1
  162. package/lib/hourglass-loading.vue_vue_type_style_index_0_lang-DkUGIxQ2.js +0 -22
  163. package/lib/label-button.cjs +0 -1
  164. package/lib/label-button.js +0 -4
  165. package/lib/label-button.vue_vue_type_script_setup_true_lang-BwVOxaJP.cjs +0 -1
  166. package/lib/label-button.vue_vue_type_script_setup_true_lang-DorC4pKz.js +0 -44
  167. package/lib/label-icon.cjs +0 -1
  168. package/lib/label-icon.js +0 -4
  169. package/lib/label-icon.vue_vue_type_style_index_0_lang-D9Cimu20.cjs +0 -1
  170. package/lib/label-icon.vue_vue_type_style_index_0_lang-me52HE2V.js +0 -38
  171. package/lib/page-section.cjs +0 -1
  172. package/lib/page-section.js +0 -4
  173. package/lib/page-section.vue_vue_type_style_index_0_lang-DEAkTLxd.cjs +0 -1
  174. package/lib/page-section.vue_vue_type_style_index_0_lang-DpVQe_rV.js +0 -54
  175. package/lib/page-title.cjs +0 -1
  176. package/lib/page-title.js +0 -4
  177. package/lib/page-title.vue_vue_type_style_index_0_lang-BqIsIks5.cjs +0 -1
  178. package/lib/page-title.vue_vue_type_style_index_0_lang-ChZot85K.js +0 -36
  179. package/lib/tab-content.cjs +0 -1
  180. package/lib/tab-content.js +0 -4
  181. package/lib/tab-content.vue_vue_type_style_index_0_lang-BeCi7Xkp.cjs +0 -1
  182. package/lib/tab-content.vue_vue_type_style_index_0_lang-CcQLHmIF.js +0 -44
  183. package/lib/tab-group.cjs +0 -1
  184. package/lib/tab-group.js +0 -4
  185. package/lib/tab-group.vue_vue_type_style_index_0_lang-C84mDEOC.js +0 -103
  186. package/lib/tab-group.vue_vue_type_style_index_0_lang-CMaufRJV.cjs +0 -1
  187. package/lib/use-shrinkable-CS2bmsJJ.js +0 -17
  188. package/lib/use-shrinkable-Cu9JQZll.cjs +0 -1
package/src/tab-group.vue CHANGED
@@ -10,28 +10,32 @@ TabContentを並べてタブで切り替える
10
10
  >
11
11
  <div
12
12
  class="dwui-tab-headers"
13
+ role="tablist"
13
14
  :class="props.headerClass"
14
15
  :style="props.headerStyle"
15
16
  >
16
17
  <template
17
18
  v-for="tab in tabs"
18
- :key="tab.labelId"
19
+ :key="tab.tabId"
19
20
  >
20
21
  <input
21
- :id="`${groupName}-${tab.labelId}`"
22
+ :id="`${groupName}-${tab.tabId}`"
22
23
  type="radio"
23
24
  class="dwui-tab-radio"
25
+ role="tab"
24
26
  :name="groupName"
25
27
  :disabled="tab.disabled"
26
- :checked="tab.labelId === activeLabelId"
27
- @change="onChangeTab(tab.labelId)"
28
+ :checked="tab.tabId === activeTabId"
29
+ :aria-selected="tab.tabId === activeTabId ? 'true' : 'false'"
30
+ :aria-controls="`${groupName}-${tab.tabId}-panel`"
31
+ @change="onChangeTab(tab.tabId)"
28
32
  >
29
33
  <label
30
- :for="`${groupName}-${tab.labelId}`"
34
+ :for="`${groupName}-${tab.tabId}`"
31
35
  class="dwui-tab-item"
32
36
  :class="[tab.status != null ? `dwui-tab-${tab.status}` : undefined, tab.headerClass]"
33
37
  :style="tab.headerStyle"
34
- :data-test-tab-content-control="tab.labelId"
38
+ :data-test-tab-content-control="tab.tabId"
35
39
  >
36
40
  <LabelIcon>
37
41
  <template
@@ -40,7 +44,7 @@ TabContentを並べてタブで切り替える
40
44
  >
41
45
  <component :is="tab.icon" />
42
46
  </template>
43
- {{ tab.description }}
47
+ {{ tab.label }}
44
48
  </LabelIcon>
45
49
  </label>
46
50
  </template>
@@ -60,10 +64,10 @@ import TabContent from '@/tab-content.vue';
60
64
  import { tabGroupContextKey } from '@/internal/tab-group-context';
61
65
  import type { TabContentStatus } from '@/internal/tab-group-context';
62
66
 
63
- interface Props {
67
+ export interface Props {
64
68
  /** ラジオボタンのname。未指定なら自動で採番する */
65
69
  tabGroupName?: string;
66
- /** selectedTabLabelIdが未指定のとき、trueならdisabledでない最初のタブを選ぶ。falseなら先頭のタブ(disabledなら中身は空になる) */
70
+ /** selectedTabIdが未指定のとき、trueならdisabledでない最初のタブを選ぶ。falseなら先頭のタブ(disabledなら中身は空になる) */
67
71
  selectFirstEnabled?: boolean;
68
72
  /** タブの見出しを並べる部分に付けるclass */
69
73
  headerClass?: ClassValue;
@@ -74,18 +78,13 @@ interface Props {
74
78
  }
75
79
  const props = defineProps<Props>();
76
80
 
77
- interface Emits {
78
- (e: 'emit:changeSelectedTab', labelId: string): void;
79
- }
80
- const emit = defineEmits<Emits>();
81
-
82
81
  /**
83
82
  * 選択するタブのlabelId。未指定なら先頭のタブ
84
- * 親がいつ代入しても選び直せるよう、v-model:selected-tab-label-idで同期する前提とする
83
+ * 親がいつ代入しても選び直せるよう、v-model:selected-tab-idで同期する前提とする
85
84
  */
86
- const selectedLabelId = defineModel<string>('selectedTabLabelId');
85
+ const selectedTabId = defineModel<string>('selectedTabId');
87
86
 
88
- interface Slots {
87
+ export interface Slots {
89
88
  default?(): VNode[];
90
89
  /** 読み込み中のTabContentに重ねて表示する内容。未指定なら既定の読み込み中表示 */
91
90
  loading?(): VNode[];
@@ -94,8 +93,8 @@ const slots = defineSlots<Slots>();
94
93
 
95
94
  /** タブの見出しの描画に使う、TabContentの指定 */
96
95
  interface TabHeader {
97
- labelId: string;
98
- description: string;
96
+ tabId: string;
97
+ label: string;
99
98
  disabled: boolean;
100
99
  status?: TabContentStatus;
101
100
  headerClass?: ClassValue;
@@ -107,7 +106,7 @@ const groupName = props.tabGroupName ?? useId();
107
106
 
108
107
  /**
109
108
  * TabContentのVNodeから見出しの指定を取り出す
110
- * propsのキーはテンプレートの書き方(label-id / labelId)のまま入っているため、両方を見る
109
+ * propsのキーはテンプレートの書き方(tab-id / tabId)のまま入っているため、両方を見る
111
110
  *
112
111
  * @param {VNode} vnode
113
112
  * @returns {TabHeader | undefined}
@@ -120,8 +119,8 @@ const toTabHeader = (vnode: VNode): TabHeader | undefined => {
120
119
  const vnodeProps = vnode.props ?? {};
121
120
  const disabled = vnodeProps.disabled;
122
121
  return {
123
- labelId: String(vnodeProps['label-id'] ?? vnodeProps.labelId),
124
- description: vnodeProps.description,
122
+ tabId: String(vnodeProps['tab-id'] ?? vnodeProps.tabId),
123
+ label: vnodeProps.label,
125
124
  // 属性だけを書いた場合(<TabContent disabled>)は空文字になる
126
125
  disabled: disabled === '' || !!disabled,
127
126
  status: vnodeProps.status,
@@ -148,51 +147,56 @@ const tabs = computed((): TabHeader[] => {
148
147
  });
149
148
 
150
149
  // 選ばれるまでは先頭のタブを選択中とする。スロットは描画中に読む必要があるため、setupの時点では先頭を確定しない
151
- const activeLabelId = computed((): string | undefined => {
152
- if (selectedLabelId.value != null) {
153
- return selectedLabelId.value;
150
+ const activeTabId = computed((): string | undefined => {
151
+ if (selectedTabId.value != null) {
152
+ return selectedTabId.value;
154
153
  }
155
154
  const first = props.selectFirstEnabled ? tabs.value.find(tab => !tab.disabled) : tabs.value[0];
156
- return first?.labelId;
155
+ return first?.tabId;
157
156
  });
158
157
  // タブの中身はactivatedを契機にAPIを呼ぶため、親の画面のonMountedで検索条件が整う前に通知しないよう、マウント後に通知を始める
159
158
  const mounted = ref(false);
160
- provide(tabGroupContextKey, { activeLabelId, mounted, loadingSlot: () => slots.loading });
159
+ provide(tabGroupContextKey, { groupName, activeTabId, mounted, loadingSlot: () => slots.loading });
161
160
 
162
161
  onMounted(() => {
163
162
  mounted.value = true;
164
163
  });
165
164
 
166
- const onChangeTab = (labelId: string) => {
167
- selectedLabelId.value = labelId;
168
- emit('emit:changeSelectedTab', labelId);
165
+ const onChangeTab = (tabId: string) => {
166
+ selectedTabId.value = tabId;
169
167
  };
170
168
  </script>
171
169
 
172
170
  <style>
173
171
  :where(.dwui-tab-group) {
174
- margin-bottom: 8px;
172
+ margin-bottom: 0.67em;
175
173
  }
176
174
 
177
175
  :where(.dwui-tab-headers) {
178
176
  display: flex;
179
177
  flex-direction: row;
180
178
  flex-wrap: wrap;
181
- margin-top: 5px;
182
- padding-bottom: 4px;
179
+ position: relative;
180
+ margin-top: 0.4em;
181
+ padding-bottom: 0.33em;
183
182
  }
184
183
 
185
184
  :where(.dwui-tab-radio) {
186
- display: none;
185
+ position: absolute;
186
+ width: 1px;
187
+ height: 1px;
188
+ margin: 0;
189
+ opacity: 0;
190
+ pointer-events: none;
187
191
  }
188
192
 
189
193
  :where(.dwui-tab-item) {
190
194
  display: block;
191
195
  min-width: 100px;
192
- padding: 0 4px;
193
- border: 1px solid var(--dwui-border-color-tab, #565656);
196
+ padding: 0 0.33em;
197
+ border: 1px solid var(--dwui-border-color-tab, light-dark(#565656, #8a8a8a));
194
198
  border-bottom: 1px solid var(--dwui-border-color-tab-header-accent, #5ab4bd);
195
- background: var(--dwui-background-tab-header, linear-gradient(#1313c7, navy));
199
+ background: var(--dwui-background-tab-header, linear-gradient(light-dark(#1313c7, #2a3a8f), light-dark(navy, #141c4d)));
196
200
  line-height: 2em;
197
201
  text-align: center;
198
202
  white-space: nowrap;
@@ -203,43 +207,48 @@ const onChangeTab = (labelId: string) => {
203
207
  }
204
208
 
205
209
  :where(.dwui-tab-radio:checked + .dwui-tab-item) {
206
- background: var(--dwui-background-tab-header-selected, linear-gradient(#1313c7, rgb(149, 149, 234), #1313c7));
210
+ background: var(--dwui-background-tab-header-selected, linear-gradient(light-dark(#1313c7, #2a3a8f), light-dark(rgb(149, 149, 234), #5a62b8), light-dark(#1313c7, #2a3a8f)));
207
211
  color: var(--dwui-color-text-tab-header-selected, azure);
208
212
  /* 選択済みのタブは操作の対象ではないためカーソルを既定にする */
209
213
  cursor: default;
210
214
  }
211
215
 
212
216
  :where(.dwui-tab-radio:disabled + .dwui-tab-item) {
213
- background: var(--dwui-background-tab-header-disabled, gray);
217
+ background: var(--dwui-background-tab-header-disabled, light-dark(gray, #4a4a4a));
214
218
  cursor: not-allowed;
215
219
  }
216
220
 
217
221
  :where(.dwui-tab-item.dwui-tab-warn) {
218
- background: var(--dwui-background-tab-header-warn, #efef13);
219
- color: var(--dwui-color-text-tab-header-warn, midnightblue);
222
+ background: var(--dwui-background-tab-header-warn, light-dark(#efef13, #8a8a10));
223
+ color: var(--dwui-color-text-tab-header-warn, light-dark(midnightblue, #fffbd0));
220
224
  }
221
225
 
222
226
  :where(.dwui-tab-radio:checked + .dwui-tab-item.dwui-tab-warn) {
223
- background: var(--dwui-background-tab-header-warn-selected, linear-gradient(#fafa06, rgb(232, 238, 206), #fafa06));
227
+ background: var(--dwui-background-tab-header-warn-selected, linear-gradient(light-dark(#fafa06, #8a8a10), light-dark(rgb(232, 238, 206), #a8a860), light-dark(#fafa06, #8a8a10)));
224
228
  }
225
229
 
226
230
  :where(.dwui-tab-item.dwui-tab-error) {
227
- background: var(--dwui-background-tab-header-error, red);
231
+ background: var(--dwui-background-tab-header-error, light-dark(red, #a01818));
228
232
  color: var(--dwui-color-text-tab-header-error, azure);
229
233
  }
230
234
 
231
235
  :where(.dwui-tab-radio:checked + .dwui-tab-item.dwui-tab-error) {
232
- background: var(--dwui-background-tab-header-error-selected, linear-gradient(#ff0000, rgb(240, 136, 136), #ff0000));
236
+ background: var(--dwui-background-tab-header-error-selected, linear-gradient(light-dark(#ff0000, #a01818), light-dark(rgb(240, 136, 136), #c86060), light-dark(#ff0000, #a01818)));
233
237
  }
234
238
 
235
239
  :where(.dwui-tab-radio:not(:checked) + .dwui-tab-item:hover) {
236
240
  /* 背景の上に半透明の白を重ね、枠線と文字はそのままで背景だけを明るくする */
237
- box-shadow: inset 0 0 0 999px var(--dwui-overlay-color-tab-header-hover, rgba(255, 255, 255, 0.35));
241
+ box-shadow: inset 0 0 0 999px var(--dwui-overlay-color-tab-header-hover, light-dark(rgba(255, 255, 255, 0.35), rgba(255, 255, 255, 0.15)));
242
+ }
243
+
244
+ :where(.dwui-tab-radio:focus-visible + .dwui-tab-item) {
245
+ outline: var(--dwui-outline-width-focus-ring, 2px) solid var(--dwui-outline-color-focus-ring, Highlight);
246
+ outline-offset: var(--dwui-outline-offset-focus-ring, 2px);
238
247
  }
239
248
 
240
249
  :where(.dwui-tab-items) {
241
250
  height: 100%;
242
- border: 1px solid var(--dwui-border-color-tab, #565656);
251
+ border: 1px solid var(--dwui-border-color-tab, light-dark(#565656, #8a8a8a));
243
252
  /* 中身を切り替えたときのスライドを枠内に収める */
244
253
  overflow: hidden;
245
254
  }
@@ -0,0 +1,196 @@
1
+ import type { ClassValue, StyleValue } from 'vue';
2
+
3
+ /** 列の値の型。ソートの比較方法を決める */
4
+ export type DataTableValueType = 'boolean' | 'string' | 'number' | 'object';
5
+
6
+ /** ソートの方式。page は表示中の行を並べ替えて返し、remote はソート条件を通知するだけで利用側が再取得する */
7
+ export type DataTableSortMode = 'page' | 'remote';
8
+
9
+ /** コントロール(ページネーション・総件数・表示件数・ダウンロードボタン)を出す位置 */
10
+ export type DataTableControlsPlacement = 'both' | 'top' | 'bottom' | 'none';
11
+
12
+ /**
13
+ * CSV に出力する列の定義
14
+ */
15
+ export interface DataTableCsvColumn<T = unknown> {
16
+ /** true なら出力しない */
17
+ disabled?: boolean;
18
+ /** 値を取り出すキー。ドット区切りで入れ子を辿る。未指定なら DataTableHeader.id。'$index' は行番号 */
19
+ key?: string;
20
+ /** 列名。未指定なら DataTableHeader.label。言語切替に追従させる場合は関数で渡す */
21
+ label?: string | (() => string);
22
+ /** 値の整形。指定したときは key を使わない */
23
+ format?: (row: T) => unknown;
24
+ }
25
+
26
+ /**
27
+ * ヘッダの定義
28
+ */
29
+ export interface DataTableHeader<T = unknown> {
30
+ /** 列を識別するキー。ソートで値を取り出すキーにもなる */
31
+ id: string;
32
+ /** 見出し。言語切替に追従させる場合は関数で渡す */
33
+ label: string | (() => string);
34
+ /** true なら label を HTML として描画する */
35
+ html?: boolean;
36
+ /** ソートで値を取り出すキー。id と違うキーで並べるときに指定する。ドット区切りで入れ子を辿る */
37
+ sortKey?: string;
38
+ /** 値の型。ソートの比較方法を決める。未指定なら string */
39
+ type?: DataTableValueType;
40
+ /** 行同士を比較する関数。指定したときは sortKey と type を使わない。昇順の並びで a が前なら負の数を返す */
41
+ compare?: (a: T, b: T) => number;
42
+ /** 列の幅。数値は px */
43
+ width?: string | number;
44
+ /** 列の最小幅。数値は px */
45
+ minWidth?: string | number;
46
+ /** 列の最大幅。数値は px */
47
+ maxWidth?: string | number;
48
+ /** th の rowspan */
49
+ rowspan?: string | number;
50
+ /** th の colspan */
51
+ colspan?: string | number;
52
+ /** th の title 属性 */
53
+ title?: string;
54
+ /** CSV の出力定義。true なら id の値を label の列名で出力する。未指定なら出力しない */
55
+ csv?: boolean | DataTableCsvColumn<T>[];
56
+ }
57
+
58
+ /**
59
+ * 表示する文言。言語切替に追従させる場合は関数で渡す
60
+ */
61
+ export interface DataTableLabels {
62
+ /** 総件数の見出し */
63
+ totalCount?: string | (() => string);
64
+ /** 総件数の後ろに付ける単位 */
65
+ totalUnit?: string | (() => string);
66
+ /** 1ページあたりの表示件数の見出し */
67
+ limit?: string | (() => string);
68
+ /** データが無いときの表示 */
69
+ noData?: string | (() => string);
70
+ /** ページ番号の選択の見出し。showPageSelect のときに表示する */
71
+ pageNumber?: string | (() => string);
72
+ /** ページダウンロードボタンの title */
73
+ downloadPage?: string | (() => string);
74
+ /** 全件ダウンロードボタンの title */
75
+ downloadAll?: string | (() => string);
76
+ /** 先頭ページへ移動するボタンの読み上げ名 */
77
+ firstPage?: string | (() => string);
78
+ /** 前のページへ移動するボタンの読み上げ名 */
79
+ previousPage?: string | (() => string);
80
+ /** 前のページ番号の組へ移動するボタンの読み上げ名 */
81
+ previousPages?: string | (() => string);
82
+ /** 次のページ番号の組へ移動するボタンの読み上げ名 */
83
+ nextPages?: string | (() => string);
84
+ /** 次のページへ移動するボタンの読み上げ名 */
85
+ nextPage?: string | (() => string);
86
+ /** 末尾ページへ移動するボタンの読み上げ名 */
87
+ lastPage?: string | (() => string);
88
+ }
89
+
90
+ /** 関数を評価した後の文言 */
91
+ export type DataTableResolvedLabels = Record<keyof DataTableLabels, string>;
92
+
93
+ /**
94
+ * DataTable の props
95
+ */
96
+ export interface DataTableProps<T = unknown> {
97
+ /** 表示している行のデータ。スロットで描画する行と同じ順に並んでいること */
98
+ dataList: T[];
99
+ /** ヘッダ。id は一意であること */
100
+ headers: DataTableHeader<T>[];
101
+ /** 読み込み中。true の間は行を描画せず読み込み中の表示を出す */
102
+ loading?: boolean;
103
+ /** 総件数。未指定なら dataList の件数 */
104
+ totalCount?: number;
105
+ /** 現在ページ(1起点) */
106
+ current?: number;
107
+ /** 1ページあたりの表示件数 */
108
+ limit?: number;
109
+ /** 1ページあたりの表示件数の上限 */
110
+ maxLimit?: number;
111
+ /** ページネーションに並べるページ番号の最大数 */
112
+ maxPagination?: number;
113
+ /** 行をクリックで選択できるか */
114
+ selectable?: boolean;
115
+ /** コントロールを出す位置 */
116
+ controls?: DataTableControlsPlacement;
117
+ /** ページネーションを出す位置。controls が無い側には出ない */
118
+ pagination?: DataTableControlsPlacement;
119
+ /** ページダウンロードボタンを表示するか */
120
+ showDownloadPage?: boolean;
121
+ /** 全件ダウンロードボタンを表示するか */
122
+ showDownloadAll?: boolean;
123
+ /** 総件数を表示するか */
124
+ showTotal?: boolean;
125
+ /** 1ページあたりの表示件数の入力を表示するか */
126
+ showLimit?: boolean;
127
+ /** ページネーションにページ番号の選択を表示するか */
128
+ showPageSelect?: boolean;
129
+ /** dataList が空のときにデータが無い旨の行を表示するか */
130
+ showNoData?: boolean;
131
+ /** ヘッダの境界のドラッグで列幅を変えられるか */
132
+ resizable?: boolean;
133
+ /** ヘッダのクリックでソートできるか */
134
+ sortable?: boolean;
135
+ /** ソートの方式。未指定なら remote */
136
+ sortMode?: DataTableSortMode;
137
+ /** テーブルをスクロールする領域に付ける class */
138
+ contentClass?: ClassValue;
139
+ /** テーブルをスクロールする領域に付ける style */
140
+ contentStyle?: StyleValue;
141
+ /** table に付ける class */
142
+ tableClass?: ClassValue;
143
+ /** table に付ける style */
144
+ tableStyle?: StyleValue;
145
+ /** 表示する文言。未指定の項目は英語 */
146
+ labels?: DataTableLabels;
147
+ /** 総件数の整形。未指定なら en-US の桁区切り。SSR とクライアントで同じ文字列を返すこと */
148
+ formatTotalCount?: (count: number) => string;
149
+ }
150
+
151
+ /**
152
+ * DataTable が発行するイベント
153
+ */
154
+ export interface DataTableEmits<T = unknown> {
155
+ /** 選択が変わった。クリックでの選択・解除、カーソルキーでの移動、読み込み完了時の解除で発行する。解除は undefined と -1 */
156
+ (e: 'emit:selectRow', value: T | undefined, index: number): void;
157
+ /** ソートの条件が変わった。sortMode に関わらず発行する */
158
+ (e: 'emit:changeSort', context: DataTableSortContext): void;
159
+ /** sortMode が page のとき、表示中の行を並べ替えた配列を発行する */
160
+ (e: 'emit:sortData', dataList: T[]): void;
161
+ (e: 'emit:updateHeader', headers: DataTableHeader<T>[]): void;
162
+ (e: 'emit:dblclickRow', value: T, index: number): void;
163
+ (e: 'emit:changeLimit', limit: number): void;
164
+ (e: 'emit:changePage', page: number): void;
165
+ (e: 'emit:downloadPage'): void;
166
+ (e: 'emit:downloadAll'): void;
167
+ }
168
+
169
+ /**
170
+ * DataTable のスロット
171
+ */
172
+ export interface DataTableSlots<T = unknown> {
173
+ /** 行。tr を dataList と同じ順に並べ、tr の click で clickRow(row, index) を呼ぶ */
174
+ default?(props: {
175
+ /** 行を選択する。選択している行なら選択を解除する */
176
+ clickRow: (row: T, index: number) => void;
177
+ /** 行を選択してダブルクリックを通知する */
178
+ dblclickRow: (row: T, index: number) => void;
179
+ /** 行のインデックスから、ページをまたいだ1起点の行番号を返す */
180
+ rowNumber: (index: number) => number;
181
+ /** 選択している行のインデックス。選択していなければ -1 */
182
+ selectedIndex: number;
183
+ }): unknown;
184
+ /** 読み込み中の表示。未指定なら既定のスピナー */
185
+ loading?(): unknown;
186
+ }
187
+
188
+ /**
189
+ * ソートの状態
190
+ */
191
+ export interface DataTableSortContext {
192
+ /** ソートしているヘッダの id。ソートしていなければ空文字 */
193
+ sortKey: string;
194
+ /** 降順なら true */
195
+ descending: boolean;
196
+ }
@@ -0,0 +1,16 @@
1
+ /** モーダルダイアログの種類 */
2
+ export type ModalDialogType = 'info' | 'confirm' | 'warn' | 'error';
3
+
4
+ /** モーダルダイアログに並べるボタンの種類 */
5
+ export type ModalDialogButton = 'ok' | 'yes' | 'no' | 'cancel';
6
+
7
+ /** モーダルダイアログを閉じたボタン。Esc で閉じたときは cancel */
8
+ export type ModalDialogResult = ModalDialogButton;
9
+
10
+ /** モーダルダイアログに表示する画像。文字列は画像の URL */
11
+ export type ModalDialogImage = string | {
12
+ /** 画像の URL */
13
+ src: string;
14
+ /** 代替テキスト */
15
+ alt: string;
16
+ };
@@ -0,0 +1,18 @@
1
+ /** ドラッグで移動するときに掴む範囲。body はウィンドウ全体、header は見出しだけ */
2
+ export type MovableWindowDragMode = 'body' | 'header';
3
+
4
+ /** showOverlayBox / showFloatingComponent が中身のコンポーネントに props として渡す関数 */
5
+ export interface MovableWindowContentProps {
6
+ /** ウィンドウを閉じる */
7
+ close: () => void;
8
+ /** ウィンドウのローディング表示を切り替える */
9
+ setLoading: (loading: boolean) => void;
10
+ }
11
+
12
+ /** showOverlayBox / showFloatingComponent が返す、表示中のウィンドウを操作するためのハンドル */
13
+ export interface MovableWindowHandle {
14
+ /** ウィンドウを閉じ、閉じ終わったら取り外す */
15
+ close: () => void;
16
+ /** ウィンドウのローディング表示を切り替える */
17
+ setLoading: (loading: boolean) => void;
18
+ }
@@ -0,0 +1,70 @@
1
+ <!--
2
+ 警告ポップアップ
3
+ アイコンにマウスを載せている、またはフォーカスしている間だけ警告文を表示する。
4
+ -->
5
+ <template>
6
+ <IconPopper
7
+ class="dwui-warning-popper"
8
+ popover-class="dwui-warning-popper-popover"
9
+ :placement="props.placement"
10
+ :arrow="props.arrow"
11
+ :label="props.label"
12
+ @emit:open="emit('emit:open')"
13
+ @emit:close="emit('emit:close')"
14
+ >
15
+ <template #icon>
16
+ <slot name="icon">
17
+ <SvgWarningSign />
18
+ </slot>
19
+ </template>
20
+ <slot />
21
+ </IconPopper>
22
+ </template>
23
+
24
+ <script setup lang="ts">
25
+ import { SvgWarningSign } from '@digitalwalletcorp/vue-svg-icons';
26
+ import IconPopper from '@/internal/icon-popper.vue';
27
+ import type { PopoverPlacement } from '@/internal/anchored-position';
28
+
29
+ export interface Props {
30
+ /** アイコンに対するパネルの表示位置。収まらないときは反対側に出す */
31
+ placement?: PopoverPlacement;
32
+ /** アイコンを指す矢印をパネルに付ける */
33
+ arrow?: boolean;
34
+ /** アイコンの読み上げ名 */
35
+ label?: string;
36
+ }
37
+ const props = withDefaults(defineProps<Props>(), {
38
+ placement: 'right',
39
+ arrow: true,
40
+ label: 'Warning'
41
+ });
42
+
43
+ export interface Emits {
44
+ (e: 'emit:open'): void;
45
+ (e: 'emit:close'): void;
46
+ }
47
+ const emit = defineEmits<Emits>();
48
+
49
+ export interface Slots {
50
+ /** アイコン */
51
+ icon?(): unknown;
52
+ /** パネルに表示する中身 */
53
+ default?(): unknown;
54
+ }
55
+ defineSlots<Slots>();
56
+ </script>
57
+
58
+ <style>
59
+ :where(.dwui-warning-popper-popover) {
60
+ --dwui-max-width-anchored-popover: var(--dwui-max-width-warning-popper, calc(100vw - 16px));
61
+ --dwui-max-height-anchored-popover: var(--dwui-max-height-warning-popper, calc(100vh - 16px));
62
+ --dwui-padding-anchored-popover: var(--dwui-padding-warning-popper, 0.67em 1em);
63
+ --dwui-border-color-anchored-popover: var(--dwui-border-color-warning-popper, light-dark(#8f8f8f, #6b6f76));
64
+ --dwui-radius-anchored-popover: var(--dwui-radius-warning-popper, 4px);
65
+ --dwui-background-anchored-popover: var(--dwui-background-warning-popper, Canvas);
66
+ --dwui-background-anchored-popover-arrow: var(--dwui-background-warning-popper-arrow, var(--dwui-background-warning-popper, Canvas));
67
+ --dwui-color-text-anchored-popover: var(--dwui-color-text-warning-popper, CanvasText);
68
+ --dwui-box-shadow-anchored-popover: var(--dwui-box-shadow-warning-popper, 0 2px 8px rgba(0, 0, 0, 0.25));
69
+ }
70
+ </style>
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./accordion-fieldset.vue_vue_type_style_index_0_lang-t9NqmoZW.cjs");exports.default=e._sfc_main;
@@ -1,4 +0,0 @@
1
- import { _ as f } from "./accordion-fieldset.vue_vue_type_style_index_0_lang-n-IZxUiu.js";
2
- export {
3
- f as default
4
- };
@@ -1,66 +0,0 @@
1
- import { defineComponent as f, useSlots as m, ref as g, reactive as x, onMounted as _, openBlock as i, createElementBlock as k, createElementVNode as d, createVNode as C, unref as s, createBlock as b, createSlots as y, withCtx as r, renderSlot as l, createTextVNode as h, toDisplayString as w, createCommentVNode as B, normalizeClass as S } from "vue";
2
- import { SvgTriangleButton as v } from "@digitalwalletcorp/vue-svg-icons";
3
- import { _ as E } from "./label-icon.vue_vue_type_style_index_0_lang-me52HE2V.js";
4
- import { u as N } from "./use-shrinkable-CS2bmsJJ.js";
5
- const V = ["disabled"], $ = ["aria-expanded"], q = /* @__PURE__ */ f({
6
- __name: "accordion-fieldset",
7
- props: {
8
- legend: {},
9
- disabled: { type: Boolean },
10
- initialExpand: { type: Boolean }
11
- },
12
- setup(c) {
13
- const n = c, o = m(), a = g(), e = x({
14
- expanded: !0
15
- }), p = N(a), u = () => {
16
- e.expanded = !e.expanded;
17
- };
18
- return _(() => {
19
- e.expanded = !!n.initialExpand;
20
- }), (t, T) => (i(), k("fieldset", {
21
- class: "dwui-accordion-fieldset",
22
- disabled: n.disabled
23
- }, [
24
- d("legend", null, [
25
- d("button", {
26
- type: "button",
27
- class: "dwui-accordion-toggle",
28
- "aria-expanded": e.expanded,
29
- onClick: u
30
- }, [
31
- C(s(v), {
32
- direction: e.expanded ? "up" : "down"
33
- }, null, 8, ["direction"]),
34
- n.legend != null || o.legend != null || o.icon != null ? (i(), b(E, { key: 0 }, y({ _: 2 }, [
35
- o.icon != null ? {
36
- name: "icon",
37
- fn: r(() => [
38
- l(t.$slots, "icon")
39
- ]),
40
- key: "0"
41
- } : void 0,
42
- n.legend != null || o.legend != null ? {
43
- name: "default",
44
- fn: r(() => [
45
- l(t.$slots, "legend", {}, () => [
46
- h(w(n.legend), 1)
47
- ])
48
- ]),
49
- key: "1"
50
- } : void 0
51
- ]), 1024)) : B("", !0)
52
- ], 8, $)
53
- ]),
54
- d("div", {
55
- ref_key: "refContents",
56
- ref: a,
57
- class: S(["dwui-accordion-contents", s(p) ? e.expanded ? "dwui-expanded" : "dwui-shrunk" : ""])
58
- }, [
59
- l(t.$slots, "default")
60
- ], 2)
61
- ], 8, V));
62
- }
63
- });
64
- export {
65
- q as _
66
- };
@@ -1 +0,0 @@
1
- "use strict";const e=require("vue"),r=require("@digitalwalletcorp/vue-svg-icons"),c=require("./label-icon.vue_vue_type_style_index_0_lang-D9Cimu20.cjs"),u=require("./use-shrinkable-Cu9JQZll.cjs"),p=["disabled"],_=["aria-expanded"],f=e.defineComponent({__name:"accordion-fieldset",props:{legend:{},disabled:{type:Boolean},initialExpand:{type:Boolean}},setup(a){const t=a,o=e.useSlots(),l=e.ref(),n=e.reactive({expanded:!0}),i=u.useShrinkable(l),s=()=>{n.expanded=!n.expanded};return e.onMounted(()=>{n.expanded=!!t.initialExpand}),(d,g)=>(e.openBlock(),e.createElementBlock("fieldset",{class:"dwui-accordion-fieldset",disabled:t.disabled},[e.createElementVNode("legend",null,[e.createElementVNode("button",{type:"button",class:"dwui-accordion-toggle","aria-expanded":n.expanded,onClick:s},[e.createVNode(e.unref(r.SvgTriangleButton),{direction:n.expanded?"up":"down"},null,8,["direction"]),t.legend!=null||o.legend!=null||o.icon!=null?(e.openBlock(),e.createBlock(c._sfc_main,{key:0},e.createSlots({_:2},[o.icon!=null?{name:"icon",fn:e.withCtx(()=>[e.renderSlot(d.$slots,"icon")]),key:"0"}:void 0,t.legend!=null||o.legend!=null?{name:"default",fn:e.withCtx(()=>[e.renderSlot(d.$slots,"legend",{},()=>[e.createTextVNode(e.toDisplayString(t.legend),1)])]),key:"1"}:void 0]),1024)):e.createCommentVNode("",!0)],8,_)]),e.createElementVNode("div",{ref_key:"refContents",ref:l,class:e.normalizeClass(["dwui-accordion-contents",e.unref(i)?n.expanded?"dwui-expanded":"dwui-shrunk":""])},[e.renderSlot(d.$slots,"default")],2)],8,p))}});exports._sfc_main=f;
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./accordion-section.vue_vue_type_style_index_0_lang-CFDdUEnn.cjs");exports.default=e._sfc_main;
@@ -1,4 +0,0 @@
1
- import { _ as f } from "./accordion-section.vue_vue_type_style_index_0_lang-Gvjjx02P.js";
2
- export {
3
- f as default
4
- };
@@ -1 +0,0 @@
1
- "use strict";const e=require("vue"),k=require("@digitalwalletcorp/vue-svg-icons"),v=require("./label-icon.vue_vue_type_style_index_0_lang-D9Cimu20.cjs"),x=require("./use-shrinkable-Cu9JQZll.cjs"),f={class:"dwui-accordion-section"},g={key:0,class:"dwui-accordion-section-control"},m=["disabled","aria-expanded"],b=e.defineComponent({__name:"accordion-section",props:{disabled:{type:Boolean},initialExpand:{type:Boolean},noGradient:{type:Boolean},openLabel:{},closeLabel:{},openPreset:{},closePreset:{}},setup(u){const o=u,l=e.useSlots(),r=e.ref(),n=e.reactive({expanded:!0}),d=x.useShrinkable(r),s=e.computed(()=>n.expanded?o.closePreset:o.openPreset),a=()=>(n.expanded?l["close-icon"]:l["open-icon"])??s.value?.icon,p=()=>(n.expanded?l["close-icon"]:l["open-icon"])==null?s.value?.iconProps:void 0,i=e.computed(()=>{const t=n.expanded?o.closeLabel:o.openLabel;if(t!=null)return t;const c=s.value?.label;return typeof c=="function"?c():c}),_=()=>{n.expanded=!n.expanded};return e.onMounted(()=>{n.expanded=!!o.initialExpand}),(t,c)=>(e.openBlock(),e.createElementBlock("div",f,[e.createElementVNode("div",{ref_key:"refContents",ref:r,class:e.normalizeClass(["dwui-accordion-section-contents",[e.unref(d)?n.expanded?"dwui-expanded":"dwui-shrunk":"",{"dwui-no-gradient":o.noGradient}]])},[e.renderSlot(t.$slots,"default")],2),e.unref(d)?(e.openBlock(),e.createElementBlock("div",g,[e.createElementVNode("button",{type:"button",class:"dwui-accordion-section-toggle",disabled:o.disabled,"aria-expanded":n.expanded,onClick:e.withModifiers(_,["stop"])},[a()!=null||i.value!=null?(e.openBlock(),e.createBlock(v._sfc_main,{key:0},e.createSlots({_:2},[a()!=null?{name:"icon",fn:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(a()),e.normalizeProps(e.guardReactiveProps(p())),null,16))]),key:"0"}:void 0,i.value!=null?{name:"default",fn:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(i.value),1)]),key:"1"}:void 0]),1024)):(e.openBlock(),e.createBlock(e.unref(k.SvgTriangleButton),{key:1,direction:n.expanded?"up":"down"},null,8,["direction"]))],8,m)])):e.createCommentVNode("",!0)]))}});exports._sfc_main=b;