gi-component 0.0.51 → 0.0.53

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.es.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { defineComponent, createElementBlock, openBlock, createElementVNode, getCurrentInstance, ref, onMounted, watch, toValue, toRef, nextTick, onUnmounted, useAttrs, computed, createBlock, unref, mergeProps, withCtx, renderSlot, createTextVNode, toDisplayString, useSlots, normalizeClass, createCommentVNode, normalizeStyle, createVNode, createSlots, Fragment, renderList, mergeModels, useModel, resolveDynamicComponent, resolveComponent, h, createApp, onUpdated, inject, toRefs, watchEffect, reactive, provide, onBeforeUnmount, resolveDirective, normalizeProps, guardReactiveProps, withDirectives, useTemplateRef } from "vue";
2
2
  import * as El from "element-plus";
3
- import El__default, { ElButton, ElSpace, ElDescriptions, ElDescriptionsItem, ElDialog, ElDrawer, ElInput, ElForm, ElTable, ElTableColumn, ElFormItem, ElText, ElMessage, ElIcon, ElSplitter, ElSplitterPanel, ElRow, ElPagination, ElTabs, ElTabPane, ElCheckbox, ElScrollbar, ElTree, ElCheckboxGroup, ElEmpty } from "element-plus";
3
+ import El__default, { ElButton, ElSpace, ElDescriptions, ElDescriptionsItem, ElDialog, ElIcon, ElDrawer, ElInput, ElForm, ElTable, ElTableColumn, ElFormItem, ElText, ElMessage, ElSplitter, ElSplitterPanel, ElRow, ElPagination, ElTabs, ElTabPane, ElCheckbox, ElScrollbar, ElTree, ElCheckboxGroup, ElEmpty } from "element-plus";
4
4
  /*! Element Plus Icons Vue v2.3.2 */
5
5
  var _sfc_main6 = /* @__PURE__ */ defineComponent({
6
6
  name: "ArrowDown",
@@ -171,6 +171,21 @@ var _sfc_main94 = /* @__PURE__ */ defineComponent({
171
171
  ]));
172
172
  }
173
173
  }), edit_default = _sfc_main94;
174
+ var _sfc_main118 = /* @__PURE__ */ defineComponent({
175
+ name: "FullScreen",
176
+ __name: "full-screen",
177
+ setup(__props) {
178
+ return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
179
+ xmlns: "http://www.w3.org/2000/svg",
180
+ viewBox: "0 0 1024 1024"
181
+ }, [
182
+ createElementVNode("path", {
183
+ fill: "currentColor",
184
+ d: "m160 96.064 192 .192a32 32 0 0 1 0 64l-192-.192V352a32 32 0 0 1-64 0V96h64zm0 831.872V928H96V672a32 32 0 1 1 64 0v191.936l192-.192a32 32 0 1 1 0 64zM864 96.064V96h64v256a32 32 0 1 1-64 0V160.064l-192 .192a32 32 0 1 1 0-64zm0 831.872-192-.192a32 32 0 0 1 0-64l192 .192V672a32 32 0 1 1 64 0v256h-64z"
185
+ })
186
+ ]));
187
+ }
188
+ }), full_screen_default = _sfc_main118;
174
189
  var _sfc_main143 = /* @__PURE__ */ defineComponent({
175
190
  name: "InfoFilled",
176
191
  __name: "info-filled",
@@ -910,7 +925,8 @@ const _sfc_main$j = /* @__PURE__ */ defineComponent({
910
925
  };
911
926
  }
912
927
  });
913
- const _hoisted_1$5 = { key: 0 };
928
+ const _hoisted_1$5 = ["id"];
929
+ const _hoisted_2$2 = { key: 0 };
914
930
  const _sfc_main$i = /* @__PURE__ */ defineComponent({
915
931
  __name: "dialog",
916
932
  props: /* @__PURE__ */ mergeModels({
@@ -922,6 +938,7 @@ const _sfc_main$i = /* @__PURE__ */ defineComponent({
922
938
  cancelButtonProps: {},
923
939
  style: {},
924
940
  simple: { type: Boolean },
941
+ showFullscreen: { type: Boolean, default: false },
925
942
  onOk: {},
926
943
  onBeforeOk: {},
927
944
  onCancel: {},
@@ -968,6 +985,14 @@ const _sfc_main$i = /* @__PURE__ */ defineComponent({
968
985
  const visible = useModel(__props, "modelValue");
969
986
  const props = __props;
970
987
  const { b } = useBemClass();
988
+ const isFullscreen = ref(false);
989
+ watch(
990
+ () => props.fullscreen,
991
+ (val) => {
992
+ isFullscreen.value = !!val;
993
+ },
994
+ { immediate: true }
995
+ );
971
996
  const getClass = computed(() => {
972
997
  const arr = [b("dialog")];
973
998
  if (props.simple) {
@@ -987,10 +1012,16 @@ const _sfc_main$i = /* @__PURE__ */ defineComponent({
987
1012
  onOk: void 0,
988
1013
  onBeforeOk: void 0,
989
1014
  onCancel: void 0,
990
- simple: void 0
1015
+ simple: void 0,
1016
+ showFullscreen: void 0,
1017
+ fullscreen: void 0,
1018
+ title: void 0
991
1019
  };
992
1020
  });
993
1021
  const okLoading = ref(false);
1022
+ const toggleFullscreen = () => {
1023
+ isFullscreen.value = !isFullscreen.value;
1024
+ };
994
1025
  const handleCancel = () => {
995
1026
  var _a;
996
1027
  (_a = props.onCancel) == null ? void 0 : _a.call(props);
@@ -1020,17 +1051,69 @@ const _sfc_main$i = /* @__PURE__ */ defineComponent({
1020
1051
  modelValue: visible.value,
1021
1052
  "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => visible.value = $event),
1022
1053
  class: getClass.value,
1023
- title: props.title,
1024
- style: { maxWidth: !props.fullscreen ? "480px" : "100%", ...props.style }
1054
+ fullscreen: isFullscreen.value,
1055
+ "show-close": false,
1056
+ style: { maxWidth: !isFullscreen.value ? "480px" : "100%", ...props.style }
1025
1057
  }), createSlots({
1058
+ header: withCtx(({ close, titleId, titleClass }) => [
1059
+ createElementVNode("div", {
1060
+ class: normalizeClass(unref(b)("dialog-header"))
1061
+ }, [
1062
+ renderSlot(_ctx.$slots, "title", {}, () => [
1063
+ createElementVNode("div", {
1064
+ id: titleId,
1065
+ class: normalizeClass(["el-dialog__title", [titleClass, unref(b)("dialog-title")]])
1066
+ }, toDisplayString(props.title), 11, _hoisted_1$5)
1067
+ ], true),
1068
+ createVNode(unref(ElSpace), { size: 8 }, {
1069
+ default: withCtx(() => [
1070
+ props.showFullscreen ? (openBlock(), createBlock(unref(ElButton), {
1071
+ key: 0,
1072
+ class: normalizeClass(unref(b)("dialog-button")),
1073
+ text: "",
1074
+ circle: "",
1075
+ onClick: toggleFullscreen
1076
+ }, {
1077
+ default: withCtx(() => [
1078
+ createVNode(unref(ElIcon), { size: 16 }, {
1079
+ default: withCtx(() => [
1080
+ createVNode(unref(full_screen_default))
1081
+ ]),
1082
+ _: 1
1083
+ })
1084
+ ]),
1085
+ _: 1
1086
+ }, 8, ["class"])) : createCommentVNode("", true),
1087
+ props.showClose ? (openBlock(), createBlock(unref(ElButton), {
1088
+ key: 1,
1089
+ class: normalizeClass(unref(b)("dialog-button")),
1090
+ text: "",
1091
+ circle: "",
1092
+ onClick: close
1093
+ }, {
1094
+ default: withCtx(() => [
1095
+ createVNode(unref(ElIcon), { size: 16 }, {
1096
+ default: withCtx(() => [
1097
+ createVNode(unref(close_default))
1098
+ ]),
1099
+ _: 1
1100
+ })
1101
+ ]),
1102
+ _: 1
1103
+ }, 8, ["class", "onClick"])) : createCommentVNode("", true)
1104
+ ]),
1105
+ _: 2
1106
+ }, 1024)
1107
+ ], 2)
1108
+ ]),
1026
1109
  default: withCtx(() => [
1027
1110
  renderSlot(_ctx.$slots, "default", {}, () => {
1028
1111
  var _a;
1029
1112
  return [
1030
- typeof props.content === "string" ? (openBlock(), createElementBlock("p", _hoisted_1$5, toDisplayString(props.content), 1)) : createCommentVNode("", true),
1113
+ typeof props.content === "string" ? (openBlock(), createElementBlock("p", _hoisted_2$2, toDisplayString(props.content), 1)) : createCommentVNode("", true),
1031
1114
  typeof props.content === "function" ? (openBlock(), createBlock(resolveDynamicComponent((_a = props == null ? void 0 : props.content) == null ? void 0 : _a.call(props)), { key: 1 })) : createCommentVNode("", true)
1032
1115
  ];
1033
- })
1116
+ }, true)
1034
1117
  ]),
1035
1118
  _: 2
1036
1119
  }, [
@@ -1061,14 +1144,15 @@ const _sfc_main$i = /* @__PURE__ */ defineComponent({
1061
1144
  ]),
1062
1145
  _: 1
1063
1146
  })) : (openBlock(), createBlock(resolveDynamicComponent(props.footer()), { key: 1 }))
1064
- ])
1147
+ ], true)
1065
1148
  ]),
1066
1149
  key: "0"
1067
1150
  } : void 0
1068
- ]), 1040, ["modelValue", "class", "title", "style"]);
1151
+ ]), 1040, ["modelValue", "class", "fullscreen", "style"]);
1069
1152
  };
1070
1153
  }
1071
1154
  });
1155
+ const DialogComponent = /* @__PURE__ */ _export_sfc(_sfc_main$i, [["__scopeId", "data-v-166b4c09"]]);
1072
1156
  const _hoisted_1$4 = { class: "el-message-box__message" };
1073
1157
  const _sfc_main$h = /* @__PURE__ */ defineComponent({
1074
1158
  __name: "dialog-content",
@@ -1122,7 +1206,7 @@ function createDialog() {
1122
1206
  dialogApp.unmount();
1123
1207
  container.remove();
1124
1208
  };
1125
- return () => h(_sfc_main$i, {
1209
+ return () => h(DialogComponent, {
1126
1210
  ...dialogOptions.value,
1127
1211
  "modelValue": visible.value,
1128
1212
  "onUpdate:modelValue": (val) => visible.value = val,
@@ -1234,7 +1318,8 @@ const _sfc_main$g = /* @__PURE__ */ defineComponent({
1234
1318
  }
1235
1319
  });
1236
1320
  const Dot = /* @__PURE__ */ _export_sfc(_sfc_main$g, [["__scopeId", "data-v-575d79dc"]]);
1237
- const _hoisted_1$3 = { key: 0 };
1321
+ const _hoisted_1$3 = ["id"];
1322
+ const _hoisted_2$1 = { key: 0 };
1238
1323
  const _sfc_main$f = /* @__PURE__ */ defineComponent({
1239
1324
  __name: "drawer",
1240
1325
  props: /* @__PURE__ */ mergeModels({
@@ -1312,7 +1397,7 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
1312
1397
  onOk: void 0,
1313
1398
  onBeforeOk: void 0,
1314
1399
  onCancel: void 0,
1315
- simple: void 0
1400
+ title: void 0
1316
1401
  };
1317
1402
  });
1318
1403
  const okLoading = ref(false);
@@ -1345,20 +1430,58 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
1345
1430
  modelValue: visible.value,
1346
1431
  "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => visible.value = $event),
1347
1432
  class: getClass.value,
1348
- title: props.title,
1433
+ "show-close": false,
1349
1434
  style: { ...props.style }
1350
1435
  }), createSlots({
1351
1436
  default: withCtx(() => [
1352
1437
  renderSlot(_ctx.$slots, "default", {}, () => {
1353
1438
  var _a;
1354
1439
  return [
1355
- typeof props.content === "string" ? (openBlock(), createElementBlock("p", _hoisted_1$3, toDisplayString(props.content), 1)) : createCommentVNode("", true),
1440
+ typeof props.content === "string" ? (openBlock(), createElementBlock("p", _hoisted_2$1, toDisplayString(props.content), 1)) : createCommentVNode("", true),
1356
1441
  typeof props.content === "function" ? (openBlock(), createBlock(resolveDynamicComponent((_a = props == null ? void 0 : props.content) == null ? void 0 : _a.call(props)), { key: 1 })) : createCommentVNode("", true)
1357
1442
  ];
1358
- })
1443
+ }, true)
1359
1444
  ]),
1360
1445
  _: 2
1361
1446
  }, [
1447
+ props.withHeader ? {
1448
+ name: "header",
1449
+ fn: withCtx(({ close, titleId, titleClass }) => [
1450
+ createElementVNode("div", {
1451
+ class: normalizeClass(unref(b)("drawer-header"))
1452
+ }, [
1453
+ renderSlot(_ctx.$slots, "title", {}, () => [
1454
+ createElementVNode("div", {
1455
+ id: titleId,
1456
+ class: normalizeClass(["el-drawer__title", [titleClass, unref(b)("drawer-title")]])
1457
+ }, toDisplayString(props.title), 11, _hoisted_1$3)
1458
+ ], true),
1459
+ createVNode(unref(ElSpace), { size: 8 }, {
1460
+ default: withCtx(() => [
1461
+ props.showClose ? (openBlock(), createBlock(unref(ElButton), {
1462
+ key: 0,
1463
+ class: normalizeClass(unref(b)("drawer-button")),
1464
+ text: "",
1465
+ circle: "",
1466
+ onClick: close
1467
+ }, {
1468
+ default: withCtx(() => [
1469
+ createVNode(unref(ElIcon), { size: 16 }, {
1470
+ default: withCtx(() => [
1471
+ createVNode(unref(close_default))
1472
+ ]),
1473
+ _: 1
1474
+ })
1475
+ ]),
1476
+ _: 1
1477
+ }, 8, ["class", "onClick"])) : createCommentVNode("", true)
1478
+ ]),
1479
+ _: 2
1480
+ }, 1024)
1481
+ ], 2)
1482
+ ]),
1483
+ key: "0"
1484
+ } : void 0,
1362
1485
  props.footer ? {
1363
1486
  name: "footer",
1364
1487
  fn: withCtx(() => [
@@ -1386,14 +1509,15 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
1386
1509
  ]),
1387
1510
  _: 1
1388
1511
  })) : (openBlock(), createBlock(resolveDynamicComponent(props.footer()), { key: 1 }))
1389
- ])
1512
+ ], true)
1390
1513
  ]),
1391
- key: "0"
1514
+ key: "1"
1392
1515
  } : void 0
1393
- ]), 1040, ["modelValue", "class", "title", "style"]);
1516
+ ]), 1040, ["modelValue", "class", "style"]);
1394
1517
  };
1395
1518
  }
1396
1519
  });
1520
+ const Drawer$1 = /* @__PURE__ */ _export_sfc(_sfc_main$f, [["__scopeId", "data-v-a9d2ac8f"]]);
1397
1521
  const DEF_OPTIONS = {};
1398
1522
  function createDrawer() {
1399
1523
  const Drawer2 = {
@@ -1411,7 +1535,7 @@ function createDrawer() {
1411
1535
  drawerApp.unmount();
1412
1536
  container.remove();
1413
1537
  };
1414
- return () => h(_sfc_main$f, {
1538
+ return () => h(Drawer$1, {
1415
1539
  ...dialogOptions.value,
1416
1540
  "modelValue": visible.value,
1417
1541
  "onUpdate:modelValue": (val) => visible.value = val,
@@ -2270,7 +2394,8 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
2270
2394
  hideFoldBtn: { type: Boolean, default: false },
2271
2395
  defaultCollapsed: { type: Boolean, default: void 0 },
2272
2396
  suffix: { type: Boolean, default: true },
2273
- model: {},
2397
+ size: {},
2398
+ disabled: { type: Boolean },
2274
2399
  rules: {},
2275
2400
  labelPosition: {},
2276
2401
  requireAsteriskPosition: {},
@@ -2283,9 +2408,7 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
2283
2408
  validateOnRuleChange: { type: Boolean },
2284
2409
  hideRequiredAsterisk: { type: Boolean },
2285
2410
  scrollToError: { type: Boolean, default: true },
2286
- scrollIntoViewOptions: {},
2287
- size: {},
2288
- disabled: { type: Boolean }
2411
+ scrollIntoViewOptions: { type: Boolean }
2289
2412
  },
2290
2413
  emits: ["update:modelValue", "search", "reset"],
2291
2414
  setup(__props, { expose: __expose, emit: __emit }) {
@@ -2658,7 +2781,7 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
2658
2781
  };
2659
2782
  }
2660
2783
  });
2661
- const Form = /* @__PURE__ */ _export_sfc(_sfc_main$8, [["__scopeId", "data-v-4c32de90"]]);
2784
+ const _Form = /* @__PURE__ */ _export_sfc(_sfc_main$8, [["__scopeId", "data-v-5ba30556"]]);
2662
2785
  const _hoisted_1$1 = ["data-value", "onClick"];
2663
2786
  const _sfc_main$7 = /* @__PURE__ */ defineComponent({
2664
2787
  __name: "nav-tabs",
@@ -9162,7 +9285,7 @@ const components = {
9162
9285
  Button: _sfc_main$l,
9163
9286
  Card,
9164
9287
  Descriptions: _sfc_main$j,
9165
- Drawer: _sfc_main$f,
9288
+ Drawer: Drawer$1,
9166
9289
  Dot,
9167
9290
  Tabs,
9168
9291
  InputGroup,
@@ -9171,9 +9294,9 @@ const components = {
9171
9294
  Flex,
9172
9295
  Grid,
9173
9296
  GridItem,
9174
- Form,
9297
+ Form: _Form,
9175
9298
  PageLayout,
9176
- Dialog: _sfc_main$i,
9299
+ Dialog: DialogComponent,
9177
9300
  EditTable,
9178
9301
  Table: _Table,
9179
9302
  Tag,
@@ -9182,7 +9305,7 @@ const components = {
9182
9305
  const GiButton = _sfc_main$l;
9183
9306
  const GiCard = Card;
9184
9307
  const GiDescriptions = _sfc_main$j;
9185
- const GiDrawer = _sfc_main$f;
9308
+ const GiDrawer = Drawer$1;
9186
9309
  const GiDot = Dot;
9187
9310
  const GiTabs = Tabs;
9188
9311
  const GiInputGroup = InputGroup;
@@ -9191,9 +9314,9 @@ const GiNavTabs = NavTabs;
9191
9314
  const GiFlex = Flex;
9192
9315
  const GiGrid = Grid;
9193
9316
  const GiGridItem = GridItem;
9194
- const GiForm = Form;
9317
+ const GiForm = _Form;
9195
9318
  const GiPageLayout = PageLayout;
9196
- const GiDialog = _sfc_main$i;
9319
+ const GiDialog = DialogComponent;
9197
9320
  const GiEditTable = EditTable;
9198
9321
  const GiTable = _Table;
9199
9322
  const GiTag = Tag;