@j-solution/components 1.1.0 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/USAGE_GUIDE.md +1068 -61
- package/assets/jwms-portal-frontend-D8DdrheA.css +1 -0
- package/assets/styles/j-components.css +1 -1
- package/components/atoms/JEditor.vue.cjs +7 -0
- package/components/atoms/JEditor.vue.cjs.map +1 -0
- package/components/atoms/JEditor.vue.js +13 -0
- package/components/atoms/JEditor.vue.js.map +1 -0
- package/components/atoms/JEditor.vue2.cjs +2 -0
- package/components/atoms/JEditor.vue2.cjs.map +1 -0
- package/components/atoms/JEditor.vue2.js +43 -0
- package/components/atoms/JEditor.vue2.js.map +1 -0
- package/components/atoms/JPreview.vue.cjs +7 -0
- package/components/atoms/JPreview.vue.cjs.map +1 -0
- package/components/atoms/JPreview.vue.js +13 -0
- package/components/atoms/JPreview.vue.js.map +1 -0
- package/components/atoms/JPreview.vue2.cjs +2 -0
- package/components/atoms/JPreview.vue2.cjs.map +1 -0
- package/components/atoms/JPreview.vue2.js +121 -0
- package/components/atoms/JPreview.vue2.js.map +1 -0
- package/components/molecules/JAlert.vue.cjs +1 -1
- package/components/molecules/JAlert.vue.cjs.map +1 -1
- package/components/molecules/JAlert.vue.js +26 -20
- package/components/molecules/JAlert.vue.js.map +1 -1
- package/components/molecules/JFormField.vue.cjs +1 -1
- package/components/molecules/JFormField.vue.cjs.map +1 -1
- package/components/molecules/JFormField.vue.js +8 -2
- package/components/molecules/JFormField.vue.js.map +1 -1
- package/components/molecules/JTitlebar.vue.cjs +1 -1
- package/components/molecules/JTitlebar.vue.cjs.map +1 -1
- package/components/molecules/JTitlebar.vue.js +26 -20
- package/components/molecules/JTitlebar.vue.js.map +1 -1
- package/components/organisms/JDynamicForm.vue2.cjs +1 -1
- package/components/organisms/JDynamicForm.vue2.cjs.map +1 -1
- package/components/organisms/JDynamicForm.vue2.js +8 -2
- package/components/organisms/JDynamicForm.vue2.js.map +1 -1
- package/components/organisms/JFormModal.vue.cjs +1 -1
- package/components/organisms/JFormModal.vue.cjs.map +1 -1
- package/components/organisms/JFormModal.vue.js +21 -15
- package/components/organisms/JFormModal.vue.js.map +1 -1
- package/components/organisms/JModal.vue.cjs +1 -1
- package/components/organisms/JModal.vue.cjs.map +1 -1
- package/components/organisms/JModal.vue.js +22 -16
- package/components/organisms/JModal.vue.js.map +1 -1
- package/components/organisms/JSearchPanel.vue2.cjs +1 -1
- package/components/organisms/JSearchPanel.vue2.cjs.map +1 -1
- package/components/organisms/JSearchPanel.vue2.js +45 -39
- package/components/organisms/JSearchPanel.vue2.js.map +1 -1
- package/index.cjs +1 -1
- package/index.js +82 -76
- package/package.json +3 -1
- package/tailwind.config.js +2 -1
- package/types/index.d.ts +141 -90
- package/assets/jwms-portal-frontend-BqyV9oqF.css +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue");require("../shadcn/index.cjs");const i=require("../atoms/JButton.vue.cjs");require("lucide-vue-next");require("clsx");require("tailwind-merge");require("@internationalized/date");require("../shadcn/badge-variants.cjs");require("@vueuse/core");require("reka-ui");;/* empty css */require("../shadcn/avatar-variants.cjs");require("ag-grid-vue3");require("ag-grid-community");require("ag-grid-enterprise");;/* empty css */;/* empty css */;/* empty css */;/* empty css */const
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue");require("../shadcn/index.cjs");const i=require("../atoms/JButton.vue.cjs");require("lucide-vue-next");require("clsx");require("tailwind-merge");require("@internationalized/date");require("md-editor-v3");;/* empty css */;/* empty css */require("../shadcn/badge-variants.cjs");require("@vueuse/core");require("reka-ui");;/* empty css */require("../shadcn/avatar-variants.cjs");require("dompurify");;/* empty css */require("ag-grid-vue3");require("ag-grid-community");require("ag-grid-enterprise");;/* empty css */;/* empty css */;/* empty css */;/* empty css */require("vue-sonner");const q=require("../molecules/JFormField.vue.cjs");;/* empty css */;/* empty css */;/* empty css */;/* empty css */const y=require("../shadcn/Dialog.vue.cjs"),v=require("../shadcn/DialogContent.vue.cjs"),x=require("../shadcn/DialogHeader.vue.cjs"),_=require("../shadcn/DialogTitle.vue.cjs"),g=require("../shadcn/DialogBody.vue.cjs"),F=require("../shadcn/DialogFooter.vue.cjs"),V={class:"space-y-4"},b={key:0,class:"text-sm text-muted-foreground"},C={key:1},h=e.defineComponent({__name:"JModal",props:{open:{type:Boolean,default:!1},title:{},description:{},size:{default:"md"},showFormField:{type:Boolean,default:!1},formFieldLabel:{},formFieldError:{},formFieldRequired:{type:Boolean},formFieldInputType:{default:"text"},formFieldInputPlaceholder:{},formFieldValue:{},formFieldType:{default:"input"},buttonType:{default:"OkCancel"},confirmText:{default:"확인"},cancelText:{default:"취소"},confirmVariant:{default:"default"},confirmDisabled:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1}},emits:["update:open","confirm","cancel"],setup(t,{emit:d}){const l=t,u=d,a=e.ref(l.formFieldValue||""),c=e.computed(()=>`modal-input-${Math.random().toString(36).substr(2,9)}`),s=e.computed(()=>({sm:"!max-w-sm",md:"!max-w-md",lg:"!max-w-2xl",xl:"!max-w-4xl","2xl":"!max-w-6xl",full:"!max-w-[95vw]"})[l.size]);e.watch(()=>l.formFieldValue,r=>{r!==void 0&&(a.value=r)});const f=r=>{u("update:open",r)},o=()=>{const r=l.showFormField?a.value:void 0;u("confirm",r)},m=()=>{u("cancel"),a.value=l.formFieldValue||""};return(r,n)=>(e.openBlock(),e.createBlock(e.unref(y.default),{open:t.open,"onUpdate:open":f,class:e.normalizeClass(s.value)},{default:e.withCtx(()=>[e.createVNode(e.unref(v.default),null,{default:e.withCtx(()=>[t.title?(e.openBlock(),e.createBlock(e.unref(x.default),{key:0,class:"bg-muted/50 border-b"},{default:e.withCtx(()=>[e.createVNode(e.unref(_.default),null,{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.title),1)]),_:1})]),_:1})):e.createCommentVNode("",!0),e.createVNode(e.unref(g.default),null,{default:e.withCtx(()=>[e.createElementVNode("div",V,[t.description?(e.openBlock(),e.createElementBlock("p",b,e.toDisplayString(t.description),1)):e.createCommentVNode("",!0),t.showFormField?(e.openBlock(),e.createElementBlock("div",C,[e.createVNode(e.unref(q.default),{label:t.formFieldLabel,"error-msg":t.formFieldError,required:t.formFieldRequired,type:t.formFieldType,id:c.value,modelValue:a.value,"onUpdate:modelValue":n[0]||(n[0]=p=>a.value=p),"input-type":t.formFieldInputType,placeholder:t.formFieldInputPlaceholder,disabled:t.disabled},null,8,["label","error-msg","required","type","id","modelValue","input-type","placeholder","disabled"])])):e.createCommentVNode("",!0),e.renderSlot(r.$slots,"body")])]),_:3}),e.createVNode(e.unref(F.default),null,{default:e.withCtx(()=>[t.buttonType==="OkCancel"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createVNode(e.unref(i.default),{variant:"outline",onClick:m},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.cancelText),1)]),_:1}),e.createVNode(e.unref(i.default),{variant:t.confirmVariant,disabled:t.confirmDisabled,onClick:o},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.confirmText),1)]),_:1},8,["variant","disabled"])],64)):t.buttonType==="Ok"?(e.openBlock(),e.createBlock(e.unref(i.default),{key:1,variant:t.confirmVariant,disabled:t.confirmDisabled,onClick:o,class:"w-full"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.confirmText),1)]),_:1},8,["variant","disabled"])):e.createCommentVNode("",!0)]),_:1})]),_:3})]),_:3},8,["open","class"]))}});exports.default=h;
|
|
2
2
|
//# sourceMappingURL=JModal.vue.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"JModal.vue.cjs","sources":["../../../../src/components/organisms/JModal.vue"],"sourcesContent":["<template>\r\n <Dialog\r\n :open=\"open\"\r\n @update:open=\"onOpenChange\"\r\n :class=\"sizeClass\"\r\n >\r\n <DialogContent>\r\n <!-- Header -->\r\n <DialogHeader v-if=\"title\" class=\"bg-muted/50 border-b\">\r\n <DialogTitle>\r\n {{ title }}\r\n </DialogTitle>\r\n </DialogHeader>\r\n\r\n <!-- Body -->\r\n <DialogBody>\r\n <div class=\"space-y-4\">\r\n <!-- Description -->\r\n <p v-if=\"description\" class=\"text-sm text-muted-foreground\">\r\n {{ description }}\r\n </p>\r\n\r\n <!-- JFormField가 있는 경우 -->\r\n <div v-if=\"showFormField\">\r\n <JFormField\r\n :label=\"formFieldLabel\"\r\n :error-msg=\"formFieldError\"\r\n :required=\"formFieldRequired\"\r\n :type=\"formFieldType\"\r\n :id=\"inputId\"\r\n v-model=\"inputValue\"\r\n :input-type=\"formFieldInputType\"\r\n :placeholder=\"formFieldInputPlaceholder\"\r\n :disabled=\"disabled\"\r\n />\r\n </div>\r\n\r\n <!-- 커스텀 컨텐츠 슬롯 -->\r\n <slot name=\"body\" />\r\n </div>\r\n </DialogBody>\r\n\r\n <!-- Footer -->\r\n <DialogFooter>\r\n <!-- 확인/취소 버튼 -->\r\n <template v-if=\"buttonType === 'OkCancel'\">\r\n <JButton\r\n variant=\"outline\"\r\n @click=\"handleCancel\"\r\n >\r\n {{ cancelText }}\r\n </JButton>\r\n <JButton\r\n :variant=\"confirmVariant\"\r\n :disabled=\"confirmDisabled\"\r\n @click=\"handleConfirm\"\r\n >\r\n {{ confirmText }}\r\n </JButton>\r\n </template>\r\n \r\n <!-- 확인 버튼만 -->\r\n <template v-else-if=\"buttonType === 'Ok'\">\r\n <JButton\r\n :variant=\"confirmVariant\"\r\n :disabled=\"confirmDisabled\"\r\n @click=\"handleConfirm\"\r\n class=\"w-full\"\r\n >\r\n {{ confirmText }}\r\n </JButton>\r\n </template>\r\n </DialogFooter>\r\n </DialogContent>\r\n </Dialog>\r\n</template>\r\n\r\n<script setup lang=\"ts\">\r\nimport { computed, ref, watch } from 'vue'\r\nimport {\r\n Dialog,\r\n DialogBody,\r\n DialogContent,\r\n DialogFooter,\r\n DialogHeader,\r\n DialogTitle,\r\n} from '@/components/shadcn'\r\nimport { JButton } from '@/components/atoms'\r\nimport { JFormField } from '@/components/molecules'\r\n\r\nexport interface JModalProps {\r\n // 모달 표시 여부\r\n open: boolean\r\n // 헤더\r\n title?: string\r\n description?: string\r\n // 모달 사이즈\r\n size?: 'sm' | 'md' | 'lg' | 'xl' | '2xl' | 'full'\r\n // 폼 필드 (JFormField)\r\n showFormField?: boolean\r\n formFieldLabel?: string\r\n formFieldError?: string\r\n formFieldRequired?: boolean\r\n // 입력 필드 설정\r\n formFieldInputType?: 'text' | 'email' | 'password' | 'number' | 'tel' | 'url'\r\n formFieldInputPlaceholder?: string\r\n formFieldValue?: string\r\n formFieldType?: 'input' | 'textarea' | 'checkbox' | 'switch' | 'combo' | 'radio' | 'searchCombo' | 'datepicker'\r\n // 버튼 설정\r\n buttonType?: 'Ok' | 'OkCancel'\r\n confirmText?: string\r\n cancelText?: string\r\n confirmVariant?: 'default' | 'destructive' | 'outline' | 'secondary' | 'ghost' | 'link'\r\n confirmDisabled?: boolean\r\n // 기타\r\n disabled?: boolean\r\n}\r\n\r\nconst props = withDefaults(defineProps<JModalProps>(), {\r\n open: false,\r\n size: 'md',\r\n showFormField: false,\r\n formFieldInputType: 'text',\r\n formFieldType: 'input',\r\n buttonType: 'OkCancel',\r\n confirmText: '확인',\r\n cancelText: '취소',\r\n confirmVariant: 'default',\r\n confirmDisabled: false,\r\n disabled: false,\r\n})\r\n\r\nconst emit = defineEmits<{\r\n 'update:open': [value: boolean]\r\n 'confirm': [value?: string]\r\n 'cancel': []\r\n}>()\r\n\r\n// 입력값 관리\r\nconst inputValue = ref(props.formFieldValue || '')\r\n\r\n// 입력 필드 ID 생성\r\nconst inputId = computed(() => `modal-input-${Math.random().toString(36).substr(2, 9)}`)\r\n\r\n// 사이즈 클래스 계산\r\nconst sizeClass = computed(() => {\r\n // Dialog.vue에 기본 max-w-lg가 하드코딩되어 있어 !max-w-*로 오버라이드\r\n const sizeMap: Record<NonNullable<JModalProps['size']>, string> = {\r\n 'sm': '!max-w-sm',\r\n 'md': '!max-w-md',\r\n 'lg': '!max-w-2xl',\r\n 'xl': '!max-w-4xl',\r\n '2xl': '!max-w-6xl',\r\n 'full': '!max-w-[95vw]'\r\n }\r\n return sizeMap[props.size]\r\n})\r\n\r\n// props.formFieldValue 변경 감지\r\nwatch(() => props.formFieldValue, (newValue) => {\r\n if (newValue !== undefined) {\r\n inputValue.value = newValue\r\n }\r\n})\r\n\r\n// 모달 열기/닫기 핸들러\r\nconst onOpenChange = (value: boolean) => {\r\n emit('update:open', value)\r\n}\r\n\r\n// 확인 버튼 핸들러\r\nconst handleConfirm = () => {\r\n const value = props.showFormField ? inputValue.value : undefined\r\n emit('confirm', value)\r\n}\r\n\r\n// 취소 버튼 핸들러\r\nconst handleCancel = () => {\r\n emit('cancel')\r\n // 입력값 초기화\r\n inputValue.value = props.formFieldValue || ''\r\n}\r\n</script>\r\n"],"names":["props","__props","emit","__emit","inputValue","ref","inputId","computed","sizeClass","watch","newValue","onOpenChange","value","handleConfirm","handleCancel","_createBlock","_unref","Dialog","_createVNode","DialogContent","DialogHeader","DialogTitle","DialogBody","_createElementVNode","_hoisted_1","_createElementBlock","_hoisted_2","_toDisplayString","_hoisted_3","JFormField","$event","_renderSlot","_ctx","DialogFooter","_Fragment","JButton"],"mappings":"
|
|
1
|
+
{"version":3,"file":"JModal.vue.cjs","sources":["../../../../src/components/organisms/JModal.vue"],"sourcesContent":["<template>\r\n <Dialog\r\n :open=\"open\"\r\n @update:open=\"onOpenChange\"\r\n :class=\"sizeClass\"\r\n >\r\n <DialogContent>\r\n <!-- Header -->\r\n <DialogHeader v-if=\"title\" class=\"bg-muted/50 border-b\">\r\n <DialogTitle>\r\n {{ title }}\r\n </DialogTitle>\r\n </DialogHeader>\r\n\r\n <!-- Body -->\r\n <DialogBody>\r\n <div class=\"space-y-4\">\r\n <!-- Description -->\r\n <p v-if=\"description\" class=\"text-sm text-muted-foreground\">\r\n {{ description }}\r\n </p>\r\n\r\n <!-- JFormField가 있는 경우 -->\r\n <div v-if=\"showFormField\">\r\n <JFormField\r\n :label=\"formFieldLabel\"\r\n :error-msg=\"formFieldError\"\r\n :required=\"formFieldRequired\"\r\n :type=\"formFieldType\"\r\n :id=\"inputId\"\r\n v-model=\"inputValue\"\r\n :input-type=\"formFieldInputType\"\r\n :placeholder=\"formFieldInputPlaceholder\"\r\n :disabled=\"disabled\"\r\n />\r\n </div>\r\n\r\n <!-- 커스텀 컨텐츠 슬롯 -->\r\n <slot name=\"body\" />\r\n </div>\r\n </DialogBody>\r\n\r\n <!-- Footer -->\r\n <DialogFooter>\r\n <!-- 확인/취소 버튼 -->\r\n <template v-if=\"buttonType === 'OkCancel'\">\r\n <JButton\r\n variant=\"outline\"\r\n @click=\"handleCancel\"\r\n >\r\n {{ cancelText }}\r\n </JButton>\r\n <JButton\r\n :variant=\"confirmVariant\"\r\n :disabled=\"confirmDisabled\"\r\n @click=\"handleConfirm\"\r\n >\r\n {{ confirmText }}\r\n </JButton>\r\n </template>\r\n \r\n <!-- 확인 버튼만 -->\r\n <template v-else-if=\"buttonType === 'Ok'\">\r\n <JButton\r\n :variant=\"confirmVariant\"\r\n :disabled=\"confirmDisabled\"\r\n @click=\"handleConfirm\"\r\n class=\"w-full\"\r\n >\r\n {{ confirmText }}\r\n </JButton>\r\n </template>\r\n </DialogFooter>\r\n </DialogContent>\r\n </Dialog>\r\n</template>\r\n\r\n<script setup lang=\"ts\">\r\nimport { computed, ref, watch } from 'vue'\r\nimport {\r\n Dialog,\r\n DialogBody,\r\n DialogContent,\r\n DialogFooter,\r\n DialogHeader,\r\n DialogTitle,\r\n} from '@/components/shadcn'\r\nimport { JButton } from '@/components/atoms'\r\nimport { JFormField } from '@/components/molecules'\r\n\r\nexport interface JModalProps {\r\n // 모달 표시 여부\r\n open: boolean\r\n // 헤더\r\n title?: string\r\n description?: string\r\n // 모달 사이즈\r\n size?: 'sm' | 'md' | 'lg' | 'xl' | '2xl' | 'full'\r\n // 폼 필드 (JFormField)\r\n showFormField?: boolean\r\n formFieldLabel?: string\r\n formFieldError?: string\r\n formFieldRequired?: boolean\r\n // 입력 필드 설정\r\n formFieldInputType?: 'text' | 'email' | 'password' | 'number' | 'tel' | 'url'\r\n formFieldInputPlaceholder?: string\r\n formFieldValue?: string\r\n formFieldType?: 'input' | 'textarea' | 'checkbox' | 'switch' | 'combo' | 'radio' | 'searchCombo' | 'datepicker'\r\n // 버튼 설정\r\n buttonType?: 'Ok' | 'OkCancel'\r\n confirmText?: string\r\n cancelText?: string\r\n confirmVariant?: 'default' | 'destructive' | 'outline' | 'secondary' | 'ghost' | 'link'\r\n confirmDisabled?: boolean\r\n // 기타\r\n disabled?: boolean\r\n}\r\n\r\nconst props = withDefaults(defineProps<JModalProps>(), {\r\n open: false,\r\n size: 'md',\r\n showFormField: false,\r\n formFieldInputType: 'text',\r\n formFieldType: 'input',\r\n buttonType: 'OkCancel',\r\n confirmText: '확인',\r\n cancelText: '취소',\r\n confirmVariant: 'default',\r\n confirmDisabled: false,\r\n disabled: false,\r\n})\r\n\r\nconst emit = defineEmits<{\r\n 'update:open': [value: boolean]\r\n 'confirm': [value?: string]\r\n 'cancel': []\r\n}>()\r\n\r\n// 입력값 관리\r\nconst inputValue = ref(props.formFieldValue || '')\r\n\r\n// 입력 필드 ID 생성\r\nconst inputId = computed(() => `modal-input-${Math.random().toString(36).substr(2, 9)}`)\r\n\r\n// 사이즈 클래스 계산\r\nconst sizeClass = computed(() => {\r\n // Dialog.vue에 기본 max-w-lg가 하드코딩되어 있어 !max-w-*로 오버라이드\r\n const sizeMap: Record<NonNullable<JModalProps['size']>, string> = {\r\n 'sm': '!max-w-sm',\r\n 'md': '!max-w-md',\r\n 'lg': '!max-w-2xl',\r\n 'xl': '!max-w-4xl',\r\n '2xl': '!max-w-6xl',\r\n 'full': '!max-w-[95vw]'\r\n }\r\n return sizeMap[props.size]\r\n})\r\n\r\n// props.formFieldValue 변경 감지\r\nwatch(() => props.formFieldValue, (newValue) => {\r\n if (newValue !== undefined) {\r\n inputValue.value = newValue\r\n }\r\n})\r\n\r\n// 모달 열기/닫기 핸들러\r\nconst onOpenChange = (value: boolean) => {\r\n emit('update:open', value)\r\n}\r\n\r\n// 확인 버튼 핸들러\r\nconst handleConfirm = () => {\r\n const value = props.showFormField ? inputValue.value : undefined\r\n emit('confirm', value)\r\n}\r\n\r\n// 취소 버튼 핸들러\r\nconst handleCancel = () => {\r\n emit('cancel')\r\n // 입력값 초기화\r\n inputValue.value = props.formFieldValue || ''\r\n}\r\n</script>\r\n"],"names":["props","__props","emit","__emit","inputValue","ref","inputId","computed","sizeClass","watch","newValue","onOpenChange","value","handleConfirm","handleCancel","_createBlock","_unref","Dialog","_createVNode","DialogContent","DialogHeader","DialogTitle","DialogBody","_createElementVNode","_hoisted_1","_createElementBlock","_hoisted_2","_toDisplayString","_hoisted_3","JFormField","$event","_renderSlot","_ctx","DialogFooter","_Fragment","JButton"],"mappings":"61EAsHA,MAAMA,EAAQC,EAcRC,EAAOC,EAOPC,EAAaC,EAAAA,IAAIL,EAAM,gBAAkB,EAAE,EAG3CM,EAAUC,EAAAA,SAAS,IAAM,eAAe,KAAK,OAAA,EAAS,SAAS,EAAE,EAAE,OAAO,EAAG,CAAC,CAAC,EAAE,EAGjFC,EAAYD,EAAAA,SAAS,KAEyC,CAChE,GAAM,YACN,GAAM,YACN,GAAM,aACN,GAAM,aACN,MAAO,aACP,KAAQ,eAAA,GAEKP,EAAM,IAAI,CAC1B,EAGDS,EAAAA,MAAM,IAAMT,EAAM,eAAiBU,GAAa,CAC1CA,IAAa,SACfN,EAAW,MAAQM,EAEvB,CAAC,EAGD,MAAMC,EAAgBC,GAAmB,CACvCV,EAAK,cAAeU,CAAK,CAC3B,EAGMC,EAAgB,IAAM,CAC1B,MAAMD,EAAQZ,EAAM,cAAgBI,EAAW,MAAQ,OACvDF,EAAK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,MAAAmB,EAAAA,OAAA,EAAA,CAJR,QAAQ,UACP,QAAOrB,CAAA,qBAER,IAAgB,qCAAbb,EAAA,UAAU,EAAA,CAAA,CAAA,SAEfiB,cAMUF,EAAAA,MAAAmB,EAAAA,OAAA,EAAA,CALP,QAASlC,EAAA,eACT,SAAUA,EAAA,gBACV,QAAOY,CAAA,qBAER,IAAiB,qCAAdZ,EAAA,WAAW,EAAA,CAAA,CAAA,wCAKGA,EAAA,aAAU,oBAC7Bc,EAAAA,YAOUC,QAAAmB,EAAAA,OAAA,EAAA,OANP,QAASlC,EAAA,eACT,SAAUA,EAAA,gBACV,QAAOY,EACR,MAAM,QAAA,qBAEN,IAAiB,qCAAdZ,EAAA,WAAW,EAAA,CAAA,CAAA"}
|
|
@@ -1,15 +1,20 @@
|
|
|
1
|
-
import { defineComponent as T, ref as w, computed as F, watch as $, createBlock as c, openBlock as
|
|
1
|
+
import { defineComponent as T, ref as w, computed as F, watch as $, createBlock as c, openBlock as a, unref as t, normalizeClass as g, withCtx as o, createVNode as i, createCommentVNode as d, createTextVNode as f, toDisplayString as n, createElementVNode as B, createElementBlock as s, renderSlot as z, Fragment as I } from "vue";
|
|
2
2
|
import "../shadcn/index.js";
|
|
3
3
|
import p from "../atoms/JButton.vue.js";
|
|
4
4
|
import "lucide-vue-next";
|
|
5
5
|
import "clsx";
|
|
6
6
|
import "tailwind-merge";
|
|
7
7
|
import "@internationalized/date";
|
|
8
|
+
import "md-editor-v3";
|
|
9
|
+
/* empty css */
|
|
10
|
+
/* empty css */
|
|
8
11
|
import "../shadcn/badge-variants.js";
|
|
9
12
|
import "@vueuse/core";
|
|
10
13
|
import "reka-ui";
|
|
11
14
|
/* empty css */
|
|
12
15
|
import "../shadcn/avatar-variants.js";
|
|
16
|
+
import "dompurify";
|
|
17
|
+
/* empty css */
|
|
13
18
|
import "ag-grid-vue3";
|
|
14
19
|
import "ag-grid-community";
|
|
15
20
|
import "ag-grid-enterprise";
|
|
@@ -17,6 +22,7 @@ import "ag-grid-enterprise";
|
|
|
17
22
|
/* empty css */
|
|
18
23
|
/* empty css */
|
|
19
24
|
/* empty css */
|
|
25
|
+
import "vue-sonner";
|
|
20
26
|
import q from "../molecules/JFormField.vue.js";
|
|
21
27
|
/* empty css */
|
|
22
28
|
/* empty css */
|
|
@@ -31,7 +37,7 @@ import S from "../shadcn/DialogFooter.vue.js";
|
|
|
31
37
|
const L = { class: "space-y-4" }, P = {
|
|
32
38
|
key: 0,
|
|
33
39
|
class: "text-sm text-muted-foreground"
|
|
34
|
-
}, R = { key: 1 },
|
|
40
|
+
}, R = { key: 1 }, Ce = /* @__PURE__ */ T({
|
|
35
41
|
__name: "JModal",
|
|
36
42
|
props: {
|
|
37
43
|
open: { type: Boolean, default: !1 },
|
|
@@ -74,20 +80,20 @@ const L = { class: "space-y-4" }, P = {
|
|
|
74
80
|
}, V = () => {
|
|
75
81
|
u("cancel"), m.value = r.formFieldValue || "";
|
|
76
82
|
};
|
|
77
|
-
return (l, b) => (
|
|
83
|
+
return (l, b) => (a(), c(t(D), {
|
|
78
84
|
open: e.open,
|
|
79
85
|
"onUpdate:open": k,
|
|
80
86
|
class: g(h.value)
|
|
81
87
|
}, {
|
|
82
88
|
default: o(() => [
|
|
83
|
-
|
|
89
|
+
i(t(E), null, {
|
|
84
90
|
default: o(() => [
|
|
85
|
-
e.title ? (
|
|
91
|
+
e.title ? (a(), c(t(M), {
|
|
86
92
|
key: 0,
|
|
87
93
|
class: "bg-muted/50 border-b"
|
|
88
94
|
}, {
|
|
89
95
|
default: o(() => [
|
|
90
|
-
|
|
96
|
+
i(t(N), null, {
|
|
91
97
|
default: o(() => [
|
|
92
98
|
f(n(e.title), 1)
|
|
93
99
|
]),
|
|
@@ -96,12 +102,12 @@ const L = { class: "space-y-4" }, P = {
|
|
|
96
102
|
]),
|
|
97
103
|
_: 1
|
|
98
104
|
})) : d("", !0),
|
|
99
|
-
|
|
105
|
+
i(t(O), null, {
|
|
100
106
|
default: o(() => [
|
|
101
107
|
B("div", L, [
|
|
102
|
-
e.description ? (
|
|
103
|
-
e.showFormField ? (
|
|
104
|
-
|
|
108
|
+
e.description ? (a(), s("p", P, n(e.description), 1)) : d("", !0),
|
|
109
|
+
e.showFormField ? (a(), s("div", R, [
|
|
110
|
+
i(t(q), {
|
|
105
111
|
label: e.formFieldLabel,
|
|
106
112
|
"error-msg": e.formFieldError,
|
|
107
113
|
required: e.formFieldRequired,
|
|
@@ -119,10 +125,10 @@ const L = { class: "space-y-4" }, P = {
|
|
|
119
125
|
]),
|
|
120
126
|
_: 3
|
|
121
127
|
}),
|
|
122
|
-
|
|
128
|
+
i(t(S), null, {
|
|
123
129
|
default: o(() => [
|
|
124
|
-
e.buttonType === "OkCancel" ? (
|
|
125
|
-
|
|
130
|
+
e.buttonType === "OkCancel" ? (a(), s(I, { key: 0 }, [
|
|
131
|
+
i(t(p), {
|
|
126
132
|
variant: "outline",
|
|
127
133
|
onClick: V
|
|
128
134
|
}, {
|
|
@@ -131,7 +137,7 @@ const L = { class: "space-y-4" }, P = {
|
|
|
131
137
|
]),
|
|
132
138
|
_: 1
|
|
133
139
|
}),
|
|
134
|
-
|
|
140
|
+
i(t(p), {
|
|
135
141
|
variant: e.confirmVariant,
|
|
136
142
|
disabled: e.confirmDisabled,
|
|
137
143
|
onClick: y
|
|
@@ -141,7 +147,7 @@ const L = { class: "space-y-4" }, P = {
|
|
|
141
147
|
]),
|
|
142
148
|
_: 1
|
|
143
149
|
}, 8, ["variant", "disabled"])
|
|
144
|
-
], 64)) : e.buttonType === "Ok" ? (
|
|
150
|
+
], 64)) : e.buttonType === "Ok" ? (a(), c(t(p), {
|
|
145
151
|
key: 1,
|
|
146
152
|
variant: e.confirmVariant,
|
|
147
153
|
disabled: e.confirmDisabled,
|
|
@@ -165,6 +171,6 @@ const L = { class: "space-y-4" }, P = {
|
|
|
165
171
|
}
|
|
166
172
|
});
|
|
167
173
|
export {
|
|
168
|
-
|
|
174
|
+
Ce as default
|
|
169
175
|
};
|
|
170
176
|
//# sourceMappingURL=JModal.vue.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"JModal.vue.js","sources":["../../../../src/components/organisms/JModal.vue"],"sourcesContent":["<template>\r\n <Dialog\r\n :open=\"open\"\r\n @update:open=\"onOpenChange\"\r\n :class=\"sizeClass\"\r\n >\r\n <DialogContent>\r\n <!-- Header -->\r\n <DialogHeader v-if=\"title\" class=\"bg-muted/50 border-b\">\r\n <DialogTitle>\r\n {{ title }}\r\n </DialogTitle>\r\n </DialogHeader>\r\n\r\n <!-- Body -->\r\n <DialogBody>\r\n <div class=\"space-y-4\">\r\n <!-- Description -->\r\n <p v-if=\"description\" class=\"text-sm text-muted-foreground\">\r\n {{ description }}\r\n </p>\r\n\r\n <!-- JFormField가 있는 경우 -->\r\n <div v-if=\"showFormField\">\r\n <JFormField\r\n :label=\"formFieldLabel\"\r\n :error-msg=\"formFieldError\"\r\n :required=\"formFieldRequired\"\r\n :type=\"formFieldType\"\r\n :id=\"inputId\"\r\n v-model=\"inputValue\"\r\n :input-type=\"formFieldInputType\"\r\n :placeholder=\"formFieldInputPlaceholder\"\r\n :disabled=\"disabled\"\r\n />\r\n </div>\r\n\r\n <!-- 커스텀 컨텐츠 슬롯 -->\r\n <slot name=\"body\" />\r\n </div>\r\n </DialogBody>\r\n\r\n <!-- Footer -->\r\n <DialogFooter>\r\n <!-- 확인/취소 버튼 -->\r\n <template v-if=\"buttonType === 'OkCancel'\">\r\n <JButton\r\n variant=\"outline\"\r\n @click=\"handleCancel\"\r\n >\r\n {{ cancelText }}\r\n </JButton>\r\n <JButton\r\n :variant=\"confirmVariant\"\r\n :disabled=\"confirmDisabled\"\r\n @click=\"handleConfirm\"\r\n >\r\n {{ confirmText }}\r\n </JButton>\r\n </template>\r\n \r\n <!-- 확인 버튼만 -->\r\n <template v-else-if=\"buttonType === 'Ok'\">\r\n <JButton\r\n :variant=\"confirmVariant\"\r\n :disabled=\"confirmDisabled\"\r\n @click=\"handleConfirm\"\r\n class=\"w-full\"\r\n >\r\n {{ confirmText }}\r\n </JButton>\r\n </template>\r\n </DialogFooter>\r\n </DialogContent>\r\n </Dialog>\r\n</template>\r\n\r\n<script setup lang=\"ts\">\r\nimport { computed, ref, watch } from 'vue'\r\nimport {\r\n Dialog,\r\n DialogBody,\r\n DialogContent,\r\n DialogFooter,\r\n DialogHeader,\r\n DialogTitle,\r\n} from '@/components/shadcn'\r\nimport { JButton } from '@/components/atoms'\r\nimport { JFormField } from '@/components/molecules'\r\n\r\nexport interface JModalProps {\r\n // 모달 표시 여부\r\n open: boolean\r\n // 헤더\r\n title?: string\r\n description?: string\r\n // 모달 사이즈\r\n size?: 'sm' | 'md' | 'lg' | 'xl' | '2xl' | 'full'\r\n // 폼 필드 (JFormField)\r\n showFormField?: boolean\r\n formFieldLabel?: string\r\n formFieldError?: string\r\n formFieldRequired?: boolean\r\n // 입력 필드 설정\r\n formFieldInputType?: 'text' | 'email' | 'password' | 'number' | 'tel' | 'url'\r\n formFieldInputPlaceholder?: string\r\n formFieldValue?: string\r\n formFieldType?: 'input' | 'textarea' | 'checkbox' | 'switch' | 'combo' | 'radio' | 'searchCombo' | 'datepicker'\r\n // 버튼 설정\r\n buttonType?: 'Ok' | 'OkCancel'\r\n confirmText?: string\r\n cancelText?: string\r\n confirmVariant?: 'default' | 'destructive' | 'outline' | 'secondary' | 'ghost' | 'link'\r\n confirmDisabled?: boolean\r\n // 기타\r\n disabled?: boolean\r\n}\r\n\r\nconst props = withDefaults(defineProps<JModalProps>(), {\r\n open: false,\r\n size: 'md',\r\n showFormField: false,\r\n formFieldInputType: 'text',\r\n formFieldType: 'input',\r\n buttonType: 'OkCancel',\r\n confirmText: '확인',\r\n cancelText: '취소',\r\n confirmVariant: 'default',\r\n confirmDisabled: false,\r\n disabled: false,\r\n})\r\n\r\nconst emit = defineEmits<{\r\n 'update:open': [value: boolean]\r\n 'confirm': [value?: string]\r\n 'cancel': []\r\n}>()\r\n\r\n// 입력값 관리\r\nconst inputValue = ref(props.formFieldValue || '')\r\n\r\n// 입력 필드 ID 생성\r\nconst inputId = computed(() => `modal-input-${Math.random().toString(36).substr(2, 9)}`)\r\n\r\n// 사이즈 클래스 계산\r\nconst sizeClass = computed(() => {\r\n // Dialog.vue에 기본 max-w-lg가 하드코딩되어 있어 !max-w-*로 오버라이드\r\n const sizeMap: Record<NonNullable<JModalProps['size']>, string> = {\r\n 'sm': '!max-w-sm',\r\n 'md': '!max-w-md',\r\n 'lg': '!max-w-2xl',\r\n 'xl': '!max-w-4xl',\r\n '2xl': '!max-w-6xl',\r\n 'full': '!max-w-[95vw]'\r\n }\r\n return sizeMap[props.size]\r\n})\r\n\r\n// props.formFieldValue 변경 감지\r\nwatch(() => props.formFieldValue, (newValue) => {\r\n if (newValue !== undefined) {\r\n inputValue.value = newValue\r\n }\r\n})\r\n\r\n// 모달 열기/닫기 핸들러\r\nconst onOpenChange = (value: boolean) => {\r\n emit('update:open', value)\r\n}\r\n\r\n// 확인 버튼 핸들러\r\nconst handleConfirm = () => {\r\n const value = props.showFormField ? inputValue.value : undefined\r\n emit('confirm', value)\r\n}\r\n\r\n// 취소 버튼 핸들러\r\nconst handleCancel = () => {\r\n emit('cancel')\r\n // 입력값 초기화\r\n inputValue.value = props.formFieldValue || ''\r\n}\r\n</script>\r\n"],"names":["props","__props","emit","__emit","inputValue","ref","inputId","computed","sizeClass","watch","newValue","onOpenChange","value","handleConfirm","handleCancel","_createBlock","_unref","Dialog","_createVNode","DialogContent","DialogHeader","DialogTitle","DialogBody","_createElementVNode","_hoisted_1","_createElementBlock","_hoisted_2","_toDisplayString","_hoisted_3","JFormField","$event","_renderSlot","_ctx","DialogFooter","_Fragment","JButton"],"mappings":"
|
|
1
|
+
{"version":3,"file":"JModal.vue.js","sources":["../../../../src/components/organisms/JModal.vue"],"sourcesContent":["<template>\r\n <Dialog\r\n :open=\"open\"\r\n @update:open=\"onOpenChange\"\r\n :class=\"sizeClass\"\r\n >\r\n <DialogContent>\r\n <!-- Header -->\r\n <DialogHeader v-if=\"title\" class=\"bg-muted/50 border-b\">\r\n <DialogTitle>\r\n {{ title }}\r\n </DialogTitle>\r\n </DialogHeader>\r\n\r\n <!-- Body -->\r\n <DialogBody>\r\n <div class=\"space-y-4\">\r\n <!-- Description -->\r\n <p v-if=\"description\" class=\"text-sm text-muted-foreground\">\r\n {{ description }}\r\n </p>\r\n\r\n <!-- JFormField가 있는 경우 -->\r\n <div v-if=\"showFormField\">\r\n <JFormField\r\n :label=\"formFieldLabel\"\r\n :error-msg=\"formFieldError\"\r\n :required=\"formFieldRequired\"\r\n :type=\"formFieldType\"\r\n :id=\"inputId\"\r\n v-model=\"inputValue\"\r\n :input-type=\"formFieldInputType\"\r\n :placeholder=\"formFieldInputPlaceholder\"\r\n :disabled=\"disabled\"\r\n />\r\n </div>\r\n\r\n <!-- 커스텀 컨텐츠 슬롯 -->\r\n <slot name=\"body\" />\r\n </div>\r\n </DialogBody>\r\n\r\n <!-- Footer -->\r\n <DialogFooter>\r\n <!-- 확인/취소 버튼 -->\r\n <template v-if=\"buttonType === 'OkCancel'\">\r\n <JButton\r\n variant=\"outline\"\r\n @click=\"handleCancel\"\r\n >\r\n {{ cancelText }}\r\n </JButton>\r\n <JButton\r\n :variant=\"confirmVariant\"\r\n :disabled=\"confirmDisabled\"\r\n @click=\"handleConfirm\"\r\n >\r\n {{ confirmText }}\r\n </JButton>\r\n </template>\r\n \r\n <!-- 확인 버튼만 -->\r\n <template v-else-if=\"buttonType === 'Ok'\">\r\n <JButton\r\n :variant=\"confirmVariant\"\r\n :disabled=\"confirmDisabled\"\r\n @click=\"handleConfirm\"\r\n class=\"w-full\"\r\n >\r\n {{ confirmText }}\r\n </JButton>\r\n </template>\r\n </DialogFooter>\r\n </DialogContent>\r\n </Dialog>\r\n</template>\r\n\r\n<script setup lang=\"ts\">\r\nimport { computed, ref, watch } from 'vue'\r\nimport {\r\n Dialog,\r\n DialogBody,\r\n DialogContent,\r\n DialogFooter,\r\n DialogHeader,\r\n DialogTitle,\r\n} from '@/components/shadcn'\r\nimport { JButton } from '@/components/atoms'\r\nimport { JFormField } from '@/components/molecules'\r\n\r\nexport interface JModalProps {\r\n // 모달 표시 여부\r\n open: boolean\r\n // 헤더\r\n title?: string\r\n description?: string\r\n // 모달 사이즈\r\n size?: 'sm' | 'md' | 'lg' | 'xl' | '2xl' | 'full'\r\n // 폼 필드 (JFormField)\r\n showFormField?: boolean\r\n formFieldLabel?: string\r\n formFieldError?: string\r\n formFieldRequired?: boolean\r\n // 입력 필드 설정\r\n formFieldInputType?: 'text' | 'email' | 'password' | 'number' | 'tel' | 'url'\r\n formFieldInputPlaceholder?: string\r\n formFieldValue?: string\r\n formFieldType?: 'input' | 'textarea' | 'checkbox' | 'switch' | 'combo' | 'radio' | 'searchCombo' | 'datepicker'\r\n // 버튼 설정\r\n buttonType?: 'Ok' | 'OkCancel'\r\n confirmText?: string\r\n cancelText?: string\r\n confirmVariant?: 'default' | 'destructive' | 'outline' | 'secondary' | 'ghost' | 'link'\r\n confirmDisabled?: boolean\r\n // 기타\r\n disabled?: boolean\r\n}\r\n\r\nconst props = withDefaults(defineProps<JModalProps>(), {\r\n open: false,\r\n size: 'md',\r\n showFormField: false,\r\n formFieldInputType: 'text',\r\n formFieldType: 'input',\r\n buttonType: 'OkCancel',\r\n confirmText: '확인',\r\n cancelText: '취소',\r\n confirmVariant: 'default',\r\n confirmDisabled: false,\r\n disabled: false,\r\n})\r\n\r\nconst emit = defineEmits<{\r\n 'update:open': [value: boolean]\r\n 'confirm': [value?: string]\r\n 'cancel': []\r\n}>()\r\n\r\n// 입력값 관리\r\nconst inputValue = ref(props.formFieldValue || '')\r\n\r\n// 입력 필드 ID 생성\r\nconst inputId = computed(() => `modal-input-${Math.random().toString(36).substr(2, 9)}`)\r\n\r\n// 사이즈 클래스 계산\r\nconst sizeClass = computed(() => {\r\n // Dialog.vue에 기본 max-w-lg가 하드코딩되어 있어 !max-w-*로 오버라이드\r\n const sizeMap: Record<NonNullable<JModalProps['size']>, string> = {\r\n 'sm': '!max-w-sm',\r\n 'md': '!max-w-md',\r\n 'lg': '!max-w-2xl',\r\n 'xl': '!max-w-4xl',\r\n '2xl': '!max-w-6xl',\r\n 'full': '!max-w-[95vw]'\r\n }\r\n return sizeMap[props.size]\r\n})\r\n\r\n// props.formFieldValue 변경 감지\r\nwatch(() => props.formFieldValue, (newValue) => {\r\n if (newValue !== undefined) {\r\n inputValue.value = newValue\r\n }\r\n})\r\n\r\n// 모달 열기/닫기 핸들러\r\nconst onOpenChange = (value: boolean) => {\r\n emit('update:open', value)\r\n}\r\n\r\n// 확인 버튼 핸들러\r\nconst handleConfirm = () => {\r\n const value = props.showFormField ? inputValue.value : undefined\r\n emit('confirm', value)\r\n}\r\n\r\n// 취소 버튼 핸들러\r\nconst handleCancel = () => {\r\n emit('cancel')\r\n // 입력값 초기화\r\n inputValue.value = props.formFieldValue || ''\r\n}\r\n</script>\r\n"],"names":["props","__props","emit","__emit","inputValue","ref","inputId","computed","sizeClass","watch","newValue","onOpenChange","value","handleConfirm","handleCancel","_createBlock","_unref","Dialog","_createVNode","DialogContent","DialogHeader","DialogTitle","DialogBody","_createElementVNode","_hoisted_1","_createElementBlock","_hoisted_2","_toDisplayString","_hoisted_3","JFormField","$event","_renderSlot","_ctx","DialogFooter","_Fragment","JButton"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsHA,UAAMA,IAAQC,GAcRC,IAAOC,GAOPC,IAAaC,EAAIL,EAAM,kBAAkB,EAAE,GAG3CM,IAAUC,EAAS,MAAM,eAAe,KAAK,OAAA,EAAS,SAAS,EAAE,EAAE,OAAO,GAAG,CAAC,CAAC,EAAE,GAGjFC,IAAYD,EAAS,OAEyC;AAAA,MAChE,IAAM;AAAA,MACN,IAAM;AAAA,MACN,IAAM;AAAA,MACN,IAAM;AAAA,MACN,OAAO;AAAA,MACP,MAAQ;AAAA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,EAAA;AAAA,sBACN,IAAIK,EAAA;AAAA,kCACIF,EAAA;AAAA,oEAAAA,EAAU,QAAA0B;AAAA,sBAClB,cAAY7B,EAAA;AAAA,sBACZ,aAAaA,EAAA;AAAA,sBACb,UAAUA,EAAA;AAAA,oBAAA;;kBAKf8B,EAAoBC,EAAA,QAAA,MAAA;AAAA,gBAAA;;;;YAKxBd,EA6BeF,EAAAiB,CAAA,GAAA,MAAA;AAAA,yBA3Bb,MAcW;AAAA,gBAdKhC,EAAA,eAAU,mBAA1BwB,EAcWS,GAAA,EAAA,KAAA,KAAA;AAAA,kBAbThB,EAKUF,EAAAmB,CAAA,GAAA;AAAA,oBAJR,SAAQ;AAAA,oBACP,SAAOrB;AAAA,kBAAA;+BAER,MAAgB;AAAA,0BAAbb,EAAA,UAAU,GAAA,CAAA;AAAA,oBAAA;;;kBAEfiB,EAMUF,EAAAmB,CAAA,GAAA;AAAA,oBALP,SAASlC,EAAA;AAAA,oBACT,UAAUA,EAAA;AAAA,oBACV,SAAOY;AAAA,kBAAA;+BAER,MAAiB;AAAA,0BAAdZ,EAAA,WAAW,GAAA,CAAA;AAAA,oBAAA;;;0BAKGA,EAAA,eAAU,aAC7Bc,EAOUC,EAAAmB,CAAA,GAAA;AAAA;kBANP,SAASlC,EAAA;AAAA,kBACT,UAAUA,EAAA;AAAA,kBACV,SAAOY;AAAA,kBACR,OAAM;AAAA,gBAAA;6BAEN,MAAiB;AAAA,wBAAdZ,EAAA,WAAW,GAAA,CAAA;AAAA,kBAAA;;;;;;;;;;;;;;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),_=require("lucide-vue-next");require("../shadcn/index.cjs");const N=require("../atoms/JButton.vue.cjs");require("clsx");require("tailwind-merge");require("@internationalized/date");const V=require("../atoms/JBadge.vue.cjs");require("@vueuse/core");require("reka-ui");;/* empty css */require("../shadcn/avatar-variants.cjs");require("ag-grid-vue3");require("ag-grid-community");require("ag-grid-enterprise");;/* empty css */;/* empty css */;/* empty css */;/* empty css */const C=require("./JDynamicForm.vue.cjs"),g=require("../shadcn/Card.vue.cjs"),w=require("../shadcn/CardHeader.vue.cjs"),B=require("../shadcn/CardTitle.vue.cjs"),E=require("../shadcn/CardContent.vue.cjs"),S={class:"flex items-center justify-between"},D={class:"flex items-center gap-3 flex-1"},F={key:2,class:"flex flex-wrap items-center gap-2 ml-2"},j=["onClick","aria-label"],T=e.defineComponent({__name:"JSearchPanel",props:{title:{default:"조회조건"},schema:{},modelValue:{},defaultCollapsed:{type:Boolean,default:!1},collapsible:{type:Boolean,default:!0}},emits:["update:modelValue","submit","reset"],setup(u,{emit:v}){const
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),_=require("lucide-vue-next");require("../shadcn/index.cjs");const N=require("../atoms/JButton.vue.cjs");require("clsx");require("tailwind-merge");require("@internationalized/date");require("md-editor-v3");;/* empty css */;/* empty css */const V=require("../atoms/JBadge.vue.cjs");require("@vueuse/core");require("reka-ui");;/* empty css */require("../shadcn/avatar-variants.cjs");require("dompurify");;/* empty css */require("ag-grid-vue3");require("ag-grid-community");require("ag-grid-enterprise");;/* empty css */;/* empty css */;/* empty css */;/* empty css */require("vue-sonner");const C=require("./JDynamicForm.vue.cjs"),g=require("../shadcn/Card.vue.cjs"),w=require("../shadcn/CardHeader.vue.cjs"),B=require("../shadcn/CardTitle.vue.cjs"),E=require("../shadcn/CardContent.vue.cjs"),S={class:"flex items-center justify-between"},D={class:"flex items-center gap-3 flex-1"},F={key:2,class:"flex flex-wrap items-center gap-2 ml-2"},j=["onClick","aria-label"],T=e.defineComponent({__name:"JSearchPanel",props:{title:{default:"조회조건"},schema:{},modelValue:{},defaultCollapsed:{type:Boolean,default:!1},collapsible:{type:Boolean,default:!0}},emits:["update:modelValue","submit","reset"],setup(u,{emit:v}){const a=u,i=v,d=e.ref(null),n=e.ref(!a.defaultCollapsed),s=e.reactive(a.modelValue?{...a.modelValue}:{});let c=!1;e.watch(()=>a.modelValue,l=>{l&&!c&&(Object.keys(s).forEach(r=>{r in l||delete s[r]}),Object.assign(s,l)),c=!1},{deep:!0,immediate:!0});function y(l){c=!0,Object.assign(s,l),i("update:modelValue",{...l})}const m=e.computed(()=>{if(!a.schema)return[];const l=[];return a.schema.type==="simple"&&a.schema.fields?l.push(...a.schema.fields):a.schema.type==="sectioned"&&a.schema.sections?a.schema.sections.forEach(r=>{r.fields&&l.push(...r.fields)}):a.schema.type==="wizard"&&a.schema.steps&&a.schema.steps.forEach(r=>{r.fields&&l.push(...r.fields)}),l}),p=e.computed(()=>{if(!s||!a.schema)return[];const l=[],r=s;return m.value.forEach(t=>{const o=r[t.controlName];if(o==null||o===""||o==="ALL"||o==="SELECT"||t.type==="checkbox"&&o==="N"||t.type==="switch"&&o==="N")return;let f=String(o);if((t.type==="combo"||t.type==="searchcombo")&&t.options){const h=t.options.find(k=>k.value===o);h&&(f=h.label)}t.type==="checkbox"||t.type==="switch"?o==="Y"&&l.push({fieldName:t.controlName,label:t.label,value:t.inlineLabel||t.label}):l.push({fieldName:t.controlName,label:t.label,value:f})}),l});function b(l){i("submit",l)}function q(){d.value&&(d.value.reset(),i("reset"))}function x(l){if(!s||!a.schema)return;const r=m.value.find(t=>t.controlName===l);r&&(r.type==="checkbox"||r.type==="switch"?s[l]="N":s[l]="",c=!0,i("update:modelValue",{...s}))}return(l,r)=>(e.openBlock(),e.createBlock(e.unref(g.default),{class:"w-full"},{default:e.withCtx(()=>[e.createVNode(e.unref(w.default),{class:"pt-4 pb-3 px-6"},{default:e.withCtx(()=>[e.createElementVNode("div",S,[e.createElementVNode("div",D,[u.collapsible?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",onClick:r[0]||(r[0]=t=>n.value=!n.value),class:"flex items-center gap-2 font-semibold hover:text-primary transition-colors"},[e.createVNode(e.unref(_.ChevronDown),{class:e.normalizeClass(["h-4 w-4 transition-transform",n.value?"rotate-0":"-rotate-90"])},null,8,["class"]),e.createTextVNode(" "+e.toDisplayString(u.title),1)])):(e.openBlock(),e.createBlock(e.unref(B.default),{key:1,class:"mb-0"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(u.title),1)]),_:1})),p.value.length>0?(e.openBlock(),e.createElementBlock("div",F,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(p.value,t=>(e.openBlock(),e.createBlock(e.unref(V.default),{key:t.fieldName,variant:"secondary",size:"sm",class:"flex items-center gap-1.5 pr-1"},{default:e.withCtx(()=>[e.createElementVNode("span",null,e.toDisplayString(t.label)+": "+e.toDisplayString(t.value),1),e.createElementVNode("button",{type:"button",onClick:e.withModifiers(o=>x(t.fieldName),["stop"]),class:"h-4 w-4 rounded-full hover:bg-destructive/20 hover:text-destructive transition-colors flex items-center justify-center","aria-label":`${t.label} 조건 제거`},[e.createVNode(e.unref(_.X),{class:"h-3 w-3"})],8,j)]),_:2},1024))),128))])):e.createCommentVNode("",!0)]),e.createVNode(e.unref(N.default),{variant:"outline",size:"sm",onClick:e.withModifiers(q,["stop"])},{default:e.withCtx(()=>[...r[1]||(r[1]=[e.createTextVNode(" 초기화 ",-1)])]),_:1})])]),_:1}),e.withDirectives(e.createVNode(e.unref(E.default),{class:"px-6 pb-6 pt-0"},{default:e.withCtx(()=>[e.createVNode(C.default,{ref_key:"dynamicFormRef",ref:d,schema:u.schema,"model-value":s,"onUpdate:modelValue":y,onSubmit:b},null,8,["schema","model-value"])]),_:1},512),[[e.vShow,n.value||!u.collapsible]])]),_:1}))}});exports.default=T;
|
|
2
2
|
//# sourceMappingURL=JSearchPanel.vue2.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"JSearchPanel.vue2.cjs","sources":["../../../../src/components/organisms/JSearchPanel.vue"],"sourcesContent":["<template>\n <Card class=\"w-full\">\n <!-- 헤더: 제목, Badge 목록, 초기화 버튼 -->\n <CardHeader class=\"pt-4 pb-3 px-6\">\n <div class=\"flex items-center justify-between\">\n <div class=\"flex items-center gap-3 flex-1\">\n <button\n v-if=\"collapsible\"\n type=\"button\"\n @click=\"isExpanded = !isExpanded\"\n class=\"flex items-center gap-2 font-semibold hover:text-primary transition-colors\"\n >\n <ChevronDown\n :class=\"['h-4 w-4 transition-transform', isExpanded ? 'rotate-0' : '-rotate-90']\"\n />\n {{ title }}\n </button>\n <CardTitle v-else class=\"mb-0\">{{ title }}</CardTitle>\n \n <!-- 조건 Badge 목록 -->\n <div v-if=\"conditionBadges.length > 0\" class=\"flex flex-wrap items-center gap-2 ml-2\">\n <JBadge\n v-for=\"badge in conditionBadges\"\n :key=\"badge.fieldName\"\n variant=\"secondary\"\n size=\"sm\"\n class=\"flex items-center gap-1.5 pr-1\"\n >\n <span>{{ badge.label }}: {{ badge.value }}</span>\n <button\n type=\"button\"\n @click.stop=\"handleFieldReset(badge.fieldName)\"\n class=\"h-4 w-4 rounded-full hover:bg-destructive/20 hover:text-destructive transition-colors flex items-center justify-center\"\n :aria-label=\"`${badge.label} 조건 제거`\"\n >\n <X class=\"h-3 w-3\" />\n </button>\n </JBadge>\n </div>\n </div>\n \n <JButton\n variant=\"outline\"\n size=\"sm\"\n @click.stop=\"handleReset\"\n >\n 초기화\n </JButton>\n </div>\n </CardHeader>\n \n <!-- 폼 내용 -->\n <CardContent v-show=\"isExpanded || !collapsible\" class=\"px-6 pb-6 pt-0\">\n <JDynamicForm\n ref=\"dynamicFormRef\"\n :schema=\"schema\"\n :model-value=\"localModelValue\"\n @update:model-value=\"handleFormValueUpdate\"\n @submit=\"handleSubmit\"\n />\n </CardContent>\n </Card>\n</template>\n\n<script setup lang=\"ts\">\nimport { computed, ref, reactive, watch } from 'vue'\nimport { ChevronDown, X } from 'lucide-vue-next'\nimport { Card, CardHeader, CardTitle, CardContent } from '@/components/shadcn'\nimport { JButton, JBadge } from '@/components/atoms'\nimport JDynamicForm from './JDynamicForm.vue'\nimport type { FormSchema, DynamicFormField } from '@/types/dynamic-form'\nimport type { ComponentPublicInstance } from 'vue'\n\ninterface ConditionBadge {\n fieldName: string\n label: string\n value: string\n}\n\nexport interface JSearchPanelProps {\n /** 패널 제목 */\n title?: string\n /** JDynamicForm에 전달할 FormSchema */\n schema: FormSchema\n /** JDynamicForm의 v-model 값 */\n modelValue?: Record<string, any>\n /** 기본 접힘 상태 */\n defaultCollapsed?: boolean\n /** 접기/펼치기 가능 여부 */\n collapsible?: boolean\n}\n\nconst props = withDefaults(defineProps<JSearchPanelProps>(), {\n title: '조회조건',\n defaultCollapsed: false,\n collapsible: true,\n})\n\nconst emit = defineEmits<{\n 'update:modelValue': [value: Record<string, any>]\n 'submit': [values: Record<string, any>]\n 'reset': []\n}>()\n\nconst dynamicFormRef = ref<ComponentPublicInstance & { reset: () => void } | null>(null)\nconst isExpanded = ref(!props.defaultCollapsed)\n\n// 로컬 modelValue - reactive로 관리하여 양방향 바인딩\nconst localModelValue = reactive<Record<string, any>>(props.modelValue ? { ...props.modelValue } : {})\n\n// 내부 변경인지 외부 변경인지 구분하는 플래그\nlet isInternalUpdate = false\n\n// props.modelValue 변경 시 localModelValue 동기화 (외부 변경)\nwatch(\n () => props.modelValue,\n (newValue) => {\n if (newValue && !isInternalUpdate) {\n // 기존 키 중 새 값에 없는 것은 삭제\n Object.keys(localModelValue).forEach(key => {\n if (!(key in newValue)) {\n delete localModelValue[key]\n }\n })\n // 새 값으로 업데이트\n Object.assign(localModelValue, newValue)\n }\n isInternalUpdate = false\n },\n { deep: true, immediate: true }\n)\n\n// JDynamicForm에서 값이 변경되었을 때 처리\nfunction handleFormValueUpdate(value: Record<string, any>) {\n // JDynamicForm에서 emit된 값을 localModelValue에 반영\n isInternalUpdate = true\n Object.assign(localModelValue, value)\n // 상위로 emit\n emit('update:modelValue', { ...value })\n}\n\n// 모든 필드 가져오기\nconst allFields = computed((): DynamicFormField[] => {\n if (!props.schema) return []\n \n const fields: DynamicFormField[] = []\n if (props.schema.type === 'simple' && props.schema.fields) {\n fields.push(...props.schema.fields)\n } else if (props.schema.type === 'sectioned' && props.schema.sections) {\n props.schema.sections.forEach(section => {\n if (section.fields) fields.push(...section.fields)\n })\n } else if (props.schema.type === 'wizard' && props.schema.steps) {\n props.schema.steps.forEach(step => {\n if (step.fields) fields.push(...step.fields)\n })\n }\n return fields\n})\n\n// 조건 Badge 목록 생성\nconst conditionBadges = computed((): ConditionBadge[] => {\n if (!localModelValue || !props.schema) {\n return []\n }\n\n const badges: ConditionBadge[] = []\n const formState = localModelValue\n\n allFields.value.forEach((field) => {\n const value = formState[field.controlName]\n \n // 빈 값 체크 (빈 문자열, null, undefined, 'ALL', 'SELECT' 제외)\n if (\n value === undefined ||\n value === null ||\n value === '' ||\n value === 'ALL' ||\n value === 'SELECT' ||\n (field.type === 'checkbox' && value === 'N') ||\n (field.type === 'switch' && value === 'N')\n ) {\n return\n }\n\n // 필드 타입에 따라 값 표시\n let displayValue = String(value)\n\n // 콤보/검색콤보인 경우 옵션의 label 찾기\n if ((field.type === 'combo' || field.type === 'searchcombo') && field.options) {\n const option = field.options.find(opt => opt.value === value)\n if (option) {\n displayValue = option.label\n }\n }\n\n // 체크박스/스위치는 'Y'일 때만 표시\n if (field.type === 'checkbox' || field.type === 'switch') {\n if (value === 'Y') {\n badges.push({\n fieldName: field.controlName,\n label: field.label,\n value: field.inlineLabel || field.label\n })\n }\n } else {\n badges.push({\n fieldName: field.controlName,\n label: field.label,\n value: displayValue\n })\n }\n })\n\n return badges\n})\n\n// submit 핸들러\nfunction handleSubmit(values: Record<string, any>) {\n emit('submit', values)\n}\n\n// 전체 초기화 핸들러\nfunction handleReset() {\n if (dynamicFormRef.value) {\n dynamicFormRef.value.reset()\n emit('reset')\n }\n}\n\n// 필드별 초기화 핸들러\nfunction handleFieldReset(fieldName: string) {\n if (!localModelValue || !props.schema) return\n \n const field = allFields.value.find(f => f.controlName === fieldName)\n \n if (field) {\n // 필드 타입에 따라 초기값 설정 - reactive 객체 직접 수정\n if (field.type === 'checkbox' || field.type === 'switch') {\n localModelValue[fieldName] = 'N'\n } else {\n localModelValue[fieldName] = ''\n }\n \n // localModelValue 변경 후 상위로 emit하여 JDynamicForm에도 반영\n isInternalUpdate = true\n emit('update:modelValue', { ...localModelValue })\n }\n}\n</script>\n\n<style scoped>\n/* 필요시 스타일 추가 */\n</style>\n\n"],"names":["props","__props","emit","__emit","dynamicFormRef","ref","isExpanded","localModelValue","reactive","isInternalUpdate","watch","newValue","key","handleFormValueUpdate","value","allFields","computed","fields","section","step","conditionBadges","badges","formState","field","displayValue","option","opt","handleSubmit","values","handleReset","handleFieldReset","fieldName","f","_createBlock","_unref","Card","_createVNode","CardHeader","_createElementVNode","_hoisted_1","_hoisted_2","_createElementBlock","_cache","$event","ChevronDown","_createTextVNode","CardTitle","_openBlock","_hoisted_3","_Fragment","_renderList","badge","JBadge","_toDisplayString","_withModifiers","X","JButton","CardContent","JDynamicForm","_vShow"],"mappings":"gjDA4FA,MAAMA,EAAQC,EAMRC,EAAOC,EAMPC,EAAiBC,EAAAA,IAA4D,IAAI,EACjFC,EAAaD,EAAAA,IAAI,CAACL,EAAM,gBAAgB,EAGxCO,EAAkBC,EAAAA,SAA8BR,EAAM,WAAa,CAAE,GAAGA,EAAM,UAAA,EAAe,EAAE,EAGrG,IAAIS,EAAmB,GAGvBC,EAAAA,MACE,IAAMV,EAAM,WACXW,GAAa,CACRA,GAAY,CAACF,IAEf,OAAO,KAAKF,CAAe,EAAE,QAAQK,GAAO,CACpCA,KAAOD,GACX,OAAOJ,EAAgBK,CAAG,CAE9B,CAAC,EAED,OAAO,OAAOL,EAAiBI,CAAQ,GAEzCF,EAAmB,EACrB,EACA,CAAE,KAAM,GAAM,UAAW,EAAA,CAAK,EAIhC,SAASI,EAAsBC,EAA4B,CAEzDL,EAAmB,GACnB,OAAO,OAAOF,EAAiBO,CAAK,EAEpCZ,EAAK,oBAAqB,CAAE,GAAGY,EAAO,CACxC,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3,"file":"JSearchPanel.vue2.cjs","sources":["../../../../src/components/organisms/JSearchPanel.vue"],"sourcesContent":["<template>\n <Card class=\"w-full\">\n <!-- 헤더: 제목, Badge 목록, 초기화 버튼 -->\n <CardHeader class=\"pt-4 pb-3 px-6\">\n <div class=\"flex items-center justify-between\">\n <div class=\"flex items-center gap-3 flex-1\">\n <button\n v-if=\"collapsible\"\n type=\"button\"\n @click=\"isExpanded = !isExpanded\"\n class=\"flex items-center gap-2 font-semibold hover:text-primary transition-colors\"\n >\n <ChevronDown\n :class=\"['h-4 w-4 transition-transform', isExpanded ? 'rotate-0' : '-rotate-90']\"\n />\n {{ title }}\n </button>\n <CardTitle v-else class=\"mb-0\">{{ title }}</CardTitle>\n \n <!-- 조건 Badge 목록 -->\n <div v-if=\"conditionBadges.length > 0\" class=\"flex flex-wrap items-center gap-2 ml-2\">\n <JBadge\n v-for=\"badge in conditionBadges\"\n :key=\"badge.fieldName\"\n variant=\"secondary\"\n size=\"sm\"\n class=\"flex items-center gap-1.5 pr-1\"\n >\n <span>{{ badge.label }}: {{ badge.value }}</span>\n <button\n type=\"button\"\n @click.stop=\"handleFieldReset(badge.fieldName)\"\n class=\"h-4 w-4 rounded-full hover:bg-destructive/20 hover:text-destructive transition-colors flex items-center justify-center\"\n :aria-label=\"`${badge.label} 조건 제거`\"\n >\n <X class=\"h-3 w-3\" />\n </button>\n </JBadge>\n </div>\n </div>\n \n <JButton\n variant=\"outline\"\n size=\"sm\"\n @click.stop=\"handleReset\"\n >\n 초기화\n </JButton>\n </div>\n </CardHeader>\n \n <!-- 폼 내용 -->\n <CardContent v-show=\"isExpanded || !collapsible\" class=\"px-6 pb-6 pt-0\">\n <JDynamicForm\n ref=\"dynamicFormRef\"\n :schema=\"schema\"\n :model-value=\"localModelValue\"\n @update:model-value=\"handleFormValueUpdate\"\n @submit=\"handleSubmit\"\n />\n </CardContent>\n </Card>\n</template>\n\n<script setup lang=\"ts\">\nimport { computed, ref, reactive, watch } from 'vue'\nimport { ChevronDown, X } from 'lucide-vue-next'\nimport { Card, CardHeader, CardTitle, CardContent } from '@/components/shadcn'\nimport { JButton, JBadge } from '@/components/atoms'\nimport JDynamicForm from './JDynamicForm.vue'\nimport type { FormSchema, DynamicFormField } from '@/types/dynamic-form'\nimport type { ComponentPublicInstance } from 'vue'\n\ninterface ConditionBadge {\n fieldName: string\n label: string\n value: string\n}\n\nexport interface JSearchPanelProps {\n /** 패널 제목 */\n title?: string\n /** JDynamicForm에 전달할 FormSchema */\n schema: FormSchema\n /** JDynamicForm의 v-model 값 */\n modelValue?: Record<string, any>\n /** 기본 접힘 상태 */\n defaultCollapsed?: boolean\n /** 접기/펼치기 가능 여부 */\n collapsible?: boolean\n}\n\nconst props = withDefaults(defineProps<JSearchPanelProps>(), {\n title: '조회조건',\n defaultCollapsed: false,\n collapsible: true,\n})\n\nconst emit = defineEmits<{\n 'update:modelValue': [value: Record<string, any>]\n 'submit': [values: Record<string, any>]\n 'reset': []\n}>()\n\nconst dynamicFormRef = ref<ComponentPublicInstance & { reset: () => void } | null>(null)\nconst isExpanded = ref(!props.defaultCollapsed)\n\n// 로컬 modelValue - reactive로 관리하여 양방향 바인딩\nconst localModelValue = reactive<Record<string, any>>(props.modelValue ? { ...props.modelValue } : {})\n\n// 내부 변경인지 외부 변경인지 구분하는 플래그\nlet isInternalUpdate = false\n\n// props.modelValue 변경 시 localModelValue 동기화 (외부 변경)\nwatch(\n () => props.modelValue,\n (newValue) => {\n if (newValue && !isInternalUpdate) {\n // 기존 키 중 새 값에 없는 것은 삭제\n Object.keys(localModelValue).forEach(key => {\n if (!(key in newValue)) {\n delete localModelValue[key]\n }\n })\n // 새 값으로 업데이트\n Object.assign(localModelValue, newValue)\n }\n isInternalUpdate = false\n },\n { deep: true, immediate: true }\n)\n\n// JDynamicForm에서 값이 변경되었을 때 처리\nfunction handleFormValueUpdate(value: Record<string, any>) {\n // JDynamicForm에서 emit된 값을 localModelValue에 반영\n isInternalUpdate = true\n Object.assign(localModelValue, value)\n // 상위로 emit\n emit('update:modelValue', { ...value })\n}\n\n// 모든 필드 가져오기\nconst allFields = computed((): DynamicFormField[] => {\n if (!props.schema) return []\n \n const fields: DynamicFormField[] = []\n if (props.schema.type === 'simple' && props.schema.fields) {\n fields.push(...props.schema.fields)\n } else if (props.schema.type === 'sectioned' && props.schema.sections) {\n props.schema.sections.forEach(section => {\n if (section.fields) fields.push(...section.fields)\n })\n } else if (props.schema.type === 'wizard' && props.schema.steps) {\n props.schema.steps.forEach(step => {\n if (step.fields) fields.push(...step.fields)\n })\n }\n return fields\n})\n\n// 조건 Badge 목록 생성\nconst conditionBadges = computed((): ConditionBadge[] => {\n if (!localModelValue || !props.schema) {\n return []\n }\n\n const badges: ConditionBadge[] = []\n const formState = localModelValue\n\n allFields.value.forEach((field) => {\n const value = formState[field.controlName]\n \n // 빈 값 체크 (빈 문자열, null, undefined, 'ALL', 'SELECT' 제외)\n if (\n value === undefined ||\n value === null ||\n value === '' ||\n value === 'ALL' ||\n value === 'SELECT' ||\n (field.type === 'checkbox' && value === 'N') ||\n (field.type === 'switch' && value === 'N')\n ) {\n return\n }\n\n // 필드 타입에 따라 값 표시\n let displayValue = String(value)\n\n // 콤보/검색콤보인 경우 옵션의 label 찾기\n if ((field.type === 'combo' || field.type === 'searchcombo') && field.options) {\n const option = field.options.find(opt => opt.value === value)\n if (option) {\n displayValue = option.label\n }\n }\n\n // 체크박스/스위치는 'Y'일 때만 표시\n if (field.type === 'checkbox' || field.type === 'switch') {\n if (value === 'Y') {\n badges.push({\n fieldName: field.controlName,\n label: field.label,\n value: field.inlineLabel || field.label\n })\n }\n } else {\n badges.push({\n fieldName: field.controlName,\n label: field.label,\n value: displayValue\n })\n }\n })\n\n return badges\n})\n\n// submit 핸들러\nfunction handleSubmit(values: Record<string, any>) {\n emit('submit', values)\n}\n\n// 전체 초기화 핸들러\nfunction handleReset() {\n if (dynamicFormRef.value) {\n dynamicFormRef.value.reset()\n emit('reset')\n }\n}\n\n// 필드별 초기화 핸들러\nfunction handleFieldReset(fieldName: string) {\n if (!localModelValue || !props.schema) return\n \n const field = allFields.value.find(f => f.controlName === fieldName)\n \n if (field) {\n // 필드 타입에 따라 초기값 설정 - reactive 객체 직접 수정\n if (field.type === 'checkbox' || field.type === 'switch') {\n localModelValue[fieldName] = 'N'\n } else {\n localModelValue[fieldName] = ''\n }\n \n // localModelValue 변경 후 상위로 emit하여 JDynamicForm에도 반영\n isInternalUpdate = true\n emit('update:modelValue', { ...localModelValue })\n }\n}\n</script>\n\n<style scoped>\n/* 필요시 스타일 추가 */\n</style>\n\n"],"names":["props","__props","emit","__emit","dynamicFormRef","ref","isExpanded","localModelValue","reactive","isInternalUpdate","watch","newValue","key","handleFormValueUpdate","value","allFields","computed","fields","section","step","conditionBadges","badges","formState","field","displayValue","option","opt","handleSubmit","values","handleReset","handleFieldReset","fieldName","f","_createBlock","_unref","Card","_createVNode","CardHeader","_createElementVNode","_hoisted_1","_hoisted_2","_createElementBlock","_cache","$event","ChevronDown","_createTextVNode","CardTitle","_openBlock","_hoisted_3","_Fragment","_renderList","badge","JBadge","_toDisplayString","_withModifiers","X","JButton","CardContent","JDynamicForm","_vShow"],"mappings":"8zDA4FA,MAAMA,EAAQC,EAMRC,EAAOC,EAMPC,EAAiBC,EAAAA,IAA4D,IAAI,EACjFC,EAAaD,EAAAA,IAAI,CAACL,EAAM,gBAAgB,EAGxCO,EAAkBC,EAAAA,SAA8BR,EAAM,WAAa,CAAE,GAAGA,EAAM,UAAA,EAAe,EAAE,EAGrG,IAAIS,EAAmB,GAGvBC,EAAAA,MACE,IAAMV,EAAM,WACXW,GAAa,CACRA,GAAY,CAACF,IAEf,OAAO,KAAKF,CAAe,EAAE,QAAQK,GAAO,CACpCA,KAAOD,GACX,OAAOJ,EAAgBK,CAAG,CAE9B,CAAC,EAED,OAAO,OAAOL,EAAiBI,CAAQ,GAEzCF,EAAmB,EACrB,EACA,CAAE,KAAM,GAAM,UAAW,EAAA,CAAK,EAIhC,SA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aM,EACb,sBAAoBM,EACpB,SAAQc,CAAA,gDANQ,CAAAgC,EAAAA,MAAArD,EAAA,QAAeL,EAAA,WAAW,CAAA"}
|
|
@@ -1,15 +1,20 @@
|
|
|
1
|
-
import { defineComponent as L, ref as V, reactive as z, watch as D, computed as C, createBlock as v, openBlock as
|
|
1
|
+
import { defineComponent as L, ref as V, reactive as z, watch as D, computed as C, createBlock as v, openBlock as n, unref as i, withCtx as m, createVNode as c, withDirectives as R, createElementVNode as d, createElementBlock as y, createCommentVNode as O, createTextVNode as x, normalizeClass as U, toDisplayString as h, Fragment as J, renderList as M, withModifiers as g, vShow as T } from "vue";
|
|
2
2
|
import { ChevronDown as A, X as I } from "lucide-vue-next";
|
|
3
3
|
import "../shadcn/index.js";
|
|
4
4
|
import P from "../atoms/JButton.vue.js";
|
|
5
5
|
import "clsx";
|
|
6
6
|
import "tailwind-merge";
|
|
7
7
|
import "@internationalized/date";
|
|
8
|
+
import "md-editor-v3";
|
|
9
|
+
/* empty css */
|
|
10
|
+
/* empty css */
|
|
8
11
|
import X from "../atoms/JBadge.vue.js";
|
|
9
12
|
import "@vueuse/core";
|
|
10
13
|
import "reka-ui";
|
|
11
14
|
/* empty css */
|
|
12
15
|
import "../shadcn/avatar-variants.js";
|
|
16
|
+
import "dompurify";
|
|
17
|
+
/* empty css */
|
|
13
18
|
import "ag-grid-vue3";
|
|
14
19
|
import "ag-grid-community";
|
|
15
20
|
import "ag-grid-enterprise";
|
|
@@ -17,6 +22,7 @@ import "ag-grid-enterprise";
|
|
|
17
22
|
/* empty css */
|
|
18
23
|
/* empty css */
|
|
19
24
|
/* empty css */
|
|
25
|
+
import "vue-sonner";
|
|
20
26
|
import Y from "./JDynamicForm.vue.js";
|
|
21
27
|
import q from "../shadcn/Card.vue.js";
|
|
22
28
|
import G from "../shadcn/CardHeader.vue.js";
|
|
@@ -25,7 +31,7 @@ import K from "../shadcn/CardContent.vue.js";
|
|
|
25
31
|
const Q = { class: "flex items-center justify-between" }, W = { class: "flex items-center gap-3 flex-1" }, Z = {
|
|
26
32
|
key: 2,
|
|
27
33
|
class: "flex flex-wrap items-center gap-2 ml-2"
|
|
28
|
-
}, ee = ["onClick", "aria-label"],
|
|
34
|
+
}, ee = ["onClick", "aria-label"], Be = /* @__PURE__ */ L({
|
|
29
35
|
__name: "JSearchPanel",
|
|
30
36
|
props: {
|
|
31
37
|
title: { default: "조회조건" },
|
|
@@ -35,33 +41,33 @@ const Q = { class: "flex items-center justify-between" }, W = { class: "flex ite
|
|
|
35
41
|
collapsible: { type: Boolean, default: !0 }
|
|
36
42
|
},
|
|
37
43
|
emits: ["update:modelValue", "submit", "reset"],
|
|
38
|
-
setup(
|
|
39
|
-
const
|
|
44
|
+
setup(r, { emit: E }) {
|
|
45
|
+
const o = r, u = E, b = V(null), p = V(!o.defaultCollapsed), a = z(o.modelValue ? { ...o.modelValue } : {});
|
|
40
46
|
let f = !1;
|
|
41
47
|
D(
|
|
42
|
-
() =>
|
|
48
|
+
() => o.modelValue,
|
|
43
49
|
(t) => {
|
|
44
|
-
t && !f && (Object.keys(
|
|
45
|
-
l in t || delete
|
|
46
|
-
}), Object.assign(
|
|
50
|
+
t && !f && (Object.keys(a).forEach((l) => {
|
|
51
|
+
l in t || delete a[l];
|
|
52
|
+
}), Object.assign(a, t)), f = !1;
|
|
47
53
|
},
|
|
48
54
|
{ deep: !0, immediate: !0 }
|
|
49
55
|
);
|
|
50
56
|
function $(t) {
|
|
51
|
-
f = !0, Object.assign(
|
|
57
|
+
f = !0, Object.assign(a, t), u("update:modelValue", { ...t });
|
|
52
58
|
}
|
|
53
59
|
const _ = C(() => {
|
|
54
|
-
if (!
|
|
60
|
+
if (!o.schema) return [];
|
|
55
61
|
const t = [];
|
|
56
|
-
return
|
|
62
|
+
return o.schema.type === "simple" && o.schema.fields ? t.push(...o.schema.fields) : o.schema.type === "sectioned" && o.schema.sections ? o.schema.sections.forEach((l) => {
|
|
57
63
|
l.fields && t.push(...l.fields);
|
|
58
|
-
}) :
|
|
64
|
+
}) : o.schema.type === "wizard" && o.schema.steps && o.schema.steps.forEach((l) => {
|
|
59
65
|
l.fields && t.push(...l.fields);
|
|
60
66
|
}), t;
|
|
61
67
|
}), k = C(() => {
|
|
62
|
-
if (!
|
|
68
|
+
if (!a || !o.schema)
|
|
63
69
|
return [];
|
|
64
|
-
const t = [], l =
|
|
70
|
+
const t = [], l = a;
|
|
65
71
|
return _.value.forEach((e) => {
|
|
66
72
|
const s = l[e.controlName];
|
|
67
73
|
if (s == null || s === "" || s === "ALL" || s === "SELECT" || e.type === "checkbox" && s === "N" || e.type === "switch" && s === "N")
|
|
@@ -89,43 +95,43 @@ const Q = { class: "flex items-center justify-between" }, W = { class: "flex ite
|
|
|
89
95
|
b.value && (b.value.reset(), u("reset"));
|
|
90
96
|
}
|
|
91
97
|
function B(t) {
|
|
92
|
-
if (!
|
|
98
|
+
if (!a || !o.schema) return;
|
|
93
99
|
const l = _.value.find((e) => e.controlName === t);
|
|
94
|
-
l && (l.type === "checkbox" || l.type === "switch" ?
|
|
100
|
+
l && (l.type === "checkbox" || l.type === "switch" ? a[t] = "N" : a[t] = "", f = !0, u("update:modelValue", { ...a }));
|
|
95
101
|
}
|
|
96
|
-
return (t, l) => (
|
|
97
|
-
default:
|
|
98
|
-
|
|
99
|
-
default:
|
|
102
|
+
return (t, l) => (n(), v(i(q), { class: "w-full" }, {
|
|
103
|
+
default: m(() => [
|
|
104
|
+
c(i(G), { class: "pt-4 pb-3 px-6" }, {
|
|
105
|
+
default: m(() => [
|
|
100
106
|
d("div", Q, [
|
|
101
107
|
d("div", W, [
|
|
102
|
-
|
|
108
|
+
r.collapsible ? (n(), y("button", {
|
|
103
109
|
key: 0,
|
|
104
110
|
type: "button",
|
|
105
111
|
onClick: l[0] || (l[0] = (e) => p.value = !p.value),
|
|
106
112
|
class: "flex items-center gap-2 font-semibold hover:text-primary transition-colors"
|
|
107
113
|
}, [
|
|
108
|
-
|
|
114
|
+
c(i(A), {
|
|
109
115
|
class: U(["h-4 w-4 transition-transform", p.value ? "rotate-0" : "-rotate-90"])
|
|
110
116
|
}, null, 8, ["class"]),
|
|
111
|
-
x(" " + h(
|
|
112
|
-
])) : (
|
|
117
|
+
x(" " + h(r.title), 1)
|
|
118
|
+
])) : (n(), v(i(H), {
|
|
113
119
|
key: 1,
|
|
114
120
|
class: "mb-0"
|
|
115
121
|
}, {
|
|
116
|
-
default:
|
|
117
|
-
x(h(
|
|
122
|
+
default: m(() => [
|
|
123
|
+
x(h(r.title), 1)
|
|
118
124
|
]),
|
|
119
125
|
_: 1
|
|
120
126
|
})),
|
|
121
|
-
k.value.length > 0 ? (
|
|
122
|
-
(
|
|
127
|
+
k.value.length > 0 ? (n(), y("div", Z, [
|
|
128
|
+
(n(!0), y(J, null, M(k.value, (e) => (n(), v(i(X), {
|
|
123
129
|
key: e.fieldName,
|
|
124
130
|
variant: "secondary",
|
|
125
131
|
size: "sm",
|
|
126
132
|
class: "flex items-center gap-1.5 pr-1"
|
|
127
133
|
}, {
|
|
128
|
-
default:
|
|
134
|
+
default: m(() => [
|
|
129
135
|
d("span", null, h(e.label) + ": " + h(e.value), 1),
|
|
130
136
|
d("button", {
|
|
131
137
|
type: "button",
|
|
@@ -133,19 +139,19 @@ const Q = { class: "flex items-center justify-between" }, W = { class: "flex ite
|
|
|
133
139
|
class: "h-4 w-4 rounded-full hover:bg-destructive/20 hover:text-destructive transition-colors flex items-center justify-center",
|
|
134
140
|
"aria-label": `${e.label} 조건 제거`
|
|
135
141
|
}, [
|
|
136
|
-
|
|
142
|
+
c(i(I), { class: "h-3 w-3" })
|
|
137
143
|
], 8, ee)
|
|
138
144
|
]),
|
|
139
145
|
_: 2
|
|
140
146
|
}, 1024))), 128))
|
|
141
147
|
])) : O("", !0)
|
|
142
148
|
]),
|
|
143
|
-
|
|
149
|
+
c(i(P), {
|
|
144
150
|
variant: "outline",
|
|
145
151
|
size: "sm",
|
|
146
152
|
onClick: g(F, ["stop"])
|
|
147
153
|
}, {
|
|
148
|
-
default:
|
|
154
|
+
default: m(() => [...l[1] || (l[1] = [
|
|
149
155
|
x(" 초기화 ", -1)
|
|
150
156
|
])]),
|
|
151
157
|
_: 1
|
|
@@ -154,20 +160,20 @@ const Q = { class: "flex items-center justify-between" }, W = { class: "flex ite
|
|
|
154
160
|
]),
|
|
155
161
|
_: 1
|
|
156
162
|
}),
|
|
157
|
-
R(
|
|
158
|
-
default:
|
|
159
|
-
|
|
163
|
+
R(c(i(K), { class: "px-6 pb-6 pt-0" }, {
|
|
164
|
+
default: m(() => [
|
|
165
|
+
c(Y, {
|
|
160
166
|
ref_key: "dynamicFormRef",
|
|
161
167
|
ref: b,
|
|
162
|
-
schema:
|
|
163
|
-
"model-value":
|
|
168
|
+
schema: r.schema,
|
|
169
|
+
"model-value": a,
|
|
164
170
|
"onUpdate:modelValue": $,
|
|
165
171
|
onSubmit: S
|
|
166
172
|
}, null, 8, ["schema", "model-value"])
|
|
167
173
|
]),
|
|
168
174
|
_: 1
|
|
169
175
|
}, 512), [
|
|
170
|
-
[T, p.value || !
|
|
176
|
+
[T, p.value || !r.collapsible]
|
|
171
177
|
])
|
|
172
178
|
]),
|
|
173
179
|
_: 1
|
|
@@ -175,6 +181,6 @@ const Q = { class: "flex items-center justify-between" }, W = { class: "flex ite
|
|
|
175
181
|
}
|
|
176
182
|
});
|
|
177
183
|
export {
|
|
178
|
-
|
|
184
|
+
Be as default
|
|
179
185
|
};
|
|
180
186
|
//# sourceMappingURL=JSearchPanel.vue2.js.map
|