@aloudata/aloudata-design 3.0.0-beta.1 → 3.0.0-beta.3

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,11 +3,11 @@ import DisabledContext from "../ConfigProvider/DisabledContext.js";
3
3
  import SizeContext from "../ConfigProvider/sizeContext.js";
4
4
  import { LocaleContext } from "../locale/default.js";
5
5
  /* empty css */
6
+ import enUSDatePicker from "rc-picker/es/locale/en_US";
6
7
  import { forwardRef, useContext } from "react";
7
8
  import { jsx } from "react/jsx-runtime";
8
9
  import { Picker, RangePicker } from "rc-picker";
9
10
  import dayjsGenerateConfig from "rc-picker/es/generate/dayjs";
10
- import enUS from "rc-picker/es/locale/en_US";
11
11
  //#region src/DatePicker/index.tsx
12
12
  var SIZE_CLS = {
13
13
  small: "ald-picker-sm",
@@ -22,7 +22,7 @@ var InternalDatePicker = forwardRef((props, ref) => {
22
22
  return /* @__PURE__ */ jsx(Picker, {
23
23
  ref,
24
24
  generateConfig: dayjsGenerateConfig,
25
- locale: useContext(LocaleContext)?.DatePicker || enUS,
25
+ locale: useContext(LocaleContext)?.DatePicker || enUSDatePicker,
26
26
  prefixCls,
27
27
  disabled: mergedDisabled,
28
28
  className: cn(SIZE_CLS[size] || "", !bordered && "ald-picker-borderless", status === "error" && "ald-picker-status-error", status === "warning" && "ald-picker-status-warning", className),
@@ -38,7 +38,7 @@ var InternalRangePicker = forwardRef((props, ref) => {
38
38
  return /* @__PURE__ */ jsx(RangePicker, {
39
39
  ref,
40
40
  generateConfig: dayjsGenerateConfig,
41
- locale: useContext(LocaleContext)?.DatePicker || enUS,
41
+ locale: useContext(LocaleContext)?.DatePicker || enUSDatePicker,
42
42
  prefixCls,
43
43
  disabled: mergedDisabled,
44
44
  className: cn(SIZE_CLS[size] || "", !bordered && "ald-picker-borderless", status === "error" && "ald-picker-status-error", status === "warning" && "ald-picker-status-warning", className),
@@ -57,6 +57,8 @@ export interface FormItemProps {
57
57
  validateStatus?: ValidateStatus;
58
58
  colon?: boolean;
59
59
  trigger?: string;
60
+ normalize?: (value: any, prevValue: any, allValues: any) => any;
61
+ getValueProps?: (value: any) => Record<string, any>;
60
62
  }
61
63
  export interface ErrorListProps {
62
64
  errors?: React.ReactNode[];
@@ -149,7 +149,7 @@ function FormItemLayout({ label, children, meta, help, extra, required, hidden,
149
149
  });
150
150
  }
151
151
  var AldFormItem = function(props) {
152
- const { labelWidth, style = {}, label, name, rules, children, className, required, hidden, initialValue, dependencies, shouldUpdate, help, extra, validateTrigger, valuePropName, getValueFromEvent, noStyle, labelCol, wrapperCol, validateStatus, colon } = props;
152
+ const { labelWidth, style = {}, label, name, rules, children, className, required, hidden, initialValue, dependencies, shouldUpdate, help, extra, validateTrigger, valuePropName, getValueFromEvent, normalize, getValueProps, noStyle, labelCol, wrapperCol, validateStatus, colon } = props;
153
153
  const formContext = useContext(FormContext);
154
154
  const customStyle = labelWidth ? {
155
155
  ...style,
@@ -180,6 +180,8 @@ var AldFormItem = function(props) {
180
180
  validateTrigger,
181
181
  valuePropName,
182
182
  getValueFromEvent,
183
+ normalize,
184
+ getValueProps,
183
185
  children: (control, meta, form) => {
184
186
  if (typeof children === "function") {
185
187
  const childContent = children(form);
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../src/Form/index.tsx"],"sourcesContent":["import RcForm, {\n Field,\n FormInstance as RcFormInstance,\n FormProvider,\n List,\n useForm as rcUseForm,\n useWatch,\n} from 'rc-field-form';\nimport type { FormProps as RcFormProps } from 'rc-field-form';\nimport FieldContext from 'rc-field-form/es/FieldContext';\nimport type { Rule, RuleObject, RuleRender } from 'rc-field-form/es/interface';\nimport type { Meta, NamePath } from 'rc-field-form/es/interface';\nimport React, { forwardRef, useContext, useMemo } from 'react';\nimport SizeContext, {\n SizeContextProvider,\n} from '../ConfigProvider/sizeContext';\nimport DisabledContext from '../ConfigProvider/DisabledContext';\nimport { cn } from '../lib/utils';\nimport {\n FormContext,\n FormItemInputContext,\n type ValidateStatus,\n} from './FormItemContext';\n\n// FormInstance type compatible with antd\nexport type FormInstance<Values = any> = RcFormInstance<Values>;\n\n// FormProps compatible with antd\nexport interface FormProps<Values = any> extends Omit<RcFormProps, 'form'> {\n form?: FormInstance<Values>;\n layout?: 'horizontal' | 'vertical' | 'inline';\n size?: 'small' | 'middle' | 'large';\n colon?: boolean;\n disabled?: boolean;\n labelCol?: { span?: number; offset?: number };\n wrapperCol?: { span?: number; offset?: number };\n className?: string;\n style?: React.CSSProperties;\n requiredMark?: boolean | 'optional';\n labelWidth?: number;\n labelAlign?: 'left' | 'right';\n}\n\n// FormItemProps\nexport interface FormItemProps {\n name?: NamePath;\n label?: React.ReactNode;\n rules?: Rule[];\n children?: React.ReactNode | ((form: RcFormInstance) => React.ReactNode);\n className?: string;\n style?: React.CSSProperties;\n required?: boolean;\n hidden?: boolean;\n initialValue?: any;\n dependencies?: NamePath[];\n shouldUpdate?: boolean | ((prevValues: any, curValues: any) => boolean);\n help?: React.ReactNode;\n extra?: React.ReactNode;\n validateTrigger?: string | string[];\n valuePropName?: string;\n getValueFromEvent?: (...args: any[]) => any;\n noStyle?: boolean;\n labelWidth?: number;\n tooltip?:\n | React.ReactNode\n | { title?: React.ReactNode; icon?: React.ReactNode };\n labelCol?: { span?: number; offset?: number };\n wrapperCol?: { span?: number; offset?: number };\n validateStatus?: ValidateStatus;\n colon?: boolean;\n trigger?: string;\n}\n\nexport interface ErrorListProps {\n errors?: React.ReactNode[];\n help?: React.ReactNode;\n className?: string;\n}\n\nexport type FormListFieldData = {\n name: number;\n key: number;\n isListField: boolean;\n};\n\nexport type FormListOperation = {\n add: (defaultValue?: any, insertIndex?: number) => void;\n remove: (index: number | number[]) => void;\n move: (from: number, to: number) => void;\n};\n\nexport type FormListProps = {\n name: NamePath;\n rules?: Rule[];\n children: (\n fields: FormListFieldData[],\n operation: FormListOperation,\n meta: { errors: React.ReactNode[] },\n ) => React.ReactNode;\n initialValue?: any[];\n};\n\n// ============== Helpers ==============\n\n/** Convert a 24-column span/offset to Tailwind-compatible inline styles */\nfunction colStyle(col?: {\n span?: number;\n offset?: number;\n}): React.CSSProperties | undefined {\n if (!col) return undefined;\n const s: React.CSSProperties = {};\n if (col.span !== null && col.span !== undefined) {\n // 24-column grid: width = span / 24 * 100%\n s.width = `${(col.span / 24) * 100}%`;\n s.flex = `0 0 ${(col.span / 24) * 100}%`;\n }\n if (col.offset !== null && col.offset !== undefined && col.offset > 0) {\n s.marginLeft = `${(col.offset / 24) * 100}%`;\n }\n return s;\n}\n\n// ============== Form ==============\n\nconst AldForm = forwardRef((props: any, ref: any) => {\n const contextSize = useContext(SizeContext);\n const {\n children,\n size = contextSize,\n labelWidth,\n style = {},\n className,\n layout = 'horizontal',\n disabled,\n labelCol,\n wrapperCol,\n colon,\n requiredMark,\n ...restProps\n } = props;\n const customStyle = labelWidth\n ? { ...style, '--label-width': `${labelWidth}px` }\n : style;\n\n const formContextValue = useMemo(\n () => ({ layout, labelCol, wrapperCol, colon, requiredMark, labelWidth }),\n [layout, labelCol, wrapperCol, colon, requiredMark, labelWidth],\n );\n\n return (\n <FormContext.Provider value={formContextValue}>\n <DisabledContext.Provider value={disabled}>\n <SizeContextProvider size={size}>\n <RcForm\n style={customStyle}\n className={cn('ald-form', `ald-form-${layout}`, className)}\n {...restProps}\n ref={ref}\n >\n {children}\n </RcForm>\n </SizeContextProvider>\n </DisabledContext.Provider>\n </FormContext.Provider>\n );\n}) as <Values = any>(\n props: React.PropsWithChildren<FormProps<Values>> & {\n ref?: React.Ref<FormInstance<Values>>;\n labelWidth?: number;\n },\n) => React.ReactElement;\n\n// ============== Form.Item ==============\n\ninterface IFormItemProps extends FormItemProps {\n labelWidth?: number;\n}\n\n/** Derive status from meta or manual validateStatus */\nfunction deriveStatus(\n meta?: Meta,\n validateStatus?: ValidateStatus,\n): ValidateStatus {\n if (validateStatus) return validateStatus;\n if (!meta) return '';\n if (meta.validating) return 'validating';\n if (meta.errors && meta.errors.length > 0) return 'error';\n if (meta.warnings && meta.warnings.length > 0) return 'warning';\n if (meta.touched) return 'success';\n return '';\n}\n\n/** Status-based border class for the control wrapper */\nfunction statusClassName(status: ValidateStatus): string {\n switch (status) {\n case 'error':\n return 'ald-form-item-has-error';\n case 'warning':\n return 'ald-form-item-has-warning';\n case 'success':\n return 'ald-form-item-has-success';\n case 'validating':\n return 'ald-form-item-is-validating';\n default:\n return '';\n }\n}\n\n/** Render the inner label + control layout, receiving meta from Field */\nfunction FormItemLayout({\n label,\n children,\n meta,\n help,\n extra,\n required,\n hidden,\n className,\n customStyle,\n noStyle,\n labelCol: itemLabelCol,\n wrapperCol: itemWrapperCol,\n validateStatus: manualStatus,\n colon: itemColon,\n formContext,\n}: {\n label?: React.ReactNode;\n children: React.ReactNode;\n meta?: Meta;\n help?: React.ReactNode;\n extra?: React.ReactNode;\n required?: boolean;\n hidden?: boolean;\n className?: string;\n customStyle?: React.CSSProperties;\n noStyle?: boolean;\n labelCol?: { span?: number; offset?: number };\n wrapperCol?: { span?: number; offset?: number };\n validateStatus?: ValidateStatus;\n colon?: boolean;\n formContext: {\n layout?: string;\n labelCol?: { span?: number; offset?: number };\n wrapperCol?: { span?: number; offset?: number };\n colon?: boolean;\n requiredMark?: boolean | 'optional';\n labelWidth?: number;\n };\n}) {\n const status = deriveStatus(meta, manualStatus);\n const errors = useMemo(() => meta?.errors ?? [], [meta?.errors]);\n const warnings = useMemo(() => meta?.warnings ?? [], [meta?.warnings]);\n\n // Provide status context to child controls\n const itemInputContextValue = useMemo(\n () => ({\n status,\n isFormItemInput: true,\n errors,\n warnings,\n }),\n [status, errors, warnings],\n );\n\n if (noStyle) {\n return <>{children}</>;\n }\n\n // Determine if we should show required mark\n const { requiredMark } = formContext;\n const isRequired = required || (meta && (meta as any).required);\n const showRequired = requiredMark !== false && isRequired;\n const showOptional = requiredMark === 'optional' && !isRequired;\n\n // Resolve cols: item-level overrides form-level\n const resolvedLabelCol = itemLabelCol ?? formContext.labelCol;\n const resolvedWrapperCol = itemWrapperCol ?? formContext.wrapperCol;\n const layout = formContext.layout || 'horizontal';\n const showColon =\n (itemColon ?? formContext.colon) !== false && layout === 'horizontal';\n\n // Decide whether to use grid-style layout\n const useGridLayout =\n layout === 'horizontal' && (resolvedLabelCol || resolvedWrapperCol);\n\n // Determine display errors: if help is provided, show help instead of validation errors\n const displayMessages = help !== null && help !== undefined ? [help] : errors;\n const hasError = status === 'error' || (errors.length > 0 && help === null);\n const hasWarning =\n status === 'warning' || (warnings.length > 0 && help === null);\n\n const labelNode =\n label !== null && label !== undefined ? (\n <label\n className={cn(\n 'ald-form-item-label tw-text-sm tw-font-medium tw-text-[var(--content-primary)]',\n layout === 'vertical' && 'tw-mb-1 tw-block',\n layout === 'horizontal' && !useGridLayout && 'tw-mr-3 tw-shrink-0',\n layout === 'horizontal' && formContext.labelWidth && 'tw-shrink-0',\n )}\n style={\n !useGridLayout && layout === 'horizontal' && formContext.labelWidth\n ? { width: `var(--label-width, ${formContext.labelWidth}px)` }\n : useGridLayout\n ? colStyle(resolvedLabelCol)\n : undefined\n }\n >\n {showRequired && (\n <span className=\"tw-mr-1 tw-text-[var(--content-negative-primary)]\">\n *\n </span>\n )}\n {label}\n {showOptional && (\n <span className=\"tw-ml-1 tw-text-xs tw-font-normal tw-text-[var(--content-secondary)]\">\n (optional)\n </span>\n )}\n {showColon && label ? ':' : null}\n </label>\n ) : null;\n\n const controlNode = (\n <div\n className={cn(\n 'ald-form-item-control',\n layout === 'horizontal' && 'tw-flex-1',\n )}\n style={useGridLayout ? colStyle(resolvedWrapperCol) : undefined}\n >\n <FormItemInputContext.Provider value={itemInputContextValue}>\n <div className=\"ald-form-item-control-input\">{children}</div>\n </FormItemInputContext.Provider>\n {displayMessages.length > 0 && (\n <div\n className={cn(\n 'ald-form-item-explain tw-mt-1 tw-text-xs tw-transition-all tw-duration-200',\n hasError && 'tw-text-[var(--content-negative-secondary)]',\n hasWarning &&\n !hasError &&\n 'tw-text-[color:var(--content-warning-primary,#faad14)]',\n !hasError &&\n !hasWarning &&\n help !== null &&\n help !== undefined &&\n 'tw-text-[var(--content-secondary)]',\n )}\n >\n {displayMessages.map((msg, i) => (\n <div key={i}>{msg}</div>\n ))}\n </div>\n )}\n {extra && (\n <div className=\"ald-form-item-extra tw-mt-1 tw-text-xs tw-text-[var(--content-secondary)]\">\n {extra}\n </div>\n )}\n </div>\n );\n\n return (\n <div\n className={cn(\n 'ald-form-item tw-mb-6',\n hidden && 'tw-hidden',\n showRequired && 'ald-form-item-required',\n statusClassName(status),\n layout === 'horizontal' && 'tw-flex tw-flex-row tw-items-start',\n layout === 'inline' &&\n 'tw-mr-4 tw-inline-flex tw-flex-row tw-items-start',\n className,\n )}\n style={customStyle as React.CSSProperties}\n >\n {labelNode}\n {controlNode}\n </div>\n );\n}\n\nconst AldFormItem = function (props: IFormItemProps) {\n const {\n labelWidth,\n style = {},\n label,\n name,\n rules,\n children,\n className,\n required,\n hidden,\n initialValue,\n dependencies,\n shouldUpdate,\n help,\n extra,\n validateTrigger,\n valuePropName,\n getValueFromEvent,\n noStyle,\n labelCol,\n wrapperCol,\n validateStatus,\n colon,\n } = props;\n\n const formContext = useContext(FormContext);\n\n const customStyle = labelWidth\n ? { ...style, '--label-width': `${labelWidth}px` }\n : style;\n\n // If no name is provided (e.g. a submit button wrapper), we don't need Field\n // Also when shouldUpdate or dependencies are used without name, Field is still needed for re-render\n const needField =\n (name !== null && name !== undefined) ||\n (shouldUpdate !== null && shouldUpdate !== undefined) ||\n (dependencies !== null && dependencies !== undefined);\n\n if (!needField) {\n return (\n <FormItemLayout\n label={label}\n help={help}\n extra={extra}\n required={required}\n hidden={hidden}\n className={className}\n customStyle={customStyle as React.CSSProperties}\n noStyle={noStyle}\n labelCol={labelCol}\n wrapperCol={wrapperCol}\n validateStatus={validateStatus}\n colon={colon}\n formContext={formContext}\n >\n {children as React.ReactNode}\n </FormItemLayout>\n );\n }\n\n return (\n <Field\n name={name}\n rules={rules}\n initialValue={initialValue}\n dependencies={dependencies}\n shouldUpdate={shouldUpdate}\n validateTrigger={validateTrigger}\n valuePropName={valuePropName}\n getValueFromEvent={getValueFromEvent}\n >\n {(control, meta, form) => {\n // If children is a render function (shouldUpdate / dependencies pattern),\n // call it with the form instance and wrap in layout\n if (typeof children === 'function') {\n const childContent = (\n children as (form: RcFormInstance) => React.ReactNode\n )(form);\n if (noStyle) {\n return childContent;\n }\n return (\n <FormItemLayout\n label={label}\n meta={meta}\n help={help}\n extra={extra}\n required={required}\n hidden={hidden}\n className={className}\n customStyle={customStyle as React.CSSProperties}\n noStyle={noStyle}\n labelCol={labelCol}\n wrapperCol={wrapperCol}\n validateStatus={validateStatus}\n colon={colon}\n formContext={formContext}\n >\n {childContent}\n </FormItemLayout>\n );\n }\n\n // For noStyle, just clone with control props\n if (noStyle) {\n if (React.isValidElement(children)) {\n return React.cloneElement(\n children as React.ReactElement<any>,\n control,\n );\n }\n return children;\n }\n\n // Clone control props onto the single child element\n let childNode: React.ReactNode = children;\n if (React.isValidElement(children)) {\n childNode = React.cloneElement(\n children as React.ReactElement<any>,\n control,\n );\n }\n\n return (\n <FormItemLayout\n label={label}\n meta={meta}\n help={help}\n extra={extra}\n required={required}\n hidden={hidden}\n className={className}\n customStyle={customStyle as React.CSSProperties}\n labelCol={labelCol}\n wrapperCol={wrapperCol}\n validateStatus={validateStatus}\n colon={colon}\n formContext={formContext}\n >\n {childNode}\n </FormItemLayout>\n );\n }}\n </Field>\n );\n};\n\nfunction useFormItemStatus() {\n const ctx = useContext(FormItemInputContext);\n return {\n status: ctx.status,\n errors: ctx.errors ?? [],\n warnings: ctx.warnings ?? [],\n };\n}\n\nAldFormItem.useStatus = useFormItemStatus;\n\n// ============== ErrorList ==============\n\nfunction ErrorListComponent(props: ErrorListProps) {\n const { errors, className } = props;\n if (!errors || errors.length === 0) return null;\n return (\n <div className={cn('ald-form-error-list', className)}>\n {errors.map((err, i) => (\n <div\n key={i}\n className=\"tw-text-xs tw-text-[var(--content-negative-secondary)]\"\n >\n {err}\n </div>\n ))}\n </div>\n );\n}\n\n// ============== useFormInstance ==============\n\nfunction useFormInstance<T = any>(): FormInstance<T> {\n const form = useContext(FieldContext);\n return form as unknown as FormInstance<T>;\n}\n\n// ============== Compound component ==============\n\ntype InternalFormType = typeof AldForm;\ntype CompoundedComponent = InternalFormType & {\n useForm: <T = any>(...args: any[]) => [FormInstance<T>];\n useFormInstance: typeof useFormInstance;\n useWatch: typeof useWatch;\n Item: typeof AldFormItem;\n List: typeof List;\n ErrorList: typeof ErrorListComponent;\n Provider: typeof FormProvider;\n create: () => void;\n};\n\nconst Form = AldForm as CompoundedComponent;\n\nForm.Item = AldFormItem;\nForm.List = List;\nForm.ErrorList = ErrorListComponent;\nForm.useForm = rcUseForm;\nForm.useFormInstance = useFormInstance;\nForm.useWatch = useWatch;\nForm.Provider = FormProvider;\nForm.create = () => {\n console.warn('Form.create is deprecated. Please use Form.useForm() instead.');\n};\n\nexport type { Rule, RuleObject, RuleRender };\nexport default Form;\n"],"mappings":";;;;;;;;;;AAyGA,SAAS,SAAS,KAGkB;AAClC,KAAI,CAAC,IAAK,QAAO;CACjB,MAAM,IAAyB,EAAE;AACjC,KAAI,IAAI,SAAS,QAAQ,IAAI,SAAS,QAAW;AAE/C,IAAE,QAAQ,GAAI,IAAI,OAAO,KAAM,IAAI;AACnC,IAAE,OAAO,OAAQ,IAAI,OAAO,KAAM,IAAI;;AAExC,KAAI,IAAI,WAAW,QAAQ,IAAI,WAAW,UAAa,IAAI,SAAS,EAClE,GAAE,aAAa,GAAI,IAAI,SAAS,KAAM,IAAI;AAE5C,QAAO;;AAKT,IAAM,UAAU,YAAY,OAAY,QAAa;CACnD,MAAM,cAAc,WAAW,YAAY;CAC3C,MAAM,EACJ,UACA,OAAO,aACP,YACA,QAAQ,EAAE,EACV,WACA,SAAS,cACT,UACA,UACA,YACA,OACA,cACA,GAAG,cACD;CACJ,MAAM,cAAc,aAChB;EAAE,GAAG;EAAO,iBAAiB,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;KACM;eAEZ;KACc,CAAA;;AAKrB,OAAI,SAAS;AACX,QAAI,MAAM,eAAe,SAAS,CAChC,QAAO,MAAM,aACX,UACA,QACD;AAEH,WAAO;;GAIT,IAAI,YAA6B;AACjC,OAAI,MAAM,eAAe,SAAS,CAChC,aAAY,MAAM,aAChB,UACA,QACD;AAGH,UACE,oBAAC,gBAAD;IACS;IACD;IACA;IACC;IACG;IACF;IACG;IACE;IACH;IACE;IACI;IACT;IACM;cAEZ;IACc,CAAA;;EAGf,CAAA;;AAIZ,SAAS,oBAAoB;CAC3B,MAAM,MAAM,WAAW,qBAAqB;AAC5C,QAAO;EACL,QAAQ,IAAI;EACZ,QAAQ,IAAI,UAAU,EAAE;EACxB,UAAU,IAAI,YAAY,EAAE;EAC7B;;AAGH,YAAY,YAAY;AAIxB,SAAS,mBAAmB,OAAuB;CACjD,MAAM,EAAE,QAAQ,cAAc;AAC9B,KAAI,CAAC,UAAU,OAAO,WAAW,EAAG,QAAO;AAC3C,QACE,oBAAC,OAAD;EAAK,WAAW,GAAG,uBAAuB,UAAU;YACjD,OAAO,KAAK,KAAK,MAChB,oBAAC,OAAD;GAEE,WAAU;aAET;GACG,EAJC,EAID,CACN;EACE,CAAA;;AAMV,SAAS,kBAA4C;AAEnD,QADa,WAAW,aAAa;;AAkBvC,IAAM,OAAO;AAEb,KAAK,OAAO;AACZ,KAAK,OAAO;AACZ,KAAK,YAAY;AACjB,KAAK,UAAU;AACf,KAAK,kBAAkB;AACvB,KAAK,WAAW;AAChB,KAAK,WAAW;AAChB,KAAK,eAAe;AAClB,SAAQ,KAAK,gEAAgE"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../src/Form/index.tsx"],"sourcesContent":["import RcForm, {\n Field,\n FormInstance as RcFormInstance,\n FormProvider,\n List,\n useForm as rcUseForm,\n useWatch,\n} from 'rc-field-form';\nimport type { FormProps as RcFormProps } from 'rc-field-form';\nimport FieldContext from 'rc-field-form/es/FieldContext';\nimport type { Rule, RuleObject, RuleRender } from 'rc-field-form/es/interface';\nimport type { Meta, NamePath } from 'rc-field-form/es/interface';\nimport React, { forwardRef, useContext, useMemo } from 'react';\nimport SizeContext, {\n SizeContextProvider,\n} from '../ConfigProvider/sizeContext';\nimport DisabledContext from '../ConfigProvider/DisabledContext';\nimport { cn } from '../lib/utils';\nimport {\n FormContext,\n FormItemInputContext,\n type ValidateStatus,\n} from './FormItemContext';\n\n// FormInstance type compatible with antd\nexport type FormInstance<Values = any> = RcFormInstance<Values>;\n\n// FormProps compatible with antd\nexport interface FormProps<Values = any> extends Omit<RcFormProps, 'form'> {\n form?: FormInstance<Values>;\n layout?: 'horizontal' | 'vertical' | 'inline';\n size?: 'small' | 'middle' | 'large';\n colon?: boolean;\n disabled?: boolean;\n labelCol?: { span?: number; offset?: number };\n wrapperCol?: { span?: number; offset?: number };\n className?: string;\n style?: React.CSSProperties;\n requiredMark?: boolean | 'optional';\n labelWidth?: number;\n labelAlign?: 'left' | 'right';\n}\n\n// FormItemProps\nexport interface FormItemProps {\n name?: NamePath;\n label?: React.ReactNode;\n rules?: Rule[];\n children?: React.ReactNode | ((form: RcFormInstance) => React.ReactNode);\n className?: string;\n style?: React.CSSProperties;\n required?: boolean;\n hidden?: boolean;\n initialValue?: any;\n dependencies?: NamePath[];\n shouldUpdate?: boolean | ((prevValues: any, curValues: any) => boolean);\n help?: React.ReactNode;\n extra?: React.ReactNode;\n validateTrigger?: string | string[];\n valuePropName?: string;\n getValueFromEvent?: (...args: any[]) => any;\n noStyle?: boolean;\n labelWidth?: number;\n tooltip?:\n | React.ReactNode\n | { title?: React.ReactNode; icon?: React.ReactNode };\n labelCol?: { span?: number; offset?: number };\n wrapperCol?: { span?: number; offset?: number };\n validateStatus?: ValidateStatus;\n colon?: boolean;\n trigger?: string;\n normalize?: (value: any, prevValue: any, allValues: any) => any;\n getValueProps?: (value: any) => Record<string, any>;\n}\n\nexport interface ErrorListProps {\n errors?: React.ReactNode[];\n help?: React.ReactNode;\n className?: string;\n}\n\nexport type FormListFieldData = {\n name: number;\n key: number;\n isListField: boolean;\n};\n\nexport type FormListOperation = {\n add: (defaultValue?: any, insertIndex?: number) => void;\n remove: (index: number | number[]) => void;\n move: (from: number, to: number) => void;\n};\n\nexport type FormListProps = {\n name: NamePath;\n rules?: Rule[];\n children: (\n fields: FormListFieldData[],\n operation: FormListOperation,\n meta: { errors: React.ReactNode[] },\n ) => React.ReactNode;\n initialValue?: any[];\n};\n\n// ============== Helpers ==============\n\n/** Convert a 24-column span/offset to Tailwind-compatible inline styles */\nfunction colStyle(col?: {\n span?: number;\n offset?: number;\n}): React.CSSProperties | undefined {\n if (!col) return undefined;\n const s: React.CSSProperties = {};\n if (col.span !== null && col.span !== undefined) {\n // 24-column grid: width = span / 24 * 100%\n s.width = `${(col.span / 24) * 100}%`;\n s.flex = `0 0 ${(col.span / 24) * 100}%`;\n }\n if (col.offset !== null && col.offset !== undefined && col.offset > 0) {\n s.marginLeft = `${(col.offset / 24) * 100}%`;\n }\n return s;\n}\n\n// ============== Form ==============\n\nconst AldForm = forwardRef((props: any, ref: any) => {\n const contextSize = useContext(SizeContext);\n const {\n children,\n size = contextSize,\n labelWidth,\n style = {},\n className,\n layout = 'horizontal',\n disabled,\n labelCol,\n wrapperCol,\n colon,\n requiredMark,\n ...restProps\n } = props;\n const customStyle = labelWidth\n ? { ...style, '--label-width': `${labelWidth}px` }\n : style;\n\n const formContextValue = useMemo(\n () => ({ layout, labelCol, wrapperCol, colon, requiredMark, labelWidth }),\n [layout, labelCol, wrapperCol, colon, requiredMark, labelWidth],\n );\n\n return (\n <FormContext.Provider value={formContextValue}>\n <DisabledContext.Provider value={disabled}>\n <SizeContextProvider size={size}>\n <RcForm\n style={customStyle}\n className={cn('ald-form', `ald-form-${layout}`, className)}\n {...restProps}\n ref={ref}\n >\n {children}\n </RcForm>\n </SizeContextProvider>\n </DisabledContext.Provider>\n </FormContext.Provider>\n );\n}) as <Values = any>(\n props: React.PropsWithChildren<FormProps<Values>> & {\n ref?: React.Ref<FormInstance<Values>>;\n labelWidth?: number;\n },\n) => React.ReactElement;\n\n// ============== Form.Item ==============\n\ninterface IFormItemProps extends FormItemProps {\n labelWidth?: number;\n}\n\n/** Derive status from meta or manual validateStatus */\nfunction deriveStatus(\n meta?: Meta,\n validateStatus?: ValidateStatus,\n): ValidateStatus {\n if (validateStatus) return validateStatus;\n if (!meta) return '';\n if (meta.validating) return 'validating';\n if (meta.errors && meta.errors.length > 0) return 'error';\n if (meta.warnings && meta.warnings.length > 0) return 'warning';\n if (meta.touched) return 'success';\n return '';\n}\n\n/** Status-based border class for the control wrapper */\nfunction statusClassName(status: ValidateStatus): string {\n switch (status) {\n case 'error':\n return 'ald-form-item-has-error';\n case 'warning':\n return 'ald-form-item-has-warning';\n case 'success':\n return 'ald-form-item-has-success';\n case 'validating':\n return 'ald-form-item-is-validating';\n default:\n return '';\n }\n}\n\n/** Render the inner label + control layout, receiving meta from Field */\nfunction FormItemLayout({\n label,\n children,\n meta,\n help,\n extra,\n required,\n hidden,\n className,\n customStyle,\n noStyle,\n labelCol: itemLabelCol,\n wrapperCol: itemWrapperCol,\n validateStatus: manualStatus,\n colon: itemColon,\n formContext,\n}: {\n label?: React.ReactNode;\n children: React.ReactNode;\n meta?: Meta;\n help?: React.ReactNode;\n extra?: React.ReactNode;\n required?: boolean;\n hidden?: boolean;\n className?: string;\n customStyle?: React.CSSProperties;\n noStyle?: boolean;\n labelCol?: { span?: number; offset?: number };\n wrapperCol?: { span?: number; offset?: number };\n validateStatus?: ValidateStatus;\n colon?: boolean;\n formContext: {\n layout?: string;\n labelCol?: { span?: number; offset?: number };\n wrapperCol?: { span?: number; offset?: number };\n colon?: boolean;\n requiredMark?: boolean | 'optional';\n labelWidth?: number;\n };\n}) {\n const status = deriveStatus(meta, manualStatus);\n const errors = useMemo(() => meta?.errors ?? [], [meta?.errors]);\n const warnings = useMemo(() => meta?.warnings ?? [], [meta?.warnings]);\n\n // Provide status context to child controls\n const itemInputContextValue = useMemo(\n () => ({\n status,\n isFormItemInput: true,\n errors,\n warnings,\n }),\n [status, errors, warnings],\n );\n\n if (noStyle) {\n return <>{children}</>;\n }\n\n // Determine if we should show required mark\n const { requiredMark } = formContext;\n const isRequired = required || (meta && (meta as any).required);\n const showRequired = requiredMark !== false && isRequired;\n const showOptional = requiredMark === 'optional' && !isRequired;\n\n // Resolve cols: item-level overrides form-level\n const resolvedLabelCol = itemLabelCol ?? formContext.labelCol;\n const resolvedWrapperCol = itemWrapperCol ?? formContext.wrapperCol;\n const layout = formContext.layout || 'horizontal';\n const showColon =\n (itemColon ?? formContext.colon) !== false && layout === 'horizontal';\n\n // Decide whether to use grid-style layout\n const useGridLayout =\n layout === 'horizontal' && (resolvedLabelCol || resolvedWrapperCol);\n\n // Determine display errors: if help is provided, show help instead of validation errors\n const displayMessages = help !== null && help !== undefined ? [help] : errors;\n const hasError = status === 'error' || (errors.length > 0 && help === null);\n const hasWarning =\n status === 'warning' || (warnings.length > 0 && help === null);\n\n const labelNode =\n label !== null && label !== undefined ? (\n <label\n className={cn(\n 'ald-form-item-label tw-text-sm tw-font-medium tw-text-[var(--content-primary)]',\n layout === 'vertical' && 'tw-mb-1 tw-block',\n layout === 'horizontal' && !useGridLayout && 'tw-mr-3 tw-shrink-0',\n layout === 'horizontal' && formContext.labelWidth && 'tw-shrink-0',\n )}\n style={\n !useGridLayout && layout === 'horizontal' && formContext.labelWidth\n ? { width: `var(--label-width, ${formContext.labelWidth}px)` }\n : useGridLayout\n ? colStyle(resolvedLabelCol)\n : undefined\n }\n >\n {showRequired && (\n <span className=\"tw-mr-1 tw-text-[var(--content-negative-primary)]\">\n *\n </span>\n )}\n {label}\n {showOptional && (\n <span className=\"tw-ml-1 tw-text-xs tw-font-normal tw-text-[var(--content-secondary)]\">\n (optional)\n </span>\n )}\n {showColon && label ? ':' : null}\n </label>\n ) : null;\n\n const controlNode = (\n <div\n className={cn(\n 'ald-form-item-control',\n layout === 'horizontal' && 'tw-flex-1',\n )}\n style={useGridLayout ? colStyle(resolvedWrapperCol) : undefined}\n >\n <FormItemInputContext.Provider value={itemInputContextValue}>\n <div className=\"ald-form-item-control-input\">{children}</div>\n </FormItemInputContext.Provider>\n {displayMessages.length > 0 && (\n <div\n className={cn(\n 'ald-form-item-explain tw-mt-1 tw-text-xs tw-transition-all tw-duration-200',\n hasError && 'tw-text-[var(--content-negative-secondary)]',\n hasWarning &&\n !hasError &&\n 'tw-text-[color:var(--content-warning-primary,#faad14)]',\n !hasError &&\n !hasWarning &&\n help !== null &&\n help !== undefined &&\n 'tw-text-[var(--content-secondary)]',\n )}\n >\n {displayMessages.map((msg, i) => (\n <div key={i}>{msg}</div>\n ))}\n </div>\n )}\n {extra && (\n <div className=\"ald-form-item-extra tw-mt-1 tw-text-xs tw-text-[var(--content-secondary)]\">\n {extra}\n </div>\n )}\n </div>\n );\n\n return (\n <div\n className={cn(\n 'ald-form-item tw-mb-6',\n hidden && 'tw-hidden',\n showRequired && 'ald-form-item-required',\n statusClassName(status),\n layout === 'horizontal' && 'tw-flex tw-flex-row tw-items-start',\n layout === 'inline' &&\n 'tw-mr-4 tw-inline-flex tw-flex-row tw-items-start',\n className,\n )}\n style={customStyle as React.CSSProperties}\n >\n {labelNode}\n {controlNode}\n </div>\n );\n}\n\nconst AldFormItem = function (props: IFormItemProps) {\n const {\n labelWidth,\n style = {},\n label,\n name,\n rules,\n children,\n className,\n required,\n hidden,\n initialValue,\n dependencies,\n shouldUpdate,\n help,\n extra,\n validateTrigger,\n valuePropName,\n getValueFromEvent,\n normalize,\n getValueProps,\n noStyle,\n labelCol,\n wrapperCol,\n validateStatus,\n colon,\n } = props;\n\n const formContext = useContext(FormContext);\n\n const customStyle = labelWidth\n ? { ...style, '--label-width': `${labelWidth}px` }\n : style;\n\n // If no name is provided (e.g. a submit button wrapper), we don't need Field\n // Also when shouldUpdate or dependencies are used without name, Field is still needed for re-render\n const needField =\n (name !== null && name !== undefined) ||\n (shouldUpdate !== null && shouldUpdate !== undefined) ||\n (dependencies !== null && dependencies !== undefined);\n\n if (!needField) {\n return (\n <FormItemLayout\n label={label}\n help={help}\n extra={extra}\n required={required}\n hidden={hidden}\n className={className}\n customStyle={customStyle as React.CSSProperties}\n noStyle={noStyle}\n labelCol={labelCol}\n wrapperCol={wrapperCol}\n validateStatus={validateStatus}\n colon={colon}\n formContext={formContext}\n >\n {children as React.ReactNode}\n </FormItemLayout>\n );\n }\n\n return (\n <Field\n name={name}\n rules={rules}\n initialValue={initialValue}\n dependencies={dependencies}\n shouldUpdate={shouldUpdate}\n validateTrigger={validateTrigger}\n valuePropName={valuePropName}\n getValueFromEvent={getValueFromEvent}\n normalize={normalize}\n getValueProps={getValueProps}\n >\n {(control, meta, form) => {\n // If children is a render function (shouldUpdate / dependencies pattern),\n // call it with the form instance and wrap in layout\n if (typeof children === 'function') {\n const childContent = (\n children as (form: RcFormInstance) => React.ReactNode\n )(form);\n if (noStyle) {\n return childContent;\n }\n return (\n <FormItemLayout\n label={label}\n meta={meta}\n help={help}\n extra={extra}\n required={required}\n hidden={hidden}\n className={className}\n customStyle={customStyle as React.CSSProperties}\n noStyle={noStyle}\n labelCol={labelCol}\n wrapperCol={wrapperCol}\n validateStatus={validateStatus}\n colon={colon}\n formContext={formContext}\n >\n {childContent}\n </FormItemLayout>\n );\n }\n\n // For noStyle, just clone with control props\n if (noStyle) {\n if (React.isValidElement(children)) {\n return React.cloneElement(\n children as React.ReactElement<any>,\n control,\n );\n }\n return children;\n }\n\n // Clone control props onto the single child element\n let childNode: React.ReactNode = children;\n if (React.isValidElement(children)) {\n childNode = React.cloneElement(\n children as React.ReactElement<any>,\n control,\n );\n }\n\n return (\n <FormItemLayout\n label={label}\n meta={meta}\n help={help}\n extra={extra}\n required={required}\n hidden={hidden}\n className={className}\n customStyle={customStyle as React.CSSProperties}\n labelCol={labelCol}\n wrapperCol={wrapperCol}\n validateStatus={validateStatus}\n colon={colon}\n formContext={formContext}\n >\n {childNode}\n </FormItemLayout>\n );\n }}\n </Field>\n );\n};\n\nfunction useFormItemStatus() {\n const ctx = useContext(FormItemInputContext);\n return {\n status: ctx.status,\n errors: ctx.errors ?? [],\n warnings: ctx.warnings ?? [],\n };\n}\n\nAldFormItem.useStatus = useFormItemStatus;\n\n// ============== ErrorList ==============\n\nfunction ErrorListComponent(props: ErrorListProps) {\n const { errors, className } = props;\n if (!errors || errors.length === 0) return null;\n return (\n <div className={cn('ald-form-error-list', className)}>\n {errors.map((err, i) => (\n <div\n key={i}\n className=\"tw-text-xs tw-text-[var(--content-negative-secondary)]\"\n >\n {err}\n </div>\n ))}\n </div>\n );\n}\n\n// ============== useFormInstance ==============\n\nfunction useFormInstance<T = any>(): FormInstance<T> {\n const form = useContext(FieldContext);\n return form as unknown as FormInstance<T>;\n}\n\n// ============== Compound component ==============\n\ntype InternalFormType = typeof AldForm;\ntype CompoundedComponent = InternalFormType & {\n useForm: <T = any>(...args: any[]) => [FormInstance<T>];\n useFormInstance: typeof useFormInstance;\n useWatch: typeof useWatch;\n Item: typeof AldFormItem;\n List: typeof List;\n ErrorList: typeof ErrorListComponent;\n Provider: typeof FormProvider;\n create: () => void;\n};\n\nconst Form = AldForm as CompoundedComponent;\n\nForm.Item = AldFormItem;\nForm.List = List;\nForm.ErrorList = ErrorListComponent;\nForm.useForm = rcUseForm;\nForm.useFormInstance = useFormInstance;\nForm.useWatch = useWatch;\nForm.Provider = FormProvider;\nForm.create = () => {\n console.warn('Form.create is deprecated. Please use Form.useForm() instead.');\n};\n\nexport type { Rule, RuleObject, RuleRender };\nexport default Form;\n"],"mappings":";;;;;;;;;;AA2GA,SAAS,SAAS,KAGkB;AAClC,KAAI,CAAC,IAAK,QAAO;CACjB,MAAM,IAAyB,EAAE;AACjC,KAAI,IAAI,SAAS,QAAQ,IAAI,SAAS,QAAW;AAE/C,IAAE,QAAQ,GAAI,IAAI,OAAO,KAAM,IAAI;AACnC,IAAE,OAAO,OAAQ,IAAI,OAAO,KAAM,IAAI;;AAExC,KAAI,IAAI,WAAW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,UAAU;AACf,KAAK,kBAAkB;AACvB,KAAK,WAAW;AAChB,KAAK,WAAW;AAChB,KAAK,eAAe;AAClB,SAAQ,KAAK,gEAAgE"}
package/dist/index.d.ts CHANGED
@@ -3,6 +3,8 @@ export type MenuClickEventHandler = (info: {
3
3
  keyPath: string[];
4
4
  domEvent: React.MouseEvent<HTMLElement> | React.KeyboardEvent<HTMLElement>;
5
5
  }) => void;
6
+ export { default as localeZhCN } from './locale/zh_CN.js';
7
+ export { default as localeEnUS } from './locale/en_US.js';
6
8
  export { default as AProgress } from './AProgress.js';
7
9
  export { default as Alert } from './Alert.js';
8
10
  export type { AlertProps } from './Alert.js';
package/dist/index.js CHANGED
@@ -1,4 +1,6 @@
1
1
  /* empty css */
2
+ import localeValues$1 from "./locale/zh_CN.js";
3
+ import localeValues from "./locale/en_US.js";
2
4
  import AProgress from "./AProgress/index.js";
3
5
  import Alert from "./Alert/index.js";
4
6
  import AldApp from "./App/index.js";
@@ -68,4 +70,4 @@ import Watermark from "./Watermark/index.js";
68
70
  import notification from "./notification/index.js";
69
71
  import AMenu from "./AMenu/index.js";
70
72
  import Tour from "./Tour/index.js";
71
- export { AMenu, AProgress, Select_default as AldSelect, Alert, AldApp as App, Avatar, Badge, Breadcrumb, Button_default as Button, Card, Carousel, Checkbox, Col, Collapse, ColorPicker, AldCustomConfigProvider as ConfigProvider, DataPreviewTable_default as DataPreviewTable, DatePicker, DisplayLogicTree, Divider, Drawer, Dropdown, ELogicType, EMemberPicker, ENodeType, EUserType, Empty, Form, HighlightText, IconButton, Input, InputNumber, InputSearch, Layout, List, LogicTree, MemberSelector as MemberPicker, Menu, Modal, OverflowCount, Pagination, Popconfirm, Popover, Progress_default as Progress, Radio, RenameInput, Result, Row, ScrollArea_default as ScrollArea, Select_default as Select, Skeleton, Slider, Space, CustomSpin as Spin, StatusLight, Steps, Switch, Table_default as Table, Tabs, Tag, TextLink, Tooltip, Tour, Tree, Typography, Upload, User, Watermark, getInitialLogicNode, logicTreeIterator, message, notification };
73
+ export { AMenu, AProgress, Select_default as AldSelect, Alert, AldApp as App, Avatar, Badge, Breadcrumb, Button_default as Button, Card, Carousel, Checkbox, Col, Collapse, ColorPicker, AldCustomConfigProvider as ConfigProvider, DataPreviewTable_default as DataPreviewTable, DatePicker, DisplayLogicTree, Divider, Drawer, Dropdown, ELogicType, EMemberPicker, ENodeType, EUserType, Empty, Form, HighlightText, IconButton, Input, InputNumber, InputSearch, Layout, List, LogicTree, MemberSelector as MemberPicker, Menu, Modal, OverflowCount, Pagination, Popconfirm, Popover, Progress_default as Progress, Radio, RenameInput, Result, Row, ScrollArea_default as ScrollArea, Select_default as Select, Skeleton, Slider, Space, CustomSpin as Spin, StatusLight, Steps, Switch, Table_default as Table, Tabs, Tag, TextLink, Tooltip, Tour, Tree, Typography, Upload, User, Watermark, getInitialLogicNode, localeValues as localeEnUS, localeValues$1 as localeZhCN, logicTreeIterator, message, notification };
@@ -10,6 +10,7 @@ export declare const defaultLocale: {
10
10
  export declare const LocaleContext: import('react').Context<Locale>;
11
11
  export declare function getTranslator(lang?: string): {
12
12
  locale: string;
13
+ DatePicker: import('rc-picker/es/interface').Locale;
13
14
  Empty: {
14
15
  noContentFound: string;
15
16
  };
@@ -27,6 +28,7 @@ export declare function getTranslator(lang?: string): {
27
28
  };
28
29
  MemberPicker: {
29
30
  select: string;
31
+ ban: string;
30
32
  pleaseConfigGetUserByKeywordsMethod: string;
31
33
  pleaseConfigGetUserByIdsMethod: string;
32
34
  noData: string;
@@ -36,7 +38,6 @@ export declare function getTranslator(lang?: string): {
36
38
  selectedTotal: (total: number) => string;
37
39
  cancel: string;
38
40
  confirm: string;
39
- ban: string;
40
41
  };
41
42
  Modal: {
42
43
  cancel: string;
@@ -1,5 +1,5 @@
1
- import localeValues from "./en_US.js";
2
- import localeValues$1 from "./zh_CN.js";
1
+ import localeValues from "./zh_CN.js";
2
+ import localeValues$1 from "./en_US.js";
3
3
  import { createContext } from "react";
4
4
  //#region src/locale/default.ts
5
5
  var ELangType = /* @__PURE__ */ function(ELangType) {
@@ -10,8 +10,8 @@ var ELangType = /* @__PURE__ */ function(ELangType) {
10
10
  var defaultLocale = { locale: ELangType.ZH_CN };
11
11
  var LocaleContext = createContext(defaultLocale);
12
12
  function getTranslator(lang) {
13
- if (lang === ELangType.ZH_CN) return localeValues$1;
14
- return localeValues;
13
+ if (lang === ELangType.ZH_CN) return localeValues;
14
+ return localeValues$1;
15
15
  }
16
16
  //#endregion
17
17
  export { ELangType, LocaleContext, defaultLocale, getTranslator };
@@ -1,5 +1,6 @@
1
1
  declare const localeValues: {
2
2
  locale: string;
3
+ DatePicker: import('rc-picker/es/interface').Locale;
3
4
  Empty: {
4
5
  noContentFound: string;
5
6
  };
@@ -1,6 +1,8 @@
1
+ import enUSDatePicker from "rc-picker/es/locale/en_US";
1
2
  //#region src/locale/en_US.ts
2
3
  var localeValues = {
3
4
  locale: "en",
5
+ DatePicker: enUSDatePicker,
4
6
  Empty: { noContentFound: "No Content Found" },
5
7
  ColorPicker: {
6
8
  default: "Default",
@@ -1 +1 @@
1
- {"version":3,"file":"en_US.js","names":[],"sources":["../../src/locale/en_US.ts"],"sourcesContent":["const localeValues = {\n locale: 'en',\n Empty: {\n noContentFound: 'No Content Found',\n },\n ColorPicker: {\n default: 'Default',\n standardColor: 'Standard Color',\n recentlyUsed: 'Recently Used',\n },\n DataPreviewTable: {\n dataLoadFailed: 'Data loading failed',\n loadFailed: 'Loading failed',\n },\n InputSearch: {\n search: 'Search',\n },\n MemberPicker: {\n select: 'Select',\n pleaseConfigGetUserByKeywordsMethod:\n 'Please configure the getUsersByKeywords method in ConfigProvider',\n pleaseConfigGetUserByIdsMethod:\n 'Please configure the getUsersByIds method in ConfigProvider',\n noData: 'No Data',\n subLevel: 'Sub-level',\n users: 'Users',\n userGroups: 'User Groups',\n selectedTotal: (total: number) => `Selected ${total}`,\n cancel: 'Cancel',\n confirm: 'Confirm',\n ban: 'Banned',\n },\n Modal: {\n cancel: 'Cancel',\n sure: 'Ok',\n },\n Select: {\n noSearchResult: 'No search results',\n all: 'All',\n },\n Tree: {\n expand: 'Expand',\n },\n Table: {\n cancelSelect: 'Cancel Selection',\n selected: 'Selected ',\n item: ' items',\n selectAll: 'Select All',\n },\n ErrorBoundary: {\n happenedError: 'An error occurred',\n },\n LogicTree: {\n btn: {\n addCondition: 'Add condition',\n addRelation: 'Add relation',\n },\n select: {\n and: 'And',\n or: 'Or',\n },\n },\n Pagination: {\n itemsPerPage: '/ page',\n selectPageSize: 'Select size',\n totalItems: (total: number, range: [number, number]) =>\n `Total ${total} items, showing ${range[0]}-${range[1]}`,\n },\n};\n\nexport default localeValues;\n"],"mappings":";AAAA,IAAM,eAAe;CACnB,QAAQ;CACR,OAAO,EACL,gBAAgB,oBACjB;CACD,aAAa;EACX,SAAS;EACT,eAAe;EACf,cAAc;EACf;CACD,kBAAkB;EAChB,gBAAgB;EAChB,YAAY;EACb;CACD,aAAa,EACX,QAAQ,UACT;CACD,cAAc;EACZ,QAAQ;EACR,qCACE;EACF,gCACE;EACF,QAAQ;EACR,UAAU;EACV,OAAO;EACP,YAAY;EACZ,gBAAgB,UAAkB,YAAY;EAC9C,QAAQ;EACR,SAAS;EACT,KAAK;EACN;CACD,OAAO;EACL,QAAQ;EACR,MAAM;EACP;CACD,QAAQ;EACN,gBAAgB;EAChB,KAAK;EACN;CACD,MAAM,EACJ,QAAQ,UACT;CACD,OAAO;EACL,cAAc;EACd,UAAU;EACV,MAAM;EACN,WAAW;EACZ;CACD,eAAe,EACb,eAAe,qBAChB;CACD,WAAW;EACT,KAAK;GACH,cAAc;GACd,aAAa;GACd;EACD,QAAQ;GACN,KAAK;GACL,IAAI;GACL;EACF;CACD,YAAY;EACV,cAAc;EACd,gBAAgB;EAChB,aAAa,OAAe,UAC1B,SAAS,MAAM,kBAAkB,MAAM,GAAG,GAAG,MAAM;EACtD;CACF"}
1
+ {"version":3,"file":"en_US.js","names":[],"sources":["../../src/locale/en_US.ts"],"sourcesContent":["import enUSDatePicker from 'rc-picker/es/locale/en_US';\n\nconst localeValues = {\n locale: 'en',\n DatePicker: enUSDatePicker,\n Empty: {\n noContentFound: 'No Content Found',\n },\n ColorPicker: {\n default: 'Default',\n standardColor: 'Standard Color',\n recentlyUsed: 'Recently Used',\n },\n DataPreviewTable: {\n dataLoadFailed: 'Data loading failed',\n loadFailed: 'Loading failed',\n },\n InputSearch: {\n search: 'Search',\n },\n MemberPicker: {\n select: 'Select',\n pleaseConfigGetUserByKeywordsMethod:\n 'Please configure the getUsersByKeywords method in ConfigProvider',\n pleaseConfigGetUserByIdsMethod:\n 'Please configure the getUsersByIds method in ConfigProvider',\n noData: 'No Data',\n subLevel: 'Sub-level',\n users: 'Users',\n userGroups: 'User Groups',\n selectedTotal: (total: number) => `Selected ${total}`,\n cancel: 'Cancel',\n confirm: 'Confirm',\n ban: 'Banned',\n },\n Modal: {\n cancel: 'Cancel',\n sure: 'Ok',\n },\n Select: {\n noSearchResult: 'No search results',\n all: 'All',\n },\n Tree: {\n expand: 'Expand',\n },\n Table: {\n cancelSelect: 'Cancel Selection',\n selected: 'Selected ',\n item: ' items',\n selectAll: 'Select All',\n },\n ErrorBoundary: {\n happenedError: 'An error occurred',\n },\n LogicTree: {\n btn: {\n addCondition: 'Add condition',\n addRelation: 'Add relation',\n },\n select: {\n and: 'And',\n or: 'Or',\n },\n },\n Pagination: {\n itemsPerPage: '/ page',\n selectPageSize: 'Select size',\n totalItems: (total: number, range: [number, number]) =>\n `Total ${total} items, showing ${range[0]}-${range[1]}`,\n },\n};\n\nexport default localeValues;\n"],"mappings":";;AAEA,IAAM,eAAe;CACnB,QAAQ;CACR,YAAY;CACZ,OAAO,EACL,gBAAgB,oBACjB;CACD,aAAa;EACX,SAAS;EACT,eAAe;EACf,cAAc;EACf;CACD,kBAAkB;EAChB,gBAAgB;EAChB,YAAY;EACb;CACD,aAAa,EACX,QAAQ,UACT;CACD,cAAc;EACZ,QAAQ;EACR,qCACE;EACF,gCACE;EACF,QAAQ;EACR,UAAU;EACV,OAAO;EACP,YAAY;EACZ,gBAAgB,UAAkB,YAAY;EAC9C,QAAQ;EACR,SAAS;EACT,KAAK;EACN;CACD,OAAO;EACL,QAAQ;EACR,MAAM;EACP;CACD,QAAQ;EACN,gBAAgB;EAChB,KAAK;EACN;CACD,MAAM,EACJ,QAAQ,UACT;CACD,OAAO;EACL,cAAc;EACd,UAAU;EACV,MAAM;EACN,WAAW;EACZ;CACD,eAAe,EACb,eAAe,qBAChB;CACD,WAAW;EACT,KAAK;GACH,cAAc;GACd,aAAa;GACd;EACD,QAAQ;GACN,KAAK;GACL,IAAI;GACL;EACF;CACD,YAAY;EACV,cAAc;EACd,gBAAgB;EAChB,aAAa,OAAe,UAC1B,SAAS,MAAM,kBAAkB,MAAM,GAAG,GAAG,MAAM;EACtD;CACF"}
@@ -1,5 +1,6 @@
1
1
  declare const localeValues: {
2
2
  locale: string;
3
+ DatePicker: import('rc-picker/es/interface').Locale;
3
4
  Empty: {
4
5
  noContentFound: string;
5
6
  };
@@ -1,6 +1,8 @@
1
+ import zhCNDatePicker from "rc-picker/es/locale/zh_CN";
1
2
  //#region src/locale/zh_CN.ts
2
3
  var localeValues = {
3
4
  locale: "zh-cn",
5
+ DatePicker: zhCNDatePicker,
4
6
  Empty: { noContentFound: "未找到内容" },
5
7
  ColorPicker: {
6
8
  default: "默认",
@@ -1 +1 @@
1
- {"version":3,"file":"zh_CN.js","names":[],"sources":["../../src/locale/zh_CN.ts"],"sourcesContent":["const localeValues = {\n locale: 'zh-cn',\n Empty: {\n noContentFound: '未找到内容',\n },\n ColorPicker: {\n default: '默认',\n standardColor: '标准色',\n recentlyUsed: '最近使用',\n },\n DataPreviewTable: {\n dataLoadFailed: '数据加载失败',\n loadFailed: '加载失败',\n },\n InputSearch: {\n search: '搜索',\n },\n MemberPicker: {\n select: '选择',\n ban: '已停用',\n pleaseConfigGetUserByKeywordsMethod:\n '请在ConfigProvider中配置getUsersByKeywords方法',\n pleaseConfigGetUserByIdsMethod: '请在ConfigProvider中配置getUsersByIds方法',\n noData: '无数据',\n subLevel: '下级',\n users: '用户',\n userGroups: '用户组',\n selectedTotal: (total: number) => `已选 ${total}`,\n cancel: '取消',\n confirm: '确定',\n },\n Modal: {\n cancel: '取消',\n sure: '确定',\n },\n Select: {\n noSearchResult: '无搜索结果',\n all: '全部',\n },\n Tree: {\n expand: '展开',\n },\n Table: {\n cancelSelect: '取消选择',\n selected: '已选',\n item: '个',\n selectAll: '全选',\n },\n ErrorBoundary: {\n happenedError: '发生了错误',\n },\n LogicTree: {\n btn: {\n addCondition: '添加条件',\n addRelation: '添加关系',\n },\n select: {\n and: '且',\n or: '或',\n },\n },\n Pagination: {\n itemsPerPage: '条/页',\n selectPageSize: '选择条数',\n totalItems: (total: number, range: [number, number]) =>\n `共 ${total} 条,当前第 ${range[0]}-${range[1]} 条`,\n },\n};\n\nexport default localeValues;\n"],"mappings":";AAAA,IAAM,eAAe;CACnB,QAAQ;CACR,OAAO,EACL,gBAAgB,SACjB;CACD,aAAa;EACX,SAAS;EACT,eAAe;EACf,cAAc;EACf;CACD,kBAAkB;EAChB,gBAAgB;EAChB,YAAY;EACb;CACD,aAAa,EACX,QAAQ,MACT;CACD,cAAc;EACZ,QAAQ;EACR,KAAK;EACL,qCACE;EACF,gCAAgC;EAChC,QAAQ;EACR,UAAU;EACV,OAAO;EACP,YAAY;EACZ,gBAAgB,UAAkB,MAAM;EACxC,QAAQ;EACR,SAAS;EACV;CACD,OAAO;EACL,QAAQ;EACR,MAAM;EACP;CACD,QAAQ;EACN,gBAAgB;EAChB,KAAK;EACN;CACD,MAAM,EACJ,QAAQ,MACT;CACD,OAAO;EACL,cAAc;EACd,UAAU;EACV,MAAM;EACN,WAAW;EACZ;CACD,eAAe,EACb,eAAe,SAChB;CACD,WAAW;EACT,KAAK;GACH,cAAc;GACd,aAAa;GACd;EACD,QAAQ;GACN,KAAK;GACL,IAAI;GACL;EACF;CACD,YAAY;EACV,cAAc;EACd,gBAAgB;EAChB,aAAa,OAAe,UAC1B,KAAK,MAAM,SAAS,MAAM,GAAG,GAAG,MAAM,GAAG;EAC5C;CACF"}
1
+ {"version":3,"file":"zh_CN.js","names":[],"sources":["../../src/locale/zh_CN.ts"],"sourcesContent":["import zhCNDatePicker from 'rc-picker/es/locale/zh_CN';\n\nconst localeValues = {\n locale: 'zh-cn',\n DatePicker: zhCNDatePicker,\n Empty: {\n noContentFound: '未找到内容',\n },\n ColorPicker: {\n default: '默认',\n standardColor: '标准色',\n recentlyUsed: '最近使用',\n },\n DataPreviewTable: {\n dataLoadFailed: '数据加载失败',\n loadFailed: '加载失败',\n },\n InputSearch: {\n search: '搜索',\n },\n MemberPicker: {\n select: '选择',\n ban: '已停用',\n pleaseConfigGetUserByKeywordsMethod:\n '请在ConfigProvider中配置getUsersByKeywords方法',\n pleaseConfigGetUserByIdsMethod: '请在ConfigProvider中配置getUsersByIds方法',\n noData: '无数据',\n subLevel: '下级',\n users: '用户',\n userGroups: '用户组',\n selectedTotal: (total: number) => `已选 ${total}`,\n cancel: '取消',\n confirm: '确定',\n },\n Modal: {\n cancel: '取消',\n sure: '确定',\n },\n Select: {\n noSearchResult: '无搜索结果',\n all: '全部',\n },\n Tree: {\n expand: '展开',\n },\n Table: {\n cancelSelect: '取消选择',\n selected: '已选',\n item: '个',\n selectAll: '全选',\n },\n ErrorBoundary: {\n happenedError: '发生了错误',\n },\n LogicTree: {\n btn: {\n addCondition: '添加条件',\n addRelation: '添加关系',\n },\n select: {\n and: '且',\n or: '或',\n },\n },\n Pagination: {\n itemsPerPage: '条/页',\n selectPageSize: '选择条数',\n totalItems: (total: number, range: [number, number]) =>\n `共 ${total} 条,当前第 ${range[0]}-${range[1]} 条`,\n },\n};\n\nexport default localeValues;\n"],"mappings":";;AAEA,IAAM,eAAe;CACnB,QAAQ;CACR,YAAY;CACZ,OAAO,EACL,gBAAgB,SACjB;CACD,aAAa;EACX,SAAS;EACT,eAAe;EACf,cAAc;EACf;CACD,kBAAkB;EAChB,gBAAgB;EAChB,YAAY;EACb;CACD,aAAa,EACX,QAAQ,MACT;CACD,cAAc;EACZ,QAAQ;EACR,KAAK;EACL,qCACE;EACF,gCAAgC;EAChC,QAAQ;EACR,UAAU;EACV,OAAO;EACP,YAAY;EACZ,gBAAgB,UAAkB,MAAM;EACxC,QAAQ;EACR,SAAS;EACV;CACD,OAAO;EACL,QAAQ;EACR,MAAM;EACP;CACD,QAAQ;EACN,gBAAgB;EAChB,KAAK;EACN;CACD,MAAM,EACJ,QAAQ,MACT;CACD,OAAO;EACL,cAAc;EACd,UAAU;EACV,MAAM;EACN,WAAW;EACZ;CACD,eAAe,EACb,eAAe,SAChB;CACD,WAAW;EACT,KAAK;GACH,cAAc;GACd,aAAa;GACd;EACD,QAAQ;GACN,KAAK;GACL,IAAI;GACL;EACF;CACD,YAAY;EACV,cAAc;EACd,gBAAgB;EAChB,aAAa,OAAe,UAC1B,KAAK,MAAM,SAAS,MAAM,GAAG,GAAG,MAAM,GAAG;EAC5C;CACF"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aloudata/aloudata-design",
3
- "version": "3.0.0-beta.1",
3
+ "version": "3.0.0-beta.3",
4
4
  "description": "",
5
5
  "license": "MIT",
6
6
  "sideEffects": [