@aplus-frontend/ui 0.0.1-beta.4 → 0.0.1-beta.5

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.
@@ -1 +1,11 @@
1
- export declare const ProFieldDatePresetFormats: string[];
1
+ import { PickerMode } from 'ant-design-vue/es/vc-picker/interface';
2
+ import { ApFormatPresetType } from './interface';
3
+
4
+ export declare const ApFieldDatePresetFormats: string[];
5
+ export declare const PRESET_FORMAT_MAP: Record<ApFormatPresetType, string>;
6
+ export declare const PRESET_FORMAT_PICK_MAP: Record<ApFormatPresetType, PickerMode>;
7
+ export declare const PRESET_FORMAT_TIME_MAP: Record<ApFormatPresetType, {
8
+ showTime: boolean;
9
+ showSecond?: boolean;
10
+ showMinute?: boolean;
11
+ }>;
@@ -0,0 +1,3 @@
1
+ import { Dayjs } from 'dayjs';
2
+
3
+ export declare const formatDay: (d: Dayjs, f: string, begin?: boolean) => number | null;
@@ -1 +1,2 @@
1
1
  export type OmitValue<T> = Omit<T, 'value' | 'defaultValue' | 'onChange' | 'mode' | 'format'>;
2
+ export type ApFormatPresetType = 'Y' | 'Y-M' | 'Y-D' | 'Y-h' | 'Y-m' | 'Y-s';
@@ -1,5 +1,6 @@
1
1
  import { default as ApFieldText } from './text/index.vue';
2
2
  import { default as ApFiledCheckbox } from './checkbox/index.vue';
3
+ import { default as ApFiledDate } from './date/index.vue';
3
4
 
4
5
  export * from './interface';
5
- export { ApFieldText, ApFiledCheckbox };
6
+ export { ApFieldText, ApFiledCheckbox, ApFiledDate };
@@ -1,8 +1,7 @@
1
- import { InputProps, CheckboxGroupProps } from 'ant-design-vue';
1
+ import { InputProps, CheckboxGroupProps, DatePickerProps } from 'ant-design-vue';
2
2
  import { InputFocusOptions } from 'ant-design-vue/es/vc-input/utils/commonUtils';
3
- import { OmitValue } from './date/interface';
4
- import { Dayjs } from 'dayjs';
5
- import { PickerBaseProps, PickerDateProps, PickerTimeProps } from 'ant-design-vue/es/date-picker/generatePicker';
3
+ import { ApFormatPresetType } from './date/interface';
4
+ import { PanelMode } from 'ant-design-vue/es/vc-picker/interface';
6
5
 
7
6
  export type FieldMode = 'read' | 'edit';
8
7
  export type BasicApFieldProps<FieldPropsType = any> = {
@@ -21,11 +20,12 @@ export type ApFieldCheckboxProps = BasicApFieldProps<CheckboxGroupProps> & {
21
20
  emptyText?: string;
22
21
  request?: () => Promise<CheckboxGroupProps['options']>;
23
22
  };
24
- export type ApFormatPresetType = 'Y' | 'Y-M' | 'Y-D' | 'Y-h' | 'Y-m' | 'Y-s';
25
- export type ApFieldDateProps = BasicApFieldProps<OmitValue<PickerBaseProps<Dayjs>> | OmitValue<PickerDateProps<Dayjs>> | OmitValue<PickerTimeProps<Dayjs>>> & {
23
+ export type ApFieldDateProps = BasicApFieldProps<Omit<DatePickerProps, 'mode' | 'value' | 'defaultValue'>> & {
26
24
  emptyText?: string;
27
25
  value?: number | null;
28
26
  defaultValue?: number;
29
27
  onChange?: (ts: number | null, dayStr: string) => void;
28
+ onOk?: (ts: number | null) => void;
30
29
  format?: ApFormatPresetType;
30
+ pickerMode?: PanelMode | undefined;
31
31
  };
@@ -1,15 +1,15 @@
1
1
  import { ref as v, watch as c } from "vue";
2
- function V(u, f, e) {
3
- const d = (e == null ? void 0 : e.defaultValuePropName) || "defaultValue", l = (e == null ? void 0 : e.valuePropName) || "value", r = v(
4
- u[d] || (e == null ? void 0 : e.defaultValue)
2
+ function t(a, f, e) {
3
+ const d = (e == null ? void 0 : e.defaultValuePropName) || "defaultValue", u = (e == null ? void 0 : e.valuePropName) || "value", r = v(
4
+ a[d] || (e == null ? void 0 : e.defaultValue)
5
5
  );
6
- function m(a) {
7
- u[l] === void 0 && (r.value = a), f(`update:${l}`, a);
6
+ function m(l) {
7
+ a[u] === void 0 && (r.value = l), f(`update:${u}`, l);
8
8
  }
9
9
  return c(
10
- () => u[l],
11
- (a) => {
12
- u[l] !== void 0 && (console.log("set inner to ", a), r.value = a);
10
+ () => a[u],
11
+ (l) => {
12
+ a[u] !== void 0 && (r.value = l);
13
13
  },
14
14
  {
15
15
  immediate: !0
@@ -20,5 +20,5 @@ function V(u, f, e) {
20
20
  };
21
21
  }
22
22
  export {
23
- V as useControllableValue
23
+ t as useControllableValue
24
24
  };
@@ -18,7 +18,7 @@
18
18
  width: 520px;
19
19
  padding-bottom: 0;
20
20
  }
21
- .ant-modal .ant-modal-body > .scrollbar {
21
+ .ant-modal .ant-modal-body > .aplus-scrollbar {
22
22
  padding: 14px;
23
23
  }
24
24
  .ant-modal-title {
@@ -31,7 +31,7 @@
31
31
  .ant-modal .ant-modal-body {
32
32
  padding: 0;
33
33
  }
34
- .ant-modal .ant-modal-body > .scrollbar > .scrollbar__bar.is-horizontal {
34
+ .ant-modal .ant-modal-body > .aplus-scrollbar > .aplus-scrollbar__bar.is-horizontal {
35
35
  display: none;
36
36
  }
37
37
  .ant-modal-large {
@@ -18,7 +18,7 @@
18
18
  width: 520px;
19
19
  padding-bottom: 0;
20
20
  }
21
- .ant-modal .ant-modal-body > .scrollbar {
21
+ .ant-modal .ant-modal-body > .aplus-scrollbar {
22
22
  padding: 14px;
23
23
  }
24
24
  .ant-modal-title {
@@ -31,7 +31,7 @@
31
31
  .ant-modal .ant-modal-body {
32
32
  padding: 0;
33
33
  }
34
- .ant-modal .ant-modal-body > .scrollbar > .scrollbar__bar.is-horizontal {
34
+ .ant-modal .ant-modal-body > .aplus-scrollbar > .aplus-scrollbar__bar.is-horizontal {
35
35
  display: none;
36
36
  }
37
37
  .ant-modal-large {
@@ -1 +1,11 @@
1
- export declare const ProFieldDatePresetFormats: string[];
1
+ import { PickerMode } from 'ant-design-vue/es/vc-picker/interface';
2
+ import { ApFormatPresetType } from './interface';
3
+
4
+ export declare const ApFieldDatePresetFormats: string[];
5
+ export declare const PRESET_FORMAT_MAP: Record<ApFormatPresetType, string>;
6
+ export declare const PRESET_FORMAT_PICK_MAP: Record<ApFormatPresetType, PickerMode>;
7
+ export declare const PRESET_FORMAT_TIME_MAP: Record<ApFormatPresetType, {
8
+ showTime: boolean;
9
+ showSecond?: boolean;
10
+ showMinute?: boolean;
11
+ }>;
@@ -0,0 +1,3 @@
1
+ import { Dayjs } from 'dayjs';
2
+
3
+ export declare const formatDay: (d: Dayjs, f: string, begin?: boolean) => number | null;
@@ -1 +1,2 @@
1
1
  export type OmitValue<T> = Omit<T, 'value' | 'defaultValue' | 'onChange' | 'mode' | 'format'>;
2
+ export type ApFormatPresetType = 'Y' | 'Y-M' | 'Y-D' | 'Y-h' | 'Y-m' | 'Y-s';
@@ -1,5 +1,6 @@
1
1
  import { default as ApFieldText } from './text/index.vue';
2
2
  import { default as ApFiledCheckbox } from './checkbox/index.vue';
3
+ import { default as ApFiledDate } from './date/index.vue';
3
4
 
4
5
  export * from './interface';
5
- export { ApFieldText, ApFiledCheckbox };
6
+ export { ApFieldText, ApFiledCheckbox, ApFiledDate };
@@ -1,8 +1,7 @@
1
- import { InputProps, CheckboxGroupProps } from 'ant-design-vue';
1
+ import { InputProps, CheckboxGroupProps, DatePickerProps } from 'ant-design-vue';
2
2
  import { InputFocusOptions } from 'ant-design-vue/es/vc-input/utils/commonUtils';
3
- import { OmitValue } from './date/interface';
4
- import { Dayjs } from 'dayjs';
5
- import { PickerBaseProps, PickerDateProps, PickerTimeProps } from 'ant-design-vue/es/date-picker/generatePicker';
3
+ import { ApFormatPresetType } from './date/interface';
4
+ import { PanelMode } from 'ant-design-vue/es/vc-picker/interface';
6
5
 
7
6
  export type FieldMode = 'read' | 'edit';
8
7
  export type BasicApFieldProps<FieldPropsType = any> = {
@@ -21,11 +20,12 @@ export type ApFieldCheckboxProps = BasicApFieldProps<CheckboxGroupProps> & {
21
20
  emptyText?: string;
22
21
  request?: () => Promise<CheckboxGroupProps['options']>;
23
22
  };
24
- export type ApFormatPresetType = 'Y' | 'Y-M' | 'Y-D' | 'Y-h' | 'Y-m' | 'Y-s';
25
- export type ApFieldDateProps = BasicApFieldProps<OmitValue<PickerBaseProps<Dayjs>> | OmitValue<PickerDateProps<Dayjs>> | OmitValue<PickerTimeProps<Dayjs>>> & {
23
+ export type ApFieldDateProps = BasicApFieldProps<Omit<DatePickerProps, 'mode' | 'value' | 'defaultValue'>> & {
26
24
  emptyText?: string;
27
25
  value?: number | null;
28
26
  defaultValue?: number;
29
27
  onChange?: (ts: number | null, dayStr: string) => void;
28
+ onOk?: (ts: number | null) => void;
30
29
  format?: ApFormatPresetType;
30
+ pickerMode?: PanelMode | undefined;
31
31
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("vue");function v(a,d,e){const c=(e==null?void 0:e.defaultValuePropName)||"defaultValue",l=(e==null?void 0:e.valuePropName)||"value",r=t.ref(a[c]||(e==null?void 0:e.defaultValue));function f(u){a[l]===void 0&&(r.value=u),d(`update:${l}`,u)}return t.watch(()=>a[l],u=>{a[l]!==void 0&&(console.log("set inner to ",u),r.value=u)},{immediate:!0}),{value:r,updateValue:f}}exports.useControllableValue=v;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("vue");function c(u,t,e){const f=(e==null?void 0:e.defaultValuePropName)||"defaultValue",a=(e==null?void 0:e.valuePropName)||"value",r=d.ref(u[f]||(e==null?void 0:e.defaultValue));function v(l){u[a]===void 0&&(r.value=l),t(`update:${a}`,l)}return d.watch(()=>u[a],l=>{u[a]!==void 0&&(r.value=l)},{immediate:!0}),{value:r,updateValue:v}}exports.useControllableValue=c;
@@ -18,7 +18,7 @@
18
18
  width: 520px;
19
19
  padding-bottom: 0;
20
20
  }
21
- .ant-modal .ant-modal-body > .scrollbar {
21
+ .ant-modal .ant-modal-body > .aplus-scrollbar {
22
22
  padding: 14px;
23
23
  }
24
24
  .ant-modal-title {
@@ -31,7 +31,7 @@
31
31
  .ant-modal .ant-modal-body {
32
32
  padding: 0;
33
33
  }
34
- .ant-modal .ant-modal-body > .scrollbar > .scrollbar__bar.is-horizontal {
34
+ .ant-modal .ant-modal-body > .aplus-scrollbar > .aplus-scrollbar__bar.is-horizontal {
35
35
  display: none;
36
36
  }
37
37
  .ant-modal-large {
@@ -18,7 +18,7 @@
18
18
  width: 520px;
19
19
  padding-bottom: 0;
20
20
  }
21
- .ant-modal .ant-modal-body > .scrollbar {
21
+ .ant-modal .ant-modal-body > .aplus-scrollbar {
22
22
  padding: 14px;
23
23
  }
24
24
  .ant-modal-title {
@@ -31,7 +31,7 @@
31
31
  .ant-modal .ant-modal-body {
32
32
  padding: 0;
33
33
  }
34
- .ant-modal .ant-modal-body > .scrollbar > .scrollbar__bar.is-horizontal {
34
+ .ant-modal .ant-modal-body > .aplus-scrollbar > .aplus-scrollbar__bar.is-horizontal {
35
35
  display: none;
36
36
  }
37
37
  .ant-modal-large {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aplus-frontend/ui",
3
- "version": "0.0.1-beta.4",
3
+ "version": "0.0.1-beta.5",
4
4
  "main": "lib/index.js",
5
5
  "module": "es/index.mjs",
6
6
  "files": [
@@ -51,8 +51,8 @@
51
51
  "dayjs": "^1.11.11",
52
52
  "lodash-unified": "^1.0.3",
53
53
  "sortablejs": "^1.15.2",
54
- "@aplus-frontend/hooks": "1.0.2",
55
- "@aplus-frontend/utils": "1.0.5"
54
+ "@aplus-frontend/utils": "1.0.5",
55
+ "@aplus-frontend/hooks": "1.0.2"
56
56
  },
57
57
  "peerDependencies": {
58
58
  "ant-design-vue": "^4.2.1"