ui-process-h5 0.1.20 → 0.1.23

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/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "ui-process-h5",
3
3
  "private": false,
4
4
  "description": "流程组件",
5
- "version": "0.1.20",
5
+ "version": "0.1.23",
6
6
  "type": "module",
7
7
  "scripts": {
8
8
  "dev": "vite",
@@ -18,32 +18,33 @@
18
18
  "publicConfig": {
19
19
  "registry": "http://registry.npmjs.org/"
20
20
  },
21
- "main": "./lib/design.umd.js",
22
- "module": "./lib/design.mjs",
21
+ "main": "./lib/index.umd.js",
22
+ "module": "./lib/index.mjs",
23
23
  "exports": {
24
24
  ".": {
25
- "import": "./lib/design.mjs",
26
- "require": "./lib/design.umd.js"
25
+ "import": "./lib/index.mjs",
26
+ "require": "./lib/index.umd.js"
27
27
  },
28
28
  "./lib/style.css": "./lib/style.css"
29
29
  },
30
30
  "dependencies": {
31
+ "axios": "^1.3.6",
32
+ "dayjs": "^1.11.7",
33
+ "less-loader": "^11.1.0",
31
34
  "sass": "^1.62.0",
32
35
  "vue": "^3.2.47",
33
- "dayjs": "^1.11.7"
36
+ "vue-demi": "^0.14.0"
34
37
  },
35
38
  "devDependencies": {
36
- "@types/node": "^18.15.12",
37
- "@vitejs/plugin-vue": "^4.1.0",
38
- "typescript": "^4.9.3",
39
- "vite": "^4.2.0",
40
- "vue-tsc": "^1.2.0",
41
39
  "@commitlint/cli": "^17.0.0",
42
40
  "@commitlint/config-conventional": "^17.0.0",
41
+ "@types/node": "^18.15.12",
43
42
  "@types/sass": "^1.43.1",
44
43
  "@typescript-eslint/eslint-plugin": "^5.27.0",
45
44
  "@typescript-eslint/parser": "^5.27.0",
45
+ "@vitejs/plugin-vue": "^4.1.0",
46
46
  "@vitejs/plugin-vue-jsx": "^2.0.0",
47
+ "axios": "^1.3.5",
47
48
  "chalk": "^4.1.2",
48
49
  "commitizen": "^4.2.4",
49
50
  "cross-env": "^7.0.3",
@@ -53,16 +54,21 @@
53
54
  "eslint-define-config": "^1.5.0",
54
55
  "eslint-plugin-prettier": "^4.0.0",
55
56
  "eslint-plugin-vue": "^9.1.0",
57
+ "good-storage": "^1.1.1",
56
58
  "husky": "^8.0.1",
59
+ "js-cookie": "^3.0.1",
57
60
  "prettier": "^2.6.2",
58
61
  "rimraf": "^3.0.2",
59
62
  "sass": "^1.49.7",
60
63
  "standard-version": "^9.5.0",
64
+ "typescript": "^4.9.3",
65
+ "vite": "^4.2.0",
61
66
  "vite-plugin-dts": "^1.2.0",
62
67
  "vite-plugin-md": "^0.15.0",
63
- "vue": "^3.2.47"
68
+ "vue": "^3.2.47",
69
+ "vue-tsc": "^1.2.0"
64
70
  },
65
71
  "engines": {
66
72
  "node": ">=16.0.0"
67
73
  }
68
- }
74
+ }
@@ -1,5 +1,5 @@
1
1
  import TopTab from "./components/tab";
2
+ import TopProcess from "./components/process";
2
3
 
3
- export default [TopTab];
4
- export { TopTab };
5
-
4
+ export default [TopTab, TopProcess];
5
+ export { TopTab, TopProcess };
@@ -0,0 +1,9 @@
1
+ import { App, createApp } from "vue";
2
+ import TopButton from "./src/index.vue";
3
+
4
+ TopButton.install = function (app: App) {
5
+ // 组件注册,按需引入
6
+ app.component(TopButton.name, TopButton);
7
+ return app;
8
+ };
9
+ export default TopButton;
@@ -0,0 +1,55 @@
1
+ <template>
2
+ <div
3
+ class="top-button"
4
+ :style="`background-color:${style.bckColor};color:${style.textColor}`"
5
+ >
6
+ <slot></slot>
7
+ </div>
8
+ </template>
9
+ <script>
10
+ import { defineComponent, ref, watch, computed, onMounted } from "vue-demi";
11
+ export default defineComponent({
12
+ name: "TopButton",
13
+ props: {
14
+ type: { default: "default", type: String },
15
+ },
16
+ setup(props) {
17
+ const style = ref({
18
+ textColor: "#fff",
19
+ bckColor: "3c9cff",
20
+ });
21
+
22
+ switch (props.type) {
23
+ case "primary":
24
+ style.value.textColor = "#fff";
25
+ style.value.bckColor = "#3c9cff";
26
+ break;
27
+ case "danger":
28
+ style.value.textColor = "rgb(255, 96, 96)";
29
+ style.value.bckColor = "rgb(255, 230, 230)";
30
+ break;
31
+ case "default":
32
+ style.value.textColor = "rgb(51, 51, 51)";
33
+ style.value.bckColor = "rgb(241, 241, 241)";
34
+ break;
35
+ }
36
+
37
+ return {
38
+ style,
39
+ };
40
+ },
41
+ });
42
+ </script>
43
+ <style scoped>
44
+ .top-button {
45
+ width: 100%;
46
+ border-radius: 20px;
47
+ height: 36px;
48
+ background-color: #3c9cff;
49
+ color: #fff;
50
+ font-size: 14px;
51
+ justify-content: center;
52
+ display: flex;
53
+ align-items: center;
54
+ }
55
+ </style>
@@ -0,0 +1,11 @@
1
+ import { App, createApp } from "vue";
2
+ import TopPopup from "./src/index.vue";
3
+
4
+ TopPopup.install = function (app: App) {
5
+ // 组件注册,按需引入
6
+ console.log("TopPopup.install",app)
7
+ app.mount(TopPopup)
8
+ app.component(TopPopup.name, TopPopup);
9
+ return app;
10
+ };
11
+ export default TopPopup;
@@ -0,0 +1,128 @@
1
+ <template>
2
+ <div
3
+ class="top-popup"
4
+ :style="
5
+ show ? 'transform: translateY(0)' : 'transform: translateY(100%)'
6
+ "
7
+ >
8
+ <div class="top-popup-header">
9
+ <div class="header-cancel" @click="handleCancel">
10
+ {{ cancelText }}
11
+ </div>
12
+ <div class="header-title">{{ titleText }}</div>
13
+ <div class="header-comfig" @click="handleComfig">
14
+ {{ comfigText }}
15
+ </div>
16
+ </div>
17
+ <div class="top-popup-body">
18
+ <slot name="default"></slot>
19
+ </div>
20
+ </div>
21
+ <div
22
+ class="top-popup-mask"
23
+ v-if="show && isMask"
24
+ @click="isMaskClose && handleClose()"
25
+ ></div>
26
+ </template>
27
+ <script lang="ts">
28
+ import { defineComponent, ref, watch, computed, onMounted } from "vue-demi";
29
+
30
+ export default defineComponent({
31
+ name: "TopPopup",
32
+ props: {
33
+ titleText: { default: "top-popup", type: String },
34
+ cancelText: { default: "取消", type: String },
35
+ comfigText: { default: "确定", type: String },
36
+ comfig: { default: null, type: Function },
37
+ cancel: { default: null, type: Function },
38
+ isMask: { require: false, default: true, type: Boolean },
39
+ isMaskClose: { require: false, default: true, type: Boolean },
40
+ },
41
+ setup(props) {
42
+ const show = ref<boolean>(false);
43
+
44
+ const handleOpen = () => {
45
+ show.value = true;
46
+ };
47
+
48
+ const handleCancel = () => {
49
+ typeof props.cancel === "function" && props.cancel();
50
+ handleClose();
51
+ };
52
+
53
+ const handleComfig = () => {
54
+ typeof props.comfig === "function" && props.comfig();
55
+ };
56
+
57
+ const handleClose = () => {
58
+ show.value = false;
59
+ };
60
+
61
+ onMounted(() => {
62
+ const body = document.querySelector("body");
63
+ });
64
+
65
+ return {
66
+ handleOpen,
67
+ handleCancel,
68
+ handleComfig,
69
+ handleClose,
70
+ show,
71
+ };
72
+ },
73
+ });
74
+ </script>
75
+ <style scoped>
76
+ .top-popup {
77
+ width: 100%;
78
+ height: 80vh;
79
+ position: fixed;
80
+ left: 0;
81
+ background-color: #fff;
82
+ z-index: 199;
83
+ border-radius: 20px 20px 0 0;
84
+ padding: 0 10px;
85
+ box-sizing: border-box;
86
+ transition: all 0.5s ease;
87
+ bottom: 0;
88
+ }
89
+ .top-popup-mask {
90
+ position: fixed;
91
+ width: 100vw;
92
+ height: 100vh;
93
+ background-color: #000;
94
+ opacity: 0.7;
95
+ top: 0;
96
+ left: 0;
97
+ z-index: 99;
98
+ }
99
+ .top-popup-header {
100
+ display: flex;
101
+ justify-content: space-between;
102
+ align-items: center;
103
+ padding: 10px 0;
104
+ }
105
+
106
+ .top-popup-header .header-cancel {
107
+ color: #1389ff;
108
+ }
109
+ .top-popup-header .header-comfig {
110
+ color: #1389ff;
111
+ }
112
+
113
+ .fade-enter-active,
114
+ .fade-leave-active {
115
+ transition: all 0.5s ease;
116
+ }
117
+
118
+ .fade-enter,
119
+ .fade-leave-to {
120
+ /* transform: translateY(100%); */
121
+ bottom: -100%;
122
+ }
123
+ .fade-enter-to,
124
+ .fade-leave {
125
+ /* transform: translateY(0%); */
126
+ bottom: 0d;
127
+ }
128
+ </style>
@@ -0,0 +1,9 @@
1
+ import { App } from "vue";
2
+ import TopProcess from "./src/index.vue";
3
+
4
+ TopProcess.install = function (app: App) {
5
+ // 组件注册,按需引入
6
+ app.component(TopProcess.name, TopProcess);
7
+ return app;
8
+ };
9
+ export default TopProcess;