@gct-paas/design-web 0.1.4-dev.1 → 0.1.4-dev.11
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/index.esm.min.mjs +836 -0
- package/dist/index.min.cjs +1 -1
- package/dist/index.min.css +1 -0
- package/dist/index.system.min.js +1 -1
- package/es/_virtual/_plugin-vue_export-helper.mjs +9 -0
- package/es/components/I18nSelect/index.d.ts +7 -0
- package/es/components/I18nSelect/src/i18n-modal.vue.d.ts +21 -0
- package/es/components/I18nSelect/src/i18n-modal.vue.mjs +151 -0
- package/es/components/I18nSelect/src/i18n-modal.vue2.mjs +5 -0
- package/es/components/I18nSelect/src/i18n-select-btn.css +58 -0
- package/es/components/I18nSelect/src/i18n-select-btn.vue.d.ts +17 -0
- package/es/components/I18nSelect/src/i18n-select-btn.vue.mjs +7 -0
- package/es/components/I18nSelect/src/i18n-select-btn.vue2.mjs +138 -0
- package/es/components/I18nSelect/src/i18n-select-container.css +6 -0
- package/es/components/I18nSelect/src/i18n-select-container.vue.d.ts +10 -0
- package/es/components/I18nSelect/src/i18n-select-container.vue.mjs +7 -0
- package/es/components/I18nSelect/src/i18n-select-container.vue2.mjs +250 -0
- package/es/components/I18nSelect/src/i18n-select-input-form.vue.d.ts +15 -0
- package/es/components/I18nSelect/src/i18n-select-input-form.vue.mjs +57 -0
- package/es/components/I18nSelect/src/i18n-select-input-form.vue2.mjs +5 -0
- package/es/components/I18nSelect/src/i18n-select-input.css +3 -0
- package/es/components/I18nSelect/src/i18n-select-input.vue.d.ts +51 -0
- package/es/components/I18nSelect/src/i18n-select-input.vue.mjs +7 -0
- package/es/components/I18nSelect/src/i18n-select-input.vue2.mjs +129 -0
- package/es/components/{test-com/test-com.d.ts → I18nSelect/src/i18n-select-modal.vue.d.ts} +3 -2
- package/es/components/I18nSelect/src/i18n-select-modal.vue.mjs +21 -0
- package/es/components/I18nSelect/src/i18n-select-modal.vue2.mjs +5 -0
- package/es/components/I18nSelect/src/i18n-select-textarea-form.vue.d.ts +15 -0
- package/es/components/I18nSelect/src/i18n-select-textarea-form.vue.mjs +57 -0
- package/es/components/I18nSelect/src/i18n-select-textarea-form.vue2.mjs +5 -0
- package/es/components/I18nSelect/src/i18n-select-textarea.css +17 -0
- package/es/components/I18nSelect/src/i18n-select-textarea.vue.d.ts +26 -0
- package/es/components/I18nSelect/src/i18n-select-textarea.vue.mjs +7 -0
- package/es/components/I18nSelect/src/i18n-select-textarea.vue2.mjs +93 -0
- package/es/components/I18nSelect/src/useI18nSelect.d.ts +13 -0
- package/es/components/I18nSelect/src/useI18nSelect.mjs +51 -0
- package/es/components/index.d.ts +1 -3
- package/es/index.d.ts +1 -0
- package/es/index.mjs +9 -7
- package/es/types/index.d.ts +4 -2
- package/package.json +17 -12
- package/dist/design-web.css +0 -1
- package/es/components/index.mjs +0 -4
- package/es/components/test-com/test-com.mjs +0 -21
- package/es/components/test-com/test-com.scss +0 -3
- package/es/components/test-vue-com/test-vue-com.vue +0 -15
- package/es/components/test-vue-com/test-vue-com.vue.d.ts +0 -2
- package/es/vite-env.d.ts +0 -1
package/dist/index.min.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),s=require("@gct-paas/core"),n=e.defineComponent({__name:"test-vue-com",setup(t){const r=s.useNamespace("test-vue-com"),c=e.ref("Hello World!"),l=e.ref("Hello World2!");return(u,m)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(r).b())},[e.createElementVNode("div",null,e.toDisplayString(c.value),1),e.createElementVNode("div",null,e.toDisplayString(l.value),1)],2))}}),o=e.defineComponent({name:"TestCom",setup(){return{ns:s.useNamespace("test-com")}},render(){return e.createVNode("div",{class:this.ns.b()},[e.createTextVNode("TestCom")])}}),a={install(t){t.component(o.name,o),t.component(n.name,n)}};exports.default=a;
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),I=require("lodash-es"),R=require("@gct-paas/core-web"),Z=require("@ant-design/icons-vue"),k=require("@gct-paas/core"),F=e.defineComponent({__name:"i18n-modal",props:{lang:{},getContainer:{type:Function}},emits:["ok","register"],setup(t,{emit:u}){const l=t,o=u,a=e.ref(),n=e.reactive({id:""}),r=e.ref(!1),p=g=>{g&&(r.value=!1)},[f,{closeModal:d}]=R.useModalInner(g=>{g&&m(g)}),m=g=>{r.value=!0,n.id=g.key;const{lang:i}=l;console.log(i,"lang========");for(const s of i){const h=s.dataIndex;n[h]=g[h]}},y=(g,i,s)=>{/^[a-zA-Z_.]*$/.test(i)||s(k.t("sys.i18n.validated18nKeyErrorMsg")),s()},v=async(g,i)=>/^\s*$/g.test(i)?Promise.reject(k.t("sys.notEmptySth",{sth:k.t("sys.i18n")})):Promise.resolve(),c=()=>{a.value?.validate().then(()=>{o("ok",{...e.toRaw(n)},r.value),d()})},x=()=>{a.value?.resetFields()};return(g,i)=>{const s=e.resolveComponent("a-input"),h=e.resolveComponent("a-form-item"),_=e.resolveComponent("a-form"),V=e.resolveComponent("BasicModal");return e.openBlock(),e.createBlock(V,e.mergeProps(g.$attrs,{title:r.value?e.unref(k.t)("sys.edit"):e.unref(k.t)("sys.new"),centered:"",width:"640px","min-height":100,"mask-closable":!1,"after-close":x,"get-container":t.getContainer,onRegister:e.unref(f),onOk:c,onVisibleChange:p}),{default:e.withCtx(()=>[e.createVNode(_,{ref_key:"formRef",ref:a,model:n,"label-col":{span:6},"wrapper-col":{span:16},autocomplete:"off",layout:"horizontal"},{default:e.withCtx(()=>[e.createVNode(h,{label:e.unref(k.t)("sys.i18n.resourceIdentification"),name:"id",rules:[{required:!0,message:e.unref(k.t)("sys.pleaseInputSth",{sth:e.unref(k.t)("sys.i18n.resourceIdentification")})},{validator:y}]},{default:e.withCtx(()=>[e.createVNode(s,{value:n.id,"onUpdate:value":i[0]||(i[0]=N=>n.id=N),"show-count":"",maxlength:128,disabled:r.value},null,8,["value","disabled"])]),_:1},8,["label","rules"]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.lang,N=>(e.openBlock(),e.createBlock(h,{key:N.dataIndex,label:N.title,name:N.dataIndex,rules:[{required:!0,message:e.unref(k.t)("sys.pleaseInputSth",{sth:N.title})},{validator:v}]},{default:e.withCtx(()=>[e.createVNode(s,{value:n[N.dataIndex],"onUpdate:value":$=>n[N.dataIndex]=$,"show-count":"",maxlength:300},null,8,["value","onUpdate:value"])]),_:2},1032,["label","name","rules"]))),128))]),_:1},8,["model"])]),_:1},16,["title","get-container","onRegister"])}}}),Q={class:"i18n-select-container"},X={class:"table-wrap"},Y=e.defineComponent({__name:"i18n-select-container",props:{i18nModalKey:{},destroyCallback:{type:Function},saveCallback:{type:Function}},setup(t){const[u,{closeModal:l}]=R.useModalInner(),[o,{openModal:a}]=R.useModal(),n=t,r=()=>document.querySelector(`#${n.i18nModalKey}`),p=e.ref(),f=e.reactive({keywords:""}),d=e.reactive({current:1,pageSize:5,total:0,size:"small",showTotal:C=>k.t("sys.component.table.total",{total:C})}),m=e.ref([]),y=e.ref(),v=e.ref({type:"radio",hideSelectAll:!0,selectedRowKeys:[],onChange:V}),c=e.ref(!1),x=e.computed(()=>[]),g=async(C,b)=>{c.value=!0;const w=await _api.apaas.i18NInfo.getPageList({pageNo:b??d.current,pageSize:d.pageSize,searchKey:C});if(c.value=!1,w&&w.data){const S=w.data.map(E=>{const B=JSON.parse(E?.info);return{key:E.key,type:E.type,...Object.fromEntries(B.map(P=>[P.locale,P.info]))}});d.total=w.totalCount,m.value=S}};e.onMounted(g);const i=()=>{p.value?.validate().then(async()=>{await g(f.keywords,1)})},s=C=>{const{current:b,total:w,pageSize:S}=C;d.current=b,d.total=w,d.pageSize=S,g()},h=()=>{a()},_=async(C,b)=>{const w=x.value.map(S=>({locale:S.dataIndex,info:C[S.dataIndex]}));c.value=!0;try{b?await _api.apaas.i18NInfo.putKey({key:C.id},{info:JSON.stringify(w)}):await _api.apaas.i18NInfo.post({info:JSON.stringify(w),key:C.id}),g(),V([C.id],[e.reactive(C)])}catch{c.value=!1}};function V(C,b){v.value.selectedRowKeys=C,y.value=b}const N=()=>{n.destroyCallback&&typeof n.destroyCallback=="function"&&n.destroyCallback()},$=async()=>{if(n.saveCallback&&typeof n.saveCallback=="function"){const C=v.value.selectedRowKeys,b={};if(C&&C[0]){const w=y.value?.[0];console.log("selectRow",w),Object.assign(b,{i18nKey:C[0]})}n.saveCallback(b)}l()};return(C,b)=>{const w=e.resolveComponent("a-input"),S=e.resolveComponent("a-form-item"),E=e.resolveComponent("a-col"),B=e.resolveComponent("a-button"),P=e.resolveComponent("plus-outlined"),q=e.resolveComponent("a-row"),U=e.resolveComponent("a-form"),H=e.resolveComponent("a-table"),J=e.resolveComponent("basic-modal");return e.openBlock(),e.createBlock(J,e.mergeProps(C.$attrs,{"min-height":40,title:e.unref(k.t)("sys.i18n.i18nConfig"),centered:"",width:"640px","can-fullscreen":!1,"mask-closable":!1,"after-close":N,"get-container":r,onRegister:e.unref(u),onOk:$}),{default:e.withCtx(()=>[e.createElementVNode("div",Q,[e.createVNode(U,{ref_key:"formRef",ref:p,model:f,autocomplete:"off",layout:"horizontal"},{default:e.withCtx(()=>[e.createVNode(q,null,{default:e.withCtx(()=>[e.createVNode(E,{span:12},{default:e.withCtx(()=>[e.createVNode(S,{name:"keywords",label:e.unref(k.t)("sys.keywords")},{default:e.withCtx(()=>[e.createVNode(w,{value:f.keywords,"onUpdate:value":b[0]||(b[0]=G=>f.keywords=G),placeholder:e.unref(k.t)("sys.keywordsPlaceholder"),style:{display:"inline-flex"}},null,8,["value","placeholder"])]),_:1},8,["label"])]),_:1}),e.createVNode(E,{span:12,style:{"text-align":"right"}},{default:e.withCtx(()=>[e.createVNode(B,{type:"primary",onClick:i},{icon:e.withCtx(()=>[e.createVNode(e.unref(Z.SearchOutlined))]),default:e.withCtx(()=>[e.createTextVNode(" "+e.toDisplayString(e.unref(k.t)("sys.queryText")),1)]),_:1}),e.createVNode(B,{style:{margin:"0 8px"},type:"primary",onClick:h},{icon:e.withCtx(()=>[e.createVNode(P)]),default:e.withCtx(()=>[e.createTextVNode(" "+e.toDisplayString(e.unref(k.t)("sys.new")),1)]),_:1})]),_:1})]),_:1})]),_:1},8,["model"]),e.createElementVNode("div",X,[e.createVNode(H,{ref:"tableRef","data-source":m.value,columns:x.value,"show-index-column":!1,pagination:d,striped:!1,bordered:!0,"row-selection":v.value,loading:c.value,onChange:s},null,8,["data-source","columns","pagination","row-selection","loading"]),e.createVNode(F,{lang:x.value,"get-container":r,onRegister:e.unref(o),onOk:_},null,8,["lang","onRegister"])])])]),_:1},16,["title","onRegister"])}}}),O=(t,u)=>{const l=t.__vccOpts||t;for(const[o,a]of u)l[o]=a;return l},ee=O(Y,[["__scopeId","data-v-0160ed5e"]]),te=e.defineComponent({__name:"i18n-select-modal",setup(t,{expose:u}){const[l,{openModal:o}]=R.useModal();return u({open:()=>{o()}}),(n,r)=>(e.openBlock(),e.createBlock(ee,{onRegister:e.unref(l)},null,8,["onRegister"]))}});function L(){let t=null,u=null;const l=e.ref("");function o(n){let r,p=document.body;if(I.has(n,"target")||I.has(n,"props")){const d=n;r=d.props||{},p=d.target||document.body}else r=n;l.value=r.i18nModalKey||`i18n-select-modal-${Math.random().toString(16).substring(8)}`;const f={...r,destroyCallback:()=>a(r?.destroyCallback),i18nModalKey:e.unref(l)};if(!t){const d=document.createElement("div");d.id=e.unref(l),e.unref(p)?.appendChild(d),t=e.createApp(te,f),u=t.mount(d)}u?.open()}function a(n){typeof n=="function"&&n(),document.querySelector(`#${e.unref(l)}`).remove(),t&&(t.unmount(),t=null)}return{open:o,close:a}}const ne={class:"i18n-tooltip-title"},oe={style:{"margin-left":"4px"}},ae=e.defineComponent({__name:"i18n-select-btn",props:{i18nValue:{},buttonExtraProps:{},size:{},i18nModalKey:{},simpleBtn:{type:Boolean},btnHeight:{},btnWidth:{}},emits:["on-select-i18n","closed"],setup(t,{emit:u}){const l=e.ref(),o=L(),a=t,n=u,r=e.reactive({}),p=e.computed(()=>!I.isEmpty(a.i18nValue)),f=async m=>{const y=await _api.apaas.i18NInfo.getPageList({pageNo:1,pageSize:20,searchKey:m});if(y&&y.data){const v=y.data.find(c=>c.key===a.i18nValue);v&&Object.assign(r,Object.fromEntries(Object.entries(JSON.parse(v.info)).map(([c,x])=>[x.locale,x.info])))}};e.watch(()=>a.i18nValue,()=>{I.isEmpty(a.i18nValue)||f(a.i18nValue)},{immediate:!0});const d=()=>{o.open({i18nModalKey:a.i18nModalKey,saveCallback:m=>{n("on-select-i18n",{...m})},destroyCallback:()=>{n("closed")}})};return(m,y)=>{const v=e.resolveComponent("Icon"),c=e.resolveComponent("a-button"),x=e.resolveComponent("a-tooltip");return t.simpleBtn?(e.openBlock(),e.createBlock(v,{key:0,class:e.normalizeClass(["i18n-icon simple-btn",{"is-highlight":p.value}]),icon:"ion:language",onClick:d},null,8,["class"])):p.value?(e.openBlock(),e.createBlock(x,{key:1,color:"#fff",placement:"topRight"},{title:e.withCtx(()=>[e.createElementVNode("div",ne,"语言标识:"+e.toDisplayString(t.i18nValue),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.value,g=>(e.openBlock(),e.createElementBlock("div",{key:g.id,class:"i18n-tooltip-item"},[e.createElementVNode("strong",null,e.toDisplayString(g.language)+": ",1),e.createElementVNode("span",oe,e.toDisplayString(r[g.languageTag]),1)]))),128))]),default:e.withCtx(()=>[e.createVNode(c,e.mergeProps(t.buttonExtraProps,{class:{"is-highlight":p.value},style:{"--btn-width":t.btnWidth,"--btn-height":t.btnHeight},size:t.size,onClick:d}),{icon:e.withCtx(()=>[e.createVNode(v,{class:"i18n-icon",icon:"ion:language"})]),_:1},16,["class","style","size"])]),_:1})):(e.openBlock(),e.createBlock(c,e.mergeProps({key:2},t.buttonExtraProps,{class:{"is-highlight":p.value},style:{"--btn-width":t.btnWidth,"--btn-height":t.btnHeight},size:t.size,onClick:d}),{icon:e.withCtx(()=>[e.createVNode(v,{class:"i18n-icon",icon:"ion:language"})]),_:1},16,["class","style","size"]))}}}),A=O(ae,[["__scopeId","data-v-dc8ffb2c"]]),le=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const ie=Object.prototype.toString,re=t=>ie.call(t)==="[object Object]",M=()=>{};function z(t){return Array.isArray(t)?t:[t]}function se(t,u,l){return e.watch(t,u,{...l,immediate:!0})}const j=le?window:void 0;function T(t){var u;const l=e.toValue(t);return(u=l?.$el)!==null&&u!==void 0?u:l}function K(...t){const u=(o,a,n,r)=>(o.addEventListener(a,n,r),()=>o.removeEventListener(a,n,r)),l=e.computed(()=>{const o=z(e.toValue(t[0])).filter(a=>a!=null);return o.every(a=>typeof a!="string")?o:void 0});return se(()=>{var o,a;return[(o=(a=l.value)===null||a===void 0?void 0:a.map(n=>T(n)))!==null&&o!==void 0?o:[j].filter(n=>n!=null),z(e.toValue(l.value?t[1]:t[0])),z(e.unref(l.value?t[2]:t[1])),e.toValue(l.value?t[3]:t[2])]},([o,a,n,r],p,f)=>{if(!o?.length||!a?.length||!n?.length)return;const d=re(r)?{...r}:r,m=o.flatMap(y=>a.flatMap(v=>n.map(c=>u(y,v,c,d))));f(()=>{m.forEach(y=>y())})},{flush:"post"})}function ce(t,u,l={}){const{window:o=j,ignore:a=[],capture:n=!0,detectIframe:r=!1,controls:p=!1}=l;if(!o)return p?{stop:M,cancel:M,trigger:M}:M;let f=!0;const d=i=>e.toValue(a).some(s=>{if(typeof s=="string")return Array.from(o.document.querySelectorAll(s)).some(h=>h===i.target||i.composedPath().includes(h));{const h=T(s);return h&&(i.target===h||i.composedPath().includes(h))}});function m(i){const s=e.toValue(i);return s&&s.$.subTree.shapeFlag===16}function y(i,s){const h=e.toValue(i),_=h.$.subTree&&h.$.subTree.children;return _==null||!Array.isArray(_)?!1:_.some(V=>V.el===s.target||s.composedPath().includes(V.el))}const v=i=>{const s=T(t);if(i.target!=null&&!(!(s instanceof Element)&&m(t)&&y(t,i))&&!(!s||s===i.target||i.composedPath().includes(s))){if("detail"in i&&i.detail===0&&(f=!d(i)),!f){f=!0;return}u(i)}};let c=!1;const x=[K(o,"click",i=>{c||(c=!0,setTimeout(()=>{c=!1},0),v(i))},{passive:!0,capture:n}),K(o,"pointerdown",i=>{const s=T(t);f=!d(i)&&!!(s&&!i.composedPath().includes(s))},{passive:!0}),r&&K(o,"blur",i=>{setTimeout(()=>{var s;const h=T(t);((s=o.document.activeElement)===null||s===void 0?void 0:s.tagName)==="IFRAME"&&!h?.contains(o.document.activeElement)&&u(i)},0)},{passive:!0})].filter(Boolean),g=()=>x.forEach(i=>i());return p?{stop:g,cancel:()=>{f=!1},trigger:i=>{f=!0,v(i),f=!1}}:g}const ue=e.defineComponent({__name:"i18n-select-input",props:{attr:{},inputExtraProps:{},i18nConfig:{},i18nText:{},placeholderText:{},size:{},i18nModalKey:{},forceUpdate:{type:Boolean},btnHeight:{},btnWidth:{}},emits:["update:i18nText","update:i18nConfig","on-i18n-select","clickOutside","focus","blur"],setup(t,{emit:u}){const l=e.computed(()=>!!_gct.store.appInfo.id),o=t,a=u,n=e.computed({get(){return o.i18nText??""},set(c){c!==o.i18nText&&a("update:i18nText",c)}}),r=e.computed(()=>I.isEmpty(o.i18nConfig)?{}:typeof o.i18nConfig=="string"?JSON.parse(o.i18nConfig)??{}:o.i18nConfig??{}),p=e.computed(()=>r.value?.[o.attr]),f=c=>{console.log("emit",c),c&&((I.isEmpty(n.value)||o.forceUpdate===!0)&&a("update:i18nText",c.i18nTitle),a("update:i18nConfig",JSON.stringify(I.isEmpty(c)?I.omit(r.value,o.attr):{...r.value,[o.attr]:c.i18nKey})),a("on-i18n-select",c))},d=e.ref(),m=()=>{a("focus",d.value)},y=()=>{a("blur",d.value)},v=e.ref();return ce(v,()=>{a("clickOutside")}),(c,x)=>{const g=e.resolveComponent("a-input"),i=e.resolveComponent("a-input-group");return e.openBlock(),e.createBlock(i,{id:"i18nInputGroup",ref_key:"i18nInputGroup",ref:v,compact:""},{default:e.withCtx(()=>[e.renderSlot(c.$slots,"i18n-input",{},()=>[e.createVNode(g,e.mergeProps({ref_key:"inputRef",ref:d},t.inputExtraProps,{value:n.value,"onUpdate:value":x[0]||(x[0]=s=>n.value=s),valueModifiers:{trim:!0},style:{height:t.btnHeight?t.btnHeight:t.size===e.unref(k.ButtonSize).SMALL?"26px":"32px",width:l.value?`calc(100% - ${t.btnWidth?t.btnWidth:t.size===e.unref(k.ButtonSize).SMALL?"26px":"32px"}`:"100%"},placeholder:t.placeholderText,size:t.size,"allow-clear":"",onFocus:m,onBlur:y}),null,16,["value","style","placeholder","size"])],!0),l.value?(e.openBlock(),e.createBlock(A,{key:0,"btn-height":t.btnHeight,"btn-width":t.btnWidth,"i18n-value":p.value,size:t.size,"i18n-modal-key":t.i18nModalKey,onOnSelectI18n:f,onClosed:x[1]||(x[1]=s=>a("clickOutside"))},null,8,["btn-height","btn-width","i18n-value","size","i18n-modal-key"])):e.createCommentVNode("",!0)]),_:3},512)}}}),D=O(ue,[["__scopeId","data-v-412e1309"]]),de=e.defineComponent({__name:"i18n-select-input-form",props:{formItemName:{},fromItemExtraProps:{},inputExtraProps:{},i18nConfig:{},text:{},formRef:{}},emits:["update:text"],setup(t,{emit:u}){const l=t,o=u,a=e.computed({get(){return l.text??""},set(n){o("update:text",n),l.formRef?.validateFields([l.formItemName])}});return(n,r)=>{const p=e.resolveComponent("a-form-item");return e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createVNode(p,e.mergeProps({name:t.formItemName},t.fromItemExtraProps),{default:e.withCtx(()=>[e.createVNode(D,e.mergeProps(n.$attrs,{"i18n-text":a.value,"onUpdate:i18nText":r[0]||(r[0]=f=>a.value=f),"input-extra-props":t.inputExtraProps,"i18n-config":t.i18nConfig,attr:Array.isArray(t.formItemName)?t.formItemName.join("."):t.formItemName,"placeholder-text":n.$t("sys.inputText")}),null,16,["i18n-text","input-extra-props","i18n-config","attr","placeholder-text"])]),_:1},16,["name"]),e.createVNode(p,{name:"i18nConfig",hidden:""},{default:e.withCtx(()=>[e.createElementVNode("span",null,e.toDisplayString(t.i18nConfig),1)]),_:1})],64)}}}),fe={class:"inline-block w100% relative"},pe=e.defineComponent({__name:"i18n-select-textarea",props:{attr:{},inputExtraProps:{},i18nConfig:{},i18nText:{},placeholderText:{},rows:{},style:{}},emits:["update:i18nText","update:i18nConfig","on-i18n-select","clickOutside","focus"],setup(t,{emit:u}){const l=t,o=u,a=e.computed({get(){return l.i18nText??""},set(m){o("update:i18nText",m)}}),n=e.computed(()=>I.isEmpty(l.i18nConfig)?{}:typeof l.i18nConfig=="string"?JSON.parse(l.i18nConfig)??{}:l.i18nConfig??{}),r=e.computed(()=>n.value?.[l.attr]),p=m=>{m&&(I.isEmpty(a.value)&&o("update:i18nText",m.i18nTitle),o("update:i18nConfig",JSON.stringify(I.isEmpty(m)?I.omit(n.value,l.attr):{...n.value,[l.attr]:m.i18nKey})),o("on-i18n-select",m))},f=e.ref(),d=()=>{o("focus",f.value)};return(m,y)=>{const v=e.resolveComponent("a-textarea");return e.openBlock(),e.createElementBlock("div",fe,[e.createVNode(v,e.mergeProps({ref_key:"inputRef",ref:f,value:a.value,"onUpdate:value":y[0]||(y[0]=c=>a.value=c),placeholder:t.placeholderText},t.inputExtraProps,{style:{resize:"none",...t.style},onFocus:d}),null,16,["value","placeholder","style"]),e.createVNode(A,{"i18n-value":r.value,"simple-btn":!0,type:"text",onOnSelectI18n:p,onClosed:y[1]||(y[1]=c=>o("clickOutside"))},null,8,["i18n-value"])])}}}),W=O(pe,[["__scopeId","data-v-cd95c416"]]),me=e.defineComponent({__name:"i18n-select-textarea-form",props:{formItemName:{},fromItemExtraProps:{},inputExtraProps:{},i18nConfig:{},text:{},formRef:{}},emits:["update:text"],setup(t,{emit:u}){const l=t,o=u,a=e.computed({get(){return l.text??""},set(n){o("update:text",n),l.formRef?.validateFields([l.formItemName])}});return(n,r)=>{const p=e.resolveComponent("a-form-item");return e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createVNode(p,e.mergeProps({name:t.formItemName},t.fromItemExtraProps),{default:e.withCtx(()=>[e.createVNode(W,e.mergeProps(n.$attrs,{"i18n-text":a.value,"onUpdate:i18nText":r[0]||(r[0]=f=>a.value=f),"placeholder-text":n.$t("sys.inputText"),"input-extra-props":t.inputExtraProps,"i18n-config":t.i18nConfig,attr:Array.isArray(t.formItemName)?t.formItemName.join("."):t.formItemName}),null,16,["i18n-text","placeholder-text","input-extra-props","i18n-config","attr"])]),_:1},16,["name"]),e.createVNode(p,{name:"i18nConfig",hidden:""},{default:e.withCtx(()=>[e.createElementVNode("span",null,e.toDisplayString(t.i18nConfig),1)]),_:1})],64)}}}),ge={install(t){console.log("Design Web install",t)}};exports.I18Modal=F;exports.I18nSelectBtn=A;exports.I18nSelectInput=D;exports.I18nSelectInputForm=de;exports.I18nSelectTextarea=W;exports.I18nSelectTextareaForm=me;exports.default=ge;exports.useI18nSelect=L;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.i18n-select-container[data-v-0160ed5e]{padding:4px}[data-v-0160ed5e] .ant-form-horizontal .ant-form-item{flex-direction:row}.ant-btn[data-v-dc8ffb2c]{background-color:#fff!important}.ant-btn.ant-btn-icon-only[data-v-dc8ffb2c]{width:var(--btn-width, 32px);height:var(--btn-height, 32px)}.ant-btn.ant-btn-icon-only.ant-btn-sm[data-v-dc8ffb2c]{width:26px;height:26px}.ant-btn:hover .i18n-icon[data-v-dc8ffb2c]{transition:all .3s cubic-bezier(.645,.045,.355,1);color:var(--ant-primary-color)}.ant-btn.is-highlight[data-v-dc8ffb2c]{color:var(--ant-primary-color);border-color:var(--ant-primary-color)}.ant-btn.is-highlight .i18n-icon[data-v-dc8ffb2c]{color:var(--ant-primary-color)}.i18n-icon[data-v-dc8ffb2c]{color:#7f8695;display:flex!important}.simple-btn[data-v-dc8ffb2c]:hover,.simple-btn.is-highlight[data-v-dc8ffb2c]{color:var(--ant-primary-color)}.i18n-tooltip-title[data-v-dc8ffb2c]{color:#303133;font-size:16px;line-height:1;margin-bottom:12px}.i18n-tooltip-item[data-v-dc8ffb2c]{color:#606266;font-size:14px}.custom-i18n-btn[data-v-dc8ffb2c]{vertical-align:middle;background:#fff;color:#303133;border:none;font-size:14px;display:inline-flex;justify-content:center;align-items:center;padding:0}.custom-i18n-btn.reg-i18n[data-v-dc8ffb2c]{position:absolute;right:-32px;bottom:0}[data-v-412e1309] .ant-form-item-has-error .ant-btn{border-color:var(--ant-error-color)!important}[data-v-cd95c416] .i18n-icon{position:absolute;right:16px;bottom:12px;color:#212528;font-size:16px;cursor:pointer}[data-v-cd95c416] div.ant-input-textarea.ant-input-textarea-show-count.ant-input-textarea-show-count:after{right:33px}[data-v-cd95c416] .ant-input{border:2px dashed #dbdbdb;background:transparent}
|
package/dist/index.system.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
System.register(["vue","@gct-paas/core"],(function(v,C){"use strict";var n,s,a,l,i,m,c,o,u,p,r;return{setters:[e=>{n=e.defineComponent,s=e.ref,a=e.createElementBlock,l=e.openBlock,i=e.normalizeClass,m=e.unref,c=e.createElementVNode,o=e.toDisplayString,u=e.createVNode,p=e.createTextVNode},e=>{r=e.useNamespace}],execute:(function(){const e=n({__name:"test-vue-com",setup(t){const d=r("test-vue-com"),N=s("Hello World!"),_=s("Hello World2!");return(V,x)=>(l(),a("div",{class:i(m(d).b())},[c("div",null,o(N.value),1),c("div",null,o(_.value),1)],2))}}),f=n({name:"TestCom",setup(){return{ns:r("test-com")}},render(){return u("div",{class:this.ns.b()},[p("TestCom")])}}),g=v("default",{install(t){t.component(f.name,f),t.component(e.name,e)}})})}}));
|
|
1
|
+
System.register(["vue","lodash-es","@gct-paas/core-web","@ant-design/icons-vue","@gct-paas/core"],(function(K,Be){"use strict";var z,T,U,b,S,N,$,h,v,f,L,H,X,ce,E,ue,A,Y,B,de,ee,fe,F,pe,me,te,P,ne,oe,ae,ge,w,ie;return{setters:[l=>{z=l.defineComponent,T=l.ref,U=l.reactive,b=l.resolveComponent,S=l.openBlock,N=l.createBlock,$=l.mergeProps,h=l.unref,v=l.withCtx,f=l.createVNode,L=l.createElementBlock,H=l.Fragment,X=l.renderList,ce=l.toRaw,E=l.computed,ue=l.onMounted,A=l.createElementVNode,Y=l.createTextVNode,B=l.toDisplayString,de=l.createApp,ee=l.watch,fe=l.normalizeClass,F=l.toValue,pe=l.renderSlot,me=l.createCommentVNode},l=>{te=l.has,P=l.isEmpty,ne=l.omit},l=>{oe=l.useModalInner,ae=l.useModal},l=>{ge=l.SearchOutlined},l=>{w=l.t,ie=l.ButtonSize}],execute:(function(){K("useI18nSelect",ye);const l=K("I18Modal",z({__name:"i18n-modal",props:{lang:{},getContainer:{type:Function}},emits:["ok","register"],setup(e,{emit:u}){const a=e,n=u,o=T(),t=U({id:""}),s=T(!1),m=y=>{y&&(s.value=!1)},[p,{closeModal:d}]=oe(y=>{y&&g(y)}),g=y=>{s.value=!0,t.id=y.key;const{lang:i}=a;console.log(i,"lang========");for(const r of i){const I=r.dataIndex;t[I]=y[I]}},x=(y,i,r)=>{/^[a-zA-Z_.]*$/.test(i)||r(w("sys.i18n.validated18nKeyErrorMsg")),r()},C=async(y,i)=>/^\s*$/g.test(i)?Promise.reject(w("sys.notEmptySth",{sth:w("sys.i18n")})):Promise.resolve(),c=()=>{o.value?.validate().then(()=>{n("ok",{...ce(t)},s.value),d()})},_=()=>{o.value?.resetFields()};return(y,i)=>{const r=b("a-input"),I=b("a-form-item"),j=b("a-form"),W=b("BasicModal");return S(),N(W,$(y.$attrs,{title:s.value?h(w)("sys.edit"):h(w)("sys.new"),centered:"",width:"640px","min-height":100,"mask-closable":!1,"after-close":_,"get-container":e.getContainer,onRegister:h(p),onOk:c,onVisibleChange:m}),{default:v(()=>[f(j,{ref_key:"formRef",ref:o,model:t,"label-col":{span:6},"wrapper-col":{span:16},autocomplete:"off",layout:"horizontal"},{default:v(()=>[f(I,{label:h(w)("sys.i18n.resourceIdentification"),name:"id",rules:[{required:!0,message:h(w)("sys.pleaseInputSth",{sth:h(w)("sys.i18n.resourceIdentification")})},{validator:x}]},{default:v(()=>[f(r,{value:t.id,"onUpdate:value":i[0]||(i[0]=O=>t.id=O),"show-count":"",maxlength:128,disabled:s.value},null,8,["value","disabled"])]),_:1},8,["label","rules"]),(S(!0),L(H,null,X(a.lang,O=>(S(),N(I,{key:O.dataIndex,label:O.title,name:O.dataIndex,rules:[{required:!0,message:h(w)("sys.pleaseInputSth",{sth:O.title})},{validator:C}]},{default:v(()=>[f(r,{value:t[O.dataIndex],"onUpdate:value":re=>t[O.dataIndex]=re,"show-count":"",maxlength:300},null,8,["value","onUpdate:value"])]),_:2},1032,["label","name","rules"]))),128))]),_:1},8,["model"])]),_:1},16,["title","get-container","onRegister"])}}})),be={class:"i18n-select-container"},xe={class:"table-wrap"},Ce=z({__name:"i18n-select-container",props:{i18nModalKey:{},destroyCallback:{type:Function},saveCallback:{type:Function}},setup(e){const[u,{closeModal:a}]=oe(),[n,{openModal:o}]=ae(),t=e,s=()=>document.querySelector(`#${t.i18nModalKey}`),m=T(),p=U({keywords:""}),d=U({current:1,pageSize:5,total:0,size:"small",showTotal:k=>w("sys.component.table.total",{total:k})}),g=T([]),x=T(),C=T({type:"radio",hideSelectAll:!0,selectedRowKeys:[],onChange:W}),c=T(!1),_=E(()=>[]),y=async(k,R)=>{c.value=!0;const M=await _api.apaas.i18NInfo.getPageList({pageNo:R??d.current,pageSize:d.pageSize,searchKey:k});if(c.value=!1,M&&M.data){const V=M.data.map(D=>{const Z=JSON.parse(D?.info);return{key:D.key,type:D.type,...Object.fromEntries(Z.map(Q=>[Q.locale,Q.info]))}});d.total=M.totalCount,g.value=V}};ue(y);const i=()=>{m.value?.validate().then(async()=>{await y(p.keywords,1)})},r=k=>{const{current:R,total:M,pageSize:V}=k;d.current=R,d.total=M,d.pageSize=V,y()},I=()=>{o()},j=async(k,R)=>{const M=_.value.map(V=>({locale:V.dataIndex,info:k[V.dataIndex]}));c.value=!0;try{R?await _api.apaas.i18NInfo.putKey({key:k.id},{info:JSON.stringify(M)}):await _api.apaas.i18NInfo.post({info:JSON.stringify(M),key:k.id}),y(),W([k.id],[U(k)])}catch{c.value=!1}};function W(k,R){C.value.selectedRowKeys=k,x.value=R}const O=()=>{t.destroyCallback&&typeof t.destroyCallback=="function"&&t.destroyCallback()},re=async()=>{if(t.saveCallback&&typeof t.saveCallback=="function"){const k=C.value.selectedRowKeys,R={};if(k&&k[0]){const M=x.value?.[0];console.log("selectRow",M),Object.assign(R,{i18nKey:k[0]})}t.saveCallback(R)}a()};return(k,R)=>{const M=b("a-input"),V=b("a-form-item"),D=b("a-col"),Z=b("a-button"),Q=b("plus-outlined"),ze=b("a-row"),Pe=b("a-form"),Ve=b("a-table"),Ke=b("basic-modal");return S(),N(Ke,$(k.$attrs,{"min-height":40,title:h(w)("sys.i18n.i18nConfig"),centered:"",width:"640px","can-fullscreen":!1,"mask-closable":!1,"after-close":O,"get-container":s,onRegister:h(u),onOk:re}),{default:v(()=>[A("div",be,[f(Pe,{ref_key:"formRef",ref:m,model:p,autocomplete:"off",layout:"horizontal"},{default:v(()=>[f(ze,null,{default:v(()=>[f(D,{span:12},{default:v(()=>[f(V,{name:"keywords",label:h(w)("sys.keywords")},{default:v(()=>[f(M,{value:p.keywords,"onUpdate:value":R[0]||(R[0]=Ae=>p.keywords=Ae),placeholder:h(w)("sys.keywordsPlaceholder"),style:{display:"inline-flex"}},null,8,["value","placeholder"])]),_:1},8,["label"])]),_:1}),f(D,{span:12,style:{"text-align":"right"}},{default:v(()=>[f(Z,{type:"primary",onClick:i},{icon:v(()=>[f(h(ge))]),default:v(()=>[Y(" "+B(h(w)("sys.queryText")),1)]),_:1}),f(Z,{style:{margin:"0 8px"},type:"primary",onClick:I},{icon:v(()=>[f(Q)]),default:v(()=>[Y(" "+B(h(w)("sys.new")),1)]),_:1})]),_:1})]),_:1})]),_:1},8,["model"]),A("div",xe,[f(Ve,{ref:"tableRef","data-source":g.value,columns:_.value,"show-index-column":!1,pagination:d,striped:!1,bordered:!0,"row-selection":C.value,loading:c.value,onChange:r},null,8,["data-source","columns","pagination","row-selection","loading"]),f(l,{lang:_.value,"get-container":s,onRegister:h(n),onOk:j},null,8,["lang","onRegister"])])])]),_:1},16,["title","onRegister"])}}}),q=(e,u)=>{const a=e.__vccOpts||e;for(const[n,o]of u)a[n]=o;return a},Ie=q(Ce,[["__scopeId","data-v-0160ed5e"]]),ke=z({__name:"i18n-select-modal",setup(e,{expose:u}){const[a,{openModal:n}]=ae();return u({open:()=>{n()}}),(t,s)=>(S(),N(Ie,{onRegister:h(a)},null,8,["onRegister"]))}});function ye(){let e=null,u=null;const a=T("");function n(t){let s,m=document.body;if(te(t,"target")||te(t,"props")){const d=t;s=d.props||{},m=d.target||document.body}else s=t;a.value=s.i18nModalKey||`i18n-select-modal-${Math.random().toString(16).substring(8)}`;const p={...s,destroyCallback:()=>o(s?.destroyCallback),i18nModalKey:h(a)};if(!e){const d=document.createElement("div");d.id=h(a),h(m)?.appendChild(d),e=de(ke,p),u=e.mount(d)}u?.open()}function o(t){typeof t=="function"&&t(),document.querySelector(`#${h(a)}`).remove(),e&&(e.unmount(),e=null)}return{open:n,close:o}}const _e={class:"i18n-tooltip-title"},Se={style:{"margin-left":"4px"}},he=K("I18nSelectBtn",q(z({__name:"i18n-select-btn",props:{i18nValue:{},buttonExtraProps:{},size:{},i18nModalKey:{},simpleBtn:{type:Boolean},btnHeight:{},btnWidth:{}},emits:["on-select-i18n","closed"],setup(e,{emit:u}){const a=T(),n=ye(),o=e,t=u,s=U({}),m=E(()=>!P(o.i18nValue)),p=async g=>{const x=await _api.apaas.i18NInfo.getPageList({pageNo:1,pageSize:20,searchKey:g});if(x&&x.data){const C=x.data.find(c=>c.key===o.i18nValue);C&&Object.assign(s,Object.fromEntries(Object.entries(JSON.parse(C.info)).map(([c,_])=>[_.locale,_.info])))}};ee(()=>o.i18nValue,()=>{P(o.i18nValue)||p(o.i18nValue)},{immediate:!0});const d=()=>{n.open({i18nModalKey:o.i18nModalKey,saveCallback:g=>{t("on-select-i18n",{...g})},destroyCallback:()=>{t("closed")}})};return(g,x)=>{const C=b("Icon"),c=b("a-button"),_=b("a-tooltip");return e.simpleBtn?(S(),N(C,{key:0,class:fe(["i18n-icon simple-btn",{"is-highlight":m.value}]),icon:"ion:language",onClick:d},null,8,["class"])):m.value?(S(),N(_,{key:1,color:"#fff",placement:"topRight"},{title:v(()=>[A("div",_e,"语言标识:"+B(e.i18nValue),1),(S(!0),L(H,null,X(a.value,y=>(S(),L("div",{key:y.id,class:"i18n-tooltip-item"},[A("strong",null,B(y.language)+": ",1),A("span",Se,B(s[y.languageTag]),1)]))),128))]),default:v(()=>[f(c,$(e.buttonExtraProps,{class:{"is-highlight":m.value},style:{"--btn-width":e.btnWidth,"--btn-height":e.btnHeight},size:e.size,onClick:d}),{icon:v(()=>[f(C,{class:"i18n-icon",icon:"ion:language"})]),_:1},16,["class","style","size"])]),_:1})):(S(),N(c,$({key:2},e.buttonExtraProps,{class:{"is-highlight":m.value},style:{"--btn-width":e.btnWidth,"--btn-height":e.btnHeight},size:e.size,onClick:d}),{icon:v(()=>[f(C,{class:"i18n-icon",icon:"ion:language"})]),_:1},16,["class","style","size"]))}}}),[["__scopeId","data-v-dc8ffb2c"]])),we=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const Te=Object.prototype.toString,Ee=e=>Te.call(e)==="[object Object]",G=()=>{};function le(e){return Array.isArray(e)?e:[e]}function Re(e,u,a){return ee(e,u,{...a,immediate:!0})}const ve=we?window:void 0;function J(e){var u;const a=F(e);return(u=a?.$el)!==null&&u!==void 0?u:a}function se(...e){const u=(n,o,t,s)=>(n.addEventListener(o,t,s),()=>n.removeEventListener(o,t,s)),a=E(()=>{const n=le(F(e[0])).filter(o=>o!=null);return n.every(o=>typeof o!="string")?n:void 0});return Re(()=>{var n,o;return[(n=(o=a.value)===null||o===void 0?void 0:o.map(t=>J(t)))!==null&&n!==void 0?n:[ve].filter(t=>t!=null),le(F(a.value?e[1]:e[0])),le(h(a.value?e[2]:e[1])),F(a.value?e[3]:e[2])]},([n,o,t,s],m,p)=>{if(!n?.length||!o?.length||!t?.length)return;const d=Ee(s)?{...s}:s,g=n.flatMap(x=>o.flatMap(C=>t.map(c=>u(x,C,c,d))));p(()=>{g.forEach(x=>x())})},{flush:"post"})}function Me(e,u,a={}){const{window:n=ve,ignore:o=[],capture:t=!0,detectIframe:s=!1,controls:m=!1}=a;if(!n)return m?{stop:G,cancel:G,trigger:G}:G;let p=!0;const d=i=>F(o).some(r=>{if(typeof r=="string")return Array.from(n.document.querySelectorAll(r)).some(I=>I===i.target||i.composedPath().includes(I));{const I=J(r);return I&&(i.target===I||i.composedPath().includes(I))}});function g(i){const r=F(i);return r&&r.$.subTree.shapeFlag===16}function x(i,r){const I=F(i),j=I.$.subTree&&I.$.subTree.children;return j==null||!Array.isArray(j)?!1:j.some(W=>W.el===r.target||r.composedPath().includes(W.el))}const C=i=>{const r=J(e);if(i.target!=null&&!(!(r instanceof Element)&&g(e)&&x(e,i))&&!(!r||r===i.target||i.composedPath().includes(r))){if("detail"in i&&i.detail===0&&(p=!d(i)),!p){p=!0;return}u(i)}};let c=!1;const _=[se(n,"click",i=>{c||(c=!0,setTimeout(()=>{c=!1},0),C(i))},{passive:!0,capture:t}),se(n,"pointerdown",i=>{const r=J(e);p=!d(i)&&!!(r&&!i.composedPath().includes(r))},{passive:!0}),s&&se(n,"blur",i=>{setTimeout(()=>{var r;const I=J(e);((r=n.document.activeElement)===null||r===void 0?void 0:r.tagName)==="IFRAME"&&!I?.contains(n.document.activeElement)&&u(i)},0)},{passive:!0})].filter(Boolean),y=()=>_.forEach(i=>i());return m?{stop:y,cancel:()=>{p=!1},trigger:i=>{p=!0,C(i),p=!1}}:y}const $e=K("I18nSelectInput",q(z({__name:"i18n-select-input",props:{attr:{},inputExtraProps:{},i18nConfig:{},i18nText:{},placeholderText:{},size:{},i18nModalKey:{},forceUpdate:{type:Boolean},btnHeight:{},btnWidth:{}},emits:["update:i18nText","update:i18nConfig","on-i18n-select","clickOutside","focus","blur"],setup(e,{emit:u}){const a=E(()=>!!_gct.store.appInfo.id),n=e,o=u,t=E({get(){return n.i18nText??""},set(c){c!==n.i18nText&&o("update:i18nText",c)}}),s=E(()=>P(n.i18nConfig)?{}:typeof n.i18nConfig=="string"?JSON.parse(n.i18nConfig)??{}:n.i18nConfig??{}),m=E(()=>s.value?.[n.attr]),p=c=>{console.log("emit",c),c&&((P(t.value)||n.forceUpdate===!0)&&o("update:i18nText",c.i18nTitle),o("update:i18nConfig",JSON.stringify(P(c)?ne(s.value,n.attr):{...s.value,[n.attr]:c.i18nKey})),o("on-i18n-select",c))},d=T(),g=()=>{o("focus",d.value)},x=()=>{o("blur",d.value)},C=T();return Me(C,()=>{o("clickOutside")}),(c,_)=>{const y=b("a-input"),i=b("a-input-group");return S(),N(i,{id:"i18nInputGroup",ref_key:"i18nInputGroup",ref:C,compact:""},{default:v(()=>[pe(c.$slots,"i18n-input",{},()=>[f(y,$({ref_key:"inputRef",ref:d},e.inputExtraProps,{value:t.value,"onUpdate:value":_[0]||(_[0]=r=>t.value=r),valueModifiers:{trim:!0},style:{height:e.btnHeight?e.btnHeight:e.size===h(ie).SMALL?"26px":"32px",width:a.value?`calc(100% - ${e.btnWidth?e.btnWidth:e.size===h(ie).SMALL?"26px":"32px"}`:"100%"},placeholder:e.placeholderText,size:e.size,"allow-clear":"",onFocus:g,onBlur:x}),null,16,["value","style","placeholder","size"])],!0),a.value?(S(),N(he,{key:0,"btn-height":e.btnHeight,"btn-width":e.btnWidth,"i18n-value":m.value,size:e.size,"i18n-modal-key":e.i18nModalKey,onOnSelectI18n:p,onClosed:_[1]||(_[1]=r=>o("clickOutside"))},null,8,["btn-height","btn-width","i18n-value","size","i18n-modal-key"])):me("",!0)]),_:3},512)}}}),[["__scopeId","data-v-412e1309"]])),je=K("I18nSelectInputForm",z({__name:"i18n-select-input-form",props:{formItemName:{},fromItemExtraProps:{},inputExtraProps:{},i18nConfig:{},text:{},formRef:{}},emits:["update:text"],setup(e,{emit:u}){const a=e,n=u,o=E({get(){return a.text??""},set(t){n("update:text",t),a.formRef?.validateFields([a.formItemName])}});return(t,s)=>{const m=b("a-form-item");return S(),L(H,null,[f(m,$({name:e.formItemName},e.fromItemExtraProps),{default:v(()=>[f($e,$(t.$attrs,{"i18n-text":o.value,"onUpdate:i18nText":s[0]||(s[0]=p=>o.value=p),"input-extra-props":e.inputExtraProps,"i18n-config":e.i18nConfig,attr:Array.isArray(e.formItemName)?e.formItemName.join("."):e.formItemName,"placeholder-text":t.$t("sys.inputText")}),null,16,["i18n-text","input-extra-props","i18n-config","attr","placeholder-text"])]),_:1},16,["name"]),f(m,{name:"i18nConfig",hidden:""},{default:v(()=>[A("span",null,B(e.i18nConfig),1)]),_:1})],64)}}})),Ne={class:"inline-block w100% relative"},Oe=K("I18nSelectTextarea",q(z({__name:"i18n-select-textarea",props:{attr:{},inputExtraProps:{},i18nConfig:{},i18nText:{},placeholderText:{},rows:{},style:{}},emits:["update:i18nText","update:i18nConfig","on-i18n-select","clickOutside","focus"],setup(e,{emit:u}){const a=e,n=u,o=E({get(){return a.i18nText??""},set(g){n("update:i18nText",g)}}),t=E(()=>P(a.i18nConfig)?{}:typeof a.i18nConfig=="string"?JSON.parse(a.i18nConfig)??{}:a.i18nConfig??{}),s=E(()=>t.value?.[a.attr]),m=g=>{g&&(P(o.value)&&n("update:i18nText",g.i18nTitle),n("update:i18nConfig",JSON.stringify(P(g)?ne(t.value,a.attr):{...t.value,[a.attr]:g.i18nKey})),n("on-i18n-select",g))},p=T(),d=()=>{n("focus",p.value)};return(g,x)=>{const C=b("a-textarea");return S(),L("div",Ne,[f(C,$({ref_key:"inputRef",ref:p,value:o.value,"onUpdate:value":x[0]||(x[0]=c=>o.value=c),placeholder:e.placeholderText},e.inputExtraProps,{style:{resize:"none",...e.style},onFocus:d}),null,16,["value","placeholder","style"]),f(he,{"i18n-value":s.value,"simple-btn":!0,type:"text",onOnSelectI18n:m,onClosed:x[1]||(x[1]=c=>n("clickOutside"))},null,8,["i18n-value"])])}}}),[["__scopeId","data-v-cd95c416"]])),Ue=K("I18nSelectTextareaForm",z({__name:"i18n-select-textarea-form",props:{formItemName:{},fromItemExtraProps:{},inputExtraProps:{},i18nConfig:{},text:{},formRef:{}},emits:["update:text"],setup(e,{emit:u}){const a=e,n=u,o=E({get(){return a.text??""},set(t){n("update:text",t),a.formRef?.validateFields([a.formItemName])}});return(t,s)=>{const m=b("a-form-item");return S(),L(H,null,[f(m,$({name:e.formItemName},e.fromItemExtraProps),{default:v(()=>[f(Oe,$(t.$attrs,{"i18n-text":o.value,"onUpdate:i18nText":s[0]||(s[0]=p=>o.value=p),"placeholder-text":t.$t("sys.inputText"),"input-extra-props":e.inputExtraProps,"i18n-config":e.i18nConfig,attr:Array.isArray(e.formItemName)?e.formItemName.join("."):e.formItemName}),null,16,["i18n-text","placeholder-text","input-extra-props","i18n-config","attr"])]),_:1},16,["name"]),f(m,{name:"i18nConfig",hidden:""},{default:v(()=>[A("span",null,B(e.i18nConfig),1)]),_:1})],64)}}})),De=K("default",{install(e){console.log("Design Web install",e)}})})}}));
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { useI18nSelect } from './src/useI18nSelect';
|
|
2
|
+
export { default as I18Modal } from './src/i18n-modal.vue';
|
|
3
|
+
export { default as I18nSelectBtn } from './src/i18n-select-btn.vue';
|
|
4
|
+
export { default as I18nSelectInput } from './src/i18n-select-input.vue';
|
|
5
|
+
export { default as I18nSelectInputForm } from './src/i18n-select-input-form.vue';
|
|
6
|
+
export { default as I18nSelectTextarea } from './src/i18n-select-textarea.vue';
|
|
7
|
+
export { default as I18nSelectTextareaForm } from './src/i18n-select-textarea-form.vue';
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export interface I18nState {
|
|
2
|
+
id: string;
|
|
3
|
+
[key: string]: string;
|
|
4
|
+
}
|
|
5
|
+
type __VLS_Props = {
|
|
6
|
+
lang: {
|
|
7
|
+
title: string;
|
|
8
|
+
dataIndex: string;
|
|
9
|
+
}[];
|
|
10
|
+
getContainer: () => HTMLElement;
|
|
11
|
+
};
|
|
12
|
+
declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
13
|
+
ok: (...args: any[]) => void;
|
|
14
|
+
register: (...args: any[]) => void;
|
|
15
|
+
}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
16
|
+
onOk?: ((...args: any[]) => any) | undefined;
|
|
17
|
+
onRegister?: ((...args: any[]) => any) | undefined;
|
|
18
|
+
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
|
|
19
|
+
formRef: unknown;
|
|
20
|
+
}, any>;
|
|
21
|
+
export default _default;
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
import { defineComponent, ref, reactive, resolveComponent, openBlock, createBlock, mergeProps, unref, withCtx, createVNode, createElementBlock, Fragment, renderList, toRaw } from 'vue';
|
|
2
|
+
import { t } from '@gct-paas/core';
|
|
3
|
+
import { useModalInner } from '@gct-paas/core-web';
|
|
4
|
+
|
|
5
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
6
|
+
__name: "i18n-modal",
|
|
7
|
+
props: {
|
|
8
|
+
lang: {},
|
|
9
|
+
getContainer: { type: Function }
|
|
10
|
+
},
|
|
11
|
+
emits: ["ok", "register"],
|
|
12
|
+
setup(__props, { emit: __emit }) {
|
|
13
|
+
const props = __props;
|
|
14
|
+
const emit = __emit;
|
|
15
|
+
const formRef = ref();
|
|
16
|
+
const i18nState = reactive({
|
|
17
|
+
id: ""
|
|
18
|
+
});
|
|
19
|
+
const isEdit = ref(false);
|
|
20
|
+
const handleShow = (visible) => {
|
|
21
|
+
if (visible) {
|
|
22
|
+
isEdit.value = false;
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
const [registerInner, { closeModal }] = useModalInner((data) => {
|
|
26
|
+
data && onDataReceive(data);
|
|
27
|
+
});
|
|
28
|
+
const onDataReceive = (data) => {
|
|
29
|
+
isEdit.value = true;
|
|
30
|
+
i18nState.id = data.key;
|
|
31
|
+
const { lang } = props;
|
|
32
|
+
console.log(lang, "lang========");
|
|
33
|
+
for (const item of lang) {
|
|
34
|
+
const key = item.dataIndex;
|
|
35
|
+
i18nState[key] = data[key];
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
const validateSpecialCharacters = (_, value, callback) => {
|
|
39
|
+
const reg = /^[a-zA-Z_.]*$/;
|
|
40
|
+
if (!reg.test(value)) {
|
|
41
|
+
callback(t("sys.i18n.validated18nKeyErrorMsg"));
|
|
42
|
+
}
|
|
43
|
+
callback();
|
|
44
|
+
};
|
|
45
|
+
const validateLang = async (_rule, value) => {
|
|
46
|
+
const reg = /^\s*$/g;
|
|
47
|
+
if (reg.test(value)) {
|
|
48
|
+
return Promise.reject(t("sys.notEmptySth", { sth: t("sys.i18n") }));
|
|
49
|
+
} else {
|
|
50
|
+
return Promise.resolve();
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
const handleOk = () => {
|
|
54
|
+
formRef.value?.validate().then(() => {
|
|
55
|
+
emit("ok", { ...toRaw(i18nState) }, isEdit.value);
|
|
56
|
+
closeModal();
|
|
57
|
+
});
|
|
58
|
+
};
|
|
59
|
+
const handleClose = () => {
|
|
60
|
+
formRef.value?.resetFields();
|
|
61
|
+
return void 0;
|
|
62
|
+
};
|
|
63
|
+
return (_ctx, _cache) => {
|
|
64
|
+
const _component_a_input = resolveComponent("a-input");
|
|
65
|
+
const _component_a_form_item = resolveComponent("a-form-item");
|
|
66
|
+
const _component_a_form = resolveComponent("a-form");
|
|
67
|
+
const _component_BasicModal = resolveComponent("BasicModal");
|
|
68
|
+
return openBlock(), createBlock(_component_BasicModal, mergeProps(_ctx.$attrs, {
|
|
69
|
+
title: isEdit.value ? unref(t)("sys.edit") : unref(t)("sys.new"),
|
|
70
|
+
centered: "",
|
|
71
|
+
width: "640px",
|
|
72
|
+
"min-height": 100,
|
|
73
|
+
"mask-closable": false,
|
|
74
|
+
"after-close": handleClose,
|
|
75
|
+
"get-container": __props.getContainer,
|
|
76
|
+
onRegister: unref(registerInner),
|
|
77
|
+
onOk: handleOk,
|
|
78
|
+
onVisibleChange: handleShow
|
|
79
|
+
}), {
|
|
80
|
+
default: withCtx(() => [
|
|
81
|
+
createVNode(_component_a_form, {
|
|
82
|
+
ref_key: "formRef",
|
|
83
|
+
ref: formRef,
|
|
84
|
+
model: i18nState,
|
|
85
|
+
"label-col": { span: 6 },
|
|
86
|
+
"wrapper-col": { span: 16 },
|
|
87
|
+
autocomplete: "off",
|
|
88
|
+
layout: "horizontal"
|
|
89
|
+
}, {
|
|
90
|
+
default: withCtx(() => [
|
|
91
|
+
createVNode(_component_a_form_item, {
|
|
92
|
+
label: unref(t)("sys.i18n.resourceIdentification"),
|
|
93
|
+
name: "id",
|
|
94
|
+
rules: [
|
|
95
|
+
{
|
|
96
|
+
required: true,
|
|
97
|
+
message: unref(t)("sys.pleaseInputSth", {
|
|
98
|
+
sth: unref(t)("sys.i18n.resourceIdentification")
|
|
99
|
+
})
|
|
100
|
+
},
|
|
101
|
+
{ validator: validateSpecialCharacters }
|
|
102
|
+
]
|
|
103
|
+
}, {
|
|
104
|
+
default: withCtx(() => [
|
|
105
|
+
createVNode(_component_a_input, {
|
|
106
|
+
value: i18nState.id,
|
|
107
|
+
"onUpdate:value": _cache[0] || (_cache[0] = ($event) => i18nState.id = $event),
|
|
108
|
+
"show-count": "",
|
|
109
|
+
maxlength: 128,
|
|
110
|
+
disabled: isEdit.value
|
|
111
|
+
}, null, 8, ["value", "disabled"])
|
|
112
|
+
]),
|
|
113
|
+
_: 1
|
|
114
|
+
}, 8, ["label", "rules"]),
|
|
115
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(props.lang, (item) => {
|
|
116
|
+
return openBlock(), createBlock(_component_a_form_item, {
|
|
117
|
+
key: item.dataIndex,
|
|
118
|
+
label: item.title,
|
|
119
|
+
name: item.dataIndex,
|
|
120
|
+
rules: [
|
|
121
|
+
{
|
|
122
|
+
required: true,
|
|
123
|
+
message: unref(t)("sys.pleaseInputSth", { sth: item.title })
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
validator: validateLang
|
|
127
|
+
}
|
|
128
|
+
]
|
|
129
|
+
}, {
|
|
130
|
+
default: withCtx(() => [
|
|
131
|
+
createVNode(_component_a_input, {
|
|
132
|
+
value: i18nState[item.dataIndex],
|
|
133
|
+
"onUpdate:value": ($event) => i18nState[item.dataIndex] = $event,
|
|
134
|
+
"show-count": "",
|
|
135
|
+
maxlength: 300
|
|
136
|
+
}, null, 8, ["value", "onUpdate:value"])
|
|
137
|
+
]),
|
|
138
|
+
_: 2
|
|
139
|
+
}, 1032, ["label", "name", "rules"]);
|
|
140
|
+
}), 128))
|
|
141
|
+
]),
|
|
142
|
+
_: 1
|
|
143
|
+
}, 8, ["model"])
|
|
144
|
+
]),
|
|
145
|
+
_: 1
|
|
146
|
+
}, 16, ["title", "get-container", "onRegister"]);
|
|
147
|
+
};
|
|
148
|
+
}
|
|
149
|
+
});
|
|
150
|
+
|
|
151
|
+
export { _sfc_main as default };
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
.ant-btn[data-v-dc8ffb2c] {
|
|
2
|
+
background-color: #fff !important;
|
|
3
|
+
}
|
|
4
|
+
.ant-btn.ant-btn-icon-only[data-v-dc8ffb2c] {
|
|
5
|
+
width: var(--btn-width, 32px);
|
|
6
|
+
height: var(--btn-height, 32px);
|
|
7
|
+
}
|
|
8
|
+
.ant-btn.ant-btn-icon-only.ant-btn-sm[data-v-dc8ffb2c] {
|
|
9
|
+
width: 26px;
|
|
10
|
+
height: 26px;
|
|
11
|
+
}
|
|
12
|
+
.ant-btn:hover .i18n-icon[data-v-dc8ffb2c] {
|
|
13
|
+
transition: all 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);
|
|
14
|
+
color: var(--ant-primary-color);
|
|
15
|
+
}
|
|
16
|
+
.ant-btn.is-highlight[data-v-dc8ffb2c] {
|
|
17
|
+
color: var(--ant-primary-color);
|
|
18
|
+
border-color: var(--ant-primary-color);
|
|
19
|
+
}
|
|
20
|
+
.ant-btn.is-highlight .i18n-icon[data-v-dc8ffb2c] {
|
|
21
|
+
color: var(--ant-primary-color);
|
|
22
|
+
}
|
|
23
|
+
.i18n-icon[data-v-dc8ffb2c] {
|
|
24
|
+
color: #7f8695;
|
|
25
|
+
display: flex !important;
|
|
26
|
+
}
|
|
27
|
+
.simple-btn[data-v-dc8ffb2c]:hover {
|
|
28
|
+
color: var(--ant-primary-color);
|
|
29
|
+
}
|
|
30
|
+
.simple-btn.is-highlight[data-v-dc8ffb2c] {
|
|
31
|
+
color: var(--ant-primary-color);
|
|
32
|
+
}
|
|
33
|
+
.i18n-tooltip-title[data-v-dc8ffb2c] {
|
|
34
|
+
color: #303133;
|
|
35
|
+
font-size: 16px;
|
|
36
|
+
line-height: 1;
|
|
37
|
+
margin-bottom: 12px;
|
|
38
|
+
}
|
|
39
|
+
.i18n-tooltip-item[data-v-dc8ffb2c] {
|
|
40
|
+
color: #606266;
|
|
41
|
+
font-size: 14px;
|
|
42
|
+
}
|
|
43
|
+
.custom-i18n-btn[data-v-dc8ffb2c] {
|
|
44
|
+
vertical-align: middle;
|
|
45
|
+
background: #fff;
|
|
46
|
+
color: #303133;
|
|
47
|
+
border: none;
|
|
48
|
+
font-size: 14px;
|
|
49
|
+
display: inline-flex;
|
|
50
|
+
justify-content: center;
|
|
51
|
+
align-items: center;
|
|
52
|
+
padding: 0;
|
|
53
|
+
}
|
|
54
|
+
.custom-i18n-btn.reg-i18n[data-v-dc8ffb2c] {
|
|
55
|
+
position: absolute;
|
|
56
|
+
right: -32px;
|
|
57
|
+
bottom: 0;
|
|
58
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
interface Props {
|
|
2
|
+
i18nValue?: string;
|
|
3
|
+
buttonExtraProps?: IObject;
|
|
4
|
+
size?: string;
|
|
5
|
+
i18nModalKey?: string;
|
|
6
|
+
simpleBtn?: boolean;
|
|
7
|
+
btnHeight?: string;
|
|
8
|
+
btnWidth?: string;
|
|
9
|
+
}
|
|
10
|
+
declare const _default: import('vue').DefineComponent<Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
11
|
+
"on-select-i18n": (...args: any[]) => void;
|
|
12
|
+
closed: (...args: any[]) => void;
|
|
13
|
+
}, string, import('vue').PublicProps, Readonly<Props> & Readonly<{
|
|
14
|
+
"onOn-select-i18n"?: ((...args: any[]) => any) | undefined;
|
|
15
|
+
onClosed?: ((...args: any[]) => any) | undefined;
|
|
16
|
+
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
17
|
+
export default _default;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import _sfc_main from './i18n-select-btn.vue2.mjs';
|
|
2
|
+
import './i18n-select-btn.css';/* empty css */
|
|
3
|
+
import _export_sfc from '../../../_virtual/_plugin-vue_export-helper.mjs';
|
|
4
|
+
|
|
5
|
+
const I18nSelectBtn = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-dc8ffb2c"]]);
|
|
6
|
+
|
|
7
|
+
export { I18nSelectBtn as default };
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import { defineComponent, ref, reactive, computed, watch, resolveComponent, openBlock, createBlock, normalizeClass, withCtx, createVNode, mergeProps, createElementVNode, toDisplayString, createElementBlock, Fragment, renderList } from 'vue';
|
|
2
|
+
import { isEmpty } from 'lodash-es';
|
|
3
|
+
import { useI18nSelect } from './useI18nSelect.mjs';
|
|
4
|
+
|
|
5
|
+
const _hoisted_1 = { class: "i18n-tooltip-title" };
|
|
6
|
+
const _hoisted_2 = { style: { "margin-left": "4px" } };
|
|
7
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
8
|
+
__name: "i18n-select-btn",
|
|
9
|
+
props: {
|
|
10
|
+
i18nValue: {},
|
|
11
|
+
buttonExtraProps: {},
|
|
12
|
+
size: {},
|
|
13
|
+
i18nModalKey: {},
|
|
14
|
+
simpleBtn: { type: Boolean },
|
|
15
|
+
btnHeight: {},
|
|
16
|
+
btnWidth: {}
|
|
17
|
+
},
|
|
18
|
+
emits: ["on-select-i18n", "closed"],
|
|
19
|
+
setup(__props, { emit: __emit }) {
|
|
20
|
+
const getEnableLocaleList = ref();
|
|
21
|
+
const i18nInstance = useI18nSelect();
|
|
22
|
+
const props = __props;
|
|
23
|
+
const emit = __emit;
|
|
24
|
+
const i18nMap = reactive({});
|
|
25
|
+
const isHighlight = computed(() => {
|
|
26
|
+
return !isEmpty(props.i18nValue);
|
|
27
|
+
});
|
|
28
|
+
const getTableData = async (keyword) => {
|
|
29
|
+
const result = await _api.apaas.i18NInfo.getPageList({
|
|
30
|
+
pageNo: 1,
|
|
31
|
+
pageSize: 20,
|
|
32
|
+
searchKey: keyword
|
|
33
|
+
});
|
|
34
|
+
if (result && result.data) {
|
|
35
|
+
const row = result.data.find((item) => item.key === props.i18nValue);
|
|
36
|
+
if (row) {
|
|
37
|
+
Object.assign(
|
|
38
|
+
i18nMap,
|
|
39
|
+
Object.fromEntries(
|
|
40
|
+
Object.entries(JSON.parse(row.info)).map(([_, item]) => [
|
|
41
|
+
item.locale,
|
|
42
|
+
item.info
|
|
43
|
+
])
|
|
44
|
+
)
|
|
45
|
+
);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
watch(
|
|
50
|
+
() => props.i18nValue,
|
|
51
|
+
() => {
|
|
52
|
+
if (!isEmpty(props.i18nValue)) {
|
|
53
|
+
getTableData(props.i18nValue);
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
immediate: true
|
|
58
|
+
}
|
|
59
|
+
);
|
|
60
|
+
const handleOpenI18nSelectModal = () => {
|
|
61
|
+
i18nInstance.open({
|
|
62
|
+
i18nModalKey: props.i18nModalKey,
|
|
63
|
+
saveCallback: (params) => {
|
|
64
|
+
emit("on-select-i18n", { ...params });
|
|
65
|
+
},
|
|
66
|
+
destroyCallback: () => {
|
|
67
|
+
emit("closed");
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
};
|
|
71
|
+
return (_ctx, _cache) => {
|
|
72
|
+
const _component_Icon = resolveComponent("Icon");
|
|
73
|
+
const _component_a_button = resolveComponent("a-button");
|
|
74
|
+
const _component_a_tooltip = resolveComponent("a-tooltip");
|
|
75
|
+
return __props.simpleBtn ? (openBlock(), createBlock(_component_Icon, {
|
|
76
|
+
key: 0,
|
|
77
|
+
class: normalizeClass(["i18n-icon simple-btn", { "is-highlight": isHighlight.value }]),
|
|
78
|
+
icon: "ion:language",
|
|
79
|
+
onClick: handleOpenI18nSelectModal
|
|
80
|
+
}, null, 8, ["class"])) : isHighlight.value ? (openBlock(), createBlock(_component_a_tooltip, {
|
|
81
|
+
key: 1,
|
|
82
|
+
color: "#fff",
|
|
83
|
+
placement: "topRight"
|
|
84
|
+
}, {
|
|
85
|
+
title: withCtx(() => [
|
|
86
|
+
createElementVNode("div", _hoisted_1, "语言标识:" + toDisplayString(__props.i18nValue), 1),
|
|
87
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(getEnableLocaleList.value, (item) => {
|
|
88
|
+
return openBlock(), createElementBlock("div", {
|
|
89
|
+
key: item.id,
|
|
90
|
+
class: "i18n-tooltip-item"
|
|
91
|
+
}, [
|
|
92
|
+
createElementVNode("strong", null, toDisplayString(item.language) + ": ", 1),
|
|
93
|
+
createElementVNode("span", _hoisted_2, toDisplayString(i18nMap[item.languageTag]), 1)
|
|
94
|
+
]);
|
|
95
|
+
}), 128))
|
|
96
|
+
]),
|
|
97
|
+
default: withCtx(() => [
|
|
98
|
+
createVNode(_component_a_button, mergeProps(__props.buttonExtraProps, {
|
|
99
|
+
class: { "is-highlight": isHighlight.value },
|
|
100
|
+
style: {
|
|
101
|
+
"--btn-width": __props.btnWidth,
|
|
102
|
+
"--btn-height": __props.btnHeight
|
|
103
|
+
},
|
|
104
|
+
size: __props.size,
|
|
105
|
+
onClick: handleOpenI18nSelectModal
|
|
106
|
+
}), {
|
|
107
|
+
icon: withCtx(() => [
|
|
108
|
+
createVNode(_component_Icon, {
|
|
109
|
+
class: "i18n-icon",
|
|
110
|
+
icon: "ion:language"
|
|
111
|
+
})
|
|
112
|
+
]),
|
|
113
|
+
_: 1
|
|
114
|
+
}, 16, ["class", "style", "size"])
|
|
115
|
+
]),
|
|
116
|
+
_: 1
|
|
117
|
+
})) : (openBlock(), createBlock(_component_a_button, mergeProps({ key: 2 }, __props.buttonExtraProps, {
|
|
118
|
+
class: { "is-highlight": isHighlight.value },
|
|
119
|
+
style: {
|
|
120
|
+
"--btn-width": __props.btnWidth,
|
|
121
|
+
"--btn-height": __props.btnHeight
|
|
122
|
+
},
|
|
123
|
+
size: __props.size,
|
|
124
|
+
onClick: handleOpenI18nSelectModal
|
|
125
|
+
}), {
|
|
126
|
+
icon: withCtx(() => [
|
|
127
|
+
createVNode(_component_Icon, {
|
|
128
|
+
class: "i18n-icon",
|
|
129
|
+
icon: "ion:language"
|
|
130
|
+
})
|
|
131
|
+
]),
|
|
132
|
+
_: 1
|
|
133
|
+
}, 16, ["class", "style", "size"]));
|
|
134
|
+
};
|
|
135
|
+
}
|
|
136
|
+
});
|
|
137
|
+
|
|
138
|
+
export { _sfc_main as default };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export interface Prop {
|
|
2
|
+
i18nModalKey?: string;
|
|
3
|
+
destroyCallback?: () => void;
|
|
4
|
+
saveCallback?: (params: IObject) => void;
|
|
5
|
+
}
|
|
6
|
+
declare const _default: import('vue').DefineComponent<Prop, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<Prop> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
|
|
7
|
+
formRef: unknown;
|
|
8
|
+
tableRef: unknown;
|
|
9
|
+
}, any>;
|
|
10
|
+
export default _default;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import _sfc_main from './i18n-select-container.vue2.mjs';
|
|
2
|
+
import './i18n-select-container.css';/* empty css */
|
|
3
|
+
import _export_sfc from '../../../_virtual/_plugin-vue_export-helper.mjs';
|
|
4
|
+
|
|
5
|
+
const I18nSelectContainer = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-0160ed5e"]]);
|
|
6
|
+
|
|
7
|
+
export { I18nSelectContainer as default };
|