ods-ant 0.4.1 → 0.5.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-lib/{AutoComplete-gOMQxLvY.cjs → AutoComplete-C9LcpBRs.cjs} +3 -3
- package/dist-lib/{AutoComplete-gOMQxLvY.cjs.map → AutoComplete-C9LcpBRs.cjs.map} +1 -1
- package/dist-lib/{AutoComplete-cpf8hCnK.js → AutoComplete-CCYcFqfs.js} +2 -2
- package/dist-lib/{AutoComplete-cpf8hCnK.js.map → AutoComplete-CCYcFqfs.js.map} +1 -1
- package/dist-lib/{DatePicker-DTVtamsX.cjs → DatePicker-CQgt-WoB.cjs} +2 -2
- package/dist-lib/{DatePicker-DTVtamsX.cjs.map → DatePicker-CQgt-WoB.cjs.map} +1 -1
- package/dist-lib/{DatePicker-BpjYibJF.js → DatePicker-LXjOxVN5.js} +87 -33
- package/dist-lib/{DatePicker-BpjYibJF.js.map → DatePicker-LXjOxVN5.js.map} +1 -1
- package/dist-lib/display/Table.cjs +1 -1
- package/dist-lib/display/Table.cjs.map +1 -1
- package/dist-lib/display/Table.js +1 -1
- package/dist-lib/display/Table.js.map +1 -1
- package/dist-lib/forms/AccessibleDatePicker.cjs +1 -1
- package/dist-lib/forms/AccessibleDatePicker.js +1 -1
- package/dist-lib/forms/AutoComplete.cjs +1 -1
- package/dist-lib/forms/AutoComplete.js +1 -1
- package/dist-lib/forms/Button.cjs +2 -2
- package/dist-lib/forms/Button.cjs.map +1 -1
- package/dist-lib/forms/Button.js +24 -48
- package/dist-lib/forms/Button.js.map +1 -1
- package/dist-lib/forms/Cascader.cjs +2 -2
- package/dist-lib/forms/Cascader.js +3 -3
- package/dist-lib/forms/ClearableAutoComplete.cjs +1 -1
- package/dist-lib/forms/ClearableAutoComplete.js +1 -1
- package/dist-lib/forms/ClearableDatePicker.cjs +1 -1
- package/dist-lib/forms/ClearableDatePicker.cjs.map +1 -1
- package/dist-lib/forms/ClearableDatePicker.js +6 -5
- package/dist-lib/forms/ClearableDatePicker.js.map +1 -1
- package/dist-lib/forms/ClearableTransfer.cjs +1 -1
- package/dist-lib/forms/ClearableTransfer.cjs.map +1 -1
- package/dist-lib/forms/ClearableTransfer.js +5 -0
- package/dist-lib/forms/ClearableTransfer.js.map +1 -1
- package/dist-lib/forms/DatePicker.cjs +1 -1
- package/dist-lib/forms/DatePicker.js +1 -1
- package/dist-lib/forms/Select.cjs +1 -1
- package/dist-lib/forms/Select.cjs.map +1 -1
- package/dist-lib/forms/Select.js +45 -43
- package/dist-lib/forms/Select.js.map +1 -1
- package/dist-lib/forms/TreeSelect.cjs +60 -1
- package/dist-lib/forms/TreeSelect.cjs.map +1 -1
- package/dist-lib/forms/TreeSelect.js +148 -36
- package/dist-lib/forms/TreeSelect.js.map +1 -1
- package/dist-lib/forms/index.cjs +1 -1
- package/dist-lib/forms/index.js +2 -2
- package/dist-lib/index.cjs +1 -1
- package/dist-lib/index.js +2 -2
- package/dist-lib/{selectStyles-C8j5Vvgp.js → selectStyles-7f37TvzD.js} +182 -151
- package/dist-lib/selectStyles-7f37TvzD.js.map +1 -0
- package/dist-lib/{selectStyles-BFeXUMpO.cjs → selectStyles-KK5-1q0t.cjs} +180 -149
- package/dist-lib/selectStyles-KK5-1q0t.cjs.map +1 -0
- package/dist-lib/types/ds/accessibility.smoke.test.d.ts +2 -0
- package/dist-lib/types/ds/accessibility.smoke.test.d.ts.map +1 -0
- package/dist-lib/types/ds/forms/Button.d.ts +2 -3
- package/dist-lib/types/ds/forms/Button.d.ts.map +1 -1
- package/dist-lib/types/ds/forms/ClearableDatePicker.d.ts +8 -4
- package/dist-lib/types/ds/forms/ClearableDatePicker.d.ts.map +1 -1
- package/dist-lib/types/ds/forms/ClearableTransfer.d.ts.map +1 -1
- package/dist-lib/types/ds/forms/DatePicker.d.ts +6 -1
- package/dist-lib/types/ds/forms/DatePicker.d.ts.map +1 -1
- package/dist-lib/types/ds/forms/Select.d.ts +4 -1
- package/dist-lib/types/ds/forms/Select.d.ts.map +1 -1
- package/dist-lib/types/ds/forms/TreeSelect.d.ts +1 -1
- package/dist-lib/types/ds/forms/TreeSelect.d.ts.map +1 -1
- package/dist-lib/types/ds/forms/selectStyles.d.ts +1 -0
- package/dist-lib/types/ds/forms/selectStyles.d.ts.map +1 -1
- package/package.json +10 -2
- package/dist-lib/selectStyles-BFeXUMpO.cjs.map +0 -1
- package/dist-lib/selectStyles-C8j5Vvgp.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Select.js","names":[],"sources":["../../src/ds/forms/Select.tsx"],"sourcesContent":["import { Select as AntSelect } from 'antd';\nimport type { SelectProps } from 'antd';\nimport { useEffect, useId, useState } from 'react';\nimport { Icon } from '../../utils/icons';\nimport { dsSemanticTokens } from '../../theme/ontadaTheme';\nimport { FieldShell } from './FieldShell';\nimport type { DSFieldShellProps } from './fieldProps';\nimport { joinDescribedByIds } from './fieldProps';\nimport {\n DS_SELECT_CLASS,\n DS_SELECT_FORCE_FOCUS_CLASS,\n DS_SELECT_FORCE_HOVER_CLASS,\n DS_SELECT_READONLY_CLASS,\n DS_SELECT_DROPDOWN_CLASS,\n DS_SELECT_DROPDOWN_MULTI_CLASS,\n ensureSelectStyles,\n mergeClassNames,\n} from './selectStyles';\n\nexport type DSSelectInteractionState = 'rest' | 'hover' | 'focus';\n\nexport type DSSelectProps = SelectProps & {\n readOnly?: boolean;\n interactionState?: DSSelectInteractionState;\n};\n\nexport type SelectFieldProps = DSFieldShellProps & {\n onValueChange?: (nextValue: SelectProps['value']) => void;\n clearToValue?: SelectProps['value'];\n};\n\nexport const Select = ({\n className: providedClassName,\n popupClassName: providedPopupClassName,\n classNames: providedClassNames,\n suffixIcon,\n readOnly = false,\n interactionState = 'rest',\n open,\n onOpenChange,\n onDropdownVisibleChange,\n fieldLabel,\n fieldRequired,\n fieldDescription,\n fieldError,\n fieldActions,\n containerStyle,\n clear,\n clearable = false,\n clearLabel,\n clearVisibility = 'always',\n onClear,\n onValueChange,\n clearToValue,\n ...props\n}: DSSelectProps & SelectFieldProps) => {\n const generatedId = useId();\n const [isOpen, setIsOpen] = useState<boolean>(Boolean(open));\n\n useEffect(() => {\n ensureSelectStyles();\n }, []);\n\n useEffect(() => {\n if (typeof open === 'boolean') {\n setIsOpen(open);\n }\n }, [open]);\n\n const isMultiMode = props.mode === 'multiple' || props.mode === 'tags';\n const mergedSelectClassName = mergeClassNames(\n DS_SELECT_CLASS,\n interactionState === 'hover' ? DS_SELECT_FORCE_HOVER_CLASS : undefined,\n interactionState === 'focus' ? DS_SELECT_FORCE_FOCUS_CLASS : undefined,\n readOnly ? DS_SELECT_READONLY_CLASS : undefined,\n providedClassName,\n );\n const mergedPopupRootClass = mergeClassNames(\n DS_SELECT_DROPDOWN_CLASS,\n isMultiMode ? DS_SELECT_DROPDOWN_MULTI_CLASS : undefined,\n (providedClassNames as any)?.popup?.root,\n providedPopupClassName,\n );\n const resolvedOpen = readOnly ? false : open;\n const shouldWrapInFieldShell = Boolean(\n fieldLabel ||\n fieldRequired ||\n fieldDescription ||\n fieldError ||\n fieldActions ||\n clearable ||\n clear ||\n onClear,\n );\n const controlId = props.id ?? (shouldWrapInFieldShell ? generatedId : undefined);\n const descriptionId = controlId ? `${controlId}-description` : undefined;\n const errorId = controlId ? `${controlId}-error` : undefined;\n const clearValue = clearToValue === undefined ? undefined : clearToValue;\n const clearAction = clear?.onClear ?? onClear;\n\n const mergedClassNames = {\n ...(providedClassNames ?? {}),\n popup: {\n ...((providedClassNames as any)?.popup ?? {}),\n root: mergedPopupRootClass,\n },\n } as SelectProps['classNames'];\n\n const resolvedSuffixIcon = suffixIcon ?? (\n <Icon\n name={isOpen ? 'arrowButtonUp' : 'arrowButtonDown'}\n size={10}\n style={{ color: dsSemanticTokens.input.text.focus }}\n />\n );\n\n const handleChange = (nextValue: SelectProps['value'], option: Parameters<NonNullable<SelectProps['onChange']>>[1]) => {\n props.onChange?.(nextValue, option);\n onValueChange?.(nextValue);\n };\n\n const handleClear = () => {\n clearAction?.();\n onValueChange?.(clearValue);\n props.onChange?.(clearValue, undefined as never);\n };\n\n const describedBy = joinDescribedByIds(\n fieldDescription ? descriptionId : undefined,\n fieldError ? errorId : undefined,\n );\n\n const control = (\n <AntSelect\n {...props}\n id={controlId}\n open={resolvedOpen}\n suffixIcon={resolvedSuffixIcon}\n className={mergedSelectClassName}\n classNames={mergedClassNames}\n aria-describedby={describedBy}\n aria-invalid={fieldError ? true : undefined}\n onOpenChange={(nextOpen) => {\n if (readOnly && nextOpen) {\n setIsOpen(false);\n return;\n }\n setIsOpen(nextOpen);\n onOpenChange?.(nextOpen);\n onDropdownVisibleChange?.(nextOpen);\n }}\n onChange={handleChange}\n />\n );\n\n if (!shouldWrapInFieldShell) {\n return control;\n }\n\n return (\n <FieldShell\n label={fieldLabel}\n required={fieldRequired}\n htmlFor={controlId}\n description={fieldDescription}\n descriptionId={descriptionId}\n error={fieldError}\n errorId={errorId}\n clear={clear}\n clearable={clearable}\n clearLabel={clearLabel}\n clearVisibility={clearVisibility}\n clearValue={props.value}\n onClear={handleClear}\n extraActions={fieldActions}\n style={containerStyle}\n >\n {control}\n </FieldShell>\n );\n};\n\nSelect.displayName = 'Select';\n"],"mappings":";;;;;;;;;
|
|
1
|
+
{"version":3,"file":"Select.js","names":[],"sources":["../../src/ds/forms/Select.tsx"],"sourcesContent":["import { Select as AntSelect } from 'antd';\nimport type { SelectProps } from 'antd';\nimport { useEffect, useId, useState } from 'react';\nimport { Icon } from '../../utils/icons';\nimport { dsSemanticTokens } from '../../theme/ontadaTheme';\nimport { FieldShell } from './FieldShell';\nimport type { DSFieldShellProps } from './fieldProps';\nimport { joinDescribedByIds } from './fieldProps';\nimport {\n DS_SELECT_CLASS,\n DS_SELECT_COUNT_DISPLAY_CLASS,\n DS_SELECT_FORCE_FOCUS_CLASS,\n DS_SELECT_FORCE_HOVER_CLASS,\n DS_SELECT_READONLY_CLASS,\n DS_SELECT_DROPDOWN_CLASS,\n DS_SELECT_DROPDOWN_MULTI_CLASS,\n ensureSelectStyles,\n mergeClassNames,\n} from './selectStyles';\n\nexport type DSSelectInteractionState = 'rest' | 'hover' | 'focus';\nexport type DSSelectSelectionDisplay = 'pills' | 'count';\n\nexport type DSSelectProps = SelectProps & {\n readOnly?: boolean;\n interactionState?: DSSelectInteractionState;\n /** Controls how selected values render in multiple/tags mode. */\n dsSelectionDisplay?: DSSelectSelectionDisplay;\n};\n\nexport type SelectFieldProps = DSFieldShellProps & {\n onValueChange?: (nextValue: SelectProps['value']) => void;\n clearToValue?: SelectProps['value'];\n};\n\nexport const Select = ({\n className: providedClassName,\n popupClassName: providedPopupClassName,\n classNames: providedClassNames,\n suffixIcon,\n readOnly = false,\n interactionState = 'rest',\n dsSelectionDisplay = 'pills',\n open,\n onOpenChange,\n onDropdownVisibleChange,\n maxTagCount: providedMaxTagCount,\n maxTagPlaceholder: providedMaxTagPlaceholder,\n fieldLabel,\n fieldRequired,\n fieldDescription,\n fieldError,\n fieldActions,\n containerStyle,\n clear,\n clearable = false,\n clearLabel,\n clearVisibility = 'always',\n onClear,\n onValueChange,\n clearToValue,\n ...props\n}: DSSelectProps & SelectFieldProps) => {\n const generatedId = useId();\n const [isOpen, setIsOpen] = useState<boolean>(Boolean(open));\n\n useEffect(() => {\n ensureSelectStyles();\n }, []);\n\n useEffect(() => {\n if (typeof open === 'boolean') {\n setIsOpen(open);\n }\n }, [open]);\n\n const isMultiMode = props.mode === 'multiple' || props.mode === 'tags';\n const mergedSelectClassName = mergeClassNames(\n DS_SELECT_CLASS,\n isMultiMode && dsSelectionDisplay === 'count' ? DS_SELECT_COUNT_DISPLAY_CLASS : undefined,\n interactionState === 'hover' ? DS_SELECT_FORCE_HOVER_CLASS : undefined,\n interactionState === 'focus' ? DS_SELECT_FORCE_FOCUS_CLASS : undefined,\n readOnly ? DS_SELECT_READONLY_CLASS : undefined,\n providedClassName,\n );\n const mergedPopupRootClass = mergeClassNames(\n DS_SELECT_DROPDOWN_CLASS,\n isMultiMode ? DS_SELECT_DROPDOWN_MULTI_CLASS : undefined,\n (providedClassNames as any)?.popup?.root,\n providedPopupClassName,\n );\n const resolvedOpen = readOnly ? false : open;\n const shouldWrapInFieldShell = Boolean(\n fieldLabel ||\n fieldRequired ||\n fieldDescription ||\n fieldError ||\n fieldActions ||\n clearable ||\n clear ||\n onClear,\n );\n const controlId = props.id ?? (shouldWrapInFieldShell ? generatedId : undefined);\n const descriptionId = controlId ? `${controlId}-description` : undefined;\n const errorId = controlId ? `${controlId}-error` : undefined;\n const clearValue = clearToValue === undefined ? undefined : clearToValue;\n const clearAction = clear?.onClear ?? onClear;\n\n const mergedClassNames = {\n ...(providedClassNames ?? {}),\n popup: {\n ...((providedClassNames as any)?.popup ?? {}),\n root: mergedPopupRootClass,\n },\n } as SelectProps['classNames'];\n\n const resolvedSuffixIcon = suffixIcon ?? (\n <Icon\n name={isOpen ? 'arrowButtonUp' : 'arrowButtonDown'}\n size={10}\n style={{ color: dsSemanticTokens.input.text.focus }}\n />\n );\n\n const handleChange = (nextValue: SelectProps['value'], option: Parameters<NonNullable<SelectProps['onChange']>>[1]) => {\n props.onChange?.(nextValue, option);\n onValueChange?.(nextValue);\n };\n\n const handleClear = () => {\n clearAction?.();\n onValueChange?.(clearValue);\n props.onChange?.(clearValue, undefined as never);\n };\n\n const describedBy = joinDescribedByIds(\n fieldDescription ? descriptionId : undefined,\n fieldError ? errorId : undefined,\n );\n\n const resolvedMaxTagCount =\n isMultiMode && dsSelectionDisplay === 'count' ? 0 : providedMaxTagCount;\n const resolvedMaxTagPlaceholder: SelectProps['maxTagPlaceholder'] =\n isMultiMode && dsSelectionDisplay === 'count'\n ? (omittedValues) => `${omittedValues.length} selected`\n : providedMaxTagPlaceholder;\n\n const control = (\n <AntSelect\n {...props}\n id={controlId}\n open={resolvedOpen}\n suffixIcon={resolvedSuffixIcon}\n className={mergedSelectClassName}\n classNames={mergedClassNames}\n maxTagCount={resolvedMaxTagCount}\n maxTagPlaceholder={resolvedMaxTagPlaceholder}\n aria-describedby={describedBy}\n aria-invalid={fieldError ? true : undefined}\n onOpenChange={(nextOpen) => {\n if (readOnly && nextOpen) {\n setIsOpen(false);\n return;\n }\n setIsOpen(nextOpen);\n onOpenChange?.(nextOpen);\n onDropdownVisibleChange?.(nextOpen);\n }}\n onChange={handleChange}\n />\n );\n\n if (!shouldWrapInFieldShell) {\n return control;\n }\n\n return (\n <FieldShell\n label={fieldLabel}\n required={fieldRequired}\n htmlFor={controlId}\n description={fieldDescription}\n descriptionId={descriptionId}\n error={fieldError}\n errorId={errorId}\n clear={clear}\n clearable={clearable}\n clearLabel={clearLabel}\n clearVisibility={clearVisibility}\n clearValue={props.value}\n onClear={handleClear}\n extraActions={fieldActions}\n style={containerStyle}\n >\n {control}\n </FieldShell>\n );\n};\n\nSelect.displayName = 'Select';\n"],"mappings":";;;;;;;;;AAmCA,IAAa,KAAU,EACrB,WAAW,GACX,gBAAgB,IAChB,YAAY,GACZ,eACA,cAAW,IACX,sBAAmB,QACnB,wBAAqB,SACrB,SACA,iBACA,4BACA,aAAa,GACb,mBAAmB,IACnB,eACA,kBACA,qBACA,eACA,iBACA,mBACA,UACA,eAAY,IACZ,eACA,qBAAkB,UAClB,YACA,kBACA,iBACA,GAAG,QACmC;CACtC,IAAM,IAAc,GAAO,EACrB,CAAC,GAAQ,KAAa,EAAkB,EAAQ,EAAM;AAM5D,CAJA,QAAgB;AACd,KAAoB;IACnB,EAAE,CAAC,EAEN,QAAgB;AACd,EAAI,OAAO,KAAS,aAClB,EAAU,EAAK;IAEhB,CAAC,EAAK,CAAC;CAEV,IAAM,IAAc,EAAM,SAAS,cAAc,EAAM,SAAS,QAC1D,IAAwB,EAC5B,GACA,KAAe,MAAuB,UAAU,KAAgC,KAAA,GAChF,MAAqB,UAAU,IAA8B,KAAA,GAC7D,MAAqB,UAAU,KAA8B,KAAA,GAC7D,IAAW,IAA2B,KAAA,GACtC,EACD,EACK,IAAuB,EAC3B,GACA,IAAc,IAAiC,KAAA,GAC9C,GAA4B,OAAO,MACpC,GACD,EACK,IAAe,IAAW,KAAQ,GAClC,IAAyB,GAC7B,KACE,KACA,KACA,KACA,KACA,KACA,KACA,IAEE,IAAY,EAAM,OAAO,IAAyB,IAAc,KAAA,IAChE,IAAgB,IAAY,GAAG,EAAU,gBAAgB,KAAA,GACzD,IAAU,IAAY,GAAG,EAAU,UAAU,KAAA,GAC7C,IAAa,MAAiB,KAAA,IAAY,KAAA,IAAY,GACtD,KAAc,GAAO,WAAW,GAEhC,IAAmB;EACvB,GAAI,KAAsB,EAAE;EAC5B,OAAO;GACL,GAAK,GAA4B,SAAS,EAAE;GAC5C,MAAM;GACP;EACF,EAEK,KAAqB,KACzB,kBAAC,GAAD;EACE,MAAM,IAAS,kBAAkB;EACjC,MAAM;EACN,OAAO,EAAE,OAAO,EAAiB,MAAM,KAAK,OAAO;EACnD,CAAA,EAGE,MAAgB,GAAiC,MAAgE;AAErH,EADA,EAAM,WAAW,GAAW,EAAO,EACnC,IAAgB,EAAU;IAGtB,WAAoB;AAGxB,EAFA,MAAe,EACf,IAAgB,EAAW,EAC3B,EAAM,WAAW,GAAY,KAAA,EAAmB;IAG5C,KAAc,EAClB,IAAmB,IAAgB,KAAA,GACnC,IAAa,IAAU,KAAA,EACxB,EAEK,KACJ,KAAe,MAAuB,UAAU,IAAI,GAChD,KACJ,KAAe,MAAuB,WACjC,MAAkB,GAAG,EAAc,OAAO,aAC3C,IAEA,IACJ,kBAAC,GAAD;EACE,GAAI;EACJ,IAAI;EACJ,MAAM;EACN,YAAY;EACZ,WAAW;EACX,YAAY;EACZ,aAAa;EACb,mBAAmB;EACnB,oBAAkB;EAClB,gBAAc,IAAa,KAAO,KAAA;EAClC,eAAe,MAAa;AAC1B,OAAI,KAAY,GAAU;AACxB,MAAU,GAAM;AAChB;;AAIF,GAFA,EAAU,EAAS,EACnB,IAAe,EAAS,EACxB,IAA0B,EAAS;;EAErC,UAAU;EACV,CAAA;AAOJ,QAJK,IAKH,kBAAC,GAAD;EACE,OAAO;EACP,UAAU;EACV,SAAS;EACT,aAAa;EACE;EACf,OAAO;EACE;EACF;EACI;EACC;EACK;EACjB,YAAY,EAAM;EAClB,SAAS;EACT,cAAc;EACd,OAAO;YAEN;EACU,CAAA,GAtBN;;AA0BX,EAAO,cAAc"}
|
|
@@ -1,2 +1,61 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../chunk-Bmb41Sf3.cjs`);const e=require(`./FieldShell.cjs`),
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../chunk-Bmb41Sf3.cjs`);const e=require(`../useCustomIcon-DbSB56Pd.cjs`),t=require(`./FieldShell.cjs`),n=require(`../fieldProps-CuWfEbFx.cjs`),r=require(`../selectStyles-KK5-1q0t.cjs`);let i=require(`antd`),a=require(`react`),o=require(`react/jsx-runtime`);var s=`ds-tree-select-styles`,c=`ds-tree-select`,l=`ds-tree-select-popup`;function u({isOpen:t}){return(0,o.jsx)(`span`,{className:`ds-tree-select-suffix-icon`,"data-ds-icon-name":t?`arrowDown1`:`arrowRight1`,"aria-hidden":`true`,children:(0,o.jsx)(e.t,{name:t?`arrowDown1`:`arrowRight1`,size:12,style:{width:12,height:12,minWidth:12,minHeight:12}})})}function d(t){return t.isLeaf?null:(0,o.jsx)(`span`,{className:`ds-tree-select-switcher-icon`,"data-ds-icon-name":t.expanded?`arrowDown1`:`arrowRight1`,"aria-hidden":`true`,children:(0,o.jsx)(e.t,{name:t.expanded?`arrowDown1`:`arrowRight1`,size:12,style:{width:12,height:12,minWidth:12,minHeight:12}})})}var f=({className:e,open:f,fieldLabel:p,fieldRequired:m,fieldDescription:h,fieldError:g,fieldActions:_,containerStyle:v,clear:y,clearable:b=!1,clearLabel:x,clearVisibility:S=`always`,onClear:C,onValueChange:w,clearToValue:T,onOpenChange:E,onDropdownVisibleChange:D,popupClassName:O,suffixIcon:k,switcherIcon:A,...j})=>{let M=(0,a.useId)(),[N,P]=(0,a.useState)(!!f);(0,a.useEffect)(()=>{f!==void 0&&P(!!f)},[f]),(0,a.useEffect)(()=>{if(typeof document>`u`||document.getElementById(s))return;let e=document.createElement(`style`);e.id=s,e.textContent=`
|
|
2
|
+
.${c} .ant-select-arrow,
|
|
3
|
+
.${c} .ant-select-suffix,
|
|
4
|
+
.${l} .ant-select-tree-switcher {
|
|
5
|
+
width: 24px !important;
|
|
6
|
+
height: 24px !important;
|
|
7
|
+
display: inline-flex !important;
|
|
8
|
+
align-items: center !important;
|
|
9
|
+
justify-content: center !important;
|
|
10
|
+
line-height: 0 !important;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.${c} .ant-select-arrow,
|
|
14
|
+
.${c} .ant-select-suffix {
|
|
15
|
+
margin-top: 0 !important;
|
|
16
|
+
transform: translateY(-50%) !important;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.${l} .ant-select-tree-switcher {
|
|
20
|
+
margin-inline-end: 0 !important;
|
|
21
|
+
flex: 0 0 24px !important;
|
|
22
|
+
padding: 0 !important;
|
|
23
|
+
transform: none !important;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.${l} .ant-select-tree-switcher,
|
|
27
|
+
.${l} .ant-select-tree-switcher_close,
|
|
28
|
+
.${l} .ant-select-tree-switcher_open,
|
|
29
|
+
.${l} .ant-select-tree-switcher .ant-select-tree-switcher-icon,
|
|
30
|
+
.${l} .ant-select-tree-switcher .ant-select-tree-switcher-icon svg {
|
|
31
|
+
transform: none !important;
|
|
32
|
+
transition: none !important;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.${c} .ds-tree-select-suffix-icon,
|
|
36
|
+
.${l} .ds-tree-select-switcher-icon {
|
|
37
|
+
width: 24px !important;
|
|
38
|
+
height: 24px !important;
|
|
39
|
+
display: inline-flex !important;
|
|
40
|
+
align-items: center !important;
|
|
41
|
+
justify-content: center !important;
|
|
42
|
+
line-height: 0 !important;
|
|
43
|
+
pointer-events: none !important;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.${c} .ds-tree-select-suffix-icon .ds-icon,
|
|
47
|
+
.${l} .ds-tree-select-switcher-icon .ds-icon,
|
|
48
|
+
.${c} .ds-tree-select-suffix-icon svg,
|
|
49
|
+
.${l} .ds-tree-select-switcher-icon svg {
|
|
50
|
+
width: 12px !important;
|
|
51
|
+
height: 12px !important;
|
|
52
|
+
min-width: 12px !important;
|
|
53
|
+
min-height: 12px !important;
|
|
54
|
+
display: block !important;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.${l} .ant-select-tree-switcher-icon > .ds-tree-select-switcher-icon {
|
|
58
|
+
margin: 0 !important;
|
|
59
|
+
}
|
|
60
|
+
`,document.head.appendChild(e)},[]);let F=!!(p||m||h||g||_||b||y||C),I=j.id??(F?M:void 0),L=I?`${I}-description`:void 0,R=I?`${I}-error`:void 0,z=T===void 0?void 0:T,B=y?.onClear??C,V=(e,t,n)=>{j.onChange?.(e,t,n),w?.(e)},H=e=>{f===void 0&&P(e),E?.(e),D?.(e)},U=()=>{B?.(),w?.(z),j.onChange?.(z,null,null)},W=n.t(h?L:void 0,g?R:void 0),G=k??(0,o.jsx)(u,{isOpen:N}),K=A??d,q=r.l(l,O),J=(0,o.jsx)(i.TreeSelect,{...j,className:r.l(c,e),id:I,open:f,popupClassName:q,style:{width:`100%`,...j.style},"aria-describedby":W,"aria-invalid":g?!0:void 0,suffixIcon:G,switcherIcon:K,onOpenChange:H,onChange:V});return F?(0,o.jsx)(t.FieldShell,{label:p,required:m,htmlFor:I,description:h,descriptionId:L,error:g,errorId:R,clear:y,clearable:b,clearLabel:x,clearVisibility:S,clearValue:j.value,onClear:U,extraActions:_,style:v,children:J}):J};exports.TreeSelect=f;
|
|
2
61
|
//# sourceMappingURL=TreeSelect.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TreeSelect.cjs","names":[],"sources":["../../src/ds/forms/TreeSelect.tsx"],"sourcesContent":["import { TreeSelect as AntTreeSelect } from 'antd';\nimport { useId } from 'react';\nimport { FieldShell } from './FieldShell';\nimport type { DSFieldShellProps } from './fieldProps';\nimport { joinDescribedByIds } from './fieldProps';\n\ntype AntTreeSelectProps = React.ComponentProps<typeof AntTreeSelect>;\n\nexport type DSTreeSelectProps = AntTreeSelectProps;\n\nexport type TreeSelectFieldProps = DSFieldShellProps & {\n onValueChange?: (nextValue: AntTreeSelectProps['value']) => void;\n clearToValue?: AntTreeSelectProps['value'];\n};\n\nexport const TreeSelect = ({\n fieldLabel,\n fieldRequired,\n fieldDescription,\n fieldError,\n fieldActions,\n containerStyle,\n clear,\n clearable = false,\n clearLabel,\n clearVisibility = 'always',\n onClear,\n onValueChange,\n clearToValue,\n ...props\n}: DSTreeSelectProps & TreeSelectFieldProps) => {\n const generatedId = useId();\n const shouldWrapInFieldShell = Boolean(\n fieldLabel ||\n fieldRequired ||\n fieldDescription ||\n fieldError ||\n fieldActions ||\n clearable ||\n clear ||\n onClear,\n );\n const controlId = props.id ?? (shouldWrapInFieldShell ? generatedId : undefined);\n const descriptionId = controlId ? `${controlId}-description` : undefined;\n const errorId = controlId ? `${controlId}-error` : undefined;\n const clearValue = clearToValue === undefined ? undefined : clearToValue;\n const clearAction = clear?.onClear ?? onClear;\n\n const handleChange: AntTreeSelectProps['onChange'] = (nextValue, label, extra) => {\n props.onChange?.(nextValue, label, extra);\n onValueChange?.(nextValue);\n };\n\n const handleClear = () => {\n clearAction?.();\n onValueChange?.(clearValue);\n props.onChange?.(clearValue, null as never, null as never);\n };\n\n const describedBy = joinDescribedByIds(\n fieldDescription ? descriptionId : undefined,\n fieldError ? errorId : undefined,\n );\n\n const control = (\n <AntTreeSelect\n {...props}\n id={controlId}\n style={{ width: '100%', ...props.style }}\n aria-describedby={describedBy}\n aria-invalid={fieldError ? true : undefined}\n onChange={handleChange}\n />\n );\n\n if (!shouldWrapInFieldShell) {\n return control;\n }\n\n return (\n <FieldShell\n label={fieldLabel}\n required={fieldRequired}\n htmlFor={controlId}\n description={fieldDescription}\n descriptionId={descriptionId}\n error={fieldError}\n errorId={errorId}\n clear={clear}\n clearable={clearable}\n clearLabel={clearLabel}\n clearVisibility={clearVisibility}\n clearValue={props.value}\n onClear={handleClear}\n extraActions={fieldActions}\n style={containerStyle}\n >\n {control}\n </FieldShell>\n );\n};\n"],"mappings":"wPAeA,IAAa,GAAc,CACzB,aACA,gBACA,mBACA,aACA,eACA,iBACA,QACA,YAAY,GACZ,aACA,kBAAkB,SAClB,UACA,gBACA,eACA,GAAG,KAC2C,CAC9C,IAAM,GAAA,EAAA,EAAA,QAAqB,CACrB,EAAyB,GAC7B,GACE,GACA,GACA,GACA,GACA,GACA,GACA,GAEE,EAAY,EAAM,KAAO,EAAyB,EAAc,IAAA,IAChE,EAAgB,EAAY,GAAG,EAAU,cAAgB,IAAA,GACzD,EAAU,EAAY,GAAG,EAAU,QAAU,IAAA,GAC7C,EAAa,IAAiB,IAAA,GAAY,IAAA,GAAY,EACtD,EAAc,GAAO,SAAW,EAEhC,GAAgD,EAAW,EAAO,IAAU,CAChF,EAAM,WAAW,EAAW,EAAO,EAAM,CACzC,IAAgB,EAAU,EAGtB,MAAoB,CACxB,KAAe,CACf,IAAgB,EAAW,CAC3B,EAAM,WAAW,EAAY,KAAe,KAAc,EAGtD,EAAc,EAAA,EAClB,EAAmB,EAAgB,IAAA,GACnC,EAAa,EAAU,IAAA,GACxB,CAEK,GACJ,EAAA,EAAA,KAAC,EAAA,WAAD,CACE,GAAI,EACJ,GAAI,EACJ,MAAO,CAAE,MAAO,OAAQ,GAAG,EAAM,MAAO,CACxC,mBAAkB,EAClB,eAAc,EAAa,GAAO,IAAA,GAClC,SAAU,EACV,CAAA,CAOJ,OAJK,GAKH,EAAA,EAAA,KAAC,EAAA,WAAD,CACE,MAAO,EACP,SAAU,EACV,QAAS,EACT,YAAa,EACE,gBACf,MAAO,EACE,UACF,QACI,YACC,aACK,kBACjB,WAAY,EAAM,MAClB,QAAS,EACT,aAAc,EACd,MAAO,WAEN,EACU,CAAA,CAtBN"}
|
|
1
|
+
{"version":3,"file":"TreeSelect.cjs","names":[],"sources":["../../src/ds/forms/TreeSelect.tsx"],"sourcesContent":["import { TreeSelect as AntTreeSelect } from 'antd';\nimport { useEffect, useId, useState } from 'react';\nimport { Icon } from '../../utils/icons';\nimport { FieldShell } from './FieldShell';\nimport type { DSFieldShellProps } from './fieldProps';\nimport { joinDescribedByIds } from './fieldProps';\nimport { mergeClassNames } from './selectStyles';\n\ntype AntTreeSelectProps = React.ComponentProps<typeof AntTreeSelect>;\n\nconst STYLE_ID = 'ds-tree-select-styles';\nconst DS_TREE_SELECT_CLASS = 'ds-tree-select';\nconst DS_TREE_SELECT_POPUP_CLASS = 'ds-tree-select-popup';\n\nfunction DefaultTreeSelectSuffixIcon({ isOpen }: { isOpen: boolean }) {\n return (\n <span\n className=\"ds-tree-select-suffix-icon\"\n data-ds-icon-name={isOpen ? 'arrowDown1' : 'arrowRight1'}\n aria-hidden=\"true\"\n >\n <Icon\n name={isOpen ? 'arrowDown1' : 'arrowRight1'}\n size={12}\n style={{ width: 12, height: 12, minWidth: 12, minHeight: 12 }}\n />\n </span>\n );\n}\n\nfunction DefaultTreeSelectSwitcherIcon(nodeProps: { expanded?: boolean; isLeaf?: boolean }) {\n if (nodeProps.isLeaf) {\n return null;\n }\n\n return (\n <span\n className=\"ds-tree-select-switcher-icon\"\n data-ds-icon-name={nodeProps.expanded ? 'arrowDown1' : 'arrowRight1'}\n aria-hidden=\"true\"\n >\n <Icon\n name={nodeProps.expanded ? 'arrowDown1' : 'arrowRight1'}\n size={12}\n style={{ width: 12, height: 12, minWidth: 12, minHeight: 12 }}\n />\n </span>\n );\n}\n\nexport type DSTreeSelectProps = AntTreeSelectProps;\n\nexport type TreeSelectFieldProps = DSFieldShellProps & {\n onValueChange?: (nextValue: AntTreeSelectProps['value']) => void;\n clearToValue?: AntTreeSelectProps['value'];\n};\n\nexport const TreeSelect = ({\n className,\n open,\n fieldLabel,\n fieldRequired,\n fieldDescription,\n fieldError,\n fieldActions,\n containerStyle,\n clear,\n clearable = false,\n clearLabel,\n clearVisibility = 'always',\n onClear,\n onValueChange,\n clearToValue,\n onOpenChange,\n onDropdownVisibleChange,\n popupClassName,\n suffixIcon,\n switcherIcon,\n ...props\n}: DSTreeSelectProps & TreeSelectFieldProps) => {\n const generatedId = useId();\n const [isOpen, setIsOpen] = useState(Boolean(open));\n\n useEffect(() => {\n if (open !== undefined) {\n setIsOpen(Boolean(open));\n }\n }, [open]);\n\n useEffect(() => {\n if (typeof document === 'undefined' || document.getElementById(STYLE_ID)) {\n return;\n }\n\n const style = document.createElement('style');\n style.id = STYLE_ID;\n style.textContent = `\n .${DS_TREE_SELECT_CLASS} .ant-select-arrow,\n .${DS_TREE_SELECT_CLASS} .ant-select-suffix,\n .${DS_TREE_SELECT_POPUP_CLASS} .ant-select-tree-switcher {\n width: 24px !important;\n height: 24px !important;\n display: inline-flex !important;\n align-items: center !important;\n justify-content: center !important;\n line-height: 0 !important;\n }\n\n .${DS_TREE_SELECT_CLASS} .ant-select-arrow,\n .${DS_TREE_SELECT_CLASS} .ant-select-suffix {\n margin-top: 0 !important;\n transform: translateY(-50%) !important;\n }\n\n .${DS_TREE_SELECT_POPUP_CLASS} .ant-select-tree-switcher {\n margin-inline-end: 0 !important;\n flex: 0 0 24px !important;\n padding: 0 !important;\n transform: none !important;\n }\n\n .${DS_TREE_SELECT_POPUP_CLASS} .ant-select-tree-switcher,\n .${DS_TREE_SELECT_POPUP_CLASS} .ant-select-tree-switcher_close,\n .${DS_TREE_SELECT_POPUP_CLASS} .ant-select-tree-switcher_open,\n .${DS_TREE_SELECT_POPUP_CLASS} .ant-select-tree-switcher .ant-select-tree-switcher-icon,\n .${DS_TREE_SELECT_POPUP_CLASS} .ant-select-tree-switcher .ant-select-tree-switcher-icon svg {\n transform: none !important;\n transition: none !important;\n }\n\n .${DS_TREE_SELECT_CLASS} .ds-tree-select-suffix-icon,\n .${DS_TREE_SELECT_POPUP_CLASS} .ds-tree-select-switcher-icon {\n width: 24px !important;\n height: 24px !important;\n display: inline-flex !important;\n align-items: center !important;\n justify-content: center !important;\n line-height: 0 !important;\n pointer-events: none !important;\n }\n\n .${DS_TREE_SELECT_CLASS} .ds-tree-select-suffix-icon .ds-icon,\n .${DS_TREE_SELECT_POPUP_CLASS} .ds-tree-select-switcher-icon .ds-icon,\n .${DS_TREE_SELECT_CLASS} .ds-tree-select-suffix-icon svg,\n .${DS_TREE_SELECT_POPUP_CLASS} .ds-tree-select-switcher-icon svg {\n width: 12px !important;\n height: 12px !important;\n min-width: 12px !important;\n min-height: 12px !important;\n display: block !important;\n }\n\n .${DS_TREE_SELECT_POPUP_CLASS} .ant-select-tree-switcher-icon > .ds-tree-select-switcher-icon {\n margin: 0 !important;\n }\n `;\n document.head.appendChild(style);\n }, []);\n\n const shouldWrapInFieldShell = Boolean(\n fieldLabel ||\n fieldRequired ||\n fieldDescription ||\n fieldError ||\n fieldActions ||\n clearable ||\n clear ||\n onClear,\n );\n const controlId = props.id ?? (shouldWrapInFieldShell ? generatedId : undefined);\n const descriptionId = controlId ? `${controlId}-description` : undefined;\n const errorId = controlId ? `${controlId}-error` : undefined;\n const clearValue = clearToValue === undefined ? undefined : clearToValue;\n const clearAction = clear?.onClear ?? onClear;\n\n const handleChange: AntTreeSelectProps['onChange'] = (nextValue, label, extra) => {\n props.onChange?.(nextValue, label, extra);\n onValueChange?.(nextValue);\n };\n\n const handleOpenChange = (nextOpen: boolean) => {\n if (open === undefined) {\n setIsOpen(nextOpen);\n }\n onOpenChange?.(nextOpen);\n onDropdownVisibleChange?.(nextOpen);\n };\n\n const handleClear = () => {\n clearAction?.();\n onValueChange?.(clearValue);\n props.onChange?.(clearValue, null as never, null as never);\n };\n\n const describedBy = joinDescribedByIds(\n fieldDescription ? descriptionId : undefined,\n fieldError ? errorId : undefined,\n );\n const resolvedSuffixIcon = suffixIcon ?? <DefaultTreeSelectSuffixIcon isOpen={isOpen} />;\n const resolvedSwitcherIcon = switcherIcon ?? DefaultTreeSelectSwitcherIcon;\n const resolvedPopupClassName = mergeClassNames(DS_TREE_SELECT_POPUP_CLASS, popupClassName);\n\n const control = (\n <AntTreeSelect\n {...props}\n className={mergeClassNames(DS_TREE_SELECT_CLASS, className)}\n id={controlId}\n open={open}\n popupClassName={resolvedPopupClassName}\n style={{ width: '100%', ...props.style }}\n aria-describedby={describedBy}\n aria-invalid={fieldError ? true : undefined}\n suffixIcon={resolvedSuffixIcon}\n switcherIcon={resolvedSwitcherIcon}\n onOpenChange={handleOpenChange}\n onChange={handleChange}\n />\n );\n\n if (!shouldWrapInFieldShell) {\n return control;\n }\n\n return (\n <FieldShell\n label={fieldLabel}\n required={fieldRequired}\n htmlFor={controlId}\n description={fieldDescription}\n descriptionId={descriptionId}\n error={fieldError}\n errorId={errorId}\n clear={clear}\n clearable={clearable}\n clearLabel={clearLabel}\n clearVisibility={clearVisibility}\n clearValue={props.value}\n onClear={handleClear}\n extraActions={fieldActions}\n style={containerStyle}\n >\n {control}\n </FieldShell>\n );\n};\n"],"mappings":"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"}
|
|
@@ -1,45 +1,157 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t } from "
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
1
|
+
import { t as e } from "../useCustomIcon-B-VUK-84.js";
|
|
2
|
+
import { FieldShell as t } from "./FieldShell.js";
|
|
3
|
+
import { t as n } from "../fieldProps-EeYy2kXb.js";
|
|
4
|
+
import { l as r } from "../selectStyles-7f37TvzD.js";
|
|
5
|
+
import { TreeSelect as i } from "antd";
|
|
6
|
+
import { useEffect as a, useId as o, useState as s } from "react";
|
|
7
|
+
import { jsx as c } from "react/jsx-runtime";
|
|
6
8
|
//#region src/ds/forms/TreeSelect.tsx
|
|
7
|
-
var
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
9
|
+
var l = "ds-tree-select-styles", u = "ds-tree-select", d = "ds-tree-select-popup";
|
|
10
|
+
function f({ isOpen: t }) {
|
|
11
|
+
return /* @__PURE__ */ c("span", {
|
|
12
|
+
className: "ds-tree-select-suffix-icon",
|
|
13
|
+
"data-ds-icon-name": t ? "arrowDown1" : "arrowRight1",
|
|
14
|
+
"aria-hidden": "true",
|
|
15
|
+
children: /* @__PURE__ */ c(e, {
|
|
16
|
+
name: t ? "arrowDown1" : "arrowRight1",
|
|
17
|
+
size: 12,
|
|
18
|
+
style: {
|
|
19
|
+
width: 12,
|
|
20
|
+
height: 12,
|
|
21
|
+
minWidth: 12,
|
|
22
|
+
minHeight: 12
|
|
23
|
+
}
|
|
24
|
+
})
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
function p(t) {
|
|
28
|
+
return t.isLeaf ? null : /* @__PURE__ */ c("span", {
|
|
29
|
+
className: "ds-tree-select-switcher-icon",
|
|
30
|
+
"data-ds-icon-name": t.expanded ? "arrowDown1" : "arrowRight1",
|
|
31
|
+
"aria-hidden": "true",
|
|
32
|
+
children: /* @__PURE__ */ c(e, {
|
|
33
|
+
name: t.expanded ? "arrowDown1" : "arrowRight1",
|
|
34
|
+
size: 12,
|
|
35
|
+
style: {
|
|
36
|
+
width: 12,
|
|
37
|
+
height: 12,
|
|
38
|
+
minWidth: 12,
|
|
39
|
+
minHeight: 12
|
|
40
|
+
}
|
|
41
|
+
})
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
var m = ({ className: e, open: m, fieldLabel: h, fieldRequired: g, fieldDescription: _, fieldError: v, fieldActions: y, containerStyle: b, clear: x, clearable: S = !1, clearLabel: C, clearVisibility: w = "always", onClear: T, onValueChange: E, clearToValue: D, onOpenChange: O, onDropdownVisibleChange: k, popupClassName: A, suffixIcon: j, switcherIcon: M, ...N }) => {
|
|
45
|
+
let P = o(), [F, I] = s(!!m);
|
|
46
|
+
a(() => {
|
|
47
|
+
m !== void 0 && I(!!m);
|
|
48
|
+
}, [m]), a(() => {
|
|
49
|
+
if (typeof document > "u" || document.getElementById(l)) return;
|
|
50
|
+
let e = document.createElement("style");
|
|
51
|
+
e.id = l, e.textContent = `
|
|
52
|
+
.${u} .ant-select-arrow,
|
|
53
|
+
.${u} .ant-select-suffix,
|
|
54
|
+
.${d} .ant-select-tree-switcher {
|
|
55
|
+
width: 24px !important;
|
|
56
|
+
height: 24px !important;
|
|
57
|
+
display: inline-flex !important;
|
|
58
|
+
align-items: center !important;
|
|
59
|
+
justify-content: center !important;
|
|
60
|
+
line-height: 0 !important;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.${u} .ant-select-arrow,
|
|
64
|
+
.${u} .ant-select-suffix {
|
|
65
|
+
margin-top: 0 !important;
|
|
66
|
+
transform: translateY(-50%) !important;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.${d} .ant-select-tree-switcher {
|
|
70
|
+
margin-inline-end: 0 !important;
|
|
71
|
+
flex: 0 0 24px !important;
|
|
72
|
+
padding: 0 !important;
|
|
73
|
+
transform: none !important;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.${d} .ant-select-tree-switcher,
|
|
77
|
+
.${d} .ant-select-tree-switcher_close,
|
|
78
|
+
.${d} .ant-select-tree-switcher_open,
|
|
79
|
+
.${d} .ant-select-tree-switcher .ant-select-tree-switcher-icon,
|
|
80
|
+
.${d} .ant-select-tree-switcher .ant-select-tree-switcher-icon svg {
|
|
81
|
+
transform: none !important;
|
|
82
|
+
transition: none !important;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.${u} .ds-tree-select-suffix-icon,
|
|
86
|
+
.${d} .ds-tree-select-switcher-icon {
|
|
87
|
+
width: 24px !important;
|
|
88
|
+
height: 24px !important;
|
|
89
|
+
display: inline-flex !important;
|
|
90
|
+
align-items: center !important;
|
|
91
|
+
justify-content: center !important;
|
|
92
|
+
line-height: 0 !important;
|
|
93
|
+
pointer-events: none !important;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.${u} .ds-tree-select-suffix-icon .ds-icon,
|
|
97
|
+
.${d} .ds-tree-select-switcher-icon .ds-icon,
|
|
98
|
+
.${u} .ds-tree-select-suffix-icon svg,
|
|
99
|
+
.${d} .ds-tree-select-switcher-icon svg {
|
|
100
|
+
width: 12px !important;
|
|
101
|
+
height: 12px !important;
|
|
102
|
+
min-width: 12px !important;
|
|
103
|
+
min-height: 12px !important;
|
|
104
|
+
display: block !important;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
.${d} .ant-select-tree-switcher-icon > .ds-tree-select-switcher-icon {
|
|
108
|
+
margin: 0 !important;
|
|
109
|
+
}
|
|
110
|
+
`, document.head.appendChild(e);
|
|
111
|
+
}, []);
|
|
112
|
+
let L = !!(h || g || _ || v || y || S || x || T), R = N.id ?? (L ? P : void 0), z = R ? `${R}-description` : void 0, B = R ? `${R}-error` : void 0, V = D === void 0 ? void 0 : D, H = x?.onClear ?? T, U = (e, t, n) => {
|
|
113
|
+
N.onChange?.(e, t, n), E?.(e);
|
|
114
|
+
}, W = (e) => {
|
|
115
|
+
m === void 0 && I(e), O?.(e), k?.(e);
|
|
116
|
+
}, G = () => {
|
|
117
|
+
H?.(), E?.(V), N.onChange?.(V, null, null);
|
|
118
|
+
}, K = n(_ ? z : void 0, v ? B : void 0), q = j ?? /* @__PURE__ */ c(f, { isOpen: F }), J = M ?? p, Y = r(d, A), X = /* @__PURE__ */ c(i, {
|
|
119
|
+
...N,
|
|
120
|
+
className: r(u, e),
|
|
121
|
+
id: R,
|
|
122
|
+
open: m,
|
|
123
|
+
popupClassName: Y,
|
|
15
124
|
style: {
|
|
16
125
|
width: "100%",
|
|
17
|
-
...
|
|
126
|
+
...N.style
|
|
18
127
|
},
|
|
19
|
-
"aria-describedby":
|
|
20
|
-
"aria-invalid":
|
|
21
|
-
|
|
128
|
+
"aria-describedby": K,
|
|
129
|
+
"aria-invalid": v ? !0 : void 0,
|
|
130
|
+
suffixIcon: q,
|
|
131
|
+
switcherIcon: J,
|
|
132
|
+
onOpenChange: W,
|
|
133
|
+
onChange: U
|
|
22
134
|
});
|
|
23
|
-
return
|
|
24
|
-
label:
|
|
25
|
-
required:
|
|
26
|
-
htmlFor:
|
|
27
|
-
description:
|
|
28
|
-
descriptionId:
|
|
29
|
-
error:
|
|
30
|
-
errorId:
|
|
31
|
-
clear:
|
|
32
|
-
clearable:
|
|
33
|
-
clearLabel:
|
|
34
|
-
clearVisibility:
|
|
35
|
-
clearValue:
|
|
36
|
-
onClear:
|
|
37
|
-
extraActions:
|
|
38
|
-
style:
|
|
39
|
-
children:
|
|
40
|
-
}) :
|
|
135
|
+
return L ? /* @__PURE__ */ c(t, {
|
|
136
|
+
label: h,
|
|
137
|
+
required: g,
|
|
138
|
+
htmlFor: R,
|
|
139
|
+
description: _,
|
|
140
|
+
descriptionId: z,
|
|
141
|
+
error: v,
|
|
142
|
+
errorId: B,
|
|
143
|
+
clear: x,
|
|
144
|
+
clearable: S,
|
|
145
|
+
clearLabel: C,
|
|
146
|
+
clearVisibility: w,
|
|
147
|
+
clearValue: N.value,
|
|
148
|
+
onClear: G,
|
|
149
|
+
extraActions: y,
|
|
150
|
+
style: b,
|
|
151
|
+
children: X
|
|
152
|
+
}) : X;
|
|
41
153
|
};
|
|
42
154
|
//#endregion
|
|
43
|
-
export {
|
|
155
|
+
export { m as TreeSelect };
|
|
44
156
|
|
|
45
157
|
//# sourceMappingURL=TreeSelect.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TreeSelect.js","names":[],"sources":["../../src/ds/forms/TreeSelect.tsx"],"sourcesContent":["import { TreeSelect as AntTreeSelect } from 'antd';\nimport { useId } from 'react';\nimport { FieldShell } from './FieldShell';\nimport type { DSFieldShellProps } from './fieldProps';\nimport { joinDescribedByIds } from './fieldProps';\n\ntype AntTreeSelectProps = React.ComponentProps<typeof AntTreeSelect>;\n\nexport type DSTreeSelectProps = AntTreeSelectProps;\n\nexport type TreeSelectFieldProps = DSFieldShellProps & {\n onValueChange?: (nextValue: AntTreeSelectProps['value']) => void;\n clearToValue?: AntTreeSelectProps['value'];\n};\n\nexport const TreeSelect = ({\n fieldLabel,\n fieldRequired,\n fieldDescription,\n fieldError,\n fieldActions,\n containerStyle,\n clear,\n clearable = false,\n clearLabel,\n clearVisibility = 'always',\n onClear,\n onValueChange,\n clearToValue,\n ...props\n}: DSTreeSelectProps & TreeSelectFieldProps) => {\n const generatedId = useId();\n const shouldWrapInFieldShell = Boolean(\n fieldLabel ||\n fieldRequired ||\n fieldDescription ||\n fieldError ||\n fieldActions ||\n clearable ||\n clear ||\n onClear,\n );\n const controlId = props.id ?? (shouldWrapInFieldShell ? generatedId : undefined);\n const descriptionId = controlId ? `${controlId}-description` : undefined;\n const errorId = controlId ? `${controlId}-error` : undefined;\n const clearValue = clearToValue === undefined ? undefined : clearToValue;\n const clearAction = clear?.onClear ?? onClear;\n\n const handleChange: AntTreeSelectProps['onChange'] = (nextValue, label, extra) => {\n props.onChange?.(nextValue, label, extra);\n onValueChange?.(nextValue);\n };\n\n const handleClear = () => {\n clearAction?.();\n onValueChange?.(clearValue);\n props.onChange?.(clearValue, null as never, null as never);\n };\n\n const describedBy = joinDescribedByIds(\n fieldDescription ? descriptionId : undefined,\n fieldError ? errorId : undefined,\n );\n\n const control = (\n <AntTreeSelect\n {...props}\n id={controlId}\n style={{ width: '100%', ...props.style }}\n aria-describedby={describedBy}\n aria-invalid={fieldError ? true : undefined}\n onChange={handleChange}\n />\n );\n\n if (!shouldWrapInFieldShell) {\n return control;\n }\n\n return (\n <FieldShell\n label={fieldLabel}\n required={fieldRequired}\n htmlFor={controlId}\n description={fieldDescription}\n descriptionId={descriptionId}\n error={fieldError}\n errorId={errorId}\n clear={clear}\n clearable={clearable}\n clearLabel={clearLabel}\n clearVisibility={clearVisibility}\n clearValue={props.value}\n onClear={handleClear}\n extraActions={fieldActions}\n style={containerStyle}\n >\n {control}\n </FieldShell>\n );\n};\n"],"mappings":";;;;;;AAeA,IAAa,KAAc,EACzB,eACA,kBACA,qBACA,eACA,iBACA,mBACA,UACA,eAAY,IACZ,eACA,qBAAkB,UAClB,YACA,kBACA,iBACA,GAAG,QAC2C;CAC9C,IAAM,IAAc,GAAO,EACrB,IAAyB,GAC7B,KACE,KACA,KACA,KACA,KACA,KACA,KACA,IAEE,IAAY,EAAM,OAAO,IAAyB,IAAc,KAAA,IAChE,IAAgB,IAAY,GAAG,EAAU,gBAAgB,KAAA,GACzD,IAAU,IAAY,GAAG,EAAU,UAAU,KAAA,GAC7C,IAAa,MAAiB,KAAA,IAAY,KAAA,IAAY,GACtD,IAAc,GAAO,WAAW,GAEhC,KAAgD,GAAW,GAAO,MAAU;AAEhF,EADA,EAAM,WAAW,GAAW,GAAO,EAAM,EACzC,IAAgB,EAAU;IAGtB,UAAoB;AAGxB,EAFA,KAAe,EACf,IAAgB,EAAW,EAC3B,EAAM,WAAW,GAAY,MAAe,KAAc;IAGtD,IAAc,EAClB,IAAmB,IAAgB,KAAA,GACnC,IAAa,IAAU,KAAA,EACxB,EAEK,IACJ,kBAAC,GAAD;EACE,GAAI;EACJ,IAAI;EACJ,OAAO;GAAE,OAAO;GAAQ,GAAG,EAAM;GAAO;EACxC,oBAAkB;EAClB,gBAAc,IAAa,KAAO,KAAA;EAClC,UAAU;EACV,CAAA;AAOJ,QAJK,IAKH,kBAAC,GAAD;EACE,OAAO;EACP,UAAU;EACV,SAAS;EACT,aAAa;EACE;EACf,OAAO;EACE;EACF;EACI;EACC;EACK;EACjB,YAAY,EAAM;EAClB,SAAS;EACT,cAAc;EACd,OAAO;YAEN;EACU,CAAA,GAtBN"}
|
|
1
|
+
{"version":3,"file":"TreeSelect.js","names":[],"sources":["../../src/ds/forms/TreeSelect.tsx"],"sourcesContent":["import { TreeSelect as AntTreeSelect } from 'antd';\nimport { useEffect, useId, useState } from 'react';\nimport { Icon } from '../../utils/icons';\nimport { FieldShell } from './FieldShell';\nimport type { DSFieldShellProps } from './fieldProps';\nimport { joinDescribedByIds } from './fieldProps';\nimport { mergeClassNames } from './selectStyles';\n\ntype AntTreeSelectProps = React.ComponentProps<typeof AntTreeSelect>;\n\nconst STYLE_ID = 'ds-tree-select-styles';\nconst DS_TREE_SELECT_CLASS = 'ds-tree-select';\nconst DS_TREE_SELECT_POPUP_CLASS = 'ds-tree-select-popup';\n\nfunction DefaultTreeSelectSuffixIcon({ isOpen }: { isOpen: boolean }) {\n return (\n <span\n className=\"ds-tree-select-suffix-icon\"\n data-ds-icon-name={isOpen ? 'arrowDown1' : 'arrowRight1'}\n aria-hidden=\"true\"\n >\n <Icon\n name={isOpen ? 'arrowDown1' : 'arrowRight1'}\n size={12}\n style={{ width: 12, height: 12, minWidth: 12, minHeight: 12 }}\n />\n </span>\n );\n}\n\nfunction DefaultTreeSelectSwitcherIcon(nodeProps: { expanded?: boolean; isLeaf?: boolean }) {\n if (nodeProps.isLeaf) {\n return null;\n }\n\n return (\n <span\n className=\"ds-tree-select-switcher-icon\"\n data-ds-icon-name={nodeProps.expanded ? 'arrowDown1' : 'arrowRight1'}\n aria-hidden=\"true\"\n >\n <Icon\n name={nodeProps.expanded ? 'arrowDown1' : 'arrowRight1'}\n size={12}\n style={{ width: 12, height: 12, minWidth: 12, minHeight: 12 }}\n />\n </span>\n );\n}\n\nexport type DSTreeSelectProps = AntTreeSelectProps;\n\nexport type TreeSelectFieldProps = DSFieldShellProps & {\n onValueChange?: (nextValue: AntTreeSelectProps['value']) => void;\n clearToValue?: AntTreeSelectProps['value'];\n};\n\nexport const TreeSelect = ({\n className,\n open,\n fieldLabel,\n fieldRequired,\n fieldDescription,\n fieldError,\n fieldActions,\n containerStyle,\n clear,\n clearable = false,\n clearLabel,\n clearVisibility = 'always',\n onClear,\n onValueChange,\n clearToValue,\n onOpenChange,\n onDropdownVisibleChange,\n popupClassName,\n suffixIcon,\n switcherIcon,\n ...props\n}: DSTreeSelectProps & TreeSelectFieldProps) => {\n const generatedId = useId();\n const [isOpen, setIsOpen] = useState(Boolean(open));\n\n useEffect(() => {\n if (open !== undefined) {\n setIsOpen(Boolean(open));\n }\n }, [open]);\n\n useEffect(() => {\n if (typeof document === 'undefined' || document.getElementById(STYLE_ID)) {\n return;\n }\n\n const style = document.createElement('style');\n style.id = STYLE_ID;\n style.textContent = `\n .${DS_TREE_SELECT_CLASS} .ant-select-arrow,\n .${DS_TREE_SELECT_CLASS} .ant-select-suffix,\n .${DS_TREE_SELECT_POPUP_CLASS} .ant-select-tree-switcher {\n width: 24px !important;\n height: 24px !important;\n display: inline-flex !important;\n align-items: center !important;\n justify-content: center !important;\n line-height: 0 !important;\n }\n\n .${DS_TREE_SELECT_CLASS} .ant-select-arrow,\n .${DS_TREE_SELECT_CLASS} .ant-select-suffix {\n margin-top: 0 !important;\n transform: translateY(-50%) !important;\n }\n\n .${DS_TREE_SELECT_POPUP_CLASS} .ant-select-tree-switcher {\n margin-inline-end: 0 !important;\n flex: 0 0 24px !important;\n padding: 0 !important;\n transform: none !important;\n }\n\n .${DS_TREE_SELECT_POPUP_CLASS} .ant-select-tree-switcher,\n .${DS_TREE_SELECT_POPUP_CLASS} .ant-select-tree-switcher_close,\n .${DS_TREE_SELECT_POPUP_CLASS} .ant-select-tree-switcher_open,\n .${DS_TREE_SELECT_POPUP_CLASS} .ant-select-tree-switcher .ant-select-tree-switcher-icon,\n .${DS_TREE_SELECT_POPUP_CLASS} .ant-select-tree-switcher .ant-select-tree-switcher-icon svg {\n transform: none !important;\n transition: none !important;\n }\n\n .${DS_TREE_SELECT_CLASS} .ds-tree-select-suffix-icon,\n .${DS_TREE_SELECT_POPUP_CLASS} .ds-tree-select-switcher-icon {\n width: 24px !important;\n height: 24px !important;\n display: inline-flex !important;\n align-items: center !important;\n justify-content: center !important;\n line-height: 0 !important;\n pointer-events: none !important;\n }\n\n .${DS_TREE_SELECT_CLASS} .ds-tree-select-suffix-icon .ds-icon,\n .${DS_TREE_SELECT_POPUP_CLASS} .ds-tree-select-switcher-icon .ds-icon,\n .${DS_TREE_SELECT_CLASS} .ds-tree-select-suffix-icon svg,\n .${DS_TREE_SELECT_POPUP_CLASS} .ds-tree-select-switcher-icon svg {\n width: 12px !important;\n height: 12px !important;\n min-width: 12px !important;\n min-height: 12px !important;\n display: block !important;\n }\n\n .${DS_TREE_SELECT_POPUP_CLASS} .ant-select-tree-switcher-icon > .ds-tree-select-switcher-icon {\n margin: 0 !important;\n }\n `;\n document.head.appendChild(style);\n }, []);\n\n const shouldWrapInFieldShell = Boolean(\n fieldLabel ||\n fieldRequired ||\n fieldDescription ||\n fieldError ||\n fieldActions ||\n clearable ||\n clear ||\n onClear,\n );\n const controlId = props.id ?? (shouldWrapInFieldShell ? generatedId : undefined);\n const descriptionId = controlId ? `${controlId}-description` : undefined;\n const errorId = controlId ? `${controlId}-error` : undefined;\n const clearValue = clearToValue === undefined ? undefined : clearToValue;\n const clearAction = clear?.onClear ?? onClear;\n\n const handleChange: AntTreeSelectProps['onChange'] = (nextValue, label, extra) => {\n props.onChange?.(nextValue, label, extra);\n onValueChange?.(nextValue);\n };\n\n const handleOpenChange = (nextOpen: boolean) => {\n if (open === undefined) {\n setIsOpen(nextOpen);\n }\n onOpenChange?.(nextOpen);\n onDropdownVisibleChange?.(nextOpen);\n };\n\n const handleClear = () => {\n clearAction?.();\n onValueChange?.(clearValue);\n props.onChange?.(clearValue, null as never, null as never);\n };\n\n const describedBy = joinDescribedByIds(\n fieldDescription ? descriptionId : undefined,\n fieldError ? errorId : undefined,\n );\n const resolvedSuffixIcon = suffixIcon ?? <DefaultTreeSelectSuffixIcon isOpen={isOpen} />;\n const resolvedSwitcherIcon = switcherIcon ?? DefaultTreeSelectSwitcherIcon;\n const resolvedPopupClassName = mergeClassNames(DS_TREE_SELECT_POPUP_CLASS, popupClassName);\n\n const control = (\n <AntTreeSelect\n {...props}\n className={mergeClassNames(DS_TREE_SELECT_CLASS, className)}\n id={controlId}\n open={open}\n popupClassName={resolvedPopupClassName}\n style={{ width: '100%', ...props.style }}\n aria-describedby={describedBy}\n aria-invalid={fieldError ? true : undefined}\n suffixIcon={resolvedSuffixIcon}\n switcherIcon={resolvedSwitcherIcon}\n onOpenChange={handleOpenChange}\n onChange={handleChange}\n />\n );\n\n if (!shouldWrapInFieldShell) {\n return control;\n }\n\n return (\n <FieldShell\n label={fieldLabel}\n required={fieldRequired}\n htmlFor={controlId}\n description={fieldDescription}\n descriptionId={descriptionId}\n error={fieldError}\n errorId={errorId}\n clear={clear}\n clearable={clearable}\n clearLabel={clearLabel}\n clearVisibility={clearVisibility}\n clearValue={props.value}\n onClear={handleClear}\n extraActions={fieldActions}\n style={containerStyle}\n >\n {control}\n </FieldShell>\n );\n};\n"],"mappings":"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"}
|
package/dist-lib/forms/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./Button.cjs`),t=require(`./Form.cjs`),n=require(`./clearUtils.cjs`),r=require(`./FieldShell.cjs`),i=require(`./Select.cjs`),a=require(`../DatePicker-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./Button.cjs`),t=require(`./Form.cjs`),n=require(`./clearUtils.cjs`),r=require(`./FieldShell.cjs`),i=require(`./Select.cjs`),a=require(`../DatePicker-CQgt-WoB.cjs`),o=require(`../TimePicker-D4iKsUck.cjs`),s=require(`./TreeSelect.cjs`),c=require(`./Input.cjs`),l=require(`./PasswordInput.cjs`),u=require(`../InputNumber-X-VvOKNc.cjs`),d=require(`./Checkbox.cjs`),f=require(`./FieldSetShell.cjs`),p=require(`./CheckboxGroup.cjs`),m=require(`./Radio.cjs`),h=require(`./RadioGroup.cjs`),g=require(`./Switch.cjs`),_=require(`./Mentions.cjs`),v=require(`./Slider.cjs`),y=require(`./Rate.cjs`),b=require(`./ColorPicker.cjs`),x=require(`./AccessiblePasswordInput.cjs`),S=require(`./AccessibleCheckboxGroup.cjs`),C=require(`./AccessibleRadioGroup.cjs`),w=require(`./AccessibleSwitch.cjs`),T=require(`./AccessibleSelect.cjs`),E=require(`./AccessibleDatePicker.cjs`),D=require(`./FormError.cjs`),O=require(`./FormSuccess.cjs`),k=require(`./FormWarning.cjs`),A=require(`./validation.cjs`),j=require(`./ClearableInput.cjs`),M=require(`./ClearableSelect.cjs`),N=require(`./ClearableDatePicker.cjs`),P=require(`./ClearableInputNumber.cjs`),F=require(`./ClearableTimePicker.cjs`),I=require(`./ClearableTreeSelect.cjs`),L=require(`./Cascader.cjs`),R=require(`./ClearableCascader.cjs`),z=require(`../AutoComplete-C9LcpBRs.cjs`),B=require(`./ClearableAutoComplete.cjs`),V=require(`./ClearableMentions.cjs`),H=require(`./ClearableCheckbox.cjs`),U=require(`./ClearableRadio.cjs`),W=require(`./ClearableRadioGroup.cjs`),G=require(`./ClearableSwitch.cjs`),K=require(`./ClearableSlider.cjs`),q=require(`./ClearableRate.cjs`),J=require(`./ClearableColorPicker.cjs`),Y=require(`./ClearableTransfer.cjs`),X=require(`./ClearableUpload.cjs`);exports.AccessibleCheckboxGroup=S.AccessibleCheckboxGroup,exports.AccessibleDatePicker=E.AccessibleDatePicker,exports.AccessiblePasswordInput=x.AccessiblePasswordInput,exports.AccessibleRadioGroup=C.AccessibleRadioGroup,exports.AccessibleSelect=T.AccessibleSelect,exports.AccessibleSwitch=w.AccessibleSwitch,exports.AutoComplete=z.t,exports.Button=e.Button,exports.Cascader=L.Cascader,exports.Checkbox=d.Checkbox,exports.CheckboxGroup=p.CheckboxGroup,exports.ClearableAutoComplete=B.ClearableAutoComplete,exports.ClearableCascader=R.ClearableCascader,exports.ClearableCheckbox=H.ClearableCheckbox,exports.ClearableColorPicker=J.ClearableColorPicker,exports.ClearableDatePicker=N.ClearableDatePicker,exports.ClearableInput=j.ClearableInput,exports.ClearableInputNumber=P.ClearableInputNumber,exports.ClearableMentions=V.ClearableMentions,exports.ClearableRadio=U.ClearableRadio,exports.ClearableRadioGroup=W.ClearableRadioGroup,exports.ClearableRate=q.ClearableRate,exports.ClearableSelect=M.ClearableSelect,exports.ClearableSlider=K.ClearableSlider,exports.ClearableSwitch=G.ClearableSwitch,exports.ClearableTimePicker=F.ClearableTimePicker,exports.ClearableTransfer=Y.ClearableTransfer,exports.ClearableTreeSelect=I.ClearableTreeSelect,exports.ClearableUpload=X.ClearableUpload,exports.ColorPicker=b.ColorPicker,exports.DS_DATE_FORMAT=a.t,exports.DatePicker=a.n,exports.FieldSetShell=f.FieldSetShell,exports.FieldShell=r.FieldShell,exports.Form=t.Form,exports.FormBase=t.FormBase,exports.FormError=D.FormError,exports.FormSuccess=O.FormSuccess,exports.FormWarning=k.FormWarning,exports.Input=c.Input,exports.InputNumber=u.t,exports.InputOTP=c.InputOTP,exports.InputSearch=c.InputSearch,exports.InputTextArea=c.InputTextArea,exports.Mentions=_.Mentions,exports.PasswordInput=l.PasswordInput,exports.Radio=m.Radio,exports.RadioGroup=h.RadioGroup,exports.Rate=y.Rate,exports.Select=i.Select,exports.Slider=v.Slider,exports.Switch=g.Switch,exports.TimePicker=o.t,exports.Transfer=Y.Transfer,exports.TreeSelect=s.TreeSelect,exports.Upload=X.Upload,exports.ValidationRules=A.ValidationRules,exports.createFieldValidator=A.createFieldValidator,exports.hasUsableValue=n.hasUsableValue,exports.shouldShowClear=n.shouldShowClear;
|
package/dist-lib/forms/index.js
CHANGED
|
@@ -3,7 +3,7 @@ import { Form as t, FormBase as n } from "./Form.js";
|
|
|
3
3
|
import { hasUsableValue as r, shouldShowClear as i } from "./clearUtils.js";
|
|
4
4
|
import { FieldShell as a } from "./FieldShell.js";
|
|
5
5
|
import { Select as o } from "./Select.js";
|
|
6
|
-
import { n as s, t as c } from "../DatePicker-
|
|
6
|
+
import { n as s, t as c } from "../DatePicker-LXjOxVN5.js";
|
|
7
7
|
import { t as l } from "../TimePicker-BgaELcl_.js";
|
|
8
8
|
import { TreeSelect as u } from "./TreeSelect.js";
|
|
9
9
|
import { Input as d, InputOTP as f, InputSearch as p, InputTextArea as m } from "./Input.js";
|
|
@@ -37,7 +37,7 @@ import { ClearableTimePicker as H } from "./ClearableTimePicker.js";
|
|
|
37
37
|
import { ClearableTreeSelect as U } from "./ClearableTreeSelect.js";
|
|
38
38
|
import { Cascader as W } from "./Cascader.js";
|
|
39
39
|
import { ClearableCascader as G } from "./ClearableCascader.js";
|
|
40
|
-
import { t as K } from "../AutoComplete-
|
|
40
|
+
import { t as K } from "../AutoComplete-CCYcFqfs.js";
|
|
41
41
|
import { ClearableAutoComplete as q } from "./ClearableAutoComplete.js";
|
|
42
42
|
import { ClearableMentions as J } from "./ClearableMentions.js";
|
|
43
43
|
import { ClearableCheckbox as Y } from "./ClearableCheckbox.js";
|
package/dist-lib/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./forms/Button.cjs`),t=require(`./forms/Form.cjs`),n=require(`./forms/clearUtils.cjs`),r=require(`./forms/FieldShell.cjs`),i=require(`./forms/Select.cjs`),a=require(`./DatePicker-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./forms/Button.cjs`),t=require(`./forms/Form.cjs`),n=require(`./forms/clearUtils.cjs`),r=require(`./forms/FieldShell.cjs`),i=require(`./forms/Select.cjs`),a=require(`./DatePicker-CQgt-WoB.cjs`),o=require(`./TimePicker-D4iKsUck.cjs`),s=require(`./forms/TreeSelect.cjs`),c=require(`./forms/Input.cjs`),ee=require(`./forms/PasswordInput.cjs`),te=require(`./InputNumber-X-VvOKNc.cjs`),ne=require(`./forms/Checkbox.cjs`),l=require(`./forms/FieldSetShell.cjs`),u=require(`./forms/CheckboxGroup.cjs`),d=require(`./forms/Radio.cjs`),f=require(`./forms/RadioGroup.cjs`),p=require(`./forms/Switch.cjs`),m=require(`./forms/Mentions.cjs`),h=require(`./forms/Slider.cjs`),g=require(`./forms/Rate.cjs`),_=require(`./forms/ColorPicker.cjs`),v=require(`./forms/AccessiblePasswordInput.cjs`),y=require(`./forms/AccessibleCheckboxGroup.cjs`),b=require(`./forms/AccessibleRadioGroup.cjs`),x=require(`./forms/AccessibleSwitch.cjs`),S=require(`./forms/AccessibleSelect.cjs`),C=require(`./forms/AccessibleDatePicker.cjs`),w=require(`./forms/FormError.cjs`),T=require(`./forms/FormSuccess.cjs`),E=require(`./forms/FormWarning.cjs`),D=require(`./forms/validation.cjs`),O=require(`./forms/ClearableInput.cjs`),k=require(`./forms/ClearableSelect.cjs`),A=require(`./forms/ClearableDatePicker.cjs`),j=require(`./forms/ClearableInputNumber.cjs`),M=require(`./forms/ClearableTimePicker.cjs`),N=require(`./forms/ClearableTreeSelect.cjs`),P=require(`./forms/Cascader.cjs`),F=require(`./forms/ClearableCascader.cjs`),I=require(`./AutoComplete-C9LcpBRs.cjs`),L=require(`./forms/ClearableAutoComplete.cjs`),R=require(`./forms/ClearableMentions.cjs`),z=require(`./forms/ClearableCheckbox.cjs`),B=require(`./forms/ClearableRadio.cjs`),V=require(`./forms/ClearableRadioGroup.cjs`),H=require(`./forms/ClearableSwitch.cjs`),U=require(`./forms/ClearableSlider.cjs`),W=require(`./forms/ClearableRate.cjs`),G=require(`./forms/ClearableColorPicker.cjs`),K=require(`./forms/ClearableTransfer.cjs`),q=require(`./forms/ClearableUpload.cjs`),J=require(`./navigation/Breadcrumb.cjs`),re=require(`./navigation/Anchor.cjs`),Y=require(`./display/Tooltip.cjs`),X=require(`./navigation/Pagination.cjs`),ie=require(`./Steps-Dhq_inin.cjs`),ae=require(`./navigation/Tabs.cjs`),oe=require(`./Dropdown-BU7v5Q4i.cjs`),se=require(`./navigation/Menu.cjs`);require(`./navigation/index.cjs`);const ce=require(`./display/Badge.cjs`),le=require(`./display/Empty.cjs`),Z=require(`./display/Icon.cjs`),ue=require(`./display/Tag.cjs`),de=require(`./display/List.cjs`),fe=require(`./display/Descriptions.cjs`),pe=require(`./display/Statistic.cjs`),me=require(`./display/Typography.cjs`),he=require(`./display/Avatar.cjs`),ge=require(`./display/Tree.cjs`),_e=require(`./display/Timeline.cjs`),ve=require(`./display/Segmented.cjs`),ye=require(`./display/Calendar.cjs`),be=require(`./display/Table.cjs`),xe=require(`./display/Popover.cjs`),Se=require(`./display/Collapse.cjs`),Ce=require(`./display/Card.cjs`),we=require(`./display/Image.cjs`),Te=require(`./feedback/Modal.cjs`),Q=require(`./feedback/Message.cjs`),$=require(`./feedback/Notification.cjs`),Ee=require(`./feedback/Popconfirm.cjs`),De=require(`./feedback/Spin.cjs`),Oe=require(`./feedback/FloatButton.cjs`),ke=require(`./feedback/Drawer.cjs`),Ae=require(`./feedback/Progress.cjs`),je=require(`./feedback/Skeleton.cjs`),Me=require(`./feedback/Result.cjs`),Ne=require(`./feedback/Tour.cjs`);require(`./feedback/index.cjs`),exports.AccessibleCheckboxGroup=y.AccessibleCheckboxGroup,exports.AccessibleDatePicker=C.AccessibleDatePicker,exports.AccessiblePasswordInput=v.AccessiblePasswordInput,exports.AccessibleRadioGroup=b.AccessibleRadioGroup,exports.AccessibleSelect=S.AccessibleSelect,exports.AccessibleSwitch=x.AccessibleSwitch,exports.Anchor=re.Anchor,exports.AutoComplete=I.t,exports.Avatar=he.Avatar,exports.Badge=ce.Badge,exports.Breadcrumb=J.Breadcrumb,exports.Button=e.Button,exports.Calendar=ye.Calendar,exports.Card=Ce.Card,exports.Cascader=P.Cascader,exports.Checkbox=ne.Checkbox,exports.CheckboxGroup=u.CheckboxGroup,exports.ClearableAutoComplete=L.ClearableAutoComplete,exports.ClearableCascader=F.ClearableCascader,exports.ClearableCheckbox=z.ClearableCheckbox,exports.ClearableColorPicker=G.ClearableColorPicker,exports.ClearableDatePicker=A.ClearableDatePicker,exports.ClearableInput=O.ClearableInput,exports.ClearableInputNumber=j.ClearableInputNumber,exports.ClearableMentions=R.ClearableMentions,exports.ClearableRadio=B.ClearableRadio,exports.ClearableRadioGroup=V.ClearableRadioGroup,exports.ClearableRate=W.ClearableRate,exports.ClearableSelect=k.ClearableSelect,exports.ClearableSlider=U.ClearableSlider,exports.ClearableSwitch=H.ClearableSwitch,exports.ClearableTimePicker=M.ClearableTimePicker,exports.ClearableTransfer=K.ClearableTransfer,exports.ClearableTreeSelect=N.ClearableTreeSelect,exports.ClearableUpload=q.ClearableUpload,exports.Collapse=Se.Collapse,exports.ColorPicker=_.ColorPicker,exports.DS_DATE_FORMAT=a.t,exports.DS_ICON_GROUPS=Z.DS_ICON_GROUPS,exports.DS_ICON_NAMES=Z.DS_ICON_NAMES,exports.DS_STATUS_ICON_MAP=Z.DS_STATUS_ICON_MAP,exports.DatePicker=a.n,exports.Descriptions=fe.Descriptions,exports.Drawer=ke.Drawer,exports.Dropdown=oe.t,exports.Empty=le.Empty,exports.FieldSetShell=l.FieldSetShell,exports.FieldShell=r.FieldShell,exports.FloatButton=Oe.FloatButton,exports.Form=t.Form,exports.FormBase=t.FormBase,exports.FormError=w.FormError,exports.FormSuccess=T.FormSuccess,exports.FormWarning=E.FormWarning,exports.Icon=Z.Icon,exports.Image=we.Image,exports.Input=c.Input,exports.InputNumber=te.t,exports.InputOTP=c.InputOTP,exports.InputSearch=c.InputSearch,exports.InputTextArea=c.InputTextArea,exports.List=de.List,exports.Mentions=m.Mentions,exports.Menu=se.Menu,exports.Modal=Te.Modal,exports.Pagination=X.Pagination,exports.PasswordInput=ee.PasswordInput,exports.Popconfirm=Ee.Popconfirm,exports.Popover=xe.Popover,exports.Progress=Ae.Progress,exports.Radio=d.Radio,exports.RadioGroup=f.RadioGroup,exports.Rate=g.Rate,exports.Result=Me.Result,exports.Segmented=ve.Segmented,exports.Select=i.Select,exports.Skeleton=je.Skeleton,exports.Slider=h.Slider,exports.Spin=De.Spin,exports.Statistic=pe.Statistic,exports.Steps=ie.t,exports.Switch=p.Switch,exports.Table=be.Table,exports.Tabs=ae.Tabs,exports.Tag=ue.Tag,exports.TimePicker=o.t,exports.Timeline=_e.Timeline,exports.Tooltip=Y.Tooltip,exports.Tour=Ne.Tour,exports.Transfer=K.Transfer,exports.Tree=ge.Tree,exports.TreeSelect=s.TreeSelect,exports.Typography=me.Typography,exports.Upload=q.Upload,exports.ValidationRules=D.ValidationRules,exports.createFieldValidator=D.createFieldValidator,exports.ensureTooltipStyles=Y.ensureTooltipStyles,exports.hasUsableValue=n.hasUsableValue,exports.messageDS=Q.messageDS,exports.notificationDS=$.notificationDS,exports.shouldShowClear=n.shouldShowClear,exports.useMessage=Q.useMessage,exports.useNotification=$.useNotification;
|
package/dist-lib/index.js
CHANGED
|
@@ -3,7 +3,7 @@ import { Form as t, FormBase as n } from "./forms/Form.js";
|
|
|
3
3
|
import { hasUsableValue as r, shouldShowClear as i } from "./forms/clearUtils.js";
|
|
4
4
|
import { FieldShell as a } from "./forms/FieldShell.js";
|
|
5
5
|
import { Select as o } from "./forms/Select.js";
|
|
6
|
-
import { n as s, t as c } from "./DatePicker-
|
|
6
|
+
import { n as s, t as c } from "./DatePicker-LXjOxVN5.js";
|
|
7
7
|
import { t as l } from "./TimePicker-BgaELcl_.js";
|
|
8
8
|
import { TreeSelect as u } from "./forms/TreeSelect.js";
|
|
9
9
|
import { Input as d, InputOTP as f, InputSearch as p, InputTextArea as m } from "./forms/Input.js";
|
|
@@ -37,7 +37,7 @@ import { ClearableTimePicker as H } from "./forms/ClearableTimePicker.js";
|
|
|
37
37
|
import { ClearableTreeSelect as U } from "./forms/ClearableTreeSelect.js";
|
|
38
38
|
import { Cascader as W } from "./forms/Cascader.js";
|
|
39
39
|
import { ClearableCascader as G } from "./forms/ClearableCascader.js";
|
|
40
|
-
import { t as K } from "./AutoComplete-
|
|
40
|
+
import { t as K } from "./AutoComplete-CCYcFqfs.js";
|
|
41
41
|
import { ClearableAutoComplete as q } from "./forms/ClearableAutoComplete.js";
|
|
42
42
|
import { ClearableMentions as J } from "./forms/ClearableMentions.js";
|
|
43
43
|
import { ClearableCheckbox as Y } from "./forms/ClearableCheckbox.js";
|