@vuetkit/components 0.0.18 → 0.0.19

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.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { RequestService } from "@vuetkit/core";
2
- import { CollapseItemProps, CollapseModelValue, CollapseProps, ComponentSize, DescriptionItemProps, DescriptionProps, DialogProps, ElDropdown, ElMenu, FormRules, MessageProps, MessageType, PaginationProps, StepProps, StepsProps, TabPaneName, TableProps, TabsPaneContext, TabsProps } from "element-plus";
2
+ import { CollapseItemProps, CollapseModelValue, CollapseProps, ComponentSize, DescriptionItemProps, DescriptionProps, DialogProps, ElDropdown, ElMenu, FormRules, MessageProps, MessageType, NotificationOptions, PaginationProps, StepProps, StepsProps, TabPaneName, TableProps, TabsPaneContext, TabsProps } from "element-plus";
3
3
  import { CSSProperties, Component, MaybeRef, Ref, VNode } from "vue";
4
4
  import { TableColumnProps } from "element-plus/es/components/table/src/table-column/defaults.mjs";
5
5
 
@@ -73,6 +73,16 @@ declare function useMessage(options?: MessageProps): {
73
73
  closeAll: () => void;
74
74
  };
75
75
  //#endregion
76
+ //#region src/feedback/useNotification/index.d.ts
77
+ declare function useNotification(options?: NotificationOptions): {
78
+ primary: (message: string, title?: string) => import("element-plus").NotificationHandle;
79
+ success: (message: string, title?: string) => import("element-plus").NotificationHandle;
80
+ error: (message: string, title?: string) => import("element-plus").NotificationHandle;
81
+ warning: (message: string, title?: string) => import("element-plus").NotificationHandle;
82
+ info: (message: string, title?: string) => import("element-plus").NotificationHandle;
83
+ closeAll: () => void;
84
+ };
85
+ //#endregion
76
86
  //#region src/form/useForm/index.d.ts
77
87
  type CustomRender = (...args: unknown[]) => unknown;
78
88
  type Recordable = Record<string, unknown>;
@@ -281,4 +291,4 @@ interface TableOptions<T extends DefaultRow> extends TableProps<T> {
281
291
  type TableReturn = [Component];
282
292
  declare function useTable<T extends DefaultRow>(options: TableOptions<T>): TableReturn;
283
293
  //#endregion
284
- export { AsyncConfirmOptions, CollapseColumn, CollapseOptions, CollapseReturnType, CustomRender, DefaultComponentKey, DescriptionsColumn, DescriptionsOptions, DescriptionsReturnType, DropdownItem, DropdownOptions, DropdownReturnType, FormItemType, FormOptions, FormReturnType, FormRuleFn, FormSchema, MenuColumn, MenuOptions, MenuReturnType, PaginationOptions, Recordable, StepsColumn, StepsOptions, StepsReturnType, TableColumnOptions, TableOptions, TableReturn, TabsColumn, TabsOptions, TabsReturnType, setDeepProperty, useAsyncConfirm, useCollapse, useDescriptions, useDialog, useDropdown, useForm, useMenu, useMessage, useSteps, useTable, useTabs };
294
+ export { AsyncConfirmOptions, CollapseColumn, CollapseOptions, CollapseReturnType, CustomRender, DefaultComponentKey, DescriptionsColumn, DescriptionsOptions, DescriptionsReturnType, DropdownItem, DropdownOptions, DropdownReturnType, FormItemType, FormOptions, FormReturnType, FormRuleFn, FormSchema, MenuColumn, MenuOptions, MenuReturnType, PaginationOptions, Recordable, StepsColumn, StepsOptions, StepsReturnType, TableColumnOptions, TableOptions, TableReturn, TabsColumn, TabsOptions, TabsReturnType, setDeepProperty, useAsyncConfirm, useCollapse, useDescriptions, useDialog, useDropdown, useForm, useMenu, useMessage, useNotification, useSteps, useTable, useTabs };
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { useRequest } from "@vuetkit/core";
2
- import { ElButton, ElCascader, ElCheckbox, ElCol, ElCollapse, ElCollapseItem, ElColorPicker, ElDatePicker, ElDescriptions, ElDescriptionsItem, ElDialog, ElDropdown, ElDropdownItem, ElDropdownMenu, ElForm, ElFormItem, ElInput, ElInputNumber, ElInputOtp, ElMention, ElMenu, ElMenuItem, ElMenuItemGroup, ElMessage, ElMessageBox, ElPagination, ElRadio, ElRate, ElRow, ElScrollbar, ElSelect, ElSelectV2, ElSlider, ElStep, ElSteps, ElSubMenu, ElSwitch, ElTabPane, ElTable, ElTableColumn, ElTabs, ElTimePicker, ElTimeSelect, ElTransfer, ElTreeSelect, ElUpload, vLoading } from "element-plus";
2
+ import { ElButton, ElCascader, ElCheckbox, ElCol, ElCollapse, ElCollapseItem, ElColorPicker, ElDatePicker, ElDescriptions, ElDescriptionsItem, ElDialog, ElDropdown, ElDropdownItem, ElDropdownMenu, ElForm, ElFormItem, ElInput, ElInputNumber, ElInputOtp, ElMention, ElMenu, ElMenuItem, ElMenuItemGroup, ElMessage, ElMessageBox, ElNotification, ElPagination, ElRadio, ElRate, ElRow, ElScrollbar, ElSelect, ElSelectV2, ElSlider, ElStep, ElSteps, ElSubMenu, ElSwitch, ElTabPane, ElTable, ElTableColumn, ElTabs, ElTimePicker, ElTimeSelect, ElTransfer, ElTreeSelect, ElUpload, vLoading } from "element-plus";
3
3
  import { computed, defineComponent, h, nextTick, onMounted, reactive, ref, toValue, useTemplateRef, watch, withDirectives } from "vue";
4
4
  import { isFunc, realObj } from "@vuetkit/shared";
5
5
  //#region src/data/useCollapse/index.ts
@@ -112,16 +112,16 @@ function useDescriptions(options) {
112
112
  }
113
113
  //#endregion
114
114
  //#region src/feedback/useMessage/index.ts
115
- const DEFAULT_DURATION = 3e3;
116
- const DEFAULT_SHOW_CLOSE = true;
115
+ const DEFAULT_DURATION$1 = 3e3;
116
+ const DEFAULT_SHOW_CLOSE$1 = true;
117
117
  const DEFAULT_PLAIN = true;
118
118
  const DEFAULT_GROUPING = true;
119
119
  function useMessage(options = {}) {
120
120
  var _options$duration, _options$showClose, _options$plain, _options$grouping;
121
121
  const mergedOptions = {
122
122
  ...options,
123
- duration: (_options$duration = options.duration) !== null && _options$duration !== void 0 ? _options$duration : DEFAULT_DURATION,
124
- showClose: (_options$showClose = options.showClose) !== null && _options$showClose !== void 0 ? _options$showClose : DEFAULT_SHOW_CLOSE,
123
+ duration: (_options$duration = options.duration) !== null && _options$duration !== void 0 ? _options$duration : DEFAULT_DURATION$1,
124
+ showClose: (_options$showClose = options.showClose) !== null && _options$showClose !== void 0 ? _options$showClose : DEFAULT_SHOW_CLOSE$1,
125
125
  plain: (_options$plain = options.plain) !== null && _options$plain !== void 0 ? _options$plain : DEFAULT_PLAIN,
126
126
  grouping: (_options$grouping = options.grouping) !== null && _options$grouping !== void 0 ? _options$grouping : DEFAULT_GROUPING
127
127
  };
@@ -233,6 +233,54 @@ function useDialog(options) {
233
233
  }];
234
234
  }
235
235
  //#endregion
236
+ //#region src/feedback/useNotification/index.ts
237
+ const DEFAULT_DURATION = 4500;
238
+ const DEFAULT_SHOW_CLOSE = true;
239
+ const DEFAULT_POSITION = "top-right";
240
+ function useNotification(options = {}) {
241
+ var _options$duration, _options$showClose, _options$position;
242
+ const mergedOptions = {
243
+ ...options,
244
+ duration: (_options$duration = options.duration) !== null && _options$duration !== void 0 ? _options$duration : DEFAULT_DURATION,
245
+ showClose: (_options$showClose = options.showClose) !== null && _options$showClose !== void 0 ? _options$showClose : DEFAULT_SHOW_CLOSE,
246
+ position: (_options$position = options.position) !== null && _options$position !== void 0 ? _options$position : DEFAULT_POSITION
247
+ };
248
+ function createNotification(message, type, title) {
249
+ return ElNotification({
250
+ ...mergedOptions,
251
+ message,
252
+ type,
253
+ title: title !== null && title !== void 0 ? title : mergedOptions.title
254
+ });
255
+ }
256
+ function closeAll() {
257
+ ElNotification.closeAll();
258
+ }
259
+ function primary(message, title) {
260
+ return createNotification(message, "primary", title);
261
+ }
262
+ function success(message, title) {
263
+ return createNotification(message, "success", title);
264
+ }
265
+ function error(message, title) {
266
+ return createNotification(message, "error", title);
267
+ }
268
+ function warning(message, title) {
269
+ return createNotification(message, "warning", title);
270
+ }
271
+ function info(message, title) {
272
+ return createNotification(message, "info", title);
273
+ }
274
+ return {
275
+ primary,
276
+ success,
277
+ error,
278
+ warning,
279
+ info,
280
+ closeAll
281
+ };
282
+ }
283
+ //#endregion
236
284
  //#region src/form/useForm/index.ts
237
285
  const defaultComponent = {
238
286
  "input": ElInput,
@@ -831,4 +879,4 @@ function useTable(options) {
831
879
  })];
832
880
  }
833
881
  //#endregion
834
- export { setDeepProperty, useAsyncConfirm, useCollapse, useDescriptions, useDialog, useDropdown, useForm, useMenu, useMessage, useSteps, useTable, useTabs };
882
+ export { setDeepProperty, useAsyncConfirm, useCollapse, useDescriptions, useDialog, useDropdown, useForm, useMenu, useMessage, useNotification, useSteps, useTable, useTabs };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@vuetkit/components",
3
3
  "type": "module",
4
- "version": "0.0.18",
4
+ "version": "0.0.19",
5
5
  "description": "Collection of business development components for Vue3 projects",
6
6
  "author": "Kalu5",
7
7
  "license": "MIT",
@@ -21,8 +21,8 @@
21
21
  "vue": "^3.5.35"
22
22
  },
23
23
  "dependencies": {
24
- "@vuetkit/core": "0.0.18",
25
- "@vuetkit/shared": "0.0.18"
24
+ "@vuetkit/core": "0.0.19",
25
+ "@vuetkit/shared": "0.0.19"
26
26
  },
27
27
  "scripts": {
28
28
  "build": "tsdown --config-loader tsx"