nuxt-hs-ui 2.11.4 → 2.12.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/dist/module.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "compatibility": {
5
5
  "nuxt": ">=3.15.0"
6
6
  },
7
- "version": "2.11.4",
7
+ "version": "2.12.0",
8
8
  "builder": {
9
9
  "@nuxt/module-builder": "0.8.4",
10
10
  "unbuild": "2.0.0"
@@ -221,7 +221,7 @@ interface SelectItemShow extends DisplaySelectItem<IdType> {
221
221
  const displayList: Ref<SelectItemShow[]> = ref([]);
222
222
 
223
223
  const setDisplayList = () => {
224
- console.log("setDisplayList");
224
+ // console.log("setDisplayList");
225
225
  displayList.value = useDisplayList<IdType>({
226
226
  list: ObjectCopy(props.list).map((row) => {
227
227
  return { ...row, text: gt(row.text) };
@@ -390,7 +390,7 @@ const onKeyup = (event: KeyboardEvent) => {
390
390
  const setValue = async (row: SelectItemShow | null) => {
391
391
  if (props.disabled) return;
392
392
  if (props.readonly) return;
393
- console.log(row);
393
+ // console.log(row);
394
394
  displayData.value = row;
395
395
  };
396
396
 
@@ -83,6 +83,17 @@ const clickCancel = () => {
83
83
  item.data.cancelBtnClick();
84
84
  };
85
85
 
86
+ const clickBg = () => {
87
+ if (activeItem.value === null) return;
88
+ const item = activeItem.value;
89
+ if (activeItem.value?.data.option.bgClose === true) {
90
+ item.data.cancelBtnClick();
91
+ return;
92
+ }
93
+ if (item.data.option.btnCancel.isShow === false) return;
94
+ item.data.cancelBtnClick();
95
+ };
96
+
86
97
  watch(activateTs, async (ts) => {
87
98
  await nextTick();
88
99
  if (ts === null || !isShow.value) {
@@ -217,6 +228,14 @@ const baseCardHeader = [
217
228
  "py-1",
218
229
  "pe-1",
219
230
  ];
231
+
232
+ const modalClosable = computed(() => {
233
+ if (activeItem.value?.data.option.btnCancel.isShow) return true;
234
+ if (activeItem.value?.data.option.bgClose !== undefined) {
235
+ return activeItem.value?.data.option.bgClose;
236
+ }
237
+ return false;
238
+ });
220
239
  </script>
221
240
 
222
241
  <template>
@@ -226,8 +245,8 @@ const baseCardHeader = [
226
245
  :show="isShow"
227
246
  :z-index="zindex"
228
247
  focus-lock
229
- :closeable="activeItem?.data.option.btnCancel.isShow || false"
230
- @close="clickCancel()"
248
+ :closeable="modalClosable"
249
+ @close="clickBg()"
231
250
  >
232
251
  <Card
233
252
  v-if="activeItem !== null"
@@ -160,7 +160,6 @@ const downStop = () => {
160
160
  >
161
161
  <slot />
162
162
  </div>
163
- <div class="fixed bottom-0 right-0 bg-white z-50">{{ down }}</div>
164
163
  </div>
165
164
  </Teleport>
166
165
  </ClientOnly>
@@ -14,6 +14,7 @@ export interface DialogOption {
14
14
  zindex: number;
15
15
  theme: Theme;
16
16
  defaultBtn: "left" | "right" | "cancel" | null;
17
+ bgClose?: boolean;
17
18
  btnLeft: {
18
19
  isShow: boolean;
19
20
  title: MultiLang;
@@ -9,6 +9,7 @@ export const InitDialogOption = () => {
9
9
  zindex: 10001,
10
10
  theme: "main1",
11
11
  defaultBtn: "right",
12
+ bgClose: void 0,
12
13
  btnLeft: {
13
14
  isShow: true,
14
15
  title: "no",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nuxt-hs-ui",
3
- "version": "2.11.4",
3
+ "version": "2.12.0",
4
4
  "description": "My new Nuxt module",
5
5
  "repository": "https://github.com/hare-systems-ryo/nuxt-hs-ui",
6
6
  "license": "MIT",