@react-querybuilder/antd 8.23.0 → 8.24.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.
- package/dist/cjs/react-querybuilder_antd.cjs.development.d.ts +14 -15
- package/dist/cjs/react-querybuilder_antd.cjs.development.js +1 -0
- package/dist/cjs/react-querybuilder_antd.cjs.development.js.map +1 -1
- package/dist/cjs/react-querybuilder_antd.cjs.production.d.ts +14 -15
- package/dist/cjs/react-querybuilder_antd.cjs.production.js +1 -1
- package/dist/cjs/react-querybuilder_antd.cjs.production.js.map +1 -1
- package/dist/react-querybuilder_antd.d.mts +14 -15
- package/dist/react-querybuilder_antd.legacy-esm.d.ts +14 -15
- package/dist/react-querybuilder_antd.legacy-esm.js +9 -8
- package/dist/react-querybuilder_antd.legacy-esm.js.map +1 -1
- package/dist/react-querybuilder_antd.mjs +2 -1
- package/dist/react-querybuilder_antd.mjs.map +1 -1
- package/dist/react-querybuilder_antd.production.d.mts +14 -15
- package/dist/react-querybuilder_antd.production.mjs +1 -1
- package/dist/react-querybuilder_antd.production.mjs.map +1 -1
- package/package.json +14 -14
|
@@ -8,75 +8,74 @@ type RemoveDataIndexKeys<T> = { [K in keyof T as `data-${string}` extends K ? ne
|
|
|
8
8
|
/**
|
|
9
9
|
* @group Props
|
|
10
10
|
*/
|
|
11
|
-
interface AntDActionProps extends ActionProps, RemoveDataIndexKeys<ComponentPropsWithoutRef<typeof Button>> {}
|
|
11
|
+
export interface AntDActionProps extends ActionProps, RemoveDataIndexKeys<ComponentPropsWithoutRef<typeof Button>> {}
|
|
12
12
|
/**
|
|
13
13
|
* @group Components
|
|
14
14
|
*/
|
|
15
|
-
declare const AntDActionElement: ({ className, handleOnClick, label, title, disabled, disabledTranslation, testID: _testID, level: _level, path: _path, context: _context, validation: _validation, ruleOrGroup: _ruleOrGroup, schema: _schema, ...extraProps }: AntDActionProps) => React.JSX.Element;
|
|
15
|
+
export declare const AntDActionElement: ({ className, handleOnClick, label, title, disabled, disabledTranslation, testID: _testID, level: _level, path: _path, context: _context, validation: _validation, ruleOrGroup: _ruleOrGroup, schema: _schema, ...extraProps }: AntDActionProps) => React.JSX.Element;
|
|
16
16
|
//#endregion
|
|
17
17
|
//#region src/AntDDragHandle.d.ts
|
|
18
18
|
/**
|
|
19
19
|
* @group Props
|
|
20
20
|
*/
|
|
21
|
-
type AntDDragHandleProps = DragHandleProps & {
|
|
21
|
+
export type AntDDragHandleProps = DragHandleProps & {
|
|
22
22
|
label?: any;
|
|
23
23
|
} & ComponentPropsWithRef<typeof HolderOutlined>;
|
|
24
24
|
/**
|
|
25
25
|
* @group Components
|
|
26
26
|
*/
|
|
27
|
-
declare const AntDDragHandle: React.ForwardRefExoticComponent<Omit<AntDDragHandleProps, "ref"> & React.RefAttributes<HTMLSpanElement>>;
|
|
27
|
+
export declare const AntDDragHandle: React.ForwardRefExoticComponent<Omit<AntDDragHandleProps, "ref"> & React.RefAttributes<HTMLSpanElement>>;
|
|
28
28
|
//#endregion
|
|
29
29
|
//#region src/AntDNotToggle.d.ts
|
|
30
30
|
/**
|
|
31
31
|
* @group Props
|
|
32
32
|
*/
|
|
33
|
-
interface AntDNotToggleProps extends NotToggleProps, ComponentPropsWithoutRef<typeof Switch> {}
|
|
33
|
+
export interface AntDNotToggleProps extends NotToggleProps, ComponentPropsWithoutRef<typeof Switch> {}
|
|
34
34
|
/**
|
|
35
35
|
* @group Components
|
|
36
36
|
*/
|
|
37
|
-
declare const AntDNotToggle: ({ className, handleOnChange, label, checked, title, disabled, path: _path, context: _context, validation: _validation, testID: _testID, schema: _schema, ruleGroup: _ruleGroup, ...extraProps }: AntDNotToggleProps) => React.JSX.Element;
|
|
37
|
+
export declare const AntDNotToggle: ({ className, handleOnChange, label, checked, title, disabled, path: _path, context: _context, validation: _validation, testID: _testID, schema: _schema, ruleGroup: _ruleGroup, ...extraProps }: AntDNotToggleProps) => React.JSX.Element;
|
|
38
38
|
//#endregion
|
|
39
39
|
//#region src/AntDShiftActions.d.ts
|
|
40
40
|
/**
|
|
41
41
|
* @group Components
|
|
42
42
|
*/
|
|
43
|
-
declare const AntDShiftActions: ({ shiftUp, shiftDown, shiftUpDisabled, shiftDownDisabled, disabled, className, labels, titles, testID }: ShiftActionsProps) => React.JSX.Element;
|
|
43
|
+
export declare const AntDShiftActions: ({ shiftUp, shiftDown, shiftUpDisabled, shiftDownDisabled, disabled, className, labels, titles, testID }: ShiftActionsProps) => React.JSX.Element;
|
|
44
44
|
//#endregion
|
|
45
45
|
//#region src/AntDValueEditor.d.ts
|
|
46
46
|
/**
|
|
47
47
|
* @group Props
|
|
48
48
|
*/
|
|
49
|
-
interface AntDValueEditorProps extends ValueEditorProps {
|
|
49
|
+
export interface AntDValueEditorProps extends ValueEditorProps {
|
|
50
50
|
extraProps?: Record<string, unknown>;
|
|
51
51
|
}
|
|
52
52
|
/**
|
|
53
53
|
* @group Components
|
|
54
54
|
*/
|
|
55
|
-
declare const AntDValueEditor: (allProps: AntDValueEditorProps) => React.JSX.Element | null;
|
|
55
|
+
export declare const AntDValueEditor: (allProps: AntDValueEditorProps) => React.JSX.Element | null;
|
|
56
56
|
//#endregion
|
|
57
57
|
//#region src/AntDValueSelector.d.ts
|
|
58
58
|
/**
|
|
59
59
|
* @group Props
|
|
60
60
|
*/
|
|
61
|
-
type AntDValueSelectorProps = VersatileSelectorProps & Omit<ComponentPropsWithoutRef<typeof Select>, "onChange" | "defaultValue">;
|
|
61
|
+
export type AntDValueSelectorProps = VersatileSelectorProps & Omit<ComponentPropsWithoutRef<typeof Select>, "onChange" | "defaultValue">;
|
|
62
62
|
/**
|
|
63
63
|
* @group Components
|
|
64
64
|
*/
|
|
65
|
-
declare const AntDValueSelector: ({ className, handleOnChange, options, value, title, disabled, multiple, listsAsArrays, testID: _testID, rule: _rule, ruleGroup: _ruleGroup, rules: _rules, level: _level, path: _path, context: _context, validation: _validation, operator: _operator, field: _field, fieldData: _fieldData, schema: _schema, ...extraProps }: AntDValueSelectorProps) => React.JSX.Element;
|
|
65
|
+
export declare const AntDValueSelector: ({ className, handleOnChange, options, value, title, disabled, multiple, listsAsArrays, testID: _testID, rule: _rule, ruleGroup: _ruleGroup, rules: _rules, level: _level, path: _path, context: _context, validation: _validation, operator: _operator, field: _field, fieldData: _fieldData, schema: _schema, ...extraProps }: AntDValueSelectorProps) => React.JSX.Element;
|
|
66
66
|
//#endregion
|
|
67
67
|
//#region src/index.d.ts
|
|
68
68
|
/**
|
|
69
69
|
* @group Props
|
|
70
70
|
*/
|
|
71
|
-
declare const antdControlElements: ControlElementsProp<FullField, string>;
|
|
71
|
+
export declare const antdControlElements: ControlElementsProp<FullField, string>;
|
|
72
72
|
/**
|
|
73
73
|
* @group Props
|
|
74
74
|
*/
|
|
75
|
-
declare const antdTranslations: Partial<Translations>;
|
|
75
|
+
export declare const antdTranslations: Partial<Translations>;
|
|
76
76
|
/**
|
|
77
77
|
* @group Components
|
|
78
78
|
*/
|
|
79
|
-
declare const QueryBuilderAntD: QueryBuilderContextProvider;
|
|
79
|
+
export declare const QueryBuilderAntD: QueryBuilderContextProvider;
|
|
80
80
|
//#endregion
|
|
81
|
-
export { AntDActionElement, AntDActionProps, AntDDragHandle, AntDDragHandleProps, AntDNotToggle, AntDNotToggleProps, AntDShiftActions, AntDValueEditor, AntDValueEditorProps, AntDValueSelector, AntDValueSelectorProps, QueryBuilderAntD, antdControlElements, antdTranslations };
|
|
82
81
|
//# sourceMappingURL=react-querybuilder_antd.cjs.development.d.ts.map
|
|
@@ -440,6 +440,7 @@ const antdTranslations = {
|
|
|
440
440
|
removeRule: { label: /* @__PURE__ */ react.createElement(_ant_design_icons.CloseOutlined, null) },
|
|
441
441
|
cloneRule: { label: /* @__PURE__ */ react.createElement(_ant_design_icons.CopyOutlined, null) },
|
|
442
442
|
cloneRuleGroup: { label: /* @__PURE__ */ react.createElement(_ant_design_icons.CopyOutlined, null) },
|
|
443
|
+
ungroupRuleGroup: { label: /* @__PURE__ */ react.createElement(_ant_design_icons.UngroupOutlined, null) },
|
|
443
444
|
lockGroup: { label: /* @__PURE__ */ react.createElement(_ant_design_icons.UnlockOutlined, null) },
|
|
444
445
|
lockRule: { label: /* @__PURE__ */ react.createElement(_ant_design_icons.UnlockOutlined, null) },
|
|
445
446
|
lockGroupDisabled: { label: /* @__PURE__ */ react.createElement(_ant_design_icons.LockOutlined, null) },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"react-querybuilder_antd.cjs.development.js","names":["Button","forwardRef","HolderOutlined","Switch","Button","customParseFormat","advancedFormat","weekday","localeData","weekOfYear","weekYear","generatePicker","dayjsGenerateConfig","useValueEditor","InputNumber","Input","ValueEditor","Switch","Checkbox","Radio","joinWith","useValueSelector","React","joinWith","Select","CloseOutlined","CopyOutlined","UnlockOutlined","LockOutlined","UpOutlined","DownOutlined","UndoOutlined","RedoOutlined","getCompatContextProvider"],"sources":["../../src/AntDActionElement.tsx","../../src/AntDDragHandle.tsx","../../src/AntDNotToggle.tsx","../../src/AntDShiftActions.tsx","../../src/dayjs.ts","../../src/AntDValueEditor.tsx","../../src/AntDValueSelector.tsx","../../src/index.tsx"],"sourcesContent":["import { Button } from 'antd';\nimport type { ComponentPropsWithoutRef } from 'react';\nimport * as React from 'react';\nimport type { ActionProps } from 'react-querybuilder';\n\n// TODO: This may be unnecessary. Find out if there's a way to allow\n// `data-${string}` index keys without breaking other type contraints.\ntype RemoveDataIndexKeys<T> = {\n [K in keyof T as `data-${string}` extends K ? never : K]: T[K];\n};\n\n/**\n * @group Props\n */\nexport interface AntDActionProps\n extends ActionProps, RemoveDataIndexKeys<ComponentPropsWithoutRef<typeof Button>> {}\n\n/**\n * @group Components\n */\nexport const AntDActionElement = ({\n className,\n handleOnClick,\n label,\n title,\n disabled,\n disabledTranslation,\n // Props that should not be in extraProps\n testID: _testID,\n level: _level,\n path: _path,\n context: _context,\n validation: _validation,\n ruleOrGroup: _ruleOrGroup,\n schema: _schema,\n ...extraProps\n}: AntDActionProps): React.JSX.Element => (\n <Button\n type=\"primary\"\n className={className}\n title={disabledTranslation && disabled ? disabledTranslation.title : title}\n onClick={e => handleOnClick(e)}\n disabled={disabled && !disabledTranslation}\n {...extraProps}>\n {disabledTranslation && disabled ? disabledTranslation.label : label}\n </Button>\n);\n","import { HolderOutlined } from '@ant-design/icons';\nimport type { ComponentPropsWithRef } from 'react';\nimport * as React from 'react';\nimport { forwardRef } from 'react';\nimport type { DragHandleProps } from 'react-querybuilder';\n\n/**\n * @group Props\n */\n// oxlint-disable-next-line typescript/no-explicit-any\nexport type AntDDragHandleProps = DragHandleProps & { label?: any } & ComponentPropsWithRef<\n typeof HolderOutlined\n >;\n\n/**\n * @group Components\n */\nexport const AntDDragHandle: React.ForwardRefExoticComponent<\n Omit<AntDDragHandleProps, 'ref'> & React.RefAttributes<HTMLSpanElement>\n> = forwardRef<HTMLSpanElement, AntDDragHandleProps>(\n (\n {\n className,\n title,\n dragHandleAttributes,\n // Props that should not be in extraProps\n testID: _testID,\n level: _level,\n path: _path,\n label: _label,\n disabled: _disabled,\n context: _context,\n validation: _validation,\n schema: _schema,\n ruleOrGroup: _ruleOrGroup,\n ...extraProps\n },\n dragRef\n ) => (\n <HolderOutlined\n className={className}\n title={title}\n {...extraProps}\n {...dragHandleAttributes}\n ref={dragRef}\n />\n )\n);\n","import { Switch } from 'antd';\nimport type { ComponentPropsWithoutRef } from 'react';\nimport * as React from 'react';\nimport type { NotToggleProps } from 'react-querybuilder';\n\n/**\n * @group Props\n */\nexport interface AntDNotToggleProps\n extends NotToggleProps, ComponentPropsWithoutRef<typeof Switch> {}\n\n/**\n * @group Components\n */\nexport const AntDNotToggle = ({\n className,\n handleOnChange,\n label,\n checked,\n title,\n disabled,\n // Props that should not be in extraProps\n path: _path,\n context: _context,\n validation: _validation,\n testID: _testID,\n schema: _schema,\n ruleGroup: _ruleGroup,\n ...extraProps\n}: AntDNotToggleProps): React.JSX.Element => (\n <Switch\n title={title}\n className={className}\n onChange={v => handleOnChange(v)}\n checked={!!checked}\n disabled={disabled}\n checkedChildren={label}\n unCheckedChildren=\"=\"\n {...extraProps}\n />\n);\n","import { Button } from 'antd';\nimport * as React from 'react';\nimport type { ShiftActionsProps } from 'react-querybuilder';\n\n/**\n * @group Components\n */\nexport const AntDShiftActions = ({\n shiftUp,\n shiftDown,\n shiftUpDisabled,\n shiftDownDisabled,\n disabled,\n className,\n labels,\n titles,\n testID,\n}: ShiftActionsProps): React.JSX.Element => (\n <div data-testid={testID} className={className}>\n <Button\n type=\"primary\"\n size=\"small\"\n title={titles?.shiftUp}\n onClick={shiftUp}\n disabled={disabled || shiftUpDisabled}>\n {labels?.shiftUp}\n </Button>\n <Button\n type=\"primary\"\n size=\"small\"\n title={titles?.shiftDown}\n onClick={shiftDown}\n disabled={disabled || shiftDownDisabled}>\n {labels?.shiftDown}\n </Button>\n </div>\n);\n","/**\n * This file is adapted from the following sources:\n * - https://github.com/react-component/picker/blob/d526bd551778070be3295060f1b5841786cb9500/src/generate/dayjs.ts\n * - https://github.com/react-component/picker/blob/d526bd551778070be3295060f1b5841786cb9500/src/generate/index.ts\n */\n\nimport type { Dayjs } from 'dayjs';\nimport dayjs from 'dayjs';\nimport advancedFormat from 'dayjs/plugin/advancedFormat.js';\nimport customParseFormat from 'dayjs/plugin/customParseFormat.js';\nimport localeData from 'dayjs/plugin/localeData.js';\nimport weekday from 'dayjs/plugin/weekday.js';\nimport weekOfYear from 'dayjs/plugin/weekOfYear.js';\nimport weekYear from 'dayjs/plugin/weekYear.js';\n\ntype GenerateConfig<DateType> = {\n // Get\n getWeekDay: (value: DateType) => number;\n getMillisecond: (value: DateType) => number;\n getSecond: (value: DateType) => number;\n getMinute: (value: DateType) => number;\n getHour: (value: DateType) => number;\n getDate: (value: DateType) => number;\n getMonth: (value: DateType) => number;\n getYear: (value: DateType) => number;\n getNow: () => DateType;\n getFixedDate: (fixed: string) => DateType;\n getEndDate: (value: DateType) => DateType;\n\n // Set\n addYear: (value: DateType, diff: number) => DateType;\n addMonth: (value: DateType, diff: number) => DateType;\n addDate: (value: DateType, diff: number) => DateType;\n setYear: (value: DateType, year: number) => DateType;\n setMonth: (value: DateType, month: number) => DateType;\n setDate: (value: DateType, date: number) => DateType;\n setHour: (value: DateType, hour: number) => DateType;\n setMinute: (value: DateType, minute: number) => DateType;\n setSecond: (value: DateType, second: number) => DateType;\n setMillisecond: (value: DateType, millisecond: number) => DateType;\n\n // Compare\n isAfter: (date1: DateType, date2: DateType) => boolean;\n isValidate: (date: DateType) => boolean;\n\n locale: {\n getWeekFirstDay: (locale: string) => number;\n getWeekFirstDate: (locale: string, value: DateType) => DateType;\n getWeek: (locale: string, value: DateType) => number;\n\n format: (locale: string, date: DateType, format: string) => string;\n\n /** Should only return validate date instance */\n parse: (locale: string, text: string, formats: string[]) => DateType | null;\n\n /** A proxy for getting locale with moment or other locale library */\n getShortWeekDays?: (locale: string) => string[];\n /** A proxy for getting locale with moment or other locale library */\n getShortMonths?: (locale: string) => string[];\n };\n};\n\n/* v8 ignore file -- @preserve */\n\ndayjs.extend(customParseFormat);\ndayjs.extend(advancedFormat);\ndayjs.extend(weekday);\ndayjs.extend(localeData);\ndayjs.extend(weekOfYear);\ndayjs.extend(weekYear);\n\ndayjs.extend((o, c) => {\n // todo support Wo (ISO week)\n const proto = c.prototype;\n const oldFormat = proto.format;\n proto.format = function f(formatStr: string) {\n const str = (formatStr || '').replace('Wo', 'wo');\n return oldFormat.bind(this)(str);\n };\n});\n\ntype IlocaleMapObject = Record<string, string>;\nconst localeMap: IlocaleMapObject = {\n // ar_EG:\n // az_AZ:\n // bg_BG:\n bn_BD: 'bn-bd',\n by_BY: 'be',\n // ca_ES:\n // cs_CZ:\n // da_DK:\n // de_DE:\n // el_GR:\n en_GB: 'en-gb',\n en_US: 'en',\n // es_ES:\n // et_EE:\n // fa_IR:\n // fi_FI:\n fr_BE: 'fr', // todo: dayjs has no fr_BE locale, use fr at present\n fr_CA: 'fr-ca',\n // fr_FR:\n // ga_IE:\n // gl_ES:\n // he_IL:\n // hi_IN:\n // hr_HR:\n // hu_HU:\n hy_AM: 'hy-am',\n // id_ID:\n // is_IS:\n // it_IT:\n // ja_JP:\n // ka_GE:\n // kk_KZ:\n // km_KH:\n kmr_IQ: 'ku',\n // kn_IN:\n // ko_KR:\n // ku_IQ: // previous ku in antd\n // lt_LT:\n // lv_LV:\n // mk_MK:\n // ml_IN:\n // mn_MN:\n // ms_MY:\n // nb_NO:\n // ne_NP:\n nl_BE: 'nl-be',\n // nl_NL:\n // pl_PL:\n pt_BR: 'pt-br',\n // pt_PT:\n // ro_RO:\n // ru_RU:\n // sk_SK:\n // sl_SI:\n // sr_RS:\n // sv_SE:\n // ta_IN:\n // th_TH:\n // tr_TR:\n // uk_UA:\n // ur_PK:\n // vi_VN:\n zh_CN: 'zh-cn',\n zh_HK: 'zh-hk',\n zh_TW: 'zh-tw',\n};\n\nconst parseLocale = (locale: string) => {\n const mapLocale = localeMap[locale];\n return mapLocale || locale.split('_')[0];\n};\n\nconst parseNoMatchNotice = () => {\n // noteOnce(false, 'Not match any format. Please help to fire a issue about this.');\n};\n\nconst generateConfig: GenerateConfig<Dayjs> = {\n // get\n getNow: () => dayjs(),\n getFixedDate: string => dayjs(string, ['YYYY-M-DD', 'YYYY-MM-DD']),\n getEndDate: date => date.endOf('month'),\n getWeekDay: date => {\n const clone = date.locale('en');\n return clone.weekday() + clone.localeData().firstDayOfWeek();\n },\n getYear: date => date.year(),\n getMonth: date => date.month(),\n getDate: date => date.date(),\n getHour: date => date.hour(),\n getMinute: date => date.minute(),\n getSecond: date => date.second(),\n getMillisecond: date => date.millisecond(),\n\n // set\n addYear: (date, diff) => date.add(diff, 'year'),\n addMonth: (date, diff) => date.add(diff, 'month'),\n addDate: (date, diff) => date.add(diff, 'day'),\n setYear: (date, year) => date.year(year),\n setMonth: (date, month) => date.month(month),\n setDate: (date, num) => date.date(num),\n setHour: (date, hour) => date.hour(hour),\n setMinute: (date, minute) => date.minute(minute),\n setSecond: (date, second) => date.second(second),\n setMillisecond: (date, milliseconds) => date.millisecond(milliseconds),\n\n // Compare\n isAfter: (date1, date2) => date1.isAfter(date2),\n isValidate: date => date.isValid(),\n\n locale: {\n getWeekFirstDay: locale => dayjs().locale(parseLocale(locale)).localeData().firstDayOfWeek(),\n getWeekFirstDate: (locale, date) => date.locale(parseLocale(locale)).weekday(0),\n getWeek: (locale, date) => date.locale(parseLocale(locale)).week(),\n getShortWeekDays: locale => dayjs().locale(parseLocale(locale)).localeData().weekdaysMin(),\n getShortMonths: locale => dayjs().locale(parseLocale(locale)).localeData().monthsShort(),\n format: (locale, date, format) => date.locale(parseLocale(locale)).format(format),\n parse: (locale, text, formats) => {\n const localeStr = parseLocale(locale);\n for (const format of formats) {\n const formatText = text;\n if (format.includes('wo') || format.includes('Wo')) {\n // parse Wo\n const year = formatText.split('-')[0];\n const weekStr = formatText.split('-')[1];\n const firstWeek = dayjs(year, 'YYYY').startOf('year').locale(localeStr);\n for (let j = 0; j <= 52; j += 1) {\n const nextWeek = firstWeek.add(j, 'week');\n if (nextWeek.format('Wo') === weekStr) {\n return nextWeek;\n }\n }\n parseNoMatchNotice();\n return null;\n }\n const date = dayjs(formatText, format, true).locale(localeStr);\n if (date.isValid()) {\n return date;\n }\n }\n\n if (text) {\n parseNoMatchNotice();\n }\n return null;\n },\n },\n};\n\nexport default generateConfig;\n","import { Checkbox, Input, InputNumber, Radio, Switch } from 'antd';\nimport generatePicker from 'antd/es/date-picker/generatePicker/index.js';\nimport type { Dayjs } from 'dayjs';\nimport dayjs from 'dayjs';\nimport * as React from 'react';\nimport type { ValueEditorProps } from 'react-querybuilder';\nimport { joinWith, useValueEditor, ValueEditor } from 'react-querybuilder';\nimport dayjsGenerateConfig from './dayjs';\n\n/**\n * @group Props\n */\nexport interface AntDValueEditorProps extends ValueEditorProps {\n extraProps?: Record<string, unknown>;\n}\n\nconst DatePicker = generatePicker(dayjsGenerateConfig);\n\n/**\n * @group Components\n */\nexport const AntDValueEditor = (allProps: AntDValueEditorProps): React.JSX.Element | null => {\n const {\n fieldData,\n operator,\n value,\n handleOnChange,\n title,\n className,\n type,\n inputType,\n values = [],\n listsAsArrays,\n separator,\n valueSource: _vs,\n disabled,\n testID,\n selectorComponent: SelectorComponent = allProps.schema.controls.valueSelector,\n extraProps,\n parseNumbers: _parseNumbers,\n ...propsForValueSelector\n } = allProps;\n\n const {\n valueAsArray,\n multiValueHandler,\n bigIntValueHandler,\n valueListItemClassName,\n inputTypeCoerced,\n } = useValueEditor(allProps);\n\n if (operator === 'null' || operator === 'notNull') {\n return null;\n }\n\n const placeHolderText = fieldData?.placeholder ?? '';\n\n if (\n (operator === 'between' || operator === 'notBetween') &&\n (type === 'select' || type === 'text') &&\n // Date ranges are handled differently in AntD--see below\n inputTypeCoerced !== 'date' &&\n inputTypeCoerced !== 'datetime-local'\n ) {\n if (type === 'text') {\n const editors = ['from', 'to'].map((key, i) => {\n if (inputTypeCoerced === 'time') {\n return (\n <DatePicker.TimePicker\n key={key}\n value={valueAsArray[i] ? dayjs(valueAsArray[i], 'HH:mm:ss') : null}\n className={valueListItemClassName}\n disabled={disabled}\n placeholder={placeHolderText}\n onChange={d => multiValueHandler(d?.format('HH:mm:ss') ?? '', i)}\n {...extraProps}\n />\n );\n } else if (inputTypeCoerced === 'number') {\n return (\n <InputNumber\n key={key}\n type={inputTypeCoerced}\n value={valueAsArray[i] ?? ''}\n className={valueListItemClassName}\n disabled={disabled}\n placeholder={placeHolderText}\n onChange={v => multiValueHandler(v, i)}\n {...extraProps}\n />\n );\n }\n return (\n <Input\n key={key}\n type={inputTypeCoerced}\n value={valueAsArray[i] ?? ''}\n className={valueListItemClassName}\n disabled={disabled}\n placeholder={placeHolderText}\n onChange={e => multiValueHandler(e.target.value, i)}\n {...extraProps}\n />\n );\n });\n return (\n <span data-testid={testID} className={className} title={title}>\n {editors[0]}\n {separator}\n {editors[1]}\n </span>\n );\n }\n\n return <ValueEditor {...allProps} skipHook />;\n }\n\n switch (type) {\n case 'select':\n case 'multiselect':\n return (\n <SelectorComponent\n {...propsForValueSelector}\n className={className}\n title={title}\n value={value}\n disabled={disabled}\n listsAsArrays={listsAsArrays}\n multiple={type === 'multiselect'}\n handleOnChange={handleOnChange}\n options={values}\n {...extraProps}\n />\n );\n\n case 'textarea':\n return (\n <Input.TextArea\n value={value}\n title={title}\n className={className}\n disabled={disabled}\n placeholder={placeHolderText}\n onChange={e => handleOnChange(e.target.value)}\n {...extraProps}\n />\n );\n\n case 'switch':\n return (\n <Switch\n checked={!!value}\n title={title}\n className={className}\n disabled={disabled}\n onChange={v => handleOnChange(v)}\n {...extraProps}\n />\n );\n\n case 'checkbox':\n return (\n <span title={title} className={className}>\n <Checkbox\n type=\"checkbox\"\n disabled={disabled}\n onChange={e => handleOnChange(e.target.checked)}\n checked={!!value}\n {...extraProps}\n />\n </span>\n );\n\n case 'radio':\n return (\n <span className={className} title={title}>\n {values.map(v => (\n <Radio\n key={v.name}\n value={v.name}\n checked={value === v.name}\n disabled={disabled}\n onChange={e => handleOnChange(e.target.value)}\n {...extraProps}>\n {v.label}\n </Radio>\n ))}\n </span>\n );\n }\n\n switch (inputTypeCoerced) {\n case 'date':\n case 'datetime-local': {\n if (operator === 'between' || operator === 'notBetween') {\n // oxlint-disable-next-line typescript/no-explicit-any\n const dayjsArray = valueAsArray.slice(0, 2).map((v: any) => dayjs(v)) as [Dayjs, Dayjs];\n return (\n <DatePicker.RangePicker\n value={dayjsArray.every(d => d.isValid()) ? dayjsArray : undefined}\n showTime={inputTypeCoerced === 'datetime-local'}\n className={className}\n disabled={disabled}\n placeholder={[placeHolderText, placeHolderText]}\n // TODO: the function below is currently untested (see the\n // \"renders a date range picker\" test in ./AntD.test.tsx)\n onChange={\n /* v8 ignore start -- @preserve */\n dates => {\n const timeFormat = inputTypeCoerced === 'datetime-local' ? 'THH:mm:ss' : '';\n const format = `YYYY-MM-DD${timeFormat}`;\n const dateArray = dates?.map(d => (d?.isValid() ? d.format(format) : undefined));\n handleOnChange(\n dateArray ? (listsAsArrays ? dateArray : joinWith(dateArray, ',')) : dates\n );\n }\n /* v8 ignore stop -- @preserve */\n }\n {...extraProps}\n />\n );\n }\n\n const dateValue = dayjs(value);\n return (\n <DatePicker\n value={dateValue.isValid() ? dateValue : undefined}\n showTime={inputTypeCoerced === 'datetime-local'}\n className={className}\n disabled={disabled}\n placeholder={placeHolderText}\n onChange={(_d, dateString) => handleOnChange(dateString)}\n {...extraProps}\n />\n );\n }\n\n case 'time': {\n const dateValue = dayjs(value, 'HH:mm:ss');\n return (\n <DatePicker.TimePicker\n value={dateValue.isValid() ? dateValue : undefined}\n className={className}\n disabled={disabled}\n placeholder={placeHolderText}\n onChange={d => handleOnChange(d?.format('HH:mm:ss') ?? '')}\n {...extraProps}\n />\n );\n }\n\n case 'number': {\n return (\n <InputNumber\n type={inputTypeCoerced}\n value={value}\n title={title}\n className={className}\n disabled={disabled}\n placeholder={placeHolderText}\n onChange={handleOnChange}\n {...extraProps}\n />\n );\n }\n }\n\n if (inputType === 'bigint') {\n return (\n <Input\n data-testid={testID}\n type={inputTypeCoerced}\n placeholder={placeHolderText}\n value={`${value}`}\n title={title}\n className={className}\n disabled={disabled}\n onChange={e => bigIntValueHandler(e.target.value)}\n {...extraProps}\n />\n );\n }\n\n return (\n <Input\n type={inputTypeCoerced}\n value={value}\n title={title}\n className={className}\n disabled={disabled}\n placeholder={placeHolderText}\n onChange={e => handleOnChange(e.target.value)}\n {...extraProps}\n />\n );\n};\n","import { Select } from 'antd';\nimport type { ComponentPropsWithoutRef } from 'react';\nimport * as React from 'react';\nimport type { VersatileSelectorProps } from 'react-querybuilder';\nimport { joinWith, useValueSelector } from 'react-querybuilder';\n\n/**\n * @group Props\n */\nexport type AntDValueSelectorProps = VersatileSelectorProps &\n Omit<ComponentPropsWithoutRef<typeof Select>, 'onChange' | 'defaultValue'>;\n\n/**\n * @group Components\n */\nexport const AntDValueSelector = ({\n className,\n handleOnChange,\n options,\n value,\n title,\n disabled,\n multiple,\n listsAsArrays,\n // Props that should not be in extraProps\n testID: _testID,\n rule: _rule,\n ruleGroup: _ruleGroup,\n rules: _rules,\n level: _level,\n path: _path,\n context: _context,\n validation: _validation,\n operator: _operator,\n field: _field,\n fieldData: _fieldData,\n schema: _schema,\n ...extraProps\n}: AntDValueSelectorProps): React.JSX.Element => {\n // Alternate onChange handler that doesn't use arrays even when `multiple` is true\n const { onChange: onChangeNoArrays } = useValueSelector({\n handleOnChange,\n listsAsArrays: false,\n multiple: false,\n value,\n });\n const { onChange: onChangeNormal, val } = useValueSelector({\n handleOnChange,\n // This forces `val` to be an array if `multiple` is true,\n // even if `listsAsArrays` is false\n listsAsArrays: multiple || listsAsArrays,\n multiple,\n value,\n });\n\n const onChange = React.useCallback(\n (v: string | string[]) => {\n if (multiple && !listsAsArrays && Array.isArray(v)) {\n // `multiple: true` means `v` is probably an array, but we don't want\n // to send an array to `handleOnChange` when `listsAsArrays` is false\n onChangeNoArrays(joinWith(v));\n } else {\n onChangeNormal(v);\n }\n },\n [listsAsArrays, multiple, onChangeNoArrays, onChangeNormal]\n );\n\n return (\n <Select\n {...(multiple ? { mode: 'multiple', allowClear: true } : {})}\n title={title}\n className={className}\n popupMatchSelectWidth={false}\n disabled={disabled}\n value={val}\n onChange={onChange}\n optionFilterProp=\"label\"\n options={options}\n {...extraProps}\n />\n );\n};\n","import {\n CloseOutlined,\n CopyOutlined,\n DownOutlined,\n LockOutlined,\n RedoOutlined,\n UndoOutlined,\n UnlockOutlined,\n UpOutlined,\n} from '@ant-design/icons';\nimport * as React from 'react';\nimport type {\n ControlElementsProp,\n FullField,\n QueryBuilderContextProvider,\n Translations,\n} from 'react-querybuilder';\nimport { getCompatContextProvider } from 'react-querybuilder';\nimport { AntDActionElement } from './AntDActionElement';\nimport { AntDDragHandle } from './AntDDragHandle';\nimport { AntDNotToggle } from './AntDNotToggle';\nimport { AntDShiftActions } from './AntDShiftActions';\nimport { AntDValueEditor } from './AntDValueEditor';\nimport { AntDValueSelector } from './AntDValueSelector';\n\nexport * from './AntDActionElement';\nexport * from './AntDDragHandle';\nexport * from './AntDNotToggle';\nexport * from './AntDShiftActions';\nexport * from './AntDValueEditor';\nexport * from './AntDValueSelector';\n\n/**\n * @group Props\n */\nexport const antdControlElements: ControlElementsProp<FullField, string> = {\n actionElement: AntDActionElement,\n dragHandle: AntDDragHandle,\n notToggle: AntDNotToggle,\n shiftActions: AntDShiftActions,\n valueEditor: AntDValueEditor,\n valueSelector: AntDValueSelector,\n};\n\n/**\n * @group Props\n */\nexport const antdTranslations: Partial<Translations> = {\n removeGroup: { label: <CloseOutlined /> },\n removeRule: { label: <CloseOutlined /> },\n cloneRule: { label: <CopyOutlined /> },\n cloneRuleGroup: { label: <CopyOutlined /> },\n lockGroup: { label: <UnlockOutlined /> },\n lockRule: { label: <UnlockOutlined /> },\n lockGroupDisabled: { label: <LockOutlined /> },\n lockRuleDisabled: { label: <LockOutlined /> },\n shiftActionUp: { label: <UpOutlined /> },\n shiftActionDown: { label: <DownOutlined /> },\n undo: { label: <UndoOutlined /> },\n redo: { label: <RedoOutlined /> },\n};\n\n/**\n * @group Components\n */\nexport const QueryBuilderAntD: QueryBuilderContextProvider = getCompatContextProvider({\n controlElements: antdControlElements,\n translations: antdTranslations,\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoBA,MAAa,qBAAqB,EAChC,WACA,eACA,OACA,OACA,UACA,qBAEA,QAAQ,SACR,OAAO,QACP,MAAM,OACN,SAAS,UACT,YAAY,aACZ,aAAa,cACb,QAAQ,SACR,GAAG,iBAEH,sBAAA,cAACA,KAAAA,QAAD;CACE,MAAK;CACM;CACX,OAAO,uBAAuB,WAAW,oBAAoB,QAAQ;CACrE,UAAS,MAAK,cAAc,CAAC;CAC7B,UAAU,YAAY,CAAC;CACvB,GAAI;AAEE,GADL,uBAAuB,WAAW,oBAAoB,QAAQ,KACzD;;;;;;AC5BV,MAAa,kBAAA,GAETC,MA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3,"file":"react-querybuilder_antd.cjs.development.js","names":["Button","forwardRef","HolderOutlined","Switch","Button","customParseFormat","advancedFormat","weekday","localeData","weekOfYear","weekYear","generatePicker","dayjsGenerateConfig","useValueEditor","InputNumber","Input","ValueEditor","Switch","Checkbox","Radio","joinWith","useValueSelector","React","joinWith","Select","CloseOutlined","CopyOutlined","UngroupOutlined","UnlockOutlined","LockOutlined","UpOutlined","DownOutlined","UndoOutlined","RedoOutlined","getCompatContextProvider"],"sources":["../../src/AntDActionElement.tsx","../../src/AntDDragHandle.tsx","../../src/AntDNotToggle.tsx","../../src/AntDShiftActions.tsx","../../src/dayjs.ts","../../src/AntDValueEditor.tsx","../../src/AntDValueSelector.tsx","../../src/index.tsx"],"sourcesContent":["import { Button } from 'antd';\nimport type { ComponentPropsWithoutRef } from 'react';\nimport * as React from 'react';\nimport type { ActionProps } from 'react-querybuilder';\n\n// TODO: This may be unnecessary. Find out if there's a way to allow\n// `data-${string}` index keys without breaking other type contraints.\ntype RemoveDataIndexKeys<T> = {\n [K in keyof T as `data-${string}` extends K ? never : K]: T[K];\n};\n\n/**\n * @group Props\n */\nexport interface AntDActionProps\n extends ActionProps, RemoveDataIndexKeys<ComponentPropsWithoutRef<typeof Button>> {}\n\n/**\n * @group Components\n */\nexport const AntDActionElement = ({\n className,\n handleOnClick,\n label,\n title,\n disabled,\n disabledTranslation,\n // Props that should not be in extraProps\n testID: _testID,\n level: _level,\n path: _path,\n context: _context,\n validation: _validation,\n ruleOrGroup: _ruleOrGroup,\n schema: _schema,\n ...extraProps\n}: AntDActionProps): React.JSX.Element => (\n <Button\n type=\"primary\"\n className={className}\n title={disabledTranslation && disabled ? disabledTranslation.title : title}\n onClick={e => handleOnClick(e)}\n disabled={disabled && !disabledTranslation}\n {...extraProps}>\n {disabledTranslation && disabled ? disabledTranslation.label : label}\n </Button>\n);\n","import { HolderOutlined } from '@ant-design/icons';\nimport type { ComponentPropsWithRef } from 'react';\nimport * as React from 'react';\nimport { forwardRef } from 'react';\nimport type { DragHandleProps } from 'react-querybuilder';\n\n/**\n * @group Props\n */\n// oxlint-disable-next-line typescript/no-explicit-any\nexport type AntDDragHandleProps = DragHandleProps & { label?: any } & ComponentPropsWithRef<\n typeof HolderOutlined\n >;\n\n/**\n * @group Components\n */\nexport const AntDDragHandle: React.ForwardRefExoticComponent<\n Omit<AntDDragHandleProps, 'ref'> & React.RefAttributes<HTMLSpanElement>\n> = forwardRef<HTMLSpanElement, AntDDragHandleProps>(\n (\n {\n className,\n title,\n dragHandleAttributes,\n // Props that should not be in extraProps\n testID: _testID,\n level: _level,\n path: _path,\n label: _label,\n disabled: _disabled,\n context: _context,\n validation: _validation,\n schema: _schema,\n ruleOrGroup: _ruleOrGroup,\n ...extraProps\n },\n dragRef\n ) => (\n <HolderOutlined\n className={className}\n title={title}\n {...extraProps}\n {...dragHandleAttributes}\n ref={dragRef}\n />\n )\n);\n","import { Switch } from 'antd';\nimport type { ComponentPropsWithoutRef } from 'react';\nimport * as React from 'react';\nimport type { NotToggleProps } from 'react-querybuilder';\n\n/**\n * @group Props\n */\nexport interface AntDNotToggleProps\n extends NotToggleProps, ComponentPropsWithoutRef<typeof Switch> {}\n\n/**\n * @group Components\n */\nexport const AntDNotToggle = ({\n className,\n handleOnChange,\n label,\n checked,\n title,\n disabled,\n // Props that should not be in extraProps\n path: _path,\n context: _context,\n validation: _validation,\n testID: _testID,\n schema: _schema,\n ruleGroup: _ruleGroup,\n ...extraProps\n}: AntDNotToggleProps): React.JSX.Element => (\n <Switch\n title={title}\n className={className}\n onChange={v => handleOnChange(v)}\n checked={!!checked}\n disabled={disabled}\n checkedChildren={label}\n unCheckedChildren=\"=\"\n {...extraProps}\n />\n);\n","import { Button } from 'antd';\nimport * as React from 'react';\nimport type { ShiftActionsProps } from 'react-querybuilder';\n\n/**\n * @group Components\n */\nexport const AntDShiftActions = ({\n shiftUp,\n shiftDown,\n shiftUpDisabled,\n shiftDownDisabled,\n disabled,\n className,\n labels,\n titles,\n testID,\n}: ShiftActionsProps): React.JSX.Element => (\n <div data-testid={testID} className={className}>\n <Button\n type=\"primary\"\n size=\"small\"\n title={titles?.shiftUp}\n onClick={shiftUp}\n disabled={disabled || shiftUpDisabled}>\n {labels?.shiftUp}\n </Button>\n <Button\n type=\"primary\"\n size=\"small\"\n title={titles?.shiftDown}\n onClick={shiftDown}\n disabled={disabled || shiftDownDisabled}>\n {labels?.shiftDown}\n </Button>\n </div>\n);\n","/**\n * This file is adapted from the following sources:\n * - https://github.com/react-component/picker/blob/d526bd551778070be3295060f1b5841786cb9500/src/generate/dayjs.ts\n * - https://github.com/react-component/picker/blob/d526bd551778070be3295060f1b5841786cb9500/src/generate/index.ts\n */\n\nimport type { Dayjs } from 'dayjs';\nimport dayjs from 'dayjs';\nimport advancedFormat from 'dayjs/plugin/advancedFormat.js';\nimport customParseFormat from 'dayjs/plugin/customParseFormat.js';\nimport localeData from 'dayjs/plugin/localeData.js';\nimport weekday from 'dayjs/plugin/weekday.js';\nimport weekOfYear from 'dayjs/plugin/weekOfYear.js';\nimport weekYear from 'dayjs/plugin/weekYear.js';\n\ntype GenerateConfig<DateType> = {\n // Get\n getWeekDay: (value: DateType) => number;\n getMillisecond: (value: DateType) => number;\n getSecond: (value: DateType) => number;\n getMinute: (value: DateType) => number;\n getHour: (value: DateType) => number;\n getDate: (value: DateType) => number;\n getMonth: (value: DateType) => number;\n getYear: (value: DateType) => number;\n getNow: () => DateType;\n getFixedDate: (fixed: string) => DateType;\n getEndDate: (value: DateType) => DateType;\n\n // Set\n addYear: (value: DateType, diff: number) => DateType;\n addMonth: (value: DateType, diff: number) => DateType;\n addDate: (value: DateType, diff: number) => DateType;\n setYear: (value: DateType, year: number) => DateType;\n setMonth: (value: DateType, month: number) => DateType;\n setDate: (value: DateType, date: number) => DateType;\n setHour: (value: DateType, hour: number) => DateType;\n setMinute: (value: DateType, minute: number) => DateType;\n setSecond: (value: DateType, second: number) => DateType;\n setMillisecond: (value: DateType, millisecond: number) => DateType;\n\n // Compare\n isAfter: (date1: DateType, date2: DateType) => boolean;\n isValidate: (date: DateType) => boolean;\n\n locale: {\n getWeekFirstDay: (locale: string) => number;\n getWeekFirstDate: (locale: string, value: DateType) => DateType;\n getWeek: (locale: string, value: DateType) => number;\n\n format: (locale: string, date: DateType, format: string) => string;\n\n /** Should only return validate date instance */\n parse: (locale: string, text: string, formats: string[]) => DateType | null;\n\n /** A proxy for getting locale with moment or other locale library */\n getShortWeekDays?: (locale: string) => string[];\n /** A proxy for getting locale with moment or other locale library */\n getShortMonths?: (locale: string) => string[];\n };\n};\n\n/* v8 ignore file -- @preserve */\n\ndayjs.extend(customParseFormat);\ndayjs.extend(advancedFormat);\ndayjs.extend(weekday);\ndayjs.extend(localeData);\ndayjs.extend(weekOfYear);\ndayjs.extend(weekYear);\n\ndayjs.extend((o, c) => {\n // todo support Wo (ISO week)\n const proto = c.prototype;\n const oldFormat = proto.format;\n proto.format = function f(formatStr: string) {\n const str = (formatStr || '').replace('Wo', 'wo');\n return oldFormat.bind(this)(str);\n };\n});\n\ntype IlocaleMapObject = Record<string, string>;\nconst localeMap: IlocaleMapObject = {\n // ar_EG:\n // az_AZ:\n // bg_BG:\n bn_BD: 'bn-bd',\n by_BY: 'be',\n // ca_ES:\n // cs_CZ:\n // da_DK:\n // de_DE:\n // el_GR:\n en_GB: 'en-gb',\n en_US: 'en',\n // es_ES:\n // et_EE:\n // fa_IR:\n // fi_FI:\n fr_BE: 'fr', // todo: dayjs has no fr_BE locale, use fr at present\n fr_CA: 'fr-ca',\n // fr_FR:\n // ga_IE:\n // gl_ES:\n // he_IL:\n // hi_IN:\n // hr_HR:\n // hu_HU:\n hy_AM: 'hy-am',\n // id_ID:\n // is_IS:\n // it_IT:\n // ja_JP:\n // ka_GE:\n // kk_KZ:\n // km_KH:\n kmr_IQ: 'ku',\n // kn_IN:\n // ko_KR:\n // ku_IQ: // previous ku in antd\n // lt_LT:\n // lv_LV:\n // mk_MK:\n // ml_IN:\n // mn_MN:\n // ms_MY:\n // nb_NO:\n // ne_NP:\n nl_BE: 'nl-be',\n // nl_NL:\n // pl_PL:\n pt_BR: 'pt-br',\n // pt_PT:\n // ro_RO:\n // ru_RU:\n // sk_SK:\n // sl_SI:\n // sr_RS:\n // sv_SE:\n // ta_IN:\n // th_TH:\n // tr_TR:\n // uk_UA:\n // ur_PK:\n // vi_VN:\n zh_CN: 'zh-cn',\n zh_HK: 'zh-hk',\n zh_TW: 'zh-tw',\n};\n\nconst parseLocale = (locale: string) => {\n const mapLocale = localeMap[locale];\n return mapLocale || locale.split('_')[0];\n};\n\nconst parseNoMatchNotice = () => {\n // noteOnce(false, 'Not match any format. Please help to fire a issue about this.');\n};\n\nconst generateConfig: GenerateConfig<Dayjs> = {\n // get\n getNow: () => dayjs(),\n getFixedDate: string => dayjs(string, ['YYYY-M-DD', 'YYYY-MM-DD']),\n getEndDate: date => date.endOf('month'),\n getWeekDay: date => {\n const clone = date.locale('en');\n return clone.weekday() + clone.localeData().firstDayOfWeek();\n },\n getYear: date => date.year(),\n getMonth: date => date.month(),\n getDate: date => date.date(),\n getHour: date => date.hour(),\n getMinute: date => date.minute(),\n getSecond: date => date.second(),\n getMillisecond: date => date.millisecond(),\n\n // set\n addYear: (date, diff) => date.add(diff, 'year'),\n addMonth: (date, diff) => date.add(diff, 'month'),\n addDate: (date, diff) => date.add(diff, 'day'),\n setYear: (date, year) => date.year(year),\n setMonth: (date, month) => date.month(month),\n setDate: (date, num) => date.date(num),\n setHour: (date, hour) => date.hour(hour),\n setMinute: (date, minute) => date.minute(minute),\n setSecond: (date, second) => date.second(second),\n setMillisecond: (date, milliseconds) => date.millisecond(milliseconds),\n\n // Compare\n isAfter: (date1, date2) => date1.isAfter(date2),\n isValidate: date => date.isValid(),\n\n locale: {\n getWeekFirstDay: locale => dayjs().locale(parseLocale(locale)).localeData().firstDayOfWeek(),\n getWeekFirstDate: (locale, date) => date.locale(parseLocale(locale)).weekday(0),\n getWeek: (locale, date) => date.locale(parseLocale(locale)).week(),\n getShortWeekDays: locale => dayjs().locale(parseLocale(locale)).localeData().weekdaysMin(),\n getShortMonths: locale => dayjs().locale(parseLocale(locale)).localeData().monthsShort(),\n format: (locale, date, format) => date.locale(parseLocale(locale)).format(format),\n parse: (locale, text, formats) => {\n const localeStr = parseLocale(locale);\n for (const format of formats) {\n const formatText = text;\n if (format.includes('wo') || format.includes('Wo')) {\n // parse Wo\n const year = formatText.split('-')[0];\n const weekStr = formatText.split('-')[1];\n const firstWeek = dayjs(year, 'YYYY').startOf('year').locale(localeStr);\n for (let j = 0; j <= 52; j += 1) {\n const nextWeek = firstWeek.add(j, 'week');\n if (nextWeek.format('Wo') === weekStr) {\n return nextWeek;\n }\n }\n parseNoMatchNotice();\n return null;\n }\n const date = dayjs(formatText, format, true).locale(localeStr);\n if (date.isValid()) {\n return date;\n }\n }\n\n if (text) {\n parseNoMatchNotice();\n }\n return null;\n },\n },\n};\n\nexport default generateConfig;\n","import { Checkbox, Input, InputNumber, Radio, Switch } from 'antd';\nimport generatePicker from 'antd/es/date-picker/generatePicker/index.js';\nimport type { Dayjs } from 'dayjs';\nimport dayjs from 'dayjs';\nimport * as React from 'react';\nimport type { ValueEditorProps } from 'react-querybuilder';\nimport { joinWith, useValueEditor, ValueEditor } from 'react-querybuilder';\nimport dayjsGenerateConfig from './dayjs';\n\n/**\n * @group Props\n */\nexport interface AntDValueEditorProps extends ValueEditorProps {\n extraProps?: Record<string, unknown>;\n}\n\nconst DatePicker = generatePicker(dayjsGenerateConfig);\n\n/**\n * @group Components\n */\nexport const AntDValueEditor = (allProps: AntDValueEditorProps): React.JSX.Element | null => {\n const {\n fieldData,\n operator,\n value,\n handleOnChange,\n title,\n className,\n type,\n inputType,\n values = [],\n listsAsArrays,\n separator,\n valueSource: _vs,\n disabled,\n testID,\n selectorComponent: SelectorComponent = allProps.schema.controls.valueSelector,\n extraProps,\n parseNumbers: _parseNumbers,\n ...propsForValueSelector\n } = allProps;\n\n const {\n valueAsArray,\n multiValueHandler,\n bigIntValueHandler,\n valueListItemClassName,\n inputTypeCoerced,\n } = useValueEditor(allProps);\n\n if (operator === 'null' || operator === 'notNull') {\n return null;\n }\n\n const placeHolderText = fieldData?.placeholder ?? '';\n\n if (\n (operator === 'between' || operator === 'notBetween') &&\n (type === 'select' || type === 'text') &&\n // Date ranges are handled differently in AntD--see below\n inputTypeCoerced !== 'date' &&\n inputTypeCoerced !== 'datetime-local'\n ) {\n if (type === 'text') {\n const editors = ['from', 'to'].map((key, i) => {\n if (inputTypeCoerced === 'time') {\n return (\n <DatePicker.TimePicker\n key={key}\n value={valueAsArray[i] ? dayjs(valueAsArray[i], 'HH:mm:ss') : null}\n className={valueListItemClassName}\n disabled={disabled}\n placeholder={placeHolderText}\n onChange={d => multiValueHandler(d?.format('HH:mm:ss') ?? '', i)}\n {...extraProps}\n />\n );\n } else if (inputTypeCoerced === 'number') {\n return (\n <InputNumber\n key={key}\n type={inputTypeCoerced}\n value={valueAsArray[i] ?? ''}\n className={valueListItemClassName}\n disabled={disabled}\n placeholder={placeHolderText}\n onChange={v => multiValueHandler(v, i)}\n {...extraProps}\n />\n );\n }\n return (\n <Input\n key={key}\n type={inputTypeCoerced}\n value={valueAsArray[i] ?? ''}\n className={valueListItemClassName}\n disabled={disabled}\n placeholder={placeHolderText}\n onChange={e => multiValueHandler(e.target.value, i)}\n {...extraProps}\n />\n );\n });\n return (\n <span data-testid={testID} className={className} title={title}>\n {editors[0]}\n {separator}\n {editors[1]}\n </span>\n );\n }\n\n return <ValueEditor {...allProps} skipHook />;\n }\n\n switch (type) {\n case 'select':\n case 'multiselect':\n return (\n <SelectorComponent\n {...propsForValueSelector}\n className={className}\n title={title}\n value={value}\n disabled={disabled}\n listsAsArrays={listsAsArrays}\n multiple={type === 'multiselect'}\n handleOnChange={handleOnChange}\n options={values}\n {...extraProps}\n />\n );\n\n case 'textarea':\n return (\n <Input.TextArea\n value={value}\n title={title}\n className={className}\n disabled={disabled}\n placeholder={placeHolderText}\n onChange={e => handleOnChange(e.target.value)}\n {...extraProps}\n />\n );\n\n case 'switch':\n return (\n <Switch\n checked={!!value}\n title={title}\n className={className}\n disabled={disabled}\n onChange={v => handleOnChange(v)}\n {...extraProps}\n />\n );\n\n case 'checkbox':\n return (\n <span title={title} className={className}>\n <Checkbox\n type=\"checkbox\"\n disabled={disabled}\n onChange={e => handleOnChange(e.target.checked)}\n checked={!!value}\n {...extraProps}\n />\n </span>\n );\n\n case 'radio':\n return (\n <span className={className} title={title}>\n {values.map(v => (\n <Radio\n key={v.name}\n value={v.name}\n checked={value === v.name}\n disabled={disabled}\n onChange={e => handleOnChange(e.target.value)}\n {...extraProps}>\n {v.label}\n </Radio>\n ))}\n </span>\n );\n }\n\n switch (inputTypeCoerced) {\n case 'date':\n case 'datetime-local': {\n if (operator === 'between' || operator === 'notBetween') {\n // oxlint-disable-next-line typescript/no-explicit-any\n const dayjsArray = valueAsArray.slice(0, 2).map((v: any) => dayjs(v)) as [Dayjs, Dayjs];\n return (\n <DatePicker.RangePicker\n value={dayjsArray.every(d => d.isValid()) ? dayjsArray : undefined}\n showTime={inputTypeCoerced === 'datetime-local'}\n className={className}\n disabled={disabled}\n placeholder={[placeHolderText, placeHolderText]}\n // TODO: the function below is currently untested (see the\n // \"renders a date range picker\" test in ./AntD.test.tsx)\n onChange={\n /* v8 ignore start -- @preserve */\n dates => {\n const timeFormat = inputTypeCoerced === 'datetime-local' ? 'THH:mm:ss' : '';\n const format = `YYYY-MM-DD${timeFormat}`;\n const dateArray = dates?.map(d => (d?.isValid() ? d.format(format) : undefined));\n handleOnChange(\n dateArray ? (listsAsArrays ? dateArray : joinWith(dateArray, ',')) : dates\n );\n }\n /* v8 ignore stop -- @preserve */\n }\n {...extraProps}\n />\n );\n }\n\n const dateValue = dayjs(value);\n return (\n <DatePicker\n value={dateValue.isValid() ? dateValue : undefined}\n showTime={inputTypeCoerced === 'datetime-local'}\n className={className}\n disabled={disabled}\n placeholder={placeHolderText}\n onChange={(_d, dateString) => handleOnChange(dateString)}\n {...extraProps}\n />\n );\n }\n\n case 'time': {\n const dateValue = dayjs(value, 'HH:mm:ss');\n return (\n <DatePicker.TimePicker\n value={dateValue.isValid() ? dateValue : undefined}\n className={className}\n disabled={disabled}\n placeholder={placeHolderText}\n onChange={d => handleOnChange(d?.format('HH:mm:ss') ?? '')}\n {...extraProps}\n />\n );\n }\n\n case 'number': {\n return (\n <InputNumber\n type={inputTypeCoerced}\n value={value}\n title={title}\n className={className}\n disabled={disabled}\n placeholder={placeHolderText}\n onChange={handleOnChange}\n {...extraProps}\n />\n );\n }\n }\n\n if (inputType === 'bigint') {\n return (\n <Input\n data-testid={testID}\n type={inputTypeCoerced}\n placeholder={placeHolderText}\n value={`${value}`}\n title={title}\n className={className}\n disabled={disabled}\n onChange={e => bigIntValueHandler(e.target.value)}\n {...extraProps}\n />\n );\n }\n\n return (\n <Input\n type={inputTypeCoerced}\n value={value}\n title={title}\n className={className}\n disabled={disabled}\n placeholder={placeHolderText}\n onChange={e => handleOnChange(e.target.value)}\n {...extraProps}\n />\n );\n};\n","import { Select } from 'antd';\nimport type { ComponentPropsWithoutRef } from 'react';\nimport * as React from 'react';\nimport type { VersatileSelectorProps } from 'react-querybuilder';\nimport { joinWith, useValueSelector } from 'react-querybuilder';\n\n/**\n * @group Props\n */\nexport type AntDValueSelectorProps = VersatileSelectorProps &\n Omit<ComponentPropsWithoutRef<typeof Select>, 'onChange' | 'defaultValue'>;\n\n/**\n * @group Components\n */\nexport const AntDValueSelector = ({\n className,\n handleOnChange,\n options,\n value,\n title,\n disabled,\n multiple,\n listsAsArrays,\n // Props that should not be in extraProps\n testID: _testID,\n rule: _rule,\n ruleGroup: _ruleGroup,\n rules: _rules,\n level: _level,\n path: _path,\n context: _context,\n validation: _validation,\n operator: _operator,\n field: _field,\n fieldData: _fieldData,\n schema: _schema,\n ...extraProps\n}: AntDValueSelectorProps): React.JSX.Element => {\n // Alternate onChange handler that doesn't use arrays even when `multiple` is true\n const { onChange: onChangeNoArrays } = useValueSelector({\n handleOnChange,\n listsAsArrays: false,\n multiple: false,\n value,\n });\n const { onChange: onChangeNormal, val } = useValueSelector({\n handleOnChange,\n // This forces `val` to be an array if `multiple` is true,\n // even if `listsAsArrays` is false\n listsAsArrays: multiple || listsAsArrays,\n multiple,\n value,\n });\n\n const onChange = React.useCallback(\n (v: string | string[]) => {\n if (multiple && !listsAsArrays && Array.isArray(v)) {\n // `multiple: true` means `v` is probably an array, but we don't want\n // to send an array to `handleOnChange` when `listsAsArrays` is false\n onChangeNoArrays(joinWith(v));\n } else {\n onChangeNormal(v);\n }\n },\n [listsAsArrays, multiple, onChangeNoArrays, onChangeNormal]\n );\n\n return (\n <Select\n {...(multiple ? { mode: 'multiple', allowClear: true } : {})}\n title={title}\n className={className}\n popupMatchSelectWidth={false}\n disabled={disabled}\n value={val}\n onChange={onChange}\n optionFilterProp=\"label\"\n options={options}\n {...extraProps}\n />\n );\n};\n","import {\n CloseOutlined,\n CopyOutlined,\n DownOutlined,\n LockOutlined,\n RedoOutlined,\n UndoOutlined,\n UngroupOutlined,\n UnlockOutlined,\n UpOutlined,\n} from '@ant-design/icons';\nimport * as React from 'react';\nimport type {\n ControlElementsProp,\n FullField,\n QueryBuilderContextProvider,\n Translations,\n} from 'react-querybuilder';\nimport { getCompatContextProvider } from 'react-querybuilder';\nimport { AntDActionElement } from './AntDActionElement';\nimport { AntDDragHandle } from './AntDDragHandle';\nimport { AntDNotToggle } from './AntDNotToggle';\nimport { AntDShiftActions } from './AntDShiftActions';\nimport { AntDValueEditor } from './AntDValueEditor';\nimport { AntDValueSelector } from './AntDValueSelector';\n\nexport * from './AntDActionElement';\nexport * from './AntDDragHandle';\nexport * from './AntDNotToggle';\nexport * from './AntDShiftActions';\nexport * from './AntDValueEditor';\nexport * from './AntDValueSelector';\n\n/**\n * @group Props\n */\nexport const antdControlElements: ControlElementsProp<FullField, string> = {\n actionElement: AntDActionElement,\n dragHandle: AntDDragHandle,\n notToggle: AntDNotToggle,\n shiftActions: AntDShiftActions,\n valueEditor: AntDValueEditor,\n valueSelector: AntDValueSelector,\n};\n\n/**\n * @group Props\n */\nexport const antdTranslations: Partial<Translations> = {\n removeGroup: { label: <CloseOutlined /> },\n removeRule: { label: <CloseOutlined /> },\n cloneRule: { label: <CopyOutlined /> },\n cloneRuleGroup: { label: <CopyOutlined /> },\n ungroupRuleGroup: { label: <UngroupOutlined /> },\n lockGroup: { label: <UnlockOutlined /> },\n lockRule: { label: <UnlockOutlined /> },\n lockGroupDisabled: { label: <LockOutlined /> },\n lockRuleDisabled: { label: <LockOutlined /> },\n shiftActionUp: { label: <UpOutlined /> },\n shiftActionDown: { label: <DownOutlined /> },\n undo: { label: <UndoOutlined /> },\n redo: { label: <RedoOutlined /> },\n};\n\n/**\n * @group Components\n */\nexport const QueryBuilderAntD: QueryBuilderContextProvider = getCompatContextProvider({\n controlElements: antdControlElements,\n translations: antdTranslations,\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoBA,MAAa,qBAAqB,EAChC,WACA,eACA,OACA,OACA,UACA,qBAEA,QAAQ,SACR,OAAO,QACP,MAAM,OACN,SAAS,UACT,YAAY,aACZ,aAAa,cACb,QAAQ,SACR,GAAG,iBAEH,sBAAA,cAACA,KAAAA,QAAD;CACE,MAAK;CACM;CACX,OAAO,uBAAuB,WAAW,oBAAoB,QAAQ;CACrE,UAAS,MAAK,cAAc,CAAC;CAC7B,UAAU,YAAY,CAAC;CACvB,GAAI;AAEE,GADL,uBAAuB,WAAW,oBAAoB,QAAQ,KACzD;;;;;;AC5BV,MAAa,kBAAA,GAETC,MAAAA,WAAAA,EAEA,EACE,WACA,OACA,sBAEA,QAAQ,SACR,OAAO,QACP,MAAM,OACN,OAAO,QACP,UAAU,WACV,SAAS,UACT,YAAY,aACZ,QAAQ,SACR,aAAa,cACb,GAAG,cAEL,YAEA,sBAAA,cAACC,kBAAAA,gBAAD;CACa;CACJ;CACP,GAAI;CAC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A8D;CACzE,eAAe;CACf,YAAY;CACZ,WAAW;CACX,cAAc;CACd,aAAa;CACb,eAAe;AACjB;;;;AAKA,MAAa,mBAA0C;CACrD,aAAa,EAAE,OAAO,sBAAA,cAACC,kBAAAA,eAAAA,IAAe,EAAE;CACxC,YAAY,EAAE,OAAO,sBAAA,cAACA,kBAAAA,eAAAA,IAAe,EAAE;CACvC,WAAW,EAAE,OAAO,sBAAA,cAACC,kBAAAA,cAAAA,IAAc,EAAE;CACrC,gBAAgB,EAAE,OAAO,sBAAA,cAACA,kBAAAA,cAAAA,IAAc,EAAE;CAC1C,kBAAkB,EAAE,OAAO,sBAAA,cAACC,kBAAAA,iBAAAA,IAAiB,EAAE;CAC/C,WAAW,EAAE,OAAO,sBAAA,cAACC,kBAAAA,gBAAAA,IAAgB,EAAE;CACvC,UAAU,EAAE,OAAO,sBAAA,cAACA,kBAAAA,gBAAAA,IAAgB,EAAE;CACtC,mBAAmB,EAAE,OAAO,sBAAA,cAACC,kBAAAA,cAAAA,IAAc,EAAE;CAC7C,kBAAkB,EAAE,OAAO,sBAAA,cAACA,kBAAAA,cAAAA,IAAc,EAAE;CAC5C,eAAe,EAAE,OAAO,sBAAA,cAACC,kBAAAA,YAAAA,IAAY,EAAE;CACvC,iBAAiB,EAAE,OAAO,sBAAA,cAACC,kBAAAA,cAAAA,IAAc,EAAE;CAC3C,MAAM,EAAE,OAAO,sBAAA,cAACC,kBAAAA,cAAAA,IAAc,EAAE;CAChC,MAAM,EAAE,OAAO,sBAAA,cAACC,kBAAAA,cAAAA,IAAc,EAAE;AAClC;;;;AAKA,MAAa,oBAAA,GAAgDC,mBAAAA,yBAAAA,CAAyB;CACpF,iBAAiB;CACjB,cAAc;AAChB,CAAC"}
|
|
@@ -8,75 +8,74 @@ type RemoveDataIndexKeys<T> = { [K in keyof T as `data-${string}` extends K ? ne
|
|
|
8
8
|
/**
|
|
9
9
|
* @group Props
|
|
10
10
|
*/
|
|
11
|
-
interface AntDActionProps extends ActionProps, RemoveDataIndexKeys<ComponentPropsWithoutRef<typeof Button>> {}
|
|
11
|
+
export interface AntDActionProps extends ActionProps, RemoveDataIndexKeys<ComponentPropsWithoutRef<typeof Button>> {}
|
|
12
12
|
/**
|
|
13
13
|
* @group Components
|
|
14
14
|
*/
|
|
15
|
-
declare const AntDActionElement: ({ className, handleOnClick, label, title, disabled, disabledTranslation, testID: _testID, level: _level, path: _path, context: _context, validation: _validation, ruleOrGroup: _ruleOrGroup, schema: _schema, ...extraProps }: AntDActionProps) => React.JSX.Element;
|
|
15
|
+
export declare const AntDActionElement: ({ className, handleOnClick, label, title, disabled, disabledTranslation, testID: _testID, level: _level, path: _path, context: _context, validation: _validation, ruleOrGroup: _ruleOrGroup, schema: _schema, ...extraProps }: AntDActionProps) => React.JSX.Element;
|
|
16
16
|
//#endregion
|
|
17
17
|
//#region src/AntDDragHandle.d.ts
|
|
18
18
|
/**
|
|
19
19
|
* @group Props
|
|
20
20
|
*/
|
|
21
|
-
type AntDDragHandleProps = DragHandleProps & {
|
|
21
|
+
export type AntDDragHandleProps = DragHandleProps & {
|
|
22
22
|
label?: any;
|
|
23
23
|
} & ComponentPropsWithRef<typeof HolderOutlined>;
|
|
24
24
|
/**
|
|
25
25
|
* @group Components
|
|
26
26
|
*/
|
|
27
|
-
declare const AntDDragHandle: React.ForwardRefExoticComponent<Omit<AntDDragHandleProps, "ref"> & React.RefAttributes<HTMLSpanElement>>;
|
|
27
|
+
export declare const AntDDragHandle: React.ForwardRefExoticComponent<Omit<AntDDragHandleProps, "ref"> & React.RefAttributes<HTMLSpanElement>>;
|
|
28
28
|
//#endregion
|
|
29
29
|
//#region src/AntDNotToggle.d.ts
|
|
30
30
|
/**
|
|
31
31
|
* @group Props
|
|
32
32
|
*/
|
|
33
|
-
interface AntDNotToggleProps extends NotToggleProps, ComponentPropsWithoutRef<typeof Switch> {}
|
|
33
|
+
export interface AntDNotToggleProps extends NotToggleProps, ComponentPropsWithoutRef<typeof Switch> {}
|
|
34
34
|
/**
|
|
35
35
|
* @group Components
|
|
36
36
|
*/
|
|
37
|
-
declare const AntDNotToggle: ({ className, handleOnChange, label, checked, title, disabled, path: _path, context: _context, validation: _validation, testID: _testID, schema: _schema, ruleGroup: _ruleGroup, ...extraProps }: AntDNotToggleProps) => React.JSX.Element;
|
|
37
|
+
export declare const AntDNotToggle: ({ className, handleOnChange, label, checked, title, disabled, path: _path, context: _context, validation: _validation, testID: _testID, schema: _schema, ruleGroup: _ruleGroup, ...extraProps }: AntDNotToggleProps) => React.JSX.Element;
|
|
38
38
|
//#endregion
|
|
39
39
|
//#region src/AntDShiftActions.d.ts
|
|
40
40
|
/**
|
|
41
41
|
* @group Components
|
|
42
42
|
*/
|
|
43
|
-
declare const AntDShiftActions: ({ shiftUp, shiftDown, shiftUpDisabled, shiftDownDisabled, disabled, className, labels, titles, testID }: ShiftActionsProps) => React.JSX.Element;
|
|
43
|
+
export declare const AntDShiftActions: ({ shiftUp, shiftDown, shiftUpDisabled, shiftDownDisabled, disabled, className, labels, titles, testID }: ShiftActionsProps) => React.JSX.Element;
|
|
44
44
|
//#endregion
|
|
45
45
|
//#region src/AntDValueEditor.d.ts
|
|
46
46
|
/**
|
|
47
47
|
* @group Props
|
|
48
48
|
*/
|
|
49
|
-
interface AntDValueEditorProps extends ValueEditorProps {
|
|
49
|
+
export interface AntDValueEditorProps extends ValueEditorProps {
|
|
50
50
|
extraProps?: Record<string, unknown>;
|
|
51
51
|
}
|
|
52
52
|
/**
|
|
53
53
|
* @group Components
|
|
54
54
|
*/
|
|
55
|
-
declare const AntDValueEditor: (allProps: AntDValueEditorProps) => React.JSX.Element | null;
|
|
55
|
+
export declare const AntDValueEditor: (allProps: AntDValueEditorProps) => React.JSX.Element | null;
|
|
56
56
|
//#endregion
|
|
57
57
|
//#region src/AntDValueSelector.d.ts
|
|
58
58
|
/**
|
|
59
59
|
* @group Props
|
|
60
60
|
*/
|
|
61
|
-
type AntDValueSelectorProps = VersatileSelectorProps & Omit<ComponentPropsWithoutRef<typeof Select>, "onChange" | "defaultValue">;
|
|
61
|
+
export type AntDValueSelectorProps = VersatileSelectorProps & Omit<ComponentPropsWithoutRef<typeof Select>, "onChange" | "defaultValue">;
|
|
62
62
|
/**
|
|
63
63
|
* @group Components
|
|
64
64
|
*/
|
|
65
|
-
declare const AntDValueSelector: ({ className, handleOnChange, options, value, title, disabled, multiple, listsAsArrays, testID: _testID, rule: _rule, ruleGroup: _ruleGroup, rules: _rules, level: _level, path: _path, context: _context, validation: _validation, operator: _operator, field: _field, fieldData: _fieldData, schema: _schema, ...extraProps }: AntDValueSelectorProps) => React.JSX.Element;
|
|
65
|
+
export declare const AntDValueSelector: ({ className, handleOnChange, options, value, title, disabled, multiple, listsAsArrays, testID: _testID, rule: _rule, ruleGroup: _ruleGroup, rules: _rules, level: _level, path: _path, context: _context, validation: _validation, operator: _operator, field: _field, fieldData: _fieldData, schema: _schema, ...extraProps }: AntDValueSelectorProps) => React.JSX.Element;
|
|
66
66
|
//#endregion
|
|
67
67
|
//#region src/index.d.ts
|
|
68
68
|
/**
|
|
69
69
|
* @group Props
|
|
70
70
|
*/
|
|
71
|
-
declare const antdControlElements: ControlElementsProp<FullField, string>;
|
|
71
|
+
export declare const antdControlElements: ControlElementsProp<FullField, string>;
|
|
72
72
|
/**
|
|
73
73
|
* @group Props
|
|
74
74
|
*/
|
|
75
|
-
declare const antdTranslations: Partial<Translations>;
|
|
75
|
+
export declare const antdTranslations: Partial<Translations>;
|
|
76
76
|
/**
|
|
77
77
|
* @group Components
|
|
78
78
|
*/
|
|
79
|
-
declare const QueryBuilderAntD: QueryBuilderContextProvider;
|
|
79
|
+
export declare const QueryBuilderAntD: QueryBuilderContextProvider;
|
|
80
80
|
//#endregion
|
|
81
|
-
export { AntDActionElement, AntDActionProps, AntDDragHandle, AntDDragHandleProps, AntDNotToggle, AntDNotToggleProps, AntDShiftActions, AntDValueEditor, AntDValueEditorProps, AntDValueSelector, AntDValueSelectorProps, QueryBuilderAntD, antdControlElements, antdTranslations };
|
|
82
81
|
//# sourceMappingURL=react-querybuilder_antd.cjs.production.d.ts.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},s=(n,r,s)=>(s=n==null?{}:e(i(n)),o(r||!n||!n.__esModule||!a.call(n,`default`)?t(s,`default`,{value:n,enumerable:!0}):s,n));let c=require("@ant-design/icons"),l=require("react");l=s(l);let u=require("react-querybuilder"),d=require("antd"),f=require("antd/es/date-picker/generatePicker/index.js");f=s(f);let p=require("dayjs");p=s(p);let m=require("dayjs/plugin/advancedFormat.js");m=s(m);let h=require("dayjs/plugin/customParseFormat.js");h=s(h);let g=require("dayjs/plugin/localeData.js");g=s(g);let _=require("dayjs/plugin/weekday.js");_=s(_);let v=require("dayjs/plugin/weekOfYear.js");v=s(v);let y=require("dayjs/plugin/weekYear.js");y=s(y);const b=({className:e,handleOnClick:t,label:n,title:r,disabled:i,disabledTranslation:a,testID:o,level:s,path:c,context:u,validation:f,ruleOrGroup:p,schema:m,...h})=>l.createElement(d.Button,{type:`primary`,className:e,title:a&&i?a.title:r,onClick:e=>t(e),disabled:i&&!a,...h},a&&i?a.label:n),x=(0,l.forwardRef)(({className:e,title:t,dragHandleAttributes:n,testID:r,level:i,path:a,label:o,disabled:s,context:u,validation:d,schema:f,ruleOrGroup:p,...m},h)=>l.createElement(c.HolderOutlined,{className:e,title:t,...m,...n,ref:h})),S=({className:e,handleOnChange:t,label:n,checked:r,title:i,disabled:a,path:o,context:s,validation:c,testID:u,schema:f,ruleGroup:p,...m})=>l.createElement(d.Switch,{title:i,className:e,onChange:e=>t(e),checked:!!r,disabled:a,checkedChildren:n,unCheckedChildren:`=`,...m}),C=({shiftUp:e,shiftDown:t,shiftUpDisabled:n,shiftDownDisabled:r,disabled:i,className:a,labels:o,titles:s,testID:c})=>l.createElement(`div`,{"data-testid":c,className:a},l.createElement(d.Button,{type:`primary`,size:`small`,title:s?.shiftUp,onClick:e,disabled:i||n},o?.shiftUp),l.createElement(d.Button,{type:`primary`,size:`small`,title:s?.shiftDown,onClick:t,disabled:i||r},o?.shiftDown));p.default.extend(h.default),p.default.extend(m.default),p.default.extend(_.default),p.default.extend(g.default),p.default.extend(v.default),p.default.extend(y.default),p.default.extend((e,t)=>{let n=t.prototype,r=n.format;n.format=function(e){let t=(e||``).replace(`Wo`,`wo`);return r.bind(this)(t)}});const w={bn_BD:`bn-bd`,by_BY:`be`,en_GB:`en-gb`,en_US:`en`,fr_BE:`fr`,fr_CA:`fr-ca`,hy_AM:`hy-am`,kmr_IQ:`ku`,nl_BE:`nl-be`,pt_BR:`pt-br`,zh_CN:`zh-cn`,zh_HK:`zh-hk`,zh_TW:`zh-tw`},T=e=>w[e]||e.split(`_`)[0],E=(0,f.default)({getNow:()=>(0,p.default)(),getFixedDate:e=>(0,p.default)(e,[`YYYY-M-DD`,`YYYY-MM-DD`]),getEndDate:e=>e.endOf(`month`),getWeekDay:e=>{let t=e.locale(`en`);return t.weekday()+t.localeData().firstDayOfWeek()},getYear:e=>e.year(),getMonth:e=>e.month(),getDate:e=>e.date(),getHour:e=>e.hour(),getMinute:e=>e.minute(),getSecond:e=>e.second(),getMillisecond:e=>e.millisecond(),addYear:(e,t)=>e.add(t,`year`),addMonth:(e,t)=>e.add(t,`month`),addDate:(e,t)=>e.add(t,`day`),setYear:(e,t)=>e.year(t),setMonth:(e,t)=>e.month(t),setDate:(e,t)=>e.date(t),setHour:(e,t)=>e.hour(t),setMinute:(e,t)=>e.minute(t),setSecond:(e,t)=>e.second(t),setMillisecond:(e,t)=>e.millisecond(t),isAfter:(e,t)=>e.isAfter(t),isValidate:e=>e.isValid(),locale:{getWeekFirstDay:e=>(0,p.default)().locale(T(e)).localeData().firstDayOfWeek(),getWeekFirstDate:(e,t)=>t.locale(T(e)).weekday(0),getWeek:(e,t)=>t.locale(T(e)).week(),getShortWeekDays:e=>(0,p.default)().locale(T(e)).localeData().weekdaysMin(),getShortMonths:e=>(0,p.default)().locale(T(e)).localeData().monthsShort(),format:(e,t,n)=>t.locale(T(e)).format(n),parse:(e,t,n)=>{let r=T(e);for(let e of n){let n=t;if(e.includes(`wo`)||e.includes(`Wo`)){let e=n.split(`-`)[0],t=n.split(`-`)[1],i=(0,p.default)(e,`YYYY`).startOf(`year`).locale(r);for(let e=0;e<=52;e+=1){let n=i.add(e,`week`);if(n.format(`Wo`)===t)return n}return null}let i=(0,p.default)(n,e,!0).locale(r);if(i.isValid())return i}return null}}}),D=e=>{let{fieldData:t,operator:n,value:r,handleOnChange:i,title:a,className:o,type:s,inputType:c,values:f=[],listsAsArrays:m,separator:h,valueSource:g,disabled:_,testID:v,selectorComponent:y=e.schema.controls.valueSelector,extraProps:b,parseNumbers:x,...S}=e,{valueAsArray:C,multiValueHandler:w,bigIntValueHandler:T,valueListItemClassName:D,inputTypeCoerced:O}=(0,u.useValueEditor)(e);if(n===`null`||n===`notNull`)return null;let k=t?.placeholder??``;if((n===`between`||n===`notBetween`)&&(s===`select`||s===`text`)&&O!==`date`&&O!==`datetime-local`){if(s===`text`){let e=[`from`,`to`].map((e,t)=>O===`time`?l.createElement(E.TimePicker,{key:e,value:C[t]?(0,p.default)(C[t],`HH:mm:ss`):null,className:D,disabled:_,placeholder:k,onChange:e=>w(e?.format(`HH:mm:ss`)??``,t),...b}):O===`number`?l.createElement(d.InputNumber,{key:e,type:O,value:C[t]??``,className:D,disabled:_,placeholder:k,onChange:e=>w(e,t),...b}):l.createElement(d.Input,{key:e,type:O,value:C[t]??``,className:D,disabled:_,placeholder:k,onChange:e=>w(e.target.value,t),...b}));return l.createElement(`span`,{"data-testid":v,className:o,title:a},e[0],h,e[1])}return l.createElement(u.ValueEditor,{...e,skipHook:!0})}switch(s){case`select`:case`multiselect`:return l.createElement(y,{...S,className:o,title:a,value:r,disabled:_,listsAsArrays:m,multiple:s===`multiselect`,handleOnChange:i,options:f,...b});case`textarea`:return l.createElement(d.Input.TextArea,{value:r,title:a,className:o,disabled:_,placeholder:k,onChange:e=>i(e.target.value),...b});case`switch`:return l.createElement(d.Switch,{checked:!!r,title:a,className:o,disabled:_,onChange:e=>i(e),...b});case`checkbox`:return l.createElement(`span`,{title:a,className:o},l.createElement(d.Checkbox,{type:`checkbox`,disabled:_,onChange:e=>i(e.target.checked),checked:!!r,...b}));case`radio`:return l.createElement(`span`,{className:o,title:a},f.map(e=>l.createElement(d.Radio,{key:e.name,value:e.name,checked:r===e.name,disabled:_,onChange:e=>i(e.target.value),...b},e.label)))}switch(O){case`date`:case`datetime-local`:{if(n===`between`||n===`notBetween`){let e=C.slice(0,2).map(e=>(0,p.default)(e));return l.createElement(E.RangePicker,{value:e.every(e=>e.isValid())?e:void 0,showTime:O===`datetime-local`,className:o,disabled:_,placeholder:[k,k],onChange:e=>{let t=`YYYY-MM-DD${O===`datetime-local`?`THH:mm:ss`:``}`,n=e?.map(e=>e?.isValid()?e.format(t):void 0);i(n?m?n:(0,u.joinWith)(n,`,`):e)},...b})}let e=(0,p.default)(r);return l.createElement(E,{value:e.isValid()?e:void 0,showTime:O===`datetime-local`,className:o,disabled:_,placeholder:k,onChange:(e,t)=>i(t),...b})}case`time`:{let e=(0,p.default)(r,`HH:mm:ss`);return l.createElement(E.TimePicker,{value:e.isValid()?e:void 0,className:o,disabled:_,placeholder:k,onChange:e=>i(e?.format(`HH:mm:ss`)??``),...b})}case`number`:return l.createElement(d.InputNumber,{type:O,value:r,title:a,className:o,disabled:_,placeholder:k,onChange:i,...b})}return c===`bigint`?l.createElement(d.Input,{"data-testid":v,type:O,placeholder:k,value:`${r}`,title:a,className:o,disabled:_,onChange:e=>T(e.target.value),...b}):l.createElement(d.Input,{type:O,value:r,title:a,className:o,disabled:_,placeholder:k,onChange:e=>i(e.target.value),...b})},O=({className:e,handleOnChange:t,options:n,value:r,title:i,disabled:a,multiple:o,listsAsArrays:s,testID:c,rule:f,ruleGroup:p,rules:m,level:h,path:g,context:_,validation:v,operator:y,field:b,fieldData:x,schema:S,...C})=>{let{onChange:w}=(0,u.useValueSelector)({handleOnChange:t,listsAsArrays:!1,multiple:!1,value:r}),{onChange:T,val:E}=(0,u.useValueSelector)({handleOnChange:t,listsAsArrays:o||s,multiple:o,value:r}),D=l.useCallback(e=>{o&&!s&&Array.isArray(e)?w((0,u.joinWith)(e)):T(e)},[s,o,w,T]);return l.createElement(d.Select,{...o?{mode:`multiple`,allowClear:!0}:{},title:i,className:e,popupMatchSelectWidth:!1,disabled:a,value:E,onChange:D,optionFilterProp:`label`,options:n,...C})},k={actionElement:b,dragHandle:x,notToggle:S,shiftActions:C,valueEditor:D,valueSelector:O},A={removeGroup:{label:l.createElement(c.CloseOutlined,null)},removeRule:{label:l.createElement(c.CloseOutlined,null)},cloneRule:{label:l.createElement(c.CopyOutlined,null)},cloneRuleGroup:{label:l.createElement(c.CopyOutlined,null)},lockGroup:{label:l.createElement(c.UnlockOutlined,null)},lockRule:{label:l.createElement(c.UnlockOutlined,null)},lockGroupDisabled:{label:l.createElement(c.LockOutlined,null)},lockRuleDisabled:{label:l.createElement(c.LockOutlined,null)},shiftActionUp:{label:l.createElement(c.UpOutlined,null)},shiftActionDown:{label:l.createElement(c.DownOutlined,null)},undo:{label:l.createElement(c.UndoOutlined,null)},redo:{label:l.createElement(c.RedoOutlined,null)}},j=(0,u.getCompatContextProvider)({controlElements:k,translations:A});exports.AntDActionElement=b,exports.AntDDragHandle=x,exports.AntDNotToggle=S,exports.AntDShiftActions=C,exports.AntDValueEditor=D,exports.AntDValueSelector=O,exports.QueryBuilderAntD=j,exports.antdControlElements=k,exports.antdTranslations=A;
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},s=(n,r,s)=>(s=n==null?{}:e(i(n)),o(r||!n||!n.__esModule||!a.call(n,`default`)?t(s,`default`,{value:n,enumerable:!0}):s,n));let c=require("@ant-design/icons"),l=require("react");l=s(l);let u=require("react-querybuilder"),d=require("antd"),f=require("antd/es/date-picker/generatePicker/index.js");f=s(f);let p=require("dayjs");p=s(p);let m=require("dayjs/plugin/advancedFormat.js");m=s(m);let h=require("dayjs/plugin/customParseFormat.js");h=s(h);let g=require("dayjs/plugin/localeData.js");g=s(g);let _=require("dayjs/plugin/weekday.js");_=s(_);let v=require("dayjs/plugin/weekOfYear.js");v=s(v);let y=require("dayjs/plugin/weekYear.js");y=s(y);const b=({className:e,handleOnClick:t,label:n,title:r,disabled:i,disabledTranslation:a,testID:o,level:s,path:c,context:u,validation:f,ruleOrGroup:p,schema:m,...h})=>l.createElement(d.Button,{type:`primary`,className:e,title:a&&i?a.title:r,onClick:e=>t(e),disabled:i&&!a,...h},a&&i?a.label:n),x=(0,l.forwardRef)(({className:e,title:t,dragHandleAttributes:n,testID:r,level:i,path:a,label:o,disabled:s,context:u,validation:d,schema:f,ruleOrGroup:p,...m},h)=>l.createElement(c.HolderOutlined,{className:e,title:t,...m,...n,ref:h})),S=({className:e,handleOnChange:t,label:n,checked:r,title:i,disabled:a,path:o,context:s,validation:c,testID:u,schema:f,ruleGroup:p,...m})=>l.createElement(d.Switch,{title:i,className:e,onChange:e=>t(e),checked:!!r,disabled:a,checkedChildren:n,unCheckedChildren:`=`,...m}),C=({shiftUp:e,shiftDown:t,shiftUpDisabled:n,shiftDownDisabled:r,disabled:i,className:a,labels:o,titles:s,testID:c})=>l.createElement(`div`,{"data-testid":c,className:a},l.createElement(d.Button,{type:`primary`,size:`small`,title:s?.shiftUp,onClick:e,disabled:i||n},o?.shiftUp),l.createElement(d.Button,{type:`primary`,size:`small`,title:s?.shiftDown,onClick:t,disabled:i||r},o?.shiftDown));p.default.extend(h.default),p.default.extend(m.default),p.default.extend(_.default),p.default.extend(g.default),p.default.extend(v.default),p.default.extend(y.default),p.default.extend((e,t)=>{let n=t.prototype,r=n.format;n.format=function(e){let t=(e||``).replace(`Wo`,`wo`);return r.bind(this)(t)}});const w={bn_BD:`bn-bd`,by_BY:`be`,en_GB:`en-gb`,en_US:`en`,fr_BE:`fr`,fr_CA:`fr-ca`,hy_AM:`hy-am`,kmr_IQ:`ku`,nl_BE:`nl-be`,pt_BR:`pt-br`,zh_CN:`zh-cn`,zh_HK:`zh-hk`,zh_TW:`zh-tw`},T=e=>w[e]||e.split(`_`)[0],E=(0,f.default)({getNow:()=>(0,p.default)(),getFixedDate:e=>(0,p.default)(e,[`YYYY-M-DD`,`YYYY-MM-DD`]),getEndDate:e=>e.endOf(`month`),getWeekDay:e=>{let t=e.locale(`en`);return t.weekday()+t.localeData().firstDayOfWeek()},getYear:e=>e.year(),getMonth:e=>e.month(),getDate:e=>e.date(),getHour:e=>e.hour(),getMinute:e=>e.minute(),getSecond:e=>e.second(),getMillisecond:e=>e.millisecond(),addYear:(e,t)=>e.add(t,`year`),addMonth:(e,t)=>e.add(t,`month`),addDate:(e,t)=>e.add(t,`day`),setYear:(e,t)=>e.year(t),setMonth:(e,t)=>e.month(t),setDate:(e,t)=>e.date(t),setHour:(e,t)=>e.hour(t),setMinute:(e,t)=>e.minute(t),setSecond:(e,t)=>e.second(t),setMillisecond:(e,t)=>e.millisecond(t),isAfter:(e,t)=>e.isAfter(t),isValidate:e=>e.isValid(),locale:{getWeekFirstDay:e=>(0,p.default)().locale(T(e)).localeData().firstDayOfWeek(),getWeekFirstDate:(e,t)=>t.locale(T(e)).weekday(0),getWeek:(e,t)=>t.locale(T(e)).week(),getShortWeekDays:e=>(0,p.default)().locale(T(e)).localeData().weekdaysMin(),getShortMonths:e=>(0,p.default)().locale(T(e)).localeData().monthsShort(),format:(e,t,n)=>t.locale(T(e)).format(n),parse:(e,t,n)=>{let r=T(e);for(let e of n){let n=t;if(e.includes(`wo`)||e.includes(`Wo`)){let e=n.split(`-`)[0],t=n.split(`-`)[1],i=(0,p.default)(e,`YYYY`).startOf(`year`).locale(r);for(let e=0;e<=52;e+=1){let n=i.add(e,`week`);if(n.format(`Wo`)===t)return n}return null}let i=(0,p.default)(n,e,!0).locale(r);if(i.isValid())return i}return null}}}),D=e=>{let{fieldData:t,operator:n,value:r,handleOnChange:i,title:a,className:o,type:s,inputType:c,values:f=[],listsAsArrays:m,separator:h,valueSource:g,disabled:_,testID:v,selectorComponent:y=e.schema.controls.valueSelector,extraProps:b,parseNumbers:x,...S}=e,{valueAsArray:C,multiValueHandler:w,bigIntValueHandler:T,valueListItemClassName:D,inputTypeCoerced:O}=(0,u.useValueEditor)(e);if(n===`null`||n===`notNull`)return null;let k=t?.placeholder??``;if((n===`between`||n===`notBetween`)&&(s===`select`||s===`text`)&&O!==`date`&&O!==`datetime-local`){if(s===`text`){let e=[`from`,`to`].map((e,t)=>O===`time`?l.createElement(E.TimePicker,{key:e,value:C[t]?(0,p.default)(C[t],`HH:mm:ss`):null,className:D,disabled:_,placeholder:k,onChange:e=>w(e?.format(`HH:mm:ss`)??``,t),...b}):O===`number`?l.createElement(d.InputNumber,{key:e,type:O,value:C[t]??``,className:D,disabled:_,placeholder:k,onChange:e=>w(e,t),...b}):l.createElement(d.Input,{key:e,type:O,value:C[t]??``,className:D,disabled:_,placeholder:k,onChange:e=>w(e.target.value,t),...b}));return l.createElement(`span`,{"data-testid":v,className:o,title:a},e[0],h,e[1])}return l.createElement(u.ValueEditor,{...e,skipHook:!0})}switch(s){case`select`:case`multiselect`:return l.createElement(y,{...S,className:o,title:a,value:r,disabled:_,listsAsArrays:m,multiple:s===`multiselect`,handleOnChange:i,options:f,...b});case`textarea`:return l.createElement(d.Input.TextArea,{value:r,title:a,className:o,disabled:_,placeholder:k,onChange:e=>i(e.target.value),...b});case`switch`:return l.createElement(d.Switch,{checked:!!r,title:a,className:o,disabled:_,onChange:e=>i(e),...b});case`checkbox`:return l.createElement(`span`,{title:a,className:o},l.createElement(d.Checkbox,{type:`checkbox`,disabled:_,onChange:e=>i(e.target.checked),checked:!!r,...b}));case`radio`:return l.createElement(`span`,{className:o,title:a},f.map(e=>l.createElement(d.Radio,{key:e.name,value:e.name,checked:r===e.name,disabled:_,onChange:e=>i(e.target.value),...b},e.label)))}switch(O){case`date`:case`datetime-local`:{if(n===`between`||n===`notBetween`){let e=C.slice(0,2).map(e=>(0,p.default)(e));return l.createElement(E.RangePicker,{value:e.every(e=>e.isValid())?e:void 0,showTime:O===`datetime-local`,className:o,disabled:_,placeholder:[k,k],onChange:e=>{let t=`YYYY-MM-DD${O===`datetime-local`?`THH:mm:ss`:``}`,n=e?.map(e=>e?.isValid()?e.format(t):void 0);i(n?m?n:(0,u.joinWith)(n,`,`):e)},...b})}let e=(0,p.default)(r);return l.createElement(E,{value:e.isValid()?e:void 0,showTime:O===`datetime-local`,className:o,disabled:_,placeholder:k,onChange:(e,t)=>i(t),...b})}case`time`:{let e=(0,p.default)(r,`HH:mm:ss`);return l.createElement(E.TimePicker,{value:e.isValid()?e:void 0,className:o,disabled:_,placeholder:k,onChange:e=>i(e?.format(`HH:mm:ss`)??``),...b})}case`number`:return l.createElement(d.InputNumber,{type:O,value:r,title:a,className:o,disabled:_,placeholder:k,onChange:i,...b})}return c===`bigint`?l.createElement(d.Input,{"data-testid":v,type:O,placeholder:k,value:`${r}`,title:a,className:o,disabled:_,onChange:e=>T(e.target.value),...b}):l.createElement(d.Input,{type:O,value:r,title:a,className:o,disabled:_,placeholder:k,onChange:e=>i(e.target.value),...b})},O=({className:e,handleOnChange:t,options:n,value:r,title:i,disabled:a,multiple:o,listsAsArrays:s,testID:c,rule:f,ruleGroup:p,rules:m,level:h,path:g,context:_,validation:v,operator:y,field:b,fieldData:x,schema:S,...C})=>{let{onChange:w}=(0,u.useValueSelector)({handleOnChange:t,listsAsArrays:!1,multiple:!1,value:r}),{onChange:T,val:E}=(0,u.useValueSelector)({handleOnChange:t,listsAsArrays:o||s,multiple:o,value:r}),D=l.useCallback(e=>{o&&!s&&Array.isArray(e)?w((0,u.joinWith)(e)):T(e)},[s,o,w,T]);return l.createElement(d.Select,{...o?{mode:`multiple`,allowClear:!0}:{},title:i,className:e,popupMatchSelectWidth:!1,disabled:a,value:E,onChange:D,optionFilterProp:`label`,options:n,...C})},k={actionElement:b,dragHandle:x,notToggle:S,shiftActions:C,valueEditor:D,valueSelector:O},A={removeGroup:{label:l.createElement(c.CloseOutlined,null)},removeRule:{label:l.createElement(c.CloseOutlined,null)},cloneRule:{label:l.createElement(c.CopyOutlined,null)},cloneRuleGroup:{label:l.createElement(c.CopyOutlined,null)},ungroupRuleGroup:{label:l.createElement(c.UngroupOutlined,null)},lockGroup:{label:l.createElement(c.UnlockOutlined,null)},lockRule:{label:l.createElement(c.UnlockOutlined,null)},lockGroupDisabled:{label:l.createElement(c.LockOutlined,null)},lockRuleDisabled:{label:l.createElement(c.LockOutlined,null)},shiftActionUp:{label:l.createElement(c.UpOutlined,null)},shiftActionDown:{label:l.createElement(c.DownOutlined,null)},undo:{label:l.createElement(c.UndoOutlined,null)},redo:{label:l.createElement(c.RedoOutlined,null)}},j=(0,u.getCompatContextProvider)({controlElements:k,translations:A});exports.AntDActionElement=b,exports.AntDDragHandle=x,exports.AntDNotToggle=S,exports.AntDShiftActions=C,exports.AntDValueEditor=D,exports.AntDValueSelector=O,exports.QueryBuilderAntD=j,exports.antdControlElements=k,exports.antdTranslations=A;
|
|
2
2
|
//# sourceMappingURL=react-querybuilder_antd.cjs.production.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"react-querybuilder_antd.cjs.production.js","names":["Button","forwardRef","HolderOutlined","Switch","Button","customParseFormat","advancedFormat","weekday","localeData","weekOfYear","weekYear","generatePicker","dayjsGenerateConfig","useValueEditor","InputNumber","Input","ValueEditor","Switch","Checkbox","Radio","joinWith","useValueSelector","React","joinWith","Select","CloseOutlined","CopyOutlined","UnlockOutlined","LockOutlined","UpOutlined","DownOutlined","UndoOutlined","RedoOutlined","getCompatContextProvider"],"sources":["../../src/AntDActionElement.tsx","../../src/AntDDragHandle.tsx","../../src/AntDNotToggle.tsx","../../src/AntDShiftActions.tsx","../../src/dayjs.ts","../../src/AntDValueEditor.tsx","../../src/AntDValueSelector.tsx","../../src/index.tsx"],"sourcesContent":["import { Button } from 'antd';\nimport type { ComponentPropsWithoutRef } from 'react';\nimport * as React from 'react';\nimport type { ActionProps } from 'react-querybuilder';\n\n// TODO: This may be unnecessary. Find out if there's a way to allow\n// `data-${string}` index keys without breaking other type contraints.\ntype RemoveDataIndexKeys<T> = {\n [K in keyof T as `data-${string}` extends K ? never : K]: T[K];\n};\n\n/**\n * @group Props\n */\nexport interface AntDActionProps\n extends ActionProps, RemoveDataIndexKeys<ComponentPropsWithoutRef<typeof Button>> {}\n\n/**\n * @group Components\n */\nexport const AntDActionElement = ({\n className,\n handleOnClick,\n label,\n title,\n disabled,\n disabledTranslation,\n // Props that should not be in extraProps\n testID: _testID,\n level: _level,\n path: _path,\n context: _context,\n validation: _validation,\n ruleOrGroup: _ruleOrGroup,\n schema: _schema,\n ...extraProps\n}: AntDActionProps): React.JSX.Element => (\n <Button\n type=\"primary\"\n className={className}\n title={disabledTranslation && disabled ? disabledTranslation.title : title}\n onClick={e => handleOnClick(e)}\n disabled={disabled && !disabledTranslation}\n {...extraProps}>\n {disabledTranslation && disabled ? disabledTranslation.label : label}\n </Button>\n);\n","import { HolderOutlined } from '@ant-design/icons';\nimport type { ComponentPropsWithRef } from 'react';\nimport * as React from 'react';\nimport { forwardRef } from 'react';\nimport type { DragHandleProps } from 'react-querybuilder';\n\n/**\n * @group Props\n */\n// oxlint-disable-next-line typescript/no-explicit-any\nexport type AntDDragHandleProps = DragHandleProps & { label?: any } & ComponentPropsWithRef<\n typeof HolderOutlined\n >;\n\n/**\n * @group Components\n */\nexport const AntDDragHandle: React.ForwardRefExoticComponent<\n Omit<AntDDragHandleProps, 'ref'> & React.RefAttributes<HTMLSpanElement>\n> = forwardRef<HTMLSpanElement, AntDDragHandleProps>(\n (\n {\n className,\n title,\n dragHandleAttributes,\n // Props that should not be in extraProps\n testID: _testID,\n level: _level,\n path: _path,\n label: _label,\n disabled: _disabled,\n context: _context,\n validation: _validation,\n schema: _schema,\n ruleOrGroup: _ruleOrGroup,\n ...extraProps\n },\n dragRef\n ) => (\n <HolderOutlined\n className={className}\n title={title}\n {...extraProps}\n {...dragHandleAttributes}\n ref={dragRef}\n />\n )\n);\n","import { Switch } from 'antd';\nimport type { ComponentPropsWithoutRef } from 'react';\nimport * as React from 'react';\nimport type { NotToggleProps } from 'react-querybuilder';\n\n/**\n * @group Props\n */\nexport interface AntDNotToggleProps\n extends NotToggleProps, ComponentPropsWithoutRef<typeof Switch> {}\n\n/**\n * @group Components\n */\nexport const AntDNotToggle = ({\n className,\n handleOnChange,\n label,\n checked,\n title,\n disabled,\n // Props that should not be in extraProps\n path: _path,\n context: _context,\n validation: _validation,\n testID: _testID,\n schema: _schema,\n ruleGroup: _ruleGroup,\n ...extraProps\n}: AntDNotToggleProps): React.JSX.Element => (\n <Switch\n title={title}\n className={className}\n onChange={v => handleOnChange(v)}\n checked={!!checked}\n disabled={disabled}\n checkedChildren={label}\n unCheckedChildren=\"=\"\n {...extraProps}\n />\n);\n","import { Button } from 'antd';\nimport * as React from 'react';\nimport type { ShiftActionsProps } from 'react-querybuilder';\n\n/**\n * @group Components\n */\nexport const AntDShiftActions = ({\n shiftUp,\n shiftDown,\n shiftUpDisabled,\n shiftDownDisabled,\n disabled,\n className,\n labels,\n titles,\n testID,\n}: ShiftActionsProps): React.JSX.Element => (\n <div data-testid={testID} className={className}>\n <Button\n type=\"primary\"\n size=\"small\"\n title={titles?.shiftUp}\n onClick={shiftUp}\n disabled={disabled || shiftUpDisabled}>\n {labels?.shiftUp}\n </Button>\n <Button\n type=\"primary\"\n size=\"small\"\n title={titles?.shiftDown}\n onClick={shiftDown}\n disabled={disabled || shiftDownDisabled}>\n {labels?.shiftDown}\n </Button>\n </div>\n);\n","/**\n * This file is adapted from the following sources:\n * - https://github.com/react-component/picker/blob/d526bd551778070be3295060f1b5841786cb9500/src/generate/dayjs.ts\n * - https://github.com/react-component/picker/blob/d526bd551778070be3295060f1b5841786cb9500/src/generate/index.ts\n */\n\nimport type { Dayjs } from 'dayjs';\nimport dayjs from 'dayjs';\nimport advancedFormat from 'dayjs/plugin/advancedFormat.js';\nimport customParseFormat from 'dayjs/plugin/customParseFormat.js';\nimport localeData from 'dayjs/plugin/localeData.js';\nimport weekday from 'dayjs/plugin/weekday.js';\nimport weekOfYear from 'dayjs/plugin/weekOfYear.js';\nimport weekYear from 'dayjs/plugin/weekYear.js';\n\ntype GenerateConfig<DateType> = {\n // Get\n getWeekDay: (value: DateType) => number;\n getMillisecond: (value: DateType) => number;\n getSecond: (value: DateType) => number;\n getMinute: (value: DateType) => number;\n getHour: (value: DateType) => number;\n getDate: (value: DateType) => number;\n getMonth: (value: DateType) => number;\n getYear: (value: DateType) => number;\n getNow: () => DateType;\n getFixedDate: (fixed: string) => DateType;\n getEndDate: (value: DateType) => DateType;\n\n // Set\n addYear: (value: DateType, diff: number) => DateType;\n addMonth: (value: DateType, diff: number) => DateType;\n addDate: (value: DateType, diff: number) => DateType;\n setYear: (value: DateType, year: number) => DateType;\n setMonth: (value: DateType, month: number) => DateType;\n setDate: (value: DateType, date: number) => DateType;\n setHour: (value: DateType, hour: number) => DateType;\n setMinute: (value: DateType, minute: number) => DateType;\n setSecond: (value: DateType, second: number) => DateType;\n setMillisecond: (value: DateType, millisecond: number) => DateType;\n\n // Compare\n isAfter: (date1: DateType, date2: DateType) => boolean;\n isValidate: (date: DateType) => boolean;\n\n locale: {\n getWeekFirstDay: (locale: string) => number;\n getWeekFirstDate: (locale: string, value: DateType) => DateType;\n getWeek: (locale: string, value: DateType) => number;\n\n format: (locale: string, date: DateType, format: string) => string;\n\n /** Should only return validate date instance */\n parse: (locale: string, text: string, formats: string[]) => DateType | null;\n\n /** A proxy for getting locale with moment or other locale library */\n getShortWeekDays?: (locale: string) => string[];\n /** A proxy for getting locale with moment or other locale library */\n getShortMonths?: (locale: string) => string[];\n };\n};\n\n/* v8 ignore file -- @preserve */\n\ndayjs.extend(customParseFormat);\ndayjs.extend(advancedFormat);\ndayjs.extend(weekday);\ndayjs.extend(localeData);\ndayjs.extend(weekOfYear);\ndayjs.extend(weekYear);\n\ndayjs.extend((o, c) => {\n // todo support Wo (ISO week)\n const proto = c.prototype;\n const oldFormat = proto.format;\n proto.format = function f(formatStr: string) {\n const str = (formatStr || '').replace('Wo', 'wo');\n return oldFormat.bind(this)(str);\n };\n});\n\ntype IlocaleMapObject = Record<string, string>;\nconst localeMap: IlocaleMapObject = {\n // ar_EG:\n // az_AZ:\n // bg_BG:\n bn_BD: 'bn-bd',\n by_BY: 'be',\n // ca_ES:\n // cs_CZ:\n // da_DK:\n // de_DE:\n // el_GR:\n en_GB: 'en-gb',\n en_US: 'en',\n // es_ES:\n // et_EE:\n // fa_IR:\n // fi_FI:\n fr_BE: 'fr', // todo: dayjs has no fr_BE locale, use fr at present\n fr_CA: 'fr-ca',\n // fr_FR:\n // ga_IE:\n // gl_ES:\n // he_IL:\n // hi_IN:\n // hr_HR:\n // hu_HU:\n hy_AM: 'hy-am',\n // id_ID:\n // is_IS:\n // it_IT:\n // ja_JP:\n // ka_GE:\n // kk_KZ:\n // km_KH:\n kmr_IQ: 'ku',\n // kn_IN:\n // ko_KR:\n // ku_IQ: // previous ku in antd\n // lt_LT:\n // lv_LV:\n // mk_MK:\n // ml_IN:\n // mn_MN:\n // ms_MY:\n // nb_NO:\n // ne_NP:\n nl_BE: 'nl-be',\n // nl_NL:\n // pl_PL:\n pt_BR: 'pt-br',\n // pt_PT:\n // ro_RO:\n // ru_RU:\n // sk_SK:\n // sl_SI:\n // sr_RS:\n // sv_SE:\n // ta_IN:\n // th_TH:\n // tr_TR:\n // uk_UA:\n // ur_PK:\n // vi_VN:\n zh_CN: 'zh-cn',\n zh_HK: 'zh-hk',\n zh_TW: 'zh-tw',\n};\n\nconst parseLocale = (locale: string) => {\n const mapLocale = localeMap[locale];\n return mapLocale || locale.split('_')[0];\n};\n\nconst parseNoMatchNotice = () => {\n // noteOnce(false, 'Not match any format. Please help to fire a issue about this.');\n};\n\nconst generateConfig: GenerateConfig<Dayjs> = {\n // get\n getNow: () => dayjs(),\n getFixedDate: string => dayjs(string, ['YYYY-M-DD', 'YYYY-MM-DD']),\n getEndDate: date => date.endOf('month'),\n getWeekDay: date => {\n const clone = date.locale('en');\n return clone.weekday() + clone.localeData().firstDayOfWeek();\n },\n getYear: date => date.year(),\n getMonth: date => date.month(),\n getDate: date => date.date(),\n getHour: date => date.hour(),\n getMinute: date => date.minute(),\n getSecond: date => date.second(),\n getMillisecond: date => date.millisecond(),\n\n // set\n addYear: (date, diff) => date.add(diff, 'year'),\n addMonth: (date, diff) => date.add(diff, 'month'),\n addDate: (date, diff) => date.add(diff, 'day'),\n setYear: (date, year) => date.year(year),\n setMonth: (date, month) => date.month(month),\n setDate: (date, num) => date.date(num),\n setHour: (date, hour) => date.hour(hour),\n setMinute: (date, minute) => date.minute(minute),\n setSecond: (date, second) => date.second(second),\n setMillisecond: (date, milliseconds) => date.millisecond(milliseconds),\n\n // Compare\n isAfter: (date1, date2) => date1.isAfter(date2),\n isValidate: date => date.isValid(),\n\n locale: {\n getWeekFirstDay: locale => dayjs().locale(parseLocale(locale)).localeData().firstDayOfWeek(),\n getWeekFirstDate: (locale, date) => date.locale(parseLocale(locale)).weekday(0),\n getWeek: (locale, date) => date.locale(parseLocale(locale)).week(),\n getShortWeekDays: locale => dayjs().locale(parseLocale(locale)).localeData().weekdaysMin(),\n getShortMonths: locale => dayjs().locale(parseLocale(locale)).localeData().monthsShort(),\n format: (locale, date, format) => date.locale(parseLocale(locale)).format(format),\n parse: (locale, text, formats) => {\n const localeStr = parseLocale(locale);\n for (const format of formats) {\n const formatText = text;\n if (format.includes('wo') || format.includes('Wo')) {\n // parse Wo\n const year = formatText.split('-')[0];\n const weekStr = formatText.split('-')[1];\n const firstWeek = dayjs(year, 'YYYY').startOf('year').locale(localeStr);\n for (let j = 0; j <= 52; j += 1) {\n const nextWeek = firstWeek.add(j, 'week');\n if (nextWeek.format('Wo') === weekStr) {\n return nextWeek;\n }\n }\n parseNoMatchNotice();\n return null;\n }\n const date = dayjs(formatText, format, true).locale(localeStr);\n if (date.isValid()) {\n return date;\n }\n }\n\n if (text) {\n parseNoMatchNotice();\n }\n return null;\n },\n },\n};\n\nexport default generateConfig;\n","import { Checkbox, Input, InputNumber, Radio, Switch } from 'antd';\nimport generatePicker from 'antd/es/date-picker/generatePicker/index.js';\nimport type { Dayjs } from 'dayjs';\nimport dayjs from 'dayjs';\nimport * as React from 'react';\nimport type { ValueEditorProps } from 'react-querybuilder';\nimport { joinWith, useValueEditor, ValueEditor } from 'react-querybuilder';\nimport dayjsGenerateConfig from './dayjs';\n\n/**\n * @group Props\n */\nexport interface AntDValueEditorProps extends ValueEditorProps {\n extraProps?: Record<string, unknown>;\n}\n\nconst DatePicker = generatePicker(dayjsGenerateConfig);\n\n/**\n * @group Components\n */\nexport const AntDValueEditor = (allProps: AntDValueEditorProps): React.JSX.Element | null => {\n const {\n fieldData,\n operator,\n value,\n handleOnChange,\n title,\n className,\n type,\n inputType,\n values = [],\n listsAsArrays,\n separator,\n valueSource: _vs,\n disabled,\n testID,\n selectorComponent: SelectorComponent = allProps.schema.controls.valueSelector,\n extraProps,\n parseNumbers: _parseNumbers,\n ...propsForValueSelector\n } = allProps;\n\n const {\n valueAsArray,\n multiValueHandler,\n bigIntValueHandler,\n valueListItemClassName,\n inputTypeCoerced,\n } = useValueEditor(allProps);\n\n if (operator === 'null' || operator === 'notNull') {\n return null;\n }\n\n const placeHolderText = fieldData?.placeholder ?? '';\n\n if (\n (operator === 'between' || operator === 'notBetween') &&\n (type === 'select' || type === 'text') &&\n // Date ranges are handled differently in AntD--see below\n inputTypeCoerced !== 'date' &&\n inputTypeCoerced !== 'datetime-local'\n ) {\n if (type === 'text') {\n const editors = ['from', 'to'].map((key, i) => {\n if (inputTypeCoerced === 'time') {\n return (\n <DatePicker.TimePicker\n key={key}\n value={valueAsArray[i] ? dayjs(valueAsArray[i], 'HH:mm:ss') : null}\n className={valueListItemClassName}\n disabled={disabled}\n placeholder={placeHolderText}\n onChange={d => multiValueHandler(d?.format('HH:mm:ss') ?? '', i)}\n {...extraProps}\n />\n );\n } else if (inputTypeCoerced === 'number') {\n return (\n <InputNumber\n key={key}\n type={inputTypeCoerced}\n value={valueAsArray[i] ?? ''}\n className={valueListItemClassName}\n disabled={disabled}\n placeholder={placeHolderText}\n onChange={v => multiValueHandler(v, i)}\n {...extraProps}\n />\n );\n }\n return (\n <Input\n key={key}\n type={inputTypeCoerced}\n value={valueAsArray[i] ?? ''}\n className={valueListItemClassName}\n disabled={disabled}\n placeholder={placeHolderText}\n onChange={e => multiValueHandler(e.target.value, i)}\n {...extraProps}\n />\n );\n });\n return (\n <span data-testid={testID} className={className} title={title}>\n {editors[0]}\n {separator}\n {editors[1]}\n </span>\n );\n }\n\n return <ValueEditor {...allProps} skipHook />;\n }\n\n switch (type) {\n case 'select':\n case 'multiselect':\n return (\n <SelectorComponent\n {...propsForValueSelector}\n className={className}\n title={title}\n value={value}\n disabled={disabled}\n listsAsArrays={listsAsArrays}\n multiple={type === 'multiselect'}\n handleOnChange={handleOnChange}\n options={values}\n {...extraProps}\n />\n );\n\n case 'textarea':\n return (\n <Input.TextArea\n value={value}\n title={title}\n className={className}\n disabled={disabled}\n placeholder={placeHolderText}\n onChange={e => handleOnChange(e.target.value)}\n {...extraProps}\n />\n );\n\n case 'switch':\n return (\n <Switch\n checked={!!value}\n title={title}\n className={className}\n disabled={disabled}\n onChange={v => handleOnChange(v)}\n {...extraProps}\n />\n );\n\n case 'checkbox':\n return (\n <span title={title} className={className}>\n <Checkbox\n type=\"checkbox\"\n disabled={disabled}\n onChange={e => handleOnChange(e.target.checked)}\n checked={!!value}\n {...extraProps}\n />\n </span>\n );\n\n case 'radio':\n return (\n <span className={className} title={title}>\n {values.map(v => (\n <Radio\n key={v.name}\n value={v.name}\n checked={value === v.name}\n disabled={disabled}\n onChange={e => handleOnChange(e.target.value)}\n {...extraProps}>\n {v.label}\n </Radio>\n ))}\n </span>\n );\n }\n\n switch (inputTypeCoerced) {\n case 'date':\n case 'datetime-local': {\n if (operator === 'between' || operator === 'notBetween') {\n // oxlint-disable-next-line typescript/no-explicit-any\n const dayjsArray = valueAsArray.slice(0, 2).map((v: any) => dayjs(v)) as [Dayjs, Dayjs];\n return (\n <DatePicker.RangePicker\n value={dayjsArray.every(d => d.isValid()) ? dayjsArray : undefined}\n showTime={inputTypeCoerced === 'datetime-local'}\n className={className}\n disabled={disabled}\n placeholder={[placeHolderText, placeHolderText]}\n // TODO: the function below is currently untested (see the\n // \"renders a date range picker\" test in ./AntD.test.tsx)\n onChange={\n /* v8 ignore start -- @preserve */\n dates => {\n const timeFormat = inputTypeCoerced === 'datetime-local' ? 'THH:mm:ss' : '';\n const format = `YYYY-MM-DD${timeFormat}`;\n const dateArray = dates?.map(d => (d?.isValid() ? d.format(format) : undefined));\n handleOnChange(\n dateArray ? (listsAsArrays ? dateArray : joinWith(dateArray, ',')) : dates\n );\n }\n /* v8 ignore stop -- @preserve */\n }\n {...extraProps}\n />\n );\n }\n\n const dateValue = dayjs(value);\n return (\n <DatePicker\n value={dateValue.isValid() ? dateValue : undefined}\n showTime={inputTypeCoerced === 'datetime-local'}\n className={className}\n disabled={disabled}\n placeholder={placeHolderText}\n onChange={(_d, dateString) => handleOnChange(dateString)}\n {...extraProps}\n />\n );\n }\n\n case 'time': {\n const dateValue = dayjs(value, 'HH:mm:ss');\n return (\n <DatePicker.TimePicker\n value={dateValue.isValid() ? dateValue : undefined}\n className={className}\n disabled={disabled}\n placeholder={placeHolderText}\n onChange={d => handleOnChange(d?.format('HH:mm:ss') ?? '')}\n {...extraProps}\n />\n );\n }\n\n case 'number': {\n return (\n <InputNumber\n type={inputTypeCoerced}\n value={value}\n title={title}\n className={className}\n disabled={disabled}\n placeholder={placeHolderText}\n onChange={handleOnChange}\n {...extraProps}\n />\n );\n }\n }\n\n if (inputType === 'bigint') {\n return (\n <Input\n data-testid={testID}\n type={inputTypeCoerced}\n placeholder={placeHolderText}\n value={`${value}`}\n title={title}\n className={className}\n disabled={disabled}\n onChange={e => bigIntValueHandler(e.target.value)}\n {...extraProps}\n />\n );\n }\n\n return (\n <Input\n type={inputTypeCoerced}\n value={value}\n title={title}\n className={className}\n disabled={disabled}\n placeholder={placeHolderText}\n onChange={e => handleOnChange(e.target.value)}\n {...extraProps}\n />\n );\n};\n","import { Select } from 'antd';\nimport type { ComponentPropsWithoutRef } from 'react';\nimport * as React from 'react';\nimport type { VersatileSelectorProps } from 'react-querybuilder';\nimport { joinWith, useValueSelector } from 'react-querybuilder';\n\n/**\n * @group Props\n */\nexport type AntDValueSelectorProps = VersatileSelectorProps &\n Omit<ComponentPropsWithoutRef<typeof Select>, 'onChange' | 'defaultValue'>;\n\n/**\n * @group Components\n */\nexport const AntDValueSelector = ({\n className,\n handleOnChange,\n options,\n value,\n title,\n disabled,\n multiple,\n listsAsArrays,\n // Props that should not be in extraProps\n testID: _testID,\n rule: _rule,\n ruleGroup: _ruleGroup,\n rules: _rules,\n level: _level,\n path: _path,\n context: _context,\n validation: _validation,\n operator: _operator,\n field: _field,\n fieldData: _fieldData,\n schema: _schema,\n ...extraProps\n}: AntDValueSelectorProps): React.JSX.Element => {\n // Alternate onChange handler that doesn't use arrays even when `multiple` is true\n const { onChange: onChangeNoArrays } = useValueSelector({\n handleOnChange,\n listsAsArrays: false,\n multiple: false,\n value,\n });\n const { onChange: onChangeNormal, val } = useValueSelector({\n handleOnChange,\n // This forces `val` to be an array if `multiple` is true,\n // even if `listsAsArrays` is false\n listsAsArrays: multiple || listsAsArrays,\n multiple,\n value,\n });\n\n const onChange = React.useCallback(\n (v: string | string[]) => {\n if (multiple && !listsAsArrays && Array.isArray(v)) {\n // `multiple: true` means `v` is probably an array, but we don't want\n // to send an array to `handleOnChange` when `listsAsArrays` is false\n onChangeNoArrays(joinWith(v));\n } else {\n onChangeNormal(v);\n }\n },\n [listsAsArrays, multiple, onChangeNoArrays, onChangeNormal]\n );\n\n return (\n <Select\n {...(multiple ? { mode: 'multiple', allowClear: true } : {})}\n title={title}\n className={className}\n popupMatchSelectWidth={false}\n disabled={disabled}\n value={val}\n onChange={onChange}\n optionFilterProp=\"label\"\n options={options}\n {...extraProps}\n />\n );\n};\n","import {\n CloseOutlined,\n CopyOutlined,\n DownOutlined,\n LockOutlined,\n RedoOutlined,\n UndoOutlined,\n UnlockOutlined,\n UpOutlined,\n} from '@ant-design/icons';\nimport * as React from 'react';\nimport type {\n ControlElementsProp,\n FullField,\n QueryBuilderContextProvider,\n Translations,\n} from 'react-querybuilder';\nimport { getCompatContextProvider } from 'react-querybuilder';\nimport { AntDActionElement } from './AntDActionElement';\nimport { AntDDragHandle } from './AntDDragHandle';\nimport { AntDNotToggle } from './AntDNotToggle';\nimport { AntDShiftActions } from './AntDShiftActions';\nimport { AntDValueEditor } from './AntDValueEditor';\nimport { AntDValueSelector } from './AntDValueSelector';\n\nexport * from './AntDActionElement';\nexport * from './AntDDragHandle';\nexport * from './AntDNotToggle';\nexport * from './AntDShiftActions';\nexport * from './AntDValueEditor';\nexport * from './AntDValueSelector';\n\n/**\n * @group Props\n */\nexport const antdControlElements: ControlElementsProp<FullField, string> = {\n actionElement: AntDActionElement,\n dragHandle: AntDDragHandle,\n notToggle: AntDNotToggle,\n shiftActions: AntDShiftActions,\n valueEditor: AntDValueEditor,\n valueSelector: AntDValueSelector,\n};\n\n/**\n * @group Props\n */\nexport const antdTranslations: Partial<Translations> = {\n removeGroup: { label: <CloseOutlined /> },\n removeRule: { label: <CloseOutlined /> },\n cloneRule: { label: <CopyOutlined /> },\n cloneRuleGroup: { label: <CopyOutlined /> },\n lockGroup: { label: <UnlockOutlined /> },\n lockRule: { label: <UnlockOutlined /> },\n lockGroupDisabled: { label: <LockOutlined /> },\n lockRuleDisabled: { label: <LockOutlined /> },\n shiftActionUp: { label: <UpOutlined /> },\n shiftActionDown: { label: <DownOutlined /> },\n undo: { label: <UndoOutlined /> },\n redo: { label: <RedoOutlined /> },\n};\n\n/**\n * @group Components\n */\nexport const QueryBuilderAntD: QueryBuilderContextProvider = getCompatContextProvider({\n controlElements: antdControlElements,\n translations: antdTranslations,\n});\n"],"mappings":"gkCAoBA,MAAa,GAAqB,CAChC,YACA,gBACA,QACA,QACA,WACA,sBAEA,OAAQ,EACR,MAAO,EACP,KAAM,EACN,QAAS,EACT,WAAY,EACZ,YAAa,EACb,OAAQ,EACR,GAAG,KAEH,EAAA,cAACA,EAAAA,OAAD,CACE,KAAK,UACM,YACX,MAAO,GAAuB,EAAW,EAAoB,MAAQ,EACrE,QAAS,GAAK,EAAc,CAAC,EAC7B,SAAU,GAAY,CAAC,EACvB,GAAI,CAEE,EADL,GAAuB,EAAW,EAAoB,MAAQ,CACzD,EC5BG,GAAA,EAETC,EAAAA,WAAAA,EAEA,CACE,YACA,QACA,uBAEA,OAAQ,EACR,MAAO,EACP,KAAM,EACN,MAAO,EACP,SAAU,EACV,QAAS,EACT,WAAY,EACZ,OAAQ,EACR,YAAa,EACb,GAAG,GAEL,IAEA,EAAA,cAACC,EAAAA,eAAD,CACa,YACJ,QACP,GAAI,EACJ,GAAI,EACJ,IAAK,CACN,CAAA,CAEL,ECjCa,GAAiB,CAC5B,YACA,iBACA,QACA,UAC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AAA,cAACC,EAAAA,eAAAA,IAAgB,CAAE,EACvC,SAAU,CAAE,MAAO,EAAA,cAACA,EAAAA,eAAAA,IAAgB,CAAE,EACtC,kBAAmB,CAAE,MAAO,EAAA,cAACC,EAAAA,aAAAA,IAAc,CAAE,EAC7C,iBAAkB,CAAE,MAAO,EAAA,cAACA,EAAAA,aAAAA,IAAc,CAAE,EAC5C,cAAe,CAAE,MAAO,EAAA,cAACC,EAAAA,WAAAA,IAAY,CAAE,EACvC,gBAAiB,CAAE,MAAO,EAAA,cAACC,EAAAA,aAAAA,IAAc,CAAE,EAC3C,KAAM,CAAE,MAAO,EAAA,cAACC,EAAAA,aAAAA,IAAc,CAAE,EAChC,KAAM,CAAE,MAAO,EAAA,cAACC,EAAAA,aAAAA,IAAc,CAAE,CAClC,EAKa,GAAA,EAAgDC,EAAAA,yBAAAA,CAAyB,CACpF,gBAAiB,EACjB,aAAc,CAChB,CAAC"}
|
|
1
|
+
{"version":3,"file":"react-querybuilder_antd.cjs.production.js","names":["Button","forwardRef","HolderOutlined","Switch","Button","customParseFormat","advancedFormat","weekday","localeData","weekOfYear","weekYear","generatePicker","dayjsGenerateConfig","useValueEditor","InputNumber","Input","ValueEditor","Switch","Checkbox","Radio","joinWith","useValueSelector","React","joinWith","Select","CloseOutlined","CopyOutlined","UngroupOutlined","UnlockOutlined","LockOutlined","UpOutlined","DownOutlined","UndoOutlined","RedoOutlined","getCompatContextProvider"],"sources":["../../src/AntDActionElement.tsx","../../src/AntDDragHandle.tsx","../../src/AntDNotToggle.tsx","../../src/AntDShiftActions.tsx","../../src/dayjs.ts","../../src/AntDValueEditor.tsx","../../src/AntDValueSelector.tsx","../../src/index.tsx"],"sourcesContent":["import { Button } from 'antd';\nimport type { ComponentPropsWithoutRef } from 'react';\nimport * as React from 'react';\nimport type { ActionProps } from 'react-querybuilder';\n\n// TODO: This may be unnecessary. Find out if there's a way to allow\n// `data-${string}` index keys without breaking other type contraints.\ntype RemoveDataIndexKeys<T> = {\n [K in keyof T as `data-${string}` extends K ? never : K]: T[K];\n};\n\n/**\n * @group Props\n */\nexport interface AntDActionProps\n extends ActionProps, RemoveDataIndexKeys<ComponentPropsWithoutRef<typeof Button>> {}\n\n/**\n * @group Components\n */\nexport const AntDActionElement = ({\n className,\n handleOnClick,\n label,\n title,\n disabled,\n disabledTranslation,\n // Props that should not be in extraProps\n testID: _testID,\n level: _level,\n path: _path,\n context: _context,\n validation: _validation,\n ruleOrGroup: _ruleOrGroup,\n schema: _schema,\n ...extraProps\n}: AntDActionProps): React.JSX.Element => (\n <Button\n type=\"primary\"\n className={className}\n title={disabledTranslation && disabled ? disabledTranslation.title : title}\n onClick={e => handleOnClick(e)}\n disabled={disabled && !disabledTranslation}\n {...extraProps}>\n {disabledTranslation && disabled ? disabledTranslation.label : label}\n </Button>\n);\n","import { HolderOutlined } from '@ant-design/icons';\nimport type { ComponentPropsWithRef } from 'react';\nimport * as React from 'react';\nimport { forwardRef } from 'react';\nimport type { DragHandleProps } from 'react-querybuilder';\n\n/**\n * @group Props\n */\n// oxlint-disable-next-line typescript/no-explicit-any\nexport type AntDDragHandleProps = DragHandleProps & { label?: any } & ComponentPropsWithRef<\n typeof HolderOutlined\n >;\n\n/**\n * @group Components\n */\nexport const AntDDragHandle: React.ForwardRefExoticComponent<\n Omit<AntDDragHandleProps, 'ref'> & React.RefAttributes<HTMLSpanElement>\n> = forwardRef<HTMLSpanElement, AntDDragHandleProps>(\n (\n {\n className,\n title,\n dragHandleAttributes,\n // Props that should not be in extraProps\n testID: _testID,\n level: _level,\n path: _path,\n label: _label,\n disabled: _disabled,\n context: _context,\n validation: _validation,\n schema: _schema,\n ruleOrGroup: _ruleOrGroup,\n ...extraProps\n },\n dragRef\n ) => (\n <HolderOutlined\n className={className}\n title={title}\n {...extraProps}\n {...dragHandleAttributes}\n ref={dragRef}\n />\n )\n);\n","import { Switch } from 'antd';\nimport type { ComponentPropsWithoutRef } from 'react';\nimport * as React from 'react';\nimport type { NotToggleProps } from 'react-querybuilder';\n\n/**\n * @group Props\n */\nexport interface AntDNotToggleProps\n extends NotToggleProps, ComponentPropsWithoutRef<typeof Switch> {}\n\n/**\n * @group Components\n */\nexport const AntDNotToggle = ({\n className,\n handleOnChange,\n label,\n checked,\n title,\n disabled,\n // Props that should not be in extraProps\n path: _path,\n context: _context,\n validation: _validation,\n testID: _testID,\n schema: _schema,\n ruleGroup: _ruleGroup,\n ...extraProps\n}: AntDNotToggleProps): React.JSX.Element => (\n <Switch\n title={title}\n className={className}\n onChange={v => handleOnChange(v)}\n checked={!!checked}\n disabled={disabled}\n checkedChildren={label}\n unCheckedChildren=\"=\"\n {...extraProps}\n />\n);\n","import { Button } from 'antd';\nimport * as React from 'react';\nimport type { ShiftActionsProps } from 'react-querybuilder';\n\n/**\n * @group Components\n */\nexport const AntDShiftActions = ({\n shiftUp,\n shiftDown,\n shiftUpDisabled,\n shiftDownDisabled,\n disabled,\n className,\n labels,\n titles,\n testID,\n}: ShiftActionsProps): React.JSX.Element => (\n <div data-testid={testID} className={className}>\n <Button\n type=\"primary\"\n size=\"small\"\n title={titles?.shiftUp}\n onClick={shiftUp}\n disabled={disabled || shiftUpDisabled}>\n {labels?.shiftUp}\n </Button>\n <Button\n type=\"primary\"\n size=\"small\"\n title={titles?.shiftDown}\n onClick={shiftDown}\n disabled={disabled || shiftDownDisabled}>\n {labels?.shiftDown}\n </Button>\n </div>\n);\n","/**\n * This file is adapted from the following sources:\n * - https://github.com/react-component/picker/blob/d526bd551778070be3295060f1b5841786cb9500/src/generate/dayjs.ts\n * - https://github.com/react-component/picker/blob/d526bd551778070be3295060f1b5841786cb9500/src/generate/index.ts\n */\n\nimport type { Dayjs } from 'dayjs';\nimport dayjs from 'dayjs';\nimport advancedFormat from 'dayjs/plugin/advancedFormat.js';\nimport customParseFormat from 'dayjs/plugin/customParseFormat.js';\nimport localeData from 'dayjs/plugin/localeData.js';\nimport weekday from 'dayjs/plugin/weekday.js';\nimport weekOfYear from 'dayjs/plugin/weekOfYear.js';\nimport weekYear from 'dayjs/plugin/weekYear.js';\n\ntype GenerateConfig<DateType> = {\n // Get\n getWeekDay: (value: DateType) => number;\n getMillisecond: (value: DateType) => number;\n getSecond: (value: DateType) => number;\n getMinute: (value: DateType) => number;\n getHour: (value: DateType) => number;\n getDate: (value: DateType) => number;\n getMonth: (value: DateType) => number;\n getYear: (value: DateType) => number;\n getNow: () => DateType;\n getFixedDate: (fixed: string) => DateType;\n getEndDate: (value: DateType) => DateType;\n\n // Set\n addYear: (value: DateType, diff: number) => DateType;\n addMonth: (value: DateType, diff: number) => DateType;\n addDate: (value: DateType, diff: number) => DateType;\n setYear: (value: DateType, year: number) => DateType;\n setMonth: (value: DateType, month: number) => DateType;\n setDate: (value: DateType, date: number) => DateType;\n setHour: (value: DateType, hour: number) => DateType;\n setMinute: (value: DateType, minute: number) => DateType;\n setSecond: (value: DateType, second: number) => DateType;\n setMillisecond: (value: DateType, millisecond: number) => DateType;\n\n // Compare\n isAfter: (date1: DateType, date2: DateType) => boolean;\n isValidate: (date: DateType) => boolean;\n\n locale: {\n getWeekFirstDay: (locale: string) => number;\n getWeekFirstDate: (locale: string, value: DateType) => DateType;\n getWeek: (locale: string, value: DateType) => number;\n\n format: (locale: string, date: DateType, format: string) => string;\n\n /** Should only return validate date instance */\n parse: (locale: string, text: string, formats: string[]) => DateType | null;\n\n /** A proxy for getting locale with moment or other locale library */\n getShortWeekDays?: (locale: string) => string[];\n /** A proxy for getting locale with moment or other locale library */\n getShortMonths?: (locale: string) => string[];\n };\n};\n\n/* v8 ignore file -- @preserve */\n\ndayjs.extend(customParseFormat);\ndayjs.extend(advancedFormat);\ndayjs.extend(weekday);\ndayjs.extend(localeData);\ndayjs.extend(weekOfYear);\ndayjs.extend(weekYear);\n\ndayjs.extend((o, c) => {\n // todo support Wo (ISO week)\n const proto = c.prototype;\n const oldFormat = proto.format;\n proto.format = function f(formatStr: string) {\n const str = (formatStr || '').replace('Wo', 'wo');\n return oldFormat.bind(this)(str);\n };\n});\n\ntype IlocaleMapObject = Record<string, string>;\nconst localeMap: IlocaleMapObject = {\n // ar_EG:\n // az_AZ:\n // bg_BG:\n bn_BD: 'bn-bd',\n by_BY: 'be',\n // ca_ES:\n // cs_CZ:\n // da_DK:\n // de_DE:\n // el_GR:\n en_GB: 'en-gb',\n en_US: 'en',\n // es_ES:\n // et_EE:\n // fa_IR:\n // fi_FI:\n fr_BE: 'fr', // todo: dayjs has no fr_BE locale, use fr at present\n fr_CA: 'fr-ca',\n // fr_FR:\n // ga_IE:\n // gl_ES:\n // he_IL:\n // hi_IN:\n // hr_HR:\n // hu_HU:\n hy_AM: 'hy-am',\n // id_ID:\n // is_IS:\n // it_IT:\n // ja_JP:\n // ka_GE:\n // kk_KZ:\n // km_KH:\n kmr_IQ: 'ku',\n // kn_IN:\n // ko_KR:\n // ku_IQ: // previous ku in antd\n // lt_LT:\n // lv_LV:\n // mk_MK:\n // ml_IN:\n // mn_MN:\n // ms_MY:\n // nb_NO:\n // ne_NP:\n nl_BE: 'nl-be',\n // nl_NL:\n // pl_PL:\n pt_BR: 'pt-br',\n // pt_PT:\n // ro_RO:\n // ru_RU:\n // sk_SK:\n // sl_SI:\n // sr_RS:\n // sv_SE:\n // ta_IN:\n // th_TH:\n // tr_TR:\n // uk_UA:\n // ur_PK:\n // vi_VN:\n zh_CN: 'zh-cn',\n zh_HK: 'zh-hk',\n zh_TW: 'zh-tw',\n};\n\nconst parseLocale = (locale: string) => {\n const mapLocale = localeMap[locale];\n return mapLocale || locale.split('_')[0];\n};\n\nconst parseNoMatchNotice = () => {\n // noteOnce(false, 'Not match any format. Please help to fire a issue about this.');\n};\n\nconst generateConfig: GenerateConfig<Dayjs> = {\n // get\n getNow: () => dayjs(),\n getFixedDate: string => dayjs(string, ['YYYY-M-DD', 'YYYY-MM-DD']),\n getEndDate: date => date.endOf('month'),\n getWeekDay: date => {\n const clone = date.locale('en');\n return clone.weekday() + clone.localeData().firstDayOfWeek();\n },\n getYear: date => date.year(),\n getMonth: date => date.month(),\n getDate: date => date.date(),\n getHour: date => date.hour(),\n getMinute: date => date.minute(),\n getSecond: date => date.second(),\n getMillisecond: date => date.millisecond(),\n\n // set\n addYear: (date, diff) => date.add(diff, 'year'),\n addMonth: (date, diff) => date.add(diff, 'month'),\n addDate: (date, diff) => date.add(diff, 'day'),\n setYear: (date, year) => date.year(year),\n setMonth: (date, month) => date.month(month),\n setDate: (date, num) => date.date(num),\n setHour: (date, hour) => date.hour(hour),\n setMinute: (date, minute) => date.minute(minute),\n setSecond: (date, second) => date.second(second),\n setMillisecond: (date, milliseconds) => date.millisecond(milliseconds),\n\n // Compare\n isAfter: (date1, date2) => date1.isAfter(date2),\n isValidate: date => date.isValid(),\n\n locale: {\n getWeekFirstDay: locale => dayjs().locale(parseLocale(locale)).localeData().firstDayOfWeek(),\n getWeekFirstDate: (locale, date) => date.locale(parseLocale(locale)).weekday(0),\n getWeek: (locale, date) => date.locale(parseLocale(locale)).week(),\n getShortWeekDays: locale => dayjs().locale(parseLocale(locale)).localeData().weekdaysMin(),\n getShortMonths: locale => dayjs().locale(parseLocale(locale)).localeData().monthsShort(),\n format: (locale, date, format) => date.locale(parseLocale(locale)).format(format),\n parse: (locale, text, formats) => {\n const localeStr = parseLocale(locale);\n for (const format of formats) {\n const formatText = text;\n if (format.includes('wo') || format.includes('Wo')) {\n // parse Wo\n const year = formatText.split('-')[0];\n const weekStr = formatText.split('-')[1];\n const firstWeek = dayjs(year, 'YYYY').startOf('year').locale(localeStr);\n for (let j = 0; j <= 52; j += 1) {\n const nextWeek = firstWeek.add(j, 'week');\n if (nextWeek.format('Wo') === weekStr) {\n return nextWeek;\n }\n }\n parseNoMatchNotice();\n return null;\n }\n const date = dayjs(formatText, format, true).locale(localeStr);\n if (date.isValid()) {\n return date;\n }\n }\n\n if (text) {\n parseNoMatchNotice();\n }\n return null;\n },\n },\n};\n\nexport default generateConfig;\n","import { Checkbox, Input, InputNumber, Radio, Switch } from 'antd';\nimport generatePicker from 'antd/es/date-picker/generatePicker/index.js';\nimport type { Dayjs } from 'dayjs';\nimport dayjs from 'dayjs';\nimport * as React from 'react';\nimport type { ValueEditorProps } from 'react-querybuilder';\nimport { joinWith, useValueEditor, ValueEditor } from 'react-querybuilder';\nimport dayjsGenerateConfig from './dayjs';\n\n/**\n * @group Props\n */\nexport interface AntDValueEditorProps extends ValueEditorProps {\n extraProps?: Record<string, unknown>;\n}\n\nconst DatePicker = generatePicker(dayjsGenerateConfig);\n\n/**\n * @group Components\n */\nexport const AntDValueEditor = (allProps: AntDValueEditorProps): React.JSX.Element | null => {\n const {\n fieldData,\n operator,\n value,\n handleOnChange,\n title,\n className,\n type,\n inputType,\n values = [],\n listsAsArrays,\n separator,\n valueSource: _vs,\n disabled,\n testID,\n selectorComponent: SelectorComponent = allProps.schema.controls.valueSelector,\n extraProps,\n parseNumbers: _parseNumbers,\n ...propsForValueSelector\n } = allProps;\n\n const {\n valueAsArray,\n multiValueHandler,\n bigIntValueHandler,\n valueListItemClassName,\n inputTypeCoerced,\n } = useValueEditor(allProps);\n\n if (operator === 'null' || operator === 'notNull') {\n return null;\n }\n\n const placeHolderText = fieldData?.placeholder ?? '';\n\n if (\n (operator === 'between' || operator === 'notBetween') &&\n (type === 'select' || type === 'text') &&\n // Date ranges are handled differently in AntD--see below\n inputTypeCoerced !== 'date' &&\n inputTypeCoerced !== 'datetime-local'\n ) {\n if (type === 'text') {\n const editors = ['from', 'to'].map((key, i) => {\n if (inputTypeCoerced === 'time') {\n return (\n <DatePicker.TimePicker\n key={key}\n value={valueAsArray[i] ? dayjs(valueAsArray[i], 'HH:mm:ss') : null}\n className={valueListItemClassName}\n disabled={disabled}\n placeholder={placeHolderText}\n onChange={d => multiValueHandler(d?.format('HH:mm:ss') ?? '', i)}\n {...extraProps}\n />\n );\n } else if (inputTypeCoerced === 'number') {\n return (\n <InputNumber\n key={key}\n type={inputTypeCoerced}\n value={valueAsArray[i] ?? ''}\n className={valueListItemClassName}\n disabled={disabled}\n placeholder={placeHolderText}\n onChange={v => multiValueHandler(v, i)}\n {...extraProps}\n />\n );\n }\n return (\n <Input\n key={key}\n type={inputTypeCoerced}\n value={valueAsArray[i] ?? ''}\n className={valueListItemClassName}\n disabled={disabled}\n placeholder={placeHolderText}\n onChange={e => multiValueHandler(e.target.value, i)}\n {...extraProps}\n />\n );\n });\n return (\n <span data-testid={testID} className={className} title={title}>\n {editors[0]}\n {separator}\n {editors[1]}\n </span>\n );\n }\n\n return <ValueEditor {...allProps} skipHook />;\n }\n\n switch (type) {\n case 'select':\n case 'multiselect':\n return (\n <SelectorComponent\n {...propsForValueSelector}\n className={className}\n title={title}\n value={value}\n disabled={disabled}\n listsAsArrays={listsAsArrays}\n multiple={type === 'multiselect'}\n handleOnChange={handleOnChange}\n options={values}\n {...extraProps}\n />\n );\n\n case 'textarea':\n return (\n <Input.TextArea\n value={value}\n title={title}\n className={className}\n disabled={disabled}\n placeholder={placeHolderText}\n onChange={e => handleOnChange(e.target.value)}\n {...extraProps}\n />\n );\n\n case 'switch':\n return (\n <Switch\n checked={!!value}\n title={title}\n className={className}\n disabled={disabled}\n onChange={v => handleOnChange(v)}\n {...extraProps}\n />\n );\n\n case 'checkbox':\n return (\n <span title={title} className={className}>\n <Checkbox\n type=\"checkbox\"\n disabled={disabled}\n onChange={e => handleOnChange(e.target.checked)}\n checked={!!value}\n {...extraProps}\n />\n </span>\n );\n\n case 'radio':\n return (\n <span className={className} title={title}>\n {values.map(v => (\n <Radio\n key={v.name}\n value={v.name}\n checked={value === v.name}\n disabled={disabled}\n onChange={e => handleOnChange(e.target.value)}\n {...extraProps}>\n {v.label}\n </Radio>\n ))}\n </span>\n );\n }\n\n switch (inputTypeCoerced) {\n case 'date':\n case 'datetime-local': {\n if (operator === 'between' || operator === 'notBetween') {\n // oxlint-disable-next-line typescript/no-explicit-any\n const dayjsArray = valueAsArray.slice(0, 2).map((v: any) => dayjs(v)) as [Dayjs, Dayjs];\n return (\n <DatePicker.RangePicker\n value={dayjsArray.every(d => d.isValid()) ? dayjsArray : undefined}\n showTime={inputTypeCoerced === 'datetime-local'}\n className={className}\n disabled={disabled}\n placeholder={[placeHolderText, placeHolderText]}\n // TODO: the function below is currently untested (see the\n // \"renders a date range picker\" test in ./AntD.test.tsx)\n onChange={\n /* v8 ignore start -- @preserve */\n dates => {\n const timeFormat = inputTypeCoerced === 'datetime-local' ? 'THH:mm:ss' : '';\n const format = `YYYY-MM-DD${timeFormat}`;\n const dateArray = dates?.map(d => (d?.isValid() ? d.format(format) : undefined));\n handleOnChange(\n dateArray ? (listsAsArrays ? dateArray : joinWith(dateArray, ',')) : dates\n );\n }\n /* v8 ignore stop -- @preserve */\n }\n {...extraProps}\n />\n );\n }\n\n const dateValue = dayjs(value);\n return (\n <DatePicker\n value={dateValue.isValid() ? dateValue : undefined}\n showTime={inputTypeCoerced === 'datetime-local'}\n className={className}\n disabled={disabled}\n placeholder={placeHolderText}\n onChange={(_d, dateString) => handleOnChange(dateString)}\n {...extraProps}\n />\n );\n }\n\n case 'time': {\n const dateValue = dayjs(value, 'HH:mm:ss');\n return (\n <DatePicker.TimePicker\n value={dateValue.isValid() ? dateValue : undefined}\n className={className}\n disabled={disabled}\n placeholder={placeHolderText}\n onChange={d => handleOnChange(d?.format('HH:mm:ss') ?? '')}\n {...extraProps}\n />\n );\n }\n\n case 'number': {\n return (\n <InputNumber\n type={inputTypeCoerced}\n value={value}\n title={title}\n className={className}\n disabled={disabled}\n placeholder={placeHolderText}\n onChange={handleOnChange}\n {...extraProps}\n />\n );\n }\n }\n\n if (inputType === 'bigint') {\n return (\n <Input\n data-testid={testID}\n type={inputTypeCoerced}\n placeholder={placeHolderText}\n value={`${value}`}\n title={title}\n className={className}\n disabled={disabled}\n onChange={e => bigIntValueHandler(e.target.value)}\n {...extraProps}\n />\n );\n }\n\n return (\n <Input\n type={inputTypeCoerced}\n value={value}\n title={title}\n className={className}\n disabled={disabled}\n placeholder={placeHolderText}\n onChange={e => handleOnChange(e.target.value)}\n {...extraProps}\n />\n );\n};\n","import { Select } from 'antd';\nimport type { ComponentPropsWithoutRef } from 'react';\nimport * as React from 'react';\nimport type { VersatileSelectorProps } from 'react-querybuilder';\nimport { joinWith, useValueSelector } from 'react-querybuilder';\n\n/**\n * @group Props\n */\nexport type AntDValueSelectorProps = VersatileSelectorProps &\n Omit<ComponentPropsWithoutRef<typeof Select>, 'onChange' | 'defaultValue'>;\n\n/**\n * @group Components\n */\nexport const AntDValueSelector = ({\n className,\n handleOnChange,\n options,\n value,\n title,\n disabled,\n multiple,\n listsAsArrays,\n // Props that should not be in extraProps\n testID: _testID,\n rule: _rule,\n ruleGroup: _ruleGroup,\n rules: _rules,\n level: _level,\n path: _path,\n context: _context,\n validation: _validation,\n operator: _operator,\n field: _field,\n fieldData: _fieldData,\n schema: _schema,\n ...extraProps\n}: AntDValueSelectorProps): React.JSX.Element => {\n // Alternate onChange handler that doesn't use arrays even when `multiple` is true\n const { onChange: onChangeNoArrays } = useValueSelector({\n handleOnChange,\n listsAsArrays: false,\n multiple: false,\n value,\n });\n const { onChange: onChangeNormal, val } = useValueSelector({\n handleOnChange,\n // This forces `val` to be an array if `multiple` is true,\n // even if `listsAsArrays` is false\n listsAsArrays: multiple || listsAsArrays,\n multiple,\n value,\n });\n\n const onChange = React.useCallback(\n (v: string | string[]) => {\n if (multiple && !listsAsArrays && Array.isArray(v)) {\n // `multiple: true` means `v` is probably an array, but we don't want\n // to send an array to `handleOnChange` when `listsAsArrays` is false\n onChangeNoArrays(joinWith(v));\n } else {\n onChangeNormal(v);\n }\n },\n [listsAsArrays, multiple, onChangeNoArrays, onChangeNormal]\n );\n\n return (\n <Select\n {...(multiple ? { mode: 'multiple', allowClear: true } : {})}\n title={title}\n className={className}\n popupMatchSelectWidth={false}\n disabled={disabled}\n value={val}\n onChange={onChange}\n optionFilterProp=\"label\"\n options={options}\n {...extraProps}\n />\n );\n};\n","import {\n CloseOutlined,\n CopyOutlined,\n DownOutlined,\n LockOutlined,\n RedoOutlined,\n UndoOutlined,\n UngroupOutlined,\n UnlockOutlined,\n UpOutlined,\n} from '@ant-design/icons';\nimport * as React from 'react';\nimport type {\n ControlElementsProp,\n FullField,\n QueryBuilderContextProvider,\n Translations,\n} from 'react-querybuilder';\nimport { getCompatContextProvider } from 'react-querybuilder';\nimport { AntDActionElement } from './AntDActionElement';\nimport { AntDDragHandle } from './AntDDragHandle';\nimport { AntDNotToggle } from './AntDNotToggle';\nimport { AntDShiftActions } from './AntDShiftActions';\nimport { AntDValueEditor } from './AntDValueEditor';\nimport { AntDValueSelector } from './AntDValueSelector';\n\nexport * from './AntDActionElement';\nexport * from './AntDDragHandle';\nexport * from './AntDNotToggle';\nexport * from './AntDShiftActions';\nexport * from './AntDValueEditor';\nexport * from './AntDValueSelector';\n\n/**\n * @group Props\n */\nexport const antdControlElements: ControlElementsProp<FullField, string> = {\n actionElement: AntDActionElement,\n dragHandle: AntDDragHandle,\n notToggle: AntDNotToggle,\n shiftActions: AntDShiftActions,\n valueEditor: AntDValueEditor,\n valueSelector: AntDValueSelector,\n};\n\n/**\n * @group Props\n */\nexport const antdTranslations: Partial<Translations> = {\n removeGroup: { label: <CloseOutlined /> },\n removeRule: { label: <CloseOutlined /> },\n cloneRule: { label: <CopyOutlined /> },\n cloneRuleGroup: { label: <CopyOutlined /> },\n ungroupRuleGroup: { label: <UngroupOutlined /> },\n lockGroup: { label: <UnlockOutlined /> },\n lockRule: { label: <UnlockOutlined /> },\n lockGroupDisabled: { label: <LockOutlined /> },\n lockRuleDisabled: { label: <LockOutlined /> },\n shiftActionUp: { label: <UpOutlined /> },\n shiftActionDown: { label: <DownOutlined /> },\n undo: { label: <UndoOutlined /> },\n redo: { label: <RedoOutlined /> },\n};\n\n/**\n * @group Components\n */\nexport const QueryBuilderAntD: QueryBuilderContextProvider = getCompatContextProvider({\n controlElements: antdControlElements,\n translations: antdTranslations,\n});\n"],"mappings":"gkCAoBA,MAAa,GAAqB,CAChC,YACA,gBACA,QACA,QACA,WACA,sB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