{"id":11876,"date":"2022-01-10T09:08:48","date_gmt":"2022-01-10T00:08:48","guid":{"rendered":"http:\/\/www.gisdeveloper.co.kr\/?p=11876"},"modified":"2024-01-29T11:56:57","modified_gmt":"2024-01-29T02:56:57","slug":"gwc-ui-library-textinput","status":"publish","type":"post","link":"http:\/\/www.gisdeveloper.co.kr\/?p=11876","title":{"rendered":"#GWC UI Library : TextInput"},"content":{"rendered":"<p>\uc6f9 UI \ub77c\uc774\ube0c\ub7ec\ub9ac\uc778 GWC\uc5d0\uc11c \uc81c\uacf5\ud558\ub294 TextInput \ucef4\ud3ec\ub10c\ud2b8\uc5d0 \ub300\ud55c \uc608\uc81c \ucf54\ub4dc\uc785\ub2c8\ub2e4.<\/p>\n<p>\uba3c\uc800 DOM \uad6c\uc131\uc740 \ub2e4\uc74c\uacfc \uac19\uc2b5\ub2c8\ub2e4.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"html\">\r\n<div class=\"center\">\r\n    <gwc-label id=\"label\" content=\"Input \uc774\ubca4\ud2b8 \uc815\ubcf4\" outline-type=\"concave\"><\/gwc-label>\r\n    <div>\r\n        <gwc-textinput id=\"textinput1\" label=\"\ud14d\uc2a4\ud2b8\uc785\ub8251\" hint=\"\uc77c\ubc18 \ubb38\uc790\uc5f4\uc744 \uc785\ub825\ud558\uc138\uc694\"><\/gwc-textinput>\r\n    <\/div>\r\n    <div>\r\n        <gwc-label content=\"\ud14d\uc2a4\ud2b8\uc785\ub8252\"><\/gwc-label>\r\n        <gwc-textinput id=\"textinput2\" value=\"GWC \ud14d\uc2a4\ud2b8 \uc785\ub825 \ucef4\ud3ec\ub10c\ud2b8\"><\/gwc-textinput>\r\n    <\/div>\r\n    <div>\r\n        <gwc-label content=\"\ube44\ud65c\uc131\ud654\"><\/gwc-label>\r\n        <gwc-textinput id=\"textinput3\" value=\"GWC \ud14d\uc2a4\ud2b8 \uc785\ub825 \ucef4\ud3ec\ub10c\ud2b8\" disabled=\"true\"><\/gwc-textinput>\r\n    <\/div>\r\n    <div>\r\n        <gwc-label content=\"\uc554\ud638\uc785\ub825\"><\/gwc-label>\r\n        <gwc-textinput id=\"textinput4\" type=\"password\"><\/gwc-textinput>\r\n    <\/div>            \r\n    <gwc-button id=\"button\" title=\"\uac12 \ud655\uc778\"><\/gwc-button>\r\n<\/div>\r\n<\/pre>\n<p>\uadf8\ub9ac\uace0 CSS \uad6c\uc131\uc740 \ub2e4\uc74c\uacfc \uac19\uad6c\uc694.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"css\">\r\n.center {\r\n    display: flex;\r\n    width: 100%;\r\n    height: 100%;\r\n    justify-content: center;\r\n    align-items: center;\r\n    flex-direction: column;\r\n    gap: 1em;\r\n}\r\n\r\n.center div {\r\n    display: flex;\r\n    align-items: center;\r\n    gap: 0.2em;\r\n}\r\n\r\ngwc-textinput {\r\n    width: 20em;\r\n}\r\n<\/pre>\n<p>js \ucf54\ub4dc\ub294 \ub2e4\uc74c\uacfc \uac19\uc2b5\ub2c8\ub2e4.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"js\">\r\nwindow.onload = () => {\r\n    const onChange = (event) => {\r\n        label.content = `${event.target.id}\uc758 \uac12: ${event.target.value}`;\r\n    };\r\n\r\n    textinput1.addEventListener(\"change\", onChange);\r\n    textinput2.addEventListener(\"change\", onChange);\r\n    textinput3.addEventListener(\"change\", onChange);\r\n    textinput4.addEventListener(\"change\", onChange);\r\n\r\n    button.addEventListener(\"click\", () => {\r\n        const v1 = textinput1.value;\r\n        const v2 = textinput2.value;\r\n        const v3 = textinput3.value;\r\n        const v4 = textinput4.value;\r\n\r\n        gwcMessage(`\r\n            textinput1: ${v1}<br>\r\n            textinput2: ${v2}<br>\r\n            textinput3: ${v3}<br>\r\n            textinput4: ${v4}\r\n        `);\r\n    });\r\n};\r\n<\/pre>\n<p>\uc2e4\ud589 \uacb0\uacfc\ub294 \ub2e4\uc74c\uacfc \uac19\uc2b5\ub2c8\ub2e4.<\/p>\n<p><center><video controls=\"controls\" ><source src=\"http:\/\/www.gisdeveloper.co.kr\/wp-content\/uploads\/2022\/01\/gwc-textinput.mp4\" \/>\ube44\ub514\uc624\ub97c \uc9c0\uc6d0\ud558\uc9c0 \uc54a\ub294 \uc6f9\ube0c\ub77c\uc6b0\uc838\uc785\ub2c8\ub2e4.<\/video><\/center><\/p>\n<p>keyup \uc774\ubca4\ud2b8\uc5d0 \ub300\ud55c \ucf54\ub4dc \uc0ac\uc6a9\uc608\ub294 \ub2e4\uc74c\uacfc \uac19\uc2b5\ub2c8\ub2e4.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"js\">\r\ntextinput.addEventListener(\"keyup\", (event) => {\r\n    if (event.detail.originalEvent.key === \"Enter\") {\r\n        \/\/ ..\r\n    }\r\n});\r\n<\/pre>\n<p>\ucd94\uac00\uc801\uc73c\ub85c focus\uc640 blur \uc774\ubca4\ud2b8\ub3c4 \uc81c\uacf5\ud569\ub2c8\ub2e4.<\/p>\n<p>gwc\uc5d0\uc11c\ub294 \uc0c1\uc704 \uc774\ubca4\ud2b8 \uac1d\uccb4\uc5d0 \uc811\uadfc\ud558\uae30 \uc704\ud574\uc11c\ub294 event.detail.originalEvent\ub97c \uc774\uc6a9\ud569\ub2c8\ub2e4.<\/p>\n<p>\ube44\ud65c\uc131\ud654\ub294 \uc544\ub2cc\ub370, \ud3b8\uc9d1\ub9cc \ub9c9\ub294 readonly \uc18d\uc131\ub3c4 \uc81c\uacf5\ud569\ub2c8\ub2e4. \uc0ac\uc6a9 \uc608\ub294 \ub2e4\uc74c\uacfc \uac19\uc2b5\ub2c8\ub2e4.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"html\">\r\n<gwc-textinput readonly=\"true\"><\/gwc-textinput>\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\uc6f9 UI \ub77c\uc774\ube0c\ub7ec\ub9ac\uc778 GWC\uc5d0\uc11c \uc81c\uacf5\ud558\ub294 TextInput \ucef4\ud3ec\ub10c\ud2b8\uc5d0 \ub300\ud55c \uc608\uc81c \ucf54\ub4dc\uc785\ub2c8\ub2e4. \uba3c\uc800 DOM \uad6c\uc131\uc740 \ub2e4\uc74c\uacfc \uac19\uc2b5\ub2c8\ub2e4. \uadf8\ub9ac\uace0 CSS \uad6c\uc131\uc740 \ub2e4\uc74c\uacfc \uac19\uad6c\uc694. .center { display: flex; width: 100%; height: 100%; justify-content: center; align-items: center; flex-direction: column; gap: 1em; } .center div { display: flex; align-items: center; gap: 0.2em; } gwc-textinput { width: 20em; } js \ucf54\ub4dc\ub294 \ub2e4\uc74c\uacfc &hellip; <\/p>\n<p class=\"link-more\"><a href=\"http:\/\/www.gisdeveloper.co.kr\/?p=11876\" class=\"more-link\">\ub354 \ubcf4\uae30<span class=\"screen-reader-text\"> &#8220;#GWC UI Library : TextInput&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[140,1],"tags":[],"class_list":["post-11876","post","type-post","status-publish","format-standard","hentry","category-gwc","category-uncategorized"],"_links":{"self":[{"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=\/wp\/v2\/posts\/11876","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=11876"}],"version-history":[{"count":7,"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=\/wp\/v2\/posts\/11876\/revisions"}],"predecessor-version":[{"id":14498,"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=\/wp\/v2\/posts\/11876\/revisions\/14498"}],"wp:attachment":[{"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=11876"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=11876"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=11876"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}