@94ai/common-ui 4.0.22 → 5.0.1

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/components.d.ts CHANGED
@@ -44,6 +44,7 @@ declare module 'vue' {
44
44
  NfTable: typeof import('@94ai/nf-table/lib/nf-table.vue')['default']
45
45
  NfTag: typeof import('@94ai/nf-tag/lib/nf-tag.vue')['default']
46
46
  NfTextOverflow: typeof import('@94ai/nf-text-overflow/lib/nf-text-overflow.vue')['default']
47
+ NfTimezonePicker: typeof import('@94ai/nf-timezone-picker/lib/nf-timezone-picker.vue')['default']
47
48
  NfToastDemo: typeof import('@94ai/nf-toast-demo/lib/nf-toast-demo.vue')['default']
48
49
  NfTransferSelect: typeof import('@94ai/nf-transfer-select/lib/nf-transfer-select.vue')['default']
49
50
  NfVariableSelect: typeof import('@94ai/nf-variable-select/lib/nf-variable-select.vue')['default']
@@ -46,6 +46,7 @@ const NfAddressSelect = require("@94ai/nf-address-select");
46
46
  const NfSoftphone = require("@94ai/nf-softphone");
47
47
  const NfInput = require("@94ai/nf-input");
48
48
  const NfMicrophone = require("@94ai/nf-microphone");
49
+ const NfTimezonePicker = require("@94ai/nf-timezone-picker");
49
50
  const CommonUI = vueDemi.defineComponent({
50
51
  name: "common-ui",
51
52
  install(app) {
@@ -94,7 +95,8 @@ const CommonUI = vueDemi.defineComponent({
94
95
  NfAddressSelect,
95
96
  NfSoftphone,
96
97
  NfInput,
97
- NfMicrophone
98
+ NfMicrophone,
99
+ NfTimezonePicker
98
100
  ].forEach((component) => {
99
101
  app.use(component);
100
102
  });
@@ -164,4 +166,5 @@ Object.defineProperty(exports, "softphoneManager", {
164
166
  get: () => NfSoftphone.softphoneManager
165
167
  });
166
168
  exports.NfMicrophone = NfMicrophone;
169
+ exports.NfTimezonePicker = NfTimezonePicker;
167
170
  exports.default = CommonUI;
@@ -88,6 +88,8 @@ import { default as default44, SoftphoneManager, softphoneManager } from "@94ai/
88
88
  import NfInput from "@94ai/nf-input";
89
89
  import NfMicrophone from "@94ai/nf-microphone";
90
90
  import { default as default45 } from "@94ai/nf-microphone";
91
+ import NfTimezonePicker from "@94ai/nf-timezone-picker";
92
+ import { default as default46 } from "@94ai/nf-timezone-picker";
91
93
  const CommonUI = defineComponent({
92
94
  name: "common-ui",
93
95
  install(app) {
@@ -136,7 +138,8 @@ const CommonUI = defineComponent({
136
138
  NfAddressSelect,
137
139
  NfSoftphone,
138
140
  NfInput,
139
- NfMicrophone
141
+ NfMicrophone,
142
+ NfTimezonePicker
140
143
  ].forEach((component) => {
141
144
  app.use(component);
142
145
  });
@@ -185,6 +188,7 @@ export {
185
188
  default24 as NfTable,
186
189
  default12 as NfTag,
187
190
  default30 as NfTextOverflow,
191
+ default46 as NfTimezonePicker,
188
192
  default3 as NfToastDemo,
189
193
  default42 as NfTransferSelect,
190
194
  default38 as NfVariableSelect,
@@ -359,6 +359,54 @@ const copyFile = (sourcePath, targetPath) => {
359
359
  fs.copyFileSync(newSourcePath, newTargetPath);
360
360
  });
361
361
  };
362
+ const add = (arg1, arg2) => {
363
+ let r1, r2, m;
364
+ try {
365
+ r1 = (arg1.toString().split(".")[1] || "").length;
366
+ } catch (e) {
367
+ r1 = 0;
368
+ }
369
+ try {
370
+ r2 = (arg2.toString().split(".")[1] || "").length;
371
+ } catch (e) {
372
+ r2 = 0;
373
+ }
374
+ m = Math.pow(10, Math.max(r1, r2));
375
+ return div(mul(arg1, m) + mul(arg2, m), m);
376
+ };
377
+ const mul = (arg1, arg2) => {
378
+ let m = 0;
379
+ const s1 = arg1.toString();
380
+ const s2 = arg2.toString();
381
+ m += (s1.split(".")[1] || "").length;
382
+ m += (s2.split(".")[1] || "").length;
383
+ return Number(s1.replace(".", "")) * Number(s2.replace(".", "")) / Math.pow(10, m);
384
+ };
385
+ const div = (arg1, arg2) => {
386
+ const t1 = (arg1.toString().split(".")[1] || "").length;
387
+ const t2 = (arg2.toString().split(".")[1] || "").length;
388
+ const r1 = Number(arg1.toString().replace(".", ""));
389
+ const r2 = Number(arg2.toString().replace(".", ""));
390
+ return r1 / r2 * Math.pow(10, t2 - t1);
391
+ };
392
+ function getLocalTime(i) {
393
+ let time = i;
394
+ if (typeof time === "string") {
395
+ const arr = time.split(":");
396
+ if (arr.length < 2) {
397
+ return /* @__PURE__ */ new Date();
398
+ }
399
+ time = add(Number(arr[0]), div(Math.floor(Number(arr[1])), 60));
400
+ }
401
+ if (typeof time !== "number") {
402
+ return /* @__PURE__ */ new Date();
403
+ }
404
+ const d = /* @__PURE__ */ new Date();
405
+ const len = d.getTime();
406
+ const offset = d.getTimezoneOffset() * 6e4;
407
+ const utcTime = len + offset;
408
+ return new Date(utcTime + 36e5 * time);
409
+ }
362
410
  function toPascalCase(str) {
363
411
  const camelCase = str.replace(/-([a-z])/g, function(_match, letter) {
364
412
  return letter.toUpperCase();
@@ -388,6 +436,7 @@ const tool = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty
388
436
  getHalfYear,
389
437
  getJsComponentSampleConfig,
390
438
  getLightColor,
439
+ getLocalTime,
391
440
  getNextYear,
392
441
  getQuarter,
393
442
  getResolver,
@@ -425,6 +474,7 @@ exports.getFlexDirection = getFlexDirection;
425
474
  exports.getHalfYear = getHalfYear;
426
475
  exports.getJsComponentSampleConfig = getJsComponentSampleConfig;
427
476
  exports.getLightColor = getLightColor;
477
+ exports.getLocalTime = getLocalTime;
428
478
  exports.getNextYear = getNextYear;
429
479
  exports.getQuarter = getQuarter;
430
480
  exports.getResolver = getResolver;
@@ -357,6 +357,54 @@ const copyFile = (sourcePath, targetPath) => {
357
357
  fs.copyFileSync(newSourcePath, newTargetPath);
358
358
  });
359
359
  };
360
+ const add = (arg1, arg2) => {
361
+ let r1, r2, m;
362
+ try {
363
+ r1 = (arg1.toString().split(".")[1] || "").length;
364
+ } catch (e) {
365
+ r1 = 0;
366
+ }
367
+ try {
368
+ r2 = (arg2.toString().split(".")[1] || "").length;
369
+ } catch (e) {
370
+ r2 = 0;
371
+ }
372
+ m = Math.pow(10, Math.max(r1, r2));
373
+ return div(mul(arg1, m) + mul(arg2, m), m);
374
+ };
375
+ const mul = (arg1, arg2) => {
376
+ let m = 0;
377
+ const s1 = arg1.toString();
378
+ const s2 = arg2.toString();
379
+ m += (s1.split(".")[1] || "").length;
380
+ m += (s2.split(".")[1] || "").length;
381
+ return Number(s1.replace(".", "")) * Number(s2.replace(".", "")) / Math.pow(10, m);
382
+ };
383
+ const div = (arg1, arg2) => {
384
+ const t1 = (arg1.toString().split(".")[1] || "").length;
385
+ const t2 = (arg2.toString().split(".")[1] || "").length;
386
+ const r1 = Number(arg1.toString().replace(".", ""));
387
+ const r2 = Number(arg2.toString().replace(".", ""));
388
+ return r1 / r2 * Math.pow(10, t2 - t1);
389
+ };
390
+ function getLocalTime(i) {
391
+ let time = i;
392
+ if (typeof time === "string") {
393
+ const arr = time.split(":");
394
+ if (arr.length < 2) {
395
+ return /* @__PURE__ */ new Date();
396
+ }
397
+ time = add(Number(arr[0]), div(Math.floor(Number(arr[1])), 60));
398
+ }
399
+ if (typeof time !== "number") {
400
+ return /* @__PURE__ */ new Date();
401
+ }
402
+ const d = /* @__PURE__ */ new Date();
403
+ const len = d.getTime();
404
+ const offset = d.getTimezoneOffset() * 6e4;
405
+ const utcTime = len + offset;
406
+ return new Date(utcTime + 36e5 * time);
407
+ }
360
408
  function toPascalCase(str) {
361
409
  const camelCase = str.replace(/-([a-z])/g, function(_match, letter) {
362
410
  return letter.toUpperCase();
@@ -386,6 +434,7 @@ const tool = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty
386
434
  getHalfYear,
387
435
  getJsComponentSampleConfig,
388
436
  getLightColor,
437
+ getLocalTime,
389
438
  getNextYear,
390
439
  getQuarter,
391
440
  getResolver,
@@ -424,6 +473,7 @@ export {
424
473
  getHalfYear,
425
474
  getJsComponentSampleConfig,
426
475
  getLightColor,
476
+ getLocalTime,
427
477
  getNextYear,
428
478
  getQuarter,
429
479
  getResolver,
package/lib/index.d.ts CHANGED
@@ -43,8 +43,9 @@ import NfTransferSelect from '@94ai/nf-transfer-select';
43
43
  import NfAddressSelect from '@94ai/nf-address-select';
44
44
  import NfSoftphone, { softphoneManager, SoftphoneManager } from '@94ai/nf-softphone';
45
45
  import NfMicrophone from '@94ai/nf-microphone';
46
+ import NfTimezonePicker from '@94ai/nf-timezone-picker';
46
47
  declare const _default: import("vue/types/v3-component-public-instance").ComponentPublicInstanceConstructor<import("vue/types/v3-component-public-instance").Vue3Instance<{}, Readonly<import("vue-demi").ExtractPropTypes<{}>>, Readonly<import("vue-demi").ExtractPropTypes<{}>>, {}, {}, true, import("vue/types/v3-component-options").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, any>> & Readonly<Readonly<import("vue-demi").ExtractPropTypes<{}>>> & import("vue-demi").ShallowUnwrapRef<{}> & import("vue/types/v3-component-options").ExtractComputedReturns<{}> & import("vue-demi").ComponentCustomProperties & Readonly<import("vue-demi").ExtractPropTypes<{}>>, any, any, any, import("vue-demi").ComponentComputedOptions, import("vue-demi").ComponentMethodOptions> & import("vue/types/v3-component-options").ComponentOptionsBase<Readonly<import("vue-demi").ExtractPropTypes<{}>>, unknown, {}, {}, {}, import("vue/types/v3-component-options").ComponentOptionsMixin, import("vue/types/v3-component-options").ComponentOptionsMixin, {}, string, {}> & {
47
48
  props: {};
48
49
  } & PluginObject<undefined>;
49
50
  export default _default;
50
- export { NfButtonDemo, NfToastDemo, NfMenu, NfInfiniteMenu, NfDoubleTime, NfEmpty, NfImportTemplate, NfRadioGroup, NfAlert, NfVirtualSelect, NfTag, NfAction, NfIndicatorPlane, NfQuarterPicker, NfDoubleQuarter, NfDoubleHalfYear, NfHalfYearPicker, NfDoubleWeek, NfDoubleYear, NfDatePicker, NfFormItem, NfForm, NfTable, NfSearchForm, NfDrawer, NfMessage, Message, NfNotification, Notification, NfConfirm, Confirm, NfTextOverflow, NfResizablePanels, NfAudio, NfButton, NfIconfontIcon, NfSvgIcon, NfKeywords, NfConditions, NfVariableSelect, NfRules, NfLazySelect, NfPopupLazySelect, NfTransferSelect, NfAddressSelect, NfSoftphone, NfMicrophone, softphoneManager, SoftphoneManager };
51
+ export { NfButtonDemo, NfToastDemo, NfMenu, NfInfiniteMenu, NfDoubleTime, NfEmpty, NfImportTemplate, NfRadioGroup, NfAlert, NfVirtualSelect, NfTag, NfAction, NfIndicatorPlane, NfQuarterPicker, NfDoubleQuarter, NfDoubleHalfYear, NfHalfYearPicker, NfDoubleWeek, NfDoubleYear, NfDatePicker, NfFormItem, NfForm, NfTable, NfSearchForm, NfDrawer, NfMessage, Message, NfNotification, Notification, NfConfirm, Confirm, NfTextOverflow, NfResizablePanels, NfAudio, NfButton, NfIconfontIcon, NfSvgIcon, NfKeywords, NfConditions, NfVariableSelect, NfRules, NfLazySelect, NfPopupLazySelect, NfTransferSelect, NfAddressSelect, NfSoftphone, NfMicrophone, softphoneManager, SoftphoneManager, NfTimezonePicker };
package/package/index.ts CHANGED
@@ -48,6 +48,7 @@ import NfAddressSelect from '@94ai/nf-address-select'
48
48
  import NfSoftphone, { softphoneManager, SoftphoneManager } from '@94ai/nf-softphone'
49
49
  import NfInput from '@94ai/nf-input'
50
50
  import NfMicrophone from '@94ai/nf-microphone'
51
+ import NfTimezonePicker from '@94ai/nf-timezone-picker'
51
52
 
52
53
 
53
54
  const CommonUI = defineComponent({
@@ -99,6 +100,7 @@ const CommonUI = defineComponent({
99
100
  NfSoftphone,
100
101
  NfInput,
101
102
  NfMicrophone,
103
+ NfTimezonePicker,
102
104
  ].forEach((component) => {
103
105
  app!.use(component)
104
106
  })
@@ -156,6 +158,7 @@ export {
156
158
  NfSoftphone,
157
159
  NfMicrophone,
158
160
  softphoneManager,
159
- SoftphoneManager
161
+ SoftphoneManager,
162
+ NfTimezonePicker
160
163
  }
161
164
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@94ai/common-ui",
3
- "version": "4.0.22",
3
+ "version": "5.0.1",
4
4
  "description": "94智能公共组件库",
5
5
  "keywords": [
6
6
  "组件库"
@@ -16,53 +16,54 @@
16
16
  "url": "http://94ai.gitlab.com/zoujiahe/common-ui.git"
17
17
  },
18
18
  "dependencies": {
19
- "@94ai/common-utils": "^4.0.22",
20
- "@94ai/nf-action": "^4.0.22",
21
- "@94ai/nf-address-select": "^4.0.22",
22
- "@94ai/nf-alert": "^4.0.22",
23
- "@94ai/nf-audio": "^4.0.22",
24
- "@94ai/nf-button": "^4.0.22",
25
- "@94ai/nf-button-demo": "^4.0.22",
26
- "@94ai/nf-conditions": "^4.0.22",
27
- "@94ai/nf-confirm": "^4.0.22",
28
- "@94ai/nf-date-picker": "^4.0.22",
29
- "@94ai/nf-double-half-year": "^4.0.22",
30
- "@94ai/nf-double-quarter": "^4.0.22",
31
- "@94ai/nf-double-time": "^4.0.22",
32
- "@94ai/nf-double-week": "^4.0.22",
33
- "@94ai/nf-double-year": "^4.0.22",
34
- "@94ai/nf-drawer": "^4.0.22",
35
- "@94ai/nf-empty": "^4.0.22",
36
- "@94ai/nf-form": "^4.0.22",
37
- "@94ai/nf-form-item": "^4.0.22",
38
- "@94ai/nf-half-year-picker": "^4.0.22",
39
- "@94ai/nf-iconfont-icon": "^4.0.22",
40
- "@94ai/nf-import-template": "^4.0.22",
41
- "@94ai/nf-indicator-plane": "^4.0.22",
42
- "@94ai/nf-infinite-menu": "^4.0.22",
43
- "@94ai/nf-input": "^4.0.22",
44
- "@94ai/nf-keywords": "^4.0.22",
45
- "@94ai/nf-lazy-select": "^4.0.22",
46
- "@94ai/nf-menu": "^4.0.22",
47
- "@94ai/nf-message": "^4.0.22",
48
- "@94ai/nf-microphone": "^4.0.22",
49
- "@94ai/nf-notification": "^4.0.22",
50
- "@94ai/nf-popup-lazy-select": "^4.0.22",
51
- "@94ai/nf-quarter-picker": "^4.0.22",
52
- "@94ai/nf-radio-group": "^4.0.22",
53
- "@94ai/nf-resizable-panels": "^4.0.22",
54
- "@94ai/nf-rules": "^4.0.22",
55
- "@94ai/nf-search-form": "^4.0.22",
56
- "@94ai/nf-softphone": "^4.0.22",
57
- "@94ai/nf-svg-icon": "^4.0.22",
58
- "@94ai/nf-table": "^4.0.22",
59
- "@94ai/nf-tag": "^4.0.22",
60
- "@94ai/nf-text-overflow": "^4.0.22",
61
- "@94ai/nf-theme-chalk": "^4.0.22",
62
- "@94ai/nf-toast-demo": "^4.0.22",
63
- "@94ai/nf-transfer-select": "^4.0.22",
64
- "@94ai/nf-variable-select": "^4.0.22",
65
- "@94ai/nf-virtual-select": "^4.0.22",
19
+ "@94ai/common-utils": "^5.0.1",
20
+ "@94ai/nf-action": "^5.0.1",
21
+ "@94ai/nf-address-select": "^5.0.1",
22
+ "@94ai/nf-alert": "^5.0.1",
23
+ "@94ai/nf-audio": "^5.0.1",
24
+ "@94ai/nf-button": "^5.0.1",
25
+ "@94ai/nf-button-demo": "^5.0.1",
26
+ "@94ai/nf-conditions": "^5.0.1",
27
+ "@94ai/nf-confirm": "^5.0.1",
28
+ "@94ai/nf-date-picker": "^5.0.1",
29
+ "@94ai/nf-double-half-year": "^5.0.1",
30
+ "@94ai/nf-double-quarter": "^5.0.1",
31
+ "@94ai/nf-double-time": "^5.0.1",
32
+ "@94ai/nf-double-week": "^5.0.1",
33
+ "@94ai/nf-double-year": "^5.0.1",
34
+ "@94ai/nf-drawer": "^5.0.1",
35
+ "@94ai/nf-empty": "^5.0.1",
36
+ "@94ai/nf-form": "^5.0.1",
37
+ "@94ai/nf-form-item": "^5.0.1",
38
+ "@94ai/nf-half-year-picker": "^5.0.1",
39
+ "@94ai/nf-iconfont-icon": "^5.0.1",
40
+ "@94ai/nf-import-template": "^5.0.1",
41
+ "@94ai/nf-indicator-plane": "^5.0.1",
42
+ "@94ai/nf-infinite-menu": "^5.0.1",
43
+ "@94ai/nf-input": "^5.0.1",
44
+ "@94ai/nf-keywords": "^5.0.1",
45
+ "@94ai/nf-lazy-select": "^5.0.1",
46
+ "@94ai/nf-menu": "^5.0.1",
47
+ "@94ai/nf-message": "^5.0.1",
48
+ "@94ai/nf-microphone": "^5.0.1",
49
+ "@94ai/nf-notification": "^5.0.1",
50
+ "@94ai/nf-popup-lazy-select": "^5.0.1",
51
+ "@94ai/nf-quarter-picker": "^5.0.1",
52
+ "@94ai/nf-radio-group": "^5.0.1",
53
+ "@94ai/nf-resizable-panels": "^5.0.1",
54
+ "@94ai/nf-rules": "^5.0.1",
55
+ "@94ai/nf-search-form": "^5.0.1",
56
+ "@94ai/nf-softphone": "^5.0.1",
57
+ "@94ai/nf-svg-icon": "^5.0.1",
58
+ "@94ai/nf-table": "^5.0.1",
59
+ "@94ai/nf-tag": "^5.0.1",
60
+ "@94ai/nf-text-overflow": "^5.0.1",
61
+ "@94ai/nf-theme-chalk": "^5.0.1",
62
+ "@94ai/nf-timezone-picker": "^5.0.1",
63
+ "@94ai/nf-toast-demo": "^5.0.1",
64
+ "@94ai/nf-transfer-select": "^5.0.1",
65
+ "@94ai/nf-variable-select": "^5.0.1",
66
+ "@94ai/nf-virtual-select": "^5.0.1",
66
67
  "lodash-es": "^4.17.21",
67
68
  "vue-demi": "^0.14.5"
68
69
  },
@@ -96,5 +97,5 @@
96
97
  "import": "./lib/common-ui.tool.esm-bundler.mjs"
97
98
  }
98
99
  },
99
- "gitHead": "4aaddb6db6a7fb10949063a28552549aa51bd117"
100
+ "gitHead": "6ce64e4667a262706f4577c008871a42b69edef4"
100
101
  }