@kengic/uni 0.6.3-beta.2 → 0.6.3-beta.20

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.
@@ -3,54 +3,6 @@
3
3
  <view class="uni-easyinput__content" :class="inputContentClass" :style="inputContentStyle">
4
4
  <uni-icons v-if="prefixIcon" class="content-clear-icon" :type="prefixIcon" color="#c0c4cc" @click="onClickIcon('prefix')" size="16"></uni-icons>
5
5
  <slot name="left"></slot>
6
- <!-- #ifdef MP-ALIPAY -->
7
- <textarea
8
- :enableNative="enableNative"
9
- v-if="type === 'textarea'"
10
- class="uni-easyinput__content-textarea"
11
- :class="{ 'input-padding': inputBorder }"
12
- :name="name"
13
- :value="val"
14
- :placeholder="placeholder"
15
- :placeholderStyle="placeholderStyle"
16
- :disabled="disabled"
17
- placeholder-class="uni-easyinput__placeholder-class"
18
- :maxlength="inputMaxlength"
19
- :focus="focused"
20
- :autoHeight="autoHeight"
21
- :cursor-spacing="cursorSpacing"
22
- :adjust-position="adjustPosition"
23
- @input="onInput"
24
- @blur="_Blur"
25
- @focus="_Focus"
26
- @confirm="onConfirm"
27
- @keyboardheightchange="onkeyboardheightchange"
28
- ></textarea>
29
- <input
30
- :enableNative="enableNative"
31
- v-else
32
- :type="type === 'password' ? 'text' : type"
33
- class="uni-easyinput__content-input"
34
- :style="inputStyle"
35
- :name="name"
36
- :value="val"
37
- :password="!showPassword && type === 'password'"
38
- :placeholder="placeholder"
39
- :placeholderStyle="placeholderStyle"
40
- placeholder-class="uni-easyinput__placeholder-class"
41
- :disabled="disabled"
42
- :maxlength="inputMaxlength"
43
- :focus="focused"
44
- :confirmType="confirmType"
45
- :cursor-spacing="cursorSpacing"
46
- :adjust-position="adjustPosition"
47
- @focus="_Focus"
48
- @blur="_Blur"
49
- @input="onInput"
50
- @confirm="onConfirm"
51
- @keyboardheightchange="onkeyboardheightchange"
52
- />
53
- <!-- #endif -->
54
6
  <!-- #ifndef MP-ALIPAY -->
55
7
  <textarea
56
8
  v-if="type === 'textarea'"
@@ -60,7 +12,7 @@
60
12
  :value="val"
61
13
  :placeholder="placeholder"
62
14
  :placeholderStyle="placeholderStyle"
63
- :disabled="disabled"
15
+ :disabled="disabled || readonly"
64
16
  placeholder-class="uni-easyinput__placeholder-class"
65
17
  :maxlength="inputMaxlength"
66
18
  :focus="focused"
@@ -84,7 +36,7 @@
84
36
  :placeholder="placeholder"
85
37
  :placeholderStyle="placeholderStyle"
86
38
  placeholder-class="uni-easyinput__placeholder-class"
87
- :disabled="disabled"
39
+ :disabled="disabled || readonly"
88
40
  :maxlength="inputMaxlength"
89
41
  :focus="focused"
90
42
  :confirmType="confirmType"
@@ -98,8 +50,8 @@
98
50
  />
99
51
  <!-- #endif -->
100
52
 
53
+ <!-- 开启密码时显示小眼睛 -->
101
54
  <template v-if="type === 'password' && passwordIcon">
102
- <!-- 开启密码时显示小眼睛 -->
103
55
  <uni-icons
104
56
  v-if="isVal"
105
57
  class="content-clear-icon"
@@ -196,7 +148,7 @@
196
148
 
197
149
  export default {
198
150
  name: 'UniEasyinput',
199
- emits: ['click', 'iconClick', 'update:modelValue', 'input', 'focus', 'blur', 'confirm', 'clear', 'eyes', 'change', 'keyboardheightchange'],
151
+ emits: ['click', 'iconClick', 'update:modelValue', 'focus', 'blur', 'confirm', 'clear', 'eyes', 'change', 'keyboardheightchange'],
200
152
  model: {
201
153
  prop: 'modelValue',
202
154
  event: 'update:modelValue',
@@ -248,6 +200,14 @@
248
200
  type: Boolean,
249
201
  default: false,
250
202
  },
203
+
204
+ /**
205
+ * <p>是否只读, 跟 disabled 的区别是: 会显示清空图标.</p>
206
+ */
207
+ readonly: {
208
+ type: Boolean,
209
+ default: false,
210
+ },
251
211
  maxlength: {
252
212
  type: [Number, String],
253
213
  default: 140,
@@ -362,7 +322,7 @@
362
322
  'is-input-border': this.inputBorder,
363
323
  'is-input-error-border': this.inputBorder && this.msg,
364
324
  'is-textarea': this.type === 'textarea',
365
- 'is-disabled': this.disabled,
325
+ 'is-disabled': this.disabled || this.readonly,
366
326
  'is-focused': this.focusShow,
367
327
  });
368
328
  },
@@ -371,7 +331,7 @@
371
331
  const borderColor = this.inputBorder && this.msg ? '#dd524d' : focusColor;
372
332
  return obj2strStyle({
373
333
  'border-color': borderColor || '#e5e5e5',
374
- 'background-color': this.disabled ? this.styles.disableColor : this.styles.backgroundColor,
334
+ 'background-color': this.disabled || this.readonly ? this.styles.disableColor : this.styles.backgroundColor,
375
335
  });
376
336
  },
377
337
  // input右侧样式
@@ -459,9 +419,6 @@
459
419
  }
460
420
  if (this.errMsg) this.errMsg = '';
461
421
  this.val = value;
462
- // TODO 兼容 vue2
463
- this.$emit('input', value);
464
- // TODO 兼容 vue3
465
422
  this.$emit('update:modelValue', value);
466
423
  },
467
424
 
@@ -527,9 +484,6 @@
527
484
  */
528
485
  onClear(event) {
529
486
  this.val = '';
530
- // TODO 兼容 vue2
531
- this.$emit('input', '');
532
- // TODO 兼容 vue2
533
487
  // TODO 兼容 vue3
534
488
  this.$emit('update:modelValue', '');
535
489
  // 点击叉号触发
@@ -582,7 +536,7 @@
582
536
  position: relative;
583
537
  text-align: left;
584
538
  color: #333;
585
- font-size: 14px;
539
+ font-size: 13px;
586
540
  }
587
541
 
588
542
  .uni-easyinput__content {
@@ -609,7 +563,7 @@
609
563
  overflow: hidden;
610
564
  flex: 1;
611
565
  line-height: 1;
612
- font-size: 14px;
566
+ font-size: 13px;
613
567
  height: 24px;
614
568
  // min-height: 36px;
615
569
 
@@ -621,17 +575,16 @@
621
575
  & ::-ms-clear {
622
576
  display: none;
623
577
  }
624
-
625
- & ::-o-clear {
626
- display: none;
627
- }
628
-
629
578
  /*endif*/
630
579
  }
631
580
 
581
+ :deep(.uni-easyinput__content-input) .uni-input-input {
582
+ padding-bottom: 1px;
583
+ }
584
+
632
585
  .uni-easyinput__placeholder-class {
633
586
  color: #999;
634
- font-size: 12px;
587
+ font-size: 13px;
635
588
  // font-weight: 200;
636
589
  }
637
590
 
@@ -648,7 +601,7 @@
648
601
  overflow: hidden;
649
602
  flex: 1;
650
603
  line-height: 1.5;
651
- font-size: 14px;
604
+ font-size: 13px;
652
605
  margin: 6px;
653
606
  margin-left: 0;
654
607
  height: 80px;
@@ -737,7 +690,7 @@
737
690
 
738
691
  .uni-easyinput__placeholder-class {
739
692
  color: #d5d5d5;
740
- font-size: 12px;
693
+ font-size: 13px;
741
694
  }
742
695
  }
743
696
  </style>
package/dist/util/kg.ts CHANGED
@@ -128,7 +128,7 @@ export class Kg {
128
128
  const patch: number = Number(oldVersionSegments[2]);
129
129
 
130
130
  try {
131
- const newVersion = await API.WMS.CommonController.GetLatestApkVersion({}, { timeout: 5 * 1000 });
131
+ const newVersion = await API.WMS.CommonController.GetLatestApkVersion({}, { timeout: 5 * 1000, isSuppressSuccess: true });
132
132
 
133
133
  // 最新版本
134
134
  const newVersionSegments = newVersion.split('.');
@@ -383,7 +383,7 @@ export class Kg {
383
383
 
384
384
  //region WHERE
385
385
  // ----------------------------------------------------------------------------------------------------
386
- let whereSql = `WHERE (1 = 1)${whereSqlSegment}`;
386
+ let whereSql = `WHERE (1 = 1)${whereSqlSegment}`.replace('(1 = 1) AND ', '');
387
387
  whereSql = encodeURIComponent(whereSql);
388
388
  //endregion
389
389
 
package/package.json CHANGED
@@ -1,38 +1,34 @@
1
1
  {
2
2
  "name": "@kengic/uni",
3
- "version": "0.6.3-beta.2",
3
+ "version": "0.6.3-beta.20",
4
4
  "scripts": {
5
- "build": "npm run switch-node-version && rimraf dist && vue-tsc && vite build",
5
+ "build": "npm run use-node && rimraf dist && vue-tsc && vite build",
6
6
  "------ -------------------------------------------": "",
7
- "publish:all:major": "npm run bump-version:major && npm run publish:all",
8
- "publish:all:minor": "npm run bump-version:minor && npm run publish:all",
9
- "publish:all:patch": "npm run bump-version:patch && npm run publish:all",
10
- "publish:all:beta": "npm run bump-version:beta && npm run publish:all",
7
+ "publish:major": "npm run bump:major && tsx script/publish.ts",
8
+ "publish:minor": "npm run bump:minor && tsx script/publish.ts",
9
+ "publish:patch": "npm run bump:patch && tsx script/publish.ts",
10
+ "publish:beta": "npm run bump:beta && tsx script/publish.ts",
11
11
  "--------------------------------------------------": "",
12
- "gen:apis:WMS": "npm run switch-node-version && kengic-pont generate-apis --config kg.config.ts --origin WMS",
12
+ "gen:apis:WMS": "npm run use-node && kengic-pont generate-apis --config kg.config.ts --origin WMS",
13
13
  "- ------------------------------------------------": "",
14
- "copy-to:luotao.smartfactory.product.wms.wms--dev-3.2": "npm run build && node scripts/copy-to.luotao.smartfactory.product.wms.wms--dev-3.2.mjs --experimental-default-type=module",
15
- "copy-to:luotao.wms-pda--focus": "npm run build && node scripts/copy-to.luotao.wms-pda--focus.mjs --experimental-default-type=module",
16
- "----------- --------------------------------------": "",
17
- "bump-to:luotao.smartfactory.product.wms.wms--dev-3.2": "npm run switch-node-version && node scripts/bump-to.luotao.smartfactory.product.wms.wms--dev-3.2.mjs --experimental-default-type=module",
18
- "bump-to:luotao.wms-pda--focus": "npm run switch-node-version && node scripts/bump-to.luotao.wms-pda--focus.mjs --experimental-default-type=module",
14
+ "copy-to:luotao.smartfactory.product.wms.wms--dev-3.2": "npm run build && npx tsx script/copy-to.luotao.smartfactory.product.wms.wms--dev-3.2.ts",
15
+ "bump-to:luotao.smartfactory.product.wms.wms--dev-3.2": "npm run use-node && npx tsx script/bump-to.luotao.smartfactory.product.wms.wms--dev-3.2.ts",
19
16
  "-- -----------------------------------------------": "",
20
17
  "cnpm:sync": "npx cnpm --yes sync @kengic/uni",
21
18
  "--- ----------------------------------------------": "",
22
- "switch-node-version": "nvm use 20.11.0 && corepack enable && corepack prepare pnpm@7.30.5 --activate",
19
+ "use-node": "npm cache clean -f && nvm use 18.20.4 && corepack enable && corepack use pnpm@9.12.1",
23
20
  "---- ---------------------------------------------": "",
24
- "bump-version:major": "npm run switch-node-version && node scripts/bump.mjs major --experimental-default-type=module",
25
- "bump-version:minor": "npm run switch-node-version && node scripts/bump.mjs minor --experimental-default-type=module",
26
- "bump-version:patch": "npm run switch-node-version && node scripts/bump.mjs patch --experimental-default-type=module",
27
- "bump-version:beta": "npm run switch-node-version && node scripts/bump.mjs beta --experimental-default-type=module",
21
+ "bump:major": "npm run use-node && npx tsx script/bump.ts major",
22
+ "bump:minor": "npm run use-node && npx tsx script/bump.ts minor",
23
+ "bump:patch": "npm run use-node && npx tsx script/bump.ts patch",
24
+ "bump:beta": "npm run use-node && npx tsx script/bump.ts beta",
28
25
  "----- --------------------------------------------": "",
29
- "publish:all": "npm run switch-node-version && node scripts/publish.mjs --experimental-default-type=module",
30
- "publish:npm": "npm run switch-node-version && npmrc kengic && npm publish ./ --registry https://registry.npmjs.org/ --access public"
26
+ "publish:npm": "npm run use-node && npmrc kengic && npm publish ./ --registry https://registry.npmjs.org/ --access public"
31
27
  },
32
28
  "dependencies": {
33
29
  "@dcloudio/types": "~3.3.3",
34
30
  "@dcloudio/uni-app": "3.0.0-alpha-3080220230428001",
35
- "@kengic/pont": "1.2.15-beta.0",
31
+ "@kengic/pont": "1.2.17-beta.1",
36
32
  "@types/lodash-es": "4.17.7",
37
33
  "@types/node": "18.16.3",
38
34
  "@types/semver": "7.3.13",
@@ -45,12 +41,13 @@
45
41
  "less": "4.1.3",
46
42
  "lodash-es": "4.17.21",
47
43
  "pinia": "2.0.35",
48
- "prettier": "3.2.5",
44
+ "prettier": "3.3.3",
49
45
  "rimraf": "~3.0.2",
50
46
  "rollup": "~2.79.1",
51
47
  "sass": "1.62.1",
52
48
  "sass-loader": "10.4.1",
53
- "semver": "7.5.0",
49
+ "semver": "7.5.4",
50
+ "tsx": "3.12.3",
54
51
  "typescript": "4.9.5",
55
52
  "uuid": "~9.0.1",
56
53
  "vite": "4.3.4",
@@ -0,0 +1,3 @@
1
+ import { bumpVersionToProjects } from './bump-to.ts';
2
+
3
+ ['file:///D:/proj/kg/smartfactory.product.wms.wms--dev-3.2/wms-pda'].forEach((projectPath) => bumpVersionToProjects(projectPath, []));
@@ -0,0 +1,38 @@
1
+ import fs from 'fs';
2
+ import chalk from 'chalk';
3
+
4
+ /**
5
+ * 更新前端项目中包的版本号.
6
+ * 当我们升级了这些包的版本后, 可以使用该方法快速将新的版本号同步到前端项目中去.
7
+ *
8
+ * @param projectPath 前端项目目录.
9
+ * @param excludes 要排除的包.
10
+ */
11
+ function bumpVersionToProjects(projectPath, excludes = []) {
12
+ // file:///D:/foo/...
13
+ const pkgPath = `${projectPath}/package.json`;
14
+ // D:/foo/...
15
+ const absolutePkgPath = pkgPath.replace('file:///', '');
16
+
17
+ import(pkgPath, { with: { type: 'json' } })
18
+ .then(({ default: projectJSON }) => {
19
+ import('../package.json', { with: { type: 'json' } })
20
+ .then(({ default: packageJSON }) => {
21
+ const { version, name } = packageJSON;
22
+ if (projectJSON.dependencies[name]) {
23
+ projectJSON.dependencies[name] = version;
24
+ }
25
+
26
+ fs.writeFileSync(absolutePkgPath, `${JSON.stringify(projectJSON, null, 4)}\n`, {});
27
+ console.log(chalk.green(`版本更新成功`) + ' | ' + chalk.blue(version) + ' | ' + absolutePkgPath);
28
+ })
29
+ .catch((e) => {
30
+ console.log(e);
31
+ });
32
+ })
33
+ .catch((e) => {
34
+ console.error(e);
35
+ });
36
+ }
37
+
38
+ export { bumpVersionToProjects };
package/script/bump.ts ADDED
@@ -0,0 +1,35 @@
1
+ import fs from 'fs';
2
+ import semver from 'semver';
3
+
4
+ // ----------------------------------------------------------------------------------------------------
5
+ // 自动更新所有包的版本号
6
+ // ----------------------------------------------------------------------------------------------------
7
+
8
+ import('../package.json').then(({ default: json }) => {
9
+ const type = process.argv[2];
10
+ let version = json.version;
11
+
12
+ switch (type) {
13
+ case 'major':
14
+ version = semver.inc(version, 'major');
15
+ break;
16
+ case 'minor':
17
+ version = semver.inc(version, 'minor');
18
+ break;
19
+ case 'patch':
20
+ version = semver.inc(version, 'patch');
21
+ break;
22
+ case 'beta':
23
+ version = semver.inc(version, 'prerelease', 'beta');
24
+ break;
25
+ default:
26
+ throw new Error('INVALID SEMVER TYPE');
27
+ }
28
+
29
+ import('../package.json').then(({ default: json }) => {
30
+ json.version = version;
31
+ fs.writeFileSync('./package.json', `${JSON.stringify(json, null, 4)}\n`, {});
32
+ });
33
+ });
34
+
35
+ export {};
@@ -0,0 +1,3 @@
1
+ import { copyToProject } from './copy-to.ts';
2
+
3
+ ['D:/proj/kg/smartfactory.product.wms.wms--dev-3.2/wms-pda'].forEach((projectPath) => copyToProject(projectPath));
@@ -0,0 +1,23 @@
1
+ import fs from 'fs';
2
+ import path from 'path';
3
+
4
+ /**
5
+ * 开发时, 需要将打包后的文件复制到项目的 node_modules 目录下进行测试.
6
+ *
7
+ * @param projectPath 前端项目目录.
8
+ */
9
+ function copyToProject(projectPath) {
10
+ const cacheDir = path.join(projectPath, '/node_modules/.vite/');
11
+ if (fs.existsSync(cacheDir)) {
12
+ fs.rmSync(cacheDir, { recursive: true, force: true });
13
+ }
14
+
15
+ const dir = path.join(projectPath, '/node_modules/@kengic/uni/dist/');
16
+ if (fs.existsSync(dir)) {
17
+ fs.rmSync(dir, { recursive: true, force: true });
18
+ }
19
+
20
+ fs.cpSync('./dist/', dir, { recursive: true });
21
+ }
22
+
23
+ export { copyToProject };
@@ -0,0 +1,20 @@
1
+ import chalk from 'chalk';
2
+ import { execSync } from 'child_process';
3
+ import { name, version } from '../package.json';
4
+
5
+ /*
6
+ * 使用下面的脚本来简化打包发布流程.
7
+ */
8
+
9
+ const PKGNAME = `${name}@${version}`;
10
+
11
+ execSync('npm cache clean -f', { cwd: './', stdio: 'ignore' });
12
+ execSync('pnpm install', { cwd: './', stdio: 'ignore' });
13
+ console.log(`${chalk.blueBright('INSTALL ')}| ${PKGNAME}`);
14
+
15
+ execSync('npm run build', { cwd: './', stdio: 'ignore' });
16
+ console.log(`${chalk.blueBright(' BUILD ')}| ${PKGNAME}`);
17
+
18
+ execSync('npm run publish:npm', { cwd: './', stdio: 'ignore' });
19
+ console.log(`${chalk.blueBright('PUBLISH ')}| ${PKGNAME}`);
20
+ console.log('');
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- ## 最近一次同步的提交是 196a983af765287f539c071c0fbf6919e68a6a94
@@ -1,4 +0,0 @@
1
- `uni-sass` 是 `uni-ui`提供的一套全局样式 ,通过一些简单的类名和`sass`变量,实现简单的页面布局操作,比如颜色、边距、圆角等。
2
-
3
- ### [查看文档](https://uniapp.dcloud.io/component/uniui/uni-sass)
4
- #### 如使用过程中有任何问题,或者您对uni-ui有一些好的建议,欢迎加入 uni-ui 交流群:871950839