gnui 1.2.19 → 1.2.20
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/js/gnui.esm.js +339 -134
- package/dist/js/gnui.js +339 -134
- package/dist/js/gnui.min.js +6 -6
- package/dist/styles/default.css +10600 -20758
- package/dist/styles/gpi.css +10630 -20788
- package/dist/styles/green24.css +11263 -21435
- package/dist/styles/insights.css +10616 -20775
- package/dist/styles/nac.css +10628 -20795
- package/dist/styles/ztnac.css +11263 -21436
- package/package.json +3 -2
- package/styleguide/assets/components.js +58 -3
- package/styleguide/assets/js/gnui.js +339 -134
- package/styleguide/assets/js/gnui.min.js +6 -6
- package/styleguide/assets/styles/default.css +10600 -20758
- package/styleguide/assets/styles/gpi.css +10630 -20788
- package/styleguide/assets/styles/green24.css +11263 -21435
- package/styleguide/assets/styles/insights.css +10616 -20775
- package/styleguide/assets/styles/nac.css +10628 -20795
- package/styleguide/assets/styles/ztnac.css +11263 -21436
- package/styleguide/category/COLOR/index.html +1 -1
- package/styleguide/category/COMPONENT/Alert(js)/index.html +1 -1
- package/styleguide/category/COMPONENT/Bignumber/index.html +1 -1
- package/styleguide/category/COMPONENT/Breadcrumb/index.html +1 -1
- package/styleguide/category/COMPONENT/Calendar(js)/index.html +1 -1
- package/styleguide/category/COMPONENT/Card/index.html +1 -1
- package/styleguide/category/COMPONENT/Chart(js)/index.html +1 -1
- package/styleguide/category/COMPONENT/Datagrid(js)/index.html +1 -1
- package/styleguide/category/COMPONENT/Datalist(js)/index.html +1 -1
- package/styleguide/category/COMPONENT/Growl(js)/index.html +1 -1
- package/styleguide/category/COMPONENT/JsonView(js)/index.html +1 -1
- package/styleguide/category/COMPONENT/Loader(js)/index.html +1 -1
- package/styleguide/category/COMPONENT/MenuButton(js)/index.html +169 -21
- package/styleguide/category/COMPONENT/Message(js)/index.html +1 -1
- package/styleguide/category/COMPONENT/Modal(js)/index.html +1 -1
- package/styleguide/category/COMPONENT/Pagination(js)/index.html +1 -1
- package/styleguide/category/COMPONENT/Panel/index.html +1 -1
- package/styleguide/category/COMPONENT/Progressbar(js)/index.html +1 -1
- package/styleguide/category/COMPONENT/Tab(js)/index.html +1 -1
- package/styleguide/category/COMPONENT/Tagcloud(js)/index.html +1 -1
- package/styleguide/category/COMPONENT/Tooltip(js)/index.html +1 -1
- package/styleguide/category/COMPONENT/Tree(js)/index.html +16 -1
- package/styleguide/category/CONTROLS/Button(js)/index.html +1 -1
- package/styleguide/category/CONTROLS/Checkbox/index.html +1 -1
- package/styleguide/category/CONTROLS/Colorpicker(js)/index.html +1 -1
- package/styleguide/category/CONTROLS/Datepicker(js)/index.html +1 -1
- package/styleguide/category/CONTROLS/Dropdown(js)/index.html +67 -10
- package/styleguide/category/CONTROLS/File/index.html +1 -1
- package/styleguide/category/CONTROLS/Form/Control/index.html +1 -1
- package/styleguide/category/CONTROLS/Form/Field/index.html +2 -2
- package/styleguide/category/CONTROLS/Form/Plain/index.html +2 -2
- package/styleguide/category/CONTROLS/Input/index.html +1 -1
- package/styleguide/category/CONTROLS/MultiText(js)/index.html +1 -1
- package/styleguide/category/CONTROLS/Picklist(js)/index.html +67 -13
- package/styleguide/category/CONTROLS/Radio/index.html +1 -1
- package/styleguide/category/CONTROLS/Select/index.html +1 -1
- package/styleguide/category/CONTROLS/SelectButton(js)/index.html +2 -2
- package/styleguide/category/CONTROLS/Slider/index.html +1 -1
- package/styleguide/category/CONTROLS/SortableList(js)/index.html +2 -2
- package/styleguide/category/CONTROLS/Switch(js)/index.html +1 -1
- package/styleguide/category/CONTROLS/SyntaxInput(js)/index.html +1 -1
- package/styleguide/category/CONTROLS/Textarea/index.html +2 -2
- package/styleguide/category/CONTROLS/Time(js)/index.html +2 -2
- package/styleguide/category/ELEMENTS/Box/index.html +1 -1
- package/styleguide/category/ELEMENTS/Icon/index.html +1 -1
- package/styleguide/category/ELEMENTS/Image/index.html +1 -1
- package/styleguide/category/ELEMENTS/List/index.html +1 -1
- package/styleguide/category/ELEMENTS/Table/index.html +1 -1
- package/styleguide/category/ELEMENTS/Tag/index.html +1 -1
- package/styleguide/category/ELEMENTS/Title/index.html +1 -1
- package/styleguide/category/LAYOUT/Container/index.html +1 -1
- package/styleguide/category/LAYOUT/Grid/index.html +1 -1
- package/styleguide/category/LAYOUT/Splitter(js)/index.html +1 -1
- package/styleguide/category/UTILITY/index.html +1 -1
- package/styleguide/category/Utils/index.html +1 -1
- package/styleguide/color.html +1 -1
- package/styleguide/index.html +1 -1
- package/styleguide/tag/javascript/index.html +4446 -4172
- package/styleguide/tag/v.0.1.0/index.html +5259 -4985
package/dist/js/gnui.esm.js
CHANGED
|
@@ -16870,65 +16870,65 @@ class GNCoreEventManager {
|
|
|
16870
16870
|
return GNCoreEventManager.instance;
|
|
16871
16871
|
}
|
|
16872
16872
|
// life cycle event add
|
|
16873
|
-
stateAdd(
|
|
16874
|
-
return this.add(undefined,
|
|
16873
|
+
stateAdd(cid, name, handler) {
|
|
16874
|
+
return this.add(undefined, cid, name, handler);
|
|
16875
16875
|
}
|
|
16876
|
-
add(target,
|
|
16877
|
-
if (!this._eventMap[
|
|
16878
|
-
this._eventMap[
|
|
16876
|
+
add(target, cid, name, handler) {
|
|
16877
|
+
if (!this._eventMap[cid]) {
|
|
16878
|
+
this._eventMap[cid] = []; // 해당 cid에 대한 이벤트가 없는 경우 초기화
|
|
16879
16879
|
}
|
|
16880
|
-
const eid = this._getEventId(
|
|
16881
|
-
this._eventMap[
|
|
16880
|
+
const eid = this._getEventId(cid); // eventID 생성
|
|
16881
|
+
this._eventMap[cid].push(target
|
|
16882
16882
|
? {
|
|
16883
16883
|
target,
|
|
16884
16884
|
eid,
|
|
16885
|
-
|
|
16885
|
+
cid,
|
|
16886
16886
|
name,
|
|
16887
16887
|
handler
|
|
16888
16888
|
}
|
|
16889
16889
|
: {
|
|
16890
16890
|
eid,
|
|
16891
|
-
|
|
16891
|
+
cid,
|
|
16892
16892
|
name,
|
|
16893
16893
|
handler
|
|
16894
16894
|
});
|
|
16895
16895
|
target && on(target, name, handler); // 이벤트 바인딩
|
|
16896
16896
|
return eid;
|
|
16897
16897
|
}
|
|
16898
|
-
remove(
|
|
16899
|
-
const _events = this._getEvent(
|
|
16898
|
+
remove(cid, name) {
|
|
16899
|
+
const _events = this._getEvent(cid, name);
|
|
16900
16900
|
// 이벤트 해제
|
|
16901
16901
|
if (_events.length) {
|
|
16902
16902
|
_events.forEach((_event) => {
|
|
16903
16903
|
off(_event.target, _event.name, _event.handler);
|
|
16904
16904
|
// eventMap에서 해당 이벤트 삭제
|
|
16905
|
-
this._eventMap[
|
|
16906
|
-
this._eventMap[
|
|
16905
|
+
this._eventMap[cid].some(event => event.eid === _event.eid) &&
|
|
16906
|
+
this._eventMap[cid].splice(this._eventMap[cid].findIndex(event => event.eid === _event.eid), 1);
|
|
16907
16907
|
});
|
|
16908
|
-
//
|
|
16909
|
-
if (!this._eventMap[
|
|
16910
|
-
delete this._eventMap[
|
|
16908
|
+
// cid에 대한 이벤트가 남아있지 않은 경우 cid 키 삭제
|
|
16909
|
+
if (!this._eventMap[cid].length) {
|
|
16910
|
+
delete this._eventMap[cid];
|
|
16911
16911
|
}
|
|
16912
16912
|
}
|
|
16913
16913
|
}
|
|
16914
|
-
removeAll(
|
|
16915
|
-
if (!this._eventMap[
|
|
16914
|
+
removeAll(cid) {
|
|
16915
|
+
if (!this._eventMap[cid]) {
|
|
16916
16916
|
return;
|
|
16917
16917
|
}
|
|
16918
16918
|
// 이벤트 해제
|
|
16919
|
-
this._eventMap[
|
|
16919
|
+
this._eventMap[cid].forEach(event => {
|
|
16920
16920
|
if (event.target) {
|
|
16921
16921
|
off(event.target, event.name, event.handler);
|
|
16922
16922
|
}
|
|
16923
16923
|
});
|
|
16924
16924
|
// 이벤트 삭제
|
|
16925
|
-
delete this._eventMap[
|
|
16925
|
+
delete this._eventMap[cid];
|
|
16926
16926
|
}
|
|
16927
16927
|
/**
|
|
16928
16928
|
* lifeCycle 핸들러 실행
|
|
16929
16929
|
*/
|
|
16930
|
-
cyclepatch(
|
|
16931
|
-
const _events = this._getEvent(
|
|
16930
|
+
cyclepatch(cid, name, params) {
|
|
16931
|
+
const _events = this._getEvent(cid, name);
|
|
16932
16932
|
if (_events.length) {
|
|
16933
16933
|
_events.forEach((_event) => {
|
|
16934
16934
|
const _tagret = _event.target || this;
|
|
@@ -16943,8 +16943,8 @@ class GNCoreEventManager {
|
|
|
16943
16943
|
* - 모든 핸들러를 순차 실행한 뒤, 하나라도 `false` 를 반환한 경우 `true`(cancelled)를 반환한다.
|
|
16944
16944
|
* (첫 false 에서 중단하지 않고, 나머지 핸들러도 계속 실행한다)
|
|
16945
16945
|
*/
|
|
16946
|
-
async dispatch(
|
|
16947
|
-
const _events = this._getEvent(
|
|
16946
|
+
async dispatch(cid, name, params) {
|
|
16947
|
+
const _events = this._getEvent(cid, name);
|
|
16948
16948
|
let cancelled = false;
|
|
16949
16949
|
if (_events.length) {
|
|
16950
16950
|
for (const _event of _events) {
|
|
@@ -16958,17 +16958,17 @@ class GNCoreEventManager {
|
|
|
16958
16958
|
}
|
|
16959
16959
|
return cancelled;
|
|
16960
16960
|
}
|
|
16961
|
-
_getEvent(
|
|
16961
|
+
_getEvent(cid, name) {
|
|
16962
16962
|
// parameters에 해당하는 이벤트 반환
|
|
16963
|
-
return this._eventMap[
|
|
16964
|
-
? this._eventMap[
|
|
16963
|
+
return this._eventMap[cid]
|
|
16964
|
+
? this._eventMap[cid].filter(event => {
|
|
16965
16965
|
return event.name === name;
|
|
16966
16966
|
}) || []
|
|
16967
16967
|
: [];
|
|
16968
16968
|
}
|
|
16969
|
-
_getEventId(
|
|
16969
|
+
_getEventId(cid) {
|
|
16970
16970
|
// event ID 생성
|
|
16971
|
-
return `ev_${
|
|
16971
|
+
return `ev_${cid}${this._eventMap[cid].length}`;
|
|
16972
16972
|
}
|
|
16973
16973
|
}
|
|
16974
16974
|
|
|
@@ -17012,12 +17012,12 @@ class GNUIState {
|
|
|
17012
17012
|
}
|
|
17013
17013
|
// 최초 생성 후 state에 등록 - created
|
|
17014
17014
|
_addComponent(component) {
|
|
17015
|
-
const
|
|
17016
|
-
if (
|
|
17017
|
-
this._componentMap[
|
|
17015
|
+
const cid = component._cid;
|
|
17016
|
+
if (cid) {
|
|
17017
|
+
this._componentMap[cid] = {
|
|
17018
17018
|
component: component,
|
|
17019
17019
|
selector: component.$selector,
|
|
17020
|
-
|
|
17020
|
+
cid: cid,
|
|
17021
17021
|
status: 'created'
|
|
17022
17022
|
};
|
|
17023
17023
|
}
|
|
@@ -17032,13 +17032,28 @@ class GNUIState {
|
|
|
17032
17032
|
if (!_selector) {
|
|
17033
17033
|
return undefined;
|
|
17034
17034
|
}
|
|
17035
|
-
|
|
17036
|
-
|
|
17037
|
-
|
|
17035
|
+
// 1) cid 직접 조회 (string selector 인 경우)
|
|
17036
|
+
if (typeof selector === 'string' && this._componentMap[selector]) {
|
|
17037
|
+
_findComponent = this._componentMap[selector].component;
|
|
17038
|
+
_findComponent._status = this._componentMap[selector].status;
|
|
17039
|
+
return _findComponent;
|
|
17040
|
+
}
|
|
17041
|
+
// 2) data-component-id 기반 조회
|
|
17042
|
+
const dataCid = (_selector === null || _selector === void 0 ? void 0 : _selector.getAttribute) && _selector.getAttribute('data-component-id');
|
|
17043
|
+
if (dataCid && this._componentMap[dataCid]) {
|
|
17044
|
+
_findComponent = this._componentMap[dataCid].component;
|
|
17045
|
+
_findComponent._status = this._componentMap[dataCid].status;
|
|
17046
|
+
return _findComponent;
|
|
17047
|
+
}
|
|
17048
|
+
// 3) selector/element 비교 fallback
|
|
17049
|
+
Object.values(this._componentMap).some(n => {
|
|
17050
|
+
var _a;
|
|
17051
|
+
if (isEquals(n.selector, _selector) || isEquals((_a = n.component) === null || _a === void 0 ? void 0 : _a.$el, _selector)) {
|
|
17038
17052
|
_findComponent = n.component;
|
|
17039
17053
|
_findComponent._status = n.status;
|
|
17040
|
-
return
|
|
17054
|
+
return true;
|
|
17041
17055
|
}
|
|
17056
|
+
return false;
|
|
17042
17057
|
});
|
|
17043
17058
|
return _findComponent;
|
|
17044
17059
|
}
|
|
@@ -17052,7 +17067,7 @@ class GNUIState {
|
|
|
17052
17067
|
// 동일한 selector 인지 비교해서 동일한 component의 selector이면 제거 처리
|
|
17053
17068
|
if (isEquals(n.selector, _selector)) {
|
|
17054
17069
|
// componentMap에서 완전히 제거
|
|
17055
|
-
delete this._componentMap[n.
|
|
17070
|
+
delete this._componentMap[n.cid];
|
|
17056
17071
|
// 컴포넌트 내부 참조도 제거 (메모리 누수 방지)
|
|
17057
17072
|
if (n.component) {
|
|
17058
17073
|
n.component = null;
|
|
@@ -17061,32 +17076,32 @@ class GNUIState {
|
|
|
17061
17076
|
}
|
|
17062
17077
|
});
|
|
17063
17078
|
}
|
|
17064
|
-
// 등록된 컴포넌트 제거 (
|
|
17065
|
-
|
|
17066
|
-
if (!
|
|
17079
|
+
// 등록된 컴포넌트 제거 (cid 기반)
|
|
17080
|
+
_removeComponentByCid(cid) {
|
|
17081
|
+
if (!cid || !this._componentMap[cid]) {
|
|
17067
17082
|
return;
|
|
17068
17083
|
}
|
|
17069
17084
|
// 컴포넌트 내부 참조 제거 (메모리 누수 방지)
|
|
17070
|
-
const componentInfo = this._componentMap[
|
|
17085
|
+
const componentInfo = this._componentMap[cid];
|
|
17071
17086
|
if (componentInfo.component) {
|
|
17072
17087
|
componentInfo.component = null;
|
|
17073
17088
|
}
|
|
17074
17089
|
componentInfo.selector = null;
|
|
17075
17090
|
// componentMap에서 완전히 제거
|
|
17076
|
-
delete this._componentMap[
|
|
17091
|
+
delete this._componentMap[cid];
|
|
17077
17092
|
}
|
|
17078
17093
|
// 컴포넌트 life cycle에 따른 eventManager dispatch
|
|
17079
|
-
_detectedCycle(
|
|
17094
|
+
_detectedCycle(cid, name) {
|
|
17080
17095
|
// component 마지막 status 업데이트
|
|
17081
|
-
if (this._componentMap[
|
|
17082
|
-
this._componentMap[
|
|
17096
|
+
if (this._componentMap[cid]) {
|
|
17097
|
+
this._componentMap[cid].status = name;
|
|
17083
17098
|
}
|
|
17084
|
-
// event manager를 이용해 해당
|
|
17099
|
+
// event manager를 이용해 해당 cid 이벤트 dispatch
|
|
17085
17100
|
const eventManager = GNCoreEventManager.getInstance();
|
|
17086
17101
|
// 호출 후
|
|
17087
|
-
eventManager.cyclepatch(
|
|
17102
|
+
eventManager.cyclepatch(cid, name, '');
|
|
17088
17103
|
// 이벤트 해제 - life cycle 은 컴포넌트 별로 한번씩만 존재하므로..
|
|
17089
|
-
eventManager.remove(
|
|
17104
|
+
eventManager.remove(cid, name);
|
|
17090
17105
|
}
|
|
17091
17106
|
// document DOM observer 실행
|
|
17092
17107
|
// - DOM 변환 이벤트 감지해서 removedNodes 가 생기면 해당 node와 일치하는 component를 찾아 제거한다.
|
|
@@ -17111,18 +17126,18 @@ class GNUIState {
|
|
|
17111
17126
|
if (isElement$2(rm) && attr(rm, 'data-gnui')) {
|
|
17112
17127
|
remove($('#' + attr(rm, 'data-gnui')));
|
|
17113
17128
|
}
|
|
17114
|
-
const childComponents = $$('[data-
|
|
17129
|
+
const childComponents = $$('[data-component-id]', rm);
|
|
17115
17130
|
each(childComponents, (childComponent) => {
|
|
17116
17131
|
if (isElement$2(childComponent)) {
|
|
17117
17132
|
const findComponent = closerThis._getComponent($(childComponent));
|
|
17118
|
-
if (findComponent && findComponent.
|
|
17119
|
-
// $destroy 내부에서 removeAll과
|
|
17133
|
+
if (findComponent && findComponent._cid && findComponent.$el && findComponent.$name !== 'modal') {
|
|
17134
|
+
// $destroy 내부에서 removeAll과 _removeComponentByCid를 처리하므로 직접 호출만
|
|
17120
17135
|
findComponent.$destroy(findComponent, false);
|
|
17121
17136
|
}
|
|
17122
17137
|
}
|
|
17123
17138
|
});
|
|
17124
17139
|
const findComponent = closerThis._getComponent($(rm));
|
|
17125
|
-
if (findComponent && findComponent.
|
|
17140
|
+
if (findComponent && findComponent._cid && !((_a = findComponent.$el) === null || _a === void 0 ? void 0 : _a.parentNode) && findComponent.$name !== 'modal') {
|
|
17126
17141
|
findComponent.$destroy(findComponent, false);
|
|
17127
17142
|
}
|
|
17128
17143
|
});
|
|
@@ -17155,6 +17170,7 @@ class GNCoreInstance {
|
|
|
17155
17170
|
return generateUUID();
|
|
17156
17171
|
};
|
|
17157
17172
|
this._uid = ((_a = this.$options) === null || _a === void 0 ? void 0 : _a.id) || ((_b = this.$selector) === null || _b === void 0 ? void 0 : _b.id) || `${GN_CONSTANT.PREFIX}${uuid()}`;
|
|
17173
|
+
this._cid = `${GN_CONSTANT.PREFIX}${uuid()}`;
|
|
17158
17174
|
}
|
|
17159
17175
|
$reset() { }
|
|
17160
17176
|
$init(component, options) {
|
|
@@ -17165,14 +17181,14 @@ class GNCoreInstance {
|
|
|
17165
17181
|
// component.$options.states => 사용자가 정의한 lifecycle callback handler
|
|
17166
17182
|
this.$stateBind(component);
|
|
17167
17183
|
// stateManager를 통해 beforeMount 상태 dispatch
|
|
17168
|
-
stateManager._detectedCycle(component.
|
|
17184
|
+
stateManager._detectedCycle(component._cid, 'beforeMount');
|
|
17169
17185
|
this.$mount(component, this.$selector);
|
|
17170
17186
|
this.$render(component.$options);
|
|
17171
17187
|
// stateManager를 통해 beforeBind 상태 dispatch
|
|
17172
|
-
stateManager._detectedCycle(component.
|
|
17188
|
+
stateManager._detectedCycle(component._cid, 'beforeBind');
|
|
17173
17189
|
this.$bind(component);
|
|
17174
17190
|
// stateManager를 통해 completed 상태 dispatch
|
|
17175
|
-
stateManager._detectedCycle(component.
|
|
17191
|
+
stateManager._detectedCycle(component._cid, 'completed');
|
|
17176
17192
|
}
|
|
17177
17193
|
$create(component, options) {
|
|
17178
17194
|
// extend options
|
|
@@ -17234,7 +17250,7 @@ class GNCoreInstance {
|
|
|
17234
17250
|
const eventManager = GNCoreEventManager.getInstance();
|
|
17235
17251
|
// lifecycle 관련 이벤트 add to eventManager
|
|
17236
17252
|
GN_CONSTANT.LIFE_CYCLE.forEach((ev) => {
|
|
17237
|
-
eventManager.stateAdd(component.
|
|
17253
|
+
eventManager.stateAdd(component._cid, ev, (...args) => {
|
|
17238
17254
|
// 해당 life cycle 상태에 해당하는 함수가 각 컴포넌트 내부에 정의되어 있으면 호출한다.
|
|
17239
17255
|
if (isFunction(component[ev])) {
|
|
17240
17256
|
component[ev](args);
|
|
@@ -17279,13 +17295,17 @@ class GNCoreInstance {
|
|
|
17279
17295
|
if (tmpRole) {
|
|
17280
17296
|
attr(this.$el, 'role', tmpRole);
|
|
17281
17297
|
}
|
|
17282
|
-
attr(this.$el, 'data-
|
|
17298
|
+
attr(this.$el, 'data-component-id', this._cid);
|
|
17283
17299
|
// inherit selector class
|
|
17284
17300
|
selector.className && addClass(this.$el, selector.className);
|
|
17285
17301
|
}
|
|
17286
17302
|
else {
|
|
17287
17303
|
this.$el = $(this.$selector);
|
|
17288
17304
|
}
|
|
17305
|
+
// 항상 컴포넌트 cid를 DOM에 표시 (기존 DOM 사용 시에도)
|
|
17306
|
+
if (this.$el) {
|
|
17307
|
+
attr(this.$el, 'data-component-id', this._cid);
|
|
17308
|
+
}
|
|
17289
17309
|
// delegates 바인딩
|
|
17290
17310
|
each(this.$options.delegates, (val, key) => {
|
|
17291
17311
|
if (isString(val)) {
|
|
@@ -17305,11 +17325,11 @@ class GNCoreInstance {
|
|
|
17305
17325
|
const eventManager = GNCoreEventManager.getInstance();
|
|
17306
17326
|
each(events, (event, name) => {
|
|
17307
17327
|
if (isFunction(event)) {
|
|
17308
|
-
eventManager.add(this.$el, this.
|
|
17328
|
+
eventManager.add(this.$el, this._cid, event.name || name, event);
|
|
17309
17329
|
}
|
|
17310
17330
|
else if (isPlainObject$1(event)) {
|
|
17311
17331
|
const delegate = isFunction(event.delegate) ? event.delegate() : event.delegate;
|
|
17312
|
-
eventManager.add(delegate, this.
|
|
17332
|
+
eventManager.add(delegate, this._cid, event.name, event.handler);
|
|
17313
17333
|
}
|
|
17314
17334
|
});
|
|
17315
17335
|
}
|
|
@@ -17328,13 +17348,13 @@ class GNCoreInstance {
|
|
|
17328
17348
|
*/
|
|
17329
17349
|
async $event(component, name, ...params) {
|
|
17330
17350
|
const eventManager = GNCoreEventManager.getInstance();
|
|
17331
|
-
return eventManager.dispatch(component.
|
|
17351
|
+
return eventManager.dispatch(component._cid, name, params);
|
|
17332
17352
|
}
|
|
17333
17353
|
$destroy(component = this, removeEl = true) {
|
|
17334
17354
|
var _a;
|
|
17335
17355
|
const stateManager = GNUIState.getInstance();
|
|
17336
17356
|
// state manager 를 통해 destroy 상태 dispatch
|
|
17337
|
-
stateManager._detectedCycle(component.
|
|
17357
|
+
stateManager._detectedCycle(component._cid, 'destroy');
|
|
17338
17358
|
// remove DOM (by removeEl)
|
|
17339
17359
|
if (removeEl) {
|
|
17340
17360
|
style(component.$el, 'display', 'none');
|
|
@@ -17344,11 +17364,11 @@ class GNCoreInstance {
|
|
|
17344
17364
|
component.$options._destroy();
|
|
17345
17365
|
}
|
|
17346
17366
|
// state manager 를 통해 destroy 상태 dispatch
|
|
17347
|
-
stateManager._detectedCycle(component.
|
|
17367
|
+
stateManager._detectedCycle(component._cid, 'destroyed');
|
|
17348
17368
|
// event manager 에서 등록 해제
|
|
17349
|
-
GNCoreEventManager.getInstance().removeAll(component.
|
|
17350
|
-
// state manager에서 component 제거 (
|
|
17351
|
-
stateManager.
|
|
17369
|
+
GNCoreEventManager.getInstance().removeAll(component._cid);
|
|
17370
|
+
// state manager에서 component 제거 (cid 기반)
|
|
17371
|
+
stateManager._removeComponentByCid(component._cid);
|
|
17352
17372
|
// 메모리 누수 방지: component의 모든 hasOwnProperty 제거
|
|
17353
17373
|
// config, events, methods, _hidden 등 동적으로 추가된 속성 포함
|
|
17354
17374
|
Object.keys(component).forEach((key) => {
|
|
@@ -33305,7 +33325,10 @@ class Dropdown extends GNCoreInstance {
|
|
|
33305
33325
|
text: ''
|
|
33306
33326
|
};
|
|
33307
33327
|
}
|
|
33308
|
-
|
|
33328
|
+
// 기존 의미 유지: 클릭된 옵션 기준으로 value/text 전달
|
|
33329
|
+
const value = !isArray$1(option.value) ? String(option.value) : '';
|
|
33330
|
+
const text = option.text || (isArray$1(option === null || option === void 0 ? void 0 : option.cols) ? option.cols : value);
|
|
33331
|
+
this.$event(this, 'onChange', value, text, this.$options.value);
|
|
33309
33332
|
},
|
|
33310
33333
|
toggle: () => {
|
|
33311
33334
|
if (this.$options.disabled) {
|
|
@@ -33401,18 +33424,33 @@ class Dropdown extends GNCoreInstance {
|
|
|
33401
33424
|
const target = e instanceof Event ? $(e.currentTarget) : find(`[data-value=${option.value}]`, this.$el);
|
|
33402
33425
|
e instanceof Event && e.stopPropagation();
|
|
33403
33426
|
// toggle 처리
|
|
33427
|
+
const checkbox = find('input[type=checkbox]', target);
|
|
33404
33428
|
if (hasClass(target, 'is-active')) {
|
|
33405
33429
|
removeClass(target, 'is-active');
|
|
33406
|
-
|
|
33430
|
+
if (checkbox) {
|
|
33431
|
+
checkbox.checked = false;
|
|
33432
|
+
}
|
|
33407
33433
|
}
|
|
33408
33434
|
else {
|
|
33409
33435
|
addClass(target, 'is-active');
|
|
33410
|
-
|
|
33436
|
+
if (checkbox) {
|
|
33437
|
+
checkbox.checked = true;
|
|
33438
|
+
}
|
|
33411
33439
|
}
|
|
33412
33440
|
const selected = findAll('.dropdown-item.is-active', this.$el).map((item) => data(item, 'data-value'));
|
|
33413
|
-
this.$options.value = this.$options.data.filter((opt) =>
|
|
33441
|
+
this.$options.value = this.$options.data.filter((opt) => {
|
|
33442
|
+
// value가 배열이 아닌 경우에만 비교
|
|
33443
|
+
return !isArray$1(opt.value) && selected.includes(opt.value);
|
|
33444
|
+
});
|
|
33414
33445
|
// text 표시
|
|
33415
|
-
|
|
33446
|
+
// Implements [US-Rev-014] cols가 있는 경우 첫 번째 컬럼 값을 표시
|
|
33447
|
+
const selectText = this.$options.value.map((v) => {
|
|
33448
|
+
if (isArray$1(v === null || v === void 0 ? void 0 : v.cols)) {
|
|
33449
|
+
return v.cols[0];
|
|
33450
|
+
}
|
|
33451
|
+
// value가 배열이 아닌 경우에만 사용
|
|
33452
|
+
return v.text || (!isArray$1(v.value) ? String(v.value) : '');
|
|
33453
|
+
}).join(',');
|
|
33416
33454
|
text$1(find('.dropdown-text', this.$el), selectText.length ? escapeEntity(selectText) : this.$options.textSets && this.$options.textSets.selectText ? this.$options.textSets.selectText : '');
|
|
33417
33455
|
this._hidden.change(option);
|
|
33418
33456
|
}
|
|
@@ -33434,9 +33472,21 @@ class Dropdown extends GNCoreInstance {
|
|
|
33434
33472
|
}
|
|
33435
33473
|
// text 표시
|
|
33436
33474
|
const selectText = find('.dropdown-text', this.$el);
|
|
33437
|
-
|
|
33475
|
+
// Implements [US-Rev-014] cols가 있는 경우 첫 번째 컬럼 값을 표시
|
|
33476
|
+
let displayText;
|
|
33477
|
+
if (isArray$1(option === null || option === void 0 ? void 0 : option.cols)) {
|
|
33478
|
+
displayText = option.cols[0];
|
|
33479
|
+
}
|
|
33480
|
+
else {
|
|
33481
|
+
// value가 배열이 아닌 경우에만 사용
|
|
33482
|
+
displayText = option.text || (!isArray$1(option.value) ? String(option.value) : '');
|
|
33483
|
+
}
|
|
33484
|
+
text$1(selectText, escapeEntity(displayText));
|
|
33438
33485
|
// select 선택값 변경
|
|
33439
|
-
|
|
33486
|
+
// value가 배열이 아닌 경우에만 설정
|
|
33487
|
+
if (!isArray$1(option.value)) {
|
|
33488
|
+
targetSelect.value = option.value;
|
|
33489
|
+
}
|
|
33440
33490
|
trigger(targetSelect, 'change');
|
|
33441
33491
|
this.$options.value = option;
|
|
33442
33492
|
this._hidden.change(option);
|
|
@@ -33493,21 +33543,76 @@ class Dropdown extends GNCoreInstance {
|
|
|
33493
33543
|
return;
|
|
33494
33544
|
}
|
|
33495
33545
|
findAll('.dropdown-item', this.$el).forEach((option) => {
|
|
33496
|
-
|
|
33546
|
+
const itemValue = data(option, 'value');
|
|
33547
|
+
// value가 배열이 아닌 항목만 검색 대상으로 처리
|
|
33548
|
+
const rowData = this.$options.flatData.find((item) => {
|
|
33549
|
+
// value가 배열이 아닌 경우에만 비교
|
|
33550
|
+
return !isArray$1(item.value) && String(item.value) === itemValue;
|
|
33551
|
+
});
|
|
33552
|
+
let match = false;
|
|
33553
|
+
// Implements [US-Rev-014] 다중 컬럼 모드: cols 배열의 값들을 검색
|
|
33554
|
+
if (isArray$1(rowData === null || rowData === void 0 ? void 0 : rowData.cols)) {
|
|
33555
|
+
match = rowData.cols.some((colValue) => {
|
|
33556
|
+
return includes(String(colValue).toUpperCase(), q.toUpperCase());
|
|
33557
|
+
});
|
|
33558
|
+
// value 필드도 검색 대상에 포함 (배열이 아닌 경우에만)
|
|
33559
|
+
if (!match && rowData.value && !isArray$1(rowData.value)) {
|
|
33560
|
+
match = includes(String(rowData.value).toUpperCase(), q.toUpperCase());
|
|
33561
|
+
}
|
|
33562
|
+
}
|
|
33563
|
+
else if (rowData) {
|
|
33564
|
+
// 단일 컬럼 모드: text 또는 value 필드 검색
|
|
33565
|
+
const textValue = rowData.text || (!isArray$1(rowData.value) ? String(rowData.value) : '');
|
|
33566
|
+
const valueStr = !isArray$1(rowData.value) ? String(rowData.value) : '';
|
|
33567
|
+
match = includes(valueStr.toUpperCase(), q.toUpperCase()) || includes(textValue.toUpperCase(), q.toUpperCase());
|
|
33568
|
+
}
|
|
33569
|
+
else {
|
|
33570
|
+
// rowData를 찾지 못한 경우 (그룹화된 항목 등), DOM에서 직접 검색
|
|
33571
|
+
const textValue = text$1(find('.dropdown-text', option));
|
|
33572
|
+
match = includes(itemValue.toUpperCase(), q.toUpperCase()) || includes(textValue.toUpperCase(), q.toUpperCase());
|
|
33573
|
+
}
|
|
33574
|
+
if (!match) {
|
|
33497
33575
|
css$1(option, 'display', 'none');
|
|
33498
33576
|
}
|
|
33499
33577
|
});
|
|
33500
33578
|
},
|
|
33501
33579
|
renderLabel: () => {
|
|
33502
|
-
|
|
33503
|
-
|
|
33504
|
-
|
|
33505
|
-
|
|
33506
|
-
|
|
33507
|
-
|
|
33508
|
-
|
|
33509
|
-
|
|
33510
|
-
|
|
33580
|
+
// Implements [US-Rev-014] cols가 있는 경우 첫 번째 컬럼 값을 표시
|
|
33581
|
+
let _labelText = '';
|
|
33582
|
+
if (this.$options.value) {
|
|
33583
|
+
if (isArray$1(this.$options.value)) {
|
|
33584
|
+
_labelText = this.$options.value.map((v) => {
|
|
33585
|
+
if (isArray$1(v === null || v === void 0 ? void 0 : v.cols)) {
|
|
33586
|
+
return v.cols[0];
|
|
33587
|
+
}
|
|
33588
|
+
// value가 배열이 아닌 경우에만 사용
|
|
33589
|
+
return v.text || (!isArray$1(v.value) ? String(v.value) : '');
|
|
33590
|
+
}).join(',');
|
|
33591
|
+
}
|
|
33592
|
+
else {
|
|
33593
|
+
const value = this.$options.value;
|
|
33594
|
+
if (isArray$1(value === null || value === void 0 ? void 0 : value.cols)) {
|
|
33595
|
+
_labelText = value.cols[0];
|
|
33596
|
+
}
|
|
33597
|
+
else {
|
|
33598
|
+
// value가 배열이 아닌 경우에만 사용
|
|
33599
|
+
_labelText = value.text || (!isArray$1(value.value) ? String(value.value) : '');
|
|
33600
|
+
}
|
|
33601
|
+
}
|
|
33602
|
+
}
|
|
33603
|
+
else if (this.$options.textSets && this.$options.textSets.selectText) {
|
|
33604
|
+
_labelText = this.$options.textSets.selectText;
|
|
33605
|
+
}
|
|
33606
|
+
else if (this.$options.flatData.length) {
|
|
33607
|
+
const firstItem = this.$options.flatData[0];
|
|
33608
|
+
if (isArray$1(firstItem === null || firstItem === void 0 ? void 0 : firstItem.cols)) {
|
|
33609
|
+
_labelText = firstItem.cols[0];
|
|
33610
|
+
}
|
|
33611
|
+
else {
|
|
33612
|
+
// value가 배열이 아닌 경우에만 사용
|
|
33613
|
+
_labelText = firstItem.text || (!isArray$1(firstItem.value) ? String(firstItem.value) : '');
|
|
33614
|
+
}
|
|
33615
|
+
}
|
|
33511
33616
|
return createElement$1("span", { className: "dropdown-text" }, escapeEntity(_labelText));
|
|
33512
33617
|
},
|
|
33513
33618
|
renderSub: (data) => {
|
|
@@ -33517,24 +33622,43 @@ class Dropdown extends GNCoreInstance {
|
|
|
33517
33622
|
if (this.$options.type === 'opened' && !items.length) {
|
|
33518
33623
|
return createElement$1("div", { className: 'dropdown-nodata' }, this.$options.textSets.noData);
|
|
33519
33624
|
}
|
|
33520
|
-
|
|
33521
|
-
|
|
33522
|
-
|
|
33523
|
-
|
|
33524
|
-
|
|
33525
|
-
|
|
33526
|
-
|
|
33527
|
-
|
|
33528
|
-
option.
|
|
33529
|
-
|
|
33530
|
-
|
|
33531
|
-
|
|
33532
|
-
|
|
33533
|
-
|
|
33534
|
-
|
|
33535
|
-
|
|
33536
|
-
|
|
33537
|
-
|
|
33625
|
+
const hasCols = items.some((item) => !(item === null || item === void 0 ? void 0 : item.html) && isArray$1(item === null || item === void 0 ? void 0 : item.cols));
|
|
33626
|
+
return (createElement$1("ul", { className: hasCols ? 'is-cols' : '' }, items.map((option, index) => {
|
|
33627
|
+
const hasHtml = !!option.html;
|
|
33628
|
+
const hasColsData = isArray$1(option === null || option === void 0 ? void 0 : option.cols);
|
|
33629
|
+
const renderAsCols = !hasHtml && hasColsData;
|
|
33630
|
+
// html이 있으면 text가 있는 항목만 선택 가능
|
|
33631
|
+
// cols가 있으면 첫 번째 컬럼을 displayText로 사용 (value가 비어도 선택 가능)
|
|
33632
|
+
const displayText = hasHtml
|
|
33633
|
+
? (option.text || '')
|
|
33634
|
+
: renderAsCols
|
|
33635
|
+
? (option.cols && option.cols.length ? String(option.cols[0]) : '')
|
|
33636
|
+
: (option.text || (!isArray$1(option.value) ? String(option.value) : ''));
|
|
33637
|
+
return (createElement$1("li", { key: index, id: this._uid + '_opt_' + index, className: 'dropdown-item' +
|
|
33638
|
+
(renderAsCols ? ' dropdown-row' : '') +
|
|
33639
|
+
(displayText ? '' : ' is-unselectable') +
|
|
33640
|
+
(this.$options.value &&
|
|
33641
|
+
(isArray$1(this.$options.value) ? this.$options.value.find((v) => v.value === option.value) : option.value === this.$options.value.value)
|
|
33642
|
+
? ' is-active'
|
|
33643
|
+
: '') +
|
|
33644
|
+
(this.$options.multiple ? ' has-checkbox' : ''), "on-click": isArray$1(option.value) || !displayText ? null : this._hidden.select.bind(this, option), "data-value": isArray$1(option.value) ? '' : option.value, title: displayText ? escapeEntity(String(displayText)) : '' },
|
|
33645
|
+
createElement$1("span", { className: "dropdown-text", innerHTML: option.html ? option.html : '' },
|
|
33646
|
+
option.html ? ('') : renderAsCols ? (createElement$1("div", { className: "gn-checks dropdown-cols" },
|
|
33647
|
+
this.$options.multiple && (createElement$1("div", { className: "is-small is-no-padding" },
|
|
33648
|
+
createElement$1("input", { type: "checkbox", id: this._uid + '_chk_' + index, defaultChecked: this.$options.value &&
|
|
33649
|
+
(isArray$1(this.$options.value) ? this.$options.value.find((v) => v.value === option.value) : option.value === this.$options.value.value), disabled: this.$options.disabled }),
|
|
33650
|
+
createElement$1("label", { for: this._uid + '_chk_' + index }))),
|
|
33651
|
+
option.cols.map((col, colIndex) => (createElement$1("span", { key: colIndex, className: "dropdown-col" }, escapeEntity(col)))))) : this.$options.multiple ? (createElement$1("div", { className: "gn-checks is-small is-no-padding" },
|
|
33652
|
+
createElement$1("input", { type: "checkbox", id: this._uid + '_chk_' + index, defaultChecked: this.$options.value &&
|
|
33653
|
+
(isArray$1(this.$options.value) ? this.$options.value.find((v) => v.value === option.value) : option.value === this.$options.value.value), disabled: this.$options.disabled }),
|
|
33654
|
+
createElement$1("label", { for: this._uid + '_chk_' + index }, escapeEntity(option.text || (!isArray$1(option.value) ? String(option.value) : ''))))) : option.icon ? (createElement$1("span", null,
|
|
33655
|
+
createElement$1("span", { className: 'gn-icon' + (this.$options.size ? ' is-' + this.$options.size : '') },
|
|
33656
|
+
createElement$1("i", { className: (this.isBrandIcon(option.icon) ? 'fab' : 'fa') + ` fa-${option.icon}` })),
|
|
33657
|
+
escapeEntity(option.text || (!isArray$1(option.value) ? String(option.value) : '')))) : (escapeEntity(option.text || (!isArray$1(option.value) ? String(option.value) : ''))),
|
|
33658
|
+
isArray$1(option.value) && (createElement$1("span", { className: "gn-icon is-small submenu-icon" },
|
|
33659
|
+
createElement$1("i", { className: "fas fa-angle-right" })))),
|
|
33660
|
+
isArray$1(option.value) && this._hidden.renderSub(option.value)));
|
|
33661
|
+
})));
|
|
33538
33662
|
},
|
|
33539
33663
|
flatData: () => {
|
|
33540
33664
|
// data 검색 편의성을 위해 depth를 없앤 flatdata 생성
|
|
@@ -33572,11 +33696,17 @@ class Dropdown extends GNCoreInstance {
|
|
|
33572
33696
|
: [String(this.$options.value)]; // 기타: 숫자 등
|
|
33573
33697
|
this.$options.value = this.$options.flatData.filter((opt) => {
|
|
33574
33698
|
const optValue = typeof opt.value === 'string' ? opt.value : String(opt.value);
|
|
33575
|
-
|
|
33699
|
+
// Implements [US-Rev-014] cols가 있으면 text 없어도 선택 가능
|
|
33700
|
+
return values.includes(optValue) && (opt.text || isArray$1(opt === null || opt === void 0 ? void 0 : opt.cols) || (!isArray$1(opt.value)));
|
|
33576
33701
|
});
|
|
33577
33702
|
}
|
|
33578
33703
|
else {
|
|
33579
|
-
|
|
33704
|
+
// Implements [US-Rev-014] cols가 있으면 text 없어도 선택 가능
|
|
33705
|
+
this.$options.value = this.$options.flatData.find((opt) => {
|
|
33706
|
+
const optValue = !isArray$1(opt.value) ? String(opt.value) : '';
|
|
33707
|
+
const compareValue = String(this.$options.value);
|
|
33708
|
+
return optValue === compareValue && (opt.text || isArray$1(opt === null || opt === void 0 ? void 0 : opt.cols) || optValue);
|
|
33709
|
+
});
|
|
33580
33710
|
}
|
|
33581
33711
|
}
|
|
33582
33712
|
},
|
|
@@ -37150,9 +37280,11 @@ class DataGrid extends GNCoreInstance {
|
|
|
37150
37280
|
isCheck = true;
|
|
37151
37281
|
}
|
|
37152
37282
|
return (createElement$1("div", { "on-click": (e) => {
|
|
37153
|
-
|
|
37283
|
+
var _a;
|
|
37284
|
+
((_a = this === null || this === void 0 ? void 0 : this.$options) === null || _a === void 0 ? void 0 : _a.onSelect) && !this.$options.disabled && this._hidden.selectRow.call(this, row, _index, e);
|
|
37154
37285
|
}, "on-dblclick": (e) => {
|
|
37155
|
-
|
|
37286
|
+
var _a;
|
|
37287
|
+
((_a = this === null || this === void 0 ? void 0 : this.$options) === null || _a === void 0 ? void 0 : _a.onDoubleClick) && !this.$options.disabled && this._hidden.doubleSelect.call(this, row, _index, e);
|
|
37156
37288
|
}, className: 'gn-datagrid-body-row' + (hasChild ? ' has-child' : '') + (row.isOpened ? '' : ' is-collapsed') + (depth > 0 && !isOpened ? ' is-hidden' : '') + (row.color ? ` ${row.color}` : ''), style: {
|
|
37157
37289
|
'grid-template-columns': this._columnsTemplate.join(' ')
|
|
37158
37290
|
}, id: this._uid + '-row-' + _index, "data-depth": depth }, columns.map((col, idx) => {
|
|
@@ -37203,11 +37335,11 @@ class DataGrid extends GNCoreInstance {
|
|
|
37203
37335
|
(col.bodyClass ? col.bodyClass : col.className ? col.className : '') +
|
|
37204
37336
|
(isFunction(col.onSelect) ? ' is-selectable' : '') +
|
|
37205
37337
|
(col.isHidden ? ' is-unvisible' : ''), "data-key": col.key, style: cellStyle, "on-click": (e) => {
|
|
37206
|
-
!this.$options.disabled && this._hidden.selectCell.call(this, col, row, _index, e);
|
|
37338
|
+
col.onSelect && !this.$options.disabled && this._hidden.selectCell.call(this, col, row, _index, e);
|
|
37207
37339
|
}, "on-mouseenter": (e) => {
|
|
37208
|
-
!this.$options.disabled && this._hidden.hoverCell.call(this, col, row, _index, e);
|
|
37340
|
+
col.onHover && !this.$options.disabled && this._hidden.hoverCell.call(this, col, row, _index, e);
|
|
37209
37341
|
}, "on-mouseleave": (e) => {
|
|
37210
|
-
this._hidden.blurCell.call(this, col, row, _index, e);
|
|
37342
|
+
col.offHover && this._hidden.blurCell.call(this, col, row, _index, e);
|
|
37211
37343
|
}, title: col.tipField && row[col.tipField] ? row[col.tipField] : !col.template && row[col.key] ? row[col.key] : '' }, this._hidden.renderCell(row, col, idx, hasChild, isCheck, _index)));
|
|
37212
37344
|
})));
|
|
37213
37345
|
},
|
|
@@ -37893,7 +38025,7 @@ class DataList extends GNCoreInstance {
|
|
|
37893
38025
|
color: (this.$options.readonly ? 'info' : 'cancel')
|
|
37894
38026
|
};
|
|
37895
38027
|
return (createElement$1("div", { "on-dblclick": (e) => {
|
|
37896
|
-
this._hidden.doubleSelect.call(this, row, _index, e);
|
|
38028
|
+
this.$options.onDoubleClick && this._hidden.doubleSelect.call(this, row, _index, e);
|
|
37897
38029
|
}, id: this._uid + '-row-' + _index, className: 'gn-datalist-body-row' + (hasChild ? ' has-child' : '') + (row.isOpened ? '' : ' is-collapsed') + (row.isSelectedRow ? ' is-active' : '') + (depth > 0 && !isOpened ? ' is-hidden' : ''), "data-depth": depth, style: { cursor: this.$options.onSelect ? 'pointer' : 'default' } },
|
|
37898
38030
|
createElement$1("ol", { className: 'gn-datalist-ol-container' }, columns.map((col, idx) => {
|
|
37899
38031
|
const cellStyle = {};
|
|
@@ -37922,9 +38054,9 @@ class DataList extends GNCoreInstance {
|
|
|
37922
38054
|
(col.bodyClass ? col.bodyClass : col.className ? col.className : '') +
|
|
37923
38055
|
(isFunction(col.onSelect) ? ' is-selectable' : '') +
|
|
37924
38056
|
(col.isHidden ? ' is-unvisible' : ''), style: cellStyle, "on-mouseenter": (e) => {
|
|
37925
|
-
this._hidden.hoverCell.call(this, col, row, _index, e);
|
|
38057
|
+
col.onHover && this._hidden.hoverCell.call(this, col, row, _index, e);
|
|
37926
38058
|
}, "on-mouseleave": (e) => {
|
|
37927
|
-
this._hidden.blurCell.call(this, col, row, _index, e);
|
|
38059
|
+
col.offHover && this._hidden.blurCell.call(this, col, row, _index, e);
|
|
37928
38060
|
}, title: !col.template && row[col.key] ? row[col.key] : '' }, this._hidden.renderCell(row, col, idx, hasChild)))));
|
|
37929
38061
|
})),
|
|
37930
38062
|
createElement$1("div", { id: this._uid + '-btn-' + index, className: "gn-datalist-btn-container" },
|
|
@@ -39199,6 +39331,7 @@ class Message extends GNCoreInstance {
|
|
|
39199
39331
|
|
|
39200
39332
|
class MenuButton extends GNCoreInstance {
|
|
39201
39333
|
constructor(name, selector, options = {}) {
|
|
39334
|
+
var _a, _b, _c, _d;
|
|
39202
39335
|
super(name, selector, options);
|
|
39203
39336
|
this._hidden = {
|
|
39204
39337
|
open: () => {
|
|
@@ -39210,7 +39343,9 @@ class MenuButton extends GNCoreInstance {
|
|
|
39210
39343
|
removeClass(this.$el, 'is-open');
|
|
39211
39344
|
},
|
|
39212
39345
|
select: (menu, e) => {
|
|
39213
|
-
|
|
39346
|
+
// cols만 있고 text가 없는 경우 cols[0]을 text로 사용 (호환성 유지)
|
|
39347
|
+
const menuText = menu.text || (isArray$1(menu === null || menu === void 0 ? void 0 : menu.cols) ? menu.cols[0] : menu.value || '');
|
|
39348
|
+
this.$event(this, 'onSelect', menu.value, menuText, menu, e);
|
|
39214
39349
|
this._hidden.close();
|
|
39215
39350
|
},
|
|
39216
39351
|
changeText: (buttonText) => {
|
|
@@ -39245,12 +39380,16 @@ class MenuButton extends GNCoreInstance {
|
|
|
39245
39380
|
// 부모 경로를 포함한 고유한 ID 생성
|
|
39246
39381
|
const currentPath = parentPath ? `${parentPath}-${index}` : `${index}`;
|
|
39247
39382
|
const uniqueId = `${this._uid}-${currentPath}`;
|
|
39383
|
+
const hasColsData = isArray$1(menu === null || menu === void 0 ? void 0 : menu.cols);
|
|
39384
|
+
const renderAsCols = !hasHtml && hasColsData;
|
|
39385
|
+
const canSelect = !hasHtml || !!menu.text;
|
|
39248
39386
|
return (createElement$1("li", { id: uniqueId, className: 'menuButton-menu' +
|
|
39249
39387
|
(this.$options.align ? ' has-text-' + this.$options.align : '') +
|
|
39250
39388
|
(canRenderChild ? ' has-submenu' : '') +
|
|
39251
39389
|
(depth > 0 ? ' is-submenu-item' : '') +
|
|
39252
39390
|
(isDisabled ? ' is-disabled' : '') +
|
|
39253
|
-
(isActived ? ' is-actived' : '')
|
|
39391
|
+
(isActived ? ' is-actived' : '') +
|
|
39392
|
+
(renderAsCols ? ' has-cols' : ''), "on-click": (e) => {
|
|
39254
39393
|
// disabled 상태이거나 자식 메뉴가 있는 경우 클릭 이벤트 처리하지 않음
|
|
39255
39394
|
if (isDisabled) {
|
|
39256
39395
|
e.stopPropagation();
|
|
@@ -39259,12 +39398,16 @@ class MenuButton extends GNCoreInstance {
|
|
|
39259
39398
|
}
|
|
39260
39399
|
// 자식 메뉴가 없는 경우에만 select 이벤트 발생
|
|
39261
39400
|
if (!canRenderChild) {
|
|
39401
|
+
if (!canSelect) {
|
|
39402
|
+
e.stopPropagation();
|
|
39403
|
+
return;
|
|
39404
|
+
}
|
|
39262
39405
|
e.stopPropagation();
|
|
39263
39406
|
this._hidden.select.call(this, menu, e);
|
|
39264
39407
|
}
|
|
39265
39408
|
}, innerHTML: hasHtml ? menu.html : '' },
|
|
39266
|
-
hasHtml ? ('') : (createElement$1("span", { className: "menuButton-menu-content" },
|
|
39267
|
-
createElement$1("span", { className: "menuButton-menu-text" }, menu.text),
|
|
39409
|
+
hasHtml ? ('') : renderAsCols ? (createElement$1("div", { className: "menubutton-cols" }, menu.cols.map((col, colIndex) => (createElement$1("span", { key: colIndex, className: "menubutton-col" }, escapeEntity(col)))))) : (createElement$1("span", { className: "menuButton-menu-content" },
|
|
39410
|
+
createElement$1("span", { className: "menuButton-menu-text" }, menu.text || menu.value || ''),
|
|
39268
39411
|
canRenderChild && (createElement$1("span", { className: "menuButton-menu-arrow" },
|
|
39269
39412
|
createElement$1("i", { className: "fas fa-caret-right" }))))),
|
|
39270
39413
|
canRenderChild && this._hidden.renderMenus.call(this, menu.child, depth + 1, currentPath)));
|
|
@@ -39276,9 +39419,11 @@ class MenuButton extends GNCoreInstance {
|
|
|
39276
39419
|
};
|
|
39277
39420
|
this.config = {
|
|
39278
39421
|
textSets: {
|
|
39279
|
-
buttonText: this.$selector.
|
|
39422
|
+
buttonText: ((_a = this.$selector) === null || _a === void 0 ? void 0 : _a.cols)
|
|
39423
|
+
? (isArray$1(this.$selector.cols) ? this.$selector.cols.join(', ') : String(this.$selector.cols))
|
|
39424
|
+
: (((_b = this.$selector) === null || _b === void 0 ? void 0 : _b.textContent) || ((_c = this.$selector) === null || _c === void 0 ? void 0 : _c.text) || '')
|
|
39280
39425
|
},
|
|
39281
|
-
name: this.$selector.name,
|
|
39426
|
+
name: (_d = this.$selector) === null || _d === void 0 ? void 0 : _d.name,
|
|
39282
39427
|
data: [],
|
|
39283
39428
|
align: 'left'
|
|
39284
39429
|
};
|
|
@@ -39556,9 +39701,27 @@ class Picklist extends GNCoreInstance {
|
|
|
39556
39701
|
return;
|
|
39557
39702
|
}
|
|
39558
39703
|
findAll(`.picklist-${obj} .dropdown-item`, this.$el).forEach((option) => {
|
|
39559
|
-
|
|
39704
|
+
const itemValue = data(option, 'value');
|
|
39705
|
+
const rowData = this.$options.data[obj].find((item) => item.value === itemValue);
|
|
39706
|
+
let match = false;
|
|
39707
|
+
// Implements [US-Rev-023] 다중 컬럼 모드: cols 배열의 값들을 검색
|
|
39708
|
+
if (isArray$1(rowData === null || rowData === void 0 ? void 0 : rowData.cols)) {
|
|
39709
|
+
match = rowData.cols.some((colValue) => {
|
|
39710
|
+
return includes(String(colValue).toUpperCase(), q.toUpperCase());
|
|
39711
|
+
});
|
|
39712
|
+
// value 필드도 검색 대상에 포함
|
|
39713
|
+
if (!match && rowData.value) {
|
|
39714
|
+
match = includes(String(rowData.value).toUpperCase(), q.toUpperCase());
|
|
39715
|
+
}
|
|
39716
|
+
}
|
|
39717
|
+
else {
|
|
39718
|
+
// 단일 컬럼 모드: text 또는 value 필드 검색
|
|
39719
|
+
const textValue = text$1(find('.dropdown-text', option));
|
|
39720
|
+
match = includes(data(option, 'value').toUpperCase(), q.toUpperCase()) || includes(textValue.toUpperCase(), q.toUpperCase());
|
|
39721
|
+
}
|
|
39722
|
+
if (!match) {
|
|
39560
39723
|
css$1(option, 'display', 'none');
|
|
39561
|
-
this.$options.data[`filtered-${obj}`] = this.$options.data[`filtered-${obj}`].filter((e) => e.value !==
|
|
39724
|
+
this.$options.data[`filtered-${obj}`] = this.$options.data[`filtered-${obj}`].filter((e) => e.value !== itemValue);
|
|
39562
39725
|
}
|
|
39563
39726
|
});
|
|
39564
39727
|
},
|
|
@@ -39667,9 +39830,20 @@ class Picklist extends GNCoreInstance {
|
|
|
39667
39830
|
isArray$1(addArr) &&
|
|
39668
39831
|
addArr.forEach((option) => {
|
|
39669
39832
|
const _index = source.findIndex((select) => {
|
|
39670
|
-
|
|
39833
|
+
const valueMatch = option.value === select.value;
|
|
39834
|
+
if (isArray$1(option === null || option === void 0 ? void 0 : option.cols)) {
|
|
39835
|
+
if (!isArray$1(select === null || select === void 0 ? void 0 : select.cols) || select.cols.length !== option.cols.length) {
|
|
39836
|
+
return false;
|
|
39837
|
+
}
|
|
39838
|
+
const colsMatch = option.cols.every((col, idx) => col === select.cols[idx]);
|
|
39839
|
+
return valueMatch && colsMatch;
|
|
39840
|
+
}
|
|
39841
|
+
return valueMatch && option.text === select.text;
|
|
39671
39842
|
});
|
|
39672
|
-
|
|
39843
|
+
// 매칭 실패 시 (_index === -1) 마지막 항목이 제거되는 것을 방지
|
|
39844
|
+
if (_index >= 0) {
|
|
39845
|
+
target.push(source.splice(_index, 1).pop());
|
|
39846
|
+
}
|
|
39673
39847
|
});
|
|
39674
39848
|
},
|
|
39675
39849
|
reRender: (obj) => {
|
|
@@ -39679,21 +39853,32 @@ class Picklist extends GNCoreInstance {
|
|
|
39679
39853
|
},
|
|
39680
39854
|
renderSub: (item) => {
|
|
39681
39855
|
const items = this.$options.data[item] || [];
|
|
39682
|
-
|
|
39856
|
+
const hasColsForList = items.some((item) => !(item === null || item === void 0 ? void 0 : item.html) && isArray$1(item === null || item === void 0 ? void 0 : item.cols));
|
|
39857
|
+
return (createElement$1("ul", { className: hasColsForList ? 'is-cols' : '' }, items.map((option, index) => {
|
|
39683
39858
|
var _a;
|
|
39684
|
-
|
|
39859
|
+
const hasHtml = !!option.html;
|
|
39860
|
+
const hasColsData = isArray$1(option === null || option === void 0 ? void 0 : option.cols);
|
|
39861
|
+
const renderAsCols = !hasHtml && hasColsData;
|
|
39862
|
+
// html이 있으면 text가 있는 항목만 선택 가능
|
|
39863
|
+
// cols가 있으면 첫 번째 컬럼을 displayText로 사용 (value가 비어도 선택 가능)
|
|
39864
|
+
const displayText = hasHtml
|
|
39865
|
+
? (option.text || '')
|
|
39866
|
+
: renderAsCols
|
|
39867
|
+
? (option.cols && option.cols.length ? String(option.cols[0]) : '')
|
|
39868
|
+
: (option.text || option.value);
|
|
39869
|
+
return (createElement$1("li", { key: index, id: this._uid + '_opt_' + index, className: 'dropdown-item' + (renderAsCols ? ' picklist-row' : '') + (option.selected ? ' is-active' : ''), "data-value": option.value, "on-click": !displayText ? null : this._hidden.toggle.bind(this), "on-dblclick": !displayText
|
|
39685
39870
|
? null
|
|
39686
39871
|
: this._hidden.move.bind(this, item === 'source' ? 'add' : 'remove', [
|
|
39687
39872
|
{
|
|
39688
39873
|
value: option.value,
|
|
39689
|
-
text: option.text,
|
|
39874
|
+
text: renderAsCols ? undefined : option.text,
|
|
39875
|
+
cols: hasColsData ? option.cols : undefined,
|
|
39690
39876
|
html: (_a = option.html) !== null && _a !== void 0 ? _a : null
|
|
39691
39877
|
}
|
|
39692
|
-
]) },
|
|
39693
|
-
createElement$1("span", { className:
|
|
39694
|
-
createElement$1("
|
|
39695
|
-
|
|
39696
|
-
escapeEntity(option.text))) : (escapeEntity(option.text)))));
|
|
39878
|
+
]) }, hasHtml ? (createElement$1("span", { className: "dropdown-text", innerHTML: option.html })) : renderAsCols ? (createElement$1("div", { className: "picklist-cols" }, option.cols.map((col, colIndex) => (createElement$1("span", { key: colIndex, className: "picklist-col" }, escapeEntity(col)))))) : (createElement$1("span", { className: "dropdown-text" }, option.icon ? (createElement$1("span", null,
|
|
39879
|
+
createElement$1("span", { className: 'gn-icon' + (this.$options.size ? ' is-' + this.$options.size : '') },
|
|
39880
|
+
createElement$1("i", { className: (this.isBrandIcon(option.icon) ? 'fab' : 'fa') + ` fa-${option.icon}` })),
|
|
39881
|
+
escapeEntity(option.text || option.value))) : (escapeEntity(option.text || option.value))))));
|
|
39697
39882
|
})));
|
|
39698
39883
|
},
|
|
39699
39884
|
getSelection: (target) => {
|
|
@@ -40830,19 +41015,32 @@ class Tree extends GNCoreInstance {
|
|
|
40830
41015
|
findAll('.is-checker', parents(target, 'li')[0]).forEach((c) => {
|
|
40831
41016
|
c.checked = target.checked;
|
|
40832
41017
|
});
|
|
40833
|
-
if (this.$options.checkPath
|
|
41018
|
+
if (this.$options.checkPath) {
|
|
40834
41019
|
parents(target, 'ul')
|
|
40835
41020
|
.map((list) => siblings(list, '.tree-item').pop())
|
|
40836
41021
|
.filter((item) => item)
|
|
40837
41022
|
.forEach((item) => {
|
|
40838
|
-
find('.is-checker', item)
|
|
41023
|
+
const parentChecker = find('.is-checker', item);
|
|
41024
|
+
if (!parentChecker) {
|
|
41025
|
+
return;
|
|
41026
|
+
}
|
|
41027
|
+
const parentLi = parents(item, 'li')[0];
|
|
41028
|
+
if (!parentLi) {
|
|
41029
|
+
return;
|
|
41030
|
+
}
|
|
41031
|
+
// 자식 중 하나라도 체크면 부모 체크, 전부 해제되면 부모도 해제
|
|
41032
|
+
const descendantCheckers = findAll('.is-checker', parentLi).filter((checker) => checker !== parentChecker);
|
|
41033
|
+
if (!descendantCheckers.length) {
|
|
41034
|
+
return;
|
|
41035
|
+
}
|
|
41036
|
+
parentChecker.checked = descendantCheckers.some((checker) => checker.checked);
|
|
40839
41037
|
});
|
|
40840
41038
|
}
|
|
40841
41039
|
this.$event(this, 'onCheck', item, target.checked, this._hidden.getItemIndex(target), e);
|
|
40842
41040
|
},
|
|
40843
|
-
checkAll: () => {
|
|
41041
|
+
checkAll: (isChecked) => {
|
|
40844
41042
|
findAll('.is-checker', this.$el).forEach((c) => {
|
|
40845
|
-
c.checked =
|
|
41043
|
+
c.checked = isChecked;
|
|
40846
41044
|
});
|
|
40847
41045
|
},
|
|
40848
41046
|
getChecked: (withStatus = false) => {
|
|
@@ -41020,7 +41218,14 @@ class Tree extends GNCoreInstance {
|
|
|
41020
41218
|
this._hidden.collapseAll();
|
|
41021
41219
|
},
|
|
41022
41220
|
checkAll() {
|
|
41023
|
-
this.
|
|
41221
|
+
if (!this.$options.hasCheck)
|
|
41222
|
+
return;
|
|
41223
|
+
this._hidden.checkAll(true);
|
|
41224
|
+
},
|
|
41225
|
+
uncheckAll() {
|
|
41226
|
+
if (!this.$options.hasCheck)
|
|
41227
|
+
return;
|
|
41228
|
+
this._hidden.checkAll(false);
|
|
41024
41229
|
},
|
|
41025
41230
|
getChecked(withStatus = false) {
|
|
41026
41231
|
return this._hidden.getChecked(withStatus);
|