@ngockhoale/ukit 1.1.6
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/CHANGELOG.md +179 -0
- package/LICENSE +21 -0
- package/README.md +189 -0
- package/bin/ukit +30 -0
- package/manifests/platform.full.yaml +1194 -0
- package/package.json +71 -0
- package/scripts/bug/triage.mjs +37 -0
- package/scripts/index/build-index.mjs +35 -0
- package/scripts/index/query-index.mjs +92 -0
- package/scripts/index/refresh-index.mjs +85 -0
- package/scripts/release/verify-release.mjs +56 -0
- package/src/bug/triageBug.js +123 -0
- package/src/cli/adapters.js +148 -0
- package/src/cli/commands/diff.js +51 -0
- package/src/cli/commands/doctor.js +125 -0
- package/src/cli/commands/indexArgs.js +73 -0
- package/src/cli/commands/indexTools.js +509 -0
- package/src/cli/commands/install.js +293 -0
- package/src/cli/commands/memory.js +126 -0
- package/src/cli/commands/status.js +8 -0
- package/src/cli/commands/uninstall.js +51 -0
- package/src/cli/index.js +109 -0
- package/src/context/detectProjectContext.js +49 -0
- package/src/context/detectProviders.js +12 -0
- package/src/core/applyPlan.js +89 -0
- package/src/core/buildPlan.js +228 -0
- package/src/core/compact/index.js +294 -0
- package/src/core/compact/threshold.js +936 -0
- package/src/core/diffPlan.js +73 -0
- package/src/core/ensureGitignore.js +117 -0
- package/src/core/fileOps.js +188 -0
- package/src/core/memory/hygiene.js +160 -0
- package/src/core/memory/index.js +2 -0
- package/src/core/memory/retrieval.js +476 -0
- package/src/core/memory/store.js +202 -0
- package/src/core/metadata.js +132 -0
- package/src/core/migrateLegacy.js +139 -0
- package/src/core/output/index.js +1309 -0
- package/src/core/paths.js +13 -0
- package/src/core/report.js +17 -0
- package/src/core/router/advisor.js +42 -0
- package/src/core/router/index.js +2 -0
- package/src/core/router/router.js +164 -0
- package/src/core/runInstallPipeline.js +365 -0
- package/src/core/runtimeConfig.js +190 -0
- package/src/core/runtimePaths.js +24 -0
- package/src/core/status.js +186 -0
- package/src/core/token/index.js +328 -0
- package/src/core/uninstall.js +246 -0
- package/src/core/validation/confidence.js +89 -0
- package/src/core/validation/index.js +2 -0
- package/src/core/validation/validator.js +165 -0
- package/src/index/buildIndex.js +1392 -0
- package/src/index/gitHooks.js +109 -0
- package/src/index/importResolution.js +377 -0
- package/src/index/languageTools.js +127 -0
- package/src/index/paths.js +27 -0
- package/src/index/queryIndex.js +637 -0
- package/src/index/relatedTests.js +237 -0
- package/src/index/resolveContext.js +345 -0
- package/src/index/routeCatalog.js +258 -0
- package/src/index/taskRouting.js +677 -0
- package/src/index/verificationPlan.js +437 -0
- package/src/manifest/loadManifest.js +22 -0
- package/src/manifest/selectItems.js +78 -0
- package/src/manifest/validateManifest.js +115 -0
- package/src/render/buildVariables.js +39 -0
- package/src/render/renderTemplate.js +44 -0
- package/src/stack/detectStack.js +213 -0
- package/templates/.claude/agents/bug-debugger.md +57 -0
- package/templates/.claude/agents/feature-implementer.md +55 -0
- package/templates/.claude/config/providers.md +25 -0
- package/templates/.claude/hooks/auto-allow-bash.sh +155 -0
- package/templates/.claude/hooks/auto-prune-bash.sh +75 -0
- package/templates/.claude/hooks/block-dangerous.sh +54 -0
- package/templates/.claude/hooks/compress-output.sh +17 -0
- package/templates/.claude/hooks/protect-files.sh +37 -0
- package/templates/.claude/hooks/reinject-context.sh +28 -0
- package/templates/.claude/hooks/session-start.md +13 -0
- package/templates/.claude/hooks/skill-router.sh +1681 -0
- package/templates/.claude/hooks/verification-guard.sh +271 -0
- package/templates/.claude/settings.json +144 -0
- package/templates/.claude/skills/_shared/ooxml/schemas/ISO-IEC29500-4_2016/dml-chart.xsd +1499 -0
- package/templates/.claude/skills/_shared/ooxml/schemas/ISO-IEC29500-4_2016/dml-chartDrawing.xsd +146 -0
- package/templates/.claude/skills/_shared/ooxml/schemas/ISO-IEC29500-4_2016/dml-diagram.xsd +1085 -0
- package/templates/.claude/skills/_shared/ooxml/schemas/ISO-IEC29500-4_2016/dml-lockedCanvas.xsd +11 -0
- package/templates/.claude/skills/_shared/ooxml/schemas/ISO-IEC29500-4_2016/dml-main.xsd +3081 -0
- package/templates/.claude/skills/_shared/ooxml/schemas/ISO-IEC29500-4_2016/dml-picture.xsd +23 -0
- package/templates/.claude/skills/_shared/ooxml/schemas/ISO-IEC29500-4_2016/dml-spreadsheetDrawing.xsd +185 -0
- package/templates/.claude/skills/_shared/ooxml/schemas/ISO-IEC29500-4_2016/dml-wordprocessingDrawing.xsd +287 -0
- package/templates/.claude/skills/_shared/ooxml/schemas/ISO-IEC29500-4_2016/pml.xsd +1676 -0
- package/templates/.claude/skills/_shared/ooxml/schemas/ISO-IEC29500-4_2016/shared-additionalCharacteristics.xsd +28 -0
- package/templates/.claude/skills/_shared/ooxml/schemas/ISO-IEC29500-4_2016/shared-bibliography.xsd +144 -0
- package/templates/.claude/skills/_shared/ooxml/schemas/ISO-IEC29500-4_2016/shared-commonSimpleTypes.xsd +174 -0
- package/templates/.claude/skills/_shared/ooxml/schemas/ISO-IEC29500-4_2016/shared-customXmlDataProperties.xsd +25 -0
- package/templates/.claude/skills/_shared/ooxml/schemas/ISO-IEC29500-4_2016/shared-customXmlSchemaProperties.xsd +18 -0
- package/templates/.claude/skills/_shared/ooxml/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesCustom.xsd +59 -0
- package/templates/.claude/skills/_shared/ooxml/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesExtended.xsd +56 -0
- package/templates/.claude/skills/_shared/ooxml/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesVariantTypes.xsd +195 -0
- package/templates/.claude/skills/_shared/ooxml/schemas/ISO-IEC29500-4_2016/shared-math.xsd +582 -0
- package/templates/.claude/skills/_shared/ooxml/schemas/ISO-IEC29500-4_2016/shared-relationshipReference.xsd +25 -0
- package/templates/.claude/skills/_shared/ooxml/schemas/ISO-IEC29500-4_2016/sml.xsd +4439 -0
- package/templates/.claude/skills/_shared/ooxml/schemas/ISO-IEC29500-4_2016/vml-main.xsd +570 -0
- package/templates/.claude/skills/_shared/ooxml/schemas/ISO-IEC29500-4_2016/vml-officeDrawing.xsd +509 -0
- package/templates/.claude/skills/_shared/ooxml/schemas/ISO-IEC29500-4_2016/vml-presentationDrawing.xsd +12 -0
- package/templates/.claude/skills/_shared/ooxml/schemas/ISO-IEC29500-4_2016/vml-spreadsheetDrawing.xsd +108 -0
- package/templates/.claude/skills/_shared/ooxml/schemas/ISO-IEC29500-4_2016/vml-wordprocessingDrawing.xsd +96 -0
- package/templates/.claude/skills/_shared/ooxml/schemas/ISO-IEC29500-4_2016/wml.xsd +3646 -0
- package/templates/.claude/skills/_shared/ooxml/schemas/ISO-IEC29500-4_2016/xml.xsd +116 -0
- package/templates/.claude/skills/_shared/ooxml/schemas/ecma/fouth-edition/opc-contentTypes.xsd +42 -0
- package/templates/.claude/skills/_shared/ooxml/schemas/ecma/fouth-edition/opc-coreProperties.xsd +50 -0
- package/templates/.claude/skills/_shared/ooxml/schemas/ecma/fouth-edition/opc-digSig.xsd +49 -0
- package/templates/.claude/skills/_shared/ooxml/schemas/ecma/fouth-edition/opc-relationships.xsd +33 -0
- package/templates/.claude/skills/_shared/ooxml/schemas/mce/mc.xsd +75 -0
- package/templates/.claude/skills/_shared/ooxml/schemas/microsoft/wml-2010.xsd +560 -0
- package/templates/.claude/skills/_shared/ooxml/schemas/microsoft/wml-2012.xsd +67 -0
- package/templates/.claude/skills/_shared/ooxml/schemas/microsoft/wml-2018.xsd +14 -0
- package/templates/.claude/skills/_shared/ooxml/schemas/microsoft/wml-cex-2018.xsd +20 -0
- package/templates/.claude/skills/_shared/ooxml/schemas/microsoft/wml-cid-2016.xsd +13 -0
- package/templates/.claude/skills/_shared/ooxml/schemas/microsoft/wml-sdtdatahash-2020.xsd +4 -0
- package/templates/.claude/skills/_shared/ooxml/schemas/microsoft/wml-symex-2015.xsd +8 -0
- package/templates/.claude/skills/_shared/ooxml/scripts/pack.py +159 -0
- package/templates/.claude/skills/_shared/ooxml/scripts/unpack.py +29 -0
- package/templates/.claude/skills/_shared/ooxml/scripts/validate.py +69 -0
- package/templates/.claude/skills/_shared/ooxml/scripts/validation/__init__.py +15 -0
- package/templates/.claude/skills/_shared/ooxml/scripts/validation/base.py +951 -0
- package/templates/.claude/skills/_shared/ooxml/scripts/validation/docx.py +274 -0
- package/templates/.claude/skills/_shared/ooxml/scripts/validation/pptx.py +315 -0
- package/templates/.claude/skills/_shared/ooxml/scripts/validation/redlining.py +279 -0
- package/templates/.claude/skills/backend-api/SKILL.md +26 -0
- package/templates/.claude/skills/canvas-design/LICENSE.txt +202 -0
- package/templates/.claude/skills/canvas-design/SKILL.md +130 -0
- package/templates/.claude/skills/canvas-design/canvas-fonts/BricolageGrotesque-Bold.ttf +0 -0
- package/templates/.claude/skills/canvas-design/canvas-fonts/BricolageGrotesque-OFL.txt +93 -0
- package/templates/.claude/skills/canvas-design/canvas-fonts/BricolageGrotesque-Regular.ttf +0 -0
- package/templates/.claude/skills/canvas-design/canvas-fonts/InstrumentSans-Bold.ttf +0 -0
- package/templates/.claude/skills/canvas-design/canvas-fonts/InstrumentSans-BoldItalic.ttf +0 -0
- package/templates/.claude/skills/canvas-design/canvas-fonts/InstrumentSans-Italic.ttf +0 -0
- package/templates/.claude/skills/canvas-design/canvas-fonts/InstrumentSans-OFL.txt +93 -0
- package/templates/.claude/skills/canvas-design/canvas-fonts/InstrumentSans-Regular.ttf +0 -0
- package/templates/.claude/skills/canvas-design/canvas-fonts/InstrumentSerif-Italic.ttf +0 -0
- package/templates/.claude/skills/canvas-design/canvas-fonts/InstrumentSerif-Regular.ttf +0 -0
- package/templates/.claude/skills/canvas-design/canvas-fonts/JetBrainsMono-Bold.ttf +0 -0
- package/templates/.claude/skills/canvas-design/canvas-fonts/JetBrainsMono-OFL.txt +93 -0
- package/templates/.claude/skills/canvas-design/canvas-fonts/JetBrainsMono-Regular.ttf +0 -0
- package/templates/.claude/skills/canvas-design/canvas-fonts/Lora-Bold.ttf +0 -0
- package/templates/.claude/skills/canvas-design/canvas-fonts/Lora-BoldItalic.ttf +0 -0
- package/templates/.claude/skills/canvas-design/canvas-fonts/Lora-Italic.ttf +0 -0
- package/templates/.claude/skills/canvas-design/canvas-fonts/Lora-OFL.txt +93 -0
- package/templates/.claude/skills/canvas-design/canvas-fonts/Lora-Regular.ttf +0 -0
- package/templates/.claude/skills/canvas-design/canvas-fonts/NothingYouCouldDo-OFL.txt +93 -0
- package/templates/.claude/skills/canvas-design/canvas-fonts/NothingYouCouldDo-Regular.ttf +0 -0
- package/templates/.claude/skills/canvas-design/canvas-fonts/Outfit-Bold.ttf +0 -0
- package/templates/.claude/skills/canvas-design/canvas-fonts/Outfit-OFL.txt +93 -0
- package/templates/.claude/skills/canvas-design/canvas-fonts/Outfit-Regular.ttf +0 -0
- package/templates/.claude/skills/canvas-design/canvas-fonts/Tektur-Medium.ttf +0 -0
- package/templates/.claude/skills/canvas-design/canvas-fonts/Tektur-OFL.txt +93 -0
- package/templates/.claude/skills/canvas-design/canvas-fonts/Tektur-Regular.ttf +0 -0
- package/templates/.claude/skills/canvas-design/canvas-fonts/YoungSerif-OFL.txt +93 -0
- package/templates/.claude/skills/canvas-design/canvas-fonts/YoungSerif-Regular.ttf +0 -0
- package/templates/.claude/skills/code-review/SKILL.md +97 -0
- package/templates/.claude/skills/debugging-toolkit/SKILL.md +156 -0
- package/templates/.claude/skills/delivery/SKILL.md +92 -0
- package/templates/.claude/skills/discover-security/SKILL.md +86 -0
- package/templates/.claude/skills/docker-packaging/SKILL.md +60 -0
- package/templates/.claude/skills/docs-manager/SKILL.md +465 -0
- package/templates/.claude/skills/docs-manager/init-project-docs.sh +70 -0
- package/templates/.claude/skills/docs-manager/templates/README.md.template +50 -0
- package/templates/.claude/skills/docs-manager/templates/agent-roles.md.template +24 -0
- package/templates/.claude/skills/docs-manager/templates/coding-conventions.md.template +28 -0
- package/templates/.claude/skills/docs-manager/templates/memory.md.template +30 -0
- package/templates/.claude/skills/docs-manager/templates/onboarding.md.template +20 -0
- package/templates/.claude/skills/docs-manager/templates/project.md.template +26 -0
- package/templates/.claude/skills/docs-quality/SKILL.md +148 -0
- package/templates/.claude/skills/docx/LICENSE.txt +30 -0
- package/templates/.claude/skills/docx/SKILL.md +197 -0
- package/templates/.claude/skills/docx/docx-js.md +350 -0
- package/templates/.claude/skills/docx/ooxml.md +610 -0
- package/templates/.claude/skills/docx/scripts/__init__.py +1 -0
- package/templates/.claude/skills/docx/scripts/document.py +1276 -0
- package/templates/.claude/skills/docx/scripts/templates/comments.xml +3 -0
- package/templates/.claude/skills/docx/scripts/templates/commentsExtended.xml +3 -0
- package/templates/.claude/skills/docx/scripts/templates/commentsExtensible.xml +3 -0
- package/templates/.claude/skills/docx/scripts/templates/commentsIds.xml +3 -0
- package/templates/.claude/skills/docx/scripts/templates/people.xml +3 -0
- package/templates/.claude/skills/docx/scripts/utilities.py +374 -0
- package/templates/.claude/skills/duraone/SKILL.md +204 -0
- package/templates/.claude/skills/duraone/references/backend.md +636 -0
- package/templates/.claude/skills/duraone/references/frontend.md +1506 -0
- package/templates/.claude/skills/duraone/references/sql.md +631 -0
- package/templates/.claude/skills/duraone/references/workflow.md +520 -0
- package/templates/.claude/skills/executing-plans/SKILL.md +76 -0
- package/templates/.claude/skills/file-organizer/SKILL.md +433 -0
- package/templates/.claude/skills/frontend/SKILL.md +26 -0
- package/templates/.claude/skills/frontend-design/LICENSE.txt +177 -0
- package/templates/.claude/skills/frontend-design/SKILL.md +42 -0
- package/templates/.claude/skills/frontend-vue/SKILL.md +127 -0
- package/templates/.claude/skills/frontend-vue/components/Control/Box.vue +137 -0
- package/templates/.claude/skills/frontend-vue/components/Control/Button.vue +93 -0
- package/templates/.claude/skills/frontend-vue/components/Control/ButtonBar.vue +29 -0
- package/templates/.claude/skills/frontend-vue/components/Control/ButtonFloat.vue +62 -0
- package/templates/.claude/skills/frontend-vue/components/Control/CheckButton.vue +75 -0
- package/templates/.claude/skills/frontend-vue/components/Control/Checkbox.vue +58 -0
- package/templates/.claude/skills/frontend-vue/components/Control/Datetime.vue +148 -0
- package/templates/.claude/skills/frontend-vue/components/Control/Dropdownlist.vue +156 -0
- package/templates/.claude/skills/frontend-vue/components/Control/Input.vue +106 -0
- package/templates/.claude/skills/frontend-vue/components/Control/Label.vue +38 -0
- package/templates/.claude/skills/frontend-vue/components/Control/Master/BoxColumn.vue +24 -0
- package/templates/.claude/skills/frontend-vue/components/Control/Popup/Confirm.vue +33 -0
- package/templates/.claude/skills/frontend-vue/components/Control/Popup/Info.vue +32 -0
- package/templates/.claude/skills/frontend-vue/components/Control/Popup/ModalInfo.vue +39 -0
- package/templates/.claude/skills/frontend-vue/components/Control/Popup/Reject.vue +64 -0
- package/templates/.claude/skills/frontend-vue/components/Control/Tag.vue +82 -0
- package/templates/.claude/skills/frontend-vue/components/Control/Upload.vue +61 -0
- package/templates/.claude/skills/frontend-vue/components/ControlMobile/Dropdownlist.vue +103 -0
- package/templates/.claude/skills/frontend-vue/components/ControlMobile/PagingBar.vue +108 -0
- package/templates/.claude/skills/frontend-vue/components/ControlMobile/UploadImage.vue +137 -0
- package/templates/.claude/skills/frontend-vue/components/Grid/AG.vue +806 -0
- package/templates/.claude/skills/frontend-vue/components/Grid/AntTable.vue +253 -0
- package/templates/.claude/skills/frontend-vue/components/Grid/CustomDropdownEditor.vue +43 -0
- package/templates/.claude/skills/frontend-vue/components/Grid/CustomDropdownEditorEnable.vue +55 -0
- package/templates/.claude/skills/frontend-vue/components/Grid/HtmlTable.vue +40 -0
- package/templates/.claude/skills/frontend-vue/components/PDFViewer.vue +25 -0
- package/templates/.claude/skills/frontend-vue/components/Panel/FormView.vue +309 -0
- package/templates/.claude/skills/frontend-vue/components/Partial/Footer.vue +23 -0
- package/templates/.claude/skills/frontend-vue/components/Partial/Header.vue +265 -0
- package/templates/.claude/skills/frontend-vue/components/Partial/Sidebar.vue +122 -0
- package/templates/.claude/skills/frontend-vue/components/Template.vue +16 -0
- package/templates/.claude/skills/frontend-vue/components/View/Form.vue +89 -0
- package/templates/.claude/skills/frontend-vue/composables/indexDBStore.js +140 -0
- package/templates/.claude/skills/frontend-vue/composables/masterApi.js +362 -0
- package/templates/.claude/skills/frontend-vue/composables/state.js +578 -0
- package/templates/.claude/skills/frontend-vue/composables/useRequest.js +221 -0
- package/templates/.claude/skills/frontend-vue/composables/useSession.js +179 -0
- package/templates/.claude/skills/frontend-vue/composables/useTranslation.js +54 -0
- package/templates/.claude/skills/frontend-vue/composables/useWebSocket.js +257 -0
- package/templates/.claude/skills/frontend-vue/composables/userObj.js +111 -0
- package/templates/.claude/skills/frontend-vue/composables/utils.js +322 -0
- package/templates/.claude/skills/frontend-vue/reference/composables-example.vue +320 -0
- package/templates/.claude/skills/frontend-vue/reference/form-example.vue +183 -0
- package/templates/.claude/skills/frontend-vue/reference/grid-example.vue +147 -0
- package/templates/.claude/skills/frontend-vue/reference/masterdata-example/[id].vue +106 -0
- package/templates/.claude/skills/frontend-vue/reference/masterdata-example/index.vue +58 -0
- package/templates/.claude/skills/frontend-vue/reference/popup-example.vue +159 -0
- package/templates/.claude/skills/pdf/LICENSE.txt +30 -0
- package/templates/.claude/skills/pdf/SKILL.md +294 -0
- package/templates/.claude/skills/pdf/forms.md +205 -0
- package/templates/.claude/skills/pdf/reference.md +612 -0
- package/templates/.claude/skills/pdf/scripts/check_bounding_boxes.py +70 -0
- package/templates/.claude/skills/pdf/scripts/check_bounding_boxes_test.py +226 -0
- package/templates/.claude/skills/pdf/scripts/check_fillable_fields.py +12 -0
- package/templates/.claude/skills/pdf/scripts/convert_pdf_to_images.py +35 -0
- package/templates/.claude/skills/pdf/scripts/create_validation_image.py +41 -0
- package/templates/.claude/skills/pdf/scripts/extract_form_field_info.py +152 -0
- package/templates/.claude/skills/pdf/scripts/fill_fillable_fields.py +114 -0
- package/templates/.claude/skills/pdf/scripts/fill_pdf_form_with_annotations.py +108 -0
- package/templates/.claude/skills/pdf-processing/SKILL.md +107 -0
- package/templates/.claude/skills/pdf-processing-pro/FORMS.md +610 -0
- package/templates/.claude/skills/pdf-processing-pro/OCR.md +137 -0
- package/templates/.claude/skills/pdf-processing-pro/SKILL.md +296 -0
- package/templates/.claude/skills/pdf-processing-pro/TABLES.md +626 -0
- package/templates/.claude/skills/pdf-processing-pro/scripts/analyze_form.py +307 -0
- package/templates/.claude/skills/postgres/SKILL.md +69 -0
- package/templates/.claude/skills/postgres/reference/fn_get_examples.sql +208 -0
- package/templates/.claude/skills/postgres/reference/fn_rpt_examples.sql +239 -0
- package/templates/.claude/skills/postgres/reference/utility_functions.sql +94 -0
- package/templates/.claude/skills/pptx/LICENSE.txt +30 -0
- package/templates/.claude/skills/pptx/SKILL.md +484 -0
- package/templates/.claude/skills/pptx/html2pptx.md +625 -0
- package/templates/.claude/skills/pptx/ooxml.md +427 -0
- package/templates/.claude/skills/pptx/scripts/html2pptx.js +979 -0
- package/templates/.claude/skills/pptx/scripts/inventory.py +1020 -0
- package/templates/.claude/skills/pptx/scripts/rearrange.py +231 -0
- package/templates/.claude/skills/pptx/scripts/replace.py +385 -0
- package/templates/.claude/skills/pptx/scripts/thumbnail.py +450 -0
- package/templates/.claude/skills/repo-maintenance/SKILL.md +97 -0
- package/templates/.claude/skills/research/EXAMPLES.md +434 -0
- package/templates/.claude/skills/research/REFERENCE.md +399 -0
- package/templates/.claude/skills/research/SKILL.md +136 -0
- package/templates/.claude/skills/root-cause-tracing/SKILL.md +174 -0
- package/templates/.claude/skills/root-cause-tracing/find-polluter.sh +63 -0
- package/templates/.claude/skills/sharing-skills/SKILL.md +194 -0
- package/templates/.claude/skills/sql-optimization-patterns/SKILL.md +493 -0
- package/templates/.claude/skills/subagent-driven-development/SKILL.md +189 -0
- package/templates/.claude/skills/systematic-debugging/CREATION-LOG.md +119 -0
- package/templates/.claude/skills/systematic-debugging/SKILL.md +295 -0
- package/templates/.claude/skills/systematic-debugging/test-academic.md +14 -0
- package/templates/.claude/skills/systematic-debugging/test-pressure-1.md +58 -0
- package/templates/.claude/skills/systematic-debugging/test-pressure-2.md +68 -0
- package/templates/.claude/skills/systematic-debugging/test-pressure-3.md +69 -0
- package/templates/.claude/skills/test-driven-development/SKILL.md +364 -0
- package/templates/.claude/skills/testing-anti-patterns/SKILL.md +302 -0
- package/templates/.claude/skills/testing-quality/SKILL.md +97 -0
- package/templates/.claude/skills/verification-before-completion/SKILL.md +139 -0
- package/templates/.claude/skills/webapp-testing/LICENSE.txt +202 -0
- package/templates/.claude/skills/webapp-testing/SKILL.md +96 -0
- package/templates/.claude/skills/webapp-testing/examples/console_logging.py +35 -0
- package/templates/.claude/skills/webapp-testing/examples/element_discovery.py +40 -0
- package/templates/.claude/skills/webapp-testing/examples/static_html_automation.py +33 -0
- package/templates/.claude/skills/webapp-testing/scripts/with_server.py +106 -0
- package/templates/.claude/ukit/index/build-index.mjs +28 -0
- package/templates/.claude/ukit/index/cache-utils.mjs +140 -0
- package/templates/.claude/ukit/index/lib/index-core.mjs +2800 -0
- package/templates/.claude/ukit/index/query-index.mjs +150 -0
- package/templates/.claude/ukit/index/refresh-index.mjs +57 -0
- package/templates/.claude/ukit/index/reset-auto-permissions.mjs +76 -0
- package/templates/.claude/ukit/index/resolve-context.mjs +279 -0
- package/templates/.claude/ukit/index/route-catalog.mjs +258 -0
- package/templates/.claude/ukit/index/route-task.mjs +1994 -0
- package/templates/.claude/ukit/index/triage.mjs +133 -0
- package/templates/.claude/ukit/index/verify-context.mjs +689 -0
- package/templates/.claude/ukit/runtime/compact-threshold.mjs +1013 -0
- package/templates/.claude/ukit/runtime/output-compression.mjs +1340 -0
- package/templates/.claude/ukit/runtime/reinject-context.mjs +874 -0
- package/templates/.claude/ukit/runtime/token-utils.mjs +500 -0
- package/templates/.codex/README.md +83 -0
- package/templates/.codex/settings.json +187 -0
- package/templates/.gitignore +75 -0
- package/templates/AGENTS.md +116 -0
- package/templates/CLAUDE.md +93 -0
- package/templates/adapter-presets/antigravity/README.md +22 -0
- package/templates/adapter-presets/antigravity/rules.md +49 -0
- package/templates/adapter-presets/claude/settings.local.json +42 -0
- package/templates/adapter-presets/codex/settings.local.json +6 -0
- package/templates/adapter-presets/opencode/opencode.template.json +1 -0
- package/templates/docs/BUGFIX.md +20 -0
- package/templates/docs/BUG_INDEX.md +12 -0
- package/templates/docs/BUG_METRICS.md +7 -0
- package/templates/docs/BUG_TEMPLATE.md +13 -0
- package/templates/docs/CODE_MAP.md +35 -0
- package/templates/docs/INSTALL.md +113 -0
- package/templates/docs/MEMORY.md +49 -0
- package/templates/docs/PROJECT.md +50 -0
- package/templates/docs/UKIT_USAGE_GUIDE.md +147 -0
- package/templates/docs/WORKLOG.md +10 -0
- package/templates/ukit/README.md +14 -0
- package/templates/ukit/storage/cache/compact-history.json +3 -0
- package/templates/ukit/storage/cache/compact-pressure.json +1 -0
- package/templates/ukit/storage/cache/output-history.json +3 -0
- package/templates/ukit/storage/cache/prompt-cache.json +3 -0
- package/templates/ukit/storage/config.json +37 -0
- package/templates/ukit/storage/memory/projects/.gitkeep +2 -0
- package/templates/ukit/storage/memory/sessions/.gitkeep +0 -0
- package/templates/ukit/storage/memory/user.json +5 -0
|
@@ -0,0 +1,806 @@
|
|
|
1
|
+
<!-- <GridAG id="gridag" :columns="columns_list" :rows="rows" @onClickDetail="onClickDetail" @onAdd="onAdd" @reloadData="reloadData" :can_delete="true" :height="table_height" :table="table_name" :table_schema="table_schema" /> -->
|
|
2
|
+
<!-- :extra_button="[{ name: 'test', key: 'test', 'type': 'warning' }]" @onExtraBtnClick="onExtraBtnClick" -->
|
|
3
|
+
<!-- If have checkbox then use @getSelectedRows="getSelectedRows" -->
|
|
4
|
+
<template>
|
|
5
|
+
<div>
|
|
6
|
+
<ControlPopupConfirm :visible="show_confirm_delete" :title="t('Confirm')" :message="t('Are you sure to delete this record?')" @onClose="onClose" @onConfirm="onConfirm" />
|
|
7
|
+
<ControlPopupConfirm
|
|
8
|
+
:visible="show_confirm_sync"
|
|
9
|
+
title="Confirm"
|
|
10
|
+
message="All data will be deleted and replaced with new data. You must be sure that you want to replace all the data with the uploaded Excel file. You should DOWNLOAD the data for BACKUP to ensure safety before synchronization"
|
|
11
|
+
@onClose="onCloseSync"
|
|
12
|
+
@onConfirm="onConfirmSync"
|
|
13
|
+
/>
|
|
14
|
+
<ControlPopupConfirm :visible="show_confirm_upload" title="Confirm" :message="'The data will be added. Make sure COLUMN: ' + upload_key.join(', ') + ' NOT have dupplicate value.'" @onClose="onCloseUpload" @onConfirm="onConfirmUpload" />
|
|
15
|
+
<div class="d-flex justify-content-between mb-2">
|
|
16
|
+
<span>
|
|
17
|
+
<ControlButton v-if="can_add" classes="button button-success button-small" :name="t('Add')" @onClick="onAdd" />
|
|
18
|
+
<ControlButton v-if="can_export" classes="button button-warning button-small" :name="t('Refresh')" @onClick="reloadData" />
|
|
19
|
+
<ControlButton v-if="can_export" classes="button button-light button-small" :name="t('Export')" @onClick="onBtnExportExcel" />
|
|
20
|
+
<ControlButton v-if="can_upload" classes="button button-light button-small" :name="t('Import')" @onClick="onBtnUpload" />
|
|
21
|
+
<ControlButton v-for="item in extra_button" :classes="`button button-${item.type} button-small`" :name="item.name" @onClick="onExtraBtnClick(item.key)" />
|
|
22
|
+
</span>
|
|
23
|
+
<input style="display: none" ref="click_sync_file" id="click_sync_file" type="file" class="form-control input-style" accept="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel" @change="onChooseImg" />
|
|
24
|
+
<input style="display: none" ref="click_upload_file" id="click_upload_file" type="file" class="form-control input-style" accept="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel" @change="onChooseImgUpload" />
|
|
25
|
+
<div style="display: flex; align-items: center; height: 50px">
|
|
26
|
+
<i style="margin-left: 10px" v-if="can_upload" @click="onBtnUpload" class="fas fa-upload"></i>
|
|
27
|
+
<i style="margin-left: 10px" v-if="can_sync" @click="onBtnSync" class="fas fa-sync"></i>
|
|
28
|
+
<input v-if="can_search" type="text" class="form-control" style="width: 250px; height: 30px; margin: 10px 5px 10px 15px; border-radius: 2px" id="filter-text-box" :placeholder="'🔍 ' + t('Type to search')" v-on:input="onFilterTextBoxChanged()" />
|
|
29
|
+
</div>
|
|
30
|
+
</div>
|
|
31
|
+
<div>
|
|
32
|
+
<ag-grid-vue
|
|
33
|
+
:id="id"
|
|
34
|
+
:ref="id"
|
|
35
|
+
class="ag-theme-alpine"
|
|
36
|
+
:pagination="true"
|
|
37
|
+
:paginationPageSize="pagesize"
|
|
38
|
+
:suppressSizeToFit="true"
|
|
39
|
+
:enableCellTextSelection="true"
|
|
40
|
+
@grid-ready="onGridReady"
|
|
41
|
+
@first-data-rendered="onFirstDataRendered"
|
|
42
|
+
:quickFilterMatcher="quickFilterMatcher"
|
|
43
|
+
@cell-clicked="onCellClicked"
|
|
44
|
+
@column-resized="onColumnResized"
|
|
45
|
+
@cellValueChanged="onCellValueChanged"
|
|
46
|
+
@filter-changed="onFilterChanged"
|
|
47
|
+
:defaultColDef="defaultColDef"
|
|
48
|
+
:style="'width: 100%; height: ' + this.calculateGridHeight() + 'px'"
|
|
49
|
+
:rowSelection="'multiple'"
|
|
50
|
+
:columnDefs="columns_computed"
|
|
51
|
+
:rowData="rows"
|
|
52
|
+
:pinnedBottomRowData="pinnedBottomRowData"
|
|
53
|
+
:getRowStyle="getRowStyle"
|
|
54
|
+
>
|
|
55
|
+
</ag-grid-vue>
|
|
56
|
+
</div>
|
|
57
|
+
</div>
|
|
58
|
+
</template>
|
|
59
|
+
<script>
|
|
60
|
+
import "ag-grid-community/styles/ag-grid.css";
|
|
61
|
+
import "ag-grid-community/styles/ag-theme-alpine.css";
|
|
62
|
+
import { AgGridVue } from "ag-grid-vue3";
|
|
63
|
+
|
|
64
|
+
import { v4 as uuidv4 } from "uuid";
|
|
65
|
+
import dayjs from "dayjs";
|
|
66
|
+
import { writeFile, read, utils } from "xlsx";
|
|
67
|
+
|
|
68
|
+
import CustomDropdownEditor from "./CustomDropdownEditor.vue";
|
|
69
|
+
import CustomDropdownEditorEnable from "./CustomDropdownEditorEnable.vue";
|
|
70
|
+
|
|
71
|
+
export default {
|
|
72
|
+
props: {
|
|
73
|
+
height: {
|
|
74
|
+
type: [String, Number],
|
|
75
|
+
default: "600px",
|
|
76
|
+
},
|
|
77
|
+
is_fix_height: {
|
|
78
|
+
type: Boolean,
|
|
79
|
+
default: false,
|
|
80
|
+
},
|
|
81
|
+
rows: {
|
|
82
|
+
type: Array,
|
|
83
|
+
default: [],
|
|
84
|
+
},
|
|
85
|
+
columns: {
|
|
86
|
+
type: Array,
|
|
87
|
+
default: [],
|
|
88
|
+
},
|
|
89
|
+
can_add: {
|
|
90
|
+
type: Boolean,
|
|
91
|
+
default: true,
|
|
92
|
+
},
|
|
93
|
+
can_search: {
|
|
94
|
+
type: Boolean,
|
|
95
|
+
default: true,
|
|
96
|
+
},
|
|
97
|
+
have_checkbox: {
|
|
98
|
+
type: Boolean,
|
|
99
|
+
default: false,
|
|
100
|
+
},
|
|
101
|
+
can_edit: {
|
|
102
|
+
type: Boolean,
|
|
103
|
+
default: true,
|
|
104
|
+
},
|
|
105
|
+
can_delete: {
|
|
106
|
+
type: Boolean,
|
|
107
|
+
default: false,
|
|
108
|
+
},
|
|
109
|
+
can_export: {
|
|
110
|
+
type: Boolean,
|
|
111
|
+
default: true,
|
|
112
|
+
},
|
|
113
|
+
can_refresh: {
|
|
114
|
+
type: Boolean,
|
|
115
|
+
default: true,
|
|
116
|
+
},
|
|
117
|
+
can_sync: {
|
|
118
|
+
type: Boolean,
|
|
119
|
+
default: false,
|
|
120
|
+
},
|
|
121
|
+
can_upload: {
|
|
122
|
+
type: Boolean,
|
|
123
|
+
default: false,
|
|
124
|
+
},
|
|
125
|
+
upload_key: {
|
|
126
|
+
type: Array,
|
|
127
|
+
default: [],
|
|
128
|
+
},
|
|
129
|
+
is_loading: {
|
|
130
|
+
type: Boolean,
|
|
131
|
+
default: false,
|
|
132
|
+
},
|
|
133
|
+
table: {
|
|
134
|
+
type: String,
|
|
135
|
+
default: "",
|
|
136
|
+
},
|
|
137
|
+
table_schema: {
|
|
138
|
+
type: String,
|
|
139
|
+
default: "",
|
|
140
|
+
},
|
|
141
|
+
detail_button_list: {
|
|
142
|
+
type: Array,
|
|
143
|
+
default: [],
|
|
144
|
+
},
|
|
145
|
+
extra_button: {
|
|
146
|
+
type: Array,
|
|
147
|
+
default: [],
|
|
148
|
+
},
|
|
149
|
+
show_total: {
|
|
150
|
+
type: Boolean,
|
|
151
|
+
default: false,
|
|
152
|
+
},
|
|
153
|
+
id: {
|
|
154
|
+
type: String,
|
|
155
|
+
default: () => {
|
|
156
|
+
return uuidv4();
|
|
157
|
+
},
|
|
158
|
+
},
|
|
159
|
+
},
|
|
160
|
+
components: {
|
|
161
|
+
AgGridVue,
|
|
162
|
+
CustomDropdownEditor,
|
|
163
|
+
CustomDropdownEditorEnable,
|
|
164
|
+
},
|
|
165
|
+
computed: {
|
|
166
|
+
columns_computed() {
|
|
167
|
+
let to_return = [];
|
|
168
|
+
if (this.have_checkbox) {
|
|
169
|
+
to_return.push({
|
|
170
|
+
field: "is_check",
|
|
171
|
+
headerName: "",
|
|
172
|
+
headerCheckboxSelection: true,
|
|
173
|
+
checkboxSelection: (params) => params.node.rowPinned !== "bottom",
|
|
174
|
+
showDisabledCheckboxes: true,
|
|
175
|
+
maxWidth: 50,
|
|
176
|
+
});
|
|
177
|
+
}
|
|
178
|
+
if (this.can_edit) {
|
|
179
|
+
to_return.push({
|
|
180
|
+
field: "edit",
|
|
181
|
+
headerName: "",
|
|
182
|
+
cellRenderer: (params) => {
|
|
183
|
+
if (params.node.rowPinned === "bottom") {
|
|
184
|
+
return "";
|
|
185
|
+
}
|
|
186
|
+
return `<span>
|
|
187
|
+
<svg data-action="edit" xmlns="https://www.w3.org/2000/svg" height="1em" viewBox="0 0 576 512"><path d="M402.6 83.2l90.2 90.2c3.8 3.8 3.8 10 0 13.8L274.4 405.6l-92.8 10.3c-12.4 1.4-22.9-9.1-21.5-21.5l10.3-92.8L388.8 83.2c3.8-3.8 10-3.8 13.8 0zm162-22.9l-48.8-48.8c-15.2-15.2-39.9-15.2-55.2 0l-35.4 35.4c-3.8 3.8-3.8 10 0 13.8l90.2 90.2c3.8 3.8 10 3.8 13.8 0l35.4-35.4c15.2-15.3 15.2-40 0-55.2zM384 346.2V448H64V128h229.8c3.2 0 6.2-1.3 8.5-3.5l40-40c7.6-7.6 2.2-20.5-8.5-20.5H48C21.5 64 0 85.5 0 112v352c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48V306.2c0-10.7-12.9-16-20.5-8.5l-40 40c-2.2 2.3-3.5 5.3-3.5 8.5z"/></svg>
|
|
188
|
+
</span>`;
|
|
189
|
+
},
|
|
190
|
+
maxWidth: 55,
|
|
191
|
+
resizable: false,
|
|
192
|
+
filter: false,
|
|
193
|
+
sortable: false,
|
|
194
|
+
});
|
|
195
|
+
}
|
|
196
|
+
for (let i = 0; i < this.detail_button_list.length; i++) {
|
|
197
|
+
to_return.push({
|
|
198
|
+
field: this.detail_button_list[i]["key"],
|
|
199
|
+
headerName: "",
|
|
200
|
+
cellRenderer: (params) => {
|
|
201
|
+
if (params.node.rowPinned === "bottom") {
|
|
202
|
+
return "";
|
|
203
|
+
}
|
|
204
|
+
return `<button type="button" class='btn btn-sm btn-${this.detail_button_list[i]["type"]}'>${this.detail_button_list[i]["name"]}</button>`;
|
|
205
|
+
},
|
|
206
|
+
maxWidth: this.detail_button_list[i]["width"] || 140,
|
|
207
|
+
resizable: false,
|
|
208
|
+
filter: false,
|
|
209
|
+
sortable: false,
|
|
210
|
+
cellClass: "no-padding-cell",
|
|
211
|
+
});
|
|
212
|
+
}
|
|
213
|
+
// Count non-number columns for colSpan in total row
|
|
214
|
+
let nonNumberColCount = 0;
|
|
215
|
+
for (let j = 0; j < this.columns.length; j++) {
|
|
216
|
+
if (this.columns[j].type === "number") break;
|
|
217
|
+
nonNumberColCount++;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
for (let i = 0; i < this.columns.length; i++) {
|
|
221
|
+
this.columns[i]["headerName"] = this.columns[i]["title"];
|
|
222
|
+
const obj = { field: this.columns[i]["key"], headerName: this.columns[i]["title"] };
|
|
223
|
+
|
|
224
|
+
// Add colSpan and cellRenderer to first column for total row
|
|
225
|
+
if (i === 0 && this.show_total && nonNumberColCount > 1) {
|
|
226
|
+
obj["colSpan"] = (params) => {
|
|
227
|
+
if (params.node.rowPinned === "bottom") {
|
|
228
|
+
return nonNumberColCount;
|
|
229
|
+
}
|
|
230
|
+
return 1;
|
|
231
|
+
};
|
|
232
|
+
obj["cellRenderer"] = (params) => {
|
|
233
|
+
if (params.node.rowPinned === "bottom") {
|
|
234
|
+
return "<strong>Total</strong>";
|
|
235
|
+
}
|
|
236
|
+
return params.value;
|
|
237
|
+
};
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
if (this.columns[i]["type"] === "number") {
|
|
241
|
+
obj["filter"] = "agNumberColumnFilter";
|
|
242
|
+
obj["type"] = "numericColumn";
|
|
243
|
+
obj["valueFormatter"] = function (params) {
|
|
244
|
+
if (typeof params.value === "string") {
|
|
245
|
+
return params.value === "" ? "" : params.value;
|
|
246
|
+
}
|
|
247
|
+
if (params.value === null || params.value === undefined || isNaN(params.value)) {
|
|
248
|
+
return "";
|
|
249
|
+
}
|
|
250
|
+
return params.value.toLocaleString();
|
|
251
|
+
};
|
|
252
|
+
obj["valueParser"] = function (params) {
|
|
253
|
+
const newValue = Number(params.newValue);
|
|
254
|
+
if (isNaN(newValue)) {
|
|
255
|
+
alert("Please enter a valid number!");
|
|
256
|
+
return params.oldValue; // Keep the old value if invalid
|
|
257
|
+
}
|
|
258
|
+
return newValue;
|
|
259
|
+
};
|
|
260
|
+
} else if (this.columns[i]["type"] === "date") {
|
|
261
|
+
obj["filter"] = "agDateColumnFilter";
|
|
262
|
+
obj["filterParams"] = {
|
|
263
|
+
comparator: (filterLocalDateAtMidnight, cellValue) => {
|
|
264
|
+
if (!cellValue) return -1;
|
|
265
|
+
const cellDate = dayjs(cellValue, "YYYY-MM-DD").format("YYYY-MM-DD");
|
|
266
|
+
const filterDate = dayjs(filterLocalDateAtMidnight).format("YYYY-MM-DD");
|
|
267
|
+
if (cellDate > filterDate) return 1;
|
|
268
|
+
if (cellDate < filterDate) return -1;
|
|
269
|
+
return 0; // equal
|
|
270
|
+
},
|
|
271
|
+
filterOptions: ["equals", "greaterThanOrEqual", "lessThanOrEqual"],
|
|
272
|
+
};
|
|
273
|
+
obj["valueFormatter"] = this.dateFormatter;
|
|
274
|
+
} else if (this.columns[i]["type"] === "datetime") {
|
|
275
|
+
obj["filter"] = "agDateColumnFilter";
|
|
276
|
+
obj["filterParams"] = {
|
|
277
|
+
comparator: (filterLocalDateAtMidnight, cellValue) => {
|
|
278
|
+
if (!cellValue) return -1;
|
|
279
|
+
const cellDate = dayjs(cellValue, "YYYY-MM-DD HH:mm:ss").format("YYYY-MM-DD");
|
|
280
|
+
const filterDate = dayjs(filterLocalDateAtMidnight).format("YYYY-MM-DD");
|
|
281
|
+
if (cellDate > filterDate) return 1;
|
|
282
|
+
if (cellDate < filterDate) return -1;
|
|
283
|
+
return 0; // equal
|
|
284
|
+
},
|
|
285
|
+
filterOptions: ["equals", "greaterThanOrEqual", "lessThanOrEqual"],
|
|
286
|
+
};
|
|
287
|
+
obj["valueFormatter"] = this.datetimeFormatter;
|
|
288
|
+
} else if (this.columns[i]["type"] === "html") {
|
|
289
|
+
obj["cellRenderer"] = function (params) {
|
|
290
|
+
return params.value;
|
|
291
|
+
};
|
|
292
|
+
} else if (this.columns[i]["type"] === "checkbox") {
|
|
293
|
+
obj["cellEditor"] = "agCheckboxCellEditor";
|
|
294
|
+
obj["cellDataType"] = "boolean";
|
|
295
|
+
} else if (this.columns[i]["type"] === "selectbox") {
|
|
296
|
+
obj["cellEditor"] = "agSelectCellEditor";
|
|
297
|
+
obj["cellEditorParams"] = {
|
|
298
|
+
values: this.columns[i]["selectbox_list"],
|
|
299
|
+
};
|
|
300
|
+
obj["editable"] = true; // this line is commented out
|
|
301
|
+
} else if (this.columns[i]["type"] === "dropdown") {
|
|
302
|
+
obj["cellRendererSelector"] = (params) => {
|
|
303
|
+
if (params.node.rowPinned === "bottom") {
|
|
304
|
+
return { component: () => "" };
|
|
305
|
+
}
|
|
306
|
+
return {
|
|
307
|
+
component: "CustomDropdownEditorEnable",
|
|
308
|
+
params: {
|
|
309
|
+
options: this.columns[i]["dropdown_list"],
|
|
310
|
+
can_edit: this.columns[i]["can_edit"],
|
|
311
|
+
},
|
|
312
|
+
};
|
|
313
|
+
};
|
|
314
|
+
obj["cellClass"] = "dropdown-cell";
|
|
315
|
+
// obj["cellEditor"] = "CustomDropdownEditor";
|
|
316
|
+
// obj["cellEditorParams"] = {
|
|
317
|
+
// options: this.columns[i]["dropdown_list"],
|
|
318
|
+
// };
|
|
319
|
+
} else {
|
|
320
|
+
obj["filter"] = "agTextColumnFilter";
|
|
321
|
+
}
|
|
322
|
+
if (this.columns[i]["width"]) {
|
|
323
|
+
obj["width"] = this.columns[i]["width"];
|
|
324
|
+
}
|
|
325
|
+
if (this.columns[i]["minWidth"]) {
|
|
326
|
+
obj["minWidth"] = this.columns[i]["minWidth"];
|
|
327
|
+
}
|
|
328
|
+
if (this.columns[i]["maxWidth"]) {
|
|
329
|
+
obj["maxWidth"] = this.columns[i]["maxWidth"];
|
|
330
|
+
}
|
|
331
|
+
if (this.columns[i]["editable"]) {
|
|
332
|
+
obj["editable"] = true;
|
|
333
|
+
} else {
|
|
334
|
+
obj["editable"] = false;
|
|
335
|
+
}
|
|
336
|
+
if (this.columns[i]["aggFunc"]) {
|
|
337
|
+
obj["aggFunc"] = this.columns[i]["aggFunc"];
|
|
338
|
+
}
|
|
339
|
+
if (this.columns[i]["suppressAutoSize"]) {
|
|
340
|
+
obj["suppressAutoSize"] = this.columns[i]["suppressAutoSize"];
|
|
341
|
+
}
|
|
342
|
+
if (this.columns[i]["nopadding"]) {
|
|
343
|
+
obj["cellClass"] = "no-padding-cell";
|
|
344
|
+
}
|
|
345
|
+
to_return.push(obj);
|
|
346
|
+
// this.columns[i]["customFilterDropdown"] = true;
|
|
347
|
+
// this.columns[i]["onFilter"] = (value, record) => record[this.columns[i]["key"]].toString().trim().toLowerCase().includes(value.toLowerCase().trim());
|
|
348
|
+
// this.columns[i]["sorter"] = (a, b) => {
|
|
349
|
+
// const valueA = a[this.columns[i]["key"]] ?? 0;
|
|
350
|
+
// const valueB = b[this.columns[i]["key"]] ?? 0;
|
|
351
|
+
// if (typeof valueA === "number" && typeof valueB === "number") {
|
|
352
|
+
// return valueA - valueB;
|
|
353
|
+
// } else {
|
|
354
|
+
// return String(valueA).localeCompare(String(valueB));
|
|
355
|
+
// }
|
|
356
|
+
// };
|
|
357
|
+
}
|
|
358
|
+
if (this.can_delete) {
|
|
359
|
+
to_return.push({
|
|
360
|
+
field: "delete",
|
|
361
|
+
headerName: "",
|
|
362
|
+
cellRenderer: (params) => {
|
|
363
|
+
if (params.node.rowPinned === "bottom") {
|
|
364
|
+
return "";
|
|
365
|
+
}
|
|
366
|
+
return `<span>
|
|
367
|
+
<svg data-action="delete" xmlns="http://www.w3.org/2000/svg" height="1em" viewBox="0 0 448 512"><path d="M135.2 17.7L128 32H32C14.3 32 0 46.3 0 64S14.3 96 32 96H416c17.7 0 32-14.3 32-32s-14.3-32-32-32H320l-7.2-14.3C307.4 6.8 296.3 0 284.2 0H163.8c-12.1 0-23.2 6.8-28.6 17.7zM416 128H32L53.2 467c1.6 25.3 22.6 45 47.9 45H346.9c25.3 0 46.3-19.7 47.9-45L416 128z"/></svg>
|
|
368
|
+
</span>`;
|
|
369
|
+
},
|
|
370
|
+
maxWidth: 55,
|
|
371
|
+
resizable: false,
|
|
372
|
+
filter: false,
|
|
373
|
+
sortable: false,
|
|
374
|
+
});
|
|
375
|
+
}
|
|
376
|
+
return to_return;
|
|
377
|
+
},
|
|
378
|
+
pinnedBottomRowData() {
|
|
379
|
+
if (!this.show_total || !this.rows || this.rows.length === 0) {
|
|
380
|
+
return [];
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
const totalRow = { _isTotalRow: true };
|
|
384
|
+
|
|
385
|
+
// Put "Total" in the first column
|
|
386
|
+
if (this.columns.length > 0) {
|
|
387
|
+
totalRow[this.columns[0].key] = "Total";
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
// Calculate sums for numeric columns
|
|
391
|
+
for (const col of this.columns) {
|
|
392
|
+
if (col.type === "number") {
|
|
393
|
+
let sum = 0;
|
|
394
|
+
for (const row of this.rows) {
|
|
395
|
+
const value = row[col.key];
|
|
396
|
+
if (typeof value === "number" && !isNaN(value)) {
|
|
397
|
+
sum += value;
|
|
398
|
+
}
|
|
399
|
+
}
|
|
400
|
+
totalRow[col.key] = sum;
|
|
401
|
+
}
|
|
402
|
+
}
|
|
403
|
+
|
|
404
|
+
return [totalRow];
|
|
405
|
+
},
|
|
406
|
+
},
|
|
407
|
+
setup() {
|
|
408
|
+
const myGrid = ref(null);
|
|
409
|
+
return {
|
|
410
|
+
myGrid,
|
|
411
|
+
columnDefs: [],
|
|
412
|
+
defaultColDef: {
|
|
413
|
+
flex: 1,
|
|
414
|
+
minWidth: 100,
|
|
415
|
+
width: 100,
|
|
416
|
+
sortable: true,
|
|
417
|
+
resizable: true,
|
|
418
|
+
filter: true,
|
|
419
|
+
},
|
|
420
|
+
rowSelection: null,
|
|
421
|
+
};
|
|
422
|
+
},
|
|
423
|
+
data() {
|
|
424
|
+
return {
|
|
425
|
+
gridApi: null,
|
|
426
|
+
gridColumnApi: null,
|
|
427
|
+
show_confirm_delete: false,
|
|
428
|
+
show_confirm_sync: false,
|
|
429
|
+
show_confirm_upload: false,
|
|
430
|
+
to_delete_obj: {},
|
|
431
|
+
to_delete_row_index: {},
|
|
432
|
+
pagesize: 20,
|
|
433
|
+
pageSizes: [10, 20, 50, 100],
|
|
434
|
+
rowHeight: 42,
|
|
435
|
+
};
|
|
436
|
+
},
|
|
437
|
+
methods: {
|
|
438
|
+
getRowStyle(params) {
|
|
439
|
+
if (params.node.rowPinned === "bottom") {
|
|
440
|
+
return {
|
|
441
|
+
fontWeight: "bold",
|
|
442
|
+
backgroundColor: "#f5f5f5",
|
|
443
|
+
borderTop: "2px solid #ddd",
|
|
444
|
+
};
|
|
445
|
+
}
|
|
446
|
+
return null;
|
|
447
|
+
},
|
|
448
|
+
onBtnUpload() {
|
|
449
|
+
this.show_confirm_upload = true;
|
|
450
|
+
},
|
|
451
|
+
onCloseUpload() {
|
|
452
|
+
this.show_confirm_upload = false;
|
|
453
|
+
},
|
|
454
|
+
onConfirmUpload() {
|
|
455
|
+
this.show_confirm_upload = false;
|
|
456
|
+
$("#click_upload_file").click();
|
|
457
|
+
},
|
|
458
|
+
onChooseImgUpload(e) {
|
|
459
|
+
let attFiles = e.target.files;
|
|
460
|
+
let arr = Array.from(attFiles);
|
|
461
|
+
this.readExcelUpload(arr[0]);
|
|
462
|
+
this.$refs.click_upload_file.value = "";
|
|
463
|
+
},
|
|
464
|
+
async readExcelUpload(file) {
|
|
465
|
+
const fileReader = await new FileReader();
|
|
466
|
+
fileReader.readAsArrayBuffer(file);
|
|
467
|
+
|
|
468
|
+
fileReader.onload = (e) => {
|
|
469
|
+
const bufferArray = e?.target.result;
|
|
470
|
+
const wb = read(bufferArray, { type: "buffer" });
|
|
471
|
+
const wsname = wb.SheetNames[0];
|
|
472
|
+
const ws = wb.Sheets[wsname];
|
|
473
|
+
const columnsArrayFromXlsx = utils.sheet_to_json(ws, { header: 1 })[0];
|
|
474
|
+
const colArrayWeb = this.columns.map((obj) => obj.title);
|
|
475
|
+
for (let i = 0; i < columnsArrayFromXlsx.length; i++) {
|
|
476
|
+
if (!colArrayWeb.includes(columnsArrayFromXlsx[i])) {
|
|
477
|
+
show_message("error", "File có tên cột " + columnsArrayFromXlsx[i] + " không đúng với web");
|
|
478
|
+
return true;
|
|
479
|
+
}
|
|
480
|
+
}
|
|
481
|
+
let renameObj = {};
|
|
482
|
+
for (let i = 0; i < this.columns.length; i++) {
|
|
483
|
+
renameObj[this.columns[i].title] = this.columns[i].key;
|
|
484
|
+
}
|
|
485
|
+
const data = utils.sheet_to_json(ws);
|
|
486
|
+
if (check_is_null_or_blank(data)) {
|
|
487
|
+
show_message("error", "File không có dữ liệu");
|
|
488
|
+
return true;
|
|
489
|
+
}
|
|
490
|
+
const updatedArr = data.map((item) => {
|
|
491
|
+
const newItem = {};
|
|
492
|
+
for (const key in item) {
|
|
493
|
+
const newKey = renameObj[key] || key; // use mapped key or keep original
|
|
494
|
+
newItem[newKey] = item[key];
|
|
495
|
+
}
|
|
496
|
+
return newItem;
|
|
497
|
+
});
|
|
498
|
+
this.uploadDataToServer(updatedArr);
|
|
499
|
+
};
|
|
500
|
+
},
|
|
501
|
+
async uploadDataToServer(uploadData) {
|
|
502
|
+
let data = {
|
|
503
|
+
schema: this.table_schema,
|
|
504
|
+
table: this.table,
|
|
505
|
+
data: uploadData,
|
|
506
|
+
key: this.upload_key,
|
|
507
|
+
};
|
|
508
|
+
let resp = await request("/upload_more_data", data);
|
|
509
|
+
if (resp.success) {
|
|
510
|
+
show_message("success", "Upload success");
|
|
511
|
+
} else {
|
|
512
|
+
show_message("error", "Upload problem, please check excel file and try again");
|
|
513
|
+
}
|
|
514
|
+
await this.reloadData();
|
|
515
|
+
},
|
|
516
|
+
onBtnSync() {
|
|
517
|
+
this.show_confirm_sync = true;
|
|
518
|
+
},
|
|
519
|
+
onCloseSync() {
|
|
520
|
+
this.show_confirm_sync = false;
|
|
521
|
+
},
|
|
522
|
+
onConfirmSync() {
|
|
523
|
+
this.show_confirm_sync = false;
|
|
524
|
+
$("#click_sync_file").click();
|
|
525
|
+
},
|
|
526
|
+
onChooseImg(e) {
|
|
527
|
+
this.attFiles = e.target.files;
|
|
528
|
+
let tmp = [];
|
|
529
|
+
let arr = Array.from(this.attFiles);
|
|
530
|
+
this.readExcel(arr[0]);
|
|
531
|
+
this.$refs.click_sync_file.value = "";
|
|
532
|
+
},
|
|
533
|
+
async readExcel(file) {
|
|
534
|
+
const fileReader = await new FileReader();
|
|
535
|
+
fileReader.readAsArrayBuffer(file);
|
|
536
|
+
|
|
537
|
+
fileReader.onload = (e) => {
|
|
538
|
+
const bufferArray = e?.target.result;
|
|
539
|
+
const wb = read(bufferArray, { type: "buffer" });
|
|
540
|
+
const wsname = wb.SheetNames[0];
|
|
541
|
+
const ws = wb.Sheets[wsname];
|
|
542
|
+
|
|
543
|
+
const columnsArrayFromXlsx = utils.sheet_to_json(ws, { header: 1 })[0];
|
|
544
|
+
const colArrayWeb = this.columns.map((obj) => obj.key);
|
|
545
|
+
// if (columnsArrayFromXlsx.length !== colArrayWeb.length) {
|
|
546
|
+
// show_message("File có số cột không đúng với web", "error");
|
|
547
|
+
// return true;
|
|
548
|
+
// }
|
|
549
|
+
for (let i = 0; i < columnsArrayFromXlsx.length; i++) {
|
|
550
|
+
if (!colArrayWeb.includes(columnsArrayFromXlsx[i])) {
|
|
551
|
+
show_message("File có tên cột " + columnsArrayFromXlsx[i] + " không đúng với web", "error");
|
|
552
|
+
return true;
|
|
553
|
+
}
|
|
554
|
+
}
|
|
555
|
+
|
|
556
|
+
const data = utils.sheet_to_json(ws);
|
|
557
|
+
if (check_is_null_or_blank(data)) {
|
|
558
|
+
show_message("File không có dữ liệu", "error");
|
|
559
|
+
return true;
|
|
560
|
+
}
|
|
561
|
+
this.syncDataToServer(data);
|
|
562
|
+
};
|
|
563
|
+
},
|
|
564
|
+
async syncDataToServer(syncData) {
|
|
565
|
+
let data = {
|
|
566
|
+
schema: this.table_schema,
|
|
567
|
+
table: this.table,
|
|
568
|
+
data: syncData,
|
|
569
|
+
};
|
|
570
|
+
await request("/sync", data);
|
|
571
|
+
await this.reloadData();
|
|
572
|
+
},
|
|
573
|
+
onExtraBtnClick(key) {
|
|
574
|
+
this.$emit("onExtraBtnClick", key);
|
|
575
|
+
if (this.have_checkbox) {
|
|
576
|
+
this.getSelectedRows(key);
|
|
577
|
+
}
|
|
578
|
+
},
|
|
579
|
+
getSelectedRows(key) {
|
|
580
|
+
let selectedRows = this.gridApi.getSelectedRows();
|
|
581
|
+
this.$emit("getSelectedRows", key, selectedRows);
|
|
582
|
+
},
|
|
583
|
+
onFilterChanged() {
|
|
584
|
+
const filterModel = this.gridApi.getFilterModel();
|
|
585
|
+
setSession(this.$route.path + "agGridFilterModel", JSON.stringify(filterModel));
|
|
586
|
+
},
|
|
587
|
+
async onGridReady(params) {
|
|
588
|
+
this.gridApi = params.api;
|
|
589
|
+
this.gridColumnApi = params.columnApi;
|
|
590
|
+
this.gridApi.showLoadingOverlay();
|
|
591
|
+
const savedFilterModel = getSession(this.$route.path + "agGridFilterModel");
|
|
592
|
+
if (savedFilterModel) {
|
|
593
|
+
this.gridApi.setFilterModel(JSON.parse(savedFilterModel));
|
|
594
|
+
}
|
|
595
|
+
},
|
|
596
|
+
async onFirstDataRendered() {
|
|
597
|
+
// console.log("after run first data");
|
|
598
|
+
const agPagination = document.querySelector("#" + this.id + " .ag-paging-panel");
|
|
599
|
+
// check if the select box already exists
|
|
600
|
+
if (agPagination.querySelector(".custom-pagination-controls")) {
|
|
601
|
+
return;
|
|
602
|
+
}
|
|
603
|
+
const selectBox = document.createElement("div");
|
|
604
|
+
selectBox.classList.add("custom-pagination-controls");
|
|
605
|
+
selectBox.innerHTML = `
|
|
606
|
+
<label for="page-size" style="margin-right: 5px; font-weight: bold">${t("Rows")}:</label>
|
|
607
|
+
<select id="page-size">
|
|
608
|
+
${this.pageSizes.map((size) => `<option value="${size}" ${size === this.pagesize ? "selected" : ""}>${size}</option>`).join("")}
|
|
609
|
+
</select>
|
|
610
|
+
`;
|
|
611
|
+
// append child to the left
|
|
612
|
+
agPagination.insertBefore(selectBox, agPagination.firstChild);
|
|
613
|
+
// agPagination.appendChild(selectBox);
|
|
614
|
+
|
|
615
|
+
// Add event listener for the select box
|
|
616
|
+
selectBox.querySelector("select").addEventListener("change", this.onPageSizeChanged);
|
|
617
|
+
// setTimeout(() => {
|
|
618
|
+
// this.autoSizeAll(true);
|
|
619
|
+
// }, 1000);
|
|
620
|
+
},
|
|
621
|
+
onPageSizeChanged(event) {
|
|
622
|
+
this.gridApi.paginationSetPageSize(Number(event.target.value));
|
|
623
|
+
this.pagesize = Number(event.target.value);
|
|
624
|
+
},
|
|
625
|
+
calculateGridHeight() {
|
|
626
|
+
const headerHeight = 49; // Adjust based on your grid header height
|
|
627
|
+
const paginationHeight = 50; // Adjust based on your pagination controls height
|
|
628
|
+
const horizontal_height = 15;
|
|
629
|
+
const total_height = headerHeight + paginationHeight + +horizontal_height;
|
|
630
|
+
if (this.is_fix_height) {
|
|
631
|
+
return parseInt(this.height);
|
|
632
|
+
} else {
|
|
633
|
+
if (this.rows.length < this.pagesize) {
|
|
634
|
+
if (this.rows.length === 0) {
|
|
635
|
+
return total_height + 70;
|
|
636
|
+
}
|
|
637
|
+
return total_height + this.rows.length * this.rowHeight;
|
|
638
|
+
}
|
|
639
|
+
return total_height + this.pagesize * this.rowHeight;
|
|
640
|
+
}
|
|
641
|
+
},
|
|
642
|
+
async onColumnResized() {
|
|
643
|
+
// await this.autoSizeAll(true);
|
|
644
|
+
},
|
|
645
|
+
async autoSizeAll(skipHeader) {
|
|
646
|
+
// console.log(skipHeader)
|
|
647
|
+
// if (this.gridColumnApi == null) return;
|
|
648
|
+
// if (this.columns.length > 10) {
|
|
649
|
+
// this.gridColumnApi.autoSizeAllColumns(skipHeader);
|
|
650
|
+
// }
|
|
651
|
+
},
|
|
652
|
+
onFilterTextBoxChanged() {
|
|
653
|
+
this.gridApi.setQuickFilter(bodautiengviet(document.getElementById("filter-text-box").value));
|
|
654
|
+
},
|
|
655
|
+
quickFilterMatcher(quickFilterParts, rowQuickFilterAggregateText) {
|
|
656
|
+
return quickFilterParts.every((part) => {
|
|
657
|
+
return bodautiengviet(rowQuickFilterAggregateText).toUpperCase().match(part.toUpperCase());
|
|
658
|
+
});
|
|
659
|
+
},
|
|
660
|
+
onCellValueChanged(e) {
|
|
661
|
+
this.$emit("onCellValueChanged", e);
|
|
662
|
+
},
|
|
663
|
+
onBtExport() {
|
|
664
|
+
this.gridApi.exportDataAsCsv();
|
|
665
|
+
},
|
|
666
|
+
getColumnTitle(key) {
|
|
667
|
+
for (let i = 0; i < this.columns.length; i++) {
|
|
668
|
+
if (this.columns[i].key === key) {
|
|
669
|
+
return this.columns[i].title;
|
|
670
|
+
}
|
|
671
|
+
}
|
|
672
|
+
return "";
|
|
673
|
+
},
|
|
674
|
+
removeHTMLTags(str) {
|
|
675
|
+
if (str && str.replace) {
|
|
676
|
+
return str.replace(/<[^>]*>/g, "");
|
|
677
|
+
}
|
|
678
|
+
return str;
|
|
679
|
+
},
|
|
680
|
+
filterArrayToExport(toFilter, attributesToKeep) {
|
|
681
|
+
let filteredArray = toFilter.map((obj) => {
|
|
682
|
+
let filteredObj = {};
|
|
683
|
+
// Use the order from this.columns to maintain consistency
|
|
684
|
+
for (let i = 0; i < this.columns.length; i++) {
|
|
685
|
+
const column = this.columns[i];
|
|
686
|
+
const key = column.key;
|
|
687
|
+
const title = column.title;
|
|
688
|
+
|
|
689
|
+
if (obj.hasOwnProperty(key) && title !== "") {
|
|
690
|
+
filteredObj[title] = this.removeHTMLTags(obj[key]);
|
|
691
|
+
}
|
|
692
|
+
}
|
|
693
|
+
return filteredObj;
|
|
694
|
+
});
|
|
695
|
+
return filteredArray;
|
|
696
|
+
},
|
|
697
|
+
onBtnExportExcel() {
|
|
698
|
+
let col_lst = this.columns.map((obj) => obj.key);
|
|
699
|
+
let to_export = this.filterArrayToExport(this.rows, col_lst);
|
|
700
|
+
// Create workbook & worksheet
|
|
701
|
+
const fileName = "export.xlsx";
|
|
702
|
+
const workbook = utils.book_new();
|
|
703
|
+
const worksheet = utils.json_to_sheet(to_export);
|
|
704
|
+
utils.book_append_sheet(workbook, worksheet, "Data");
|
|
705
|
+
writeFile(workbook, fileName);
|
|
706
|
+
},
|
|
707
|
+
onAdd() {
|
|
708
|
+
this.$emit("onAdd");
|
|
709
|
+
},
|
|
710
|
+
onClose() {
|
|
711
|
+
this.show_confirm_delete = false;
|
|
712
|
+
},
|
|
713
|
+
resetSearchBox() {
|
|
714
|
+
$("#filter-text-box").val("");
|
|
715
|
+
this.onFilterTextBoxChanged();
|
|
716
|
+
},
|
|
717
|
+
async reloadData() {
|
|
718
|
+
this.$emit("reloadData");
|
|
719
|
+
},
|
|
720
|
+
async onConfirm() {
|
|
721
|
+
this.$emit("onDeleteRowIndex", this.to_delete_row_index);
|
|
722
|
+
let data = {};
|
|
723
|
+
data["id_" + this.table] = this.to_delete_obj["id_" + this.table];
|
|
724
|
+
data["schema"] = this.table_schema;
|
|
725
|
+
data["table"] = this.table;
|
|
726
|
+
await request("/hard_delete", data);
|
|
727
|
+
await this.reloadData();
|
|
728
|
+
this.onClose();
|
|
729
|
+
},
|
|
730
|
+
onCellClicked(params) {
|
|
731
|
+
if (params.column.colId === "edit") {
|
|
732
|
+
this.$emit("onClickDetail", params.data);
|
|
733
|
+
return;
|
|
734
|
+
}
|
|
735
|
+
if (params.column.colId === "delete") {
|
|
736
|
+
this.to_delete_obj = params.data;
|
|
737
|
+
this.to_delete_row_index = params.rowIndex;
|
|
738
|
+
this.show_confirm_delete = true;
|
|
739
|
+
return;
|
|
740
|
+
}
|
|
741
|
+
for (let i = 0; i < this.detail_button_list.length; i++) {
|
|
742
|
+
if (params.column.colId === this.detail_button_list[i]["key"]) {
|
|
743
|
+
this.$emit("onExtraDetailBtnClick", this.detail_button_list[i]["key"], params.data);
|
|
744
|
+
return;
|
|
745
|
+
}
|
|
746
|
+
}
|
|
747
|
+
},
|
|
748
|
+
dateFormatter(params) {
|
|
749
|
+
if (dayjs(params.value).isValid()) {
|
|
750
|
+
return dayjs(params.value).format("DD-MM-YYYY");
|
|
751
|
+
} else {
|
|
752
|
+
return "";
|
|
753
|
+
}
|
|
754
|
+
},
|
|
755
|
+
datetimeFormatter(params) {
|
|
756
|
+
if (dayjs(params.value).isValid()) {
|
|
757
|
+
return dayjs(params.value).format("DD-MM-YYYY HH:mm:ss");
|
|
758
|
+
} else {
|
|
759
|
+
return "";
|
|
760
|
+
}
|
|
761
|
+
},
|
|
762
|
+
},
|
|
763
|
+
mounted() {
|
|
764
|
+
this.onFirstDataRendered();
|
|
765
|
+
},
|
|
766
|
+
watch: {
|
|
767
|
+
is_loading: {
|
|
768
|
+
async handler(newVal, oldVal) {
|
|
769
|
+
if (newVal) {
|
|
770
|
+
this.gridApi.showLoadingOverlay();
|
|
771
|
+
} else {
|
|
772
|
+
this.gridApi.hideOverlay();
|
|
773
|
+
}
|
|
774
|
+
},
|
|
775
|
+
deep: true,
|
|
776
|
+
},
|
|
777
|
+
},
|
|
778
|
+
};
|
|
779
|
+
</script>
|
|
780
|
+
<style>
|
|
781
|
+
.ag-icon-filter {
|
|
782
|
+
color: red;
|
|
783
|
+
}
|
|
784
|
+
.no-padding-cell {
|
|
785
|
+
padding-left: 0 !important;
|
|
786
|
+
padding-right: 0 !important;
|
|
787
|
+
}
|
|
788
|
+
.ag-header-cell,
|
|
789
|
+
.ag-header-group-cell {
|
|
790
|
+
padding-left: 2px;
|
|
791
|
+
padding-right: 2px;
|
|
792
|
+
}
|
|
793
|
+
.ag-header-cell-label,
|
|
794
|
+
.ag-header-group-cell-label {
|
|
795
|
+
align-items: center;
|
|
796
|
+
align-self: stretch;
|
|
797
|
+
display: flex;
|
|
798
|
+
flex: 1 1 auto;
|
|
799
|
+
overflow: hidden;
|
|
800
|
+
text-overflow: ellipsis;
|
|
801
|
+
display: flex;
|
|
802
|
+
justify-content: center;
|
|
803
|
+
align-items: center;
|
|
804
|
+
text-align: center;
|
|
805
|
+
}
|
|
806
|
+
</style>
|