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

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
@@ -12865,7 +12865,7 @@ function autoUpdate(reference2, floating, update, options) {
12865
12865
  const computePosition = (reference2, floating, options) => computePosition$1(reference2, floating, __spreadValues({
12866
12866
  platform
12867
12867
  }, options));
12868
- var usePlatform = () => {
12868
+ var usePlatform = (fullscreenTarget) => {
12869
12869
  const getElementRects = ({
12870
12870
  reference: reference2,
12871
12871
  floating
@@ -12898,11 +12898,11 @@ var usePlatform = () => {
12898
12898
  };
12899
12899
  };
12900
12900
  const getClippingRect2 = ({}) => {
12901
- var _a, _b;
12901
+ var _a;
12902
12902
  const {
12903
12903
  width = 0,
12904
12904
  height = 0
12905
- } = (_b = (_a = document.fullscreenElement) == null ? void 0 : _a.getBoundingClientRect()) != null ? _b : {};
12905
+ } = (_a = fullscreenTarget == null ? void 0 : fullscreenTarget.getBoundingClientRect()) != null ? _a : {};
12906
12906
  return {
12907
12907
  width,
12908
12908
  height,
@@ -12916,8 +12916,14 @@ var usePlatform = () => {
12916
12916
  getClippingRect: getClippingRect2
12917
12917
  };
12918
12918
  };
12919
- var useFloating = (props2, ctx, refReference, refContent, refArrow, refRoot) => {
12919
+ var useFloating = (props2, ctx, {
12920
+ refReference,
12921
+ refContent,
12922
+ refArrow,
12923
+ refRoot
12924
+ }) => {
12920
12925
  const localIsShow = ref(false);
12926
+ const fullScreenTarget = ref();
12921
12927
  const isElementFullScreen = () => {
12922
12928
  var _a, _b, _c;
12923
12929
  const elReference = resolveTargetElement((_a = refReference.value) == null ? void 0 : _a.$el);
@@ -12981,7 +12987,7 @@ var useFloating = (props2, ctx, refReference, refContent, refArrow, refRoot) =>
12981
12987
  getElementRects,
12982
12988
  getDimensions: getDimensions2,
12983
12989
  getClippingRect: getClippingRect2
12984
- } = usePlatform();
12990
+ } = usePlatform(fullScreenTarget.value);
12985
12991
  Object.assign(options, {
12986
12992
  platform: __spreadProps(__spreadValues({}, (_a = props3 == null ? void 0 : props3.platform) != null ? _a : {}), {
12987
12993
  getElementRects,
@@ -13166,6 +13172,9 @@ var useFloating = (props2, ctx, refReference, refContent, refArrow, refRoot) =>
13166
13172
  };
13167
13173
  return (_a = triggerEvents[props2.trigger]) != null ? _a : [];
13168
13174
  };
13175
+ const updateFullscreenTarget = (val) => {
13176
+ fullScreenTarget.value = val;
13177
+ };
13169
13178
  watch(localIsShow, (val) => {
13170
13179
  if (val) {
13171
13180
  hanldePopoverShow();
@@ -13183,15 +13192,15 @@ var useFloating = (props2, ctx, refReference, refContent, refArrow, refRoot) =>
13183
13192
  isElementFullScreen,
13184
13193
  resolveTargetElement,
13185
13194
  createPopInstance,
13195
+ updateFullscreenTarget,
13186
13196
  localIsShow,
13187
13197
  cleanup
13188
13198
  };
13189
13199
  };
13190
13200
  let popContainerId = null;
13191
- let fullscreenReferId = null;
13192
13201
  let parentNodeReferId = null;
13193
13202
  var usePopperId = (props2, prefix = "#") => {
13194
- const getPrefixId = (isFullscreen = false, root) => {
13203
+ const getPrefixId = (root) => {
13195
13204
  let resolvedBoundary = null;
13196
13205
  const resolveBoundary = (fn2) => {
13197
13206
  if (resolvedBoundary === null) {
@@ -13208,11 +13217,6 @@ var usePopperId = (props2, prefix = "#") => {
13208
13217
  }
13209
13218
  }
13210
13219
  };
13211
- const resolveFullScreenBoundary = () => {
13212
- if (isFullscreen) {
13213
- resolvedBoundary = `[data-fllsrn-id=${fullscreenReferId}]`;
13214
- }
13215
- };
13216
13220
  const resolveCommonBoundary = () => {
13217
13221
  if (!/^body$/i.test(props2.boundary) && typeof props2.boundary === "string") {
13218
13222
  if (!isAvailableId(props2.boundary)) {
@@ -13225,7 +13229,6 @@ var usePopperId = (props2, prefix = "#") => {
13225
13229
  };
13226
13230
  resolveBoundary(resolveParentBoundary);
13227
13231
  resolveBoundary(resolveCommonBoundary);
13228
- resolveBoundary(resolveFullScreenBoundary);
13229
13232
  resolveBoundary(() => {
13230
13233
  resolvedBoundary = typeof props2.boundary === "string" ? props2.boundary : `${prefix}${popContainerId}`;
13231
13234
  });
@@ -13238,33 +13241,20 @@ var usePopperId = (props2, prefix = "#") => {
13238
13241
  popContainer.setAttribute("data-popper-id", popContainerId);
13239
13242
  document.body.append(popContainer);
13240
13243
  }
13241
- if (fullscreenReferId === null) {
13242
- fullscreenReferId = `id_${uuid_1.v4()}`;
13243
- }
13244
13244
  if (parentNodeReferId === null) {
13245
13245
  parentNodeReferId = `id_${uuid_1.v4()}`;
13246
13246
  }
13247
- const resetFullscreenElementTag = () => {
13248
- var _a;
13249
- if (document.fullscreenElement === null) {
13250
- const query = `[data-fllsrn-id=${fullscreenReferId}]`;
13251
- ((_a = document.querySelectorAll(query)) != null ? _a : []).forEach((element) => {
13252
- element.removeAttribute("data-fllsrn-id");
13253
- });
13254
- } else {
13255
- document.fullscreenElement.setAttribute("data-fllsrn-id", fullscreenReferId);
13256
- }
13257
- };
13258
13247
  return {
13259
13248
  popContainerId,
13260
13249
  prefixId: getPrefixId(),
13261
- getPrefixId,
13262
- resetFullscreenElementTag
13250
+ getPrefixId
13263
13251
  };
13264
13252
  };
13265
- var usePopoverInit = (props2, ctx, refReference, refContent, refArrow, refRoot) => {
13253
+ var usePopoverInit = (props2, ctx, { refReference, refContent, refArrow, refRoot }) => {
13266
13254
  let storeEvents = null;
13267
13255
  const isFullscreen = ref(false);
13256
+ const fullscreenReferId = `id_${uuid_1.v4()}`;
13257
+ const fullScreenTarget = ref();
13268
13258
  const {
13269
13259
  localIsShow,
13270
13260
  showPopover,
@@ -13273,9 +13263,10 @@ var usePopoverInit = (props2, ctx, refReference, refContent, refArrow, refRoot)
13273
13263
  resolveTriggerEvents,
13274
13264
  resolvePopElements,
13275
13265
  isElementFullScreen,
13266
+ updateFullscreenTarget,
13276
13267
  cleanup,
13277
13268
  createPopInstance
13278
- } = useFloating(props2, ctx, refReference, refContent, refArrow, refRoot);
13269
+ } = useFloating(props2, ctx, { refReference, refContent, refArrow, refRoot });
13279
13270
  const showFn = () => {
13280
13271
  showPopover();
13281
13272
  };
@@ -13323,16 +13314,49 @@ var usePopoverInit = (props2, ctx, refReference, refContent, refArrow, refRoot)
13323
13314
  };
13324
13315
  const updateBoundary = () => {
13325
13316
  const { elReference, root } = resolvePopElements();
13326
- boundary.value = getPrefixId(isFullscreen.value, root || elReference);
13317
+ if (isFullscreen.value) {
13318
+ boundary.value = fullScreenTarget == null ? void 0 : fullScreenTarget.value;
13319
+ return;
13320
+ }
13321
+ boundary.value = getPrefixId(root || elReference);
13322
+ };
13323
+ const { getPrefixId } = usePopperId(props2, "#");
13324
+ const setFullscreenTag = () => {
13325
+ var _a;
13326
+ (_a = fullScreenTarget == null ? void 0 : fullScreenTarget.value) == null ? void 0 : _a.setAttribute("data-fllsrn-id", fullscreenReferId);
13327
+ };
13328
+ const clearFullscreenTag = () => {
13329
+ var _a;
13330
+ 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");
13333
+ });
13327
13334
  };
13328
- const { getPrefixId, resetFullscreenElementTag } = usePopperId(props2, "#");
13329
13335
  const boundary = ref();
13330
13336
  const beforeInstanceUnmount = () => {
13331
13337
  removeEventListener2();
13332
13338
  };
13333
- const handleFullscreenChange = () => {
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;
13351
+ };
13352
+ const handleFullscreenChange = (e) => {
13353
+ if (!document.fullscreenElement) {
13354
+ clearFullscreenTag();
13355
+ }
13356
+ fullScreenTarget.value = getFullscreenRootElement(e.target);
13357
+ updateFullscreenTarget(e.target);
13334
13358
  isFullscreen.value = isElementFullScreen();
13335
- resetFullscreenElementTag();
13359
+ setFullscreenTag();
13336
13360
  updateBoundary();
13337
13361
  updatePopover(null, props2);
13338
13362
  };
@@ -13365,8 +13389,11 @@ var usePopoverInit = (props2, ctx, refReference, refContent, refArrow, refRoot)
13365
13389
  updateBoundary,
13366
13390
  initPopInstance,
13367
13391
  updatePopover,
13392
+ showPopover,
13393
+ hidePopover,
13368
13394
  showFn,
13369
13395
  hideFn,
13396
+ isFullscreen,
13370
13397
  boundary
13371
13398
  };
13372
13399
  };
@@ -13395,13 +13422,7 @@ var Component$q = defineComponent({
13395
13422
  const refContent = ref();
13396
13423
  const refArrow = ref();
13397
13424
  const refRoot = ref();
13398
- const isFullscreen = ref(false);
13399
13425
  const refReference = computed(() => reference2.value || refDefaultReference.value);
13400
- const {
13401
- showPopover,
13402
- hidePopover,
13403
- updatePopover
13404
- } = useFloating(props2, ctx, refReference, refContent, refArrow, refRoot);
13405
13426
  const {
13406
13427
  onMountedFn,
13407
13428
  onUnmountedFn,
@@ -13411,8 +13432,16 @@ var Component$q = defineComponent({
13411
13432
  initPopInstance,
13412
13433
  showFn,
13413
13434
  hideFn,
13435
+ showPopover,
13436
+ hidePopover,
13437
+ updatePopover,
13414
13438
  boundary
13415
- } = usePopoverInit(props2, ctx, refReference, refContent, refArrow, refRoot);
13439
+ } = usePopoverInit(props2, ctx, {
13440
+ refReference,
13441
+ refContent,
13442
+ refArrow,
13443
+ refRoot
13444
+ });
13416
13445
  if (!props2.always && !props2.disabled) {
13417
13446
  watch(() => props2.isShow, () => {
13418
13447
  props2.isShow ? showPopover() : hidePopover();
@@ -13430,7 +13459,7 @@ var Component$q = defineComponent({
13430
13459
  updateBoundary();
13431
13460
  onMounted(onMountedFn);
13432
13461
  onBeforeUnmount(onUnmountedFn);
13433
- const transBoundary = computed(() => (isFullscreen.value || !disableTeleport) && typeof boundary.value === "string");
13462
+ const transBoundary = computed(() => !disableTeleport);
13434
13463
  const show2 = () => {
13435
13464
  showFn();
13436
13465
  };
@@ -14903,6 +14932,7 @@ var SelectTagInput = defineComponent({
14903
14932
  const {
14904
14933
  proxy
14905
14934
  } = getCurrentInstance();
14935
+ const select2 = inject(selectKey, null);
14906
14936
  const {
14907
14937
  modelValue,
14908
14938
  collapseTags,
@@ -14958,6 +14988,7 @@ var SelectTagInput = defineComponent({
14958
14988
  });
14959
14989
  };
14960
14990
  return {
14991
+ select: select2,
14961
14992
  overflowTagIndex,
14962
14993
  value,
14963
14994
  inputRef,
@@ -14993,7 +15024,10 @@ var SelectTagInput = defineComponent({
14993
15024
  },
14994
15025
  "onClose": () => this.handleRemoveTag(item.value)
14995
15026
  }, {
14996
- default: () => [item.label]
15027
+ default: () => {
15028
+ var _a2;
15029
+ return [(_a2 = this.select) == null ? void 0 : _a2.handleGetLabelByValue(item.value)];
15030
+ }
14997
15031
  })), !!this.overflowTagIndex && this.collapseTags && createVNode(BkTag, {
14998
15032
  "class": "bk-select-overflow-tag"
14999
15033
  }, {
@@ -15442,7 +15476,8 @@ var Component$j = defineComponent({
15442
15476
  unregister,
15443
15477
  registerGroup,
15444
15478
  unregisterGroup,
15445
- handleOptionSelected
15479
+ handleOptionSelected,
15480
+ handleGetLabelByValue
15446
15481
  }));
15447
15482
  onMounted(() => {
15448
15483
  handleSetSelectedData();
@@ -16121,7 +16156,7 @@ var SORT_OPTION = /* @__PURE__ */ ((SORT_OPTION2) => {
16121
16156
  SORT_OPTION2["NULL"] = "null";
16122
16157
  return SORT_OPTION2;
16123
16158
  })(SORT_OPTION || {});
16124
- const SORT_OPTIONS = ["asc", "desc"];
16159
+ const SORT_OPTIONS = ["asc", "desc", "null"];
16125
16160
  var SortScope = /* @__PURE__ */ ((SortScope2) => {
16126
16161
  SortScope2["CURRENT"] = "current";
16127
16162
  SortScope2["ALL"] = "all";
@@ -16149,7 +16184,7 @@ const IColumnType = {
16149
16184
  PropTypes.shape({
16150
16185
  sortFn: PropTypes.func.def(void 0),
16151
16186
  sortScope: PropTypes.commonType(Object.values(SortScope)).def("current"),
16152
- value: PropTypes.string.def(null)
16187
+ value: PropTypes.string.def(SORT_OPTION.NULL)
16153
16188
  }),
16154
16189
  PropTypes.bool,
16155
16190
  PropTypes.string
@@ -16225,7 +16260,7 @@ const tableProps = {
16225
16260
  })]).def(false),
16226
16261
  asyncData: PropTypes.bool.def(false),
16227
16262
  rowHover: PropTypes.oneOf(ROW_HOVER_OPTIONS).def(ROW_HOVER.HIGHLIGHT),
16228
- defaultSort: PropTypes.shape({}).def()
16263
+ defaultSort: PropTypes.shape({}).def({})
16229
16264
  };
16230
16265
  var Column = defineComponent({
16231
16266
  name: "TableColumn",
@@ -17314,7 +17349,7 @@ var HeadSort = defineComponent({
17314
17349
  name: "HeadSort",
17315
17350
  props: {
17316
17351
  column: PropTypes.any.def({}),
17317
- defaultSort: PropTypes.oneOf(SORT_OPTIONS).def(SORT_OPTION.ASC)
17352
+ defaultSort: PropTypes.oneOf(SORT_OPTIONS).def(SORT_OPTION.NULL)
17318
17353
  },
17319
17354
  emits: ["change"],
17320
17355
  setup(props2, {
@@ -18393,13 +18428,15 @@ const useInit = (props2, targetColumns) => {
18393
18428
  const colgroups = reactive([]);
18394
18429
  const { getColumns } = useColumn(props2, targetColumns);
18395
18430
  const updateColGroups = () => {
18396
- var _a2;
18431
+ var _a2, _b2;
18397
18432
  const checked = ((_a2 = props2.settings) == null ? void 0 : _a2.checked) || [];
18433
+ const settingFields = ((_b2 = props2.settings) == null ? void 0 : _b2.fields) || [];
18434
+ const isSettingField = (col) => settingFields.some((field) => field.field === resolvePropVal(col, "field", [col]));
18398
18435
  colgroups.splice(0, colgroups.length, ...getColumns().map((col) => __spreadProps(__spreadValues({}, col), {
18399
18436
  calcWidth: null,
18400
18437
  resizeWidth: null,
18401
18438
  listeners: /* @__PURE__ */ new Map(),
18402
- isHidden: checked.length && !checked.includes(resolvePropVal(col, ["field", "type"], [col]))
18439
+ isHidden: isSettingField(col) && checked.length && !checked.includes(resolvePropVal(col, ["field", "type"], [col]))
18403
18440
  })));
18404
18441
  };
18405
18442
  const { dragOffsetXStyle, dragOffsetX, resetResizeEvents, registerResizeEvent } = useColumnResize(colgroups, true);