@aplus-frontend/ui 6.40.0 → 7.0.0-beta.0

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.
Files changed (77) hide show
  1. package/es/src/ag-grid/editable/form-item.vue.mjs +1 -0
  2. package/es/src/ag-grid/editable/index.vue.mjs +1 -0
  3. package/es/src/ag-grid/editable/interface.d.ts +1 -0
  4. package/es/src/ag-grid/hooks/use-columns-def.mjs +27 -26
  5. package/es/src/ag-grid/hooks/use-editable-columns.mjs +65 -59
  6. package/es/src/ag-grid/index.vue.mjs +38 -33
  7. package/es/src/ag-grid/interface.d.ts +12 -1
  8. package/es/src/ag-grid/theme.d.ts +2 -1
  9. package/es/src/ag-grid/theme.mjs +12 -11
  10. package/es/src/ap-action/item/index.vue2.mjs +14 -12
  11. package/es/src/ap-action/style/index.d.ts +8 -0
  12. package/es/src/ap-action/style/index.js +61 -0
  13. package/es/src/ap-action/style/index.mjs +74 -0
  14. package/es/src/ap-grid/utils/col.mjs +91 -82
  15. package/es/src/config-provider/config-provider-props.d.ts +7 -0
  16. package/es/src/config-provider/config-provider-props.mjs +6 -0
  17. package/es/src/config-provider/config-provider.d.ts +7 -0
  18. package/es/src/config-provider/config-provider.mjs +11 -10
  19. package/es/src/config-provider/hooks/use-global-config.d.ts +4 -0
  20. package/es/src/config-provider/hooks/use-global-config.mjs +27 -22
  21. package/es/src/config-provider/hooks/use-token.d.ts +4 -0
  22. package/es/src/config-provider/hooks/use-token.mjs +6 -0
  23. package/es/src/config-provider/index.d.ts +10 -0
  24. package/es/src/design-token/constants.d.ts +2 -0
  25. package/es/src/design-token/constants.mjs +44 -0
  26. package/es/src/design-token/interface.d.ts +123 -0
  27. package/es/src/style/index.d.ts +3 -0
  28. package/es/src/style/index.js +12 -0
  29. package/es/src/style/index.mjs +13 -0
  30. package/es/src/utils/cssinjs/index.d.ts +8 -0
  31. package/es/src/utils/cssinjs/index.mjs +56 -0
  32. package/es/src/version.d.ts +1 -1
  33. package/es/src/version.mjs +1 -1
  34. package/lib/src/ag-grid/editable/form-item.vue.js +1 -1
  35. package/lib/src/ag-grid/editable/index.vue.js +1 -1
  36. package/lib/src/ag-grid/editable/interface.d.ts +1 -0
  37. package/lib/src/ag-grid/hooks/use-columns-def.js +1 -1
  38. package/lib/src/ag-grid/hooks/use-editable-columns.js +1 -1
  39. package/lib/src/ag-grid/index.vue.js +1 -1
  40. package/lib/src/ag-grid/interface.d.ts +12 -1
  41. package/lib/src/ag-grid/theme.d.ts +2 -1
  42. package/lib/src/ag-grid/theme.js +1 -1
  43. package/lib/src/ap-action/item/index.vue2.js +1 -1
  44. package/lib/src/ap-action/style/index.cjs +61 -0
  45. package/lib/src/ap-action/style/index.d.ts +8 -0
  46. package/lib/src/ap-action/style/index.js +1 -0
  47. package/lib/src/ap-grid/utils/col.js +1 -1
  48. package/lib/src/config-provider/config-provider-props.d.ts +7 -0
  49. package/lib/src/config-provider/config-provider-props.js +1 -1
  50. package/lib/src/config-provider/config-provider.d.ts +7 -0
  51. package/lib/src/config-provider/config-provider.js +1 -1
  52. package/lib/src/config-provider/hooks/use-global-config.d.ts +4 -0
  53. package/lib/src/config-provider/hooks/use-global-config.js +1 -1
  54. package/lib/src/config-provider/hooks/use-token.d.ts +4 -0
  55. package/lib/src/config-provider/hooks/use-token.js +1 -0
  56. package/lib/src/config-provider/index.d.ts +10 -0
  57. package/lib/src/design-token/constants.d.ts +2 -0
  58. package/lib/src/design-token/constants.js +1 -0
  59. package/lib/src/design-token/interface.d.ts +123 -0
  60. package/lib/src/style/index.cjs +12 -0
  61. package/lib/src/style/index.d.ts +3 -0
  62. package/lib/src/style/index.js +1 -0
  63. package/lib/src/utils/cssinjs/index.d.ts +8 -0
  64. package/lib/src/utils/cssinjs/index.js +1 -0
  65. package/lib/src/version.d.ts +1 -1
  66. package/lib/src/version.js +1 -1
  67. package/package.json +3 -1
  68. package/theme/ag-grid/index.css +0 -56
  69. package/theme/ag-grid-modal/index.css +0 -56
  70. package/theme/ap-action/item.css +0 -56
  71. package/theme/ap-action/item.less +1 -58
  72. package/theme/ap-grid/index.css +0 -56
  73. package/theme/ap-table/ap-table.css +0 -56
  74. package/theme/ap-table-modal/index.css +0 -56
  75. package/theme/editable-table/index.css +0 -56
  76. package/theme/index.css +0 -56
  77. package/theme/index.less +1 -1
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("vue"),l=require("lodash-unified"),u=require("../../ap-table/utils.js"),x=require("../../ap-table/constants.js");require("../../ap-table/components/paragraph-ellipsis/index.vue.js");const q=require("../../ap-table/components/paragraph-ellipsis/index.vue2.js");function h(e,t){if(t)return l.isArray(t)?t.reduce((r,n)=>r?.[n],e):e?.[t]}function y(e){if(!l.isUndefined(e))return l.isArray(e)?e.reduce((t,r)=>l.isString(r)?`${t}${t?".":""}${r}`:`${t}[${r}]`,""):String(e)}function b(e){if(e)return e===!0?"left":e}function A(e){return l.isBoolean(e)?{sortable:e}:e?{sortable:!0,sortType:e?.type,sortBy:e?.by}:{sortable:!1}}function N(e){let t;return l.isBoolean(e.filters)&&e.valueEnum?t=u.valueEnumToArray(e.valueEnum):t=e.filters,t?.map(r=>({label:l.isString(r.text)?r.text:"",value:r.value}))}function R(e){if(e)return t=>e(t.value,t.row)}function S(e,t){return e?l.isNumber(e)?{tooltip:t,rows:e}:e===!0||e==="tooltip"?{tooltip:t,rows:1}:{tooltip:null,rows:1,htmlTitle:e==="title"?t:""}:!1}function V(e,t,r){if(x.noRenderAsFormItemValueList.includes(e.valueType))return r;if(e.copyable||e.ellipsis){const n=S(e.ellipsis,t),i=u.objectToString(t);return f.createVNode(q.default,{rawValue:i,copyable:e.copyable,ellipsis:n,content:r},null)}return r}function c(e,t,r){const n=l.pick(e,["width","minWidth","align"]);return n.field=y(e.dataIndex),n.fixed=b(e.fixed),n.slots={header:()=>u.getTableTitle(e,r,void 0,t)},n.headerAlign=e.align,n.showOverflow=!1,n.showFooterOverflow=!1,n}const v=({value:e,...t},r,n,i=!0)=>{const a=u.getTableRenderType(r),d=u.getTableRenderProps({...r,valueType:a},{value:e,...t}),s=u.getTableCellRenderNode(a,d,t.record,n),o=r.renderText?.({value:e,...t})||e,F=r.renderText?f.createVNode(f.Fragment,null,[r.renderText?.({value:e,...t})]):s;let p=i?V(r,o,F):F;return r.customRender&&(p=r.customRender({value:e,...t,column:r,originalNode:p,originalText:o})),f.createVNode(f.Fragment,null,[p])};function T(e,t,r,n){const i=l.pick(e,["width","minWidth","align","resizable","className","headerClassName","footerClassName","treeNode"]);i.field=y(e.dataIndex),i.fixed=b(e.fixed),i.headerAlign=e.align,i.footerAlign=e.align,i.showOverflow=!1,i.showFooterOverflow=!1,Object.assign(i,A(e.sorter)),i.filters=N(e),i.filterMultiple=e.filterMultiple,i.filterMethod=R(e.onFilter);const a=({row:d,rowIndex:s})=>v({value:h(d,e.dataIndex),text:h(d,e.dataIndex),record:d,index:s,renderIndex:s,column:e},e,n);return i.slots={header:()=>u.getTableTitle(e,r,void 0,t),default:a,footer:a},e.html&&(delete i.slots.default,delete i.slots.footer,i.type="html"),e.seq&&(i.type="seq",i.slots={}),i}function _(e,t,r,n){if(!e.children?.length)return T(e,t,r,n);function i(d){return d.map(s=>{if(s.children?.length){const o=c(s,t,r);return o.children=i(s.children),o}return T(s,t,r,n)})}const a=c(e,t,r);return a.children=i(e.children),a}exports.contentCustom=v;exports.dataIndexToField=y;exports.getValueByDataIndex=h;exports.transformCol=_;exports.transformFixed=b;exports.transformToColGroup=c;exports.transformToColumn=T;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("vue"),l=require("lodash-unified"),u=require("../../ap-table/utils.js"),q=require("../../ap-table/constants.js");require("../../ap-table/components/paragraph-ellipsis/index.vue.js");const A=require("../../ap-table/components/paragraph-ellipsis/index.vue2.js");function p(e,t){if(t)return l.isArray(t)?t.reduce((r,i)=>r?.[i],e):e?.[t]}function y(e){if(!l.isUndefined(e))return l.isArray(e)?e.reduce((t,r)=>l.isString(r)?`${t}${t?".":""}${r}`:`${t}[${r}]`,""):String(e)}function b(e){if(e)return e===!0?"left":e}function N(e){return l.isBoolean(e)?{sortable:e}:e?{sortable:!0,sortType:e?.type,sortBy:e?.by}:{sortable:!1}}function R(e){let t;return l.isBoolean(e.filters)&&e.valueEnum?t=u.valueEnumToArray(e.valueEnum):t=e.filters,t?.map(r=>({label:l.isString(r.text)?r.text:"",value:r.value}))}function _(e){if(e)return t=>e(t.value,t.row)}function V(e,t){return e?l.isNumber(e)?{tooltip:t,rows:e}:e===!0||e==="tooltip"?{tooltip:t,rows:1}:{tooltip:null,rows:1,htmlTitle:e==="title"?t:""}:!1}function O(e,t,r){if(q.noRenderAsFormItemValueList.includes(e.valueType))return r;if(e.copyable||e.ellipsis){const i=V(e.ellipsis,t),n=u.objectToString(t);return f.createVNode(A.default,{rawValue:n,copyable:e.copyable,ellipsis:i,content:r},null)}return r}function c(e,t,r){const i=l.pick(e,["width","minWidth","align"]);return i.field=y(e.dataIndex),i.fixed=b(e.fixed),i.slots={header:()=>u.getTableTitle(e,r,void 0,t)},i.headerAlign=e.align,i.showOverflow=!1,i.showFooterOverflow=!1,i}function g(e,t,r){if(r)return l.isString(r)?e[r]:r(e,t)}const F=({value:e,...t},r,i,n=!0)=>{const a=u.getTableRenderType(r),d=u.getTableRenderProps({...r,valueType:a},{value:e,...t}),s=u.getTableCellRenderNode(a,d,t.record,i),o=r.renderText?.({value:e,...t})||e,x=r.renderText?f.createVNode(f.Fragment,null,[r.renderText?.({value:e,...t})]):s;let h=n?O(r,o,x):x;if(r.customRender){const v=r._path||[],S=g(t.record,t.rowIndex,t.params.rowKey);h=r.customRender({value:e,...t,column:r,originalNode:h,originalText:o,path:[...v,String(S)]})}return f.createVNode(f.Fragment,null,[h])};function T(e,t,r,i){const n=l.pick(e,["width","minWidth","align","resizable","className","headerClassName","footerClassName","treeNode"]);n.field=y(e.dataIndex),n.fixed=b(e.fixed),n.headerAlign=e.align,n.footerAlign=e.align,n.showOverflow=!1,n.showFooterOverflow=!1,Object.assign(n,N(e.sorter)),n.filters=R(e),n.filterMultiple=e.filterMultiple,n.filterMethod=_(e.onFilter);const a=({row:d,rowIndex:s})=>F({value:p(d,e.dataIndex),text:p(d,e.dataIndex),record:d,index:s,renderIndex:s,column:e},e,i);return n.slots={header:()=>u.getTableTitle(e,r,void 0,t),default:a,footer:a},e.html&&(delete n.slots.default,delete n.slots.footer,n.type="html"),e.seq&&(n.type="seq",n.slots={}),n}function w(e,t,r,i){if(!e.children?.length)return T(e,t,r,i);function n(d){return d.map(s=>{if(s.children?.length){const o=c(s,t,r);return o.children=n(s.children),o}return T(s,t,r,i)})}const a=c(e,t,r);return a.children=n(e.children),a}exports.contentCustom=F;exports.dataIndexToField=y;exports.getValueByDataIndex=p;exports.transformCol=w;exports.transformFixed=b;exports.transformToColGroup=c;exports.transformToColumn=T;
@@ -4,6 +4,7 @@ import { ApiType, ApUploadConfig, ApDescriptionsConfig, ValueTypeRenderConfig, d
4
4
  import { ApGridProps } from '../ap-grid';
5
5
  import { AgGridProps } from '../ag-grid';
6
6
  import { ViewCacheOption } from '../business';
7
+ import { FullToken } from '../design-token/interface';
7
8
  import { default as __DTS_DEFAULT_0__ } from '@aplus-frontend/antdv/es/config-provider/renderEmpty';
8
9
  import { TransformCellTextProps } from '@aplus-frontend/antdv/es/table/interface';
9
10
  import { CSPConfig } from '@aplus-frontend/antdv/es/config-provider';
@@ -156,6 +157,12 @@ export declare const configProviderProps: () => {
156
157
  aplusLocale: {
157
158
  type: PropType<LocaleType>;
158
159
  };
160
+ /**
161
+ * APlus-UI 自己的token
162
+ */
163
+ aplusToken: {
164
+ type: PropType<Partial<FullToken>>;
165
+ };
159
166
  namespace: {
160
167
  type: StringConstructor;
161
168
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("@aplus-frontend/antdv/es/config-provider/context"),t=()=>({apGrid:{type:Object},agGrid:{type:Object}}),o=()=>({aplusLocale:{type:Object},namespace:{type:String},api:{type:Object,default:()=>({})},uiMode:{type:String},apUpload:{type:Object,default:()=>({})},apDescriptions:{type:Object,default:()=>({})},valueTypeMap:{type:Object,default:()=>({})},downloadCenterTriggerConfig:{type:Object,default:()=>({})},exportField:{type:[Object,Boolean],default:!1},scrollYDomName:{type:String},viewCacheOption:{type:Object,default:()=>({})},searchForm:{type:Object,default:()=>({})},...t(),...e.configProviderProps()});exports.configProviderProps=o;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("@aplus-frontend/antdv/es/config-provider/context"),t=()=>({apGrid:{type:Object},agGrid:{type:Object}}),o=()=>({aplusLocale:{type:Object},aplusToken:{type:Object},namespace:{type:String},api:{type:Object,default:()=>({})},uiMode:{type:String},apUpload:{type:Object,default:()=>({})},apDescriptions:{type:Object,default:()=>({})},valueTypeMap:{type:Object,default:()=>({})},downloadCenterTriggerConfig:{type:Object,default:()=>({})},exportField:{type:[Object,Boolean],default:!1},scrollYDomName:{type:String},viewCacheOption:{type:Object,default:()=>({})},searchForm:{type:Object,default:()=>({})},...t(),...e.configProviderProps()});exports.configProviderProps=o;
@@ -8,6 +8,7 @@ import { ButtonSize } from '@aplus-frontend/antdv/es/button';
8
8
  import { ThemeConfig, InputConfig, PaginationConfig, FormConfig, SelectConfig, CascaderConfig, DatePickerConfig, RangePickerConfig, TreeSelectConfig, TextAreaConfig, InputNumberConfig, MentionsConfig, TimePickerConfig, CardConfig } from '@aplus-frontend/antdv/es/config-provider/context';
9
9
  import { ApGridRowSelection, AgGridRowSelection, ViewCacheOption } from '..';
10
10
  import { LocaleType } from '../locale';
11
+ import { FullToken } from '../design-token/interface';
11
12
  import { ApiType, ApUploadConfig, ApDescriptionsConfig, ValueTypeRenderConfig, downloadCenterTriggerConfig, ExportField, SearchFormGlobalConfig } from './constants';
12
13
  export declare const globalConfigCached: Ref<ConfigProviderProps>;
13
14
  export declare const ConfigProvider: DefineComponent<ExtractPropTypes<{
@@ -155,6 +156,9 @@ export declare const ConfigProvider: DefineComponent<ExtractPropTypes<{
155
156
  aplusLocale: {
156
157
  type: PropType<LocaleType>;
157
158
  };
159
+ aplusToken: {
160
+ type: PropType<Partial< FullToken>>;
161
+ };
158
162
  namespace: {
159
163
  type: StringConstructor;
160
164
  };
@@ -341,6 +345,9 @@ export declare const ConfigProvider: DefineComponent<ExtractPropTypes<{
341
345
  aplusLocale: {
342
346
  type: PropType<LocaleType>;
343
347
  };
348
+ aplusToken: {
349
+ type: PropType<Partial< FullToken>>;
350
+ };
344
351
  namespace: {
345
352
  type: StringConstructor;
346
353
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("vue"),C=require("@aplus-frontend/antdv"),u=require("./hooks/use-global-config.js"),P=require("./config-provider-props.js"),r=require("../utils/config-provider-preset.js"),c=require("./constants.js");function G(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!i.isVNode(e)}const o=i.ref({}),h=i.defineComponent({name:"AplusConfigProvider",props:P.configProviderProps(),setup(e,{slots:l}){const t=u.useGlobalConfig();let a=!0;const f=i.computed(()=>e.namespace!==void 0?e.namespace:t.value?.namespace||c.DEFAULT_NAMESPACE),d=i.computed(()=>e.uiMode!==void 0?e.uiMode:t.value?.uiMode||c.DEFAULT_UIMODE),g=i.computed(()=>e.apGrid!==void 0?e.apGrid:t.value?.apGrid),m=i.computed(()=>e.agGrid!==void 0?e.agGrid:t.value?.agGrid),v=i.computed(()=>({namespace:i.unref(f),aplusLocale:e.aplusLocale,api:e.api,uiMode:i.unref(d),apUpload:e.apUpload,apDescriptions:e.apDescriptions,valueTypeMap:e.valueTypeMap,downloadCenterTriggerConfig:e.downloadCenterTriggerConfig,exportField:e.exportField,scrollYDomName:e.scrollYDomName,viewCacheOption:e.viewCacheOption,searchForm:e.searchForm,apGrid:i.unref(g),agGrid:i.unref(m)})),s=u.provideGlobalConfig(v);return i.watch(()=>e,n=>{o.value=r.mergeAntdProviderConfigWithCache(r.mergeAntdProvideConfig(n),o.value)},{deep:!0,immediate:!0}),i.onActivated(()=>{if(a){a=!1;return}o.value=r.mergeAntdProviderConfigWithCache(r.mergeAntdProvideConfig(e),o.value)}),typeof window<"u"&&i.watch(()=>i.unref(d),n=>{document.documentElement.dataset.aplusUiMode=n},{immediate:!0}),()=>{let n;return i.createVNode(C.ConfigProvider,o.value,G(n=i.renderSlot(l,"default",{config:s?.value}))?n:{default:()=>[n]})}}});exports.ConfigProvider=h;exports.globalConfigCached=o;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("vue"),C=require("@aplus-frontend/antdv"),u=require("./hooks/use-global-config.js"),P=require("./config-provider-props.js"),r=require("../utils/config-provider-preset.js"),c=require("./constants.js");function G(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!n.isVNode(e)}const o=n.ref({}),h=n.defineComponent({name:"AplusConfigProvider",props:P.configProviderProps(),setup(e,{slots:l}){const t=u.useGlobalConfig();let a=!0;const f=n.computed(()=>e.namespace!==void 0?e.namespace:t.value?.namespace||c.DEFAULT_NAMESPACE),d=n.computed(()=>e.uiMode!==void 0?e.uiMode:t.value?.uiMode||c.DEFAULT_UIMODE),g=n.computed(()=>e.apGrid!==void 0?e.apGrid:t.value?.apGrid),m=n.computed(()=>e.agGrid!==void 0?e.agGrid:t.value?.agGrid),s=n.computed(()=>({namespace:n.unref(f),aplusLocale:e.aplusLocale,aplusToken:e.aplusToken,api:e.api,uiMode:n.unref(d),apUpload:e.apUpload,apDescriptions:e.apDescriptions,valueTypeMap:e.valueTypeMap,downloadCenterTriggerConfig:e.downloadCenterTriggerConfig,exportField:e.exportField,scrollYDomName:e.scrollYDomName,viewCacheOption:e.viewCacheOption,searchForm:e.searchForm,apGrid:n.unref(g),agGrid:n.unref(m)})),v=u.provideGlobalConfig(s);return n.watch(()=>e,i=>{o.value=r.mergeAntdProviderConfigWithCache(r.mergeAntdProvideConfig(i),o.value)},{deep:!0,immediate:!0}),n.onActivated(()=>{if(a){a=!1;return}o.value=r.mergeAntdProviderConfigWithCache(r.mergeAntdProvideConfig(e),o.value)}),typeof window<"u"&&n.watch(()=>n.unref(d),i=>{document.documentElement.dataset.aplusUiMode=i},{immediate:!0}),()=>{let i;return n.createVNode(C.ConfigProvider,o.value,G(i=n.renderSlot(l,"default",{config:v?.value}))?i:{default:()=>[i]})}}});exports.ConfigProvider=h;exports.globalConfigCached=o;
@@ -9,6 +9,7 @@ import { ButtonSize } from '@aplus-frontend/antdv/es/button';
9
9
  import { ThemeConfig, InputConfig, PaginationConfig, FormConfig, SelectConfig, CascaderConfig, DatePickerConfig, RangePickerConfig, TreeSelectConfig, TextAreaConfig, InputNumberConfig, MentionsConfig, TimePickerConfig, CardConfig } from '@aplus-frontend/antdv/es/config-provider/context';
10
10
  import { ApGridRowSelection, AgGridRowSelection, ViewCacheOption } from '../..';
11
11
  import { LocaleType } from '../../locale';
12
+ import { FullToken } from '../../design-token/interface';
12
13
  import { ApiType, ApUploadConfig, ApDescriptionsConfig, ValueTypeRenderConfig, downloadCenterTriggerConfig, ExportField, SearchFormGlobalConfig } from '..';
13
14
  export declare const keysOf: <T extends Record<string, any>>(arr: T) => Array<keyof T>;
14
15
  export declare function useGlobalConfig<K extends keyof ConfigProviderContext, D extends ConfigProviderContext[K]>(key: K, defaultValue?: D): Ref<Exclude<ConfigProviderContext[K], undefined> | D>;
@@ -158,6 +159,9 @@ export declare const provideGlobalConfig: (config: MaybeRef<ConfigProviderContex
158
159
  aplusLocale: {
159
160
  type: PropType<LocaleType>;
160
161
  };
162
+ aplusToken: {
163
+ type: PropType<Partial< FullToken>>;
164
+ };
161
165
  namespace: {
162
166
  type: StringConstructor;
163
167
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("vue"),f=require("../constants.js"),d=require("./use-locale.js"),g=require("./use-namespace.js"),l=e=>Object.keys(e),i=o.ref();function v(e,n=void 0){const r=o.getCurrentInstance()?o.inject(f.configProviderContextKey,i):i;return e?o.computed(()=>r.value?.[e]??n):r}const p=(e,n,r=!1)=>{const c=!!o.getCurrentInstance(),t=c?v():void 0,u=n?.provide??(c?o.provide:void 0);if(!u)return;const s=o.computed(()=>{const a=o.unref(e);return t?.value?C(t.value,a):a});return u(f.configProviderContextKey,s),u(g.namespaceContextKey,s.value.namespace),u(d.localeContextKey,o.computed(()=>s.value.aplusLocale)),(r||!i.value)&&(i.value=s.value),s},C=(e,n)=>{const r=[...new Set([...l(e),...l(n)])],c={};for(const t of r)c[t]=n[t]!==void 0?n[t]:e[t];return c};exports.keysOf=l;exports.provideGlobalConfig=p;exports.useGlobalConfig=v;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),f=require("../constants.js"),g=require("./use-locale.js"),p=require("./use-namespace.js"),C=require("./use-token.js"),m=require("lodash-unified"),y=require("../../design-token/constants.js"),a=o=>Object.keys(o),i=e.ref();function d(o,n=void 0){const r=e.getCurrentInstance()?e.inject(f.configProviderContextKey,i):i;return o?e.computed(()=>r.value?.[o]??n):r}const k=(o,n,r=!1)=>{const c=!!e.getCurrentInstance(),t=c?d():void 0,u=n?.provide??(c?e.provide:void 0);if(!u)return;const s=e.computed(()=>{const l=e.unref(o);return t?.value?b(t.value,l):l});u(f.configProviderContextKey,s),u(p.namespaceContextKey,s.value.namespace);const v=e.computed(()=>({...m.merge(y.defaultToken,s.value.aplusToken||{})}));return u(C.designTokenContextKey,v),u(g.localeContextKey,e.computed(()=>s.value.aplusLocale)),(r||!i.value)&&(i.value=s.value),s},b=(o,n)=>{const r=[...new Set([...a(o),...a(n)])],c={};for(const t of r)c[t]=n[t]!==void 0?n[t]:o[t];return c};exports.keysOf=a;exports.provideGlobalConfig=k;exports.useGlobalConfig=d;
@@ -0,0 +1,4 @@
1
+ import { InjectionKey, Ref } from 'vue';
2
+ import { FullToken } from '../../design-token/interface';
3
+ export declare const designTokenContextKey: InjectionKey<Ref<Partial<FullToken>>>;
4
+ export declare const useToken: () => Ref<FullToken>;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),n=Symbol("designTokenContextKey"),t=()=>e.inject(n,e.ref({}));exports.designTokenContextKey=n;exports.useToken=t;
@@ -7,6 +7,7 @@ import { ButtonSize } from '@aplus-frontend/antdv/es/button';
7
7
  import { ThemeConfig, InputConfig, PaginationConfig, FormConfig, SelectConfig, CascaderConfig, DatePickerConfig, RangePickerConfig, TreeSelectConfig, TextAreaConfig, InputNumberConfig, MentionsConfig, TimePickerConfig, CardConfig } from '@aplus-frontend/antdv/es/config-provider/context';
8
8
  import { ApGridRowSelection, AgGridRowSelection, ViewCacheOption } from '..';
9
9
  import { LocaleType } from '../locale';
10
+ import { FullToken } from '../design-token/interface';
10
11
  import { ApiType, ApUploadConfig, ApDescriptionsConfig, ValueTypeRenderConfig, downloadCenterTriggerConfig, ExportField, SearchFormGlobalConfig } from './constants';
11
12
  export * from './config-provider-props';
12
13
  export * from './constants';
@@ -160,6 +161,9 @@ export declare const APConfigProvider: {
160
161
  aplusLocale: {
161
162
  type: PropType<LocaleType>;
162
163
  };
164
+ aplusToken: {
165
+ type: PropType<Partial< FullToken>>;
166
+ };
163
167
  namespace: {
164
168
  type: StringConstructor;
165
169
  };
@@ -392,6 +396,9 @@ export declare const APConfigProvider: {
392
396
  aplusLocale: {
393
397
  type: PropType<LocaleType>;
394
398
  };
399
+ aplusToken: {
400
+ type: PropType<Partial< FullToken>>;
401
+ };
395
402
  namespace: {
396
403
  type: StringConstructor;
397
404
  };
@@ -621,6 +628,9 @@ export declare const APConfigProvider: {
621
628
  aplusLocale: {
622
629
  type: PropType<LocaleType>;
623
630
  };
631
+ aplusToken: {
632
+ type: PropType<Partial< FullToken>>;
633
+ };
624
634
  namespace: {
625
635
  type: StringConstructor;
626
636
  };
@@ -0,0 +1,2 @@
1
+ import { BaseToken } from './interface';
2
+ export declare const defaultToken: BaseToken;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o={borderColorBase:"#dee4ed",hoverColorBase:"#66a9ff",activeColorBase:"#66a9ff",colorPrimary:"#0070ff",colorPrimaryDisabled:"#cce2ff",colorLink:"#0070ff",colorLinkHover:"#66a9ff",colorLinkDisabled:"#cce2ff",colorSuccess:"#2ed1a3",colorSuccessDisabled:"#d5f6ed",colorError:"#ff4d4f",colorErrorDisabled:"#ffdbdc",colorWarn:"#ffa940",colorWarnDisabled:"#ffeed9",textColor1:"#526a90",textColor2:"#182948",textColor3:"#8896b0",textColor4:"#abb7cc",colorBg1:"#e9edf3",colorBg2:"#f6f9fa",colorBg3:"#f3f5f8",colorBgDisabled:"#f2f6f9",fontSizeSM:10,fontSize:12,fontSizeLG:14,fontSizeXL:16,lineHeightSM:16,lineHeight:18,lineHeightLG:22,borderRadiusXS:1,borderRadius:4,spaceXXS:2,spaceXS:4,spaceSM:6,space:8,spaceMD:10,spaceLG:12,spaceXL:16,spaceXXL:24};exports.defaultToken=o;
@@ -0,0 +1,123 @@
1
+ import { ActionToken } from '../ap-action/style';
2
+ import { Recordable } from '../type';
3
+ import { CSSInterpolation } from '@emotion/serialize';
4
+ export type BaseToken = {
5
+ /**
6
+ * 基础边框色
7
+ */
8
+ borderColorBase: string;
9
+ /**
10
+ * 基础hover色
11
+ */
12
+ hoverColorBase: string;
13
+ /**
14
+ * 基础active色
15
+ */
16
+ activeColorBase: string;
17
+ /**
18
+ * 主色
19
+ */
20
+ colorPrimary: string;
21
+ /**
22
+ * 主色禁用色
23
+ */
24
+ colorPrimaryDisabled: string;
25
+ /**
26
+ * 链接色
27
+ */
28
+ colorLink: string;
29
+ /**
30
+ * 链接色-hover
31
+ */
32
+ colorLinkHover: string;
33
+ /**
34
+ * 链接色-禁用
35
+ */
36
+ colorLinkDisabled: string;
37
+ /**
38
+ * 成功色
39
+ */
40
+ colorSuccess: string;
41
+ /**
42
+ * 成功色-禁用
43
+ */
44
+ colorSuccessDisabled: string;
45
+ /**
46
+ * 失败色
47
+ */
48
+ colorError: string;
49
+ /**
50
+ * 失败色-禁用
51
+ */
52
+ colorErrorDisabled: string;
53
+ /**
54
+ * 警告色
55
+ */
56
+ colorWarn: string;
57
+ /**
58
+ * 警告色-禁用
59
+ */
60
+ colorWarnDisabled: string;
61
+ /**
62
+ * 一级文本色
63
+ */
64
+ textColor1: string;
65
+ /**
66
+ * 二级文本色
67
+ */
68
+ textColor2: string;
69
+ /**
70
+ * 三级文本色
71
+ */
72
+ textColor3: string;
73
+ /**
74
+ * 四级文本色
75
+ */
76
+ textColor4: string;
77
+ /**
78
+ * 一级背景色
79
+ */
80
+ colorBg1: string;
81
+ /**
82
+ * 二级背景色
83
+ */
84
+ colorBg2: string;
85
+ /**
86
+ * 三级背景色
87
+ */
88
+ colorBg3: string;
89
+ /**
90
+ * 背景禁用色
91
+ */
92
+ colorBgDisabled: string;
93
+ fontSizeXL: number;
94
+ fontSizeLG: number;
95
+ fontSize: number;
96
+ fontSizeSM: number;
97
+ lineHeightLG: number;
98
+ lineHeight: number;
99
+ lineHeightSM: number;
100
+ borderRadiusXS: number;
101
+ borderRadius: number;
102
+ spaceXXS: number;
103
+ spaceXS: number;
104
+ spaceSM: number;
105
+ space: number;
106
+ spaceMD: number;
107
+ spaceLG: number;
108
+ spaceXL: number;
109
+ spaceXXL: number;
110
+ };
111
+ export type FullToken = BaseToken & {
112
+ components: {
113
+ ApAction: ActionToken;
114
+ };
115
+ };
116
+ export type TokenWithComponentCls<Token> = Token & {
117
+ componentCls: string;
118
+ };
119
+ export type CssVarToken<Token = Recordable> = {
120
+ [key in keyof Token]: Token[key] | string;
121
+ };
122
+ export type GenStyleFunc<Token> = (token: TokenWithComponentCls<Token>) => CSSInterpolation;
123
+ export type GenStyleCallback<Token> = (token: TokenWithComponentCls<Token>) => CSSInterpolation[];
@@ -0,0 +1,12 @@
1
+ export const resetComponent = (token) => {
2
+ return {
3
+ boxSizing: 'border-box',
4
+ margin: 0,
5
+ padding: 0,
6
+ color: token.textColor2,
7
+ fontSize: token.fontSize,
8
+ fontFamily: 'inherit',
9
+ lineHeight: token.lineHeight,
10
+ listStyle: 'none'
11
+ };
12
+ };
@@ -0,0 +1,3 @@
1
+ import { CSSProperties } from 'vue';
2
+ import { BaseToken } from '../design-token/interface';
3
+ export declare const resetComponent: (token: BaseToken) => CSSProperties;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=e=>({boxSizing:"border-box",margin:0,padding:0,color:e.textColor2,fontSize:e.fontSize,fontFamily:"inherit",lineHeight:e.lineHeight,listStyle:"none"});exports.resetComponent=t;
@@ -0,0 +1,8 @@
1
+ import { BaseToken, GenStyleCallback } from '../../design-token/interface';
2
+ import { Ref } from 'vue';
3
+ type GeneraterOption = {
4
+ skipUnit: string[];
5
+ };
6
+ export declare function camelToKebab(str: string): string;
7
+ export declare function genComponentStyleHook<ComponentToken>(componentName: string, cb: GenStyleCallback<BaseToken & ComponentToken>, componentToken?: Partial<ComponentToken>, option?: GeneraterOption): (prefixCls: string) => Ref<string | undefined, string | undefined>;
8
+ export {};
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p=require("lodash-unified"),a=require("vue"),g=require("../../config-provider/hooks/use-token.js"),f=require("@emotion/css");require("../../config-provider/index.js");const k=require("../../config-provider/hooks/use-global-config.js");function C(e,t){return Object.entries(e).reduce((n,[s,r])=>{const c=typeof r=="number"&&!t?.skipUnit?.includes(s)?`${r}px`:r;return n[i(s)]=c,n},{})}function i(e){return"--"+e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}function T(e){const t={};for(const n in e)t[n]=`var(${i(n)})`;return t}function S(e,t,n,s){return r=>{const c=a.ref(),l=g.useToken(),b=k.useGlobalConfig("namespace"),m=a.computed(()=>{let o=p.omit(l.value||{},"components");return o={...o,...p.merge(n||{},l.value.components?.[e]||{})},o});return a.watch(()=>m.value,o=>{const u=T(o);u.componentCls=`.${b.value}-${r}`;const d=t(u);f.injectGlobal(d)},{immediate:!0,once:!0}),a.watch(()=>m.value,o=>{const u=C(o,s);c.value=f.css(u)},{deep:!0,immediate:!0}),c}}exports.camelToKebab=i;exports.genComponentStyleHook=S;
@@ -1,2 +1,2 @@
1
- declare const _default: "6.40.0";
1
+ declare const _default: "7.0.0-beta.0";
2
2
  export default _default;
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e="6.40.0";exports.default=e;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e="7.0.0-beta.0";exports.default=e;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aplus-frontend/ui",
3
- "version": "6.40.0",
3
+ "version": "7.0.0-beta.0",
4
4
  "main": "./lib/index.js",
5
5
  "type": "module",
6
6
  "files": [
@@ -27,6 +27,7 @@
27
27
  },
28
28
  "dependencies": {
29
29
  "@ant-design/icons-vue": "^7.0.1",
30
+ "@emotion/css": "^11.13.5",
30
31
  "@fruits-chain/utils": "^1.0.7",
31
32
  "@vueuse/core": "^10.9.0",
32
33
  "ag-grid-community": "^33.3.2",
@@ -51,6 +52,7 @@
51
52
  "@aplus-frontend/antdv": "^1.2.16",
52
53
  "@aplus-frontend/icon": "^1.3.2",
53
54
  "@aplus-frontend/oss": "^1.1.2",
55
+ "@emotion/serialize": "^1.3.3",
54
56
  "@types/sortablejs": "^1.15.8",
55
57
  "@vue/test-utils": "^2.4.6",
56
58
  "axios": "^1.7.2",
@@ -485,62 +485,6 @@
485
485
  word-wrap: break-word;
486
486
  word-break: break-all;
487
487
  }
488
- .aplus-action-item {
489
- box-sizing: border-box;
490
- margin: 0;
491
- padding: 0;
492
- color: #182948;
493
- font-size: 12px;
494
- font-family: inherit;
495
- line-height: 18px;
496
- list-style: none;
497
- display: inline-block;
498
- cursor: pointer;
499
- }
500
- .aplus-action-item--primary {
501
- color: var(--ap-color-link);
502
- }
503
- .aplus-action-item--primary:not(.aplus-action-item--disabled):hover {
504
- color: var(--ap-color-link-hover);
505
- }
506
- .aplus-action-item--success {
507
- color: var(--ap-color-success);
508
- }
509
- .aplus-action-item--error {
510
- color: var(--ap-color-error);
511
- }
512
- .aplus-action-item--warn {
513
- color: var(--ap-color-warn);
514
- }
515
- .aplus-action-item--loading {
516
- opacity: 0.35;
517
- transition: opacity 0.2s;
518
- cursor: default;
519
- }
520
- .aplus-action-item--loading .btn-loading-icon {
521
- margin-right: 4px;
522
- }
523
- .aplus-action-item--disabled {
524
- cursor: not-allowed;
525
- }
526
- .aplus-action-item--primary.aplus-action-item--disabled {
527
- color: var(--ap-color-link-disabled);
528
- }
529
- .aplus-action-item--success.aplus-action-item--disabled {
530
- color: var(--ap-color-success-disabled);
531
- }
532
- .aplus-action-item--error.aplus-action-item--disabled {
533
- color: var(--ap-color-error-disabled);
534
- }
535
- .aplus-action-item--warn.aplus-action-item--disabled {
536
- color: var(--ap-color-warn-disabled);
537
- }
538
- .aplus-action-item__icon-wrapper {
539
- padding-right: 4px;
540
- }
541
- .aplus-action-item--icon-first .aplus-action-item__icon-wrapper {
542
- padding-right: 0;
543
- }
544
488
  .aplus-action-item-dropdown__item .aplus-action-item {
545
489
  width: 100%;
546
490
  }
@@ -485,62 +485,6 @@
485
485
  word-wrap: break-word;
486
486
  word-break: break-all;
487
487
  }
488
- .aplus-action-item {
489
- box-sizing: border-box;
490
- margin: 0;
491
- padding: 0;
492
- color: #182948;
493
- font-size: 12px;
494
- font-family: inherit;
495
- line-height: 18px;
496
- list-style: none;
497
- display: inline-block;
498
- cursor: pointer;
499
- }
500
- .aplus-action-item--primary {
501
- color: var(--ap-color-link);
502
- }
503
- .aplus-action-item--primary:not(.aplus-action-item--disabled):hover {
504
- color: var(--ap-color-link-hover);
505
- }
506
- .aplus-action-item--success {
507
- color: var(--ap-color-success);
508
- }
509
- .aplus-action-item--error {
510
- color: var(--ap-color-error);
511
- }
512
- .aplus-action-item--warn {
513
- color: var(--ap-color-warn);
514
- }
515
- .aplus-action-item--loading {
516
- opacity: 0.35;
517
- transition: opacity 0.2s;
518
- cursor: default;
519
- }
520
- .aplus-action-item--loading .btn-loading-icon {
521
- margin-right: 4px;
522
- }
523
- .aplus-action-item--disabled {
524
- cursor: not-allowed;
525
- }
526
- .aplus-action-item--primary.aplus-action-item--disabled {
527
- color: var(--ap-color-link-disabled);
528
- }
529
- .aplus-action-item--success.aplus-action-item--disabled {
530
- color: var(--ap-color-success-disabled);
531
- }
532
- .aplus-action-item--error.aplus-action-item--disabled {
533
- color: var(--ap-color-error-disabled);
534
- }
535
- .aplus-action-item--warn.aplus-action-item--disabled {
536
- color: var(--ap-color-warn-disabled);
537
- }
538
- .aplus-action-item__icon-wrapper {
539
- padding-right: 4px;
540
- }
541
- .aplus-action-item--icon-first .aplus-action-item__icon-wrapper {
542
- padding-right: 0;
543
- }
544
488
  .aplus-action-item-dropdown__item .aplus-action-item {
545
489
  width: 100%;
546
490
  }
@@ -44,59 +44,3 @@
44
44
  .common-style::after {
45
45
  box-sizing: border-box;
46
46
  }
47
- .aplus-action-item {
48
- box-sizing: border-box;
49
- margin: 0;
50
- padding: 0;
51
- color: #182948;
52
- font-size: 12px;
53
- font-family: inherit;
54
- line-height: 18px;
55
- list-style: none;
56
- display: inline-block;
57
- cursor: pointer;
58
- }
59
- .aplus-action-item--primary {
60
- color: var(--ap-color-link);
61
- }
62
- .aplus-action-item--primary:not(.aplus-action-item--disabled):hover {
63
- color: var(--ap-color-link-hover);
64
- }
65
- .aplus-action-item--success {
66
- color: var(--ap-color-success);
67
- }
68
- .aplus-action-item--error {
69
- color: var(--ap-color-error);
70
- }
71
- .aplus-action-item--warn {
72
- color: var(--ap-color-warn);
73
- }
74
- .aplus-action-item--loading {
75
- opacity: 0.35;
76
- transition: opacity 0.2s;
77
- cursor: default;
78
- }
79
- .aplus-action-item--loading .btn-loading-icon {
80
- margin-right: 4px;
81
- }
82
- .aplus-action-item--disabled {
83
- cursor: not-allowed;
84
- }
85
- .aplus-action-item--primary.aplus-action-item--disabled {
86
- color: var(--ap-color-link-disabled);
87
- }
88
- .aplus-action-item--success.aplus-action-item--disabled {
89
- color: var(--ap-color-success-disabled);
90
- }
91
- .aplus-action-item--error.aplus-action-item--disabled {
92
- color: var(--ap-color-error-disabled);
93
- }
94
- .aplus-action-item--warn.aplus-action-item--disabled {
95
- color: var(--ap-color-warn-disabled);
96
- }
97
- .aplus-action-item__icon-wrapper {
98
- padding-right: 4px;
99
- }
100
- .aplus-action-item--icon-first .aplus-action-item__icon-wrapper {
101
- padding-right: 0;
102
- }
@@ -4,61 +4,4 @@
4
4
  @aid: ~'@{ns}-action-item--disabled';
5
5
  @aiiw: ~'@{ns}-action-item__icon-wrapper';
6
6
 
7
- .b(action-item, {
8
- .reset-component();
9
- display: inline-block;
10
- cursor: pointer;
11
- // 因为这里action-item类似于button type=link 所以主色=link色
12
- &--primary {
13
- color: var(--ap-color-link);
14
- &:not(.@{aid}):hover {
15
- color: var(--ap-color-link-hover);
16
- }
17
- }
18
-
19
- &--success {
20
- color: var(--ap-color-success);
21
- }
22
-
23
- &--error {
24
- color: var(--ap-color-error);
25
- }
26
-
27
- &--warn {
28
- color: var(--ap-color-warn);
29
- }
30
-
31
- &--loading {
32
- opacity: 0.35;
33
- transition: opacity 0.2s;
34
- cursor: default;
35
- .btn-loading-icon {
36
- margin-right: @spacing-xs;
37
- }
38
- }
39
-
40
- &--disabled {
41
- cursor: not-allowed;
42
- }
43
-
44
- &--primary&--disabled {
45
- color: var(--ap-color-link-disabled);
46
- }
47
- &--success&--disabled {
48
- color: var(--ap-color-success-disabled);
49
- }
50
- &--error&--disabled {
51
- color: var(--ap-color-error-disabled);
52
- }
53
- &--warn&--disabled {
54
- color: var(--ap-color-warn-disabled);
55
- }
56
- &__icon-wrapper {
57
- padding-right: @spacing-xs;
58
- }
59
- &--icon-first {
60
- .@{aiiw} {
61
- padding-right: 0;
62
- }
63
- }
64
- });
7
+ .b(action-item, {});