@dooboostore/simple-web-component 1.0.31 → 1.0.33

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.
Files changed (100) hide show
  1. package/README.md +280 -43
  2. package/dist/cjs/decorators/applyStyle.js +1 -1
  3. package/dist/cjs/decorators/applyStyle.js.map +2 -2
  4. package/dist/cjs/decorators/attribute.js +17 -1
  5. package/dist/cjs/decorators/attribute.js.map +2 -2
  6. package/dist/cjs/decorators/elementDefine.js +27 -10
  7. package/dist/cjs/decorators/elementDefine.js.map +3 -3
  8. package/dist/cjs/decorators/index.js +3 -1
  9. package/dist/cjs/decorators/index.js.map +2 -2
  10. package/dist/cjs/decorators/publishSwcAppMessage.js +86 -0
  11. package/dist/cjs/decorators/publishSwcAppMessage.js.map +7 -0
  12. package/dist/cjs/decorators/subscribeSwcAppMessageWhileConnected.js +62 -0
  13. package/dist/cjs/decorators/subscribeSwcAppMessageWhileConnected.js.map +7 -0
  14. package/dist/cjs/decorators/{subscribeSwcAppRouteChange.js → subscribeSwcAppRouteChangeWhileConnected.js} +16 -16
  15. package/dist/cjs/decorators/subscribeSwcAppRouteChangeWhileConnected.js.map +7 -0
  16. package/dist/cjs/elements/SwcAppMixin.js +32 -3
  17. package/dist/cjs/elements/SwcAppMixin.js.map +2 -2
  18. package/dist/cjs/elements/SwcAsync.js +69 -57
  19. package/dist/cjs/elements/SwcAsync.js.map +2 -2
  20. package/dist/cjs/elements/SwcChoose.js +66 -60
  21. package/dist/cjs/elements/SwcChoose.js.map +2 -2
  22. package/dist/cjs/elements/SwcIf.js +51 -66
  23. package/dist/cjs/elements/SwcIf.js.map +2 -2
  24. package/dist/cjs/elements/SwcLoop.js +58 -78
  25. package/dist/cjs/elements/SwcLoop.js.map +2 -2
  26. package/dist/cjs/elements/register.js +310 -335
  27. package/dist/cjs/elements/register.js.map +2 -2
  28. package/dist/cjs/types.js.map +1 -1
  29. package/dist/cjs/utils/Utils.js +7 -13
  30. package/dist/cjs/utils/Utils.js.map +2 -2
  31. package/dist/esm/decorators/applyStyle.js +1 -1
  32. package/dist/esm/decorators/applyStyle.js.map +2 -2
  33. package/dist/esm/decorators/attribute.js +18 -2
  34. package/dist/esm/decorators/attribute.js.map +2 -2
  35. package/dist/esm/decorators/elementDefine.js +25 -8
  36. package/dist/esm/decorators/elementDefine.js.map +3 -3
  37. package/dist/esm/decorators/index.js +3 -1
  38. package/dist/esm/decorators/index.js.map +2 -2
  39. package/dist/esm/decorators/publishSwcAppMessage.js +67 -0
  40. package/dist/esm/decorators/publishSwcAppMessage.js.map +7 -0
  41. package/dist/esm/decorators/subscribeSwcAppMessageWhileConnected.js +43 -0
  42. package/dist/esm/decorators/subscribeSwcAppMessageWhileConnected.js.map +7 -0
  43. package/dist/esm/decorators/{subscribeSwcAppRouteChange.js → subscribeSwcAppRouteChangeWhileConnected.js} +13 -13
  44. package/dist/esm/decorators/subscribeSwcAppRouteChangeWhileConnected.js.map +7 -0
  45. package/dist/esm/elements/SwcAppMixin.js +32 -3
  46. package/dist/esm/elements/SwcAppMixin.js.map +2 -2
  47. package/dist/esm/elements/SwcAsync.js +70 -58
  48. package/dist/esm/elements/SwcAsync.js.map +2 -2
  49. package/dist/esm/elements/SwcChoose.js +67 -61
  50. package/dist/esm/elements/SwcChoose.js.map +2 -2
  51. package/dist/esm/elements/SwcIf.js +52 -67
  52. package/dist/esm/elements/SwcIf.js.map +2 -2
  53. package/dist/esm/elements/SwcLoop.js +59 -79
  54. package/dist/esm/elements/SwcLoop.js.map +2 -2
  55. package/dist/esm/elements/register.js +239 -264
  56. package/dist/esm/elements/register.js.map +2 -2
  57. package/dist/esm/types.js.map +1 -1
  58. package/dist/esm/utils/Utils.js +7 -13
  59. package/dist/esm/utils/Utils.js.map +2 -2
  60. package/dist/esm-bundle/dooboostore-simple-web-component.esm.js +2804 -2498
  61. package/dist/esm-bundle/dooboostore-simple-web-component.esm.js.map +4 -4
  62. package/dist/types/decorators/attribute.d.ts.map +1 -1
  63. package/dist/types/decorators/elementDefine.d.ts +1 -0
  64. package/dist/types/decorators/elementDefine.d.ts.map +1 -1
  65. package/dist/types/decorators/index.d.ts +3 -1
  66. package/dist/types/decorators/index.d.ts.map +1 -1
  67. package/dist/types/decorators/publishSwcAppMessage.d.ts +13 -0
  68. package/dist/types/decorators/publishSwcAppMessage.d.ts.map +1 -0
  69. package/dist/types/decorators/subscribeSwcAppMessageWhileConnected.d.ts +16 -0
  70. package/dist/types/decorators/subscribeSwcAppMessageWhileConnected.d.ts.map +1 -0
  71. package/dist/types/decorators/subscribeSwcAppRouteChangeWhileConnected.d.ts +18 -0
  72. package/dist/types/decorators/subscribeSwcAppRouteChangeWhileConnected.d.ts.map +1 -0
  73. package/dist/types/elements/SwcAppMixin.d.ts +3 -0
  74. package/dist/types/elements/SwcAppMixin.d.ts.map +1 -1
  75. package/dist/types/elements/register.d.ts.map +1 -1
  76. package/dist/types/types.d.ts +14 -1
  77. package/dist/types/types.d.ts.map +1 -1
  78. package/dist/types/utils/Utils.d.ts.map +1 -1
  79. package/dist/umd-bundle/dooboostore-simple-web-component.umd.js +2804 -2498
  80. package/dist/umd-bundle/dooboostore-simple-web-component.umd.js.map +4 -4
  81. package/package.json +4 -4
  82. package/src/decorators/applyStyle.ts +1 -1
  83. package/src/decorators/attribute.ts +35 -30
  84. package/src/decorators/elementDefine.ts +28 -8
  85. package/src/decorators/index.ts +3 -1
  86. package/src/decorators/publishSwcAppMessage.ts +100 -0
  87. package/src/decorators/subscribeSwcAppMessageWhileConnected.ts +73 -0
  88. package/src/decorators/{subscribeSwcAppRouteChange.ts → subscribeSwcAppRouteChangeWhileConnected.ts} +19 -19
  89. package/src/elements/SwcAppMixin.ts +43 -4
  90. package/src/elements/SwcAsync.ts +75 -69
  91. package/src/elements/SwcChoose.ts +67 -80
  92. package/src/elements/SwcIf.ts +51 -76
  93. package/src/elements/SwcLoop.ts +56 -87
  94. package/src/elements/register.ts +235 -307
  95. package/src/types.ts +14 -1
  96. package/src/utils/Utils.ts +11 -17
  97. package/dist/cjs/decorators/subscribeSwcAppRouteChange.js.map +0 -7
  98. package/dist/esm/decorators/subscribeSwcAppRouteChange.js.map +0 -7
  99. package/dist/types/decorators/subscribeSwcAppRouteChange.d.ts +0 -18
  100. package/dist/types/decorators/subscribeSwcAppRouteChange.d.ts.map +0 -1
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/elements/SwcChoose.ts"],
4
- "sourcesContent": ["import { changedAttributeHost } from '../decorators/changedAttributeHost';\nimport { SwcUtils } from '../utils/Utils';\nimport { FunctionUtils } from '@dooboostore/core';\nimport { SwcChooseInterface } from '../types';\n\nclass SwcChoose extends HTMLTemplateElement implements SwcChooseInterface {\n private _nodes: Node[] = [];\n private _value: any = null;\n private _previousTemplate: HTMLTemplateElement | null = null;\n\n get value(): any {\n return this._value;\n }\n set value(nv: any) {\n this._value = nv;\n this.render();\n }\n\n private _executeCloneCallback(attr: string, args: any) {\n const script = this.getAttribute(attr);\n if (!script) return;\n FunctionUtils.execute({ script, context: this, args });\n }\n\n @changedAttributeHost('value')\n refresh(valueAttr?: string | null) {\n valueAttr ??= this.getAttribute('value');\n if (valueAttr === null) {\n this.value = null;\n return;\n }\n\n // {{ }} 브레이스로 감싸진 값은 스크립트 실행\n if (valueAttr.startsWith('{{') && valueAttr.endsWith('}}')) {\n const script = valueAttr.slice(2, -2).trim();\n const win = this.ownerDocument?.defaultView || window;\n const helperAndHostSet = SwcUtils.getHelperAndHostSet(win, SwcUtils.findNearestSwcHost(this));\n // console.log('vvvvvvvvvvvvvvvvvv323', helperAndHostSet);\n const result = FunctionUtils.executeReturn({ script, context: this, args: helperAndHostSet });\n this.value = result;\n // console.log('----------vv', this.value);\n } else {\n // 일반 문자열 값\n this.value = valueAttr;\n }\n }\n\n private render() {\n // console.log('-------------', this.value);\n const win = this.ownerDocument?.defaultView || window;\n const helperSet = SwcUtils.getHelperAndHostSet(win, this);\n const templates = Array.from(this.content.querySelectorAll('template'));\n let selected: HTMLTemplateElement | null = null;\n\n for (const t of templates) {\n if (t.getAttribute('is') === 'swc-when') {\n let matches = false;\n const value = t.getAttribute('value') || '';\n\n // {{ }} 브레이스로 감싸진 값은 스크립트 실행\n if (value.startsWith('{{') && value.endsWith('}}')) {\n const script = value.slice(2, -2).trim();\n const result = FunctionUtils.executeReturn({\n script,\n context: t,\n args: { ...helperSet, $value: this._value }\n });\n // console.log('rrrrrrrrrrrrrr', result);\n matches = result === true;\n } else {\n // 일반 문자열 비교 (기존 방식)\n matches = String(value) === String(this._value);\n }\n\n if (matches) {\n selected = t;\n break;\n }\n }\n }\n\n const target = selected || (this.content.querySelector('template[is=\"swc-otherwise\"]') as HTMLTemplateElement);\n\n // skip-if-same attribute가 있고 이전과 같은 template이면 렌더링 스킵\n // 최상위 skip-if-same 또는 각 when/otherwise의 skip-if-same 체크\n const targetHasSkipIfSame = target?.hasAttribute('skip-if-same');\n const shouldSkip = (this.hasAttribute('skip-if-same') || targetHasSkipIfSame) && this._previousTemplate === target;\n if (shouldSkip) {\n return;\n }\n\n this.cleanup();\n this._previousTemplate = target;\n\n if (target) {\n const clone = target.content.cloneNode(true) as DocumentFragment;\n this._nodes = Array.from(clone.childNodes);\n const elements = this._nodes.filter(n => n.nodeType === 1) as HTMLElement[];\n const groupArgs = { ...helperSet, $value: this._value, $nodes: this._nodes, $elements: elements, $firstElement: elements[0] };\n\n // 복제된 최상위 요소들은 SwcChoose의 직접 자식이 될 것이므로 __swc_host 설정 안 함\n this._nodes.forEach((n, nodeIdx) => {\n // if (n instanceof HTMLElement) (n as any).__swc_host = this; // 제거: 부모 체인 유지\n this._executeCloneCallback('on-clone-node', { ...groupArgs, $node: n, $nodeIndex: nodeIdx, $isElement: n.nodeType === 1 });\n\n // Attribute {{ }} 치환 - HTML string 차원에서 동적 치환\n if (n instanceof HTMLElement) {\n Array.from(n.attributes).forEach(attr => {\n const value = attr.value || '';\n if (value.startsWith('{{') && value.endsWith('}}')) {\n const script = value.slice(2, -2).trim();\n const result = FunctionUtils.executeReturn({\n script,\n context: n,\n args: { ...groupArgs, $value: this._value }\n });\n n.setAttribute(attr.name, String(result));\n }\n });\n }\n });\n\n this._executeCloneCallback('on-clone-nodes', groupArgs);\n\n this.parentElement?.insertBefore(clone, this.nextSibling);\n // if (portal === this.parentElement) {\n // portal.insertBefore(clone, this.nextSibling);\n // } else {\n // portal.appendChild(clone);\n // }\n }\n }\n\n private cleanup() {\n this._nodes.forEach(n => n.parentElement?.removeChild(n));\n this._nodes = [];\n }\n\n connectedCallback() {\n this.refresh();\n }\n disconnectedCallback() {\n this.cleanup();\n }\n}\n"],
5
- "mappings": "AAAA,kCAAqC;AACrC,mBAAyB;AACzB,kBAA8B;;;;;;;;;;AAG9B,MAAM,kBAAkB,oBAAmB;EAA3C,cAAA;;AACU,SAAA,SAAiB,CAAA;AACjB,SAAA,SAAc;AACd,SAAA,oBAAgD;EAwI1D;EAtIE,IAAI,QAAK;AACP,WAAO,KAAK;EACd;EACA,IAAI,MAAM,IAAO;AACf,SAAK,SAAS;AACd,SAAK,OAAM;EACb;EAEQ,sBAAsB,MAAc,MAAS;AACnD,UAAM,SAAS,KAAK,aAAa,IAAI;AACrC,QAAI,CAAC;AAAQ;AACb,8BAAc,QAAQ,EAAE,QAAQ,SAAS,MAAM,KAAI,CAAE;EACvD;EAGA,QAAQ,WAAyB;AAC/B,kBAAA,YAAc,KAAK,aAAa,OAAO;AACvC,QAAI,cAAc,MAAM;AACtB,WAAK,QAAQ;AACb;IACF;AAGA,QAAI,UAAU,WAAW,IAAI,KAAK,UAAU,SAAS,IAAI,GAAG;AAC1D,YAAM,SAAS,UAAU,MAAM,GAAG,EAAE,EAAE,KAAI;AAC1C,YAAM,MAAM,KAAK,eAAe,eAAe;AAC/C,YAAM,mBAAmB,sBAAS,oBAAoB,KAAK,sBAAS,mBAAmB,IAAI,CAAC;AAE5F,YAAM,SAAS,0BAAc,cAAc,EAAE,QAAQ,SAAS,MA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eAAe,SAAS,CAAC,EAAC;AAG3H,WAAK,OAAO,QAAQ,CAAC,GAAG,YAAW;AAEjC,aAAK,sBAAsB,iBAAiB,EAAE,GAAG,WAAW,OAAO,GAAG,YAAY,SAAS,YAAY,EAAE,aAAa,EAAC,CAAE;AAGzH,YAAI,aAAa,aAAa;AAC5B,gBAAM,KAAK,EAAE,UAAU,EAAE,QAAQ,UAAO;AACtC,kBAAM,QAAQ,KAAK,SAAS;AAC5B,gBAAI,MAAM,WAAW,IAAI,KAAK,MAAM,SAAS,IAAI,GAAG;AAClD,oBAAM,SAAS,MAAM,MAAM,GAAG,EAAE,EAAE,KAAI;AACtC,oBAAM,SAAS,0BAAc,cAAc;gBACzC;gBACA,SAAS;gBACT,MAAM,EAAE,GAAG,WAAW,QAAQ,KAAK,OAAM;eAC1C;AACD,gBAAE,aAAa,KAAK,MAAM,OAAO,MAAM,CAAC;YAC1C;UACF,CAAC;QACH;MACF,CAAC;AAED,WAAK,sBAAsB,kBAAkB,SAAS;AAEtD,WAAK,eAAe,aAAa,OAAO,KAAK,WAAW;IAM1D;EACF;EAEQ,UAAO;AACb,SAAK,OAAO,QAAQ,OAAK,EAAE,eAAe,YAAY,CAAC,CAAC;AACxD,SAAK,SAAS,CAAA;EAChB;EAEA,oBAAiB;AACf,SAAK,QAAO;EACd;EACA,uBAAoB;AAClB,SAAK,QAAO;EACd;;AAtHA,WAAA;MADC,kDAAqB,OAAO;;;;;",
4
+ "sourcesContent": ["import { changedAttributeHost } from '../decorators/changedAttributeHost';\nimport { SwcUtils } from '../utils/Utils';\nimport { FunctionUtils, ActionExpression } from '@dooboostore/core';\nimport { ConvertUtils } from '@dooboostore/core-web';\nimport { SwcChooseInterface } from '../types';\nimport { attributeHost } from '../decorators';\n\nclass SwcChoose extends HTMLTemplateElement implements SwcChooseInterface {\n @attributeHost('value')\n _value: any;\n\n @attributeHost('replace-wrap')\n _replaceWrap: string | null;\n\n private _nodes: Node[] = [];\n private _previousTemplate: HTMLTemplateElement | null = null;\n\n get value(): any {\n return this._value;\n }\n\n set value(nv: any) {\n this.refresh(nv);\n }\n\n @changedAttributeHost('value')\n private setValue() {\n this.refresh();\n }\n\n @changedAttributeHost('replace-wrap')\n private setReplaceWrap(replaceWrapAttr?: string | null) {\n this.refresh();\n }\n\n private replaceExpressions(html: string, groupArgs: any, context: any, wrap?: string | null): string {\n const config = wrap ? { wrapExpression: wrap } : undefined;\n const ae = new ActionExpression(html, config);\n const filterOptions = wrap ? { type: 'replace' as const, wrap } : 'replace';\n const win = this.ownerDocument?.defaultView || window;\n\n // @ts-ignore\n for (const expr of ae.getExpressions(filterOptions)) {\n try {\n const value = FunctionUtils.executeReturn({\n script: ConvertUtils.decodeHtmlEntity(expr.script, win.document),\n context,\n args: groupArgs\n });\n ae.replace(expr, String(value));\n } catch (e) {\n console.error(`[SWC] Failed to execute ${expr.original}:`, e);\n }\n }\n return ae.getUnprocessedTemplate();\n }\n\n refresh(value = this._value) {\n const portal = this.parentElement;\n if (!portal) return;\n\n const win = this.ownerDocument?.defaultView || window;\n const helperSet = SwcUtils.getHelperAndHostSet(win, this);\n const groupArgs = { ...helperSet, $value: value };\n\n const templates = Array.from(this.content.querySelectorAll('template'));\n let selected: HTMLTemplateElement | null = null;\n\n for (const t of templates) {\n if (t.getAttribute('is') === 'swc-when') {\n const attrVal = t.getAttribute('value') || '';\n let matches = false;\n\n // Use ActionExpression to parse and extract script from value attribute\n const ae = new ActionExpression(attrVal);\n const expr = ae.getFirstExpression('replace');\n\n if (expr) {\n const decodedScript = ConvertUtils.decodeHtmlEntity(expr.script, win.document);\n const result = FunctionUtils.executeReturn({\n script: decodedScript,\n context: t,\n args: groupArgs\n });\n matches = !!result;\n } else {\n matches = String(attrVal) === String(value);\n }\n\n if (matches) {\n selected = t;\n break;\n }\n }\n }\n\n const target = selected || (this.content.querySelector('template[is=\"swc-otherwise\"]') as HTMLTemplateElement);\n\n const skipValue = target?.getAttribute?.('skip-if-same');\n const skipValue2 = this._previousTemplate?.getAttribute?.('skip-if-same');\n const hasSkipIfSame = target?.hasAttribute?.('skip-if-same');\n const isSame = this._previousTemplate === target;\n // console.log('---rrrr---', this._previousTemplate, target, hasSkipIfSame, isSame, skipValue, skipValue2);\n if (hasSkipIfSame && isSame) {\n return;\n }\n\n this.cleanup();\n this._previousTemplate = target;\n\n if (target) {\n let htmlString = target.innerHTML;\n htmlString = this.replaceExpressions(htmlString, groupArgs, this, this._replaceWrap);\n\n const result = this.ownerDocument?.createElement('template') || document.createElement('template');\n result.innerHTML = htmlString;\n const processedFragment = result.content;\n\n this._nodes = Array.from(processedFragment.childNodes);\n portal.insertBefore(processedFragment, this.nextSibling);\n }\n }\n\n private cleanup() {\n this._nodes.forEach(n => n.parentElement?.removeChild(n));\n this._nodes = [];\n }\n\n disconnectedCallback() {\n this.cleanup();\n }\n}\n"],
5
+ "mappings": "AAAA,kCAAqC;AACrC,mBAAyB;AACzB,kBAAgD;AAChD,sBAA6B;AAE7B,wBAA8B;;;;;;;;;;AAE9B,MAAM,kBAAkB,oBAAmB;EAA3C,cAAA;;AAOU,SAAA,SAAiB,CAAA;AACjB,SAAA,oBAAgD;EAoH1D;EAlHE,IAAI,QAAK;AACP,WAAO,KAAK;EACd;EAEA,IAAI,MAAM,IAAO;AACf,SAAK,QAAQ,EAAE;EACjB;EAGQ,WAAQ;AACd,SAAK,QAAO;EACd;EAGQ,eAAe,iBAA+B;AACpD,SAAK,QAAO;EACd;EAEQ,mBAAmB,MAAc,WAAgB,SAAc,MAAoB;AACzF,UAAM,SAAS,OAAO,EAAE,gBAAgB,KAAI,IAAK;AACjD,UAAM,KAAK,IAAI,6BAAiB,MAAM,MAAM;AAC5C,UAAM,gBAAgB,OAAO,EAAE,MAAM,WAAoB,KAAI,IAAK;AAClE,UAAM,MAAM,KAAK,eAAe,eAAe;AAG/C,eAAW,QAAQ,GAAG,eAAe,aAAa,GAAG;AACnD,UAAI;AACF,cAAM,QAAQ,0BAAc,cAAc;UACxC,QAAQ,6BAA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AAiB,QAAQ;AAC3B;IACF;AAEA,SAAK,QAAO;AACZ,SAAK,oBAAoB;AAEzB,QAAI,QAAQ;AACV,UAAI,aAAa,OAAO;AACxB,mBAAa,KAAK,mBAAmB,YAAY,WAAW,MAAM,KAAK,YAAY;AAEnF,YAAM,SAAS,KAAK,eAAe,cAAc,UAAU,KAAK,SAAS,cAAc,UAAU;AACjG,aAAO,YAAY;AACnB,YAAM,oBAAoB,OAAO;AAEjC,WAAK,SAAS,MAAM,KAAK,kBAAkB,UAAU;AACrD,aAAO,aAAa,mBAAmB,KAAK,WAAW;IACzD;EACF;EAEQ,UAAO;AACb,SAAK,OAAO,QAAQ,OAAK,EAAE,eAAe,YAAY,CAAC,CAAC;AACxD,SAAK,SAAS,CAAA;EAChB;EAEA,uBAAoB;AAClB,SAAK,QAAO;EACd;;AAzHA,WAAA;MADC,iCAAc,OAAO;;;AAItB,WAAA;MADC,iCAAc,cAAc;;;AAerB,WAAA;MADP,kDAAqB,OAAO;;;;;AAMrB,WAAA;MADP,kDAAqB,cAAc;;;;;",
6
6
  "names": []
7
7
  }
@@ -1,6 +1,8 @@
1
1
  var import_changedAttributeHost = require("../decorators/changedAttributeHost");
2
2
  var import_Utils = require("../utils/Utils");
3
3
  var import_core = require("@dooboostore/core");
4
+ var import_core_web = require("@dooboostore/core-web");
5
+ var import_decorators = require("../decorators");
4
6
  var __decorate = function(decorators, target, key, desc) {
5
7
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
6
8
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
@@ -13,98 +15,81 @@ var __metadata = function(k, v) {
13
15
  class SwcIf extends HTMLTemplateElement {
14
16
  constructor() {
15
17
  super(...arguments);
16
- this._value = false;
17
18
  this._nodes = [];
18
19
  }
19
20
  get value() {
20
21
  return this._value;
21
22
  }
22
23
  set value(nv) {
23
- this._value = Boolean(nv);
24
- this.render();
24
+ this.refresh(nv);
25
25
  }
26
- _executeCloneCallback(attr, args) {
27
- const script = this.getAttribute(attr);
28
- if (!script)
29
- return;
30
- import_core.FunctionUtils.execute({ script, context: this, args });
31
- }
32
- refreshValue(valueAttr) {
33
- valueAttr ?? (valueAttr = this.getAttribute("value"));
34
- if (valueAttr === null) {
35
- this.value = false;
36
- return;
37
- }
38
- if (valueAttr.startsWith("{{") && valueAttr.endsWith("}}")) {
39
- const script = valueAttr.slice(2, -2).trim();
40
- const win = this.ownerDocument?.defaultView || window;
41
- const result = import_core.FunctionUtils.executeReturn({
42
- script,
43
- context: this,
44
- args: import_Utils.SwcUtils.getHelperAndHostSet(win, this)
45
- });
46
- this.value = result;
47
- } else {
48
- this.value = Boolean(valueAttr);
26
+ replaceExpressions(html, groupArgs, context, wrap) {
27
+ const config = wrap ? { wrapExpression: wrap } : void 0;
28
+ const ae = new import_core.ActionExpression(html, config);
29
+ const filterOptions = wrap ? { type: "replace", wrap } : "replace";
30
+ const win = this.ownerDocument?.defaultView || window;
31
+ for (const expr of ae.getExpressions(filterOptions)) {
32
+ try {
33
+ const value = import_core.FunctionUtils.executeReturn({
34
+ script: import_core_web.ConvertUtils.decodeHtmlEntity(expr.script, win.document),
35
+ context,
36
+ args: groupArgs
37
+ });
38
+ ae.replace(expr, String(value));
39
+ } catch (e) {
40
+ console.error(`[SWC] Failed to execute ${expr.original}:`, e);
41
+ }
49
42
  }
43
+ return ae.getUnprocessedTemplate();
44
+ }
45
+ setValue(valueAttr) {
46
+ this.refresh();
50
47
  }
51
- render() {
48
+ setReplaceWrap(replaceWrapAttr) {
49
+ this.refresh();
50
+ }
51
+ refresh(value = this._value) {
52
52
  this.cleanup();
53
53
  const portal = this.parentElement;
54
- if (!portal)
54
+ if (!portal || !value)
55
55
  return;
56
56
  const win = this.ownerDocument?.defaultView || window;
57
57
  const helperSet = import_Utils.SwcUtils.getHelperAndHostSet(win, this);
58
- let targetTpl = null;
59
- if (this._value) {
60
- targetTpl = this;
61
- } else {
62
- targetTpl = this.content.querySelector('template[is="swc-default"]');
63
- }
64
- if (targetTpl) {
65
- const clone = targetTpl.content.cloneNode(true);
66
- if (targetTpl === this) {
67
- clone.querySelectorAll('template[is^="swc-"]').forEach((t) => t.remove());
68
- }
69
- this._nodes = Array.from(clone.childNodes);
70
- const elements = this._nodes.filter((n) => n.nodeType === 1);
71
- const groupArgs = { ...helperSet, $value: this._value, $nodes: this._nodes, $elements: elements, $firstElement: elements[0] };
72
- this._nodes.forEach((node, nodeIdx) => {
73
- this._executeCloneCallback("on-clone-node", { ...groupArgs, $node: node, $nodeIndex: nodeIdx, $isElement: node.nodeType === 1 });
74
- if (node instanceof HTMLElement) {
75
- Array.from(node.attributes).forEach((attr) => {
76
- const value = attr.value || "";
77
- if (value.startsWith("{{") && value.endsWith("}}")) {
78
- const script = value.slice(2, -2).trim();
79
- const result = import_core.FunctionUtils.executeReturn({
80
- script,
81
- context: node,
82
- args: { ...groupArgs, $value: this._value }
83
- });
84
- node.setAttribute(attr.name, String(result));
85
- }
86
- });
87
- }
88
- });
89
- this._executeCloneCallback("on-clone-nodes", groupArgs);
90
- portal.insertBefore(clone, this.nextSibling);
91
- }
58
+ let htmlString = this.innerHTML;
59
+ const groupArgs = { ...helperSet, $value: value };
60
+ htmlString = this.replaceExpressions(htmlString, groupArgs, this, this._replaceWrap);
61
+ const result = this.ownerDocument?.createElement("template") || document.createElement("template");
62
+ result.innerHTML = htmlString;
63
+ const processedFragment = result.content;
64
+ this._nodes = Array.from(processedFragment.childNodes);
65
+ portal.insertBefore(processedFragment, this.nextSibling);
92
66
  }
93
67
  cleanup() {
94
68
  this._nodes.forEach((n) => n.parentElement?.removeChild(n));
95
69
  this._nodes = [];
96
70
  }
97
- connectedCallback() {
98
- this.refreshValue();
99
- }
100
71
  disconnectedCallback() {
101
72
  this.cleanup();
102
73
  }
103
74
  }
75
+ __decorate([
76
+ (0, import_decorators.attributeHost)("value"),
77
+ __metadata("design:type", Object)
78
+ ], SwcIf.prototype, "_value", void 0);
79
+ __decorate([
80
+ (0, import_decorators.attributeHost)("replace-wrap"),
81
+ __metadata("design:type", String)
82
+ ], SwcIf.prototype, "_replaceWrap", void 0);
104
83
  __decorate([
105
84
  (0, import_changedAttributeHost.changedAttributeHost)("value"),
106
85
  __metadata("design:type", Function),
107
86
  __metadata("design:paramtypes", [String]),
108
87
  __metadata("design:returntype", void 0)
109
- ], SwcIf.prototype, "refreshValue", null);
88
+ ], SwcIf.prototype, "setValue", null);
89
+ __decorate([
90
+ (0, import_changedAttributeHost.changedAttributeHost)("replace-wrap"),
91
+ __metadata("design:type", Function),
92
+ __metadata("design:paramtypes", [String]),
93
+ __metadata("design:returntype", void 0)
94
+ ], SwcIf.prototype, "setReplaceWrap", null);
110
95
  //# sourceMappingURL=SwcIf.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/elements/SwcIf.ts"],
4
- "sourcesContent": ["import { changedAttributeHost } from '../decorators/changedAttributeHost';\nimport { SwcUtils } from '../utils/Utils';\nimport { FunctionUtils } from '@dooboostore/core';\n\nclass SwcIf extends HTMLTemplateElement {\n private _value = false;\n private _nodes: Node[] = [];\n\n get value(): boolean {\n return this._value;\n }\n set value(nv: any) {\n this._value = Boolean(nv);\n this.render();\n }\n\n private _executeCloneCallback(attr: string, args: any) {\n const script = this.getAttribute(attr);\n if (!script) return;\n FunctionUtils.execute({ script, context: this, args });\n }\n\n @changedAttributeHost('value')\n private refreshValue(valueAttr?: string | null) {\n valueAttr ??= this.getAttribute('value');\n if (valueAttr === null) {\n this.value = false;\n return;\n }\n\n // {{ }} 브레이스로 감싸진 값은 스크립트 실행\n if (valueAttr.startsWith('{{') && valueAttr.endsWith('}}')) {\n const script = valueAttr.slice(2, -2).trim();\n const win = this.ownerDocument?.defaultView || window;\n const result = FunctionUtils.executeReturn({\n script,\n context: this,\n args: SwcUtils.getHelperAndHostSet(win, this)\n });\n this.value = result;\n } else {\n // 일반 문자열 값\n this.value = Boolean(valueAttr);\n }\n }\n\n private render() {\n this.cleanup();\n const portal = this.parentElement;\n if (!portal) return;\n\n const win = this.ownerDocument?.defaultView || window;\n const helperSet = SwcUtils.getHelperAndHostSet(win, this);\n\n let targetTpl: HTMLTemplateElement | null = null;\n if (this._value) {\n targetTpl = this;\n } else {\n targetTpl = this.content.querySelector('template[is=\"swc-default\"]') as HTMLTemplateElement;\n }\n\n if (targetTpl) {\n const clone = targetTpl.content.cloneNode(true) as DocumentFragment;\n // If it's the host template, remove sub-templates from clone\n if (targetTpl === this) {\n clone.querySelectorAll('template[is^=\"swc-\"]').forEach(t => t.remove());\n }\n\n this._nodes = Array.from(clone.childNodes);\n const elements = this._nodes.filter(n => n.nodeType === 1) as HTMLElement[];\n const groupArgs = { ...helperSet, $value: this._value, $nodes: this._nodes, $elements: elements, $firstElement: elements[0] };\n\n // 부모 체인을 정상적으로 유지하기 위해 __swc_host 할당 제거\n this._nodes.forEach((node, nodeIdx) => {\n // if (node instanceof HTMLElement) (node as any).__swc_host = this; // 제거: 부모 체인 유지\n this._executeCloneCallback('on-clone-node', { ...groupArgs, $node: node, $nodeIndex: nodeIdx, $isElement: node.nodeType === 1 });\n\n // Attribute {{ }} 치환 - SwcChoose처럼 동적 치환\n if (node instanceof HTMLElement) {\n Array.from(node.attributes).forEach(attr => {\n const value = attr.value || '';\n if (value.startsWith('{{') && value.endsWith('}}')) {\n const script = value.slice(2, -2).trim();\n const result = FunctionUtils.executeReturn({\n script,\n context: node,\n args: { ...groupArgs, $value: this._value }\n });\n node.setAttribute(attr.name, String(result));\n }\n });\n }\n });\n\n this._executeCloneCallback('on-clone-nodes', groupArgs);\n\n portal.insertBefore(clone, this.nextSibling);\n }\n }\n\n private cleanup() {\n this._nodes.forEach(n => n.parentElement?.removeChild(n));\n this._nodes = [];\n }\n\n connectedCallback() {\n this.refreshValue();\n }\n disconnectedCallback() {\n this.cleanup();\n }\n}\n"],
5
- "mappings": "AAAA,kCAAqC;AACrC,mBAAy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EAAE,OAAM,CAAE;MACxE;AAEA,WAAK,SAAS,MAAM,KAAK,MAAM,UAAU;AACzC,YAAM,WAAW,KAAK,OAAO,OAAO,OAAK,EAAE,aAAa,CAAC;AACzD,YAAM,YAAY,EAAE,GAAG,WAAW,QAAQ,KAAK,QAAQ,QAAQ,KAAK,QAAQ,WAAW,UAAU,eAAe,SAAS,CAAC,EAAC;AAG3H,WAAK,OAAO,QAAQ,CAAC,MAAM,YAAW;AAEpC,aAAK,sBAAsB,iBAAiB,EAAE,GAAG,WAAW,OAAO,MAAM,YAAY,SAAS,YAAY,KAAK,aAAa,EAAC,CAAE;AAG/H,YAAI,gBAAgB,aAAa;AAC/B,gBAAM,KAAK,KAAK,UAAU,EAAE,QAAQ,UAAO;AACzC,kBAAM,QAAQ,KAAK,SAAS;AAC5B,gBAAI,MAAM,WAAW,IAAI,KAAK,MAAM,SAAS,IAAI,GAAG;AAClD,oBAAM,SAAS,MAAM,MAAM,GAAG,EAAE,EAAE,KAAI;AACtC,oBAAM,SAAS,0BAAc,cAAc;gBACzC;gBACA,SAAS;gBACT,MAAM,EAAE,GAAG,WAAW,QAAQ,KAAK,OAAM;eAC1C;AACD,mBAAK,aAAa,KAAK,MAAM,OAAO,MAAM,CAAC;YAC7C;UACF,CAAC;QACH;MACF,CAAC;AAED,WAAK,sBAAsB,kBAAkB,SAAS;AAEtD,aAAO,aAAa,OAAO,KAAK,WAAW;IAC7C;EACF;EAEQ,UAAO;AACb,SAAK,OAAO,QAAQ,OAAK,EAAE,eAAe,YAAY,CAAC,CAAC;AACxD,SAAK,SAAS,CAAA;EAChB;EAEA,oBAAiB;AACf,SAAK,aAAY;EACnB;EACA,uBAAoB;AAClB,SAAK,QAAO;EACd;;AAvFQ,WAAA;MADP,kDAAqB,OAAO;;;;;",
4
+ "sourcesContent": ["import { changedAttributeHost } from '../decorators/changedAttributeHost';\nimport { SwcUtils } from '../utils/Utils';\nimport { FunctionUtils, ActionExpression } from '@dooboostore/core';\nimport { ConvertUtils } from '@dooboostore/core-web';\nimport { SwcIfInterface } from '../types';\nimport { attributeHost } from '../decorators';\n\nclass SwcIf extends HTMLTemplateElement implements SwcIfInterface {\n @attributeHost('value')\n _value: any;\n\n @attributeHost('replace-wrap')\n _replaceWrap: string | null;\n\n private _nodes: Node[] = [];\n\n get value(): boolean {\n return this._value;\n }\n\n set value(nv: any) {\n // this._value = nv;\n this.refresh(nv);\n }\n\n private replaceExpressions(html: string, groupArgs: any, context: any, wrap?: string | null): string {\n const config = wrap ? { wrapExpression: wrap } : undefined;\n const ae = new ActionExpression(html, config);\n const filterOptions = wrap ? { type: 'replace' as const, wrap } : 'replace';\n const win = this.ownerDocument?.defaultView || window;\n \n // @ts-ignore\n for (const expr of ae.getExpressions(filterOptions)) {\n try {\n const value = FunctionUtils.executeReturn({\n script: ConvertUtils.decodeHtmlEntity(expr.script, win.document),\n context,\n args: groupArgs\n });\n ae.replace(expr, String(value));\n } catch (e) {\n console.error(`[SWC] Failed to execute ${expr.original}:`, e);\n }\n }\n return ae.getUnprocessedTemplate();\n }\n\n @changedAttributeHost('value')\n private setValue(valueAttr?: string | null) {\n this.refresh();\n }\n\n @changedAttributeHost('replace-wrap')\n private setReplaceWrap(replaceWrapAttr?: string | null) {\n this.refresh();\n }\n\n refresh(value = this._value) {\n this.cleanup();\n const portal = this.parentElement;\n if (!portal || !value) return;\n\n const win = this.ownerDocument?.defaultView || window;\n const helperSet = SwcUtils.getHelperAndHostSet(win, this);\n\n let htmlString = this.innerHTML;\n const groupArgs = { ...helperSet, $value: value };\n\n htmlString = this.replaceExpressions(htmlString, groupArgs, this, this._replaceWrap);\n\n const result = this.ownerDocument?.createElement('template') || document.createElement('template');\n result.innerHTML = htmlString;\n const processedFragment = result.content;\n\n this._nodes = Array.from(processedFragment.childNodes);\n portal.insertBefore(processedFragment, this.nextSibling);\n }\n\n private cleanup() {\n this._nodes.forEach(n => n.parentElement?.removeChild(n));\n this._nodes = [];\n }\n\n disconnectedCallback() {\n this.clean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AW,MAAM,KAAK,YAAY;AAEnF,UAAM,SAAS,KAAK,eAAe,cAAc,UAAU,KAAK,SAAS,cAAc,UAAU;AACjG,WAAO,YAAY;AACnB,UAAM,oBAAoB,OAAO;AAEjC,SAAK,SAAS,MAAM,KAAK,kBAAkB,UAAU;AACrD,WAAO,aAAa,mBAAmB,KAAK,WAAW;EACzD;EAEQ,UAAO;AACb,SAAK,OAAO,QAAQ,OAAK,EAAE,eAAe,YAAY,CAAC,CAAC;AACxD,SAAK,SAAS,CAAA;EAChB;EAEA,uBAAoB;AAClB,SAAK,QAAO;EACd;;AA5EA,WAAA;MADC,iCAAc,OAAO;;;AAItB,WAAA;MADC,iCAAc,cAAc;;;AAqCrB,WAAA;MADP,kDAAqB,OAAO;;;;;AAMrB,WAAA;MADP,kDAAqB,cAAc;;;;;",
6
6
  "names": []
7
7
  }
@@ -1,6 +1,8 @@
1
1
  var import_changedAttributeHost = require("../decorators/changedAttributeHost");
2
2
  var import_Utils = require("../utils/Utils");
3
3
  var import_core = require("@dooboostore/core");
4
+ var import_core_web = require("@dooboostore/core-web");
5
+ var import_decorators = require("../decorators");
4
6
  var __decorate = function(decorators, target, key, desc) {
5
7
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
6
8
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
@@ -13,110 +15,88 @@ var __metadata = function(k, v) {
13
15
  class SwcLoop extends HTMLTemplateElement {
14
16
  constructor() {
15
17
  super(...arguments);
16
- this._value = [];
17
18
  this._nodeGroups = [];
18
19
  }
19
20
  get value() {
20
21
  return this._value;
21
22
  }
22
23
  set value(nv) {
23
- this._value = Array.isArray(nv) ? [...nv] : [];
24
- this.render();
24
+ this.refresh(nv);
25
25
  }
26
- _executeCloneCallback(attr, args) {
27
- const script = this.getAttribute(attr);
28
- if (!script)
29
- return;
30
- import_core.FunctionUtils.execute({ script, context: this, args });
26
+ setValue() {
27
+ this.refresh();
31
28
  }
32
- _cleanup() {
33
- this._nodeGroups.forEach((nodes) => nodes.forEach((n) => n.parentElement?.removeChild(n)));
34
- this._nodeGroups = [];
29
+ setReplaceWrap() {
30
+ this.refresh();
35
31
  }
36
- refreshValue() {
37
- let script = this.getAttribute("value");
38
- if (!script) {
39
- this.value = [];
40
- return;
41
- }
42
- if (script.startsWith("{{") && script.endsWith("}}")) {
43
- script = script.slice(2, -2).trim();
44
- }
32
+ replaceExpressions(html, groupArgs, context, wrap) {
33
+ const config = wrap ? { wrapExpression: wrap } : void 0;
34
+ const ae = new import_core.ActionExpression(html, config);
35
+ const filterOptions = wrap ? { type: "replace", wrap } : "replace";
45
36
  const win = this.ownerDocument?.defaultView || window;
46
- const res = import_core.FunctionUtils.executeReturn({
47
- script,
48
- context: this,
49
- args: import_Utils.SwcUtils.getHelperAndHostSet(win, this)
50
- });
51
- if (res instanceof Promise) {
52
- res.then((v) => this.value = v).catch(() => this.value = []);
53
- } else {
54
- this.value = res;
37
+ for (const expr of ae.getExpressions(filterOptions)) {
38
+ try {
39
+ const value = import_core.FunctionUtils.executeReturn({
40
+ script: import_core_web.ConvertUtils.decodeHtmlEntity(expr.script, win.document),
41
+ context,
42
+ args: groupArgs
43
+ });
44
+ ae.replace(expr, String(value));
45
+ } catch (e) {
46
+ console.error(`[SWC] Failed to execute ${expr.original}:`, e);
47
+ }
55
48
  }
49
+ return ae.getUnprocessedTemplate();
56
50
  }
57
- render() {
58
- this._cleanup();
51
+ refresh(value = this._value) {
52
+ this.cleanup();
53
+ if (value?.length <= 0)
54
+ return;
59
55
  const portal = this.parentElement;
60
56
  if (!portal)
61
57
  return;
62
58
  const win = this.ownerDocument?.defaultView || window;
63
59
  const helperSet = import_Utils.SwcUtils.getHelperAndHostSet(win, this);
64
60
  const fragment = win.document.createDocumentFragment();
65
- if (this._value.length === 0) {
66
- const defaultTpl = this.content.querySelector('template[is="swc-default"]');
67
- if (defaultTpl) {
68
- const clone = defaultTpl.content.cloneNode(true);
69
- const nodes = Array.from(clone.childNodes);
70
- this._nodeGroups.push(nodes);
71
- fragment.appendChild(clone);
72
- }
73
- } else {
74
- this._value.forEach((item, index) => {
75
- const clone = this.content.cloneNode(true);
76
- const subTemplates = clone.querySelectorAll('template[is^="swc-"]');
77
- subTemplates.forEach((t) => t.remove());
78
- const nodes = Array.from(clone.childNodes);
79
- const elements = nodes.filter((n) => n.nodeType === 1);
80
- const groupArgs = { ...helperSet, $item: item, $index: index, $value: this._value, $nodes: nodes, $elements: elements, $firstElement: elements[0] };
81
- nodes.forEach((node, nodeIdx) => {
82
- this._executeCloneCallback("on-clone-node", { ...groupArgs, $node: node, $nodeIndex: nodeIdx, $isElement: node.nodeType === 1 });
83
- if (node instanceof HTMLElement) {
84
- Array.from(node.attributes).forEach((attr) => {
85
- const value = attr.value || "";
86
- if (value.startsWith("{{") && value.endsWith("}}")) {
87
- const script = value.slice(2, -2).trim();
88
- const result = import_core.FunctionUtils.executeReturn({
89
- script,
90
- context: node,
91
- args: groupArgs
92
- });
93
- node.setAttribute(attr.name, String(result));
94
- }
95
- });
96
- }
97
- });
98
- this._executeCloneCallback("on-clone-nodes", groupArgs);
99
- this._nodeGroups.push(nodes);
100
- fragment.appendChild(clone);
101
- });
102
- }
103
- if (portal === this.parentElement) {
104
- portal.insertBefore(fragment, this.nextSibling);
105
- } else {
106
- portal.appendChild(fragment);
107
- }
61
+ value.forEach((item, index) => {
62
+ let htmlString = this.innerHTML;
63
+ const groupArgs = { ...helperSet, $item: item, $index: index, $value: this._value };
64
+ htmlString = this.replaceExpressions(htmlString, groupArgs, this, this._replaceWrap);
65
+ const temp = this.ownerDocument?.createElement("template") || document.createElement("template");
66
+ temp.innerHTML = htmlString;
67
+ const content = temp.content;
68
+ const nodes = Array.from(content.childNodes);
69
+ this._nodeGroups.push(nodes);
70
+ fragment.appendChild(content);
71
+ });
72
+ portal.insertBefore(fragment, this.nextSibling);
108
73
  }
109
- connectedCallback() {
110
- this.refreshValue();
74
+ cleanup() {
75
+ this._nodeGroups.forEach((nodes) => nodes.forEach((n) => n.parentElement?.removeChild(n)));
76
+ this._nodeGroups = [];
111
77
  }
112
78
  disconnectedCallback() {
113
- this._cleanup();
79
+ this.cleanup();
114
80
  }
115
81
  }
82
+ __decorate([
83
+ (0, import_decorators.attributeHost)("value"),
84
+ __metadata("design:type", Array)
85
+ ], SwcLoop.prototype, "_value", void 0);
86
+ __decorate([
87
+ (0, import_decorators.attributeHost)("replace-wrap"),
88
+ __metadata("design:type", String)
89
+ ], SwcLoop.prototype, "_replaceWrap", void 0);
116
90
  __decorate([
117
91
  (0, import_changedAttributeHost.changedAttributeHost)("value"),
118
92
  __metadata("design:type", Function),
119
93
  __metadata("design:paramtypes", []),
120
94
  __metadata("design:returntype", void 0)
121
- ], SwcLoop.prototype, "refreshValue", null);
95
+ ], SwcLoop.prototype, "setValue", null);
96
+ __decorate([
97
+ (0, import_changedAttributeHost.changedAttributeHost)("replace-wrap"),
98
+ __metadata("design:type", Function),
99
+ __metadata("design:paramtypes", []),
100
+ __metadata("design:returntype", void 0)
101
+ ], SwcLoop.prototype, "setReplaceWrap", null);
122
102
  //# sourceMappingURL=SwcLoop.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/elements/SwcLoop.ts"],
4
- "sourcesContent": ["import { changedAttributeHost } from '../decorators/changedAttributeHost';\nimport { SwcUtils } from '../utils/Utils';\nimport { FunctionUtils } from '@dooboostore/core';\n\nclass SwcLoop extends HTMLTemplateElement {\n private _value: any[] = [];\n private _nodeGroups: Node[][] = [];\n\n get value(): any[] {\n return this._value;\n }\n set value(nv: any[]) {\n this._value = Array.isArray(nv) ? [...nv] : [];\n this.render();\n }\n\n\n\n private _executeCloneCallback(attr: string, args: any) {\n const script = this.getAttribute(attr);\n if (!script) return;\n FunctionUtils.execute({ script, context: this, args });\n }\n\n private _cleanup() {\n this._nodeGroups.forEach(nodes => nodes.forEach(n => n.parentElement?.removeChild(n)));\n this._nodeGroups = [];\n }\n\n @changedAttributeHost('value')\n private refreshValue() {\n let script = this.getAttribute('value');\n if (!script) {\n this.value = [];\n return;\n }\n // Parse {{ }} braces\n if (script.startsWith('{{') && script.endsWith('}}')) {\n script = script.slice(2, -2).trim();\n }\n const win = this.ownerDocument?.defaultView || window;\n const res = FunctionUtils.executeReturn({\n script,\n context: this,\n args: SwcUtils.getHelperAndHostSet(win, this)\n });\n\n if (res instanceof Promise) {\n res.then(v => (this.value = v)).catch(() => (this.value = []));\n } else {\n this.value = res;\n }\n }\n\n render() {\n this._cleanup();\n const portal = this.parentElement;\n if (!portal) return;\n\n const win = this.ownerDocument?.defaultView || window;\n const helperSet = SwcUtils.getHelperAndHostSet(win, this);\n const fragment = win.document.createDocumentFragment();\n\n if (this._value.length === 0) {\n const defaultTpl = this.content.querySelector('template[is=\"swc-default\"]') as HTMLTemplateElement;\n if (defaultTpl) {\n const clone = defaultTpl.content.cloneNode(true);\n const nodes = Array.from(clone.childNodes);\n this._nodeGroups.push(nodes);\n fragment.appendChild(clone);\n }\n } else {\n this._value.forEach((item, index) => {\n const clone = this.content.cloneNode(true) as DocumentFragment;\n // Filter out sub-templates\n const subTemplates = clone.querySelectorAll('template[is^=\"swc-\"]');\n subTemplates.forEach(t => t.remove());\n\n const nodes = Array.from(clone.childNodes);\n const elements = nodes.filter(n => n.nodeType === 1) as HTMLElement[];\n\n const groupArgs = { ...helperSet, $item: item, $index: index, $value: this._value, $nodes: nodes, $elements: elements, $firstElement: elements[0] };\n\n nodes.forEach((node, nodeIdx) => {\n this._executeCloneCallback('on-clone-node', { ...groupArgs, $node: node, $nodeIndex: nodeIdx, $isElement: node.nodeType === 1 });\n\n // Attribute {{ }} 치환 - SwcChoose처럼 동적 치환\n if (node instanceof HTMLElement) {\n Array.from(node.attributes).forEach(attr => {\n const value = attr.value || '';\n if (value.startsWith('{{') && value.endsWith('}}')) {\n const script = value.slice(2, -2).trim();\n const result = FunctionUtils.executeReturn({\n script,\n context: node,\n args: groupArgs\n });\n node.setAttribute(attr.name, String(result));\n }\n });\n }\n });\n\n this._executeCloneCallback('on-clone-nodes', groupArgs);\n this._nodeGroups.push(nodes);\n fragment.appendChild(clone);\n });\n }\n\n if (portal === this.parentElement) {\n portal.insertBefore(fragment, this.nextSibling);\n } else {\n portal.appendChild(fragment);\n }\n }\n\n connectedCallback() {\n this.refreshValue();\n }\n disconnectedCallback() {\n this._cleanup();\n }\n}\n"],
5
- "mappings": "AAAA,kCAAqC;AACrC,mBAAyB;AACzB,kBAA8B;;;;;;;;;;AAE9B,MAAM,gBAAgB,oBAAmB;EAAzC,cAAA;;AACU,SAAA,SAAgB,CAAA;AAChB,SAAA,cAAwB,CAAA;EAoHlC;EAlHE,IAAI,QAAK;AACP,WAAO,KAAK;EACd;EACA,IAAI,MAAM,IAAS;AACjB,SAAK,SAAS,MAAM,QAAQ,EAAE,IAAI,CAAC,GAAG,EAAE,IAAI,CAAA;AAC5C,SAAK,OAAM;EACb;EAIQ,sBAAsB,MAAc,MAAS;AACnD,UAAM,SAAS,KAAK,aAAa,IAAI;AACrC,QAAI,CAAC;AAAQ;AACb,8BAAc,QAAQ,EAAE,QAAQ,SAAS,MAAM,KAAI,CAAE;EACvD;EAEQ,WAAQ;AACd,SAAK,YAAY,QAAQ,WAAS,MAAM,QAAQ,OAAK,EAAE,eAAe,YAAY,CAAC,CAAC,CAAC;AACrF,SAAK,cAAc,CAAA;EACrB;EAGQ,eAAY;AAClB,QAAI,SAAS,KAAK,aAAa,OAAO;AACtC,QAAI,CAAC,QAAQ;AACX,WAAK,QAAQ,CAAA;AACb;IACF;AAEA,QAAI,OAAO,WAAW,IAAI,KAAK,OAAO,SAAS,IAAI,GAAG;AACpD,eAAS,OAAO,MAAM,GAAG,EAAE,EAAE,KAAI;IACnC;AACA,UAAM,MAAM,KAAK,eAAe,eAAe;AAC/C,UAAM,MAAM,0BAAc,cAAc;MACtC;MACA,SAAS;MACT,MAAM,sBAAS,oBAA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AK,KAAK,UAAU,EAAE,QAAQ,UAAO;AACzC,oBAAM,QAAQ,KAAK,SAAS;AAC5B,kBAAI,MAAM,WAAW,IAAI,KAAK,MAAM,SAAS,IAAI,GAAG;AAClD,sBAAM,SAAS,MAAM,MAAM,GAAG,EAAE,EAAE,KAAI;AACtC,sBAAM,SAAS,0BAAc,cAAc;kBACzC;kBACA,SAAS;kBACT,MAAM;iBACP;AACD,qBAAK,aAAa,KAAK,MAAM,OAAO,MAAM,CAAC;cAC7C;YACF,CAAC;UACH;QACF,CAAC;AAED,aAAK,sBAAsB,kBAAkB,SAAS;AACtD,aAAK,YAAY,KAAK,KAAK;AAC3B,iBAAS,YAAY,KAAK;MAC5B,CAAC;IACH;AAEA,QAAI,WAAW,KAAK,eAAe;AACjC,aAAO,aAAa,UAAU,KAAK,WAAW;IAChD,OAAO;AACL,aAAO,YAAY,QAAQ;IAC7B;EACF;EAEA,oBAAiB;AACf,SAAK,aAAY;EACnB;EACA,uBAAoB;AAClB,SAAK,SAAQ;EACf;;AA3FQ,WAAA;MADP,kDAAqB,OAAO;;;;;",
4
+ "sourcesContent": ["import { changedAttributeHost } from '../decorators/changedAttributeHost';\nimport { SwcUtils } from '../utils/Utils';\nimport { FunctionUtils, ActionExpression } from '@dooboostore/core';\nimport { ConvertUtils } from '@dooboostore/core-web';\nimport { attributeHost } from '../decorators';\n\nclass SwcLoop extends HTMLTemplateElement {\n @attributeHost('value')\n _value: any[];\n\n @attributeHost('replace-wrap')\n _replaceWrap: string | null;\n\n private _nodeGroups: Node[][] = [];\n\n get value(): any[] {\n return this._value;\n }\n set value(nv: any[]) {\n // this._value = Array.isArray(nv) ? [...nv] : [];\n this.refresh(nv);\n }\n\n @changedAttributeHost('value')\n private setValue() {\n this.refresh();\n }\n\n @changedAttributeHost('replace-wrap')\n private setReplaceWrap() {\n this.refresh();\n }\n\n private replaceExpressions(html: string, groupArgs: any, context: any, wrap?: string | null): string {\n const config = wrap ? { wrapExpression: wrap } : undefined;\n const ae = new ActionExpression(html, config);\n const filterOptions = wrap ? { type: 'replace' as const, wrap } : 'replace';\n const win = this.ownerDocument?.defaultView || window;\n\n // @ts-ignore\n for (const expr of ae.getExpressions(filterOptions)) {\n try {\n const value = FunctionUtils.executeReturn({\n script: ConvertUtils.decodeHtmlEntity(expr.script, win.document),\n context,\n args: groupArgs\n });\n ae.replace(expr, String(value));\n } catch (e) {\n console.error(`[SWC] Failed to execute ${expr.original}:`, e);\n }\n }\n return ae.getUnprocessedTemplate();\n }\n\n refresh(value = this._value) {\n this.cleanup();\n if (value?.length<=0) return;\n const portal = this.parentElement;\n if (!portal) return;\n\n const win = this.ownerDocument?.defaultView || window;\n const helperSet = SwcUtils.getHelperAndHostSet(win, this);\n const fragment = win.document.createDocumentFragment();\n\n value.forEach((item, index) => {\n let htmlString = this.innerHTML;\n const groupArgs = { ...helperSet, $item: item, $index: index, $value: this._value };\n\n htmlString = this.replaceExpressions(htmlString, groupArgs, this, this._replaceWrap);\n\n const temp = this.ownerDocument?.createElement('template') || document.createElement('template');\n temp.innerHTML = htmlString;\n\n const content = temp.content;\n const nodes = Array.from(content.childNodes);\n this._nodeGroups.push(nodes);\n fragment.appendChild(content);\n });\n\n portal.insertBefore(fragment, this.nextSibling);\n }\n\n private cleanup() {\n this._nodeGroups.forEach(nodes => nodes.forEach(n => n.parentElement?.removeChild(n)));\n this._nodeGroups = [];\n }\n\n disconnectedCallback() {\n this.cleanup();\n }\n}\n"],
5
+ "mappings": "AAAA,kCAAqC;AACrC,mBAAyB;AACzB,kBAAgD;AAChD,sBAA6B;AAC7B,wBAA8B;;;;;;;;;;AAE9B,MAAM,gBAAgB,oBAAmB;EAAzC,cAAA;;AAOU,SAAA,cAAwB,CAAA;EA8ElC;EA5EE,IAAI,QAAK;AACP,WAAO,KAAK;EACd;EACA,IAAI,MAAM,IAAS;AAEjB,SAAK,QAAQ,EAAE;EACjB;EAGQ,WAAQ;AACd,SAAK,QAAO;EACd;EAGQ,iBAAc;AACpB,SAA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