@xuda.io/xuda-widget-plugin-xuda-drive 1.0.13 → 1.0.14

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 (2) hide show
  1. package/package.json +1 -1
  2. package/runtime.mjs +13 -7
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xuda.io/xuda-widget-plugin-xuda-drive",
3
- "version": "1.0.13",
3
+ "version": "1.0.14",
4
4
  "description": "Xuda Drive widget plugin",
5
5
  "scripts": {
6
6
  "pub": "npm version patch --force && npm publish --access public"
package/runtime.mjs CHANGED
@@ -573,11 +573,15 @@ export async function viewer(fields, e) {
573
573
  };
574
574
 
575
575
  let viewer_type = fields.default_view_type || "gallery";
576
+ let opt = { app_id, type: "file", search_string: "a" };
576
577
 
577
578
  const render_view = async function () {
578
- e.$containerP.find(".drive_view_wrapper").empty();
579
+ const expand = function (e) {
580
+ console.log(e);
581
+ alert("aaa");
582
+ };
579
583
 
580
- let opt = { app_id, type: "file", search_string: "a" };
584
+ e.$containerP.find(".drive_view_wrapper").empty();
581
585
 
582
586
  try {
583
587
  const ret = await search_drive();
@@ -596,11 +600,11 @@ export async function viewer(fields, e) {
596
600
  default:
597
601
  break;
598
602
  }
599
-
603
+ let $item;
600
604
  for (let file of ret.data) {
601
605
  switch (viewer_type) {
602
606
  case "gallery": {
603
- $wrapper.append(`
607
+ $item = `
604
608
  <li class="relative">
605
609
  <div class="aspect-w-10 aspect-h-7 group block w-full overflow-hidden rounded-lg bg-gray-100 ring-2 ring-indigo-500 ring-offset-2" x-state:on="Current" x-state:off="Default" x-state-description='Current: "ring-2 ring-indigo-500 ring-offset-2", Default: "focus-within:ring-2 focus-within:ring-indigo-500 focus-within:ring-offset-2 focus-within:ring-offset-gray-100"'>
606
610
  <img src="${file.file_url}" alt="${file.name}" class="pointer-events-none object-cover" x-state:on="Current" x-state:off="Default" x-state-description='Current: "", Default: "group-hover:opacity-75"' />
@@ -610,9 +614,11 @@ export async function viewer(fields, e) {
610
614
  </div>
611
615
  <p class="pointer-events-none mt-2 block truncate text-sm font-medium text-gray-900">IMG_4985.HEIC</p>
612
616
  <p class="pointer-events-none block text-sm font-medium text-gray-500">3.9 MB</p>
613
- </li>
614
-
615
- `);
617
+ </li> `.on("click", (e) => {
618
+ expand(e);
619
+ });
620
+
621
+ $wrapper.append($item);
616
622
  break;
617
623
  }
618
624
  default: