@gct-paas/v-ben 0.1.6-dev.9 → 6.0.0-dev.2

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 (59) hide show
  1. package/README.md +127 -0
  2. package/dist/index.min.css +1 -1
  3. package/dist/loader.esm.min.js +2 -1
  4. package/es/_virtual/_rolldown/runtime.mjs +13 -0
  5. package/es/components/index.mjs +1 -0
  6. package/es/components/v-ben-button/src/BasicButton.vue_vue_type_script_setup_true_lang.mjs +0 -1
  7. package/es/components/v-ben-button/src/PopConfirmButton.vue_vue_type_script_lang.mjs +1 -1
  8. package/es/components/v-ben-table/index.d.ts +2 -0
  9. package/es/components/v-ben-table/index.mjs +1 -0
  10. package/es/components/v-ben-table/src/BasicTable.vue.d.ts +49 -25
  11. package/es/components/v-ben-table/src/BasicTable.vue.mjs +34 -16
  12. package/es/components/v-ben-table/src/BasicTable.vue_vue_type_script_lang.mjs +113 -17
  13. package/es/components/v-ben-table/src/BasicTable.vue_vue_type_style_index_0_lang.css +81 -0
  14. package/es/components/v-ben-table/src/components/TableAction.vue_vue_type_script_setup_true_lang.mjs +4 -10
  15. package/es/components/v-ben-table/src/components/TableAction.vue_vue_type_style_index_0_lang.css +13 -12
  16. package/es/components/v-ben-table/src/components/TableActionAuto.vue_vue_type_script_setup_true_lang.mjs +3 -3
  17. package/es/components/v-ben-table/src/components/TableActionAuto.vue_vue_type_style_index_0_lang.css +13 -12
  18. package/es/components/v-ben-table/src/components/TableHeader.vue.d.ts +2 -0
  19. package/es/components/v-ben-table/src/components/TableHeader.vue.mjs +13 -0
  20. package/es/components/v-ben-table/src/components/TableHeader.vue_vue_type_script_lang.mjs +5 -0
  21. package/es/components/v-ben-table/src/components/TableHeader.vue_vue_type_style_index_0_lang.css +9 -0
  22. package/es/components/v-ben-table/src/const.d.ts +12 -0
  23. package/es/components/v-ben-table/src/const.mjs +14 -0
  24. package/es/components/v-ben-table/src/hooks/useColumns.d.ts +8 -0
  25. package/es/components/v-ben-table/src/hooks/useColumns.mjs +180 -0
  26. package/es/components/v-ben-table/src/hooks/usePagination.d.ts +10 -0
  27. package/es/components/v-ben-table/src/hooks/usePagination.mjs +63 -0
  28. package/es/components/v-ben-table/src/hooks/useTable.d.ts +6 -0
  29. package/es/components/v-ben-table/src/hooks/useTable.mjs +21 -0
  30. package/es/components/v-ben-table/src/hooks/useTableExpand.d.ts +9 -0
  31. package/es/components/v-ben-table/src/hooks/useTableExpand.mjs +62 -0
  32. package/es/components/v-ben-table/src/hooks/useTableHeader.d.ts +4 -0
  33. package/es/components/v-ben-table/src/hooks/useTableHeader.mjs +11 -0
  34. package/es/components/v-ben-table/src/hooks/useTableRowDrag.d.ts +7 -0
  35. package/es/components/v-ben-table/src/hooks/useTableRowDrag.mjs +148 -0
  36. package/es/components/v-ben-table/src/hooks/useTableScroll.d.ts +17 -0
  37. package/es/components/v-ben-table/src/hooks/useTableScroll.mjs +126 -0
  38. package/es/components/v-ben-table/src/props.d.ts +8 -1
  39. package/es/components/v-ben-table/src/props.mjs +46 -1
  40. package/es/components/v-ben-table/src/types/pagination.d.ts +1 -1
  41. package/es/components/v-ben-table/src/types/table.d.ts +16 -0
  42. package/es/components/v-ben-table/src/utils/dom-utils.d.ts +13 -0
  43. package/es/components/v-ben-table/src/utils/dom-utils.mjs +36 -0
  44. package/es/components/v-ben-table/src/utils/tsxHelper.d.ts +13 -0
  45. package/es/components/v-ben-table/src/utils/tsxHelper.mjs +17 -0
  46. package/es/hooks/useDesign.mjs +10 -0
  47. package/es/hooks/useRefs.d.ts +5 -0
  48. package/es/hooks/useRefs.mjs +17 -0
  49. package/es/index.d.ts +2 -0
  50. package/es/index.mjs +4 -1
  51. package/es/locale/auto-register.d.ts +2 -0
  52. package/es/locale/auto-register.mjs +13 -0
  53. package/es/locale/sys/component.d.ts +6 -0
  54. package/es/locale/sys/component.mjs +6 -0
  55. package/es/locale/sys.mjs +9 -0
  56. package/es/setup-app.d.ts +2 -0
  57. package/es/setup-app.mjs +7 -0
  58. package/es/types/sortablejs.d.ts +24 -0
  59. package/package.json +8 -8
@@ -0,0 +1,13 @@
1
+ import { Slots } from 'vue';
2
+ /**
3
+ * @description: Get slot to prevent empty error
4
+ */
5
+ export declare function getSlot(slots: Slots, slot?: string, data?: IObject): import('vue').VNode<import('vue').RendererNode, import('vue').RendererElement, {
6
+ [key: string]: any;
7
+ }>[] | null;
8
+ /**
9
+ * extends slots
10
+ * @param slots
11
+ * @param excludeKeys
12
+ */
13
+ export declare function extendSlots(slots: Slots, excludeKeys?: string[]): IObject;
@@ -0,0 +1,17 @@
1
+ import { isFunction } from "../../../../utils/is.mjs";
2
+ //#region src/components/v-ben-table/src/utils/tsxHelper.tsx
3
+ /**
4
+ * @description: Get slot to prevent empty error
5
+ */
6
+ function getSlot(slots, slot = "default", data) {
7
+ if (!slots || !Reflect.has(slots, slot)) return null;
8
+ if (!isFunction(slots[slot])) {
9
+ console.error(`${slot} is not a function!`);
10
+ return null;
11
+ }
12
+ const slotFn = slots[slot];
13
+ if (!slotFn) return null;
14
+ return slotFn(data);
15
+ }
16
+ //#endregion
17
+ export { getSlot };
@@ -0,0 +1,10 @@
1
+ //#region src/hooks/useDesign.ts
2
+ var prefixCls = "vben";
3
+ function useDesign(scope) {
4
+ return {
5
+ prefixCls: `${prefixCls}-${scope}`,
6
+ prefixVar: prefixCls
7
+ };
8
+ }
9
+ //#endregion
10
+ export { useDesign };
@@ -0,0 +1,5 @@
1
+ import { Ref } from 'vue';
2
+ export declare function useRefs(): {
3
+ refs: Ref<HTMLElement[]>;
4
+ setRefs: (index: number) => (el: HTMLElement) => void;
5
+ };
@@ -0,0 +1,17 @@
1
+ import { onBeforeUpdate, shallowRef } from "vue";
2
+ //#region src/hooks/useRefs.ts
3
+ function useRefs() {
4
+ const refs = shallowRef([]);
5
+ onBeforeUpdate(() => {
6
+ refs.value = [];
7
+ });
8
+ const setRefs = (index) => (el) => {
9
+ refs.value[index] = el;
10
+ };
11
+ return {
12
+ refs,
13
+ setRefs
14
+ };
15
+ }
16
+ //#endregion
17
+ export { useRefs };
package/es/index.d.ts CHANGED
@@ -1,3 +1,5 @@
1
1
  export * from './utils/is';
2
2
  export * from './components';
3
+ export * from './hooks/useRefs';
4
+ export { vBenSetupApp } from './setup-app';
3
5
  export declare function run(): void;
package/es/index.mjs CHANGED
@@ -2,11 +2,14 @@ import { is, isArray, isBoolean, isDate, isDef, isElement, isEmpty, isEmptyStr,
2
2
  import BasicTable_default from "./components/v-ben-table/src/BasicTable.vue.mjs";
3
3
  import TableAction_default from "./components/v-ben-table/src/components/TableAction.vue.mjs";
4
4
  import TableActionAuto_default from "./components/v-ben-table/src/components/TableActionAuto.vue.mjs";
5
+ import { useTable } from "./components/v-ben-table/src/hooks/useTable.mjs";
5
6
  import custom_button_default from "./components/v-ben-button/src/custom-button.vue.mjs";
6
7
  import { Button, PopConfirmButton } from "./components/v-ben-button/index.mjs";
7
8
  import { Dropdown } from "./components/v-ben-dropdown/index.mjs";
8
9
  import "./components/index.mjs";
10
+ import { useRefs } from "./hooks/useRefs.mjs";
11
+ import { vBenSetupApp } from "./setup-app.mjs";
9
12
  //#region src/index.ts
10
13
  function run() {}
11
14
  //#endregion
12
- export { BasicTable_default as BasicTable, Button, custom_button_default as CustomButton, Dropdown, PopConfirmButton, TableAction_default as TableAction, TableActionAuto_default as TableActionAuto, is, isArray, isBoolean, isDate, isDef, isElement, isEmpty, isEmptyStr, isFunction, isMap, isNull, isNullAndUnDef, isNullOrUnDef, isNumber, isObject, isPromise, isRegExp, isString, isUnDef, isUrl, isWindow, run };
15
+ export { BasicTable_default as BasicTable, Button, custom_button_default as CustomButton, Dropdown, PopConfirmButton, TableAction_default as TableAction, TableActionAuto_default as TableActionAuto, is, isArray, isBoolean, isDate, isDef, isElement, isEmpty, isEmptyStr, isFunction, isMap, isNull, isNullAndUnDef, isNullOrUnDef, isNumber, isObject, isPromise, isRegExp, isString, isUnDef, isUrl, isWindow, run, useRefs, useTable, vBenSetupApp };
@@ -0,0 +1,2 @@
1
+ /** 注册 v-ben 包的 locale 多语言资源 */
2
+ export declare function registerVBenLocale(): void;
@@ -0,0 +1,13 @@
1
+ import { component_exports } from "./sys/component.mjs";
2
+ import { sys_exports } from "./sys.mjs";
3
+ //#region src/locale/auto-register.ts
4
+ var localeModules = /* @__PURE__ */ Object.assign({
5
+ "./sys/component.ts": component_exports,
6
+ "./sys.ts": sys_exports
7
+ });
8
+ /** 注册 v-ben 包的 locale 多语言资源 */
9
+ function registerVBenLocale() {
10
+ _gct.i18nUtil.autoRegisterLocale(localeModules);
11
+ }
12
+ //#endregion
13
+ export { registerVBenLocale };
@@ -0,0 +1,6 @@
1
+ declare const _default: {
2
+ table: {
3
+ index: string;
4
+ };
5
+ };
6
+ export default _default;
@@ -0,0 +1,6 @@
1
+ import { __exportAll } from "../../_virtual/_rolldown/runtime.mjs";
2
+ //#region src/locale/sys/component.ts
3
+ var component_exports = /* @__PURE__ */ __exportAll({ default: () => component_default });
4
+ var component_default = { table: { index: "序号" } };
5
+ //#endregion
6
+ export { component_exports };
@@ -0,0 +1,9 @@
1
+ import { __exportAll } from "../_virtual/_rolldown/runtime.mjs";
2
+ //#region src/locale/sys.ts
3
+ var sys_exports = /* @__PURE__ */ __exportAll({ default: () => sys_default });
4
+ var sys_default = {
5
+ okText: "确认",
6
+ cancelText: "取消"
7
+ };
8
+ //#endregion
9
+ export { sys_exports };
@@ -0,0 +1,2 @@
1
+ import { App } from 'vue';
2
+ export declare function vBenSetupApp(_app: App): Promise<void>;
@@ -0,0 +1,7 @@
1
+ import { registerVBenLocale } from "./locale/auto-register.mjs";
2
+ //#region src/setup-app.ts
3
+ async function vBenSetupApp(_app) {
4
+ registerVBenLocale();
5
+ }
6
+ //#endregion
7
+ export { vBenSetupApp };
@@ -0,0 +1,24 @@
1
+ declare module 'sortablejs' {
2
+ interface SortableEvent {
3
+ item: HTMLElement;
4
+ related?: HTMLElement;
5
+ willInsertAfter?: boolean;
6
+ }
7
+
8
+ interface SortableOptions {
9
+ group?: string;
10
+ animation?: number;
11
+ handle?: string;
12
+ dataIdAttr?: string;
13
+ filter?: string;
14
+ onStart?: (evt: SortableEvent) => void;
15
+ onMove?: (evt: SortableEvent) => boolean;
16
+ onEnd?: () => void | Promise<void>;
17
+ }
18
+
19
+ export default class Sortable {
20
+ static create(el: HTMLElement, options?: SortableOptions): Sortable;
21
+ destroy(): void;
22
+ toArray(): string[];
23
+ }
24
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gct-paas/v-ben",
3
- "version": "0.1.6-dev.9",
3
+ "version": "6.0.0-dev.2",
4
4
  "type": "module",
5
5
  "description": "paas 平台历史 v-ben 内容",
6
6
  "loader": "dist/loader.esm.min.js",
@@ -32,23 +32,23 @@
32
32
  "author": "gct",
33
33
  "dependencies": {
34
34
  "@ant-design/icons-vue": "^6.1.0",
35
- "@gct-paas/api": "^0.1.6-dev.5",
35
+ "@gct-paas/api": "^6.0.0-dev.2",
36
36
  "@gct-paas/platform-icons": "^0.0.2",
37
37
  "@icon-park/vue-next": "^1.4.2",
38
38
  "@vueuse/core": "^14.1.0",
39
- "ant-design-vue": "~3.2.20",
39
+ "ant-design-vue": "npm:@gct-paas/ant-design-vue@3.2.21",
40
40
  "lodash-es": "^4.17.23",
41
41
  "sortablejs": "^1.15.7",
42
42
  "vue": "^3.5.30",
43
43
  "vue-types": "^6.0.0",
44
- "@gct-paas/core": "0.1.6-dev.9",
45
- "@gct-paas/scss": "0.1.6-dev.9"
44
+ "@gct-paas/core": "6.0.0-dev.2",
45
+ "@gct-paas/scss": "6.0.0-dev.2"
46
46
  },
47
47
  "peerDependencies": {
48
- "@gct-paas/api": "^0.1.6-dev.5",
48
+ "@gct-paas/api": "^6.0.0-dev.2",
49
49
  "vue": ">=3",
50
- "@gct-paas/core": "0.1.6-dev.9",
51
- "@gct-paas/scss": "0.1.6-dev.9"
50
+ "@gct-paas/core": "6.0.0-dev.2",
51
+ "@gct-paas/scss": "6.0.0-dev.2"
52
52
  },
53
53
  "scripts": {
54
54
  "dev": "cross-env NODE_ENV=development vite build --watch --config vite.dev.config.ts",