@seniorsistemas/angular-components 14.9.14 → 14.10.0
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/angular-components.module.d.ts +2 -1
- package/bundles/seniorsistemas-angular-components.umd.js +1837 -22
- package/bundles/seniorsistemas-angular-components.umd.js.map +1 -1
- package/bundles/seniorsistemas-angular-components.umd.min.js +2 -2
- package/bundles/seniorsistemas-angular-components.umd.min.js.map +1 -1
- package/components/code-editor/core/facades/core-facade.d.ts +30 -0
- package/components/code-editor/core/facades/linter-facade.d.ts +4 -0
- package/components/code-editor/core/models/enums/marker-severity.d.ts +5 -0
- package/components/code-editor/core/models/index.d.ts +2 -0
- package/components/code-editor/core/models/interfaces/marker.d.ts +7 -0
- package/components/code-editor/core/use-cases/core-linters.d.ts +6 -0
- package/components/code-editor/index.d.ts +3 -0
- package/components/code-editor/infra/cores/codemirror-6/codemirror-6-core.d.ts +25 -0
- package/components/code-editor/infra/cores/codemirror-6/languages/editor-languages.d.ts +6 -0
- package/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/extensions/autocomplete/autocomplete-states/autocomplete-empty-state.d.ts +10 -0
- package/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/extensions/autocomplete/autocomplete-states/autocomplete-loading-state.d.ts +10 -0
- package/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/extensions/autocomplete/autocomplete-states/autocomplete-state-wrapper/autocomplete-state-wrapper-style.d.ts +6 -0
- package/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/extensions/autocomplete/autocomplete-states/autocomplete-state-wrapper/autocomplete-state-wrapper.d.ts +15 -0
- package/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/extensions/autocomplete/autocomplete-states/index.d.ts +3 -0
- package/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/extensions/autocomplete/autocomplete-style.d.ts +6 -0
- package/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/extensions/autocomplete/autocomplete.d.ts +6 -0
- package/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/extensions/autocomplete/autocomplete.service.d.ts +8 -0
- package/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/extensions/base-configs/base-configs.d.ts +2 -0
- package/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/extensions/base-configs/grammar.d.ts +2 -0
- package/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/extensions/on-paste-completion-items-updater/models/index.d.ts +1 -0
- package/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/extensions/on-paste-completion-items-updater/models/interfaces/request-extra-info.d.ts +4 -0
- package/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/extensions/on-paste-completion-items-updater/on-paste-completion-items-updater.d.ts +6 -0
- package/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/models/enums/completion-types.d.ts +8 -0
- package/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/models/enums/enum-type-order.d.ts +4 -0
- package/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/models/enums/keywords.d.ts +10 -0
- package/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/models/enums/meta-type.d.ts +17 -0
- package/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/models/enums/request-types.d.ts +6 -0
- package/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/models/index.d.ts +19 -0
- package/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/models/interfaces/completion-Item.d.ts +6 -0
- package/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/models/interfaces/facade-metadata-name.d.ts +5 -0
- package/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/models/interfaces/fields-order-by.d.ts +5 -0
- package/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/models/interfaces/get-facade-metadata-by-path.d.ts +9 -0
- package/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/models/interfaces/list-context-metadata-by-id.d.ts +9 -0
- package/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/models/interfaces/list-expression-metadata.d.ts +11 -0
- package/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/models/interfaces/list-facade-metadata-names.d.ts +10 -0
- package/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/models/interfaces/rec-expression-metadata.d.ts +10 -0
- package/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/models/interfaces/rec-front-context-metadata.d.ts +4 -0
- package/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/models/interfaces/rec-front-facade-metadata.d.ts +8 -0
- package/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/models/interfaces/rec-front-field-metadata.d.ts +7 -0
- package/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/models/interfaces/rec-page-request.d.ts +6 -0
- package/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/models/interfaces/safe-http-communication.d.ts +12 -0
- package/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/models/interfaces/tax-calculation-configs.d.ts +4 -0
- package/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/tax-calculation-language-configs.d.ts +7 -0
- package/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/tax-calculation.language.d.ts +2 -0
- package/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/utils/get-language-configs.d.ts +6 -0
- package/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/utils/get-safe-response.d.ts +8 -0
- package/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/utils/index.d.ts +3 -0
- package/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/utils/update-core-completion-items.d.ts +2 -0
- package/components/code-editor/infra/cores/codemirror-6/models/index.d.ts +2 -0
- package/components/code-editor/infra/cores/codemirror-6/models/types/diagnostic-severity.d.ts +1 -0
- package/components/code-editor/infra/cores/codemirror-6/models/types/editor-theme.d.ts +3 -0
- package/components/code-editor/infra/cores/codemirror-6/themes/editor-themes.d.ts +6 -0
- package/components/code-editor/infra/cores/codemirror-6/themes/sds-light/extensions/autocomplete-tooltip.d.ts +6 -0
- package/components/code-editor/infra/cores/codemirror-6/themes/sds-light/extensions/font-style.d.ts +6 -0
- package/components/code-editor/infra/cores/codemirror-6/themes/sds-light/extensions/line-counter.d.ts +6 -0
- package/components/code-editor/infra/cores/codemirror-6/themes/sds-light/extensions/scrollbars.d.ts +6 -0
- package/components/code-editor/infra/cores/codemirror-6/themes/sds-light/sds-light-highlight-style.d.ts +2 -0
- package/components/code-editor/infra/cores/codemirror-6/themes/sds-light/sds-light-style.d.ts +6 -0
- package/components/code-editor/infra/cores/codemirror-6/themes/sds-light/sds-light-theme.d.ts +2 -0
- package/components/code-editor/infra/cores/codemirror-6/utils/convert-markers-to-diagnostics.d.ts +3 -0
- package/components/code-editor/infra/cores/codemirror-6/utils/index.d.ts +2 -0
- package/components/code-editor/infra/cores/codemirror-6/utils/is-current-position-inside-string.d.ts +1 -0
- package/components/code-editor/infra/linters/tax-calculation/models/index.d.ts +1 -0
- package/components/code-editor/infra/linters/tax-calculation/models/interfaces/validation.d.ts +4 -0
- package/components/code-editor/infra/linters/tax-calculation/tax-calculation-linter.d.ts +11 -0
- package/components/code-editor/infra/linters/tax-calculation/validation-compositors/index.d.ts +2 -0
- package/components/code-editor/infra/linters/tax-calculation/validation-compositors/validation-composite.d.ts +6 -0
- package/components/code-editor/infra/linters/tax-calculation/validation-compositors/validation-workers-compositor/validations-workers-composite.d.ts +6 -0
- package/components/code-editor/infra/utils/custom-http-client/custom-http-client.d.ts +34 -0
- package/components/code-editor/infra/utils/custom-http-client/json-response-formatters/format-blob-response.d.ts +6 -0
- package/components/code-editor/infra/utils/custom-http-client/json-response-formatters/format-json-response.d.ts +6 -0
- package/components/code-editor/infra/utils/custom-http-client/json-response-formatters/index.d.ts +2 -0
- package/components/code-editor/infra/utils/custom-translations/custom-translations-service.d.ts +25 -0
- package/components/code-editor/infra/utils/custom-translations/custom-translations.module.d.ts +12 -0
- package/components/code-editor/infra/utils/custom-translations/index.d.ts +2 -0
- package/components/code-editor/infra/utils/custom-translations/models/index.d.ts +1 -0
- package/components/code-editor/infra/utils/custom-translations/models/interfaces/translations.d.ts +5 -0
- package/components/code-editor/infra/utils/index.d.ts +3 -0
- package/components/code-editor/infra/utils/regex-index-of.d.ts +8 -0
- package/components/code-editor/models/enums/languages.d.ts +3 -0
- package/components/code-editor/models/enums/themes.d.ts +3 -0
- package/components/code-editor/models/index.d.ts +3 -0
- package/components/code-editor/models/interfaces/editor-options.d.ts +5 -0
- package/components/code-editor/presentation/code-editor-component.d.ts +21 -0
- package/components/code-editor/presentation/code-editor-module.d.ts +2 -0
- package/esm2015/angular-components.module.js +4 -3
- package/esm2015/components/code-editor/core/facades/core-facade.js +80 -0
- package/esm2015/components/code-editor/core/facades/linter-facade.js +1 -0
- package/esm2015/components/code-editor/core/models/enums/marker-severity.js +7 -0
- package/esm2015/components/code-editor/core/models/index.js +3 -0
- package/esm2015/components/code-editor/core/models/interfaces/marker.js +1 -0
- package/esm2015/components/code-editor/core/use-cases/core-linters.js +12 -0
- package/esm2015/components/code-editor/index.js +5 -0
- package/esm2015/components/code-editor/infra/cores/codemirror-6/codemirror-6-core.js +94 -0
- package/esm2015/components/code-editor/infra/cores/codemirror-6/languages/editor-languages.js +12 -0
- package/esm2015/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/extensions/autocomplete/autocomplete-states/autocomplete-empty-state.js +29 -0
- package/esm2015/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/extensions/autocomplete/autocomplete-states/autocomplete-loading-state.js +29 -0
- package/esm2015/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/extensions/autocomplete/autocomplete-states/autocomplete-state-wrapper/autocomplete-state-wrapper-style.js +17 -0
- package/esm2015/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/extensions/autocomplete/autocomplete-states/autocomplete-state-wrapper/autocomplete-state-wrapper.js +75 -0
- package/esm2015/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/extensions/autocomplete/autocomplete-states/index.js +4 -0
- package/esm2015/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/extensions/autocomplete/autocomplete-style.js +35 -0
- package/esm2015/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/extensions/autocomplete/autocomplete.js +342 -0
- package/esm2015/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/extensions/autocomplete/autocomplete.service.js +34 -0
- package/esm2015/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/extensions/base-configs/base-configs.js +18 -0
- package/esm2015/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/extensions/base-configs/grammar.js +37 -0
- package/esm2015/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/extensions/on-paste-completion-items-updater/models/index.js +1 -0
- package/esm2015/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/extensions/on-paste-completion-items-updater/models/interfaces/request-extra-info.js +1 -0
- package/esm2015/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/extensions/on-paste-completion-items-updater/on-paste-completion-items-updater.js +164 -0
- package/esm2015/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/models/enums/completion-types.js +10 -0
- package/esm2015/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/models/enums/enum-type-order.js +8 -0
- package/esm2015/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/models/enums/keywords.js +12 -0
- package/esm2015/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/models/enums/meta-type.js +34 -0
- package/esm2015/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/models/enums/request-types.js +8 -0
- package/esm2015/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/models/index.js +7 -0
- package/esm2015/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/models/interfaces/completion-Item.js +1 -0
- package/esm2015/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/models/interfaces/facade-metadata-name.js +1 -0
- package/esm2015/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/models/interfaces/fields-order-by.js +1 -0
- package/esm2015/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/models/interfaces/get-facade-metadata-by-path.js +1 -0
- package/esm2015/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/models/interfaces/list-context-metadata-by-id.js +1 -0
- package/esm2015/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/models/interfaces/list-expression-metadata.js +1 -0
- package/esm2015/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/models/interfaces/list-facade-metadata-names.js +1 -0
- package/esm2015/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/models/interfaces/rec-expression-metadata.js +1 -0
- package/esm2015/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/models/interfaces/rec-front-context-metadata.js +1 -0
- package/esm2015/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/models/interfaces/rec-front-facade-metadata.js +1 -0
- package/esm2015/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/models/interfaces/rec-front-field-metadata.js +1 -0
- package/esm2015/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/models/interfaces/rec-page-request.js +1 -0
- package/esm2015/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/models/interfaces/safe-http-communication.js +1 -0
- package/esm2015/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/models/interfaces/tax-calculation-configs.js +1 -0
- package/esm2015/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/tax-calculation-language-configs.js +10 -0
- package/esm2015/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/tax-calculation.language.js +11 -0
- package/esm2015/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/utils/get-language-configs.js +15 -0
- package/esm2015/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/utils/get-safe-response.js +16 -0
- package/esm2015/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/utils/index.js +4 -0
- package/esm2015/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/utils/update-core-completion-items.js +30 -0
- package/esm2015/components/code-editor/infra/cores/codemirror-6/models/index.js +1 -0
- package/esm2015/components/code-editor/infra/cores/codemirror-6/models/types/diagnostic-severity.js +1 -0
- package/esm2015/components/code-editor/infra/cores/codemirror-6/models/types/editor-theme.js +1 -0
- package/esm2015/components/code-editor/infra/cores/codemirror-6/themes/editor-themes.js +12 -0
- package/esm2015/components/code-editor/infra/cores/codemirror-6/themes/sds-light/extensions/autocomplete-tooltip.js +61 -0
- package/esm2015/components/code-editor/infra/cores/codemirror-6/themes/sds-light/extensions/font-style.js +29 -0
- package/esm2015/components/code-editor/infra/cores/codemirror-6/themes/sds-light/extensions/line-counter.js +25 -0
- package/esm2015/components/code-editor/infra/cores/codemirror-6/themes/sds-light/extensions/scrollbars.js +18 -0
- package/esm2015/components/code-editor/infra/cores/codemirror-6/themes/sds-light/sds-light-highlight-style.js +16 -0
- package/esm2015/components/code-editor/infra/cores/codemirror-6/themes/sds-light/sds-light-style.js +13 -0
- package/esm2015/components/code-editor/infra/cores/codemirror-6/themes/sds-light/sds-light-theme.js +22 -0
- package/esm2015/components/code-editor/infra/cores/codemirror-6/utils/convert-markers-to-diagnostics.js +18 -0
- package/esm2015/components/code-editor/infra/cores/codemirror-6/utils/index.js +3 -0
- package/esm2015/components/code-editor/infra/cores/codemirror-6/utils/is-current-position-inside-string.js +6 -0
- package/esm2015/components/code-editor/infra/linters/tax-calculation/models/index.js +1 -0
- package/esm2015/components/code-editor/infra/linters/tax-calculation/models/interfaces/validation.js +1 -0
- package/esm2015/components/code-editor/infra/linters/tax-calculation/tax-calculation-linter.js +19 -0
- package/esm2015/components/code-editor/infra/linters/tax-calculation/validation-compositors/index.js +3 -0
- package/esm2015/components/code-editor/infra/linters/tax-calculation/validation-compositors/validation-composite.js +16 -0
- package/esm2015/components/code-editor/infra/linters/tax-calculation/validation-compositors/validation-workers-compositor/validations-workers-composite.js +25 -0
- package/esm2015/components/code-editor/infra/utils/custom-http-client/custom-http-client.js +80 -0
- package/esm2015/components/code-editor/infra/utils/custom-http-client/json-response-formatters/format-blob-response.js +13 -0
- package/esm2015/components/code-editor/infra/utils/custom-http-client/json-response-formatters/format-json-response.js +12 -0
- package/esm2015/components/code-editor/infra/utils/custom-http-client/json-response-formatters/index.js +3 -0
- package/esm2015/components/code-editor/infra/utils/custom-translations/custom-translations-service.js +37 -0
- package/esm2015/components/code-editor/infra/utils/custom-translations/custom-translations.module.js +30 -0
- package/esm2015/components/code-editor/infra/utils/custom-translations/index.js +3 -0
- package/esm2015/components/code-editor/infra/utils/custom-translations/models/index.js +1 -0
- package/esm2015/components/code-editor/infra/utils/custom-translations/models/interfaces/translations.js +1 -0
- package/esm2015/components/code-editor/infra/utils/index.js +4 -0
- package/esm2015/components/code-editor/infra/utils/regex-index-of.js +12 -0
- package/esm2015/components/code-editor/models/enums/languages.js +5 -0
- package/esm2015/components/code-editor/models/enums/themes.js +5 -0
- package/esm2015/components/code-editor/models/index.js +4 -0
- package/esm2015/components/code-editor/models/interfaces/editor-options.js +1 -0
- package/esm2015/components/code-editor/presentation/code-editor-component.js +90 -0
- package/esm2015/components/code-editor/presentation/code-editor-module.js +27 -0
- package/esm2015/components/table/table-column/table-columns.component.js +4 -3
- package/esm2015/public-api.js +2 -1
- package/esm2015/seniorsistemas-angular-components.js +5 -1
- package/esm5/angular-components.module.js +4 -3
- package/esm5/components/code-editor/core/facades/core-facade.js +91 -0
- package/esm5/components/code-editor/core/facades/linter-facade.js +1 -0
- package/esm5/components/code-editor/core/models/enums/marker-severity.js +7 -0
- package/esm5/components/code-editor/core/models/index.js +3 -0
- package/esm5/components/code-editor/core/models/interfaces/marker.js +1 -0
- package/esm5/components/code-editor/core/use-cases/core-linters.js +16 -0
- package/esm5/components/code-editor/index.js +5 -0
- package/esm5/components/code-editor/infra/cores/codemirror-6/codemirror-6-core.js +106 -0
- package/esm5/components/code-editor/infra/cores/codemirror-6/languages/editor-languages.js +16 -0
- package/esm5/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/extensions/autocomplete/autocomplete-states/autocomplete-empty-state.js +29 -0
- package/esm5/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/extensions/autocomplete/autocomplete-states/autocomplete-loading-state.js +29 -0
- package/esm5/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/extensions/autocomplete/autocomplete-states/autocomplete-state-wrapper/autocomplete-state-wrapper-style.js +17 -0
- package/esm5/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/extensions/autocomplete/autocomplete-states/autocomplete-state-wrapper/autocomplete-state-wrapper.js +68 -0
- package/esm5/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/extensions/autocomplete/autocomplete-states/index.js +4 -0
- package/esm5/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/extensions/autocomplete/autocomplete-style.js +35 -0
- package/esm5/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/extensions/autocomplete/autocomplete.js +356 -0
- package/esm5/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/extensions/autocomplete/autocomplete.service.js +46 -0
- package/esm5/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/extensions/base-configs/base-configs.js +19 -0
- package/esm5/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/extensions/base-configs/grammar.js +2 -0
- package/esm5/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/extensions/on-paste-completion-items-updater/models/index.js +1 -0
- package/esm5/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/extensions/on-paste-completion-items-updater/models/interfaces/request-extra-info.js +1 -0
- package/esm5/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/extensions/on-paste-completion-items-updater/on-paste-completion-items-updater.js +191 -0
- package/esm5/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/models/enums/completion-types.js +10 -0
- package/esm5/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/models/enums/enum-type-order.js +8 -0
- package/esm5/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/models/enums/keywords.js +12 -0
- package/esm5/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/models/enums/meta-type.js +34 -0
- package/esm5/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/models/enums/request-types.js +8 -0
- package/esm5/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/models/index.js +7 -0
- package/esm5/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/models/interfaces/completion-Item.js +1 -0
- package/esm5/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/models/interfaces/facade-metadata-name.js +1 -0
- package/esm5/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/models/interfaces/fields-order-by.js +1 -0
- package/esm5/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/models/interfaces/get-facade-metadata-by-path.js +1 -0
- package/esm5/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/models/interfaces/list-context-metadata-by-id.js +1 -0
- package/esm5/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/models/interfaces/list-expression-metadata.js +1 -0
- package/esm5/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/models/interfaces/list-facade-metadata-names.js +1 -0
- package/esm5/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/models/interfaces/rec-expression-metadata.js +1 -0
- package/esm5/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/models/interfaces/rec-front-context-metadata.js +1 -0
- package/esm5/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/models/interfaces/rec-front-facade-metadata.js +1 -0
- package/esm5/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/models/interfaces/rec-front-field-metadata.js +1 -0
- package/esm5/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/models/interfaces/rec-page-request.js +1 -0
- package/esm5/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/models/interfaces/safe-http-communication.js +1 -0
- package/esm5/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/models/interfaces/tax-calculation-configs.js +1 -0
- package/esm5/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/tax-calculation-language-configs.js +14 -0
- package/esm5/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/tax-calculation.language.js +11 -0
- package/esm5/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/utils/get-language-configs.js +15 -0
- package/esm5/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/utils/get-safe-response.js +27 -0
- package/esm5/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/utils/index.js +4 -0
- package/esm5/components/code-editor/infra/cores/codemirror-6/languages/tax-calculation/utils/update-core-completion-items.js +34 -0
- package/esm5/components/code-editor/infra/cores/codemirror-6/models/index.js +1 -0
- package/esm5/components/code-editor/infra/cores/codemirror-6/models/types/diagnostic-severity.js +1 -0
- package/esm5/components/code-editor/infra/cores/codemirror-6/models/types/editor-theme.js +1 -0
- package/esm5/components/code-editor/infra/cores/codemirror-6/themes/editor-themes.js +16 -0
- package/esm5/components/code-editor/infra/cores/codemirror-6/themes/sds-light/extensions/autocomplete-tooltip.js +61 -0
- package/esm5/components/code-editor/infra/cores/codemirror-6/themes/sds-light/extensions/font-style.js +30 -0
- package/esm5/components/code-editor/infra/cores/codemirror-6/themes/sds-light/extensions/line-counter.js +25 -0
- package/esm5/components/code-editor/infra/cores/codemirror-6/themes/sds-light/extensions/scrollbars.js +18 -0
- package/esm5/components/code-editor/infra/cores/codemirror-6/themes/sds-light/sds-light-highlight-style.js +16 -0
- package/esm5/components/code-editor/infra/cores/codemirror-6/themes/sds-light/sds-light-style.js +13 -0
- package/esm5/components/code-editor/infra/cores/codemirror-6/themes/sds-light/sds-light-theme.js +22 -0
- package/esm5/components/code-editor/infra/cores/codemirror-6/utils/convert-markers-to-diagnostics.js +18 -0
- package/esm5/components/code-editor/infra/cores/codemirror-6/utils/index.js +3 -0
- package/esm5/components/code-editor/infra/cores/codemirror-6/utils/is-current-position-inside-string.js +6 -0
- package/esm5/components/code-editor/infra/linters/tax-calculation/models/index.js +1 -0
- package/esm5/components/code-editor/infra/linters/tax-calculation/models/interfaces/validation.js +1 -0
- package/esm5/components/code-editor/infra/linters/tax-calculation/tax-calculation-linter.js +21 -0
- package/esm5/components/code-editor/infra/linters/tax-calculation/validation-compositors/index.js +3 -0
- package/esm5/components/code-editor/infra/linters/tax-calculation/validation-compositors/validation-composite.js +49 -0
- package/esm5/components/code-editor/infra/linters/tax-calculation/validation-compositors/validation-workers-compositor/validations-workers-composite.js +42 -0
- package/esm5/components/code-editor/infra/utils/custom-http-client/custom-http-client.js +126 -0
- package/esm5/components/code-editor/infra/utils/custom-http-client/json-response-formatters/format-blob-response.js +21 -0
- package/esm5/components/code-editor/infra/utils/custom-http-client/json-response-formatters/format-json-response.js +14 -0
- package/esm5/components/code-editor/infra/utils/custom-http-client/json-response-formatters/index.js +3 -0
- package/esm5/components/code-editor/infra/utils/custom-translations/custom-translations-service.js +41 -0
- package/esm5/components/code-editor/infra/utils/custom-translations/custom-translations.module.js +31 -0
- package/esm5/components/code-editor/infra/utils/custom-translations/index.js +3 -0
- package/esm5/components/code-editor/infra/utils/custom-translations/models/index.js +1 -0
- package/esm5/components/code-editor/infra/utils/custom-translations/models/interfaces/translations.js +1 -0
- package/esm5/components/code-editor/infra/utils/index.js +4 -0
- package/esm5/components/code-editor/infra/utils/regex-index-of.js +12 -0
- package/esm5/components/code-editor/models/enums/languages.js +5 -0
- package/esm5/components/code-editor/models/enums/themes.js +5 -0
- package/esm5/components/code-editor/models/index.js +4 -0
- package/esm5/components/code-editor/models/interfaces/editor-options.js +1 -0
- package/esm5/components/code-editor/presentation/code-editor-component.js +100 -0
- package/esm5/components/code-editor/presentation/code-editor-module.js +30 -0
- package/esm5/components/table/table-column/table-columns.component.js +4 -3
- package/esm5/public-api.js +2 -1
- package/esm5/seniorsistemas-angular-components.js +5 -1
- package/fesm2015/seniorsistemas-angular-components.js +1679 -40
- package/fesm2015/seniorsistemas-angular-components.js.map +1 -1
- package/fesm5/seniorsistemas-angular-components.js +1858 -41
- package/fesm5/seniorsistemas-angular-components.js.map +1 -1
- package/package.json +11 -2
- package/public-api.d.ts +1 -0
- package/seniorsistemas-angular-components.d.ts +4 -0
- package/seniorsistemas-angular-components.metadata.json +1 -1
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { __spread, __assign, __decorate, __extends, __values, __param, __read } from 'tslib';
|
|
2
|
-
import { Input, Component, NgModule, EventEmitter, HostBinding, Output, ViewChild, Renderer2, HostListener, Directive, Injectable, Pipe, forwardRef, ViewEncapsulation, TemplateRef, ViewContainerRef, ComponentFactoryResolver, ChangeDetectorRef, Inject, ContentChild, ApplicationRef, Injector, ElementRef, ContentChildren } from '@angular/core';
|
|
1
|
+
import { __spread, __assign, __decorate, __extends, __values, __param, __read, __awaiter, __generator } from 'tslib';
|
|
2
|
+
import { Input, Component, NgModule, EventEmitter, HostBinding, Output, ViewChild, Renderer2, HostListener, Directive, Injectable, Pipe, forwardRef, ViewEncapsulation, TemplateRef, ViewContainerRef, ComponentFactoryResolver, ChangeDetectorRef, InjectionToken, Inject, ContentChild, ApplicationRef, Injector, ElementRef, ContentChildren } from '@angular/core';
|
|
3
3
|
import { CommonModule } from '@angular/common';
|
|
4
4
|
import { BreadcrumbModule as BreadcrumbModule$1 } from 'primeng/breadcrumb';
|
|
5
5
|
import { NavigationEnd, PRIMARY_OUTLET, ActivatedRoute, Router, RouterModule } from '@angular/router';
|
|
6
|
-
import { Subject, of, from, forkJoin, throwError } from 'rxjs';
|
|
7
|
-
import { takeUntil, filter, tap, map, switchMap, catchError, delay, finalize, debounceTime, repeat } from 'rxjs/operators';
|
|
6
|
+
import { Subject, of, from, forkJoin, throwError, ReplaySubject } from 'rxjs';
|
|
7
|
+
import { takeUntil, filter, tap, map, switchMap, catchError, delay, finalize, debounceTime, repeat, take } from 'rxjs/operators';
|
|
8
8
|
import { TieredMenu, TieredMenuModule } from 'primeng/tieredmenu';
|
|
9
9
|
import { TooltipModule } from 'primeng/tooltip';
|
|
10
10
|
import { DomHandler } from 'primeng/dom';
|
|
11
11
|
import { Calendar, CalendarModule } from 'primeng/calendar';
|
|
12
|
-
import { trigger, state, style, transition, animate, group, query, animateChild } from '@angular/animations';
|
|
12
|
+
import { trigger, state, style as style$7, transition, animate, group, query, animateChild } from '@angular/animations';
|
|
13
13
|
import { FormsModule, ReactiveFormsModule, NG_VALUE_ACCESSOR, FormControl, FormGroup, NG_VALIDATORS, Validators, FormArray } from '@angular/forms';
|
|
14
14
|
import { HttpClient, HttpEventType, HttpClientModule } from '@angular/common/http';
|
|
15
15
|
import { Hotkey, HotkeysService, HotkeyModule } from 'angular2-hotkeys';
|
|
@@ -18,7 +18,7 @@ import { AutoComplete, AutoCompleteModule } from 'primeng/autocomplete';
|
|
|
18
18
|
import { Dialog, DialogModule } from 'primeng/dialog';
|
|
19
19
|
import { Table, TableService, RowToggler, TableModule as TableModule$1 } from 'primeng/table';
|
|
20
20
|
import { applyMask, AlignmentOptions, CurrencyMaskDirective as CurrencyMaskDirective$1 } from '@seniorsistemas/ng2-currency-mask';
|
|
21
|
-
import { user } from '@seniorsistemas/senior-platform-data';
|
|
21
|
+
import { user, service } from '@seniorsistemas/senior-platform-data';
|
|
22
22
|
import * as moment_ from 'moment';
|
|
23
23
|
import { CookieService } from 'ngx-cookie-service';
|
|
24
24
|
import { CurrencyMaskDirective } from 'ng2-currency-mask';
|
|
@@ -42,6 +42,15 @@ import * as elementResizeDetectorMaker_ from 'element-resize-detector';
|
|
|
42
42
|
import { FocusTrapFactory, A11yModule } from '@angular/cdk/a11y';
|
|
43
43
|
import { ScrollPanelModule } from 'primeng/scrollpanel';
|
|
44
44
|
import { Sidebar, SidebarModule as SidebarModule$1 } from 'primeng/sidebar';
|
|
45
|
+
import { EditorView, keymap } from '@codemirror/view';
|
|
46
|
+
import { StateField, StateEffect, EditorState } from '@codemirror/state';
|
|
47
|
+
import { setDiagnostics } from '@codemirror/lint';
|
|
48
|
+
import { LRLanguage, LanguageSupport } from '@codemirror/language';
|
|
49
|
+
import { buildParser } from '@lezer/generator';
|
|
50
|
+
import { styleTags, tags, HighlightStyle } from '@codemirror/highlight';
|
|
51
|
+
import { autocompletion, pickedCompletion, startCompletion } from '@codemirror/autocomplete';
|
|
52
|
+
import { showTooltip } from '@codemirror/tooltip';
|
|
53
|
+
import { lineNumbers } from '@codemirror/gutter';
|
|
45
54
|
|
|
46
55
|
var BreadcrumbComponent = /** @class */ (function () {
|
|
47
56
|
function BreadcrumbComponent(activatedRoute, router) {
|
|
@@ -906,11 +915,11 @@ var CollapseLinkComponent = /** @class */ (function () {
|
|
|
906
915
|
template: "<div *ngIf=\"!collapsed\" @collapseContent (@collapseContent.done)=\"onToggleDone()\">\n <ng-content></ng-content>\n</div>\n\n<button [id]=\"buttonId\" type=\"button\" class=\"s-collapse-button\" (click)=\"toggle()\" [disabled]=\"disabled\">\n <span class=\"s-button-icon fa\" [ngClass]=\"{'fa-caret-down': collapsed, 'fa-caret-up': !collapsed}\"\n aria-hidden=\"true\"></span>\n <span class=\"s-button-text\">{{ collapsed ? collapsedLabel : expandedLabel }}</span>\n</button>\n",
|
|
907
916
|
animations: [
|
|
908
917
|
trigger("collapseContent", [
|
|
909
|
-
state("void", style({
|
|
918
|
+
state("void", style$7({
|
|
910
919
|
height: 0,
|
|
911
920
|
opacity: 0,
|
|
912
921
|
})),
|
|
913
|
-
state("*", style({
|
|
922
|
+
state("*", style$7({
|
|
914
923
|
height: "*",
|
|
915
924
|
opacity: 1,
|
|
916
925
|
})),
|
|
@@ -2338,20 +2347,20 @@ var LookupComponent = /** @class */ (function () {
|
|
|
2338
2347
|
encapsulation: ViewEncapsulation.None,
|
|
2339
2348
|
animations: [
|
|
2340
2349
|
trigger("collapseContent", [
|
|
2341
|
-
state("hidden", style({
|
|
2350
|
+
state("hidden", style$7({
|
|
2342
2351
|
width: "10px",
|
|
2343
2352
|
padding: 0,
|
|
2344
2353
|
})),
|
|
2345
|
-
state("visible", style({
|
|
2354
|
+
state("visible", style$7({
|
|
2346
2355
|
width: "*",
|
|
2347
2356
|
})),
|
|
2348
2357
|
transition("visible <=> hidden", [group([query("@childCollapseContent", animateChild()), animate("{{transitionParams}}")])]),
|
|
2349
2358
|
]),
|
|
2350
2359
|
trigger("childCollapseContent", [
|
|
2351
|
-
state(":leave", style({
|
|
2360
|
+
state(":leave", style$7({
|
|
2352
2361
|
opacity: 0,
|
|
2353
2362
|
})),
|
|
2354
|
-
state(":enter", style({
|
|
2363
|
+
state(":enter", style$7({
|
|
2355
2364
|
opacity: 1,
|
|
2356
2365
|
})),
|
|
2357
2366
|
transition("* <=> *", animate("{{transitionParams}}")),
|
|
@@ -3694,6 +3703,29 @@ var EnumBadgeColors;
|
|
|
3694
3703
|
EnumBadgeColors["BLUE"] = "sds-semantic-blue";
|
|
3695
3704
|
})(EnumBadgeColors || (EnumBadgeColors = {}));
|
|
3696
3705
|
|
|
3706
|
+
var HostProjectConfigsInjectionToken = new InjectionToken("hostProjectConfigs");
|
|
3707
|
+
var AngularComponentsModule = /** @class */ (function () {
|
|
3708
|
+
function AngularComponentsModule() {
|
|
3709
|
+
}
|
|
3710
|
+
AngularComponentsModule_1 = AngularComponentsModule;
|
|
3711
|
+
AngularComponentsModule.forRoot = function (config) {
|
|
3712
|
+
return {
|
|
3713
|
+
ngModule: AngularComponentsModule_1,
|
|
3714
|
+
providers: [
|
|
3715
|
+
{
|
|
3716
|
+
provide: HostProjectConfigsInjectionToken,
|
|
3717
|
+
useValue: config
|
|
3718
|
+
}
|
|
3719
|
+
]
|
|
3720
|
+
};
|
|
3721
|
+
};
|
|
3722
|
+
var AngularComponentsModule_1;
|
|
3723
|
+
AngularComponentsModule = AngularComponentsModule_1 = __decorate([
|
|
3724
|
+
NgModule({})
|
|
3725
|
+
], AngularComponentsModule);
|
|
3726
|
+
return AngularComponentsModule;
|
|
3727
|
+
}());
|
|
3728
|
+
|
|
3697
3729
|
var TableColumnsComponent = /** @class */ (function () {
|
|
3698
3730
|
function TableColumnsComponent(viewContainerRef, translate, hostProjectConfigs) {
|
|
3699
3731
|
this.viewContainerRef = viewContainerRef;
|
|
@@ -3885,7 +3917,7 @@ var TableColumnsComponent = /** @class */ (function () {
|
|
|
3885
3917
|
TableColumnsComponent.ctorParameters = function () { return [
|
|
3886
3918
|
{ type: ViewContainerRef },
|
|
3887
3919
|
{ type: TranslateService },
|
|
3888
|
-
{ type: undefined, decorators: [{ type: Inject, args: [
|
|
3920
|
+
{ type: undefined, decorators: [{ type: Inject, args: [HostProjectConfigsInjectionToken,] }] }
|
|
3889
3921
|
]; };
|
|
3890
3922
|
__decorate([
|
|
3891
3923
|
ViewChild("columnsTemplate", { static: true })
|
|
@@ -3905,7 +3937,7 @@ var TableColumnsComponent = /** @class */ (function () {
|
|
|
3905
3937
|
selector: "s-table-columns",
|
|
3906
3938
|
styles: [":host{display:none}"]
|
|
3907
3939
|
}),
|
|
3908
|
-
__param(2, Inject(
|
|
3940
|
+
__param(2, Inject(HostProjectConfigsInjectionToken))
|
|
3909
3941
|
], TableColumnsComponent);
|
|
3910
3942
|
return TableColumnsComponent;
|
|
3911
3943
|
}());
|
|
@@ -6257,13 +6289,13 @@ var ObjectCardComponent = /** @class */ (function () {
|
|
|
6257
6289
|
template: "<div [id]=\"id\" class=\"container\">\n <div\n [id]=\"id + '-main-container'\"\n class=\"main-container\"\n [ngClass]=\"{\n 'with-hidden-fields': fields.length > maxVisibleFields,\n 'with-visible-fields': fields.length && maxVisibleFields\n }\"\n >\n <div class=\"object-content\">\n <div class=\"s-object-card-main\"><ng-content select=\"s-object-card-main\"></ng-content></div>\n\n <div class=\"divider\" *ngIf=\"maxVisibleFields && fields.length\"></div>\n\n <div *ngFor=\"let field of (fields.toArray() | slice: 0:maxVisibleFields)\" class=\"s-object-card-field\">\n <ng-container *ngTemplateOutlet=\"field.content\"></ng-container>\n </div>\n </div>\n\n <div\n [id]=\"id + '-expand-icon-container'\"\n class=\"expand-icon-container\"\n (click)=\"toggle()\"\n [pTooltip]=\"expanded ? collapseTooltip : expandTooltip\"\n tooltipPosition=\"top\"\n [showDelay]=\"500\"\n >\n <span [id]=\"id + '-expand-icon'\" class=\"expand-icon fa\" [ngClass]=\"{ 'fa-minus': expanded, 'fa-plus': !expanded }\"></span>\n </div>\n </div>\n\n <div [id]=\"id + '-expandable-container'\" [@expandableContent]=\"expanded\" class=\"expandable-container\">\n <div class=\"ui-g ui-g-12\">\n <ng-container *ngFor=\"let field of (fields.toArray() | slice: maxVisibleFields:fields.length)\">\n <div class=\"ui-g-{{getExpandedFieldWidth()}}\">\n <div class=\"s-object-card-field\"><ng-container *ngTemplateOutlet=\"field.content\"></ng-container></div>\n </div>\n </ng-container>\n </div>\n </div>\n</div>\n",
|
|
6258
6290
|
animations: [
|
|
6259
6291
|
trigger("expandableContent", [
|
|
6260
|
-
state("*", style({
|
|
6292
|
+
state("*", style$7({
|
|
6261
6293
|
height: "0",
|
|
6262
6294
|
})),
|
|
6263
|
-
state("false", style({
|
|
6295
|
+
state("false", style$7({
|
|
6264
6296
|
height: "0",
|
|
6265
6297
|
})),
|
|
6266
|
-
state("true", style({
|
|
6298
|
+
state("true", style$7({
|
|
6267
6299
|
height: "*",
|
|
6268
6300
|
})),
|
|
6269
6301
|
transition("* => true", animate("200ms ease-out")),
|
|
@@ -6617,30 +6649,30 @@ var StepsComponent = /** @class */ (function () {
|
|
|
6617
6649
|
},
|
|
6618
6650
|
animations: [
|
|
6619
6651
|
trigger("beforeActiveDesative", [
|
|
6620
|
-
state("active", style({
|
|
6652
|
+
state("active", style$7({
|
|
6621
6653
|
"background-position": "left bottom",
|
|
6622
6654
|
})),
|
|
6623
|
-
state("desactive", style({
|
|
6655
|
+
state("desactive", style$7({
|
|
6624
6656
|
"background-position": "right bottom",
|
|
6625
6657
|
})),
|
|
6626
6658
|
transition("active => desactive", [animate("50ms 100ms linear")]),
|
|
6627
6659
|
transition("desactive => active", [animate("50ms 250ms linear")]),
|
|
6628
6660
|
]),
|
|
6629
6661
|
trigger("activeDesative", [
|
|
6630
|
-
state("active", style({
|
|
6662
|
+
state("active", style$7({
|
|
6631
6663
|
"background-position": "left bottom",
|
|
6632
6664
|
})),
|
|
6633
|
-
state("desactive", style({
|
|
6665
|
+
state("desactive", style$7({
|
|
6634
6666
|
"background-position": "right bottom",
|
|
6635
6667
|
})),
|
|
6636
6668
|
transition("active => desactive", [animate("100ms 150ms linear")]),
|
|
6637
6669
|
transition("desactive => active", [animate("100ms 150ms linear")]),
|
|
6638
6670
|
]),
|
|
6639
6671
|
trigger("afterActiveDesative", [
|
|
6640
|
-
state("active", style({
|
|
6672
|
+
state("active", style$7({
|
|
6641
6673
|
"background-position": "left bottom",
|
|
6642
6674
|
})),
|
|
6643
|
-
state("desactive", style({
|
|
6675
|
+
state("desactive", style$7({
|
|
6644
6676
|
"background-position": "right bottom",
|
|
6645
6677
|
})),
|
|
6646
6678
|
transition("active => desactive", [animate("50ms 250ms linear")]),
|
|
@@ -6940,13 +6972,13 @@ var GlobalSearchComponent = /** @class */ (function () {
|
|
|
6940
6972
|
template: "<div class=\"ui-inputgroup\">\n <input #globalSearch class=\"global-search__input\" [(ngModel)]=\"search\" (ngModelChange)=\"onChange()\" pInputText\n [placeholder]=\"placeholder\" (focus)=\"focusIn()\" (blur)=\"focusOut()\">\n <span class=\"ui-inputgroup-addon global-search__span\"><em class=\"fas fa-search\"></em></span>\n <div class=\"global-search__modal\" *ngIf=\"wasSearched\">\n <div *sLoadingState=\"isLoading && !isModalLoading\" class=\"global-search__loader\">\n <div class=\"global-search__container\" *ngIf=\"dropdownItens && dropdownItens.length > 0 || isLoading\">\n <div *ngIf=\"dropdownItens && dropdownItens.length > 0\">\n <div class=\"global-search__modal--total-itens-title\">\n <span class=\"ui-g-11 no-space\">{{totalItensLabel}}</span>\n <span class=\"ui-g-1 no-space global-search__modal--total-itens-title-icon\" (click)=\"close()\"><em\n class=\"fas fa-times\"></em></span>\n </div>\n <div class=\"no-space global-search__dropdown--itens\"\n [@expandableContent]=\"expanded\">\n <ng-container *ngFor=\"let item of dropdownItens\">\n <div class=\"s-object-card-field no-space global-search__dropdown--itens-container\">\n <ng-container *ngTemplateOutlet=\"item.content\"></ng-container>\n </div>\n </ng-container>\n </div>\n <div *ngIf=\"showFooter\" class=\"ui-g-12 global-search__modal--footer\">\n <s-button class=\"global-search__show-more\" (click)=\"showMore()\" priority=\"link\">\n {{showMoreLabel}}\n </s-button>\n </div>\n </div>\n </div>\n <s-empty-state *ngIf=\"(!dropdownItens || dropdownItens.length==0) && !isLoading\" [title]=\"emptyTitle\"\n [description]=\"emptyDescription\" ngClass=\"global-search__empty-state--icon\"\n [iconClass]=\"(emptyIcon ? emptyIcon : 'fas fa-search')\">\n </s-empty-state>\n </div>\n </div>\n <div *ngIf=\"wasSearched\" class=\"global-search__background\" (click)=\"close()\"></div>\n</div>\n",
|
|
6941
6973
|
animations: [
|
|
6942
6974
|
trigger("expandableContent", [
|
|
6943
|
-
state("*", style({
|
|
6975
|
+
state("*", style$7({
|
|
6944
6976
|
height: "0",
|
|
6945
6977
|
})),
|
|
6946
|
-
state("false", style({
|
|
6978
|
+
state("false", style$7({
|
|
6947
6979
|
height: "0",
|
|
6948
6980
|
})),
|
|
6949
|
-
state("true", style({
|
|
6981
|
+
state("true", style$7({
|
|
6950
6982
|
height: "*",
|
|
6951
6983
|
})),
|
|
6952
6984
|
transition("* => true", animate("200ms ease-out")),
|
|
@@ -7044,31 +7076,1816 @@ var GlobalSearchModule = /** @class */ (function () {
|
|
|
7044
7076
|
return GlobalSearchModule;
|
|
7045
7077
|
}());
|
|
7046
7078
|
|
|
7047
|
-
var
|
|
7048
|
-
|
|
7079
|
+
var Languages;
|
|
7080
|
+
(function (Languages) {
|
|
7081
|
+
Languages["TaxCalculation"] = "TaxCalculation";
|
|
7082
|
+
})(Languages || (Languages = {}));
|
|
7083
|
+
|
|
7084
|
+
var Themes;
|
|
7085
|
+
(function (Themes) {
|
|
7086
|
+
Themes["SDSLight"] = "SDSLight";
|
|
7087
|
+
})(Themes || (Themes = {}));
|
|
7088
|
+
|
|
7089
|
+
/* Enums */
|
|
7090
|
+
|
|
7091
|
+
var ValidationWorkersComposite = /** @class */ (function () {
|
|
7092
|
+
function ValidationWorkersComposite() {
|
|
7093
|
+
this._validations = [];
|
|
7094
|
+
}
|
|
7095
|
+
ValidationWorkersComposite.prototype.validate = function (code, completionItems) {
|
|
7096
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
7097
|
+
var _this = this;
|
|
7098
|
+
return __generator(this, function (_a) {
|
|
7099
|
+
return [2 /*return*/, new Promise(function (resolve) {
|
|
7100
|
+
var e_1, _a;
|
|
7101
|
+
var markers = [];
|
|
7102
|
+
var finishedWorkers = 0;
|
|
7103
|
+
try {
|
|
7104
|
+
for (var _b = __values(_this._validations), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
7105
|
+
var worker = _c.value;
|
|
7106
|
+
worker.onmessage = function (_a) {
|
|
7107
|
+
var data = _a.data;
|
|
7108
|
+
markers.concat(data);
|
|
7109
|
+
finishedWorkers++;
|
|
7110
|
+
if (finishedWorkers === _this._validations.length) {
|
|
7111
|
+
resolve(markers);
|
|
7112
|
+
}
|
|
7113
|
+
};
|
|
7114
|
+
worker.postMessage({ code: code, completionItems: completionItems });
|
|
7115
|
+
}
|
|
7116
|
+
}
|
|
7117
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
7118
|
+
finally {
|
|
7119
|
+
try {
|
|
7120
|
+
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
7121
|
+
}
|
|
7122
|
+
finally { if (e_1) throw e_1.error; }
|
|
7123
|
+
}
|
|
7124
|
+
})];
|
|
7125
|
+
});
|
|
7126
|
+
});
|
|
7127
|
+
};
|
|
7128
|
+
return ValidationWorkersComposite;
|
|
7129
|
+
}());
|
|
7130
|
+
|
|
7131
|
+
var ValidationComposite = /** @class */ (function () {
|
|
7132
|
+
function ValidationComposite() {
|
|
7133
|
+
this._validations = [];
|
|
7134
|
+
}
|
|
7135
|
+
ValidationComposite.prototype.validate = function (code, completionItems) {
|
|
7136
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
7137
|
+
var markers, _a, _b, validation, _c, _d, e_1_1;
|
|
7138
|
+
var e_1, _e;
|
|
7139
|
+
return __generator(this, function (_f) {
|
|
7140
|
+
switch (_f.label) {
|
|
7141
|
+
case 0:
|
|
7142
|
+
markers = [];
|
|
7143
|
+
_f.label = 1;
|
|
7144
|
+
case 1:
|
|
7145
|
+
_f.trys.push([1, 6, 7, 8]);
|
|
7146
|
+
_a = __values(this._validations), _b = _a.next();
|
|
7147
|
+
_f.label = 2;
|
|
7148
|
+
case 2:
|
|
7149
|
+
if (!!_b.done) return [3 /*break*/, 5];
|
|
7150
|
+
validation = _b.value;
|
|
7151
|
+
_d = (_c = markers).concat;
|
|
7152
|
+
return [4 /*yield*/, validation.validate(code, completionItems)];
|
|
7153
|
+
case 3:
|
|
7154
|
+
_d.apply(_c, [_f.sent()]);
|
|
7155
|
+
_f.label = 4;
|
|
7156
|
+
case 4:
|
|
7157
|
+
_b = _a.next();
|
|
7158
|
+
return [3 /*break*/, 2];
|
|
7159
|
+
case 5: return [3 /*break*/, 8];
|
|
7160
|
+
case 6:
|
|
7161
|
+
e_1_1 = _f.sent();
|
|
7162
|
+
e_1 = { error: e_1_1 };
|
|
7163
|
+
return [3 /*break*/, 8];
|
|
7164
|
+
case 7:
|
|
7165
|
+
try {
|
|
7166
|
+
if (_b && !_b.done && (_e = _a.return)) _e.call(_a);
|
|
7167
|
+
}
|
|
7168
|
+
finally { if (e_1) throw e_1.error; }
|
|
7169
|
+
return [7 /*endfinally*/];
|
|
7170
|
+
case 8: return [2 /*return*/, markers];
|
|
7171
|
+
}
|
|
7172
|
+
});
|
|
7173
|
+
});
|
|
7174
|
+
};
|
|
7175
|
+
return ValidationComposite;
|
|
7176
|
+
}());
|
|
7177
|
+
|
|
7178
|
+
/**
|
|
7179
|
+
* Linter for the "TaxCalculation" Language
|
|
7180
|
+
*/
|
|
7181
|
+
var TaxCalculationLinter = /** @class */ (function () {
|
|
7182
|
+
function TaxCalculationLinter() {
|
|
7183
|
+
this.setValidation();
|
|
7049
7184
|
}
|
|
7050
|
-
|
|
7051
|
-
|
|
7185
|
+
TaxCalculationLinter.prototype.lint = function (code, completionItems) {
|
|
7186
|
+
return this._validation.validate(code, completionItems || []);
|
|
7187
|
+
};
|
|
7188
|
+
TaxCalculationLinter.prototype.setValidation = function () {
|
|
7189
|
+
var browserSupportsWorkers = typeof Worker !== "undefined";
|
|
7190
|
+
this._validation = browserSupportsWorkers
|
|
7191
|
+
? new ValidationWorkersComposite()
|
|
7192
|
+
: new ValidationComposite();
|
|
7193
|
+
};
|
|
7194
|
+
return TaxCalculationLinter;
|
|
7195
|
+
}());
|
|
7196
|
+
|
|
7197
|
+
var CoreLinters = /** @class */ (function () {
|
|
7198
|
+
function CoreLinters() {
|
|
7199
|
+
}
|
|
7200
|
+
CoreLinters.getLinter = function (language) {
|
|
7201
|
+
return CoreLinters._LINTERS.get(language);
|
|
7202
|
+
};
|
|
7203
|
+
CoreLinters._LINTERS = new Map([
|
|
7204
|
+
[Languages.TaxCalculation, new TaxCalculationLinter()]
|
|
7205
|
+
]);
|
|
7206
|
+
return CoreLinters;
|
|
7207
|
+
}());
|
|
7208
|
+
|
|
7209
|
+
var CoreFacade = /** @class */ (function () {
|
|
7210
|
+
function CoreFacade() {
|
|
7211
|
+
this.$onCoreFinishLoad = new ReplaySubject(1);
|
|
7212
|
+
this.$onCodeChange = new Subject();
|
|
7213
|
+
this.$onCodeValidityChange = new Subject();
|
|
7214
|
+
this._completionItems = [];
|
|
7215
|
+
}
|
|
7216
|
+
CoreFacade.prototype.changeEditorOptions = function (options) {
|
|
7217
|
+
if (options) {
|
|
7218
|
+
if (typeof options !== "object")
|
|
7219
|
+
throw new Error("Editor's options must be an EditorOptions object");
|
|
7220
|
+
this.validateLanguage(options.language);
|
|
7221
|
+
this.validateTheme(options.theme);
|
|
7222
|
+
this.setLinter(options.language);
|
|
7223
|
+
this.setCoreEditorOptions(options);
|
|
7224
|
+
}
|
|
7225
|
+
};
|
|
7226
|
+
CoreFacade.prototype.changeCode = function (code) {
|
|
7227
|
+
if (code !== this._lastCodeEmitted) {
|
|
7228
|
+
this.setCode(code);
|
|
7229
|
+
}
|
|
7230
|
+
};
|
|
7231
|
+
CoreFacade.prototype.destroyObservables = function () { };
|
|
7232
|
+
CoreFacade.prototype.getOnCoreFinishLoadObservable = function () {
|
|
7233
|
+
return this.$onCoreFinishLoad.asObservable();
|
|
7234
|
+
};
|
|
7235
|
+
CoreFacade.prototype.getOnCodeChangeObservable = function () {
|
|
7236
|
+
return this.$onCodeChange.asObservable();
|
|
7237
|
+
};
|
|
7238
|
+
CoreFacade.prototype.getOnCodeValidityChangeObservable = function () {
|
|
7239
|
+
return this.$onCodeValidityChange.asObservable();
|
|
7240
|
+
};
|
|
7241
|
+
CoreFacade.prototype.notifyCoreFinishLoad = function () {
|
|
7242
|
+
this.$onCoreFinishLoad.next();
|
|
7243
|
+
};
|
|
7244
|
+
CoreFacade.prototype.notifyCodeChange = function (code) {
|
|
7245
|
+
if (code !== this._lastCodeEmitted) {
|
|
7246
|
+
this._lastCodeEmitted = code;
|
|
7247
|
+
this.$onCodeChange.next(code);
|
|
7248
|
+
this.validateCode(code);
|
|
7249
|
+
}
|
|
7250
|
+
};
|
|
7251
|
+
CoreFacade.prototype.updateCompletionItems = function (items) {
|
|
7252
|
+
this._completionItems = items;
|
|
7253
|
+
this.validateCode(this._lastCodeEmitted);
|
|
7254
|
+
};
|
|
7255
|
+
CoreFacade.prototype.setLinter = function (language) {
|
|
7256
|
+
this._linter = CoreLinters.getLinter(language);
|
|
7257
|
+
};
|
|
7258
|
+
CoreFacade.prototype.validateCode = function (code) {
|
|
7259
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
7260
|
+
var markers;
|
|
7261
|
+
return __generator(this, function (_a) {
|
|
7262
|
+
switch (_a.label) {
|
|
7263
|
+
case 0:
|
|
7264
|
+
if (!this._linter) return [3 /*break*/, 2];
|
|
7265
|
+
return [4 /*yield*/, this._linter.lint(code, this._completionItems)];
|
|
7266
|
+
case 1:
|
|
7267
|
+
markers = _a.sent();
|
|
7268
|
+
this.highlightCode(markers);
|
|
7269
|
+
this.notifyCodeValidityChange(!!markers.length);
|
|
7270
|
+
_a.label = 2;
|
|
7271
|
+
case 2: return [2 /*return*/];
|
|
7272
|
+
}
|
|
7273
|
+
});
|
|
7274
|
+
});
|
|
7275
|
+
};
|
|
7276
|
+
CoreFacade.prototype.notifyCodeValidityChange = function (validity) {
|
|
7277
|
+
if (validity !== this._lastCodeValidityEmitted) {
|
|
7278
|
+
this._lastCodeValidityEmitted = validity;
|
|
7279
|
+
this.$onCodeValidityChange.next(validity);
|
|
7280
|
+
}
|
|
7281
|
+
};
|
|
7282
|
+
CoreFacade.prototype.validateLanguage = function (language) {
|
|
7283
|
+
var languages = Object.values(Languages);
|
|
7284
|
+
if (language && !languages.includes(language))
|
|
7285
|
+
throw new Error("The informed language \"" + language + "\" is not supported");
|
|
7286
|
+
};
|
|
7287
|
+
CoreFacade.prototype.validateTheme = function (theme) {
|
|
7288
|
+
var themes = Object.values(Themes);
|
|
7289
|
+
if (theme && !themes.includes(theme))
|
|
7290
|
+
throw new Error("The informed theme \"" + theme + "\" is not supported");
|
|
7291
|
+
};
|
|
7292
|
+
return CoreFacade;
|
|
7293
|
+
}());
|
|
7294
|
+
|
|
7295
|
+
var CodeEditorComponent = /** @class */ (function () {
|
|
7296
|
+
function CodeEditorComponent(coreFacade) {
|
|
7297
|
+
this.coreFacade = coreFacade;
|
|
7298
|
+
this._ngUnsubscribe = new Subject();
|
|
7299
|
+
this.codeChange = new EventEmitter();
|
|
7300
|
+
this.isCodeValidChange = new EventEmitter();
|
|
7301
|
+
this.onCodeChange = new EventEmitter();
|
|
7302
|
+
this.onComponentFinishLoad = new EventEmitter();
|
|
7303
|
+
}
|
|
7304
|
+
Object.defineProperty(CodeEditorComponent.prototype, "editorOptions", {
|
|
7305
|
+
set: function (options) {
|
|
7306
|
+
this.coreFacade.changeEditorOptions(options);
|
|
7307
|
+
},
|
|
7308
|
+
enumerable: true,
|
|
7309
|
+
configurable: true
|
|
7310
|
+
});
|
|
7311
|
+
Object.defineProperty(CodeEditorComponent.prototype, "code", {
|
|
7312
|
+
set: function (code) {
|
|
7313
|
+
this.coreFacade.changeCode(code);
|
|
7314
|
+
},
|
|
7315
|
+
enumerable: true,
|
|
7316
|
+
configurable: true
|
|
7317
|
+
});
|
|
7318
|
+
CodeEditorComponent.prototype.ngOnInit = function () {
|
|
7319
|
+
this.setupCoreListeners();
|
|
7320
|
+
};
|
|
7321
|
+
CodeEditorComponent.prototype.ngAfterViewInit = function () {
|
|
7322
|
+
this.setCoreWrapperElement();
|
|
7323
|
+
};
|
|
7324
|
+
CodeEditorComponent.prototype.ngOnDestroy = function () {
|
|
7325
|
+
this.coreFacade.destroyObservables();
|
|
7326
|
+
this._ngUnsubscribe.next();
|
|
7327
|
+
this._ngUnsubscribe.complete();
|
|
7328
|
+
};
|
|
7329
|
+
CodeEditorComponent.prototype.setCoreWrapperElement = function () {
|
|
7330
|
+
this.coreFacade.setCoreWrapperElement(this.coreWrapperElement.nativeElement);
|
|
7331
|
+
};
|
|
7332
|
+
CodeEditorComponent.prototype.setupCoreListeners = function () {
|
|
7333
|
+
var _this = this;
|
|
7334
|
+
this.coreFacade
|
|
7335
|
+
.getOnCoreFinishLoadObservable()
|
|
7336
|
+
.pipe(take(1))
|
|
7337
|
+
.subscribe(function () { return _this.onComponentFinishLoad.emit(); });
|
|
7338
|
+
this.coreFacade
|
|
7339
|
+
.getOnCodeChangeObservable()
|
|
7340
|
+
.pipe(takeUntil(this._ngUnsubscribe))
|
|
7341
|
+
.subscribe(function (code) {
|
|
7342
|
+
_this.codeChange.emit(code);
|
|
7343
|
+
_this.onCodeChange.emit(code);
|
|
7344
|
+
});
|
|
7345
|
+
this.coreFacade
|
|
7346
|
+
.getOnCodeValidityChangeObservable()
|
|
7347
|
+
.pipe(takeUntil(this._ngUnsubscribe))
|
|
7348
|
+
.subscribe(function (validity) {
|
|
7349
|
+
_this.isCodeValidChange.emit(validity);
|
|
7350
|
+
});
|
|
7351
|
+
};
|
|
7352
|
+
CodeEditorComponent.ctorParameters = function () { return [
|
|
7353
|
+
{ type: CoreFacade }
|
|
7354
|
+
]; };
|
|
7355
|
+
__decorate([
|
|
7356
|
+
ViewChild("coreWrapper")
|
|
7357
|
+
], CodeEditorComponent.prototype, "coreWrapperElement", void 0);
|
|
7358
|
+
__decorate([
|
|
7359
|
+
Input()
|
|
7360
|
+
], CodeEditorComponent.prototype, "editorOptions", null);
|
|
7361
|
+
__decorate([
|
|
7362
|
+
Input()
|
|
7363
|
+
], CodeEditorComponent.prototype, "code", null);
|
|
7364
|
+
__decorate([
|
|
7365
|
+
Output()
|
|
7366
|
+
], CodeEditorComponent.prototype, "codeChange", void 0);
|
|
7367
|
+
__decorate([
|
|
7368
|
+
Input()
|
|
7369
|
+
], CodeEditorComponent.prototype, "isCodeValid", void 0);
|
|
7370
|
+
__decorate([
|
|
7371
|
+
Output()
|
|
7372
|
+
], CodeEditorComponent.prototype, "isCodeValidChange", void 0);
|
|
7373
|
+
__decorate([
|
|
7374
|
+
Output()
|
|
7375
|
+
], CodeEditorComponent.prototype, "onCodeChange", void 0);
|
|
7376
|
+
__decorate([
|
|
7377
|
+
Output()
|
|
7378
|
+
], CodeEditorComponent.prototype, "onComponentFinishLoad", void 0);
|
|
7379
|
+
CodeEditorComponent = __decorate([
|
|
7380
|
+
Component({
|
|
7381
|
+
selector: "s-code-editor",
|
|
7382
|
+
template: "<div #coreWrapper class=\"core-wrapper\"></div>",
|
|
7383
|
+
styles: [".core-wrapper{height:100%}"]
|
|
7384
|
+
})
|
|
7385
|
+
], CodeEditorComponent);
|
|
7386
|
+
return CodeEditorComponent;
|
|
7387
|
+
}());
|
|
7388
|
+
|
|
7389
|
+
var parserGrammar = "\n@top Script { statement+ }\n\nstatement[@isGroup=Statement] {\n Keyword |\n String |\n Number\n}\n\n@tokens {\n String { '\"' (![\\n\"])* '\"'? }\n\n Number { std.digit+ }\n\n identifierChar { std.asciiLetter | $[_$\u00A1-\uDBFF\uDFFF] }\n\n word { identifierChar (identifierChar | std.digit)* }\n\n identifier { word }\n}\n\nKeyword {\n kw<\"SE\">\n kw<\"ENTAO\">\n kw<\"FIM_SE\">\n kw<\"SENAO\">\n kw<\"NAO\">\n kw<\"CONTENHA\">\n kw<\"OU\">\n kw<\"E\">\n}\n\nkw<term> { @specialize[@name={term}]<identifier, term> }\n\n@detectDelim\n";
|
|
7390
|
+
|
|
7391
|
+
var EnumTypeOrder;
|
|
7392
|
+
(function (EnumTypeOrder) {
|
|
7393
|
+
// Tipo de ordenação - Crescente
|
|
7394
|
+
EnumTypeOrder["ASC"] = "ASC";
|
|
7395
|
+
// Tipo de ordenação - Decrescente
|
|
7396
|
+
EnumTypeOrder["DESC"] = "DESC";
|
|
7397
|
+
})(EnumTypeOrder || (EnumTypeOrder = {}));
|
|
7398
|
+
|
|
7399
|
+
var MetaType;
|
|
7400
|
+
(function (MetaType) {
|
|
7401
|
+
// Entity
|
|
7402
|
+
MetaType["ENTITY"] = "ENTITY";
|
|
7403
|
+
// String
|
|
7404
|
+
MetaType["STRING"] = "STRING";
|
|
7405
|
+
// Integer
|
|
7406
|
+
MetaType["INTEGER"] = "INTEGER";
|
|
7407
|
+
// Double
|
|
7408
|
+
MetaType["DOUBLE"] = "DOUBLE";
|
|
7409
|
+
// Long
|
|
7410
|
+
MetaType["LONG"] = "LONG";
|
|
7411
|
+
// BigDecimal
|
|
7412
|
+
MetaType["BIGDECIMAL"] = "BIGDECIMAL";
|
|
7413
|
+
// UUID
|
|
7414
|
+
MetaType["UUID"] = "UUID";
|
|
7415
|
+
// Date
|
|
7416
|
+
MetaType["DATE"] = "DATE";
|
|
7417
|
+
// DateTime
|
|
7418
|
+
MetaType["DATETIME"] = "DATETIME";
|
|
7419
|
+
// Time
|
|
7420
|
+
MetaType["TIME"] = "TIME";
|
|
7421
|
+
// Boolean
|
|
7422
|
+
MetaType["BOOLEAN"] = "BOOLEAN";
|
|
7423
|
+
// List
|
|
7424
|
+
MetaType["LIST"] = "LIST";
|
|
7425
|
+
// Enum
|
|
7426
|
+
MetaType["ENUM"] = "ENUM";
|
|
7427
|
+
// CustomExpression
|
|
7428
|
+
MetaType["CUSTOM_EXPRESSION"] = "CUSTOM_EXPRESSION";
|
|
7429
|
+
// PublicExpression
|
|
7430
|
+
MetaType["PUBLIC_EXPRESSION"] = "PUBLIC_EXPRESSION";
|
|
7431
|
+
})(MetaType || (MetaType = {}));
|
|
7432
|
+
|
|
7433
|
+
var RequestTypes;
|
|
7434
|
+
(function (RequestTypes) {
|
|
7435
|
+
RequestTypes[RequestTypes["ListContextMetadataById"] = 0] = "ListContextMetadataById";
|
|
7436
|
+
RequestTypes[RequestTypes["ListExpressionMetadata"] = 1] = "ListExpressionMetadata";
|
|
7437
|
+
RequestTypes[RequestTypes["ListFacadeMetadataNames"] = 2] = "ListFacadeMetadataNames";
|
|
7438
|
+
RequestTypes[RequestTypes["GetFacadeMetadataByPath"] = 3] = "GetFacadeMetadataByPath";
|
|
7439
|
+
})(RequestTypes || (RequestTypes = {}));
|
|
7440
|
+
|
|
7441
|
+
var CompletionTypes;
|
|
7442
|
+
(function (CompletionTypes) {
|
|
7443
|
+
CompletionTypes["Keyword"] = "keyword";
|
|
7444
|
+
CompletionTypes["Context"] = "context";
|
|
7445
|
+
CompletionTypes["Expression"] = "expression";
|
|
7446
|
+
CompletionTypes["UserExpression"] = "userExpression";
|
|
7447
|
+
CompletionTypes["Entity"] = "entity";
|
|
7448
|
+
CompletionTypes["FinalValue"] = "finalValue";
|
|
7449
|
+
})(CompletionTypes || (CompletionTypes = {}));
|
|
7450
|
+
|
|
7451
|
+
var Keywords;
|
|
7452
|
+
(function (Keywords) {
|
|
7453
|
+
Keywords["SE"] = "SE";
|
|
7454
|
+
Keywords["SENAO"] = "SENAO";
|
|
7455
|
+
Keywords["CONTENHA"] = "CONTENHA";
|
|
7456
|
+
Keywords["ENTAO"] = "ENTAO";
|
|
7457
|
+
Keywords["FIM_SE"] = "FIM_SE";
|
|
7458
|
+
Keywords["NAO"] = "NAO";
|
|
7459
|
+
Keywords["E"] = "E";
|
|
7460
|
+
Keywords["OU"] = "OU";
|
|
7461
|
+
})(Keywords || (Keywords = {}));
|
|
7462
|
+
|
|
7463
|
+
/* Enums */
|
|
7464
|
+
|
|
7465
|
+
var _a;
|
|
7466
|
+
var baseConfigs = LRLanguage.define({
|
|
7467
|
+
parser: buildParser(parserGrammar)
|
|
7468
|
+
.configure({
|
|
7469
|
+
props: [
|
|
7470
|
+
styleTags((_a = {},
|
|
7471
|
+
_a[Object.values(Keywords).join(" ")] = tags.keyword,
|
|
7472
|
+
_a["String"] = tags.string,
|
|
7473
|
+
_a["Number"] = tags.number,
|
|
7474
|
+
_a))
|
|
7475
|
+
]
|
|
7476
|
+
})
|
|
7477
|
+
});
|
|
7478
|
+
|
|
7479
|
+
/**
|
|
7480
|
+
* Formats a JSON response to a JS object
|
|
7481
|
+
* @param response The response to format
|
|
7482
|
+
* @returns A JS object based on the response's body
|
|
7483
|
+
*/
|
|
7484
|
+
function formatJsonResponse(response) {
|
|
7485
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
7486
|
+
return __generator(this, function (_a) {
|
|
7487
|
+
return [2 /*return*/, response.json()];
|
|
7488
|
+
});
|
|
7489
|
+
});
|
|
7490
|
+
}
|
|
7491
|
+
|
|
7492
|
+
/**
|
|
7493
|
+
* Formats a Blob response to a JS object
|
|
7494
|
+
* @param response The response to format
|
|
7495
|
+
* @returns A JS object based on the response's body
|
|
7496
|
+
*/
|
|
7497
|
+
function formatBlobResponse(response) {
|
|
7498
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
7499
|
+
var textResponse;
|
|
7500
|
+
return __generator(this, function (_a) {
|
|
7501
|
+
switch (_a.label) {
|
|
7502
|
+
case 0: return [4 /*yield*/, response.blob()];
|
|
7503
|
+
case 1: return [4 /*yield*/, (_a.sent()).text()];
|
|
7504
|
+
case 2:
|
|
7505
|
+
textResponse = _a.sent();
|
|
7506
|
+
return [2 /*return*/, JSON.parse(textResponse)];
|
|
7507
|
+
}
|
|
7508
|
+
});
|
|
7509
|
+
});
|
|
7510
|
+
}
|
|
7511
|
+
|
|
7512
|
+
/**
|
|
7513
|
+
* Custom HttpClient for cases when is not possible to use the Angular's HttpClient
|
|
7514
|
+
*/
|
|
7515
|
+
var CustomHttpClient = /** @class */ (function () {
|
|
7516
|
+
function CustomHttpClient() {
|
|
7517
|
+
}
|
|
7518
|
+
/**
|
|
7519
|
+
* Executes a Http Get
|
|
7520
|
+
* @param url Url to execute the Get on
|
|
7521
|
+
* @param init Optional additional configs
|
|
7522
|
+
* @returns Whether a Promise<T> on request success or an error in request fail
|
|
7523
|
+
*/
|
|
7524
|
+
CustomHttpClient.GET = function (url, init) {
|
|
7525
|
+
if (init === void 0) { init = {}; }
|
|
7526
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
7527
|
+
var response;
|
|
7528
|
+
return __generator(this, function (_a) {
|
|
7529
|
+
switch (_a.label) {
|
|
7530
|
+
case 0: return [4 /*yield*/, this.interceptRequest(url, __assign(__assign({}, init), { method: "GET" }))];
|
|
7531
|
+
case 1:
|
|
7532
|
+
response = _a.sent();
|
|
7533
|
+
return [2 /*return*/, this.formatResponse(response)];
|
|
7534
|
+
}
|
|
7535
|
+
});
|
|
7536
|
+
});
|
|
7537
|
+
};
|
|
7538
|
+
/**
|
|
7539
|
+
* Executes a Http Post
|
|
7540
|
+
* @param url Url to execute the Post on
|
|
7541
|
+
* @param body Info to send to server on Post
|
|
7542
|
+
* @param init Optional additional configs
|
|
7543
|
+
* @returns Whether a Promise<T> on request success or an error in request fail
|
|
7544
|
+
*/
|
|
7545
|
+
CustomHttpClient.POST = function (url, body, init) {
|
|
7546
|
+
if (init === void 0) { init = {}; }
|
|
7547
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
7548
|
+
var headers, response;
|
|
7549
|
+
return __generator(this, function (_a) {
|
|
7550
|
+
switch (_a.label) {
|
|
7551
|
+
case 0:
|
|
7552
|
+
headers = new Headers(init.headers);
|
|
7553
|
+
headers.append("Content-Type", "application/json");
|
|
7554
|
+
headers.append("Accept", "application/json");
|
|
7555
|
+
return [4 /*yield*/, this.interceptRequest(url, __assign(__assign({}, init), { method: "POST", body: JSON.stringify(body), headers: headers }))];
|
|
7556
|
+
case 1:
|
|
7557
|
+
response = _a.sent();
|
|
7558
|
+
return [2 /*return*/, this.formatResponse(response)];
|
|
7559
|
+
}
|
|
7560
|
+
});
|
|
7561
|
+
});
|
|
7562
|
+
};
|
|
7563
|
+
/**
|
|
7564
|
+
* Intercepts the original request to add a required header for Senior in case of a internal request
|
|
7565
|
+
* @param url Url from the original request
|
|
7566
|
+
* @param originalReq Configs from the original request
|
|
7567
|
+
* @returns Whether a Promise<Response> if the request was made successfully or an error
|
|
7568
|
+
*/
|
|
7569
|
+
CustomHttpClient.interceptRequest = function (url, originalReq) {
|
|
7570
|
+
if (originalReq === void 0) { originalReq = {}; }
|
|
7571
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
7572
|
+
var restUrl, authHeader, headers, request, err_1;
|
|
7573
|
+
return __generator(this, function (_a) {
|
|
7574
|
+
switch (_a.label) {
|
|
7575
|
+
case 0:
|
|
7576
|
+
_a.trys.push([0, 4, , 5]);
|
|
7577
|
+
if (!!url.includes("://")) return [3 /*break*/, 3];
|
|
7578
|
+
return [4 /*yield*/, service.getRestUrl()];
|
|
7579
|
+
case 1:
|
|
7580
|
+
restUrl = _a.sent();
|
|
7581
|
+
return [4 /*yield*/, user.getAuthHeader()];
|
|
7582
|
+
case 2:
|
|
7583
|
+
authHeader = _a.sent();
|
|
7584
|
+
headers = new Headers(originalReq.headers);
|
|
7585
|
+
headers.append("Authorization", authHeader);
|
|
7586
|
+
request = new Request(restUrl + url, __assign(__assign({}, originalReq), { headers: headers }));
|
|
7587
|
+
return [2 /*return*/, fetch(request)];
|
|
7588
|
+
case 3: return [2 /*return*/, fetch(url, originalReq)];
|
|
7589
|
+
case 4:
|
|
7590
|
+
err_1 = _a.sent();
|
|
7591
|
+
throw new Error("Error fetching requested URL: " + err_1);
|
|
7592
|
+
case 5: return [2 /*return*/];
|
|
7593
|
+
}
|
|
7594
|
+
});
|
|
7595
|
+
});
|
|
7596
|
+
};
|
|
7597
|
+
/**
|
|
7598
|
+
* Formats the request response to an object<T> or {}
|
|
7599
|
+
* @param response The response to be formatted
|
|
7600
|
+
* @returns Whether a Promise<T> if the response status is in the range 200-299 an error
|
|
7601
|
+
*/
|
|
7602
|
+
CustomHttpClient.formatResponse = function (response) {
|
|
7603
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
7604
|
+
var contentType, formatter, formattedContentType, _a;
|
|
7605
|
+
return __generator(this, function (_b) {
|
|
7606
|
+
switch (_b.label) {
|
|
7607
|
+
case 0:
|
|
7608
|
+
contentType = response.headers.get("content-type");
|
|
7609
|
+
formatter = CustomHttpClient._responseFormatterMap.get(contentType);
|
|
7610
|
+
if (!formatter) return [3 /*break*/, 2];
|
|
7611
|
+
return [4 /*yield*/, formatter(response)];
|
|
7612
|
+
case 1:
|
|
7613
|
+
_a = _b.sent();
|
|
7614
|
+
return [3 /*break*/, 3];
|
|
7615
|
+
case 2:
|
|
7616
|
+
_a = {};
|
|
7617
|
+
_b.label = 3;
|
|
7618
|
+
case 3:
|
|
7619
|
+
formattedContentType = _a;
|
|
7620
|
+
if (response.ok)
|
|
7621
|
+
return [2 /*return*/, formattedContentType];
|
|
7622
|
+
throw new Error(JSON.stringify(formattedContentType));
|
|
7623
|
+
}
|
|
7624
|
+
});
|
|
7625
|
+
});
|
|
7626
|
+
};
|
|
7627
|
+
CustomHttpClient._responseFormatterMap = new Map([
|
|
7628
|
+
["application/json", formatJsonResponse],
|
|
7629
|
+
["application/octet-stream", formatBlobResponse]
|
|
7630
|
+
]);
|
|
7631
|
+
return CustomHttpClient;
|
|
7632
|
+
}());
|
|
7633
|
+
|
|
7634
|
+
/**
|
|
7635
|
+
* Custom translator for cases when is not possible to use the "TranslateService" from "@ngx-translate/core"
|
|
7636
|
+
*/
|
|
7637
|
+
var CustomTranslationsService = /** @class */ (function () {
|
|
7638
|
+
function CustomTranslationsService() {
|
|
7639
|
+
}
|
|
7640
|
+
/**
|
|
7641
|
+
* Method used to get the translation for an key based on the host project's translations. Always use the first available language
|
|
7642
|
+
* @param key Key used to search the translation
|
|
7643
|
+
* @returns The translation for the informed key or the key in case there is no translation
|
|
7644
|
+
*/
|
|
7645
|
+
CustomTranslationsService.translate = function (key) {
|
|
7646
|
+
var _a, _b;
|
|
7647
|
+
if (key === undefined || key === null)
|
|
7648
|
+
return "";
|
|
7649
|
+
var translationKey = "" + CustomTranslationsService._TRANSLATION_PREFIX + key;
|
|
7650
|
+
var firstLanguageTranslations = (_a = Object.values(CustomTranslationsService._translations)[0]) !== null && _a !== void 0 ? _a : {};
|
|
7651
|
+
return (_b = firstLanguageTranslations[translationKey]) !== null && _b !== void 0 ? _b : translationKey;
|
|
7652
|
+
};
|
|
7653
|
+
/**
|
|
7654
|
+
* Method used to set the translations that will be used as base when calling the "translate" method
|
|
7655
|
+
* @param translations Translations to use as base
|
|
7656
|
+
*/
|
|
7657
|
+
CustomTranslationsService.setTranslations = function (translations) {
|
|
7658
|
+
CustomTranslationsService._translations = translations !== null && translations !== void 0 ? translations : {};
|
|
7659
|
+
};
|
|
7660
|
+
/**
|
|
7661
|
+
* Method used to set the prefix that will be used when calling the "translate" method
|
|
7662
|
+
* @param hostProjectConfigs The host project's configs used to create the prefix
|
|
7663
|
+
*/
|
|
7664
|
+
CustomTranslationsService.setTranslationsPrefix = function (hostProjectConfigs) {
|
|
7665
|
+
var _a = hostProjectConfigs !== null && hostProjectConfigs !== void 0 ? hostProjectConfigs : {}, domain = _a.domain, service = _a.service;
|
|
7666
|
+
var prefix = domain + "." + service + ".";
|
|
7667
|
+
CustomTranslationsService._TRANSLATION_PREFIX = prefix;
|
|
7668
|
+
};
|
|
7669
|
+
CustomTranslationsService._translations = {};
|
|
7670
|
+
CustomTranslationsService._TRANSLATION_PREFIX = "";
|
|
7671
|
+
return CustomTranslationsService;
|
|
7672
|
+
}());
|
|
7673
|
+
|
|
7674
|
+
/**
|
|
7675
|
+
* Responsible for setting up the translations that will be used by the "CustomTranslationsService".
|
|
7676
|
+
* Uses the host project's translations set by using the "TranslationsModule" from "@seniorsistemas/platform-components"
|
|
7677
|
+
*/
|
|
7678
|
+
var CustomTranslationsModule = /** @class */ (function () {
|
|
7679
|
+
function CustomTranslationsModule(translate, hostProjectConfigs) {
|
|
7680
|
+
this.translate = translate;
|
|
7681
|
+
this.hostProjectConfigs = hostProjectConfigs;
|
|
7682
|
+
this.factoryTranslations(this.translate, this.hostProjectConfigs);
|
|
7683
|
+
}
|
|
7684
|
+
CustomTranslationsModule.prototype.factoryTranslations = function (translate, hostProjectConfigs) {
|
|
7685
|
+
CustomTranslationsService.setTranslations(translate.translations);
|
|
7686
|
+
CustomTranslationsService.setTranslationsPrefix(hostProjectConfigs);
|
|
7687
|
+
};
|
|
7688
|
+
CustomTranslationsModule.ctorParameters = function () { return [
|
|
7689
|
+
{ type: TranslateService },
|
|
7690
|
+
{ type: undefined, decorators: [{ type: Inject, args: [HostProjectConfigsInjectionToken,] }] }
|
|
7691
|
+
]; };
|
|
7692
|
+
CustomTranslationsModule = __decorate([
|
|
7693
|
+
NgModule(),
|
|
7694
|
+
__param(1, Inject(HostProjectConfigsInjectionToken))
|
|
7695
|
+
], CustomTranslationsModule);
|
|
7696
|
+
return CustomTranslationsModule;
|
|
7697
|
+
}());
|
|
7698
|
+
|
|
7699
|
+
/**
|
|
7700
|
+
* Function to get the position of the first occurrence of a regex in a string
|
|
7701
|
+
* @param string The string to search into
|
|
7702
|
+
* @param regex The regex to search into the string
|
|
7703
|
+
* @param position The index at which to begin searching the string. If omitted, search starts at the index 0.
|
|
7704
|
+
* @returns the position of the first occurrence of the informed regex.
|
|
7705
|
+
*/
|
|
7706
|
+
function regexIndexOf(string, regex, position) {
|
|
7707
|
+
var indexOf = string.substring(position || 0).search(regex);
|
|
7708
|
+
return (indexOf >= 0) ? (indexOf + (position || 0)) : indexOf;
|
|
7709
|
+
}
|
|
7710
|
+
|
|
7711
|
+
var MarkerSeverity;
|
|
7712
|
+
(function (MarkerSeverity) {
|
|
7713
|
+
MarkerSeverity[MarkerSeverity["Error"] = 0] = "Error";
|
|
7714
|
+
MarkerSeverity[MarkerSeverity["Info"] = 1] = "Info";
|
|
7715
|
+
MarkerSeverity[MarkerSeverity["Warning"] = 2] = "Warning";
|
|
7716
|
+
})(MarkerSeverity || (MarkerSeverity = {}));
|
|
7717
|
+
|
|
7718
|
+
/* Enums */
|
|
7719
|
+
|
|
7720
|
+
var diagnosticSeverityInMarkerSeverityMap = new Map([
|
|
7721
|
+
[MarkerSeverity.Error, "error"],
|
|
7722
|
+
[MarkerSeverity.Info, "info"],
|
|
7723
|
+
[MarkerSeverity.Warning, "warning"]
|
|
7724
|
+
]);
|
|
7725
|
+
function convertMarkersToDiagnostics(markers, textLength) {
|
|
7726
|
+
return markers.map(function (marker) {
|
|
7727
|
+
var _a, _b;
|
|
7728
|
+
return ({
|
|
7729
|
+
from: marker.start || 0,
|
|
7730
|
+
to: marker.end || textLength,
|
|
7731
|
+
message: (_a = marker.message) !== null && _a !== void 0 ? _a : "",
|
|
7732
|
+
severity: (_b = diagnosticSeverityInMarkerSeverityMap.get(marker.severity)) !== null && _b !== void 0 ? _b : "error"
|
|
7733
|
+
});
|
|
7734
|
+
});
|
|
7735
|
+
}
|
|
7736
|
+
|
|
7737
|
+
function isCurrentPositionInsideString(stringBeforeCurrentPosition) {
|
|
7738
|
+
var _a;
|
|
7739
|
+
var doubleQuotesQuantity = ((_a = stringBeforeCurrentPosition.match(/"/g)) === null || _a === void 0 ? void 0 : _a.length) || 0;
|
|
7740
|
+
return doubleQuotesQuantity % 2 !== 0;
|
|
7741
|
+
}
|
|
7742
|
+
|
|
7743
|
+
var AutocompleteService = /** @class */ (function () {
|
|
7744
|
+
function AutocompleteService() {
|
|
7745
|
+
}
|
|
7746
|
+
AutocompleteService.listContextMetadataById = function (request, abortSignal) {
|
|
7747
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
7748
|
+
return __generator(this, function (_a) {
|
|
7749
|
+
return [2 /*return*/, CustomHttpClient.POST(AutocompleteService.BASE_URL + "/queries/listContextMetadataById", request, {
|
|
7750
|
+
signal: abortSignal
|
|
7751
|
+
})];
|
|
7752
|
+
});
|
|
7753
|
+
});
|
|
7754
|
+
};
|
|
7755
|
+
AutocompleteService.listExpressionMetadata = function (request, abortSignal) {
|
|
7756
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
7757
|
+
return __generator(this, function (_a) {
|
|
7758
|
+
return [2 /*return*/, CustomHttpClient.POST(AutocompleteService.BASE_URL + "/queries/listExpressionMetadata", request, {
|
|
7759
|
+
signal: abortSignal
|
|
7760
|
+
})];
|
|
7761
|
+
});
|
|
7762
|
+
});
|
|
7763
|
+
};
|
|
7764
|
+
AutocompleteService.listFacadeMetadataNames = function (request, abortSignal) {
|
|
7765
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
7766
|
+
return __generator(this, function (_a) {
|
|
7767
|
+
return [2 /*return*/, CustomHttpClient.POST(AutocompleteService.BASE_URL + "/queries/listFacadeMetadataNames", request, {
|
|
7768
|
+
signal: abortSignal
|
|
7769
|
+
})];
|
|
7770
|
+
});
|
|
7771
|
+
});
|
|
7772
|
+
};
|
|
7773
|
+
AutocompleteService.getFacadeMetadataByPath = function (request, abortSignal) {
|
|
7774
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
7775
|
+
return __generator(this, function (_a) {
|
|
7776
|
+
return [2 /*return*/, CustomHttpClient.POST(AutocompleteService.BASE_URL + "/queries/getFacadeMetadataByPath", request, {
|
|
7777
|
+
signal: abortSignal
|
|
7778
|
+
})];
|
|
7779
|
+
});
|
|
7780
|
+
});
|
|
7781
|
+
};
|
|
7782
|
+
AutocompleteService.BASE_URL = "platform/rule_metadata";
|
|
7783
|
+
return AutocompleteService;
|
|
7784
|
+
}());
|
|
7785
|
+
|
|
7786
|
+
/**
|
|
7787
|
+
* Adds style to autocomplete's state-wrapper
|
|
7788
|
+
* @returns An extension containing the style
|
|
7789
|
+
*/
|
|
7790
|
+
function style() {
|
|
7791
|
+
return EditorView.theme({
|
|
7792
|
+
".s-code-editor-taxCalculation-autocomplete-ul": {
|
|
7793
|
+
"padding": ".75rem !important",
|
|
7794
|
+
},
|
|
7795
|
+
".s-code-editor-taxCalculation-autocomplete-li": {
|
|
7796
|
+
cursor: "default !important",
|
|
7797
|
+
"line-height": "1.375em !important",
|
|
7798
|
+
},
|
|
7799
|
+
});
|
|
7800
|
+
}
|
|
7801
|
+
|
|
7802
|
+
var htmlElementToBeWrapped = null;
|
|
7803
|
+
/**
|
|
7804
|
+
* Adds a view updates's listener that creates an state over the autocomplete
|
|
7805
|
+
* @returns An extension containing everything needed to listen the updates and create the autocomplete's state
|
|
7806
|
+
*/
|
|
7807
|
+
function autocompleteStateWrapper() {
|
|
7808
|
+
return [
|
|
7809
|
+
autocompleteStateWrapperStateField(),
|
|
7810
|
+
style()
|
|
7811
|
+
];
|
|
7812
|
+
}
|
|
7813
|
+
/**
|
|
7814
|
+
* Shows a state on a non-clickable autocomplete item's format with an HTMLElement inside
|
|
7815
|
+
* @param element The HTMLElement to show inside the state
|
|
7816
|
+
*/
|
|
7817
|
+
function showAutocompleteStateWrapper(element) {
|
|
7818
|
+
htmlElementToBeWrapped = element;
|
|
7819
|
+
CodeMirror6Core.updateEditorView();
|
|
7820
|
+
}
|
|
7821
|
+
/**
|
|
7822
|
+
* Removes a possible showed autocomplete state
|
|
7823
|
+
*/
|
|
7824
|
+
function hideAutocompleteStateWrapper() {
|
|
7825
|
+
htmlElementToBeWrapped = null;
|
|
7826
|
+
CodeMirror6Core.updateEditorView();
|
|
7827
|
+
}
|
|
7828
|
+
/*
|
|
7829
|
+
* Creates and returns a StateField responsible for listening the view's change and to add the autocomplete state's wrapper
|
|
7830
|
+
*/
|
|
7831
|
+
function autocompleteStateWrapperStateField() {
|
|
7832
|
+
return StateField.define({
|
|
7833
|
+
create: getAutocompleteStateWrapper,
|
|
7834
|
+
update: function (_, transaction) {
|
|
7835
|
+
return getAutocompleteStateWrapper(transaction.state);
|
|
7836
|
+
},
|
|
7837
|
+
provide: function (field) {
|
|
7838
|
+
return showTooltip.compute([field], function (state) { return state.field(field); });
|
|
7839
|
+
}
|
|
7840
|
+
});
|
|
7841
|
+
}
|
|
7842
|
+
/*
|
|
7843
|
+
* Function responsible for creating the state's wrapper and returning the same as a Tooltip from "@codemirror/tooltip";
|
|
7844
|
+
* Only creates the Tooltip if the theres is element on the "htmlElementToBeWrapped" variable;
|
|
7845
|
+
* The same will also be removed when any view update is emitted;
|
|
7846
|
+
*/
|
|
7847
|
+
function getAutocompleteStateWrapper(state) {
|
|
7848
|
+
if (!htmlElementToBeWrapped)
|
|
7849
|
+
return;
|
|
7850
|
+
var htmlElementToBeWrappedString = htmlElementToBeWrapped.outerHTML;
|
|
7851
|
+
var stateWrapper = {
|
|
7852
|
+
pos: state.selection.ranges[0].head,
|
|
7853
|
+
create: function () { return ({ dom: getAutocompleteStateWrapperDomElement(htmlElementToBeWrappedString) }); }
|
|
7854
|
+
};
|
|
7855
|
+
htmlElementToBeWrapped = null;
|
|
7856
|
+
return stateWrapper;
|
|
7857
|
+
}
|
|
7858
|
+
function getAutocompleteStateWrapperDomElement(elementToBeWrappedString) {
|
|
7859
|
+
var wrapperDiv = document.createElement("div");
|
|
7860
|
+
wrapperDiv.className = "cm-tooltip-autocomplete cm-tooltip";
|
|
7861
|
+
wrapperDiv.innerHTML =
|
|
7862
|
+
"\n <ul class=\"s-code-editor-taxCalculation-autocomplete-ul\">\n <li class=\"s-code-editor-taxCalculation-autocomplete-li\">\n " + elementToBeWrappedString + "\n </li>\n </ul>\n\n ";
|
|
7863
|
+
return wrapperDiv;
|
|
7864
|
+
}
|
|
7865
|
+
|
|
7866
|
+
var autocompleteLoadingStateHTMLElement;
|
|
7867
|
+
/**
|
|
7868
|
+
* Adds a loading-state over the autocomplete
|
|
7869
|
+
* @returns An extension containing everything needed to add the loading-state
|
|
7870
|
+
*/
|
|
7871
|
+
function autocompleteLoadingState() {
|
|
7872
|
+
return [autocompleteStateWrapper()];
|
|
7873
|
+
}
|
|
7874
|
+
/**
|
|
7875
|
+
* Activates the loading state on the autocomplete
|
|
7876
|
+
*/
|
|
7877
|
+
/*
|
|
7878
|
+
* Must set the "autocompleteLoadingStateHTMLElement" here for when the document is loaded we do not have
|
|
7879
|
+
* yet the "CustomTranslationsService" ready
|
|
7880
|
+
*/
|
|
7881
|
+
function showAutocompleteLoadingState() {
|
|
7882
|
+
if (!autocompleteLoadingStateHTMLElement) {
|
|
7883
|
+
autocompleteLoadingStateHTMLElement = getAutocompleteLoadingStateHTMLElement();
|
|
7884
|
+
}
|
|
7885
|
+
showAutocompleteStateWrapper(autocompleteLoadingStateHTMLElement);
|
|
7886
|
+
}
|
|
7887
|
+
function getAutocompleteLoadingStateHTMLElement() {
|
|
7888
|
+
var loadingStateSpanWrapper = document.createElement("span");
|
|
7889
|
+
loadingStateSpanWrapper.innerText = CustomTranslationsService.translate("core_language_tax_calculation_fetching_suggestions");
|
|
7890
|
+
return loadingStateSpanWrapper;
|
|
7891
|
+
}
|
|
7892
|
+
|
|
7893
|
+
var autocompleteEmptyStateHTMLElement;
|
|
7894
|
+
/**
|
|
7895
|
+
* Adds an empty-state over the autocomplete
|
|
7896
|
+
* @returns An extension containing everything needed to add the empty-state
|
|
7897
|
+
*/
|
|
7898
|
+
function autocompleteEmptyState() {
|
|
7899
|
+
return [autocompleteStateWrapper()];
|
|
7900
|
+
}
|
|
7901
|
+
/**
|
|
7902
|
+
* Activates the empty-state on the autocomplete
|
|
7903
|
+
*/
|
|
7904
|
+
/*
|
|
7905
|
+
* Must set the "autocompleteEmptyStateHTMLElement" here for when the document is loaded we do not have
|
|
7906
|
+
* yet the "CustomTranslationsService" ready
|
|
7907
|
+
*/
|
|
7908
|
+
function showAutocompleteEmptyState() {
|
|
7909
|
+
if (!autocompleteEmptyStateHTMLElement) {
|
|
7910
|
+
autocompleteEmptyStateHTMLElement = getAutocompleteEmptyStateHTMLElement();
|
|
7911
|
+
}
|
|
7912
|
+
showAutocompleteStateWrapper(autocompleteEmptyStateHTMLElement);
|
|
7913
|
+
}
|
|
7914
|
+
function getAutocompleteEmptyStateHTMLElement() {
|
|
7915
|
+
var emptyStateSpanWrapper = document.createElement("span");
|
|
7916
|
+
emptyStateSpanWrapper.innerText = CustomTranslationsService.translate("core_language_tax_calculation_no_suggestions");
|
|
7917
|
+
return emptyStateSpanWrapper;
|
|
7918
|
+
}
|
|
7919
|
+
|
|
7920
|
+
var TaxCalculationLanguageConfigs = /** @class */ (function () {
|
|
7921
|
+
function TaxCalculationLanguageConfigs() {
|
|
7922
|
+
}
|
|
7923
|
+
TaxCalculationLanguageConfigs.setConfigs = function (configs) {
|
|
7924
|
+
TaxCalculationLanguageConfigs.CONFIGS = JSON.parse(JSON.stringify(configs));
|
|
7925
|
+
};
|
|
7926
|
+
TaxCalculationLanguageConfigs.getConfigs = function () {
|
|
7927
|
+
return TaxCalculationLanguageConfigs.CONFIGS;
|
|
7928
|
+
};
|
|
7929
|
+
TaxCalculationLanguageConfigs.CONFIGS = { contexts: [] };
|
|
7930
|
+
return TaxCalculationLanguageConfigs;
|
|
7931
|
+
}());
|
|
7932
|
+
|
|
7933
|
+
/**
|
|
7934
|
+
* Gets the configs for the TaxCalculationLanguage
|
|
7935
|
+
* @returns The configs
|
|
7936
|
+
*/
|
|
7937
|
+
function getLanguageConfigs() {
|
|
7938
|
+
var _a;
|
|
7939
|
+
var configs = TaxCalculationLanguageConfigs.getConfigs();
|
|
7940
|
+
if (!((_a = configs.contexts) === null || _a === void 0 ? void 0 : _a.length))
|
|
7941
|
+
throw new Error("In order to use the TaxCalculation Language's autocomplete, "
|
|
7942
|
+
+ "one must inform at least one context by using the "
|
|
7943
|
+
+ "'TaxCalculationLanguageConfigs.setConfigs()'");
|
|
7944
|
+
return configs;
|
|
7945
|
+
}
|
|
7946
|
+
|
|
7947
|
+
/**
|
|
7948
|
+
* Wraps the request to return the same with an identification or undefined in case of error, so the promise will
|
|
7949
|
+
* always trigger the "then"
|
|
7950
|
+
* @param request Request to wrap
|
|
7951
|
+
* @returns The typed request's response
|
|
7952
|
+
*/
|
|
7953
|
+
function getSafeResponse(request) {
|
|
7954
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
7955
|
+
var _a, _b, _1;
|
|
7956
|
+
return __generator(this, function (_c) {
|
|
7957
|
+
switch (_c.label) {
|
|
7958
|
+
case 0:
|
|
7959
|
+
_c.trys.push([0, 2, , 3]);
|
|
7960
|
+
_a = [__assign({}, request)];
|
|
7961
|
+
_b = {};
|
|
7962
|
+
return [4 /*yield*/, request.request];
|
|
7963
|
+
case 1: return [2 /*return*/, __assign.apply(void 0, _a.concat([(_b.response = _c.sent(), _b)]))];
|
|
7964
|
+
case 2:
|
|
7965
|
+
_1 = _c.sent();
|
|
7966
|
+
return [3 /*break*/, 3];
|
|
7967
|
+
case 3: return [2 /*return*/];
|
|
7968
|
+
}
|
|
7969
|
+
});
|
|
7970
|
+
});
|
|
7971
|
+
}
|
|
7972
|
+
|
|
7973
|
+
var completionItemsMap = new Map();
|
|
7974
|
+
var usefulToCompletionItemsCompletionTypes = [
|
|
7975
|
+
CompletionTypes.Expression,
|
|
7976
|
+
CompletionTypes.UserExpression,
|
|
7977
|
+
CompletionTypes.FinalValue
|
|
7978
|
+
];
|
|
7979
|
+
/*
|
|
7980
|
+
* Updates the completionItems used by the core.
|
|
7981
|
+
* Utilizes the path and filter to create a key and store the results from the search to the given "path.filter" on a map.
|
|
7982
|
+
* Must save the results to each different filter for the search does not bring all the results, so the user must do a more
|
|
7983
|
+
* specific filter to achieve its objective
|
|
7984
|
+
*/
|
|
7985
|
+
function updateCoreCompletionItems(completionItem) {
|
|
7986
|
+
var path = completionItem.path, filter = completionItem.filter, completions = completionItem.completions;
|
|
7987
|
+
var mapPath = path + "." + filter;
|
|
7988
|
+
var filteredCompletions = (completions || []).filter(function (completion) {
|
|
7989
|
+
return usefulToCompletionItemsCompletionTypes.includes(completion === null || completion === void 0 ? void 0 : completion.type);
|
|
7990
|
+
});
|
|
7991
|
+
var formattedSearchResults = filteredCompletions.map(function (completion) {
|
|
7992
|
+
return path === "" ? completion === null || completion === void 0 ? void 0 : completion.label : path + "." + (completion === null || completion === void 0 ? void 0 : completion.label);
|
|
7993
|
+
});
|
|
7994
|
+
completionItemsMap.delete(mapPath);
|
|
7995
|
+
if (formattedSearchResults.length) {
|
|
7996
|
+
completionItemsMap.set(mapPath, formattedSearchResults);
|
|
7997
|
+
}
|
|
7998
|
+
var allArraysFromMap = Array.from(completionItemsMap.values());
|
|
7999
|
+
var unrepeatedCompletionItems = new Set(allArraysFromMap.flat());
|
|
8000
|
+
CodeMirror6Core
|
|
8001
|
+
.$onCompletionItemsUpdate
|
|
8002
|
+
.next(Array.from(unrepeatedCompletionItems));
|
|
8003
|
+
}
|
|
8004
|
+
|
|
8005
|
+
/**
|
|
8006
|
+
* Adds style to the autocomplete
|
|
8007
|
+
* @returns An extension containing the style
|
|
8008
|
+
*/
|
|
8009
|
+
function style$1() {
|
|
8010
|
+
return EditorView.theme({
|
|
8011
|
+
".cm-completionIcon": {
|
|
8012
|
+
"font-family": "'Font Awesome 5 Pro'",
|
|
8013
|
+
"font-weight": "900",
|
|
8014
|
+
},
|
|
8015
|
+
".cm-completionIcon-keyword::after": {
|
|
8016
|
+
"content": getIconBasedOnUnicode("f084"),
|
|
8017
|
+
},
|
|
8018
|
+
".cm-completionIcon-context::after": {
|
|
8019
|
+
"content": getIconBasedOnUnicode("f466"),
|
|
8020
|
+
},
|
|
8021
|
+
".cm-completionIcon-expression::after": {
|
|
8022
|
+
"content": getIconBasedOnUnicode("f505"),
|
|
8023
|
+
},
|
|
8024
|
+
".cm-completionIcon-userExpression::after": {
|
|
8025
|
+
"content": getIconBasedOnUnicode("f4ff"),
|
|
8026
|
+
},
|
|
8027
|
+
".cm-completionIcon-entity::after": {
|
|
8028
|
+
"content": getIconBasedOnUnicode("f126"),
|
|
8029
|
+
},
|
|
8030
|
+
".cm-completionIcon-finalValue::after": {
|
|
8031
|
+
"content": getIconBasedOnUnicode("f192"),
|
|
8032
|
+
},
|
|
8033
|
+
});
|
|
8034
|
+
}
|
|
8035
|
+
function getIconBasedOnUnicode(unicode) {
|
|
8036
|
+
return "\"\\" + unicode + "\"";
|
|
8037
|
+
}
|
|
8038
|
+
|
|
8039
|
+
/**
|
|
8040
|
+
* Adds an autocomplete to the editor
|
|
8041
|
+
* @returns An extension containing everything needed to create the autocomplete
|
|
8042
|
+
*/
|
|
8043
|
+
function autocomplete() {
|
|
8044
|
+
return [
|
|
8045
|
+
autocompletion({ override: [getCompletionResults] }),
|
|
8046
|
+
autocompleteLoadingState(),
|
|
8047
|
+
autocompleteEmptyState(),
|
|
8048
|
+
style$1(),
|
|
8049
|
+
];
|
|
8050
|
+
}
|
|
8051
|
+
var TRANSLATION_PREFIX = "core_language_tax_calculation";
|
|
8052
|
+
var completionResults;
|
|
8053
|
+
/*
|
|
8054
|
+
* A function to be called when a key is pressed, the ctrl+space is triggered or when the search for completionResults is done.
|
|
8055
|
+
* If there is a completionResult, returns it, otherwise starts a new async search.
|
|
8056
|
+
* Will only execute the autocompletion if the current cursor position is not inside a string
|
|
8057
|
+
*/
|
|
8058
|
+
function getCompletionResults(context) {
|
|
8059
|
+
var isCursorInsideString = isCurrentPositionInsideString(context.state.doc.toString().substring(0, context.pos));
|
|
8060
|
+
if (isCursorInsideString)
|
|
8061
|
+
return;
|
|
8062
|
+
if (completionResults) {
|
|
8063
|
+
var finalCompletionResults = __assign({}, completionResults);
|
|
8064
|
+
var codeLength = context.state.doc.toString().length;
|
|
8065
|
+
finalCompletionResults.from = finalCompletionResults.from > codeLength
|
|
8066
|
+
? codeLength
|
|
8067
|
+
: finalCompletionResults.from;
|
|
8068
|
+
completionResults = null;
|
|
8069
|
+
return finalCompletionResults;
|
|
8070
|
+
}
|
|
8071
|
+
startCompletionResultsSearch(context);
|
|
8072
|
+
}
|
|
8073
|
+
var cancelLastCompletionSearch = function () { };
|
|
8074
|
+
var ɵ0 = cancelLastCompletionSearch;
|
|
8075
|
+
var codeMirrorViewElement;
|
|
8076
|
+
/*
|
|
8077
|
+
* Starts a new completionResults's async search.
|
|
8078
|
+
* Avoids the last search to be finished by calling the "cancelLastCompletionSearch" callback function
|
|
8079
|
+
*/
|
|
8080
|
+
function startCompletionResultsSearch(context) {
|
|
8081
|
+
var token = new AbortController();
|
|
8082
|
+
setTimeout(function () {
|
|
8083
|
+
if (!token.signal.aborted) {
|
|
8084
|
+
showAutocompleteLoadingState();
|
|
8085
|
+
searchCompletionResults(context, token);
|
|
8086
|
+
}
|
|
8087
|
+
}, 500);
|
|
8088
|
+
/*
|
|
8089
|
+
* IMPORTANT: The following lines MUST be the way they are!
|
|
8090
|
+
* Here is being add the listener to any keydown/click event so when any key is downed or mouse clicked, we cancel the last request.
|
|
8091
|
+
* We do this to not show to the user a completionItem in an incorrect place of text, that can be done by either pressing the
|
|
8092
|
+
* arrows, home, end, backspace and etc. The flow is:
|
|
8093
|
+
* 1. We add an eventListener to keydown/click when the autocompletion's request is triggered;
|
|
8094
|
+
* 2. When any key/click is pressed, we remove the listener and cancel the last request by changing the isSearchCanceled on token object
|
|
8095
|
+
* to true;
|
|
8096
|
+
* 3. If any key that requires autocompletion is triggered, the flow repeats;
|
|
8097
|
+
*/
|
|
8098
|
+
codeMirrorViewElement = CodeMirror6Core.getEditorView().contentDOM;
|
|
8099
|
+
cancelLastCompletionSearch = function () {
|
|
8100
|
+
codeMirrorViewElement.removeEventListener("keydown", cancelLastCompletionSearch);
|
|
8101
|
+
codeMirrorViewElement.removeEventListener("click", cancelLastCompletionSearch);
|
|
8102
|
+
token.abort();
|
|
8103
|
+
};
|
|
8104
|
+
codeMirrorViewElement.addEventListener("keydown", cancelLastCompletionSearch);
|
|
8105
|
+
codeMirrorViewElement.addEventListener("click", cancelLastCompletionSearch);
|
|
8106
|
+
}
|
|
8107
|
+
/*
|
|
8108
|
+
* Requests the necessary items to fill the completionResults, although it only really opens the autocomplete
|
|
8109
|
+
* box (by calling the "startCompletion()", that calls the "getCompletionResults") if the current search was not cancelled
|
|
8110
|
+
* by a new one
|
|
8111
|
+
*/
|
|
8112
|
+
function searchCompletionResults(context, token) {
|
|
8113
|
+
var _a, _b, _c, _d;
|
|
8114
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
8115
|
+
var codeBeforeCursor, filter, path, requests;
|
|
8116
|
+
return __generator(this, function (_e) {
|
|
8117
|
+
codeBeforeCursor = (_d = (_b = (_a = context === null || context === void 0 ? void 0 : context.state) === null || _a === void 0 ? void 0 : _a.doc) === null || _b === void 0 ? void 0 : _b.toString().substring(0, (_c = context === null || context === void 0 ? void 0 : context.pos) !== null && _c !== void 0 ? _c : 0)) !== null && _d !== void 0 ? _d : "";
|
|
8118
|
+
filter = getFilter(codeBeforeCursor);
|
|
8119
|
+
path = getPath(codeBeforeCursor, filter.length);
|
|
8120
|
+
requests = getRequestsBasedOnPath(path, filter, token.signal);
|
|
8121
|
+
Promise
|
|
8122
|
+
.all(requests)
|
|
8123
|
+
.then(function (responses) {
|
|
8124
|
+
if (!token.signal.aborted) {
|
|
8125
|
+
var completions = [].concat(getKeywordsCompletions(path), getContextsCompletions(responses), getExpressionsCompletions(responses), getEntitiesCompletions(responses));
|
|
8126
|
+
var filteredCompletions = getFilteredCompletions(completions, filter);
|
|
8127
|
+
if (filteredCompletions.length) {
|
|
8128
|
+
var formattedCompletions = getFormattedCompletions(filteredCompletions, filter);
|
|
8129
|
+
var sortedCompletions = getSortedCompletions(formattedCompletions);
|
|
8130
|
+
completionResults = {
|
|
8131
|
+
from: context.pos,
|
|
8132
|
+
filter: false,
|
|
8133
|
+
options: sortedCompletions
|
|
8134
|
+
};
|
|
8135
|
+
updateCoreCompletionItems({ path: path, filter: filter, completions: sortedCompletions });
|
|
8136
|
+
startCompletion(CodeMirror6Core.getEditorView());
|
|
8137
|
+
}
|
|
8138
|
+
else {
|
|
8139
|
+
showAutocompleteEmptyState();
|
|
8140
|
+
}
|
|
8141
|
+
}
|
|
8142
|
+
});
|
|
8143
|
+
return [2 /*return*/];
|
|
8144
|
+
});
|
|
8145
|
+
});
|
|
8146
|
+
}
|
|
8147
|
+
/*
|
|
8148
|
+
* Returns the filter in the code written.
|
|
8149
|
+
* For example in the code "controladoria.empresa", "empresa" would be the filter
|
|
8150
|
+
* and in "controladoria", "controladoria" would be the filter.
|
|
8151
|
+
* Allows only alphanumerics, underscore and hashtag on filter's start.
|
|
8152
|
+
* Does not allow spaces
|
|
8153
|
+
*/
|
|
8154
|
+
function getFilter(string) {
|
|
8155
|
+
var _a, _b;
|
|
8156
|
+
if (string === undefined || string === null)
|
|
8157
|
+
return "";
|
|
8158
|
+
var filter = (_b = (_a = string.match(/(#|\.|)\w*$/)) === null || _a === void 0 ? void 0 : _a[0]) !== null && _b !== void 0 ? _b : "";
|
|
8159
|
+
return filter.replace(".", "").trim();
|
|
8160
|
+
}
|
|
8161
|
+
/*
|
|
8162
|
+
* Returns the path in the code written based on filter.
|
|
8163
|
+
* For example in the code "controladoria.empresa", "controladoria" would be the path
|
|
8164
|
+
* and in "controladoria", "" would be the path.
|
|
8165
|
+
* Does not allow spaces
|
|
8166
|
+
*/
|
|
8167
|
+
function getPath(string, filterLength) {
|
|
8168
|
+
var _a, _b;
|
|
8169
|
+
if (string === undefined || string === null)
|
|
8170
|
+
return "";
|
|
8171
|
+
var stringWithoutPath = string.substring(0, string.length - filterLength);
|
|
8172
|
+
var path = (_b = (_a = stringWithoutPath.match(/(\w*\.)*$/)) === null || _a === void 0 ? void 0 : _a[0]) !== null && _b !== void 0 ? _b : "";
|
|
8173
|
+
return path.replace(/\.$/, "");
|
|
8174
|
+
}
|
|
8175
|
+
function getRequestsBasedOnPath(path, filter, abortSignal) {
|
|
8176
|
+
var _a;
|
|
8177
|
+
var languageConfigs = getLanguageConfigs();
|
|
8178
|
+
var requests = [];
|
|
8179
|
+
if (path === "") {
|
|
8180
|
+
requests.push({
|
|
8181
|
+
requestType: RequestTypes.ListContextMetadataById,
|
|
8182
|
+
request: AutocompleteService.listContextMetadataById({
|
|
8183
|
+
id: languageConfigs.contexts,
|
|
8184
|
+
}, abortSignal)
|
|
8185
|
+
});
|
|
8186
|
+
requests.push({
|
|
8187
|
+
requestType: RequestTypes.ListExpressionMetadata,
|
|
8188
|
+
request: AutocompleteService.listExpressionMetadata({
|
|
8189
|
+
context: languageConfigs.contexts,
|
|
8190
|
+
subcontext: (_a = languageConfigs.subContexts) !== null && _a !== void 0 ? _a : [],
|
|
8191
|
+
name: filter,
|
|
8192
|
+
pageRequest: {
|
|
8193
|
+
offset: 0,
|
|
8194
|
+
size: 20
|
|
8195
|
+
}
|
|
8196
|
+
}, abortSignal)
|
|
8197
|
+
});
|
|
8198
|
+
}
|
|
8199
|
+
else if (path.includes(".")) {
|
|
8200
|
+
var splittedPath = path.split(".");
|
|
8201
|
+
requests.push({
|
|
8202
|
+
requestType: RequestTypes.GetFacadeMetadataByPath,
|
|
8203
|
+
request: AutocompleteService.getFacadeMetadataByPath({
|
|
8204
|
+
context: splittedPath[0],
|
|
8205
|
+
entityName: splittedPath[1],
|
|
8206
|
+
fields: splittedPath[2] === undefined ? undefined : splittedPath.slice(2)
|
|
8207
|
+
}, abortSignal)
|
|
8208
|
+
});
|
|
8209
|
+
}
|
|
8210
|
+
else {
|
|
8211
|
+
requests.push({
|
|
8212
|
+
requestType: RequestTypes.ListFacadeMetadataNames,
|
|
8213
|
+
request: AutocompleteService.listFacadeMetadataNames({
|
|
8214
|
+
context: [path],
|
|
8215
|
+
name: filter,
|
|
8216
|
+
pageRequest: {
|
|
8217
|
+
offset: 0,
|
|
8218
|
+
size: 30
|
|
8219
|
+
}
|
|
8220
|
+
}, abortSignal)
|
|
8221
|
+
});
|
|
8222
|
+
}
|
|
8223
|
+
return requests.map(function (request) { return getSafeResponse(request); });
|
|
8224
|
+
}
|
|
8225
|
+
function getKeywordsCompletions(path) {
|
|
8226
|
+
if (path !== "")
|
|
8227
|
+
return [];
|
|
8228
|
+
var completions = [
|
|
8229
|
+
{
|
|
8230
|
+
label: Keywords.SE,
|
|
8231
|
+
apply: "SE ()\nENTAO\n\tacao\nFIM_SE",
|
|
8232
|
+
},
|
|
8233
|
+
{
|
|
8234
|
+
label: Keywords.SENAO,
|
|
8235
|
+
apply: "SENAO\n\tacao",
|
|
8236
|
+
},
|
|
8237
|
+
{
|
|
8238
|
+
label: Keywords.CONTENHA,
|
|
8239
|
+
apply: "CONTENHA(condicao)",
|
|
8240
|
+
},
|
|
8241
|
+
{
|
|
8242
|
+
label: Keywords.ENTAO,
|
|
8243
|
+
apply: "ENTAO\n\tacao",
|
|
8244
|
+
},
|
|
8245
|
+
{
|
|
8246
|
+
label: Keywords.FIM_SE,
|
|
8247
|
+
apply: "FIM_SE ",
|
|
8248
|
+
},
|
|
8249
|
+
{
|
|
8250
|
+
label: Keywords.NAO,
|
|
8251
|
+
apply: "NAO ",
|
|
8252
|
+
},
|
|
8253
|
+
{
|
|
8254
|
+
label: Keywords.E,
|
|
8255
|
+
apply: "E ",
|
|
8256
|
+
},
|
|
8257
|
+
{
|
|
8258
|
+
label: Keywords.OU,
|
|
8259
|
+
apply: "OU "
|
|
8260
|
+
},
|
|
8261
|
+
];
|
|
8262
|
+
return completions.map(function (completionItem) { return (__assign(__assign({}, completionItem), { detail: CustomTranslationsService.translate(TRANSLATION_PREFIX + "_keyword"), type: CompletionTypes.Keyword })); });
|
|
8263
|
+
}
|
|
8264
|
+
function getContextsCompletions(responses) {
|
|
8265
|
+
var _a, _b;
|
|
8266
|
+
var contextsResponse = responses.find(function (response) {
|
|
8267
|
+
return (response === null || response === void 0 ? void 0 : response.requestType) === RequestTypes.ListContextMetadataById;
|
|
8268
|
+
});
|
|
8269
|
+
if (contextsResponse) {
|
|
8270
|
+
return ((_b = (_a = contextsResponse.response) === null || _a === void 0 ? void 0 : _a.contextMetadata) !== null && _b !== void 0 ? _b : [])
|
|
8271
|
+
.map(function (contextMetadata) { return ({
|
|
8272
|
+
label: contextMetadata.name,
|
|
8273
|
+
detail: CustomTranslationsService.translate(TRANSLATION_PREFIX + "_context"),
|
|
8274
|
+
apply: contextMetadata.name,
|
|
8275
|
+
type: CompletionTypes.Context
|
|
8276
|
+
}); });
|
|
8277
|
+
}
|
|
8278
|
+
return [];
|
|
8279
|
+
}
|
|
8280
|
+
function getExpressionsCompletions(responses) {
|
|
8281
|
+
var _a, _b;
|
|
8282
|
+
var expressionsResponse = responses.find(function (response) {
|
|
8283
|
+
return (response === null || response === void 0 ? void 0 : response.requestType) === RequestTypes.ListExpressionMetadata;
|
|
8284
|
+
});
|
|
8285
|
+
if (expressionsResponse) {
|
|
8286
|
+
return ((_b = (_a = expressionsResponse.response) === null || _a === void 0 ? void 0 : _a.expressionMetadata) !== null && _b !== void 0 ? _b : [])
|
|
8287
|
+
.map(function (expressionMetadata) { return ({
|
|
8288
|
+
label: expressionMetadata.name,
|
|
8289
|
+
detail: CustomTranslationsService.translate(TRANSLATION_PREFIX + "_" + (expressionMetadata.type === MetaType.PUBLIC_EXPRESSION
|
|
8290
|
+
? "senior_expression"
|
|
8291
|
+
: "user_expression")),
|
|
8292
|
+
apply: expressionMetadata.name,
|
|
8293
|
+
info: expressionMetadata.description,
|
|
8294
|
+
type: expressionMetadata.type === MetaType.PUBLIC_EXPRESSION ? CompletionTypes.Expression : CompletionTypes.UserExpression
|
|
8295
|
+
}); });
|
|
8296
|
+
}
|
|
8297
|
+
return [];
|
|
8298
|
+
}
|
|
8299
|
+
function getEntitiesCompletions(responses) {
|
|
8300
|
+
var _a, _b, _c, _d, _e;
|
|
8301
|
+
var facadesResponseFromList = responses.find(function (response) {
|
|
8302
|
+
return (response === null || response === void 0 ? void 0 : response.requestType) === RequestTypes.ListFacadeMetadataNames;
|
|
8303
|
+
});
|
|
8304
|
+
if (facadesResponseFromList) {
|
|
8305
|
+
return ((_b = (_a = facadesResponseFromList.response) === null || _a === void 0 ? void 0 : _a.facadeMetadataNames) !== null && _b !== void 0 ? _b : [])
|
|
8306
|
+
.map(function (facade) { return ({
|
|
8307
|
+
label: facade.name,
|
|
8308
|
+
detail: CustomTranslationsService.translate(TRANSLATION_PREFIX + "_entity"),
|
|
8309
|
+
apply: facade.name,
|
|
8310
|
+
type: CompletionTypes.Entity
|
|
8311
|
+
}); });
|
|
8312
|
+
}
|
|
8313
|
+
var facadesResponseFromGet = responses.find(function (response) {
|
|
8314
|
+
return (response === null || response === void 0 ? void 0 : response.requestType) === RequestTypes.GetFacadeMetadataByPath;
|
|
8315
|
+
});
|
|
8316
|
+
if (facadesResponseFromGet) {
|
|
8317
|
+
return ((_e = (_d = (_c = facadesResponseFromGet.response) === null || _c === void 0 ? void 0 : _c.facadeMetadata) === null || _d === void 0 ? void 0 : _d.fields) !== null && _e !== void 0 ? _e : [])
|
|
8318
|
+
.map(function (facade) { return ({
|
|
8319
|
+
label: facade.name,
|
|
8320
|
+
detail: CustomTranslationsService.translate(TRANSLATION_PREFIX + "_" + (facade.type === MetaType.ENTITY
|
|
8321
|
+
? "entity"
|
|
8322
|
+
: "field")),
|
|
8323
|
+
apply: facade.name,
|
|
8324
|
+
type: facade.type === MetaType.ENTITY ? CompletionTypes.Entity : CompletionTypes.FinalValue
|
|
8325
|
+
}); });
|
|
8326
|
+
}
|
|
8327
|
+
return [];
|
|
8328
|
+
}
|
|
8329
|
+
/*
|
|
8330
|
+
* Filtering the completions to only deal with the necessary items
|
|
8331
|
+
*/
|
|
8332
|
+
function getFilteredCompletions(completions, filter) {
|
|
8333
|
+
return completions
|
|
8334
|
+
.filter(function (completionItem) {
|
|
8335
|
+
return completionItem
|
|
8336
|
+
.label
|
|
8337
|
+
.toLowerCase()
|
|
8338
|
+
.startsWith(filter.toLowerCase());
|
|
8339
|
+
});
|
|
8340
|
+
}
|
|
8341
|
+
/*
|
|
8342
|
+
* Overwriting the completions's apply to remove the entire current written value and apply the the entire completion's apply
|
|
8343
|
+
*/
|
|
8344
|
+
function getFormattedCompletions(completions, filter) {
|
|
8345
|
+
return completions
|
|
8346
|
+
.map(function (completionItem) { return (__assign(__assign({}, completionItem), { apply: getCompletionApply(filter, "" + completionItem.apply) })); });
|
|
8347
|
+
}
|
|
8348
|
+
function getCompletionApply(filter, oldApplyText) {
|
|
8349
|
+
return function (view, completion, from, to) {
|
|
8350
|
+
var newFrom = from - filter.length;
|
|
8351
|
+
view.dispatch({
|
|
8352
|
+
changes: {
|
|
8353
|
+
from: newFrom,
|
|
8354
|
+
to: to,
|
|
8355
|
+
insert: oldApplyText
|
|
8356
|
+
},
|
|
8357
|
+
selection: {
|
|
8358
|
+
anchor: newFrom + oldApplyText.length
|
|
8359
|
+
},
|
|
8360
|
+
userEvent: "input.complete",
|
|
8361
|
+
annotations: pickedCompletion.of(completion)
|
|
8362
|
+
});
|
|
8363
|
+
};
|
|
8364
|
+
}
|
|
8365
|
+
var completionsSortOrder = [
|
|
8366
|
+
CompletionTypes.Keyword,
|
|
8367
|
+
CompletionTypes.Context,
|
|
8368
|
+
CompletionTypes.UserExpression,
|
|
8369
|
+
CompletionTypes.Expression,
|
|
8370
|
+
CompletionTypes.Entity,
|
|
8371
|
+
CompletionTypes.FinalValue
|
|
8372
|
+
];
|
|
8373
|
+
/*
|
|
8374
|
+
* Sorts the completions following the "completionsSortOrder" priority order
|
|
8375
|
+
*/
|
|
8376
|
+
function getSortedCompletions(completions) {
|
|
8377
|
+
return completions.sort(function (x, y) {
|
|
8378
|
+
var xPriority = completionsSortOrder.indexOf(x.type);
|
|
8379
|
+
var yPriority = completionsSortOrder.indexOf(y.type);
|
|
8380
|
+
return xPriority - yPriority;
|
|
8381
|
+
});
|
|
8382
|
+
}
|
|
8383
|
+
|
|
8384
|
+
/**
|
|
8385
|
+
* Adds an watcher to the paste command that updates the core's completions items
|
|
8386
|
+
* @returns An extension containing everything needed to create the the updater
|
|
8387
|
+
*/
|
|
8388
|
+
function onPasteCompletionItemsUpdater() {
|
|
8389
|
+
return [
|
|
8390
|
+
keymap.of([
|
|
8391
|
+
{
|
|
8392
|
+
key: "Ctrl-v",
|
|
8393
|
+
run: searchCompletionResultsCommand,
|
|
8394
|
+
}
|
|
8395
|
+
])
|
|
8396
|
+
];
|
|
8397
|
+
}
|
|
8398
|
+
var cancelLastCompletionSearch$1 = function () { };
|
|
8399
|
+
var ɵ0$1 = cancelLastCompletionSearch$1;
|
|
8400
|
+
/*
|
|
8401
|
+
* Must use the setTimeout for we does not have access to the code pasted on the current state, so we need to wait codemirror
|
|
8402
|
+
* remake the state, also it would be way more difficult to work with the clipboard
|
|
8403
|
+
*/
|
|
8404
|
+
function searchCompletionResultsCommand(view) {
|
|
8405
|
+
cancelLastCompletionSearch$1();
|
|
8406
|
+
var token = new AbortController();
|
|
8407
|
+
setTimeout(function () {
|
|
8408
|
+
if (!token.signal.aborted) {
|
|
8409
|
+
searchCompletionResults$1(view.state.doc.toString(), token);
|
|
8410
|
+
}
|
|
8411
|
+
}, 200);
|
|
8412
|
+
cancelLastCompletionSearch$1 = function () { return token.abort(); };
|
|
8413
|
+
return false;
|
|
8414
|
+
}
|
|
8415
|
+
/*
|
|
8416
|
+
* Requests the necessary items to update the core's completionItems when the user uses the ctrl+v
|
|
8417
|
+
*/
|
|
8418
|
+
function searchCompletionResults$1(code, token) {
|
|
8419
|
+
var codeWithoutStrings = getCodeWithoutStringedCode(code);
|
|
8420
|
+
var variablesToVerify = getVariablesToVerify(codeWithoutStrings);
|
|
8421
|
+
var requests = getRequestsBasedOnVariables(variablesToVerify, token.signal);
|
|
8422
|
+
Promise
|
|
8423
|
+
.all(requests)
|
|
8424
|
+
.then(function (responses) {
|
|
8425
|
+
if (!token.signal.aborted) {
|
|
8426
|
+
var expressionsCompletionItems = getExpressionsCompletionsItems(responses);
|
|
8427
|
+
var entitiesCompletionItems = getEntitiesCompletionsItems(responses);
|
|
8428
|
+
var completionItems = expressionsCompletionItems.concat(entitiesCompletionItems);
|
|
8429
|
+
updateCompletionItems(completionItems);
|
|
8430
|
+
}
|
|
8431
|
+
});
|
|
8432
|
+
}
|
|
8433
|
+
/*
|
|
8434
|
+
* Returns the code itself without its inside double quotes parts, e.g
|
|
8435
|
+
* on string `return this "here not" code`, the return value will be `return this code`;
|
|
8436
|
+
*/
|
|
8437
|
+
function getCodeWithoutStringedCode(code) {
|
|
8438
|
+
return (code !== null && code !== void 0 ? code : "").replace(/"([^"])*["]?/g, " ");
|
|
8439
|
+
}
|
|
8440
|
+
/*
|
|
8441
|
+
* Returns the code's parts that need to be verified by requests, excluding the keywords,
|
|
8442
|
+
* special character (except dot/`.` in middle of two regex's \w and at the end and hashtag in sentence's start)
|
|
8443
|
+
* e.g on string `SE (something.another OU expression E something.another.)`, the variables array would be
|
|
8444
|
+
* ["something.another", "expression", "something.another."]
|
|
8445
|
+
*/
|
|
8446
|
+
function getVariablesToVerify(code) {
|
|
8447
|
+
var _a;
|
|
8448
|
+
var keywordsRegex = Object
|
|
8449
|
+
.values(Keywords)
|
|
8450
|
+
.map(function (keyword) { return "(?!" + keyword + "\\b)"; })
|
|
8451
|
+
.join("");
|
|
8452
|
+
return (_a = (code !== null && code !== void 0 ? code : "").match(new RegExp("[#]?\\b(" + keywordsRegex + ")(\\w+\\.)*\\w+[\\.]?", "g"))) !== null && _a !== void 0 ? _a : [];
|
|
8453
|
+
}
|
|
8454
|
+
/*
|
|
8455
|
+
* Only needs to request the expressions and the fields from an entity;
|
|
8456
|
+
* Creates an request to every variable;
|
|
8457
|
+
* Uses the AutocompleteService for the requests needed here are Autocomplete's usage, so we are just
|
|
8458
|
+
* borrowing from it
|
|
8459
|
+
*/
|
|
8460
|
+
function getRequestsBasedOnVariables(variables, abortSignal) {
|
|
8461
|
+
var e_1, _a;
|
|
8462
|
+
var _b;
|
|
8463
|
+
var languageConfigs = getLanguageConfigs();
|
|
8464
|
+
var requests = [];
|
|
8465
|
+
try {
|
|
8466
|
+
for (var variables_1 = __values(variables), variables_1_1 = variables_1.next(); !variables_1_1.done; variables_1_1 = variables_1.next()) {
|
|
8467
|
+
var variable = variables_1_1.value;
|
|
8468
|
+
var splittedVariable = variable.split(".");
|
|
8469
|
+
if (splittedVariable.length === 1) {
|
|
8470
|
+
var extraInfo = {
|
|
8471
|
+
path: "",
|
|
8472
|
+
filter: splittedVariable[0]
|
|
8473
|
+
};
|
|
8474
|
+
requests.push({
|
|
8475
|
+
requestType: RequestTypes.ListExpressionMetadata,
|
|
8476
|
+
request: AutocompleteService.listExpressionMetadata({
|
|
8477
|
+
context: languageConfigs.contexts,
|
|
8478
|
+
subcontext: (_b = languageConfigs.subContexts) !== null && _b !== void 0 ? _b : [],
|
|
8479
|
+
name: splittedVariable[0]
|
|
8480
|
+
}, abortSignal),
|
|
8481
|
+
extraInfo: extraInfo
|
|
8482
|
+
});
|
|
8483
|
+
}
|
|
8484
|
+
else if (splittedVariable.length > 2) {
|
|
8485
|
+
var extraInfo = {
|
|
8486
|
+
path: splittedVariable
|
|
8487
|
+
.slice(0, splittedVariable.length - 1)
|
|
8488
|
+
.join("."),
|
|
8489
|
+
filter: ""
|
|
8490
|
+
};
|
|
8491
|
+
requests.push({
|
|
8492
|
+
requestType: RequestTypes.GetFacadeMetadataByPath,
|
|
8493
|
+
request: AutocompleteService.getFacadeMetadataByPath({
|
|
8494
|
+
context: splittedVariable[0],
|
|
8495
|
+
entityName: splittedVariable[1],
|
|
8496
|
+
fields: splittedVariable.slice(2, splittedVariable.length - 1)
|
|
8497
|
+
}, abortSignal),
|
|
8498
|
+
extraInfo: extraInfo
|
|
8499
|
+
});
|
|
8500
|
+
}
|
|
8501
|
+
}
|
|
8502
|
+
}
|
|
8503
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
8504
|
+
finally {
|
|
8505
|
+
try {
|
|
8506
|
+
if (variables_1_1 && !variables_1_1.done && (_a = variables_1.return)) _a.call(variables_1);
|
|
8507
|
+
}
|
|
8508
|
+
finally { if (e_1) throw e_1.error; }
|
|
8509
|
+
}
|
|
8510
|
+
return requests.map(function (request) { return getSafeResponse(request); });
|
|
8511
|
+
}
|
|
8512
|
+
function getExpressionsCompletionsItems(responses) {
|
|
8513
|
+
var expressionsResponses = responses.filter(function (response) {
|
|
8514
|
+
return (response === null || response === void 0 ? void 0 : response.requestType) === RequestTypes.ListExpressionMetadata;
|
|
8515
|
+
});
|
|
8516
|
+
return expressionsResponses
|
|
8517
|
+
.map(function (expressionsResponse) {
|
|
8518
|
+
var _a, _b, _c, _d, _e, _f;
|
|
7052
8519
|
return {
|
|
7053
|
-
|
|
8520
|
+
path: (_b = (_a = expressionsResponse.extraInfo) === null || _a === void 0 ? void 0 : _a.path) !== null && _b !== void 0 ? _b : "",
|
|
8521
|
+
filter: (_d = (_c = expressionsResponse.extraInfo) === null || _c === void 0 ? void 0 : _c.filter) !== null && _d !== void 0 ? _d : "",
|
|
8522
|
+
completions: ((_f = (_e = expressionsResponse.response) === null || _e === void 0 ? void 0 : _e.expressionMetadata) !== null && _f !== void 0 ? _f : [])
|
|
8523
|
+
.map(function (expressionMetadata) { return ({
|
|
8524
|
+
label: expressionMetadata.name,
|
|
8525
|
+
type: expressionMetadata.type === MetaType.PUBLIC_EXPRESSION
|
|
8526
|
+
? CompletionTypes.Expression
|
|
8527
|
+
: CompletionTypes.UserExpression
|
|
8528
|
+
}); })
|
|
8529
|
+
};
|
|
8530
|
+
})
|
|
8531
|
+
.flat();
|
|
8532
|
+
}
|
|
8533
|
+
function getEntitiesCompletionsItems(responses) {
|
|
8534
|
+
var facadesResponsesFromGet = responses.filter(function (response) {
|
|
8535
|
+
return (response === null || response === void 0 ? void 0 : response.requestType) === RequestTypes.GetFacadeMetadataByPath;
|
|
8536
|
+
});
|
|
8537
|
+
return facadesResponsesFromGet
|
|
8538
|
+
.map(function (facadesResponseFromGet) {
|
|
8539
|
+
var _a, _b, _c;
|
|
8540
|
+
return {
|
|
8541
|
+
path: facadesResponseFromGet.extraInfo.path,
|
|
8542
|
+
filter: facadesResponseFromGet.extraInfo.filter,
|
|
8543
|
+
completions: ((_c = (_b = (_a = facadesResponseFromGet.response) === null || _a === void 0 ? void 0 : _a.facadeMetadata) === null || _b === void 0 ? void 0 : _b.fields) !== null && _c !== void 0 ? _c : [])
|
|
8544
|
+
.map(function (facade) { return ({
|
|
8545
|
+
label: facade.name,
|
|
8546
|
+
type: facade.type === MetaType.ENTITY ? CompletionTypes.Entity : CompletionTypes.FinalValue
|
|
8547
|
+
}); })
|
|
8548
|
+
};
|
|
8549
|
+
})
|
|
8550
|
+
.flat();
|
|
8551
|
+
}
|
|
8552
|
+
function updateCompletionItems(completionItems) {
|
|
8553
|
+
var e_2, _a;
|
|
8554
|
+
try {
|
|
8555
|
+
for (var completionItems_1 = __values(completionItems), completionItems_1_1 = completionItems_1.next(); !completionItems_1_1.done; completionItems_1_1 = completionItems_1.next()) {
|
|
8556
|
+
var completionItem = completionItems_1_1.value;
|
|
8557
|
+
updateCoreCompletionItems(completionItem);
|
|
8558
|
+
}
|
|
8559
|
+
}
|
|
8560
|
+
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
|
8561
|
+
finally {
|
|
8562
|
+
try {
|
|
8563
|
+
if (completionItems_1_1 && !completionItems_1_1.done && (_a = completionItems_1.return)) _a.call(completionItems_1);
|
|
8564
|
+
}
|
|
8565
|
+
finally { if (e_2) throw e_2.error; }
|
|
8566
|
+
}
|
|
8567
|
+
}
|
|
8568
|
+
|
|
8569
|
+
function TaxCalculation() {
|
|
8570
|
+
return new LanguageSupport(baseConfigs, [
|
|
8571
|
+
autocomplete(),
|
|
8572
|
+
onPasteCompletionItemsUpdater(),
|
|
8573
|
+
]);
|
|
8574
|
+
}
|
|
8575
|
+
|
|
8576
|
+
var EditorLanguages = /** @class */ (function () {
|
|
8577
|
+
function EditorLanguages() {
|
|
8578
|
+
}
|
|
8579
|
+
EditorLanguages.getLanguage = function (language) {
|
|
8580
|
+
return EditorLanguages._LANGUAGES.get(language) || [];
|
|
8581
|
+
};
|
|
8582
|
+
EditorLanguages._LANGUAGES = new Map([
|
|
8583
|
+
[Languages.TaxCalculation, TaxCalculation()]
|
|
8584
|
+
]);
|
|
8585
|
+
return EditorLanguages;
|
|
8586
|
+
}());
|
|
8587
|
+
|
|
8588
|
+
/**
|
|
8589
|
+
* Adds style to the editor in general
|
|
8590
|
+
* @returns An extension containing the style
|
|
8591
|
+
*/
|
|
8592
|
+
function style$2() {
|
|
8593
|
+
return EditorView.theme({
|
|
8594
|
+
"&.cm-editor.cm-focused": {
|
|
8595
|
+
outline: "none",
|
|
8596
|
+
},
|
|
8597
|
+
});
|
|
8598
|
+
}
|
|
8599
|
+
|
|
8600
|
+
var SDSLightHighlightStyle = HighlightStyle.define([
|
|
8601
|
+
{
|
|
8602
|
+
tag: tags.keyword,
|
|
8603
|
+
color: "blue",
|
|
8604
|
+
},
|
|
8605
|
+
{
|
|
8606
|
+
tag: tags.string,
|
|
8607
|
+
color: "red",
|
|
8608
|
+
},
|
|
8609
|
+
{
|
|
8610
|
+
tag: tags.number,
|
|
8611
|
+
color: "green",
|
|
8612
|
+
},
|
|
8613
|
+
]);
|
|
8614
|
+
|
|
8615
|
+
/**
|
|
8616
|
+
* Adds a vertical scrollbar when the editor's height overflows the parent's height
|
|
8617
|
+
* @returns An extension containing everything needed to add the scrollbar
|
|
8618
|
+
*/
|
|
8619
|
+
function scrollbars() {
|
|
8620
|
+
return [
|
|
8621
|
+
style$3()
|
|
8622
|
+
];
|
|
8623
|
+
}
|
|
8624
|
+
function style$3() {
|
|
8625
|
+
return EditorView.baseTheme({
|
|
8626
|
+
"&.cm-editor": {
|
|
8627
|
+
"height": "100%"
|
|
8628
|
+
},
|
|
8629
|
+
});
|
|
8630
|
+
}
|
|
8631
|
+
|
|
8632
|
+
/**
|
|
8633
|
+
* Adds style to editor'font
|
|
8634
|
+
* @returns An extension containing everything needed to add the font style
|
|
8635
|
+
*/
|
|
8636
|
+
function fontStyle() {
|
|
8637
|
+
return [style$4()];
|
|
8638
|
+
}
|
|
8639
|
+
var generalFontStyle = {
|
|
8640
|
+
"font-family": "'Noto Sans Mono', 'sans-serif'",
|
|
8641
|
+
"font-style": "normal",
|
|
8642
|
+
"font-size": "1rem",
|
|
8643
|
+
};
|
|
8644
|
+
function style$4() {
|
|
8645
|
+
return EditorView.theme({
|
|
8646
|
+
".cm-scroller": __assign(__assign({}, generalFontStyle), { "letter-spacing": "0", "line-height": "1.5em", "font-variation-settings": "'wght' 400", "color": "#333333" }),
|
|
8647
|
+
".cm-tooltip.cm-tooltip-autocomplete > ul": __assign(__assign({}, generalFontStyle), { "font-variation-settings": "'wght' 300", "color": "#697882" }),
|
|
8648
|
+
".cm-tooltip.cm-tooltip-autocomplete > ul .cm-completionLabel": {
|
|
8649
|
+
"line-height": "1.5em",
|
|
8650
|
+
"font-variation-settings": "'wght' 500",
|
|
8651
|
+
},
|
|
8652
|
+
".cm-tooltip.cm-tooltip-autocomplete > ul .cm-completionDetail": {
|
|
8653
|
+
"font-size": "0.875em",
|
|
8654
|
+
"font-style": "normal",
|
|
8655
|
+
"margin-left": "0.75rem",
|
|
8656
|
+
},
|
|
8657
|
+
});
|
|
8658
|
+
}
|
|
8659
|
+
|
|
8660
|
+
/**
|
|
8661
|
+
* Adds a line counter
|
|
8662
|
+
* @returns An extension containing everything needed to add the line counter
|
|
8663
|
+
*/
|
|
8664
|
+
function lineCounter() {
|
|
8665
|
+
return [
|
|
8666
|
+
lineNumbers(),
|
|
8667
|
+
style$5()
|
|
8668
|
+
];
|
|
8669
|
+
}
|
|
8670
|
+
function style$5() {
|
|
8671
|
+
return EditorView.theme({
|
|
8672
|
+
".cm-gutters": {
|
|
8673
|
+
"background-color": "#fff",
|
|
8674
|
+
"color": "#428BCA",
|
|
8675
|
+
"border-right": "none"
|
|
8676
|
+
},
|
|
8677
|
+
".cm-gutter": {
|
|
8678
|
+
"padding": "0 2rem 0 2rem"
|
|
8679
|
+
}
|
|
8680
|
+
});
|
|
8681
|
+
}
|
|
8682
|
+
|
|
8683
|
+
/**
|
|
8684
|
+
* Adds styles to the autocomplete's tooltip
|
|
8685
|
+
* @returns An extension containing everything needed to add the style
|
|
8686
|
+
*/
|
|
8687
|
+
function autocompleteTooltip() {
|
|
8688
|
+
return [style$6()];
|
|
8689
|
+
}
|
|
8690
|
+
function style$6() {
|
|
8691
|
+
return EditorView.baseTheme({
|
|
8692
|
+
".cm-tooltip": {
|
|
8693
|
+
"border": "none !important",
|
|
8694
|
+
"border-radius": "4px",
|
|
8695
|
+
"background-color": "#E5EAEA !important",
|
|
8696
|
+
},
|
|
8697
|
+
".cm-tooltip.cm-tooltip-autocomplete > ul[role='listbox']": {
|
|
8698
|
+
"padding": "1rem",
|
|
8699
|
+
},
|
|
8700
|
+
".cm-tooltip.cm-tooltip-autocomplete > ul .cm-completionDetail": {
|
|
8701
|
+
"margin-left": ".75rem",
|
|
8702
|
+
},
|
|
8703
|
+
".cm-tooltip.cm-tooltip-autocomplete > ul .cm-completionDetail::before": {
|
|
8704
|
+
"content": "'[ '",
|
|
8705
|
+
},
|
|
8706
|
+
".cm-tooltip.cm-tooltip-autocomplete > ul .cm-completionDetail::after": {
|
|
8707
|
+
"content": "' ]'",
|
|
8708
|
+
},
|
|
8709
|
+
".cm-tooltip.cm-tooltip-autocomplete > ul .cm-completionIcon": {
|
|
8710
|
+
"padding-right": 0,
|
|
8711
|
+
"margin-right": ".475rem",
|
|
8712
|
+
"width": "1rem",
|
|
8713
|
+
},
|
|
8714
|
+
".cm-tooltip-autocomplete ul li[aria-selected]": {
|
|
8715
|
+
"border-radius": "4px",
|
|
8716
|
+
"background-color": "#5D96A2 !important",
|
|
8717
|
+
"color": "#fff !important",
|
|
8718
|
+
},
|
|
8719
|
+
".cm-tooltip.cm-completionInfo.cm-completionInfo-right": {
|
|
8720
|
+
"border-radius": "3px",
|
|
8721
|
+
"box-shadow": "0 2px 4px -1px rgb(0 0 0 / 20%), 0 4px 5px 0 rgb(0 0 0 / 14%), 0 1px 10px 0 rgb(0 0 0 / 12%)",
|
|
8722
|
+
"background": "#495057 !important",
|
|
8723
|
+
"color": "#fff",
|
|
8724
|
+
"padding": ".5rem",
|
|
8725
|
+
"left": "101.6%",
|
|
8726
|
+
},
|
|
8727
|
+
".cm-tooltip.cm-completionInfo.cm-completionInfo-right::before": {
|
|
8728
|
+
"content": "''",
|
|
8729
|
+
"position": "absolute",
|
|
8730
|
+
"width": 0,
|
|
8731
|
+
"height": 0,
|
|
8732
|
+
"top": ".8125rem",
|
|
8733
|
+
"left": "-.25rem",
|
|
8734
|
+
"margin-top": "-.25rem",
|
|
8735
|
+
"border-color": "transparent",
|
|
8736
|
+
"border-style": "solid",
|
|
8737
|
+
"border-right-color": "#495057",
|
|
8738
|
+
"border-width": ".25rem .25rem .25rem 0",
|
|
8739
|
+
},
|
|
8740
|
+
});
|
|
8741
|
+
}
|
|
8742
|
+
|
|
8743
|
+
/* General Style */
|
|
8744
|
+
function SDSLight() {
|
|
8745
|
+
return [
|
|
8746
|
+
[
|
|
8747
|
+
style$2(),
|
|
8748
|
+
scrollbars(),
|
|
8749
|
+
fontStyle(),
|
|
8750
|
+
lineCounter(),
|
|
8751
|
+
autocompleteTooltip()
|
|
8752
|
+
],
|
|
8753
|
+
SDSLightHighlightStyle
|
|
8754
|
+
];
|
|
8755
|
+
}
|
|
8756
|
+
|
|
8757
|
+
var EditorThemes = /** @class */ (function () {
|
|
8758
|
+
function EditorThemes() {
|
|
8759
|
+
}
|
|
8760
|
+
EditorThemes.getTheme = function (theme) {
|
|
8761
|
+
return EditorThemes._THEMES.get(theme) || [];
|
|
8762
|
+
};
|
|
8763
|
+
EditorThemes._THEMES = new Map([
|
|
8764
|
+
[Themes.SDSLight, SDSLight()]
|
|
8765
|
+
]);
|
|
8766
|
+
return EditorThemes;
|
|
8767
|
+
}());
|
|
8768
|
+
|
|
8769
|
+
var CodeMirror6Core = /** @class */ (function (_super) {
|
|
8770
|
+
__extends(CodeMirror6Core, _super);
|
|
8771
|
+
function CodeMirror6Core() {
|
|
8772
|
+
var _this = _super.call(this) || this;
|
|
8773
|
+
/* These are necessary for the setCode and setEditorOptions can be called before view has been created */
|
|
8774
|
+
_this._codeReceivedBeforeViewCreation = "";
|
|
8775
|
+
_this._editorOptionsReceivedBeforeViewCreation = [];
|
|
8776
|
+
_this.setObservablesListeners();
|
|
8777
|
+
return _this;
|
|
8778
|
+
}
|
|
8779
|
+
CodeMirror6Core.getEditorView = function () {
|
|
8780
|
+
return CodeMirror6Core._editorView;
|
|
8781
|
+
};
|
|
8782
|
+
CodeMirror6Core.updateEditorView = function () {
|
|
8783
|
+
var _a;
|
|
8784
|
+
var transactionSpecs = [];
|
|
8785
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
8786
|
+
transactionSpecs[_i] = arguments[_i];
|
|
8787
|
+
}
|
|
8788
|
+
(_a = CodeMirror6Core._editorView).dispatch.apply(_a, __spread(transactionSpecs));
|
|
8789
|
+
};
|
|
8790
|
+
CodeMirror6Core.prototype.setCoreWrapperElement = function (element) {
|
|
8791
|
+
this.createEditorView(element);
|
|
8792
|
+
};
|
|
8793
|
+
CodeMirror6Core.prototype.setCode = function (code) {
|
|
8794
|
+
this.changeEditorContent(code);
|
|
8795
|
+
};
|
|
8796
|
+
// @Override
|
|
8797
|
+
CodeMirror6Core.prototype.destroyObservables = function () {
|
|
8798
|
+
CodeMirror6Core._ngUnsubscribe.next();
|
|
8799
|
+
CodeMirror6Core._ngUnsubscribe.complete();
|
|
8800
|
+
};
|
|
8801
|
+
CodeMirror6Core.prototype.setCoreEditorOptions = function (options) {
|
|
8802
|
+
var language = EditorLanguages.getLanguage(options.language);
|
|
8803
|
+
var theme = EditorThemes.getTheme(options.theme);
|
|
8804
|
+
if (CodeMirror6Core._editorView) {
|
|
8805
|
+
CodeMirror6Core.updateEditorView({
|
|
8806
|
+
effects: StateEffect.reconfigure.of([
|
|
8807
|
+
language,
|
|
8808
|
+
theme,
|
|
8809
|
+
this.getCodeChangeListenerExtension()
|
|
8810
|
+
])
|
|
8811
|
+
});
|
|
8812
|
+
}
|
|
8813
|
+
else {
|
|
8814
|
+
this._editorOptionsReceivedBeforeViewCreation = [language, theme];
|
|
8815
|
+
}
|
|
8816
|
+
};
|
|
8817
|
+
CodeMirror6Core.prototype.highlightCode = function (markers) {
|
|
8818
|
+
var diagnostics = convertMarkersToDiagnostics(markers, CodeMirror6Core._editorView.state.doc.length);
|
|
8819
|
+
CodeMirror6Core.updateEditorView(setDiagnostics(CodeMirror6Core._editorView.state, diagnostics));
|
|
8820
|
+
};
|
|
8821
|
+
CodeMirror6Core.prototype.setObservablesListeners = function () {
|
|
8822
|
+
var _this = this;
|
|
8823
|
+
CodeMirror6Core.$onCompletionItemsUpdate
|
|
8824
|
+
.pipe(takeUntil(CodeMirror6Core._ngUnsubscribe))
|
|
8825
|
+
.subscribe(function (items) { return _this.updateCompletionItems(items); });
|
|
8826
|
+
};
|
|
8827
|
+
CodeMirror6Core.prototype.createEditorView = function (parentElement) {
|
|
8828
|
+
CodeMirror6Core._editorView = new EditorView({
|
|
8829
|
+
parent: parentElement,
|
|
8830
|
+
state: EditorState.create({
|
|
8831
|
+
doc: this._codeReceivedBeforeViewCreation,
|
|
8832
|
+
extensions: [
|
|
8833
|
+
this._editorOptionsReceivedBeforeViewCreation,
|
|
8834
|
+
this.getCodeChangeListenerExtension()
|
|
8835
|
+
]
|
|
8836
|
+
})
|
|
8837
|
+
});
|
|
8838
|
+
this.notifyCoreFinishLoad();
|
|
8839
|
+
};
|
|
8840
|
+
CodeMirror6Core.prototype.getCodeChangeListenerExtension = function () {
|
|
8841
|
+
var _this = this;
|
|
8842
|
+
return EditorView.updateListener.of(function (update) { return update.docChanged && _this.notifyCodeChange(update.state.doc.toString()); });
|
|
8843
|
+
};
|
|
8844
|
+
CodeMirror6Core.prototype.changeEditorContent = function (code) {
|
|
8845
|
+
if (CodeMirror6Core._editorView) {
|
|
8846
|
+
CodeMirror6Core.updateEditorView({
|
|
8847
|
+
changes: {
|
|
8848
|
+
from: 0,
|
|
8849
|
+
to: CodeMirror6Core._editorView.state.doc.length,
|
|
8850
|
+
insert: code
|
|
8851
|
+
}
|
|
8852
|
+
});
|
|
8853
|
+
}
|
|
8854
|
+
else {
|
|
8855
|
+
this._codeReceivedBeforeViewCreation = code;
|
|
8856
|
+
}
|
|
8857
|
+
};
|
|
8858
|
+
CodeMirror6Core.$onCompletionItemsUpdate = new Subject();
|
|
8859
|
+
CodeMirror6Core._ngUnsubscribe = new Subject();
|
|
8860
|
+
CodeMirror6Core._editorView = null;
|
|
8861
|
+
return CodeMirror6Core;
|
|
8862
|
+
}(CoreFacade));
|
|
8863
|
+
|
|
8864
|
+
var CodeEditorModule = /** @class */ (function () {
|
|
8865
|
+
function CodeEditorModule() {
|
|
8866
|
+
}
|
|
8867
|
+
CodeEditorModule = __decorate([
|
|
8868
|
+
NgModule({
|
|
8869
|
+
imports: [
|
|
8870
|
+
CommonModule,
|
|
8871
|
+
CustomTranslationsModule,
|
|
8872
|
+
],
|
|
8873
|
+
declarations: [CodeEditorComponent],
|
|
8874
|
+
exports: [CodeEditorComponent],
|
|
7054
8875
|
providers: [
|
|
7055
8876
|
{
|
|
7056
|
-
provide:
|
|
7057
|
-
|
|
8877
|
+
provide: CoreFacade,
|
|
8878
|
+
useClass: CodeMirror6Core
|
|
7058
8879
|
}
|
|
7059
8880
|
]
|
|
7060
|
-
}
|
|
7061
|
-
|
|
7062
|
-
|
|
7063
|
-
AngularComponentsModule = AngularComponentsModule_1 = __decorate([
|
|
7064
|
-
NgModule({})
|
|
7065
|
-
], AngularComponentsModule);
|
|
7066
|
-
return AngularComponentsModule;
|
|
8881
|
+
})
|
|
8882
|
+
], CodeEditorModule);
|
|
8883
|
+
return CodeEditorModule;
|
|
7067
8884
|
}());
|
|
7068
8885
|
|
|
7069
8886
|
/**
|
|
7070
8887
|
* Generated bundle index. Do not edit.
|
|
7071
8888
|
*/
|
|
7072
8889
|
|
|
7073
|
-
export { AngularComponentsModule, AutocompleteField, BignumberField, BignumberInputDirective, BignumberInputModule, BooleanField, BooleanOptionsLabel, BreadcrumbComponent, BreadcrumbModule, Breakpoints, ButtonComponent, ButtonModule, ButtonPriority, ButtonSize, CalendarField, CalendarLocaleOptions, CalendarMaskDirective, CalendarMaskModule, ChipsField, CollapseLinkComponent, CollapseLinkModule, ControlErrorsComponent, ControlErrorsModule, CurrencyField, CustomFieldsComponent, CustomFieldsModule, CustomFieldsService, DEFAULT_CALENDAR_LOCALE_OPTIONS, DEFAULT_LOCALE_OPTIONS, DEFAULT_NUMBER_LOCALE_OPTIONS, DynamicConfig, DynamicFormComponent, DynamicFormModule, DynamicType, EditableOverlayDirective, EditableOverlayModule, EmptyStateComponent, EmptyStateModule, EnumBadgeColors, EnumColumnFieldType, ExportUtils, Field, FieldType, Fieldset, FileUploadComponent, FileUploadModule, FormField, GlobalSearchComponent, GlobalSearchDropdownItemComponent, GlobalSearchModule, GlobalSearchSizeEnum, ImageCropperComponent, ImageCropperModule, ImageCropperService, InfoSignDirective, InfoSignModule, LoadingStateComponent, LoadingStateDirective, LoadingStateModule, LocaleModule, LocaleOptions, LocaleService, LocalizedCurrencyPipe, LocalizedCurrencyPipeOptions, LocalizedDateImpurePipe, LocalizedDatePipe, LocalizedNumberInputDirective, LocalizedNumberInputModule, LocalizedNumberPipe, LocalizedTimeImpurePipe, LocalizedTimePipe, LongPressDirective, LookupComponent, LookupField, MaskFormatterModule, MaskFormatterPipe, MouseEventsModule, NavigationDirective, NumberAlignmentOption, NumberField, NumberInputDirective, NumberInputModule, NumberLocaleOptions, ObjectCardComponent, ObjectCardFieldComponent, ObjectCardMainComponent, ObjectCardModule, Option, ProductHeaderComponent, ProductHeaderModule, RadioButtonField, RationButtonOption, RowTogllerDirective, Section, SelectField, SelectOption, SidebarComponent, SidebarModule, StatsCardComponent, StatsCardModule, StepState, StepsComponent, StepsModule, Structure, TableHeaderCheckboxComponent, TableHeaderCheckboxModule, TableModule, TextAreaField, TextField, ThumbnailComponent, ThumbnailModule, ThumbnailSize, TileComponent, TileModule, TokenListComponent, TokenListModule, ValidateErrors, LocalizedCurrencyImpurePipe as ɵa, LocalizedBignumberPipe as ɵb, DecimalField as ɵba, StructureModule as ɵbb, HeaderComponent as ɵbc, FooterComponent as ɵbd, InfoSignComponent as ɵbe, NumberLocaleOptions as ɵbf, ThumbnailService as ɵbg, InfiniteScrollModule as ɵbh, InfiniteScrollDirective as ɵbi, LocalizedBignumberImpurePipe as ɵc, TokenListModule as ɵd, TableColumnsComponent as ɵe, InfoSignModule as ɵf, AutocompleteFieldComponent as ɵg, BooleanFieldComponent as ɵh, CalendarFieldComponent as ɵi, ChipsFieldComponent as ɵj, CurrencyFieldComponent as ɵk, BaseFieldComponent as ɵl, DynamicFieldComponent as ɵm, DynamicFormDirective as ɵn, FieldsetComponent as ɵo, FileUploadComponent$1 as ɵp, LookupFieldComponent as ɵq, NumberFieldComponent as ɵr, BignumberFieldComponent as ɵs, RadioButtonComponent as ɵt, RowComponent as ɵu, SectionComponent as ɵv, SelectFieldComponent as ɵw, TextAreaFieldComponent as ɵx, TextFieldComponent as ɵy };
|
|
8890
|
+
export { AngularComponentsModule, AutocompleteField, BignumberField, BignumberInputDirective, BignumberInputModule, BooleanField, BooleanOptionsLabel, BreadcrumbComponent, BreadcrumbModule, Breakpoints, ButtonComponent, ButtonModule, ButtonPriority, ButtonSize, CalendarField, CalendarLocaleOptions, CalendarMaskDirective, CalendarMaskModule, ChipsField, CodeEditorModule, CollapseLinkComponent, CollapseLinkModule, ControlErrorsComponent, ControlErrorsModule, CurrencyField, CustomFieldsComponent, CustomFieldsModule, CustomFieldsService, DEFAULT_CALENDAR_LOCALE_OPTIONS, DEFAULT_LOCALE_OPTIONS, DEFAULT_NUMBER_LOCALE_OPTIONS, DynamicConfig, DynamicFormComponent, DynamicFormModule, DynamicType, EditableOverlayDirective, EditableOverlayModule, EmptyStateComponent, EmptyStateModule, EnumBadgeColors, EnumColumnFieldType, ExportUtils, Field, FieldType, Fieldset, FileUploadComponent, FileUploadModule, FormField, GlobalSearchComponent, GlobalSearchDropdownItemComponent, GlobalSearchModule, GlobalSearchSizeEnum, HostProjectConfigsInjectionToken, ImageCropperComponent, ImageCropperModule, ImageCropperService, InfoSignDirective, InfoSignModule, Languages, LoadingStateComponent, LoadingStateDirective, LoadingStateModule, LocaleModule, LocaleOptions, LocaleService, LocalizedCurrencyPipe, LocalizedCurrencyPipeOptions, LocalizedDateImpurePipe, LocalizedDatePipe, LocalizedNumberInputDirective, LocalizedNumberInputModule, LocalizedNumberPipe, LocalizedTimeImpurePipe, LocalizedTimePipe, LongPressDirective, LookupComponent, LookupField, MaskFormatterModule, MaskFormatterPipe, MouseEventsModule, NavigationDirective, NumberAlignmentOption, NumberField, NumberInputDirective, NumberInputModule, NumberLocaleOptions, ObjectCardComponent, ObjectCardFieldComponent, ObjectCardMainComponent, ObjectCardModule, Option, ProductHeaderComponent, ProductHeaderModule, RadioButtonField, RationButtonOption, RowTogllerDirective, Section, SelectField, SelectOption, SidebarComponent, SidebarModule, StatsCardComponent, StatsCardModule, StepState, StepsComponent, StepsModule, Structure, TableHeaderCheckboxComponent, TableHeaderCheckboxModule, TableModule, TaxCalculationLanguageConfigs, TextAreaField, TextField, Themes, ThumbnailComponent, ThumbnailModule, ThumbnailSize, TileComponent, TileModule, TokenListComponent, TokenListModule, ValidateErrors, LocalizedCurrencyImpurePipe as ɵa, LocalizedBignumberPipe as ɵb, DecimalField as ɵba, StructureModule as ɵbb, HeaderComponent as ɵbc, FooterComponent as ɵbd, InfoSignComponent as ɵbe, NumberLocaleOptions as ɵbf, ThumbnailService as ɵbg, InfiniteScrollModule as ɵbh, InfiniteScrollDirective as ɵbi, CustomTranslationsModule as ɵbj, CodeEditorComponent as ɵbk, CoreFacade as ɵbl, CodeMirror6Core as ɵbm, LocalizedBignumberImpurePipe as ɵc, TokenListModule as ɵd, TableColumnsComponent as ɵe, InfoSignModule as ɵf, AutocompleteFieldComponent as ɵg, BooleanFieldComponent as ɵh, CalendarFieldComponent as ɵi, ChipsFieldComponent as ɵj, CurrencyFieldComponent as ɵk, BaseFieldComponent as ɵl, DynamicFieldComponent as ɵm, DynamicFormDirective as ɵn, FieldsetComponent as ɵo, FileUploadComponent$1 as ɵp, LookupFieldComponent as ɵq, NumberFieldComponent as ɵr, BignumberFieldComponent as ɵs, RadioButtonComponent as ɵt, RowComponent as ɵu, SectionComponent as ɵv, SelectFieldComponent as ɵw, TextAreaFieldComponent as ɵx, TextFieldComponent as ɵy };
|
|
7074
8891
|
//# sourceMappingURL=seniorsistemas-angular-components.js.map
|