bkui-vue 0.0.1-beta.202 → 0.0.1-beta.203

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/index.esm.js CHANGED
@@ -11324,10 +11324,17 @@ function hide$1(el) {
11324
11324
  onHide();
11325
11325
  }
11326
11326
  }
11327
+ const CachedConst = {};
11327
11328
  const isAvailableId = (query) => {
11328
11329
  const container2 = document.querySelector(query);
11329
11330
  return container2 instanceof HTMLElement;
11330
11331
  };
11332
+ const getFullscreenUid = () => {
11333
+ if (!CachedConst.fullscreenReferId) {
11334
+ CachedConst.fullscreenReferId = `id_${uuid_1.v4()}`;
11335
+ }
11336
+ return CachedConst.fullscreenReferId;
11337
+ };
11331
11338
  function createPopoverComponent(options) {
11332
11339
  let $PopoverInstance = null;
11333
11340
  let $PopoverInstanceVm = null;
@@ -12932,6 +12939,15 @@ var useFloating = (props2, ctx, {
12932
12939
  }
12933
12940
  return (_c = document.fullscreenElement) == null ? void 0 : _c.contains(elReference);
12934
12941
  };
12942
+ const getFullscreenRoot = (selector) => {
12943
+ if (isElementFullScreen()) {
12944
+ if (document.fullscreenElement.shadowRoot) {
12945
+ return document.fullscreenElement.shadowRoot.querySelector(selector);
12946
+ }
12947
+ return document.fullscreenElement.querySelector(selector);
12948
+ }
12949
+ return document.body;
12950
+ };
12935
12951
  const themeList = ["dark", "light"];
12936
12952
  const compTheme = computed(() => {
12937
12953
  var _a, _b;
@@ -12944,8 +12960,8 @@ var useFloating = (props2, ctx, {
12944
12960
  customThemes
12945
12961
  };
12946
12962
  });
12947
- const isHideMiddlewareAvailable = () => !isElementFullScreen() && props2.autoVisibility;
12948
- const isAutoPlacemntAvailable = () => isElementFullScreen() || props2.autoPlacement;
12963
+ const isHideMiddlewareAvailable = () => props2.autoVisibility;
12964
+ const isAutoPlacementAvailable = () => props2.autoPlacement;
12949
12965
  const resolvePopElements = () => {
12950
12966
  var _a, _b, _c, _d;
12951
12967
  const elReference = resolveTargetElement((_a = refReference.value) == null ? void 0 : _a.$el);
@@ -12973,7 +12989,7 @@ var useFloating = (props2, ctx, {
12973
12989
  element: elArrow
12974
12990
  }));
12975
12991
  }
12976
- if (isAutoPlacemntAvailable()) {
12992
+ if (isAutoPlacementAvailable()) {
12977
12993
  middleware.push(autoPlacement());
12978
12994
  } else {
12979
12995
  middleware.unshift(inline());
@@ -13193,6 +13209,7 @@ var useFloating = (props2, ctx, {
13193
13209
  resolveTargetElement,
13194
13210
  createPopInstance,
13195
13211
  updateFullscreenTarget,
13212
+ getFullscreenRoot,
13196
13213
  localIsShow,
13197
13214
  cleanup
13198
13215
  };
@@ -13253,7 +13270,7 @@ var usePopperId = (props2, prefix = "#") => {
13253
13270
  var usePopoverInit = (props2, ctx, { refReference, refContent, refArrow, refRoot }) => {
13254
13271
  let storeEvents = null;
13255
13272
  const isFullscreen = ref(false);
13256
- const fullscreenReferId = `id_${uuid_1.v4()}`;
13273
+ const fullscreenReferId = getFullscreenUid();
13257
13274
  const fullScreenTarget = ref();
13258
13275
  const {
13259
13276
  localIsShow,
@@ -13264,8 +13281,8 @@ var usePopoverInit = (props2, ctx, { refReference, refContent, refArrow, refRoot
13264
13281
  resolvePopElements,
13265
13282
  isElementFullScreen,
13266
13283
  updateFullscreenTarget,
13267
- cleanup,
13268
- createPopInstance
13284
+ createPopInstance,
13285
+ getFullscreenRoot
13269
13286
  } = useFloating(props2, ctx, { refReference, refContent, refArrow, refRoot });
13270
13287
  const showFn = () => {
13271
13288
  showPopover();
@@ -13326,37 +13343,27 @@ var usePopoverInit = (props2, ctx, { refReference, refContent, refArrow, refRoot
13326
13343
  (_a = fullScreenTarget == null ? void 0 : fullScreenTarget.value) == null ? void 0 : _a.setAttribute("data-fllsrn-id", fullscreenReferId);
13327
13344
  };
13328
13345
  const clearFullscreenTag = () => {
13329
- var _a;
13346
+ var _a, _b;
13330
13347
  const query = `[data-fllsrn-id=${fullscreenReferId}]`;
13331
- ((_a = fullScreenTarget == null ? void 0 : fullScreenTarget.value.querySelectorAll(query)) != null ? _a : []).forEach((element) => {
13332
- element.removeAttribute("data-fllsrn-id");
13348
+ ((_b = (_a = fullScreenTarget == null ? void 0 : fullScreenTarget.value) == null ? void 0 : _a.querySelectorAll(query)) != null ? _b : []).forEach((element) => {
13349
+ element == null ? void 0 : element.removeAttribute("data-fllsrn-id");
13333
13350
  });
13334
13351
  };
13335
13352
  const boundary = ref();
13336
13353
  const beforeInstanceUnmount = () => {
13337
13354
  removeEventListener2();
13338
13355
  };
13339
- const getFullscreenRootElement = (target) => {
13340
- var _a;
13341
- if (((_a = document.fullscreenElement) == null ? void 0 : _a.shadowRoot) && document.fullscreenElement.shadowRoot.contains(target)) {
13342
- if (target.parentNode === document.fullscreenElement.shadowRoot) {
13343
- return target;
13344
- }
13345
- if (target.parentNode === document.body) {
13346
- return document.body;
13347
- }
13348
- return getFullscreenRootElement(target.parentNode);
13349
- }
13350
- return document.fullscreenElement;
13356
+ const updateFullscreen = (target) => {
13357
+ fullScreenTarget.value = target;
13358
+ updateFullscreenTarget(target);
13359
+ isFullscreen.value = isElementFullScreen();
13360
+ setFullscreenTag();
13351
13361
  };
13352
13362
  const handleFullscreenChange = (e) => {
13353
13363
  if (!document.fullscreenElement) {
13354
13364
  clearFullscreenTag();
13355
13365
  }
13356
- fullScreenTarget.value = getFullscreenRootElement(e.target);
13357
- updateFullscreenTarget(e.target);
13358
- isFullscreen.value = isElementFullScreen();
13359
- setFullscreenTag();
13366
+ updateFullscreen(e.target);
13360
13367
  updateBoundary();
13361
13368
  updatePopover(null, props2);
13362
13369
  };
@@ -13365,6 +13372,11 @@ var usePopoverInit = (props2, ctx, { refReference, refContent, refArrow, refRoot
13365
13372
  return;
13366
13373
  }
13367
13374
  initPopInstance();
13375
+ if (isElementFullScreen()) {
13376
+ const query = `[data-fllsrn-id=${fullscreenReferId}]`;
13377
+ const target = getFullscreenRoot(query);
13378
+ updateFullscreen(target);
13379
+ }
13368
13380
  updateBoundary();
13369
13381
  document.body.addEventListener("fullscreenchange", handleFullscreenChange);
13370
13382
  };
@@ -17307,7 +17319,7 @@ var HeadFilter = defineComponent({
17307
17319
  return () => createVNode(BkPopover2, mergeProps({
17308
17320
  "trigger": "click",
17309
17321
  "isShow": state.isOpen,
17310
- "placement": "bottom-end",
17322
+ "placement": "bottom-start",
17311
17323
  "arrow": false,
17312
17324
  "offset": 0
17313
17325
  }, {