@cgboiler/biz-mobile 1.17.15 → 1.17.17

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/es/index.d.ts CHANGED
@@ -8,7 +8,7 @@ declare namespace _default {
8
8
  }
9
9
  export default _default;
10
10
  export function install(app: any): void;
11
- export const version: "1.17.14";
11
+ export const version: "1.17.16";
12
12
  import MdPreview from './md-preview';
13
13
  import OrgPicker from './org-picker';
14
14
  import ProjectSelect from './project-select';
package/es/index.js CHANGED
@@ -2,7 +2,7 @@ import MdPreview from "./md-preview";
2
2
  import OrgPicker from "./org-picker";
3
3
  import ProjectSelect from "./project-select";
4
4
  import RichTextEditor from "./rich-text-editor";
5
- const version = "1.17.14";
5
+ const version = "1.17.16";
6
6
  function install(app) {
7
7
  const components = [
8
8
  MdPreview,
@@ -24,6 +24,7 @@ var stdin_default = defineComponent({
24
24
  } = api;
25
25
  getOrgList();
26
26
  const activeTab = ref("txl");
27
+ const isSearchFocus = ref(false);
27
28
  const {
28
29
  keyword,
29
30
  searchRef,
@@ -32,7 +33,11 @@ var stdin_default = defineComponent({
32
33
  handleDeleteHistorySelect,
33
34
  highlightText,
34
35
  renderSearchResult
35
- } = useSearch(props, api);
36
+ } = useSearch({
37
+ props,
38
+ api,
39
+ isSearchFocus
40
+ });
36
41
  const selectedItems = ref([]);
37
42
  const sortOrgList = computed(() => {
38
43
  const departments = orgList.value.filter((item) => item.type === "dept");
@@ -101,6 +106,12 @@ var stdin_default = defineComponent({
101
106
  "modelValue": keyword.value,
102
107
  "onUpdate:modelValue": ($event) => keyword.value = $event,
103
108
  "placeholder": "\u641C\u7D22\u4EBA\u5458",
109
+ "onFocus": () => {
110
+ isSearchFocus.value = true;
111
+ },
112
+ "onBlur": () => {
113
+ isSearchFocus.value = false;
114
+ },
104
115
  "class": "search-bar"
105
116
  }, null), _createVNode("div", {
106
117
  "class": "org-selected-items"
@@ -37,6 +37,7 @@
37
37
  .cgx-atm .right-0{right:0rem;}
38
38
  .cgx-atm .top-0{top:0rem;}
39
39
  .cgx-atm .z-1{z-index:1;}
40
+ .cgx-atm .h-\[300px\]{height:300px;}
40
41
  .cgx-atm .flex-1{flex:1 1 0%;}
41
42
  .cgx-atm .overflow-auto{overflow:auto;}
42
43
  .cgx-atm .border-b{border-bottom-width:1px;border-bottom-style:solid;}
@@ -1,4 +1,4 @@
1
- export declare function useSearch(props: any, api: any): {
1
+ export declare function useSearch({ props, api, isSearchFocus }: any): {
2
2
  keyword: import("vue").Ref<string, string>;
3
3
  searchRef: import("vue").Ref<any, any>;
4
4
  setRecentUsers: (users: any[]) => Promise<void>;
@@ -21,8 +21,13 @@ var __async = (__this, __arguments, generator) => {
21
21
  import { createVNode as _createVNode, Fragment as _Fragment, createTextVNode as _createTextVNode } from "vue";
22
22
  import "./_atomic.css";
23
23
  import { ref, computed, watch, watchEffect, nextTick } from "vue";
24
- import { Empty, List, Image } from "vant";
25
- function useSearch(props, api) {
24
+ import { Empty, Image } from "vant";
25
+ const isMobile = /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);
26
+ function useSearch({
27
+ props,
28
+ api,
29
+ isSearchFocus
30
+ }) {
26
31
  const {
27
32
  orgSearchList,
28
33
  getOrgList,
@@ -92,11 +97,11 @@ function useSearch(props, api) {
92
97
  handleSelect
93
98
  }) => {
94
99
  return _createVNode("div", {
95
- "class": "absolute top-0 left-0 right-0 bottom-0 bg-[#fff] z-1"
100
+ "class": "absolute top-0 left-0 right-0 bottom-0 bg-[#fff] z-1 overflow-auto"
96
101
  }, [filterRecentSelectedHistory.value.length ? _createVNode(_Fragment, null, [_createVNode("p", {
97
102
  "class": "text-[14px] text-[#333] font-bold px-[16px] py-[12px] border-b border-[#eee]"
98
103
  }, [_createTextVNode("\u6700\u8FD1\u9009\u62E9")]), _createVNode("div", {
99
- "class": "recent-list-wrap flex-1 overflow-auto py-[8px]"
104
+ "class": "recent-list-wrap flex-1 py-[8px]"
100
105
  }, [filterRecentSelectedHistory.value.map((historyItem) => _createVNode("div", {
101
106
  "key": historyItem.id,
102
107
  "onClick": () => handleHistorySelect(historyItem),
@@ -104,22 +109,22 @@ function useSearch(props, api) {
104
109
  }, [_createVNode("span", null, [historyItem.selectedUsers.map((user) => highlightText(getUserInfoById(user.id), keyword.value)).reduce((prev, curr) => [prev, "\uFF0C", curr])])]))])]) : "", filteredOrgList.value.length ? _createVNode(_Fragment, null, [" ", _createVNode("p", {
105
110
  "class": "text-[14px] text-[#333] font-bold px-[16px] py-[12px] border-b border-[#eee]"
106
111
  }, [_createTextVNode("\u901A\u8BAF\u5F55")]), _createVNode("div", {
107
- "class": "feed-list-wrap"
112
+ "class": "px-16px"
108
113
  }, [filteredOrgList.value.length === 0 ? _createVNode(Empty, {
109
114
  "description": "\u672A\u627E\u5230\u76F8\u5173\u4EBA\u5458"
110
- }, null) : _createVNode(List, null, {
111
- default: () => [filteredOrgList.value.map((item) => _createVNode("div", {
112
- "class": ["org-item", isSelected(item) ? "selected" : ""],
113
- "onClick": () => handleSelect(item)
114
- }, [_createVNode(Image, {
115
- "class": "org-avatar",
116
- "src": item.avatar
117
- }, null), _createVNode("div", {
118
- "class": "org-name"
119
- }, [item.name, _createVNode("span", {
120
- "class": "org-item-select-icon"
121
- }, [_createTextVNode("\u2713")])])]))]
122
- })])]) : ""]);
115
+ }, null) : _createVNode(_Fragment, null, [filteredOrgList.value.map((item) => _createVNode("div", {
116
+ "class": ["org-item", isSelected(item) ? "selected" : ""],
117
+ "onClick": () => handleSelect(item)
118
+ }, [_createVNode(Image, {
119
+ "class": "org-avatar",
120
+ "src": item.avatar
121
+ }, null), _createVNode("div", {
122
+ "class": "org-name"
123
+ }, [item.name, _createVNode("span", {
124
+ "class": "org-item-select-icon"
125
+ }, [_createTextVNode("\u2713")])])]))])])]) : "", isSearchFocus.value && isMobile ? _createVNode("div", {
126
+ "class": "h-[300px]"
127
+ }, null) : ""]);
123
128
  };
124
129
  return {
125
130
  keyword,
@@ -1,12 +1,9 @@
1
1
  import { createVNode as _createVNode } from "vue";
2
2
  import "./_atomic.css";
3
- import { defineComponent, onMounted, onBeforeUnmount, ref, watch } from "vue";
4
- import StarterKit from "@tiptap/starter-kit";
5
- import { Editor, EditorContent } from "@tiptap/vue-3";
6
- import { TableKit } from "@tiptap/extension-table";
7
- import { Placeholder } from "@tiptap/extensions";
3
+ import { defineComponent } from "vue";
8
4
  import { richTextEditorProps } from "./types";
9
5
  import "./index.css";
6
+ import { RichTextEditor } from "@cgboiler/biz-basic";
10
7
  var stdin_default = defineComponent({
11
8
  name: "RichTextEditor",
12
9
  props: richTextEditorProps,
@@ -14,62 +11,10 @@ var stdin_default = defineComponent({
14
11
  setup(props, {
15
12
  emit
16
13
  }) {
17
- const editor = ref();
18
- const addTableRow = () => {
19
- var _a;
20
- (_a = editor.value) == null ? void 0 : _a.chain().focus().addRowAfter().run();
21
- };
22
- const deleteTableRow = () => {
23
- var _a;
24
- (_a = editor.value) == null ? void 0 : _a.chain().focus().deleteRow().run();
25
- };
26
- const setTextFormat = (level) => {
27
- var _a, _b;
28
- if (level === 0) {
29
- (_a = editor.value) == null ? void 0 : _a.chain().focus().setParagraph().run();
30
- } else {
31
- (_b = editor.value) == null ? void 0 : _b.chain().focus().toggleHeading({
32
- level
33
- }).run();
34
- }
35
- };
36
- const showTableButtons = ref(false);
37
- onMounted(() => {
38
- editor.value = new Editor({
39
- extensions: [StarterKit, TableKit.configure({
40
- table: {
41
- resizable: true
42
- }
43
- }), Placeholder.configure({
44
- placeholder: props.placeholder
45
- })],
46
- content: props.modelValue,
47
- onUpdate: ({
48
- editor: editor2
49
- }) => {
50
- const html = editor2.getHTML();
51
- emit("update:modelValue", html);
52
- },
53
- onSelectionUpdate: ({
54
- editor: editor2
55
- }) => {
56
- showTableButtons.value = editor2.isActive("table");
57
- }
58
- });
59
- });
60
- watch(() => props.modelValue, (newValue) => {
61
- var _a, _b;
62
- if (((_a = editor.value) == null ? void 0 : _a.getHTML()) !== newValue) {
63
- (_b = editor.value) == null ? void 0 : _b.commands.setContent(newValue || "");
64
- }
65
- });
66
- onBeforeUnmount(() => {
67
- var _a;
68
- (_a = editor.value) == null ? void 0 : _a.destroy();
69
- });
70
- return () => _createVNode(EditorContent, {
71
- "class": "ProseMirror",
72
- "editor": editor.value
14
+ return () => _createVNode(RichTextEditor, {
15
+ "modelValue": props.modelValue,
16
+ "onUpdate:modelValue": (val) => emit("update:modelValue", val),
17
+ "placeholder": props.placeholder
73
18
  }, null);
74
19
  }
75
20
  });
@@ -30,5 +30,3 @@
30
30
  flex-wrap: wrap;
31
31
  }
32
32
 
33
- /* layer: default */
34
- .cgx-atm .table{display:table;}
package/lib/index.d.ts CHANGED
@@ -8,7 +8,7 @@ declare namespace _default {
8
8
  }
9
9
  export default _default;
10
10
  export function install(app: any): void;
11
- export const version: "1.17.14";
11
+ export const version: "1.17.16";
12
12
  import MdPreview from './md-preview';
13
13
  import OrgPicker from './org-picker';
14
14
  import ProjectSelect from './project-select';
package/lib/index.js CHANGED
@@ -45,7 +45,7 @@ __reExport(stdin_exports, require("./md-preview"), module.exports);
45
45
  __reExport(stdin_exports, require("./org-picker"), module.exports);
46
46
  __reExport(stdin_exports, require("./project-select"), module.exports);
47
47
  __reExport(stdin_exports, require("./rich-text-editor"), module.exports);
48
- const version = "1.17.14";
48
+ const version = "1.17.16";
49
49
  function install(app) {
50
50
  const components = [
51
51
  import_md_preview.default,
@@ -56,6 +56,7 @@ var stdin_default = (0, import_vue2.defineComponent)({
56
56
  } = api;
57
57
  getOrgList();
58
58
  const activeTab = (0, import_vue2.ref)("txl");
59
+ const isSearchFocus = (0, import_vue2.ref)(false);
59
60
  const {
60
61
  keyword,
61
62
  searchRef,
@@ -64,7 +65,11 @@ var stdin_default = (0, import_vue2.defineComponent)({
64
65
  handleDeleteHistorySelect,
65
66
  highlightText,
66
67
  renderSearchResult
67
- } = (0, import_useSearch.useSearch)(props, api);
68
+ } = (0, import_useSearch.useSearch)({
69
+ props,
70
+ api,
71
+ isSearchFocus
72
+ });
68
73
  const selectedItems = (0, import_vue2.ref)([]);
69
74
  const sortOrgList = (0, import_vue2.computed)(() => {
70
75
  const departments = orgList.value.filter((item) => item.type === "dept");
@@ -133,6 +138,12 @@ var stdin_default = (0, import_vue2.defineComponent)({
133
138
  "modelValue": keyword.value,
134
139
  "onUpdate:modelValue": ($event) => keyword.value = $event,
135
140
  "placeholder": "\u641C\u7D22\u4EBA\u5458",
141
+ "onFocus": () => {
142
+ isSearchFocus.value = true;
143
+ },
144
+ "onBlur": () => {
145
+ isSearchFocus.value = false;
146
+ },
136
147
  "class": "search-bar"
137
148
  }, null), (0, import_vue.createVNode)("div", {
138
149
  "class": "org-selected-items"
@@ -37,6 +37,7 @@
37
37
  .cgx-atm .right-0{right:0rem;}
38
38
  .cgx-atm .top-0{top:0rem;}
39
39
  .cgx-atm .z-1{z-index:1;}
40
+ .cgx-atm .h-\[300px\]{height:300px;}
40
41
  .cgx-atm .flex-1{flex:1 1 0%;}
41
42
  .cgx-atm .overflow-auto{overflow:auto;}
42
43
  .cgx-atm .border-b{border-bottom-width:1px;border-bottom-style:solid;}
@@ -1,4 +1,4 @@
1
- export declare function useSearch(props: any, api: any): {
1
+ export declare function useSearch({ props, api, isSearchFocus }: any): {
2
2
  keyword: import("vue").Ref<string, string>;
3
3
  searchRef: import("vue").Ref<any, any>;
4
4
  setRecentUsers: (users: any[]) => Promise<void>;
@@ -44,7 +44,12 @@ var import_vue = require("vue");
44
44
  var import_atomic = require("./_atomic.css");
45
45
  var import_vue2 = require("vue");
46
46
  var import_vant = require("vant");
47
- function useSearch(props, api) {
47
+ const isMobile = /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);
48
+ function useSearch({
49
+ props,
50
+ api,
51
+ isSearchFocus
52
+ }) {
48
53
  const {
49
54
  orgSearchList,
50
55
  getOrgList,
@@ -114,11 +119,11 @@ function useSearch(props, api) {
114
119
  handleSelect
115
120
  }) => {
116
121
  return (0, import_vue.createVNode)("div", {
117
- "class": "absolute top-0 left-0 right-0 bottom-0 bg-[#fff] z-1"
122
+ "class": "absolute top-0 left-0 right-0 bottom-0 bg-[#fff] z-1 overflow-auto"
118
123
  }, [filterRecentSelectedHistory.value.length ? (0, import_vue.createVNode)(import_vue.Fragment, null, [(0, import_vue.createVNode)("p", {
119
124
  "class": "text-[14px] text-[#333] font-bold px-[16px] py-[12px] border-b border-[#eee]"
120
125
  }, [(0, import_vue.createTextVNode)("\u6700\u8FD1\u9009\u62E9")]), (0, import_vue.createVNode)("div", {
121
- "class": "recent-list-wrap flex-1 overflow-auto py-[8px]"
126
+ "class": "recent-list-wrap flex-1 py-[8px]"
122
127
  }, [filterRecentSelectedHistory.value.map((historyItem) => (0, import_vue.createVNode)("div", {
123
128
  "key": historyItem.id,
124
129
  "onClick": () => handleHistorySelect(historyItem),
@@ -126,22 +131,22 @@ function useSearch(props, api) {
126
131
  }, [(0, import_vue.createVNode)("span", null, [historyItem.selectedUsers.map((user) => highlightText(getUserInfoById(user.id), keyword.value)).reduce((prev, curr) => [prev, "\uFF0C", curr])])]))])]) : "", filteredOrgList.value.length ? (0, import_vue.createVNode)(import_vue.Fragment, null, [" ", (0, import_vue.createVNode)("p", {
127
132
  "class": "text-[14px] text-[#333] font-bold px-[16px] py-[12px] border-b border-[#eee]"
128
133
  }, [(0, import_vue.createTextVNode)("\u901A\u8BAF\u5F55")]), (0, import_vue.createVNode)("div", {
129
- "class": "feed-list-wrap"
134
+ "class": "px-16px"
130
135
  }, [filteredOrgList.value.length === 0 ? (0, import_vue.createVNode)(import_vant.Empty, {
131
136
  "description": "\u672A\u627E\u5230\u76F8\u5173\u4EBA\u5458"
132
- }, null) : (0, import_vue.createVNode)(import_vant.List, null, {
133
- default: () => [filteredOrgList.value.map((item) => (0, import_vue.createVNode)("div", {
134
- "class": ["org-item", isSelected(item) ? "selected" : ""],
135
- "onClick": () => handleSelect(item)
136
- }, [(0, import_vue.createVNode)(import_vant.Image, {
137
- "class": "org-avatar",
138
- "src": item.avatar
139
- }, null), (0, import_vue.createVNode)("div", {
140
- "class": "org-name"
141
- }, [item.name, (0, import_vue.createVNode)("span", {
142
- "class": "org-item-select-icon"
143
- }, [(0, import_vue.createTextVNode)("\u2713")])])]))]
144
- })])]) : ""]);
137
+ }, null) : (0, import_vue.createVNode)(import_vue.Fragment, null, [filteredOrgList.value.map((item) => (0, import_vue.createVNode)("div", {
138
+ "class": ["org-item", isSelected(item) ? "selected" : ""],
139
+ "onClick": () => handleSelect(item)
140
+ }, [(0, import_vue.createVNode)(import_vant.Image, {
141
+ "class": "org-avatar",
142
+ "src": item.avatar
143
+ }, null), (0, import_vue.createVNode)("div", {
144
+ "class": "org-name"
145
+ }, [item.name, (0, import_vue.createVNode)("span", {
146
+ "class": "org-item-select-icon"
147
+ }, [(0, import_vue.createTextVNode)("\u2713")])])]))])])]) : "", isSearchFocus.value && isMobile ? (0, import_vue.createVNode)("div", {
148
+ "class": "h-[300px]"
149
+ }, null) : ""]);
145
150
  };
146
151
  return {
147
152
  keyword,
@@ -1,8 +1,6 @@
1
- var __create = Object.create;
2
1
  var __defProp = Object.defineProperty;
3
2
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
3
  var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf;
6
4
  var __hasOwnProp = Object.prototype.hasOwnProperty;
7
5
  var __export = (target, all) => {
8
6
  for (var name in all)
@@ -16,14 +14,6 @@ var __copyProps = (to, from, except, desc) => {
16
14
  }
17
15
  return to;
18
16
  };
19
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
- // If the importer is in node compatibility mode or this is not an ESM
21
- // file that has been converted to a CommonJS file using a Babel-
22
- // compatible transform (i.e. "__esModule" has not been set), then set
23
- // "default" to the CommonJS "module.exports" for node compatibility.
24
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
- mod
26
- ));
27
17
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
18
  var stdin_exports = {};
29
19
  __export(stdin_exports, {
@@ -33,12 +23,9 @@ module.exports = __toCommonJS(stdin_exports);
33
23
  var import_vue = require("vue");
34
24
  var import_atomic = require("./_atomic.css");
35
25
  var import_vue2 = require("vue");
36
- var import_starter_kit = __toESM(require("@tiptap/starter-kit"));
37
- var import_vue_3 = require("@tiptap/vue-3");
38
- var import_extension_table = require("@tiptap/extension-table");
39
- var import_extensions = require("@tiptap/extensions");
40
26
  var import_types = require("./types");
41
27
  var import_index = require("./index.css");
28
+ var import_biz_basic = require("@cgboiler/biz-basic");
42
29
  var stdin_default = (0, import_vue2.defineComponent)({
43
30
  name: "RichTextEditor",
44
31
  props: import_types.richTextEditorProps,
@@ -46,62 +33,10 @@ var stdin_default = (0, import_vue2.defineComponent)({
46
33
  setup(props, {
47
34
  emit
48
35
  }) {
49
- const editor = (0, import_vue2.ref)();
50
- const addTableRow = () => {
51
- var _a;
52
- (_a = editor.value) == null ? void 0 : _a.chain().focus().addRowAfter().run();
53
- };
54
- const deleteTableRow = () => {
55
- var _a;
56
- (_a = editor.value) == null ? void 0 : _a.chain().focus().deleteRow().run();
57
- };
58
- const setTextFormat = (level) => {
59
- var _a, _b;
60
- if (level === 0) {
61
- (_a = editor.value) == null ? void 0 : _a.chain().focus().setParagraph().run();
62
- } else {
63
- (_b = editor.value) == null ? void 0 : _b.chain().focus().toggleHeading({
64
- level
65
- }).run();
66
- }
67
- };
68
- const showTableButtons = (0, import_vue2.ref)(false);
69
- (0, import_vue2.onMounted)(() => {
70
- editor.value = new import_vue_3.Editor({
71
- extensions: [import_starter_kit.default, import_extension_table.TableKit.configure({
72
- table: {
73
- resizable: true
74
- }
75
- }), import_extensions.Placeholder.configure({
76
- placeholder: props.placeholder
77
- })],
78
- content: props.modelValue,
79
- onUpdate: ({
80
- editor: editor2
81
- }) => {
82
- const html = editor2.getHTML();
83
- emit("update:modelValue", html);
84
- },
85
- onSelectionUpdate: ({
86
- editor: editor2
87
- }) => {
88
- showTableButtons.value = editor2.isActive("table");
89
- }
90
- });
91
- });
92
- (0, import_vue2.watch)(() => props.modelValue, (newValue) => {
93
- var _a, _b;
94
- if (((_a = editor.value) == null ? void 0 : _a.getHTML()) !== newValue) {
95
- (_b = editor.value) == null ? void 0 : _b.commands.setContent(newValue || "");
96
- }
97
- });
98
- (0, import_vue2.onBeforeUnmount)(() => {
99
- var _a;
100
- (_a = editor.value) == null ? void 0 : _a.destroy();
101
- });
102
- return () => (0, import_vue.createVNode)(import_vue_3.EditorContent, {
103
- "class": "ProseMirror",
104
- "editor": editor.value
36
+ return () => (0, import_vue.createVNode)(import_biz_basic.RichTextEditor, {
37
+ "modelValue": props.modelValue,
38
+ "onUpdate:modelValue": (val) => emit("update:modelValue", val),
39
+ "placeholder": props.placeholder
105
40
  }, null);
106
41
  }
107
42
  });
@@ -30,5 +30,3 @@
30
30
  flex-wrap: wrap;
31
31
  }
32
32
 
33
- /* layer: default */
34
- .cgx-atm .table{display:table;}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cgboiler/biz-mobile",
3
- "version": "1.17.15",
3
+ "version": "1.17.17",
4
4
  "description": "",
5
5
  "main": "lib/index.js",
6
6
  "module": "es/index.js",
@@ -50,8 +50,9 @@
50
50
  "@tiptap/vue-3": "3.0.0-beta.5",
51
51
  "lodash-es": "^4.17.21",
52
52
  "vant": "^4.9.19",
53
- "@cgboiler/core": "1.2.2",
54
- "@cgboiler/shared": "1.1.1"
53
+ "@cgboiler/shared": "1.1.1",
54
+ "@cgboiler/biz-basic": "0.0.1",
55
+ "@cgboiler/core": "1.2.2"
55
56
  },
56
57
  "scripts": {
57
58
  "dev": "cg-cli dev",