@adapttable/element-plus 0.2.0 → 0.3.1
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/ElementCheckbox-BQN4_eas.js.map +1 -1
- package/dist/ElementCheckbox-BewKx6sv.cjs.map +1 -1
- package/dist/{ElementFilterHeaderRow-CR1aax4I.cjs → ElementFilterHeaderRow-C3N5F-sW.cjs} +2 -2
- package/dist/{ElementFilterHeaderRow-CR1aax4I.cjs.map → ElementFilterHeaderRow-C3N5F-sW.cjs.map} +1 -1
- package/dist/{ElementFilterHeaderRow-CjduRYN5.js → ElementFilterHeaderRow-qiv68upK.js} +2 -2
- package/dist/{ElementFilterHeaderRow-CjduRYN5.js.map → ElementFilterHeaderRow-qiv68upK.js.map} +1 -1
- package/dist/{ElementFilterSurface-B8Fo3hPb.cjs → ElementFilterSurface-CUpyLfPF.cjs} +2 -2
- package/dist/{ElementFilterSurface-B8Fo3hPb.cjs.map → ElementFilterSurface-CUpyLfPF.cjs.map} +1 -1
- package/dist/{ElementFilterSurface-BR_nBvZU.js → ElementFilterSurface-CztEiJ0k.js} +2 -2
- package/dist/{ElementFilterSurface-BR_nBvZU.js.map → ElementFilterSurface-CztEiJ0k.js.map} +1 -1
- package/dist/{ElementSelect-Cl5ZjuQM.js → ElementSelect-BtmVMA7B.js} +6 -2
- package/dist/ElementSelect-BtmVMA7B.js.map +1 -0
- package/dist/{ElementSelect-K1rRvu5q.cjs → ElementSelect-CvGw_zHh.cjs} +6 -2
- package/dist/ElementSelect-CvGw_zHh.cjs.map +1 -0
- package/dist/{assistant-BcVKhdKt.cjs → assistant-B27ZguV8.cjs} +3 -2
- package/dist/assistant-B27ZguV8.cjs.map +1 -0
- package/dist/{assistant-Dv4a3KEk.js → assistant-BPwGaQnx.js} +3 -2
- package/dist/assistant-BPwGaQnx.js.map +1 -0
- package/dist/assistant.cjs +1 -1
- package/dist/assistant.js +1 -1
- package/dist/batch-editing.cjs +1 -1
- package/dist/batch-editing.js +1 -1
- package/dist/{column-menu-CtaKQS3b.cjs → column-menu-CNxXJ-ra.cjs} +2 -2
- package/dist/{column-menu-CtaKQS3b.cjs.map → column-menu-CNxXJ-ra.cjs.map} +1 -1
- package/dist/{column-menu-C6gwlyUQ.js → column-menu-Dna4oiPc.js} +2 -2
- package/dist/{column-menu-C6gwlyUQ.js.map → column-menu-Dna4oiPc.js.map} +1 -1
- package/dist/column-menu.cjs +1 -1
- package/dist/column-menu.js +1 -1
- package/dist/density-Bj1pck4x.cjs.map +1 -1
- package/dist/density-ChRp0NG3.js.map +1 -1
- package/dist/{editing-BMtWRqqJ.cjs → editing-9371TGFz.cjs} +7 -3
- package/dist/editing-9371TGFz.cjs.map +1 -0
- package/dist/{editing-CohAxA65.js → editing-B_HAxfh4.js} +7 -3
- package/dist/editing-B_HAxfh4.js.map +1 -0
- package/dist/editing.cjs +1 -1
- package/dist/editing.js +1 -1
- package/dist/features.cjs +8 -8
- package/dist/features.js +8 -8
- package/dist/{filters-DD-qeRIb.js → filters-BMS9STAJ.js} +3 -3
- package/dist/{filters-DD-qeRIb.js.map → filters-BMS9STAJ.js.map} +1 -1
- package/dist/{filters-2G3MfNF7.cjs → filters-BuzAGNaj.cjs} +3 -3
- package/dist/{filters-2G3MfNF7.cjs.map → filters-BuzAGNaj.cjs.map} +1 -1
- package/dist/filters.cjs +2 -2
- package/dist/filters.js +2 -2
- package/dist/{grouping-panel-B9AcU8lx.cjs → grouping-panel-C_QWRh_Q.cjs} +2 -2
- package/dist/{grouping-panel-B9AcU8lx.cjs.map → grouping-panel-C_QWRh_Q.cjs.map} +1 -1
- package/dist/{grouping-panel-B8gWD_90.js → grouping-panel-CscefKyP.js} +2 -2
- package/dist/{grouping-panel-B8gWD_90.js.map → grouping-panel-CscefKyP.js.map} +1 -1
- package/dist/grouping-panel.cjs +1 -1
- package/dist/grouping-panel.js +1 -1
- package/dist/{header-filters-D71v75Us.cjs → header-filters-BDSKDeJ9.cjs} +2 -2
- package/dist/{header-filters-D71v75Us.cjs.map → header-filters-BDSKDeJ9.cjs.map} +1 -1
- package/dist/{header-filters-Chknfchw.js → header-filters-FQFlnVM9.js} +2 -2
- package/dist/{header-filters-Chknfchw.js.map → header-filters-FQFlnVM9.js.map} +1 -1
- package/dist/header-filters.cjs +2 -2
- package/dist/header-filters.js +2 -2
- package/dist/index.cjs +15 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +15 -3
- package/dist/index.js.map +1 -1
- package/dist/pivot.cjs +1 -1
- package/dist/pivot.js +1 -1
- package/dist/preset.cjs +3 -3
- package/dist/preset.js +3 -3
- package/dist/styles.css +89 -0
- package/package.json +4 -4
- package/dist/ElementSelect-Cl5ZjuQM.js.map +0 -1
- package/dist/ElementSelect-K1rRvu5q.cjs.map +0 -1
- package/dist/assistant-BcVKhdKt.cjs.map +0 -1
- package/dist/assistant-Dv4a3KEk.js.map +0 -1
- package/dist/editing-BMtWRqqJ.cjs.map +0 -1
- package/dist/editing-CohAxA65.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ElementCheckbox-BQN4_eas.js","names":["$attrs"],"sources":["../src/controls/ElementCheckbox.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { useElementRef, useScopeActivity } from \"@adapttable/vue/adapter\";\nimport { type CheckboxInstance, ElCheckbox } from \"element-plus\";\nimport { computed, nextTick, shallowRef, watch } from \"vue\";\n\ndefineOptions({ inheritAttrs: false });\nconst props = withDefaults(\n defineProps<{\n checked: boolean;\n indeterminate?: boolean;\n disabled?: boolean;\n readonly?: boolean;\n label: string;\n labelVisible?: boolean;\n inputRef?: (element: HTMLInputElement | null) => void;\n }>(),\n {\n indeterminate: false,\n disabled: false,\n readonly: false,\n labelVisible: false,\n inputRef: undefined,\n }\n);\nconst emit = defineEmits<{ change: [checked: boolean] }>();\nconst active = useScopeActivity();\nlet ownerGeneration = 0;\nconst control = shallowRef<CheckboxInstance>();\nconst input = computed((): HTMLInputElement | null => {\n const host: unknown = control.value?.$el;\n if (host == null) return null;\n if (!(host instanceof HTMLLabelElement))\n throw new Error(\n \"AdaptTable: Element Plus checkbox must render its associated label host.\"\n );\n const field = host.control;\n if (!(field instanceof HTMLInputElement))\n throw new Error(\n \"AdaptTable: Element Plus checkbox label must own an input.\"\n );\n return field;\n});\nuseElementRef(\n () => input.value,\n () => props.inputRef\n);\nfunction reconcile(\n field = input.value,\n owner = props.inputRef,\n generation = ownerGeneration\n): void {\n // A replacement control or activity session owns its own reconciliation.\n void nextTick(() => {\n if (\n !field ||\n !active.value ||\n generation !== ownerGeneration ||\n input.value !== field ||\n props.inputRef !== owner ||\n !field.isConnected\n )\n return;\n field.checked = props.checked;\n field.indeterminate = props.indeterminate;\n });\n}\nwatch(\n [active, input, () => props.inputRef],\n () => {\n ownerGeneration += 1;\n if (active.value) reconcile();\n },\n { flush: \"sync\" }\n);\nfunction requestChange(value: unknown): void {\n if (\n !active.value ||\n props.disabled ||\n props.readonly ||\n typeof value !== \"boolean\"\n )\n return;\n const field = input.value;\n const owner = props.inputRef;\n const generation = ownerGeneration;\n emit(\"change\", value);\n // Let native activation finish before reconciling the controlled state.\n reconcile(field, owner, generation);\n}\ndefineExpose({ input, focus: () => input.value?.focus() });\n</script>\n\n<template>\n <ElCheckbox\n ref=\"control\"\n v-bind=\"$attrs\"\n :model-value=\"props.checked\"\n :indeterminate=\"props.indeterminate\"\n :disabled=\"props.disabled || props.readonly\"\n :validate-event=\"false\"\n @update:model-value=\"requestChange\"\n >\n <span\n :class=\"{\n 'adapttable-element-plus-visually-hidden': !props.labelVisible,\n }\"\n >{{ props.label }}</span\n >\n </ElCheckbox>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAMA,MAAM,QAAQ;EAkBd,MAAM,OAAO;EACb,MAAM,SAAS,iBAAiB;EAChC,IAAI,kBAAkB;EACtB,MAAM,UAAU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M,
|
|
1
|
+
{"version":3,"file":"ElementCheckbox-BQN4_eas.js","names":["$attrs"],"sources":["../src/controls/ElementCheckbox.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { useElementRef, useScopeActivity } from \"@adapttable/vue/adapter\";\nimport { type CheckboxInstance, ElCheckbox } from \"element-plus\";\nimport { computed, nextTick, shallowRef, watch } from \"vue\";\n\ndefineOptions({ inheritAttrs: false });\nconst props = withDefaults(\n defineProps<{\n checked: boolean;\n indeterminate?: boolean;\n disabled?: boolean;\n readonly?: boolean;\n label: string;\n labelVisible?: boolean;\n inputRef?: (element: HTMLInputElement | null) => void;\n }>(),\n {\n indeterminate: false,\n disabled: false,\n readonly: false,\n labelVisible: false,\n inputRef: undefined,\n }\n);\nconst emit = defineEmits<{ change: [checked: boolean] }>();\nconst active = useScopeActivity();\nlet ownerGeneration = 0;\nconst control = shallowRef<CheckboxInstance>();\nconst input = computed((): HTMLInputElement | null => {\n const host: unknown = control.value?.$el;\n if (host == null) return null;\n if (!(host instanceof HTMLLabelElement))\n throw new Error(\n \"AdaptTable: Element Plus checkbox must render its associated label host.\"\n );\n const field = host.control;\n if (!(field instanceof HTMLInputElement))\n throw new Error(\n \"AdaptTable: Element Plus checkbox label must own an input.\"\n );\n return field;\n});\nuseElementRef(\n () => input.value,\n () => props.inputRef\n);\nfunction reconcile(\n field = input.value,\n owner = props.inputRef,\n generation = ownerGeneration\n): void {\n // A replacement control or activity session owns its own reconciliation.\n void nextTick(() => {\n if (\n !field ||\n !active.value ||\n generation !== ownerGeneration ||\n input.value !== field ||\n props.inputRef !== owner ||\n !field.isConnected\n )\n return;\n field.checked = props.checked;\n field.indeterminate = props.indeterminate;\n });\n}\nwatch(\n [active, input, () => props.inputRef],\n () => {\n ownerGeneration += 1;\n if (active.value) reconcile();\n },\n { flush: \"sync\" }\n);\nfunction requestChange(value: unknown): void {\n if (\n !active.value ||\n props.disabled ||\n props.readonly ||\n typeof value !== \"boolean\"\n )\n return;\n const field = input.value;\n const owner = props.inputRef;\n const generation = ownerGeneration;\n emit(\"change\", value);\n // Let native activation finish before reconciling the controlled state.\n reconcile(field, owner, generation);\n}\ndefineExpose({ input, focus: () => input.value?.focus() });\n</script>\n\n<template>\n <ElCheckbox\n ref=\"control\"\n v-bind=\"$attrs\"\n :model-value=\"props.checked\"\n :indeterminate=\"props.indeterminate\"\n :disabled=\"props.disabled || props.readonly\"\n :validate-event=\"false\"\n @update:model-value=\"requestChange\"\n >\n <span\n :class=\"{\n 'adapttable-element-plus-visually-hidden': !props.labelVisible,\n }\"\n >{{ props.label }}</span\n >\n </ElCheckbox>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAMA,MAAM,QAAQ;EAkBd,MAAM,OAAO;EACb,MAAM,SAAS,iBAAiB;EAChC,IAAI,kBAAkB;EACtB,MAAM,UAAU,WAA6B;EAC7C,MAAM,QAAQ,eAAwC;GACpD,MAAM,OAAgB,QAAQ,OAAO;GACrC,IAAI,QAAQ,MAAM,OAAO;GACzB,IAAI,EAAE,gBAAgB,mBACpB,MAAM,IAAI,MACR,0EACF;GACF,MAAM,QAAQ,KAAK;GACnB,IAAI,EAAE,iBAAiB,mBACrB,MAAM,IAAI,MACR,4DACF;GACF,OAAO;EACT,CAAC;EACD,oBACQ,MAAM,aACN,MAAM,QACd;EACA,SAAS,UACP,QAAQ,MAAM,OACd,QAAQ,MAAM,UACd,aAAa,iBACP;GAEN,eAAoB;IAClB,IACE,CAAC,SACD,CAAC,OAAO,SACR,eAAe,mBACf,MAAM,UAAU,SAChB,MAAM,aAAa,SACnB,CAAC,MAAM,aAEP;IACF,MAAM,UAAU,MAAM;IACtB,MAAM,gBAAgB,MAAM;GAC9B,CAAC;EACH;EACA,MACE;GAAC;GAAQ;SAAa,MAAM;EAAQ,SAC9B;GACJ,mBAAmB;GACnB,IAAI,OAAO,OAAO,UAAU;EAC9B,GACA,EAAE,OAAO,OAAO,CAClB;EACA,SAAS,cAAc,OAAsB;GAC3C,IACE,CAAC,OAAO,SACR,MAAM,YACN,MAAM,YACN,OAAO,UAAU,WAEjB;GACF,MAAM,QAAQ,MAAM;GACpB,MAAM,QAAQ,MAAM;GACpB,MAAM,aAAa;GACnB,KAAK,UAAU,KAAK;GAEpB,UAAU,OAAO,OAAO,UAAU;EACpC;EACA,SAAa;GAAE;GAAO,aAAa,MAAM,OAAO,MAAM;EAAE,CAAC;;GAIvD,OAAA,UAAA,GAAA,YAea,MAAA,UAAA,GAfb,WAea;IAdP,SAAA;IAAJ,KAAI;GACIA,GAAAA,KAAAA,QAAM;IACb,eAAa,MAAM;IACnB,eAAe,MAAM;IACrB,UAAU,MAAM,YAAY,MAAM;IAClC,kBAAgB;IAChB,uBAAoB;;IAErB,SAAA,cAKC,CALD,mBAKC,QAAA,EAJE,OAAK,eAAA,EAAwD,2CAAA,CAAA,MAAM,a,C,EAGhE,GAAA,gBAAA,MAAM,KAAK,GAAA,CAAA,C,C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ElementCheckbox-BewKx6sv.cjs","names":["$attrs"],"sources":["../src/controls/ElementCheckbox.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { useElementRef, useScopeActivity } from \"@adapttable/vue/adapter\";\nimport { type CheckboxInstance, ElCheckbox } from \"element-plus\";\nimport { computed, nextTick, shallowRef, watch } from \"vue\";\n\ndefineOptions({ inheritAttrs: false });\nconst props = withDefaults(\n defineProps<{\n checked: boolean;\n indeterminate?: boolean;\n disabled?: boolean;\n readonly?: boolean;\n label: string;\n labelVisible?: boolean;\n inputRef?: (element: HTMLInputElement | null) => void;\n }>(),\n {\n indeterminate: false,\n disabled: false,\n readonly: false,\n labelVisible: false,\n inputRef: undefined,\n }\n);\nconst emit = defineEmits<{ change: [checked: boolean] }>();\nconst active = useScopeActivity();\nlet ownerGeneration = 0;\nconst control = shallowRef<CheckboxInstance>();\nconst input = computed((): HTMLInputElement | null => {\n const host: unknown = control.value?.$el;\n if (host == null) return null;\n if (!(host instanceof HTMLLabelElement))\n throw new Error(\n \"AdaptTable: Element Plus checkbox must render its associated label host.\"\n );\n const field = host.control;\n if (!(field instanceof HTMLInputElement))\n throw new Error(\n \"AdaptTable: Element Plus checkbox label must own an input.\"\n );\n return field;\n});\nuseElementRef(\n () => input.value,\n () => props.inputRef\n);\nfunction reconcile(\n field = input.value,\n owner = props.inputRef,\n generation = ownerGeneration\n): void {\n // A replacement control or activity session owns its own reconciliation.\n void nextTick(() => {\n if (\n !field ||\n !active.value ||\n generation !== ownerGeneration ||\n input.value !== field ||\n props.inputRef !== owner ||\n !field.isConnected\n )\n return;\n field.checked = props.checked;\n field.indeterminate = props.indeterminate;\n });\n}\nwatch(\n [active, input, () => props.inputRef],\n () => {\n ownerGeneration += 1;\n if (active.value) reconcile();\n },\n { flush: \"sync\" }\n);\nfunction requestChange(value: unknown): void {\n if (\n !active.value ||\n props.disabled ||\n props.readonly ||\n typeof value !== \"boolean\"\n )\n return;\n const field = input.value;\n const owner = props.inputRef;\n const generation = ownerGeneration;\n emit(\"change\", value);\n // Let native activation finish before reconciling the controlled state.\n reconcile(field, owner, generation);\n}\ndefineExpose({ input, focus: () => input.value?.focus() });\n</script>\n\n<template>\n <ElCheckbox\n ref=\"control\"\n v-bind=\"$attrs\"\n :model-value=\"props.checked\"\n :indeterminate=\"props.indeterminate\"\n :disabled=\"props.disabled || props.readonly\"\n :validate-event=\"false\"\n @update:model-value=\"requestChange\"\n >\n <span\n :class=\"{\n 'adapttable-element-plus-visually-hidden': !props.labelVisible,\n }\"\n >{{ props.label }}</span\n >\n </ElCheckbox>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAMA,MAAM,QAAQ;EAkBd,MAAM,OAAO;EACb,MAAM,UAAA,GAAS,wBAAA,iBAAA,CAAiB;EAChC,IAAI,kBAAkB;EACtB,MAAM,WAAA,GAAU,IAAA,WAAA,CAA6B;EAC7C,MAAM,SAAA,GAAQ,IAAA,SAA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M,YAAY,MAAM;IAClC,kBAAgB;IAChB,uBAAoB;;IAErB,UAAA,GAAA,IAAA,QAAA,OAKC,EAAA,GALD,IAAA,mBAAA,CAKC,QAAA,EAJE,QAAA,GAAK,IAAA,eAAA,CAAA,EAAwD,2CAAA,CAAA,MAAM,
|
|
1
|
+
{"version":3,"file":"ElementCheckbox-BewKx6sv.cjs","names":["$attrs"],"sources":["../src/controls/ElementCheckbox.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { useElementRef, useScopeActivity } from \"@adapttable/vue/adapter\";\nimport { type CheckboxInstance, ElCheckbox } from \"element-plus\";\nimport { computed, nextTick, shallowRef, watch } from \"vue\";\n\ndefineOptions({ inheritAttrs: false });\nconst props = withDefaults(\n defineProps<{\n checked: boolean;\n indeterminate?: boolean;\n disabled?: boolean;\n readonly?: boolean;\n label: string;\n labelVisible?: boolean;\n inputRef?: (element: HTMLInputElement | null) => void;\n }>(),\n {\n indeterminate: false,\n disabled: false,\n readonly: false,\n labelVisible: false,\n inputRef: undefined,\n }\n);\nconst emit = defineEmits<{ change: [checked: boolean] }>();\nconst active = useScopeActivity();\nlet ownerGeneration = 0;\nconst control = shallowRef<CheckboxInstance>();\nconst input = computed((): HTMLInputElement | null => {\n const host: unknown = control.value?.$el;\n if (host == null) return null;\n if (!(host instanceof HTMLLabelElement))\n throw new Error(\n \"AdaptTable: Element Plus checkbox must render its associated label host.\"\n );\n const field = host.control;\n if (!(field instanceof HTMLInputElement))\n throw new Error(\n \"AdaptTable: Element Plus checkbox label must own an input.\"\n );\n return field;\n});\nuseElementRef(\n () => input.value,\n () => props.inputRef\n);\nfunction reconcile(\n field = input.value,\n owner = props.inputRef,\n generation = ownerGeneration\n): void {\n // A replacement control or activity session owns its own reconciliation.\n void nextTick(() => {\n if (\n !field ||\n !active.value ||\n generation !== ownerGeneration ||\n input.value !== field ||\n props.inputRef !== owner ||\n !field.isConnected\n )\n return;\n field.checked = props.checked;\n field.indeterminate = props.indeterminate;\n });\n}\nwatch(\n [active, input, () => props.inputRef],\n () => {\n ownerGeneration += 1;\n if (active.value) reconcile();\n },\n { flush: \"sync\" }\n);\nfunction requestChange(value: unknown): void {\n if (\n !active.value ||\n props.disabled ||\n props.readonly ||\n typeof value !== \"boolean\"\n )\n return;\n const field = input.value;\n const owner = props.inputRef;\n const generation = ownerGeneration;\n emit(\"change\", value);\n // Let native activation finish before reconciling the controlled state.\n reconcile(field, owner, generation);\n}\ndefineExpose({ input, focus: () => input.value?.focus() });\n</script>\n\n<template>\n <ElCheckbox\n ref=\"control\"\n v-bind=\"$attrs\"\n :model-value=\"props.checked\"\n :indeterminate=\"props.indeterminate\"\n :disabled=\"props.disabled || props.readonly\"\n :validate-event=\"false\"\n @update:model-value=\"requestChange\"\n >\n <span\n :class=\"{\n 'adapttable-element-plus-visually-hidden': !props.labelVisible,\n }\"\n >{{ props.label }}</span\n >\n </ElCheckbox>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAMA,MAAM,QAAQ;EAkBd,MAAM,OAAO;EACb,MAAM,UAAA,GAAS,wBAAA,iBAAA,CAAiB;EAChC,IAAI,kBAAkB;EACtB,MAAM,WAAA,GAAU,IAAA,WAAA,CAA6B;EAC7C,MAAM,SAAA,GAAQ,IAAA,SAAA,OAAwC;GACpD,MAAM,OAAgB,QAAQ,OAAO;GACrC,IAAI,QAAQ,MAAM,OAAO;GACzB,IAAI,EAAE,gBAAgB,mBACpB,MAAM,IAAI,MACR,0EACF;GACF,MAAM,QAAQ,KAAK;GACnB,IAAI,EAAE,iBAAiB,mBACrB,MAAM,IAAI,MACR,4DACF;GACF,OAAO;EACT,CAAC;EACD,CAAA,GAAA,wBAAA,cAAA,OACQ,MAAM,aACN,MAAM,QACd;EACA,SAAS,UACP,QAAQ,MAAM,OACd,QAAQ,MAAM,UACd,aAAa,iBACP;GAEN,CAAA,GAAK,IAAA,SAAA,OAAe;IAClB,IACE,CAAC,SACD,CAAC,OAAO,SACR,eAAe,mBACf,MAAM,UAAU,SAChB,MAAM,aAAa,SACnB,CAAC,MAAM,aAEP;IACF,MAAM,UAAU,MAAM;IACtB,MAAM,gBAAgB,MAAM;GAC9B,CAAC;EACH;EACA,CAAA,GAAA,IAAA,MAAA,CACE;GAAC;GAAQ;SAAa,MAAM;EAAQ,SAC9B;GACJ,mBAAmB;GACnB,IAAI,OAAO,OAAO,UAAU;EAC9B,GACA,EAAE,OAAO,OAAO,CAClB;EACA,SAAS,cAAc,OAAsB;GAC3C,IACE,CAAC,OAAO,SACR,MAAM,YACN,MAAM,YACN,OAAO,UAAU,WAEjB;GACF,MAAM,QAAQ,MAAM;GACpB,MAAM,QAAQ,MAAM;GACpB,MAAM,aAAa;GACnB,KAAK,UAAU,KAAK;GAEpB,UAAU,OAAO,OAAO,UAAU;EACpC;EACA,SAAa;GAAE;GAAO,aAAa,MAAM,OAAO,MAAM;EAAE,CAAC;;GAIvD,QAAA,GAAA,IAAA,UAAA,CAAA,IAAA,GAAA,IAAA,YAAA,EAAA,GAea,IAAA,MAAA,CAAA,aAAA,UAAA,IAAA,GAfb,IAAA,WAAA,CAea;IAdP,SAAA;IAAJ,KAAI;GACIA,GAAAA,KAAAA,QAAM;IACb,eAAa,MAAM;IACnB,eAAe,MAAM;IACrB,UAAU,MAAM,YAAY,MAAM;IAClC,kBAAgB;IAChB,uBAAoB;;IAErB,UAAA,GAAA,IAAA,QAAA,OAKC,EAAA,GALD,IAAA,mBAAA,CAKC,QAAA,EAJE,QAAA,GAAK,IAAA,eAAA,CAAA,EAAwD,2CAAA,CAAA,MAAM,a,C,EAGhE,IAAA,GAAA,IAAA,gBAAA,CAAA,MAAM,KAAK,GAAA,CAAA,C,C"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
const require_button = require("./button-BFjBL9m3.cjs");
|
|
2
2
|
const require_ElementCheckbox = require("./ElementCheckbox-BewKx6sv.cjs");
|
|
3
3
|
const require_ElementInput = require("./ElementInput-vBVDBaLp.cjs");
|
|
4
|
-
const require_ElementSelect = require("./ElementSelect-
|
|
4
|
+
const require_ElementSelect = require("./ElementSelect-CvGw_zHh.cjs");
|
|
5
5
|
let vue = require("vue");
|
|
6
6
|
let _adapttable_vue_adapter = require("@adapttable/vue/adapter");
|
|
7
7
|
let element_plus = require("element-plus");
|
|
@@ -199,4 +199,4 @@ Object.defineProperty(exports, "_sfc_main$1", {
|
|
|
199
199
|
}
|
|
200
200
|
});
|
|
201
201
|
|
|
202
|
-
//# sourceMappingURL=ElementFilterHeaderRow-
|
|
202
|
+
//# sourceMappingURL=ElementFilterHeaderRow-C3N5F-sW.cjs.map
|
package/dist/{ElementFilterHeaderRow-CR1aax4I.cjs.map → ElementFilterHeaderRow-C3N5F-sW.cjs.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ElementFilterHeaderRow-
|
|
1
|
+
{"version":3,"file":"ElementFilterHeaderRow-C3N5F-sW.cjs","names":[],"sources":["../src/filters/ElementFilterHeaderControl.vue","../src/filters/ElementFilterHeaderRow.vue"],"sourcesContent":["<script setup lang=\"ts\" generic=\"TRow\">\nimport {\n FilterHeaderControlChrome,\n type FilterHeaderControlOptions,\n type FilterHeaderSlots,\n FULLSCREEN_MODEL,\n useFeatureState,\n useFilterHeaderControl,\n useScopeActivity,\n} from \"@adapttable/vue/adapter\";\nimport { ElPopover, ElSpace, type PopoverInstance } from \"element-plus\";\nimport { computed, h, shallowRef } from \"vue\";\n\nimport { elementButton } from \"../controls/button\";\nimport ElementCheckbox from \"../controls/ElementCheckbox.vue\";\nimport ElementInput from \"../controls/ElementInput.vue\";\nimport ElementSelect from \"../controls/ElementSelect.vue\";\n\ndefineOptions({ name: \"ElementFilterHeaderControl\" });\nconst props = withDefaults(defineProps<FilterHeaderControlOptions<TRow>>(), {\n closeOnSelect: undefined,\n});\nconst model = useFilterHeaderControl(() => props);\nconst active = useScopeActivity();\nconst fullscreen = useFeatureState(FULLSCREEN_MODEL);\nconst popover = shallowRef<PopoverInstance>();\nconst trigger = shallowRef<HTMLElement | null>(null);\nconst inheritedDirection = shallowRef<\"ltr\" | \"rtl\">();\nconst popupDirection = computed(() => props.dir ?? inheritedDirection.value);\nconst setTrigger = (element: HTMLElement | null) => {\n trigger.value = element;\n};\nconst readInheritedDirection = () => {\n if (props.dir !== undefined || !trigger.value) return;\n const target = trigger.value;\n const direction =\n target.ownerDocument.defaultView?.getComputedStyle(target).direction;\n inheritedDirection.value =\n direction === \"rtl\" || direction === \"ltr\" ? direction : undefined;\n};\nconst dismiss = (event: KeyboardEvent) => {\n if (\n event.key !== \"Escape\" ||\n event.defaultPrevented ||\n event.isComposing ||\n trigger.value?.getAttribute(\"aria-expanded\") !== \"true\"\n )\n return;\n event.preventDefault();\n event.stopPropagation();\n popover.value?.hide();\n if (active.value && trigger.value?.isConnected) trigger.value.focus();\n};\nconst renderChoices = (control: Parameters<FilterHeaderSlots[\"Multi\"]>[0]) =>\n control.options.map((option) =>\n h(ElementCheckbox, {\n key: option.value,\n label: option.label,\n labelVisible: true,\n checked: control.selected.includes(option.value),\n onChange: (checked) => control.onToggle(option.value, checked),\n })\n );\nconst controls: FilterHeaderSlots = {\n Search: (control) =>\n h(ElementInput, {\n type: \"search\",\n dir: props.dir,\n value: control.value,\n \"data-adapttable-part\": \"filter-header-input\",\n \"aria-label\": control.label,\n placeholder: control.placeholder,\n class: control.className,\n onChange: control.onChange,\n }),\n Select: (control) =>\n h(ElementSelect, {\n value: control.value,\n dir: props.dir,\n options: control.options,\n \"data-adapttable-part\": \"filter-header-input\",\n \"aria-label\": control.label,\n class: control.className,\n onChange: control.onChange,\n }),\n Range: (control) =>\n h(ElementInput, {\n value: control.value,\n type: control.type,\n dir: props.dir,\n \"aria-label\": control.label,\n onChange: control.onChange,\n }),\n Multi: (control) =>\n h(\n ElPopover,\n {\n key: `${props.def.key}:${props.def.type}`,\n ref: popover,\n trigger: \"click\",\n role: \"dialog\",\n \"aria-label\": control.label,\n persistent: false,\n hideAfter: 0,\n teleported: true,\n appendTo: fullscreen.value?.container ?? \"body\",\n placement:\n popupDirection.value === \"rtl\" ? \"bottom-end\" : \"bottom-start\",\n popperStyle: { direction: popupDirection.value },\n onBeforeEnter: readInheritedDirection,\n width: \"auto\",\n },\n {\n reference: () =>\n elementButton(\n {\n ref: setTrigger,\n dir: props.dir,\n \"data-adapttable-part\": \"filter-header-input\",\n class: control.className,\n \"aria-label\": control.label,\n onKeydown: dismiss,\n },\n control.summary\n ),\n default: () =>\n h(\n ElSpace,\n {\n direction: \"vertical\",\n alignment: \"start\",\n role: \"group\",\n dir: popupDirection.value,\n \"data-adapttable-part\": \"filter-header-menu\",\n class: control.menuClassName,\n \"aria-label\": control.label,\n onKeydown: dismiss,\n style: { maxBlockSize: \"14rem\", overflow: \"auto\" },\n },\n {\n default: () => renderChoices(control),\n }\n ),\n }\n ),\n};\nconst Render = () =>\n FilterHeaderControlChrome({ model: model.value, controls });\nconst renderProps: string[] = [];\nRender.props = renderProps;\n</script>\n\n<template><Render /></template>\n","<script setup lang=\"ts\" generic=\"TRow\">\nimport {\n FilterHeaderChrome as FilterHeaderRowChrome,\n type FilterHeaderRowProps,\n type FilterHeaderRowSlots,\n} from \"@adapttable/vue/adapter\";\nimport { h } from \"vue\";\n\nimport ElementFilterHeaderControl from \"./ElementFilterHeaderControl.vue\";\n\ndefineOptions({ name: \"ElementFilterHeaderRow\" });\nconst props = withDefaults(defineProps<FilterHeaderRowProps<TRow>>(), {\n enabled: undefined,\n expandable: undefined,\n showReorder: undefined,\n selection: undefined,\n showActions: undefined,\n stickyAttr: undefined,\n});\nconst controls: FilterHeaderRowSlots<TRow> = {\n Control: (control) => h(ElementFilterHeaderControl<TRow>, { ...control }),\n};\nconst Render = () => FilterHeaderRowChrome({ ...props, controls });\nconst renderProps: string[] = [];\nRender.props = renderProps;\n</script>\n\n<template>\n <Render />\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;EAmBA,MAAM,QAAQ;EAGd,MAAM,SAAA,GA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AAO,MAAM;GAAO;EAAS,CAAC;EAE5D,OAAO,QAAQ,CAAA;;GAGL,QAAA,GAAA,IAAA,UAAA,CAAA,IAAA,GAAA,IAAA,YAAA,CAAU,MAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EC7IpB,MAAM,QAAQ;EAQd,MAAM,WAAuC,EAC3C,UAAU,aAAA,GAAY,IAAA,EAAA,CAAE,aAAkC,EAAE,GAAG,QAAQ,CAAC,EAC1E;EACA,MAAM,gBAAA,GAAe,wBAAA,mBAAA,CAAsB;GAAE,GAAG;GAAO;EAAS,CAAC;EAEjE,OAAO,QAAQ,CAAA;;GAIb,QAAA,GAAA,IAAA,UAAA,CAAA,IAAA,GAAA,IAAA,YAAA,CAAU,MAAA"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as elementButton } from "./button-DwB4UxI2.js";
|
|
2
2
|
import { t as _sfc_main$2 } from "./ElementCheckbox-BQN4_eas.js";
|
|
3
3
|
import { t as _sfc_main$3 } from "./ElementInput-BsoAvPfO.js";
|
|
4
|
-
import { t as _sfc_main$4 } from "./ElementSelect-
|
|
4
|
+
import { t as _sfc_main$4 } from "./ElementSelect-BtmVMA7B.js";
|
|
5
5
|
import { computed, createBlock, defineComponent, h, openBlock, shallowRef } from "vue";
|
|
6
6
|
import { FULLSCREEN_MODEL, FilterHeaderChrome, FilterHeaderControlChrome, useFeatureState, useFilterHeaderControl, useScopeActivity } from "@adapttable/vue/adapter";
|
|
7
7
|
import { ElPopover, ElSpace } from "element-plus";
|
|
@@ -188,4 +188,4 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
188
188
|
//#endregion
|
|
189
189
|
export { _sfc_main$1 as n, _sfc_main as t };
|
|
190
190
|
|
|
191
|
-
//# sourceMappingURL=ElementFilterHeaderRow-
|
|
191
|
+
//# sourceMappingURL=ElementFilterHeaderRow-qiv68upK.js.map
|
package/dist/{ElementFilterHeaderRow-CjduRYN5.js.map → ElementFilterHeaderRow-qiv68upK.js.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ElementFilterHeaderRow-
|
|
1
|
+
{"version":3,"file":"ElementFilterHeaderRow-qiv68upK.js","names":[],"sources":["../src/filters/ElementFilterHeaderControl.vue","../src/filters/ElementFilterHeaderRow.vue"],"sourcesContent":["<script setup lang=\"ts\" generic=\"TRow\">\nimport {\n FilterHeaderControlChrome,\n type FilterHeaderControlOptions,\n type FilterHeaderSlots,\n FULLSCREEN_MODEL,\n useFeatureState,\n useFilterHeaderControl,\n useScopeActivity,\n} from \"@adapttable/vue/adapter\";\nimport { ElPopover, ElSpace, type PopoverInstance } from \"element-plus\";\nimport { computed, h, shallowRef } from \"vue\";\n\nimport { elementButton } from \"../controls/button\";\nimport ElementCheckbox from \"../controls/ElementCheckbox.vue\";\nimport ElementInput from \"../controls/ElementInput.vue\";\nimport ElementSelect from \"../controls/ElementSelect.vue\";\n\ndefineOptions({ name: \"ElementFilterHeaderControl\" });\nconst props = withDefaults(defineProps<FilterHeaderControlOptions<TRow>>(), {\n closeOnSelect: undefined,\n});\nconst model = useFilterHeaderControl(() => props);\nconst active = useScopeActivity();\nconst fullscreen = useFeatureState(FULLSCREEN_MODEL);\nconst popover = shallowRef<PopoverInstance>();\nconst trigger = shallowRef<HTMLElement | null>(null);\nconst inheritedDirection = shallowRef<\"ltr\" | \"rtl\">();\nconst popupDirection = computed(() => props.dir ?? inheritedDirection.value);\nconst setTrigger = (element: HTMLElement | null) => {\n trigger.value = element;\n};\nconst readInheritedDirection = () => {\n if (props.dir !== undefined || !trigger.value) return;\n const target = trigger.value;\n const direction =\n target.ownerDocument.defaultView?.getComputedStyle(target).direction;\n inheritedDirection.value =\n direction === \"rtl\" || direction === \"ltr\" ? direction : undefined;\n};\nconst dismiss = (event: KeyboardEvent) => {\n if (\n event.key !== \"Escape\" ||\n event.defaultPrevented ||\n event.isComposing ||\n trigger.value?.getAttribute(\"aria-expanded\") !== \"true\"\n )\n return;\n event.preventDefault();\n event.stopPropagation();\n popover.value?.hide();\n if (active.value && trigger.value?.isConnected) trigger.value.focus();\n};\nconst renderChoices = (control: Parameters<FilterHeaderSlots[\"Multi\"]>[0]) =>\n control.options.map((option) =>\n h(ElementCheckbox, {\n key: option.value,\n label: option.label,\n labelVisible: true,\n checked: control.selected.includes(option.value),\n onChange: (checked) => control.onToggle(option.value, checked),\n })\n );\nconst controls: FilterHeaderSlots = {\n Search: (control) =>\n h(ElementInput, {\n type: \"search\",\n dir: props.dir,\n value: control.value,\n \"data-adapttable-part\": \"filter-header-input\",\n \"aria-label\": control.label,\n placeholder: control.placeholder,\n class: control.className,\n onChange: control.onChange,\n }),\n Select: (control) =>\n h(ElementSelect, {\n value: control.value,\n dir: props.dir,\n options: control.options,\n \"data-adapttable-part\": \"filter-header-input\",\n \"aria-label\": control.label,\n class: control.className,\n onChange: control.onChange,\n }),\n Range: (control) =>\n h(ElementInput, {\n value: control.value,\n type: control.type,\n dir: props.dir,\n \"aria-label\": control.label,\n onChange: control.onChange,\n }),\n Multi: (control) =>\n h(\n ElPopover,\n {\n key: `${props.def.key}:${props.def.type}`,\n ref: popover,\n trigger: \"click\",\n role: \"dialog\",\n \"aria-label\": control.label,\n persistent: false,\n hideAfter: 0,\n teleported: true,\n appendTo: fullscreen.value?.container ?? \"body\",\n placement:\n popupDirection.value === \"rtl\" ? \"bottom-end\" : \"bottom-start\",\n popperStyle: { direction: popupDirection.value },\n onBeforeEnter: readInheritedDirection,\n width: \"auto\",\n },\n {\n reference: () =>\n elementButton(\n {\n ref: setTrigger,\n dir: props.dir,\n \"data-adapttable-part\": \"filter-header-input\",\n class: control.className,\n \"aria-label\": control.label,\n onKeydown: dismiss,\n },\n control.summary\n ),\n default: () =>\n h(\n ElSpace,\n {\n direction: \"vertical\",\n alignment: \"start\",\n role: \"group\",\n dir: popupDirection.value,\n \"data-adapttable-part\": \"filter-header-menu\",\n class: control.menuClassName,\n \"aria-label\": control.label,\n onKeydown: dismiss,\n style: { maxBlockSize: \"14rem\", overflow: \"auto\" },\n },\n {\n default: () => renderChoices(control),\n }\n ),\n }\n ),\n};\nconst Render = () =>\n FilterHeaderControlChrome({ model: model.value, controls });\nconst renderProps: string[] = [];\nRender.props = renderProps;\n</script>\n\n<template><Render /></template>\n","<script setup lang=\"ts\" generic=\"TRow\">\nimport {\n FilterHeaderChrome as FilterHeaderRowChrome,\n type FilterHeaderRowProps,\n type FilterHeaderRowSlots,\n} from \"@adapttable/vue/adapter\";\nimport { h } from \"vue\";\n\nimport ElementFilterHeaderControl from \"./ElementFilterHeaderControl.vue\";\n\ndefineOptions({ name: \"ElementFilterHeaderRow\" });\nconst props = withDefaults(defineProps<FilterHeaderRowProps<TRow>>(), {\n enabled: undefined,\n expandable: undefined,\n showReorder: undefined,\n selection: undefined,\n showActions: undefined,\n stickyAttr: undefined,\n});\nconst controls: FilterHeaderRowSlots<TRow> = {\n Control: (control) => h(ElementFilterHeaderControl<TRow>, { ...control }),\n};\nconst Render = () => FilterHeaderRowChrome({ ...props, controls });\nconst renderProps: string[] = [];\nRender.props = renderProps;\n</script>\n\n<template>\n <Render />\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;EAmBA,MAAM,QAAQ;EAGd,MAAM,QAAQ,6BAA6B,KAAK;EAChD,MAAM,SAAS,iBAAiB;EAChC,MAAM,aAAa,gBAAgB,gBAAgB;EACnD,MAAM,UAAU,WAA4B;EAC5C,MAAM,UAAU,WAA+B,IAAI;EACnD,MAAM,qBAAqB,WAA0B;EACrD,MAAM,iBAAiB,eAAe,MAAM,OAAO,mBAAmB,KAAK;EAC3E,MAAM,cAAc,YAAgC;GAClD,QAAQ,QAAQ;EAClB;EACA,MAAM,+BAA+B;GACnC,IAAI,MAAM,QAAQ,KAAA,KAAa,CAAC,QAAQ,OAAO;GAC/C,MAAM,SAAS,QAAQ;GACvB,MAAM,YACJ,OAAO,cAAc,aAAa,iBAAiB,MAAM,CAAC,CAAC;G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e,UAAU,QAAQ,eAAe;IAClD,aAAa,EAAE,WAAW,eAAe,MAAM;IAC/C,eAAe;IACf,OAAO;GACT,GACA;IACE,iBACE,cACE;KACE,KAAK;KACL,KAAK,MAAM;KACX,wBAAwB;KACxB,OAAO,QAAQ;KACf,cAAc,QAAQ;KACtB,WAAW;IACb,GACA,QAAQ,OACV;IACF,eACE,EACE,SACA;KACE,WAAW;KACX,WAAW;KACX,MAAM;KACN,KAAK,eAAe;KACpB,wBAAwB;KACxB,OAAO,QAAQ;KACf,cAAc,QAAQ;KACtB,WAAW;KACX,OAAO;MAAE,cAAc;MAAS,UAAU;KAAO;IACnD,GACA,EACE,eAAe,cAAc,OAAO,EACtC,CACF;GACJ,CACF;EACJ;EACA,MAAM,eACJ,0BAA0B;GAAE,OAAO,MAAM;GAAO;EAAS,CAAC;EAE5D,OAAO,QAAQ,CAAA;;GAGL,OAAA,UAAA,GAAA,YAAU,MAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EC7IpB,MAAM,QAAQ;EAQd,MAAM,WAAuC,EAC3C,UAAU,YAAY,EAAE,aAAkC,EAAE,GAAG,QAAQ,CAAC,EAC1E;EACA,MAAM,eAAe,mBAAsB;GAAE,GAAG;GAAO;EAAS,CAAC;EAEjE,OAAO,QAAQ,CAAA;;GAIb,OAAA,UAAA,GAAA,YAAU,MAAA"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
const require_button = require("./button-BFjBL9m3.cjs");
|
|
2
2
|
const require_ElementCheckbox = require("./ElementCheckbox-BewKx6sv.cjs");
|
|
3
3
|
const require_ElementInput = require("./ElementInput-vBVDBaLp.cjs");
|
|
4
|
-
const require_ElementSelect = require("./ElementSelect-
|
|
4
|
+
const require_ElementSelect = require("./ElementSelect-CvGw_zHh.cjs");
|
|
5
5
|
const require_scrollbarGutter = require("./scrollbarGutter-B-QczwA9.cjs");
|
|
6
6
|
let vue = require("vue");
|
|
7
7
|
let _adapttable_vue_adapter = require("@adapttable/vue/adapter");
|
|
@@ -305,4 +305,4 @@ Object.defineProperty(exports, "_sfc_main", {
|
|
|
305
305
|
}
|
|
306
306
|
});
|
|
307
307
|
|
|
308
|
-
//# sourceMappingURL=ElementFilterSurface-
|
|
308
|
+
//# sourceMappingURL=ElementFilterSurface-CUpyLfPF.cjs.map
|
package/dist/{ElementFilterSurface-B8Fo3hPb.cjs.map → ElementFilterSurface-CUpyLfPF.cjs.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ElementFilterSurface-B8Fo3hPb.cjs","names":["h","ElementInput","ElementSelect","ElementCheckbox","h","ElementInput","elementButton","ElementCheckbox","ElText","defineComponent","useChecklistModel","ChecklistChrome","createVNode","defineComponent","shallowRef","useScopeActivity","useFeatureState","FULLSCREEN_MODEL","nextTick","h","ElDrawer","ElPopover","rtlScrollbarGutter","withDirectives","ElCard","ClickOutside"],"sources":["../src/filters/fieldControls.ts","../src/filters/ElementBasicFilterField.vue","../src/filters/ElementChecklistFilter.ts","../src/filters/ElementFilterField.vue","../src/filters/ElementFilterSurface.ts"],"sourcesContent":["import type {\n DataTableClassNames,\n FilterFieldSlots,\n} from \"@adapttable/vue/adapter\";\nimport { h } from \"vue\";\n\nimport ElementCheckbox from \"../controls/ElementCheckbox.vue\";\nimport ElementInput from \"../controls/ElementInput.vue\";\nimport ElementSelect from \"../controls/ElementSelect.vue\";\n\nexport function elementFilterControls(\n names: () => DataTableClassNames\n): FilterFieldSlots {\n return {\n Input: (control) =>\n h(ElementInput, {\n ...control.attrs,\n value: control.value,\n type: control.type,\n class: names().filterInput,\n onChange: control.onChange,\n }),\n Select: (control) =>\n h(ElementSelect, {\n ...control.attrs,\n value: control.value,\n options: control.options,\n class:\n control.attrs[\"data-adapttable-part\"] === \"filter-operator\"\n ? names().filterOperator\n : names().filterSelect,\n onChange: control.onChange,\n }),\n Checkbox: (control) =>\n h(ElementCheckbox, {\n ...control.attrs,\n checked: control.checked,\n label: control.label,\n labelVisible: true,\n class: names().filterCheckbox,\n onChange: control.onChange,\n }),\n };\n}\n","<script setup lang=\"ts\" generic=\"TRow\">\nimport {\n type DataTableClassNames,\n FilterFieldChrome,\n type FilterFieldOptions,\n useFilterField,\n} from \"@adapttable/vue/adapter\";\n\nimport { elementFilterControls } from \"./fieldControls\";\n\ndefineOptions({ name: \"ElementBasicFilterField\" });\nconst props = defineProps<\n FilterFieldOptions<TRow> & { classNames?: DataTableClassNames }\n>();\nconst model = useFilterField(() => props);\nconst controls = elementFilterControls(() => props.classNames ?? {});\nconst Render = () =>\n FilterFieldChrome({\n model: model.value,\n controls,\n classNames: props.classNames,\n });\nconst renderProps: string[] = [];\nRender.props = renderProps;\n</script>\n\n<template><Render /></template>\n","import {\n ChecklistChrome,\n type ChecklistFilterProps,\n type ChecklistSlots,\n useChecklistModel,\n} from \"@adapttable/vue/adapter\";\nimport { ElText } from \"element-plus\";\nimport {\n createVNode,\n defineComponent,\n h,\n type PropType,\n type SetupContext,\n type VNodeChild,\n} from \"vue\";\n\nimport { elementButton } from \"../controls/button\";\nimport ElementCheckbox from \"../controls/ElementCheckbox.vue\";\nimport ElementInput from \"../controls/ElementInput.vue\";\n\nconst controls: ChecklistSlots<VNodeChild> = {\n Search: (control) =>\n h(ElementInput, {\n type: \"search\",\n value: control.value,\n \"aria-label\": control.label,\n \"data-adapttable-part\": \"filter-checklist-search\",\n class: control.className,\n onChange: control.onChange,\n }),\n Button: (control) =>\n elementButton({ onClick: control.onClick }, control.label),\n Checkbox: (control) =>\n h(\"div\", { class: \"adapttable-element-plus-checklist-option\" }, [\n h(ElementCheckbox, {\n \"data-adapttable-part\": \"filter-checkbox\",\n class: control.className,\n label: control.label,\n labelVisible: true,\n checked: control.checked,\n onChange: control.onChange,\n }),\n h(\n ElText,\n {\n class: control.countClassName,\n \"data-adapttable-part\": \"filter-checklist-count\",\n type: \"info\",\n size: \"small\",\n },\n { default: () => control.count }\n ),\n ]),\n};\n\n// The presentation validates values; its key list preserves generic public\n// components and Vue fallthrough attribute inference.\nconst checklistRuntimeProps = {\n def: { type: Object as PropType<ChecklistFilterProps<unknown>[\"def\"]> },\n source: { type: Object as PropType<ChecklistFilterProps<unknown>[\"source\"]> },\n labels: { type: Object as PropType<ChecklistFilterProps<unknown>[\"labels\"]> },\n classNames: {\n type: Object as PropType<ChecklistFilterProps<unknown>[\"classNames\"]>,\n },\n};\n\nconst ElementChecklistFilterPresentation = defineComponent(\n (props: ChecklistFilterProps<unknown>) => {\n const model = useChecklistModel(() => props);\n return () => ChecklistChrome({ model: model.value, controls });\n },\n {\n name: \"ElementChecklistFilterPresentation\",\n props: checklistRuntimeProps,\n }\n);\n\n/** Preserve the canonical row contract without exposing versioned instance helpers. */\nexport function ElementChecklistFilter<TRow>(\n props: ChecklistFilterProps<TRow>,\n context: Pick<SetupContext, \"attrs\">\n) {\n return createVNode(ElementChecklistFilterPresentation, {\n ...context.attrs,\n ...props,\n });\n}\nElementChecklistFilter.props = Object.keys(checklistRuntimeProps);\n","<script setup lang=\"ts\" generic=\"TRow\">\nimport {\n type DataTableClassNames,\n defaultFilterRegistry,\n type FilterFieldOptions,\n filterLabel,\n filterWidgetKind,\n} from \"@adapttable/vue/adapter\";\nimport { ElFormItem } from \"element-plus\";\n\nimport ElementBasicFilterField from \"./ElementBasicFilterField.vue\";\nimport { ElementChecklistFilter } from \"./ElementChecklistFilter\";\n\ndefineOptions({ name: \"ElementFilterField\" });\nconst props = defineProps<\n FilterFieldOptions<TRow> & { classNames?: DataTableClassNames }\n>();\n</script>\n\n<template>\n <ElFormItem\n v-if=\"\n filterWidgetKind(props.def, props.registry ?? defaultFilterRegistry) ===\n 'checklist'\n \"\n :label=\"filterLabel(props.def)\"\n :class=\"props.classNames?.filterField\"\n data-adapttable-part=\"filter-field\"\n >\n <ElementChecklistFilter\n :def=\"props.def\"\n :source=\"props.source\"\n :labels=\"props.labels\"\n :class-names=\"props.classNames\"\n />\n </ElFormItem>\n <ElementBasicFilterField v-else v-bind=\"props\" />\n</template>\n","import {\n type FilterPanelSurfaceProps,\n FULLSCREEN_MODEL,\n useFeatureState,\n useScopeActivity,\n} from \"@adapttable/vue/adapter\";\nimport {\n type CardInstance,\n ClickOutside,\n ElCard,\n ElDrawer,\n ElPopover,\n} from \"element-plus\";\nimport {\n defineComponent,\n h,\n nextTick,\n onMounted,\n type PropType,\n shallowRef,\n watch,\n withDirectives,\n} from \"vue\";\n\nimport { rtlScrollbarGutter } from \"../scrollbarGutter\";\n\n/** Kit overlays retain their own positioning, focus trap and modal backdrop. */\nexport const ElementFilterSurface = defineComponent(\n (\n props: FilterPanelSurfaceProps & {\n readonly modal: boolean;\n readonly part?: string;\n /** Class for ElDrawer's modal mask, through its `modalClass` hook. */\n readonly backdropClassName?: string;\n }\n ) => {\n const mounted = shallowRef(false);\n const active = useScopeActivity();\n const fullscreen = useFeatureState(FULLSCREEN_MODEL);\n const panel = shallowRef<CardInstance>();\n onMounted(() => {\n mounted.value = true;\n });\n const close: FilterPanelSurfaceProps[\"onClose\"] = (reason) => {\n if (!active.value || !props.open) return;\n props.onClose(reason);\n if (reason === \"escape\") {\n const anchor = props.anchor;\n void nextTick(() => {\n if (\n active.value &&\n !props.open &&\n props.anchor === anchor &&\n anchor?.isConnected\n )\n anchor.focus();\n });\n }\n };\n const outside = (event: MouseEvent) => {\n const target = event.target;\n if (target instanceof Node && props.anchor?.contains(target)) return;\n close(\"outside\");\n };\n const keydown = (event: KeyboardEvent) => {\n if (event.key !== \"Escape\") return;\n // Element's focus trap releases on any Escape that reaches the document,\n // including one an inner control handled or an IME composition owns, so\n // the panel keeps those Escapes inside itself.\n if (event.defaultPrevented || event.isComposing) {\n event.stopPropagation();\n return;\n }\n event.preventDefault();\n event.stopPropagation();\n close(\"escape\");\n };\n // Escape also dismisses while focus is still on the external trigger,\n // before the native enter transition has moved it into the card.\n watch(\n () => active.value && props.open,\n (open, _previous, cleanup) => {\n const document = props.anchor?.ownerDocument;\n if (!open || !document) return;\n document.addEventListener(\"keydown\", keydown);\n cleanup(() => document.removeEventListener(\"keydown\", keydown));\n },\n { immediate: true }\n );\n // A closed native combobox must not swallow the containing overlay's Escape.\n // Open comboboxes keep the event so their own menu closes first.\n const captureKeydown = (event: KeyboardEvent) => {\n const target = event.target;\n if (\n target instanceof Element &&\n target.getAttribute(\"role\") === \"combobox\" &&\n target.getAttribute(\"aria-expanded\") === \"false\"\n )\n keydown(event);\n };\n const focusPanel = () => {\n const element: unknown = panel.value?.$el;\n if (!active.value || !props.open || !(element instanceof HTMLElement))\n return;\n const focused = element.ownerDocument.activeElement;\n if (focused === props.anchor || focused === element.ownerDocument.body)\n element.focus();\n };\n return () => {\n if (!mounted.value || !active.value) return null;\n if (props.modal)\n return h(\n ElDrawer,\n {\n modelValue: props.open,\n title: props.label,\n direction: props.dir === \"rtl\" ? \"ltr\" : \"rtl\",\n appendTo: props.container ?? fullscreen.value?.container ?? \"body\",\n appendToBody: true,\n modal: true,\n modalClass: props.backdropClassName,\n withHeader: false,\n showClose: false,\n destroyOnClose: true,\n // Relative to the drawer's overlay, which excludes a classic\n // scrollbar or a reserved gutter; 100vw does not.\n size: \"min(30rem, 100%)\",\n dir: props.dir,\n class: props.className,\n \"data-adapttable-part\": \"filters-panel\",\n beforeClose: () => close(\"outside\"),\n onKeydown: keydown,\n onKeydownCapture: captureKeydown,\n },\n { default: () => props.children }\n );\n if (!props.anchor) return null;\n return h(\n ElPopover,\n {\n visible: props.open,\n virtualTriggering: true,\n virtualRef: props.anchor,\n trigger: \"click\",\n role: \"dialog\",\n \"aria-label\": props.label,\n placement: props.dir === \"rtl\" ? \"bottom-end\" : \"bottom-start\",\n appendTo: props.container ?? fullscreen.value?.container ?? \"body\",\n teleported: true,\n persistent: false,\n showArrow: false,\n width: \"min(28rem, calc(100vw - 1rem))\",\n popperClass: \"adapttable-element-plus-filter-popover\",\n popperStyle: {\n padding: 0,\n translate: `${rtlScrollbarGutter(props.dir, props.anchor?.ownerDocument.defaultView)} 0`,\n },\n onAfterEnter: focusPanel,\n },\n {\n default: () =>\n withDirectives(\n h(\n ElCard,\n {\n ref: panel,\n shadow: \"never\",\n dir: props.dir,\n tabindex: -1,\n \"aria-label\": props.label,\n \"data-adapttable-part\": props.part ?? \"filters-popover\",\n class: props.className,\n onKeydown: keydown,\n onKeydownCapture: captureKeydown,\n },\n { default: () => props.children }\n ),\n [[ClickOutside, outside]]\n ),\n }\n );\n };\n },\n {\n name: \"ElementFilterSurface\",\n props: {\n className: {\n type: String as PropType<\n (FilterPanelSurfaceProps & {\n readonly modal: boolean;\n readonly part?: string;\n /** Class for ElDrawer's modal mask, through its `modalClass` hook. */\n readonly backdropClassName?: string;\n })[\"className\"]\n >,\n },\n open: {\n type: Boolean as PropType<\n (FilterPanelSurfaceProps & {\n readonly modal: boolean;\n readonly part?: string;\n /** Class for ElDrawer's modal mask, through its `modalClass` hook. */\n readonly backdropClassName?: string;\n })[\"open\"]\n >,\n default: undefined,\n },\n label: {\n type: String as PropType<\n (FilterPanelSurfaceProps & {\n readonly modal: boolean;\n readonly part?: string;\n /** Class for ElDrawer's modal mask, through its `modalClass` hook. */\n readonly backdropClassName?: string;\n })[\"label\"]\n >,\n },\n dir: {\n type: String as PropType<\n (FilterPanelSurfaceProps & {\n readonly modal: boolean;\n readonly part?: string;\n /** Class for ElDrawer's modal mask, through its `modalClass` hook. */\n readonly backdropClassName?: string;\n })[\"dir\"]\n >,\n },\n anchor: {\n type: Object as PropType<\n (FilterPanelSurfaceProps & {\n readonly modal: boolean;\n readonly part?: string;\n /** Class for ElDrawer's modal mask, through its `modalClass` hook. */\n readonly backdropClassName?: string;\n })[\"anchor\"]\n >,\n },\n container: {\n type: Object as PropType<\n (FilterPanelSurfaceProps & {\n readonly modal: boolean;\n readonly part?: string;\n /** Class for ElDrawer's modal mask, through its `modalClass` hook. */\n readonly backdropClassName?: string;\n })[\"container\"]\n >,\n },\n children: {\n type: [String, Number, Boolean, Array, Object] as PropType<\n (FilterPanelSurfaceProps & {\n readonly modal: boolean;\n readonly part?: string;\n /** Class for ElDrawer's modal mask, through its `modalClass` hook. */\n readonly backdropClassName?: string;\n })[\"children\"]\n >,\n default: undefined,\n },\n onClose: {\n type: Function as PropType<\n (FilterPanelSurfaceProps & {\n readonly modal: boolean;\n readonly part?: string;\n /** Class for ElDrawer's modal mask, through its `modalClass` hook. */\n readonly backdropClassName?: string;\n })[\"onClose\"]\n >,\n },\n modal: {\n type: Boolean as PropType<\n (FilterPanelSurfaceProps & {\n readonly modal: boolean;\n readonly part?: string;\n /** Class for ElDrawer's modal mask, through its `modalClass` hook. */\n readonly backdropClassName?: string;\n })[\"modal\"]\n >,\n default: undefined,\n },\n part: {\n type: String as PropType<\n (FilterPanelSurfaceProps & {\n readonly modal: boolean;\n readonly part?: string;\n /** Class for ElDrawer's modal mask, through its `modalClass` hook. */\n readonly backdropClassName?: string;\n })[\"part\"]\n >,\n },\n backdropClassName: {\n type: String as PropType<\n (FilterPanelSurfaceProps & {\n readonly modal: boolean;\n readonly part?: string;\n /** Class for ElDrawer's modal mask, through its `modalClass` hook. */\n readonly backdropClassName?: string;\n })[\"backdropClassName\"]\n >,\n },\n },\n }\n);\n"],"mappings":";;;;;;;;;AAUA,SAAgB,sBACd,OACkB;CAClB,OAAO;EACL,QAAQ,aAAA,GACNA,IAAAA,EAAAA,CAAEC,qBAAAA,WAAc;GACd,GAAG,QAAQ;GACX,OAAO,QAAQ;GACf,MAAM,QAAQ;GACd,OAAO,MAAM,CAAC,CAAC;GACf,UAAU,QAAQ;EACpB,CAAC;EACH,SAAS,aAAA,GACPD,IAAAA,EAAAA,CAAEE,sBAAAA,WAAe;GACf,GAAG,QAAQ;GACX,OAAO,QAAQ;GACf,SAAS,QAAQ;GACjB,OACE,QAAQ,MAAM,4BAA4B,oBACtC,MAAM,CAAC,CAAC,iBACR,MAAM,CAAC,CAAC;GACd,UAAU,QAAQ;EACpB,CAAC;EACH,WAAW,aAAA,GACTF,IAAAA,EAAAA,CAAEG,wBAAAA,WAAi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AAa;IACX,SAAS;IACT,WAAW,GAAGC,wBAAAA,mBAAmB,MAAM,KAAK,MAAM,QAAQ,cAAc,WAAW,EAAE;GACvF;GACA,cAAc;EAChB,GACA,EACE,gBAAA,GACEC,IAAAA,eAAAA,EAAAA,GACEJ,IAAAA,EAAAA,CACEK,aAAAA,QACA;GACE,KAAK;GACL,QAAQ;GACR,KAAK,MAAM;GACX,UAAU;GACV,cAAc,MAAM;GACpB,wBAAwB,MAAM,QAAQ;GACtC,OAAO,MAAM;GACb,WAAW;GACX,kBAAkB;EACpB,GACA,EAAE,eAAe,MAAM,SAAS,CAClC,GACA,CAAC,CAACC,aAAAA,cAAc,OAAO,CAAC,CAC1B,EACJ,CACF;CACF;AACF,GACA;CACE,MAAM;CACN,OAAO;EACL,WAAW,EACT,MAAM,OAQR;EACA,MAAM;GACJ,MAAM;GAQN,SAAS,KAAA;EACX;EACA,OAAO,EACL,MAAM,OAQR;EACA,KAAK,EACH,MAAM,OAQR;EACA,QAAQ,EACN,MAAM,OAQR;EACA,WAAW,EACT,MAAM,OAQR;EACA,UAAU;GACR,MAAM;IAAC;IAAQ;IAAQ;IAAS;IAAO;GAAM;GAQ7C,SAAS,KAAA;EACX;EACA,SAAS,EACP,MAAM,SAQR;EACA,OAAO;GACL,MAAM;GAQN,SAAS,KAAA;EACX;EACA,MAAM,EACJ,MAAM,OAQR;EACA,mBAAmB,EACjB,MAAM,OAQR;CACF;AACF,CACF"}
|
|
1
|
+
{"version":3,"file":"ElementFilterSurface-CUpyLfPF.cjs","names":["h","ElementInput","ElementSelect","ElementCheckbox","h","ElementInput","elementButton","ElementCheckbox","ElText","defineComponent","useChecklistModel","ChecklistChrome","createVNode","defineComponent","shallowRef","useScopeActivity","useFeatureState","FULLSCREEN_MODEL","nextTick","h","ElDrawer","ElPopover","rtlScrollbarGutter","withDirectives","ElCard","ClickOutside"],"sources":["../src/filters/fieldControls.ts","../src/filters/ElementBasicFilterField.vue","../src/filters/ElementChecklistFilter.ts","../src/filters/ElementFilterField.vue","../src/filters/ElementFilterSurface.ts"],"sourcesContent":["import type {\n DataTableClassNames,\n FilterFieldSlots,\n} from \"@adapttable/vue/adapter\";\nimport { h } from \"vue\";\n\nimport ElementCheckbox from \"../controls/ElementCheckbox.vue\";\nimport ElementInput from \"../controls/ElementInput.vue\";\nimport ElementSelect from \"../controls/ElementSelect.vue\";\n\nexport function elementFilterControls(\n names: () => DataTableClassNames\n): FilterFieldSlots {\n return {\n Input: (control) =>\n h(ElementInput, {\n ...control.attrs,\n value: control.value,\n type: control.type,\n class: names().filterInput,\n onChange: control.onChange,\n }),\n Select: (control) =>\n h(ElementSelect, {\n ...control.attrs,\n value: control.value,\n options: control.options,\n class:\n control.attrs[\"data-adapttable-part\"] === \"filter-operator\"\n ? names().filterOperator\n : names().filterSelect,\n onChange: control.onChange,\n }),\n Checkbox: (control) =>\n h(ElementCheckbox, {\n ...control.attrs,\n checked: control.checked,\n label: control.label,\n labelVisible: true,\n class: names().filterCheckbox,\n onChange: control.onChange,\n }),\n };\n}\n","<script setup lang=\"ts\" generic=\"TRow\">\nimport {\n type DataTableClassNames,\n FilterFieldChrome,\n type FilterFieldOptions,\n useFilterField,\n} from \"@adapttable/vue/adapter\";\n\nimport { elementFilterControls } from \"./fieldControls\";\n\ndefineOptions({ name: \"ElementBasicFilterField\" });\nconst props = defineProps<\n FilterFieldOptions<TRow> & { classNames?: DataTableClassNames }\n>();\nconst model = useFilterField(() => props);\nconst controls = elementFilterControls(() => props.classNames ?? {});\nconst Render = () =>\n FilterFieldChrome({\n model: model.value,\n controls,\n classNames: props.classNames,\n });\nconst renderProps: string[] = [];\nRender.props = renderProps;\n</script>\n\n<template><Render /></template>\n","import {\n ChecklistChrome,\n type ChecklistFilterProps,\n type ChecklistSlots,\n useChecklistModel,\n} from \"@adapttable/vue/adapter\";\nimport { ElText } from \"element-plus\";\nimport {\n createVNode,\n defineComponent,\n h,\n type PropType,\n type SetupContext,\n type VNodeChild,\n} from \"vue\";\n\nimport { elementButton } from \"../controls/button\";\nimport ElementCheckbox from \"../controls/ElementCheckbox.vue\";\nimport ElementInput from \"../controls/ElementInput.vue\";\n\nconst controls: ChecklistSlots<VNodeChild> = {\n Search: (control) =>\n h(ElementInput, {\n type: \"search\",\n value: control.value,\n \"aria-label\": control.label,\n \"data-adapttable-part\": \"filter-checklist-search\",\n class: control.className,\n onChange: control.onChange,\n }),\n Button: (control) =>\n elementButton({ onClick: control.onClick }, control.label),\n Checkbox: (control) =>\n h(\"div\", { class: \"adapttable-element-plus-checklist-option\" }, [\n h(ElementCheckbox, {\n \"data-adapttable-part\": \"filter-checkbox\",\n class: control.className,\n label: control.label,\n labelVisible: true,\n checked: control.checked,\n onChange: control.onChange,\n }),\n h(\n ElText,\n {\n class: control.countClassName,\n \"data-adapttable-part\": \"filter-checklist-count\",\n type: \"info\",\n size: \"small\",\n },\n { default: () => control.count }\n ),\n ]),\n};\n\n// The presentation validates values; its key list preserves generic public\n// components and Vue fallthrough attribute inference.\nconst checklistRuntimeProps = {\n def: { type: Object as PropType<ChecklistFilterProps<unknown>[\"def\"]> },\n source: { type: Object as PropType<ChecklistFilterProps<unknown>[\"source\"]> },\n labels: { type: Object as PropType<ChecklistFilterProps<unknown>[\"labels\"]> },\n classNames: {\n type: Object as PropType<ChecklistFilterProps<unknown>[\"classNames\"]>,\n },\n};\n\nconst ElementChecklistFilterPresentation = defineComponent(\n (props: ChecklistFilterProps<unknown>) => {\n const model = useChecklistModel(() => props);\n return () => ChecklistChrome({ model: model.value, controls });\n },\n {\n name: \"ElementChecklistFilterPresentation\",\n props: checklistRuntimeProps,\n }\n);\n\n/** Preserve the canonical row contract without exposing versioned instance helpers. */\nexport function ElementChecklistFilter<TRow>(\n props: ChecklistFilterProps<TRow>,\n context: Pick<SetupContext, \"attrs\">\n) {\n return createVNode(ElementChecklistFilterPresentation, {\n ...context.attrs,\n ...props,\n });\n}\nElementChecklistFilter.props = Object.keys(checklistRuntimeProps);\n","<script setup lang=\"ts\" generic=\"TRow\">\nimport {\n type DataTableClassNames,\n defaultFilterRegistry,\n type FilterFieldOptions,\n filterLabel,\n filterWidgetKind,\n} from \"@adapttable/vue/adapter\";\nimport { ElFormItem } from \"element-plus\";\n\nimport ElementBasicFilterField from \"./ElementBasicFilterField.vue\";\nimport { ElementChecklistFilter } from \"./ElementChecklistFilter\";\n\ndefineOptions({ name: \"ElementFilterField\" });\nconst props = defineProps<\n FilterFieldOptions<TRow> & { classNames?: DataTableClassNames }\n>();\n</script>\n\n<template>\n <ElFormItem\n v-if=\"\n filterWidgetKind(props.def, props.registry ?? defaultFilterRegistry) ===\n 'checklist'\n \"\n :label=\"filterLabel(props.def)\"\n :class=\"props.classNames?.filterField\"\n data-adapttable-part=\"filter-field\"\n >\n <ElementChecklistFilter\n :def=\"props.def\"\n :source=\"props.source\"\n :labels=\"props.labels\"\n :class-names=\"props.classNames\"\n />\n </ElFormItem>\n <ElementBasicFilterField v-else v-bind=\"props\" />\n</template>\n","import {\n type FilterPanelSurfaceProps,\n FULLSCREEN_MODEL,\n useFeatureState,\n useScopeActivity,\n} from \"@adapttable/vue/adapter\";\nimport {\n type CardInstance,\n ClickOutside,\n ElCard,\n ElDrawer,\n ElPopover,\n} from \"element-plus\";\nimport {\n defineComponent,\n h,\n nextTick,\n onMounted,\n type PropType,\n shallowRef,\n watch,\n withDirectives,\n} from \"vue\";\n\nimport { rtlScrollbarGutter } from \"../scrollbarGutter\";\n\n/** Kit overlays retain their own positioning, focus trap and modal backdrop. */\nexport const ElementFilterSurface = defineComponent(\n (\n props: FilterPanelSurfaceProps & {\n readonly modal: boolean;\n readonly part?: string;\n /** Class for ElDrawer's modal mask, through its `modalClass` hook. */\n readonly backdropClassName?: string;\n }\n ) => {\n const mounted = shallowRef(false);\n const active = useScopeActivity();\n const fullscreen = useFeatureState(FULLSCREEN_MODEL);\n const panel = shallowRef<CardInstance>();\n onMounted(() => {\n mounted.value = true;\n });\n const close: FilterPanelSurfaceProps[\"onClose\"] = (reason) => {\n if (!active.value || !props.open) return;\n props.onClose(reason);\n if (reason === \"escape\") {\n const anchor = props.anchor;\n void nextTick(() => {\n if (\n active.value &&\n !props.open &&\n props.anchor === anchor &&\n anchor?.isConnected\n )\n anchor.focus();\n });\n }\n };\n const outside = (event: MouseEvent) => {\n const target = event.target;\n if (target instanceof Node && props.anchor?.contains(target)) return;\n close(\"outside\");\n };\n const keydown = (event: KeyboardEvent) => {\n if (event.key !== \"Escape\") return;\n // Element's focus trap releases on any Escape that reaches the document,\n // including one an inner control handled or an IME composition owns, so\n // the panel keeps those Escapes inside itself.\n if (event.defaultPrevented || event.isComposing) {\n event.stopPropagation();\n return;\n }\n event.preventDefault();\n event.stopPropagation();\n close(\"escape\");\n };\n // Escape also dismisses while focus is still on the external trigger,\n // before the native enter transition has moved it into the card.\n watch(\n () => active.value && props.open,\n (open, _previous, cleanup) => {\n const document = props.anchor?.ownerDocument;\n if (!open || !document) return;\n document.addEventListener(\"keydown\", keydown);\n cleanup(() => document.removeEventListener(\"keydown\", keydown));\n },\n { immediate: true }\n );\n // A closed native combobox must not swallow the containing overlay's Escape.\n // Open comboboxes keep the event so their own menu closes first.\n const captureKeydown = (event: KeyboardEvent) => {\n const target = event.target;\n if (\n target instanceof Element &&\n target.getAttribute(\"role\") === \"combobox\" &&\n target.getAttribute(\"aria-expanded\") === \"false\"\n )\n keydown(event);\n };\n const focusPanel = () => {\n const element: unknown = panel.value?.$el;\n if (!active.value || !props.open || !(element instanceof HTMLElement))\n return;\n const focused = element.ownerDocument.activeElement;\n if (focused === props.anchor || focused === element.ownerDocument.body)\n element.focus();\n };\n return () => {\n if (!mounted.value || !active.value) return null;\n if (props.modal)\n return h(\n ElDrawer,\n {\n modelValue: props.open,\n title: props.label,\n direction: props.dir === \"rtl\" ? \"ltr\" : \"rtl\",\n appendTo: props.container ?? fullscreen.value?.container ?? \"body\",\n appendToBody: true,\n modal: true,\n modalClass: props.backdropClassName,\n withHeader: false,\n showClose: false,\n destroyOnClose: true,\n // Relative to the drawer's overlay, which excludes a classic\n // scrollbar or a reserved gutter; 100vw does not.\n size: \"min(30rem, 100%)\",\n dir: props.dir,\n class: props.className,\n \"data-adapttable-part\": \"filters-panel\",\n beforeClose: () => close(\"outside\"),\n onKeydown: keydown,\n onKeydownCapture: captureKeydown,\n },\n { default: () => props.children }\n );\n if (!props.anchor) return null;\n return h(\n ElPopover,\n {\n visible: props.open,\n virtualTriggering: true,\n virtualRef: props.anchor,\n trigger: \"click\",\n role: \"dialog\",\n \"aria-label\": props.label,\n placement: props.dir === \"rtl\" ? \"bottom-end\" : \"bottom-start\",\n appendTo: props.container ?? fullscreen.value?.container ?? \"body\",\n teleported: true,\n persistent: false,\n showArrow: false,\n width: \"min(28rem, calc(100vw - 1rem))\",\n popperClass: \"adapttable-element-plus-filter-popover\",\n popperStyle: {\n padding: 0,\n translate: `${rtlScrollbarGutter(props.dir, props.anchor?.ownerDocument.defaultView)} 0`,\n },\n onAfterEnter: focusPanel,\n },\n {\n default: () =>\n withDirectives(\n h(\n ElCard,\n {\n ref: panel,\n shadow: \"never\",\n dir: props.dir,\n tabindex: -1,\n \"aria-label\": props.label,\n \"data-adapttable-part\": props.part ?? \"filters-popover\",\n class: props.className,\n onKeydown: keydown,\n onKeydownCapture: captureKeydown,\n },\n { default: () => props.children }\n ),\n [[ClickOutside, outside]]\n ),\n }\n );\n };\n },\n {\n name: \"ElementFilterSurface\",\n props: {\n className: {\n type: String as PropType<\n (FilterPanelSurfaceProps & {\n readonly modal: boolean;\n readonly part?: string;\n /** Class for ElDrawer's modal mask, through its `modalClass` hook. */\n readonly backdropClassName?: string;\n })[\"className\"]\n >,\n },\n open: {\n type: Boolean as PropType<\n (FilterPanelSurfaceProps & {\n readonly modal: boolean;\n readonly part?: string;\n /** Class for ElDrawer's modal mask, through its `modalClass` hook. */\n readonly backdropClassName?: string;\n })[\"open\"]\n >,\n default: undefined,\n },\n label: {\n type: String as PropType<\n (FilterPanelSurfaceProps & {\n readonly modal: boolean;\n readonly part?: string;\n /** Class for ElDrawer's modal mask, through its `modalClass` hook. */\n readonly backdropClassName?: string;\n })[\"label\"]\n >,\n },\n dir: {\n type: String as PropType<\n (FilterPanelSurfaceProps & {\n readonly modal: boolean;\n readonly part?: string;\n /** Class for ElDrawer's modal mask, through its `modalClass` hook. */\n readonly backdropClassName?: string;\n })[\"dir\"]\n >,\n },\n anchor: {\n type: Object as PropType<\n (FilterPanelSurfaceProps & {\n readonly modal: boolean;\n readonly part?: string;\n /** Class for ElDrawer's modal mask, through its `modalClass` hook. */\n readonly backdropClassName?: string;\n })[\"anchor\"]\n >,\n },\n container: {\n type: Object as PropType<\n (FilterPanelSurfaceProps & {\n readonly modal: boolean;\n readonly part?: string;\n /** Class for ElDrawer's modal mask, through its `modalClass` hook. */\n readonly backdropClassName?: string;\n })[\"container\"]\n >,\n },\n children: {\n type: [String, Number, Boolean, Array, Object] as PropType<\n (FilterPanelSurfaceProps & {\n readonly modal: boolean;\n readonly part?: string;\n /** Class for ElDrawer's modal mask, through its `modalClass` hook. */\n readonly backdropClassName?: string;\n })[\"children\"]\n >,\n default: undefined,\n },\n onClose: {\n type: Function as PropType<\n (FilterPanelSurfaceProps & {\n readonly modal: boolean;\n readonly part?: string;\n /** Class for ElDrawer's modal mask, through its `modalClass` hook. */\n readonly backdropClassName?: string;\n })[\"onClose\"]\n >,\n },\n modal: {\n type: Boolean as PropType<\n (FilterPanelSurfaceProps & {\n readonly modal: boolean;\n readonly part?: string;\n /** Class for ElDrawer's modal mask, through its `modalClass` hook. */\n readonly backdropClassName?: string;\n })[\"modal\"]\n >,\n default: undefined,\n },\n part: {\n type: String as PropType<\n (FilterPanelSurfaceProps & {\n readonly modal: boolean;\n readonly part?: string;\n /** Class for ElDrawer's modal mask, through its `modalClass` hook. */\n readonly backdropClassName?: string;\n })[\"part\"]\n >,\n },\n backdropClassName: {\n type: String as PropType<\n (FilterPanelSurfaceProps & {\n readonly modal: boolean;\n readonly part?: string;\n /** Class for ElDrawer's modal mask,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AAQ;IAAQ;IAAS;IAAO;GAAM;GAQ7C,SAAS,KAAA;EACX;EACA,SAAS,EACP,MAAM,SAQR;EACA,OAAO;GACL,MAAM;GAQN,SAAS,KAAA;EACX;EACA,MAAM,EACJ,MAAM,OAQR;EACA,mBAAmB,EACjB,MAAM,OAQR;CACF;AACF,CACF"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as elementButton } from "./button-DwB4UxI2.js";
|
|
2
2
|
import { t as _sfc_main$2 } from "./ElementCheckbox-BQN4_eas.js";
|
|
3
3
|
import { t as _sfc_main$3 } from "./ElementInput-BsoAvPfO.js";
|
|
4
|
-
import { t as _sfc_main$4 } from "./ElementSelect-
|
|
4
|
+
import { t as _sfc_main$4 } from "./ElementSelect-BtmVMA7B.js";
|
|
5
5
|
import { t as rtlScrollbarGutter } from "./scrollbarGutter-BNp0-4l1.js";
|
|
6
6
|
import { createBlock, createVNode, defineComponent, h, mergeProps, nextTick, normalizeClass, normalizeProps, onMounted, openBlock, shallowRef, unref, watch, withCtx, withDirectives } from "vue";
|
|
7
7
|
import { ChecklistChrome, FULLSCREEN_MODEL, FilterFieldChrome, defaultFilterRegistry, filterLabel, filterWidgetKind, useChecklistModel, useFeatureState, useFilterField, useScopeActivity } from "@adapttable/vue/adapter";
|
|
@@ -288,4 +288,4 @@ const ElementFilterSurface = defineComponent((props) => {
|
|
|
288
288
|
//#endregion
|
|
289
289
|
export { _sfc_main as n, ElementChecklistFilter as r, ElementFilterSurface as t };
|
|
290
290
|
|
|
291
|
-
//# sourceMappingURL=ElementFilterSurface-
|
|
291
|
+
//# sourceMappingURL=ElementFilterSurface-CztEiJ0k.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ElementFilterSurface-BR_nBvZU.js","names":["ElementInput","ElementSelect","ElementCheckbox","ElementInput","ElementCheckbox"],"sources":["../src/filters/fieldControls.ts","../src/filters/ElementBasicFilterField.vue","../src/filters/ElementChecklistFilter.ts","../src/filters/ElementFilterField.vue","../src/filters/ElementFilterSurface.ts"],"sourcesContent":["import type {\n DataTableClassNames,\n FilterFieldSlots,\n} from \"@adapttable/vue/adapter\";\nimport { h } from \"vue\";\n\nimport ElementCheckbox from \"../controls/ElementCheckbox.vue\";\nimport ElementInput from \"../controls/ElementInput.vue\";\nimport ElementSelect from \"../controls/ElementSelect.vue\";\n\nexport function elementFilterControls(\n names: () => DataTableClassNames\n): FilterFieldSlots {\n return {\n Input: (control) =>\n h(ElementInput, {\n ...control.attrs,\n value: control.value,\n type: control.type,\n class: names().filterInput,\n onChange: control.onChange,\n }),\n Select: (control) =>\n h(ElementSelect, {\n ...control.attrs,\n value: control.value,\n options: control.options,\n class:\n control.attrs[\"data-adapttable-part\"] === \"filter-operator\"\n ? names().filterOperator\n : names().filterSelect,\n onChange: control.onChange,\n }),\n Checkbox: (control) =>\n h(ElementCheckbox, {\n ...control.attrs,\n checked: control.checked,\n label: control.label,\n labelVisible: true,\n class: names().filterCheckbox,\n onChange: control.onChange,\n }),\n };\n}\n","<script setup lang=\"ts\" generic=\"TRow\">\nimport {\n type DataTableClassNames,\n FilterFieldChrome,\n type FilterFieldOptions,\n useFilterField,\n} from \"@adapttable/vue/adapter\";\n\nimport { elementFilterControls } from \"./fieldControls\";\n\ndefineOptions({ name: \"ElementBasicFilterField\" });\nconst props = defineProps<\n FilterFieldOptions<TRow> & { classNames?: DataTableClassNames }\n>();\nconst model = useFilterField(() => props);\nconst controls = elementFilterControls(() => props.classNames ?? {});\nconst Render = () =>\n FilterFieldChrome({\n model: model.value,\n controls,\n classNames: props.classNames,\n });\nconst renderProps: string[] = [];\nRender.props = renderProps;\n</script>\n\n<template><Render /></template>\n","import {\n ChecklistChrome,\n type ChecklistFilterProps,\n type ChecklistSlots,\n useChecklistModel,\n} from \"@adapttable/vue/adapter\";\nimport { ElText } from \"element-plus\";\nimport {\n createVNode,\n defineComponent,\n h,\n type PropType,\n type SetupContext,\n type VNodeChild,\n} from \"vue\";\n\nimport { elementButton } from \"../controls/button\";\nimport ElementCheckbox from \"../controls/ElementCheckbox.vue\";\nimport ElementInput from \"../controls/ElementInput.vue\";\n\nconst controls: ChecklistSlots<VNodeChild> = {\n Search: (control) =>\n h(ElementInput, {\n type: \"search\",\n value: control.value,\n \"aria-label\": control.label,\n \"data-adapttable-part\": \"filter-checklist-search\",\n class: control.className,\n onChange: control.onChange,\n }),\n Button: (control) =>\n elementButton({ onClick: control.onClick }, control.label),\n Checkbox: (control) =>\n h(\"div\", { class: \"adapttable-element-plus-checklist-option\" }, [\n h(ElementCheckbox, {\n \"data-adapttable-part\": \"filter-checkbox\",\n class: control.className,\n label: control.label,\n labelVisible: true,\n checked: control.checked,\n onChange: control.onChange,\n }),\n h(\n ElText,\n {\n class: control.countClassName,\n \"data-adapttable-part\": \"filter-checklist-count\",\n type: \"info\",\n size: \"small\",\n },\n { default: () => control.count }\n ),\n ]),\n};\n\n// The presentation validates values; its key list preserves generic public\n// components and Vue fallthrough attribute inference.\nconst checklistRuntimeProps = {\n def: { type: Object as PropType<ChecklistFilterProps<unknown>[\"def\"]> },\n source: { type: Object as PropType<ChecklistFilterProps<unknown>[\"source\"]> },\n labels: { type: Object as PropType<ChecklistFilterProps<unknown>[\"labels\"]> },\n classNames: {\n type: Object as PropType<ChecklistFilterProps<unknown>[\"classNames\"]>,\n },\n};\n\nconst ElementChecklistFilterPresentation = defineComponent(\n (props: ChecklistFilterProps<unknown>) => {\n const model = useChecklistModel(() => props);\n return () => ChecklistChrome({ model: model.value, controls });\n },\n {\n name: \"ElementChecklistFilterPresentation\",\n props: checklistRuntimeProps,\n }\n);\n\n/** Preserve the canonical row contract without exposing versioned instance helpers. */\nexport function ElementChecklistFilter<TRow>(\n props: ChecklistFilterProps<TRow>,\n context: Pick<SetupContext, \"attrs\">\n) {\n return createVNode(ElementChecklistFilterPresentation, {\n ...context.attrs,\n ...props,\n });\n}\nElementChecklistFilter.props = Object.keys(checklistRuntimeProps);\n","<script setup lang=\"ts\" generic=\"TRow\">\nimport {\n type DataTableClassNames,\n defaultFilterRegistry,\n type FilterFieldOptions,\n filterLabel,\n filterWidgetKind,\n} from \"@adapttable/vue/adapter\";\nimport { ElFormItem } from \"element-plus\";\n\nimport ElementBasicFilterField from \"./ElementBasicFilterField.vue\";\nimport { ElementChecklistFilter } from \"./ElementChecklistFilter\";\n\ndefineOptions({ name: \"ElementFilterField\" });\nconst props = defineProps<\n FilterFieldOptions<TRow> & { classNames?: DataTableClassNames }\n>();\n</script>\n\n<template>\n <ElFormItem\n v-if=\"\n filterWidgetKind(props.def, props.registry ?? defaultFilterRegistry) ===\n 'checklist'\n \"\n :label=\"filterLabel(props.def)\"\n :class=\"props.classNames?.filterField\"\n data-adapttable-part=\"filter-field\"\n >\n <ElementChecklistFilter\n :def=\"props.def\"\n :source=\"props.source\"\n :labels=\"props.labels\"\n :class-names=\"props.classNames\"\n />\n </ElFormItem>\n <ElementBasicFilterField v-else v-bind=\"props\" />\n</template>\n","import {\n type FilterPanelSurfaceProps,\n FULLSCREEN_MODEL,\n useFeatureState,\n useScopeActivity,\n} from \"@adapttable/vue/adapter\";\nimport {\n type CardInstance,\n ClickOutside,\n ElCard,\n ElDrawer,\n ElPopover,\n} from \"element-plus\";\nimport {\n defineComponent,\n h,\n nextTick,\n onMounted,\n type PropType,\n shallowRef,\n watch,\n withDirectives,\n} from \"vue\";\n\nimport { rtlScrollbarGutter } from \"../scrollbarGutter\";\n\n/** Kit overlays retain their own positioning, focus trap and modal backdrop. */\nexport const ElementFilterSurface = defineComponent(\n (\n props: FilterPanelSurfaceProps & {\n readonly modal: boolean;\n readonly part?: string;\n /** Class for ElDrawer's modal mask, through its `modalClass` hook. */\n readonly backdropClassName?: string;\n }\n ) => {\n const mounted = shallowRef(false);\n const active = useScopeActivity();\n const fullscreen = useFeatureState(FULLSCREEN_MODEL);\n const panel = shallowRef<CardInstance>();\n onMounted(() => {\n mounted.value = true;\n });\n const close: FilterPanelSurfaceProps[\"onClose\"] = (reason) => {\n if (!active.value || !props.open) return;\n props.onClose(reason);\n if (reason === \"escape\") {\n const anchor = props.anchor;\n void nextTick(() => {\n if (\n active.value &&\n !props.open &&\n props.anchor === anchor &&\n anchor?.isConnected\n )\n anchor.focus();\n });\n }\n };\n const outside = (event: MouseEvent) => {\n const target = event.target;\n if (target instanceof Node && props.anchor?.contains(target)) return;\n close(\"outside\");\n };\n const keydown = (event: KeyboardEvent) => {\n if (event.key !== \"Escape\") return;\n // Element's focus trap releases on any Escape that reaches the document,\n // including one an inner control handled or an IME composition owns, so\n // the panel keeps those Escapes inside itself.\n if (event.defaultPrevented || event.isComposing) {\n event.stopPropagation();\n return;\n }\n event.preventDefault();\n event.stopPropagation();\n close(\"escape\");\n };\n // Escape also dismisses while focus is still on the external trigger,\n // before the native enter transition has moved it into the card.\n watch(\n () => active.value && props.open,\n (open, _previous, cleanup) => {\n const document = props.anchor?.ownerDocument;\n if (!open || !document) return;\n document.addEventListener(\"keydown\", keydown);\n cleanup(() => document.removeEventListener(\"keydown\", keydown));\n },\n { immediate: true }\n );\n // A closed native combobox must not swallow the containing overlay's Escape.\n // Open comboboxes keep the event so their own menu closes first.\n const captureKeydown = (event: KeyboardEvent) => {\n const target = event.target;\n if (\n target instanceof Element &&\n target.getAttribute(\"role\") === \"combobox\" &&\n target.getAttribute(\"aria-expanded\") === \"false\"\n )\n keydown(event);\n };\n const focusPanel = () => {\n const element: unknown = panel.value?.$el;\n if (!active.value || !props.open || !(element instanceof HTMLElement))\n return;\n const focused = element.ownerDocument.activeElement;\n if (focused === props.anchor || focused === element.ownerDocument.body)\n element.focus();\n };\n return () => {\n if (!mounted.value || !active.value) return null;\n if (props.modal)\n return h(\n ElDrawer,\n {\n modelValue: props.open,\n title: props.label,\n direction: props.dir === \"rtl\" ? \"ltr\" : \"rtl\",\n appendTo: props.container ?? fullscreen.value?.container ?? \"body\",\n appendToBody: true,\n modal: true,\n modalClass: props.backdropClassName,\n withHeader: false,\n showClose: false,\n destroyOnClose: true,\n // Relative to the drawer's overlay, which excludes a classic\n // scrollbar or a reserved gutter; 100vw does not.\n size: \"min(30rem, 100%)\",\n dir: props.dir,\n class: props.className,\n \"data-adapttable-part\": \"filters-panel\",\n beforeClose: () => close(\"outside\"),\n onKeydown: keydown,\n onKeydownCapture: captureKeydown,\n },\n { default: () => props.children }\n );\n if (!props.anchor) return null;\n return h(\n ElPopover,\n {\n visible: props.open,\n virtualTriggering: true,\n virtualRef: props.anchor,\n trigger: \"click\",\n role: \"dialog\",\n \"aria-label\": props.label,\n placement: props.dir === \"rtl\" ? \"bottom-end\" : \"bottom-start\",\n appendTo: props.container ?? fullscreen.value?.container ?? \"body\",\n teleported: true,\n persistent: false,\n showArrow: false,\n width: \"min(28rem, calc(100vw - 1rem))\",\n popperClass: \"adapttable-element-plus-filter-popover\",\n popperStyle: {\n padding: 0,\n translate: `${rtlScrollbarGutter(props.dir, props.anchor?.ownerDocument.defaultView)} 0`,\n },\n onAfterEnter: focusPanel,\n },\n {\n default: () =>\n withDirectives(\n h(\n ElCard,\n {\n ref: panel,\n shadow: \"never\",\n dir: props.dir,\n tabindex: -1,\n \"aria-label\": props.label,\n \"data-adapttable-part\": props.part ?? \"filters-popover\",\n class: props.className,\n onKeydown: keydown,\n onKeydownCapture: captureKeydown,\n },\n { default: () => props.children }\n ),\n [[ClickOutside, outside]]\n ),\n }\n );\n };\n },\n {\n name: \"ElementFilterSurface\",\n props: {\n className: {\n type: String as PropType<\n (FilterPanelSurfaceProps & {\n readonly modal: boolean;\n readonly part?: string;\n /** Class for ElDrawer's modal mask, through its `modalClass` hook. */\n readonly backdropClassName?: string;\n })[\"className\"]\n >,\n },\n open: {\n type: Boolean as PropType<\n (FilterPanelSurfaceProps & {\n readonly modal: boolean;\n readonly part?: string;\n /** Class for ElDrawer's modal mask, through its `modalClass` hook. */\n readonly backdropClassName?: string;\n })[\"open\"]\n >,\n default: undefined,\n },\n label: {\n type: String as PropType<\n (FilterPanelSurfaceProps & {\n readonly modal: boolean;\n readonly part?: string;\n /** Class for ElDrawer's modal mask, through its `modalClass` hook. */\n readonly backdropClassName?: string;\n })[\"label\"]\n >,\n },\n dir: {\n type: String as PropType<\n (FilterPanelSurfaceProps & {\n readonly modal: boolean;\n readonly part?: string;\n /** Class for ElDrawer's modal mask, through its `modalClass` hook. */\n readonly backdropClassName?: string;\n })[\"dir\"]\n >,\n },\n anchor: {\n type: Object as PropType<\n (FilterPanelSurfaceProps & {\n readonly modal: boolean;\n readonly part?: string;\n /** Class for ElDrawer's modal mask, through its `modalClass` hook. */\n readonly backdropClassName?: string;\n })[\"anchor\"]\n >,\n },\n container: {\n type: Object as PropType<\n (FilterPanelSurfaceProps & {\n readonly modal: boolean;\n readonly part?: string;\n /** Class for ElDrawer's modal mask, through its `modalClass` hook. */\n readonly backdropClassName?: string;\n })[\"container\"]\n >,\n },\n children: {\n type: [String, Number, Boolean, Array, Object] as PropType<\n (FilterPanelSurfaceProps & {\n readonly modal: boolean;\n readonly part?: string;\n /** Class for ElDrawer's modal mask, through its `modalClass` hook. */\n readonly backdropClassName?: string;\n })[\"children\"]\n >,\n default: undefined,\n },\n onClose: {\n type: Function as PropType<\n (FilterPanelSurfaceProps & {\n readonly modal: boolean;\n readonly part?: string;\n /** Class for ElDrawer's modal mask, through its `modalClass` hook. */\n readonly backdropClassName?: string;\n })[\"onClose\"]\n >,\n },\n modal: {\n type: Boolean as PropType<\n (FilterPanelSurfaceProps & {\n readonly modal: boolean;\n readonly part?: string;\n /** Class for ElDrawer's modal mask, through its `modalClass` hook. */\n readonly backdropClassName?: string;\n })[\"modal\"]\n >,\n default: undefined,\n },\n part: {\n type: String as PropType<\n (FilterPanelSurfaceProps & {\n readonly modal: boolean;\n readonly part?: string;\n /** Class for ElDrawer's modal mask, through its `modalClass` hook. */\n readonly backdropClassName?: string;\n })[\"part\"]\n >,\n },\n backdropClassName: {\n type: String as PropType<\n (FilterPanelSurfaceProps & {\n readonly modal: boolean;\n readonly part?: string;\n /** Class for ElDrawer's modal mask, through its `modal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AC,cAAc,OAAO,CAAC,CAC1B,EACJ,CACF;CACF;AACF,GACA;CACE,MAAM;CACN,OAAO;EACL,WAAW,EACT,MAAM,OAQR;EACA,MAAM;GACJ,MAAM;GAQN,SAAS,KAAA;EACX;EACA,OAAO,EACL,MAAM,OAQR;EACA,KAAK,EACH,MAAM,OAQR;EACA,QAAQ,EACN,MAAM,OAQR;EACA,WAAW,EACT,MAAM,OAQR;EACA,UAAU;GACR,MAAM;IAAC;IAAQ;IAAQ;IAAS;IAAO;GAAM;GAQ7C,SAAS,KAAA;EACX;EACA,SAAS,EACP,MAAM,SAQR;EACA,OAAO;GACL,MAAM;GAQN,SAAS,KAAA;EACX;EACA,MAAM,EACJ,MAAM,OAQR;EACA,mBAAmB,EACjB,MAAM,OAQR;CACF;AACF,CACF"}
|
|
1
|
+
{"version":3,"file":"ElementFilterSurface-CztEiJ0k.js","names":["ElementInput","ElementSelect","ElementCheckbox","ElementInput","ElementCheckbox"],"sources":["../src/filters/fieldControls.ts","../src/filters/ElementBasicFilterField.vue","../src/filters/ElementChecklistFilter.ts","../src/filters/ElementFilterField.vue","../src/filters/ElementFilterSurface.ts"],"sourcesContent":["import type {\n DataTableClassNames,\n FilterFieldSlots,\n} from \"@adapttable/vue/adapter\";\nimport { h } from \"vue\";\n\nimport ElementCheckbox from \"../controls/ElementCheckbox.vue\";\nimport ElementInput from \"../controls/ElementInput.vue\";\nimport ElementSelect from \"../controls/ElementSelect.vue\";\n\nexport function elementFilterControls(\n names: () => DataTableClassNames\n): FilterFieldSlots {\n return {\n Input: (control) =>\n h(ElementInput, {\n ...control.attrs,\n value: control.value,\n type: control.type,\n class: names().filterInput,\n onChange: control.onChange,\n }),\n Select: (control) =>\n h(ElementSelect, {\n ...control.attrs,\n value: control.value,\n options: control.options,\n class:\n control.attrs[\"data-adapttable-part\"] === \"filter-operator\"\n ? names().filterOperator\n : names().filterSelect,\n onChange: control.onChange,\n }),\n Checkbox: (control) =>\n h(ElementCheckbox, {\n ...control.attrs,\n checked: control.checked,\n label: control.label,\n labelVisible: true,\n class: names().filterCheckbox,\n onChange: control.onChange,\n }),\n };\n}\n","<script setup lang=\"ts\" generic=\"TRow\">\nimport {\n type DataTableClassNames,\n FilterFieldChrome,\n type FilterFieldOptions,\n useFilterField,\n} from \"@adapttable/vue/adapter\";\n\nimport { elementFilterControls } from \"./fieldControls\";\n\ndefineOptions({ name: \"ElementBasicFilterField\" });\nconst props = defineProps<\n FilterFieldOptions<TRow> & { classNames?: DataTableClassNames }\n>();\nconst model = useFilterField(() => props);\nconst controls = elementFilterControls(() => props.classNames ?? {});\nconst Render = () =>\n FilterFieldChrome({\n model: model.value,\n controls,\n classNames: props.classNames,\n });\nconst renderProps: string[] = [];\nRender.props = renderProps;\n</script>\n\n<template><Render /></template>\n","import {\n ChecklistChrome,\n type ChecklistFilterProps,\n type ChecklistSlots,\n useChecklistModel,\n} from \"@adapttable/vue/adapter\";\nimport { ElText } from \"element-plus\";\nimport {\n createVNode,\n defineComponent,\n h,\n type PropType,\n type SetupContext,\n type VNodeChild,\n} from \"vue\";\n\nimport { elementButton } from \"../controls/button\";\nimport ElementCheckbox from \"../controls/ElementCheckbox.vue\";\nimport ElementInput from \"../controls/ElementInput.vue\";\n\nconst controls: ChecklistSlots<VNodeChild> = {\n Search: (control) =>\n h(ElementInput, {\n type: \"search\",\n value: control.value,\n \"aria-label\": control.label,\n \"data-adapttable-part\": \"filter-checklist-search\",\n class: control.className,\n onChange: control.onChange,\n }),\n Button: (control) =>\n elementButton({ onClick: control.onClick }, control.label),\n Checkbox: (control) =>\n h(\"div\", { class: \"adapttable-element-plus-checklist-option\" }, [\n h(ElementCheckbox, {\n \"data-adapttable-part\": \"filter-checkbox\",\n class: control.className,\n label: control.label,\n labelVisible: true,\n checked: control.checked,\n onChange: control.onChange,\n }),\n h(\n ElText,\n {\n class: control.countClassName,\n \"data-adapttable-part\": \"filter-checklist-count\",\n type: \"info\",\n size: \"small\",\n },\n { default: () => control.count }\n ),\n ]),\n};\n\n// The presentation validates values; its key list preserves generic public\n// components and Vue fallthrough attribute inference.\nconst checklistRuntimeProps = {\n def: { type: Object as PropType<ChecklistFilterProps<unknown>[\"def\"]> },\n source: { type: Object as PropType<ChecklistFilterProps<unknown>[\"source\"]> },\n labels: { type: Object as PropType<ChecklistFilterProps<unknown>[\"labels\"]> },\n classNames: {\n type: Object as PropType<ChecklistFilterProps<unknown>[\"classNames\"]>,\n },\n};\n\nconst ElementChecklistFilterPresentation = defineComponent(\n (props: ChecklistFilterProps<unknown>) => {\n const model = useChecklistModel(() => props);\n return () => ChecklistChrome({ model: model.value, controls });\n },\n {\n name: \"ElementChecklistFilterPresentation\",\n props: checklistRuntimeProps,\n }\n);\n\n/** Preserve the canonical row contract without exposing versioned instance helpers. */\nexport function ElementChecklistFilter<TRow>(\n props: ChecklistFilterProps<TRow>,\n context: Pick<SetupContext, \"attrs\">\n) {\n return createVNode(ElementChecklistFilterPresentation, {\n ...context.attrs,\n ...props,\n });\n}\nElementChecklistFilter.props = Object.keys(checklistRuntimeProps);\n","<script setup lang=\"ts\" generic=\"TRow\">\nimport {\n type DataTableClassNames,\n defaultFilterRegistry,\n type FilterFieldOptions,\n filterLabel,\n filterWidgetKind,\n} from \"@adapttable/vue/adapter\";\nimport { ElFormItem } from \"element-plus\";\n\nimport ElementBasicFilterField from \"./ElementBasicFilterField.vue\";\nimport { ElementChecklistFilter } from \"./ElementChecklistFilter\";\n\ndefineOptions({ name: \"ElementFilterField\" });\nconst props = defineProps<\n FilterFieldOptions<TRow> & { classNames?: DataTableClassNames }\n>();\n</script>\n\n<template>\n <ElFormItem\n v-if=\"\n filterWidgetKind(props.def, props.registry ?? defaultFilterRegistry) ===\n 'checklist'\n \"\n :label=\"filterLabel(props.def)\"\n :class=\"props.classNames?.filterField\"\n data-adapttable-part=\"filter-field\"\n >\n <ElementChecklistFilter\n :def=\"props.def\"\n :source=\"props.source\"\n :labels=\"props.labels\"\n :class-names=\"props.classNames\"\n />\n </ElFormItem>\n <ElementBasicFilterField v-else v-bind=\"props\" />\n</template>\n","import {\n type FilterPanelSurfaceProps,\n FULLSCREEN_MODEL,\n useFeatureState,\n useScopeActivity,\n} from \"@adapttable/vue/adapter\";\nimport {\n type CardInstance,\n ClickOutside,\n ElCard,\n ElDrawer,\n ElPopover,\n} from \"element-plus\";\nimport {\n defineComponent,\n h,\n nextTick,\n onMounted,\n type PropType,\n shallowRef,\n watch,\n withDirectives,\n} from \"vue\";\n\nimport { rtlScrollbarGutter } from \"../scrollbarGutter\";\n\n/** Kit overlays retain their own positioning, focus trap and modal backdrop. */\nexport const ElementFilterSurface = defineComponent(\n (\n props: FilterPanelSurfaceProps & {\n readonly modal: boolean;\n readonly part?: string;\n /** Class for ElDrawer's modal mask, through its `modalClass` hook. */\n readonly backdropClassName?: string;\n }\n ) => {\n const mounted = shallowRef(false);\n const active = useScopeActivity();\n const fullscreen = useFeatureState(FULLSCREEN_MODEL);\n const panel = shallowRef<CardInstance>();\n onMounted(() => {\n mounted.value = true;\n });\n const close: FilterPanelSurfaceProps[\"onClose\"] = (reason) => {\n if (!active.value || !props.open) return;\n props.onClose(reason);\n if (reason === \"escape\") {\n const anchor = props.anchor;\n void nextTick(() => {\n if (\n active.value &&\n !props.open &&\n props.anchor === anchor &&\n anchor?.isConnected\n )\n anchor.focus();\n });\n }\n };\n const outside = (event: MouseEvent) => {\n const target = event.target;\n if (target instanceof Node && props.anchor?.contains(target)) return;\n close(\"outside\");\n };\n const keydown = (event: KeyboardEvent) => {\n if (event.key !== \"Escape\") return;\n // Element's focus trap releases on any Escape that reaches the document,\n // including one an inner control handled or an IME composition owns, so\n // the panel keeps those Escapes inside itself.\n if (event.defaultPrevented || event.isComposing) {\n event.stopPropagation();\n return;\n }\n event.preventDefault();\n event.stopPropagation();\n close(\"escape\");\n };\n // Escape also dismisses while focus is still on the external trigger,\n // before the native enter transition has moved it into the card.\n watch(\n () => active.value && props.open,\n (open, _previous, cleanup) => {\n const document = props.anchor?.ownerDocument;\n if (!open || !document) return;\n document.addEventListener(\"keydown\", keydown);\n cleanup(() => document.removeEventListener(\"keydown\", keydown));\n },\n { immediate: true }\n );\n // A closed native combobox must not swallow the containing overlay's Escape.\n // Open comboboxes keep the event so their own menu closes first.\n const captureKeydown = (event: KeyboardEvent) => {\n const target = event.target;\n if (\n target instanceof Element &&\n target.getAttribute(\"role\") === \"combobox\" &&\n target.getAttribute(\"aria-expanded\") === \"false\"\n )\n keydown(event);\n };\n const focusPanel = () => {\n const element: unknown = panel.value?.$el;\n if (!active.value || !props.open || !(element instanceof HTMLElement))\n return;\n const focused = element.ownerDocument.activeElement;\n if (focused === props.anchor || focused === element.ownerDocument.body)\n element.focus();\n };\n return () => {\n if (!mounted.value || !active.value) return null;\n if (props.modal)\n return h(\n ElDrawer,\n {\n modelValue: props.open,\n title: props.label,\n direction: props.dir === \"rtl\" ? \"ltr\" : \"rtl\",\n appendTo: props.container ?? fullscreen.value?.container ?? \"body\",\n appendToBody: true,\n modal: true,\n modalClass: props.backdropClassName,\n withHeader: false,\n showClose: false,\n destroyOnClose: true,\n // Relative to the drawer's overlay, which excludes a classic\n // scrollbar or a reserved gutter; 100vw does not.\n size: \"min(30rem, 100%)\",\n dir: props.dir,\n class: props.className,\n \"data-adapttable-part\": \"filters-panel\",\n beforeClose: () => close(\"outside\"),\n onKeydown: keydown,\n onKeydownCapture: captureKeydown,\n },\n { default: () => props.children }\n );\n if (!props.anchor) return null;\n return h(\n ElPopover,\n {\n visible: props.open,\n virtualTriggering: true,\n virtualRef: props.anchor,\n trigger: \"click\",\n role: \"dialog\",\n \"aria-label\": props.label,\n placement: props.dir === \"rtl\" ? \"bottom-end\" : \"bottom-start\",\n appendTo: props.container ?? fullscreen.value?.container ?? \"body\",\n teleported: true,\n persistent: false,\n showArrow: false,\n width: \"min(28rem, calc(100vw - 1rem))\",\n popperClass: \"adapttable-element-plus-filter-popover\",\n popperStyle: {\n padding: 0,\n translate: `${rtlScrollbarGutter(props.dir, props.anchor?.ownerDocument.defaultView)} 0`,\n },\n onAfterEnter: focusPanel,\n },\n {\n default: () =>\n withDirectives(\n h(\n ElCard,\n {\n ref: panel,\n shadow: \"never\",\n dir: props.dir,\n tabindex: -1,\n \"aria-label\": props.label,\n \"data-adapttable-part\": props.part ?? \"filters-popover\",\n class: props.className,\n onKeydown: keydown,\n onKeydownCapture: captureKeydown,\n },\n { default: () => props.children }\n ),\n [[ClickOutside, outside]]\n ),\n }\n );\n };\n },\n {\n name: \"ElementFilterSurface\",\n props: {\n className: {\n type: String as PropType<\n (FilterPanelSurfaceProps & {\n readonly modal: boolean;\n readonly part?: string;\n /** Class for ElDrawer's modal mask, through its `modalClass` hook. */\n readonly backdropClassName?: string;\n })[\"className\"]\n >,\n },\n open: {\n type: Boolean as PropType<\n (FilterPanelSurfaceProps & {\n readonly modal: boolean;\n readonly part?: string;\n /** Class for ElDrawer's modal mask, through its `modalClass` hook. */\n readonly backdropClassName?: string;\n })[\"open\"]\n >,\n default: undefined,\n },\n label: {\n type: String as PropType<\n (FilterPanelSurfaceProps & {\n readonly modal: boolean;\n readonly part?: string;\n /** Class for ElDrawer's modal mask, through its `modalClass` hook. */\n readonly backdropClassName?: string;\n })[\"label\"]\n >,\n },\n dir: {\n type: String as PropType<\n (FilterPanelSurfaceProps & {\n readonly modal: boolean;\n readonly part?: string;\n /** Class for ElDrawer's modal mask, through its `modalClass` hook. */\n readonly backdropClassName?: string;\n })[\"dir\"]\n >,\n },\n anchor: {\n type: Object as PropType<\n (FilterPanelSurfaceProps & {\n readonly modal: boolean;\n readonly part?: string;\n /** Class for ElDrawer's modal mask, through its `modalClass` hook. */\n readonly backdropClassName?: string;\n })[\"anchor\"]\n >,\n },\n container: {\n type: Object as PropType<\n (FilterPanelSurfaceProps & {\n readonly modal: boolean;\n readonly part?: string;\n /** Class for ElDrawer's modal mask, through its `modalClass` hook. */\n readonly backdropClassName?: string;\n })[\"container\"]\n >,\n },\n children: {\n type: [String, Number, Boolean, Array, Object] as PropType<\n (FilterPanelSurfaceProps & {\n readonly modal: boolean;\n readonly part?: string;\n /** Class for ElDrawer's modal mask, through its `modalClass` hook. */\n readonly backdropClassName?: string;\n })[\"children\"]\n >,\n default: undefined,\n },\n onClose: {\n type: Function as PropType<\n (FilterPanelSurfaceProps & {\n readonly modal: boolean;\n readonly part?: string;\n /** Class for ElDrawer's modal mask, through its `modalClass` hook. */\n readonly backdropClassName?: string;\n })[\"onClose\"]\n >,\n },\n modal: {\n type: Boolean as PropType<\n (FilterPanelSurfaceProps & {\n readonly modal: boolean;\n readonly part?: string;\n /** Class for ElDrawer's modal mask, through its `modalClass` hook. */\n readonly backdropClassName?: string;\n })[\"modal\"]\n >,\n default: undefined,\n },\n part: {\n type: String as PropType<\n (FilterPanelSurfaceProps & {\n readonly modal: boolean;\n readonly part?: string;\n /** Class for ElDrawer's modal mask, through its `modalClass` hook. */\n readonly backdropClassName?: string;\n })[\"part\"]\n >,\n },\n backdropClassName: {\n type: String as PropType<\n (FilterPanelSurfaceProps & {\n readonly modal: boolean;\n readonly part?: string;\n /** Class for ElDrawer's modal mask, through its `modalClass` hook. */\n readonly backdropClassName?: string;\n })[\"backdropClassName\"]\n >,\n },\n },\n }\n);\n"],"mappings":";;;;;;;;;AAUA,SAAgB,sBACd,OACkB;CAClB,OAAO;EACL,QAAQ,YACN,EAAEA,aAAc;GACd,GAAG,QAAQ;GACX,OAAO,QAAQ;GACf,MAAM,QAAQ;GACd,OAAO,MAAM,CAAC,CAAC;GACf,UAAU,QAAQ;EACpB,CAAC;EACH,SAAS,YACP,EAAEC,aAAe;GACf,GAAG,QAAQ;GACX,OAAO,QAAQ;GACf,SAAS,QAAQ;GACjB,OACE,QAAQ,MAAM,4BAA4B,oBACtC,MAAM,CAAC,CAAC,iBACR,MAAM,CAAC,CAAC;GACd,UAAU,QAAQ;EACpB,CAAC;EACH,WAAW,YACT,EAAEC,aAAiB;GACjB,GAAG,QAAQ;GACX,SAAS,QAAQ;GACjB,OAAO,QAAQ;GACf,cA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,eAAe,MAAM,SAAS,CAClC;EACF,IAAI,CAAC,MAAM,QAAQ,OAAO;EAC1B,OAAO,EACL,WACA;GACE,SAAS,MAAM;GACf,mBAAmB;GACnB,YAAY,MAAM;GAClB,SAAS;GACT,MAAM;GACN,cAAc,MAAM;GACpB,WAAW,MAAM,QAAQ,QAAQ,eAAe;GAChD,UAAU,MAAM,aAAa,WAAW,OAAO,aAAa;GAC5D,YAAY;GACZ,YAAY;GACZ,WAAW;GACX,OAAO;GACP,aAAa;GACb,aAAa;IACX,SAAS;IACT,WAAW,GAAG,mBAAmB,MAAM,KAAK,MAAM,QAAQ,cAAc,WAAW,EAAE;GACvF;GACA,cAAc;EAChB,GACA,EACE,eACE,eACE,EACE,QACA;GACE,KAAK;GACL,QAAQ;GACR,KAAK,MAAM;GACX,UAAU;GACV,cAAc,MAAM;GACpB,wBAAwB,MAAM,QAAQ;GACtC,OAAO,MAAM;GACb,WAAW;GACX,kBAAkB;EACpB,GACA,EAAE,eAAe,MAAM,SAAS,CAClC,GACA,CAAC,CAAC,cAAc,OAAO,CAAC,CAC1B,EACJ,CACF;CACF;AACF,GACA;CACE,MAAM;CACN,OAAO;EACL,WAAW,EACT,MAAM,OAQR;EACA,MAAM;GACJ,MAAM;GAQN,SAAS,KAAA;EACX;EACA,OAAO,EACL,MAAM,OAQR;EACA,KAAK,EACH,MAAM,OAQR;EACA,QAAQ,EACN,MAAM,OAQR;EACA,WAAW,EACT,MAAM,OAQR;EACA,UAAU;GACR,MAAM;IAAC;IAAQ;IAAQ;IAAS;IAAO;GAAM;GAQ7C,SAAS,KAAA;EACX;EACA,SAAS,EACP,MAAM,SAQR;EACA,OAAO;GACL,MAAM;GAQN,SAAS,KAAA;EACX;EACA,MAAM,EACJ,MAAM,OAQR;EACA,mBAAmB,EACjB,MAAM,OAQR;CACF;AACF,CACF"}
|
|
@@ -26,8 +26,12 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
26
26
|
if (typeof value === "string") emit("change", value);
|
|
27
27
|
nextTick(() => control.value?.$forceUpdate());
|
|
28
28
|
}
|
|
29
|
+
function focus() {
|
|
30
|
+
if (control.value) control.value.focus();
|
|
31
|
+
else nextTick(() => control.value?.focus());
|
|
32
|
+
}
|
|
29
33
|
__expose({
|
|
30
|
-
focus
|
|
34
|
+
focus,
|
|
31
35
|
blur: () => control.value?.blur()
|
|
32
36
|
});
|
|
33
37
|
return (_ctx, _cache) => {
|
|
@@ -62,4 +66,4 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
62
66
|
//#endregion
|
|
63
67
|
export { _sfc_main as t };
|
|
64
68
|
|
|
65
|
-
//# sourceMappingURL=ElementSelect-
|
|
69
|
+
//# sourceMappingURL=ElementSelect-BtmVMA7B.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ElementSelect-BtmVMA7B.js","names":["$attrs"],"sources":["../src/controls/ElementSelect.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ElOption, ElSelect, type SelectInstance } from \"element-plus\";\nimport { nextTick, shallowRef } from \"vue\";\n\ndefineOptions({ inheritAttrs: false });\nconst props = withDefaults(\n defineProps<{\n value: string;\n options: readonly { value: string; label: string }[];\n disabled?: boolean;\n teleported?: boolean;\n appendTo?: HTMLElement | string;\n }>(),\n { disabled: false, teleported: false, appendTo: undefined }\n);\nconst emit = defineEmits<{ change: [value: string] }>();\nconst control = shallowRef<SelectInstance>();\nfunction change(value: unknown): void {\n if (typeof value === \"string\") emit(\"change\", value);\n void nextTick(() => control.value?.$forceUpdate());\n}\n// A parent ref resolves before this template ref does, so a focus requested\n// while the select mounts waits a tick for it.\nfunction focus(): void {\n if (control.value) control.value.focus();\n else void nextTick(() => control.value?.focus());\n}\ndefineExpose({\n focus,\n blur: () => control.value?.blur(),\n});\n</script>\n\n<template>\n <ElSelect\n ref=\"control\"\n v-bind=\"$attrs\"\n :model-value=\"props.value\"\n :disabled=\"props.disabled\"\n :teleported=\"props.teleported\"\n :append-to=\"props.appendTo\"\n :validate-event=\"false\"\n @update:model-value=\"change\"\n >\n <ElOption\n v-for=\"option in props.options\"\n :key=\"option.value\"\n :value=\"option.value\"\n :label=\"option.label\"\n />\n </ElSelect>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;EAKA,MAAM,QAAQ;EAUd,MAAM,OAAO;EACb,MAAM,UAAU,WAA2B;EAC3C,SAAS,OAAO,OAAsB;GACpC,IAAI,OAAO,UAAU,UAAU,KAAK,UAAU,KAAK;GACnD,eAAoB,QAAQ,OAAO,aAAa,CAAC;EACnD;EAGA,SAAS,QAAc;GACrB,IAAI,QAAQ,OAAO,QAAQ,MAAM,MAAM;QAClC,eAAoB,QAAQ,OAAO,MAAM,CAAC;EACjD;EACA,SAAa;GACX;GACA,YAAY,QAAQ,OAAO,KAAK;EAClC,CAAC;;GAIC,OAAA,UAAA,GAAA,YAgBW,MAAA,QAAA,GAhBX,WAgBW;IAfL,SAAA;IAAJ,KAAI;GACIA,GAAAA,KAAAA,QAAM;IACb,eAAa,MAAM;IACnB,UAAU,MAAM;IAChB,YAAY,MAAM;IAClB,aAAW,MAAM;IACjB,kBAAgB;IAChB,uBAAoB;;IAGnB,SAAA,cAA+B,EADjC,UAAA,IAAA,GAAA,mBAKE,UAAA,MAAA,WAJiB,MAAM,UAAhB,WAAM;KADf,OAAA,UAAA,GAAA,YAKE,MAAA,QAAA,GAAA;MAHC,KAAK,OAAO;MACZ,OAAO,OAAO;MACd,OAAO,OAAO"}
|
|
@@ -26,8 +26,12 @@ const _sfc_main = /*@__PURE__*/ (0, vue.defineComponent)({
|
|
|
26
26
|
if (typeof value === "string") emit("change", value);
|
|
27
27
|
(0, vue.nextTick)(() => control.value?.$forceUpdate());
|
|
28
28
|
}
|
|
29
|
+
function focus() {
|
|
30
|
+
if (control.value) control.value.focus();
|
|
31
|
+
else (0, vue.nextTick)(() => control.value?.focus());
|
|
32
|
+
}
|
|
29
33
|
__expose({
|
|
30
|
-
focus
|
|
34
|
+
focus,
|
|
31
35
|
blur: () => control.value?.blur()
|
|
32
36
|
});
|
|
33
37
|
return (_ctx, _cache) => {
|
|
@@ -67,4 +71,4 @@ Object.defineProperty(exports, "_sfc_main", {
|
|
|
67
71
|
}
|
|
68
72
|
});
|
|
69
73
|
|
|
70
|
-
//# sourceMappingURL=ElementSelect-
|
|
74
|
+
//# sourceMappingURL=ElementSelect-CvGw_zHh.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ElementSelect-CvGw_zHh.cjs","names":["$attrs"],"sources":["../src/controls/ElementSelect.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ElOption, ElSelect, type SelectInstance } from \"element-plus\";\nimport { nextTick, shallowRef } from \"vue\";\n\ndefineOptions({ inheritAttrs: false });\nconst props = withDefaults(\n defineProps<{\n value: string;\n options: readonly { value: string; label: string }[];\n disabled?: boolean;\n teleported?: boolean;\n appendTo?: HTMLElement | string;\n }>(),\n { disabled: false, teleported: false, appendTo: undefined }\n);\nconst emit = defineEmits<{ change: [value: string] }>();\nconst control = shallowRef<SelectInstance>();\nfunction change(value: unknown): void {\n if (typeof value === \"string\") emit(\"change\", value);\n void nextTick(() => control.value?.$forceUpdate());\n}\n// A parent ref resolves before this template ref does, so a focus requested\n// while the select mounts waits a tick for it.\nfunction focus(): void {\n if (control.value) control.value.focus();\n else void nextTick(() => control.value?.focus());\n}\ndefineExpose({\n focus,\n blur: () => control.value?.blur(),\n});\n</script>\n\n<template>\n <ElSelect\n ref=\"control\"\n v-bind=\"$attrs\"\n :model-value=\"props.value\"\n :disabled=\"props.disabled\"\n :teleported=\"props.teleported\"\n :append-to=\"props.appendTo\"\n :validate-event=\"false\"\n @update:model-value=\"change\"\n >\n <ElOption\n v-for=\"option in props.options\"\n :key=\"option.value\"\n :value=\"option.value\"\n :label=\"option.label\"\n />\n </ElSelect>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;EAKA,MAAM,QAAQ;EAUd,MAAM,OAAO;EACb,MAAM,WAAA,GAAU,IAAA,WAAA,CAA2B;EAC3C,SAAS,OAAO,OAAsB;GACpC,IAAI,OAAO,UAAU,UAAU,KAAK,UAAU,KAAK;GACnD,CAAA,GAAK,IAAA,SAAA,OAAe,QAAQ,OAAO,aAAa,CAAC;EACnD;EAGA,SAAS,QAAc;GACrB,IAAI,QAAQ,OAAO,QAAQ,MAAM,MAAM;QAClC,CAAA,GAAK,IAAA,SAAA,OAAe,QAAQ,OAAO,MAAM,CAAC;EACjD;EACA,SAAa;GACX;GACA,YAAY,QAAQ,OAAO,KAAK;EAClC,CAAC;;GAIC,QAAA,GAAA,IAAA,UAAA,CAAA,IAAA,GAAA,IAAA,YAAA,EAAA,GAgBW,IAAA,MAAA,CAAA,aAAA,QAAA,IAAA,GAhBX,IAAA,WAAA,CAgBW;IAfL,SAAA;IAAJ,KAAI;GACIA,GAAAA,KAAAA,QAAM;IACb,eAAa,MAAM;IACnB,UAAU,MAAM;IAChB,YAAY,MAAM;IAClB,aAAW,MAAM;IACjB,kBAAgB;IAChB,uBAAoB;;IAGnB,UAAA,GAAA,IAAA,QAAA,OAA+B,GAAA,GADjC,IAAA,UAAA,CAAA,IAAA,IAAA,GAAA,IAAA,mBAAA,CAKE,IAAA,UAAA,OAAA,GAAA,IAAA,WAAA,CAJiB,MAAM,UAAhB,WAAM;KADf,QAAA,GAAA,IAAA,UAAA,CAAA,IAAA,GAAA,IAAA,YAAA,EAAA,GAKE,IAAA,MAAA,CAAA,aAAA,QAAA,GAAA;MAHC,KAAK,OAAO;MACZ,OAAO,OAAO;MACd,OAAO,OAAO"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
const require_button = require("./button-BFjBL9m3.cjs");
|
|
2
2
|
const require_ElementInput = require("./ElementInput-vBVDBaLp.cjs");
|
|
3
|
-
const require_ElementSelect = require("./ElementSelect-
|
|
3
|
+
const require_ElementSelect = require("./ElementSelect-CvGw_zHh.cjs");
|
|
4
4
|
const require_ElementCard = require("./ElementCard-BRZekaHr.cjs");
|
|
5
5
|
let vue = require("vue");
|
|
6
6
|
let _adapttable_vue_adapter = require("@adapttable/vue/adapter");
|
|
@@ -203,6 +203,7 @@ const elementAssistantControls = {
|
|
|
203
203
|
type: TAG_TYPE[props.tone],
|
|
204
204
|
size: "small",
|
|
205
205
|
effect: "light",
|
|
206
|
+
style: props.tone === "neutral" || props.tone === "warning" ? { "--el-tag-text-color": "var(--el-text-color-regular)" } : void 0,
|
|
206
207
|
class: props.className
|
|
207
208
|
}, { default: () => props.label }),
|
|
208
209
|
Panel: (props) => (0, vue.h)(require_ElementCard.ElementCard, { attrs: {
|
|
@@ -325,4 +326,4 @@ Object.defineProperty(exports, "tableAssistant", {
|
|
|
325
326
|
}
|
|
326
327
|
});
|
|
327
328
|
|
|
328
|
-
//# sourceMappingURL=assistant-
|
|
329
|
+
//# sourceMappingURL=assistant-B27ZguV8.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"assistant-B27ZguV8.cjs","names":["h","ElDropdownItem","defineComponent","useScopeActivity","shallowRef","ElDropdown","elementButton","ElDropdownMenu","defineComponent","useScopeActivity","h","ElDrawer","elementButton","h","ElementInput","ElTag","ElementCard","ElementSelect","defineComponent","h","TableAssistantChrome","AgentApprovalChrome","createAdapterTableAssistantFeature","createAdapterAgentApprovalFeature"],"sources":["../src/assistant/ExamplesMenu.ts","../src/assistant/Sheet.ts","../src/assistant/controls.ts","../src/assistant.ts"],"sourcesContent":["import {\n type TableAssistantMenuProps,\n useScopeActivity,\n} from \"@adapttable/vue/adapter\";\nimport {\n type DropdownInstance,\n ElDropdown,\n ElDropdownItem,\n ElDropdownMenu,\n} from \"element-plus\";\nimport { defineComponent, h, type PropType, shallowRef, watch } from \"vue\";\n\nimport { elementButton } from \"../controls/button\";\n\n/** One shortcut: its icon, title and optional description. */\nfunction menuItem(item: TableAssistantMenuProps[\"items\"][number]) {\n return h(\n ElDropdownItem,\n { key: item.id, command: item.id, \"data-adapttable-part\": item.part },\n {\n default: () => [\n item.icon,\n h(\"span\", [\n h(\"strong\", item.title),\n item.description ? h(\"small\", item.description) : null,\n ]),\n ],\n }\n );\n}\n\n/** The assistant's shortcuts in an Element Plus dropdown under its trigger. */\nexport const ElementExamplesMenu = defineComponent(\n (props: TableAssistantMenuProps) => {\n const active = useScopeActivity();\n const dropdown = shallowRef<DropdownInstance>();\n const trigger = shallowRef<HTMLElement | null>(null);\n const open = shallowRef(false);\n let generation = 0;\n watch(\n [active, () => props.disabled, () => props.items, () => props.onSelect],\n () => {\n generation++;\n dropdown.value?.handleClose();\n },\n { flush: \"sync\" }\n );\n // The menu closes itself on Escape and hands focus back to its trigger,\n // so an Escape inside it never reaches the surface around the trigger.\n const keydown = (event: KeyboardEvent) => {\n if (event.key !== \"Escape\" || event.isComposing) return;\n event.preventDefault();\n event.stopPropagation();\n dropdown.value?.handleClose();\n trigger.value?.focus({ preventScroll: true });\n };\n return () => {\n if (!active.value) return null;\n const ticket = generation;\n const current = () =>\n active.value && !props.disabled && ticket === generation;\n return h(\n ElDropdown,\n {\n ref: dropdown,\n trigger: \"click\",\n persistent: false,\n hideTimeout: 0,\n disabled: props.disabled,\n maxHeight: props.maxHeight,\n onVisibleChange: (value: boolean) => {\n open.value = value;\n },\n onCommand: (id: unknown) => {\n if (\n current() &&\n typeof id === \"string\" &&\n props.items.some((item) => item.id === id)\n )\n props.onSelect(id);\n },\n },\n {\n default: () =>\n elementButton(\n {\n ref: (element: HTMLElement | null) => {\n trigger.value = element;\n },\n type: \"button\",\n disabled: props.disabled,\n \"aria-label\": props.label,\n title: props.label,\n class: props.className,\n \"data-adapttable-part\": props.part,\n onKeydown: (event: KeyboardEvent) => {\n if (open.value) keydown(event);\n },\n },\n [props.icon ?? props.label]\n ),\n dropdown: () =>\n h(\n ElDropdownMenu,\n // Captured on the list so an Escape from any item reaches it\n // before Element's own handling moves focus into the list.\n { \"aria-label\": props.label, onKeydownCapture: keydown },\n { default: () => props.items.map(menuItem) }\n ),\n }\n );\n };\n },\n {\n name: \"ElementExamplesMenu\",\n props: {\n label: { type: String as PropType<TableAssistantMenuProps[\"label\"]> },\n part: { type: String as PropType<TableAssistantMenuProps[\"part\"]> },\n className: {\n type: String as PropType<TableAssistantMenuProps[\"className\"]>,\n },\n icon: {\n type: [String, Number, Boolean, Array, Object] as PropType<\n TableAssistantMenuProps[\"icon\"]\n >,\n default: undefined,\n },\n disabled: {\n type: Boolean as PropType<TableAssistantMenuProps[\"disabled\"]>,\n default: undefined,\n },\n items: { type: Array as PropType<TableAssistantMenuProps[\"items\"]> },\n onSelect: {\n type: Function as PropType<TableAssistantMenuProps[\"onSelect\"]>,\n },\n maxHeight: {\n type: String as PropType<TableAssistantMenuProps[\"maxHeight\"]>,\n },\n },\n }\n);\n","import {\n type TableAssistantSheetProps,\n useScopeActivity,\n} from \"@adapttable/vue/adapter\";\nimport { ElDrawer } from \"element-plus\";\nimport { defineComponent, h, type PropType } from \"vue\";\n\n/**\n * Chrome chooses initial and return focus; ElDrawer contains focus and owns\n * the portal. Escape and backdrop dismissal become one close request to the\n * host, and the drawer stays open until the host closes it.\n */\nexport const ElementAssistantSheet = defineComponent(\n (props: TableAssistantSheetProps) => {\n const active = useScopeActivity();\n const requestClose = () => {\n if (active.value && props.open) props.onClose();\n };\n const preventDefault = (event: Event) => event.preventDefault();\n const keydown = (event: KeyboardEvent) => {\n if (event.key !== \"Escape\" || event.defaultPrevented || event.isComposing)\n return;\n event.preventDefault();\n event.stopPropagation();\n requestClose();\n };\n return () => {\n if (!active.value) return null;\n return h(\n ElDrawer,\n {\n modelValue: props.open,\n direction: props.dir === \"rtl\" ? \"ltr\" : \"rtl\",\n size: \"min(28rem, 100vw)\",\n withHeader: false,\n showClose: false,\n appendToBody: true,\n destroyOnClose: true,\n closeOnPressEscape: false,\n title: props.label,\n \"aria-label\": props.label,\n dir: props.dir,\n class: [\"adapttable-element-plus-assistant-sheet\", props.className],\n \"data-adapttable-part\": props.part,\n beforeClose: requestClose,\n onKeydown: keydown,\n // Chrome places the initial focus and returns it to the launcher;\n // the drawer's trap only keeps focus inside while open.\n \"on:focus-trap.focus-after-trapped\": preventDefault,\n \"on:focus-trap.focus-after-released\": preventDefault,\n },\n { default: () => props.children }\n );\n };\n },\n {\n name: \"ElementAssistantSheet\",\n props: {\n label: { type: String as PropType<TableAssistantSheetProps[\"label\"]> },\n part: { type: String as PropType<TableAssistantSheetProps[\"part\"]> },\n className: {\n type: String as PropType<TableAssistantSheetProps[\"className\"]>,\n },\n dir: { type: String as PropType<TableAssistantSheetProps[\"dir\"]> },\n open: {\n type: Boolean as PropType<TableAssistantSheetProps[\"open\"]>,\n default: undefined,\n },\n onClose: {\n type: Function as PropType<TableAssistantSheetProps[\"onClose\"]>,\n },\n children: {\n type: [String, Number, Boolean, Array, Object] as PropType<\n TableAssistantSheetProps[\"children\"]\n >,\n default: undefined,\n },\n },\n }\n);\n","import type {\n ApprovalReviewSlots,\n TableAssistantSlots,\n} from \"@adapttable/vue/adapter\";\nimport { ElTag } from \"element-plus\";\nimport { h } from \"vue\";\n\nimport { elementButton } from \"../controls/button\";\nimport ElementInput from \"../controls/ElementInput.vue\";\nimport ElementSelect from \"../controls/ElementSelect.vue\";\nimport { ElementCard } from \"../presentation/ElementCard\";\nimport { ElementExamplesMenu } from \"./ExamplesMenu\";\nimport { ElementAssistantSheet } from \"./Sheet\";\n\n/** Element Plus tag types for the assistant's status tones. */\nconst TAG_TYPE = {\n neutral: \"info\",\n busy: \"primary\",\n warning: \"warning\",\n danger: \"danger\",\n} as const;\n\nexport const elementAssistantControls: TableAssistantSlots = {\n Button: (props) =>\n elementButton(\n {\n type: \"button\",\n \"data-adapttable-part\": props.part,\n \"aria-label\": props.label,\n \"aria-expanded\": props.expanded,\n title: props.tooltip,\n class: props.className,\n disabled: props.disabled,\n onClick: props.onClick,\n },\n [\n props.icon,\n props.iconOnly && props.icon ? null : (props.children ?? props.label),\n ]\n ),\n Composer: (props) =>\n h(ElementInput, {\n type: \"textarea\",\n rows: 1,\n value: props.value,\n disabled: props.disabled,\n \"data-adapttable-part\": props.part,\n \"aria-label\": props.label,\n placeholder: props.placeholder,\n class: [\"adapttable-element-plus-assistant-input\", props.className],\n onChange: props.onChange,\n onKeydown: props.onKeyDown,\n }),\n Badge: (props) =>\n h(\n ElTag,\n {\n \"data-adapttable-part\": props.part,\n \"data-tone\": props.tone,\n type: TAG_TYPE[props.tone],\n size: \"small\",\n effect: \"light\",\n style:\n props.tone === \"neutral\" || props.tone === \"warning\"\n ? { \"--el-tag-text-color\": \"var(--el-text-color-regular)\" }\n : undefined,\n class: props.className,\n },\n { default: () => props.label }\n ),\n Panel: (props) =>\n h(\n ElementCard,\n {\n attrs: {\n role: \"region\",\n \"data-adapttable-part\": props.part,\n \"aria-label\": props.label,\n class: [\"adapttable-element-plus-assistant-panel\", props.className],\n },\n },\n { default: () => props.children }\n ),\n Window: (props) =>\n h(\n ElementCard,\n {\n attrs: {\n role: \"region\",\n \"data-adapttable-part\": props.part,\n \"aria-label\": props.label,\n class: [\"adapttable-element-plus-assistant-window\", props.className],\n style: props.style,\n },\n },\n { default: () => props.children }\n ),\n Sheet: (props) => h(ElementAssistantSheet, { ...props, key: props.part }),\n Menu: (props) => h(ElementExamplesMenu, props),\n LanguageChip: (props) =>\n h(ElementSelect, {\n \"data-adapttable-part\": props.part,\n \"aria-label\": props.label,\n class: props.className,\n disabled: props.disabled,\n value: props.value,\n options: props.options,\n onChange: props.onChange,\n }),\n};\n\nexport const elementApprovalControls: ApprovalReviewSlots = {\n Approve: elementAssistantControls.Button,\n Reject: elementAssistantControls.Button,\n Action: elementAssistantControls.Button,\n List: (props) =>\n h(\n \"ul\",\n {\n \"data-adapttable-part\": props.part,\n \"aria-label\": props.label,\n class: [\"adapttable-element-plus-approval-list\", props.className],\n },\n [props.children]\n ),\n};\n","/** Optional assistant presentation; all conversation and approval state stays in the binding. */\nimport \"./assistant/assistant.css\";\n\nimport type { StaticTableFeature } from \"@adapttable/vue\";\nimport {\n AgentApprovalChrome,\n type AgentApprovalProps,\n createAdapterAgentApprovalFeature,\n createAdapterTableAssistantFeature,\n TableAssistantChrome,\n type TableAssistantProps,\n} from \"@adapttable/vue/adapter\";\nimport { defineComponent, h, type PropType } from \"vue\";\n\nimport {\n elementApprovalControls,\n elementAssistantControls,\n} from \"./assistant/controls\";\n\nexport const TableAssistant = defineComponent(\n (props: TableAssistantProps) => () =>\n h(TableAssistantChrome, {\n ...props,\n accent: props.accent ?? \"var(--el-color-primary)\",\n slots: elementAssistantControls,\n }),\n {\n name: \"ElementTableAssistant\",\n props: {\n assistant: { type: Object as PropType<TableAssistantProps[\"assistant\"]> },\n speech: { type: Object as PropType<TableAssistantProps[\"speech\"]> },\n open: {\n type: Boolean as PropType<TableAssistantProps[\"open\"]>,\n default: undefined,\n },\n onOpenChange: {\n type: Function as PropType<TableAssistantProps[\"onOpenChange\"]>,\n },\n presentation: {\n type: String as PropType<TableAssistantProps[\"presentation\"]>,\n },\n labels: { type: Object as PropType<TableAssistantProps[\"labels\"]> },\n accent: { type: String as PropType<TableAssistantProps[\"accent\"]> },\n receipts: {\n type: Boolean as PropType<TableAssistantProps[\"receipts\"]>,\n default: undefined,\n },\n className: { type: String as PropType<TableAssistantProps[\"className\"]> },\n launcher: {\n type: Boolean as PropType<TableAssistantProps[\"launcher\"]>,\n default: undefined,\n },\n onSettings: {\n type: Function as PropType<TableAssistantProps[\"onSettings\"]>,\n },\n boundary: {\n type: [String, Object] as PropType<TableAssistantProps[\"boundary\"]>,\n },\n note: { type: String as PropType<TableAssistantProps[\"note\"]> },\n greeting: { type: String as PropType<TableAssistantProps[\"greeting\"]> },\n avatars: { type: Object as PropType<TableAssistantProps[\"avatars\"]> },\n messageAction: {\n type: Function as PropType<TableAssistantProps[\"messageAction\"]>,\n },\n approval: { type: Object as PropType<TableAssistantProps[\"approval\"]> },\n dir: { type: String as PropType<TableAssistantProps[\"dir\"]> },\n },\n }\n);\nexport const AgentApproval = defineComponent(\n (props: AgentApprovalProps) => () =>\n h(AgentApprovalChrome, { ...props, slots: elementApprovalControls }),\n {\n name: \"ElementAgentApproval\",\n props: {\n pending: { type: Object as PropType<AgentApprovalProps[\"pending\"]> },\n labels: { type: Object as PropType<AgentApprovalProps[\"labels\"]> },\n className: { type: String as PropType<AgentApprovalProps[\"className\"]> },\n buttonClassName: {\n type: String as PropType<AgentApprovalProps[\"buttonClassName\"]>,\n },\n },\n }\n);\nexport function tableAssistant(): StaticTableFeature {\n return createAdapterTableAssistantFeature((props) =>\n h(TableAssistant, props)\n );\n}\nexport function agentApproval(): StaticTableFeature {\n return createAdapterAgentApprovalFeature((props) => h(AgentApproval, props));\n}\nexport type {\n AgentApprovalProps,\n TableAssistantProps,\n} from \"@adapttable/vue/adapter\";\n"],"mappings":";;;;;;;;;AAeA,SAAS,SAAS,MAAgD;CAChE,QAAA,GAAOA,IAAAA,EAAAA,CACLC,aAAAA,gBACA;EAAE,KAAK,KAAK;EAAI,SAAS,KAAK;EAAI,wBAAwB,KAAK;CAAK,GACpE,EACE,eAAe,CACb,KAAK,OAAA,GACLD,IAAAA,EAAAA,CAAE,QAAQ,EAAA,GACRA,IAAAA,EAAAA,CAAE,UAAU,KAAK,KAAK,GACtB,KAAK,eAAA,GAAcA,IAAAA,EAAAA,CAAE,SAAS,KAAK,WAAW,IAAI,IACpD,CAAC,CACH,EACF,CACF;AACF;;AAGA,MAAa,uBAAA,GAAsBE,IAAAA,gBAAAA,EAChC,UAAmC;CAClC,MAAM,UAAA,GAASC,wBAAAA,iBAAAA,CAAiB;CAChC,MAAM,YAAA,GAAWC,IAAAA,WAAAA,CAA6B;CAC9C,MAAM,WAAA,GAAUA,IAAAA,WAAAA,CAA+B,IAAI;CACnD,MAAM,QAAA,GAAOA,IAAAA,WAAAA,CAAW,KAAK;CAC7B,IAAI,aAAa;CACjB,CAAA,GAAA,IAAA,MAAA,CACE;EAAC;QAAc,MAAM;QAAgB,MAAM;QAAa,MAAM;CAAQ,SAChE;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