diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index 6d78352d..8c64eac1 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -4,9 +4,8 @@ "tools": { "sign": { "version": "0.9.1-beta.26330.1", - "commands": [ - "sign" - ] + "commands": ["sign"], + "rollForward": false } } } diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 00000000..468784dc --- /dev/null +++ b/.editorconfig @@ -0,0 +1,341 @@ +# Repo-wide coding conventions — https://editorconfig.org +# .NET style rules are enforced at build time via EnforceCodeStyleInBuild +# (see Directory.Build.props). Whitespace formatting is gated in CI via +# dotnet format whitespace . --folder --exclude templates node_modules --verify-no-changes +# NOTE: only use `dotnet format whitespace --folder` in this repo — the full +# `dotnet format` (style/analyzers verbs) corrupts files on multi-targeted +# projects by inserting "Unmerged change from project" conflict markers +# (https://github.com/dotnet/format/issues/1634). +# +# Structure: Visual Studio's generated .editorconfig as the base, with +# repo-specific deltas marked "REPO:" and a commented "future candidates" +# section (aspnetcore-inspired) at the bottom. Keep exactly one severity line +# per rule id — the last assignment silently wins. Careful: some options +# silently ignore a `:severity` suffix; use dotnet_diagnostic lines instead. +root = true + +[*] +indent_style = space +insert_final_newline = true +trim_trailing_whitespace = true +max_line_length = 120 + +[*.{json,yml,yaml}] +indent_size = 2 + +[*.{xml,config,*proj,props,targets,nuspec,resx,slnx,runsettings}] +indent_size = 2 + +# C# files +[*.{cs,razor}] +indent_size = 4 +tab_width = 4 + +[*.cs] + +#### Core EditorConfig Options #### + +# REPO: end_of_line intentionally NOT set (VS default: crlf) — no .gitattributes +# yet, enforcing it would churn line endings; revisit together with a .gitattributes. +# REPO: insert_final_newline = true inherited from [*] (VS default: false). + +#### .NET Code Actions #### + +# Type members +dotnet_hide_advanced_members = false +dotnet_member_insertion_location = with_other_members_of_the_same_kind +dotnet_property_generation_behavior = prefer_throwing_properties + +# Symbol search +dotnet_search_reference_assemblies = true + +#### .NET Coding Conventions #### + +# Organize usings (remove both for no-sort run https://github.com/dotnet/format/issues/772) +dotnet_separate_import_directive_groups = false +dotnet_sort_system_directives_first = true +file_header_template = unset + +# this. and Me. preferences +dotnet_style_qualification_for_event = false +dotnet_style_qualification_for_field = false +dotnet_style_qualification_for_method = false +dotnet_style_qualification_for_property = false + +# Language keywords vs BCL types preferences +dotnet_style_predefined_type_for_locals_parameters_members = true +dotnet_style_predefined_type_for_member_access = true + +# Parentheses preferences +dotnet_style_parentheses_in_arithmetic_binary_operators = always_for_clarity +dotnet_style_parentheses_in_other_binary_operators = always_for_clarity +dotnet_style_parentheses_in_other_operators = never_if_unnecessary +dotnet_style_parentheses_in_relational_binary_operators = always_for_clarity + +# Modifier preferences +dotnet_style_require_accessibility_modifiers = for_non_interface_members + +# Expression-level preferences +dotnet_prefer_system_hash_code = true +dotnet_style_coalesce_expression = true +dotnet_style_collection_initializer = true +dotnet_style_explicit_tuple_names = true +dotnet_style_namespace_match_folder = true +dotnet_style_null_propagation = true +dotnet_style_object_initializer = true +dotnet_style_operator_placement_when_wrapping = beginning_of_line +dotnet_style_prefer_auto_properties = true +dotnet_style_prefer_collection_expression = when_types_loosely_match +dotnet_style_prefer_compound_assignment = true +dotnet_style_prefer_conditional_expression_over_assignment = true +dotnet_style_prefer_conditional_expression_over_return = true +dotnet_style_prefer_foreach_explicit_cast_in_source = when_strongly_typed +dotnet_style_prefer_inferred_anonymous_type_member_names = true +dotnet_style_prefer_inferred_tuple_names = true +dotnet_style_prefer_is_null_check_over_reference_equality_method = true +dotnet_style_prefer_non_hidden_explicit_cast_in_source = true +dotnet_style_prefer_simplified_boolean_expressions = true +dotnet_style_prefer_simplified_interpolation = true + +# Field preferences +dotnet_style_readonly_field = true + +# Parameter preferences +dotnet_code_quality_unused_parameters = all + +# Suppression preferences +dotnet_remove_unnecessary_suppression_exclusions = none + +# New line preferences +# REPO: VS default allows multiple blank lines; we disallow (IDE2000, gated below). +dotnet_style_allow_multiple_blank_lines_experimental = false +dotnet_style_allow_statement_immediately_after_block_experimental = true + +#### C# Coding Conventions #### + +# var preferences +# REPO: VS default is false; this codebase uses `var` heavily (aspnetcore also true). +csharp_style_var_elsewhere = true +csharp_style_var_for_built_in_types = true +csharp_style_var_when_type_is_apparent = true + +# Expression-bodied members +csharp_style_expression_bodied_accessors = true +csharp_style_expression_bodied_constructors = false +csharp_style_expression_bodied_indexers = true +csharp_style_expression_bodied_lambdas = true +csharp_style_expression_bodied_local_functions = false +csharp_style_expression_bodied_methods = false +csharp_style_expression_bodied_operators = false +csharp_style_expression_bodied_properties = true + +# Pattern matching preferences +csharp_style_pattern_matching_over_as_with_null_check = true +csharp_style_pattern_matching_over_is_with_cast_check = true +csharp_style_prefer_extended_property_pattern = true +csharp_style_prefer_not_pattern = true +csharp_style_prefer_pattern_matching = true +csharp_style_prefer_switch_expression = true + +# Null-checking preferences +csharp_style_conditional_delegate_call = true + +# Modifier preferences +csharp_prefer_static_anonymous_function = true +csharp_prefer_static_local_function = true +csharp_preferred_modifier_order = public,private,protected,internal,file,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,required,volatile,async +csharp_style_prefer_readonly_struct = true +csharp_style_prefer_readonly_struct_member = true + +# Code-block preferences +csharp_prefer_braces = true +csharp_prefer_simple_using_statement = true +csharp_prefer_system_threading_lock = true +# REPO: block_scoped matches the codebase majority incl. generated components +# (aspnetcore uses file_scoped — see future candidates / IDE0161). +csharp_style_namespace_declarations = block_scoped +csharp_style_prefer_method_group_conversion = true +csharp_style_prefer_primary_constructors = true +csharp_style_prefer_simple_property_accessors = true +csharp_style_prefer_top_level_statements = true + +# Expression-level preferences +csharp_prefer_simple_default_expression = true +csharp_style_deconstructed_variable_declaration = true +csharp_style_implicit_object_creation_when_type_is_apparent = true +csharp_style_inlined_variable_declaration = true +csharp_style_prefer_implicitly_typed_lambda_expression = true +csharp_style_prefer_index_operator = true +csharp_style_prefer_local_over_anonymous_function = true +csharp_style_prefer_null_check_over_type_check = true +csharp_style_prefer_range_operator = true +csharp_style_prefer_tuple_swap = true +csharp_style_prefer_unbound_generic_type_in_nameof = true +csharp_style_prefer_utf8_string_literals = true +csharp_style_throw_expression = true +csharp_style_unused_value_assignment_preference = discard_variable +csharp_style_unused_value_expression_statement_preference = discard_variable + +# 'using' directive preferences +csharp_using_directive_placement = outside_namespace + +# New line preferences +csharp_style_allow_blank_line_after_colon_in_constructor_initializer_experimental = true +csharp_style_allow_blank_line_after_token_in_arrow_expression_clause_experimental = true +csharp_style_allow_blank_line_after_token_in_conditional_expression_experimental = true +csharp_style_allow_blank_lines_between_consecutive_braces_experimental = true +csharp_style_allow_embedded_statements_on_same_line_experimental = true + +#### C# Formatting Rules #### + +# New line preferences +csharp_new_line_before_catch = true +csharp_new_line_before_else = true +csharp_new_line_before_finally = true +csharp_new_line_before_members_in_anonymous_types = true +csharp_new_line_before_members_in_object_initializers = true +csharp_new_line_before_open_brace = all +csharp_new_line_between_query_expression_clauses = true + +# Indentation preferences +csharp_indent_block_contents = true +csharp_indent_braces = false +csharp_indent_case_contents = true +csharp_indent_case_contents_when_block = false +csharp_indent_labels = one_less_than_current +csharp_indent_switch_labels = true + +# Space preferences +csharp_space_after_cast = false +csharp_space_after_colon_in_inheritance_clause = true +csharp_space_after_comma = true +csharp_space_after_dot = false +csharp_space_after_keywords_in_control_flow_statements = true +csharp_space_after_semicolon_in_for_statement = true +csharp_space_around_binary_operators = before_and_after +csharp_space_around_declaration_statements = false +csharp_space_before_colon_in_inheritance_clause = true +csharp_space_before_comma = false +csharp_space_before_dot = false +csharp_space_before_open_square_brackets = false +csharp_space_before_semicolon_in_for_statement = false +csharp_space_between_empty_square_brackets = false +csharp_space_between_method_call_empty_parameter_list_parentheses = false +csharp_space_between_method_call_name_and_opening_parenthesis = false +csharp_space_between_method_call_parameter_list_parentheses = false +csharp_space_between_method_declaration_empty_parameter_list_parentheses = false +csharp_space_between_method_declaration_name_and_open_parenthesis = false +csharp_space_between_method_declaration_parameter_list_parentheses = false +csharp_space_between_parentheses = false +csharp_space_between_square_brackets = false + +# Wrapping preferences +csharp_preserve_single_line_blocks = true +# REPO: VS default is true; false splits `int a; int b;` style one-liners +# (matches aspnetcore and the tested one-time-format baseline). +csharp_preserve_single_line_statements = false + +#### Naming styles #### + +# Naming rules + +dotnet_naming_rule.interface_should_be_begins_with_i.severity = suggestion +dotnet_naming_rule.interface_should_be_begins_with_i.symbols = interface +dotnet_naming_rule.interface_should_be_begins_with_i.style = begins_with_i + +dotnet_naming_rule.types_should_be_pascal_case.severity = suggestion +dotnet_naming_rule.types_should_be_pascal_case.symbols = types +dotnet_naming_rule.types_should_be_pascal_case.style = pascal_case + +dotnet_naming_rule.non_field_members_should_be_pascal_case.severity = suggestion +dotnet_naming_rule.non_field_members_should_be_pascal_case.symbols = non_field_members +dotnet_naming_rule.non_field_members_should_be_pascal_case.style = pascal_case + +# Symbol specifications + +dotnet_naming_symbols.interface.applicable_kinds = interface +dotnet_naming_symbols.interface.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected +dotnet_naming_symbols.interface.required_modifiers = + +dotnet_naming_symbols.types.applicable_kinds = class, struct, interface, enum +dotnet_naming_symbols.types.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected +dotnet_naming_symbols.types.required_modifiers = + +dotnet_naming_symbols.non_field_members.applicable_kinds = property, event, method +dotnet_naming_symbols.non_field_members.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected +dotnet_naming_symbols.non_field_members.required_modifiers = + +# Naming styles + +dotnet_naming_style.pascal_case.required_prefix = +dotnet_naming_style.pascal_case.required_suffix = +dotnet_naming_style.pascal_case.word_separator = +dotnet_naming_style.pascal_case.capitalization = pascal_case + +dotnet_naming_style.begins_with_i.required_prefix = I +dotnet_naming_style.begins_with_i.required_suffix = +dotnet_naming_style.begins_with_i.word_separator = +dotnet_naming_style.begins_with_i.capitalization = pascal_case + +#### Enforced severities (the repo gates) #### + +# IDE0055: All formatting rules — build warning + fixed by the whitespace gate. +# (aspnetcore keeps this at `suggestion` and relies purely on their CI format +# check; we use `warning` so violations are visible in the IDE/build.) +dotnet_diagnostic.IDE0055.severity = warning + +# IDE2000: Disallow multiple blank lines (option set above). +# Reported as a build warning (EnforceCodeStyleInBuild), but NOT auto-fixed by +# `dotnet format whitespace` — only `dotnet format style` (unusable here, see +# header note) or CSharpier can fix it automatically. +dotnet_diagnostic.IDE2000.severity = warning + +# IDE0005: Remove unnecessary usings. Only reported during build when the +# project generates an XML docs file; always applied in the IDE. +dotnet_diagnostic.IDE0005.severity = warning + +#### Future candidates (aspnetcore-inspired) — enable after the one-time format +#### and a cleanup pass. Most below have NO auto-fix via our safe format +#### command, so enabling them creates manual work; the ones marked [fixer] +#### at least have an IDE code fix. Test-project relaxations can mirror +#### aspnetcore (suggestion severity under a [tests/**.cs] section) when enabled. + +## Hygiene / dead code +# dotnet_diagnostic.IDE0011.severity = warning # braces around blocks [fixer] +# dotnet_diagnostic.IDE0035.severity = warning # remove unreachable code [fixer] +# dotnet_diagnostic.IDE0036.severity = warning # modifier order [fixer] +# dotnet_diagnostic.IDE0044.severity = warning # make field readonly [fixer] +# dotnet_diagnostic.IDE0051.severity = warning # unused private members +# dotnet_diagnostic.IDE0059.severity = warning # unnecessary value assignment +# dotnet_diagnostic.IDE0060.severity = warning # unused parameter +# dotnet_diagnostic.IDE0161.severity = warning # file-scoped namespace [fixer] — conflicts with block_scoped choice above + +## Correctness (aspnetcore has these at warning; mostly no fixer) +# dotnet_diagnostic.CA2011.severity = warning # avoid infinite recursion +# dotnet_diagnostic.CA2013.severity = warning # no ReferenceEquals on value types +# dotnet_diagnostic.CA2016.severity = warning # forward CancellationToken +# dotnet_diagnostic.CA2200.severity = warning # rethrow preserving stack +# dotnet_diagnostic.CA2201.severity = warning # no reserved exception types +# dotnet_diagnostic.CA2208.severity = warning # instantiate ArgumentException correctly +# dotnet_diagnostic.CA2245.severity = warning # do not assign property to itself + +## Performance (aspnetcore CA18xx set; some have fixers, review per-rule) +# dotnet_diagnostic.CA1822.severity = warning # make member static (scope with dotnet_code_quality.CA1822.api_surface = private, internal) +# dotnet_diagnostic.CA1825.severity = warning # avoid zero-length array allocs [fixer] +# dotnet_diagnostic.CA1827.severity = warning # Any() over Count() [fixer] +# dotnet_diagnostic.CA1829.severity = warning # Length/Count over Count() [fixer] +# dotnet_diagnostic.CA1854.severity = warning # TryGetValue over ContainsKey+indexer [fixer] + +## Line endings / encoding — pair with a .gitattributes first +# end_of_line = crlf +# charset = utf-8 + +#### Generated code — keep LAST so it overrides all sections above #### + +# Generated TS interop sources (ingested; tab-indented) — leave untouched so +# editors don't churn them on save. Also excluded from Prettier (.prettierignore). +[src/src/ig/**] +indent_style = unset +indent_size = unset +insert_final_newline = unset +trim_trailing_whitespace = unset diff --git a/.git-blame-ignore-revs b/.git-blame-ignore-revs new file mode 100644 index 00000000..00aafca0 --- /dev/null +++ b/.git-blame-ignore-revs @@ -0,0 +1,14 @@ +# Commits listed here are skipped by `git blame` (and GitHub's blame view +# picks this file up automatically at the repo root). +# +# Local setup (one-time, per clone): +# git config blame.ignoreRevsFile .git-blame-ignore-revs +# +# Only full 40-character SHAs are valid; a bad entry makes `git blame` error +# out. Append the SHA in a follow-up commit (the hash is only known after the +# formatting commit is created). + +# One-time repo-wide formatting commit (dotnet format whitespace + prettier) +152588b1db59b64bd5249043e870a6db87ed5295 +9a14240ce192dcbed48445ab6251ae33c9f53cbb +98dd4eae72d03f6cecb8b22ae1ea7583362c69ee diff --git a/.githooks/pre-commit b/.githooks/pre-commit new file mode 100755 index 00000000..a9edecd1 --- /dev/null +++ b/.githooks/pre-commit @@ -0,0 +1,4 @@ +#!/bin/sh +# Format staged files with Prettier (and run any other lint-staged tasks). +# Configuration lives in package.json under "lint-staged". +exec npx --no-install lint-staged diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml index ce0d54f2..33053282 100644 --- a/.github/ISSUE_TEMPLATE/config.yml +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -1,8 +1,8 @@ blank_issues_enabled: false contact_links: - - name: Ask a Question - url: https://github.com/IgniteUI/igniteui-blazor/discussions/new - about: Start a Discussion. - - name: Read the Docs - url: https://www.infragistics.com/products/ignite-ui-blazor/blazor/components/general-getting-started - about: Be sure you've read the docs! + - name: Ask a Question + url: https://github.com/IgniteUI/igniteui-blazor/discussions/new + about: Start a Discussion. + - name: Read the Docs + url: https://www.infragistics.com/products/ignite-ui-blazor/blazor/components/general-getting-started + about: Be sure you've read the docs! diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 0caf1ba4..49cab9a4 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -2,14 +2,14 @@ version: 2 updates: - package-ecosystem: "github-actions" - directory: "/" # scans .github/workflows/ automatically + directory: "/" # scans .github/workflows/ automatically schedule: interval: "weekly" day: "monday" cooldown: - default-days: 14 # only propose versions released ≥14 days ago + default-days: 14 # only propose versions released ≥14 days ago groups: github-actions: - applies-to: version-updates # security updates bypass grouping — each gets its own fast-track PR + applies-to: version-updates # security updates bypass grouping — each gets its own fast-track PR patterns: - - "*" # batch all version updates into a single PR + - "*" # batch all version updates into a single PR diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ac0be6bb..9fa92bfa 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -28,6 +28,13 @@ jobs: 9.0.x 10.0.x + # Folder mode formats files directly without loading MSBuild projects — + # full `dotnet format` corrupts sources on multi-targeted projects + # (inserts "Unmerged change from project" conflict markers per TFM; + # dotnet/format#1634, see FORMATTING.md). + - name: Verify .NET code formatting + run: dotnet format whitespace . --folder --exclude templates node_modules --verify-no-changes + - name: Setup Node.js uses: actions/setup-node@v6.4.0 with: @@ -37,6 +44,9 @@ jobs: - name: Install npm dependencies run: npm ci + - name: Verify JS/TS formatting + run: npm run format:check + - name: Build TypeScript/Webpack assets run: npm run build diff --git a/.github/workflows/igniteui-blazor-lite-release.yml b/.github/workflows/igniteui-blazor-lite-release.yml index c2bb7326..0e1df8a7 100644 --- a/.github/workflows/igniteui-blazor-lite-release.yml +++ b/.github/workflows/igniteui-blazor-lite-release.yml @@ -16,23 +16,23 @@ jobs: runs-on: windows-latest environment: nuget-org-publish permissions: - id-token: write # enable Azure OIDC token issuance for this job + id-token: write # enable Azure OIDC token issuance for this job contents: read - + steps: - name: Checkout repository - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 + uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 - name: Setup .NET SDK - uses: actions/setup-dotnet@26b0ec14cb23fa6904739307f278c14f94c95bf1 # v5.4.0 + uses: actions/setup-dotnet@26b0ec14cb23fa6904739307f278c14f94c95bf1 # v5.4.0 with: dotnet-version: 10.0.x - - uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 + - uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 with: - node-version: '24' - registry-url: 'https://registry.npmjs.org' - package-manager-cache: false # never use caching in release builds + node-version: "24" + registry-url: "https://registry.npmjs.org" + package-manager-cache: false # never use caching in release builds - name: Install npm dependencies run: npm ci @@ -53,7 +53,7 @@ jobs: run: dotnet build ./src/IgniteUI.Blazor.Lite.csproj --no-restore --configuration Release /p:Version=${{ env.VERSION }} /p:TreatWarningsAsErrors=false - name: Authenticate to Azure - uses: azure/login@532459ea530d8321f2fb9bb10d1e0bcf23869a43 # v3.0.0 + uses: azure/login@532459ea530d8321f2fb9bb10d1e0bcf23869a43 # v3.0.0 with: client-id: ${{ secrets.AZURE_CLIENT_ID }} tenant-id: ${{ secrets.AZURE_TENANT_ID }} @@ -103,7 +103,7 @@ jobs: run: dotnet nuget verify "${{ github.workspace }}/nupkg/IgniteUI.Blazor.Lite.${{ env.VERSION }}.nupkg" -v q - name: NuGet login (OIDC Trusted Publishing) - uses: NuGet/login@8d196754b4036150537f80ac539e15c2f1028841 # v1 + uses: NuGet/login@8d196754b4036150537f80ac539e15c2f1028841 # v1 id: nuget-login with: user: ${{ secrets.INFRAGISTICS_NUGET_ORG_USER }} diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml index a0fd4cff..ac4a14c1 100644 --- a/.github/workflows/stale.yml +++ b/.github/workflows/stale.yml @@ -2,7 +2,7 @@ name: Mark stale or close issues and pull requests on: schedule: - - cron: "0 0 * * *" + - cron: "0 0 * * *" jobs: stale: @@ -13,14 +13,14 @@ jobs: pull-requests: write steps: - - uses: actions/stale@v10.3.0 - with: - days-before-issue-stale: 60 - days-before-issue-close: 14 - days-before-pr-close: -1 - repo-token: ${{ secrets.GITHUB_TOKEN }} - stale-issue-message: 'There has been no recent activity and this issue has been marked inactive.' - stale-pr-message: 'There has been no recent activity and this PR has been marked inactive.' - stale-issue-label: 'status: inactive' - stale-pr-label: 'status: inactive' - close-issue-message: 'This issue was closed because it has been inactive for 14 days since being marked as stale.' + - uses: actions/stale@v10.3.0 + with: + days-before-issue-stale: 60 + days-before-issue-close: 14 + days-before-pr-close: -1 + repo-token: ${{ secrets.GITHUB_TOKEN }} + stale-issue-message: "There has been no recent activity and this issue has been marked inactive." + stale-pr-message: "There has been no recent activity and this PR has been marked inactive." + stale-issue-label: "status: inactive" + stale-pr-label: "status: inactive" + close-issue-message: "This issue was closed because it has been inactive for 14 days since being marked as stale." diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 00000000..a36999a2 --- /dev/null +++ b/.prettierignore @@ -0,0 +1,15 @@ +# Only tracked files need entries — Prettier 3 also respects .gitignore by +# default (--ignore-path defaults to ['.gitignore', '.prettierignore']), so +# build output, node_modules, obj/bin etc. are already excluded. + +# Generated (committed) TS interop sources — see FORMATTING.md +src/src/ig/ + +# Project templates contain placeholder tokens — leave untouched +templates/ + +# Lockfile +package-lock.json + +# Markdown left unformatted for now (tables/changelog churn) — remove to enable +*.md diff --git a/.prettierrc b/.prettierrc new file mode 100644 index 00000000..49f43edb --- /dev/null +++ b/.prettierrc @@ -0,0 +1,11 @@ +{ + "singleQuote": true, + "overrides": [ + { + "files": ["*.yml", "*.yaml"], + "options": { + "singleQuote": false + } + } + ] +} diff --git a/Directory.Build.props b/Directory.Build.props index 0871a39c..e4adda19 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -5,5 +5,8 @@ true enable enable + + true diff --git a/package-lock.json b/package-lock.json index 4173129e..d93872cf 100644 --- a/package-lock.json +++ b/package-lock.json @@ -24,7 +24,9 @@ "gulp-flatten": "^0.4.0", "html-loader": "^0.5.5", "html-webpack-plugin": "^5.5.0", + "lint-staged": "^17.0.8", "ncp": "^2.0.0", + "prettier": "^3.9.5", "rimraf": "^2.6.1", "source-map-loader": "^0.2.1", "style-loader": "^0.22.1", @@ -1174,6 +1176,22 @@ "node": ">=0.10.0" } }, + "node_modules/ansi-escapes": { + "version": "7.3.0", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-7.3.0.tgz", + "integrity": "sha512-BvU8nYgGQBxcmMuEeUEmNTvrMVjJNSH7RgW24vXexN4Ven6qCvy4TntnvlnwnMLTVlcRQQdbRY8NKnaIoeWDNg==", + "dev": true, + "license": "MIT", + "dependencies": { + "environment": "^1.0.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/ansi-html-community": { "version": "0.0.8", "resolved": "https://registry.npmjs.org/ansi-html-community/-/ansi-html-community-0.0.8.tgz", @@ -1809,6 +1827,85 @@ "node": ">=0.10.0" } }, + "node_modules/cli-cursor": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-5.0.0.tgz", + "integrity": "sha512-aCj4O5wKyszjMmDT4tZj93kxyydN/K5zPWSCe6/0AV/AA1pqe5ZBIw0a2ZfPQV7lL5/yb5HsUreJ6UFAF1tEQw==", + "dev": true, + "license": "MIT", + "dependencies": { + "restore-cursor": "^5.0.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/cli-truncate": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/cli-truncate/-/cli-truncate-5.2.0.tgz", + "integrity": "sha512-xRwvIOMGrfOAnM1JYtqQImuaNtDEv9v6oIYAs4LIHwTiKee8uwvIi363igssOC0O5U04i4AlENs79LQLu9tEMw==", + "dev": true, + "license": "MIT", + "dependencies": { + "slice-ansi": "^8.0.0", + "string-width": "^8.2.0" + }, + "engines": { + "node": ">=20" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/cli-truncate/node_modules/ansi-regex": { + "version": "6.2.2", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.2.2.tgz", + "integrity": "sha512-Bq3SmSpyFHaWjPk8If9yc6svM8c56dB5BAtW4Qbw5jHTwwXXcTLoRMkpDJp6VL0XzlWaCHTXrkFURMYmD0sLqg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-regex?sponsor=1" + } + }, + "node_modules/cli-truncate/node_modules/string-width": { + "version": "8.2.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-8.2.2.tgz", + "integrity": "sha512-GaPUh5gfdrYzqeVNZvUfT23vYYxXzKYidUcnMtJg/3rxRV63EFZy3k6xfKlmfeJD0176lnUV/Usr3XcwSvFzpg==", + "dev": true, + "license": "MIT", + "dependencies": { + "get-east-asian-width": "^1.5.0", + "strip-ansi": "^7.1.2" + }, + "engines": { + "node": ">=20" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/cli-truncate/node_modules/strip-ansi": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.2.0.tgz", + "integrity": "sha512-yDPMNjp4WyfYBkHnjIRLfca1i6KMyGCtsVgoKe/z1+6vukgaENdgGBZt+ZmKPc4gavvEZ5OgHfHdrazhgNyG7w==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^6.2.2" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/strip-ansi?sponsor=1" + } + }, "node_modules/cliui": { "version": "8.0.1", "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", @@ -2524,6 +2621,19 @@ "node": ">=4" } }, + "node_modules/environment": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/environment/-/environment-1.1.0.tgz", + "integrity": "sha512-xUtoPkMggbz0MPyPiIWr1Kp4aeWJjDZ6SMvURhimjdZgsRuDplF5/s9hcgGhyXMhs+6vpnuoiZ2kFiu3FMnS8Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/es-define-property": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz", @@ -2938,6 +3048,13 @@ "through": "^2.3.8" } }, + "node_modules/eventemitter3": { + "version": "5.0.4", + "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-5.0.4.tgz", + "integrity": "sha512-mlsTRyGaPBjPedk6Bvw+aqbsXDtoAyAzm5MO7JgU+yVRyMQ5O8bD4Kcci7BS85f93veegeCPkL8R4GLClnjLFw==", + "dev": true, + "license": "MIT" + }, "node_modules/events": { "version": "3.3.0", "resolved": "https://registry.npmjs.org/events/-/events-3.3.0.tgz", @@ -3331,6 +3448,19 @@ "node": "6.* || 8.* || >= 10.*" } }, + "node_modules/get-east-asian-width": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/get-east-asian-width/-/get-east-asian-width-1.6.0.tgz", + "integrity": "sha512-QRbvDIbx6YklUe6RxeTeleMR0yv3cYH6PsPZHcnVn7xv7zO1BHN8r0XETu8n6Ye3Q+ahtSarc3WgtNWmehIBfA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/get-intrinsic": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz", @@ -4592,6 +4722,138 @@ "node": ">=0.10.0" } }, + "node_modules/lint-staged": { + "version": "17.0.8", + "resolved": "https://registry.npmjs.org/lint-staged/-/lint-staged-17.0.8.tgz", + "integrity": "sha512-B2P/d+jVW0UXOQ0MVMLrB/9ydA1P+zz6jYfdrbbEd9ur3S2rcbduFWKiUCC02Sm5hbC8nrm7y24WuYMG54HfxA==", + "dev": true, + "license": "MIT", + "dependencies": { + "listr2": "^10.2.1", + "picomatch": "^4.0.4", + "string-argv": "^0.3.2", + "tinyexec": "^1.2.4" + }, + "bin": { + "lint-staged": "bin/lint-staged.js" + }, + "engines": { + "node": ">=22.22.1" + }, + "funding": { + "url": "https://opencollective.com/lint-staged" + }, + "optionalDependencies": { + "yaml": "^2.9.0" + } + }, + "node_modules/lint-staged/node_modules/picomatch": { + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.5.tgz", + "integrity": "sha512-RvwwcruNjI1ncT5xRakeyS9Lf8lcItv34KD+aif+VH9kduAyfYBipGh12274xtenIPZ119/R9BdTBa8gAwSh0A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/listr2": { + "version": "10.2.2", + "resolved": "https://registry.npmjs.org/listr2/-/listr2-10.2.2.tgz", + "integrity": "sha512-JtNtbZj8q5BnDMR7trpwvwk3RIrANtIVzEUm8w7amp6xelLgyuq+4WZoTH913XaQAoH/cNdYhaNzBPA2U3xbDw==", + "dev": true, + "license": "MIT", + "dependencies": { + "cli-truncate": "^5.2.0", + "eventemitter3": "^5.0.4", + "log-update": "^6.1.0", + "rfdc": "^1.4.1", + "wrap-ansi": "^10.0.0" + }, + "engines": { + "node": ">=22.13.0" + } + }, + "node_modules/listr2/node_modules/ansi-regex": { + "version": "6.2.2", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.2.2.tgz", + "integrity": "sha512-Bq3SmSpyFHaWjPk8If9yc6svM8c56dB5BAtW4Qbw5jHTwwXXcTLoRMkpDJp6VL0XzlWaCHTXrkFURMYmD0sLqg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-regex?sponsor=1" + } + }, + "node_modules/listr2/node_modules/ansi-styles": { + "version": "6.2.3", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.3.tgz", + "integrity": "sha512-4Dj6M28JB+oAH8kFkTLUo+a2jwOFkuqb3yucU0CANcRRUbxS0cP0nZYCGjcc3BNXwRIsUVmDGgzawme7zvJHvg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/listr2/node_modules/string-width": { + "version": "8.2.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-8.2.2.tgz", + "integrity": "sha512-GaPUh5gfdrYzqeVNZvUfT23vYYxXzKYidUcnMtJg/3rxRV63EFZy3k6xfKlmfeJD0176lnUV/Usr3XcwSvFzpg==", + "dev": true, + "license": "MIT", + "dependencies": { + "get-east-asian-width": "^1.5.0", + "strip-ansi": "^7.1.2" + }, + "engines": { + "node": ">=20" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/listr2/node_modules/strip-ansi": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.2.0.tgz", + "integrity": "sha512-yDPMNjp4WyfYBkHnjIRLfca1i6KMyGCtsVgoKe/z1+6vukgaENdgGBZt+ZmKPc4gavvEZ5OgHfHdrazhgNyG7w==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^6.2.2" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/strip-ansi?sponsor=1" + } + }, + "node_modules/listr2/node_modules/wrap-ansi": { + "version": "10.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-10.0.0.tgz", + "integrity": "sha512-SGcvg80f0wUy2/fXES19feHMz8E0JoXv2uNgHOu4Dgi2OrCy1lqwFYEJz1BLbDI0exjPMe/ZdzZ/YpGECBG/aQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^6.2.3", + "string-width": "^8.2.0", + "strip-ansi": "^7.1.2" + }, + "engines": { + "node": ">=20" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, "node_modules/lit": { "version": "3.3.2", "resolved": "https://registry.npmjs.org/lit/-/lit-3.3.2.tgz", @@ -4671,6 +4933,144 @@ "integrity": "sha512-dMInicTPVE8d1e5otfwmmjlxkZoUpiVLwyeTdUsi/Caj/gfzzblBcCE5sRHV/AsjuCmxWrte2TNGSYuCeCq+0Q==", "dev": true }, + "node_modules/log-update": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/log-update/-/log-update-6.1.0.tgz", + "integrity": "sha512-9ie8ItPR6tjY5uYJh8K/Zrv/RMZ5VOlOWvtZdEHYSTFKZfIBPQa9tOAEeAWhd+AnIneLJ22w5fjOYtoutpWq5w==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-escapes": "^7.0.0", + "cli-cursor": "^5.0.0", + "slice-ansi": "^7.1.0", + "strip-ansi": "^7.1.0", + "wrap-ansi": "^9.0.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/log-update/node_modules/ansi-regex": { + "version": "6.2.2", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.2.2.tgz", + "integrity": "sha512-Bq3SmSpyFHaWjPk8If9yc6svM8c56dB5BAtW4Qbw5jHTwwXXcTLoRMkpDJp6VL0XzlWaCHTXrkFURMYmD0sLqg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-regex?sponsor=1" + } + }, + "node_modules/log-update/node_modules/ansi-styles": { + "version": "6.2.3", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.3.tgz", + "integrity": "sha512-4Dj6M28JB+oAH8kFkTLUo+a2jwOFkuqb3yucU0CANcRRUbxS0cP0nZYCGjcc3BNXwRIsUVmDGgzawme7zvJHvg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/log-update/node_modules/emoji-regex": { + "version": "10.6.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-10.6.0.tgz", + "integrity": "sha512-toUI84YS5YmxW219erniWD0CIVOo46xGKColeNQRgOzDorgBi1v4D71/OFzgD9GO2UGKIv1C3Sp8DAn0+j5w7A==", + "dev": true, + "license": "MIT" + }, + "node_modules/log-update/node_modules/is-fullwidth-code-point": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-5.1.0.tgz", + "integrity": "sha512-5XHYaSyiqADb4RnZ1Bdad6cPp8Toise4TzEjcOYDHZkTCbKgiUl7WTUCpNWHuxmDt91wnsZBc9xinNzopv3JMQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "get-east-asian-width": "^1.3.1" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/log-update/node_modules/slice-ansi": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-7.1.2.tgz", + "integrity": "sha512-iOBWFgUX7caIZiuutICxVgX1SdxwAVFFKwt1EvMYYec/NWO5meOJ6K5uQxhrYBdQJne4KxiqZc+KptFOWFSI9w==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^6.2.1", + "is-fullwidth-code-point": "^5.0.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/chalk/slice-ansi?sponsor=1" + } + }, + "node_modules/log-update/node_modules/string-width": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-7.2.0.tgz", + "integrity": "sha512-tsaTIkKW9b4N+AEj+SVA+WhJzV7/zMhcSu78mLKWSk7cXMOSHsBKFWUs0fWwq8QyK3MgJBQRX6Gbi4kYbdvGkQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "emoji-regex": "^10.3.0", + "get-east-asian-width": "^1.0.0", + "strip-ansi": "^7.1.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/log-update/node_modules/strip-ansi": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.2.0.tgz", + "integrity": "sha512-yDPMNjp4WyfYBkHnjIRLfca1i6KMyGCtsVgoKe/z1+6vukgaENdgGBZt+ZmKPc4gavvEZ5OgHfHdrazhgNyG7w==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^6.2.2" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/strip-ansi?sponsor=1" + } + }, + "node_modules/log-update/node_modules/wrap-ansi": { + "version": "9.0.2", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-9.0.2.tgz", + "integrity": "sha512-42AtmgqjV+X1VpdOfyTGOYRi0/zsoLqtXQckTmqTeybT+BDIbM/Guxo7x3pE2vtpr1ok6xRqM9OpBe+Jyoqyww==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^6.2.1", + "string-width": "^7.0.0", + "strip-ansi": "^7.1.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, "node_modules/lower-case": { "version": "1.1.4", "dev": true, @@ -5268,6 +5668,19 @@ "url": "https://opencollective.com/express" } }, + "node_modules/mimic-function": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/mimic-function/-/mimic-function-5.0.1.tgz", + "integrity": "sha512-VP79XUPxV2CigYP3jWwAUFSku2aKqBH7uTAapFWCBqutsbmDo96KY5o8uh6U+/YSIn5OxJnXp73beVkpqMIGhA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/minimatch": { "version": "3.1.5", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.5.tgz", @@ -5503,6 +5916,22 @@ "wrappy": "1" } }, + "node_modules/onetime": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-7.0.0.tgz", + "integrity": "sha512-VXJjc87FScF88uafS3JllDgvAm+c/Slfz06lorj2uAY34rlUu0Nt+v8wreiImcrgAjjIHp1rXpTDlLOGw29WwQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "mimic-function": "^5.0.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/open": { "version": "11.0.0", "resolved": "https://registry.npmjs.org/open/-/open-11.0.0.tgz", @@ -6022,6 +6451,22 @@ "node": ">= 0.8.0" } }, + "node_modules/prettier": { + "version": "3.9.5", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.9.5.tgz", + "integrity": "sha512-/FVl766LpUfB5vXgCYOYa0MeV/441Ia99AeICQIQFTY/Nw0roZwULcXpku5i1/m5kt/baz+s4Zogspd839HSMg==", + "dev": true, + "license": "MIT", + "bin": { + "prettier": "bin/prettier.cjs" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/prettier/prettier?sponsor=1" + } + }, "node_modules/pretty-error": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/pretty-error/-/pretty-error-4.0.0.tgz", @@ -6317,6 +6762,23 @@ "node": ">= 10.13.0" } }, + "node_modules/restore-cursor": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-5.1.0.tgz", + "integrity": "sha512-oMA2dcrw6u0YfxJQXm342bFKX/E4sG9rbTzO9ptUcR/e8A33cHuvStiYOwH7fszkZlZ1z/ta9AAoPk2F4qIOHA==", + "dev": true, + "license": "MIT", + "dependencies": { + "onetime": "^7.0.0", + "signal-exit": "^4.1.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/reusify": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.1.0.tgz", @@ -6327,6 +6789,13 @@ "node": ">=0.10.0" } }, + "node_modules/rfdc": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/rfdc/-/rfdc-1.4.1.tgz", + "integrity": "sha512-q1b3N5QkRUWUl7iyylaaj3kOpIT0N2i9MqIEQXP73GVsN9cw3fdx8X63cEmWhJGi2PPCF23Ijp7ktmd39rawIA==", + "dev": true, + "license": "MIT" + }, "node_modules/rimraf": { "version": "2.7.1", "dev": true, @@ -6782,6 +7251,65 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/signal-exit": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", + "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/slice-ansi": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-8.0.0.tgz", + "integrity": "sha512-stxByr12oeeOyY2BlviTNQlYV5xOj47GirPr4yA1hE9JCtxfQN0+tVbkxwCtYDQWhEKWFHsEK48ORg5jrouCAg==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^6.2.3", + "is-fullwidth-code-point": "^5.1.0" + }, + "engines": { + "node": ">=20" + }, + "funding": { + "url": "https://github.com/chalk/slice-ansi?sponsor=1" + } + }, + "node_modules/slice-ansi/node_modules/ansi-styles": { + "version": "6.2.3", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.3.tgz", + "integrity": "sha512-4Dj6M28JB+oAH8kFkTLUo+a2jwOFkuqb3yucU0CANcRRUbxS0cP0nZYCGjcc3BNXwRIsUVmDGgzawme7zvJHvg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/slice-ansi/node_modules/is-fullwidth-code-point": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-5.1.0.tgz", + "integrity": "sha512-5XHYaSyiqADb4RnZ1Bdad6cPp8Toise4TzEjcOYDHZkTCbKgiUl7WTUCpNWHuxmDt91wnsZBc9xinNzopv3JMQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "get-east-asian-width": "^1.3.1" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/source-map": { "version": "0.5.7", "dev": true, @@ -6906,6 +7434,16 @@ "safe-buffer": "~5.1.0" } }, + "node_modules/string-argv": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/string-argv/-/string-argv-0.3.2.tgz", + "integrity": "sha512-aqD2Q0144Z+/RqG52NeHEkZauTAUWJO8c6yTftGJKO3Tja5tUgIfmIl6kExvhtxSDP7fXB6DvzkfMpCd/F3G+Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.6.19" + } + }, "node_modules/string-width": { "version": "4.2.3", "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", @@ -7106,6 +7644,16 @@ "integrity": "sha512-eHY7nBftgThBqOyHGVN+l8gF0BucP09fMo0oO/Lb0w1OF80dJv+lDVpXG60WMQvkcxAkNybKsrEIE3ZtKGmPrA==", "dev": true }, + "node_modules/tinyexec": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/tinyexec/-/tinyexec-1.2.4.tgz", + "integrity": "sha512-SHf/r48b7vOrjve9PxJo3MN5v5yuyjHvdUcrQffT3WXMUfnGmHDVbC4k3sHJaJTgZCwpUplIaAo5ANtMyp3YHg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + } + }, "node_modules/tinyglobby": { "version": "0.2.16", "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.16.tgz", @@ -8389,6 +8937,23 @@ "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", "dev": true }, + "node_modules/yaml": { + "version": "2.9.0", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.9.0.tgz", + "integrity": "sha512-2AvhNX3mb8zd6Zy7INTtSpl1F15HW6Wnqj0srWlkKLcpYl/gMIMJiyuGq2KeI2YFxUPjdlB+3Lc10seMLtL4cA==", + "dev": true, + "license": "ISC", + "optional": true, + "bin": { + "yaml": "bin.mjs" + }, + "engines": { + "node": ">= 14.6" + }, + "funding": { + "url": "https://github.com/sponsors/eemeli" + } + }, "node_modules/yargs": { "version": "17.7.2", "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", @@ -9425,6 +9990,15 @@ "ansi-wrap": "0.1.0" } }, + "ansi-escapes": { + "version": "7.3.0", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-7.3.0.tgz", + "integrity": "sha512-BvU8nYgGQBxcmMuEeUEmNTvrMVjJNSH7RgW24vXexN4Ven6qCvy4TntnvlnwnMLTVlcRQQdbRY8NKnaIoeWDNg==", + "dev": true, + "requires": { + "environment": "^1.0.0" + } + }, "ansi-html-community": { "version": "0.0.8", "resolved": "https://registry.npmjs.org/ansi-html-community/-/ansi-html-community-0.0.8.tgz", @@ -9836,6 +10410,52 @@ } } }, + "cli-cursor": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-5.0.0.tgz", + "integrity": "sha512-aCj4O5wKyszjMmDT4tZj93kxyydN/K5zPWSCe6/0AV/AA1pqe5ZBIw0a2ZfPQV7lL5/yb5HsUreJ6UFAF1tEQw==", + "dev": true, + "requires": { + "restore-cursor": "^5.0.0" + } + }, + "cli-truncate": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/cli-truncate/-/cli-truncate-5.2.0.tgz", + "integrity": "sha512-xRwvIOMGrfOAnM1JYtqQImuaNtDEv9v6oIYAs4LIHwTiKee8uwvIi363igssOC0O5U04i4AlENs79LQLu9tEMw==", + "dev": true, + "requires": { + "slice-ansi": "^8.0.0", + "string-width": "^8.2.0" + }, + "dependencies": { + "ansi-regex": { + "version": "6.2.2", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.2.2.tgz", + "integrity": "sha512-Bq3SmSpyFHaWjPk8If9yc6svM8c56dB5BAtW4Qbw5jHTwwXXcTLoRMkpDJp6VL0XzlWaCHTXrkFURMYmD0sLqg==", + "dev": true + }, + "string-width": { + "version": "8.2.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-8.2.2.tgz", + "integrity": "sha512-GaPUh5gfdrYzqeVNZvUfT23vYYxXzKYidUcnMtJg/3rxRV63EFZy3k6xfKlmfeJD0176lnUV/Usr3XcwSvFzpg==", + "dev": true, + "requires": { + "get-east-asian-width": "^1.5.0", + "strip-ansi": "^7.1.2" + } + }, + "strip-ansi": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.2.0.tgz", + "integrity": "sha512-yDPMNjp4WyfYBkHnjIRLfca1i6KMyGCtsVgoKe/z1+6vukgaENdgGBZt+ZmKPc4gavvEZ5OgHfHdrazhgNyG7w==", + "dev": true, + "requires": { + "ansi-regex": "^6.2.2" + } + } + } + }, "cliui": { "version": "8.0.1", "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", @@ -10355,6 +10975,12 @@ "integrity": "sha512-/o+BXHmB7ocbHEAs6F2EnG0ogybVVUdkRunTT2glZU9XAaGmhqskrvKwqXuDfNjEO0LZKWdejEEpnq8aM0tOaw==", "dev": true }, + "environment": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/environment/-/environment-1.1.0.tgz", + "integrity": "sha512-xUtoPkMggbz0MPyPiIWr1Kp4aeWJjDZ6SMvURhimjdZgsRuDplF5/s9hcgGhyXMhs+6vpnuoiZ2kFiu3FMnS8Q==", + "dev": true + }, "es-define-property": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz", @@ -10643,6 +11269,12 @@ "through": "^2.3.8" } }, + "eventemitter3": { + "version": "5.0.4", + "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-5.0.4.tgz", + "integrity": "sha512-mlsTRyGaPBjPedk6Bvw+aqbsXDtoAyAzm5MO7JgU+yVRyMQ5O8bD4Kcci7BS85f93veegeCPkL8R4GLClnjLFw==", + "dev": true + }, "events": { "version": "3.3.0", "resolved": "https://registry.npmjs.org/events/-/events-3.3.0.tgz", @@ -10943,6 +11575,12 @@ "version": "2.0.5", "dev": true }, + "get-east-asian-width": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/get-east-asian-width/-/get-east-asian-width-1.6.0.tgz", + "integrity": "sha512-QRbvDIbx6YklUe6RxeTeleMR0yv3cYH6PsPZHcnVn7xv7zO1BHN8r0XETu8n6Ye3Q+ahtSarc3WgtNWmehIBfA==", + "dev": true + }, "get-intrinsic": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz", @@ -11821,6 +12459,84 @@ } } }, + "lint-staged": { + "version": "17.0.8", + "resolved": "https://registry.npmjs.org/lint-staged/-/lint-staged-17.0.8.tgz", + "integrity": "sha512-B2P/d+jVW0UXOQ0MVMLrB/9ydA1P+zz6jYfdrbbEd9ur3S2rcbduFWKiUCC02Sm5hbC8nrm7y24WuYMG54HfxA==", + "dev": true, + "requires": { + "listr2": "^10.2.1", + "picomatch": "^4.0.4", + "string-argv": "^0.3.2", + "tinyexec": "^1.2.4", + "yaml": "^2.9.0" + }, + "dependencies": { + "picomatch": { + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.5.tgz", + "integrity": "sha512-RvwwcruNjI1ncT5xRakeyS9Lf8lcItv34KD+aif+VH9kduAyfYBipGh12274xtenIPZ119/R9BdTBa8gAwSh0A==", + "dev": true + } + } + }, + "listr2": { + "version": "10.2.2", + "resolved": "https://registry.npmjs.org/listr2/-/listr2-10.2.2.tgz", + "integrity": "sha512-JtNtbZj8q5BnDMR7trpwvwk3RIrANtIVzEUm8w7amp6xelLgyuq+4WZoTH913XaQAoH/cNdYhaNzBPA2U3xbDw==", + "dev": true, + "requires": { + "cli-truncate": "^5.2.0", + "eventemitter3": "^5.0.4", + "log-update": "^6.1.0", + "rfdc": "^1.4.1", + "wrap-ansi": "^10.0.0" + }, + "dependencies": { + "ansi-regex": { + "version": "6.2.2", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.2.2.tgz", + "integrity": "sha512-Bq3SmSpyFHaWjPk8If9yc6svM8c56dB5BAtW4Qbw5jHTwwXXcTLoRMkpDJp6VL0XzlWaCHTXrkFURMYmD0sLqg==", + "dev": true + }, + "ansi-styles": { + "version": "6.2.3", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.3.tgz", + "integrity": "sha512-4Dj6M28JB+oAH8kFkTLUo+a2jwOFkuqb3yucU0CANcRRUbxS0cP0nZYCGjcc3BNXwRIsUVmDGgzawme7zvJHvg==", + "dev": true + }, + "string-width": { + "version": "8.2.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-8.2.2.tgz", + "integrity": "sha512-GaPUh5gfdrYzqeVNZvUfT23vYYxXzKYidUcnMtJg/3rxRV63EFZy3k6xfKlmfeJD0176lnUV/Usr3XcwSvFzpg==", + "dev": true, + "requires": { + "get-east-asian-width": "^1.5.0", + "strip-ansi": "^7.1.2" + } + }, + "strip-ansi": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.2.0.tgz", + "integrity": "sha512-yDPMNjp4WyfYBkHnjIRLfca1i6KMyGCtsVgoKe/z1+6vukgaENdgGBZt+ZmKPc4gavvEZ5OgHfHdrazhgNyG7w==", + "dev": true, + "requires": { + "ansi-regex": "^6.2.2" + } + }, + "wrap-ansi": { + "version": "10.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-10.0.0.tgz", + "integrity": "sha512-SGcvg80f0wUy2/fXES19feHMz8E0JoXv2uNgHOu4Dgi2OrCy1lqwFYEJz1BLbDI0exjPMe/ZdzZ/YpGECBG/aQ==", + "dev": true, + "requires": { + "ansi-styles": "^6.2.3", + "string-width": "^8.2.0", + "strip-ansi": "^7.1.2" + } + } + } + }, "lit": { "version": "3.3.2", "resolved": "https://registry.npmjs.org/lit/-/lit-3.3.2.tgz", @@ -11881,6 +12597,89 @@ "integrity": "sha512-dMInicTPVE8d1e5otfwmmjlxkZoUpiVLwyeTdUsi/Caj/gfzzblBcCE5sRHV/AsjuCmxWrte2TNGSYuCeCq+0Q==", "dev": true }, + "log-update": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/log-update/-/log-update-6.1.0.tgz", + "integrity": "sha512-9ie8ItPR6tjY5uYJh8K/Zrv/RMZ5VOlOWvtZdEHYSTFKZfIBPQa9tOAEeAWhd+AnIneLJ22w5fjOYtoutpWq5w==", + "dev": true, + "requires": { + "ansi-escapes": "^7.0.0", + "cli-cursor": "^5.0.0", + "slice-ansi": "^7.1.0", + "strip-ansi": "^7.1.0", + "wrap-ansi": "^9.0.0" + }, + "dependencies": { + "ansi-regex": { + "version": "6.2.2", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.2.2.tgz", + "integrity": "sha512-Bq3SmSpyFHaWjPk8If9yc6svM8c56dB5BAtW4Qbw5jHTwwXXcTLoRMkpDJp6VL0XzlWaCHTXrkFURMYmD0sLqg==", + "dev": true + }, + "ansi-styles": { + "version": "6.2.3", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.3.tgz", + "integrity": "sha512-4Dj6M28JB+oAH8kFkTLUo+a2jwOFkuqb3yucU0CANcRRUbxS0cP0nZYCGjcc3BNXwRIsUVmDGgzawme7zvJHvg==", + "dev": true + }, + "emoji-regex": { + "version": "10.6.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-10.6.0.tgz", + "integrity": "sha512-toUI84YS5YmxW219erniWD0CIVOo46xGKColeNQRgOzDorgBi1v4D71/OFzgD9GO2UGKIv1C3Sp8DAn0+j5w7A==", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-5.1.0.tgz", + "integrity": "sha512-5XHYaSyiqADb4RnZ1Bdad6cPp8Toise4TzEjcOYDHZkTCbKgiUl7WTUCpNWHuxmDt91wnsZBc9xinNzopv3JMQ==", + "dev": true, + "requires": { + "get-east-asian-width": "^1.3.1" + } + }, + "slice-ansi": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-7.1.2.tgz", + "integrity": "sha512-iOBWFgUX7caIZiuutICxVgX1SdxwAVFFKwt1EvMYYec/NWO5meOJ6K5uQxhrYBdQJne4KxiqZc+KptFOWFSI9w==", + "dev": true, + "requires": { + "ansi-styles": "^6.2.1", + "is-fullwidth-code-point": "^5.0.0" + } + }, + "string-width": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-7.2.0.tgz", + "integrity": "sha512-tsaTIkKW9b4N+AEj+SVA+WhJzV7/zMhcSu78mLKWSk7cXMOSHsBKFWUs0fWwq8QyK3MgJBQRX6Gbi4kYbdvGkQ==", + "dev": true, + "requires": { + "emoji-regex": "^10.3.0", + "get-east-asian-width": "^1.0.0", + "strip-ansi": "^7.1.0" + } + }, + "strip-ansi": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.2.0.tgz", + "integrity": "sha512-yDPMNjp4WyfYBkHnjIRLfca1i6KMyGCtsVgoKe/z1+6vukgaENdgGBZt+ZmKPc4gavvEZ5OgHfHdrazhgNyG7w==", + "dev": true, + "requires": { + "ansi-regex": "^6.2.2" + } + }, + "wrap-ansi": { + "version": "9.0.2", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-9.0.2.tgz", + "integrity": "sha512-42AtmgqjV+X1VpdOfyTGOYRi0/zsoLqtXQckTmqTeybT+BDIbM/Guxo7x3pE2vtpr1ok6xRqM9OpBe+Jyoqyww==", + "dev": true, + "requires": { + "ansi-styles": "^6.2.1", + "string-width": "^7.0.0", + "strip-ansi": "^7.1.0" + } + } + } + }, "lower-case": { "version": "1.1.4", "dev": true @@ -12217,6 +13016,12 @@ "mime-db": "^1.54.0" } }, + "mimic-function": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/mimic-function/-/mimic-function-5.0.1.tgz", + "integrity": "sha512-VP79XUPxV2CigYP3jWwAUFSku2aKqBH7uTAapFWCBqutsbmDo96KY5o8uh6U+/YSIn5OxJnXp73beVkpqMIGhA==", + "dev": true + }, "minimatch": { "version": "3.1.5", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.5.tgz", @@ -12381,6 +13186,15 @@ "wrappy": "1" } }, + "onetime": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-7.0.0.tgz", + "integrity": "sha512-VXJjc87FScF88uafS3JllDgvAm+c/Slfz06lorj2uAY34rlUu0Nt+v8wreiImcrgAjjIHp1rXpTDlLOGw29WwQ==", + "dev": true, + "requires": { + "mimic-function": "^5.0.0" + } + }, "open": { "version": "11.0.0", "resolved": "https://registry.npmjs.org/open/-/open-11.0.0.tgz", @@ -12736,6 +13550,12 @@ "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", "dev": true }, + "prettier": { + "version": "3.9.5", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.9.5.tgz", + "integrity": "sha512-/FVl766LpUfB5vXgCYOYa0MeV/441Ia99AeICQIQFTY/Nw0roZwULcXpku5i1/m5kt/baz+s4Zogspd839HSMg==", + "dev": true + }, "pretty-error": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/pretty-error/-/pretty-error-4.0.0.tgz", @@ -12955,12 +13775,28 @@ "value-or-function": "^4.0.0" } }, + "restore-cursor": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-5.1.0.tgz", + "integrity": "sha512-oMA2dcrw6u0YfxJQXm342bFKX/E4sG9rbTzO9ptUcR/e8A33cHuvStiYOwH7fszkZlZ1z/ta9AAoPk2F4qIOHA==", + "dev": true, + "requires": { + "onetime": "^7.0.0", + "signal-exit": "^4.1.0" + } + }, "reusify": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.1.0.tgz", "integrity": "sha512-g6QUff04oZpHs0eG5p83rFLhHeV00ug/Yf9nZM6fLeUrPguBTkTQOdpAWWspMh55TZfVQDPaN3NQJfbVRAxdIw==", "dev": true }, + "rfdc": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/rfdc/-/rfdc-1.4.1.tgz", + "integrity": "sha512-q1b3N5QkRUWUl7iyylaaj3kOpIT0N2i9MqIEQXP73GVsN9cw3fdx8X63cEmWhJGi2PPCF23Ijp7ktmd39rawIA==", + "dev": true + }, "rimraf": { "version": "2.7.1", "dev": true, @@ -13283,6 +14119,39 @@ "side-channel-map": "^1.0.1" } }, + "signal-exit": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", + "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", + "dev": true + }, + "slice-ansi": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-8.0.0.tgz", + "integrity": "sha512-stxByr12oeeOyY2BlviTNQlYV5xOj47GirPr4yA1hE9JCtxfQN0+tVbkxwCtYDQWhEKWFHsEK48ORg5jrouCAg==", + "dev": true, + "requires": { + "ansi-styles": "^6.2.3", + "is-fullwidth-code-point": "^5.1.0" + }, + "dependencies": { + "ansi-styles": { + "version": "6.2.3", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.3.tgz", + "integrity": "sha512-4Dj6M28JB+oAH8kFkTLUo+a2jwOFkuqb3yucU0CANcRRUbxS0cP0nZYCGjcc3BNXwRIsUVmDGgzawme7zvJHvg==", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-5.1.0.tgz", + "integrity": "sha512-5XHYaSyiqADb4RnZ1Bdad6cPp8Toise4TzEjcOYDHZkTCbKgiUl7WTUCpNWHuxmDt91wnsZBc9xinNzopv3JMQ==", + "dev": true, + "requires": { + "get-east-asian-width": "^1.3.1" + } + } + } + }, "source-map": { "version": "0.5.7", "dev": true @@ -13381,6 +14250,12 @@ "safe-buffer": "~5.1.0" } }, + "string-argv": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/string-argv/-/string-argv-0.3.2.tgz", + "integrity": "sha512-aqD2Q0144Z+/RqG52NeHEkZauTAUWJO8c6yTftGJKO3Tja5tUgIfmIl6kExvhtxSDP7fXB6DvzkfMpCd/F3G+Q==", + "dev": true + }, "string-width": { "version": "4.2.3", "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", @@ -13524,6 +14399,12 @@ "integrity": "sha512-eHY7nBftgThBqOyHGVN+l8gF0BucP09fMo0oO/Lb0w1OF80dJv+lDVpXG60WMQvkcxAkNybKsrEIE3ZtKGmPrA==", "dev": true }, + "tinyexec": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/tinyexec/-/tinyexec-1.2.4.tgz", + "integrity": "sha512-SHf/r48b7vOrjve9PxJo3MN5v5yuyjHvdUcrQffT3WXMUfnGmHDVbC4k3sHJaJTgZCwpUplIaAo5ANtMyp3YHg==", + "dev": true + }, "tinyglobby": { "version": "0.2.16", "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.16.tgz", @@ -14389,6 +15270,13 @@ "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", "dev": true }, + "yaml": { + "version": "2.9.0", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.9.0.tgz", + "integrity": "sha512-2AvhNX3mb8zd6Zy7INTtSpl1F15HW6Wnqj0srWlkKLcpYl/gMIMJiyuGq2KeI2YFxUPjdlB+3Lc10seMLtL4cA==", + "dev": true, + "optional": true + }, "yargs": { "version": "17.7.2", "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", diff --git a/package.json b/package.json index 8ccb729d..481bd762 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,13 @@ "build": "cross-env NODE_ENV=production node node_modules/webpack/bin/webpack.js --mode production --config ./webpack.config.js --color --bail", "build:dev": "cross-env NODE_ENV=development node node_modules/webpack/bin/webpack.js --mode development --config ./webpack.config.js --color --bail", "copythemes": "ncp node_modules/igniteui-webcomponents/themes ./src/wwwroot/themes", - "ingest": "gulp" + "ingest": "gulp", + "format": "prettier --write .", + "format:check": "prettier --check .", + "prepare": "git config core.hooksPath .githooks" + }, + "lint-staged": { + "*.{js,ts,json,yml,yaml,css}": "prettier --write" }, "author": "", "license": "ISC", @@ -23,7 +29,9 @@ "gulp-flatten": "^0.4.0", "html-loader": "^0.5.5", "html-webpack-plugin": "^5.5.0", + "lint-staged": "^17.0.8", "ncp": "^2.0.0", + "prettier": "^3.9.5", "rimraf": "^2.6.1", "source-map-loader": "^0.2.1", "style-loader": "^0.22.1", diff --git a/src/components/Blazor/AbsolutePosition.cs b/src/components/Blazor/AbsolutePosition.cs index c8dca940..1ccd3373 100644 --- a/src/components/Blazor/AbsolutePosition.cs +++ b/src/components/Blazor/AbsolutePosition.cs @@ -1,9 +1,10 @@ namespace IgniteUI.Blazor.Controls { -public enum AbsolutePosition { - Bottom, - Middle, - Top + public enum AbsolutePosition + { + Bottom, + Middle, + Top -} + } } diff --git a/src/components/Blazor/Accordion.cs b/src/components/Blazor/Accordion.cs index 6fcf331a..f168d47a 100644 --- a/src/components/Blazor/Accordion.cs +++ b/src/components/Blazor/Accordion.cs @@ -1,394 +1,416 @@ - -using System; using Microsoft.AspNetCore.Components; -using Microsoft.AspNetCore.Components.Rendering; -using System.Threading.Tasks; -using System.Collections.Generic; -using System.Linq; namespace IgniteUI.Blazor.Controls { - /// -/// The Accordion is a container-based component that can house multiple expansion panels -/// and offers keyboard navigation. -/// -public partial class IgbAccordion: BaseRendererControl { - public override string Type { get { return "WebAccordion"; } } - - protected override void EnsureModulesLoaded() - { - if (!IgbAccordionModule.IsLoadRequested(IgBlazor)) - { - IgbAccordionModule.Register(IgBlazor); - } - } - - protected override string ResolveDisplay() + /// + /// The Accordion is a container-based component that can house multiple expansion panels + /// and offers keyboard navigation. + /// + public partial class IgbAccordion : BaseRendererControl + { + public override string Type { get { return "WebAccordion"; } } + + protected override void EnsureModulesLoaded() + { + if (!IgbAccordionModule.IsLoadRequested(IgBlazor)) + { + IgbAccordionModule.Register(IgBlazor); + } + } + + protected override string ResolveDisplay() + { + return "inline-block"; + } + + protected override bool SupportsVisualChildren + { + get + { + return true; + } + } + + protected override bool UseDirectRender + { + get + { + return true; + } + } + + protected override string DirectRenderElementName + { + get + { + return "igc-accordion"; + } + } + + protected override ControlEventBehavior DefaultEventBehavior + { + get { return ControlEventBehavior.Immediate; } + } + + public IgbAccordion() : base() + { + OnCreatedIgbAccordion(); + + } + + partial void OnCreatedIgbAccordion(); + + private bool _singleExpand = false; + + partial void OnSingleExpandChanging(ref bool newValue); + /// + /// Allows only one panel to be expanded at a time. + /// + [Parameter] + public bool SingleExpand + { + get { return this._singleExpand; } + set + { + if (this._singleExpand != value || !IsPropDirty("SingleExpand")) + { + MarkPropDirty("SingleExpand"); + } + this._singleExpand = value; + + } + } + + partial void FindByNameAccordion(string name, ref object item); + public override object FindByName(string name) + { + + var baseResult = base.FindByName(name); + if (baseResult != null) + { + return baseResult; + } + + object item = null; + FindByNameAccordion(name, ref item); + if (item != null) + { + return item; + } + + return null; + } + public async Task SetNativeElementAsync(Object element) + { + await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + } + public void SetNativeElement(Object element) + { + InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + } + /// + /// Hides all of the child expansion panels' contents. + /// + public async Task HideAllAsync() + { + await InvokeMethod("hideAll", new object[] { }, new string[] { }); + } + public void HideAll() + { + InvokeMethodSync("hideAll", new object[] { }, new string[] { }); + } + /// + /// Shows all of the child expansion panels' contents. + /// + public async Task ShowAllAsync() + { + await InvokeMethod("showAll", new object[] { }, new string[] { }); + } + public void ShowAll() + { + InvokeMethodSync("showAll", new object[] { }, new string[] { }); + } + + private string _openingRef = null; + private string _openingScript = null; + [Parameter] + public string OpeningScript + { + + set + { + if (value != this._openingScript) + { + this._openingScript = value; + this.OnRefChanged("Opening", null, value, true, false, (string refName, object oldValue, object newValue) => + { + this._openingRef = refName; + this.MarkPropDirty("OpeningRef"); + }); + } + } + get + { + return this._openingScript; + } + } + + partial void OnHandlingOpening(IgbExpansionPanelComponentEventArgs args); + private EventCallback? _opening = null; + [Parameter] + public EventCallback Opening + { + get + { + return this._opening != null ? this._opening.Value : EventCallback.Empty; + } + set + { + if (!value.Equals(EventCallback.Empty)) + { + if (!CompareEventCallbacks(value, _opening, ref eventCallbacksCache)) + { + _opening = value; + this.SetHandler(this.Name, "Opening", value, (args) => { - return "inline-block"; - } + OnHandlingOpening(args); - protected override bool SupportsVisualChildren + }); + this.OnRefChanged("Opening", null, "event:::Opening", true, false, (refName, oldValue, newValue) => { - get - { - return true; - } - } + this._openingRef = refName; + this.MarkPropDirty("OpeningRef"); + }); + } + } + else + { + _opening = null; + this.SetHandler(this.Name, "Opening", null); + this.OnRefChanged("Opening", null, null, true, false, (refName, oldValue, newValue) => + { + this._openingRef = null; + this.MarkPropDirty("OpeningRef"); + }); + } + } + } + + private string _openedRef = null; + private string _openedScript = null; + [Parameter] + public string OpenedScript + { - protected override bool UseDirectRender + set + { + if (value != this._openedScript) + { + this._openedScript = value; + this.OnRefChanged("Opened", null, value, true, false, (string refName, object oldValue, object newValue) => + { + this._openedRef = refName; + this.MarkPropDirty("OpenedRef"); + }); + } + } + get + { + return this._openedScript; + } + } + + partial void OnHandlingOpened(IgbExpansionPanelComponentEventArgs args); + private EventCallback? _opened = null; + [Parameter] + public EventCallback Opened + { + get + { + return this._opened != null ? this._opened.Value : EventCallback.Empty; + } + set + { + if (!value.Equals(EventCallback.Empty)) + { + if (!CompareEventCallbacks(value, _opened, ref eventCallbacksCache)) + { + _opened = value; + this.SetHandler(this.Name, "Opened", value, (args) => { - get - { - return true; - } - } + OnHandlingOpened(args); - protected override string DirectRenderElementName + }); + this.OnRefChanged("Opened", null, "event:::Opened", true, false, (refName, oldValue, newValue) => { - get - { - return "igc-accordion"; - } - } - - protected override ControlEventBehavior DefaultEventBehavior - { - get { return ControlEventBehavior.Immediate; } - } - - public IgbAccordion(): base() { - OnCreatedIgbAccordion(); - - - } - - partial void OnCreatedIgbAccordion(); - - private bool _singleExpand = false; - - partial void OnSingleExpandChanging(ref bool newValue); - /// - /// Allows only one panel to be expanded at a time. - /// - [Parameter] - public bool SingleExpand - { - get { return this._singleExpand; } - set { - if (this._singleExpand != value || !IsPropDirty("SingleExpand")) { - MarkPropDirty("SingleExpand"); - } - this._singleExpand = value; - - } - } - - partial void FindByNameAccordion(string name, ref object item); - public override object FindByName(string name) - { - - var baseResult = base.FindByName(name); - if (baseResult != null) - { - return baseResult; - } - - object item = null; - FindByNameAccordion(name, ref item); - if (item != null) - { - return item; - } - - return null; - } - public async Task SetNativeElementAsync(Object element) - { - await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); - } - public void SetNativeElement(Object element) - { - InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); - } - /// - /// Hides all of the child expansion panels' contents. - /// - public async Task HideAllAsync() - { - await InvokeMethod("hideAll", new object[] { }, new string[] { }); - } - public void HideAll() - { - InvokeMethodSync("hideAll", new object[] { }, new string[] { }); - } - /// - /// Shows all of the child expansion panels' contents. - /// - public async Task ShowAllAsync() - { - await InvokeMethod("showAll", new object[] { }, new string[] { }); - } - public void ShowAll() - { - InvokeMethodSync("showAll", new object[] { }, new string[] { }); - } - - private string _openingRef = null; - private string _openingScript = null; - [Parameter] - public string OpeningScript { - - set - { - if (value != this._openingScript) - { - this._openingScript = value; - this.OnRefChanged("Opening", null, value, true, false, (string refName, object oldValue, object newValue) => { - this._openingRef = refName; - this.MarkPropDirty("OpeningRef"); - }); - } - } - get - { - return this._openingScript; - } - } - - partial void OnHandlingOpening(IgbExpansionPanelComponentEventArgs args); - private EventCallback? _opening = null; - [Parameter] - public EventCallback Opening - { - get - { - return this._opening != null ? this._opening.Value : EventCallback.Empty; - } - set - { - if (!value.Equals(EventCallback.Empty)) - { - if (!CompareEventCallbacks(value, _opening, ref eventCallbacksCache)) - { - _opening = value; - this.SetHandler(this.Name, "Opening", value, (args) => { - OnHandlingOpening(args); - - }); - this.OnRefChanged("Opening", null, "event:::Opening", true, false, (refName, oldValue, newValue) => { - this._openingRef = refName; - this.MarkPropDirty("OpeningRef"); - }); - } - } - else - { - _opening = null; - this.SetHandler(this.Name, "Opening", null); - this.OnRefChanged("Opening", null, null, true, false, (refName, oldValue, newValue) => { - this._openingRef = null; - this.MarkPropDirty("OpeningRef"); - }); - } - } - } - - private string _openedRef = null; - private string _openedScript = null; - [Parameter] - public string OpenedScript { - - set - { - if (value != this._openedScript) - { - this._openedScript = value; - this.OnRefChanged("Opened", null, value, true, false, (string refName, object oldValue, object newValue) => { - this._openedRef = refName; - this.MarkPropDirty("OpenedRef"); - }); - } - } - get - { - return this._openedScript; - } - } - - partial void OnHandlingOpened(IgbExpansionPanelComponentEventArgs args); - private EventCallback? _opened = null; - [Parameter] - public EventCallback Opened - { - get - { - return this._opened != null ? this._opened.Value : EventCallback.Empty; - } - set - { - if (!value.Equals(EventCallback.Empty)) - { - if (!CompareEventCallbacks(value, _opened, ref eventCallbacksCache)) - { - _opened = value; - this.SetHandler(this.Name, "Opened", value, (args) => { - OnHandlingOpened(args); - - }); - this.OnRefChanged("Opened", null, "event:::Opened", true, false, (refName, oldValue, newValue) => { - this._openedRef = refName; - this.MarkPropDirty("OpenedRef"); - }); - } - } - else - { - _opened = null; - this.SetHandler(this.Name, "Opened", null); - this.OnRefChanged("Opened", null, null, true, false, (refName, oldValue, newValue) => { - this._openedRef = null; - this.MarkPropDirty("OpenedRef"); - }); - } - } - } - - private string _closingRef = null; - private string _closingScript = null; - [Parameter] - public string ClosingScript { - - set - { - if (value != this._closingScript) - { - this._closingScript = value; - this.OnRefChanged("Closing", null, value, true, false, (string refName, object oldValue, object newValue) => { - this._closingRef = refName; - this.MarkPropDirty("ClosingRef"); - }); - } - } - get - { - return this._closingScript; - } - } - - partial void OnHandlingClosing(IgbExpansionPanelComponentEventArgs args); - private EventCallback? _closing = null; - [Parameter] - public EventCallback Closing - { - get - { - return this._closing != null ? this._closing.Value : EventCallback.Empty; - } - set - { - if (!value.Equals(EventCallback.Empty)) - { - if (!CompareEventCallbacks(value, _closing, ref eventCallbacksCache)) - { - _closing = value; - this.SetHandler(this.Name, "Closing", value, (args) => { - OnHandlingClosing(args); - - }); - this.OnRefChanged("Closing", null, "event:::Closing", true, false, (refName, oldValue, newValue) => { - this._closingRef = refName; - this.MarkPropDirty("ClosingRef"); - }); - } - } - else - { - _closing = null; - this.SetHandler(this.Name, "Closing", null); - this.OnRefChanged("Closing", null, null, true, false, (refName, oldValue, newValue) => { - this._closingRef = null; - this.MarkPropDirty("ClosingRef"); - }); - } - } - } - - private string _closedRef = null; - private string _closedScript = null; - [Parameter] - public string ClosedScript { - - set - { - if (value != this._closedScript) - { - this._closedScript = value; - this.OnRefChanged("Closed", null, value, true, false, (string refName, object oldValue, object newValue) => { - this._closedRef = refName; - this.MarkPropDirty("ClosedRef"); - }); - } - } - get - { - return this._closedScript; - } - } - - partial void OnHandlingClosed(IgbExpansionPanelComponentEventArgs args); - private EventCallback? _closed = null; - [Parameter] - public EventCallback Closed - { - get - { - return this._closed != null ? this._closed.Value : EventCallback.Empty; - } - set - { - if (!value.Equals(EventCallback.Empty)) - { - if (!CompareEventCallbacks(value, _closed, ref eventCallbacksCache)) - { - _closed = value; - this.SetHandler(this.Name, "Closed", value, (args) => { - OnHandlingClosed(args); - - }); - this.OnRefChanged("Closed", null, "event:::Closed", true, false, (refName, oldValue, newValue) => { - this._closedRef = refName; - this.MarkPropDirty("ClosedRef"); - }); - } - } - else - { - _closed = null; - this.SetHandler(this.Name, "Closed", null); - this.OnRefChanged("Closed", null, null, true, false, (refName, oldValue, newValue) => { - this._closedRef = null; - this.MarkPropDirty("ClosedRef"); - }); - } - } - } - - partial void SerializeCoreIgbAccordion(RendererSerializer ser); - - internal override void SerializeCore(RendererSerializer ser) - { - base.SerializeCore(ser); - - SerializeCoreIgbAccordion(ser); - - if (IsPropDirty("SingleExpand")) { ser.AddBooleanProp("singleExpand", this._singleExpand); } - if (IsPropDirty("OpeningRef")) { ser.AddStringProp("openingRef", this._openingRef); } - if (IsPropDirty("OpenedRef")) { ser.AddStringProp("openedRef", this._openedRef); } - if (IsPropDirty("ClosingRef")) { ser.AddStringProp("closingRef", this._closingRef); } - if (IsPropDirty("ClosedRef")) { ser.AddStringProp("closedRef", this._closedRef); } - - } - -} + this._openedRef = refName; + this.MarkPropDirty("OpenedRef"); + }); + } + } + else + { + _opened = null; + this.SetHandler(this.Name, "Opened", null); + this.OnRefChanged("Opened", null, null, true, false, (refName, oldValue, newValue) => + { + this._openedRef = null; + this.MarkPropDirty("OpenedRef"); + }); + } + } + } + + private string _closingRef = null; + private string _closingScript = null; + [Parameter] + public string ClosingScript + { + + set + { + if (value != this._closingScript) + { + this._closingScript = value; + this.OnRefChanged("Closing", null, value, true, false, (string refName, object oldValue, object newValue) => + { + this._closingRef = refName; + this.MarkPropDirty("ClosingRef"); + }); + } + } + get + { + return this._closingScript; + } + } + + partial void OnHandlingClosing(IgbExpansionPanelComponentEventArgs args); + private EventCallback? _closing = null; + [Parameter] + public EventCallback Closing + { + get + { + return this._closing != null ? this._closing.Value : EventCallback.Empty; + } + set + { + if (!value.Equals(EventCallback.Empty)) + { + if (!CompareEventCallbacks(value, _closing, ref eventCallbacksCache)) + { + _closing = value; + this.SetHandler(this.Name, "Closing", value, (args) => + { + OnHandlingClosing(args); + + }); + this.OnRefChanged("Closing", null, "event:::Closing", true, false, (refName, oldValue, newValue) => + { + this._closingRef = refName; + this.MarkPropDirty("ClosingRef"); + }); + } + } + else + { + _closing = null; + this.SetHandler(this.Name, "Closing", null); + this.OnRefChanged("Closing", null, null, true, false, (refName, oldValue, newValue) => + { + this._closingRef = null; + this.MarkPropDirty("ClosingRef"); + }); + } + } + } + + private string _closedRef = null; + private string _closedScript = null; + [Parameter] + public string ClosedScript + { + + set + { + if (value != this._closedScript) + { + this._closedScript = value; + this.OnRefChanged("Closed", null, value, true, false, (string refName, object oldValue, object newValue) => + { + this._closedRef = refName; + this.MarkPropDirty("ClosedRef"); + }); + } + } + get + { + return this._closedScript; + } + } + + partial void OnHandlingClosed(IgbExpansionPanelComponentEventArgs args); + private EventCallback? _closed = null; + [Parameter] + public EventCallback Closed + { + get + { + return this._closed != null ? this._closed.Value : EventCallback.Empty; + } + set + { + if (!value.Equals(EventCallback.Empty)) + { + if (!CompareEventCallbacks(value, _closed, ref eventCallbacksCache)) + { + _closed = value; + this.SetHandler(this.Name, "Closed", value, (args) => + { + OnHandlingClosed(args); + + }); + this.OnRefChanged("Closed", null, "event:::Closed", true, false, (refName, oldValue, newValue) => + { + this._closedRef = refName; + this.MarkPropDirty("ClosedRef"); + }); + } + } + else + { + _closed = null; + this.SetHandler(this.Name, "Closed", null); + this.OnRefChanged("Closed", null, null, true, false, (refName, oldValue, newValue) => + { + this._closedRef = null; + this.MarkPropDirty("ClosedRef"); + }); + } + } + } + + partial void SerializeCoreIgbAccordion(RendererSerializer ser); + + internal override void SerializeCore(RendererSerializer ser) + { + base.SerializeCore(ser); + + SerializeCoreIgbAccordion(ser); + + if (IsPropDirty("SingleExpand")) + { ser.AddBooleanProp("singleExpand", this._singleExpand); } + if (IsPropDirty("OpeningRef")) + { ser.AddStringProp("openingRef", this._openingRef); } + if (IsPropDirty("OpenedRef")) + { ser.AddStringProp("openedRef", this._openedRef); } + if (IsPropDirty("ClosingRef")) + { ser.AddStringProp("closingRef", this._closingRef); } + if (IsPropDirty("ClosedRef")) + { ser.AddStringProp("closedRef", this._closedRef); } + + } + + } } diff --git a/src/components/Blazor/AccordionModule.cs b/src/components/Blazor/AccordionModule.cs index 69403f3d..d737ba1c 100644 --- a/src/components/Blazor/AccordionModule.cs +++ b/src/components/Blazor/AccordionModule.cs @@ -1,23 +1,20 @@ -using System; -using System.Collections.Generic; -using System.Runtime.CompilerServices; -using System.Text; -using System.Collections.Generic; - namespace IgniteUI.Blazor.Controls { - public partial class IgbAccordionModule { - public static void Register(IIgniteUIBlazor runtime) { + public partial class IgbAccordionModule + { + public static void Register(IIgniteUIBlazor runtime) + { ModuleLoader.Load(runtime, "WebAccordionModule"); - } - public static void MarkIsLoadRequested(IIgniteUIBlazor runtime) { + public static void MarkIsLoadRequested(IIgniteUIBlazor runtime) + { ModuleLoader.MarkIsLoadRequested(runtime, "WebAccordionModule"); } - public static bool IsLoadRequested(IIgniteUIBlazor runtime) { + public static bool IsLoadRequested(IIgniteUIBlazor runtime) + { return ModuleLoader.IsLoadRequested(runtime, "WebAccordionModule"); } } diff --git a/src/components/Blazor/ActiveStepChangedEventArgs.cs b/src/components/Blazor/ActiveStepChangedEventArgs.cs index 6b9b31cf..6b8b6eb9 100644 --- a/src/components/Blazor/ActiveStepChangedEventArgs.cs +++ b/src/components/Blazor/ActiveStepChangedEventArgs.cs @@ -1,99 +1,97 @@ - -using System; using Microsoft.AspNetCore.Components; -using Microsoft.AspNetCore.Components.Rendering; -using System.Threading.Tasks; -using System.Collections.Generic; -using System.Linq; namespace IgniteUI.Blazor.Controls { - public partial class IgbActiveStepChangedEventArgs: BaseRendererElement { - public override string Type { get { return "WebActiveStepChangedEventArgs"; } } - - - private static bool _marshalByValue = true; - - public IgbActiveStepChangedEventArgs(): base() { - OnCreatedIgbActiveStepChangedEventArgs(); - - - } - - partial void OnCreatedIgbActiveStepChangedEventArgs(); - - private IgbActiveStepChangedEventArgsDetail _detail; - - partial void OnDetailChanging(ref IgbActiveStepChangedEventArgsDetail newValue); - [Parameter] - public IgbActiveStepChangedEventArgsDetail Detail - { - get { return this._detail; } - set { - OnDetailChanging(ref value); - MarkPropDirty("Detail"); - if (this._detail != null) { - this.DetachChild(this._detail); - } - if (value != null) { - this.AttachChild(value); - } - this._detail = value; - } - - } - - partial void FindByNameActiveStepChangedEventArgs(string name, ref object item); - public override object FindByName(string name) - { - - var baseResult = base.FindByName(name); - if (baseResult != null) - { - return baseResult; - } - - object item = null; - FindByNameActiveStepChangedEventArgs(name, ref item); - if (item != null) - { - return item; - } - - return null; - } - - partial void SerializeCoreIgbActiveStepChangedEventArgs(RendererSerializer ser); - - internal override void SerializeCore(RendererSerializer ser) - { - base.SerializeCore(ser); - - SerializeCoreIgbActiveStepChangedEventArgs(ser); - - if (IsPropDirty("Detail")) { ser.AddSerializableProp("detail", this._detail); } - - } - - - protected internal override void ToEventJson(BaseRendererControl control, Dictionary args) - { - base.ToEventJson(control, args); - - if (IsPropDirty("Detail")) { args["detail"] = ObjectToParam(this._detail); } - - - } - - - protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) { - base.FromEventJson(control, args); - this.SuppressParentNotify = true; - - if (args.ContainsKey("detail")) { this.Detail = (IgbActiveStepChangedEventArgsDetail)ConvertReturnValue(args["detail"], "ActiveStepChangedEventArgsDetail", true); } - - this.SuppressParentNotify = false; - } - -} + public partial class IgbActiveStepChangedEventArgs : BaseRendererElement + { + public override string Type { get { return "WebActiveStepChangedEventArgs"; } } + + private static bool _marshalByValue = true; + + public IgbActiveStepChangedEventArgs() : base() + { + OnCreatedIgbActiveStepChangedEventArgs(); + + } + + partial void OnCreatedIgbActiveStepChangedEventArgs(); + + private IgbActiveStepChangedEventArgsDetail _detail; + + partial void OnDetailChanging(ref IgbActiveStepChangedEventArgsDetail newValue); + [Parameter] + public IgbActiveStepChangedEventArgsDetail Detail + { + get { return this._detail; } + set + { + OnDetailChanging(ref value); + MarkPropDirty("Detail"); + if (this._detail != null) + { + this.DetachChild(this._detail); + } + if (value != null) + { + this.AttachChild(value); + } + this._detail = value; + } + + } + + partial void FindByNameActiveStepChangedEventArgs(string name, ref object item); + public override object FindByName(string name) + { + + var baseResult = base.FindByName(name); + if (baseResult != null) + { + return baseResult; + } + + object item = null; + FindByNameActiveStepChangedEventArgs(name, ref item); + if (item != null) + { + return item; + } + + return null; + } + + partial void SerializeCoreIgbActiveStepChangedEventArgs(RendererSerializer ser); + + internal override void SerializeCore(RendererSerializer ser) + { + base.SerializeCore(ser); + + SerializeCoreIgbActiveStepChangedEventArgs(ser); + + if (IsPropDirty("Detail")) + { ser.AddSerializableProp("detail", this._detail); } + + } + + protected internal override void ToEventJson(BaseRendererControl control, Dictionary args) + { + base.ToEventJson(control, args); + + if (IsPropDirty("Detail")) + { args["detail"] = ObjectToParam(this._detail); } + + } + + protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) + { + base.FromEventJson(control, args); + this.SuppressParentNotify = true; + + if (args.ContainsKey("detail")) + { this.Detail = (IgbActiveStepChangedEventArgsDetail)ConvertReturnValue(args["detail"], "ActiveStepChangedEventArgsDetail", true); } + + this.SuppressParentNotify = false; + } + + } } diff --git a/src/components/Blazor/ActiveStepChangedEventArgsDetail.cs b/src/components/Blazor/ActiveStepChangedEventArgsDetail.cs index c2e59916..a1db0bd8 100644 --- a/src/components/Blazor/ActiveStepChangedEventArgsDetail.cs +++ b/src/components/Blazor/ActiveStepChangedEventArgsDetail.cs @@ -1,94 +1,91 @@ - -using System; using Microsoft.AspNetCore.Components; -using Microsoft.AspNetCore.Components.Rendering; -using System.Threading.Tasks; -using System.Collections.Generic; -using System.Linq; namespace IgniteUI.Blazor.Controls { - public partial class IgbActiveStepChangedEventArgsDetail: BaseRendererElement { - public override string Type { get { return "WebActiveStepChangedEventArgsDetail"; } } - - - private static bool _marshalByValue = true; - - public IgbActiveStepChangedEventArgsDetail(): base() { - OnCreatedIgbActiveStepChangedEventArgsDetail(); - - - } - - partial void OnCreatedIgbActiveStepChangedEventArgsDetail(); - - private double _index = 0; - - partial void OnIndexChanging(ref double newValue); - [Parameter] - public double Index - { - get { return this._index; } - set { - if (this._index != value || !IsPropDirty("Index")) { - MarkPropDirty("Index"); - } - this._index = value; - - } - } - - partial void FindByNameActiveStepChangedEventArgsDetail(string name, ref object item); - public override object FindByName(string name) - { - - var baseResult = base.FindByName(name); - if (baseResult != null) - { - return baseResult; - } - - object item = null; - FindByNameActiveStepChangedEventArgsDetail(name, ref item); - if (item != null) - { - return item; - } - - return null; - } - - partial void SerializeCoreIgbActiveStepChangedEventArgsDetail(RendererSerializer ser); - - internal override void SerializeCore(RendererSerializer ser) - { - base.SerializeCore(ser); - - SerializeCoreIgbActiveStepChangedEventArgsDetail(ser); - - if (IsPropDirty("Index")) { ser.AddNumberProp("index", this._index); } - - } - - - protected internal override void ToEventJson(BaseRendererControl control, Dictionary args) - { - base.ToEventJson(control, args); - - if (IsPropDirty("Index")) { args["index"] = (this._index).ToString(); } - - - } - - - protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) { - base.FromEventJson(control, args); - this.SuppressParentNotify = true; - - if (args.ContainsKey("index")) { this.Index = ReturnToDouble(args["index"]); } - - this.SuppressParentNotify = false; - } - -} + public partial class IgbActiveStepChangedEventArgsDetail : BaseRendererElement + { + public override string Type { get { return "WebActiveStepChangedEventArgsDetail"; } } + + private static bool _marshalByValue = true; + + public IgbActiveStepChangedEventArgsDetail() : base() + { + OnCreatedIgbActiveStepChangedEventArgsDetail(); + + } + + partial void OnCreatedIgbActiveStepChangedEventArgsDetail(); + + private double _index = 0; + + partial void OnIndexChanging(ref double newValue); + [Parameter] + public double Index + { + get { return this._index; } + set + { + if (this._index != value || !IsPropDirty("Index")) + { + MarkPropDirty("Index"); + } + this._index = value; + + } + } + + partial void FindByNameActiveStepChangedEventArgsDetail(string name, ref object item); + public override object FindByName(string name) + { + + var baseResult = base.FindByName(name); + if (baseResult != null) + { + return baseResult; + } + + object item = null; + FindByNameActiveStepChangedEventArgsDetail(name, ref item); + if (item != null) + { + return item; + } + + return null; + } + + partial void SerializeCoreIgbActiveStepChangedEventArgsDetail(RendererSerializer ser); + + internal override void SerializeCore(RendererSerializer ser) + { + base.SerializeCore(ser); + + SerializeCoreIgbActiveStepChangedEventArgsDetail(ser); + + if (IsPropDirty("Index")) + { ser.AddNumberProp("index", this._index); } + + } + + protected internal override void ToEventJson(BaseRendererControl control, Dictionary args) + { + base.ToEventJson(control, args); + + if (IsPropDirty("Index")) + { args["index"] = (this._index).ToString(); } + + } + + protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) + { + base.FromEventJson(control, args); + this.SuppressParentNotify = true; + + if (args.ContainsKey("index")) + { this.Index = ReturnToDouble(args["index"]); } + + this.SuppressParentNotify = false; + } + + } } diff --git a/src/components/Blazor/ActiveStepChangingEventArgs.cs b/src/components/Blazor/ActiveStepChangingEventArgs.cs index f9551850..bfcfd317 100644 --- a/src/components/Blazor/ActiveStepChangingEventArgs.cs +++ b/src/components/Blazor/ActiveStepChangingEventArgs.cs @@ -1,99 +1,97 @@ - -using System; using Microsoft.AspNetCore.Components; -using Microsoft.AspNetCore.Components.Rendering; -using System.Threading.Tasks; -using System.Collections.Generic; -using System.Linq; namespace IgniteUI.Blazor.Controls { - public partial class IgbActiveStepChangingEventArgs: BaseRendererElement { - public override string Type { get { return "WebActiveStepChangingEventArgs"; } } - - - private static bool _marshalByValue = true; - - public IgbActiveStepChangingEventArgs(): base() { - OnCreatedIgbActiveStepChangingEventArgs(); - - - } - - partial void OnCreatedIgbActiveStepChangingEventArgs(); - - private IgbActiveStepChangingEventArgsDetail _detail; - - partial void OnDetailChanging(ref IgbActiveStepChangingEventArgsDetail newValue); - [Parameter] - public IgbActiveStepChangingEventArgsDetail Detail - { - get { return this._detail; } - set { - OnDetailChanging(ref value); - MarkPropDirty("Detail"); - if (this._detail != null) { - this.DetachChild(this._detail); - } - if (value != null) { - this.AttachChild(value); - } - this._detail = value; - } - - } - - partial void FindByNameActiveStepChangingEventArgs(string name, ref object item); - public override object FindByName(string name) - { - - var baseResult = base.FindByName(name); - if (baseResult != null) - { - return baseResult; - } - - object item = null; - FindByNameActiveStepChangingEventArgs(name, ref item); - if (item != null) - { - return item; - } - - return null; - } - - partial void SerializeCoreIgbActiveStepChangingEventArgs(RendererSerializer ser); - - internal override void SerializeCore(RendererSerializer ser) - { - base.SerializeCore(ser); - - SerializeCoreIgbActiveStepChangingEventArgs(ser); - - if (IsPropDirty("Detail")) { ser.AddSerializableProp("detail", this._detail); } - - } - - - protected internal override void ToEventJson(BaseRendererControl control, Dictionary args) - { - base.ToEventJson(control, args); - - if (IsPropDirty("Detail")) { args["detail"] = ObjectToParam(this._detail); } - - - } - - - protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) { - base.FromEventJson(control, args); - this.SuppressParentNotify = true; - - if (args.ContainsKey("detail")) { this.Detail = (IgbActiveStepChangingEventArgsDetail)ConvertReturnValue(args["detail"], "ActiveStepChangingEventArgsDetail", true); } - - this.SuppressParentNotify = false; - } - -} + public partial class IgbActiveStepChangingEventArgs : BaseRendererElement + { + public override string Type { get { return "WebActiveStepChangingEventArgs"; } } + + private static bool _marshalByValue = true; + + public IgbActiveStepChangingEventArgs() : base() + { + OnCreatedIgbActiveStepChangingEventArgs(); + + } + + partial void OnCreatedIgbActiveStepChangingEventArgs(); + + private IgbActiveStepChangingEventArgsDetail _detail; + + partial void OnDetailChanging(ref IgbActiveStepChangingEventArgsDetail newValue); + [Parameter] + public IgbActiveStepChangingEventArgsDetail Detail + { + get { return this._detail; } + set + { + OnDetailChanging(ref value); + MarkPropDirty("Detail"); + if (this._detail != null) + { + this.DetachChild(this._detail); + } + if (value != null) + { + this.AttachChild(value); + } + this._detail = value; + } + + } + + partial void FindByNameActiveStepChangingEventArgs(string name, ref object item); + public override object FindByName(string name) + { + + var baseResult = base.FindByName(name); + if (baseResult != null) + { + return baseResult; + } + + object item = null; + FindByNameActiveStepChangingEventArgs(name, ref item); + if (item != null) + { + return item; + } + + return null; + } + + partial void SerializeCoreIgbActiveStepChangingEventArgs(RendererSerializer ser); + + internal override void SerializeCore(RendererSerializer ser) + { + base.SerializeCore(ser); + + SerializeCoreIgbActiveStepChangingEventArgs(ser); + + if (IsPropDirty("Detail")) + { ser.AddSerializableProp("detail", this._detail); } + + } + + protected internal override void ToEventJson(BaseRendererControl control, Dictionary args) + { + base.ToEventJson(control, args); + + if (IsPropDirty("Detail")) + { args["detail"] = ObjectToParam(this._detail); } + + } + + protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) + { + base.FromEventJson(control, args); + this.SuppressParentNotify = true; + + if (args.ContainsKey("detail")) + { this.Detail = (IgbActiveStepChangingEventArgsDetail)ConvertReturnValue(args["detail"], "ActiveStepChangingEventArgsDetail", true); } + + this.SuppressParentNotify = false; + } + + } } diff --git a/src/components/Blazor/ActiveStepChangingEventArgsDetail.cs b/src/components/Blazor/ActiveStepChangingEventArgsDetail.cs index 8df19bcf..292bec1f 100644 --- a/src/components/Blazor/ActiveStepChangingEventArgsDetail.cs +++ b/src/components/Blazor/ActiveStepChangingEventArgsDetail.cs @@ -1,112 +1,114 @@ - -using System; using Microsoft.AspNetCore.Components; -using Microsoft.AspNetCore.Components.Rendering; -using System.Threading.Tasks; -using System.Collections.Generic; -using System.Linq; namespace IgniteUI.Blazor.Controls { - public partial class IgbActiveStepChangingEventArgsDetail: BaseRendererElement { - public override string Type { get { return "WebActiveStepChangingEventArgsDetail"; } } - - - private static bool _marshalByValue = true; - - public IgbActiveStepChangingEventArgsDetail(): base() { - OnCreatedIgbActiveStepChangingEventArgsDetail(); - - - } - - partial void OnCreatedIgbActiveStepChangingEventArgsDetail(); - - private double _oldIndex = 0; - - partial void OnOldIndexChanging(ref double newValue); - [Parameter] - public double OldIndex - { - get { return this._oldIndex; } - set { - if (this._oldIndex != value || !IsPropDirty("OldIndex")) { - MarkPropDirty("OldIndex"); - } - this._oldIndex = value; - - } - } - private double _newIndex = 0; - - partial void OnNewIndexChanging(ref double newValue); - [Parameter] - public double NewIndex - { - get { return this._newIndex; } - set { - if (this._newIndex != value || !IsPropDirty("NewIndex")) { - MarkPropDirty("NewIndex"); - } - this._newIndex = value; - - } - } - - partial void FindByNameActiveStepChangingEventArgsDetail(string name, ref object item); - public override object FindByName(string name) - { - - var baseResult = base.FindByName(name); - if (baseResult != null) - { - return baseResult; - } - - object item = null; - FindByNameActiveStepChangingEventArgsDetail(name, ref item); - if (item != null) - { - return item; - } - - return null; - } - - partial void SerializeCoreIgbActiveStepChangingEventArgsDetail(RendererSerializer ser); - - internal override void SerializeCore(RendererSerializer ser) - { - base.SerializeCore(ser); - - SerializeCoreIgbActiveStepChangingEventArgsDetail(ser); - - if (IsPropDirty("OldIndex")) { ser.AddNumberProp("oldIndex", this._oldIndex); } - if (IsPropDirty("NewIndex")) { ser.AddNumberProp("newIndex", this._newIndex); } - - } - - - protected internal override void ToEventJson(BaseRendererControl control, Dictionary args) - { - base.ToEventJson(control, args); - - if (IsPropDirty("OldIndex")) { args["oldIndex"] = (this._oldIndex).ToString(); } - if (IsPropDirty("NewIndex")) { args["newIndex"] = (this._newIndex).ToString(); } - - - } - - - protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) { - base.FromEventJson(control, args); - this.SuppressParentNotify = true; - - if (args.ContainsKey("oldIndex")) { this.OldIndex = ReturnToDouble(args["oldIndex"]); } - if (args.ContainsKey("newIndex")) { this.NewIndex = ReturnToDouble(args["newIndex"]); } - - this.SuppressParentNotify = false; - } - -} + public partial class IgbActiveStepChangingEventArgsDetail : BaseRendererElement + { + public override string Type { get { return "WebActiveStepChangingEventArgsDetail"; } } + + private static bool _marshalByValue = true; + + public IgbActiveStepChangingEventArgsDetail() : base() + { + OnCreatedIgbActiveStepChangingEventArgsDetail(); + + } + + partial void OnCreatedIgbActiveStepChangingEventArgsDetail(); + + private double _oldIndex = 0; + + partial void OnOldIndexChanging(ref double newValue); + [Parameter] + public double OldIndex + { + get { return this._oldIndex; } + set + { + if (this._oldIndex != value || !IsPropDirty("OldIndex")) + { + MarkPropDirty("OldIndex"); + } + this._oldIndex = value; + + } + } + private double _newIndex = 0; + + partial void OnNewIndexChanging(ref double newValue); + [Parameter] + public double NewIndex + { + get { return this._newIndex; } + set + { + if (this._newIndex != value || !IsPropDirty("NewIndex")) + { + MarkPropDirty("NewIndex"); + } + this._newIndex = value; + + } + } + + partial void FindByNameActiveStepChangingEventArgsDetail(string name, ref object item); + public override object FindByName(string name) + { + + var baseResult = base.FindByName(name); + if (baseResult != null) + { + return baseResult; + } + + object item = null; + FindByNameActiveStepChangingEventArgsDetail(name, ref item); + if (item != null) + { + return item; + } + + return null; + } + + partial void SerializeCoreIgbActiveStepChangingEventArgsDetail(RendererSerializer ser); + + internal override void SerializeCore(RendererSerializer ser) + { + base.SerializeCore(ser); + + SerializeCoreIgbActiveStepChangingEventArgsDetail(ser); + + if (IsPropDirty("OldIndex")) + { ser.AddNumberProp("oldIndex", this._oldIndex); } + if (IsPropDirty("NewIndex")) + { ser.AddNumberProp("newIndex", this._newIndex); } + + } + + protected internal override void ToEventJson(BaseRendererControl control, Dictionary args) + { + base.ToEventJson(control, args); + + if (IsPropDirty("OldIndex")) + { args["oldIndex"] = (this._oldIndex).ToString(); } + if (IsPropDirty("NewIndex")) + { args["newIndex"] = (this._newIndex).ToString(); } + + } + + protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) + { + base.FromEventJson(control, args); + this.SuppressParentNotify = true; + + if (args.ContainsKey("oldIndex")) + { this.OldIndex = ReturnToDouble(args["oldIndex"]); } + if (args.ContainsKey("newIndex")) + { this.NewIndex = ReturnToDouble(args["newIndex"]); } + + this.SuppressParentNotify = false; + } + + } } diff --git a/src/components/Blazor/Avatar.cs b/src/components/Blazor/Avatar.cs index aa6278e6..16a64f3c 100644 --- a/src/components/Blazor/Avatar.cs +++ b/src/components/Blazor/Avatar.cs @@ -1,185 +1,192 @@ - -using System; using Microsoft.AspNetCore.Components; -using Microsoft.AspNetCore.Components.Rendering; -using System.Threading.Tasks; -using System.Collections.Generic; -using System.Linq; namespace IgniteUI.Blazor.Controls { - /// -/// An avatar component is used as a representation of a user identity -/// typically in a user profile. -/// -public partial class IgbAvatar: BaseRendererControl { - public override string Type { get { return "WebAvatar"; } } - - protected override void EnsureModulesLoaded() - { - if (!IgbAvatarModule.IsLoadRequested(IgBlazor)) - { - IgbAvatarModule.Register(IgBlazor); - } - } - - protected override string ResolveDisplay() - { - return "inline-block"; - } - - protected override bool SupportsVisualChildren - { - get - { - return true; - } - } - - protected override bool UseDirectRender - { - get - { - return true; - } - } - - protected override string DirectRenderElementName - { - get - { - return "igc-avatar"; - } - } - - protected override ControlEventBehavior DefaultEventBehavior - { - get { return ControlEventBehavior.Immediate; } - } - - public IgbAvatar(): base() { - OnCreatedIgbAvatar(); - - - } - - partial void OnCreatedIgbAvatar(); - - private string _src; - - partial void OnSrcChanging(ref string newValue); - /// - /// The image source to use. - /// - [Parameter] - public string Src - { - get { return this._src; } - set { - if (this._src != value || !IsPropDirty("Src")) { - MarkPropDirty("Src"); - } - this._src = value; - - } - } - private string _alt; - - partial void OnAltChanging(ref string newValue); - /// - /// Alternative text for the image. - /// - [Parameter] - public string Alt - { - get { return this._alt; } - set { - if (this._alt != value || !IsPropDirty("Alt")) { - MarkPropDirty("Alt"); - } - this._alt = value; - - } - } - private string _initials; - - partial void OnInitialsChanging(ref string newValue); - /// - /// Initials to use as a fallback when no image is available. - /// - [Parameter] - public string Initials - { - get { return this._initials; } - set { - if (this._initials != value || !IsPropDirty("Initials")) { - MarkPropDirty("Initials"); - } - this._initials = value; - - } - } - private AvatarShape _shape = AvatarShape.Square; - - partial void OnShapeChanging(ref AvatarShape newValue); - /// - /// The shape of the avatar. - /// - [Parameter] - public AvatarShape Shape - { - get { return this._shape; } - set { - if (this._shape != value || !IsPropDirty("Shape")) { - MarkPropDirty("Shape"); - } - this._shape = value; - - } - } - - partial void FindByNameAvatar(string name, ref object item); - public override object FindByName(string name) - { - - var baseResult = base.FindByName(name); - if (baseResult != null) - { - return baseResult; - } - - object item = null; - FindByNameAvatar(name, ref item); - if (item != null) - { - return item; - } - - return null; - } - public async Task SetNativeElementAsync(Object element) - { - await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); - } - public void SetNativeElement(Object element) - { - InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); - } - - partial void SerializeCoreIgbAvatar(RendererSerializer ser); - - internal override void SerializeCore(RendererSerializer ser) - { - base.SerializeCore(ser); - - SerializeCoreIgbAvatar(ser); - - if (IsPropDirty("Src")) { ser.AddStringProp("src", this._src); } - if (IsPropDirty("Alt")) { ser.AddStringProp("alt", this._alt); } - if (IsPropDirty("Initials")) { ser.AddStringProp("initials", this._initials); } - if (IsPropDirty("Shape")) { ser.AddEnumProp("shape", this._shape); } - - } - -} + /// + /// An avatar component is used as a representation of a user identity + /// typically in a user profile. + /// + public partial class IgbAvatar : BaseRendererControl + { + public override string Type { get { return "WebAvatar"; } } + + protected override void EnsureModulesLoaded() + { + if (!IgbAvatarModule.IsLoadRequested(IgBlazor)) + { + IgbAvatarModule.Register(IgBlazor); + } + } + + protected override string ResolveDisplay() + { + return "inline-block"; + } + + protected override bool SupportsVisualChildren + { + get + { + return true; + } + } + + protected override bool UseDirectRender + { + get + { + return true; + } + } + + protected override string DirectRenderElementName + { + get + { + return "igc-avatar"; + } + } + + protected override ControlEventBehavior DefaultEventBehavior + { + get { return ControlEventBehavior.Immediate; } + } + + public IgbAvatar() : base() + { + OnCreatedIgbAvatar(); + + } + + partial void OnCreatedIgbAvatar(); + + private string _src; + + partial void OnSrcChanging(ref string newValue); + /// + /// The image source to use. + /// + [Parameter] + public string Src + { + get { return this._src; } + set + { + if (this._src != value || !IsPropDirty("Src")) + { + MarkPropDirty("Src"); + } + this._src = value; + + } + } + private string _alt; + + partial void OnAltChanging(ref string newValue); + /// + /// Alternative text for the image. + /// + [Parameter] + public string Alt + { + get { return this._alt; } + set + { + if (this._alt != value || !IsPropDirty("Alt")) + { + MarkPropDirty("Alt"); + } + this._alt = value; + + } + } + private string _initials; + + partial void OnInitialsChanging(ref string newValue); + /// + /// Initials to use as a fallback when no image is available. + /// + [Parameter] + public string Initials + { + get { return this._initials; } + set + { + if (this._initials != value || !IsPropDirty("Initials")) + { + MarkPropDirty("Initials"); + } + this._initials = value; + + } + } + private AvatarShape _shape = AvatarShape.Square; + + partial void OnShapeChanging(ref AvatarShape newValue); + /// + /// The shape of the avatar. + /// + [Parameter] + public AvatarShape Shape + { + get { return this._shape; } + set + { + if (this._shape != value || !IsPropDirty("Shape")) + { + MarkPropDirty("Shape"); + } + this._shape = value; + + } + } + + partial void FindByNameAvatar(string name, ref object item); + public override object FindByName(string name) + { + + var baseResult = base.FindByName(name); + if (baseResult != null) + { + return baseResult; + } + + object item = null; + FindByNameAvatar(name, ref item); + if (item != null) + { + return item; + } + + return null; + } + public async Task SetNativeElementAsync(Object element) + { + await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + } + public void SetNativeElement(Object element) + { + InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + } + + partial void SerializeCoreIgbAvatar(RendererSerializer ser); + + internal override void SerializeCore(RendererSerializer ser) + { + base.SerializeCore(ser); + + SerializeCoreIgbAvatar(ser); + + if (IsPropDirty("Src")) + { ser.AddStringProp("src", this._src); } + if (IsPropDirty("Alt")) + { ser.AddStringProp("alt", this._alt); } + if (IsPropDirty("Initials")) + { ser.AddStringProp("initials", this._initials); } + if (IsPropDirty("Shape")) + { ser.AddEnumProp("shape", this._shape); } + + } + + } } diff --git a/src/components/Blazor/AvatarModule.cs b/src/components/Blazor/AvatarModule.cs index 3b3ed4a1..d55b13b0 100644 --- a/src/components/Blazor/AvatarModule.cs +++ b/src/components/Blazor/AvatarModule.cs @@ -1,23 +1,20 @@ -using System; -using System.Collections.Generic; -using System.Runtime.CompilerServices; -using System.Text; -using System.Collections.Generic; - namespace IgniteUI.Blazor.Controls { - public partial class IgbAvatarModule { - public static void Register(IIgniteUIBlazor runtime) { + public partial class IgbAvatarModule + { + public static void Register(IIgniteUIBlazor runtime) + { ModuleLoader.Load(runtime, "WebAvatarModule"); - } - public static void MarkIsLoadRequested(IIgniteUIBlazor runtime) { + public static void MarkIsLoadRequested(IIgniteUIBlazor runtime) + { ModuleLoader.MarkIsLoadRequested(runtime, "WebAvatarModule"); } - public static bool IsLoadRequested(IIgniteUIBlazor runtime) { + public static bool IsLoadRequested(IIgniteUIBlazor runtime) + { return ModuleLoader.IsLoadRequested(runtime, "WebAvatarModule"); } } diff --git a/src/components/Blazor/AvatarShape.cs b/src/components/Blazor/AvatarShape.cs index edaf7aab..cdbe3cf7 100644 --- a/src/components/Blazor/AvatarShape.cs +++ b/src/components/Blazor/AvatarShape.cs @@ -1,9 +1,10 @@ namespace IgniteUI.Blazor.Controls { -public enum AvatarShape { - Square, - Circle, - Rounded + public enum AvatarShape + { + Square, + Circle, + Rounded -} + } } diff --git a/src/components/Blazor/Badge.cs b/src/components/Blazor/Badge.cs index e04bb2dc..87a2e322 100644 --- a/src/components/Blazor/Badge.cs +++ b/src/components/Blazor/Badge.cs @@ -1,186 +1,193 @@ - -using System; using Microsoft.AspNetCore.Components; -using Microsoft.AspNetCore.Components.Rendering; -using System.Threading.Tasks; -using System.Collections.Generic; -using System.Linq; namespace IgniteUI.Blazor.Controls { - /// -/// The badge is a component indicating a status on a related item or an area -/// where some active indication is required. -/// -public partial class IgbBadge: BaseRendererControl { - public override string Type { get { return "WebBadge"; } } - - protected override void EnsureModulesLoaded() - { - if (!IgbBadgeModule.IsLoadRequested(IgBlazor)) - { - IgbBadgeModule.Register(IgBlazor); - } - } - - protected override string ResolveDisplay() - { - return "inline-block"; - } - - protected override bool SupportsVisualChildren - { - get - { - return true; - } - } - - protected override bool UseDirectRender - { - get - { - return true; - } - } - - protected override string DirectRenderElementName - { - get - { - return "igc-badge"; - } - } - - protected override ControlEventBehavior DefaultEventBehavior - { - get { return ControlEventBehavior.Immediate; } - } - - public IgbBadge(): base() { - OnCreatedIgbBadge(); - - - } - - partial void OnCreatedIgbBadge(); - - private StyleVariant _variant = StyleVariant.Primary; - - partial void OnVariantChanging(ref StyleVariant newValue); - /// - /// The type (style variant) of the badge. - /// - [Parameter] - public StyleVariant Variant - { - get { return this._variant; } - set { - if (this._variant != value || !IsPropDirty("Variant")) { - MarkPropDirty("Variant"); - } - this._variant = value; - - } - } - private bool _outlined = false; - - partial void OnOutlinedChanging(ref bool newValue); - /// - /// Sets whether to draw an outlined version of the badge. - /// - [Parameter] - public bool Outlined - { - get { return this._outlined; } - set { - if (this._outlined != value || !IsPropDirty("Outlined")) { - MarkPropDirty("Outlined"); - } - this._outlined = value; - - } - } - private BadgeShape _shape = BadgeShape.Rounded; - - partial void OnShapeChanging(ref BadgeShape newValue); - /// - /// The shape of the badge. - /// - [Parameter] - public BadgeShape Shape - { - get { return this._shape; } - set { - if (this._shape != value || !IsPropDirty("Shape")) { - MarkPropDirty("Shape"); - } - this._shape = value; - - } - } - private bool _dot = false; - - partial void OnDotChanging(ref bool newValue); - /// - /// Sets whether to render a dot type badge. - /// When enabled, the badge appears as a small dot without any content. - /// - [Parameter] - public bool Dot - { - get { return this._dot; } - set { - if (this._dot != value || !IsPropDirty("Dot")) { - MarkPropDirty("Dot"); - } - this._dot = value; - - } - } - - partial void FindByNameBadge(string name, ref object item); - public override object FindByName(string name) - { - - var baseResult = base.FindByName(name); - if (baseResult != null) - { - return baseResult; - } - - object item = null; - FindByNameBadge(name, ref item); - if (item != null) - { - return item; - } - - return null; - } - public async Task SetNativeElementAsync(Object element) - { - await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); - } - public void SetNativeElement(Object element) - { - InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); - } - - partial void SerializeCoreIgbBadge(RendererSerializer ser); - - internal override void SerializeCore(RendererSerializer ser) - { - base.SerializeCore(ser); - - SerializeCoreIgbBadge(ser); - - if (IsPropDirty("Variant")) { ser.AddEnumProp("variant", this._variant); } - if (IsPropDirty("Outlined")) { ser.AddBooleanProp("outlined", this._outlined); } - if (IsPropDirty("Shape")) { ser.AddEnumProp("shape", this._shape); } - if (IsPropDirty("Dot")) { ser.AddBooleanProp("dot", this._dot); } - - } - -} + /// + /// The badge is a component indicating a status on a related item or an area + /// where some active indication is required. + /// + public partial class IgbBadge : BaseRendererControl + { + public override string Type { get { return "WebBadge"; } } + + protected override void EnsureModulesLoaded() + { + if (!IgbBadgeModule.IsLoadRequested(IgBlazor)) + { + IgbBadgeModule.Register(IgBlazor); + } + } + + protected override string ResolveDisplay() + { + return "inline-block"; + } + + protected override bool SupportsVisualChildren + { + get + { + return true; + } + } + + protected override bool UseDirectRender + { + get + { + return true; + } + } + + protected override string DirectRenderElementName + { + get + { + return "igc-badge"; + } + } + + protected override ControlEventBehavior DefaultEventBehavior + { + get { return ControlEventBehavior.Immediate; } + } + + public IgbBadge() : base() + { + OnCreatedIgbBadge(); + + } + + partial void OnCreatedIgbBadge(); + + private StyleVariant _variant = StyleVariant.Primary; + + partial void OnVariantChanging(ref StyleVariant newValue); + /// + /// The type (style variant) of the badge. + /// + [Parameter] + public StyleVariant Variant + { + get { return this._variant; } + set + { + if (this._variant != value || !IsPropDirty("Variant")) + { + MarkPropDirty("Variant"); + } + this._variant = value; + + } + } + private bool _outlined = false; + + partial void OnOutlinedChanging(ref bool newValue); + /// + /// Sets whether to draw an outlined version of the badge. + /// + [Parameter] + public bool Outlined + { + get { return this._outlined; } + set + { + if (this._outlined != value || !IsPropDirty("Outlined")) + { + MarkPropDirty("Outlined"); + } + this._outlined = value; + + } + } + private BadgeShape _shape = BadgeShape.Rounded; + + partial void OnShapeChanging(ref BadgeShape newValue); + /// + /// The shape of the badge. + /// + [Parameter] + public BadgeShape Shape + { + get { return this._shape; } + set + { + if (this._shape != value || !IsPropDirty("Shape")) + { + MarkPropDirty("Shape"); + } + this._shape = value; + + } + } + private bool _dot = false; + + partial void OnDotChanging(ref bool newValue); + /// + /// Sets whether to render a dot type badge. + /// When enabled, the badge appears as a small dot without any content. + /// + [Parameter] + public bool Dot + { + get { return this._dot; } + set + { + if (this._dot != value || !IsPropDirty("Dot")) + { + MarkPropDirty("Dot"); + } + this._dot = value; + + } + } + + partial void FindByNameBadge(string name, ref object item); + public override object FindByName(string name) + { + + var baseResult = base.FindByName(name); + if (baseResult != null) + { + return baseResult; + } + + object item = null; + FindByNameBadge(name, ref item); + if (item != null) + { + return item; + } + + return null; + } + public async Task SetNativeElementAsync(Object element) + { + await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + } + public void SetNativeElement(Object element) + { + InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + } + + partial void SerializeCoreIgbBadge(RendererSerializer ser); + + internal override void SerializeCore(RendererSerializer ser) + { + base.SerializeCore(ser); + + SerializeCoreIgbBadge(ser); + + if (IsPropDirty("Variant")) + { ser.AddEnumProp("variant", this._variant); } + if (IsPropDirty("Outlined")) + { ser.AddBooleanProp("outlined", this._outlined); } + if (IsPropDirty("Shape")) + { ser.AddEnumProp("shape", this._shape); } + if (IsPropDirty("Dot")) + { ser.AddBooleanProp("dot", this._dot); } + + } + + } } diff --git a/src/components/Blazor/BadgeModule.cs b/src/components/Blazor/BadgeModule.cs index 5f5ce42e..fcb0038c 100644 --- a/src/components/Blazor/BadgeModule.cs +++ b/src/components/Blazor/BadgeModule.cs @@ -1,23 +1,20 @@ -using System; -using System.Collections.Generic; -using System.Runtime.CompilerServices; -using System.Text; -using System.Collections.Generic; - namespace IgniteUI.Blazor.Controls { - public partial class IgbBadgeModule { - public static void Register(IIgniteUIBlazor runtime) { + public partial class IgbBadgeModule + { + public static void Register(IIgniteUIBlazor runtime) + { ModuleLoader.Load(runtime, "WebBadgeModule"); - } - public static void MarkIsLoadRequested(IIgniteUIBlazor runtime) { + public static void MarkIsLoadRequested(IIgniteUIBlazor runtime) + { ModuleLoader.MarkIsLoadRequested(runtime, "WebBadgeModule"); } - public static bool IsLoadRequested(IIgniteUIBlazor runtime) { + public static bool IsLoadRequested(IIgniteUIBlazor runtime) + { return ModuleLoader.IsLoadRequested(runtime, "WebBadgeModule"); } } diff --git a/src/components/Blazor/BadgeShape.cs b/src/components/Blazor/BadgeShape.cs index 5446ebe8..a299183c 100644 --- a/src/components/Blazor/BadgeShape.cs +++ b/src/components/Blazor/BadgeShape.cs @@ -1,8 +1,9 @@ namespace IgniteUI.Blazor.Controls { -public enum BadgeShape { - Rounded, - Square + public enum BadgeShape + { + Rounded, + Square -} + } } diff --git a/src/components/Blazor/Banner.cs b/src/components/Blazor/Banner.cs index 7f8b18a5..f73999cc 100644 --- a/src/components/Blazor/Banner.cs +++ b/src/components/Blazor/Banner.cs @@ -1,295 +1,305 @@ - -using System; using Microsoft.AspNetCore.Components; -using Microsoft.AspNetCore.Components.Rendering; -using System.Threading.Tasks; -using System.Collections.Generic; -using System.Linq; namespace IgniteUI.Blazor.Controls { - public partial class IgbBanner: BaseRendererControl { - public override string Type { get { return "WebBanner"; } } + public partial class IgbBanner : BaseRendererControl + { + public override string Type { get { return "WebBanner"; } } + + protected override void EnsureModulesLoaded() + { + if (!IgbBannerModule.IsLoadRequested(IgBlazor)) + { + IgbBannerModule.Register(IgBlazor); + } + } + + protected override string ResolveDisplay() + { + return "inline-block"; + } + + protected override bool SupportsVisualChildren + { + get + { + return true; + } + } + + protected override bool UseDirectRender + { + get + { + return true; + } + } + + protected override string DirectRenderElementName + { + get + { + return "igc-banner"; + } + } + + protected override ControlEventBehavior DefaultEventBehavior + { + get { return ControlEventBehavior.Immediate; } + } + + public IgbBanner() : base() + { + OnCreatedIgbBanner(); + + } + + partial void OnCreatedIgbBanner(); + + private bool _open = false; + + partial void OnOpenChanging(ref bool newValue); + /// + /// Whether the banner is open. + /// Setting this property programmatically will immediately show or hide the + /// banner without animation and without emitting close events. + /// Prefer the `show()`, `hide()`, and `toggle()` methods for animated + /// transitions. + /// + [Parameter] + public bool Open + { + get { return this._open; } + set + { + if (this._open != value || !IsPropDirty("Open")) + { + MarkPropDirty("Open"); + } + this._open = value; + + } + } - protected override void EnsureModulesLoaded() - { - if (!IgbBannerModule.IsLoadRequested(IgBlazor)) - { - IgbBannerModule.Register(IgBlazor); - } - } + partial void FindByNameBanner(string name, ref object item); + public override object FindByName(string name) + { - protected override string ResolveDisplay() + var baseResult = base.FindByName(name); + if (baseResult != null) + { + return baseResult; + } + + object item = null; + FindByNameBanner(name, ref item); + if (item != null) + { + return item; + } + + return null; + } + public async Task SetNativeElementAsync(Object element) + { + await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + } + public void SetNativeElement(Object element) + { + InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + } + /// + /// Opens the banner with an animated grow-in transition. + /// Returns `true` when the banner was successfully opened, or `false` if + /// it was already open. + /// + public async Task ShowAsync() + { + var iv = await InvokeMethod("show", new object[] { }, new string[] { }); + return ReturnToBoolean(iv); + } + public bool Show() + { + var iv = InvokeMethodSync("show", new object[] { }, new string[] { }); + return ReturnToBoolean(iv); + } + /// + /// Closes the banner with an animated grow-out transition. + /// Returns `true` when the banner was successfully closed, or `false` if + /// it was already closed. + /// + public async Task HideAsync() + { + var iv = await InvokeMethod("hide", new object[] { }, new string[] { }); + return ReturnToBoolean(iv); + } + public bool Hide() + { + var iv = InvokeMethodSync("hide", new object[] { }, new string[] { }); + return ReturnToBoolean(iv); + } + /// + /// Toggles the banner open or closed depending on its current state. + /// Equivalent to calling `show()` when closed and `hide()` when open. + /// Returns `true` when the transition completed successfully. + /// + public async Task ToggleAsync() + { + var iv = await InvokeMethod("toggle", new object[] { }, new string[] { }); + return ReturnToBoolean(iv); + } + public bool Toggle() + { + var iv = InvokeMethodSync("toggle", new object[] { }, new string[] { }); + return ReturnToBoolean(iv); + } + + private string _closingRef = null; + private string _closingScript = null; + [Parameter] + public string ClosingScript + { + + set + { + if (value != this._closingScript) + { + this._closingScript = value; + this.OnRefChanged("Closing", null, value, true, false, (string refName, object oldValue, object newValue) => + { + this._closingRef = refName; + this.MarkPropDirty("ClosingRef"); + }); + } + } + get + { + return this._closingScript; + } + } + + partial void OnHandlingClosing(IgbVoidEventArgs args); + private EventCallback? _closing = null; + [Parameter] + public EventCallback Closing + { + get + { + return this._closing != null ? this._closing.Value : EventCallback.Empty; + } + set + { + if (!value.Equals(EventCallback.Empty)) + { + if (!CompareEventCallbacks(value, _closing, ref eventCallbacksCache)) + { + _closing = value; + this.SetHandler(this.Name, "Closing", value, (args) => { - return "inline-block"; - } + OnHandlingClosing(args); - protected override bool SupportsVisualChildren + }); + this.OnRefChanged("Closing", null, "event:::Closing", true, false, (refName, oldValue, newValue) => { - get - { - return true; - } - } + this._closingRef = refName; + this.MarkPropDirty("ClosingRef"); + }); + } + } + else + { + _closing = null; + this.SetHandler(this.Name, "Closing", null); + this.OnRefChanged("Closing", null, null, true, false, (refName, oldValue, newValue) => + { + this._closingRef = null; + this.MarkPropDirty("ClosingRef"); + }); + } + } + } + + private string _closedRef = null; + private string _closedScript = null; + [Parameter] + public string ClosedScript + { + + set + { + if (value != this._closedScript) + { + this._closedScript = value; + this.OnRefChanged("Closed", null, value, true, false, (string refName, object oldValue, object newValue) => + { + this._closedRef = refName; + this.MarkPropDirty("ClosedRef"); + }); + } + } + get + { + return this._closedScript; + } + } - protected override bool UseDirectRender + partial void OnHandlingClosed(IgbVoidEventArgs args); + private EventCallback? _closed = null; + [Parameter] + public EventCallback Closed + { + get + { + return this._closed != null ? this._closed.Value : EventCallback.Empty; + } + set + { + if (!value.Equals(EventCallback.Empty)) + { + if (!CompareEventCallbacks(value, _closed, ref eventCallbacksCache)) + { + _closed = value; + this.SetHandler(this.Name, "Closed", value, (args) => { - get - { - return true; - } - } + OnHandlingClosed(args); - protected override string DirectRenderElementName + }); + this.OnRefChanged("Closed", null, "event:::Closed", true, false, (refName, oldValue, newValue) => { - get - { - return "igc-banner"; - } - } + this._closedRef = refName; + this.MarkPropDirty("ClosedRef"); + }); + } + } + else + { + _closed = null; + this.SetHandler(this.Name, "Closed", null); + this.OnRefChanged("Closed", null, null, true, false, (refName, oldValue, newValue) => + { + this._closedRef = null; + this.MarkPropDirty("ClosedRef"); + }); + } + } + } - protected override ControlEventBehavior DefaultEventBehavior - { - get { return ControlEventBehavior.Immediate; } - } - - public IgbBanner(): base() { - OnCreatedIgbBanner(); - - - } - - partial void OnCreatedIgbBanner(); - - private bool _open = false; - - partial void OnOpenChanging(ref bool newValue); - /// - /// Whether the banner is open. - /// Setting this property programmatically will immediately show or hide the - /// banner without animation and without emitting close events. - /// Prefer the `show()`, `hide()`, and `toggle()` methods for animated - /// transitions. - /// - [Parameter] - public bool Open - { - get { return this._open; } - set { - if (this._open != value || !IsPropDirty("Open")) { - MarkPropDirty("Open"); - } - this._open = value; - - } - } - - partial void FindByNameBanner(string name, ref object item); - public override object FindByName(string name) - { - - var baseResult = base.FindByName(name); - if (baseResult != null) - { - return baseResult; - } - - object item = null; - FindByNameBanner(name, ref item); - if (item != null) - { - return item; - } - - return null; - } - public async Task SetNativeElementAsync(Object element) - { - await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); - } - public void SetNativeElement(Object element) - { - InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); - } - /// - /// Opens the banner with an animated grow-in transition. - /// Returns `true` when the banner was successfully opened, or `false` if - /// it was already open. - /// - public async Task ShowAsync() - { - var iv = await InvokeMethod("show", new object[] { }, new string[] { }); - return ReturnToBoolean(iv); - } - public bool Show() - { - var iv = InvokeMethodSync("show", new object[] { }, new string[] { }); - return ReturnToBoolean(iv); - } - /// - /// Closes the banner with an animated grow-out transition. - /// Returns `true` when the banner was successfully closed, or `false` if - /// it was already closed. - /// - public async Task HideAsync() - { - var iv = await InvokeMethod("hide", new object[] { }, new string[] { }); - return ReturnToBoolean(iv); - } - public bool Hide() - { - var iv = InvokeMethodSync("hide", new object[] { }, new string[] { }); - return ReturnToBoolean(iv); - } - /// - /// Toggles the banner open or closed depending on its current state. - /// Equivalent to calling `show()` when closed and `hide()` when open. - /// Returns `true` when the transition completed successfully. - /// - public async Task ToggleAsync() - { - var iv = await InvokeMethod("toggle", new object[] { }, new string[] { }); - return ReturnToBoolean(iv); - } - public bool Toggle() - { - var iv = InvokeMethodSync("toggle", new object[] { }, new string[] { }); - return ReturnToBoolean(iv); - } - - private string _closingRef = null; - private string _closingScript = null; - [Parameter] - public string ClosingScript { - - set - { - if (value != this._closingScript) - { - this._closingScript = value; - this.OnRefChanged("Closing", null, value, true, false, (string refName, object oldValue, object newValue) => { - this._closingRef = refName; - this.MarkPropDirty("ClosingRef"); - }); - } - } - get - { - return this._closingScript; - } - } - - partial void OnHandlingClosing(IgbVoidEventArgs args); - private EventCallback? _closing = null; - [Parameter] - public EventCallback Closing - { - get - { - return this._closing != null ? this._closing.Value : EventCallback.Empty; - } - set - { - if (!value.Equals(EventCallback.Empty)) - { - if (!CompareEventCallbacks(value, _closing, ref eventCallbacksCache)) - { - _closing = value; - this.SetHandler(this.Name, "Closing", value, (args) => { - OnHandlingClosing(args); - - }); - this.OnRefChanged("Closing", null, "event:::Closing", true, false, (refName, oldValue, newValue) => { - this._closingRef = refName; - this.MarkPropDirty("ClosingRef"); - }); - } - } - else - { - _closing = null; - this.SetHandler(this.Name, "Closing", null); - this.OnRefChanged("Closing", null, null, true, false, (refName, oldValue, newValue) => { - this._closingRef = null; - this.MarkPropDirty("ClosingRef"); - }); - } - } - } - - private string _closedRef = null; - private string _closedScript = null; - [Parameter] - public string ClosedScript { - - set - { - if (value != this._closedScript) - { - this._closedScript = value; - this.OnRefChanged("Closed", null, value, true, false, (string refName, object oldValue, object newValue) => { - this._closedRef = refName; - this.MarkPropDirty("ClosedRef"); - }); - } - } - get - { - return this._closedScript; - } - } - - partial void OnHandlingClosed(IgbVoidEventArgs args); - private EventCallback? _closed = null; - [Parameter] - public EventCallback Closed - { - get - { - return this._closed != null ? this._closed.Value : EventCallback.Empty; - } - set - { - if (!value.Equals(EventCallback.Empty)) - { - if (!CompareEventCallbacks(value, _closed, ref eventCallbacksCache)) - { - _closed = value; - this.SetHandler(this.Name, "Closed", value, (args) => { - OnHandlingClosed(args); - - }); - this.OnRefChanged("Closed", null, "event:::Closed", true, false, (refName, oldValue, newValue) => { - this._closedRef = refName; - this.MarkPropDirty("ClosedRef"); - }); - } - } - else - { - _closed = null; - this.SetHandler(this.Name, "Closed", null); - this.OnRefChanged("Closed", null, null, true, false, (refName, oldValue, newValue) => { - this._closedRef = null; - this.MarkPropDirty("ClosedRef"); - }); - } - } - } - - partial void SerializeCoreIgbBanner(RendererSerializer ser); - - internal override void SerializeCore(RendererSerializer ser) - { - base.SerializeCore(ser); - - SerializeCoreIgbBanner(ser); - - if (IsPropDirty("Open")) { ser.AddBooleanProp("open", this._open); } - if (IsPropDirty("ClosingRef")) { ser.AddStringProp("closingRef", this._closingRef); } - if (IsPropDirty("ClosedRef")) { ser.AddStringProp("closedRef", this._closedRef); } - - } - -} + partial void SerializeCoreIgbBanner(RendererSerializer ser); + + internal override void SerializeCore(RendererSerializer ser) + { + base.SerializeCore(ser); + + SerializeCoreIgbBanner(ser); + + if (IsPropDirty("Open")) + { ser.AddBooleanProp("open", this._open); } + if (IsPropDirty("ClosingRef")) + { ser.AddStringProp("closingRef", this._closingRef); } + if (IsPropDirty("ClosedRef")) + { ser.AddStringProp("closedRef", this._closedRef); } + + } + + } } diff --git a/src/components/Blazor/BannerModule.cs b/src/components/Blazor/BannerModule.cs index a18917a9..57040c06 100644 --- a/src/components/Blazor/BannerModule.cs +++ b/src/components/Blazor/BannerModule.cs @@ -1,23 +1,20 @@ -using System; -using System.Collections.Generic; -using System.Runtime.CompilerServices; -using System.Text; -using System.Collections.Generic; - namespace IgniteUI.Blazor.Controls { - public partial class IgbBannerModule { - public static void Register(IIgniteUIBlazor runtime) { + public partial class IgbBannerModule + { + public static void Register(IIgniteUIBlazor runtime) + { ModuleLoader.Load(runtime, "WebBannerModule"); - } - public static void MarkIsLoadRequested(IIgniteUIBlazor runtime) { + public static void MarkIsLoadRequested(IIgniteUIBlazor runtime) + { ModuleLoader.MarkIsLoadRequested(runtime, "WebBannerModule"); } - public static bool IsLoadRequested(IIgniteUIBlazor runtime) { + public static bool IsLoadRequested(IIgniteUIBlazor runtime) + { return ModuleLoader.IsLoadRequested(runtime, "WebBannerModule"); } } diff --git a/src/components/Blazor/BaseAlertLike.cs b/src/components/Blazor/BaseAlertLike.cs index 2161d7c3..90ddc3ab 100644 --- a/src/components/Blazor/BaseAlertLike.cs +++ b/src/components/Blazor/BaseAlertLike.cs @@ -1,250 +1,260 @@ - -using System; using Microsoft.AspNetCore.Components; -using Microsoft.AspNetCore.Components.Rendering; -using System.Threading.Tasks; -using System.Collections.Generic; -using System.Linq; namespace IgniteUI.Blazor.Controls { - public partial class IgbBaseAlertLike: BaseRendererControl { - public override string Type { get { return "WebBaseAlertLike"; } } - - protected override string ResolveDisplay() - { - return "inline-block"; - } - - protected override bool SupportsVisualChildren - { - get - { - return true; - } - } - - protected override bool UseDirectRender - { - get - { - return true; - } - } - - protected override string DirectRenderElementName - { - get - { - return "igc-base-alert-like"; - } - } - - protected override ControlEventBehavior DefaultEventBehavior - { - get { return ControlEventBehavior.Immediate; } - } - - public IgbBaseAlertLike(): base() { - OnCreatedIgbBaseAlertLike(); - - - } - - partial void OnCreatedIgbBaseAlertLike(); - - private bool _open = false; - - partial void OnOpenChanging(ref bool newValue); - /// - /// Whether the component is in shown state. - /// - [Parameter] - public bool Open - { - get { return this._open; } - set { - if (this._open != value || !IsPropDirty("Open")) { - MarkPropDirty("Open"); - } - this._open = value; - - } - } - private double _displayTime = 0; - - partial void OnDisplayTimeChanging(ref double newValue); - /// - /// Determines the duration in milliseconds in which the component will be visible. - /// - [Parameter] - public double DisplayTime - { - get { return this._displayTime; } - set { - if (this._displayTime != value || !IsPropDirty("DisplayTime")) { - MarkPropDirty("DisplayTime"); - } - this._displayTime = value; - - } - } - private bool _keepOpen = false; - - partial void OnKeepOpenChanging(ref bool newValue); - /// - /// Determines whether the component should close after the `displayTime` is over. - /// - [Parameter] - public bool KeepOpen - { - get { return this._keepOpen; } - set { - if (this._keepOpen != value || !IsPropDirty("KeepOpen")) { - MarkPropDirty("KeepOpen"); - } - this._keepOpen = value; - - } - } - private AbsolutePosition _position = AbsolutePosition.Bottom; - - partial void OnPositionChanging(ref AbsolutePosition newValue); - /// - /// Sets the position of the component in the viewport. - /// `bottom` - positions the component at the bottom. This is the default. - /// `middle` - positions the component at the center. - /// `top` - positions the component at the top. - /// - [Parameter] - public AbsolutePosition Position - { - get { return this._position; } - set { - if (this._position != value || !IsPropDirty("Position")) { - MarkPropDirty("Position"); - } - this._position = value; - - } - } - private NotificationPositioning _positioning = NotificationPositioning.Viewport; - - partial void OnPositioningChanging(ref NotificationPositioning newValue); - /// - /// Sets the positioning strategy of the component. - /// `viewport` - positions the component relative to the viewport, ignoring any ancestor elements. This is the default behavior. - /// `container` - positions the component relative to the nearest visible ancestor. In this mode, the component will be constrained within the bounding box of the ancestor and will be positioned according to the `position` attribute. - /// - [Parameter] - public NotificationPositioning Positioning - { - get { return this._positioning; } - set { - if (this._positioning != value || !IsPropDirty("Positioning")) { - MarkPropDirty("Positioning"); - } - this._positioning = value; - - } - } - - partial void FindByNameBaseAlertLike(string name, ref object item); - public override object FindByName(string name) - { - - var baseResult = base.FindByName(name); - if (baseResult != null) - { - return baseResult; - } - - object item = null; - FindByNameBaseAlertLike(name, ref item); - if (item != null) - { - return item; - } - - return null; - } - public async Task SetNativeElementAsync(Object element) - { - await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); - } - public void SetNativeElement(Object element) - { - InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); - } - public async Task ConnectedCallbackAsync() - { - await InvokeMethod("connectedCallback", new object[] { }, new string[] { }); - } - public void ConnectedCallback() - { - InvokeMethodSync("connectedCallback", new object[] { }, new string[] { }); - } - /// - /// Opens the component. - /// Returns a promise that resolves to `true` if the component was successfully opened, or `false` - /// if it was already open or could not be shown (e.g., in `container` positioning mode with no visible ancestors). - /// - public async Task ShowAsync() - { - var iv = await InvokeMethod("show", new object[] { }, new string[] { }); - return ReturnToBoolean(iv); - } - public bool Show() - { - var iv = InvokeMethodSync("show", new object[] { }, new string[] { }); - return ReturnToBoolean(iv); - } - /// - /// Closes the component. - /// Returns a promise that resolves to `true` if the component was successfully closed, or `false` - /// if it was already closed. - /// - public async Task HideAsync() - { - var iv = await InvokeMethod("hide", new object[] { }, new string[] { }); - return ReturnToBoolean(iv); - } - public bool Hide() - { - var iv = InvokeMethodSync("hide", new object[] { }, new string[] { }); - return ReturnToBoolean(iv); - } - /// - /// Toggles the open state of the component. - /// Returns a promise that resolves to `true` if the operation completed successfully, or `false` - /// if it was already in the desired state. - /// - public async Task ToggleAsync() - { - var iv = await InvokeMethod("toggle", new object[] { }, new string[] { }); - return ReturnToBoolean(iv); - } - public bool Toggle() - { - var iv = InvokeMethodSync("toggle", new object[] { }, new string[] { }); - return ReturnToBoolean(iv); - } - - partial void SerializeCoreIgbBaseAlertLike(RendererSerializer ser); - - internal override void SerializeCore(RendererSerializer ser) - { - base.SerializeCore(ser); - - SerializeCoreIgbBaseAlertLike(ser); - - if (IsPropDirty("Open")) { ser.AddBooleanProp("open", this._open); } - if (IsPropDirty("DisplayTime")) { ser.AddNumberProp("displayTime", this._displayTime); } - if (IsPropDirty("KeepOpen")) { ser.AddBooleanProp("keepOpen", this._keepOpen); } - if (IsPropDirty("Position")) { ser.AddEnumProp("position", this._position); } - if (IsPropDirty("Positioning")) { ser.AddEnumProp("positioning", this._positioning); } - - } - -} + public partial class IgbBaseAlertLike : BaseRendererControl + { + public override string Type { get { return "WebBaseAlertLike"; } } + + protected override string ResolveDisplay() + { + return "inline-block"; + } + + protected override bool SupportsVisualChildren + { + get + { + return true; + } + } + + protected override bool UseDirectRender + { + get + { + return true; + } + } + + protected override string DirectRenderElementName + { + get + { + return "igc-base-alert-like"; + } + } + + protected override ControlEventBehavior DefaultEventBehavior + { + get { return ControlEventBehavior.Immediate; } + } + + public IgbBaseAlertLike() : base() + { + OnCreatedIgbBaseAlertLike(); + + } + + partial void OnCreatedIgbBaseAlertLike(); + + private bool _open = false; + + partial void OnOpenChanging(ref bool newValue); + /// + /// Whether the component is in shown state. + /// + [Parameter] + public bool Open + { + get { return this._open; } + set + { + if (this._open != value || !IsPropDirty("Open")) + { + MarkPropDirty("Open"); + } + this._open = value; + + } + } + private double _displayTime = 0; + + partial void OnDisplayTimeChanging(ref double newValue); + /// + /// Determines the duration in milliseconds in which the component will be visible. + /// + [Parameter] + public double DisplayTime + { + get { return this._displayTime; } + set + { + if (this._displayTime != value || !IsPropDirty("DisplayTime")) + { + MarkPropDirty("DisplayTime"); + } + this._displayTime = value; + + } + } + private bool _keepOpen = false; + + partial void OnKeepOpenChanging(ref bool newValue); + /// + /// Determines whether the component should close after the `displayTime` is over. + /// + [Parameter] + public bool KeepOpen + { + get { return this._keepOpen; } + set + { + if (this._keepOpen != value || !IsPropDirty("KeepOpen")) + { + MarkPropDirty("KeepOpen"); + } + this._keepOpen = value; + + } + } + private AbsolutePosition _position = AbsolutePosition.Bottom; + + partial void OnPositionChanging(ref AbsolutePosition newValue); + /// + /// Sets the position of the component in the viewport. + /// `bottom` - positions the component at the bottom. This is the default. + /// `middle` - positions the component at the center. + /// `top` - positions the component at the top. + /// + [Parameter] + public AbsolutePosition Position + { + get { return this._position; } + set + { + if (this._position != value || !IsPropDirty("Position")) + { + MarkPropDirty("Position"); + } + this._position = value; + + } + } + private NotificationPositioning _positioning = NotificationPositioning.Viewport; + + partial void OnPositioningChanging(ref NotificationPositioning newValue); + /// + /// Sets the positioning strategy of the component. + /// `viewport` - positions the component relative to the viewport, ignoring any ancestor elements. This is the default behavior. + /// `container` - positions the component relative to the nearest visible ancestor. In this mode, the component will be constrained within the bounding box of the ancestor and will be positioned according to the `position` attribute. + /// + [Parameter] + public NotificationPositioning Positioning + { + get { return this._positioning; } + set + { + if (this._positioning != value || !IsPropDirty("Positioning")) + { + MarkPropDirty("Positioning"); + } + this._positioning = value; + + } + } + + partial void FindByNameBaseAlertLike(string name, ref object item); + public override object FindByName(string name) + { + + var baseResult = base.FindByName(name); + if (baseResult != null) + { + return baseResult; + } + + object item = null; + FindByNameBaseAlertLike(name, ref item); + if (item != null) + { + return item; + } + + return null; + } + public async Task SetNativeElementAsync(Object element) + { + await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + } + public void SetNativeElement(Object element) + { + InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + } + public async Task ConnectedCallbackAsync() + { + await InvokeMethod("connectedCallback", new object[] { }, new string[] { }); + } + public void ConnectedCallback() + { + InvokeMethodSync("connectedCallback", new object[] { }, new string[] { }); + } + /// + /// Opens the component. + /// Returns a promise that resolves to `true` if the component was successfully opened, or `false` + /// if it was already open or could not be shown (e.g., in `container` positioning mode with no visible ancestors). + /// + public async Task ShowAsync() + { + var iv = await InvokeMethod("show", new object[] { }, new string[] { }); + return ReturnToBoolean(iv); + } + public bool Show() + { + var iv = InvokeMethodSync("show", new object[] { }, new string[] { }); + return ReturnToBoolean(iv); + } + /// + /// Closes the component. + /// Returns a promise that resolves to `true` if the component was successfully closed, or `false` + /// if it was already closed. + /// + public async Task HideAsync() + { + var iv = await InvokeMethod("hide", new object[] { }, new string[] { }); + return ReturnToBoolean(iv); + } + public bool Hide() + { + var iv = InvokeMethodSync("hide", new object[] { }, new string[] { }); + return ReturnToBoolean(iv); + } + /// + /// Toggles the open state of the component. + /// Returns a promise that resolves to `true` if the operation completed successfully, or `false` + /// if it was already in the desired state. + /// + public async Task ToggleAsync() + { + var iv = await InvokeMethod("toggle", new object[] { }, new string[] { }); + return ReturnToBoolean(iv); + } + public bool Toggle() + { + var iv = InvokeMethodSync("toggle", new object[] { }, new string[] { }); + return ReturnToBoolean(iv); + } + + partial void SerializeCoreIgbBaseAlertLike(RendererSerializer ser); + + internal override void SerializeCore(RendererSerializer ser) + { + base.SerializeCore(ser); + + SerializeCoreIgbBaseAlertLike(ser); + + if (IsPropDirty("Open")) + { ser.AddBooleanProp("open", this._open); } + if (IsPropDirty("DisplayTime")) + { ser.AddNumberProp("displayTime", this._displayTime); } + if (IsPropDirty("KeepOpen")) + { ser.AddBooleanProp("keepOpen", this._keepOpen); } + if (IsPropDirty("Position")) + { ser.AddEnumProp("position", this._position); } + if (IsPropDirty("Positioning")) + { ser.AddEnumProp("positioning", this._positioning); } + + } + + } } diff --git a/src/components/Blazor/BaseComboBox.cs b/src/components/Blazor/BaseComboBox.cs index 53488ce5..5d51fb31 100644 --- a/src/components/Blazor/BaseComboBox.cs +++ b/src/components/Blazor/BaseComboBox.cs @@ -1,131 +1,129 @@ - -using System; using Microsoft.AspNetCore.Components; -using Microsoft.AspNetCore.Components.Rendering; -using System.Threading.Tasks; -using System.Collections.Generic; -using System.Linq; namespace IgniteUI.Blazor.Controls { - public partial class IgbBaseComboBox: BaseRendererControl { - public override string Type { get { return "WebBaseComboBox"; } } - - protected override string ResolveDisplay() - { - return "inline-block"; - } - - protected override ControlEventBehavior DefaultEventBehavior - { - get { return ControlEventBehavior.Queued; } - } - - public IgbBaseComboBox(): base() { - OnCreatedIgbBaseComboBox(); - - - } - - partial void OnCreatedIgbBaseComboBox(); - - private bool _open = false; - - partial void OnOpenChanging(ref bool newValue); - /// - /// Sets the open state of the component. - /// - [Parameter] - public bool Open - { - get { return this._open; } - set { - if (this._open != value || !IsPropDirty("Open")) { - MarkPropDirty("Open"); - } - this._open = value; - - } - } - - partial void FindByNameBaseComboBox(string name, ref object item); - public override object FindByName(string name) - { - - var baseResult = base.FindByName(name); - if (baseResult != null) - { - return baseResult; - } - - object item = null; - FindByNameBaseComboBox(name, ref item); - if (item != null) - { - return item; - } - - return null; - } - public async Task SetNativeElementAsync(Object element) - { - await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); - } - public void SetNativeElement(Object element) - { - InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); - } - /// - /// Shows the component. - /// - public async Task ShowAsync() - { - var iv = await InvokeMethod("show", new object[] { }, new string[] { }); - return ReturnToBoolean(iv); - } - public bool Show() - { - var iv = InvokeMethodSync("show", new object[] { }, new string[] { }); - return ReturnToBoolean(iv); - } - /// - /// Hides the component. - /// - public async Task HideAsync() - { - var iv = await InvokeMethod("hide", new object[] { }, new string[] { }); - return ReturnToBoolean(iv); - } - public bool Hide() - { - var iv = InvokeMethodSync("hide", new object[] { }, new string[] { }); - return ReturnToBoolean(iv); - } - /// - /// Toggles the open state of the component. - /// - public async Task ToggleAsync() - { - var iv = await InvokeMethod("toggle", new object[] { }, new string[] { }); - return ReturnToBoolean(iv); - } - public bool Toggle() - { - var iv = InvokeMethodSync("toggle", new object[] { }, new string[] { }); - return ReturnToBoolean(iv); - } - - partial void SerializeCoreIgbBaseComboBox(RendererSerializer ser); - - internal override void SerializeCore(RendererSerializer ser) - { - base.SerializeCore(ser); - - SerializeCoreIgbBaseComboBox(ser); - - if (IsPropDirty("Open")) { ser.AddBooleanProp("open", this._open); } - - } - -} + public partial class IgbBaseComboBox : BaseRendererControl + { + public override string Type { get { return "WebBaseComboBox"; } } + + protected override string ResolveDisplay() + { + return "inline-block"; + } + + protected override ControlEventBehavior DefaultEventBehavior + { + get { return ControlEventBehavior.Queued; } + } + + public IgbBaseComboBox() : base() + { + OnCreatedIgbBaseComboBox(); + + } + + partial void OnCreatedIgbBaseComboBox(); + + private bool _open = false; + + partial void OnOpenChanging(ref bool newValue); + /// + /// Sets the open state of the component. + /// + [Parameter] + public bool Open + { + get { return this._open; } + set + { + if (this._open != value || !IsPropDirty("Open")) + { + MarkPropDirty("Open"); + } + this._open = value; + + } + } + + partial void FindByNameBaseComboBox(string name, ref object item); + public override object FindByName(string name) + { + + var baseResult = base.FindByName(name); + if (baseResult != null) + { + return baseResult; + } + + object item = null; + FindByNameBaseComboBox(name, ref item); + if (item != null) + { + return item; + } + + return null; + } + public async Task SetNativeElementAsync(Object element) + { + await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + } + public void SetNativeElement(Object element) + { + InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + } + /// + /// Shows the component. + /// + public async Task ShowAsync() + { + var iv = await InvokeMethod("show", new object[] { }, new string[] { }); + return ReturnToBoolean(iv); + } + public bool Show() + { + var iv = InvokeMethodSync("show", new object[] { }, new string[] { }); + return ReturnToBoolean(iv); + } + /// + /// Hides the component. + /// + public async Task HideAsync() + { + var iv = await InvokeMethod("hide", new object[] { }, new string[] { }); + return ReturnToBoolean(iv); + } + public bool Hide() + { + var iv = InvokeMethodSync("hide", new object[] { }, new string[] { }); + return ReturnToBoolean(iv); + } + /// + /// Toggles the open state of the component. + /// + public async Task ToggleAsync() + { + var iv = await InvokeMethod("toggle", new object[] { }, new string[] { }); + return ReturnToBoolean(iv); + } + public bool Toggle() + { + var iv = InvokeMethodSync("toggle", new object[] { }, new string[] { }); + return ReturnToBoolean(iv); + } + + partial void SerializeCoreIgbBaseComboBox(RendererSerializer ser); + + internal override void SerializeCore(RendererSerializer ser) + { + base.SerializeCore(ser); + + SerializeCoreIgbBaseComboBox(ser); + + if (IsPropDirty("Open")) + { ser.AddBooleanProp("open", this._open); } + + } + + } } diff --git a/src/components/Blazor/BaseOptionLike.cs b/src/components/Blazor/BaseOptionLike.cs index dc096f59..5f3ce2ed 100644 --- a/src/components/Blazor/BaseOptionLike.cs +++ b/src/components/Blazor/BaseOptionLike.cs @@ -1,174 +1,181 @@ - -using System; using Microsoft.AspNetCore.Components; -using Microsoft.AspNetCore.Components.Rendering; -using System.Threading.Tasks; -using System.Collections.Generic; -using System.Linq; namespace IgniteUI.Blazor.Controls { - public partial class IgbBaseOptionLike: BaseRendererControl { - public override string Type { get { return "WebBaseOptionLike"; } } - - protected override string ResolveDisplay() - { - return "inline-block"; - } - - protected override bool SupportsVisualChildren - { - get - { - return true; - } - } - - protected override bool UseDirectRender - { - get - { - return true; - } - } - - protected override string DirectRenderElementName - { - get - { - return "igc-base-option-like"; - } - } - - protected override ControlEventBehavior DefaultEventBehavior - { - get { return ControlEventBehavior.Immediate; } - } - - public IgbBaseOptionLike(): base() { - OnCreatedIgbBaseOptionLike(); - - - } - - partial void OnCreatedIgbBaseOptionLike(); - - private bool _active = false; - - partial void OnActiveChanging(ref bool newValue); - /// - /// Whether the item is active. - /// - [Parameter] - public bool Active - { - get { return this._active; } - set { - if (this._active != value || !IsPropDirty("Active")) { - MarkPropDirty("Active"); - } - this._active = value; - - } - } - private bool _disabled = false; - - partial void OnDisabledChanging(ref bool newValue); - /// - /// Whether the item is disabled. - /// - [Parameter] - public bool Disabled - { - get { return this._disabled; } - set { - if (this._disabled != value || !IsPropDirty("Disabled")) { - MarkPropDirty("Disabled"); - } - this._disabled = value; - - } - } - private bool _selected = false; - - partial void OnSelectedChanging(ref bool newValue); - /// - /// Whether the item is selected. - /// - [Parameter] - public bool Selected - { - get { return this._selected; } - set { - if (this._selected != value || !IsPropDirty("Selected")) { - MarkPropDirty("Selected"); - } - this._selected = value; - - } - } - private string _value; - - partial void OnValueChanging(ref string newValue); - /// - /// The current value of the item. - /// If not specified, the element's text content is used. - /// - [Parameter] - public string Value - { - get { return this._value; } - set { - if (this._value != value || !IsPropDirty("Value")) { - MarkPropDirty("Value"); - } - this._value = value; - - } - } - - partial void FindByNameBaseOptionLike(string name, ref object item); - public override object FindByName(string name) - { - - var baseResult = base.FindByName(name); - if (baseResult != null) - { - return baseResult; - } - - object item = null; - FindByNameBaseOptionLike(name, ref item); - if (item != null) - { - return item; - } - - return null; - } - public async Task SetNativeElementAsync(Object element) - { - await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); - } - public void SetNativeElement(Object element) - { - InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); - } - - partial void SerializeCoreIgbBaseOptionLike(RendererSerializer ser); - - internal override void SerializeCore(RendererSerializer ser) - { - base.SerializeCore(ser); - - SerializeCoreIgbBaseOptionLike(ser); - - if (IsPropDirty("Active")) { ser.AddBooleanProp("active", this._active); } - if (IsPropDirty("Disabled")) { ser.AddBooleanProp("disabled", this._disabled); } - if (IsPropDirty("Selected")) { ser.AddBooleanProp("selected", this._selected); } - if (IsPropDirty("Value")) { ser.AddStringProp("value", this._value); } - - } - -} + public partial class IgbBaseOptionLike : BaseRendererControl + { + public override string Type { get { return "WebBaseOptionLike"; } } + + protected override string ResolveDisplay() + { + return "inline-block"; + } + + protected override bool SupportsVisualChildren + { + get + { + return true; + } + } + + protected override bool UseDirectRender + { + get + { + return true; + } + } + + protected override string DirectRenderElementName + { + get + { + return "igc-base-option-like"; + } + } + + protected override ControlEventBehavior DefaultEventBehavior + { + get { return ControlEventBehavior.Immediate; } + } + + public IgbBaseOptionLike() : base() + { + OnCreatedIgbBaseOptionLike(); + + } + + partial void OnCreatedIgbBaseOptionLike(); + + private bool _active = false; + + partial void OnActiveChanging(ref bool newValue); + /// + /// Whether the item is active. + /// + [Parameter] + public bool Active + { + get { return this._active; } + set + { + if (this._active != value || !IsPropDirty("Active")) + { + MarkPropDirty("Active"); + } + this._active = value; + + } + } + private bool _disabled = false; + + partial void OnDisabledChanging(ref bool newValue); + /// + /// Whether the item is disabled. + /// + [Parameter] + public bool Disabled + { + get { return this._disabled; } + set + { + if (this._disabled != value || !IsPropDirty("Disabled")) + { + MarkPropDirty("Disabled"); + } + this._disabled = value; + + } + } + private bool _selected = false; + + partial void OnSelectedChanging(ref bool newValue); + /// + /// Whether the item is selected. + /// + [Parameter] + public bool Selected + { + get { return this._selected; } + set + { + if (this._selected != value || !IsPropDirty("Selected")) + { + MarkPropDirty("Selected"); + } + this._selected = value; + + } + } + private string _value; + + partial void OnValueChanging(ref string newValue); + /// + /// The current value of the item. + /// If not specified, the element's text content is used. + /// + [Parameter] + public string Value + { + get { return this._value; } + set + { + if (this._value != value || !IsPropDirty("Value")) + { + MarkPropDirty("Value"); + } + this._value = value; + + } + } + + partial void FindByNameBaseOptionLike(string name, ref object item); + public override object FindByName(string name) + { + + var baseResult = base.FindByName(name); + if (baseResult != null) + { + return baseResult; + } + + object item = null; + FindByNameBaseOptionLike(name, ref item); + if (item != null) + { + return item; + } + + return null; + } + public async Task SetNativeElementAsync(Object element) + { + await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + } + public void SetNativeElement(Object element) + { + InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + } + + partial void SerializeCoreIgbBaseOptionLike(RendererSerializer ser); + + internal override void SerializeCore(RendererSerializer ser) + { + base.SerializeCore(ser); + + SerializeCoreIgbBaseOptionLike(ser); + + if (IsPropDirty("Active")) + { ser.AddBooleanProp("active", this._active); } + if (IsPropDirty("Disabled")) + { ser.AddBooleanProp("disabled", this._disabled); } + if (IsPropDirty("Selected")) + { ser.AddBooleanProp("selected", this._selected); } + if (IsPropDirty("Value")) + { ser.AddStringProp("value", this._value); } + + } + + } } diff --git a/src/components/Blazor/Button.cs b/src/components/Blazor/Button.cs index b52c556c..42a26433 100644 --- a/src/components/Blazor/Button.cs +++ b/src/components/Blazor/Button.cs @@ -1,115 +1,113 @@ - -using System; using Microsoft.AspNetCore.Components; -using Microsoft.AspNetCore.Components.Rendering; -using System.Threading.Tasks; -using System.Collections.Generic; -using System.Linq; namespace IgniteUI.Blazor.Controls { - public partial class IgbButton: IgbButtonBase { - public override string Type { get { return "WebButton"; } } - - protected override void EnsureModulesLoaded() - { - if (!IgbButtonModule.IsLoadRequested(IgBlazor)) - { - IgbButtonModule.Register(IgBlazor); - } - } - - protected override string ResolveDisplay() - { - return "inline-block"; - } - - protected override bool SupportsVisualChildren - { - get - { - return true; - } - } - - protected override bool UseDirectRender - { - get - { - return true; - } - } - - protected override string DirectRenderElementName - { - get - { - return "igc-button"; - } - } - - public IgbButton(): base() { - OnCreatedIgbButton(); - - - } - - partial void OnCreatedIgbButton(); - - private ButtonVariant _variant = ButtonVariant.Contained; - - partial void OnVariantChanging(ref ButtonVariant newValue); - /// - /// The variant of the button which determines its visual appearance. - /// - `contained` – filled background; highest visual emphasis (default). - /// - `outlined` – transparent background with a visible border. - /// - `flat` – no background or border; lowest visual emphasis. - /// - `fab` – floating action button shape; typically used for primary actions. - /// - [Parameter] - public ButtonVariant Variant - { - get { return this._variant; } - set { - if (this._variant != value || !IsPropDirty("Variant")) { - MarkPropDirty("Variant"); - } - this._variant = value; - - } - } - - partial void FindByNameButton(string name, ref object item); - public override object FindByName(string name) - { - - var baseResult = base.FindByName(name); - if (baseResult != null) - { - return baseResult; - } - - object item = null; - FindByNameButton(name, ref item); - if (item != null) - { - return item; - } - - return null; - } - - partial void SerializeCoreIgbButton(RendererSerializer ser); - - internal override void SerializeCore(RendererSerializer ser) - { - base.SerializeCore(ser); - - SerializeCoreIgbButton(ser); - - if (IsPropDirty("Variant")) { ser.AddEnumProp("variant", this._variant); } - - } - -} + public partial class IgbButton : IgbButtonBase + { + public override string Type { get { return "WebButton"; } } + + protected override void EnsureModulesLoaded() + { + if (!IgbButtonModule.IsLoadRequested(IgBlazor)) + { + IgbButtonModule.Register(IgBlazor); + } + } + + protected override string ResolveDisplay() + { + return "inline-block"; + } + + protected override bool SupportsVisualChildren + { + get + { + return true; + } + } + + protected override bool UseDirectRender + { + get + { + return true; + } + } + + protected override string DirectRenderElementName + { + get + { + return "igc-button"; + } + } + + public IgbButton() : base() + { + OnCreatedIgbButton(); + + } + + partial void OnCreatedIgbButton(); + + private ButtonVariant _variant = ButtonVariant.Contained; + + partial void OnVariantChanging(ref ButtonVariant newValue); + /// + /// The variant of the button which determines its visual appearance. + /// - `contained` – filled background; highest visual emphasis (default). + /// - `outlined` – transparent background with a visible border. + /// - `flat` – no background or border; lowest visual emphasis. + /// - `fab` – floating action button shape; typically used for primary actions. + /// + [Parameter] + public ButtonVariant Variant + { + get { return this._variant; } + set + { + if (this._variant != value || !IsPropDirty("Variant")) + { + MarkPropDirty("Variant"); + } + this._variant = value; + + } + } + + partial void FindByNameButton(string name, ref object item); + public override object FindByName(string name) + { + + var baseResult = base.FindByName(name); + if (baseResult != null) + { + return baseResult; + } + + object item = null; + FindByNameButton(name, ref item); + if (item != null) + { + return item; + } + + return null; + } + + partial void SerializeCoreIgbButton(RendererSerializer ser); + + internal override void SerializeCore(RendererSerializer ser) + { + base.SerializeCore(ser); + + SerializeCoreIgbButton(ser); + + if (IsPropDirty("Variant")) + { ser.AddEnumProp("variant", this._variant); } + + } + + } } diff --git a/src/components/Blazor/ButtonBase.cs b/src/components/Blazor/ButtonBase.cs index 18725edb..c809da8e 100644 --- a/src/components/Blazor/ButtonBase.cs +++ b/src/components/Blazor/ButtonBase.cs @@ -1,426 +1,457 @@ - -using System; using Microsoft.AspNetCore.Components; -using Microsoft.AspNetCore.Components.Rendering; -using System.Threading.Tasks; -using System.Collections.Generic; -using System.Linq; namespace IgniteUI.Blazor.Controls { - public partial class IgbButtonBase: BaseRendererControl { - public override string Type { get { return "WebButtonBase"; } } + public partial class IgbButtonBase : BaseRendererControl + { + public override string Type { get { return "WebButtonBase"; } } + + protected override string ResolveDisplay() + { + return "inline-block"; + } + + protected override bool SupportsVisualChildren + { + get + { + return true; + } + } + + protected override bool UseDirectRender + { + get + { + return true; + } + } + + protected override string DirectRenderElementName + { + get + { + return "igc-button-base"; + } + } + + protected override ControlEventBehavior DefaultEventBehavior + { + get { return ControlEventBehavior.Immediate; } + } + + public IgbButtonBase() : base() + { + OnCreatedIgbButtonBase(); + + } + + partial void OnCreatedIgbButtonBase(); + + private ButtonBaseType _displayType = ButtonBaseType.Button; + + partial void OnDisplayTypeChanging(ref ButtonBaseType newValue); + /// + /// The type of the button, which determines its behavior and semantics. + /// - `'button'` – no default action; useful for custom JavaScript handlers. + /// - `'submit'` – submits the associated form when clicked. + /// - `'reset'` – resets the associated form fields to their initial values. + /// Ignored when the button is rendered as a link (i.e. `href` is set). + /// + [Parameter] + [WCWidgetMemberName("Type")] + public ButtonBaseType DisplayType + { + get { return this._displayType; } + set + { + if (this._displayType != value || !IsPropDirty("DisplayType")) + { + MarkPropDirty("DisplayType"); + } + this._displayType = value; + + } + } + private string _href; + + partial void OnHrefChanging(ref string newValue); + [Parameter] + public string Href + { + get { return this._href; } + set + { + if (this._href != value || !IsPropDirty("Href")) + { + MarkPropDirty("Href"); + } + this._href = value; + + } + } + private string _download; + + partial void OnDownloadChanging(ref string newValue); + /// + /// Prompts the browser to download the linked resource rather than navigating + /// to it. The optional value is used as the suggested file name. + /// Only effective when `href` is set. + /// + [Parameter] + public string Download + { + get { return this._download; } + set + { + if (this._download != value || !IsPropDirty("Download")) + { + MarkPropDirty("Download"); + } + this._download = value; + + } + } + private ButtonBaseTarget _target = ButtonBaseTarget._blank; + + partial void OnTargetChanging(ref ButtonBaseTarget newValue); + /// + /// Where to open the linked document. Only effective when `href` is set. + /// - `'_self'` – current browsing context (default browser behavior). + /// - `'_blank'` – new tab or window. + /// - `'_parent'` – parent browsing context; falls back to `_self` if none. + /// - `'_top'` – top-level browsing context; falls back to `_self` if none. + /// + [Parameter] + public ButtonBaseTarget Target + { + get { return this._target; } + set + { + if (this._target != value || !IsPropDirty("Target")) + { + MarkPropDirty("Target"); + } + this._target = value; + + } + } + private string _rel; + + partial void OnRelChanging(ref string newValue); + /// + /// The relationship between the current document and the linked URL. + /// Accepts a space-separated list of link types (e.g. `'noopener noreferrer'`). + /// Only effective when `href` is set. When `target="_blank"` is used, + /// setting `rel="noopener noreferrer"` is strongly recommended for security. + /// + [Parameter] + public string Rel + { + get { return this._rel; } + set + { + if (this._rel != value || !IsPropDirty("Rel")) + { + MarkPropDirty("Rel"); + } + this._rel = value; + + } + } + private bool _disabled = false; + + partial void OnDisabledChanging(ref bool newValue); + /// + /// When set, the button will be disabled and non-interactive. + /// + [Parameter] + public bool Disabled + { + get { return this._disabled; } + set + { + if (this._disabled != value || !IsPropDirty("Disabled")) + { + MarkPropDirty("Disabled"); + } + this._disabled = value; + + } + } + private string _command; + + partial void OnCommandChanging(ref string newValue); + /// + /// The command to invoke on the target element specified by `commandfor`. + /// Part of the [Invoker Commands](https://developer.mozilla.org/en-US/docs/Web/API/Invoker_Commands_API) API. + /// Custom commands must start with two dashes (e.g. `'--my-command'`). + /// + [Parameter] + public string Command + { + get { return this._command; } + set + { + if (this._command != value || !IsPropDirty("Command")) + { + MarkPropDirty("Command"); + } + this._command = value; - protected override string ResolveDisplay() + } + } + private string? _commandfor; + + partial void OnCommandforChanging(ref string? newValue); + /// + /// The ID of the target element for the invoker command. + /// Part of the [Invoker Commands API](https://developer.mozilla.org/en-US/docs/Web/API/Invoker_Commands_API). + /// + [Parameter] + public string? Commandfor + { + get { return this._commandfor; } + set + { + if (this._commandfor != value || !IsPropDirty("Commandfor")) + { + MarkPropDirty("Commandfor"); + } + this._commandfor = value; + + } + } + + partial void FindByNameButtonBase(string name, ref object item); + public override object FindByName(string name) + { + + var baseResult = base.FindByName(name); + if (baseResult != null) + { + return baseResult; + } + + object item = null; + FindByNameButtonBase(name, ref item); + if (item != null) + { + return item; + } + + return null; + } + /// + /// Sets focus in the button. + /// + + [WCWidgetMemberName("Focus")] + public async Task FocusComponentAsync(IgbFocusOptions options) + { + await InvokeMethod("focus", new object[] { ObjectToParam(options) }, new string[] { "Json" }); + } + + [WCWidgetMemberName("Focus")] + public void FocusComponent(IgbFocusOptions options) + { + InvokeMethodSync("focus", new object[] { ObjectToParam(options) }, new string[] { "Json" }); + } + /// + /// Removes focus from the button. + /// + + [WCWidgetMemberName("Blur")] + public async Task BlurComponentAsync() + { + await InvokeMethod("blur", new object[] { }, new string[] { }); + } + + [WCWidgetMemberName("Blur")] + public void BlurComponent() + { + InvokeMethodSync("blur", new object[] { }, new string[] { }); + } + public async Task SetNativeElementAsync(Object element) + { + await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + } + public void SetNativeElement(Object element) + { + InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + } + /// + /// Simulates a mouse click on the button, triggering its click handler and any associated form action. + /// + public async Task ClickAsync() + { + await InvokeMethod("click", new object[] { }, new string[] { }); + } + public void Click() + { + InvokeMethodSync("click", new object[] { }, new string[] { }); + } + + private string _focusRef = null; + private string _focusScript = null; + [Parameter] + public string FocusScript + { + + set + { + if (value != this._focusScript) + { + this._focusScript = value; + this.OnRefChanged("Focus", null, value, true, false, (string refName, object oldValue, object newValue) => + { + this._focusRef = refName; + this.MarkPropDirty("FocusRef"); + }); + } + } + get + { + return this._focusScript; + } + } + + partial void OnHandlingFocus(IgbVoidEventArgs args); + private EventCallback? _focus = null; + [Parameter] + public EventCallback Focus + { + get + { + return this._focus != null ? this._focus.Value : EventCallback.Empty; + } + set + { + if (!value.Equals(EventCallback.Empty)) + { + if (!CompareEventCallbacks(value, _focus, ref eventCallbacksCache)) + { + _focus = value; + this.SetHandler(this.Name, "Focus", value, (args) => { - return "inline-block"; - } + OnHandlingFocus(args); - protected override bool SupportsVisualChildren + }); + this.OnRefChanged("Focus", null, "nativeEvent:::Focus", true, false, (refName, oldValue, newValue) => { - get - { - return true; - } - } + this._focusRef = refName; + this.MarkPropDirty("FocusRef"); + }); + } + } + else + { + _focus = null; + this.SetHandler(this.Name, "Focus", null); + this.OnRefChanged("Focus", null, null, true, false, (refName, oldValue, newValue) => + { + this._focusRef = null; + this.MarkPropDirty("FocusRef"); + }); + } + } + } + + private string _blurRef = null; + private string _blurScript = null; + [Parameter] + public string BlurScript + { - protected override bool UseDirectRender + set + { + if (value != this._blurScript) + { + this._blurScript = value; + this.OnRefChanged("Blur", null, value, true, false, (string refName, object oldValue, object newValue) => + { + this._blurRef = refName; + this.MarkPropDirty("BlurRef"); + }); + } + } + get + { + return this._blurScript; + } + } + + partial void OnHandlingBlur(IgbVoidEventArgs args); + private EventCallback? _blur = null; + [Parameter] + public EventCallback Blur + { + get + { + return this._blur != null ? this._blur.Value : EventCallback.Empty; + } + set + { + if (!value.Equals(EventCallback.Empty)) + { + if (!CompareEventCallbacks(value, _blur, ref eventCallbacksCache)) + { + _blur = value; + this.SetHandler(this.Name, "Blur", value, (args) => { - get - { - return true; - } - } + OnHandlingBlur(args); - protected override string DirectRenderElementName + }); + this.OnRefChanged("Blur", null, "nativeEvent:::Blur", true, false, (refName, oldValue, newValue) => { - get - { - return "igc-button-base"; - } - } - - protected override ControlEventBehavior DefaultEventBehavior - { - get { return ControlEventBehavior.Immediate; } - } - - public IgbButtonBase(): base() { - OnCreatedIgbButtonBase(); - - - } - - partial void OnCreatedIgbButtonBase(); - - private ButtonBaseType _displayType = ButtonBaseType.Button; - - partial void OnDisplayTypeChanging(ref ButtonBaseType newValue); - /// - /// The type of the button, which determines its behavior and semantics. - /// - `'button'` – no default action; useful for custom JavaScript handlers. - /// - `'submit'` – submits the associated form when clicked. - /// - `'reset'` – resets the associated form fields to their initial values. - /// Ignored when the button is rendered as a link (i.e. `href` is set). - /// - [Parameter] - [WCWidgetMemberName("Type")] - public ButtonBaseType DisplayType - { - get { return this._displayType; } - set { - if (this._displayType != value || !IsPropDirty("DisplayType")) { - MarkPropDirty("DisplayType"); - } - this._displayType = value; - - } - } - private string _href; - - partial void OnHrefChanging(ref string newValue); - [Parameter] - public string Href - { - get { return this._href; } - set { - if (this._href != value || !IsPropDirty("Href")) { - MarkPropDirty("Href"); - } - this._href = value; - - } - } - private string _download; - - partial void OnDownloadChanging(ref string newValue); - /// - /// Prompts the browser to download the linked resource rather than navigating - /// to it. The optional value is used as the suggested file name. - /// Only effective when `href` is set. - /// - [Parameter] - public string Download - { - get { return this._download; } - set { - if (this._download != value || !IsPropDirty("Download")) { - MarkPropDirty("Download"); - } - this._download = value; - - } - } - private ButtonBaseTarget _target = ButtonBaseTarget._blank; - - partial void OnTargetChanging(ref ButtonBaseTarget newValue); - /// - /// Where to open the linked document. Only effective when `href` is set. - /// - `'_self'` – current browsing context (default browser behavior). - /// - `'_blank'` – new tab or window. - /// - `'_parent'` – parent browsing context; falls back to `_self` if none. - /// - `'_top'` – top-level browsing context; falls back to `_self` if none. - /// - [Parameter] - public ButtonBaseTarget Target - { - get { return this._target; } - set { - if (this._target != value || !IsPropDirty("Target")) { - MarkPropDirty("Target"); - } - this._target = value; - - } - } - private string _rel; - - partial void OnRelChanging(ref string newValue); - /// - /// The relationship between the current document and the linked URL. - /// Accepts a space-separated list of link types (e.g. `'noopener noreferrer'`). - /// Only effective when `href` is set. When `target="_blank"` is used, - /// setting `rel="noopener noreferrer"` is strongly recommended for security. - /// - [Parameter] - public string Rel - { - get { return this._rel; } - set { - if (this._rel != value || !IsPropDirty("Rel")) { - MarkPropDirty("Rel"); - } - this._rel = value; - - } - } - private bool _disabled = false; - - partial void OnDisabledChanging(ref bool newValue); - /// - /// When set, the button will be disabled and non-interactive. - /// - [Parameter] - public bool Disabled - { - get { return this._disabled; } - set { - if (this._disabled != value || !IsPropDirty("Disabled")) { - MarkPropDirty("Disabled"); - } - this._disabled = value; - - } - } - private string _command; - - partial void OnCommandChanging(ref string newValue); - /// - /// The command to invoke on the target element specified by `commandfor`. - /// Part of the [Invoker Commands](https://developer.mozilla.org/en-US/docs/Web/API/Invoker_Commands_API) API. - /// Custom commands must start with two dashes (e.g. `'--my-command'`). - /// - [Parameter] - public string Command - { - get { return this._command; } - set { - if (this._command != value || !IsPropDirty("Command")) { - MarkPropDirty("Command"); - } - this._command = value; - - } - } - private string? _commandfor; - - partial void OnCommandforChanging(ref string? newValue); - /// - /// The ID of the target element for the invoker command. - /// Part of the [Invoker Commands API](https://developer.mozilla.org/en-US/docs/Web/API/Invoker_Commands_API). - /// - [Parameter] - public string? Commandfor - { - get { return this._commandfor; } - set { - if (this._commandfor != value || !IsPropDirty("Commandfor")) { - MarkPropDirty("Commandfor"); - } - this._commandfor = value; - - } - } - - partial void FindByNameButtonBase(string name, ref object item); - public override object FindByName(string name) - { - - var baseResult = base.FindByName(name); - if (baseResult != null) - { - return baseResult; - } - - object item = null; - FindByNameButtonBase(name, ref item); - if (item != null) - { - return item; - } - - return null; - } - /// - /// Sets focus in the button. - /// - - [WCWidgetMemberName("Focus")] - public async Task FocusComponentAsync(IgbFocusOptions options) - { - await InvokeMethod("focus", new object[] { ObjectToParam(options) }, new string[] { "Json" }); - } - - [WCWidgetMemberName("Focus")] - public void FocusComponent(IgbFocusOptions options) - { - InvokeMethodSync("focus", new object[] { ObjectToParam(options) }, new string[] { "Json" }); - } - /// - /// Removes focus from the button. - /// - - [WCWidgetMemberName("Blur")] - public async Task BlurComponentAsync() - { - await InvokeMethod("blur", new object[] { }, new string[] { }); - } - - [WCWidgetMemberName("Blur")] - public void BlurComponent() - { - InvokeMethodSync("blur", new object[] { }, new string[] { }); - } - public async Task SetNativeElementAsync(Object element) - { - await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); - } - public void SetNativeElement(Object element) - { - InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); - } - /// - /// Simulates a mouse click on the button, triggering its click handler and any associated form action. - /// - public async Task ClickAsync() - { - await InvokeMethod("click", new object[] { }, new string[] { }); - } - public void Click() - { - InvokeMethodSync("click", new object[] { }, new string[] { }); - } - - private string _focusRef = null; - private string _focusScript = null; - [Parameter] - public string FocusScript { - - set - { - if (value != this._focusScript) - { - this._focusScript = value; - this.OnRefChanged("Focus", null, value, true, false, (string refName, object oldValue, object newValue) => { - this._focusRef = refName; - this.MarkPropDirty("FocusRef"); - }); - } - } - get - { - return this._focusScript; - } - } - - partial void OnHandlingFocus(IgbVoidEventArgs args); - private EventCallback? _focus = null; - [Parameter] - public EventCallback Focus - { - get - { - return this._focus != null ? this._focus.Value : EventCallback.Empty; - } - set - { - if (!value.Equals(EventCallback.Empty)) - { - if (!CompareEventCallbacks(value, _focus, ref eventCallbacksCache)) - { - _focus = value; - this.SetHandler(this.Name, "Focus", value, (args) => { - OnHandlingFocus(args); - - }); - this.OnRefChanged("Focus", null, "nativeEvent:::Focus", true, false, (refName, oldValue, newValue) => { - this._focusRef = refName; - this.MarkPropDirty("FocusRef"); - }); - } - } - else - { - _focus = null; - this.SetHandler(this.Name, "Focus", null); - this.OnRefChanged("Focus", null, null, true, false, (refName, oldValue, newValue) => { - this._focusRef = null; - this.MarkPropDirty("FocusRef"); - }); - } - } - } - - private string _blurRef = null; - private string _blurScript = null; - [Parameter] - public string BlurScript { - - set - { - if (value != this._blurScript) - { - this._blurScript = value; - this.OnRefChanged("Blur", null, value, true, false, (string refName, object oldValue, object newValue) => { - this._blurRef = refName; - this.MarkPropDirty("BlurRef"); - }); - } - } - get - { - return this._blurScript; - } - } - - partial void OnHandlingBlur(IgbVoidEventArgs args); - private EventCallback? _blur = null; - [Parameter] - public EventCallback Blur - { - get - { - return this._blur != null ? this._blur.Value : EventCallback.Empty; - } - set - { - if (!value.Equals(EventCallback.Empty)) - { - if (!CompareEventCallbacks(value, _blur, ref eventCallbacksCache)) - { - _blur = value; - this.SetHandler(this.Name, "Blur", value, (args) => { - OnHandlingBlur(args); - - }); - this.OnRefChanged("Blur", null, "nativeEvent:::Blur", true, false, (refName, oldValue, newValue) => { - this._blurRef = refName; - this.MarkPropDirty("BlurRef"); - }); - } - } - else - { - _blur = null; - this.SetHandler(this.Name, "Blur", null); - this.OnRefChanged("Blur", null, null, true, false, (refName, oldValue, newValue) => { - this._blurRef = null; - this.MarkPropDirty("BlurRef"); - }); - } - } - } - - partial void SerializeCoreIgbButtonBase(RendererSerializer ser); - - internal override void SerializeCore(RendererSerializer ser) - { - base.SerializeCore(ser); - - SerializeCoreIgbButtonBase(ser); - - if (IsPropDirty("DisplayType")) { ser.AddEnumProp("displayType", this._displayType); } - if (IsPropDirty("Href")) { ser.AddStringProp("href", this._href); } - if (IsPropDirty("Download")) { ser.AddStringProp("download", this._download); } - if (IsPropDirty("Target")) { ser.AddEnumProp("target", this._target); } - if (IsPropDirty("Rel")) { ser.AddStringProp("rel", this._rel); } - if (IsPropDirty("Disabled")) { ser.AddBooleanProp("disabled", this._disabled); } - if (IsPropDirty("Command")) { ser.AddStringProp("command", this._command); } - if (IsPropDirty("Commandfor")) { ser.AddStringProp("commandfor", this._commandfor); } - if (IsPropDirty("FocusRef")) { ser.AddStringProp("focusRef", this._focusRef); } - if (IsPropDirty("BlurRef")) { ser.AddStringProp("blurRef", this._blurRef); } - - } - -} + this._blurRef = refName; + this.MarkPropDirty("BlurRef"); + }); + } + } + else + { + _blur = null; + this.SetHandler(this.Name, "Blur", null); + this.OnRefChanged("Blur", null, null, true, false, (refName, oldValue, newValue) => + { + this._blurRef = null; + this.MarkPropDirty("BlurRef"); + }); + } + } + } + + partial void SerializeCoreIgbButtonBase(RendererSerializer ser); + + internal override void SerializeCore(RendererSerializer ser) + { + base.SerializeCore(ser); + + SerializeCoreIgbButtonBase(ser); + + if (IsPropDirty("DisplayType")) + { ser.AddEnumProp("displayType", this._displayType); } + if (IsPropDirty("Href")) + { ser.AddStringProp("href", this._href); } + if (IsPropDirty("Download")) + { ser.AddStringProp("download", this._download); } + if (IsPropDirty("Target")) + { ser.AddEnumProp("target", this._target); } + if (IsPropDirty("Rel")) + { ser.AddStringProp("rel", this._rel); } + if (IsPropDirty("Disabled")) + { ser.AddBooleanProp("disabled", this._disabled); } + if (IsPropDirty("Command")) + { ser.AddStringProp("command", this._command); } + if (IsPropDirty("Commandfor")) + { ser.AddStringProp("commandfor", this._commandfor); } + if (IsPropDirty("FocusRef")) + { ser.AddStringProp("focusRef", this._focusRef); } + if (IsPropDirty("BlurRef")) + { ser.AddStringProp("blurRef", this._blurRef); } + + } + + } } diff --git a/src/components/Blazor/ButtonBaseTarget.cs b/src/components/Blazor/ButtonBaseTarget.cs index a5229b2e..bba827ea 100644 --- a/src/components/Blazor/ButtonBaseTarget.cs +++ b/src/components/Blazor/ButtonBaseTarget.cs @@ -1,10 +1,11 @@ namespace IgniteUI.Blazor.Controls { -public enum ButtonBaseTarget { - _blank, - _parent, - _self, - _top + public enum ButtonBaseTarget + { + _blank, + _parent, + _self, + _top -} + } } diff --git a/src/components/Blazor/ButtonBaseType.cs b/src/components/Blazor/ButtonBaseType.cs index 266b1dbe..3b787012 100644 --- a/src/components/Blazor/ButtonBaseType.cs +++ b/src/components/Blazor/ButtonBaseType.cs @@ -1,9 +1,10 @@ namespace IgniteUI.Blazor.Controls { -public enum ButtonBaseType { - Button, - Reset, - Submit + public enum ButtonBaseType + { + Button, + Reset, + Submit -} + } } diff --git a/src/components/Blazor/ButtonGroup.cs b/src/components/Blazor/ButtonGroup.cs index c27ae9ae..9476af85 100644 --- a/src/components/Blazor/ButtonGroup.cs +++ b/src/components/Blazor/ButtonGroup.cs @@ -1,303 +1,322 @@ - -using System; using Microsoft.AspNetCore.Components; -using Microsoft.AspNetCore.Components.Rendering; -using System.Threading.Tasks; -using System.Collections.Generic; -using System.Linq; namespace IgniteUI.Blazor.Controls { - /// -/// The `igc-button-group` groups a series of `igc-toggle-button`s together, exposing features such as layout and selection. -/// -public partial class IgbButtonGroup: BaseRendererControl { - public override string Type { get { return "WebButtonGroup"; } } - - protected override void EnsureModulesLoaded() - { - if (!IgbButtonGroupModule.IsLoadRequested(IgBlazor)) - { - IgbButtonGroupModule.Register(IgBlazor); - } - } - - protected override string ResolveDisplay() + /// + /// The `igc-button-group` groups a series of `igc-toggle-button`s together, exposing features such as layout and selection. + /// + public partial class IgbButtonGroup : BaseRendererControl + { + public override string Type { get { return "WebButtonGroup"; } } + + protected override void EnsureModulesLoaded() + { + if (!IgbButtonGroupModule.IsLoadRequested(IgBlazor)) + { + IgbButtonGroupModule.Register(IgBlazor); + } + } + + protected override string ResolveDisplay() + { + return "inline-block"; + } + + protected override bool SupportsVisualChildren + { + get + { + return true; + } + } + + protected override bool UseDirectRender + { + get + { + return true; + } + } + + protected override string DirectRenderElementName + { + get + { + return "igc-button-group"; + } + } + + protected override ControlEventBehavior DefaultEventBehavior + { + get { return ControlEventBehavior.Immediate; } + } + + public IgbButtonGroup() : base() + { + OnCreatedIgbButtonGroup(); + + } + + partial void OnCreatedIgbButtonGroup(); + + private bool _disabled = false; + + partial void OnDisabledChanging(ref bool newValue); + /// + /// Disables all buttons inside the group. + /// + [Parameter] + public bool Disabled + { + get { return this._disabled; } + set + { + if (this._disabled != value || !IsPropDirty("Disabled")) + { + MarkPropDirty("Disabled"); + } + this._disabled = value; + + } + } + private ContentOrientation _alignment = ContentOrientation.Horizontal; + + partial void OnAlignmentChanging(ref ContentOrientation newValue); + /// + /// Sets the orientation of the buttons in the group. + /// + [Parameter] + public ContentOrientation Alignment + { + get { return this._alignment; } + set + { + if (this._alignment != value || !IsPropDirty("Alignment")) + { + MarkPropDirty("Alignment"); + } + this._alignment = value; + + } + } + private ButtonGroupSelection _selection = ButtonGroupSelection.Single; + + partial void OnSelectionChanging(ref ButtonGroupSelection newValue); + /// + /// Controls the mode of selection for the button group. + /// + [Parameter] + public ButtonGroupSelection Selection + { + get { return this._selection; } + set + { + if (this._selection != value || !IsPropDirty("Selection")) + { + MarkPropDirty("Selection"); + } + this._selection = value; + + } + } + private string[] _selectedItems; + + partial void OnSelectedItemsChanging(ref string[] newValue); + [Parameter] + public string[] SelectedItems + { + get { return this._selectedItems; } + set + { + if (this._selectedItems != value || !IsPropDirty("SelectedItems")) + { + MarkPropDirty("SelectedItems"); + } + this._selectedItems = value; + + } + } + + partial void FindByNameButtonGroup(string name, ref object item); + public override object FindByName(string name) + { + + var baseResult = base.FindByName(name); + if (baseResult != null) + { + return baseResult; + } + + object item = null; + FindByNameButtonGroup(name, ref item); + if (item != null) + { + return item; + } + + return null; + } + public async Task SetNativeElementAsync(Object element) + { + await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + } + public void SetNativeElement(Object element) + { + InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + } + + private string _selectRef = null; + private string _selectScript = null; + [Parameter] + public string SelectScript + { + + set + { + if (value != this._selectScript) + { + this._selectScript = value; + this.OnRefChanged("Select", null, value, true, false, (string refName, object oldValue, object newValue) => + { + this._selectRef = refName; + this.MarkPropDirty("SelectRef"); + }); + } + } + get + { + return this._selectScript; + } + } + + partial void OnHandlingSelect(IgbComponentValueChangedEventArgs args); + private EventCallback? _select = null; + [Parameter] + public EventCallback Select + { + get + { + return this._select != null ? this._select.Value : EventCallback.Empty; + } + set + { + if (!value.Equals(EventCallback.Empty)) + { + if (!CompareEventCallbacks(value, _select, ref eventCallbacksCache)) + { + _select = value; + this.SetHandler(this.Name, "Select", value, (args) => { - return "inline-block"; - } + OnHandlingSelect(args); - protected override bool SupportsVisualChildren + }); + this.OnRefChanged("Select", null, "event:::Select", true, false, (refName, oldValue, newValue) => { - get - { - return true; - } - } + this._selectRef = refName; + this.MarkPropDirty("SelectRef"); + }); + } + } + else + { + _select = null; + this.SetHandler(this.Name, "Select", null); + this.OnRefChanged("Select", null, null, true, false, (refName, oldValue, newValue) => + { + this._selectRef = null; + this.MarkPropDirty("SelectRef"); + }); + } + } + } + + private string _deselectRef = null; + private string _deselectScript = null; + [Parameter] + public string DeselectScript + { - protected override bool UseDirectRender + set + { + if (value != this._deselectScript) + { + this._deselectScript = value; + this.OnRefChanged("Deselect", null, value, true, false, (string refName, object oldValue, object newValue) => + { + this._deselectRef = refName; + this.MarkPropDirty("DeselectRef"); + }); + } + } + get + { + return this._deselectScript; + } + } + + partial void OnHandlingDeselect(IgbComponentValueChangedEventArgs args); + private EventCallback? _deselect = null; + [Parameter] + public EventCallback Deselect + { + get + { + return this._deselect != null ? this._deselect.Value : EventCallback.Empty; + } + set + { + if (!value.Equals(EventCallback.Empty)) + { + if (!CompareEventCallbacks(value, _deselect, ref eventCallbacksCache)) + { + _deselect = value; + this.SetHandler(this.Name, "Deselect", value, (args) => { - get - { - return true; - } - } + OnHandlingDeselect(args); - protected override string DirectRenderElementName + }); + this.OnRefChanged("Deselect", null, "event:::Deselect", true, false, (refName, oldValue, newValue) => { - get - { - return "igc-button-group"; - } - } - - protected override ControlEventBehavior DefaultEventBehavior - { - get { return ControlEventBehavior.Immediate; } - } - - public IgbButtonGroup(): base() { - OnCreatedIgbButtonGroup(); - - - } - - partial void OnCreatedIgbButtonGroup(); - - private bool _disabled = false; - - partial void OnDisabledChanging(ref bool newValue); - /// - /// Disables all buttons inside the group. - /// - [Parameter] - public bool Disabled - { - get { return this._disabled; } - set { - if (this._disabled != value || !IsPropDirty("Disabled")) { - MarkPropDirty("Disabled"); - } - this._disabled = value; - - } - } - private ContentOrientation _alignment = ContentOrientation.Horizontal; - - partial void OnAlignmentChanging(ref ContentOrientation newValue); - /// - /// Sets the orientation of the buttons in the group. - /// - [Parameter] - public ContentOrientation Alignment - { - get { return this._alignment; } - set { - if (this._alignment != value || !IsPropDirty("Alignment")) { - MarkPropDirty("Alignment"); - } - this._alignment = value; - - } - } - private ButtonGroupSelection _selection = ButtonGroupSelection.Single; - - partial void OnSelectionChanging(ref ButtonGroupSelection newValue); - /// - /// Controls the mode of selection for the button group. - /// - [Parameter] - public ButtonGroupSelection Selection - { - get { return this._selection; } - set { - if (this._selection != value || !IsPropDirty("Selection")) { - MarkPropDirty("Selection"); - } - this._selection = value; - - } - } - private string[] _selectedItems; - - partial void OnSelectedItemsChanging(ref string[] newValue); - [Parameter] - public string[] SelectedItems - { - get { return this._selectedItems; } - set { - if (this._selectedItems != value || !IsPropDirty("SelectedItems")) { - MarkPropDirty("SelectedItems"); - } - this._selectedItems = value; - - } - } - - partial void FindByNameButtonGroup(string name, ref object item); - public override object FindByName(string name) - { - - var baseResult = base.FindByName(name); - if (baseResult != null) - { - return baseResult; - } - - object item = null; - FindByNameButtonGroup(name, ref item); - if (item != null) - { - return item; - } - - return null; - } - public async Task SetNativeElementAsync(Object element) - { - await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); - } - public void SetNativeElement(Object element) - { - InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); - } - - private string _selectRef = null; - private string _selectScript = null; - [Parameter] - public string SelectScript { - - set - { - if (value != this._selectScript) - { - this._selectScript = value; - this.OnRefChanged("Select", null, value, true, false, (string refName, object oldValue, object newValue) => { - this._selectRef = refName; - this.MarkPropDirty("SelectRef"); - }); - } - } - get - { - return this._selectScript; - } - } - - partial void OnHandlingSelect(IgbComponentValueChangedEventArgs args); - private EventCallback? _select = null; - [Parameter] - public EventCallback Select - { - get - { - return this._select != null ? this._select.Value : EventCallback.Empty; - } - set - { - if (!value.Equals(EventCallback.Empty)) - { - if (!CompareEventCallbacks(value, _select, ref eventCallbacksCache)) - { - _select = value; - this.SetHandler(this.Name, "Select", value, (args) => { - OnHandlingSelect(args); - - }); - this.OnRefChanged("Select", null, "event:::Select", true, false, (refName, oldValue, newValue) => { - this._selectRef = refName; - this.MarkPropDirty("SelectRef"); - }); - } - } - else - { - _select = null; - this.SetHandler(this.Name, "Select", null); - this.OnRefChanged("Select", null, null, true, false, (refName, oldValue, newValue) => { - this._selectRef = null; - this.MarkPropDirty("SelectRef"); - }); - } - } - } - - private string _deselectRef = null; - private string _deselectScript = null; - [Parameter] - public string DeselectScript { - - set - { - if (value != this._deselectScript) - { - this._deselectScript = value; - this.OnRefChanged("Deselect", null, value, true, false, (string refName, object oldValue, object newValue) => { - this._deselectRef = refName; - this.MarkPropDirty("DeselectRef"); - }); - } - } - get - { - return this._deselectScript; - } - } - - partial void OnHandlingDeselect(IgbComponentValueChangedEventArgs args); - private EventCallback? _deselect = null; - [Parameter] - public EventCallback Deselect - { - get - { - return this._deselect != null ? this._deselect.Value : EventCallback.Empty; - } - set - { - if (!value.Equals(EventCallback.Empty)) - { - if (!CompareEventCallbacks(value, _deselect, ref eventCallbacksCache)) - { - _deselect = value; - this.SetHandler(this.Name, "Deselect", value, (args) => { - OnHandlingDeselect(args); - - }); - this.OnRefChanged("Deselect", null, "event:::Deselect", true, false, (refName, oldValue, newValue) => { - this._deselectRef = refName; - this.MarkPropDirty("DeselectRef"); - }); - } - } - else - { - _deselect = null; - this.SetHandler(this.Name, "Deselect", null); - this.OnRefChanged("Deselect", null, null, true, false, (refName, oldValue, newValue) => { - this._deselectRef = null; - this.MarkPropDirty("DeselectRef"); - }); - } - } - } - - partial void SerializeCoreIgbButtonGroup(RendererSerializer ser); - - internal override void SerializeCore(RendererSerializer ser) - { - base.SerializeCore(ser); - - SerializeCoreIgbButtonGroup(ser); - - if (IsPropDirty("Disabled")) { ser.AddBooleanProp("disabled", this._disabled); } - if (IsPropDirty("Alignment")) { ser.AddEnumProp("alignment", this._alignment); } - if (IsPropDirty("Selection")) { ser.AddEnumProp("selection", this._selection); } - if (IsPropDirty("SelectedItems")) { ser.AddArrayProp("selectedItems", this._selectedItems); } - if (IsPropDirty("SelectRef")) { ser.AddStringProp("selectRef", this._selectRef); } - if (IsPropDirty("DeselectRef")) { ser.AddStringProp("deselectRef", this._deselectRef); } - - } - -} + this._deselectRef = refName; + this.MarkPropDirty("DeselectRef"); + }); + } + } + else + { + _deselect = null; + this.SetHandler(this.Name, "Deselect", null); + this.OnRefChanged("Deselect", null, null, true, false, (refName, oldValue, newValue) => + { + this._deselectRef = null; + this.MarkPropDirty("DeselectRef"); + }); + } + } + } + + partial void SerializeCoreIgbButtonGroup(RendererSerializer ser); + + internal override void SerializeCore(RendererSerializer ser) + { + base.SerializeCore(ser); + + SerializeCoreIgbButtonGroup(ser); + + if (IsPropDirty("Disabled")) + { ser.AddBooleanProp("disabled", this._disabled); } + if (IsPropDirty("Alignment")) + { ser.AddEnumProp("alignment", this._alignment); } + if (IsPropDirty("Selection")) + { ser.AddEnumProp("selection", this._selection); } + if (IsPropDirty("SelectedItems")) + { ser.AddArrayProp("selectedItems", this._selectedItems); } + if (IsPropDirty("SelectRef")) + { ser.AddStringProp("selectRef", this._selectRef); } + if (IsPropDirty("DeselectRef")) + { ser.AddStringProp("deselectRef", this._deselectRef); } + + } + + } } diff --git a/src/components/Blazor/ButtonGroupModule.cs b/src/components/Blazor/ButtonGroupModule.cs index 9b07ee6d..ea6f612a 100644 --- a/src/components/Blazor/ButtonGroupModule.cs +++ b/src/components/Blazor/ButtonGroupModule.cs @@ -1,24 +1,22 @@ -using System; -using System.Collections.Generic; -using System.Runtime.CompilerServices; -using System.Text; -using System.Collections.Generic; - namespace IgniteUI.Blazor.Controls { - public partial class IgbButtonGroupModule { - public static void Register(IIgniteUIBlazor runtime) { + public partial class IgbButtonGroupModule + { + public static void Register(IIgniteUIBlazor runtime) + { ModuleLoader.Load(runtime, "WebButtonGroupModule"); IgbToggleButtonModule.MarkIsLoadRequested(runtime); } - public static void MarkIsLoadRequested(IIgniteUIBlazor runtime) { + public static void MarkIsLoadRequested(IIgniteUIBlazor runtime) + { ModuleLoader.MarkIsLoadRequested(runtime, "WebButtonGroupModule"); } - public static bool IsLoadRequested(IIgniteUIBlazor runtime) { + public static bool IsLoadRequested(IIgniteUIBlazor runtime) + { return ModuleLoader.IsLoadRequested(runtime, "WebButtonGroupModule"); } } diff --git a/src/components/Blazor/ButtonGroupSelection.cs b/src/components/Blazor/ButtonGroupSelection.cs index 9cb48105..bedac50b 100644 --- a/src/components/Blazor/ButtonGroupSelection.cs +++ b/src/components/Blazor/ButtonGroupSelection.cs @@ -1,10 +1,11 @@ namespace IgniteUI.Blazor.Controls { -public enum ButtonGroupSelection { - Single, - [WCEnumName("single-required")] - SingleRequired, - Multiple + public enum ButtonGroupSelection + { + Single, + [WCEnumName("single-required")] + SingleRequired, + Multiple -} + } } diff --git a/src/components/Blazor/ButtonModule.cs b/src/components/Blazor/ButtonModule.cs index 1856bdae..cc09dce2 100644 --- a/src/components/Blazor/ButtonModule.cs +++ b/src/components/Blazor/ButtonModule.cs @@ -1,23 +1,20 @@ -using System; -using System.Collections.Generic; -using System.Runtime.CompilerServices; -using System.Text; -using System.Collections.Generic; - namespace IgniteUI.Blazor.Controls { - public partial class IgbButtonModule { - public static void Register(IIgniteUIBlazor runtime) { + public partial class IgbButtonModule + { + public static void Register(IIgniteUIBlazor runtime) + { ModuleLoader.Load(runtime, "WebButtonModule"); - } - public static void MarkIsLoadRequested(IIgniteUIBlazor runtime) { + public static void MarkIsLoadRequested(IIgniteUIBlazor runtime) + { ModuleLoader.MarkIsLoadRequested(runtime, "WebButtonModule"); } - public static bool IsLoadRequested(IIgniteUIBlazor runtime) { + public static bool IsLoadRequested(IIgniteUIBlazor runtime) + { return ModuleLoader.IsLoadRequested(runtime, "WebButtonModule"); } } diff --git a/src/components/Blazor/ButtonVariant.cs b/src/components/Blazor/ButtonVariant.cs index 4ac070a8..e4d696f1 100644 --- a/src/components/Blazor/ButtonVariant.cs +++ b/src/components/Blazor/ButtonVariant.cs @@ -1,10 +1,11 @@ namespace IgniteUI.Blazor.Controls { -public enum ButtonVariant { - Contained, - Flat, - Outlined, - Fab + public enum ButtonVariant + { + Contained, + Flat, + Outlined, + Fab -} + } } diff --git a/src/components/Blazor/Calendar.cs b/src/components/Blazor/Calendar.cs index 0074c7d6..d4d935d7 100644 --- a/src/components/Blazor/Calendar.cs +++ b/src/components/Blazor/Calendar.cs @@ -1,466 +1,504 @@ - -using System; using Microsoft.AspNetCore.Components; -using Microsoft.AspNetCore.Components.Rendering; -using System.Threading.Tasks; -using System.Collections.Generic; -using System.Linq; namespace IgniteUI.Blazor.Controls { - /// -/// Represents a calendar that lets users -/// to select a date value in a variety of different ways. -/// -public partial class IgbCalendar: IgbCalendarBase { - public override string Type { get { return "WebCalendar"; } } - - protected override void EnsureModulesLoaded() + /// + /// Represents a calendar that lets users + /// to select a date value in a variety of different ways. + /// + public partial class IgbCalendar : IgbCalendarBase + { + public override string Type { get { return "WebCalendar"; } } + + protected override void EnsureModulesLoaded() + { + if (!IgbCalendarModule.IsLoadRequested(IgBlazor)) + { + IgbCalendarModule.Register(IgBlazor); + } + } + + protected override string ResolveDisplay() + { + return "inline-block"; + } + + protected override bool SupportsVisualChildren + { + get + { + return true; + } + } + + public IgbCalendar() : base() + { + OnCreatedIgbCalendar(); + + } + + partial void OnCreatedIgbCalendar(); + + private DateTime _value = DateTime.MinValue; + + partial void OnValueChanging(ref DateTime newValue); + [Parameter] + public DateTime Value + { + get { return this._value; } + set + { + if (this._value != value || !IsPropDirty("Value")) + { + MarkPropDirty("Value"); + } + this._value = value; + + } + } + public async Task GetCurrentValueAsync() + { + var iv = await InvokeMethod("p:Value", new object[] { }, new string[] { }); + return ReturnToDate(iv); + } + public DateTime GetCurrentValue() + { + var iv = InvokeMethodSync("p:Value", new object[] { }, new string[] { }); + return ReturnToDate(iv); + } + private DateTime[] _values; + + partial void OnValuesChanging(ref DateTime[] newValue); + [Parameter] + public DateTime[] Values + { + get { return this._values; } + set + { + if (this._values != value || !IsPropDirty("Values")) + { + MarkPropDirty("Values"); + } + this._values = value; + + } + } + public async Task GetCurrentValuesAsync() + { + var iv = await InvokeMethod("p:Values", new object[] { }, new string[] { }); + return ReturnToDateArray(iv); + } + public DateTime[] GetCurrentValues() + { + var iv = InvokeMethodSync("p:Values", new object[] { }, new string[] { }); + return ReturnToDateArray(iv); + } + private DateTime _activeDate = DateTime.MinValue; + + partial void OnActiveDateChanging(ref DateTime newValue); + /// + /// Sets the date which is shown in view and is highlighted. By default it is the current date. + /// + [Parameter] + public DateTime ActiveDate + { + get { return this._activeDate; } + set + { + if (this._activeDate != value || !IsPropDirty("ActiveDate")) + { + MarkPropDirty("ActiveDate"); + } + this._activeDate = value; + + } + } + private bool _hideOutsideDays = false; + + partial void OnHideOutsideDaysChanging(ref bool newValue); + /// + /// Whether to show the dates that do not belong to the current active month. + /// + [Parameter] + public bool HideOutsideDays + { + get { return this._hideOutsideDays; } + set + { + if (this._hideOutsideDays != value || !IsPropDirty("HideOutsideDays")) + { + MarkPropDirty("HideOutsideDays"); + } + this._hideOutsideDays = value; + + } + } + private bool _hideHeader = false; + + partial void OnHideHeaderChanging(ref bool newValue); + /// + /// Whether to render the calendar header part. + /// When the calendar selection is set to `multiple` the header is always hidden. + /// + [Parameter] + public bool HideHeader + { + get { return this._hideHeader; } + set + { + if (this._hideHeader != value || !IsPropDirty("HideHeader")) + { + MarkPropDirty("HideHeader"); + } + this._hideHeader = value; + + } + } + private CalendarHeaderOrientation _headerOrientation = CalendarHeaderOrientation.Horizontal; + + partial void OnHeaderOrientationChanging(ref CalendarHeaderOrientation newValue); + /// + /// The orientation of the calendar header. + /// + [Parameter] + public CalendarHeaderOrientation HeaderOrientation + { + get { return this._headerOrientation; } + set + { + if (this._headerOrientation != value || !IsPropDirty("HeaderOrientation")) + { + MarkPropDirty("HeaderOrientation"); + } + this._headerOrientation = value; + + } + } + private ContentOrientation _orientation = ContentOrientation.Horizontal; + + partial void OnOrientationChanging(ref ContentOrientation newValue); + /// + /// The orientation of the calendar months when more than one month + /// is being shown. + /// + [Parameter] + public ContentOrientation Orientation + { + get { return this._orientation; } + set + { + if (this._orientation != value || !IsPropDirty("Orientation")) + { + MarkPropDirty("Orientation"); + } + this._orientation = value; + + } + } + private double _visibleMonths = 0; + + partial void OnVisibleMonthsChanging(ref double newValue); + /// + /// The number of months displayed in the days view. + /// + [Parameter] + public double VisibleMonths + { + get { return this._visibleMonths; } + set + { + if (this._visibleMonths != value || !IsPropDirty("VisibleMonths")) + { + MarkPropDirty("VisibleMonths"); + } + this._visibleMonths = value; + + } + } + private CalendarActiveView _activeView = CalendarActiveView.Days; + + partial void OnActiveViewChanging(ref CalendarActiveView newValue); + /// + /// The current active view of the component. + /// + [Parameter] + public CalendarActiveView ActiveView + { + get { return this._activeView; } + set + { + if (this._activeView != value || !IsPropDirty("ActiveView")) + { + MarkPropDirty("ActiveView"); + } + this._activeView = value; + + } + } + private IgbCalendarFormatOptions _formatOptions; + + partial void OnFormatOptionsChanging(ref IgbCalendarFormatOptions newValue); + /// + /// The options used to format the months and the weekdays in the calendar views. + /// + [Parameter] + public IgbCalendarFormatOptions FormatOptions + { + get { return this._formatOptions; } + set + { + OnFormatOptionsChanging(ref value); + MarkPropDirty("FormatOptions"); + if (this._formatOptions != null) + { + this.DetachChild(this._formatOptions); + } + if (value != null) + { + this.AttachChild(value); + } + this._formatOptions = value; + } + + } + + partial void FindByNameCalendar(string name, ref object item); + public override object FindByName(string name) + { + + var baseResult = base.FindByName(name); + if (baseResult != null) + { + return baseResult; + } + + object item = null; + FindByNameCalendar(name, ref item); + if (item != null) + { + return item; + } + + return null; + } + + private EventCallback? _valueChanged = null; + [Parameter] + public EventCallback ValueChanged + { + get + { + return this._valueChanged != null ? this._valueChanged.Value : EventCallback.Empty; + } + set + { + if (!value.Equals(EventCallback.Empty)) + { + if (!CompareEventCallbacks(value, _valueChanged, ref eventCallbacksCache)) + { + this.EnsureChangeHandled(); + + _valueChanged = value; + } + } + else + { + _valueChanged = null; + } + } + } + + private EventCallback? _valuesChanged = null; + [Parameter] + public EventCallback ValuesChanged + { + get + { + return this._valuesChanged != null ? this._valuesChanged.Value : EventCallback.Empty; + } + set + { + if (!value.Equals(EventCallback.Empty)) + { + if (!CompareEventCallbacks(value, _valuesChanged, ref eventCallbacksCache)) + { + this.EnsureChangeHandled(); + + _valuesChanged = value; + } + } + else + { + _valuesChanged = null; + } + } + } + + private string _changeRef = null; + private string _changeScript = null; + [Parameter] + public string ChangeScript + { + + set + { + if (value != this._changeScript) + { + this._changeScript = value; + this.OnRefChanged("Change", null, value, true, false, (string refName, object oldValue, object newValue) => + { + this._changeRef = refName; + this.MarkPropDirty("ChangeRef"); + }); + } + } + get + { + return this._changeScript; + } + } + + partial void OnHandlingChange(IgbComponentDataValueChangedEventArgs args); + private EventCallback? _change = null; + [Parameter] + public EventCallback Change + { + get + { + return this._change != null ? this._change.Value : EventCallback.Empty; + } + set + { + if (!value.Equals(EventCallback.Empty)) + { + if (!CompareEventCallbacks(value, _change, ref eventCallbacksCache)) + { + _change = value; + this.SetHandler(this.Name, "Change", value, (args) => + { + OnHandlingChange(args); + + var newValueValue = default(DateTime); + + if (this.Selection == CalendarSelection.Single) + { + newValueValue = (DateTime)(args.Detail); + ; + OnEventUpdatingValue(this._value, ref newValueValue); + if (UseDirectRender) + { + //TODO: maybe we should be doing this for everything. Need to make sure we don't infinity bounce though. + this.Value = newValueValue; + } + else { - if (!IgbCalendarModule.IsLoadRequested(IgBlazor)) - { - IgbCalendarModule.Register(IgBlazor); - } + this._value = newValueValue; } + OnPropertyPropagatedOut(Name, "Value"); + } - protected override string ResolveDisplay() - { - return "inline-block"; - } + var newValueValues = default(DateTime[]); - protected override bool SupportsVisualChildren - { - get + if (this.Selection != CalendarSelection.Single) + { + newValueValues = (DateTime[])(DowncastArray(args.Detail)); + ; + OnEventUpdatingValues(this._values, ref newValueValues); + if (UseDirectRender) { - return true; + //TODO: maybe we should be doing this for everything. Need to make sure we don't infinity bounce though. + this.Values = newValueValues; } - } - - public IgbCalendar(): base() { - OnCreatedIgbCalendar(); - - - } - - partial void OnCreatedIgbCalendar(); - - private DateTime _value = DateTime.MinValue; - - partial void OnValueChanging(ref DateTime newValue); - [Parameter] - public DateTime Value - { - get { return this._value; } - set { - if (this._value != value || !IsPropDirty("Value")) { - MarkPropDirty("Value"); - } - this._value = value; - - } - } - public async Task GetCurrentValueAsync() - { - var iv = await InvokeMethod("p:Value", new object[] { }, new string[] { }); - return ReturnToDate(iv); - } - public DateTime GetCurrentValue() - { - var iv = InvokeMethodSync("p:Value", new object[] { }, new string[] { }); - return ReturnToDate(iv); - } - private DateTime[] _values; - - partial void OnValuesChanging(ref DateTime[] newValue); - [Parameter] - public DateTime[] Values - { - get { return this._values; } - set { - if (this._values != value || !IsPropDirty("Values")) { - MarkPropDirty("Values"); - } - this._values = value; - - } - } - public async Task GetCurrentValuesAsync() - { - var iv = await InvokeMethod("p:Values", new object[] { }, new string[] { }); - return ReturnToDateArray(iv); - } - public DateTime[] GetCurrentValues() - { - var iv = InvokeMethodSync("p:Values", new object[] { }, new string[] { }); - return ReturnToDateArray(iv); - } - private DateTime _activeDate = DateTime.MinValue; - - partial void OnActiveDateChanging(ref DateTime newValue); - /// - /// Sets the date which is shown in view and is highlighted. By default it is the current date. - /// - [Parameter] - public DateTime ActiveDate - { - get { return this._activeDate; } - set { - if (this._activeDate != value || !IsPropDirty("ActiveDate")) { - MarkPropDirty("ActiveDate"); - } - this._activeDate = value; - - } - } - private bool _hideOutsideDays = false; - - partial void OnHideOutsideDaysChanging(ref bool newValue); - /// - /// Whether to show the dates that do not belong to the current active month. - /// - [Parameter] - public bool HideOutsideDays - { - get { return this._hideOutsideDays; } - set { - if (this._hideOutsideDays != value || !IsPropDirty("HideOutsideDays")) { - MarkPropDirty("HideOutsideDays"); - } - this._hideOutsideDays = value; - - } - } - private bool _hideHeader = false; - - partial void OnHideHeaderChanging(ref bool newValue); - /// - /// Whether to render the calendar header part. - /// When the calendar selection is set to `multiple` the header is always hidden. - /// - [Parameter] - public bool HideHeader - { - get { return this._hideHeader; } - set { - if (this._hideHeader != value || !IsPropDirty("HideHeader")) { - MarkPropDirty("HideHeader"); - } - this._hideHeader = value; - - } - } - private CalendarHeaderOrientation _headerOrientation = CalendarHeaderOrientation.Horizontal; - - partial void OnHeaderOrientationChanging(ref CalendarHeaderOrientation newValue); - /// - /// The orientation of the calendar header. - /// - [Parameter] - public CalendarHeaderOrientation HeaderOrientation - { - get { return this._headerOrientation; } - set { - if (this._headerOrientation != value || !IsPropDirty("HeaderOrientation")) { - MarkPropDirty("HeaderOrientation"); - } - this._headerOrientation = value; - - } - } - private ContentOrientation _orientation = ContentOrientation.Horizontal; - - partial void OnOrientationChanging(ref ContentOrientation newValue); - /// - /// The orientation of the calendar months when more than one month - /// is being shown. - /// - [Parameter] - public ContentOrientation Orientation - { - get { return this._orientation; } - set { - if (this._orientation != value || !IsPropDirty("Orientation")) { - MarkPropDirty("Orientation"); - } - this._orientation = value; - - } - } - private double _visibleMonths = 0; - - partial void OnVisibleMonthsChanging(ref double newValue); - /// - /// The number of months displayed in the days view. - /// - [Parameter] - public double VisibleMonths - { - get { return this._visibleMonths; } - set { - if (this._visibleMonths != value || !IsPropDirty("VisibleMonths")) { - MarkPropDirty("VisibleMonths"); - } - this._visibleMonths = value; - - } - } - private CalendarActiveView _activeView = CalendarActiveView.Days; - - partial void OnActiveViewChanging(ref CalendarActiveView newValue); - /// - /// The current active view of the component. - /// - [Parameter] - public CalendarActiveView ActiveView - { - get { return this._activeView; } - set { - if (this._activeView != value || !IsPropDirty("ActiveView")) { - MarkPropDirty("ActiveView"); - } - this._activeView = value; - - } - } - private IgbCalendarFormatOptions _formatOptions; - - partial void OnFormatOptionsChanging(ref IgbCalendarFormatOptions newValue); - /// - /// The options used to format the months and the weekdays in the calendar views. - /// - [Parameter] - public IgbCalendarFormatOptions FormatOptions - { - get { return this._formatOptions; } - set { - OnFormatOptionsChanging(ref value); - MarkPropDirty("FormatOptions"); - if (this._formatOptions != null) { - this.DetachChild(this._formatOptions); - } - if (value != null) { - this.AttachChild(value); - } - this._formatOptions = value; - } - - } - - partial void FindByNameCalendar(string name, ref object item); - public override object FindByName(string name) - { - - var baseResult = base.FindByName(name); - if (baseResult != null) - { - return baseResult; - } - - object item = null; - FindByNameCalendar(name, ref item); - if (item != null) - { - return item; - } - - return null; - } - - private EventCallback? _valueChanged = null; - [Parameter] - public EventCallback ValueChanged - { - get - { - return this._valueChanged != null ? this._valueChanged.Value : EventCallback.Empty; - } - set - { - if (!value.Equals(EventCallback.Empty)) - { - if (!CompareEventCallbacks(value, _valueChanged, ref eventCallbacksCache)) - { - this.EnsureChangeHandled(); - - _valueChanged = value; - } - } - else - { - _valueChanged = null; - } - } - } - - private EventCallback? _valuesChanged = null; - [Parameter] - public EventCallback ValuesChanged - { - get - { - return this._valuesChanged != null ? this._valuesChanged.Value : EventCallback.Empty; - } - set - { - if (!value.Equals(EventCallback.Empty)) - { - if (!CompareEventCallbacks(value, _valuesChanged, ref eventCallbacksCache)) - { - this.EnsureChangeHandled(); - - _valuesChanged = value; - } - } - else - { - _valuesChanged = null; - } - } - } - - private string _changeRef = null; - private string _changeScript = null; - [Parameter] - public string ChangeScript { - - set - { - if (value != this._changeScript) - { - this._changeScript = value; - this.OnRefChanged("Change", null, value, true, false, (string refName, object oldValue, object newValue) => { - this._changeRef = refName; - this.MarkPropDirty("ChangeRef"); - }); - } - } - get - { - return this._changeScript; - } - } - - partial void OnHandlingChange(IgbComponentDataValueChangedEventArgs args); - private EventCallback? _change = null; - [Parameter] - public EventCallback Change - { - get - { - return this._change != null ? this._change.Value : EventCallback.Empty; - } - set - { - if (!value.Equals(EventCallback.Empty)) - { - if (!CompareEventCallbacks(value, _change, ref eventCallbacksCache)) - { - _change = value; - this.SetHandler(this.Name, "Change", value, (args) => { - OnHandlingChange(args); - - var newValueValue = default(DateTime); - - if (this.Selection == CalendarSelection.Single) - { - newValueValue = (DateTime)(args.Detail); - ; - OnEventUpdatingValue(this._value, ref newValueValue); - if (UseDirectRender) { - //TODO: maybe we should be doing this for everything. Need to make sure we don't infinity bounce though. - this.Value = newValueValue; - } else { - this._value = newValueValue; - } - OnPropertyPropagatedOut(Name, "Value"); - } - - var newValueValues = default(DateTime[]); - - if (this.Selection != CalendarSelection.Single) - { - newValueValues = (DateTime[])(DowncastArray(args.Detail)); - ; - OnEventUpdatingValues(this._values, ref newValueValues); - if (UseDirectRender) { - //TODO: maybe we should be doing this for everything. Need to make sure we don't infinity bounce though. - this.Values = newValueValues; - } else { - this._values = newValueValues; - } - OnPropertyPropagatedOut(Name, "Values"); - } - - if (!EventCallback.Empty.Equals(ValueChanged)) - { - var task = ValueChanged.InvokeAsync(newValueValue); - if (task.Exception != null) - { - throw task.Exception; - } - } - - if (!EventCallback.Empty.Equals(ValuesChanged)) - { - var task = ValuesChanged.InvokeAsync(newValueValues); - if (task.Exception != null) - { - throw task.Exception; - } - } - - }); - this.OnRefChanged("Change", null, "event:::Change", true, false, (refName, oldValue, newValue) => { - this._changeRef = refName; - this.MarkPropDirty("ChangeRef"); - }); - } - } - else - { - _change = null; - this.SetHandler(this.Name, "Change", null); - this.OnRefChanged("Change", null, null, true, false, (refName, oldValue, newValue) => { - this._changeRef = null; - this.MarkPropDirty("ChangeRef"); - }); - } - } - } - internal void EnsureChangeHandled() - { - if (EventCallback.Empty.Equals(this.Change)) - { - this.Change = new EventCallback(null, (Action)((e) => { })); this._change = null; - } - } - - - partial void OnEventUpdatingValue(DateTime oldValue, ref DateTime newValue); - - partial void OnEventUpdatingValues(DateTime[] oldValue, ref DateTime[] newValue); - - partial void SerializeCoreIgbCalendar(RendererSerializer ser); - - internal override void SerializeCore(RendererSerializer ser) - { - base.SerializeCore(ser); - - SerializeCoreIgbCalendar(ser); - - if (IsPropDirty("Value")) { ser.AddDateTimeProp("value", this._value); } - if (IsPropDirty("Values")) { ser.AddDateArrayProp("values", this._values); } - if (IsPropDirty("ActiveDate")) { ser.AddDateTimeProp("activeDate", this._activeDate); } - if (IsPropDirty("HideOutsideDays")) { ser.AddBooleanProp("hideOutsideDays", this._hideOutsideDays); } - if (IsPropDirty("HideHeader")) { ser.AddBooleanProp("hideHeader", this._hideHeader); } - if (IsPropDirty("HeaderOrientation")) { ser.AddEnumProp("headerOrientation", this._headerOrientation); } - if (IsPropDirty("Orientation")) { ser.AddEnumProp("orientation", this._orientation); } - if (IsPropDirty("VisibleMonths")) { ser.AddNumberProp("visibleMonths", this._visibleMonths); } - if (IsPropDirty("ActiveView")) { ser.AddEnumProp("activeView", this._activeView); } - if (IsPropDirty("FormatOptions")) { ser.AddSerializableProp("formatOptions", this._formatOptions); } - if (IsPropDirty("ChangeRef")) { ser.AddStringProp("changeRef", this._changeRef); } - - } - -} + else + { + this._values = newValueValues; + } + OnPropertyPropagatedOut(Name, "Values"); + } + + if (!EventCallback.Empty.Equals(ValueChanged)) + { + var task = ValueChanged.InvokeAsync(newValueValue); + if (task.Exception != null) + { + throw task.Exception; + } + } + + if (!EventCallback.Empty.Equals(ValuesChanged)) + { + var task = ValuesChanged.InvokeAsync(newValueValues); + if (task.Exception != null) + { + throw task.Exception; + } + } + + }); + this.OnRefChanged("Change", null, "event:::Change", true, false, (refName, oldValue, newValue) => + { + this._changeRef = refName; + this.MarkPropDirty("ChangeRef"); + }); + } + } + else + { + _change = null; + this.SetHandler(this.Name, "Change", null); + this.OnRefChanged("Change", null, null, true, false, (refName, oldValue, newValue) => + { + this._changeRef = null; + this.MarkPropDirty("ChangeRef"); + }); + } + } + } + internal void EnsureChangeHandled() + { + if (EventCallback.Empty.Equals(this.Change)) + { + this.Change = new EventCallback(null, (Action)((e) => { })); + this._change = null; + } + } + + partial void OnEventUpdatingValue(DateTime oldValue, ref DateTime newValue); + + partial void OnEventUpdatingValues(DateTime[] oldValue, ref DateTime[] newValue); + + partial void SerializeCoreIgbCalendar(RendererSerializer ser); + + internal override void SerializeCore(RendererSerializer ser) + { + base.SerializeCore(ser); + + SerializeCoreIgbCalendar(ser); + + if (IsPropDirty("Value")) + { ser.AddDateTimeProp("value", this._value); } + if (IsPropDirty("Values")) + { ser.AddDateArrayProp("values", this._values); } + if (IsPropDirty("ActiveDate")) + { ser.AddDateTimeProp("activeDate", this._activeDate); } + if (IsPropDirty("HideOutsideDays")) + { ser.AddBooleanProp("hideOutsideDays", this._hideOutsideDays); } + if (IsPropDirty("HideHeader")) + { ser.AddBooleanProp("hideHeader", this._hideHeader); } + if (IsPropDirty("HeaderOrientation")) + { ser.AddEnumProp("headerOrientation", this._headerOrientation); } + if (IsPropDirty("Orientation")) + { ser.AddEnumProp("orientation", this._orientation); } + if (IsPropDirty("VisibleMonths")) + { ser.AddNumberProp("visibleMonths", this._visibleMonths); } + if (IsPropDirty("ActiveView")) + { ser.AddEnumProp("activeView", this._activeView); } + if (IsPropDirty("FormatOptions")) + { ser.AddSerializableProp("formatOptions", this._formatOptions); } + if (IsPropDirty("ChangeRef")) + { ser.AddStringProp("changeRef", this._changeRef); } + + } + + } } diff --git a/src/components/Blazor/CalendarActiveView.cs b/src/components/Blazor/CalendarActiveView.cs index 76397c8c..5846b1ba 100644 --- a/src/components/Blazor/CalendarActiveView.cs +++ b/src/components/Blazor/CalendarActiveView.cs @@ -1,9 +1,10 @@ namespace IgniteUI.Blazor.Controls { -public enum CalendarActiveView { - Days, - Months, - Years + public enum CalendarActiveView + { + Days, + Months, + Years -} + } } diff --git a/src/components/Blazor/CalendarBase.cs b/src/components/Blazor/CalendarBase.cs index 6f7b7c94..52fa0628 100644 --- a/src/components/Blazor/CalendarBase.cs +++ b/src/components/Blazor/CalendarBase.cs @@ -1,219 +1,236 @@ - -using System; using Microsoft.AspNetCore.Components; -using Microsoft.AspNetCore.Components.Rendering; -using System.Threading.Tasks; -using System.Collections.Generic; -using System.Linq; namespace IgniteUI.Blazor.Controls { - public partial class IgbCalendarBase: BaseRendererControl { - public override string Type { get { return "WebCalendarBase"; } } - - protected override void EnsureModulesLoaded() - { - if (!IgbCalendarBaseModule.IsLoadRequested(IgBlazor)) - { - IgbCalendarBaseModule.Register(IgBlazor); - } - } - - protected override string ResolveDisplay() - { - return "inline-block"; - } - - protected override ControlEventBehavior DefaultEventBehavior - { - get { return ControlEventBehavior.Queued; } - } - - public IgbCalendarBase(): base() { - OnCreatedIgbCalendarBase(); - - - } - - partial void OnCreatedIgbCalendarBase(); - - private CalendarSelection _selection = CalendarSelection.Single; - - partial void OnSelectionChanging(ref CalendarSelection newValue); - /// - /// Sets the type of selection in the component. - /// - [Parameter] - public CalendarSelection Selection - { - get { return this._selection; } - set { - if (this._selection != value || !IsPropDirty("Selection")) { - MarkPropDirty("Selection"); - } - this._selection = value; - - } - } - private bool _showWeekNumbers = false; - - partial void OnShowWeekNumbersChanging(ref bool newValue); - /// - /// Whether to show the week numbers. - /// - [Parameter] - public bool ShowWeekNumbers - { - get { return this._showWeekNumbers; } - set { - if (this._showWeekNumbers != value || !IsPropDirty("ShowWeekNumbers")) { - MarkPropDirty("ShowWeekNumbers"); - } - this._showWeekNumbers = value; - - } - } - private WeekDays _weekStart = WeekDays.Sunday; - - partial void OnWeekStartChanging(ref WeekDays newValue); - /// - /// Gets/Sets the first day of the week. - /// - [Parameter] - public WeekDays WeekStart - { - get { return this._weekStart; } - set { - if (this._weekStart != value || !IsPropDirty("WeekStart")) { - MarkPropDirty("WeekStart"); - } - this._weekStart = value; - - } - } - private string _locale; - - partial void OnLocaleChanging(ref string newValue); - /// - /// Gets/Sets the locale used for formatting and displaying the dates in the component. - /// - [Parameter] - public string Locale - { - get { return this._locale; } - set { - if (this._locale != value || !IsPropDirty("Locale")) { - MarkPropDirty("Locale"); - } - this._locale = value; - - } - } - private IgbCalendarResourceStrings _resourceStrings; - - partial void OnResourceStringsChanging(ref IgbCalendarResourceStrings newValue); - /// - /// The resource strings for localization. - /// - [Parameter] - public IgbCalendarResourceStrings ResourceStrings - { - get { return this._resourceStrings; } - set { - OnResourceStringsChanging(ref value); - MarkPropDirty("ResourceStrings"); - if (this._resourceStrings != null) { - this.DetachChild(this._resourceStrings); - } - if (value != null) { - this.AttachChild(value); - } - this._resourceStrings = value; - } - - } - private IgbDateRangeDescriptor[]? _specialDates; - - partial void OnSpecialDatesChanging(ref IgbDateRangeDescriptor[]? newValue); - /// - /// Gets/Sets the special dates for the component. - /// - [Parameter] - public IgbDateRangeDescriptor[]? SpecialDates - { - get { return this._specialDates; } - set { - if (this._specialDates != value || !IsPropDirty("SpecialDates")) { - MarkPropDirty("SpecialDates"); - } - this._specialDates = value; - - } - } - private IgbDateRangeDescriptor[]? _disabledDates; - - partial void OnDisabledDatesChanging(ref IgbDateRangeDescriptor[]? newValue); - /// - /// Gets/Sets the disabled dates for the component. - /// - [Parameter] - public IgbDateRangeDescriptor[]? DisabledDates - { - get { return this._disabledDates; } - set { - if (this._disabledDates != value || !IsPropDirty("DisabledDates")) { - MarkPropDirty("DisabledDates"); - } - this._disabledDates = value; - - } - } - - partial void FindByNameCalendarBase(string name, ref object item); - public override object FindByName(string name) - { - - var baseResult = base.FindByName(name); - if (baseResult != null) - { - return baseResult; - } - - object item = null; - FindByNameCalendarBase(name, ref item); - if (item != null) - { - return item; - } - - return null; - } - public async Task SetNativeElementAsync(Object element) - { - await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); - } - public void SetNativeElement(Object element) - { - InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); - } - - partial void SerializeCoreIgbCalendarBase(RendererSerializer ser); - - internal override void SerializeCore(RendererSerializer ser) - { - base.SerializeCore(ser); - - SerializeCoreIgbCalendarBase(ser); - - if (IsPropDirty("Selection")) { ser.AddEnumProp("selection", this._selection); } - if (IsPropDirty("ShowWeekNumbers")) { ser.AddBooleanProp("showWeekNumbers", this._showWeekNumbers); } - if (IsPropDirty("WeekStart")) { ser.AddEnumProp("weekStart", this._weekStart); } - if (IsPropDirty("Locale")) { ser.AddStringProp("locale", this._locale); } - if (IsPropDirty("ResourceStrings")) { ser.AddSerializableProp("resourceStrings", this._resourceStrings); } - if (IsPropDirty("SpecialDates")) { ser.AddSerializableArrayProp("specialDates", this._specialDates); } - if (IsPropDirty("DisabledDates")) { ser.AddSerializableArrayProp("disabledDates", this._disabledDates); } - - } - -} + public partial class IgbCalendarBase : BaseRendererControl + { + public override string Type { get { return "WebCalendarBase"; } } + + protected override void EnsureModulesLoaded() + { + if (!IgbCalendarBaseModule.IsLoadRequested(IgBlazor)) + { + IgbCalendarBaseModule.Register(IgBlazor); + } + } + + protected override string ResolveDisplay() + { + return "inline-block"; + } + + protected override ControlEventBehavior DefaultEventBehavior + { + get { return ControlEventBehavior.Queued; } + } + + public IgbCalendarBase() : base() + { + OnCreatedIgbCalendarBase(); + + } + + partial void OnCreatedIgbCalendarBase(); + + private CalendarSelection _selection = CalendarSelection.Single; + + partial void OnSelectionChanging(ref CalendarSelection newValue); + /// + /// Sets the type of selection in the component. + /// + [Parameter] + public CalendarSelection Selection + { + get { return this._selection; } + set + { + if (this._selection != value || !IsPropDirty("Selection")) + { + MarkPropDirty("Selection"); + } + this._selection = value; + + } + } + private bool _showWeekNumbers = false; + + partial void OnShowWeekNumbersChanging(ref bool newValue); + /// + /// Whether to show the week numbers. + /// + [Parameter] + public bool ShowWeekNumbers + { + get { return this._showWeekNumbers; } + set + { + if (this._showWeekNumbers != value || !IsPropDirty("ShowWeekNumbers")) + { + MarkPropDirty("ShowWeekNumbers"); + } + this._showWeekNumbers = value; + + } + } + private WeekDays _weekStart = WeekDays.Sunday; + + partial void OnWeekStartChanging(ref WeekDays newValue); + /// + /// Gets/Sets the first day of the week. + /// + [Parameter] + public WeekDays WeekStart + { + get { return this._weekStart; } + set + { + if (this._weekStart != value || !IsPropDirty("WeekStart")) + { + MarkPropDirty("WeekStart"); + } + this._weekStart = value; + + } + } + private string _locale; + + partial void OnLocaleChanging(ref string newValue); + /// + /// Gets/Sets the locale used for formatting and displaying the dates in the component. + /// + [Parameter] + public string Locale + { + get { return this._locale; } + set + { + if (this._locale != value || !IsPropDirty("Locale")) + { + MarkPropDirty("Locale"); + } + this._locale = value; + + } + } + private IgbCalendarResourceStrings _resourceStrings; + + partial void OnResourceStringsChanging(ref IgbCalendarResourceStrings newValue); + /// + /// The resource strings for localization. + /// + [Parameter] + public IgbCalendarResourceStrings ResourceStrings + { + get { return this._resourceStrings; } + set + { + OnResourceStringsChanging(ref value); + MarkPropDirty("ResourceStrings"); + if (this._resourceStrings != null) + { + this.DetachChild(this._resourceStrings); + } + if (value != null) + { + this.AttachChild(value); + } + this._resourceStrings = value; + } + + } + private IgbDateRangeDescriptor[]? _specialDates; + + partial void OnSpecialDatesChanging(ref IgbDateRangeDescriptor[]? newValue); + /// + /// Gets/Sets the special dates for the component. + /// + [Parameter] + public IgbDateRangeDescriptor[]? SpecialDates + { + get { return this._specialDates; } + set + { + if (this._specialDates != value || !IsPropDirty("SpecialDates")) + { + MarkPropDirty("SpecialDates"); + } + this._specialDates = value; + + } + } + private IgbDateRangeDescriptor[]? _disabledDates; + + partial void OnDisabledDatesChanging(ref IgbDateRangeDescriptor[]? newValue); + /// + /// Gets/Sets the disabled dates for the component. + /// + [Parameter] + public IgbDateRangeDescriptor[]? DisabledDates + { + get { return this._disabledDates; } + set + { + if (this._disabledDates != value || !IsPropDirty("DisabledDates")) + { + MarkPropDirty("DisabledDates"); + } + this._disabledDates = value; + + } + } + + partial void FindByNameCalendarBase(string name, ref object item); + public override object FindByName(string name) + { + + var baseResult = base.FindByName(name); + if (baseResult != null) + { + return baseResult; + } + + object item = null; + FindByNameCalendarBase(name, ref item); + if (item != null) + { + return item; + } + + return null; + } + public async Task SetNativeElementAsync(Object element) + { + await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + } + public void SetNativeElement(Object element) + { + InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + } + + partial void SerializeCoreIgbCalendarBase(RendererSerializer ser); + + internal override void SerializeCore(RendererSerializer ser) + { + base.SerializeCore(ser); + + SerializeCoreIgbCalendarBase(ser); + + if (IsPropDirty("Selection")) + { ser.AddEnumProp("selection", this._selection); } + if (IsPropDirty("ShowWeekNumbers")) + { ser.AddBooleanProp("showWeekNumbers", this._showWeekNumbers); } + if (IsPropDirty("WeekStart")) + { ser.AddEnumProp("weekStart", this._weekStart); } + if (IsPropDirty("Locale")) + { ser.AddStringProp("locale", this._locale); } + if (IsPropDirty("ResourceStrings")) + { ser.AddSerializableProp("resourceStrings", this._resourceStrings); } + if (IsPropDirty("SpecialDates")) + { ser.AddSerializableArrayProp("specialDates", this._specialDates); } + if (IsPropDirty("DisabledDates")) + { ser.AddSerializableArrayProp("disabledDates", this._disabledDates); } + + } + + } } diff --git a/src/components/Blazor/CalendarBaseModule.cs b/src/components/Blazor/CalendarBaseModule.cs index e2fd005a..5bacf65f 100644 --- a/src/components/Blazor/CalendarBaseModule.cs +++ b/src/components/Blazor/CalendarBaseModule.cs @@ -1,23 +1,20 @@ -using System; -using System.Collections.Generic; -using System.Runtime.CompilerServices; -using System.Text; -using System.Collections.Generic; - namespace IgniteUI.Blazor.Controls { - public partial class IgbCalendarBaseModule { - public static void Register(IIgniteUIBlazor runtime) { + public partial class IgbCalendarBaseModule + { + public static void Register(IIgniteUIBlazor runtime) + { ModuleLoader.Load(runtime, "WebCalendarBaseModule"); - } - public static void MarkIsLoadRequested(IIgniteUIBlazor runtime) { + public static void MarkIsLoadRequested(IIgniteUIBlazor runtime) + { ModuleLoader.MarkIsLoadRequested(runtime, "WebCalendarBaseModule"); } - public static bool IsLoadRequested(IIgniteUIBlazor runtime) { + public static bool IsLoadRequested(IIgniteUIBlazor runtime) + { return ModuleLoader.IsLoadRequested(runtime, "WebCalendarBaseModule"); } } diff --git a/src/components/Blazor/CalendarDate.cs b/src/components/Blazor/CalendarDate.cs index 8e3abd4e..007dbe58 100644 --- a/src/components/Blazor/CalendarDate.cs +++ b/src/components/Blazor/CalendarDate.cs @@ -1,148 +1,160 @@ - -using System; using Microsoft.AspNetCore.Components; -using Microsoft.AspNetCore.Components.Rendering; -using System.Threading.Tasks; -using System.Collections.Generic; -using System.Linq; namespace IgniteUI.Blazor.Controls { - public partial class IgbCalendarDate: BaseRendererElement { - public override string Type { get { return "CalendarDate"; } } - - - private static bool _marshalByValue = true; - - public IgbCalendarDate(): base() { - OnCreatedIgbCalendarDate(); - - - } - - partial void OnCreatedIgbCalendarDate(); - - private DateTime _date = DateTime.MinValue; - - partial void OnDateChanging(ref DateTime newValue); - [Parameter] - public DateTime Date - { - get { return this._date; } - set { - if (this._date != value || !IsPropDirty("Date")) { - MarkPropDirty("Date"); - } - this._date = value; - - } - } - private bool _isCurrentMonth = false; - - partial void OnIsCurrentMonthChanging(ref bool newValue); - [Parameter] - public bool IsCurrentMonth - { - get { return this._isCurrentMonth; } - set { - if (this._isCurrentMonth != value || !IsPropDirty("IsCurrentMonth")) { - MarkPropDirty("IsCurrentMonth"); - } - this._isCurrentMonth = value; - - } - } - private bool _isPrevMonth = false; - - partial void OnIsPrevMonthChanging(ref bool newValue); - [Parameter] - public bool IsPrevMonth - { - get { return this._isPrevMonth; } - set { - if (this._isPrevMonth != value || !IsPropDirty("IsPrevMonth")) { - MarkPropDirty("IsPrevMonth"); - } - this._isPrevMonth = value; - - } - } - private bool _isNextMonth = false; - - partial void OnIsNextMonthChanging(ref bool newValue); - [Parameter] - public bool IsNextMonth - { - get { return this._isNextMonth; } - set { - if (this._isNextMonth != value || !IsPropDirty("IsNextMonth")) { - MarkPropDirty("IsNextMonth"); - } - this._isNextMonth = value; - - } - } - - partial void FindByNameCalendarDate(string name, ref object item); - public override object FindByName(string name) - { - - var baseResult = base.FindByName(name); - if (baseResult != null) - { - return baseResult; - } - - object item = null; - FindByNameCalendarDate(name, ref item); - if (item != null) - { - return item; - } - - return null; - } - - partial void SerializeCoreIgbCalendarDate(RendererSerializer ser); - - internal override void SerializeCore(RendererSerializer ser) - { - base.SerializeCore(ser); - - SerializeCoreIgbCalendarDate(ser); - - if (IsPropDirty("Date")) { ser.AddDateTimeProp("date", this._date); } - if (IsPropDirty("IsCurrentMonth")) { ser.AddBooleanProp("isCurrentMonth", this._isCurrentMonth); } - if (IsPropDirty("IsPrevMonth")) { ser.AddBooleanProp("isPrevMonth", this._isPrevMonth); } - if (IsPropDirty("IsNextMonth")) { ser.AddBooleanProp("isNextMonth", this._isNextMonth); } - - } - - - protected internal override void ToEventJson(BaseRendererControl control, Dictionary args) - { - base.ToEventJson(control, args); - - if (IsPropDirty("Date")) { args["date"] = DateToString(this._date); } - if (IsPropDirty("IsCurrentMonth")) { args["isCurrentMonth"] = (this._isCurrentMonth).ToString().ToLower(); } - if (IsPropDirty("IsPrevMonth")) { args["isPrevMonth"] = (this._isPrevMonth).ToString().ToLower(); } - if (IsPropDirty("IsNextMonth")) { args["isNextMonth"] = (this._isNextMonth).ToString().ToLower(); } - - - } - - - protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) { - base.FromEventJson(control, args); - this.SuppressParentNotify = true; - - if (args.ContainsKey("date")) { this.Date = ReturnToDate(args["date"]); } - if (args.ContainsKey("isCurrentMonth")) { this.IsCurrentMonth = ReturnToBoolean(args["isCurrentMonth"]); } - if (args.ContainsKey("isPrevMonth")) { this.IsPrevMonth = ReturnToBoolean(args["isPrevMonth"]); } - if (args.ContainsKey("isNextMonth")) { this.IsNextMonth = ReturnToBoolean(args["isNextMonth"]); } - - this.SuppressParentNotify = false; - } - -} + public partial class IgbCalendarDate : BaseRendererElement + { + public override string Type { get { return "CalendarDate"; } } + + private static bool _marshalByValue = true; + + public IgbCalendarDate() : base() + { + OnCreatedIgbCalendarDate(); + + } + + partial void OnCreatedIgbCalendarDate(); + + private DateTime _date = DateTime.MinValue; + + partial void OnDateChanging(ref DateTime newValue); + [Parameter] + public DateTime Date + { + get { return this._date; } + set + { + if (this._date != value || !IsPropDirty("Date")) + { + MarkPropDirty("Date"); + } + this._date = value; + + } + } + private bool _isCurrentMonth = false; + + partial void OnIsCurrentMonthChanging(ref bool newValue); + [Parameter] + public bool IsCurrentMonth + { + get { return this._isCurrentMonth; } + set + { + if (this._isCurrentMonth != value || !IsPropDirty("IsCurrentMonth")) + { + MarkPropDirty("IsCurrentMonth"); + } + this._isCurrentMonth = value; + + } + } + private bool _isPrevMonth = false; + + partial void OnIsPrevMonthChanging(ref bool newValue); + [Parameter] + public bool IsPrevMonth + { + get { return this._isPrevMonth; } + set + { + if (this._isPrevMonth != value || !IsPropDirty("IsPrevMonth")) + { + MarkPropDirty("IsPrevMonth"); + } + this._isPrevMonth = value; + + } + } + private bool _isNextMonth = false; + + partial void OnIsNextMonthChanging(ref bool newValue); + [Parameter] + public bool IsNextMonth + { + get { return this._isNextMonth; } + set + { + if (this._isNextMonth != value || !IsPropDirty("IsNextMonth")) + { + MarkPropDirty("IsNextMonth"); + } + this._isNextMonth = value; + + } + } + + partial void FindByNameCalendarDate(string name, ref object item); + public override object FindByName(string name) + { + + var baseResult = base.FindByName(name); + if (baseResult != null) + { + return baseResult; + } + + object item = null; + FindByNameCalendarDate(name, ref item); + if (item != null) + { + return item; + } + + return null; + } + + partial void SerializeCoreIgbCalendarDate(RendererSerializer ser); + + internal override void SerializeCore(RendererSerializer ser) + { + base.SerializeCore(ser); + + SerializeCoreIgbCalendarDate(ser); + + if (IsPropDirty("Date")) + { ser.AddDateTimeProp("date", this._date); } + if (IsPropDirty("IsCurrentMonth")) + { ser.AddBooleanProp("isCurrentMonth", this._isCurrentMonth); } + if (IsPropDirty("IsPrevMonth")) + { ser.AddBooleanProp("isPrevMonth", this._isPrevMonth); } + if (IsPropDirty("IsNextMonth")) + { ser.AddBooleanProp("isNextMonth", this._isNextMonth); } + + } + + protected internal override void ToEventJson(BaseRendererControl control, Dictionary args) + { + base.ToEventJson(control, args); + + if (IsPropDirty("Date")) + { args["date"] = DateToString(this._date); } + if (IsPropDirty("IsCurrentMonth")) + { args["isCurrentMonth"] = (this._isCurrentMonth).ToString().ToLower(); } + if (IsPropDirty("IsPrevMonth")) + { args["isPrevMonth"] = (this._isPrevMonth).ToString().ToLower(); } + if (IsPropDirty("IsNextMonth")) + { args["isNextMonth"] = (this._isNextMonth).ToString().ToLower(); } + + } + + protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) + { + base.FromEventJson(control, args); + this.SuppressParentNotify = true; + + if (args.ContainsKey("date")) + { this.Date = ReturnToDate(args["date"]); } + if (args.ContainsKey("isCurrentMonth")) + { this.IsCurrentMonth = ReturnToBoolean(args["isCurrentMonth"]); } + if (args.ContainsKey("isPrevMonth")) + { this.IsPrevMonth = ReturnToBoolean(args["isPrevMonth"]); } + if (args.ContainsKey("isNextMonth")) + { this.IsNextMonth = ReturnToBoolean(args["isNextMonth"]); } + + this.SuppressParentNotify = false; + } + + } } diff --git a/src/components/Blazor/CalendarDateEventArgs.cs b/src/components/Blazor/CalendarDateEventArgs.cs index a64ac619..0f3186cf 100644 --- a/src/components/Blazor/CalendarDateEventArgs.cs +++ b/src/components/Blazor/CalendarDateEventArgs.cs @@ -1,97 +1,95 @@ - -using System; using Microsoft.AspNetCore.Components; -using Microsoft.AspNetCore.Components.Rendering; -using System.Threading.Tasks; -using System.Collections.Generic; -using System.Linq; namespace IgniteUI.Blazor.Controls { - public partial class IgbCalendarDateEventArgs: BaseRendererElement { - public override string Type { get { return "WebCalendarDateEventArgs"; } } - - - public IgbCalendarDateEventArgs(): base() { - OnCreatedIgbCalendarDateEventArgs(); - - - } - - partial void OnCreatedIgbCalendarDateEventArgs(); - - private IgbCalendarDate _detail; - - partial void OnDetailChanging(ref IgbCalendarDate newValue); - [Parameter] - public IgbCalendarDate Detail - { - get { return this._detail; } - set { - OnDetailChanging(ref value); - MarkPropDirty("Detail"); - if (this._detail != null) { - this.DetachChild(this._detail); - } - if (value != null) { - this.AttachChild(value); - } - this._detail = value; - } - - } - - partial void FindByNameCalendarDateEventArgs(string name, ref object item); - public override object FindByName(string name) - { - - var baseResult = base.FindByName(name); - if (baseResult != null) - { - return baseResult; - } - - object item = null; - FindByNameCalendarDateEventArgs(name, ref item); - if (item != null) - { - return item; - } - - return null; - } - - partial void SerializeCoreIgbCalendarDateEventArgs(RendererSerializer ser); - - internal override void SerializeCore(RendererSerializer ser) - { - base.SerializeCore(ser); - - SerializeCoreIgbCalendarDateEventArgs(ser); - - if (IsPropDirty("Detail")) { ser.AddSerializableProp("detail", this._detail); } - - } - - - protected internal override void ToEventJson(BaseRendererControl control, Dictionary args) - { - base.ToEventJson(control, args); - - if (IsPropDirty("Detail")) { args["detail"] = ObjectToParam(this._detail); } - - - } - - - protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) { - base.FromEventJson(control, args); - this.SuppressParentNotify = true; - - if (args.ContainsKey("detail")) { this.Detail = (IgbCalendarDate)ConvertReturnValue(args["detail"], "CalendarDate", true); } - - this.SuppressParentNotify = false; - } - -} + public partial class IgbCalendarDateEventArgs : BaseRendererElement + { + public override string Type { get { return "WebCalendarDateEventArgs"; } } + + public IgbCalendarDateEventArgs() : base() + { + OnCreatedIgbCalendarDateEventArgs(); + + } + + partial void OnCreatedIgbCalendarDateEventArgs(); + + private IgbCalendarDate _detail; + + partial void OnDetailChanging(ref IgbCalendarDate newValue); + [Parameter] + public IgbCalendarDate Detail + { + get { return this._detail; } + set + { + OnDetailChanging(ref value); + MarkPropDirty("Detail"); + if (this._detail != null) + { + this.DetachChild(this._detail); + } + if (value != null) + { + this.AttachChild(value); + } + this._detail = value; + } + + } + + partial void FindByNameCalendarDateEventArgs(string name, ref object item); + public override object FindByName(string name) + { + + var baseResult = base.FindByName(name); + if (baseResult != null) + { + return baseResult; + } + + object item = null; + FindByNameCalendarDateEventArgs(name, ref item); + if (item != null) + { + return item; + } + + return null; + } + + partial void SerializeCoreIgbCalendarDateEventArgs(RendererSerializer ser); + + internal override void SerializeCore(RendererSerializer ser) + { + base.SerializeCore(ser); + + SerializeCoreIgbCalendarDateEventArgs(ser); + + if (IsPropDirty("Detail")) + { ser.AddSerializableProp("detail", this._detail); } + + } + + protected internal override void ToEventJson(BaseRendererControl control, Dictionary args) + { + base.ToEventJson(control, args); + + if (IsPropDirty("Detail")) + { args["detail"] = ObjectToParam(this._detail); } + + } + + protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) + { + base.FromEventJson(control, args); + this.SuppressParentNotify = true; + + if (args.ContainsKey("detail")) + { this.Detail = (IgbCalendarDate)ConvertReturnValue(args["detail"], "CalendarDate", true); } + + this.SuppressParentNotify = false; + } + + } } diff --git a/src/components/Blazor/CalendarFormatOptions.cs b/src/components/Blazor/CalendarFormatOptions.cs index 71e45225..78c77634 100644 --- a/src/components/Blazor/CalendarFormatOptions.cs +++ b/src/components/Blazor/CalendarFormatOptions.cs @@ -1,112 +1,114 @@ - -using System; using Microsoft.AspNetCore.Components; -using Microsoft.AspNetCore.Components.Rendering; -using System.Threading.Tasks; -using System.Collections.Generic; -using System.Linq; namespace IgniteUI.Blazor.Controls { - public partial class IgbCalendarFormatOptions: BaseRendererElement { - public override string Type { get { return "CalendarFormatOptions"; } } - - - private static bool _marshalByValue = true; - - public IgbCalendarFormatOptions(): base() { - OnCreatedIgbCalendarFormatOptions(); - - - } - - partial void OnCreatedIgbCalendarFormatOptions(); - - private string _weekday; - - partial void OnWeekdayChanging(ref string newValue); - [Parameter] - public string Weekday - { - get { return this._weekday; } - set { - if (this._weekday != value || !IsPropDirty("Weekday")) { - MarkPropDirty("Weekday"); - } - this._weekday = value; - - } - } - private string _month; - - partial void OnMonthChanging(ref string newValue); - [Parameter] - public string Month - { - get { return this._month; } - set { - if (this._month != value || !IsPropDirty("Month")) { - MarkPropDirty("Month"); - } - this._month = value; - - } - } - - partial void FindByNameCalendarFormatOptions(string name, ref object item); - public override object FindByName(string name) - { - - var baseResult = base.FindByName(name); - if (baseResult != null) - { - return baseResult; - } - - object item = null; - FindByNameCalendarFormatOptions(name, ref item); - if (item != null) - { - return item; - } - - return null; - } - - partial void SerializeCoreIgbCalendarFormatOptions(RendererSerializer ser); - - internal override void SerializeCore(RendererSerializer ser) - { - base.SerializeCore(ser); - - SerializeCoreIgbCalendarFormatOptions(ser); - - if (IsPropDirty("Weekday")) { ser.AddStringProp("weekday", this._weekday); } - if (IsPropDirty("Month")) { ser.AddStringProp("month", this._month); } - - } - - - protected internal override void ToEventJson(BaseRendererControl control, Dictionary args) - { - base.ToEventJson(control, args); - - if (IsPropDirty("Weekday")) { args["weekday"] = this._weekday; } - if (IsPropDirty("Month")) { args["month"] = this._month; } - - - } - - - protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) { - base.FromEventJson(control, args); - this.SuppressParentNotify = true; - - if (args.ContainsKey("weekday")) { this.Weekday = ReturnToString(args["weekday"]); } - if (args.ContainsKey("month")) { this.Month = ReturnToString(args["month"]); } - - this.SuppressParentNotify = false; - } - -} + public partial class IgbCalendarFormatOptions : BaseRendererElement + { + public override string Type { get { return "CalendarFormatOptions"; } } + + private static bool _marshalByValue = true; + + public IgbCalendarFormatOptions() : base() + { + OnCreatedIgbCalendarFormatOptions(); + + } + + partial void OnCreatedIgbCalendarFormatOptions(); + + private string _weekday; + + partial void OnWeekdayChanging(ref string newValue); + [Parameter] + public string Weekday + { + get { return this._weekday; } + set + { + if (this._weekday != value || !IsPropDirty("Weekday")) + { + MarkPropDirty("Weekday"); + } + this._weekday = value; + + } + } + private string _month; + + partial void OnMonthChanging(ref string newValue); + [Parameter] + public string Month + { + get { return this._month; } + set + { + if (this._month != value || !IsPropDirty("Month")) + { + MarkPropDirty("Month"); + } + this._month = value; + + } + } + + partial void FindByNameCalendarFormatOptions(string name, ref object item); + public override object FindByName(string name) + { + + var baseResult = base.FindByName(name); + if (baseResult != null) + { + return baseResult; + } + + object item = null; + FindByNameCalendarFormatOptions(name, ref item); + if (item != null) + { + return item; + } + + return null; + } + + partial void SerializeCoreIgbCalendarFormatOptions(RendererSerializer ser); + + internal override void SerializeCore(RendererSerializer ser) + { + base.SerializeCore(ser); + + SerializeCoreIgbCalendarFormatOptions(ser); + + if (IsPropDirty("Weekday")) + { ser.AddStringProp("weekday", this._weekday); } + if (IsPropDirty("Month")) + { ser.AddStringProp("month", this._month); } + + } + + protected internal override void ToEventJson(BaseRendererControl control, Dictionary args) + { + base.ToEventJson(control, args); + + if (IsPropDirty("Weekday")) + { args["weekday"] = this._weekday; } + if (IsPropDirty("Month")) + { args["month"] = this._month; } + + } + + protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) + { + base.FromEventJson(control, args); + this.SuppressParentNotify = true; + + if (args.ContainsKey("weekday")) + { this.Weekday = ReturnToString(args["weekday"]); } + if (args.ContainsKey("month")) + { this.Month = ReturnToString(args["month"]); } + + this.SuppressParentNotify = false; + } + + } } diff --git a/src/components/Blazor/CalendarHeaderOrientation.cs b/src/components/Blazor/CalendarHeaderOrientation.cs index 858338b5..0ea4910a 100644 --- a/src/components/Blazor/CalendarHeaderOrientation.cs +++ b/src/components/Blazor/CalendarHeaderOrientation.cs @@ -1,8 +1,9 @@ namespace IgniteUI.Blazor.Controls { -public enum CalendarHeaderOrientation { - Horizontal, - Vertical + public enum CalendarHeaderOrientation + { + Horizontal, + Vertical -} + } } diff --git a/src/components/Blazor/CalendarModule.cs b/src/components/Blazor/CalendarModule.cs index 5fd1e4a7..ee873e43 100644 --- a/src/components/Blazor/CalendarModule.cs +++ b/src/components/Blazor/CalendarModule.cs @@ -1,24 +1,22 @@ -using System; -using System.Collections.Generic; -using System.Runtime.CompilerServices; -using System.Text; -using System.Collections.Generic; - namespace IgniteUI.Blazor.Controls { - public partial class IgbCalendarModule { - public static void Register(IIgniteUIBlazor runtime) { + public partial class IgbCalendarModule + { + public static void Register(IIgniteUIBlazor runtime) + { ModuleLoader.Load(runtime, "WebCalendarModule"); IgbCalendarBaseModule.MarkIsLoadRequested(runtime); } - public static void MarkIsLoadRequested(IIgniteUIBlazor runtime) { + public static void MarkIsLoadRequested(IIgniteUIBlazor runtime) + { ModuleLoader.MarkIsLoadRequested(runtime, "WebCalendarModule"); } - public static bool IsLoadRequested(IIgniteUIBlazor runtime) { + public static bool IsLoadRequested(IIgniteUIBlazor runtime) + { return ModuleLoader.IsLoadRequested(runtime, "WebCalendarModule"); } } diff --git a/src/components/Blazor/CalendarResourceStrings.cs b/src/components/Blazor/CalendarResourceStrings.cs index 7a131a82..770285b8 100644 --- a/src/components/Blazor/CalendarResourceStrings.cs +++ b/src/components/Blazor/CalendarResourceStrings.cs @@ -1,280 +1,316 @@ - -using System; using Microsoft.AspNetCore.Components; -using Microsoft.AspNetCore.Components.Rendering; -using System.Threading.Tasks; -using System.Collections.Generic; -using System.Linq; namespace IgniteUI.Blazor.Controls { - public partial class IgbCalendarResourceStrings: BaseRendererElement { - public override string Type { get { return "WebCalendarResourceStrings"; } } - - - public IgbCalendarResourceStrings(): base() { - OnCreatedIgbCalendarResourceStrings(); - - - } - - partial void OnCreatedIgbCalendarResourceStrings(); - - private string _selectMonth; - - partial void OnSelectMonthChanging(ref string newValue); - [Parameter] - public string SelectMonth - { - get { return this._selectMonth; } - set { - if (this._selectMonth != value || !IsPropDirty("SelectMonth")) { - MarkPropDirty("SelectMonth"); - } - this._selectMonth = value; - - } - } - private string _selectYear; - - partial void OnSelectYearChanging(ref string newValue); - [Parameter] - public string SelectYear - { - get { return this._selectYear; } - set { - if (this._selectYear != value || !IsPropDirty("SelectYear")) { - MarkPropDirty("SelectYear"); - } - this._selectYear = value; - - } - } - private string _selectDate; - - partial void OnSelectDateChanging(ref string newValue); - [Parameter] - public string SelectDate - { - get { return this._selectDate; } - set { - if (this._selectDate != value || !IsPropDirty("SelectDate")) { - MarkPropDirty("SelectDate"); - } - this._selectDate = value; - - } - } - private string _selectRange; - - partial void OnSelectRangeChanging(ref string newValue); - [Parameter] - public string SelectRange - { - get { return this._selectRange; } - set { - if (this._selectRange != value || !IsPropDirty("SelectRange")) { - MarkPropDirty("SelectRange"); - } - this._selectRange = value; - - } - } - private string _selectedDate; - - partial void OnSelectedDateChanging(ref string newValue); - [Parameter] - public string SelectedDate - { - get { return this._selectedDate; } - set { - if (this._selectedDate != value || !IsPropDirty("SelectedDate")) { - MarkPropDirty("SelectedDate"); - } - this._selectedDate = value; - - } - } - private string _startDate; - - partial void OnStartDateChanging(ref string newValue); - [Parameter] - public string StartDate - { - get { return this._startDate; } - set { - if (this._startDate != value || !IsPropDirty("StartDate")) { - MarkPropDirty("StartDate"); - } - this._startDate = value; - - } - } - private string _endDate; - - partial void OnEndDateChanging(ref string newValue); - [Parameter] - public string EndDate - { - get { return this._endDate; } - set { - if (this._endDate != value || !IsPropDirty("EndDate")) { - MarkPropDirty("EndDate"); - } - this._endDate = value; - - } - } - private string _previousMonth; - - partial void OnPreviousMonthChanging(ref string newValue); - [Parameter] - public string PreviousMonth - { - get { return this._previousMonth; } - set { - if (this._previousMonth != value || !IsPropDirty("PreviousMonth")) { - MarkPropDirty("PreviousMonth"); - } - this._previousMonth = value; - - } - } - private string _nextMonth; - - partial void OnNextMonthChanging(ref string newValue); - [Parameter] - public string NextMonth - { - get { return this._nextMonth; } - set { - if (this._nextMonth != value || !IsPropDirty("NextMonth")) { - MarkPropDirty("NextMonth"); - } - this._nextMonth = value; - - } - } - private string _previousYear; - - partial void OnPreviousYearChanging(ref string newValue); - [Parameter] - public string PreviousYear - { - get { return this._previousYear; } - set { - if (this._previousYear != value || !IsPropDirty("PreviousYear")) { - MarkPropDirty("PreviousYear"); - } - this._previousYear = value; - - } - } - private string _nextYear; - - partial void OnNextYearChanging(ref string newValue); - [Parameter] - public string NextYear - { - get { return this._nextYear; } - set { - if (this._nextYear != value || !IsPropDirty("NextYear")) { - MarkPropDirty("NextYear"); - } - this._nextYear = value; - - } - } - private string _previousYears; - - partial void OnPreviousYearsChanging(ref string newValue); - [Parameter] - public string PreviousYears - { - get { return this._previousYears; } - set { - if (this._previousYears != value || !IsPropDirty("PreviousYears")) { - MarkPropDirty("PreviousYears"); - } - this._previousYears = value; - - } - } - private string _nextYears; - - partial void OnNextYearsChanging(ref string newValue); - [Parameter] - public string NextYears - { - get { return this._nextYears; } - set { - if (this._nextYears != value || !IsPropDirty("NextYears")) { - MarkPropDirty("NextYears"); - } - this._nextYears = value; - - } - } - private string _weekLabel; - - partial void OnWeekLabelChanging(ref string newValue); - [Parameter] - public string WeekLabel - { - get { return this._weekLabel; } - set { - if (this._weekLabel != value || !IsPropDirty("WeekLabel")) { - MarkPropDirty("WeekLabel"); - } - this._weekLabel = value; - - } - } - - partial void FindByNameCalendarResourceStrings(string name, ref object item); - public override object FindByName(string name) - { - - var baseResult = base.FindByName(name); - if (baseResult != null) - { - return baseResult; - } - - object item = null; - FindByNameCalendarResourceStrings(name, ref item); - if (item != null) - { - return item; - } - - return null; - } - - partial void SerializeCoreIgbCalendarResourceStrings(RendererSerializer ser); - - internal override void SerializeCore(RendererSerializer ser) - { - base.SerializeCore(ser); - - SerializeCoreIgbCalendarResourceStrings(ser); - - if (IsPropDirty("SelectMonth")) { ser.AddStringProp("selectMonth", this._selectMonth); } - if (IsPropDirty("SelectYear")) { ser.AddStringProp("selectYear", this._selectYear); } - if (IsPropDirty("SelectDate")) { ser.AddStringProp("selectDate", this._selectDate); } - if (IsPropDirty("SelectRange")) { ser.AddStringProp("selectRange", this._selectRange); } - if (IsPropDirty("SelectedDate")) { ser.AddStringProp("selectedDate", this._selectedDate); } - if (IsPropDirty("StartDate")) { ser.AddStringProp("startDate", this._startDate); } - if (IsPropDirty("EndDate")) { ser.AddStringProp("endDate", this._endDate); } - if (IsPropDirty("PreviousMonth")) { ser.AddStringProp("previousMonth", this._previousMonth); } - if (IsPropDirty("NextMonth")) { ser.AddStringProp("nextMonth", this._nextMonth); } - if (IsPropDirty("PreviousYear")) { ser.AddStringProp("previousYear", this._previousYear); } - if (IsPropDirty("NextYear")) { ser.AddStringProp("nextYear", this._nextYear); } - if (IsPropDirty("PreviousYears")) { ser.AddStringProp("previousYears", this._previousYears); } - if (IsPropDirty("NextYears")) { ser.AddStringProp("nextYears", this._nextYears); } - if (IsPropDirty("WeekLabel")) { ser.AddStringProp("weekLabel", this._weekLabel); } - - } - -} + public partial class IgbCalendarResourceStrings : BaseRendererElement + { + public override string Type { get { return "WebCalendarResourceStrings"; } } + + public IgbCalendarResourceStrings() : base() + { + OnCreatedIgbCalendarResourceStrings(); + + } + + partial void OnCreatedIgbCalendarResourceStrings(); + + private string _selectMonth; + + partial void OnSelectMonthChanging(ref string newValue); + [Parameter] + public string SelectMonth + { + get { return this._selectMonth; } + set + { + if (this._selectMonth != value || !IsPropDirty("SelectMonth")) + { + MarkPropDirty("SelectMonth"); + } + this._selectMonth = value; + + } + } + private string _selectYear; + + partial void OnSelectYearChanging(ref string newValue); + [Parameter] + public string SelectYear + { + get { return this._selectYear; } + set + { + if (this._selectYear != value || !IsPropDirty("SelectYear")) + { + MarkPropDirty("SelectYear"); + } + this._selectYear = value; + + } + } + private string _selectDate; + + partial void OnSelectDateChanging(ref string newValue); + [Parameter] + public string SelectDate + { + get { return this._selectDate; } + set + { + if (this._selectDate != value || !IsPropDirty("SelectDate")) + { + MarkPropDirty("SelectDate"); + } + this._selectDate = value; + + } + } + private string _selectRange; + + partial void OnSelectRangeChanging(ref string newValue); + [Parameter] + public string SelectRange + { + get { return this._selectRange; } + set + { + if (this._selectRange != value || !IsPropDirty("SelectRange")) + { + MarkPropDirty("SelectRange"); + } + this._selectRange = value; + + } + } + private string _selectedDate; + + partial void OnSelectedDateChanging(ref string newValue); + [Parameter] + public string SelectedDate + { + get { return this._selectedDate; } + set + { + if (this._selectedDate != value || !IsPropDirty("SelectedDate")) + { + MarkPropDirty("SelectedDate"); + } + this._selectedDate = value; + + } + } + private string _startDate; + + partial void OnStartDateChanging(ref string newValue); + [Parameter] + public string StartDate + { + get { return this._startDate; } + set + { + if (this._startDate != value || !IsPropDirty("StartDate")) + { + MarkPropDirty("StartDate"); + } + this._startDate = value; + + } + } + private string _endDate; + + partial void OnEndDateChanging(ref string newValue); + [Parameter] + public string EndDate + { + get { return this._endDate; } + set + { + if (this._endDate != value || !IsPropDirty("EndDate")) + { + MarkPropDirty("EndDate"); + } + this._endDate = value; + + } + } + private string _previousMonth; + + partial void OnPreviousMonthChanging(ref string newValue); + [Parameter] + public string PreviousMonth + { + get { return this._previousMonth; } + set + { + if (this._previousMonth != value || !IsPropDirty("PreviousMonth")) + { + MarkPropDirty("PreviousMonth"); + } + this._previousMonth = value; + + } + } + private string _nextMonth; + + partial void OnNextMonthChanging(ref string newValue); + [Parameter] + public string NextMonth + { + get { return this._nextMonth; } + set + { + if (this._nextMonth != value || !IsPropDirty("NextMonth")) + { + MarkPropDirty("NextMonth"); + } + this._nextMonth = value; + + } + } + private string _previousYear; + + partial void OnPreviousYearChanging(ref string newValue); + [Parameter] + public string PreviousYear + { + get { return this._previousYear; } + set + { + if (this._previousYear != value || !IsPropDirty("PreviousYear")) + { + MarkPropDirty("PreviousYear"); + } + this._previousYear = value; + + } + } + private string _nextYear; + + partial void OnNextYearChanging(ref string newValue); + [Parameter] + public string NextYear + { + get { return this._nextYear; } + set + { + if (this._nextYear != value || !IsPropDirty("NextYear")) + { + MarkPropDirty("NextYear"); + } + this._nextYear = value; + + } + } + private string _previousYears; + + partial void OnPreviousYearsChanging(ref string newValue); + [Parameter] + public string PreviousYears + { + get { return this._previousYears; } + set + { + if (this._previousYears != value || !IsPropDirty("PreviousYears")) + { + MarkPropDirty("PreviousYears"); + } + this._previousYears = value; + + } + } + private string _nextYears; + + partial void OnNextYearsChanging(ref string newValue); + [Parameter] + public string NextYears + { + get { return this._nextYears; } + set + { + if (this._nextYears != value || !IsPropDirty("NextYears")) + { + MarkPropDirty("NextYears"); + } + this._nextYears = value; + + } + } + private string _weekLabel; + + partial void OnWeekLabelChanging(ref string newValue); + [Parameter] + public string WeekLabel + { + get { return this._weekLabel; } + set + { + if (this._weekLabel != value || !IsPropDirty("WeekLabel")) + { + MarkPropDirty("WeekLabel"); + } + this._weekLabel = value; + + } + } + + partial void FindByNameCalendarResourceStrings(string name, ref object item); + public override object FindByName(string name) + { + + var baseResult = base.FindByName(name); + if (baseResult != null) + { + return baseResult; + } + + object item = null; + FindByNameCalendarResourceStrings(name, ref item); + if (item != null) + { + return item; + } + + return null; + } + + partial void SerializeCoreIgbCalendarResourceStrings(RendererSerializer ser); + + internal override void SerializeCore(RendererSerializer ser) + { + base.SerializeCore(ser); + + SerializeCoreIgbCalendarResourceStrings(ser); + + if (IsPropDirty("SelectMonth")) + { ser.AddStringProp("selectMonth", this._selectMonth); } + if (IsPropDirty("SelectYear")) + { ser.AddStringProp("selectYear", this._selectYear); } + if (IsPropDirty("SelectDate")) + { ser.AddStringProp("selectDate", this._selectDate); } + if (IsPropDirty("SelectRange")) + { ser.AddStringProp("selectRange", this._selectRange); } + if (IsPropDirty("SelectedDate")) + { ser.AddStringProp("selectedDate", this._selectedDate); } + if (IsPropDirty("StartDate")) + { ser.AddStringProp("startDate", this._startDate); } + if (IsPropDirty("EndDate")) + { ser.AddStringProp("endDate", this._endDate); } + if (IsPropDirty("PreviousMonth")) + { ser.AddStringProp("previousMonth", this._previousMonth); } + if (IsPropDirty("NextMonth")) + { ser.AddStringProp("nextMonth", this._nextMonth); } + if (IsPropDirty("PreviousYear")) + { ser.AddStringProp("previousYear", this._previousYear); } + if (IsPropDirty("NextYear")) + { ser.AddStringProp("nextYear", this._nextYear); } + if (IsPropDirty("PreviousYears")) + { ser.AddStringProp("previousYears", this._previousYears); } + if (IsPropDirty("NextYears")) + { ser.AddStringProp("nextYears", this._nextYears); } + if (IsPropDirty("WeekLabel")) + { ser.AddStringProp("weekLabel", this._weekLabel); } + + } + + } } diff --git a/src/components/Blazor/CalendarSelection.cs b/src/components/Blazor/CalendarSelection.cs index e9685469..de2c2ea9 100644 --- a/src/components/Blazor/CalendarSelection.cs +++ b/src/components/Blazor/CalendarSelection.cs @@ -1,9 +1,10 @@ namespace IgniteUI.Blazor.Controls { -public enum CalendarSelection { - Single, - Multiple, - Range + public enum CalendarSelection + { + Single, + Multiple, + Range -} + } } diff --git a/src/components/Blazor/Card.cs b/src/components/Blazor/Card.cs index 25ab3606..d05be50e 100644 --- a/src/components/Blazor/Card.cs +++ b/src/components/Blazor/Card.cs @@ -1,130 +1,128 @@ - -using System; using Microsoft.AspNetCore.Components; -using Microsoft.AspNetCore.Components.Rendering; -using System.Threading.Tasks; -using System.Collections.Generic; -using System.Linq; namespace IgniteUI.Blazor.Controls { - /// -/// A container component that wraps different elements related to a single subject. -/// The card component provides a flexible container for organizing content such as headers, -/// media, text content, and actions. -/// -public partial class IgbCard: BaseRendererControl { - public override string Type { get { return "WebCard"; } } - - protected override void EnsureModulesLoaded() - { - if (!IgbCardModule.IsLoadRequested(IgBlazor)) - { - IgbCardModule.Register(IgBlazor); - } - } - - protected override string ResolveDisplay() - { - return "inline-block"; - } - - protected override bool SupportsVisualChildren - { - get - { - return true; - } - } - - protected override bool UseDirectRender - { - get - { - return true; - } - } - - protected override string DirectRenderElementName - { - get - { - return "igc-card"; - } - } - - protected override ControlEventBehavior DefaultEventBehavior - { - get { return ControlEventBehavior.Immediate; } - } - - public IgbCard(): base() { - OnCreatedIgbCard(); - - - } - - partial void OnCreatedIgbCard(); - - private bool _elevated = false; - - partial void OnElevatedChanging(ref bool newValue); - /// - /// Sets the card to have an elevated appearance with shadow. - /// When false, the card uses an outlined style with a border. - /// - [Parameter] - public bool Elevated - { - get { return this._elevated; } - set { - if (this._elevated != value || !IsPropDirty("Elevated")) { - MarkPropDirty("Elevated"); - } - this._elevated = value; - - } - } - - partial void FindByNameCard(string name, ref object item); - public override object FindByName(string name) - { - - var baseResult = base.FindByName(name); - if (baseResult != null) - { - return baseResult; - } - - object item = null; - FindByNameCard(name, ref item); - if (item != null) - { - return item; - } - - return null; - } - public async Task SetNativeElementAsync(Object element) - { - await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); - } - public void SetNativeElement(Object element) - { - InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); - } - - partial void SerializeCoreIgbCard(RendererSerializer ser); - - internal override void SerializeCore(RendererSerializer ser) - { - base.SerializeCore(ser); - - SerializeCoreIgbCard(ser); - - if (IsPropDirty("Elevated")) { ser.AddBooleanProp("elevated", this._elevated); } - - } - -} + /// + /// A container component that wraps different elements related to a single subject. + /// The card component provides a flexible container for organizing content such as headers, + /// media, text content, and actions. + /// + public partial class IgbCard : BaseRendererControl + { + public override string Type { get { return "WebCard"; } } + + protected override void EnsureModulesLoaded() + { + if (!IgbCardModule.IsLoadRequested(IgBlazor)) + { + IgbCardModule.Register(IgBlazor); + } + } + + protected override string ResolveDisplay() + { + return "inline-block"; + } + + protected override bool SupportsVisualChildren + { + get + { + return true; + } + } + + protected override bool UseDirectRender + { + get + { + return true; + } + } + + protected override string DirectRenderElementName + { + get + { + return "igc-card"; + } + } + + protected override ControlEventBehavior DefaultEventBehavior + { + get { return ControlEventBehavior.Immediate; } + } + + public IgbCard() : base() + { + OnCreatedIgbCard(); + + } + + partial void OnCreatedIgbCard(); + + private bool _elevated = false; + + partial void OnElevatedChanging(ref bool newValue); + /// + /// Sets the card to have an elevated appearance with shadow. + /// When false, the card uses an outlined style with a border. + /// + [Parameter] + public bool Elevated + { + get { return this._elevated; } + set + { + if (this._elevated != value || !IsPropDirty("Elevated")) + { + MarkPropDirty("Elevated"); + } + this._elevated = value; + + } + } + + partial void FindByNameCard(string name, ref object item); + public override object FindByName(string name) + { + + var baseResult = base.FindByName(name); + if (baseResult != null) + { + return baseResult; + } + + object item = null; + FindByNameCard(name, ref item); + if (item != null) + { + return item; + } + + return null; + } + public async Task SetNativeElementAsync(Object element) + { + await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + } + public void SetNativeElement(Object element) + { + InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + } + + partial void SerializeCoreIgbCard(RendererSerializer ser); + + internal override void SerializeCore(RendererSerializer ser) + { + base.SerializeCore(ser); + + SerializeCoreIgbCard(ser); + + if (IsPropDirty("Elevated")) + { ser.AddBooleanProp("elevated", this._elevated); } + + } + + } } diff --git a/src/components/Blazor/CardActions.cs b/src/components/Blazor/CardActions.cs index e9355c64..9d3e010e 100644 --- a/src/components/Blazor/CardActions.cs +++ b/src/components/Blazor/CardActions.cs @@ -1,128 +1,126 @@ - -using System; using Microsoft.AspNetCore.Components; -using Microsoft.AspNetCore.Components.Rendering; -using System.Threading.Tasks; -using System.Collections.Generic; -using System.Linq; namespace IgniteUI.Blazor.Controls { - /// -/// A container component for card action items such as buttons or icon buttons. -/// Actions can be positioned at the start, center, or end of the container. -/// -public partial class IgbCardActions: BaseRendererControl { - public override string Type { get { return "WebCardActions"; } } - - protected override void EnsureModulesLoaded() - { - if (!IgbCardActionsModule.IsLoadRequested(IgBlazor)) - { - IgbCardActionsModule.Register(IgBlazor); - } - } - - protected override string ResolveDisplay() - { - return "inline-block"; - } - - protected override bool SupportsVisualChildren - { - get - { - return true; - } - } - - protected override bool UseDirectRender - { - get - { - return true; - } - } - - protected override string DirectRenderElementName - { - get - { - return "igc-card-actions"; - } - } - - protected override ControlEventBehavior DefaultEventBehavior - { - get { return ControlEventBehavior.Immediate; } - } - - public IgbCardActions(): base() { - OnCreatedIgbCardActions(); - - - } - - partial void OnCreatedIgbCardActions(); - - private ContentOrientation _orientation = ContentOrientation.Horizontal; - - partial void OnOrientationChanging(ref ContentOrientation newValue); - /// - /// The orientation of the actions layout. - /// - [Parameter] - public ContentOrientation Orientation - { - get { return this._orientation; } - set { - if (this._orientation != value || !IsPropDirty("Orientation")) { - MarkPropDirty("Orientation"); - } - this._orientation = value; - - } - } - - partial void FindByNameCardActions(string name, ref object item); - public override object FindByName(string name) - { - - var baseResult = base.FindByName(name); - if (baseResult != null) - { - return baseResult; - } - - object item = null; - FindByNameCardActions(name, ref item); - if (item != null) - { - return item; - } - - return null; - } - public async Task SetNativeElementAsync(Object element) - { - await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); - } - public void SetNativeElement(Object element) - { - InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); - } - - partial void SerializeCoreIgbCardActions(RendererSerializer ser); - - internal override void SerializeCore(RendererSerializer ser) - { - base.SerializeCore(ser); - - SerializeCoreIgbCardActions(ser); - - if (IsPropDirty("Orientation")) { ser.AddEnumProp("orientation", this._orientation); } - - } - -} + /// + /// A container component for card action items such as buttons or icon buttons. + /// Actions can be positioned at the start, center, or end of the container. + /// + public partial class IgbCardActions : BaseRendererControl + { + public override string Type { get { return "WebCardActions"; } } + + protected override void EnsureModulesLoaded() + { + if (!IgbCardActionsModule.IsLoadRequested(IgBlazor)) + { + IgbCardActionsModule.Register(IgBlazor); + } + } + + protected override string ResolveDisplay() + { + return "inline-block"; + } + + protected override bool SupportsVisualChildren + { + get + { + return true; + } + } + + protected override bool UseDirectRender + { + get + { + return true; + } + } + + protected override string DirectRenderElementName + { + get + { + return "igc-card-actions"; + } + } + + protected override ControlEventBehavior DefaultEventBehavior + { + get { return ControlEventBehavior.Immediate; } + } + + public IgbCardActions() : base() + { + OnCreatedIgbCardActions(); + + } + + partial void OnCreatedIgbCardActions(); + + private ContentOrientation _orientation = ContentOrientation.Horizontal; + + partial void OnOrientationChanging(ref ContentOrientation newValue); + /// + /// The orientation of the actions layout. + /// + [Parameter] + public ContentOrientation Orientation + { + get { return this._orientation; } + set + { + if (this._orientation != value || !IsPropDirty("Orientation")) + { + MarkPropDirty("Orientation"); + } + this._orientation = value; + + } + } + + partial void FindByNameCardActions(string name, ref object item); + public override object FindByName(string name) + { + + var baseResult = base.FindByName(name); + if (baseResult != null) + { + return baseResult; + } + + object item = null; + FindByNameCardActions(name, ref item); + if (item != null) + { + return item; + } + + return null; + } + public async Task SetNativeElementAsync(Object element) + { + await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + } + public void SetNativeElement(Object element) + { + InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + } + + partial void SerializeCoreIgbCardActions(RendererSerializer ser); + + internal override void SerializeCore(RendererSerializer ser) + { + base.SerializeCore(ser); + + SerializeCoreIgbCardActions(ser); + + if (IsPropDirty("Orientation")) + { ser.AddEnumProp("orientation", this._orientation); } + + } + + } } diff --git a/src/components/Blazor/CardActionsModule.cs b/src/components/Blazor/CardActionsModule.cs index e9d876cb..46bbb3d8 100644 --- a/src/components/Blazor/CardActionsModule.cs +++ b/src/components/Blazor/CardActionsModule.cs @@ -1,23 +1,20 @@ -using System; -using System.Collections.Generic; -using System.Runtime.CompilerServices; -using System.Text; -using System.Collections.Generic; - namespace IgniteUI.Blazor.Controls { - public partial class IgbCardActionsModule { - public static void Register(IIgniteUIBlazor runtime) { + public partial class IgbCardActionsModule + { + public static void Register(IIgniteUIBlazor runtime) + { ModuleLoader.Load(runtime, "WebCardActionsModule"); - } - public static void MarkIsLoadRequested(IIgniteUIBlazor runtime) { + public static void MarkIsLoadRequested(IIgniteUIBlazor runtime) + { ModuleLoader.MarkIsLoadRequested(runtime, "WebCardActionsModule"); } - public static bool IsLoadRequested(IIgniteUIBlazor runtime) { + public static bool IsLoadRequested(IIgniteUIBlazor runtime) + { return ModuleLoader.IsLoadRequested(runtime, "WebCardActionsModule"); } } diff --git a/src/components/Blazor/CardContent.cs b/src/components/Blazor/CardContent.cs index f8502be4..49265fe3 100644 --- a/src/components/Blazor/CardContent.cs +++ b/src/components/Blazor/CardContent.cs @@ -1,109 +1,100 @@ - -using System; -using Microsoft.AspNetCore.Components; -using Microsoft.AspNetCore.Components.Rendering; -using System.Threading.Tasks; -using System.Collections.Generic; -using System.Linq; - namespace IgniteUI.Blazor.Controls { - /// -/// A container component for the card's main text content. -/// This component should be used within an igc-card element to display the primary content. -/// -public partial class IgbCardContent: BaseRendererControl { - public override string Type { get { return "WebCardContent"; } } - - protected override void EnsureModulesLoaded() - { - if (!IgbCardContentModule.IsLoadRequested(IgBlazor)) - { - IgbCardContentModule.Register(IgBlazor); - } - } - - protected override string ResolveDisplay() - { - return "inline-block"; - } - - protected override bool SupportsVisualChildren - { - get - { - return true; - } - } - - protected override bool UseDirectRender - { - get - { - return true; - } - } - - protected override string DirectRenderElementName - { - get - { - return "igc-card-content"; - } - } - - protected override ControlEventBehavior DefaultEventBehavior - { - get { return ControlEventBehavior.Immediate; } - } - - public IgbCardContent(): base() { - OnCreatedIgbCardContent(); - - - } - - partial void OnCreatedIgbCardContent(); - - - partial void FindByNameCardContent(string name, ref object item); - public override object FindByName(string name) - { - - var baseResult = base.FindByName(name); - if (baseResult != null) - { - return baseResult; - } - - object item = null; - FindByNameCardContent(name, ref item); - if (item != null) - { - return item; - } - - return null; - } - public async Task SetNativeElementAsync(Object element) - { - await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); - } - public void SetNativeElement(Object element) - { - InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); - } - - partial void SerializeCoreIgbCardContent(RendererSerializer ser); - - internal override void SerializeCore(RendererSerializer ser) - { - base.SerializeCore(ser); - - SerializeCoreIgbCardContent(ser); - - - } - -} + /// + /// A container component for the card's main text content. + /// This component should be used within an igc-card element to display the primary content. + /// + public partial class IgbCardContent : BaseRendererControl + { + public override string Type { get { return "WebCardContent"; } } + + protected override void EnsureModulesLoaded() + { + if (!IgbCardContentModule.IsLoadRequested(IgBlazor)) + { + IgbCardContentModule.Register(IgBlazor); + } + } + + protected override string ResolveDisplay() + { + return "inline-block"; + } + + protected override bool SupportsVisualChildren + { + get + { + return true; + } + } + + protected override bool UseDirectRender + { + get + { + return true; + } + } + + protected override string DirectRenderElementName + { + get + { + return "igc-card-content"; + } + } + + protected override ControlEventBehavior DefaultEventBehavior + { + get { return ControlEventBehavior.Immediate; } + } + + public IgbCardContent() : base() + { + OnCreatedIgbCardContent(); + + } + + partial void OnCreatedIgbCardContent(); + + partial void FindByNameCardContent(string name, ref object item); + public override object FindByName(string name) + { + + var baseResult = base.FindByName(name); + if (baseResult != null) + { + return baseResult; + } + + object item = null; + FindByNameCardContent(name, ref item); + if (item != null) + { + return item; + } + + return null; + } + public async Task SetNativeElementAsync(Object element) + { + await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + } + public void SetNativeElement(Object element) + { + InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + } + + partial void SerializeCoreIgbCardContent(RendererSerializer ser); + + internal override void SerializeCore(RendererSerializer ser) + { + base.SerializeCore(ser); + + SerializeCoreIgbCardContent(ser); + + } + + } } diff --git a/src/components/Blazor/CardContentModule.cs b/src/components/Blazor/CardContentModule.cs index 274b8cc2..625280dd 100644 --- a/src/components/Blazor/CardContentModule.cs +++ b/src/components/Blazor/CardContentModule.cs @@ -1,23 +1,20 @@ -using System; -using System.Collections.Generic; -using System.Runtime.CompilerServices; -using System.Text; -using System.Collections.Generic; - namespace IgniteUI.Blazor.Controls { - public partial class IgbCardContentModule { - public static void Register(IIgniteUIBlazor runtime) { + public partial class IgbCardContentModule + { + public static void Register(IIgniteUIBlazor runtime) + { ModuleLoader.Load(runtime, "WebCardContentModule"); - } - public static void MarkIsLoadRequested(IIgniteUIBlazor runtime) { + public static void MarkIsLoadRequested(IIgniteUIBlazor runtime) + { ModuleLoader.MarkIsLoadRequested(runtime, "WebCardContentModule"); } - public static bool IsLoadRequested(IIgniteUIBlazor runtime) { + public static bool IsLoadRequested(IIgniteUIBlazor runtime) + { return ModuleLoader.IsLoadRequested(runtime, "WebCardContentModule"); } } diff --git a/src/components/Blazor/CardHeader.cs b/src/components/Blazor/CardHeader.cs index 8ab79e0d..e0a3613d 100644 --- a/src/components/Blazor/CardHeader.cs +++ b/src/components/Blazor/CardHeader.cs @@ -1,109 +1,100 @@ - -using System; -using Microsoft.AspNetCore.Components; -using Microsoft.AspNetCore.Components.Rendering; -using System.Threading.Tasks; -using System.Collections.Generic; -using System.Linq; - namespace IgniteUI.Blazor.Controls { - /// -/// A container component for the card's header section. -/// Displays header content including an optional thumbnail, title, subtitle, and additional content. -/// -public partial class IgbCardHeader: BaseRendererControl { - public override string Type { get { return "WebCardHeader"; } } - - protected override void EnsureModulesLoaded() - { - if (!IgbCardHeaderModule.IsLoadRequested(IgBlazor)) - { - IgbCardHeaderModule.Register(IgBlazor); - } - } - - protected override string ResolveDisplay() - { - return "inline-block"; - } - - protected override bool SupportsVisualChildren - { - get - { - return true; - } - } - - protected override bool UseDirectRender - { - get - { - return true; - } - } - - protected override string DirectRenderElementName - { - get - { - return "igc-card-header"; - } - } - - protected override ControlEventBehavior DefaultEventBehavior - { - get { return ControlEventBehavior.Immediate; } - } - - public IgbCardHeader(): base() { - OnCreatedIgbCardHeader(); - - - } - - partial void OnCreatedIgbCardHeader(); - - - partial void FindByNameCardHeader(string name, ref object item); - public override object FindByName(string name) - { - - var baseResult = base.FindByName(name); - if (baseResult != null) - { - return baseResult; - } - - object item = null; - FindByNameCardHeader(name, ref item); - if (item != null) - { - return item; - } - - return null; - } - public async Task SetNativeElementAsync(Object element) - { - await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); - } - public void SetNativeElement(Object element) - { - InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); - } - - partial void SerializeCoreIgbCardHeader(RendererSerializer ser); - - internal override void SerializeCore(RendererSerializer ser) - { - base.SerializeCore(ser); - - SerializeCoreIgbCardHeader(ser); - - - } - -} + /// + /// A container component for the card's header section. + /// Displays header content including an optional thumbnail, title, subtitle, and additional content. + /// + public partial class IgbCardHeader : BaseRendererControl + { + public override string Type { get { return "WebCardHeader"; } } + + protected override void EnsureModulesLoaded() + { + if (!IgbCardHeaderModule.IsLoadRequested(IgBlazor)) + { + IgbCardHeaderModule.Register(IgBlazor); + } + } + + protected override string ResolveDisplay() + { + return "inline-block"; + } + + protected override bool SupportsVisualChildren + { + get + { + return true; + } + } + + protected override bool UseDirectRender + { + get + { + return true; + } + } + + protected override string DirectRenderElementName + { + get + { + return "igc-card-header"; + } + } + + protected override ControlEventBehavior DefaultEventBehavior + { + get { return ControlEventBehavior.Immediate; } + } + + public IgbCardHeader() : base() + { + OnCreatedIgbCardHeader(); + + } + + partial void OnCreatedIgbCardHeader(); + + partial void FindByNameCardHeader(string name, ref object item); + public override object FindByName(string name) + { + + var baseResult = base.FindByName(name); + if (baseResult != null) + { + return baseResult; + } + + object item = null; + FindByNameCardHeader(name, ref item); + if (item != null) + { + return item; + } + + return null; + } + public async Task SetNativeElementAsync(Object element) + { + await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + } + public void SetNativeElement(Object element) + { + InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + } + + partial void SerializeCoreIgbCardHeader(RendererSerializer ser); + + internal override void SerializeCore(RendererSerializer ser) + { + base.SerializeCore(ser); + + SerializeCoreIgbCardHeader(ser); + + } + + } } diff --git a/src/components/Blazor/CardHeaderModule.cs b/src/components/Blazor/CardHeaderModule.cs index 706c3e4e..84cd6bbc 100644 --- a/src/components/Blazor/CardHeaderModule.cs +++ b/src/components/Blazor/CardHeaderModule.cs @@ -1,23 +1,20 @@ -using System; -using System.Collections.Generic; -using System.Runtime.CompilerServices; -using System.Text; -using System.Collections.Generic; - namespace IgniteUI.Blazor.Controls { - public partial class IgbCardHeaderModule { - public static void Register(IIgniteUIBlazor runtime) { + public partial class IgbCardHeaderModule + { + public static void Register(IIgniteUIBlazor runtime) + { ModuleLoader.Load(runtime, "WebCardHeaderModule"); - } - public static void MarkIsLoadRequested(IIgniteUIBlazor runtime) { + public static void MarkIsLoadRequested(IIgniteUIBlazor runtime) + { ModuleLoader.MarkIsLoadRequested(runtime, "WebCardHeaderModule"); } - public static bool IsLoadRequested(IIgniteUIBlazor runtime) { + public static bool IsLoadRequested(IIgniteUIBlazor runtime) + { return ModuleLoader.IsLoadRequested(runtime, "WebCardHeaderModule"); } } diff --git a/src/components/Blazor/CardMedia.cs b/src/components/Blazor/CardMedia.cs index 3ec1dbc7..4a88e32e 100644 --- a/src/components/Blazor/CardMedia.cs +++ b/src/components/Blazor/CardMedia.cs @@ -1,109 +1,100 @@ - -using System; -using Microsoft.AspNetCore.Components; -using Microsoft.AspNetCore.Components.Rendering; -using System.Threading.Tasks; -using System.Collections.Generic; -using System.Linq; - namespace IgniteUI.Blazor.Controls { - /// -/// A container component for card media content such as images, GIFs, or videos. -/// This component should be used within an igc-card element to display visual content. -/// -public partial class IgbCardMedia: BaseRendererControl { - public override string Type { get { return "WebCardMedia"; } } - - protected override void EnsureModulesLoaded() - { - if (!IgbCardMediaModule.IsLoadRequested(IgBlazor)) - { - IgbCardMediaModule.Register(IgBlazor); - } - } - - protected override string ResolveDisplay() - { - return "inline-block"; - } - - protected override bool SupportsVisualChildren - { - get - { - return true; - } - } - - protected override bool UseDirectRender - { - get - { - return true; - } - } - - protected override string DirectRenderElementName - { - get - { - return "igc-card-media"; - } - } - - protected override ControlEventBehavior DefaultEventBehavior - { - get { return ControlEventBehavior.Immediate; } - } - - public IgbCardMedia(): base() { - OnCreatedIgbCardMedia(); - - - } - - partial void OnCreatedIgbCardMedia(); - - - partial void FindByNameCardMedia(string name, ref object item); - public override object FindByName(string name) - { - - var baseResult = base.FindByName(name); - if (baseResult != null) - { - return baseResult; - } - - object item = null; - FindByNameCardMedia(name, ref item); - if (item != null) - { - return item; - } - - return null; - } - public async Task SetNativeElementAsync(Object element) - { - await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); - } - public void SetNativeElement(Object element) - { - InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); - } - - partial void SerializeCoreIgbCardMedia(RendererSerializer ser); - - internal override void SerializeCore(RendererSerializer ser) - { - base.SerializeCore(ser); - - SerializeCoreIgbCardMedia(ser); - - - } - -} + /// + /// A container component for card media content such as images, GIFs, or videos. + /// This component should be used within an igc-card element to display visual content. + /// + public partial class IgbCardMedia : BaseRendererControl + { + public override string Type { get { return "WebCardMedia"; } } + + protected override void EnsureModulesLoaded() + { + if (!IgbCardMediaModule.IsLoadRequested(IgBlazor)) + { + IgbCardMediaModule.Register(IgBlazor); + } + } + + protected override string ResolveDisplay() + { + return "inline-block"; + } + + protected override bool SupportsVisualChildren + { + get + { + return true; + } + } + + protected override bool UseDirectRender + { + get + { + return true; + } + } + + protected override string DirectRenderElementName + { + get + { + return "igc-card-media"; + } + } + + protected override ControlEventBehavior DefaultEventBehavior + { + get { return ControlEventBehavior.Immediate; } + } + + public IgbCardMedia() : base() + { + OnCreatedIgbCardMedia(); + + } + + partial void OnCreatedIgbCardMedia(); + + partial void FindByNameCardMedia(string name, ref object item); + public override object FindByName(string name) + { + + var baseResult = base.FindByName(name); + if (baseResult != null) + { + return baseResult; + } + + object item = null; + FindByNameCardMedia(name, ref item); + if (item != null) + { + return item; + } + + return null; + } + public async Task SetNativeElementAsync(Object element) + { + await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + } + public void SetNativeElement(Object element) + { + InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + } + + partial void SerializeCoreIgbCardMedia(RendererSerializer ser); + + internal override void SerializeCore(RendererSerializer ser) + { + base.SerializeCore(ser); + + SerializeCoreIgbCardMedia(ser); + + } + + } } diff --git a/src/components/Blazor/CardMediaModule.cs b/src/components/Blazor/CardMediaModule.cs index 28df6a91..f2757dd7 100644 --- a/src/components/Blazor/CardMediaModule.cs +++ b/src/components/Blazor/CardMediaModule.cs @@ -1,23 +1,20 @@ -using System; -using System.Collections.Generic; -using System.Runtime.CompilerServices; -using System.Text; -using System.Collections.Generic; - namespace IgniteUI.Blazor.Controls { - public partial class IgbCardMediaModule { - public static void Register(IIgniteUIBlazor runtime) { + public partial class IgbCardMediaModule + { + public static void Register(IIgniteUIBlazor runtime) + { ModuleLoader.Load(runtime, "WebCardMediaModule"); - } - public static void MarkIsLoadRequested(IIgniteUIBlazor runtime) { + public static void MarkIsLoadRequested(IIgniteUIBlazor runtime) + { ModuleLoader.MarkIsLoadRequested(runtime, "WebCardMediaModule"); } - public static bool IsLoadRequested(IIgniteUIBlazor runtime) { + public static bool IsLoadRequested(IIgniteUIBlazor runtime) + { return ModuleLoader.IsLoadRequested(runtime, "WebCardMediaModule"); } } diff --git a/src/components/Blazor/CardModule.cs b/src/components/Blazor/CardModule.cs index c55a24ce..aeff3209 100644 --- a/src/components/Blazor/CardModule.cs +++ b/src/components/Blazor/CardModule.cs @@ -1,23 +1,20 @@ -using System; -using System.Collections.Generic; -using System.Runtime.CompilerServices; -using System.Text; -using System.Collections.Generic; - namespace IgniteUI.Blazor.Controls { - public partial class IgbCardModule { - public static void Register(IIgniteUIBlazor runtime) { + public partial class IgbCardModule + { + public static void Register(IIgniteUIBlazor runtime) + { ModuleLoader.Load(runtime, "WebCardModule"); - } - public static void MarkIsLoadRequested(IIgniteUIBlazor runtime) { + public static void MarkIsLoadRequested(IIgniteUIBlazor runtime) + { ModuleLoader.MarkIsLoadRequested(runtime, "WebCardModule"); } - public static bool IsLoadRequested(IIgniteUIBlazor runtime) { + public static bool IsLoadRequested(IIgniteUIBlazor runtime) + { return ModuleLoader.IsLoadRequested(runtime, "WebCardModule"); } } diff --git a/src/components/Blazor/Carousel.cs b/src/components/Blazor/Carousel.cs index 0e33f6f6..113b1114 100644 --- a/src/components/Blazor/Carousel.cs +++ b/src/components/Blazor/Carousel.cs @@ -1,602 +1,648 @@ - -using System; using Microsoft.AspNetCore.Components; -using Microsoft.AspNetCore.Components.Rendering; -using System.Threading.Tasks; -using System.Collections.Generic; -using System.Linq; namespace IgniteUI.Blazor.Controls { - /// -/// The `igc-carousel` presents a set of `igc-carousel-slide`s by sequentially displaying a subset of one or more slides. -/// -public partial class IgbCarousel: BaseRendererControl { - public override string Type { get { return "WebCarousel"; } } - - protected override void EnsureModulesLoaded() - { - if (!IgbCarouselModule.IsLoadRequested(IgBlazor)) - { - IgbCarouselModule.Register(IgBlazor); - } - } - - protected override string ResolveDisplay() + /// + /// The `igc-carousel` presents a set of `igc-carousel-slide`s by sequentially displaying a subset of one or more slides. + /// + public partial class IgbCarousel : BaseRendererControl + { + public override string Type { get { return "WebCarousel"; } } + + protected override void EnsureModulesLoaded() + { + if (!IgbCarouselModule.IsLoadRequested(IgBlazor)) + { + IgbCarouselModule.Register(IgBlazor); + } + } + + protected override string ResolveDisplay() + { + return "inline-block"; + } + + protected override bool SupportsVisualChildren + { + get + { + return true; + } + } + + protected override bool UseDirectRender + { + get + { + return true; + } + } + + protected override string DirectRenderElementName + { + get + { + return "igc-carousel"; + } + } + + protected override ControlEventBehavior DefaultEventBehavior + { + get { return ControlEventBehavior.Immediate; } + } + + public IgbCarousel() : base() + { + OnCreatedIgbCarousel(); + + } + + partial void OnCreatedIgbCarousel(); + + private bool _disableLoop = false; + + partial void OnDisableLoopChanging(ref bool newValue); + /// + /// Whether the carousel should skip rotating to the first slide after it reaches the last. + /// + [Parameter] + public bool DisableLoop + { + get { return this._disableLoop; } + set + { + if (this._disableLoop != value || !IsPropDirty("DisableLoop")) + { + MarkPropDirty("DisableLoop"); + } + this._disableLoop = value; + + } + } + private bool _disablePauseOnInteraction = false; + + partial void OnDisablePauseOnInteractionChanging(ref bool newValue); + /// + /// Whether the carousel should ignore use interactions and not pause on them. + /// + [Parameter] + public bool DisablePauseOnInteraction + { + get { return this._disablePauseOnInteraction; } + set + { + if (this._disablePauseOnInteraction != value || !IsPropDirty("DisablePauseOnInteraction")) + { + MarkPropDirty("DisablePauseOnInteraction"); + } + this._disablePauseOnInteraction = value; + + } + } + private bool _hideNavigation = false; + + partial void OnHideNavigationChanging(ref bool newValue); + /// + /// Whether the carousel should skip rendering of the default navigation buttons. + /// + [Parameter] + public bool HideNavigation + { + get { return this._hideNavigation; } + set + { + if (this._hideNavigation != value || !IsPropDirty("HideNavigation")) + { + MarkPropDirty("HideNavigation"); + } + this._hideNavigation = value; + + } + } + private bool _hideIndicators = false; + + partial void OnHideIndicatorsChanging(ref bool newValue); + /// + /// Whether the carousel should render the indicator controls (dots). + /// + [Parameter] + public bool HideIndicators + { + get { return this._hideIndicators; } + set + { + if (this._hideIndicators != value || !IsPropDirty("HideIndicators")) + { + MarkPropDirty("HideIndicators"); + } + this._hideIndicators = value; + + } + } + private bool _vertical = false; + + partial void OnVerticalChanging(ref bool newValue); + /// + /// Whether the carousel has vertical alignment. + /// + [Parameter] + public bool Vertical + { + get { return this._vertical; } + set + { + if (this._vertical != value || !IsPropDirty("Vertical")) + { + MarkPropDirty("Vertical"); + } + this._vertical = value; + + } + } + private CarouselIndicatorsOrientation _indicatorsOrientation = CarouselIndicatorsOrientation.End; + + partial void OnIndicatorsOrientationChanging(ref CarouselIndicatorsOrientation newValue); + /// + /// Sets the orientation of the indicator controls (dots). + /// + [Parameter] + public CarouselIndicatorsOrientation IndicatorsOrientation + { + get { return this._indicatorsOrientation; } + set + { + if (this._indicatorsOrientation != value || !IsPropDirty("IndicatorsOrientation")) + { + MarkPropDirty("IndicatorsOrientation"); + } + this._indicatorsOrientation = value; + + } + } + private string _indicatorsLabelFormat; + + partial void OnIndicatorsLabelFormatChanging(ref string newValue); + /// + /// The format used to set the aria-label on the carousel indicators. + /// Instances of '{0}' will be replaced with the index of the corresponding slide. + /// + [Parameter] + public string IndicatorsLabelFormat + { + get { return this._indicatorsLabelFormat; } + set + { + if (this._indicatorsLabelFormat != value || !IsPropDirty("IndicatorsLabelFormat")) + { + MarkPropDirty("IndicatorsLabelFormat"); + } + this._indicatorsLabelFormat = value; + + } + } + private string _slidesLabelFormat; + + partial void OnSlidesLabelFormatChanging(ref string newValue); + /// + /// The format used to set the aria-label on the carousel slides and the text displayed + /// when the number of indicators is greater than tha maximum indicator count. + /// Instances of '{0}' will be replaced with the index of the corresponding slide. + /// Instances of '{1}' will be replaced with the total amount of slides. + /// + [Parameter] + public string SlidesLabelFormat + { + get { return this._slidesLabelFormat; } + set + { + if (this._slidesLabelFormat != value || !IsPropDirty("SlidesLabelFormat")) + { + MarkPropDirty("SlidesLabelFormat"); + } + this._slidesLabelFormat = value; + + } + } + private double _interval = 0; + + partial void OnIntervalChanging(ref double newValue); + /// + /// The duration in milliseconds between changing the active slide. + /// + [Parameter] + public double Interval + { + get { return this._interval; } + set + { + if (this._interval != value || !IsPropDirty("Interval")) + { + MarkPropDirty("Interval"); + } + this._interval = value; + + } + } + private double _maximumIndicatorsCount = 0; + + partial void OnMaximumIndicatorsCountChanging(ref double newValue); + /// + /// Controls the maximum indicator controls (dots) that can be shown. Default value is `10`. + /// + [Parameter] + public double MaximumIndicatorsCount + { + get { return this._maximumIndicatorsCount; } + set + { + if (this._maximumIndicatorsCount != value || !IsPropDirty("MaximumIndicatorsCount")) + { + MarkPropDirty("MaximumIndicatorsCount"); + } + this._maximumIndicatorsCount = value; + + } + } + private HorizontalTransitionAnimation _animationType = HorizontalTransitionAnimation.Slide; + + partial void OnAnimationTypeChanging(ref HorizontalTransitionAnimation newValue); + /// + /// The animation type. + /// + [Parameter] + public HorizontalTransitionAnimation AnimationType + { + get { return this._animationType; } + set + { + if (this._animationType != value || !IsPropDirty("AnimationType")) + { + MarkPropDirty("AnimationType"); + } + this._animationType = value; + + } + } + public async Task GetTotalAsync() + { + var iv = await InvokeMethod("p:Total", new object[] { }, new string[] { }); + return ReturnToDouble(iv); + } + public double GetTotal() + { + var iv = InvokeMethodSync("p:Total", new object[] { }, new string[] { }); + return ReturnToDouble(iv); + } + public async Task GetCurrentAsync() + { + var iv = await InvokeMethod("p:Current", new object[] { }, new string[] { }); + return ReturnToDouble(iv); + } + public double GetCurrent() + { + var iv = InvokeMethodSync("p:Current", new object[] { }, new string[] { }); + return ReturnToDouble(iv); + } + public async Task GetIsPlayingAsync() + { + var iv = await InvokeMethod("p:IsPlaying", new object[] { }, new string[] { }); + return ReturnToBoolean(iv); + } + public bool GetIsPlaying() + { + var iv = InvokeMethodSync("p:IsPlaying", new object[] { }, new string[] { }); + return ReturnToBoolean(iv); + } + public async Task GetIsPausedAsync() + { + var iv = await InvokeMethod("p:IsPaused", new object[] { }, new string[] { }); + return ReturnToBoolean(iv); + } + public bool GetIsPaused() + { + var iv = InvokeMethodSync("p:IsPaused", new object[] { }, new string[] { }); + return ReturnToBoolean(iv); + } + + partial void FindByNameCarousel(string name, ref object item); + public override object FindByName(string name) + { + + var baseResult = base.FindByName(name); + if (baseResult != null) + { + return baseResult; + } + + object item = null; + FindByNameCarousel(name, ref item); + if (item != null) + { + return item; + } + + return null; + } + public async Task SetNativeElementAsync(Object element) + { + await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + } + public void SetNativeElement(Object element) + { + InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + } + /// + /// Resumes playing of the carousel slides. + /// + public async Task PlayAsync() + { + await InvokeMethod("play", new object[] { }, new string[] { }); + } + public void Play() + { + InvokeMethodSync("play", new object[] { }, new string[] { }); + } + /// + /// Pauses the carousel rotation of slides. + /// + public async Task PauseAsync() + { + await InvokeMethod("pause", new object[] { }, new string[] { }); + } + public void Pause() + { + InvokeMethodSync("pause", new object[] { }, new string[] { }); + } + /// + /// Switches to the next slide, runs any animations, and returns if the operation was successful. + /// + public async Task NextAsync() + { + var iv = await InvokeMethod("next", new object[] { }, new string[] { }); + return ReturnToBoolean(iv); + } + public bool Next() + { + var iv = InvokeMethodSync("next", new object[] { }, new string[] { }); + return ReturnToBoolean(iv); + } + /// + /// Switches to the previous slide, runs any animations, and returns if the operation was successful. + /// + public async Task PrevAsync() + { + var iv = await InvokeMethod("prev", new object[] { }, new string[] { }); + return ReturnToBoolean(iv); + } + public bool Prev() + { + var iv = InvokeMethodSync("prev", new object[] { }, new string[] { }); + return ReturnToBoolean(iv); + } + public async Task SelectAsync(double index, CarouselAnimationDirection? animationDirection = null) + { + var iv = await InvokeMethod("select", new object[] { index, ObjectToParam(animationDirection, typeof(CarouselAnimationDirection)) }, new string[] { "Number", "Json" }); + return ReturnToBoolean(iv); + } + public bool Select(double index, CarouselAnimationDirection? animationDirection = null) + { + var iv = InvokeMethodSync("select", new object[] { index, ObjectToParam(animationDirection, typeof(CarouselAnimationDirection)) }, new string[] { "Number", "Json" }); + return ReturnToBoolean(iv); + } + + private string _slideChangedRef = null; + private string _slideChangedScript = null; + [Parameter] + public string SlideChangedScript + { + + set + { + if (value != this._slideChangedScript) + { + this._slideChangedScript = value; + this.OnRefChanged("SlideChanged", null, value, true, false, (string refName, object oldValue, object newValue) => + { + this._slideChangedRef = refName; + this.MarkPropDirty("SlideChangedRef"); + }); + } + } + get + { + return this._slideChangedScript; + } + } + + partial void OnHandlingSlideChanged(IgbNumberEventArgs args); + private EventCallback? _slideChanged = null; + [Parameter] + public EventCallback SlideChanged + { + get + { + return this._slideChanged != null ? this._slideChanged.Value : EventCallback.Empty; + } + set + { + if (!value.Equals(EventCallback.Empty)) + { + if (!CompareEventCallbacks(value, _slideChanged, ref eventCallbacksCache)) + { + _slideChanged = value; + this.SetHandler(this.Name, "SlideChanged", value, (args) => { - return "inline-block"; - } + OnHandlingSlideChanged(args); - protected override bool SupportsVisualChildren + }); + this.OnRefChanged("SlideChanged", null, "event:::SlideChanged", true, false, (refName, oldValue, newValue) => { - get - { - return true; - } - } + this._slideChangedRef = refName; + this.MarkPropDirty("SlideChangedRef"); + }); + } + } + else + { + _slideChanged = null; + this.SetHandler(this.Name, "SlideChanged", null); + this.OnRefChanged("SlideChanged", null, null, true, false, (refName, oldValue, newValue) => + { + this._slideChangedRef = null; + this.MarkPropDirty("SlideChangedRef"); + }); + } + } + } + + private string _playingRef = null; + private string _playingScript = null; + [Parameter] + public string PlayingScript + { + + set + { + if (value != this._playingScript) + { + this._playingScript = value; + this.OnRefChanged("Playing", null, value, true, false, (string refName, object oldValue, object newValue) => + { + this._playingRef = refName; + this.MarkPropDirty("PlayingRef"); + }); + } + } + get + { + return this._playingScript; + } + } - protected override bool UseDirectRender + partial void OnHandlingPlaying(IgbVoidEventArgs args); + private EventCallback? _playing = null; + [Parameter] + public EventCallback Playing + { + get + { + return this._playing != null ? this._playing.Value : EventCallback.Empty; + } + set + { + if (!value.Equals(EventCallback.Empty)) + { + if (!CompareEventCallbacks(value, _playing, ref eventCallbacksCache)) + { + _playing = value; + this.SetHandler(this.Name, "Playing", value, (args) => { - get - { - return true; - } - } + OnHandlingPlaying(args); - protected override string DirectRenderElementName + }); + this.OnRefChanged("Playing", null, "event:::Playing", true, false, (refName, oldValue, newValue) => { - get - { - return "igc-carousel"; - } - } - - protected override ControlEventBehavior DefaultEventBehavior - { - get { return ControlEventBehavior.Immediate; } - } - - public IgbCarousel(): base() { - OnCreatedIgbCarousel(); - - - } - - partial void OnCreatedIgbCarousel(); - - private bool _disableLoop = false; - - partial void OnDisableLoopChanging(ref bool newValue); - /// - /// Whether the carousel should skip rotating to the first slide after it reaches the last. - /// - [Parameter] - public bool DisableLoop - { - get { return this._disableLoop; } - set { - if (this._disableLoop != value || !IsPropDirty("DisableLoop")) { - MarkPropDirty("DisableLoop"); - } - this._disableLoop = value; - - } - } - private bool _disablePauseOnInteraction = false; - - partial void OnDisablePauseOnInteractionChanging(ref bool newValue); - /// - /// Whether the carousel should ignore use interactions and not pause on them. - /// - [Parameter] - public bool DisablePauseOnInteraction - { - get { return this._disablePauseOnInteraction; } - set { - if (this._disablePauseOnInteraction != value || !IsPropDirty("DisablePauseOnInteraction")) { - MarkPropDirty("DisablePauseOnInteraction"); - } - this._disablePauseOnInteraction = value; - - } - } - private bool _hideNavigation = false; - - partial void OnHideNavigationChanging(ref bool newValue); - /// - /// Whether the carousel should skip rendering of the default navigation buttons. - /// - [Parameter] - public bool HideNavigation - { - get { return this._hideNavigation; } - set { - if (this._hideNavigation != value || !IsPropDirty("HideNavigation")) { - MarkPropDirty("HideNavigation"); - } - this._hideNavigation = value; - - } - } - private bool _hideIndicators = false; - - partial void OnHideIndicatorsChanging(ref bool newValue); - /// - /// Whether the carousel should render the indicator controls (dots). - /// - [Parameter] - public bool HideIndicators - { - get { return this._hideIndicators; } - set { - if (this._hideIndicators != value || !IsPropDirty("HideIndicators")) { - MarkPropDirty("HideIndicators"); - } - this._hideIndicators = value; - - } - } - private bool _vertical = false; - - partial void OnVerticalChanging(ref bool newValue); - /// - /// Whether the carousel has vertical alignment. - /// - [Parameter] - public bool Vertical - { - get { return this._vertical; } - set { - if (this._vertical != value || !IsPropDirty("Vertical")) { - MarkPropDirty("Vertical"); - } - this._vertical = value; - - } - } - private CarouselIndicatorsOrientation _indicatorsOrientation = CarouselIndicatorsOrientation.End; - - partial void OnIndicatorsOrientationChanging(ref CarouselIndicatorsOrientation newValue); - /// - /// Sets the orientation of the indicator controls (dots). - /// - [Parameter] - public CarouselIndicatorsOrientation IndicatorsOrientation - { - get { return this._indicatorsOrientation; } - set { - if (this._indicatorsOrientation != value || !IsPropDirty("IndicatorsOrientation")) { - MarkPropDirty("IndicatorsOrientation"); - } - this._indicatorsOrientation = value; - - } - } - private string _indicatorsLabelFormat; - - partial void OnIndicatorsLabelFormatChanging(ref string newValue); - /// - /// The format used to set the aria-label on the carousel indicators. - /// Instances of '{0}' will be replaced with the index of the corresponding slide. - /// - [Parameter] - public string IndicatorsLabelFormat - { - get { return this._indicatorsLabelFormat; } - set { - if (this._indicatorsLabelFormat != value || !IsPropDirty("IndicatorsLabelFormat")) { - MarkPropDirty("IndicatorsLabelFormat"); - } - this._indicatorsLabelFormat = value; - - } - } - private string _slidesLabelFormat; - - partial void OnSlidesLabelFormatChanging(ref string newValue); - /// - /// The format used to set the aria-label on the carousel slides and the text displayed - /// when the number of indicators is greater than tha maximum indicator count. - /// Instances of '{0}' will be replaced with the index of the corresponding slide. - /// Instances of '{1}' will be replaced with the total amount of slides. - /// - [Parameter] - public string SlidesLabelFormat - { - get { return this._slidesLabelFormat; } - set { - if (this._slidesLabelFormat != value || !IsPropDirty("SlidesLabelFormat")) { - MarkPropDirty("SlidesLabelFormat"); - } - this._slidesLabelFormat = value; - - } - } - private double _interval = 0; - - partial void OnIntervalChanging(ref double newValue); - /// - /// The duration in milliseconds between changing the active slide. - /// - [Parameter] - public double Interval - { - get { return this._interval; } - set { - if (this._interval != value || !IsPropDirty("Interval")) { - MarkPropDirty("Interval"); - } - this._interval = value; - - } - } - private double _maximumIndicatorsCount = 0; - - partial void OnMaximumIndicatorsCountChanging(ref double newValue); - /// - /// Controls the maximum indicator controls (dots) that can be shown. Default value is `10`. - /// - [Parameter] - public double MaximumIndicatorsCount - { - get { return this._maximumIndicatorsCount; } - set { - if (this._maximumIndicatorsCount != value || !IsPropDirty("MaximumIndicatorsCount")) { - MarkPropDirty("MaximumIndicatorsCount"); - } - this._maximumIndicatorsCount = value; - - } - } - private HorizontalTransitionAnimation _animationType = HorizontalTransitionAnimation.Slide; - - partial void OnAnimationTypeChanging(ref HorizontalTransitionAnimation newValue); - /// - /// The animation type. - /// - [Parameter] - public HorizontalTransitionAnimation AnimationType - { - get { return this._animationType; } - set { - if (this._animationType != value || !IsPropDirty("AnimationType")) { - MarkPropDirty("AnimationType"); - } - this._animationType = value; - - } - } - public async Task GetTotalAsync() - { - var iv = await InvokeMethod("p:Total", new object[] { }, new string[] { }); - return ReturnToDouble(iv); - } - public double GetTotal() - { - var iv = InvokeMethodSync("p:Total", new object[] { }, new string[] { }); - return ReturnToDouble(iv); - } - public async Task GetCurrentAsync() - { - var iv = await InvokeMethod("p:Current", new object[] { }, new string[] { }); - return ReturnToDouble(iv); - } - public double GetCurrent() - { - var iv = InvokeMethodSync("p:Current", new object[] { }, new string[] { }); - return ReturnToDouble(iv); - } - public async Task GetIsPlayingAsync() - { - var iv = await InvokeMethod("p:IsPlaying", new object[] { }, new string[] { }); - return ReturnToBoolean(iv); - } - public bool GetIsPlaying() - { - var iv = InvokeMethodSync("p:IsPlaying", new object[] { }, new string[] { }); - return ReturnToBoolean(iv); - } - public async Task GetIsPausedAsync() - { - var iv = await InvokeMethod("p:IsPaused", new object[] { }, new string[] { }); - return ReturnToBoolean(iv); - } - public bool GetIsPaused() - { - var iv = InvokeMethodSync("p:IsPaused", new object[] { }, new string[] { }); - return ReturnToBoolean(iv); - } - - partial void FindByNameCarousel(string name, ref object item); - public override object FindByName(string name) - { - - var baseResult = base.FindByName(name); - if (baseResult != null) - { - return baseResult; - } - - object item = null; - FindByNameCarousel(name, ref item); - if (item != null) - { - return item; - } - - return null; - } - public async Task SetNativeElementAsync(Object element) - { - await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); - } - public void SetNativeElement(Object element) - { - InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); - } - /// - /// Resumes playing of the carousel slides. - /// - public async Task PlayAsync() - { - await InvokeMethod("play", new object[] { }, new string[] { }); - } - public void Play() - { - InvokeMethodSync("play", new object[] { }, new string[] { }); - } - /// - /// Pauses the carousel rotation of slides. - /// - public async Task PauseAsync() - { - await InvokeMethod("pause", new object[] { }, new string[] { }); - } - public void Pause() - { - InvokeMethodSync("pause", new object[] { }, new string[] { }); - } - /// - /// Switches to the next slide, runs any animations, and returns if the operation was successful. - /// - public async Task NextAsync() - { - var iv = await InvokeMethod("next", new object[] { }, new string[] { }); - return ReturnToBoolean(iv); - } - public bool Next() - { - var iv = InvokeMethodSync("next", new object[] { }, new string[] { }); - return ReturnToBoolean(iv); - } - /// - /// Switches to the previous slide, runs any animations, and returns if the operation was successful. - /// - public async Task PrevAsync() - { - var iv = await InvokeMethod("prev", new object[] { }, new string[] { }); - return ReturnToBoolean(iv); - } - public bool Prev() - { - var iv = InvokeMethodSync("prev", new object[] { }, new string[] { }); - return ReturnToBoolean(iv); - } - public async Task SelectAsync(double index, CarouselAnimationDirection? animationDirection = null) - { - var iv = await InvokeMethod("select", new object[] { index, ObjectToParam(animationDirection, typeof(CarouselAnimationDirection)) }, new string[] { "Number", "Json" }); - return ReturnToBoolean(iv); - } - public bool Select(double index, CarouselAnimationDirection? animationDirection = null) - { - var iv = InvokeMethodSync("select", new object[] { index, ObjectToParam(animationDirection, typeof(CarouselAnimationDirection)) }, new string[] { "Number", "Json" }); - return ReturnToBoolean(iv); - } - - private string _slideChangedRef = null; - private string _slideChangedScript = null; - [Parameter] - public string SlideChangedScript { - - set - { - if (value != this._slideChangedScript) - { - this._slideChangedScript = value; - this.OnRefChanged("SlideChanged", null, value, true, false, (string refName, object oldValue, object newValue) => { - this._slideChangedRef = refName; - this.MarkPropDirty("SlideChangedRef"); - }); - } - } - get - { - return this._slideChangedScript; - } - } - - partial void OnHandlingSlideChanged(IgbNumberEventArgs args); - private EventCallback? _slideChanged = null; - [Parameter] - public EventCallback SlideChanged - { - get - { - return this._slideChanged != null ? this._slideChanged.Value : EventCallback.Empty; - } - set - { - if (!value.Equals(EventCallback.Empty)) - { - if (!CompareEventCallbacks(value, _slideChanged, ref eventCallbacksCache)) - { - _slideChanged = value; - this.SetHandler(this.Name, "SlideChanged", value, (args) => { - OnHandlingSlideChanged(args); - - }); - this.OnRefChanged("SlideChanged", null, "event:::SlideChanged", true, false, (refName, oldValue, newValue) => { - this._slideChangedRef = refName; - this.MarkPropDirty("SlideChangedRef"); - }); - } - } - else - { - _slideChanged = null; - this.SetHandler(this.Name, "SlideChanged", null); - this.OnRefChanged("SlideChanged", null, null, true, false, (refName, oldValue, newValue) => { - this._slideChangedRef = null; - this.MarkPropDirty("SlideChangedRef"); - }); - } - } - } - - private string _playingRef = null; - private string _playingScript = null; - [Parameter] - public string PlayingScript { - - set - { - if (value != this._playingScript) - { - this._playingScript = value; - this.OnRefChanged("Playing", null, value, true, false, (string refName, object oldValue, object newValue) => { - this._playingRef = refName; - this.MarkPropDirty("PlayingRef"); - }); - } - } - get - { - return this._playingScript; - } - } - - partial void OnHandlingPlaying(IgbVoidEventArgs args); - private EventCallback? _playing = null; - [Parameter] - public EventCallback Playing - { - get - { - return this._playing != null ? this._playing.Value : EventCallback.Empty; - } - set - { - if (!value.Equals(EventCallback.Empty)) - { - if (!CompareEventCallbacks(value, _playing, ref eventCallbacksCache)) - { - _playing = value; - this.SetHandler(this.Name, "Playing", value, (args) => { - OnHandlingPlaying(args); - - }); - this.OnRefChanged("Playing", null, "event:::Playing", true, false, (refName, oldValue, newValue) => { - this._playingRef = refName; - this.MarkPropDirty("PlayingRef"); - }); - } - } - else - { - _playing = null; - this.SetHandler(this.Name, "Playing", null); - this.OnRefChanged("Playing", null, null, true, false, (refName, oldValue, newValue) => { - this._playingRef = null; - this.MarkPropDirty("PlayingRef"); - }); - } - } - } - - private string _pausedRef = null; - private string _pausedScript = null; - [Parameter] - public string PausedScript { - - set - { - if (value != this._pausedScript) - { - this._pausedScript = value; - this.OnRefChanged("Paused", null, value, true, false, (string refName, object oldValue, object newValue) => { - this._pausedRef = refName; - this.MarkPropDirty("PausedRef"); - }); - } - } - get - { - return this._pausedScript; - } - } - - partial void OnHandlingPaused(IgbVoidEventArgs args); - private EventCallback? _paused = null; - [Parameter] - public EventCallback Paused - { - get - { - return this._paused != null ? this._paused.Value : EventCallback.Empty; - } - set - { - if (!value.Equals(EventCallback.Empty)) - { - if (!CompareEventCallbacks(value, _paused, ref eventCallbacksCache)) - { - _paused = value; - this.SetHandler(this.Name, "Paused", value, (args) => { - OnHandlingPaused(args); - - }); - this.OnRefChanged("Paused", null, "event:::Paused", true, false, (refName, oldValue, newValue) => { - this._pausedRef = refName; - this.MarkPropDirty("PausedRef"); - }); - } - } - else - { - _paused = null; - this.SetHandler(this.Name, "Paused", null); - this.OnRefChanged("Paused", null, null, true, false, (refName, oldValue, newValue) => { - this._pausedRef = null; - this.MarkPropDirty("PausedRef"); - }); - } - } - } - - partial void SerializeCoreIgbCarousel(RendererSerializer ser); - - internal override void SerializeCore(RendererSerializer ser) - { - base.SerializeCore(ser); - - SerializeCoreIgbCarousel(ser); - - if (IsPropDirty("DisableLoop")) { ser.AddBooleanProp("disableLoop", this._disableLoop); } - if (IsPropDirty("DisablePauseOnInteraction")) { ser.AddBooleanProp("disablePauseOnInteraction", this._disablePauseOnInteraction); } - if (IsPropDirty("HideNavigation")) { ser.AddBooleanProp("hideNavigation", this._hideNavigation); } - if (IsPropDirty("HideIndicators")) { ser.AddBooleanProp("hideIndicators", this._hideIndicators); } - if (IsPropDirty("Vertical")) { ser.AddBooleanProp("vertical", this._vertical); } - if (IsPropDirty("IndicatorsOrientation")) { ser.AddEnumProp("indicatorsOrientation", this._indicatorsOrientation); } - if (IsPropDirty("IndicatorsLabelFormat")) { ser.AddStringProp("indicatorsLabelFormat", this._indicatorsLabelFormat); } - if (IsPropDirty("SlidesLabelFormat")) { ser.AddStringProp("slidesLabelFormat", this._slidesLabelFormat); } - if (IsPropDirty("Interval")) { ser.AddNumberProp("interval", this._interval); } - if (IsPropDirty("MaximumIndicatorsCount")) { ser.AddNumberProp("maximumIndicatorsCount", this._maximumIndicatorsCount); } - if (IsPropDirty("AnimationType")) { ser.AddEnumProp("animationType", this._animationType); } - if (IsPropDirty("SlideChangedRef")) { ser.AddStringProp("slideChangedRef", this._slideChangedRef); } - if (IsPropDirty("PlayingRef")) { ser.AddStringProp("playingRef", this._playingRef); } - if (IsPropDirty("PausedRef")) { ser.AddStringProp("pausedRef", this._pausedRef); } - - } - -} + this._playingRef = refName; + this.MarkPropDirty("PlayingRef"); + }); + } + } + else + { + _playing = null; + this.SetHandler(this.Name, "Playing", null); + this.OnRefChanged("Playing", null, null, true, false, (refName, oldValue, newValue) => + { + this._playingRef = null; + this.MarkPropDirty("PlayingRef"); + }); + } + } + } + + private string _pausedRef = null; + private string _pausedScript = null; + [Parameter] + public string PausedScript + { + + set + { + if (value != this._pausedScript) + { + this._pausedScript = value; + this.OnRefChanged("Paused", null, value, true, false, (string refName, object oldValue, object newValue) => + { + this._pausedRef = refName; + this.MarkPropDirty("PausedRef"); + }); + } + } + get + { + return this._pausedScript; + } + } + + partial void OnHandlingPaused(IgbVoidEventArgs args); + private EventCallback? _paused = null; + [Parameter] + public EventCallback Paused + { + get + { + return this._paused != null ? this._paused.Value : EventCallback.Empty; + } + set + { + if (!value.Equals(EventCallback.Empty)) + { + if (!CompareEventCallbacks(value, _paused, ref eventCallbacksCache)) + { + _paused = value; + this.SetHandler(this.Name, "Paused", value, (args) => + { + OnHandlingPaused(args); + + }); + this.OnRefChanged("Paused", null, "event:::Paused", true, false, (refName, oldValue, newValue) => + { + this._pausedRef = refName; + this.MarkPropDirty("PausedRef"); + }); + } + } + else + { + _paused = null; + this.SetHandler(this.Name, "Paused", null); + this.OnRefChanged("Paused", null, null, true, false, (refName, oldValue, newValue) => + { + this._pausedRef = null; + this.MarkPropDirty("PausedRef"); + }); + } + } + } + + partial void SerializeCoreIgbCarousel(RendererSerializer ser); + + internal override void SerializeCore(RendererSerializer ser) + { + base.SerializeCore(ser); + + SerializeCoreIgbCarousel(ser); + + if (IsPropDirty("DisableLoop")) + { ser.AddBooleanProp("disableLoop", this._disableLoop); } + if (IsPropDirty("DisablePauseOnInteraction")) + { ser.AddBooleanProp("disablePauseOnInteraction", this._disablePauseOnInteraction); } + if (IsPropDirty("HideNavigation")) + { ser.AddBooleanProp("hideNavigation", this._hideNavigation); } + if (IsPropDirty("HideIndicators")) + { ser.AddBooleanProp("hideIndicators", this._hideIndicators); } + if (IsPropDirty("Vertical")) + { ser.AddBooleanProp("vertical", this._vertical); } + if (IsPropDirty("IndicatorsOrientation")) + { ser.AddEnumProp("indicatorsOrientation", this._indicatorsOrientation); } + if (IsPropDirty("IndicatorsLabelFormat")) + { ser.AddStringProp("indicatorsLabelFormat", this._indicatorsLabelFormat); } + if (IsPropDirty("SlidesLabelFormat")) + { ser.AddStringProp("slidesLabelFormat", this._slidesLabelFormat); } + if (IsPropDirty("Interval")) + { ser.AddNumberProp("interval", this._interval); } + if (IsPropDirty("MaximumIndicatorsCount")) + { ser.AddNumberProp("maximumIndicatorsCount", this._maximumIndicatorsCount); } + if (IsPropDirty("AnimationType")) + { ser.AddEnumProp("animationType", this._animationType); } + if (IsPropDirty("SlideChangedRef")) + { ser.AddStringProp("slideChangedRef", this._slideChangedRef); } + if (IsPropDirty("PlayingRef")) + { ser.AddStringProp("playingRef", this._playingRef); } + if (IsPropDirty("PausedRef")) + { ser.AddStringProp("pausedRef", this._pausedRef); } + + } + + } } diff --git a/src/components/Blazor/CarouselAnimationDirection.cs b/src/components/Blazor/CarouselAnimationDirection.cs index e9796603..0050efec 100644 --- a/src/components/Blazor/CarouselAnimationDirection.cs +++ b/src/components/Blazor/CarouselAnimationDirection.cs @@ -1,8 +1,9 @@ namespace IgniteUI.Blazor.Controls { -public enum CarouselAnimationDirection { - Next, - Prev + public enum CarouselAnimationDirection + { + Next, + Prev -} + } } diff --git a/src/components/Blazor/CarouselIndicator.cs b/src/components/Blazor/CarouselIndicator.cs index 8a984b1e..a2565349 100644 --- a/src/components/Blazor/CarouselIndicator.cs +++ b/src/components/Blazor/CarouselIndicator.cs @@ -1,108 +1,99 @@ - -using System; -using Microsoft.AspNetCore.Components; -using Microsoft.AspNetCore.Components.Rendering; -using System.Threading.Tasks; -using System.Collections.Generic; -using System.Linq; - namespace IgniteUI.Blazor.Controls { - /// -/// Used when a custom indicator needs to be passed to the `igc-carousel` component. -/// -public partial class IgbCarouselIndicator: BaseRendererControl { - public override string Type { get { return "WebCarouselIndicator"; } } - - protected override void EnsureModulesLoaded() - { - if (!IgbCarouselIndicatorModule.IsLoadRequested(IgBlazor)) - { - IgbCarouselIndicatorModule.Register(IgBlazor); - } - } - - protected override string ResolveDisplay() - { - return "inline-block"; - } - - protected override bool SupportsVisualChildren - { - get - { - return true; - } - } - - protected override bool UseDirectRender - { - get - { - return true; - } - } - - protected override string DirectRenderElementName - { - get - { - return "igc-carousel-indicator"; - } - } - - protected override ControlEventBehavior DefaultEventBehavior - { - get { return ControlEventBehavior.Immediate; } - } - - public IgbCarouselIndicator(): base() { - OnCreatedIgbCarouselIndicator(); - - - } - - partial void OnCreatedIgbCarouselIndicator(); - - - partial void FindByNameCarouselIndicator(string name, ref object item); - public override object FindByName(string name) - { - - var baseResult = base.FindByName(name); - if (baseResult != null) - { - return baseResult; - } - - object item = null; - FindByNameCarouselIndicator(name, ref item); - if (item != null) - { - return item; - } - - return null; - } - public async Task SetNativeElementAsync(Object element) - { - await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); - } - public void SetNativeElement(Object element) - { - InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); - } - - partial void SerializeCoreIgbCarouselIndicator(RendererSerializer ser); - - internal override void SerializeCore(RendererSerializer ser) - { - base.SerializeCore(ser); - - SerializeCoreIgbCarouselIndicator(ser); - - - } - -} + /// + /// Used when a custom indicator needs to be passed to the `igc-carousel` component. + /// + public partial class IgbCarouselIndicator : BaseRendererControl + { + public override string Type { get { return "WebCarouselIndicator"; } } + + protected override void EnsureModulesLoaded() + { + if (!IgbCarouselIndicatorModule.IsLoadRequested(IgBlazor)) + { + IgbCarouselIndicatorModule.Register(IgBlazor); + } + } + + protected override string ResolveDisplay() + { + return "inline-block"; + } + + protected override bool SupportsVisualChildren + { + get + { + return true; + } + } + + protected override bool UseDirectRender + { + get + { + return true; + } + } + + protected override string DirectRenderElementName + { + get + { + return "igc-carousel-indicator"; + } + } + + protected override ControlEventBehavior DefaultEventBehavior + { + get { return ControlEventBehavior.Immediate; } + } + + public IgbCarouselIndicator() : base() + { + OnCreatedIgbCarouselIndicator(); + + } + + partial void OnCreatedIgbCarouselIndicator(); + + partial void FindByNameCarouselIndicator(string name, ref object item); + public override object FindByName(string name) + { + + var baseResult = base.FindByName(name); + if (baseResult != null) + { + return baseResult; + } + + object item = null; + FindByNameCarouselIndicator(name, ref item); + if (item != null) + { + return item; + } + + return null; + } + public async Task SetNativeElementAsync(Object element) + { + await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + } + public void SetNativeElement(Object element) + { + InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + } + + partial void SerializeCoreIgbCarouselIndicator(RendererSerializer ser); + + internal override void SerializeCore(RendererSerializer ser) + { + base.SerializeCore(ser); + + SerializeCoreIgbCarouselIndicator(ser); + + } + + } } diff --git a/src/components/Blazor/CarouselIndicatorModule.cs b/src/components/Blazor/CarouselIndicatorModule.cs index 0c1847e1..44d02c28 100644 --- a/src/components/Blazor/CarouselIndicatorModule.cs +++ b/src/components/Blazor/CarouselIndicatorModule.cs @@ -1,23 +1,20 @@ -using System; -using System.Collections.Generic; -using System.Runtime.CompilerServices; -using System.Text; -using System.Collections.Generic; - namespace IgniteUI.Blazor.Controls { - public partial class IgbCarouselIndicatorModule { - public static void Register(IIgniteUIBlazor runtime) { + public partial class IgbCarouselIndicatorModule + { + public static void Register(IIgniteUIBlazor runtime) + { ModuleLoader.Load(runtime, "WebCarouselIndicatorModule"); - } - public static void MarkIsLoadRequested(IIgniteUIBlazor runtime) { + public static void MarkIsLoadRequested(IIgniteUIBlazor runtime) + { ModuleLoader.MarkIsLoadRequested(runtime, "WebCarouselIndicatorModule"); } - public static bool IsLoadRequested(IIgniteUIBlazor runtime) { + public static bool IsLoadRequested(IIgniteUIBlazor runtime) + { return ModuleLoader.IsLoadRequested(runtime, "WebCarouselIndicatorModule"); } } diff --git a/src/components/Blazor/CarouselIndicatorsOrientation.cs b/src/components/Blazor/CarouselIndicatorsOrientation.cs index 99fffd6c..0a16d70d 100644 --- a/src/components/Blazor/CarouselIndicatorsOrientation.cs +++ b/src/components/Blazor/CarouselIndicatorsOrientation.cs @@ -1,8 +1,9 @@ namespace IgniteUI.Blazor.Controls { -public enum CarouselIndicatorsOrientation { - End, - Start + public enum CarouselIndicatorsOrientation + { + End, + Start -} + } } diff --git a/src/components/Blazor/CarouselModule.cs b/src/components/Blazor/CarouselModule.cs index 2be987ea..4ea48e53 100644 --- a/src/components/Blazor/CarouselModule.cs +++ b/src/components/Blazor/CarouselModule.cs @@ -1,23 +1,20 @@ -using System; -using System.Collections.Generic; -using System.Runtime.CompilerServices; -using System.Text; -using System.Collections.Generic; - namespace IgniteUI.Blazor.Controls { - public partial class IgbCarouselModule { - public static void Register(IIgniteUIBlazor runtime) { + public partial class IgbCarouselModule + { + public static void Register(IIgniteUIBlazor runtime) + { ModuleLoader.Load(runtime, "WebCarouselModule"); - } - public static void MarkIsLoadRequested(IIgniteUIBlazor runtime) { + public static void MarkIsLoadRequested(IIgniteUIBlazor runtime) + { ModuleLoader.MarkIsLoadRequested(runtime, "WebCarouselModule"); } - public static bool IsLoadRequested(IIgniteUIBlazor runtime) { + public static bool IsLoadRequested(IIgniteUIBlazor runtime) + { return ModuleLoader.IsLoadRequested(runtime, "WebCarouselModule"); } } diff --git a/src/components/Blazor/CarouselSlide.cs b/src/components/Blazor/CarouselSlide.cs index a819b332..d0fed9cd 100644 --- a/src/components/Blazor/CarouselSlide.cs +++ b/src/components/Blazor/CarouselSlide.cs @@ -1,127 +1,125 @@ - -using System; using Microsoft.AspNetCore.Components; -using Microsoft.AspNetCore.Components.Rendering; -using System.Threading.Tasks; -using System.Collections.Generic; -using System.Linq; namespace IgniteUI.Blazor.Controls { - /// -/// A single content container within a set of containers used in the context of an `igc-carousel`. -/// -public partial class IgbCarouselSlide: BaseRendererControl { - public override string Type { get { return "WebCarouselSlide"; } } - - protected override void EnsureModulesLoaded() - { - if (!IgbCarouselSlideModule.IsLoadRequested(IgBlazor)) - { - IgbCarouselSlideModule.Register(IgBlazor); - } - } - - protected override string ResolveDisplay() - { - return "inline-block"; - } - - protected override bool SupportsVisualChildren - { - get - { - return true; - } - } - - protected override bool UseDirectRender - { - get - { - return true; - } - } - - protected override string DirectRenderElementName - { - get - { - return "igc-carousel-slide"; - } - } - - protected override ControlEventBehavior DefaultEventBehavior - { - get { return ControlEventBehavior.Immediate; } - } - - public IgbCarouselSlide(): base() { - OnCreatedIgbCarouselSlide(); - - - } - - partial void OnCreatedIgbCarouselSlide(); - - private bool _active = false; - - partial void OnActiveChanging(ref bool newValue); - /// - /// The current active slide for the carousel component. - /// - [Parameter] - public bool Active - { - get { return this._active; } - set { - if (this._active != value || !IsPropDirty("Active")) { - MarkPropDirty("Active"); - } - this._active = value; - - } - } - - partial void FindByNameCarouselSlide(string name, ref object item); - public override object FindByName(string name) - { - - var baseResult = base.FindByName(name); - if (baseResult != null) - { - return baseResult; - } - - object item = null; - FindByNameCarouselSlide(name, ref item); - if (item != null) - { - return item; - } - - return null; - } - public async Task SetNativeElementAsync(Object element) - { - await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); - } - public void SetNativeElement(Object element) - { - InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); - } - - partial void SerializeCoreIgbCarouselSlide(RendererSerializer ser); - - internal override void SerializeCore(RendererSerializer ser) - { - base.SerializeCore(ser); - - SerializeCoreIgbCarouselSlide(ser); - - if (IsPropDirty("Active")) { ser.AddBooleanProp("active", this._active); } - - } - -} + /// + /// A single content container within a set of containers used in the context of an `igc-carousel`. + /// + public partial class IgbCarouselSlide : BaseRendererControl + { + public override string Type { get { return "WebCarouselSlide"; } } + + protected override void EnsureModulesLoaded() + { + if (!IgbCarouselSlideModule.IsLoadRequested(IgBlazor)) + { + IgbCarouselSlideModule.Register(IgBlazor); + } + } + + protected override string ResolveDisplay() + { + return "inline-block"; + } + + protected override bool SupportsVisualChildren + { + get + { + return true; + } + } + + protected override bool UseDirectRender + { + get + { + return true; + } + } + + protected override string DirectRenderElementName + { + get + { + return "igc-carousel-slide"; + } + } + + protected override ControlEventBehavior DefaultEventBehavior + { + get { return ControlEventBehavior.Immediate; } + } + + public IgbCarouselSlide() : base() + { + OnCreatedIgbCarouselSlide(); + + } + + partial void OnCreatedIgbCarouselSlide(); + + private bool _active = false; + + partial void OnActiveChanging(ref bool newValue); + /// + /// The current active slide for the carousel component. + /// + [Parameter] + public bool Active + { + get { return this._active; } + set + { + if (this._active != value || !IsPropDirty("Active")) + { + MarkPropDirty("Active"); + } + this._active = value; + + } + } + + partial void FindByNameCarouselSlide(string name, ref object item); + public override object FindByName(string name) + { + + var baseResult = base.FindByName(name); + if (baseResult != null) + { + return baseResult; + } + + object item = null; + FindByNameCarouselSlide(name, ref item); + if (item != null) + { + return item; + } + + return null; + } + public async Task SetNativeElementAsync(Object element) + { + await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + } + public void SetNativeElement(Object element) + { + InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + } + + partial void SerializeCoreIgbCarouselSlide(RendererSerializer ser); + + internal override void SerializeCore(RendererSerializer ser) + { + base.SerializeCore(ser); + + SerializeCoreIgbCarouselSlide(ser); + + if (IsPropDirty("Active")) + { ser.AddBooleanProp("active", this._active); } + + } + + } } diff --git a/src/components/Blazor/CarouselSlideModule.cs b/src/components/Blazor/CarouselSlideModule.cs index 117c6da0..fcfd5b75 100644 --- a/src/components/Blazor/CarouselSlideModule.cs +++ b/src/components/Blazor/CarouselSlideModule.cs @@ -1,23 +1,20 @@ -using System; -using System.Collections.Generic; -using System.Runtime.CompilerServices; -using System.Text; -using System.Collections.Generic; - namespace IgniteUI.Blazor.Controls { - public partial class IgbCarouselSlideModule { - public static void Register(IIgniteUIBlazor runtime) { + public partial class IgbCarouselSlideModule + { + public static void Register(IIgniteUIBlazor runtime) + { ModuleLoader.Load(runtime, "WebCarouselSlideModule"); - } - public static void MarkIsLoadRequested(IIgniteUIBlazor runtime) { + public static void MarkIsLoadRequested(IIgniteUIBlazor runtime) + { ModuleLoader.MarkIsLoadRequested(runtime, "WebCarouselSlideModule"); } - public static bool IsLoadRequested(IIgniteUIBlazor runtime) { + public static bool IsLoadRequested(IIgniteUIBlazor runtime) + { return ModuleLoader.IsLoadRequested(runtime, "WebCarouselSlideModule"); } } diff --git a/src/components/Blazor/Chat.cs b/src/components/Blazor/Chat.cs index 3c2c1670..e61f4eb6 100644 --- a/src/components/Blazor/Chat.cs +++ b/src/components/Blazor/Chat.cs @@ -1,600 +1,648 @@ - -using System; using Microsoft.AspNetCore.Components; -using Microsoft.AspNetCore.Components.Rendering; -using System.Threading.Tasks; -using System.Collections.Generic; -using System.Linq; namespace IgniteUI.Blazor.Controls { - /// -/// A chat UI component for displaying messages, attachments, and input interaction. -/// -public partial class IgbChat: BaseRendererControl { - public override string Type { get { return "WebChat"; } } - - protected override void EnsureModulesLoaded() - { - if (!IgbChatModule.IsLoadRequested(IgBlazor)) - { - IgbChatModule.Register(IgBlazor); - } - } - - protected override string ResolveDisplay() + /// + /// A chat UI component for displaying messages, attachments, and input interaction. + /// + public partial class IgbChat : BaseRendererControl + { + public override string Type { get { return "WebChat"; } } + + protected override void EnsureModulesLoaded() + { + if (!IgbChatModule.IsLoadRequested(IgBlazor)) + { + IgbChatModule.Register(IgBlazor); + } + } + + protected override string ResolveDisplay() + { + return "inline-block"; + } + + protected override bool SupportsVisualChildren + { + get + { + return true; + } + } + + protected override ControlEventBehavior DefaultEventBehavior + { + get { return ControlEventBehavior.Queued; } + } + + public IgbChat() : base() + { + OnCreatedIgbChat(); + + } + + partial void OnCreatedIgbChat(); + + private IgbChatMessage[] _messages; + + partial void OnMessagesChanging(ref IgbChatMessage[] newValue); + /// + /// The list of chat messages currently displayed. + /// Use this property to set or update the message history. + /// + [Parameter] + public IgbChatMessage[] Messages + { + get { return this._messages; } + set + { + if (this._messages != value || !IsPropDirty("Messages")) + { + MarkPropDirty("Messages"); + } + this._messages = value; + + } + } + private IgbChatDraftMessage _draftMessage; + + partial void OnDraftMessageChanging(ref IgbChatDraftMessage newValue); + /// + /// The chat message currently being composed but not yet sent. + /// Includes the draft text and any attachments. + /// + [Parameter] + public IgbChatDraftMessage DraftMessage + { + get { return this._draftMessage; } + set + { + OnDraftMessageChanging(ref value); + MarkPropDirty("DraftMessage"); + if (this._draftMessage != null) + { + this.DetachChild(this._draftMessage); + } + if (value != null) + { + this.AttachChild(value); + } + this._draftMessage = value; + } + + } + private IgbChatOptions? _options; + + partial void OnOptionsChanging(ref IgbChatOptions? newValue); + /// + /// Controls the chat behavior and appearance through a configuration object. + /// Use this to toggle UI options, provide suggestions, templates, etc. + /// + [Parameter] + public IgbChatOptions? Options + { + get { return this._options; } + set + { + OnOptionsChanging(ref value); + MarkPropDirty("Options"); + if (this._options != null) + { + this.DetachChild(this._options); + } + if (value != null) + { + this.AttachChild(value); + } + this._options = value; + } + + } + + partial void FindByNameChat(string name, ref object item); + public override object FindByName(string name) + { + + var baseResult = base.FindByName(name); + if (baseResult != null) + { + return baseResult; + } + + object item = null; + FindByNameChat(name, ref item); + if (item != null) + { + return item; + } + + return null; + } + public async Task SetNativeElementAsync(Object element) + { + await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + } + public void SetNativeElement(Object element) + { + InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + } + /// + /// Scrolls the view to a specific message by id. + /// + public async Task ScrollToMessageAsync(String messageId) + { + await InvokeMethod("scrollToMessage", new object[] { StringToString(messageId) }, new string[] { "String" }); + } + public void ScrollToMessage(String messageId) + { + InvokeMethodSync("scrollToMessage", new object[] { StringToString(messageId) }, new string[] { "String" }); + } + + private string _messageCreatedRef = null; + private string _messageCreatedScript = null; + [Parameter] + public string MessageCreatedScript + { + + set + { + if (value != this._messageCreatedScript) + { + this._messageCreatedScript = value; + this.OnRefChanged("MessageCreated", null, value, true, false, (string refName, object oldValue, object newValue) => + { + this._messageCreatedRef = refName; + this.MarkPropDirty("MessageCreatedRef"); + }); + } + } + get + { + return this._messageCreatedScript; + } + } + + partial void OnHandlingMessageCreated(IgbChatMessageEventArgs args); + private EventCallback? _messageCreated = null; + [Parameter] + public EventCallback MessageCreated + { + get + { + return this._messageCreated != null ? this._messageCreated.Value : EventCallback.Empty; + } + set + { + if (!value.Equals(EventCallback.Empty)) + { + if (!CompareEventCallbacks(value, _messageCreated, ref eventCallbacksCache)) + { + _messageCreated = value; + this.SetHandler(this.Name, "MessageCreated", value, (args) => { - return "inline-block"; - } + OnHandlingMessageCreated(args); - protected override bool SupportsVisualChildren + }); + this.OnRefChanged("MessageCreated", null, "event:::MessageCreated", true, false, (refName, oldValue, newValue) => { - get - { - return true; - } - } - - protected override ControlEventBehavior DefaultEventBehavior - { - get { return ControlEventBehavior.Queued; } - } - - public IgbChat(): base() { - OnCreatedIgbChat(); - - - } - - partial void OnCreatedIgbChat(); - - private IgbChatMessage[] _messages; - - partial void OnMessagesChanging(ref IgbChatMessage[] newValue); - /// - /// The list of chat messages currently displayed. - /// Use this property to set or update the message history. - /// - [Parameter] - public IgbChatMessage[] Messages - { - get { return this._messages; } - set { - if (this._messages != value || !IsPropDirty("Messages")) { - MarkPropDirty("Messages"); - } - this._messages = value; - - } - } - private IgbChatDraftMessage _draftMessage; - - partial void OnDraftMessageChanging(ref IgbChatDraftMessage newValue); - /// - /// The chat message currently being composed but not yet sent. - /// Includes the draft text and any attachments. - /// - [Parameter] - public IgbChatDraftMessage DraftMessage - { - get { return this._draftMessage; } - set { - OnDraftMessageChanging(ref value); - MarkPropDirty("DraftMessage"); - if (this._draftMessage != null) { - this.DetachChild(this._draftMessage); - } - if (value != null) { - this.AttachChild(value); - } - this._draftMessage = value; - } - - } - private IgbChatOptions? _options; - - partial void OnOptionsChanging(ref IgbChatOptions? newValue); - /// - /// Controls the chat behavior and appearance through a configuration object. - /// Use this to toggle UI options, provide suggestions, templates, etc. - /// - [Parameter] - public IgbChatOptions? Options - { - get { return this._options; } - set { - OnOptionsChanging(ref value); - MarkPropDirty("Options"); - if (this._options != null) { - this.DetachChild(this._options); - } - if (value != null) { - this.AttachChild(value); - } - this._options = value; - } - - } - - partial void FindByNameChat(string name, ref object item); - public override object FindByName(string name) - { - - var baseResult = base.FindByName(name); - if (baseResult != null) - { - return baseResult; - } - - object item = null; - FindByNameChat(name, ref item); - if (item != null) - { - return item; - } - - return null; - } - public async Task SetNativeElementAsync(Object element) - { - await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); - } - public void SetNativeElement(Object element) - { - InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); - } - /// - /// Scrolls the view to a specific message by id. - /// - public async Task ScrollToMessageAsync(String messageId) - { - await InvokeMethod("scrollToMessage", new object[] { StringToString(messageId) }, new string[] { "String" }); - } - public void ScrollToMessage(String messageId) - { - InvokeMethodSync("scrollToMessage", new object[] { StringToString(messageId) }, new string[] { "String" }); - } - - private string _messageCreatedRef = null; - private string _messageCreatedScript = null; - [Parameter] - public string MessageCreatedScript { - - set - { - if (value != this._messageCreatedScript) - { - this._messageCreatedScript = value; - this.OnRefChanged("MessageCreated", null, value, true, false, (string refName, object oldValue, object newValue) => { - this._messageCreatedRef = refName; - this.MarkPropDirty("MessageCreatedRef"); - }); - } - } - get - { - return this._messageCreatedScript; - } - } - - partial void OnHandlingMessageCreated(IgbChatMessageEventArgs args); - private EventCallback? _messageCreated = null; - [Parameter] - public EventCallback MessageCreated - { - get - { - return this._messageCreated != null ? this._messageCreated.Value : EventCallback.Empty; - } - set - { - if (!value.Equals(EventCallback.Empty)) - { - if (!CompareEventCallbacks(value, _messageCreated, ref eventCallbacksCache)) - { - _messageCreated = value; - this.SetHandler(this.Name, "MessageCreated", value, (args) => { - OnHandlingMessageCreated(args); - - }); - this.OnRefChanged("MessageCreated", null, "event:::MessageCreated", true, false, (refName, oldValue, newValue) => { - this._messageCreatedRef = refName; - this.MarkPropDirty("MessageCreatedRef"); - }); - } - } - else - { - _messageCreated = null; - this.SetHandler(this.Name, "MessageCreated", null); - this.OnRefChanged("MessageCreated", null, null, true, false, (refName, oldValue, newValue) => { - this._messageCreatedRef = null; - this.MarkPropDirty("MessageCreatedRef"); - }); - } - } - } - - private string _messageReactRef = null; - private string _messageReactScript = null; - [Parameter] - public string MessageReactScript { - - set - { - if (value != this._messageReactScript) - { - this._messageReactScript = value; - this.OnRefChanged("MessageReact", null, value, true, false, (string refName, object oldValue, object newValue) => { - this._messageReactRef = refName; - this.MarkPropDirty("MessageReactRef"); - }); - } - } - get - { - return this._messageReactScript; - } - } - - partial void OnHandlingMessageReact(IgbChatMessageReactionEventArgs args); - private EventCallback? _messageReact = null; - [Parameter] - public EventCallback MessageReact - { - get - { - return this._messageReact != null ? this._messageReact.Value : EventCallback.Empty; - } - set - { - if (!value.Equals(EventCallback.Empty)) - { - if (!CompareEventCallbacks(value, _messageReact, ref eventCallbacksCache)) - { - _messageReact = value; - this.SetHandler(this.Name, "MessageReact", value, (args) => { - OnHandlingMessageReact(args); - - }); - this.OnRefChanged("MessageReact", null, "event:::MessageReact", true, false, (refName, oldValue, newValue) => { - this._messageReactRef = refName; - this.MarkPropDirty("MessageReactRef"); - }); - } - } - else - { - _messageReact = null; - this.SetHandler(this.Name, "MessageReact", null); - this.OnRefChanged("MessageReact", null, null, true, false, (refName, oldValue, newValue) => { - this._messageReactRef = null; - this.MarkPropDirty("MessageReactRef"); - }); - } - } - } - - private string _attachmentClickRef = null; - private string _attachmentClickScript = null; - [Parameter] - public string AttachmentClickScript { - - set - { - if (value != this._attachmentClickScript) - { - this._attachmentClickScript = value; - this.OnRefChanged("AttachmentClick", null, value, true, false, (string refName, object oldValue, object newValue) => { - this._attachmentClickRef = refName; - this.MarkPropDirty("AttachmentClickRef"); - }); - } - } - get - { - return this._attachmentClickScript; - } - } - - partial void OnHandlingAttachmentClick(IgbChatMessageAttachmentEventArgs args); - private EventCallback? _attachmentClick = null; - [Parameter] - public EventCallback AttachmentClick - { - get - { - return this._attachmentClick != null ? this._attachmentClick.Value : EventCallback.Empty; - } - set - { - if (!value.Equals(EventCallback.Empty)) - { - if (!CompareEventCallbacks(value, _attachmentClick, ref eventCallbacksCache)) - { - _attachmentClick = value; - this.SetHandler(this.Name, "AttachmentClick", value, (args) => { - OnHandlingAttachmentClick(args); - - }); - this.OnRefChanged("AttachmentClick", null, "event:::AttachmentClick", true, false, (refName, oldValue, newValue) => { - this._attachmentClickRef = refName; - this.MarkPropDirty("AttachmentClickRef"); - }); - } - } - else - { - _attachmentClick = null; - this.SetHandler(this.Name, "AttachmentClick", null); - this.OnRefChanged("AttachmentClick", null, null, true, false, (refName, oldValue, newValue) => { - this._attachmentClickRef = null; - this.MarkPropDirty("AttachmentClickRef"); - }); - } - } - } - - private string _typingChangeRef = null; - private string _typingChangeScript = null; - [Parameter] - public string TypingChangeScript { - - set - { - if (value != this._typingChangeScript) - { - this._typingChangeScript = value; - this.OnRefChanged("TypingChange", null, value, true, false, (string refName, object oldValue, object newValue) => { - this._typingChangeRef = refName; - this.MarkPropDirty("TypingChangeRef"); - }); - } - } - get - { - return this._typingChangeScript; - } - } - - partial void OnHandlingTypingChange(IgbComponentBoolValueChangedEventArgs args); - private EventCallback? _typingChange = null; - [Parameter] - public EventCallback TypingChange - { - get - { - return this._typingChange != null ? this._typingChange.Value : EventCallback.Empty; - } - set - { - if (!value.Equals(EventCallback.Empty)) - { - if (!CompareEventCallbacks(value, _typingChange, ref eventCallbacksCache)) - { - _typingChange = value; - this.SetHandler(this.Name, "TypingChange", value, (args) => { - OnHandlingTypingChange(args); - - }); - this.OnRefChanged("TypingChange", null, "event:::TypingChange", true, false, (refName, oldValue, newValue) => { - this._typingChangeRef = refName; - this.MarkPropDirty("TypingChangeRef"); - }); - } - } - else - { - _typingChange = null; - this.SetHandler(this.Name, "TypingChange", null); - this.OnRefChanged("TypingChange", null, null, true, false, (refName, oldValue, newValue) => { - this._typingChangeRef = null; - this.MarkPropDirty("TypingChangeRef"); - }); - } - } - } - - private string _inputFocusRef = null; - private string _inputFocusScript = null; - [Parameter] - public string InputFocusScript { - - set - { - if (value != this._inputFocusScript) - { - this._inputFocusScript = value; - this.OnRefChanged("InputFocus", null, value, true, false, (string refName, object oldValue, object newValue) => { - this._inputFocusRef = refName; - this.MarkPropDirty("InputFocusRef"); - }); - } - } - get - { - return this._inputFocusScript; - } - } - - partial void OnHandlingInputFocus(IgbVoidEventArgs args); - private EventCallback? _inputFocus = null; - [Parameter] - public EventCallback InputFocus - { - get - { - return this._inputFocus != null ? this._inputFocus.Value : EventCallback.Empty; - } - set - { - if (!value.Equals(EventCallback.Empty)) - { - if (!CompareEventCallbacks(value, _inputFocus, ref eventCallbacksCache)) - { - _inputFocus = value; - this.SetHandler(this.Name, "InputFocus", value, (args) => { - OnHandlingInputFocus(args); - - }); - this.OnRefChanged("InputFocus", null, "event:::InputFocus", true, false, (refName, oldValue, newValue) => { - this._inputFocusRef = refName; - this.MarkPropDirty("InputFocusRef"); - }); - } - } - else - { - _inputFocus = null; - this.SetHandler(this.Name, "InputFocus", null); - this.OnRefChanged("InputFocus", null, null, true, false, (refName, oldValue, newValue) => { - this._inputFocusRef = null; - this.MarkPropDirty("InputFocusRef"); - }); - } - } - } - - private string _inputBlurRef = null; - private string _inputBlurScript = null; - [Parameter] - public string InputBlurScript { - - set - { - if (value != this._inputBlurScript) - { - this._inputBlurScript = value; - this.OnRefChanged("InputBlur", null, value, true, false, (string refName, object oldValue, object newValue) => { - this._inputBlurRef = refName; - this.MarkPropDirty("InputBlurRef"); - }); - } - } - get - { - return this._inputBlurScript; - } - } - - partial void OnHandlingInputBlur(IgbVoidEventArgs args); - private EventCallback? _inputBlur = null; - [Parameter] - public EventCallback InputBlur - { - get - { - return this._inputBlur != null ? this._inputBlur.Value : EventCallback.Empty; - } - set - { - if (!value.Equals(EventCallback.Empty)) - { - if (!CompareEventCallbacks(value, _inputBlur, ref eventCallbacksCache)) - { - _inputBlur = value; - this.SetHandler(this.Name, "InputBlur", value, (args) => { - OnHandlingInputBlur(args); - - }); - this.OnRefChanged("InputBlur", null, "event:::InputBlur", true, false, (refName, oldValue, newValue) => { - this._inputBlurRef = refName; - this.MarkPropDirty("InputBlurRef"); - }); - } - } - else - { - _inputBlur = null; - this.SetHandler(this.Name, "InputBlur", null); - this.OnRefChanged("InputBlur", null, null, true, false, (refName, oldValue, newValue) => { - this._inputBlurRef = null; - this.MarkPropDirty("InputBlurRef"); - }); - } - } - } - - private string _inputChangeRef = null; - private string _inputChangeScript = null; - [Parameter] - public string InputChangeScript { - - set - { - if (value != this._inputChangeScript) - { - this._inputChangeScript = value; - this.OnRefChanged("InputChange", null, value, true, false, (string refName, object oldValue, object newValue) => { - this._inputChangeRef = refName; - this.MarkPropDirty("InputChangeRef"); - }); - } - } - get - { - return this._inputChangeScript; - } - } - - partial void OnHandlingInputChange(IgbComponentValueChangedEventArgs args); - private EventCallback? _inputChange = null; - [Parameter] - public EventCallback InputChange - { - get - { - return this._inputChange != null ? this._inputChange.Value : EventCallback.Empty; - } - set - { - if (!value.Equals(EventCallback.Empty)) - { - if (!CompareEventCallbacks(value, _inputChange, ref eventCallbacksCache)) - { - _inputChange = value; - this.SetHandler(this.Name, "InputChange", value, (args) => { - OnHandlingInputChange(args); - - }); - this.OnRefChanged("InputChange", null, "event:::InputChange", true, false, (refName, oldValue, newValue) => { - this._inputChangeRef = refName; - this.MarkPropDirty("InputChangeRef"); - }); - } - } - else - { - _inputChange = null; - this.SetHandler(this.Name, "InputChange", null); - this.OnRefChanged("InputChange", null, null, true, false, (refName, oldValue, newValue) => { - this._inputChangeRef = null; - this.MarkPropDirty("InputChangeRef"); - }); - } - } - } - - partial void SerializeCoreIgbChat(RendererSerializer ser); - - internal override void SerializeCore(RendererSerializer ser) - { - base.SerializeCore(ser); - - SerializeCoreIgbChat(ser); - - if (IsPropDirty("Messages")) { ser.AddSerializableArrayProp("messages", this._messages); } - if (IsPropDirty("DraftMessage")) { ser.AddSerializableProp("draftMessage", this._draftMessage); } - if (IsPropDirty("Options")) { ser.AddSerializableProp("options", this._options); } - if (IsPropDirty("MessageCreatedRef")) { ser.AddStringProp("messageCreatedRef", this._messageCreatedRef); } - if (IsPropDirty("MessageReactRef")) { ser.AddStringProp("messageReactRef", this._messageReactRef); } - if (IsPropDirty("AttachmentClickRef")) { ser.AddStringProp("attachmentClickRef", this._attachmentClickRef); } - if (IsPropDirty("TypingChangeRef")) { ser.AddStringProp("typingChangeRef", this._typingChangeRef); } - if (IsPropDirty("InputFocusRef")) { ser.AddStringProp("inputFocusRef", this._inputFocusRef); } - if (IsPropDirty("InputBlurRef")) { ser.AddStringProp("inputBlurRef", this._inputBlurRef); } - if (IsPropDirty("InputChangeRef")) { ser.AddStringProp("inputChangeRef", this._inputChangeRef); } - - } - -} + this._messageCreatedRef = refName; + this.MarkPropDirty("MessageCreatedRef"); + }); + } + } + else + { + _messageCreated = null; + this.SetHandler(this.Name, "MessageCreated", null); + this.OnRefChanged("MessageCreated", null, null, true, false, (refName, oldValue, newValue) => + { + this._messageCreatedRef = null; + this.MarkPropDirty("MessageCreatedRef"); + }); + } + } + } + + private string _messageReactRef = null; + private string _messageReactScript = null; + [Parameter] + public string MessageReactScript + { + + set + { + if (value != this._messageReactScript) + { + this._messageReactScript = value; + this.OnRefChanged("MessageReact", null, value, true, false, (string refName, object oldValue, object newValue) => + { + this._messageReactRef = refName; + this.MarkPropDirty("MessageReactRef"); + }); + } + } + get + { + return this._messageReactScript; + } + } + + partial void OnHandlingMessageReact(IgbChatMessageReactionEventArgs args); + private EventCallback? _messageReact = null; + [Parameter] + public EventCallback MessageReact + { + get + { + return this._messageReact != null ? this._messageReact.Value : EventCallback.Empty; + } + set + { + if (!value.Equals(EventCallback.Empty)) + { + if (!CompareEventCallbacks(value, _messageReact, ref eventCallbacksCache)) + { + _messageReact = value; + this.SetHandler(this.Name, "MessageReact", value, (args) => + { + OnHandlingMessageReact(args); + + }); + this.OnRefChanged("MessageReact", null, "event:::MessageReact", true, false, (refName, oldValue, newValue) => + { + this._messageReactRef = refName; + this.MarkPropDirty("MessageReactRef"); + }); + } + } + else + { + _messageReact = null; + this.SetHandler(this.Name, "MessageReact", null); + this.OnRefChanged("MessageReact", null, null, true, false, (refName, oldValue, newValue) => + { + this._messageReactRef = null; + this.MarkPropDirty("MessageReactRef"); + }); + } + } + } + + private string _attachmentClickRef = null; + private string _attachmentClickScript = null; + [Parameter] + public string AttachmentClickScript + { + + set + { + if (value != this._attachmentClickScript) + { + this._attachmentClickScript = value; + this.OnRefChanged("AttachmentClick", null, value, true, false, (string refName, object oldValue, object newValue) => + { + this._attachmentClickRef = refName; + this.MarkPropDirty("AttachmentClickRef"); + }); + } + } + get + { + return this._attachmentClickScript; + } + } + + partial void OnHandlingAttachmentClick(IgbChatMessageAttachmentEventArgs args); + private EventCallback? _attachmentClick = null; + [Parameter] + public EventCallback AttachmentClick + { + get + { + return this._attachmentClick != null ? this._attachmentClick.Value : EventCallback.Empty; + } + set + { + if (!value.Equals(EventCallback.Empty)) + { + if (!CompareEventCallbacks(value, _attachmentClick, ref eventCallbacksCache)) + { + _attachmentClick = value; + this.SetHandler(this.Name, "AttachmentClick", value, (args) => + { + OnHandlingAttachmentClick(args); + + }); + this.OnRefChanged("AttachmentClick", null, "event:::AttachmentClick", true, false, (refName, oldValue, newValue) => + { + this._attachmentClickRef = refName; + this.MarkPropDirty("AttachmentClickRef"); + }); + } + } + else + { + _attachmentClick = null; + this.SetHandler(this.Name, "AttachmentClick", null); + this.OnRefChanged("AttachmentClick", null, null, true, false, (refName, oldValue, newValue) => + { + this._attachmentClickRef = null; + this.MarkPropDirty("AttachmentClickRef"); + }); + } + } + } + + private string _typingChangeRef = null; + private string _typingChangeScript = null; + [Parameter] + public string TypingChangeScript + { + + set + { + if (value != this._typingChangeScript) + { + this._typingChangeScript = value; + this.OnRefChanged("TypingChange", null, value, true, false, (string refName, object oldValue, object newValue) => + { + this._typingChangeRef = refName; + this.MarkPropDirty("TypingChangeRef"); + }); + } + } + get + { + return this._typingChangeScript; + } + } + + partial void OnHandlingTypingChange(IgbComponentBoolValueChangedEventArgs args); + private EventCallback? _typingChange = null; + [Parameter] + public EventCallback TypingChange + { + get + { + return this._typingChange != null ? this._typingChange.Value : EventCallback.Empty; + } + set + { + if (!value.Equals(EventCallback.Empty)) + { + if (!CompareEventCallbacks(value, _typingChange, ref eventCallbacksCache)) + { + _typingChange = value; + this.SetHandler(this.Name, "TypingChange", value, (args) => + { + OnHandlingTypingChange(args); + + }); + this.OnRefChanged("TypingChange", null, "event:::TypingChange", true, false, (refName, oldValue, newValue) => + { + this._typingChangeRef = refName; + this.MarkPropDirty("TypingChangeRef"); + }); + } + } + else + { + _typingChange = null; + this.SetHandler(this.Name, "TypingChange", null); + this.OnRefChanged("TypingChange", null, null, true, false, (refName, oldValue, newValue) => + { + this._typingChangeRef = null; + this.MarkPropDirty("TypingChangeRef"); + }); + } + } + } + + private string _inputFocusRef = null; + private string _inputFocusScript = null; + [Parameter] + public string InputFocusScript + { + + set + { + if (value != this._inputFocusScript) + { + this._inputFocusScript = value; + this.OnRefChanged("InputFocus", null, value, true, false, (string refName, object oldValue, object newValue) => + { + this._inputFocusRef = refName; + this.MarkPropDirty("InputFocusRef"); + }); + } + } + get + { + return this._inputFocusScript; + } + } + + partial void OnHandlingInputFocus(IgbVoidEventArgs args); + private EventCallback? _inputFocus = null; + [Parameter] + public EventCallback InputFocus + { + get + { + return this._inputFocus != null ? this._inputFocus.Value : EventCallback.Empty; + } + set + { + if (!value.Equals(EventCallback.Empty)) + { + if (!CompareEventCallbacks(value, _inputFocus, ref eventCallbacksCache)) + { + _inputFocus = value; + this.SetHandler(this.Name, "InputFocus", value, (args) => + { + OnHandlingInputFocus(args); + + }); + this.OnRefChanged("InputFocus", null, "event:::InputFocus", true, false, (refName, oldValue, newValue) => + { + this._inputFocusRef = refName; + this.MarkPropDirty("InputFocusRef"); + }); + } + } + else + { + _inputFocus = null; + this.SetHandler(this.Name, "InputFocus", null); + this.OnRefChanged("InputFocus", null, null, true, false, (refName, oldValue, newValue) => + { + this._inputFocusRef = null; + this.MarkPropDirty("InputFocusRef"); + }); + } + } + } + + private string _inputBlurRef = null; + private string _inputBlurScript = null; + [Parameter] + public string InputBlurScript + { + + set + { + if (value != this._inputBlurScript) + { + this._inputBlurScript = value; + this.OnRefChanged("InputBlur", null, value, true, false, (string refName, object oldValue, object newValue) => + { + this._inputBlurRef = refName; + this.MarkPropDirty("InputBlurRef"); + }); + } + } + get + { + return this._inputBlurScript; + } + } + + partial void OnHandlingInputBlur(IgbVoidEventArgs args); + private EventCallback? _inputBlur = null; + [Parameter] + public EventCallback InputBlur + { + get + { + return this._inputBlur != null ? this._inputBlur.Value : EventCallback.Empty; + } + set + { + if (!value.Equals(EventCallback.Empty)) + { + if (!CompareEventCallbacks(value, _inputBlur, ref eventCallbacksCache)) + { + _inputBlur = value; + this.SetHandler(this.Name, "InputBlur", value, (args) => + { + OnHandlingInputBlur(args); + + }); + this.OnRefChanged("InputBlur", null, "event:::InputBlur", true, false, (refName, oldValue, newValue) => + { + this._inputBlurRef = refName; + this.MarkPropDirty("InputBlurRef"); + }); + } + } + else + { + _inputBlur = null; + this.SetHandler(this.Name, "InputBlur", null); + this.OnRefChanged("InputBlur", null, null, true, false, (refName, oldValue, newValue) => + { + this._inputBlurRef = null; + this.MarkPropDirty("InputBlurRef"); + }); + } + } + } + + private string _inputChangeRef = null; + private string _inputChangeScript = null; + [Parameter] + public string InputChangeScript + { + + set + { + if (value != this._inputChangeScript) + { + this._inputChangeScript = value; + this.OnRefChanged("InputChange", null, value, true, false, (string refName, object oldValue, object newValue) => + { + this._inputChangeRef = refName; + this.MarkPropDirty("InputChangeRef"); + }); + } + } + get + { + return this._inputChangeScript; + } + } + + partial void OnHandlingInputChange(IgbComponentValueChangedEventArgs args); + private EventCallback? _inputChange = null; + [Parameter] + public EventCallback InputChange + { + get + { + return this._inputChange != null ? this._inputChange.Value : EventCallback.Empty; + } + set + { + if (!value.Equals(EventCallback.Empty)) + { + if (!CompareEventCallbacks(value, _inputChange, ref eventCallbacksCache)) + { + _inputChange = value; + this.SetHandler(this.Name, "InputChange", value, (args) => + { + OnHandlingInputChange(args); + + }); + this.OnRefChanged("InputChange", null, "event:::InputChange", true, false, (refName, oldValue, newValue) => + { + this._inputChangeRef = refName; + this.MarkPropDirty("InputChangeRef"); + }); + } + } + else + { + _inputChange = null; + this.SetHandler(this.Name, "InputChange", null); + this.OnRefChanged("InputChange", null, null, true, false, (refName, oldValue, newValue) => + { + this._inputChangeRef = null; + this.MarkPropDirty("InputChangeRef"); + }); + } + } + } + + partial void SerializeCoreIgbChat(RendererSerializer ser); + + internal override void SerializeCore(RendererSerializer ser) + { + base.SerializeCore(ser); + + SerializeCoreIgbChat(ser); + + if (IsPropDirty("Messages")) + { ser.AddSerializableArrayProp("messages", this._messages); } + if (IsPropDirty("DraftMessage")) + { ser.AddSerializableProp("draftMessage", this._draftMessage); } + if (IsPropDirty("Options")) + { ser.AddSerializableProp("options", this._options); } + if (IsPropDirty("MessageCreatedRef")) + { ser.AddStringProp("messageCreatedRef", this._messageCreatedRef); } + if (IsPropDirty("MessageReactRef")) + { ser.AddStringProp("messageReactRef", this._messageReactRef); } + if (IsPropDirty("AttachmentClickRef")) + { ser.AddStringProp("attachmentClickRef", this._attachmentClickRef); } + if (IsPropDirty("TypingChangeRef")) + { ser.AddStringProp("typingChangeRef", this._typingChangeRef); } + if (IsPropDirty("InputFocusRef")) + { ser.AddStringProp("inputFocusRef", this._inputFocusRef); } + if (IsPropDirty("InputBlurRef")) + { ser.AddStringProp("inputBlurRef", this._inputBlurRef); } + if (IsPropDirty("InputChangeRef")) + { ser.AddStringProp("inputChangeRef", this._inputChangeRef); } + + } + + } } diff --git a/src/components/Blazor/ChatAttachmentRenderContext.cs b/src/components/Blazor/ChatAttachmentRenderContext.cs index 2f7e6f0e..83814fee 100644 --- a/src/components/Blazor/ChatAttachmentRenderContext.cs +++ b/src/components/Blazor/ChatAttachmentRenderContext.cs @@ -1,88 +1,86 @@ - -using System; using Microsoft.AspNetCore.Components; -using Microsoft.AspNetCore.Components.Rendering; -using System.Threading.Tasks; -using System.Collections.Generic; -using System.Linq; namespace IgniteUI.Blazor.Controls { - public partial class IgbChatAttachmentRenderContext: BaseRendererElement { - public override string Type { get { return "WebChatAttachmentRenderContext"; } } - - - public IgbChatAttachmentRenderContext(): base() { - OnCreatedIgbChatAttachmentRenderContext(); - - - } - - partial void OnCreatedIgbChatAttachmentRenderContext(); - - private IgbChatMessageAttachment _attachment; - - partial void OnAttachmentChanging(ref IgbChatMessageAttachment newValue); - /// - /// The specific attachment being rendered. - /// - [Parameter] - public IgbChatMessageAttachment Attachment - { - get { return this._attachment; } - set { - OnAttachmentChanging(ref value); - MarkPropDirty("Attachment"); - if (this._attachment != null) { - this.DetachChild(this._attachment); - } - if (value != null) { - this.AttachChild(value); - } - this._attachment = value; - } - - } - - partial void FindByNameChatAttachmentRenderContext(string name, ref object item); - public override object FindByName(string name) - { - - var baseResult = base.FindByName(name); - if (baseResult != null) - { - return baseResult; - } - - object item = null; - FindByNameChatAttachmentRenderContext(name, ref item); - if (item != null) - { - return item; - } - - return null; - } - public async Task SetNativeElementAsync(Object element) - { - await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); - } - public void SetNativeElement(Object element) - { - InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); - } - - partial void SerializeCoreIgbChatAttachmentRenderContext(RendererSerializer ser); - - internal override void SerializeCore(RendererSerializer ser) - { - base.SerializeCore(ser); - - SerializeCoreIgbChatAttachmentRenderContext(ser); - - if (IsPropDirty("Attachment")) { ser.AddSerializableProp("attachment", this._attachment); } - - } - -} + public partial class IgbChatAttachmentRenderContext : BaseRendererElement + { + public override string Type { get { return "WebChatAttachmentRenderContext"; } } + + public IgbChatAttachmentRenderContext() : base() + { + OnCreatedIgbChatAttachmentRenderContext(); + + } + + partial void OnCreatedIgbChatAttachmentRenderContext(); + + private IgbChatMessageAttachment _attachment; + + partial void OnAttachmentChanging(ref IgbChatMessageAttachment newValue); + /// + /// The specific attachment being rendered. + /// + [Parameter] + public IgbChatMessageAttachment Attachment + { + get { return this._attachment; } + set + { + OnAttachmentChanging(ref value); + MarkPropDirty("Attachment"); + if (this._attachment != null) + { + this.DetachChild(this._attachment); + } + if (value != null) + { + this.AttachChild(value); + } + this._attachment = value; + } + + } + + partial void FindByNameChatAttachmentRenderContext(string name, ref object item); + public override object FindByName(string name) + { + + var baseResult = base.FindByName(name); + if (baseResult != null) + { + return baseResult; + } + + object item = null; + FindByNameChatAttachmentRenderContext(name, ref item); + if (item != null) + { + return item; + } + + return null; + } + public async Task SetNativeElementAsync(Object element) + { + await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + } + public void SetNativeElement(Object element) + { + InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + } + + partial void SerializeCoreIgbChatAttachmentRenderContext(RendererSerializer ser); + + internal override void SerializeCore(RendererSerializer ser) + { + base.SerializeCore(ser); + + SerializeCoreIgbChatAttachmentRenderContext(ser); + + if (IsPropDirty("Attachment")) + { ser.AddSerializableProp("attachment", this._attachment); } + + } + + } } diff --git a/src/components/Blazor/ChatDraftMessage.cs b/src/components/Blazor/ChatDraftMessage.cs index ce447c27..d42f5d00 100644 --- a/src/components/Blazor/ChatDraftMessage.cs +++ b/src/components/Blazor/ChatDraftMessage.cs @@ -1,126 +1,128 @@ - -using System; using Microsoft.AspNetCore.Components; -using Microsoft.AspNetCore.Components.Rendering; -using System.Threading.Tasks; -using System.Collections.Generic; -using System.Linq; namespace IgniteUI.Blazor.Controls { - public partial class IgbChatDraftMessage: BaseRendererElement { - public override string Type { get { return "WebChatDraftMessage"; } } - - - private static bool _marshalByValue = true; - - public IgbChatDraftMessage(): base() { - OnCreatedIgbChatDraftMessage(); - - - } - - partial void OnCreatedIgbChatDraftMessage(); - - private string _text; - - partial void OnTextChanging(ref string newValue); - /// - /// The textual content of the draft message. - /// - [Parameter] - public string Text - { - get { return this._text; } - set { - if (this._text != value || !IsPropDirty("Text")) { - MarkPropDirty("Text"); - } - this._text = value; - - } - } - private IgbChatMessageAttachment[] _attachments; - - partial void OnAttachmentsChanging(ref IgbChatMessageAttachment[] newValue); - /// - /// An array of attachments associated with the draft message. - /// - [Parameter] - public IgbChatMessageAttachment[] Attachments - { - get { return this._attachments; } - set { - if (this._attachments != value || !IsPropDirty("Attachments")) { - MarkPropDirty("Attachments"); - } - this._attachments = value; - - } - } - - partial void FindByNameChatDraftMessage(string name, ref object item); - public override object FindByName(string name) - { - - var baseResult = base.FindByName(name); - if (baseResult != null) - { - return baseResult; - } - - object item = null; - FindByNameChatDraftMessage(name, ref item); - if (item != null) - { - return item; - } - - return null; - } - public async Task SetNativeElementAsync(Object element) - { - await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); - } - public void SetNativeElement(Object element) - { - InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); - } - - partial void SerializeCoreIgbChatDraftMessage(RendererSerializer ser); - - internal override void SerializeCore(RendererSerializer ser) - { - base.SerializeCore(ser); - - SerializeCoreIgbChatDraftMessage(ser); - - if (IsPropDirty("Text")) { ser.AddStringProp("text", this._text); } - if (IsPropDirty("Attachments")) { ser.AddSerializableArrayProp("attachments", this._attachments); } - - } - - - protected internal override void ToEventJson(BaseRendererControl control, Dictionary args) - { - base.ToEventJson(control, args); - - if (IsPropDirty("Text")) { args["text"] = this._text; } - if (IsPropDirty("Attachments")) { args["attachments"] = ObjectArrayToParam(this._attachments); } - - - } - - - protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) { - base.FromEventJson(control, args); - this.SuppressParentNotify = true; - - if (args.ContainsKey("text")) { this.Text = ReturnToString(args["text"]); } - if (args.ContainsKey("attachments")) { this.Attachments = ReturnToObjectArray(args["attachments"]); } - - this.SuppressParentNotify = false; - } - -} + public partial class IgbChatDraftMessage : BaseRendererElement + { + public override string Type { get { return "WebChatDraftMessage"; } } + + private static bool _marshalByValue = true; + + public IgbChatDraftMessage() : base() + { + OnCreatedIgbChatDraftMessage(); + + } + + partial void OnCreatedIgbChatDraftMessage(); + + private string _text; + + partial void OnTextChanging(ref string newValue); + /// + /// The textual content of the draft message. + /// + [Parameter] + public string Text + { + get { return this._text; } + set + { + if (this._text != value || !IsPropDirty("Text")) + { + MarkPropDirty("Text"); + } + this._text = value; + + } + } + private IgbChatMessageAttachment[] _attachments; + + partial void OnAttachmentsChanging(ref IgbChatMessageAttachment[] newValue); + /// + /// An array of attachments associated with the draft message. + /// + [Parameter] + public IgbChatMessageAttachment[] Attachments + { + get { return this._attachments; } + set + { + if (this._attachments != value || !IsPropDirty("Attachments")) + { + MarkPropDirty("Attachments"); + } + this._attachments = value; + + } + } + + partial void FindByNameChatDraftMessage(string name, ref object item); + public override object FindByName(string name) + { + + var baseResult = base.FindByName(name); + if (baseResult != null) + { + return baseResult; + } + + object item = null; + FindByNameChatDraftMessage(name, ref item); + if (item != null) + { + return item; + } + + return null; + } + public async Task SetNativeElementAsync(Object element) + { + await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + } + public void SetNativeElement(Object element) + { + InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + } + + partial void SerializeCoreIgbChatDraftMessage(RendererSerializer ser); + + internal override void SerializeCore(RendererSerializer ser) + { + base.SerializeCore(ser); + + SerializeCoreIgbChatDraftMessage(ser); + + if (IsPropDirty("Text")) + { ser.AddStringProp("text", this._text); } + if (IsPropDirty("Attachments")) + { ser.AddSerializableArrayProp("attachments", this._attachments); } + + } + + protected internal override void ToEventJson(BaseRendererControl control, Dictionary args) + { + base.ToEventJson(control, args); + + if (IsPropDirty("Text")) + { args["text"] = this._text; } + if (IsPropDirty("Attachments")) + { args["attachments"] = ObjectArrayToParam(this._attachments); } + + } + + protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) + { + base.FromEventJson(control, args); + this.SuppressParentNotify = true; + + if (args.ContainsKey("text")) + { this.Text = ReturnToString(args["text"]); } + if (args.ContainsKey("attachments")) + { this.Attachments = ReturnToObjectArray(args["attachments"]); } + + this.SuppressParentNotify = false; + } + + } } diff --git a/src/components/Blazor/ChatInputRenderContext.cs b/src/components/Blazor/ChatInputRenderContext.cs index 1b0d0ea7..7b7bc67e 100644 --- a/src/components/Blazor/ChatInputRenderContext.cs +++ b/src/components/Blazor/ChatInputRenderContext.cs @@ -1,83 +1,80 @@ - -using System; using Microsoft.AspNetCore.Components; -using Microsoft.AspNetCore.Components.Rendering; -using System.Threading.Tasks; -using System.Collections.Generic; -using System.Linq; namespace IgniteUI.Blazor.Controls { - public partial class IgbChatInputRenderContext: BaseRendererElement { - public override string Type { get { return "WebChatInputRenderContext"; } } - - - public IgbChatInputRenderContext(): base() { - OnCreatedIgbChatInputRenderContext(); - - - } - - partial void OnCreatedIgbChatInputRenderContext(); - - private string _value; - - partial void OnValueChanging(ref string newValue); - /// - /// The current value of the input field. - /// - [Parameter] - public string Value - { - get { return this._value; } - set { - if (this._value != value || !IsPropDirty("Value")) { - MarkPropDirty("Value"); - } - this._value = value; - - } - } - - partial void FindByNameChatInputRenderContext(string name, ref object item); - public override object FindByName(string name) - { - - var baseResult = base.FindByName(name); - if (baseResult != null) - { - return baseResult; - } - - object item = null; - FindByNameChatInputRenderContext(name, ref item); - if (item != null) - { - return item; - } - - return null; - } - public async Task SetNativeElementAsync(Object element) - { - await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); - } - public void SetNativeElement(Object element) - { - InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); - } - - partial void SerializeCoreIgbChatInputRenderContext(RendererSerializer ser); - - internal override void SerializeCore(RendererSerializer ser) - { - base.SerializeCore(ser); - - SerializeCoreIgbChatInputRenderContext(ser); - - if (IsPropDirty("Value")) { ser.AddStringProp("value", this._value); } - - } - -} + public partial class IgbChatInputRenderContext : BaseRendererElement + { + public override string Type { get { return "WebChatInputRenderContext"; } } + + public IgbChatInputRenderContext() : base() + { + OnCreatedIgbChatInputRenderContext(); + + } + + partial void OnCreatedIgbChatInputRenderContext(); + + private string _value; + + partial void OnValueChanging(ref string newValue); + /// + /// The current value of the input field. + /// + [Parameter] + public string Value + { + get { return this._value; } + set + { + if (this._value != value || !IsPropDirty("Value")) + { + MarkPropDirty("Value"); + } + this._value = value; + + } + } + + partial void FindByNameChatInputRenderContext(string name, ref object item); + public override object FindByName(string name) + { + + var baseResult = base.FindByName(name); + if (baseResult != null) + { + return baseResult; + } + + object item = null; + FindByNameChatInputRenderContext(name, ref item); + if (item != null) + { + return item; + } + + return null; + } + public async Task SetNativeElementAsync(Object element) + { + await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + } + public void SetNativeElement(Object element) + { + InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + } + + partial void SerializeCoreIgbChatInputRenderContext(RendererSerializer ser); + + internal override void SerializeCore(RendererSerializer ser) + { + base.SerializeCore(ser); + + SerializeCoreIgbChatInputRenderContext(ser); + + if (IsPropDirty("Value")) + { ser.AddStringProp("value", this._value); } + + } + + } } diff --git a/src/components/Blazor/ChatMessage.cs b/src/components/Blazor/ChatMessage.cs index 88042bb5..5aaefc4f 100644 --- a/src/components/Blazor/ChatMessage.cs +++ b/src/components/Blazor/ChatMessage.cs @@ -1,211 +1,233 @@ - -using System; using Microsoft.AspNetCore.Components; -using Microsoft.AspNetCore.Components.Rendering; -using System.Threading.Tasks; -using System.Collections.Generic; -using System.Linq; namespace IgniteUI.Blazor.Controls { - public partial class IgbChatMessage: BaseRendererElement { - public override string Type { get { return "WebChatMessage"; } } - - - private static bool _marshalByValue = true; - - public IgbChatMessage(): base() { - OnCreatedIgbChatMessage(); - - - } - - partial void OnCreatedIgbChatMessage(); - - private string _id; - - partial void OnIdChanging(ref string newValue); - /// - /// A unique identifier for the message. - /// - [Parameter] - public string Id - { - get { return this._id; } - set { - if (this._id != value || !IsPropDirty("Id")) { - MarkPropDirty("Id"); - } - this._id = value; - - } - } - private string _text; - - partial void OnTextChanging(ref string newValue); - /// - /// The textual content of the message. - /// - [Parameter] - public string Text - { - get { return this._text; } - set { - if (this._text != value || !IsPropDirty("Text")) { - MarkPropDirty("Text"); - } - this._text = value; - - } - } - private string _sender; - - partial void OnSenderChanging(ref string newValue); - /// - /// The identifier or name of the sender of the message. - /// - [Parameter] - public string Sender - { - get { return this._sender; } - set { - if (this._sender != value || !IsPropDirty("Sender")) { - MarkPropDirty("Sender"); - } - this._sender = value; - - } - } - private string _timestamp; - - partial void OnTimestampChanging(ref string newValue); - /// - /// The timestamp indicating when the message was sent. - /// - [Parameter] - public string Timestamp - { - get { return this._timestamp; } - set { - if (this._timestamp != value || !IsPropDirty("Timestamp")) { - MarkPropDirty("Timestamp"); - } - this._timestamp = value; - - } - } - private IgbChatMessageAttachment[] _attachments; - - partial void OnAttachmentsChanging(ref IgbChatMessageAttachment[] newValue); - /// - /// Optional list of attachments associated with the message, - /// such as images, files, or links. - /// - [Parameter] - public IgbChatMessageAttachment[] Attachments - { - get { return this._attachments; } - set { - if (this._attachments != value || !IsPropDirty("Attachments")) { - MarkPropDirty("Attachments"); - } - this._attachments = value; - - } - } - private string[] _reactions; - - partial void OnReactionsChanging(ref string[] newValue); - /// - /// Optional list of reactions associated with the message. - /// - [Parameter] - public string[] Reactions - { - get { return this._reactions; } - set { - if (this._reactions != value || !IsPropDirty("Reactions")) { - MarkPropDirty("Reactions"); - } - this._reactions = value; - - } - } - - partial void FindByNameChatMessage(string name, ref object item); - public override object FindByName(string name) - { - - var baseResult = base.FindByName(name); - if (baseResult != null) - { - return baseResult; - } - - object item = null; - FindByNameChatMessage(name, ref item); - if (item != null) - { - return item; - } - - return null; - } - public async Task SetNativeElementAsync(Object element) - { - await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); - } - public void SetNativeElement(Object element) - { - InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); - } - - partial void SerializeCoreIgbChatMessage(RendererSerializer ser); - - internal override void SerializeCore(RendererSerializer ser) - { - base.SerializeCore(ser); - - SerializeCoreIgbChatMessage(ser); - - if (IsPropDirty("Id")) { ser.AddStringProp("id", this._id); } - if (IsPropDirty("Text")) { ser.AddStringProp("text", this._text); } - if (IsPropDirty("Sender")) { ser.AddStringProp("sender", this._sender); } - if (IsPropDirty("Timestamp")) { ser.AddStringProp("timestamp", this._timestamp); } - if (IsPropDirty("Attachments")) { ser.AddSerializableArrayProp("attachments", this._attachments); } - if (IsPropDirty("Reactions")) { ser.AddArrayProp("reactions", this._reactions); } - - } - - - protected internal override void ToEventJson(BaseRendererControl control, Dictionary args) - { - base.ToEventJson(control, args); - - if (IsPropDirty("Id")) { args["id"] = this._id; } - if (IsPropDirty("Text")) { args["text"] = this._text; } - if (IsPropDirty("Sender")) { args["sender"] = this._sender; } - if (IsPropDirty("Timestamp")) { args["timestamp"] = this._timestamp; } - if (IsPropDirty("Attachments")) { args["attachments"] = ObjectArrayToParam(this._attachments); } - if (IsPropDirty("Reactions")) { args["reactions"] = StringArrayToString(this._reactions); } - - - } - - - protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) { - base.FromEventJson(control, args); - this.SuppressParentNotify = true; - - if (args.ContainsKey("id")) { this.Id = ReturnToString(args["id"]); } - if (args.ContainsKey("text")) { this.Text = ReturnToString(args["text"]); } - if (args.ContainsKey("sender")) { this.Sender = ReturnToString(args["sender"]); } - if (args.ContainsKey("timestamp")) { this.Timestamp = ReturnToString(args["timestamp"]); } - if (args.ContainsKey("attachments")) { this.Attachments = ReturnToObjectArray(args["attachments"]); } - if (args.ContainsKey("reactions")) { this.Reactions = ReturnToStringArray(args["reactions"]); } - - this.SuppressParentNotify = false; - } - -} + public partial class IgbChatMessage : BaseRendererElement + { + public override string Type { get { return "WebChatMessage"; } } + + private static bool _marshalByValue = true; + + public IgbChatMessage() : base() + { + OnCreatedIgbChatMessage(); + + } + + partial void OnCreatedIgbChatMessage(); + + private string _id; + + partial void OnIdChanging(ref string newValue); + /// + /// A unique identifier for the message. + /// + [Parameter] + public string Id + { + get { return this._id; } + set + { + if (this._id != value || !IsPropDirty("Id")) + { + MarkPropDirty("Id"); + } + this._id = value; + + } + } + private string _text; + + partial void OnTextChanging(ref string newValue); + /// + /// The textual content of the message. + /// + [Parameter] + public string Text + { + get { return this._text; } + set + { + if (this._text != value || !IsPropDirty("Text")) + { + MarkPropDirty("Text"); + } + this._text = value; + + } + } + private string _sender; + + partial void OnSenderChanging(ref string newValue); + /// + /// The identifier or name of the sender of the message. + /// + [Parameter] + public string Sender + { + get { return this._sender; } + set + { + if (this._sender != value || !IsPropDirty("Sender")) + { + MarkPropDirty("Sender"); + } + this._sender = value; + + } + } + private string _timestamp; + + partial void OnTimestampChanging(ref string newValue); + /// + /// The timestamp indicating when the message was sent. + /// + [Parameter] + public string Timestamp + { + get { return this._timestamp; } + set + { + if (this._timestamp != value || !IsPropDirty("Timestamp")) + { + MarkPropDirty("Timestamp"); + } + this._timestamp = value; + + } + } + private IgbChatMessageAttachment[] _attachments; + + partial void OnAttachmentsChanging(ref IgbChatMessageAttachment[] newValue); + /// + /// Optional list of attachments associated with the message, + /// such as images, files, or links. + /// + [Parameter] + public IgbChatMessageAttachment[] Attachments + { + get { return this._attachments; } + set + { + if (this._attachments != value || !IsPropDirty("Attachments")) + { + MarkPropDirty("Attachments"); + } + this._attachments = value; + + } + } + private string[] _reactions; + + partial void OnReactionsChanging(ref string[] newValue); + /// + /// Optional list of reactions associated with the message. + /// + [Parameter] + public string[] Reactions + { + get { return this._reactions; } + set + { + if (this._reactions != value || !IsPropDirty("Reactions")) + { + MarkPropDirty("Reactions"); + } + this._reactions = value; + + } + } + + partial void FindByNameChatMessage(string name, ref object item); + public override object FindByName(string name) + { + + var baseResult = base.FindByName(name); + if (baseResult != null) + { + return baseResult; + } + + object item = null; + FindByNameChatMessage(name, ref item); + if (item != null) + { + return item; + } + + return null; + } + public async Task SetNativeElementAsync(Object element) + { + await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + } + public void SetNativeElement(Object element) + { + InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + } + + partial void SerializeCoreIgbChatMessage(RendererSerializer ser); + + internal override void SerializeCore(RendererSerializer ser) + { + base.SerializeCore(ser); + + SerializeCoreIgbChatMessage(ser); + + if (IsPropDirty("Id")) + { ser.AddStringProp("id", this._id); } + if (IsPropDirty("Text")) + { ser.AddStringProp("text", this._text); } + if (IsPropDirty("Sender")) + { ser.AddStringProp("sender", this._sender); } + if (IsPropDirty("Timestamp")) + { ser.AddStringProp("timestamp", this._timestamp); } + if (IsPropDirty("Attachments")) + { ser.AddSerializableArrayProp("attachments", this._attachments); } + if (IsPropDirty("Reactions")) + { ser.AddArrayProp("reactions", this._reactions); } + + } + + protected internal override void ToEventJson(BaseRendererControl control, Dictionary args) + { + base.ToEventJson(control, args); + + if (IsPropDirty("Id")) + { args["id"] = this._id; } + if (IsPropDirty("Text")) + { args["text"] = this._text; } + if (IsPropDirty("Sender")) + { args["sender"] = this._sender; } + if (IsPropDirty("Timestamp")) + { args["timestamp"] = this._timestamp; } + if (IsPropDirty("Attachments")) + { args["attachments"] = ObjectArrayToParam(this._attachments); } + if (IsPropDirty("Reactions")) + { args["reactions"] = StringArrayToString(this._reactions); } + + } + + protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) + { + base.FromEventJson(control, args); + this.SuppressParentNotify = true; + + if (args.ContainsKey("id")) + { this.Id = ReturnToString(args["id"]); } + if (args.ContainsKey("text")) + { this.Text = ReturnToString(args["text"]); } + if (args.ContainsKey("sender")) + { this.Sender = ReturnToString(args["sender"]); } + if (args.ContainsKey("timestamp")) + { this.Timestamp = ReturnToString(args["timestamp"]); } + if (args.ContainsKey("attachments")) + { this.Attachments = ReturnToObjectArray(args["attachments"]); } + if (args.ContainsKey("reactions")) + { this.Reactions = ReturnToStringArray(args["reactions"]); } + + this.SuppressParentNotify = false; + } + + } } diff --git a/src/components/Blazor/ChatMessageAttachment.cs b/src/components/Blazor/ChatMessageAttachment.cs index 27b53719..59c32272 100644 --- a/src/components/Blazor/ChatMessageAttachment.cs +++ b/src/components/Blazor/ChatMessageAttachment.cs @@ -1,172 +1,186 @@ - -using System; using Microsoft.AspNetCore.Components; -using Microsoft.AspNetCore.Components.Rendering; -using System.Threading.Tasks; -using System.Collections.Generic; -using System.Linq; namespace IgniteUI.Blazor.Controls { - public partial class IgbChatMessageAttachment: BaseRendererElement { - public override string Type { get { return "WebChatMessageAttachment"; } } - - - private static bool _marshalByValue = true; - - public IgbChatMessageAttachment(): base() { - OnCreatedIgbChatMessageAttachment(); - - - } - - partial void OnCreatedIgbChatMessageAttachment(); - - private string _id; - - partial void OnIdChanging(ref string newValue); - /// - /// A unique identifier for the attachment. - /// - [Parameter] - public string Id - { - get { return this._id; } - set { - if (this._id != value || !IsPropDirty("Id")) { - MarkPropDirty("Id"); - } - this._id = value; - - } - } - private string _url; - - partial void OnUrlChanging(ref string newValue); - /// - /// The URL from which the attachment can be downloaded or viewed. - /// Typically used for attachments stored on a server or CDN. - /// - [Parameter] - public string Url - { - get { return this._url; } - set { - if (this._url != value || !IsPropDirty("Url")) { - MarkPropDirty("Url"); - } - this._url = value; - - } - } - private string _attachmentType; - - partial void OnAttachmentTypeChanging(ref string newValue); - /// - /// The MIME type or a custom type identifier for the attachment (e.g. "image/png", "pdf", "audio"). - /// - [Parameter] - [WCWidgetMemberName("Type")] - public string AttachmentType - { - get { return this._attachmentType; } - set { - if (this._attachmentType != value || !IsPropDirty("AttachmentType")) { - MarkPropDirty("AttachmentType"); - } - this._attachmentType = value; - - } - } - private string _thumbnail; - - partial void OnThumbnailChanging(ref string newValue); - /// - /// Optional URL to a thumbnail preview of the attachment (e.g. for images or videos). - /// - [Parameter] - public string Thumbnail - { - get { return this._thumbnail; } - set { - if (this._thumbnail != value || !IsPropDirty("Thumbnail")) { - MarkPropDirty("Thumbnail"); - } - this._thumbnail = value; - - } - } - - partial void FindByNameChatMessageAttachment(string name, ref object item); - public override object FindByName(string name) - { - - var baseResult = base.FindByName(name); - if (baseResult != null) - { - return baseResult; - } - - object item = null; - FindByNameChatMessageAttachment(name, ref item); - if (item != null) - { - return item; - } - - return null; - } - public async Task SetNativeElementAsync(Object element) - { - await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); - } - public void SetNativeElement(Object element) - { - InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); - } - - partial void SerializeCoreIgbChatMessageAttachment(RendererSerializer ser); - - internal override void SerializeCore(RendererSerializer ser) - { - base.SerializeCore(ser); - - SerializeCoreIgbChatMessageAttachment(ser); - - if (IsPropDirty("Id")) { ser.AddStringProp("id", this._id); } - if (IsPropDirty("Url")) { ser.AddStringProp("url", this._url); } - if (IsPropDirty("AttachmentType")) { ser.AddStringProp("attachmentType", this._attachmentType); } - if (IsPropDirty("Thumbnail")) { ser.AddStringProp("thumbnail", this._thumbnail); } - - } - - - protected internal override void ToEventJson(BaseRendererControl control, Dictionary args) - { - base.ToEventJson(control, args); - - if (IsPropDirty("Id")) { args["id"] = this._id; } - if (IsPropDirty("Name")) { args["name"] = this._name; } - if (IsPropDirty("Url")) { args["url"] = this._url; } - if (IsPropDirty("AttachmentType")) { args["attachmentType"] = this._attachmentType; } - if (IsPropDirty("Thumbnail")) { args["thumbnail"] = this._thumbnail; } - - - } - - - protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) { - base.FromEventJson(control, args); - this.SuppressParentNotify = true; - - if (args.ContainsKey("id")) { this.Id = ReturnToString(args["id"]); } - if (args.ContainsKey("name")) { this.Name = ReturnToString(args["name"]); } - if (args.ContainsKey("url")) { this.Url = ReturnToString(args["url"]); } - if (args.ContainsKey("attachmentType")) { this.AttachmentType = ReturnToString(args["attachmentType"]); } - if (args.ContainsKey("thumbnail")) { this.Thumbnail = ReturnToString(args["thumbnail"]); } - - this.SuppressParentNotify = false; - } - -} + public partial class IgbChatMessageAttachment : BaseRendererElement + { + public override string Type { get { return "WebChatMessageAttachment"; } } + + private static bool _marshalByValue = true; + + public IgbChatMessageAttachment() : base() + { + OnCreatedIgbChatMessageAttachment(); + + } + + partial void OnCreatedIgbChatMessageAttachment(); + + private string _id; + + partial void OnIdChanging(ref string newValue); + /// + /// A unique identifier for the attachment. + /// + [Parameter] + public string Id + { + get { return this._id; } + set + { + if (this._id != value || !IsPropDirty("Id")) + { + MarkPropDirty("Id"); + } + this._id = value; + + } + } + private string _url; + + partial void OnUrlChanging(ref string newValue); + /// + /// The URL from which the attachment can be downloaded or viewed. + /// Typically used for attachments stored on a server or CDN. + /// + [Parameter] + public string Url + { + get { return this._url; } + set + { + if (this._url != value || !IsPropDirty("Url")) + { + MarkPropDirty("Url"); + } + this._url = value; + + } + } + private string _attachmentType; + + partial void OnAttachmentTypeChanging(ref string newValue); + /// + /// The MIME type or a custom type identifier for the attachment (e.g. "image/png", "pdf", "audio"). + /// + [Parameter] + [WCWidgetMemberName("Type")] + public string AttachmentType + { + get { return this._attachmentType; } + set + { + if (this._attachmentType != value || !IsPropDirty("AttachmentType")) + { + MarkPropDirty("AttachmentType"); + } + this._attachmentType = value; + + } + } + private string _thumbnail; + + partial void OnThumbnailChanging(ref string newValue); + /// + /// Optional URL to a thumbnail preview of the attachment (e.g. for images or videos). + /// + [Parameter] + public string Thumbnail + { + get { return this._thumbnail; } + set + { + if (this._thumbnail != value || !IsPropDirty("Thumbnail")) + { + MarkPropDirty("Thumbnail"); + } + this._thumbnail = value; + + } + } + + partial void FindByNameChatMessageAttachment(string name, ref object item); + public override object FindByName(string name) + { + + var baseResult = base.FindByName(name); + if (baseResult != null) + { + return baseResult; + } + + object item = null; + FindByNameChatMessageAttachment(name, ref item); + if (item != null) + { + return item; + } + + return null; + } + public async Task SetNativeElementAsync(Object element) + { + await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + } + public void SetNativeElement(Object element) + { + InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + } + + partial void SerializeCoreIgbChatMessageAttachment(RendererSerializer ser); + + internal override void SerializeCore(RendererSerializer ser) + { + base.SerializeCore(ser); + + SerializeCoreIgbChatMessageAttachment(ser); + + if (IsPropDirty("Id")) + { ser.AddStringProp("id", this._id); } + if (IsPropDirty("Url")) + { ser.AddStringProp("url", this._url); } + if (IsPropDirty("AttachmentType")) + { ser.AddStringProp("attachmentType", this._attachmentType); } + if (IsPropDirty("Thumbnail")) + { ser.AddStringProp("thumbnail", this._thumbnail); } + + } + + protected internal override void ToEventJson(BaseRendererControl control, Dictionary args) + { + base.ToEventJson(control, args); + + if (IsPropDirty("Id")) + { args["id"] = this._id; } + if (IsPropDirty("Name")) + { args["name"] = this._name; } + if (IsPropDirty("Url")) + { args["url"] = this._url; } + if (IsPropDirty("AttachmentType")) + { args["attachmentType"] = this._attachmentType; } + if (IsPropDirty("Thumbnail")) + { args["thumbnail"] = this._thumbnail; } + + } + + protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) + { + base.FromEventJson(control, args); + this.SuppressParentNotify = true; + + if (args.ContainsKey("id")) + { this.Id = ReturnToString(args["id"]); } + if (args.ContainsKey("name")) + { this.Name = ReturnToString(args["name"]); } + if (args.ContainsKey("url")) + { this.Url = ReturnToString(args["url"]); } + if (args.ContainsKey("attachmentType")) + { this.AttachmentType = ReturnToString(args["attachmentType"]); } + if (args.ContainsKey("thumbnail")) + { this.Thumbnail = ReturnToString(args["thumbnail"]); } + + this.SuppressParentNotify = false; + } + + } } diff --git a/src/components/Blazor/ChatMessageAttachmentEventArgs.cs b/src/components/Blazor/ChatMessageAttachmentEventArgs.cs index 60b3e5d9..3c51f7dc 100644 --- a/src/components/Blazor/ChatMessageAttachmentEventArgs.cs +++ b/src/components/Blazor/ChatMessageAttachmentEventArgs.cs @@ -1,99 +1,97 @@ - -using System; using Microsoft.AspNetCore.Components; -using Microsoft.AspNetCore.Components.Rendering; -using System.Threading.Tasks; -using System.Collections.Generic; -using System.Linq; namespace IgniteUI.Blazor.Controls { - public partial class IgbChatMessageAttachmentEventArgs: BaseRendererElement { - public override string Type { get { return "WebChatMessageAttachmentEventArgs"; } } - - - private static bool _marshalByValue = true; - - public IgbChatMessageAttachmentEventArgs(): base() { - OnCreatedIgbChatMessageAttachmentEventArgs(); - - - } - - partial void OnCreatedIgbChatMessageAttachmentEventArgs(); - - private IgbChatMessageAttachment _detail; - - partial void OnDetailChanging(ref IgbChatMessageAttachment newValue); - [Parameter] - public IgbChatMessageAttachment Detail - { - get { return this._detail; } - set { - OnDetailChanging(ref value); - MarkPropDirty("Detail"); - if (this._detail != null) { - this.DetachChild(this._detail); - } - if (value != null) { - this.AttachChild(value); - } - this._detail = value; - } - - } - - partial void FindByNameChatMessageAttachmentEventArgs(string name, ref object item); - public override object FindByName(string name) - { - - var baseResult = base.FindByName(name); - if (baseResult != null) - { - return baseResult; - } - - object item = null; - FindByNameChatMessageAttachmentEventArgs(name, ref item); - if (item != null) - { - return item; - } - - return null; - } - - partial void SerializeCoreIgbChatMessageAttachmentEventArgs(RendererSerializer ser); - - internal override void SerializeCore(RendererSerializer ser) - { - base.SerializeCore(ser); - - SerializeCoreIgbChatMessageAttachmentEventArgs(ser); - - if (IsPropDirty("Detail")) { ser.AddSerializableProp("detail", this._detail); } - - } - - - protected internal override void ToEventJson(BaseRendererControl control, Dictionary args) - { - base.ToEventJson(control, args); - - if (IsPropDirty("Detail")) { args["detail"] = ObjectToParam(this._detail); } - - - } - - - protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) { - base.FromEventJson(control, args); - this.SuppressParentNotify = true; - - if (args.ContainsKey("detail")) { this.Detail = (IgbChatMessageAttachment)ConvertReturnValue(args["detail"], "ChatMessageAttachment", true); } - - this.SuppressParentNotify = false; - } - -} + public partial class IgbChatMessageAttachmentEventArgs : BaseRendererElement + { + public override string Type { get { return "WebChatMessageAttachmentEventArgs"; } } + + private static bool _marshalByValue = true; + + public IgbChatMessageAttachmentEventArgs() : base() + { + OnCreatedIgbChatMessageAttachmentEventArgs(); + + } + + partial void OnCreatedIgbChatMessageAttachmentEventArgs(); + + private IgbChatMessageAttachment _detail; + + partial void OnDetailChanging(ref IgbChatMessageAttachment newValue); + [Parameter] + public IgbChatMessageAttachment Detail + { + get { return this._detail; } + set + { + OnDetailChanging(ref value); + MarkPropDirty("Detail"); + if (this._detail != null) + { + this.DetachChild(this._detail); + } + if (value != null) + { + this.AttachChild(value); + } + this._detail = value; + } + + } + + partial void FindByNameChatMessageAttachmentEventArgs(string name, ref object item); + public override object FindByName(string name) + { + + var baseResult = base.FindByName(name); + if (baseResult != null) + { + return baseResult; + } + + object item = null; + FindByNameChatMessageAttachmentEventArgs(name, ref item); + if (item != null) + { + return item; + } + + return null; + } + + partial void SerializeCoreIgbChatMessageAttachmentEventArgs(RendererSerializer ser); + + internal override void SerializeCore(RendererSerializer ser) + { + base.SerializeCore(ser); + + SerializeCoreIgbChatMessageAttachmentEventArgs(ser); + + if (IsPropDirty("Detail")) + { ser.AddSerializableProp("detail", this._detail); } + + } + + protected internal override void ToEventJson(BaseRendererControl control, Dictionary args) + { + base.ToEventJson(control, args); + + if (IsPropDirty("Detail")) + { args["detail"] = ObjectToParam(this._detail); } + + } + + protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) + { + base.FromEventJson(control, args); + this.SuppressParentNotify = true; + + if (args.ContainsKey("detail")) + { this.Detail = (IgbChatMessageAttachment)ConvertReturnValue(args["detail"], "ChatMessageAttachment", true); } + + this.SuppressParentNotify = false; + } + + } } diff --git a/src/components/Blazor/ChatMessageEventArgs.cs b/src/components/Blazor/ChatMessageEventArgs.cs index bee2f211..4105b9f1 100644 --- a/src/components/Blazor/ChatMessageEventArgs.cs +++ b/src/components/Blazor/ChatMessageEventArgs.cs @@ -1,99 +1,97 @@ - -using System; using Microsoft.AspNetCore.Components; -using Microsoft.AspNetCore.Components.Rendering; -using System.Threading.Tasks; -using System.Collections.Generic; -using System.Linq; namespace IgniteUI.Blazor.Controls { - public partial class IgbChatMessageEventArgs: BaseRendererElement { - public override string Type { get { return "WebChatMessageEventArgs"; } } - - - private static bool _marshalByValue = true; - - public IgbChatMessageEventArgs(): base() { - OnCreatedIgbChatMessageEventArgs(); - - - } - - partial void OnCreatedIgbChatMessageEventArgs(); - - private IgbChatMessage _detail; - - partial void OnDetailChanging(ref IgbChatMessage newValue); - [Parameter] - public IgbChatMessage Detail - { - get { return this._detail; } - set { - OnDetailChanging(ref value); - MarkPropDirty("Detail"); - if (this._detail != null) { - this.DetachChild(this._detail); - } - if (value != null) { - this.AttachChild(value); - } - this._detail = value; - } - - } - - partial void FindByNameChatMessageEventArgs(string name, ref object item); - public override object FindByName(string name) - { - - var baseResult = base.FindByName(name); - if (baseResult != null) - { - return baseResult; - } - - object item = null; - FindByNameChatMessageEventArgs(name, ref item); - if (item != null) - { - return item; - } - - return null; - } - - partial void SerializeCoreIgbChatMessageEventArgs(RendererSerializer ser); - - internal override void SerializeCore(RendererSerializer ser) - { - base.SerializeCore(ser); - - SerializeCoreIgbChatMessageEventArgs(ser); - - if (IsPropDirty("Detail")) { ser.AddSerializableProp("detail", this._detail); } - - } - - - protected internal override void ToEventJson(BaseRendererControl control, Dictionary args) - { - base.ToEventJson(control, args); - - if (IsPropDirty("Detail")) { args["detail"] = ObjectToParam(this._detail); } - - - } - - - protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) { - base.FromEventJson(control, args); - this.SuppressParentNotify = true; - - if (args.ContainsKey("detail")) { this.Detail = (IgbChatMessage)ConvertReturnValue(args["detail"], "ChatMessage", true); } - - this.SuppressParentNotify = false; - } - -} + public partial class IgbChatMessageEventArgs : BaseRendererElement + { + public override string Type { get { return "WebChatMessageEventArgs"; } } + + private static bool _marshalByValue = true; + + public IgbChatMessageEventArgs() : base() + { + OnCreatedIgbChatMessageEventArgs(); + + } + + partial void OnCreatedIgbChatMessageEventArgs(); + + private IgbChatMessage _detail; + + partial void OnDetailChanging(ref IgbChatMessage newValue); + [Parameter] + public IgbChatMessage Detail + { + get { return this._detail; } + set + { + OnDetailChanging(ref value); + MarkPropDirty("Detail"); + if (this._detail != null) + { + this.DetachChild(this._detail); + } + if (value != null) + { + this.AttachChild(value); + } + this._detail = value; + } + + } + + partial void FindByNameChatMessageEventArgs(string name, ref object item); + public override object FindByName(string name) + { + + var baseResult = base.FindByName(name); + if (baseResult != null) + { + return baseResult; + } + + object item = null; + FindByNameChatMessageEventArgs(name, ref item); + if (item != null) + { + return item; + } + + return null; + } + + partial void SerializeCoreIgbChatMessageEventArgs(RendererSerializer ser); + + internal override void SerializeCore(RendererSerializer ser) + { + base.SerializeCore(ser); + + SerializeCoreIgbChatMessageEventArgs(ser); + + if (IsPropDirty("Detail")) + { ser.AddSerializableProp("detail", this._detail); } + + } + + protected internal override void ToEventJson(BaseRendererControl control, Dictionary args) + { + base.ToEventJson(control, args); + + if (IsPropDirty("Detail")) + { args["detail"] = ObjectToParam(this._detail); } + + } + + protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) + { + base.FromEventJson(control, args); + this.SuppressParentNotify = true; + + if (args.ContainsKey("detail")) + { this.Detail = (IgbChatMessage)ConvertReturnValue(args["detail"], "ChatMessage", true); } + + this.SuppressParentNotify = false; + } + + } } diff --git a/src/components/Blazor/ChatMessageReaction.cs b/src/components/Blazor/ChatMessageReaction.cs index 21824df0..a1d8a45b 100644 --- a/src/components/Blazor/ChatMessageReaction.cs +++ b/src/components/Blazor/ChatMessageReaction.cs @@ -1,131 +1,134 @@ - -using System; using Microsoft.AspNetCore.Components; -using Microsoft.AspNetCore.Components.Rendering; -using System.Threading.Tasks; -using System.Collections.Generic; -using System.Linq; namespace IgniteUI.Blazor.Controls { - public partial class IgbChatMessageReaction: BaseRendererElement { - public override string Type { get { return "WebChatMessageReaction"; } } - - - private static bool _marshalByValue = true; - - public IgbChatMessageReaction(): base() { - OnCreatedIgbChatMessageReaction(); - - - } - - partial void OnCreatedIgbChatMessageReaction(); - - private IgbChatMessage _message; - - partial void OnMessageChanging(ref IgbChatMessage newValue); - /// - /// The chat message that the reaction is associated with. - /// - [Parameter] - public IgbChatMessage Message - { - get { return this._message; } - set { - OnMessageChanging(ref value); - MarkPropDirty("Message"); - if (this._message != null) { - this.DetachChild(this._message); - } - if (value != null) { - this.AttachChild(value); - } - this._message = value; - } - - } - private string _reaction; - - partial void OnReactionChanging(ref string newValue); - /// - /// The string representation of the reaction, such as an emoji or a string; - /// - [Parameter] - public string Reaction - { - get { return this._reaction; } - set { - if (this._reaction != value || !IsPropDirty("Reaction")) { - MarkPropDirty("Reaction"); - } - this._reaction = value; - - } - } - - partial void FindByNameChatMessageReaction(string name, ref object item); - public override object FindByName(string name) - { - - var baseResult = base.FindByName(name); - if (baseResult != null) - { - return baseResult; - } - - object item = null; - FindByNameChatMessageReaction(name, ref item); - if (item != null) - { - return item; - } - - return null; - } - public async Task SetNativeElementAsync(Object element) - { - await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); - } - public void SetNativeElement(Object element) - { - InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); - } - - partial void SerializeCoreIgbChatMessageReaction(RendererSerializer ser); - - internal override void SerializeCore(RendererSerializer ser) - { - base.SerializeCore(ser); - - SerializeCoreIgbChatMessageReaction(ser); - - if (IsPropDirty("Message")) { ser.AddSerializableProp("message", this._message); } - if (IsPropDirty("Reaction")) { ser.AddStringProp("reaction", this._reaction); } - - } - - - protected internal override void ToEventJson(BaseRendererControl control, Dictionary args) - { - base.ToEventJson(control, args); - - if (IsPropDirty("Message")) { args["message"] = ObjectToParam(this._message); } - if (IsPropDirty("Reaction")) { args["reaction"] = this._reaction; } - - - } - - - protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) { - base.FromEventJson(control, args); - this.SuppressParentNotify = true; - - if (args.ContainsKey("message")) { this.Message = (IgbChatMessage)ConvertReturnValue(args["message"], "ChatMessage", true); } - if (args.ContainsKey("reaction")) { this.Reaction = ReturnToString(args["reaction"]); } - - this.SuppressParentNotify = false; - } - -} + public partial class IgbChatMessageReaction : BaseRendererElement + { + public override string Type { get { return "WebChatMessageReaction"; } } + + private static bool _marshalByValue = true; + + public IgbChatMessageReaction() : base() + { + OnCreatedIgbChatMessageReaction(); + + } + + partial void OnCreatedIgbChatMessageReaction(); + + private IgbChatMessage _message; + + partial void OnMessageChanging(ref IgbChatMessage newValue); + /// + /// The chat message that the reaction is associated with. + /// + [Parameter] + public IgbChatMessage Message + { + get { return this._message; } + set + { + OnMessageChanging(ref value); + MarkPropDirty("Message"); + if (this._message != null) + { + this.DetachChild(this._message); + } + if (value != null) + { + this.AttachChild(value); + } + this._message = value; + } + + } + private string _reaction; + + partial void OnReactionChanging(ref string newValue); + /// + /// The string representation of the reaction, such as an emoji or a string; + /// + [Parameter] + public string Reaction + { + get { return this._reaction; } + set + { + if (this._reaction != value || !IsPropDirty("Reaction")) + { + MarkPropDirty("Reaction"); + } + this._reaction = value; + + } + } + + partial void FindByNameChatMessageReaction(string name, ref object item); + public override object FindByName(string name) + { + + var baseResult = base.FindByName(name); + if (baseResult != null) + { + return baseResult; + } + + object item = null; + FindByNameChatMessageReaction(name, ref item); + if (item != null) + { + return item; + } + + return null; + } + public async Task SetNativeElementAsync(Object element) + { + await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + } + public void SetNativeElement(Object element) + { + InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + } + + partial void SerializeCoreIgbChatMessageReaction(RendererSerializer ser); + + internal override void SerializeCore(RendererSerializer ser) + { + base.SerializeCore(ser); + + SerializeCoreIgbChatMessageReaction(ser); + + if (IsPropDirty("Message")) + { ser.AddSerializableProp("message", this._message); } + if (IsPropDirty("Reaction")) + { ser.AddStringProp("reaction", this._reaction); } + + } + + protected internal override void ToEventJson(BaseRendererControl control, Dictionary args) + { + base.ToEventJson(control, args); + + if (IsPropDirty("Message")) + { args["message"] = ObjectToParam(this._message); } + if (IsPropDirty("Reaction")) + { args["reaction"] = this._reaction; } + + } + + protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) + { + base.FromEventJson(control, args); + this.SuppressParentNotify = true; + + if (args.ContainsKey("message")) + { this.Message = (IgbChatMessage)ConvertReturnValue(args["message"], "ChatMessage", true); } + if (args.ContainsKey("reaction")) + { this.Reaction = ReturnToString(args["reaction"]); } + + this.SuppressParentNotify = false; + } + + } } diff --git a/src/components/Blazor/ChatMessageReactionEventArgs.cs b/src/components/Blazor/ChatMessageReactionEventArgs.cs index 87cc69ae..e2d47330 100644 --- a/src/components/Blazor/ChatMessageReactionEventArgs.cs +++ b/src/components/Blazor/ChatMessageReactionEventArgs.cs @@ -1,99 +1,97 @@ - -using System; using Microsoft.AspNetCore.Components; -using Microsoft.AspNetCore.Components.Rendering; -using System.Threading.Tasks; -using System.Collections.Generic; -using System.Linq; namespace IgniteUI.Blazor.Controls { - public partial class IgbChatMessageReactionEventArgs: BaseRendererElement { - public override string Type { get { return "WebChatMessageReactionEventArgs"; } } - - - private static bool _marshalByValue = true; - - public IgbChatMessageReactionEventArgs(): base() { - OnCreatedIgbChatMessageReactionEventArgs(); - - - } - - partial void OnCreatedIgbChatMessageReactionEventArgs(); - - private IgbChatMessageReaction _detail; - - partial void OnDetailChanging(ref IgbChatMessageReaction newValue); - [Parameter] - public IgbChatMessageReaction Detail - { - get { return this._detail; } - set { - OnDetailChanging(ref value); - MarkPropDirty("Detail"); - if (this._detail != null) { - this.DetachChild(this._detail); - } - if (value != null) { - this.AttachChild(value); - } - this._detail = value; - } - - } - - partial void FindByNameChatMessageReactionEventArgs(string name, ref object item); - public override object FindByName(string name) - { - - var baseResult = base.FindByName(name); - if (baseResult != null) - { - return baseResult; - } - - object item = null; - FindByNameChatMessageReactionEventArgs(name, ref item); - if (item != null) - { - return item; - } - - return null; - } - - partial void SerializeCoreIgbChatMessageReactionEventArgs(RendererSerializer ser); - - internal override void SerializeCore(RendererSerializer ser) - { - base.SerializeCore(ser); - - SerializeCoreIgbChatMessageReactionEventArgs(ser); - - if (IsPropDirty("Detail")) { ser.AddSerializableProp("detail", this._detail); } - - } - - - protected internal override void ToEventJson(BaseRendererControl control, Dictionary args) - { - base.ToEventJson(control, args); - - if (IsPropDirty("Detail")) { args["detail"] = ObjectToParam(this._detail); } - - - } - - - protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) { - base.FromEventJson(control, args); - this.SuppressParentNotify = true; - - if (args.ContainsKey("detail")) { this.Detail = (IgbChatMessageReaction)ConvertReturnValue(args["detail"], "ChatMessageReaction", true); } - - this.SuppressParentNotify = false; - } - -} + public partial class IgbChatMessageReactionEventArgs : BaseRendererElement + { + public override string Type { get { return "WebChatMessageReactionEventArgs"; } } + + private static bool _marshalByValue = true; + + public IgbChatMessageReactionEventArgs() : base() + { + OnCreatedIgbChatMessageReactionEventArgs(); + + } + + partial void OnCreatedIgbChatMessageReactionEventArgs(); + + private IgbChatMessageReaction _detail; + + partial void OnDetailChanging(ref IgbChatMessageReaction newValue); + [Parameter] + public IgbChatMessageReaction Detail + { + get { return this._detail; } + set + { + OnDetailChanging(ref value); + MarkPropDirty("Detail"); + if (this._detail != null) + { + this.DetachChild(this._detail); + } + if (value != null) + { + this.AttachChild(value); + } + this._detail = value; + } + + } + + partial void FindByNameChatMessageReactionEventArgs(string name, ref object item); + public override object FindByName(string name) + { + + var baseResult = base.FindByName(name); + if (baseResult != null) + { + return baseResult; + } + + object item = null; + FindByNameChatMessageReactionEventArgs(name, ref item); + if (item != null) + { + return item; + } + + return null; + } + + partial void SerializeCoreIgbChatMessageReactionEventArgs(RendererSerializer ser); + + internal override void SerializeCore(RendererSerializer ser) + { + base.SerializeCore(ser); + + SerializeCoreIgbChatMessageReactionEventArgs(ser); + + if (IsPropDirty("Detail")) + { ser.AddSerializableProp("detail", this._detail); } + + } + + protected internal override void ToEventJson(BaseRendererControl control, Dictionary args) + { + base.ToEventJson(control, args); + + if (IsPropDirty("Detail")) + { args["detail"] = ObjectToParam(this._detail); } + + } + + protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) + { + base.FromEventJson(control, args); + this.SuppressParentNotify = true; + + if (args.ContainsKey("detail")) + { this.Detail = (IgbChatMessageReaction)ConvertReturnValue(args["detail"], "ChatMessageReaction", true); } + + this.SuppressParentNotify = false; + } + + } } diff --git a/src/components/Blazor/ChatMessageRenderContext.cs b/src/components/Blazor/ChatMessageRenderContext.cs index 36ee80ac..a7967579 100644 --- a/src/components/Blazor/ChatMessageRenderContext.cs +++ b/src/components/Blazor/ChatMessageRenderContext.cs @@ -1,88 +1,86 @@ - -using System; using Microsoft.AspNetCore.Components; -using Microsoft.AspNetCore.Components.Rendering; -using System.Threading.Tasks; -using System.Collections.Generic; -using System.Linq; namespace IgniteUI.Blazor.Controls { - public partial class IgbChatMessageRenderContext: BaseRendererElement { - public override string Type { get { return "WebChatMessageRenderContext"; } } - - - public IgbChatMessageRenderContext(): base() { - OnCreatedIgbChatMessageRenderContext(); - - - } - - partial void OnCreatedIgbChatMessageRenderContext(); - - private IgbChatMessage _message; - - partial void OnMessageChanging(ref IgbChatMessage newValue); - /// - /// The specific chat message being rendered. - /// - [Parameter] - public IgbChatMessage Message - { - get { return this._message; } - set { - OnMessageChanging(ref value); - MarkPropDirty("Message"); - if (this._message != null) { - this.DetachChild(this._message); - } - if (value != null) { - this.AttachChild(value); - } - this._message = value; - } - - } - - partial void FindByNameChatMessageRenderContext(string name, ref object item); - public override object FindByName(string name) - { - - var baseResult = base.FindByName(name); - if (baseResult != null) - { - return baseResult; - } - - object item = null; - FindByNameChatMessageRenderContext(name, ref item); - if (item != null) - { - return item; - } - - return null; - } - public async Task SetNativeElementAsync(Object element) - { - await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); - } - public void SetNativeElement(Object element) - { - InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); - } - - partial void SerializeCoreIgbChatMessageRenderContext(RendererSerializer ser); - - internal override void SerializeCore(RendererSerializer ser) - { - base.SerializeCore(ser); - - SerializeCoreIgbChatMessageRenderContext(ser); - - if (IsPropDirty("Message")) { ser.AddSerializableProp("message", this._message); } - - } - -} + public partial class IgbChatMessageRenderContext : BaseRendererElement + { + public override string Type { get { return "WebChatMessageRenderContext"; } } + + public IgbChatMessageRenderContext() : base() + { + OnCreatedIgbChatMessageRenderContext(); + + } + + partial void OnCreatedIgbChatMessageRenderContext(); + + private IgbChatMessage _message; + + partial void OnMessageChanging(ref IgbChatMessage newValue); + /// + /// The specific chat message being rendered. + /// + [Parameter] + public IgbChatMessage Message + { + get { return this._message; } + set + { + OnMessageChanging(ref value); + MarkPropDirty("Message"); + if (this._message != null) + { + this.DetachChild(this._message); + } + if (value != null) + { + this.AttachChild(value); + } + this._message = value; + } + + } + + partial void FindByNameChatMessageRenderContext(string name, ref object item); + public override object FindByName(string name) + { + + var baseResult = base.FindByName(name); + if (baseResult != null) + { + return baseResult; + } + + object item = null; + FindByNameChatMessageRenderContext(name, ref item); + if (item != null) + { + return item; + } + + return null; + } + public async Task SetNativeElementAsync(Object element) + { + await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + } + public void SetNativeElement(Object element) + { + InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + } + + partial void SerializeCoreIgbChatMessageRenderContext(RendererSerializer ser); + + internal override void SerializeCore(RendererSerializer ser) + { + base.SerializeCore(ser); + + SerializeCoreIgbChatMessageRenderContext(ser); + + if (IsPropDirty("Message")) + { ser.AddSerializableProp("message", this._message); } + + } + + } } diff --git a/src/components/Blazor/ChatModule.cs b/src/components/Blazor/ChatModule.cs index af39f34b..22e8166b 100644 --- a/src/components/Blazor/ChatModule.cs +++ b/src/components/Blazor/ChatModule.cs @@ -1,23 +1,20 @@ -using System; -using System.Collections.Generic; -using System.Runtime.CompilerServices; -using System.Text; -using System.Collections.Generic; - namespace IgniteUI.Blazor.Controls { - public partial class IgbChatModule { - public static void Register(IIgniteUIBlazor runtime) { + public partial class IgbChatModule + { + public static void Register(IIgniteUIBlazor runtime) + { ModuleLoader.Load(runtime, "WebChatModule"); - } - public static void MarkIsLoadRequested(IIgniteUIBlazor runtime) { + public static void MarkIsLoadRequested(IIgniteUIBlazor runtime) + { ModuleLoader.MarkIsLoadRequested(runtime, "WebChatModule"); } - public static bool IsLoadRequested(IIgniteUIBlazor runtime) { + public static bool IsLoadRequested(IIgniteUIBlazor runtime) + { return ModuleLoader.IsLoadRequested(runtime, "WebChatModule"); } } diff --git a/src/components/Blazor/ChatOptions.cs b/src/components/Blazor/ChatOptions.cs index 6b803ca5..b80ee245 100644 --- a/src/components/Blazor/ChatOptions.cs +++ b/src/components/Blazor/ChatOptions.cs @@ -1,281 +1,309 @@ - -using System; using Microsoft.AspNetCore.Components; -using Microsoft.AspNetCore.Components.Rendering; -using System.Threading.Tasks; -using System.Collections.Generic; -using System.Linq; namespace IgniteUI.Blazor.Controls { - public partial class IgbChatOptions: BaseRendererElement { - public override string Type { get { return "WebChatOptions"; } } - - - public IgbChatOptions(): base() { - OnCreatedIgbChatOptions(); - - - } - - partial void OnCreatedIgbChatOptions(); - - private string _currentUserId; - - partial void OnCurrentUserIdChanging(ref string newValue); - /// - /// The ID of the current user. Used to differentiate between incoming and outgoing messages. - /// - [Parameter] - public string CurrentUserId - { - get { return this._currentUserId; } - set { - if (this._currentUserId != value || !IsPropDirty("CurrentUserId")) { - MarkPropDirty("CurrentUserId"); - } - this._currentUserId = value; - - } - } - private bool _disableAutoScroll = false; - - partial void OnDisableAutoScrollChanging(ref bool newValue); - /// - /// If `true`, prevents the chat from automatically scrolling to the latest message. - /// - [Parameter] - public bool DisableAutoScroll - { - get { return this._disableAutoScroll; } - set { - if (this._disableAutoScroll != value || !IsPropDirty("DisableAutoScroll")) { - MarkPropDirty("DisableAutoScroll"); - } - this._disableAutoScroll = value; - - } - } - private bool _disableInputAttachments = false; - - partial void OnDisableInputAttachmentsChanging(ref bool newValue); - /// - /// If `true`, disables the ability to upload and send attachments. - /// Defaults to `false`. - /// - [Parameter] - public bool DisableInputAttachments - { - get { return this._disableInputAttachments; } - set { - if (this._disableInputAttachments != value || !IsPropDirty("DisableInputAttachments")) { - MarkPropDirty("DisableInputAttachments"); - } - this._disableInputAttachments = value; - - } - } - private bool _isTyping = false; - - partial void OnIsTypingChanging(ref bool newValue); - /// - /// Indicates whether the other user is currently typing a message. - /// - [Parameter] - public bool IsTyping - { - get { return this._isTyping; } - set { - if (this._isTyping != value || !IsPropDirty("IsTyping")) { - MarkPropDirty("IsTyping"); - } - this._isTyping = value; - - } - } - private string _headerText; - - partial void OnHeaderTextChanging(ref string newValue); - /// - /// Optional header text to display at the top of the chat component. - /// - [Parameter] - public string HeaderText - { - get { return this._headerText; } - set { - if (this._headerText != value || !IsPropDirty("HeaderText")) { - MarkPropDirty("HeaderText"); - } - this._headerText = value; - - } - } - private string _inputPlaceholder; - - partial void OnInputPlaceholderChanging(ref string newValue); - /// - /// Optional placeholder text for the chat input area. - /// Provides a hint to the user about what they can type (e.g. "Type a message..."). - /// - [Parameter] - public string InputPlaceholder - { - get { return this._inputPlaceholder; } - set { - if (this._inputPlaceholder != value || !IsPropDirty("InputPlaceholder")) { - MarkPropDirty("InputPlaceholder"); - } - this._inputPlaceholder = value; - - } - } - private string[] _suggestions; - - partial void OnSuggestionsChanging(ref string[] newValue); - /// - /// Suggested text snippets or quick replies that can be shown as user-selectable options. - /// - [Parameter] - public string[] Suggestions - { - get { return this._suggestions; } - set { - if (this._suggestions != value || !IsPropDirty("Suggestions")) { - MarkPropDirty("Suggestions"); - } - this._suggestions = value; - - } - } - private ChatSuggestionsPosition _suggestionsPosition = ChatSuggestionsPosition.BelowInput; - - partial void OnSuggestionsPositionChanging(ref ChatSuggestionsPosition newValue); - /// - /// Controls the position of the chat suggestions within the component layout. - /// - `"below-input"`: Renders suggestions below the chat input area. - /// - `"below-messages"`: Renders suggestions below the chat messages area. - /// Default is `"below-messages"`. - /// - [Parameter] - public ChatSuggestionsPosition SuggestionsPosition - { - get { return this._suggestionsPosition; } - set { - if (this._suggestionsPosition != value || !IsPropDirty("SuggestionsPosition")) { - MarkPropDirty("SuggestionsPosition"); - } - this._suggestionsPosition = value; - - } - } - private double _stopTypingDelay = 0; - - partial void OnStopTypingDelayChanging(ref double newValue); - /// - /// Time in milliseconds to wait before dispatching a stop typing event. - /// Default is `3000`. - /// - [Parameter] - public double StopTypingDelay - { - get { return this._stopTypingDelay; } - set { - if (this._stopTypingDelay != value || !IsPropDirty("StopTypingDelay")) { - MarkPropDirty("StopTypingDelay"); - } - this._stopTypingDelay = value; - - } - } - private bool _adoptRootStyles = false; - - partial void OnAdoptRootStylesChanging(ref bool newValue); - [Parameter] - public bool AdoptRootStyles - { - get { return this._adoptRootStyles; } - set { - if (this._adoptRootStyles != value || !IsPropDirty("AdoptRootStyles")) { - MarkPropDirty("AdoptRootStyles"); - } - this._adoptRootStyles = value; - - } - } - private IgbChatRenderers _renderers; - - partial void OnRenderersChanging(ref IgbChatRenderers newValue); - /// - /// An object containing a collection of custom renderers for different parts of the chat UI. - /// - [Parameter] - public IgbChatRenderers Renderers - { - get { return this._renderers; } - set { - OnRenderersChanging(ref value); - MarkPropDirty("Renderers"); - if (this._renderers != null) { - this.DetachChild(this._renderers); - } - if (value != null) { - this.AttachChild(value); - } - this._renderers = value; - } - - } - - partial void FindByNameChatOptions(string name, ref object item); - public override object FindByName(string name) - { - - var baseResult = base.FindByName(name); - if (baseResult != null) - { - return baseResult; - } - - object item = null; - FindByNameChatOptions(name, ref item); - if (item != null) - { - return item; - } - - return null; - } - public async Task SetNativeElementAsync(Object element) - { - await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); - } - public void SetNativeElement(Object element) - { - InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); - } - - partial void SerializeCoreIgbChatOptions(RendererSerializer ser); - - internal override void SerializeCore(RendererSerializer ser) - { - base.SerializeCore(ser); - - SerializeCoreIgbChatOptions(ser); - - if (IsPropDirty("CurrentUserId")) { ser.AddStringProp("currentUserId", this._currentUserId); } - if (IsPropDirty("DisableAutoScroll")) { ser.AddBooleanProp("disableAutoScroll", this._disableAutoScroll); } - if (IsPropDirty("DisableInputAttachments")) { ser.AddBooleanProp("disableInputAttachments", this._disableInputAttachments); } - if (IsPropDirty("IsTyping")) { ser.AddBooleanProp("isTyping", this._isTyping); } - if (IsPropDirty("HeaderText")) { ser.AddStringProp("headerText", this._headerText); } - if (IsPropDirty("InputPlaceholder")) { ser.AddStringProp("inputPlaceholder", this._inputPlaceholder); } - if (IsPropDirty("Suggestions")) { ser.AddArrayProp("suggestions", this._suggestions); } - if (IsPropDirty("SuggestionsPosition")) { ser.AddEnumProp("suggestionsPosition", this._suggestionsPosition); } - if (IsPropDirty("StopTypingDelay")) { ser.AddNumberProp("stopTypingDelay", this._stopTypingDelay); } - if (IsPropDirty("AdoptRootStyles")) { ser.AddBooleanProp("adoptRootStyles", this._adoptRootStyles); } - if (IsPropDirty("Renderers")) { ser.AddSerializableProp("renderers", this._renderers); } - - } - -} + public partial class IgbChatOptions : BaseRendererElement + { + public override string Type { get { return "WebChatOptions"; } } + + public IgbChatOptions() : base() + { + OnCreatedIgbChatOptions(); + + } + + partial void OnCreatedIgbChatOptions(); + + private string _currentUserId; + + partial void OnCurrentUserIdChanging(ref string newValue); + /// + /// The ID of the current user. Used to differentiate between incoming and outgoing messages. + /// + [Parameter] + public string CurrentUserId + { + get { return this._currentUserId; } + set + { + if (this._currentUserId != value || !IsPropDirty("CurrentUserId")) + { + MarkPropDirty("CurrentUserId"); + } + this._currentUserId = value; + + } + } + private bool _disableAutoScroll = false; + + partial void OnDisableAutoScrollChanging(ref bool newValue); + /// + /// If `true`, prevents the chat from automatically scrolling to the latest message. + /// + [Parameter] + public bool DisableAutoScroll + { + get { return this._disableAutoScroll; } + set + { + if (this._disableAutoScroll != value || !IsPropDirty("DisableAutoScroll")) + { + MarkPropDirty("DisableAutoScroll"); + } + this._disableAutoScroll = value; + + } + } + private bool _disableInputAttachments = false; + + partial void OnDisableInputAttachmentsChanging(ref bool newValue); + /// + /// If `true`, disables the ability to upload and send attachments. + /// Defaults to `false`. + /// + [Parameter] + public bool DisableInputAttachments + { + get { return this._disableInputAttachments; } + set + { + if (this._disableInputAttachments != value || !IsPropDirty("DisableInputAttachments")) + { + MarkPropDirty("DisableInputAttachments"); + } + this._disableInputAttachments = value; + + } + } + private bool _isTyping = false; + + partial void OnIsTypingChanging(ref bool newValue); + /// + /// Indicates whether the other user is currently typing a message. + /// + [Parameter] + public bool IsTyping + { + get { return this._isTyping; } + set + { + if (this._isTyping != value || !IsPropDirty("IsTyping")) + { + MarkPropDirty("IsTyping"); + } + this._isTyping = value; + + } + } + private string _headerText; + + partial void OnHeaderTextChanging(ref string newValue); + /// + /// Optional header text to display at the top of the chat component. + /// + [Parameter] + public string HeaderText + { + get { return this._headerText; } + set + { + if (this._headerText != value || !IsPropDirty("HeaderText")) + { + MarkPropDirty("HeaderText"); + } + this._headerText = value; + + } + } + private string _inputPlaceholder; + + partial void OnInputPlaceholderChanging(ref string newValue); + /// + /// Optional placeholder text for the chat input area. + /// Provides a hint to the user about what they can type (e.g. "Type a message..."). + /// + [Parameter] + public string InputPlaceholder + { + get { return this._inputPlaceholder; } + set + { + if (this._inputPlaceholder != value || !IsPropDirty("InputPlaceholder")) + { + MarkPropDirty("InputPlaceholder"); + } + this._inputPlaceholder = value; + + } + } + private string[] _suggestions; + + partial void OnSuggestionsChanging(ref string[] newValue); + /// + /// Suggested text snippets or quick replies that can be shown as user-selectable options. + /// + [Parameter] + public string[] Suggestions + { + get { return this._suggestions; } + set + { + if (this._suggestions != value || !IsPropDirty("Suggestions")) + { + MarkPropDirty("Suggestions"); + } + this._suggestions = value; + + } + } + private ChatSuggestionsPosition _suggestionsPosition = ChatSuggestionsPosition.BelowInput; + + partial void OnSuggestionsPositionChanging(ref ChatSuggestionsPosition newValue); + /// + /// Controls the position of the chat suggestions within the component layout. + /// - `"below-input"`: Renders suggestions below the chat input area. + /// - `"below-messages"`: Renders suggestions below the chat messages area. + /// Default is `"below-messages"`. + /// + [Parameter] + public ChatSuggestionsPosition SuggestionsPosition + { + get { return this._suggestionsPosition; } + set + { + if (this._suggestionsPosition != value || !IsPropDirty("SuggestionsPosition")) + { + MarkPropDirty("SuggestionsPosition"); + } + this._suggestionsPosition = value; + + } + } + private double _stopTypingDelay = 0; + + partial void OnStopTypingDelayChanging(ref double newValue); + /// + /// Time in milliseconds to wait before dispatching a stop typing event. + /// Default is `3000`. + /// + [Parameter] + public double StopTypingDelay + { + get { return this._stopTypingDelay; } + set + { + if (this._stopTypingDelay != value || !IsPropDirty("StopTypingDelay")) + { + MarkPropDirty("StopTypingDelay"); + } + this._stopTypingDelay = value; + + } + } + private bool _adoptRootStyles = false; + + partial void OnAdoptRootStylesChanging(ref bool newValue); + [Parameter] + public bool AdoptRootStyles + { + get { return this._adoptRootStyles; } + set + { + if (this._adoptRootStyles != value || !IsPropDirty("AdoptRootStyles")) + { + MarkPropDirty("AdoptRootStyles"); + } + this._adoptRootStyles = value; + + } + } + private IgbChatRenderers _renderers; + + partial void OnRenderersChanging(ref IgbChatRenderers newValue); + /// + /// An object containing a collection of custom renderers for different parts of the chat UI. + /// + [Parameter] + public IgbChatRenderers Renderers + { + get { return this._renderers; } + set + { + OnRenderersChanging(ref value); + MarkPropDirty("Renderers"); + if (this._renderers != null) + { + this.DetachChild(this._renderers); + } + if (value != null) + { + this.AttachChild(value); + } + this._renderers = value; + } + + } + + partial void FindByNameChatOptions(string name, ref object item); + public override object FindByName(string name) + { + + var baseResult = base.FindByName(name); + if (baseResult != null) + { + return baseResult; + } + + object item = null; + FindByNameChatOptions(name, ref item); + if (item != null) + { + return item; + } + + return null; + } + public async Task SetNativeElementAsync(Object element) + { + await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + } + public void SetNativeElement(Object element) + { + InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + } + + partial void SerializeCoreIgbChatOptions(RendererSerializer ser); + + internal override void SerializeCore(RendererSerializer ser) + { + base.SerializeCore(ser); + + SerializeCoreIgbChatOptions(ser); + + if (IsPropDirty("CurrentUserId")) + { ser.AddStringProp("currentUserId", this._currentUserId); } + if (IsPropDirty("DisableAutoScroll")) + { ser.AddBooleanProp("disableAutoScroll", this._disableAutoScroll); } + if (IsPropDirty("DisableInputAttachments")) + { ser.AddBooleanProp("disableInputAttachments", this._disableInputAttachments); } + if (IsPropDirty("IsTyping")) + { ser.AddBooleanProp("isTyping", this._isTyping); } + if (IsPropDirty("HeaderText")) + { ser.AddStringProp("headerText", this._headerText); } + if (IsPropDirty("InputPlaceholder")) + { ser.AddStringProp("inputPlaceholder", this._inputPlaceholder); } + if (IsPropDirty("Suggestions")) + { ser.AddArrayProp("suggestions", this._suggestions); } + if (IsPropDirty("SuggestionsPosition")) + { ser.AddEnumProp("suggestionsPosition", this._suggestionsPosition); } + if (IsPropDirty("StopTypingDelay")) + { ser.AddNumberProp("stopTypingDelay", this._stopTypingDelay); } + if (IsPropDirty("AdoptRootStyles")) + { ser.AddBooleanProp("adoptRootStyles", this._adoptRootStyles); } + if (IsPropDirty("Renderers")) + { ser.AddSerializableProp("renderers", this._renderers); } + + } + + } } diff --git a/src/components/Blazor/ChatRenderContext.cs b/src/components/Blazor/ChatRenderContext.cs index 40f59e8c..b5898edc 100644 --- a/src/components/Blazor/ChatRenderContext.cs +++ b/src/components/Blazor/ChatRenderContext.cs @@ -1,83 +1,80 @@ - -using System; using Microsoft.AspNetCore.Components; -using Microsoft.AspNetCore.Components.Rendering; -using System.Threading.Tasks; -using System.Collections.Generic; -using System.Linq; namespace IgniteUI.Blazor.Controls { - public partial class IgbChatRenderContext: BaseRendererElement { - public override string Type { get { return "WebChatRenderContext"; } } - - - public IgbChatRenderContext(): base() { - OnCreatedIgbChatRenderContext(); - - - } - - partial void OnCreatedIgbChatRenderContext(); - - private IgbChat _instance; - - partial void OnInstanceChanging(ref IgbChat newValue); - /// - /// The instance of the IgcChatComponent. - /// - [Parameter] - public IgbChat Instance - { - get { return this._instance; } - set { - if (this._instance != value || !IsPropDirty("Instance")) { - MarkPropDirty("Instance"); - } - this._instance = value; - - } - } - - partial void FindByNameChatRenderContext(string name, ref object item); - public override object FindByName(string name) - { - - var baseResult = base.FindByName(name); - if (baseResult != null) - { - return baseResult; - } - - object item = null; - FindByNameChatRenderContext(name, ref item); - if (item != null) - { - return item; - } - - return null; - } - public async Task SetNativeElementAsync(Object element) - { - await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); - } - public void SetNativeElement(Object element) - { - InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); - } - - partial void SerializeCoreIgbChatRenderContext(RendererSerializer ser); - - internal override void SerializeCore(RendererSerializer ser) - { - base.SerializeCore(ser); - - SerializeCoreIgbChatRenderContext(ser); - - if (IsPropDirty("Instance")) { ser.AddSerializableProp("instance", this._instance); } - - } - -} + public partial class IgbChatRenderContext : BaseRendererElement + { + public override string Type { get { return "WebChatRenderContext"; } } + + public IgbChatRenderContext() : base() + { + OnCreatedIgbChatRenderContext(); + + } + + partial void OnCreatedIgbChatRenderContext(); + + private IgbChat _instance; + + partial void OnInstanceChanging(ref IgbChat newValue); + /// + /// The instance of the IgcChatComponent. + /// + [Parameter] + public IgbChat Instance + { + get { return this._instance; } + set + { + if (this._instance != value || !IsPropDirty("Instance")) + { + MarkPropDirty("Instance"); + } + this._instance = value; + + } + } + + partial void FindByNameChatRenderContext(string name, ref object item); + public override object FindByName(string name) + { + + var baseResult = base.FindByName(name); + if (baseResult != null) + { + return baseResult; + } + + object item = null; + FindByNameChatRenderContext(name, ref item); + if (item != null) + { + return item; + } + + return null; + } + public async Task SetNativeElementAsync(Object element) + { + await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + } + public void SetNativeElement(Object element) + { + InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + } + + partial void SerializeCoreIgbChatRenderContext(RendererSerializer ser); + + internal override void SerializeCore(RendererSerializer ser) + { + base.SerializeCore(ser); + + SerializeCoreIgbChatRenderContext(ser); + + if (IsPropDirty("Instance")) + { ser.AddSerializableProp("instance", this._instance); } + + } + + } } diff --git a/src/components/Blazor/ChatRenderers.cs b/src/components/Blazor/ChatRenderers.cs index 90d1824f..f973b73b 100644 --- a/src/components/Blazor/ChatRenderers.cs +++ b/src/components/Blazor/ChatRenderers.cs @@ -1,826 +1,848 @@ - -using System; using Microsoft.AspNetCore.Components; -using Microsoft.AspNetCore.Components.Rendering; -using System.Threading.Tasks; -using System.Collections.Generic; -using System.Linq; namespace IgniteUI.Blazor.Controls { - public partial class IgbChatRenderers: BaseRendererElement { - public override string Type { get { return "WebChatRenderers"; } } - - - public IgbChatRenderers(): base() { - OnCreatedIgbChatRenderers(); - - - } - - partial void OnCreatedIgbChatRenderers(); - - private string _attachmentRef; - private RenderFragment _attachment; - - partial void OnAttachmentChanging(ref RenderFragment newValue); - /// - /// Custom renderer for a single chat message attachment. - /// - [Parameter] - public RenderFragment Attachment - { - get { return this._attachment; } - - set { - var oldValue = this._attachment; - OnAttachmentChanging(ref value); - if (oldValue != value || !IsPropDirty("Attachment")) - { - MarkPropDirty("Attachment"); - this._attachment = value; - this._attachmentTemplateId = Guid.NewGuid().ToString(); - this.UpdateTemplate(this._attachmentTemplateId, this._attachment, typeof(IgbChatAttachmentRenderContext)); - this.OnRefChanged("Attachment", null, "template:::" + this._attachmentTemplateId, true, false, (string refName, object old, object newValue) => { - this._attachmentRef = refName; - this.MarkPropDirty("AttachmentRef"); - }); - } - } - } - - - private string _attachmentTemplateId; - private string _attachmentScript; - - - ///Provides a means of setting Attachment in the JavaScript environment. - [Parameter] - public string AttachmentScript - { - get { return _attachmentScript; } - - - set { - var oldValue = this._attachmentScript; - if (oldValue != value || !IsPropDirty("Attachment")) - { - this._attachmentScript = value; - MarkPropDirty("Attachment"); - this.OnRefChanged("Attachment", oldValue, value, true, false, (string refName, object old, object newValue) => { - this._attachmentRef = refName; - this.MarkPropDirty("AttachmentRef"); - }); - } - } - } - private string _attachmentContentRef; - private RenderFragment _attachmentContent; - - partial void OnAttachmentContentChanging(ref RenderFragment newValue); - /// - /// Custom renderer for the content of an attachment. - /// - [Parameter] - public RenderFragment AttachmentContent - { - get { return this._attachmentContent; } - - set { - var oldValue = this._attachmentContent; - OnAttachmentContentChanging(ref value); - if (oldValue != value || !IsPropDirty("AttachmentContent")) - { - MarkPropDirty("AttachmentContent"); - this._attachmentContent = value; - this._attachmentContentTemplateId = Guid.NewGuid().ToString(); - this.UpdateTemplate(this._attachmentContentTemplateId, this._attachmentContent, typeof(IgbChatAttachmentRenderContext)); - this.OnRefChanged("AttachmentContent", null, "template:::" + this._attachmentContentTemplateId, true, false, (string refName, object old, object newValue) => { - this._attachmentContentRef = refName; - this.MarkPropDirty("AttachmentContentRef"); - }); - } - } - } - - - private string _attachmentContentTemplateId; - private string _attachmentContentScript; - - - ///Provides a means of setting AttachmentContent in the JavaScript environment. - [Parameter] - public string AttachmentContentScript - { - get { return _attachmentContentScript; } - - - set { - var oldValue = this._attachmentContentScript; - if (oldValue != value || !IsPropDirty("AttachmentContent")) - { - this._attachmentContentScript = value; - MarkPropDirty("AttachmentContent"); - this.OnRefChanged("AttachmentContent", oldValue, value, true, false, (string refName, object old, object newValue) => { - this._attachmentContentRef = refName; - this.MarkPropDirty("AttachmentContentRef"); - }); - } - } - } - private string _attachmentHeaderRef; - private RenderFragment _attachmentHeader; - - partial void OnAttachmentHeaderChanging(ref RenderFragment newValue); - /// - /// Custom renderer for the header of an attachment. - /// - [Parameter] - public RenderFragment AttachmentHeader - { - get { return this._attachmentHeader; } - - set { - var oldValue = this._attachmentHeader; - OnAttachmentHeaderChanging(ref value); - if (oldValue != value || !IsPropDirty("AttachmentHeader")) - { - MarkPropDirty("AttachmentHeader"); - this._attachmentHeader = value; - this._attachmentHeaderTemplateId = Guid.NewGuid().ToString(); - this.UpdateTemplate(this._attachmentHeaderTemplateId, this._attachmentHeader, typeof(IgbChatAttachmentRenderContext)); - this.OnRefChanged("AttachmentHeader", null, "template:::" + this._attachmentHeaderTemplateId, true, false, (string refName, object old, object newValue) => { - this._attachmentHeaderRef = refName; - this.MarkPropDirty("AttachmentHeaderRef"); - }); - } - } - } - - - private string _attachmentHeaderTemplateId; - private string _attachmentHeaderScript; - - - ///Provides a means of setting AttachmentHeader in the JavaScript environment. - [Parameter] - public string AttachmentHeaderScript - { - get { return _attachmentHeaderScript; } - - - set { - var oldValue = this._attachmentHeaderScript; - if (oldValue != value || !IsPropDirty("AttachmentHeader")) - { - this._attachmentHeaderScript = value; - MarkPropDirty("AttachmentHeader"); - this.OnRefChanged("AttachmentHeader", oldValue, value, true, false, (string refName, object old, object newValue) => { - this._attachmentHeaderRef = refName; - this.MarkPropDirty("AttachmentHeaderRef"); - }); - } - } - } - private string _inputRef; - private RenderFragment _input; - - partial void OnInputChanging(ref RenderFragment newValue); - /// - /// Custom renderer for the main chat input field. - /// - [Parameter] - public RenderFragment Input - { - get { return this._input; } - - set { - var oldValue = this._input; - OnInputChanging(ref value); - if (oldValue != value || !IsPropDirty("Input")) - { - MarkPropDirty("Input"); - this._input = value; - this._inputTemplateId = Guid.NewGuid().ToString(); - this.UpdateTemplate(this._inputTemplateId, this._input, typeof(IgbChatInputRenderContext)); - this.OnRefChanged("Input", null, "template:::" + this._inputTemplateId, true, false, (string refName, object old, object newValue) => { - this._inputRef = refName; - this.MarkPropDirty("InputRef"); - }); - } - } - } - - - private string _inputTemplateId; - private string _inputScript; - - - ///Provides a means of setting Input in the JavaScript environment. - [Parameter] - public string InputScript - { - get { return _inputScript; } - - - set { - var oldValue = this._inputScript; - if (oldValue != value || !IsPropDirty("Input")) - { - this._inputScript = value; - MarkPropDirty("Input"); - this.OnRefChanged("Input", oldValue, value, true, false, (string refName, object old, object newValue) => { - this._inputRef = refName; - this.MarkPropDirty("InputRef"); - }); - } - } - } - private string _inputActionsRef; - private RenderFragment _inputActions; - - partial void OnInputActionsChanging(ref RenderFragment newValue); - /// - /// Custom renderer for the actions container within the input area. - /// - [Parameter] - public RenderFragment InputActions - { - get { return this._inputActions; } - - set { - var oldValue = this._inputActions; - OnInputActionsChanging(ref value); - if (oldValue != value || !IsPropDirty("InputActions")) - { - MarkPropDirty("InputActions"); - this._inputActions = value; - this._inputActionsTemplateId = Guid.NewGuid().ToString(); - this.UpdateTemplate(this._inputActionsTemplateId, this._inputActions, typeof(IgbChatRenderContext)); - this.OnRefChanged("InputActions", null, "template:::" + this._inputActionsTemplateId, true, false, (string refName, object old, object newValue) => { - this._inputActionsRef = refName; - this.MarkPropDirty("InputActionsRef"); - }); - } - } - } - - - private string _inputActionsTemplateId; - private string _inputActionsScript; - - - ///Provides a means of setting InputActions in the JavaScript environment. - [Parameter] - public string InputActionsScript - { - get { return _inputActionsScript; } - - - set { - var oldValue = this._inputActionsScript; - if (oldValue != value || !IsPropDirty("InputActions")) - { - this._inputActionsScript = value; - MarkPropDirty("InputActions"); - this.OnRefChanged("InputActions", oldValue, value, true, false, (string refName, object old, object newValue) => { - this._inputActionsRef = refName; - this.MarkPropDirty("InputActionsRef"); - }); - } - } - } - private string _inputActionsEndRef; - private RenderFragment _inputActionsEnd; - - partial void OnInputActionsEndChanging(ref RenderFragment newValue); - /// - /// Custom renderer for the actions at the end of the input area. - /// - [Parameter] - public RenderFragment InputActionsEnd - { - get { return this._inputActionsEnd; } - - set { - var oldValue = this._inputActionsEnd; - OnInputActionsEndChanging(ref value); - if (oldValue != value || !IsPropDirty("InputActionsEnd")) - { - MarkPropDirty("InputActionsEnd"); - this._inputActionsEnd = value; - this._inputActionsEndTemplateId = Guid.NewGuid().ToString(); - this.UpdateTemplate(this._inputActionsEndTemplateId, this._inputActionsEnd, typeof(IgbChatRenderContext)); - this.OnRefChanged("InputActionsEnd", null, "template:::" + this._inputActionsEndTemplateId, true, false, (string refName, object old, object newValue) => { - this._inputActionsEndRef = refName; - this.MarkPropDirty("InputActionsEndRef"); - }); - } - } - } - - - private string _inputActionsEndTemplateId; - private string _inputActionsEndScript; - - - ///Provides a means of setting InputActionsEnd in the JavaScript environment. - [Parameter] - public string InputActionsEndScript - { - get { return _inputActionsEndScript; } - - - set { - var oldValue = this._inputActionsEndScript; - if (oldValue != value || !IsPropDirty("InputActionsEnd")) - { - this._inputActionsEndScript = value; - MarkPropDirty("InputActionsEnd"); - this.OnRefChanged("InputActionsEnd", oldValue, value, true, false, (string refName, object old, object newValue) => { - this._inputActionsEndRef = refName; - this.MarkPropDirty("InputActionsEndRef"); - }); - } - } - } - private string _inputActionsStartRef; - private RenderFragment _inputActionsStart; - - partial void OnInputActionsStartChanging(ref RenderFragment newValue); - /// - /// Custom renderer for the actions at the start of the input area. - /// - [Parameter] - public RenderFragment InputActionsStart - { - get { return this._inputActionsStart; } - - set { - var oldValue = this._inputActionsStart; - OnInputActionsStartChanging(ref value); - if (oldValue != value || !IsPropDirty("InputActionsStart")) - { - MarkPropDirty("InputActionsStart"); - this._inputActionsStart = value; - this._inputActionsStartTemplateId = Guid.NewGuid().ToString(); - this.UpdateTemplate(this._inputActionsStartTemplateId, this._inputActionsStart, typeof(IgbChatRenderContext)); - this.OnRefChanged("InputActionsStart", null, "template:::" + this._inputActionsStartTemplateId, true, false, (string refName, object old, object newValue) => { - this._inputActionsStartRef = refName; - this.MarkPropDirty("InputActionsStartRef"); - }); - } - } - } - - - private string _inputActionsStartTemplateId; - private string _inputActionsStartScript; - - - ///Provides a means of setting InputActionsStart in the JavaScript environment. - [Parameter] - public string InputActionsStartScript - { - get { return _inputActionsStartScript; } - - - set { - var oldValue = this._inputActionsStartScript; - if (oldValue != value || !IsPropDirty("InputActionsStart")) - { - this._inputActionsStartScript = value; - MarkPropDirty("InputActionsStart"); - this.OnRefChanged("InputActionsStart", oldValue, value, true, false, (string refName, object old, object newValue) => { - this._inputActionsStartRef = refName; - this.MarkPropDirty("InputActionsStartRef"); - }); - } - } - } - private string _messageRef; - private RenderFragment _message; - - partial void OnMessageChanging(ref RenderFragment newValue); - /// - /// Custom renderer for an entire chat message bubble. - /// - [Parameter] - public RenderFragment Message - { - get { return this._message; } - - set { - var oldValue = this._message; - OnMessageChanging(ref value); - if (oldValue != value || !IsPropDirty("Message")) - { - MarkPropDirty("Message"); - this._message = value; - this._messageTemplateId = Guid.NewGuid().ToString(); - this.UpdateTemplate(this._messageTemplateId, this._message, typeof(IgbChatMessageRenderContext)); - this.OnRefChanged("Message", null, "template:::" + this._messageTemplateId, true, false, (string refName, object old, object newValue) => { - this._messageRef = refName; - this.MarkPropDirty("MessageRef"); - }); - } - } - } - - - private string _messageTemplateId; - private string _messageScript; - - - ///Provides a means of setting Message in the JavaScript environment. - [Parameter] - public string MessageScript - { - get { return _messageScript; } - - - set { - var oldValue = this._messageScript; - if (oldValue != value || !IsPropDirty("Message")) - { - this._messageScript = value; - MarkPropDirty("Message"); - this.OnRefChanged("Message", oldValue, value, true, false, (string refName, object old, object newValue) => { - this._messageRef = refName; - this.MarkPropDirty("MessageRef"); - }); - } - } - } - private string _messageActionsRef; - private RenderFragment _messageActions; - - partial void OnMessageActionsChanging(ref RenderFragment newValue); - /// - /// Custom renderer for message-specific actions (e.g., reply or delete buttons). - /// - [Parameter] - public RenderFragment MessageActions - { - get { return this._messageActions; } - - set { - var oldValue = this._messageActions; - OnMessageActionsChanging(ref value); - if (oldValue != value || !IsPropDirty("MessageActions")) - { - MarkPropDirty("MessageActions"); - this._messageActions = value; - this._messageActionsTemplateId = Guid.NewGuid().ToString(); - this.UpdateTemplate(this._messageActionsTemplateId, this._messageActions, typeof(IgbChatMessageRenderContext)); - this.OnRefChanged("MessageActions", null, "template:::" + this._messageActionsTemplateId, true, false, (string refName, object old, object newValue) => { - this._messageActionsRef = refName; - this.MarkPropDirty("MessageActionsRef"); - }); - } - } - } - - - private string _messageActionsTemplateId; - private string _messageActionsScript; - - - ///Provides a means of setting MessageActions in the JavaScript environment. - [Parameter] - public string MessageActionsScript - { - get { return _messageActionsScript; } - - - set { - var oldValue = this._messageActionsScript; - if (oldValue != value || !IsPropDirty("MessageActions")) - { - this._messageActionsScript = value; - MarkPropDirty("MessageActions"); - this.OnRefChanged("MessageActions", oldValue, value, true, false, (string refName, object old, object newValue) => { - this._messageActionsRef = refName; - this.MarkPropDirty("MessageActionsRef"); - }); - } - } - } - private string _messageAttachmentsRef; - private RenderFragment _messageAttachments; - - partial void OnMessageAttachmentsChanging(ref RenderFragment newValue); - /// - /// Custom renderer for the attachments associated with a message. - /// - [Parameter] - public RenderFragment MessageAttachments - { - get { return this._messageAttachments; } - - set { - var oldValue = this._messageAttachments; - OnMessageAttachmentsChanging(ref value); - if (oldValue != value || !IsPropDirty("MessageAttachments")) - { - MarkPropDirty("MessageAttachments"); - this._messageAttachments = value; - this._messageAttachmentsTemplateId = Guid.NewGuid().ToString(); - this.UpdateTemplate(this._messageAttachmentsTemplateId, this._messageAttachments, typeof(IgbChatMessageRenderContext)); - this.OnRefChanged("MessageAttachments", null, "template:::" + this._messageAttachmentsTemplateId, true, false, (string refName, object old, object newValue) => { - this._messageAttachmentsRef = refName; - this.MarkPropDirty("MessageAttachmentsRef"); - }); - } - } - } - - - private string _messageAttachmentsTemplateId; - private string _messageAttachmentsScript; - - - ///Provides a means of setting MessageAttachments in the JavaScript environment. - [Parameter] - public string MessageAttachmentsScript - { - get { return _messageAttachmentsScript; } - - - set { - var oldValue = this._messageAttachmentsScript; - if (oldValue != value || !IsPropDirty("MessageAttachments")) - { - this._messageAttachmentsScript = value; - MarkPropDirty("MessageAttachments"); - this.OnRefChanged("MessageAttachments", oldValue, value, true, false, (string refName, object old, object newValue) => { - this._messageAttachmentsRef = refName; - this.MarkPropDirty("MessageAttachmentsRef"); - }); - } - } - } - private string _messageContentRef; - private RenderFragment _messageContent; - - partial void OnMessageContentChanging(ref RenderFragment newValue); - /// - /// Custom renderer for the main text and content of a message. - /// - [Parameter] - public RenderFragment MessageContent - { - get { return this._messageContent; } - - set { - var oldValue = this._messageContent; - OnMessageContentChanging(ref value); - if (oldValue != value || !IsPropDirty("MessageContent")) - { - MarkPropDirty("MessageContent"); - this._messageContent = value; - this._messageContentTemplateId = Guid.NewGuid().ToString(); - this.UpdateTemplate(this._messageContentTemplateId, this._messageContent, typeof(IgbChatMessageRenderContext)); - this.OnRefChanged("MessageContent", null, "template:::" + this._messageContentTemplateId, true, false, (string refName, object old, object newValue) => { - this._messageContentRef = refName; - this.MarkPropDirty("MessageContentRef"); - }); - } - } - } - - - private string _messageContentTemplateId; - private string _messageContentScript; - - - ///Provides a means of setting MessageContent in the JavaScript environment. - [Parameter] - public string MessageContentScript - { - get { return _messageContentScript; } - - - set { - var oldValue = this._messageContentScript; - if (oldValue != value || !IsPropDirty("MessageContent")) - { - this._messageContentScript = value; - MarkPropDirty("MessageContent"); - this.OnRefChanged("MessageContent", oldValue, value, true, false, (string refName, object old, object newValue) => { - this._messageContentRef = refName; - this.MarkPropDirty("MessageContentRef"); - }); - } - } - } - private string _messageHeaderRef; - private RenderFragment _messageHeader; - - partial void OnMessageHeaderChanging(ref RenderFragment newValue); - /// - /// Custom renderer for the header of a message, including sender and timestamp. - /// - [Parameter] - public RenderFragment MessageHeader - { - get { return this._messageHeader; } - - set { - var oldValue = this._messageHeader; - OnMessageHeaderChanging(ref value); - if (oldValue != value || !IsPropDirty("MessageHeader")) - { - MarkPropDirty("MessageHeader"); - this._messageHeader = value; - this._messageHeaderTemplateId = Guid.NewGuid().ToString(); - this.UpdateTemplate(this._messageHeaderTemplateId, this._messageHeader, typeof(IgbChatMessageRenderContext)); - this.OnRefChanged("MessageHeader", null, "template:::" + this._messageHeaderTemplateId, true, false, (string refName, object old, object newValue) => { - this._messageHeaderRef = refName; - this.MarkPropDirty("MessageHeaderRef"); - }); - } - } - } - - - private string _messageHeaderTemplateId; - private string _messageHeaderScript; - - - ///Provides a means of setting MessageHeader in the JavaScript environment. - [Parameter] - public string MessageHeaderScript - { - get { return _messageHeaderScript; } - - - set { - var oldValue = this._messageHeaderScript; - if (oldValue != value || !IsPropDirty("MessageHeader")) - { - this._messageHeaderScript = value; - MarkPropDirty("MessageHeader"); - this.OnRefChanged("MessageHeader", oldValue, value, true, false, (string refName, object old, object newValue) => { - this._messageHeaderRef = refName; - this.MarkPropDirty("MessageHeaderRef"); - }); - } - } - } - private string _sendButtonRef; - private RenderFragment _sendButton; - - partial void OnSendButtonChanging(ref RenderFragment newValue); - /// - /// Custom renderer for the message send button. - /// - [Parameter] - public RenderFragment SendButton - { - get { return this._sendButton; } - - set { - var oldValue = this._sendButton; - OnSendButtonChanging(ref value); - if (oldValue != value || !IsPropDirty("SendButton")) - { - MarkPropDirty("SendButton"); - this._sendButton = value; - this._sendButtonTemplateId = Guid.NewGuid().ToString(); - this.UpdateTemplate(this._sendButtonTemplateId, this._sendButton, typeof(IgbChatRenderContext)); - this.OnRefChanged("SendButton", null, "template:::" + this._sendButtonTemplateId, true, false, (string refName, object old, object newValue) => { - this._sendButtonRef = refName; - this.MarkPropDirty("SendButtonRef"); - }); - } - } - } - - - private string _sendButtonTemplateId; - private string _sendButtonScript; - - - ///Provides a means of setting SendButton in the JavaScript environment. - [Parameter] - public string SendButtonScript - { - get { return _sendButtonScript; } - - - set { - var oldValue = this._sendButtonScript; - if (oldValue != value || !IsPropDirty("SendButton")) - { - this._sendButtonScript = value; - MarkPropDirty("SendButton"); - this.OnRefChanged("SendButton", oldValue, value, true, false, (string refName, object old, object newValue) => { - this._sendButtonRef = refName; - this.MarkPropDirty("SendButtonRef"); - }); - } - } - } - private string _suggestionPrefixRef; - private RenderFragment _suggestionPrefix; - - partial void OnSuggestionPrefixChanging(ref RenderFragment newValue); - /// - /// Custom renderer for the prefix text shown before suggestions. - /// - [Parameter] - public RenderFragment SuggestionPrefix - { - get { return this._suggestionPrefix; } - - set { - var oldValue = this._suggestionPrefix; - OnSuggestionPrefixChanging(ref value); - if (oldValue != value || !IsPropDirty("SuggestionPrefix")) - { - MarkPropDirty("SuggestionPrefix"); - this._suggestionPrefix = value; - this._suggestionPrefixTemplateId = Guid.NewGuid().ToString(); - this.UpdateTemplate(this._suggestionPrefixTemplateId, this._suggestionPrefix, typeof(IgbChatRenderContext)); - this.OnRefChanged("SuggestionPrefix", null, "template:::" + this._suggestionPrefixTemplateId, true, false, (string refName, object old, object newValue) => { - this._suggestionPrefixRef = refName; - this.MarkPropDirty("SuggestionPrefixRef"); - }); - } - } - } - - - private string _suggestionPrefixTemplateId; - private string _suggestionPrefixScript; - - - ///Provides a means of setting SuggestionPrefix in the JavaScript environment. - [Parameter] - public string SuggestionPrefixScript - { - get { return _suggestionPrefixScript; } - - - set { - var oldValue = this._suggestionPrefixScript; - if (oldValue != value || !IsPropDirty("SuggestionPrefix")) - { - this._suggestionPrefixScript = value; - MarkPropDirty("SuggestionPrefix"); - this.OnRefChanged("SuggestionPrefix", oldValue, value, true, false, (string refName, object old, object newValue) => { - this._suggestionPrefixRef = refName; - this.MarkPropDirty("SuggestionPrefixRef"); - }); - } - } - } - - partial void FindByNameChatRenderers(string name, ref object item); - public override object FindByName(string name) - { - - var baseResult = base.FindByName(name); - if (baseResult != null) - { - return baseResult; - } - - object item = null; - FindByNameChatRenderers(name, ref item); - if (item != null) - { - return item; - } - - return null; - } - - partial void SerializeCoreIgbChatRenderers(RendererSerializer ser); - - internal override void SerializeCore(RendererSerializer ser) - { - base.SerializeCore(ser); - - SerializeCoreIgbChatRenderers(ser); - - if (IsPropDirty("AttachmentRef")) { ser.AddStringProp("attachmentRef", this._attachmentRef); } - if (IsPropDirty("AttachmentContentRef")) { ser.AddStringProp("attachmentContentRef", this._attachmentContentRef); } - if (IsPropDirty("AttachmentHeaderRef")) { ser.AddStringProp("attachmentHeaderRef", this._attachmentHeaderRef); } - if (IsPropDirty("InputRef")) { ser.AddStringProp("inputRef", this._inputRef); } - if (IsPropDirty("InputActionsRef")) { ser.AddStringProp("inputActionsRef", this._inputActionsRef); } - if (IsPropDirty("InputActionsEndRef")) { ser.AddStringProp("inputActionsEndRef", this._inputActionsEndRef); } - if (IsPropDirty("InputActionsStartRef")) { ser.AddStringProp("inputActionsStartRef", this._inputActionsStartRef); } - if (IsPropDirty("MessageRef")) { ser.AddStringProp("messageRef", this._messageRef); } - if (IsPropDirty("MessageActionsRef")) { ser.AddStringProp("messageActionsRef", this._messageActionsRef); } - if (IsPropDirty("MessageAttachmentsRef")) { ser.AddStringProp("messageAttachmentsRef", this._messageAttachmentsRef); } - if (IsPropDirty("MessageContentRef")) { ser.AddStringProp("messageContentRef", this._messageContentRef); } - if (IsPropDirty("MessageHeaderRef")) { ser.AddStringProp("messageHeaderRef", this._messageHeaderRef); } - if (IsPropDirty("SendButtonRef")) { ser.AddStringProp("sendButtonRef", this._sendButtonRef); } - if (IsPropDirty("SuggestionPrefixRef")) { ser.AddStringProp("suggestionPrefixRef", this._suggestionPrefixRef); } - - } - -} + public partial class IgbChatRenderers : BaseRendererElement + { + public override string Type { get { return "WebChatRenderers"; } } + + public IgbChatRenderers() : base() + { + OnCreatedIgbChatRenderers(); + + } + + partial void OnCreatedIgbChatRenderers(); + + private string _attachmentRef; + private RenderFragment _attachment; + + partial void OnAttachmentChanging(ref RenderFragment newValue); + /// + /// Custom renderer for a single chat message attachment. + /// + [Parameter] + public RenderFragment Attachment + { + get { return this._attachment; } + + set + { + var oldValue = this._attachment; + OnAttachmentChanging(ref value); + if (oldValue != value || !IsPropDirty("Attachment")) + { + MarkPropDirty("Attachment"); + this._attachment = value; + this._attachmentTemplateId = Guid.NewGuid().ToString(); + this.UpdateTemplate(this._attachmentTemplateId, this._attachment, typeof(IgbChatAttachmentRenderContext)); + this.OnRefChanged("Attachment", null, "template:::" + this._attachmentTemplateId, true, false, (string refName, object old, object newValue) => + { + this._attachmentRef = refName; + this.MarkPropDirty("AttachmentRef"); + }); + } + } + } + + private string _attachmentTemplateId; + private string _attachmentScript; + + ///Provides a means of setting Attachment in the JavaScript environment. + [Parameter] + public string AttachmentScript + { + get { return _attachmentScript; } + + set + { + var oldValue = this._attachmentScript; + if (oldValue != value || !IsPropDirty("Attachment")) + { + this._attachmentScript = value; + MarkPropDirty("Attachment"); + this.OnRefChanged("Attachment", oldValue, value, true, false, (string refName, object old, object newValue) => + { + this._attachmentRef = refName; + this.MarkPropDirty("AttachmentRef"); + }); + } + } + } + private string _attachmentContentRef; + private RenderFragment _attachmentContent; + + partial void OnAttachmentContentChanging(ref RenderFragment newValue); + /// + /// Custom renderer for the content of an attachment. + /// + [Parameter] + public RenderFragment AttachmentContent + { + get { return this._attachmentContent; } + + set + { + var oldValue = this._attachmentContent; + OnAttachmentContentChanging(ref value); + if (oldValue != value || !IsPropDirty("AttachmentContent")) + { + MarkPropDirty("AttachmentContent"); + this._attachmentContent = value; + this._attachmentContentTemplateId = Guid.NewGuid().ToString(); + this.UpdateTemplate(this._attachmentContentTemplateId, this._attachmentContent, typeof(IgbChatAttachmentRenderContext)); + this.OnRefChanged("AttachmentContent", null, "template:::" + this._attachmentContentTemplateId, true, false, (string refName, object old, object newValue) => + { + this._attachmentContentRef = refName; + this.MarkPropDirty("AttachmentContentRef"); + }); + } + } + } + + private string _attachmentContentTemplateId; + private string _attachmentContentScript; + + ///Provides a means of setting AttachmentContent in the JavaScript environment. + [Parameter] + public string AttachmentContentScript + { + get { return _attachmentContentScript; } + + set + { + var oldValue = this._attachmentContentScript; + if (oldValue != value || !IsPropDirty("AttachmentContent")) + { + this._attachmentContentScript = value; + MarkPropDirty("AttachmentContent"); + this.OnRefChanged("AttachmentContent", oldValue, value, true, false, (string refName, object old, object newValue) => + { + this._attachmentContentRef = refName; + this.MarkPropDirty("AttachmentContentRef"); + }); + } + } + } + private string _attachmentHeaderRef; + private RenderFragment _attachmentHeader; + + partial void OnAttachmentHeaderChanging(ref RenderFragment newValue); + /// + /// Custom renderer for the header of an attachment. + /// + [Parameter] + public RenderFragment AttachmentHeader + { + get { return this._attachmentHeader; } + + set + { + var oldValue = this._attachmentHeader; + OnAttachmentHeaderChanging(ref value); + if (oldValue != value || !IsPropDirty("AttachmentHeader")) + { + MarkPropDirty("AttachmentHeader"); + this._attachmentHeader = value; + this._attachmentHeaderTemplateId = Guid.NewGuid().ToString(); + this.UpdateTemplate(this._attachmentHeaderTemplateId, this._attachmentHeader, typeof(IgbChatAttachmentRenderContext)); + this.OnRefChanged("AttachmentHeader", null, "template:::" + this._attachmentHeaderTemplateId, true, false, (string refName, object old, object newValue) => + { + this._attachmentHeaderRef = refName; + this.MarkPropDirty("AttachmentHeaderRef"); + }); + } + } + } + + private string _attachmentHeaderTemplateId; + private string _attachmentHeaderScript; + + ///Provides a means of setting AttachmentHeader in the JavaScript environment. + [Parameter] + public string AttachmentHeaderScript + { + get { return _attachmentHeaderScript; } + + set + { + var oldValue = this._attachmentHeaderScript; + if (oldValue != value || !IsPropDirty("AttachmentHeader")) + { + this._attachmentHeaderScript = value; + MarkPropDirty("AttachmentHeader"); + this.OnRefChanged("AttachmentHeader", oldValue, value, true, false, (string refName, object old, object newValue) => + { + this._attachmentHeaderRef = refName; + this.MarkPropDirty("AttachmentHeaderRef"); + }); + } + } + } + private string _inputRef; + private RenderFragment _input; + + partial void OnInputChanging(ref RenderFragment newValue); + /// + /// Custom renderer for the main chat input field. + /// + [Parameter] + public RenderFragment Input + { + get { return this._input; } + + set + { + var oldValue = this._input; + OnInputChanging(ref value); + if (oldValue != value || !IsPropDirty("Input")) + { + MarkPropDirty("Input"); + this._input = value; + this._inputTemplateId = Guid.NewGuid().ToString(); + this.UpdateTemplate(this._inputTemplateId, this._input, typeof(IgbChatInputRenderContext)); + this.OnRefChanged("Input", null, "template:::" + this._inputTemplateId, true, false, (string refName, object old, object newValue) => + { + this._inputRef = refName; + this.MarkPropDirty("InputRef"); + }); + } + } + } + + private string _inputTemplateId; + private string _inputScript; + + ///Provides a means of setting Input in the JavaScript environment. + [Parameter] + public string InputScript + { + get { return _inputScript; } + + set + { + var oldValue = this._inputScript; + if (oldValue != value || !IsPropDirty("Input")) + { + this._inputScript = value; + MarkPropDirty("Input"); + this.OnRefChanged("Input", oldValue, value, true, false, (string refName, object old, object newValue) => + { + this._inputRef = refName; + this.MarkPropDirty("InputRef"); + }); + } + } + } + private string _inputActionsRef; + private RenderFragment _inputActions; + + partial void OnInputActionsChanging(ref RenderFragment newValue); + /// + /// Custom renderer for the actions container within the input area. + /// + [Parameter] + public RenderFragment InputActions + { + get { return this._inputActions; } + + set + { + var oldValue = this._inputActions; + OnInputActionsChanging(ref value); + if (oldValue != value || !IsPropDirty("InputActions")) + { + MarkPropDirty("InputActions"); + this._inputActions = value; + this._inputActionsTemplateId = Guid.NewGuid().ToString(); + this.UpdateTemplate(this._inputActionsTemplateId, this._inputActions, typeof(IgbChatRenderContext)); + this.OnRefChanged("InputActions", null, "template:::" + this._inputActionsTemplateId, true, false, (string refName, object old, object newValue) => + { + this._inputActionsRef = refName; + this.MarkPropDirty("InputActionsRef"); + }); + } + } + } + + private string _inputActionsTemplateId; + private string _inputActionsScript; + + ///Provides a means of setting InputActions in the JavaScript environment. + [Parameter] + public string InputActionsScript + { + get { return _inputActionsScript; } + + set + { + var oldValue = this._inputActionsScript; + if (oldValue != value || !IsPropDirty("InputActions")) + { + this._inputActionsScript = value; + MarkPropDirty("InputActions"); + this.OnRefChanged("InputActions", oldValue, value, true, false, (string refName, object old, object newValue) => + { + this._inputActionsRef = refName; + this.MarkPropDirty("InputActionsRef"); + }); + } + } + } + private string _inputActionsEndRef; + private RenderFragment _inputActionsEnd; + + partial void OnInputActionsEndChanging(ref RenderFragment newValue); + /// + /// Custom renderer for the actions at the end of the input area. + /// + [Parameter] + public RenderFragment InputActionsEnd + { + get { return this._inputActionsEnd; } + + set + { + var oldValue = this._inputActionsEnd; + OnInputActionsEndChanging(ref value); + if (oldValue != value || !IsPropDirty("InputActionsEnd")) + { + MarkPropDirty("InputActionsEnd"); + this._inputActionsEnd = value; + this._inputActionsEndTemplateId = Guid.NewGuid().ToString(); + this.UpdateTemplate(this._inputActionsEndTemplateId, this._inputActionsEnd, typeof(IgbChatRenderContext)); + this.OnRefChanged("InputActionsEnd", null, "template:::" + this._inputActionsEndTemplateId, true, false, (string refName, object old, object newValue) => + { + this._inputActionsEndRef = refName; + this.MarkPropDirty("InputActionsEndRef"); + }); + } + } + } + + private string _inputActionsEndTemplateId; + private string _inputActionsEndScript; + + ///Provides a means of setting InputActionsEnd in the JavaScript environment. + [Parameter] + public string InputActionsEndScript + { + get { return _inputActionsEndScript; } + + set + { + var oldValue = this._inputActionsEndScript; + if (oldValue != value || !IsPropDirty("InputActionsEnd")) + { + this._inputActionsEndScript = value; + MarkPropDirty("InputActionsEnd"); + this.OnRefChanged("InputActionsEnd", oldValue, value, true, false, (string refName, object old, object newValue) => + { + this._inputActionsEndRef = refName; + this.MarkPropDirty("InputActionsEndRef"); + }); + } + } + } + private string _inputActionsStartRef; + private RenderFragment _inputActionsStart; + + partial void OnInputActionsStartChanging(ref RenderFragment newValue); + /// + /// Custom renderer for the actions at the start of the input area. + /// + [Parameter] + public RenderFragment InputActionsStart + { + get { return this._inputActionsStart; } + + set + { + var oldValue = this._inputActionsStart; + OnInputActionsStartChanging(ref value); + if (oldValue != value || !IsPropDirty("InputActionsStart")) + { + MarkPropDirty("InputActionsStart"); + this._inputActionsStart = value; + this._inputActionsStartTemplateId = Guid.NewGuid().ToString(); + this.UpdateTemplate(this._inputActionsStartTemplateId, this._inputActionsStart, typeof(IgbChatRenderContext)); + this.OnRefChanged("InputActionsStart", null, "template:::" + this._inputActionsStartTemplateId, true, false, (string refName, object old, object newValue) => + { + this._inputActionsStartRef = refName; + this.MarkPropDirty("InputActionsStartRef"); + }); + } + } + } + + private string _inputActionsStartTemplateId; + private string _inputActionsStartScript; + + ///Provides a means of setting InputActionsStart in the JavaScript environment. + [Parameter] + public string InputActionsStartScript + { + get { return _inputActionsStartScript; } + + set + { + var oldValue = this._inputActionsStartScript; + if (oldValue != value || !IsPropDirty("InputActionsStart")) + { + this._inputActionsStartScript = value; + MarkPropDirty("InputActionsStart"); + this.OnRefChanged("InputActionsStart", oldValue, value, true, false, (string refName, object old, object newValue) => + { + this._inputActionsStartRef = refName; + this.MarkPropDirty("InputActionsStartRef"); + }); + } + } + } + private string _messageRef; + private RenderFragment _message; + + partial void OnMessageChanging(ref RenderFragment newValue); + /// + /// Custom renderer for an entire chat message bubble. + /// + [Parameter] + public RenderFragment Message + { + get { return this._message; } + + set + { + var oldValue = this._message; + OnMessageChanging(ref value); + if (oldValue != value || !IsPropDirty("Message")) + { + MarkPropDirty("Message"); + this._message = value; + this._messageTemplateId = Guid.NewGuid().ToString(); + this.UpdateTemplate(this._messageTemplateId, this._message, typeof(IgbChatMessageRenderContext)); + this.OnRefChanged("Message", null, "template:::" + this._messageTemplateId, true, false, (string refName, object old, object newValue) => + { + this._messageRef = refName; + this.MarkPropDirty("MessageRef"); + }); + } + } + } + + private string _messageTemplateId; + private string _messageScript; + + ///Provides a means of setting Message in the JavaScript environment. + [Parameter] + public string MessageScript + { + get { return _messageScript; } + + set + { + var oldValue = this._messageScript; + if (oldValue != value || !IsPropDirty("Message")) + { + this._messageScript = value; + MarkPropDirty("Message"); + this.OnRefChanged("Message", oldValue, value, true, false, (string refName, object old, object newValue) => + { + this._messageRef = refName; + this.MarkPropDirty("MessageRef"); + }); + } + } + } + private string _messageActionsRef; + private RenderFragment _messageActions; + + partial void OnMessageActionsChanging(ref RenderFragment newValue); + /// + /// Custom renderer for message-specific actions (e.g., reply or delete buttons). + /// + [Parameter] + public RenderFragment MessageActions + { + get { return this._messageActions; } + + set + { + var oldValue = this._messageActions; + OnMessageActionsChanging(ref value); + if (oldValue != value || !IsPropDirty("MessageActions")) + { + MarkPropDirty("MessageActions"); + this._messageActions = value; + this._messageActionsTemplateId = Guid.NewGuid().ToString(); + this.UpdateTemplate(this._messageActionsTemplateId, this._messageActions, typeof(IgbChatMessageRenderContext)); + this.OnRefChanged("MessageActions", null, "template:::" + this._messageActionsTemplateId, true, false, (string refName, object old, object newValue) => + { + this._messageActionsRef = refName; + this.MarkPropDirty("MessageActionsRef"); + }); + } + } + } + + private string _messageActionsTemplateId; + private string _messageActionsScript; + + ///Provides a means of setting MessageActions in the JavaScript environment. + [Parameter] + public string MessageActionsScript + { + get { return _messageActionsScript; } + + set + { + var oldValue = this._messageActionsScript; + if (oldValue != value || !IsPropDirty("MessageActions")) + { + this._messageActionsScript = value; + MarkPropDirty("MessageActions"); + this.OnRefChanged("MessageActions", oldValue, value, true, false, (string refName, object old, object newValue) => + { + this._messageActionsRef = refName; + this.MarkPropDirty("MessageActionsRef"); + }); + } + } + } + private string _messageAttachmentsRef; + private RenderFragment _messageAttachments; + + partial void OnMessageAttachmentsChanging(ref RenderFragment newValue); + /// + /// Custom renderer for the attachments associated with a message. + /// + [Parameter] + public RenderFragment MessageAttachments + { + get { return this._messageAttachments; } + + set + { + var oldValue = this._messageAttachments; + OnMessageAttachmentsChanging(ref value); + if (oldValue != value || !IsPropDirty("MessageAttachments")) + { + MarkPropDirty("MessageAttachments"); + this._messageAttachments = value; + this._messageAttachmentsTemplateId = Guid.NewGuid().ToString(); + this.UpdateTemplate(this._messageAttachmentsTemplateId, this._messageAttachments, typeof(IgbChatMessageRenderContext)); + this.OnRefChanged("MessageAttachments", null, "template:::" + this._messageAttachmentsTemplateId, true, false, (string refName, object old, object newValue) => + { + this._messageAttachmentsRef = refName; + this.MarkPropDirty("MessageAttachmentsRef"); + }); + } + } + } + + private string _messageAttachmentsTemplateId; + private string _messageAttachmentsScript; + + ///Provides a means of setting MessageAttachments in the JavaScript environment. + [Parameter] + public string MessageAttachmentsScript + { + get { return _messageAttachmentsScript; } + + set + { + var oldValue = this._messageAttachmentsScript; + if (oldValue != value || !IsPropDirty("MessageAttachments")) + { + this._messageAttachmentsScript = value; + MarkPropDirty("MessageAttachments"); + this.OnRefChanged("MessageAttachments", oldValue, value, true, false, (string refName, object old, object newValue) => + { + this._messageAttachmentsRef = refName; + this.MarkPropDirty("MessageAttachmentsRef"); + }); + } + } + } + private string _messageContentRef; + private RenderFragment _messageContent; + + partial void OnMessageContentChanging(ref RenderFragment newValue); + /// + /// Custom renderer for the main text and content of a message. + /// + [Parameter] + public RenderFragment MessageContent + { + get { return this._messageContent; } + + set + { + var oldValue = this._messageContent; + OnMessageContentChanging(ref value); + if (oldValue != value || !IsPropDirty("MessageContent")) + { + MarkPropDirty("MessageContent"); + this._messageContent = value; + this._messageContentTemplateId = Guid.NewGuid().ToString(); + this.UpdateTemplate(this._messageContentTemplateId, this._messageContent, typeof(IgbChatMessageRenderContext)); + this.OnRefChanged("MessageContent", null, "template:::" + this._messageContentTemplateId, true, false, (string refName, object old, object newValue) => + { + this._messageContentRef = refName; + this.MarkPropDirty("MessageContentRef"); + }); + } + } + } + + private string _messageContentTemplateId; + private string _messageContentScript; + + ///Provides a means of setting MessageContent in the JavaScript environment. + [Parameter] + public string MessageContentScript + { + get { return _messageContentScript; } + + set + { + var oldValue = this._messageContentScript; + if (oldValue != value || !IsPropDirty("MessageContent")) + { + this._messageContentScript = value; + MarkPropDirty("MessageContent"); + this.OnRefChanged("MessageContent", oldValue, value, true, false, (string refName, object old, object newValue) => + { + this._messageContentRef = refName; + this.MarkPropDirty("MessageContentRef"); + }); + } + } + } + private string _messageHeaderRef; + private RenderFragment _messageHeader; + + partial void OnMessageHeaderChanging(ref RenderFragment newValue); + /// + /// Custom renderer for the header of a message, including sender and timestamp. + /// + [Parameter] + public RenderFragment MessageHeader + { + get { return this._messageHeader; } + + set + { + var oldValue = this._messageHeader; + OnMessageHeaderChanging(ref value); + if (oldValue != value || !IsPropDirty("MessageHeader")) + { + MarkPropDirty("MessageHeader"); + this._messageHeader = value; + this._messageHeaderTemplateId = Guid.NewGuid().ToString(); + this.UpdateTemplate(this._messageHeaderTemplateId, this._messageHeader, typeof(IgbChatMessageRenderContext)); + this.OnRefChanged("MessageHeader", null, "template:::" + this._messageHeaderTemplateId, true, false, (string refName, object old, object newValue) => + { + this._messageHeaderRef = refName; + this.MarkPropDirty("MessageHeaderRef"); + }); + } + } + } + + private string _messageHeaderTemplateId; + private string _messageHeaderScript; + + ///Provides a means of setting MessageHeader in the JavaScript environment. + [Parameter] + public string MessageHeaderScript + { + get { return _messageHeaderScript; } + + set + { + var oldValue = this._messageHeaderScript; + if (oldValue != value || !IsPropDirty("MessageHeader")) + { + this._messageHeaderScript = value; + MarkPropDirty("MessageHeader"); + this.OnRefChanged("MessageHeader", oldValue, value, true, false, (string refName, object old, object newValue) => + { + this._messageHeaderRef = refName; + this.MarkPropDirty("MessageHeaderRef"); + }); + } + } + } + private string _sendButtonRef; + private RenderFragment _sendButton; + + partial void OnSendButtonChanging(ref RenderFragment newValue); + /// + /// Custom renderer for the message send button. + /// + [Parameter] + public RenderFragment SendButton + { + get { return this._sendButton; } + + set + { + var oldValue = this._sendButton; + OnSendButtonChanging(ref value); + if (oldValue != value || !IsPropDirty("SendButton")) + { + MarkPropDirty("SendButton"); + this._sendButton = value; + this._sendButtonTemplateId = Guid.NewGuid().ToString(); + this.UpdateTemplate(this._sendButtonTemplateId, this._sendButton, typeof(IgbChatRenderContext)); + this.OnRefChanged("SendButton", null, "template:::" + this._sendButtonTemplateId, true, false, (string refName, object old, object newValue) => + { + this._sendButtonRef = refName; + this.MarkPropDirty("SendButtonRef"); + }); + } + } + } + + private string _sendButtonTemplateId; + private string _sendButtonScript; + + ///Provides a means of setting SendButton in the JavaScript environment. + [Parameter] + public string SendButtonScript + { + get { return _sendButtonScript; } + + set + { + var oldValue = this._sendButtonScript; + if (oldValue != value || !IsPropDirty("SendButton")) + { + this._sendButtonScript = value; + MarkPropDirty("SendButton"); + this.OnRefChanged("SendButton", oldValue, value, true, false, (string refName, object old, object newValue) => + { + this._sendButtonRef = refName; + this.MarkPropDirty("SendButtonRef"); + }); + } + } + } + private string _suggestionPrefixRef; + private RenderFragment _suggestionPrefix; + + partial void OnSuggestionPrefixChanging(ref RenderFragment newValue); + /// + /// Custom renderer for the prefix text shown before suggestions. + /// + [Parameter] + public RenderFragment SuggestionPrefix + { + get { return this._suggestionPrefix; } + + set + { + var oldValue = this._suggestionPrefix; + OnSuggestionPrefixChanging(ref value); + if (oldValue != value || !IsPropDirty("SuggestionPrefix")) + { + MarkPropDirty("SuggestionPrefix"); + this._suggestionPrefix = value; + this._suggestionPrefixTemplateId = Guid.NewGuid().ToString(); + this.UpdateTemplate(this._suggestionPrefixTemplateId, this._suggestionPrefix, typeof(IgbChatRenderContext)); + this.OnRefChanged("SuggestionPrefix", null, "template:::" + this._suggestionPrefixTemplateId, true, false, (string refName, object old, object newValue) => + { + this._suggestionPrefixRef = refName; + this.MarkPropDirty("SuggestionPrefixRef"); + }); + } + } + } + + private string _suggestionPrefixTemplateId; + private string _suggestionPrefixScript; + + ///Provides a means of setting SuggestionPrefix in the JavaScript environment. + [Parameter] + public string SuggestionPrefixScript + { + get { return _suggestionPrefixScript; } + + set + { + var oldValue = this._suggestionPrefixScript; + if (oldValue != value || !IsPropDirty("SuggestionPrefix")) + { + this._suggestionPrefixScript = value; + MarkPropDirty("SuggestionPrefix"); + this.OnRefChanged("SuggestionPrefix", oldValue, value, true, false, (string refName, object old, object newValue) => + { + this._suggestionPrefixRef = refName; + this.MarkPropDirty("SuggestionPrefixRef"); + }); + } + } + } + + partial void FindByNameChatRenderers(string name, ref object item); + public override object FindByName(string name) + { + + var baseResult = base.FindByName(name); + if (baseResult != null) + { + return baseResult; + } + + object item = null; + FindByNameChatRenderers(name, ref item); + if (item != null) + { + return item; + } + + return null; + } + + partial void SerializeCoreIgbChatRenderers(RendererSerializer ser); + + internal override void SerializeCore(RendererSerializer ser) + { + base.SerializeCore(ser); + + SerializeCoreIgbChatRenderers(ser); + + if (IsPropDirty("AttachmentRef")) + { ser.AddStringProp("attachmentRef", this._attachmentRef); } + if (IsPropDirty("AttachmentContentRef")) + { ser.AddStringProp("attachmentContentRef", this._attachmentContentRef); } + if (IsPropDirty("AttachmentHeaderRef")) + { ser.AddStringProp("attachmentHeaderRef", this._attachmentHeaderRef); } + if (IsPropDirty("InputRef")) + { ser.AddStringProp("inputRef", this._inputRef); } + if (IsPropDirty("InputActionsRef")) + { ser.AddStringProp("inputActionsRef", this._inputActionsRef); } + if (IsPropDirty("InputActionsEndRef")) + { ser.AddStringProp("inputActionsEndRef", this._inputActionsEndRef); } + if (IsPropDirty("InputActionsStartRef")) + { ser.AddStringProp("inputActionsStartRef", this._inputActionsStartRef); } + if (IsPropDirty("MessageRef")) + { ser.AddStringProp("messageRef", this._messageRef); } + if (IsPropDirty("MessageActionsRef")) + { ser.AddStringProp("messageActionsRef", this._messageActionsRef); } + if (IsPropDirty("MessageAttachmentsRef")) + { ser.AddStringProp("messageAttachmentsRef", this._messageAttachmentsRef); } + if (IsPropDirty("MessageContentRef")) + { ser.AddStringProp("messageContentRef", this._messageContentRef); } + if (IsPropDirty("MessageHeaderRef")) + { ser.AddStringProp("messageHeaderRef", this._messageHeaderRef); } + if (IsPropDirty("SendButtonRef")) + { ser.AddStringProp("sendButtonRef", this._sendButtonRef); } + if (IsPropDirty("SuggestionPrefixRef")) + { ser.AddStringProp("suggestionPrefixRef", this._suggestionPrefixRef); } + + } + + } } diff --git a/src/components/Blazor/ChatSuggestionsPosition.cs b/src/components/Blazor/ChatSuggestionsPosition.cs index 909918b1..da23474a 100644 --- a/src/components/Blazor/ChatSuggestionsPosition.cs +++ b/src/components/Blazor/ChatSuggestionsPosition.cs @@ -1,10 +1,11 @@ namespace IgniteUI.Blazor.Controls { -public enum ChatSuggestionsPosition { - [WCEnumName("below-input")] - BelowInput, - [WCEnumName("below-messages")] - BelowMessages + public enum ChatSuggestionsPosition + { + [WCEnumName("below-input")] + BelowInput, + [WCEnumName("below-messages")] + BelowMessages -} + } } diff --git a/src/components/Blazor/Checkbox.cs b/src/components/Blazor/Checkbox.cs index 505aafd2..c7ccf59d 100644 --- a/src/components/Blazor/Checkbox.cs +++ b/src/components/Blazor/Checkbox.cs @@ -1,114 +1,112 @@ - -using System; using Microsoft.AspNetCore.Components; -using Microsoft.AspNetCore.Components.Rendering; -using System.Threading.Tasks; -using System.Collections.Generic; -using System.Linq; namespace IgniteUI.Blazor.Controls { - /// -/// A check box allowing single values to be selected/deselected. -/// -public partial class IgbCheckbox: IgbCheckboxBase { - public override string Type { get { return "WebCheckbox"; } } - - protected override void EnsureModulesLoaded() - { - if (!IgbCheckboxModule.IsLoadRequested(IgBlazor)) - { - IgbCheckboxModule.Register(IgBlazor); - } - } - - protected override string ResolveDisplay() - { - return "inline-block"; - } - - protected override bool SupportsVisualChildren - { - get - { - return true; - } - } - - protected override bool UseDirectRender - { - get - { - return true; - } - } - - protected override string DirectRenderElementName - { - get - { - return "igc-checkbox"; - } - } - - public IgbCheckbox(): base() { - OnCreatedIgbCheckbox(); - - - } - - partial void OnCreatedIgbCheckbox(); - - private bool _indeterminate = false; - - partial void OnIndeterminateChanging(ref bool newValue); - /// - /// Draws the checkbox in indeterminate state. - /// - [Parameter] - public bool Indeterminate - { - get { return this._indeterminate; } - set { - if (this._indeterminate != value || !IsPropDirty("Indeterminate")) { - MarkPropDirty("Indeterminate"); - } - this._indeterminate = value; - - } - } - - partial void FindByNameCheckbox(string name, ref object item); - public override object FindByName(string name) - { - - var baseResult = base.FindByName(name); - if (baseResult != null) - { - return baseResult; - } - - object item = null; - FindByNameCheckbox(name, ref item); - if (item != null) - { - return item; - } - - return null; - } - - partial void SerializeCoreIgbCheckbox(RendererSerializer ser); - - internal override void SerializeCore(RendererSerializer ser) - { - base.SerializeCore(ser); - - SerializeCoreIgbCheckbox(ser); - - if (IsPropDirty("Indeterminate")) { ser.AddBooleanProp("indeterminate", this._indeterminate); } - - } - -} + /// + /// A check box allowing single values to be selected/deselected. + /// + public partial class IgbCheckbox : IgbCheckboxBase + { + public override string Type { get { return "WebCheckbox"; } } + + protected override void EnsureModulesLoaded() + { + if (!IgbCheckboxModule.IsLoadRequested(IgBlazor)) + { + IgbCheckboxModule.Register(IgBlazor); + } + } + + protected override string ResolveDisplay() + { + return "inline-block"; + } + + protected override bool SupportsVisualChildren + { + get + { + return true; + } + } + + protected override bool UseDirectRender + { + get + { + return true; + } + } + + protected override string DirectRenderElementName + { + get + { + return "igc-checkbox"; + } + } + + public IgbCheckbox() : base() + { + OnCreatedIgbCheckbox(); + + } + + partial void OnCreatedIgbCheckbox(); + + private bool _indeterminate = false; + + partial void OnIndeterminateChanging(ref bool newValue); + /// + /// Draws the checkbox in indeterminate state. + /// + [Parameter] + public bool Indeterminate + { + get { return this._indeterminate; } + set + { + if (this._indeterminate != value || !IsPropDirty("Indeterminate")) + { + MarkPropDirty("Indeterminate"); + } + this._indeterminate = value; + + } + } + + partial void FindByNameCheckbox(string name, ref object item); + public override object FindByName(string name) + { + + var baseResult = base.FindByName(name); + if (baseResult != null) + { + return baseResult; + } + + object item = null; + FindByNameCheckbox(name, ref item); + if (item != null) + { + return item; + } + + return null; + } + + partial void SerializeCoreIgbCheckbox(RendererSerializer ser); + + internal override void SerializeCore(RendererSerializer ser) + { + base.SerializeCore(ser); + + SerializeCoreIgbCheckbox(ser); + + if (IsPropDirty("Indeterminate")) + { ser.AddBooleanProp("indeterminate", this._indeterminate); } + + } + + } } diff --git a/src/components/Blazor/CheckboxBase.cs b/src/components/Blazor/CheckboxBase.cs index ae8c539f..ce6a5144 100644 --- a/src/components/Blazor/CheckboxBase.cs +++ b/src/components/Blazor/CheckboxBase.cs @@ -1,548 +1,581 @@ - -using System; using Microsoft.AspNetCore.Components; -using Microsoft.AspNetCore.Components.Rendering; -using System.Threading.Tasks; -using System.Collections.Generic; -using System.Linq; namespace IgniteUI.Blazor.Controls { - public partial class IgbCheckboxBase: BaseRendererControl { - public override string Type { get { return "WebCheckboxBase"; } } + public partial class IgbCheckboxBase : BaseRendererControl + { + public override string Type { get { return "WebCheckboxBase"; } } - protected override void EnsureModulesLoaded() - { - if (!IgbCheckboxBaseModule.IsLoadRequested(IgBlazor)) - { - IgbCheckboxBaseModule.Register(IgBlazor); - } - } + protected override void EnsureModulesLoaded() + { + if (!IgbCheckboxBaseModule.IsLoadRequested(IgBlazor)) + { + IgbCheckboxBaseModule.Register(IgBlazor); + } + } - protected override string ResolveDisplay() - { - return "inline-block"; - } + protected override string ResolveDisplay() + { + return "inline-block"; + } - protected override bool SupportsVisualChildren - { - get - { - return true; - } - } + protected override bool SupportsVisualChildren + { + get + { + return true; + } + } + + protected override bool UseDirectRender + { + get + { + return true; + } + } + + protected override string DirectRenderElementName + { + get + { + return "igc-checkbox-base"; + } + } + + protected override ControlEventBehavior DefaultEventBehavior + { + get { return ControlEventBehavior.Immediate; } + } + + public IgbCheckboxBase() : base() + { + OnCreatedIgbCheckboxBase(); + + } + + partial void OnCreatedIgbCheckboxBase(); + + private string _value; + + partial void OnValueChanging(ref string newValue); + /// + /// The value attribute of the control. + /// + [Parameter] + public string Value + { + get { return this._value; } + set + { + if (this._value != value || !IsPropDirty("Value")) + { + MarkPropDirty("Value"); + } + this._value = value; + + } + } + private bool _checked = false; + + partial void OnCheckedChanging(ref bool newValue); + /// + /// The checked state of the control. + /// + [Parameter] + public bool Checked + { + get { return this._checked; } + set + { + if (this._checked != value || !IsPropDirty("Checked")) + { + MarkPropDirty("Checked"); + } + this._checked = value; + + } + } + public async Task GetCurrentCheckedAsync() + { + var iv = await InvokeMethod("p:Checked", new object[] { }, new string[] { }); + return ReturnToBoolean(iv); + } + public bool GetCurrentChecked() + { + var iv = InvokeMethodSync("p:Checked", new object[] { }, new string[] { }); + return ReturnToBoolean(iv); + } + private ToggleLabelPosition _labelPosition = ToggleLabelPosition.After; + + partial void OnLabelPositionChanging(ref ToggleLabelPosition newValue); + /// + /// The label position of the control. + /// + [Parameter] + public ToggleLabelPosition LabelPosition + { + get { return this._labelPosition; } + set + { + if (this._labelPosition != value || !IsPropDirty("LabelPosition")) + { + MarkPropDirty("LabelPosition"); + } + this._labelPosition = value; + + } + } + private bool _disabled = false; + + partial void OnDisabledChanging(ref bool newValue); + /// + /// The disabled state of the component + /// + [Parameter] + public bool Disabled + { + get { return this._disabled; } + set + { + if (this._disabled != value || !IsPropDirty("Disabled")) + { + MarkPropDirty("Disabled"); + } + this._disabled = value; + + } + } + private bool _required = false; + + partial void OnRequiredChanging(ref bool newValue); + /// + /// Makes the control a required field in a form context. + /// + [Parameter] + public bool Required + { + get { return this._required; } + set + { + if (this._required != value || !IsPropDirty("Required")) + { + MarkPropDirty("Required"); + } + this._required = value; + + } + } + private bool _invalid = false; + + partial void OnInvalidChanging(ref bool newValue); + /// + /// Control the validity of the control. + /// + [Parameter] + public bool Invalid + { + get { return this._invalid; } + set + { + if (this._invalid != value || !IsPropDirty("Invalid")) + { + MarkPropDirty("Invalid"); + } + this._invalid = value; + + } + } + + partial void FindByNameCheckboxBase(string name, ref object item); + public override object FindByName(string name) + { + + var baseResult = base.FindByName(name); + if (baseResult != null) + { + return baseResult; + } + + object item = null; + FindByNameCheckboxBase(name, ref item); + if (item != null) + { + return item; + } + + return null; + } + public async Task SetNativeElementAsync(Object element) + { + await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + } + public void SetNativeElement(Object element) + { + InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + } + /// + /// Simulates a click on the control. + /// + public async Task ClickAsync() + { + await InvokeMethod("click", new object[] { }, new string[] { }); + } + public void Click() + { + InvokeMethodSync("click", new object[] { }, new string[] { }); + } + /// + /// Sets focus on the control. + /// + + [WCWidgetMemberName("Focus")] + public async Task FocusComponentAsync(IgbFocusOptions options) + { + await InvokeMethod("focus", new object[] { ObjectToParam(options) }, new string[] { "Json" }); + } + + [WCWidgetMemberName("Focus")] + public void FocusComponent(IgbFocusOptions options) + { + InvokeMethodSync("focus", new object[] { ObjectToParam(options) }, new string[] { "Json" }); + } + /// + /// Removes focus from the control. + /// + + [WCWidgetMemberName("Blur")] + public async Task BlurComponentAsync() + { + await InvokeMethod("blur", new object[] { }, new string[] { }); + } + + [WCWidgetMemberName("Blur")] + public void BlurComponent() + { + InvokeMethodSync("blur", new object[] { }, new string[] { }); + } + /// + /// Checks for validity of the control and shows the browser message if it invalid. + /// + public async Task ReportValidityAsync() + { + await InvokeMethod("reportValidity", new object[] { }, new string[] { }); + } + public void ReportValidity() + { + InvokeMethodSync("reportValidity", new object[] { }, new string[] { }); + } + /// + /// Checks for validity of the control and emits the invalid event if it invalid. + /// + public async Task CheckValidityAsync() + { + await InvokeMethod("checkValidity", new object[] { }, new string[] { }); + } + public void CheckValidity() + { + InvokeMethodSync("checkValidity", new object[] { }, new string[] { }); + } + /// + /// Sets a custom validation message for the control. + /// As long as `message` is not empty, the control is considered invalid. + /// + public async Task SetCustomValidityAsync(String message) + { + await InvokeMethod("setCustomValidity", new object[] { StringToString(message) }, new string[] { "String" }); + } + public void SetCustomValidity(String message) + { + InvokeMethodSync("setCustomValidity", new object[] { StringToString(message) }, new string[] { "String" }); + } - protected override bool UseDirectRender + private EventCallback? _checkedChanged = null; + [Parameter] + public EventCallback CheckedChanged + { + get + { + return this._checkedChanged != null ? this._checkedChanged.Value : EventCallback.Empty; + } + set + { + if (!value.Equals(EventCallback.Empty)) + { + if (!CompareEventCallbacks(value, _checkedChanged, ref eventCallbacksCache)) + { + this.EnsureChangeHandled(); + + _checkedChanged = value; + } + } + else + { + _checkedChanged = null; + } + } + } + + private string _changeRef = null; + private string _changeScript = null; + [Parameter] + public string ChangeScript + { + + set + { + if (value != this._changeScript) + { + this._changeScript = value; + this.OnRefChanged("Change", null, value, true, false, (string refName, object oldValue, object newValue) => + { + this._changeRef = refName; + this.MarkPropDirty("ChangeRef"); + }); + } + } + get + { + return this._changeScript; + } + } + + partial void OnHandlingChange(IgbCheckboxChangeEventArgs args); + private EventCallback? _change = null; + [Parameter] + public EventCallback Change + { + get + { + return this._change != null ? this._change.Value : EventCallback.Empty; + } + set + { + if (!value.Equals(EventCallback.Empty)) + { + if (!CompareEventCallbacks(value, _change, ref eventCallbacksCache)) + { + _change = value; + this.SetHandler(this.Name, "Change", value, (args) => { - get + OnHandlingChange(args); + + var newValueChecked = default(bool); + + { + newValueChecked = (bool)(args.Detail.Checked); + ; + OnEventUpdatingChecked(this._checked, ref newValueChecked); + if (UseDirectRender) { - return true; + //TODO: maybe we should be doing this for everything. Need to make sure we don't infinity bounce though. + this.Checked = newValueChecked; } - } - - protected override string DirectRenderElementName - { - get + else { - return "igc-checkbox-base"; + this._checked = newValueChecked; } - } + OnPropertyPropagatedOut(Name, "Checked"); + } - protected override ControlEventBehavior DefaultEventBehavior + if (!EventCallback.Empty.Equals(CheckedChanged)) { - get { return ControlEventBehavior.Immediate; } + var task = CheckedChanged.InvokeAsync(newValueChecked); + if (task.Exception != null) + { + throw task.Exception; + } } - - public IgbCheckboxBase(): base() { - OnCreatedIgbCheckboxBase(); - - - } - - partial void OnCreatedIgbCheckboxBase(); - - private string _value; - - partial void OnValueChanging(ref string newValue); - /// - /// The value attribute of the control. - /// - [Parameter] - public string Value - { - get { return this._value; } - set { - if (this._value != value || !IsPropDirty("Value")) { - MarkPropDirty("Value"); - } - this._value = value; - - } - } - private bool _checked = false; - - partial void OnCheckedChanging(ref bool newValue); - /// - /// The checked state of the control. - /// - [Parameter] - public bool Checked - { - get { return this._checked; } - set { - if (this._checked != value || !IsPropDirty("Checked")) { - MarkPropDirty("Checked"); - } - this._checked = value; - - } - } - public async Task GetCurrentCheckedAsync() - { - var iv = await InvokeMethod("p:Checked", new object[] { }, new string[] { }); - return ReturnToBoolean(iv); - } - public bool GetCurrentChecked() - { - var iv = InvokeMethodSync("p:Checked", new object[] { }, new string[] { }); - return ReturnToBoolean(iv); - } - private ToggleLabelPosition _labelPosition = ToggleLabelPosition.After; - - partial void OnLabelPositionChanging(ref ToggleLabelPosition newValue); - /// - /// The label position of the control. - /// - [Parameter] - public ToggleLabelPosition LabelPosition - { - get { return this._labelPosition; } - set { - if (this._labelPosition != value || !IsPropDirty("LabelPosition")) { - MarkPropDirty("LabelPosition"); - } - this._labelPosition = value; - - } - } - private bool _disabled = false; - - partial void OnDisabledChanging(ref bool newValue); - /// - /// The disabled state of the component - /// - [Parameter] - public bool Disabled - { - get { return this._disabled; } - set { - if (this._disabled != value || !IsPropDirty("Disabled")) { - MarkPropDirty("Disabled"); - } - this._disabled = value; - - } - } - private bool _required = false; - - partial void OnRequiredChanging(ref bool newValue); - /// - /// Makes the control a required field in a form context. - /// - [Parameter] - public bool Required - { - get { return this._required; } - set { - if (this._required != value || !IsPropDirty("Required")) { - MarkPropDirty("Required"); - } - this._required = value; - - } - } - private bool _invalid = false; - - partial void OnInvalidChanging(ref bool newValue); - /// - /// Control the validity of the control. - /// - [Parameter] - public bool Invalid - { - get { return this._invalid; } - set { - if (this._invalid != value || !IsPropDirty("Invalid")) { - MarkPropDirty("Invalid"); - } - this._invalid = value; - - } - } - - partial void FindByNameCheckboxBase(string name, ref object item); - public override object FindByName(string name) - { - - var baseResult = base.FindByName(name); - if (baseResult != null) - { - return baseResult; - } - - object item = null; - FindByNameCheckboxBase(name, ref item); - if (item != null) - { - return item; - } - - return null; - } - public async Task SetNativeElementAsync(Object element) - { - await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); - } - public void SetNativeElement(Object element) - { - InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); - } - /// - /// Simulates a click on the control. - /// - public async Task ClickAsync() - { - await InvokeMethod("click", new object[] { }, new string[] { }); - } - public void Click() - { - InvokeMethodSync("click", new object[] { }, new string[] { }); - } - /// - /// Sets focus on the control. - /// - - [WCWidgetMemberName("Focus")] - public async Task FocusComponentAsync(IgbFocusOptions options) - { - await InvokeMethod("focus", new object[] { ObjectToParam(options) }, new string[] { "Json" }); - } - - [WCWidgetMemberName("Focus")] - public void FocusComponent(IgbFocusOptions options) - { - InvokeMethodSync("focus", new object[] { ObjectToParam(options) }, new string[] { "Json" }); - } - /// - /// Removes focus from the control. - /// - - [WCWidgetMemberName("Blur")] - public async Task BlurComponentAsync() - { - await InvokeMethod("blur", new object[] { }, new string[] { }); - } - - [WCWidgetMemberName("Blur")] - public void BlurComponent() - { - InvokeMethodSync("blur", new object[] { }, new string[] { }); - } - /// - /// Checks for validity of the control and shows the browser message if it invalid. - /// - public async Task ReportValidityAsync() - { - await InvokeMethod("reportValidity", new object[] { }, new string[] { }); - } - public void ReportValidity() - { - InvokeMethodSync("reportValidity", new object[] { }, new string[] { }); - } - /// - /// Checks for validity of the control and emits the invalid event if it invalid. - /// - public async Task CheckValidityAsync() - { - await InvokeMethod("checkValidity", new object[] { }, new string[] { }); - } - public void CheckValidity() - { - InvokeMethodSync("checkValidity", new object[] { }, new string[] { }); - } - /// - /// Sets a custom validation message for the control. - /// As long as `message` is not empty, the control is considered invalid. - /// - public async Task SetCustomValidityAsync(String message) - { - await InvokeMethod("setCustomValidity", new object[] { StringToString(message) }, new string[] { "String" }); - } - public void SetCustomValidity(String message) - { - InvokeMethodSync("setCustomValidity", new object[] { StringToString(message) }, new string[] { "String" }); - } - - private EventCallback? _checkedChanged = null; - [Parameter] - public EventCallback CheckedChanged - { - get - { - return this._checkedChanged != null ? this._checkedChanged.Value : EventCallback.Empty; - } - set - { - if (!value.Equals(EventCallback.Empty)) - { - if (!CompareEventCallbacks(value, _checkedChanged, ref eventCallbacksCache)) - { - this.EnsureChangeHandled(); - - _checkedChanged = value; - } - } - else - { - _checkedChanged = null; - } - } - } - - private string _changeRef = null; - private string _changeScript = null; - [Parameter] - public string ChangeScript { - - set - { - if (value != this._changeScript) - { - this._changeScript = value; - this.OnRefChanged("Change", null, value, true, false, (string refName, object oldValue, object newValue) => { - this._changeRef = refName; - this.MarkPropDirty("ChangeRef"); - }); - } - } - get - { - return this._changeScript; - } - } - - partial void OnHandlingChange(IgbCheckboxChangeEventArgs args); - private EventCallback? _change = null; - [Parameter] - public EventCallback Change - { - get - { - return this._change != null ? this._change.Value : EventCallback.Empty; - } - set - { - if (!value.Equals(EventCallback.Empty)) - { - if (!CompareEventCallbacks(value, _change, ref eventCallbacksCache)) - { - _change = value; - this.SetHandler(this.Name, "Change", value, (args) => { - OnHandlingChange(args); - - var newValueChecked = default(bool); - - - { - newValueChecked = (bool)(args.Detail.Checked); - ; - OnEventUpdatingChecked(this._checked, ref newValueChecked); - if (UseDirectRender) { - //TODO: maybe we should be doing this for everything. Need to make sure we don't infinity bounce though. - this.Checked = newValueChecked; - } else { - this._checked = newValueChecked; - } - OnPropertyPropagatedOut(Name, "Checked"); - } - - if (!EventCallback.Empty.Equals(CheckedChanged)) - { - var task = CheckedChanged.InvokeAsync(newValueChecked); - if (task.Exception != null) - { - throw task.Exception; - } - } - - }); - this.OnRefChanged("Change", null, "event:::Change", true, false, (refName, oldValue, newValue) => { - this._changeRef = refName; - this.MarkPropDirty("ChangeRef"); - }); - } - } - else - { - _change = null; - this.SetHandler(this.Name, "Change", null); - this.OnRefChanged("Change", null, null, true, false, (refName, oldValue, newValue) => { - this._changeRef = null; - this.MarkPropDirty("ChangeRef"); - }); - } - } - } - internal void EnsureChangeHandled() - { - if (EventCallback.Empty.Equals(this.Change)) - { - this.Change = new EventCallback(null, (Action)((e) => { })); this._change = null; - } - } - - - private string _focusRef = null; - private string _focusScript = null; - [Parameter] - public string FocusScript { - - set - { - if (value != this._focusScript) - { - this._focusScript = value; - this.OnRefChanged("Focus", null, value, true, false, (string refName, object oldValue, object newValue) => { - this._focusRef = refName; - this.MarkPropDirty("FocusRef"); - }); - } - } - get - { - return this._focusScript; - } - } - - partial void OnHandlingFocus(IgbVoidEventArgs args); - private EventCallback? _focus = null; - [Parameter] - public EventCallback Focus - { - get - { - return this._focus != null ? this._focus.Value : EventCallback.Empty; - } - set - { - if (!value.Equals(EventCallback.Empty)) - { - if (!CompareEventCallbacks(value, _focus, ref eventCallbacksCache)) - { - _focus = value; - this.SetHandler(this.Name, "Focus", value, (args) => { - OnHandlingFocus(args); - - }); - this.OnRefChanged("Focus", null, "nativeEvent:::Focus", true, false, (refName, oldValue, newValue) => { - this._focusRef = refName; - this.MarkPropDirty("FocusRef"); - }); - } - } - else - { - _focus = null; - this.SetHandler(this.Name, "Focus", null); - this.OnRefChanged("Focus", null, null, true, false, (refName, oldValue, newValue) => { - this._focusRef = null; - this.MarkPropDirty("FocusRef"); - }); - } - } - } - - private string _blurRef = null; - private string _blurScript = null; - [Parameter] - public string BlurScript { - - set - { - if (value != this._blurScript) - { - this._blurScript = value; - this.OnRefChanged("Blur", null, value, true, false, (string refName, object oldValue, object newValue) => { - this._blurRef = refName; - this.MarkPropDirty("BlurRef"); - }); - } - } - get - { - return this._blurScript; - } - } - - partial void OnHandlingBlur(IgbVoidEventArgs args); - private EventCallback? _blur = null; - [Parameter] - public EventCallback Blur - { - get - { - return this._blur != null ? this._blur.Value : EventCallback.Empty; - } - set - { - if (!value.Equals(EventCallback.Empty)) - { - if (!CompareEventCallbacks(value, _blur, ref eventCallbacksCache)) - { - _blur = value; - this.SetHandler(this.Name, "Blur", value, (args) => { - OnHandlingBlur(args); - - }); - this.OnRefChanged("Blur", null, "nativeEvent:::Blur", true, false, (refName, oldValue, newValue) => { - this._blurRef = refName; - this.MarkPropDirty("BlurRef"); - }); - } - } - else - { - _blur = null; - this.SetHandler(this.Name, "Blur", null); - this.OnRefChanged("Blur", null, null, true, false, (refName, oldValue, newValue) => { - this._blurRef = null; - this.MarkPropDirty("BlurRef"); - }); - } - } - } - - partial void OnEventUpdatingChecked(bool oldValue, ref bool newValue); - - partial void SerializeCoreIgbCheckboxBase(RendererSerializer ser); - - internal override void SerializeCore(RendererSerializer ser) - { - base.SerializeCore(ser); - - SerializeCoreIgbCheckboxBase(ser); - - if (IsPropDirty("Value")) { ser.AddStringProp("value", this._value); } - if (IsPropDirty("Checked")) { ser.AddBooleanProp("checked", this._checked); } - if (IsPropDirty("LabelPosition")) { ser.AddEnumProp("labelPosition", this._labelPosition); } - if (IsPropDirty("Disabled")) { ser.AddBooleanProp("disabled", this._disabled); } - if (IsPropDirty("Required")) { ser.AddBooleanProp("required", this._required); } - if (IsPropDirty("Invalid")) { ser.AddBooleanProp("invalid", this._invalid); } - if (IsPropDirty("ChangeRef")) { ser.AddStringProp("changeRef", this._changeRef); } - if (IsPropDirty("FocusRef")) { ser.AddStringProp("focusRef", this._focusRef); } - if (IsPropDirty("BlurRef")) { ser.AddStringProp("blurRef", this._blurRef); } - - } - -} + + }); + this.OnRefChanged("Change", null, "event:::Change", true, false, (refName, oldValue, newValue) => + { + this._changeRef = refName; + this.MarkPropDirty("ChangeRef"); + }); + } + } + else + { + _change = null; + this.SetHandler(this.Name, "Change", null); + this.OnRefChanged("Change", null, null, true, false, (refName, oldValue, newValue) => + { + this._changeRef = null; + this.MarkPropDirty("ChangeRef"); + }); + } + } + } + internal void EnsureChangeHandled() + { + if (EventCallback.Empty.Equals(this.Change)) + { + this.Change = new EventCallback(null, (Action)((e) => { })); + this._change = null; + } + } + + private string _focusRef = null; + private string _focusScript = null; + [Parameter] + public string FocusScript + { + + set + { + if (value != this._focusScript) + { + this._focusScript = value; + this.OnRefChanged("Focus", null, value, true, false, (string refName, object oldValue, object newValue) => + { + this._focusRef = refName; + this.MarkPropDirty("FocusRef"); + }); + } + } + get + { + return this._focusScript; + } + } + + partial void OnHandlingFocus(IgbVoidEventArgs args); + private EventCallback? _focus = null; + [Parameter] + public EventCallback Focus + { + get + { + return this._focus != null ? this._focus.Value : EventCallback.Empty; + } + set + { + if (!value.Equals(EventCallback.Empty)) + { + if (!CompareEventCallbacks(value, _focus, ref eventCallbacksCache)) + { + _focus = value; + this.SetHandler(this.Name, "Focus", value, (args) => + { + OnHandlingFocus(args); + + }); + this.OnRefChanged("Focus", null, "nativeEvent:::Focus", true, false, (refName, oldValue, newValue) => + { + this._focusRef = refName; + this.MarkPropDirty("FocusRef"); + }); + } + } + else + { + _focus = null; + this.SetHandler(this.Name, "Focus", null); + this.OnRefChanged("Focus", null, null, true, false, (refName, oldValue, newValue) => + { + this._focusRef = null; + this.MarkPropDirty("FocusRef"); + }); + } + } + } + + private string _blurRef = null; + private string _blurScript = null; + [Parameter] + public string BlurScript + { + + set + { + if (value != this._blurScript) + { + this._blurScript = value; + this.OnRefChanged("Blur", null, value, true, false, (string refName, object oldValue, object newValue) => + { + this._blurRef = refName; + this.MarkPropDirty("BlurRef"); + }); + } + } + get + { + return this._blurScript; + } + } + + partial void OnHandlingBlur(IgbVoidEventArgs args); + private EventCallback? _blur = null; + [Parameter] + public EventCallback Blur + { + get + { + return this._blur != null ? this._blur.Value : EventCallback.Empty; + } + set + { + if (!value.Equals(EventCallback.Empty)) + { + if (!CompareEventCallbacks(value, _blur, ref eventCallbacksCache)) + { + _blur = value; + this.SetHandler(this.Name, "Blur", value, (args) => + { + OnHandlingBlur(args); + + }); + this.OnRefChanged("Blur", null, "nativeEvent:::Blur", true, false, (refName, oldValue, newValue) => + { + this._blurRef = refName; + this.MarkPropDirty("BlurRef"); + }); + } + } + else + { + _blur = null; + this.SetHandler(this.Name, "Blur", null); + this.OnRefChanged("Blur", null, null, true, false, (refName, oldValue, newValue) => + { + this._blurRef = null; + this.MarkPropDirty("BlurRef"); + }); + } + } + } + + partial void OnEventUpdatingChecked(bool oldValue, ref bool newValue); + + partial void SerializeCoreIgbCheckboxBase(RendererSerializer ser); + + internal override void SerializeCore(RendererSerializer ser) + { + base.SerializeCore(ser); + + SerializeCoreIgbCheckboxBase(ser); + + if (IsPropDirty("Value")) + { ser.AddStringProp("value", this._value); } + if (IsPropDirty("Checked")) + { ser.AddBooleanProp("checked", this._checked); } + if (IsPropDirty("LabelPosition")) + { ser.AddEnumProp("labelPosition", this._labelPosition); } + if (IsPropDirty("Disabled")) + { ser.AddBooleanProp("disabled", this._disabled); } + if (IsPropDirty("Required")) + { ser.AddBooleanProp("required", this._required); } + if (IsPropDirty("Invalid")) + { ser.AddBooleanProp("invalid", this._invalid); } + if (IsPropDirty("ChangeRef")) + { ser.AddStringProp("changeRef", this._changeRef); } + if (IsPropDirty("FocusRef")) + { ser.AddStringProp("focusRef", this._focusRef); } + if (IsPropDirty("BlurRef")) + { ser.AddStringProp("blurRef", this._blurRef); } + + } + + } } diff --git a/src/components/Blazor/CheckboxBaseModule.cs b/src/components/Blazor/CheckboxBaseModule.cs index 5f556422..71543a2f 100644 --- a/src/components/Blazor/CheckboxBaseModule.cs +++ b/src/components/Blazor/CheckboxBaseModule.cs @@ -1,23 +1,20 @@ -using System; -using System.Collections.Generic; -using System.Runtime.CompilerServices; -using System.Text; -using System.Collections.Generic; - namespace IgniteUI.Blazor.Controls { - public partial class IgbCheckboxBaseModule { - public static void Register(IIgniteUIBlazor runtime) { + public partial class IgbCheckboxBaseModule + { + public static void Register(IIgniteUIBlazor runtime) + { ModuleLoader.Load(runtime, "WebCheckboxBaseModule"); - } - public static void MarkIsLoadRequested(IIgniteUIBlazor runtime) { + public static void MarkIsLoadRequested(IIgniteUIBlazor runtime) + { ModuleLoader.MarkIsLoadRequested(runtime, "WebCheckboxBaseModule"); } - public static bool IsLoadRequested(IIgniteUIBlazor runtime) { + public static bool IsLoadRequested(IIgniteUIBlazor runtime) + { return ModuleLoader.IsLoadRequested(runtime, "WebCheckboxBaseModule"); } } diff --git a/src/components/Blazor/CheckboxChangeEventArgs.cs b/src/components/Blazor/CheckboxChangeEventArgs.cs index 8259109a..78f8fbcf 100644 --- a/src/components/Blazor/CheckboxChangeEventArgs.cs +++ b/src/components/Blazor/CheckboxChangeEventArgs.cs @@ -1,99 +1,97 @@ - -using System; using Microsoft.AspNetCore.Components; -using Microsoft.AspNetCore.Components.Rendering; -using System.Threading.Tasks; -using System.Collections.Generic; -using System.Linq; namespace IgniteUI.Blazor.Controls { - public partial class IgbCheckboxChangeEventArgs: BaseRendererElement { - public override string Type { get { return "WebCheckboxChangeEventArgs"; } } - - - private static bool _marshalByValue = true; - - public IgbCheckboxChangeEventArgs(): base() { - OnCreatedIgbCheckboxChangeEventArgs(); - - - } - - partial void OnCreatedIgbCheckboxChangeEventArgs(); - - private IgbCheckboxChangeEventArgsDetail _detail; - - partial void OnDetailChanging(ref IgbCheckboxChangeEventArgsDetail newValue); - [Parameter] - public IgbCheckboxChangeEventArgsDetail Detail - { - get { return this._detail; } - set { - OnDetailChanging(ref value); - MarkPropDirty("Detail"); - if (this._detail != null) { - this.DetachChild(this._detail); - } - if (value != null) { - this.AttachChild(value); - } - this._detail = value; - } - - } - - partial void FindByNameCheckboxChangeEventArgs(string name, ref object item); - public override object FindByName(string name) - { - - var baseResult = base.FindByName(name); - if (baseResult != null) - { - return baseResult; - } - - object item = null; - FindByNameCheckboxChangeEventArgs(name, ref item); - if (item != null) - { - return item; - } - - return null; - } - - partial void SerializeCoreIgbCheckboxChangeEventArgs(RendererSerializer ser); - - internal override void SerializeCore(RendererSerializer ser) - { - base.SerializeCore(ser); - - SerializeCoreIgbCheckboxChangeEventArgs(ser); - - if (IsPropDirty("Detail")) { ser.AddSerializableProp("detail", this._detail); } - - } - - - protected internal override void ToEventJson(BaseRendererControl control, Dictionary args) - { - base.ToEventJson(control, args); - - if (IsPropDirty("Detail")) { args["detail"] = ObjectToParam(this._detail); } - - - } - - - protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) { - base.FromEventJson(control, args); - this.SuppressParentNotify = true; - - if (args.ContainsKey("detail")) { this.Detail = (IgbCheckboxChangeEventArgsDetail)ConvertReturnValue(args["detail"], "CheckboxChangeEventArgsDetail", true); } - - this.SuppressParentNotify = false; - } - -} + public partial class IgbCheckboxChangeEventArgs : BaseRendererElement + { + public override string Type { get { return "WebCheckboxChangeEventArgs"; } } + + private static bool _marshalByValue = true; + + public IgbCheckboxChangeEventArgs() : base() + { + OnCreatedIgbCheckboxChangeEventArgs(); + + } + + partial void OnCreatedIgbCheckboxChangeEventArgs(); + + private IgbCheckboxChangeEventArgsDetail _detail; + + partial void OnDetailChanging(ref IgbCheckboxChangeEventArgsDetail newValue); + [Parameter] + public IgbCheckboxChangeEventArgsDetail Detail + { + get { return this._detail; } + set + { + OnDetailChanging(ref value); + MarkPropDirty("Detail"); + if (this._detail != null) + { + this.DetachChild(this._detail); + } + if (value != null) + { + this.AttachChild(value); + } + this._detail = value; + } + + } + + partial void FindByNameCheckboxChangeEventArgs(string name, ref object item); + public override object FindByName(string name) + { + + var baseResult = base.FindByName(name); + if (baseResult != null) + { + return baseResult; + } + + object item = null; + FindByNameCheckboxChangeEventArgs(name, ref item); + if (item != null) + { + return item; + } + + return null; + } + + partial void SerializeCoreIgbCheckboxChangeEventArgs(RendererSerializer ser); + + internal override void SerializeCore(RendererSerializer ser) + { + base.SerializeCore(ser); + + SerializeCoreIgbCheckboxChangeEventArgs(ser); + + if (IsPropDirty("Detail")) + { ser.AddSerializableProp("detail", this._detail); } + + } + + protected internal override void ToEventJson(BaseRendererControl control, Dictionary args) + { + base.ToEventJson(control, args); + + if (IsPropDirty("Detail")) + { args["detail"] = ObjectToParam(this._detail); } + + } + + protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) + { + base.FromEventJson(control, args); + this.SuppressParentNotify = true; + + if (args.ContainsKey("detail")) + { this.Detail = (IgbCheckboxChangeEventArgsDetail)ConvertReturnValue(args["detail"], "CheckboxChangeEventArgsDetail", true); } + + this.SuppressParentNotify = false; + } + + } } diff --git a/src/components/Blazor/CheckboxChangeEventArgsDetail.cs b/src/components/Blazor/CheckboxChangeEventArgsDetail.cs index ab60d7d0..a668ff48 100644 --- a/src/components/Blazor/CheckboxChangeEventArgsDetail.cs +++ b/src/components/Blazor/CheckboxChangeEventArgsDetail.cs @@ -1,120 +1,122 @@ - -using System; using Microsoft.AspNetCore.Components; -using Microsoft.AspNetCore.Components.Rendering; -using System.Threading.Tasks; -using System.Collections.Generic; -using System.Linq; namespace IgniteUI.Blazor.Controls { - public partial class IgbCheckboxChangeEventArgsDetail: BaseRendererElement { - public override string Type { get { return "WebCheckboxChangeEventArgsDetail"; } } - - - private static bool _marshalByValue = true; - - public IgbCheckboxChangeEventArgsDetail(): base() { - OnCreatedIgbCheckboxChangeEventArgsDetail(); - - - } - - partial void OnCreatedIgbCheckboxChangeEventArgsDetail(); - - private bool _checked = false; - - partial void OnCheckedChanging(ref bool newValue); - [Parameter] - public bool Checked - { - get { return this._checked; } - set { - if (this._checked != value || !IsPropDirty("Checked")) { - MarkPropDirty("Checked"); - } - this._checked = value; - - } - } - private string _value; - - partial void OnValueChanging(ref string newValue); - [Parameter] - public string Value - { - get { return this._value; } - set { - if (this._value != value || !IsPropDirty("Value")) { - MarkPropDirty("Value"); - } - this._value = value; - - } - } - - partial void FindByNameCheckboxChangeEventArgsDetail(string name, ref object item); - public override object FindByName(string name) - { - - var baseResult = base.FindByName(name); - if (baseResult != null) - { - return baseResult; - } - - object item = null; - FindByNameCheckboxChangeEventArgsDetail(name, ref item); - if (item != null) - { - return item; - } - - return null; - } - public async Task SetNativeElementAsync(Object element) - { - await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); - } - public void SetNativeElement(Object element) - { - InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); - } - - partial void SerializeCoreIgbCheckboxChangeEventArgsDetail(RendererSerializer ser); - - internal override void SerializeCore(RendererSerializer ser) - { - base.SerializeCore(ser); - - SerializeCoreIgbCheckboxChangeEventArgsDetail(ser); - - if (IsPropDirty("Checked")) { ser.AddBooleanProp("checked", this._checked); } - if (IsPropDirty("Value")) { ser.AddStringProp("value", this._value); } - - } - - - protected internal override void ToEventJson(BaseRendererControl control, Dictionary args) - { - base.ToEventJson(control, args); - - if (IsPropDirty("Checked")) { args["checked"] = (this._checked).ToString().ToLower(); } - if (IsPropDirty("Value")) { args["value"] = this._value; } - - - } - - - protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) { - base.FromEventJson(control, args); - this.SuppressParentNotify = true; - - if (args.ContainsKey("checked")) { this.Checked = ReturnToBoolean(args["checked"]); } - if (args.ContainsKey("value")) { this.Value = ReturnToString(args["value"]); } - - this.SuppressParentNotify = false; - } - -} + public partial class IgbCheckboxChangeEventArgsDetail : BaseRendererElement + { + public override string Type { get { return "WebCheckboxChangeEventArgsDetail"; } } + + private static bool _marshalByValue = true; + + public IgbCheckboxChangeEventArgsDetail() : base() + { + OnCreatedIgbCheckboxChangeEventArgsDetail(); + + } + + partial void OnCreatedIgbCheckboxChangeEventArgsDetail(); + + private bool _checked = false; + + partial void OnCheckedChanging(ref bool newValue); + [Parameter] + public bool Checked + { + get { return this._checked; } + set + { + if (this._checked != value || !IsPropDirty("Checked")) + { + MarkPropDirty("Checked"); + } + this._checked = value; + + } + } + private string _value; + + partial void OnValueChanging(ref string newValue); + [Parameter] + public string Value + { + get { return this._value; } + set + { + if (this._value != value || !IsPropDirty("Value")) + { + MarkPropDirty("Value"); + } + this._value = value; + + } + } + + partial void FindByNameCheckboxChangeEventArgsDetail(string name, ref object item); + public override object FindByName(string name) + { + + var baseResult = base.FindByName(name); + if (baseResult != null) + { + return baseResult; + } + + object item = null; + FindByNameCheckboxChangeEventArgsDetail(name, ref item); + if (item != null) + { + return item; + } + + return null; + } + public async Task SetNativeElementAsync(Object element) + { + await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + } + public void SetNativeElement(Object element) + { + InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + } + + partial void SerializeCoreIgbCheckboxChangeEventArgsDetail(RendererSerializer ser); + + internal override void SerializeCore(RendererSerializer ser) + { + base.SerializeCore(ser); + + SerializeCoreIgbCheckboxChangeEventArgsDetail(ser); + + if (IsPropDirty("Checked")) + { ser.AddBooleanProp("checked", this._checked); } + if (IsPropDirty("Value")) + { ser.AddStringProp("value", this._value); } + + } + + protected internal override void ToEventJson(BaseRendererControl control, Dictionary args) + { + base.ToEventJson(control, args); + + if (IsPropDirty("Checked")) + { args["checked"] = (this._checked).ToString().ToLower(); } + if (IsPropDirty("Value")) + { args["value"] = this._value; } + + } + + protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) + { + base.FromEventJson(control, args); + this.SuppressParentNotify = true; + + if (args.ContainsKey("checked")) + { this.Checked = ReturnToBoolean(args["checked"]); } + if (args.ContainsKey("value")) + { this.Value = ReturnToString(args["value"]); } + + this.SuppressParentNotify = false; + } + + } } diff --git a/src/components/Blazor/CheckboxModule.cs b/src/components/Blazor/CheckboxModule.cs index 782535c3..96f4769c 100644 --- a/src/components/Blazor/CheckboxModule.cs +++ b/src/components/Blazor/CheckboxModule.cs @@ -1,24 +1,22 @@ -using System; -using System.Collections.Generic; -using System.Runtime.CompilerServices; -using System.Text; -using System.Collections.Generic; - namespace IgniteUI.Blazor.Controls { - public partial class IgbCheckboxModule { - public static void Register(IIgniteUIBlazor runtime) { + public partial class IgbCheckboxModule + { + public static void Register(IIgniteUIBlazor runtime) + { ModuleLoader.Load(runtime, "WebCheckboxModule"); IgbCheckboxBaseModule.MarkIsLoadRequested(runtime); } - public static void MarkIsLoadRequested(IIgniteUIBlazor runtime) { + public static void MarkIsLoadRequested(IIgniteUIBlazor runtime) + { ModuleLoader.MarkIsLoadRequested(runtime, "WebCheckboxModule"); } - public static bool IsLoadRequested(IIgniteUIBlazor runtime) { + public static bool IsLoadRequested(IIgniteUIBlazor runtime) + { return ModuleLoader.IsLoadRequested(runtime, "WebCheckboxModule"); } } diff --git a/src/components/Blazor/Chip.cs b/src/components/Blazor/Chip.cs index 81f96e60..6ae5f81c 100644 --- a/src/components/Blazor/Chip.cs +++ b/src/components/Blazor/Chip.cs @@ -1,396 +1,420 @@ - -using System; using Microsoft.AspNetCore.Components; -using Microsoft.AspNetCore.Components.Rendering; -using System.Threading.Tasks; -using System.Collections.Generic; -using System.Linq; namespace IgniteUI.Blazor.Controls { - /// -/// Chips help people enter information, make selections, filter content, or trigger actions. -/// -public partial class IgbChip: BaseRendererControl { - public override string Type { get { return "WebChip"; } } + /// + /// Chips help people enter information, make selections, filter content, or trigger actions. + /// + public partial class IgbChip : BaseRendererControl + { + public override string Type { get { return "WebChip"; } } - protected override void EnsureModulesLoaded() - { - if (!IgbChipModule.IsLoadRequested(IgBlazor)) - { - IgbChipModule.Register(IgBlazor); - } - } + protected override void EnsureModulesLoaded() + { + if (!IgbChipModule.IsLoadRequested(IgBlazor)) + { + IgbChipModule.Register(IgBlazor); + } + } + + protected override string ResolveDisplay() + { + return "inline-block"; + } + + protected override bool SupportsVisualChildren + { + get + { + return true; + } + } + + protected override bool UseDirectRender + { + get + { + return true; + } + } + + protected override string DirectRenderElementName + { + get + { + return "igc-chip"; + } + } + + protected override ControlEventBehavior DefaultEventBehavior + { + get { return ControlEventBehavior.Immediate; } + } + + public IgbChip() : base() + { + OnCreatedIgbChip(); + + } + + partial void OnCreatedIgbChip(); + + private bool _disabled = false; + + partial void OnDisabledChanging(ref bool newValue); + /// + /// Sets the disabled state for the chip. + /// + [Parameter] + public bool Disabled + { + get { return this._disabled; } + set + { + if (this._disabled != value || !IsPropDirty("Disabled")) + { + MarkPropDirty("Disabled"); + } + this._disabled = value; + + } + } + private bool _removable = false; + + partial void OnRemovableChanging(ref bool newValue); + /// + /// Defines if the chip is removable or not. + /// + [Parameter] + public bool Removable + { + get { return this._removable; } + set + { + if (this._removable != value || !IsPropDirty("Removable")) + { + MarkPropDirty("Removable"); + } + this._removable = value; + + } + } + private bool _selectable = false; + + partial void OnSelectableChanging(ref bool newValue); + /// + /// Defines if the chip is selectable or not. + /// + [Parameter] + public bool Selectable + { + get { return this._selectable; } + set + { + if (this._selectable != value || !IsPropDirty("Selectable")) + { + MarkPropDirty("Selectable"); + } + this._selectable = value; + + } + } + private bool _selected = false; + + partial void OnSelectedChanging(ref bool newValue); + /// + /// Defines if the chip is selected or not. + /// + [Parameter] + public bool Selected + { + get { return this._selected; } + set + { + if (this._selected != value || !IsPropDirty("Selected")) + { + MarkPropDirty("Selected"); + } + this._selected = value; + + } + } + public async Task GetCurrentSelectedAsync() + { + var iv = await InvokeMethod("p:Selected", new object[] { }, new string[] { }); + return ReturnToBoolean(iv); + } + public bool GetCurrentSelected() + { + var iv = InvokeMethodSync("p:Selected", new object[] { }, new string[] { }); + return ReturnToBoolean(iv); + } + private StyleVariant _variant = StyleVariant.Primary; + + partial void OnVariantChanging(ref StyleVariant newValue); + /// + /// A property that sets the color variant of the chip component. + /// + [Parameter] + public StyleVariant Variant + { + get { return this._variant; } + set + { + if (this._variant != value || !IsPropDirty("Variant")) + { + MarkPropDirty("Variant"); + } + this._variant = value; + + } + } + + partial void FindByNameChip(string name, ref object item); + public override object FindByName(string name) + { + + var baseResult = base.FindByName(name); + if (baseResult != null) + { + return baseResult; + } + + object item = null; + FindByNameChip(name, ref item); + if (item != null) + { + return item; + } + + return null; + } + public async Task SetNativeElementAsync(Object element) + { + await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + } + public void SetNativeElement(Object element) + { + InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + } - protected override string ResolveDisplay() + private EventCallback? _selectedChanged = null; + [Parameter] + public EventCallback SelectedChanged + { + get + { + return this._selectedChanged != null ? this._selectedChanged.Value : EventCallback.Empty; + } + set + { + if (!value.Equals(EventCallback.Empty)) + { + if (!CompareEventCallbacks(value, _selectedChanged, ref eventCallbacksCache)) + { + this.EnsureSelectHandled(); + + _selectedChanged = value; + } + } + else + { + _selectedChanged = null; + } + } + } + + private string _removeRef = null; + private string _removeScript = null; + [Parameter] + public string RemoveScript + { + + set + { + if (value != this._removeScript) + { + this._removeScript = value; + this.OnRefChanged("Remove", null, value, true, false, (string refName, object oldValue, object newValue) => + { + this._removeRef = refName; + this.MarkPropDirty("RemoveRef"); + }); + } + } + get + { + return this._removeScript; + } + } + + partial void OnHandlingRemove(IgbComponentBoolValueChangedEventArgs args); + private EventCallback? _remove = null; + [Parameter] + public EventCallback Remove + { + get + { + return this._remove != null ? this._remove.Value : EventCallback.Empty; + } + set + { + if (!value.Equals(EventCallback.Empty)) + { + if (!CompareEventCallbacks(value, _remove, ref eventCallbacksCache)) + { + _remove = value; + this.SetHandler(this.Name, "Remove", value, (args) => { - return "inline-block"; - } + OnHandlingRemove(args); - protected override bool SupportsVisualChildren + }); + this.OnRefChanged("Remove", null, "event:::Remove", true, false, (refName, oldValue, newValue) => { - get - { - return true; - } - } + this._removeRef = refName; + this.MarkPropDirty("RemoveRef"); + }); + } + } + else + { + _remove = null; + this.SetHandler(this.Name, "Remove", null); + this.OnRefChanged("Remove", null, null, true, false, (refName, oldValue, newValue) => + { + this._removeRef = null; + this.MarkPropDirty("RemoveRef"); + }); + } + } + } + + private string _selectRef = null; + private string _selectScript = null; + [Parameter] + public string SelectScript + { - protected override bool UseDirectRender + set + { + if (value != this._selectScript) + { + this._selectScript = value; + this.OnRefChanged("Select", null, value, true, false, (string refName, object oldValue, object newValue) => + { + this._selectRef = refName; + this.MarkPropDirty("SelectRef"); + }); + } + } + get + { + return this._selectScript; + } + } + + partial void OnHandlingSelect(IgbComponentBoolValueChangedEventArgs args); + private EventCallback? _select = null; + [Parameter] + public EventCallback Select + { + get + { + return this._select != null ? this._select.Value : EventCallback.Empty; + } + set + { + if (!value.Equals(EventCallback.Empty)) + { + if (!CompareEventCallbacks(value, _select, ref eventCallbacksCache)) + { + _select = value; + this.SetHandler(this.Name, "Select", value, (args) => { - get + OnHandlingSelect(args); + + var newValueSelected = default(bool); + + { + newValueSelected = (bool)(args.Detail); + ; + OnEventUpdatingSelected(this._selected, ref newValueSelected); + if (UseDirectRender) { - return true; + //TODO: maybe we should be doing this for everything. Need to make sure we don't infinity bounce though. + this.Selected = newValueSelected; } - } - - protected override string DirectRenderElementName - { - get + else { - return "igc-chip"; + this._selected = newValueSelected; } - } + OnPropertyPropagatedOut(Name, "Selected"); + } - protected override ControlEventBehavior DefaultEventBehavior + if (!EventCallback.Empty.Equals(SelectedChanged)) { - get { return ControlEventBehavior.Immediate; } + var task = SelectedChanged.InvokeAsync(newValueSelected); + if (task.Exception != null) + { + throw task.Exception; + } } - - public IgbChip(): base() { - OnCreatedIgbChip(); - - - } - - partial void OnCreatedIgbChip(); - - private bool _disabled = false; - - partial void OnDisabledChanging(ref bool newValue); - /// - /// Sets the disabled state for the chip. - /// - [Parameter] - public bool Disabled - { - get { return this._disabled; } - set { - if (this._disabled != value || !IsPropDirty("Disabled")) { - MarkPropDirty("Disabled"); - } - this._disabled = value; - - } - } - private bool _removable = false; - - partial void OnRemovableChanging(ref bool newValue); - /// - /// Defines if the chip is removable or not. - /// - [Parameter] - public bool Removable - { - get { return this._removable; } - set { - if (this._removable != value || !IsPropDirty("Removable")) { - MarkPropDirty("Removable"); - } - this._removable = value; - - } - } - private bool _selectable = false; - - partial void OnSelectableChanging(ref bool newValue); - /// - /// Defines if the chip is selectable or not. - /// - [Parameter] - public bool Selectable - { - get { return this._selectable; } - set { - if (this._selectable != value || !IsPropDirty("Selectable")) { - MarkPropDirty("Selectable"); - } - this._selectable = value; - - } - } - private bool _selected = false; - - partial void OnSelectedChanging(ref bool newValue); - /// - /// Defines if the chip is selected or not. - /// - [Parameter] - public bool Selected - { - get { return this._selected; } - set { - if (this._selected != value || !IsPropDirty("Selected")) { - MarkPropDirty("Selected"); - } - this._selected = value; - - } - } - public async Task GetCurrentSelectedAsync() - { - var iv = await InvokeMethod("p:Selected", new object[] { }, new string[] { }); - return ReturnToBoolean(iv); - } - public bool GetCurrentSelected() - { - var iv = InvokeMethodSync("p:Selected", new object[] { }, new string[] { }); - return ReturnToBoolean(iv); - } - private StyleVariant _variant = StyleVariant.Primary; - - partial void OnVariantChanging(ref StyleVariant newValue); - /// - /// A property that sets the color variant of the chip component. - /// - [Parameter] - public StyleVariant Variant - { - get { return this._variant; } - set { - if (this._variant != value || !IsPropDirty("Variant")) { - MarkPropDirty("Variant"); - } - this._variant = value; - - } - } - - partial void FindByNameChip(string name, ref object item); - public override object FindByName(string name) - { - - var baseResult = base.FindByName(name); - if (baseResult != null) - { - return baseResult; - } - - object item = null; - FindByNameChip(name, ref item); - if (item != null) - { - return item; - } - - return null; - } - public async Task SetNativeElementAsync(Object element) - { - await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); - } - public void SetNativeElement(Object element) - { - InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); - } - - private EventCallback? _selectedChanged = null; - [Parameter] - public EventCallback SelectedChanged - { - get - { - return this._selectedChanged != null ? this._selectedChanged.Value : EventCallback.Empty; - } - set - { - if (!value.Equals(EventCallback.Empty)) - { - if (!CompareEventCallbacks(value, _selectedChanged, ref eventCallbacksCache)) - { - this.EnsureSelectHandled(); - - _selectedChanged = value; - } - } - else - { - _selectedChanged = null; - } - } - } - - private string _removeRef = null; - private string _removeScript = null; - [Parameter] - public string RemoveScript { - - set - { - if (value != this._removeScript) - { - this._removeScript = value; - this.OnRefChanged("Remove", null, value, true, false, (string refName, object oldValue, object newValue) => { - this._removeRef = refName; - this.MarkPropDirty("RemoveRef"); - }); - } - } - get - { - return this._removeScript; - } - } - - partial void OnHandlingRemove(IgbComponentBoolValueChangedEventArgs args); - private EventCallback? _remove = null; - [Parameter] - public EventCallback Remove - { - get - { - return this._remove != null ? this._remove.Value : EventCallback.Empty; - } - set - { - if (!value.Equals(EventCallback.Empty)) - { - if (!CompareEventCallbacks(value, _remove, ref eventCallbacksCache)) - { - _remove = value; - this.SetHandler(this.Name, "Remove", value, (args) => { - OnHandlingRemove(args); - - }); - this.OnRefChanged("Remove", null, "event:::Remove", true, false, (refName, oldValue, newValue) => { - this._removeRef = refName; - this.MarkPropDirty("RemoveRef"); - }); - } - } - else - { - _remove = null; - this.SetHandler(this.Name, "Remove", null); - this.OnRefChanged("Remove", null, null, true, false, (refName, oldValue, newValue) => { - this._removeRef = null; - this.MarkPropDirty("RemoveRef"); - }); - } - } - } - - private string _selectRef = null; - private string _selectScript = null; - [Parameter] - public string SelectScript { - - set - { - if (value != this._selectScript) - { - this._selectScript = value; - this.OnRefChanged("Select", null, value, true, false, (string refName, object oldValue, object newValue) => { - this._selectRef = refName; - this.MarkPropDirty("SelectRef"); - }); - } - } - get - { - return this._selectScript; - } - } - - partial void OnHandlingSelect(IgbComponentBoolValueChangedEventArgs args); - private EventCallback? _select = null; - [Parameter] - public EventCallback Select - { - get - { - return this._select != null ? this._select.Value : EventCallback.Empty; - } - set - { - if (!value.Equals(EventCallback.Empty)) - { - if (!CompareEventCallbacks(value, _select, ref eventCallbacksCache)) - { - _select = value; - this.SetHandler(this.Name, "Select", value, (args) => { - OnHandlingSelect(args); - - var newValueSelected = default(bool); - - - { - newValueSelected = (bool)(args.Detail); - ; - OnEventUpdatingSelected(this._selected, ref newValueSelected); - if (UseDirectRender) { - //TODO: maybe we should be doing this for everything. Need to make sure we don't infinity bounce though. - this.Selected = newValueSelected; - } else { - this._selected = newValueSelected; - } - OnPropertyPropagatedOut(Name, "Selected"); - } - - if (!EventCallback.Empty.Equals(SelectedChanged)) - { - var task = SelectedChanged.InvokeAsync(newValueSelected); - if (task.Exception != null) - { - throw task.Exception; - } - } - - }); - this.OnRefChanged("Select", null, "event:::Select", true, false, (refName, oldValue, newValue) => { - this._selectRef = refName; - this.MarkPropDirty("SelectRef"); - }); - } - } - else - { - _select = null; - this.SetHandler(this.Name, "Select", null); - this.OnRefChanged("Select", null, null, true, false, (refName, oldValue, newValue) => { - this._selectRef = null; - this.MarkPropDirty("SelectRef"); - }); - } - } - } - internal void EnsureSelectHandled() - { - if (EventCallback.Empty.Equals(this.Select)) - { - this.Select = new EventCallback(null, (Action)((e) => { })); this._select = null; - } - } - - - partial void OnEventUpdatingSelected(bool oldValue, ref bool newValue); - - partial void SerializeCoreIgbChip(RendererSerializer ser); - - internal override void SerializeCore(RendererSerializer ser) - { - base.SerializeCore(ser); - - SerializeCoreIgbChip(ser); - - if (IsPropDirty("Disabled")) { ser.AddBooleanProp("disabled", this._disabled); } - if (IsPropDirty("Removable")) { ser.AddBooleanProp("removable", this._removable); } - if (IsPropDirty("Selectable")) { ser.AddBooleanProp("selectable", this._selectable); } - if (IsPropDirty("Selected")) { ser.AddBooleanProp("selected", this._selected); } - if (IsPropDirty("Variant")) { ser.AddEnumProp("variant", this._variant); } - if (IsPropDirty("RemoveRef")) { ser.AddStringProp("removeRef", this._removeRef); } - if (IsPropDirty("SelectRef")) { ser.AddStringProp("selectRef", this._selectRef); } - - } - -} + + }); + this.OnRefChanged("Select", null, "event:::Select", true, false, (refName, oldValue, newValue) => + { + this._selectRef = refName; + this.MarkPropDirty("SelectRef"); + }); + } + } + else + { + _select = null; + this.SetHandler(this.Name, "Select", null); + this.OnRefChanged("Select", null, null, true, false, (refName, oldValue, newValue) => + { + this._selectRef = null; + this.MarkPropDirty("SelectRef"); + }); + } + } + } + internal void EnsureSelectHandled() + { + if (EventCallback.Empty.Equals(this.Select)) + { + this.Select = new EventCallback(null, (Action)((e) => { })); + this._select = null; + } + } + + partial void OnEventUpdatingSelected(bool oldValue, ref bool newValue); + + partial void SerializeCoreIgbChip(RendererSerializer ser); + + internal override void SerializeCore(RendererSerializer ser) + { + base.SerializeCore(ser); + + SerializeCoreIgbChip(ser); + + if (IsPropDirty("Disabled")) + { ser.AddBooleanProp("disabled", this._disabled); } + if (IsPropDirty("Removable")) + { ser.AddBooleanProp("removable", this._removable); } + if (IsPropDirty("Selectable")) + { ser.AddBooleanProp("selectable", this._selectable); } + if (IsPropDirty("Selected")) + { ser.AddBooleanProp("selected", this._selected); } + if (IsPropDirty("Variant")) + { ser.AddEnumProp("variant", this._variant); } + if (IsPropDirty("RemoveRef")) + { ser.AddStringProp("removeRef", this._removeRef); } + if (IsPropDirty("SelectRef")) + { ser.AddStringProp("selectRef", this._selectRef); } + + } + + } } diff --git a/src/components/Blazor/ChipModule.cs b/src/components/Blazor/ChipModule.cs index 92efce9b..332a7f4c 100644 --- a/src/components/Blazor/ChipModule.cs +++ b/src/components/Blazor/ChipModule.cs @@ -1,23 +1,20 @@ -using System; -using System.Collections.Generic; -using System.Runtime.CompilerServices; -using System.Text; -using System.Collections.Generic; - namespace IgniteUI.Blazor.Controls { - public partial class IgbChipModule { - public static void Register(IIgniteUIBlazor runtime) { + public partial class IgbChipModule + { + public static void Register(IIgniteUIBlazor runtime) + { ModuleLoader.Load(runtime, "WebChipModule"); - } - public static void MarkIsLoadRequested(IIgniteUIBlazor runtime) { + public static void MarkIsLoadRequested(IIgniteUIBlazor runtime) + { ModuleLoader.MarkIsLoadRequested(runtime, "WebChipModule"); } - public static bool IsLoadRequested(IIgniteUIBlazor runtime) { + public static bool IsLoadRequested(IIgniteUIBlazor runtime) + { return ModuleLoader.IsLoadRequested(runtime, "WebChipModule"); } } diff --git a/src/components/Blazor/CircularGradient.cs b/src/components/Blazor/CircularGradient.cs index c06cb2f9..5c1957de 100644 --- a/src/components/Blazor/CircularGradient.cs +++ b/src/components/Blazor/CircularGradient.cs @@ -1,168 +1,172 @@ - -using System; using Microsoft.AspNetCore.Components; -using Microsoft.AspNetCore.Components.Rendering; -using System.Threading.Tasks; -using System.Collections.Generic; -using System.Linq; namespace IgniteUI.Blazor.Controls { - /// -/// Used for defining gradient stops in the igc-circular-progress. -/// For each `igc-circular-gradient` defined as `gradient` slot of `igc-circular-progress` element would be created a SVG stop element. -/// The values passed as `color`, `offset` and `opacity` would be set as -/// `stop-color`, `offset` and `stop-opacity` of the SVG element without further validations. -/// -public partial class IgbCircularGradient: BaseRendererControl { - public override string Type { get { return "WebCircularGradient"; } } - - protected override void EnsureModulesLoaded() - { - if (!IgbCircularGradientModule.IsLoadRequested(IgBlazor)) - { - IgbCircularGradientModule.Register(IgBlazor); - } - } - - protected override string ResolveDisplay() - { - return "inline-block"; - } - - protected override bool SupportsVisualChildren - { - get - { - return true; - } - } - - protected override bool UseDirectRender - { - get - { - return true; - } - } - - protected override string DirectRenderElementName - { - get - { - return "igc-circular-gradient"; - } - } - - protected override ControlEventBehavior DefaultEventBehavior - { - get { return ControlEventBehavior.Immediate; } - } - - public IgbCircularGradient(): base() { - OnCreatedIgbCircularGradient(); - - - } - - partial void OnCreatedIgbCircularGradient(); - - private string _offset; - - partial void OnOffsetChanging(ref string newValue); - /// - /// Defines where the gradient stop is placed along the gradient vector - /// - [Parameter] - public string Offset - { - get { return this._offset; } - set { - if (this._offset != value || !IsPropDirty("Offset")) { - MarkPropDirty("Offset"); - } - this._offset = value; - - } - } - private string _color; - - partial void OnColorChanging(ref string newValue); - /// - /// Defines the color of the gradient stop - /// - [Parameter] - public string Color - { - get { return this._color; } - set { - if (this._color != value || !IsPropDirty("Color")) { - MarkPropDirty("Color"); - } - this._color = value; - - } - } - private double _opacity = 0; - - partial void OnOpacityChanging(ref double newValue); - /// - /// Defines the opacity of the gradient stop - /// - [Parameter] - public double Opacity - { - get { return this._opacity; } - set { - if (this._opacity != value || !IsPropDirty("Opacity")) { - MarkPropDirty("Opacity"); - } - this._opacity = value; - - } - } - - partial void FindByNameCircularGradient(string name, ref object item); - public override object FindByName(string name) - { - - var baseResult = base.FindByName(name); - if (baseResult != null) - { - return baseResult; - } - - object item = null; - FindByNameCircularGradient(name, ref item); - if (item != null) - { - return item; - } - - return null; - } - public async Task SetNativeElementAsync(Object element) - { - await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); - } - public void SetNativeElement(Object element) - { - InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); - } - - partial void SerializeCoreIgbCircularGradient(RendererSerializer ser); - - internal override void SerializeCore(RendererSerializer ser) - { - base.SerializeCore(ser); - - SerializeCoreIgbCircularGradient(ser); - - if (IsPropDirty("Offset")) { ser.AddStringProp("offset", this._offset); } - if (IsPropDirty("Color")) { ser.AddStringProp("color", this._color); } - if (IsPropDirty("Opacity")) { ser.AddNumberProp("opacity", this._opacity); } - - } - -} + /// + /// Used for defining gradient stops in the igc-circular-progress. + /// For each `igc-circular-gradient` defined as `gradient` slot of `igc-circular-progress` element would be created a SVG stop element. + /// The values passed as `color`, `offset` and `opacity` would be set as + /// `stop-color`, `offset` and `stop-opacity` of the SVG element without further validations. + /// + public partial class IgbCircularGradient : BaseRendererControl + { + public override string Type { get { return "WebCircularGradient"; } } + + protected override void EnsureModulesLoaded() + { + if (!IgbCircularGradientModule.IsLoadRequested(IgBlazor)) + { + IgbCircularGradientModule.Register(IgBlazor); + } + } + + protected override string ResolveDisplay() + { + return "inline-block"; + } + + protected override bool SupportsVisualChildren + { + get + { + return true; + } + } + + protected override bool UseDirectRender + { + get + { + return true; + } + } + + protected override string DirectRenderElementName + { + get + { + return "igc-circular-gradient"; + } + } + + protected override ControlEventBehavior DefaultEventBehavior + { + get { return ControlEventBehavior.Immediate; } + } + + public IgbCircularGradient() : base() + { + OnCreatedIgbCircularGradient(); + + } + + partial void OnCreatedIgbCircularGradient(); + + private string _offset; + + partial void OnOffsetChanging(ref string newValue); + /// + /// Defines where the gradient stop is placed along the gradient vector + /// + [Parameter] + public string Offset + { + get { return this._offset; } + set + { + if (this._offset != value || !IsPropDirty("Offset")) + { + MarkPropDirty("Offset"); + } + this._offset = value; + + } + } + private string _color; + + partial void OnColorChanging(ref string newValue); + /// + /// Defines the color of the gradient stop + /// + [Parameter] + public string Color + { + get { return this._color; } + set + { + if (this._color != value || !IsPropDirty("Color")) + { + MarkPropDirty("Color"); + } + this._color = value; + + } + } + private double _opacity = 0; + + partial void OnOpacityChanging(ref double newValue); + /// + /// Defines the opacity of the gradient stop + /// + [Parameter] + public double Opacity + { + get { return this._opacity; } + set + { + if (this._opacity != value || !IsPropDirty("Opacity")) + { + MarkPropDirty("Opacity"); + } + this._opacity = value; + + } + } + + partial void FindByNameCircularGradient(string name, ref object item); + public override object FindByName(string name) + { + + var baseResult = base.FindByName(name); + if (baseResult != null) + { + return baseResult; + } + + object item = null; + FindByNameCircularGradient(name, ref item); + if (item != null) + { + return item; + } + + return null; + } + public async Task SetNativeElementAsync(Object element) + { + await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + } + public void SetNativeElement(Object element) + { + InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + } + + partial void SerializeCoreIgbCircularGradient(RendererSerializer ser); + + internal override void SerializeCore(RendererSerializer ser) + { + base.SerializeCore(ser); + + SerializeCoreIgbCircularGradient(ser); + + if (IsPropDirty("Offset")) + { ser.AddStringProp("offset", this._offset); } + if (IsPropDirty("Color")) + { ser.AddStringProp("color", this._color); } + if (IsPropDirty("Opacity")) + { ser.AddNumberProp("opacity", this._opacity); } + + } + + } } diff --git a/src/components/Blazor/CircularGradientModule.cs b/src/components/Blazor/CircularGradientModule.cs index 18882f2c..7a702e75 100644 --- a/src/components/Blazor/CircularGradientModule.cs +++ b/src/components/Blazor/CircularGradientModule.cs @@ -1,23 +1,20 @@ -using System; -using System.Collections.Generic; -using System.Runtime.CompilerServices; -using System.Text; -using System.Collections.Generic; - namespace IgniteUI.Blazor.Controls { - public partial class IgbCircularGradientModule { - public static void Register(IIgniteUIBlazor runtime) { + public partial class IgbCircularGradientModule + { + public static void Register(IIgniteUIBlazor runtime) + { ModuleLoader.Load(runtime, "WebCircularGradientModule"); - } - public static void MarkIsLoadRequested(IIgniteUIBlazor runtime) { + public static void MarkIsLoadRequested(IIgniteUIBlazor runtime) + { ModuleLoader.MarkIsLoadRequested(runtime, "WebCircularGradientModule"); } - public static bool IsLoadRequested(IIgniteUIBlazor runtime) { + public static bool IsLoadRequested(IIgniteUIBlazor runtime) + { return ModuleLoader.IsLoadRequested(runtime, "WebCircularGradientModule"); } } diff --git a/src/components/Blazor/CircularProgress.cs b/src/components/Blazor/CircularProgress.cs index 831e1ddf..f2d6065c 100644 --- a/src/components/Blazor/CircularProgress.cs +++ b/src/components/Blazor/CircularProgress.cs @@ -1,96 +1,87 @@ - -using System; -using Microsoft.AspNetCore.Components; -using Microsoft.AspNetCore.Components.Rendering; -using System.Threading.Tasks; -using System.Collections.Generic; -using System.Linq; - namespace IgniteUI.Blazor.Controls { - /// -/// A circular progress indicator used to express unspecified wait time or display -/// the length of a process. -/// -public partial class IgbCircularProgress: IgbProgressBase { - public override string Type { get { return "WebCircularProgress"; } } - - protected override void EnsureModulesLoaded() - { - if (!IgbCircularProgressModule.IsLoadRequested(IgBlazor)) - { - IgbCircularProgressModule.Register(IgBlazor); - } - } - - protected override string ResolveDisplay() - { - return "inline-block"; - } - - protected override bool SupportsVisualChildren - { - get - { - return true; - } - } - - protected override bool UseDirectRender - { - get - { - return true; - } - } - - protected override string DirectRenderElementName - { - get - { - return "igc-circular-progress"; - } - } - - public IgbCircularProgress(): base() { - OnCreatedIgbCircularProgress(); - - - } - - partial void OnCreatedIgbCircularProgress(); - - - partial void FindByNameCircularProgress(string name, ref object item); - public override object FindByName(string name) - { - - var baseResult = base.FindByName(name); - if (baseResult != null) - { - return baseResult; - } - - object item = null; - FindByNameCircularProgress(name, ref item); - if (item != null) - { - return item; - } - - return null; - } - - partial void SerializeCoreIgbCircularProgress(RendererSerializer ser); - - internal override void SerializeCore(RendererSerializer ser) - { - base.SerializeCore(ser); - - SerializeCoreIgbCircularProgress(ser); - - - } - -} + /// + /// A circular progress indicator used to express unspecified wait time or display + /// the length of a process. + /// + public partial class IgbCircularProgress : IgbProgressBase + { + public override string Type { get { return "WebCircularProgress"; } } + + protected override void EnsureModulesLoaded() + { + if (!IgbCircularProgressModule.IsLoadRequested(IgBlazor)) + { + IgbCircularProgressModule.Register(IgBlazor); + } + } + + protected override string ResolveDisplay() + { + return "inline-block"; + } + + protected override bool SupportsVisualChildren + { + get + { + return true; + } + } + + protected override bool UseDirectRender + { + get + { + return true; + } + } + + protected override string DirectRenderElementName + { + get + { + return "igc-circular-progress"; + } + } + + public IgbCircularProgress() : base() + { + OnCreatedIgbCircularProgress(); + + } + + partial void OnCreatedIgbCircularProgress(); + + partial void FindByNameCircularProgress(string name, ref object item); + public override object FindByName(string name) + { + + var baseResult = base.FindByName(name); + if (baseResult != null) + { + return baseResult; + } + + object item = null; + FindByNameCircularProgress(name, ref item); + if (item != null) + { + return item; + } + + return null; + } + + partial void SerializeCoreIgbCircularProgress(RendererSerializer ser); + + internal override void SerializeCore(RendererSerializer ser) + { + base.SerializeCore(ser); + + SerializeCoreIgbCircularProgress(ser); + + } + + } } diff --git a/src/components/Blazor/CircularProgressModule.cs b/src/components/Blazor/CircularProgressModule.cs index 87b36fb5..6c33f0eb 100644 --- a/src/components/Blazor/CircularProgressModule.cs +++ b/src/components/Blazor/CircularProgressModule.cs @@ -1,23 +1,20 @@ -using System; -using System.Collections.Generic; -using System.Runtime.CompilerServices; -using System.Text; -using System.Collections.Generic; - namespace IgniteUI.Blazor.Controls { - public partial class IgbCircularProgressModule { - public static void Register(IIgniteUIBlazor runtime) { + public partial class IgbCircularProgressModule + { + public static void Register(IIgniteUIBlazor runtime) + { ModuleLoader.Load(runtime, "WebCircularProgressModule"); - } - public static void MarkIsLoadRequested(IIgniteUIBlazor runtime) { + public static void MarkIsLoadRequested(IIgniteUIBlazor runtime) + { ModuleLoader.MarkIsLoadRequested(runtime, "WebCircularProgressModule"); } - public static bool IsLoadRequested(IIgniteUIBlazor runtime) { + public static bool IsLoadRequested(IIgniteUIBlazor runtime) + { return ModuleLoader.IsLoadRequested(runtime, "WebCircularProgressModule"); } } diff --git a/src/components/Blazor/Combo.cs b/src/components/Blazor/Combo.cs index 657ecd67..7cebfcc8 100644 --- a/src/components/Blazor/Combo.cs +++ b/src/components/Blazor/Combo.cs @@ -1,1217 +1,1322 @@ - -using System; using Microsoft.AspNetCore.Components; -using Microsoft.AspNetCore.Components.Rendering; -using System.Threading.Tasks; -using System.Collections.Generic; -using System.Linq; namespace IgniteUI.Blazor.Controls { - /// -/// The Combo component is similar to the Select component in that it provides a list of options from which the user can make a selection. -/// In contrast to the Select component, the Combo component displays all options in a virtualized list of items, -/// meaning the combo box can simultaneously show thousands of options, where one or more options can be selected. -/// Additionally, users can create custom item templates, allowing for robust data visualization. -/// The Combo component features case-sensitive filtering, grouping, complex data binding, dynamic addition of values and more. -/// -public partial class IgbCombo: IgbBaseComboBox { - public override string Type { get { return "WebCombo"; } } - - protected override void EnsureModulesLoaded() + /// + /// The Combo component is similar to the Select component in that it provides a list of options from which the user can make a selection. + /// In contrast to the Select component, the Combo component displays all options in a virtualized list of items, + /// meaning the combo box can simultaneously show thousands of options, where one or more options can be selected. + /// Additionally, users can create custom item templates, allowing for robust data visualization. + /// The Combo component features case-sensitive filtering, grouping, complex data binding, dynamic addition of values and more. + /// + public partial class IgbCombo : IgbBaseComboBox + { + public override string Type { get { return "WebCombo"; } } + + protected override void EnsureModulesLoaded() + { + if (!IgbComboModule.IsLoadRequested(IgBlazor)) + { + IgbComboModule.Register(IgBlazor); + } + } + + protected override string ResolveDisplay() + { + return "inline-block"; + } + + protected override bool SupportsVisualChildren + { + get + { + return true; + } + } + + public IgbCombo() : base() + { + OnCreatedIgbCombo(); + + } + + partial void OnCreatedIgbCombo(); + + private string _dataRef; + private Object _data; + + partial void OnDataChanging(ref Object newValue); + /// + /// The data source used to generate the list of options. + /// + [Parameter] + public Object Data + { + get { return this._data; } + + set + { + var oldValue = this._data; + OnDataChanging(ref value); + + if (oldValue != value || !IsPropDirty("Data")) + { + MarkPropDirty("Data"); + this._data = value; + this.OnRefChanged("Data", oldValue, value, false, false, (string refName, object old, object newValue) => + { + this._dataRef = refName; + this.MarkPropDirty("DataRef"); + }); + } + } + } + + private string _dataScript; + + ///Provides a means of setting Data in the JavaScript environment. + [Parameter] + public string DataScript + { + get { return _dataScript; } + + set + { + var oldValue = this._dataScript; + if (oldValue != value || !IsPropDirty("Data")) + { + this._dataScript = value; + MarkPropDirty("Data"); + this.OnRefChanged("Data", oldValue, value, true, false, (string refName, object old, object newValue) => + { + this._dataRef = refName; + this.MarkPropDirty("DataRef"); + }); + } + } + } + private bool _outlined = false; + + partial void OnOutlinedChanging(ref bool newValue); + /// + /// The outlined attribute of the control. + /// + [Parameter] + public bool Outlined + { + get { return this._outlined; } + set + { + if (this._outlined != value || !IsPropDirty("Outlined")) + { + MarkPropDirty("Outlined"); + } + this._outlined = value; + + } + } + private bool _singleSelect = false; + + partial void OnSingleSelectChanging(ref bool newValue); + /// + /// Enables single selection mode and moves item filtering to the main input. + /// + [Parameter] + public bool SingleSelect + { + get { return this._singleSelect; } + set + { + if (this._singleSelect != value || !IsPropDirty("SingleSelect")) + { + MarkPropDirty("SingleSelect"); + } + this._singleSelect = value; + + } + } + private bool _autofocus = false; + + partial void OnAutofocusChanging(ref bool newValue); + /// + /// The autofocus attribute of the control. + /// + [Parameter] + public bool Autofocus + { + get { return this._autofocus; } + set + { + if (this._autofocus != value || !IsPropDirty("Autofocus")) + { + MarkPropDirty("Autofocus"); + } + this._autofocus = value; + + } + } + private bool _autofocusList = false; + + partial void OnAutofocusListChanging(ref bool newValue); + /// + /// Focuses the list of options when the menu opens. + /// + [Parameter] + public bool AutofocusList + { + get { return this._autofocusList; } + set + { + if (this._autofocusList != value || !IsPropDirty("AutofocusList")) + { + MarkPropDirty("AutofocusList"); + } + this._autofocusList = value; + + } + } + private string _locale; + + partial void OnLocaleChanging(ref string newValue); + /// + /// Gets/Sets the locale used for getting language, affecting resource strings. + /// + [Parameter] + public string Locale + { + get { return this._locale; } + set + { + if (this._locale != value || !IsPropDirty("Locale")) + { + MarkPropDirty("Locale"); + } + this._locale = value; + + } + } + private string _label; + + partial void OnLabelChanging(ref string newValue); + /// + /// The label attribute of the control. + /// + [Parameter] + public string Label + { + get { return this._label; } + set + { + if (this._label != value || !IsPropDirty("Label")) + { + MarkPropDirty("Label"); + } + this._label = value; + + } + } + private string _placeholder; + + partial void OnPlaceholderChanging(ref string newValue); + /// + /// The placeholder attribute of the control. + /// + [Parameter] + public string Placeholder + { + get { return this._placeholder; } + set + { + if (this._placeholder != value || !IsPropDirty("Placeholder")) + { + MarkPropDirty("Placeholder"); + } + this._placeholder = value; + + } + } + private string _placeholderSearch; + + partial void OnPlaceholderSearchChanging(ref string newValue); + /// + /// The placeholder attribute of the search input. + /// + [Parameter] + public string PlaceholderSearch + { + get { return this._placeholderSearch; } + set + { + if (this._placeholderSearch != value || !IsPropDirty("PlaceholderSearch")) + { + MarkPropDirty("PlaceholderSearch"); + } + this._placeholderSearch = value; + + } + } + private string? _valueKey; + + partial void OnValueKeyChanging(ref string? newValue); + /// + /// The key in the data source used when selecting items. + /// + [Parameter] + public string? ValueKey + { + get { return this._valueKey; } + set + { + if (this._valueKey != value || !IsPropDirty("ValueKey")) + { + MarkPropDirty("ValueKey"); + } + this._valueKey = value; + + } + } + private string? _displayKey; + + partial void OnDisplayKeyChanging(ref string? newValue); + /// + /// The key in the data source used to display items in the list. + /// + [Parameter] + public string? DisplayKey + { + get { return this._displayKey; } + set + { + if (this._displayKey != value || !IsPropDirty("DisplayKey")) + { + MarkPropDirty("DisplayKey"); + } + this._displayKey = value; + + } + } + private string _groupKey; + + partial void OnGroupKeyChanging(ref string newValue); + /// + /// The key in the data source used to group items in the list. + /// + [Parameter] + public string GroupKey + { + get { return this._groupKey; } + set + { + if (this._groupKey != value || !IsPropDirty("GroupKey")) + { + MarkPropDirty("GroupKey"); + } + this._groupKey = value; + + } + } + private GroupingDirection _groupSorting = GroupingDirection.Asc; + + partial void OnGroupSortingChanging(ref GroupingDirection newValue); + /// + /// Sorts the items in each group by ascending or descending order. + /// + [Parameter] + public GroupingDirection GroupSorting + { + get { return this._groupSorting; } + set + { + if (this._groupSorting != value || !IsPropDirty("GroupSorting")) + { + MarkPropDirty("GroupSorting"); + } + this._groupSorting = value; + + } + } + private IgbFilteringOptions _filteringOptions; + + partial void OnFilteringOptionsChanging(ref IgbFilteringOptions newValue); + /// + /// An object that configures the filtering of the combo. + /// + [Parameter] + public IgbFilteringOptions FilteringOptions + { + get { return this._filteringOptions; } + set + { + OnFilteringOptionsChanging(ref value); + MarkPropDirty("FilteringOptions"); + if (this._filteringOptions != null) + { + this.DetachChild(this._filteringOptions); + } + if (value != null) + { + this.AttachChild(value); + } + this._filteringOptions = value; + } + + } + private bool _caseSensitiveIcon = false; + + partial void OnCaseSensitiveIconChanging(ref bool newValue); + /// + /// Enables the case sensitive search icon in the filtering input. + /// + [Parameter] + public bool CaseSensitiveIcon + { + get { return this._caseSensitiveIcon; } + set + { + if (this._caseSensitiveIcon != value || !IsPropDirty("CaseSensitiveIcon")) + { + MarkPropDirty("CaseSensitiveIcon"); + } + this._caseSensitiveIcon = value; + + } + } + private bool _disableFiltering = false; + + partial void OnDisableFilteringChanging(ref bool newValue); + /// + /// Disables the filtering of the list of options. + /// + [Parameter] + public bool DisableFiltering + { + get { return this._disableFiltering; } + set + { + if (this._disableFiltering != value || !IsPropDirty("DisableFiltering")) + { + MarkPropDirty("DisableFiltering"); + } + this._disableFiltering = value; + + } + } + private bool _disableClear = false; + + partial void OnDisableClearChanging(ref bool newValue); + /// + /// Hides the clear button. + /// + [Parameter] + public bool DisableClear + { + get { return this._disableClear; } + set + { + if (this._disableClear != value || !IsPropDirty("DisableClear")) + { + MarkPropDirty("DisableClear"); + } + this._disableClear = value; + + } + } + private T[] _value; + + partial void OnValueChanging(ref T[] newValue); + /// + /// Sets the value (selected items). The passed value must be a valid JSON array. + /// If the data source is an array of complex objects, the `valueKey` attribute must be set. + /// Note that when `displayKey` is not explicitly set, it will fall back to the value of `valueKey`. + /// + [Parameter] + public T[] Value + { + get { return this._value; } + set + { + if (this._value != value || !IsPropDirty("Value")) + { + MarkPropDirty("Value"); + } + this._value = value; + + } + } + public async Task GetCurrentValueAsync() + { + var iv = await InvokeMethod("p:Value", new object[] { }, new string[] { }); + return ReturnToObjectArray(iv).Cast().ToArray(); + } + public T[] GetCurrentValue() + { + var iv = InvokeMethodSync("p:Value", new object[] { }, new string[] { }); + return ReturnToObjectArray(iv).Cast().ToArray(); + } + private string _selectionRef; + public async Task GetSelectionAsync() + { + var iv = await InvokeMethod("p:Selection", new object[] { }, new string[] { }); + return ReturnToObjectArray(iv); + } + public object[] GetSelection() + { + var iv = InvokeMethodSync("p:Selection", new object[] { }, new string[] { }); + return ReturnToObjectArray(iv); + } + private bool _disabled = false; + + partial void OnDisabledChanging(ref bool newValue); + /// + /// The disabled state of the component + /// + [Parameter] + public bool Disabled + { + get { return this._disabled; } + set + { + if (this._disabled != value || !IsPropDirty("Disabled")) + { + MarkPropDirty("Disabled"); + } + this._disabled = value; + + } + } + private bool _required = false; + + partial void OnRequiredChanging(ref bool newValue); + /// + /// Makes the control a required field in a form context. + /// + [Parameter] + public bool Required + { + get { return this._required; } + set + { + if (this._required != value || !IsPropDirty("Required")) + { + MarkPropDirty("Required"); + } + this._required = value; + + } + } + private bool _invalid = false; + + partial void OnInvalidChanging(ref bool newValue); + /// + /// Control the validity of the control. + /// + [Parameter] + public bool Invalid + { + get { return this._invalid; } + set + { + if (this._invalid != value || !IsPropDirty("Invalid")) + { + MarkPropDirty("Invalid"); + } + this._invalid = value; + + } + } + private string _itemTemplateRef; + private RenderFragment _itemTemplate; + + partial void OnItemTemplateChanging(ref RenderFragment newValue); + [Parameter] + public RenderFragment ItemTemplate + { + get { return this._itemTemplate; } + + set + { + var oldValue = this._itemTemplate; + OnItemTemplateChanging(ref value); + if (oldValue != value || !IsPropDirty("ItemTemplate")) + { + MarkPropDirty("ItemTemplate"); + this._itemTemplate = value; + this._itemTemplateTemplateId = Guid.NewGuid().ToString(); + this.UpdateTemplate(this._itemTemplateTemplateId, this._itemTemplate, typeof(object)); + this.OnRefChanged("ItemTemplate", null, "template:::" + this._itemTemplateTemplateId, true, false, (string refName, object old, object newValue) => + { + this._itemTemplateRef = refName; + this.MarkPropDirty("ItemTemplateRef"); + }); + } + } + } + + private string _itemTemplateTemplateId; + private string _itemTemplateScript; + + ///Provides a means of setting ItemTemplate in the JavaScript environment. + [Parameter] + public string ItemTemplateScript + { + get { return _itemTemplateScript; } + + set + { + var oldValue = this._itemTemplateScript; + if (oldValue != value || !IsPropDirty("ItemTemplate")) + { + this._itemTemplateScript = value; + MarkPropDirty("ItemTemplate"); + this.OnRefChanged("ItemTemplate", oldValue, value, true, false, (string refName, object old, object newValue) => + { + this._itemTemplateRef = refName; + this.MarkPropDirty("ItemTemplateRef"); + }); + } + } + } + private string _groupHeaderTemplateRef; + private RenderFragment _groupHeaderTemplate; + + partial void OnGroupHeaderTemplateChanging(ref RenderFragment newValue); + [Parameter] + public RenderFragment GroupHeaderTemplate + { + get { return this._groupHeaderTemplate; } + + set + { + var oldValue = this._groupHeaderTemplate; + OnGroupHeaderTemplateChanging(ref value); + if (oldValue != value || !IsPropDirty("GroupHeaderTemplate")) + { + MarkPropDirty("GroupHeaderTemplate"); + this._groupHeaderTemplate = value; + this._groupHeaderTemplateTemplateId = Guid.NewGuid().ToString(); + this.UpdateTemplate(this._groupHeaderTemplateTemplateId, this._groupHeaderTemplate, typeof(object)); + this.OnRefChanged("GroupHeaderTemplate", null, "template:::" + this._groupHeaderTemplateTemplateId, true, false, (string refName, object old, object newValue) => + { + this._groupHeaderTemplateRef = refName; + this.MarkPropDirty("GroupHeaderTemplateRef"); + }); + } + } + } + + private string _groupHeaderTemplateTemplateId; + private string _groupHeaderTemplateScript; + + ///Provides a means of setting GroupHeaderTemplate in the JavaScript environment. + [Parameter] + public string GroupHeaderTemplateScript + { + get { return _groupHeaderTemplateScript; } + + set + { + var oldValue = this._groupHeaderTemplateScript; + if (oldValue != value || !IsPropDirty("GroupHeaderTemplate")) + { + this._groupHeaderTemplateScript = value; + MarkPropDirty("GroupHeaderTemplate"); + this.OnRefChanged("GroupHeaderTemplate", oldValue, value, true, false, (string refName, object old, object newValue) => + { + this._groupHeaderTemplateRef = refName; + this.MarkPropDirty("GroupHeaderTemplateRef"); + }); + } + } + } + + partial void FindByNameCombo(string name, ref object item); + public override object FindByName(string name) + { + + var baseResult = base.FindByName(name); + if (baseResult != null) + { + return baseResult; + } + + object item = null; + FindByNameCombo(name, ref item); + if (item != null) + { + return item; + } + + return null; + } + /// + /// Sets focus on the component. + /// + + [WCWidgetMemberName("Focus")] + public async Task FocusComponentAsync(IgbFocusOptions options) + { + await InvokeMethod("focus", new object[] { ObjectToParam(options) }, new string[] { "Json" }); + } + + [WCWidgetMemberName("Focus")] + public void FocusComponent(IgbFocusOptions options) + { + InvokeMethodSync("focus", new object[] { ObjectToParam(options) }, new string[] { "Json" }); + } + /// + /// Removes focus from the component. + /// + + [WCWidgetMemberName("Blur")] + public async Task BlurComponentAsync() + { + await InvokeMethod("blur", new object[] { }, new string[] { }); + } + + [WCWidgetMemberName("Blur")] + public void BlurComponent() + { + InvokeMethodSync("blur", new object[] { }, new string[] { }); + } + public async Task SelectAsync(object[] items) + { + await InvokeMethod("select", new object[] { ObjectArrayToParam(items) }, new string[] { "" }); + } + public void Select(object[] items) + { + InvokeMethodSync("select", new object[] { ObjectArrayToParam(items) }, new string[] { "" }); + } + public async Task DeselectAsync(object[] items) + { + await InvokeMethod("deselect", new object[] { ObjectArrayToParam(items) }, new string[] { "" }); + } + public void Deselect(object[] items) + { + InvokeMethodSync("deselect", new object[] { ObjectArrayToParam(items) }, new string[] { "" }); + } + /// + /// Checks for validity of the control and shows the browser message if it invalid. + /// + public async Task ReportValidityAsync() + { + await InvokeMethod("reportValidity", new object[] { }, new string[] { }); + } + public void ReportValidity() + { + InvokeMethodSync("reportValidity", new object[] { }, new string[] { }); + } + /// + /// Checks for validity of the control and emits the invalid event if it invalid. + /// + public async Task CheckValidityAsync() + { + await InvokeMethod("checkValidity", new object[] { }, new string[] { }); + } + public void CheckValidity() + { + InvokeMethodSync("checkValidity", new object[] { }, new string[] { }); + } + /// + /// Sets a custom validation message for the control. + /// As long as `message` is not empty, the control is considered invalid. + /// + public async Task SetCustomValidityAsync(String message) + { + await InvokeMethod("setCustomValidity", new object[] { StringToString(message) }, new string[] { "String" }); + } + public void SetCustomValidity(String message) + { + InvokeMethodSync("setCustomValidity", new object[] { StringToString(message) }, new string[] { "String" }); + } + + private EventCallback? _valueChanged = null; + [Parameter] + public EventCallback ValueChanged + { + get + { + return this._valueChanged != null ? this._valueChanged.Value : EventCallback.Empty; + } + set + { + if (!value.Equals(EventCallback.Empty)) + { + if (!CompareEventCallbacks(value, _valueChanged, ref eventCallbacksCache)) + { + this.EnsureChangeHandled(); + + _valueChanged = value; + } + } + else + { + _valueChanged = null; + } + } + } + + private string _changeRef = null; + private string _changeScript = null; + [Parameter] + public string ChangeScript + { + + set + { + if (value != this._changeScript) + { + this._changeScript = value; + this.OnRefChanged("Change", null, value, true, false, (string refName, object oldValue, object newValue) => + { + this._changeRef = refName; + this.MarkPropDirty("ChangeRef"); + }); + } + } + get + { + return this._changeScript; + } + } + + partial void OnHandlingChange(IgbComboChangeEventArgs args); + private EventCallback? _change = null; + [Parameter] + public EventCallback Change + { + get + { + return this._change != null ? this._change.Value : EventCallback.Empty; + } + set + { + if (!value.Equals(EventCallback.Empty)) + { + if (!CompareEventCallbacks(value, _change, ref eventCallbacksCache)) + { + _change = value; + this.SetHandler(this.Name, "Change", value, (args) => + { + OnHandlingChange(args); + + var newValueValue = default(T[]); + + { + newValueValue = (T[])(DowncastArray(args.Detail.NewValue)); + ; + OnEventUpdatingValue(this._value, ref newValueValue); + if (UseDirectRender) + { + //TODO: maybe we should be doing this for everything. Need to make sure we don't infinity bounce though. + this.Value = newValueValue; + } + else + { + this._value = newValueValue; + } + OnPropertyPropagatedOut(Name, "Value"); + } + + if (!EventCallback.Empty.Equals(ValueChanged)) + { + var task = ValueChanged.InvokeAsync(newValueValue); + if (task.Exception != null) { - if (!IgbComboModule.IsLoadRequested(IgBlazor)) - { - IgbComboModule.Register(IgBlazor); - } + throw task.Exception; } + } - protected override string ResolveDisplay() + }); + this.OnRefChanged("Change", null, "event:::Change", true, false, (refName, oldValue, newValue) => { - return "inline-block"; - } + this._changeRef = refName; + this.MarkPropDirty("ChangeRef"); + }); + } + } + else + { + _change = null; + this.SetHandler(this.Name, "Change", null); + this.OnRefChanged("Change", null, null, true, false, (refName, oldValue, newValue) => + { + this._changeRef = null; + this.MarkPropDirty("ChangeRef"); + }); + } + } + } + internal void EnsureChangeHandled() + { + if (EventCallback.Empty.Equals(this.Change)) + { + this.Change = new EventCallback(null, (Action)((e) => { })); + this._change = null; + } + } - protected override bool SupportsVisualChildren + private string _focusRef = null; + private string _focusScript = null; + [Parameter] + public string FocusScript + { + + set + { + if (value != this._focusScript) + { + this._focusScript = value; + this.OnRefChanged("Focus", null, value, true, false, (string refName, object oldValue, object newValue) => + { + this._focusRef = refName; + this.MarkPropDirty("FocusRef"); + }); + } + } + get + { + return this._focusScript; + } + } + + partial void OnHandlingFocus(IgbVoidEventArgs args); + private EventCallback? _focus = null; + [Parameter] + public EventCallback Focus + { + get + { + return this._focus != null ? this._focus.Value : EventCallback.Empty; + } + set + { + if (!value.Equals(EventCallback.Empty)) + { + if (!CompareEventCallbacks(value, _focus, ref eventCallbacksCache)) + { + _focus = value; + this.SetHandler(this.Name, "Focus", value, (args) => { - get - { - return true; - } - } - - public IgbCombo(): base() { - OnCreatedIgbCombo(); - - - } - - partial void OnCreatedIgbCombo(); - - private string _dataRef; - private Object _data; - - partial void OnDataChanging(ref Object newValue); - /// - /// The data source used to generate the list of options. - /// - [Parameter] - public Object Data - { - get { return this._data; } - - set { - var oldValue = this._data; - OnDataChanging(ref value); - - - if (oldValue != value || !IsPropDirty("Data")) - { - MarkPropDirty("Data"); - this._data = value; - this.OnRefChanged("Data", oldValue, value, false, false, (string refName, object old, object newValue) => { - this._dataRef = refName; - this.MarkPropDirty("DataRef"); - }); - } - } - } - - - private string _dataScript; - - - ///Provides a means of setting Data in the JavaScript environment. - [Parameter] - public string DataScript - { - get { return _dataScript; } - - - set { - var oldValue = this._dataScript; - if (oldValue != value || !IsPropDirty("Data")) - { - this._dataScript = value; - MarkPropDirty("Data"); - this.OnRefChanged("Data", oldValue, value, true, false, (string refName, object old, object newValue) => { - this._dataRef = refName; - this.MarkPropDirty("DataRef"); - }); - } - } - } - private bool _outlined = false; - - partial void OnOutlinedChanging(ref bool newValue); - /// - /// The outlined attribute of the control. - /// - [Parameter] - public bool Outlined - { - get { return this._outlined; } - set { - if (this._outlined != value || !IsPropDirty("Outlined")) { - MarkPropDirty("Outlined"); - } - this._outlined = value; - - } - } - private bool _singleSelect = false; - - partial void OnSingleSelectChanging(ref bool newValue); - /// - /// Enables single selection mode and moves item filtering to the main input. - /// - [Parameter] - public bool SingleSelect - { - get { return this._singleSelect; } - set { - if (this._singleSelect != value || !IsPropDirty("SingleSelect")) { - MarkPropDirty("SingleSelect"); - } - this._singleSelect = value; - - } - } - private bool _autofocus = false; - - partial void OnAutofocusChanging(ref bool newValue); - /// - /// The autofocus attribute of the control. - /// - [Parameter] - public bool Autofocus - { - get { return this._autofocus; } - set { - if (this._autofocus != value || !IsPropDirty("Autofocus")) { - MarkPropDirty("Autofocus"); - } - this._autofocus = value; - - } - } - private bool _autofocusList = false; - - partial void OnAutofocusListChanging(ref bool newValue); - /// - /// Focuses the list of options when the menu opens. - /// - [Parameter] - public bool AutofocusList - { - get { return this._autofocusList; } - set { - if (this._autofocusList != value || !IsPropDirty("AutofocusList")) { - MarkPropDirty("AutofocusList"); - } - this._autofocusList = value; - - } - } - private string _locale; - - partial void OnLocaleChanging(ref string newValue); - /// - /// Gets/Sets the locale used for getting language, affecting resource strings. - /// - [Parameter] - public string Locale - { - get { return this._locale; } - set { - if (this._locale != value || !IsPropDirty("Locale")) { - MarkPropDirty("Locale"); - } - this._locale = value; - - } - } - private string _label; - - partial void OnLabelChanging(ref string newValue); - /// - /// The label attribute of the control. - /// - [Parameter] - public string Label - { - get { return this._label; } - set { - if (this._label != value || !IsPropDirty("Label")) { - MarkPropDirty("Label"); - } - this._label = value; - - } - } - private string _placeholder; - - partial void OnPlaceholderChanging(ref string newValue); - /// - /// The placeholder attribute of the control. - /// - [Parameter] - public string Placeholder - { - get { return this._placeholder; } - set { - if (this._placeholder != value || !IsPropDirty("Placeholder")) { - MarkPropDirty("Placeholder"); - } - this._placeholder = value; - - } - } - private string _placeholderSearch; - - partial void OnPlaceholderSearchChanging(ref string newValue); - /// - /// The placeholder attribute of the search input. - /// - [Parameter] - public string PlaceholderSearch - { - get { return this._placeholderSearch; } - set { - if (this._placeholderSearch != value || !IsPropDirty("PlaceholderSearch")) { - MarkPropDirty("PlaceholderSearch"); - } - this._placeholderSearch = value; - - } - } - private string? _valueKey; - - partial void OnValueKeyChanging(ref string? newValue); - /// - /// The key in the data source used when selecting items. - /// - [Parameter] - public string? ValueKey - { - get { return this._valueKey; } - set { - if (this._valueKey != value || !IsPropDirty("ValueKey")) { - MarkPropDirty("ValueKey"); - } - this._valueKey = value; - - } - } - private string? _displayKey; - - partial void OnDisplayKeyChanging(ref string? newValue); - /// - /// The key in the data source used to display items in the list. - /// - [Parameter] - public string? DisplayKey - { - get { return this._displayKey; } - set { - if (this._displayKey != value || !IsPropDirty("DisplayKey")) { - MarkPropDirty("DisplayKey"); - } - this._displayKey = value; - - } - } - private string _groupKey; - - partial void OnGroupKeyChanging(ref string newValue); - /// - /// The key in the data source used to group items in the list. - /// - [Parameter] - public string GroupKey - { - get { return this._groupKey; } - set { - if (this._groupKey != value || !IsPropDirty("GroupKey")) { - MarkPropDirty("GroupKey"); - } - this._groupKey = value; - - } - } - private GroupingDirection _groupSorting = GroupingDirection.Asc; - - partial void OnGroupSortingChanging(ref GroupingDirection newValue); - /// - /// Sorts the items in each group by ascending or descending order. - /// - [Parameter] - public GroupingDirection GroupSorting - { - get { return this._groupSorting; } - set { - if (this._groupSorting != value || !IsPropDirty("GroupSorting")) { - MarkPropDirty("GroupSorting"); - } - this._groupSorting = value; - - } - } - private IgbFilteringOptions _filteringOptions; - - partial void OnFilteringOptionsChanging(ref IgbFilteringOptions newValue); - /// - /// An object that configures the filtering of the combo. - /// - [Parameter] - public IgbFilteringOptions FilteringOptions - { - get { return this._filteringOptions; } - set { - OnFilteringOptionsChanging(ref value); - MarkPropDirty("FilteringOptions"); - if (this._filteringOptions != null) { - this.DetachChild(this._filteringOptions); - } - if (value != null) { - this.AttachChild(value); - } - this._filteringOptions = value; - } - - } - private bool _caseSensitiveIcon = false; - - partial void OnCaseSensitiveIconChanging(ref bool newValue); - /// - /// Enables the case sensitive search icon in the filtering input. - /// - [Parameter] - public bool CaseSensitiveIcon - { - get { return this._caseSensitiveIcon; } - set { - if (this._caseSensitiveIcon != value || !IsPropDirty("CaseSensitiveIcon")) { - MarkPropDirty("CaseSensitiveIcon"); - } - this._caseSensitiveIcon = value; - - } - } - private bool _disableFiltering = false; - - partial void OnDisableFilteringChanging(ref bool newValue); - /// - /// Disables the filtering of the list of options. - /// - [Parameter] - public bool DisableFiltering - { - get { return this._disableFiltering; } - set { - if (this._disableFiltering != value || !IsPropDirty("DisableFiltering")) { - MarkPropDirty("DisableFiltering"); - } - this._disableFiltering = value; - - } - } - private bool _disableClear = false; - - partial void OnDisableClearChanging(ref bool newValue); - /// - /// Hides the clear button. - /// - [Parameter] - public bool DisableClear - { - get { return this._disableClear; } - set { - if (this._disableClear != value || !IsPropDirty("DisableClear")) { - MarkPropDirty("DisableClear"); - } - this._disableClear = value; - - } - } - private T[] _value; - - partial void OnValueChanging(ref T[] newValue); - /// - /// Sets the value (selected items). The passed value must be a valid JSON array. - /// If the data source is an array of complex objects, the `valueKey` attribute must be set. - /// Note that when `displayKey` is not explicitly set, it will fall back to the value of `valueKey`. - /// - [Parameter] - public T[] Value - { - get { return this._value; } - set { - if (this._value != value || !IsPropDirty("Value")) { - MarkPropDirty("Value"); - } - this._value = value; - - } - } - public async Task GetCurrentValueAsync() - { - var iv = await InvokeMethod("p:Value", new object[] { }, new string[] { }); - return ReturnToObjectArray(iv).Cast().ToArray(); - } - public T[] GetCurrentValue() - { - var iv = InvokeMethodSync("p:Value", new object[] { }, new string[] { }); - return ReturnToObjectArray(iv).Cast().ToArray(); - } - private string _selectionRef; - public async Task GetSelectionAsync() - { - var iv = await InvokeMethod("p:Selection", new object[] { }, new string[] { }); - return ReturnToObjectArray(iv); - } - public object[] GetSelection() - { - var iv = InvokeMethodSync("p:Selection", new object[] { }, new string[] { }); - return ReturnToObjectArray(iv); - } - private bool _disabled = false; - - partial void OnDisabledChanging(ref bool newValue); - /// - /// The disabled state of the component - /// - [Parameter] - public bool Disabled - { - get { return this._disabled; } - set { - if (this._disabled != value || !IsPropDirty("Disabled")) { - MarkPropDirty("Disabled"); - } - this._disabled = value; - - } - } - private bool _required = false; - - partial void OnRequiredChanging(ref bool newValue); - /// - /// Makes the control a required field in a form context. - /// - [Parameter] - public bool Required - { - get { return this._required; } - set { - if (this._required != value || !IsPropDirty("Required")) { - MarkPropDirty("Required"); - } - this._required = value; - - } - } - private bool _invalid = false; - - partial void OnInvalidChanging(ref bool newValue); - /// - /// Control the validity of the control. - /// - [Parameter] - public bool Invalid - { - get { return this._invalid; } - set { - if (this._invalid != value || !IsPropDirty("Invalid")) { - MarkPropDirty("Invalid"); - } - this._invalid = value; - - } - } - private string _itemTemplateRef; - private RenderFragment _itemTemplate; - - partial void OnItemTemplateChanging(ref RenderFragment newValue); - [Parameter] - public RenderFragment ItemTemplate - { - get { return this._itemTemplate; } - - set { - var oldValue = this._itemTemplate; - OnItemTemplateChanging(ref value); - if (oldValue != value || !IsPropDirty("ItemTemplate")) - { - MarkPropDirty("ItemTemplate"); - this._itemTemplate = value; - this._itemTemplateTemplateId = Guid.NewGuid().ToString(); - this.UpdateTemplate(this._itemTemplateTemplateId, this._itemTemplate, typeof(object)); - this.OnRefChanged("ItemTemplate", null, "template:::" + this._itemTemplateTemplateId, true, false, (string refName, object old, object newValue) => { - this._itemTemplateRef = refName; - this.MarkPropDirty("ItemTemplateRef"); - }); - } - } - } - - - private string _itemTemplateTemplateId; - private string _itemTemplateScript; - - - ///Provides a means of setting ItemTemplate in the JavaScript environment. - [Parameter] - public string ItemTemplateScript - { - get { return _itemTemplateScript; } - - - set { - var oldValue = this._itemTemplateScript; - if (oldValue != value || !IsPropDirty("ItemTemplate")) - { - this._itemTemplateScript = value; - MarkPropDirty("ItemTemplate"); - this.OnRefChanged("ItemTemplate", oldValue, value, true, false, (string refName, object old, object newValue) => { - this._itemTemplateRef = refName; - this.MarkPropDirty("ItemTemplateRef"); - }); - } - } - } - private string _groupHeaderTemplateRef; - private RenderFragment _groupHeaderTemplate; - - partial void OnGroupHeaderTemplateChanging(ref RenderFragment newValue); - [Parameter] - public RenderFragment GroupHeaderTemplate - { - get { return this._groupHeaderTemplate; } - - set { - var oldValue = this._groupHeaderTemplate; - OnGroupHeaderTemplateChanging(ref value); - if (oldValue != value || !IsPropDirty("GroupHeaderTemplate")) - { - MarkPropDirty("GroupHeaderTemplate"); - this._groupHeaderTemplate = value; - this._groupHeaderTemplateTemplateId = Guid.NewGuid().ToString(); - this.UpdateTemplate(this._groupHeaderTemplateTemplateId, this._groupHeaderTemplate, typeof(object)); - this.OnRefChanged("GroupHeaderTemplate", null, "template:::" + this._groupHeaderTemplateTemplateId, true, false, (string refName, object old, object newValue) => { - this._groupHeaderTemplateRef = refName; - this.MarkPropDirty("GroupHeaderTemplateRef"); - }); - } - } - } - - - private string _groupHeaderTemplateTemplateId; - private string _groupHeaderTemplateScript; - - - ///Provides a means of setting GroupHeaderTemplate in the JavaScript environment. - [Parameter] - public string GroupHeaderTemplateScript - { - get { return _groupHeaderTemplateScript; } - - - set { - var oldValue = this._groupHeaderTemplateScript; - if (oldValue != value || !IsPropDirty("GroupHeaderTemplate")) - { - this._groupHeaderTemplateScript = value; - MarkPropDirty("GroupHeaderTemplate"); - this.OnRefChanged("GroupHeaderTemplate", oldValue, value, true, false, (string refName, object old, object newValue) => { - this._groupHeaderTemplateRef = refName; - this.MarkPropDirty("GroupHeaderTemplateRef"); - }); - } - } - } - - partial void FindByNameCombo(string name, ref object item); - public override object FindByName(string name) - { - - var baseResult = base.FindByName(name); - if (baseResult != null) - { - return baseResult; - } - - object item = null; - FindByNameCombo(name, ref item); - if (item != null) - { - return item; - } - - return null; - } - /// - /// Sets focus on the component. - /// - - [WCWidgetMemberName("Focus")] - public async Task FocusComponentAsync(IgbFocusOptions options) - { - await InvokeMethod("focus", new object[] { ObjectToParam(options) }, new string[] { "Json" }); - } - - [WCWidgetMemberName("Focus")] - public void FocusComponent(IgbFocusOptions options) - { - InvokeMethodSync("focus", new object[] { ObjectToParam(options) }, new string[] { "Json" }); - } - /// - /// Removes focus from the component. - /// - - [WCWidgetMemberName("Blur")] - public async Task BlurComponentAsync() - { - await InvokeMethod("blur", new object[] { }, new string[] { }); - } - - [WCWidgetMemberName("Blur")] - public void BlurComponent() - { - InvokeMethodSync("blur", new object[] { }, new string[] { }); - } - public async Task SelectAsync(object[] items) - { - await InvokeMethod("select", new object[] { ObjectArrayToParam(items) }, new string[] { "" }); - } - public void Select(object[] items) - { - InvokeMethodSync("select", new object[] { ObjectArrayToParam(items) }, new string[] { "" }); - } - public async Task DeselectAsync(object[] items) - { - await InvokeMethod("deselect", new object[] { ObjectArrayToParam(items) }, new string[] { "" }); - } - public void Deselect(object[] items) - { - InvokeMethodSync("deselect", new object[] { ObjectArrayToParam(items) }, new string[] { "" }); - } - /// - /// Checks for validity of the control and shows the browser message if it invalid. - /// - public async Task ReportValidityAsync() - { - await InvokeMethod("reportValidity", new object[] { }, new string[] { }); - } - public void ReportValidity() - { - InvokeMethodSync("reportValidity", new object[] { }, new string[] { }); - } - /// - /// Checks for validity of the control and emits the invalid event if it invalid. - /// - public async Task CheckValidityAsync() - { - await InvokeMethod("checkValidity", new object[] { }, new string[] { }); - } - public void CheckValidity() - { - InvokeMethodSync("checkValidity", new object[] { }, new string[] { }); - } - /// - /// Sets a custom validation message for the control. - /// As long as `message` is not empty, the control is considered invalid. - /// - public async Task SetCustomValidityAsync(String message) - { - await InvokeMethod("setCustomValidity", new object[] { StringToString(message) }, new string[] { "String" }); - } - public void SetCustomValidity(String message) - { - InvokeMethodSync("setCustomValidity", new object[] { StringToString(message) }, new string[] { "String" }); - } - - private EventCallback? _valueChanged = null; - [Parameter] - public EventCallback ValueChanged - { - get - { - return this._valueChanged != null ? this._valueChanged.Value : EventCallback.Empty; - } - set - { - if (!value.Equals(EventCallback.Empty)) - { - if (!CompareEventCallbacks(value, _valueChanged, ref eventCallbacksCache)) - { - this.EnsureChangeHandled(); - - _valueChanged = value; - } - } - else - { - _valueChanged = null; - } - } - } - - private string _changeRef = null; - private string _changeScript = null; - [Parameter] - public string ChangeScript { - - set - { - if (value != this._changeScript) - { - this._changeScript = value; - this.OnRefChanged("Change", null, value, true, false, (string refName, object oldValue, object newValue) => { - this._changeRef = refName; - this.MarkPropDirty("ChangeRef"); - }); - } - } - get - { - return this._changeScript; - } - } - - partial void OnHandlingChange(IgbComboChangeEventArgs args); - private EventCallback? _change = null; - [Parameter] - public EventCallback Change - { - get - { - return this._change != null ? this._change.Value : EventCallback.Empty; - } - set - { - if (!value.Equals(EventCallback.Empty)) - { - if (!CompareEventCallbacks(value, _change, ref eventCallbacksCache)) - { - _change = value; - this.SetHandler(this.Name, "Change", value, (args) => { - OnHandlingChange(args); - - var newValueValue = default(T[]); - - - { - newValueValue = (T[])(DowncastArray(args.Detail.NewValue)); - ; - OnEventUpdatingValue(this._value, ref newValueValue); - if (UseDirectRender) { - //TODO: maybe we should be doing this for everything. Need to make sure we don't infinity bounce though. - this.Value = newValueValue; - } else { - this._value = newValueValue; - } - OnPropertyPropagatedOut(Name, "Value"); - } - - if (!EventCallback.Empty.Equals(ValueChanged)) - { - var task = ValueChanged.InvokeAsync(newValueValue); - if (task.Exception != null) - { - throw task.Exception; - } - } - - }); - this.OnRefChanged("Change", null, "event:::Change", true, false, (refName, oldValue, newValue) => { - this._changeRef = refName; - this.MarkPropDirty("ChangeRef"); - }); - } - } - else - { - _change = null; - this.SetHandler(this.Name, "Change", null); - this.OnRefChanged("Change", null, null, true, false, (refName, oldValue, newValue) => { - this._changeRef = null; - this.MarkPropDirty("ChangeRef"); - }); - } - } - } - internal void EnsureChangeHandled() - { - if (EventCallback.Empty.Equals(this.Change)) - { - this.Change = new EventCallback(null, (Action)((e) => { })); this._change = null; - } - } - - - private string _focusRef = null; - private string _focusScript = null; - [Parameter] - public string FocusScript { - - set - { - if (value != this._focusScript) - { - this._focusScript = value; - this.OnRefChanged("Focus", null, value, true, false, (string refName, object oldValue, object newValue) => { - this._focusRef = refName; - this.MarkPropDirty("FocusRef"); - }); - } - } - get - { - return this._focusScript; - } - } - - partial void OnHandlingFocus(IgbVoidEventArgs args); - private EventCallback? _focus = null; - [Parameter] - public EventCallback Focus - { - get - { - return this._focus != null ? this._focus.Value : EventCallback.Empty; - } - set - { - if (!value.Equals(EventCallback.Empty)) - { - if (!CompareEventCallbacks(value, _focus, ref eventCallbacksCache)) - { - _focus = value; - this.SetHandler(this.Name, "Focus", value, (args) => { - OnHandlingFocus(args); - - }); - this.OnRefChanged("Focus", null, "nativeEvent:::Focus", true, false, (refName, oldValue, newValue) => { - this._focusRef = refName; - this.MarkPropDirty("FocusRef"); - }); - } - } - else - { - _focus = null; - this.SetHandler(this.Name, "Focus", null); - this.OnRefChanged("Focus", null, null, true, false, (refName, oldValue, newValue) => { - this._focusRef = null; - this.MarkPropDirty("FocusRef"); - }); - } - } - } - - private string _blurRef = null; - private string _blurScript = null; - [Parameter] - public string BlurScript { - - set - { - if (value != this._blurScript) - { - this._blurScript = value; - this.OnRefChanged("Blur", null, value, true, false, (string refName, object oldValue, object newValue) => { - this._blurRef = refName; - this.MarkPropDirty("BlurRef"); - }); - } - } - get - { - return this._blurScript; - } - } - - partial void OnHandlingBlur(IgbVoidEventArgs args); - private EventCallback? _blur = null; - [Parameter] - public EventCallback Blur - { - get - { - return this._blur != null ? this._blur.Value : EventCallback.Empty; - } - set - { - if (!value.Equals(EventCallback.Empty)) - { - if (!CompareEventCallbacks(value, _blur, ref eventCallbacksCache)) - { - _blur = value; - this.SetHandler(this.Name, "Blur", value, (args) => { - OnHandlingBlur(args); - - }); - this.OnRefChanged("Blur", null, "nativeEvent:::Blur", true, false, (refName, oldValue, newValue) => { - this._blurRef = refName; - this.MarkPropDirty("BlurRef"); - }); - } - } - else - { - _blur = null; - this.SetHandler(this.Name, "Blur", null); - this.OnRefChanged("Blur", null, null, true, false, (refName, oldValue, newValue) => { - this._blurRef = null; - this.MarkPropDirty("BlurRef"); - }); - } - } - } - - private string _openingRef = null; - private string _openingScript = null; - [Parameter] - public string OpeningScript { - - set - { - if (value != this._openingScript) - { - this._openingScript = value; - this.OnRefChanged("Opening", null, value, true, false, (string refName, object oldValue, object newValue) => { - this._openingRef = refName; - this.MarkPropDirty("OpeningRef"); - }); - } - } - get - { - return this._openingScript; - } - } - - partial void OnHandlingOpening(IgbVoidEventArgs args); - private EventCallback? _opening = null; - [Parameter] - public EventCallback Opening - { - get - { - return this._opening != null ? this._opening.Value : EventCallback.Empty; - } - set - { - if (!value.Equals(EventCallback.Empty)) - { - if (!CompareEventCallbacks(value, _opening, ref eventCallbacksCache)) - { - _opening = value; - this.SetHandler(this.Name, "Opening", value, (args) => { - OnHandlingOpening(args); - - }); - this.OnRefChanged("Opening", null, "event:::Opening", true, false, (refName, oldValue, newValue) => { - this._openingRef = refName; - this.MarkPropDirty("OpeningRef"); - }); - } - } - else - { - _opening = null; - this.SetHandler(this.Name, "Opening", null); - this.OnRefChanged("Opening", null, null, true, false, (refName, oldValue, newValue) => { - this._openingRef = null; - this.MarkPropDirty("OpeningRef"); - }); - } - } - } - - private string _openedRef = null; - private string _openedScript = null; - [Parameter] - public string OpenedScript { - - set - { - if (value != this._openedScript) - { - this._openedScript = value; - this.OnRefChanged("Opened", null, value, true, false, (string refName, object oldValue, object newValue) => { - this._openedRef = refName; - this.MarkPropDirty("OpenedRef"); - }); - } - } - get - { - return this._openedScript; - } - } - - partial void OnHandlingOpened(IgbVoidEventArgs args); - private EventCallback? _opened = null; - [Parameter] - public EventCallback Opened - { - get - { - return this._opened != null ? this._opened.Value : EventCallback.Empty; - } - set - { - if (!value.Equals(EventCallback.Empty)) - { - if (!CompareEventCallbacks(value, _opened, ref eventCallbacksCache)) - { - _opened = value; - this.SetHandler(this.Name, "Opened", value, (args) => { - OnHandlingOpened(args); - - }); - this.OnRefChanged("Opened", null, "event:::Opened", true, false, (refName, oldValue, newValue) => { - this._openedRef = refName; - this.MarkPropDirty("OpenedRef"); - }); - } - } - else - { - _opened = null; - this.SetHandler(this.Name, "Opened", null); - this.OnRefChanged("Opened", null, null, true, false, (refName, oldValue, newValue) => { - this._openedRef = null; - this.MarkPropDirty("OpenedRef"); - }); - } - } - } - - private string _closingRef = null; - private string _closingScript = null; - [Parameter] - public string ClosingScript { - - set - { - if (value != this._closingScript) - { - this._closingScript = value; - this.OnRefChanged("Closing", null, value, true, false, (string refName, object oldValue, object newValue) => { - this._closingRef = refName; - this.MarkPropDirty("ClosingRef"); - }); - } - } - get - { - return this._closingScript; - } - } - - partial void OnHandlingClosing(IgbVoidEventArgs args); - private EventCallback? _closing = null; - [Parameter] - public EventCallback Closing - { - get - { - return this._closing != null ? this._closing.Value : EventCallback.Empty; - } - set - { - if (!value.Equals(EventCallback.Empty)) - { - if (!CompareEventCallbacks(value, _closing, ref eventCallbacksCache)) - { - _closing = value; - this.SetHandler(this.Name, "Closing", value, (args) => { - OnHandlingClosing(args); - - }); - this.OnRefChanged("Closing", null, "event:::Closing", true, false, (refName, oldValue, newValue) => { - this._closingRef = refName; - this.MarkPropDirty("ClosingRef"); - }); - } - } - else - { - _closing = null; - this.SetHandler(this.Name, "Closing", null); - this.OnRefChanged("Closing", null, null, true, false, (refName, oldValue, newValue) => { - this._closingRef = null; - this.MarkPropDirty("ClosingRef"); - }); - } - } - } - - private string _closedRef = null; - private string _closedScript = null; - [Parameter] - public string ClosedScript { - - set - { - if (value != this._closedScript) - { - this._closedScript = value; - this.OnRefChanged("Closed", null, value, true, false, (string refName, object oldValue, object newValue) => { - this._closedRef = refName; - this.MarkPropDirty("ClosedRef"); - }); - } - } - get - { - return this._closedScript; - } - } - - partial void OnHandlingClosed(IgbVoidEventArgs args); - private EventCallback? _closed = null; - [Parameter] - public EventCallback Closed - { - get - { - return this._closed != null ? this._closed.Value : EventCallback.Empty; - } - set - { - if (!value.Equals(EventCallback.Empty)) - { - if (!CompareEventCallbacks(value, _closed, ref eventCallbacksCache)) - { - _closed = value; - this.SetHandler(this.Name, "Closed", value, (args) => { - OnHandlingClosed(args); - - }); - this.OnRefChanged("Closed", null, "event:::Closed", true, false, (refName, oldValue, newValue) => { - this._closedRef = refName; - this.MarkPropDirty("ClosedRef"); - }); - } - } - else - { - _closed = null; - this.SetHandler(this.Name, "Closed", null); - this.OnRefChanged("Closed", null, null, true, false, (refName, oldValue, newValue) => { - this._closedRef = null; - this.MarkPropDirty("ClosedRef"); - }); - } - } - } - - partial void OnEventUpdatingValue(T[] oldValue, ref T[] newValue); - - partial void SerializeCoreIgbCombo(RendererSerializer ser); - - internal override void SerializeCore(RendererSerializer ser) - { - base.SerializeCore(ser); - - SerializeCoreIgbCombo(ser); - - if (IsPropDirty("DataRef")) { ser.AddStringProp("dataRef", this._dataRef); } - if (IsPropDirty("Outlined")) { ser.AddBooleanProp("outlined", this._outlined); } - if (IsPropDirty("SingleSelect")) { ser.AddBooleanProp("singleSelect", this._singleSelect); } - if (IsPropDirty("Autofocus")) { ser.AddBooleanProp("autofocus", this._autofocus); } - if (IsPropDirty("AutofocusList")) { ser.AddBooleanProp("autofocusList", this._autofocusList); } - if (IsPropDirty("Locale")) { ser.AddStringProp("locale", this._locale); } - if (IsPropDirty("Label")) { ser.AddStringProp("label", this._label); } - if (IsPropDirty("Placeholder")) { ser.AddStringProp("placeholder", this._placeholder); } - if (IsPropDirty("PlaceholderSearch")) { ser.AddStringProp("placeholderSearch", this._placeholderSearch); } - if (IsPropDirty("ValueKey")) { ser.AddStringProp("valueKey", this._valueKey); } - if (IsPropDirty("DisplayKey")) { ser.AddStringProp("displayKey", this._displayKey); } - if (IsPropDirty("GroupKey")) { ser.AddStringProp("groupKey", this._groupKey); } - if (IsPropDirty("GroupSorting")) { ser.AddEnumProp("groupSorting", this._groupSorting); } - if (IsPropDirty("FilteringOptions")) { ser.AddSerializableProp("filteringOptions", this._filteringOptions); } - if (IsPropDirty("CaseSensitiveIcon")) { ser.AddBooleanProp("caseSensitiveIcon", this._caseSensitiveIcon); } - if (IsPropDirty("DisableFiltering")) { ser.AddBooleanProp("disableFiltering", this._disableFiltering); } - if (IsPropDirty("DisableClear")) { ser.AddBooleanProp("disableClear", this._disableClear); } - if (IsPropDirty("Value")) { ser.AddArrayProp("value", this._value); } - if (IsPropDirty("Disabled")) { ser.AddBooleanProp("disabled", this._disabled); } - if (IsPropDirty("Required")) { ser.AddBooleanProp("required", this._required); } - if (IsPropDirty("Invalid")) { ser.AddBooleanProp("invalid", this._invalid); } - if (IsPropDirty("ItemTemplateRef")) { ser.AddStringProp("itemTemplateRef", this._itemTemplateRef); } - if (IsPropDirty("GroupHeaderTemplateRef")) { ser.AddStringProp("groupHeaderTemplateRef", this._groupHeaderTemplateRef); } - if (IsPropDirty("ChangeRef")) { ser.AddStringProp("changeRef", this._changeRef); } - if (IsPropDirty("FocusRef")) { ser.AddStringProp("focusRef", this._focusRef); } - if (IsPropDirty("BlurRef")) { ser.AddStringProp("blurRef", this._blurRef); } - if (IsPropDirty("OpeningRef")) { ser.AddStringProp("openingRef", this._openingRef); } - if (IsPropDirty("OpenedRef")) { ser.AddStringProp("openedRef", this._openedRef); } - if (IsPropDirty("ClosingRef")) { ser.AddStringProp("closingRef", this._closingRef); } - if (IsPropDirty("ClosedRef")) { ser.AddStringProp("closedRef", this._closedRef); } - - } - -} + OnHandlingFocus(args); + + }); + this.OnRefChanged("Focus", null, "nativeEvent:::Focus", true, false, (refName, oldValue, newValue) => + { + this._focusRef = refName; + this.MarkPropDirty("FocusRef"); + }); + } + } + else + { + _focus = null; + this.SetHandler(this.Name, "Focus", null); + this.OnRefChanged("Focus", null, null, true, false, (refName, oldValue, newValue) => + { + this._focusRef = null; + this.MarkPropDirty("FocusRef"); + }); + } + } + } + + private string _blurRef = null; + private string _blurScript = null; + [Parameter] + public string BlurScript + { + + set + { + if (value != this._blurScript) + { + this._blurScript = value; + this.OnRefChanged("Blur", null, value, true, false, (string refName, object oldValue, object newValue) => + { + this._blurRef = refName; + this.MarkPropDirty("BlurRef"); + }); + } + } + get + { + return this._blurScript; + } + } + + partial void OnHandlingBlur(IgbVoidEventArgs args); + private EventCallback? _blur = null; + [Parameter] + public EventCallback Blur + { + get + { + return this._blur != null ? this._blur.Value : EventCallback.Empty; + } + set + { + if (!value.Equals(EventCallback.Empty)) + { + if (!CompareEventCallbacks(value, _blur, ref eventCallbacksCache)) + { + _blur = value; + this.SetHandler(this.Name, "Blur", value, (args) => + { + OnHandlingBlur(args); + + }); + this.OnRefChanged("Blur", null, "nativeEvent:::Blur", true, false, (refName, oldValue, newValue) => + { + this._blurRef = refName; + this.MarkPropDirty("BlurRef"); + }); + } + } + else + { + _blur = null; + this.SetHandler(this.Name, "Blur", null); + this.OnRefChanged("Blur", null, null, true, false, (refName, oldValue, newValue) => + { + this._blurRef = null; + this.MarkPropDirty("BlurRef"); + }); + } + } + } + + private string _openingRef = null; + private string _openingScript = null; + [Parameter] + public string OpeningScript + { + + set + { + if (value != this._openingScript) + { + this._openingScript = value; + this.OnRefChanged("Opening", null, value, true, false, (string refName, object oldValue, object newValue) => + { + this._openingRef = refName; + this.MarkPropDirty("OpeningRef"); + }); + } + } + get + { + return this._openingScript; + } + } + + partial void OnHandlingOpening(IgbVoidEventArgs args); + private EventCallback? _opening = null; + [Parameter] + public EventCallback Opening + { + get + { + return this._opening != null ? this._opening.Value : EventCallback.Empty; + } + set + { + if (!value.Equals(EventCallback.Empty)) + { + if (!CompareEventCallbacks(value, _opening, ref eventCallbacksCache)) + { + _opening = value; + this.SetHandler(this.Name, "Opening", value, (args) => + { + OnHandlingOpening(args); + + }); + this.OnRefChanged("Opening", null, "event:::Opening", true, false, (refName, oldValue, newValue) => + { + this._openingRef = refName; + this.MarkPropDirty("OpeningRef"); + }); + } + } + else + { + _opening = null; + this.SetHandler(this.Name, "Opening", null); + this.OnRefChanged("Opening", null, null, true, false, (refName, oldValue, newValue) => + { + this._openingRef = null; + this.MarkPropDirty("OpeningRef"); + }); + } + } + } + + private string _openedRef = null; + private string _openedScript = null; + [Parameter] + public string OpenedScript + { + + set + { + if (value != this._openedScript) + { + this._openedScript = value; + this.OnRefChanged("Opened", null, value, true, false, (string refName, object oldValue, object newValue) => + { + this._openedRef = refName; + this.MarkPropDirty("OpenedRef"); + }); + } + } + get + { + return this._openedScript; + } + } + + partial void OnHandlingOpened(IgbVoidEventArgs args); + private EventCallback? _opened = null; + [Parameter] + public EventCallback Opened + { + get + { + return this._opened != null ? this._opened.Value : EventCallback.Empty; + } + set + { + if (!value.Equals(EventCallback.Empty)) + { + if (!CompareEventCallbacks(value, _opened, ref eventCallbacksCache)) + { + _opened = value; + this.SetHandler(this.Name, "Opened", value, (args) => + { + OnHandlingOpened(args); + + }); + this.OnRefChanged("Opened", null, "event:::Opened", true, false, (refName, oldValue, newValue) => + { + this._openedRef = refName; + this.MarkPropDirty("OpenedRef"); + }); + } + } + else + { + _opened = null; + this.SetHandler(this.Name, "Opened", null); + this.OnRefChanged("Opened", null, null, true, false, (refName, oldValue, newValue) => + { + this._openedRef = null; + this.MarkPropDirty("OpenedRef"); + }); + } + } + } + + private string _closingRef = null; + private string _closingScript = null; + [Parameter] + public string ClosingScript + { + + set + { + if (value != this._closingScript) + { + this._closingScript = value; + this.OnRefChanged("Closing", null, value, true, false, (string refName, object oldValue, object newValue) => + { + this._closingRef = refName; + this.MarkPropDirty("ClosingRef"); + }); + } + } + get + { + return this._closingScript; + } + } + + partial void OnHandlingClosing(IgbVoidEventArgs args); + private EventCallback? _closing = null; + [Parameter] + public EventCallback Closing + { + get + { + return this._closing != null ? this._closing.Value : EventCallback.Empty; + } + set + { + if (!value.Equals(EventCallback.Empty)) + { + if (!CompareEventCallbacks(value, _closing, ref eventCallbacksCache)) + { + _closing = value; + this.SetHandler(this.Name, "Closing", value, (args) => + { + OnHandlingClosing(args); + + }); + this.OnRefChanged("Closing", null, "event:::Closing", true, false, (refName, oldValue, newValue) => + { + this._closingRef = refName; + this.MarkPropDirty("ClosingRef"); + }); + } + } + else + { + _closing = null; + this.SetHandler(this.Name, "Closing", null); + this.OnRefChanged("Closing", null, null, true, false, (refName, oldValue, newValue) => + { + this._closingRef = null; + this.MarkPropDirty("ClosingRef"); + }); + } + } + } + + private string _closedRef = null; + private string _closedScript = null; + [Parameter] + public string ClosedScript + { + + set + { + if (value != this._closedScript) + { + this._closedScript = value; + this.OnRefChanged("Closed", null, value, true, false, (string refName, object oldValue, object newValue) => + { + this._closedRef = refName; + this.MarkPropDirty("ClosedRef"); + }); + } + } + get + { + return this._closedScript; + } + } + + partial void OnHandlingClosed(IgbVoidEventArgs args); + private EventCallback? _closed = null; + [Parameter] + public EventCallback Closed + { + get + { + return this._closed != null ? this._closed.Value : EventCallback.Empty; + } + set + { + if (!value.Equals(EventCallback.Empty)) + { + if (!CompareEventCallbacks(value, _closed, ref eventCallbacksCache)) + { + _closed = value; + this.SetHandler(this.Name, "Closed", value, (args) => + { + OnHandlingClosed(args); + + }); + this.OnRefChanged("Closed", null, "event:::Closed", true, false, (refName, oldValue, newValue) => + { + this._closedRef = refName; + this.MarkPropDirty("ClosedRef"); + }); + } + } + else + { + _closed = null; + this.SetHandler(this.Name, "Closed", null); + this.OnRefChanged("Closed", null, null, true, false, (refName, oldValue, newValue) => + { + this._closedRef = null; + this.MarkPropDirty("ClosedRef"); + }); + } + } + } + + partial void OnEventUpdatingValue(T[] oldValue, ref T[] newValue); + + partial void SerializeCoreIgbCombo(RendererSerializer ser); + + internal override void SerializeCore(RendererSerializer ser) + { + base.SerializeCore(ser); + + SerializeCoreIgbCombo(ser); + + if (IsPropDirty("DataRef")) + { ser.AddStringProp("dataRef", this._dataRef); } + if (IsPropDirty("Outlined")) + { ser.AddBooleanProp("outlined", this._outlined); } + if (IsPropDirty("SingleSelect")) + { ser.AddBooleanProp("singleSelect", this._singleSelect); } + if (IsPropDirty("Autofocus")) + { ser.AddBooleanProp("autofocus", this._autofocus); } + if (IsPropDirty("AutofocusList")) + { ser.AddBooleanProp("autofocusList", this._autofocusList); } + if (IsPropDirty("Locale")) + { ser.AddStringProp("locale", this._locale); } + if (IsPropDirty("Label")) + { ser.AddStringProp("label", this._label); } + if (IsPropDirty("Placeholder")) + { ser.AddStringProp("placeholder", this._placeholder); } + if (IsPropDirty("PlaceholderSearch")) + { ser.AddStringProp("placeholderSearch", this._placeholderSearch); } + if (IsPropDirty("ValueKey")) + { ser.AddStringProp("valueKey", this._valueKey); } + if (IsPropDirty("DisplayKey")) + { ser.AddStringProp("displayKey", this._displayKey); } + if (IsPropDirty("GroupKey")) + { ser.AddStringProp("groupKey", this._groupKey); } + if (IsPropDirty("GroupSorting")) + { ser.AddEnumProp("groupSorting", this._groupSorting); } + if (IsPropDirty("FilteringOptions")) + { ser.AddSerializableProp("filteringOptions", this._filteringOptions); } + if (IsPropDirty("CaseSensitiveIcon")) + { ser.AddBooleanProp("caseSensitiveIcon", this._caseSensitiveIcon); } + if (IsPropDirty("DisableFiltering")) + { ser.AddBooleanProp("disableFiltering", this._disableFiltering); } + if (IsPropDirty("DisableClear")) + { ser.AddBooleanProp("disableClear", this._disableClear); } + if (IsPropDirty("Value")) + { ser.AddArrayProp("value", this._value); } + if (IsPropDirty("Disabled")) + { ser.AddBooleanProp("disabled", this._disabled); } + if (IsPropDirty("Required")) + { ser.AddBooleanProp("required", this._required); } + if (IsPropDirty("Invalid")) + { ser.AddBooleanProp("invalid", this._invalid); } + if (IsPropDirty("ItemTemplateRef")) + { ser.AddStringProp("itemTemplateRef", this._itemTemplateRef); } + if (IsPropDirty("GroupHeaderTemplateRef")) + { ser.AddStringProp("groupHeaderTemplateRef", this._groupHeaderTemplateRef); } + if (IsPropDirty("ChangeRef")) + { ser.AddStringProp("changeRef", this._changeRef); } + if (IsPropDirty("FocusRef")) + { ser.AddStringProp("focusRef", this._focusRef); } + if (IsPropDirty("BlurRef")) + { ser.AddStringProp("blurRef", this._blurRef); } + if (IsPropDirty("OpeningRef")) + { ser.AddStringProp("openingRef", this._openingRef); } + if (IsPropDirty("OpenedRef")) + { ser.AddStringProp("openedRef", this._openedRef); } + if (IsPropDirty("ClosingRef")) + { ser.AddStringProp("closingRef", this._closingRef); } + if (IsPropDirty("ClosedRef")) + { ser.AddStringProp("closedRef", this._closedRef); } + + } + + } } diff --git a/src/components/Blazor/ComboBoxBaseLike.cs b/src/components/Blazor/ComboBoxBaseLike.cs index 1b471a94..23c1d4b9 100644 --- a/src/components/Blazor/ComboBoxBaseLike.cs +++ b/src/components/Blazor/ComboBoxBaseLike.cs @@ -1,98 +1,99 @@ - -using System; using Microsoft.AspNetCore.Components; -using Microsoft.AspNetCore.Components.Rendering; -using System.Threading.Tasks; -using System.Collections.Generic; -using System.Linq; namespace IgniteUI.Blazor.Controls { - public partial class IgbComboBoxBaseLike: IgbBaseComboBox { - public override string Type { get { return "WebComboBoxBaseLike"; } } - - protected override string ResolveDisplay() - { - return "inline-block"; - } - - public IgbComboBoxBaseLike(): base() { - OnCreatedIgbComboBoxBaseLike(); - - - } - - partial void OnCreatedIgbComboBoxBaseLike(); - - private bool _keepOpenOnSelect = false; - - partial void OnKeepOpenOnSelectChanging(ref bool newValue); - /// - /// Whether the component dropdown should be kept open on selection. - /// - [Parameter] - public bool KeepOpenOnSelect - { - get { return this._keepOpenOnSelect; } - set { - if (this._keepOpenOnSelect != value || !IsPropDirty("KeepOpenOnSelect")) { - MarkPropDirty("KeepOpenOnSelect"); - } - this._keepOpenOnSelect = value; - - } - } - private bool _keepOpenOnOutsideClick = false; - - partial void OnKeepOpenOnOutsideClickChanging(ref bool newValue); - /// - /// Whether the component dropdown should be kept open on clicking outside of it. - /// - [Parameter] - public bool KeepOpenOnOutsideClick - { - get { return this._keepOpenOnOutsideClick; } - set { - if (this._keepOpenOnOutsideClick != value || !IsPropDirty("KeepOpenOnOutsideClick")) { - MarkPropDirty("KeepOpenOnOutsideClick"); - } - this._keepOpenOnOutsideClick = value; - - } - } - - partial void FindByNameComboBoxBaseLike(string name, ref object item); - public override object FindByName(string name) - { - - var baseResult = base.FindByName(name); - if (baseResult != null) - { - return baseResult; - } - - object item = null; - FindByNameComboBoxBaseLike(name, ref item); - if (item != null) - { - return item; - } - - return null; - } - - partial void SerializeCoreIgbComboBoxBaseLike(RendererSerializer ser); - - internal override void SerializeCore(RendererSerializer ser) - { - base.SerializeCore(ser); - - SerializeCoreIgbComboBoxBaseLike(ser); - - if (IsPropDirty("KeepOpenOnSelect")) { ser.AddBooleanProp("keepOpenOnSelect", this._keepOpenOnSelect); } - if (IsPropDirty("KeepOpenOnOutsideClick")) { ser.AddBooleanProp("keepOpenOnOutsideClick", this._keepOpenOnOutsideClick); } - - } - -} + public partial class IgbComboBoxBaseLike : IgbBaseComboBox + { + public override string Type { get { return "WebComboBoxBaseLike"; } } + + protected override string ResolveDisplay() + { + return "inline-block"; + } + + public IgbComboBoxBaseLike() : base() + { + OnCreatedIgbComboBoxBaseLike(); + + } + + partial void OnCreatedIgbComboBoxBaseLike(); + + private bool _keepOpenOnSelect = false; + + partial void OnKeepOpenOnSelectChanging(ref bool newValue); + /// + /// Whether the component dropdown should be kept open on selection. + /// + [Parameter] + public bool KeepOpenOnSelect + { + get { return this._keepOpenOnSelect; } + set + { + if (this._keepOpenOnSelect != value || !IsPropDirty("KeepOpenOnSelect")) + { + MarkPropDirty("KeepOpenOnSelect"); + } + this._keepOpenOnSelect = value; + + } + } + private bool _keepOpenOnOutsideClick = false; + + partial void OnKeepOpenOnOutsideClickChanging(ref bool newValue); + /// + /// Whether the component dropdown should be kept open on clicking outside of it. + /// + [Parameter] + public bool KeepOpenOnOutsideClick + { + get { return this._keepOpenOnOutsideClick; } + set + { + if (this._keepOpenOnOutsideClick != value || !IsPropDirty("KeepOpenOnOutsideClick")) + { + MarkPropDirty("KeepOpenOnOutsideClick"); + } + this._keepOpenOnOutsideClick = value; + + } + } + + partial void FindByNameComboBoxBaseLike(string name, ref object item); + public override object FindByName(string name) + { + + var baseResult = base.FindByName(name); + if (baseResult != null) + { + return baseResult; + } + + object item = null; + FindByNameComboBoxBaseLike(name, ref item); + if (item != null) + { + return item; + } + + return null; + } + + partial void SerializeCoreIgbComboBoxBaseLike(RendererSerializer ser); + + internal override void SerializeCore(RendererSerializer ser) + { + base.SerializeCore(ser); + + SerializeCoreIgbComboBoxBaseLike(ser); + + if (IsPropDirty("KeepOpenOnSelect")) + { ser.AddBooleanProp("keepOpenOnSelect", this._keepOpenOnSelect); } + if (IsPropDirty("KeepOpenOnOutsideClick")) + { ser.AddBooleanProp("keepOpenOnOutsideClick", this._keepOpenOnOutsideClick); } + + } + + } } diff --git a/src/components/Blazor/ComboChangeEventArgs.cs b/src/components/Blazor/ComboChangeEventArgs.cs index 37bf31f8..9ee86fba 100644 --- a/src/components/Blazor/ComboChangeEventArgs.cs +++ b/src/components/Blazor/ComboChangeEventArgs.cs @@ -1,99 +1,97 @@ - -using System; using Microsoft.AspNetCore.Components; -using Microsoft.AspNetCore.Components.Rendering; -using System.Threading.Tasks; -using System.Collections.Generic; -using System.Linq; namespace IgniteUI.Blazor.Controls { - public partial class IgbComboChangeEventArgs: BaseRendererElement { - public override string Type { get { return "WebComboChangeEventArgs"; } } - - - private static bool _marshalByValue = true; - - public IgbComboChangeEventArgs(): base() { - OnCreatedIgbComboChangeEventArgs(); - - - } - - partial void OnCreatedIgbComboChangeEventArgs(); - - private IgbComboChangeEventArgsDetail _detail; - - partial void OnDetailChanging(ref IgbComboChangeEventArgsDetail newValue); - [Parameter] - public IgbComboChangeEventArgsDetail Detail - { - get { return this._detail; } - set { - OnDetailChanging(ref value); - MarkPropDirty("Detail"); - if (this._detail != null) { - this.DetachChild(this._detail); - } - if (value != null) { - this.AttachChild(value); - } - this._detail = value; - } - - } - - partial void FindByNameComboChangeEventArgs(string name, ref object item); - public override object FindByName(string name) - { - - var baseResult = base.FindByName(name); - if (baseResult != null) - { - return baseResult; - } - - object item = null; - FindByNameComboChangeEventArgs(name, ref item); - if (item != null) - { - return item; - } - - return null; - } - - partial void SerializeCoreIgbComboChangeEventArgs(RendererSerializer ser); - - internal override void SerializeCore(RendererSerializer ser) - { - base.SerializeCore(ser); - - SerializeCoreIgbComboChangeEventArgs(ser); - - if (IsPropDirty("Detail")) { ser.AddSerializableProp("detail", this._detail); } - - } - - - protected internal override void ToEventJson(BaseRendererControl control, Dictionary args) - { - base.ToEventJson(control, args); - - if (IsPropDirty("Detail")) { args["detail"] = ObjectToParam(this._detail); } - - - } - - - protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) { - base.FromEventJson(control, args); - this.SuppressParentNotify = true; - - if (args.ContainsKey("detail")) { this.Detail = (IgbComboChangeEventArgsDetail)ConvertReturnValue(args["detail"], "ComboChangeEventArgsDetail", true); } - - this.SuppressParentNotify = false; - } - -} + public partial class IgbComboChangeEventArgs : BaseRendererElement + { + public override string Type { get { return "WebComboChangeEventArgs"; } } + + private static bool _marshalByValue = true; + + public IgbComboChangeEventArgs() : base() + { + OnCreatedIgbComboChangeEventArgs(); + + } + + partial void OnCreatedIgbComboChangeEventArgs(); + + private IgbComboChangeEventArgsDetail _detail; + + partial void OnDetailChanging(ref IgbComboChangeEventArgsDetail newValue); + [Parameter] + public IgbComboChangeEventArgsDetail Detail + { + get { return this._detail; } + set + { + OnDetailChanging(ref value); + MarkPropDirty("Detail"); + if (this._detail != null) + { + this.DetachChild(this._detail); + } + if (value != null) + { + this.AttachChild(value); + } + this._detail = value; + } + + } + + partial void FindByNameComboChangeEventArgs(string name, ref object item); + public override object FindByName(string name) + { + + var baseResult = base.FindByName(name); + if (baseResult != null) + { + return baseResult; + } + + object item = null; + FindByNameComboChangeEventArgs(name, ref item); + if (item != null) + { + return item; + } + + return null; + } + + partial void SerializeCoreIgbComboChangeEventArgs(RendererSerializer ser); + + internal override void SerializeCore(RendererSerializer ser) + { + base.SerializeCore(ser); + + SerializeCoreIgbComboChangeEventArgs(ser); + + if (IsPropDirty("Detail")) + { ser.AddSerializableProp("detail", this._detail); } + + } + + protected internal override void ToEventJson(BaseRendererControl control, Dictionary args) + { + base.ToEventJson(control, args); + + if (IsPropDirty("Detail")) + { args["detail"] = ObjectToParam(this._detail); } + + } + + protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) + { + base.FromEventJson(control, args); + this.SuppressParentNotify = true; + + if (args.ContainsKey("detail")) + { this.Detail = (IgbComboChangeEventArgsDetail)ConvertReturnValue(args["detail"], "ComboChangeEventArgsDetail", true); } + + this.SuppressParentNotify = false; + } + + } } diff --git a/src/components/Blazor/ComboChangeEventArgsDetail.cs b/src/components/Blazor/ComboChangeEventArgsDetail.cs index 6828911b..de32f29c 100644 --- a/src/components/Blazor/ComboChangeEventArgsDetail.cs +++ b/src/components/Blazor/ComboChangeEventArgsDetail.cs @@ -1,209 +1,212 @@ - -using System; using Microsoft.AspNetCore.Components; -using Microsoft.AspNetCore.Components.Rendering; -using System.Threading.Tasks; -using System.Collections.Generic; -using System.Linq; namespace IgniteUI.Blazor.Controls { - public partial class IgbComboChangeEventArgsDetail: BaseRendererElement { - public override string Type { get { return "WebComboChangeEventArgsDetail"; } } - - - private static bool _marshalByValue = true; - - public IgbComboChangeEventArgsDetail(): base() { - OnCreatedIgbComboChangeEventArgsDetail(); - - - } - - partial void OnCreatedIgbComboChangeEventArgsDetail(); - - private string _newValueRef; - private object[] _newValue; - - partial void OnNewValueChanging(ref object[] newValue); - [Parameter] - public object[] NewValue - { - get { return this._newValue; } - - set { - var oldValue = this._newValue; - OnNewValueChanging(ref value); - - - if (oldValue != value || !IsPropDirty("NewValue")) - { - MarkPropDirty("NewValue"); - this._newValue = value; - this.OnRefChanged("NewValue", oldValue, value, false, false, (string refName, object old, object newValue) => { - this._newValueRef = refName; - this.MarkPropDirty("NewValueRef"); - }); - } - } - } - - - private string _newValueScript; - - - ///Provides a means of setting NewValue in the JavaScript environment. - [Parameter] - public string NewValueScript - { - get { return _newValueScript; } - - - set { - var oldValue = this._newValueScript; - if (oldValue != value || !IsPropDirty("NewValue")) - { - this._newValueScript = value; - MarkPropDirty("NewValue"); - this.OnRefChanged("NewValue", oldValue, value, true, false, (string refName, object old, object newValue) => { - this._newValueRef = refName; - this.MarkPropDirty("NewValueRef"); - }); - } - } - } - private string _itemsRef; - private object[] _items; - - partial void OnItemsChanging(ref object[] newValue); - [Parameter] - public object[] Items - { - get { return this._items; } - - set { - var oldValue = this._items; - OnItemsChanging(ref value); - - - if (oldValue != value || !IsPropDirty("Items")) - { - MarkPropDirty("Items"); - this._items = value; - this.OnRefChanged("Items", oldValue, value, false, false, (string refName, object old, object newValue) => { - this._itemsRef = refName; - this.MarkPropDirty("ItemsRef"); - }); - } - } - } - - - private string _itemsScript; - - - ///Provides a means of setting Items in the JavaScript environment. - [Parameter] - public string ItemsScript - { - get { return _itemsScript; } - - - set { - var oldValue = this._itemsScript; - if (oldValue != value || !IsPropDirty("Items")) - { - this._itemsScript = value; - MarkPropDirty("Items"); - this.OnRefChanged("Items", oldValue, value, true, false, (string refName, object old, object newValue) => { - this._itemsRef = refName; - this.MarkPropDirty("ItemsRef"); - }); - } - } - } - private ComboChangeType _changeType = ComboChangeType.Selection; - - partial void OnChangeTypeChanging(ref ComboChangeType newValue); - [Parameter] - [WCWidgetMemberName("Type")] - public ComboChangeType ChangeType - { - get { return this._changeType; } - set { - if (this._changeType != value || !IsPropDirty("ChangeType")) { - MarkPropDirty("ChangeType"); - } - this._changeType = value; - - } - } - - partial void FindByNameComboChangeEventArgsDetail(string name, ref object item); - public override object FindByName(string name) - { - - var baseResult = base.FindByName(name); - if (baseResult != null) - { - return baseResult; - } - - object item = null; - FindByNameComboChangeEventArgsDetail(name, ref item); - if (item != null) - { - return item; - } - - return null; - } - public async Task SetNativeElementAsync(Object element) - { - await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); - } - public void SetNativeElement(Object element) - { - InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); - } - - partial void SerializeCoreIgbComboChangeEventArgsDetail(RendererSerializer ser); - - internal override void SerializeCore(RendererSerializer ser) - { - base.SerializeCore(ser); - - SerializeCoreIgbComboChangeEventArgsDetail(ser); - - if (IsPropDirty("NewValue")) { ser.AddArrayProp("newValue", this._newValue); } - if (IsPropDirty("Items")) { ser.AddArrayProp("items", this._items); } - if (IsPropDirty("ChangeType")) { ser.AddEnumProp("changeType", this._changeType); } - - } - - - protected internal override void ToEventJson(BaseRendererControl control, Dictionary args) - { - base.ToEventJson(control, args); - - if (IsPropDirty("NewValue")) { args["newValue"] = ObjectArrayToParam(this._newValue); } - if (IsPropDirty("Items")) { args["items"] = ObjectArrayToParam(this._items); } - if (IsPropDirty("ChangeType")) { args["changeType"] = EnumToString(this._changeType); } - - - } - - - protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) { - base.FromEventJson(control, args); - this.SuppressParentNotify = true; - - if (args.ContainsKey("newValue")) { this.NewValue = ReturnToObjectArray(args["newValue"]); } - if (args.ContainsKey("items")) { this.Items = ReturnToObjectArray(args["items"]); } - if (args.ContainsKey("changeType")) { this.ChangeType = StringToEnum(args["changeType"]); } - - this.SuppressParentNotify = false; - } - -} + public partial class IgbComboChangeEventArgsDetail : BaseRendererElement + { + public override string Type { get { return "WebComboChangeEventArgsDetail"; } } + + private static bool _marshalByValue = true; + + public IgbComboChangeEventArgsDetail() : base() + { + OnCreatedIgbComboChangeEventArgsDetail(); + + } + + partial void OnCreatedIgbComboChangeEventArgsDetail(); + + private string _newValueRef; + private object[] _newValue; + + partial void OnNewValueChanging(ref object[] newValue); + [Parameter] + public object[] NewValue + { + get { return this._newValue; } + + set + { + var oldValue = this._newValue; + OnNewValueChanging(ref value); + + if (oldValue != value || !IsPropDirty("NewValue")) + { + MarkPropDirty("NewValue"); + this._newValue = value; + this.OnRefChanged("NewValue", oldValue, value, false, false, (string refName, object old, object newValue) => + { + this._newValueRef = refName; + this.MarkPropDirty("NewValueRef"); + }); + } + } + } + + private string _newValueScript; + + ///Provides a means of setting NewValue in the JavaScript environment. + [Parameter] + public string NewValueScript + { + get { return _newValueScript; } + + set + { + var oldValue = this._newValueScript; + if (oldValue != value || !IsPropDirty("NewValue")) + { + this._newValueScript = value; + MarkPropDirty("NewValue"); + this.OnRefChanged("NewValue", oldValue, value, true, false, (string refName, object old, object newValue) => + { + this._newValueRef = refName; + this.MarkPropDirty("NewValueRef"); + }); + } + } + } + private string _itemsRef; + private object[] _items; + + partial void OnItemsChanging(ref object[] newValue); + [Parameter] + public object[] Items + { + get { return this._items; } + + set + { + var oldValue = this._items; + OnItemsChanging(ref value); + + if (oldValue != value || !IsPropDirty("Items")) + { + MarkPropDirty("Items"); + this._items = value; + this.OnRefChanged("Items", oldValue, value, false, false, (string refName, object old, object newValue) => + { + this._itemsRef = refName; + this.MarkPropDirty("ItemsRef"); + }); + } + } + } + + private string _itemsScript; + + ///Provides a means of setting Items in the JavaScript environment. + [Parameter] + public string ItemsScript + { + get { return _itemsScript; } + + set + { + var oldValue = this._itemsScript; + if (oldValue != value || !IsPropDirty("Items")) + { + this._itemsScript = value; + MarkPropDirty("Items"); + this.OnRefChanged("Items", oldValue, value, true, false, (string refName, object old, object newValue) => + { + this._itemsRef = refName; + this.MarkPropDirty("ItemsRef"); + }); + } + } + } + private ComboChangeType _changeType = ComboChangeType.Selection; + + partial void OnChangeTypeChanging(ref ComboChangeType newValue); + [Parameter] + [WCWidgetMemberName("Type")] + public ComboChangeType ChangeType + { + get { return this._changeType; } + set + { + if (this._changeType != value || !IsPropDirty("ChangeType")) + { + MarkPropDirty("ChangeType"); + } + this._changeType = value; + + } + } + + partial void FindByNameComboChangeEventArgsDetail(string name, ref object item); + public override object FindByName(string name) + { + + var baseResult = base.FindByName(name); + if (baseResult != null) + { + return baseResult; + } + + object item = null; + FindByNameComboChangeEventArgsDetail(name, ref item); + if (item != null) + { + return item; + } + + return null; + } + public async Task SetNativeElementAsync(Object element) + { + await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + } + public void SetNativeElement(Object element) + { + InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + } + + partial void SerializeCoreIgbComboChangeEventArgsDetail(RendererSerializer ser); + + internal override void SerializeCore(RendererSerializer ser) + { + base.SerializeCore(ser); + + SerializeCoreIgbComboChangeEventArgsDetail(ser); + + if (IsPropDirty("NewValue")) + { ser.AddArrayProp("newValue", this._newValue); } + if (IsPropDirty("Items")) + { ser.AddArrayProp("items", this._items); } + if (IsPropDirty("ChangeType")) + { ser.AddEnumProp("changeType", this._changeType); } + + } + + protected internal override void ToEventJson(BaseRendererControl control, Dictionary args) + { + base.ToEventJson(control, args); + + if (IsPropDirty("NewValue")) + { args["newValue"] = ObjectArrayToParam(this._newValue); } + if (IsPropDirty("Items")) + { args["items"] = ObjectArrayToParam(this._items); } + if (IsPropDirty("ChangeType")) + { args["changeType"] = EnumToString(this._changeType); } + + } + + protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) + { + base.FromEventJson(control, args); + this.SuppressParentNotify = true; + + if (args.ContainsKey("newValue")) + { this.NewValue = ReturnToObjectArray(args["newValue"]); } + if (args.ContainsKey("items")) + { this.Items = ReturnToObjectArray(args["items"]); } + if (args.ContainsKey("changeType")) + { this.ChangeType = StringToEnum(args["changeType"]); } + + this.SuppressParentNotify = false; + } + + } } diff --git a/src/components/Blazor/ComboChangeType.cs b/src/components/Blazor/ComboChangeType.cs index 872e0556..f77e2f22 100644 --- a/src/components/Blazor/ComboChangeType.cs +++ b/src/components/Blazor/ComboChangeType.cs @@ -1,9 +1,10 @@ namespace IgniteUI.Blazor.Controls { -public enum ComboChangeType { - Selection, - Deselection, - Addition + public enum ComboChangeType + { + Selection, + Deselection, + Addition -} + } } diff --git a/src/components/Blazor/ComboModule.cs b/src/components/Blazor/ComboModule.cs index da8eb640..50de43a8 100644 --- a/src/components/Blazor/ComboModule.cs +++ b/src/components/Blazor/ComboModule.cs @@ -1,25 +1,23 @@ -using System; -using System.Collections.Generic; -using System.Runtime.CompilerServices; -using System.Text; -using System.Collections.Generic; - namespace IgniteUI.Blazor.Controls { - public partial class IgbComboModule { - public static void Register(IIgniteUIBlazor runtime) { + public partial class IgbComboModule + { + public static void Register(IIgniteUIBlazor runtime) + { ModuleLoader.Load(runtime, "WebComboModule"); IgbIconModule.MarkIsLoadRequested(runtime); -IgbInputModule.MarkIsLoadRequested(runtime); + IgbInputModule.MarkIsLoadRequested(runtime); } - public static void MarkIsLoadRequested(IIgniteUIBlazor runtime) { + public static void MarkIsLoadRequested(IIgniteUIBlazor runtime) + { ModuleLoader.MarkIsLoadRequested(runtime, "WebComboModule"); } - public static bool IsLoadRequested(IIgniteUIBlazor runtime) { + public static bool IsLoadRequested(IIgniteUIBlazor runtime) + { return ModuleLoader.IsLoadRequested(runtime, "WebComboModule"); } } diff --git a/src/components/Blazor/ComponentBoolValueChangedEventArgs.cs b/src/components/Blazor/ComponentBoolValueChangedEventArgs.cs index 6cb38851..52c2d863 100644 --- a/src/components/Blazor/ComponentBoolValueChangedEventArgs.cs +++ b/src/components/Blazor/ComponentBoolValueChangedEventArgs.cs @@ -1,94 +1,91 @@ - -using System; using Microsoft.AspNetCore.Components; -using Microsoft.AspNetCore.Components.Rendering; -using System.Threading.Tasks; -using System.Collections.Generic; -using System.Linq; namespace IgniteUI.Blazor.Controls { - public partial class IgbComponentBoolValueChangedEventArgs: BaseRendererElement { - public override string Type { get { return "WebComponentBoolValueChangedEventArgs"; } } - - - private static bool _marshalByValue = true; - - public IgbComponentBoolValueChangedEventArgs(): base() { - OnCreatedIgbComponentBoolValueChangedEventArgs(); - - - } - - partial void OnCreatedIgbComponentBoolValueChangedEventArgs(); - - private bool _detail = false; - - partial void OnDetailChanging(ref bool newValue); - [Parameter] - public bool Detail - { - get { return this._detail; } - set { - if (this._detail != value || !IsPropDirty("Detail")) { - MarkPropDirty("Detail"); - } - this._detail = value; - - } - } - - partial void FindByNameComponentBoolValueChangedEventArgs(string name, ref object item); - public override object FindByName(string name) - { - - var baseResult = base.FindByName(name); - if (baseResult != null) - { - return baseResult; - } - - object item = null; - FindByNameComponentBoolValueChangedEventArgs(name, ref item); - if (item != null) - { - return item; - } - - return null; - } - - partial void SerializeCoreIgbComponentBoolValueChangedEventArgs(RendererSerializer ser); - - internal override void SerializeCore(RendererSerializer ser) - { - base.SerializeCore(ser); - - SerializeCoreIgbComponentBoolValueChangedEventArgs(ser); - - if (IsPropDirty("Detail")) { ser.AddBooleanProp("detail", this._detail); } - - } - - - protected internal override void ToEventJson(BaseRendererControl control, Dictionary args) - { - base.ToEventJson(control, args); - - if (IsPropDirty("Detail")) { args["detail"] = (this._detail).ToString().ToLower(); } - - - } - - - protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) { - base.FromEventJson(control, args); - this.SuppressParentNotify = true; - - if (args.ContainsKey("detail")) { this.Detail = ReturnToBoolean(args["detail"]); } - - this.SuppressParentNotify = false; - } - -} + public partial class IgbComponentBoolValueChangedEventArgs : BaseRendererElement + { + public override string Type { get { return "WebComponentBoolValueChangedEventArgs"; } } + + private static bool _marshalByValue = true; + + public IgbComponentBoolValueChangedEventArgs() : base() + { + OnCreatedIgbComponentBoolValueChangedEventArgs(); + + } + + partial void OnCreatedIgbComponentBoolValueChangedEventArgs(); + + private bool _detail = false; + + partial void OnDetailChanging(ref bool newValue); + [Parameter] + public bool Detail + { + get { return this._detail; } + set + { + if (this._detail != value || !IsPropDirty("Detail")) + { + MarkPropDirty("Detail"); + } + this._detail = value; + + } + } + + partial void FindByNameComponentBoolValueChangedEventArgs(string name, ref object item); + public override object FindByName(string name) + { + + var baseResult = base.FindByName(name); + if (baseResult != null) + { + return baseResult; + } + + object item = null; + FindByNameComponentBoolValueChangedEventArgs(name, ref item); + if (item != null) + { + return item; + } + + return null; + } + + partial void SerializeCoreIgbComponentBoolValueChangedEventArgs(RendererSerializer ser); + + internal override void SerializeCore(RendererSerializer ser) + { + base.SerializeCore(ser); + + SerializeCoreIgbComponentBoolValueChangedEventArgs(ser); + + if (IsPropDirty("Detail")) + { ser.AddBooleanProp("detail", this._detail); } + + } + + protected internal override void ToEventJson(BaseRendererControl control, Dictionary args) + { + base.ToEventJson(control, args); + + if (IsPropDirty("Detail")) + { args["detail"] = (this._detail).ToString().ToLower(); } + + } + + protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) + { + base.FromEventJson(control, args); + this.SuppressParentNotify = true; + + if (args.ContainsKey("detail")) + { this.Detail = ReturnToBoolean(args["detail"]); } + + this.SuppressParentNotify = false; + } + + } } diff --git a/src/components/Blazor/ComponentDataValueChangedEventArgs.cs b/src/components/Blazor/ComponentDataValueChangedEventArgs.cs index c5b731a6..4715d3c2 100644 --- a/src/components/Blazor/ComponentDataValueChangedEventArgs.cs +++ b/src/components/Blazor/ComponentDataValueChangedEventArgs.cs @@ -1,92 +1,89 @@ - -using System; using Microsoft.AspNetCore.Components; -using Microsoft.AspNetCore.Components.Rendering; -using System.Threading.Tasks; -using System.Collections.Generic; -using System.Linq; namespace IgniteUI.Blazor.Controls { - public partial class IgbComponentDataValueChangedEventArgs: BaseRendererElement { - public override string Type { get { return "WebComponentDataValueChangedEventArgs"; } } - - - public IgbComponentDataValueChangedEventArgs(): base() { - OnCreatedIgbComponentDataValueChangedEventArgs(); - - - } - - partial void OnCreatedIgbComponentDataValueChangedEventArgs(); - - private object _detail; - - partial void OnDetailChanging(ref object newValue); - [Parameter] - public object Detail - { - get { return this._detail; } - set { - if (this._detail != value || !IsPropDirty("Detail")) { - MarkPropDirty("Detail"); - } - this._detail = value; - - } - } - - partial void FindByNameComponentDataValueChangedEventArgs(string name, ref object item); - public override object FindByName(string name) - { - - var baseResult = base.FindByName(name); - if (baseResult != null) - { - return baseResult; - } - - object item = null; - FindByNameComponentDataValueChangedEventArgs(name, ref item); - if (item != null) - { - return item; - } - - return null; - } - - partial void SerializeCoreIgbComponentDataValueChangedEventArgs(RendererSerializer ser); - - internal override void SerializeCore(RendererSerializer ser) - { - base.SerializeCore(ser); - - SerializeCoreIgbComponentDataValueChangedEventArgs(ser); - - if (IsPropDirty("Detail")) { ser.AddPrimitiveProp("detail", this._detail); } - - } - - - protected internal override void ToEventJson(BaseRendererControl control, Dictionary args) - { - base.ToEventJson(control, args); - - if (IsPropDirty("Detail")) { args["detail"] = ObjectToParam(this._detail); } - - - } - - - protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) { - base.FromEventJson(control, args); - this.SuppressParentNotify = true; - - if (args.ContainsKey("detail")) { this.Detail = ReturnToPrimitive(args["detail"]); } - - this.SuppressParentNotify = false; - } - -} + public partial class IgbComponentDataValueChangedEventArgs : BaseRendererElement + { + public override string Type { get { return "WebComponentDataValueChangedEventArgs"; } } + + public IgbComponentDataValueChangedEventArgs() : base() + { + OnCreatedIgbComponentDataValueChangedEventArgs(); + + } + + partial void OnCreatedIgbComponentDataValueChangedEventArgs(); + + private object _detail; + + partial void OnDetailChanging(ref object newValue); + [Parameter] + public object Detail + { + get { return this._detail; } + set + { + if (this._detail != value || !IsPropDirty("Detail")) + { + MarkPropDirty("Detail"); + } + this._detail = value; + + } + } + + partial void FindByNameComponentDataValueChangedEventArgs(string name, ref object item); + public override object FindByName(string name) + { + + var baseResult = base.FindByName(name); + if (baseResult != null) + { + return baseResult; + } + + object item = null; + FindByNameComponentDataValueChangedEventArgs(name, ref item); + if (item != null) + { + return item; + } + + return null; + } + + partial void SerializeCoreIgbComponentDataValueChangedEventArgs(RendererSerializer ser); + + internal override void SerializeCore(RendererSerializer ser) + { + base.SerializeCore(ser); + + SerializeCoreIgbComponentDataValueChangedEventArgs(ser); + + if (IsPropDirty("Detail")) + { ser.AddPrimitiveProp("detail", this._detail); } + + } + + protected internal override void ToEventJson(BaseRendererControl control, Dictionary args) + { + base.ToEventJson(control, args); + + if (IsPropDirty("Detail")) + { args["detail"] = ObjectToParam(this._detail); } + + } + + protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) + { + base.FromEventJson(control, args); + this.SuppressParentNotify = true; + + if (args.ContainsKey("detail")) + { this.Detail = ReturnToPrimitive(args["detail"]); } + + this.SuppressParentNotify = false; + } + + } } diff --git a/src/components/Blazor/ComponentDateValueChangedEventArgs.cs b/src/components/Blazor/ComponentDateValueChangedEventArgs.cs index f77b675d..70090623 100644 --- a/src/components/Blazor/ComponentDateValueChangedEventArgs.cs +++ b/src/components/Blazor/ComponentDateValueChangedEventArgs.cs @@ -1,94 +1,91 @@ - -using System; using Microsoft.AspNetCore.Components; -using Microsoft.AspNetCore.Components.Rendering; -using System.Threading.Tasks; -using System.Collections.Generic; -using System.Linq; namespace IgniteUI.Blazor.Controls { - public partial class IgbComponentDateValueChangedEventArgs: BaseRendererElement { - public override string Type { get { return "WebComponentDateValueChangedEventArgs"; } } - - - private static bool _marshalByValue = true; - - public IgbComponentDateValueChangedEventArgs(): base() { - OnCreatedIgbComponentDateValueChangedEventArgs(); - - - } - - partial void OnCreatedIgbComponentDateValueChangedEventArgs(); - - private DateTime _detail = DateTime.MinValue; - - partial void OnDetailChanging(ref DateTime newValue); - [Parameter] - public DateTime Detail - { - get { return this._detail; } - set { - if (this._detail != value || !IsPropDirty("Detail")) { - MarkPropDirty("Detail"); - } - this._detail = value; - - } - } - - partial void FindByNameComponentDateValueChangedEventArgs(string name, ref object item); - public override object FindByName(string name) - { - - var baseResult = base.FindByName(name); - if (baseResult != null) - { - return baseResult; - } - - object item = null; - FindByNameComponentDateValueChangedEventArgs(name, ref item); - if (item != null) - { - return item; - } - - return null; - } - - partial void SerializeCoreIgbComponentDateValueChangedEventArgs(RendererSerializer ser); - - internal override void SerializeCore(RendererSerializer ser) - { - base.SerializeCore(ser); - - SerializeCoreIgbComponentDateValueChangedEventArgs(ser); - - if (IsPropDirty("Detail")) { ser.AddDateTimeProp("detail", this._detail); } - - } - - - protected internal override void ToEventJson(BaseRendererControl control, Dictionary args) - { - base.ToEventJson(control, args); - - if (IsPropDirty("Detail")) { args["detail"] = DateToString(this._detail); } - - - } - - - protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) { - base.FromEventJson(control, args); - this.SuppressParentNotify = true; - - if (args.ContainsKey("detail")) { this.Detail = ReturnToDate(args["detail"]); } - - this.SuppressParentNotify = false; - } - -} + public partial class IgbComponentDateValueChangedEventArgs : BaseRendererElement + { + public override string Type { get { return "WebComponentDateValueChangedEventArgs"; } } + + private static bool _marshalByValue = true; + + public IgbComponentDateValueChangedEventArgs() : base() + { + OnCreatedIgbComponentDateValueChangedEventArgs(); + + } + + partial void OnCreatedIgbComponentDateValueChangedEventArgs(); + + private DateTime _detail = DateTime.MinValue; + + partial void OnDetailChanging(ref DateTime newValue); + [Parameter] + public DateTime Detail + { + get { return this._detail; } + set + { + if (this._detail != value || !IsPropDirty("Detail")) + { + MarkPropDirty("Detail"); + } + this._detail = value; + + } + } + + partial void FindByNameComponentDateValueChangedEventArgs(string name, ref object item); + public override object FindByName(string name) + { + + var baseResult = base.FindByName(name); + if (baseResult != null) + { + return baseResult; + } + + object item = null; + FindByNameComponentDateValueChangedEventArgs(name, ref item); + if (item != null) + { + return item; + } + + return null; + } + + partial void SerializeCoreIgbComponentDateValueChangedEventArgs(RendererSerializer ser); + + internal override void SerializeCore(RendererSerializer ser) + { + base.SerializeCore(ser); + + SerializeCoreIgbComponentDateValueChangedEventArgs(ser); + + if (IsPropDirty("Detail")) + { ser.AddDateTimeProp("detail", this._detail); } + + } + + protected internal override void ToEventJson(BaseRendererControl control, Dictionary args) + { + base.ToEventJson(control, args); + + if (IsPropDirty("Detail")) + { args["detail"] = DateToString(this._detail); } + + } + + protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) + { + base.FromEventJson(control, args); + this.SuppressParentNotify = true; + + if (args.ContainsKey("detail")) + { this.Detail = ReturnToDate(args["detail"]); } + + this.SuppressParentNotify = false; + } + + } } diff --git a/src/components/Blazor/ComponentValueChangedEventArgs.cs b/src/components/Blazor/ComponentValueChangedEventArgs.cs index 3dd88a5b..d5273ca6 100644 --- a/src/components/Blazor/ComponentValueChangedEventArgs.cs +++ b/src/components/Blazor/ComponentValueChangedEventArgs.cs @@ -1,94 +1,91 @@ - -using System; using Microsoft.AspNetCore.Components; -using Microsoft.AspNetCore.Components.Rendering; -using System.Threading.Tasks; -using System.Collections.Generic; -using System.Linq; namespace IgniteUI.Blazor.Controls { - public partial class IgbComponentValueChangedEventArgs: BaseRendererElement { - public override string Type { get { return "WebComponentValueChangedEventArgs"; } } - - - private static bool _marshalByValue = true; - - public IgbComponentValueChangedEventArgs(): base() { - OnCreatedIgbComponentValueChangedEventArgs(); - - - } - - partial void OnCreatedIgbComponentValueChangedEventArgs(); - - private string _detail; - - partial void OnDetailChanging(ref string newValue); - [Parameter] - public string Detail - { - get { return this._detail; } - set { - if (this._detail != value || !IsPropDirty("Detail")) { - MarkPropDirty("Detail"); - } - this._detail = value; - - } - } - - partial void FindByNameComponentValueChangedEventArgs(string name, ref object item); - public override object FindByName(string name) - { - - var baseResult = base.FindByName(name); - if (baseResult != null) - { - return baseResult; - } - - object item = null; - FindByNameComponentValueChangedEventArgs(name, ref item); - if (item != null) - { - return item; - } - - return null; - } - - partial void SerializeCoreIgbComponentValueChangedEventArgs(RendererSerializer ser); - - internal override void SerializeCore(RendererSerializer ser) - { - base.SerializeCore(ser); - - SerializeCoreIgbComponentValueChangedEventArgs(ser); - - if (IsPropDirty("Detail")) { ser.AddStringProp("detail", this._detail); } - - } - - - protected internal override void ToEventJson(BaseRendererControl control, Dictionary args) - { - base.ToEventJson(control, args); - - if (IsPropDirty("Detail")) { args["detail"] = this._detail; } - - - } - - - protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) { - base.FromEventJson(control, args); - this.SuppressParentNotify = true; - - if (args.ContainsKey("detail")) { this.Detail = ReturnToString(args["detail"]); } - - this.SuppressParentNotify = false; - } - -} + public partial class IgbComponentValueChangedEventArgs : BaseRendererElement + { + public override string Type { get { return "WebComponentValueChangedEventArgs"; } } + + private static bool _marshalByValue = true; + + public IgbComponentValueChangedEventArgs() : base() + { + OnCreatedIgbComponentValueChangedEventArgs(); + + } + + partial void OnCreatedIgbComponentValueChangedEventArgs(); + + private string _detail; + + partial void OnDetailChanging(ref string newValue); + [Parameter] + public string Detail + { + get { return this._detail; } + set + { + if (this._detail != value || !IsPropDirty("Detail")) + { + MarkPropDirty("Detail"); + } + this._detail = value; + + } + } + + partial void FindByNameComponentValueChangedEventArgs(string name, ref object item); + public override object FindByName(string name) + { + + var baseResult = base.FindByName(name); + if (baseResult != null) + { + return baseResult; + } + + object item = null; + FindByNameComponentValueChangedEventArgs(name, ref item); + if (item != null) + { + return item; + } + + return null; + } + + partial void SerializeCoreIgbComponentValueChangedEventArgs(RendererSerializer ser); + + internal override void SerializeCore(RendererSerializer ser) + { + base.SerializeCore(ser); + + SerializeCoreIgbComponentValueChangedEventArgs(ser); + + if (IsPropDirty("Detail")) + { ser.AddStringProp("detail", this._detail); } + + } + + protected internal override void ToEventJson(BaseRendererControl control, Dictionary args) + { + base.ToEventJson(control, args); + + if (IsPropDirty("Detail")) + { args["detail"] = this._detail; } + + } + + protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) + { + base.FromEventJson(control, args); + this.SuppressParentNotify = true; + + if (args.ContainsKey("detail")) + { this.Detail = ReturnToString(args["detail"]); } + + this.SuppressParentNotify = false; + } + + } } diff --git a/src/components/Blazor/ContentOrientation.cs b/src/components/Blazor/ContentOrientation.cs index 69e27947..a3b2ae1a 100644 --- a/src/components/Blazor/ContentOrientation.cs +++ b/src/components/Blazor/ContentOrientation.cs @@ -1,8 +1,9 @@ namespace IgniteUI.Blazor.Controls { -public enum ContentOrientation { - Horizontal, - Vertical + public enum ContentOrientation + { + Horizontal, + Vertical -} + } } diff --git a/src/components/Blazor/CustomDateRange.cs b/src/components/Blazor/CustomDateRange.cs index e15501c2..87891460 100644 --- a/src/components/Blazor/CustomDateRange.cs +++ b/src/components/Blazor/CustomDateRange.cs @@ -1,101 +1,102 @@ - -using System; using Microsoft.AspNetCore.Components; -using Microsoft.AspNetCore.Components.Rendering; -using System.Threading.Tasks; -using System.Collections.Generic; -using System.Linq; namespace IgniteUI.Blazor.Controls { - public partial class IgbCustomDateRange: BaseRendererElement { - public override string Type { get { return "WebCustomDateRange"; } } - - - public IgbCustomDateRange(): base() { - OnCreatedIgbCustomDateRange(); - - - } - - partial void OnCreatedIgbCustomDateRange(); - - private string _label; - - partial void OnLabelChanging(ref string newValue); - [Parameter] - public string Label - { - get { return this._label; } - set { - if (this._label != value || !IsPropDirty("Label")) { - MarkPropDirty("Label"); - } - this._label = value; - - } - } - private IgbDateRangeValue _dateRange; - - partial void OnDateRangeChanging(ref IgbDateRangeValue newValue); - [Parameter] - public IgbDateRangeValue DateRange - { - get { return this._dateRange; } - set { - OnDateRangeChanging(ref value); - MarkPropDirty("DateRange"); - if (this._dateRange != null) { - this.DetachChild(this._dateRange); - } - if (value != null) { - this.AttachChild(value); - } - this._dateRange = value; - } - - } - - partial void FindByNameCustomDateRange(string name, ref object item); - public override object FindByName(string name) - { - - var baseResult = base.FindByName(name); - if (baseResult != null) - { - return baseResult; - } - - object item = null; - FindByNameCustomDateRange(name, ref item); - if (item != null) - { - return item; - } - - return null; - } - public async Task SetNativeElementAsync(Object element) - { - await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); - } - public void SetNativeElement(Object element) - { - InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); - } - - partial void SerializeCoreIgbCustomDateRange(RendererSerializer ser); - - internal override void SerializeCore(RendererSerializer ser) - { - base.SerializeCore(ser); - - SerializeCoreIgbCustomDateRange(ser); - - if (IsPropDirty("Label")) { ser.AddStringProp("label", this._label); } - if (IsPropDirty("DateRange")) { ser.AddSerializableProp("dateRange", this._dateRange); } - - } - -} + public partial class IgbCustomDateRange : BaseRendererElement + { + public override string Type { get { return "WebCustomDateRange"; } } + + public IgbCustomDateRange() : base() + { + OnCreatedIgbCustomDateRange(); + + } + + partial void OnCreatedIgbCustomDateRange(); + + private string _label; + + partial void OnLabelChanging(ref string newValue); + [Parameter] + public string Label + { + get { return this._label; } + set + { + if (this._label != value || !IsPropDirty("Label")) + { + MarkPropDirty("Label"); + } + this._label = value; + + } + } + private IgbDateRangeValue _dateRange; + + partial void OnDateRangeChanging(ref IgbDateRangeValue newValue); + [Parameter] + public IgbDateRangeValue DateRange + { + get { return this._dateRange; } + set + { + OnDateRangeChanging(ref value); + MarkPropDirty("DateRange"); + if (this._dateRange != null) + { + this.DetachChild(this._dateRange); + } + if (value != null) + { + this.AttachChild(value); + } + this._dateRange = value; + } + + } + + partial void FindByNameCustomDateRange(string name, ref object item); + public override object FindByName(string name) + { + + var baseResult = base.FindByName(name); + if (baseResult != null) + { + return baseResult; + } + + object item = null; + FindByNameCustomDateRange(name, ref item); + if (item != null) + { + return item; + } + + return null; + } + public async Task SetNativeElementAsync(Object element) + { + await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + } + public void SetNativeElement(Object element) + { + InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + } + + partial void SerializeCoreIgbCustomDateRange(RendererSerializer ser); + + internal override void SerializeCore(RendererSerializer ser) + { + base.SerializeCore(ser); + + SerializeCoreIgbCustomDateRange(ser); + + if (IsPropDirty("Label")) + { ser.AddStringProp("label", this._label); } + if (IsPropDirty("DateRange")) + { ser.AddSerializableProp("dateRange", this._dateRange); } + + } + + } } diff --git a/src/components/Blazor/DatePart.cs b/src/components/Blazor/DatePart.cs index 0c702c7e..4eaaebde 100644 --- a/src/components/Blazor/DatePart.cs +++ b/src/components/Blazor/DatePart.cs @@ -1,20 +1,21 @@ namespace IgniteUI.Blazor.Controls { -public enum DatePart { - [WCEnumName("month")] - Month, - [WCEnumName("year")] - Year, - [WCEnumName("date")] - Date, - [WCEnumName("hours")] - Hours, - [WCEnumName("minutes")] - Minutes, - [WCEnumName("seconds")] - Seconds, - [WCEnumName("amPm")] - AmPm + public enum DatePart + { + [WCEnumName("month")] + Month, + [WCEnumName("year")] + Year, + [WCEnumName("date")] + Date, + [WCEnumName("hours")] + Hours, + [WCEnumName("minutes")] + Minutes, + [WCEnumName("seconds")] + Seconds, + [WCEnumName("amPm")] + AmPm -} + } } diff --git a/src/components/Blazor/DatePartDeltas.cs b/src/components/Blazor/DatePartDeltas.cs index bcff40d9..765293cb 100644 --- a/src/components/Blazor/DatePartDeltas.cs +++ b/src/components/Blazor/DatePartDeltas.cs @@ -1,152 +1,164 @@ - -using System; using Microsoft.AspNetCore.Components; -using Microsoft.AspNetCore.Components.Rendering; -using System.Threading.Tasks; -using System.Collections.Generic; -using System.Linq; namespace IgniteUI.Blazor.Controls { - public partial class IgbDatePartDeltas: BaseRendererElement { - public override string Type { get { return "DatePartDeltas"; } } - - - public IgbDatePartDeltas(): base() { - OnCreatedIgbDatePartDeltas(); - - - } - - partial void OnCreatedIgbDatePartDeltas(); - - private double _date = 0; - - partial void OnDateChanging(ref double newValue); - [Parameter] - public double Date - { - get { return this._date; } - set { - if (this._date != value || !IsPropDirty("Date")) { - MarkPropDirty("Date"); - } - this._date = value; - - } - } - private double _month = 0; - - partial void OnMonthChanging(ref double newValue); - [Parameter] - public double Month - { - get { return this._month; } - set { - if (this._month != value || !IsPropDirty("Month")) { - MarkPropDirty("Month"); - } - this._month = value; - - } - } - private double _year = 0; - - partial void OnYearChanging(ref double newValue); - [Parameter] - public double Year - { - get { return this._year; } - set { - if (this._year != value || !IsPropDirty("Year")) { - MarkPropDirty("Year"); - } - this._year = value; - - } - } - private double _hours = 0; - - partial void OnHoursChanging(ref double newValue); - [Parameter] - public double Hours - { - get { return this._hours; } - set { - if (this._hours != value || !IsPropDirty("Hours")) { - MarkPropDirty("Hours"); - } - this._hours = value; - - } - } - private double _minutes = 0; - - partial void OnMinutesChanging(ref double newValue); - [Parameter] - public double Minutes - { - get { return this._minutes; } - set { - if (this._minutes != value || !IsPropDirty("Minutes")) { - MarkPropDirty("Minutes"); - } - this._minutes = value; - - } - } - private double _seconds = 0; - - partial void OnSecondsChanging(ref double newValue); - [Parameter] - public double Seconds - { - get { return this._seconds; } - set { - if (this._seconds != value || !IsPropDirty("Seconds")) { - MarkPropDirty("Seconds"); - } - this._seconds = value; - - } - } - - partial void FindByNameDatePartDeltas(string name, ref object item); - public override object FindByName(string name) - { - - var baseResult = base.FindByName(name); - if (baseResult != null) - { - return baseResult; - } - - object item = null; - FindByNameDatePartDeltas(name, ref item); - if (item != null) - { - return item; - } - - return null; - } - - partial void SerializeCoreIgbDatePartDeltas(RendererSerializer ser); - - internal override void SerializeCore(RendererSerializer ser) - { - base.SerializeCore(ser); - - SerializeCoreIgbDatePartDeltas(ser); - - if (IsPropDirty("Date")) { ser.AddNumberProp("date", this._date); } - if (IsPropDirty("Month")) { ser.AddNumberProp("month", this._month); } - if (IsPropDirty("Year")) { ser.AddNumberProp("year", this._year); } - if (IsPropDirty("Hours")) { ser.AddNumberProp("hours", this._hours); } - if (IsPropDirty("Minutes")) { ser.AddNumberProp("minutes", this._minutes); } - if (IsPropDirty("Seconds")) { ser.AddNumberProp("seconds", this._seconds); } - - } - -} + public partial class IgbDatePartDeltas : BaseRendererElement + { + public override string Type { get { return "DatePartDeltas"; } } + + public IgbDatePartDeltas() : base() + { + OnCreatedIgbDatePartDeltas(); + + } + + partial void OnCreatedIgbDatePartDeltas(); + + private double _date = 0; + + partial void OnDateChanging(ref double newValue); + [Parameter] + public double Date + { + get { return this._date; } + set + { + if (this._date != value || !IsPropDirty("Date")) + { + MarkPropDirty("Date"); + } + this._date = value; + + } + } + private double _month = 0; + + partial void OnMonthChanging(ref double newValue); + [Parameter] + public double Month + { + get { return this._month; } + set + { + if (this._month != value || !IsPropDirty("Month")) + { + MarkPropDirty("Month"); + } + this._month = value; + + } + } + private double _year = 0; + + partial void OnYearChanging(ref double newValue); + [Parameter] + public double Year + { + get { return this._year; } + set + { + if (this._year != value || !IsPropDirty("Year")) + { + MarkPropDirty("Year"); + } + this._year = value; + + } + } + private double _hours = 0; + + partial void OnHoursChanging(ref double newValue); + [Parameter] + public double Hours + { + get { return this._hours; } + set + { + if (this._hours != value || !IsPropDirty("Hours")) + { + MarkPropDirty("Hours"); + } + this._hours = value; + + } + } + private double _minutes = 0; + + partial void OnMinutesChanging(ref double newValue); + [Parameter] + public double Minutes + { + get { return this._minutes; } + set + { + if (this._minutes != value || !IsPropDirty("Minutes")) + { + MarkPropDirty("Minutes"); + } + this._minutes = value; + + } + } + private double _seconds = 0; + + partial void OnSecondsChanging(ref double newValue); + [Parameter] + public double Seconds + { + get { return this._seconds; } + set + { + if (this._seconds != value || !IsPropDirty("Seconds")) + { + MarkPropDirty("Seconds"); + } + this._seconds = value; + + } + } + + partial void FindByNameDatePartDeltas(string name, ref object item); + public override object FindByName(string name) + { + + var baseResult = base.FindByName(name); + if (baseResult != null) + { + return baseResult; + } + + object item = null; + FindByNameDatePartDeltas(name, ref item); + if (item != null) + { + return item; + } + + return null; + } + + partial void SerializeCoreIgbDatePartDeltas(RendererSerializer ser); + + internal override void SerializeCore(RendererSerializer ser) + { + base.SerializeCore(ser); + + SerializeCoreIgbDatePartDeltas(ser); + + if (IsPropDirty("Date")) + { ser.AddNumberProp("date", this._date); } + if (IsPropDirty("Month")) + { ser.AddNumberProp("month", this._month); } + if (IsPropDirty("Year")) + { ser.AddNumberProp("year", this._year); } + if (IsPropDirty("Hours")) + { ser.AddNumberProp("hours", this._hours); } + if (IsPropDirty("Minutes")) + { ser.AddNumberProp("minutes", this._minutes); } + if (IsPropDirty("Seconds")) + { ser.AddNumberProp("seconds", this._seconds); } + + } + + } } diff --git a/src/components/Blazor/DatePicker.cs b/src/components/Blazor/DatePicker.cs index 40191965..684d0879 100644 --- a/src/components/Blazor/DatePicker.cs +++ b/src/components/Blazor/DatePicker.cs @@ -1,1111 +1,1226 @@ - -using System; using Microsoft.AspNetCore.Components; -using Microsoft.AspNetCore.Components.Rendering; -using System.Threading.Tasks; -using System.Collections.Generic; -using System.Linq; namespace IgniteUI.Blazor.Controls { - /// -/// igc-date-picker is a feature rich component used for entering a date through manual text input or -/// choosing date values from a calendar dialog that pops up. -/// -public partial class IgbDatePicker: IgbComboBoxBaseLike { - public override string Type { get { return "WebDatePicker"; } } - - protected override void EnsureModulesLoaded() - { - if (!IgbDatePickerModule.IsLoadRequested(IgBlazor)) - { - IgbDatePickerModule.Register(IgBlazor); - } - } + /// + /// igc-date-picker is a feature rich component used for entering a date through manual text input or + /// choosing date values from a calendar dialog that pops up. + /// + public partial class IgbDatePicker : IgbComboBoxBaseLike + { + public override string Type { get { return "WebDatePicker"; } } + + protected override void EnsureModulesLoaded() + { + if (!IgbDatePickerModule.IsLoadRequested(IgBlazor)) + { + IgbDatePickerModule.Register(IgBlazor); + } + } + + protected override string ResolveDisplay() + { + return "inline-block"; + } + + protected override bool SupportsVisualChildren + { + get + { + return true; + } + } + + public IgbDatePicker() : base() + { + OnCreatedIgbDatePicker(); + + } + + partial void OnCreatedIgbDatePicker(); + + private string _label; + + partial void OnLabelChanging(ref string newValue); + /// + /// The label of the datepicker. + /// + [Parameter] + public string Label + { + get { return this._label; } + set + { + if (this._label != value || !IsPropDirty("Label")) + { + MarkPropDirty("Label"); + } + this._label = value; + + } + } + private PickerMode _mode = PickerMode.Dropdown; + + partial void OnModeChanging(ref PickerMode newValue); + /// + /// Determines whether the calendar is opened in a dropdown or a modal dialog + /// + [Parameter] + public PickerMode Mode + { + get { return this._mode; } + set + { + if (this._mode != value || !IsPropDirty("Mode")) + { + MarkPropDirty("Mode"); + } + this._mode = value; + + } + } + private bool _nonEditable = false; + + partial void OnNonEditableChanging(ref bool newValue); + /// + /// Whether to allow typing in the input. + /// + [Parameter] + public bool NonEditable + { + get { return this._nonEditable; } + set + { + if (this._nonEditable != value || !IsPropDirty("NonEditable")) + { + MarkPropDirty("NonEditable"); + } + this._nonEditable = value; + + } + } + private bool _readOnly = false; + + partial void OnReadOnlyChanging(ref bool newValue); + /// + /// Makes the control a readonly field. + /// + [Parameter] + [WCAttributeName("readonly")] + public bool ReadOnly + { + get { return this._readOnly; } + set + { + if (this._readOnly != value || !IsPropDirty("ReadOnly")) + { + MarkPropDirty("ReadOnly"); + } + this._readOnly = value; + + } + } + private DateTime? _value = DateTime.MinValue; + + partial void OnValueChanging(ref DateTime? newValue); + /// + /// The value of the picker + /// + [Parameter] + public DateTime? Value + { + get { return this._value; } + set + { + if (this._value != value || !IsPropDirty("Value")) + { + MarkPropDirty("Value"); + } + this._value = value; + + } + } + public async Task GetCurrentValueAsync() + { + var iv = await InvokeMethod("p:Value", new object[] { }, new string[] { }); + return ReturnToDate(iv); + } + public DateTime? GetCurrentValue() + { + var iv = InvokeMethodSync("p:Value", new object[] { }, new string[] { }); + return ReturnToDate(iv); + } + private DateTime _activeDate = DateTime.MinValue; + + partial void OnActiveDateChanging(ref DateTime newValue); + /// + /// Gets/Sets the date which is shown in the calendar picker and is highlighted. + /// By default it is the current date. + /// + [Parameter] + public DateTime ActiveDate + { + get { return this._activeDate; } + set + { + if (this._activeDate != value || !IsPropDirty("ActiveDate")) + { + MarkPropDirty("ActiveDate"); + } + this._activeDate = value; + + } + } + private DateTime? _min = DateTime.MinValue; + + partial void OnMinChanging(ref DateTime? newValue); + /// + /// The minimum value required for the date picker to remain valid. + /// + [Parameter] + public DateTime? Min + { + get { return this._min; } + set + { + if (this._min != value || !IsPropDirty("Min")) + { + MarkPropDirty("Min"); + } + this._min = value; + + } + } + private DateTime? _max = DateTime.MinValue; + + partial void OnMaxChanging(ref DateTime? newValue); + /// + /// The maximum value required for the date picker to remain valid. + /// + [Parameter] + public DateTime? Max + { + get { return this._max; } + set + { + if (this._max != value || !IsPropDirty("Max")) + { + MarkPropDirty("Max"); + } + this._max = value; + + } + } + private CalendarHeaderOrientation _headerOrientation = CalendarHeaderOrientation.Horizontal; + + partial void OnHeaderOrientationChanging(ref CalendarHeaderOrientation newValue); + /// + /// The orientation of the calendar header. + /// + [Parameter] + public CalendarHeaderOrientation HeaderOrientation + { + get { return this._headerOrientation; } + set + { + if (this._headerOrientation != value || !IsPropDirty("HeaderOrientation")) + { + MarkPropDirty("HeaderOrientation"); + } + this._headerOrientation = value; + + } + } + private ContentOrientation _orientation = ContentOrientation.Horizontal; + + partial void OnOrientationChanging(ref ContentOrientation newValue); + /// + /// The orientation of the multiple months displayed in the calendar's days view. + /// + [Parameter] + public ContentOrientation Orientation + { + get { return this._orientation; } + set + { + if (this._orientation != value || !IsPropDirty("Orientation")) + { + MarkPropDirty("Orientation"); + } + this._orientation = value; + + } + } + private bool _hideHeader = false; + + partial void OnHideHeaderChanging(ref bool newValue); + /// + /// Determines whether the calendar hides its header. + /// + [Parameter] + public bool HideHeader + { + get { return this._hideHeader; } + set + { + if (this._hideHeader != value || !IsPropDirty("HideHeader")) + { + MarkPropDirty("HideHeader"); + } + this._hideHeader = value; + + } + } + private bool _hideOutsideDays = false; + + partial void OnHideOutsideDaysChanging(ref bool newValue); + /// + /// Controls the visibility of the dates that do not belong to the current month. + /// + [Parameter] + public bool HideOutsideDays + { + get { return this._hideOutsideDays; } + set + { + if (this._hideOutsideDays != value || !IsPropDirty("HideOutsideDays")) + { + MarkPropDirty("HideOutsideDays"); + } + this._hideOutsideDays = value; + + } + } + private IgbDateRangeDescriptor[] _disabledDates; + + partial void OnDisabledDatesChanging(ref IgbDateRangeDescriptor[] newValue); + /// + /// Gets/sets disabled dates. + /// + [Parameter] + public IgbDateRangeDescriptor[] DisabledDates + { + get { return this._disabledDates; } + set + { + if (this._disabledDates != value || !IsPropDirty("DisabledDates")) + { + MarkPropDirty("DisabledDates"); + } + this._disabledDates = value; + + } + } + private IgbDateRangeDescriptor[] _specialDates; + + partial void OnSpecialDatesChanging(ref IgbDateRangeDescriptor[] newValue); + /// + /// Gets/sets special dates. + /// + [Parameter] + public IgbDateRangeDescriptor[] SpecialDates + { + get { return this._specialDates; } + set + { + if (this._specialDates != value || !IsPropDirty("SpecialDates")) + { + MarkPropDirty("SpecialDates"); + } + this._specialDates = value; + + } + } + private bool _outlined = false; + + partial void OnOutlinedChanging(ref bool newValue); + /// + /// Whether the control will have outlined appearance. + /// + [Parameter] + public bool Outlined + { + get { return this._outlined; } + set + { + if (this._outlined != value || !IsPropDirty("Outlined")) + { + MarkPropDirty("Outlined"); + } + this._outlined = value; + + } + } + private string _placeholder; + + partial void OnPlaceholderChanging(ref string newValue); + /// + /// The placeholder attribute of the control. + /// + [Parameter] + public string Placeholder + { + get { return this._placeholder; } + set + { + if (this._placeholder != value || !IsPropDirty("Placeholder")) + { + MarkPropDirty("Placeholder"); + } + this._placeholder = value; + + } + } + private double _visibleMonths = 0; + + partial void OnVisibleMonthsChanging(ref double newValue); + /// + /// The number of months displayed in the calendar. + /// + [Parameter] + public double VisibleMonths + { + get { return this._visibleMonths; } + set + { + if (this._visibleMonths != value || !IsPropDirty("VisibleMonths")) + { + MarkPropDirty("VisibleMonths"); + } + this._visibleMonths = value; + + } + } + private bool _showWeekNumbers = false; + + partial void OnShowWeekNumbersChanging(ref bool newValue); + /// + /// Whether to show the number of the week in the calendar. + /// + [Parameter] + public bool ShowWeekNumbers + { + get { return this._showWeekNumbers; } + set + { + if (this._showWeekNumbers != value || !IsPropDirty("ShowWeekNumbers")) + { + MarkPropDirty("ShowWeekNumbers"); + } + this._showWeekNumbers = value; + + } + } + private string _displayFormat; + + partial void OnDisplayFormatChanging(ref string newValue); + /// + /// Format to display the value in when not editing. + /// Defaults to the locale format if not set. + /// + [Parameter] + public string DisplayFormat + { + get { return this._displayFormat; } + set + { + if (this._displayFormat != value || !IsPropDirty("DisplayFormat")) + { + MarkPropDirty("DisplayFormat"); + } + this._displayFormat = value; + + } + } + private string _inputFormat; + + partial void OnInputFormatChanging(ref string newValue); + /// + /// The date format to apply on the input. + /// Defaults to the current locale Intl.DateTimeFormat + /// + [Parameter] + public string InputFormat + { + get { return this._inputFormat; } + set + { + if (this._inputFormat != value || !IsPropDirty("InputFormat")) + { + MarkPropDirty("InputFormat"); + } + this._inputFormat = value; + + } + } + private string _prompt; + + partial void OnPromptChanging(ref string newValue); + /// + /// The prompt symbol to use for unfilled parts of the mask. + /// + [Parameter] + public string Prompt + { + get { return this._prompt; } + set + { + if (this._prompt != value || !IsPropDirty("Prompt")) + { + MarkPropDirty("Prompt"); + } + this._prompt = value; + + } + } + private string _locale; + + partial void OnLocaleChanging(ref string newValue); + /// + /// Gets/Sets the locale used for formatting the display value. + /// + [Parameter] + public string Locale + { + get { return this._locale; } + set + { + if (this._locale != value || !IsPropDirty("Locale")) + { + MarkPropDirty("Locale"); + } + this._locale = value; + + } + } + private IgbCalendarResourceStrings _resourceStrings; + + partial void OnResourceStringsChanging(ref IgbCalendarResourceStrings newValue); + /// + /// The resource strings for localization. + /// + [Parameter] + public IgbCalendarResourceStrings ResourceStrings + { + get { return this._resourceStrings; } + set + { + OnResourceStringsChanging(ref value); + MarkPropDirty("ResourceStrings"); + if (this._resourceStrings != null) + { + this.DetachChild(this._resourceStrings); + } + if (value != null) + { + this.AttachChild(value); + } + this._resourceStrings = value; + } + + } + private WeekDays _weekStart = WeekDays.Sunday; + + partial void OnWeekStartChanging(ref WeekDays newValue); + /// + /// Sets the start day of the week for the calendar. + /// + [Parameter] + public WeekDays WeekStart + { + get { return this._weekStart; } + set + { + if (this._weekStart != value || !IsPropDirty("WeekStart")) + { + MarkPropDirty("WeekStart"); + } + this._weekStart = value; + + } + } + private bool _disabled = false; + + partial void OnDisabledChanging(ref bool newValue); + /// + /// The disabled state of the component + /// + [Parameter] + public bool Disabled + { + get { return this._disabled; } + set + { + if (this._disabled != value || !IsPropDirty("Disabled")) + { + MarkPropDirty("Disabled"); + } + this._disabled = value; - protected override string ResolveDisplay() + } + } + private bool _required = false; + + partial void OnRequiredChanging(ref bool newValue); + /// + /// Makes the control a required field in a form context. + /// + [Parameter] + public bool Required + { + get { return this._required; } + set + { + if (this._required != value || !IsPropDirty("Required")) + { + MarkPropDirty("Required"); + } + this._required = value; + + } + } + private bool _invalid = false; + + partial void OnInvalidChanging(ref bool newValue); + /// + /// Control the validity of the control. + /// + [Parameter] + public bool Invalid + { + get { return this._invalid; } + set + { + if (this._invalid != value || !IsPropDirty("Invalid")) + { + MarkPropDirty("Invalid"); + } + this._invalid = value; + + } + } + + partial void FindByNameDatePicker(string name, ref object item); + public override object FindByName(string name) + { + + var baseResult = base.FindByName(name); + if (baseResult != null) + { + return baseResult; + } + + object item = null; + FindByNameDatePicker(name, ref item); + if (item != null) + { + return item; + } + + return null; + } + /// + /// Clears the input part of the component of any user input + /// + public async Task ClearAsync() + { + await InvokeMethod("clear", new object[] { }, new string[] { }); + } + public void Clear() + { + InvokeMethodSync("clear", new object[] { }, new string[] { }); + } + public async Task StepUpAsync(DatePart? datePart = null, double delta = -1) + { + await InvokeMethod("stepUp", new object[] { ObjectToParam(datePart, typeof(DatePart)), delta }, new string[] { "Json", "Number" }); + } + public void StepUp(DatePart? datePart = null, double delta = -1) + { + InvokeMethodSync("stepUp", new object[] { ObjectToParam(datePart, typeof(DatePart)), delta }, new string[] { "Json", "Number" }); + } + public async Task StepDownAsync(DatePart? datePart = null, double delta = -1) + { + await InvokeMethod("stepDown", new object[] { ObjectToParam(datePart, typeof(DatePart)), delta }, new string[] { "Json", "Number" }); + } + public void StepDown(DatePart? datePart = null, double delta = -1) + { + InvokeMethodSync("stepDown", new object[] { ObjectToParam(datePart, typeof(DatePart)), delta }, new string[] { "Json", "Number" }); + } + /// + /// Selects the text in the input of the component + /// + public async Task SelectAsync() + { + await InvokeMethod("select", new object[] { }, new string[] { }); + } + public void Select() + { + InvokeMethodSync("select", new object[] { }, new string[] { }); + } + /// + /// Checks for validity of the control and shows the browser message if it invalid. + /// + public async Task ReportValidityAsync() + { + await InvokeMethod("reportValidity", new object[] { }, new string[] { }); + } + public void ReportValidity() + { + InvokeMethodSync("reportValidity", new object[] { }, new string[] { }); + } + /// + /// Checks for validity of the control and emits the invalid event if it invalid. + /// + public async Task CheckValidityAsync() + { + await InvokeMethod("checkValidity", new object[] { }, new string[] { }); + } + public void CheckValidity() + { + InvokeMethodSync("checkValidity", new object[] { }, new string[] { }); + } + /// + /// Sets a custom validation message for the control. + /// As long as `message` is not empty, the control is considered invalid. + /// + public async Task SetCustomValidityAsync(String message) + { + await InvokeMethod("setCustomValidity", new object[] { StringToString(message) }, new string[] { "String" }); + } + public void SetCustomValidity(String message) + { + InvokeMethodSync("setCustomValidity", new object[] { StringToString(message) }, new string[] { "String" }); + } + + private EventCallback? _valueChanged = null; + [Parameter] + public EventCallback ValueChanged + { + get + { + return this._valueChanged != null ? this._valueChanged.Value : EventCallback.Empty; + } + set + { + if (!value.Equals(EventCallback.Empty)) + { + if (!CompareEventCallbacks(value, _valueChanged, ref eventCallbacksCache)) + { + this.EnsureChangeHandled(); + + _valueChanged = value; + } + } + else + { + _valueChanged = null; + } + } + } + + private string _openingRef = null; + private string _openingScript = null; + [Parameter] + public string OpeningScript + { + + set + { + if (value != this._openingScript) + { + this._openingScript = value; + this.OnRefChanged("Opening", null, value, true, false, (string refName, object oldValue, object newValue) => + { + this._openingRef = refName; + this.MarkPropDirty("OpeningRef"); + }); + } + } + get + { + return this._openingScript; + } + } + + partial void OnHandlingOpening(IgbVoidEventArgs args); + private EventCallback? _opening = null; + [Parameter] + public EventCallback Opening + { + get + { + return this._opening != null ? this._opening.Value : EventCallback.Empty; + } + set + { + if (!value.Equals(EventCallback.Empty)) + { + if (!CompareEventCallbacks(value, _opening, ref eventCallbacksCache)) + { + _opening = value; + this.SetHandler(this.Name, "Opening", value, (args) => + { + OnHandlingOpening(args); + + }); + this.OnRefChanged("Opening", null, "event:::Opening", true, false, (refName, oldValue, newValue) => + { + this._openingRef = refName; + this.MarkPropDirty("OpeningRef"); + }); + } + } + else + { + _opening = null; + this.SetHandler(this.Name, "Opening", null); + this.OnRefChanged("Opening", null, null, true, false, (refName, oldValue, newValue) => + { + this._openingRef = null; + this.MarkPropDirty("OpeningRef"); + }); + } + } + } + + private string _openedRef = null; + private string _openedScript = null; + [Parameter] + public string OpenedScript + { + + set + { + if (value != this._openedScript) + { + this._openedScript = value; + this.OnRefChanged("Opened", null, value, true, false, (string refName, object oldValue, object newValue) => + { + this._openedRef = refName; + this.MarkPropDirty("OpenedRef"); + }); + } + } + get + { + return this._openedScript; + } + } + + partial void OnHandlingOpened(IgbVoidEventArgs args); + private EventCallback? _opened = null; + [Parameter] + public EventCallback Opened + { + get + { + return this._opened != null ? this._opened.Value : EventCallback.Empty; + } + set + { + if (!value.Equals(EventCallback.Empty)) + { + if (!CompareEventCallbacks(value, _opened, ref eventCallbacksCache)) + { + _opened = value; + this.SetHandler(this.Name, "Opened", value, (args) => + { + OnHandlingOpened(args); + + }); + this.OnRefChanged("Opened", null, "event:::Opened", true, false, (refName, oldValue, newValue) => + { + this._openedRef = refName; + this.MarkPropDirty("OpenedRef"); + }); + } + } + else + { + _opened = null; + this.SetHandler(this.Name, "Opened", null); + this.OnRefChanged("Opened", null, null, true, false, (refName, oldValue, newValue) => + { + this._openedRef = null; + this.MarkPropDirty("OpenedRef"); + }); + } + } + } + + private string _closingRef = null; + private string _closingScript = null; + [Parameter] + public string ClosingScript + { + + set + { + if (value != this._closingScript) + { + this._closingScript = value; + this.OnRefChanged("Closing", null, value, true, false, (string refName, object oldValue, object newValue) => + { + this._closingRef = refName; + this.MarkPropDirty("ClosingRef"); + }); + } + } + get + { + return this._closingScript; + } + } + + partial void OnHandlingClosing(IgbVoidEventArgs args); + private EventCallback? _closing = null; + [Parameter] + public EventCallback Closing + { + get + { + return this._closing != null ? this._closing.Value : EventCallback.Empty; + } + set + { + if (!value.Equals(EventCallback.Empty)) + { + if (!CompareEventCallbacks(value, _closing, ref eventCallbacksCache)) + { + _closing = value; + this.SetHandler(this.Name, "Closing", value, (args) => + { + OnHandlingClosing(args); + + }); + this.OnRefChanged("Closing", null, "event:::Closing", true, false, (refName, oldValue, newValue) => + { + this._closingRef = refName; + this.MarkPropDirty("ClosingRef"); + }); + } + } + else + { + _closing = null; + this.SetHandler(this.Name, "Closing", null); + this.OnRefChanged("Closing", null, null, true, false, (refName, oldValue, newValue) => + { + this._closingRef = null; + this.MarkPropDirty("ClosingRef"); + }); + } + } + } + + private string _closedRef = null; + private string _closedScript = null; + [Parameter] + public string ClosedScript + { + + set + { + if (value != this._closedScript) + { + this._closedScript = value; + this.OnRefChanged("Closed", null, value, true, false, (string refName, object oldValue, object newValue) => + { + this._closedRef = refName; + this.MarkPropDirty("ClosedRef"); + }); + } + } + get + { + return this._closedScript; + } + } + + partial void OnHandlingClosed(IgbVoidEventArgs args); + private EventCallback? _closed = null; + [Parameter] + public EventCallback Closed + { + get + { + return this._closed != null ? this._closed.Value : EventCallback.Empty; + } + set + { + if (!value.Equals(EventCallback.Empty)) + { + if (!CompareEventCallbacks(value, _closed, ref eventCallbacksCache)) + { + _closed = value; + this.SetHandler(this.Name, "Closed", value, (args) => + { + OnHandlingClosed(args); + + }); + this.OnRefChanged("Closed", null, "event:::Closed", true, false, (refName, oldValue, newValue) => { - return "inline-block"; - } + this._closedRef = refName; + this.MarkPropDirty("ClosedRef"); + }); + } + } + else + { + _closed = null; + this.SetHandler(this.Name, "Closed", null); + this.OnRefChanged("Closed", null, null, true, false, (refName, oldValue, newValue) => + { + this._closedRef = null; + this.MarkPropDirty("ClosedRef"); + }); + } + } + } - protected override bool SupportsVisualChildren + private string _changeRef = null; + private string _changeScript = null; + [Parameter] + public string ChangeScript + { + + set + { + if (value != this._changeScript) + { + this._changeScript = value; + this.OnRefChanged("Change", null, value, true, false, (string refName, object oldValue, object newValue) => + { + this._changeRef = refName; + this.MarkPropDirty("ChangeRef"); + }); + } + } + get + { + return this._changeScript; + } + } + + partial void OnHandlingChange(IgbComponentDateValueChangedEventArgs args); + private EventCallback? _change = null; + [Parameter] + public EventCallback Change + { + get + { + return this._change != null ? this._change.Value : EventCallback.Empty; + } + set + { + if (!value.Equals(EventCallback.Empty)) + { + if (!CompareEventCallbacks(value, _change, ref eventCallbacksCache)) + { + _change = value; + this.SetHandler(this.Name, "Change", value, (args) => { - get + OnHandlingChange(args); + + var newValueValue = default(DateTime?); + + { + newValueValue = (DateTime?)(args.Detail); + ; + OnEventUpdatingValue(this._value, ref newValueValue); + if (UseDirectRender) { - return true; + //TODO: maybe we should be doing this for everything. Need to make sure we don't infinity bounce though. + this.Value = newValueValue; } - } - - public IgbDatePicker(): base() { - OnCreatedIgbDatePicker(); - - - } - - partial void OnCreatedIgbDatePicker(); - - private string _label; - - partial void OnLabelChanging(ref string newValue); - /// - /// The label of the datepicker. - /// - [Parameter] - public string Label - { - get { return this._label; } - set { - if (this._label != value || !IsPropDirty("Label")) { - MarkPropDirty("Label"); - } - this._label = value; - - } - } - private PickerMode _mode = PickerMode.Dropdown; - - partial void OnModeChanging(ref PickerMode newValue); - /// - /// Determines whether the calendar is opened in a dropdown or a modal dialog - /// - [Parameter] - public PickerMode Mode - { - get { return this._mode; } - set { - if (this._mode != value || !IsPropDirty("Mode")) { - MarkPropDirty("Mode"); - } - this._mode = value; - - } - } - private bool _nonEditable = false; - - partial void OnNonEditableChanging(ref bool newValue); - /// - /// Whether to allow typing in the input. - /// - [Parameter] - public bool NonEditable - { - get { return this._nonEditable; } - set { - if (this._nonEditable != value || !IsPropDirty("NonEditable")) { - MarkPropDirty("NonEditable"); - } - this._nonEditable = value; - - } - } - private bool _readOnly = false; - - partial void OnReadOnlyChanging(ref bool newValue); - /// - /// Makes the control a readonly field. - /// - [Parameter] - [WCAttributeName("readonly")] - public bool ReadOnly - { - get { return this._readOnly; } - set { - if (this._readOnly != value || !IsPropDirty("ReadOnly")) { - MarkPropDirty("ReadOnly"); - } - this._readOnly = value; - - } - } - private DateTime? _value = DateTime.MinValue; - - partial void OnValueChanging(ref DateTime? newValue); - /// - /// The value of the picker - /// - [Parameter] - public DateTime? Value - { - get { return this._value; } - set { - if (this._value != value || !IsPropDirty("Value")) { - MarkPropDirty("Value"); - } - this._value = value; - - } - } - public async Task GetCurrentValueAsync() - { - var iv = await InvokeMethod("p:Value", new object[] { }, new string[] { }); - return ReturnToDate(iv); - } - public DateTime? GetCurrentValue() - { - var iv = InvokeMethodSync("p:Value", new object[] { }, new string[] { }); - return ReturnToDate(iv); - } - private DateTime _activeDate = DateTime.MinValue; - - partial void OnActiveDateChanging(ref DateTime newValue); - /// - /// Gets/Sets the date which is shown in the calendar picker and is highlighted. - /// By default it is the current date. - /// - [Parameter] - public DateTime ActiveDate - { - get { return this._activeDate; } - set { - if (this._activeDate != value || !IsPropDirty("ActiveDate")) { - MarkPropDirty("ActiveDate"); - } - this._activeDate = value; - - } - } - private DateTime? _min = DateTime.MinValue; - - partial void OnMinChanging(ref DateTime? newValue); - /// - /// The minimum value required for the date picker to remain valid. - /// - [Parameter] - public DateTime? Min - { - get { return this._min; } - set { - if (this._min != value || !IsPropDirty("Min")) { - MarkPropDirty("Min"); - } - this._min = value; - - } - } - private DateTime? _max = DateTime.MinValue; - - partial void OnMaxChanging(ref DateTime? newValue); - /// - /// The maximum value required for the date picker to remain valid. - /// - [Parameter] - public DateTime? Max - { - get { return this._max; } - set { - if (this._max != value || !IsPropDirty("Max")) { - MarkPropDirty("Max"); - } - this._max = value; - - } - } - private CalendarHeaderOrientation _headerOrientation = CalendarHeaderOrientation.Horizontal; - - partial void OnHeaderOrientationChanging(ref CalendarHeaderOrientation newValue); - /// - /// The orientation of the calendar header. - /// - [Parameter] - public CalendarHeaderOrientation HeaderOrientation - { - get { return this._headerOrientation; } - set { - if (this._headerOrientation != value || !IsPropDirty("HeaderOrientation")) { - MarkPropDirty("HeaderOrientation"); - } - this._headerOrientation = value; - - } - } - private ContentOrientation _orientation = ContentOrientation.Horizontal; - - partial void OnOrientationChanging(ref ContentOrientation newValue); - /// - /// The orientation of the multiple months displayed in the calendar's days view. - /// - [Parameter] - public ContentOrientation Orientation - { - get { return this._orientation; } - set { - if (this._orientation != value || !IsPropDirty("Orientation")) { - MarkPropDirty("Orientation"); - } - this._orientation = value; - - } - } - private bool _hideHeader = false; - - partial void OnHideHeaderChanging(ref bool newValue); - /// - /// Determines whether the calendar hides its header. - /// - [Parameter] - public bool HideHeader - { - get { return this._hideHeader; } - set { - if (this._hideHeader != value || !IsPropDirty("HideHeader")) { - MarkPropDirty("HideHeader"); - } - this._hideHeader = value; - - } - } - private bool _hideOutsideDays = false; - - partial void OnHideOutsideDaysChanging(ref bool newValue); - /// - /// Controls the visibility of the dates that do not belong to the current month. - /// - [Parameter] - public bool HideOutsideDays - { - get { return this._hideOutsideDays; } - set { - if (this._hideOutsideDays != value || !IsPropDirty("HideOutsideDays")) { - MarkPropDirty("HideOutsideDays"); - } - this._hideOutsideDays = value; - - } - } - private IgbDateRangeDescriptor[] _disabledDates; - - partial void OnDisabledDatesChanging(ref IgbDateRangeDescriptor[] newValue); - /// - /// Gets/sets disabled dates. - /// - [Parameter] - public IgbDateRangeDescriptor[] DisabledDates - { - get { return this._disabledDates; } - set { - if (this._disabledDates != value || !IsPropDirty("DisabledDates")) { - MarkPropDirty("DisabledDates"); - } - this._disabledDates = value; - - } - } - private IgbDateRangeDescriptor[] _specialDates; - - partial void OnSpecialDatesChanging(ref IgbDateRangeDescriptor[] newValue); - /// - /// Gets/sets special dates. - /// - [Parameter] - public IgbDateRangeDescriptor[] SpecialDates - { - get { return this._specialDates; } - set { - if (this._specialDates != value || !IsPropDirty("SpecialDates")) { - MarkPropDirty("SpecialDates"); - } - this._specialDates = value; - - } - } - private bool _outlined = false; - - partial void OnOutlinedChanging(ref bool newValue); - /// - /// Whether the control will have outlined appearance. - /// - [Parameter] - public bool Outlined - { - get { return this._outlined; } - set { - if (this._outlined != value || !IsPropDirty("Outlined")) { - MarkPropDirty("Outlined"); - } - this._outlined = value; - - } - } - private string _placeholder; - - partial void OnPlaceholderChanging(ref string newValue); - /// - /// The placeholder attribute of the control. - /// - [Parameter] - public string Placeholder - { - get { return this._placeholder; } - set { - if (this._placeholder != value || !IsPropDirty("Placeholder")) { - MarkPropDirty("Placeholder"); - } - this._placeholder = value; - - } - } - private double _visibleMonths = 0; - - partial void OnVisibleMonthsChanging(ref double newValue); - /// - /// The number of months displayed in the calendar. - /// - [Parameter] - public double VisibleMonths - { - get { return this._visibleMonths; } - set { - if (this._visibleMonths != value || !IsPropDirty("VisibleMonths")) { - MarkPropDirty("VisibleMonths"); - } - this._visibleMonths = value; - - } - } - private bool _showWeekNumbers = false; - - partial void OnShowWeekNumbersChanging(ref bool newValue); - /// - /// Whether to show the number of the week in the calendar. - /// - [Parameter] - public bool ShowWeekNumbers - { - get { return this._showWeekNumbers; } - set { - if (this._showWeekNumbers != value || !IsPropDirty("ShowWeekNumbers")) { - MarkPropDirty("ShowWeekNumbers"); - } - this._showWeekNumbers = value; - - } - } - private string _displayFormat; - - partial void OnDisplayFormatChanging(ref string newValue); - /// - /// Format to display the value in when not editing. - /// Defaults to the locale format if not set. - /// - [Parameter] - public string DisplayFormat - { - get { return this._displayFormat; } - set { - if (this._displayFormat != value || !IsPropDirty("DisplayFormat")) { - MarkPropDirty("DisplayFormat"); - } - this._displayFormat = value; - - } - } - private string _inputFormat; - - partial void OnInputFormatChanging(ref string newValue); - /// - /// The date format to apply on the input. - /// Defaults to the current locale Intl.DateTimeFormat - /// - [Parameter] - public string InputFormat - { - get { return this._inputFormat; } - set { - if (this._inputFormat != value || !IsPropDirty("InputFormat")) { - MarkPropDirty("InputFormat"); - } - this._inputFormat = value; - - } - } - private string _prompt; - - partial void OnPromptChanging(ref string newValue); - /// - /// The prompt symbol to use for unfilled parts of the mask. - /// - [Parameter] - public string Prompt - { - get { return this._prompt; } - set { - if (this._prompt != value || !IsPropDirty("Prompt")) { - MarkPropDirty("Prompt"); - } - this._prompt = value; - - } - } - private string _locale; - - partial void OnLocaleChanging(ref string newValue); - /// - /// Gets/Sets the locale used for formatting the display value. - /// - [Parameter] - public string Locale - { - get { return this._locale; } - set { - if (this._locale != value || !IsPropDirty("Locale")) { - MarkPropDirty("Locale"); - } - this._locale = value; - - } - } - private IgbCalendarResourceStrings _resourceStrings; - - partial void OnResourceStringsChanging(ref IgbCalendarResourceStrings newValue); - /// - /// The resource strings for localization. - /// - [Parameter] - public IgbCalendarResourceStrings ResourceStrings - { - get { return this._resourceStrings; } - set { - OnResourceStringsChanging(ref value); - MarkPropDirty("ResourceStrings"); - if (this._resourceStrings != null) { - this.DetachChild(this._resourceStrings); - } - if (value != null) { - this.AttachChild(value); - } - this._resourceStrings = value; - } - - } - private WeekDays _weekStart = WeekDays.Sunday; - - partial void OnWeekStartChanging(ref WeekDays newValue); - /// - /// Sets the start day of the week for the calendar. - /// - [Parameter] - public WeekDays WeekStart - { - get { return this._weekStart; } - set { - if (this._weekStart != value || !IsPropDirty("WeekStart")) { - MarkPropDirty("WeekStart"); - } - this._weekStart = value; - - } - } - private bool _disabled = false; - - partial void OnDisabledChanging(ref bool newValue); - /// - /// The disabled state of the component - /// - [Parameter] - public bool Disabled - { - get { return this._disabled; } - set { - if (this._disabled != value || !IsPropDirty("Disabled")) { - MarkPropDirty("Disabled"); - } - this._disabled = value; - - } - } - private bool _required = false; - - partial void OnRequiredChanging(ref bool newValue); - /// - /// Makes the control a required field in a form context. - /// - [Parameter] - public bool Required - { - get { return this._required; } - set { - if (this._required != value || !IsPropDirty("Required")) { - MarkPropDirty("Required"); - } - this._required = value; - - } - } - private bool _invalid = false; - - partial void OnInvalidChanging(ref bool newValue); - /// - /// Control the validity of the control. - /// - [Parameter] - public bool Invalid - { - get { return this._invalid; } - set { - if (this._invalid != value || !IsPropDirty("Invalid")) { - MarkPropDirty("Invalid"); - } - this._invalid = value; - - } - } - - partial void FindByNameDatePicker(string name, ref object item); - public override object FindByName(string name) - { - - var baseResult = base.FindByName(name); - if (baseResult != null) - { - return baseResult; - } - - object item = null; - FindByNameDatePicker(name, ref item); - if (item != null) - { - return item; - } - - return null; - } - /// - /// Clears the input part of the component of any user input - /// - public async Task ClearAsync() - { - await InvokeMethod("clear", new object[] { }, new string[] { }); - } - public void Clear() - { - InvokeMethodSync("clear", new object[] { }, new string[] { }); - } - public async Task StepUpAsync(DatePart? datePart = null, double delta = -1) - { - await InvokeMethod("stepUp", new object[] { ObjectToParam(datePart, typeof(DatePart)), delta }, new string[] { "Json", "Number" }); - } - public void StepUp(DatePart? datePart = null, double delta = -1) - { - InvokeMethodSync("stepUp", new object[] { ObjectToParam(datePart, typeof(DatePart)), delta }, new string[] { "Json", "Number" }); - } - public async Task StepDownAsync(DatePart? datePart = null, double delta = -1) - { - await InvokeMethod("stepDown", new object[] { ObjectToParam(datePart, typeof(DatePart)), delta }, new string[] { "Json", "Number" }); - } - public void StepDown(DatePart? datePart = null, double delta = -1) - { - InvokeMethodSync("stepDown", new object[] { ObjectToParam(datePart, typeof(DatePart)), delta }, new string[] { "Json", "Number" }); - } - /// - /// Selects the text in the input of the component - /// - public async Task SelectAsync() - { - await InvokeMethod("select", new object[] { }, new string[] { }); - } - public void Select() - { - InvokeMethodSync("select", new object[] { }, new string[] { }); - } - /// - /// Checks for validity of the control and shows the browser message if it invalid. - /// - public async Task ReportValidityAsync() - { - await InvokeMethod("reportValidity", new object[] { }, new string[] { }); - } - public void ReportValidity() - { - InvokeMethodSync("reportValidity", new object[] { }, new string[] { }); - } - /// - /// Checks for validity of the control and emits the invalid event if it invalid. - /// - public async Task CheckValidityAsync() - { - await InvokeMethod("checkValidity", new object[] { }, new string[] { }); - } - public void CheckValidity() - { - InvokeMethodSync("checkValidity", new object[] { }, new string[] { }); - } - /// - /// Sets a custom validation message for the control. - /// As long as `message` is not empty, the control is considered invalid. - /// - public async Task SetCustomValidityAsync(String message) - { - await InvokeMethod("setCustomValidity", new object[] { StringToString(message) }, new string[] { "String" }); - } - public void SetCustomValidity(String message) - { - InvokeMethodSync("setCustomValidity", new object[] { StringToString(message) }, new string[] { "String" }); - } - - private EventCallback? _valueChanged = null; - [Parameter] - public EventCallback ValueChanged - { - get - { - return this._valueChanged != null ? this._valueChanged.Value : EventCallback.Empty; - } - set - { - if (!value.Equals(EventCallback.Empty)) - { - if (!CompareEventCallbacks(value, _valueChanged, ref eventCallbacksCache)) - { - this.EnsureChangeHandled(); - - _valueChanged = value; - } - } - else - { - _valueChanged = null; - } - } - } - - private string _openingRef = null; - private string _openingScript = null; - [Parameter] - public string OpeningScript { - - set - { - if (value != this._openingScript) - { - this._openingScript = value; - this.OnRefChanged("Opening", null, value, true, false, (string refName, object oldValue, object newValue) => { - this._openingRef = refName; - this.MarkPropDirty("OpeningRef"); - }); - } - } - get - { - return this._openingScript; - } - } - - partial void OnHandlingOpening(IgbVoidEventArgs args); - private EventCallback? _opening = null; - [Parameter] - public EventCallback Opening - { - get - { - return this._opening != null ? this._opening.Value : EventCallback.Empty; - } - set - { - if (!value.Equals(EventCallback.Empty)) - { - if (!CompareEventCallbacks(value, _opening, ref eventCallbacksCache)) - { - _opening = value; - this.SetHandler(this.Name, "Opening", value, (args) => { - OnHandlingOpening(args); - - }); - this.OnRefChanged("Opening", null, "event:::Opening", true, false, (refName, oldValue, newValue) => { - this._openingRef = refName; - this.MarkPropDirty("OpeningRef"); - }); - } - } - else - { - _opening = null; - this.SetHandler(this.Name, "Opening", null); - this.OnRefChanged("Opening", null, null, true, false, (refName, oldValue, newValue) => { - this._openingRef = null; - this.MarkPropDirty("OpeningRef"); - }); - } - } - } - - private string _openedRef = null; - private string _openedScript = null; - [Parameter] - public string OpenedScript { - - set - { - if (value != this._openedScript) - { - this._openedScript = value; - this.OnRefChanged("Opened", null, value, true, false, (string refName, object oldValue, object newValue) => { - this._openedRef = refName; - this.MarkPropDirty("OpenedRef"); - }); - } - } - get - { - return this._openedScript; - } - } - - partial void OnHandlingOpened(IgbVoidEventArgs args); - private EventCallback? _opened = null; - [Parameter] - public EventCallback Opened - { - get - { - return this._opened != null ? this._opened.Value : EventCallback.Empty; - } - set - { - if (!value.Equals(EventCallback.Empty)) - { - if (!CompareEventCallbacks(value, _opened, ref eventCallbacksCache)) - { - _opened = value; - this.SetHandler(this.Name, "Opened", value, (args) => { - OnHandlingOpened(args); - - }); - this.OnRefChanged("Opened", null, "event:::Opened", true, false, (refName, oldValue, newValue) => { - this._openedRef = refName; - this.MarkPropDirty("OpenedRef"); - }); - } - } - else - { - _opened = null; - this.SetHandler(this.Name, "Opened", null); - this.OnRefChanged("Opened", null, null, true, false, (refName, oldValue, newValue) => { - this._openedRef = null; - this.MarkPropDirty("OpenedRef"); - }); - } - } - } - - private string _closingRef = null; - private string _closingScript = null; - [Parameter] - public string ClosingScript { - - set - { - if (value != this._closingScript) - { - this._closingScript = value; - this.OnRefChanged("Closing", null, value, true, false, (string refName, object oldValue, object newValue) => { - this._closingRef = refName; - this.MarkPropDirty("ClosingRef"); - }); - } - } - get - { - return this._closingScript; - } - } - - partial void OnHandlingClosing(IgbVoidEventArgs args); - private EventCallback? _closing = null; - [Parameter] - public EventCallback Closing - { - get - { - return this._closing != null ? this._closing.Value : EventCallback.Empty; - } - set - { - if (!value.Equals(EventCallback.Empty)) - { - if (!CompareEventCallbacks(value, _closing, ref eventCallbacksCache)) - { - _closing = value; - this.SetHandler(this.Name, "Closing", value, (args) => { - OnHandlingClosing(args); - - }); - this.OnRefChanged("Closing", null, "event:::Closing", true, false, (refName, oldValue, newValue) => { - this._closingRef = refName; - this.MarkPropDirty("ClosingRef"); - }); - } - } - else - { - _closing = null; - this.SetHandler(this.Name, "Closing", null); - this.OnRefChanged("Closing", null, null, true, false, (refName, oldValue, newValue) => { - this._closingRef = null; - this.MarkPropDirty("ClosingRef"); - }); - } - } - } - - private string _closedRef = null; - private string _closedScript = null; - [Parameter] - public string ClosedScript { - - set - { - if (value != this._closedScript) - { - this._closedScript = value; - this.OnRefChanged("Closed", null, value, true, false, (string refName, object oldValue, object newValue) => { - this._closedRef = refName; - this.MarkPropDirty("ClosedRef"); - }); - } - } - get - { - return this._closedScript; - } - } - - partial void OnHandlingClosed(IgbVoidEventArgs args); - private EventCallback? _closed = null; - [Parameter] - public EventCallback Closed - { - get - { - return this._closed != null ? this._closed.Value : EventCallback.Empty; - } - set - { - if (!value.Equals(EventCallback.Empty)) - { - if (!CompareEventCallbacks(value, _closed, ref eventCallbacksCache)) - { - _closed = value; - this.SetHandler(this.Name, "Closed", value, (args) => { - OnHandlingClosed(args); - - }); - this.OnRefChanged("Closed", null, "event:::Closed", true, false, (refName, oldValue, newValue) => { - this._closedRef = refName; - this.MarkPropDirty("ClosedRef"); - }); - } - } - else - { - _closed = null; - this.SetHandler(this.Name, "Closed", null); - this.OnRefChanged("Closed", null, null, true, false, (refName, oldValue, newValue) => { - this._closedRef = null; - this.MarkPropDirty("ClosedRef"); - }); - } - } - } - - private string _changeRef = null; - private string _changeScript = null; - [Parameter] - public string ChangeScript { - - set - { - if (value != this._changeScript) - { - this._changeScript = value; - this.OnRefChanged("Change", null, value, true, false, (string refName, object oldValue, object newValue) => { - this._changeRef = refName; - this.MarkPropDirty("ChangeRef"); - }); - } - } - get - { - return this._changeScript; - } - } - - partial void OnHandlingChange(IgbComponentDateValueChangedEventArgs args); - private EventCallback? _change = null; - [Parameter] - public EventCallback Change - { - get - { - return this._change != null ? this._change.Value : EventCallback.Empty; - } - set - { - if (!value.Equals(EventCallback.Empty)) - { - if (!CompareEventCallbacks(value, _change, ref eventCallbacksCache)) - { - _change = value; - this.SetHandler(this.Name, "Change", value, (args) => { - OnHandlingChange(args); - - var newValueValue = default(DateTime?); - - - { - newValueValue = (DateTime?)(args.Detail); - ; - OnEventUpdatingValue(this._value, ref newValueValue); - if (UseDirectRender) { - //TODO: maybe we should be doing this for everything. Need to make sure we don't infinity bounce though. - this.Value = newValueValue; - } else { - this._value = newValueValue; - } - OnPropertyPropagatedOut(Name, "Value"); - } - - if (!EventCallback.Empty.Equals(ValueChanged)) - { - var task = ValueChanged.InvokeAsync(newValueValue); - if (task.Exception != null) - { - throw task.Exception; - } - } - - }); - this.OnRefChanged("Change", null, "event:::Change", true, false, (refName, oldValue, newValue) => { - this._changeRef = refName; - this.MarkPropDirty("ChangeRef"); - }); - } - } - else - { - _change = null; - this.SetHandler(this.Name, "Change", null); - this.OnRefChanged("Change", null, null, true, false, (refName, oldValue, newValue) => { - this._changeRef = null; - this.MarkPropDirty("ChangeRef"); - }); - } - } - } - internal void EnsureChangeHandled() - { - if (EventCallback.Empty.Equals(this.Change)) - { - this.Change = new EventCallback(null, (Action)((e) => { })); this._change = null; - } - } - - - private string _inputRef = null; - private string _inputScript = null; - [Parameter] - public string InputScript { - - set - { - if (value != this._inputScript) - { - this._inputScript = value; - this.OnRefChanged("Input", null, value, true, false, (string refName, object oldValue, object newValue) => { - this._inputRef = refName; - this.MarkPropDirty("InputRef"); - }); - } - } - get - { - return this._inputScript; - } - } - - partial void OnHandlingInput(IgbComponentDateValueChangedEventArgs args); - private EventCallback? _input = null; - [Parameter] - public EventCallback Input - { - get - { - return this._input != null ? this._input.Value : EventCallback.Empty; - } - set - { - if (!value.Equals(EventCallback.Empty)) - { - if (!CompareEventCallbacks(value, _input, ref eventCallbacksCache)) - { - _input = value; - this.SetHandler(this.Name, "Input", value, (args) => { - OnHandlingInput(args); - - }); - this.OnRefChanged("Input", null, "event:::Input", true, false, (refName, oldValue, newValue) => { - this._inputRef = refName; - this.MarkPropDirty("InputRef"); - }); - } - } - else - { - _input = null; - this.SetHandler(this.Name, "Input", null); - this.OnRefChanged("Input", null, null, true, false, (refName, oldValue, newValue) => { - this._inputRef = null; - this.MarkPropDirty("InputRef"); - }); - } - } - } - - partial void OnEventUpdatingValue(DateTime? oldValue, ref DateTime? newValue); - - partial void SerializeCoreIgbDatePicker(RendererSerializer ser); - - internal override void SerializeCore(RendererSerializer ser) - { - base.SerializeCore(ser); - - SerializeCoreIgbDatePicker(ser); - - if (IsPropDirty("Label")) { ser.AddStringProp("label", this._label); } - if (IsPropDirty("Mode")) { ser.AddEnumProp("mode", this._mode); } - if (IsPropDirty("NonEditable")) { ser.AddBooleanProp("nonEditable", this._nonEditable); } - if (IsPropDirty("ReadOnly")) { ser.AddBooleanProp("readOnly", this._readOnly); } - if (IsPropDirty("Value")) { ser.AddDateTimeProp("value", this._value); } - if (IsPropDirty("ActiveDate")) { ser.AddDateTimeProp("activeDate", this._activeDate); } - if (IsPropDirty("Min")) { ser.AddDateTimeProp("min", this._min); } - if (IsPropDirty("Max")) { ser.AddDateTimeProp("max", this._max); } - if (IsPropDirty("HeaderOrientation")) { ser.AddEnumProp("headerOrientation", this._headerOrientation); } - if (IsPropDirty("Orientation")) { ser.AddEnumProp("orientation", this._orientation); } - if (IsPropDirty("HideHeader")) { ser.AddBooleanProp("hideHeader", this._hideHeader); } - if (IsPropDirty("HideOutsideDays")) { ser.AddBooleanProp("hideOutsideDays", this._hideOutsideDays); } - if (IsPropDirty("DisabledDates")) { ser.AddSerializableArrayProp("disabledDates", this._disabledDates); } - if (IsPropDirty("SpecialDates")) { ser.AddSerializableArrayProp("specialDates", this._specialDates); } - if (IsPropDirty("Outlined")) { ser.AddBooleanProp("outlined", this._outlined); } - if (IsPropDirty("Placeholder")) { ser.AddStringProp("placeholder", this._placeholder); } - if (IsPropDirty("VisibleMonths")) { ser.AddNumberProp("visibleMonths", this._visibleMonths); } - if (IsPropDirty("ShowWeekNumbers")) { ser.AddBooleanProp("showWeekNumbers", this._showWeekNumbers); } - if (IsPropDirty("DisplayFormat")) { ser.AddStringProp("displayFormat", this._displayFormat); } - if (IsPropDirty("InputFormat")) { ser.AddStringProp("inputFormat", this._inputFormat); } - if (IsPropDirty("Prompt")) { ser.AddStringProp("prompt", this._prompt); } - if (IsPropDirty("Locale")) { ser.AddStringProp("locale", this._locale); } - if (IsPropDirty("ResourceStrings")) { ser.AddSerializableProp("resourceStrings", this._resourceStrings); } - if (IsPropDirty("WeekStart")) { ser.AddEnumProp("weekStart", this._weekStart); } - if (IsPropDirty("Disabled")) { ser.AddBooleanProp("disabled", this._disabled); } - if (IsPropDirty("Required")) { ser.AddBooleanProp("required", this._required); } - if (IsPropDirty("Invalid")) { ser.AddBooleanProp("invalid", this._invalid); } - if (IsPropDirty("OpeningRef")) { ser.AddStringProp("openingRef", this._openingRef); } - if (IsPropDirty("OpenedRef")) { ser.AddStringProp("openedRef", this._openedRef); } - if (IsPropDirty("ClosingRef")) { ser.AddStringProp("closingRef", this._closingRef); } - if (IsPropDirty("ClosedRef")) { ser.AddStringProp("closedRef", this._closedRef); } - if (IsPropDirty("ChangeRef")) { ser.AddStringProp("changeRef", this._changeRef); } - if (IsPropDirty("InputRef")) { ser.AddStringProp("inputRef", this._inputRef); } - - } - -} + else + { + this._value = newValueValue; + } + OnPropertyPropagatedOut(Name, "Value"); + } + + if (!EventCallback.Empty.Equals(ValueChanged)) + { + var task = ValueChanged.InvokeAsync(newValueValue); + if (task.Exception != null) + { + throw task.Exception; + } + } + + }); + this.OnRefChanged("Change", null, "event:::Change", true, false, (refName, oldValue, newValue) => + { + this._changeRef = refName; + this.MarkPropDirty("ChangeRef"); + }); + } + } + else + { + _change = null; + this.SetHandler(this.Name, "Change", null); + this.OnRefChanged("Change", null, null, true, false, (refName, oldValue, newValue) => + { + this._changeRef = null; + this.MarkPropDirty("ChangeRef"); + }); + } + } + } + internal void EnsureChangeHandled() + { + if (EventCallback.Empty.Equals(this.Change)) + { + this.Change = new EventCallback(null, (Action)((e) => { })); + this._change = null; + } + } + + private string _inputRef = null; + private string _inputScript = null; + [Parameter] + public string InputScript + { + + set + { + if (value != this._inputScript) + { + this._inputScript = value; + this.OnRefChanged("Input", null, value, true, false, (string refName, object oldValue, object newValue) => + { + this._inputRef = refName; + this.MarkPropDirty("InputRef"); + }); + } + } + get + { + return this._inputScript; + } + } + + partial void OnHandlingInput(IgbComponentDateValueChangedEventArgs args); + private EventCallback? _input = null; + [Parameter] + public EventCallback Input + { + get + { + return this._input != null ? this._input.Value : EventCallback.Empty; + } + set + { + if (!value.Equals(EventCallback.Empty)) + { + if (!CompareEventCallbacks(value, _input, ref eventCallbacksCache)) + { + _input = value; + this.SetHandler(this.Name, "Input", value, (args) => + { + OnHandlingInput(args); + + }); + this.OnRefChanged("Input", null, "event:::Input", true, false, (refName, oldValue, newValue) => + { + this._inputRef = refName; + this.MarkPropDirty("InputRef"); + }); + } + } + else + { + _input = null; + this.SetHandler(this.Name, "Input", null); + this.OnRefChanged("Input", null, null, true, false, (refName, oldValue, newValue) => + { + this._inputRef = null; + this.MarkPropDirty("InputRef"); + }); + } + } + } + + partial void OnEventUpdatingValue(DateTime? oldValue, ref DateTime? newValue); + + partial void SerializeCoreIgbDatePicker(RendererSerializer ser); + + internal override void SerializeCore(RendererSerializer ser) + { + base.SerializeCore(ser); + + SerializeCoreIgbDatePicker(ser); + + if (IsPropDirty("Label")) + { ser.AddStringProp("label", this._label); } + if (IsPropDirty("Mode")) + { ser.AddEnumProp("mode", this._mode); } + if (IsPropDirty("NonEditable")) + { ser.AddBooleanProp("nonEditable", this._nonEditable); } + if (IsPropDirty("ReadOnly")) + { ser.AddBooleanProp("readOnly", this._readOnly); } + if (IsPropDirty("Value")) + { ser.AddDateTimeProp("value", this._value); } + if (IsPropDirty("ActiveDate")) + { ser.AddDateTimeProp("activeDate", this._activeDate); } + if (IsPropDirty("Min")) + { ser.AddDateTimeProp("min", this._min); } + if (IsPropDirty("Max")) + { ser.AddDateTimeProp("max", this._max); } + if (IsPropDirty("HeaderOrientation")) + { ser.AddEnumProp("headerOrientation", this._headerOrientation); } + if (IsPropDirty("Orientation")) + { ser.AddEnumProp("orientation", this._orientation); } + if (IsPropDirty("HideHeader")) + { ser.AddBooleanProp("hideHeader", this._hideHeader); } + if (IsPropDirty("HideOutsideDays")) + { ser.AddBooleanProp("hideOutsideDays", this._hideOutsideDays); } + if (IsPropDirty("DisabledDates")) + { ser.AddSerializableArrayProp("disabledDates", this._disabledDates); } + if (IsPropDirty("SpecialDates")) + { ser.AddSerializableArrayProp("specialDates", this._specialDates); } + if (IsPropDirty("Outlined")) + { ser.AddBooleanProp("outlined", this._outlined); } + if (IsPropDirty("Placeholder")) + { ser.AddStringProp("placeholder", this._placeholder); } + if (IsPropDirty("VisibleMonths")) + { ser.AddNumberProp("visibleMonths", this._visibleMonths); } + if (IsPropDirty("ShowWeekNumbers")) + { ser.AddBooleanProp("showWeekNumbers", this._showWeekNumbers); } + if (IsPropDirty("DisplayFormat")) + { ser.AddStringProp("displayFormat", this._displayFormat); } + if (IsPropDirty("InputFormat")) + { ser.AddStringProp("inputFormat", this._inputFormat); } + if (IsPropDirty("Prompt")) + { ser.AddStringProp("prompt", this._prompt); } + if (IsPropDirty("Locale")) + { ser.AddStringProp("locale", this._locale); } + if (IsPropDirty("ResourceStrings")) + { ser.AddSerializableProp("resourceStrings", this._resourceStrings); } + if (IsPropDirty("WeekStart")) + { ser.AddEnumProp("weekStart", this._weekStart); } + if (IsPropDirty("Disabled")) + { ser.AddBooleanProp("disabled", this._disabled); } + if (IsPropDirty("Required")) + { ser.AddBooleanProp("required", this._required); } + if (IsPropDirty("Invalid")) + { ser.AddBooleanProp("invalid", this._invalid); } + if (IsPropDirty("OpeningRef")) + { ser.AddStringProp("openingRef", this._openingRef); } + if (IsPropDirty("OpenedRef")) + { ser.AddStringProp("openedRef", this._openedRef); } + if (IsPropDirty("ClosingRef")) + { ser.AddStringProp("closingRef", this._closingRef); } + if (IsPropDirty("ClosedRef")) + { ser.AddStringProp("closedRef", this._closedRef); } + if (IsPropDirty("ChangeRef")) + { ser.AddStringProp("changeRef", this._changeRef); } + if (IsPropDirty("InputRef")) + { ser.AddStringProp("inputRef", this._inputRef); } + + } + + } } diff --git a/src/components/Blazor/DatePickerModule.cs b/src/components/Blazor/DatePickerModule.cs index 17e8dee2..1356ae6d 100644 --- a/src/components/Blazor/DatePickerModule.cs +++ b/src/components/Blazor/DatePickerModule.cs @@ -1,27 +1,25 @@ -using System; -using System.Collections.Generic; -using System.Runtime.CompilerServices; -using System.Text; -using System.Collections.Generic; - namespace IgniteUI.Blazor.Controls { - public partial class IgbDatePickerModule { - public static void Register(IIgniteUIBlazor runtime) { + public partial class IgbDatePickerModule + { + public static void Register(IIgniteUIBlazor runtime) + { ModuleLoader.Load(runtime, "WebDatePickerModule"); IgbCalendarModule.MarkIsLoadRequested(runtime); -IgbDateTimeInputModule.MarkIsLoadRequested(runtime); -IgbDialogModule.MarkIsLoadRequested(runtime); -IgbIconModule.MarkIsLoadRequested(runtime); + IgbDateTimeInputModule.MarkIsLoadRequested(runtime); + IgbDialogModule.MarkIsLoadRequested(runtime); + IgbIconModule.MarkIsLoadRequested(runtime); } - public static void MarkIsLoadRequested(IIgniteUIBlazor runtime) { + public static void MarkIsLoadRequested(IIgniteUIBlazor runtime) + { ModuleLoader.MarkIsLoadRequested(runtime, "WebDatePickerModule"); } - public static bool IsLoadRequested(IIgniteUIBlazor runtime) { + public static bool IsLoadRequested(IIgniteUIBlazor runtime) + { return ModuleLoader.IsLoadRequested(runtime, "WebDatePickerModule"); } } diff --git a/src/components/Blazor/DateRangeDescriptor.cs b/src/components/Blazor/DateRangeDescriptor.cs index 4c54dc57..ed45e8dc 100644 --- a/src/components/Blazor/DateRangeDescriptor.cs +++ b/src/components/Blazor/DateRangeDescriptor.cs @@ -1,89 +1,89 @@ - -using System; using Microsoft.AspNetCore.Components; -using Microsoft.AspNetCore.Components.Rendering; -using System.Threading.Tasks; -using System.Collections.Generic; -using System.Linq; namespace IgniteUI.Blazor.Controls { - public partial class IgbDateRangeDescriptor: BaseRendererElement { - public override string Type { get { return "DateRangeDescriptor"; } } - - - public IgbDateRangeDescriptor(): base() { - OnCreatedIgbDateRangeDescriptor(); - - - } - - partial void OnCreatedIgbDateRangeDescriptor(); - - private DateRangeType _rangeType = DateRangeType.After; - - partial void OnRangeTypeChanging(ref DateRangeType newValue); - [Parameter] - [WCWidgetMemberName("Type")] - public DateRangeType RangeType - { - get { return this._rangeType; } - set { - if (this._rangeType != value || !IsPropDirty("RangeType")) { - MarkPropDirty("RangeType"); - } - this._rangeType = value; - - } - } - private object _dateRange; - - partial void OnDateRangeChanging(ref object newValue); - [Parameter] - public object DateRange - { - get { return this._dateRange; } - set { - if (this._dateRange != value || !IsPropDirty("DateRange")) { - MarkPropDirty("DateRange"); - } - this._dateRange = value; - - } - } - - partial void FindByNameDateRangeDescriptor(string name, ref object item); - public override object FindByName(string name) - { - - var baseResult = base.FindByName(name); - if (baseResult != null) - { - return baseResult; - } - - object item = null; - FindByNameDateRangeDescriptor(name, ref item); - if (item != null) - { - return item; - } - - return null; - } - - partial void SerializeCoreIgbDateRangeDescriptor(RendererSerializer ser); - - internal override void SerializeCore(RendererSerializer ser) - { - base.SerializeCore(ser); - - SerializeCoreIgbDateRangeDescriptor(ser); - - if (IsPropDirty("RangeType")) { ser.AddEnumProp("rangeType", this._rangeType); } - if (IsPropDirty("DateRange")) { ser.AddPrimitiveProp("dateRange", this._dateRange); } - - } - -} + public partial class IgbDateRangeDescriptor : BaseRendererElement + { + public override string Type { get { return "DateRangeDescriptor"; } } + + public IgbDateRangeDescriptor() : base() + { + OnCreatedIgbDateRangeDescriptor(); + + } + + partial void OnCreatedIgbDateRangeDescriptor(); + + private DateRangeType _rangeType = DateRangeType.After; + + partial void OnRangeTypeChanging(ref DateRangeType newValue); + [Parameter] + [WCWidgetMemberName("Type")] + public DateRangeType RangeType + { + get { return this._rangeType; } + set + { + if (this._rangeType != value || !IsPropDirty("RangeType")) + { + MarkPropDirty("RangeType"); + } + this._rangeType = value; + + } + } + private object _dateRange; + + partial void OnDateRangeChanging(ref object newValue); + [Parameter] + public object DateRange + { + get { return this._dateRange; } + set + { + if (this._dateRange != value || !IsPropDirty("DateRange")) + { + MarkPropDirty("DateRange"); + } + this._dateRange = value; + + } + } + + partial void FindByNameDateRangeDescriptor(string name, ref object item); + public override object FindByName(string name) + { + + var baseResult = base.FindByName(name); + if (baseResult != null) + { + return baseResult; + } + + object item = null; + FindByNameDateRangeDescriptor(name, ref item); + if (item != null) + { + return item; + } + + return null; + } + + partial void SerializeCoreIgbDateRangeDescriptor(RendererSerializer ser); + + internal override void SerializeCore(RendererSerializer ser) + { + base.SerializeCore(ser); + + SerializeCoreIgbDateRangeDescriptor(ser); + + if (IsPropDirty("RangeType")) + { ser.AddEnumProp("rangeType", this._rangeType); } + if (IsPropDirty("DateRange")) + { ser.AddPrimitiveProp("dateRange", this._dateRange); } + + } + + } } diff --git a/src/components/Blazor/DateRangePicker.cs b/src/components/Blazor/DateRangePicker.cs index 1220037a..e4f97a55 100644 --- a/src/components/Blazor/DateRangePicker.cs +++ b/src/components/Blazor/DateRangePicker.cs @@ -1,1257 +1,1395 @@ - -using System; -using Microsoft.AspNetCore.Components; -using Microsoft.AspNetCore.Components.Rendering; -using System.Threading.Tasks; -using System.Collections.Generic; -using System.Linq; using System.Text.Json; using System.Text.Json.Serialization; +using Microsoft.AspNetCore.Components; namespace IgniteUI.Blazor.Controls { - /// -/// The igc-date-range-picker allows the user to select a range of dates. -/// -public partial class IgbDateRangePicker: IgbComboBoxBaseLike { - public override string Type { get { return "WebDateRangePicker"; } } - - protected override void EnsureModulesLoaded() - { - if (!IgbDateRangePickerModule.IsLoadRequested(IgBlazor)) - { - IgbDateRangePickerModule.Register(IgBlazor); - } - } + /// + /// The igc-date-range-picker allows the user to select a range of dates. + /// + public partial class IgbDateRangePicker : IgbComboBoxBaseLike + { + public override string Type { get { return "WebDateRangePicker"; } } + + protected override void EnsureModulesLoaded() + { + if (!IgbDateRangePickerModule.IsLoadRequested(IgBlazor)) + { + IgbDateRangePickerModule.Register(IgBlazor); + } + } + + protected override string ResolveDisplay() + { + return "inline-block"; + } + + protected override bool SupportsVisualChildren + { + get + { + return true; + } + } + + public IgbDateRangePicker() : base() + { + OnCreatedIgbDateRangePicker(); + + } + + partial void OnCreatedIgbDateRangePicker(); + + private IgbDateRangeValue? _value; + + partial void OnValueChanging(ref IgbDateRangeValue? newValue); + /// + /// The value of the picker + /// + [Parameter] + public IgbDateRangeValue? Value + { + get { return this._value; } + set + { + OnValueChanging(ref value); + MarkPropDirty("Value"); + if (this._value != null) + { + this.DetachChild(this._value); + } + if (value != null) + { + this.AttachChild(value); + } + this._value = value; + } + + } + public async Task GetCurrentValueAsync() + { + var iv = await InvokeMethod("p:Value", new object[] { }, new string[] { }); + + if (iv == null) + { + return default(IgbDateRangeValue); + } + var retVal = (IgbDateRangeValue)ConvertReturnValue(iv); + if (retVal == null) + { + return default(IgbDateRangeValue); + } + return retVal; + + } + public IgbDateRangeValue? GetCurrentValue() + { + var iv = InvokeMethodSync("p:Value", new object[] { }, new string[] { }); + + if (iv == null) + { + return default(IgbDateRangeValue); + } + var retVal = (IgbDateRangeValue)ConvertReturnValue(iv); + if (retVal == null) + { + return default(IgbDateRangeValue); + } + return retVal; + + } + private IgbCustomDateRange[] _customRanges; + + partial void OnCustomRangesChanging(ref IgbCustomDateRange[] newValue); + /// + /// Renders chips with custom ranges based on the elements of the array. + /// + [Parameter] + public IgbCustomDateRange[] CustomRanges + { + get { return this._customRanges; } + set + { + if (this._customRanges != value || !IsPropDirty("CustomRanges")) + { + MarkPropDirty("CustomRanges"); + } + this._customRanges = value; + + } + } + private PickerMode _mode = PickerMode.Dropdown; + + partial void OnModeChanging(ref PickerMode newValue); + /// + /// Determines whether the calendar is opened in a dropdown or a modal dialog + /// + [Parameter] + public PickerMode Mode + { + get { return this._mode; } + set + { + if (this._mode != value || !IsPropDirty("Mode")) + { + MarkPropDirty("Mode"); + } + this._mode = value; + + } + } + private bool _useTwoInputs = false; + + partial void OnUseTwoInputsChanging(ref bool newValue); + /// + /// Use two inputs to display the date range values. Makes the input editable in dropdown mode. + /// + [Parameter] + public bool UseTwoInputs + { + get { return this._useTwoInputs; } + set + { + if (this._useTwoInputs != value || !IsPropDirty("UseTwoInputs")) + { + MarkPropDirty("UseTwoInputs"); + } + this._useTwoInputs = value; + + } + } + private bool _usePredefinedRanges = false; + + partial void OnUsePredefinedRangesChanging(ref bool newValue); + /// + /// Whether the control will show chips with predefined ranges. + /// + [Parameter] + public bool UsePredefinedRanges + { + get { return this._usePredefinedRanges; } + set + { + if (this._usePredefinedRanges != value || !IsPropDirty("UsePredefinedRanges")) + { + MarkPropDirty("UsePredefinedRanges"); + } + this._usePredefinedRanges = value; + + } + } + private string _locale; + + partial void OnLocaleChanging(ref string newValue); + /// + /// The locale settings used to display the value. + /// + [Parameter] + public string Locale + { + get { return this._locale; } + set + { + if (this._locale != value || !IsPropDirty("Locale")) + { + MarkPropDirty("Locale"); + } + this._locale = value; + + } + } + private IgbDateRangePickerResourceStrings _resourceStrings; + + partial void OnResourceStringsChanging(ref IgbDateRangePickerResourceStrings newValue); + /// + /// The resource strings of the date range picker. + /// + [Parameter] + public IgbDateRangePickerResourceStrings ResourceStrings + { + get { return this._resourceStrings; } + set + { + OnResourceStringsChanging(ref value); + MarkPropDirty("ResourceStrings"); + if (this._resourceStrings != null) + { + this.DetachChild(this._resourceStrings); + } + if (value != null) + { + this.AttachChild(value); + } + this._resourceStrings = value; + } + + } + private bool _readOnly = false; + + partial void OnReadOnlyChanging(ref bool newValue); + /// + /// Makes the control a readonly field. + /// + [Parameter] + [WCAttributeName("readonly")] + public bool ReadOnly + { + get { return this._readOnly; } + set + { + if (this._readOnly != value || !IsPropDirty("ReadOnly")) + { + MarkPropDirty("ReadOnly"); + } + this._readOnly = value; + + } + } + private bool _nonEditable = false; + + partial void OnNonEditableChanging(ref bool newValue); + /// + /// Whether to allow typing in the input. + /// + [Parameter] + public bool NonEditable + { + get { return this._nonEditable; } + set + { + if (this._nonEditable != value || !IsPropDirty("NonEditable")) + { + MarkPropDirty("NonEditable"); + } + this._nonEditable = value; + + } + } + private bool _outlined = false; + + partial void OnOutlinedChanging(ref bool newValue); + /// + /// Whether the control will have outlined appearance. + /// + [Parameter] + public bool Outlined + { + get { return this._outlined; } + set + { + if (this._outlined != value || !IsPropDirty("Outlined")) + { + MarkPropDirty("Outlined"); + } + this._outlined = value; + + } + } + private string _label; + + partial void OnLabelChanging(ref string newValue); + /// + /// The label of the control (single input). + /// + [Parameter] + public string Label + { + get { return this._label; } + set + { + if (this._label != value || !IsPropDirty("Label")) + { + MarkPropDirty("Label"); + } + this._label = value; + + } + } + private string _labelStart; + + partial void OnLabelStartChanging(ref string newValue); + /// + /// The label attribute of the start input. + /// + [Parameter] + public string LabelStart + { + get { return this._labelStart; } + set + { + if (this._labelStart != value || !IsPropDirty("LabelStart")) + { + MarkPropDirty("LabelStart"); + } + this._labelStart = value; + + } + } + private string _labelEnd; + + partial void OnLabelEndChanging(ref string newValue); + /// + /// The label attribute of the end input. + /// + [Parameter] + public string LabelEnd + { + get { return this._labelEnd; } + set + { + if (this._labelEnd != value || !IsPropDirty("LabelEnd")) + { + MarkPropDirty("LabelEnd"); + } + this._labelEnd = value; + + } + } + private string _placeholder; + + partial void OnPlaceholderChanging(ref string newValue); + /// + /// The placeholder attribute of the control (single input). + /// + [Parameter] + public string Placeholder + { + get { return this._placeholder; } + set + { + if (this._placeholder != value || !IsPropDirty("Placeholder")) + { + MarkPropDirty("Placeholder"); + } + this._placeholder = value; + + } + } + private string _placeholderStart; + + partial void OnPlaceholderStartChanging(ref string newValue); + /// + /// The placeholder attribute of the start input. + /// + [Parameter] + public string PlaceholderStart + { + get { return this._placeholderStart; } + set + { + if (this._placeholderStart != value || !IsPropDirty("PlaceholderStart")) + { + MarkPropDirty("PlaceholderStart"); + } + this._placeholderStart = value; + + } + } + private string _placeholderEnd; + + partial void OnPlaceholderEndChanging(ref string newValue); + /// + /// The placeholder attribute of the end input. + /// + [Parameter] + public string PlaceholderEnd + { + get { return this._placeholderEnd; } + set + { + if (this._placeholderEnd != value || !IsPropDirty("PlaceholderEnd")) + { + MarkPropDirty("PlaceholderEnd"); + } + this._placeholderEnd = value; + + } + } + private string _prompt; + + partial void OnPromptChanging(ref string newValue); + /// + /// The prompt symbol to use for unfilled parts of the mask. + /// + [Parameter] + public string Prompt + { + get { return this._prompt; } + set + { + if (this._prompt != value || !IsPropDirty("Prompt")) + { + MarkPropDirty("Prompt"); + } + this._prompt = value; + + } + } + private string _displayFormat; + + partial void OnDisplayFormatChanging(ref string newValue); + /// + /// Format to display the value in when not editing. + /// Defaults to the locale format if not set. + /// + [Parameter] + public string DisplayFormat + { + get { return this._displayFormat; } + set + { + if (this._displayFormat != value || !IsPropDirty("DisplayFormat")) + { + MarkPropDirty("DisplayFormat"); + } + this._displayFormat = value; + + } + } + private string _inputFormat; + + partial void OnInputFormatChanging(ref string newValue); + /// + /// The date format to apply on the inputs. + /// Defaults to the current locale Intl.DateTimeFormat + /// + [Parameter] + public string InputFormat + { + get { return this._inputFormat; } + set + { + if (this._inputFormat != value || !IsPropDirty("InputFormat")) + { + MarkPropDirty("InputFormat"); + } + this._inputFormat = value; + + } + } + private DateTime? _min = DateTime.MinValue; + + partial void OnMinChanging(ref DateTime? newValue); + /// + /// The minimum value required for the date range picker to remain valid. + /// + [Parameter] + public DateTime? Min + { + get { return this._min; } + set + { + if (this._min != value || !IsPropDirty("Min")) + { + MarkPropDirty("Min"); + } + this._min = value; + + } + } + private DateTime? _max = DateTime.MinValue; + + partial void OnMaxChanging(ref DateTime? newValue); + /// + /// The maximum value required for the date range picker to remain valid. + /// + [Parameter] + public DateTime? Max + { + get { return this._max; } + set + { + if (this._max != value || !IsPropDirty("Max")) + { + MarkPropDirty("Max"); + } + this._max = value; + + } + } + private IgbDateRangeDescriptor[] _disabledDates; + + partial void OnDisabledDatesChanging(ref IgbDateRangeDescriptor[] newValue); + /// + /// Gets/sets disabled dates. + /// + [Parameter] + public IgbDateRangeDescriptor[] DisabledDates + { + get { return this._disabledDates; } + set + { + if (this._disabledDates != value || !IsPropDirty("DisabledDates")) + { + MarkPropDirty("DisabledDates"); + } + this._disabledDates = value; + + } + } + private double _visibleMonths = 0; + + partial void OnVisibleMonthsChanging(ref double newValue); + [Parameter] + public double VisibleMonths + { + get { return this._visibleMonths; } + set + { + if (this._visibleMonths != value || !IsPropDirty("VisibleMonths")) + { + MarkPropDirty("VisibleMonths"); + } + this._visibleMonths = value; + + } + } + private ContentOrientation _headerOrientation = ContentOrientation.Horizontal; + + partial void OnHeaderOrientationChanging(ref ContentOrientation newValue); + /// + /// The orientation of the calendar header. + /// + [Parameter] + public ContentOrientation HeaderOrientation + { + get { return this._headerOrientation; } + set + { + if (this._headerOrientation != value || !IsPropDirty("HeaderOrientation")) + { + MarkPropDirty("HeaderOrientation"); + } + this._headerOrientation = value; + + } + } + private ContentOrientation _orientation = ContentOrientation.Horizontal; + + partial void OnOrientationChanging(ref ContentOrientation newValue); + /// + /// The orientation of the multiple months displayed in the calendar's days view. + /// + [Parameter] + public ContentOrientation Orientation + { + get { return this._orientation; } + set + { + if (this._orientation != value || !IsPropDirty("Orientation")) + { + MarkPropDirty("Orientation"); + } + this._orientation = value; + + } + } + private bool _hideHeader = false; + + partial void OnHideHeaderChanging(ref bool newValue); + /// + /// Determines whether the calendar hides its header. + /// + [Parameter] + public bool HideHeader + { + get { return this._hideHeader; } + set + { + if (this._hideHeader != value || !IsPropDirty("HideHeader")) + { + MarkPropDirty("HideHeader"); + } + this._hideHeader = value; + + } + } + private DateTime _activeDate = DateTime.MinValue; + + partial void OnActiveDateChanging(ref DateTime newValue); + /// + /// Gets/Sets the date which is shown in the calendar picker and is highlighted. + /// By default it is the current date. + /// + [Parameter] + public DateTime ActiveDate + { + get { return this._activeDate; } + set + { + if (this._activeDate != value || !IsPropDirty("ActiveDate")) + { + MarkPropDirty("ActiveDate"); + } + this._activeDate = value; + + } + } + private bool _showWeekNumbers = false; - protected override string ResolveDisplay() + partial void OnShowWeekNumbersChanging(ref bool newValue); + /// + /// Whether to show the number of the week in the calendar. + /// + [Parameter] + public bool ShowWeekNumbers + { + get { return this._showWeekNumbers; } + set + { + if (this._showWeekNumbers != value || !IsPropDirty("ShowWeekNumbers")) + { + MarkPropDirty("ShowWeekNumbers"); + } + this._showWeekNumbers = value; + + } + } + private bool _hideOutsideDays = false; + + partial void OnHideOutsideDaysChanging(ref bool newValue); + /// + /// Controls the visibility of the dates that do not belong to the current month. + /// + [Parameter] + public bool HideOutsideDays + { + get { return this._hideOutsideDays; } + set + { + if (this._hideOutsideDays != value || !IsPropDirty("HideOutsideDays")) + { + MarkPropDirty("HideOutsideDays"); + } + this._hideOutsideDays = value; + + } + } + private IgbDateRangeDescriptor[] _specialDates; + + partial void OnSpecialDatesChanging(ref IgbDateRangeDescriptor[] newValue); + /// + /// Gets/sets special dates. + /// + [Parameter] + public IgbDateRangeDescriptor[] SpecialDates + { + get { return this._specialDates; } + set + { + if (this._specialDates != value || !IsPropDirty("SpecialDates")) + { + MarkPropDirty("SpecialDates"); + } + this._specialDates = value; + + } + } + private WeekDays _weekStart = WeekDays.Sunday; + + partial void OnWeekStartChanging(ref WeekDays newValue); + /// + /// Sets the start day of the week for the calendar. + /// + [Parameter] + public WeekDays WeekStart + { + get { return this._weekStart; } + set + { + if (this._weekStart != value || !IsPropDirty("WeekStart")) + { + MarkPropDirty("WeekStart"); + } + this._weekStart = value; + + } + } + private bool _disabled = false; + + partial void OnDisabledChanging(ref bool newValue); + /// + /// The disabled state of the component + /// + [Parameter] + public bool Disabled + { + get { return this._disabled; } + set + { + if (this._disabled != value || !IsPropDirty("Disabled")) + { + MarkPropDirty("Disabled"); + } + this._disabled = value; + + } + } + private bool _required = false; + + partial void OnRequiredChanging(ref bool newValue); + /// + /// Makes the control a required field in a form context. + /// + [Parameter] + public bool Required + { + get { return this._required; } + set + { + if (this._required != value || !IsPropDirty("Required")) + { + MarkPropDirty("Required"); + } + this._required = value; + + } + } + private bool _invalid = false; + + partial void OnInvalidChanging(ref bool newValue); + /// + /// Control the validity of the control. + /// + [Parameter] + public bool Invalid + { + get { return this._invalid; } + set + { + if (this._invalid != value || !IsPropDirty("Invalid")) + { + MarkPropDirty("Invalid"); + } + this._invalid = value; + + } + } + + partial void FindByNameDateRangePicker(string name, ref object item); + public override object FindByName(string name) + { + + var baseResult = base.FindByName(name); + if (baseResult != null) + { + return baseResult; + } + + object item = null; + FindByNameDateRangePicker(name, ref item); + if (item != null) + { + return item; + } + + return null; + } + /// + /// Clears the input parts of the component of any user input + /// + public async Task ClearAsync() + { + await InvokeMethod("clear", new object[] { }, new string[] { }); + } + public void Clear() + { + InvokeMethodSync("clear", new object[] { }, new string[] { }); + } + /// + /// Selects a date range value in the picker + /// + public async Task SelectAsync(IgbDateRangeValue value) + { + await InvokeMethod("select", new object[] { ObjectToParam(value) }, new string[] { "Json" }); + } + public void Select(IgbDateRangeValue value) + { + InvokeMethodSync("select", new object[] { ObjectToParam(value) }, new string[] { "Json" }); + } + /// + /// Checks for validity of the control and shows the browser message if it invalid. + /// + public async Task ReportValidityAsync() + { + await InvokeMethod("reportValidity", new object[] { }, new string[] { }); + } + public void ReportValidity() + { + InvokeMethodSync("reportValidity", new object[] { }, new string[] { }); + } + /// + /// Checks for validity of the control and emits the invalid event if it invalid. + /// + public async Task CheckValidityAsync() + { + await InvokeMethod("checkValidity", new object[] { }, new string[] { }); + } + public void CheckValidity() + { + InvokeMethodSync("checkValidity", new object[] { }, new string[] { }); + } + /// + /// Sets a custom validation message for the control. + /// As long as `message` is not empty, the control is considered invalid. + /// + public async Task SetCustomValidityAsync(String message) + { + await InvokeMethod("setCustomValidity", new object[] { StringToString(message) }, new string[] { "String" }); + } + public void SetCustomValidity(String message) + { + InvokeMethodSync("setCustomValidity", new object[] { StringToString(message) }, new string[] { "String" }); + } + + private EventCallback? _valueChanged = null; + [Parameter] + public EventCallback ValueChanged + { + get + { + return this._valueChanged != null ? this._valueChanged.Value : EventCallback.Empty; + } + set + { + if (!value.Equals(EventCallback.Empty)) + { + if (!CompareEventCallbacks(value, _valueChanged, ref eventCallbacksCache)) + { + this.EnsureChangeHandled(); + + _valueChanged = value; + } + } + else + { + _valueChanged = null; + } + } + } + + private string _openingRef = null; + private string _openingScript = null; + [Parameter] + public string OpeningScript + { + + set + { + if (value != this._openingScript) + { + this._openingScript = value; + this.OnRefChanged("Opening", null, value, true, false, (string refName, object oldValue, object newValue) => + { + this._openingRef = refName; + this.MarkPropDirty("OpeningRef"); + }); + } + } + get + { + return this._openingScript; + } + } + + partial void OnHandlingOpening(IgbVoidEventArgs args); + private EventCallback? _opening = null; + [Parameter] + public EventCallback Opening + { + get + { + return this._opening != null ? this._opening.Value : EventCallback.Empty; + } + set + { + if (!value.Equals(EventCallback.Empty)) + { + if (!CompareEventCallbacks(value, _opening, ref eventCallbacksCache)) + { + _opening = value; + this.SetHandler(this.Name, "Opening", value, (args) => + { + OnHandlingOpening(args); + + }); + this.OnRefChanged("Opening", null, "event:::Opening", true, false, (refName, oldValue, newValue) => + { + this._openingRef = refName; + this.MarkPropDirty("OpeningRef"); + }); + } + } + else + { + _opening = null; + this.SetHandler(this.Name, "Opening", null); + this.OnRefChanged("Opening", null, null, true, false, (refName, oldValue, newValue) => + { + this._openingRef = null; + this.MarkPropDirty("OpeningRef"); + }); + } + } + } + + private string _openedRef = null; + private string _openedScript = null; + [Parameter] + public string OpenedScript + { + + set + { + if (value != this._openedScript) + { + this._openedScript = value; + this.OnRefChanged("Opened", null, value, true, false, (string refName, object oldValue, object newValue) => + { + this._openedRef = refName; + this.MarkPropDirty("OpenedRef"); + }); + } + } + get + { + return this._openedScript; + } + } + + partial void OnHandlingOpened(IgbVoidEventArgs args); + private EventCallback? _opened = null; + [Parameter] + public EventCallback Opened + { + get + { + return this._opened != null ? this._opened.Value : EventCallback.Empty; + } + set + { + if (!value.Equals(EventCallback.Empty)) + { + if (!CompareEventCallbacks(value, _opened, ref eventCallbacksCache)) + { + _opened = value; + this.SetHandler(this.Name, "Opened", value, (args) => + { + OnHandlingOpened(args); + + }); + this.OnRefChanged("Opened", null, "event:::Opened", true, false, (refName, oldValue, newValue) => + { + this._openedRef = refName; + this.MarkPropDirty("OpenedRef"); + }); + } + } + else + { + _opened = null; + this.SetHandler(this.Name, "Opened", null); + this.OnRefChanged("Opened", null, null, true, false, (refName, oldValue, newValue) => + { + this._openedRef = null; + this.MarkPropDirty("OpenedRef"); + }); + } + } + } + + private string _closingRef = null; + private string _closingScript = null; + [Parameter] + public string ClosingScript + { + + set + { + if (value != this._closingScript) + { + this._closingScript = value; + this.OnRefChanged("Closing", null, value, true, false, (string refName, object oldValue, object newValue) => + { + this._closingRef = refName; + this.MarkPropDirty("ClosingRef"); + }); + } + } + get + { + return this._closingScript; + } + } + + partial void OnHandlingClosing(IgbVoidEventArgs args); + private EventCallback? _closing = null; + [Parameter] + public EventCallback Closing + { + get + { + return this._closing != null ? this._closing.Value : EventCallback.Empty; + } + set + { + if (!value.Equals(EventCallback.Empty)) + { + if (!CompareEventCallbacks(value, _closing, ref eventCallbacksCache)) + { + _closing = value; + this.SetHandler(this.Name, "Closing", value, (args) => + { + OnHandlingClosing(args); + + }); + this.OnRefChanged("Closing", null, "event:::Closing", true, false, (refName, oldValue, newValue) => + { + this._closingRef = refName; + this.MarkPropDirty("ClosingRef"); + }); + } + } + else + { + _closing = null; + this.SetHandler(this.Name, "Closing", null); + this.OnRefChanged("Closing", null, null, true, false, (refName, oldValue, newValue) => + { + this._closingRef = null; + this.MarkPropDirty("ClosingRef"); + }); + } + } + } + + private string _closedRef = null; + private string _closedScript = null; + [Parameter] + public string ClosedScript + { + + set + { + if (value != this._closedScript) + { + this._closedScript = value; + this.OnRefChanged("Closed", null, value, true, false, (string refName, object oldValue, object newValue) => + { + this._closedRef = refName; + this.MarkPropDirty("ClosedRef"); + }); + } + } + get + { + return this._closedScript; + } + } + + partial void OnHandlingClosed(IgbVoidEventArgs args); + private EventCallback? _closed = null; + [Parameter] + public EventCallback Closed + { + get + { + return this._closed != null ? this._closed.Value : EventCallback.Empty; + } + set + { + if (!value.Equals(EventCallback.Empty)) + { + if (!CompareEventCallbacks(value, _closed, ref eventCallbacksCache)) + { + _closed = value; + this.SetHandler(this.Name, "Closed", value, (args) => { - return "inline-block"; - } + OnHandlingClosed(args); + + }); + this.OnRefChanged("Closed", null, "event:::Closed", true, false, (refName, oldValue, newValue) => + { + this._closedRef = refName; + this.MarkPropDirty("ClosedRef"); + }); + } + } + else + { + _closed = null; + this.SetHandler(this.Name, "Closed", null); + this.OnRefChanged("Closed", null, null, true, false, (refName, oldValue, newValue) => + { + this._closedRef = null; + this.MarkPropDirty("ClosedRef"); + }); + } + } + } + + private string _changeRef = null; + private string _changeScript = null; + [Parameter] + public string ChangeScript + { + + set + { + if (value != this._changeScript) + { + this._changeScript = value; + this.OnRefChanged("Change", null, value, true, false, (string refName, object oldValue, object newValue) => + { + this._changeRef = refName; + this.MarkPropDirty("ChangeRef"); + }); + } + } + get + { + return this._changeScript; + } + } - protected override bool SupportsVisualChildren + partial void OnHandlingChange(IgbDateRangeValueEventArgs args); + private EventCallback? _change = null; + [Parameter] + public EventCallback Change + { + get + { + return this._change != null ? this._change.Value : EventCallback.Empty; + } + set + { + if (!value.Equals(EventCallback.Empty)) + { + if (!CompareEventCallbacks(value, _change, ref eventCallbacksCache)) + { + _change = value; + this.SetHandler(this.Name, "Change", value, (args) => { - get + OnHandlingChange(args); + + var newValueValue = default(IgbDateRangeValue?); + + { + newValueValue = JsonSerializer.Deserialize(JsonSerializer.Serialize(args.Detail, new JsonSerializerOptions() { ReferenceHandler = ReferenceHandler.IgnoreCycles })); + + if (newValueValue != null) { - return true; + this.AttachChild(newValueValue); } - } - - public IgbDateRangePicker(): base() { - OnCreatedIgbDateRangePicker(); - - - } - - partial void OnCreatedIgbDateRangePicker(); - - private IgbDateRangeValue? _value; - - partial void OnValueChanging(ref IgbDateRangeValue? newValue); - /// - /// The value of the picker - /// - [Parameter] - public IgbDateRangeValue? Value - { - get { return this._value; } - set { - OnValueChanging(ref value); - MarkPropDirty("Value"); - if (this._value != null) { - this.DetachChild(this._value); - } - if (value != null) { - this.AttachChild(value); - } - this._value = value; - } - - } - public async Task GetCurrentValueAsync() - { - var iv = await InvokeMethod("p:Value", new object[] { }, new string[] { }); - - if (iv == null) - { - return default(IgbDateRangeValue); - } - var retVal = (IgbDateRangeValue)ConvertReturnValue(iv); - if (retVal == null) - { - return default(IgbDateRangeValue); - } - return retVal; - - } - public IgbDateRangeValue? GetCurrentValue() - { - var iv = InvokeMethodSync("p:Value", new object[] { }, new string[] { }); - - if (iv == null) - { - return default(IgbDateRangeValue); - } - var retVal = (IgbDateRangeValue)ConvertReturnValue(iv); - if (retVal == null) - { - return default(IgbDateRangeValue); - } - return retVal; - - } - private IgbCustomDateRange[] _customRanges; - - partial void OnCustomRangesChanging(ref IgbCustomDateRange[] newValue); - /// - /// Renders chips with custom ranges based on the elements of the array. - /// - [Parameter] - public IgbCustomDateRange[] CustomRanges - { - get { return this._customRanges; } - set { - if (this._customRanges != value || !IsPropDirty("CustomRanges")) { - MarkPropDirty("CustomRanges"); - } - this._customRanges = value; - - } - } - private PickerMode _mode = PickerMode.Dropdown; - - partial void OnModeChanging(ref PickerMode newValue); - /// - /// Determines whether the calendar is opened in a dropdown or a modal dialog - /// - [Parameter] - public PickerMode Mode - { - get { return this._mode; } - set { - if (this._mode != value || !IsPropDirty("Mode")) { - MarkPropDirty("Mode"); - } - this._mode = value; - - } - } - private bool _useTwoInputs = false; - - partial void OnUseTwoInputsChanging(ref bool newValue); - /// - /// Use two inputs to display the date range values. Makes the input editable in dropdown mode. - /// - [Parameter] - public bool UseTwoInputs - { - get { return this._useTwoInputs; } - set { - if (this._useTwoInputs != value || !IsPropDirty("UseTwoInputs")) { - MarkPropDirty("UseTwoInputs"); - } - this._useTwoInputs = value; - - } - } - private bool _usePredefinedRanges = false; - - partial void OnUsePredefinedRangesChanging(ref bool newValue); - /// - /// Whether the control will show chips with predefined ranges. - /// - [Parameter] - public bool UsePredefinedRanges - { - get { return this._usePredefinedRanges; } - set { - if (this._usePredefinedRanges != value || !IsPropDirty("UsePredefinedRanges")) { - MarkPropDirty("UsePredefinedRanges"); - } - this._usePredefinedRanges = value; - - } - } - private string _locale; - - partial void OnLocaleChanging(ref string newValue); - /// - /// The locale settings used to display the value. - /// - [Parameter] - public string Locale - { - get { return this._locale; } - set { - if (this._locale != value || !IsPropDirty("Locale")) { - MarkPropDirty("Locale"); - } - this._locale = value; - - } - } - private IgbDateRangePickerResourceStrings _resourceStrings; - - partial void OnResourceStringsChanging(ref IgbDateRangePickerResourceStrings newValue); - /// - /// The resource strings of the date range picker. - /// - [Parameter] - public IgbDateRangePickerResourceStrings ResourceStrings - { - get { return this._resourceStrings; } - set { - OnResourceStringsChanging(ref value); - MarkPropDirty("ResourceStrings"); - if (this._resourceStrings != null) { - this.DetachChild(this._resourceStrings); - } - if (value != null) { - this.AttachChild(value); - } - this._resourceStrings = value; - } - - } - private bool _readOnly = false; - - partial void OnReadOnlyChanging(ref bool newValue); - /// - /// Makes the control a readonly field. - /// - [Parameter] - [WCAttributeName("readonly")] - public bool ReadOnly - { - get { return this._readOnly; } - set { - if (this._readOnly != value || !IsPropDirty("ReadOnly")) { - MarkPropDirty("ReadOnly"); - } - this._readOnly = value; - - } - } - private bool _nonEditable = false; - - partial void OnNonEditableChanging(ref bool newValue); - /// - /// Whether to allow typing in the input. - /// - [Parameter] - public bool NonEditable - { - get { return this._nonEditable; } - set { - if (this._nonEditable != value || !IsPropDirty("NonEditable")) { - MarkPropDirty("NonEditable"); - } - this._nonEditable = value; - - } - } - private bool _outlined = false; - - partial void OnOutlinedChanging(ref bool newValue); - /// - /// Whether the control will have outlined appearance. - /// - [Parameter] - public bool Outlined - { - get { return this._outlined; } - set { - if (this._outlined != value || !IsPropDirty("Outlined")) { - MarkPropDirty("Outlined"); - } - this._outlined = value; - - } - } - private string _label; - - partial void OnLabelChanging(ref string newValue); - /// - /// The label of the control (single input). - /// - [Parameter] - public string Label - { - get { return this._label; } - set { - if (this._label != value || !IsPropDirty("Label")) { - MarkPropDirty("Label"); - } - this._label = value; - - } - } - private string _labelStart; - - partial void OnLabelStartChanging(ref string newValue); - /// - /// The label attribute of the start input. - /// - [Parameter] - public string LabelStart - { - get { return this._labelStart; } - set { - if (this._labelStart != value || !IsPropDirty("LabelStart")) { - MarkPropDirty("LabelStart"); - } - this._labelStart = value; - - } - } - private string _labelEnd; - - partial void OnLabelEndChanging(ref string newValue); - /// - /// The label attribute of the end input. - /// - [Parameter] - public string LabelEnd - { - get { return this._labelEnd; } - set { - if (this._labelEnd != value || !IsPropDirty("LabelEnd")) { - MarkPropDirty("LabelEnd"); - } - this._labelEnd = value; - - } - } - private string _placeholder; - - partial void OnPlaceholderChanging(ref string newValue); - /// - /// The placeholder attribute of the control (single input). - /// - [Parameter] - public string Placeholder - { - get { return this._placeholder; } - set { - if (this._placeholder != value || !IsPropDirty("Placeholder")) { - MarkPropDirty("Placeholder"); - } - this._placeholder = value; - - } - } - private string _placeholderStart; - - partial void OnPlaceholderStartChanging(ref string newValue); - /// - /// The placeholder attribute of the start input. - /// - [Parameter] - public string PlaceholderStart - { - get { return this._placeholderStart; } - set { - if (this._placeholderStart != value || !IsPropDirty("PlaceholderStart")) { - MarkPropDirty("PlaceholderStart"); - } - this._placeholderStart = value; - - } - } - private string _placeholderEnd; - - partial void OnPlaceholderEndChanging(ref string newValue); - /// - /// The placeholder attribute of the end input. - /// - [Parameter] - public string PlaceholderEnd - { - get { return this._placeholderEnd; } - set { - if (this._placeholderEnd != value || !IsPropDirty("PlaceholderEnd")) { - MarkPropDirty("PlaceholderEnd"); - } - this._placeholderEnd = value; - - } - } - private string _prompt; - - partial void OnPromptChanging(ref string newValue); - /// - /// The prompt symbol to use for unfilled parts of the mask. - /// - [Parameter] - public string Prompt - { - get { return this._prompt; } - set { - if (this._prompt != value || !IsPropDirty("Prompt")) { - MarkPropDirty("Prompt"); - } - this._prompt = value; - - } - } - private string _displayFormat; - - partial void OnDisplayFormatChanging(ref string newValue); - /// - /// Format to display the value in when not editing. - /// Defaults to the locale format if not set. - /// - [Parameter] - public string DisplayFormat - { - get { return this._displayFormat; } - set { - if (this._displayFormat != value || !IsPropDirty("DisplayFormat")) { - MarkPropDirty("DisplayFormat"); - } - this._displayFormat = value; - - } - } - private string _inputFormat; - - partial void OnInputFormatChanging(ref string newValue); - /// - /// The date format to apply on the inputs. - /// Defaults to the current locale Intl.DateTimeFormat - /// - [Parameter] - public string InputFormat - { - get { return this._inputFormat; } - set { - if (this._inputFormat != value || !IsPropDirty("InputFormat")) { - MarkPropDirty("InputFormat"); - } - this._inputFormat = value; - - } - } - private DateTime? _min = DateTime.MinValue; - - partial void OnMinChanging(ref DateTime? newValue); - /// - /// The minimum value required for the date range picker to remain valid. - /// - [Parameter] - public DateTime? Min - { - get { return this._min; } - set { - if (this._min != value || !IsPropDirty("Min")) { - MarkPropDirty("Min"); - } - this._min = value; - - } - } - private DateTime? _max = DateTime.MinValue; - - partial void OnMaxChanging(ref DateTime? newValue); - /// - /// The maximum value required for the date range picker to remain valid. - /// - [Parameter] - public DateTime? Max - { - get { return this._max; } - set { - if (this._max != value || !IsPropDirty("Max")) { - MarkPropDirty("Max"); - } - this._max = value; - - } - } - private IgbDateRangeDescriptor[] _disabledDates; - - partial void OnDisabledDatesChanging(ref IgbDateRangeDescriptor[] newValue); - /// - /// Gets/sets disabled dates. - /// - [Parameter] - public IgbDateRangeDescriptor[] DisabledDates - { - get { return this._disabledDates; } - set { - if (this._disabledDates != value || !IsPropDirty("DisabledDates")) { - MarkPropDirty("DisabledDates"); - } - this._disabledDates = value; - - } - } - private double _visibleMonths = 0; - - partial void OnVisibleMonthsChanging(ref double newValue); - [Parameter] - public double VisibleMonths - { - get { return this._visibleMonths; } - set { - if (this._visibleMonths != value || !IsPropDirty("VisibleMonths")) { - MarkPropDirty("VisibleMonths"); - } - this._visibleMonths = value; - - } - } - private ContentOrientation _headerOrientation = ContentOrientation.Horizontal; - - partial void OnHeaderOrientationChanging(ref ContentOrientation newValue); - /// - /// The orientation of the calendar header. - /// - [Parameter] - public ContentOrientation HeaderOrientation - { - get { return this._headerOrientation; } - set { - if (this._headerOrientation != value || !IsPropDirty("HeaderOrientation")) { - MarkPropDirty("HeaderOrientation"); - } - this._headerOrientation = value; - - } - } - private ContentOrientation _orientation = ContentOrientation.Horizontal; - - partial void OnOrientationChanging(ref ContentOrientation newValue); - /// - /// The orientation of the multiple months displayed in the calendar's days view. - /// - [Parameter] - public ContentOrientation Orientation - { - get { return this._orientation; } - set { - if (this._orientation != value || !IsPropDirty("Orientation")) { - MarkPropDirty("Orientation"); - } - this._orientation = value; - - } - } - private bool _hideHeader = false; - - partial void OnHideHeaderChanging(ref bool newValue); - /// - /// Determines whether the calendar hides its header. - /// - [Parameter] - public bool HideHeader - { - get { return this._hideHeader; } - set { - if (this._hideHeader != value || !IsPropDirty("HideHeader")) { - MarkPropDirty("HideHeader"); - } - this._hideHeader = value; - - } - } - private DateTime _activeDate = DateTime.MinValue; - - partial void OnActiveDateChanging(ref DateTime newValue); - /// - /// Gets/Sets the date which is shown in the calendar picker and is highlighted. - /// By default it is the current date. - /// - [Parameter] - public DateTime ActiveDate - { - get { return this._activeDate; } - set { - if (this._activeDate != value || !IsPropDirty("ActiveDate")) { - MarkPropDirty("ActiveDate"); - } - this._activeDate = value; - - } - } - private bool _showWeekNumbers = false; - - partial void OnShowWeekNumbersChanging(ref bool newValue); - /// - /// Whether to show the number of the week in the calendar. - /// - [Parameter] - public bool ShowWeekNumbers - { - get { return this._showWeekNumbers; } - set { - if (this._showWeekNumbers != value || !IsPropDirty("ShowWeekNumbers")) { - MarkPropDirty("ShowWeekNumbers"); - } - this._showWeekNumbers = value; - - } - } - private bool _hideOutsideDays = false; - - partial void OnHideOutsideDaysChanging(ref bool newValue); - /// - /// Controls the visibility of the dates that do not belong to the current month. - /// - [Parameter] - public bool HideOutsideDays - { - get { return this._hideOutsideDays; } - set { - if (this._hideOutsideDays != value || !IsPropDirty("HideOutsideDays")) { - MarkPropDirty("HideOutsideDays"); - } - this._hideOutsideDays = value; - - } - } - private IgbDateRangeDescriptor[] _specialDates; - - partial void OnSpecialDatesChanging(ref IgbDateRangeDescriptor[] newValue); - /// - /// Gets/sets special dates. - /// - [Parameter] - public IgbDateRangeDescriptor[] SpecialDates - { - get { return this._specialDates; } - set { - if (this._specialDates != value || !IsPropDirty("SpecialDates")) { - MarkPropDirty("SpecialDates"); - } - this._specialDates = value; - - } - } - private WeekDays _weekStart = WeekDays.Sunday; - - partial void OnWeekStartChanging(ref WeekDays newValue); - /// - /// Sets the start day of the week for the calendar. - /// - [Parameter] - public WeekDays WeekStart - { - get { return this._weekStart; } - set { - if (this._weekStart != value || !IsPropDirty("WeekStart")) { - MarkPropDirty("WeekStart"); - } - this._weekStart = value; - - } - } - private bool _disabled = false; - - partial void OnDisabledChanging(ref bool newValue); - /// - /// The disabled state of the component - /// - [Parameter] - public bool Disabled - { - get { return this._disabled; } - set { - if (this._disabled != value || !IsPropDirty("Disabled")) { - MarkPropDirty("Disabled"); - } - this._disabled = value; - - } - } - private bool _required = false; - - partial void OnRequiredChanging(ref bool newValue); - /// - /// Makes the control a required field in a form context. - /// - [Parameter] - public bool Required - { - get { return this._required; } - set { - if (this._required != value || !IsPropDirty("Required")) { - MarkPropDirty("Required"); - } - this._required = value; - - } - } - private bool _invalid = false; - - partial void OnInvalidChanging(ref bool newValue); - /// - /// Control the validity of the control. - /// - [Parameter] - public bool Invalid - { - get { return this._invalid; } - set { - if (this._invalid != value || !IsPropDirty("Invalid")) { - MarkPropDirty("Invalid"); - } - this._invalid = value; - - } - } - - partial void FindByNameDateRangePicker(string name, ref object item); - public override object FindByName(string name) - { - - var baseResult = base.FindByName(name); - if (baseResult != null) - { - return baseResult; - } - - object item = null; - FindByNameDateRangePicker(name, ref item); - if (item != null) - { - return item; - } - - return null; - } - /// - /// Clears the input parts of the component of any user input - /// - public async Task ClearAsync() - { - await InvokeMethod("clear", new object[] { }, new string[] { }); - } - public void Clear() - { - InvokeMethodSync("clear", new object[] { }, new string[] { }); - } - /// - /// Selects a date range value in the picker - /// - public async Task SelectAsync(IgbDateRangeValue value) - { - await InvokeMethod("select", new object[] { ObjectToParam(value) }, new string[] { "Json" }); - } - public void Select(IgbDateRangeValue value) - { - InvokeMethodSync("select", new object[] { ObjectToParam(value) }, new string[] { "Json" }); - } - /// - /// Checks for validity of the control and shows the browser message if it invalid. - /// - public async Task ReportValidityAsync() - { - await InvokeMethod("reportValidity", new object[] { }, new string[] { }); - } - public void ReportValidity() - { - InvokeMethodSync("reportValidity", new object[] { }, new string[] { }); - } - /// - /// Checks for validity of the control and emits the invalid event if it invalid. - /// - public async Task CheckValidityAsync() - { - await InvokeMethod("checkValidity", new object[] { }, new string[] { }); - } - public void CheckValidity() - { - InvokeMethodSync("checkValidity", new object[] { }, new string[] { }); - } - /// - /// Sets a custom validation message for the control. - /// As long as `message` is not empty, the control is considered invalid. - /// - public async Task SetCustomValidityAsync(String message) - { - await InvokeMethod("setCustomValidity", new object[] { StringToString(message) }, new string[] { "String" }); - } - public void SetCustomValidity(String message) - { - InvokeMethodSync("setCustomValidity", new object[] { StringToString(message) }, new string[] { "String" }); - } - - private EventCallback? _valueChanged = null; - [Parameter] - public EventCallback ValueChanged - { - get - { - return this._valueChanged != null ? this._valueChanged.Value : EventCallback.Empty; - } - set - { - if (!value.Equals(EventCallback.Empty)) - { - if (!CompareEventCallbacks(value, _valueChanged, ref eventCallbacksCache)) - { - this.EnsureChangeHandled(); - - _valueChanged = value; - } - } - else - { - _valueChanged = null; - } - } - } - - private string _openingRef = null; - private string _openingScript = null; - [Parameter] - public string OpeningScript { - - set - { - if (value != this._openingScript) - { - this._openingScript = value; - this.OnRefChanged("Opening", null, value, true, false, (string refName, object oldValue, object newValue) => { - this._openingRef = refName; - this.MarkPropDirty("OpeningRef"); - }); - } - } - get - { - return this._openingScript; - } - } - - partial void OnHandlingOpening(IgbVoidEventArgs args); - private EventCallback? _opening = null; - [Parameter] - public EventCallback Opening - { - get - { - return this._opening != null ? this._opening.Value : EventCallback.Empty; - } - set - { - if (!value.Equals(EventCallback.Empty)) - { - if (!CompareEventCallbacks(value, _opening, ref eventCallbacksCache)) - { - _opening = value; - this.SetHandler(this.Name, "Opening", value, (args) => { - OnHandlingOpening(args); - - }); - this.OnRefChanged("Opening", null, "event:::Opening", true, false, (refName, oldValue, newValue) => { - this._openingRef = refName; - this.MarkPropDirty("OpeningRef"); - }); - } - } - else - { - _opening = null; - this.SetHandler(this.Name, "Opening", null); - this.OnRefChanged("Opening", null, null, true, false, (refName, oldValue, newValue) => { - this._openingRef = null; - this.MarkPropDirty("OpeningRef"); - }); - } - } - } - - private string _openedRef = null; - private string _openedScript = null; - [Parameter] - public string OpenedScript { - - set - { - if (value != this._openedScript) - { - this._openedScript = value; - this.OnRefChanged("Opened", null, value, true, false, (string refName, object oldValue, object newValue) => { - this._openedRef = refName; - this.MarkPropDirty("OpenedRef"); - }); - } - } - get - { - return this._openedScript; - } - } - - partial void OnHandlingOpened(IgbVoidEventArgs args); - private EventCallback? _opened = null; - [Parameter] - public EventCallback Opened - { - get - { - return this._opened != null ? this._opened.Value : EventCallback.Empty; - } - set - { - if (!value.Equals(EventCallback.Empty)) - { - if (!CompareEventCallbacks(value, _opened, ref eventCallbacksCache)) - { - _opened = value; - this.SetHandler(this.Name, "Opened", value, (args) => { - OnHandlingOpened(args); - - }); - this.OnRefChanged("Opened", null, "event:::Opened", true, false, (refName, oldValue, newValue) => { - this._openedRef = refName; - this.MarkPropDirty("OpenedRef"); - }); - } - } - else - { - _opened = null; - this.SetHandler(this.Name, "Opened", null); - this.OnRefChanged("Opened", null, null, true, false, (refName, oldValue, newValue) => { - this._openedRef = null; - this.MarkPropDirty("OpenedRef"); - }); - } - } - } - - private string _closingRef = null; - private string _closingScript = null; - [Parameter] - public string ClosingScript { - - set - { - if (value != this._closingScript) - { - this._closingScript = value; - this.OnRefChanged("Closing", null, value, true, false, (string refName, object oldValue, object newValue) => { - this._closingRef = refName; - this.MarkPropDirty("ClosingRef"); - }); - } - } - get - { - return this._closingScript; - } - } - - partial void OnHandlingClosing(IgbVoidEventArgs args); - private EventCallback? _closing = null; - [Parameter] - public EventCallback Closing - { - get - { - return this._closing != null ? this._closing.Value : EventCallback.Empty; - } - set - { - if (!value.Equals(EventCallback.Empty)) - { - if (!CompareEventCallbacks(value, _closing, ref eventCallbacksCache)) - { - _closing = value; - this.SetHandler(this.Name, "Closing", value, (args) => { - OnHandlingClosing(args); - - }); - this.OnRefChanged("Closing", null, "event:::Closing", true, false, (refName, oldValue, newValue) => { - this._closingRef = refName; - this.MarkPropDirty("ClosingRef"); - }); - } - } - else - { - _closing = null; - this.SetHandler(this.Name, "Closing", null); - this.OnRefChanged("Closing", null, null, true, false, (refName, oldValue, newValue) => { - this._closingRef = null; - this.MarkPropDirty("ClosingRef"); - }); - } - } - } - - private string _closedRef = null; - private string _closedScript = null; - [Parameter] - public string ClosedScript { - - set - { - if (value != this._closedScript) - { - this._closedScript = value; - this.OnRefChanged("Closed", null, value, true, false, (string refName, object oldValue, object newValue) => { - this._closedRef = refName; - this.MarkPropDirty("ClosedRef"); - }); - } - } - get - { - return this._closedScript; - } - } - - partial void OnHandlingClosed(IgbVoidEventArgs args); - private EventCallback? _closed = null; - [Parameter] - public EventCallback Closed - { - get - { - return this._closed != null ? this._closed.Value : EventCallback.Empty; - } - set - { - if (!value.Equals(EventCallback.Empty)) - { - if (!CompareEventCallbacks(value, _closed, ref eventCallbacksCache)) - { - _closed = value; - this.SetHandler(this.Name, "Closed", value, (args) => { - OnHandlingClosed(args); - - }); - this.OnRefChanged("Closed", null, "event:::Closed", true, false, (refName, oldValue, newValue) => { - this._closedRef = refName; - this.MarkPropDirty("ClosedRef"); - }); - } - } - else - { - _closed = null; - this.SetHandler(this.Name, "Closed", null); - this.OnRefChanged("Closed", null, null, true, false, (refName, oldValue, newValue) => { - this._closedRef = null; - this.MarkPropDirty("ClosedRef"); - }); - } - } - } - - private string _changeRef = null; - private string _changeScript = null; - [Parameter] - public string ChangeScript { - - set - { - if (value != this._changeScript) - { - this._changeScript = value; - this.OnRefChanged("Change", null, value, true, false, (string refName, object oldValue, object newValue) => { - this._changeRef = refName; - this.MarkPropDirty("ChangeRef"); - }); - } - } - get - { - return this._changeScript; - } - } - - partial void OnHandlingChange(IgbDateRangeValueEventArgs args); - private EventCallback? _change = null; - [Parameter] - public EventCallback Change - { - get - { - return this._change != null ? this._change.Value : EventCallback.Empty; - } - set - { - if (!value.Equals(EventCallback.Empty)) - { - if (!CompareEventCallbacks(value, _change, ref eventCallbacksCache)) - { - _change = value; - this.SetHandler(this.Name, "Change", value, (args) => { - OnHandlingChange(args); - - var newValueValue = default(IgbDateRangeValue?); - - - { - newValueValue = JsonSerializer.Deserialize(JsonSerializer.Serialize(args.Detail, new JsonSerializerOptions() { ReferenceHandler = ReferenceHandler.IgnoreCycles })); - - if (newValueValue != null) - { - this.AttachChild(newValueValue); - }; - OnEventUpdatingValue(this._value, ref newValueValue); - if (UseDirectRender) { - //TODO: maybe we should be doing this for everything. Need to make sure we don't infinity bounce though. - this.Value = newValueValue; - } else { - this._value = newValueValue; - } - OnPropertyPropagatedOut(Name, "Value"); - } - - if (!EventCallback.Empty.Equals(ValueChanged)) - { - var task = ValueChanged.InvokeAsync(newValueValue); - if (task.Exception != null) - { - throw task.Exception; - } - } - - }); - this.OnRefChanged("Change", null, "event:::Change", true, false, (refName, oldValue, newValue) => { - this._changeRef = refName; - this.MarkPropDirty("ChangeRef"); - }); - } - } - else - { - _change = null; - this.SetHandler(this.Name, "Change", null); - this.OnRefChanged("Change", null, null, true, false, (refName, oldValue, newValue) => { - this._changeRef = null; - this.MarkPropDirty("ChangeRef"); - }); - } - } - } - internal void EnsureChangeHandled() - { - if (EventCallback.Empty.Equals(this.Change)) - { - this.Change = new EventCallback(null, (Action)((e) => { })); this._change = null; - } - } - - - private string _inputRef = null; - private string _inputScript = null; - [Parameter] - public string InputScript { - - set - { - if (value != this._inputScript) - { - this._inputScript = value; - this.OnRefChanged("Input", null, value, true, false, (string refName, object oldValue, object newValue) => { - this._inputRef = refName; - this.MarkPropDirty("InputRef"); - }); - } - } - get - { - return this._inputScript; - } - } - - partial void OnHandlingInput(IgbDateRangeValueEventArgs args); - private EventCallback? _input = null; - [Parameter] - public EventCallback Input - { - get - { - return this._input != null ? this._input.Value : EventCallback.Empty; - } - set - { - if (!value.Equals(EventCallback.Empty)) - { - if (!CompareEventCallbacks(value, _input, ref eventCallbacksCache)) - { - _input = value; - this.SetHandler(this.Name, "Input", value, (args) => { - OnHandlingInput(args); - - }); - this.OnRefChanged("Input", null, "event:::Input", true, false, (refName, oldValue, newValue) => { - this._inputRef = refName; - this.MarkPropDirty("InputRef"); - }); - } - } - else - { - _input = null; - this.SetHandler(this.Name, "Input", null); - this.OnRefChanged("Input", null, null, true, false, (refName, oldValue, newValue) => { - this._inputRef = null; - this.MarkPropDirty("InputRef"); - }); - } - } - } - - partial void OnEventUpdatingValue(IgbDateRangeValue? oldValue, ref IgbDateRangeValue? newValue); - - partial void SerializeCoreIgbDateRangePicker(RendererSerializer ser); - - internal override void SerializeCore(RendererSerializer ser) - { - base.SerializeCore(ser); - - SerializeCoreIgbDateRangePicker(ser); - - if (IsPropDirty("Value")) { ser.AddSerializableProp("value", this._value); } - if (IsPropDirty("CustomRanges")) { ser.AddSerializableArrayProp("customRanges", this._customRanges); } - if (IsPropDirty("Mode")) { ser.AddEnumProp("mode", this._mode); } - if (IsPropDirty("UseTwoInputs")) { ser.AddBooleanProp("useTwoInputs", this._useTwoInputs); } - if (IsPropDirty("UsePredefinedRanges")) { ser.AddBooleanProp("usePredefinedRanges", this._usePredefinedRanges); } - if (IsPropDirty("Locale")) { ser.AddStringProp("locale", this._locale); } - if (IsPropDirty("ResourceStrings")) { ser.AddSerializableProp("resourceStrings", this._resourceStrings); } - if (IsPropDirty("ReadOnly")) { ser.AddBooleanProp("readOnly", this._readOnly); } - if (IsPropDirty("NonEditable")) { ser.AddBooleanProp("nonEditable", this._nonEditable); } - if (IsPropDirty("Outlined")) { ser.AddBooleanProp("outlined", this._outlined); } - if (IsPropDirty("Label")) { ser.AddStringProp("label", this._label); } - if (IsPropDirty("LabelStart")) { ser.AddStringProp("labelStart", this._labelStart); } - if (IsPropDirty("LabelEnd")) { ser.AddStringProp("labelEnd", this._labelEnd); } - if (IsPropDirty("Placeholder")) { ser.AddStringProp("placeholder", this._placeholder); } - if (IsPropDirty("PlaceholderStart")) { ser.AddStringProp("placeholderStart", this._placeholderStart); } - if (IsPropDirty("PlaceholderEnd")) { ser.AddStringProp("placeholderEnd", this._placeholderEnd); } - if (IsPropDirty("Prompt")) { ser.AddStringProp("prompt", this._prompt); } - if (IsPropDirty("DisplayFormat")) { ser.AddStringProp("displayFormat", this._displayFormat); } - if (IsPropDirty("InputFormat")) { ser.AddStringProp("inputFormat", this._inputFormat); } - if (IsPropDirty("Min")) { ser.AddDateTimeProp("min", this._min); } - if (IsPropDirty("Max")) { ser.AddDateTimeProp("max", this._max); } - if (IsPropDirty("DisabledDates")) { ser.AddSerializableArrayProp("disabledDates", this._disabledDates); } - if (IsPropDirty("VisibleMonths")) { ser.AddNumberProp("visibleMonths", this._visibleMonths); } - if (IsPropDirty("HeaderOrientation")) { ser.AddEnumProp("headerOrientation", this._headerOrientation); } - if (IsPropDirty("Orientation")) { ser.AddEnumProp("orientation", this._orientation); } - if (IsPropDirty("HideHeader")) { ser.AddBooleanProp("hideHeader", this._hideHeader); } - if (IsPropDirty("ActiveDate")) { ser.AddDateTimeProp("activeDate", this._activeDate); } - if (IsPropDirty("ShowWeekNumbers")) { ser.AddBooleanProp("showWeekNumbers", this._showWeekNumbers); } - if (IsPropDirty("HideOutsideDays")) { ser.AddBooleanProp("hideOutsideDays", this._hideOutsideDays); } - if (IsPropDirty("SpecialDates")) { ser.AddSerializableArrayProp("specialDates", this._specialDates); } - if (IsPropDirty("WeekStart")) { ser.AddEnumProp("weekStart", this._weekStart); } - if (IsPropDirty("Disabled")) { ser.AddBooleanProp("disabled", this._disabled); } - if (IsPropDirty("Required")) { ser.AddBooleanProp("required", this._required); } - if (IsPropDirty("Invalid")) { ser.AddBooleanProp("invalid", this._invalid); } - if (IsPropDirty("OpeningRef")) { ser.AddStringProp("openingRef", this._openingRef); } - if (IsPropDirty("OpenedRef")) { ser.AddStringProp("openedRef", this._openedRef); } - if (IsPropDirty("ClosingRef")) { ser.AddStringProp("closingRef", this._closingRef); } - if (IsPropDirty("ClosedRef")) { ser.AddStringProp("closedRef", this._closedRef); } - if (IsPropDirty("ChangeRef")) { ser.AddStringProp("changeRef", this._changeRef); } - if (IsPropDirty("InputRef")) { ser.AddStringProp("inputRef", this._inputRef); } - - } - -} + ; + OnEventUpdatingValue(this._value, ref newValueValue); + if (UseDirectRender) + { + //TODO: maybe we should be doing this for everything. Need to make sure we don't infinity bounce though. + this.Value = newValueValue; + } + else + { + this._value = newValueValue; + } + OnPropertyPropagatedOut(Name, "Value"); + } + + if (!EventCallback.Empty.Equals(ValueChanged)) + { + var task = ValueChanged.InvokeAsync(newValueValue); + if (task.Exception != null) + { + throw task.Exception; + } + } + + }); + this.OnRefChanged("Change", null, "event:::Change", true, false, (refName, oldValue, newValue) => + { + this._changeRef = refName; + this.MarkPropDirty("ChangeRef"); + }); + } + } + else + { + _change = null; + this.SetHandler(this.Name, "Change", null); + this.OnRefChanged("Change", null, null, true, false, (refName, oldValue, newValue) => + { + this._changeRef = null; + this.MarkPropDirty("ChangeRef"); + }); + } + } + } + internal void EnsureChangeHandled() + { + if (EventCallback.Empty.Equals(this.Change)) + { + this.Change = new EventCallback(null, (Action)((e) => { })); + this._change = null; + } + } + + private string _inputRef = null; + private string _inputScript = null; + [Parameter] + public string InputScript + { + + set + { + if (value != this._inputScript) + { + this._inputScript = value; + this.OnRefChanged("Input", null, value, true, false, (string refName, object oldValue, object newValue) => + { + this._inputRef = refName; + this.MarkPropDirty("InputRef"); + }); + } + } + get + { + return this._inputScript; + } + } + + partial void OnHandlingInput(IgbDateRangeValueEventArgs args); + private EventCallback? _input = null; + [Parameter] + public EventCallback Input + { + get + { + return this._input != null ? this._input.Value : EventCallback.Empty; + } + set + { + if (!value.Equals(EventCallback.Empty)) + { + if (!CompareEventCallbacks(value, _input, ref eventCallbacksCache)) + { + _input = value; + this.SetHandler(this.Name, "Input", value, (args) => + { + OnHandlingInput(args); + + }); + this.OnRefChanged("Input", null, "event:::Input", true, false, (refName, oldValue, newValue) => + { + this._inputRef = refName; + this.MarkPropDirty("InputRef"); + }); + } + } + else + { + _input = null; + this.SetHandler(this.Name, "Input", null); + this.OnRefChanged("Input", null, null, true, false, (refName, oldValue, newValue) => + { + this._inputRef = null; + this.MarkPropDirty("InputRef"); + }); + } + } + } + + partial void OnEventUpdatingValue(IgbDateRangeValue? oldValue, ref IgbDateRangeValue? newValue); + + partial void SerializeCoreIgbDateRangePicker(RendererSerializer ser); + + internal override void SerializeCore(RendererSerializer ser) + { + base.SerializeCore(ser); + + SerializeCoreIgbDateRangePicker(ser); + + if (IsPropDirty("Value")) + { ser.AddSerializableProp("value", this._value); } + if (IsPropDirty("CustomRanges")) + { ser.AddSerializableArrayProp("customRanges", this._customRanges); } + if (IsPropDirty("Mode")) + { ser.AddEnumProp("mode", this._mode); } + if (IsPropDirty("UseTwoInputs")) + { ser.AddBooleanProp("useTwoInputs", this._useTwoInputs); } + if (IsPropDirty("UsePredefinedRanges")) + { ser.AddBooleanProp("usePredefinedRanges", this._usePredefinedRanges); } + if (IsPropDirty("Locale")) + { ser.AddStringProp("locale", this._locale); } + if (IsPropDirty("ResourceStrings")) + { ser.AddSerializableProp("resourceStrings", this._resourceStrings); } + if (IsPropDirty("ReadOnly")) + { ser.AddBooleanProp("readOnly", this._readOnly); } + if (IsPropDirty("NonEditable")) + { ser.AddBooleanProp("nonEditable", this._nonEditable); } + if (IsPropDirty("Outlined")) + { ser.AddBooleanProp("outlined", this._outlined); } + if (IsPropDirty("Label")) + { ser.AddStringProp("label", this._label); } + if (IsPropDirty("LabelStart")) + { ser.AddStringProp("labelStart", this._labelStart); } + if (IsPropDirty("LabelEnd")) + { ser.AddStringProp("labelEnd", this._labelEnd); } + if (IsPropDirty("Placeholder")) + { ser.AddStringProp("placeholder", this._placeholder); } + if (IsPropDirty("PlaceholderStart")) + { ser.AddStringProp("placeholderStart", this._placeholderStart); } + if (IsPropDirty("PlaceholderEnd")) + { ser.AddStringProp("placeholderEnd", this._placeholderEnd); } + if (IsPropDirty("Prompt")) + { ser.AddStringProp("prompt", this._prompt); } + if (IsPropDirty("DisplayFormat")) + { ser.AddStringProp("displayFormat", this._displayFormat); } + if (IsPropDirty("InputFormat")) + { ser.AddStringProp("inputFormat", this._inputFormat); } + if (IsPropDirty("Min")) + { ser.AddDateTimeProp("min", this._min); } + if (IsPropDirty("Max")) + { ser.AddDateTimeProp("max", this._max); } + if (IsPropDirty("DisabledDates")) + { ser.AddSerializableArrayProp("disabledDates", this._disabledDates); } + if (IsPropDirty("VisibleMonths")) + { ser.AddNumberProp("visibleMonths", this._visibleMonths); } + if (IsPropDirty("HeaderOrientation")) + { ser.AddEnumProp("headerOrientation", this._headerOrientation); } + if (IsPropDirty("Orientation")) + { ser.AddEnumProp("orientation", this._orientation); } + if (IsPropDirty("HideHeader")) + { ser.AddBooleanProp("hideHeader", this._hideHeader); } + if (IsPropDirty("ActiveDate")) + { ser.AddDateTimeProp("activeDate", this._activeDate); } + if (IsPropDirty("ShowWeekNumbers")) + { ser.AddBooleanProp("showWeekNumbers", this._showWeekNumbers); } + if (IsPropDirty("HideOutsideDays")) + { ser.AddBooleanProp("hideOutsideDays", this._hideOutsideDays); } + if (IsPropDirty("SpecialDates")) + { ser.AddSerializableArrayProp("specialDates", this._specialDates); } + if (IsPropDirty("WeekStart")) + { ser.AddEnumProp("weekStart", this._weekStart); } + if (IsPropDirty("Disabled")) + { ser.AddBooleanProp("disabled", this._disabled); } + if (IsPropDirty("Required")) + { ser.AddBooleanProp("required", this._required); } + if (IsPropDirty("Invalid")) + { ser.AddBooleanProp("invalid", this._invalid); } + if (IsPropDirty("OpeningRef")) + { ser.AddStringProp("openingRef", this._openingRef); } + if (IsPropDirty("OpenedRef")) + { ser.AddStringProp("openedRef", this._openedRef); } + if (IsPropDirty("ClosingRef")) + { ser.AddStringProp("closingRef", this._closingRef); } + if (IsPropDirty("ClosedRef")) + { ser.AddStringProp("closedRef", this._closedRef); } + if (IsPropDirty("ChangeRef")) + { ser.AddStringProp("changeRef", this._changeRef); } + if (IsPropDirty("InputRef")) + { ser.AddStringProp("inputRef", this._inputRef); } + + } + + } } diff --git a/src/components/Blazor/DateRangePickerModule.cs b/src/components/Blazor/DateRangePickerModule.cs index a9efdd9e..eec5d0ed 100644 --- a/src/components/Blazor/DateRangePickerModule.cs +++ b/src/components/Blazor/DateRangePickerModule.cs @@ -1,29 +1,27 @@ -using System; -using System.Collections.Generic; -using System.Runtime.CompilerServices; -using System.Text; -using System.Collections.Generic; - namespace IgniteUI.Blazor.Controls { - public partial class IgbDateRangePickerModule { - public static void Register(IIgniteUIBlazor runtime) { + public partial class IgbDateRangePickerModule + { + public static void Register(IIgniteUIBlazor runtime) + { ModuleLoader.Load(runtime, "WebDateRangePickerModule"); IgbCalendarModule.MarkIsLoadRequested(runtime); -IgbDateTimeInputModule.MarkIsLoadRequested(runtime); -IgbDialogModule.MarkIsLoadRequested(runtime); -IgbIconModule.MarkIsLoadRequested(runtime); -IgbChipModule.MarkIsLoadRequested(runtime); -IgbInputModule.MarkIsLoadRequested(runtime); + IgbDateTimeInputModule.MarkIsLoadRequested(runtime); + IgbDialogModule.MarkIsLoadRequested(runtime); + IgbIconModule.MarkIsLoadRequested(runtime); + IgbChipModule.MarkIsLoadRequested(runtime); + IgbInputModule.MarkIsLoadRequested(runtime); } - public static void MarkIsLoadRequested(IIgniteUIBlazor runtime) { + public static void MarkIsLoadRequested(IIgniteUIBlazor runtime) + { ModuleLoader.MarkIsLoadRequested(runtime, "WebDateRangePickerModule"); } - public static bool IsLoadRequested(IIgniteUIBlazor runtime) { + public static bool IsLoadRequested(IIgniteUIBlazor runtime) + { return ModuleLoader.IsLoadRequested(runtime, "WebDateRangePickerModule"); } } diff --git a/src/components/Blazor/DateRangePickerResourceStrings.cs b/src/components/Blazor/DateRangePickerResourceStrings.cs index 24ddac12..a0acabd5 100644 --- a/src/components/Blazor/DateRangePickerResourceStrings.cs +++ b/src/components/Blazor/DateRangePickerResourceStrings.cs @@ -1,56 +1,46 @@ - -using System; -using Microsoft.AspNetCore.Components; -using Microsoft.AspNetCore.Components.Rendering; -using System.Threading.Tasks; -using System.Collections.Generic; -using System.Linq; - namespace IgniteUI.Blazor.Controls { - public partial class IgbDateRangePickerResourceStrings: BaseRendererElement { - public override string Type { get { return "WebDateRangePickerResourceStrings"; } } - - - public IgbDateRangePickerResourceStrings(): base() { - OnCreatedIgbDateRangePickerResourceStrings(); - - - } - - partial void OnCreatedIgbDateRangePickerResourceStrings(); - - - partial void FindByNameDateRangePickerResourceStrings(string name, ref object item); - public override object FindByName(string name) - { - - var baseResult = base.FindByName(name); - if (baseResult != null) - { - return baseResult; - } - - object item = null; - FindByNameDateRangePickerResourceStrings(name, ref item); - if (item != null) - { - return item; - } - - return null; - } - - partial void SerializeCoreIgbDateRangePickerResourceStrings(RendererSerializer ser); - - internal override void SerializeCore(RendererSerializer ser) - { - base.SerializeCore(ser); - - SerializeCoreIgbDateRangePickerResourceStrings(ser); - - - } - -} + public partial class IgbDateRangePickerResourceStrings : BaseRendererElement + { + public override string Type { get { return "WebDateRangePickerResourceStrings"; } } + + public IgbDateRangePickerResourceStrings() : base() + { + OnCreatedIgbDateRangePickerResourceStrings(); + + } + + partial void OnCreatedIgbDateRangePickerResourceStrings(); + + partial void FindByNameDateRangePickerResourceStrings(string name, ref object item); + public override object FindByName(string name) + { + + var baseResult = base.FindByName(name); + if (baseResult != null) + { + return baseResult; + } + + object item = null; + FindByNameDateRangePickerResourceStrings(name, ref item); + if (item != null) + { + return item; + } + + return null; + } + + partial void SerializeCoreIgbDateRangePickerResourceStrings(RendererSerializer ser); + + internal override void SerializeCore(RendererSerializer ser) + { + base.SerializeCore(ser); + + SerializeCoreIgbDateRangePickerResourceStrings(ser); + + } + + } } diff --git a/src/components/Blazor/DateRangeType.cs b/src/components/Blazor/DateRangeType.cs index 64562762..b0fc4621 100644 --- a/src/components/Blazor/DateRangeType.cs +++ b/src/components/Blazor/DateRangeType.cs @@ -1,12 +1,13 @@ namespace IgniteUI.Blazor.Controls { -public enum DateRangeType { - After, - Before, - Between, - Specific, - Weekdays, - Weekends + public enum DateRangeType + { + After, + Before, + Between, + Specific, + Weekdays, + Weekends -} + } } diff --git a/src/components/Blazor/DateRangeValue.cs b/src/components/Blazor/DateRangeValue.cs index 68d47c45..c83b42db 100644 --- a/src/components/Blazor/DateRangeValue.cs +++ b/src/components/Blazor/DateRangeValue.cs @@ -1,96 +1,96 @@ - -using System; using Microsoft.AspNetCore.Components; -using Microsoft.AspNetCore.Components.Rendering; -using System.Threading.Tasks; -using System.Collections.Generic; -using System.Linq; namespace IgniteUI.Blazor.Controls { - public partial class IgbDateRangeValue: BaseRendererElement { - public override string Type { get { return "WebDateRangeValue"; } } - - - public IgbDateRangeValue(): base() { - OnCreatedIgbDateRangeValue(); - - - } - - partial void OnCreatedIgbDateRangeValue(); - - private DateTime _start = DateTime.MinValue; - - partial void OnStartChanging(ref DateTime newValue); - [Parameter] - public DateTime Start - { - get { return this._start; } - set { - if (this._start != value || !IsPropDirty("Start")) { - MarkPropDirty("Start"); - } - this._start = value; - - } - } - private DateTime _end = DateTime.MinValue; - - partial void OnEndChanging(ref DateTime newValue); - [Parameter] - public DateTime End - { - get { return this._end; } - set { - if (this._end != value || !IsPropDirty("End")) { - MarkPropDirty("End"); - } - this._end = value; - - } - } - - partial void FindByNameDateRangeValue(string name, ref object item); - public override object FindByName(string name) - { - - var baseResult = base.FindByName(name); - if (baseResult != null) - { - return baseResult; - } - - object item = null; - FindByNameDateRangeValue(name, ref item); - if (item != null) - { - return item; - } - - return null; - } - public async Task SetNativeElementAsync(Object element) - { - await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); - } - public void SetNativeElement(Object element) - { - InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); - } - - partial void SerializeCoreIgbDateRangeValue(RendererSerializer ser); - - internal override void SerializeCore(RendererSerializer ser) - { - base.SerializeCore(ser); - - SerializeCoreIgbDateRangeValue(ser); - - if (IsPropDirty("Start")) { ser.AddDateTimeProp("start", this._start); } - if (IsPropDirty("End")) { ser.AddDateTimeProp("end", this._end); } - - } - -} + public partial class IgbDateRangeValue : BaseRendererElement + { + public override string Type { get { return "WebDateRangeValue"; } } + + public IgbDateRangeValue() : base() + { + OnCreatedIgbDateRangeValue(); + + } + + partial void OnCreatedIgbDateRangeValue(); + + private DateTime _start = DateTime.MinValue; + + partial void OnStartChanging(ref DateTime newValue); + [Parameter] + public DateTime Start + { + get { return this._start; } + set + { + if (this._start != value || !IsPropDirty("Start")) + { + MarkPropDirty("Start"); + } + this._start = value; + + } + } + private DateTime _end = DateTime.MinValue; + + partial void OnEndChanging(ref DateTime newValue); + [Parameter] + public DateTime End + { + get { return this._end; } + set + { + if (this._end != value || !IsPropDirty("End")) + { + MarkPropDirty("End"); + } + this._end = value; + + } + } + + partial void FindByNameDateRangeValue(string name, ref object item); + public override object FindByName(string name) + { + + var baseResult = base.FindByName(name); + if (baseResult != null) + { + return baseResult; + } + + object item = null; + FindByNameDateRangeValue(name, ref item); + if (item != null) + { + return item; + } + + return null; + } + public async Task SetNativeElementAsync(Object element) + { + await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + } + public void SetNativeElement(Object element) + { + InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + } + + partial void SerializeCoreIgbDateRangeValue(RendererSerializer ser); + + internal override void SerializeCore(RendererSerializer ser) + { + base.SerializeCore(ser); + + SerializeCoreIgbDateRangeValue(ser); + + if (IsPropDirty("Start")) + { ser.AddDateTimeProp("start", this._start); } + if (IsPropDirty("End")) + { ser.AddDateTimeProp("end", this._end); } + + } + + } } diff --git a/src/components/Blazor/DateRangeValueDetail.cs b/src/components/Blazor/DateRangeValueDetail.cs index 77813fe2..de6c1aa4 100644 --- a/src/components/Blazor/DateRangeValueDetail.cs +++ b/src/components/Blazor/DateRangeValueDetail.cs @@ -1,120 +1,122 @@ - -using System; using Microsoft.AspNetCore.Components; -using Microsoft.AspNetCore.Components.Rendering; -using System.Threading.Tasks; -using System.Collections.Generic; -using System.Linq; namespace IgniteUI.Blazor.Controls { - public partial class IgbDateRangeValueDetail: BaseRendererElement { - public override string Type { get { return "WebDateRangeValueDetail"; } } - - - private static bool _marshalByValue = true; - - public IgbDateRangeValueDetail(): base() { - OnCreatedIgbDateRangeValueDetail(); - - - } - - partial void OnCreatedIgbDateRangeValueDetail(); - - private DateTime _start = DateTime.MinValue; - - partial void OnStartChanging(ref DateTime newValue); - [Parameter] - public DateTime Start - { - get { return this._start; } - set { - if (this._start != value || !IsPropDirty("Start")) { - MarkPropDirty("Start"); - } - this._start = value; - - } - } - private DateTime _end = DateTime.MinValue; - - partial void OnEndChanging(ref DateTime newValue); - [Parameter] - public DateTime End - { - get { return this._end; } - set { - if (this._end != value || !IsPropDirty("End")) { - MarkPropDirty("End"); - } - this._end = value; - - } - } - - partial void FindByNameDateRangeValueDetail(string name, ref object item); - public override object FindByName(string name) - { - - var baseResult = base.FindByName(name); - if (baseResult != null) - { - return baseResult; - } - - object item = null; - FindByNameDateRangeValueDetail(name, ref item); - if (item != null) - { - return item; - } - - return null; - } - public async Task SetNativeElementAsync(Object element) - { - await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); - } - public void SetNativeElement(Object element) - { - InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); - } - - partial void SerializeCoreIgbDateRangeValueDetail(RendererSerializer ser); - - internal override void SerializeCore(RendererSerializer ser) - { - base.SerializeCore(ser); - - SerializeCoreIgbDateRangeValueDetail(ser); - - if (IsPropDirty("Start")) { ser.AddDateTimeProp("start", this._start); } - if (IsPropDirty("End")) { ser.AddDateTimeProp("end", this._end); } - - } - - - protected internal override void ToEventJson(BaseRendererControl control, Dictionary args) - { - base.ToEventJson(control, args); - - if (IsPropDirty("Start")) { args["start"] = DateToString(this._start); } - if (IsPropDirty("End")) { args["end"] = DateToString(this._end); } - - - } - - - protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) { - base.FromEventJson(control, args); - this.SuppressParentNotify = true; - - if (args.ContainsKey("start")) { this.Start = ReturnToDate(args["start"]); } - if (args.ContainsKey("end")) { this.End = ReturnToDate(args["end"]); } - - this.SuppressParentNotify = false; - } - -} + public partial class IgbDateRangeValueDetail : BaseRendererElement + { + public override string Type { get { return "WebDateRangeValueDetail"; } } + + private static bool _marshalByValue = true; + + public IgbDateRangeValueDetail() : base() + { + OnCreatedIgbDateRangeValueDetail(); + + } + + partial void OnCreatedIgbDateRangeValueDetail(); + + private DateTime _start = DateTime.MinValue; + + partial void OnStartChanging(ref DateTime newValue); + [Parameter] + public DateTime Start + { + get { return this._start; } + set + { + if (this._start != value || !IsPropDirty("Start")) + { + MarkPropDirty("Start"); + } + this._start = value; + + } + } + private DateTime _end = DateTime.MinValue; + + partial void OnEndChanging(ref DateTime newValue); + [Parameter] + public DateTime End + { + get { return this._end; } + set + { + if (this._end != value || !IsPropDirty("End")) + { + MarkPropDirty("End"); + } + this._end = value; + + } + } + + partial void FindByNameDateRangeValueDetail(string name, ref object item); + public override object FindByName(string name) + { + + var baseResult = base.FindByName(name); + if (baseResult != null) + { + return baseResult; + } + + object item = null; + FindByNameDateRangeValueDetail(name, ref item); + if (item != null) + { + return item; + } + + return null; + } + public async Task SetNativeElementAsync(Object element) + { + await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + } + public void SetNativeElement(Object element) + { + InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + } + + partial void SerializeCoreIgbDateRangeValueDetail(RendererSerializer ser); + + internal override void SerializeCore(RendererSerializer ser) + { + base.SerializeCore(ser); + + SerializeCoreIgbDateRangeValueDetail(ser); + + if (IsPropDirty("Start")) + { ser.AddDateTimeProp("start", this._start); } + if (IsPropDirty("End")) + { ser.AddDateTimeProp("end", this._end); } + + } + + protected internal override void ToEventJson(BaseRendererControl control, Dictionary args) + { + base.ToEventJson(control, args); + + if (IsPropDirty("Start")) + { args["start"] = DateToString(this._start); } + if (IsPropDirty("End")) + { args["end"] = DateToString(this._end); } + + } + + protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) + { + base.FromEventJson(control, args); + this.SuppressParentNotify = true; + + if (args.ContainsKey("start")) + { this.Start = ReturnToDate(args["start"]); } + if (args.ContainsKey("end")) + { this.End = ReturnToDate(args["end"]); } + + this.SuppressParentNotify = false; + } + + } } diff --git a/src/components/Blazor/DateRangeValueEventArgs.cs b/src/components/Blazor/DateRangeValueEventArgs.cs index 19c0f009..349559bd 100644 --- a/src/components/Blazor/DateRangeValueEventArgs.cs +++ b/src/components/Blazor/DateRangeValueEventArgs.cs @@ -1,99 +1,97 @@ - -using System; using Microsoft.AspNetCore.Components; -using Microsoft.AspNetCore.Components.Rendering; -using System.Threading.Tasks; -using System.Collections.Generic; -using System.Linq; namespace IgniteUI.Blazor.Controls { - public partial class IgbDateRangeValueEventArgs: BaseRendererElement { - public override string Type { get { return "WebDateRangeValueEventArgs"; } } - - - private static bool _marshalByValue = true; - - public IgbDateRangeValueEventArgs(): base() { - OnCreatedIgbDateRangeValueEventArgs(); - - - } - - partial void OnCreatedIgbDateRangeValueEventArgs(); - - private IgbDateRangeValueDetail _detail; - - partial void OnDetailChanging(ref IgbDateRangeValueDetail newValue); - [Parameter] - public IgbDateRangeValueDetail Detail - { - get { return this._detail; } - set { - OnDetailChanging(ref value); - MarkPropDirty("Detail"); - if (this._detail != null) { - this.DetachChild(this._detail); - } - if (value != null) { - this.AttachChild(value); - } - this._detail = value; - } - - } - - partial void FindByNameDateRangeValueEventArgs(string name, ref object item); - public override object FindByName(string name) - { - - var baseResult = base.FindByName(name); - if (baseResult != null) - { - return baseResult; - } - - object item = null; - FindByNameDateRangeValueEventArgs(name, ref item); - if (item != null) - { - return item; - } - - return null; - } - - partial void SerializeCoreIgbDateRangeValueEventArgs(RendererSerializer ser); - - internal override void SerializeCore(RendererSerializer ser) - { - base.SerializeCore(ser); - - SerializeCoreIgbDateRangeValueEventArgs(ser); - - if (IsPropDirty("Detail")) { ser.AddSerializableProp("detail", this._detail); } - - } - - - protected internal override void ToEventJson(BaseRendererControl control, Dictionary args) - { - base.ToEventJson(control, args); - - if (IsPropDirty("Detail")) { args["detail"] = ObjectToParam(this._detail); } - - - } - - - protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) { - base.FromEventJson(control, args); - this.SuppressParentNotify = true; - - if (args.ContainsKey("detail")) { this.Detail = (IgbDateRangeValueDetail)ConvertReturnValue(args["detail"], "DateRangeValueDetail", true); } - - this.SuppressParentNotify = false; - } - -} + public partial class IgbDateRangeValueEventArgs : BaseRendererElement + { + public override string Type { get { return "WebDateRangeValueEventArgs"; } } + + private static bool _marshalByValue = true; + + public IgbDateRangeValueEventArgs() : base() + { + OnCreatedIgbDateRangeValueEventArgs(); + + } + + partial void OnCreatedIgbDateRangeValueEventArgs(); + + private IgbDateRangeValueDetail _detail; + + partial void OnDetailChanging(ref IgbDateRangeValueDetail newValue); + [Parameter] + public IgbDateRangeValueDetail Detail + { + get { return this._detail; } + set + { + OnDetailChanging(ref value); + MarkPropDirty("Detail"); + if (this._detail != null) + { + this.DetachChild(this._detail); + } + if (value != null) + { + this.AttachChild(value); + } + this._detail = value; + } + + } + + partial void FindByNameDateRangeValueEventArgs(string name, ref object item); + public override object FindByName(string name) + { + + var baseResult = base.FindByName(name); + if (baseResult != null) + { + return baseResult; + } + + object item = null; + FindByNameDateRangeValueEventArgs(name, ref item); + if (item != null) + { + return item; + } + + return null; + } + + partial void SerializeCoreIgbDateRangeValueEventArgs(RendererSerializer ser); + + internal override void SerializeCore(RendererSerializer ser) + { + base.SerializeCore(ser); + + SerializeCoreIgbDateRangeValueEventArgs(ser); + + if (IsPropDirty("Detail")) + { ser.AddSerializableProp("detail", this._detail); } + + } + + protected internal override void ToEventJson(BaseRendererControl control, Dictionary args) + { + base.ToEventJson(control, args); + + if (IsPropDirty("Detail")) + { args["detail"] = ObjectToParam(this._detail); } + + } + + protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) + { + base.FromEventJson(control, args); + this.SuppressParentNotify = true; + + if (args.ContainsKey("detail")) + { this.Detail = (IgbDateRangeValueDetail)ConvertReturnValue(args["detail"], "DateRangeValueDetail", true); } + + this.SuppressParentNotify = false; + } + + } } diff --git a/src/components/Blazor/DateTimeInput.cs b/src/components/Blazor/DateTimeInput.cs index bb94bb55..f54c55d0 100644 --- a/src/components/Blazor/DateTimeInput.cs +++ b/src/components/Blazor/DateTimeInput.cs @@ -1,441 +1,465 @@ - -using System; using Microsoft.AspNetCore.Components; -using Microsoft.AspNetCore.Components.Rendering; -using System.Threading.Tasks; -using System.Collections.Generic; -using System.Linq; namespace IgniteUI.Blazor.Controls { - /// -/// A date time input is an input field that lets you set and edit the date and time in a chosen input element -/// using customizable display and input formats. -/// -public partial class IgbDateTimeInput: IgbDateTimeInputBase { - public override string Type { get { return "WebDateTimeInput"; } } - - protected override void EnsureModulesLoaded() - { - if (!IgbDateTimeInputModule.IsLoadRequested(IgBlazor)) - { - IgbDateTimeInputModule.Register(IgBlazor); - } - } + /// + /// A date time input is an input field that lets you set and edit the date and time in a chosen input element + /// using customizable display and input formats. + /// + public partial class IgbDateTimeInput : IgbDateTimeInputBase + { + public override string Type { get { return "WebDateTimeInput"; } } + + protected override void EnsureModulesLoaded() + { + if (!IgbDateTimeInputModule.IsLoadRequested(IgBlazor)) + { + IgbDateTimeInputModule.Register(IgBlazor); + } + } + + protected override string ResolveDisplay() + { + return "inline-block"; + } + + protected override bool SupportsVisualChildren + { + get + { + return true; + } + } + + public IgbDateTimeInput() : base() + { + OnCreatedIgbDateTimeInput(); + + } + + partial void OnCreatedIgbDateTimeInput(); + + private DateTime? _value = DateTime.MinValue; + + partial void OnValueChanging(ref DateTime? newValue); + /// + /// The value of the input. + /// + [Parameter] + public DateTime? Value + { + get { return this._value; } + set + { + if (this._value != value || !IsPropDirty("Value")) + { + MarkPropDirty("Value"); + } + this._value = value; + + } + } + public async Task GetCurrentValueAsync() + { + var iv = await InvokeMethod("p:Value", new object[] { }, new string[] { }); + return ReturnToDate(iv); + } + public DateTime? GetCurrentValue() + { + var iv = InvokeMethodSync("p:Value", new object[] { }, new string[] { }); + return ReturnToDate(iv); + } + + partial void FindByNameDateTimeInput(string name, ref object item); + public override object FindByName(string name) + { + + var baseResult = base.FindByName(name); + if (baseResult != null) + { + return baseResult; + } - protected override string ResolveDisplay() + object item = null; + FindByNameDateTimeInput(name, ref item); + if (item != null) + { + return item; + } + + return null; + } + public async Task StepUpAsync(DatePart? datePart = null, double delta = -1) + { + await InvokeMethod("stepUp", new object[] { ObjectToParam(datePart, typeof(DatePart)), delta }, new string[] { "Json", "Number" }); + } + public void StepUp(DatePart? datePart = null, double delta = -1) + { + InvokeMethodSync("stepUp", new object[] { ObjectToParam(datePart, typeof(DatePart)), delta }, new string[] { "Json", "Number" }); + } + public async Task StepDownAsync(DatePart? datePart = null, double delta = -1) + { + await InvokeMethod("stepDown", new object[] { ObjectToParam(datePart, typeof(DatePart)), delta }, new string[] { "Json", "Number" }); + } + public void StepDown(DatePart? datePart = null, double delta = -1) + { + InvokeMethodSync("stepDown", new object[] { ObjectToParam(datePart, typeof(DatePart)), delta }, new string[] { "Json", "Number" }); + } + /// + /// Clears the input element of user input. + /// + public async Task ClearAsync() + { + await InvokeMethod("clear", new object[] { }, new string[] { }); + } + public void Clear() + { + InvokeMethodSync("clear", new object[] { }, new string[] { }); + } + + private EventCallback? _valueChanged = null; + [Parameter] + public EventCallback ValueChanged + { + get + { + return this._valueChanged != null ? this._valueChanged.Value : EventCallback.Empty; + } + set + { + if (!value.Equals(EventCallback.Empty)) + { + if (!CompareEventCallbacks(value, _valueChanged, ref eventCallbacksCache)) + { + this.EnsureChangeHandled(); + + _valueChanged = value; + } + } + else + { + _valueChanged = null; + } + } + } + + private string _inputOcurredRef = null; + private string _inputOcurredScript = null; + [Parameter] + public string InputOcurredScript + { + + set + { + if (value != this._inputOcurredScript) + { + this._inputOcurredScript = value; + this.OnRefChanged("InputOcurred", null, value, true, false, (string refName, object oldValue, object newValue) => + { + this._inputOcurredRef = refName; + this.MarkPropDirty("InputOcurredRef"); + }); + } + } + get + { + return this._inputOcurredScript; + } + } + + partial void OnHandlingInputOcurred(IgbComponentValueChangedEventArgs args); + private EventCallback? _inputOcurred = null; + [Parameter] + public EventCallback InputOcurred + { + get + { + return this._inputOcurred != null ? this._inputOcurred.Value : EventCallback.Empty; + } + set + { + if (!value.Equals(EventCallback.Empty)) + { + if (!CompareEventCallbacks(value, _inputOcurred, ref eventCallbacksCache)) + { + _inputOcurred = value; + this.SetHandler(this.Name, "InputOcurred", value, (args) => { - return "inline-block"; - } + OnHandlingInputOcurred(args); - protected override bool SupportsVisualChildren + }); + this.OnRefChanged("InputOcurred", null, "event:::InputOcurred", true, false, (refName, oldValue, newValue) => { - get + this._inputOcurredRef = refName; + this.MarkPropDirty("InputOcurredRef"); + }); + } + } + else + { + _inputOcurred = null; + this.SetHandler(this.Name, "InputOcurred", null); + this.OnRefChanged("InputOcurred", null, null, true, false, (refName, oldValue, newValue) => + { + this._inputOcurredRef = null; + this.MarkPropDirty("InputOcurredRef"); + }); + } + } + } + + private string _changeRef = null; + private string _changeScript = null; + [Parameter] + public string ChangeScript + { + + set + { + if (value != this._changeScript) + { + this._changeScript = value; + this.OnRefChanged("Change", null, value, true, false, (string refName, object oldValue, object newValue) => + { + this._changeRef = refName; + this.MarkPropDirty("ChangeRef"); + }); + } + } + get + { + return this._changeScript; + } + } + + partial void OnHandlingChange(IgbComponentDateValueChangedEventArgs args); + private EventCallback? _change = null; + [Parameter] + public EventCallback Change + { + get + { + return this._change != null ? this._change.Value : EventCallback.Empty; + } + set + { + if (!value.Equals(EventCallback.Empty)) + { + if (!CompareEventCallbacks(value, _change, ref eventCallbacksCache)) + { + _change = value; + this.SetHandler(this.Name, "Change", value, (args) => + { + OnHandlingChange(args); + + var newValueValue = default(DateTime?); + + { + newValueValue = (DateTime?)(args.Detail); + ; + OnEventUpdatingValue(this._value, ref newValueValue); + if (UseDirectRender) { - return true; + //TODO: maybe we should be doing this for everything. Need to make sure we don't infinity bounce though. + this.Value = newValueValue; } - } - - public IgbDateTimeInput(): base() { - OnCreatedIgbDateTimeInput(); - - - } - - partial void OnCreatedIgbDateTimeInput(); - - private DateTime? _value = DateTime.MinValue; - - partial void OnValueChanging(ref DateTime? newValue); - /// - /// The value of the input. - /// - [Parameter] - public DateTime? Value - { - get { return this._value; } - set { - if (this._value != value || !IsPropDirty("Value")) { - MarkPropDirty("Value"); - } - this._value = value; - - } - } - public async Task GetCurrentValueAsync() - { - var iv = await InvokeMethod("p:Value", new object[] { }, new string[] { }); - return ReturnToDate(iv); - } - public DateTime? GetCurrentValue() - { - var iv = InvokeMethodSync("p:Value", new object[] { }, new string[] { }); - return ReturnToDate(iv); - } - - partial void FindByNameDateTimeInput(string name, ref object item); - public override object FindByName(string name) - { - - var baseResult = base.FindByName(name); - if (baseResult != null) - { - return baseResult; - } - - object item = null; - FindByNameDateTimeInput(name, ref item); - if (item != null) - { - return item; - } - - return null; - } - public async Task StepUpAsync(DatePart? datePart = null, double delta = -1) - { - await InvokeMethod("stepUp", new object[] { ObjectToParam(datePart, typeof(DatePart)), delta }, new string[] { "Json", "Number" }); - } - public void StepUp(DatePart? datePart = null, double delta = -1) - { - InvokeMethodSync("stepUp", new object[] { ObjectToParam(datePart, typeof(DatePart)), delta }, new string[] { "Json", "Number" }); - } - public async Task StepDownAsync(DatePart? datePart = null, double delta = -1) - { - await InvokeMethod("stepDown", new object[] { ObjectToParam(datePart, typeof(DatePart)), delta }, new string[] { "Json", "Number" }); - } - public void StepDown(DatePart? datePart = null, double delta = -1) - { - InvokeMethodSync("stepDown", new object[] { ObjectToParam(datePart, typeof(DatePart)), delta }, new string[] { "Json", "Number" }); - } - /// - /// Clears the input element of user input. - /// - public async Task ClearAsync() - { - await InvokeMethod("clear", new object[] { }, new string[] { }); - } - public void Clear() - { - InvokeMethodSync("clear", new object[] { }, new string[] { }); - } - - private EventCallback? _valueChanged = null; - [Parameter] - public EventCallback ValueChanged - { - get - { - return this._valueChanged != null ? this._valueChanged.Value : EventCallback.Empty; - } - set - { - if (!value.Equals(EventCallback.Empty)) - { - if (!CompareEventCallbacks(value, _valueChanged, ref eventCallbacksCache)) - { - this.EnsureChangeHandled(); - - _valueChanged = value; - } - } - else - { - _valueChanged = null; - } - } - } - - private string _inputOcurredRef = null; - private string _inputOcurredScript = null; - [Parameter] - public string InputOcurredScript { - - set - { - if (value != this._inputOcurredScript) - { - this._inputOcurredScript = value; - this.OnRefChanged("InputOcurred", null, value, true, false, (string refName, object oldValue, object newValue) => { - this._inputOcurredRef = refName; - this.MarkPropDirty("InputOcurredRef"); - }); - } - } - get - { - return this._inputOcurredScript; - } - } - - partial void OnHandlingInputOcurred(IgbComponentValueChangedEventArgs args); - private EventCallback? _inputOcurred = null; - [Parameter] - public EventCallback InputOcurred - { - get - { - return this._inputOcurred != null ? this._inputOcurred.Value : EventCallback.Empty; - } - set - { - if (!value.Equals(EventCallback.Empty)) - { - if (!CompareEventCallbacks(value, _inputOcurred, ref eventCallbacksCache)) - { - _inputOcurred = value; - this.SetHandler(this.Name, "InputOcurred", value, (args) => { - OnHandlingInputOcurred(args); - - }); - this.OnRefChanged("InputOcurred", null, "event:::InputOcurred", true, false, (refName, oldValue, newValue) => { - this._inputOcurredRef = refName; - this.MarkPropDirty("InputOcurredRef"); - }); - } - } - else - { - _inputOcurred = null; - this.SetHandler(this.Name, "InputOcurred", null); - this.OnRefChanged("InputOcurred", null, null, true, false, (refName, oldValue, newValue) => { - this._inputOcurredRef = null; - this.MarkPropDirty("InputOcurredRef"); - }); - } - } - } - - private string _changeRef = null; - private string _changeScript = null; - [Parameter] - public string ChangeScript { - - set - { - if (value != this._changeScript) - { - this._changeScript = value; - this.OnRefChanged("Change", null, value, true, false, (string refName, object oldValue, object newValue) => { - this._changeRef = refName; - this.MarkPropDirty("ChangeRef"); - }); - } - } - get - { - return this._changeScript; - } - } - - partial void OnHandlingChange(IgbComponentDateValueChangedEventArgs args); - private EventCallback? _change = null; - [Parameter] - public EventCallback Change - { - get - { - return this._change != null ? this._change.Value : EventCallback.Empty; - } - set - { - if (!value.Equals(EventCallback.Empty)) - { - if (!CompareEventCallbacks(value, _change, ref eventCallbacksCache)) - { - _change = value; - this.SetHandler(this.Name, "Change", value, (args) => { - OnHandlingChange(args); - - var newValueValue = default(DateTime?); - - - { - newValueValue = (DateTime?)(args.Detail); - ; - OnEventUpdatingValue(this._value, ref newValueValue); - if (UseDirectRender) { - //TODO: maybe we should be doing this for everything. Need to make sure we don't infinity bounce though. - this.Value = newValueValue; - } else { - this._value = newValueValue; - } - OnPropertyPropagatedOut(Name, "Value"); - } - - if (!EventCallback.Empty.Equals(ValueChanged)) - { - var task = ValueChanged.InvokeAsync(newValueValue); - if (task.Exception != null) - { - throw task.Exception; - } - } - - }); - this.OnRefChanged("Change", null, "event:::Change", true, false, (refName, oldValue, newValue) => { - this._changeRef = refName; - this.MarkPropDirty("ChangeRef"); - }); - } - } - else - { - _change = null; - this.SetHandler(this.Name, "Change", null); - this.OnRefChanged("Change", null, null, true, false, (refName, oldValue, newValue) => { - this._changeRef = null; - this.MarkPropDirty("ChangeRef"); - }); - } - } - } - internal void EnsureChangeHandled() - { - if (EventCallback.Empty.Equals(this.Change)) - { - this.Change = new EventCallback(null, (Action)((e) => { })); this._change = null; - } - } - - - private string _focusRef = null; - private string _focusScript = null; - [Parameter] - public string FocusScript { - - set - { - if (value != this._focusScript) - { - this._focusScript = value; - this.OnRefChanged("Focus", null, value, true, false, (string refName, object oldValue, object newValue) => { - this._focusRef = refName; - this.MarkPropDirty("FocusRef"); - }); - } - } - get - { - return this._focusScript; - } - } - - partial void OnHandlingFocus(IgbVoidEventArgs args); - private EventCallback? _focus = null; - [Parameter] - public EventCallback Focus - { - get - { - return this._focus != null ? this._focus.Value : EventCallback.Empty; - } - set - { - if (!value.Equals(EventCallback.Empty)) - { - if (!CompareEventCallbacks(value, _focus, ref eventCallbacksCache)) - { - _focus = value; - this.SetHandler(this.Name, "Focus", value, (args) => { - OnHandlingFocus(args); - - }); - this.OnRefChanged("Focus", null, "nativeEvent:::Focus", true, false, (refName, oldValue, newValue) => { - this._focusRef = refName; - this.MarkPropDirty("FocusRef"); - }); - } - } - else - { - _focus = null; - this.SetHandler(this.Name, "Focus", null); - this.OnRefChanged("Focus", null, null, true, false, (refName, oldValue, newValue) => { - this._focusRef = null; - this.MarkPropDirty("FocusRef"); - }); - } - } - } - - private string _blurRef = null; - private string _blurScript = null; - [Parameter] - public string BlurScript { - - set - { - if (value != this._blurScript) - { - this._blurScript = value; - this.OnRefChanged("Blur", null, value, true, false, (string refName, object oldValue, object newValue) => { - this._blurRef = refName; - this.MarkPropDirty("BlurRef"); - }); - } - } - get - { - return this._blurScript; - } - } - - partial void OnHandlingBlur(IgbVoidEventArgs args); - private EventCallback? _blur = null; - [Parameter] - public EventCallback Blur - { - get - { - return this._blur != null ? this._blur.Value : EventCallback.Empty; - } - set - { - if (!value.Equals(EventCallback.Empty)) - { - if (!CompareEventCallbacks(value, _blur, ref eventCallbacksCache)) - { - _blur = value; - this.SetHandler(this.Name, "Blur", value, (args) => { - OnHandlingBlur(args); - - }); - this.OnRefChanged("Blur", null, "nativeEvent:::Blur", true, false, (refName, oldValue, newValue) => { - this._blurRef = refName; - this.MarkPropDirty("BlurRef"); - }); - } - } - else - { - _blur = null; - this.SetHandler(this.Name, "Blur", null); - this.OnRefChanged("Blur", null, null, true, false, (refName, oldValue, newValue) => { - this._blurRef = null; - this.MarkPropDirty("BlurRef"); - }); - } - } - } - - partial void OnEventUpdatingValue(DateTime? oldValue, ref DateTime? newValue); - - partial void SerializeCoreIgbDateTimeInput(RendererSerializer ser); - - internal override void SerializeCore(RendererSerializer ser) - { - base.SerializeCore(ser); - - SerializeCoreIgbDateTimeInput(ser); - - if (IsPropDirty("Value")) { ser.AddDateTimeProp("value", this._value); } - if (IsPropDirty("InputOcurredRef")) { ser.AddStringProp("inputOcurredRef", this._inputOcurredRef); } - if (IsPropDirty("ChangeRef")) { ser.AddStringProp("changeRef", this._changeRef); } - if (IsPropDirty("FocusRef")) { ser.AddStringProp("focusRef", this._focusRef); } - if (IsPropDirty("BlurRef")) { ser.AddStringProp("blurRef", this._blurRef); } - - } - -} + else + { + this._value = newValueValue; + } + OnPropertyPropagatedOut(Name, "Value"); + } + + if (!EventCallback.Empty.Equals(ValueChanged)) + { + var task = ValueChanged.InvokeAsync(newValueValue); + if (task.Exception != null) + { + throw task.Exception; + } + } + + }); + this.OnRefChanged("Change", null, "event:::Change", true, false, (refName, oldValue, newValue) => + { + this._changeRef = refName; + this.MarkPropDirty("ChangeRef"); + }); + } + } + else + { + _change = null; + this.SetHandler(this.Name, "Change", null); + this.OnRefChanged("Change", null, null, true, false, (refName, oldValue, newValue) => + { + this._changeRef = null; + this.MarkPropDirty("ChangeRef"); + }); + } + } + } + internal void EnsureChangeHandled() + { + if (EventCallback.Empty.Equals(this.Change)) + { + this.Change = new EventCallback(null, (Action)((e) => { })); + this._change = null; + } + } + + private string _focusRef = null; + private string _focusScript = null; + [Parameter] + public string FocusScript + { + + set + { + if (value != this._focusScript) + { + this._focusScript = value; + this.OnRefChanged("Focus", null, value, true, false, (string refName, object oldValue, object newValue) => + { + this._focusRef = refName; + this.MarkPropDirty("FocusRef"); + }); + } + } + get + { + return this._focusScript; + } + } + + partial void OnHandlingFocus(IgbVoidEventArgs args); + private EventCallback? _focus = null; + [Parameter] + public EventCallback Focus + { + get + { + return this._focus != null ? this._focus.Value : EventCallback.Empty; + } + set + { + if (!value.Equals(EventCallback.Empty)) + { + if (!CompareEventCallbacks(value, _focus, ref eventCallbacksCache)) + { + _focus = value; + this.SetHandler(this.Name, "Focus", value, (args) => + { + OnHandlingFocus(args); + + }); + this.OnRefChanged("Focus", null, "nativeEvent:::Focus", true, false, (refName, oldValue, newValue) => + { + this._focusRef = refName; + this.MarkPropDirty("FocusRef"); + }); + } + } + else + { + _focus = null; + this.SetHandler(this.Name, "Focus", null); + this.OnRefChanged("Focus", null, null, true, false, (refName, oldValue, newValue) => + { + this._focusRef = null; + this.MarkPropDirty("FocusRef"); + }); + } + } + } + + private string _blurRef = null; + private string _blurScript = null; + [Parameter] + public string BlurScript + { + + set + { + if (value != this._blurScript) + { + this._blurScript = value; + this.OnRefChanged("Blur", null, value, true, false, (string refName, object oldValue, object newValue) => + { + this._blurRef = refName; + this.MarkPropDirty("BlurRef"); + }); + } + } + get + { + return this._blurScript; + } + } + + partial void OnHandlingBlur(IgbVoidEventArgs args); + private EventCallback? _blur = null; + [Parameter] + public EventCallback Blur + { + get + { + return this._blur != null ? this._blur.Value : EventCallback.Empty; + } + set + { + if (!value.Equals(EventCallback.Empty)) + { + if (!CompareEventCallbacks(value, _blur, ref eventCallbacksCache)) + { + _blur = value; + this.SetHandler(this.Name, "Blur", value, (args) => + { + OnHandlingBlur(args); + + }); + this.OnRefChanged("Blur", null, "nativeEvent:::Blur", true, false, (refName, oldValue, newValue) => + { + this._blurRef = refName; + this.MarkPropDirty("BlurRef"); + }); + } + } + else + { + _blur = null; + this.SetHandler(this.Name, "Blur", null); + this.OnRefChanged("Blur", null, null, true, false, (refName, oldValue, newValue) => + { + this._blurRef = null; + this.MarkPropDirty("BlurRef"); + }); + } + } + } + + partial void OnEventUpdatingValue(DateTime? oldValue, ref DateTime? newValue); + + partial void SerializeCoreIgbDateTimeInput(RendererSerializer ser); + + internal override void SerializeCore(RendererSerializer ser) + { + base.SerializeCore(ser); + + SerializeCoreIgbDateTimeInput(ser); + + if (IsPropDirty("Value")) + { ser.AddDateTimeProp("value", this._value); } + if (IsPropDirty("InputOcurredRef")) + { ser.AddStringProp("inputOcurredRef", this._inputOcurredRef); } + if (IsPropDirty("ChangeRef")) + { ser.AddStringProp("changeRef", this._changeRef); } + if (IsPropDirty("FocusRef")) + { ser.AddStringProp("focusRef", this._focusRef); } + if (IsPropDirty("BlurRef")) + { ser.AddStringProp("blurRef", this._blurRef); } + + } + + } } diff --git a/src/components/Blazor/DateTimeInputBase.cs b/src/components/Blazor/DateTimeInputBase.cs index 870eef3f..71b12341 100644 --- a/src/components/Blazor/DateTimeInputBase.cs +++ b/src/components/Blazor/DateTimeInputBase.cs @@ -1,513 +1,557 @@ - -using System; using Microsoft.AspNetCore.Components; -using Microsoft.AspNetCore.Components.Rendering; -using System.Threading.Tasks; -using System.Collections.Generic; -using System.Linq; namespace IgniteUI.Blazor.Controls { - public partial class IgbDateTimeInputBase: BaseRendererControl { - public override string Type { get { return "WebDateTimeInputBase"; } } - - protected override string ResolveDisplay() - { - return "inline-block"; - } - - protected override bool SupportsVisualChildren - { - get - { - return true; - } - } - - protected override ControlEventBehavior DefaultEventBehavior - { - get { return ControlEventBehavior.Queued; } - } - - public IgbDateTimeInputBase(): base() { - OnCreatedIgbDateTimeInputBase(); - - - } - - partial void OnCreatedIgbDateTimeInputBase(); - - private bool _outlined = false; - - partial void OnOutlinedChanging(ref bool newValue); - /// - /// Whether the control will have outlined appearance. - /// - [Parameter] - public bool Outlined - { - get { return this._outlined; } - set { - if (this._outlined != value || !IsPropDirty("Outlined")) { - MarkPropDirty("Outlined"); - } - this._outlined = value; - - } - } - private string _placeholder; - - partial void OnPlaceholderChanging(ref string newValue); - /// - /// The placeholder attribute of the control. - /// - [Parameter] - public string Placeholder - { - get { return this._placeholder; } - set { - if (this._placeholder != value || !IsPropDirty("Placeholder")) { - MarkPropDirty("Placeholder"); - } - this._placeholder = value; - - } - } - private string _label; - - partial void OnLabelChanging(ref string newValue); - /// - /// The label for the control. - /// - [Parameter] - public string Label - { - get { return this._label; } - set { - if (this._label != value || !IsPropDirty("Label")) { - MarkPropDirty("Label"); - } - this._label = value; - - } - } - private string _inputFormat; - - partial void OnInputFormatChanging(ref string newValue); - [Parameter] - public string InputFormat - { - get { return this._inputFormat; } - set { - if (this._inputFormat != value || !IsPropDirty("InputFormat")) { - MarkPropDirty("InputFormat"); - } - this._inputFormat = value; - - } - } - private DateTime? _min = DateTime.MinValue; - - partial void OnMinChanging(ref DateTime? newValue); - /// - /// The minimum value required for the input to remain valid. - /// - [Parameter] - public DateTime? Min - { - get { return this._min; } - set { - if (this._min != value || !IsPropDirty("Min")) { - MarkPropDirty("Min"); - } - this._min = value; - - } - } - private DateTime? _max = DateTime.MinValue; - - partial void OnMaxChanging(ref DateTime? newValue); - /// - /// The maximum value required for the input to remain valid. - /// - [Parameter] - public DateTime? Max - { - get { return this._max; } - set { - if (this._max != value || !IsPropDirty("Max")) { - MarkPropDirty("Max"); - } - this._max = value; - - } - } - private string _displayFormat; - - partial void OnDisplayFormatChanging(ref string newValue); - /// - /// Format to display the value in when not editing. - /// Defaults to the locale format if not set. - /// - [Parameter] - public string DisplayFormat - { - get { return this._displayFormat; } - set { - if (this._displayFormat != value || !IsPropDirty("DisplayFormat")) { - MarkPropDirty("DisplayFormat"); - } - this._displayFormat = value; - - } - } - private IgbDatePartDeltas _spinDelta; - - partial void OnSpinDeltaChanging(ref IgbDatePartDeltas newValue); - /// - /// Delta values used to increment or decrement each date part on step actions. - /// All values default to `1`. - /// - [Parameter] - public IgbDatePartDeltas SpinDelta - { - get { return this._spinDelta; } - set { - OnSpinDeltaChanging(ref value); - MarkPropDirty("SpinDelta"); - if (this._spinDelta != null) { - this.DetachChild(this._spinDelta); - } - if (value != null) { - this.AttachChild(value); - } - this._spinDelta = value; - } - - } - private bool _spinLoop = false; - - partial void OnSpinLoopChanging(ref bool newValue); - /// - /// Sets whether to loop over the currently spun segment. - /// - [Parameter] - public bool SpinLoop - { - get { return this._spinLoop; } - set { - if (this._spinLoop != value || !IsPropDirty("SpinLoop")) { - MarkPropDirty("SpinLoop"); - } - this._spinLoop = value; - - } - } - private string _locale; - - partial void OnLocaleChanging(ref string newValue); - /// - /// Gets/Sets the locale used for formatting the display value. - /// - [Parameter] - public string Locale - { - get { return this._locale; } - set { - if (this._locale != value || !IsPropDirty("Locale")) { - MarkPropDirty("Locale"); - } - this._locale = value; - - } - } - private bool _readOnly = false; - - partial void OnReadOnlyChanging(ref bool newValue); - /// - /// Makes the control a readonly field. - /// @default false - /// - [Parameter] - public bool ReadOnly - { - get { return this._readOnly; } - set { - if (this._readOnly != value || !IsPropDirty("ReadOnly")) { - MarkPropDirty("ReadOnly"); - } - this._readOnly = value; - - } - } - private string _mask; - - partial void OnMaskChanging(ref string newValue); - /// - /// The mask pattern of the component. - /// - [Parameter] - public string Mask - { - get { return this._mask; } - set { - if (this._mask != value || !IsPropDirty("Mask")) { - MarkPropDirty("Mask"); - } - this._mask = value; - - } - } - private string _prompt; - - partial void OnPromptChanging(ref string newValue); - /// - /// The prompt symbol to use for unfilled parts of the mask pattern. - /// @default '_' - /// - [Parameter] - public string Prompt - { - get { return this._prompt; } - set { - if (this._prompt != value || !IsPropDirty("Prompt")) { - MarkPropDirty("Prompt"); - } - this._prompt = value; - - } - } - private bool _disabled = false; - - partial void OnDisabledChanging(ref bool newValue); - /// - /// The disabled state of the component - /// - [Parameter] - public bool Disabled - { - get { return this._disabled; } - set { - if (this._disabled != value || !IsPropDirty("Disabled")) { - MarkPropDirty("Disabled"); - } - this._disabled = value; - - } - } - private bool _required = false; - - partial void OnRequiredChanging(ref bool newValue); - /// - /// Makes the control a required field in a form context. - /// - [Parameter] - public bool Required - { - get { return this._required; } - set { - if (this._required != value || !IsPropDirty("Required")) { - MarkPropDirty("Required"); - } - this._required = value; - - } - } - private bool _invalid = false; - - partial void OnInvalidChanging(ref bool newValue); - /// - /// Control the validity of the control. - /// - [Parameter] - public bool Invalid - { - get { return this._invalid; } - set { - if (this._invalid != value || !IsPropDirty("Invalid")) { - MarkPropDirty("Invalid"); - } - this._invalid = value; - - } - } - - partial void FindByNameDateTimeInputBase(string name, ref object item); - public override object FindByName(string name) - { - - var baseResult = base.FindByName(name); - if (baseResult != null) - { - return baseResult; - } - - object item = null; - FindByNameDateTimeInputBase(name, ref item); - if (item != null) - { - return item; - } - - return null; - } - public async Task SetNativeElementAsync(Object element) - { - await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); - } - public void SetNativeElement(Object element) - { - InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); - } - /// - /// Selects all the text inside the input. - /// - public async Task SelectAsync() - { - await InvokeMethod("select", new object[] { }, new string[] { }); - } - public void Select() - { - InvokeMethodSync("select", new object[] { }, new string[] { }); - } - /// - /// Sets focus on the control. - /// - - [WCWidgetMemberName("Focus")] - public async Task FocusComponentAsync(IgbFocusOptions options) - { - await InvokeMethod("focus", new object[] { ObjectToParam(options) }, new string[] { "Json" }); - } - - [WCWidgetMemberName("Focus")] - public void FocusComponent(IgbFocusOptions options) - { - InvokeMethodSync("focus", new object[] { ObjectToParam(options) }, new string[] { "Json" }); - } - /// - /// Removes focus from the control. - /// - - [WCWidgetMemberName("Blur")] - public async Task BlurComponentAsync() - { - await InvokeMethod("blur", new object[] { }, new string[] { }); - } - - [WCWidgetMemberName("Blur")] - public void BlurComponent() - { - InvokeMethodSync("blur", new object[] { }, new string[] { }); - } - /// - /// Clears the input element of user input. - /// - public async Task ClearAsync() - { - await InvokeMethod("clear", new object[] { }, new string[] { }); - } - public void Clear() - { - InvokeMethodSync("clear", new object[] { }, new string[] { }); - } - public async Task HasDatePartsAsync() - { - var iv = await InvokeMethod("hasDateParts", new object[] { }, new string[] { }); - return ReturnToBoolean(iv); - } - public bool HasDateParts() - { - var iv = InvokeMethodSync("hasDateParts", new object[] { }, new string[] { }); - return ReturnToBoolean(iv); - } - public async Task HasTimePartsAsync() - { - var iv = await InvokeMethod("hasTimeParts", new object[] { }, new string[] { }); - return ReturnToBoolean(iv); - } - public bool HasTimeParts() - { - var iv = InvokeMethodSync("hasTimeParts", new object[] { }, new string[] { }); - return ReturnToBoolean(iv); - } - public async Task SetSelectionRangeAsync(double start = -1, double end = -1, String direction = null) - { - await InvokeMethod("setSelectionRange", new object[] { start, end, StringToString(direction) }, new string[] { "Number", "Number", "String" }); - } - public void SetSelectionRange(double start = -1, double end = -1, String direction = null) - { - InvokeMethodSync("setSelectionRange", new object[] { start, end, StringToString(direction) }, new string[] { "Number", "Number", "String" }); - } - public async Task SetRangeTextAsync(String replacement, double start = -1, double end = -1, String selectMode = null) - { - await InvokeMethod("setRangeText", new object[] { StringToString(replacement), start, end, StringToString(selectMode) }, new string[] { "String", "Number", "Number", "String" }); - } - public void SetRangeText(String replacement, double start = -1, double end = -1, String selectMode = null) - { - InvokeMethodSync("setRangeText", new object[] { StringToString(replacement), start, end, StringToString(selectMode) }, new string[] { "String", "Number", "Number", "String" }); - } - /// - /// Checks for validity of the control and shows the browser message if it invalid. - /// - public async Task ReportValidityAsync() - { - await InvokeMethod("reportValidity", new object[] { }, new string[] { }); - } - public void ReportValidity() - { - InvokeMethodSync("reportValidity", new object[] { }, new string[] { }); - } - /// - /// Checks for validity of the control and emits the invalid event if it invalid. - /// - public async Task CheckValidityAsync() - { - await InvokeMethod("checkValidity", new object[] { }, new string[] { }); - } - public void CheckValidity() - { - InvokeMethodSync("checkValidity", new object[] { }, new string[] { }); - } - /// - /// Sets a custom validation message for the control. - /// As long as `message` is not empty, the control is considered invalid. - /// - public async Task SetCustomValidityAsync(String message) - { - await InvokeMethod("setCustomValidity", new object[] { StringToString(message) }, new string[] { "String" }); - } - public void SetCustomValidity(String message) - { - InvokeMethodSync("setCustomValidity", new object[] { StringToString(message) }, new string[] { "String" }); - } - - partial void SerializeCoreIgbDateTimeInputBase(RendererSerializer ser); - - internal override void SerializeCore(RendererSerializer ser) - { - base.SerializeCore(ser); - - SerializeCoreIgbDateTimeInputBase(ser); - - if (IsPropDirty("Outlined")) { ser.AddBooleanProp("outlined", this._outlined); } - if (IsPropDirty("Placeholder")) { ser.AddStringProp("placeholder", this._placeholder); } - if (IsPropDirty("Label")) { ser.AddStringProp("label", this._label); } - if (IsPropDirty("InputFormat")) { ser.AddStringProp("inputFormat", this._inputFormat); } - if (IsPropDirty("Min")) { ser.AddDateTimeProp("min", this._min); } - if (IsPropDirty("Max")) { ser.AddDateTimeProp("max", this._max); } - if (IsPropDirty("DisplayFormat")) { ser.AddStringProp("displayFormat", this._displayFormat); } - if (IsPropDirty("SpinDelta")) { ser.AddSerializableProp("spinDelta", this._spinDelta); } - if (IsPropDirty("SpinLoop")) { ser.AddBooleanProp("spinLoop", this._spinLoop); } - if (IsPropDirty("Locale")) { ser.AddStringProp("locale", this._locale); } - if (IsPropDirty("ReadOnly")) { ser.AddBooleanProp("readOnly", this._readOnly); } - if (IsPropDirty("Mask")) { ser.AddStringProp("mask", this._mask); } - if (IsPropDirty("Prompt")) { ser.AddStringProp("prompt", this._prompt); } - if (IsPropDirty("Disabled")) { ser.AddBooleanProp("disabled", this._disabled); } - if (IsPropDirty("Required")) { ser.AddBooleanProp("required", this._required); } - if (IsPropDirty("Invalid")) { ser.AddBooleanProp("invalid", this._invalid); } - - } - -} + public partial class IgbDateTimeInputBase : BaseRendererControl + { + public override string Type { get { return "WebDateTimeInputBase"; } } + + protected override string ResolveDisplay() + { + return "inline-block"; + } + + protected override bool SupportsVisualChildren + { + get + { + return true; + } + } + + protected override ControlEventBehavior DefaultEventBehavior + { + get { return ControlEventBehavior.Queued; } + } + + public IgbDateTimeInputBase() : base() + { + OnCreatedIgbDateTimeInputBase(); + + } + + partial void OnCreatedIgbDateTimeInputBase(); + + private bool _outlined = false; + + partial void OnOutlinedChanging(ref bool newValue); + /// + /// Whether the control will have outlined appearance. + /// + [Parameter] + public bool Outlined + { + get { return this._outlined; } + set + { + if (this._outlined != value || !IsPropDirty("Outlined")) + { + MarkPropDirty("Outlined"); + } + this._outlined = value; + + } + } + private string _placeholder; + + partial void OnPlaceholderChanging(ref string newValue); + /// + /// The placeholder attribute of the control. + /// + [Parameter] + public string Placeholder + { + get { return this._placeholder; } + set + { + if (this._placeholder != value || !IsPropDirty("Placeholder")) + { + MarkPropDirty("Placeholder"); + } + this._placeholder = value; + + } + } + private string _label; + + partial void OnLabelChanging(ref string newValue); + /// + /// The label for the control. + /// + [Parameter] + public string Label + { + get { return this._label; } + set + { + if (this._label != value || !IsPropDirty("Label")) + { + MarkPropDirty("Label"); + } + this._label = value; + + } + } + private string _inputFormat; + + partial void OnInputFormatChanging(ref string newValue); + [Parameter] + public string InputFormat + { + get { return this._inputFormat; } + set + { + if (this._inputFormat != value || !IsPropDirty("InputFormat")) + { + MarkPropDirty("InputFormat"); + } + this._inputFormat = value; + + } + } + private DateTime? _min = DateTime.MinValue; + + partial void OnMinChanging(ref DateTime? newValue); + /// + /// The minimum value required for the input to remain valid. + /// + [Parameter] + public DateTime? Min + { + get { return this._min; } + set + { + if (this._min != value || !IsPropDirty("Min")) + { + MarkPropDirty("Min"); + } + this._min = value; + + } + } + private DateTime? _max = DateTime.MinValue; + + partial void OnMaxChanging(ref DateTime? newValue); + /// + /// The maximum value required for the input to remain valid. + /// + [Parameter] + public DateTime? Max + { + get { return this._max; } + set + { + if (this._max != value || !IsPropDirty("Max")) + { + MarkPropDirty("Max"); + } + this._max = value; + + } + } + private string _displayFormat; + + partial void OnDisplayFormatChanging(ref string newValue); + /// + /// Format to display the value in when not editing. + /// Defaults to the locale format if not set. + /// + [Parameter] + public string DisplayFormat + { + get { return this._displayFormat; } + set + { + if (this._displayFormat != value || !IsPropDirty("DisplayFormat")) + { + MarkPropDirty("DisplayFormat"); + } + this._displayFormat = value; + + } + } + private IgbDatePartDeltas _spinDelta; + + partial void OnSpinDeltaChanging(ref IgbDatePartDeltas newValue); + /// + /// Delta values used to increment or decrement each date part on step actions. + /// All values default to `1`. + /// + [Parameter] + public IgbDatePartDeltas SpinDelta + { + get { return this._spinDelta; } + set + { + OnSpinDeltaChanging(ref value); + MarkPropDirty("SpinDelta"); + if (this._spinDelta != null) + { + this.DetachChild(this._spinDelta); + } + if (value != null) + { + this.AttachChild(value); + } + this._spinDelta = value; + } + + } + private bool _spinLoop = false; + + partial void OnSpinLoopChanging(ref bool newValue); + /// + /// Sets whether to loop over the currently spun segment. + /// + [Parameter] + public bool SpinLoop + { + get { return this._spinLoop; } + set + { + if (this._spinLoop != value || !IsPropDirty("SpinLoop")) + { + MarkPropDirty("SpinLoop"); + } + this._spinLoop = value; + + } + } + private string _locale; + + partial void OnLocaleChanging(ref string newValue); + /// + /// Gets/Sets the locale used for formatting the display value. + /// + [Parameter] + public string Locale + { + get { return this._locale; } + set + { + if (this._locale != value || !IsPropDirty("Locale")) + { + MarkPropDirty("Locale"); + } + this._locale = value; + + } + } + private bool _readOnly = false; + + partial void OnReadOnlyChanging(ref bool newValue); + /// + /// Makes the control a readonly field. + /// @default false + /// + [Parameter] + public bool ReadOnly + { + get { return this._readOnly; } + set + { + if (this._readOnly != value || !IsPropDirty("ReadOnly")) + { + MarkPropDirty("ReadOnly"); + } + this._readOnly = value; + + } + } + private string _mask; + + partial void OnMaskChanging(ref string newValue); + /// + /// The mask pattern of the component. + /// + [Parameter] + public string Mask + { + get { return this._mask; } + set + { + if (this._mask != value || !IsPropDirty("Mask")) + { + MarkPropDirty("Mask"); + } + this._mask = value; + + } + } + private string _prompt; + + partial void OnPromptChanging(ref string newValue); + /// + /// The prompt symbol to use for unfilled parts of the mask pattern. + /// @default '_' + /// + [Parameter] + public string Prompt + { + get { return this._prompt; } + set + { + if (this._prompt != value || !IsPropDirty("Prompt")) + { + MarkPropDirty("Prompt"); + } + this._prompt = value; + + } + } + private bool _disabled = false; + + partial void OnDisabledChanging(ref bool newValue); + /// + /// The disabled state of the component + /// + [Parameter] + public bool Disabled + { + get { return this._disabled; } + set + { + if (this._disabled != value || !IsPropDirty("Disabled")) + { + MarkPropDirty("Disabled"); + } + this._disabled = value; + + } + } + private bool _required = false; + + partial void OnRequiredChanging(ref bool newValue); + /// + /// Makes the control a required field in a form context. + /// + [Parameter] + public bool Required + { + get { return this._required; } + set + { + if (this._required != value || !IsPropDirty("Required")) + { + MarkPropDirty("Required"); + } + this._required = value; + + } + } + private bool _invalid = false; + + partial void OnInvalidChanging(ref bool newValue); + /// + /// Control the validity of the control. + /// + [Parameter] + public bool Invalid + { + get { return this._invalid; } + set + { + if (this._invalid != value || !IsPropDirty("Invalid")) + { + MarkPropDirty("Invalid"); + } + this._invalid = value; + + } + } + + partial void FindByNameDateTimeInputBase(string name, ref object item); + public override object FindByName(string name) + { + + var baseResult = base.FindByName(name); + if (baseResult != null) + { + return baseResult; + } + + object item = null; + FindByNameDateTimeInputBase(name, ref item); + if (item != null) + { + return item; + } + + return null; + } + public async Task SetNativeElementAsync(Object element) + { + await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + } + public void SetNativeElement(Object element) + { + InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + } + /// + /// Selects all the text inside the input. + /// + public async Task SelectAsync() + { + await InvokeMethod("select", new object[] { }, new string[] { }); + } + public void Select() + { + InvokeMethodSync("select", new object[] { }, new string[] { }); + } + /// + /// Sets focus on the control. + /// + + [WCWidgetMemberName("Focus")] + public async Task FocusComponentAsync(IgbFocusOptions options) + { + await InvokeMethod("focus", new object[] { ObjectToParam(options) }, new string[] { "Json" }); + } + + [WCWidgetMemberName("Focus")] + public void FocusComponent(IgbFocusOptions options) + { + InvokeMethodSync("focus", new object[] { ObjectToParam(options) }, new string[] { "Json" }); + } + /// + /// Removes focus from the control. + /// + + [WCWidgetMemberName("Blur")] + public async Task BlurComponentAsync() + { + await InvokeMethod("blur", new object[] { }, new string[] { }); + } + + [WCWidgetMemberName("Blur")] + public void BlurComponent() + { + InvokeMethodSync("blur", new object[] { }, new string[] { }); + } + /// + /// Clears the input element of user input. + /// + public async Task ClearAsync() + { + await InvokeMethod("clear", new object[] { }, new string[] { }); + } + public void Clear() + { + InvokeMethodSync("clear", new object[] { }, new string[] { }); + } + public async Task HasDatePartsAsync() + { + var iv = await InvokeMethod("hasDateParts", new object[] { }, new string[] { }); + return ReturnToBoolean(iv); + } + public bool HasDateParts() + { + var iv = InvokeMethodSync("hasDateParts", new object[] { }, new string[] { }); + return ReturnToBoolean(iv); + } + public async Task HasTimePartsAsync() + { + var iv = await InvokeMethod("hasTimeParts", new object[] { }, new string[] { }); + return ReturnToBoolean(iv); + } + public bool HasTimeParts() + { + var iv = InvokeMethodSync("hasTimeParts", new object[] { }, new string[] { }); + return ReturnToBoolean(iv); + } + public async Task SetSelectionRangeAsync(double start = -1, double end = -1, String direction = null) + { + await InvokeMethod("setSelectionRange", new object[] { start, end, StringToString(direction) }, new string[] { "Number", "Number", "String" }); + } + public void SetSelectionRange(double start = -1, double end = -1, String direction = null) + { + InvokeMethodSync("setSelectionRange", new object[] { start, end, StringToString(direction) }, new string[] { "Number", "Number", "String" }); + } + public async Task SetRangeTextAsync(String replacement, double start = -1, double end = -1, String selectMode = null) + { + await InvokeMethod("setRangeText", new object[] { StringToString(replacement), start, end, StringToString(selectMode) }, new string[] { "String", "Number", "Number", "String" }); + } + public void SetRangeText(String replacement, double start = -1, double end = -1, String selectMode = null) + { + InvokeMethodSync("setRangeText", new object[] { StringToString(replacement), start, end, StringToString(selectMode) }, new string[] { "String", "Number", "Number", "String" }); + } + /// + /// Checks for validity of the control and shows the browser message if it invalid. + /// + public async Task ReportValidityAsync() + { + await InvokeMethod("reportValidity", new object[] { }, new string[] { }); + } + public void ReportValidity() + { + InvokeMethodSync("reportValidity", new object[] { }, new string[] { }); + } + /// + /// Checks for validity of the control and emits the invalid event if it invalid. + /// + public async Task CheckValidityAsync() + { + await InvokeMethod("checkValidity", new object[] { }, new string[] { }); + } + public void CheckValidity() + { + InvokeMethodSync("checkValidity", new object[] { }, new string[] { }); + } + /// + /// Sets a custom validation message for the control. + /// As long as `message` is not empty, the control is considered invalid. + /// + public async Task SetCustomValidityAsync(String message) + { + await InvokeMethod("setCustomValidity", new object[] { StringToString(message) }, new string[] { "String" }); + } + public void SetCustomValidity(String message) + { + InvokeMethodSync("setCustomValidity", new object[] { StringToString(message) }, new string[] { "String" }); + } + + partial void SerializeCoreIgbDateTimeInputBase(RendererSerializer ser); + + internal override void SerializeCore(RendererSerializer ser) + { + base.SerializeCore(ser); + + SerializeCoreIgbDateTimeInputBase(ser); + + if (IsPropDirty("Outlined")) + { ser.AddBooleanProp("outlined", this._outlined); } + if (IsPropDirty("Placeholder")) + { ser.AddStringProp("placeholder", this._placeholder); } + if (IsPropDirty("Label")) + { ser.AddStringProp("label", this._label); } + if (IsPropDirty("InputFormat")) + { ser.AddStringProp("inputFormat", this._inputFormat); } + if (IsPropDirty("Min")) + { ser.AddDateTimeProp("min", this._min); } + if (IsPropDirty("Max")) + { ser.AddDateTimeProp("max", this._max); } + if (IsPropDirty("DisplayFormat")) + { ser.AddStringProp("displayFormat", this._displayFormat); } + if (IsPropDirty("SpinDelta")) + { ser.AddSerializableProp("spinDelta", this._spinDelta); } + if (IsPropDirty("SpinLoop")) + { ser.AddBooleanProp("spinLoop", this._spinLoop); } + if (IsPropDirty("Locale")) + { ser.AddStringProp("locale", this._locale); } + if (IsPropDirty("ReadOnly")) + { ser.AddBooleanProp("readOnly", this._readOnly); } + if (IsPropDirty("Mask")) + { ser.AddStringProp("mask", this._mask); } + if (IsPropDirty("Prompt")) + { ser.AddStringProp("prompt", this._prompt); } + if (IsPropDirty("Disabled")) + { ser.AddBooleanProp("disabled", this._disabled); } + if (IsPropDirty("Required")) + { ser.AddBooleanProp("required", this._required); } + if (IsPropDirty("Invalid")) + { ser.AddBooleanProp("invalid", this._invalid); } + + } + + } } diff --git a/src/components/Blazor/DateTimeInputModule.cs b/src/components/Blazor/DateTimeInputModule.cs index 694fd774..734322e2 100644 --- a/src/components/Blazor/DateTimeInputModule.cs +++ b/src/components/Blazor/DateTimeInputModule.cs @@ -1,23 +1,20 @@ -using System; -using System.Collections.Generic; -using System.Runtime.CompilerServices; -using System.Text; -using System.Collections.Generic; - namespace IgniteUI.Blazor.Controls { - public partial class IgbDateTimeInputModule { - public static void Register(IIgniteUIBlazor runtime) { + public partial class IgbDateTimeInputModule + { + public static void Register(IIgniteUIBlazor runtime) + { ModuleLoader.Load(runtime, "WebDateTimeInputModule"); - } - public static void MarkIsLoadRequested(IIgniteUIBlazor runtime) { + public static void MarkIsLoadRequested(IIgniteUIBlazor runtime) + { ModuleLoader.MarkIsLoadRequested(runtime, "WebDateTimeInputModule"); } - public static bool IsLoadRequested(IIgniteUIBlazor runtime) { + public static bool IsLoadRequested(IIgniteUIBlazor runtime) + { return ModuleLoader.IsLoadRequested(runtime, "WebDateTimeInputModule"); } } diff --git a/src/components/Blazor/Dialog.cs b/src/components/Blazor/Dialog.cs index 4d3e69a0..3dc72611 100644 --- a/src/components/Blazor/Dialog.cs +++ b/src/components/Blazor/Dialog.cs @@ -1,395 +1,420 @@ - -using System; using Microsoft.AspNetCore.Components; -using Microsoft.AspNetCore.Components.Rendering; -using System.Threading.Tasks; -using System.Collections.Generic; -using System.Linq; namespace IgniteUI.Blazor.Controls { - public partial class IgbDialog: BaseRendererControl { - public override string Type { get { return "WebDialog"; } } - - protected override void EnsureModulesLoaded() - { - if (!IgbDialogModule.IsLoadRequested(IgBlazor)) - { - IgbDialogModule.Register(IgBlazor); - } - } - - protected override string ResolveDisplay() + public partial class IgbDialog : BaseRendererControl + { + public override string Type { get { return "WebDialog"; } } + + protected override void EnsureModulesLoaded() + { + if (!IgbDialogModule.IsLoadRequested(IgBlazor)) + { + IgbDialogModule.Register(IgBlazor); + } + } + + protected override string ResolveDisplay() + { + return "inline-block"; + } + + protected override bool SupportsVisualChildren + { + get + { + return true; + } + } + + protected override bool UseDirectRender + { + get + { + return true; + } + } + + protected override string DirectRenderElementName + { + get + { + return "igc-dialog"; + } + } + + protected override ControlEventBehavior DefaultEventBehavior + { + get { return ControlEventBehavior.Immediate; } + } + + public IgbDialog() : base() + { + OnCreatedIgbDialog(); + + } + + partial void OnCreatedIgbDialog(); + + private bool _keepOpenOnEscape = false; + + partial void OnKeepOpenOnEscapeChanging(ref bool newValue); + /// + /// When set, pressing the `Escape` key will not close the dialog. + /// By default the browser closes a modal dialog on `Escape`. Enable this + /// option when the dialog guards unsaved work and should require an explicit + /// user action to dismiss. + /// + [Parameter] + public bool KeepOpenOnEscape + { + get { return this._keepOpenOnEscape; } + set + { + if (this._keepOpenOnEscape != value || !IsPropDirty("KeepOpenOnEscape")) + { + MarkPropDirty("KeepOpenOnEscape"); + } + this._keepOpenOnEscape = value; + + } + } + private bool _closeOnOutsideClick = false; + + partial void OnCloseOnOutsideClickChanging(ref bool newValue); + /// + /// When set, clicking on the backdrop area outside the dialog surface + /// will close it (emitting close events). + /// Has no effect when the dialog is not yet open. + /// + [Parameter] + public bool CloseOnOutsideClick + { + get { return this._closeOnOutsideClick; } + set + { + if (this._closeOnOutsideClick != value || !IsPropDirty("CloseOnOutsideClick")) + { + MarkPropDirty("CloseOnOutsideClick"); + } + this._closeOnOutsideClick = value; + + } + } + private bool _hideDefaultAction = false; + + partial void OnHideDefaultActionChanging(ref bool newValue); + /// + /// When set, the built-in "OK" close button in the footer is not rendered. + /// Has no effect when content is projected into the `footer` slot, since + /// the slot content replaces the default button entirely. + /// + [Parameter] + public bool HideDefaultAction + { + get { return this._hideDefaultAction; } + set + { + if (this._hideDefaultAction != value || !IsPropDirty("HideDefaultAction")) + { + MarkPropDirty("HideDefaultAction"); + } + this._hideDefaultAction = value; + + } + } + private bool _open = false; + + partial void OnOpenChanging(ref bool newValue); + /// + /// Whether the dialog is open. + /// Setting this property programmatically will open or close the dialog + /// without animation and without emitting close events. + /// Prefer the `show()`, `hide()`, and `toggle()` methods for animated + /// transitions. + /// + [Parameter] + public bool Open + { + get { return this._open; } + set + { + if (this._open != value || !IsPropDirty("Open")) + { + MarkPropDirty("Open"); + } + this._open = value; + + } + } + private string _title; + + partial void OnTitleChanging(ref string newValue); + /// + /// The title displayed in the dialog header. + /// Overridden by any content projected into the `title` slot. + /// + [Parameter] + public string Title + { + get { return this._title; } + set + { + if (this._title != value || !IsPropDirty("Title")) + { + MarkPropDirty("Title"); + } + this._title = value; + + } + } + private string _returnValue; + + partial void OnReturnValueChanging(ref string newValue); + [Parameter] + public string ReturnValue + { + get { return this._returnValue; } + set + { + if (this._returnValue != value || !IsPropDirty("ReturnValue")) + { + MarkPropDirty("ReturnValue"); + } + this._returnValue = value; + + } + } + + partial void FindByNameDialog(string name, ref object item); + public override object FindByName(string name) + { + + var baseResult = base.FindByName(name); + if (baseResult != null) + { + return baseResult; + } + + object item = null; + FindByNameDialog(name, ref item); + if (item != null) + { + return item; + } + + return null; + } + public async Task SetNativeElementAsync(Object element) + { + await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + } + public void SetNativeElement(Object element) + { + InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + } + /// + /// Opens the dialog with an animated fade-in transition. + /// Returns `true` when the dialog was successfully opened, or `false` if + /// it was already open. + /// + public async Task ShowAsync() + { + var iv = await InvokeMethod("show", new object[] { }, new string[] { }); + return ReturnToBoolean(iv); + } + public bool Show() + { + var iv = InvokeMethodSync("show", new object[] { }, new string[] { }); + return ReturnToBoolean(iv); + } + /// + /// Closes the dialog with an animated fade-out transition. + /// Returns `true` when the dialog was successfully closed, or `false` if + /// it was already closed. + /// + public async Task HideAsync() + { + var iv = await InvokeMethod("hide", new object[] { }, new string[] { }); + return ReturnToBoolean(iv); + } + public bool Hide() + { + var iv = InvokeMethodSync("hide", new object[] { }, new string[] { }); + return ReturnToBoolean(iv); + } + /// + /// Toggles the dialog open or closed depending on its current state. + /// Equivalent to calling `show()` when closed and `hide()` when open. + /// Returns `true` when the transition completed successfully. + /// + public async Task ToggleAsync() + { + var iv = await InvokeMethod("toggle", new object[] { }, new string[] { }); + return ReturnToBoolean(iv); + } + public bool Toggle() + { + var iv = InvokeMethodSync("toggle", new object[] { }, new string[] { }); + return ReturnToBoolean(iv); + } + + private string _closingRef = null; + private string _closingScript = null; + [Parameter] + public string ClosingScript + { + + set + { + if (value != this._closingScript) + { + this._closingScript = value; + this.OnRefChanged("Closing", null, value, true, false, (string refName, object oldValue, object newValue) => + { + this._closingRef = refName; + this.MarkPropDirty("ClosingRef"); + }); + } + } + get + { + return this._closingScript; + } + } + + partial void OnHandlingClosing(IgbVoidEventArgs args); + private EventCallback? _closing = null; + [Parameter] + public EventCallback Closing + { + get + { + return this._closing != null ? this._closing.Value : EventCallback.Empty; + } + set + { + if (!value.Equals(EventCallback.Empty)) + { + if (!CompareEventCallbacks(value, _closing, ref eventCallbacksCache)) + { + _closing = value; + this.SetHandler(this.Name, "Closing", value, (args) => { - return "inline-block"; - } + OnHandlingClosing(args); - protected override bool SupportsVisualChildren + }); + this.OnRefChanged("Closing", null, "event:::Closing", true, false, (refName, oldValue, newValue) => { - get - { - return true; - } - } + this._closingRef = refName; + this.MarkPropDirty("ClosingRef"); + }); + } + } + else + { + _closing = null; + this.SetHandler(this.Name, "Closing", null); + this.OnRefChanged("Closing", null, null, true, false, (refName, oldValue, newValue) => + { + this._closingRef = null; + this.MarkPropDirty("ClosingRef"); + }); + } + } + } - protected override bool UseDirectRender + private string _closedRef = null; + private string _closedScript = null; + [Parameter] + public string ClosedScript + { + + set + { + if (value != this._closedScript) + { + this._closedScript = value; + this.OnRefChanged("Closed", null, value, true, false, (string refName, object oldValue, object newValue) => + { + this._closedRef = refName; + this.MarkPropDirty("ClosedRef"); + }); + } + } + get + { + return this._closedScript; + } + } + + partial void OnHandlingClosed(IgbVoidEventArgs args); + private EventCallback? _closed = null; + [Parameter] + public EventCallback Closed + { + get + { + return this._closed != null ? this._closed.Value : EventCallback.Empty; + } + set + { + if (!value.Equals(EventCallback.Empty)) + { + if (!CompareEventCallbacks(value, _closed, ref eventCallbacksCache)) + { + _closed = value; + this.SetHandler(this.Name, "Closed", value, (args) => { - get - { - return true; - } - } + OnHandlingClosed(args); - protected override string DirectRenderElementName + }); + this.OnRefChanged("Closed", null, "event:::Closed", true, false, (refName, oldValue, newValue) => { - get - { - return "igc-dialog"; - } - } - - protected override ControlEventBehavior DefaultEventBehavior - { - get { return ControlEventBehavior.Immediate; } - } - - public IgbDialog(): base() { - OnCreatedIgbDialog(); - - - } - - partial void OnCreatedIgbDialog(); - - private bool _keepOpenOnEscape = false; - - partial void OnKeepOpenOnEscapeChanging(ref bool newValue); - /// - /// When set, pressing the `Escape` key will not close the dialog. - /// By default the browser closes a modal dialog on `Escape`. Enable this - /// option when the dialog guards unsaved work and should require an explicit - /// user action to dismiss. - /// - [Parameter] - public bool KeepOpenOnEscape - { - get { return this._keepOpenOnEscape; } - set { - if (this._keepOpenOnEscape != value || !IsPropDirty("KeepOpenOnEscape")) { - MarkPropDirty("KeepOpenOnEscape"); - } - this._keepOpenOnEscape = value; - - } - } - private bool _closeOnOutsideClick = false; - - partial void OnCloseOnOutsideClickChanging(ref bool newValue); - /// - /// When set, clicking on the backdrop area outside the dialog surface - /// will close it (emitting close events). - /// Has no effect when the dialog is not yet open. - /// - [Parameter] - public bool CloseOnOutsideClick - { - get { return this._closeOnOutsideClick; } - set { - if (this._closeOnOutsideClick != value || !IsPropDirty("CloseOnOutsideClick")) { - MarkPropDirty("CloseOnOutsideClick"); - } - this._closeOnOutsideClick = value; - - } - } - private bool _hideDefaultAction = false; - - partial void OnHideDefaultActionChanging(ref bool newValue); - /// - /// When set, the built-in "OK" close button in the footer is not rendered. - /// Has no effect when content is projected into the `footer` slot, since - /// the slot content replaces the default button entirely. - /// - [Parameter] - public bool HideDefaultAction - { - get { return this._hideDefaultAction; } - set { - if (this._hideDefaultAction != value || !IsPropDirty("HideDefaultAction")) { - MarkPropDirty("HideDefaultAction"); - } - this._hideDefaultAction = value; - - } - } - private bool _open = false; - - partial void OnOpenChanging(ref bool newValue); - /// - /// Whether the dialog is open. - /// Setting this property programmatically will open or close the dialog - /// without animation and without emitting close events. - /// Prefer the `show()`, `hide()`, and `toggle()` methods for animated - /// transitions. - /// - [Parameter] - public bool Open - { - get { return this._open; } - set { - if (this._open != value || !IsPropDirty("Open")) { - MarkPropDirty("Open"); - } - this._open = value; - - } - } - private string _title; - - partial void OnTitleChanging(ref string newValue); - /// - /// The title displayed in the dialog header. - /// Overridden by any content projected into the `title` slot. - /// - [Parameter] - public string Title - { - get { return this._title; } - set { - if (this._title != value || !IsPropDirty("Title")) { - MarkPropDirty("Title"); - } - this._title = value; - - } - } - private string _returnValue; - - partial void OnReturnValueChanging(ref string newValue); - [Parameter] - public string ReturnValue - { - get { return this._returnValue; } - set { - if (this._returnValue != value || !IsPropDirty("ReturnValue")) { - MarkPropDirty("ReturnValue"); - } - this._returnValue = value; - - } - } - - partial void FindByNameDialog(string name, ref object item); - public override object FindByName(string name) - { - - var baseResult = base.FindByName(name); - if (baseResult != null) - { - return baseResult; - } - - object item = null; - FindByNameDialog(name, ref item); - if (item != null) - { - return item; - } - - return null; - } - public async Task SetNativeElementAsync(Object element) - { - await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); - } - public void SetNativeElement(Object element) - { - InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); - } - /// - /// Opens the dialog with an animated fade-in transition. - /// Returns `true` when the dialog was successfully opened, or `false` if - /// it was already open. - /// - public async Task ShowAsync() - { - var iv = await InvokeMethod("show", new object[] { }, new string[] { }); - return ReturnToBoolean(iv); - } - public bool Show() - { - var iv = InvokeMethodSync("show", new object[] { }, new string[] { }); - return ReturnToBoolean(iv); - } - /// - /// Closes the dialog with an animated fade-out transition. - /// Returns `true` when the dialog was successfully closed, or `false` if - /// it was already closed. - /// - public async Task HideAsync() - { - var iv = await InvokeMethod("hide", new object[] { }, new string[] { }); - return ReturnToBoolean(iv); - } - public bool Hide() - { - var iv = InvokeMethodSync("hide", new object[] { }, new string[] { }); - return ReturnToBoolean(iv); - } - /// - /// Toggles the dialog open or closed depending on its current state. - /// Equivalent to calling `show()` when closed and `hide()` when open. - /// Returns `true` when the transition completed successfully. - /// - public async Task ToggleAsync() - { - var iv = await InvokeMethod("toggle", new object[] { }, new string[] { }); - return ReturnToBoolean(iv); - } - public bool Toggle() - { - var iv = InvokeMethodSync("toggle", new object[] { }, new string[] { }); - return ReturnToBoolean(iv); - } - - private string _closingRef = null; - private string _closingScript = null; - [Parameter] - public string ClosingScript { - - set - { - if (value != this._closingScript) - { - this._closingScript = value; - this.OnRefChanged("Closing", null, value, true, false, (string refName, object oldValue, object newValue) => { - this._closingRef = refName; - this.MarkPropDirty("ClosingRef"); - }); - } - } - get - { - return this._closingScript; - } - } - - partial void OnHandlingClosing(IgbVoidEventArgs args); - private EventCallback? _closing = null; - [Parameter] - public EventCallback Closing - { - get - { - return this._closing != null ? this._closing.Value : EventCallback.Empty; - } - set - { - if (!value.Equals(EventCallback.Empty)) - { - if (!CompareEventCallbacks(value, _closing, ref eventCallbacksCache)) - { - _closing = value; - this.SetHandler(this.Name, "Closing", value, (args) => { - OnHandlingClosing(args); - - }); - this.OnRefChanged("Closing", null, "event:::Closing", true, false, (refName, oldValue, newValue) => { - this._closingRef = refName; - this.MarkPropDirty("ClosingRef"); - }); - } - } - else - { - _closing = null; - this.SetHandler(this.Name, "Closing", null); - this.OnRefChanged("Closing", null, null, true, false, (refName, oldValue, newValue) => { - this._closingRef = null; - this.MarkPropDirty("ClosingRef"); - }); - } - } - } - - private string _closedRef = null; - private string _closedScript = null; - [Parameter] - public string ClosedScript { - - set - { - if (value != this._closedScript) - { - this._closedScript = value; - this.OnRefChanged("Closed", null, value, true, false, (string refName, object oldValue, object newValue) => { - this._closedRef = refName; - this.MarkPropDirty("ClosedRef"); - }); - } - } - get - { - return this._closedScript; - } - } - - partial void OnHandlingClosed(IgbVoidEventArgs args); - private EventCallback? _closed = null; - [Parameter] - public EventCallback Closed - { - get - { - return this._closed != null ? this._closed.Value : EventCallback.Empty; - } - set - { - if (!value.Equals(EventCallback.Empty)) - { - if (!CompareEventCallbacks(value, _closed, ref eventCallbacksCache)) - { - _closed = value; - this.SetHandler(this.Name, "Closed", value, (args) => { - OnHandlingClosed(args); - - }); - this.OnRefChanged("Closed", null, "event:::Closed", true, false, (refName, oldValue, newValue) => { - this._closedRef = refName; - this.MarkPropDirty("ClosedRef"); - }); - } - } - else - { - _closed = null; - this.SetHandler(this.Name, "Closed", null); - this.OnRefChanged("Closed", null, null, true, false, (refName, oldValue, newValue) => { - this._closedRef = null; - this.MarkPropDirty("ClosedRef"); - }); - } - } - } - - partial void SerializeCoreIgbDialog(RendererSerializer ser); - - internal override void SerializeCore(RendererSerializer ser) - { - base.SerializeCore(ser); - - SerializeCoreIgbDialog(ser); - - if (IsPropDirty("KeepOpenOnEscape")) { ser.AddBooleanProp("keepOpenOnEscape", this._keepOpenOnEscape); } - if (IsPropDirty("CloseOnOutsideClick")) { ser.AddBooleanProp("closeOnOutsideClick", this._closeOnOutsideClick); } - if (IsPropDirty("HideDefaultAction")) { ser.AddBooleanProp("hideDefaultAction", this._hideDefaultAction); } - if (IsPropDirty("Open")) { ser.AddBooleanProp("open", this._open); } - if (IsPropDirty("Title")) { ser.AddStringProp("title", this._title); } - if (IsPropDirty("ReturnValue")) { ser.AddStringProp("returnValue", this._returnValue); } - if (IsPropDirty("ClosingRef")) { ser.AddStringProp("closingRef", this._closingRef); } - if (IsPropDirty("ClosedRef")) { ser.AddStringProp("closedRef", this._closedRef); } - - } - -} + this._closedRef = refName; + this.MarkPropDirty("ClosedRef"); + }); + } + } + else + { + _closed = null; + this.SetHandler(this.Name, "Closed", null); + this.OnRefChanged("Closed", null, null, true, false, (refName, oldValue, newValue) => + { + this._closedRef = null; + this.MarkPropDirty("ClosedRef"); + }); + } + } + } + + partial void SerializeCoreIgbDialog(RendererSerializer ser); + + internal override void SerializeCore(RendererSerializer ser) + { + base.SerializeCore(ser); + + SerializeCoreIgbDialog(ser); + + if (IsPropDirty("KeepOpenOnEscape")) + { ser.AddBooleanProp("keepOpenOnEscape", this._keepOpenOnEscape); } + if (IsPropDirty("CloseOnOutsideClick")) + { ser.AddBooleanProp("closeOnOutsideClick", this._closeOnOutsideClick); } + if (IsPropDirty("HideDefaultAction")) + { ser.AddBooleanProp("hideDefaultAction", this._hideDefaultAction); } + if (IsPropDirty("Open")) + { ser.AddBooleanProp("open", this._open); } + if (IsPropDirty("Title")) + { ser.AddStringProp("title", this._title); } + if (IsPropDirty("ReturnValue")) + { ser.AddStringProp("returnValue", this._returnValue); } + if (IsPropDirty("ClosingRef")) + { ser.AddStringProp("closingRef", this._closingRef); } + if (IsPropDirty("ClosedRef")) + { ser.AddStringProp("closedRef", this._closedRef); } + + } + + } } diff --git a/src/components/Blazor/DialogModule.cs b/src/components/Blazor/DialogModule.cs index dfb82347..120ccb96 100644 --- a/src/components/Blazor/DialogModule.cs +++ b/src/components/Blazor/DialogModule.cs @@ -1,24 +1,22 @@ -using System; -using System.Collections.Generic; -using System.Runtime.CompilerServices; -using System.Text; -using System.Collections.Generic; - namespace IgniteUI.Blazor.Controls { - public partial class IgbDialogModule { - public static void Register(IIgniteUIBlazor runtime) { + public partial class IgbDialogModule + { + public static void Register(IIgniteUIBlazor runtime) + { ModuleLoader.Load(runtime, "WebDialogModule"); IgbButtonModule.MarkIsLoadRequested(runtime); } - public static void MarkIsLoadRequested(IIgniteUIBlazor runtime) { + public static void MarkIsLoadRequested(IIgniteUIBlazor runtime) + { ModuleLoader.MarkIsLoadRequested(runtime, "WebDialogModule"); } - public static bool IsLoadRequested(IIgniteUIBlazor runtime) { + public static bool IsLoadRequested(IIgniteUIBlazor runtime) + { return ModuleLoader.IsLoadRequested(runtime, "WebDialogModule"); } } diff --git a/src/components/Blazor/Divider.cs b/src/components/Blazor/Divider.cs index c6d624ff..d4be4319 100644 --- a/src/components/Blazor/Divider.cs +++ b/src/components/Blazor/Divider.cs @@ -1,166 +1,170 @@ - -using System; using Microsoft.AspNetCore.Components; -using Microsoft.AspNetCore.Components.Rendering; -using System.Threading.Tasks; -using System.Collections.Generic; -using System.Linq; namespace IgniteUI.Blazor.Controls { - /// -/// The igc-divider allows the content author to easily create a horizontal/vertical rule as a break between content to better organize information on a page. -/// -public partial class IgbDivider: BaseRendererControl { - public override string Type { get { return "WebDivider"; } } - - protected override void EnsureModulesLoaded() - { - if (!IgbDividerModule.IsLoadRequested(IgBlazor)) - { - IgbDividerModule.Register(IgBlazor); - } - } - - protected override string ResolveDisplay() - { - return "inline-block"; - } - - protected override bool SupportsVisualChildren - { - get - { - return true; - } - } - - protected override bool UseDirectRender - { - get - { - return true; - } - } - - protected override string DirectRenderElementName - { - get - { - return "igc-divider"; - } - } - - protected override ControlEventBehavior DefaultEventBehavior - { - get { return ControlEventBehavior.Immediate; } - } - - public IgbDivider(): base() { - OnCreatedIgbDivider(); - - - } - - partial void OnCreatedIgbDivider(); - - private bool _vertical = false; - - partial void OnVerticalChanging(ref bool newValue); - /// - /// Whether to render a vertical divider line. - /// - [Parameter] - public bool Vertical - { - get { return this._vertical; } - set { - if (this._vertical != value || !IsPropDirty("Vertical")) { - MarkPropDirty("Vertical"); - } - this._vertical = value; - - } - } - private bool _middle = false; - - partial void OnMiddleChanging(ref bool newValue); - /// - /// When set and inset is provided, it will shrink the divider line from both sides. - /// - [Parameter] - public bool Middle - { - get { return this._middle; } - set { - if (this._middle != value || !IsPropDirty("Middle")) { - MarkPropDirty("Middle"); - } - this._middle = value; - - } - } - private DividerType _lineType = DividerType.Solid; - - partial void OnLineTypeChanging(ref DividerType newValue); - /// - /// Whether to render a solid or a dashed divider line. - /// - [Parameter] - [WCWidgetMemberName("Type")] - public DividerType LineType - { - get { return this._lineType; } - set { - if (this._lineType != value || !IsPropDirty("LineType")) { - MarkPropDirty("LineType"); - } - this._lineType = value; - - } - } - - partial void FindByNameDivider(string name, ref object item); - public override object FindByName(string name) - { - - var baseResult = base.FindByName(name); - if (baseResult != null) - { - return baseResult; - } - - object item = null; - FindByNameDivider(name, ref item); - if (item != null) - { - return item; - } - - return null; - } - public async Task SetNativeElementAsync(Object element) - { - await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); - } - public void SetNativeElement(Object element) - { - InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); - } - - partial void SerializeCoreIgbDivider(RendererSerializer ser); - - internal override void SerializeCore(RendererSerializer ser) - { - base.SerializeCore(ser); - - SerializeCoreIgbDivider(ser); - - if (IsPropDirty("Vertical")) { ser.AddBooleanProp("vertical", this._vertical); } - if (IsPropDirty("Middle")) { ser.AddBooleanProp("middle", this._middle); } - if (IsPropDirty("LineType")) { ser.AddEnumProp("lineType", this._lineType); } - - } - -} + /// + /// The igc-divider allows the content author to easily create a horizontal/vertical rule as a break between content to better organize information on a page. + /// + public partial class IgbDivider : BaseRendererControl + { + public override string Type { get { return "WebDivider"; } } + + protected override void EnsureModulesLoaded() + { + if (!IgbDividerModule.IsLoadRequested(IgBlazor)) + { + IgbDividerModule.Register(IgBlazor); + } + } + + protected override string ResolveDisplay() + { + return "inline-block"; + } + + protected override bool SupportsVisualChildren + { + get + { + return true; + } + } + + protected override bool UseDirectRender + { + get + { + return true; + } + } + + protected override string DirectRenderElementName + { + get + { + return "igc-divider"; + } + } + + protected override ControlEventBehavior DefaultEventBehavior + { + get { return ControlEventBehavior.Immediate; } + } + + public IgbDivider() : base() + { + OnCreatedIgbDivider(); + + } + + partial void OnCreatedIgbDivider(); + + private bool _vertical = false; + + partial void OnVerticalChanging(ref bool newValue); + /// + /// Whether to render a vertical divider line. + /// + [Parameter] + public bool Vertical + { + get { return this._vertical; } + set + { + if (this._vertical != value || !IsPropDirty("Vertical")) + { + MarkPropDirty("Vertical"); + } + this._vertical = value; + + } + } + private bool _middle = false; + + partial void OnMiddleChanging(ref bool newValue); + /// + /// When set and inset is provided, it will shrink the divider line from both sides. + /// + [Parameter] + public bool Middle + { + get { return this._middle; } + set + { + if (this._middle != value || !IsPropDirty("Middle")) + { + MarkPropDirty("Middle"); + } + this._middle = value; + + } + } + private DividerType _lineType = DividerType.Solid; + + partial void OnLineTypeChanging(ref DividerType newValue); + /// + /// Whether to render a solid or a dashed divider line. + /// + [Parameter] + [WCWidgetMemberName("Type")] + public DividerType LineType + { + get { return this._lineType; } + set + { + if (this._lineType != value || !IsPropDirty("LineType")) + { + MarkPropDirty("LineType"); + } + this._lineType = value; + + } + } + + partial void FindByNameDivider(string name, ref object item); + public override object FindByName(string name) + { + + var baseResult = base.FindByName(name); + if (baseResult != null) + { + return baseResult; + } + + object item = null; + FindByNameDivider(name, ref item); + if (item != null) + { + return item; + } + + return null; + } + public async Task SetNativeElementAsync(Object element) + { + await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + } + public void SetNativeElement(Object element) + { + InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + } + + partial void SerializeCoreIgbDivider(RendererSerializer ser); + + internal override void SerializeCore(RendererSerializer ser) + { + base.SerializeCore(ser); + + SerializeCoreIgbDivider(ser); + + if (IsPropDirty("Vertical")) + { ser.AddBooleanProp("vertical", this._vertical); } + if (IsPropDirty("Middle")) + { ser.AddBooleanProp("middle", this._middle); } + if (IsPropDirty("LineType")) + { ser.AddEnumProp("lineType", this._lineType); } + + } + + } } diff --git a/src/components/Blazor/DividerModule.cs b/src/components/Blazor/DividerModule.cs index 641d311b..01a65df8 100644 --- a/src/components/Blazor/DividerModule.cs +++ b/src/components/Blazor/DividerModule.cs @@ -1,23 +1,20 @@ -using System; -using System.Collections.Generic; -using System.Runtime.CompilerServices; -using System.Text; -using System.Collections.Generic; - namespace IgniteUI.Blazor.Controls { - public partial class IgbDividerModule { - public static void Register(IIgniteUIBlazor runtime) { + public partial class IgbDividerModule + { + public static void Register(IIgniteUIBlazor runtime) + { ModuleLoader.Load(runtime, "WebDividerModule"); - } - public static void MarkIsLoadRequested(IIgniteUIBlazor runtime) { + public static void MarkIsLoadRequested(IIgniteUIBlazor runtime) + { ModuleLoader.MarkIsLoadRequested(runtime, "WebDividerModule"); } - public static bool IsLoadRequested(IIgniteUIBlazor runtime) { + public static bool IsLoadRequested(IIgniteUIBlazor runtime) + { return ModuleLoader.IsLoadRequested(runtime, "WebDividerModule"); } } diff --git a/src/components/Blazor/DividerType.cs b/src/components/Blazor/DividerType.cs index 73d704a8..b0731e0a 100644 --- a/src/components/Blazor/DividerType.cs +++ b/src/components/Blazor/DividerType.cs @@ -1,8 +1,9 @@ namespace IgniteUI.Blazor.Controls { -public enum DividerType { - Solid, - Dashed + public enum DividerType + { + Solid, + Dashed -} + } } diff --git a/src/components/Blazor/Dropdown.cs b/src/components/Blazor/Dropdown.cs index 991e0df0..f47664cf 100644 --- a/src/components/Blazor/Dropdown.cs +++ b/src/components/Blazor/Dropdown.cs @@ -1,681 +1,721 @@ - -using System; using Microsoft.AspNetCore.Components; -using Microsoft.AspNetCore.Components.Rendering; -using System.Threading.Tasks; -using System.Collections.Generic; -using System.Linq; namespace IgniteUI.Blazor.Controls { - /// -/// Represents a DropDown component. -/// -public partial class IgbDropdown: IgbComboBoxBaseLike { - public override string Type { get { return "WebDropdown"; } } - - protected override void EnsureModulesLoaded() - { - if (!IgbDropdownModule.IsLoadRequested(IgBlazor)) - { - IgbDropdownModule.Register(IgBlazor); - } - } - - protected override string ResolveDisplay() + /// + /// Represents a DropDown component. + /// + public partial class IgbDropdown : IgbComboBoxBaseLike + { + public override string Type { get { return "WebDropdown"; } } + + protected override void EnsureModulesLoaded() + { + if (!IgbDropdownModule.IsLoadRequested(IgBlazor)) + { + IgbDropdownModule.Register(IgBlazor); + } + } + + protected override string ResolveDisplay() + { + return "inline-block"; + } + + protected override bool SupportsVisualChildren + { + get + { + return true; + } + } + + protected override bool UseDirectRender + { + get + { + return true; + } + } + + protected override string DirectRenderElementName + { + get + { + return "igc-dropdown"; + } + } + + public IgbDropdown() : base() + { + OnCreatedIgbDropdown(); + + } + + partial void OnCreatedIgbDropdown(); + + private PopoverPlacement _placement = PopoverPlacement.Top; + + partial void OnPlacementChanging(ref PopoverPlacement newValue); + /// + /// The preferred placement of the component around the target element. + /// + [Parameter] + public PopoverPlacement Placement + { + get { return this._placement; } + set + { + if (this._placement != value || !IsPropDirty("Placement")) + { + MarkPropDirty("Placement"); + } + this._placement = value; + + } + } + private PopoverScrollStrategy _scrollStrategy = PopoverScrollStrategy.Scroll; + + partial void OnScrollStrategyChanging(ref PopoverScrollStrategy newValue); + /// + /// Determines the behavior of the component during scrolling of the parent container. + /// + [Parameter] + public PopoverScrollStrategy ScrollStrategy + { + get { return this._scrollStrategy; } + set + { + if (this._scrollStrategy != value || !IsPropDirty("ScrollStrategy")) + { + MarkPropDirty("ScrollStrategy"); + } + this._scrollStrategy = value; + + } + } + private bool _flip = false; + + partial void OnFlipChanging(ref bool newValue); + /// + /// Whether the component should be flipped to the opposite side of the target once it's about to overflow the visible area. + /// When true, once enough space is detected on its preferred side, it will flip back. + /// + [Parameter] + public bool Flip + { + get { return this._flip; } + set + { + if (this._flip != value || !IsPropDirty("Flip")) + { + MarkPropDirty("Flip"); + } + this._flip = value; + + } + } + private double _distance = 0; + + partial void OnDistanceChanging(ref double newValue); + /// + /// The distance from the target element. + /// + [Parameter] + public double Distance + { + get { return this._distance; } + set + { + if (this._distance != value || !IsPropDirty("Distance")) + { + MarkPropDirty("Distance"); + } + this._distance = value; + + } + } + private bool _sameWidth = false; + + partial void OnSameWidthChanging(ref bool newValue); + /// + /// Whether the dropdown's width should be the same as the target's one. + /// + [Parameter] + public bool SameWidth + { + get { return this._sameWidth; } + set + { + if (this._sameWidth != value || !IsPropDirty("SameWidth")) + { + MarkPropDirty("SameWidth"); + } + this._sameWidth = value; + + } + } + public async Task GetItemsAsync() + { + var iv = await InvokeMethod("p:Items", new object[] { }, new string[] { }); + + if (iv == null) + { + return default(IgbDropdownItem[]); + } + var retVal = ReturnToObjectArray(iv); + if (retVal == null) + { + return default(IgbDropdownItem[]); + } + return retVal; + + } + public IgbDropdownItem[] GetItems() + { + var iv = InvokeMethodSync("p:Items", new object[] { }, new string[] { }); + + if (iv == null) + { + return default(IgbDropdownItem[]); + } + var retVal = ReturnToObjectArray(iv); + if (retVal == null) + { + return default(IgbDropdownItem[]); + } + return retVal; + + } + public async Task GetGroupsAsync() + { + var iv = await InvokeMethod("p:Groups", new object[] { }, new string[] { }); + + if (iv == null) + { + return default(IgbDropdownGroup[]); + } + var retVal = ReturnToObjectArray(iv); + if (retVal == null) + { + return default(IgbDropdownGroup[]); + } + return retVal; + + } + public IgbDropdownGroup[] GetGroups() + { + var iv = InvokeMethodSync("p:Groups", new object[] { }, new string[] { }); + + if (iv == null) + { + return default(IgbDropdownGroup[]); + } + var retVal = ReturnToObjectArray(iv); + if (retVal == null) + { + return default(IgbDropdownGroup[]); + } + return retVal; + + } + public async Task GetSelectedItemAsync() + { + var iv = await InvokeMethod("p:SelectedItem", new object[] { }, new string[] { }); + + if (iv == null) + { + return default(IgbDropdownItem); + } + var retVal = (IgbDropdownItem)ConvertReturnValue(iv); + if (retVal == null) + { + return default(IgbDropdownItem); + } + return retVal; + + } + public IgbDropdownItem? GetSelectedItem() + { + var iv = InvokeMethodSync("p:SelectedItem", new object[] { }, new string[] { }); + + if (iv == null) + { + return default(IgbDropdownItem); + } + var retVal = (IgbDropdownItem)ConvertReturnValue(iv); + if (retVal == null) + { + return default(IgbDropdownItem); + } + return retVal; + + } + + partial void FindByNameDropdown(string name, ref object item); + public override object FindByName(string name) + { + + var baseResult = base.FindByName(name); + if (baseResult != null) + { + return baseResult; + } + + object item = null; + FindByNameDropdown(name, ref item); + if (item != null) + { + return item; + } + + return null; + } + /// + /// Navigates to the item at the specified index. If it exists, returns the found item, otherwise - null. + /// + public async Task NavigateToAsync(Object index) + { + var iv = await InvokeMethod("navigateTo", new object[] { ObjectToParam(index) }, new string[] { "Json" }); + + if (iv == null) + { + return default(IgbDropdownItem); + } + var retVal = (IgbDropdownItem)ConvertReturnValue(iv); + if (retVal == null) + { + return default(IgbDropdownItem); + } + return retVal; + + } + public IgbDropdownItem NavigateTo(Object index) + { + var iv = InvokeMethodSync("navigateTo", new object[] { ObjectToParam(index) }, new string[] { "Json" }); + + if (iv == null) + { + return default(IgbDropdownItem); + } + var retVal = (IgbDropdownItem)ConvertReturnValue(iv); + if (retVal == null) + { + return default(IgbDropdownItem); + } + return retVal; + + } + /// + /// Selects the item with the specified value. If it exists, returns the found item, otherwise - null. + /// + public async Task SelectAsync(Object value) + { + var iv = await InvokeMethod("select", new object[] { ObjectToParam(value) }, new string[] { "Json" }); + + if (iv == null) + { + return default(IgbDropdownItem); + } + var retVal = (IgbDropdownItem)ConvertReturnValue(iv); + if (retVal == null) + { + return default(IgbDropdownItem); + } + return retVal; + + } + public IgbDropdownItem Select(Object value) + { + var iv = InvokeMethodSync("select", new object[] { ObjectToParam(value) }, new string[] { "Json" }); + + if (iv == null) + { + return default(IgbDropdownItem); + } + var retVal = (IgbDropdownItem)ConvertReturnValue(iv); + if (retVal == null) + { + return default(IgbDropdownItem); + } + return retVal; + + } + public async Task DisconnectedCallbackAsync() + { + await InvokeMethod("disconnectedCallback", new object[] { }, new string[] { }); + } + public void DisconnectedCallback() + { + InvokeMethodSync("disconnectedCallback", new object[] { }, new string[] { }); + } + /// + /// Clears the current selection of the dropdown. + /// + public async Task ClearSelectionAsync() + { + await InvokeMethod("clearSelection", new object[] { }, new string[] { }); + } + public void ClearSelection() + { + InvokeMethodSync("clearSelection", new object[] { }, new string[] { }); + } + + private string _openingRef = null; + private string _openingScript = null; + [Parameter] + public string OpeningScript + { + + set + { + if (value != this._openingScript) + { + this._openingScript = value; + this.OnRefChanged("Opening", null, value, true, false, (string refName, object oldValue, object newValue) => + { + this._openingRef = refName; + this.MarkPropDirty("OpeningRef"); + }); + } + } + get + { + return this._openingScript; + } + } + + partial void OnHandlingOpening(IgbVoidEventArgs args); + private EventCallback? _opening = null; + [Parameter] + public EventCallback Opening + { + get + { + return this._opening != null ? this._opening.Value : EventCallback.Empty; + } + set + { + if (!value.Equals(EventCallback.Empty)) + { + if (!CompareEventCallbacks(value, _opening, ref eventCallbacksCache)) + { + _opening = value; + this.SetHandler(this.Name, "Opening", value, (args) => { - return "inline-block"; - } + OnHandlingOpening(args); - protected override bool SupportsVisualChildren + }); + this.OnRefChanged("Opening", null, "event:::Opening", true, false, (refName, oldValue, newValue) => { - get - { - return true; - } - } + this._openingRef = refName; + this.MarkPropDirty("OpeningRef"); + }); + } + } + else + { + _opening = null; + this.SetHandler(this.Name, "Opening", null); + this.OnRefChanged("Opening", null, null, true, false, (refName, oldValue, newValue) => + { + this._openingRef = null; + this.MarkPropDirty("OpeningRef"); + }); + } + } + } - protected override bool UseDirectRender + private string _openedRef = null; + private string _openedScript = null; + [Parameter] + public string OpenedScript + { + + set + { + if (value != this._openedScript) + { + this._openedScript = value; + this.OnRefChanged("Opened", null, value, true, false, (string refName, object oldValue, object newValue) => + { + this._openedRef = refName; + this.MarkPropDirty("OpenedRef"); + }); + } + } + get + { + return this._openedScript; + } + } + + partial void OnHandlingOpened(IgbVoidEventArgs args); + private EventCallback? _opened = null; + [Parameter] + public EventCallback Opened + { + get + { + return this._opened != null ? this._opened.Value : EventCallback.Empty; + } + set + { + if (!value.Equals(EventCallback.Empty)) + { + if (!CompareEventCallbacks(value, _opened, ref eventCallbacksCache)) + { + _opened = value; + this.SetHandler(this.Name, "Opened", value, (args) => { - get - { - return true; - } - } + OnHandlingOpened(args); - protected override string DirectRenderElementName + }); + this.OnRefChanged("Opened", null, "event:::Opened", true, false, (refName, oldValue, newValue) => { - get - { - return "igc-dropdown"; - } - } - - public IgbDropdown(): base() { - OnCreatedIgbDropdown(); - - - } - - partial void OnCreatedIgbDropdown(); - - private PopoverPlacement _placement = PopoverPlacement.Top; - - partial void OnPlacementChanging(ref PopoverPlacement newValue); - /// - /// The preferred placement of the component around the target element. - /// - [Parameter] - public PopoverPlacement Placement - { - get { return this._placement; } - set { - if (this._placement != value || !IsPropDirty("Placement")) { - MarkPropDirty("Placement"); - } - this._placement = value; - - } - } - private PopoverScrollStrategy _scrollStrategy = PopoverScrollStrategy.Scroll; - - partial void OnScrollStrategyChanging(ref PopoverScrollStrategy newValue); - /// - /// Determines the behavior of the component during scrolling of the parent container. - /// - [Parameter] - public PopoverScrollStrategy ScrollStrategy - { - get { return this._scrollStrategy; } - set { - if (this._scrollStrategy != value || !IsPropDirty("ScrollStrategy")) { - MarkPropDirty("ScrollStrategy"); - } - this._scrollStrategy = value; - - } - } - private bool _flip = false; - - partial void OnFlipChanging(ref bool newValue); - /// - /// Whether the component should be flipped to the opposite side of the target once it's about to overflow the visible area. - /// When true, once enough space is detected on its preferred side, it will flip back. - /// - [Parameter] - public bool Flip - { - get { return this._flip; } - set { - if (this._flip != value || !IsPropDirty("Flip")) { - MarkPropDirty("Flip"); - } - this._flip = value; - - } - } - private double _distance = 0; - - partial void OnDistanceChanging(ref double newValue); - /// - /// The distance from the target element. - /// - [Parameter] - public double Distance - { - get { return this._distance; } - set { - if (this._distance != value || !IsPropDirty("Distance")) { - MarkPropDirty("Distance"); - } - this._distance = value; - - } - } - private bool _sameWidth = false; - - partial void OnSameWidthChanging(ref bool newValue); - /// - /// Whether the dropdown's width should be the same as the target's one. - /// - [Parameter] - public bool SameWidth - { - get { return this._sameWidth; } - set { - if (this._sameWidth != value || !IsPropDirty("SameWidth")) { - MarkPropDirty("SameWidth"); - } - this._sameWidth = value; - - } - } - public async Task GetItemsAsync() - { - var iv = await InvokeMethod("p:Items", new object[] { }, new string[] { }); - - if (iv == null) - { - return default(IgbDropdownItem[]); - } - var retVal = ReturnToObjectArray(iv); - if (retVal == null) - { - return default(IgbDropdownItem[]); - } - return retVal; - - } - public IgbDropdownItem[] GetItems() - { - var iv = InvokeMethodSync("p:Items", new object[] { }, new string[] { }); - - if (iv == null) - { - return default(IgbDropdownItem[]); - } - var retVal = ReturnToObjectArray(iv); - if (retVal == null) - { - return default(IgbDropdownItem[]); - } - return retVal; - - } - public async Task GetGroupsAsync() - { - var iv = await InvokeMethod("p:Groups", new object[] { }, new string[] { }); - - if (iv == null) - { - return default(IgbDropdownGroup[]); - } - var retVal = ReturnToObjectArray(iv); - if (retVal == null) - { - return default(IgbDropdownGroup[]); - } - return retVal; - - } - public IgbDropdownGroup[] GetGroups() - { - var iv = InvokeMethodSync("p:Groups", new object[] { }, new string[] { }); - - if (iv == null) - { - return default(IgbDropdownGroup[]); - } - var retVal = ReturnToObjectArray(iv); - if (retVal == null) - { - return default(IgbDropdownGroup[]); - } - return retVal; - - } - public async Task GetSelectedItemAsync() - { - var iv = await InvokeMethod("p:SelectedItem", new object[] { }, new string[] { }); - - if (iv == null) - { - return default(IgbDropdownItem); - } - var retVal = (IgbDropdownItem)ConvertReturnValue(iv); - if (retVal == null) - { - return default(IgbDropdownItem); - } - return retVal; - - } - public IgbDropdownItem? GetSelectedItem() - { - var iv = InvokeMethodSync("p:SelectedItem", new object[] { }, new string[] { }); - - if (iv == null) - { - return default(IgbDropdownItem); - } - var retVal = (IgbDropdownItem)ConvertReturnValue(iv); - if (retVal == null) - { - return default(IgbDropdownItem); - } - return retVal; - - } - - partial void FindByNameDropdown(string name, ref object item); - public override object FindByName(string name) - { - - var baseResult = base.FindByName(name); - if (baseResult != null) - { - return baseResult; - } - - object item = null; - FindByNameDropdown(name, ref item); - if (item != null) - { - return item; - } - - return null; - } - /// - /// Navigates to the item at the specified index. If it exists, returns the found item, otherwise - null. - /// - public async Task NavigateToAsync(Object index) - { - var iv = await InvokeMethod("navigateTo", new object[] { ObjectToParam(index) }, new string[] { "Json" }); - - if (iv == null) - { - return default(IgbDropdownItem); - } - var retVal = (IgbDropdownItem)ConvertReturnValue(iv); - if (retVal == null) - { - return default(IgbDropdownItem); - } - return retVal; - - } - public IgbDropdownItem NavigateTo(Object index) - { - var iv = InvokeMethodSync("navigateTo", new object[] { ObjectToParam(index) }, new string[] { "Json" }); - - if (iv == null) - { - return default(IgbDropdownItem); - } - var retVal = (IgbDropdownItem)ConvertReturnValue(iv); - if (retVal == null) - { - return default(IgbDropdownItem); - } - return retVal; - - } - /// - /// Selects the item with the specified value. If it exists, returns the found item, otherwise - null. - /// - public async Task SelectAsync(Object value) - { - var iv = await InvokeMethod("select", new object[] { ObjectToParam(value) }, new string[] { "Json" }); - - if (iv == null) - { - return default(IgbDropdownItem); - } - var retVal = (IgbDropdownItem)ConvertReturnValue(iv); - if (retVal == null) - { - return default(IgbDropdownItem); - } - return retVal; - - } - public IgbDropdownItem Select(Object value) - { - var iv = InvokeMethodSync("select", new object[] { ObjectToParam(value) }, new string[] { "Json" }); - - if (iv == null) - { - return default(IgbDropdownItem); - } - var retVal = (IgbDropdownItem)ConvertReturnValue(iv); - if (retVal == null) - { - return default(IgbDropdownItem); - } - return retVal; - - } - public async Task DisconnectedCallbackAsync() - { - await InvokeMethod("disconnectedCallback", new object[] { }, new string[] { }); - } - public void DisconnectedCallback() - { - InvokeMethodSync("disconnectedCallback", new object[] { }, new string[] { }); - } - /// - /// Clears the current selection of the dropdown. - /// - public async Task ClearSelectionAsync() - { - await InvokeMethod("clearSelection", new object[] { }, new string[] { }); - } - public void ClearSelection() - { - InvokeMethodSync("clearSelection", new object[] { }, new string[] { }); - } - - private string _openingRef = null; - private string _openingScript = null; - [Parameter] - public string OpeningScript { - - set - { - if (value != this._openingScript) - { - this._openingScript = value; - this.OnRefChanged("Opening", null, value, true, false, (string refName, object oldValue, object newValue) => { - this._openingRef = refName; - this.MarkPropDirty("OpeningRef"); - }); - } - } - get - { - return this._openingScript; - } - } - - partial void OnHandlingOpening(IgbVoidEventArgs args); - private EventCallback? _opening = null; - [Parameter] - public EventCallback Opening - { - get - { - return this._opening != null ? this._opening.Value : EventCallback.Empty; - } - set - { - if (!value.Equals(EventCallback.Empty)) - { - if (!CompareEventCallbacks(value, _opening, ref eventCallbacksCache)) - { - _opening = value; - this.SetHandler(this.Name, "Opening", value, (args) => { - OnHandlingOpening(args); - - }); - this.OnRefChanged("Opening", null, "event:::Opening", true, false, (refName, oldValue, newValue) => { - this._openingRef = refName; - this.MarkPropDirty("OpeningRef"); - }); - } - } - else - { - _opening = null; - this.SetHandler(this.Name, "Opening", null); - this.OnRefChanged("Opening", null, null, true, false, (refName, oldValue, newValue) => { - this._openingRef = null; - this.MarkPropDirty("OpeningRef"); - }); - } - } - } - - private string _openedRef = null; - private string _openedScript = null; - [Parameter] - public string OpenedScript { - - set - { - if (value != this._openedScript) - { - this._openedScript = value; - this.OnRefChanged("Opened", null, value, true, false, (string refName, object oldValue, object newValue) => { - this._openedRef = refName; - this.MarkPropDirty("OpenedRef"); - }); - } - } - get - { - return this._openedScript; - } - } - - partial void OnHandlingOpened(IgbVoidEventArgs args); - private EventCallback? _opened = null; - [Parameter] - public EventCallback Opened - { - get - { - return this._opened != null ? this._opened.Value : EventCallback.Empty; - } - set - { - if (!value.Equals(EventCallback.Empty)) - { - if (!CompareEventCallbacks(value, _opened, ref eventCallbacksCache)) - { - _opened = value; - this.SetHandler(this.Name, "Opened", value, (args) => { - OnHandlingOpened(args); - - }); - this.OnRefChanged("Opened", null, "event:::Opened", true, false, (refName, oldValue, newValue) => { - this._openedRef = refName; - this.MarkPropDirty("OpenedRef"); - }); - } - } - else - { - _opened = null; - this.SetHandler(this.Name, "Opened", null); - this.OnRefChanged("Opened", null, null, true, false, (refName, oldValue, newValue) => { - this._openedRef = null; - this.MarkPropDirty("OpenedRef"); - }); - } - } - } - - private string _closingRef = null; - private string _closingScript = null; - [Parameter] - public string ClosingScript { - - set - { - if (value != this._closingScript) - { - this._closingScript = value; - this.OnRefChanged("Closing", null, value, true, false, (string refName, object oldValue, object newValue) => { - this._closingRef = refName; - this.MarkPropDirty("ClosingRef"); - }); - } - } - get - { - return this._closingScript; - } - } - - partial void OnHandlingClosing(IgbVoidEventArgs args); - private EventCallback? _closing = null; - [Parameter] - public EventCallback Closing - { - get - { - return this._closing != null ? this._closing.Value : EventCallback.Empty; - } - set - { - if (!value.Equals(EventCallback.Empty)) - { - if (!CompareEventCallbacks(value, _closing, ref eventCallbacksCache)) - { - _closing = value; - this.SetHandler(this.Name, "Closing", value, (args) => { - OnHandlingClosing(args); - - }); - this.OnRefChanged("Closing", null, "event:::Closing", true, false, (refName, oldValue, newValue) => { - this._closingRef = refName; - this.MarkPropDirty("ClosingRef"); - }); - } - } - else - { - _closing = null; - this.SetHandler(this.Name, "Closing", null); - this.OnRefChanged("Closing", null, null, true, false, (refName, oldValue, newValue) => { - this._closingRef = null; - this.MarkPropDirty("ClosingRef"); - }); - } - } - } - - private string _closedRef = null; - private string _closedScript = null; - [Parameter] - public string ClosedScript { - - set - { - if (value != this._closedScript) - { - this._closedScript = value; - this.OnRefChanged("Closed", null, value, true, false, (string refName, object oldValue, object newValue) => { - this._closedRef = refName; - this.MarkPropDirty("ClosedRef"); - }); - } - } - get - { - return this._closedScript; - } - } - - partial void OnHandlingClosed(IgbVoidEventArgs args); - private EventCallback? _closed = null; - [Parameter] - public EventCallback Closed - { - get - { - return this._closed != null ? this._closed.Value : EventCallback.Empty; - } - set - { - if (!value.Equals(EventCallback.Empty)) - { - if (!CompareEventCallbacks(value, _closed, ref eventCallbacksCache)) - { - _closed = value; - this.SetHandler(this.Name, "Closed", value, (args) => { - OnHandlingClosed(args); - - }); - this.OnRefChanged("Closed", null, "event:::Closed", true, false, (refName, oldValue, newValue) => { - this._closedRef = refName; - this.MarkPropDirty("ClosedRef"); - }); - } - } - else - { - _closed = null; - this.SetHandler(this.Name, "Closed", null); - this.OnRefChanged("Closed", null, null, true, false, (refName, oldValue, newValue) => { - this._closedRef = null; - this.MarkPropDirty("ClosedRef"); - }); - } - } - } - - private string _changeRef = null; - private string _changeScript = null; - [Parameter] - public string ChangeScript { - - set - { - if (value != this._changeScript) - { - this._changeScript = value; - this.OnRefChanged("Change", null, value, true, false, (string refName, object oldValue, object newValue) => { - this._changeRef = refName; - this.MarkPropDirty("ChangeRef"); - }); - } - } - get - { - return this._changeScript; - } - } - - partial void OnHandlingChange(IgbDropdownItemComponentEventArgs args); - private EventCallback? _change = null; - [Parameter] - public EventCallback Change - { - get - { - return this._change != null ? this._change.Value : EventCallback.Empty; - } - set - { - if (!value.Equals(EventCallback.Empty)) - { - if (!CompareEventCallbacks(value, _change, ref eventCallbacksCache)) - { - _change = value; - this.SetHandler(this.Name, "Change", value, (args) => { - OnHandlingChange(args); - - }); - this.OnRefChanged("Change", null, "event:::Change", true, false, (refName, oldValue, newValue) => { - this._changeRef = refName; - this.MarkPropDirty("ChangeRef"); - }); - } - } - else - { - _change = null; - this.SetHandler(this.Name, "Change", null); - this.OnRefChanged("Change", null, null, true, false, (refName, oldValue, newValue) => { - this._changeRef = null; - this.MarkPropDirty("ChangeRef"); - }); - } - } - } - - partial void SerializeCoreIgbDropdown(RendererSerializer ser); - - internal override void SerializeCore(RendererSerializer ser) - { - base.SerializeCore(ser); - - SerializeCoreIgbDropdown(ser); - - if (IsPropDirty("Placement")) { ser.AddEnumProp("placement", this._placement); } - if (IsPropDirty("ScrollStrategy")) { ser.AddEnumProp("scrollStrategy", this._scrollStrategy); } - if (IsPropDirty("Flip")) { ser.AddBooleanProp("flip", this._flip); } - if (IsPropDirty("Distance")) { ser.AddNumberProp("distance", this._distance); } - if (IsPropDirty("SameWidth")) { ser.AddBooleanProp("sameWidth", this._sameWidth); } - if (IsPropDirty("OpeningRef")) { ser.AddStringProp("openingRef", this._openingRef); } - if (IsPropDirty("OpenedRef")) { ser.AddStringProp("openedRef", this._openedRef); } - if (IsPropDirty("ClosingRef")) { ser.AddStringProp("closingRef", this._closingRef); } - if (IsPropDirty("ClosedRef")) { ser.AddStringProp("closedRef", this._closedRef); } - if (IsPropDirty("ChangeRef")) { ser.AddStringProp("changeRef", this._changeRef); } - - } - -} + this._openedRef = refName; + this.MarkPropDirty("OpenedRef"); + }); + } + } + else + { + _opened = null; + this.SetHandler(this.Name, "Opened", null); + this.OnRefChanged("Opened", null, null, true, false, (refName, oldValue, newValue) => + { + this._openedRef = null; + this.MarkPropDirty("OpenedRef"); + }); + } + } + } + + private string _closingRef = null; + private string _closingScript = null; + [Parameter] + public string ClosingScript + { + + set + { + if (value != this._closingScript) + { + this._closingScript = value; + this.OnRefChanged("Closing", null, value, true, false, (string refName, object oldValue, object newValue) => + { + this._closingRef = refName; + this.MarkPropDirty("ClosingRef"); + }); + } + } + get + { + return this._closingScript; + } + } + + partial void OnHandlingClosing(IgbVoidEventArgs args); + private EventCallback? _closing = null; + [Parameter] + public EventCallback Closing + { + get + { + return this._closing != null ? this._closing.Value : EventCallback.Empty; + } + set + { + if (!value.Equals(EventCallback.Empty)) + { + if (!CompareEventCallbacks(value, _closing, ref eventCallbacksCache)) + { + _closing = value; + this.SetHandler(this.Name, "Closing", value, (args) => + { + OnHandlingClosing(args); + + }); + this.OnRefChanged("Closing", null, "event:::Closing", true, false, (refName, oldValue, newValue) => + { + this._closingRef = refName; + this.MarkPropDirty("ClosingRef"); + }); + } + } + else + { + _closing = null; + this.SetHandler(this.Name, "Closing", null); + this.OnRefChanged("Closing", null, null, true, false, (refName, oldValue, newValue) => + { + this._closingRef = null; + this.MarkPropDirty("ClosingRef"); + }); + } + } + } + + private string _closedRef = null; + private string _closedScript = null; + [Parameter] + public string ClosedScript + { + + set + { + if (value != this._closedScript) + { + this._closedScript = value; + this.OnRefChanged("Closed", null, value, true, false, (string refName, object oldValue, object newValue) => + { + this._closedRef = refName; + this.MarkPropDirty("ClosedRef"); + }); + } + } + get + { + return this._closedScript; + } + } + + partial void OnHandlingClosed(IgbVoidEventArgs args); + private EventCallback? _closed = null; + [Parameter] + public EventCallback Closed + { + get + { + return this._closed != null ? this._closed.Value : EventCallback.Empty; + } + set + { + if (!value.Equals(EventCallback.Empty)) + { + if (!CompareEventCallbacks(value, _closed, ref eventCallbacksCache)) + { + _closed = value; + this.SetHandler(this.Name, "Closed", value, (args) => + { + OnHandlingClosed(args); + + }); + this.OnRefChanged("Closed", null, "event:::Closed", true, false, (refName, oldValue, newValue) => + { + this._closedRef = refName; + this.MarkPropDirty("ClosedRef"); + }); + } + } + else + { + _closed = null; + this.SetHandler(this.Name, "Closed", null); + this.OnRefChanged("Closed", null, null, true, false, (refName, oldValue, newValue) => + { + this._closedRef = null; + this.MarkPropDirty("ClosedRef"); + }); + } + } + } + + private string _changeRef = null; + private string _changeScript = null; + [Parameter] + public string ChangeScript + { + + set + { + if (value != this._changeScript) + { + this._changeScript = value; + this.OnRefChanged("Change", null, value, true, false, (string refName, object oldValue, object newValue) => + { + this._changeRef = refName; + this.MarkPropDirty("ChangeRef"); + }); + } + } + get + { + return this._changeScript; + } + } + + partial void OnHandlingChange(IgbDropdownItemComponentEventArgs args); + private EventCallback? _change = null; + [Parameter] + public EventCallback Change + { + get + { + return this._change != null ? this._change.Value : EventCallback.Empty; + } + set + { + if (!value.Equals(EventCallback.Empty)) + { + if (!CompareEventCallbacks(value, _change, ref eventCallbacksCache)) + { + _change = value; + this.SetHandler(this.Name, "Change", value, (args) => + { + OnHandlingChange(args); + + }); + this.OnRefChanged("Change", null, "event:::Change", true, false, (refName, oldValue, newValue) => + { + this._changeRef = refName; + this.MarkPropDirty("ChangeRef"); + }); + } + } + else + { + _change = null; + this.SetHandler(this.Name, "Change", null); + this.OnRefChanged("Change", null, null, true, false, (refName, oldValue, newValue) => + { + this._changeRef = null; + this.MarkPropDirty("ChangeRef"); + }); + } + } + } + + partial void SerializeCoreIgbDropdown(RendererSerializer ser); + + internal override void SerializeCore(RendererSerializer ser) + { + base.SerializeCore(ser); + + SerializeCoreIgbDropdown(ser); + + if (IsPropDirty("Placement")) + { ser.AddEnumProp("placement", this._placement); } + if (IsPropDirty("ScrollStrategy")) + { ser.AddEnumProp("scrollStrategy", this._scrollStrategy); } + if (IsPropDirty("Flip")) + { ser.AddBooleanProp("flip", this._flip); } + if (IsPropDirty("Distance")) + { ser.AddNumberProp("distance", this._distance); } + if (IsPropDirty("SameWidth")) + { ser.AddBooleanProp("sameWidth", this._sameWidth); } + if (IsPropDirty("OpeningRef")) + { ser.AddStringProp("openingRef", this._openingRef); } + if (IsPropDirty("OpenedRef")) + { ser.AddStringProp("openedRef", this._openedRef); } + if (IsPropDirty("ClosingRef")) + { ser.AddStringProp("closingRef", this._closingRef); } + if (IsPropDirty("ClosedRef")) + { ser.AddStringProp("closedRef", this._closedRef); } + if (IsPropDirty("ChangeRef")) + { ser.AddStringProp("changeRef", this._changeRef); } + + } + + } } diff --git a/src/components/Blazor/DropdownGroup.cs b/src/components/Blazor/DropdownGroup.cs index 0360637b..bdc6b333 100644 --- a/src/components/Blazor/DropdownGroup.cs +++ b/src/components/Blazor/DropdownGroup.cs @@ -1,108 +1,99 @@ - -using System; -using Microsoft.AspNetCore.Components; -using Microsoft.AspNetCore.Components.Rendering; -using System.Threading.Tasks; -using System.Collections.Generic; -using System.Linq; - namespace IgniteUI.Blazor.Controls { - /// -/// A container for a group of `igc-dropdown-item` components. -/// -public partial class IgbDropdownGroup: BaseRendererControl { - public override string Type { get { return "WebDropdownGroup"; } } - - protected override void EnsureModulesLoaded() - { - if (!IgbDropdownGroupModule.IsLoadRequested(IgBlazor)) - { - IgbDropdownGroupModule.Register(IgBlazor); - } - } - - protected override string ResolveDisplay() - { - return "inline-block"; - } - - protected override bool SupportsVisualChildren - { - get - { - return true; - } - } - - protected override bool UseDirectRender - { - get - { - return true; - } - } - - protected override string DirectRenderElementName - { - get - { - return "igc-dropdown-group"; - } - } - - protected override ControlEventBehavior DefaultEventBehavior - { - get { return ControlEventBehavior.Immediate; } - } - - public IgbDropdownGroup(): base() { - OnCreatedIgbDropdownGroup(); - - - } - - partial void OnCreatedIgbDropdownGroup(); - - - partial void FindByNameDropdownGroup(string name, ref object item); - public override object FindByName(string name) - { - - var baseResult = base.FindByName(name); - if (baseResult != null) - { - return baseResult; - } - - object item = null; - FindByNameDropdownGroup(name, ref item); - if (item != null) - { - return item; - } - - return null; - } - public async Task SetNativeElementAsync(Object element) - { - await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); - } - public void SetNativeElement(Object element) - { - InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); - } - - partial void SerializeCoreIgbDropdownGroup(RendererSerializer ser); - - internal override void SerializeCore(RendererSerializer ser) - { - base.SerializeCore(ser); - - SerializeCoreIgbDropdownGroup(ser); - - - } - -} + /// + /// A container for a group of `igc-dropdown-item` components. + /// + public partial class IgbDropdownGroup : BaseRendererControl + { + public override string Type { get { return "WebDropdownGroup"; } } + + protected override void EnsureModulesLoaded() + { + if (!IgbDropdownGroupModule.IsLoadRequested(IgBlazor)) + { + IgbDropdownGroupModule.Register(IgBlazor); + } + } + + protected override string ResolveDisplay() + { + return "inline-block"; + } + + protected override bool SupportsVisualChildren + { + get + { + return true; + } + } + + protected override bool UseDirectRender + { + get + { + return true; + } + } + + protected override string DirectRenderElementName + { + get + { + return "igc-dropdown-group"; + } + } + + protected override ControlEventBehavior DefaultEventBehavior + { + get { return ControlEventBehavior.Immediate; } + } + + public IgbDropdownGroup() : base() + { + OnCreatedIgbDropdownGroup(); + + } + + partial void OnCreatedIgbDropdownGroup(); + + partial void FindByNameDropdownGroup(string name, ref object item); + public override object FindByName(string name) + { + + var baseResult = base.FindByName(name); + if (baseResult != null) + { + return baseResult; + } + + object item = null; + FindByNameDropdownGroup(name, ref item); + if (item != null) + { + return item; + } + + return null; + } + public async Task SetNativeElementAsync(Object element) + { + await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + } + public void SetNativeElement(Object element) + { + InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + } + + partial void SerializeCoreIgbDropdownGroup(RendererSerializer ser); + + internal override void SerializeCore(RendererSerializer ser) + { + base.SerializeCore(ser); + + SerializeCoreIgbDropdownGroup(ser); + + } + + } } diff --git a/src/components/Blazor/DropdownGroupModule.cs b/src/components/Blazor/DropdownGroupModule.cs index 168e2808..97665717 100644 --- a/src/components/Blazor/DropdownGroupModule.cs +++ b/src/components/Blazor/DropdownGroupModule.cs @@ -1,23 +1,20 @@ -using System; -using System.Collections.Generic; -using System.Runtime.CompilerServices; -using System.Text; -using System.Collections.Generic; - namespace IgniteUI.Blazor.Controls { - public partial class IgbDropdownGroupModule { - public static void Register(IIgniteUIBlazor runtime) { + public partial class IgbDropdownGroupModule + { + public static void Register(IIgniteUIBlazor runtime) + { ModuleLoader.Load(runtime, "WebDropdownGroupModule"); - } - public static void MarkIsLoadRequested(IIgniteUIBlazor runtime) { + public static void MarkIsLoadRequested(IIgniteUIBlazor runtime) + { ModuleLoader.MarkIsLoadRequested(runtime, "WebDropdownGroupModule"); } - public static bool IsLoadRequested(IIgniteUIBlazor runtime) { + public static bool IsLoadRequested(IIgniteUIBlazor runtime) + { return ModuleLoader.IsLoadRequested(runtime, "WebDropdownGroupModule"); } } diff --git a/src/components/Blazor/DropdownHeader.cs b/src/components/Blazor/DropdownHeader.cs index a94cef9e..2684bea4 100644 --- a/src/components/Blazor/DropdownHeader.cs +++ b/src/components/Blazor/DropdownHeader.cs @@ -1,108 +1,99 @@ - -using System; -using Microsoft.AspNetCore.Components; -using Microsoft.AspNetCore.Components.Rendering; -using System.Threading.Tasks; -using System.Collections.Generic; -using System.Linq; - namespace IgniteUI.Blazor.Controls { - /// -/// Represents a header item in a igc-dropdown list. -/// -public partial class IgbDropdownHeader: BaseRendererControl { - public override string Type { get { return "WebDropdownHeader"; } } - - protected override void EnsureModulesLoaded() - { - if (!IgbDropdownHeaderModule.IsLoadRequested(IgBlazor)) - { - IgbDropdownHeaderModule.Register(IgBlazor); - } - } - - protected override string ResolveDisplay() - { - return "inline-block"; - } - - protected override bool SupportsVisualChildren - { - get - { - return true; - } - } - - protected override bool UseDirectRender - { - get - { - return true; - } - } - - protected override string DirectRenderElementName - { - get - { - return "igc-dropdown-header"; - } - } - - protected override ControlEventBehavior DefaultEventBehavior - { - get { return ControlEventBehavior.Immediate; } - } - - public IgbDropdownHeader(): base() { - OnCreatedIgbDropdownHeader(); - - - } - - partial void OnCreatedIgbDropdownHeader(); - - - partial void FindByNameDropdownHeader(string name, ref object item); - public override object FindByName(string name) - { - - var baseResult = base.FindByName(name); - if (baseResult != null) - { - return baseResult; - } - - object item = null; - FindByNameDropdownHeader(name, ref item); - if (item != null) - { - return item; - } - - return null; - } - public async Task SetNativeElementAsync(Object element) - { - await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); - } - public void SetNativeElement(Object element) - { - InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); - } - - partial void SerializeCoreIgbDropdownHeader(RendererSerializer ser); - - internal override void SerializeCore(RendererSerializer ser) - { - base.SerializeCore(ser); - - SerializeCoreIgbDropdownHeader(ser); - - - } - -} + /// + /// Represents a header item in a igc-dropdown list. + /// + public partial class IgbDropdownHeader : BaseRendererControl + { + public override string Type { get { return "WebDropdownHeader"; } } + + protected override void EnsureModulesLoaded() + { + if (!IgbDropdownHeaderModule.IsLoadRequested(IgBlazor)) + { + IgbDropdownHeaderModule.Register(IgBlazor); + } + } + + protected override string ResolveDisplay() + { + return "inline-block"; + } + + protected override bool SupportsVisualChildren + { + get + { + return true; + } + } + + protected override bool UseDirectRender + { + get + { + return true; + } + } + + protected override string DirectRenderElementName + { + get + { + return "igc-dropdown-header"; + } + } + + protected override ControlEventBehavior DefaultEventBehavior + { + get { return ControlEventBehavior.Immediate; } + } + + public IgbDropdownHeader() : base() + { + OnCreatedIgbDropdownHeader(); + + } + + partial void OnCreatedIgbDropdownHeader(); + + partial void FindByNameDropdownHeader(string name, ref object item); + public override object FindByName(string name) + { + + var baseResult = base.FindByName(name); + if (baseResult != null) + { + return baseResult; + } + + object item = null; + FindByNameDropdownHeader(name, ref item); + if (item != null) + { + return item; + } + + return null; + } + public async Task SetNativeElementAsync(Object element) + { + await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + } + public void SetNativeElement(Object element) + { + InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + } + + partial void SerializeCoreIgbDropdownHeader(RendererSerializer ser); + + internal override void SerializeCore(RendererSerializer ser) + { + base.SerializeCore(ser); + + SerializeCoreIgbDropdownHeader(ser); + + } + + } } diff --git a/src/components/Blazor/DropdownHeaderModule.cs b/src/components/Blazor/DropdownHeaderModule.cs index 03170a36..c1f06485 100644 --- a/src/components/Blazor/DropdownHeaderModule.cs +++ b/src/components/Blazor/DropdownHeaderModule.cs @@ -1,23 +1,20 @@ -using System; -using System.Collections.Generic; -using System.Runtime.CompilerServices; -using System.Text; -using System.Collections.Generic; - namespace IgniteUI.Blazor.Controls { - public partial class IgbDropdownHeaderModule { - public static void Register(IIgniteUIBlazor runtime) { + public partial class IgbDropdownHeaderModule + { + public static void Register(IIgniteUIBlazor runtime) + { ModuleLoader.Load(runtime, "WebDropdownHeaderModule"); - } - public static void MarkIsLoadRequested(IIgniteUIBlazor runtime) { + public static void MarkIsLoadRequested(IIgniteUIBlazor runtime) + { ModuleLoader.MarkIsLoadRequested(runtime, "WebDropdownHeaderModule"); } - public static bool IsLoadRequested(IIgniteUIBlazor runtime) { + public static bool IsLoadRequested(IIgniteUIBlazor runtime) + { return ModuleLoader.IsLoadRequested(runtime, "WebDropdownHeaderModule"); } } diff --git a/src/components/Blazor/DropdownItem.cs b/src/components/Blazor/DropdownItem.cs index 16c322a8..a3efbda1 100644 --- a/src/components/Blazor/DropdownItem.cs +++ b/src/components/Blazor/DropdownItem.cs @@ -1,95 +1,86 @@ - -using System; -using Microsoft.AspNetCore.Components; -using Microsoft.AspNetCore.Components.Rendering; -using System.Threading.Tasks; -using System.Collections.Generic; -using System.Linq; - namespace IgniteUI.Blazor.Controls { - /// -/// Represents an item in a dropdown list. -/// -public partial class IgbDropdownItem: IgbBaseOptionLike { - public override string Type { get { return "WebDropdownItem"; } } - - protected override void EnsureModulesLoaded() - { - if (!IgbDropdownItemModule.IsLoadRequested(IgBlazor)) - { - IgbDropdownItemModule.Register(IgBlazor); - } - } - - protected override string ResolveDisplay() - { - return "inline-block"; - } - - protected override bool SupportsVisualChildren - { - get - { - return true; - } - } - - protected override bool UseDirectRender - { - get - { - return true; - } - } - - protected override string DirectRenderElementName - { - get - { - return "igc-dropdown-item"; - } - } - - public IgbDropdownItem(): base() { - OnCreatedIgbDropdownItem(); - - - } - - partial void OnCreatedIgbDropdownItem(); - - - partial void FindByNameDropdownItem(string name, ref object item); - public override object FindByName(string name) - { - - var baseResult = base.FindByName(name); - if (baseResult != null) - { - return baseResult; - } - - object item = null; - FindByNameDropdownItem(name, ref item); - if (item != null) - { - return item; - } - - return null; - } - - partial void SerializeCoreIgbDropdownItem(RendererSerializer ser); - - internal override void SerializeCore(RendererSerializer ser) - { - base.SerializeCore(ser); - - SerializeCoreIgbDropdownItem(ser); - - - } - -} + /// + /// Represents an item in a dropdown list. + /// + public partial class IgbDropdownItem : IgbBaseOptionLike + { + public override string Type { get { return "WebDropdownItem"; } } + + protected override void EnsureModulesLoaded() + { + if (!IgbDropdownItemModule.IsLoadRequested(IgBlazor)) + { + IgbDropdownItemModule.Register(IgBlazor); + } + } + + protected override string ResolveDisplay() + { + return "inline-block"; + } + + protected override bool SupportsVisualChildren + { + get + { + return true; + } + } + + protected override bool UseDirectRender + { + get + { + return true; + } + } + + protected override string DirectRenderElementName + { + get + { + return "igc-dropdown-item"; + } + } + + public IgbDropdownItem() : base() + { + OnCreatedIgbDropdownItem(); + + } + + partial void OnCreatedIgbDropdownItem(); + + partial void FindByNameDropdownItem(string name, ref object item); + public override object FindByName(string name) + { + + var baseResult = base.FindByName(name); + if (baseResult != null) + { + return baseResult; + } + + object item = null; + FindByNameDropdownItem(name, ref item); + if (item != null) + { + return item; + } + + return null; + } + + partial void SerializeCoreIgbDropdownItem(RendererSerializer ser); + + internal override void SerializeCore(RendererSerializer ser) + { + base.SerializeCore(ser); + + SerializeCoreIgbDropdownItem(ser); + + } + + } } diff --git a/src/components/Blazor/DropdownItemCollection.cs b/src/components/Blazor/DropdownItemCollection.cs index 0a6ebd4e..351aceb8 100644 --- a/src/components/Blazor/DropdownItemCollection.cs +++ b/src/components/Blazor/DropdownItemCollection.cs @@ -1,11 +1,10 @@ - -using System; - namespace IgniteUI.Blazor.Controls { -public partial class IgbDropdownItemCollection: BaseCollection { - public IgbDropdownItemCollection(object parent, string propertyName): base(parent, propertyName) { - + public partial class IgbDropdownItemCollection : BaseCollection + { + public IgbDropdownItemCollection(object parent, string propertyName) : base(parent, propertyName) + { + + } } } -} diff --git a/src/components/Blazor/DropdownItemComponentEventArgs.cs b/src/components/Blazor/DropdownItemComponentEventArgs.cs index 4e269ef9..471faba1 100644 --- a/src/components/Blazor/DropdownItemComponentEventArgs.cs +++ b/src/components/Blazor/DropdownItemComponentEventArgs.cs @@ -1,94 +1,91 @@ - -using System; using Microsoft.AspNetCore.Components; -using Microsoft.AspNetCore.Components.Rendering; -using System.Threading.Tasks; -using System.Collections.Generic; -using System.Linq; namespace IgniteUI.Blazor.Controls { - public partial class IgbDropdownItemComponentEventArgs: BaseRendererElement { - public override string Type { get { return "WebDropdownItemComponentEventArgs"; } } - - - private static bool _marshalByValue = true; - - public IgbDropdownItemComponentEventArgs(): base() { - OnCreatedIgbDropdownItemComponentEventArgs(); - - - } - - partial void OnCreatedIgbDropdownItemComponentEventArgs(); - - private IgbDropdownItem _detail; - - partial void OnDetailChanging(ref IgbDropdownItem newValue); - [Parameter] - public IgbDropdownItem Detail - { - get { return this._detail; } - set { - if (this._detail != value || !IsPropDirty("Detail")) { - MarkPropDirty("Detail"); - } - this._detail = value; - - } - } - - partial void FindByNameDropdownItemComponentEventArgs(string name, ref object item); - public override object FindByName(string name) - { - - var baseResult = base.FindByName(name); - if (baseResult != null) - { - return baseResult; - } - - object item = null; - FindByNameDropdownItemComponentEventArgs(name, ref item); - if (item != null) - { - return item; - } - - return null; - } - - partial void SerializeCoreIgbDropdownItemComponentEventArgs(RendererSerializer ser); - - internal override void SerializeCore(RendererSerializer ser) - { - base.SerializeCore(ser); - - SerializeCoreIgbDropdownItemComponentEventArgs(ser); - - if (IsPropDirty("Detail")) { ser.AddSerializableProp("detail", this._detail); } - - } - - - protected internal override void ToEventJson(BaseRendererControl control, Dictionary args) - { - base.ToEventJson(control, args); - - if (IsPropDirty("Detail")) { args["detail"] = ObjectToParam(this._detail); } - - - } - - - protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) { - base.FromEventJson(control, args); - this.SuppressParentNotify = true; - - if (args.ContainsKey("detail")) { this.Detail = (IgbDropdownItem)ConvertReturnValue(args["detail"], "DropdownItem", true); } - - this.SuppressParentNotify = false; - } - -} + public partial class IgbDropdownItemComponentEventArgs : BaseRendererElement + { + public override string Type { get { return "WebDropdownItemComponentEventArgs"; } } + + private static bool _marshalByValue = true; + + public IgbDropdownItemComponentEventArgs() : base() + { + OnCreatedIgbDropdownItemComponentEventArgs(); + + } + + partial void OnCreatedIgbDropdownItemComponentEventArgs(); + + private IgbDropdownItem _detail; + + partial void OnDetailChanging(ref IgbDropdownItem newValue); + [Parameter] + public IgbDropdownItem Detail + { + get { return this._detail; } + set + { + if (this._detail != value || !IsPropDirty("Detail")) + { + MarkPropDirty("Detail"); + } + this._detail = value; + + } + } + + partial void FindByNameDropdownItemComponentEventArgs(string name, ref object item); + public override object FindByName(string name) + { + + var baseResult = base.FindByName(name); + if (baseResult != null) + { + return baseResult; + } + + object item = null; + FindByNameDropdownItemComponentEventArgs(name, ref item); + if (item != null) + { + return item; + } + + return null; + } + + partial void SerializeCoreIgbDropdownItemComponentEventArgs(RendererSerializer ser); + + internal override void SerializeCore(RendererSerializer ser) + { + base.SerializeCore(ser); + + SerializeCoreIgbDropdownItemComponentEventArgs(ser); + + if (IsPropDirty("Detail")) + { ser.AddSerializableProp("detail", this._detail); } + + } + + protected internal override void ToEventJson(BaseRendererControl control, Dictionary args) + { + base.ToEventJson(control, args); + + if (IsPropDirty("Detail")) + { args["detail"] = ObjectToParam(this._detail); } + + } + + protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) + { + base.FromEventJson(control, args); + this.SuppressParentNotify = true; + + if (args.ContainsKey("detail")) + { this.Detail = (IgbDropdownItem)ConvertReturnValue(args["detail"], "DropdownItem", true); } + + this.SuppressParentNotify = false; + } + + } } diff --git a/src/components/Blazor/DropdownItemModule.cs b/src/components/Blazor/DropdownItemModule.cs index 6c51741f..53eefd48 100644 --- a/src/components/Blazor/DropdownItemModule.cs +++ b/src/components/Blazor/DropdownItemModule.cs @@ -1,23 +1,20 @@ -using System; -using System.Collections.Generic; -using System.Runtime.CompilerServices; -using System.Text; -using System.Collections.Generic; - namespace IgniteUI.Blazor.Controls { - public partial class IgbDropdownItemModule { - public static void Register(IIgniteUIBlazor runtime) { + public partial class IgbDropdownItemModule + { + public static void Register(IIgniteUIBlazor runtime) + { ModuleLoader.Load(runtime, "WebDropdownItemModule"); - } - public static void MarkIsLoadRequested(IIgniteUIBlazor runtime) { + public static void MarkIsLoadRequested(IIgniteUIBlazor runtime) + { ModuleLoader.MarkIsLoadRequested(runtime, "WebDropdownItemModule"); } - public static bool IsLoadRequested(IIgniteUIBlazor runtime) { + public static bool IsLoadRequested(IIgniteUIBlazor runtime) + { return ModuleLoader.IsLoadRequested(runtime, "WebDropdownItemModule"); } } diff --git a/src/components/Blazor/DropdownModule.cs b/src/components/Blazor/DropdownModule.cs index 41621273..e6241161 100644 --- a/src/components/Blazor/DropdownModule.cs +++ b/src/components/Blazor/DropdownModule.cs @@ -1,26 +1,24 @@ -using System; -using System.Collections.Generic; -using System.Runtime.CompilerServices; -using System.Text; -using System.Collections.Generic; - namespace IgniteUI.Blazor.Controls { - public partial class IgbDropdownModule { - public static void Register(IIgniteUIBlazor runtime) { + public partial class IgbDropdownModule + { + public static void Register(IIgniteUIBlazor runtime) + { ModuleLoader.Load(runtime, "WebDropdownModule"); IgbDropdownItemModule.MarkIsLoadRequested(runtime); -IgbDropdownHeaderModule.MarkIsLoadRequested(runtime); -IgbDropdownGroupModule.MarkIsLoadRequested(runtime); + IgbDropdownHeaderModule.MarkIsLoadRequested(runtime); + IgbDropdownGroupModule.MarkIsLoadRequested(runtime); } - public static void MarkIsLoadRequested(IIgniteUIBlazor runtime) { + public static void MarkIsLoadRequested(IIgniteUIBlazor runtime) + { ModuleLoader.MarkIsLoadRequested(runtime, "WebDropdownModule"); } - public static bool IsLoadRequested(IIgniteUIBlazor runtime) { + public static bool IsLoadRequested(IIgniteUIBlazor runtime) + { return ModuleLoader.IsLoadRequested(runtime, "WebDropdownModule"); } } diff --git a/src/components/Blazor/ExpansionPanel.cs b/src/components/Blazor/ExpansionPanel.cs index 55cc63d5..001f9776 100644 --- a/src/components/Blazor/ExpansionPanel.cs +++ b/src/components/Blazor/ExpansionPanel.cs @@ -1,450 +1,478 @@ - -using System; using Microsoft.AspNetCore.Components; -using Microsoft.AspNetCore.Components.Rendering; -using System.Threading.Tasks; -using System.Collections.Generic; -using System.Linq; namespace IgniteUI.Blazor.Controls { - /// -/// The Expansion Panel Component provides a way to display information in a toggleable way - -/// compact summary view containing title and description and expanded detail view containing -/// additional content to the summary header. -/// -public partial class IgbExpansionPanel: BaseRendererControl { - public override string Type { get { return "WebExpansionPanel"; } } - - protected override void EnsureModulesLoaded() - { - if (!IgbExpansionPanelModule.IsLoadRequested(IgBlazor)) - { - IgbExpansionPanelModule.Register(IgBlazor); - } - } - - protected override string ResolveDisplay() + /// + /// The Expansion Panel Component provides a way to display information in a toggleable way - + /// compact summary view containing title and description and expanded detail view containing + /// additional content to the summary header. + /// + public partial class IgbExpansionPanel : BaseRendererControl + { + public override string Type { get { return "WebExpansionPanel"; } } + + protected override void EnsureModulesLoaded() + { + if (!IgbExpansionPanelModule.IsLoadRequested(IgBlazor)) + { + IgbExpansionPanelModule.Register(IgBlazor); + } + } + + protected override string ResolveDisplay() + { + return "inline-block"; + } + + protected override bool SupportsVisualChildren + { + get + { + return true; + } + } + + protected override bool UseDirectRender + { + get + { + return true; + } + } + + protected override string DirectRenderElementName + { + get + { + return "igc-expansion-panel"; + } + } + + protected override ControlEventBehavior DefaultEventBehavior + { + get { return ControlEventBehavior.Immediate; } + } + + public IgbExpansionPanel() : base() + { + OnCreatedIgbExpansionPanel(); + + } + + partial void OnCreatedIgbExpansionPanel(); + + private bool _open = false; + + partial void OnOpenChanging(ref bool newValue); + /// + /// Indicates whether the contents of the control should be visible. + /// + [Parameter] + public bool Open + { + get { return this._open; } + set + { + if (this._open != value || !IsPropDirty("Open")) + { + MarkPropDirty("Open"); + } + this._open = value; + + } + } + private bool _disabled = false; + + partial void OnDisabledChanging(ref bool newValue); + /// + /// Get/Set whether the expansion panel is disabled. Disabled panels are ignored for user interactions. + /// + [Parameter] + public bool Disabled + { + get { return this._disabled; } + set + { + if (this._disabled != value || !IsPropDirty("Disabled")) + { + MarkPropDirty("Disabled"); + } + this._disabled = value; + + } + } + private ExpansionPanelIndicatorPosition _indicatorPosition = ExpansionPanelIndicatorPosition.Start; + + partial void OnIndicatorPositionChanging(ref ExpansionPanelIndicatorPosition newValue); + /// + /// The indicator position of the expansion panel. + /// + [Parameter] + public ExpansionPanelIndicatorPosition IndicatorPosition + { + get { return this._indicatorPosition; } + set + { + if (this._indicatorPosition != value || !IsPropDirty("IndicatorPosition")) + { + MarkPropDirty("IndicatorPosition"); + } + this._indicatorPosition = value; + + } + } + + partial void FindByNameExpansionPanel(string name, ref object item); + public override object FindByName(string name) + { + + var baseResult = base.FindByName(name); + if (baseResult != null) + { + return baseResult; + } + + object item = null; + FindByNameExpansionPanel(name, ref item); + if (item != null) + { + return item; + } + + return null; + } + public async Task SetNativeElementAsync(Object element) + { + await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + } + public void SetNativeElement(Object element) + { + InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + } + /// + /// Toggles the panel open/close state. + /// + public async Task ToggleAsync() + { + var iv = await InvokeMethod("toggle", new object[] { }, new string[] { }); + return ReturnToBoolean(iv); + } + public bool Toggle() + { + var iv = InvokeMethodSync("toggle", new object[] { }, new string[] { }); + return ReturnToBoolean(iv); + } + /// + /// Hides the panel content. + /// + public async Task HideAsync() + { + var iv = await InvokeMethod("hide", new object[] { }, new string[] { }); + return ReturnToBoolean(iv); + } + public bool Hide() + { + var iv = InvokeMethodSync("hide", new object[] { }, new string[] { }); + return ReturnToBoolean(iv); + } + /// + /// Shows the panel content. + /// + public async Task ShowAsync() + { + var iv = await InvokeMethod("show", new object[] { }, new string[] { }); + return ReturnToBoolean(iv); + } + public bool Show() + { + var iv = InvokeMethodSync("show", new object[] { }, new string[] { }); + return ReturnToBoolean(iv); + } + + private string _openingRef = null; + private string _openingScript = null; + [Parameter] + public string OpeningScript + { + + set + { + if (value != this._openingScript) + { + this._openingScript = value; + this.OnRefChanged("Opening", null, value, true, false, (string refName, object oldValue, object newValue) => + { + this._openingRef = refName; + this.MarkPropDirty("OpeningRef"); + }); + } + } + get + { + return this._openingScript; + } + } + + partial void OnHandlingOpening(IgbExpansionPanelComponentEventArgs args); + private EventCallback? _opening = null; + [Parameter] + public EventCallback Opening + { + get + { + return this._opening != null ? this._opening.Value : EventCallback.Empty; + } + set + { + if (!value.Equals(EventCallback.Empty)) + { + if (!CompareEventCallbacks(value, _opening, ref eventCallbacksCache)) + { + _opening = value; + this.SetHandler(this.Name, "Opening", value, (args) => { - return "inline-block"; - } + OnHandlingOpening(args); - protected override bool SupportsVisualChildren + }); + this.OnRefChanged("Opening", null, "event:::Opening", true, false, (refName, oldValue, newValue) => { - get - { - return true; - } - } + this._openingRef = refName; + this.MarkPropDirty("OpeningRef"); + }); + } + } + else + { + _opening = null; + this.SetHandler(this.Name, "Opening", null); + this.OnRefChanged("Opening", null, null, true, false, (refName, oldValue, newValue) => + { + this._openingRef = null; + this.MarkPropDirty("OpeningRef"); + }); + } + } + } + + private string _openedRef = null; + private string _openedScript = null; + [Parameter] + public string OpenedScript + { + + set + { + if (value != this._openedScript) + { + this._openedScript = value; + this.OnRefChanged("Opened", null, value, true, false, (string refName, object oldValue, object newValue) => + { + this._openedRef = refName; + this.MarkPropDirty("OpenedRef"); + }); + } + } + get + { + return this._openedScript; + } + } - protected override bool UseDirectRender + partial void OnHandlingOpened(IgbExpansionPanelComponentEventArgs args); + private EventCallback? _opened = null; + [Parameter] + public EventCallback Opened + { + get + { + return this._opened != null ? this._opened.Value : EventCallback.Empty; + } + set + { + if (!value.Equals(EventCallback.Empty)) + { + if (!CompareEventCallbacks(value, _opened, ref eventCallbacksCache)) + { + _opened = value; + this.SetHandler(this.Name, "Opened", value, (args) => { - get - { - return true; - } - } + OnHandlingOpened(args); - protected override string DirectRenderElementName + }); + this.OnRefChanged("Opened", null, "event:::Opened", true, false, (refName, oldValue, newValue) => { - get - { - return "igc-expansion-panel"; - } - } - - protected override ControlEventBehavior DefaultEventBehavior - { - get { return ControlEventBehavior.Immediate; } - } - - public IgbExpansionPanel(): base() { - OnCreatedIgbExpansionPanel(); - - - } - - partial void OnCreatedIgbExpansionPanel(); - - private bool _open = false; - - partial void OnOpenChanging(ref bool newValue); - /// - /// Indicates whether the contents of the control should be visible. - /// - [Parameter] - public bool Open - { - get { return this._open; } - set { - if (this._open != value || !IsPropDirty("Open")) { - MarkPropDirty("Open"); - } - this._open = value; - - } - } - private bool _disabled = false; - - partial void OnDisabledChanging(ref bool newValue); - /// - /// Get/Set whether the expansion panel is disabled. Disabled panels are ignored for user interactions. - /// - [Parameter] - public bool Disabled - { - get { return this._disabled; } - set { - if (this._disabled != value || !IsPropDirty("Disabled")) { - MarkPropDirty("Disabled"); - } - this._disabled = value; - - } - } - private ExpansionPanelIndicatorPosition _indicatorPosition = ExpansionPanelIndicatorPosition.Start; - - partial void OnIndicatorPositionChanging(ref ExpansionPanelIndicatorPosition newValue); - /// - /// The indicator position of the expansion panel. - /// - [Parameter] - public ExpansionPanelIndicatorPosition IndicatorPosition - { - get { return this._indicatorPosition; } - set { - if (this._indicatorPosition != value || !IsPropDirty("IndicatorPosition")) { - MarkPropDirty("IndicatorPosition"); - } - this._indicatorPosition = value; - - } - } - - partial void FindByNameExpansionPanel(string name, ref object item); - public override object FindByName(string name) - { - - var baseResult = base.FindByName(name); - if (baseResult != null) - { - return baseResult; - } - - object item = null; - FindByNameExpansionPanel(name, ref item); - if (item != null) - { - return item; - } - - return null; - } - public async Task SetNativeElementAsync(Object element) - { - await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); - } - public void SetNativeElement(Object element) - { - InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); - } - /// - /// Toggles the panel open/close state. - /// - public async Task ToggleAsync() - { - var iv = await InvokeMethod("toggle", new object[] { }, new string[] { }); - return ReturnToBoolean(iv); - } - public bool Toggle() - { - var iv = InvokeMethodSync("toggle", new object[] { }, new string[] { }); - return ReturnToBoolean(iv); - } - /// - /// Hides the panel content. - /// - public async Task HideAsync() - { - var iv = await InvokeMethod("hide", new object[] { }, new string[] { }); - return ReturnToBoolean(iv); - } - public bool Hide() - { - var iv = InvokeMethodSync("hide", new object[] { }, new string[] { }); - return ReturnToBoolean(iv); - } - /// - /// Shows the panel content. - /// - public async Task ShowAsync() - { - var iv = await InvokeMethod("show", new object[] { }, new string[] { }); - return ReturnToBoolean(iv); - } - public bool Show() - { - var iv = InvokeMethodSync("show", new object[] { }, new string[] { }); - return ReturnToBoolean(iv); - } - - private string _openingRef = null; - private string _openingScript = null; - [Parameter] - public string OpeningScript { - - set - { - if (value != this._openingScript) - { - this._openingScript = value; - this.OnRefChanged("Opening", null, value, true, false, (string refName, object oldValue, object newValue) => { - this._openingRef = refName; - this.MarkPropDirty("OpeningRef"); - }); - } - } - get - { - return this._openingScript; - } - } - - partial void OnHandlingOpening(IgbExpansionPanelComponentEventArgs args); - private EventCallback? _opening = null; - [Parameter] - public EventCallback Opening - { - get - { - return this._opening != null ? this._opening.Value : EventCallback.Empty; - } - set - { - if (!value.Equals(EventCallback.Empty)) - { - if (!CompareEventCallbacks(value, _opening, ref eventCallbacksCache)) - { - _opening = value; - this.SetHandler(this.Name, "Opening", value, (args) => { - OnHandlingOpening(args); - - }); - this.OnRefChanged("Opening", null, "event:::Opening", true, false, (refName, oldValue, newValue) => { - this._openingRef = refName; - this.MarkPropDirty("OpeningRef"); - }); - } - } - else - { - _opening = null; - this.SetHandler(this.Name, "Opening", null); - this.OnRefChanged("Opening", null, null, true, false, (refName, oldValue, newValue) => { - this._openingRef = null; - this.MarkPropDirty("OpeningRef"); - }); - } - } - } - - private string _openedRef = null; - private string _openedScript = null; - [Parameter] - public string OpenedScript { - - set - { - if (value != this._openedScript) - { - this._openedScript = value; - this.OnRefChanged("Opened", null, value, true, false, (string refName, object oldValue, object newValue) => { - this._openedRef = refName; - this.MarkPropDirty("OpenedRef"); - }); - } - } - get - { - return this._openedScript; - } - } - - partial void OnHandlingOpened(IgbExpansionPanelComponentEventArgs args); - private EventCallback? _opened = null; - [Parameter] - public EventCallback Opened - { - get - { - return this._opened != null ? this._opened.Value : EventCallback.Empty; - } - set - { - if (!value.Equals(EventCallback.Empty)) - { - if (!CompareEventCallbacks(value, _opened, ref eventCallbacksCache)) - { - _opened = value; - this.SetHandler(this.Name, "Opened", value, (args) => { - OnHandlingOpened(args); - - }); - this.OnRefChanged("Opened", null, "event:::Opened", true, false, (refName, oldValue, newValue) => { - this._openedRef = refName; - this.MarkPropDirty("OpenedRef"); - }); - } - } - else - { - _opened = null; - this.SetHandler(this.Name, "Opened", null); - this.OnRefChanged("Opened", null, null, true, false, (refName, oldValue, newValue) => { - this._openedRef = null; - this.MarkPropDirty("OpenedRef"); - }); - } - } - } - - private string _closingRef = null; - private string _closingScript = null; - [Parameter] - public string ClosingScript { - - set - { - if (value != this._closingScript) - { - this._closingScript = value; - this.OnRefChanged("Closing", null, value, true, false, (string refName, object oldValue, object newValue) => { - this._closingRef = refName; - this.MarkPropDirty("ClosingRef"); - }); - } - } - get - { - return this._closingScript; - } - } - - partial void OnHandlingClosing(IgbExpansionPanelComponentEventArgs args); - private EventCallback? _closing = null; - [Parameter] - public EventCallback Closing - { - get - { - return this._closing != null ? this._closing.Value : EventCallback.Empty; - } - set - { - if (!value.Equals(EventCallback.Empty)) - { - if (!CompareEventCallbacks(value, _closing, ref eventCallbacksCache)) - { - _closing = value; - this.SetHandler(this.Name, "Closing", value, (args) => { - OnHandlingClosing(args); - - }); - this.OnRefChanged("Closing", null, "event:::Closing", true, false, (refName, oldValue, newValue) => { - this._closingRef = refName; - this.MarkPropDirty("ClosingRef"); - }); - } - } - else - { - _closing = null; - this.SetHandler(this.Name, "Closing", null); - this.OnRefChanged("Closing", null, null, true, false, (refName, oldValue, newValue) => { - this._closingRef = null; - this.MarkPropDirty("ClosingRef"); - }); - } - } - } - - private string _closedRef = null; - private string _closedScript = null; - [Parameter] - public string ClosedScript { - - set - { - if (value != this._closedScript) - { - this._closedScript = value; - this.OnRefChanged("Closed", null, value, true, false, (string refName, object oldValue, object newValue) => { - this._closedRef = refName; - this.MarkPropDirty("ClosedRef"); - }); - } - } - get - { - return this._closedScript; - } - } - - partial void OnHandlingClosed(IgbExpansionPanelComponentEventArgs args); - private EventCallback? _closed = null; - [Parameter] - public EventCallback Closed - { - get - { - return this._closed != null ? this._closed.Value : EventCallback.Empty; - } - set - { - if (!value.Equals(EventCallback.Empty)) - { - if (!CompareEventCallbacks(value, _closed, ref eventCallbacksCache)) - { - _closed = value; - this.SetHandler(this.Name, "Closed", value, (args) => { - OnHandlingClosed(args); - - }); - this.OnRefChanged("Closed", null, "event:::Closed", true, false, (refName, oldValue, newValue) => { - this._closedRef = refName; - this.MarkPropDirty("ClosedRef"); - }); - } - } - else - { - _closed = null; - this.SetHandler(this.Name, "Closed", null); - this.OnRefChanged("Closed", null, null, true, false, (refName, oldValue, newValue) => { - this._closedRef = null; - this.MarkPropDirty("ClosedRef"); - }); - } - } - } - - partial void SerializeCoreIgbExpansionPanel(RendererSerializer ser); - - internal override void SerializeCore(RendererSerializer ser) - { - base.SerializeCore(ser); - - SerializeCoreIgbExpansionPanel(ser); - - if (IsPropDirty("Open")) { ser.AddBooleanProp("open", this._open); } - if (IsPropDirty("Disabled")) { ser.AddBooleanProp("disabled", this._disabled); } - if (IsPropDirty("IndicatorPosition")) { ser.AddEnumProp("indicatorPosition", this._indicatorPosition); } - if (IsPropDirty("OpeningRef")) { ser.AddStringProp("openingRef", this._openingRef); } - if (IsPropDirty("OpenedRef")) { ser.AddStringProp("openedRef", this._openedRef); } - if (IsPropDirty("ClosingRef")) { ser.AddStringProp("closingRef", this._closingRef); } - if (IsPropDirty("ClosedRef")) { ser.AddStringProp("closedRef", this._closedRef); } - - } - -} + this._openedRef = refName; + this.MarkPropDirty("OpenedRef"); + }); + } + } + else + { + _opened = null; + this.SetHandler(this.Name, "Opened", null); + this.OnRefChanged("Opened", null, null, true, false, (refName, oldValue, newValue) => + { + this._openedRef = null; + this.MarkPropDirty("OpenedRef"); + }); + } + } + } + + private string _closingRef = null; + private string _closingScript = null; + [Parameter] + public string ClosingScript + { + + set + { + if (value != this._closingScript) + { + this._closingScript = value; + this.OnRefChanged("Closing", null, value, true, false, (string refName, object oldValue, object newValue) => + { + this._closingRef = refName; + this.MarkPropDirty("ClosingRef"); + }); + } + } + get + { + return this._closingScript; + } + } + + partial void OnHandlingClosing(IgbExpansionPanelComponentEventArgs args); + private EventCallback? _closing = null; + [Parameter] + public EventCallback Closing + { + get + { + return this._closing != null ? this._closing.Value : EventCallback.Empty; + } + set + { + if (!value.Equals(EventCallback.Empty)) + { + if (!CompareEventCallbacks(value, _closing, ref eventCallbacksCache)) + { + _closing = value; + this.SetHandler(this.Name, "Closing", value, (args) => + { + OnHandlingClosing(args); + + }); + this.OnRefChanged("Closing", null, "event:::Closing", true, false, (refName, oldValue, newValue) => + { + this._closingRef = refName; + this.MarkPropDirty("ClosingRef"); + }); + } + } + else + { + _closing = null; + this.SetHandler(this.Name, "Closing", null); + this.OnRefChanged("Closing", null, null, true, false, (refName, oldValue, newValue) => + { + this._closingRef = null; + this.MarkPropDirty("ClosingRef"); + }); + } + } + } + + private string _closedRef = null; + private string _closedScript = null; + [Parameter] + public string ClosedScript + { + + set + { + if (value != this._closedScript) + { + this._closedScript = value; + this.OnRefChanged("Closed", null, value, true, false, (string refName, object oldValue, object newValue) => + { + this._closedRef = refName; + this.MarkPropDirty("ClosedRef"); + }); + } + } + get + { + return this._closedScript; + } + } + + partial void OnHandlingClosed(IgbExpansionPanelComponentEventArgs args); + private EventCallback? _closed = null; + [Parameter] + public EventCallback Closed + { + get + { + return this._closed != null ? this._closed.Value : EventCallback.Empty; + } + set + { + if (!value.Equals(EventCallback.Empty)) + { + if (!CompareEventCallbacks(value, _closed, ref eventCallbacksCache)) + { + _closed = value; + this.SetHandler(this.Name, "Closed", value, (args) => + { + OnHandlingClosed(args); + + }); + this.OnRefChanged("Closed", null, "event:::Closed", true, false, (refName, oldValue, newValue) => + { + this._closedRef = refName; + this.MarkPropDirty("ClosedRef"); + }); + } + } + else + { + _closed = null; + this.SetHandler(this.Name, "Closed", null); + this.OnRefChanged("Closed", null, null, true, false, (refName, oldValue, newValue) => + { + this._closedRef = null; + this.MarkPropDirty("ClosedRef"); + }); + } + } + } + + partial void SerializeCoreIgbExpansionPanel(RendererSerializer ser); + + internal override void SerializeCore(RendererSerializer ser) + { + base.SerializeCore(ser); + + SerializeCoreIgbExpansionPanel(ser); + + if (IsPropDirty("Open")) + { ser.AddBooleanProp("open", this._open); } + if (IsPropDirty("Disabled")) + { ser.AddBooleanProp("disabled", this._disabled); } + if (IsPropDirty("IndicatorPosition")) + { ser.AddEnumProp("indicatorPosition", this._indicatorPosition); } + if (IsPropDirty("OpeningRef")) + { ser.AddStringProp("openingRef", this._openingRef); } + if (IsPropDirty("OpenedRef")) + { ser.AddStringProp("openedRef", this._openedRef); } + if (IsPropDirty("ClosingRef")) + { ser.AddStringProp("closingRef", this._closingRef); } + if (IsPropDirty("ClosedRef")) + { ser.AddStringProp("closedRef", this._closedRef); } + + } + + } } diff --git a/src/components/Blazor/ExpansionPanelComponentEventArgs.cs b/src/components/Blazor/ExpansionPanelComponentEventArgs.cs index 803aa8b5..ab1d5a2e 100644 --- a/src/components/Blazor/ExpansionPanelComponentEventArgs.cs +++ b/src/components/Blazor/ExpansionPanelComponentEventArgs.cs @@ -1,94 +1,91 @@ - -using System; using Microsoft.AspNetCore.Components; -using Microsoft.AspNetCore.Components.Rendering; -using System.Threading.Tasks; -using System.Collections.Generic; -using System.Linq; namespace IgniteUI.Blazor.Controls { - public partial class IgbExpansionPanelComponentEventArgs: BaseRendererElement { - public override string Type { get { return "WebExpansionPanelComponentEventArgs"; } } - - - private static bool _marshalByValue = true; - - public IgbExpansionPanelComponentEventArgs(): base() { - OnCreatedIgbExpansionPanelComponentEventArgs(); - - - } - - partial void OnCreatedIgbExpansionPanelComponentEventArgs(); - - private IgbExpansionPanel _detail; - - partial void OnDetailChanging(ref IgbExpansionPanel newValue); - [Parameter] - public IgbExpansionPanel Detail - { - get { return this._detail; } - set { - if (this._detail != value || !IsPropDirty("Detail")) { - MarkPropDirty("Detail"); - } - this._detail = value; - - } - } - - partial void FindByNameExpansionPanelComponentEventArgs(string name, ref object item); - public override object FindByName(string name) - { - - var baseResult = base.FindByName(name); - if (baseResult != null) - { - return baseResult; - } - - object item = null; - FindByNameExpansionPanelComponentEventArgs(name, ref item); - if (item != null) - { - return item; - } - - return null; - } - - partial void SerializeCoreIgbExpansionPanelComponentEventArgs(RendererSerializer ser); - - internal override void SerializeCore(RendererSerializer ser) - { - base.SerializeCore(ser); - - SerializeCoreIgbExpansionPanelComponentEventArgs(ser); - - if (IsPropDirty("Detail")) { ser.AddSerializableProp("detail", this._detail); } - - } - - - protected internal override void ToEventJson(BaseRendererControl control, Dictionary args) - { - base.ToEventJson(control, args); - - if (IsPropDirty("Detail")) { args["detail"] = ObjectToParam(this._detail); } - - - } - - - protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) { - base.FromEventJson(control, args); - this.SuppressParentNotify = true; - - if (args.ContainsKey("detail")) { this.Detail = (IgbExpansionPanel)ConvertReturnValue(args["detail"], "ExpansionPanel", true); } - - this.SuppressParentNotify = false; - } - -} + public partial class IgbExpansionPanelComponentEventArgs : BaseRendererElement + { + public override string Type { get { return "WebExpansionPanelComponentEventArgs"; } } + + private static bool _marshalByValue = true; + + public IgbExpansionPanelComponentEventArgs() : base() + { + OnCreatedIgbExpansionPanelComponentEventArgs(); + + } + + partial void OnCreatedIgbExpansionPanelComponentEventArgs(); + + private IgbExpansionPanel _detail; + + partial void OnDetailChanging(ref IgbExpansionPanel newValue); + [Parameter] + public IgbExpansionPanel Detail + { + get { return this._detail; } + set + { + if (this._detail != value || !IsPropDirty("Detail")) + { + MarkPropDirty("Detail"); + } + this._detail = value; + + } + } + + partial void FindByNameExpansionPanelComponentEventArgs(string name, ref object item); + public override object FindByName(string name) + { + + var baseResult = base.FindByName(name); + if (baseResult != null) + { + return baseResult; + } + + object item = null; + FindByNameExpansionPanelComponentEventArgs(name, ref item); + if (item != null) + { + return item; + } + + return null; + } + + partial void SerializeCoreIgbExpansionPanelComponentEventArgs(RendererSerializer ser); + + internal override void SerializeCore(RendererSerializer ser) + { + base.SerializeCore(ser); + + SerializeCoreIgbExpansionPanelComponentEventArgs(ser); + + if (IsPropDirty("Detail")) + { ser.AddSerializableProp("detail", this._detail); } + + } + + protected internal override void ToEventJson(BaseRendererControl control, Dictionary args) + { + base.ToEventJson(control, args); + + if (IsPropDirty("Detail")) + { args["detail"] = ObjectToParam(this._detail); } + + } + + protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) + { + base.FromEventJson(control, args); + this.SuppressParentNotify = true; + + if (args.ContainsKey("detail")) + { this.Detail = (IgbExpansionPanel)ConvertReturnValue(args["detail"], "ExpansionPanel", true); } + + this.SuppressParentNotify = false; + } + + } } diff --git a/src/components/Blazor/ExpansionPanelIndicatorPosition.cs b/src/components/Blazor/ExpansionPanelIndicatorPosition.cs index ab7e8462..ee59ea04 100644 --- a/src/components/Blazor/ExpansionPanelIndicatorPosition.cs +++ b/src/components/Blazor/ExpansionPanelIndicatorPosition.cs @@ -1,9 +1,10 @@ namespace IgniteUI.Blazor.Controls { -public enum ExpansionPanelIndicatorPosition { - Start, - End, - None + public enum ExpansionPanelIndicatorPosition + { + Start, + End, + None -} + } } diff --git a/src/components/Blazor/ExpansionPanelModule.cs b/src/components/Blazor/ExpansionPanelModule.cs index cf3a506c..ab358a68 100644 --- a/src/components/Blazor/ExpansionPanelModule.cs +++ b/src/components/Blazor/ExpansionPanelModule.cs @@ -1,23 +1,20 @@ -using System; -using System.Collections.Generic; -using System.Runtime.CompilerServices; -using System.Text; -using System.Collections.Generic; - namespace IgniteUI.Blazor.Controls { - public partial class IgbExpansionPanelModule { - public static void Register(IIgniteUIBlazor runtime) { + public partial class IgbExpansionPanelModule + { + public static void Register(IIgniteUIBlazor runtime) + { ModuleLoader.Load(runtime, "WebExpansionPanelModule"); - } - public static void MarkIsLoadRequested(IIgniteUIBlazor runtime) { + public static void MarkIsLoadRequested(IIgniteUIBlazor runtime) + { ModuleLoader.MarkIsLoadRequested(runtime, "WebExpansionPanelModule"); } - public static bool IsLoadRequested(IIgniteUIBlazor runtime) { + public static bool IsLoadRequested(IIgniteUIBlazor runtime) + { return ModuleLoader.IsLoadRequested(runtime, "WebExpansionPanelModule"); } } diff --git a/src/components/Blazor/FilteringOptions.cs b/src/components/Blazor/FilteringOptions.cs index 5b9f9c3b..4fc02c40 100644 --- a/src/components/Blazor/FilteringOptions.cs +++ b/src/components/Blazor/FilteringOptions.cs @@ -1,121 +1,124 @@ - -using System; using Microsoft.AspNetCore.Components; -using Microsoft.AspNetCore.Components.Rendering; -using System.Threading.Tasks; -using System.Collections.Generic; -using System.Linq; namespace IgniteUI.Blazor.Controls { - public partial class IgbFilteringOptions: BaseRendererElement { - public override string Type { get { return "WebFilteringOptions"; } } - - - public IgbFilteringOptions(): base() { - OnCreatedIgbFilteringOptions(); - - - } - - partial void OnCreatedIgbFilteringOptions(); - - private string _filterKey; - - partial void OnFilterKeyChanging(ref string newValue); - /// - /// The key in the data source used when filtering the list of options. - /// - [Parameter] - public string FilterKey - { - get { return this._filterKey; } - set { - if (this._filterKey != value || !IsPropDirty("FilterKey")) { - MarkPropDirty("FilterKey"); - } - this._filterKey = value; - - } - } - private bool _caseSensitive = false; - - partial void OnCaseSensitiveChanging(ref bool newValue); - /// - /// Determines whether the filtering operation should be case sensitive. - /// - [Parameter] - public bool CaseSensitive - { - get { return this._caseSensitive; } - set { - if (this._caseSensitive != value || !IsPropDirty("CaseSensitive")) { - MarkPropDirty("CaseSensitive"); - } - this._caseSensitive = value; - - } - } - private bool _matchDiacritics = false; - - partial void OnMatchDiacriticsChanging(ref bool newValue); - /// - /// If true, the filter distinguishes between accented letters and their base letters - /// - [Parameter] - public bool MatchDiacritics - { - get { return this._matchDiacritics; } - set { - if (this._matchDiacritics != value || !IsPropDirty("MatchDiacritics")) { - MarkPropDirty("MatchDiacritics"); - } - this._matchDiacritics = value; - - } - } - - partial void FindByNameFilteringOptions(string name, ref object item); - public override object FindByName(string name) - { - - var baseResult = base.FindByName(name); - if (baseResult != null) - { - return baseResult; - } - - object item = null; - FindByNameFilteringOptions(name, ref item); - if (item != null) - { - return item; - } - - return null; - } - public async Task SetNativeElementAsync(Object element) - { - await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); - } - public void SetNativeElement(Object element) - { - InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); - } - - partial void SerializeCoreIgbFilteringOptions(RendererSerializer ser); - - internal override void SerializeCore(RendererSerializer ser) - { - base.SerializeCore(ser); - - SerializeCoreIgbFilteringOptions(ser); - - if (IsPropDirty("FilterKey")) { ser.AddStringProp("filterKey", this._filterKey); } - if (IsPropDirty("CaseSensitive")) { ser.AddBooleanProp("caseSensitive", this._caseSensitive); } - if (IsPropDirty("MatchDiacritics")) { ser.AddBooleanProp("matchDiacritics", this._matchDiacritics); } - - } - -} + public partial class IgbFilteringOptions : BaseRendererElement + { + public override string Type { get { return "WebFilteringOptions"; } } + + public IgbFilteringOptions() : base() + { + OnCreatedIgbFilteringOptions(); + + } + + partial void OnCreatedIgbFilteringOptions(); + + private string _filterKey; + + partial void OnFilterKeyChanging(ref string newValue); + /// + /// The key in the data source used when filtering the list of options. + /// + [Parameter] + public string FilterKey + { + get { return this._filterKey; } + set + { + if (this._filterKey != value || !IsPropDirty("FilterKey")) + { + MarkPropDirty("FilterKey"); + } + this._filterKey = value; + + } + } + private bool _caseSensitive = false; + + partial void OnCaseSensitiveChanging(ref bool newValue); + /// + /// Determines whether the filtering operation should be case sensitive. + /// + [Parameter] + public bool CaseSensitive + { + get { return this._caseSensitive; } + set + { + if (this._caseSensitive != value || !IsPropDirty("CaseSensitive")) + { + MarkPropDirty("CaseSensitive"); + } + this._caseSensitive = value; + + } + } + private bool _matchDiacritics = false; + + partial void OnMatchDiacriticsChanging(ref bool newValue); + /// + /// If true, the filter distinguishes between accented letters and their base letters + /// + [Parameter] + public bool MatchDiacritics + { + get { return this._matchDiacritics; } + set + { + if (this._matchDiacritics != value || !IsPropDirty("MatchDiacritics")) + { + MarkPropDirty("MatchDiacritics"); + } + this._matchDiacritics = value; + + } + } + + partial void FindByNameFilteringOptions(string name, ref object item); + public override object FindByName(string name) + { + + var baseResult = base.FindByName(name); + if (baseResult != null) + { + return baseResult; + } + + object item = null; + FindByNameFilteringOptions(name, ref item); + if (item != null) + { + return item; + } + + return null; + } + public async Task SetNativeElementAsync(Object element) + { + await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + } + public void SetNativeElement(Object element) + { + InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + } + + partial void SerializeCoreIgbFilteringOptions(RendererSerializer ser); + + internal override void SerializeCore(RendererSerializer ser) + { + base.SerializeCore(ser); + + SerializeCoreIgbFilteringOptions(ser); + + if (IsPropDirty("FilterKey")) + { ser.AddStringProp("filterKey", this._filterKey); } + if (IsPropDirty("CaseSensitive")) + { ser.AddBooleanProp("caseSensitive", this._caseSensitive); } + if (IsPropDirty("MatchDiacritics")) + { ser.AddBooleanProp("matchDiacritics", this._matchDiacritics); } + + } + + } } diff --git a/src/components/Blazor/FocusOptions.cs b/src/components/Blazor/FocusOptions.cs index 0f79e3a2..d2708724 100644 --- a/src/components/Blazor/FocusOptions.cs +++ b/src/components/Blazor/FocusOptions.cs @@ -1,72 +1,69 @@ - -using System; using Microsoft.AspNetCore.Components; -using Microsoft.AspNetCore.Components.Rendering; -using System.Threading.Tasks; -using System.Collections.Generic; -using System.Linq; namespace IgniteUI.Blazor.Controls { - public partial class IgbFocusOptions: BaseRendererElement { - public override string Type { get { return "FocusOptions"; } } - - - public IgbFocusOptions(): base() { - OnCreatedIgbFocusOptions(); - - - } - - partial void OnCreatedIgbFocusOptions(); - - private bool _preventScroll = false; - - partial void OnPreventScrollChanging(ref bool newValue); - [Parameter] - public bool PreventScroll - { - get { return this._preventScroll; } - set { - if (this._preventScroll != value || !IsPropDirty("PreventScroll")) { - MarkPropDirty("PreventScroll"); - } - this._preventScroll = value; - - } - } - - partial void FindByNameFocusOptions(string name, ref object item); - public override object FindByName(string name) - { - - var baseResult = base.FindByName(name); - if (baseResult != null) - { - return baseResult; - } - - object item = null; - FindByNameFocusOptions(name, ref item); - if (item != null) - { - return item; - } - - return null; - } - - partial void SerializeCoreIgbFocusOptions(RendererSerializer ser); - - internal override void SerializeCore(RendererSerializer ser) - { - base.SerializeCore(ser); - - SerializeCoreIgbFocusOptions(ser); - - if (IsPropDirty("PreventScroll")) { ser.AddBooleanProp("preventScroll", this._preventScroll); } - - } - -} + public partial class IgbFocusOptions : BaseRendererElement + { + public override string Type { get { return "FocusOptions"; } } + + public IgbFocusOptions() : base() + { + OnCreatedIgbFocusOptions(); + + } + + partial void OnCreatedIgbFocusOptions(); + + private bool _preventScroll = false; + + partial void OnPreventScrollChanging(ref bool newValue); + [Parameter] + public bool PreventScroll + { + get { return this._preventScroll; } + set + { + if (this._preventScroll != value || !IsPropDirty("PreventScroll")) + { + MarkPropDirty("PreventScroll"); + } + this._preventScroll = value; + + } + } + + partial void FindByNameFocusOptions(string name, ref object item); + public override object FindByName(string name) + { + + var baseResult = base.FindByName(name); + if (baseResult != null) + { + return baseResult; + } + + object item = null; + FindByNameFocusOptions(name, ref item); + if (item != null) + { + return item; + } + + return null; + } + + partial void SerializeCoreIgbFocusOptions(RendererSerializer ser); + + internal override void SerializeCore(RendererSerializer ser) + { + base.SerializeCore(ser); + + SerializeCoreIgbFocusOptions(ser); + + if (IsPropDirty("PreventScroll")) + { ser.AddBooleanProp("preventScroll", this._preventScroll); } + + } + + } } diff --git a/src/components/Blazor/FormatSpecifier.cs b/src/components/Blazor/FormatSpecifier.cs index cba0e509..2e7ceaa1 100644 --- a/src/components/Blazor/FormatSpecifier.cs +++ b/src/components/Blazor/FormatSpecifier.cs @@ -1,110 +1,99 @@ - -using System; -using Microsoft.AspNetCore.Components; -using Microsoft.AspNetCore.Components.Rendering; -using System.Threading.Tasks; -using System.Collections.Generic; -using System.Linq; - namespace IgniteUI.Blazor.Controls { - public partial class IgbFormatSpecifier: BaseRendererElement { - public override string Type { get { return "FormatSpecifier"; } } - - protected override void EnsureModulesLoaded() - { - if (!IgbFormatSpecifierModule.IsLoadRequested(IgBlazor)) - { - IgbFormatSpecifierModule.Register(IgBlazor); - } - } - - private static bool _marshalByValue = true; - - public IgbFormatSpecifier(): base() { - OnCreatedIgbFormatSpecifier(); - - - } - - partial void OnCreatedIgbFormatSpecifier(); - - - partial void FindByNameFormatSpecifier(string name, ref object item); - public override object FindByName(string name) - { - - var baseResult = base.FindByName(name); - if (baseResult != null) - { - return baseResult; - } - - object item = null; - FindByNameFormatSpecifier(name, ref item); - if (item != null) - { - return item; - } - - return null; - } - public async Task GetLocalCultureAsync() - { - var iv = await InvokeMethod("getLocalCulture", new object[] { }, new string[] { }); - return ReturnToString(iv); - } - public String GetLocalCulture() - { - var iv = InvokeMethodSync("getLocalCulture", new object[] { }, new string[] { }); - return ReturnToString(iv); - } - - partial void SerializeCoreIgbFormatSpecifier(RendererSerializer ser); - - internal override void SerializeCore(RendererSerializer ser) - { - base.SerializeCore(ser); - - SerializeCoreIgbFormatSpecifier(ser); - - - } - - - protected internal override void ToEventJson(BaseRendererControl control, Dictionary args) - { - base.ToEventJson(control, args); - - - - } - - - protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) { - base.FromEventJson(control, args); - this.SuppressParentNotify = true; - - - this.SuppressParentNotify = false; - } - -} + public partial class IgbFormatSpecifier : BaseRendererElement + { + public override string Type { get { return "FormatSpecifier"; } } -public class IgbFormatSpecifierModule -{ - public static void Register(IIgniteUIBlazor runtime) { - ModuleLoader.Load(runtime, "FormatSpecifierModule"); - } + protected override void EnsureModulesLoaded() + { + if (!IgbFormatSpecifierModule.IsLoadRequested(IgBlazor)) + { + IgbFormatSpecifierModule.Register(IgBlazor); + } + } + + private static bool _marshalByValue = true; + + public IgbFormatSpecifier() : base() + { + OnCreatedIgbFormatSpecifier(); + + } + + partial void OnCreatedIgbFormatSpecifier(); + + partial void FindByNameFormatSpecifier(string name, ref object item); + public override object FindByName(string name) + { + + var baseResult = base.FindByName(name); + if (baseResult != null) + { + return baseResult; + } + + object item = null; + FindByNameFormatSpecifier(name, ref item); + if (item != null) + { + return item; + } + + return null; + } + public async Task GetLocalCultureAsync() + { + var iv = await InvokeMethod("getLocalCulture", new object[] { }, new string[] { }); + return ReturnToString(iv); + } + public String GetLocalCulture() + { + var iv = InvokeMethodSync("getLocalCulture", new object[] { }, new string[] { }); + return ReturnToString(iv); + } + + partial void SerializeCoreIgbFormatSpecifier(RendererSerializer ser); + + internal override void SerializeCore(RendererSerializer ser) + { + base.SerializeCore(ser); + + SerializeCoreIgbFormatSpecifier(ser); + + } + + protected internal override void ToEventJson(BaseRendererControl control, Dictionary args) + { + base.ToEventJson(control, args); + + } + + protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) + { + base.FromEventJson(control, args); + this.SuppressParentNotify = true; + + this.SuppressParentNotify = false; + } - public static void MarkIsLoadRequested(IIgniteUIBlazor runtime) { - ModuleLoader.MarkIsLoadRequested(runtime, "FormatSpecifierModule"); } + public class IgbFormatSpecifierModule + { + public static void Register(IIgniteUIBlazor runtime) + { + ModuleLoader.Load(runtime, "FormatSpecifierModule"); + } - public static bool IsLoadRequested(IIgniteUIBlazor runtime) { - return ModuleLoader.IsLoadRequested(runtime, "FormatSpecifierModule"); + public static void MarkIsLoadRequested(IIgniteUIBlazor runtime) + { + ModuleLoader.MarkIsLoadRequested(runtime, "FormatSpecifierModule"); + } + + public static bool IsLoadRequested(IIgniteUIBlazor runtime) + { + return ModuleLoader.IsLoadRequested(runtime, "FormatSpecifierModule"); + } } -} } diff --git a/src/components/Blazor/GroupingDirection.cs b/src/components/Blazor/GroupingDirection.cs index c85e7bf6..9f6e0d4a 100644 --- a/src/components/Blazor/GroupingDirection.cs +++ b/src/components/Blazor/GroupingDirection.cs @@ -1,9 +1,10 @@ namespace IgniteUI.Blazor.Controls { -public enum GroupingDirection { - Asc, - Desc, - None + public enum GroupingDirection + { + Asc, + Desc, + None -} + } } diff --git a/src/components/Blazor/Highlight.cs b/src/components/Blazor/Highlight.cs index f6218875..fa645e11 100644 --- a/src/components/Blazor/Highlight.cs +++ b/src/components/Blazor/Highlight.cs @@ -1,222 +1,223 @@ - -using System; using Microsoft.AspNetCore.Components; -using Microsoft.AspNetCore.Components.Rendering; -using System.Threading.Tasks; -using System.Collections.Generic; -using System.Linq; namespace IgniteUI.Blazor.Controls { - /// -/// The highlight component provides efficient searching and highlighting of text -/// projected into it via its default slot. It uses the native CSS Custom Highlight API -/// to apply highlight styles to matched text nodes without modifying the DOM. -/// The component supports case-sensitive matching, programmatic navigation between -/// matches, and automatic scroll-into-view of the active match. -/// -public partial class IgbHighlight: BaseRendererControl { - public override string Type { get { return "WebHighlight"; } } - - protected override void EnsureModulesLoaded() - { - if (!IgbHighlightModule.IsLoadRequested(IgBlazor)) - { - IgbHighlightModule.Register(IgBlazor); - } - } - - protected override string ResolveDisplay() - { - return "inline-block"; - } - - protected override bool SupportsVisualChildren - { - get - { - return true; - } - } - - protected override bool UseDirectRender - { - get - { - return true; - } - } - - protected override string DirectRenderElementName - { - get - { - return "igc-highlight"; - } - } - - protected override ControlEventBehavior DefaultEventBehavior - { - get { return ControlEventBehavior.Immediate; } - } - - public IgbHighlight(): base() { - OnCreatedIgbHighlight(); - - - } - - partial void OnCreatedIgbHighlight(); - - private bool _caseSensitive = false; - - partial void OnCaseSensitiveChanging(ref bool newValue); - /// - /// Whether to match the searched text with case sensitivity in mind. - /// When `true`, only exact-case occurrences of `searchText` are highlighted. - /// - [Parameter] - public bool CaseSensitive - { - get { return this._caseSensitive; } - set { - if (this._caseSensitive != value || !IsPropDirty("CaseSensitive")) { - MarkPropDirty("CaseSensitive"); - } - this._caseSensitive = value; - - } - } - private string _searchText; - - partial void OnSearchTextChanging(ref string newValue); - /// - /// The string to search and highlight in the DOM content of the component. - /// Setting this property triggers a new search automatically. - /// An empty string clears all highlights. - /// - [Parameter] - public string SearchText - { - get { return this._searchText; } - set { - if (this._searchText != value || !IsPropDirty("SearchText")) { - MarkPropDirty("SearchText"); - } - this._searchText = value; - - } - } - public async Task GetSizeAsync() - { - var iv = await InvokeMethod("p:Size", new object[] { }, new string[] { }); - return ReturnToDouble(iv); - } - public double GetSize() - { - var iv = InvokeMethodSync("p:Size", new object[] { }, new string[] { }); - return ReturnToDouble(iv); - } - public async Task GetCurrentAsync() - { - var iv = await InvokeMethod("p:Current", new object[] { }, new string[] { }); - return ReturnToDouble(iv); - } - public double GetCurrent() - { - var iv = InvokeMethodSync("p:Current", new object[] { }, new string[] { }); - return ReturnToDouble(iv); - } - - partial void FindByNameHighlight(string name, ref object item); - public override object FindByName(string name) - { - - var baseResult = base.FindByName(name); - if (baseResult != null) - { - return baseResult; - } - - object item = null; - FindByNameHighlight(name, ref item); - if (item != null) - { - return item; - } - - return null; - } - public async Task SetNativeElementAsync(Object element) - { - await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); - } - public void SetNativeElement(Object element) - { - InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); - } - /// - /// Moves the active highlight to the next match. - /// Wraps around to the first match after the last one. - /// options - Optional navigation options (e.g. `preventScroll`). - /// - /// - Optional navigation options (e.g. `preventScroll`). - public async Task NextAsync(IgbHighlightNavigation options) - { - await InvokeMethod("next", new object[] { ObjectToParam(options) }, new string[] { "Json" }); - } - public void Next(IgbHighlightNavigation options) - { - InvokeMethodSync("next", new object[] { ObjectToParam(options) }, new string[] { "Json" }); - } - /// - /// Moves the active highlight to the previous match. - /// Wraps around to the last match when going back from the first one. - /// options - Optional navigation options (e.g. `preventScroll`). - /// - /// - Optional navigation options (e.g. `preventScroll`). - public async Task PreviousAsync(IgbHighlightNavigation options) - { - await InvokeMethod("previous", new object[] { ObjectToParam(options) }, new string[] { "Json" }); - } - public void Previous(IgbHighlightNavigation options) - { - InvokeMethodSync("previous", new object[] { ObjectToParam(options) }, new string[] { "Json" }); - } - public async Task SetActiveAsync(double index, IgbHighlightNavigation options) - { - await InvokeMethod("setActive", new object[] { index, ObjectToParam(options) }, new string[] { "Number", "Json" }); - } - public void SetActive(double index, IgbHighlightNavigation options) - { - InvokeMethodSync("setActive", new object[] { index, ObjectToParam(options) }, new string[] { "Number", "Json" }); - } - /// - /// Re-runs the highlight search based on the current `searchText` and `caseSensitive` values. - /// Call this method after the slotted content changes dynamically (e.g. after lazy loading - /// or programmatic DOM mutations) to ensure all matches are up to date. - /// - public async Task SearchAsync() - { - await InvokeMethod("search", new object[] { }, new string[] { }); - } - public void Search() - { - InvokeMethodSync("search", new object[] { }, new string[] { }); - } - - partial void SerializeCoreIgbHighlight(RendererSerializer ser); - - internal override void SerializeCore(RendererSerializer ser) - { - base.SerializeCore(ser); - - SerializeCoreIgbHighlight(ser); - - if (IsPropDirty("CaseSensitive")) { ser.AddBooleanProp("caseSensitive", this._caseSensitive); } - if (IsPropDirty("SearchText")) { ser.AddStringProp("searchText", this._searchText); } - - } - -} + /// + /// The highlight component provides efficient searching and highlighting of text + /// projected into it via its default slot. It uses the native CSS Custom Highlight API + /// to apply highlight styles to matched text nodes without modifying the DOM. + /// The component supports case-sensitive matching, programmatic navigation between + /// matches, and automatic scroll-into-view of the active match. + /// + public partial class IgbHighlight : BaseRendererControl + { + public override string Type { get { return "WebHighlight"; } } + + protected override void EnsureModulesLoaded() + { + if (!IgbHighlightModule.IsLoadRequested(IgBlazor)) + { + IgbHighlightModule.Register(IgBlazor); + } + } + + protected override string ResolveDisplay() + { + return "inline-block"; + } + + protected override bool SupportsVisualChildren + { + get + { + return true; + } + } + + protected override bool UseDirectRender + { + get + { + return true; + } + } + + protected override string DirectRenderElementName + { + get + { + return "igc-highlight"; + } + } + + protected override ControlEventBehavior DefaultEventBehavior + { + get { return ControlEventBehavior.Immediate; } + } + + public IgbHighlight() : base() + { + OnCreatedIgbHighlight(); + + } + + partial void OnCreatedIgbHighlight(); + + private bool _caseSensitive = false; + + partial void OnCaseSensitiveChanging(ref bool newValue); + /// + /// Whether to match the searched text with case sensitivity in mind. + /// When `true`, only exact-case occurrences of `searchText` are highlighted. + /// + [Parameter] + public bool CaseSensitive + { + get { return this._caseSensitive; } + set + { + if (this._caseSensitive != value || !IsPropDirty("CaseSensitive")) + { + MarkPropDirty("CaseSensitive"); + } + this._caseSensitive = value; + + } + } + private string _searchText; + + partial void OnSearchTextChanging(ref string newValue); + /// + /// The string to search and highlight in the DOM content of the component. + /// Setting this property triggers a new search automatically. + /// An empty string clears all highlights. + /// + [Parameter] + public string SearchText + { + get { return this._searchText; } + set + { + if (this._searchText != value || !IsPropDirty("SearchText")) + { + MarkPropDirty("SearchText"); + } + this._searchText = value; + + } + } + public async Task GetSizeAsync() + { + var iv = await InvokeMethod("p:Size", new object[] { }, new string[] { }); + return ReturnToDouble(iv); + } + public double GetSize() + { + var iv = InvokeMethodSync("p:Size", new object[] { }, new string[] { }); + return ReturnToDouble(iv); + } + public async Task GetCurrentAsync() + { + var iv = await InvokeMethod("p:Current", new object[] { }, new string[] { }); + return ReturnToDouble(iv); + } + public double GetCurrent() + { + var iv = InvokeMethodSync("p:Current", new object[] { }, new string[] { }); + return ReturnToDouble(iv); + } + + partial void FindByNameHighlight(string name, ref object item); + public override object FindByName(string name) + { + + var baseResult = base.FindByName(name); + if (baseResult != null) + { + return baseResult; + } + + object item = null; + FindByNameHighlight(name, ref item); + if (item != null) + { + return item; + } + + return null; + } + public async Task SetNativeElementAsync(Object element) + { + await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + } + public void SetNativeElement(Object element) + { + InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + } + /// + /// Moves the active highlight to the next match. + /// Wraps around to the first match after the last one. + /// options - Optional navigation options (e.g. `preventScroll`). + /// + /// - Optional navigation options (e.g. `preventScroll`). + public async Task NextAsync(IgbHighlightNavigation options) + { + await InvokeMethod("next", new object[] { ObjectToParam(options) }, new string[] { "Json" }); + } + public void Next(IgbHighlightNavigation options) + { + InvokeMethodSync("next", new object[] { ObjectToParam(options) }, new string[] { "Json" }); + } + /// + /// Moves the active highlight to the previous match. + /// Wraps around to the last match when going back from the first one. + /// options - Optional navigation options (e.g. `preventScroll`). + /// + /// - Optional navigation options (e.g. `preventScroll`). + public async Task PreviousAsync(IgbHighlightNavigation options) + { + await InvokeMethod("previous", new object[] { ObjectToParam(options) }, new string[] { "Json" }); + } + public void Previous(IgbHighlightNavigation options) + { + InvokeMethodSync("previous", new object[] { ObjectToParam(options) }, new string[] { "Json" }); + } + public async Task SetActiveAsync(double index, IgbHighlightNavigation options) + { + await InvokeMethod("setActive", new object[] { index, ObjectToParam(options) }, new string[] { "Number", "Json" }); + } + public void SetActive(double index, IgbHighlightNavigation options) + { + InvokeMethodSync("setActive", new object[] { index, ObjectToParam(options) }, new string[] { "Number", "Json" }); + } + /// + /// Re-runs the highlight search based on the current `searchText` and `caseSensitive` values. + /// Call this method after the slotted content changes dynamically (e.g. after lazy loading + /// or programmatic DOM mutations) to ensure all matches are up to date. + /// + public async Task SearchAsync() + { + await InvokeMethod("search", new object[] { }, new string[] { }); + } + public void Search() + { + InvokeMethodSync("search", new object[] { }, new string[] { }); + } + + partial void SerializeCoreIgbHighlight(RendererSerializer ser); + + internal override void SerializeCore(RendererSerializer ser) + { + base.SerializeCore(ser); + + SerializeCoreIgbHighlight(ser); + + if (IsPropDirty("CaseSensitive")) + { ser.AddBooleanProp("caseSensitive", this._caseSensitive); } + if (IsPropDirty("SearchText")) + { ser.AddStringProp("searchText", this._searchText); } + + } + + } } diff --git a/src/components/Blazor/HighlightModule.cs b/src/components/Blazor/HighlightModule.cs index 5addb99e..a6c540c2 100644 --- a/src/components/Blazor/HighlightModule.cs +++ b/src/components/Blazor/HighlightModule.cs @@ -1,23 +1,20 @@ -using System; -using System.Collections.Generic; -using System.Runtime.CompilerServices; -using System.Text; -using System.Collections.Generic; - namespace IgniteUI.Blazor.Controls { - public partial class IgbHighlightModule { - public static void Register(IIgniteUIBlazor runtime) { + public partial class IgbHighlightModule + { + public static void Register(IIgniteUIBlazor runtime) + { ModuleLoader.Load(runtime, "WebHighlightModule"); - } - public static void MarkIsLoadRequested(IIgniteUIBlazor runtime) { + public static void MarkIsLoadRequested(IIgniteUIBlazor runtime) + { ModuleLoader.MarkIsLoadRequested(runtime, "WebHighlightModule"); } - public static bool IsLoadRequested(IIgniteUIBlazor runtime) { + public static bool IsLoadRequested(IIgniteUIBlazor runtime) + { return ModuleLoader.IsLoadRequested(runtime, "WebHighlightModule"); } } diff --git a/src/components/Blazor/HighlightNavigation.cs b/src/components/Blazor/HighlightNavigation.cs index 107326e4..ad3def38 100644 --- a/src/components/Blazor/HighlightNavigation.cs +++ b/src/components/Blazor/HighlightNavigation.cs @@ -1,105 +1,102 @@ - -using System; using Microsoft.AspNetCore.Components; -using Microsoft.AspNetCore.Components.Rendering; -using System.Threading.Tasks; -using System.Collections.Generic; -using System.Linq; namespace IgniteUI.Blazor.Controls { - public partial class IgbHighlightNavigation: BaseRendererElement { - public override string Type { get { return "WebHighlightNavigation"; } } - - - private static bool _marshalByValue = true; - - public IgbHighlightNavigation(): base() { - OnCreatedIgbHighlightNavigation(); - - - } - - partial void OnCreatedIgbHighlightNavigation(); - - private bool _preventScroll = false; - - partial void OnPreventScrollChanging(ref bool newValue); - /// - /// If true, prevents the component from scrolling the new active match into view. - /// - [Parameter] - public bool PreventScroll - { - get { return this._preventScroll; } - set { - if (this._preventScroll != value || !IsPropDirty("PreventScroll")) { - MarkPropDirty("PreventScroll"); - } - this._preventScroll = value; - - } - } - - partial void FindByNameHighlightNavigation(string name, ref object item); - public override object FindByName(string name) - { - - var baseResult = base.FindByName(name); - if (baseResult != null) - { - return baseResult; - } - - object item = null; - FindByNameHighlightNavigation(name, ref item); - if (item != null) - { - return item; - } - - return null; - } - public async Task SetNativeElementAsync(Object element) - { - await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); - } - public void SetNativeElement(Object element) - { - InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); - } - - partial void SerializeCoreIgbHighlightNavigation(RendererSerializer ser); - - internal override void SerializeCore(RendererSerializer ser) - { - base.SerializeCore(ser); - - SerializeCoreIgbHighlightNavigation(ser); - - if (IsPropDirty("PreventScroll")) { ser.AddBooleanProp("preventScroll", this._preventScroll); } - - } - - - protected internal override void ToEventJson(BaseRendererControl control, Dictionary args) - { - base.ToEventJson(control, args); - - if (IsPropDirty("PreventScroll")) { args["preventScroll"] = (this._preventScroll).ToString().ToLower(); } - - - } - - - protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) { - base.FromEventJson(control, args); - this.SuppressParentNotify = true; - - if (args.ContainsKey("preventScroll")) { this.PreventScroll = ReturnToBoolean(args["preventScroll"]); } - - this.SuppressParentNotify = false; - } - -} + public partial class IgbHighlightNavigation : BaseRendererElement + { + public override string Type { get { return "WebHighlightNavigation"; } } + + private static bool _marshalByValue = true; + + public IgbHighlightNavigation() : base() + { + OnCreatedIgbHighlightNavigation(); + + } + + partial void OnCreatedIgbHighlightNavigation(); + + private bool _preventScroll = false; + + partial void OnPreventScrollChanging(ref bool newValue); + /// + /// If true, prevents the component from scrolling the new active match into view. + /// + [Parameter] + public bool PreventScroll + { + get { return this._preventScroll; } + set + { + if (this._preventScroll != value || !IsPropDirty("PreventScroll")) + { + MarkPropDirty("PreventScroll"); + } + this._preventScroll = value; + + } + } + + partial void FindByNameHighlightNavigation(string name, ref object item); + public override object FindByName(string name) + { + + var baseResult = base.FindByName(name); + if (baseResult != null) + { + return baseResult; + } + + object item = null; + FindByNameHighlightNavigation(name, ref item); + if (item != null) + { + return item; + } + + return null; + } + public async Task SetNativeElementAsync(Object element) + { + await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + } + public void SetNativeElement(Object element) + { + InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + } + + partial void SerializeCoreIgbHighlightNavigation(RendererSerializer ser); + + internal override void SerializeCore(RendererSerializer ser) + { + base.SerializeCore(ser); + + SerializeCoreIgbHighlightNavigation(ser); + + if (IsPropDirty("PreventScroll")) + { ser.AddBooleanProp("preventScroll", this._preventScroll); } + + } + + protected internal override void ToEventJson(BaseRendererControl control, Dictionary args) + { + base.ToEventJson(control, args); + + if (IsPropDirty("PreventScroll")) + { args["preventScroll"] = (this._preventScroll).ToString().ToLower(); } + + } + + protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) + { + base.FromEventJson(control, args); + this.SuppressParentNotify = true; + + if (args.ContainsKey("preventScroll")) + { this.PreventScroll = ReturnToBoolean(args["preventScroll"]); } + + this.SuppressParentNotify = false; + } + + } } diff --git a/src/components/Blazor/HorizontalTransitionAnimation.cs b/src/components/Blazor/HorizontalTransitionAnimation.cs index 0b5b0867..bd71a112 100644 --- a/src/components/Blazor/HorizontalTransitionAnimation.cs +++ b/src/components/Blazor/HorizontalTransitionAnimation.cs @@ -1,9 +1,10 @@ namespace IgniteUI.Blazor.Controls { -public enum HorizontalTransitionAnimation { - Slide, - Fade, - None + public enum HorizontalTransitionAnimation + { + Slide, + Fade, + None -} + } } diff --git a/src/components/Blazor/Icon.cs b/src/components/Blazor/Icon.cs index 7cdfbf56..e0b5fcd0 100644 --- a/src/components/Blazor/Icon.cs +++ b/src/components/Blazor/Icon.cs @@ -1,190 +1,194 @@ - -using System; using Microsoft.AspNetCore.Components; -using Microsoft.AspNetCore.Components.Rendering; -using System.Threading.Tasks; -using System.Collections.Generic; -using System.Linq; namespace IgniteUI.Blazor.Controls { - /// -/// The icon component allows visualizing collections of pre-registered SVG icons. -/// -public partial class IgbIcon: BaseRendererControl { - public override string Type { get { return "WebIcon"; } } - - protected override void EnsureModulesLoaded() - { - if (!IgbIconModule.IsLoadRequested(IgBlazor)) - { - IgbIconModule.Register(IgBlazor); - } - } - - protected override string ResolveDisplay() - { - return "inline-block"; - } - - protected override bool SupportsVisualChildren - { - get - { - return true; - } - } - - protected override bool UseDirectRender - { - get - { - return true; - } - } - - protected override string DirectRenderElementName - { - get - { - return "igc-icon"; - } - } - - protected override ControlEventBehavior DefaultEventBehavior - { - get { return ControlEventBehavior.Immediate; } - } - - public IgbIcon(): base() { - OnCreatedIgbIcon(); - - - } - - partial void OnCreatedIgbIcon(); - - private string _iconName; - - partial void OnIconNameChanging(ref string newValue); - /// - /// The name of the icon glyph to draw. - /// - [Parameter] - [WCWidgetMemberName("Name")] - public string IconName - { - get { return this._iconName; } - set { - if (this._iconName != value || !IsPropDirty("IconName")) { - MarkPropDirty("IconName"); - } - this._iconName = value; - - } - } - private string _collection; - - partial void OnCollectionChanging(ref string newValue); - /// - /// The name of the registered collection for look up of icons. - /// - [Parameter] - public string Collection - { - get { return this._collection; } - set { - if (this._collection != value || !IsPropDirty("Collection")) { - MarkPropDirty("Collection"); - } - this._collection = value; - - } - } - private bool _mirrored = false; - - partial void OnMirroredChanging(ref bool newValue); - /// - /// Whether to flip the icon horizontally. Useful for RTL (right-to-left) layouts. - /// - [Parameter] - public bool Mirrored - { - get { return this._mirrored; } - set { - if (this._mirrored != value || !IsPropDirty("Mirrored")) { - MarkPropDirty("Mirrored"); - } - this._mirrored = value; - - } - } - - partial void FindByNameIcon(string name, ref object item); - public override object FindByName(string name) - { - - var baseResult = base.FindByName(name); - if (baseResult != null) - { - return baseResult; - } - - object item = null; - FindByNameIcon(name, ref item); - if (item != null) - { - return item; - } - - return null; - } - public async Task SetNativeElementAsync(Object element) - { - await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); - } - public void SetNativeElement(Object element) - { - InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); - } - public async Task RegisterIconAsync(String name, String url, String collection = null) - { - await InvokeMethod("registerIcon", new object[] { StringToString(name), StringToString(url), StringToString(collection) }, new string[] { "String", "String", "String" }); - } - public void RegisterIcon(String name, String url, String collection = null) - { - InvokeMethodSync("registerIcon", new object[] { StringToString(name), StringToString(url), StringToString(collection) }, new string[] { "String", "String", "String" }); - } - public async Task RegisterIconFromTextAsync(String name, String iconText, String collection = null) - { - await InvokeMethod("registerIconFromText", new object[] { StringToString(name), StringToString(iconText), StringToString(collection) }, new string[] { "String", "String", "String" }); - } - public void RegisterIconFromText(String name, String iconText, String collection = null) - { - InvokeMethodSync("registerIconFromText", new object[] { StringToString(name), StringToString(iconText), StringToString(collection) }, new string[] { "String", "String", "String" }); - } - public async Task SetIconRefAsync(String name, String collection, IgbIconMeta icon) - { - await InvokeMethod("setIconRef", new object[] { StringToString(name), StringToString(collection), ObjectToParam(icon) }, new string[] { "String", "String", "Json" }); - } - public void SetIconRef(String name, String collection, IgbIconMeta icon) - { - InvokeMethodSync("setIconRef", new object[] { StringToString(name), StringToString(collection), ObjectToParam(icon) }, new string[] { "String", "String", "Json" }); - } - - partial void SerializeCoreIgbIcon(RendererSerializer ser); - - internal override void SerializeCore(RendererSerializer ser) - { - base.SerializeCore(ser); - - SerializeCoreIgbIcon(ser); - - if (IsPropDirty("IconName")) { ser.AddStringProp("iconName", this._iconName); } - if (IsPropDirty("Collection")) { ser.AddStringProp("collection", this._collection); } - if (IsPropDirty("Mirrored")) { ser.AddBooleanProp("mirrored", this._mirrored); } - - } - -} + /// + /// The icon component allows visualizing collections of pre-registered SVG icons. + /// + public partial class IgbIcon : BaseRendererControl + { + public override string Type { get { return "WebIcon"; } } + + protected override void EnsureModulesLoaded() + { + if (!IgbIconModule.IsLoadRequested(IgBlazor)) + { + IgbIconModule.Register(IgBlazor); + } + } + + protected override string ResolveDisplay() + { + return "inline-block"; + } + + protected override bool SupportsVisualChildren + { + get + { + return true; + } + } + + protected override bool UseDirectRender + { + get + { + return true; + } + } + + protected override string DirectRenderElementName + { + get + { + return "igc-icon"; + } + } + + protected override ControlEventBehavior DefaultEventBehavior + { + get { return ControlEventBehavior.Immediate; } + } + + public IgbIcon() : base() + { + OnCreatedIgbIcon(); + + } + + partial void OnCreatedIgbIcon(); + + private string _iconName; + + partial void OnIconNameChanging(ref string newValue); + /// + /// The name of the icon glyph to draw. + /// + [Parameter] + [WCWidgetMemberName("Name")] + public string IconName + { + get { return this._iconName; } + set + { + if (this._iconName != value || !IsPropDirty("IconName")) + { + MarkPropDirty("IconName"); + } + this._iconName = value; + + } + } + private string _collection; + + partial void OnCollectionChanging(ref string newValue); + /// + /// The name of the registered collection for look up of icons. + /// + [Parameter] + public string Collection + { + get { return this._collection; } + set + { + if (this._collection != value || !IsPropDirty("Collection")) + { + MarkPropDirty("Collection"); + } + this._collection = value; + + } + } + private bool _mirrored = false; + + partial void OnMirroredChanging(ref bool newValue); + /// + /// Whether to flip the icon horizontally. Useful for RTL (right-to-left) layouts. + /// + [Parameter] + public bool Mirrored + { + get { return this._mirrored; } + set + { + if (this._mirrored != value || !IsPropDirty("Mirrored")) + { + MarkPropDirty("Mirrored"); + } + this._mirrored = value; + + } + } + + partial void FindByNameIcon(string name, ref object item); + public override object FindByName(string name) + { + + var baseResult = base.FindByName(name); + if (baseResult != null) + { + return baseResult; + } + + object item = null; + FindByNameIcon(name, ref item); + if (item != null) + { + return item; + } + + return null; + } + public async Task SetNativeElementAsync(Object element) + { + await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + } + public void SetNativeElement(Object element) + { + InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + } + public async Task RegisterIconAsync(String name, String url, String collection = null) + { + await InvokeMethod("registerIcon", new object[] { StringToString(name), StringToString(url), StringToString(collection) }, new string[] { "String", "String", "String" }); + } + public void RegisterIcon(String name, String url, String collection = null) + { + InvokeMethodSync("registerIcon", new object[] { StringToString(name), StringToString(url), StringToString(collection) }, new string[] { "String", "String", "String" }); + } + public async Task RegisterIconFromTextAsync(String name, String iconText, String collection = null) + { + await InvokeMethod("registerIconFromText", new object[] { StringToString(name), StringToString(iconText), StringToString(collection) }, new string[] { "String", "String", "String" }); + } + public void RegisterIconFromText(String name, String iconText, String collection = null) + { + InvokeMethodSync("registerIconFromText", new object[] { StringToString(name), StringToString(iconText), StringToString(collection) }, new string[] { "String", "String", "String" }); + } + public async Task SetIconRefAsync(String name, String collection, IgbIconMeta icon) + { + await InvokeMethod("setIconRef", new object[] { StringToString(name), StringToString(collection), ObjectToParam(icon) }, new string[] { "String", "String", "Json" }); + } + public void SetIconRef(String name, String collection, IgbIconMeta icon) + { + InvokeMethodSync("setIconRef", new object[] { StringToString(name), StringToString(collection), ObjectToParam(icon) }, new string[] { "String", "String", "Json" }); + } + + partial void SerializeCoreIgbIcon(RendererSerializer ser); + + internal override void SerializeCore(RendererSerializer ser) + { + base.SerializeCore(ser); + + SerializeCoreIgbIcon(ser); + + if (IsPropDirty("IconName")) + { ser.AddStringProp("iconName", this._iconName); } + if (IsPropDirty("Collection")) + { ser.AddStringProp("collection", this._collection); } + if (IsPropDirty("Mirrored")) + { ser.AddBooleanProp("mirrored", this._mirrored); } + + } + + } } diff --git a/src/components/Blazor/IconButton.cs b/src/components/Blazor/IconButton.cs index bb1b6a17..fbadad05 100644 --- a/src/components/Blazor/IconButton.cs +++ b/src/components/Blazor/IconButton.cs @@ -1,196 +1,203 @@ - -using System; using Microsoft.AspNetCore.Components; -using Microsoft.AspNetCore.Components.Rendering; -using System.Threading.Tasks; -using System.Collections.Generic; -using System.Linq; namespace IgniteUI.Blazor.Controls { - /// -/// A button that displays a single icon, designed for compact, icon-only -/// interactions such as toolbar actions, floating action buttons, or inline -/// controls. -/// The icon is sourced from the icon registry via the `name` and `collection` -/// attributes. Like the normal button, it can render as an anchor element when -/// `href` is set and is fully form-associated. -/// -public partial class IgbIconButton: IgbButtonBase { - public override string Type { get { return "WebIconButton"; } } - - protected override void EnsureModulesLoaded() - { - if (!IgbIconButtonModule.IsLoadRequested(IgBlazor)) - { - IgbIconButtonModule.Register(IgBlazor); - } - } - - protected override string ResolveDisplay() - { - return "inline-block"; - } - - protected override bool SupportsVisualChildren - { - get - { - return true; - } - } - - protected override bool UseDirectRender - { - get - { - return true; - } - } - - protected override string DirectRenderElementName - { - get - { - return "igc-icon-button"; - } - } - - public IgbIconButton(): base() { - OnCreatedIgbIconButton(); - - - } - - partial void OnCreatedIgbIconButton(); - - private string _iconName; - - partial void OnIconNameChanging(ref string newValue); - /// - /// The name of the icon to display. - /// - [Parameter] - [WCWidgetMemberName("Name")] - public string IconName - { - get { return this._iconName; } - set { - if (this._iconName != value || !IsPropDirty("IconName")) { - MarkPropDirty("IconName"); - } - this._iconName = value; - - } - } - private string _collection; - - partial void OnCollectionChanging(ref string newValue); - /// - /// The collection the icon belongs to. - /// - [Parameter] - public string Collection - { - get { return this._collection; } - set { - if (this._collection != value || !IsPropDirty("Collection")) { - MarkPropDirty("Collection"); - } - this._collection = value; - - } - } - private bool _mirrored = false; - - partial void OnMirroredChanging(ref bool newValue); - /// - /// Determines whether the icon should be mirrored in right-to-left contexts. - /// - [Parameter] - public bool Mirrored - { - get { return this._mirrored; } - set { - if (this._mirrored != value || !IsPropDirty("Mirrored")) { - MarkPropDirty("Mirrored"); - } - this._mirrored = value; - - } - } - private IconButtonVariant _variant = IconButtonVariant.Contained; - - partial void OnVariantChanging(ref IconButtonVariant newValue); - /// - /// The variant of the button which determines its visual appearance. - /// - `contained` – filled background; highest visual emphasis (default). - /// - `outlined` – transparent background with a visible border. - /// - `flat` – no background or border; lowest visual emphasis. - /// - [Parameter] - public IconButtonVariant Variant - { - get { return this._variant; } - set { - if (this._variant != value || !IsPropDirty("Variant")) { - MarkPropDirty("Variant"); - } - this._variant = value; - - } - } - - partial void FindByNameIconButton(string name, ref object item); - public override object FindByName(string name) - { - - var baseResult = base.FindByName(name); - if (baseResult != null) - { - return baseResult; - } - - object item = null; - FindByNameIconButton(name, ref item); - if (item != null) - { - return item; - } - - return null; - } - public async Task RegisterIconAsync(String name, String url, String collection = null) - { - await InvokeMethod("registerIcon", new object[] { StringToString(name), StringToString(url), StringToString(collection) }, new string[] { "String", "String", "String" }); - } - public void RegisterIcon(String name, String url, String collection = null) - { - InvokeMethodSync("registerIcon", new object[] { StringToString(name), StringToString(url), StringToString(collection) }, new string[] { "String", "String", "String" }); - } - public async Task RegisterIconFromTextAsync(String name, String iconText, String collection = null) - { - await InvokeMethod("registerIconFromText", new object[] { StringToString(name), StringToString(iconText), StringToString(collection) }, new string[] { "String", "String", "String" }); - } - public void RegisterIconFromText(String name, String iconText, String collection = null) - { - InvokeMethodSync("registerIconFromText", new object[] { StringToString(name), StringToString(iconText), StringToString(collection) }, new string[] { "String", "String", "String" }); - } - - partial void SerializeCoreIgbIconButton(RendererSerializer ser); - - internal override void SerializeCore(RendererSerializer ser) - { - base.SerializeCore(ser); - - SerializeCoreIgbIconButton(ser); - - if (IsPropDirty("IconName")) { ser.AddStringProp("iconName", this._iconName); } - if (IsPropDirty("Collection")) { ser.AddStringProp("collection", this._collection); } - if (IsPropDirty("Mirrored")) { ser.AddBooleanProp("mirrored", this._mirrored); } - if (IsPropDirty("Variant")) { ser.AddEnumProp("variant", this._variant); } - - } - -} + /// + /// A button that displays a single icon, designed for compact, icon-only + /// interactions such as toolbar actions, floating action buttons, or inline + /// controls. + /// The icon is sourced from the icon registry via the `name` and `collection` + /// attributes. Like the normal button, it can render as an anchor element when + /// `href` is set and is fully form-associated. + /// + public partial class IgbIconButton : IgbButtonBase + { + public override string Type { get { return "WebIconButton"; } } + + protected override void EnsureModulesLoaded() + { + if (!IgbIconButtonModule.IsLoadRequested(IgBlazor)) + { + IgbIconButtonModule.Register(IgBlazor); + } + } + + protected override string ResolveDisplay() + { + return "inline-block"; + } + + protected override bool SupportsVisualChildren + { + get + { + return true; + } + } + + protected override bool UseDirectRender + { + get + { + return true; + } + } + + protected override string DirectRenderElementName + { + get + { + return "igc-icon-button"; + } + } + + public IgbIconButton() : base() + { + OnCreatedIgbIconButton(); + + } + + partial void OnCreatedIgbIconButton(); + + private string _iconName; + + partial void OnIconNameChanging(ref string newValue); + /// + /// The name of the icon to display. + /// + [Parameter] + [WCWidgetMemberName("Name")] + public string IconName + { + get { return this._iconName; } + set + { + if (this._iconName != value || !IsPropDirty("IconName")) + { + MarkPropDirty("IconName"); + } + this._iconName = value; + + } + } + private string _collection; + + partial void OnCollectionChanging(ref string newValue); + /// + /// The collection the icon belongs to. + /// + [Parameter] + public string Collection + { + get { return this._collection; } + set + { + if (this._collection != value || !IsPropDirty("Collection")) + { + MarkPropDirty("Collection"); + } + this._collection = value; + + } + } + private bool _mirrored = false; + + partial void OnMirroredChanging(ref bool newValue); + /// + /// Determines whether the icon should be mirrored in right-to-left contexts. + /// + [Parameter] + public bool Mirrored + { + get { return this._mirrored; } + set + { + if (this._mirrored != value || !IsPropDirty("Mirrored")) + { + MarkPropDirty("Mirrored"); + } + this._mirrored = value; + + } + } + private IconButtonVariant _variant = IconButtonVariant.Contained; + + partial void OnVariantChanging(ref IconButtonVariant newValue); + /// + /// The variant of the button which determines its visual appearance. + /// - `contained` – filled background; highest visual emphasis (default). + /// - `outlined` – transparent background with a visible border. + /// - `flat` – no background or border; lowest visual emphasis. + /// + [Parameter] + public IconButtonVariant Variant + { + get { return this._variant; } + set + { + if (this._variant != value || !IsPropDirty("Variant")) + { + MarkPropDirty("Variant"); + } + this._variant = value; + + } + } + + partial void FindByNameIconButton(string name, ref object item); + public override object FindByName(string name) + { + + var baseResult = base.FindByName(name); + if (baseResult != null) + { + return baseResult; + } + + object item = null; + FindByNameIconButton(name, ref item); + if (item != null) + { + return item; + } + + return null; + } + public async Task RegisterIconAsync(String name, String url, String collection = null) + { + await InvokeMethod("registerIcon", new object[] { StringToString(name), StringToString(url), StringToString(collection) }, new string[] { "String", "String", "String" }); + } + public void RegisterIcon(String name, String url, String collection = null) + { + InvokeMethodSync("registerIcon", new object[] { StringToString(name), StringToString(url), StringToString(collection) }, new string[] { "String", "String", "String" }); + } + public async Task RegisterIconFromTextAsync(String name, String iconText, String collection = null) + { + await InvokeMethod("registerIconFromText", new object[] { StringToString(name), StringToString(iconText), StringToString(collection) }, new string[] { "String", "String", "String" }); + } + public void RegisterIconFromText(String name, String iconText, String collection = null) + { + InvokeMethodSync("registerIconFromText", new object[] { StringToString(name), StringToString(iconText), StringToString(collection) }, new string[] { "String", "String", "String" }); + } + + partial void SerializeCoreIgbIconButton(RendererSerializer ser); + + internal override void SerializeCore(RendererSerializer ser) + { + base.SerializeCore(ser); + + SerializeCoreIgbIconButton(ser); + + if (IsPropDirty("IconName")) + { ser.AddStringProp("iconName", this._iconName); } + if (IsPropDirty("Collection")) + { ser.AddStringProp("collection", this._collection); } + if (IsPropDirty("Mirrored")) + { ser.AddBooleanProp("mirrored", this._mirrored); } + if (IsPropDirty("Variant")) + { ser.AddEnumProp("variant", this._variant); } + + } + + } } diff --git a/src/components/Blazor/IconButtonModule.cs b/src/components/Blazor/IconButtonModule.cs index 8a563c77..72e8034f 100644 --- a/src/components/Blazor/IconButtonModule.cs +++ b/src/components/Blazor/IconButtonModule.cs @@ -1,23 +1,20 @@ -using System; -using System.Collections.Generic; -using System.Runtime.CompilerServices; -using System.Text; -using System.Collections.Generic; - namespace IgniteUI.Blazor.Controls { - public partial class IgbIconButtonModule { - public static void Register(IIgniteUIBlazor runtime) { + public partial class IgbIconButtonModule + { + public static void Register(IIgniteUIBlazor runtime) + { ModuleLoader.Load(runtime, "WebIconButtonModule"); - } - public static void MarkIsLoadRequested(IIgniteUIBlazor runtime) { + public static void MarkIsLoadRequested(IIgniteUIBlazor runtime) + { ModuleLoader.MarkIsLoadRequested(runtime, "WebIconButtonModule"); } - public static bool IsLoadRequested(IIgniteUIBlazor runtime) { + public static bool IsLoadRequested(IIgniteUIBlazor runtime) + { return ModuleLoader.IsLoadRequested(runtime, "WebIconButtonModule"); } } diff --git a/src/components/Blazor/IconButtonVariant.cs b/src/components/Blazor/IconButtonVariant.cs index 87ade86c..28c33aa2 100644 --- a/src/components/Blazor/IconButtonVariant.cs +++ b/src/components/Blazor/IconButtonVariant.cs @@ -1,9 +1,10 @@ namespace IgniteUI.Blazor.Controls { -public enum IconButtonVariant { - Contained, - Flat, - Outlined + public enum IconButtonVariant + { + Contained, + Flat, + Outlined -} + } } diff --git a/src/components/Blazor/IconMeta.cs b/src/components/Blazor/IconMeta.cs index a74ed946..86e204b3 100644 --- a/src/components/Blazor/IconMeta.cs +++ b/src/components/Blazor/IconMeta.cs @@ -1,96 +1,95 @@ - -using System; using Microsoft.AspNetCore.Components; -using Microsoft.AspNetCore.Components.Rendering; -using System.Threading.Tasks; -using System.Collections.Generic; -using System.Linq; namespace IgniteUI.Blazor.Controls { - public partial class IgbIconMeta: BaseRendererElement { - public override string Type { get { return "WebIconMeta"; } } - - - private static bool _marshalByValue = true; - - public IgbIconMeta(): base() { - OnCreatedIgbIconMeta(); - - - } - - partial void OnCreatedIgbIconMeta(); - - private string _collection; - - partial void OnCollectionChanging(ref string newValue); - [Parameter] - public string Collection - { - get { return this._collection; } - set { - if (this._collection != value || !IsPropDirty("Collection")) { - MarkPropDirty("Collection"); - } - this._collection = value; - - } - } - - partial void FindByNameIconMeta(string name, ref object item); - public override object FindByName(string name) - { - - var baseResult = base.FindByName(name); - if (baseResult != null) - { - return baseResult; - } - - object item = null; - FindByNameIconMeta(name, ref item); - if (item != null) - { - return item; - } - - return null; - } - - partial void SerializeCoreIgbIconMeta(RendererSerializer ser); - - internal override void SerializeCore(RendererSerializer ser) - { - base.SerializeCore(ser); - - SerializeCoreIgbIconMeta(ser); - - if (IsPropDirty("Collection")) { ser.AddStringProp("collection", this._collection); } - - } - - - protected internal override void ToEventJson(BaseRendererControl control, Dictionary args) - { - base.ToEventJson(control, args); - - if (IsPropDirty("Name")) { args["name"] = this._name; } - if (IsPropDirty("Collection")) { args["collection"] = this._collection; } - - - } - - - protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) { - base.FromEventJson(control, args); - this.SuppressParentNotify = true; - - if (args.ContainsKey("name")) { this.Name = ReturnToString(args["name"]); } - if (args.ContainsKey("collection")) { this.Collection = ReturnToString(args["collection"]); } - - this.SuppressParentNotify = false; - } - -} + public partial class IgbIconMeta : BaseRendererElement + { + public override string Type { get { return "WebIconMeta"; } } + + private static bool _marshalByValue = true; + + public IgbIconMeta() : base() + { + OnCreatedIgbIconMeta(); + + } + + partial void OnCreatedIgbIconMeta(); + + private string _collection; + + partial void OnCollectionChanging(ref string newValue); + [Parameter] + public string Collection + { + get { return this._collection; } + set + { + if (this._collection != value || !IsPropDirty("Collection")) + { + MarkPropDirty("Collection"); + } + this._collection = value; + + } + } + + partial void FindByNameIconMeta(string name, ref object item); + public override object FindByName(string name) + { + + var baseResult = base.FindByName(name); + if (baseResult != null) + { + return baseResult; + } + + object item = null; + FindByNameIconMeta(name, ref item); + if (item != null) + { + return item; + } + + return null; + } + + partial void SerializeCoreIgbIconMeta(RendererSerializer ser); + + internal override void SerializeCore(RendererSerializer ser) + { + base.SerializeCore(ser); + + SerializeCoreIgbIconMeta(ser); + + if (IsPropDirty("Collection")) + { ser.AddStringProp("collection", this._collection); } + + } + + protected internal override void ToEventJson(BaseRendererControl control, Dictionary args) + { + base.ToEventJson(control, args); + + if (IsPropDirty("Name")) + { args["name"] = this._name; } + if (IsPropDirty("Collection")) + { args["collection"] = this._collection; } + + } + + protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) + { + base.FromEventJson(control, args); + this.SuppressParentNotify = true; + + if (args.ContainsKey("name")) + { this.Name = ReturnToString(args["name"]); } + if (args.ContainsKey("collection")) + { this.Collection = ReturnToString(args["collection"]); } + + this.SuppressParentNotify = false; + } + + } } diff --git a/src/components/Blazor/IconModule.cs b/src/components/Blazor/IconModule.cs index 4d326f02..d6171401 100644 --- a/src/components/Blazor/IconModule.cs +++ b/src/components/Blazor/IconModule.cs @@ -1,23 +1,20 @@ -using System; -using System.Collections.Generic; -using System.Runtime.CompilerServices; -using System.Text; -using System.Collections.Generic; - namespace IgniteUI.Blazor.Controls { - public partial class IgbIconModule { - public static void Register(IIgniteUIBlazor runtime) { + public partial class IgbIconModule + { + public static void Register(IIgniteUIBlazor runtime) + { ModuleLoader.Load(runtime, "WebIconModule"); - } - public static void MarkIsLoadRequested(IIgniteUIBlazor runtime) { + public static void MarkIsLoadRequested(IIgniteUIBlazor runtime) + { ModuleLoader.MarkIsLoadRequested(runtime, "WebIconModule"); } - public static bool IsLoadRequested(IIgniteUIBlazor runtime) { + public static bool IsLoadRequested(IIgniteUIBlazor runtime) + { return ModuleLoader.IsLoadRequested(runtime, "WebIconModule"); } } diff --git a/src/components/Blazor/Input.cs b/src/components/Blazor/Input.cs index b281ee8a..f1ab96e1 100644 --- a/src/components/Blazor/Input.cs +++ b/src/components/Blazor/Input.cs @@ -1,500 +1,542 @@ - -using System; using Microsoft.AspNetCore.Components; -using Microsoft.AspNetCore.Components.Rendering; -using System.Threading.Tasks; -using System.Collections.Generic; -using System.Linq; namespace IgniteUI.Blazor.Controls { - public partial class IgbInput: IgbInputBase { - public override string Type { get { return "WebInput"; } } - - protected override void EnsureModulesLoaded() - { - if (!IgbInputModule.IsLoadRequested(IgBlazor)) - { - IgbInputModule.Register(IgBlazor); - } - } + public partial class IgbInput : IgbInputBase + { + public override string Type { get { return "WebInput"; } } - protected override string ResolveDisplay() - { - return "inline-block"; - } + protected override void EnsureModulesLoaded() + { + if (!IgbInputModule.IsLoadRequested(IgBlazor)) + { + IgbInputModule.Register(IgBlazor); + } + } + + protected override string ResolveDisplay() + { + return "inline-block"; + } + + protected override bool SupportsVisualChildren + { + get + { + return true; + } + } + + protected override bool UseDirectRender + { + get + { + return true; + } + } + + protected override string DirectRenderElementName + { + get + { + return "igc-input"; + } + } + + public IgbInput() : base() + { + OnCreatedIgbInput(); + + } + + partial void OnCreatedIgbInput(); + + private string _value; + + partial void OnValueChanging(ref string newValue); + /// + /// The value of the control. + /// + [Parameter] + public string Value + { + get { return this._value; } + set + { + if (this._value != value || !IsPropDirty("Value")) + { + MarkPropDirty("Value"); + } + this._value = value; + + } + } + public async Task GetCurrentValueAsync() + { + var iv = await InvokeMethod("p:Value", new object[] { }, new string[] { }); + return ReturnToString(iv); + } + public string GetCurrentValue() + { + var iv = InvokeMethodSync("p:Value", new object[] { }, new string[] { }); + return ReturnToString(iv); + } + private InputType _displayType = InputType.Text; + + partial void OnDisplayTypeChanging(ref InputType newValue); + /// + /// The type attribute of the control. + /// + [Parameter] + [WCWidgetMemberName("Type")] + public InputType DisplayType + { + get { return this._displayType; } + set + { + if (this._displayType != value || !IsPropDirty("DisplayType")) + { + MarkPropDirty("DisplayType"); + } + this._displayType = value; + + } + } + private bool _readOnly = false; + + partial void OnReadOnlyChanging(ref bool newValue); + /// + /// Makes the control a readonly field. + /// + [Parameter] + [WCAttributeName("readonly")] + public bool ReadOnly + { + get { return this._readOnly; } + set + { + if (this._readOnly != value || !IsPropDirty("ReadOnly")) + { + MarkPropDirty("ReadOnly"); + } + this._readOnly = value; + + } + } + private string _inputMode; + + partial void OnInputModeChanging(ref string newValue); + /// + /// The input mode attribute of the control. + /// See [relevant MDN article](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/inputmode) + /// + [Parameter] + [WCAttributeName("inputmode")] + public string InputMode + { + get { return this._inputMode; } + set + { + if (this._inputMode != value || !IsPropDirty("InputMode")) + { + MarkPropDirty("InputMode"); + } + this._inputMode = value; + + } + } + private string? _pattern; + + partial void OnPatternChanging(ref string? newValue); + /// + /// The pattern attribute of the control. + /// + [Parameter] + public string? Pattern + { + get { return this._pattern; } + set + { + if (this._pattern != value || !IsPropDirty("Pattern")) + { + MarkPropDirty("Pattern"); + } + this._pattern = value; + + } + } + private double? _minLength = 0; + + partial void OnMinLengthChanging(ref double? newValue); + /// + /// The minimum string length required by the control. + /// + [Parameter] + [WCAttributeName("minlength")] + public double? MinLength + { + get { return this._minLength; } + set + { + if (this._minLength != value || !IsPropDirty("MinLength")) + { + MarkPropDirty("MinLength"); + } + this._minLength = value; + + } + } + private double? _maxLength = 0; + + partial void OnMaxLengthChanging(ref double? newValue); + /// + /// The maximum string length of the control. + /// + [Parameter] + [WCAttributeName("maxlength")] + public double? MaxLength + { + get { return this._maxLength; } + set + { + if (this._maxLength != value || !IsPropDirty("MaxLength")) + { + MarkPropDirty("MaxLength"); + } + this._maxLength = value; + + } + } + private double? _min = 0; + + partial void OnMinChanging(ref double? newValue); + /// + /// The min attribute of the control. + /// + [Parameter] + public double? Min + { + get { return this._min; } + set + { + if (this._min != value || !IsPropDirty("Min")) + { + MarkPropDirty("Min"); + } + this._min = value; + + } + } + private double? _max = 0; + + partial void OnMaxChanging(ref double? newValue); + /// + /// The max attribute of the control. + /// + [Parameter] + public double? Max + { + get { return this._max; } + set + { + if (this._max != value || !IsPropDirty("Max")) + { + MarkPropDirty("Max"); + } + this._max = value; + + } + } + private double? _step = 0; + + partial void OnStepChanging(ref double? newValue); + /// + /// The step attribute of the control. + /// + [Parameter] + public double? Step + { + get { return this._step; } + set + { + if (this._step != value || !IsPropDirty("Step")) + { + MarkPropDirty("Step"); + } + this._step = value; - protected override bool SupportsVisualChildren + } + } + private bool _autofocus = false; + + partial void OnAutofocusChanging(ref bool newValue); + /// + /// The autofocus attribute of the control. + /// + [Parameter] + public bool Autofocus + { + get { return this._autofocus; } + set + { + if (this._autofocus != value || !IsPropDirty("Autofocus")) + { + MarkPropDirty("Autofocus"); + } + this._autofocus = value; + + } + } + private string _autocomplete; + + partial void OnAutocompleteChanging(ref string newValue); + /// + /// The autocomplete attribute of the control. + /// + [Parameter] + public string Autocomplete + { + get { return this._autocomplete; } + set + { + if (this._autocomplete != value || !IsPropDirty("Autocomplete")) + { + MarkPropDirty("Autocomplete"); + } + this._autocomplete = value; + + } + } + private bool _validateOnly = false; + + partial void OnValidateOnlyChanging(ref bool newValue); + /// + /// Enables validation rules to be evaluated without restricting user input. This applies to the `maxLength` property for + /// string-type inputs or allows spin buttons to exceed the predefined `min/max` limits for number-type inputs. + /// + [Parameter] + public bool ValidateOnly + { + get { return this._validateOnly; } + set + { + if (this._validateOnly != value || !IsPropDirty("ValidateOnly")) + { + MarkPropDirty("ValidateOnly"); + } + this._validateOnly = value; + + } + } + + partial void FindByNameInput(string name, ref object item); + public override object FindByName(string name) + { + + var baseResult = base.FindByName(name); + if (baseResult != null) + { + return baseResult; + } + + object item = null; + FindByNameInput(name, ref item); + if (item != null) + { + return item; + } + + return null; + } + /// + /// Increments the numeric value of the input by one or more steps. + /// + public async Task StepUpAsync(double n = -1) + { + await InvokeMethod("stepUp", new object[] { n }, new string[] { "Number" }); + } + public void StepUp(double n = -1) + { + InvokeMethodSync("stepUp", new object[] { n }, new string[] { "Number" }); + } + /// + /// Decrements the numeric value of the input by one or more steps. + /// + public async Task StepDownAsync(double n = -1) + { + await InvokeMethod("stepDown", new object[] { n }, new string[] { "Number" }); + } + public void StepDown(double n = -1) + { + InvokeMethodSync("stepDown", new object[] { n }, new string[] { "Number" }); + } + + private EventCallback? _valueChanged = null; + [Parameter] + public EventCallback ValueChanged + { + get + { + return this._valueChanged != null ? this._valueChanged.Value : EventCallback.Empty; + } + set + { + if (!value.Equals(EventCallback.Empty)) + { + if (!CompareEventCallbacks(value, _valueChanged, ref eventCallbacksCache)) + { + this.EnsureChangeHandled(); + + _valueChanged = value; + } + } + else + { + _valueChanged = null; + } + } + } + + private string _changeRef = null; + private string _changeScript = null; + [Parameter] + public string ChangeScript + { + + set + { + if (value != this._changeScript) + { + this._changeScript = value; + this.OnRefChanged("Change", null, value, true, false, (string refName, object oldValue, object newValue) => + { + this._changeRef = refName; + this.MarkPropDirty("ChangeRef"); + }); + } + } + get + { + return this._changeScript; + } + } + + partial void OnHandlingChange(IgbComponentValueChangedEventArgs args); + private EventCallback? _change = null; + [Parameter] + public EventCallback Change + { + get + { + return this._change != null ? this._change.Value : EventCallback.Empty; + } + set + { + if (!value.Equals(EventCallback.Empty)) + { + if (!CompareEventCallbacks(value, _change, ref eventCallbacksCache)) + { + _change = value; + this.SetHandler(this.Name, "Change", value, (args) => { - get + OnHandlingChange(args); + + var newValueValue = default(string); + + { + newValueValue = (string)(args.Detail); + ; + OnEventUpdatingValue(this._value, ref newValueValue); + if (UseDirectRender) { - return true; + //TODO: maybe we should be doing this for everything. Need to make sure we don't infinity bounce though. + this.Value = newValueValue; } - } - - protected override bool UseDirectRender - { - get + else { - return true; + this._value = newValueValue; } - } + OnPropertyPropagatedOut(Name, "Value"); + } - protected override string DirectRenderElementName - { - get + if (!EventCallback.Empty.Equals(ValueChanged)) + { + var task = ValueChanged.InvokeAsync(newValueValue); + if (task.Exception != null) { - return "igc-input"; + throw task.Exception; } - } - - public IgbInput(): base() { - OnCreatedIgbInput(); - - - } - - partial void OnCreatedIgbInput(); - - private string _value; - - partial void OnValueChanging(ref string newValue); - /// - /// The value of the control. - /// - [Parameter] - public string Value - { - get { return this._value; } - set { - if (this._value != value || !IsPropDirty("Value")) { - MarkPropDirty("Value"); - } - this._value = value; - - } - } - public async Task GetCurrentValueAsync() - { - var iv = await InvokeMethod("p:Value", new object[] { }, new string[] { }); - return ReturnToString(iv); - } - public string GetCurrentValue() - { - var iv = InvokeMethodSync("p:Value", new object[] { }, new string[] { }); - return ReturnToString(iv); - } - private InputType _displayType = InputType.Text; - - partial void OnDisplayTypeChanging(ref InputType newValue); - /// - /// The type attribute of the control. - /// - [Parameter] - [WCWidgetMemberName("Type")] - public InputType DisplayType - { - get { return this._displayType; } - set { - if (this._displayType != value || !IsPropDirty("DisplayType")) { - MarkPropDirty("DisplayType"); - } - this._displayType = value; - - } - } - private bool _readOnly = false; - - partial void OnReadOnlyChanging(ref bool newValue); - /// - /// Makes the control a readonly field. - /// - [Parameter] - [WCAttributeName("readonly")] - public bool ReadOnly - { - get { return this._readOnly; } - set { - if (this._readOnly != value || !IsPropDirty("ReadOnly")) { - MarkPropDirty("ReadOnly"); - } - this._readOnly = value; - - } - } - private string _inputMode; - - partial void OnInputModeChanging(ref string newValue); - /// - /// The input mode attribute of the control. - /// See [relevant MDN article](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/inputmode) - /// - [Parameter] - [WCAttributeName("inputmode")] - public string InputMode - { - get { return this._inputMode; } - set { - if (this._inputMode != value || !IsPropDirty("InputMode")) { - MarkPropDirty("InputMode"); - } - this._inputMode = value; - - } - } - private string? _pattern; - - partial void OnPatternChanging(ref string? newValue); - /// - /// The pattern attribute of the control. - /// - [Parameter] - public string? Pattern - { - get { return this._pattern; } - set { - if (this._pattern != value || !IsPropDirty("Pattern")) { - MarkPropDirty("Pattern"); - } - this._pattern = value; - - } - } - private double? _minLength = 0; - - partial void OnMinLengthChanging(ref double? newValue); - /// - /// The minimum string length required by the control. - /// - [Parameter] - [WCAttributeName("minlength")] - public double? MinLength - { - get { return this._minLength; } - set { - if (this._minLength != value || !IsPropDirty("MinLength")) { - MarkPropDirty("MinLength"); - } - this._minLength = value; - - } - } - private double? _maxLength = 0; - - partial void OnMaxLengthChanging(ref double? newValue); - /// - /// The maximum string length of the control. - /// - [Parameter] - [WCAttributeName("maxlength")] - public double? MaxLength - { - get { return this._maxLength; } - set { - if (this._maxLength != value || !IsPropDirty("MaxLength")) { - MarkPropDirty("MaxLength"); - } - this._maxLength = value; - - } - } - private double? _min = 0; - - partial void OnMinChanging(ref double? newValue); - /// - /// The min attribute of the control. - /// - [Parameter] - public double? Min - { - get { return this._min; } - set { - if (this._min != value || !IsPropDirty("Min")) { - MarkPropDirty("Min"); - } - this._min = value; - - } - } - private double? _max = 0; - - partial void OnMaxChanging(ref double? newValue); - /// - /// The max attribute of the control. - /// - [Parameter] - public double? Max - { - get { return this._max; } - set { - if (this._max != value || !IsPropDirty("Max")) { - MarkPropDirty("Max"); - } - this._max = value; - - } - } - private double? _step = 0; - - partial void OnStepChanging(ref double? newValue); - /// - /// The step attribute of the control. - /// - [Parameter] - public double? Step - { - get { return this._step; } - set { - if (this._step != value || !IsPropDirty("Step")) { - MarkPropDirty("Step"); - } - this._step = value; - - } - } - private bool _autofocus = false; - - partial void OnAutofocusChanging(ref bool newValue); - /// - /// The autofocus attribute of the control. - /// - [Parameter] - public bool Autofocus - { - get { return this._autofocus; } - set { - if (this._autofocus != value || !IsPropDirty("Autofocus")) { - MarkPropDirty("Autofocus"); - } - this._autofocus = value; - - } - } - private string _autocomplete; - - partial void OnAutocompleteChanging(ref string newValue); - /// - /// The autocomplete attribute of the control. - /// - [Parameter] - public string Autocomplete - { - get { return this._autocomplete; } - set { - if (this._autocomplete != value || !IsPropDirty("Autocomplete")) { - MarkPropDirty("Autocomplete"); - } - this._autocomplete = value; - - } - } - private bool _validateOnly = false; - - partial void OnValidateOnlyChanging(ref bool newValue); - /// - /// Enables validation rules to be evaluated without restricting user input. This applies to the `maxLength` property for - /// string-type inputs or allows spin buttons to exceed the predefined `min/max` limits for number-type inputs. - /// - [Parameter] - public bool ValidateOnly - { - get { return this._validateOnly; } - set { - if (this._validateOnly != value || !IsPropDirty("ValidateOnly")) { - MarkPropDirty("ValidateOnly"); - } - this._validateOnly = value; - - } - } - - partial void FindByNameInput(string name, ref object item); - public override object FindByName(string name) - { - - var baseResult = base.FindByName(name); - if (baseResult != null) - { - return baseResult; - } - - object item = null; - FindByNameInput(name, ref item); - if (item != null) - { - return item; - } - - return null; - } - /// - /// Increments the numeric value of the input by one or more steps. - /// - public async Task StepUpAsync(double n = -1) - { - await InvokeMethod("stepUp", new object[] { n }, new string[] { "Number" }); - } - public void StepUp(double n = -1) - { - InvokeMethodSync("stepUp", new object[] { n }, new string[] { "Number" }); - } - /// - /// Decrements the numeric value of the input by one or more steps. - /// - public async Task StepDownAsync(double n = -1) - { - await InvokeMethod("stepDown", new object[] { n }, new string[] { "Number" }); - } - public void StepDown(double n = -1) - { - InvokeMethodSync("stepDown", new object[] { n }, new string[] { "Number" }); - } - - private EventCallback? _valueChanged = null; - [Parameter] - public EventCallback ValueChanged - { - get - { - return this._valueChanged != null ? this._valueChanged.Value : EventCallback.Empty; - } - set - { - if (!value.Equals(EventCallback.Empty)) - { - if (!CompareEventCallbacks(value, _valueChanged, ref eventCallbacksCache)) - { - this.EnsureChangeHandled(); - - _valueChanged = value; - } - } - else - { - _valueChanged = null; - } - } - } - - private string _changeRef = null; - private string _changeScript = null; - [Parameter] - public string ChangeScript { - - set - { - if (value != this._changeScript) - { - this._changeScript = value; - this.OnRefChanged("Change", null, value, true, false, (string refName, object oldValue, object newValue) => { - this._changeRef = refName; - this.MarkPropDirty("ChangeRef"); - }); - } - } - get - { - return this._changeScript; - } - } - - partial void OnHandlingChange(IgbComponentValueChangedEventArgs args); - private EventCallback? _change = null; - [Parameter] - public EventCallback Change - { - get - { - return this._change != null ? this._change.Value : EventCallback.Empty; - } - set - { - if (!value.Equals(EventCallback.Empty)) - { - if (!CompareEventCallbacks(value, _change, ref eventCallbacksCache)) - { - _change = value; - this.SetHandler(this.Name, "Change", value, (args) => { - OnHandlingChange(args); - - var newValueValue = default(string); - - - { - newValueValue = (string)(args.Detail); - ; - OnEventUpdatingValue(this._value, ref newValueValue); - if (UseDirectRender) { - //TODO: maybe we should be doing this for everything. Need to make sure we don't infinity bounce though. - this.Value = newValueValue; - } else { - this._value = newValueValue; - } - OnPropertyPropagatedOut(Name, "Value"); - } - - if (!EventCallback.Empty.Equals(ValueChanged)) - { - var task = ValueChanged.InvokeAsync(newValueValue); - if (task.Exception != null) - { - throw task.Exception; - } - } - - }); - this.OnRefChanged("Change", null, "event:::Change", true, false, (refName, oldValue, newValue) => { - this._changeRef = refName; - this.MarkPropDirty("ChangeRef"); - }); - } - } - else - { - _change = null; - this.SetHandler(this.Name, "Change", null); - this.OnRefChanged("Change", null, null, true, false, (refName, oldValue, newValue) => { - this._changeRef = null; - this.MarkPropDirty("ChangeRef"); - }); - } - } - } - internal void EnsureChangeHandled() - { - if (EventCallback.Empty.Equals(this.Change)) - { - this.Change = new EventCallback(null, (Action)((e) => { })); this._change = null; - } - } - - - partial void OnEventUpdatingValue(string oldValue, ref string newValue); - - partial void SerializeCoreIgbInput(RendererSerializer ser); - - internal override void SerializeCore(RendererSerializer ser) - { - base.SerializeCore(ser); - - SerializeCoreIgbInput(ser); - - if (IsPropDirty("Value")) { ser.AddStringProp("value", this._value); } - if (IsPropDirty("DisplayType")) { ser.AddEnumProp("displayType", this._displayType); } - if (IsPropDirty("ReadOnly")) { ser.AddBooleanProp("readOnly", this._readOnly); } - if (IsPropDirty("InputMode")) { ser.AddStringProp("inputMode", this._inputMode); } - if (IsPropDirty("Pattern")) { ser.AddStringProp("pattern", this._pattern); } - if (IsPropDirty("MinLength")) { ser.AddNumberProp("minLength", this._minLength); } - if (IsPropDirty("MaxLength")) { ser.AddNumberProp("maxLength", this._maxLength); } - if (IsPropDirty("Min")) { ser.AddNumberProp("min", this._min); } - if (IsPropDirty("Max")) { ser.AddNumberProp("max", this._max); } - if (IsPropDirty("Step")) { ser.AddNumberProp("step", this._step); } - if (IsPropDirty("Autofocus")) { ser.AddBooleanProp("autofocus", this._autofocus); } - if (IsPropDirty("Autocomplete")) { ser.AddStringProp("autocomplete", this._autocomplete); } - if (IsPropDirty("ValidateOnly")) { ser.AddBooleanProp("validateOnly", this._validateOnly); } - if (IsPropDirty("ChangeRef")) { ser.AddStringProp("changeRef", this._changeRef); } - - } - -} + } + + }); + this.OnRefChanged("Change", null, "event:::Change", true, false, (refName, oldValue, newValue) => + { + this._changeRef = refName; + this.MarkPropDirty("ChangeRef"); + }); + } + } + else + { + _change = null; + this.SetHandler(this.Name, "Change", null); + this.OnRefChanged("Change", null, null, true, false, (refName, oldValue, newValue) => + { + this._changeRef = null; + this.MarkPropDirty("ChangeRef"); + }); + } + } + } + internal void EnsureChangeHandled() + { + if (EventCallback.Empty.Equals(this.Change)) + { + this.Change = new EventCallback(null, (Action)((e) => { })); + this._change = null; + } + } + + partial void OnEventUpdatingValue(string oldValue, ref string newValue); + + partial void SerializeCoreIgbInput(RendererSerializer ser); + + internal override void SerializeCore(RendererSerializer ser) + { + base.SerializeCore(ser); + + SerializeCoreIgbInput(ser); + + if (IsPropDirty("Value")) + { ser.AddStringProp("value", this._value); } + if (IsPropDirty("DisplayType")) + { ser.AddEnumProp("displayType", this._displayType); } + if (IsPropDirty("ReadOnly")) + { ser.AddBooleanProp("readOnly", this._readOnly); } + if (IsPropDirty("InputMode")) + { ser.AddStringProp("inputMode", this._inputMode); } + if (IsPropDirty("Pattern")) + { ser.AddStringProp("pattern", this._pattern); } + if (IsPropDirty("MinLength")) + { ser.AddNumberProp("minLength", this._minLength); } + if (IsPropDirty("MaxLength")) + { ser.AddNumberProp("maxLength", this._maxLength); } + if (IsPropDirty("Min")) + { ser.AddNumberProp("min", this._min); } + if (IsPropDirty("Max")) + { ser.AddNumberProp("max", this._max); } + if (IsPropDirty("Step")) + { ser.AddNumberProp("step", this._step); } + if (IsPropDirty("Autofocus")) + { ser.AddBooleanProp("autofocus", this._autofocus); } + if (IsPropDirty("Autocomplete")) + { ser.AddStringProp("autocomplete", this._autocomplete); } + if (IsPropDirty("ValidateOnly")) + { ser.AddBooleanProp("validateOnly", this._validateOnly); } + if (IsPropDirty("ChangeRef")) + { ser.AddStringProp("changeRef", this._changeRef); } + + } + + } } diff --git a/src/components/Blazor/InputBase.cs b/src/components/Blazor/InputBase.cs index d1434915..cd7cb73e 100644 --- a/src/components/Blazor/InputBase.cs +++ b/src/components/Blazor/InputBase.cs @@ -1,453 +1,484 @@ - -using System; using Microsoft.AspNetCore.Components; -using Microsoft.AspNetCore.Components.Rendering; -using System.Threading.Tasks; -using System.Collections.Generic; -using System.Linq; namespace IgniteUI.Blazor.Controls { - public partial class IgbInputBase: BaseRendererControl { - public override string Type { get { return "WebInputBase"; } } + public partial class IgbInputBase : BaseRendererControl + { + public override string Type { get { return "WebInputBase"; } } + + protected override string ResolveDisplay() + { + return "inline-block"; + } + + protected override bool SupportsVisualChildren + { + get + { + return true; + } + } + + protected override ControlEventBehavior DefaultEventBehavior + { + get { return ControlEventBehavior.Queued; } + } + + public IgbInputBase() : base() + { + OnCreatedIgbInputBase(); + + } + + partial void OnCreatedIgbInputBase(); + + private bool _outlined = false; + + partial void OnOutlinedChanging(ref bool newValue); + /// + /// Whether the control will have outlined appearance. + /// + [Parameter] + public bool Outlined + { + get { return this._outlined; } + set + { + if (this._outlined != value || !IsPropDirty("Outlined")) + { + MarkPropDirty("Outlined"); + } + this._outlined = value; + + } + } + private string _placeholder; + + partial void OnPlaceholderChanging(ref string newValue); + /// + /// The placeholder attribute of the control. + /// + [Parameter] + public string Placeholder + { + get { return this._placeholder; } + set + { + if (this._placeholder != value || !IsPropDirty("Placeholder")) + { + MarkPropDirty("Placeholder"); + } + this._placeholder = value; + + } + } + private string _label; + + partial void OnLabelChanging(ref string newValue); + /// + /// The label for the control. + /// + [Parameter] + public string Label + { + get { return this._label; } + set + { + if (this._label != value || !IsPropDirty("Label")) + { + MarkPropDirty("Label"); + } + this._label = value; + + } + } + private bool _disabled = false; + + partial void OnDisabledChanging(ref bool newValue); + /// + /// The disabled state of the component + /// + [Parameter] + public bool Disabled + { + get { return this._disabled; } + set + { + if (this._disabled != value || !IsPropDirty("Disabled")) + { + MarkPropDirty("Disabled"); + } + this._disabled = value; + + } + } + private bool _required = false; + + partial void OnRequiredChanging(ref bool newValue); + /// + /// Makes the control a required field in a form context. + /// + [Parameter] + public bool Required + { + get { return this._required; } + set + { + if (this._required != value || !IsPropDirty("Required")) + { + MarkPropDirty("Required"); + } + this._required = value; + + } + } + private bool _invalid = false; + + partial void OnInvalidChanging(ref bool newValue); + /// + /// Control the validity of the control. + /// + [Parameter] + public bool Invalid + { + get { return this._invalid; } + set + { + if (this._invalid != value || !IsPropDirty("Invalid")) + { + MarkPropDirty("Invalid"); + } + this._invalid = value; + + } + } + + partial void FindByNameInputBase(string name, ref object item); + public override object FindByName(string name) + { + + var baseResult = base.FindByName(name); + if (baseResult != null) + { + return baseResult; + } + + object item = null; + FindByNameInputBase(name, ref item); + if (item != null) + { + return item; + } + + return null; + } + public async Task SetNativeElementAsync(Object element) + { + await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + } + public void SetNativeElement(Object element) + { + InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + } + /// + /// Selects all the text inside the input. + /// + public async Task SelectAsync() + { + await InvokeMethod("select", new object[] { }, new string[] { }); + } + public void Select() + { + InvokeMethodSync("select", new object[] { }, new string[] { }); + } + /// + /// Sets focus on the control. + /// + + [WCWidgetMemberName("Focus")] + public async Task FocusComponentAsync(IgbFocusOptions options) + { + await InvokeMethod("focus", new object[] { ObjectToParam(options) }, new string[] { "Json" }); + } - protected override string ResolveDisplay() + [WCWidgetMemberName("Focus")] + public void FocusComponent(IgbFocusOptions options) + { + InvokeMethodSync("focus", new object[] { ObjectToParam(options) }, new string[] { "Json" }); + } + /// + /// Removes focus from the control. + /// + + [WCWidgetMemberName("Blur")] + public async Task BlurComponentAsync() + { + await InvokeMethod("blur", new object[] { }, new string[] { }); + } + + [WCWidgetMemberName("Blur")] + public void BlurComponent() + { + InvokeMethodSync("blur", new object[] { }, new string[] { }); + } + /// + /// Checks for validity of the control and shows the browser message if it invalid. + /// + public async Task ReportValidityAsync() + { + await InvokeMethod("reportValidity", new object[] { }, new string[] { }); + } + public void ReportValidity() + { + InvokeMethodSync("reportValidity", new object[] { }, new string[] { }); + } + /// + /// Checks for validity of the control and emits the invalid event if it invalid. + /// + public async Task CheckValidityAsync() + { + await InvokeMethod("checkValidity", new object[] { }, new string[] { }); + } + public void CheckValidity() + { + InvokeMethodSync("checkValidity", new object[] { }, new string[] { }); + } + /// + /// Sets a custom validation message for the control. + /// As long as `message` is not empty, the control is considered invalid. + /// + public async Task SetCustomValidityAsync(String message) + { + await InvokeMethod("setCustomValidity", new object[] { StringToString(message) }, new string[] { "String" }); + } + public void SetCustomValidity(String message) + { + InvokeMethodSync("setCustomValidity", new object[] { StringToString(message) }, new string[] { "String" }); + } + + private string _inputOcurredRef = null; + private string _inputOcurredScript = null; + [Parameter] + public string InputOcurredScript + { + + set + { + if (value != this._inputOcurredScript) + { + this._inputOcurredScript = value; + this.OnRefChanged("InputOcurred", null, value, true, false, (string refName, object oldValue, object newValue) => + { + this._inputOcurredRef = refName; + this.MarkPropDirty("InputOcurredRef"); + }); + } + } + get + { + return this._inputOcurredScript; + } + } + + partial void OnHandlingInputOcurred(IgbComponentValueChangedEventArgs args); + private EventCallback? _inputOcurred = null; + [Parameter] + public EventCallback InputOcurred + { + get + { + return this._inputOcurred != null ? this._inputOcurred.Value : EventCallback.Empty; + } + set + { + if (!value.Equals(EventCallback.Empty)) + { + if (!CompareEventCallbacks(value, _inputOcurred, ref eventCallbacksCache)) + { + _inputOcurred = value; + this.SetHandler(this.Name, "InputOcurred", value, (args) => { - return "inline-block"; - } + OnHandlingInputOcurred(args); - protected override bool SupportsVisualChildren + }); + this.OnRefChanged("InputOcurred", null, "event:::InputOcurred", true, false, (refName, oldValue, newValue) => { - get - { - return true; - } - } - - protected override ControlEventBehavior DefaultEventBehavior - { - get { return ControlEventBehavior.Queued; } - } - - public IgbInputBase(): base() { - OnCreatedIgbInputBase(); - - - } - - partial void OnCreatedIgbInputBase(); - - private bool _outlined = false; - - partial void OnOutlinedChanging(ref bool newValue); - /// - /// Whether the control will have outlined appearance. - /// - [Parameter] - public bool Outlined - { - get { return this._outlined; } - set { - if (this._outlined != value || !IsPropDirty("Outlined")) { - MarkPropDirty("Outlined"); - } - this._outlined = value; - - } - } - private string _placeholder; - - partial void OnPlaceholderChanging(ref string newValue); - /// - /// The placeholder attribute of the control. - /// - [Parameter] - public string Placeholder - { - get { return this._placeholder; } - set { - if (this._placeholder != value || !IsPropDirty("Placeholder")) { - MarkPropDirty("Placeholder"); - } - this._placeholder = value; - - } - } - private string _label; - - partial void OnLabelChanging(ref string newValue); - /// - /// The label for the control. - /// - [Parameter] - public string Label - { - get { return this._label; } - set { - if (this._label != value || !IsPropDirty("Label")) { - MarkPropDirty("Label"); - } - this._label = value; - - } - } - private bool _disabled = false; - - partial void OnDisabledChanging(ref bool newValue); - /// - /// The disabled state of the component - /// - [Parameter] - public bool Disabled - { - get { return this._disabled; } - set { - if (this._disabled != value || !IsPropDirty("Disabled")) { - MarkPropDirty("Disabled"); - } - this._disabled = value; - - } - } - private bool _required = false; - - partial void OnRequiredChanging(ref bool newValue); - /// - /// Makes the control a required field in a form context. - /// - [Parameter] - public bool Required - { - get { return this._required; } - set { - if (this._required != value || !IsPropDirty("Required")) { - MarkPropDirty("Required"); - } - this._required = value; - - } - } - private bool _invalid = false; - - partial void OnInvalidChanging(ref bool newValue); - /// - /// Control the validity of the control. - /// - [Parameter] - public bool Invalid - { - get { return this._invalid; } - set { - if (this._invalid != value || !IsPropDirty("Invalid")) { - MarkPropDirty("Invalid"); - } - this._invalid = value; - - } - } - - partial void FindByNameInputBase(string name, ref object item); - public override object FindByName(string name) - { - - var baseResult = base.FindByName(name); - if (baseResult != null) - { - return baseResult; - } - - object item = null; - FindByNameInputBase(name, ref item); - if (item != null) - { - return item; - } - - return null; - } - public async Task SetNativeElementAsync(Object element) - { - await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); - } - public void SetNativeElement(Object element) - { - InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); - } - /// - /// Selects all the text inside the input. - /// - public async Task SelectAsync() - { - await InvokeMethod("select", new object[] { }, new string[] { }); - } - public void Select() - { - InvokeMethodSync("select", new object[] { }, new string[] { }); - } - /// - /// Sets focus on the control. - /// - - [WCWidgetMemberName("Focus")] - public async Task FocusComponentAsync(IgbFocusOptions options) - { - await InvokeMethod("focus", new object[] { ObjectToParam(options) }, new string[] { "Json" }); - } - - [WCWidgetMemberName("Focus")] - public void FocusComponent(IgbFocusOptions options) - { - InvokeMethodSync("focus", new object[] { ObjectToParam(options) }, new string[] { "Json" }); - } - /// - /// Removes focus from the control. - /// - - [WCWidgetMemberName("Blur")] - public async Task BlurComponentAsync() - { - await InvokeMethod("blur", new object[] { }, new string[] { }); - } - - [WCWidgetMemberName("Blur")] - public void BlurComponent() - { - InvokeMethodSync("blur", new object[] { }, new string[] { }); - } - /// - /// Checks for validity of the control and shows the browser message if it invalid. - /// - public async Task ReportValidityAsync() - { - await InvokeMethod("reportValidity", new object[] { }, new string[] { }); - } - public void ReportValidity() - { - InvokeMethodSync("reportValidity", new object[] { }, new string[] { }); - } - /// - /// Checks for validity of the control and emits the invalid event if it invalid. - /// - public async Task CheckValidityAsync() - { - await InvokeMethod("checkValidity", new object[] { }, new string[] { }); - } - public void CheckValidity() - { - InvokeMethodSync("checkValidity", new object[] { }, new string[] { }); - } - /// - /// Sets a custom validation message for the control. - /// As long as `message` is not empty, the control is considered invalid. - /// - public async Task SetCustomValidityAsync(String message) - { - await InvokeMethod("setCustomValidity", new object[] { StringToString(message) }, new string[] { "String" }); - } - public void SetCustomValidity(String message) - { - InvokeMethodSync("setCustomValidity", new object[] { StringToString(message) }, new string[] { "String" }); - } - - private string _inputOcurredRef = null; - private string _inputOcurredScript = null; - [Parameter] - public string InputOcurredScript { - - set - { - if (value != this._inputOcurredScript) - { - this._inputOcurredScript = value; - this.OnRefChanged("InputOcurred", null, value, true, false, (string refName, object oldValue, object newValue) => { - this._inputOcurredRef = refName; - this.MarkPropDirty("InputOcurredRef"); - }); - } - } - get - { - return this._inputOcurredScript; - } - } - - partial void OnHandlingInputOcurred(IgbComponentValueChangedEventArgs args); - private EventCallback? _inputOcurred = null; - [Parameter] - public EventCallback InputOcurred - { - get - { - return this._inputOcurred != null ? this._inputOcurred.Value : EventCallback.Empty; - } - set - { - if (!value.Equals(EventCallback.Empty)) - { - if (!CompareEventCallbacks(value, _inputOcurred, ref eventCallbacksCache)) - { - _inputOcurred = value; - this.SetHandler(this.Name, "InputOcurred", value, (args) => { - OnHandlingInputOcurred(args); - - }); - this.OnRefChanged("InputOcurred", null, "event:::InputOcurred", true, false, (refName, oldValue, newValue) => { - this._inputOcurredRef = refName; - this.MarkPropDirty("InputOcurredRef"); - }); - } - } - else - { - _inputOcurred = null; - this.SetHandler(this.Name, "InputOcurred", null); - this.OnRefChanged("InputOcurred", null, null, true, false, (refName, oldValue, newValue) => { - this._inputOcurredRef = null; - this.MarkPropDirty("InputOcurredRef"); - }); - } - } - } - - private string _focusRef = null; - private string _focusScript = null; - [Parameter] - public string FocusScript { - - set - { - if (value != this._focusScript) - { - this._focusScript = value; - this.OnRefChanged("Focus", null, value, true, false, (string refName, object oldValue, object newValue) => { - this._focusRef = refName; - this.MarkPropDirty("FocusRef"); - }); - } - } - get - { - return this._focusScript; - } - } - - partial void OnHandlingFocus(IgbVoidEventArgs args); - private EventCallback? _focus = null; - [Parameter] - public EventCallback Focus - { - get - { - return this._focus != null ? this._focus.Value : EventCallback.Empty; - } - set - { - if (!value.Equals(EventCallback.Empty)) - { - if (!CompareEventCallbacks(value, _focus, ref eventCallbacksCache)) - { - _focus = value; - this.SetHandler(this.Name, "Focus", value, (args) => { - OnHandlingFocus(args); - - }); - this.OnRefChanged("Focus", null, "nativeEvent:::Focus", true, false, (refName, oldValue, newValue) => { - this._focusRef = refName; - this.MarkPropDirty("FocusRef"); - }); - } - } - else - { - _focus = null; - this.SetHandler(this.Name, "Focus", null); - this.OnRefChanged("Focus", null, null, true, false, (refName, oldValue, newValue) => { - this._focusRef = null; - this.MarkPropDirty("FocusRef"); - }); - } - } - } - - private string _blurRef = null; - private string _blurScript = null; - [Parameter] - public string BlurScript { - - set - { - if (value != this._blurScript) - { - this._blurScript = value; - this.OnRefChanged("Blur", null, value, true, false, (string refName, object oldValue, object newValue) => { - this._blurRef = refName; - this.MarkPropDirty("BlurRef"); - }); - } - } - get - { - return this._blurScript; - } - } - - partial void OnHandlingBlur(IgbVoidEventArgs args); - private EventCallback? _blur = null; - [Parameter] - public EventCallback Blur - { - get - { - return this._blur != null ? this._blur.Value : EventCallback.Empty; - } - set - { - if (!value.Equals(EventCallback.Empty)) - { - if (!CompareEventCallbacks(value, _blur, ref eventCallbacksCache)) - { - _blur = value; - this.SetHandler(this.Name, "Blur", value, (args) => { - OnHandlingBlur(args); - - }); - this.OnRefChanged("Blur", null, "nativeEvent:::Blur", true, false, (refName, oldValue, newValue) => { - this._blurRef = refName; - this.MarkPropDirty("BlurRef"); - }); - } - } - else - { - _blur = null; - this.SetHandler(this.Name, "Blur", null); - this.OnRefChanged("Blur", null, null, true, false, (refName, oldValue, newValue) => { - this._blurRef = null; - this.MarkPropDirty("BlurRef"); - }); - } - } - } - - partial void SerializeCoreIgbInputBase(RendererSerializer ser); - - internal override void SerializeCore(RendererSerializer ser) - { - base.SerializeCore(ser); - - SerializeCoreIgbInputBase(ser); - - if (IsPropDirty("Outlined")) { ser.AddBooleanProp("outlined", this._outlined); } - if (IsPropDirty("Placeholder")) { ser.AddStringProp("placeholder", this._placeholder); } - if (IsPropDirty("Label")) { ser.AddStringProp("label", this._label); } - if (IsPropDirty("Disabled")) { ser.AddBooleanProp("disabled", this._disabled); } - if (IsPropDirty("Required")) { ser.AddBooleanProp("required", this._required); } - if (IsPropDirty("Invalid")) { ser.AddBooleanProp("invalid", this._invalid); } - if (IsPropDirty("InputOcurredRef")) { ser.AddStringProp("inputOcurredRef", this._inputOcurredRef); } - if (IsPropDirty("FocusRef")) { ser.AddStringProp("focusRef", this._focusRef); } - if (IsPropDirty("BlurRef")) { ser.AddStringProp("blurRef", this._blurRef); } - - } - -} + this._inputOcurredRef = refName; + this.MarkPropDirty("InputOcurredRef"); + }); + } + } + else + { + _inputOcurred = null; + this.SetHandler(this.Name, "InputOcurred", null); + this.OnRefChanged("InputOcurred", null, null, true, false, (refName, oldValue, newValue) => + { + this._inputOcurredRef = null; + this.MarkPropDirty("InputOcurredRef"); + }); + } + } + } + + private string _focusRef = null; + private string _focusScript = null; + [Parameter] + public string FocusScript + { + + set + { + if (value != this._focusScript) + { + this._focusScript = value; + this.OnRefChanged("Focus", null, value, true, false, (string refName, object oldValue, object newValue) => + { + this._focusRef = refName; + this.MarkPropDirty("FocusRef"); + }); + } + } + get + { + return this._focusScript; + } + } + + partial void OnHandlingFocus(IgbVoidEventArgs args); + private EventCallback? _focus = null; + [Parameter] + public EventCallback Focus + { + get + { + return this._focus != null ? this._focus.Value : EventCallback.Empty; + } + set + { + if (!value.Equals(EventCallback.Empty)) + { + if (!CompareEventCallbacks(value, _focus, ref eventCallbacksCache)) + { + _focus = value; + this.SetHandler(this.Name, "Focus", value, (args) => + { + OnHandlingFocus(args); + + }); + this.OnRefChanged("Focus", null, "nativeEvent:::Focus", true, false, (refName, oldValue, newValue) => + { + this._focusRef = refName; + this.MarkPropDirty("FocusRef"); + }); + } + } + else + { + _focus = null; + this.SetHandler(this.Name, "Focus", null); + this.OnRefChanged("Focus", null, null, true, false, (refName, oldValue, newValue) => + { + this._focusRef = null; + this.MarkPropDirty("FocusRef"); + }); + } + } + } + + private string _blurRef = null; + private string _blurScript = null; + [Parameter] + public string BlurScript + { + + set + { + if (value != this._blurScript) + { + this._blurScript = value; + this.OnRefChanged("Blur", null, value, true, false, (string refName, object oldValue, object newValue) => + { + this._blurRef = refName; + this.MarkPropDirty("BlurRef"); + }); + } + } + get + { + return this._blurScript; + } + } + + partial void OnHandlingBlur(IgbVoidEventArgs args); + private EventCallback? _blur = null; + [Parameter] + public EventCallback Blur + { + get + { + return this._blur != null ? this._blur.Value : EventCallback.Empty; + } + set + { + if (!value.Equals(EventCallback.Empty)) + { + if (!CompareEventCallbacks(value, _blur, ref eventCallbacksCache)) + { + _blur = value; + this.SetHandler(this.Name, "Blur", value, (args) => + { + OnHandlingBlur(args); + + }); + this.OnRefChanged("Blur", null, "nativeEvent:::Blur", true, false, (refName, oldValue, newValue) => + { + this._blurRef = refName; + this.MarkPropDirty("BlurRef"); + }); + } + } + else + { + _blur = null; + this.SetHandler(this.Name, "Blur", null); + this.OnRefChanged("Blur", null, null, true, false, (refName, oldValue, newValue) => + { + this._blurRef = null; + this.MarkPropDirty("BlurRef"); + }); + } + } + } + + partial void SerializeCoreIgbInputBase(RendererSerializer ser); + + internal override void SerializeCore(RendererSerializer ser) + { + base.SerializeCore(ser); + + SerializeCoreIgbInputBase(ser); + + if (IsPropDirty("Outlined")) + { ser.AddBooleanProp("outlined", this._outlined); } + if (IsPropDirty("Placeholder")) + { ser.AddStringProp("placeholder", this._placeholder); } + if (IsPropDirty("Label")) + { ser.AddStringProp("label", this._label); } + if (IsPropDirty("Disabled")) + { ser.AddBooleanProp("disabled", this._disabled); } + if (IsPropDirty("Required")) + { ser.AddBooleanProp("required", this._required); } + if (IsPropDirty("Invalid")) + { ser.AddBooleanProp("invalid", this._invalid); } + if (IsPropDirty("InputOcurredRef")) + { ser.AddStringProp("inputOcurredRef", this._inputOcurredRef); } + if (IsPropDirty("FocusRef")) + { ser.AddStringProp("focusRef", this._focusRef); } + if (IsPropDirty("BlurRef")) + { ser.AddStringProp("blurRef", this._blurRef); } + + } + + } } diff --git a/src/components/Blazor/InputModule.cs b/src/components/Blazor/InputModule.cs index 8c455c39..4fb2788c 100644 --- a/src/components/Blazor/InputModule.cs +++ b/src/components/Blazor/InputModule.cs @@ -1,23 +1,20 @@ -using System; -using System.Collections.Generic; -using System.Runtime.CompilerServices; -using System.Text; -using System.Collections.Generic; - namespace IgniteUI.Blazor.Controls { - public partial class IgbInputModule { - public static void Register(IIgniteUIBlazor runtime) { + public partial class IgbInputModule + { + public static void Register(IIgniteUIBlazor runtime) + { ModuleLoader.Load(runtime, "WebInputModule"); - } - public static void MarkIsLoadRequested(IIgniteUIBlazor runtime) { + public static void MarkIsLoadRequested(IIgniteUIBlazor runtime) + { ModuleLoader.MarkIsLoadRequested(runtime, "WebInputModule"); } - public static bool IsLoadRequested(IIgniteUIBlazor runtime) { + public static bool IsLoadRequested(IIgniteUIBlazor runtime) + { return ModuleLoader.IsLoadRequested(runtime, "WebInputModule"); } } diff --git a/src/components/Blazor/InputType.cs b/src/components/Blazor/InputType.cs index adbda1ed..37e191d2 100644 --- a/src/components/Blazor/InputType.cs +++ b/src/components/Blazor/InputType.cs @@ -1,13 +1,14 @@ namespace IgniteUI.Blazor.Controls { -public enum InputType { - Text, - Email, - Number, - Password, - Search, - Tel, - Url + public enum InputType + { + Text, + Email, + Number, + Password, + Search, + Tel, + Url -} + } } diff --git a/src/components/Blazor/LinearProgress.cs b/src/components/Blazor/LinearProgress.cs index 97143d5d..d4de7d1c 100644 --- a/src/components/Blazor/LinearProgress.cs +++ b/src/components/Blazor/LinearProgress.cs @@ -1,134 +1,135 @@ - -using System; using Microsoft.AspNetCore.Components; -using Microsoft.AspNetCore.Components.Rendering; -using System.Threading.Tasks; -using System.Collections.Generic; -using System.Linq; namespace IgniteUI.Blazor.Controls { - /// -/// A linear progress indicator used to express unspecified wait time or display -/// the length of a process. -/// -public partial class IgbLinearProgress: IgbProgressBase { - public override string Type { get { return "WebLinearProgress"; } } - - protected override void EnsureModulesLoaded() - { - if (!IgbLinearProgressModule.IsLoadRequested(IgBlazor)) - { - IgbLinearProgressModule.Register(IgBlazor); - } - } - - protected override string ResolveDisplay() - { - return "inline-block"; - } - - protected override bool SupportsVisualChildren - { - get - { - return true; - } - } - - protected override bool UseDirectRender - { - get - { - return true; - } - } - - protected override string DirectRenderElementName - { - get - { - return "igc-linear-progress"; - } - } - - public IgbLinearProgress(): base() { - OnCreatedIgbLinearProgress(); - - - } - - partial void OnCreatedIgbLinearProgress(); - - private bool _striped = false; - - partial void OnStripedChanging(ref bool newValue); - /// - /// Sets the striped look of the control. - /// - [Parameter] - public bool Striped - { - get { return this._striped; } - set { - if (this._striped != value || !IsPropDirty("Striped")) { - MarkPropDirty("Striped"); - } - this._striped = value; - - } - } - private LinearProgressLabelAlign _labelAlign = LinearProgressLabelAlign.TopStart; - - partial void OnLabelAlignChanging(ref LinearProgressLabelAlign newValue); - /// - /// The position for the default label of the control. - /// - [Parameter] - public LinearProgressLabelAlign LabelAlign - { - get { return this._labelAlign; } - set { - if (this._labelAlign != value || !IsPropDirty("LabelAlign")) { - MarkPropDirty("LabelAlign"); - } - this._labelAlign = value; - - } - } - - partial void FindByNameLinearProgress(string name, ref object item); - public override object FindByName(string name) - { - - var baseResult = base.FindByName(name); - if (baseResult != null) - { - return baseResult; - } - - object item = null; - FindByNameLinearProgress(name, ref item); - if (item != null) - { - return item; - } - - return null; - } - - partial void SerializeCoreIgbLinearProgress(RendererSerializer ser); - - internal override void SerializeCore(RendererSerializer ser) - { - base.SerializeCore(ser); - - SerializeCoreIgbLinearProgress(ser); - - if (IsPropDirty("Striped")) { ser.AddBooleanProp("striped", this._striped); } - if (IsPropDirty("LabelAlign")) { ser.AddEnumProp("labelAlign", this._labelAlign); } - - } - -} + /// + /// A linear progress indicator used to express unspecified wait time or display + /// the length of a process. + /// + public partial class IgbLinearProgress : IgbProgressBase + { + public override string Type { get { return "WebLinearProgress"; } } + + protected override void EnsureModulesLoaded() + { + if (!IgbLinearProgressModule.IsLoadRequested(IgBlazor)) + { + IgbLinearProgressModule.Register(IgBlazor); + } + } + + protected override string ResolveDisplay() + { + return "inline-block"; + } + + protected override bool SupportsVisualChildren + { + get + { + return true; + } + } + + protected override bool UseDirectRender + { + get + { + return true; + } + } + + protected override string DirectRenderElementName + { + get + { + return "igc-linear-progress"; + } + } + + public IgbLinearProgress() : base() + { + OnCreatedIgbLinearProgress(); + + } + + partial void OnCreatedIgbLinearProgress(); + + private bool _striped = false; + + partial void OnStripedChanging(ref bool newValue); + /// + /// Sets the striped look of the control. + /// + [Parameter] + public bool Striped + { + get { return this._striped; } + set + { + if (this._striped != value || !IsPropDirty("Striped")) + { + MarkPropDirty("Striped"); + } + this._striped = value; + + } + } + private LinearProgressLabelAlign _labelAlign = LinearProgressLabelAlign.TopStart; + + partial void OnLabelAlignChanging(ref LinearProgressLabelAlign newValue); + /// + /// The position for the default label of the control. + /// + [Parameter] + public LinearProgressLabelAlign LabelAlign + { + get { return this._labelAlign; } + set + { + if (this._labelAlign != value || !IsPropDirty("LabelAlign")) + { + MarkPropDirty("LabelAlign"); + } + this._labelAlign = value; + + } + } + + partial void FindByNameLinearProgress(string name, ref object item); + public override object FindByName(string name) + { + + var baseResult = base.FindByName(name); + if (baseResult != null) + { + return baseResult; + } + + object item = null; + FindByNameLinearProgress(name, ref item); + if (item != null) + { + return item; + } + + return null; + } + + partial void SerializeCoreIgbLinearProgress(RendererSerializer ser); + + internal override void SerializeCore(RendererSerializer ser) + { + base.SerializeCore(ser); + + SerializeCoreIgbLinearProgress(ser); + + if (IsPropDirty("Striped")) + { ser.AddBooleanProp("striped", this._striped); } + if (IsPropDirty("LabelAlign")) + { ser.AddEnumProp("labelAlign", this._labelAlign); } + + } + + } } diff --git a/src/components/Blazor/LinearProgressLabelAlign.cs b/src/components/Blazor/LinearProgressLabelAlign.cs index fddc5c06..86c3f6c6 100644 --- a/src/components/Blazor/LinearProgressLabelAlign.cs +++ b/src/components/Blazor/LinearProgressLabelAlign.cs @@ -1,16 +1,17 @@ namespace IgniteUI.Blazor.Controls { -public enum LinearProgressLabelAlign { - [WCEnumName("top-start")] - TopStart, - Top, - [WCEnumName("top-end")] - TopEnd, - [WCEnumName("bottom-start")] - BottomStart, - Bottom, - [WCEnumName("bottom-end")] - BottomEnd + public enum LinearProgressLabelAlign + { + [WCEnumName("top-start")] + TopStart, + Top, + [WCEnumName("top-end")] + TopEnd, + [WCEnumName("bottom-start")] + BottomStart, + Bottom, + [WCEnumName("bottom-end")] + BottomEnd -} + } } diff --git a/src/components/Blazor/LinearProgressModule.cs b/src/components/Blazor/LinearProgressModule.cs index d0e8e880..eb7b5fd8 100644 --- a/src/components/Blazor/LinearProgressModule.cs +++ b/src/components/Blazor/LinearProgressModule.cs @@ -1,23 +1,20 @@ -using System; -using System.Collections.Generic; -using System.Runtime.CompilerServices; -using System.Text; -using System.Collections.Generic; - namespace IgniteUI.Blazor.Controls { - public partial class IgbLinearProgressModule { - public static void Register(IIgniteUIBlazor runtime) { + public partial class IgbLinearProgressModule + { + public static void Register(IIgniteUIBlazor runtime) + { ModuleLoader.Load(runtime, "WebLinearProgressModule"); - } - public static void MarkIsLoadRequested(IIgniteUIBlazor runtime) { + public static void MarkIsLoadRequested(IIgniteUIBlazor runtime) + { ModuleLoader.MarkIsLoadRequested(runtime, "WebLinearProgressModule"); } - public static bool IsLoadRequested(IIgniteUIBlazor runtime) { + public static bool IsLoadRequested(IIgniteUIBlazor runtime) + { return ModuleLoader.IsLoadRequested(runtime, "WebLinearProgressModule"); } } diff --git a/src/components/Blazor/List.cs b/src/components/Blazor/List.cs index 8573b4ab..092d717b 100644 --- a/src/components/Blazor/List.cs +++ b/src/components/Blazor/List.cs @@ -1,108 +1,99 @@ - -using System; -using Microsoft.AspNetCore.Components; -using Microsoft.AspNetCore.Components.Rendering; -using System.Threading.Tasks; -using System.Collections.Generic; -using System.Linq; - namespace IgniteUI.Blazor.Controls { - /// -/// Displays a collection of data items in a templatable list format. -/// -public partial class IgbList: BaseRendererControl { - public override string Type { get { return "WebList"; } } - - protected override void EnsureModulesLoaded() - { - if (!IgbListModule.IsLoadRequested(IgBlazor)) - { - IgbListModule.Register(IgBlazor); - } - } - - protected override string ResolveDisplay() - { - return "inline-block"; - } - - protected override bool SupportsVisualChildren - { - get - { - return true; - } - } - - protected override bool UseDirectRender - { - get - { - return true; - } - } - - protected override string DirectRenderElementName - { - get - { - return "igc-list"; - } - } - - protected override ControlEventBehavior DefaultEventBehavior - { - get { return ControlEventBehavior.Immediate; } - } - - public IgbList(): base() { - OnCreatedIgbList(); - - - } - - partial void OnCreatedIgbList(); - - - partial void FindByNameList(string name, ref object item); - public override object FindByName(string name) - { - - var baseResult = base.FindByName(name); - if (baseResult != null) - { - return baseResult; - } - - object item = null; - FindByNameList(name, ref item); - if (item != null) - { - return item; - } - - return null; - } - public async Task SetNativeElementAsync(Object element) - { - await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); - } - public void SetNativeElement(Object element) - { - InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); - } - - partial void SerializeCoreIgbList(RendererSerializer ser); - - internal override void SerializeCore(RendererSerializer ser) - { - base.SerializeCore(ser); - - SerializeCoreIgbList(ser); - - - } - -} + /// + /// Displays a collection of data items in a templatable list format. + /// + public partial class IgbList : BaseRendererControl + { + public override string Type { get { return "WebList"; } } + + protected override void EnsureModulesLoaded() + { + if (!IgbListModule.IsLoadRequested(IgBlazor)) + { + IgbListModule.Register(IgBlazor); + } + } + + protected override string ResolveDisplay() + { + return "inline-block"; + } + + protected override bool SupportsVisualChildren + { + get + { + return true; + } + } + + protected override bool UseDirectRender + { + get + { + return true; + } + } + + protected override string DirectRenderElementName + { + get + { + return "igc-list"; + } + } + + protected override ControlEventBehavior DefaultEventBehavior + { + get { return ControlEventBehavior.Immediate; } + } + + public IgbList() : base() + { + OnCreatedIgbList(); + + } + + partial void OnCreatedIgbList(); + + partial void FindByNameList(string name, ref object item); + public override object FindByName(string name) + { + + var baseResult = base.FindByName(name); + if (baseResult != null) + { + return baseResult; + } + + object item = null; + FindByNameList(name, ref item); + if (item != null) + { + return item; + } + + return null; + } + public async Task SetNativeElementAsync(Object element) + { + await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + } + public void SetNativeElement(Object element) + { + InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + } + + partial void SerializeCoreIgbList(RendererSerializer ser); + + internal override void SerializeCore(RendererSerializer ser) + { + base.SerializeCore(ser); + + SerializeCoreIgbList(ser); + + } + + } } diff --git a/src/components/Blazor/ListHeader.cs b/src/components/Blazor/ListHeader.cs index b44830a4..2707d566 100644 --- a/src/components/Blazor/ListHeader.cs +++ b/src/components/Blazor/ListHeader.cs @@ -1,108 +1,99 @@ - -using System; -using Microsoft.AspNetCore.Components; -using Microsoft.AspNetCore.Components.Rendering; -using System.Threading.Tasks; -using System.Collections.Generic; -using System.Linq; - namespace IgniteUI.Blazor.Controls { - /// -/// Header list item. -/// -public partial class IgbListHeader: BaseRendererControl { - public override string Type { get { return "WebListHeader"; } } - - protected override void EnsureModulesLoaded() - { - if (!IgbListHeaderModule.IsLoadRequested(IgBlazor)) - { - IgbListHeaderModule.Register(IgBlazor); - } - } - - protected override string ResolveDisplay() - { - return "inline-block"; - } - - protected override bool SupportsVisualChildren - { - get - { - return true; - } - } - - protected override bool UseDirectRender - { - get - { - return true; - } - } - - protected override string DirectRenderElementName - { - get - { - return "igc-list-header"; - } - } - - protected override ControlEventBehavior DefaultEventBehavior - { - get { return ControlEventBehavior.Immediate; } - } - - public IgbListHeader(): base() { - OnCreatedIgbListHeader(); - - - } - - partial void OnCreatedIgbListHeader(); - - - partial void FindByNameListHeader(string name, ref object item); - public override object FindByName(string name) - { - - var baseResult = base.FindByName(name); - if (baseResult != null) - { - return baseResult; - } - - object item = null; - FindByNameListHeader(name, ref item); - if (item != null) - { - return item; - } - - return null; - } - public async Task SetNativeElementAsync(Object element) - { - await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); - } - public void SetNativeElement(Object element) - { - InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); - } - - partial void SerializeCoreIgbListHeader(RendererSerializer ser); - - internal override void SerializeCore(RendererSerializer ser) - { - base.SerializeCore(ser); - - SerializeCoreIgbListHeader(ser); - - - } - -} + /// + /// Header list item. + /// + public partial class IgbListHeader : BaseRendererControl + { + public override string Type { get { return "WebListHeader"; } } + + protected override void EnsureModulesLoaded() + { + if (!IgbListHeaderModule.IsLoadRequested(IgBlazor)) + { + IgbListHeaderModule.Register(IgBlazor); + } + } + + protected override string ResolveDisplay() + { + return "inline-block"; + } + + protected override bool SupportsVisualChildren + { + get + { + return true; + } + } + + protected override bool UseDirectRender + { + get + { + return true; + } + } + + protected override string DirectRenderElementName + { + get + { + return "igc-list-header"; + } + } + + protected override ControlEventBehavior DefaultEventBehavior + { + get { return ControlEventBehavior.Immediate; } + } + + public IgbListHeader() : base() + { + OnCreatedIgbListHeader(); + + } + + partial void OnCreatedIgbListHeader(); + + partial void FindByNameListHeader(string name, ref object item); + public override object FindByName(string name) + { + + var baseResult = base.FindByName(name); + if (baseResult != null) + { + return baseResult; + } + + object item = null; + FindByNameListHeader(name, ref item); + if (item != null) + { + return item; + } + + return null; + } + public async Task SetNativeElementAsync(Object element) + { + await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + } + public void SetNativeElement(Object element) + { + InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + } + + partial void SerializeCoreIgbListHeader(RendererSerializer ser); + + internal override void SerializeCore(RendererSerializer ser) + { + base.SerializeCore(ser); + + SerializeCoreIgbListHeader(ser); + + } + + } } diff --git a/src/components/Blazor/ListHeaderModule.cs b/src/components/Blazor/ListHeaderModule.cs index 84bfb5b0..917029d6 100644 --- a/src/components/Blazor/ListHeaderModule.cs +++ b/src/components/Blazor/ListHeaderModule.cs @@ -1,23 +1,20 @@ -using System; -using System.Collections.Generic; -using System.Runtime.CompilerServices; -using System.Text; -using System.Collections.Generic; - namespace IgniteUI.Blazor.Controls { - public partial class IgbListHeaderModule { - public static void Register(IIgniteUIBlazor runtime) { + public partial class IgbListHeaderModule + { + public static void Register(IIgniteUIBlazor runtime) + { ModuleLoader.Load(runtime, "WebListHeaderModule"); - } - public static void MarkIsLoadRequested(IIgniteUIBlazor runtime) { + public static void MarkIsLoadRequested(IIgniteUIBlazor runtime) + { ModuleLoader.MarkIsLoadRequested(runtime, "WebListHeaderModule"); } - public static bool IsLoadRequested(IIgniteUIBlazor runtime) { + public static bool IsLoadRequested(IIgniteUIBlazor runtime) + { return ModuleLoader.IsLoadRequested(runtime, "WebListHeaderModule"); } } diff --git a/src/components/Blazor/ListItem.cs b/src/components/Blazor/ListItem.cs index 8d752071..0e6505b8 100644 --- a/src/components/Blazor/ListItem.cs +++ b/src/components/Blazor/ListItem.cs @@ -1,128 +1,126 @@ - -using System; using Microsoft.AspNetCore.Components; -using Microsoft.AspNetCore.Components.Rendering; -using System.Threading.Tasks; -using System.Collections.Generic; -using System.Linq; namespace IgniteUI.Blazor.Controls { - /// -/// The list-item component is a container -/// intended for row items in the list component. -/// -public partial class IgbListItem: BaseRendererControl { - public override string Type { get { return "WebListItem"; } } - - protected override void EnsureModulesLoaded() - { - if (!IgbListItemModule.IsLoadRequested(IgBlazor)) - { - IgbListItemModule.Register(IgBlazor); - } - } - - protected override string ResolveDisplay() - { - return "inline-block"; - } - - protected override bool SupportsVisualChildren - { - get - { - return true; - } - } - - protected override bool UseDirectRender - { - get - { - return true; - } - } - - protected override string DirectRenderElementName - { - get - { - return "igc-list-item"; - } - } - - protected override ControlEventBehavior DefaultEventBehavior - { - get { return ControlEventBehavior.Immediate; } - } - - public IgbListItem(): base() { - OnCreatedIgbListItem(); - - - } - - partial void OnCreatedIgbListItem(); - - private bool _selected = false; - - partial void OnSelectedChanging(ref bool newValue); - /// - /// Defines if the list item is selected or not. - /// - [Parameter] - public bool Selected - { - get { return this._selected; } - set { - if (this._selected != value || !IsPropDirty("Selected")) { - MarkPropDirty("Selected"); - } - this._selected = value; - - } - } - - partial void FindByNameListItem(string name, ref object item); - public override object FindByName(string name) - { - - var baseResult = base.FindByName(name); - if (baseResult != null) - { - return baseResult; - } - - object item = null; - FindByNameListItem(name, ref item); - if (item != null) - { - return item; - } - - return null; - } - public async Task SetNativeElementAsync(Object element) - { - await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); - } - public void SetNativeElement(Object element) - { - InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); - } - - partial void SerializeCoreIgbListItem(RendererSerializer ser); - - internal override void SerializeCore(RendererSerializer ser) - { - base.SerializeCore(ser); - - SerializeCoreIgbListItem(ser); - - if (IsPropDirty("Selected")) { ser.AddBooleanProp("selected", this._selected); } - - } - -} + /// + /// The list-item component is a container + /// intended for row items in the list component. + /// + public partial class IgbListItem : BaseRendererControl + { + public override string Type { get { return "WebListItem"; } } + + protected override void EnsureModulesLoaded() + { + if (!IgbListItemModule.IsLoadRequested(IgBlazor)) + { + IgbListItemModule.Register(IgBlazor); + } + } + + protected override string ResolveDisplay() + { + return "inline-block"; + } + + protected override bool SupportsVisualChildren + { + get + { + return true; + } + } + + protected override bool UseDirectRender + { + get + { + return true; + } + } + + protected override string DirectRenderElementName + { + get + { + return "igc-list-item"; + } + } + + protected override ControlEventBehavior DefaultEventBehavior + { + get { return ControlEventBehavior.Immediate; } + } + + public IgbListItem() : base() + { + OnCreatedIgbListItem(); + + } + + partial void OnCreatedIgbListItem(); + + private bool _selected = false; + + partial void OnSelectedChanging(ref bool newValue); + /// + /// Defines if the list item is selected or not. + /// + [Parameter] + public bool Selected + { + get { return this._selected; } + set + { + if (this._selected != value || !IsPropDirty("Selected")) + { + MarkPropDirty("Selected"); + } + this._selected = value; + + } + } + + partial void FindByNameListItem(string name, ref object item); + public override object FindByName(string name) + { + + var baseResult = base.FindByName(name); + if (baseResult != null) + { + return baseResult; + } + + object item = null; + FindByNameListItem(name, ref item); + if (item != null) + { + return item; + } + + return null; + } + public async Task SetNativeElementAsync(Object element) + { + await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + } + public void SetNativeElement(Object element) + { + InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + } + + partial void SerializeCoreIgbListItem(RendererSerializer ser); + + internal override void SerializeCore(RendererSerializer ser) + { + base.SerializeCore(ser); + + SerializeCoreIgbListItem(ser); + + if (IsPropDirty("Selected")) + { ser.AddBooleanProp("selected", this._selected); } + + } + + } } diff --git a/src/components/Blazor/ListItemModule.cs b/src/components/Blazor/ListItemModule.cs index ed68dc82..eccdb054 100644 --- a/src/components/Blazor/ListItemModule.cs +++ b/src/components/Blazor/ListItemModule.cs @@ -1,23 +1,20 @@ -using System; -using System.Collections.Generic; -using System.Runtime.CompilerServices; -using System.Text; -using System.Collections.Generic; - namespace IgniteUI.Blazor.Controls { - public partial class IgbListItemModule { - public static void Register(IIgniteUIBlazor runtime) { + public partial class IgbListItemModule + { + public static void Register(IIgniteUIBlazor runtime) + { ModuleLoader.Load(runtime, "WebListItemModule"); - } - public static void MarkIsLoadRequested(IIgniteUIBlazor runtime) { + public static void MarkIsLoadRequested(IIgniteUIBlazor runtime) + { ModuleLoader.MarkIsLoadRequested(runtime, "WebListItemModule"); } - public static bool IsLoadRequested(IIgniteUIBlazor runtime) { + public static bool IsLoadRequested(IIgniteUIBlazor runtime) + { return ModuleLoader.IsLoadRequested(runtime, "WebListItemModule"); } } diff --git a/src/components/Blazor/ListModule.cs b/src/components/Blazor/ListModule.cs index 6c74e258..dcc2ecc3 100644 --- a/src/components/Blazor/ListModule.cs +++ b/src/components/Blazor/ListModule.cs @@ -1,23 +1,20 @@ -using System; -using System.Collections.Generic; -using System.Runtime.CompilerServices; -using System.Text; -using System.Collections.Generic; - namespace IgniteUI.Blazor.Controls { - public partial class IgbListModule { - public static void Register(IIgniteUIBlazor runtime) { + public partial class IgbListModule + { + public static void Register(IIgniteUIBlazor runtime) + { ModuleLoader.Load(runtime, "WebListModule"); - } - public static void MarkIsLoadRequested(IIgniteUIBlazor runtime) { + public static void MarkIsLoadRequested(IIgniteUIBlazor runtime) + { ModuleLoader.MarkIsLoadRequested(runtime, "WebListModule"); } - public static bool IsLoadRequested(IIgniteUIBlazor runtime) { + public static bool IsLoadRequested(IIgniteUIBlazor runtime) + { return ModuleLoader.IsLoadRequested(runtime, "WebListModule"); } } diff --git a/src/components/Blazor/MaskInput.cs b/src/components/Blazor/MaskInput.cs index 0361ff33..8c82b20c 100644 --- a/src/components/Blazor/MaskInput.cs +++ b/src/components/Blazor/MaskInput.cs @@ -1,328 +1,346 @@ - -using System; using Microsoft.AspNetCore.Components; -using Microsoft.AspNetCore.Components.Rendering; -using System.Threading.Tasks; -using System.Collections.Generic; -using System.Linq; namespace IgniteUI.Blazor.Controls { - /// -/// A masked input is an input field where a developer can control user input and format the visible value, -/// based on configurable rules -/// -public partial class IgbMaskInput: IgbInputBase { - public override string Type { get { return "WebMaskInput"; } } - - protected override void EnsureModulesLoaded() - { - if (!IgbMaskInputModule.IsLoadRequested(IgBlazor)) - { - IgbMaskInputModule.Register(IgBlazor); - } - } + /// + /// A masked input is an input field where a developer can control user input and format the visible value, + /// based on configurable rules + /// + public partial class IgbMaskInput : IgbInputBase + { + public override string Type { get { return "WebMaskInput"; } } - protected override string ResolveDisplay() - { - return "inline-block"; - } + protected override void EnsureModulesLoaded() + { + if (!IgbMaskInputModule.IsLoadRequested(IgBlazor)) + { + IgbMaskInputModule.Register(IgBlazor); + } + } + + protected override string ResolveDisplay() + { + return "inline-block"; + } + + protected override bool SupportsVisualChildren + { + get + { + return true; + } + } + + public IgbMaskInput() : base() + { + OnCreatedIgbMaskInput(); + + } + + partial void OnCreatedIgbMaskInput(); + + private MaskInputValueMode _valueMode = MaskInputValueMode.Raw; + + partial void OnValueModeChanging(ref MaskInputValueMode newValue); + /// + /// Dictates the behavior when retrieving the value of the control: + /// - `raw`: Returns clean input (e.g. "5551234567") + /// - `withFormatting`: Returns with mask formatting (e.g. "(555) 123-4567") + /// Empty values always return an empty string, regardless of the value mode. + /// + [Parameter] + public MaskInputValueMode ValueMode + { + get { return this._valueMode; } + set + { + if (this._valueMode != value || !IsPropDirty("ValueMode")) + { + MarkPropDirty("ValueMode"); + } + this._valueMode = value; + + } + } + private string _value; + + partial void OnValueChanging(ref string newValue); + /// + /// The value of the input. + /// Regardless of the currently set `value-mode`, an empty value will return an empty string. + /// + [Parameter] + public string Value + { + get { return this._value; } + set + { + if (this._value != value || !IsPropDirty("Value")) + { + MarkPropDirty("Value"); + } + this._value = value; + + } + } + public async Task GetCurrentValueAsync() + { + var iv = await InvokeMethod("p:Value", new object[] { }, new string[] { }); + return ReturnToString(iv); + } + public string GetCurrentValue() + { + var iv = InvokeMethodSync("p:Value", new object[] { }, new string[] { }); + return ReturnToString(iv); + } + private string _mask; + + partial void OnMaskChanging(ref string newValue); + /// + /// The masked pattern of the component. + /// + [Parameter] + public string Mask + { + get { return this._mask; } + set + { + if (this._mask != value || !IsPropDirty("Mask")) + { + MarkPropDirty("Mask"); + } + this._mask = value; + + } + } + private string _prompt; + + partial void OnPromptChanging(ref string newValue); + /// + /// The prompt symbol to use for unfilled parts of the mask pattern. + /// + [Parameter] + public string Prompt + { + get { return this._prompt; } + set + { + if (this._prompt != value || !IsPropDirty("Prompt")) + { + MarkPropDirty("Prompt"); + } + this._prompt = value; + + } + } + private bool _readOnly = false; + + partial void OnReadOnlyChanging(ref bool newValue); + /// + /// Makes the control a readonly field. + /// @default false + /// + [Parameter] + public bool ReadOnly + { + get { return this._readOnly; } + set + { + if (this._readOnly != value || !IsPropDirty("ReadOnly")) + { + MarkPropDirty("ReadOnly"); + } + this._readOnly = value; + + } + } + + partial void FindByNameMaskInput(string name, ref object item); + public override object FindByName(string name) + { + + var baseResult = base.FindByName(name); + if (baseResult != null) + { + return baseResult; + } + + object item = null; + FindByNameMaskInput(name, ref item); + if (item != null) + { + return item; + } - protected override bool SupportsVisualChildren + return null; + } + public async Task SetSelectionRangeAsync(double start = -1, double end = -1, String direction = null) + { + await InvokeMethod("setSelectionRange", new object[] { start, end, StringToString(direction) }, new string[] { "Number", "Number", "String" }); + } + public void SetSelectionRange(double start = -1, double end = -1, String direction = null) + { + InvokeMethodSync("setSelectionRange", new object[] { start, end, StringToString(direction) }, new string[] { "Number", "Number", "String" }); + } + public async Task SetRangeTextAsync(String replacement, double start = -1, double end = -1, String selectMode = null) + { + await InvokeMethod("setRangeText", new object[] { StringToString(replacement), start, end, StringToString(selectMode) }, new string[] { "String", "Number", "Number", "String" }); + } + public void SetRangeText(String replacement, double start = -1, double end = -1, String selectMode = null) + { + InvokeMethodSync("setRangeText", new object[] { StringToString(replacement), start, end, StringToString(selectMode) }, new string[] { "String", "Number", "Number", "String" }); + } + + private EventCallback? _valueChanged = null; + [Parameter] + public EventCallback ValueChanged + { + get + { + return this._valueChanged != null ? this._valueChanged.Value : EventCallback.Empty; + } + set + { + if (!value.Equals(EventCallback.Empty)) + { + if (!CompareEventCallbacks(value, _valueChanged, ref eventCallbacksCache)) + { + this.EnsureChangeHandled(); + + _valueChanged = value; + } + } + else + { + _valueChanged = null; + } + } + } + + private string _changeRef = null; + private string _changeScript = null; + [Parameter] + public string ChangeScript + { + + set + { + if (value != this._changeScript) + { + this._changeScript = value; + this.OnRefChanged("Change", null, value, true, false, (string refName, object oldValue, object newValue) => + { + this._changeRef = refName; + this.MarkPropDirty("ChangeRef"); + }); + } + } + get + { + return this._changeScript; + } + } + + partial void OnHandlingChange(IgbComponentValueChangedEventArgs args); + private EventCallback? _change = null; + [Parameter] + public EventCallback Change + { + get + { + return this._change != null ? this._change.Value : EventCallback.Empty; + } + set + { + if (!value.Equals(EventCallback.Empty)) + { + if (!CompareEventCallbacks(value, _change, ref eventCallbacksCache)) + { + _change = value; + this.SetHandler(this.Name, "Change", value, (args) => { - get + OnHandlingChange(args); + + var newValueValue = default(string); + + { + newValueValue = (string)(args.Detail); + ; + OnEventUpdatingValue(this._value, ref newValueValue); + if (UseDirectRender) { - return true; + //TODO: maybe we should be doing this for everything. Need to make sure we don't infinity bounce though. + this.Value = newValueValue; } - } - - public IgbMaskInput(): base() { - OnCreatedIgbMaskInput(); - - - } - - partial void OnCreatedIgbMaskInput(); - - private MaskInputValueMode _valueMode = MaskInputValueMode.Raw; - - partial void OnValueModeChanging(ref MaskInputValueMode newValue); - /// - /// Dictates the behavior when retrieving the value of the control: - /// - `raw`: Returns clean input (e.g. "5551234567") - /// - `withFormatting`: Returns with mask formatting (e.g. "(555) 123-4567") - /// Empty values always return an empty string, regardless of the value mode. - /// - [Parameter] - public MaskInputValueMode ValueMode - { - get { return this._valueMode; } - set { - if (this._valueMode != value || !IsPropDirty("ValueMode")) { - MarkPropDirty("ValueMode"); - } - this._valueMode = value; - - } - } - private string _value; - - partial void OnValueChanging(ref string newValue); - /// - /// The value of the input. - /// Regardless of the currently set `value-mode`, an empty value will return an empty string. - /// - [Parameter] - public string Value - { - get { return this._value; } - set { - if (this._value != value || !IsPropDirty("Value")) { - MarkPropDirty("Value"); - } - this._value = value; - - } - } - public async Task GetCurrentValueAsync() - { - var iv = await InvokeMethod("p:Value", new object[] { }, new string[] { }); - return ReturnToString(iv); - } - public string GetCurrentValue() - { - var iv = InvokeMethodSync("p:Value", new object[] { }, new string[] { }); - return ReturnToString(iv); - } - private string _mask; - - partial void OnMaskChanging(ref string newValue); - /// - /// The masked pattern of the component. - /// - [Parameter] - public string Mask - { - get { return this._mask; } - set { - if (this._mask != value || !IsPropDirty("Mask")) { - MarkPropDirty("Mask"); - } - this._mask = value; - - } - } - private string _prompt; - - partial void OnPromptChanging(ref string newValue); - /// - /// The prompt symbol to use for unfilled parts of the mask pattern. - /// - [Parameter] - public string Prompt - { - get { return this._prompt; } - set { - if (this._prompt != value || !IsPropDirty("Prompt")) { - MarkPropDirty("Prompt"); - } - this._prompt = value; - - } - } - private bool _readOnly = false; - - partial void OnReadOnlyChanging(ref bool newValue); - /// - /// Makes the control a readonly field. - /// @default false - /// - [Parameter] - public bool ReadOnly - { - get { return this._readOnly; } - set { - if (this._readOnly != value || !IsPropDirty("ReadOnly")) { - MarkPropDirty("ReadOnly"); - } - this._readOnly = value; - - } - } - - partial void FindByNameMaskInput(string name, ref object item); - public override object FindByName(string name) - { - - var baseResult = base.FindByName(name); - if (baseResult != null) - { - return baseResult; - } - - object item = null; - FindByNameMaskInput(name, ref item); - if (item != null) - { - return item; - } - - return null; - } - public async Task SetSelectionRangeAsync(double start = -1, double end = -1, String direction = null) - { - await InvokeMethod("setSelectionRange", new object[] { start, end, StringToString(direction) }, new string[] { "Number", "Number", "String" }); - } - public void SetSelectionRange(double start = -1, double end = -1, String direction = null) - { - InvokeMethodSync("setSelectionRange", new object[] { start, end, StringToString(direction) }, new string[] { "Number", "Number", "String" }); - } - public async Task SetRangeTextAsync(String replacement, double start = -1, double end = -1, String selectMode = null) - { - await InvokeMethod("setRangeText", new object[] { StringToString(replacement), start, end, StringToString(selectMode) }, new string[] { "String", "Number", "Number", "String" }); - } - public void SetRangeText(String replacement, double start = -1, double end = -1, String selectMode = null) - { - InvokeMethodSync("setRangeText", new object[] { StringToString(replacement), start, end, StringToString(selectMode) }, new string[] { "String", "Number", "Number", "String" }); - } - - private EventCallback? _valueChanged = null; - [Parameter] - public EventCallback ValueChanged - { - get - { - return this._valueChanged != null ? this._valueChanged.Value : EventCallback.Empty; - } - set - { - if (!value.Equals(EventCallback.Empty)) - { - if (!CompareEventCallbacks(value, _valueChanged, ref eventCallbacksCache)) - { - this.EnsureChangeHandled(); - - _valueChanged = value; - } - } - else - { - _valueChanged = null; - } - } - } - - private string _changeRef = null; - private string _changeScript = null; - [Parameter] - public string ChangeScript { - - set - { - if (value != this._changeScript) - { - this._changeScript = value; - this.OnRefChanged("Change", null, value, true, false, (string refName, object oldValue, object newValue) => { - this._changeRef = refName; - this.MarkPropDirty("ChangeRef"); - }); - } - } - get - { - return this._changeScript; - } - } - - partial void OnHandlingChange(IgbComponentValueChangedEventArgs args); - private EventCallback? _change = null; - [Parameter] - public EventCallback Change - { - get - { - return this._change != null ? this._change.Value : EventCallback.Empty; - } - set - { - if (!value.Equals(EventCallback.Empty)) - { - if (!CompareEventCallbacks(value, _change, ref eventCallbacksCache)) - { - _change = value; - this.SetHandler(this.Name, "Change", value, (args) => { - OnHandlingChange(args); - - var newValueValue = default(string); - - - { - newValueValue = (string)(args.Detail); - ; - OnEventUpdatingValue(this._value, ref newValueValue); - if (UseDirectRender) { - //TODO: maybe we should be doing this for everything. Need to make sure we don't infinity bounce though. - this.Value = newValueValue; - } else { - this._value = newValueValue; - } - OnPropertyPropagatedOut(Name, "Value"); - } - - if (!EventCallback.Empty.Equals(ValueChanged)) - { - var task = ValueChanged.InvokeAsync(newValueValue); - if (task.Exception != null) - { - throw task.Exception; - } - } - - }); - this.OnRefChanged("Change", null, "event:::Change", true, false, (refName, oldValue, newValue) => { - this._changeRef = refName; - this.MarkPropDirty("ChangeRef"); - }); - } - } - else - { - _change = null; - this.SetHandler(this.Name, "Change", null); - this.OnRefChanged("Change", null, null, true, false, (refName, oldValue, newValue) => { - this._changeRef = null; - this.MarkPropDirty("ChangeRef"); - }); - } - } - } - internal void EnsureChangeHandled() - { - if (EventCallback.Empty.Equals(this.Change)) - { - this.Change = new EventCallback(null, (Action)((e) => { })); this._change = null; - } - } - - - partial void OnEventUpdatingValue(string oldValue, ref string newValue); - - partial void SerializeCoreIgbMaskInput(RendererSerializer ser); - - internal override void SerializeCore(RendererSerializer ser) - { - base.SerializeCore(ser); - - SerializeCoreIgbMaskInput(ser); - - if (IsPropDirty("ValueMode")) { ser.AddEnumProp("valueMode", this._valueMode); } - if (IsPropDirty("Value")) { ser.AddStringProp("value", this._value); } - if (IsPropDirty("Mask")) { ser.AddStringProp("mask", this._mask); } - if (IsPropDirty("Prompt")) { ser.AddStringProp("prompt", this._prompt); } - if (IsPropDirty("ReadOnly")) { ser.AddBooleanProp("readOnly", this._readOnly); } - if (IsPropDirty("ChangeRef")) { ser.AddStringProp("changeRef", this._changeRef); } - - } - -} + else + { + this._value = newValueValue; + } + OnPropertyPropagatedOut(Name, "Value"); + } + + if (!EventCallback.Empty.Equals(ValueChanged)) + { + var task = ValueChanged.InvokeAsync(newValueValue); + if (task.Exception != null) + { + throw task.Exception; + } + } + + }); + this.OnRefChanged("Change", null, "event:::Change", true, false, (refName, oldValue, newValue) => + { + this._changeRef = refName; + this.MarkPropDirty("ChangeRef"); + }); + } + } + else + { + _change = null; + this.SetHandler(this.Name, "Change", null); + this.OnRefChanged("Change", null, null, true, false, (refName, oldValue, newValue) => + { + this._changeRef = null; + this.MarkPropDirty("ChangeRef"); + }); + } + } + } + internal void EnsureChangeHandled() + { + if (EventCallback.Empty.Equals(this.Change)) + { + this.Change = new EventCallback(null, (Action)((e) => { })); + this._change = null; + } + } + + partial void OnEventUpdatingValue(string oldValue, ref string newValue); + + partial void SerializeCoreIgbMaskInput(RendererSerializer ser); + + internal override void SerializeCore(RendererSerializer ser) + { + base.SerializeCore(ser); + + SerializeCoreIgbMaskInput(ser); + + if (IsPropDirty("ValueMode")) + { ser.AddEnumProp("valueMode", this._valueMode); } + if (IsPropDirty("Value")) + { ser.AddStringProp("value", this._value); } + if (IsPropDirty("Mask")) + { ser.AddStringProp("mask", this._mask); } + if (IsPropDirty("Prompt")) + { ser.AddStringProp("prompt", this._prompt); } + if (IsPropDirty("ReadOnly")) + { ser.AddBooleanProp("readOnly", this._readOnly); } + if (IsPropDirty("ChangeRef")) + { ser.AddStringProp("changeRef", this._changeRef); } + + } + + } } diff --git a/src/components/Blazor/MaskInputModule.cs b/src/components/Blazor/MaskInputModule.cs index 3a775846..977ba948 100644 --- a/src/components/Blazor/MaskInputModule.cs +++ b/src/components/Blazor/MaskInputModule.cs @@ -1,23 +1,20 @@ -using System; -using System.Collections.Generic; -using System.Runtime.CompilerServices; -using System.Text; -using System.Collections.Generic; - namespace IgniteUI.Blazor.Controls { - public partial class IgbMaskInputModule { - public static void Register(IIgniteUIBlazor runtime) { + public partial class IgbMaskInputModule + { + public static void Register(IIgniteUIBlazor runtime) + { ModuleLoader.Load(runtime, "WebMaskInputModule"); - } - public static void MarkIsLoadRequested(IIgniteUIBlazor runtime) { + public static void MarkIsLoadRequested(IIgniteUIBlazor runtime) + { ModuleLoader.MarkIsLoadRequested(runtime, "WebMaskInputModule"); } - public static bool IsLoadRequested(IIgniteUIBlazor runtime) { + public static bool IsLoadRequested(IIgniteUIBlazor runtime) + { return ModuleLoader.IsLoadRequested(runtime, "WebMaskInputModule"); } } diff --git a/src/components/Blazor/MaskInputValueMode.cs b/src/components/Blazor/MaskInputValueMode.cs index b399a822..1c9da8c9 100644 --- a/src/components/Blazor/MaskInputValueMode.cs +++ b/src/components/Blazor/MaskInputValueMode.cs @@ -1,8 +1,9 @@ namespace IgniteUI.Blazor.Controls { -public enum MaskInputValueMode { - Raw, - WithFormatting + public enum MaskInputValueMode + { + Raw, + WithFormatting -} + } } diff --git a/src/components/Blazor/NavDrawer.cs b/src/components/Blazor/NavDrawer.cs index 734c025c..41be9133 100644 --- a/src/components/Blazor/NavDrawer.cs +++ b/src/components/Blazor/NavDrawer.cs @@ -1,346 +1,365 @@ - -using System; using Microsoft.AspNetCore.Components; -using Microsoft.AspNetCore.Components.Rendering; -using System.Threading.Tasks; -using System.Collections.Generic; -using System.Linq; namespace IgniteUI.Blazor.Controls { - public partial class IgbNavDrawer: BaseRendererControl { - public override string Type { get { return "WebNavDrawer"; } } - - protected override void EnsureModulesLoaded() - { - if (!IgbNavDrawerModule.IsLoadRequested(IgBlazor)) - { - IgbNavDrawerModule.Register(IgBlazor); - } - } - - protected override string ResolveDisplay() + public partial class IgbNavDrawer : BaseRendererControl + { + public override string Type { get { return "WebNavDrawer"; } } + + protected override void EnsureModulesLoaded() + { + if (!IgbNavDrawerModule.IsLoadRequested(IgBlazor)) + { + IgbNavDrawerModule.Register(IgBlazor); + } + } + + protected override string ResolveDisplay() + { + return "inline-block"; + } + + protected override bool SupportsVisualChildren + { + get + { + return true; + } + } + + protected override bool UseDirectRender + { + get + { + return true; + } + } + + protected override string DirectRenderElementName + { + get + { + return "igc-nav-drawer"; + } + } + + protected override ControlEventBehavior DefaultEventBehavior + { + get { return ControlEventBehavior.Immediate; } + } + + public IgbNavDrawer() : base() + { + OnCreatedIgbNavDrawer(); + + } + + partial void OnCreatedIgbNavDrawer(); + + private NavDrawerPosition _position = NavDrawerPosition.Start; + + partial void OnPositionChanging(ref NavDrawerPosition newValue); + /// + /// Sets the position of the drawer. + /// - `start` — anchored to the inline-start edge (default). + /// - `end` — anchored to the inline-end edge. + /// - `top` — anchored to the block-start edge. + /// - `bottom` — anchored to the block-end edge. + /// - `relative` — rendered inline within the page flow; no modal backdrop. + /// + [Parameter] + public NavDrawerPosition Position + { + get { return this._position; } + set + { + if (this._position != value || !IsPropDirty("Position")) + { + MarkPropDirty("Position"); + } + this._position = value; + + } + } + private bool _open = false; + + partial void OnOpenChanging(ref bool newValue); + /// + /// Whether the drawer is open. + /// + [Parameter] + public bool Open + { + get { return this._open; } + set + { + if (this._open != value || !IsPropDirty("Open")) + { + MarkPropDirty("Open"); + } + this._open = value; + + } + } + private bool _keepOpenOnEscape = false; + + partial void OnKeepOpenOnEscapeChanging(ref bool newValue); + /// + /// Determines whether the drawer should remain open when the Escape key is pressed. + /// This attribute is only applicable when the drawer is in a non-relative position, + /// as the Escape key does not trigger the closing of relative drawers. + /// + [Parameter] + public bool KeepOpenOnEscape + { + get { return this._keepOpenOnEscape; } + set + { + if (this._keepOpenOnEscape != value || !IsPropDirty("KeepOpenOnEscape")) + { + MarkPropDirty("KeepOpenOnEscape"); + } + this._keepOpenOnEscape = value; + + } + } + private string _label; + + partial void OnLabelChanging(ref string newValue); + [Parameter] + public string Label + { + get { return this._label; } + set + { + if (this._label != value || !IsPropDirty("Label")) + { + MarkPropDirty("Label"); + } + this._label = value; + + } + } + + partial void FindByNameNavDrawer(string name, ref object item); + public override object FindByName(string name) + { + + var baseResult = base.FindByName(name); + if (baseResult != null) + { + return baseResult; + } + + object item = null; + FindByNameNavDrawer(name, ref item); + if (item != null) + { + return item; + } + + return null; + } + public async Task SetNativeElementAsync(Object element) + { + await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + } + public void SetNativeElement(Object element) + { + InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + } + /// + /// Opens the drawer. Returns `true` if the operation was successful, `false` if the drawer was already open. + /// + public async Task ShowAsync() + { + var iv = await InvokeMethod("show", new object[] { }, new string[] { }); + return ReturnToBoolean(iv); + } + public bool Show() + { + var iv = InvokeMethodSync("show", new object[] { }, new string[] { }); + return ReturnToBoolean(iv); + } + /// + /// Closes the drawer. Returns `true` if the operation was successful, `false` if the drawer was already closed. + /// + public async Task HideAsync() + { + var iv = await InvokeMethod("hide", new object[] { }, new string[] { }); + return ReturnToBoolean(iv); + } + public bool Hide() + { + var iv = InvokeMethodSync("hide", new object[] { }, new string[] { }); + return ReturnToBoolean(iv); + } + /// + /// Toggles the open state of the drawer. Delegates to `show()` or `hide()` depending on the current state. + /// + public async Task ToggleAsync() + { + var iv = await InvokeMethod("toggle", new object[] { }, new string[] { }); + return ReturnToBoolean(iv); + } + public bool Toggle() + { + var iv = InvokeMethodSync("toggle", new object[] { }, new string[] { }); + return ReturnToBoolean(iv); + } + + private string _closingRef = null; + private string _closingScript = null; + [Parameter] + public string ClosingScript + { + + set + { + if (value != this._closingScript) + { + this._closingScript = value; + this.OnRefChanged("Closing", null, value, true, false, (string refName, object oldValue, object newValue) => + { + this._closingRef = refName; + this.MarkPropDirty("ClosingRef"); + }); + } + } + get + { + return this._closingScript; + } + } + + partial void OnHandlingClosing(IgbVoidEventArgs args); + private EventCallback? _closing = null; + [Parameter] + public EventCallback Closing + { + get + { + return this._closing != null ? this._closing.Value : EventCallback.Empty; + } + set + { + if (!value.Equals(EventCallback.Empty)) + { + if (!CompareEventCallbacks(value, _closing, ref eventCallbacksCache)) + { + _closing = value; + this.SetHandler(this.Name, "Closing", value, (args) => { - return "inline-block"; - } + OnHandlingClosing(args); - protected override bool SupportsVisualChildren + }); + this.OnRefChanged("Closing", null, "event:::Closing", true, false, (refName, oldValue, newValue) => { - get - { - return true; - } - } + this._closingRef = refName; + this.MarkPropDirty("ClosingRef"); + }); + } + } + else + { + _closing = null; + this.SetHandler(this.Name, "Closing", null); + this.OnRefChanged("Closing", null, null, true, false, (refName, oldValue, newValue) => + { + this._closingRef = null; + this.MarkPropDirty("ClosingRef"); + }); + } + } + } + + private string _closedRef = null; + private string _closedScript = null; + [Parameter] + public string ClosedScript + { - protected override bool UseDirectRender + set + { + if (value != this._closedScript) + { + this._closedScript = value; + this.OnRefChanged("Closed", null, value, true, false, (string refName, object oldValue, object newValue) => + { + this._closedRef = refName; + this.MarkPropDirty("ClosedRef"); + }); + } + } + get + { + return this._closedScript; + } + } + + partial void OnHandlingClosed(IgbVoidEventArgs args); + private EventCallback? _closed = null; + [Parameter] + public EventCallback Closed + { + get + { + return this._closed != null ? this._closed.Value : EventCallback.Empty; + } + set + { + if (!value.Equals(EventCallback.Empty)) + { + if (!CompareEventCallbacks(value, _closed, ref eventCallbacksCache)) + { + _closed = value; + this.SetHandler(this.Name, "Closed", value, (args) => { - get - { - return true; - } - } + OnHandlingClosed(args); - protected override string DirectRenderElementName + }); + this.OnRefChanged("Closed", null, "event:::Closed", true, false, (refName, oldValue, newValue) => { - get - { - return "igc-nav-drawer"; - } - } - - protected override ControlEventBehavior DefaultEventBehavior - { - get { return ControlEventBehavior.Immediate; } - } - - public IgbNavDrawer(): base() { - OnCreatedIgbNavDrawer(); - - - } - - partial void OnCreatedIgbNavDrawer(); - - private NavDrawerPosition _position = NavDrawerPosition.Start; - - partial void OnPositionChanging(ref NavDrawerPosition newValue); - /// - /// Sets the position of the drawer. - /// - `start` — anchored to the inline-start edge (default). - /// - `end` — anchored to the inline-end edge. - /// - `top` — anchored to the block-start edge. - /// - `bottom` — anchored to the block-end edge. - /// - `relative` — rendered inline within the page flow; no modal backdrop. - /// - [Parameter] - public NavDrawerPosition Position - { - get { return this._position; } - set { - if (this._position != value || !IsPropDirty("Position")) { - MarkPropDirty("Position"); - } - this._position = value; - - } - } - private bool _open = false; - - partial void OnOpenChanging(ref bool newValue); - /// - /// Whether the drawer is open. - /// - [Parameter] - public bool Open - { - get { return this._open; } - set { - if (this._open != value || !IsPropDirty("Open")) { - MarkPropDirty("Open"); - } - this._open = value; - - } - } - private bool _keepOpenOnEscape = false; - - partial void OnKeepOpenOnEscapeChanging(ref bool newValue); - /// - /// Determines whether the drawer should remain open when the Escape key is pressed. - /// This attribute is only applicable when the drawer is in a non-relative position, - /// as the Escape key does not trigger the closing of relative drawers. - /// - [Parameter] - public bool KeepOpenOnEscape - { - get { return this._keepOpenOnEscape; } - set { - if (this._keepOpenOnEscape != value || !IsPropDirty("KeepOpenOnEscape")) { - MarkPropDirty("KeepOpenOnEscape"); - } - this._keepOpenOnEscape = value; - - } - } - private string _label; - - partial void OnLabelChanging(ref string newValue); - [Parameter] - public string Label - { - get { return this._label; } - set { - if (this._label != value || !IsPropDirty("Label")) { - MarkPropDirty("Label"); - } - this._label = value; - - } - } - - partial void FindByNameNavDrawer(string name, ref object item); - public override object FindByName(string name) - { - - var baseResult = base.FindByName(name); - if (baseResult != null) - { - return baseResult; - } - - object item = null; - FindByNameNavDrawer(name, ref item); - if (item != null) - { - return item; - } - - return null; - } - public async Task SetNativeElementAsync(Object element) - { - await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); - } - public void SetNativeElement(Object element) - { - InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); - } - /// - /// Opens the drawer. Returns `true` if the operation was successful, `false` if the drawer was already open. - /// - public async Task ShowAsync() - { - var iv = await InvokeMethod("show", new object[] { }, new string[] { }); - return ReturnToBoolean(iv); - } - public bool Show() - { - var iv = InvokeMethodSync("show", new object[] { }, new string[] { }); - return ReturnToBoolean(iv); - } - /// - /// Closes the drawer. Returns `true` if the operation was successful, `false` if the drawer was already closed. - /// - public async Task HideAsync() - { - var iv = await InvokeMethod("hide", new object[] { }, new string[] { }); - return ReturnToBoolean(iv); - } - public bool Hide() - { - var iv = InvokeMethodSync("hide", new object[] { }, new string[] { }); - return ReturnToBoolean(iv); - } - /// - /// Toggles the open state of the drawer. Delegates to `show()` or `hide()` depending on the current state. - /// - public async Task ToggleAsync() - { - var iv = await InvokeMethod("toggle", new object[] { }, new string[] { }); - return ReturnToBoolean(iv); - } - public bool Toggle() - { - var iv = InvokeMethodSync("toggle", new object[] { }, new string[] { }); - return ReturnToBoolean(iv); - } - - private string _closingRef = null; - private string _closingScript = null; - [Parameter] - public string ClosingScript { - - set - { - if (value != this._closingScript) - { - this._closingScript = value; - this.OnRefChanged("Closing", null, value, true, false, (string refName, object oldValue, object newValue) => { - this._closingRef = refName; - this.MarkPropDirty("ClosingRef"); - }); - } - } - get - { - return this._closingScript; - } - } - - partial void OnHandlingClosing(IgbVoidEventArgs args); - private EventCallback? _closing = null; - [Parameter] - public EventCallback Closing - { - get - { - return this._closing != null ? this._closing.Value : EventCallback.Empty; - } - set - { - if (!value.Equals(EventCallback.Empty)) - { - if (!CompareEventCallbacks(value, _closing, ref eventCallbacksCache)) - { - _closing = value; - this.SetHandler(this.Name, "Closing", value, (args) => { - OnHandlingClosing(args); - - }); - this.OnRefChanged("Closing", null, "event:::Closing", true, false, (refName, oldValue, newValue) => { - this._closingRef = refName; - this.MarkPropDirty("ClosingRef"); - }); - } - } - else - { - _closing = null; - this.SetHandler(this.Name, "Closing", null); - this.OnRefChanged("Closing", null, null, true, false, (refName, oldValue, newValue) => { - this._closingRef = null; - this.MarkPropDirty("ClosingRef"); - }); - } - } - } - - private string _closedRef = null; - private string _closedScript = null; - [Parameter] - public string ClosedScript { - - set - { - if (value != this._closedScript) - { - this._closedScript = value; - this.OnRefChanged("Closed", null, value, true, false, (string refName, object oldValue, object newValue) => { - this._closedRef = refName; - this.MarkPropDirty("ClosedRef"); - }); - } - } - get - { - return this._closedScript; - } - } - - partial void OnHandlingClosed(IgbVoidEventArgs args); - private EventCallback? _closed = null; - [Parameter] - public EventCallback Closed - { - get - { - return this._closed != null ? this._closed.Value : EventCallback.Empty; - } - set - { - if (!value.Equals(EventCallback.Empty)) - { - if (!CompareEventCallbacks(value, _closed, ref eventCallbacksCache)) - { - _closed = value; - this.SetHandler(this.Name, "Closed", value, (args) => { - OnHandlingClosed(args); - - }); - this.OnRefChanged("Closed", null, "event:::Closed", true, false, (refName, oldValue, newValue) => { - this._closedRef = refName; - this.MarkPropDirty("ClosedRef"); - }); - } - } - else - { - _closed = null; - this.SetHandler(this.Name, "Closed", null); - this.OnRefChanged("Closed", null, null, true, false, (refName, oldValue, newValue) => { - this._closedRef = null; - this.MarkPropDirty("ClosedRef"); - }); - } - } - } - - partial void SerializeCoreIgbNavDrawer(RendererSerializer ser); - - internal override void SerializeCore(RendererSerializer ser) - { - base.SerializeCore(ser); - - SerializeCoreIgbNavDrawer(ser); - - if (IsPropDirty("Position")) { ser.AddEnumProp("position", this._position); } - if (IsPropDirty("Open")) { ser.AddBooleanProp("open", this._open); } - if (IsPropDirty("KeepOpenOnEscape")) { ser.AddBooleanProp("keepOpenOnEscape", this._keepOpenOnEscape); } - if (IsPropDirty("Label")) { ser.AddStringProp("label", this._label); } - if (IsPropDirty("ClosingRef")) { ser.AddStringProp("closingRef", this._closingRef); } - if (IsPropDirty("ClosedRef")) { ser.AddStringProp("closedRef", this._closedRef); } - - } - -} + this._closedRef = refName; + this.MarkPropDirty("ClosedRef"); + }); + } + } + else + { + _closed = null; + this.SetHandler(this.Name, "Closed", null); + this.OnRefChanged("Closed", null, null, true, false, (refName, oldValue, newValue) => + { + this._closedRef = null; + this.MarkPropDirty("ClosedRef"); + }); + } + } + } + + partial void SerializeCoreIgbNavDrawer(RendererSerializer ser); + + internal override void SerializeCore(RendererSerializer ser) + { + base.SerializeCore(ser); + + SerializeCoreIgbNavDrawer(ser); + + if (IsPropDirty("Position")) + { ser.AddEnumProp("position", this._position); } + if (IsPropDirty("Open")) + { ser.AddBooleanProp("open", this._open); } + if (IsPropDirty("KeepOpenOnEscape")) + { ser.AddBooleanProp("keepOpenOnEscape", this._keepOpenOnEscape); } + if (IsPropDirty("Label")) + { ser.AddStringProp("label", this._label); } + if (IsPropDirty("ClosingRef")) + { ser.AddStringProp("closingRef", this._closingRef); } + if (IsPropDirty("ClosedRef")) + { ser.AddStringProp("closedRef", this._closedRef); } + + } + + } } diff --git a/src/components/Blazor/NavDrawerHeaderItem.cs b/src/components/Blazor/NavDrawerHeaderItem.cs index b30b23ca..4f0e1edb 100644 --- a/src/components/Blazor/NavDrawerHeaderItem.cs +++ b/src/components/Blazor/NavDrawerHeaderItem.cs @@ -1,108 +1,99 @@ - -using System; -using Microsoft.AspNetCore.Components; -using Microsoft.AspNetCore.Components.Rendering; -using System.Threading.Tasks; -using System.Collections.Generic; -using System.Linq; - namespace IgniteUI.Blazor.Controls { - /// -/// A wrapper for navigation drawer's header. -/// -public partial class IgbNavDrawerHeaderItem: BaseRendererControl { - public override string Type { get { return "WebNavDrawerHeaderItem"; } } - - protected override void EnsureModulesLoaded() - { - if (!IgbNavDrawerHeaderItemModule.IsLoadRequested(IgBlazor)) - { - IgbNavDrawerHeaderItemModule.Register(IgBlazor); - } - } - - protected override string ResolveDisplay() - { - return "inline-block"; - } - - protected override bool SupportsVisualChildren - { - get - { - return true; - } - } - - protected override bool UseDirectRender - { - get - { - return true; - } - } - - protected override string DirectRenderElementName - { - get - { - return "igc-nav-drawer-header-item"; - } - } - - protected override ControlEventBehavior DefaultEventBehavior - { - get { return ControlEventBehavior.Immediate; } - } - - public IgbNavDrawerHeaderItem(): base() { - OnCreatedIgbNavDrawerHeaderItem(); - - - } - - partial void OnCreatedIgbNavDrawerHeaderItem(); - - - partial void FindByNameNavDrawerHeaderItem(string name, ref object item); - public override object FindByName(string name) - { - - var baseResult = base.FindByName(name); - if (baseResult != null) - { - return baseResult; - } - - object item = null; - FindByNameNavDrawerHeaderItem(name, ref item); - if (item != null) - { - return item; - } - - return null; - } - public async Task SetNativeElementAsync(Object element) - { - await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); - } - public void SetNativeElement(Object element) - { - InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); - } - - partial void SerializeCoreIgbNavDrawerHeaderItem(RendererSerializer ser); - - internal override void SerializeCore(RendererSerializer ser) - { - base.SerializeCore(ser); - - SerializeCoreIgbNavDrawerHeaderItem(ser); - - - } - -} + /// + /// A wrapper for navigation drawer's header. + /// + public partial class IgbNavDrawerHeaderItem : BaseRendererControl + { + public override string Type { get { return "WebNavDrawerHeaderItem"; } } + + protected override void EnsureModulesLoaded() + { + if (!IgbNavDrawerHeaderItemModule.IsLoadRequested(IgBlazor)) + { + IgbNavDrawerHeaderItemModule.Register(IgBlazor); + } + } + + protected override string ResolveDisplay() + { + return "inline-block"; + } + + protected override bool SupportsVisualChildren + { + get + { + return true; + } + } + + protected override bool UseDirectRender + { + get + { + return true; + } + } + + protected override string DirectRenderElementName + { + get + { + return "igc-nav-drawer-header-item"; + } + } + + protected override ControlEventBehavior DefaultEventBehavior + { + get { return ControlEventBehavior.Immediate; } + } + + public IgbNavDrawerHeaderItem() : base() + { + OnCreatedIgbNavDrawerHeaderItem(); + + } + + partial void OnCreatedIgbNavDrawerHeaderItem(); + + partial void FindByNameNavDrawerHeaderItem(string name, ref object item); + public override object FindByName(string name) + { + + var baseResult = base.FindByName(name); + if (baseResult != null) + { + return baseResult; + } + + object item = null; + FindByNameNavDrawerHeaderItem(name, ref item); + if (item != null) + { + return item; + } + + return null; + } + public async Task SetNativeElementAsync(Object element) + { + await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + } + public void SetNativeElement(Object element) + { + InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + } + + partial void SerializeCoreIgbNavDrawerHeaderItem(RendererSerializer ser); + + internal override void SerializeCore(RendererSerializer ser) + { + base.SerializeCore(ser); + + SerializeCoreIgbNavDrawerHeaderItem(ser); + + } + + } } diff --git a/src/components/Blazor/NavDrawerHeaderItemModule.cs b/src/components/Blazor/NavDrawerHeaderItemModule.cs index 834089f7..cf506459 100644 --- a/src/components/Blazor/NavDrawerHeaderItemModule.cs +++ b/src/components/Blazor/NavDrawerHeaderItemModule.cs @@ -1,23 +1,20 @@ -using System; -using System.Collections.Generic; -using System.Runtime.CompilerServices; -using System.Text; -using System.Collections.Generic; - namespace IgniteUI.Blazor.Controls { - public partial class IgbNavDrawerHeaderItemModule { - public static void Register(IIgniteUIBlazor runtime) { + public partial class IgbNavDrawerHeaderItemModule + { + public static void Register(IIgniteUIBlazor runtime) + { ModuleLoader.Load(runtime, "WebNavDrawerHeaderItemModule"); - } - public static void MarkIsLoadRequested(IIgniteUIBlazor runtime) { + public static void MarkIsLoadRequested(IIgniteUIBlazor runtime) + { ModuleLoader.MarkIsLoadRequested(runtime, "WebNavDrawerHeaderItemModule"); } - public static bool IsLoadRequested(IIgniteUIBlazor runtime) { + public static bool IsLoadRequested(IIgniteUIBlazor runtime) + { return ModuleLoader.IsLoadRequested(runtime, "WebNavDrawerHeaderItemModule"); } } diff --git a/src/components/Blazor/NavDrawerItem.cs b/src/components/Blazor/NavDrawerItem.cs index f59bff1e..dcb7eea7 100644 --- a/src/components/Blazor/NavDrawerItem.cs +++ b/src/components/Blazor/NavDrawerItem.cs @@ -1,146 +1,147 @@ - -using System; using Microsoft.AspNetCore.Components; -using Microsoft.AspNetCore.Components.Rendering; -using System.Threading.Tasks; -using System.Collections.Generic; -using System.Linq; namespace IgniteUI.Blazor.Controls { - /// -/// Represents a navigation drawer item. -/// -public partial class IgbNavDrawerItem: BaseRendererControl { - public override string Type { get { return "WebNavDrawerItem"; } } - - protected override void EnsureModulesLoaded() - { - if (!IgbNavDrawerItemModule.IsLoadRequested(IgBlazor)) - { - IgbNavDrawerItemModule.Register(IgBlazor); - } - } - - protected override string ResolveDisplay() - { - return "inline-block"; - } - - protected override bool SupportsVisualChildren - { - get - { - return true; - } - } - - protected override bool UseDirectRender - { - get - { - return true; - } - } - - protected override string DirectRenderElementName - { - get - { - return "igc-nav-drawer-item"; - } - } - - protected override ControlEventBehavior DefaultEventBehavior - { - get { return ControlEventBehavior.Immediate; } - } - - public IgbNavDrawerItem(): base() { - OnCreatedIgbNavDrawerItem(); - - - } - - partial void OnCreatedIgbNavDrawerItem(); - - private bool _disabled = false; - - partial void OnDisabledChanging(ref bool newValue); - /// - /// Determines whether the drawer is disabled. - /// - [Parameter] - public bool Disabled - { - get { return this._disabled; } - set { - if (this._disabled != value || !IsPropDirty("Disabled")) { - MarkPropDirty("Disabled"); - } - this._disabled = value; - - } - } - private bool _active = false; - - partial void OnActiveChanging(ref bool newValue); - /// - /// Determines whether the drawer is active. - /// - [Parameter] - public bool Active - { - get { return this._active; } - set { - if (this._active != value || !IsPropDirty("Active")) { - MarkPropDirty("Active"); - } - this._active = value; - - } - } - - partial void FindByNameNavDrawerItem(string name, ref object item); - public override object FindByName(string name) - { - - var baseResult = base.FindByName(name); - if (baseResult != null) - { - return baseResult; - } - - object item = null; - FindByNameNavDrawerItem(name, ref item); - if (item != null) - { - return item; - } - - return null; - } - public async Task SetNativeElementAsync(Object element) - { - await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); - } - public void SetNativeElement(Object element) - { - InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); - } - - partial void SerializeCoreIgbNavDrawerItem(RendererSerializer ser); - - internal override void SerializeCore(RendererSerializer ser) - { - base.SerializeCore(ser); - - SerializeCoreIgbNavDrawerItem(ser); - - if (IsPropDirty("Disabled")) { ser.AddBooleanProp("disabled", this._disabled); } - if (IsPropDirty("Active")) { ser.AddBooleanProp("active", this._active); } - - } - -} + /// + /// Represents a navigation drawer item. + /// + public partial class IgbNavDrawerItem : BaseRendererControl + { + public override string Type { get { return "WebNavDrawerItem"; } } + + protected override void EnsureModulesLoaded() + { + if (!IgbNavDrawerItemModule.IsLoadRequested(IgBlazor)) + { + IgbNavDrawerItemModule.Register(IgBlazor); + } + } + + protected override string ResolveDisplay() + { + return "inline-block"; + } + + protected override bool SupportsVisualChildren + { + get + { + return true; + } + } + + protected override bool UseDirectRender + { + get + { + return true; + } + } + + protected override string DirectRenderElementName + { + get + { + return "igc-nav-drawer-item"; + } + } + + protected override ControlEventBehavior DefaultEventBehavior + { + get { return ControlEventBehavior.Immediate; } + } + + public IgbNavDrawerItem() : base() + { + OnCreatedIgbNavDrawerItem(); + + } + + partial void OnCreatedIgbNavDrawerItem(); + + private bool _disabled = false; + + partial void OnDisabledChanging(ref bool newValue); + /// + /// Determines whether the drawer is disabled. + /// + [Parameter] + public bool Disabled + { + get { return this._disabled; } + set + { + if (this._disabled != value || !IsPropDirty("Disabled")) + { + MarkPropDirty("Disabled"); + } + this._disabled = value; + + } + } + private bool _active = false; + + partial void OnActiveChanging(ref bool newValue); + /// + /// Determines whether the drawer is active. + /// + [Parameter] + public bool Active + { + get { return this._active; } + set + { + if (this._active != value || !IsPropDirty("Active")) + { + MarkPropDirty("Active"); + } + this._active = value; + + } + } + + partial void FindByNameNavDrawerItem(string name, ref object item); + public override object FindByName(string name) + { + + var baseResult = base.FindByName(name); + if (baseResult != null) + { + return baseResult; + } + + object item = null; + FindByNameNavDrawerItem(name, ref item); + if (item != null) + { + return item; + } + + return null; + } + public async Task SetNativeElementAsync(Object element) + { + await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + } + public void SetNativeElement(Object element) + { + InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + } + + partial void SerializeCoreIgbNavDrawerItem(RendererSerializer ser); + + internal override void SerializeCore(RendererSerializer ser) + { + base.SerializeCore(ser); + + SerializeCoreIgbNavDrawerItem(ser); + + if (IsPropDirty("Disabled")) + { ser.AddBooleanProp("disabled", this._disabled); } + if (IsPropDirty("Active")) + { ser.AddBooleanProp("active", this._active); } + + } + + } } diff --git a/src/components/Blazor/NavDrawerItemModule.cs b/src/components/Blazor/NavDrawerItemModule.cs index 9be8b151..bb8a60e2 100644 --- a/src/components/Blazor/NavDrawerItemModule.cs +++ b/src/components/Blazor/NavDrawerItemModule.cs @@ -1,23 +1,20 @@ -using System; -using System.Collections.Generic; -using System.Runtime.CompilerServices; -using System.Text; -using System.Collections.Generic; - namespace IgniteUI.Blazor.Controls { - public partial class IgbNavDrawerItemModule { - public static void Register(IIgniteUIBlazor runtime) { + public partial class IgbNavDrawerItemModule + { + public static void Register(IIgniteUIBlazor runtime) + { ModuleLoader.Load(runtime, "WebNavDrawerItemModule"); - } - public static void MarkIsLoadRequested(IIgniteUIBlazor runtime) { + public static void MarkIsLoadRequested(IIgniteUIBlazor runtime) + { ModuleLoader.MarkIsLoadRequested(runtime, "WebNavDrawerItemModule"); } - public static bool IsLoadRequested(IIgniteUIBlazor runtime) { + public static bool IsLoadRequested(IIgniteUIBlazor runtime) + { return ModuleLoader.IsLoadRequested(runtime, "WebNavDrawerItemModule"); } } diff --git a/src/components/Blazor/NavDrawerModule.cs b/src/components/Blazor/NavDrawerModule.cs index 4592252a..34587dac 100644 --- a/src/components/Blazor/NavDrawerModule.cs +++ b/src/components/Blazor/NavDrawerModule.cs @@ -1,23 +1,20 @@ -using System; -using System.Collections.Generic; -using System.Runtime.CompilerServices; -using System.Text; -using System.Collections.Generic; - namespace IgniteUI.Blazor.Controls { - public partial class IgbNavDrawerModule { - public static void Register(IIgniteUIBlazor runtime) { + public partial class IgbNavDrawerModule + { + public static void Register(IIgniteUIBlazor runtime) + { ModuleLoader.Load(runtime, "WebNavDrawerModule"); - } - public static void MarkIsLoadRequested(IIgniteUIBlazor runtime) { + public static void MarkIsLoadRequested(IIgniteUIBlazor runtime) + { ModuleLoader.MarkIsLoadRequested(runtime, "WebNavDrawerModule"); } - public static bool IsLoadRequested(IIgniteUIBlazor runtime) { + public static bool IsLoadRequested(IIgniteUIBlazor runtime) + { return ModuleLoader.IsLoadRequested(runtime, "WebNavDrawerModule"); } } diff --git a/src/components/Blazor/NavDrawerPosition.cs b/src/components/Blazor/NavDrawerPosition.cs index 3a0808a2..b8067647 100644 --- a/src/components/Blazor/NavDrawerPosition.cs +++ b/src/components/Blazor/NavDrawerPosition.cs @@ -1,11 +1,12 @@ namespace IgniteUI.Blazor.Controls { -public enum NavDrawerPosition { - Start, - End, - Top, - Bottom, - Relative + public enum NavDrawerPosition + { + Start, + End, + Top, + Bottom, + Relative -} + } } diff --git a/src/components/Blazor/Navbar.cs b/src/components/Blazor/Navbar.cs index a10ff94e..1db97938 100644 --- a/src/components/Blazor/Navbar.cs +++ b/src/components/Blazor/Navbar.cs @@ -1,109 +1,100 @@ - -using System; -using Microsoft.AspNetCore.Components; -using Microsoft.AspNetCore.Components.Rendering; -using System.Threading.Tasks; -using System.Collections.Generic; -using System.Linq; - namespace IgniteUI.Blazor.Controls { - /// -/// A navigation bar component is used to facilitate navigation through -/// a series of hierarchical screens within an app. -/// -public partial class IgbNavbar: BaseRendererControl { - public override string Type { get { return "WebNavbar"; } } - - protected override void EnsureModulesLoaded() - { - if (!IgbNavbarModule.IsLoadRequested(IgBlazor)) - { - IgbNavbarModule.Register(IgBlazor); - } - } - - protected override string ResolveDisplay() - { - return "inline-block"; - } - - protected override bool SupportsVisualChildren - { - get - { - return true; - } - } - - protected override bool UseDirectRender - { - get - { - return true; - } - } - - protected override string DirectRenderElementName - { - get - { - return "igc-navbar"; - } - } - - protected override ControlEventBehavior DefaultEventBehavior - { - get { return ControlEventBehavior.Immediate; } - } - - public IgbNavbar(): base() { - OnCreatedIgbNavbar(); - - - } - - partial void OnCreatedIgbNavbar(); - - - partial void FindByNameNavbar(string name, ref object item); - public override object FindByName(string name) - { - - var baseResult = base.FindByName(name); - if (baseResult != null) - { - return baseResult; - } - - object item = null; - FindByNameNavbar(name, ref item); - if (item != null) - { - return item; - } - - return null; - } - public async Task SetNativeElementAsync(Object element) - { - await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); - } - public void SetNativeElement(Object element) - { - InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); - } - - partial void SerializeCoreIgbNavbar(RendererSerializer ser); - - internal override void SerializeCore(RendererSerializer ser) - { - base.SerializeCore(ser); - - SerializeCoreIgbNavbar(ser); - - - } - -} + /// + /// A navigation bar component is used to facilitate navigation through + /// a series of hierarchical screens within an app. + /// + public partial class IgbNavbar : BaseRendererControl + { + public override string Type { get { return "WebNavbar"; } } + + protected override void EnsureModulesLoaded() + { + if (!IgbNavbarModule.IsLoadRequested(IgBlazor)) + { + IgbNavbarModule.Register(IgBlazor); + } + } + + protected override string ResolveDisplay() + { + return "inline-block"; + } + + protected override bool SupportsVisualChildren + { + get + { + return true; + } + } + + protected override bool UseDirectRender + { + get + { + return true; + } + } + + protected override string DirectRenderElementName + { + get + { + return "igc-navbar"; + } + } + + protected override ControlEventBehavior DefaultEventBehavior + { + get { return ControlEventBehavior.Immediate; } + } + + public IgbNavbar() : base() + { + OnCreatedIgbNavbar(); + + } + + partial void OnCreatedIgbNavbar(); + + partial void FindByNameNavbar(string name, ref object item); + public override object FindByName(string name) + { + + var baseResult = base.FindByName(name); + if (baseResult != null) + { + return baseResult; + } + + object item = null; + FindByNameNavbar(name, ref item); + if (item != null) + { + return item; + } + + return null; + } + public async Task SetNativeElementAsync(Object element) + { + await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + } + public void SetNativeElement(Object element) + { + InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + } + + partial void SerializeCoreIgbNavbar(RendererSerializer ser); + + internal override void SerializeCore(RendererSerializer ser) + { + base.SerializeCore(ser); + + SerializeCoreIgbNavbar(ser); + + } + + } } diff --git a/src/components/Blazor/NavbarModule.cs b/src/components/Blazor/NavbarModule.cs index 39e2f471..8cb97fc1 100644 --- a/src/components/Blazor/NavbarModule.cs +++ b/src/components/Blazor/NavbarModule.cs @@ -1,23 +1,20 @@ -using System; -using System.Collections.Generic; -using System.Runtime.CompilerServices; -using System.Text; -using System.Collections.Generic; - namespace IgniteUI.Blazor.Controls { - public partial class IgbNavbarModule { - public static void Register(IIgniteUIBlazor runtime) { + public partial class IgbNavbarModule + { + public static void Register(IIgniteUIBlazor runtime) + { ModuleLoader.Load(runtime, "WebNavbarModule"); - } - public static void MarkIsLoadRequested(IIgniteUIBlazor runtime) { + public static void MarkIsLoadRequested(IIgniteUIBlazor runtime) + { ModuleLoader.MarkIsLoadRequested(runtime, "WebNavbarModule"); } - public static bool IsLoadRequested(IIgniteUIBlazor runtime) { + public static bool IsLoadRequested(IIgniteUIBlazor runtime) + { return ModuleLoader.IsLoadRequested(runtime, "WebNavbarModule"); } } diff --git a/src/components/Blazor/NotificationPositioning.cs b/src/components/Blazor/NotificationPositioning.cs index 8c1efadf..9e5b2505 100644 --- a/src/components/Blazor/NotificationPositioning.cs +++ b/src/components/Blazor/NotificationPositioning.cs @@ -1,8 +1,9 @@ namespace IgniteUI.Blazor.Controls { -public enum NotificationPositioning { - Viewport, - Container + public enum NotificationPositioning + { + Viewport, + Container -} + } } diff --git a/src/components/Blazor/NumberEventArgs.cs b/src/components/Blazor/NumberEventArgs.cs index 8d6469dc..01c8bb39 100644 --- a/src/components/Blazor/NumberEventArgs.cs +++ b/src/components/Blazor/NumberEventArgs.cs @@ -1,94 +1,91 @@ - -using System; using Microsoft.AspNetCore.Components; -using Microsoft.AspNetCore.Components.Rendering; -using System.Threading.Tasks; -using System.Collections.Generic; -using System.Linq; namespace IgniteUI.Blazor.Controls { - public partial class IgbNumberEventArgs: BaseRendererElement { - public override string Type { get { return "WebNumberEventArgs"; } } - - - private static bool _marshalByValue = true; - - public IgbNumberEventArgs(): base() { - OnCreatedIgbNumberEventArgs(); - - - } - - partial void OnCreatedIgbNumberEventArgs(); - - private double _detail = 0; - - partial void OnDetailChanging(ref double newValue); - [Parameter] - public double Detail - { - get { return this._detail; } - set { - if (this._detail != value || !IsPropDirty("Detail")) { - MarkPropDirty("Detail"); - } - this._detail = value; - - } - } - - partial void FindByNameNumberEventArgs(string name, ref object item); - public override object FindByName(string name) - { - - var baseResult = base.FindByName(name); - if (baseResult != null) - { - return baseResult; - } - - object item = null; - FindByNameNumberEventArgs(name, ref item); - if (item != null) - { - return item; - } - - return null; - } - - partial void SerializeCoreIgbNumberEventArgs(RendererSerializer ser); - - internal override void SerializeCore(RendererSerializer ser) - { - base.SerializeCore(ser); - - SerializeCoreIgbNumberEventArgs(ser); - - if (IsPropDirty("Detail")) { ser.AddNumberProp("detail", this._detail); } - - } - - - protected internal override void ToEventJson(BaseRendererControl control, Dictionary args) - { - base.ToEventJson(control, args); - - if (IsPropDirty("Detail")) { args["detail"] = (this._detail).ToString(); } - - - } - - - protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) { - base.FromEventJson(control, args); - this.SuppressParentNotify = true; - - if (args.ContainsKey("detail")) { this.Detail = ReturnToDouble(args["detail"]); } - - this.SuppressParentNotify = false; - } - -} + public partial class IgbNumberEventArgs : BaseRendererElement + { + public override string Type { get { return "WebNumberEventArgs"; } } + + private static bool _marshalByValue = true; + + public IgbNumberEventArgs() : base() + { + OnCreatedIgbNumberEventArgs(); + + } + + partial void OnCreatedIgbNumberEventArgs(); + + private double _detail = 0; + + partial void OnDetailChanging(ref double newValue); + [Parameter] + public double Detail + { + get { return this._detail; } + set + { + if (this._detail != value || !IsPropDirty("Detail")) + { + MarkPropDirty("Detail"); + } + this._detail = value; + + } + } + + partial void FindByNameNumberEventArgs(string name, ref object item); + public override object FindByName(string name) + { + + var baseResult = base.FindByName(name); + if (baseResult != null) + { + return baseResult; + } + + object item = null; + FindByNameNumberEventArgs(name, ref item); + if (item != null) + { + return item; + } + + return null; + } + + partial void SerializeCoreIgbNumberEventArgs(RendererSerializer ser); + + internal override void SerializeCore(RendererSerializer ser) + { + base.SerializeCore(ser); + + SerializeCoreIgbNumberEventArgs(ser); + + if (IsPropDirty("Detail")) + { ser.AddNumberProp("detail", this._detail); } + + } + + protected internal override void ToEventJson(BaseRendererControl control, Dictionary args) + { + base.ToEventJson(control, args); + + if (IsPropDirty("Detail")) + { args["detail"] = (this._detail).ToString(); } + + } + + protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) + { + base.FromEventJson(control, args); + this.SuppressParentNotify = true; + + if (args.ContainsKey("detail")) + { this.Detail = ReturnToDouble(args["detail"]); } + + this.SuppressParentNotify = false; + } + + } } diff --git a/src/components/Blazor/NumberFormatSpecifier.cs b/src/components/Blazor/NumberFormatSpecifier.cs index 826aec25..d89c1744 100644 --- a/src/components/Blazor/NumberFormatSpecifier.cs +++ b/src/components/Blazor/NumberFormatSpecifier.cs @@ -1,442 +1,532 @@ - -using System; using Microsoft.AspNetCore.Components; -using Microsoft.AspNetCore.Components.Rendering; -using System.Threading.Tasks; -using System.Collections.Generic; -using System.Linq; namespace IgniteUI.Blazor.Controls { - public partial class IgbNumberFormatSpecifier: IgbFormatSpecifier { - public override string Type { get { return "NumberFormatSpecifier"; } } - - protected override void EnsureModulesLoaded() - { - if (!IgbNumberFormatSpecifierModule.IsLoadRequested(IgBlazor)) - { - IgbNumberFormatSpecifierModule.Register(IgBlazor); - } - } - - private static bool _marshalByValue = true; - - public IgbNumberFormatSpecifier(): base() { - OnCreatedIgbNumberFormatSpecifier(); - - - } - - partial void OnCreatedIgbNumberFormatSpecifier(); - - private string _locale; - - partial void OnLocaleChanging(ref string newValue); - [Parameter] - public string Locale - { - get { return this._locale; } - set { - if (this._locale != value || !IsPropDirty("Locale")) { - MarkPropDirty("Locale"); - } - this._locale = value; - - } - } - private string _compactDisplay; - - partial void OnCompactDisplayChanging(ref string newValue); - [Parameter] - public string CompactDisplay - { - get { return this._compactDisplay; } - set { - if (this._compactDisplay != value || !IsPropDirty("CompactDisplay")) { - MarkPropDirty("CompactDisplay"); - } - this._compactDisplay = value; - - } - } - private string _currency; - - partial void OnCurrencyChanging(ref string newValue); - [Parameter] - public string Currency - { - get { return this._currency; } - set { - if (this._currency != value || !IsPropDirty("Currency")) { - MarkPropDirty("Currency"); - } - this._currency = value; - - } - } - private string _currencyDisplay; - - partial void OnCurrencyDisplayChanging(ref string newValue); - [Parameter] - public string CurrencyDisplay - { - get { return this._currencyDisplay; } - set { - if (this._currencyDisplay != value || !IsPropDirty("CurrencyDisplay")) { - MarkPropDirty("CurrencyDisplay"); - } - this._currencyDisplay = value; - - } - } - private string _currencySign; - - partial void OnCurrencySignChanging(ref string newValue); - [Parameter] - public string CurrencySign - { - get { return this._currencySign; } - set { - if (this._currencySign != value || !IsPropDirty("CurrencySign")) { - MarkPropDirty("CurrencySign"); - } - this._currencySign = value; - - } - } - private string _currencyCode; - - partial void OnCurrencyCodeChanging(ref string newValue); - [Parameter] - public string CurrencyCode - { - get { return this._currencyCode; } - set { - if (this._currencyCode != value || !IsPropDirty("CurrencyCode")) { - MarkPropDirty("CurrencyCode"); - } - this._currencyCode = value; - - } - } - private string _localeMatcher; - - partial void OnLocaleMatcherChanging(ref string newValue); - [Parameter] - public string LocaleMatcher - { - get { return this._localeMatcher; } - set { - if (this._localeMatcher != value || !IsPropDirty("LocaleMatcher")) { - MarkPropDirty("LocaleMatcher"); - } - this._localeMatcher = value; - - } - } - private string _notation; - - partial void OnNotationChanging(ref string newValue); - [Parameter] - public string Notation - { - get { return this._notation; } - set { - if (this._notation != value || !IsPropDirty("Notation")) { - MarkPropDirty("Notation"); - } - this._notation = value; - - } - } - private string _numberingSystem; - - partial void OnNumberingSystemChanging(ref string newValue); - [Parameter] - public string NumberingSystem - { - get { return this._numberingSystem; } - set { - if (this._numberingSystem != value || !IsPropDirty("NumberingSystem")) { - MarkPropDirty("NumberingSystem"); - } - this._numberingSystem = value; - - } - } - private string _signDisplay; - - partial void OnSignDisplayChanging(ref string newValue); - [Parameter] - public string SignDisplay - { - get { return this._signDisplay; } - set { - if (this._signDisplay != value || !IsPropDirty("SignDisplay")) { - MarkPropDirty("SignDisplay"); - } - this._signDisplay = value; - - } - } - private string _style; - - partial void OnStyleChanging(ref string newValue); - [Parameter] - public string Style - { - get { return this._style; } - set { - if (this._style != value || !IsPropDirty("Style")) { - MarkPropDirty("Style"); - } - this._style = value; - - } - } - private string _unit; - - partial void OnUnitChanging(ref string newValue); - [Parameter] - public string Unit - { - get { return this._unit; } - set { - if (this._unit != value || !IsPropDirty("Unit")) { - MarkPropDirty("Unit"); - } - this._unit = value; - - } - } - private string _unitDisplay; - - partial void OnUnitDisplayChanging(ref string newValue); - [Parameter] - public string UnitDisplay - { - get { return this._unitDisplay; } - set { - if (this._unitDisplay != value || !IsPropDirty("UnitDisplay")) { - MarkPropDirty("UnitDisplay"); - } - this._unitDisplay = value; - - } - } - private bool _useGrouping = false; - - partial void OnUseGroupingChanging(ref bool newValue); - [Parameter] - public bool UseGrouping - { - get { return this._useGrouping; } - set { - if (this._useGrouping != value || !IsPropDirty("UseGrouping")) { - MarkPropDirty("UseGrouping"); - } - this._useGrouping = value; - - } - } - private int _minimumIntegerDigits = 0; - - partial void OnMinimumIntegerDigitsChanging(ref int newValue); - [Parameter] - public int MinimumIntegerDigits - { - get { return this._minimumIntegerDigits; } - set { - if (this._minimumIntegerDigits != value || !IsPropDirty("MinimumIntegerDigits")) { - MarkPropDirty("MinimumIntegerDigits"); - } - this._minimumIntegerDigits = value; - - } - } - private int _minimumFractionDigits = 0; - - partial void OnMinimumFractionDigitsChanging(ref int newValue); - [Parameter] - public int MinimumFractionDigits - { - get { return this._minimumFractionDigits; } - set { - if (this._minimumFractionDigits != value || !IsPropDirty("MinimumFractionDigits")) { - MarkPropDirty("MinimumFractionDigits"); - } - this._minimumFractionDigits = value; - - } - } - private int _maximumFractionDigits = 0; - - partial void OnMaximumFractionDigitsChanging(ref int newValue); - [Parameter] - public int MaximumFractionDigits - { - get { return this._maximumFractionDigits; } - set { - if (this._maximumFractionDigits != value || !IsPropDirty("MaximumFractionDigits")) { - MarkPropDirty("MaximumFractionDigits"); - } - this._maximumFractionDigits = value; - - } - } - private int _minimumSignificantDigits = 0; - - partial void OnMinimumSignificantDigitsChanging(ref int newValue); - [Parameter] - public int MinimumSignificantDigits - { - get { return this._minimumSignificantDigits; } - set { - if (this._minimumSignificantDigits != value || !IsPropDirty("MinimumSignificantDigits")) { - MarkPropDirty("MinimumSignificantDigits"); - } - this._minimumSignificantDigits = value; - - } - } - private int _maximumSignificantDigits = 0; - - partial void OnMaximumSignificantDigitsChanging(ref int newValue); - [Parameter] - public int MaximumSignificantDigits - { - get { return this._maximumSignificantDigits; } - set { - if (this._maximumSignificantDigits != value || !IsPropDirty("MaximumSignificantDigits")) { - MarkPropDirty("MaximumSignificantDigits"); - } - this._maximumSignificantDigits = value; - - } - } - - partial void FindByNameNumberFormatSpecifier(string name, ref object item); - public override object FindByName(string name) - { - - var baseResult = base.FindByName(name); - if (baseResult != null) - { - return baseResult; - } - - object item = null; - FindByNameNumberFormatSpecifier(name, ref item); - if (item != null) - { - return item; - } - - return null; - } - - partial void SerializeCoreIgbNumberFormatSpecifier(RendererSerializer ser); - - internal override void SerializeCore(RendererSerializer ser) - { - base.SerializeCore(ser); - - SerializeCoreIgbNumberFormatSpecifier(ser); - - if (IsPropDirty("Locale")) { ser.AddStringProp("locale", this._locale); } - if (IsPropDirty("CompactDisplay")) { ser.AddStringProp("compactDisplay", this._compactDisplay); } - if (IsPropDirty("Currency")) { ser.AddStringProp("currency", this._currency); } - if (IsPropDirty("CurrencyDisplay")) { ser.AddStringProp("currencyDisplay", this._currencyDisplay); } - if (IsPropDirty("CurrencySign")) { ser.AddStringProp("currencySign", this._currencySign); } - if (IsPropDirty("CurrencyCode")) { ser.AddStringProp("currencyCode", this._currencyCode); } - if (IsPropDirty("LocaleMatcher")) { ser.AddStringProp("localeMatcher", this._localeMatcher); } - if (IsPropDirty("Notation")) { ser.AddStringProp("notation", this._notation); } - if (IsPropDirty("NumberingSystem")) { ser.AddStringProp("numberingSystem", this._numberingSystem); } - if (IsPropDirty("SignDisplay")) { ser.AddStringProp("signDisplay", this._signDisplay); } - if (IsPropDirty("Style")) { ser.AddStringProp("style", this._style); } - if (IsPropDirty("Unit")) { ser.AddStringProp("unit", this._unit); } - if (IsPropDirty("UnitDisplay")) { ser.AddStringProp("unitDisplay", this._unitDisplay); } - if (IsPropDirty("UseGrouping")) { ser.AddBooleanProp("useGrouping", this._useGrouping); } - if (IsPropDirty("MinimumIntegerDigits")) { ser.AddNumberProp("minimumIntegerDigits", this._minimumIntegerDigits); } - if (IsPropDirty("MinimumFractionDigits")) { ser.AddNumberProp("minimumFractionDigits", this._minimumFractionDigits); } - if (IsPropDirty("MaximumFractionDigits")) { ser.AddNumberProp("maximumFractionDigits", this._maximumFractionDigits); } - if (IsPropDirty("MinimumSignificantDigits")) { ser.AddNumberProp("minimumSignificantDigits", this._minimumSignificantDigits); } - if (IsPropDirty("MaximumSignificantDigits")) { ser.AddNumberProp("maximumSignificantDigits", this._maximumSignificantDigits); } - - } - - - protected internal override void ToEventJson(BaseRendererControl control, Dictionary args) - { - base.ToEventJson(control, args); - - if (IsPropDirty("Locale")) { args["locale"] = this._locale; } - if (IsPropDirty("CompactDisplay")) { args["compactDisplay"] = this._compactDisplay; } - if (IsPropDirty("Currency")) { args["currency"] = this._currency; } - if (IsPropDirty("CurrencyDisplay")) { args["currencyDisplay"] = this._currencyDisplay; } - if (IsPropDirty("CurrencySign")) { args["currencySign"] = this._currencySign; } - if (IsPropDirty("CurrencyCode")) { args["currencyCode"] = this._currencyCode; } - if (IsPropDirty("LocaleMatcher")) { args["localeMatcher"] = this._localeMatcher; } - if (IsPropDirty("Notation")) { args["notation"] = this._notation; } - if (IsPropDirty("NumberingSystem")) { args["numberingSystem"] = this._numberingSystem; } - if (IsPropDirty("SignDisplay")) { args["signDisplay"] = this._signDisplay; } - if (IsPropDirty("Style")) { args["style"] = this._style; } - if (IsPropDirty("Unit")) { args["unit"] = this._unit; } - if (IsPropDirty("UnitDisplay")) { args["unitDisplay"] = this._unitDisplay; } - if (IsPropDirty("UseGrouping")) { args["useGrouping"] = (this._useGrouping).ToString().ToLower(); } - if (IsPropDirty("MinimumIntegerDigits")) { args["minimumIntegerDigits"] = (this._minimumIntegerDigits).ToString(); } - if (IsPropDirty("MinimumFractionDigits")) { args["minimumFractionDigits"] = (this._minimumFractionDigits).ToString(); } - if (IsPropDirty("MaximumFractionDigits")) { args["maximumFractionDigits"] = (this._maximumFractionDigits).ToString(); } - if (IsPropDirty("MinimumSignificantDigits")) { args["minimumSignificantDigits"] = (this._minimumSignificantDigits).ToString(); } - if (IsPropDirty("MaximumSignificantDigits")) { args["maximumSignificantDigits"] = (this._maximumSignificantDigits).ToString(); } - - - } - - - protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) { - base.FromEventJson(control, args); - this.SuppressParentNotify = true; - - if (args.ContainsKey("locale")) { this.Locale = ReturnToString(args["locale"]); } - if (args.ContainsKey("compactDisplay")) { this.CompactDisplay = ReturnToString(args["compactDisplay"]); } - if (args.ContainsKey("currency")) { this.Currency = ReturnToString(args["currency"]); } - if (args.ContainsKey("currencyDisplay")) { this.CurrencyDisplay = ReturnToString(args["currencyDisplay"]); } - if (args.ContainsKey("currencySign")) { this.CurrencySign = ReturnToString(args["currencySign"]); } - if (args.ContainsKey("currencyCode")) { this.CurrencyCode = ReturnToString(args["currencyCode"]); } - if (args.ContainsKey("localeMatcher")) { this.LocaleMatcher = ReturnToString(args["localeMatcher"]); } - if (args.ContainsKey("notation")) { this.Notation = ReturnToString(args["notation"]); } - if (args.ContainsKey("numberingSystem")) { this.NumberingSystem = ReturnToString(args["numberingSystem"]); } - if (args.ContainsKey("signDisplay")) { this.SignDisplay = ReturnToString(args["signDisplay"]); } - if (args.ContainsKey("style")) { this.Style = ReturnToString(args["style"]); } - if (args.ContainsKey("unit")) { this.Unit = ReturnToString(args["unit"]); } - if (args.ContainsKey("unitDisplay")) { this.UnitDisplay = ReturnToString(args["unitDisplay"]); } - if (args.ContainsKey("useGrouping")) { this.UseGrouping = ReturnToBoolean(args["useGrouping"]); } - if (args.ContainsKey("minimumIntegerDigits")) { this.MinimumIntegerDigits = ReturnToInt(args["minimumIntegerDigits"]); } - if (args.ContainsKey("minimumFractionDigits")) { this.MinimumFractionDigits = ReturnToInt(args["minimumFractionDigits"]); } - if (args.ContainsKey("maximumFractionDigits")) { this.MaximumFractionDigits = ReturnToInt(args["maximumFractionDigits"]); } - if (args.ContainsKey("minimumSignificantDigits")) { this.MinimumSignificantDigits = ReturnToInt(args["minimumSignificantDigits"]); } - if (args.ContainsKey("maximumSignificantDigits")) { this.MaximumSignificantDigits = ReturnToInt(args["maximumSignificantDigits"]); } - - this.SuppressParentNotify = false; - } - -} + public partial class IgbNumberFormatSpecifier : IgbFormatSpecifier + { + public override string Type { get { return "NumberFormatSpecifier"; } } -public class IgbNumberFormatSpecifierModule -{ - public static void Register(IIgniteUIBlazor runtime) { - ModuleLoader.Load(runtime, "NumberFormatSpecifierModule"); - } + protected override void EnsureModulesLoaded() + { + if (!IgbNumberFormatSpecifierModule.IsLoadRequested(IgBlazor)) + { + IgbNumberFormatSpecifierModule.Register(IgBlazor); + } + } + + private static bool _marshalByValue = true; + + public IgbNumberFormatSpecifier() : base() + { + OnCreatedIgbNumberFormatSpecifier(); + + } + + partial void OnCreatedIgbNumberFormatSpecifier(); + + private string _locale; + + partial void OnLocaleChanging(ref string newValue); + [Parameter] + public string Locale + { + get { return this._locale; } + set + { + if (this._locale != value || !IsPropDirty("Locale")) + { + MarkPropDirty("Locale"); + } + this._locale = value; + + } + } + private string _compactDisplay; + + partial void OnCompactDisplayChanging(ref string newValue); + [Parameter] + public string CompactDisplay + { + get { return this._compactDisplay; } + set + { + if (this._compactDisplay != value || !IsPropDirty("CompactDisplay")) + { + MarkPropDirty("CompactDisplay"); + } + this._compactDisplay = value; + + } + } + private string _currency; + + partial void OnCurrencyChanging(ref string newValue); + [Parameter] + public string Currency + { + get { return this._currency; } + set + { + if (this._currency != value || !IsPropDirty("Currency")) + { + MarkPropDirty("Currency"); + } + this._currency = value; + + } + } + private string _currencyDisplay; + + partial void OnCurrencyDisplayChanging(ref string newValue); + [Parameter] + public string CurrencyDisplay + { + get { return this._currencyDisplay; } + set + { + if (this._currencyDisplay != value || !IsPropDirty("CurrencyDisplay")) + { + MarkPropDirty("CurrencyDisplay"); + } + this._currencyDisplay = value; + + } + } + private string _currencySign; + + partial void OnCurrencySignChanging(ref string newValue); + [Parameter] + public string CurrencySign + { + get { return this._currencySign; } + set + { + if (this._currencySign != value || !IsPropDirty("CurrencySign")) + { + MarkPropDirty("CurrencySign"); + } + this._currencySign = value; + + } + } + private string _currencyCode; + + partial void OnCurrencyCodeChanging(ref string newValue); + [Parameter] + public string CurrencyCode + { + get { return this._currencyCode; } + set + { + if (this._currencyCode != value || !IsPropDirty("CurrencyCode")) + { + MarkPropDirty("CurrencyCode"); + } + this._currencyCode = value; + + } + } + private string _localeMatcher; + + partial void OnLocaleMatcherChanging(ref string newValue); + [Parameter] + public string LocaleMatcher + { + get { return this._localeMatcher; } + set + { + if (this._localeMatcher != value || !IsPropDirty("LocaleMatcher")) + { + MarkPropDirty("LocaleMatcher"); + } + this._localeMatcher = value; + + } + } + private string _notation; + + partial void OnNotationChanging(ref string newValue); + [Parameter] + public string Notation + { + get { return this._notation; } + set + { + if (this._notation != value || !IsPropDirty("Notation")) + { + MarkPropDirty("Notation"); + } + this._notation = value; + + } + } + private string _numberingSystem; + + partial void OnNumberingSystemChanging(ref string newValue); + [Parameter] + public string NumberingSystem + { + get { return this._numberingSystem; } + set + { + if (this._numberingSystem != value || !IsPropDirty("NumberingSystem")) + { + MarkPropDirty("NumberingSystem"); + } + this._numberingSystem = value; + + } + } + private string _signDisplay; + + partial void OnSignDisplayChanging(ref string newValue); + [Parameter] + public string SignDisplay + { + get { return this._signDisplay; } + set + { + if (this._signDisplay != value || !IsPropDirty("SignDisplay")) + { + MarkPropDirty("SignDisplay"); + } + this._signDisplay = value; + + } + } + private string _style; + + partial void OnStyleChanging(ref string newValue); + [Parameter] + public string Style + { + get { return this._style; } + set + { + if (this._style != value || !IsPropDirty("Style")) + { + MarkPropDirty("Style"); + } + this._style = value; + + } + } + private string _unit; + + partial void OnUnitChanging(ref string newValue); + [Parameter] + public string Unit + { + get { return this._unit; } + set + { + if (this._unit != value || !IsPropDirty("Unit")) + { + MarkPropDirty("Unit"); + } + this._unit = value; + + } + } + private string _unitDisplay; + + partial void OnUnitDisplayChanging(ref string newValue); + [Parameter] + public string UnitDisplay + { + get { return this._unitDisplay; } + set + { + if (this._unitDisplay != value || !IsPropDirty("UnitDisplay")) + { + MarkPropDirty("UnitDisplay"); + } + this._unitDisplay = value; + + } + } + private bool _useGrouping = false; + + partial void OnUseGroupingChanging(ref bool newValue); + [Parameter] + public bool UseGrouping + { + get { return this._useGrouping; } + set + { + if (this._useGrouping != value || !IsPropDirty("UseGrouping")) + { + MarkPropDirty("UseGrouping"); + } + this._useGrouping = value; + + } + } + private int _minimumIntegerDigits = 0; + + partial void OnMinimumIntegerDigitsChanging(ref int newValue); + [Parameter] + public int MinimumIntegerDigits + { + get { return this._minimumIntegerDigits; } + set + { + if (this._minimumIntegerDigits != value || !IsPropDirty("MinimumIntegerDigits")) + { + MarkPropDirty("MinimumIntegerDigits"); + } + this._minimumIntegerDigits = value; + + } + } + private int _minimumFractionDigits = 0; + + partial void OnMinimumFractionDigitsChanging(ref int newValue); + [Parameter] + public int MinimumFractionDigits + { + get { return this._minimumFractionDigits; } + set + { + if (this._minimumFractionDigits != value || !IsPropDirty("MinimumFractionDigits")) + { + MarkPropDirty("MinimumFractionDigits"); + } + this._minimumFractionDigits = value; + + } + } + private int _maximumFractionDigits = 0; + + partial void OnMaximumFractionDigitsChanging(ref int newValue); + [Parameter] + public int MaximumFractionDigits + { + get { return this._maximumFractionDigits; } + set + { + if (this._maximumFractionDigits != value || !IsPropDirty("MaximumFractionDigits")) + { + MarkPropDirty("MaximumFractionDigits"); + } + this._maximumFractionDigits = value; + + } + } + private int _minimumSignificantDigits = 0; + + partial void OnMinimumSignificantDigitsChanging(ref int newValue); + [Parameter] + public int MinimumSignificantDigits + { + get { return this._minimumSignificantDigits; } + set + { + if (this._minimumSignificantDigits != value || !IsPropDirty("MinimumSignificantDigits")) + { + MarkPropDirty("MinimumSignificantDigits"); + } + this._minimumSignificantDigits = value; + + } + } + private int _maximumSignificantDigits = 0; + + partial void OnMaximumSignificantDigitsChanging(ref int newValue); + [Parameter] + public int MaximumSignificantDigits + { + get { return this._maximumSignificantDigits; } + set + { + if (this._maximumSignificantDigits != value || !IsPropDirty("MaximumSignificantDigits")) + { + MarkPropDirty("MaximumSignificantDigits"); + } + this._maximumSignificantDigits = value; + + } + } + + partial void FindByNameNumberFormatSpecifier(string name, ref object item); + public override object FindByName(string name) + { + + var baseResult = base.FindByName(name); + if (baseResult != null) + { + return baseResult; + } + + object item = null; + FindByNameNumberFormatSpecifier(name, ref item); + if (item != null) + { + return item; + } + + return null; + } + + partial void SerializeCoreIgbNumberFormatSpecifier(RendererSerializer ser); + + internal override void SerializeCore(RendererSerializer ser) + { + base.SerializeCore(ser); + + SerializeCoreIgbNumberFormatSpecifier(ser); + + if (IsPropDirty("Locale")) + { ser.AddStringProp("locale", this._locale); } + if (IsPropDirty("CompactDisplay")) + { ser.AddStringProp("compactDisplay", this._compactDisplay); } + if (IsPropDirty("Currency")) + { ser.AddStringProp("currency", this._currency); } + if (IsPropDirty("CurrencyDisplay")) + { ser.AddStringProp("currencyDisplay", this._currencyDisplay); } + if (IsPropDirty("CurrencySign")) + { ser.AddStringProp("currencySign", this._currencySign); } + if (IsPropDirty("CurrencyCode")) + { ser.AddStringProp("currencyCode", this._currencyCode); } + if (IsPropDirty("LocaleMatcher")) + { ser.AddStringProp("localeMatcher", this._localeMatcher); } + if (IsPropDirty("Notation")) + { ser.AddStringProp("notation", this._notation); } + if (IsPropDirty("NumberingSystem")) + { ser.AddStringProp("numberingSystem", this._numberingSystem); } + if (IsPropDirty("SignDisplay")) + { ser.AddStringProp("signDisplay", this._signDisplay); } + if (IsPropDirty("Style")) + { ser.AddStringProp("style", this._style); } + if (IsPropDirty("Unit")) + { ser.AddStringProp("unit", this._unit); } + if (IsPropDirty("UnitDisplay")) + { ser.AddStringProp("unitDisplay", this._unitDisplay); } + if (IsPropDirty("UseGrouping")) + { ser.AddBooleanProp("useGrouping", this._useGrouping); } + if (IsPropDirty("MinimumIntegerDigits")) + { ser.AddNumberProp("minimumIntegerDigits", this._minimumIntegerDigits); } + if (IsPropDirty("MinimumFractionDigits")) + { ser.AddNumberProp("minimumFractionDigits", this._minimumFractionDigits); } + if (IsPropDirty("MaximumFractionDigits")) + { ser.AddNumberProp("maximumFractionDigits", this._maximumFractionDigits); } + if (IsPropDirty("MinimumSignificantDigits")) + { ser.AddNumberProp("minimumSignificantDigits", this._minimumSignificantDigits); } + if (IsPropDirty("MaximumSignificantDigits")) + { ser.AddNumberProp("maximumSignificantDigits", this._maximumSignificantDigits); } + + } + + protected internal override void ToEventJson(BaseRendererControl control, Dictionary args) + { + base.ToEventJson(control, args); + + if (IsPropDirty("Locale")) + { args["locale"] = this._locale; } + if (IsPropDirty("CompactDisplay")) + { args["compactDisplay"] = this._compactDisplay; } + if (IsPropDirty("Currency")) + { args["currency"] = this._currency; } + if (IsPropDirty("CurrencyDisplay")) + { args["currencyDisplay"] = this._currencyDisplay; } + if (IsPropDirty("CurrencySign")) + { args["currencySign"] = this._currencySign; } + if (IsPropDirty("CurrencyCode")) + { args["currencyCode"] = this._currencyCode; } + if (IsPropDirty("LocaleMatcher")) + { args["localeMatcher"] = this._localeMatcher; } + if (IsPropDirty("Notation")) + { args["notation"] = this._notation; } + if (IsPropDirty("NumberingSystem")) + { args["numberingSystem"] = this._numberingSystem; } + if (IsPropDirty("SignDisplay")) + { args["signDisplay"] = this._signDisplay; } + if (IsPropDirty("Style")) + { args["style"] = this._style; } + if (IsPropDirty("Unit")) + { args["unit"] = this._unit; } + if (IsPropDirty("UnitDisplay")) + { args["unitDisplay"] = this._unitDisplay; } + if (IsPropDirty("UseGrouping")) + { args["useGrouping"] = (this._useGrouping).ToString().ToLower(); } + if (IsPropDirty("MinimumIntegerDigits")) + { args["minimumIntegerDigits"] = (this._minimumIntegerDigits).ToString(); } + if (IsPropDirty("MinimumFractionDigits")) + { args["minimumFractionDigits"] = (this._minimumFractionDigits).ToString(); } + if (IsPropDirty("MaximumFractionDigits")) + { args["maximumFractionDigits"] = (this._maximumFractionDigits).ToString(); } + if (IsPropDirty("MinimumSignificantDigits")) + { args["minimumSignificantDigits"] = (this._minimumSignificantDigits).ToString(); } + if (IsPropDirty("MaximumSignificantDigits")) + { args["maximumSignificantDigits"] = (this._maximumSignificantDigits).ToString(); } + + } + + protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) + { + base.FromEventJson(control, args); + this.SuppressParentNotify = true; + + if (args.ContainsKey("locale")) + { this.Locale = ReturnToString(args["locale"]); } + if (args.ContainsKey("compactDisplay")) + { this.CompactDisplay = ReturnToString(args["compactDisplay"]); } + if (args.ContainsKey("currency")) + { this.Currency = ReturnToString(args["currency"]); } + if (args.ContainsKey("currencyDisplay")) + { this.CurrencyDisplay = ReturnToString(args["currencyDisplay"]); } + if (args.ContainsKey("currencySign")) + { this.CurrencySign = ReturnToString(args["currencySign"]); } + if (args.ContainsKey("currencyCode")) + { this.CurrencyCode = ReturnToString(args["currencyCode"]); } + if (args.ContainsKey("localeMatcher")) + { this.LocaleMatcher = ReturnToString(args["localeMatcher"]); } + if (args.ContainsKey("notation")) + { this.Notation = ReturnToString(args["notation"]); } + if (args.ContainsKey("numberingSystem")) + { this.NumberingSystem = ReturnToString(args["numberingSystem"]); } + if (args.ContainsKey("signDisplay")) + { this.SignDisplay = ReturnToString(args["signDisplay"]); } + if (args.ContainsKey("style")) + { this.Style = ReturnToString(args["style"]); } + if (args.ContainsKey("unit")) + { this.Unit = ReturnToString(args["unit"]); } + if (args.ContainsKey("unitDisplay")) + { this.UnitDisplay = ReturnToString(args["unitDisplay"]); } + if (args.ContainsKey("useGrouping")) + { this.UseGrouping = ReturnToBoolean(args["useGrouping"]); } + if (args.ContainsKey("minimumIntegerDigits")) + { this.MinimumIntegerDigits = ReturnToInt(args["minimumIntegerDigits"]); } + if (args.ContainsKey("minimumFractionDigits")) + { this.MinimumFractionDigits = ReturnToInt(args["minimumFractionDigits"]); } + if (args.ContainsKey("maximumFractionDigits")) + { this.MaximumFractionDigits = ReturnToInt(args["maximumFractionDigits"]); } + if (args.ContainsKey("minimumSignificantDigits")) + { this.MinimumSignificantDigits = ReturnToInt(args["minimumSignificantDigits"]); } + if (args.ContainsKey("maximumSignificantDigits")) + { this.MaximumSignificantDigits = ReturnToInt(args["maximumSignificantDigits"]); } + + this.SuppressParentNotify = false; + } - public static void MarkIsLoadRequested(IIgniteUIBlazor runtime) { - ModuleLoader.MarkIsLoadRequested(runtime, "NumberFormatSpecifierModule"); } + public class IgbNumberFormatSpecifierModule + { + public static void Register(IIgniteUIBlazor runtime) + { + ModuleLoader.Load(runtime, "NumberFormatSpecifierModule"); + } - public static bool IsLoadRequested(IIgniteUIBlazor runtime) { - return ModuleLoader.IsLoadRequested(runtime, "NumberFormatSpecifierModule"); + public static void MarkIsLoadRequested(IIgniteUIBlazor runtime) + { + ModuleLoader.MarkIsLoadRequested(runtime, "NumberFormatSpecifierModule"); + } + + public static bool IsLoadRequested(IIgniteUIBlazor runtime) + { + return ModuleLoader.IsLoadRequested(runtime, "NumberFormatSpecifierModule"); + } } -} } diff --git a/src/components/Blazor/PanePosition.cs b/src/components/Blazor/PanePosition.cs index 78555e20..588834db 100644 --- a/src/components/Blazor/PanePosition.cs +++ b/src/components/Blazor/PanePosition.cs @@ -1,8 +1,9 @@ namespace IgniteUI.Blazor.Controls { -public enum PanePosition { - Start, - End + public enum PanePosition + { + Start, + End -} + } } diff --git a/src/components/Blazor/PickerMode.cs b/src/components/Blazor/PickerMode.cs index 83f7b795..e433eeb4 100644 --- a/src/components/Blazor/PickerMode.cs +++ b/src/components/Blazor/PickerMode.cs @@ -1,8 +1,9 @@ namespace IgniteUI.Blazor.Controls { -public enum PickerMode { - Dropdown, - Dialog + public enum PickerMode + { + Dropdown, + Dialog -} + } } diff --git a/src/components/Blazor/PopoverPlacement.cs b/src/components/Blazor/PopoverPlacement.cs index 5772b7e4..7b16b5eb 100644 --- a/src/components/Blazor/PopoverPlacement.cs +++ b/src/components/Blazor/PopoverPlacement.cs @@ -1,26 +1,27 @@ namespace IgniteUI.Blazor.Controls { -public enum PopoverPlacement { - Top, - [WCEnumName("top-start")] - TopStart, - [WCEnumName("top-end")] - TopEnd, - Bottom, - [WCEnumName("bottom-start")] - BottomStart, - [WCEnumName("bottom-end")] - BottomEnd, - Right, - [WCEnumName("right-start")] - RightStart, - [WCEnumName("right-end")] - RightEnd, - Left, - [WCEnumName("left-start")] - LeftStart, - [WCEnumName("left-end")] - LeftEnd + public enum PopoverPlacement + { + Top, + [WCEnumName("top-start")] + TopStart, + [WCEnumName("top-end")] + TopEnd, + Bottom, + [WCEnumName("bottom-start")] + BottomStart, + [WCEnumName("bottom-end")] + BottomEnd, + Right, + [WCEnumName("right-start")] + RightStart, + [WCEnumName("right-end")] + RightEnd, + Left, + [WCEnumName("left-start")] + LeftStart, + [WCEnumName("left-end")] + LeftEnd -} + } } diff --git a/src/components/Blazor/PopoverScrollStrategy.cs b/src/components/Blazor/PopoverScrollStrategy.cs index b53406df..9f354710 100644 --- a/src/components/Blazor/PopoverScrollStrategy.cs +++ b/src/components/Blazor/PopoverScrollStrategy.cs @@ -1,9 +1,10 @@ namespace IgniteUI.Blazor.Controls { -public enum PopoverScrollStrategy { - Scroll, - Block, - Close + public enum PopoverScrollStrategy + { + Scroll, + Block, + Close -} + } } diff --git a/src/components/Blazor/ProgressBase.cs b/src/components/Blazor/ProgressBase.cs index 6d964e7c..bb9ab746 100644 --- a/src/components/Blazor/ProgressBase.cs +++ b/src/components/Blazor/ProgressBase.cs @@ -1,233 +1,249 @@ - -using System; using Microsoft.AspNetCore.Components; -using Microsoft.AspNetCore.Components.Rendering; -using System.Threading.Tasks; -using System.Collections.Generic; -using System.Linq; namespace IgniteUI.Blazor.Controls { - public partial class IgbProgressBase: BaseRendererControl { - public override string Type { get { return "WebProgressBase"; } } - - protected override string ResolveDisplay() - { - return "inline-block"; - } - - protected override bool SupportsVisualChildren - { - get - { - return true; - } - } - - protected override bool UseDirectRender - { - get - { - return true; - } - } - - protected override string DirectRenderElementName - { - get - { - return "igc-progress-base"; - } - } - - protected override ControlEventBehavior DefaultEventBehavior - { - get { return ControlEventBehavior.Immediate; } - } - - public IgbProgressBase(): base() { - OnCreatedIgbProgressBase(); - - - } - - partial void OnCreatedIgbProgressBase(); - - private double _max = 0; - - partial void OnMaxChanging(ref double newValue); - /// - /// Maximum value of the control. - /// - [Parameter] - public double Max - { - get { return this._max; } - set { - if (this._max != value || !IsPropDirty("Max")) { - MarkPropDirty("Max"); - } - this._max = value; - - } - } - private double _value = 0; - - partial void OnValueChanging(ref double newValue); - /// - /// The value of the control. - /// - [Parameter] - public double Value - { - get { return this._value; } - set { - if (this._value != value || !IsPropDirty("Value")) { - MarkPropDirty("Value"); - } - this._value = value; - - } - } - private StyleVariant _variant = StyleVariant.Primary; - - partial void OnVariantChanging(ref StyleVariant newValue); - /// - /// The variant of the control. - /// - [Parameter] - public StyleVariant Variant - { - get { return this._variant; } - set { - if (this._variant != value || !IsPropDirty("Variant")) { - MarkPropDirty("Variant"); - } - this._variant = value; - - } - } - private double _animationDuration = 0; - - partial void OnAnimationDurationChanging(ref double newValue); - /// - /// Animation duration in milliseconds. - /// - [Parameter] - public double AnimationDuration - { - get { return this._animationDuration; } - set { - if (this._animationDuration != value || !IsPropDirty("AnimationDuration")) { - MarkPropDirty("AnimationDuration"); - } - this._animationDuration = value; - - } - } - private bool _indeterminate = false; - - partial void OnIndeterminateChanging(ref bool newValue); - /// - /// The indeterminate state of the control. - /// - [Parameter] - public bool Indeterminate - { - get { return this._indeterminate; } - set { - if (this._indeterminate != value || !IsPropDirty("Indeterminate")) { - MarkPropDirty("Indeterminate"); - } - this._indeterminate = value; - - } - } - private bool _hideLabel = false; - - partial void OnHideLabelChanging(ref bool newValue); - /// - /// Shows/hides the label of the control. - /// - [Parameter] - public bool HideLabel - { - get { return this._hideLabel; } - set { - if (this._hideLabel != value || !IsPropDirty("HideLabel")) { - MarkPropDirty("HideLabel"); - } - this._hideLabel = value; - - } - } - private string _labelFormat; - - partial void OnLabelFormatChanging(ref string newValue); - /// - /// Format string for the default label of the control. - /// Placeholders: - /// {0} - current value of the control. - /// {1} - max value of the control. - /// - [Parameter] - public string LabelFormat - { - get { return this._labelFormat; } - set { - if (this._labelFormat != value || !IsPropDirty("LabelFormat")) { - MarkPropDirty("LabelFormat"); - } - this._labelFormat = value; - - } - } - - partial void FindByNameProgressBase(string name, ref object item); - public override object FindByName(string name) - { - - var baseResult = base.FindByName(name); - if (baseResult != null) - { - return baseResult; - } - - object item = null; - FindByNameProgressBase(name, ref item); - if (item != null) - { - return item; - } - - return null; - } - public async Task SetNativeElementAsync(Object element) - { - await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); - } - public void SetNativeElement(Object element) - { - InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); - } - - partial void SerializeCoreIgbProgressBase(RendererSerializer ser); - - internal override void SerializeCore(RendererSerializer ser) - { - base.SerializeCore(ser); - - SerializeCoreIgbProgressBase(ser); - - if (IsPropDirty("Max")) { ser.AddNumberProp("max", this._max); } - if (IsPropDirty("Value")) { ser.AddNumberProp("value", this._value); } - if (IsPropDirty("Variant")) { ser.AddEnumProp("variant", this._variant); } - if (IsPropDirty("AnimationDuration")) { ser.AddNumberProp("animationDuration", this._animationDuration); } - if (IsPropDirty("Indeterminate")) { ser.AddBooleanProp("indeterminate", this._indeterminate); } - if (IsPropDirty("HideLabel")) { ser.AddBooleanProp("hideLabel", this._hideLabel); } - if (IsPropDirty("LabelFormat")) { ser.AddStringProp("labelFormat", this._labelFormat); } - - } - -} + public partial class IgbProgressBase : BaseRendererControl + { + public override string Type { get { return "WebProgressBase"; } } + + protected override string ResolveDisplay() + { + return "inline-block"; + } + + protected override bool SupportsVisualChildren + { + get + { + return true; + } + } + + protected override bool UseDirectRender + { + get + { + return true; + } + } + + protected override string DirectRenderElementName + { + get + { + return "igc-progress-base"; + } + } + + protected override ControlEventBehavior DefaultEventBehavior + { + get { return ControlEventBehavior.Immediate; } + } + + public IgbProgressBase() : base() + { + OnCreatedIgbProgressBase(); + + } + + partial void OnCreatedIgbProgressBase(); + + private double _max = 0; + + partial void OnMaxChanging(ref double newValue); + /// + /// Maximum value of the control. + /// + [Parameter] + public double Max + { + get { return this._max; } + set + { + if (this._max != value || !IsPropDirty("Max")) + { + MarkPropDirty("Max"); + } + this._max = value; + + } + } + private double _value = 0; + + partial void OnValueChanging(ref double newValue); + /// + /// The value of the control. + /// + [Parameter] + public double Value + { + get { return this._value; } + set + { + if (this._value != value || !IsPropDirty("Value")) + { + MarkPropDirty("Value"); + } + this._value = value; + + } + } + private StyleVariant _variant = StyleVariant.Primary; + + partial void OnVariantChanging(ref StyleVariant newValue); + /// + /// The variant of the control. + /// + [Parameter] + public StyleVariant Variant + { + get { return this._variant; } + set + { + if (this._variant != value || !IsPropDirty("Variant")) + { + MarkPropDirty("Variant"); + } + this._variant = value; + + } + } + private double _animationDuration = 0; + + partial void OnAnimationDurationChanging(ref double newValue); + /// + /// Animation duration in milliseconds. + /// + [Parameter] + public double AnimationDuration + { + get { return this._animationDuration; } + set + { + if (this._animationDuration != value || !IsPropDirty("AnimationDuration")) + { + MarkPropDirty("AnimationDuration"); + } + this._animationDuration = value; + + } + } + private bool _indeterminate = false; + + partial void OnIndeterminateChanging(ref bool newValue); + /// + /// The indeterminate state of the control. + /// + [Parameter] + public bool Indeterminate + { + get { return this._indeterminate; } + set + { + if (this._indeterminate != value || !IsPropDirty("Indeterminate")) + { + MarkPropDirty("Indeterminate"); + } + this._indeterminate = value; + + } + } + private bool _hideLabel = false; + + partial void OnHideLabelChanging(ref bool newValue); + /// + /// Shows/hides the label of the control. + /// + [Parameter] + public bool HideLabel + { + get { return this._hideLabel; } + set + { + if (this._hideLabel != value || !IsPropDirty("HideLabel")) + { + MarkPropDirty("HideLabel"); + } + this._hideLabel = value; + + } + } + private string _labelFormat; + + partial void OnLabelFormatChanging(ref string newValue); + /// + /// Format string for the default label of the control. + /// Placeholders: + /// {0} - current value of the control. + /// {1} - max value of the control. + /// + [Parameter] + public string LabelFormat + { + get { return this._labelFormat; } + set + { + if (this._labelFormat != value || !IsPropDirty("LabelFormat")) + { + MarkPropDirty("LabelFormat"); + } + this._labelFormat = value; + + } + } + + partial void FindByNameProgressBase(string name, ref object item); + public override object FindByName(string name) + { + + var baseResult = base.FindByName(name); + if (baseResult != null) + { + return baseResult; + } + + object item = null; + FindByNameProgressBase(name, ref item); + if (item != null) + { + return item; + } + + return null; + } + public async Task SetNativeElementAsync(Object element) + { + await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + } + public void SetNativeElement(Object element) + { + InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + } + + partial void SerializeCoreIgbProgressBase(RendererSerializer ser); + + internal override void SerializeCore(RendererSerializer ser) + { + base.SerializeCore(ser); + + SerializeCoreIgbProgressBase(ser); + + if (IsPropDirty("Max")) + { ser.AddNumberProp("max", this._max); } + if (IsPropDirty("Value")) + { ser.AddNumberProp("value", this._value); } + if (IsPropDirty("Variant")) + { ser.AddEnumProp("variant", this._variant); } + if (IsPropDirty("AnimationDuration")) + { ser.AddNumberProp("animationDuration", this._animationDuration); } + if (IsPropDirty("Indeterminate")) + { ser.AddBooleanProp("indeterminate", this._indeterminate); } + if (IsPropDirty("HideLabel")) + { ser.AddBooleanProp("hideLabel", this._hideLabel); } + if (IsPropDirty("LabelFormat")) + { ser.AddStringProp("labelFormat", this._labelFormat); } + + } + + } } diff --git a/src/components/Blazor/Radio.cs b/src/components/Blazor/Radio.cs index fcd0d635..9ac08668 100644 --- a/src/components/Blazor/Radio.cs +++ b/src/components/Blazor/Radio.cs @@ -1,549 +1,582 @@ - -using System; using Microsoft.AspNetCore.Components; -using Microsoft.AspNetCore.Components.Rendering; -using System.Threading.Tasks; -using System.Collections.Generic; -using System.Linq; namespace IgniteUI.Blazor.Controls { - public partial class IgbRadio: BaseRendererControl { - public override string Type { get { return "WebRadio"; } } + public partial class IgbRadio : BaseRendererControl + { + public override string Type { get { return "WebRadio"; } } - protected override void EnsureModulesLoaded() - { - if (!IgbRadioModule.IsLoadRequested(IgBlazor)) - { - IgbRadioModule.Register(IgBlazor); - } - } + protected override void EnsureModulesLoaded() + { + if (!IgbRadioModule.IsLoadRequested(IgBlazor)) + { + IgbRadioModule.Register(IgBlazor); + } + } - protected override string ResolveDisplay() - { - return "inline-block"; - } + protected override string ResolveDisplay() + { + return "inline-block"; + } - protected override bool SupportsVisualChildren - { - get - { - return true; - } - } + protected override bool SupportsVisualChildren + { + get + { + return true; + } + } + + protected override bool UseDirectRender + { + get + { + return true; + } + } + + protected override string DirectRenderElementName + { + get + { + return "igc-radio"; + } + } + + protected override ControlEventBehavior DefaultEventBehavior + { + get { return ControlEventBehavior.Immediate; } + } + + public IgbRadio() : base() + { + OnCreatedIgbRadio(); + + } + + partial void OnCreatedIgbRadio(); + + private bool _required = false; + + partial void OnRequiredChanging(ref bool newValue); + [Parameter] + public bool Required + { + get { return this._required; } + set + { + if (this._required != value || !IsPropDirty("Required")) + { + MarkPropDirty("Required"); + } + this._required = value; + + } + } + private string _value; + + partial void OnValueChanging(ref string newValue); + /// + /// The value attribute of the control. + /// + [Parameter] + public string Value + { + get { return this._value; } + set + { + if (this._value != value || !IsPropDirty("Value")) + { + MarkPropDirty("Value"); + } + this._value = value; + + } + } + private bool _checked = false; + + partial void OnCheckedChanging(ref bool newValue); + /// + /// The checked state of the control. + /// + [Parameter] + public bool Checked + { + get { return this._checked; } + set + { + if (this._checked != value || !IsPropDirty("Checked")) + { + MarkPropDirty("Checked"); + } + this._checked = value; + + } + } + public async Task GetCurrentCheckedAsync() + { + var iv = await InvokeMethod("p:Checked", new object[] { }, new string[] { }); + return ReturnToBoolean(iv); + } + public bool GetCurrentChecked() + { + var iv = InvokeMethodSync("p:Checked", new object[] { }, new string[] { }); + return ReturnToBoolean(iv); + } + private ToggleLabelPosition _labelPosition = ToggleLabelPosition.After; + + partial void OnLabelPositionChanging(ref ToggleLabelPosition newValue); + /// + /// The label position of the radio control. + /// + [Parameter] + public ToggleLabelPosition LabelPosition + { + get { return this._labelPosition; } + set + { + if (this._labelPosition != value || !IsPropDirty("LabelPosition")) + { + MarkPropDirty("LabelPosition"); + } + this._labelPosition = value; + + } + } + private bool _disabled = false; + + partial void OnDisabledChanging(ref bool newValue); + /// + /// The disabled state of the component + /// + [Parameter] + public bool Disabled + { + get { return this._disabled; } + set + { + if (this._disabled != value || !IsPropDirty("Disabled")) + { + MarkPropDirty("Disabled"); + } + this._disabled = value; + + } + } + private bool _invalid = false; + + partial void OnInvalidChanging(ref bool newValue); + /// + /// Control the validity of the control. + /// + [Parameter] + public bool Invalid + { + get { return this._invalid; } + set + { + if (this._invalid != value || !IsPropDirty("Invalid")) + { + MarkPropDirty("Invalid"); + } + this._invalid = value; + + } + } + + partial void FindByNameRadio(string name, ref object item); + public override object FindByName(string name) + { + + var baseResult = base.FindByName(name); + if (baseResult != null) + { + return baseResult; + } + + object item = null; + FindByNameRadio(name, ref item); + if (item != null) + { + return item; + } + + return null; + } + public async Task SetNativeElementAsync(Object element) + { + await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + } + public void SetNativeElement(Object element) + { + InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + } + /// + /// Simulates a click on the radio control. + /// + public async Task ClickAsync() + { + await InvokeMethod("click", new object[] { }, new string[] { }); + } + public void Click() + { + InvokeMethodSync("click", new object[] { }, new string[] { }); + } + /// + /// Sets focus on the radio control. + /// + + [WCWidgetMemberName("Focus")] + public async Task FocusComponentAsync(IgbFocusOptions options) + { + await InvokeMethod("focus", new object[] { ObjectToParam(options) }, new string[] { "Json" }); + } + + [WCWidgetMemberName("Focus")] + public void FocusComponent(IgbFocusOptions options) + { + InvokeMethodSync("focus", new object[] { ObjectToParam(options) }, new string[] { "Json" }); + } + /// + /// Removes focus from the radio control. + /// + + [WCWidgetMemberName("Blur")] + public async Task BlurComponentAsync() + { + await InvokeMethod("blur", new object[] { }, new string[] { }); + } + + [WCWidgetMemberName("Blur")] + public void BlurComponent() + { + InvokeMethodSync("blur", new object[] { }, new string[] { }); + } + /// + /// Checks for validity of the control and emits the invalid event if it invalid. + /// + public async Task CheckValidityAsync() + { + var iv = await InvokeMethod("checkValidity", new object[] { }, new string[] { }); + return ReturnToBoolean(iv); + } + public bool CheckValidity() + { + var iv = InvokeMethodSync("checkValidity", new object[] { }, new string[] { }); + return ReturnToBoolean(iv); + } + /// + /// Checks for validity of the control and shows the browser message if it invalid. + /// + public async Task ReportValidityAsync() + { + var iv = await InvokeMethod("reportValidity", new object[] { }, new string[] { }); + return ReturnToBoolean(iv); + } + public bool ReportValidity() + { + var iv = InvokeMethodSync("reportValidity", new object[] { }, new string[] { }); + return ReturnToBoolean(iv); + } + /// + /// Sets a custom validation message for the control. + /// As long as `message` is not empty, the control is considered invalid. + /// + public async Task SetCustomValidityAsync(String message) + { + await InvokeMethod("setCustomValidity", new object[] { StringToString(message) }, new string[] { "String" }); + } + public void SetCustomValidity(String message) + { + InvokeMethodSync("setCustomValidity", new object[] { StringToString(message) }, new string[] { "String" }); + } - protected override bool UseDirectRender + private EventCallback? _checkedChanged = null; + [Parameter] + public EventCallback CheckedChanged + { + get + { + return this._checkedChanged != null ? this._checkedChanged.Value : EventCallback.Empty; + } + set + { + if (!value.Equals(EventCallback.Empty)) + { + if (!CompareEventCallbacks(value, _checkedChanged, ref eventCallbacksCache)) + { + this.EnsureChangeHandled(); + + _checkedChanged = value; + } + } + else + { + _checkedChanged = null; + } + } + } + + private string _changeRef = null; + private string _changeScript = null; + [Parameter] + public string ChangeScript + { + + set + { + if (value != this._changeScript) + { + this._changeScript = value; + this.OnRefChanged("Change", null, value, true, false, (string refName, object oldValue, object newValue) => + { + this._changeRef = refName; + this.MarkPropDirty("ChangeRef"); + }); + } + } + get + { + return this._changeScript; + } + } + + partial void OnHandlingChange(IgbRadioChangeEventArgs args); + private EventCallback? _change = null; + [Parameter] + public EventCallback Change + { + get + { + return this._change != null ? this._change.Value : EventCallback.Empty; + } + set + { + if (!value.Equals(EventCallback.Empty)) + { + if (!CompareEventCallbacks(value, _change, ref eventCallbacksCache)) + { + _change = value; + this.SetHandler(this.Name, "Change", value, (args) => { - get + OnHandlingChange(args); + + var newValueChecked = default(bool); + + { + newValueChecked = (bool)(args.Detail.Checked); + ; + OnEventUpdatingChecked(this._checked, ref newValueChecked); + if (UseDirectRender) { - return true; + //TODO: maybe we should be doing this for everything. Need to make sure we don't infinity bounce though. + this.Checked = newValueChecked; } - } - - protected override string DirectRenderElementName - { - get + else { - return "igc-radio"; + this._checked = newValueChecked; } - } + OnPropertyPropagatedOut(Name, "Checked"); + } - protected override ControlEventBehavior DefaultEventBehavior + if (!EventCallback.Empty.Equals(CheckedChanged)) { - get { return ControlEventBehavior.Immediate; } + var task = CheckedChanged.InvokeAsync(newValueChecked); + if (task.Exception != null) + { + throw task.Exception; + } } - - public IgbRadio(): base() { - OnCreatedIgbRadio(); - - - } - - partial void OnCreatedIgbRadio(); - - private bool _required = false; - - partial void OnRequiredChanging(ref bool newValue); - [Parameter] - public bool Required - { - get { return this._required; } - set { - if (this._required != value || !IsPropDirty("Required")) { - MarkPropDirty("Required"); - } - this._required = value; - - } - } - private string _value; - - partial void OnValueChanging(ref string newValue); - /// - /// The value attribute of the control. - /// - [Parameter] - public string Value - { - get { return this._value; } - set { - if (this._value != value || !IsPropDirty("Value")) { - MarkPropDirty("Value"); - } - this._value = value; - - } - } - private bool _checked = false; - - partial void OnCheckedChanging(ref bool newValue); - /// - /// The checked state of the control. - /// - [Parameter] - public bool Checked - { - get { return this._checked; } - set { - if (this._checked != value || !IsPropDirty("Checked")) { - MarkPropDirty("Checked"); - } - this._checked = value; - - } - } - public async Task GetCurrentCheckedAsync() - { - var iv = await InvokeMethod("p:Checked", new object[] { }, new string[] { }); - return ReturnToBoolean(iv); - } - public bool GetCurrentChecked() - { - var iv = InvokeMethodSync("p:Checked", new object[] { }, new string[] { }); - return ReturnToBoolean(iv); - } - private ToggleLabelPosition _labelPosition = ToggleLabelPosition.After; - - partial void OnLabelPositionChanging(ref ToggleLabelPosition newValue); - /// - /// The label position of the radio control. - /// - [Parameter] - public ToggleLabelPosition LabelPosition - { - get { return this._labelPosition; } - set { - if (this._labelPosition != value || !IsPropDirty("LabelPosition")) { - MarkPropDirty("LabelPosition"); - } - this._labelPosition = value; - - } - } - private bool _disabled = false; - - partial void OnDisabledChanging(ref bool newValue); - /// - /// The disabled state of the component - /// - [Parameter] - public bool Disabled - { - get { return this._disabled; } - set { - if (this._disabled != value || !IsPropDirty("Disabled")) { - MarkPropDirty("Disabled"); - } - this._disabled = value; - - } - } - private bool _invalid = false; - - partial void OnInvalidChanging(ref bool newValue); - /// - /// Control the validity of the control. - /// - [Parameter] - public bool Invalid - { - get { return this._invalid; } - set { - if (this._invalid != value || !IsPropDirty("Invalid")) { - MarkPropDirty("Invalid"); - } - this._invalid = value; - - } - } - - partial void FindByNameRadio(string name, ref object item); - public override object FindByName(string name) - { - - var baseResult = base.FindByName(name); - if (baseResult != null) - { - return baseResult; - } - - object item = null; - FindByNameRadio(name, ref item); - if (item != null) - { - return item; - } - - return null; - } - public async Task SetNativeElementAsync(Object element) - { - await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); - } - public void SetNativeElement(Object element) - { - InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); - } - /// - /// Simulates a click on the radio control. - /// - public async Task ClickAsync() - { - await InvokeMethod("click", new object[] { }, new string[] { }); - } - public void Click() - { - InvokeMethodSync("click", new object[] { }, new string[] { }); - } - /// - /// Sets focus on the radio control. - /// - - [WCWidgetMemberName("Focus")] - public async Task FocusComponentAsync(IgbFocusOptions options) - { - await InvokeMethod("focus", new object[] { ObjectToParam(options) }, new string[] { "Json" }); - } - - [WCWidgetMemberName("Focus")] - public void FocusComponent(IgbFocusOptions options) - { - InvokeMethodSync("focus", new object[] { ObjectToParam(options) }, new string[] { "Json" }); - } - /// - /// Removes focus from the radio control. - /// - - [WCWidgetMemberName("Blur")] - public async Task BlurComponentAsync() - { - await InvokeMethod("blur", new object[] { }, new string[] { }); - } - - [WCWidgetMemberName("Blur")] - public void BlurComponent() - { - InvokeMethodSync("blur", new object[] { }, new string[] { }); - } - /// - /// Checks for validity of the control and emits the invalid event if it invalid. - /// - public async Task CheckValidityAsync() - { - var iv = await InvokeMethod("checkValidity", new object[] { }, new string[] { }); - return ReturnToBoolean(iv); - } - public bool CheckValidity() - { - var iv = InvokeMethodSync("checkValidity", new object[] { }, new string[] { }); - return ReturnToBoolean(iv); - } - /// - /// Checks for validity of the control and shows the browser message if it invalid. - /// - public async Task ReportValidityAsync() - { - var iv = await InvokeMethod("reportValidity", new object[] { }, new string[] { }); - return ReturnToBoolean(iv); - } - public bool ReportValidity() - { - var iv = InvokeMethodSync("reportValidity", new object[] { }, new string[] { }); - return ReturnToBoolean(iv); - } - /// - /// Sets a custom validation message for the control. - /// As long as `message` is not empty, the control is considered invalid. - /// - public async Task SetCustomValidityAsync(String message) - { - await InvokeMethod("setCustomValidity", new object[] { StringToString(message) }, new string[] { "String" }); - } - public void SetCustomValidity(String message) - { - InvokeMethodSync("setCustomValidity", new object[] { StringToString(message) }, new string[] { "String" }); - } - - private EventCallback? _checkedChanged = null; - [Parameter] - public EventCallback CheckedChanged - { - get - { - return this._checkedChanged != null ? this._checkedChanged.Value : EventCallback.Empty; - } - set - { - if (!value.Equals(EventCallback.Empty)) - { - if (!CompareEventCallbacks(value, _checkedChanged, ref eventCallbacksCache)) - { - this.EnsureChangeHandled(); - - _checkedChanged = value; - } - } - else - { - _checkedChanged = null; - } - } - } - - private string _changeRef = null; - private string _changeScript = null; - [Parameter] - public string ChangeScript { - - set - { - if (value != this._changeScript) - { - this._changeScript = value; - this.OnRefChanged("Change", null, value, true, false, (string refName, object oldValue, object newValue) => { - this._changeRef = refName; - this.MarkPropDirty("ChangeRef"); - }); - } - } - get - { - return this._changeScript; - } - } - - partial void OnHandlingChange(IgbRadioChangeEventArgs args); - private EventCallback? _change = null; - [Parameter] - public EventCallback Change - { - get - { - return this._change != null ? this._change.Value : EventCallback.Empty; - } - set - { - if (!value.Equals(EventCallback.Empty)) - { - if (!CompareEventCallbacks(value, _change, ref eventCallbacksCache)) - { - _change = value; - this.SetHandler(this.Name, "Change", value, (args) => { - OnHandlingChange(args); - - var newValueChecked = default(bool); - - - { - newValueChecked = (bool)(args.Detail.Checked); - ; - OnEventUpdatingChecked(this._checked, ref newValueChecked); - if (UseDirectRender) { - //TODO: maybe we should be doing this for everything. Need to make sure we don't infinity bounce though. - this.Checked = newValueChecked; - } else { - this._checked = newValueChecked; - } - OnPropertyPropagatedOut(Name, "Checked"); - } - - if (!EventCallback.Empty.Equals(CheckedChanged)) - { - var task = CheckedChanged.InvokeAsync(newValueChecked); - if (task.Exception != null) - { - throw task.Exception; - } - } - - }); - this.OnRefChanged("Change", null, "event:::Change", true, false, (refName, oldValue, newValue) => { - this._changeRef = refName; - this.MarkPropDirty("ChangeRef"); - }); - } - } - else - { - _change = null; - this.SetHandler(this.Name, "Change", null); - this.OnRefChanged("Change", null, null, true, false, (refName, oldValue, newValue) => { - this._changeRef = null; - this.MarkPropDirty("ChangeRef"); - }); - } - } - } - internal void EnsureChangeHandled() - { - if (EventCallback.Empty.Equals(this.Change)) - { - this.Change = new EventCallback(null, (Action)((e) => { })); this._change = null; - } - } - - - private string _focusRef = null; - private string _focusScript = null; - [Parameter] - public string FocusScript { - - set - { - if (value != this._focusScript) - { - this._focusScript = value; - this.OnRefChanged("Focus", null, value, true, false, (string refName, object oldValue, object newValue) => { - this._focusRef = refName; - this.MarkPropDirty("FocusRef"); - }); - } - } - get - { - return this._focusScript; - } - } - - partial void OnHandlingFocus(IgbVoidEventArgs args); - private EventCallback? _focus = null; - [Parameter] - public EventCallback Focus - { - get - { - return this._focus != null ? this._focus.Value : EventCallback.Empty; - } - set - { - if (!value.Equals(EventCallback.Empty)) - { - if (!CompareEventCallbacks(value, _focus, ref eventCallbacksCache)) - { - _focus = value; - this.SetHandler(this.Name, "Focus", value, (args) => { - OnHandlingFocus(args); - - }); - this.OnRefChanged("Focus", null, "nativeEvent:::Focus", true, false, (refName, oldValue, newValue) => { - this._focusRef = refName; - this.MarkPropDirty("FocusRef"); - }); - } - } - else - { - _focus = null; - this.SetHandler(this.Name, "Focus", null); - this.OnRefChanged("Focus", null, null, true, false, (refName, oldValue, newValue) => { - this._focusRef = null; - this.MarkPropDirty("FocusRef"); - }); - } - } - } - - private string _blurRef = null; - private string _blurScript = null; - [Parameter] - public string BlurScript { - - set - { - if (value != this._blurScript) - { - this._blurScript = value; - this.OnRefChanged("Blur", null, value, true, false, (string refName, object oldValue, object newValue) => { - this._blurRef = refName; - this.MarkPropDirty("BlurRef"); - }); - } - } - get - { - return this._blurScript; - } - } - - partial void OnHandlingBlur(IgbVoidEventArgs args); - private EventCallback? _blur = null; - [Parameter] - public EventCallback Blur - { - get - { - return this._blur != null ? this._blur.Value : EventCallback.Empty; - } - set - { - if (!value.Equals(EventCallback.Empty)) - { - if (!CompareEventCallbacks(value, _blur, ref eventCallbacksCache)) - { - _blur = value; - this.SetHandler(this.Name, "Blur", value, (args) => { - OnHandlingBlur(args); - - }); - this.OnRefChanged("Blur", null, "nativeEvent:::Blur", true, false, (refName, oldValue, newValue) => { - this._blurRef = refName; - this.MarkPropDirty("BlurRef"); - }); - } - } - else - { - _blur = null; - this.SetHandler(this.Name, "Blur", null); - this.OnRefChanged("Blur", null, null, true, false, (refName, oldValue, newValue) => { - this._blurRef = null; - this.MarkPropDirty("BlurRef"); - }); - } - } - } - - partial void OnEventUpdatingChecked(bool oldValue, ref bool newValue); - - partial void SerializeCoreIgbRadio(RendererSerializer ser); - - internal override void SerializeCore(RendererSerializer ser) - { - base.SerializeCore(ser); - - SerializeCoreIgbRadio(ser); - - if (IsPropDirty("Required")) { ser.AddBooleanProp("required", this._required); } - if (IsPropDirty("Value")) { ser.AddStringProp("value", this._value); } - if (IsPropDirty("Checked")) { ser.AddBooleanProp("checked", this._checked); } - if (IsPropDirty("LabelPosition")) { ser.AddEnumProp("labelPosition", this._labelPosition); } - if (IsPropDirty("Disabled")) { ser.AddBooleanProp("disabled", this._disabled); } - if (IsPropDirty("Invalid")) { ser.AddBooleanProp("invalid", this._invalid); } - if (IsPropDirty("ChangeRef")) { ser.AddStringProp("changeRef", this._changeRef); } - if (IsPropDirty("FocusRef")) { ser.AddStringProp("focusRef", this._focusRef); } - if (IsPropDirty("BlurRef")) { ser.AddStringProp("blurRef", this._blurRef); } - - } - -} + + }); + this.OnRefChanged("Change", null, "event:::Change", true, false, (refName, oldValue, newValue) => + { + this._changeRef = refName; + this.MarkPropDirty("ChangeRef"); + }); + } + } + else + { + _change = null; + this.SetHandler(this.Name, "Change", null); + this.OnRefChanged("Change", null, null, true, false, (refName, oldValue, newValue) => + { + this._changeRef = null; + this.MarkPropDirty("ChangeRef"); + }); + } + } + } + internal void EnsureChangeHandled() + { + if (EventCallback.Empty.Equals(this.Change)) + { + this.Change = new EventCallback(null, (Action)((e) => { })); + this._change = null; + } + } + + private string _focusRef = null; + private string _focusScript = null; + [Parameter] + public string FocusScript + { + + set + { + if (value != this._focusScript) + { + this._focusScript = value; + this.OnRefChanged("Focus", null, value, true, false, (string refName, object oldValue, object newValue) => + { + this._focusRef = refName; + this.MarkPropDirty("FocusRef"); + }); + } + } + get + { + return this._focusScript; + } + } + + partial void OnHandlingFocus(IgbVoidEventArgs args); + private EventCallback? _focus = null; + [Parameter] + public EventCallback Focus + { + get + { + return this._focus != null ? this._focus.Value : EventCallback.Empty; + } + set + { + if (!value.Equals(EventCallback.Empty)) + { + if (!CompareEventCallbacks(value, _focus, ref eventCallbacksCache)) + { + _focus = value; + this.SetHandler(this.Name, "Focus", value, (args) => + { + OnHandlingFocus(args); + + }); + this.OnRefChanged("Focus", null, "nativeEvent:::Focus", true, false, (refName, oldValue, newValue) => + { + this._focusRef = refName; + this.MarkPropDirty("FocusRef"); + }); + } + } + else + { + _focus = null; + this.SetHandler(this.Name, "Focus", null); + this.OnRefChanged("Focus", null, null, true, false, (refName, oldValue, newValue) => + { + this._focusRef = null; + this.MarkPropDirty("FocusRef"); + }); + } + } + } + + private string _blurRef = null; + private string _blurScript = null; + [Parameter] + public string BlurScript + { + + set + { + if (value != this._blurScript) + { + this._blurScript = value; + this.OnRefChanged("Blur", null, value, true, false, (string refName, object oldValue, object newValue) => + { + this._blurRef = refName; + this.MarkPropDirty("BlurRef"); + }); + } + } + get + { + return this._blurScript; + } + } + + partial void OnHandlingBlur(IgbVoidEventArgs args); + private EventCallback? _blur = null; + [Parameter] + public EventCallback Blur + { + get + { + return this._blur != null ? this._blur.Value : EventCallback.Empty; + } + set + { + if (!value.Equals(EventCallback.Empty)) + { + if (!CompareEventCallbacks(value, _blur, ref eventCallbacksCache)) + { + _blur = value; + this.SetHandler(this.Name, "Blur", value, (args) => + { + OnHandlingBlur(args); + + }); + this.OnRefChanged("Blur", null, "nativeEvent:::Blur", true, false, (refName, oldValue, newValue) => + { + this._blurRef = refName; + this.MarkPropDirty("BlurRef"); + }); + } + } + else + { + _blur = null; + this.SetHandler(this.Name, "Blur", null); + this.OnRefChanged("Blur", null, null, true, false, (refName, oldValue, newValue) => + { + this._blurRef = null; + this.MarkPropDirty("BlurRef"); + }); + } + } + } + + partial void OnEventUpdatingChecked(bool oldValue, ref bool newValue); + + partial void SerializeCoreIgbRadio(RendererSerializer ser); + + internal override void SerializeCore(RendererSerializer ser) + { + base.SerializeCore(ser); + + SerializeCoreIgbRadio(ser); + + if (IsPropDirty("Required")) + { ser.AddBooleanProp("required", this._required); } + if (IsPropDirty("Value")) + { ser.AddStringProp("value", this._value); } + if (IsPropDirty("Checked")) + { ser.AddBooleanProp("checked", this._checked); } + if (IsPropDirty("LabelPosition")) + { ser.AddEnumProp("labelPosition", this._labelPosition); } + if (IsPropDirty("Disabled")) + { ser.AddBooleanProp("disabled", this._disabled); } + if (IsPropDirty("Invalid")) + { ser.AddBooleanProp("invalid", this._invalid); } + if (IsPropDirty("ChangeRef")) + { ser.AddStringProp("changeRef", this._changeRef); } + if (IsPropDirty("FocusRef")) + { ser.AddStringProp("focusRef", this._focusRef); } + if (IsPropDirty("BlurRef")) + { ser.AddStringProp("blurRef", this._blurRef); } + + } + + } } diff --git a/src/components/Blazor/RadioChangeEventArgs.cs b/src/components/Blazor/RadioChangeEventArgs.cs index cdfa9da5..3a74187b 100644 --- a/src/components/Blazor/RadioChangeEventArgs.cs +++ b/src/components/Blazor/RadioChangeEventArgs.cs @@ -1,99 +1,97 @@ - -using System; using Microsoft.AspNetCore.Components; -using Microsoft.AspNetCore.Components.Rendering; -using System.Threading.Tasks; -using System.Collections.Generic; -using System.Linq; namespace IgniteUI.Blazor.Controls { - public partial class IgbRadioChangeEventArgs: BaseRendererElement { - public override string Type { get { return "WebRadioChangeEventArgs"; } } - - - private static bool _marshalByValue = true; - - public IgbRadioChangeEventArgs(): base() { - OnCreatedIgbRadioChangeEventArgs(); - - - } - - partial void OnCreatedIgbRadioChangeEventArgs(); - - private IgbRadioChangeEventArgsDetail _detail; - - partial void OnDetailChanging(ref IgbRadioChangeEventArgsDetail newValue); - [Parameter] - public IgbRadioChangeEventArgsDetail Detail - { - get { return this._detail; } - set { - OnDetailChanging(ref value); - MarkPropDirty("Detail"); - if (this._detail != null) { - this.DetachChild(this._detail); - } - if (value != null) { - this.AttachChild(value); - } - this._detail = value; - } - - } - - partial void FindByNameRadioChangeEventArgs(string name, ref object item); - public override object FindByName(string name) - { - - var baseResult = base.FindByName(name); - if (baseResult != null) - { - return baseResult; - } - - object item = null; - FindByNameRadioChangeEventArgs(name, ref item); - if (item != null) - { - return item; - } - - return null; - } - - partial void SerializeCoreIgbRadioChangeEventArgs(RendererSerializer ser); - - internal override void SerializeCore(RendererSerializer ser) - { - base.SerializeCore(ser); - - SerializeCoreIgbRadioChangeEventArgs(ser); - - if (IsPropDirty("Detail")) { ser.AddSerializableProp("detail", this._detail); } - - } - - - protected internal override void ToEventJson(BaseRendererControl control, Dictionary args) - { - base.ToEventJson(control, args); - - if (IsPropDirty("Detail")) { args["detail"] = ObjectToParam(this._detail); } - - - } - - - protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) { - base.FromEventJson(control, args); - this.SuppressParentNotify = true; - - if (args.ContainsKey("detail")) { this.Detail = (IgbRadioChangeEventArgsDetail)ConvertReturnValue(args["detail"], "RadioChangeEventArgsDetail", true); } - - this.SuppressParentNotify = false; - } - -} + public partial class IgbRadioChangeEventArgs : BaseRendererElement + { + public override string Type { get { return "WebRadioChangeEventArgs"; } } + + private static bool _marshalByValue = true; + + public IgbRadioChangeEventArgs() : base() + { + OnCreatedIgbRadioChangeEventArgs(); + + } + + partial void OnCreatedIgbRadioChangeEventArgs(); + + private IgbRadioChangeEventArgsDetail _detail; + + partial void OnDetailChanging(ref IgbRadioChangeEventArgsDetail newValue); + [Parameter] + public IgbRadioChangeEventArgsDetail Detail + { + get { return this._detail; } + set + { + OnDetailChanging(ref value); + MarkPropDirty("Detail"); + if (this._detail != null) + { + this.DetachChild(this._detail); + } + if (value != null) + { + this.AttachChild(value); + } + this._detail = value; + } + + } + + partial void FindByNameRadioChangeEventArgs(string name, ref object item); + public override object FindByName(string name) + { + + var baseResult = base.FindByName(name); + if (baseResult != null) + { + return baseResult; + } + + object item = null; + FindByNameRadioChangeEventArgs(name, ref item); + if (item != null) + { + return item; + } + + return null; + } + + partial void SerializeCoreIgbRadioChangeEventArgs(RendererSerializer ser); + + internal override void SerializeCore(RendererSerializer ser) + { + base.SerializeCore(ser); + + SerializeCoreIgbRadioChangeEventArgs(ser); + + if (IsPropDirty("Detail")) + { ser.AddSerializableProp("detail", this._detail); } + + } + + protected internal override void ToEventJson(BaseRendererControl control, Dictionary args) + { + base.ToEventJson(control, args); + + if (IsPropDirty("Detail")) + { args["detail"] = ObjectToParam(this._detail); } + + } + + protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) + { + base.FromEventJson(control, args); + this.SuppressParentNotify = true; + + if (args.ContainsKey("detail")) + { this.Detail = (IgbRadioChangeEventArgsDetail)ConvertReturnValue(args["detail"], "RadioChangeEventArgsDetail", true); } + + this.SuppressParentNotify = false; + } + + } } diff --git a/src/components/Blazor/RadioChangeEventArgsDetail.cs b/src/components/Blazor/RadioChangeEventArgsDetail.cs index 3058e986..72a659cd 100644 --- a/src/components/Blazor/RadioChangeEventArgsDetail.cs +++ b/src/components/Blazor/RadioChangeEventArgsDetail.cs @@ -1,120 +1,122 @@ - -using System; using Microsoft.AspNetCore.Components; -using Microsoft.AspNetCore.Components.Rendering; -using System.Threading.Tasks; -using System.Collections.Generic; -using System.Linq; namespace IgniteUI.Blazor.Controls { - public partial class IgbRadioChangeEventArgsDetail: BaseRendererElement { - public override string Type { get { return "WebRadioChangeEventArgsDetail"; } } - - - private static bool _marshalByValue = true; - - public IgbRadioChangeEventArgsDetail(): base() { - OnCreatedIgbRadioChangeEventArgsDetail(); - - - } - - partial void OnCreatedIgbRadioChangeEventArgsDetail(); - - private bool _checked = false; - - partial void OnCheckedChanging(ref bool newValue); - [Parameter] - public bool Checked - { - get { return this._checked; } - set { - if (this._checked != value || !IsPropDirty("Checked")) { - MarkPropDirty("Checked"); - } - this._checked = value; - - } - } - private string _value; - - partial void OnValueChanging(ref string newValue); - [Parameter] - public string Value - { - get { return this._value; } - set { - if (this._value != value || !IsPropDirty("Value")) { - MarkPropDirty("Value"); - } - this._value = value; - - } - } - - partial void FindByNameRadioChangeEventArgsDetail(string name, ref object item); - public override object FindByName(string name) - { - - var baseResult = base.FindByName(name); - if (baseResult != null) - { - return baseResult; - } - - object item = null; - FindByNameRadioChangeEventArgsDetail(name, ref item); - if (item != null) - { - return item; - } - - return null; - } - public async Task SetNativeElementAsync(Object element) - { - await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); - } - public void SetNativeElement(Object element) - { - InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); - } - - partial void SerializeCoreIgbRadioChangeEventArgsDetail(RendererSerializer ser); - - internal override void SerializeCore(RendererSerializer ser) - { - base.SerializeCore(ser); - - SerializeCoreIgbRadioChangeEventArgsDetail(ser); - - if (IsPropDirty("Checked")) { ser.AddBooleanProp("checked", this._checked); } - if (IsPropDirty("Value")) { ser.AddStringProp("value", this._value); } - - } - - - protected internal override void ToEventJson(BaseRendererControl control, Dictionary args) - { - base.ToEventJson(control, args); - - if (IsPropDirty("Checked")) { args["checked"] = (this._checked).ToString().ToLower(); } - if (IsPropDirty("Value")) { args["value"] = this._value; } - - - } - - - protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) { - base.FromEventJson(control, args); - this.SuppressParentNotify = true; - - if (args.ContainsKey("checked")) { this.Checked = ReturnToBoolean(args["checked"]); } - if (args.ContainsKey("value")) { this.Value = ReturnToString(args["value"]); } - - this.SuppressParentNotify = false; - } - -} + public partial class IgbRadioChangeEventArgsDetail : BaseRendererElement + { + public override string Type { get { return "WebRadioChangeEventArgsDetail"; } } + + private static bool _marshalByValue = true; + + public IgbRadioChangeEventArgsDetail() : base() + { + OnCreatedIgbRadioChangeEventArgsDetail(); + + } + + partial void OnCreatedIgbRadioChangeEventArgsDetail(); + + private bool _checked = false; + + partial void OnCheckedChanging(ref bool newValue); + [Parameter] + public bool Checked + { + get { return this._checked; } + set + { + if (this._checked != value || !IsPropDirty("Checked")) + { + MarkPropDirty("Checked"); + } + this._checked = value; + + } + } + private string _value; + + partial void OnValueChanging(ref string newValue); + [Parameter] + public string Value + { + get { return this._value; } + set + { + if (this._value != value || !IsPropDirty("Value")) + { + MarkPropDirty("Value"); + } + this._value = value; + + } + } + + partial void FindByNameRadioChangeEventArgsDetail(string name, ref object item); + public override object FindByName(string name) + { + + var baseResult = base.FindByName(name); + if (baseResult != null) + { + return baseResult; + } + + object item = null; + FindByNameRadioChangeEventArgsDetail(name, ref item); + if (item != null) + { + return item; + } + + return null; + } + public async Task SetNativeElementAsync(Object element) + { + await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + } + public void SetNativeElement(Object element) + { + InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + } + + partial void SerializeCoreIgbRadioChangeEventArgsDetail(RendererSerializer ser); + + internal override void SerializeCore(RendererSerializer ser) + { + base.SerializeCore(ser); + + SerializeCoreIgbRadioChangeEventArgsDetail(ser); + + if (IsPropDirty("Checked")) + { ser.AddBooleanProp("checked", this._checked); } + if (IsPropDirty("Value")) + { ser.AddStringProp("value", this._value); } + + } + + protected internal override void ToEventJson(BaseRendererControl control, Dictionary args) + { + base.ToEventJson(control, args); + + if (IsPropDirty("Checked")) + { args["checked"] = (this._checked).ToString().ToLower(); } + if (IsPropDirty("Value")) + { args["value"] = this._value; } + + } + + protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) + { + base.FromEventJson(control, args); + this.SuppressParentNotify = true; + + if (args.ContainsKey("checked")) + { this.Checked = ReturnToBoolean(args["checked"]); } + if (args.ContainsKey("value")) + { this.Value = ReturnToString(args["value"]); } + + this.SuppressParentNotify = false; + } + + } } diff --git a/src/components/Blazor/RadioGroup.cs b/src/components/Blazor/RadioGroup.cs index e761e521..22965648 100644 --- a/src/components/Blazor/RadioGroup.cs +++ b/src/components/Blazor/RadioGroup.cs @@ -1,278 +1,287 @@ - -using System; using Microsoft.AspNetCore.Components; -using Microsoft.AspNetCore.Components.Rendering; -using System.Threading.Tasks; -using System.Collections.Generic; -using System.Linq; namespace IgniteUI.Blazor.Controls { - /// -/// The igc-radio-group component unifies one or more igc-radio buttons. -/// -public partial class IgbRadioGroup: BaseRendererControl { - public override string Type { get { return "WebRadioGroup"; } } + /// + /// The igc-radio-group component unifies one or more igc-radio buttons. + /// + public partial class IgbRadioGroup : BaseRendererControl + { + public override string Type { get { return "WebRadioGroup"; } } - protected override void EnsureModulesLoaded() - { - if (!IgbRadioGroupModule.IsLoadRequested(IgBlazor)) - { - IgbRadioGroupModule.Register(IgBlazor); - } - } + protected override void EnsureModulesLoaded() + { + if (!IgbRadioGroupModule.IsLoadRequested(IgBlazor)) + { + IgbRadioGroupModule.Register(IgBlazor); + } + } - protected override string ResolveDisplay() - { - return "inline-block"; - } + protected override string ResolveDisplay() + { + return "inline-block"; + } - protected override bool SupportsVisualChildren - { - get - { - return true; - } - } + protected override bool SupportsVisualChildren + { + get + { + return true; + } + } + + protected override bool UseDirectRender + { + get + { + return true; + } + } + + protected override string DirectRenderElementName + { + get + { + return "igc-radio-group"; + } + } + + protected override ControlEventBehavior DefaultEventBehavior + { + get { return ControlEventBehavior.Immediate; } + } + + public IgbRadioGroup() : base() + { + OnCreatedIgbRadioGroup(); + + } + + partial void OnCreatedIgbRadioGroup(); + + private ContentOrientation _alignment = ContentOrientation.Horizontal; + + partial void OnAlignmentChanging(ref ContentOrientation newValue); + /// + /// Alignment of the radio controls inside this group. + /// + [Parameter] + public ContentOrientation Alignment + { + get { return this._alignment; } + set + { + if (this._alignment != value || !IsPropDirty("Alignment")) + { + MarkPropDirty("Alignment"); + } + this._alignment = value; + + } + } + private string _value; + + partial void OnValueChanging(ref string newValue); + /// + /// Gets/Sets the checked igc-radio element that matches `value` + /// + [Parameter] + public string Value + { + get { return this._value; } + set + { + if (this._value != value || !IsPropDirty("Value")) + { + MarkPropDirty("Value"); + } + this._value = value; + + } + } + public async Task GetCurrentValueAsync() + { + var iv = await InvokeMethod("p:Value", new object[] { }, new string[] { }); + return ReturnToString(iv); + } + public string GetCurrentValue() + { + var iv = InvokeMethodSync("p:Value", new object[] { }, new string[] { }); + return ReturnToString(iv); + } + + partial void FindByNameRadioGroup(string name, ref object item); + public override object FindByName(string name) + { + + var baseResult = base.FindByName(name); + if (baseResult != null) + { + return baseResult; + } + + object item = null; + FindByNameRadioGroup(name, ref item); + if (item != null) + { + return item; + } + + return null; + } + public async Task SetNativeElementAsync(Object element) + { + await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + } + public void SetNativeElement(Object element) + { + InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + } - protected override bool UseDirectRender + private EventCallback? _valueChanged = null; + [Parameter] + public EventCallback ValueChanged + { + get + { + return this._valueChanged != null ? this._valueChanged.Value : EventCallback.Empty; + } + set + { + if (!value.Equals(EventCallback.Empty)) + { + if (!CompareEventCallbacks(value, _valueChanged, ref eventCallbacksCache)) + { + this.EnsureChangeHandled(); + + _valueChanged = value; + } + } + else + { + _valueChanged = null; + } + } + } + + private string _changeRef = null; + private string _changeScript = null; + [Parameter] + public string ChangeScript + { + + set + { + if (value != this._changeScript) + { + this._changeScript = value; + this.OnRefChanged("Change", null, value, true, false, (string refName, object oldValue, object newValue) => + { + this._changeRef = refName; + this.MarkPropDirty("ChangeRef"); + }); + } + } + get + { + return this._changeScript; + } + } + + partial void OnHandlingChange(IgbRadioChangeEventArgs args); + private EventCallback? _change = null; + [Parameter] + public EventCallback Change + { + get + { + return this._change != null ? this._change.Value : EventCallback.Empty; + } + set + { + if (!value.Equals(EventCallback.Empty)) + { + if (!CompareEventCallbacks(value, _change, ref eventCallbacksCache)) + { + _change = value; + this.SetHandler(this.Name, "Change", value, (args) => { - get + OnHandlingChange(args); + + var newValueValue = default(string); + + { + newValueValue = (string)(args.Detail.Value); + ; + OnEventUpdatingValue(this._value, ref newValueValue); + if (UseDirectRender) { - return true; + //TODO: maybe we should be doing this for everything. Need to make sure we don't infinity bounce though. + this.Value = newValueValue; } - } - - protected override string DirectRenderElementName - { - get + else { - return "igc-radio-group"; + this._value = newValueValue; } - } + OnPropertyPropagatedOut(Name, "Value"); + } - protected override ControlEventBehavior DefaultEventBehavior + if (!EventCallback.Empty.Equals(ValueChanged)) { - get { return ControlEventBehavior.Immediate; } + var task = ValueChanged.InvokeAsync(newValueValue); + if (task.Exception != null) + { + throw task.Exception; + } } - - public IgbRadioGroup(): base() { - OnCreatedIgbRadioGroup(); - - - } - - partial void OnCreatedIgbRadioGroup(); - - private ContentOrientation _alignment = ContentOrientation.Horizontal; - - partial void OnAlignmentChanging(ref ContentOrientation newValue); - /// - /// Alignment of the radio controls inside this group. - /// - [Parameter] - public ContentOrientation Alignment - { - get { return this._alignment; } - set { - if (this._alignment != value || !IsPropDirty("Alignment")) { - MarkPropDirty("Alignment"); - } - this._alignment = value; - - } - } - private string _value; - - partial void OnValueChanging(ref string newValue); - /// - /// Gets/Sets the checked igc-radio element that matches `value` - /// - [Parameter] - public string Value - { - get { return this._value; } - set { - if (this._value != value || !IsPropDirty("Value")) { - MarkPropDirty("Value"); - } - this._value = value; - - } - } - public async Task GetCurrentValueAsync() - { - var iv = await InvokeMethod("p:Value", new object[] { }, new string[] { }); - return ReturnToString(iv); - } - public string GetCurrentValue() - { - var iv = InvokeMethodSync("p:Value", new object[] { }, new string[] { }); - return ReturnToString(iv); - } - - partial void FindByNameRadioGroup(string name, ref object item); - public override object FindByName(string name) - { - - var baseResult = base.FindByName(name); - if (baseResult != null) - { - return baseResult; - } - - object item = null; - FindByNameRadioGroup(name, ref item); - if (item != null) - { - return item; - } - - return null; - } - public async Task SetNativeElementAsync(Object element) - { - await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); - } - public void SetNativeElement(Object element) - { - InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); - } - - private EventCallback? _valueChanged = null; - [Parameter] - public EventCallback ValueChanged - { - get - { - return this._valueChanged != null ? this._valueChanged.Value : EventCallback.Empty; - } - set - { - if (!value.Equals(EventCallback.Empty)) - { - if (!CompareEventCallbacks(value, _valueChanged, ref eventCallbacksCache)) - { - this.EnsureChangeHandled(); - - _valueChanged = value; - } - } - else - { - _valueChanged = null; - } - } - } - - private string _changeRef = null; - private string _changeScript = null; - [Parameter] - public string ChangeScript { - - set - { - if (value != this._changeScript) - { - this._changeScript = value; - this.OnRefChanged("Change", null, value, true, false, (string refName, object oldValue, object newValue) => { - this._changeRef = refName; - this.MarkPropDirty("ChangeRef"); - }); - } - } - get - { - return this._changeScript; - } - } - - partial void OnHandlingChange(IgbRadioChangeEventArgs args); - private EventCallback? _change = null; - [Parameter] - public EventCallback Change - { - get - { - return this._change != null ? this._change.Value : EventCallback.Empty; - } - set - { - if (!value.Equals(EventCallback.Empty)) - { - if (!CompareEventCallbacks(value, _change, ref eventCallbacksCache)) - { - _change = value; - this.SetHandler(this.Name, "Change", value, (args) => { - OnHandlingChange(args); - - var newValueValue = default(string); - - - { - newValueValue = (string)(args.Detail.Value); - ; - OnEventUpdatingValue(this._value, ref newValueValue); - if (UseDirectRender) { - //TODO: maybe we should be doing this for everything. Need to make sure we don't infinity bounce though. - this.Value = newValueValue; - } else { - this._value = newValueValue; - } - OnPropertyPropagatedOut(Name, "Value"); - } - - if (!EventCallback.Empty.Equals(ValueChanged)) - { - var task = ValueChanged.InvokeAsync(newValueValue); - if (task.Exception != null) - { - throw task.Exception; - } - } - - }); - this.OnRefChanged("Change", null, "event:::Change", true, false, (refName, oldValue, newValue) => { - this._changeRef = refName; - this.MarkPropDirty("ChangeRef"); - }); - } - } - else - { - _change = null; - this.SetHandler(this.Name, "Change", null); - this.OnRefChanged("Change", null, null, true, false, (refName, oldValue, newValue) => { - this._changeRef = null; - this.MarkPropDirty("ChangeRef"); - }); - } - } - } - internal void EnsureChangeHandled() - { - if (EventCallback.Empty.Equals(this.Change)) - { - this.Change = new EventCallback(null, (Action)((e) => { })); this._change = null; - } - } - - - partial void OnEventUpdatingValue(string oldValue, ref string newValue); - - partial void SerializeCoreIgbRadioGroup(RendererSerializer ser); - - internal override void SerializeCore(RendererSerializer ser) - { - base.SerializeCore(ser); - - SerializeCoreIgbRadioGroup(ser); - - if (IsPropDirty("Alignment")) { ser.AddEnumProp("alignment", this._alignment); } - if (IsPropDirty("Value")) { ser.AddStringProp("value", this._value); } - if (IsPropDirty("ChangeRef")) { ser.AddStringProp("changeRef", this._changeRef); } - - } - -} + + }); + this.OnRefChanged("Change", null, "event:::Change", true, false, (refName, oldValue, newValue) => + { + this._changeRef = refName; + this.MarkPropDirty("ChangeRef"); + }); + } + } + else + { + _change = null; + this.SetHandler(this.Name, "Change", null); + this.OnRefChanged("Change", null, null, true, false, (refName, oldValue, newValue) => + { + this._changeRef = null; + this.MarkPropDirty("ChangeRef"); + }); + } + } + } + internal void EnsureChangeHandled() + { + if (EventCallback.Empty.Equals(this.Change)) + { + this.Change = new EventCallback(null, (Action)((e) => { })); + this._change = null; + } + } + + partial void OnEventUpdatingValue(string oldValue, ref string newValue); + + partial void SerializeCoreIgbRadioGroup(RendererSerializer ser); + + internal override void SerializeCore(RendererSerializer ser) + { + base.SerializeCore(ser); + + SerializeCoreIgbRadioGroup(ser); + + if (IsPropDirty("Alignment")) + { ser.AddEnumProp("alignment", this._alignment); } + if (IsPropDirty("Value")) + { ser.AddStringProp("value", this._value); } + if (IsPropDirty("ChangeRef")) + { ser.AddStringProp("changeRef", this._changeRef); } + + } + + } } diff --git a/src/components/Blazor/RadioGroupModule.cs b/src/components/Blazor/RadioGroupModule.cs index de6b6ce2..97a3a355 100644 --- a/src/components/Blazor/RadioGroupModule.cs +++ b/src/components/Blazor/RadioGroupModule.cs @@ -1,23 +1,20 @@ -using System; -using System.Collections.Generic; -using System.Runtime.CompilerServices; -using System.Text; -using System.Collections.Generic; - namespace IgniteUI.Blazor.Controls { - public partial class IgbRadioGroupModule { - public static void Register(IIgniteUIBlazor runtime) { + public partial class IgbRadioGroupModule + { + public static void Register(IIgniteUIBlazor runtime) + { ModuleLoader.Load(runtime, "WebRadioGroupModule"); - } - public static void MarkIsLoadRequested(IIgniteUIBlazor runtime) { + public static void MarkIsLoadRequested(IIgniteUIBlazor runtime) + { ModuleLoader.MarkIsLoadRequested(runtime, "WebRadioGroupModule"); } - public static bool IsLoadRequested(IIgniteUIBlazor runtime) { + public static bool IsLoadRequested(IIgniteUIBlazor runtime) + { return ModuleLoader.IsLoadRequested(runtime, "WebRadioGroupModule"); } } diff --git a/src/components/Blazor/RadioModule.cs b/src/components/Blazor/RadioModule.cs index 13e809fd..63f0acea 100644 --- a/src/components/Blazor/RadioModule.cs +++ b/src/components/Blazor/RadioModule.cs @@ -1,23 +1,20 @@ -using System; -using System.Collections.Generic; -using System.Runtime.CompilerServices; -using System.Text; -using System.Collections.Generic; - namespace IgniteUI.Blazor.Controls { - public partial class IgbRadioModule { - public static void Register(IIgniteUIBlazor runtime) { + public partial class IgbRadioModule + { + public static void Register(IIgniteUIBlazor runtime) + { ModuleLoader.Load(runtime, "WebRadioModule"); - } - public static void MarkIsLoadRequested(IIgniteUIBlazor runtime) { + public static void MarkIsLoadRequested(IIgniteUIBlazor runtime) + { ModuleLoader.MarkIsLoadRequested(runtime, "WebRadioModule"); } - public static bool IsLoadRequested(IIgniteUIBlazor runtime) { + public static bool IsLoadRequested(IIgniteUIBlazor runtime) + { return ModuleLoader.IsLoadRequested(runtime, "WebRadioModule"); } } diff --git a/src/components/Blazor/RangeSlider.cs b/src/components/Blazor/RangeSlider.cs index 9ca2a63d..9f241477 100644 --- a/src/components/Blazor/RangeSlider.cs +++ b/src/components/Blazor/RangeSlider.cs @@ -1,293 +1,312 @@ - -using System; using Microsoft.AspNetCore.Components; -using Microsoft.AspNetCore.Components.Rendering; -using System.Threading.Tasks; -using System.Collections.Generic; -using System.Linq; namespace IgniteUI.Blazor.Controls { - /// -/// A range slider component used to select two numeric values within a range. -/// -public partial class IgbRangeSlider: IgbSliderBase { - public override string Type { get { return "WebRangeSlider"; } } - - protected override void EnsureModulesLoaded() - { - if (!IgbRangeSliderModule.IsLoadRequested(IgBlazor)) - { - IgbRangeSliderModule.Register(IgBlazor); - } - } - - protected override string ResolveDisplay() + /// + /// A range slider component used to select two numeric values within a range. + /// + public partial class IgbRangeSlider : IgbSliderBase + { + public override string Type { get { return "WebRangeSlider"; } } + + protected override void EnsureModulesLoaded() + { + if (!IgbRangeSliderModule.IsLoadRequested(IgBlazor)) + { + IgbRangeSliderModule.Register(IgBlazor); + } + } + + protected override string ResolveDisplay() + { + return "inline-block"; + } + + protected override bool SupportsVisualChildren + { + get + { + return true; + } + } + + protected override bool UseDirectRender + { + get + { + return true; + } + } + + protected override string DirectRenderElementName + { + get + { + return "igc-range-slider"; + } + } + + public IgbRangeSlider() : base() + { + OnCreatedIgbRangeSlider(); + + } + + partial void OnCreatedIgbRangeSlider(); + + private double _lower = 0; + + partial void OnLowerChanging(ref double newValue); + /// + /// The current value of the lower thumb. + /// + [Parameter] + public double Lower + { + get { return this._lower; } + set + { + if (this._lower != value || !IsPropDirty("Lower")) + { + MarkPropDirty("Lower"); + } + this._lower = value; + + } + } + private double _upper = 0; + + partial void OnUpperChanging(ref double newValue); + /// + /// The current value of the upper thumb. + /// + [Parameter] + public double Upper + { + get { return this._upper; } + set + { + if (this._upper != value || !IsPropDirty("Upper")) + { + MarkPropDirty("Upper"); + } + this._upper = value; + + } + } + private string _thumbLabelLower; + + partial void OnThumbLabelLowerChanging(ref string newValue); + /// + /// The aria label for the lower thumb. + /// + [Parameter] + public string ThumbLabelLower + { + get { return this._thumbLabelLower; } + set + { + if (this._thumbLabelLower != value || !IsPropDirty("ThumbLabelLower")) + { + MarkPropDirty("ThumbLabelLower"); + } + this._thumbLabelLower = value; + + } + } + private string _thumbLabelUpper; + + partial void OnThumbLabelUpperChanging(ref string newValue); + /// + /// The aria label for the upper thumb. + /// + [Parameter] + public string ThumbLabelUpper + { + get { return this._thumbLabelUpper; } + set + { + if (this._thumbLabelUpper != value || !IsPropDirty("ThumbLabelUpper")) + { + MarkPropDirty("ThumbLabelUpper"); + } + this._thumbLabelUpper = value; + + } + } + + partial void FindByNameRangeSlider(string name, ref object item); + public override object FindByName(string name) + { + + var baseResult = base.FindByName(name); + if (baseResult != null) + { + return baseResult; + } + + object item = null; + FindByNameRangeSlider(name, ref item); + if (item != null) + { + return item; + } + + return null; + } + + private string _inputRef = null; + private string _inputScript = null; + [Parameter] + public string InputScript + { + + set + { + if (value != this._inputScript) + { + this._inputScript = value; + this.OnRefChanged("Input", null, value, true, false, (string refName, object oldValue, object newValue) => + { + this._inputRef = refName; + this.MarkPropDirty("InputRef"); + }); + } + } + get + { + return this._inputScript; + } + } + + partial void OnHandlingInput(IgbRangeSliderValueEventArgs args); + private EventCallback? _input = null; + [Parameter] + public EventCallback Input + { + get + { + return this._input != null ? this._input.Value : EventCallback.Empty; + } + set + { + if (!value.Equals(EventCallback.Empty)) + { + if (!CompareEventCallbacks(value, _input, ref eventCallbacksCache)) + { + _input = value; + this.SetHandler(this.Name, "Input", value, (args) => { - return "inline-block"; - } + OnHandlingInput(args); - protected override bool SupportsVisualChildren + }); + this.OnRefChanged("Input", null, "event:::Input", true, false, (refName, oldValue, newValue) => { - get - { - return true; - } - } + this._inputRef = refName; + this.MarkPropDirty("InputRef"); + }); + } + } + else + { + _input = null; + this.SetHandler(this.Name, "Input", null); + this.OnRefChanged("Input", null, null, true, false, (refName, oldValue, newValue) => + { + this._inputRef = null; + this.MarkPropDirty("InputRef"); + }); + } + } + } + + private string _changeRef = null; + private string _changeScript = null; + [Parameter] + public string ChangeScript + { - protected override bool UseDirectRender + set + { + if (value != this._changeScript) + { + this._changeScript = value; + this.OnRefChanged("Change", null, value, true, false, (string refName, object oldValue, object newValue) => + { + this._changeRef = refName; + this.MarkPropDirty("ChangeRef"); + }); + } + } + get + { + return this._changeScript; + } + } + + partial void OnHandlingChange(IgbRangeSliderValueEventArgs args); + private EventCallback? _change = null; + [Parameter] + public EventCallback Change + { + get + { + return this._change != null ? this._change.Value : EventCallback.Empty; + } + set + { + if (!value.Equals(EventCallback.Empty)) + { + if (!CompareEventCallbacks(value, _change, ref eventCallbacksCache)) + { + _change = value; + this.SetHandler(this.Name, "Change", value, (args) => { - get - { - return true; - } - } + OnHandlingChange(args); - protected override string DirectRenderElementName + }); + this.OnRefChanged("Change", null, "event:::Change", true, false, (refName, oldValue, newValue) => { - get - { - return "igc-range-slider"; - } - } - - public IgbRangeSlider(): base() { - OnCreatedIgbRangeSlider(); - - - } - - partial void OnCreatedIgbRangeSlider(); - - private double _lower = 0; - - partial void OnLowerChanging(ref double newValue); - /// - /// The current value of the lower thumb. - /// - [Parameter] - public double Lower - { - get { return this._lower; } - set { - if (this._lower != value || !IsPropDirty("Lower")) { - MarkPropDirty("Lower"); - } - this._lower = value; - - } - } - private double _upper = 0; - - partial void OnUpperChanging(ref double newValue); - /// - /// The current value of the upper thumb. - /// - [Parameter] - public double Upper - { - get { return this._upper; } - set { - if (this._upper != value || !IsPropDirty("Upper")) { - MarkPropDirty("Upper"); - } - this._upper = value; - - } - } - private string _thumbLabelLower; - - partial void OnThumbLabelLowerChanging(ref string newValue); - /// - /// The aria label for the lower thumb. - /// - [Parameter] - public string ThumbLabelLower - { - get { return this._thumbLabelLower; } - set { - if (this._thumbLabelLower != value || !IsPropDirty("ThumbLabelLower")) { - MarkPropDirty("ThumbLabelLower"); - } - this._thumbLabelLower = value; - - } - } - private string _thumbLabelUpper; - - partial void OnThumbLabelUpperChanging(ref string newValue); - /// - /// The aria label for the upper thumb. - /// - [Parameter] - public string ThumbLabelUpper - { - get { return this._thumbLabelUpper; } - set { - if (this._thumbLabelUpper != value || !IsPropDirty("ThumbLabelUpper")) { - MarkPropDirty("ThumbLabelUpper"); - } - this._thumbLabelUpper = value; - - } - } - - partial void FindByNameRangeSlider(string name, ref object item); - public override object FindByName(string name) - { - - var baseResult = base.FindByName(name); - if (baseResult != null) - { - return baseResult; - } - - object item = null; - FindByNameRangeSlider(name, ref item); - if (item != null) - { - return item; - } - - return null; - } - - private string _inputRef = null; - private string _inputScript = null; - [Parameter] - public string InputScript { - - set - { - if (value != this._inputScript) - { - this._inputScript = value; - this.OnRefChanged("Input", null, value, true, false, (string refName, object oldValue, object newValue) => { - this._inputRef = refName; - this.MarkPropDirty("InputRef"); - }); - } - } - get - { - return this._inputScript; - } - } - - partial void OnHandlingInput(IgbRangeSliderValueEventArgs args); - private EventCallback? _input = null; - [Parameter] - public EventCallback Input - { - get - { - return this._input != null ? this._input.Value : EventCallback.Empty; - } - set - { - if (!value.Equals(EventCallback.Empty)) - { - if (!CompareEventCallbacks(value, _input, ref eventCallbacksCache)) - { - _input = value; - this.SetHandler(this.Name, "Input", value, (args) => { - OnHandlingInput(args); - - }); - this.OnRefChanged("Input", null, "event:::Input", true, false, (refName, oldValue, newValue) => { - this._inputRef = refName; - this.MarkPropDirty("InputRef"); - }); - } - } - else - { - _input = null; - this.SetHandler(this.Name, "Input", null); - this.OnRefChanged("Input", null, null, true, false, (refName, oldValue, newValue) => { - this._inputRef = null; - this.MarkPropDirty("InputRef"); - }); - } - } - } - - private string _changeRef = null; - private string _changeScript = null; - [Parameter] - public string ChangeScript { - - set - { - if (value != this._changeScript) - { - this._changeScript = value; - this.OnRefChanged("Change", null, value, true, false, (string refName, object oldValue, object newValue) => { - this._changeRef = refName; - this.MarkPropDirty("ChangeRef"); - }); - } - } - get - { - return this._changeScript; - } - } - - partial void OnHandlingChange(IgbRangeSliderValueEventArgs args); - private EventCallback? _change = null; - [Parameter] - public EventCallback Change - { - get - { - return this._change != null ? this._change.Value : EventCallback.Empty; - } - set - { - if (!value.Equals(EventCallback.Empty)) - { - if (!CompareEventCallbacks(value, _change, ref eventCallbacksCache)) - { - _change = value; - this.SetHandler(this.Name, "Change", value, (args) => { - OnHandlingChange(args); - - }); - this.OnRefChanged("Change", null, "event:::Change", true, false, (refName, oldValue, newValue) => { - this._changeRef = refName; - this.MarkPropDirty("ChangeRef"); - }); - } - } - else - { - _change = null; - this.SetHandler(this.Name, "Change", null); - this.OnRefChanged("Change", null, null, true, false, (refName, oldValue, newValue) => { - this._changeRef = null; - this.MarkPropDirty("ChangeRef"); - }); - } - } - } - - partial void SerializeCoreIgbRangeSlider(RendererSerializer ser); - - internal override void SerializeCore(RendererSerializer ser) - { - base.SerializeCore(ser); - - SerializeCoreIgbRangeSlider(ser); - - if (IsPropDirty("Lower")) { ser.AddNumberProp("lower", this._lower); } - if (IsPropDirty("Upper")) { ser.AddNumberProp("upper", this._upper); } - if (IsPropDirty("ThumbLabelLower")) { ser.AddStringProp("thumbLabelLower", this._thumbLabelLower); } - if (IsPropDirty("ThumbLabelUpper")) { ser.AddStringProp("thumbLabelUpper", this._thumbLabelUpper); } - if (IsPropDirty("InputRef")) { ser.AddStringProp("inputRef", this._inputRef); } - if (IsPropDirty("ChangeRef")) { ser.AddStringProp("changeRef", this._changeRef); } - - } - -} + this._changeRef = refName; + this.MarkPropDirty("ChangeRef"); + }); + } + } + else + { + _change = null; + this.SetHandler(this.Name, "Change", null); + this.OnRefChanged("Change", null, null, true, false, (refName, oldValue, newValue) => + { + this._changeRef = null; + this.MarkPropDirty("ChangeRef"); + }); + } + } + } + + partial void SerializeCoreIgbRangeSlider(RendererSerializer ser); + + internal override void SerializeCore(RendererSerializer ser) + { + base.SerializeCore(ser); + + SerializeCoreIgbRangeSlider(ser); + + if (IsPropDirty("Lower")) + { ser.AddNumberProp("lower", this._lower); } + if (IsPropDirty("Upper")) + { ser.AddNumberProp("upper", this._upper); } + if (IsPropDirty("ThumbLabelLower")) + { ser.AddStringProp("thumbLabelLower", this._thumbLabelLower); } + if (IsPropDirty("ThumbLabelUpper")) + { ser.AddStringProp("thumbLabelUpper", this._thumbLabelUpper); } + if (IsPropDirty("InputRef")) + { ser.AddStringProp("inputRef", this._inputRef); } + if (IsPropDirty("ChangeRef")) + { ser.AddStringProp("changeRef", this._changeRef); } + + } + + } } diff --git a/src/components/Blazor/RangeSliderModule.cs b/src/components/Blazor/RangeSliderModule.cs index 3296e6a5..534d2523 100644 --- a/src/components/Blazor/RangeSliderModule.cs +++ b/src/components/Blazor/RangeSliderModule.cs @@ -1,24 +1,22 @@ -using System; -using System.Collections.Generic; -using System.Runtime.CompilerServices; -using System.Text; -using System.Collections.Generic; - namespace IgniteUI.Blazor.Controls { - public partial class IgbRangeSliderModule { - public static void Register(IIgniteUIBlazor runtime) { + public partial class IgbRangeSliderModule + { + public static void Register(IIgniteUIBlazor runtime) + { ModuleLoader.Load(runtime, "WebRangeSliderModule"); IgbSliderBaseModule.MarkIsLoadRequested(runtime); } - public static void MarkIsLoadRequested(IIgniteUIBlazor runtime) { + public static void MarkIsLoadRequested(IIgniteUIBlazor runtime) + { ModuleLoader.MarkIsLoadRequested(runtime, "WebRangeSliderModule"); } - public static bool IsLoadRequested(IIgniteUIBlazor runtime) { + public static bool IsLoadRequested(IIgniteUIBlazor runtime) + { return ModuleLoader.IsLoadRequested(runtime, "WebRangeSliderModule"); } } diff --git a/src/components/Blazor/RangeSliderValue.cs b/src/components/Blazor/RangeSliderValue.cs index 371ba6e4..2989c642 100644 --- a/src/components/Blazor/RangeSliderValue.cs +++ b/src/components/Blazor/RangeSliderValue.cs @@ -1,112 +1,114 @@ - -using System; using Microsoft.AspNetCore.Components; -using Microsoft.AspNetCore.Components.Rendering; -using System.Threading.Tasks; -using System.Collections.Generic; -using System.Linq; namespace IgniteUI.Blazor.Controls { - public partial class IgbRangeSliderValue: BaseRendererElement { - public override string Type { get { return "WebRangeSliderValue"; } } - - - private static bool _marshalByValue = true; - - public IgbRangeSliderValue(): base() { - OnCreatedIgbRangeSliderValue(); - - - } - - partial void OnCreatedIgbRangeSliderValue(); - - private double _lower = 0; - - partial void OnLowerChanging(ref double newValue); - [Parameter] - public double Lower - { - get { return this._lower; } - set { - if (this._lower != value || !IsPropDirty("Lower")) { - MarkPropDirty("Lower"); - } - this._lower = value; - - } - } - private double _upper = 0; - - partial void OnUpperChanging(ref double newValue); - [Parameter] - public double Upper - { - get { return this._upper; } - set { - if (this._upper != value || !IsPropDirty("Upper")) { - MarkPropDirty("Upper"); - } - this._upper = value; - - } - } - - partial void FindByNameRangeSliderValue(string name, ref object item); - public override object FindByName(string name) - { - - var baseResult = base.FindByName(name); - if (baseResult != null) - { - return baseResult; - } - - object item = null; - FindByNameRangeSliderValue(name, ref item); - if (item != null) - { - return item; - } - - return null; - } - - partial void SerializeCoreIgbRangeSliderValue(RendererSerializer ser); - - internal override void SerializeCore(RendererSerializer ser) - { - base.SerializeCore(ser); - - SerializeCoreIgbRangeSliderValue(ser); - - if (IsPropDirty("Lower")) { ser.AddNumberProp("lower", this._lower); } - if (IsPropDirty("Upper")) { ser.AddNumberProp("upper", this._upper); } - - } - - - protected internal override void ToEventJson(BaseRendererControl control, Dictionary args) - { - base.ToEventJson(control, args); - - if (IsPropDirty("Lower")) { args["lower"] = (this._lower).ToString(); } - if (IsPropDirty("Upper")) { args["upper"] = (this._upper).ToString(); } - - - } - - - protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) { - base.FromEventJson(control, args); - this.SuppressParentNotify = true; - - if (args.ContainsKey("lower")) { this.Lower = ReturnToDouble(args["lower"]); } - if (args.ContainsKey("upper")) { this.Upper = ReturnToDouble(args["upper"]); } - - this.SuppressParentNotify = false; - } - -} + public partial class IgbRangeSliderValue : BaseRendererElement + { + public override string Type { get { return "WebRangeSliderValue"; } } + + private static bool _marshalByValue = true; + + public IgbRangeSliderValue() : base() + { + OnCreatedIgbRangeSliderValue(); + + } + + partial void OnCreatedIgbRangeSliderValue(); + + private double _lower = 0; + + partial void OnLowerChanging(ref double newValue); + [Parameter] + public double Lower + { + get { return this._lower; } + set + { + if (this._lower != value || !IsPropDirty("Lower")) + { + MarkPropDirty("Lower"); + } + this._lower = value; + + } + } + private double _upper = 0; + + partial void OnUpperChanging(ref double newValue); + [Parameter] + public double Upper + { + get { return this._upper; } + set + { + if (this._upper != value || !IsPropDirty("Upper")) + { + MarkPropDirty("Upper"); + } + this._upper = value; + + } + } + + partial void FindByNameRangeSliderValue(string name, ref object item); + public override object FindByName(string name) + { + + var baseResult = base.FindByName(name); + if (baseResult != null) + { + return baseResult; + } + + object item = null; + FindByNameRangeSliderValue(name, ref item); + if (item != null) + { + return item; + } + + return null; + } + + partial void SerializeCoreIgbRangeSliderValue(RendererSerializer ser); + + internal override void SerializeCore(RendererSerializer ser) + { + base.SerializeCore(ser); + + SerializeCoreIgbRangeSliderValue(ser); + + if (IsPropDirty("Lower")) + { ser.AddNumberProp("lower", this._lower); } + if (IsPropDirty("Upper")) + { ser.AddNumberProp("upper", this._upper); } + + } + + protected internal override void ToEventJson(BaseRendererControl control, Dictionary args) + { + base.ToEventJson(control, args); + + if (IsPropDirty("Lower")) + { args["lower"] = (this._lower).ToString(); } + if (IsPropDirty("Upper")) + { args["upper"] = (this._upper).ToString(); } + + } + + protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) + { + base.FromEventJson(control, args); + this.SuppressParentNotify = true; + + if (args.ContainsKey("lower")) + { this.Lower = ReturnToDouble(args["lower"]); } + if (args.ContainsKey("upper")) + { this.Upper = ReturnToDouble(args["upper"]); } + + this.SuppressParentNotify = false; + } + + } } diff --git a/src/components/Blazor/RangeSliderValueEventArgs.cs b/src/components/Blazor/RangeSliderValueEventArgs.cs index f2c7f329..cc38c8ab 100644 --- a/src/components/Blazor/RangeSliderValueEventArgs.cs +++ b/src/components/Blazor/RangeSliderValueEventArgs.cs @@ -1,97 +1,95 @@ - -using System; using Microsoft.AspNetCore.Components; -using Microsoft.AspNetCore.Components.Rendering; -using System.Threading.Tasks; -using System.Collections.Generic; -using System.Linq; namespace IgniteUI.Blazor.Controls { - public partial class IgbRangeSliderValueEventArgs: BaseRendererElement { - public override string Type { get { return "WebRangeSliderValueEventArgs"; } } - - - public IgbRangeSliderValueEventArgs(): base() { - OnCreatedIgbRangeSliderValueEventArgs(); - - - } - - partial void OnCreatedIgbRangeSliderValueEventArgs(); - - private IgbRangeSliderValue _detail; - - partial void OnDetailChanging(ref IgbRangeSliderValue newValue); - [Parameter] - public IgbRangeSliderValue Detail - { - get { return this._detail; } - set { - OnDetailChanging(ref value); - MarkPropDirty("Detail"); - if (this._detail != null) { - this.DetachChild(this._detail); - } - if (value != null) { - this.AttachChild(value); - } - this._detail = value; - } - - } - - partial void FindByNameRangeSliderValueEventArgs(string name, ref object item); - public override object FindByName(string name) - { - - var baseResult = base.FindByName(name); - if (baseResult != null) - { - return baseResult; - } - - object item = null; - FindByNameRangeSliderValueEventArgs(name, ref item); - if (item != null) - { - return item; - } - - return null; - } - - partial void SerializeCoreIgbRangeSliderValueEventArgs(RendererSerializer ser); - - internal override void SerializeCore(RendererSerializer ser) - { - base.SerializeCore(ser); - - SerializeCoreIgbRangeSliderValueEventArgs(ser); - - if (IsPropDirty("Detail")) { ser.AddSerializableProp("detail", this._detail); } - - } - - - protected internal override void ToEventJson(BaseRendererControl control, Dictionary args) - { - base.ToEventJson(control, args); - - if (IsPropDirty("Detail")) { args["detail"] = ObjectToParam(this._detail); } - - - } - - - protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) { - base.FromEventJson(control, args); - this.SuppressParentNotify = true; - - if (args.ContainsKey("detail")) { this.Detail = (IgbRangeSliderValue)ConvertReturnValue(args["detail"], "RangeSliderValue", true); } - - this.SuppressParentNotify = false; - } - -} + public partial class IgbRangeSliderValueEventArgs : BaseRendererElement + { + public override string Type { get { return "WebRangeSliderValueEventArgs"; } } + + public IgbRangeSliderValueEventArgs() : base() + { + OnCreatedIgbRangeSliderValueEventArgs(); + + } + + partial void OnCreatedIgbRangeSliderValueEventArgs(); + + private IgbRangeSliderValue _detail; + + partial void OnDetailChanging(ref IgbRangeSliderValue newValue); + [Parameter] + public IgbRangeSliderValue Detail + { + get { return this._detail; } + set + { + OnDetailChanging(ref value); + MarkPropDirty("Detail"); + if (this._detail != null) + { + this.DetachChild(this._detail); + } + if (value != null) + { + this.AttachChild(value); + } + this._detail = value; + } + + } + + partial void FindByNameRangeSliderValueEventArgs(string name, ref object item); + public override object FindByName(string name) + { + + var baseResult = base.FindByName(name); + if (baseResult != null) + { + return baseResult; + } + + object item = null; + FindByNameRangeSliderValueEventArgs(name, ref item); + if (item != null) + { + return item; + } + + return null; + } + + partial void SerializeCoreIgbRangeSliderValueEventArgs(RendererSerializer ser); + + internal override void SerializeCore(RendererSerializer ser) + { + base.SerializeCore(ser); + + SerializeCoreIgbRangeSliderValueEventArgs(ser); + + if (IsPropDirty("Detail")) + { ser.AddSerializableProp("detail", this._detail); } + + } + + protected internal override void ToEventJson(BaseRendererControl control, Dictionary args) + { + base.ToEventJson(control, args); + + if (IsPropDirty("Detail")) + { args["detail"] = ObjectToParam(this._detail); } + + } + + protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) + { + base.FromEventJson(control, args); + this.SuppressParentNotify = true; + + if (args.ContainsKey("detail")) + { this.Detail = (IgbRangeSliderValue)ConvertReturnValue(args["detail"], "RangeSliderValue", true); } + + this.SuppressParentNotify = false; + } + + } } diff --git a/src/components/Blazor/Rating.cs b/src/components/Blazor/Rating.cs index ec5fb468..68fe5c4a 100644 --- a/src/components/Blazor/Rating.cs +++ b/src/components/Blazor/Rating.cs @@ -1,576 +1,618 @@ - -using System; using Microsoft.AspNetCore.Components; -using Microsoft.AspNetCore.Components.Rendering; -using System.Threading.Tasks; -using System.Collections.Generic; -using System.Linq; namespace IgniteUI.Blazor.Controls { - /// -/// A rating component that allows users to view and provide ratings using customizable symbols. -/// It supports fractional values, hover previews, keyboard navigation, single-selection mode, -/// and integrates with forms as a number input. -/// -public partial class IgbRating: BaseRendererControl { - public override string Type { get { return "WebRating"; } } - - protected override void EnsureModulesLoaded() - { - if (!IgbRatingModule.IsLoadRequested(IgBlazor)) - { - IgbRatingModule.Register(IgBlazor); - } - } + /// + /// A rating component that allows users to view and provide ratings using customizable symbols. + /// It supports fractional values, hover previews, keyboard navigation, single-selection mode, + /// and integrates with forms as a number input. + /// + public partial class IgbRating : BaseRendererControl + { + public override string Type { get { return "WebRating"; } } - protected override string ResolveDisplay() - { - return "inline-block"; - } + protected override void EnsureModulesLoaded() + { + if (!IgbRatingModule.IsLoadRequested(IgBlazor)) + { + IgbRatingModule.Register(IgBlazor); + } + } - protected override bool SupportsVisualChildren - { - get - { - return true; - } - } + protected override string ResolveDisplay() + { + return "inline-block"; + } + + protected override bool SupportsVisualChildren + { + get + { + return true; + } + } + + protected override bool UseDirectRender + { + get + { + return true; + } + } + + protected override string DirectRenderElementName + { + get + { + return "igc-rating"; + } + } + + protected override ControlEventBehavior DefaultEventBehavior + { + get { return ControlEventBehavior.Immediate; } + } + + public IgbRating() : base() + { + OnCreatedIgbRating(); + + } + + partial void OnCreatedIgbRating(); + + private double _max = 0; + + partial void OnMaxChanging(ref double newValue); + /// + /// The maximum value for the rating. + /// If there are projected symbols, the maximum value will be resolved + /// based on the number of symbols. + /// + [Parameter] + public double Max + { + get { return this._max; } + set + { + if (this._max != value || !IsPropDirty("Max")) + { + MarkPropDirty("Max"); + } + this._max = value; + + } + } + private double _step = 0; + + partial void OnStepChanging(ref double newValue); + /// + /// The minimum value change allowed. + /// Valid values are in the interval between 0 and 1 inclusive. + /// + [Parameter] + public double Step + { + get { return this._step; } + set + { + if (this._step != value || !IsPropDirty("Step")) + { + MarkPropDirty("Step"); + } + this._step = value; + + } + } + private string _label; + + partial void OnLabelChanging(ref string newValue); + /// + /// The label of the control. + /// + [Parameter] + public string Label + { + get { return this._label; } + set + { + if (this._label != value || !IsPropDirty("Label")) + { + MarkPropDirty("Label"); + } + this._label = value; + + } + } + private string _valueFormat; + + partial void OnValueFormatChanging(ref string newValue); + /// + /// A format string which sets aria-valuetext. Instances of '{0}' will be replaced + /// with the current value of the control and instances of '{1}' with the maximum value for the control. + /// Important for screen-readers and useful for localization. + /// + [Parameter] + public string ValueFormat + { + get { return this._valueFormat; } + set + { + if (this._valueFormat != value || !IsPropDirty("ValueFormat")) + { + MarkPropDirty("ValueFormat"); + } + this._valueFormat = value; + + } + } + private double _value = 0; + + partial void OnValueChanging(ref double newValue); + /// + /// The current value of the component + /// + [Parameter] + public double Value + { + get { return this._value; } + set + { + if (this._value != value || !IsPropDirty("Value")) + { + MarkPropDirty("Value"); + } + this._value = value; + + } + } + public async Task GetCurrentValueAsync() + { + var iv = await InvokeMethod("p:Value", new object[] { }, new string[] { }); + return ReturnToDouble(iv); + } + public double GetCurrentValue() + { + var iv = InvokeMethodSync("p:Value", new object[] { }, new string[] { }); + return ReturnToDouble(iv); + } + private bool _hoverPreview = false; + + partial void OnHoverPreviewChanging(ref bool newValue); + /// + /// Sets hover preview behavior for the component + /// + [Parameter] + public bool HoverPreview + { + get { return this._hoverPreview; } + set + { + if (this._hoverPreview != value || !IsPropDirty("HoverPreview")) + { + MarkPropDirty("HoverPreview"); + } + this._hoverPreview = value; + + } + } + private bool _readOnly = false; + + partial void OnReadOnlyChanging(ref bool newValue); + /// + /// Makes the control a readonly field. + /// + [Parameter] + [WCAttributeName("readonly")] + public bool ReadOnly + { + get { return this._readOnly; } + set + { + if (this._readOnly != value || !IsPropDirty("ReadOnly")) + { + MarkPropDirty("ReadOnly"); + } + this._readOnly = value; + + } + } + private bool _single = false; + + partial void OnSingleChanging(ref bool newValue); + /// + /// Toggles single selection visual mode. + /// + [Parameter] + public bool Single + { + get { return this._single; } + set + { + if (this._single != value || !IsPropDirty("Single")) + { + MarkPropDirty("Single"); + } + this._single = value; + + } + } + private bool _allowReset = false; + + partial void OnAllowResetChanging(ref bool newValue); + /// + /// Whether to reset the rating when the user selects the same value. + /// + [Parameter] + public bool AllowReset + { + get { return this._allowReset; } + set + { + if (this._allowReset != value || !IsPropDirty("AllowReset")) + { + MarkPropDirty("AllowReset"); + } + this._allowReset = value; + + } + } + private bool _disabled = false; + + partial void OnDisabledChanging(ref bool newValue); + /// + /// The disabled state of the component + /// + [Parameter] + public bool Disabled + { + get { return this._disabled; } + set + { + if (this._disabled != value || !IsPropDirty("Disabled")) + { + MarkPropDirty("Disabled"); + } + this._disabled = value; + + } + } + private bool _invalid = false; - protected override bool UseDirectRender + partial void OnInvalidChanging(ref bool newValue); + /// + /// Control the validity of the control. + /// + [Parameter] + public bool Invalid + { + get { return this._invalid; } + set + { + if (this._invalid != value || !IsPropDirty("Invalid")) + { + MarkPropDirty("Invalid"); + } + this._invalid = value; + + } + } + + partial void FindByNameRating(string name, ref object item); + public override object FindByName(string name) + { + + var baseResult = base.FindByName(name); + if (baseResult != null) + { + return baseResult; + } + + object item = null; + FindByNameRating(name, ref item); + if (item != null) + { + return item; + } + + return null; + } + public async Task SetNativeElementAsync(Object element) + { + await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + } + public void SetNativeElement(Object element) + { + InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + } + /// + /// Increments the value of the control by `n` steps multiplied by the + /// step factor. + /// + public async Task StepUpAsync(double n = 1) + { + await InvokeMethod("stepUp", new object[] { n }, new string[] { "Number" }); + } + public void StepUp(double n = 1) + { + InvokeMethodSync("stepUp", new object[] { n }, new string[] { "Number" }); + } + /// + /// Decrements the value of the control by `n` steps multiplied by + /// the step factor. + /// + public async Task StepDownAsync(double n = 1) + { + await InvokeMethod("stepDown", new object[] { n }, new string[] { "Number" }); + } + public void StepDown(double n = 1) + { + InvokeMethodSync("stepDown", new object[] { n }, new string[] { "Number" }); + } + /// + /// Checks for validity of the control and shows the browser message if it invalid. + /// + public async Task ReportValidityAsync() + { + await InvokeMethod("reportValidity", new object[] { }, new string[] { }); + } + public void ReportValidity() + { + InvokeMethodSync("reportValidity", new object[] { }, new string[] { }); + } + /// + /// Checks for validity of the control and emits the invalid event if it invalid. + /// + public async Task CheckValidityAsync() + { + await InvokeMethod("checkValidity", new object[] { }, new string[] { }); + } + public void CheckValidity() + { + InvokeMethodSync("checkValidity", new object[] { }, new string[] { }); + } + /// + /// Sets a custom validation message for the control. + /// As long as `message` is not empty, the control is considered invalid. + /// + public async Task SetCustomValidityAsync(String message) + { + await InvokeMethod("setCustomValidity", new object[] { StringToString(message) }, new string[] { "String" }); + } + public void SetCustomValidity(String message) + { + InvokeMethodSync("setCustomValidity", new object[] { StringToString(message) }, new string[] { "String" }); + } + + private EventCallback? _valueChanged = null; + [Parameter] + public EventCallback ValueChanged + { + get + { + return this._valueChanged != null ? this._valueChanged.Value : EventCallback.Empty; + } + set + { + if (!value.Equals(EventCallback.Empty)) + { + if (!CompareEventCallbacks(value, _valueChanged, ref eventCallbacksCache)) + { + this.EnsureChangeHandled(); + + _valueChanged = value; + } + } + else + { + _valueChanged = null; + } + } + } + + private string _changeRef = null; + private string _changeScript = null; + [Parameter] + public string ChangeScript + { + + set + { + if (value != this._changeScript) + { + this._changeScript = value; + this.OnRefChanged("Change", null, value, true, false, (string refName, object oldValue, object newValue) => + { + this._changeRef = refName; + this.MarkPropDirty("ChangeRef"); + }); + } + } + get + { + return this._changeScript; + } + } + + partial void OnHandlingChange(IgbNumberEventArgs args); + private EventCallback? _change = null; + [Parameter] + public EventCallback Change + { + get + { + return this._change != null ? this._change.Value : EventCallback.Empty; + } + set + { + if (!value.Equals(EventCallback.Empty)) + { + if (!CompareEventCallbacks(value, _change, ref eventCallbacksCache)) + { + _change = value; + this.SetHandler(this.Name, "Change", value, (args) => { - get + OnHandlingChange(args); + + var newValueValue = default(double); + + { + newValueValue = (double)(args.Detail); + ; + OnEventUpdatingValue(this._value, ref newValueValue); + if (UseDirectRender) { - return true; + //TODO: maybe we should be doing this for everything. Need to make sure we don't infinity bounce though. + this.Value = newValueValue; } - } - - protected override string DirectRenderElementName - { - get + else { - return "igc-rating"; + this._value = newValueValue; } - } + OnPropertyPropagatedOut(Name, "Value"); + } - protected override ControlEventBehavior DefaultEventBehavior + if (!EventCallback.Empty.Equals(ValueChanged)) { - get { return ControlEventBehavior.Immediate; } + var task = ValueChanged.InvokeAsync(newValueValue); + if (task.Exception != null) + { + throw task.Exception; + } } - - public IgbRating(): base() { - OnCreatedIgbRating(); - - - } - - partial void OnCreatedIgbRating(); - - private double _max = 0; - - partial void OnMaxChanging(ref double newValue); - /// - /// The maximum value for the rating. - /// If there are projected symbols, the maximum value will be resolved - /// based on the number of symbols. - /// - [Parameter] - public double Max - { - get { return this._max; } - set { - if (this._max != value || !IsPropDirty("Max")) { - MarkPropDirty("Max"); - } - this._max = value; - - } - } - private double _step = 0; - - partial void OnStepChanging(ref double newValue); - /// - /// The minimum value change allowed. - /// Valid values are in the interval between 0 and 1 inclusive. - /// - [Parameter] - public double Step - { - get { return this._step; } - set { - if (this._step != value || !IsPropDirty("Step")) { - MarkPropDirty("Step"); - } - this._step = value; - - } - } - private string _label; - - partial void OnLabelChanging(ref string newValue); - /// - /// The label of the control. - /// - [Parameter] - public string Label - { - get { return this._label; } - set { - if (this._label != value || !IsPropDirty("Label")) { - MarkPropDirty("Label"); - } - this._label = value; - - } - } - private string _valueFormat; - - partial void OnValueFormatChanging(ref string newValue); - /// - /// A format string which sets aria-valuetext. Instances of '{0}' will be replaced - /// with the current value of the control and instances of '{1}' with the maximum value for the control. - /// Important for screen-readers and useful for localization. - /// - [Parameter] - public string ValueFormat - { - get { return this._valueFormat; } - set { - if (this._valueFormat != value || !IsPropDirty("ValueFormat")) { - MarkPropDirty("ValueFormat"); - } - this._valueFormat = value; - - } - } - private double _value = 0; - - partial void OnValueChanging(ref double newValue); - /// - /// The current value of the component - /// - [Parameter] - public double Value - { - get { return this._value; } - set { - if (this._value != value || !IsPropDirty("Value")) { - MarkPropDirty("Value"); - } - this._value = value; - - } - } - public async Task GetCurrentValueAsync() - { - var iv = await InvokeMethod("p:Value", new object[] { }, new string[] { }); - return ReturnToDouble(iv); - } - public double GetCurrentValue() - { - var iv = InvokeMethodSync("p:Value", new object[] { }, new string[] { }); - return ReturnToDouble(iv); - } - private bool _hoverPreview = false; - - partial void OnHoverPreviewChanging(ref bool newValue); - /// - /// Sets hover preview behavior for the component - /// - [Parameter] - public bool HoverPreview - { - get { return this._hoverPreview; } - set { - if (this._hoverPreview != value || !IsPropDirty("HoverPreview")) { - MarkPropDirty("HoverPreview"); - } - this._hoverPreview = value; - - } - } - private bool _readOnly = false; - - partial void OnReadOnlyChanging(ref bool newValue); - /// - /// Makes the control a readonly field. - /// - [Parameter] - [WCAttributeName("readonly")] - public bool ReadOnly - { - get { return this._readOnly; } - set { - if (this._readOnly != value || !IsPropDirty("ReadOnly")) { - MarkPropDirty("ReadOnly"); - } - this._readOnly = value; - - } - } - private bool _single = false; - - partial void OnSingleChanging(ref bool newValue); - /// - /// Toggles single selection visual mode. - /// - [Parameter] - public bool Single - { - get { return this._single; } - set { - if (this._single != value || !IsPropDirty("Single")) { - MarkPropDirty("Single"); - } - this._single = value; - - } - } - private bool _allowReset = false; - - partial void OnAllowResetChanging(ref bool newValue); - /// - /// Whether to reset the rating when the user selects the same value. - /// - [Parameter] - public bool AllowReset - { - get { return this._allowReset; } - set { - if (this._allowReset != value || !IsPropDirty("AllowReset")) { - MarkPropDirty("AllowReset"); - } - this._allowReset = value; - - } - } - private bool _disabled = false; - - partial void OnDisabledChanging(ref bool newValue); - /// - /// The disabled state of the component - /// - [Parameter] - public bool Disabled - { - get { return this._disabled; } - set { - if (this._disabled != value || !IsPropDirty("Disabled")) { - MarkPropDirty("Disabled"); - } - this._disabled = value; - - } - } - private bool _invalid = false; - - partial void OnInvalidChanging(ref bool newValue); - /// - /// Control the validity of the control. - /// - [Parameter] - public bool Invalid - { - get { return this._invalid; } - set { - if (this._invalid != value || !IsPropDirty("Invalid")) { - MarkPropDirty("Invalid"); - } - this._invalid = value; - - } - } - - partial void FindByNameRating(string name, ref object item); - public override object FindByName(string name) - { - - var baseResult = base.FindByName(name); - if (baseResult != null) - { - return baseResult; - } - - object item = null; - FindByNameRating(name, ref item); - if (item != null) - { - return item; - } - - return null; - } - public async Task SetNativeElementAsync(Object element) - { - await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); - } - public void SetNativeElement(Object element) - { - InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); - } - /// - /// Increments the value of the control by `n` steps multiplied by the - /// step factor. - /// - public async Task StepUpAsync(double n = 1) - { - await InvokeMethod("stepUp", new object[] { n }, new string[] { "Number" }); - } - public void StepUp(double n = 1) - { - InvokeMethodSync("stepUp", new object[] { n }, new string[] { "Number" }); - } - /// - /// Decrements the value of the control by `n` steps multiplied by - /// the step factor. - /// - public async Task StepDownAsync(double n = 1) - { - await InvokeMethod("stepDown", new object[] { n }, new string[] { "Number" }); - } - public void StepDown(double n = 1) - { - InvokeMethodSync("stepDown", new object[] { n }, new string[] { "Number" }); - } - /// - /// Checks for validity of the control and shows the browser message if it invalid. - /// - public async Task ReportValidityAsync() - { - await InvokeMethod("reportValidity", new object[] { }, new string[] { }); - } - public void ReportValidity() - { - InvokeMethodSync("reportValidity", new object[] { }, new string[] { }); - } - /// - /// Checks for validity of the control and emits the invalid event if it invalid. - /// - public async Task CheckValidityAsync() - { - await InvokeMethod("checkValidity", new object[] { }, new string[] { }); - } - public void CheckValidity() - { - InvokeMethodSync("checkValidity", new object[] { }, new string[] { }); - } - /// - /// Sets a custom validation message for the control. - /// As long as `message` is not empty, the control is considered invalid. - /// - public async Task SetCustomValidityAsync(String message) - { - await InvokeMethod("setCustomValidity", new object[] { StringToString(message) }, new string[] { "String" }); - } - public void SetCustomValidity(String message) - { - InvokeMethodSync("setCustomValidity", new object[] { StringToString(message) }, new string[] { "String" }); - } - - private EventCallback? _valueChanged = null; - [Parameter] - public EventCallback ValueChanged - { - get - { - return this._valueChanged != null ? this._valueChanged.Value : EventCallback.Empty; - } - set - { - if (!value.Equals(EventCallback.Empty)) - { - if (!CompareEventCallbacks(value, _valueChanged, ref eventCallbacksCache)) - { - this.EnsureChangeHandled(); - - _valueChanged = value; - } - } - else - { - _valueChanged = null; - } - } - } - - private string _changeRef = null; - private string _changeScript = null; - [Parameter] - public string ChangeScript { - - set - { - if (value != this._changeScript) - { - this._changeScript = value; - this.OnRefChanged("Change", null, value, true, false, (string refName, object oldValue, object newValue) => { - this._changeRef = refName; - this.MarkPropDirty("ChangeRef"); - }); - } - } - get - { - return this._changeScript; - } - } - - partial void OnHandlingChange(IgbNumberEventArgs args); - private EventCallback? _change = null; - [Parameter] - public EventCallback Change - { - get - { - return this._change != null ? this._change.Value : EventCallback.Empty; - } - set - { - if (!value.Equals(EventCallback.Empty)) - { - if (!CompareEventCallbacks(value, _change, ref eventCallbacksCache)) - { - _change = value; - this.SetHandler(this.Name, "Change", value, (args) => { - OnHandlingChange(args); - - var newValueValue = default(double); - - - { - newValueValue = (double)(args.Detail); - ; - OnEventUpdatingValue(this._value, ref newValueValue); - if (UseDirectRender) { - //TODO: maybe we should be doing this for everything. Need to make sure we don't infinity bounce though. - this.Value = newValueValue; - } else { - this._value = newValueValue; - } - OnPropertyPropagatedOut(Name, "Value"); - } - - if (!EventCallback.Empty.Equals(ValueChanged)) - { - var task = ValueChanged.InvokeAsync(newValueValue); - if (task.Exception != null) - { - throw task.Exception; - } - } - - }); - this.OnRefChanged("Change", null, "event:::Change", true, false, (refName, oldValue, newValue) => { - this._changeRef = refName; - this.MarkPropDirty("ChangeRef"); - }); - } - } - else - { - _change = null; - this.SetHandler(this.Name, "Change", null); - this.OnRefChanged("Change", null, null, true, false, (refName, oldValue, newValue) => { - this._changeRef = null; - this.MarkPropDirty("ChangeRef"); - }); - } - } - } - internal void EnsureChangeHandled() - { - if (EventCallback.Empty.Equals(this.Change)) - { - this.Change = new EventCallback(null, (Action)((e) => { })); this._change = null; - } - } - - - private string _hoverRef = null; - private string _hoverScript = null; - [Parameter] - public string HoverScript { - - set - { - if (value != this._hoverScript) - { - this._hoverScript = value; - this.OnRefChanged("Hover", null, value, true, false, (string refName, object oldValue, object newValue) => { - this._hoverRef = refName; - this.MarkPropDirty("HoverRef"); - }); - } - } - get - { - return this._hoverScript; - } - } - - partial void OnHandlingHover(IgbNumberEventArgs args); - private EventCallback? _hover = null; - [Parameter] - public EventCallback Hover - { - get - { - return this._hover != null ? this._hover.Value : EventCallback.Empty; - } - set - { - if (!value.Equals(EventCallback.Empty)) - { - if (!CompareEventCallbacks(value, _hover, ref eventCallbacksCache)) - { - _hover = value; - this.SetHandler(this.Name, "Hover", value, (args) => { - OnHandlingHover(args); - - }); - this.OnRefChanged("Hover", null, "event:::Hover", true, false, (refName, oldValue, newValue) => { - this._hoverRef = refName; - this.MarkPropDirty("HoverRef"); - }); - } - } - else - { - _hover = null; - this.SetHandler(this.Name, "Hover", null); - this.OnRefChanged("Hover", null, null, true, false, (refName, oldValue, newValue) => { - this._hoverRef = null; - this.MarkPropDirty("HoverRef"); - }); - } - } - } - - partial void OnEventUpdatingValue(double oldValue, ref double newValue); - - partial void SerializeCoreIgbRating(RendererSerializer ser); - - internal override void SerializeCore(RendererSerializer ser) - { - base.SerializeCore(ser); - - SerializeCoreIgbRating(ser); - - if (IsPropDirty("Max")) { ser.AddNumberProp("max", this._max); } - if (IsPropDirty("Step")) { ser.AddNumberProp("step", this._step); } - if (IsPropDirty("Label")) { ser.AddStringProp("label", this._label); } - if (IsPropDirty("ValueFormat")) { ser.AddStringProp("valueFormat", this._valueFormat); } - if (IsPropDirty("Value")) { ser.AddNumberProp("value", this._value); } - if (IsPropDirty("HoverPreview")) { ser.AddBooleanProp("hoverPreview", this._hoverPreview); } - if (IsPropDirty("ReadOnly")) { ser.AddBooleanProp("readOnly", this._readOnly); } - if (IsPropDirty("Single")) { ser.AddBooleanProp("single", this._single); } - if (IsPropDirty("AllowReset")) { ser.AddBooleanProp("allowReset", this._allowReset); } - if (IsPropDirty("Disabled")) { ser.AddBooleanProp("disabled", this._disabled); } - if (IsPropDirty("Invalid")) { ser.AddBooleanProp("invalid", this._invalid); } - if (IsPropDirty("ChangeRef")) { ser.AddStringProp("changeRef", this._changeRef); } - if (IsPropDirty("HoverRef")) { ser.AddStringProp("hoverRef", this._hoverRef); } - - } - -} + + }); + this.OnRefChanged("Change", null, "event:::Change", true, false, (refName, oldValue, newValue) => + { + this._changeRef = refName; + this.MarkPropDirty("ChangeRef"); + }); + } + } + else + { + _change = null; + this.SetHandler(this.Name, "Change", null); + this.OnRefChanged("Change", null, null, true, false, (refName, oldValue, newValue) => + { + this._changeRef = null; + this.MarkPropDirty("ChangeRef"); + }); + } + } + } + internal void EnsureChangeHandled() + { + if (EventCallback.Empty.Equals(this.Change)) + { + this.Change = new EventCallback(null, (Action)((e) => { })); + this._change = null; + } + } + + private string _hoverRef = null; + private string _hoverScript = null; + [Parameter] + public string HoverScript + { + + set + { + if (value != this._hoverScript) + { + this._hoverScript = value; + this.OnRefChanged("Hover", null, value, true, false, (string refName, object oldValue, object newValue) => + { + this._hoverRef = refName; + this.MarkPropDirty("HoverRef"); + }); + } + } + get + { + return this._hoverScript; + } + } + + partial void OnHandlingHover(IgbNumberEventArgs args); + private EventCallback? _hover = null; + [Parameter] + public EventCallback Hover + { + get + { + return this._hover != null ? this._hover.Value : EventCallback.Empty; + } + set + { + if (!value.Equals(EventCallback.Empty)) + { + if (!CompareEventCallbacks(value, _hover, ref eventCallbacksCache)) + { + _hover = value; + this.SetHandler(this.Name, "Hover", value, (args) => + { + OnHandlingHover(args); + + }); + this.OnRefChanged("Hover", null, "event:::Hover", true, false, (refName, oldValue, newValue) => + { + this._hoverRef = refName; + this.MarkPropDirty("HoverRef"); + }); + } + } + else + { + _hover = null; + this.SetHandler(this.Name, "Hover", null); + this.OnRefChanged("Hover", null, null, true, false, (refName, oldValue, newValue) => + { + this._hoverRef = null; + this.MarkPropDirty("HoverRef"); + }); + } + } + } + + partial void OnEventUpdatingValue(double oldValue, ref double newValue); + + partial void SerializeCoreIgbRating(RendererSerializer ser); + + internal override void SerializeCore(RendererSerializer ser) + { + base.SerializeCore(ser); + + SerializeCoreIgbRating(ser); + + if (IsPropDirty("Max")) + { ser.AddNumberProp("max", this._max); } + if (IsPropDirty("Step")) + { ser.AddNumberProp("step", this._step); } + if (IsPropDirty("Label")) + { ser.AddStringProp("label", this._label); } + if (IsPropDirty("ValueFormat")) + { ser.AddStringProp("valueFormat", this._valueFormat); } + if (IsPropDirty("Value")) + { ser.AddNumberProp("value", this._value); } + if (IsPropDirty("HoverPreview")) + { ser.AddBooleanProp("hoverPreview", this._hoverPreview); } + if (IsPropDirty("ReadOnly")) + { ser.AddBooleanProp("readOnly", this._readOnly); } + if (IsPropDirty("Single")) + { ser.AddBooleanProp("single", this._single); } + if (IsPropDirty("AllowReset")) + { ser.AddBooleanProp("allowReset", this._allowReset); } + if (IsPropDirty("Disabled")) + { ser.AddBooleanProp("disabled", this._disabled); } + if (IsPropDirty("Invalid")) + { ser.AddBooleanProp("invalid", this._invalid); } + if (IsPropDirty("ChangeRef")) + { ser.AddStringProp("changeRef", this._changeRef); } + if (IsPropDirty("HoverRef")) + { ser.AddStringProp("hoverRef", this._hoverRef); } + + } + + } } diff --git a/src/components/Blazor/RatingModule.cs b/src/components/Blazor/RatingModule.cs index 74320a1f..37453fd5 100644 --- a/src/components/Blazor/RatingModule.cs +++ b/src/components/Blazor/RatingModule.cs @@ -1,23 +1,20 @@ -using System; -using System.Collections.Generic; -using System.Runtime.CompilerServices; -using System.Text; -using System.Collections.Generic; - namespace IgniteUI.Blazor.Controls { - public partial class IgbRatingModule { - public static void Register(IIgniteUIBlazor runtime) { + public partial class IgbRatingModule + { + public static void Register(IIgniteUIBlazor runtime) + { ModuleLoader.Load(runtime, "WebRatingModule"); - } - public static void MarkIsLoadRequested(IIgniteUIBlazor runtime) { + public static void MarkIsLoadRequested(IIgniteUIBlazor runtime) + { ModuleLoader.MarkIsLoadRequested(runtime, "WebRatingModule"); } - public static bool IsLoadRequested(IIgniteUIBlazor runtime) { + public static bool IsLoadRequested(IIgniteUIBlazor runtime) + { return ModuleLoader.IsLoadRequested(runtime, "WebRatingModule"); } } diff --git a/src/components/Blazor/RatingSymbol.cs b/src/components/Blazor/RatingSymbol.cs index 77e73485..ed0de962 100644 --- a/src/components/Blazor/RatingSymbol.cs +++ b/src/components/Blazor/RatingSymbol.cs @@ -1,116 +1,107 @@ - -using System; -using Microsoft.AspNetCore.Components; -using Microsoft.AspNetCore.Components.Rendering; -using System.Threading.Tasks; -using System.Collections.Generic; -using System.Linq; - namespace IgniteUI.Blazor.Controls { - /// -/// Used when a custom icon/symbol/element needs to be passed to the igc-rating component. -/// -public partial class IgbRatingSymbol: BaseRendererControl { - public override string Type { get { return "WebRatingSymbol"; } } - - protected override void EnsureModulesLoaded() - { - if (!IgbRatingSymbolModule.IsLoadRequested(IgBlazor)) - { - IgbRatingSymbolModule.Register(IgBlazor); - } - } - - protected override string ResolveDisplay() - { - return "inline-block"; - } - - protected override bool SupportsVisualChildren - { - get - { - return true; - } - } - - protected override bool UseDirectRender - { - get - { - return true; - } - } - - protected override string DirectRenderElementName - { - get - { - return "igc-rating-symbol"; - } - } - - protected override ControlEventBehavior DefaultEventBehavior - { - get { return ControlEventBehavior.Immediate; } - } - - public IgbRatingSymbol(): base() { - OnCreatedIgbRatingSymbol(); - - - } - - partial void OnCreatedIgbRatingSymbol(); - - - partial void FindByNameRatingSymbol(string name, ref object item); - public override object FindByName(string name) - { - - var baseResult = base.FindByName(name); - if (baseResult != null) - { - return baseResult; - } - - object item = null; - FindByNameRatingSymbol(name, ref item); - if (item != null) - { - return item; - } - - return null; - } - public async Task SetNativeElementAsync(Object element) - { - await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); - } - public void SetNativeElement(Object element) - { - InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); - } - public async Task ConnectedCallbackAsync() - { - await InvokeMethod("connectedCallback", new object[] { }, new string[] { }); - } - public void ConnectedCallback() - { - InvokeMethodSync("connectedCallback", new object[] { }, new string[] { }); - } - - partial void SerializeCoreIgbRatingSymbol(RendererSerializer ser); - - internal override void SerializeCore(RendererSerializer ser) - { - base.SerializeCore(ser); - - SerializeCoreIgbRatingSymbol(ser); - - - } - -} + /// + /// Used when a custom icon/symbol/element needs to be passed to the igc-rating component. + /// + public partial class IgbRatingSymbol : BaseRendererControl + { + public override string Type { get { return "WebRatingSymbol"; } } + + protected override void EnsureModulesLoaded() + { + if (!IgbRatingSymbolModule.IsLoadRequested(IgBlazor)) + { + IgbRatingSymbolModule.Register(IgBlazor); + } + } + + protected override string ResolveDisplay() + { + return "inline-block"; + } + + protected override bool SupportsVisualChildren + { + get + { + return true; + } + } + + protected override bool UseDirectRender + { + get + { + return true; + } + } + + protected override string DirectRenderElementName + { + get + { + return "igc-rating-symbol"; + } + } + + protected override ControlEventBehavior DefaultEventBehavior + { + get { return ControlEventBehavior.Immediate; } + } + + public IgbRatingSymbol() : base() + { + OnCreatedIgbRatingSymbol(); + + } + + partial void OnCreatedIgbRatingSymbol(); + + partial void FindByNameRatingSymbol(string name, ref object item); + public override object FindByName(string name) + { + + var baseResult = base.FindByName(name); + if (baseResult != null) + { + return baseResult; + } + + object item = null; + FindByNameRatingSymbol(name, ref item); + if (item != null) + { + return item; + } + + return null; + } + public async Task SetNativeElementAsync(Object element) + { + await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + } + public void SetNativeElement(Object element) + { + InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + } + public async Task ConnectedCallbackAsync() + { + await InvokeMethod("connectedCallback", new object[] { }, new string[] { }); + } + public void ConnectedCallback() + { + InvokeMethodSync("connectedCallback", new object[] { }, new string[] { }); + } + + partial void SerializeCoreIgbRatingSymbol(RendererSerializer ser); + + internal override void SerializeCore(RendererSerializer ser) + { + base.SerializeCore(ser); + + SerializeCoreIgbRatingSymbol(ser); + + } + + } } diff --git a/src/components/Blazor/RatingSymbolModule.cs b/src/components/Blazor/RatingSymbolModule.cs index d750ab44..3ac75510 100644 --- a/src/components/Blazor/RatingSymbolModule.cs +++ b/src/components/Blazor/RatingSymbolModule.cs @@ -1,23 +1,20 @@ -using System; -using System.Collections.Generic; -using System.Runtime.CompilerServices; -using System.Text; -using System.Collections.Generic; - namespace IgniteUI.Blazor.Controls { - public partial class IgbRatingSymbolModule { - public static void Register(IIgniteUIBlazor runtime) { + public partial class IgbRatingSymbolModule + { + public static void Register(IIgniteUIBlazor runtime) + { ModuleLoader.Load(runtime, "WebRatingSymbolModule"); - } - public static void MarkIsLoadRequested(IIgniteUIBlazor runtime) { + public static void MarkIsLoadRequested(IIgniteUIBlazor runtime) + { ModuleLoader.MarkIsLoadRequested(runtime, "WebRatingSymbolModule"); } - public static bool IsLoadRequested(IIgniteUIBlazor runtime) { + public static bool IsLoadRequested(IIgniteUIBlazor runtime) + { return ModuleLoader.IsLoadRequested(runtime, "WebRatingSymbolModule"); } } diff --git a/src/components/Blazor/Ripple.cs b/src/components/Blazor/Ripple.cs index 5387793c..34ba0f98 100644 --- a/src/components/Blazor/Ripple.cs +++ b/src/components/Blazor/Ripple.cs @@ -1,109 +1,100 @@ - -using System; -using Microsoft.AspNetCore.Components; -using Microsoft.AspNetCore.Components.Rendering; -using System.Threading.Tasks; -using System.Collections.Generic; -using System.Linq; - namespace IgniteUI.Blazor.Controls { - /// -/// A ripple can be applied to an element to represent -/// interactive surface. -/// -public partial class IgbRipple: BaseRendererControl { - public override string Type { get { return "WebRipple"; } } - - protected override void EnsureModulesLoaded() - { - if (!IgbRippleModule.IsLoadRequested(IgBlazor)) - { - IgbRippleModule.Register(IgBlazor); - } - } - - protected override string ResolveDisplay() - { - return "inline-block"; - } - - protected override bool SupportsVisualChildren - { - get - { - return true; - } - } - - protected override bool UseDirectRender - { - get - { - return true; - } - } - - protected override string DirectRenderElementName - { - get - { - return "igc-ripple"; - } - } - - protected override ControlEventBehavior DefaultEventBehavior - { - get { return ControlEventBehavior.Immediate; } - } - - public IgbRipple(): base() { - OnCreatedIgbRipple(); - - - } - - partial void OnCreatedIgbRipple(); - - - partial void FindByNameRipple(string name, ref object item); - public override object FindByName(string name) - { - - var baseResult = base.FindByName(name); - if (baseResult != null) - { - return baseResult; - } - - object item = null; - FindByNameRipple(name, ref item); - if (item != null) - { - return item; - } - - return null; - } - public async Task SetNativeElementAsync(Object element) - { - await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); - } - public void SetNativeElement(Object element) - { - InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); - } - - partial void SerializeCoreIgbRipple(RendererSerializer ser); - - internal override void SerializeCore(RendererSerializer ser) - { - base.SerializeCore(ser); - - SerializeCoreIgbRipple(ser); - - - } - -} + /// + /// A ripple can be applied to an element to represent + /// interactive surface. + /// + public partial class IgbRipple : BaseRendererControl + { + public override string Type { get { return "WebRipple"; } } + + protected override void EnsureModulesLoaded() + { + if (!IgbRippleModule.IsLoadRequested(IgBlazor)) + { + IgbRippleModule.Register(IgBlazor); + } + } + + protected override string ResolveDisplay() + { + return "inline-block"; + } + + protected override bool SupportsVisualChildren + { + get + { + return true; + } + } + + protected override bool UseDirectRender + { + get + { + return true; + } + } + + protected override string DirectRenderElementName + { + get + { + return "igc-ripple"; + } + } + + protected override ControlEventBehavior DefaultEventBehavior + { + get { return ControlEventBehavior.Immediate; } + } + + public IgbRipple() : base() + { + OnCreatedIgbRipple(); + + } + + partial void OnCreatedIgbRipple(); + + partial void FindByNameRipple(string name, ref object item); + public override object FindByName(string name) + { + + var baseResult = base.FindByName(name); + if (baseResult != null) + { + return baseResult; + } + + object item = null; + FindByNameRipple(name, ref item); + if (item != null) + { + return item; + } + + return null; + } + public async Task SetNativeElementAsync(Object element) + { + await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + } + public void SetNativeElement(Object element) + { + InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + } + + partial void SerializeCoreIgbRipple(RendererSerializer ser); + + internal override void SerializeCore(RendererSerializer ser) + { + base.SerializeCore(ser); + + SerializeCoreIgbRipple(ser); + + } + + } } diff --git a/src/components/Blazor/RippleModule.cs b/src/components/Blazor/RippleModule.cs index ca105860..69b8d048 100644 --- a/src/components/Blazor/RippleModule.cs +++ b/src/components/Blazor/RippleModule.cs @@ -1,23 +1,20 @@ -using System; -using System.Collections.Generic; -using System.Runtime.CompilerServices; -using System.Text; -using System.Collections.Generic; - namespace IgniteUI.Blazor.Controls { - public partial class IgbRippleModule { - public static void Register(IIgniteUIBlazor runtime) { + public partial class IgbRippleModule + { + public static void Register(IIgniteUIBlazor runtime) + { ModuleLoader.Load(runtime, "WebRippleModule"); - } - public static void MarkIsLoadRequested(IIgniteUIBlazor runtime) { + public static void MarkIsLoadRequested(IIgniteUIBlazor runtime) + { ModuleLoader.MarkIsLoadRequested(runtime, "WebRippleModule"); } - public static bool IsLoadRequested(IIgniteUIBlazor runtime) { + public static bool IsLoadRequested(IIgniteUIBlazor runtime) + { return ModuleLoader.IsLoadRequested(runtime, "WebRippleModule"); } } diff --git a/src/components/Blazor/Select.cs b/src/components/Blazor/Select.cs index b852894e..d4fcac9c 100644 --- a/src/components/Blazor/Select.cs +++ b/src/components/Blazor/Select.cs @@ -1,975 +1,1047 @@ - -using System; using Microsoft.AspNetCore.Components; -using Microsoft.AspNetCore.Components.Rendering; -using System.Threading.Tasks; -using System.Collections.Generic; -using System.Linq; namespace IgniteUI.Blazor.Controls { - /// -/// Represents a control that provides a menu of options. -/// -public partial class IgbSelect: IgbComboBoxBaseLike { - public override string Type { get { return "WebSelect"; } } - - protected override void EnsureModulesLoaded() - { - if (!IgbSelectModule.IsLoadRequested(IgBlazor)) - { - IgbSelectModule.Register(IgBlazor); - } - } + /// + /// Represents a control that provides a menu of options. + /// + public partial class IgbSelect : IgbComboBoxBaseLike + { + public override string Type { get { return "WebSelect"; } } - protected override string ResolveDisplay() - { - return "inline-block"; - } + protected override void EnsureModulesLoaded() + { + if (!IgbSelectModule.IsLoadRequested(IgBlazor)) + { + IgbSelectModule.Register(IgBlazor); + } + } + + protected override string ResolveDisplay() + { + return "inline-block"; + } + + protected override bool SupportsVisualChildren + { + get + { + return true; + } + } + + protected override bool UseDirectRender + { + get + { + return true; + } + } + + protected override string DirectRenderElementName + { + get + { + return "igc-select"; + } + } + + public IgbSelect() : base() + { + OnCreatedIgbSelect(); + + } + + partial void OnCreatedIgbSelect(); + + private string? _value; + + partial void OnValueChanging(ref string? newValue); + /// + /// The value attribute of the control. + /// + [Parameter] + public string? Value + { + get { return this._value; } + set + { + if (this._value != value || !IsPropDirty("Value")) + { + MarkPropDirty("Value"); + } + this._value = value; + + } + } + public async Task GetCurrentValueAsync() + { + var iv = await InvokeMethod("p:Value", new object[] { }, new string[] { }); + return ReturnToString(iv); + } + public string? GetCurrentValue() + { + var iv = InvokeMethodSync("p:Value", new object[] { }, new string[] { }); + return ReturnToString(iv); + } + private bool _outlined = false; + + partial void OnOutlinedChanging(ref bool newValue); + /// + /// The outlined attribute of the control. + /// + [Parameter] + public bool Outlined + { + get { return this._outlined; } + set + { + if (this._outlined != value || !IsPropDirty("Outlined")) + { + MarkPropDirty("Outlined"); + } + this._outlined = value; + + } + } + private bool _autofocus = false; + + partial void OnAutofocusChanging(ref bool newValue); + /// + /// The autofocus attribute of the control. + /// + [Parameter] + public bool Autofocus + { + get { return this._autofocus; } + set + { + if (this._autofocus != value || !IsPropDirty("Autofocus")) + { + MarkPropDirty("Autofocus"); + } + this._autofocus = value; + + } + } + private double _distance = 0; + + partial void OnDistanceChanging(ref double newValue); + /// + /// The distance of the select dropdown from its input. + /// + [Parameter] + public double Distance + { + get { return this._distance; } + set + { + if (this._distance != value || !IsPropDirty("Distance")) + { + MarkPropDirty("Distance"); + } + this._distance = value; + + } + } + private string _label; + + partial void OnLabelChanging(ref string newValue); + /// + /// The label attribute of the control. + /// + [Parameter] + public string Label + { + get { return this._label; } + set + { + if (this._label != value || !IsPropDirty("Label")) + { + MarkPropDirty("Label"); + } + this._label = value; + + } + } + private string _placeholder; + + partial void OnPlaceholderChanging(ref string newValue); + /// + /// The placeholder attribute of the control. + /// + [Parameter] + public string Placeholder + { + get { return this._placeholder; } + set + { + if (this._placeholder != value || !IsPropDirty("Placeholder")) + { + MarkPropDirty("Placeholder"); + } + this._placeholder = value; + + } + } + private PopoverPlacement _placement = PopoverPlacement.Top; + + partial void OnPlacementChanging(ref PopoverPlacement newValue); + /// + /// The preferred placement of the select dropdown around its input. + /// + [Parameter] + public PopoverPlacement Placement + { + get { return this._placement; } + set + { + if (this._placement != value || !IsPropDirty("Placement")) + { + MarkPropDirty("Placement"); + } + this._placement = value; + + } + } + private PopoverScrollStrategy _scrollStrategy = PopoverScrollStrategy.Scroll; + + partial void OnScrollStrategyChanging(ref PopoverScrollStrategy newValue); + /// + /// Determines the behavior of the component during scrolling of the parent container. + /// + [Parameter] + public PopoverScrollStrategy ScrollStrategy + { + get { return this._scrollStrategy; } + set + { + if (this._scrollStrategy != value || !IsPropDirty("ScrollStrategy")) + { + MarkPropDirty("ScrollStrategy"); + } + this._scrollStrategy = value; + + } + } + public async Task GetItemsAsync() + { + var iv = await InvokeMethod("p:Items", new object[] { }, new string[] { }); + + if (iv == null) + { + return default(IgbSelectItem[]); + } + var retVal = ReturnToObjectArray(iv); + if (retVal == null) + { + return default(IgbSelectItem[]); + } + return retVal; + + } + public IgbSelectItem[] GetItems() + { + var iv = InvokeMethodSync("p:Items", new object[] { }, new string[] { }); + + if (iv == null) + { + return default(IgbSelectItem[]); + } + var retVal = ReturnToObjectArray(iv); + if (retVal == null) + { + return default(IgbSelectItem[]); + } + return retVal; + + } + public async Task GetGroupsAsync() + { + var iv = await InvokeMethod("p:Groups", new object[] { }, new string[] { }); + + if (iv == null) + { + return default(IgbSelectGroup[]); + } + var retVal = ReturnToObjectArray(iv); + if (retVal == null) + { + return default(IgbSelectGroup[]); + } + return retVal; + + } + public IgbSelectGroup[] GetGroups() + { + var iv = InvokeMethodSync("p:Groups", new object[] { }, new string[] { }); + + if (iv == null) + { + return default(IgbSelectGroup[]); + } + var retVal = ReturnToObjectArray(iv); + if (retVal == null) + { + return default(IgbSelectGroup[]); + } + return retVal; + + } + public async Task GetSelectedItemAsync() + { + var iv = await InvokeMethod("p:SelectedItem", new object[] { }, new string[] { }); + + if (iv == null) + { + return default(IgbSelectItem); + } + var retVal = (IgbSelectItem)ConvertReturnValue(iv); + if (retVal == null) + { + return default(IgbSelectItem); + } + return retVal; + + } + public IgbSelectItem? GetSelectedItem() + { + var iv = InvokeMethodSync("p:SelectedItem", new object[] { }, new string[] { }); + + if (iv == null) + { + return default(IgbSelectItem); + } + var retVal = (IgbSelectItem)ConvertReturnValue(iv); + if (retVal == null) + { + return default(IgbSelectItem); + } + return retVal; + + } + private bool _disabled = false; + + partial void OnDisabledChanging(ref bool newValue); + /// + /// The disabled state of the component + /// + [Parameter] + public bool Disabled + { + get { return this._disabled; } + set + { + if (this._disabled != value || !IsPropDirty("Disabled")) + { + MarkPropDirty("Disabled"); + } + this._disabled = value; + + } + } + private bool _required = false; + + partial void OnRequiredChanging(ref bool newValue); + /// + /// Makes the control a required field in a form context. + /// + [Parameter] + public bool Required + { + get { return this._required; } + set + { + if (this._required != value || !IsPropDirty("Required")) + { + MarkPropDirty("Required"); + } + this._required = value; + + } + } + private bool _invalid = false; + + partial void OnInvalidChanging(ref bool newValue); + /// + /// Control the validity of the control. + /// + [Parameter] + public bool Invalid + { + get { return this._invalid; } + set + { + if (this._invalid != value || !IsPropDirty("Invalid")) + { + MarkPropDirty("Invalid"); + } + this._invalid = value; + + } + } + + partial void FindByNameSelect(string name, ref object item); + public override object FindByName(string name) + { + + var baseResult = base.FindByName(name); + if (baseResult != null) + { + return baseResult; + } + + object item = null; + FindByNameSelect(name, ref item); + if (item != null) + { + return item; + } + + return null; + } + /// + /// Sets focus on the component. + /// + + [WCWidgetMemberName("Focus")] + public async Task FocusComponentAsync(IgbFocusOptions options) + { + await InvokeMethod("focus", new object[] { ObjectToParam(options) }, new string[] { "Json" }); + } + + [WCWidgetMemberName("Focus")] + public void FocusComponent(IgbFocusOptions options) + { + InvokeMethodSync("focus", new object[] { ObjectToParam(options) }, new string[] { "Json" }); + } + /// + /// Removes focus from the component. + /// + + [WCWidgetMemberName("Blur")] + public async Task BlurComponentAsync() + { + await InvokeMethod("blur", new object[] { }, new string[] { }); + } + + [WCWidgetMemberName("Blur")] + public void BlurComponent() + { + InvokeMethodSync("blur", new object[] { }, new string[] { }); + } + /// + /// Checks the validity of the control and moves the focus to it if it is not valid. + /// + public async Task ReportValidityAsync() + { + var iv = await InvokeMethod("reportValidity", new object[] { }, new string[] { }); + return ReturnToBoolean(iv); + } + public bool ReportValidity() + { + var iv = InvokeMethodSync("reportValidity", new object[] { }, new string[] { }); + return ReturnToBoolean(iv); + } + /// + /// Resets the current value and selection of the component. + /// + public async Task ClearSelectionAsync() + { + await InvokeMethod("clearSelection", new object[] { }, new string[] { }); + } + public void ClearSelection() + { + InvokeMethodSync("clearSelection", new object[] { }, new string[] { }); + } + /// + /// Checks for validity of the control and emits the invalid event if it invalid. + /// + public async Task CheckValidityAsync() + { + await InvokeMethod("checkValidity", new object[] { }, new string[] { }); + } + public void CheckValidity() + { + InvokeMethodSync("checkValidity", new object[] { }, new string[] { }); + } + /// + /// Sets a custom validation message for the control. + /// As long as `message` is not empty, the control is considered invalid. + /// + public async Task SetCustomValidityAsync(String message) + { + await InvokeMethod("setCustomValidity", new object[] { StringToString(message) }, new string[] { "String" }); + } + public void SetCustomValidity(String message) + { + InvokeMethodSync("setCustomValidity", new object[] { StringToString(message) }, new string[] { "String" }); + } + + private EventCallback? _valueChanged = null; + [Parameter] + public EventCallback ValueChanged + { + get + { + return this._valueChanged != null ? this._valueChanged.Value : EventCallback.Empty; + } + set + { + if (!value.Equals(EventCallback.Empty)) + { + if (!CompareEventCallbacks(value, _valueChanged, ref eventCallbacksCache)) + { + this.EnsureChangeHandled(); - protected override bool SupportsVisualChildren + _valueChanged = value; + } + } + else + { + _valueChanged = null; + } + } + } + + private string _changeRef = null; + private string _changeScript = null; + [Parameter] + public string ChangeScript + { + + set + { + if (value != this._changeScript) + { + this._changeScript = value; + this.OnRefChanged("Change", null, value, true, false, (string refName, object oldValue, object newValue) => + { + this._changeRef = refName; + this.MarkPropDirty("ChangeRef"); + }); + } + } + get + { + return this._changeScript; + } + } + + partial void OnHandlingChange(IgbSelectItemComponentEventArgs args); + private EventCallback? _change = null; + [Parameter] + public EventCallback Change + { + get + { + return this._change != null ? this._change.Value : EventCallback.Empty; + } + set + { + if (!value.Equals(EventCallback.Empty)) + { + if (!CompareEventCallbacks(value, _change, ref eventCallbacksCache)) + { + _change = value; + this.SetHandler(this.Name, "Change", value, (args) => { - get + OnHandlingChange(args); + + var newValueValue = default(string?); + + { + newValueValue = (string?)(args.Detail.Value); + ; + OnEventUpdatingValue(this._value, ref newValueValue); + if (UseDirectRender) { - return true; + //TODO: maybe we should be doing this for everything. Need to make sure we don't infinity bounce though. + this.Value = newValueValue; } - } - - protected override bool UseDirectRender - { - get + else { - return true; + this._value = newValueValue; } - } + OnPropertyPropagatedOut(Name, "Value"); + } - protected override string DirectRenderElementName - { - get + if (!EventCallback.Empty.Equals(ValueChanged)) + { + var task = ValueChanged.InvokeAsync(newValueValue); + if (task.Exception != null) { - return "igc-select"; + throw task.Exception; } - } - - public IgbSelect(): base() { - OnCreatedIgbSelect(); - - - } - - partial void OnCreatedIgbSelect(); - - private string? _value; - - partial void OnValueChanging(ref string? newValue); - /// - /// The value attribute of the control. - /// - [Parameter] - public string? Value - { - get { return this._value; } - set { - if (this._value != value || !IsPropDirty("Value")) { - MarkPropDirty("Value"); - } - this._value = value; - - } - } - public async Task GetCurrentValueAsync() - { - var iv = await InvokeMethod("p:Value", new object[] { }, new string[] { }); - return ReturnToString(iv); - } - public string? GetCurrentValue() - { - var iv = InvokeMethodSync("p:Value", new object[] { }, new string[] { }); - return ReturnToString(iv); - } - private bool _outlined = false; - - partial void OnOutlinedChanging(ref bool newValue); - /// - /// The outlined attribute of the control. - /// - [Parameter] - public bool Outlined - { - get { return this._outlined; } - set { - if (this._outlined != value || !IsPropDirty("Outlined")) { - MarkPropDirty("Outlined"); - } - this._outlined = value; - - } - } - private bool _autofocus = false; - - partial void OnAutofocusChanging(ref bool newValue); - /// - /// The autofocus attribute of the control. - /// - [Parameter] - public bool Autofocus - { - get { return this._autofocus; } - set { - if (this._autofocus != value || !IsPropDirty("Autofocus")) { - MarkPropDirty("Autofocus"); - } - this._autofocus = value; - - } - } - private double _distance = 0; - - partial void OnDistanceChanging(ref double newValue); - /// - /// The distance of the select dropdown from its input. - /// - [Parameter] - public double Distance - { - get { return this._distance; } - set { - if (this._distance != value || !IsPropDirty("Distance")) { - MarkPropDirty("Distance"); - } - this._distance = value; - - } - } - private string _label; - - partial void OnLabelChanging(ref string newValue); - /// - /// The label attribute of the control. - /// - [Parameter] - public string Label - { - get { return this._label; } - set { - if (this._label != value || !IsPropDirty("Label")) { - MarkPropDirty("Label"); - } - this._label = value; - - } - } - private string _placeholder; - - partial void OnPlaceholderChanging(ref string newValue); - /// - /// The placeholder attribute of the control. - /// - [Parameter] - public string Placeholder - { - get { return this._placeholder; } - set { - if (this._placeholder != value || !IsPropDirty("Placeholder")) { - MarkPropDirty("Placeholder"); - } - this._placeholder = value; - - } - } - private PopoverPlacement _placement = PopoverPlacement.Top; - - partial void OnPlacementChanging(ref PopoverPlacement newValue); - /// - /// The preferred placement of the select dropdown around its input. - /// - [Parameter] - public PopoverPlacement Placement - { - get { return this._placement; } - set { - if (this._placement != value || !IsPropDirty("Placement")) { - MarkPropDirty("Placement"); - } - this._placement = value; - - } - } - private PopoverScrollStrategy _scrollStrategy = PopoverScrollStrategy.Scroll; - - partial void OnScrollStrategyChanging(ref PopoverScrollStrategy newValue); - /// - /// Determines the behavior of the component during scrolling of the parent container. - /// - [Parameter] - public PopoverScrollStrategy ScrollStrategy - { - get { return this._scrollStrategy; } - set { - if (this._scrollStrategy != value || !IsPropDirty("ScrollStrategy")) { - MarkPropDirty("ScrollStrategy"); - } - this._scrollStrategy = value; - - } - } - public async Task GetItemsAsync() - { - var iv = await InvokeMethod("p:Items", new object[] { }, new string[] { }); - - if (iv == null) - { - return default(IgbSelectItem[]); - } - var retVal = ReturnToObjectArray(iv); - if (retVal == null) - { - return default(IgbSelectItem[]); - } - return retVal; - - } - public IgbSelectItem[] GetItems() - { - var iv = InvokeMethodSync("p:Items", new object[] { }, new string[] { }); - - if (iv == null) - { - return default(IgbSelectItem[]); - } - var retVal = ReturnToObjectArray(iv); - if (retVal == null) - { - return default(IgbSelectItem[]); - } - return retVal; - - } - public async Task GetGroupsAsync() - { - var iv = await InvokeMethod("p:Groups", new object[] { }, new string[] { }); - - if (iv == null) - { - return default(IgbSelectGroup[]); - } - var retVal = ReturnToObjectArray(iv); - if (retVal == null) - { - return default(IgbSelectGroup[]); - } - return retVal; - - } - public IgbSelectGroup[] GetGroups() - { - var iv = InvokeMethodSync("p:Groups", new object[] { }, new string[] { }); - - if (iv == null) - { - return default(IgbSelectGroup[]); - } - var retVal = ReturnToObjectArray(iv); - if (retVal == null) - { - return default(IgbSelectGroup[]); - } - return retVal; - - } - public async Task GetSelectedItemAsync() - { - var iv = await InvokeMethod("p:SelectedItem", new object[] { }, new string[] { }); - - if (iv == null) - { - return default(IgbSelectItem); - } - var retVal = (IgbSelectItem)ConvertReturnValue(iv); - if (retVal == null) - { - return default(IgbSelectItem); - } - return retVal; - - } - public IgbSelectItem? GetSelectedItem() - { - var iv = InvokeMethodSync("p:SelectedItem", new object[] { }, new string[] { }); - - if (iv == null) - { - return default(IgbSelectItem); - } - var retVal = (IgbSelectItem)ConvertReturnValue(iv); - if (retVal == null) - { - return default(IgbSelectItem); - } - return retVal; - - } - private bool _disabled = false; - - partial void OnDisabledChanging(ref bool newValue); - /// - /// The disabled state of the component - /// - [Parameter] - public bool Disabled - { - get { return this._disabled; } - set { - if (this._disabled != value || !IsPropDirty("Disabled")) { - MarkPropDirty("Disabled"); - } - this._disabled = value; - - } - } - private bool _required = false; - - partial void OnRequiredChanging(ref bool newValue); - /// - /// Makes the control a required field in a form context. - /// - [Parameter] - public bool Required - { - get { return this._required; } - set { - if (this._required != value || !IsPropDirty("Required")) { - MarkPropDirty("Required"); - } - this._required = value; - - } - } - private bool _invalid = false; - - partial void OnInvalidChanging(ref bool newValue); - /// - /// Control the validity of the control. - /// - [Parameter] - public bool Invalid - { - get { return this._invalid; } - set { - if (this._invalid != value || !IsPropDirty("Invalid")) { - MarkPropDirty("Invalid"); - } - this._invalid = value; - - } - } - - partial void FindByNameSelect(string name, ref object item); - public override object FindByName(string name) - { - - var baseResult = base.FindByName(name); - if (baseResult != null) - { - return baseResult; - } - - object item = null; - FindByNameSelect(name, ref item); - if (item != null) - { - return item; - } - - return null; - } - /// - /// Sets focus on the component. - /// - - [WCWidgetMemberName("Focus")] - public async Task FocusComponentAsync(IgbFocusOptions options) - { - await InvokeMethod("focus", new object[] { ObjectToParam(options) }, new string[] { "Json" }); - } - - [WCWidgetMemberName("Focus")] - public void FocusComponent(IgbFocusOptions options) - { - InvokeMethodSync("focus", new object[] { ObjectToParam(options) }, new string[] { "Json" }); - } - /// - /// Removes focus from the component. - /// - - [WCWidgetMemberName("Blur")] - public async Task BlurComponentAsync() - { - await InvokeMethod("blur", new object[] { }, new string[] { }); - } - - [WCWidgetMemberName("Blur")] - public void BlurComponent() - { - InvokeMethodSync("blur", new object[] { }, new string[] { }); - } - /// - /// Checks the validity of the control and moves the focus to it if it is not valid. - /// - public async Task ReportValidityAsync() - { - var iv = await InvokeMethod("reportValidity", new object[] { }, new string[] { }); - return ReturnToBoolean(iv); - } - public bool ReportValidity() - { - var iv = InvokeMethodSync("reportValidity", new object[] { }, new string[] { }); - return ReturnToBoolean(iv); - } - /// - /// Resets the current value and selection of the component. - /// - public async Task ClearSelectionAsync() - { - await InvokeMethod("clearSelection", new object[] { }, new string[] { }); - } - public void ClearSelection() - { - InvokeMethodSync("clearSelection", new object[] { }, new string[] { }); - } - /// - /// Checks for validity of the control and emits the invalid event if it invalid. - /// - public async Task CheckValidityAsync() - { - await InvokeMethod("checkValidity", new object[] { }, new string[] { }); - } - public void CheckValidity() - { - InvokeMethodSync("checkValidity", new object[] { }, new string[] { }); - } - /// - /// Sets a custom validation message for the control. - /// As long as `message` is not empty, the control is considered invalid. - /// - public async Task SetCustomValidityAsync(String message) - { - await InvokeMethod("setCustomValidity", new object[] { StringToString(message) }, new string[] { "String" }); - } - public void SetCustomValidity(String message) - { - InvokeMethodSync("setCustomValidity", new object[] { StringToString(message) }, new string[] { "String" }); - } - - private EventCallback? _valueChanged = null; - [Parameter] - public EventCallback ValueChanged - { - get - { - return this._valueChanged != null ? this._valueChanged.Value : EventCallback.Empty; - } - set - { - if (!value.Equals(EventCallback.Empty)) - { - if (!CompareEventCallbacks(value, _valueChanged, ref eventCallbacksCache)) - { - this.EnsureChangeHandled(); - - _valueChanged = value; - } - } - else - { - _valueChanged = null; - } - } - } - - private string _changeRef = null; - private string _changeScript = null; - [Parameter] - public string ChangeScript { - - set - { - if (value != this._changeScript) - { - this._changeScript = value; - this.OnRefChanged("Change", null, value, true, false, (string refName, object oldValue, object newValue) => { - this._changeRef = refName; - this.MarkPropDirty("ChangeRef"); - }); - } - } - get - { - return this._changeScript; - } - } - - partial void OnHandlingChange(IgbSelectItemComponentEventArgs args); - private EventCallback? _change = null; - [Parameter] - public EventCallback Change - { - get - { - return this._change != null ? this._change.Value : EventCallback.Empty; - } - set - { - if (!value.Equals(EventCallback.Empty)) - { - if (!CompareEventCallbacks(value, _change, ref eventCallbacksCache)) - { - _change = value; - this.SetHandler(this.Name, "Change", value, (args) => { - OnHandlingChange(args); - - var newValueValue = default(string?); - - - { - newValueValue = (string?)(args.Detail.Value); - ; - OnEventUpdatingValue(this._value, ref newValueValue); - if (UseDirectRender) { - //TODO: maybe we should be doing this for everything. Need to make sure we don't infinity bounce though. - this.Value = newValueValue; - } else { - this._value = newValueValue; - } - OnPropertyPropagatedOut(Name, "Value"); - } - - if (!EventCallback.Empty.Equals(ValueChanged)) - { - var task = ValueChanged.InvokeAsync(newValueValue); - if (task.Exception != null) - { - throw task.Exception; - } - } - - }); - this.OnRefChanged("Change", null, "event:::Change", true, false, (refName, oldValue, newValue) => { - this._changeRef = refName; - this.MarkPropDirty("ChangeRef"); - }); - } - } - else - { - _change = null; - this.SetHandler(this.Name, "Change", null); - this.OnRefChanged("Change", null, null, true, false, (refName, oldValue, newValue) => { - this._changeRef = null; - this.MarkPropDirty("ChangeRef"); - }); - } - } - } - internal void EnsureChangeHandled() - { - if (EventCallback.Empty.Equals(this.Change)) - { - this.Change = new EventCallback(null, (Action)((e) => { })); this._change = null; - } - } - - - private string _focusRef = null; - private string _focusScript = null; - [Parameter] - public string FocusScript { - - set - { - if (value != this._focusScript) - { - this._focusScript = value; - this.OnRefChanged("Focus", null, value, true, false, (string refName, object oldValue, object newValue) => { - this._focusRef = refName; - this.MarkPropDirty("FocusRef"); - }); - } - } - get - { - return this._focusScript; - } - } - - partial void OnHandlingFocus(IgbVoidEventArgs args); - private EventCallback? _focus = null; - [Parameter] - public EventCallback Focus - { - get - { - return this._focus != null ? this._focus.Value : EventCallback.Empty; - } - set - { - if (!value.Equals(EventCallback.Empty)) - { - if (!CompareEventCallbacks(value, _focus, ref eventCallbacksCache)) - { - _focus = value; - this.SetHandler(this.Name, "Focus", value, (args) => { - OnHandlingFocus(args); - - }); - this.OnRefChanged("Focus", null, "nativeEvent:::Focus", true, false, (refName, oldValue, newValue) => { - this._focusRef = refName; - this.MarkPropDirty("FocusRef"); - }); - } - } - else - { - _focus = null; - this.SetHandler(this.Name, "Focus", null); - this.OnRefChanged("Focus", null, null, true, false, (refName, oldValue, newValue) => { - this._focusRef = null; - this.MarkPropDirty("FocusRef"); - }); - } - } - } - - private string _blurRef = null; - private string _blurScript = null; - [Parameter] - public string BlurScript { - - set - { - if (value != this._blurScript) - { - this._blurScript = value; - this.OnRefChanged("Blur", null, value, true, false, (string refName, object oldValue, object newValue) => { - this._blurRef = refName; - this.MarkPropDirty("BlurRef"); - }); - } - } - get - { - return this._blurScript; - } - } - - partial void OnHandlingBlur(IgbVoidEventArgs args); - private EventCallback? _blur = null; - [Parameter] - public EventCallback Blur - { - get - { - return this._blur != null ? this._blur.Value : EventCallback.Empty; - } - set - { - if (!value.Equals(EventCallback.Empty)) - { - if (!CompareEventCallbacks(value, _blur, ref eventCallbacksCache)) - { - _blur = value; - this.SetHandler(this.Name, "Blur", value, (args) => { - OnHandlingBlur(args); - - }); - this.OnRefChanged("Blur", null, "nativeEvent:::Blur", true, false, (refName, oldValue, newValue) => { - this._blurRef = refName; - this.MarkPropDirty("BlurRef"); - }); - } - } - else - { - _blur = null; - this.SetHandler(this.Name, "Blur", null); - this.OnRefChanged("Blur", null, null, true, false, (refName, oldValue, newValue) => { - this._blurRef = null; - this.MarkPropDirty("BlurRef"); - }); - } - } - } - - private string _openingRef = null; - private string _openingScript = null; - [Parameter] - public string OpeningScript { - - set - { - if (value != this._openingScript) - { - this._openingScript = value; - this.OnRefChanged("Opening", null, value, true, false, (string refName, object oldValue, object newValue) => { - this._openingRef = refName; - this.MarkPropDirty("OpeningRef"); - }); - } - } - get - { - return this._openingScript; - } - } - - partial void OnHandlingOpening(IgbVoidEventArgs args); - private EventCallback? _opening = null; - [Parameter] - public EventCallback Opening - { - get - { - return this._opening != null ? this._opening.Value : EventCallback.Empty; - } - set - { - if (!value.Equals(EventCallback.Empty)) - { - if (!CompareEventCallbacks(value, _opening, ref eventCallbacksCache)) - { - _opening = value; - this.SetHandler(this.Name, "Opening", value, (args) => { - OnHandlingOpening(args); - - }); - this.OnRefChanged("Opening", null, "event:::Opening", true, false, (refName, oldValue, newValue) => { - this._openingRef = refName; - this.MarkPropDirty("OpeningRef"); - }); - } - } - else - { - _opening = null; - this.SetHandler(this.Name, "Opening", null); - this.OnRefChanged("Opening", null, null, true, false, (refName, oldValue, newValue) => { - this._openingRef = null; - this.MarkPropDirty("OpeningRef"); - }); - } - } - } - - private string _openedRef = null; - private string _openedScript = null; - [Parameter] - public string OpenedScript { - - set - { - if (value != this._openedScript) - { - this._openedScript = value; - this.OnRefChanged("Opened", null, value, true, false, (string refName, object oldValue, object newValue) => { - this._openedRef = refName; - this.MarkPropDirty("OpenedRef"); - }); - } - } - get - { - return this._openedScript; - } - } - - partial void OnHandlingOpened(IgbVoidEventArgs args); - private EventCallback? _opened = null; - [Parameter] - public EventCallback Opened - { - get - { - return this._opened != null ? this._opened.Value : EventCallback.Empty; - } - set - { - if (!value.Equals(EventCallback.Empty)) - { - if (!CompareEventCallbacks(value, _opened, ref eventCallbacksCache)) - { - _opened = value; - this.SetHandler(this.Name, "Opened", value, (args) => { - OnHandlingOpened(args); - - }); - this.OnRefChanged("Opened", null, "event:::Opened", true, false, (refName, oldValue, newValue) => { - this._openedRef = refName; - this.MarkPropDirty("OpenedRef"); - }); - } - } - else - { - _opened = null; - this.SetHandler(this.Name, "Opened", null); - this.OnRefChanged("Opened", null, null, true, false, (refName, oldValue, newValue) => { - this._openedRef = null; - this.MarkPropDirty("OpenedRef"); - }); - } - } - } - - private string _closingRef = null; - private string _closingScript = null; - [Parameter] - public string ClosingScript { - - set - { - if (value != this._closingScript) - { - this._closingScript = value; - this.OnRefChanged("Closing", null, value, true, false, (string refName, object oldValue, object newValue) => { - this._closingRef = refName; - this.MarkPropDirty("ClosingRef"); - }); - } - } - get - { - return this._closingScript; - } - } - - partial void OnHandlingClosing(IgbVoidEventArgs args); - private EventCallback? _closing = null; - [Parameter] - public EventCallback Closing - { - get - { - return this._closing != null ? this._closing.Value : EventCallback.Empty; - } - set - { - if (!value.Equals(EventCallback.Empty)) - { - if (!CompareEventCallbacks(value, _closing, ref eventCallbacksCache)) - { - _closing = value; - this.SetHandler(this.Name, "Closing", value, (args) => { - OnHandlingClosing(args); - - }); - this.OnRefChanged("Closing", null, "event:::Closing", true, false, (refName, oldValue, newValue) => { - this._closingRef = refName; - this.MarkPropDirty("ClosingRef"); - }); - } - } - else - { - _closing = null; - this.SetHandler(this.Name, "Closing", null); - this.OnRefChanged("Closing", null, null, true, false, (refName, oldValue, newValue) => { - this._closingRef = null; - this.MarkPropDirty("ClosingRef"); - }); - } - } - } - - private string _closedRef = null; - private string _closedScript = null; - [Parameter] - public string ClosedScript { - - set - { - if (value != this._closedScript) - { - this._closedScript = value; - this.OnRefChanged("Closed", null, value, true, false, (string refName, object oldValue, object newValue) => { - this._closedRef = refName; - this.MarkPropDirty("ClosedRef"); - }); - } - } - get - { - return this._closedScript; - } - } - - partial void OnHandlingClosed(IgbVoidEventArgs args); - private EventCallback? _closed = null; - [Parameter] - public EventCallback Closed - { - get - { - return this._closed != null ? this._closed.Value : EventCallback.Empty; - } - set - { - if (!value.Equals(EventCallback.Empty)) - { - if (!CompareEventCallbacks(value, _closed, ref eventCallbacksCache)) - { - _closed = value; - this.SetHandler(this.Name, "Closed", value, (args) => { - OnHandlingClosed(args); - - }); - this.OnRefChanged("Closed", null, "event:::Closed", true, false, (refName, oldValue, newValue) => { - this._closedRef = refName; - this.MarkPropDirty("ClosedRef"); - }); - } - } - else - { - _closed = null; - this.SetHandler(this.Name, "Closed", null); - this.OnRefChanged("Closed", null, null, true, false, (refName, oldValue, newValue) => { - this._closedRef = null; - this.MarkPropDirty("ClosedRef"); - }); - } - } - } - - partial void OnEventUpdatingValue(string? oldValue, ref string? newValue); - - partial void SerializeCoreIgbSelect(RendererSerializer ser); - - internal override void SerializeCore(RendererSerializer ser) - { - base.SerializeCore(ser); - - SerializeCoreIgbSelect(ser); - - if (IsPropDirty("Value")) { ser.AddStringProp("value", this._value); } - if (IsPropDirty("Outlined")) { ser.AddBooleanProp("outlined", this._outlined); } - if (IsPropDirty("Autofocus")) { ser.AddBooleanProp("autofocus", this._autofocus); } - if (IsPropDirty("Distance")) { ser.AddNumberProp("distance", this._distance); } - if (IsPropDirty("Label")) { ser.AddStringProp("label", this._label); } - if (IsPropDirty("Placeholder")) { ser.AddStringProp("placeholder", this._placeholder); } - if (IsPropDirty("Placement")) { ser.AddEnumProp("placement", this._placement); } - if (IsPropDirty("ScrollStrategy")) { ser.AddEnumProp("scrollStrategy", this._scrollStrategy); } - if (IsPropDirty("Disabled")) { ser.AddBooleanProp("disabled", this._disabled); } - if (IsPropDirty("Required")) { ser.AddBooleanProp("required", this._required); } - if (IsPropDirty("Invalid")) { ser.AddBooleanProp("invalid", this._invalid); } - if (IsPropDirty("ChangeRef")) { ser.AddStringProp("changeRef", this._changeRef); } - if (IsPropDirty("FocusRef")) { ser.AddStringProp("focusRef", this._focusRef); } - if (IsPropDirty("BlurRef")) { ser.AddStringProp("blurRef", this._blurRef); } - if (IsPropDirty("OpeningRef")) { ser.AddStringProp("openingRef", this._openingRef); } - if (IsPropDirty("OpenedRef")) { ser.AddStringProp("openedRef", this._openedRef); } - if (IsPropDirty("ClosingRef")) { ser.AddStringProp("closingRef", this._closingRef); } - if (IsPropDirty("ClosedRef")) { ser.AddStringProp("closedRef", this._closedRef); } - - } - -} + } + + }); + this.OnRefChanged("Change", null, "event:::Change", true, false, (refName, oldValue, newValue) => + { + this._changeRef = refName; + this.MarkPropDirty("ChangeRef"); + }); + } + } + else + { + _change = null; + this.SetHandler(this.Name, "Change", null); + this.OnRefChanged("Change", null, null, true, false, (refName, oldValue, newValue) => + { + this._changeRef = null; + this.MarkPropDirty("ChangeRef"); + }); + } + } + } + internal void EnsureChangeHandled() + { + if (EventCallback.Empty.Equals(this.Change)) + { + this.Change = new EventCallback(null, (Action)((e) => { })); + this._change = null; + } + } + + private string _focusRef = null; + private string _focusScript = null; + [Parameter] + public string FocusScript + { + + set + { + if (value != this._focusScript) + { + this._focusScript = value; + this.OnRefChanged("Focus", null, value, true, false, (string refName, object oldValue, object newValue) => + { + this._focusRef = refName; + this.MarkPropDirty("FocusRef"); + }); + } + } + get + { + return this._focusScript; + } + } + + partial void OnHandlingFocus(IgbVoidEventArgs args); + private EventCallback? _focus = null; + [Parameter] + public EventCallback Focus + { + get + { + return this._focus != null ? this._focus.Value : EventCallback.Empty; + } + set + { + if (!value.Equals(EventCallback.Empty)) + { + if (!CompareEventCallbacks(value, _focus, ref eventCallbacksCache)) + { + _focus = value; + this.SetHandler(this.Name, "Focus", value, (args) => + { + OnHandlingFocus(args); + + }); + this.OnRefChanged("Focus", null, "nativeEvent:::Focus", true, false, (refName, oldValue, newValue) => + { + this._focusRef = refName; + this.MarkPropDirty("FocusRef"); + }); + } + } + else + { + _focus = null; + this.SetHandler(this.Name, "Focus", null); + this.OnRefChanged("Focus", null, null, true, false, (refName, oldValue, newValue) => + { + this._focusRef = null; + this.MarkPropDirty("FocusRef"); + }); + } + } + } + + private string _blurRef = null; + private string _blurScript = null; + [Parameter] + public string BlurScript + { + + set + { + if (value != this._blurScript) + { + this._blurScript = value; + this.OnRefChanged("Blur", null, value, true, false, (string refName, object oldValue, object newValue) => + { + this._blurRef = refName; + this.MarkPropDirty("BlurRef"); + }); + } + } + get + { + return this._blurScript; + } + } + + partial void OnHandlingBlur(IgbVoidEventArgs args); + private EventCallback? _blur = null; + [Parameter] + public EventCallback Blur + { + get + { + return this._blur != null ? this._blur.Value : EventCallback.Empty; + } + set + { + if (!value.Equals(EventCallback.Empty)) + { + if (!CompareEventCallbacks(value, _blur, ref eventCallbacksCache)) + { + _blur = value; + this.SetHandler(this.Name, "Blur", value, (args) => + { + OnHandlingBlur(args); + + }); + this.OnRefChanged("Blur", null, "nativeEvent:::Blur", true, false, (refName, oldValue, newValue) => + { + this._blurRef = refName; + this.MarkPropDirty("BlurRef"); + }); + } + } + else + { + _blur = null; + this.SetHandler(this.Name, "Blur", null); + this.OnRefChanged("Blur", null, null, true, false, (refName, oldValue, newValue) => + { + this._blurRef = null; + this.MarkPropDirty("BlurRef"); + }); + } + } + } + + private string _openingRef = null; + private string _openingScript = null; + [Parameter] + public string OpeningScript + { + + set + { + if (value != this._openingScript) + { + this._openingScript = value; + this.OnRefChanged("Opening", null, value, true, false, (string refName, object oldValue, object newValue) => + { + this._openingRef = refName; + this.MarkPropDirty("OpeningRef"); + }); + } + } + get + { + return this._openingScript; + } + } + + partial void OnHandlingOpening(IgbVoidEventArgs args); + private EventCallback? _opening = null; + [Parameter] + public EventCallback Opening + { + get + { + return this._opening != null ? this._opening.Value : EventCallback.Empty; + } + set + { + if (!value.Equals(EventCallback.Empty)) + { + if (!CompareEventCallbacks(value, _opening, ref eventCallbacksCache)) + { + _opening = value; + this.SetHandler(this.Name, "Opening", value, (args) => + { + OnHandlingOpening(args); + + }); + this.OnRefChanged("Opening", null, "event:::Opening", true, false, (refName, oldValue, newValue) => + { + this._openingRef = refName; + this.MarkPropDirty("OpeningRef"); + }); + } + } + else + { + _opening = null; + this.SetHandler(this.Name, "Opening", null); + this.OnRefChanged("Opening", null, null, true, false, (refName, oldValue, newValue) => + { + this._openingRef = null; + this.MarkPropDirty("OpeningRef"); + }); + } + } + } + + private string _openedRef = null; + private string _openedScript = null; + [Parameter] + public string OpenedScript + { + + set + { + if (value != this._openedScript) + { + this._openedScript = value; + this.OnRefChanged("Opened", null, value, true, false, (string refName, object oldValue, object newValue) => + { + this._openedRef = refName; + this.MarkPropDirty("OpenedRef"); + }); + } + } + get + { + return this._openedScript; + } + } + + partial void OnHandlingOpened(IgbVoidEventArgs args); + private EventCallback? _opened = null; + [Parameter] + public EventCallback Opened + { + get + { + return this._opened != null ? this._opened.Value : EventCallback.Empty; + } + set + { + if (!value.Equals(EventCallback.Empty)) + { + if (!CompareEventCallbacks(value, _opened, ref eventCallbacksCache)) + { + _opened = value; + this.SetHandler(this.Name, "Opened", value, (args) => + { + OnHandlingOpened(args); + + }); + this.OnRefChanged("Opened", null, "event:::Opened", true, false, (refName, oldValue, newValue) => + { + this._openedRef = refName; + this.MarkPropDirty("OpenedRef"); + }); + } + } + else + { + _opened = null; + this.SetHandler(this.Name, "Opened", null); + this.OnRefChanged("Opened", null, null, true, false, (refName, oldValue, newValue) => + { + this._openedRef = null; + this.MarkPropDirty("OpenedRef"); + }); + } + } + } + + private string _closingRef = null; + private string _closingScript = null; + [Parameter] + public string ClosingScript + { + + set + { + if (value != this._closingScript) + { + this._closingScript = value; + this.OnRefChanged("Closing", null, value, true, false, (string refName, object oldValue, object newValue) => + { + this._closingRef = refName; + this.MarkPropDirty("ClosingRef"); + }); + } + } + get + { + return this._closingScript; + } + } + + partial void OnHandlingClosing(IgbVoidEventArgs args); + private EventCallback? _closing = null; + [Parameter] + public EventCallback Closing + { + get + { + return this._closing != null ? this._closing.Value : EventCallback.Empty; + } + set + { + if (!value.Equals(EventCallback.Empty)) + { + if (!CompareEventCallbacks(value, _closing, ref eventCallbacksCache)) + { + _closing = value; + this.SetHandler(this.Name, "Closing", value, (args) => + { + OnHandlingClosing(args); + + }); + this.OnRefChanged("Closing", null, "event:::Closing", true, false, (refName, oldValue, newValue) => + { + this._closingRef = refName; + this.MarkPropDirty("ClosingRef"); + }); + } + } + else + { + _closing = null; + this.SetHandler(this.Name, "Closing", null); + this.OnRefChanged("Closing", null, null, true, false, (refName, oldValue, newValue) => + { + this._closingRef = null; + this.MarkPropDirty("ClosingRef"); + }); + } + } + } + + private string _closedRef = null; + private string _closedScript = null; + [Parameter] + public string ClosedScript + { + + set + { + if (value != this._closedScript) + { + this._closedScript = value; + this.OnRefChanged("Closed", null, value, true, false, (string refName, object oldValue, object newValue) => + { + this._closedRef = refName; + this.MarkPropDirty("ClosedRef"); + }); + } + } + get + { + return this._closedScript; + } + } + + partial void OnHandlingClosed(IgbVoidEventArgs args); + private EventCallback? _closed = null; + [Parameter] + public EventCallback Closed + { + get + { + return this._closed != null ? this._closed.Value : EventCallback.Empty; + } + set + { + if (!value.Equals(EventCallback.Empty)) + { + if (!CompareEventCallbacks(value, _closed, ref eventCallbacksCache)) + { + _closed = value; + this.SetHandler(this.Name, "Closed", value, (args) => + { + OnHandlingClosed(args); + + }); + this.OnRefChanged("Closed", null, "event:::Closed", true, false, (refName, oldValue, newValue) => + { + this._closedRef = refName; + this.MarkPropDirty("ClosedRef"); + }); + } + } + else + { + _closed = null; + this.SetHandler(this.Name, "Closed", null); + this.OnRefChanged("Closed", null, null, true, false, (refName, oldValue, newValue) => + { + this._closedRef = null; + this.MarkPropDirty("ClosedRef"); + }); + } + } + } + + partial void OnEventUpdatingValue(string? oldValue, ref string? newValue); + + partial void SerializeCoreIgbSelect(RendererSerializer ser); + + internal override void SerializeCore(RendererSerializer ser) + { + base.SerializeCore(ser); + + SerializeCoreIgbSelect(ser); + + if (IsPropDirty("Value")) + { ser.AddStringProp("value", this._value); } + if (IsPropDirty("Outlined")) + { ser.AddBooleanProp("outlined", this._outlined); } + if (IsPropDirty("Autofocus")) + { ser.AddBooleanProp("autofocus", this._autofocus); } + if (IsPropDirty("Distance")) + { ser.AddNumberProp("distance", this._distance); } + if (IsPropDirty("Label")) + { ser.AddStringProp("label", this._label); } + if (IsPropDirty("Placeholder")) + { ser.AddStringProp("placeholder", this._placeholder); } + if (IsPropDirty("Placement")) + { ser.AddEnumProp("placement", this._placement); } + if (IsPropDirty("ScrollStrategy")) + { ser.AddEnumProp("scrollStrategy", this._scrollStrategy); } + if (IsPropDirty("Disabled")) + { ser.AddBooleanProp("disabled", this._disabled); } + if (IsPropDirty("Required")) + { ser.AddBooleanProp("required", this._required); } + if (IsPropDirty("Invalid")) + { ser.AddBooleanProp("invalid", this._invalid); } + if (IsPropDirty("ChangeRef")) + { ser.AddStringProp("changeRef", this._changeRef); } + if (IsPropDirty("FocusRef")) + { ser.AddStringProp("focusRef", this._focusRef); } + if (IsPropDirty("BlurRef")) + { ser.AddStringProp("blurRef", this._blurRef); } + if (IsPropDirty("OpeningRef")) + { ser.AddStringProp("openingRef", this._openingRef); } + if (IsPropDirty("OpenedRef")) + { ser.AddStringProp("openedRef", this._openedRef); } + if (IsPropDirty("ClosingRef")) + { ser.AddStringProp("closingRef", this._closingRef); } + if (IsPropDirty("ClosedRef")) + { ser.AddStringProp("closedRef", this._closedRef); } + + } + + } } diff --git a/src/components/Blazor/SelectGroup.cs b/src/components/Blazor/SelectGroup.cs index 0bb28b0e..9f3dcd36 100644 --- a/src/components/Blazor/SelectGroup.cs +++ b/src/components/Blazor/SelectGroup.cs @@ -1,143 +1,144 @@ - -using System; using Microsoft.AspNetCore.Components; -using Microsoft.AspNetCore.Components.Rendering; -using System.Threading.Tasks; -using System.Collections.Generic; -using System.Linq; namespace IgniteUI.Blazor.Controls { - public partial class IgbSelectGroup: BaseRendererControl { - public override string Type { get { return "WebSelectGroup"; } } - - protected override void EnsureModulesLoaded() - { - if (!IgbSelectGroupModule.IsLoadRequested(IgBlazor)) - { - IgbSelectGroupModule.Register(IgBlazor); - } - } - - protected override string ResolveDisplay() - { - return "inline-block"; - } - - protected override bool SupportsVisualChildren - { - get - { - return true; - } - } - - protected override bool UseDirectRender - { - get - { - return true; - } - } - - protected override string DirectRenderElementName - { - get - { - return "igc-select-group"; - } - } - - protected override ControlEventBehavior DefaultEventBehavior - { - get { return ControlEventBehavior.Immediate; } - } - - public IgbSelectGroup(): base() { - OnCreatedIgbSelectGroup(); - - - } - - partial void OnCreatedIgbSelectGroup(); - - private IgbSelectItem[] _items; - - partial void OnItemsChanging(ref IgbSelectItem[] newValue); - /// - /// All child `igc-select-item`s. - /// - [Parameter] - public IgbSelectItem[] Items - { - get { return this._items; } - set { - if (this._items != value || !IsPropDirty("Items")) { - MarkPropDirty("Items"); - } - this._items = value; - - } - } - private bool _disabled = false; - - partial void OnDisabledChanging(ref bool newValue); - /// - /// Whether the group item and all its children are disabled. - /// - [Parameter] - public bool Disabled - { - get { return this._disabled; } - set { - if (this._disabled != value || !IsPropDirty("Disabled")) { - MarkPropDirty("Disabled"); - } - this._disabled = value; - - } - } - - partial void FindByNameSelectGroup(string name, ref object item); - public override object FindByName(string name) - { - - var baseResult = base.FindByName(name); - if (baseResult != null) - { - return baseResult; - } - - object item = null; - FindByNameSelectGroup(name, ref item); - if (item != null) - { - return item; - } - - return null; - } - public async Task SetNativeElementAsync(Object element) - { - await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); - } - public void SetNativeElement(Object element) - { - InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); - } - - partial void SerializeCoreIgbSelectGroup(RendererSerializer ser); - - internal override void SerializeCore(RendererSerializer ser) - { - base.SerializeCore(ser); - - SerializeCoreIgbSelectGroup(ser); - - if (IsPropDirty("Items")) { ser.AddSerializableArrayProp("items", this._items); } - if (IsPropDirty("Disabled")) { ser.AddBooleanProp("disabled", this._disabled); } - - } - -} + public partial class IgbSelectGroup : BaseRendererControl + { + public override string Type { get { return "WebSelectGroup"; } } + + protected override void EnsureModulesLoaded() + { + if (!IgbSelectGroupModule.IsLoadRequested(IgBlazor)) + { + IgbSelectGroupModule.Register(IgBlazor); + } + } + + protected override string ResolveDisplay() + { + return "inline-block"; + } + + protected override bool SupportsVisualChildren + { + get + { + return true; + } + } + + protected override bool UseDirectRender + { + get + { + return true; + } + } + + protected override string DirectRenderElementName + { + get + { + return "igc-select-group"; + } + } + + protected override ControlEventBehavior DefaultEventBehavior + { + get { return ControlEventBehavior.Immediate; } + } + + public IgbSelectGroup() : base() + { + OnCreatedIgbSelectGroup(); + + } + + partial void OnCreatedIgbSelectGroup(); + + private IgbSelectItem[] _items; + + partial void OnItemsChanging(ref IgbSelectItem[] newValue); + /// + /// All child `igc-select-item`s. + /// + [Parameter] + public IgbSelectItem[] Items + { + get { return this._items; } + set + { + if (this._items != value || !IsPropDirty("Items")) + { + MarkPropDirty("Items"); + } + this._items = value; + + } + } + private bool _disabled = false; + + partial void OnDisabledChanging(ref bool newValue); + /// + /// Whether the group item and all its children are disabled. + /// + [Parameter] + public bool Disabled + { + get { return this._disabled; } + set + { + if (this._disabled != value || !IsPropDirty("Disabled")) + { + MarkPropDirty("Disabled"); + } + this._disabled = value; + + } + } + + partial void FindByNameSelectGroup(string name, ref object item); + public override object FindByName(string name) + { + + var baseResult = base.FindByName(name); + if (baseResult != null) + { + return baseResult; + } + + object item = null; + FindByNameSelectGroup(name, ref item); + if (item != null) + { + return item; + } + + return null; + } + public async Task SetNativeElementAsync(Object element) + { + await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + } + public void SetNativeElement(Object element) + { + InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + } + + partial void SerializeCoreIgbSelectGroup(RendererSerializer ser); + + internal override void SerializeCore(RendererSerializer ser) + { + base.SerializeCore(ser); + + SerializeCoreIgbSelectGroup(ser); + + if (IsPropDirty("Items")) + { ser.AddSerializableArrayProp("items", this._items); } + if (IsPropDirty("Disabled")) + { ser.AddBooleanProp("disabled", this._disabled); } + + } + + } } diff --git a/src/components/Blazor/SelectGroupModule.cs b/src/components/Blazor/SelectGroupModule.cs index f96ff7a9..ccf07b16 100644 --- a/src/components/Blazor/SelectGroupModule.cs +++ b/src/components/Blazor/SelectGroupModule.cs @@ -1,24 +1,22 @@ -using System; -using System.Collections.Generic; -using System.Runtime.CompilerServices; -using System.Text; -using System.Collections.Generic; - namespace IgniteUI.Blazor.Controls { - public partial class IgbSelectGroupModule { - public static void Register(IIgniteUIBlazor runtime) { + public partial class IgbSelectGroupModule + { + public static void Register(IIgniteUIBlazor runtime) + { ModuleLoader.Load(runtime, "WebSelectGroupModule"); IgbSelectItemModule.MarkIsLoadRequested(runtime); } - public static void MarkIsLoadRequested(IIgniteUIBlazor runtime) { + public static void MarkIsLoadRequested(IIgniteUIBlazor runtime) + { ModuleLoader.MarkIsLoadRequested(runtime, "WebSelectGroupModule"); } - public static bool IsLoadRequested(IIgniteUIBlazor runtime) { + public static bool IsLoadRequested(IIgniteUIBlazor runtime) + { return ModuleLoader.IsLoadRequested(runtime, "WebSelectGroupModule"); } } diff --git a/src/components/Blazor/SelectHeader.cs b/src/components/Blazor/SelectHeader.cs index f0470b81..5033e8f3 100644 --- a/src/components/Blazor/SelectHeader.cs +++ b/src/components/Blazor/SelectHeader.cs @@ -1,108 +1,99 @@ - -using System; -using Microsoft.AspNetCore.Components; -using Microsoft.AspNetCore.Components.Rendering; -using System.Threading.Tasks; -using System.Collections.Generic; -using System.Linq; - namespace IgniteUI.Blazor.Controls { - /// -/// Represents a header item in an igc-select component. -/// -public partial class IgbSelectHeader: BaseRendererControl { - public override string Type { get { return "WebSelectHeader"; } } - - protected override void EnsureModulesLoaded() - { - if (!IgbSelectHeaderModule.IsLoadRequested(IgBlazor)) - { - IgbSelectHeaderModule.Register(IgBlazor); - } - } - - protected override string ResolveDisplay() - { - return "inline-block"; - } - - protected override bool SupportsVisualChildren - { - get - { - return true; - } - } - - protected override bool UseDirectRender - { - get - { - return true; - } - } - - protected override string DirectRenderElementName - { - get - { - return "igc-select-header"; - } - } - - protected override ControlEventBehavior DefaultEventBehavior - { - get { return ControlEventBehavior.Immediate; } - } - - public IgbSelectHeader(): base() { - OnCreatedIgbSelectHeader(); - - - } - - partial void OnCreatedIgbSelectHeader(); - - - partial void FindByNameSelectHeader(string name, ref object item); - public override object FindByName(string name) - { - - var baseResult = base.FindByName(name); - if (baseResult != null) - { - return baseResult; - } - - object item = null; - FindByNameSelectHeader(name, ref item); - if (item != null) - { - return item; - } - - return null; - } - public async Task SetNativeElementAsync(Object element) - { - await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); - } - public void SetNativeElement(Object element) - { - InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); - } - - partial void SerializeCoreIgbSelectHeader(RendererSerializer ser); - - internal override void SerializeCore(RendererSerializer ser) - { - base.SerializeCore(ser); - - SerializeCoreIgbSelectHeader(ser); - - - } - -} + /// + /// Represents a header item in an igc-select component. + /// + public partial class IgbSelectHeader : BaseRendererControl + { + public override string Type { get { return "WebSelectHeader"; } } + + protected override void EnsureModulesLoaded() + { + if (!IgbSelectHeaderModule.IsLoadRequested(IgBlazor)) + { + IgbSelectHeaderModule.Register(IgBlazor); + } + } + + protected override string ResolveDisplay() + { + return "inline-block"; + } + + protected override bool SupportsVisualChildren + { + get + { + return true; + } + } + + protected override bool UseDirectRender + { + get + { + return true; + } + } + + protected override string DirectRenderElementName + { + get + { + return "igc-select-header"; + } + } + + protected override ControlEventBehavior DefaultEventBehavior + { + get { return ControlEventBehavior.Immediate; } + } + + public IgbSelectHeader() : base() + { + OnCreatedIgbSelectHeader(); + + } + + partial void OnCreatedIgbSelectHeader(); + + partial void FindByNameSelectHeader(string name, ref object item); + public override object FindByName(string name) + { + + var baseResult = base.FindByName(name); + if (baseResult != null) + { + return baseResult; + } + + object item = null; + FindByNameSelectHeader(name, ref item); + if (item != null) + { + return item; + } + + return null; + } + public async Task SetNativeElementAsync(Object element) + { + await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + } + public void SetNativeElement(Object element) + { + InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + } + + partial void SerializeCoreIgbSelectHeader(RendererSerializer ser); + + internal override void SerializeCore(RendererSerializer ser) + { + base.SerializeCore(ser); + + SerializeCoreIgbSelectHeader(ser); + + } + + } } diff --git a/src/components/Blazor/SelectHeaderModule.cs b/src/components/Blazor/SelectHeaderModule.cs index 693f284c..b4171b75 100644 --- a/src/components/Blazor/SelectHeaderModule.cs +++ b/src/components/Blazor/SelectHeaderModule.cs @@ -1,23 +1,20 @@ -using System; -using System.Collections.Generic; -using System.Runtime.CompilerServices; -using System.Text; -using System.Collections.Generic; - namespace IgniteUI.Blazor.Controls { - public partial class IgbSelectHeaderModule { - public static void Register(IIgniteUIBlazor runtime) { + public partial class IgbSelectHeaderModule + { + public static void Register(IIgniteUIBlazor runtime) + { ModuleLoader.Load(runtime, "WebSelectHeaderModule"); - } - public static void MarkIsLoadRequested(IIgniteUIBlazor runtime) { + public static void MarkIsLoadRequested(IIgniteUIBlazor runtime) + { ModuleLoader.MarkIsLoadRequested(runtime, "WebSelectHeaderModule"); } - public static bool IsLoadRequested(IIgniteUIBlazor runtime) { + public static bool IsLoadRequested(IIgniteUIBlazor runtime) + { return ModuleLoader.IsLoadRequested(runtime, "WebSelectHeaderModule"); } } diff --git a/src/components/Blazor/SelectItem.cs b/src/components/Blazor/SelectItem.cs index 88f32724..940b1aa9 100644 --- a/src/components/Blazor/SelectItem.cs +++ b/src/components/Blazor/SelectItem.cs @@ -1,95 +1,86 @@ - -using System; -using Microsoft.AspNetCore.Components; -using Microsoft.AspNetCore.Components.Rendering; -using System.Threading.Tasks; -using System.Collections.Generic; -using System.Linq; - namespace IgniteUI.Blazor.Controls { - /// -/// Represents an item in a select list. -/// -public partial class IgbSelectItem: IgbBaseOptionLike { - public override string Type { get { return "WebSelectItem"; } } - - protected override void EnsureModulesLoaded() - { - if (!IgbSelectItemModule.IsLoadRequested(IgBlazor)) - { - IgbSelectItemModule.Register(IgBlazor); - } - } - - protected override string ResolveDisplay() - { - return "inline-block"; - } - - protected override bool SupportsVisualChildren - { - get - { - return true; - } - } - - protected override bool UseDirectRender - { - get - { - return true; - } - } - - protected override string DirectRenderElementName - { - get - { - return "igc-select-item"; - } - } - - public IgbSelectItem(): base() { - OnCreatedIgbSelectItem(); - - - } - - partial void OnCreatedIgbSelectItem(); - - - partial void FindByNameSelectItem(string name, ref object item); - public override object FindByName(string name) - { - - var baseResult = base.FindByName(name); - if (baseResult != null) - { - return baseResult; - } - - object item = null; - FindByNameSelectItem(name, ref item); - if (item != null) - { - return item; - } - - return null; - } - - partial void SerializeCoreIgbSelectItem(RendererSerializer ser); - - internal override void SerializeCore(RendererSerializer ser) - { - base.SerializeCore(ser); - - SerializeCoreIgbSelectItem(ser); - - - } - -} + /// + /// Represents an item in a select list. + /// + public partial class IgbSelectItem : IgbBaseOptionLike + { + public override string Type { get { return "WebSelectItem"; } } + + protected override void EnsureModulesLoaded() + { + if (!IgbSelectItemModule.IsLoadRequested(IgBlazor)) + { + IgbSelectItemModule.Register(IgBlazor); + } + } + + protected override string ResolveDisplay() + { + return "inline-block"; + } + + protected override bool SupportsVisualChildren + { + get + { + return true; + } + } + + protected override bool UseDirectRender + { + get + { + return true; + } + } + + protected override string DirectRenderElementName + { + get + { + return "igc-select-item"; + } + } + + public IgbSelectItem() : base() + { + OnCreatedIgbSelectItem(); + + } + + partial void OnCreatedIgbSelectItem(); + + partial void FindByNameSelectItem(string name, ref object item); + public override object FindByName(string name) + { + + var baseResult = base.FindByName(name); + if (baseResult != null) + { + return baseResult; + } + + object item = null; + FindByNameSelectItem(name, ref item); + if (item != null) + { + return item; + } + + return null; + } + + partial void SerializeCoreIgbSelectItem(RendererSerializer ser); + + internal override void SerializeCore(RendererSerializer ser) + { + base.SerializeCore(ser); + + SerializeCoreIgbSelectItem(ser); + + } + + } } diff --git a/src/components/Blazor/SelectItemComponentEventArgs.cs b/src/components/Blazor/SelectItemComponentEventArgs.cs index 7f039dfb..6deb423a 100644 --- a/src/components/Blazor/SelectItemComponentEventArgs.cs +++ b/src/components/Blazor/SelectItemComponentEventArgs.cs @@ -1,94 +1,91 @@ - -using System; using Microsoft.AspNetCore.Components; -using Microsoft.AspNetCore.Components.Rendering; -using System.Threading.Tasks; -using System.Collections.Generic; -using System.Linq; namespace IgniteUI.Blazor.Controls { - public partial class IgbSelectItemComponentEventArgs: BaseRendererElement { - public override string Type { get { return "WebSelectItemComponentEventArgs"; } } - - - private static bool _marshalByValue = true; - - public IgbSelectItemComponentEventArgs(): base() { - OnCreatedIgbSelectItemComponentEventArgs(); - - - } - - partial void OnCreatedIgbSelectItemComponentEventArgs(); - - private IgbSelectItem _detail; - - partial void OnDetailChanging(ref IgbSelectItem newValue); - [Parameter] - public IgbSelectItem Detail - { - get { return this._detail; } - set { - if (this._detail != value || !IsPropDirty("Detail")) { - MarkPropDirty("Detail"); - } - this._detail = value; - - } - } - - partial void FindByNameSelectItemComponentEventArgs(string name, ref object item); - public override object FindByName(string name) - { - - var baseResult = base.FindByName(name); - if (baseResult != null) - { - return baseResult; - } - - object item = null; - FindByNameSelectItemComponentEventArgs(name, ref item); - if (item != null) - { - return item; - } - - return null; - } - - partial void SerializeCoreIgbSelectItemComponentEventArgs(RendererSerializer ser); - - internal override void SerializeCore(RendererSerializer ser) - { - base.SerializeCore(ser); - - SerializeCoreIgbSelectItemComponentEventArgs(ser); - - if (IsPropDirty("Detail")) { ser.AddSerializableProp("detail", this._detail); } - - } - - - protected internal override void ToEventJson(BaseRendererControl control, Dictionary args) - { - base.ToEventJson(control, args); - - if (IsPropDirty("Detail")) { args["detail"] = ObjectToParam(this._detail); } - - - } - - - protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) { - base.FromEventJson(control, args); - this.SuppressParentNotify = true; - - if (args.ContainsKey("detail")) { this.Detail = (IgbSelectItem)ConvertReturnValue(args["detail"], "SelectItem", true); } - - this.SuppressParentNotify = false; - } - -} + public partial class IgbSelectItemComponentEventArgs : BaseRendererElement + { + public override string Type { get { return "WebSelectItemComponentEventArgs"; } } + + private static bool _marshalByValue = true; + + public IgbSelectItemComponentEventArgs() : base() + { + OnCreatedIgbSelectItemComponentEventArgs(); + + } + + partial void OnCreatedIgbSelectItemComponentEventArgs(); + + private IgbSelectItem _detail; + + partial void OnDetailChanging(ref IgbSelectItem newValue); + [Parameter] + public IgbSelectItem Detail + { + get { return this._detail; } + set + { + if (this._detail != value || !IsPropDirty("Detail")) + { + MarkPropDirty("Detail"); + } + this._detail = value; + + } + } + + partial void FindByNameSelectItemComponentEventArgs(string name, ref object item); + public override object FindByName(string name) + { + + var baseResult = base.FindByName(name); + if (baseResult != null) + { + return baseResult; + } + + object item = null; + FindByNameSelectItemComponentEventArgs(name, ref item); + if (item != null) + { + return item; + } + + return null; + } + + partial void SerializeCoreIgbSelectItemComponentEventArgs(RendererSerializer ser); + + internal override void SerializeCore(RendererSerializer ser) + { + base.SerializeCore(ser); + + SerializeCoreIgbSelectItemComponentEventArgs(ser); + + if (IsPropDirty("Detail")) + { ser.AddSerializableProp("detail", this._detail); } + + } + + protected internal override void ToEventJson(BaseRendererControl control, Dictionary args) + { + base.ToEventJson(control, args); + + if (IsPropDirty("Detail")) + { args["detail"] = ObjectToParam(this._detail); } + + } + + protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) + { + base.FromEventJson(control, args); + this.SuppressParentNotify = true; + + if (args.ContainsKey("detail")) + { this.Detail = (IgbSelectItem)ConvertReturnValue(args["detail"], "SelectItem", true); } + + this.SuppressParentNotify = false; + } + + } } diff --git a/src/components/Blazor/SelectItemModule.cs b/src/components/Blazor/SelectItemModule.cs index 6472fdfb..c7d95d6f 100644 --- a/src/components/Blazor/SelectItemModule.cs +++ b/src/components/Blazor/SelectItemModule.cs @@ -1,23 +1,20 @@ -using System; -using System.Collections.Generic; -using System.Runtime.CompilerServices; -using System.Text; -using System.Collections.Generic; - namespace IgniteUI.Blazor.Controls { - public partial class IgbSelectItemModule { - public static void Register(IIgniteUIBlazor runtime) { + public partial class IgbSelectItemModule + { + public static void Register(IIgniteUIBlazor runtime) + { ModuleLoader.Load(runtime, "WebSelectItemModule"); - } - public static void MarkIsLoadRequested(IIgniteUIBlazor runtime) { + public static void MarkIsLoadRequested(IIgniteUIBlazor runtime) + { ModuleLoader.MarkIsLoadRequested(runtime, "WebSelectItemModule"); } - public static bool IsLoadRequested(IIgniteUIBlazor runtime) { + public static bool IsLoadRequested(IIgniteUIBlazor runtime) + { return ModuleLoader.IsLoadRequested(runtime, "WebSelectItemModule"); } } diff --git a/src/components/Blazor/SelectModule.cs b/src/components/Blazor/SelectModule.cs index c554c980..382a2e95 100644 --- a/src/components/Blazor/SelectModule.cs +++ b/src/components/Blazor/SelectModule.cs @@ -1,28 +1,26 @@ -using System; -using System.Collections.Generic; -using System.Runtime.CompilerServices; -using System.Text; -using System.Collections.Generic; - namespace IgniteUI.Blazor.Controls { - public partial class IgbSelectModule { - public static void Register(IIgniteUIBlazor runtime) { + public partial class IgbSelectModule + { + public static void Register(IIgniteUIBlazor runtime) + { ModuleLoader.Load(runtime, "WebSelectModule"); IgbIconModule.MarkIsLoadRequested(runtime); -IgbInputModule.MarkIsLoadRequested(runtime); -IgbSelectGroupModule.MarkIsLoadRequested(runtime); -IgbSelectHeaderModule.MarkIsLoadRequested(runtime); -IgbSelectItemModule.MarkIsLoadRequested(runtime); + IgbInputModule.MarkIsLoadRequested(runtime); + IgbSelectGroupModule.MarkIsLoadRequested(runtime); + IgbSelectHeaderModule.MarkIsLoadRequested(runtime); + IgbSelectItemModule.MarkIsLoadRequested(runtime); } - public static void MarkIsLoadRequested(IIgniteUIBlazor runtime) { + public static void MarkIsLoadRequested(IIgniteUIBlazor runtime) + { ModuleLoader.MarkIsLoadRequested(runtime, "WebSelectModule"); } - public static bool IsLoadRequested(IIgniteUIBlazor runtime) { + public static bool IsLoadRequested(IIgniteUIBlazor runtime) + { return ModuleLoader.IsLoadRequested(runtime, "WebSelectModule"); } } diff --git a/src/components/Blazor/Slider.cs b/src/components/Blazor/Slider.cs index 8d456bad..d40ee091 100644 --- a/src/components/Blazor/Slider.cs +++ b/src/components/Blazor/Slider.cs @@ -1,386 +1,401 @@ - -using System; using Microsoft.AspNetCore.Components; -using Microsoft.AspNetCore.Components.Rendering; -using System.Threading.Tasks; -using System.Collections.Generic; -using System.Linq; namespace IgniteUI.Blazor.Controls { - /// -/// A slider component used to select numeric value within a range. -/// -public partial class IgbSlider: IgbSliderBase { - public override string Type { get { return "WebSlider"; } } - - protected override void EnsureModulesLoaded() - { - if (!IgbSliderModule.IsLoadRequested(IgBlazor)) - { - IgbSliderModule.Register(IgBlazor); - } - } + /// + /// A slider component used to select numeric value within a range. + /// + public partial class IgbSlider : IgbSliderBase + { + public override string Type { get { return "WebSlider"; } } + + protected override void EnsureModulesLoaded() + { + if (!IgbSliderModule.IsLoadRequested(IgBlazor)) + { + IgbSliderModule.Register(IgBlazor); + } + } + + protected override string ResolveDisplay() + { + return "inline-block"; + } + + protected override bool SupportsVisualChildren + { + get + { + return true; + } + } + + protected override bool UseDirectRender + { + get + { + return true; + } + } + + protected override string DirectRenderElementName + { + get + { + return "igc-slider"; + } + } + + public IgbSlider() : base() + { + OnCreatedIgbSlider(); + + } + + partial void OnCreatedIgbSlider(); + + private double _value = 0; + + partial void OnValueChanging(ref double newValue); + /// + /// The current value of the component. + /// + [Parameter] + public double Value + { + get { return this._value; } + set + { + if (this._value != value || !IsPropDirty("Value")) + { + MarkPropDirty("Value"); + } + this._value = value; + + } + } + public async Task GetCurrentValueAsync() + { + var iv = await InvokeMethod("p:Value", new object[] { }, new string[] { }); + return ReturnToDouble(iv); + } + public double GetCurrentValue() + { + var iv = InvokeMethodSync("p:Value", new object[] { }, new string[] { }); + return ReturnToDouble(iv); + } + private bool _invalid = false; + + partial void OnInvalidChanging(ref bool newValue); + /// + /// Control the validity of the control. + /// + [Parameter] + public bool Invalid + { + get { return this._invalid; } + set + { + if (this._invalid != value || !IsPropDirty("Invalid")) + { + MarkPropDirty("Invalid"); + } + this._invalid = value; + + } + } + + partial void FindByNameSlider(string name, ref object item); + public override object FindByName(string name) + { + + var baseResult = base.FindByName(name); + if (baseResult != null) + { + return baseResult; + } + + object item = null; + FindByNameSlider(name, ref item); + if (item != null) + { + return item; + } + + return null; + } + /// + /// Increments the value of the slider by `stepIncrement * step`, where `stepIncrement` defaults to 1. + /// stepIncrement Optional step increment. If no parameter is passed, it defaults to 1. + /// + /// Optional step increment. If no parameter is passed, it defaults to 1. + public async Task StepUpAsync(double stepIncrement = 1) + { + await InvokeMethod("stepUp", new object[] { stepIncrement }, new string[] { "Number" }); + } + public void StepUp(double stepIncrement = 1) + { + InvokeMethodSync("stepUp", new object[] { stepIncrement }, new string[] { "Number" }); + } + /// + /// Decrements the value of the slider by `stepDecrement * step`, where `stepDecrement` defaults to 1. + /// stepDecrement Optional step decrement. If no parameter is passed, it defaults to 1. + /// + /// Optional step decrement. If no parameter is passed, it defaults to 1. + public async Task StepDownAsync(double stepDecrement = 1) + { + await InvokeMethod("stepDown", new object[] { stepDecrement }, new string[] { "Number" }); + } + public void StepDown(double stepDecrement = 1) + { + InvokeMethodSync("stepDown", new object[] { stepDecrement }, new string[] { "Number" }); + } + /// + /// Checks for validity of the control and shows the browser message if it invalid. + /// + public async Task ReportValidityAsync() + { + await InvokeMethod("reportValidity", new object[] { }, new string[] { }); + } + public void ReportValidity() + { + InvokeMethodSync("reportValidity", new object[] { }, new string[] { }); + } + /// + /// Checks for validity of the control and emits the invalid event if it invalid. + /// + public async Task CheckValidityAsync() + { + await InvokeMethod("checkValidity", new object[] { }, new string[] { }); + } + public void CheckValidity() + { + InvokeMethodSync("checkValidity", new object[] { }, new string[] { }); + } + /// + /// Sets a custom validation message for the control. + /// As long as `message` is not empty, the control is considered invalid. + /// + public async Task SetCustomValidityAsync(String message) + { + await InvokeMethod("setCustomValidity", new object[] { StringToString(message) }, new string[] { "String" }); + } + public void SetCustomValidity(String message) + { + InvokeMethodSync("setCustomValidity", new object[] { StringToString(message) }, new string[] { "String" }); + } + + private EventCallback? _valueChanged = null; + [Parameter] + public EventCallback ValueChanged + { + get + { + return this._valueChanged != null ? this._valueChanged.Value : EventCallback.Empty; + } + set + { + if (!value.Equals(EventCallback.Empty)) + { + if (!CompareEventCallbacks(value, _valueChanged, ref eventCallbacksCache)) + { + this.EnsureChangeHandled(); + + _valueChanged = value; + } + } + else + { + _valueChanged = null; + } + } + } - protected override string ResolveDisplay() + private string _inputRef = null; + private string _inputScript = null; + [Parameter] + public string InputScript + { + + set + { + if (value != this._inputScript) + { + this._inputScript = value; + this.OnRefChanged("Input", null, value, true, false, (string refName, object oldValue, object newValue) => + { + this._inputRef = refName; + this.MarkPropDirty("InputRef"); + }); + } + } + get + { + return this._inputScript; + } + } + + partial void OnHandlingInput(IgbNumberEventArgs args); + private EventCallback? _input = null; + [Parameter] + public EventCallback Input + { + get + { + return this._input != null ? this._input.Value : EventCallback.Empty; + } + set + { + if (!value.Equals(EventCallback.Empty)) + { + if (!CompareEventCallbacks(value, _input, ref eventCallbacksCache)) + { + _input = value; + this.SetHandler(this.Name, "Input", value, (args) => { - return "inline-block"; - } + OnHandlingInput(args); - protected override bool SupportsVisualChildren + }); + this.OnRefChanged("Input", null, "event:::Input", true, false, (refName, oldValue, newValue) => { - get - { - return true; - } - } + this._inputRef = refName; + this.MarkPropDirty("InputRef"); + }); + } + } + else + { + _input = null; + this.SetHandler(this.Name, "Input", null); + this.OnRefChanged("Input", null, null, true, false, (refName, oldValue, newValue) => + { + this._inputRef = null; + this.MarkPropDirty("InputRef"); + }); + } + } + } + + private string _changeRef = null; + private string _changeScript = null; + [Parameter] + public string ChangeScript + { + + set + { + if (value != this._changeScript) + { + this._changeScript = value; + this.OnRefChanged("Change", null, value, true, false, (string refName, object oldValue, object newValue) => + { + this._changeRef = refName; + this.MarkPropDirty("ChangeRef"); + }); + } + } + get + { + return this._changeScript; + } + } - protected override bool UseDirectRender + partial void OnHandlingChange(IgbNumberEventArgs args); + private EventCallback? _change = null; + [Parameter] + public EventCallback Change + { + get + { + return this._change != null ? this._change.Value : EventCallback.Empty; + } + set + { + if (!value.Equals(EventCallback.Empty)) + { + if (!CompareEventCallbacks(value, _change, ref eventCallbacksCache)) + { + _change = value; + this.SetHandler(this.Name, "Change", value, (args) => { - get + OnHandlingChange(args); + + var newValueValue = default(double); + + { + newValueValue = (double)(args.Detail); + ; + OnEventUpdatingValue(this._value, ref newValueValue); + if (UseDirectRender) { - return true; + //TODO: maybe we should be doing this for everything. Need to make sure we don't infinity bounce though. + this.Value = newValueValue; } - } + else + { + this._value = newValueValue; + } + OnPropertyPropagatedOut(Name, "Value"); + } - protected override string DirectRenderElementName - { - get + if (!EventCallback.Empty.Equals(ValueChanged)) + { + var task = ValueChanged.InvokeAsync(newValueValue); + if (task.Exception != null) { - return "igc-slider"; + throw task.Exception; } - } - - public IgbSlider(): base() { - OnCreatedIgbSlider(); - - - } - - partial void OnCreatedIgbSlider(); - - private double _value = 0; - - partial void OnValueChanging(ref double newValue); - /// - /// The current value of the component. - /// - [Parameter] - public double Value - { - get { return this._value; } - set { - if (this._value != value || !IsPropDirty("Value")) { - MarkPropDirty("Value"); - } - this._value = value; - - } - } - public async Task GetCurrentValueAsync() - { - var iv = await InvokeMethod("p:Value", new object[] { }, new string[] { }); - return ReturnToDouble(iv); - } - public double GetCurrentValue() - { - var iv = InvokeMethodSync("p:Value", new object[] { }, new string[] { }); - return ReturnToDouble(iv); - } - private bool _invalid = false; - - partial void OnInvalidChanging(ref bool newValue); - /// - /// Control the validity of the control. - /// - [Parameter] - public bool Invalid - { - get { return this._invalid; } - set { - if (this._invalid != value || !IsPropDirty("Invalid")) { - MarkPropDirty("Invalid"); - } - this._invalid = value; - - } - } - - partial void FindByNameSlider(string name, ref object item); - public override object FindByName(string name) - { - - var baseResult = base.FindByName(name); - if (baseResult != null) - { - return baseResult; - } - - object item = null; - FindByNameSlider(name, ref item); - if (item != null) - { - return item; - } - - return null; - } - /// - /// Increments the value of the slider by `stepIncrement * step`, where `stepIncrement` defaults to 1. - /// stepIncrement Optional step increment. If no parameter is passed, it defaults to 1. - /// - /// Optional step increment. If no parameter is passed, it defaults to 1. - public async Task StepUpAsync(double stepIncrement = 1) - { - await InvokeMethod("stepUp", new object[] { stepIncrement }, new string[] { "Number" }); - } - public void StepUp(double stepIncrement = 1) - { - InvokeMethodSync("stepUp", new object[] { stepIncrement }, new string[] { "Number" }); - } - /// - /// Decrements the value of the slider by `stepDecrement * step`, where `stepDecrement` defaults to 1. - /// stepDecrement Optional step decrement. If no parameter is passed, it defaults to 1. - /// - /// Optional step decrement. If no parameter is passed, it defaults to 1. - public async Task StepDownAsync(double stepDecrement = 1) - { - await InvokeMethod("stepDown", new object[] { stepDecrement }, new string[] { "Number" }); - } - public void StepDown(double stepDecrement = 1) - { - InvokeMethodSync("stepDown", new object[] { stepDecrement }, new string[] { "Number" }); - } - /// - /// Checks for validity of the control and shows the browser message if it invalid. - /// - public async Task ReportValidityAsync() - { - await InvokeMethod("reportValidity", new object[] { }, new string[] { }); - } - public void ReportValidity() - { - InvokeMethodSync("reportValidity", new object[] { }, new string[] { }); - } - /// - /// Checks for validity of the control and emits the invalid event if it invalid. - /// - public async Task CheckValidityAsync() - { - await InvokeMethod("checkValidity", new object[] { }, new string[] { }); - } - public void CheckValidity() - { - InvokeMethodSync("checkValidity", new object[] { }, new string[] { }); - } - /// - /// Sets a custom validation message for the control. - /// As long as `message` is not empty, the control is considered invalid. - /// - public async Task SetCustomValidityAsync(String message) - { - await InvokeMethod("setCustomValidity", new object[] { StringToString(message) }, new string[] { "String" }); - } - public void SetCustomValidity(String message) - { - InvokeMethodSync("setCustomValidity", new object[] { StringToString(message) }, new string[] { "String" }); - } - - private EventCallback? _valueChanged = null; - [Parameter] - public EventCallback ValueChanged - { - get - { - return this._valueChanged != null ? this._valueChanged.Value : EventCallback.Empty; - } - set - { - if (!value.Equals(EventCallback.Empty)) - { - if (!CompareEventCallbacks(value, _valueChanged, ref eventCallbacksCache)) - { - this.EnsureChangeHandled(); - - _valueChanged = value; - } - } - else - { - _valueChanged = null; - } - } - } - - private string _inputRef = null; - private string _inputScript = null; - [Parameter] - public string InputScript { - - set - { - if (value != this._inputScript) - { - this._inputScript = value; - this.OnRefChanged("Input", null, value, true, false, (string refName, object oldValue, object newValue) => { - this._inputRef = refName; - this.MarkPropDirty("InputRef"); - }); - } - } - get - { - return this._inputScript; - } - } - - partial void OnHandlingInput(IgbNumberEventArgs args); - private EventCallback? _input = null; - [Parameter] - public EventCallback Input - { - get - { - return this._input != null ? this._input.Value : EventCallback.Empty; - } - set - { - if (!value.Equals(EventCallback.Empty)) - { - if (!CompareEventCallbacks(value, _input, ref eventCallbacksCache)) - { - _input = value; - this.SetHandler(this.Name, "Input", value, (args) => { - OnHandlingInput(args); - - }); - this.OnRefChanged("Input", null, "event:::Input", true, false, (refName, oldValue, newValue) => { - this._inputRef = refName; - this.MarkPropDirty("InputRef"); - }); - } - } - else - { - _input = null; - this.SetHandler(this.Name, "Input", null); - this.OnRefChanged("Input", null, null, true, false, (refName, oldValue, newValue) => { - this._inputRef = null; - this.MarkPropDirty("InputRef"); - }); - } - } - } - - private string _changeRef = null; - private string _changeScript = null; - [Parameter] - public string ChangeScript { - - set - { - if (value != this._changeScript) - { - this._changeScript = value; - this.OnRefChanged("Change", null, value, true, false, (string refName, object oldValue, object newValue) => { - this._changeRef = refName; - this.MarkPropDirty("ChangeRef"); - }); - } - } - get - { - return this._changeScript; - } - } - - partial void OnHandlingChange(IgbNumberEventArgs args); - private EventCallback? _change = null; - [Parameter] - public EventCallback Change - { - get - { - return this._change != null ? this._change.Value : EventCallback.Empty; - } - set - { - if (!value.Equals(EventCallback.Empty)) - { - if (!CompareEventCallbacks(value, _change, ref eventCallbacksCache)) - { - _change = value; - this.SetHandler(this.Name, "Change", value, (args) => { - OnHandlingChange(args); - - var newValueValue = default(double); - - - { - newValueValue = (double)(args.Detail); - ; - OnEventUpdatingValue(this._value, ref newValueValue); - if (UseDirectRender) { - //TODO: maybe we should be doing this for everything. Need to make sure we don't infinity bounce though. - this.Value = newValueValue; - } else { - this._value = newValueValue; - } - OnPropertyPropagatedOut(Name, "Value"); - } - - if (!EventCallback.Empty.Equals(ValueChanged)) - { - var task = ValueChanged.InvokeAsync(newValueValue); - if (task.Exception != null) - { - throw task.Exception; - } - } - - }); - this.OnRefChanged("Change", null, "event:::Change", true, false, (refName, oldValue, newValue) => { - this._changeRef = refName; - this.MarkPropDirty("ChangeRef"); - }); - } - } - else - { - _change = null; - this.SetHandler(this.Name, "Change", null); - this.OnRefChanged("Change", null, null, true, false, (refName, oldValue, newValue) => { - this._changeRef = null; - this.MarkPropDirty("ChangeRef"); - }); - } - } - } - internal void EnsureChangeHandled() - { - if (EventCallback.Empty.Equals(this.Change)) - { - this.Change = new EventCallback(null, (Action)((e) => { })); this._change = null; - } - } - - - partial void OnEventUpdatingValue(double oldValue, ref double newValue); - - partial void SerializeCoreIgbSlider(RendererSerializer ser); - - internal override void SerializeCore(RendererSerializer ser) - { - base.SerializeCore(ser); - - SerializeCoreIgbSlider(ser); - - if (IsPropDirty("Value")) { ser.AddNumberProp("value", this._value); } - if (IsPropDirty("Invalid")) { ser.AddBooleanProp("invalid", this._invalid); } - if (IsPropDirty("InputRef")) { ser.AddStringProp("inputRef", this._inputRef); } - if (IsPropDirty("ChangeRef")) { ser.AddStringProp("changeRef", this._changeRef); } - - } - -} + } + + }); + this.OnRefChanged("Change", null, "event:::Change", true, false, (refName, oldValue, newValue) => + { + this._changeRef = refName; + this.MarkPropDirty("ChangeRef"); + }); + } + } + else + { + _change = null; + this.SetHandler(this.Name, "Change", null); + this.OnRefChanged("Change", null, null, true, false, (refName, oldValue, newValue) => + { + this._changeRef = null; + this.MarkPropDirty("ChangeRef"); + }); + } + } + } + internal void EnsureChangeHandled() + { + if (EventCallback.Empty.Equals(this.Change)) + { + this.Change = new EventCallback(null, (Action)((e) => { })); + this._change = null; + } + } + + partial void OnEventUpdatingValue(double oldValue, ref double newValue); + + partial void SerializeCoreIgbSlider(RendererSerializer ser); + + internal override void SerializeCore(RendererSerializer ser) + { + base.SerializeCore(ser); + + SerializeCoreIgbSlider(ser); + + if (IsPropDirty("Value")) + { ser.AddNumberProp("value", this._value); } + if (IsPropDirty("Invalid")) + { ser.AddBooleanProp("invalid", this._invalid); } + if (IsPropDirty("InputRef")) + { ser.AddStringProp("inputRef", this._inputRef); } + if (IsPropDirty("ChangeRef")) + { ser.AddStringProp("changeRef", this._changeRef); } + + } + + } } diff --git a/src/components/Blazor/SliderBase.cs b/src/components/Blazor/SliderBase.cs index 7469d4dc..4803ce93 100644 --- a/src/components/Blazor/SliderBase.cs +++ b/src/components/Blazor/SliderBase.cs @@ -1,440 +1,486 @@ - -using System; using Microsoft.AspNetCore.Components; -using Microsoft.AspNetCore.Components.Rendering; -using System.Threading.Tasks; -using System.Collections.Generic; -using System.Linq; namespace IgniteUI.Blazor.Controls { - public partial class IgbSliderBase: BaseRendererControl { - public override string Type { get { return "WebSliderBase"; } } - - protected override void EnsureModulesLoaded() - { - if (!IgbSliderBaseModule.IsLoadRequested(IgBlazor)) - { - IgbSliderBaseModule.Register(IgBlazor); - } - } - - protected override string ResolveDisplay() - { - return "inline-block"; - } - - protected override bool SupportsVisualChildren - { - get - { - return true; - } - } - - protected override bool UseDirectRender - { - get - { - return true; - } - } - - protected override string DirectRenderElementName - { - get - { - return "igc-slider-base"; - } - } - - protected override ControlEventBehavior DefaultEventBehavior - { - get { return ControlEventBehavior.Immediate; } - } - - public IgbSliderBase(): base() { - OnCreatedIgbSliderBase(); - - - } - - partial void OnCreatedIgbSliderBase(); - - private double _min = 0; - - partial void OnMinChanging(ref double newValue); - /// - /// The minimum value of the slider scale. Defaults to 0. - /// If `min` is greater than `max` the call is a no-op. - /// If `labels` are provided (projected), then `min` is always set to 0. - /// If `lowerBound` ends up being less than than the current `min` value, - /// it is automatically assigned the new `min` value. - /// - [Parameter] - public double Min - { - get { return this._min; } - set { - if (this._min != value || !IsPropDirty("Min")) { - MarkPropDirty("Min"); - } - this._min = value; - - } - } - private double _max = 0; - - partial void OnMaxChanging(ref double newValue); - /// - /// The maximum value of the slider scale. Defaults to 100. - /// If `max` is less than `min` the call is a no-op. - /// If `labels` are provided (projected), then `max` is always set to - /// the number of labels. - /// If `upperBound` ends up being greater than than the current `max` value, - /// it is automatically assigned the new `max` value. - /// - [Parameter] - public double Max - { - get { return this._max; } - set { - if (this._max != value || !IsPropDirty("Max")) { - MarkPropDirty("Max"); - } - this._max = value; - - } - } - private double _lowerBound = 0; - - partial void OnLowerBoundChanging(ref double newValue); - /// - /// The lower bound of the slider value. If not set, the `min` value is applied. - /// - [Parameter] - public double LowerBound - { - get { return this._lowerBound; } - set { - if (this._lowerBound != value || !IsPropDirty("LowerBound")) { - MarkPropDirty("LowerBound"); - } - this._lowerBound = value; - - } - } - private double _upperBound = 0; - - partial void OnUpperBoundChanging(ref double newValue); - /// - /// The upper bound of the slider value. If not set, the `max` value is applied. - /// - [Parameter] - public double UpperBound - { - get { return this._upperBound; } - set { - if (this._upperBound != value || !IsPropDirty("UpperBound")) { - MarkPropDirty("UpperBound"); - } - this._upperBound = value; - - } - } - private bool _disabled = false; - - partial void OnDisabledChanging(ref bool newValue); - /// - /// Disables the UI interactions of the slider. - /// - [Parameter] - public bool Disabled - { - get { return this._disabled; } - set { - if (this._disabled != value || !IsPropDirty("Disabled")) { - MarkPropDirty("Disabled"); - } - this._disabled = value; - - } - } - private bool _discreteTrack = false; - - partial void OnDiscreteTrackChanging(ref bool newValue); - /// - /// Marks the slider track as discrete so it displays the steps. - /// If the `step` is 0, the slider will remain continuos even if `discreteTrack` is `true`. - /// - [Parameter] - public bool DiscreteTrack - { - get { return this._discreteTrack; } - set { - if (this._discreteTrack != value || !IsPropDirty("DiscreteTrack")) { - MarkPropDirty("DiscreteTrack"); - } - this._discreteTrack = value; - - } - } - private bool _hideTooltip = false; - - partial void OnHideTooltipChanging(ref bool newValue); - /// - /// Hides the thumb tooltip. - /// - [Parameter] - public bool HideTooltip - { - get { return this._hideTooltip; } - set { - if (this._hideTooltip != value || !IsPropDirty("HideTooltip")) { - MarkPropDirty("HideTooltip"); - } - this._hideTooltip = value; - - } - } - private double _step = 0; - - partial void OnStepChanging(ref double newValue); - /// - /// Specifies the granularity that the value must adhere to. - /// If set to 0 no stepping is implied and any value in the range is allowed. - /// If `labels` are provided (projected) then the step is always assumed to be 1 since it is a discrete slider. - /// - [Parameter] - public double Step - { - get { return this._step; } - set { - if (this._step != value || !IsPropDirty("Step")) { - MarkPropDirty("Step"); - } - this._step = value; - - } - } - private double _primaryTicks = 0; - - partial void OnPrimaryTicksChanging(ref double newValue); - /// - /// The number of primary ticks. It defaults to 0 which means no primary ticks are displayed. - /// - [Parameter] - public double PrimaryTicks - { - get { return this._primaryTicks; } - set { - if (this._primaryTicks != value || !IsPropDirty("PrimaryTicks")) { - MarkPropDirty("PrimaryTicks"); - } - this._primaryTicks = value; - - } - } - private double _secondaryTicks = 0; - - partial void OnSecondaryTicksChanging(ref double newValue); - /// - /// The number of secondary ticks. It defaults to 0 which means no secondary ticks are displayed. - /// - [Parameter] - public double SecondaryTicks - { - get { return this._secondaryTicks; } - set { - if (this._secondaryTicks != value || !IsPropDirty("SecondaryTicks")) { - MarkPropDirty("SecondaryTicks"); - } - this._secondaryTicks = value; - - } - } - private SliderTickOrientation _tickOrientation = SliderTickOrientation.End; - - partial void OnTickOrientationChanging(ref SliderTickOrientation newValue); - /// - /// Changes the orientation of the ticks. - /// - [Parameter] - public SliderTickOrientation TickOrientation - { - get { return this._tickOrientation; } - set { - if (this._tickOrientation != value || !IsPropDirty("TickOrientation")) { - MarkPropDirty("TickOrientation"); - } - this._tickOrientation = value; - - } - } - private bool _hidePrimaryLabels = false; - - partial void OnHidePrimaryLabelsChanging(ref bool newValue); - /// - /// Hides the primary tick labels. - /// - [Parameter] - public bool HidePrimaryLabels - { - get { return this._hidePrimaryLabels; } - set { - if (this._hidePrimaryLabels != value || !IsPropDirty("HidePrimaryLabels")) { - MarkPropDirty("HidePrimaryLabels"); - } - this._hidePrimaryLabels = value; - - } - } - private bool _hideSecondaryLabels = false; - - partial void OnHideSecondaryLabelsChanging(ref bool newValue); - /// - /// Hides the secondary tick labels. - /// - [Parameter] - public bool HideSecondaryLabels - { - get { return this._hideSecondaryLabels; } - set { - if (this._hideSecondaryLabels != value || !IsPropDirty("HideSecondaryLabels")) { - MarkPropDirty("HideSecondaryLabels"); - } - this._hideSecondaryLabels = value; - - } - } - private string _locale; - - partial void OnLocaleChanging(ref string newValue); - /// - /// The locale used to format the thumb and tick label values in the slider. - /// - [Parameter] - public string Locale - { - get { return this._locale; } - set { - if (this._locale != value || !IsPropDirty("Locale")) { - MarkPropDirty("Locale"); - } - this._locale = value; - - } - } - private string _valueFormat; - - partial void OnValueFormatChanging(ref string newValue); - /// - /// String format used for the thumb and tick label values in the slider. - /// - [Parameter] - public string ValueFormat - { - get { return this._valueFormat; } - set { - if (this._valueFormat != value || !IsPropDirty("ValueFormat")) { - MarkPropDirty("ValueFormat"); - } - this._valueFormat = value; - - } - } - private SliderTickLabelRotation _tickLabelRotation = SliderTickLabelRotation.Zero; - - partial void OnTickLabelRotationChanging(ref SliderTickLabelRotation newValue); - /// - /// The degrees for the rotation of the tick labels. Defaults to 0. - /// - [Parameter] - public SliderTickLabelRotation TickLabelRotation - { - get { return this._tickLabelRotation; } - set { - if (this._tickLabelRotation != value || !IsPropDirty("TickLabelRotation")) { - MarkPropDirty("TickLabelRotation"); - } - this._tickLabelRotation = value; - - } - } - private IgbNumberFormatSpecifier _valueFormatOptions; - - partial void OnValueFormatOptionsChanging(ref IgbNumberFormatSpecifier newValue); - /// - /// Number format options used for the thumb and tick label values in the slider. - /// - [Parameter] - public IgbNumberFormatSpecifier ValueFormatOptions - { - get { return this._valueFormatOptions; } - set { - if (this._valueFormatOptions != value || !IsPropDirty("ValueFormatOptions")) { - MarkPropDirty("ValueFormatOptions"); - } - this._valueFormatOptions = value; - - } - } - - partial void FindByNameSliderBase(string name, ref object item); - public override object FindByName(string name) - { - - var baseResult = base.FindByName(name); - if (baseResult != null) - { - return baseResult; - } - - object item = null; - FindByNameSliderBase(name, ref item); - if (item != null) - { - return item; - } - - return null; - } - public async Task SetNativeElementAsync(Object element) - { - await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); - } - public void SetNativeElement(Object element) - { - InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); - } - - partial void SerializeCoreIgbSliderBase(RendererSerializer ser); - - internal override void SerializeCore(RendererSerializer ser) - { - base.SerializeCore(ser); - - SerializeCoreIgbSliderBase(ser); - - if (IsPropDirty("Min")) { ser.AddNumberProp("min", this._min); } - if (IsPropDirty("Max")) { ser.AddNumberProp("max", this._max); } - if (IsPropDirty("LowerBound")) { ser.AddNumberProp("lowerBound", this._lowerBound); } - if (IsPropDirty("UpperBound")) { ser.AddNumberProp("upperBound", this._upperBound); } - if (IsPropDirty("Disabled")) { ser.AddBooleanProp("disabled", this._disabled); } - if (IsPropDirty("DiscreteTrack")) { ser.AddBooleanProp("discreteTrack", this._discreteTrack); } - if (IsPropDirty("HideTooltip")) { ser.AddBooleanProp("hideTooltip", this._hideTooltip); } - if (IsPropDirty("Step")) { ser.AddNumberProp("step", this._step); } - if (IsPropDirty("PrimaryTicks")) { ser.AddNumberProp("primaryTicks", this._primaryTicks); } - if (IsPropDirty("SecondaryTicks")) { ser.AddNumberProp("secondaryTicks", this._secondaryTicks); } - if (IsPropDirty("TickOrientation")) { ser.AddEnumProp("tickOrientation", this._tickOrientation); } - if (IsPropDirty("HidePrimaryLabels")) { ser.AddBooleanProp("hidePrimaryLabels", this._hidePrimaryLabels); } - if (IsPropDirty("HideSecondaryLabels")) { ser.AddBooleanProp("hideSecondaryLabels", this._hideSecondaryLabels); } - if (IsPropDirty("Locale")) { ser.AddStringProp("locale", this._locale); } - if (IsPropDirty("ValueFormat")) { ser.AddStringProp("valueFormat", this._valueFormat); } - if (IsPropDirty("TickLabelRotation")) { ser.AddEnumProp("tickLabelRotation", this._tickLabelRotation); } - if (IsPropDirty("ValueFormatOptions")) { ser.AddSerializableProp("valueFormatOptions", (JsonSerializable)this._valueFormatOptions); } - - } - -} + public partial class IgbSliderBase : BaseRendererControl + { + public override string Type { get { return "WebSliderBase"; } } + + protected override void EnsureModulesLoaded() + { + if (!IgbSliderBaseModule.IsLoadRequested(IgBlazor)) + { + IgbSliderBaseModule.Register(IgBlazor); + } + } + + protected override string ResolveDisplay() + { + return "inline-block"; + } + + protected override bool SupportsVisualChildren + { + get + { + return true; + } + } + + protected override bool UseDirectRender + { + get + { + return true; + } + } + + protected override string DirectRenderElementName + { + get + { + return "igc-slider-base"; + } + } + + protected override ControlEventBehavior DefaultEventBehavior + { + get { return ControlEventBehavior.Immediate; } + } + + public IgbSliderBase() : base() + { + OnCreatedIgbSliderBase(); + + } + + partial void OnCreatedIgbSliderBase(); + + private double _min = 0; + + partial void OnMinChanging(ref double newValue); + /// + /// The minimum value of the slider scale. Defaults to 0. + /// If `min` is greater than `max` the call is a no-op. + /// If `labels` are provided (projected), then `min` is always set to 0. + /// If `lowerBound` ends up being less than than the current `min` value, + /// it is automatically assigned the new `min` value. + /// + [Parameter] + public double Min + { + get { return this._min; } + set + { + if (this._min != value || !IsPropDirty("Min")) + { + MarkPropDirty("Min"); + } + this._min = value; + + } + } + private double _max = 0; + + partial void OnMaxChanging(ref double newValue); + /// + /// The maximum value of the slider scale. Defaults to 100. + /// If `max` is less than `min` the call is a no-op. + /// If `labels` are provided (projected), then `max` is always set to + /// the number of labels. + /// If `upperBound` ends up being greater than than the current `max` value, + /// it is automatically assigned the new `max` value. + /// + [Parameter] + public double Max + { + get { return this._max; } + set + { + if (this._max != value || !IsPropDirty("Max")) + { + MarkPropDirty("Max"); + } + this._max = value; + + } + } + private double _lowerBound = 0; + + partial void OnLowerBoundChanging(ref double newValue); + /// + /// The lower bound of the slider value. If not set, the `min` value is applied. + /// + [Parameter] + public double LowerBound + { + get { return this._lowerBound; } + set + { + if (this._lowerBound != value || !IsPropDirty("LowerBound")) + { + MarkPropDirty("LowerBound"); + } + this._lowerBound = value; + + } + } + private double _upperBound = 0; + + partial void OnUpperBoundChanging(ref double newValue); + /// + /// The upper bound of the slider value. If not set, the `max` value is applied. + /// + [Parameter] + public double UpperBound + { + get { return this._upperBound; } + set + { + if (this._upperBound != value || !IsPropDirty("UpperBound")) + { + MarkPropDirty("UpperBound"); + } + this._upperBound = value; + + } + } + private bool _disabled = false; + + partial void OnDisabledChanging(ref bool newValue); + /// + /// Disables the UI interactions of the slider. + /// + [Parameter] + public bool Disabled + { + get { return this._disabled; } + set + { + if (this._disabled != value || !IsPropDirty("Disabled")) + { + MarkPropDirty("Disabled"); + } + this._disabled = value; + + } + } + private bool _discreteTrack = false; + + partial void OnDiscreteTrackChanging(ref bool newValue); + /// + /// Marks the slider track as discrete so it displays the steps. + /// If the `step` is 0, the slider will remain continuos even if `discreteTrack` is `true`. + /// + [Parameter] + public bool DiscreteTrack + { + get { return this._discreteTrack; } + set + { + if (this._discreteTrack != value || !IsPropDirty("DiscreteTrack")) + { + MarkPropDirty("DiscreteTrack"); + } + this._discreteTrack = value; + + } + } + private bool _hideTooltip = false; + + partial void OnHideTooltipChanging(ref bool newValue); + /// + /// Hides the thumb tooltip. + /// + [Parameter] + public bool HideTooltip + { + get { return this._hideTooltip; } + set + { + if (this._hideTooltip != value || !IsPropDirty("HideTooltip")) + { + MarkPropDirty("HideTooltip"); + } + this._hideTooltip = value; + + } + } + private double _step = 0; + + partial void OnStepChanging(ref double newValue); + /// + /// Specifies the granularity that the value must adhere to. + /// If set to 0 no stepping is implied and any value in the range is allowed. + /// If `labels` are provided (projected) then the step is always assumed to be 1 since it is a discrete slider. + /// + [Parameter] + public double Step + { + get { return this._step; } + set + { + if (this._step != value || !IsPropDirty("Step")) + { + MarkPropDirty("Step"); + } + this._step = value; + + } + } + private double _primaryTicks = 0; + + partial void OnPrimaryTicksChanging(ref double newValue); + /// + /// The number of primary ticks. It defaults to 0 which means no primary ticks are displayed. + /// + [Parameter] + public double PrimaryTicks + { + get { return this._primaryTicks; } + set + { + if (this._primaryTicks != value || !IsPropDirty("PrimaryTicks")) + { + MarkPropDirty("PrimaryTicks"); + } + this._primaryTicks = value; + + } + } + private double _secondaryTicks = 0; + + partial void OnSecondaryTicksChanging(ref double newValue); + /// + /// The number of secondary ticks. It defaults to 0 which means no secondary ticks are displayed. + /// + [Parameter] + public double SecondaryTicks + { + get { return this._secondaryTicks; } + set + { + if (this._secondaryTicks != value || !IsPropDirty("SecondaryTicks")) + { + MarkPropDirty("SecondaryTicks"); + } + this._secondaryTicks = value; + + } + } + private SliderTickOrientation _tickOrientation = SliderTickOrientation.End; + + partial void OnTickOrientationChanging(ref SliderTickOrientation newValue); + /// + /// Changes the orientation of the ticks. + /// + [Parameter] + public SliderTickOrientation TickOrientation + { + get { return this._tickOrientation; } + set + { + if (this._tickOrientation != value || !IsPropDirty("TickOrientation")) + { + MarkPropDirty("TickOrientation"); + } + this._tickOrientation = value; + + } + } + private bool _hidePrimaryLabels = false; + + partial void OnHidePrimaryLabelsChanging(ref bool newValue); + /// + /// Hides the primary tick labels. + /// + [Parameter] + public bool HidePrimaryLabels + { + get { return this._hidePrimaryLabels; } + set + { + if (this._hidePrimaryLabels != value || !IsPropDirty("HidePrimaryLabels")) + { + MarkPropDirty("HidePrimaryLabels"); + } + this._hidePrimaryLabels = value; + + } + } + private bool _hideSecondaryLabels = false; + + partial void OnHideSecondaryLabelsChanging(ref bool newValue); + /// + /// Hides the secondary tick labels. + /// + [Parameter] + public bool HideSecondaryLabels + { + get { return this._hideSecondaryLabels; } + set + { + if (this._hideSecondaryLabels != value || !IsPropDirty("HideSecondaryLabels")) + { + MarkPropDirty("HideSecondaryLabels"); + } + this._hideSecondaryLabels = value; + + } + } + private string _locale; + + partial void OnLocaleChanging(ref string newValue); + /// + /// The locale used to format the thumb and tick label values in the slider. + /// + [Parameter] + public string Locale + { + get { return this._locale; } + set + { + if (this._locale != value || !IsPropDirty("Locale")) + { + MarkPropDirty("Locale"); + } + this._locale = value; + + } + } + private string _valueFormat; + + partial void OnValueFormatChanging(ref string newValue); + /// + /// String format used for the thumb and tick label values in the slider. + /// + [Parameter] + public string ValueFormat + { + get { return this._valueFormat; } + set + { + if (this._valueFormat != value || !IsPropDirty("ValueFormat")) + { + MarkPropDirty("ValueFormat"); + } + this._valueFormat = value; + + } + } + private SliderTickLabelRotation _tickLabelRotation = SliderTickLabelRotation.Zero; + + partial void OnTickLabelRotationChanging(ref SliderTickLabelRotation newValue); + /// + /// The degrees for the rotation of the tick labels. Defaults to 0. + /// + [Parameter] + public SliderTickLabelRotation TickLabelRotation + { + get { return this._tickLabelRotation; } + set + { + if (this._tickLabelRotation != value || !IsPropDirty("TickLabelRotation")) + { + MarkPropDirty("TickLabelRotation"); + } + this._tickLabelRotation = value; + + } + } + private IgbNumberFormatSpecifier _valueFormatOptions; + + partial void OnValueFormatOptionsChanging(ref IgbNumberFormatSpecifier newValue); + /// + /// Number format options used for the thumb and tick label values in the slider. + /// + [Parameter] + public IgbNumberFormatSpecifier ValueFormatOptions + { + get { return this._valueFormatOptions; } + set + { + if (this._valueFormatOptions != value || !IsPropDirty("ValueFormatOptions")) + { + MarkPropDirty("ValueFormatOptions"); + } + this._valueFormatOptions = value; + + } + } + + partial void FindByNameSliderBase(string name, ref object item); + public override object FindByName(string name) + { + + var baseResult = base.FindByName(name); + if (baseResult != null) + { + return baseResult; + } + + object item = null; + FindByNameSliderBase(name, ref item); + if (item != null) + { + return item; + } + + return null; + } + public async Task SetNativeElementAsync(Object element) + { + await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + } + public void SetNativeElement(Object element) + { + InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + } + + partial void SerializeCoreIgbSliderBase(RendererSerializer ser); + + internal override void SerializeCore(RendererSerializer ser) + { + base.SerializeCore(ser); + + SerializeCoreIgbSliderBase(ser); + + if (IsPropDirty("Min")) + { ser.AddNumberProp("min", this._min); } + if (IsPropDirty("Max")) + { ser.AddNumberProp("max", this._max); } + if (IsPropDirty("LowerBound")) + { ser.AddNumberProp("lowerBound", this._lowerBound); } + if (IsPropDirty("UpperBound")) + { ser.AddNumberProp("upperBound", this._upperBound); } + if (IsPropDirty("Disabled")) + { ser.AddBooleanProp("disabled", this._disabled); } + if (IsPropDirty("DiscreteTrack")) + { ser.AddBooleanProp("discreteTrack", this._discreteTrack); } + if (IsPropDirty("HideTooltip")) + { ser.AddBooleanProp("hideTooltip", this._hideTooltip); } + if (IsPropDirty("Step")) + { ser.AddNumberProp("step", this._step); } + if (IsPropDirty("PrimaryTicks")) + { ser.AddNumberProp("primaryTicks", this._primaryTicks); } + if (IsPropDirty("SecondaryTicks")) + { ser.AddNumberProp("secondaryTicks", this._secondaryTicks); } + if (IsPropDirty("TickOrientation")) + { ser.AddEnumProp("tickOrientation", this._tickOrientation); } + if (IsPropDirty("HidePrimaryLabels")) + { ser.AddBooleanProp("hidePrimaryLabels", this._hidePrimaryLabels); } + if (IsPropDirty("HideSecondaryLabels")) + { ser.AddBooleanProp("hideSecondaryLabels", this._hideSecondaryLabels); } + if (IsPropDirty("Locale")) + { ser.AddStringProp("locale", this._locale); } + if (IsPropDirty("ValueFormat")) + { ser.AddStringProp("valueFormat", this._valueFormat); } + if (IsPropDirty("TickLabelRotation")) + { ser.AddEnumProp("tickLabelRotation", this._tickLabelRotation); } + if (IsPropDirty("ValueFormatOptions")) + { ser.AddSerializableProp("valueFormatOptions", (JsonSerializable)this._valueFormatOptions); } + + } + + } } diff --git a/src/components/Blazor/SliderBaseModule.cs b/src/components/Blazor/SliderBaseModule.cs index bd14c04d..a37c3d9c 100644 --- a/src/components/Blazor/SliderBaseModule.cs +++ b/src/components/Blazor/SliderBaseModule.cs @@ -1,23 +1,20 @@ -using System; -using System.Collections.Generic; -using System.Runtime.CompilerServices; -using System.Text; -using System.Collections.Generic; - namespace IgniteUI.Blazor.Controls { - public partial class IgbSliderBaseModule { - public static void Register(IIgniteUIBlazor runtime) { + public partial class IgbSliderBaseModule + { + public static void Register(IIgniteUIBlazor runtime) + { ModuleLoader.Load(runtime, "WebSliderBaseModule"); - } - public static void MarkIsLoadRequested(IIgniteUIBlazor runtime) { + public static void MarkIsLoadRequested(IIgniteUIBlazor runtime) + { ModuleLoader.MarkIsLoadRequested(runtime, "WebSliderBaseModule"); } - public static bool IsLoadRequested(IIgniteUIBlazor runtime) { + public static bool IsLoadRequested(IIgniteUIBlazor runtime) + { return ModuleLoader.IsLoadRequested(runtime, "WebSliderBaseModule"); } } diff --git a/src/components/Blazor/SliderLabel.cs b/src/components/Blazor/SliderLabel.cs index bae8c566..3e8d06e4 100644 --- a/src/components/Blazor/SliderLabel.cs +++ b/src/components/Blazor/SliderLabel.cs @@ -1,109 +1,100 @@ - -using System; -using Microsoft.AspNetCore.Components; -using Microsoft.AspNetCore.Components.Rendering; -using System.Threading.Tasks; -using System.Collections.Generic; -using System.Linq; - namespace IgniteUI.Blazor.Controls { - /// -/// Allows formatting the values of the slider as string values. -/// The text content of the slider labels is used for thumb and tick labels. -/// -public partial class IgbSliderLabel: BaseRendererControl { - public override string Type { get { return "WebSliderLabel"; } } - - protected override void EnsureModulesLoaded() - { - if (!IgbSliderLabelModule.IsLoadRequested(IgBlazor)) - { - IgbSliderLabelModule.Register(IgBlazor); - } - } - - protected override string ResolveDisplay() - { - return "inline-block"; - } - - protected override bool SupportsVisualChildren - { - get - { - return true; - } - } - - protected override bool UseDirectRender - { - get - { - return true; - } - } - - protected override string DirectRenderElementName - { - get - { - return "igc-slider-label"; - } - } - - protected override ControlEventBehavior DefaultEventBehavior - { - get { return ControlEventBehavior.Immediate; } - } - - public IgbSliderLabel(): base() { - OnCreatedIgbSliderLabel(); - - - } - - partial void OnCreatedIgbSliderLabel(); - - - partial void FindByNameSliderLabel(string name, ref object item); - public override object FindByName(string name) - { - - var baseResult = base.FindByName(name); - if (baseResult != null) - { - return baseResult; - } - - object item = null; - FindByNameSliderLabel(name, ref item); - if (item != null) - { - return item; - } - - return null; - } - public async Task SetNativeElementAsync(Object element) - { - await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); - } - public void SetNativeElement(Object element) - { - InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); - } - - partial void SerializeCoreIgbSliderLabel(RendererSerializer ser); - - internal override void SerializeCore(RendererSerializer ser) - { - base.SerializeCore(ser); - - SerializeCoreIgbSliderLabel(ser); - - - } - -} + /// + /// Allows formatting the values of the slider as string values. + /// The text content of the slider labels is used for thumb and tick labels. + /// + public partial class IgbSliderLabel : BaseRendererControl + { + public override string Type { get { return "WebSliderLabel"; } } + + protected override void EnsureModulesLoaded() + { + if (!IgbSliderLabelModule.IsLoadRequested(IgBlazor)) + { + IgbSliderLabelModule.Register(IgBlazor); + } + } + + protected override string ResolveDisplay() + { + return "inline-block"; + } + + protected override bool SupportsVisualChildren + { + get + { + return true; + } + } + + protected override bool UseDirectRender + { + get + { + return true; + } + } + + protected override string DirectRenderElementName + { + get + { + return "igc-slider-label"; + } + } + + protected override ControlEventBehavior DefaultEventBehavior + { + get { return ControlEventBehavior.Immediate; } + } + + public IgbSliderLabel() : base() + { + OnCreatedIgbSliderLabel(); + + } + + partial void OnCreatedIgbSliderLabel(); + + partial void FindByNameSliderLabel(string name, ref object item); + public override object FindByName(string name) + { + + var baseResult = base.FindByName(name); + if (baseResult != null) + { + return baseResult; + } + + object item = null; + FindByNameSliderLabel(name, ref item); + if (item != null) + { + return item; + } + + return null; + } + public async Task SetNativeElementAsync(Object element) + { + await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + } + public void SetNativeElement(Object element) + { + InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + } + + partial void SerializeCoreIgbSliderLabel(RendererSerializer ser); + + internal override void SerializeCore(RendererSerializer ser) + { + base.SerializeCore(ser); + + SerializeCoreIgbSliderLabel(ser); + + } + + } } diff --git a/src/components/Blazor/SliderLabelModule.cs b/src/components/Blazor/SliderLabelModule.cs index 0768dea4..413c8748 100644 --- a/src/components/Blazor/SliderLabelModule.cs +++ b/src/components/Blazor/SliderLabelModule.cs @@ -1,23 +1,20 @@ -using System; -using System.Collections.Generic; -using System.Runtime.CompilerServices; -using System.Text; -using System.Collections.Generic; - namespace IgniteUI.Blazor.Controls { - public partial class IgbSliderLabelModule { - public static void Register(IIgniteUIBlazor runtime) { + public partial class IgbSliderLabelModule + { + public static void Register(IIgniteUIBlazor runtime) + { ModuleLoader.Load(runtime, "WebSliderLabelModule"); - } - public static void MarkIsLoadRequested(IIgniteUIBlazor runtime) { + public static void MarkIsLoadRequested(IIgniteUIBlazor runtime) + { ModuleLoader.MarkIsLoadRequested(runtime, "WebSliderLabelModule"); } - public static bool IsLoadRequested(IIgniteUIBlazor runtime) { + public static bool IsLoadRequested(IIgniteUIBlazor runtime) + { return ModuleLoader.IsLoadRequested(runtime, "WebSliderLabelModule"); } } diff --git a/src/components/Blazor/SliderModule.cs b/src/components/Blazor/SliderModule.cs index c62dbe31..514b5e45 100644 --- a/src/components/Blazor/SliderModule.cs +++ b/src/components/Blazor/SliderModule.cs @@ -1,24 +1,22 @@ -using System; -using System.Collections.Generic; -using System.Runtime.CompilerServices; -using System.Text; -using System.Collections.Generic; - namespace IgniteUI.Blazor.Controls { - public partial class IgbSliderModule { - public static void Register(IIgniteUIBlazor runtime) { + public partial class IgbSliderModule + { + public static void Register(IIgniteUIBlazor runtime) + { ModuleLoader.Load(runtime, "WebSliderModule"); IgbSliderBaseModule.MarkIsLoadRequested(runtime); } - public static void MarkIsLoadRequested(IIgniteUIBlazor runtime) { + public static void MarkIsLoadRequested(IIgniteUIBlazor runtime) + { ModuleLoader.MarkIsLoadRequested(runtime, "WebSliderModule"); } - public static bool IsLoadRequested(IIgniteUIBlazor runtime) { + public static bool IsLoadRequested(IIgniteUIBlazor runtime) + { return ModuleLoader.IsLoadRequested(runtime, "WebSliderModule"); } } diff --git a/src/components/Blazor/SliderTickLabelRotation.cs b/src/components/Blazor/SliderTickLabelRotation.cs index 41ab39bb..a5974c88 100644 --- a/src/components/Blazor/SliderTickLabelRotation.cs +++ b/src/components/Blazor/SliderTickLabelRotation.cs @@ -1,12 +1,13 @@ namespace IgniteUI.Blazor.Controls { -public enum SliderTickLabelRotation { - [WCEnumName("0")] - Zero, - [WCEnumName("90")] - Ninety, - [WCEnumName("-90")] - NegativeNinety + public enum SliderTickLabelRotation + { + [WCEnumName("0")] + Zero, + [WCEnumName("90")] + Ninety, + [WCEnumName("-90")] + NegativeNinety -} + } } diff --git a/src/components/Blazor/SliderTickOrientation.cs b/src/components/Blazor/SliderTickOrientation.cs index 1b6c9a5f..0f0ebbf6 100644 --- a/src/components/Blazor/SliderTickOrientation.cs +++ b/src/components/Blazor/SliderTickOrientation.cs @@ -1,9 +1,10 @@ namespace IgniteUI.Blazor.Controls { -public enum SliderTickOrientation { - End, - Mirror, - Start + public enum SliderTickOrientation + { + End, + Mirror, + Start -} + } } diff --git a/src/components/Blazor/Snackbar.cs b/src/components/Blazor/Snackbar.cs index aa6fc6ec..28390d81 100644 --- a/src/components/Blazor/Snackbar.cs +++ b/src/components/Blazor/Snackbar.cs @@ -1,172 +1,176 @@ - -using System; using Microsoft.AspNetCore.Components; -using Microsoft.AspNetCore.Components.Rendering; -using System.Threading.Tasks; -using System.Collections.Generic; -using System.Linq; namespace IgniteUI.Blazor.Controls { - public partial class IgbSnackbar: IgbBaseAlertLike { - public override string Type { get { return "WebSnackbar"; } } - - protected override void EnsureModulesLoaded() - { - if (!IgbSnackbarModule.IsLoadRequested(IgBlazor)) - { - IgbSnackbarModule.Register(IgBlazor); - } - } - - protected override string ResolveDisplay() - { - return "inline-block"; - } + public partial class IgbSnackbar : IgbBaseAlertLike + { + public override string Type { get { return "WebSnackbar"; } } - protected override bool SupportsVisualChildren - { - get - { - return true; - } - } + protected override void EnsureModulesLoaded() + { + if (!IgbSnackbarModule.IsLoadRequested(IgBlazor)) + { + IgbSnackbarModule.Register(IgBlazor); + } + } + + protected override string ResolveDisplay() + { + return "inline-block"; + } + + protected override bool SupportsVisualChildren + { + get + { + return true; + } + } + + protected override bool UseDirectRender + { + get + { + return true; + } + } + + protected override string DirectRenderElementName + { + get + { + return "igc-snackbar"; + } + } + + public IgbSnackbar() : base() + { + OnCreatedIgbSnackbar(); + + } + + partial void OnCreatedIgbSnackbar(); + + private string _actionText; + + partial void OnActionTextChanging(ref string newValue); + /// + /// The text of the action button. + /// + [Parameter] + public string ActionText + { + get { return this._actionText; } + set + { + if (this._actionText != value || !IsPropDirty("ActionText")) + { + MarkPropDirty("ActionText"); + } + this._actionText = value; + + } + } - protected override bool UseDirectRender + partial void FindByNameSnackbar(string name, ref object item); + public override object FindByName(string name) + { + + var baseResult = base.FindByName(name); + if (baseResult != null) + { + return baseResult; + } + + object item = null; + FindByNameSnackbar(name, ref item); + if (item != null) + { + return item; + } + + return null; + } + + private string _actionRef = null; + private string _actionScript = null; + [Parameter] + public string ActionScript + { + + set + { + if (value != this._actionScript) + { + this._actionScript = value; + this.OnRefChanged("Action", null, value, true, false, (string refName, object oldValue, object newValue) => + { + this._actionRef = refName; + this.MarkPropDirty("ActionRef"); + }); + } + } + get + { + return this._actionScript; + } + } + + partial void OnHandlingAction(IgbVoidEventArgs args); + private EventCallback? _action = null; + [Parameter] + public EventCallback Action + { + get + { + return this._action != null ? this._action.Value : EventCallback.Empty; + } + set + { + if (!value.Equals(EventCallback.Empty)) + { + if (!CompareEventCallbacks(value, _action, ref eventCallbacksCache)) + { + _action = value; + this.SetHandler(this.Name, "Action", value, (args) => { - get - { - return true; - } - } + OnHandlingAction(args); - protected override string DirectRenderElementName + }); + this.OnRefChanged("Action", null, "event:::Action", true, false, (refName, oldValue, newValue) => { - get - { - return "igc-snackbar"; - } - } - - public IgbSnackbar(): base() { - OnCreatedIgbSnackbar(); - - - } - - partial void OnCreatedIgbSnackbar(); - - private string _actionText; - - partial void OnActionTextChanging(ref string newValue); - /// - /// The text of the action button. - /// - [Parameter] - public string ActionText - { - get { return this._actionText; } - set { - if (this._actionText != value || !IsPropDirty("ActionText")) { - MarkPropDirty("ActionText"); - } - this._actionText = value; - - } - } - - partial void FindByNameSnackbar(string name, ref object item); - public override object FindByName(string name) - { - - var baseResult = base.FindByName(name); - if (baseResult != null) - { - return baseResult; - } - - object item = null; - FindByNameSnackbar(name, ref item); - if (item != null) - { - return item; - } - - return null; - } - - private string _actionRef = null; - private string _actionScript = null; - [Parameter] - public string ActionScript { - - set - { - if (value != this._actionScript) - { - this._actionScript = value; - this.OnRefChanged("Action", null, value, true, false, (string refName, object oldValue, object newValue) => { - this._actionRef = refName; - this.MarkPropDirty("ActionRef"); - }); - } - } - get - { - return this._actionScript; - } - } - - partial void OnHandlingAction(IgbVoidEventArgs args); - private EventCallback? _action = null; - [Parameter] - public EventCallback Action - { - get - { - return this._action != null ? this._action.Value : EventCallback.Empty; - } - set - { - if (!value.Equals(EventCallback.Empty)) - { - if (!CompareEventCallbacks(value, _action, ref eventCallbacksCache)) - { - _action = value; - this.SetHandler(this.Name, "Action", value, (args) => { - OnHandlingAction(args); - - }); - this.OnRefChanged("Action", null, "event:::Action", true, false, (refName, oldValue, newValue) => { - this._actionRef = refName; - this.MarkPropDirty("ActionRef"); - }); - } - } - else - { - _action = null; - this.SetHandler(this.Name, "Action", null); - this.OnRefChanged("Action", null, null, true, false, (refName, oldValue, newValue) => { - this._actionRef = null; - this.MarkPropDirty("ActionRef"); - }); - } - } - } - - partial void SerializeCoreIgbSnackbar(RendererSerializer ser); - - internal override void SerializeCore(RendererSerializer ser) - { - base.SerializeCore(ser); - - SerializeCoreIgbSnackbar(ser); - - if (IsPropDirty("ActionText")) { ser.AddStringProp("actionText", this._actionText); } - if (IsPropDirty("ActionRef")) { ser.AddStringProp("actionRef", this._actionRef); } - - } - -} + this._actionRef = refName; + this.MarkPropDirty("ActionRef"); + }); + } + } + else + { + _action = null; + this.SetHandler(this.Name, "Action", null); + this.OnRefChanged("Action", null, null, true, false, (refName, oldValue, newValue) => + { + this._actionRef = null; + this.MarkPropDirty("ActionRef"); + }); + } + } + } + + partial void SerializeCoreIgbSnackbar(RendererSerializer ser); + + internal override void SerializeCore(RendererSerializer ser) + { + base.SerializeCore(ser); + + SerializeCoreIgbSnackbar(ser); + + if (IsPropDirty("ActionText")) + { ser.AddStringProp("actionText", this._actionText); } + if (IsPropDirty("ActionRef")) + { ser.AddStringProp("actionRef", this._actionRef); } + + } + + } } diff --git a/src/components/Blazor/SnackbarModule.cs b/src/components/Blazor/SnackbarModule.cs index f30d4600..d16de896 100644 --- a/src/components/Blazor/SnackbarModule.cs +++ b/src/components/Blazor/SnackbarModule.cs @@ -1,23 +1,20 @@ -using System; -using System.Collections.Generic; -using System.Runtime.CompilerServices; -using System.Text; -using System.Collections.Generic; - namespace IgniteUI.Blazor.Controls { - public partial class IgbSnackbarModule { - public static void Register(IIgniteUIBlazor runtime) { + public partial class IgbSnackbarModule + { + public static void Register(IIgniteUIBlazor runtime) + { ModuleLoader.Load(runtime, "WebSnackbarModule"); - } - public static void MarkIsLoadRequested(IIgniteUIBlazor runtime) { + public static void MarkIsLoadRequested(IIgniteUIBlazor runtime) + { ModuleLoader.MarkIsLoadRequested(runtime, "WebSnackbarModule"); } - public static bool IsLoadRequested(IIgniteUIBlazor runtime) { + public static bool IsLoadRequested(IIgniteUIBlazor runtime) + { return ModuleLoader.IsLoadRequested(runtime, "WebSnackbarModule"); } } diff --git a/src/components/Blazor/Splitter.cs b/src/components/Blazor/Splitter.cs index 49515280..7bf23557 100644 --- a/src/components/Blazor/Splitter.cs +++ b/src/components/Blazor/Splitter.cs @@ -1,520 +1,566 @@ - -using System; using Microsoft.AspNetCore.Components; -using Microsoft.AspNetCore.Components.Rendering; -using System.Threading.Tasks; -using System.Collections.Generic; -using System.Linq; namespace IgniteUI.Blazor.Controls { - /// -/// The `igc-splitter` component provides a resizable split-pane layout that divides the view -/// into two panels — *start* and *end* — separated by a draggable bar. -/// Panels can be resized by dragging the bar, using keyboard shortcuts, or collapsed/expanded -/// using the built-in collapse buttons or the programmatic `toggle()` API. -/// Nested splitters are supported for more complex layouts. -/// -public partial class IgbSplitter: BaseRendererControl { - public override string Type { get { return "WebSplitter"; } } - - protected override void EnsureModulesLoaded() - { - if (!IgbSplitterModule.IsLoadRequested(IgBlazor)) - { - IgbSplitterModule.Register(IgBlazor); - } - } - - protected override string ResolveDisplay() + /// + /// The `igc-splitter` component provides a resizable split-pane layout that divides the view + /// into two panels — *start* and *end* — separated by a draggable bar. + /// Panels can be resized by dragging the bar, using keyboard shortcuts, or collapsed/expanded + /// using the built-in collapse buttons or the programmatic `toggle()` API. + /// Nested splitters are supported for more complex layouts. + /// + public partial class IgbSplitter : BaseRendererControl + { + public override string Type { get { return "WebSplitter"; } } + + protected override void EnsureModulesLoaded() + { + if (!IgbSplitterModule.IsLoadRequested(IgBlazor)) + { + IgbSplitterModule.Register(IgBlazor); + } + } + + protected override string ResolveDisplay() + { + return "inline-block"; + } + + protected override bool SupportsVisualChildren + { + get + { + return true; + } + } + + protected override bool UseDirectRender + { + get + { + return true; + } + } + + protected override string DirectRenderElementName + { + get + { + return "igc-splitter"; + } + } + + protected override ControlEventBehavior DefaultEventBehavior + { + get { return ControlEventBehavior.Immediate; } + } + + public IgbSplitter() : base() + { + OnCreatedIgbSplitter(); + + } + + partial void OnCreatedIgbSplitter(); + + private SplitterOrientation _orientation = SplitterOrientation.Horizontal; + + partial void OnOrientationChanging(ref SplitterOrientation newValue); + /// + /// The orientation of the splitter, which determines the direction of resizing and collapsing. + /// + [Parameter] + public SplitterOrientation Orientation + { + get { return this._orientation; } + set + { + if (this._orientation != value || !IsPropDirty("Orientation")) + { + MarkPropDirty("Orientation"); + } + this._orientation = value; + + } + } + private bool _disableCollapse = false; + + partial void OnDisableCollapseChanging(ref bool newValue); + /// + /// When true, prevents the user from collapsing either pane. + /// This also hides the expand/collapse buttons on the splitter bar. + /// + [Parameter] + public bool DisableCollapse + { + get { return this._disableCollapse; } + set + { + if (this._disableCollapse != value || !IsPropDirty("DisableCollapse")) + { + MarkPropDirty("DisableCollapse"); + } + this._disableCollapse = value; + + } + } + private bool _disableResize = false; + + partial void OnDisableResizeChanging(ref bool newValue); + /// + /// When true, prevents the user from resizing the panes by dragging the splitter bar or using keyboard shortcuts. + /// This also hides the drag handle on the splitter bar. + /// + [Parameter] + public bool DisableResize + { + get { return this._disableResize; } + set + { + if (this._disableResize != value || !IsPropDirty("DisableResize")) + { + MarkPropDirty("DisableResize"); + } + this._disableResize = value; + + } + } + private bool _hideCollapseButtons = false; + + partial void OnHideCollapseButtonsChanging(ref bool newValue); + /// + /// When true, hides the expand/collapse buttons on the splitter bar. + /// Note that the buttons will also be hidden if `disable-collapse` is true or + /// if a pane is currently collapsed. + /// + [Parameter] + public bool HideCollapseButtons + { + get { return this._hideCollapseButtons; } + set + { + if (this._hideCollapseButtons != value || !IsPropDirty("HideCollapseButtons")) + { + MarkPropDirty("HideCollapseButtons"); + } + this._hideCollapseButtons = value; + + } + } + private bool _hideDragHandle = false; + + partial void OnHideDragHandleChanging(ref bool newValue); + /// + /// When true, hides the drag handle on the splitter bar. + /// Note that the drag handle will also be hidden if `disable-resize` is true. + /// + [Parameter] + public bool HideDragHandle + { + get { return this._hideDragHandle; } + set + { + if (this._hideDragHandle != value || !IsPropDirty("HideDragHandle")) + { + MarkPropDirty("HideDragHandle"); + } + this._hideDragHandle = value; + + } + } + private string? _startMinSize; + + partial void OnStartMinSizeChanging(ref string? newValue); + /// + /// The minimum size of the start pane. + /// + [Parameter] + public string? StartMinSize + { + get { return this._startMinSize; } + set + { + if (this._startMinSize != value || !IsPropDirty("StartMinSize")) + { + MarkPropDirty("StartMinSize"); + } + this._startMinSize = value; + + } + } + private string? _endMinSize; + + partial void OnEndMinSizeChanging(ref string? newValue); + /// + /// The minimum size of the end pane. + /// + [Parameter] + public string? EndMinSize + { + get { return this._endMinSize; } + set + { + if (this._endMinSize != value || !IsPropDirty("EndMinSize")) + { + MarkPropDirty("EndMinSize"); + } + this._endMinSize = value; + + } + } + private string? _startMaxSize; + + partial void OnStartMaxSizeChanging(ref string? newValue); + /// + /// The maximum size of the start pane. + /// + [Parameter] + public string? StartMaxSize + { + get { return this._startMaxSize; } + set + { + if (this._startMaxSize != value || !IsPropDirty("StartMaxSize")) + { + MarkPropDirty("StartMaxSize"); + } + this._startMaxSize = value; + + } + } + private string? _endMaxSize; + + partial void OnEndMaxSizeChanging(ref string? newValue); + /// + /// The maximum size of the end pane. + /// + [Parameter] + public string? EndMaxSize + { + get { return this._endMaxSize; } + set + { + if (this._endMaxSize != value || !IsPropDirty("EndMaxSize")) + { + MarkPropDirty("EndMaxSize"); + } + this._endMaxSize = value; + + } + } + private string? _startSize; + + partial void OnStartSizeChanging(ref string? newValue); + /// + /// The size of the start pane. + /// + [Parameter] + public string? StartSize + { + get { return this._startSize; } + set + { + if (this._startSize != value || !IsPropDirty("StartSize")) + { + MarkPropDirty("StartSize"); + } + this._startSize = value; + + } + } + private string? _endSize; + + partial void OnEndSizeChanging(ref string? newValue); + /// + /// The size of the end pane. + /// + [Parameter] + public string? EndSize + { + get { return this._endSize; } + set + { + if (this._endSize != value || !IsPropDirty("EndSize")) + { + MarkPropDirty("EndSize"); + } + this._endSize = value; + + } + } + + partial void FindByNameSplitter(string name, ref object item); + public override object FindByName(string name) + { + + var baseResult = base.FindByName(name); + if (baseResult != null) + { + return baseResult; + } + + object item = null; + FindByNameSplitter(name, ref item); + if (item != null) + { + return item; + } + + return null; + } + public async Task SetNativeElementAsync(Object element) + { + await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + } + public void SetNativeElement(Object element) + { + InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + } + /// + /// Toggles the collapsed state of the specified pane. + /// + public async Task ToggleAsync(PanePosition position) + { + await InvokeMethod("toggle", new object[] { ObjectToParam(position, typeof(PanePosition)) }, new string[] { "Json" }); + } + public void Toggle(PanePosition position) + { + InvokeMethodSync("toggle", new object[] { ObjectToParam(position, typeof(PanePosition)) }, new string[] { "Json" }); + } + + private string _resizeStartRef = null; + private string _resizeStartScript = null; + [Parameter] + public string ResizeStartScript + { + + set + { + if (value != this._resizeStartScript) + { + this._resizeStartScript = value; + this.OnRefChanged("ResizeStart", null, value, true, false, (string refName, object oldValue, object newValue) => + { + this._resizeStartRef = refName; + this.MarkPropDirty("ResizeStartRef"); + }); + } + } + get + { + return this._resizeStartScript; + } + } + + partial void OnHandlingResizeStart(IgbSplitterResizeEventArgs args); + private EventCallback? _resizeStart = null; + [Parameter] + public EventCallback ResizeStart + { + get + { + return this._resizeStart != null ? this._resizeStart.Value : EventCallback.Empty; + } + set + { + if (!value.Equals(EventCallback.Empty)) + { + if (!CompareEventCallbacks(value, _resizeStart, ref eventCallbacksCache)) + { + _resizeStart = value; + this.SetHandler(this.Name, "ResizeStart", value, (args) => { - return "inline-block"; - } + OnHandlingResizeStart(args); - protected override bool SupportsVisualChildren + }); + this.OnRefChanged("ResizeStart", null, "event:::ResizeStart", true, false, (refName, oldValue, newValue) => { - get - { - return true; - } - } + this._resizeStartRef = refName; + this.MarkPropDirty("ResizeStartRef"); + }); + } + } + else + { + _resizeStart = null; + this.SetHandler(this.Name, "ResizeStart", null); + this.OnRefChanged("ResizeStart", null, null, true, false, (refName, oldValue, newValue) => + { + this._resizeStartRef = null; + this.MarkPropDirty("ResizeStartRef"); + }); + } + } + } + + private string _resizingRef = null; + private string _resizingScript = null; + [Parameter] + public string ResizingScript + { + + set + { + if (value != this._resizingScript) + { + this._resizingScript = value; + this.OnRefChanged("Resizing", null, value, true, false, (string refName, object oldValue, object newValue) => + { + this._resizingRef = refName; + this.MarkPropDirty("ResizingRef"); + }); + } + } + get + { + return this._resizingScript; + } + } - protected override bool UseDirectRender + partial void OnHandlingResizing(IgbSplitterResizeEventArgs args); + private EventCallback? _resizing = null; + [Parameter] + public EventCallback Resizing + { + get + { + return this._resizing != null ? this._resizing.Value : EventCallback.Empty; + } + set + { + if (!value.Equals(EventCallback.Empty)) + { + if (!CompareEventCallbacks(value, _resizing, ref eventCallbacksCache)) + { + _resizing = value; + this.SetHandler(this.Name, "Resizing", value, (args) => { - get - { - return true; - } - } + OnHandlingResizing(args); - protected override string DirectRenderElementName + }); + this.OnRefChanged("Resizing", null, "event:::Resizing", true, false, (refName, oldValue, newValue) => { - get - { - return "igc-splitter"; - } - } - - protected override ControlEventBehavior DefaultEventBehavior - { - get { return ControlEventBehavior.Immediate; } - } - - public IgbSplitter(): base() { - OnCreatedIgbSplitter(); - - - } - - partial void OnCreatedIgbSplitter(); - - private SplitterOrientation _orientation = SplitterOrientation.Horizontal; - - partial void OnOrientationChanging(ref SplitterOrientation newValue); - /// - /// The orientation of the splitter, which determines the direction of resizing and collapsing. - /// - [Parameter] - public SplitterOrientation Orientation - { - get { return this._orientation; } - set { - if (this._orientation != value || !IsPropDirty("Orientation")) { - MarkPropDirty("Orientation"); - } - this._orientation = value; - - } - } - private bool _disableCollapse = false; - - partial void OnDisableCollapseChanging(ref bool newValue); - /// - /// When true, prevents the user from collapsing either pane. - /// This also hides the expand/collapse buttons on the splitter bar. - /// - [Parameter] - public bool DisableCollapse - { - get { return this._disableCollapse; } - set { - if (this._disableCollapse != value || !IsPropDirty("DisableCollapse")) { - MarkPropDirty("DisableCollapse"); - } - this._disableCollapse = value; - - } - } - private bool _disableResize = false; - - partial void OnDisableResizeChanging(ref bool newValue); - /// - /// When true, prevents the user from resizing the panes by dragging the splitter bar or using keyboard shortcuts. - /// This also hides the drag handle on the splitter bar. - /// - [Parameter] - public bool DisableResize - { - get { return this._disableResize; } - set { - if (this._disableResize != value || !IsPropDirty("DisableResize")) { - MarkPropDirty("DisableResize"); - } - this._disableResize = value; - - } - } - private bool _hideCollapseButtons = false; - - partial void OnHideCollapseButtonsChanging(ref bool newValue); - /// - /// When true, hides the expand/collapse buttons on the splitter bar. - /// Note that the buttons will also be hidden if `disable-collapse` is true or - /// if a pane is currently collapsed. - /// - [Parameter] - public bool HideCollapseButtons - { - get { return this._hideCollapseButtons; } - set { - if (this._hideCollapseButtons != value || !IsPropDirty("HideCollapseButtons")) { - MarkPropDirty("HideCollapseButtons"); - } - this._hideCollapseButtons = value; - - } - } - private bool _hideDragHandle = false; - - partial void OnHideDragHandleChanging(ref bool newValue); - /// - /// When true, hides the drag handle on the splitter bar. - /// Note that the drag handle will also be hidden if `disable-resize` is true. - /// - [Parameter] - public bool HideDragHandle - { - get { return this._hideDragHandle; } - set { - if (this._hideDragHandle != value || !IsPropDirty("HideDragHandle")) { - MarkPropDirty("HideDragHandle"); - } - this._hideDragHandle = value; - - } - } - private string? _startMinSize; - - partial void OnStartMinSizeChanging(ref string? newValue); - /// - /// The minimum size of the start pane. - /// - [Parameter] - public string? StartMinSize - { - get { return this._startMinSize; } - set { - if (this._startMinSize != value || !IsPropDirty("StartMinSize")) { - MarkPropDirty("StartMinSize"); - } - this._startMinSize = value; - - } - } - private string? _endMinSize; - - partial void OnEndMinSizeChanging(ref string? newValue); - /// - /// The minimum size of the end pane. - /// - [Parameter] - public string? EndMinSize - { - get { return this._endMinSize; } - set { - if (this._endMinSize != value || !IsPropDirty("EndMinSize")) { - MarkPropDirty("EndMinSize"); - } - this._endMinSize = value; - - } - } - private string? _startMaxSize; - - partial void OnStartMaxSizeChanging(ref string? newValue); - /// - /// The maximum size of the start pane. - /// - [Parameter] - public string? StartMaxSize - { - get { return this._startMaxSize; } - set { - if (this._startMaxSize != value || !IsPropDirty("StartMaxSize")) { - MarkPropDirty("StartMaxSize"); - } - this._startMaxSize = value; - - } - } - private string? _endMaxSize; - - partial void OnEndMaxSizeChanging(ref string? newValue); - /// - /// The maximum size of the end pane. - /// - [Parameter] - public string? EndMaxSize - { - get { return this._endMaxSize; } - set { - if (this._endMaxSize != value || !IsPropDirty("EndMaxSize")) { - MarkPropDirty("EndMaxSize"); - } - this._endMaxSize = value; - - } - } - private string? _startSize; - - partial void OnStartSizeChanging(ref string? newValue); - /// - /// The size of the start pane. - /// - [Parameter] - public string? StartSize - { - get { return this._startSize; } - set { - if (this._startSize != value || !IsPropDirty("StartSize")) { - MarkPropDirty("StartSize"); - } - this._startSize = value; - - } - } - private string? _endSize; - - partial void OnEndSizeChanging(ref string? newValue); - /// - /// The size of the end pane. - /// - [Parameter] - public string? EndSize - { - get { return this._endSize; } - set { - if (this._endSize != value || !IsPropDirty("EndSize")) { - MarkPropDirty("EndSize"); - } - this._endSize = value; - - } - } - - partial void FindByNameSplitter(string name, ref object item); - public override object FindByName(string name) - { - - var baseResult = base.FindByName(name); - if (baseResult != null) - { - return baseResult; - } - - object item = null; - FindByNameSplitter(name, ref item); - if (item != null) - { - return item; - } - - return null; - } - public async Task SetNativeElementAsync(Object element) - { - await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); - } - public void SetNativeElement(Object element) - { - InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); - } - /// - /// Toggles the collapsed state of the specified pane. - /// - public async Task ToggleAsync(PanePosition position) - { - await InvokeMethod("toggle", new object[] { ObjectToParam(position, typeof(PanePosition)) }, new string[] { "Json" }); - } - public void Toggle(PanePosition position) - { - InvokeMethodSync("toggle", new object[] { ObjectToParam(position, typeof(PanePosition)) }, new string[] { "Json" }); - } - - private string _resizeStartRef = null; - private string _resizeStartScript = null; - [Parameter] - public string ResizeStartScript { - - set - { - if (value != this._resizeStartScript) - { - this._resizeStartScript = value; - this.OnRefChanged("ResizeStart", null, value, true, false, (string refName, object oldValue, object newValue) => { - this._resizeStartRef = refName; - this.MarkPropDirty("ResizeStartRef"); - }); - } - } - get - { - return this._resizeStartScript; - } - } - - partial void OnHandlingResizeStart(IgbSplitterResizeEventArgs args); - private EventCallback? _resizeStart = null; - [Parameter] - public EventCallback ResizeStart - { - get - { - return this._resizeStart != null ? this._resizeStart.Value : EventCallback.Empty; - } - set - { - if (!value.Equals(EventCallback.Empty)) - { - if (!CompareEventCallbacks(value, _resizeStart, ref eventCallbacksCache)) - { - _resizeStart = value; - this.SetHandler(this.Name, "ResizeStart", value, (args) => { - OnHandlingResizeStart(args); - - }); - this.OnRefChanged("ResizeStart", null, "event:::ResizeStart", true, false, (refName, oldValue, newValue) => { - this._resizeStartRef = refName; - this.MarkPropDirty("ResizeStartRef"); - }); - } - } - else - { - _resizeStart = null; - this.SetHandler(this.Name, "ResizeStart", null); - this.OnRefChanged("ResizeStart", null, null, true, false, (refName, oldValue, newValue) => { - this._resizeStartRef = null; - this.MarkPropDirty("ResizeStartRef"); - }); - } - } - } - - private string _resizingRef = null; - private string _resizingScript = null; - [Parameter] - public string ResizingScript { - - set - { - if (value != this._resizingScript) - { - this._resizingScript = value; - this.OnRefChanged("Resizing", null, value, true, false, (string refName, object oldValue, object newValue) => { - this._resizingRef = refName; - this.MarkPropDirty("ResizingRef"); - }); - } - } - get - { - return this._resizingScript; - } - } - - partial void OnHandlingResizing(IgbSplitterResizeEventArgs args); - private EventCallback? _resizing = null; - [Parameter] - public EventCallback Resizing - { - get - { - return this._resizing != null ? this._resizing.Value : EventCallback.Empty; - } - set - { - if (!value.Equals(EventCallback.Empty)) - { - if (!CompareEventCallbacks(value, _resizing, ref eventCallbacksCache)) - { - _resizing = value; - this.SetHandler(this.Name, "Resizing", value, (args) => { - OnHandlingResizing(args); - - }); - this.OnRefChanged("Resizing", null, "event:::Resizing", true, false, (refName, oldValue, newValue) => { - this._resizingRef = refName; - this.MarkPropDirty("ResizingRef"); - }); - } - } - else - { - _resizing = null; - this.SetHandler(this.Name, "Resizing", null); - this.OnRefChanged("Resizing", null, null, true, false, (refName, oldValue, newValue) => { - this._resizingRef = null; - this.MarkPropDirty("ResizingRef"); - }); - } - } - } - - private string _resizeEndRef = null; - private string _resizeEndScript = null; - [Parameter] - public string ResizeEndScript { - - set - { - if (value != this._resizeEndScript) - { - this._resizeEndScript = value; - this.OnRefChanged("ResizeEnd", null, value, true, false, (string refName, object oldValue, object newValue) => { - this._resizeEndRef = refName; - this.MarkPropDirty("ResizeEndRef"); - }); - } - } - get - { - return this._resizeEndScript; - } - } - - partial void OnHandlingResizeEnd(IgbSplitterResizeEventArgs args); - private EventCallback? _resizeEnd = null; - [Parameter] - public EventCallback ResizeEnd - { - get - { - return this._resizeEnd != null ? this._resizeEnd.Value : EventCallback.Empty; - } - set - { - if (!value.Equals(EventCallback.Empty)) - { - if (!CompareEventCallbacks(value, _resizeEnd, ref eventCallbacksCache)) - { - _resizeEnd = value; - this.SetHandler(this.Name, "ResizeEnd", value, (args) => { - OnHandlingResizeEnd(args); - - }); - this.OnRefChanged("ResizeEnd", null, "event:::ResizeEnd", true, false, (refName, oldValue, newValue) => { - this._resizeEndRef = refName; - this.MarkPropDirty("ResizeEndRef"); - }); - } - } - else - { - _resizeEnd = null; - this.SetHandler(this.Name, "ResizeEnd", null); - this.OnRefChanged("ResizeEnd", null, null, true, false, (refName, oldValue, newValue) => { - this._resizeEndRef = null; - this.MarkPropDirty("ResizeEndRef"); - }); - } - } - } - - partial void SerializeCoreIgbSplitter(RendererSerializer ser); - - internal override void SerializeCore(RendererSerializer ser) - { - base.SerializeCore(ser); - - SerializeCoreIgbSplitter(ser); - - if (IsPropDirty("Orientation")) { ser.AddEnumProp("orientation", this._orientation); } - if (IsPropDirty("DisableCollapse")) { ser.AddBooleanProp("disableCollapse", this._disableCollapse); } - if (IsPropDirty("DisableResize")) { ser.AddBooleanProp("disableResize", this._disableResize); } - if (IsPropDirty("HideCollapseButtons")) { ser.AddBooleanProp("hideCollapseButtons", this._hideCollapseButtons); } - if (IsPropDirty("HideDragHandle")) { ser.AddBooleanProp("hideDragHandle", this._hideDragHandle); } - if (IsPropDirty("StartMinSize")) { ser.AddStringProp("startMinSize", this._startMinSize); } - if (IsPropDirty("EndMinSize")) { ser.AddStringProp("endMinSize", this._endMinSize); } - if (IsPropDirty("StartMaxSize")) { ser.AddStringProp("startMaxSize", this._startMaxSize); } - if (IsPropDirty("EndMaxSize")) { ser.AddStringProp("endMaxSize", this._endMaxSize); } - if (IsPropDirty("StartSize")) { ser.AddStringProp("startSize", this._startSize); } - if (IsPropDirty("EndSize")) { ser.AddStringProp("endSize", this._endSize); } - if (IsPropDirty("ResizeStartRef")) { ser.AddStringProp("resizeStartRef", this._resizeStartRef); } - if (IsPropDirty("ResizingRef")) { ser.AddStringProp("resizingRef", this._resizingRef); } - if (IsPropDirty("ResizeEndRef")) { ser.AddStringProp("resizeEndRef", this._resizeEndRef); } - - } - -} + this._resizingRef = refName; + this.MarkPropDirty("ResizingRef"); + }); + } + } + else + { + _resizing = null; + this.SetHandler(this.Name, "Resizing", null); + this.OnRefChanged("Resizing", null, null, true, false, (refName, oldValue, newValue) => + { + this._resizingRef = null; + this.MarkPropDirty("ResizingRef"); + }); + } + } + } + + private string _resizeEndRef = null; + private string _resizeEndScript = null; + [Parameter] + public string ResizeEndScript + { + + set + { + if (value != this._resizeEndScript) + { + this._resizeEndScript = value; + this.OnRefChanged("ResizeEnd", null, value, true, false, (string refName, object oldValue, object newValue) => + { + this._resizeEndRef = refName; + this.MarkPropDirty("ResizeEndRef"); + }); + } + } + get + { + return this._resizeEndScript; + } + } + + partial void OnHandlingResizeEnd(IgbSplitterResizeEventArgs args); + private EventCallback? _resizeEnd = null; + [Parameter] + public EventCallback ResizeEnd + { + get + { + return this._resizeEnd != null ? this._resizeEnd.Value : EventCallback.Empty; + } + set + { + if (!value.Equals(EventCallback.Empty)) + { + if (!CompareEventCallbacks(value, _resizeEnd, ref eventCallbacksCache)) + { + _resizeEnd = value; + this.SetHandler(this.Name, "ResizeEnd", value, (args) => + { + OnHandlingResizeEnd(args); + + }); + this.OnRefChanged("ResizeEnd", null, "event:::ResizeEnd", true, false, (refName, oldValue, newValue) => + { + this._resizeEndRef = refName; + this.MarkPropDirty("ResizeEndRef"); + }); + } + } + else + { + _resizeEnd = null; + this.SetHandler(this.Name, "ResizeEnd", null); + this.OnRefChanged("ResizeEnd", null, null, true, false, (refName, oldValue, newValue) => + { + this._resizeEndRef = null; + this.MarkPropDirty("ResizeEndRef"); + }); + } + } + } + + partial void SerializeCoreIgbSplitter(RendererSerializer ser); + + internal override void SerializeCore(RendererSerializer ser) + { + base.SerializeCore(ser); + + SerializeCoreIgbSplitter(ser); + + if (IsPropDirty("Orientation")) + { ser.AddEnumProp("orientation", this._orientation); } + if (IsPropDirty("DisableCollapse")) + { ser.AddBooleanProp("disableCollapse", this._disableCollapse); } + if (IsPropDirty("DisableResize")) + { ser.AddBooleanProp("disableResize", this._disableResize); } + if (IsPropDirty("HideCollapseButtons")) + { ser.AddBooleanProp("hideCollapseButtons", this._hideCollapseButtons); } + if (IsPropDirty("HideDragHandle")) + { ser.AddBooleanProp("hideDragHandle", this._hideDragHandle); } + if (IsPropDirty("StartMinSize")) + { ser.AddStringProp("startMinSize", this._startMinSize); } + if (IsPropDirty("EndMinSize")) + { ser.AddStringProp("endMinSize", this._endMinSize); } + if (IsPropDirty("StartMaxSize")) + { ser.AddStringProp("startMaxSize", this._startMaxSize); } + if (IsPropDirty("EndMaxSize")) + { ser.AddStringProp("endMaxSize", this._endMaxSize); } + if (IsPropDirty("StartSize")) + { ser.AddStringProp("startSize", this._startSize); } + if (IsPropDirty("EndSize")) + { ser.AddStringProp("endSize", this._endSize); } + if (IsPropDirty("ResizeStartRef")) + { ser.AddStringProp("resizeStartRef", this._resizeStartRef); } + if (IsPropDirty("ResizingRef")) + { ser.AddStringProp("resizingRef", this._resizingRef); } + if (IsPropDirty("ResizeEndRef")) + { ser.AddStringProp("resizeEndRef", this._resizeEndRef); } + + } + + } } diff --git a/src/components/Blazor/SplitterModule.cs b/src/components/Blazor/SplitterModule.cs index ebeca1dc..9e933a09 100644 --- a/src/components/Blazor/SplitterModule.cs +++ b/src/components/Blazor/SplitterModule.cs @@ -1,23 +1,20 @@ -using System; -using System.Collections.Generic; -using System.Runtime.CompilerServices; -using System.Text; -using System.Collections.Generic; - namespace IgniteUI.Blazor.Controls { - public partial class IgbSplitterModule { - public static void Register(IIgniteUIBlazor runtime) { + public partial class IgbSplitterModule + { + public static void Register(IIgniteUIBlazor runtime) + { ModuleLoader.Load(runtime, "WebSplitterModule"); - } - public static void MarkIsLoadRequested(IIgniteUIBlazor runtime) { + public static void MarkIsLoadRequested(IIgniteUIBlazor runtime) + { ModuleLoader.MarkIsLoadRequested(runtime, "WebSplitterModule"); } - public static bool IsLoadRequested(IIgniteUIBlazor runtime) { + public static bool IsLoadRequested(IIgniteUIBlazor runtime) + { return ModuleLoader.IsLoadRequested(runtime, "WebSplitterModule"); } } diff --git a/src/components/Blazor/SplitterOrientation.cs b/src/components/Blazor/SplitterOrientation.cs index 1889f401..c4fd3f00 100644 --- a/src/components/Blazor/SplitterOrientation.cs +++ b/src/components/Blazor/SplitterOrientation.cs @@ -1,8 +1,9 @@ namespace IgniteUI.Blazor.Controls { -public enum SplitterOrientation { - Horizontal, - Vertical + public enum SplitterOrientation + { + Horizontal, + Vertical -} + } } diff --git a/src/components/Blazor/SplitterResizeEventArgs.cs b/src/components/Blazor/SplitterResizeEventArgs.cs index db978e80..bf5d0623 100644 --- a/src/components/Blazor/SplitterResizeEventArgs.cs +++ b/src/components/Blazor/SplitterResizeEventArgs.cs @@ -1,99 +1,97 @@ - -using System; using Microsoft.AspNetCore.Components; -using Microsoft.AspNetCore.Components.Rendering; -using System.Threading.Tasks; -using System.Collections.Generic; -using System.Linq; namespace IgniteUI.Blazor.Controls { - public partial class IgbSplitterResizeEventArgs: BaseRendererElement { - public override string Type { get { return "WebSplitterResizeEventArgs"; } } - - - private static bool _marshalByValue = true; - - public IgbSplitterResizeEventArgs(): base() { - OnCreatedIgbSplitterResizeEventArgs(); - - - } - - partial void OnCreatedIgbSplitterResizeEventArgs(); - - private IgbSplitterResizeEventArgsDetail _detail; - - partial void OnDetailChanging(ref IgbSplitterResizeEventArgsDetail newValue); - [Parameter] - public IgbSplitterResizeEventArgsDetail Detail - { - get { return this._detail; } - set { - OnDetailChanging(ref value); - MarkPropDirty("Detail"); - if (this._detail != null) { - this.DetachChild(this._detail); - } - if (value != null) { - this.AttachChild(value); - } - this._detail = value; - } - - } - - partial void FindByNameSplitterResizeEventArgs(string name, ref object item); - public override object FindByName(string name) - { - - var baseResult = base.FindByName(name); - if (baseResult != null) - { - return baseResult; - } - - object item = null; - FindByNameSplitterResizeEventArgs(name, ref item); - if (item != null) - { - return item; - } - - return null; - } - - partial void SerializeCoreIgbSplitterResizeEventArgs(RendererSerializer ser); - - internal override void SerializeCore(RendererSerializer ser) - { - base.SerializeCore(ser); - - SerializeCoreIgbSplitterResizeEventArgs(ser); - - if (IsPropDirty("Detail")) { ser.AddSerializableProp("detail", this._detail); } - - } - - - protected internal override void ToEventJson(BaseRendererControl control, Dictionary args) - { - base.ToEventJson(control, args); - - if (IsPropDirty("Detail")) { args["detail"] = ObjectToParam(this._detail); } - - - } - - - protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) { - base.FromEventJson(control, args); - this.SuppressParentNotify = true; - - if (args.ContainsKey("detail")) { this.Detail = (IgbSplitterResizeEventArgsDetail)ConvertReturnValue(args["detail"], "SplitterResizeEventArgsDetail", true); } - - this.SuppressParentNotify = false; - } - -} + public partial class IgbSplitterResizeEventArgs : BaseRendererElement + { + public override string Type { get { return "WebSplitterResizeEventArgs"; } } + + private static bool _marshalByValue = true; + + public IgbSplitterResizeEventArgs() : base() + { + OnCreatedIgbSplitterResizeEventArgs(); + + } + + partial void OnCreatedIgbSplitterResizeEventArgs(); + + private IgbSplitterResizeEventArgsDetail _detail; + + partial void OnDetailChanging(ref IgbSplitterResizeEventArgsDetail newValue); + [Parameter] + public IgbSplitterResizeEventArgsDetail Detail + { + get { return this._detail; } + set + { + OnDetailChanging(ref value); + MarkPropDirty("Detail"); + if (this._detail != null) + { + this.DetachChild(this._detail); + } + if (value != null) + { + this.AttachChild(value); + } + this._detail = value; + } + + } + + partial void FindByNameSplitterResizeEventArgs(string name, ref object item); + public override object FindByName(string name) + { + + var baseResult = base.FindByName(name); + if (baseResult != null) + { + return baseResult; + } + + object item = null; + FindByNameSplitterResizeEventArgs(name, ref item); + if (item != null) + { + return item; + } + + return null; + } + + partial void SerializeCoreIgbSplitterResizeEventArgs(RendererSerializer ser); + + internal override void SerializeCore(RendererSerializer ser) + { + base.SerializeCore(ser); + + SerializeCoreIgbSplitterResizeEventArgs(ser); + + if (IsPropDirty("Detail")) + { ser.AddSerializableProp("detail", this._detail); } + + } + + protected internal override void ToEventJson(BaseRendererControl control, Dictionary args) + { + base.ToEventJson(control, args); + + if (IsPropDirty("Detail")) + { args["detail"] = ObjectToParam(this._detail); } + + } + + protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) + { + base.FromEventJson(control, args); + this.SuppressParentNotify = true; + + if (args.ContainsKey("detail")) + { this.Detail = (IgbSplitterResizeEventArgsDetail)ConvertReturnValue(args["detail"], "SplitterResizeEventArgsDetail", true); } + + this.SuppressParentNotify = false; + } + + } } diff --git a/src/components/Blazor/SplitterResizeEventArgsDetail.cs b/src/components/Blazor/SplitterResizeEventArgsDetail.cs index c36bb699..9fe3c23c 100644 --- a/src/components/Blazor/SplitterResizeEventArgsDetail.cs +++ b/src/components/Blazor/SplitterResizeEventArgsDetail.cs @@ -1,147 +1,154 @@ - -using System; using Microsoft.AspNetCore.Components; -using Microsoft.AspNetCore.Components.Rendering; -using System.Threading.Tasks; -using System.Collections.Generic; -using System.Linq; namespace IgniteUI.Blazor.Controls { - public partial class IgbSplitterResizeEventArgsDetail: BaseRendererElement { - public override string Type { get { return "WebSplitterResizeEventArgsDetail"; } } - - - private static bool _marshalByValue = true; - - public IgbSplitterResizeEventArgsDetail(): base() { - OnCreatedIgbSplitterResizeEventArgsDetail(); - - - } - - partial void OnCreatedIgbSplitterResizeEventArgsDetail(); - - private double _startPanelSize = 0; - - partial void OnStartPanelSizeChanging(ref double newValue); - /// - /// The current size of the start panel in pixels - /// - [Parameter] - public double StartPanelSize - { - get { return this._startPanelSize; } - set { - if (this._startPanelSize != value || !IsPropDirty("StartPanelSize")) { - MarkPropDirty("StartPanelSize"); - } - this._startPanelSize = value; - - } - } - private double _endPanelSize = 0; - - partial void OnEndPanelSizeChanging(ref double newValue); - /// - /// The current size of the end panel in pixels - /// - [Parameter] - public double EndPanelSize - { - get { return this._endPanelSize; } - set { - if (this._endPanelSize != value || !IsPropDirty("EndPanelSize")) { - MarkPropDirty("EndPanelSize"); - } - this._endPanelSize = value; - - } - } - private double _delta = 0; - - partial void OnDeltaChanging(ref double newValue); - /// - /// The change in size since the resize operation started (only for igcResizing and igcResizeEnd) - /// - [Parameter] - public double Delta - { - get { return this._delta; } - set { - if (this._delta != value || !IsPropDirty("Delta")) { - MarkPropDirty("Delta"); - } - this._delta = value; - - } - } - - partial void FindByNameSplitterResizeEventArgsDetail(string name, ref object item); - public override object FindByName(string name) - { - - var baseResult = base.FindByName(name); - if (baseResult != null) - { - return baseResult; - } - - object item = null; - FindByNameSplitterResizeEventArgsDetail(name, ref item); - if (item != null) - { - return item; - } - - return null; - } - public async Task SetNativeElementAsync(Object element) - { - await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); - } - public void SetNativeElement(Object element) - { - InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); - } - - partial void SerializeCoreIgbSplitterResizeEventArgsDetail(RendererSerializer ser); - - internal override void SerializeCore(RendererSerializer ser) - { - base.SerializeCore(ser); - - SerializeCoreIgbSplitterResizeEventArgsDetail(ser); - - if (IsPropDirty("StartPanelSize")) { ser.AddNumberProp("startPanelSize", this._startPanelSize); } - if (IsPropDirty("EndPanelSize")) { ser.AddNumberProp("endPanelSize", this._endPanelSize); } - if (IsPropDirty("Delta")) { ser.AddNumberProp("delta", this._delta); } - - } - - - protected internal override void ToEventJson(BaseRendererControl control, Dictionary args) - { - base.ToEventJson(control, args); - - if (IsPropDirty("StartPanelSize")) { args["startPanelSize"] = (this._startPanelSize).ToString(); } - if (IsPropDirty("EndPanelSize")) { args["endPanelSize"] = (this._endPanelSize).ToString(); } - if (IsPropDirty("Delta")) { args["delta"] = (this._delta).ToString(); } - - - } - - - protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) { - base.FromEventJson(control, args); - this.SuppressParentNotify = true; - - if (args.ContainsKey("startPanelSize")) { this.StartPanelSize = ReturnToDouble(args["startPanelSize"]); } - if (args.ContainsKey("endPanelSize")) { this.EndPanelSize = ReturnToDouble(args["endPanelSize"]); } - if (args.ContainsKey("delta")) { this.Delta = ReturnToDouble(args["delta"]); } - - this.SuppressParentNotify = false; - } - -} + public partial class IgbSplitterResizeEventArgsDetail : BaseRendererElement + { + public override string Type { get { return "WebSplitterResizeEventArgsDetail"; } } + + private static bool _marshalByValue = true; + + public IgbSplitterResizeEventArgsDetail() : base() + { + OnCreatedIgbSplitterResizeEventArgsDetail(); + + } + + partial void OnCreatedIgbSplitterResizeEventArgsDetail(); + + private double _startPanelSize = 0; + + partial void OnStartPanelSizeChanging(ref double newValue); + /// + /// The current size of the start panel in pixels + /// + [Parameter] + public double StartPanelSize + { + get { return this._startPanelSize; } + set + { + if (this._startPanelSize != value || !IsPropDirty("StartPanelSize")) + { + MarkPropDirty("StartPanelSize"); + } + this._startPanelSize = value; + + } + } + private double _endPanelSize = 0; + + partial void OnEndPanelSizeChanging(ref double newValue); + /// + /// The current size of the end panel in pixels + /// + [Parameter] + public double EndPanelSize + { + get { return this._endPanelSize; } + set + { + if (this._endPanelSize != value || !IsPropDirty("EndPanelSize")) + { + MarkPropDirty("EndPanelSize"); + } + this._endPanelSize = value; + + } + } + private double _delta = 0; + + partial void OnDeltaChanging(ref double newValue); + /// + /// The change in size since the resize operation started (only for igcResizing and igcResizeEnd) + /// + [Parameter] + public double Delta + { + get { return this._delta; } + set + { + if (this._delta != value || !IsPropDirty("Delta")) + { + MarkPropDirty("Delta"); + } + this._delta = value; + + } + } + + partial void FindByNameSplitterResizeEventArgsDetail(string name, ref object item); + public override object FindByName(string name) + { + + var baseResult = base.FindByName(name); + if (baseResult != null) + { + return baseResult; + } + + object item = null; + FindByNameSplitterResizeEventArgsDetail(name, ref item); + if (item != null) + { + return item; + } + + return null; + } + public async Task SetNativeElementAsync(Object element) + { + await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + } + public void SetNativeElement(Object element) + { + InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + } + + partial void SerializeCoreIgbSplitterResizeEventArgsDetail(RendererSerializer ser); + + internal override void SerializeCore(RendererSerializer ser) + { + base.SerializeCore(ser); + + SerializeCoreIgbSplitterResizeEventArgsDetail(ser); + + if (IsPropDirty("StartPanelSize")) + { ser.AddNumberProp("startPanelSize", this._startPanelSize); } + if (IsPropDirty("EndPanelSize")) + { ser.AddNumberProp("endPanelSize", this._endPanelSize); } + if (IsPropDirty("Delta")) + { ser.AddNumberProp("delta", this._delta); } + + } + + protected internal override void ToEventJson(BaseRendererControl control, Dictionary args) + { + base.ToEventJson(control, args); + + if (IsPropDirty("StartPanelSize")) + { args["startPanelSize"] = (this._startPanelSize).ToString(); } + if (IsPropDirty("EndPanelSize")) + { args["endPanelSize"] = (this._endPanelSize).ToString(); } + if (IsPropDirty("Delta")) + { args["delta"] = (this._delta).ToString(); } + + } + + protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) + { + base.FromEventJson(control, args); + this.SuppressParentNotify = true; + + if (args.ContainsKey("startPanelSize")) + { this.StartPanelSize = ReturnToDouble(args["startPanelSize"]); } + if (args.ContainsKey("endPanelSize")) + { this.EndPanelSize = ReturnToDouble(args["endPanelSize"]); } + if (args.ContainsKey("delta")) + { this.Delta = ReturnToDouble(args["delta"]); } + + this.SuppressParentNotify = false; + } + + } } diff --git a/src/components/Blazor/Step.cs b/src/components/Blazor/Step.cs index cee77494..221cdbdf 100644 --- a/src/components/Blazor/Step.cs +++ b/src/components/Blazor/Step.cs @@ -1,209 +1,219 @@ - -using System; using Microsoft.AspNetCore.Components; -using Microsoft.AspNetCore.Components.Rendering; -using System.Threading.Tasks; -using System.Collections.Generic; -using System.Linq; namespace IgniteUI.Blazor.Controls { - /// -/// A step component used within an `igc-stepper` to represent an individual step in a wizard-like workflow. -/// -public partial class IgbStep: BaseRendererControl { - public override string Type { get { return "WebStep"; } } - - protected override void EnsureModulesLoaded() - { - if (!IgbStepModule.IsLoadRequested(IgBlazor)) - { - IgbStepModule.Register(IgBlazor); - } - } - - protected override string ResolveDisplay() - { - return "inline-block"; - } - - protected override bool SupportsVisualChildren - { - get - { - return true; - } - } - - protected override bool UseDirectRender - { - get - { - return true; - } - } - - protected override string DirectRenderElementName - { - get - { - return "igc-step"; - } - } - - protected override ControlEventBehavior DefaultEventBehavior - { - get { return ControlEventBehavior.Immediate; } - } - - public IgbStep(): base() { - OnCreatedIgbStep(); - - - } - - partial void OnCreatedIgbStep(); - - private bool _invalid = false; - - partial void OnInvalidChanging(ref bool newValue); - /// - /// Whether the step is invalid. - /// Invalid steps are styled with an error state and are not - /// interactive when the stepper is in linear mode. - /// - [Parameter] - public bool Invalid - { - get { return this._invalid; } - set { - if (this._invalid != value || !IsPropDirty("Invalid")) { - MarkPropDirty("Invalid"); - } - this._invalid = value; - - } - } - private bool _active = false; - - partial void OnActiveChanging(ref bool newValue); - /// - /// Whether the step is active. - /// Active steps are styled with an active state and their content is visible. - /// - [Parameter] - public bool Active - { - get { return this._active; } - set { - if (this._active != value || !IsPropDirty("Active")) { - MarkPropDirty("Active"); - } - this._active = value; - - } - } - private bool _optional = false; - - partial void OnOptionalChanging(ref bool newValue); - /// - /// Whether the step is optional. - /// Optional steps validity does not affect the default behavior when the stepper is in linear mode i.e. - /// if optional step is invalid the user could still move to the next step. - /// - [Parameter] - public bool Optional - { - get { return this._optional; } - set { - if (this._optional != value || !IsPropDirty("Optional")) { - MarkPropDirty("Optional"); - } - this._optional = value; - - } - } - private bool _disabled = false; - - partial void OnDisabledChanging(ref bool newValue); - /// - /// Whether the step is disabled. - /// Disabled steps are styled with a disabled state and are not interactive. - /// - [Parameter] - public bool Disabled - { - get { return this._disabled; } - set { - if (this._disabled != value || !IsPropDirty("Disabled")) { - MarkPropDirty("Disabled"); - } - this._disabled = value; - - } - } - private bool _complete = false; - - partial void OnCompleteChanging(ref bool newValue); - /// - /// Whether the step is completed. - /// - [Parameter] - public bool Complete - { - get { return this._complete; } - set { - if (this._complete != value || !IsPropDirty("Complete")) { - MarkPropDirty("Complete"); - } - this._complete = value; - - } - } - - partial void FindByNameStep(string name, ref object item); - public override object FindByName(string name) - { - - var baseResult = base.FindByName(name); - if (baseResult != null) - { - return baseResult; - } - - object item = null; - FindByNameStep(name, ref item); - if (item != null) - { - return item; - } - - return null; - } - public async Task SetNativeElementAsync(Object element) - { - await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); - } - public void SetNativeElement(Object element) - { - InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); - } - - partial void SerializeCoreIgbStep(RendererSerializer ser); - - internal override void SerializeCore(RendererSerializer ser) - { - base.SerializeCore(ser); - - SerializeCoreIgbStep(ser); - - if (IsPropDirty("Invalid")) { ser.AddBooleanProp("invalid", this._invalid); } - if (IsPropDirty("Active")) { ser.AddBooleanProp("active", this._active); } - if (IsPropDirty("Optional")) { ser.AddBooleanProp("optional", this._optional); } - if (IsPropDirty("Disabled")) { ser.AddBooleanProp("disabled", this._disabled); } - if (IsPropDirty("Complete")) { ser.AddBooleanProp("complete", this._complete); } - - } - -} + /// + /// A step component used within an `igc-stepper` to represent an individual step in a wizard-like workflow. + /// + public partial class IgbStep : BaseRendererControl + { + public override string Type { get { return "WebStep"; } } + + protected override void EnsureModulesLoaded() + { + if (!IgbStepModule.IsLoadRequested(IgBlazor)) + { + IgbStepModule.Register(IgBlazor); + } + } + + protected override string ResolveDisplay() + { + return "inline-block"; + } + + protected override bool SupportsVisualChildren + { + get + { + return true; + } + } + + protected override bool UseDirectRender + { + get + { + return true; + } + } + + protected override string DirectRenderElementName + { + get + { + return "igc-step"; + } + } + + protected override ControlEventBehavior DefaultEventBehavior + { + get { return ControlEventBehavior.Immediate; } + } + + public IgbStep() : base() + { + OnCreatedIgbStep(); + + } + + partial void OnCreatedIgbStep(); + + private bool _invalid = false; + + partial void OnInvalidChanging(ref bool newValue); + /// + /// Whether the step is invalid. + /// Invalid steps are styled with an error state and are not + /// interactive when the stepper is in linear mode. + /// + [Parameter] + public bool Invalid + { + get { return this._invalid; } + set + { + if (this._invalid != value || !IsPropDirty("Invalid")) + { + MarkPropDirty("Invalid"); + } + this._invalid = value; + + } + } + private bool _active = false; + + partial void OnActiveChanging(ref bool newValue); + /// + /// Whether the step is active. + /// Active steps are styled with an active state and their content is visible. + /// + [Parameter] + public bool Active + { + get { return this._active; } + set + { + if (this._active != value || !IsPropDirty("Active")) + { + MarkPropDirty("Active"); + } + this._active = value; + + } + } + private bool _optional = false; + + partial void OnOptionalChanging(ref bool newValue); + /// + /// Whether the step is optional. + /// Optional steps validity does not affect the default behavior when the stepper is in linear mode i.e. + /// if optional step is invalid the user could still move to the next step. + /// + [Parameter] + public bool Optional + { + get { return this._optional; } + set + { + if (this._optional != value || !IsPropDirty("Optional")) + { + MarkPropDirty("Optional"); + } + this._optional = value; + + } + } + private bool _disabled = false; + + partial void OnDisabledChanging(ref bool newValue); + /// + /// Whether the step is disabled. + /// Disabled steps are styled with a disabled state and are not interactive. + /// + [Parameter] + public bool Disabled + { + get { return this._disabled; } + set + { + if (this._disabled != value || !IsPropDirty("Disabled")) + { + MarkPropDirty("Disabled"); + } + this._disabled = value; + + } + } + private bool _complete = false; + + partial void OnCompleteChanging(ref bool newValue); + /// + /// Whether the step is completed. + /// + [Parameter] + public bool Complete + { + get { return this._complete; } + set + { + if (this._complete != value || !IsPropDirty("Complete")) + { + MarkPropDirty("Complete"); + } + this._complete = value; + + } + } + + partial void FindByNameStep(string name, ref object item); + public override object FindByName(string name) + { + + var baseResult = base.FindByName(name); + if (baseResult != null) + { + return baseResult; + } + + object item = null; + FindByNameStep(name, ref item); + if (item != null) + { + return item; + } + + return null; + } + public async Task SetNativeElementAsync(Object element) + { + await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + } + public void SetNativeElement(Object element) + { + InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + } + + partial void SerializeCoreIgbStep(RendererSerializer ser); + + internal override void SerializeCore(RendererSerializer ser) + { + base.SerializeCore(ser); + + SerializeCoreIgbStep(ser); + + if (IsPropDirty("Invalid")) + { ser.AddBooleanProp("invalid", this._invalid); } + if (IsPropDirty("Active")) + { ser.AddBooleanProp("active", this._active); } + if (IsPropDirty("Optional")) + { ser.AddBooleanProp("optional", this._optional); } + if (IsPropDirty("Disabled")) + { ser.AddBooleanProp("disabled", this._disabled); } + if (IsPropDirty("Complete")) + { ser.AddBooleanProp("complete", this._complete); } + + } + + } } diff --git a/src/components/Blazor/StepModule.cs b/src/components/Blazor/StepModule.cs index 140c2559..4bbdf108 100644 --- a/src/components/Blazor/StepModule.cs +++ b/src/components/Blazor/StepModule.cs @@ -1,23 +1,20 @@ -using System; -using System.Collections.Generic; -using System.Runtime.CompilerServices; -using System.Text; -using System.Collections.Generic; - namespace IgniteUI.Blazor.Controls { - public partial class IgbStepModule { - public static void Register(IIgniteUIBlazor runtime) { + public partial class IgbStepModule + { + public static void Register(IIgniteUIBlazor runtime) + { ModuleLoader.Load(runtime, "WebStepModule"); - } - public static void MarkIsLoadRequested(IIgniteUIBlazor runtime) { + public static void MarkIsLoadRequested(IIgniteUIBlazor runtime) + { ModuleLoader.MarkIsLoadRequested(runtime, "WebStepModule"); } - public static bool IsLoadRequested(IIgniteUIBlazor runtime) { + public static bool IsLoadRequested(IIgniteUIBlazor runtime) + { return ModuleLoader.IsLoadRequested(runtime, "WebStepModule"); } } diff --git a/src/components/Blazor/Stepper.cs b/src/components/Blazor/Stepper.cs index 1a2d14b2..766b1437 100644 --- a/src/components/Blazor/Stepper.cs +++ b/src/components/Blazor/Stepper.cs @@ -1,458 +1,489 @@ - -using System; using Microsoft.AspNetCore.Components; -using Microsoft.AspNetCore.Components.Rendering; -using System.Threading.Tasks; -using System.Collections.Generic; -using System.Linq; namespace IgniteUI.Blazor.Controls { - /// -/// A stepper component that provides a wizard-like workflow by dividing content into logical steps. -/// -public partial class IgbStepper: BaseRendererControl { - public override string Type { get { return "WebStepper"; } } - - protected override void EnsureModulesLoaded() - { - if (!IgbStepperModule.IsLoadRequested(IgBlazor)) - { - IgbStepperModule.Register(IgBlazor); - } - } - - protected override string ResolveDisplay() + /// + /// A stepper component that provides a wizard-like workflow by dividing content into logical steps. + /// + public partial class IgbStepper : BaseRendererControl + { + public override string Type { get { return "WebStepper"; } } + + protected override void EnsureModulesLoaded() + { + if (!IgbStepperModule.IsLoadRequested(IgBlazor)) + { + IgbStepperModule.Register(IgBlazor); + } + } + + protected override string ResolveDisplay() + { + return "inline-block"; + } + + protected override bool SupportsVisualChildren + { + get + { + return true; + } + } + + protected override bool UseDirectRender + { + get + { + return true; + } + } + + protected override string DirectRenderElementName + { + get + { + return "igc-stepper"; + } + } + + protected override ControlEventBehavior DefaultEventBehavior + { + get { return ControlEventBehavior.Immediate; } + } + + public IgbStepper() : base() + { + OnCreatedIgbStepper(); + + } + + partial void OnCreatedIgbStepper(); + + public async Task GetStepsAsync() + { + var iv = await InvokeMethod("p:Steps", new object[] { }, new string[] { }); + + if (iv == null) + { + return default(IgbStep[]); + } + var retVal = ReturnToObjectArray(iv); + if (retVal == null) + { + return default(IgbStep[]); + } + return retVal; + + } + public IgbStep[] GetSteps() + { + var iv = InvokeMethodSync("p:Steps", new object[] { }, new string[] { }); + + if (iv == null) + { + return default(IgbStep[]); + } + var retVal = ReturnToObjectArray(iv); + if (retVal == null) + { + return default(IgbStep[]); + } + return retVal; + + } + private StepperOrientation _orientation = StepperOrientation.Horizontal; + + partial void OnOrientationChanging(ref StepperOrientation newValue); + /// + /// The orientation of the stepper. + /// + [Parameter] + public StepperOrientation Orientation + { + get { return this._orientation; } + set + { + if (this._orientation != value || !IsPropDirty("Orientation")) + { + MarkPropDirty("Orientation"); + } + this._orientation = value; + + } + } + private StepperStepType _stepType = StepperStepType.Full; + + partial void OnStepTypeChanging(ref StepperStepType newValue); + /// + /// The visual type of the steps. + /// + [Parameter] + public StepperStepType StepType + { + get { return this._stepType; } + set + { + if (this._stepType != value || !IsPropDirty("StepType")) + { + MarkPropDirty("StepType"); + } + this._stepType = value; + + } + } + private bool _linear = false; + + partial void OnLinearChanging(ref bool newValue); + /// + /// Whether the stepper is linear. + /// + [Parameter] + public bool Linear + { + get { return this._linear; } + set + { + if (this._linear != value || !IsPropDirty("Linear")) + { + MarkPropDirty("Linear"); + } + this._linear = value; + + } + } + private bool _contentTop = false; + + partial void OnContentTopChanging(ref bool newValue); + /// + /// Whether the content is displayed above the steps. + /// + [Parameter] + public bool ContentTop + { + get { return this._contentTop; } + set + { + if (this._contentTop != value || !IsPropDirty("ContentTop")) + { + MarkPropDirty("ContentTop"); + } + this._contentTop = value; + + } + } + private StepperVerticalAnimation _verticalAnimation = StepperVerticalAnimation.Grow; + + partial void OnVerticalAnimationChanging(ref StepperVerticalAnimation newValue); + /// + /// The animation type when in vertical mode. + /// + [Parameter] + public StepperVerticalAnimation VerticalAnimation + { + get { return this._verticalAnimation; } + set + { + if (this._verticalAnimation != value || !IsPropDirty("VerticalAnimation")) + { + MarkPropDirty("VerticalAnimation"); + } + this._verticalAnimation = value; + + } + } + private HorizontalTransitionAnimation _horizontalAnimation = HorizontalTransitionAnimation.Slide; + + partial void OnHorizontalAnimationChanging(ref HorizontalTransitionAnimation newValue); + /// + /// The animation type when in horizontal mode. + /// + [Parameter] + public HorizontalTransitionAnimation HorizontalAnimation + { + get { return this._horizontalAnimation; } + set + { + if (this._horizontalAnimation != value || !IsPropDirty("HorizontalAnimation")) + { + MarkPropDirty("HorizontalAnimation"); + } + this._horizontalAnimation = value; + + } + } + private double _animationDuration = 0; + + partial void OnAnimationDurationChanging(ref double newValue); + /// + /// The animation duration in either vertical or horizontal mode in milliseconds. + /// + [Parameter] + public double AnimationDuration + { + get { return this._animationDuration; } + set + { + if (this._animationDuration != value || !IsPropDirty("AnimationDuration")) + { + MarkPropDirty("AnimationDuration"); + } + this._animationDuration = value; + + } + } + private StepperTitlePosition _titlePosition = StepperTitlePosition.Auto; + + partial void OnTitlePositionChanging(ref StepperTitlePosition newValue); + /// + /// The position of the steps title. + /// + [Parameter] + public StepperTitlePosition TitlePosition + { + get { return this._titlePosition; } + set + { + if (this._titlePosition != value || !IsPropDirty("TitlePosition")) + { + MarkPropDirty("TitlePosition"); + } + this._titlePosition = value; + + } + } + + partial void FindByNameStepper(string name, ref object item); + public override object FindByName(string name) + { + + var baseResult = base.FindByName(name); + if (baseResult != null) + { + return baseResult; + } + + object item = null; + FindByNameStepper(name, ref item); + if (item != null) + { + return item; + } + + return null; + } + public async Task SetNativeElementAsync(Object element) + { + await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + } + public void SetNativeElement(Object element) + { + InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + } + /// + /// Activates the step at a given index. + /// + public async Task NavigateToAsync(double index) + { + await InvokeMethod("navigateTo", new object[] { index }, new string[] { "Number" }); + } + public void NavigateTo(double index) + { + InvokeMethodSync("navigateTo", new object[] { index }, new string[] { "Number" }); + } + /// + /// Activates the next enabled step. + /// + public async Task NextAsync() + { + await InvokeMethod("next", new object[] { }, new string[] { }); + } + public void Next() + { + InvokeMethodSync("next", new object[] { }, new string[] { }); + } + /// + /// Activates the previous enabled step. + /// + public async Task PrevAsync() + { + await InvokeMethod("prev", new object[] { }, new string[] { }); + } + public void Prev() + { + InvokeMethodSync("prev", new object[] { }, new string[] { }); + } + /// + /// Resets the stepper to its initial state i.e. activates the first step. + /// + public async Task ResetAsync() + { + await InvokeMethod("reset", new object[] { }, new string[] { }); + } + public void Reset() + { + InvokeMethodSync("reset", new object[] { }, new string[] { }); + } + + private string _activeStepChangingRef = null; + private string _activeStepChangingScript = null; + [Parameter] + public string ActiveStepChangingScript + { + + set + { + if (value != this._activeStepChangingScript) + { + this._activeStepChangingScript = value; + this.OnRefChanged("ActiveStepChanging", null, value, true, false, (string refName, object oldValue, object newValue) => + { + this._activeStepChangingRef = refName; + this.MarkPropDirty("ActiveStepChangingRef"); + }); + } + } + get + { + return this._activeStepChangingScript; + } + } + + partial void OnHandlingActiveStepChanging(IgbActiveStepChangingEventArgs args); + private EventCallback? _activeStepChanging = null; + [Parameter] + public EventCallback ActiveStepChanging + { + get + { + return this._activeStepChanging != null ? this._activeStepChanging.Value : EventCallback.Empty; + } + set + { + if (!value.Equals(EventCallback.Empty)) + { + if (!CompareEventCallbacks(value, _activeStepChanging, ref eventCallbacksCache)) + { + _activeStepChanging = value; + this.SetHandler(this.Name, "ActiveStepChanging", value, (args) => { - return "inline-block"; - } + OnHandlingActiveStepChanging(args); - protected override bool SupportsVisualChildren + }); + this.OnRefChanged("ActiveStepChanging", null, "event:::ActiveStepChanging", true, false, (refName, oldValue, newValue) => { - get - { - return true; - } - } + this._activeStepChangingRef = refName; + this.MarkPropDirty("ActiveStepChangingRef"); + }); + } + } + else + { + _activeStepChanging = null; + this.SetHandler(this.Name, "ActiveStepChanging", null); + this.OnRefChanged("ActiveStepChanging", null, null, true, false, (refName, oldValue, newValue) => + { + this._activeStepChangingRef = null; + this.MarkPropDirty("ActiveStepChangingRef"); + }); + } + } + } + + private string _activeStepChangedRef = null; + private string _activeStepChangedScript = null; + [Parameter] + public string ActiveStepChangedScript + { - protected override bool UseDirectRender + set + { + if (value != this._activeStepChangedScript) + { + this._activeStepChangedScript = value; + this.OnRefChanged("ActiveStepChanged", null, value, true, false, (string refName, object oldValue, object newValue) => + { + this._activeStepChangedRef = refName; + this.MarkPropDirty("ActiveStepChangedRef"); + }); + } + } + get + { + return this._activeStepChangedScript; + } + } + + partial void OnHandlingActiveStepChanged(IgbActiveStepChangedEventArgs args); + private EventCallback? _activeStepChanged = null; + [Parameter] + public EventCallback ActiveStepChanged + { + get + { + return this._activeStepChanged != null ? this._activeStepChanged.Value : EventCallback.Empty; + } + set + { + if (!value.Equals(EventCallback.Empty)) + { + if (!CompareEventCallbacks(value, _activeStepChanged, ref eventCallbacksCache)) + { + _activeStepChanged = value; + this.SetHandler(this.Name, "ActiveStepChanged", value, (args) => { - get - { - return true; - } - } + OnHandlingActiveStepChanged(args); - protected override string DirectRenderElementName + }); + this.OnRefChanged("ActiveStepChanged", null, "event:::ActiveStepChanged", true, false, (refName, oldValue, newValue) => { - get - { - return "igc-stepper"; - } - } - - protected override ControlEventBehavior DefaultEventBehavior - { - get { return ControlEventBehavior.Immediate; } - } - - public IgbStepper(): base() { - OnCreatedIgbStepper(); - - - } - - partial void OnCreatedIgbStepper(); - - public async Task GetStepsAsync() - { - var iv = await InvokeMethod("p:Steps", new object[] { }, new string[] { }); - - if (iv == null) - { - return default(IgbStep[]); - } - var retVal = ReturnToObjectArray(iv); - if (retVal == null) - { - return default(IgbStep[]); - } - return retVal; - - } - public IgbStep[] GetSteps() - { - var iv = InvokeMethodSync("p:Steps", new object[] { }, new string[] { }); - - if (iv == null) - { - return default(IgbStep[]); - } - var retVal = ReturnToObjectArray(iv); - if (retVal == null) - { - return default(IgbStep[]); - } - return retVal; - - } - private StepperOrientation _orientation = StepperOrientation.Horizontal; - - partial void OnOrientationChanging(ref StepperOrientation newValue); - /// - /// The orientation of the stepper. - /// - [Parameter] - public StepperOrientation Orientation - { - get { return this._orientation; } - set { - if (this._orientation != value || !IsPropDirty("Orientation")) { - MarkPropDirty("Orientation"); - } - this._orientation = value; - - } - } - private StepperStepType _stepType = StepperStepType.Full; - - partial void OnStepTypeChanging(ref StepperStepType newValue); - /// - /// The visual type of the steps. - /// - [Parameter] - public StepperStepType StepType - { - get { return this._stepType; } - set { - if (this._stepType != value || !IsPropDirty("StepType")) { - MarkPropDirty("StepType"); - } - this._stepType = value; - - } - } - private bool _linear = false; - - partial void OnLinearChanging(ref bool newValue); - /// - /// Whether the stepper is linear. - /// - [Parameter] - public bool Linear - { - get { return this._linear; } - set { - if (this._linear != value || !IsPropDirty("Linear")) { - MarkPropDirty("Linear"); - } - this._linear = value; - - } - } - private bool _contentTop = false; - - partial void OnContentTopChanging(ref bool newValue); - /// - /// Whether the content is displayed above the steps. - /// - [Parameter] - public bool ContentTop - { - get { return this._contentTop; } - set { - if (this._contentTop != value || !IsPropDirty("ContentTop")) { - MarkPropDirty("ContentTop"); - } - this._contentTop = value; - - } - } - private StepperVerticalAnimation _verticalAnimation = StepperVerticalAnimation.Grow; - - partial void OnVerticalAnimationChanging(ref StepperVerticalAnimation newValue); - /// - /// The animation type when in vertical mode. - /// - [Parameter] - public StepperVerticalAnimation VerticalAnimation - { - get { return this._verticalAnimation; } - set { - if (this._verticalAnimation != value || !IsPropDirty("VerticalAnimation")) { - MarkPropDirty("VerticalAnimation"); - } - this._verticalAnimation = value; - - } - } - private HorizontalTransitionAnimation _horizontalAnimation = HorizontalTransitionAnimation.Slide; - - partial void OnHorizontalAnimationChanging(ref HorizontalTransitionAnimation newValue); - /// - /// The animation type when in horizontal mode. - /// - [Parameter] - public HorizontalTransitionAnimation HorizontalAnimation - { - get { return this._horizontalAnimation; } - set { - if (this._horizontalAnimation != value || !IsPropDirty("HorizontalAnimation")) { - MarkPropDirty("HorizontalAnimation"); - } - this._horizontalAnimation = value; - - } - } - private double _animationDuration = 0; - - partial void OnAnimationDurationChanging(ref double newValue); - /// - /// The animation duration in either vertical or horizontal mode in milliseconds. - /// - [Parameter] - public double AnimationDuration - { - get { return this._animationDuration; } - set { - if (this._animationDuration != value || !IsPropDirty("AnimationDuration")) { - MarkPropDirty("AnimationDuration"); - } - this._animationDuration = value; - - } - } - private StepperTitlePosition _titlePosition = StepperTitlePosition.Auto; - - partial void OnTitlePositionChanging(ref StepperTitlePosition newValue); - /// - /// The position of the steps title. - /// - [Parameter] - public StepperTitlePosition TitlePosition - { - get { return this._titlePosition; } - set { - if (this._titlePosition != value || !IsPropDirty("TitlePosition")) { - MarkPropDirty("TitlePosition"); - } - this._titlePosition = value; - - } - } - - partial void FindByNameStepper(string name, ref object item); - public override object FindByName(string name) - { - - var baseResult = base.FindByName(name); - if (baseResult != null) - { - return baseResult; - } - - object item = null; - FindByNameStepper(name, ref item); - if (item != null) - { - return item; - } - - return null; - } - public async Task SetNativeElementAsync(Object element) - { - await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); - } - public void SetNativeElement(Object element) - { - InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); - } - /// - /// Activates the step at a given index. - /// - public async Task NavigateToAsync(double index) - { - await InvokeMethod("navigateTo", new object[] { index }, new string[] { "Number" }); - } - public void NavigateTo(double index) - { - InvokeMethodSync("navigateTo", new object[] { index }, new string[] { "Number" }); - } - /// - /// Activates the next enabled step. - /// - public async Task NextAsync() - { - await InvokeMethod("next", new object[] { }, new string[] { }); - } - public void Next() - { - InvokeMethodSync("next", new object[] { }, new string[] { }); - } - /// - /// Activates the previous enabled step. - /// - public async Task PrevAsync() - { - await InvokeMethod("prev", new object[] { }, new string[] { }); - } - public void Prev() - { - InvokeMethodSync("prev", new object[] { }, new string[] { }); - } - /// - /// Resets the stepper to its initial state i.e. activates the first step. - /// - public async Task ResetAsync() - { - await InvokeMethod("reset", new object[] { }, new string[] { }); - } - public void Reset() - { - InvokeMethodSync("reset", new object[] { }, new string[] { }); - } - - private string _activeStepChangingRef = null; - private string _activeStepChangingScript = null; - [Parameter] - public string ActiveStepChangingScript { - - set - { - if (value != this._activeStepChangingScript) - { - this._activeStepChangingScript = value; - this.OnRefChanged("ActiveStepChanging", null, value, true, false, (string refName, object oldValue, object newValue) => { - this._activeStepChangingRef = refName; - this.MarkPropDirty("ActiveStepChangingRef"); - }); - } - } - get - { - return this._activeStepChangingScript; - } - } - - partial void OnHandlingActiveStepChanging(IgbActiveStepChangingEventArgs args); - private EventCallback? _activeStepChanging = null; - [Parameter] - public EventCallback ActiveStepChanging - { - get - { - return this._activeStepChanging != null ? this._activeStepChanging.Value : EventCallback.Empty; - } - set - { - if (!value.Equals(EventCallback.Empty)) - { - if (!CompareEventCallbacks(value, _activeStepChanging, ref eventCallbacksCache)) - { - _activeStepChanging = value; - this.SetHandler(this.Name, "ActiveStepChanging", value, (args) => { - OnHandlingActiveStepChanging(args); - - }); - this.OnRefChanged("ActiveStepChanging", null, "event:::ActiveStepChanging", true, false, (refName, oldValue, newValue) => { - this._activeStepChangingRef = refName; - this.MarkPropDirty("ActiveStepChangingRef"); - }); - } - } - else - { - _activeStepChanging = null; - this.SetHandler(this.Name, "ActiveStepChanging", null); - this.OnRefChanged("ActiveStepChanging", null, null, true, false, (refName, oldValue, newValue) => { - this._activeStepChangingRef = null; - this.MarkPropDirty("ActiveStepChangingRef"); - }); - } - } - } - - private string _activeStepChangedRef = null; - private string _activeStepChangedScript = null; - [Parameter] - public string ActiveStepChangedScript { - - set - { - if (value != this._activeStepChangedScript) - { - this._activeStepChangedScript = value; - this.OnRefChanged("ActiveStepChanged", null, value, true, false, (string refName, object oldValue, object newValue) => { - this._activeStepChangedRef = refName; - this.MarkPropDirty("ActiveStepChangedRef"); - }); - } - } - get - { - return this._activeStepChangedScript; - } - } - - partial void OnHandlingActiveStepChanged(IgbActiveStepChangedEventArgs args); - private EventCallback? _activeStepChanged = null; - [Parameter] - public EventCallback ActiveStepChanged - { - get - { - return this._activeStepChanged != null ? this._activeStepChanged.Value : EventCallback.Empty; - } - set - { - if (!value.Equals(EventCallback.Empty)) - { - if (!CompareEventCallbacks(value, _activeStepChanged, ref eventCallbacksCache)) - { - _activeStepChanged = value; - this.SetHandler(this.Name, "ActiveStepChanged", value, (args) => { - OnHandlingActiveStepChanged(args); - - }); - this.OnRefChanged("ActiveStepChanged", null, "event:::ActiveStepChanged", true, false, (refName, oldValue, newValue) => { - this._activeStepChangedRef = refName; - this.MarkPropDirty("ActiveStepChangedRef"); - }); - } - } - else - { - _activeStepChanged = null; - this.SetHandler(this.Name, "ActiveStepChanged", null); - this.OnRefChanged("ActiveStepChanged", null, null, true, false, (refName, oldValue, newValue) => { - this._activeStepChangedRef = null; - this.MarkPropDirty("ActiveStepChangedRef"); - }); - } - } - } - - partial void SerializeCoreIgbStepper(RendererSerializer ser); - - internal override void SerializeCore(RendererSerializer ser) - { - base.SerializeCore(ser); - - SerializeCoreIgbStepper(ser); - - if (IsPropDirty("Orientation")) { ser.AddEnumProp("orientation", this._orientation); } - if (IsPropDirty("StepType")) { ser.AddEnumProp("stepType", this._stepType); } - if (IsPropDirty("Linear")) { ser.AddBooleanProp("linear", this._linear); } - if (IsPropDirty("ContentTop")) { ser.AddBooleanProp("contentTop", this._contentTop); } - if (IsPropDirty("VerticalAnimation")) { ser.AddEnumProp("verticalAnimation", this._verticalAnimation); } - if (IsPropDirty("HorizontalAnimation")) { ser.AddEnumProp("horizontalAnimation", this._horizontalAnimation); } - if (IsPropDirty("AnimationDuration")) { ser.AddNumberProp("animationDuration", this._animationDuration); } - if (IsPropDirty("TitlePosition")) { ser.AddEnumProp("titlePosition", this._titlePosition); } - if (IsPropDirty("ActiveStepChangingRef")) { ser.AddStringProp("activeStepChangingRef", this._activeStepChangingRef); } - if (IsPropDirty("ActiveStepChangedRef")) { ser.AddStringProp("activeStepChangedRef", this._activeStepChangedRef); } - - } - -} + this._activeStepChangedRef = refName; + this.MarkPropDirty("ActiveStepChangedRef"); + }); + } + } + else + { + _activeStepChanged = null; + this.SetHandler(this.Name, "ActiveStepChanged", null); + this.OnRefChanged("ActiveStepChanged", null, null, true, false, (refName, oldValue, newValue) => + { + this._activeStepChangedRef = null; + this.MarkPropDirty("ActiveStepChangedRef"); + }); + } + } + } + + partial void SerializeCoreIgbStepper(RendererSerializer ser); + + internal override void SerializeCore(RendererSerializer ser) + { + base.SerializeCore(ser); + + SerializeCoreIgbStepper(ser); + + if (IsPropDirty("Orientation")) + { ser.AddEnumProp("orientation", this._orientation); } + if (IsPropDirty("StepType")) + { ser.AddEnumProp("stepType", this._stepType); } + if (IsPropDirty("Linear")) + { ser.AddBooleanProp("linear", this._linear); } + if (IsPropDirty("ContentTop")) + { ser.AddBooleanProp("contentTop", this._contentTop); } + if (IsPropDirty("VerticalAnimation")) + { ser.AddEnumProp("verticalAnimation", this._verticalAnimation); } + if (IsPropDirty("HorizontalAnimation")) + { ser.AddEnumProp("horizontalAnimation", this._horizontalAnimation); } + if (IsPropDirty("AnimationDuration")) + { ser.AddNumberProp("animationDuration", this._animationDuration); } + if (IsPropDirty("TitlePosition")) + { ser.AddEnumProp("titlePosition", this._titlePosition); } + if (IsPropDirty("ActiveStepChangingRef")) + { ser.AddStringProp("activeStepChangingRef", this._activeStepChangingRef); } + if (IsPropDirty("ActiveStepChangedRef")) + { ser.AddStringProp("activeStepChangedRef", this._activeStepChangedRef); } + + } + + } } diff --git a/src/components/Blazor/StepperModule.cs b/src/components/Blazor/StepperModule.cs index 94693201..fe67c5d5 100644 --- a/src/components/Blazor/StepperModule.cs +++ b/src/components/Blazor/StepperModule.cs @@ -1,24 +1,22 @@ -using System; -using System.Collections.Generic; -using System.Runtime.CompilerServices; -using System.Text; -using System.Collections.Generic; - namespace IgniteUI.Blazor.Controls { - public partial class IgbStepperModule { - public static void Register(IIgniteUIBlazor runtime) { + public partial class IgbStepperModule + { + public static void Register(IIgniteUIBlazor runtime) + { ModuleLoader.Load(runtime, "WebStepperModule"); IgbStepModule.MarkIsLoadRequested(runtime); } - public static void MarkIsLoadRequested(IIgniteUIBlazor runtime) { + public static void MarkIsLoadRequested(IIgniteUIBlazor runtime) + { ModuleLoader.MarkIsLoadRequested(runtime, "WebStepperModule"); } - public static bool IsLoadRequested(IIgniteUIBlazor runtime) { + public static bool IsLoadRequested(IIgniteUIBlazor runtime) + { return ModuleLoader.IsLoadRequested(runtime, "WebStepperModule"); } } diff --git a/src/components/Blazor/StepperOrientation.cs b/src/components/Blazor/StepperOrientation.cs index 225fb515..26396ced 100644 --- a/src/components/Blazor/StepperOrientation.cs +++ b/src/components/Blazor/StepperOrientation.cs @@ -1,8 +1,9 @@ namespace IgniteUI.Blazor.Controls { -public enum StepperOrientation { - Horizontal, - Vertical + public enum StepperOrientation + { + Horizontal, + Vertical -} + } } diff --git a/src/components/Blazor/StepperStepType.cs b/src/components/Blazor/StepperStepType.cs index 2063f239..b337675b 100644 --- a/src/components/Blazor/StepperStepType.cs +++ b/src/components/Blazor/StepperStepType.cs @@ -1,9 +1,10 @@ namespace IgniteUI.Blazor.Controls { -public enum StepperStepType { - Full, - Indicator, - Title + public enum StepperStepType + { + Full, + Indicator, + Title -} + } } diff --git a/src/components/Blazor/StepperTitlePosition.cs b/src/components/Blazor/StepperTitlePosition.cs index 625c6f7e..3dc07af7 100644 --- a/src/components/Blazor/StepperTitlePosition.cs +++ b/src/components/Blazor/StepperTitlePosition.cs @@ -1,11 +1,12 @@ namespace IgniteUI.Blazor.Controls { -public enum StepperTitlePosition { - Auto, - Bottom, - Top, - End, - Start + public enum StepperTitlePosition + { + Auto, + Bottom, + Top, + End, + Start -} + } } diff --git a/src/components/Blazor/StepperVerticalAnimation.cs b/src/components/Blazor/StepperVerticalAnimation.cs index 3a36e724..af818cc5 100644 --- a/src/components/Blazor/StepperVerticalAnimation.cs +++ b/src/components/Blazor/StepperVerticalAnimation.cs @@ -1,9 +1,10 @@ namespace IgniteUI.Blazor.Controls { -public enum StepperVerticalAnimation { - Grow, - Fade, - None + public enum StepperVerticalAnimation + { + Grow, + Fade, + None -} + } } diff --git a/src/components/Blazor/StyleVariant.cs b/src/components/Blazor/StyleVariant.cs index 5c10d2aa..37700e76 100644 --- a/src/components/Blazor/StyleVariant.cs +++ b/src/components/Blazor/StyleVariant.cs @@ -1,11 +1,12 @@ namespace IgniteUI.Blazor.Controls { -public enum StyleVariant { - Primary, - Info, - Success, - Warning, - Danger + public enum StyleVariant + { + Primary, + Info, + Success, + Warning, + Danger -} + } } diff --git a/src/components/Blazor/Switch.cs b/src/components/Blazor/Switch.cs index c289d406..f1a3dc19 100644 --- a/src/components/Blazor/Switch.cs +++ b/src/components/Blazor/Switch.cs @@ -1,95 +1,86 @@ - -using System; -using Microsoft.AspNetCore.Components; -using Microsoft.AspNetCore.Components.Rendering; -using System.Threading.Tasks; -using System.Collections.Generic; -using System.Linq; - namespace IgniteUI.Blazor.Controls { - /// -/// Similar to a checkbox, a switch controls the state of a single setting on or off. -/// -public partial class IgbSwitch: IgbCheckboxBase { - public override string Type { get { return "WebSwitch"; } } - - protected override void EnsureModulesLoaded() - { - if (!IgbSwitchModule.IsLoadRequested(IgBlazor)) - { - IgbSwitchModule.Register(IgBlazor); - } - } - - protected override string ResolveDisplay() - { - return "inline-block"; - } - - protected override bool SupportsVisualChildren - { - get - { - return true; - } - } - - protected override bool UseDirectRender - { - get - { - return true; - } - } - - protected override string DirectRenderElementName - { - get - { - return "igc-switch"; - } - } - - public IgbSwitch(): base() { - OnCreatedIgbSwitch(); - - - } - - partial void OnCreatedIgbSwitch(); - - - partial void FindByNameSwitch(string name, ref object item); - public override object FindByName(string name) - { - - var baseResult = base.FindByName(name); - if (baseResult != null) - { - return baseResult; - } - - object item = null; - FindByNameSwitch(name, ref item); - if (item != null) - { - return item; - } - - return null; - } - - partial void SerializeCoreIgbSwitch(RendererSerializer ser); - - internal override void SerializeCore(RendererSerializer ser) - { - base.SerializeCore(ser); - - SerializeCoreIgbSwitch(ser); - - - } - -} + /// + /// Similar to a checkbox, a switch controls the state of a single setting on or off. + /// + public partial class IgbSwitch : IgbCheckboxBase + { + public override string Type { get { return "WebSwitch"; } } + + protected override void EnsureModulesLoaded() + { + if (!IgbSwitchModule.IsLoadRequested(IgBlazor)) + { + IgbSwitchModule.Register(IgBlazor); + } + } + + protected override string ResolveDisplay() + { + return "inline-block"; + } + + protected override bool SupportsVisualChildren + { + get + { + return true; + } + } + + protected override bool UseDirectRender + { + get + { + return true; + } + } + + protected override string DirectRenderElementName + { + get + { + return "igc-switch"; + } + } + + public IgbSwitch() : base() + { + OnCreatedIgbSwitch(); + + } + + partial void OnCreatedIgbSwitch(); + + partial void FindByNameSwitch(string name, ref object item); + public override object FindByName(string name) + { + + var baseResult = base.FindByName(name); + if (baseResult != null) + { + return baseResult; + } + + object item = null; + FindByNameSwitch(name, ref item); + if (item != null) + { + return item; + } + + return null; + } + + partial void SerializeCoreIgbSwitch(RendererSerializer ser); + + internal override void SerializeCore(RendererSerializer ser) + { + base.SerializeCore(ser); + + SerializeCoreIgbSwitch(ser); + + } + + } } diff --git a/src/components/Blazor/SwitchModule.cs b/src/components/Blazor/SwitchModule.cs index f6421cd4..9551a52c 100644 --- a/src/components/Blazor/SwitchModule.cs +++ b/src/components/Blazor/SwitchModule.cs @@ -1,24 +1,22 @@ -using System; -using System.Collections.Generic; -using System.Runtime.CompilerServices; -using System.Text; -using System.Collections.Generic; - namespace IgniteUI.Blazor.Controls { - public partial class IgbSwitchModule { - public static void Register(IIgniteUIBlazor runtime) { + public partial class IgbSwitchModule + { + public static void Register(IIgniteUIBlazor runtime) + { ModuleLoader.Load(runtime, "WebSwitchModule"); IgbCheckboxBaseModule.MarkIsLoadRequested(runtime); } - public static void MarkIsLoadRequested(IIgniteUIBlazor runtime) { + public static void MarkIsLoadRequested(IIgniteUIBlazor runtime) + { ModuleLoader.MarkIsLoadRequested(runtime, "WebSwitchModule"); } - public static bool IsLoadRequested(IIgniteUIBlazor runtime) { + public static bool IsLoadRequested(IIgniteUIBlazor runtime) + { return ModuleLoader.IsLoadRequested(runtime, "WebSwitchModule"); } } diff --git a/src/components/Blazor/Tab.cs b/src/components/Blazor/Tab.cs index c664fe39..64b9d562 100644 --- a/src/components/Blazor/Tab.cs +++ b/src/components/Blazor/Tab.cs @@ -1,197 +1,201 @@ - -using System; using Microsoft.AspNetCore.Components; -using Microsoft.AspNetCore.Components.Rendering; -using System.Threading.Tasks; -using System.Collections.Generic; -using System.Linq; namespace IgniteUI.Blazor.Controls { - /// -/// A tab element slotted into an `igc-tabs` container. -/// -public partial class IgbTab: BaseRendererControl, IDisposable { - public override string Type { get { return "WebTab"; } } - - protected override void EnsureModulesLoaded() - { - if (!IgbTabModule.IsLoadRequested(IgBlazor)) - { - IgbTabModule.Register(IgBlazor); - } - } - - protected override string ResolveDisplay() - { - return "inline-block"; - } - - protected override bool SupportsVisualChildren - { - get - { - return true; - } - } - - protected override bool UseDirectRender - { - get - { - return true; - } - } - - protected override string DirectRenderElementName - { - get - { - return "igc-tab"; - } - } - - protected override ControlEventBehavior DefaultEventBehavior - { - get { return ControlEventBehavior.Immediate; } - } - - [CascadingParameter(Name="TabsParent")] - protected BaseRendererControl TabsParent - { - get; set; - } - - public IgbTab(): base() { - OnCreatedIgbTab(); - - - } - - partial void OnCreatedIgbTab(); - - partial void OnIgbTabDisposing(); - public void Dispose() - { - OnIgbTabDisposing(); - - if (TabsParent != null ) - { - var sv = (IgbTabs)TabsParent; - sv.ContentTabsCollection.Add(this); - } - - } - - partial void OnIgbTabInitializing(); - protected override async Task OnInitializedAsync() - { - OnIgbTabInitializing(); - - if (TabsParent != null ) - { - var sv = (IgbTabs)TabsParent; - sv.ContentTabsCollection.Add(this); - } - - } - - private string _label; - - partial void OnLabelChanging(ref string newValue); - /// - /// The tab item label. - /// - [Parameter] - public string Label - { - get { return this._label; } - set { - if (this._label != value || !IsPropDirty("Label")) { - MarkPropDirty("Label"); - } - this._label = value; - - } - } - private bool _selected = false; - - partial void OnSelectedChanging(ref bool newValue); - /// - /// Determines whether the tab is selected. - /// - [Parameter] - public bool Selected - { - get { return this._selected; } - set { - if (this._selected != value || !IsPropDirty("Selected")) { - MarkPropDirty("Selected"); - } - this._selected = value; - - } - } - private bool _disabled = false; - - partial void OnDisabledChanging(ref bool newValue); - /// - /// Determines whether the tab is disabled. - /// - [Parameter] - public bool Disabled - { - get { return this._disabled; } - set { - if (this._disabled != value || !IsPropDirty("Disabled")) { - MarkPropDirty("Disabled"); - } - this._disabled = value; - - } - } - - partial void FindByNameTab(string name, ref object item); - public override object FindByName(string name) - { - - var baseResult = base.FindByName(name); - if (baseResult != null) - { - return baseResult; - } - - object item = null; - FindByNameTab(name, ref item); - if (item != null) - { - return item; - } - - return null; - } - public async Task SetNativeElementAsync(Object element) - { - await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); - } - public void SetNativeElement(Object element) - { - InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); - } - - partial void SerializeCoreIgbTab(RendererSerializer ser); - - internal override void SerializeCore(RendererSerializer ser) - { - base.SerializeCore(ser); - - SerializeCoreIgbTab(ser); - - if (IsPropDirty("Label")) { ser.AddStringProp("label", this._label); } - if (IsPropDirty("Selected")) { ser.AddBooleanProp("selected", this._selected); } - if (IsPropDirty("Disabled")) { ser.AddBooleanProp("disabled", this._disabled); } - - } - -} + /// + /// A tab element slotted into an `igc-tabs` container. + /// + public partial class IgbTab : BaseRendererControl, IDisposable + { + public override string Type { get { return "WebTab"; } } + + protected override void EnsureModulesLoaded() + { + if (!IgbTabModule.IsLoadRequested(IgBlazor)) + { + IgbTabModule.Register(IgBlazor); + } + } + + protected override string ResolveDisplay() + { + return "inline-block"; + } + + protected override bool SupportsVisualChildren + { + get + { + return true; + } + } + + protected override bool UseDirectRender + { + get + { + return true; + } + } + + protected override string DirectRenderElementName + { + get + { + return "igc-tab"; + } + } + + protected override ControlEventBehavior DefaultEventBehavior + { + get { return ControlEventBehavior.Immediate; } + } + + [CascadingParameter(Name = "TabsParent")] + protected BaseRendererControl TabsParent + { + get; set; + } + + public IgbTab() : base() + { + OnCreatedIgbTab(); + + } + + partial void OnCreatedIgbTab(); + + partial void OnIgbTabDisposing(); + public void Dispose() + { + OnIgbTabDisposing(); + + if (TabsParent != null) + { + var sv = (IgbTabs)TabsParent; + sv.ContentTabsCollection.Add(this); + } + + } + + partial void OnIgbTabInitializing(); + protected override async Task OnInitializedAsync() + { + OnIgbTabInitializing(); + + if (TabsParent != null) + { + var sv = (IgbTabs)TabsParent; + sv.ContentTabsCollection.Add(this); + } + + } + + private string _label; + + partial void OnLabelChanging(ref string newValue); + /// + /// The tab item label. + /// + [Parameter] + public string Label + { + get { return this._label; } + set + { + if (this._label != value || !IsPropDirty("Label")) + { + MarkPropDirty("Label"); + } + this._label = value; + + } + } + private bool _selected = false; + + partial void OnSelectedChanging(ref bool newValue); + /// + /// Determines whether the tab is selected. + /// + [Parameter] + public bool Selected + { + get { return this._selected; } + set + { + if (this._selected != value || !IsPropDirty("Selected")) + { + MarkPropDirty("Selected"); + } + this._selected = value; + + } + } + private bool _disabled = false; + + partial void OnDisabledChanging(ref bool newValue); + /// + /// Determines whether the tab is disabled. + /// + [Parameter] + public bool Disabled + { + get { return this._disabled; } + set + { + if (this._disabled != value || !IsPropDirty("Disabled")) + { + MarkPropDirty("Disabled"); + } + this._disabled = value; + + } + } + + partial void FindByNameTab(string name, ref object item); + public override object FindByName(string name) + { + + var baseResult = base.FindByName(name); + if (baseResult != null) + { + return baseResult; + } + + object item = null; + FindByNameTab(name, ref item); + if (item != null) + { + return item; + } + + return null; + } + public async Task SetNativeElementAsync(Object element) + { + await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + } + public void SetNativeElement(Object element) + { + InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + } + + partial void SerializeCoreIgbTab(RendererSerializer ser); + + internal override void SerializeCore(RendererSerializer ser) + { + base.SerializeCore(ser); + + SerializeCoreIgbTab(ser); + + if (IsPropDirty("Label")) + { ser.AddStringProp("label", this._label); } + if (IsPropDirty("Selected")) + { ser.AddBooleanProp("selected", this._selected); } + if (IsPropDirty("Disabled")) + { ser.AddBooleanProp("disabled", this._disabled); } + + } + + } } diff --git a/src/components/Blazor/TabComponentEventArgs.cs b/src/components/Blazor/TabComponentEventArgs.cs index 5464d0fc..fac49187 100644 --- a/src/components/Blazor/TabComponentEventArgs.cs +++ b/src/components/Blazor/TabComponentEventArgs.cs @@ -1,94 +1,91 @@ - -using System; using Microsoft.AspNetCore.Components; -using Microsoft.AspNetCore.Components.Rendering; -using System.Threading.Tasks; -using System.Collections.Generic; -using System.Linq; namespace IgniteUI.Blazor.Controls { - public partial class IgbTabComponentEventArgs: BaseRendererElement { - public override string Type { get { return "WebTabComponentEventArgs"; } } - - - private static bool _marshalByValue = true; - - public IgbTabComponentEventArgs(): base() { - OnCreatedIgbTabComponentEventArgs(); - - - } - - partial void OnCreatedIgbTabComponentEventArgs(); - - private IgbTab _detail; - - partial void OnDetailChanging(ref IgbTab newValue); - [Parameter] - public IgbTab Detail - { - get { return this._detail; } - set { - if (this._detail != value || !IsPropDirty("Detail")) { - MarkPropDirty("Detail"); - } - this._detail = value; - - } - } - - partial void FindByNameTabComponentEventArgs(string name, ref object item); - public override object FindByName(string name) - { - - var baseResult = base.FindByName(name); - if (baseResult != null) - { - return baseResult; - } - - object item = null; - FindByNameTabComponentEventArgs(name, ref item); - if (item != null) - { - return item; - } - - return null; - } - - partial void SerializeCoreIgbTabComponentEventArgs(RendererSerializer ser); - - internal override void SerializeCore(RendererSerializer ser) - { - base.SerializeCore(ser); - - SerializeCoreIgbTabComponentEventArgs(ser); - - if (IsPropDirty("Detail")) { ser.AddSerializableProp("detail", this._detail); } - - } - - - protected internal override void ToEventJson(BaseRendererControl control, Dictionary args) - { - base.ToEventJson(control, args); - - if (IsPropDirty("Detail")) { args["detail"] = ObjectToParam(this._detail); } - - - } - - - protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) { - base.FromEventJson(control, args); - this.SuppressParentNotify = true; - - if (args.ContainsKey("detail")) { this.Detail = (IgbTab)ConvertReturnValue(args["detail"], "Tab", true); } - - this.SuppressParentNotify = false; - } - -} + public partial class IgbTabComponentEventArgs : BaseRendererElement + { + public override string Type { get { return "WebTabComponentEventArgs"; } } + + private static bool _marshalByValue = true; + + public IgbTabComponentEventArgs() : base() + { + OnCreatedIgbTabComponentEventArgs(); + + } + + partial void OnCreatedIgbTabComponentEventArgs(); + + private IgbTab _detail; + + partial void OnDetailChanging(ref IgbTab newValue); + [Parameter] + public IgbTab Detail + { + get { return this._detail; } + set + { + if (this._detail != value || !IsPropDirty("Detail")) + { + MarkPropDirty("Detail"); + } + this._detail = value; + + } + } + + partial void FindByNameTabComponentEventArgs(string name, ref object item); + public override object FindByName(string name) + { + + var baseResult = base.FindByName(name); + if (baseResult != null) + { + return baseResult; + } + + object item = null; + FindByNameTabComponentEventArgs(name, ref item); + if (item != null) + { + return item; + } + + return null; + } + + partial void SerializeCoreIgbTabComponentEventArgs(RendererSerializer ser); + + internal override void SerializeCore(RendererSerializer ser) + { + base.SerializeCore(ser); + + SerializeCoreIgbTabComponentEventArgs(ser); + + if (IsPropDirty("Detail")) + { ser.AddSerializableProp("detail", this._detail); } + + } + + protected internal override void ToEventJson(BaseRendererControl control, Dictionary args) + { + base.ToEventJson(control, args); + + if (IsPropDirty("Detail")) + { args["detail"] = ObjectToParam(this._detail); } + + } + + protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) + { + base.FromEventJson(control, args); + this.SuppressParentNotify = true; + + if (args.ContainsKey("detail")) + { this.Detail = (IgbTab)ConvertReturnValue(args["detail"], "Tab", true); } + + this.SuppressParentNotify = false; + } + + } } diff --git a/src/components/Blazor/TabModule.cs b/src/components/Blazor/TabModule.cs index 8164bb1d..97de7ba2 100644 --- a/src/components/Blazor/TabModule.cs +++ b/src/components/Blazor/TabModule.cs @@ -1,23 +1,20 @@ -using System; -using System.Collections.Generic; -using System.Runtime.CompilerServices; -using System.Text; -using System.Collections.Generic; - namespace IgniteUI.Blazor.Controls { - public partial class IgbTabModule { - public static void Register(IIgniteUIBlazor runtime) { + public partial class IgbTabModule + { + public static void Register(IIgniteUIBlazor runtime) + { ModuleLoader.Load(runtime, "WebTabModule"); - } - public static void MarkIsLoadRequested(IIgniteUIBlazor runtime) { + public static void MarkIsLoadRequested(IIgniteUIBlazor runtime) + { ModuleLoader.MarkIsLoadRequested(runtime, "WebTabModule"); } - public static bool IsLoadRequested(IIgniteUIBlazor runtime) { + public static bool IsLoadRequested(IIgniteUIBlazor runtime) + { return ModuleLoader.IsLoadRequested(runtime, "WebTabModule"); } } diff --git a/src/components/Blazor/Tabs.cs b/src/components/Blazor/Tabs.cs index 37fe7871..c18c3a71 100644 --- a/src/components/Blazor/Tabs.cs +++ b/src/components/Blazor/Tabs.cs @@ -1,307 +1,322 @@ - -using System; using Microsoft.AspNetCore.Components; -using Microsoft.AspNetCore.Components.Rendering; -using System.Threading.Tasks; -using System.Collections.Generic; -using System.Linq; namespace IgniteUI.Blazor.Controls { - public partial class IgbTabs: BaseRendererControl { - public override string Type { get { return "WebTabs"; } } - - protected override void EnsureModulesLoaded() - { - if (!IgbTabsModule.IsLoadRequested(IgBlazor)) - { - IgbTabsModule.Register(IgBlazor); - } - } - - protected override string ResolveDisplay() - { - return "inline-block"; - } + public partial class IgbTabs : BaseRendererControl + { + public override string Type { get { return "WebTabs"; } } - protected override bool SupportsVisualChildren - { - get - { - return true; - } - } + protected override void EnsureModulesLoaded() + { + if (!IgbTabsModule.IsLoadRequested(IgBlazor)) + { + IgbTabsModule.Register(IgBlazor); + } + } + + protected override string ResolveDisplay() + { + return "inline-block"; + } + + protected override bool SupportsVisualChildren + { + get + { + return true; + } + } + + protected override bool UseDirectRender + { + get + { + return true; + } + } + + protected override string DirectRenderElementName + { + get + { + return "igc-tabs"; + } + } + + protected override ControlEventBehavior DefaultEventBehavior + { + get { return ControlEventBehavior.Immediate; } + } + + protected override string ParentTypeName + { + get + { + return "TabsParent"; + } + } + + private CollectionAdapter _tabsCollectionAdapter; + private IgbTabs_TabCollection _allTabsCollection; + private IgbTabs_TabCollection _contentTabsCollection = null; + + public IgbTabs_TabCollection ContentTabsCollection + { + + get + { + if (this._contentTabsCollection == null) + { + this._contentTabsCollection = new IgbTabs_TabCollection(this, "TabsCollection"); + } + return this._contentTabsCollection; + } + } + partial void GetSerializableTabsCollection(ref IgbTabs_TabCollection value) + { + value = ActualTabsCollection; + } + private IgbTabs_TabCollection _actualTabsCollection = null; + + public IgbTabs_TabCollection ActualTabsCollection + { + + get + { + if (this._actualTabsCollection == null) + { + this._actualTabsCollection = new IgbTabs_TabCollection(this, "TabsCollection"); + } + return this._actualTabsCollection; + } + } + + public IgbTabs() : base() + { + OnCreatedIgbTabs(); + + _allTabsCollection = new IgbTabs_TabCollection(this, "TabsCollection"); + _tabsCollectionAdapter = new CollectionAdapter( + ContentTabsCollection, + ActualTabsCollection, + _allTabsCollection, + (s) => s, + (s) => + { + }, + (s) => { } + ); + _tabsCollectionAdapter.SubcribeToManual(TabsCollection); + + } + + partial void OnCreatedIgbTabs(); + + private IgbTabs_TabCollection _tabsCollection = null; + + partial void GetSerializableTabsCollection(ref IgbTabs_TabCollection value); + + partial void OnTabsCollectionChanging(ref IgbTabs_TabCollection newValue); - protected override bool UseDirectRender + public IgbTabs_TabCollection TabsCollection + { + + get + { + if (this._tabsCollection == null) + { + this._tabsCollection = new IgbTabs_TabCollection(this, "TabsCollection"); + } + return this._tabsCollection; + } + protected set + { + if (this._tabsCollection != value || !IsPropDirty("TabsCollection")) + { + MarkPropDirty("TabsCollection"); + } + this._tabsCollection = value; + + } + } + private TabsAlignment _alignment = TabsAlignment.Start; + + partial void OnAlignmentChanging(ref TabsAlignment newValue); + /// + /// Sets the alignment for the tab headers + /// + [Parameter] + public TabsAlignment Alignment + { + get { return this._alignment; } + set + { + if (this._alignment != value || !IsPropDirty("Alignment")) + { + MarkPropDirty("Alignment"); + } + this._alignment = value; + + } + } + private TabsActivation _activation = TabsActivation.Auto; + + partial void OnActivationChanging(ref TabsActivation newValue); + /// + /// Determines the tab activation. When set to auto, + /// the tab is instantly selected while navigating with the Left/Right Arrows, Home or End keys + /// and the corresponding panel is displayed. + /// When set to manual, the tab is only focused. The selection happens after pressing Space or Enter. + /// + [Parameter] + public TabsActivation Activation + { + get { return this._activation; } + set + { + if (this._activation != value || !IsPropDirty("Activation")) + { + MarkPropDirty("Activation"); + } + this._activation = value; + + } + } + public async Task GetSelectedAsync() + { + var iv = await InvokeMethod("p:Selected", new object[] { }, new string[] { }); + return ReturnToString(iv); + } + public string GetSelected() + { + var iv = InvokeMethodSync("p:Selected", new object[] { }, new string[] { }); + return ReturnToString(iv); + } + + partial void FindByNameTabs(string name, ref object item); + public override object FindByName(string name) + { + + var baseResult = base.FindByName(name); + if (baseResult != null) + { + return baseResult; + } + + object item = null; + FindByNameTabs(name, ref item); + if (item != null) + { + return item; + } + if (_actualTabsCollection != null && _actualTabsCollection.HasName(name)) + { return _actualTabsCollection.FindByName(name); } + + return null; + } + public async Task SetNativeElementAsync(Object element) + { + await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + } + public void SetNativeElement(Object element) + { + InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + } + /// + /// Selects the specified tab and displays the corresponding panel. + /// + public async Task SelectAsync(String id) + { + await InvokeMethod("select", new object[] { StringToString(id) }, new string[] { "String" }); + } + public void Select(String id) + { + InvokeMethodSync("select", new object[] { StringToString(id) }, new string[] { "String" }); + } + + private string _changeRef = null; + private string _changeScript = null; + [Parameter] + public string ChangeScript + { + + set + { + if (value != this._changeScript) + { + this._changeScript = value; + this.OnRefChanged("Change", null, value, true, false, (string refName, object oldValue, object newValue) => + { + this._changeRef = refName; + this.MarkPropDirty("ChangeRef"); + }); + } + } + get + { + return this._changeScript; + } + } + + partial void OnHandlingChange(IgbTabComponentEventArgs args); + private EventCallback? _change = null; + [Parameter] + public EventCallback Change + { + get + { + return this._change != null ? this._change.Value : EventCallback.Empty; + } + set + { + if (!value.Equals(EventCallback.Empty)) + { + if (!CompareEventCallbacks(value, _change, ref eventCallbacksCache)) + { + _change = value; + this.SetHandler(this.Name, "Change", value, (args) => { - get - { - return true; - } - } + OnHandlingChange(args); - protected override string DirectRenderElementName + }); + this.OnRefChanged("Change", null, "event:::Change", true, false, (refName, oldValue, newValue) => { - get - { - return "igc-tabs"; - } - } - - protected override ControlEventBehavior DefaultEventBehavior - { - get { return ControlEventBehavior.Immediate; } - } - - protected override string ParentTypeName - { - get - { - return "TabsParent"; - } - } - - private CollectionAdapter _tabsCollectionAdapter; - private IgbTabs_TabCollection _allTabsCollection; - private IgbTabs_TabCollection _contentTabsCollection = null; - - public IgbTabs_TabCollection ContentTabsCollection - { - - get - { - if (this._contentTabsCollection == null) { - this._contentTabsCollection = new IgbTabs_TabCollection(this, "TabsCollection"); - } - return this._contentTabsCollection; - } - } - partial void GetSerializableTabsCollection(ref IgbTabs_TabCollection value) - { - value = ActualTabsCollection; - } - private IgbTabs_TabCollection _actualTabsCollection = null; - - public IgbTabs_TabCollection ActualTabsCollection - { - - get - { - if (this._actualTabsCollection == null) { - this._actualTabsCollection = new IgbTabs_TabCollection(this, "TabsCollection"); - } - return this._actualTabsCollection; - } - } - - public IgbTabs(): base() { - OnCreatedIgbTabs(); - - - _allTabsCollection = new IgbTabs_TabCollection(this, "TabsCollection"); - _tabsCollectionAdapter = new CollectionAdapter( - ContentTabsCollection, - ActualTabsCollection, - _allTabsCollection, - (s) => s, - (s) => { - }, - (s) => { } - ); - _tabsCollectionAdapter.SubcribeToManual(TabsCollection); - - } - - partial void OnCreatedIgbTabs(); - - private IgbTabs_TabCollection _tabsCollection = null; - - partial void GetSerializableTabsCollection(ref IgbTabs_TabCollection value); - - partial void OnTabsCollectionChanging(ref IgbTabs_TabCollection newValue); - - public IgbTabs_TabCollection TabsCollection - { - - get - { - if (this._tabsCollection == null) { - this._tabsCollection = new IgbTabs_TabCollection(this, "TabsCollection"); - } - return this._tabsCollection; - } - protected set { - if (this._tabsCollection != value || !IsPropDirty("TabsCollection")) { - MarkPropDirty("TabsCollection"); - } - this._tabsCollection = value; - - } - } - private TabsAlignment _alignment = TabsAlignment.Start; - - partial void OnAlignmentChanging(ref TabsAlignment newValue); - /// - /// Sets the alignment for the tab headers - /// - [Parameter] - public TabsAlignment Alignment - { - get { return this._alignment; } - set { - if (this._alignment != value || !IsPropDirty("Alignment")) { - MarkPropDirty("Alignment"); - } - this._alignment = value; - - } - } - private TabsActivation _activation = TabsActivation.Auto; - - partial void OnActivationChanging(ref TabsActivation newValue); - /// - /// Determines the tab activation. When set to auto, - /// the tab is instantly selected while navigating with the Left/Right Arrows, Home or End keys - /// and the corresponding panel is displayed. - /// When set to manual, the tab is only focused. The selection happens after pressing Space or Enter. - /// - [Parameter] - public TabsActivation Activation - { - get { return this._activation; } - set { - if (this._activation != value || !IsPropDirty("Activation")) { - MarkPropDirty("Activation"); - } - this._activation = value; - - } - } - public async Task GetSelectedAsync() - { - var iv = await InvokeMethod("p:Selected", new object[] { }, new string[] { }); - return ReturnToString(iv); - } - public string GetSelected() - { - var iv = InvokeMethodSync("p:Selected", new object[] { }, new string[] { }); - return ReturnToString(iv); - } - - partial void FindByNameTabs(string name, ref object item); - public override object FindByName(string name) - { - - var baseResult = base.FindByName(name); - if (baseResult != null) - { - return baseResult; - } - - object item = null; - FindByNameTabs(name, ref item); - if (item != null) - { - return item; - } - if (_actualTabsCollection != null && _actualTabsCollection.HasName(name)) { return _actualTabsCollection.FindByName(name); } - - return null; - } - public async Task SetNativeElementAsync(Object element) - { - await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); - } - public void SetNativeElement(Object element) - { - InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); - } - /// - /// Selects the specified tab and displays the corresponding panel. - /// - public async Task SelectAsync(String id) - { - await InvokeMethod("select", new object[] { StringToString(id) }, new string[] { "String" }); - } - public void Select(String id) - { - InvokeMethodSync("select", new object[] { StringToString(id) }, new string[] { "String" }); - } - - private string _changeRef = null; - private string _changeScript = null; - [Parameter] - public string ChangeScript { - - set - { - if (value != this._changeScript) - { - this._changeScript = value; - this.OnRefChanged("Change", null, value, true, false, (string refName, object oldValue, object newValue) => { - this._changeRef = refName; - this.MarkPropDirty("ChangeRef"); - }); - } - } - get - { - return this._changeScript; - } - } - - partial void OnHandlingChange(IgbTabComponentEventArgs args); - private EventCallback? _change = null; - [Parameter] - public EventCallback Change - { - get - { - return this._change != null ? this._change.Value : EventCallback.Empty; - } - set - { - if (!value.Equals(EventCallback.Empty)) - { - if (!CompareEventCallbacks(value, _change, ref eventCallbacksCache)) - { - _change = value; - this.SetHandler(this.Name, "Change", value, (args) => { - OnHandlingChange(args); - - }); - this.OnRefChanged("Change", null, "event:::Change", true, false, (refName, oldValue, newValue) => { - this._changeRef = refName; - this.MarkPropDirty("ChangeRef"); - }); - } - } - else - { - _change = null; - this.SetHandler(this.Name, "Change", null); - this.OnRefChanged("Change", null, null, true, false, (refName, oldValue, newValue) => { - this._changeRef = null; - this.MarkPropDirty("ChangeRef"); - }); - } - } - } - - partial void SerializeCoreIgbTabs(RendererSerializer ser); - - internal override void SerializeCore(RendererSerializer ser) - { - base.SerializeCore(ser); - - SerializeCoreIgbTabs(ser); - - if (IsPropDirty("TabsCollection")) { var coll = this._tabsCollection; GetSerializableTabsCollection(ref coll); ser.AddCollectionProp("tabsCollection", coll); } - if (IsPropDirty("Alignment")) { ser.AddEnumProp("alignment", this._alignment); } - if (IsPropDirty("Activation")) { ser.AddEnumProp("activation", this._activation); } - if (IsPropDirty("ChangeRef")) { ser.AddStringProp("changeRef", this._changeRef); } - - } - -} + this._changeRef = refName; + this.MarkPropDirty("ChangeRef"); + }); + } + } + else + { + _change = null; + this.SetHandler(this.Name, "Change", null); + this.OnRefChanged("Change", null, null, true, false, (refName, oldValue, newValue) => + { + this._changeRef = null; + this.MarkPropDirty("ChangeRef"); + }); + } + } + } + + partial void SerializeCoreIgbTabs(RendererSerializer ser); + + internal override void SerializeCore(RendererSerializer ser) + { + base.SerializeCore(ser); + + SerializeCoreIgbTabs(ser); + + if (IsPropDirty("TabsCollection")) + { var coll = this._tabsCollection; GetSerializableTabsCollection(ref coll); ser.AddCollectionProp("tabsCollection", coll); } + if (IsPropDirty("Alignment")) + { ser.AddEnumProp("alignment", this._alignment); } + if (IsPropDirty("Activation")) + { ser.AddEnumProp("activation", this._activation); } + if (IsPropDirty("ChangeRef")) + { ser.AddStringProp("changeRef", this._changeRef); } + + } + + } } diff --git a/src/components/Blazor/TabsActivation.cs b/src/components/Blazor/TabsActivation.cs index 437487dc..9df46a4b 100644 --- a/src/components/Blazor/TabsActivation.cs +++ b/src/components/Blazor/TabsActivation.cs @@ -1,8 +1,9 @@ namespace IgniteUI.Blazor.Controls { -public enum TabsActivation { - Auto, - Manual + public enum TabsActivation + { + Auto, + Manual -} + } } diff --git a/src/components/Blazor/TabsAlignment.cs b/src/components/Blazor/TabsAlignment.cs index af651c30..adc00332 100644 --- a/src/components/Blazor/TabsAlignment.cs +++ b/src/components/Blazor/TabsAlignment.cs @@ -1,10 +1,11 @@ namespace IgniteUI.Blazor.Controls { -public enum TabsAlignment { - Start, - End, - Center, - Justify + public enum TabsAlignment + { + Start, + End, + Center, + Justify -} + } } diff --git a/src/components/Blazor/TabsModule.cs b/src/components/Blazor/TabsModule.cs index d091b75a..90f3bda0 100644 --- a/src/components/Blazor/TabsModule.cs +++ b/src/components/Blazor/TabsModule.cs @@ -1,24 +1,22 @@ -using System; -using System.Collections.Generic; -using System.Runtime.CompilerServices; -using System.Text; -using System.Collections.Generic; - namespace IgniteUI.Blazor.Controls { - public partial class IgbTabsModule { - public static void Register(IIgniteUIBlazor runtime) { + public partial class IgbTabsModule + { + public static void Register(IIgniteUIBlazor runtime) + { ModuleLoader.Load(runtime, "WebTabsModule"); IgbTabModule.MarkIsLoadRequested(runtime); } - public static void MarkIsLoadRequested(IIgniteUIBlazor runtime) { + public static void MarkIsLoadRequested(IIgniteUIBlazor runtime) + { ModuleLoader.MarkIsLoadRequested(runtime, "WebTabsModule"); } - public static bool IsLoadRequested(IIgniteUIBlazor runtime) { + public static bool IsLoadRequested(IIgniteUIBlazor runtime) + { return ModuleLoader.IsLoadRequested(runtime, "WebTabsModule"); } } diff --git a/src/components/Blazor/Tabs_TabCollection.cs b/src/components/Blazor/Tabs_TabCollection.cs index fc8da6c3..5e076f31 100644 --- a/src/components/Blazor/Tabs_TabCollection.cs +++ b/src/components/Blazor/Tabs_TabCollection.cs @@ -1,11 +1,10 @@ - -using System; - namespace IgniteUI.Blazor.Controls { -public partial class IgbTabs_TabCollection: BaseCollection { - public IgbTabs_TabCollection(object parent, string propertyName): base(parent, propertyName) { - + public partial class IgbTabs_TabCollection : BaseCollection + { + public IgbTabs_TabCollection(object parent, string propertyName) : base(parent, propertyName) + { + + } } } -} diff --git a/src/components/Blazor/Textarea.cs b/src/components/Blazor/Textarea.cs index 8cfa0885..23eef2ef 100644 --- a/src/components/Blazor/Textarea.cs +++ b/src/components/Blazor/Textarea.cs @@ -1,827 +1,902 @@ - -using System; using Microsoft.AspNetCore.Components; -using Microsoft.AspNetCore.Components.Rendering; -using System.Threading.Tasks; -using System.Collections.Generic; -using System.Linq; namespace IgniteUI.Blazor.Controls { - /// -/// This element represents a multi-line plain-text editing control, -/// useful when you want to allow users to enter a sizeable amount of free-form text, -/// for example a comment on a review or feedback form. -/// -public partial class IgbTextarea: BaseRendererControl { - public override string Type { get { return "WebTextarea"; } } - - protected override void EnsureModulesLoaded() - { - if (!IgbTextareaModule.IsLoadRequested(IgBlazor)) - { - IgbTextareaModule.Register(IgBlazor); - } - } + /// + /// This element represents a multi-line plain-text editing control, + /// useful when you want to allow users to enter a sizeable amount of free-form text, + /// for example a comment on a review or feedback form. + /// + public partial class IgbTextarea : BaseRendererControl + { + public override string Type { get { return "WebTextarea"; } } + + protected override void EnsureModulesLoaded() + { + if (!IgbTextareaModule.IsLoadRequested(IgBlazor)) + { + IgbTextareaModule.Register(IgBlazor); + } + } + + protected override string ResolveDisplay() + { + return "inline-block"; + } + + protected override bool SupportsVisualChildren + { + get + { + return true; + } + } + + protected override bool UseDirectRender + { + get + { + return true; + } + } + + protected override string DirectRenderElementName + { + get + { + return "igc-textarea"; + } + } + + protected override ControlEventBehavior DefaultEventBehavior + { + get { return ControlEventBehavior.Immediate; } + } + + public IgbTextarea() : base() + { + OnCreatedIgbTextarea(); + + } + + partial void OnCreatedIgbTextarea(); + + private string _autocomplete; + + partial void OnAutocompleteChanging(ref string newValue); + /// + /// Specifies what if any permission the browser has to provide for automated assistance in filling out form field values, + /// as well as guidance to the browser as to the type of information expected in the field. + /// Refer to [this page](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete) for additional information. + /// + [Parameter] + public string Autocomplete + { + get { return this._autocomplete; } + set + { + if (this._autocomplete != value || !IsPropDirty("Autocomplete")) + { + MarkPropDirty("Autocomplete"); + } + this._autocomplete = value; + + } + } + private string _autocapitalize; + + partial void OnAutocapitalizeChanging(ref string newValue); + /// + /// Controls whether and how text input is automatically capitalized as it is entered/edited by the user. + /// [MDN documentation](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/autocapitalize). + /// + [Parameter] + public string Autocapitalize + { + get { return this._autocapitalize; } + set + { + if (this._autocapitalize != value || !IsPropDirty("Autocapitalize")) + { + MarkPropDirty("Autocapitalize"); + } + this._autocapitalize = value; + + } + } + private string _inputMode; + + partial void OnInputModeChanging(ref string newValue); + /// + /// Hints at the type of data that might be entered by the user while editing the element or its contents. + /// This allows a browser to display an appropriate virtual keyboard. + /// [MDN documentation](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/inputmode) + /// + [Parameter] + [WCAttributeName("inputmode")] + public string InputMode + { + get { return this._inputMode; } + set + { + if (this._inputMode != value || !IsPropDirty("InputMode")) + { + MarkPropDirty("InputMode"); + } + this._inputMode = value; + + } + } + private string _label; + + partial void OnLabelChanging(ref string newValue); + /// + /// The label for the control. + /// + [Parameter] + public string Label + { + get { return this._label; } + set + { + if (this._label != value || !IsPropDirty("Label")) + { + MarkPropDirty("Label"); + } + this._label = value; + + } + } + private double _maxLength = 0; + + partial void OnMaxLengthChanging(ref double newValue); + /// + /// The maximum number of characters (UTF-16 code units) that the user can enter. + /// If this value isn't specified, the user can enter an unlimited number of characters. + /// + [Parameter] + [WCAttributeName("maxlength")] + public double MaxLength + { + get { return this._maxLength; } + set + { + if (this._maxLength != value || !IsPropDirty("MaxLength")) + { + MarkPropDirty("MaxLength"); + } + this._maxLength = value; + + } + } + private double _minLength = 0; + + partial void OnMinLengthChanging(ref double newValue); + /// + /// The minimum number of characters (UTF-16 code units) required that the user should enter. + /// + [Parameter] + [WCAttributeName("minlength")] + public double MinLength + { + get { return this._minLength; } + set + { + if (this._minLength != value || !IsPropDirty("MinLength")) + { + MarkPropDirty("MinLength"); + } + this._minLength = value; + + } + } + private bool _outlined = false; + + partial void OnOutlinedChanging(ref bool newValue); + /// + /// Whether the control will have outlined appearance. + /// + [Parameter] + public bool Outlined + { + get { return this._outlined; } + set + { + if (this._outlined != value || !IsPropDirty("Outlined")) + { + MarkPropDirty("Outlined"); + } + this._outlined = value; + + } + } + private string _placeholder; + + partial void OnPlaceholderChanging(ref string newValue); + /// + /// The placeholder attribute of the control. + /// + [Parameter] + public string Placeholder + { + get { return this._placeholder; } + set + { + if (this._placeholder != value || !IsPropDirty("Placeholder")) + { + MarkPropDirty("Placeholder"); + } + this._placeholder = value; + + } + } + private bool _readOnly = false; + + partial void OnReadOnlyChanging(ref bool newValue); + /// + /// Makes the control a readonly field. + /// + [Parameter] + [WCAttributeName("readonly")] + public bool ReadOnly + { + get { return this._readOnly; } + set + { + if (this._readOnly != value || !IsPropDirty("ReadOnly")) + { + MarkPropDirty("ReadOnly"); + } + this._readOnly = value; + + } + } + private TextareaResize _resize = TextareaResize.Vertical; + + partial void OnResizeChanging(ref TextareaResize newValue); + /// + /// Controls whether the control can be resized. + /// When `auto` is set, the control will try to expand and fit its content. + /// + [Parameter] + public TextareaResize Resize + { + get { return this._resize; } + set + { + if (this._resize != value || !IsPropDirty("Resize")) + { + MarkPropDirty("Resize"); + } + this._resize = value; + + } + } + private double _rows = 0; + + partial void OnRowsChanging(ref double newValue); + /// + /// The number of visible text lines for the control. If it is specified, it must be a positive integer. + /// If it is not specified, the default value is 3. + /// + [Parameter] + public double Rows + { + get { return this._rows; } + set + { + if (this._rows != value || !IsPropDirty("Rows")) + { + MarkPropDirty("Rows"); + } + this._rows = value; + + } + } + private string _value; + + partial void OnValueChanging(ref string newValue); + /// + /// The value of the component + /// + [Parameter] + public string Value + { + get { return this._value; } + set + { + if (this._value != value || !IsPropDirty("Value")) + { + MarkPropDirty("Value"); + } + this._value = value; + + } + } + public async Task GetCurrentValueAsync() + { + var iv = await InvokeMethod("p:Value", new object[] { }, new string[] { }); + return ReturnToString(iv); + } + public string GetCurrentValue() + { + var iv = InvokeMethodSync("p:Value", new object[] { }, new string[] { }); + return ReturnToString(iv); + } + private bool _spellcheck = false; + + partial void OnSpellcheckChanging(ref bool newValue); + /// + /// Controls whether the element may be checked for spelling errors. + /// + [Parameter] + public bool Spellcheck + { + get { return this._spellcheck; } + set + { + if (this._spellcheck != value || !IsPropDirty("Spellcheck")) + { + MarkPropDirty("Spellcheck"); + } + this._spellcheck = value; + + } + } + private TextareaWrap _wrap = TextareaWrap.Soft; + + partial void OnWrapChanging(ref TextareaWrap newValue); + /// + /// Indicates how the control should wrap the value for form submission. + /// Refer to [this page on MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/textarea#attributes) + /// for explanation of the available values. + /// + [Parameter] + public TextareaWrap Wrap + { + get { return this._wrap; } + set + { + if (this._wrap != value || !IsPropDirty("Wrap")) + { + MarkPropDirty("Wrap"); + } + this._wrap = value; + + } + } + private bool _validateOnly = false; + + partial void OnValidateOnlyChanging(ref bool newValue); + /// + /// Enables validation rules to be evaluated without restricting user input. This applies to the `maxLength` property + /// when it is defined. + /// + [Parameter] + public bool ValidateOnly + { + get { return this._validateOnly; } + set + { + if (this._validateOnly != value || !IsPropDirty("ValidateOnly")) + { + MarkPropDirty("ValidateOnly"); + } + this._validateOnly = value; + + } + } + private bool _disabled = false; + + partial void OnDisabledChanging(ref bool newValue); + /// + /// The disabled state of the component + /// + [Parameter] + public bool Disabled + { + get { return this._disabled; } + set + { + if (this._disabled != value || !IsPropDirty("Disabled")) + { + MarkPropDirty("Disabled"); + } + this._disabled = value; + + } + } + private bool _required = false; + + partial void OnRequiredChanging(ref bool newValue); + /// + /// Makes the control a required field in a form context. + /// + [Parameter] + public bool Required + { + get { return this._required; } + set + { + if (this._required != value || !IsPropDirty("Required")) + { + MarkPropDirty("Required"); + } + this._required = value; - protected override string ResolveDisplay() + } + } + private bool _invalid = false; + + partial void OnInvalidChanging(ref bool newValue); + /// + /// Control the validity of the control. + /// + [Parameter] + public bool Invalid + { + get { return this._invalid; } + set + { + if (this._invalid != value || !IsPropDirty("Invalid")) + { + MarkPropDirty("Invalid"); + } + this._invalid = value; + + } + } + + partial void FindByNameTextarea(string name, ref object item); + public override object FindByName(string name) + { + + var baseResult = base.FindByName(name); + if (baseResult != null) + { + return baseResult; + } + + object item = null; + FindByNameTextarea(name, ref item); + if (item != null) + { + return item; + } + + return null; + } + public async Task SetNativeElementAsync(Object element) + { + await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + } + public void SetNativeElement(Object element) + { + InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + } + /// + /// Selects all text within the control. + /// + public async Task SelectAsync() + { + await InvokeMethod("select", new object[] { }, new string[] { }); + } + public void Select() + { + InvokeMethodSync("select", new object[] { }, new string[] { }); + } + /// + /// Checks for validity of the control and shows the browser message if it invalid. + /// + public async Task ReportValidityAsync() + { + await InvokeMethod("reportValidity", new object[] { }, new string[] { }); + } + public void ReportValidity() + { + InvokeMethodSync("reportValidity", new object[] { }, new string[] { }); + } + /// + /// Checks for validity of the control and emits the invalid event if it invalid. + /// + public async Task CheckValidityAsync() + { + await InvokeMethod("checkValidity", new object[] { }, new string[] { }); + } + public void CheckValidity() + { + InvokeMethodSync("checkValidity", new object[] { }, new string[] { }); + } + /// + /// Sets a custom validation message for the control. + /// As long as `message` is not empty, the control is considered invalid. + /// + public async Task SetCustomValidityAsync(String message) + { + await InvokeMethod("setCustomValidity", new object[] { StringToString(message) }, new string[] { "String" }); + } + public void SetCustomValidity(String message) + { + InvokeMethodSync("setCustomValidity", new object[] { StringToString(message) }, new string[] { "String" }); + } + + private EventCallback? _valueChanged = null; + [Parameter] + public EventCallback ValueChanged + { + get + { + return this._valueChanged != null ? this._valueChanged.Value : EventCallback.Empty; + } + set + { + if (!value.Equals(EventCallback.Empty)) + { + if (!CompareEventCallbacks(value, _valueChanged, ref eventCallbacksCache)) + { + this.EnsureChangeHandled(); + + _valueChanged = value; + } + } + else + { + _valueChanged = null; + } + } + } + + private string _inputRef = null; + private string _inputScript = null; + [Parameter] + public string InputScript + { + + set + { + if (value != this._inputScript) + { + this._inputScript = value; + this.OnRefChanged("Input", null, value, true, false, (string refName, object oldValue, object newValue) => + { + this._inputRef = refName; + this.MarkPropDirty("InputRef"); + }); + } + } + get + { + return this._inputScript; + } + } + + partial void OnHandlingInput(IgbComponentValueChangedEventArgs args); + private EventCallback? _input = null; + [Parameter] + public EventCallback Input + { + get + { + return this._input != null ? this._input.Value : EventCallback.Empty; + } + set + { + if (!value.Equals(EventCallback.Empty)) + { + if (!CompareEventCallbacks(value, _input, ref eventCallbacksCache)) + { + _input = value; + this.SetHandler(this.Name, "Input", value, (args) => { - return "inline-block"; - } + OnHandlingInput(args); - protected override bool SupportsVisualChildren + }); + this.OnRefChanged("Input", null, "event:::Input", true, false, (refName, oldValue, newValue) => { - get - { - return true; - } - } + this._inputRef = refName; + this.MarkPropDirty("InputRef"); + }); + } + } + else + { + _input = null; + this.SetHandler(this.Name, "Input", null); + this.OnRefChanged("Input", null, null, true, false, (refName, oldValue, newValue) => + { + this._inputRef = null; + this.MarkPropDirty("InputRef"); + }); + } + } + } + + private string _changeRef = null; + private string _changeScript = null; + [Parameter] + public string ChangeScript + { + + set + { + if (value != this._changeScript) + { + this._changeScript = value; + this.OnRefChanged("Change", null, value, true, false, (string refName, object oldValue, object newValue) => + { + this._changeRef = refName; + this.MarkPropDirty("ChangeRef"); + }); + } + } + get + { + return this._changeScript; + } + } - protected override bool UseDirectRender + partial void OnHandlingChange(IgbComponentValueChangedEventArgs args); + private EventCallback? _change = null; + [Parameter] + public EventCallback Change + { + get + { + return this._change != null ? this._change.Value : EventCallback.Empty; + } + set + { + if (!value.Equals(EventCallback.Empty)) + { + if (!CompareEventCallbacks(value, _change, ref eventCallbacksCache)) + { + _change = value; + this.SetHandler(this.Name, "Change", value, (args) => { - get + OnHandlingChange(args); + + var newValueValue = default(string); + + { + newValueValue = (string)(args.Detail); + ; + OnEventUpdatingValue(this._value, ref newValueValue); + if (UseDirectRender) { - return true; + //TODO: maybe we should be doing this for everything. Need to make sure we don't infinity bounce though. + this.Value = newValueValue; } - } - - protected override string DirectRenderElementName - { - get + else { - return "igc-textarea"; + this._value = newValueValue; } - } + OnPropertyPropagatedOut(Name, "Value"); + } - protected override ControlEventBehavior DefaultEventBehavior + if (!EventCallback.Empty.Equals(ValueChanged)) { - get { return ControlEventBehavior.Immediate; } + var task = ValueChanged.InvokeAsync(newValueValue); + if (task.Exception != null) + { + throw task.Exception; + } } - - public IgbTextarea(): base() { - OnCreatedIgbTextarea(); - - - } - - partial void OnCreatedIgbTextarea(); - - private string _autocomplete; - - partial void OnAutocompleteChanging(ref string newValue); - /// - /// Specifies what if any permission the browser has to provide for automated assistance in filling out form field values, - /// as well as guidance to the browser as to the type of information expected in the field. - /// Refer to [this page](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete) for additional information. - /// - [Parameter] - public string Autocomplete - { - get { return this._autocomplete; } - set { - if (this._autocomplete != value || !IsPropDirty("Autocomplete")) { - MarkPropDirty("Autocomplete"); - } - this._autocomplete = value; - - } - } - private string _autocapitalize; - - partial void OnAutocapitalizeChanging(ref string newValue); - /// - /// Controls whether and how text input is automatically capitalized as it is entered/edited by the user. - /// [MDN documentation](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/autocapitalize). - /// - [Parameter] - public string Autocapitalize - { - get { return this._autocapitalize; } - set { - if (this._autocapitalize != value || !IsPropDirty("Autocapitalize")) { - MarkPropDirty("Autocapitalize"); - } - this._autocapitalize = value; - - } - } - private string _inputMode; - - partial void OnInputModeChanging(ref string newValue); - /// - /// Hints at the type of data that might be entered by the user while editing the element or its contents. - /// This allows a browser to display an appropriate virtual keyboard. - /// [MDN documentation](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/inputmode) - /// - [Parameter] - [WCAttributeName("inputmode")] - public string InputMode - { - get { return this._inputMode; } - set { - if (this._inputMode != value || !IsPropDirty("InputMode")) { - MarkPropDirty("InputMode"); - } - this._inputMode = value; - - } - } - private string _label; - - partial void OnLabelChanging(ref string newValue); - /// - /// The label for the control. - /// - [Parameter] - public string Label - { - get { return this._label; } - set { - if (this._label != value || !IsPropDirty("Label")) { - MarkPropDirty("Label"); - } - this._label = value; - - } - } - private double _maxLength = 0; - - partial void OnMaxLengthChanging(ref double newValue); - /// - /// The maximum number of characters (UTF-16 code units) that the user can enter. - /// If this value isn't specified, the user can enter an unlimited number of characters. - /// - [Parameter] - [WCAttributeName("maxlength")] - public double MaxLength - { - get { return this._maxLength; } - set { - if (this._maxLength != value || !IsPropDirty("MaxLength")) { - MarkPropDirty("MaxLength"); - } - this._maxLength = value; - - } - } - private double _minLength = 0; - - partial void OnMinLengthChanging(ref double newValue); - /// - /// The minimum number of characters (UTF-16 code units) required that the user should enter. - /// - [Parameter] - [WCAttributeName("minlength")] - public double MinLength - { - get { return this._minLength; } - set { - if (this._minLength != value || !IsPropDirty("MinLength")) { - MarkPropDirty("MinLength"); - } - this._minLength = value; - - } - } - private bool _outlined = false; - - partial void OnOutlinedChanging(ref bool newValue); - /// - /// Whether the control will have outlined appearance. - /// - [Parameter] - public bool Outlined - { - get { return this._outlined; } - set { - if (this._outlined != value || !IsPropDirty("Outlined")) { - MarkPropDirty("Outlined"); - } - this._outlined = value; - - } - } - private string _placeholder; - - partial void OnPlaceholderChanging(ref string newValue); - /// - /// The placeholder attribute of the control. - /// - [Parameter] - public string Placeholder - { - get { return this._placeholder; } - set { - if (this._placeholder != value || !IsPropDirty("Placeholder")) { - MarkPropDirty("Placeholder"); - } - this._placeholder = value; - - } - } - private bool _readOnly = false; - - partial void OnReadOnlyChanging(ref bool newValue); - /// - /// Makes the control a readonly field. - /// - [Parameter] - [WCAttributeName("readonly")] - public bool ReadOnly - { - get { return this._readOnly; } - set { - if (this._readOnly != value || !IsPropDirty("ReadOnly")) { - MarkPropDirty("ReadOnly"); - } - this._readOnly = value; - - } - } - private TextareaResize _resize = TextareaResize.Vertical; - - partial void OnResizeChanging(ref TextareaResize newValue); - /// - /// Controls whether the control can be resized. - /// When `auto` is set, the control will try to expand and fit its content. - /// - [Parameter] - public TextareaResize Resize - { - get { return this._resize; } - set { - if (this._resize != value || !IsPropDirty("Resize")) { - MarkPropDirty("Resize"); - } - this._resize = value; - - } - } - private double _rows = 0; - - partial void OnRowsChanging(ref double newValue); - /// - /// The number of visible text lines for the control. If it is specified, it must be a positive integer. - /// If it is not specified, the default value is 3. - /// - [Parameter] - public double Rows - { - get { return this._rows; } - set { - if (this._rows != value || !IsPropDirty("Rows")) { - MarkPropDirty("Rows"); - } - this._rows = value; - - } - } - private string _value; - - partial void OnValueChanging(ref string newValue); - /// - /// The value of the component - /// - [Parameter] - public string Value - { - get { return this._value; } - set { - if (this._value != value || !IsPropDirty("Value")) { - MarkPropDirty("Value"); - } - this._value = value; - - } - } - public async Task GetCurrentValueAsync() - { - var iv = await InvokeMethod("p:Value", new object[] { }, new string[] { }); - return ReturnToString(iv); - } - public string GetCurrentValue() - { - var iv = InvokeMethodSync("p:Value", new object[] { }, new string[] { }); - return ReturnToString(iv); - } - private bool _spellcheck = false; - - partial void OnSpellcheckChanging(ref bool newValue); - /// - /// Controls whether the element may be checked for spelling errors. - /// - [Parameter] - public bool Spellcheck - { - get { return this._spellcheck; } - set { - if (this._spellcheck != value || !IsPropDirty("Spellcheck")) { - MarkPropDirty("Spellcheck"); - } - this._spellcheck = value; - - } - } - private TextareaWrap _wrap = TextareaWrap.Soft; - - partial void OnWrapChanging(ref TextareaWrap newValue); - /// - /// Indicates how the control should wrap the value for form submission. - /// Refer to [this page on MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/textarea#attributes) - /// for explanation of the available values. - /// - [Parameter] - public TextareaWrap Wrap - { - get { return this._wrap; } - set { - if (this._wrap != value || !IsPropDirty("Wrap")) { - MarkPropDirty("Wrap"); - } - this._wrap = value; - - } - } - private bool _validateOnly = false; - - partial void OnValidateOnlyChanging(ref bool newValue); - /// - /// Enables validation rules to be evaluated without restricting user input. This applies to the `maxLength` property - /// when it is defined. - /// - [Parameter] - public bool ValidateOnly - { - get { return this._validateOnly; } - set { - if (this._validateOnly != value || !IsPropDirty("ValidateOnly")) { - MarkPropDirty("ValidateOnly"); - } - this._validateOnly = value; - - } - } - private bool _disabled = false; - - partial void OnDisabledChanging(ref bool newValue); - /// - /// The disabled state of the component - /// - [Parameter] - public bool Disabled - { - get { return this._disabled; } - set { - if (this._disabled != value || !IsPropDirty("Disabled")) { - MarkPropDirty("Disabled"); - } - this._disabled = value; - - } - } - private bool _required = false; - - partial void OnRequiredChanging(ref bool newValue); - /// - /// Makes the control a required field in a form context. - /// - [Parameter] - public bool Required - { - get { return this._required; } - set { - if (this._required != value || !IsPropDirty("Required")) { - MarkPropDirty("Required"); - } - this._required = value; - - } - } - private bool _invalid = false; - - partial void OnInvalidChanging(ref bool newValue); - /// - /// Control the validity of the control. - /// - [Parameter] - public bool Invalid - { - get { return this._invalid; } - set { - if (this._invalid != value || !IsPropDirty("Invalid")) { - MarkPropDirty("Invalid"); - } - this._invalid = value; - - } - } - - partial void FindByNameTextarea(string name, ref object item); - public override object FindByName(string name) - { - - var baseResult = base.FindByName(name); - if (baseResult != null) - { - return baseResult; - } - - object item = null; - FindByNameTextarea(name, ref item); - if (item != null) - { - return item; - } - - return null; - } - public async Task SetNativeElementAsync(Object element) - { - await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); - } - public void SetNativeElement(Object element) - { - InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); - } - /// - /// Selects all text within the control. - /// - public async Task SelectAsync() - { - await InvokeMethod("select", new object[] { }, new string[] { }); - } - public void Select() - { - InvokeMethodSync("select", new object[] { }, new string[] { }); - } - /// - /// Checks for validity of the control and shows the browser message if it invalid. - /// - public async Task ReportValidityAsync() - { - await InvokeMethod("reportValidity", new object[] { }, new string[] { }); - } - public void ReportValidity() - { - InvokeMethodSync("reportValidity", new object[] { }, new string[] { }); - } - /// - /// Checks for validity of the control and emits the invalid event if it invalid. - /// - public async Task CheckValidityAsync() - { - await InvokeMethod("checkValidity", new object[] { }, new string[] { }); - } - public void CheckValidity() - { - InvokeMethodSync("checkValidity", new object[] { }, new string[] { }); - } - /// - /// Sets a custom validation message for the control. - /// As long as `message` is not empty, the control is considered invalid. - /// - public async Task SetCustomValidityAsync(String message) - { - await InvokeMethod("setCustomValidity", new object[] { StringToString(message) }, new string[] { "String" }); - } - public void SetCustomValidity(String message) - { - InvokeMethodSync("setCustomValidity", new object[] { StringToString(message) }, new string[] { "String" }); - } - - private EventCallback? _valueChanged = null; - [Parameter] - public EventCallback ValueChanged - { - get - { - return this._valueChanged != null ? this._valueChanged.Value : EventCallback.Empty; - } - set - { - if (!value.Equals(EventCallback.Empty)) - { - if (!CompareEventCallbacks(value, _valueChanged, ref eventCallbacksCache)) - { - this.EnsureChangeHandled(); - - _valueChanged = value; - } - } - else - { - _valueChanged = null; - } - } - } - - private string _inputRef = null; - private string _inputScript = null; - [Parameter] - public string InputScript { - - set - { - if (value != this._inputScript) - { - this._inputScript = value; - this.OnRefChanged("Input", null, value, true, false, (string refName, object oldValue, object newValue) => { - this._inputRef = refName; - this.MarkPropDirty("InputRef"); - }); - } - } - get - { - return this._inputScript; - } - } - - partial void OnHandlingInput(IgbComponentValueChangedEventArgs args); - private EventCallback? _input = null; - [Parameter] - public EventCallback Input - { - get - { - return this._input != null ? this._input.Value : EventCallback.Empty; - } - set - { - if (!value.Equals(EventCallback.Empty)) - { - if (!CompareEventCallbacks(value, _input, ref eventCallbacksCache)) - { - _input = value; - this.SetHandler(this.Name, "Input", value, (args) => { - OnHandlingInput(args); - - }); - this.OnRefChanged("Input", null, "event:::Input", true, false, (refName, oldValue, newValue) => { - this._inputRef = refName; - this.MarkPropDirty("InputRef"); - }); - } - } - else - { - _input = null; - this.SetHandler(this.Name, "Input", null); - this.OnRefChanged("Input", null, null, true, false, (refName, oldValue, newValue) => { - this._inputRef = null; - this.MarkPropDirty("InputRef"); - }); - } - } - } - - private string _changeRef = null; - private string _changeScript = null; - [Parameter] - public string ChangeScript { - - set - { - if (value != this._changeScript) - { - this._changeScript = value; - this.OnRefChanged("Change", null, value, true, false, (string refName, object oldValue, object newValue) => { - this._changeRef = refName; - this.MarkPropDirty("ChangeRef"); - }); - } - } - get - { - return this._changeScript; - } - } - - partial void OnHandlingChange(IgbComponentValueChangedEventArgs args); - private EventCallback? _change = null; - [Parameter] - public EventCallback Change - { - get - { - return this._change != null ? this._change.Value : EventCallback.Empty; - } - set - { - if (!value.Equals(EventCallback.Empty)) - { - if (!CompareEventCallbacks(value, _change, ref eventCallbacksCache)) - { - _change = value; - this.SetHandler(this.Name, "Change", value, (args) => { - OnHandlingChange(args); - - var newValueValue = default(string); - - - { - newValueValue = (string)(args.Detail); - ; - OnEventUpdatingValue(this._value, ref newValueValue); - if (UseDirectRender) { - //TODO: maybe we should be doing this for everything. Need to make sure we don't infinity bounce though. - this.Value = newValueValue; - } else { - this._value = newValueValue; - } - OnPropertyPropagatedOut(Name, "Value"); - } - - if (!EventCallback.Empty.Equals(ValueChanged)) - { - var task = ValueChanged.InvokeAsync(newValueValue); - if (task.Exception != null) - { - throw task.Exception; - } - } - - }); - this.OnRefChanged("Change", null, "event:::Change", true, false, (refName, oldValue, newValue) => { - this._changeRef = refName; - this.MarkPropDirty("ChangeRef"); - }); - } - } - else - { - _change = null; - this.SetHandler(this.Name, "Change", null); - this.OnRefChanged("Change", null, null, true, false, (refName, oldValue, newValue) => { - this._changeRef = null; - this.MarkPropDirty("ChangeRef"); - }); - } - } - } - internal void EnsureChangeHandled() - { - if (EventCallback.Empty.Equals(this.Change)) - { - this.Change = new EventCallback(null, (Action)((e) => { })); this._change = null; - } - } - - - private string _focusRef = null; - private string _focusScript = null; - [Parameter] - public string FocusScript { - - set - { - if (value != this._focusScript) - { - this._focusScript = value; - this.OnRefChanged("Focus", null, value, true, false, (string refName, object oldValue, object newValue) => { - this._focusRef = refName; - this.MarkPropDirty("FocusRef"); - }); - } - } - get - { - return this._focusScript; - } - } - - partial void OnHandlingFocus(IgbVoidEventArgs args); - private EventCallback? _focus = null; - [Parameter] - public EventCallback Focus - { - get - { - return this._focus != null ? this._focus.Value : EventCallback.Empty; - } - set - { - if (!value.Equals(EventCallback.Empty)) - { - if (!CompareEventCallbacks(value, _focus, ref eventCallbacksCache)) - { - _focus = value; - this.SetHandler(this.Name, "Focus", value, (args) => { - OnHandlingFocus(args); - - }); - this.OnRefChanged("Focus", null, "nativeEvent:::Focus", true, false, (refName, oldValue, newValue) => { - this._focusRef = refName; - this.MarkPropDirty("FocusRef"); - }); - } - } - else - { - _focus = null; - this.SetHandler(this.Name, "Focus", null); - this.OnRefChanged("Focus", null, null, true, false, (refName, oldValue, newValue) => { - this._focusRef = null; - this.MarkPropDirty("FocusRef"); - }); - } - } - } - - private string _blurRef = null; - private string _blurScript = null; - [Parameter] - public string BlurScript { - - set - { - if (value != this._blurScript) - { - this._blurScript = value; - this.OnRefChanged("Blur", null, value, true, false, (string refName, object oldValue, object newValue) => { - this._blurRef = refName; - this.MarkPropDirty("BlurRef"); - }); - } - } - get - { - return this._blurScript; - } - } - - partial void OnHandlingBlur(IgbVoidEventArgs args); - private EventCallback? _blur = null; - [Parameter] - public EventCallback Blur - { - get - { - return this._blur != null ? this._blur.Value : EventCallback.Empty; - } - set - { - if (!value.Equals(EventCallback.Empty)) - { - if (!CompareEventCallbacks(value, _blur, ref eventCallbacksCache)) - { - _blur = value; - this.SetHandler(this.Name, "Blur", value, (args) => { - OnHandlingBlur(args); - - }); - this.OnRefChanged("Blur", null, "nativeEvent:::Blur", true, false, (refName, oldValue, newValue) => { - this._blurRef = refName; - this.MarkPropDirty("BlurRef"); - }); - } - } - else - { - _blur = null; - this.SetHandler(this.Name, "Blur", null); - this.OnRefChanged("Blur", null, null, true, false, (refName, oldValue, newValue) => { - this._blurRef = null; - this.MarkPropDirty("BlurRef"); - }); - } - } - } - - partial void OnEventUpdatingValue(string oldValue, ref string newValue); - - partial void SerializeCoreIgbTextarea(RendererSerializer ser); - - internal override void SerializeCore(RendererSerializer ser) - { - base.SerializeCore(ser); - - SerializeCoreIgbTextarea(ser); - - if (IsPropDirty("Autocomplete")) { ser.AddStringProp("autocomplete", this._autocomplete); } - if (IsPropDirty("Autocapitalize")) { ser.AddStringProp("autocapitalize", this._autocapitalize); } - if (IsPropDirty("InputMode")) { ser.AddStringProp("inputMode", this._inputMode); } - if (IsPropDirty("Label")) { ser.AddStringProp("label", this._label); } - if (IsPropDirty("MaxLength")) { ser.AddNumberProp("maxLength", this._maxLength); } - if (IsPropDirty("MinLength")) { ser.AddNumberProp("minLength", this._minLength); } - if (IsPropDirty("Outlined")) { ser.AddBooleanProp("outlined", this._outlined); } - if (IsPropDirty("Placeholder")) { ser.AddStringProp("placeholder", this._placeholder); } - if (IsPropDirty("ReadOnly")) { ser.AddBooleanProp("readOnly", this._readOnly); } - if (IsPropDirty("Resize")) { ser.AddEnumProp("resize", this._resize); } - if (IsPropDirty("Rows")) { ser.AddNumberProp("rows", this._rows); } - if (IsPropDirty("Value")) { ser.AddStringProp("value", this._value); } - if (IsPropDirty("Spellcheck")) { ser.AddBooleanProp("spellcheck", this._spellcheck); } - if (IsPropDirty("Wrap")) { ser.AddEnumProp("wrap", this._wrap); } - if (IsPropDirty("ValidateOnly")) { ser.AddBooleanProp("validateOnly", this._validateOnly); } - if (IsPropDirty("Disabled")) { ser.AddBooleanProp("disabled", this._disabled); } - if (IsPropDirty("Required")) { ser.AddBooleanProp("required", this._required); } - if (IsPropDirty("Invalid")) { ser.AddBooleanProp("invalid", this._invalid); } - if (IsPropDirty("InputRef")) { ser.AddStringProp("inputRef", this._inputRef); } - if (IsPropDirty("ChangeRef")) { ser.AddStringProp("changeRef", this._changeRef); } - if (IsPropDirty("FocusRef")) { ser.AddStringProp("focusRef", this._focusRef); } - if (IsPropDirty("BlurRef")) { ser.AddStringProp("blurRef", this._blurRef); } - - } - -} + + }); + this.OnRefChanged("Change", null, "event:::Change", true, false, (refName, oldValue, newValue) => + { + this._changeRef = refName; + this.MarkPropDirty("ChangeRef"); + }); + } + } + else + { + _change = null; + this.SetHandler(this.Name, "Change", null); + this.OnRefChanged("Change", null, null, true, false, (refName, oldValue, newValue) => + { + this._changeRef = null; + this.MarkPropDirty("ChangeRef"); + }); + } + } + } + internal void EnsureChangeHandled() + { + if (EventCallback.Empty.Equals(this.Change)) + { + this.Change = new EventCallback(null, (Action)((e) => { })); + this._change = null; + } + } + + private string _focusRef = null; + private string _focusScript = null; + [Parameter] + public string FocusScript + { + + set + { + if (value != this._focusScript) + { + this._focusScript = value; + this.OnRefChanged("Focus", null, value, true, false, (string refName, object oldValue, object newValue) => + { + this._focusRef = refName; + this.MarkPropDirty("FocusRef"); + }); + } + } + get + { + return this._focusScript; + } + } + + partial void OnHandlingFocus(IgbVoidEventArgs args); + private EventCallback? _focus = null; + [Parameter] + public EventCallback Focus + { + get + { + return this._focus != null ? this._focus.Value : EventCallback.Empty; + } + set + { + if (!value.Equals(EventCallback.Empty)) + { + if (!CompareEventCallbacks(value, _focus, ref eventCallbacksCache)) + { + _focus = value; + this.SetHandler(this.Name, "Focus", value, (args) => + { + OnHandlingFocus(args); + + }); + this.OnRefChanged("Focus", null, "nativeEvent:::Focus", true, false, (refName, oldValue, newValue) => + { + this._focusRef = refName; + this.MarkPropDirty("FocusRef"); + }); + } + } + else + { + _focus = null; + this.SetHandler(this.Name, "Focus", null); + this.OnRefChanged("Focus", null, null, true, false, (refName, oldValue, newValue) => + { + this._focusRef = null; + this.MarkPropDirty("FocusRef"); + }); + } + } + } + + private string _blurRef = null; + private string _blurScript = null; + [Parameter] + public string BlurScript + { + + set + { + if (value != this._blurScript) + { + this._blurScript = value; + this.OnRefChanged("Blur", null, value, true, false, (string refName, object oldValue, object newValue) => + { + this._blurRef = refName; + this.MarkPropDirty("BlurRef"); + }); + } + } + get + { + return this._blurScript; + } + } + + partial void OnHandlingBlur(IgbVoidEventArgs args); + private EventCallback? _blur = null; + [Parameter] + public EventCallback Blur + { + get + { + return this._blur != null ? this._blur.Value : EventCallback.Empty; + } + set + { + if (!value.Equals(EventCallback.Empty)) + { + if (!CompareEventCallbacks(value, _blur, ref eventCallbacksCache)) + { + _blur = value; + this.SetHandler(this.Name, "Blur", value, (args) => + { + OnHandlingBlur(args); + + }); + this.OnRefChanged("Blur", null, "nativeEvent:::Blur", true, false, (refName, oldValue, newValue) => + { + this._blurRef = refName; + this.MarkPropDirty("BlurRef"); + }); + } + } + else + { + _blur = null; + this.SetHandler(this.Name, "Blur", null); + this.OnRefChanged("Blur", null, null, true, false, (refName, oldValue, newValue) => + { + this._blurRef = null; + this.MarkPropDirty("BlurRef"); + }); + } + } + } + + partial void OnEventUpdatingValue(string oldValue, ref string newValue); + + partial void SerializeCoreIgbTextarea(RendererSerializer ser); + + internal override void SerializeCore(RendererSerializer ser) + { + base.SerializeCore(ser); + + SerializeCoreIgbTextarea(ser); + + if (IsPropDirty("Autocomplete")) + { ser.AddStringProp("autocomplete", this._autocomplete); } + if (IsPropDirty("Autocapitalize")) + { ser.AddStringProp("autocapitalize", this._autocapitalize); } + if (IsPropDirty("InputMode")) + { ser.AddStringProp("inputMode", this._inputMode); } + if (IsPropDirty("Label")) + { ser.AddStringProp("label", this._label); } + if (IsPropDirty("MaxLength")) + { ser.AddNumberProp("maxLength", this._maxLength); } + if (IsPropDirty("MinLength")) + { ser.AddNumberProp("minLength", this._minLength); } + if (IsPropDirty("Outlined")) + { ser.AddBooleanProp("outlined", this._outlined); } + if (IsPropDirty("Placeholder")) + { ser.AddStringProp("placeholder", this._placeholder); } + if (IsPropDirty("ReadOnly")) + { ser.AddBooleanProp("readOnly", this._readOnly); } + if (IsPropDirty("Resize")) + { ser.AddEnumProp("resize", this._resize); } + if (IsPropDirty("Rows")) + { ser.AddNumberProp("rows", this._rows); } + if (IsPropDirty("Value")) + { ser.AddStringProp("value", this._value); } + if (IsPropDirty("Spellcheck")) + { ser.AddBooleanProp("spellcheck", this._spellcheck); } + if (IsPropDirty("Wrap")) + { ser.AddEnumProp("wrap", this._wrap); } + if (IsPropDirty("ValidateOnly")) + { ser.AddBooleanProp("validateOnly", this._validateOnly); } + if (IsPropDirty("Disabled")) + { ser.AddBooleanProp("disabled", this._disabled); } + if (IsPropDirty("Required")) + { ser.AddBooleanProp("required", this._required); } + if (IsPropDirty("Invalid")) + { ser.AddBooleanProp("invalid", this._invalid); } + if (IsPropDirty("InputRef")) + { ser.AddStringProp("inputRef", this._inputRef); } + if (IsPropDirty("ChangeRef")) + { ser.AddStringProp("changeRef", this._changeRef); } + if (IsPropDirty("FocusRef")) + { ser.AddStringProp("focusRef", this._focusRef); } + if (IsPropDirty("BlurRef")) + { ser.AddStringProp("blurRef", this._blurRef); } + + } + + } } diff --git a/src/components/Blazor/TextareaModule.cs b/src/components/Blazor/TextareaModule.cs index f8e14922..45c9b579 100644 --- a/src/components/Blazor/TextareaModule.cs +++ b/src/components/Blazor/TextareaModule.cs @@ -1,23 +1,20 @@ -using System; -using System.Collections.Generic; -using System.Runtime.CompilerServices; -using System.Text; -using System.Collections.Generic; - namespace IgniteUI.Blazor.Controls { - public partial class IgbTextareaModule { - public static void Register(IIgniteUIBlazor runtime) { + public partial class IgbTextareaModule + { + public static void Register(IIgniteUIBlazor runtime) + { ModuleLoader.Load(runtime, "WebTextareaModule"); - } - public static void MarkIsLoadRequested(IIgniteUIBlazor runtime) { + public static void MarkIsLoadRequested(IIgniteUIBlazor runtime) + { ModuleLoader.MarkIsLoadRequested(runtime, "WebTextareaModule"); } - public static bool IsLoadRequested(IIgniteUIBlazor runtime) { + public static bool IsLoadRequested(IIgniteUIBlazor runtime) + { return ModuleLoader.IsLoadRequested(runtime, "WebTextareaModule"); } } diff --git a/src/components/Blazor/TextareaResize.cs b/src/components/Blazor/TextareaResize.cs index 0dabd5b2..703c80bf 100644 --- a/src/components/Blazor/TextareaResize.cs +++ b/src/components/Blazor/TextareaResize.cs @@ -1,9 +1,10 @@ namespace IgniteUI.Blazor.Controls { -public enum TextareaResize { - Vertical, - Auto, - None + public enum TextareaResize + { + Vertical, + Auto, + None -} + } } diff --git a/src/components/Blazor/TextareaWrap.cs b/src/components/Blazor/TextareaWrap.cs index b7685e6f..9fbb5a2a 100644 --- a/src/components/Blazor/TextareaWrap.cs +++ b/src/components/Blazor/TextareaWrap.cs @@ -1,9 +1,10 @@ namespace IgniteUI.Blazor.Controls { -public enum TextareaWrap { - Soft, - Hard, - Off + public enum TextareaWrap + { + Soft, + Hard, + Off -} + } } diff --git a/src/components/Blazor/Theme.cs b/src/components/Blazor/Theme.cs index a024fae3..e947f2e2 100644 --- a/src/components/Blazor/Theme.cs +++ b/src/components/Blazor/Theme.cs @@ -1,10 +1,11 @@ namespace IgniteUI.Blazor.Controls { -public enum Theme { - Material, - Bootstrap, - Indigo, - Fluent + public enum Theme + { + Material, + Bootstrap, + Indigo, + Fluent -} + } } diff --git a/src/components/Blazor/ThemeProvider.cs b/src/components/Blazor/ThemeProvider.cs index 6e28d0f0..22e348a8 100644 --- a/src/components/Blazor/ThemeProvider.cs +++ b/src/components/Blazor/ThemeProvider.cs @@ -1,150 +1,151 @@ - -using System; using Microsoft.AspNetCore.Components; -using Microsoft.AspNetCore.Components.Rendering; -using System.Threading.Tasks; -using System.Collections.Generic; -using System.Linq; namespace IgniteUI.Blazor.Controls { - /// -/// A theme provider component that uses Lit context to provide theme information -/// to descendant components. -/// This component allows you to scope a theme to a specific part of the page. -/// All library components within this provider will use the specified theme -/// instead of the global theme. -/// -public partial class IgbThemeProvider: BaseRendererControl { - public override string Type { get { return "WebThemeProvider"; } } - - protected override void EnsureModulesLoaded() - { - if (!IgbThemeProviderModule.IsLoadRequested(IgBlazor)) - { - IgbThemeProviderModule.Register(IgBlazor); - } - } - - protected override string ResolveDisplay() - { - return "inline-block"; - } - - protected override bool SupportsVisualChildren - { - get - { - return true; - } - } - - protected override bool UseDirectRender - { - get - { - return true; - } - } - - protected override string DirectRenderElementName - { - get - { - return "igc-theme-provider"; - } - } - - protected override ControlEventBehavior DefaultEventBehavior - { - get { return ControlEventBehavior.Immediate; } - } - - public IgbThemeProvider(): base() { - OnCreatedIgbThemeProvider(); - - - } - - partial void OnCreatedIgbThemeProvider(); - - private Theme _theme = Theme.Material; - - partial void OnThemeChanging(ref Theme newValue); - /// - /// The theme to provide to descendant components. - /// - [Parameter] - public Theme Theme - { - get { return this._theme; } - set { - if (this._theme != value || !IsPropDirty("Theme")) { - MarkPropDirty("Theme"); - } - this._theme = value; - - } - } - private ThemeVariant _variant = ThemeVariant.Light; - - partial void OnVariantChanging(ref ThemeVariant newValue); - /// - /// The theme variant to provide to descendant components. - /// - [Parameter] - public ThemeVariant Variant - { - get { return this._variant; } - set { - if (this._variant != value || !IsPropDirty("Variant")) { - MarkPropDirty("Variant"); - } - this._variant = value; - - } - } - - partial void FindByNameThemeProvider(string name, ref object item); - public override object FindByName(string name) - { - - var baseResult = base.FindByName(name); - if (baseResult != null) - { - return baseResult; - } - - object item = null; - FindByNameThemeProvider(name, ref item); - if (item != null) - { - return item; - } - - return null; - } - public async Task SetNativeElementAsync(Object element) - { - await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); - } - public void SetNativeElement(Object element) - { - InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); - } - - partial void SerializeCoreIgbThemeProvider(RendererSerializer ser); - - internal override void SerializeCore(RendererSerializer ser) - { - base.SerializeCore(ser); - - SerializeCoreIgbThemeProvider(ser); - - if (IsPropDirty("Theme")) { ser.AddEnumProp("theme", this._theme); } - if (IsPropDirty("Variant")) { ser.AddEnumProp("variant", this._variant); } - - } - -} + /// + /// A theme provider component that uses Lit context to provide theme information + /// to descendant components. + /// This component allows you to scope a theme to a specific part of the page. + /// All library components within this provider will use the specified theme + /// instead of the global theme. + /// + public partial class IgbThemeProvider : BaseRendererControl + { + public override string Type { get { return "WebThemeProvider"; } } + + protected override void EnsureModulesLoaded() + { + if (!IgbThemeProviderModule.IsLoadRequested(IgBlazor)) + { + IgbThemeProviderModule.Register(IgBlazor); + } + } + + protected override string ResolveDisplay() + { + return "inline-block"; + } + + protected override bool SupportsVisualChildren + { + get + { + return true; + } + } + + protected override bool UseDirectRender + { + get + { + return true; + } + } + + protected override string DirectRenderElementName + { + get + { + return "igc-theme-provider"; + } + } + + protected override ControlEventBehavior DefaultEventBehavior + { + get { return ControlEventBehavior.Immediate; } + } + + public IgbThemeProvider() : base() + { + OnCreatedIgbThemeProvider(); + + } + + partial void OnCreatedIgbThemeProvider(); + + private Theme _theme = Theme.Material; + + partial void OnThemeChanging(ref Theme newValue); + /// + /// The theme to provide to descendant components. + /// + [Parameter] + public Theme Theme + { + get { return this._theme; } + set + { + if (this._theme != value || !IsPropDirty("Theme")) + { + MarkPropDirty("Theme"); + } + this._theme = value; + + } + } + private ThemeVariant _variant = ThemeVariant.Light; + + partial void OnVariantChanging(ref ThemeVariant newValue); + /// + /// The theme variant to provide to descendant components. + /// + [Parameter] + public ThemeVariant Variant + { + get { return this._variant; } + set + { + if (this._variant != value || !IsPropDirty("Variant")) + { + MarkPropDirty("Variant"); + } + this._variant = value; + + } + } + + partial void FindByNameThemeProvider(string name, ref object item); + public override object FindByName(string name) + { + + var baseResult = base.FindByName(name); + if (baseResult != null) + { + return baseResult; + } + + object item = null; + FindByNameThemeProvider(name, ref item); + if (item != null) + { + return item; + } + + return null; + } + public async Task SetNativeElementAsync(Object element) + { + await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + } + public void SetNativeElement(Object element) + { + InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + } + + partial void SerializeCoreIgbThemeProvider(RendererSerializer ser); + + internal override void SerializeCore(RendererSerializer ser) + { + base.SerializeCore(ser); + + SerializeCoreIgbThemeProvider(ser); + + if (IsPropDirty("Theme")) + { ser.AddEnumProp("theme", this._theme); } + if (IsPropDirty("Variant")) + { ser.AddEnumProp("variant", this._variant); } + + } + + } } diff --git a/src/components/Blazor/ThemeProviderModule.cs b/src/components/Blazor/ThemeProviderModule.cs index 682c1db7..a439b114 100644 --- a/src/components/Blazor/ThemeProviderModule.cs +++ b/src/components/Blazor/ThemeProviderModule.cs @@ -1,23 +1,20 @@ -using System; -using System.Collections.Generic; -using System.Runtime.CompilerServices; -using System.Text; -using System.Collections.Generic; - namespace IgniteUI.Blazor.Controls { - public partial class IgbThemeProviderModule { - public static void Register(IIgniteUIBlazor runtime) { + public partial class IgbThemeProviderModule + { + public static void Register(IIgniteUIBlazor runtime) + { ModuleLoader.Load(runtime, "WebThemeProviderModule"); - } - public static void MarkIsLoadRequested(IIgniteUIBlazor runtime) { + public static void MarkIsLoadRequested(IIgniteUIBlazor runtime) + { ModuleLoader.MarkIsLoadRequested(runtime, "WebThemeProviderModule"); } - public static bool IsLoadRequested(IIgniteUIBlazor runtime) { + public static bool IsLoadRequested(IIgniteUIBlazor runtime) + { return ModuleLoader.IsLoadRequested(runtime, "WebThemeProviderModule"); } } diff --git a/src/components/Blazor/ThemeVariant.cs b/src/components/Blazor/ThemeVariant.cs index b3262076..8d04f0c3 100644 --- a/src/components/Blazor/ThemeVariant.cs +++ b/src/components/Blazor/ThemeVariant.cs @@ -1,8 +1,9 @@ namespace IgniteUI.Blazor.Controls { -public enum ThemeVariant { - Light, - Dark + public enum ThemeVariant + { + Light, + Dark -} + } } diff --git a/src/components/Blazor/Tile.cs b/src/components/Blazor/Tile.cs index a6d2a193..18e6dac1 100644 --- a/src/components/Blazor/Tile.cs +++ b/src/components/Blazor/Tile.cs @@ -1,782 +1,852 @@ - -using System; using Microsoft.AspNetCore.Components; -using Microsoft.AspNetCore.Components.Rendering; -using System.Threading.Tasks; -using System.Collections.Generic; -using System.Linq; namespace IgniteUI.Blazor.Controls { - /// -/// The tile component is used within the `igc-tile-manager` as a container -/// for displaying various types of information. -/// -public partial class IgbTile: BaseRendererControl { - public override string Type { get { return "WebTile"; } } - - protected override void EnsureModulesLoaded() - { - if (!IgbTileModule.IsLoadRequested(IgBlazor)) - { - IgbTileModule.Register(IgBlazor); - } - } - - protected override string ResolveDisplay() + /// + /// The tile component is used within the `igc-tile-manager` as a container + /// for displaying various types of information. + /// + public partial class IgbTile : BaseRendererControl + { + public override string Type { get { return "WebTile"; } } + + protected override void EnsureModulesLoaded() + { + if (!IgbTileModule.IsLoadRequested(IgBlazor)) + { + IgbTileModule.Register(IgBlazor); + } + } + + protected override string ResolveDisplay() + { + return "inline-block"; + } + + protected override bool SupportsVisualChildren + { + get + { + return true; + } + } + + protected override bool UseDirectRender + { + get + { + return true; + } + } + + protected override string DirectRenderElementName + { + get + { + return "igc-tile"; + } + } + + protected override ControlEventBehavior DefaultEventBehavior + { + get { return ControlEventBehavior.Immediate; } + } + + public IgbTile() : base() + { + OnCreatedIgbTile(); + + } + + partial void OnCreatedIgbTile(); + + private double _colSpan = 0; + + partial void OnColSpanChanging(ref double newValue); + /// + /// The number of columns the tile will span. + /// + [Parameter] + public double ColSpan + { + get { return this._colSpan; } + set + { + if (this._colSpan != value || !IsPropDirty("ColSpan")) + { + MarkPropDirty("ColSpan"); + } + this._colSpan = value; + + } + } + private double _rowSpan = 0; + + partial void OnRowSpanChanging(ref double newValue); + /// + /// The number of rows the tile will span. + /// + [Parameter] + public double RowSpan + { + get { return this._rowSpan; } + set + { + if (this._rowSpan != value || !IsPropDirty("RowSpan")) + { + MarkPropDirty("RowSpan"); + } + this._rowSpan = value; + + } + } + private double? _colStart = 0; + + partial void OnColStartChanging(ref double? newValue); + /// + /// The starting column for the tile. + /// + [Parameter] + public double? ColStart + { + get { return this._colStart; } + set + { + if (this._colStart != value || !IsPropDirty("ColStart")) + { + MarkPropDirty("ColStart"); + } + this._colStart = value; + + } + } + private double? _rowStart = 0; + + partial void OnRowStartChanging(ref double? newValue); + /// + /// The starting row for the tile. + /// + [Parameter] + public double? RowStart + { + get { return this._rowStart; } + set + { + if (this._rowStart != value || !IsPropDirty("RowStart")) + { + MarkPropDirty("RowStart"); + } + this._rowStart = value; + + } + } + public async Task GetFullscreenAsync() + { + var iv = await InvokeMethod("p:Fullscreen", new object[] { }, new string[] { }); + return ReturnToBoolean(iv); + } + public bool GetFullscreen() + { + var iv = InvokeMethodSync("p:Fullscreen", new object[] { }, new string[] { }); + return ReturnToBoolean(iv); + } + private bool _maximized = false; + + partial void OnMaximizedChanging(ref bool newValue); + /// + /// Indicates whether the tile occupies all available space within the layout. + /// + [Parameter] + public bool Maximized + { + get { return this._maximized; } + set + { + if (this._maximized != value || !IsPropDirty("Maximized")) + { + MarkPropDirty("Maximized"); + } + this._maximized = value; + + } + } + private bool _disableResize = false; + + partial void OnDisableResizeChanging(ref bool newValue); + /// + /// Indicates whether to disable tile resize behavior regardless + /// ot its tile manager parent settings. + /// + [Parameter] + public bool DisableResize + { + get { return this._disableResize; } + set + { + if (this._disableResize != value || !IsPropDirty("DisableResize")) + { + MarkPropDirty("DisableResize"); + } + this._disableResize = value; + + } + } + private bool _disableFullscreen = false; + + partial void OnDisableFullscreenChanging(ref bool newValue); + /// + /// Whether to disable the rendering of the tile `fullscreen-action` slot and its + /// default fullscreen action button. + /// + [Parameter] + public bool DisableFullscreen + { + get { return this._disableFullscreen; } + set + { + if (this._disableFullscreen != value || !IsPropDirty("DisableFullscreen")) + { + MarkPropDirty("DisableFullscreen"); + } + this._disableFullscreen = value; + + } + } + private bool _disableMaximize = false; + + partial void OnDisableMaximizeChanging(ref bool newValue); + /// + /// Whether to disable the rendering of the tile `maximize-action` slot and its + /// default maximize action button. + /// + [Parameter] + public bool DisableMaximize + { + get { return this._disableMaximize; } + set + { + if (this._disableMaximize != value || !IsPropDirty("DisableMaximize")) + { + MarkPropDirty("DisableMaximize"); + } + this._disableMaximize = value; + + } + } + private double _position = 0; + + partial void OnPositionChanging(ref double newValue); + /// + /// Gets/sets the tile's visual position in the layout. + /// Corresponds to the CSS `order` property. + /// + [Parameter] + public double Position + { + get { return this._position; } + set + { + if (this._position != value || !IsPropDirty("Position")) + { + MarkPropDirty("Position"); + } + this._position = value; + + } + } + + partial void FindByNameTile(string name, ref object item); + public override object FindByName(string name) + { + + var baseResult = base.FindByName(name); + if (baseResult != null) + { + return baseResult; + } + + object item = null; + FindByNameTile(name, ref item); + if (item != null) + { + return item; + } + + return null; + } + public async Task SetNativeElementAsync(Object element) + { + await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + } + public void SetNativeElement(Object element) + { + InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + } + + private string _tileFullscreenRef = null; + private string _tileFullscreenScript = null; + [Parameter] + public string TileFullscreenScript + { + + set + { + if (value != this._tileFullscreenScript) + { + this._tileFullscreenScript = value; + this.OnRefChanged("TileFullscreen", null, value, true, false, (string refName, object oldValue, object newValue) => + { + this._tileFullscreenRef = refName; + this.MarkPropDirty("TileFullscreenRef"); + }); + } + } + get + { + return this._tileFullscreenScript; + } + } + + partial void OnHandlingTileFullscreen(IgbTileChangeStateEventArgs args); + private EventCallback? _tileFullscreen = null; + [Parameter] + public EventCallback TileFullscreen + { + get + { + return this._tileFullscreen != null ? this._tileFullscreen.Value : EventCallback.Empty; + } + set + { + if (!value.Equals(EventCallback.Empty)) + { + if (!CompareEventCallbacks(value, _tileFullscreen, ref eventCallbacksCache)) + { + _tileFullscreen = value; + this.SetHandler(this.Name, "TileFullscreen", value, (args) => { - return "inline-block"; - } + OnHandlingTileFullscreen(args); - protected override bool SupportsVisualChildren + }); + this.OnRefChanged("TileFullscreen", null, "event:::TileFullscreen", true, false, (refName, oldValue, newValue) => { - get - { - return true; - } - } + this._tileFullscreenRef = refName; + this.MarkPropDirty("TileFullscreenRef"); + }); + } + } + else + { + _tileFullscreen = null; + this.SetHandler(this.Name, "TileFullscreen", null); + this.OnRefChanged("TileFullscreen", null, null, true, false, (refName, oldValue, newValue) => + { + this._tileFullscreenRef = null; + this.MarkPropDirty("TileFullscreenRef"); + }); + } + } + } - protected override bool UseDirectRender + private string _tileMaximizeRef = null; + private string _tileMaximizeScript = null; + [Parameter] + public string TileMaximizeScript + { + + set + { + if (value != this._tileMaximizeScript) + { + this._tileMaximizeScript = value; + this.OnRefChanged("TileMaximize", null, value, true, false, (string refName, object oldValue, object newValue) => + { + this._tileMaximizeRef = refName; + this.MarkPropDirty("TileMaximizeRef"); + }); + } + } + get + { + return this._tileMaximizeScript; + } + } + + partial void OnHandlingTileMaximize(IgbTileChangeStateEventArgs args); + private EventCallback? _tileMaximize = null; + [Parameter] + public EventCallback TileMaximize + { + get + { + return this._tileMaximize != null ? this._tileMaximize.Value : EventCallback.Empty; + } + set + { + if (!value.Equals(EventCallback.Empty)) + { + if (!CompareEventCallbacks(value, _tileMaximize, ref eventCallbacksCache)) + { + _tileMaximize = value; + this.SetHandler(this.Name, "TileMaximize", value, (args) => { - get - { - return true; - } - } + OnHandlingTileMaximize(args); - protected override string DirectRenderElementName + }); + this.OnRefChanged("TileMaximize", null, "event:::TileMaximize", true, false, (refName, oldValue, newValue) => { - get - { - return "igc-tile"; - } - } - - protected override ControlEventBehavior DefaultEventBehavior - { - get { return ControlEventBehavior.Immediate; } - } - - public IgbTile(): base() { - OnCreatedIgbTile(); - - - } - - partial void OnCreatedIgbTile(); - - private double _colSpan = 0; - - partial void OnColSpanChanging(ref double newValue); - /// - /// The number of columns the tile will span. - /// - [Parameter] - public double ColSpan - { - get { return this._colSpan; } - set { - if (this._colSpan != value || !IsPropDirty("ColSpan")) { - MarkPropDirty("ColSpan"); - } - this._colSpan = value; - - } - } - private double _rowSpan = 0; - - partial void OnRowSpanChanging(ref double newValue); - /// - /// The number of rows the tile will span. - /// - [Parameter] - public double RowSpan - { - get { return this._rowSpan; } - set { - if (this._rowSpan != value || !IsPropDirty("RowSpan")) { - MarkPropDirty("RowSpan"); - } - this._rowSpan = value; - - } - } - private double? _colStart = 0; - - partial void OnColStartChanging(ref double? newValue); - /// - /// The starting column for the tile. - /// - [Parameter] - public double? ColStart - { - get { return this._colStart; } - set { - if (this._colStart != value || !IsPropDirty("ColStart")) { - MarkPropDirty("ColStart"); - } - this._colStart = value; - - } - } - private double? _rowStart = 0; - - partial void OnRowStartChanging(ref double? newValue); - /// - /// The starting row for the tile. - /// - [Parameter] - public double? RowStart - { - get { return this._rowStart; } - set { - if (this._rowStart != value || !IsPropDirty("RowStart")) { - MarkPropDirty("RowStart"); - } - this._rowStart = value; - - } - } - public async Task GetFullscreenAsync() - { - var iv = await InvokeMethod("p:Fullscreen", new object[] { }, new string[] { }); - return ReturnToBoolean(iv); - } - public bool GetFullscreen() - { - var iv = InvokeMethodSync("p:Fullscreen", new object[] { }, new string[] { }); - return ReturnToBoolean(iv); - } - private bool _maximized = false; - - partial void OnMaximizedChanging(ref bool newValue); - /// - /// Indicates whether the tile occupies all available space within the layout. - /// - [Parameter] - public bool Maximized - { - get { return this._maximized; } - set { - if (this._maximized != value || !IsPropDirty("Maximized")) { - MarkPropDirty("Maximized"); - } - this._maximized = value; - - } - } - private bool _disableResize = false; - - partial void OnDisableResizeChanging(ref bool newValue); - /// - /// Indicates whether to disable tile resize behavior regardless - /// ot its tile manager parent settings. - /// - [Parameter] - public bool DisableResize - { - get { return this._disableResize; } - set { - if (this._disableResize != value || !IsPropDirty("DisableResize")) { - MarkPropDirty("DisableResize"); - } - this._disableResize = value; - - } - } - private bool _disableFullscreen = false; - - partial void OnDisableFullscreenChanging(ref bool newValue); - /// - /// Whether to disable the rendering of the tile `fullscreen-action` slot and its - /// default fullscreen action button. - /// - [Parameter] - public bool DisableFullscreen - { - get { return this._disableFullscreen; } - set { - if (this._disableFullscreen != value || !IsPropDirty("DisableFullscreen")) { - MarkPropDirty("DisableFullscreen"); - } - this._disableFullscreen = value; - - } - } - private bool _disableMaximize = false; - - partial void OnDisableMaximizeChanging(ref bool newValue); - /// - /// Whether to disable the rendering of the tile `maximize-action` slot and its - /// default maximize action button. - /// - [Parameter] - public bool DisableMaximize - { - get { return this._disableMaximize; } - set { - if (this._disableMaximize != value || !IsPropDirty("DisableMaximize")) { - MarkPropDirty("DisableMaximize"); - } - this._disableMaximize = value; - - } - } - private double _position = 0; - - partial void OnPositionChanging(ref double newValue); - /// - /// Gets/sets the tile's visual position in the layout. - /// Corresponds to the CSS `order` property. - /// - [Parameter] - public double Position - { - get { return this._position; } - set { - if (this._position != value || !IsPropDirty("Position")) { - MarkPropDirty("Position"); - } - this._position = value; - - } - } - - partial void FindByNameTile(string name, ref object item); - public override object FindByName(string name) - { - - var baseResult = base.FindByName(name); - if (baseResult != null) - { - return baseResult; - } - - object item = null; - FindByNameTile(name, ref item); - if (item != null) - { - return item; - } - - return null; - } - public async Task SetNativeElementAsync(Object element) - { - await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); - } - public void SetNativeElement(Object element) - { - InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); - } - - private string _tileFullscreenRef = null; - private string _tileFullscreenScript = null; - [Parameter] - public string TileFullscreenScript { - - set - { - if (value != this._tileFullscreenScript) - { - this._tileFullscreenScript = value; - this.OnRefChanged("TileFullscreen", null, value, true, false, (string refName, object oldValue, object newValue) => { - this._tileFullscreenRef = refName; - this.MarkPropDirty("TileFullscreenRef"); - }); - } - } - get - { - return this._tileFullscreenScript; - } - } - - partial void OnHandlingTileFullscreen(IgbTileChangeStateEventArgs args); - private EventCallback? _tileFullscreen = null; - [Parameter] - public EventCallback TileFullscreen - { - get - { - return this._tileFullscreen != null ? this._tileFullscreen.Value : EventCallback.Empty; - } - set - { - if (!value.Equals(EventCallback.Empty)) - { - if (!CompareEventCallbacks(value, _tileFullscreen, ref eventCallbacksCache)) - { - _tileFullscreen = value; - this.SetHandler(this.Name, "TileFullscreen", value, (args) => { - OnHandlingTileFullscreen(args); - - }); - this.OnRefChanged("TileFullscreen", null, "event:::TileFullscreen", true, false, (refName, oldValue, newValue) => { - this._tileFullscreenRef = refName; - this.MarkPropDirty("TileFullscreenRef"); - }); - } - } - else - { - _tileFullscreen = null; - this.SetHandler(this.Name, "TileFullscreen", null); - this.OnRefChanged("TileFullscreen", null, null, true, false, (refName, oldValue, newValue) => { - this._tileFullscreenRef = null; - this.MarkPropDirty("TileFullscreenRef"); - }); - } - } - } - - private string _tileMaximizeRef = null; - private string _tileMaximizeScript = null; - [Parameter] - public string TileMaximizeScript { - - set - { - if (value != this._tileMaximizeScript) - { - this._tileMaximizeScript = value; - this.OnRefChanged("TileMaximize", null, value, true, false, (string refName, object oldValue, object newValue) => { - this._tileMaximizeRef = refName; - this.MarkPropDirty("TileMaximizeRef"); - }); - } - } - get - { - return this._tileMaximizeScript; - } - } - - partial void OnHandlingTileMaximize(IgbTileChangeStateEventArgs args); - private EventCallback? _tileMaximize = null; - [Parameter] - public EventCallback TileMaximize - { - get - { - return this._tileMaximize != null ? this._tileMaximize.Value : EventCallback.Empty; - } - set - { - if (!value.Equals(EventCallback.Empty)) - { - if (!CompareEventCallbacks(value, _tileMaximize, ref eventCallbacksCache)) - { - _tileMaximize = value; - this.SetHandler(this.Name, "TileMaximize", value, (args) => { - OnHandlingTileMaximize(args); - - }); - this.OnRefChanged("TileMaximize", null, "event:::TileMaximize", true, false, (refName, oldValue, newValue) => { - this._tileMaximizeRef = refName; - this.MarkPropDirty("TileMaximizeRef"); - }); - } - } - else - { - _tileMaximize = null; - this.SetHandler(this.Name, "TileMaximize", null); - this.OnRefChanged("TileMaximize", null, null, true, false, (refName, oldValue, newValue) => { - this._tileMaximizeRef = null; - this.MarkPropDirty("TileMaximizeRef"); - }); - } - } - } - - private string _tileDragStartRef = null; - private string _tileDragStartScript = null; - [Parameter] - public string TileDragStartScript { - - set - { - if (value != this._tileDragStartScript) - { - this._tileDragStartScript = value; - this.OnRefChanged("TileDragStart", null, value, true, false, (string refName, object oldValue, object newValue) => { - this._tileDragStartRef = refName; - this.MarkPropDirty("TileDragStartRef"); - }); - } - } - get - { - return this._tileDragStartScript; - } - } - - partial void OnHandlingTileDragStart(IgbTileComponentEventArgs args); - private EventCallback? _tileDragStart = null; - [Parameter] - public EventCallback TileDragStart - { - get - { - return this._tileDragStart != null ? this._tileDragStart.Value : EventCallback.Empty; - } - set - { - if (!value.Equals(EventCallback.Empty)) - { - if (!CompareEventCallbacks(value, _tileDragStart, ref eventCallbacksCache)) - { - _tileDragStart = value; - this.SetHandler(this.Name, "TileDragStart", value, (args) => { - OnHandlingTileDragStart(args); - - }); - this.OnRefChanged("TileDragStart", null, "event:::TileDragStart", true, false, (refName, oldValue, newValue) => { - this._tileDragStartRef = refName; - this.MarkPropDirty("TileDragStartRef"); - }); - } - } - else - { - _tileDragStart = null; - this.SetHandler(this.Name, "TileDragStart", null); - this.OnRefChanged("TileDragStart", null, null, true, false, (refName, oldValue, newValue) => { - this._tileDragStartRef = null; - this.MarkPropDirty("TileDragStartRef"); - }); - } - } - } - - private string _tileDragEndRef = null; - private string _tileDragEndScript = null; - [Parameter] - public string TileDragEndScript { - - set - { - if (value != this._tileDragEndScript) - { - this._tileDragEndScript = value; - this.OnRefChanged("TileDragEnd", null, value, true, false, (string refName, object oldValue, object newValue) => { - this._tileDragEndRef = refName; - this.MarkPropDirty("TileDragEndRef"); - }); - } - } - get - { - return this._tileDragEndScript; - } - } - - partial void OnHandlingTileDragEnd(IgbTileComponentEventArgs args); - private EventCallback? _tileDragEnd = null; - [Parameter] - public EventCallback TileDragEnd - { - get - { - return this._tileDragEnd != null ? this._tileDragEnd.Value : EventCallback.Empty; - } - set - { - if (!value.Equals(EventCallback.Empty)) - { - if (!CompareEventCallbacks(value, _tileDragEnd, ref eventCallbacksCache)) - { - _tileDragEnd = value; - this.SetHandler(this.Name, "TileDragEnd", value, (args) => { - OnHandlingTileDragEnd(args); - - }); - this.OnRefChanged("TileDragEnd", null, "event:::TileDragEnd", true, false, (refName, oldValue, newValue) => { - this._tileDragEndRef = refName; - this.MarkPropDirty("TileDragEndRef"); - }); - } - } - else - { - _tileDragEnd = null; - this.SetHandler(this.Name, "TileDragEnd", null); - this.OnRefChanged("TileDragEnd", null, null, true, false, (refName, oldValue, newValue) => { - this._tileDragEndRef = null; - this.MarkPropDirty("TileDragEndRef"); - }); - } - } - } - - private string _tileDragCancelRef = null; - private string _tileDragCancelScript = null; - [Parameter] - public string TileDragCancelScript { - - set - { - if (value != this._tileDragCancelScript) - { - this._tileDragCancelScript = value; - this.OnRefChanged("TileDragCancel", null, value, true, false, (string refName, object oldValue, object newValue) => { - this._tileDragCancelRef = refName; - this.MarkPropDirty("TileDragCancelRef"); - }); - } - } - get - { - return this._tileDragCancelScript; - } - } - - partial void OnHandlingTileDragCancel(IgbTileComponentEventArgs args); - private EventCallback? _tileDragCancel = null; - [Parameter] - public EventCallback TileDragCancel - { - get - { - return this._tileDragCancel != null ? this._tileDragCancel.Value : EventCallback.Empty; - } - set - { - if (!value.Equals(EventCallback.Empty)) - { - if (!CompareEventCallbacks(value, _tileDragCancel, ref eventCallbacksCache)) - { - _tileDragCancel = value; - this.SetHandler(this.Name, "TileDragCancel", value, (args) => { - OnHandlingTileDragCancel(args); - - }); - this.OnRefChanged("TileDragCancel", null, "event:::TileDragCancel", true, false, (refName, oldValue, newValue) => { - this._tileDragCancelRef = refName; - this.MarkPropDirty("TileDragCancelRef"); - }); - } - } - else - { - _tileDragCancel = null; - this.SetHandler(this.Name, "TileDragCancel", null); - this.OnRefChanged("TileDragCancel", null, null, true, false, (refName, oldValue, newValue) => { - this._tileDragCancelRef = null; - this.MarkPropDirty("TileDragCancelRef"); - }); - } - } - } - - private string _tileResizeStartRef = null; - private string _tileResizeStartScript = null; - [Parameter] - public string TileResizeStartScript { - - set - { - if (value != this._tileResizeStartScript) - { - this._tileResizeStartScript = value; - this.OnRefChanged("TileResizeStart", null, value, true, false, (string refName, object oldValue, object newValue) => { - this._tileResizeStartRef = refName; - this.MarkPropDirty("TileResizeStartRef"); - }); - } - } - get - { - return this._tileResizeStartScript; - } - } - - partial void OnHandlingTileResizeStart(IgbTileComponentEventArgs args); - private EventCallback? _tileResizeStart = null; - [Parameter] - public EventCallback TileResizeStart - { - get - { - return this._tileResizeStart != null ? this._tileResizeStart.Value : EventCallback.Empty; - } - set - { - if (!value.Equals(EventCallback.Empty)) - { - if (!CompareEventCallbacks(value, _tileResizeStart, ref eventCallbacksCache)) - { - _tileResizeStart = value; - this.SetHandler(this.Name, "TileResizeStart", value, (args) => { - OnHandlingTileResizeStart(args); - - }); - this.OnRefChanged("TileResizeStart", null, "event:::TileResizeStart", true, false, (refName, oldValue, newValue) => { - this._tileResizeStartRef = refName; - this.MarkPropDirty("TileResizeStartRef"); - }); - } - } - else - { - _tileResizeStart = null; - this.SetHandler(this.Name, "TileResizeStart", null); - this.OnRefChanged("TileResizeStart", null, null, true, false, (refName, oldValue, newValue) => { - this._tileResizeStartRef = null; - this.MarkPropDirty("TileResizeStartRef"); - }); - } - } - } - - private string _tileResizeEndRef = null; - private string _tileResizeEndScript = null; - [Parameter] - public string TileResizeEndScript { - - set - { - if (value != this._tileResizeEndScript) - { - this._tileResizeEndScript = value; - this.OnRefChanged("TileResizeEnd", null, value, true, false, (string refName, object oldValue, object newValue) => { - this._tileResizeEndRef = refName; - this.MarkPropDirty("TileResizeEndRef"); - }); - } - } - get - { - return this._tileResizeEndScript; - } - } - - partial void OnHandlingTileResizeEnd(IgbTileComponentEventArgs args); - private EventCallback? _tileResizeEnd = null; - [Parameter] - public EventCallback TileResizeEnd - { - get - { - return this._tileResizeEnd != null ? this._tileResizeEnd.Value : EventCallback.Empty; - } - set - { - if (!value.Equals(EventCallback.Empty)) - { - if (!CompareEventCallbacks(value, _tileResizeEnd, ref eventCallbacksCache)) - { - _tileResizeEnd = value; - this.SetHandler(this.Name, "TileResizeEnd", value, (args) => { - OnHandlingTileResizeEnd(args); - - }); - this.OnRefChanged("TileResizeEnd", null, "event:::TileResizeEnd", true, false, (refName, oldValue, newValue) => { - this._tileResizeEndRef = refName; - this.MarkPropDirty("TileResizeEndRef"); - }); - } - } - else - { - _tileResizeEnd = null; - this.SetHandler(this.Name, "TileResizeEnd", null); - this.OnRefChanged("TileResizeEnd", null, null, true, false, (refName, oldValue, newValue) => { - this._tileResizeEndRef = null; - this.MarkPropDirty("TileResizeEndRef"); - }); - } - } - } - - private string _tileResizeCancelRef = null; - private string _tileResizeCancelScript = null; - [Parameter] - public string TileResizeCancelScript { - - set - { - if (value != this._tileResizeCancelScript) - { - this._tileResizeCancelScript = value; - this.OnRefChanged("TileResizeCancel", null, value, true, false, (string refName, object oldValue, object newValue) => { - this._tileResizeCancelRef = refName; - this.MarkPropDirty("TileResizeCancelRef"); - }); - } - } - get - { - return this._tileResizeCancelScript; - } - } - - partial void OnHandlingTileResizeCancel(IgbTileComponentEventArgs args); - private EventCallback? _tileResizeCancel = null; - [Parameter] - public EventCallback TileResizeCancel - { - get - { - return this._tileResizeCancel != null ? this._tileResizeCancel.Value : EventCallback.Empty; - } - set - { - if (!value.Equals(EventCallback.Empty)) - { - if (!CompareEventCallbacks(value, _tileResizeCancel, ref eventCallbacksCache)) - { - _tileResizeCancel = value; - this.SetHandler(this.Name, "TileResizeCancel", value, (args) => { - OnHandlingTileResizeCancel(args); - - }); - this.OnRefChanged("TileResizeCancel", null, "event:::TileResizeCancel", true, false, (refName, oldValue, newValue) => { - this._tileResizeCancelRef = refName; - this.MarkPropDirty("TileResizeCancelRef"); - }); - } - } - else - { - _tileResizeCancel = null; - this.SetHandler(this.Name, "TileResizeCancel", null); - this.OnRefChanged("TileResizeCancel", null, null, true, false, (refName, oldValue, newValue) => { - this._tileResizeCancelRef = null; - this.MarkPropDirty("TileResizeCancelRef"); - }); - } - } - } - - partial void SerializeCoreIgbTile(RendererSerializer ser); - - internal override void SerializeCore(RendererSerializer ser) - { - base.SerializeCore(ser); - - SerializeCoreIgbTile(ser); - - if (IsPropDirty("ColSpan")) { ser.AddNumberProp("colSpan", this._colSpan); } - if (IsPropDirty("RowSpan")) { ser.AddNumberProp("rowSpan", this._rowSpan); } - if (IsPropDirty("ColStart")) { ser.AddNumberProp("colStart", this._colStart); } - if (IsPropDirty("RowStart")) { ser.AddNumberProp("rowStart", this._rowStart); } - if (IsPropDirty("Maximized")) { ser.AddBooleanProp("maximized", this._maximized); } - if (IsPropDirty("DisableResize")) { ser.AddBooleanProp("disableResize", this._disableResize); } - if (IsPropDirty("DisableFullscreen")) { ser.AddBooleanProp("disableFullscreen", this._disableFullscreen); } - if (IsPropDirty("DisableMaximize")) { ser.AddBooleanProp("disableMaximize", this._disableMaximize); } - if (IsPropDirty("Position")) { ser.AddNumberProp("position", this._position); } - if (IsPropDirty("TileFullscreenRef")) { ser.AddStringProp("tileFullscreenRef", this._tileFullscreenRef); } - if (IsPropDirty("TileMaximizeRef")) { ser.AddStringProp("tileMaximizeRef", this._tileMaximizeRef); } - if (IsPropDirty("TileDragStartRef")) { ser.AddStringProp("tileDragStartRef", this._tileDragStartRef); } - if (IsPropDirty("TileDragEndRef")) { ser.AddStringProp("tileDragEndRef", this._tileDragEndRef); } - if (IsPropDirty("TileDragCancelRef")) { ser.AddStringProp("tileDragCancelRef", this._tileDragCancelRef); } - if (IsPropDirty("TileResizeStartRef")) { ser.AddStringProp("tileResizeStartRef", this._tileResizeStartRef); } - if (IsPropDirty("TileResizeEndRef")) { ser.AddStringProp("tileResizeEndRef", this._tileResizeEndRef); } - if (IsPropDirty("TileResizeCancelRef")) { ser.AddStringProp("tileResizeCancelRef", this._tileResizeCancelRef); } - - } - -} + this._tileMaximizeRef = refName; + this.MarkPropDirty("TileMaximizeRef"); + }); + } + } + else + { + _tileMaximize = null; + this.SetHandler(this.Name, "TileMaximize", null); + this.OnRefChanged("TileMaximize", null, null, true, false, (refName, oldValue, newValue) => + { + this._tileMaximizeRef = null; + this.MarkPropDirty("TileMaximizeRef"); + }); + } + } + } + + private string _tileDragStartRef = null; + private string _tileDragStartScript = null; + [Parameter] + public string TileDragStartScript + { + + set + { + if (value != this._tileDragStartScript) + { + this._tileDragStartScript = value; + this.OnRefChanged("TileDragStart", null, value, true, false, (string refName, object oldValue, object newValue) => + { + this._tileDragStartRef = refName; + this.MarkPropDirty("TileDragStartRef"); + }); + } + } + get + { + return this._tileDragStartScript; + } + } + + partial void OnHandlingTileDragStart(IgbTileComponentEventArgs args); + private EventCallback? _tileDragStart = null; + [Parameter] + public EventCallback TileDragStart + { + get + { + return this._tileDragStart != null ? this._tileDragStart.Value : EventCallback.Empty; + } + set + { + if (!value.Equals(EventCallback.Empty)) + { + if (!CompareEventCallbacks(value, _tileDragStart, ref eventCallbacksCache)) + { + _tileDragStart = value; + this.SetHandler(this.Name, "TileDragStart", value, (args) => + { + OnHandlingTileDragStart(args); + + }); + this.OnRefChanged("TileDragStart", null, "event:::TileDragStart", true, false, (refName, oldValue, newValue) => + { + this._tileDragStartRef = refName; + this.MarkPropDirty("TileDragStartRef"); + }); + } + } + else + { + _tileDragStart = null; + this.SetHandler(this.Name, "TileDragStart", null); + this.OnRefChanged("TileDragStart", null, null, true, false, (refName, oldValue, newValue) => + { + this._tileDragStartRef = null; + this.MarkPropDirty("TileDragStartRef"); + }); + } + } + } + + private string _tileDragEndRef = null; + private string _tileDragEndScript = null; + [Parameter] + public string TileDragEndScript + { + + set + { + if (value != this._tileDragEndScript) + { + this._tileDragEndScript = value; + this.OnRefChanged("TileDragEnd", null, value, true, false, (string refName, object oldValue, object newValue) => + { + this._tileDragEndRef = refName; + this.MarkPropDirty("TileDragEndRef"); + }); + } + } + get + { + return this._tileDragEndScript; + } + } + + partial void OnHandlingTileDragEnd(IgbTileComponentEventArgs args); + private EventCallback? _tileDragEnd = null; + [Parameter] + public EventCallback TileDragEnd + { + get + { + return this._tileDragEnd != null ? this._tileDragEnd.Value : EventCallback.Empty; + } + set + { + if (!value.Equals(EventCallback.Empty)) + { + if (!CompareEventCallbacks(value, _tileDragEnd, ref eventCallbacksCache)) + { + _tileDragEnd = value; + this.SetHandler(this.Name, "TileDragEnd", value, (args) => + { + OnHandlingTileDragEnd(args); + + }); + this.OnRefChanged("TileDragEnd", null, "event:::TileDragEnd", true, false, (refName, oldValue, newValue) => + { + this._tileDragEndRef = refName; + this.MarkPropDirty("TileDragEndRef"); + }); + } + } + else + { + _tileDragEnd = null; + this.SetHandler(this.Name, "TileDragEnd", null); + this.OnRefChanged("TileDragEnd", null, null, true, false, (refName, oldValue, newValue) => + { + this._tileDragEndRef = null; + this.MarkPropDirty("TileDragEndRef"); + }); + } + } + } + + private string _tileDragCancelRef = null; + private string _tileDragCancelScript = null; + [Parameter] + public string TileDragCancelScript + { + + set + { + if (value != this._tileDragCancelScript) + { + this._tileDragCancelScript = value; + this.OnRefChanged("TileDragCancel", null, value, true, false, (string refName, object oldValue, object newValue) => + { + this._tileDragCancelRef = refName; + this.MarkPropDirty("TileDragCancelRef"); + }); + } + } + get + { + return this._tileDragCancelScript; + } + } + + partial void OnHandlingTileDragCancel(IgbTileComponentEventArgs args); + private EventCallback? _tileDragCancel = null; + [Parameter] + public EventCallback TileDragCancel + { + get + { + return this._tileDragCancel != null ? this._tileDragCancel.Value : EventCallback.Empty; + } + set + { + if (!value.Equals(EventCallback.Empty)) + { + if (!CompareEventCallbacks(value, _tileDragCancel, ref eventCallbacksCache)) + { + _tileDragCancel = value; + this.SetHandler(this.Name, "TileDragCancel", value, (args) => + { + OnHandlingTileDragCancel(args); + + }); + this.OnRefChanged("TileDragCancel", null, "event:::TileDragCancel", true, false, (refName, oldValue, newValue) => + { + this._tileDragCancelRef = refName; + this.MarkPropDirty("TileDragCancelRef"); + }); + } + } + else + { + _tileDragCancel = null; + this.SetHandler(this.Name, "TileDragCancel", null); + this.OnRefChanged("TileDragCancel", null, null, true, false, (refName, oldValue, newValue) => + { + this._tileDragCancelRef = null; + this.MarkPropDirty("TileDragCancelRef"); + }); + } + } + } + + private string _tileResizeStartRef = null; + private string _tileResizeStartScript = null; + [Parameter] + public string TileResizeStartScript + { + + set + { + if (value != this._tileResizeStartScript) + { + this._tileResizeStartScript = value; + this.OnRefChanged("TileResizeStart", null, value, true, false, (string refName, object oldValue, object newValue) => + { + this._tileResizeStartRef = refName; + this.MarkPropDirty("TileResizeStartRef"); + }); + } + } + get + { + return this._tileResizeStartScript; + } + } + + partial void OnHandlingTileResizeStart(IgbTileComponentEventArgs args); + private EventCallback? _tileResizeStart = null; + [Parameter] + public EventCallback TileResizeStart + { + get + { + return this._tileResizeStart != null ? this._tileResizeStart.Value : EventCallback.Empty; + } + set + { + if (!value.Equals(EventCallback.Empty)) + { + if (!CompareEventCallbacks(value, _tileResizeStart, ref eventCallbacksCache)) + { + _tileResizeStart = value; + this.SetHandler(this.Name, "TileResizeStart", value, (args) => + { + OnHandlingTileResizeStart(args); + + }); + this.OnRefChanged("TileResizeStart", null, "event:::TileResizeStart", true, false, (refName, oldValue, newValue) => + { + this._tileResizeStartRef = refName; + this.MarkPropDirty("TileResizeStartRef"); + }); + } + } + else + { + _tileResizeStart = null; + this.SetHandler(this.Name, "TileResizeStart", null); + this.OnRefChanged("TileResizeStart", null, null, true, false, (refName, oldValue, newValue) => + { + this._tileResizeStartRef = null; + this.MarkPropDirty("TileResizeStartRef"); + }); + } + } + } + + private string _tileResizeEndRef = null; + private string _tileResizeEndScript = null; + [Parameter] + public string TileResizeEndScript + { + + set + { + if (value != this._tileResizeEndScript) + { + this._tileResizeEndScript = value; + this.OnRefChanged("TileResizeEnd", null, value, true, false, (string refName, object oldValue, object newValue) => + { + this._tileResizeEndRef = refName; + this.MarkPropDirty("TileResizeEndRef"); + }); + } + } + get + { + return this._tileResizeEndScript; + } + } + + partial void OnHandlingTileResizeEnd(IgbTileComponentEventArgs args); + private EventCallback? _tileResizeEnd = null; + [Parameter] + public EventCallback TileResizeEnd + { + get + { + return this._tileResizeEnd != null ? this._tileResizeEnd.Value : EventCallback.Empty; + } + set + { + if (!value.Equals(EventCallback.Empty)) + { + if (!CompareEventCallbacks(value, _tileResizeEnd, ref eventCallbacksCache)) + { + _tileResizeEnd = value; + this.SetHandler(this.Name, "TileResizeEnd", value, (args) => + { + OnHandlingTileResizeEnd(args); + + }); + this.OnRefChanged("TileResizeEnd", null, "event:::TileResizeEnd", true, false, (refName, oldValue, newValue) => + { + this._tileResizeEndRef = refName; + this.MarkPropDirty("TileResizeEndRef"); + }); + } + } + else + { + _tileResizeEnd = null; + this.SetHandler(this.Name, "TileResizeEnd", null); + this.OnRefChanged("TileResizeEnd", null, null, true, false, (refName, oldValue, newValue) => + { + this._tileResizeEndRef = null; + this.MarkPropDirty("TileResizeEndRef"); + }); + } + } + } + + private string _tileResizeCancelRef = null; + private string _tileResizeCancelScript = null; + [Parameter] + public string TileResizeCancelScript + { + + set + { + if (value != this._tileResizeCancelScript) + { + this._tileResizeCancelScript = value; + this.OnRefChanged("TileResizeCancel", null, value, true, false, (string refName, object oldValue, object newValue) => + { + this._tileResizeCancelRef = refName; + this.MarkPropDirty("TileResizeCancelRef"); + }); + } + } + get + { + return this._tileResizeCancelScript; + } + } + + partial void OnHandlingTileResizeCancel(IgbTileComponentEventArgs args); + private EventCallback? _tileResizeCancel = null; + [Parameter] + public EventCallback TileResizeCancel + { + get + { + return this._tileResizeCancel != null ? this._tileResizeCancel.Value : EventCallback.Empty; + } + set + { + if (!value.Equals(EventCallback.Empty)) + { + if (!CompareEventCallbacks(value, _tileResizeCancel, ref eventCallbacksCache)) + { + _tileResizeCancel = value; + this.SetHandler(this.Name, "TileResizeCancel", value, (args) => + { + OnHandlingTileResizeCancel(args); + + }); + this.OnRefChanged("TileResizeCancel", null, "event:::TileResizeCancel", true, false, (refName, oldValue, newValue) => + { + this._tileResizeCancelRef = refName; + this.MarkPropDirty("TileResizeCancelRef"); + }); + } + } + else + { + _tileResizeCancel = null; + this.SetHandler(this.Name, "TileResizeCancel", null); + this.OnRefChanged("TileResizeCancel", null, null, true, false, (refName, oldValue, newValue) => + { + this._tileResizeCancelRef = null; + this.MarkPropDirty("TileResizeCancelRef"); + }); + } + } + } + + partial void SerializeCoreIgbTile(RendererSerializer ser); + + internal override void SerializeCore(RendererSerializer ser) + { + base.SerializeCore(ser); + + SerializeCoreIgbTile(ser); + + if (IsPropDirty("ColSpan")) + { ser.AddNumberProp("colSpan", this._colSpan); } + if (IsPropDirty("RowSpan")) + { ser.AddNumberProp("rowSpan", this._rowSpan); } + if (IsPropDirty("ColStart")) + { ser.AddNumberProp("colStart", this._colStart); } + if (IsPropDirty("RowStart")) + { ser.AddNumberProp("rowStart", this._rowStart); } + if (IsPropDirty("Maximized")) + { ser.AddBooleanProp("maximized", this._maximized); } + if (IsPropDirty("DisableResize")) + { ser.AddBooleanProp("disableResize", this._disableResize); } + if (IsPropDirty("DisableFullscreen")) + { ser.AddBooleanProp("disableFullscreen", this._disableFullscreen); } + if (IsPropDirty("DisableMaximize")) + { ser.AddBooleanProp("disableMaximize", this._disableMaximize); } + if (IsPropDirty("Position")) + { ser.AddNumberProp("position", this._position); } + if (IsPropDirty("TileFullscreenRef")) + { ser.AddStringProp("tileFullscreenRef", this._tileFullscreenRef); } + if (IsPropDirty("TileMaximizeRef")) + { ser.AddStringProp("tileMaximizeRef", this._tileMaximizeRef); } + if (IsPropDirty("TileDragStartRef")) + { ser.AddStringProp("tileDragStartRef", this._tileDragStartRef); } + if (IsPropDirty("TileDragEndRef")) + { ser.AddStringProp("tileDragEndRef", this._tileDragEndRef); } + if (IsPropDirty("TileDragCancelRef")) + { ser.AddStringProp("tileDragCancelRef", this._tileDragCancelRef); } + if (IsPropDirty("TileResizeStartRef")) + { ser.AddStringProp("tileResizeStartRef", this._tileResizeStartRef); } + if (IsPropDirty("TileResizeEndRef")) + { ser.AddStringProp("tileResizeEndRef", this._tileResizeEndRef); } + if (IsPropDirty("TileResizeCancelRef")) + { ser.AddStringProp("tileResizeCancelRef", this._tileResizeCancelRef); } + + } + + } } diff --git a/src/components/Blazor/TileChangeStateEventArgs.cs b/src/components/Blazor/TileChangeStateEventArgs.cs index aba35ef9..3409d161 100644 --- a/src/components/Blazor/TileChangeStateEventArgs.cs +++ b/src/components/Blazor/TileChangeStateEventArgs.cs @@ -1,99 +1,97 @@ - -using System; using Microsoft.AspNetCore.Components; -using Microsoft.AspNetCore.Components.Rendering; -using System.Threading.Tasks; -using System.Collections.Generic; -using System.Linq; namespace IgniteUI.Blazor.Controls { - public partial class IgbTileChangeStateEventArgs: BaseRendererElement { - public override string Type { get { return "WebTileChangeStateEventArgs"; } } - - - private static bool _marshalByValue = true; - - public IgbTileChangeStateEventArgs(): base() { - OnCreatedIgbTileChangeStateEventArgs(); - - - } - - partial void OnCreatedIgbTileChangeStateEventArgs(); - - private IgbTileChangeStateEventArgsDetail _detail; - - partial void OnDetailChanging(ref IgbTileChangeStateEventArgsDetail newValue); - [Parameter] - public IgbTileChangeStateEventArgsDetail Detail - { - get { return this._detail; } - set { - OnDetailChanging(ref value); - MarkPropDirty("Detail"); - if (this._detail != null) { - this.DetachChild(this._detail); - } - if (value != null) { - this.AttachChild(value); - } - this._detail = value; - } - - } - - partial void FindByNameTileChangeStateEventArgs(string name, ref object item); - public override object FindByName(string name) - { - - var baseResult = base.FindByName(name); - if (baseResult != null) - { - return baseResult; - } - - object item = null; - FindByNameTileChangeStateEventArgs(name, ref item); - if (item != null) - { - return item; - } - - return null; - } - - partial void SerializeCoreIgbTileChangeStateEventArgs(RendererSerializer ser); - - internal override void SerializeCore(RendererSerializer ser) - { - base.SerializeCore(ser); - - SerializeCoreIgbTileChangeStateEventArgs(ser); - - if (IsPropDirty("Detail")) { ser.AddSerializableProp("detail", this._detail); } - - } - - - protected internal override void ToEventJson(BaseRendererControl control, Dictionary args) - { - base.ToEventJson(control, args); - - if (IsPropDirty("Detail")) { args["detail"] = ObjectToParam(this._detail); } - - - } - - - protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) { - base.FromEventJson(control, args); - this.SuppressParentNotify = true; - - if (args.ContainsKey("detail")) { this.Detail = (IgbTileChangeStateEventArgsDetail)ConvertReturnValue(args["detail"], "TileChangeStateEventArgsDetail", true); } - - this.SuppressParentNotify = false; - } - -} + public partial class IgbTileChangeStateEventArgs : BaseRendererElement + { + public override string Type { get { return "WebTileChangeStateEventArgs"; } } + + private static bool _marshalByValue = true; + + public IgbTileChangeStateEventArgs() : base() + { + OnCreatedIgbTileChangeStateEventArgs(); + + } + + partial void OnCreatedIgbTileChangeStateEventArgs(); + + private IgbTileChangeStateEventArgsDetail _detail; + + partial void OnDetailChanging(ref IgbTileChangeStateEventArgsDetail newValue); + [Parameter] + public IgbTileChangeStateEventArgsDetail Detail + { + get { return this._detail; } + set + { + OnDetailChanging(ref value); + MarkPropDirty("Detail"); + if (this._detail != null) + { + this.DetachChild(this._detail); + } + if (value != null) + { + this.AttachChild(value); + } + this._detail = value; + } + + } + + partial void FindByNameTileChangeStateEventArgs(string name, ref object item); + public override object FindByName(string name) + { + + var baseResult = base.FindByName(name); + if (baseResult != null) + { + return baseResult; + } + + object item = null; + FindByNameTileChangeStateEventArgs(name, ref item); + if (item != null) + { + return item; + } + + return null; + } + + partial void SerializeCoreIgbTileChangeStateEventArgs(RendererSerializer ser); + + internal override void SerializeCore(RendererSerializer ser) + { + base.SerializeCore(ser); + + SerializeCoreIgbTileChangeStateEventArgs(ser); + + if (IsPropDirty("Detail")) + { ser.AddSerializableProp("detail", this._detail); } + + } + + protected internal override void ToEventJson(BaseRendererControl control, Dictionary args) + { + base.ToEventJson(control, args); + + if (IsPropDirty("Detail")) + { args["detail"] = ObjectToParam(this._detail); } + + } + + protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) + { + base.FromEventJson(control, args); + this.SuppressParentNotify = true; + + if (args.ContainsKey("detail")) + { this.Detail = (IgbTileChangeStateEventArgsDetail)ConvertReturnValue(args["detail"], "TileChangeStateEventArgsDetail", true); } + + this.SuppressParentNotify = false; + } + + } } diff --git a/src/components/Blazor/TileChangeStateEventArgsDetail.cs b/src/components/Blazor/TileChangeStateEventArgsDetail.cs index 53919bad..937c0527 100644 --- a/src/components/Blazor/TileChangeStateEventArgsDetail.cs +++ b/src/components/Blazor/TileChangeStateEventArgsDetail.cs @@ -1,120 +1,122 @@ - -using System; using Microsoft.AspNetCore.Components; -using Microsoft.AspNetCore.Components.Rendering; -using System.Threading.Tasks; -using System.Collections.Generic; -using System.Linq; namespace IgniteUI.Blazor.Controls { - public partial class IgbTileChangeStateEventArgsDetail: BaseRendererElement { - public override string Type { get { return "WebTileChangeStateEventArgsDetail"; } } - - - private static bool _marshalByValue = true; - - public IgbTileChangeStateEventArgsDetail(): base() { - OnCreatedIgbTileChangeStateEventArgsDetail(); - - - } - - partial void OnCreatedIgbTileChangeStateEventArgsDetail(); - - private IgbTile _tile; - - partial void OnTileChanging(ref IgbTile newValue); - [Parameter] - public IgbTile Tile - { - get { return this._tile; } - set { - if (this._tile != value || !IsPropDirty("Tile")) { - MarkPropDirty("Tile"); - } - this._tile = value; - - } - } - private bool _state = false; - - partial void OnStateChanging(ref bool newValue); - [Parameter] - public bool State - { - get { return this._state; } - set { - if (this._state != value || !IsPropDirty("State")) { - MarkPropDirty("State"); - } - this._state = value; - - } - } - - partial void FindByNameTileChangeStateEventArgsDetail(string name, ref object item); - public override object FindByName(string name) - { - - var baseResult = base.FindByName(name); - if (baseResult != null) - { - return baseResult; - } - - object item = null; - FindByNameTileChangeStateEventArgsDetail(name, ref item); - if (item != null) - { - return item; - } - - return null; - } - public async Task SetNativeElementAsync(Object element) - { - await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); - } - public void SetNativeElement(Object element) - { - InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); - } - - partial void SerializeCoreIgbTileChangeStateEventArgsDetail(RendererSerializer ser); - - internal override void SerializeCore(RendererSerializer ser) - { - base.SerializeCore(ser); - - SerializeCoreIgbTileChangeStateEventArgsDetail(ser); - - if (IsPropDirty("Tile")) { ser.AddSerializableProp("tile", this._tile); } - if (IsPropDirty("State")) { ser.AddBooleanProp("state", this._state); } - - } - - - protected internal override void ToEventJson(BaseRendererControl control, Dictionary args) - { - base.ToEventJson(control, args); - - if (IsPropDirty("Tile")) { args["tile"] = ObjectToParam(this._tile); } - if (IsPropDirty("State")) { args["state"] = (this._state).ToString().ToLower(); } - - - } - - - protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) { - base.FromEventJson(control, args); - this.SuppressParentNotify = true; - - if (args.ContainsKey("tile")) { this.Tile = (IgbTile)ConvertReturnValue(args["tile"], "Tile", true); } - if (args.ContainsKey("state")) { this.State = ReturnToBoolean(args["state"]); } - - this.SuppressParentNotify = false; - } - -} + public partial class IgbTileChangeStateEventArgsDetail : BaseRendererElement + { + public override string Type { get { return "WebTileChangeStateEventArgsDetail"; } } + + private static bool _marshalByValue = true; + + public IgbTileChangeStateEventArgsDetail() : base() + { + OnCreatedIgbTileChangeStateEventArgsDetail(); + + } + + partial void OnCreatedIgbTileChangeStateEventArgsDetail(); + + private IgbTile _tile; + + partial void OnTileChanging(ref IgbTile newValue); + [Parameter] + public IgbTile Tile + { + get { return this._tile; } + set + { + if (this._tile != value || !IsPropDirty("Tile")) + { + MarkPropDirty("Tile"); + } + this._tile = value; + + } + } + private bool _state = false; + + partial void OnStateChanging(ref bool newValue); + [Parameter] + public bool State + { + get { return this._state; } + set + { + if (this._state != value || !IsPropDirty("State")) + { + MarkPropDirty("State"); + } + this._state = value; + + } + } + + partial void FindByNameTileChangeStateEventArgsDetail(string name, ref object item); + public override object FindByName(string name) + { + + var baseResult = base.FindByName(name); + if (baseResult != null) + { + return baseResult; + } + + object item = null; + FindByNameTileChangeStateEventArgsDetail(name, ref item); + if (item != null) + { + return item; + } + + return null; + } + public async Task SetNativeElementAsync(Object element) + { + await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + } + public void SetNativeElement(Object element) + { + InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + } + + partial void SerializeCoreIgbTileChangeStateEventArgsDetail(RendererSerializer ser); + + internal override void SerializeCore(RendererSerializer ser) + { + base.SerializeCore(ser); + + SerializeCoreIgbTileChangeStateEventArgsDetail(ser); + + if (IsPropDirty("Tile")) + { ser.AddSerializableProp("tile", this._tile); } + if (IsPropDirty("State")) + { ser.AddBooleanProp("state", this._state); } + + } + + protected internal override void ToEventJson(BaseRendererControl control, Dictionary args) + { + base.ToEventJson(control, args); + + if (IsPropDirty("Tile")) + { args["tile"] = ObjectToParam(this._tile); } + if (IsPropDirty("State")) + { args["state"] = (this._state).ToString().ToLower(); } + + } + + protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) + { + base.FromEventJson(control, args); + this.SuppressParentNotify = true; + + if (args.ContainsKey("tile")) + { this.Tile = (IgbTile)ConvertReturnValue(args["tile"], "Tile", true); } + if (args.ContainsKey("state")) + { this.State = ReturnToBoolean(args["state"]); } + + this.SuppressParentNotify = false; + } + + } } diff --git a/src/components/Blazor/TileComponentEventArgs.cs b/src/components/Blazor/TileComponentEventArgs.cs index 6cf84e0c..4286e682 100644 --- a/src/components/Blazor/TileComponentEventArgs.cs +++ b/src/components/Blazor/TileComponentEventArgs.cs @@ -1,94 +1,91 @@ - -using System; using Microsoft.AspNetCore.Components; -using Microsoft.AspNetCore.Components.Rendering; -using System.Threading.Tasks; -using System.Collections.Generic; -using System.Linq; namespace IgniteUI.Blazor.Controls { - public partial class IgbTileComponentEventArgs: BaseRendererElement { - public override string Type { get { return "WebTileComponentEventArgs"; } } - - - private static bool _marshalByValue = true; - - public IgbTileComponentEventArgs(): base() { - OnCreatedIgbTileComponentEventArgs(); - - - } - - partial void OnCreatedIgbTileComponentEventArgs(); - - private IgbTile _detail; - - partial void OnDetailChanging(ref IgbTile newValue); - [Parameter] - public IgbTile Detail - { - get { return this._detail; } - set { - if (this._detail != value || !IsPropDirty("Detail")) { - MarkPropDirty("Detail"); - } - this._detail = value; - - } - } - - partial void FindByNameTileComponentEventArgs(string name, ref object item); - public override object FindByName(string name) - { - - var baseResult = base.FindByName(name); - if (baseResult != null) - { - return baseResult; - } - - object item = null; - FindByNameTileComponentEventArgs(name, ref item); - if (item != null) - { - return item; - } - - return null; - } - - partial void SerializeCoreIgbTileComponentEventArgs(RendererSerializer ser); - - internal override void SerializeCore(RendererSerializer ser) - { - base.SerializeCore(ser); - - SerializeCoreIgbTileComponentEventArgs(ser); - - if (IsPropDirty("Detail")) { ser.AddSerializableProp("detail", this._detail); } - - } - - - protected internal override void ToEventJson(BaseRendererControl control, Dictionary args) - { - base.ToEventJson(control, args); - - if (IsPropDirty("Detail")) { args["detail"] = ObjectToParam(this._detail); } - - - } - - - protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) { - base.FromEventJson(control, args); - this.SuppressParentNotify = true; - - if (args.ContainsKey("detail")) { this.Detail = (IgbTile)ConvertReturnValue(args["detail"], "Tile", true); } - - this.SuppressParentNotify = false; - } - -} + public partial class IgbTileComponentEventArgs : BaseRendererElement + { + public override string Type { get { return "WebTileComponentEventArgs"; } } + + private static bool _marshalByValue = true; + + public IgbTileComponentEventArgs() : base() + { + OnCreatedIgbTileComponentEventArgs(); + + } + + partial void OnCreatedIgbTileComponentEventArgs(); + + private IgbTile _detail; + + partial void OnDetailChanging(ref IgbTile newValue); + [Parameter] + public IgbTile Detail + { + get { return this._detail; } + set + { + if (this._detail != value || !IsPropDirty("Detail")) + { + MarkPropDirty("Detail"); + } + this._detail = value; + + } + } + + partial void FindByNameTileComponentEventArgs(string name, ref object item); + public override object FindByName(string name) + { + + var baseResult = base.FindByName(name); + if (baseResult != null) + { + return baseResult; + } + + object item = null; + FindByNameTileComponentEventArgs(name, ref item); + if (item != null) + { + return item; + } + + return null; + } + + partial void SerializeCoreIgbTileComponentEventArgs(RendererSerializer ser); + + internal override void SerializeCore(RendererSerializer ser) + { + base.SerializeCore(ser); + + SerializeCoreIgbTileComponentEventArgs(ser); + + if (IsPropDirty("Detail")) + { ser.AddSerializableProp("detail", this._detail); } + + } + + protected internal override void ToEventJson(BaseRendererControl control, Dictionary args) + { + base.ToEventJson(control, args); + + if (IsPropDirty("Detail")) + { args["detail"] = ObjectToParam(this._detail); } + + } + + protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) + { + base.FromEventJson(control, args); + this.SuppressParentNotify = true; + + if (args.ContainsKey("detail")) + { this.Detail = (IgbTile)ConvertReturnValue(args["detail"], "Tile", true); } + + this.SuppressParentNotify = false; + } + + } } diff --git a/src/components/Blazor/TileManager.cs b/src/components/Blazor/TileManager.cs index 5fe8b956..111efd26 100644 --- a/src/components/Blazor/TileManager.cs +++ b/src/components/Blazor/TileManager.cs @@ -1,763 +1,824 @@ - -using System; using Microsoft.AspNetCore.Components; -using Microsoft.AspNetCore.Components.Rendering; -using System.Threading.Tasks; -using System.Collections.Generic; -using System.Linq; namespace IgniteUI.Blazor.Controls { - /// -/// The tile manager component enables the dynamic arrangement, resizing, and interaction of tiles. -/// -public partial class IgbTileManager: BaseRendererControl { - public override string Type { get { return "WebTileManager"; } } - - protected override void EnsureModulesLoaded() - { - if (!IgbTileManagerModule.IsLoadRequested(IgBlazor)) - { - IgbTileManagerModule.Register(IgBlazor); - } - } - - protected override string ResolveDisplay() + /// + /// The tile manager component enables the dynamic arrangement, resizing, and interaction of tiles. + /// + public partial class IgbTileManager : BaseRendererControl + { + public override string Type { get { return "WebTileManager"; } } + + protected override void EnsureModulesLoaded() + { + if (!IgbTileManagerModule.IsLoadRequested(IgBlazor)) + { + IgbTileManagerModule.Register(IgBlazor); + } + } + + protected override string ResolveDisplay() + { + return "inline-block"; + } + + protected override bool SupportsVisualChildren + { + get + { + return true; + } + } + + protected override bool UseDirectRender + { + get + { + return true; + } + } + + protected override string DirectRenderElementName + { + get + { + return "igc-tile-manager"; + } + } + + protected override ControlEventBehavior DefaultEventBehavior + { + get { return ControlEventBehavior.Immediate; } + } + + public IgbTileManager() : base() + { + OnCreatedIgbTileManager(); + + } + + partial void OnCreatedIgbTileManager(); + + private TileManagerResizeMode _resizeMode = TileManagerResizeMode.None; + + partial void OnResizeModeChanging(ref TileManagerResizeMode newValue); + /// + /// Whether resize operations are enabled. + /// + [Parameter] + public TileManagerResizeMode ResizeMode + { + get { return this._resizeMode; } + set + { + if (this._resizeMode != value || !IsPropDirty("ResizeMode")) + { + MarkPropDirty("ResizeMode"); + } + this._resizeMode = value; + + } + } + private TileManagerDragMode _dragMode = TileManagerDragMode.None; + + partial void OnDragModeChanging(ref TileManagerDragMode newValue); + /// + /// Whether drag and drop operations are enabled. + /// + [Parameter] + public TileManagerDragMode DragMode + { + get { return this._dragMode; } + set + { + if (this._dragMode != value || !IsPropDirty("DragMode")) + { + MarkPropDirty("DragMode"); + } + this._dragMode = value; + + } + } + private double _columnCount = 0; + + partial void OnColumnCountChanging(ref double newValue); + [Parameter] + public double ColumnCount + { + get { return this._columnCount; } + set + { + if (this._columnCount != value || !IsPropDirty("ColumnCount")) + { + MarkPropDirty("ColumnCount"); + } + this._columnCount = value; + + } + } + private string? _minColumnWidth; + + partial void OnMinColumnWidthChanging(ref string? newValue); + /// + /// Sets the minimum width for a column unit in the tile manager. + /// + [Parameter] + public string? MinColumnWidth + { + get { return this._minColumnWidth; } + set + { + if (this._minColumnWidth != value || !IsPropDirty("MinColumnWidth")) + { + MarkPropDirty("MinColumnWidth"); + } + this._minColumnWidth = value; + + } + } + private string? _minRowHeight; + + partial void OnMinRowHeightChanging(ref string? newValue); + /// + /// Sets the minimum height for a row unit in the tile manager. + /// + [Parameter] + public string? MinRowHeight + { + get { return this._minRowHeight; } + set + { + if (this._minRowHeight != value || !IsPropDirty("MinRowHeight")) + { + MarkPropDirty("MinRowHeight"); + } + this._minRowHeight = value; + + } + } + private string? _gap; + + partial void OnGapChanging(ref string? newValue); + /// + /// Sets the gap size between tiles in the tile manager. + /// + [Parameter] + public string? Gap + { + get { return this._gap; } + set + { + if (this._gap != value || !IsPropDirty("Gap")) + { + MarkPropDirty("Gap"); + } + this._gap = value; + + } + } + public async Task GetTilesAsync() + { + var iv = await InvokeMethod("p:Tiles", new object[] { }, new string[] { }); + + if (iv == null) + { + return default(IgbTile[]); + } + var retVal = ReturnToObjectArray(iv); + if (retVal == null) + { + return default(IgbTile[]); + } + return retVal; + + } + public IgbTile[] GetTiles() + { + var iv = InvokeMethodSync("p:Tiles", new object[] { }, new string[] { }); + + if (iv == null) + { + return default(IgbTile[]); + } + var retVal = ReturnToObjectArray(iv); + if (retVal == null) + { + return default(IgbTile[]); + } + return retVal; + + } + + partial void FindByNameTileManager(string name, ref object item); + public override object FindByName(string name) + { + + var baseResult = base.FindByName(name); + if (baseResult != null) + { + return baseResult; + } + + object item = null; + FindByNameTileManager(name, ref item); + if (item != null) + { + return item; + } + + return null; + } + public async Task SetNativeElementAsync(Object element) + { + await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + } + public void SetNativeElement(Object element) + { + InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + } + /// + /// Returns the properties of the current tile collections as a JSON payload. + /// + public async Task SaveLayoutAsync() + { + var iv = await InvokeMethod("saveLayout", new object[] { }, new string[] { }); + return ReturnToString(iv); + } + public String SaveLayout() + { + var iv = InvokeMethodSync("saveLayout", new object[] { }, new string[] { }); + return ReturnToString(iv); + } + /// + /// Restores a previously serialized state produced by `saveLayout`. + /// + public async Task LoadLayoutAsync(String data) + { + await InvokeMethod("loadLayout", new object[] { StringToString(data) }, new string[] { "String" }); + } + public void LoadLayout(String data) + { + InvokeMethodSync("loadLayout", new object[] { StringToString(data) }, new string[] { "String" }); + } + + private string _tileFullscreenRef = null; + private string _tileFullscreenScript = null; + [Parameter] + public string TileFullscreenScript + { + + set + { + if (value != this._tileFullscreenScript) + { + this._tileFullscreenScript = value; + this.OnRefChanged("TileFullscreen", null, value, true, false, (string refName, object oldValue, object newValue) => + { + this._tileFullscreenRef = refName; + this.MarkPropDirty("TileFullscreenRef"); + }); + } + } + get + { + return this._tileFullscreenScript; + } + } + + partial void OnHandlingTileFullscreen(IgbTileChangeStateEventArgs args); + private EventCallback? _tileFullscreen = null; + [Parameter] + public EventCallback TileFullscreen + { + get + { + return this._tileFullscreen != null ? this._tileFullscreen.Value : EventCallback.Empty; + } + set + { + if (!value.Equals(EventCallback.Empty)) + { + if (!CompareEventCallbacks(value, _tileFullscreen, ref eventCallbacksCache)) + { + _tileFullscreen = value; + this.SetHandler(this.Name, "TileFullscreen", value, (args) => { - return "inline-block"; - } + OnHandlingTileFullscreen(args); - protected override bool SupportsVisualChildren + }); + this.OnRefChanged("TileFullscreen", null, "event:::TileFullscreen", true, false, (refName, oldValue, newValue) => { - get - { - return true; - } - } + this._tileFullscreenRef = refName; + this.MarkPropDirty("TileFullscreenRef"); + }); + } + } + else + { + _tileFullscreen = null; + this.SetHandler(this.Name, "TileFullscreen", null); + this.OnRefChanged("TileFullscreen", null, null, true, false, (refName, oldValue, newValue) => + { + this._tileFullscreenRef = null; + this.MarkPropDirty("TileFullscreenRef"); + }); + } + } + } + + private string _tileMaximizeRef = null; + private string _tileMaximizeScript = null; + [Parameter] + public string TileMaximizeScript + { - protected override bool UseDirectRender + set + { + if (value != this._tileMaximizeScript) + { + this._tileMaximizeScript = value; + this.OnRefChanged("TileMaximize", null, value, true, false, (string refName, object oldValue, object newValue) => + { + this._tileMaximizeRef = refName; + this.MarkPropDirty("TileMaximizeRef"); + }); + } + } + get + { + return this._tileMaximizeScript; + } + } + + partial void OnHandlingTileMaximize(IgbTileChangeStateEventArgs args); + private EventCallback? _tileMaximize = null; + [Parameter] + public EventCallback TileMaximize + { + get + { + return this._tileMaximize != null ? this._tileMaximize.Value : EventCallback.Empty; + } + set + { + if (!value.Equals(EventCallback.Empty)) + { + if (!CompareEventCallbacks(value, _tileMaximize, ref eventCallbacksCache)) + { + _tileMaximize = value; + this.SetHandler(this.Name, "TileMaximize", value, (args) => { - get - { - return true; - } - } + OnHandlingTileMaximize(args); - protected override string DirectRenderElementName + }); + this.OnRefChanged("TileMaximize", null, "event:::TileMaximize", true, false, (refName, oldValue, newValue) => { - get - { - return "igc-tile-manager"; - } - } - - protected override ControlEventBehavior DefaultEventBehavior - { - get { return ControlEventBehavior.Immediate; } - } - - public IgbTileManager(): base() { - OnCreatedIgbTileManager(); - - - } - - partial void OnCreatedIgbTileManager(); - - private TileManagerResizeMode _resizeMode = TileManagerResizeMode.None; - - partial void OnResizeModeChanging(ref TileManagerResizeMode newValue); - /// - /// Whether resize operations are enabled. - /// - [Parameter] - public TileManagerResizeMode ResizeMode - { - get { return this._resizeMode; } - set { - if (this._resizeMode != value || !IsPropDirty("ResizeMode")) { - MarkPropDirty("ResizeMode"); - } - this._resizeMode = value; - - } - } - private TileManagerDragMode _dragMode = TileManagerDragMode.None; - - partial void OnDragModeChanging(ref TileManagerDragMode newValue); - /// - /// Whether drag and drop operations are enabled. - /// - [Parameter] - public TileManagerDragMode DragMode - { - get { return this._dragMode; } - set { - if (this._dragMode != value || !IsPropDirty("DragMode")) { - MarkPropDirty("DragMode"); - } - this._dragMode = value; - - } - } - private double _columnCount = 0; - - partial void OnColumnCountChanging(ref double newValue); - [Parameter] - public double ColumnCount - { - get { return this._columnCount; } - set { - if (this._columnCount != value || !IsPropDirty("ColumnCount")) { - MarkPropDirty("ColumnCount"); - } - this._columnCount = value; - - } - } - private string? _minColumnWidth; - - partial void OnMinColumnWidthChanging(ref string? newValue); - /// - /// Sets the minimum width for a column unit in the tile manager. - /// - [Parameter] - public string? MinColumnWidth - { - get { return this._minColumnWidth; } - set { - if (this._minColumnWidth != value || !IsPropDirty("MinColumnWidth")) { - MarkPropDirty("MinColumnWidth"); - } - this._minColumnWidth = value; - - } - } - private string? _minRowHeight; - - partial void OnMinRowHeightChanging(ref string? newValue); - /// - /// Sets the minimum height for a row unit in the tile manager. - /// - [Parameter] - public string? MinRowHeight - { - get { return this._minRowHeight; } - set { - if (this._minRowHeight != value || !IsPropDirty("MinRowHeight")) { - MarkPropDirty("MinRowHeight"); - } - this._minRowHeight = value; - - } - } - private string? _gap; - - partial void OnGapChanging(ref string? newValue); - /// - /// Sets the gap size between tiles in the tile manager. - /// - [Parameter] - public string? Gap - { - get { return this._gap; } - set { - if (this._gap != value || !IsPropDirty("Gap")) { - MarkPropDirty("Gap"); - } - this._gap = value; - - } - } - public async Task GetTilesAsync() - { - var iv = await InvokeMethod("p:Tiles", new object[] { }, new string[] { }); - - if (iv == null) - { - return default(IgbTile[]); - } - var retVal = ReturnToObjectArray(iv); - if (retVal == null) - { - return default(IgbTile[]); - } - return retVal; - - } - public IgbTile[] GetTiles() - { - var iv = InvokeMethodSync("p:Tiles", new object[] { }, new string[] { }); - - if (iv == null) - { - return default(IgbTile[]); - } - var retVal = ReturnToObjectArray(iv); - if (retVal == null) - { - return default(IgbTile[]); - } - return retVal; - - } - - partial void FindByNameTileManager(string name, ref object item); - public override object FindByName(string name) - { - - var baseResult = base.FindByName(name); - if (baseResult != null) - { - return baseResult; - } - - object item = null; - FindByNameTileManager(name, ref item); - if (item != null) - { - return item; - } - - return null; - } - public async Task SetNativeElementAsync(Object element) - { - await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); - } - public void SetNativeElement(Object element) - { - InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); - } - /// - /// Returns the properties of the current tile collections as a JSON payload. - /// - public async Task SaveLayoutAsync() - { - var iv = await InvokeMethod("saveLayout", new object[] { }, new string[] { }); - return ReturnToString(iv); - } - public String SaveLayout() - { - var iv = InvokeMethodSync("saveLayout", new object[] { }, new string[] { }); - return ReturnToString(iv); - } - /// - /// Restores a previously serialized state produced by `saveLayout`. - /// - public async Task LoadLayoutAsync(String data) - { - await InvokeMethod("loadLayout", new object[] { StringToString(data) }, new string[] { "String" }); - } - public void LoadLayout(String data) - { - InvokeMethodSync("loadLayout", new object[] { StringToString(data) }, new string[] { "String" }); - } - - private string _tileFullscreenRef = null; - private string _tileFullscreenScript = null; - [Parameter] - public string TileFullscreenScript { - - set - { - if (value != this._tileFullscreenScript) - { - this._tileFullscreenScript = value; - this.OnRefChanged("TileFullscreen", null, value, true, false, (string refName, object oldValue, object newValue) => { - this._tileFullscreenRef = refName; - this.MarkPropDirty("TileFullscreenRef"); - }); - } - } - get - { - return this._tileFullscreenScript; - } - } - - partial void OnHandlingTileFullscreen(IgbTileChangeStateEventArgs args); - private EventCallback? _tileFullscreen = null; - [Parameter] - public EventCallback TileFullscreen - { - get - { - return this._tileFullscreen != null ? this._tileFullscreen.Value : EventCallback.Empty; - } - set - { - if (!value.Equals(EventCallback.Empty)) - { - if (!CompareEventCallbacks(value, _tileFullscreen, ref eventCallbacksCache)) - { - _tileFullscreen = value; - this.SetHandler(this.Name, "TileFullscreen", value, (args) => { - OnHandlingTileFullscreen(args); - - }); - this.OnRefChanged("TileFullscreen", null, "event:::TileFullscreen", true, false, (refName, oldValue, newValue) => { - this._tileFullscreenRef = refName; - this.MarkPropDirty("TileFullscreenRef"); - }); - } - } - else - { - _tileFullscreen = null; - this.SetHandler(this.Name, "TileFullscreen", null); - this.OnRefChanged("TileFullscreen", null, null, true, false, (refName, oldValue, newValue) => { - this._tileFullscreenRef = null; - this.MarkPropDirty("TileFullscreenRef"); - }); - } - } - } - - private string _tileMaximizeRef = null; - private string _tileMaximizeScript = null; - [Parameter] - public string TileMaximizeScript { - - set - { - if (value != this._tileMaximizeScript) - { - this._tileMaximizeScript = value; - this.OnRefChanged("TileMaximize", null, value, true, false, (string refName, object oldValue, object newValue) => { - this._tileMaximizeRef = refName; - this.MarkPropDirty("TileMaximizeRef"); - }); - } - } - get - { - return this._tileMaximizeScript; - } - } - - partial void OnHandlingTileMaximize(IgbTileChangeStateEventArgs args); - private EventCallback? _tileMaximize = null; - [Parameter] - public EventCallback TileMaximize - { - get - { - return this._tileMaximize != null ? this._tileMaximize.Value : EventCallback.Empty; - } - set - { - if (!value.Equals(EventCallback.Empty)) - { - if (!CompareEventCallbacks(value, _tileMaximize, ref eventCallbacksCache)) - { - _tileMaximize = value; - this.SetHandler(this.Name, "TileMaximize", value, (args) => { - OnHandlingTileMaximize(args); - - }); - this.OnRefChanged("TileMaximize", null, "event:::TileMaximize", true, false, (refName, oldValue, newValue) => { - this._tileMaximizeRef = refName; - this.MarkPropDirty("TileMaximizeRef"); - }); - } - } - else - { - _tileMaximize = null; - this.SetHandler(this.Name, "TileMaximize", null); - this.OnRefChanged("TileMaximize", null, null, true, false, (refName, oldValue, newValue) => { - this._tileMaximizeRef = null; - this.MarkPropDirty("TileMaximizeRef"); - }); - } - } - } - - private string _tileDragStartRef = null; - private string _tileDragStartScript = null; - [Parameter] - public string TileDragStartScript { - - set - { - if (value != this._tileDragStartScript) - { - this._tileDragStartScript = value; - this.OnRefChanged("TileDragStart", null, value, true, false, (string refName, object oldValue, object newValue) => { - this._tileDragStartRef = refName; - this.MarkPropDirty("TileDragStartRef"); - }); - } - } - get - { - return this._tileDragStartScript; - } - } - - partial void OnHandlingTileDragStart(IgbTileComponentEventArgs args); - private EventCallback? _tileDragStart = null; - [Parameter] - public EventCallback TileDragStart - { - get - { - return this._tileDragStart != null ? this._tileDragStart.Value : EventCallback.Empty; - } - set - { - if (!value.Equals(EventCallback.Empty)) - { - if (!CompareEventCallbacks(value, _tileDragStart, ref eventCallbacksCache)) - { - _tileDragStart = value; - this.SetHandler(this.Name, "TileDragStart", value, (args) => { - OnHandlingTileDragStart(args); - - }); - this.OnRefChanged("TileDragStart", null, "event:::TileDragStart", true, false, (refName, oldValue, newValue) => { - this._tileDragStartRef = refName; - this.MarkPropDirty("TileDragStartRef"); - }); - } - } - else - { - _tileDragStart = null; - this.SetHandler(this.Name, "TileDragStart", null); - this.OnRefChanged("TileDragStart", null, null, true, false, (refName, oldValue, newValue) => { - this._tileDragStartRef = null; - this.MarkPropDirty("TileDragStartRef"); - }); - } - } - } - - private string _tileDragEndRef = null; - private string _tileDragEndScript = null; - [Parameter] - public string TileDragEndScript { - - set - { - if (value != this._tileDragEndScript) - { - this._tileDragEndScript = value; - this.OnRefChanged("TileDragEnd", null, value, true, false, (string refName, object oldValue, object newValue) => { - this._tileDragEndRef = refName; - this.MarkPropDirty("TileDragEndRef"); - }); - } - } - get - { - return this._tileDragEndScript; - } - } - - partial void OnHandlingTileDragEnd(IgbTileComponentEventArgs args); - private EventCallback? _tileDragEnd = null; - [Parameter] - public EventCallback TileDragEnd - { - get - { - return this._tileDragEnd != null ? this._tileDragEnd.Value : EventCallback.Empty; - } - set - { - if (!value.Equals(EventCallback.Empty)) - { - if (!CompareEventCallbacks(value, _tileDragEnd, ref eventCallbacksCache)) - { - _tileDragEnd = value; - this.SetHandler(this.Name, "TileDragEnd", value, (args) => { - OnHandlingTileDragEnd(args); - - }); - this.OnRefChanged("TileDragEnd", null, "event:::TileDragEnd", true, false, (refName, oldValue, newValue) => { - this._tileDragEndRef = refName; - this.MarkPropDirty("TileDragEndRef"); - }); - } - } - else - { - _tileDragEnd = null; - this.SetHandler(this.Name, "TileDragEnd", null); - this.OnRefChanged("TileDragEnd", null, null, true, false, (refName, oldValue, newValue) => { - this._tileDragEndRef = null; - this.MarkPropDirty("TileDragEndRef"); - }); - } - } - } - - private string _tileDragCancelRef = null; - private string _tileDragCancelScript = null; - [Parameter] - public string TileDragCancelScript { - - set - { - if (value != this._tileDragCancelScript) - { - this._tileDragCancelScript = value; - this.OnRefChanged("TileDragCancel", null, value, true, false, (string refName, object oldValue, object newValue) => { - this._tileDragCancelRef = refName; - this.MarkPropDirty("TileDragCancelRef"); - }); - } - } - get - { - return this._tileDragCancelScript; - } - } - - partial void OnHandlingTileDragCancel(IgbTileComponentEventArgs args); - private EventCallback? _tileDragCancel = null; - [Parameter] - public EventCallback TileDragCancel - { - get - { - return this._tileDragCancel != null ? this._tileDragCancel.Value : EventCallback.Empty; - } - set - { - if (!value.Equals(EventCallback.Empty)) - { - if (!CompareEventCallbacks(value, _tileDragCancel, ref eventCallbacksCache)) - { - _tileDragCancel = value; - this.SetHandler(this.Name, "TileDragCancel", value, (args) => { - OnHandlingTileDragCancel(args); - - }); - this.OnRefChanged("TileDragCancel", null, "event:::TileDragCancel", true, false, (refName, oldValue, newValue) => { - this._tileDragCancelRef = refName; - this.MarkPropDirty("TileDragCancelRef"); - }); - } - } - else - { - _tileDragCancel = null; - this.SetHandler(this.Name, "TileDragCancel", null); - this.OnRefChanged("TileDragCancel", null, null, true, false, (refName, oldValue, newValue) => { - this._tileDragCancelRef = null; - this.MarkPropDirty("TileDragCancelRef"); - }); - } - } - } - - private string _tileResizeStartRef = null; - private string _tileResizeStartScript = null; - [Parameter] - public string TileResizeStartScript { - - set - { - if (value != this._tileResizeStartScript) - { - this._tileResizeStartScript = value; - this.OnRefChanged("TileResizeStart", null, value, true, false, (string refName, object oldValue, object newValue) => { - this._tileResizeStartRef = refName; - this.MarkPropDirty("TileResizeStartRef"); - }); - } - } - get - { - return this._tileResizeStartScript; - } - } - - partial void OnHandlingTileResizeStart(IgbTileComponentEventArgs args); - private EventCallback? _tileResizeStart = null; - [Parameter] - public EventCallback TileResizeStart - { - get - { - return this._tileResizeStart != null ? this._tileResizeStart.Value : EventCallback.Empty; - } - set - { - if (!value.Equals(EventCallback.Empty)) - { - if (!CompareEventCallbacks(value, _tileResizeStart, ref eventCallbacksCache)) - { - _tileResizeStart = value; - this.SetHandler(this.Name, "TileResizeStart", value, (args) => { - OnHandlingTileResizeStart(args); - - }); - this.OnRefChanged("TileResizeStart", null, "event:::TileResizeStart", true, false, (refName, oldValue, newValue) => { - this._tileResizeStartRef = refName; - this.MarkPropDirty("TileResizeStartRef"); - }); - } - } - else - { - _tileResizeStart = null; - this.SetHandler(this.Name, "TileResizeStart", null); - this.OnRefChanged("TileResizeStart", null, null, true, false, (refName, oldValue, newValue) => { - this._tileResizeStartRef = null; - this.MarkPropDirty("TileResizeStartRef"); - }); - } - } - } - - private string _tileResizeEndRef = null; - private string _tileResizeEndScript = null; - [Parameter] - public string TileResizeEndScript { - - set - { - if (value != this._tileResizeEndScript) - { - this._tileResizeEndScript = value; - this.OnRefChanged("TileResizeEnd", null, value, true, false, (string refName, object oldValue, object newValue) => { - this._tileResizeEndRef = refName; - this.MarkPropDirty("TileResizeEndRef"); - }); - } - } - get - { - return this._tileResizeEndScript; - } - } - - partial void OnHandlingTileResizeEnd(IgbTileComponentEventArgs args); - private EventCallback? _tileResizeEnd = null; - [Parameter] - public EventCallback TileResizeEnd - { - get - { - return this._tileResizeEnd != null ? this._tileResizeEnd.Value : EventCallback.Empty; - } - set - { - if (!value.Equals(EventCallback.Empty)) - { - if (!CompareEventCallbacks(value, _tileResizeEnd, ref eventCallbacksCache)) - { - _tileResizeEnd = value; - this.SetHandler(this.Name, "TileResizeEnd", value, (args) => { - OnHandlingTileResizeEnd(args); - - }); - this.OnRefChanged("TileResizeEnd", null, "event:::TileResizeEnd", true, false, (refName, oldValue, newValue) => { - this._tileResizeEndRef = refName; - this.MarkPropDirty("TileResizeEndRef"); - }); - } - } - else - { - _tileResizeEnd = null; - this.SetHandler(this.Name, "TileResizeEnd", null); - this.OnRefChanged("TileResizeEnd", null, null, true, false, (refName, oldValue, newValue) => { - this._tileResizeEndRef = null; - this.MarkPropDirty("TileResizeEndRef"); - }); - } - } - } - - private string _tileResizeCancelRef = null; - private string _tileResizeCancelScript = null; - [Parameter] - public string TileResizeCancelScript { - - set - { - if (value != this._tileResizeCancelScript) - { - this._tileResizeCancelScript = value; - this.OnRefChanged("TileResizeCancel", null, value, true, false, (string refName, object oldValue, object newValue) => { - this._tileResizeCancelRef = refName; - this.MarkPropDirty("TileResizeCancelRef"); - }); - } - } - get - { - return this._tileResizeCancelScript; - } - } - - partial void OnHandlingTileResizeCancel(IgbTileComponentEventArgs args); - private EventCallback? _tileResizeCancel = null; - [Parameter] - public EventCallback TileResizeCancel - { - get - { - return this._tileResizeCancel != null ? this._tileResizeCancel.Value : EventCallback.Empty; - } - set - { - if (!value.Equals(EventCallback.Empty)) - { - if (!CompareEventCallbacks(value, _tileResizeCancel, ref eventCallbacksCache)) - { - _tileResizeCancel = value; - this.SetHandler(this.Name, "TileResizeCancel", value, (args) => { - OnHandlingTileResizeCancel(args); - - }); - this.OnRefChanged("TileResizeCancel", null, "event:::TileResizeCancel", true, false, (refName, oldValue, newValue) => { - this._tileResizeCancelRef = refName; - this.MarkPropDirty("TileResizeCancelRef"); - }); - } - } - else - { - _tileResizeCancel = null; - this.SetHandler(this.Name, "TileResizeCancel", null); - this.OnRefChanged("TileResizeCancel", null, null, true, false, (refName, oldValue, newValue) => { - this._tileResizeCancelRef = null; - this.MarkPropDirty("TileResizeCancelRef"); - }); - } - } - } - - partial void SerializeCoreIgbTileManager(RendererSerializer ser); - - internal override void SerializeCore(RendererSerializer ser) - { - base.SerializeCore(ser); - - SerializeCoreIgbTileManager(ser); - - if (IsPropDirty("ResizeMode")) { ser.AddEnumProp("resizeMode", this._resizeMode); } - if (IsPropDirty("DragMode")) { ser.AddEnumProp("dragMode", this._dragMode); } - if (IsPropDirty("ColumnCount")) { ser.AddNumberProp("columnCount", this._columnCount); } - if (IsPropDirty("MinColumnWidth")) { ser.AddStringProp("minColumnWidth", this._minColumnWidth); } - if (IsPropDirty("MinRowHeight")) { ser.AddStringProp("minRowHeight", this._minRowHeight); } - if (IsPropDirty("Gap")) { ser.AddStringProp("gap", this._gap); } - if (IsPropDirty("TileFullscreenRef")) { ser.AddStringProp("tileFullscreenRef", this._tileFullscreenRef); } - if (IsPropDirty("TileMaximizeRef")) { ser.AddStringProp("tileMaximizeRef", this._tileMaximizeRef); } - if (IsPropDirty("TileDragStartRef")) { ser.AddStringProp("tileDragStartRef", this._tileDragStartRef); } - if (IsPropDirty("TileDragEndRef")) { ser.AddStringProp("tileDragEndRef", this._tileDragEndRef); } - if (IsPropDirty("TileDragCancelRef")) { ser.AddStringProp("tileDragCancelRef", this._tileDragCancelRef); } - if (IsPropDirty("TileResizeStartRef")) { ser.AddStringProp("tileResizeStartRef", this._tileResizeStartRef); } - if (IsPropDirty("TileResizeEndRef")) { ser.AddStringProp("tileResizeEndRef", this._tileResizeEndRef); } - if (IsPropDirty("TileResizeCancelRef")) { ser.AddStringProp("tileResizeCancelRef", this._tileResizeCancelRef); } - - } - -} + this._tileMaximizeRef = refName; + this.MarkPropDirty("TileMaximizeRef"); + }); + } + } + else + { + _tileMaximize = null; + this.SetHandler(this.Name, "TileMaximize", null); + this.OnRefChanged("TileMaximize", null, null, true, false, (refName, oldValue, newValue) => + { + this._tileMaximizeRef = null; + this.MarkPropDirty("TileMaximizeRef"); + }); + } + } + } + + private string _tileDragStartRef = null; + private string _tileDragStartScript = null; + [Parameter] + public string TileDragStartScript + { + + set + { + if (value != this._tileDragStartScript) + { + this._tileDragStartScript = value; + this.OnRefChanged("TileDragStart", null, value, true, false, (string refName, object oldValue, object newValue) => + { + this._tileDragStartRef = refName; + this.MarkPropDirty("TileDragStartRef"); + }); + } + } + get + { + return this._tileDragStartScript; + } + } + + partial void OnHandlingTileDragStart(IgbTileComponentEventArgs args); + private EventCallback? _tileDragStart = null; + [Parameter] + public EventCallback TileDragStart + { + get + { + return this._tileDragStart != null ? this._tileDragStart.Value : EventCallback.Empty; + } + set + { + if (!value.Equals(EventCallback.Empty)) + { + if (!CompareEventCallbacks(value, _tileDragStart, ref eventCallbacksCache)) + { + _tileDragStart = value; + this.SetHandler(this.Name, "TileDragStart", value, (args) => + { + OnHandlingTileDragStart(args); + + }); + this.OnRefChanged("TileDragStart", null, "event:::TileDragStart", true, false, (refName, oldValue, newValue) => + { + this._tileDragStartRef = refName; + this.MarkPropDirty("TileDragStartRef"); + }); + } + } + else + { + _tileDragStart = null; + this.SetHandler(this.Name, "TileDragStart", null); + this.OnRefChanged("TileDragStart", null, null, true, false, (refName, oldValue, newValue) => + { + this._tileDragStartRef = null; + this.MarkPropDirty("TileDragStartRef"); + }); + } + } + } + + private string _tileDragEndRef = null; + private string _tileDragEndScript = null; + [Parameter] + public string TileDragEndScript + { + + set + { + if (value != this._tileDragEndScript) + { + this._tileDragEndScript = value; + this.OnRefChanged("TileDragEnd", null, value, true, false, (string refName, object oldValue, object newValue) => + { + this._tileDragEndRef = refName; + this.MarkPropDirty("TileDragEndRef"); + }); + } + } + get + { + return this._tileDragEndScript; + } + } + + partial void OnHandlingTileDragEnd(IgbTileComponentEventArgs args); + private EventCallback? _tileDragEnd = null; + [Parameter] + public EventCallback TileDragEnd + { + get + { + return this._tileDragEnd != null ? this._tileDragEnd.Value : EventCallback.Empty; + } + set + { + if (!value.Equals(EventCallback.Empty)) + { + if (!CompareEventCallbacks(value, _tileDragEnd, ref eventCallbacksCache)) + { + _tileDragEnd = value; + this.SetHandler(this.Name, "TileDragEnd", value, (args) => + { + OnHandlingTileDragEnd(args); + + }); + this.OnRefChanged("TileDragEnd", null, "event:::TileDragEnd", true, false, (refName, oldValue, newValue) => + { + this._tileDragEndRef = refName; + this.MarkPropDirty("TileDragEndRef"); + }); + } + } + else + { + _tileDragEnd = null; + this.SetHandler(this.Name, "TileDragEnd", null); + this.OnRefChanged("TileDragEnd", null, null, true, false, (refName, oldValue, newValue) => + { + this._tileDragEndRef = null; + this.MarkPropDirty("TileDragEndRef"); + }); + } + } + } + + private string _tileDragCancelRef = null; + private string _tileDragCancelScript = null; + [Parameter] + public string TileDragCancelScript + { + + set + { + if (value != this._tileDragCancelScript) + { + this._tileDragCancelScript = value; + this.OnRefChanged("TileDragCancel", null, value, true, false, (string refName, object oldValue, object newValue) => + { + this._tileDragCancelRef = refName; + this.MarkPropDirty("TileDragCancelRef"); + }); + } + } + get + { + return this._tileDragCancelScript; + } + } + + partial void OnHandlingTileDragCancel(IgbTileComponentEventArgs args); + private EventCallback? _tileDragCancel = null; + [Parameter] + public EventCallback TileDragCancel + { + get + { + return this._tileDragCancel != null ? this._tileDragCancel.Value : EventCallback.Empty; + } + set + { + if (!value.Equals(EventCallback.Empty)) + { + if (!CompareEventCallbacks(value, _tileDragCancel, ref eventCallbacksCache)) + { + _tileDragCancel = value; + this.SetHandler(this.Name, "TileDragCancel", value, (args) => + { + OnHandlingTileDragCancel(args); + + }); + this.OnRefChanged("TileDragCancel", null, "event:::TileDragCancel", true, false, (refName, oldValue, newValue) => + { + this._tileDragCancelRef = refName; + this.MarkPropDirty("TileDragCancelRef"); + }); + } + } + else + { + _tileDragCancel = null; + this.SetHandler(this.Name, "TileDragCancel", null); + this.OnRefChanged("TileDragCancel", null, null, true, false, (refName, oldValue, newValue) => + { + this._tileDragCancelRef = null; + this.MarkPropDirty("TileDragCancelRef"); + }); + } + } + } + + private string _tileResizeStartRef = null; + private string _tileResizeStartScript = null; + [Parameter] + public string TileResizeStartScript + { + + set + { + if (value != this._tileResizeStartScript) + { + this._tileResizeStartScript = value; + this.OnRefChanged("TileResizeStart", null, value, true, false, (string refName, object oldValue, object newValue) => + { + this._tileResizeStartRef = refName; + this.MarkPropDirty("TileResizeStartRef"); + }); + } + } + get + { + return this._tileResizeStartScript; + } + } + + partial void OnHandlingTileResizeStart(IgbTileComponentEventArgs args); + private EventCallback? _tileResizeStart = null; + [Parameter] + public EventCallback TileResizeStart + { + get + { + return this._tileResizeStart != null ? this._tileResizeStart.Value : EventCallback.Empty; + } + set + { + if (!value.Equals(EventCallback.Empty)) + { + if (!CompareEventCallbacks(value, _tileResizeStart, ref eventCallbacksCache)) + { + _tileResizeStart = value; + this.SetHandler(this.Name, "TileResizeStart", value, (args) => + { + OnHandlingTileResizeStart(args); + + }); + this.OnRefChanged("TileResizeStart", null, "event:::TileResizeStart", true, false, (refName, oldValue, newValue) => + { + this._tileResizeStartRef = refName; + this.MarkPropDirty("TileResizeStartRef"); + }); + } + } + else + { + _tileResizeStart = null; + this.SetHandler(this.Name, "TileResizeStart", null); + this.OnRefChanged("TileResizeStart", null, null, true, false, (refName, oldValue, newValue) => + { + this._tileResizeStartRef = null; + this.MarkPropDirty("TileResizeStartRef"); + }); + } + } + } + + private string _tileResizeEndRef = null; + private string _tileResizeEndScript = null; + [Parameter] + public string TileResizeEndScript + { + + set + { + if (value != this._tileResizeEndScript) + { + this._tileResizeEndScript = value; + this.OnRefChanged("TileResizeEnd", null, value, true, false, (string refName, object oldValue, object newValue) => + { + this._tileResizeEndRef = refName; + this.MarkPropDirty("TileResizeEndRef"); + }); + } + } + get + { + return this._tileResizeEndScript; + } + } + + partial void OnHandlingTileResizeEnd(IgbTileComponentEventArgs args); + private EventCallback? _tileResizeEnd = null; + [Parameter] + public EventCallback TileResizeEnd + { + get + { + return this._tileResizeEnd != null ? this._tileResizeEnd.Value : EventCallback.Empty; + } + set + { + if (!value.Equals(EventCallback.Empty)) + { + if (!CompareEventCallbacks(value, _tileResizeEnd, ref eventCallbacksCache)) + { + _tileResizeEnd = value; + this.SetHandler(this.Name, "TileResizeEnd", value, (args) => + { + OnHandlingTileResizeEnd(args); + + }); + this.OnRefChanged("TileResizeEnd", null, "event:::TileResizeEnd", true, false, (refName, oldValue, newValue) => + { + this._tileResizeEndRef = refName; + this.MarkPropDirty("TileResizeEndRef"); + }); + } + } + else + { + _tileResizeEnd = null; + this.SetHandler(this.Name, "TileResizeEnd", null); + this.OnRefChanged("TileResizeEnd", null, null, true, false, (refName, oldValue, newValue) => + { + this._tileResizeEndRef = null; + this.MarkPropDirty("TileResizeEndRef"); + }); + } + } + } + + private string _tileResizeCancelRef = null; + private string _tileResizeCancelScript = null; + [Parameter] + public string TileResizeCancelScript + { + + set + { + if (value != this._tileResizeCancelScript) + { + this._tileResizeCancelScript = value; + this.OnRefChanged("TileResizeCancel", null, value, true, false, (string refName, object oldValue, object newValue) => + { + this._tileResizeCancelRef = refName; + this.MarkPropDirty("TileResizeCancelRef"); + }); + } + } + get + { + return this._tileResizeCancelScript; + } + } + + partial void OnHandlingTileResizeCancel(IgbTileComponentEventArgs args); + private EventCallback? _tileResizeCancel = null; + [Parameter] + public EventCallback TileResizeCancel + { + get + { + return this._tileResizeCancel != null ? this._tileResizeCancel.Value : EventCallback.Empty; + } + set + { + if (!value.Equals(EventCallback.Empty)) + { + if (!CompareEventCallbacks(value, _tileResizeCancel, ref eventCallbacksCache)) + { + _tileResizeCancel = value; + this.SetHandler(this.Name, "TileResizeCancel", value, (args) => + { + OnHandlingTileResizeCancel(args); + + }); + this.OnRefChanged("TileResizeCancel", null, "event:::TileResizeCancel", true, false, (refName, oldValue, newValue) => + { + this._tileResizeCancelRef = refName; + this.MarkPropDirty("TileResizeCancelRef"); + }); + } + } + else + { + _tileResizeCancel = null; + this.SetHandler(this.Name, "TileResizeCancel", null); + this.OnRefChanged("TileResizeCancel", null, null, true, false, (refName, oldValue, newValue) => + { + this._tileResizeCancelRef = null; + this.MarkPropDirty("TileResizeCancelRef"); + }); + } + } + } + + partial void SerializeCoreIgbTileManager(RendererSerializer ser); + + internal override void SerializeCore(RendererSerializer ser) + { + base.SerializeCore(ser); + + SerializeCoreIgbTileManager(ser); + + if (IsPropDirty("ResizeMode")) + { ser.AddEnumProp("resizeMode", this._resizeMode); } + if (IsPropDirty("DragMode")) + { ser.AddEnumProp("dragMode", this._dragMode); } + if (IsPropDirty("ColumnCount")) + { ser.AddNumberProp("columnCount", this._columnCount); } + if (IsPropDirty("MinColumnWidth")) + { ser.AddStringProp("minColumnWidth", this._minColumnWidth); } + if (IsPropDirty("MinRowHeight")) + { ser.AddStringProp("minRowHeight", this._minRowHeight); } + if (IsPropDirty("Gap")) + { ser.AddStringProp("gap", this._gap); } + if (IsPropDirty("TileFullscreenRef")) + { ser.AddStringProp("tileFullscreenRef", this._tileFullscreenRef); } + if (IsPropDirty("TileMaximizeRef")) + { ser.AddStringProp("tileMaximizeRef", this._tileMaximizeRef); } + if (IsPropDirty("TileDragStartRef")) + { ser.AddStringProp("tileDragStartRef", this._tileDragStartRef); } + if (IsPropDirty("TileDragEndRef")) + { ser.AddStringProp("tileDragEndRef", this._tileDragEndRef); } + if (IsPropDirty("TileDragCancelRef")) + { ser.AddStringProp("tileDragCancelRef", this._tileDragCancelRef); } + if (IsPropDirty("TileResizeStartRef")) + { ser.AddStringProp("tileResizeStartRef", this._tileResizeStartRef); } + if (IsPropDirty("TileResizeEndRef")) + { ser.AddStringProp("tileResizeEndRef", this._tileResizeEndRef); } + if (IsPropDirty("TileResizeCancelRef")) + { ser.AddStringProp("tileResizeCancelRef", this._tileResizeCancelRef); } + + } + + } } diff --git a/src/components/Blazor/TileManagerDragMode.cs b/src/components/Blazor/TileManagerDragMode.cs index fd06b11e..1fc34aff 100644 --- a/src/components/Blazor/TileManagerDragMode.cs +++ b/src/components/Blazor/TileManagerDragMode.cs @@ -1,10 +1,11 @@ namespace IgniteUI.Blazor.Controls { -public enum TileManagerDragMode { - None, - [WCEnumName("tile-header")] - TileHeader, - Tile + public enum TileManagerDragMode + { + None, + [WCEnumName("tile-header")] + TileHeader, + Tile -} + } } diff --git a/src/components/Blazor/TileManagerModule.cs b/src/components/Blazor/TileManagerModule.cs index 2d600029..c4340d56 100644 --- a/src/components/Blazor/TileManagerModule.cs +++ b/src/components/Blazor/TileManagerModule.cs @@ -1,24 +1,22 @@ -using System; -using System.Collections.Generic; -using System.Runtime.CompilerServices; -using System.Text; -using System.Collections.Generic; - namespace IgniteUI.Blazor.Controls { - public partial class IgbTileManagerModule { - public static void Register(IIgniteUIBlazor runtime) { + public partial class IgbTileManagerModule + { + public static void Register(IIgniteUIBlazor runtime) + { ModuleLoader.Load(runtime, "WebTileManagerModule"); IgbTileModule.MarkIsLoadRequested(runtime); } - public static void MarkIsLoadRequested(IIgniteUIBlazor runtime) { + public static void MarkIsLoadRequested(IIgniteUIBlazor runtime) + { ModuleLoader.MarkIsLoadRequested(runtime, "WebTileManagerModule"); } - public static bool IsLoadRequested(IIgniteUIBlazor runtime) { + public static bool IsLoadRequested(IIgniteUIBlazor runtime) + { return ModuleLoader.IsLoadRequested(runtime, "WebTileManagerModule"); } } diff --git a/src/components/Blazor/TileManagerResizeMode.cs b/src/components/Blazor/TileManagerResizeMode.cs index 11652171..539e4937 100644 --- a/src/components/Blazor/TileManagerResizeMode.cs +++ b/src/components/Blazor/TileManagerResizeMode.cs @@ -1,9 +1,10 @@ namespace IgniteUI.Blazor.Controls { -public enum TileManagerResizeMode { - None, - Hover, - Always + public enum TileManagerResizeMode + { + None, + Hover, + Always -} + } } diff --git a/src/components/Blazor/TileModule.cs b/src/components/Blazor/TileModule.cs index 7a1be242..3a08ba44 100644 --- a/src/components/Blazor/TileModule.cs +++ b/src/components/Blazor/TileModule.cs @@ -1,23 +1,20 @@ -using System; -using System.Collections.Generic; -using System.Runtime.CompilerServices; -using System.Text; -using System.Collections.Generic; - namespace IgniteUI.Blazor.Controls { - public partial class IgbTileModule { - public static void Register(IIgniteUIBlazor runtime) { + public partial class IgbTileModule + { + public static void Register(IIgniteUIBlazor runtime) + { ModuleLoader.Load(runtime, "WebTileModule"); - } - public static void MarkIsLoadRequested(IIgniteUIBlazor runtime) { + public static void MarkIsLoadRequested(IIgniteUIBlazor runtime) + { ModuleLoader.MarkIsLoadRequested(runtime, "WebTileModule"); } - public static bool IsLoadRequested(IIgniteUIBlazor runtime) { + public static bool IsLoadRequested(IIgniteUIBlazor runtime) + { return ModuleLoader.IsLoadRequested(runtime, "WebTileModule"); } } diff --git a/src/components/Blazor/Toast.cs b/src/components/Blazor/Toast.cs index 8657fdbc..838cc236 100644 --- a/src/components/Blazor/Toast.cs +++ b/src/components/Blazor/Toast.cs @@ -1,92 +1,83 @@ - -using System; -using Microsoft.AspNetCore.Components; -using Microsoft.AspNetCore.Components.Rendering; -using System.Threading.Tasks; -using System.Collections.Generic; -using System.Linq; - namespace IgniteUI.Blazor.Controls { - public partial class IgbToast: IgbBaseAlertLike { - public override string Type { get { return "WebToast"; } } - - protected override void EnsureModulesLoaded() - { - if (!IgbToastModule.IsLoadRequested(IgBlazor)) - { - IgbToastModule.Register(IgBlazor); - } - } - - protected override string ResolveDisplay() - { - return "inline-block"; - } - - protected override bool SupportsVisualChildren - { - get - { - return true; - } - } - - protected override bool UseDirectRender - { - get - { - return true; - } - } - - protected override string DirectRenderElementName - { - get - { - return "igc-toast"; - } - } - - public IgbToast(): base() { - OnCreatedIgbToast(); - - - } - - partial void OnCreatedIgbToast(); - - - partial void FindByNameToast(string name, ref object item); - public override object FindByName(string name) - { - - var baseResult = base.FindByName(name); - if (baseResult != null) - { - return baseResult; - } - - object item = null; - FindByNameToast(name, ref item); - if (item != null) - { - return item; - } - - return null; - } - - partial void SerializeCoreIgbToast(RendererSerializer ser); - - internal override void SerializeCore(RendererSerializer ser) - { - base.SerializeCore(ser); - - SerializeCoreIgbToast(ser); - - - } - -} + public partial class IgbToast : IgbBaseAlertLike + { + public override string Type { get { return "WebToast"; } } + + protected override void EnsureModulesLoaded() + { + if (!IgbToastModule.IsLoadRequested(IgBlazor)) + { + IgbToastModule.Register(IgBlazor); + } + } + + protected override string ResolveDisplay() + { + return "inline-block"; + } + + protected override bool SupportsVisualChildren + { + get + { + return true; + } + } + + protected override bool UseDirectRender + { + get + { + return true; + } + } + + protected override string DirectRenderElementName + { + get + { + return "igc-toast"; + } + } + + public IgbToast() : base() + { + OnCreatedIgbToast(); + + } + + partial void OnCreatedIgbToast(); + + partial void FindByNameToast(string name, ref object item); + public override object FindByName(string name) + { + + var baseResult = base.FindByName(name); + if (baseResult != null) + { + return baseResult; + } + + object item = null; + FindByNameToast(name, ref item); + if (item != null) + { + return item; + } + + return null; + } + + partial void SerializeCoreIgbToast(RendererSerializer ser); + + internal override void SerializeCore(RendererSerializer ser) + { + base.SerializeCore(ser); + + SerializeCoreIgbToast(ser); + + } + + } } diff --git a/src/components/Blazor/ToastModule.cs b/src/components/Blazor/ToastModule.cs index f3913076..e4ecc848 100644 --- a/src/components/Blazor/ToastModule.cs +++ b/src/components/Blazor/ToastModule.cs @@ -1,23 +1,20 @@ -using System; -using System.Collections.Generic; -using System.Runtime.CompilerServices; -using System.Text; -using System.Collections.Generic; - namespace IgniteUI.Blazor.Controls { - public partial class IgbToastModule { - public static void Register(IIgniteUIBlazor runtime) { + public partial class IgbToastModule + { + public static void Register(IIgniteUIBlazor runtime) + { ModuleLoader.Load(runtime, "WebToastModule"); - } - public static void MarkIsLoadRequested(IIgniteUIBlazor runtime) { + public static void MarkIsLoadRequested(IIgniteUIBlazor runtime) + { ModuleLoader.MarkIsLoadRequested(runtime, "WebToastModule"); } - public static bool IsLoadRequested(IIgniteUIBlazor runtime) { + public static bool IsLoadRequested(IIgniteUIBlazor runtime) + { return ModuleLoader.IsLoadRequested(runtime, "WebToastModule"); } } diff --git a/src/components/Blazor/ToggleButton.cs b/src/components/Blazor/ToggleButton.cs index 58d3797d..9ad2183c 100644 --- a/src/components/Blazor/ToggleButton.cs +++ b/src/components/Blazor/ToggleButton.cs @@ -1,207 +1,211 @@ - -using System; using Microsoft.AspNetCore.Components; -using Microsoft.AspNetCore.Components.Rendering; -using System.Threading.Tasks; -using System.Collections.Generic; -using System.Linq; namespace IgniteUI.Blazor.Controls { - /// -/// The `igc-toggle-button` wraps a native button element and exposes additional `value` and `selected` properties. -/// It is used in the context of an `igc-button-group` to facilitate the creation of group/toolbar like UX behaviors. -/// -public partial class IgbToggleButton: BaseRendererControl { - public override string Type { get { return "WebToggleButton"; } } - - protected override void EnsureModulesLoaded() - { - if (!IgbToggleButtonModule.IsLoadRequested(IgBlazor)) - { - IgbToggleButtonModule.Register(IgBlazor); - } - } - - protected override string ResolveDisplay() - { - return "inline-block"; - } - - protected override bool SupportsVisualChildren - { - get - { - return true; - } - } - - protected override bool UseDirectRender - { - get - { - return true; - } - } - - protected override string DirectRenderElementName - { - get - { - return "igc-toggle-button"; - } - } - - protected override ControlEventBehavior DefaultEventBehavior - { - get { return ControlEventBehavior.Immediate; } - } - - public IgbToggleButton(): base() { - OnCreatedIgbToggleButton(); - - - } - - partial void OnCreatedIgbToggleButton(); - - private string _value; - - partial void OnValueChanging(ref string newValue); - /// - /// The value attribute of the control. - /// - [Parameter] - public string Value - { - get { return this._value; } - set { - if (this._value != value || !IsPropDirty("Value")) { - MarkPropDirty("Value"); - } - this._value = value; - - } - } - private bool _selected = false; - - partial void OnSelectedChanging(ref bool newValue); - /// - /// Determines whether the button is selected. - /// - [Parameter] - public bool Selected - { - get { return this._selected; } - set { - if (this._selected != value || !IsPropDirty("Selected")) { - MarkPropDirty("Selected"); - } - this._selected = value; - - } - } - private bool _disabled = false; - - partial void OnDisabledChanging(ref bool newValue); - /// - /// Determines whether the button is disabled. - /// - [Parameter] - public bool Disabled - { - get { return this._disabled; } - set { - if (this._disabled != value || !IsPropDirty("Disabled")) { - MarkPropDirty("Disabled"); - } - this._disabled = value; - - } - } - - partial void FindByNameToggleButton(string name, ref object item); - public override object FindByName(string name) - { - - var baseResult = base.FindByName(name); - if (baseResult != null) - { - return baseResult; - } - - object item = null; - FindByNameToggleButton(name, ref item); - if (item != null) - { - return item; - } - - return null; - } - public async Task SetNativeElementAsync(Object element) - { - await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); - } - public void SetNativeElement(Object element) - { - InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); - } - /// - /// Sets focus on the button. - /// - - [WCWidgetMemberName("Focus")] - public async Task FocusComponentAsync(IgbFocusOptions options) - { - await InvokeMethod("focus", new object[] { ObjectToParam(options) }, new string[] { "Json" }); - } - - [WCWidgetMemberName("Focus")] - public void FocusComponent(IgbFocusOptions options) - { - InvokeMethodSync("focus", new object[] { ObjectToParam(options) }, new string[] { "Json" }); - } - /// - /// Removes focus from the button. - /// - - [WCWidgetMemberName("Blur")] - public async Task BlurComponentAsync() - { - await InvokeMethod("blur", new object[] { }, new string[] { }); - } - - [WCWidgetMemberName("Blur")] - public void BlurComponent() - { - InvokeMethodSync("blur", new object[] { }, new string[] { }); - } - /// - /// Simulates a mouse click on the element. - /// - public async Task ClickAsync() - { - await InvokeMethod("click", new object[] { }, new string[] { }); - } - public void Click() - { - InvokeMethodSync("click", new object[] { }, new string[] { }); - } - - partial void SerializeCoreIgbToggleButton(RendererSerializer ser); - - internal override void SerializeCore(RendererSerializer ser) - { - base.SerializeCore(ser); - - SerializeCoreIgbToggleButton(ser); - - if (IsPropDirty("Value")) { ser.AddStringProp("value", this._value); } - if (IsPropDirty("Selected")) { ser.AddBooleanProp("selected", this._selected); } - if (IsPropDirty("Disabled")) { ser.AddBooleanProp("disabled", this._disabled); } - - } - -} + /// + /// The `igc-toggle-button` wraps a native button element and exposes additional `value` and `selected` properties. + /// It is used in the context of an `igc-button-group` to facilitate the creation of group/toolbar like UX behaviors. + /// + public partial class IgbToggleButton : BaseRendererControl + { + public override string Type { get { return "WebToggleButton"; } } + + protected override void EnsureModulesLoaded() + { + if (!IgbToggleButtonModule.IsLoadRequested(IgBlazor)) + { + IgbToggleButtonModule.Register(IgBlazor); + } + } + + protected override string ResolveDisplay() + { + return "inline-block"; + } + + protected override bool SupportsVisualChildren + { + get + { + return true; + } + } + + protected override bool UseDirectRender + { + get + { + return true; + } + } + + protected override string DirectRenderElementName + { + get + { + return "igc-toggle-button"; + } + } + + protected override ControlEventBehavior DefaultEventBehavior + { + get { return ControlEventBehavior.Immediate; } + } + + public IgbToggleButton() : base() + { + OnCreatedIgbToggleButton(); + + } + + partial void OnCreatedIgbToggleButton(); + + private string _value; + + partial void OnValueChanging(ref string newValue); + /// + /// The value attribute of the control. + /// + [Parameter] + public string Value + { + get { return this._value; } + set + { + if (this._value != value || !IsPropDirty("Value")) + { + MarkPropDirty("Value"); + } + this._value = value; + + } + } + private bool _selected = false; + + partial void OnSelectedChanging(ref bool newValue); + /// + /// Determines whether the button is selected. + /// + [Parameter] + public bool Selected + { + get { return this._selected; } + set + { + if (this._selected != value || !IsPropDirty("Selected")) + { + MarkPropDirty("Selected"); + } + this._selected = value; + + } + } + private bool _disabled = false; + + partial void OnDisabledChanging(ref bool newValue); + /// + /// Determines whether the button is disabled. + /// + [Parameter] + public bool Disabled + { + get { return this._disabled; } + set + { + if (this._disabled != value || !IsPropDirty("Disabled")) + { + MarkPropDirty("Disabled"); + } + this._disabled = value; + + } + } + + partial void FindByNameToggleButton(string name, ref object item); + public override object FindByName(string name) + { + + var baseResult = base.FindByName(name); + if (baseResult != null) + { + return baseResult; + } + + object item = null; + FindByNameToggleButton(name, ref item); + if (item != null) + { + return item; + } + + return null; + } + public async Task SetNativeElementAsync(Object element) + { + await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + } + public void SetNativeElement(Object element) + { + InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + } + /// + /// Sets focus on the button. + /// + + [WCWidgetMemberName("Focus")] + public async Task FocusComponentAsync(IgbFocusOptions options) + { + await InvokeMethod("focus", new object[] { ObjectToParam(options) }, new string[] { "Json" }); + } + + [WCWidgetMemberName("Focus")] + public void FocusComponent(IgbFocusOptions options) + { + InvokeMethodSync("focus", new object[] { ObjectToParam(options) }, new string[] { "Json" }); + } + /// + /// Removes focus from the button. + /// + + [WCWidgetMemberName("Blur")] + public async Task BlurComponentAsync() + { + await InvokeMethod("blur", new object[] { }, new string[] { }); + } + + [WCWidgetMemberName("Blur")] + public void BlurComponent() + { + InvokeMethodSync("blur", new object[] { }, new string[] { }); + } + /// + /// Simulates a mouse click on the element. + /// + public async Task ClickAsync() + { + await InvokeMethod("click", new object[] { }, new string[] { }); + } + public void Click() + { + InvokeMethodSync("click", new object[] { }, new string[] { }); + } + + partial void SerializeCoreIgbToggleButton(RendererSerializer ser); + + internal override void SerializeCore(RendererSerializer ser) + { + base.SerializeCore(ser); + + SerializeCoreIgbToggleButton(ser); + + if (IsPropDirty("Value")) + { ser.AddStringProp("value", this._value); } + if (IsPropDirty("Selected")) + { ser.AddBooleanProp("selected", this._selected); } + if (IsPropDirty("Disabled")) + { ser.AddBooleanProp("disabled", this._disabled); } + + } + + } } diff --git a/src/components/Blazor/ToggleButtonModule.cs b/src/components/Blazor/ToggleButtonModule.cs index 174e5ca4..dbf34a68 100644 --- a/src/components/Blazor/ToggleButtonModule.cs +++ b/src/components/Blazor/ToggleButtonModule.cs @@ -1,23 +1,20 @@ -using System; -using System.Collections.Generic; -using System.Runtime.CompilerServices; -using System.Text; -using System.Collections.Generic; - namespace IgniteUI.Blazor.Controls { - public partial class IgbToggleButtonModule { - public static void Register(IIgniteUIBlazor runtime) { + public partial class IgbToggleButtonModule + { + public static void Register(IIgniteUIBlazor runtime) + { ModuleLoader.Load(runtime, "WebToggleButtonModule"); - } - public static void MarkIsLoadRequested(IIgniteUIBlazor runtime) { + public static void MarkIsLoadRequested(IIgniteUIBlazor runtime) + { ModuleLoader.MarkIsLoadRequested(runtime, "WebToggleButtonModule"); } - public static bool IsLoadRequested(IIgniteUIBlazor runtime) { + public static bool IsLoadRequested(IIgniteUIBlazor runtime) + { return ModuleLoader.IsLoadRequested(runtime, "WebToggleButtonModule"); } } diff --git a/src/components/Blazor/ToggleLabelPosition.cs b/src/components/Blazor/ToggleLabelPosition.cs index b685bc72..44a0567e 100644 --- a/src/components/Blazor/ToggleLabelPosition.cs +++ b/src/components/Blazor/ToggleLabelPosition.cs @@ -1,8 +1,9 @@ namespace IgniteUI.Blazor.Controls { -public enum ToggleLabelPosition { - After, - Before + public enum ToggleLabelPosition + { + After, + Before -} + } } diff --git a/src/components/Blazor/Tooltip.cs b/src/components/Blazor/Tooltip.cs index cdb10863..20a24f36 100644 --- a/src/components/Blazor/Tooltip.cs +++ b/src/components/Blazor/Tooltip.cs @@ -1,604 +1,656 @@ - -using System; using Microsoft.AspNetCore.Components; -using Microsoft.AspNetCore.Components.Rendering; -using System.Threading.Tasks; -using System.Collections.Generic; -using System.Linq; namespace IgniteUI.Blazor.Controls { - /// -/// Provides a way to display supplementary information related to an element when a user interacts with it (e.g., hover, focus). -/// It offers features such as placement customization, delays, sticky mode, and animations. -/// -public partial class IgbTooltip: BaseRendererControl { - public override string Type { get { return "WebTooltip"; } } - - protected override void EnsureModulesLoaded() - { - if (!IgbTooltipModule.IsLoadRequested(IgBlazor)) - { - IgbTooltipModule.Register(IgBlazor); - } - } - - protected override string ResolveDisplay() + /// + /// Provides a way to display supplementary information related to an element when a user interacts with it (e.g., hover, focus). + /// It offers features such as placement customization, delays, sticky mode, and animations. + /// + public partial class IgbTooltip : BaseRendererControl + { + public override string Type { get { return "WebTooltip"; } } + + protected override void EnsureModulesLoaded() + { + if (!IgbTooltipModule.IsLoadRequested(IgBlazor)) + { + IgbTooltipModule.Register(IgBlazor); + } + } + + protected override string ResolveDisplay() + { + return "inline-block"; + } + + protected override bool SupportsVisualChildren + { + get + { + return true; + } + } + + protected override bool UseDirectRender + { + get + { + return true; + } + } + + protected override string DirectRenderElementName + { + get + { + return "igc-tooltip"; + } + } + + protected override ControlEventBehavior DefaultEventBehavior + { + get { return ControlEventBehavior.Immediate; } + } + + public IgbTooltip() : base() + { + OnCreatedIgbTooltip(); + + } + + partial void OnCreatedIgbTooltip(); + + private bool _open = false; + + partial void OnOpenChanging(ref bool newValue); + /// + /// Whether the tooltip is showing. + /// + [Parameter] + public bool Open + { + get { return this._open; } + set + { + if (this._open != value || !IsPropDirty("Open")) + { + MarkPropDirty("Open"); + } + this._open = value; + + } + } + private bool _withArrow = false; + + partial void OnWithArrowChanging(ref bool newValue); + /// + /// Whether to render an arrow indicator for the tooltip. + /// + [Parameter] + public bool WithArrow + { + get { return this._withArrow; } + set + { + if (this._withArrow != value || !IsPropDirty("WithArrow")) + { + MarkPropDirty("WithArrow"); + } + this._withArrow = value; + + } + } + private double _offset = 0; + + partial void OnOffsetChanging(ref double newValue); + /// + /// The offset of the tooltip from the anchor in pixels. + /// + [Parameter] + public double Offset + { + get { return this._offset; } + set + { + if (this._offset != value || !IsPropDirty("Offset")) + { + MarkPropDirty("Offset"); + } + this._offset = value; + + } + } + private PopoverPlacement _placement = PopoverPlacement.Top; + + partial void OnPlacementChanging(ref PopoverPlacement newValue); + /// + /// Where to place the floating element relative to the parent anchor element. + /// + [Parameter] + public PopoverPlacement Placement + { + get { return this._placement; } + set + { + if (this._placement != value || !IsPropDirty("Placement")) + { + MarkPropDirty("Placement"); + } + this._placement = value; + + } + } + private string _anchor; + + partial void OnAnchorChanging(ref string newValue); + /// + /// An element instance or an IDREF to use as the anchor for the tooltip. + /// + [Parameter] + public string Anchor + { + get { return this._anchor; } + set + { + if (this._anchor != value || !IsPropDirty("Anchor")) + { + MarkPropDirty("Anchor"); + } + this._anchor = value; + + } + } + private string _showTriggers; + + partial void OnShowTriggersChanging(ref string newValue); + /// + /// Which event triggers will show the tooltip. + /// Expects a comma separate string of different event triggers. + /// + [Parameter] + public string ShowTriggers + { + get { return this._showTriggers; } + set + { + if (this._showTriggers != value || !IsPropDirty("ShowTriggers")) + { + MarkPropDirty("ShowTriggers"); + } + this._showTriggers = value; + + } + } + private string _hideTriggers; + + partial void OnHideTriggersChanging(ref string newValue); + /// + /// Which event triggers will hide the tooltip. + /// Expects a comma separate string of different event triggers. + /// + [Parameter] + public string HideTriggers + { + get { return this._hideTriggers; } + set + { + if (this._hideTriggers != value || !IsPropDirty("HideTriggers")) + { + MarkPropDirty("HideTriggers"); + } + this._hideTriggers = value; + + } + } + private double _showDelay = 0; + + partial void OnShowDelayChanging(ref double newValue); + /// + /// Specifies the number of milliseconds that should pass before showing the tooltip. + /// + [Parameter] + public double ShowDelay + { + get { return this._showDelay; } + set + { + if (this._showDelay != value || !IsPropDirty("ShowDelay")) + { + MarkPropDirty("ShowDelay"); + } + this._showDelay = value; + + } + } + private double _hideDelay = 0; + + partial void OnHideDelayChanging(ref double newValue); + /// + /// Specifies the number of milliseconds that should pass before hiding the tooltip. + /// + [Parameter] + public double HideDelay + { + get { return this._hideDelay; } + set + { + if (this._hideDelay != value || !IsPropDirty("HideDelay")) + { + MarkPropDirty("HideDelay"); + } + this._hideDelay = value; + + } + } + private string _message; + + partial void OnMessageChanging(ref string newValue); + /// + /// Specifies a plain text as tooltip content. + /// + [Parameter] + public string Message + { + get { return this._message; } + set + { + if (this._message != value || !IsPropDirty("Message")) + { + MarkPropDirty("Message"); + } + this._message = value; + + } + } + private bool _sticky = false; + + partial void OnStickyChanging(ref bool newValue); + /// + /// Specifies if the tooltip remains visible until the user closes it via the close button or Esc key. + /// + [Parameter] + public bool Sticky + { + get { return this._sticky; } + set + { + if (this._sticky != value || !IsPropDirty("Sticky")) + { + MarkPropDirty("Sticky"); + } + this._sticky = value; + + } + } + + partial void FindByNameTooltip(string name, ref object item); + public override object FindByName(string name) + { + + var baseResult = base.FindByName(name); + if (baseResult != null) + { + return baseResult; + } + + object item = null; + FindByNameTooltip(name, ref item); + if (item != null) + { + return item; + } + + return null; + } + public async Task SetNativeElementAsync(Object element) + { + await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + } + public void SetNativeElement(Object element) + { + InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + } + /// + /// Shows the tooltip if not already showing. + /// If a target is provided, sets it as a transient anchor. + /// + public async Task ShowAsync(String target = null) + { + var iv = await InvokeMethod("show", new object[] { StringToString(target) }, new string[] { "String" }); + return ReturnToBoolean(iv); + } + public bool Show(String target = null) + { + var iv = InvokeMethodSync("show", new object[] { StringToString(target) }, new string[] { "String" }); + return ReturnToBoolean(iv); + } + /// + /// Hides the tooltip if not already hidden. + /// + public async Task HideAsync() + { + var iv = await InvokeMethod("hide", new object[] { }, new string[] { }); + return ReturnToBoolean(iv); + } + public bool Hide() + { + var iv = InvokeMethodSync("hide", new object[] { }, new string[] { }); + return ReturnToBoolean(iv); + } + /// + /// Toggles the tooltip between shown/hidden state + /// + public async Task ToggleAsync() + { + var iv = await InvokeMethod("toggle", new object[] { }, new string[] { }); + return ReturnToBoolean(iv); + } + public bool Toggle() + { + var iv = InvokeMethodSync("toggle", new object[] { }, new string[] { }); + return ReturnToBoolean(iv); + } + + private string _openingRef = null; + private string _openingScript = null; + [Parameter] + public string OpeningScript + { + + set + { + if (value != this._openingScript) + { + this._openingScript = value; + this.OnRefChanged("Opening", null, value, true, false, (string refName, object oldValue, object newValue) => + { + this._openingRef = refName; + this.MarkPropDirty("OpeningRef"); + }); + } + } + get + { + return this._openingScript; + } + } + + partial void OnHandlingOpening(IgbVoidEventArgs args); + private EventCallback? _opening = null; + [Parameter] + public EventCallback Opening + { + get + { + return this._opening != null ? this._opening.Value : EventCallback.Empty; + } + set + { + if (!value.Equals(EventCallback.Empty)) + { + if (!CompareEventCallbacks(value, _opening, ref eventCallbacksCache)) + { + _opening = value; + this.SetHandler(this.Name, "Opening", value, (args) => { - return "inline-block"; - } + OnHandlingOpening(args); - protected override bool SupportsVisualChildren + }); + this.OnRefChanged("Opening", null, "event:::Opening", true, false, (refName, oldValue, newValue) => { - get - { - return true; - } - } + this._openingRef = refName; + this.MarkPropDirty("OpeningRef"); + }); + } + } + else + { + _opening = null; + this.SetHandler(this.Name, "Opening", null); + this.OnRefChanged("Opening", null, null, true, false, (refName, oldValue, newValue) => + { + this._openingRef = null; + this.MarkPropDirty("OpeningRef"); + }); + } + } + } + + private string _openedRef = null; + private string _openedScript = null; + [Parameter] + public string OpenedScript + { - protected override bool UseDirectRender + set + { + if (value != this._openedScript) + { + this._openedScript = value; + this.OnRefChanged("Opened", null, value, true, false, (string refName, object oldValue, object newValue) => + { + this._openedRef = refName; + this.MarkPropDirty("OpenedRef"); + }); + } + } + get + { + return this._openedScript; + } + } + + partial void OnHandlingOpened(IgbVoidEventArgs args); + private EventCallback? _opened = null; + [Parameter] + public EventCallback Opened + { + get + { + return this._opened != null ? this._opened.Value : EventCallback.Empty; + } + set + { + if (!value.Equals(EventCallback.Empty)) + { + if (!CompareEventCallbacks(value, _opened, ref eventCallbacksCache)) + { + _opened = value; + this.SetHandler(this.Name, "Opened", value, (args) => { - get - { - return true; - } - } + OnHandlingOpened(args); - protected override string DirectRenderElementName + }); + this.OnRefChanged("Opened", null, "event:::Opened", true, false, (refName, oldValue, newValue) => { - get - { - return "igc-tooltip"; - } - } - - protected override ControlEventBehavior DefaultEventBehavior - { - get { return ControlEventBehavior.Immediate; } - } - - public IgbTooltip(): base() { - OnCreatedIgbTooltip(); - - - } - - partial void OnCreatedIgbTooltip(); - - private bool _open = false; - - partial void OnOpenChanging(ref bool newValue); - /// - /// Whether the tooltip is showing. - /// - [Parameter] - public bool Open - { - get { return this._open; } - set { - if (this._open != value || !IsPropDirty("Open")) { - MarkPropDirty("Open"); - } - this._open = value; - - } - } - private bool _withArrow = false; - - partial void OnWithArrowChanging(ref bool newValue); - /// - /// Whether to render an arrow indicator for the tooltip. - /// - [Parameter] - public bool WithArrow - { - get { return this._withArrow; } - set { - if (this._withArrow != value || !IsPropDirty("WithArrow")) { - MarkPropDirty("WithArrow"); - } - this._withArrow = value; - - } - } - private double _offset = 0; - - partial void OnOffsetChanging(ref double newValue); - /// - /// The offset of the tooltip from the anchor in pixels. - /// - [Parameter] - public double Offset - { - get { return this._offset; } - set { - if (this._offset != value || !IsPropDirty("Offset")) { - MarkPropDirty("Offset"); - } - this._offset = value; - - } - } - private PopoverPlacement _placement = PopoverPlacement.Top; - - partial void OnPlacementChanging(ref PopoverPlacement newValue); - /// - /// Where to place the floating element relative to the parent anchor element. - /// - [Parameter] - public PopoverPlacement Placement - { - get { return this._placement; } - set { - if (this._placement != value || !IsPropDirty("Placement")) { - MarkPropDirty("Placement"); - } - this._placement = value; - - } - } - private string _anchor; - - partial void OnAnchorChanging(ref string newValue); - /// - /// An element instance or an IDREF to use as the anchor for the tooltip. - /// - [Parameter] - public string Anchor - { - get { return this._anchor; } - set { - if (this._anchor != value || !IsPropDirty("Anchor")) { - MarkPropDirty("Anchor"); - } - this._anchor = value; - - } - } - private string _showTriggers; - - partial void OnShowTriggersChanging(ref string newValue); - /// - /// Which event triggers will show the tooltip. - /// Expects a comma separate string of different event triggers. - /// - [Parameter] - public string ShowTriggers - { - get { return this._showTriggers; } - set { - if (this._showTriggers != value || !IsPropDirty("ShowTriggers")) { - MarkPropDirty("ShowTriggers"); - } - this._showTriggers = value; - - } - } - private string _hideTriggers; - - partial void OnHideTriggersChanging(ref string newValue); - /// - /// Which event triggers will hide the tooltip. - /// Expects a comma separate string of different event triggers. - /// - [Parameter] - public string HideTriggers - { - get { return this._hideTriggers; } - set { - if (this._hideTriggers != value || !IsPropDirty("HideTriggers")) { - MarkPropDirty("HideTriggers"); - } - this._hideTriggers = value; - - } - } - private double _showDelay = 0; - - partial void OnShowDelayChanging(ref double newValue); - /// - /// Specifies the number of milliseconds that should pass before showing the tooltip. - /// - [Parameter] - public double ShowDelay - { - get { return this._showDelay; } - set { - if (this._showDelay != value || !IsPropDirty("ShowDelay")) { - MarkPropDirty("ShowDelay"); - } - this._showDelay = value; - - } - } - private double _hideDelay = 0; - - partial void OnHideDelayChanging(ref double newValue); - /// - /// Specifies the number of milliseconds that should pass before hiding the tooltip. - /// - [Parameter] - public double HideDelay - { - get { return this._hideDelay; } - set { - if (this._hideDelay != value || !IsPropDirty("HideDelay")) { - MarkPropDirty("HideDelay"); - } - this._hideDelay = value; - - } - } - private string _message; - - partial void OnMessageChanging(ref string newValue); - /// - /// Specifies a plain text as tooltip content. - /// - [Parameter] - public string Message - { - get { return this._message; } - set { - if (this._message != value || !IsPropDirty("Message")) { - MarkPropDirty("Message"); - } - this._message = value; - - } - } - private bool _sticky = false; - - partial void OnStickyChanging(ref bool newValue); - /// - /// Specifies if the tooltip remains visible until the user closes it via the close button or Esc key. - /// - [Parameter] - public bool Sticky - { - get { return this._sticky; } - set { - if (this._sticky != value || !IsPropDirty("Sticky")) { - MarkPropDirty("Sticky"); - } - this._sticky = value; - - } - } - - partial void FindByNameTooltip(string name, ref object item); - public override object FindByName(string name) - { - - var baseResult = base.FindByName(name); - if (baseResult != null) - { - return baseResult; - } - - object item = null; - FindByNameTooltip(name, ref item); - if (item != null) - { - return item; - } - - return null; - } - public async Task SetNativeElementAsync(Object element) - { - await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); - } - public void SetNativeElement(Object element) - { - InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); - } - /// - /// Shows the tooltip if not already showing. - /// If a target is provided, sets it as a transient anchor. - /// - public async Task ShowAsync(String target = null) - { - var iv = await InvokeMethod("show", new object[] { StringToString(target) }, new string[] { "String" }); - return ReturnToBoolean(iv); - } - public bool Show(String target = null) - { - var iv = InvokeMethodSync("show", new object[] { StringToString(target) }, new string[] { "String" }); - return ReturnToBoolean(iv); - } - /// - /// Hides the tooltip if not already hidden. - /// - public async Task HideAsync() - { - var iv = await InvokeMethod("hide", new object[] { }, new string[] { }); - return ReturnToBoolean(iv); - } - public bool Hide() - { - var iv = InvokeMethodSync("hide", new object[] { }, new string[] { }); - return ReturnToBoolean(iv); - } - /// - /// Toggles the tooltip between shown/hidden state - /// - public async Task ToggleAsync() - { - var iv = await InvokeMethod("toggle", new object[] { }, new string[] { }); - return ReturnToBoolean(iv); - } - public bool Toggle() - { - var iv = InvokeMethodSync("toggle", new object[] { }, new string[] { }); - return ReturnToBoolean(iv); - } - - private string _openingRef = null; - private string _openingScript = null; - [Parameter] - public string OpeningScript { - - set - { - if (value != this._openingScript) - { - this._openingScript = value; - this.OnRefChanged("Opening", null, value, true, false, (string refName, object oldValue, object newValue) => { - this._openingRef = refName; - this.MarkPropDirty("OpeningRef"); - }); - } - } - get - { - return this._openingScript; - } - } - - partial void OnHandlingOpening(IgbVoidEventArgs args); - private EventCallback? _opening = null; - [Parameter] - public EventCallback Opening - { - get - { - return this._opening != null ? this._opening.Value : EventCallback.Empty; - } - set - { - if (!value.Equals(EventCallback.Empty)) - { - if (!CompareEventCallbacks(value, _opening, ref eventCallbacksCache)) - { - _opening = value; - this.SetHandler(this.Name, "Opening", value, (args) => { - OnHandlingOpening(args); - - }); - this.OnRefChanged("Opening", null, "event:::Opening", true, false, (refName, oldValue, newValue) => { - this._openingRef = refName; - this.MarkPropDirty("OpeningRef"); - }); - } - } - else - { - _opening = null; - this.SetHandler(this.Name, "Opening", null); - this.OnRefChanged("Opening", null, null, true, false, (refName, oldValue, newValue) => { - this._openingRef = null; - this.MarkPropDirty("OpeningRef"); - }); - } - } - } - - private string _openedRef = null; - private string _openedScript = null; - [Parameter] - public string OpenedScript { - - set - { - if (value != this._openedScript) - { - this._openedScript = value; - this.OnRefChanged("Opened", null, value, true, false, (string refName, object oldValue, object newValue) => { - this._openedRef = refName; - this.MarkPropDirty("OpenedRef"); - }); - } - } - get - { - return this._openedScript; - } - } - - partial void OnHandlingOpened(IgbVoidEventArgs args); - private EventCallback? _opened = null; - [Parameter] - public EventCallback Opened - { - get - { - return this._opened != null ? this._opened.Value : EventCallback.Empty; - } - set - { - if (!value.Equals(EventCallback.Empty)) - { - if (!CompareEventCallbacks(value, _opened, ref eventCallbacksCache)) - { - _opened = value; - this.SetHandler(this.Name, "Opened", value, (args) => { - OnHandlingOpened(args); - - }); - this.OnRefChanged("Opened", null, "event:::Opened", true, false, (refName, oldValue, newValue) => { - this._openedRef = refName; - this.MarkPropDirty("OpenedRef"); - }); - } - } - else - { - _opened = null; - this.SetHandler(this.Name, "Opened", null); - this.OnRefChanged("Opened", null, null, true, false, (refName, oldValue, newValue) => { - this._openedRef = null; - this.MarkPropDirty("OpenedRef"); - }); - } - } - } - - private string _closingRef = null; - private string _closingScript = null; - [Parameter] - public string ClosingScript { - - set - { - if (value != this._closingScript) - { - this._closingScript = value; - this.OnRefChanged("Closing", null, value, true, false, (string refName, object oldValue, object newValue) => { - this._closingRef = refName; - this.MarkPropDirty("ClosingRef"); - }); - } - } - get - { - return this._closingScript; - } - } - - partial void OnHandlingClosing(IgbVoidEventArgs args); - private EventCallback? _closing = null; - [Parameter] - public EventCallback Closing - { - get - { - return this._closing != null ? this._closing.Value : EventCallback.Empty; - } - set - { - if (!value.Equals(EventCallback.Empty)) - { - if (!CompareEventCallbacks(value, _closing, ref eventCallbacksCache)) - { - _closing = value; - this.SetHandler(this.Name, "Closing", value, (args) => { - OnHandlingClosing(args); - - }); - this.OnRefChanged("Closing", null, "event:::Closing", true, false, (refName, oldValue, newValue) => { - this._closingRef = refName; - this.MarkPropDirty("ClosingRef"); - }); - } - } - else - { - _closing = null; - this.SetHandler(this.Name, "Closing", null); - this.OnRefChanged("Closing", null, null, true, false, (refName, oldValue, newValue) => { - this._closingRef = null; - this.MarkPropDirty("ClosingRef"); - }); - } - } - } - - private string _closedRef = null; - private string _closedScript = null; - [Parameter] - public string ClosedScript { - - set - { - if (value != this._closedScript) - { - this._closedScript = value; - this.OnRefChanged("Closed", null, value, true, false, (string refName, object oldValue, object newValue) => { - this._closedRef = refName; - this.MarkPropDirty("ClosedRef"); - }); - } - } - get - { - return this._closedScript; - } - } - - partial void OnHandlingClosed(IgbVoidEventArgs args); - private EventCallback? _closed = null; - [Parameter] - public EventCallback Closed - { - get - { - return this._closed != null ? this._closed.Value : EventCallback.Empty; - } - set - { - if (!value.Equals(EventCallback.Empty)) - { - if (!CompareEventCallbacks(value, _closed, ref eventCallbacksCache)) - { - _closed = value; - this.SetHandler(this.Name, "Closed", value, (args) => { - OnHandlingClosed(args); - - }); - this.OnRefChanged("Closed", null, "event:::Closed", true, false, (refName, oldValue, newValue) => { - this._closedRef = refName; - this.MarkPropDirty("ClosedRef"); - }); - } - } - else - { - _closed = null; - this.SetHandler(this.Name, "Closed", null); - this.OnRefChanged("Closed", null, null, true, false, (refName, oldValue, newValue) => { - this._closedRef = null; - this.MarkPropDirty("ClosedRef"); - }); - } - } - } - - partial void SerializeCoreIgbTooltip(RendererSerializer ser); - - internal override void SerializeCore(RendererSerializer ser) - { - base.SerializeCore(ser); - - SerializeCoreIgbTooltip(ser); - - if (IsPropDirty("Open")) { ser.AddBooleanProp("open", this._open); } - if (IsPropDirty("WithArrow")) { ser.AddBooleanProp("withArrow", this._withArrow); } - if (IsPropDirty("Offset")) { ser.AddNumberProp("offset", this._offset); } - if (IsPropDirty("Placement")) { ser.AddEnumProp("placement", this._placement); } - if (IsPropDirty("Anchor")) { ser.AddStringProp("anchor", this._anchor); } - if (IsPropDirty("ShowTriggers")) { ser.AddStringProp("showTriggers", this._showTriggers); } - if (IsPropDirty("HideTriggers")) { ser.AddStringProp("hideTriggers", this._hideTriggers); } - if (IsPropDirty("ShowDelay")) { ser.AddNumberProp("showDelay", this._showDelay); } - if (IsPropDirty("HideDelay")) { ser.AddNumberProp("hideDelay", this._hideDelay); } - if (IsPropDirty("Message")) { ser.AddStringProp("message", this._message); } - if (IsPropDirty("Sticky")) { ser.AddBooleanProp("sticky", this._sticky); } - if (IsPropDirty("OpeningRef")) { ser.AddStringProp("openingRef", this._openingRef); } - if (IsPropDirty("OpenedRef")) { ser.AddStringProp("openedRef", this._openedRef); } - if (IsPropDirty("ClosingRef")) { ser.AddStringProp("closingRef", this._closingRef); } - if (IsPropDirty("ClosedRef")) { ser.AddStringProp("closedRef", this._closedRef); } - - } - -} + this._openedRef = refName; + this.MarkPropDirty("OpenedRef"); + }); + } + } + else + { + _opened = null; + this.SetHandler(this.Name, "Opened", null); + this.OnRefChanged("Opened", null, null, true, false, (refName, oldValue, newValue) => + { + this._openedRef = null; + this.MarkPropDirty("OpenedRef"); + }); + } + } + } + + private string _closingRef = null; + private string _closingScript = null; + [Parameter] + public string ClosingScript + { + + set + { + if (value != this._closingScript) + { + this._closingScript = value; + this.OnRefChanged("Closing", null, value, true, false, (string refName, object oldValue, object newValue) => + { + this._closingRef = refName; + this.MarkPropDirty("ClosingRef"); + }); + } + } + get + { + return this._closingScript; + } + } + + partial void OnHandlingClosing(IgbVoidEventArgs args); + private EventCallback? _closing = null; + [Parameter] + public EventCallback Closing + { + get + { + return this._closing != null ? this._closing.Value : EventCallback.Empty; + } + set + { + if (!value.Equals(EventCallback.Empty)) + { + if (!CompareEventCallbacks(value, _closing, ref eventCallbacksCache)) + { + _closing = value; + this.SetHandler(this.Name, "Closing", value, (args) => + { + OnHandlingClosing(args); + + }); + this.OnRefChanged("Closing", null, "event:::Closing", true, false, (refName, oldValue, newValue) => + { + this._closingRef = refName; + this.MarkPropDirty("ClosingRef"); + }); + } + } + else + { + _closing = null; + this.SetHandler(this.Name, "Closing", null); + this.OnRefChanged("Closing", null, null, true, false, (refName, oldValue, newValue) => + { + this._closingRef = null; + this.MarkPropDirty("ClosingRef"); + }); + } + } + } + + private string _closedRef = null; + private string _closedScript = null; + [Parameter] + public string ClosedScript + { + + set + { + if (value != this._closedScript) + { + this._closedScript = value; + this.OnRefChanged("Closed", null, value, true, false, (string refName, object oldValue, object newValue) => + { + this._closedRef = refName; + this.MarkPropDirty("ClosedRef"); + }); + } + } + get + { + return this._closedScript; + } + } + + partial void OnHandlingClosed(IgbVoidEventArgs args); + private EventCallback? _closed = null; + [Parameter] + public EventCallback Closed + { + get + { + return this._closed != null ? this._closed.Value : EventCallback.Empty; + } + set + { + if (!value.Equals(EventCallback.Empty)) + { + if (!CompareEventCallbacks(value, _closed, ref eventCallbacksCache)) + { + _closed = value; + this.SetHandler(this.Name, "Closed", value, (args) => + { + OnHandlingClosed(args); + + }); + this.OnRefChanged("Closed", null, "event:::Closed", true, false, (refName, oldValue, newValue) => + { + this._closedRef = refName; + this.MarkPropDirty("ClosedRef"); + }); + } + } + else + { + _closed = null; + this.SetHandler(this.Name, "Closed", null); + this.OnRefChanged("Closed", null, null, true, false, (refName, oldValue, newValue) => + { + this._closedRef = null; + this.MarkPropDirty("ClosedRef"); + }); + } + } + } + + partial void SerializeCoreIgbTooltip(RendererSerializer ser); + + internal override void SerializeCore(RendererSerializer ser) + { + base.SerializeCore(ser); + + SerializeCoreIgbTooltip(ser); + + if (IsPropDirty("Open")) + { ser.AddBooleanProp("open", this._open); } + if (IsPropDirty("WithArrow")) + { ser.AddBooleanProp("withArrow", this._withArrow); } + if (IsPropDirty("Offset")) + { ser.AddNumberProp("offset", this._offset); } + if (IsPropDirty("Placement")) + { ser.AddEnumProp("placement", this._placement); } + if (IsPropDirty("Anchor")) + { ser.AddStringProp("anchor", this._anchor); } + if (IsPropDirty("ShowTriggers")) + { ser.AddStringProp("showTriggers", this._showTriggers); } + if (IsPropDirty("HideTriggers")) + { ser.AddStringProp("hideTriggers", this._hideTriggers); } + if (IsPropDirty("ShowDelay")) + { ser.AddNumberProp("showDelay", this._showDelay); } + if (IsPropDirty("HideDelay")) + { ser.AddNumberProp("hideDelay", this._hideDelay); } + if (IsPropDirty("Message")) + { ser.AddStringProp("message", this._message); } + if (IsPropDirty("Sticky")) + { ser.AddBooleanProp("sticky", this._sticky); } + if (IsPropDirty("OpeningRef")) + { ser.AddStringProp("openingRef", this._openingRef); } + if (IsPropDirty("OpenedRef")) + { ser.AddStringProp("openedRef", this._openedRef); } + if (IsPropDirty("ClosingRef")) + { ser.AddStringProp("closingRef", this._closingRef); } + if (IsPropDirty("ClosedRef")) + { ser.AddStringProp("closedRef", this._closedRef); } + + } + + } } diff --git a/src/components/Blazor/TooltipModule.cs b/src/components/Blazor/TooltipModule.cs index 0d675267..76b64d3d 100644 --- a/src/components/Blazor/TooltipModule.cs +++ b/src/components/Blazor/TooltipModule.cs @@ -1,23 +1,20 @@ -using System; -using System.Collections.Generic; -using System.Runtime.CompilerServices; -using System.Text; -using System.Collections.Generic; - namespace IgniteUI.Blazor.Controls { - public partial class IgbTooltipModule { - public static void Register(IIgniteUIBlazor runtime) { + public partial class IgbTooltipModule + { + public static void Register(IIgniteUIBlazor runtime) + { ModuleLoader.Load(runtime, "WebTooltipModule"); - } - public static void MarkIsLoadRequested(IIgniteUIBlazor runtime) { + public static void MarkIsLoadRequested(IIgniteUIBlazor runtime) + { ModuleLoader.MarkIsLoadRequested(runtime, "WebTooltipModule"); } - public static bool IsLoadRequested(IIgniteUIBlazor runtime) { + public static bool IsLoadRequested(IIgniteUIBlazor runtime) + { return ModuleLoader.IsLoadRequested(runtime, "WebTooltipModule"); } } diff --git a/src/components/Blazor/Tree.cs b/src/components/Blazor/Tree.cs index 498b28c2..fdd82e3a 100644 --- a/src/components/Blazor/Tree.cs +++ b/src/components/Blazor/Tree.cs @@ -1,540 +1,580 @@ - -using System; using Microsoft.AspNetCore.Components; -using Microsoft.AspNetCore.Components.Rendering; -using System.Threading.Tasks; -using System.Collections.Generic; -using System.Linq; namespace IgniteUI.Blazor.Controls { - /// -/// The tree allows users to represent hierarchical data in a tree-view structure, -/// maintaining parent-child relationships, as well as to define static tree-view structure without a corresponding data model. -/// -public partial class IgbTree: BaseRendererControl { - public override string Type { get { return "WebTree"; } } - - protected override void EnsureModulesLoaded() - { - if (!IgbTreeModule.IsLoadRequested(IgBlazor)) - { - IgbTreeModule.Register(IgBlazor); - } - } - - protected override string ResolveDisplay() + /// + /// The tree allows users to represent hierarchical data in a tree-view structure, + /// maintaining parent-child relationships, as well as to define static tree-view structure without a corresponding data model. + /// + public partial class IgbTree : BaseRendererControl + { + public override string Type { get { return "WebTree"; } } + + protected override void EnsureModulesLoaded() + { + if (!IgbTreeModule.IsLoadRequested(IgBlazor)) + { + IgbTreeModule.Register(IgBlazor); + } + } + + protected override string ResolveDisplay() + { + return "inline-block"; + } + + protected override bool SupportsVisualChildren + { + get + { + return true; + } + } + + protected override bool UseDirectRender + { + get + { + return true; + } + } + + protected override string DirectRenderElementName + { + get + { + return "igc-tree"; + } + } + + protected override ControlEventBehavior DefaultEventBehavior + { + get { return ControlEventBehavior.Immediate; } + } + + public IgbTree() : base() + { + OnCreatedIgbTree(); + + } + + partial void OnCreatedIgbTree(); + + private bool _singleBranchExpand = false; + + partial void OnSingleBranchExpandChanging(ref bool newValue); + /// + /// Whether a single or multiple of a parent's child items can be expanded. + /// + [Parameter] + public bool SingleBranchExpand + { + get { return this._singleBranchExpand; } + set + { + if (this._singleBranchExpand != value || !IsPropDirty("SingleBranchExpand")) + { + MarkPropDirty("SingleBranchExpand"); + } + this._singleBranchExpand = value; + + } + } + private bool _toggleNodeOnClick = false; + + partial void OnToggleNodeOnClickChanging(ref bool newValue); + /// + /// Whether clicking over nodes will change their expanded state or not. + /// + [Parameter] + public bool ToggleNodeOnClick + { + get { return this._toggleNodeOnClick; } + set + { + if (this._toggleNodeOnClick != value || !IsPropDirty("ToggleNodeOnClick")) + { + MarkPropDirty("ToggleNodeOnClick"); + } + this._toggleNodeOnClick = value; + + } + } + private TreeSelection _selection = TreeSelection.None; + + partial void OnSelectionChanging(ref TreeSelection newValue); + /// + /// The selection state of the tree. + /// + [Parameter] + public TreeSelection Selection + { + get { return this._selection; } + set + { + if (this._selection != value || !IsPropDirty("Selection")) + { + MarkPropDirty("Selection"); + } + this._selection = value; + + } + } + + partial void FindByNameTree(string name, ref object item); + public override object FindByName(string name) + { + + var baseResult = base.FindByName(name); + if (baseResult != null) + { + return baseResult; + } + + object item = null; + FindByNameTree(name, ref item); + if (item != null) + { + return item; + } + + return null; + } + public async Task SetNativeElementAsync(Object element) + { + await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + } + public void SetNativeElement(Object element) + { + InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + } + public async Task ConnectedCallbackAsync() + { + await InvokeMethod("connectedCallback", new object[] { }, new string[] { }); + } + public void ConnectedCallback() + { + InvokeMethodSync("connectedCallback", new object[] { }, new string[] { }); + } + + private string _selectionChangedRef = null; + private string _selectionChangedScript = null; + [Parameter] + public string SelectionChangedScript + { + + set + { + if (value != this._selectionChangedScript) + { + this._selectionChangedScript = value; + this.OnRefChanged("SelectionChanged", null, value, true, false, (string refName, object oldValue, object newValue) => + { + this._selectionChangedRef = refName; + this.MarkPropDirty("SelectionChangedRef"); + }); + } + } + get + { + return this._selectionChangedScript; + } + } + + partial void OnHandlingSelectionChanged(IgbTreeSelectionEventArgs args); + private EventCallback? _selectionChanged = null; + [Parameter] + public EventCallback SelectionChanged + { + get + { + return this._selectionChanged != null ? this._selectionChanged.Value : EventCallback.Empty; + } + set + { + if (!value.Equals(EventCallback.Empty)) + { + if (!CompareEventCallbacks(value, _selectionChanged, ref eventCallbacksCache)) + { + _selectionChanged = value; + this.SetHandler(this.Name, "SelectionChanged", value, (args) => { - return "inline-block"; - } + OnHandlingSelectionChanged(args); - protected override bool SupportsVisualChildren + }); + this.OnRefChanged("SelectionChanged", null, "event:::SelectionChanged", true, false, (refName, oldValue, newValue) => { - get - { - return true; - } - } + this._selectionChangedRef = refName; + this.MarkPropDirty("SelectionChangedRef"); + }); + } + } + else + { + _selectionChanged = null; + this.SetHandler(this.Name, "SelectionChanged", null); + this.OnRefChanged("SelectionChanged", null, null, true, false, (refName, oldValue, newValue) => + { + this._selectionChangedRef = null; + this.MarkPropDirty("SelectionChangedRef"); + }); + } + } + } + + private string _itemExpandingRef = null; + private string _itemExpandingScript = null; + [Parameter] + public string ItemExpandingScript + { + + set + { + if (value != this._itemExpandingScript) + { + this._itemExpandingScript = value; + this.OnRefChanged("ItemExpanding", null, value, true, false, (string refName, object oldValue, object newValue) => + { + this._itemExpandingRef = refName; + this.MarkPropDirty("ItemExpandingRef"); + }); + } + } + get + { + return this._itemExpandingScript; + } + } - protected override bool UseDirectRender + partial void OnHandlingItemExpanding(IgbTreeItemComponentEventArgs args); + private EventCallback? _itemExpanding = null; + [Parameter] + public EventCallback ItemExpanding + { + get + { + return this._itemExpanding != null ? this._itemExpanding.Value : EventCallback.Empty; + } + set + { + if (!value.Equals(EventCallback.Empty)) + { + if (!CompareEventCallbacks(value, _itemExpanding, ref eventCallbacksCache)) + { + _itemExpanding = value; + this.SetHandler(this.Name, "ItemExpanding", value, (args) => { - get - { - return true; - } - } + OnHandlingItemExpanding(args); - protected override string DirectRenderElementName + }); + this.OnRefChanged("ItemExpanding", null, "event:::ItemExpanding", true, false, (refName, oldValue, newValue) => { - get - { - return "igc-tree"; - } - } - - protected override ControlEventBehavior DefaultEventBehavior - { - get { return ControlEventBehavior.Immediate; } - } - - public IgbTree(): base() { - OnCreatedIgbTree(); - - - } - - partial void OnCreatedIgbTree(); - - private bool _singleBranchExpand = false; - - partial void OnSingleBranchExpandChanging(ref bool newValue); - /// - /// Whether a single or multiple of a parent's child items can be expanded. - /// - [Parameter] - public bool SingleBranchExpand - { - get { return this._singleBranchExpand; } - set { - if (this._singleBranchExpand != value || !IsPropDirty("SingleBranchExpand")) { - MarkPropDirty("SingleBranchExpand"); - } - this._singleBranchExpand = value; - - } - } - private bool _toggleNodeOnClick = false; - - partial void OnToggleNodeOnClickChanging(ref bool newValue); - /// - /// Whether clicking over nodes will change their expanded state or not. - /// - [Parameter] - public bool ToggleNodeOnClick - { - get { return this._toggleNodeOnClick; } - set { - if (this._toggleNodeOnClick != value || !IsPropDirty("ToggleNodeOnClick")) { - MarkPropDirty("ToggleNodeOnClick"); - } - this._toggleNodeOnClick = value; - - } - } - private TreeSelection _selection = TreeSelection.None; - - partial void OnSelectionChanging(ref TreeSelection newValue); - /// - /// The selection state of the tree. - /// - [Parameter] - public TreeSelection Selection - { - get { return this._selection; } - set { - if (this._selection != value || !IsPropDirty("Selection")) { - MarkPropDirty("Selection"); - } - this._selection = value; - - } - } - - partial void FindByNameTree(string name, ref object item); - public override object FindByName(string name) - { - - var baseResult = base.FindByName(name); - if (baseResult != null) - { - return baseResult; - } - - object item = null; - FindByNameTree(name, ref item); - if (item != null) - { - return item; - } - - return null; - } - public async Task SetNativeElementAsync(Object element) - { - await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); - } - public void SetNativeElement(Object element) - { - InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); - } - public async Task ConnectedCallbackAsync() - { - await InvokeMethod("connectedCallback", new object[] { }, new string[] { }); - } - public void ConnectedCallback() - { - InvokeMethodSync("connectedCallback", new object[] { }, new string[] { }); - } - - private string _selectionChangedRef = null; - private string _selectionChangedScript = null; - [Parameter] - public string SelectionChangedScript { - - set - { - if (value != this._selectionChangedScript) - { - this._selectionChangedScript = value; - this.OnRefChanged("SelectionChanged", null, value, true, false, (string refName, object oldValue, object newValue) => { - this._selectionChangedRef = refName; - this.MarkPropDirty("SelectionChangedRef"); - }); - } - } - get - { - return this._selectionChangedScript; - } - } - - partial void OnHandlingSelectionChanged(IgbTreeSelectionEventArgs args); - private EventCallback? _selectionChanged = null; - [Parameter] - public EventCallback SelectionChanged - { - get - { - return this._selectionChanged != null ? this._selectionChanged.Value : EventCallback.Empty; - } - set - { - if (!value.Equals(EventCallback.Empty)) - { - if (!CompareEventCallbacks(value, _selectionChanged, ref eventCallbacksCache)) - { - _selectionChanged = value; - this.SetHandler(this.Name, "SelectionChanged", value, (args) => { - OnHandlingSelectionChanged(args); - - }); - this.OnRefChanged("SelectionChanged", null, "event:::SelectionChanged", true, false, (refName, oldValue, newValue) => { - this._selectionChangedRef = refName; - this.MarkPropDirty("SelectionChangedRef"); - }); - } - } - else - { - _selectionChanged = null; - this.SetHandler(this.Name, "SelectionChanged", null); - this.OnRefChanged("SelectionChanged", null, null, true, false, (refName, oldValue, newValue) => { - this._selectionChangedRef = null; - this.MarkPropDirty("SelectionChangedRef"); - }); - } - } - } - - private string _itemExpandingRef = null; - private string _itemExpandingScript = null; - [Parameter] - public string ItemExpandingScript { - - set - { - if (value != this._itemExpandingScript) - { - this._itemExpandingScript = value; - this.OnRefChanged("ItemExpanding", null, value, true, false, (string refName, object oldValue, object newValue) => { - this._itemExpandingRef = refName; - this.MarkPropDirty("ItemExpandingRef"); - }); - } - } - get - { - return this._itemExpandingScript; - } - } - - partial void OnHandlingItemExpanding(IgbTreeItemComponentEventArgs args); - private EventCallback? _itemExpanding = null; - [Parameter] - public EventCallback ItemExpanding - { - get - { - return this._itemExpanding != null ? this._itemExpanding.Value : EventCallback.Empty; - } - set - { - if (!value.Equals(EventCallback.Empty)) - { - if (!CompareEventCallbacks(value, _itemExpanding, ref eventCallbacksCache)) - { - _itemExpanding = value; - this.SetHandler(this.Name, "ItemExpanding", value, (args) => { - OnHandlingItemExpanding(args); - - }); - this.OnRefChanged("ItemExpanding", null, "event:::ItemExpanding", true, false, (refName, oldValue, newValue) => { - this._itemExpandingRef = refName; - this.MarkPropDirty("ItemExpandingRef"); - }); - } - } - else - { - _itemExpanding = null; - this.SetHandler(this.Name, "ItemExpanding", null); - this.OnRefChanged("ItemExpanding", null, null, true, false, (refName, oldValue, newValue) => { - this._itemExpandingRef = null; - this.MarkPropDirty("ItemExpandingRef"); - }); - } - } - } - - private string _itemExpandedRef = null; - private string _itemExpandedScript = null; - [Parameter] - public string ItemExpandedScript { - - set - { - if (value != this._itemExpandedScript) - { - this._itemExpandedScript = value; - this.OnRefChanged("ItemExpanded", null, value, true, false, (string refName, object oldValue, object newValue) => { - this._itemExpandedRef = refName; - this.MarkPropDirty("ItemExpandedRef"); - }); - } - } - get - { - return this._itemExpandedScript; - } - } - - partial void OnHandlingItemExpanded(IgbTreeItemComponentEventArgs args); - private EventCallback? _itemExpanded = null; - [Parameter] - public EventCallback ItemExpanded - { - get - { - return this._itemExpanded != null ? this._itemExpanded.Value : EventCallback.Empty; - } - set - { - if (!value.Equals(EventCallback.Empty)) - { - if (!CompareEventCallbacks(value, _itemExpanded, ref eventCallbacksCache)) - { - _itemExpanded = value; - this.SetHandler(this.Name, "ItemExpanded", value, (args) => { - OnHandlingItemExpanded(args); - - }); - this.OnRefChanged("ItemExpanded", null, "event:::ItemExpanded", true, false, (refName, oldValue, newValue) => { - this._itemExpandedRef = refName; - this.MarkPropDirty("ItemExpandedRef"); - }); - } - } - else - { - _itemExpanded = null; - this.SetHandler(this.Name, "ItemExpanded", null); - this.OnRefChanged("ItemExpanded", null, null, true, false, (refName, oldValue, newValue) => { - this._itemExpandedRef = null; - this.MarkPropDirty("ItemExpandedRef"); - }); - } - } - } - - private string _itemCollapsingRef = null; - private string _itemCollapsingScript = null; - [Parameter] - public string ItemCollapsingScript { - - set - { - if (value != this._itemCollapsingScript) - { - this._itemCollapsingScript = value; - this.OnRefChanged("ItemCollapsing", null, value, true, false, (string refName, object oldValue, object newValue) => { - this._itemCollapsingRef = refName; - this.MarkPropDirty("ItemCollapsingRef"); - }); - } - } - get - { - return this._itemCollapsingScript; - } - } - - partial void OnHandlingItemCollapsing(IgbTreeItemComponentEventArgs args); - private EventCallback? _itemCollapsing = null; - [Parameter] - public EventCallback ItemCollapsing - { - get - { - return this._itemCollapsing != null ? this._itemCollapsing.Value : EventCallback.Empty; - } - set - { - if (!value.Equals(EventCallback.Empty)) - { - if (!CompareEventCallbacks(value, _itemCollapsing, ref eventCallbacksCache)) - { - _itemCollapsing = value; - this.SetHandler(this.Name, "ItemCollapsing", value, (args) => { - OnHandlingItemCollapsing(args); - - }); - this.OnRefChanged("ItemCollapsing", null, "event:::ItemCollapsing", true, false, (refName, oldValue, newValue) => { - this._itemCollapsingRef = refName; - this.MarkPropDirty("ItemCollapsingRef"); - }); - } - } - else - { - _itemCollapsing = null; - this.SetHandler(this.Name, "ItemCollapsing", null); - this.OnRefChanged("ItemCollapsing", null, null, true, false, (refName, oldValue, newValue) => { - this._itemCollapsingRef = null; - this.MarkPropDirty("ItemCollapsingRef"); - }); - } - } - } - - private string _itemCollapsedRef = null; - private string _itemCollapsedScript = null; - [Parameter] - public string ItemCollapsedScript { - - set - { - if (value != this._itemCollapsedScript) - { - this._itemCollapsedScript = value; - this.OnRefChanged("ItemCollapsed", null, value, true, false, (string refName, object oldValue, object newValue) => { - this._itemCollapsedRef = refName; - this.MarkPropDirty("ItemCollapsedRef"); - }); - } - } - get - { - return this._itemCollapsedScript; - } - } - - partial void OnHandlingItemCollapsed(IgbTreeItemComponentEventArgs args); - private EventCallback? _itemCollapsed = null; - [Parameter] - public EventCallback ItemCollapsed - { - get - { - return this._itemCollapsed != null ? this._itemCollapsed.Value : EventCallback.Empty; - } - set - { - if (!value.Equals(EventCallback.Empty)) - { - if (!CompareEventCallbacks(value, _itemCollapsed, ref eventCallbacksCache)) - { - _itemCollapsed = value; - this.SetHandler(this.Name, "ItemCollapsed", value, (args) => { - OnHandlingItemCollapsed(args); - - }); - this.OnRefChanged("ItemCollapsed", null, "event:::ItemCollapsed", true, false, (refName, oldValue, newValue) => { - this._itemCollapsedRef = refName; - this.MarkPropDirty("ItemCollapsedRef"); - }); - } - } - else - { - _itemCollapsed = null; - this.SetHandler(this.Name, "ItemCollapsed", null); - this.OnRefChanged("ItemCollapsed", null, null, true, false, (refName, oldValue, newValue) => { - this._itemCollapsedRef = null; - this.MarkPropDirty("ItemCollapsedRef"); - }); - } - } - } - - private string _activeItemRef = null; - private string _activeItemScript = null; - [Parameter] - public string ActiveItemScript { - - set - { - if (value != this._activeItemScript) - { - this._activeItemScript = value; - this.OnRefChanged("ActiveItem", null, value, true, false, (string refName, object oldValue, object newValue) => { - this._activeItemRef = refName; - this.MarkPropDirty("ActiveItemRef"); - }); - } - } - get - { - return this._activeItemScript; - } - } - - partial void OnHandlingActiveItem(IgbTreeItemComponentEventArgs args); - private EventCallback? _activeItem = null; - [Parameter] - public EventCallback ActiveItem - { - get - { - return this._activeItem != null ? this._activeItem.Value : EventCallback.Empty; - } - set - { - if (!value.Equals(EventCallback.Empty)) - { - if (!CompareEventCallbacks(value, _activeItem, ref eventCallbacksCache)) - { - _activeItem = value; - this.SetHandler(this.Name, "ActiveItem", value, (args) => { - OnHandlingActiveItem(args); - - }); - this.OnRefChanged("ActiveItem", null, "event:::ActiveItem", true, false, (refName, oldValue, newValue) => { - this._activeItemRef = refName; - this.MarkPropDirty("ActiveItemRef"); - }); - } - } - else - { - _activeItem = null; - this.SetHandler(this.Name, "ActiveItem", null); - this.OnRefChanged("ActiveItem", null, null, true, false, (refName, oldValue, newValue) => { - this._activeItemRef = null; - this.MarkPropDirty("ActiveItemRef"); - }); - } - } - } - - partial void SerializeCoreIgbTree(RendererSerializer ser); - - internal override void SerializeCore(RendererSerializer ser) - { - base.SerializeCore(ser); - - SerializeCoreIgbTree(ser); - - if (IsPropDirty("SingleBranchExpand")) { ser.AddBooleanProp("singleBranchExpand", this._singleBranchExpand); } - if (IsPropDirty("ToggleNodeOnClick")) { ser.AddBooleanProp("toggleNodeOnClick", this._toggleNodeOnClick); } - if (IsPropDirty("Selection")) { ser.AddEnumProp("selection", this._selection); } - if (IsPropDirty("SelectionChangedRef")) { ser.AddStringProp("selectionChangedRef", this._selectionChangedRef); } - if (IsPropDirty("ItemExpandingRef")) { ser.AddStringProp("itemExpandingRef", this._itemExpandingRef); } - if (IsPropDirty("ItemExpandedRef")) { ser.AddStringProp("itemExpandedRef", this._itemExpandedRef); } - if (IsPropDirty("ItemCollapsingRef")) { ser.AddStringProp("itemCollapsingRef", this._itemCollapsingRef); } - if (IsPropDirty("ItemCollapsedRef")) { ser.AddStringProp("itemCollapsedRef", this._itemCollapsedRef); } - if (IsPropDirty("ActiveItemRef")) { ser.AddStringProp("activeItemRef", this._activeItemRef); } - - } - -} + this._itemExpandingRef = refName; + this.MarkPropDirty("ItemExpandingRef"); + }); + } + } + else + { + _itemExpanding = null; + this.SetHandler(this.Name, "ItemExpanding", null); + this.OnRefChanged("ItemExpanding", null, null, true, false, (refName, oldValue, newValue) => + { + this._itemExpandingRef = null; + this.MarkPropDirty("ItemExpandingRef"); + }); + } + } + } + + private string _itemExpandedRef = null; + private string _itemExpandedScript = null; + [Parameter] + public string ItemExpandedScript + { + + set + { + if (value != this._itemExpandedScript) + { + this._itemExpandedScript = value; + this.OnRefChanged("ItemExpanded", null, value, true, false, (string refName, object oldValue, object newValue) => + { + this._itemExpandedRef = refName; + this.MarkPropDirty("ItemExpandedRef"); + }); + } + } + get + { + return this._itemExpandedScript; + } + } + + partial void OnHandlingItemExpanded(IgbTreeItemComponentEventArgs args); + private EventCallback? _itemExpanded = null; + [Parameter] + public EventCallback ItemExpanded + { + get + { + return this._itemExpanded != null ? this._itemExpanded.Value : EventCallback.Empty; + } + set + { + if (!value.Equals(EventCallback.Empty)) + { + if (!CompareEventCallbacks(value, _itemExpanded, ref eventCallbacksCache)) + { + _itemExpanded = value; + this.SetHandler(this.Name, "ItemExpanded", value, (args) => + { + OnHandlingItemExpanded(args); + + }); + this.OnRefChanged("ItemExpanded", null, "event:::ItemExpanded", true, false, (refName, oldValue, newValue) => + { + this._itemExpandedRef = refName; + this.MarkPropDirty("ItemExpandedRef"); + }); + } + } + else + { + _itemExpanded = null; + this.SetHandler(this.Name, "ItemExpanded", null); + this.OnRefChanged("ItemExpanded", null, null, true, false, (refName, oldValue, newValue) => + { + this._itemExpandedRef = null; + this.MarkPropDirty("ItemExpandedRef"); + }); + } + } + } + + private string _itemCollapsingRef = null; + private string _itemCollapsingScript = null; + [Parameter] + public string ItemCollapsingScript + { + + set + { + if (value != this._itemCollapsingScript) + { + this._itemCollapsingScript = value; + this.OnRefChanged("ItemCollapsing", null, value, true, false, (string refName, object oldValue, object newValue) => + { + this._itemCollapsingRef = refName; + this.MarkPropDirty("ItemCollapsingRef"); + }); + } + } + get + { + return this._itemCollapsingScript; + } + } + + partial void OnHandlingItemCollapsing(IgbTreeItemComponentEventArgs args); + private EventCallback? _itemCollapsing = null; + [Parameter] + public EventCallback ItemCollapsing + { + get + { + return this._itemCollapsing != null ? this._itemCollapsing.Value : EventCallback.Empty; + } + set + { + if (!value.Equals(EventCallback.Empty)) + { + if (!CompareEventCallbacks(value, _itemCollapsing, ref eventCallbacksCache)) + { + _itemCollapsing = value; + this.SetHandler(this.Name, "ItemCollapsing", value, (args) => + { + OnHandlingItemCollapsing(args); + + }); + this.OnRefChanged("ItemCollapsing", null, "event:::ItemCollapsing", true, false, (refName, oldValue, newValue) => + { + this._itemCollapsingRef = refName; + this.MarkPropDirty("ItemCollapsingRef"); + }); + } + } + else + { + _itemCollapsing = null; + this.SetHandler(this.Name, "ItemCollapsing", null); + this.OnRefChanged("ItemCollapsing", null, null, true, false, (refName, oldValue, newValue) => + { + this._itemCollapsingRef = null; + this.MarkPropDirty("ItemCollapsingRef"); + }); + } + } + } + + private string _itemCollapsedRef = null; + private string _itemCollapsedScript = null; + [Parameter] + public string ItemCollapsedScript + { + + set + { + if (value != this._itemCollapsedScript) + { + this._itemCollapsedScript = value; + this.OnRefChanged("ItemCollapsed", null, value, true, false, (string refName, object oldValue, object newValue) => + { + this._itemCollapsedRef = refName; + this.MarkPropDirty("ItemCollapsedRef"); + }); + } + } + get + { + return this._itemCollapsedScript; + } + } + + partial void OnHandlingItemCollapsed(IgbTreeItemComponentEventArgs args); + private EventCallback? _itemCollapsed = null; + [Parameter] + public EventCallback ItemCollapsed + { + get + { + return this._itemCollapsed != null ? this._itemCollapsed.Value : EventCallback.Empty; + } + set + { + if (!value.Equals(EventCallback.Empty)) + { + if (!CompareEventCallbacks(value, _itemCollapsed, ref eventCallbacksCache)) + { + _itemCollapsed = value; + this.SetHandler(this.Name, "ItemCollapsed", value, (args) => + { + OnHandlingItemCollapsed(args); + + }); + this.OnRefChanged("ItemCollapsed", null, "event:::ItemCollapsed", true, false, (refName, oldValue, newValue) => + { + this._itemCollapsedRef = refName; + this.MarkPropDirty("ItemCollapsedRef"); + }); + } + } + else + { + _itemCollapsed = null; + this.SetHandler(this.Name, "ItemCollapsed", null); + this.OnRefChanged("ItemCollapsed", null, null, true, false, (refName, oldValue, newValue) => + { + this._itemCollapsedRef = null; + this.MarkPropDirty("ItemCollapsedRef"); + }); + } + } + } + + private string _activeItemRef = null; + private string _activeItemScript = null; + [Parameter] + public string ActiveItemScript + { + + set + { + if (value != this._activeItemScript) + { + this._activeItemScript = value; + this.OnRefChanged("ActiveItem", null, value, true, false, (string refName, object oldValue, object newValue) => + { + this._activeItemRef = refName; + this.MarkPropDirty("ActiveItemRef"); + }); + } + } + get + { + return this._activeItemScript; + } + } + + partial void OnHandlingActiveItem(IgbTreeItemComponentEventArgs args); + private EventCallback? _activeItem = null; + [Parameter] + public EventCallback ActiveItem + { + get + { + return this._activeItem != null ? this._activeItem.Value : EventCallback.Empty; + } + set + { + if (!value.Equals(EventCallback.Empty)) + { + if (!CompareEventCallbacks(value, _activeItem, ref eventCallbacksCache)) + { + _activeItem = value; + this.SetHandler(this.Name, "ActiveItem", value, (args) => + { + OnHandlingActiveItem(args); + + }); + this.OnRefChanged("ActiveItem", null, "event:::ActiveItem", true, false, (refName, oldValue, newValue) => + { + this._activeItemRef = refName; + this.MarkPropDirty("ActiveItemRef"); + }); + } + } + else + { + _activeItem = null; + this.SetHandler(this.Name, "ActiveItem", null); + this.OnRefChanged("ActiveItem", null, null, true, false, (refName, oldValue, newValue) => + { + this._activeItemRef = null; + this.MarkPropDirty("ActiveItemRef"); + }); + } + } + } + + partial void SerializeCoreIgbTree(RendererSerializer ser); + + internal override void SerializeCore(RendererSerializer ser) + { + base.SerializeCore(ser); + + SerializeCoreIgbTree(ser); + + if (IsPropDirty("SingleBranchExpand")) + { ser.AddBooleanProp("singleBranchExpand", this._singleBranchExpand); } + if (IsPropDirty("ToggleNodeOnClick")) + { ser.AddBooleanProp("toggleNodeOnClick", this._toggleNodeOnClick); } + if (IsPropDirty("Selection")) + { ser.AddEnumProp("selection", this._selection); } + if (IsPropDirty("SelectionChangedRef")) + { ser.AddStringProp("selectionChangedRef", this._selectionChangedRef); } + if (IsPropDirty("ItemExpandingRef")) + { ser.AddStringProp("itemExpandingRef", this._itemExpandingRef); } + if (IsPropDirty("ItemExpandedRef")) + { ser.AddStringProp("itemExpandedRef", this._itemExpandedRef); } + if (IsPropDirty("ItemCollapsingRef")) + { ser.AddStringProp("itemCollapsingRef", this._itemCollapsingRef); } + if (IsPropDirty("ItemCollapsedRef")) + { ser.AddStringProp("itemCollapsedRef", this._itemCollapsedRef); } + if (IsPropDirty("ActiveItemRef")) + { ser.AddStringProp("activeItemRef", this._activeItemRef); } + + } + + } } diff --git a/src/components/Blazor/TreeItem.cs b/src/components/Blazor/TreeItem.cs index 3beada6b..d679c00c 100644 --- a/src/components/Blazor/TreeItem.cs +++ b/src/components/Blazor/TreeItem.cs @@ -1,360 +1,382 @@ - -using System; using Microsoft.AspNetCore.Components; -using Microsoft.AspNetCore.Components.Rendering; -using System.Threading.Tasks; -using System.Collections.Generic; -using System.Linq; namespace IgniteUI.Blazor.Controls { - /// -/// The tree-item component represents a child item of the tree component or another tree item. -/// -public partial class IgbTreeItem: BaseRendererControl { - public override string Type { get { return "WebTreeItem"; } } - - protected override void EnsureModulesLoaded() - { - if (!IgbTreeItemModule.IsLoadRequested(IgBlazor)) - { - IgbTreeItemModule.Register(IgBlazor); - } - } - - protected override string ResolveDisplay() - { - return "inline-block"; - } - - protected override bool SupportsVisualChildren - { - get - { - return true; - } - } - - protected override bool UseDirectRender - { - get - { - return true; - } - } - - protected override string DirectRenderElementName - { - get - { - return "igc-tree-item"; - } - } - - protected override ControlEventBehavior DefaultEventBehavior - { - get { return ControlEventBehavior.Immediate; } - } - - public IgbTreeItem(): base() { - OnCreatedIgbTreeItem(); - - - } - - partial void OnCreatedIgbTreeItem(); - - private IgbTreeItem _parent; - - partial void OnParentChanging(ref IgbTreeItem newValue); - /// - /// The parent item of the current tree item (if any) - /// - [Parameter] - public IgbTreeItem Parent - { - get { return this._parent; } - set { - if (this._parent != value || !IsPropDirty("Parent")) { - MarkPropDirty("Parent"); - } - this._parent = value; - - } - } - private double _level = 0; - - partial void OnLevelChanging(ref double newValue); - /// - /// The depth of the item, relative to the root. - /// - [Parameter] - public double Level - { - get { return this._level; } - set { - if (this._level != value || !IsPropDirty("Level")) { - MarkPropDirty("Level"); - } - this._level = value; - - } - } - private string _label; - - partial void OnLabelChanging(ref string newValue); - /// - /// The tree item label. - /// - [Parameter] - public string Label - { - get { return this._label; } - set { - if (this._label != value || !IsPropDirty("Label")) { - MarkPropDirty("Label"); - } - this._label = value; - - } - } - private bool _expanded = false; - - partial void OnExpandedChanging(ref bool newValue); - /// - /// The tree item expansion state. - /// - [Parameter] - public bool Expanded - { - get { return this._expanded; } - set { - if (this._expanded != value || !IsPropDirty("Expanded")) { - MarkPropDirty("Expanded"); - } - this._expanded = value; - - } - } - private bool _active = false; - - partial void OnActiveChanging(ref bool newValue); - /// - /// Marks the item as the tree's active item. - /// - [Parameter] - public bool Active - { - get { return this._active; } - set { - if (this._active != value || !IsPropDirty("Active")) { - MarkPropDirty("Active"); - } - this._active = value; - - } - } - private bool _disabled = false; - - partial void OnDisabledChanging(ref bool newValue); - /// - /// Get/Set whether the tree item is disabled. Disabled items are ignored for user interactions. - /// - [Parameter] - public bool Disabled - { - get { return this._disabled; } - set { - if (this._disabled != value || !IsPropDirty("Disabled")) { - MarkPropDirty("Disabled"); - } - this._disabled = value; - - } - } - private bool _selected = false; - - partial void OnSelectedChanging(ref bool newValue); - /// - /// The tree item selection state. - /// - [Parameter] - public bool Selected - { - get { return this._selected; } - set { - if (this._selected != value || !IsPropDirty("Selected")) { - MarkPropDirty("Selected"); - } - this._selected = value; - - } - } - private bool _loading = false; - - partial void OnLoadingChanging(ref bool newValue); - /// - /// To be used for load-on-demand scenarios in order to specify whether the item is loading data. - /// - [Parameter] - public bool Loading - { - get { return this._loading; } - set { - if (this._loading != value || !IsPropDirty("Loading")) { - MarkPropDirty("Loading"); - } - this._loading = value; - - } - } - private object _value; - - partial void OnValueChanging(ref object newValue); - /// - /// The value entry that the tree item is visualizing. Required for searching through items. - /// - [Parameter] - public object Value - { - get { return this._value; } - set { - if (this._value != value || !IsPropDirty("Value")) { - MarkPropDirty("Value"); - } - this._value = value; - - } - } - public async Task GetPathAsync() - { - var iv = await InvokeMethod("p:Path", new object[] { }, new string[] { }); - - if (iv == null) - { - return default(IgbTreeItem[]); - } - var retVal = ReturnToObjectArray(iv); - if (retVal == null) - { - return default(IgbTreeItem[]); - } - return retVal; - - } - public IgbTreeItem[] GetPath() - { - var iv = InvokeMethodSync("p:Path", new object[] { }, new string[] { }); - - if (iv == null) - { - return default(IgbTreeItem[]); - } - var retVal = ReturnToObjectArray(iv); - if (retVal == null) - { - return default(IgbTreeItem[]); - } - return retVal; - - } - - partial void FindByNameTreeItem(string name, ref object item); - public override object FindByName(string name) - { - - var baseResult = base.FindByName(name); - if (baseResult != null) - { - return baseResult; - } - - object item = null; - FindByNameTreeItem(name, ref item); - if (item != null) - { - return item; - } - - return null; - } - public async Task SetNativeElementAsync(Object element) - { - await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); - } - public void SetNativeElement(Object element) - { - InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); - } - public async Task ConnectedCallbackAsync() - { - await InvokeMethod("connectedCallback", new object[] { }, new string[] { }); - } - public void ConnectedCallback() - { - InvokeMethodSync("connectedCallback", new object[] { }, new string[] { }); - } - public async Task DisconnectedCallbackAsync() - { - await InvokeMethod("disconnectedCallback", new object[] { }, new string[] { }); - } - public void DisconnectedCallback() - { - InvokeMethodSync("disconnectedCallback", new object[] { }, new string[] { }); - } - /// - /// Toggles tree item expansion state. - /// - public async Task ToggleAsync() - { - await InvokeMethod("toggle", new object[] { }, new string[] { }); - } - public void Toggle() - { - InvokeMethodSync("toggle", new object[] { }, new string[] { }); - } - /// - /// Expands the tree item. - /// - public async Task ExpandAsync() - { - await InvokeMethod("expand", new object[] { }, new string[] { }); - } - public void Expand() - { - InvokeMethodSync("expand", new object[] { }, new string[] { }); - } - /// - /// Collapses the tree item. - /// - public async Task CollapseAsync() - { - await InvokeMethod("collapse", new object[] { }, new string[] { }); - } - public void Collapse() - { - InvokeMethodSync("collapse", new object[] { }, new string[] { }); - } - - partial void SerializeCoreIgbTreeItem(RendererSerializer ser); - - internal override void SerializeCore(RendererSerializer ser) - { - base.SerializeCore(ser); - - SerializeCoreIgbTreeItem(ser); - - if (IsPropDirty("Parent")) { ser.AddSerializableProp("parent", this._parent); } - if (IsPropDirty("Level")) { ser.AddNumberProp("level", this._level); } - if (IsPropDirty("Label")) { ser.AddStringProp("label", this._label); } - if (IsPropDirty("Expanded")) { ser.AddBooleanProp("expanded", this._expanded); } - if (IsPropDirty("Active")) { ser.AddBooleanProp("active", this._active); } - if (IsPropDirty("Disabled")) { ser.AddBooleanProp("disabled", this._disabled); } - if (IsPropDirty("Selected")) { ser.AddBooleanProp("selected", this._selected); } - if (IsPropDirty("Loading")) { ser.AddBooleanProp("loading", this._loading); } - if (IsPropDirty("Value")) { ser.AddPrimitiveProp("value", this._value); } - - } - -} + /// + /// The tree-item component represents a child item of the tree component or another tree item. + /// + public partial class IgbTreeItem : BaseRendererControl + { + public override string Type { get { return "WebTreeItem"; } } + + protected override void EnsureModulesLoaded() + { + if (!IgbTreeItemModule.IsLoadRequested(IgBlazor)) + { + IgbTreeItemModule.Register(IgBlazor); + } + } + + protected override string ResolveDisplay() + { + return "inline-block"; + } + + protected override bool SupportsVisualChildren + { + get + { + return true; + } + } + + protected override bool UseDirectRender + { + get + { + return true; + } + } + + protected override string DirectRenderElementName + { + get + { + return "igc-tree-item"; + } + } + + protected override ControlEventBehavior DefaultEventBehavior + { + get { return ControlEventBehavior.Immediate; } + } + + public IgbTreeItem() : base() + { + OnCreatedIgbTreeItem(); + + } + + partial void OnCreatedIgbTreeItem(); + + private IgbTreeItem _parent; + + partial void OnParentChanging(ref IgbTreeItem newValue); + /// + /// The parent item of the current tree item (if any) + /// + [Parameter] + public IgbTreeItem Parent + { + get { return this._parent; } + set + { + if (this._parent != value || !IsPropDirty("Parent")) + { + MarkPropDirty("Parent"); + } + this._parent = value; + + } + } + private double _level = 0; + + partial void OnLevelChanging(ref double newValue); + /// + /// The depth of the item, relative to the root. + /// + [Parameter] + public double Level + { + get { return this._level; } + set + { + if (this._level != value || !IsPropDirty("Level")) + { + MarkPropDirty("Level"); + } + this._level = value; + + } + } + private string _label; + + partial void OnLabelChanging(ref string newValue); + /// + /// The tree item label. + /// + [Parameter] + public string Label + { + get { return this._label; } + set + { + if (this._label != value || !IsPropDirty("Label")) + { + MarkPropDirty("Label"); + } + this._label = value; + + } + } + private bool _expanded = false; + + partial void OnExpandedChanging(ref bool newValue); + /// + /// The tree item expansion state. + /// + [Parameter] + public bool Expanded + { + get { return this._expanded; } + set + { + if (this._expanded != value || !IsPropDirty("Expanded")) + { + MarkPropDirty("Expanded"); + } + this._expanded = value; + + } + } + private bool _active = false; + + partial void OnActiveChanging(ref bool newValue); + /// + /// Marks the item as the tree's active item. + /// + [Parameter] + public bool Active + { + get { return this._active; } + set + { + if (this._active != value || !IsPropDirty("Active")) + { + MarkPropDirty("Active"); + } + this._active = value; + + } + } + private bool _disabled = false; + + partial void OnDisabledChanging(ref bool newValue); + /// + /// Get/Set whether the tree item is disabled. Disabled items are ignored for user interactions. + /// + [Parameter] + public bool Disabled + { + get { return this._disabled; } + set + { + if (this._disabled != value || !IsPropDirty("Disabled")) + { + MarkPropDirty("Disabled"); + } + this._disabled = value; + + } + } + private bool _selected = false; + + partial void OnSelectedChanging(ref bool newValue); + /// + /// The tree item selection state. + /// + [Parameter] + public bool Selected + { + get { return this._selected; } + set + { + if (this._selected != value || !IsPropDirty("Selected")) + { + MarkPropDirty("Selected"); + } + this._selected = value; + + } + } + private bool _loading = false; + + partial void OnLoadingChanging(ref bool newValue); + /// + /// To be used for load-on-demand scenarios in order to specify whether the item is loading data. + /// + [Parameter] + public bool Loading + { + get { return this._loading; } + set + { + if (this._loading != value || !IsPropDirty("Loading")) + { + MarkPropDirty("Loading"); + } + this._loading = value; + + } + } + private object _value; + + partial void OnValueChanging(ref object newValue); + /// + /// The value entry that the tree item is visualizing. Required for searching through items. + /// + [Parameter] + public object Value + { + get { return this._value; } + set + { + if (this._value != value || !IsPropDirty("Value")) + { + MarkPropDirty("Value"); + } + this._value = value; + + } + } + public async Task GetPathAsync() + { + var iv = await InvokeMethod("p:Path", new object[] { }, new string[] { }); + + if (iv == null) + { + return default(IgbTreeItem[]); + } + var retVal = ReturnToObjectArray(iv); + if (retVal == null) + { + return default(IgbTreeItem[]); + } + return retVal; + + } + public IgbTreeItem[] GetPath() + { + var iv = InvokeMethodSync("p:Path", new object[] { }, new string[] { }); + + if (iv == null) + { + return default(IgbTreeItem[]); + } + var retVal = ReturnToObjectArray(iv); + if (retVal == null) + { + return default(IgbTreeItem[]); + } + return retVal; + + } + + partial void FindByNameTreeItem(string name, ref object item); + public override object FindByName(string name) + { + + var baseResult = base.FindByName(name); + if (baseResult != null) + { + return baseResult; + } + + object item = null; + FindByNameTreeItem(name, ref item); + if (item != null) + { + return item; + } + + return null; + } + public async Task SetNativeElementAsync(Object element) + { + await InvokeMethod("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + } + public void SetNativeElement(Object element) + { + InvokeMethodSync("setNativeElement", new object[] { ObjectToParam(element) }, new string[] { "Json" }); + } + public async Task ConnectedCallbackAsync() + { + await InvokeMethod("connectedCallback", new object[] { }, new string[] { }); + } + public void ConnectedCallback() + { + InvokeMethodSync("connectedCallback", new object[] { }, new string[] { }); + } + public async Task DisconnectedCallbackAsync() + { + await InvokeMethod("disconnectedCallback", new object[] { }, new string[] { }); + } + public void DisconnectedCallback() + { + InvokeMethodSync("disconnectedCallback", new object[] { }, new string[] { }); + } + /// + /// Toggles tree item expansion state. + /// + public async Task ToggleAsync() + { + await InvokeMethod("toggle", new object[] { }, new string[] { }); + } + public void Toggle() + { + InvokeMethodSync("toggle", new object[] { }, new string[] { }); + } + /// + /// Expands the tree item. + /// + public async Task ExpandAsync() + { + await InvokeMethod("expand", new object[] { }, new string[] { }); + } + public void Expand() + { + InvokeMethodSync("expand", new object[] { }, new string[] { }); + } + /// + /// Collapses the tree item. + /// + public async Task CollapseAsync() + { + await InvokeMethod("collapse", new object[] { }, new string[] { }); + } + public void Collapse() + { + InvokeMethodSync("collapse", new object[] { }, new string[] { }); + } + + partial void SerializeCoreIgbTreeItem(RendererSerializer ser); + + internal override void SerializeCore(RendererSerializer ser) + { + base.SerializeCore(ser); + + SerializeCoreIgbTreeItem(ser); + + if (IsPropDirty("Parent")) + { ser.AddSerializableProp("parent", this._parent); } + if (IsPropDirty("Level")) + { ser.AddNumberProp("level", this._level); } + if (IsPropDirty("Label")) + { ser.AddStringProp("label", this._label); } + if (IsPropDirty("Expanded")) + { ser.AddBooleanProp("expanded", this._expanded); } + if (IsPropDirty("Active")) + { ser.AddBooleanProp("active", this._active); } + if (IsPropDirty("Disabled")) + { ser.AddBooleanProp("disabled", this._disabled); } + if (IsPropDirty("Selected")) + { ser.AddBooleanProp("selected", this._selected); } + if (IsPropDirty("Loading")) + { ser.AddBooleanProp("loading", this._loading); } + if (IsPropDirty("Value")) + { ser.AddPrimitiveProp("value", this._value); } + + } + + } } diff --git a/src/components/Blazor/TreeItemCollection.cs b/src/components/Blazor/TreeItemCollection.cs index c1fabe2d..43ff9c67 100644 --- a/src/components/Blazor/TreeItemCollection.cs +++ b/src/components/Blazor/TreeItemCollection.cs @@ -1,11 +1,10 @@ - -using System; - namespace IgniteUI.Blazor.Controls { -public partial class IgbTreeItemCollection: BaseCollection { - public IgbTreeItemCollection(object parent, string propertyName): base(parent, propertyName) { - + public partial class IgbTreeItemCollection : BaseCollection + { + public IgbTreeItemCollection(object parent, string propertyName) : base(parent, propertyName) + { + + } } } -} diff --git a/src/components/Blazor/TreeItemComponentEventArgs.cs b/src/components/Blazor/TreeItemComponentEventArgs.cs index 4d738b14..62872e1b 100644 --- a/src/components/Blazor/TreeItemComponentEventArgs.cs +++ b/src/components/Blazor/TreeItemComponentEventArgs.cs @@ -1,94 +1,91 @@ - -using System; using Microsoft.AspNetCore.Components; -using Microsoft.AspNetCore.Components.Rendering; -using System.Threading.Tasks; -using System.Collections.Generic; -using System.Linq; namespace IgniteUI.Blazor.Controls { - public partial class IgbTreeItemComponentEventArgs: BaseRendererElement { - public override string Type { get { return "WebTreeItemComponentEventArgs"; } } - - - private static bool _marshalByValue = true; - - public IgbTreeItemComponentEventArgs(): base() { - OnCreatedIgbTreeItemComponentEventArgs(); - - - } - - partial void OnCreatedIgbTreeItemComponentEventArgs(); - - private IgbTreeItem _detail; - - partial void OnDetailChanging(ref IgbTreeItem newValue); - [Parameter] - public IgbTreeItem Detail - { - get { return this._detail; } - set { - if (this._detail != value || !IsPropDirty("Detail")) { - MarkPropDirty("Detail"); - } - this._detail = value; - - } - } - - partial void FindByNameTreeItemComponentEventArgs(string name, ref object item); - public override object FindByName(string name) - { - - var baseResult = base.FindByName(name); - if (baseResult != null) - { - return baseResult; - } - - object item = null; - FindByNameTreeItemComponentEventArgs(name, ref item); - if (item != null) - { - return item; - } - - return null; - } - - partial void SerializeCoreIgbTreeItemComponentEventArgs(RendererSerializer ser); - - internal override void SerializeCore(RendererSerializer ser) - { - base.SerializeCore(ser); - - SerializeCoreIgbTreeItemComponentEventArgs(ser); - - if (IsPropDirty("Detail")) { ser.AddSerializableProp("detail", this._detail); } - - } - - - protected internal override void ToEventJson(BaseRendererControl control, Dictionary args) - { - base.ToEventJson(control, args); - - if (IsPropDirty("Detail")) { args["detail"] = ObjectToParam(this._detail); } - - - } - - - protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) { - base.FromEventJson(control, args); - this.SuppressParentNotify = true; - - if (args.ContainsKey("detail")) { this.Detail = (IgbTreeItem)ConvertReturnValue(args["detail"], "TreeItem", true); } - - this.SuppressParentNotify = false; - } - -} + public partial class IgbTreeItemComponentEventArgs : BaseRendererElement + { + public override string Type { get { return "WebTreeItemComponentEventArgs"; } } + + private static bool _marshalByValue = true; + + public IgbTreeItemComponentEventArgs() : base() + { + OnCreatedIgbTreeItemComponentEventArgs(); + + } + + partial void OnCreatedIgbTreeItemComponentEventArgs(); + + private IgbTreeItem _detail; + + partial void OnDetailChanging(ref IgbTreeItem newValue); + [Parameter] + public IgbTreeItem Detail + { + get { return this._detail; } + set + { + if (this._detail != value || !IsPropDirty("Detail")) + { + MarkPropDirty("Detail"); + } + this._detail = value; + + } + } + + partial void FindByNameTreeItemComponentEventArgs(string name, ref object item); + public override object FindByName(string name) + { + + var baseResult = base.FindByName(name); + if (baseResult != null) + { + return baseResult; + } + + object item = null; + FindByNameTreeItemComponentEventArgs(name, ref item); + if (item != null) + { + return item; + } + + return null; + } + + partial void SerializeCoreIgbTreeItemComponentEventArgs(RendererSerializer ser); + + internal override void SerializeCore(RendererSerializer ser) + { + base.SerializeCore(ser); + + SerializeCoreIgbTreeItemComponentEventArgs(ser); + + if (IsPropDirty("Detail")) + { ser.AddSerializableProp("detail", this._detail); } + + } + + protected internal override void ToEventJson(BaseRendererControl control, Dictionary args) + { + base.ToEventJson(control, args); + + if (IsPropDirty("Detail")) + { args["detail"] = ObjectToParam(this._detail); } + + } + + protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) + { + base.FromEventJson(control, args); + this.SuppressParentNotify = true; + + if (args.ContainsKey("detail")) + { this.Detail = (IgbTreeItem)ConvertReturnValue(args["detail"], "TreeItem", true); } + + this.SuppressParentNotify = false; + } + + } } diff --git a/src/components/Blazor/TreeItemModule.cs b/src/components/Blazor/TreeItemModule.cs index f52336a6..c74ba47b 100644 --- a/src/components/Blazor/TreeItemModule.cs +++ b/src/components/Blazor/TreeItemModule.cs @@ -1,23 +1,20 @@ -using System; -using System.Collections.Generic; -using System.Runtime.CompilerServices; -using System.Text; -using System.Collections.Generic; - namespace IgniteUI.Blazor.Controls { - public partial class IgbTreeItemModule { - public static void Register(IIgniteUIBlazor runtime) { + public partial class IgbTreeItemModule + { + public static void Register(IIgniteUIBlazor runtime) + { ModuleLoader.Load(runtime, "WebTreeItemModule"); - } - public static void MarkIsLoadRequested(IIgniteUIBlazor runtime) { + public static void MarkIsLoadRequested(IIgniteUIBlazor runtime) + { ModuleLoader.MarkIsLoadRequested(runtime, "WebTreeItemModule"); } - public static bool IsLoadRequested(IIgniteUIBlazor runtime) { + public static bool IsLoadRequested(IIgniteUIBlazor runtime) + { return ModuleLoader.IsLoadRequested(runtime, "WebTreeItemModule"); } } diff --git a/src/components/Blazor/TreeModule.cs b/src/components/Blazor/TreeModule.cs index c2848164..b81605a6 100644 --- a/src/components/Blazor/TreeModule.cs +++ b/src/components/Blazor/TreeModule.cs @@ -1,24 +1,22 @@ -using System; -using System.Collections.Generic; -using System.Runtime.CompilerServices; -using System.Text; -using System.Collections.Generic; - namespace IgniteUI.Blazor.Controls { - public partial class IgbTreeModule { - public static void Register(IIgniteUIBlazor runtime) { + public partial class IgbTreeModule + { + public static void Register(IIgniteUIBlazor runtime) + { ModuleLoader.Load(runtime, "WebTreeModule"); IgbTreeItemModule.MarkIsLoadRequested(runtime); } - public static void MarkIsLoadRequested(IIgniteUIBlazor runtime) { + public static void MarkIsLoadRequested(IIgniteUIBlazor runtime) + { ModuleLoader.MarkIsLoadRequested(runtime, "WebTreeModule"); } - public static bool IsLoadRequested(IIgniteUIBlazor runtime) { + public static bool IsLoadRequested(IIgniteUIBlazor runtime) + { return ModuleLoader.IsLoadRequested(runtime, "WebTreeModule"); } } diff --git a/src/components/Blazor/TreeSelection.cs b/src/components/Blazor/TreeSelection.cs index a2c799c6..56a20af8 100644 --- a/src/components/Blazor/TreeSelection.cs +++ b/src/components/Blazor/TreeSelection.cs @@ -1,9 +1,10 @@ namespace IgniteUI.Blazor.Controls { -public enum TreeSelection { - None, - Multiple, - Cascade + public enum TreeSelection + { + None, + Multiple, + Cascade -} + } } diff --git a/src/components/Blazor/TreeSelectionEventArgs.cs b/src/components/Blazor/TreeSelectionEventArgs.cs index 5941ecd3..d540dbc5 100644 --- a/src/components/Blazor/TreeSelectionEventArgs.cs +++ b/src/components/Blazor/TreeSelectionEventArgs.cs @@ -1,99 +1,97 @@ - -using System; using Microsoft.AspNetCore.Components; -using Microsoft.AspNetCore.Components.Rendering; -using System.Threading.Tasks; -using System.Collections.Generic; -using System.Linq; namespace IgniteUI.Blazor.Controls { - public partial class IgbTreeSelectionEventArgs: BaseRendererElement { - public override string Type { get { return "WebTreeSelectionEventArgs"; } } - - - private static bool _marshalByValue = true; - - public IgbTreeSelectionEventArgs(): base() { - OnCreatedIgbTreeSelectionEventArgs(); - - - } - - partial void OnCreatedIgbTreeSelectionEventArgs(); - - private IgbTreeSelectionEventArgsDetail _detail; - - partial void OnDetailChanging(ref IgbTreeSelectionEventArgsDetail newValue); - [Parameter] - public IgbTreeSelectionEventArgsDetail Detail - { - get { return this._detail; } - set { - OnDetailChanging(ref value); - MarkPropDirty("Detail"); - if (this._detail != null) { - this.DetachChild(this._detail); - } - if (value != null) { - this.AttachChild(value); - } - this._detail = value; - } - - } - - partial void FindByNameTreeSelectionEventArgs(string name, ref object item); - public override object FindByName(string name) - { - - var baseResult = base.FindByName(name); - if (baseResult != null) - { - return baseResult; - } - - object item = null; - FindByNameTreeSelectionEventArgs(name, ref item); - if (item != null) - { - return item; - } - - return null; - } - - partial void SerializeCoreIgbTreeSelectionEventArgs(RendererSerializer ser); - - internal override void SerializeCore(RendererSerializer ser) - { - base.SerializeCore(ser); - - SerializeCoreIgbTreeSelectionEventArgs(ser); - - if (IsPropDirty("Detail")) { ser.AddSerializableProp("detail", this._detail); } - - } - - - protected internal override void ToEventJson(BaseRendererControl control, Dictionary args) - { - base.ToEventJson(control, args); - - if (IsPropDirty("Detail")) { args["detail"] = ObjectToParam(this._detail); } - - - } - - - protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) { - base.FromEventJson(control, args); - this.SuppressParentNotify = true; - - if (args.ContainsKey("detail")) { this.Detail = (IgbTreeSelectionEventArgsDetail)ConvertReturnValue(args["detail"], "TreeSelectionEventArgsDetail", true); } - - this.SuppressParentNotify = false; - } - -} + public partial class IgbTreeSelectionEventArgs : BaseRendererElement + { + public override string Type { get { return "WebTreeSelectionEventArgs"; } } + + private static bool _marshalByValue = true; + + public IgbTreeSelectionEventArgs() : base() + { + OnCreatedIgbTreeSelectionEventArgs(); + + } + + partial void OnCreatedIgbTreeSelectionEventArgs(); + + private IgbTreeSelectionEventArgsDetail _detail; + + partial void OnDetailChanging(ref IgbTreeSelectionEventArgsDetail newValue); + [Parameter] + public IgbTreeSelectionEventArgsDetail Detail + { + get { return this._detail; } + set + { + OnDetailChanging(ref value); + MarkPropDirty("Detail"); + if (this._detail != null) + { + this.DetachChild(this._detail); + } + if (value != null) + { + this.AttachChild(value); + } + this._detail = value; + } + + } + + partial void FindByNameTreeSelectionEventArgs(string name, ref object item); + public override object FindByName(string name) + { + + var baseResult = base.FindByName(name); + if (baseResult != null) + { + return baseResult; + } + + object item = null; + FindByNameTreeSelectionEventArgs(name, ref item); + if (item != null) + { + return item; + } + + return null; + } + + partial void SerializeCoreIgbTreeSelectionEventArgs(RendererSerializer ser); + + internal override void SerializeCore(RendererSerializer ser) + { + base.SerializeCore(ser); + + SerializeCoreIgbTreeSelectionEventArgs(ser); + + if (IsPropDirty("Detail")) + { ser.AddSerializableProp("detail", this._detail); } + + } + + protected internal override void ToEventJson(BaseRendererControl control, Dictionary args) + { + base.ToEventJson(control, args); + + if (IsPropDirty("Detail")) + { args["detail"] = ObjectToParam(this._detail); } + + } + + protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) + { + base.FromEventJson(control, args); + this.SuppressParentNotify = true; + + if (args.ContainsKey("detail")) + { this.Detail = (IgbTreeSelectionEventArgsDetail)ConvertReturnValue(args["detail"], "TreeSelectionEventArgsDetail", true); } + + this.SuppressParentNotify = false; + } + + } } diff --git a/src/components/Blazor/TreeSelectionEventArgsDetail.cs b/src/components/Blazor/TreeSelectionEventArgsDetail.cs index cf01b0b9..3a23026d 100644 --- a/src/components/Blazor/TreeSelectionEventArgsDetail.cs +++ b/src/components/Blazor/TreeSelectionEventArgsDetail.cs @@ -1,94 +1,91 @@ - -using System; using Microsoft.AspNetCore.Components; -using Microsoft.AspNetCore.Components.Rendering; -using System.Threading.Tasks; -using System.Collections.Generic; -using System.Linq; namespace IgniteUI.Blazor.Controls { - public partial class IgbTreeSelectionEventArgsDetail: BaseRendererElement { - public override string Type { get { return "WebTreeSelectionEventArgsDetail"; } } - - - private static bool _marshalByValue = true; - - public IgbTreeSelectionEventArgsDetail(): base() { - OnCreatedIgbTreeSelectionEventArgsDetail(); - - - } - - partial void OnCreatedIgbTreeSelectionEventArgsDetail(); - - private IgbTreeItem[] _newSelection; - - partial void OnNewSelectionChanging(ref IgbTreeItem[] newValue); - [Parameter] - public IgbTreeItem[] NewSelection - { - get { return this._newSelection; } - set { - if (this._newSelection != value || !IsPropDirty("NewSelection")) { - MarkPropDirty("NewSelection"); - } - this._newSelection = value; - - } - } - - partial void FindByNameTreeSelectionEventArgsDetail(string name, ref object item); - public override object FindByName(string name) - { - - var baseResult = base.FindByName(name); - if (baseResult != null) - { - return baseResult; - } - - object item = null; - FindByNameTreeSelectionEventArgsDetail(name, ref item); - if (item != null) - { - return item; - } - - return null; - } - - partial void SerializeCoreIgbTreeSelectionEventArgsDetail(RendererSerializer ser); - - internal override void SerializeCore(RendererSerializer ser) - { - base.SerializeCore(ser); - - SerializeCoreIgbTreeSelectionEventArgsDetail(ser); - - if (IsPropDirty("NewSelection")) { ser.AddSerializableArrayProp("newSelection", this._newSelection); } - - } - - - protected internal override void ToEventJson(BaseRendererControl control, Dictionary args) - { - base.ToEventJson(control, args); - - if (IsPropDirty("NewSelection")) { args["newSelection"] = ObjectArrayToParam(this._newSelection); } - - - } - - - protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) { - base.FromEventJson(control, args); - this.SuppressParentNotify = true; - - if (args.ContainsKey("newSelection")) { this.NewSelection = ReturnToObjectArray(args["newSelection"]); } - - this.SuppressParentNotify = false; - } - -} + public partial class IgbTreeSelectionEventArgsDetail : BaseRendererElement + { + public override string Type { get { return "WebTreeSelectionEventArgsDetail"; } } + + private static bool _marshalByValue = true; + + public IgbTreeSelectionEventArgsDetail() : base() + { + OnCreatedIgbTreeSelectionEventArgsDetail(); + + } + + partial void OnCreatedIgbTreeSelectionEventArgsDetail(); + + private IgbTreeItem[] _newSelection; + + partial void OnNewSelectionChanging(ref IgbTreeItem[] newValue); + [Parameter] + public IgbTreeItem[] NewSelection + { + get { return this._newSelection; } + set + { + if (this._newSelection != value || !IsPropDirty("NewSelection")) + { + MarkPropDirty("NewSelection"); + } + this._newSelection = value; + + } + } + + partial void FindByNameTreeSelectionEventArgsDetail(string name, ref object item); + public override object FindByName(string name) + { + + var baseResult = base.FindByName(name); + if (baseResult != null) + { + return baseResult; + } + + object item = null; + FindByNameTreeSelectionEventArgsDetail(name, ref item); + if (item != null) + { + return item; + } + + return null; + } + + partial void SerializeCoreIgbTreeSelectionEventArgsDetail(RendererSerializer ser); + + internal override void SerializeCore(RendererSerializer ser) + { + base.SerializeCore(ser); + + SerializeCoreIgbTreeSelectionEventArgsDetail(ser); + + if (IsPropDirty("NewSelection")) + { ser.AddSerializableArrayProp("newSelection", this._newSelection); } + + } + + protected internal override void ToEventJson(BaseRendererControl control, Dictionary args) + { + base.ToEventJson(control, args); + + if (IsPropDirty("NewSelection")) + { args["newSelection"] = ObjectArrayToParam(this._newSelection); } + + } + + protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) + { + base.FromEventJson(control, args); + this.SuppressParentNotify = true; + + if (args.ContainsKey("newSelection")) + { this.NewSelection = ReturnToObjectArray(args["newSelection"]); } + + this.SuppressParentNotify = false; + } + + } } diff --git a/src/components/Blazor/VoidEventArgs.cs b/src/components/Blazor/VoidEventArgs.cs index 70deb51d..05a1a8ad 100644 --- a/src/components/Blazor/VoidEventArgs.cs +++ b/src/components/Blazor/VoidEventArgs.cs @@ -1,74 +1,60 @@ - -using System; -using Microsoft.AspNetCore.Components; -using Microsoft.AspNetCore.Components.Rendering; -using System.Threading.Tasks; -using System.Collections.Generic; -using System.Linq; - namespace IgniteUI.Blazor.Controls { - public partial class IgbVoidEventArgs: BaseRendererElement { - public override string Type { get { return "VoidEventArgs"; } } - - - public IgbVoidEventArgs(): base() { - OnCreatedIgbVoidEventArgs(); - - - } - - partial void OnCreatedIgbVoidEventArgs(); - - - partial void FindByNameVoidEventArgs(string name, ref object item); - public override object FindByName(string name) - { - - var baseResult = base.FindByName(name); - if (baseResult != null) - { - return baseResult; - } - - object item = null; - FindByNameVoidEventArgs(name, ref item); - if (item != null) - { - return item; - } - - return null; - } - - partial void SerializeCoreIgbVoidEventArgs(RendererSerializer ser); - - internal override void SerializeCore(RendererSerializer ser) - { - base.SerializeCore(ser); - - SerializeCoreIgbVoidEventArgs(ser); - - - } - - - protected internal override void ToEventJson(BaseRendererControl control, Dictionary args) - { - base.ToEventJson(control, args); - - - - } - - - protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) { - base.FromEventJson(control, args); - this.SuppressParentNotify = true; - - - this.SuppressParentNotify = false; - } - -} + public partial class IgbVoidEventArgs : BaseRendererElement + { + public override string Type { get { return "VoidEventArgs"; } } + + public IgbVoidEventArgs() : base() + { + OnCreatedIgbVoidEventArgs(); + + } + + partial void OnCreatedIgbVoidEventArgs(); + + partial void FindByNameVoidEventArgs(string name, ref object item); + public override object FindByName(string name) + { + + var baseResult = base.FindByName(name); + if (baseResult != null) + { + return baseResult; + } + + object item = null; + FindByNameVoidEventArgs(name, ref item); + if (item != null) + { + return item; + } + + return null; + } + + partial void SerializeCoreIgbVoidEventArgs(RendererSerializer ser); + + internal override void SerializeCore(RendererSerializer ser) + { + base.SerializeCore(ser); + + SerializeCoreIgbVoidEventArgs(ser); + + } + + protected internal override void ToEventJson(BaseRendererControl control, Dictionary args) + { + base.ToEventJson(control, args); + + } + + protected internal override void FromEventJson(BaseRendererControl control, Dictionary args) + { + base.FromEventJson(control, args); + this.SuppressParentNotify = true; + + this.SuppressParentNotify = false; + } + + } } diff --git a/src/components/Blazor/WeekDays.cs b/src/components/Blazor/WeekDays.cs index 39ed193b..bc105731 100644 --- a/src/components/Blazor/WeekDays.cs +++ b/src/components/Blazor/WeekDays.cs @@ -1,13 +1,14 @@ namespace IgniteUI.Blazor.Controls { -public enum WeekDays { - Sunday, - Monday, - Tuesday, - Wednesday, - Thursday, - Friday, - Saturday + public enum WeekDays + { + Sunday, + Monday, + Tuesday, + Wednesday, + Thursday, + Friday, + Saturday -} + } } diff --git a/src/componentsBase/BaseCollection.cs b/src/componentsBase/BaseCollection.cs index 3ad43d7e..8ebeea81 100644 --- a/src/componentsBase/BaseCollection.cs +++ b/src/componentsBase/BaseCollection.cs @@ -1,10 +1,10 @@ -using System.Collections.Generic; using System.Collections.ObjectModel; -namespace IgniteUI.Blazor.Controls +namespace IgniteUI.Blazor.Controls { - public class BaseCollection : ObservableCollection { + public class BaseCollection : ObservableCollection + { private bool _suppressNotify = false; internal bool SuppressNofify @@ -44,18 +44,20 @@ public T[] ToArray() protected override void InsertItem(int index, T item) { base.InsertItem(index, item); - if (item is BaseRendererElement) { + if (item is BaseRendererElement) + { BaseRendererElement c = (BaseRendererElement)(object)item; c.Parent = _parent; } NotifyParent(); } - protected override void RemoveItem(int index) + protected override void RemoveItem(int index) { var item = this[index]; base.RemoveItem(index); - if (item is BaseRendererElement) { + if (item is BaseRendererElement) + { BaseRendererElement c = (BaseRendererElement)(object)item; c.Parent = null; } @@ -65,7 +67,8 @@ protected override void RemoveItem(int index) protected override void SetItem(int index, T item) { base.SetItem(index, item); - if (item is BaseRendererElement) { + if (item is BaseRendererElement) + { BaseRendererElement c = (BaseRendererElement)(object)item; c.Parent = _parent; } @@ -98,12 +101,14 @@ internal string PropertyName } } - public BaseCollection(object parent, string propertyName) { + public BaseCollection(object parent, string propertyName) + { _parent = parent; _propertyName = propertyName; } - private void NotifyParent() { + private void NotifyParent() + { if (_suppressNotify) { return; @@ -112,19 +117,23 @@ private void NotifyParent() { { return; } - if (_parent is BaseRendererElement) { + if (_parent is BaseRendererElement) + { ((BaseRendererElement)_parent).MarkPropDirty(_propertyName); } - if (_parent is BaseRendererControl) { + if (_parent is BaseRendererControl) + { ((BaseRendererControl)_parent).MarkPropDirty(_propertyName); } } protected override void ClearItems() { - for (var i = 0; i < Count; i++) { + for (var i = 0; i < Count; i++) + { var item = this[i]; - if (item is BaseRendererElement) { + if (item is BaseRendererElement) + { BaseRendererElement c = (BaseRendererElement)(object)item; c.Parent = null; } @@ -133,7 +142,8 @@ protected override void ClearItems() NotifyParent(); } - public void Serialize(SerializationContext context, string propertyName = null) { + public void Serialize(SerializationContext context, string propertyName = null) + { //var vals = new List(); if (propertyName != null) { @@ -143,41 +153,55 @@ public void Serialize(SerializationContext context, string propertyName = null) { context.Writer.WriteStartArray(); } - for (var i = 0; i < Count; i++) { + for (var i = 0; i < Count; i++) + { var val = this[i]; - if (val is JsonSerializable) { + if (val is JsonSerializable) + { ((JsonSerializable)val).Serialize(context); - } else { - if (typeof(T) == typeof(int)) { + } + else + { + if (typeof(T) == typeof(int)) + { context.Writer.WriteNumberValue((int)(object)val); } - else if (typeof(T) == typeof(long)) { + else if (typeof(T) == typeof(long)) + { context.Writer.WriteNumberValue((long)(object)val); } - else if (typeof(T) == typeof(short)) { + else if (typeof(T) == typeof(short)) + { context.Writer.WriteNumberValue((short)(object)val); } - else if (typeof(T) == typeof(decimal)) { + else if (typeof(T) == typeof(decimal)) + { context.Writer.WriteNumberValue((decimal)(object)val); } - else if (typeof(T) == typeof(float)) { + else if (typeof(T) == typeof(float)) + { context.Writer.WriteNumberValue((float)(object)val); } - else if (typeof(T) == typeof(double)) { + else if (typeof(T) == typeof(double)) + { context.Writer.WriteNumberValue((double)(object)val); } - else if (typeof(T) == typeof(byte)) { + else if (typeof(T) == typeof(byte)) + { context.Writer.WriteNumberValue((byte)(object)val); } - else if (typeof(T) == typeof(string)) { + else if (typeof(T) == typeof(string)) + { context.Writer.WriteStringValue((string)(object)val); } else { - if (_parent is BaseRendererElement) { + if (_parent is BaseRendererElement) + { ((BaseRendererElement)_parent).ObjectToParam(context, val); } - if (_parent is BaseRendererControl) { + if (_parent is BaseRendererControl) + { ((BaseRendererControl)_parent).ObjectToParam(context, val); } } @@ -196,7 +220,8 @@ public object FindByName(string name) if (item is BaseRendererElement) { var ele = (BaseRendererElement)(object)item; - if (name == ele.Name) { + if (name == ele.Name) + { return item; } var subEle = ele.FindByName(name); @@ -207,7 +232,9 @@ public object FindByName(string name) return subEle; } } - } else if (item is BaseRendererControl) { + } + else if (item is BaseRendererControl) + { BaseRendererControl element = (BaseRendererControl)(object)item; if (name == element.ContainerId) { @@ -218,10 +245,10 @@ public object FindByName(string name) return null; } - public bool HasName(string name) + public bool HasName(string name) { //TODO: hash map - for (var i = 0; i < this.Count; i++) + for (var i = 0; i < this.Count; i++) { var item = this[i]; if (item is BaseRendererElement) @@ -240,9 +267,11 @@ public bool HasName(string name) } } } - else if (item is BaseRendererControl) { + else if (item is BaseRendererControl) + { BaseRendererControl element = (BaseRendererControl)(object)item; - if (name == element.ContainerId) { + if (name == element.ContainerId) + { return true; } } @@ -251,4 +280,4 @@ public bool HasName(string name) } } -} \ No newline at end of file +} diff --git a/src/componentsBase/BaseRendererControl.cs b/src/componentsBase/BaseRendererControl.cs index e849d28a..b6ad2d83 100644 --- a/src/componentsBase/BaseRendererControl.cs +++ b/src/componentsBase/BaseRendererControl.cs @@ -1,220 +1,211 @@ - - -using Microsoft.JSInterop; -using System; -using System.Collections.Generic; -using System.Threading.Tasks; -using Microsoft.AspNetCore.Components; +using System.Collections.Concurrent; +using System.Collections.ObjectModel; using System.Globalization; +using System.Reflection; +using System.Text; using System.Text.Json; -using Microsoft.AspNetCore.Components.Web; +using Microsoft.AspNetCore.Components; using Microsoft.AspNetCore.Components.Rendering; -using System.IO; -using System.Text; -using System.Collections.ObjectModel; -using System.Collections.Concurrent; -using System.Data; -using System.Threading; -using System.Reflection; +using Microsoft.JSInterop; namespace IgniteUI.Blazor.Controls { -/// -/// Determines the behavior of events as they are fired at the JavaScript level and bubbled up to the Blazor level. -/// -public enum ControlEventBehavior -{ - /// - /// The behavior is automatically determined by the component. - /// - Auto, - /// - /// The behavior is to immediately fire event handlers. - /// - Immediate, /// - /// The behavior is to queue the event handlers to the next available cycle. + /// Determines the behavior of events as they are fired at the JavaScript level and bubbled up to the Blazor level. /// - Queued -} + public enum ControlEventBehavior + { + /// + /// The behavior is automatically determined by the component. + /// + Auto, + /// + /// The behavior is to immediately fire event handlers. + /// + Immediate, + /// + /// The behavior is to queue the event handlers to the next available cycle. + /// + Queued + } -public partial class BaseRendererControl: ComponentBase, RefSink, JsonSerializable, IDisposable -{ - private IIgniteUIBlazor _igBlazor; - [Inject] - protected IIgniteUIBlazor IgBlazor - { - get - { - return _igBlazor; - } - set + public partial class BaseRendererControl : ComponentBase, RefSink, JsonSerializable, IDisposable + { + private IIgniteUIBlazor _igBlazor; + [Inject] + protected IIgniteUIBlazor IgBlazor { - _igBlazor = value; + get + { + return _igBlazor; + } + set + { + _igBlazor = value; // if (_igBlazor is IJSInProcessRuntime) // { // this.JsInProcessRuntime = (IJSInProcessRuntime)_igBlazor; // } - _igBlazor.WebCallback.Register(this); - _dataSourceManager = new DataSourceManager(this, new RuntimeHelper(JsRuntime, _igBlazor)); - EnsureModulesLoaded(); + _igBlazor.WebCallback.Register(this); + _dataSourceManager = new DataSourceManager(this, new RuntimeHelper(JsRuntime, _igBlazor)); + EnsureModulesLoaded(); + } } - } - protected virtual void EnsureModulesLoaded() - { + protected virtual void EnsureModulesLoaded() + { - } + } - private IJSRuntime JsRuntime - { - get + private IJSRuntime JsRuntime { - return IgBlazor != null ? IgBlazor.JsRuntime : null; + get + { + return IgBlazor != null ? IgBlazor.JsRuntime : null; + } } - } - private IJSInProcessRuntime _inproc = null; - private bool _checkedInproc = false; - private IJSInProcessRuntime JsInProcessRuntime - { - get + private IJSInProcessRuntime _inproc = null; + private bool _checkedInproc = false; + private IJSInProcessRuntime JsInProcessRuntime { - if (!_checkedInproc) + get { - _checkedInproc = true; - _inproc = JsRuntime as IJSInProcessRuntime; - + if (!_checkedInproc) + { + _checkedInproc = true; + _inproc = JsRuntime as IJSInProcessRuntime; + + } + return _inproc; } - return _inproc; } - } - [Parameter] - public string Height - { - get; set; - } + [Parameter] + public string Height + { + get; set; + } - [Parameter] - public string Width - { - get; set; - } + [Parameter] + public string Width + { + get; set; + } - [Parameter] - public string Class - { - get; set; - } + [Parameter] + public string Class + { + get; set; + } - [Parameter(CaptureUnmatchedValues = true)] - public Dictionary AdditionalAttributes { get; set; } + [Parameter(CaptureUnmatchedValues = true)] + public Dictionary AdditionalAttributes { get; set; } - protected virtual string ParentTypeName - { - get + protected virtual string ParentTypeName { - return "BaseRenderControlParent"; + get + { + return "BaseRenderControlParent"; + } } - } - /// - /// Gets or sets how events are bubbled up from JavaScript to Blazor. - /// - [Parameter] - public ControlEventBehavior EventBehavior { get; set; } = ControlEventBehavior.Auto; + /// + /// Gets or sets how events are bubbled up from JavaScript to Blazor. + /// + [Parameter] + public ControlEventBehavior EventBehavior { get; set; } = ControlEventBehavior.Auto; - /// - /// Gets the components default event behavior. - /// - protected virtual ControlEventBehavior DefaultEventBehavior - { - get { return ControlEventBehavior.Queued; } - } + /// + /// Gets the components default event behavior. + /// + protected virtual ControlEventBehavior DefaultEventBehavior + { + get { return ControlEventBehavior.Queued; } + } - /// - /// Resolves the components event behavior if Auto is selected. - /// - protected ControlEventBehavior ResolveEventBehavior() - { - if (EventBehavior == ControlEventBehavior.Auto) + /// + /// Resolves the components event behavior if Auto is selected. + /// + protected ControlEventBehavior ResolveEventBehavior() { - return DefaultEventBehavior; + if (EventBehavior == ControlEventBehavior.Auto) + { + return DefaultEventBehavior; + } + return EventBehavior; } - return EventBehavior; - } - [Parameter] public RenderFragment ChildContent { get; set; } + [Parameter] public RenderFragment ChildContent { get; set; } - private ElementReference contEle; - private Dictionary _isDirty = new Dictionary(); - private Dictionary _isDirtyRef = new Dictionary(); - private bool _hasDirty = false; - private bool _serializeDirty = true; - private DataSourceManager _dataSourceManager; - internal DataSourceManager DataSourceManager - { - get {return _dataSourceManager; } - } - private LinkedList _messageQueue = new LinkedList(); + private ElementReference contEle; + private Dictionary _isDirty = new Dictionary(); + private Dictionary _isDirtyRef = new Dictionary(); + private bool _hasDirty = false; + private bool _serializeDirty = true; + private DataSourceManager _dataSourceManager; + internal DataSourceManager DataSourceManager + { + get { return _dataSourceManager; } + } + private LinkedList _messageQueue = new LinkedList(); - private string _containerId = Guid.NewGuid().ToString(); + private string _containerId = Guid.NewGuid().ToString(); - internal string ContainerId - { - get + internal string ContainerId { - return _containerId; + get + { + return _containerId; + } } - } - private bool _ready = false; - private Dictionary> _handlers = new Dictionary>(); - private bool _updateQueued = false; + private bool _ready = false; + private Dictionary> _handlers = new Dictionary>(); + private bool _updateQueued = false; - /** - * Cache the delegate and receiver field of each EventCallback type for increased performance when comparing. - */ - protected Dictionary> eventCallbacksCache = new Dictionary>(); + /** + * Cache the delegate and receiver field of each EventCallback type for increased performance when comparing. + */ + protected Dictionary> eventCallbacksCache = new Dictionary>(); - /// - /// Gets or sets what type of date conversion to make when round tripping dates. - /// - [Parameter] - public RoundTripDateConversion RoundTripDateConversion { get; set; } = RoundTripDateConversion.Auto; + /// + /// Gets or sets what type of date conversion to make when round tripping dates. + /// + [Parameter] + public RoundTripDateConversion RoundTripDateConversion { get; set; } = RoundTripDateConversion.Auto; - private DotNetObjectReference _objRef; + private DotNetObjectReference _objRef; - private DotNetObjectReference GetObjectRef() - { - if (_objRef == null) + private DotNetObjectReference GetObjectRef() { - _objRef = DotNetObjectReference.Create(IgBlazor.WebCallback); - } + if (_objRef == null) + { + _objRef = DotNetObjectReference.Create(IgBlazor.WebCallback); + } - return _objRef; - } + return _objRef; + } - public BaseRendererControl(): base() - { - //Console.WriteLine("constructed: " + this.GetType().Name); - //_dataSourceManager = new DataSourceManager(this, new RuntimeHelper(JsRuntime)); - //WebCallback.Instance.Register(this); - //this._objRef = DotNetObjectReference.Create(IgBlazor.WebCallback); - //_webCallbackHelper.WebCallback = WebCallback.Instance; - } + public BaseRendererControl() : base() + { + //Console.WriteLine("constructed: " + this.GetType().Name); + //_dataSourceManager = new DataSourceManager(this, new RuntimeHelper(JsRuntime)); + //WebCallback.Instance.Register(this); + //this._objRef = DotNetObjectReference.Create(IgBlazor.WebCallback); + //_webCallbackHelper.WebCallback = WebCallback.Instance; + } - protected virtual string ResolveDisplay() - { - return "block"; - } + protected virtual string ResolveDisplay() + { + return "block"; + } - protected string ToSpinal(string value) - { - if (value == null) + protected string ToSpinal(string value) + { + if (value == null) { return null; } @@ -265,3130 +256,3428 @@ protected string ToSpinal(string value) sb.Append(output[i]); } return sb.ToString(); - } + } - protected virtual bool SupportsVisualChildren - { - get + protected virtual bool SupportsVisualChildren { - return false; + get + { + return false; + } } - } - protected virtual bool UseDirectRender - { - get + protected virtual bool UseDirectRender { - return false; + get + { + return false; + } } - } - protected virtual string DirectRenderElementName - { - get + protected virtual string DirectRenderElementName { - return ""; + get + { + return ""; + } } - } - private void EnsureSequenceInfo() - { - if (_sequenceInfo == null) + private void EnsureSequenceInfo() { - _sequenceInfo = BuildSequenceInfo(3); + if (_sequenceInfo == null) + { + _sequenceInfo = BuildSequenceInfo(3); + } } - } - private Dictionary GatherSimpleAttributes() - { - EnsureSequenceInfo(); + private Dictionary GatherSimpleAttributes() + { + EnsureSequenceInfo(); + + var ser = Serialize(); + var data = System.Text.Json.JsonSerializer.Deserialize>(ser); + Dictionary ret = new Dictionary(); + foreach (var key in data.Keys) + { + var currKey = key; + var currValue = data[key]; + if (currValue is JsonElement) + { + switch (((JsonElement)currValue).ValueKind) + { + case JsonValueKind.False: + currValue = false; + break; + case JsonValueKind.True: + currValue = true; + break; + case JsonValueKind.Array: + currValue = ArrayToSimpleAttributeValue((JsonElement)currValue); + break; + } + } + //currKey = TransformSimpleKey(currKey); + ret[currKey] = currValue; + } - var ser = Serialize(); - var data = System.Text.Json.JsonSerializer.Deserialize>(ser); - Dictionary ret = new Dictionary(); - foreach (var key in data.Keys) + return ret; + } + + private object ArrayToSimpleAttributeValue(JsonElement currValue) { - var currKey = key; - var currValue = data[key]; - if (currValue is JsonElement) + string ret = "["; + for (var i = 0; i < currValue.GetArrayLength(); i++) { - switch (((JsonElement)currValue).ValueKind) + if (i > 0) { + ret += ", "; + } + var currEle = currValue[i]; + ret += "\""; + switch (currEle.ValueKind) + { + case JsonValueKind.Undefined: + continue; + case JsonValueKind.Object: + ret += currEle.ToString(); + break; + case JsonValueKind.Array: + ret += ArrayToSimpleAttributeValue(currEle); + break; case JsonValueKind.False: - currValue = false; + ret += "false"; + break; + case JsonValueKind.Null: + ret += "null"; + break; + case JsonValueKind.String: + ret += currEle.GetString(); break; case JsonValueKind.True: - currValue = true; - break; - case JsonValueKind.Array: - currValue = ArrayToSimpleAttributeValue((JsonElement)currValue); - break; + ret += "true"; + break; + case JsonValueKind.Number: + ret += currEle.ToString(); + break; } + ret += "\""; } - //currKey = TransformSimpleKey(currKey); - ret[currKey] = currValue; - } - - return ret; - } - - private object ArrayToSimpleAttributeValue(JsonElement currValue) - { - string ret = "["; - for (var i = 0; i < currValue.GetArrayLength(); i++) - { - if (i > 0) - { - ret += ", "; - } - var currEle = currValue[i]; - ret += "\""; - switch (currEle.ValueKind) - { - case JsonValueKind.Undefined: - continue; - case JsonValueKind.Object: - ret += currEle.ToString(); - break; - case JsonValueKind.Array: - ret += ArrayToSimpleAttributeValue(currEle); - break; - case JsonValueKind.False: - ret += "false"; - break; - case JsonValueKind.Null: - ret += "null"; - break; - case JsonValueKind.String: - ret += currEle.GetString(); - break; - case JsonValueKind.True: - ret += "true"; - break; - case JsonValueKind.Number: - ret += currEle.ToString(); - break; - } - ret += "\""; - } ret += "]"; - return ret; - } + return ret; + } - protected virtual string TransformSimpleKey(string key) - { - key = Camelize(key); - return _sequenceInfo.TransformKey(key); - } + protected virtual string TransformSimpleKey(string key) + { + key = Camelize(key); + return _sequenceInfo.TransformKey(key); + } - protected virtual bool IsTransformedEnumValue(string key) - { - key = Camelize(key); - if (_sequenceInfo.IsTransformedEnum(key)) + protected virtual bool IsTransformedEnumValue(string key) { - return true; + key = Camelize(key); + if (_sequenceInfo.IsTransformedEnum(key)) + { + return true; + } + return false; } - return false; - } - protected virtual object TransformPotentialEnumValue(string key, object value) - { - key = Camelize(key); - //Console.WriteLine("transforming enum value...." + (value.GetType().Name)); - if (_sequenceInfo.IsTransformedEnum(key)) + protected virtual object TransformPotentialEnumValue(string key, object value) { - //Console.WriteLine("transforming enum value...."); - key = Camelize(key); - return _sequenceInfo.TransformEnumValue(key, value.ToString()); + //Console.WriteLine("transforming enum value...." + (value.GetType().Name)); + if (_sequenceInfo.IsTransformedEnum(key)) + { + //Console.WriteLine("transforming enum value...."); + + key = Camelize(key); + return _sequenceInfo.TransformEnumValue(key, value.ToString()); + } + return value; } - return value; - } - private SequenceInfo _sequenceInfo = null; + private SequenceInfo _sequenceInfo = null; - protected virtual SequenceInfo BuildSequenceInfo(int startSequence) - { - SequenceInfo info = new SequenceInfo(startSequence); - var props = this.GetType().GetProperties(System.Reflection.BindingFlags.Public | - System.Reflection.BindingFlags.Instance | - System.Reflection.BindingFlags.FlattenHierarchy); - foreach (var prop in props) + protected virtual SequenceInfo BuildSequenceInfo(int startSequence) { - bool isParam = false; - string wcName = null; - foreach (var attr in prop.GetCustomAttributes(true)) + SequenceInfo info = new SequenceInfo(startSequence); + var props = this.GetType().GetProperties(System.Reflection.BindingFlags.Public | + System.Reflection.BindingFlags.Instance | + System.Reflection.BindingFlags.FlattenHierarchy); + foreach (var prop in props) { - if (attr.GetType().Name == "ParameterAttribute") - { - isParam = true; - } - if (attr.GetType().Name == "WCWidgetMemberNameAttribute") - { - var wc = (WCWidgetMemberNameAttribute)attr; - wcName = Camelize(wc.Name); - } - if (attr.GetType().Name == "WCAttributeNameAttribute") + bool isParam = false; + string wcName = null; + foreach (var attr in prop.GetCustomAttributes(true)) { - var wc = (WCAttributeNameAttribute)attr; - wcName = wc.Name; - } + if (attr.GetType().Name == "ParameterAttribute") + { + isParam = true; + } + if (attr.GetType().Name == "WCWidgetMemberNameAttribute") + { + var wc = (WCWidgetMemberNameAttribute)attr; + wcName = Camelize(wc.Name); + } + if (attr.GetType().Name == "WCAttributeNameAttribute") + { + var wc = (WCAttributeNameAttribute)attr; + wcName = wc.Name; + } } - var pType = prop.PropertyType; - Dictionary wcEnumTransform = null; - if (pType != null) - { - if (pType.IsEnum) + var pType = prop.PropertyType; + Dictionary wcEnumTransform = null; + if (pType != null) { - - foreach (var f in pType.GetFields()) + if (pType.IsEnum) { - if (f.IsPublic && !f.IsSpecialName) + + foreach (var f in pType.GetFields()) { - foreach (var attr in f.GetCustomAttributes(true)) + if (f.IsPublic && !f.IsSpecialName) { - if (attr.GetType().Name == "WCEnumNameAttribute") + foreach (var attr in f.GetCustomAttributes(true)) { - if (wcEnumTransform == null) + if (attr.GetType().Name == "WCEnumNameAttribute") { - wcEnumTransform = new Dictionary(); + if (wcEnumTransform == null) + { + wcEnumTransform = new Dictionary(); + } + var wc = (WCEnumNameAttribute)attr; + var wcEnumName = Camelize(wc.Name); + wcEnumTransform.Add(f.Name.ToLower(), wcEnumName); } - var wc = (WCEnumNameAttribute)attr; - var wcEnumName = Camelize(wc.Name); - wcEnumTransform.Add(f.Name.ToLower(), wcEnumName); } } } } } - } - if (isParam) - { - info.AddSequence(Camelize(prop.Name), wcName, wcEnumTransform); + if (isParam) + { + info.AddSequence(Camelize(prop.Name), wcName, wcEnumTransform); + } } - } - - return info; - } - protected override void BuildRenderTree(RenderTreeBuilder builder) - { - string spinalName = ToSpinal(this.Type); - string className = "igb-" + spinalName; - if (Class != null) - { - className = Class; + return info; } - if (UseDirectRender) + protected override void BuildRenderTree(RenderTreeBuilder builder) { - builder.OpenElement(0, DirectRenderElementName); - builder.AddAttribute(1, "class", className); - var attributes = GatherSimpleAttributes(); - builder.AddAttribute(2, "data-ig-id", _containerId); - - EnsureSequenceInfo(); - foreach (var key in _sequenceInfo.AttributeKeys) + string spinalName = ToSpinal(this.Type); + string className = "igb-" + spinalName; + if (Class != null) { - if (attributes.ContainsKey(key)) - { - var sequence = _sequenceInfo.GetSequence(key); - var tKey = TransformSimpleKey(key); + className = Class; + } + + if (UseDirectRender) + { + builder.OpenElement(0, DirectRenderElementName); + builder.AddAttribute(1, "class", className); + var attributes = GatherSimpleAttributes(); + builder.AddAttribute(2, "data-ig-id", _containerId); - var val = attributes[key]; - if (val is bool) + EnsureSequenceInfo(); + foreach (var key in _sequenceInfo.AttributeKeys) + { + if (attributes.ContainsKey(key)) { - if ((bool)val == false) + var sequence = _sequenceInfo.GetSequence(key); + var tKey = TransformSimpleKey(key); + + var val = attributes[key]; + if (val is bool) { - continue; + if ((bool)val == false) + { + continue; + } } - } - var attributeVal = attributes[key]; - if (IsTransformedEnumValue(key)) - { - attributeVal = TransformPotentialEnumValue(key, attributeVal); + var attributeVal = attributes[key]; + if (IsTransformedEnumValue(key)) + { + attributeVal = TransformPotentialEnumValue(key, attributeVal); + } + //Console.WriteLine("adding attribute: " + tKey + ", " + attributes[key]); + builder.AddAttribute(sequence, ToSpinal(ToPascal(tKey)), attributeVal); } - //Console.WriteLine("adding attribute: " + tKey + ", " + attributes[key]); - builder.AddAttribute(sequence, ToSpinal(ToPascal(tKey)), attributeVal); } + + builder.AddMultipleAttributes(4 + _sequenceInfo.MaxSequence, AdditionalAttributes); + + builder.AddElementReferenceCapture(5 + 15 + _sequenceInfo.MaxSequence, delegate (ElementReference value) + { + contEle = value; + }); + + //builder.AddMarkupContent(6 + 15 + _sequenceInfo.MaxSequence, "\r\n "); + builder.OpenComponent>(6); // TODO: This '6' here might be a bug because it doesn't seem to match the other line sequence numbers + builder.AddAttribute(7 + 15 + _sequenceInfo.MaxSequence, "Value", this); + builder.AddAttribute(8 + 15 + _sequenceInfo.MaxSequence, "Name", ParentTypeName); + builder.AddAttribute(9 + 15 + _sequenceInfo.MaxSequence, "ChildContent", (RenderFragment)delegate (RenderTreeBuilder builder2) + { + //builder2.AddMarkupContent(10 + 15 + _sequenceInfo.MaxSequence, "\r\n "); + builder2.AddContent(11 + 15 + _sequenceInfo.MaxSequence, ChildContent); + //builder2.AddMarkupContent(12 + 15 + _sequenceInfo.MaxSequence, "\r\n "); + }); + builder.CloseComponent(); + //builder.AddMarkupContent(13 + 15 + _sequenceInfo.MaxSequence, "\r\n"); + + builder.CloseElement(); + return; + } + + //Console.WriteLine("rendering"); + var width = Width; + var height = Height; + var display = "block"; + bool hasSize = false; + if ((width != "" && width != null) || + (height != "" && height != null)) + { + hasSize = true; } - builder.AddMultipleAttributes(4 + _sequenceInfo.MaxSequence, AdditionalAttributes); + display = ResolveDisplay(); - - builder.AddElementReferenceCapture(5 + 15 + _sequenceInfo.MaxSequence, delegate(ElementReference value) + builder.OpenElement(0, "div"); + builder.AddAttribute(1, "class", className); + if (hasSize) { - contEle = value; - }); + builder.AddAttribute(2, "style", "width: " + Width + "; height: " + Height + "; display: " + display + "; padding: 0px;"); + } + else + { + builder.AddAttribute(2, "style", "display: " + display + "; padding: 0px;"); + } + builder.AddMultipleAttributes(3, AdditionalAttributes); + + builder.OpenElement(4, "igc-component-renderer-container"); + builder.AddAttribute(5, "data-ig-id", _containerId); + //if (hasSize) + { + builder.AddAttribute(6, "style", "width: 100%; height: 100%; display: " + display + ";"); + } - - //builder.AddMarkupContent(6 + 15 + _sequenceInfo.MaxSequence, "\r\n "); - builder.OpenComponent>(6); // TODO: This '6' here might be a bug because it doesn't seem to match the other line sequence numbers - builder.AddAttribute(7 + 15 + _sequenceInfo.MaxSequence, "Value", this); - builder.AddAttribute(8 + 15 + _sequenceInfo.MaxSequence, "Name", ParentTypeName); - builder.AddAttribute(9 + 15 + _sequenceInfo.MaxSequence, "ChildContent", (RenderFragment)delegate(RenderTreeBuilder builder2) + // if (SupportsVisualChildren) { + // builder.AddAttribute(7, "shadow-dom-mode", true); + // builder.AddAttribute(8, "child-content-mode", true); + // } + + if (SupportsVisualChildren) + { + builder.AddAttribute(7, "portal-mode", true); + } + + // else + // { + // builder.AddAttribute(4, "style", "display: " + display + ";"); + // } + + builder.AddElementReferenceCapture(9, delegate (ElementReference value) { - //builder2.AddMarkupContent(10 + 15 + _sequenceInfo.MaxSequence, "\r\n "); - builder2.AddContent(11 + 15 + _sequenceInfo.MaxSequence, ChildContent); - //builder2.AddMarkupContent(12 + 15 + _sequenceInfo.MaxSequence, "\r\n "); + contEle = value; }); - builder.CloseComponent(); - //builder.AddMarkupContent(13 + 15 + _sequenceInfo.MaxSequence, "\r\n"); builder.CloseElement(); - return; - } - //Console.WriteLine("rendering"); - var width = Width; - var height = Height; - var display = "block"; - bool hasSize = false; - if ((width != "" && width != null) || - (height != "" && height != null)) - { - hasSize = true; - } + builder.AddMarkupContent(10, "\r\n "); + if (!SupportsVisualChildren) + { + builder.OpenElement(11, "div"); + builder.AddAttribute(12, "class", "ig-hidden-content"); + builder.AddAttribute(13, "style", "display: none"); + builder.AddMarkupContent(14, "\r\n"); + builder.OpenComponent>(10); + builder.AddAttribute(15, "Value", this); + builder.AddAttribute(16, "Name", ParentTypeName); + builder.AddAttribute(17, "ChildContent", (RenderFragment)delegate (RenderTreeBuilder builder2) + { + builder2.AddMarkupContent(18, "\r\n "); + builder2.AddContent(19, ChildContent); + builder2.AddMarkupContent(20, "\r\n "); + }); + builder.CloseComponent(); + builder.CloseElement(); + } + builder.AddMarkupContent(21, "\r\n"); - display = ResolveDisplay(); + if (SupportsVisualChildren) + { + builder.OpenComponent>(10); + builder.AddAttribute(22, "Value", this); + builder.AddAttribute(23, "Name", ParentTypeName); + builder.AddAttribute(24, "ChildContent", (RenderFragment)delegate (RenderTreeBuilder builder2) + { + builder2.AddMarkupContent(25, "\r\n "); + builder2.OpenElement(26, "igc-portal-entrance"); + builder2.AddAttribute(27, "portal-id", "portal-" + _containerId); + builder2.AddAttribute(28, "move-once-mode", "true"); + builder2.AddContent(29, ChildContent); + builder2.CloseElement(); + builder2.AddMarkupContent(30, "\r\n "); + }); + builder.CloseComponent(); + builder.AddMarkupContent(31, "\r\n"); + } + + if (NeedsDynamicContent) + { + builder.OpenComponent(32); + builder.AddComponentReferenceCapture(33, delegate (object __value) + { + Holder = (DynamicContentHolder)__value; + }); + builder.CloseComponent(); + builder.AddMarkupContent(34, "\r\n"); + } + builder.CloseElement(); + } - builder.OpenElement(0, "div"); - builder.AddAttribute(1, "class", className); - if (hasSize) + internal Dictionary[] DeserializeDictionaryArray(string batch) { - builder.AddAttribute(2, "style", "width: " + Width + "; height: " + Height + "; display: " + display + "; padding: 0px;"); + return JsonSerializer.Deserialize[]>(batch, SerializerOptions); } - else - { - builder.AddAttribute(2, "style", "display: " + display + "; padding: 0px;"); - } - builder.AddMultipleAttributes(3, AdditionalAttributes); - - builder.OpenElement(4, "igc-component-renderer-container"); - builder.AddAttribute(5, "data-ig-id", _containerId); - //if (hasSize) - { - builder.AddAttribute(6, "style", "width: 100%; height: 100%; display: " + display + ";"); - } - - // if (SupportsVisualChildren) { - // builder.AddAttribute(7, "shadow-dom-mode", true); - // builder.AddAttribute(8, "child-content-mode", true); - // } - - if (SupportsVisualChildren) { - builder.AddAttribute(7, "portal-mode", true); - } - - // else - // { - // builder.AddAttribute(4, "style", "display: " + display + ";"); - // } - builder.AddElementReferenceCapture(9, delegate(ElementReference value) - { - contEle = value; - }); - - builder.CloseElement(); + private Dictionary _dynamicContentInfos = new Dictionary(); - builder.AddMarkupContent(10, "\r\n "); - if (!SupportsVisualChildren) + private Dictionary _contentTemplates = new Dictionary(); + private Dictionary _contentTemplateTypes = new Dictionary(); + internal void UpdateTemplate(string templateId, object template, Type type) { - builder.OpenElement(11, "div"); - builder.AddAttribute(12, "class", "ig-hidden-content"); - builder.AddAttribute(13, "style", "display: none"); - builder.AddMarkupContent(14, "\r\n"); - builder.OpenComponent>(10); - builder.AddAttribute(15, "Value", this); - builder.AddAttribute(16, "Name", ParentTypeName); - builder.AddAttribute(17, "ChildContent", (RenderFragment)delegate(RenderTreeBuilder builder2) - { - builder2.AddMarkupContent(18, "\r\n "); - builder2.AddContent(19, ChildContent); - builder2.AddMarkupContent(20, "\r\n "); - }); - builder.CloseComponent(); - builder.CloseElement(); + _contentTemplates[templateId] = template; + _contentTemplateTypes[templateId] = type; } - builder.AddMarkupContent(21, "\r\n"); - - if (SupportsVisualChildren) + internal object FindTemplate(string templateId) { - builder.OpenComponent>(10); - builder.AddAttribute(22, "Value", this); - builder.AddAttribute(23, "Name", ParentTypeName); - builder.AddAttribute(24, "ChildContent", (RenderFragment)delegate(RenderTreeBuilder builder2) + if (_contentTemplates.ContainsKey(templateId)) { - builder2.AddMarkupContent(25, "\r\n "); - builder2.OpenElement(26, "igc-portal-entrance"); - builder2.AddAttribute(27, "portal-id", "portal-" + _containerId); - builder2.AddAttribute(28, "move-once-mode", "true"); - builder2.AddContent(29, ChildContent); - builder2.CloseElement(); - builder2.AddMarkupContent(30, "\r\n "); - }); - builder.CloseComponent(); - builder.AddMarkupContent(31, "\r\n"); - } - - if (NeedsDynamicContent) - { - builder.OpenComponent(32); - builder.AddComponentReferenceCapture(33, delegate(object __value) - { - Holder = (DynamicContentHolder)__value; - }); - builder.CloseComponent(); - builder.AddMarkupContent(34, "\r\n"); - } - builder.CloseElement(); - } - - - - internal Dictionary[] DeserializeDictionaryArray(string batch) - { - return JsonSerializer.Deserialize[]>(batch, SerializerOptions); - } - - private Dictionary _dynamicContentInfos = new Dictionary(); - - private Dictionary _contentTemplates = new Dictionary(); - private Dictionary _contentTemplateTypes = new Dictionary(); - internal void UpdateTemplate(string templateId, object template, Type type) - { - _contentTemplates[templateId] = template; - _contentTemplateTypes[templateId] = type; - } - - internal object FindTemplate(string templateId) - { - if (_contentTemplates.ContainsKey(templateId)) - { - return _contentTemplates[templateId]; + return _contentTemplates[templateId]; + } + return null; } - return null; - } - internal void AdjustDynamicContent(string containerId, string contentType, string templateId, string contentId, string actionType, string args) - { - switch (actionType) + internal void AdjustDynamicContent(string containerId, string contentType, string templateId, string contentId, string actionType, string args) { - case "Add": + switch (actionType) { - DynamicContentInfo dynamicContent = BuildDynamicContentInfo(contentType, templateId); - if (dynamicContent == null) - { - return; - } - dynamicContent.Owner = this; - dynamicContent.RefName = contentId; - _dynamicContentInfos[contentId] = dynamicContent; - - var template = FindTemplate(templateId); - if (template == null) - { - return; - } - else + case "Add": { - dynamicContent.UpdateTemplate(template); - } + DynamicContentInfo dynamicContent = BuildDynamicContentInfo(contentType, templateId); + if (dynamicContent == null) + { + return; + } + dynamicContent.Owner = this; + dynamicContent.RefName = contentId; + _dynamicContentInfos[contentId] = dynamicContent; - Holder.AddDynamicContent(dynamicContent); - break; - } - case "Remove": - { - if (_dynamicContentInfos.ContainsKey(contentId)) + var template = FindTemplate(templateId); + if (template == null) + { + return; + } + else + { + dynamicContent.UpdateTemplate(template); + } + + Holder.AddDynamicContent(dynamicContent); + break; + } + case "Remove": { - DynamicContentInfo dynamicContent = _dynamicContentInfos[contentId]; - _dynamicContentInfos.Remove(contentId); - Holder.RemoveDynamicContent(dynamicContent); + if (_dynamicContentInfos.ContainsKey(contentId)) + { + DynamicContentInfo dynamicContent = _dynamicContentInfos[contentId]; + _dynamicContentInfos.Remove(contentId); + Holder.RemoveDynamicContent(dynamicContent); + } + break; } - break; - } - case "Update": - { - if (_dynamicContentInfos.ContainsKey(contentId)) + case "Update": { - DynamicContentInfo dynamicContent = _dynamicContentInfos[contentId]; - - object context = null; - if (args != null) + if (_dynamicContentInfos.ContainsKey(contentId)) { - var argsDic = JsonSerializer.Deserialize>(args, SerializerOptions); - context = ConvertReturnValue(argsDic); + DynamicContentInfo dynamicContent = _dynamicContentInfos[contentId]; + + object context = null; + if (args != null) + { + var argsDic = JsonSerializer.Deserialize>(args, SerializerOptions); + context = ConvertReturnValue(argsDic); + } + dynamicContent.UpdateContext(context); } - dynamicContent.UpdateContext(context); + break; } - break; - } + } } - } - protected Type TemplateContentType(string templateId) - { - if (!_contentTemplateTypes.ContainsKey(templateId)) + protected Type TemplateContentType(string templateId) { - return null; - } + if (!_contentTemplateTypes.ContainsKey(templateId)) + { + return null; + } - return _contentTemplateTypes[templateId]; - } + return _contentTemplateTypes[templateId]; + } - - private Dictionary> _dynamicContentBuilders = new Dictionary>(); - private DynamicContentInfo BuildDynamicContentInfo(string contentType, string templateId) - { - var templateContentType = TemplateContentType(templateId); - if (templateContentType != null) + private Dictionary> _dynamicContentBuilders = new Dictionary>(); + private DynamicContentInfo BuildDynamicContentInfo(string contentType, string templateId) { - if (!_dynamicContentBuilders.ContainsKey(templateContentType)) + var templateContentType = TemplateContentType(templateId); + if (templateContentType != null) { - if (contentType == "TemplateContent" && templateContentType != null) + if (!_dynamicContentBuilders.ContainsKey(templateContentType)) { - var createType = typeof(DynamicContentInfo<>).MakeGenericType(templateContentType); - var nonGen = typeof(DynamicContentInfo); - System.Linq.Expressions.NewExpression newExp = System.Linq.Expressions.Expression.New(createType); - System.Linq.Expressions.UnaryExpression conversion = System.Linq.Expressions.Expression.Convert(newExp, nonGen); + if (contentType == "TemplateContent" && templateContentType != null) + { + var createType = typeof(DynamicContentInfo<>).MakeGenericType(templateContentType); + var nonGen = typeof(DynamicContentInfo); + System.Linq.Expressions.NewExpression newExp = System.Linq.Expressions.Expression.New(createType); + System.Linq.Expressions.UnaryExpression conversion = System.Linq.Expressions.Expression.Convert(newExp, nonGen); - var getNew = (Func)System.Linq.Expressions.Expression.Lambda(conversion).Compile(); - _dynamicContentBuilders[templateContentType] = getNew; - } - else - { - //TODO: other types - _dynamicContentBuilders[templateContentType] = () => null; + var getNew = (Func)System.Linq.Expressions.Expression.Lambda(conversion).Compile(); + _dynamicContentBuilders[templateContentType] = getNew; + } + else + { + //TODO: other types + _dynamicContentBuilders[templateContentType] = () => null; + } } } - } - else - { - //TODO: other types - _dynamicContentBuilders[templateContentType] = () => null; - } + else + { + //TODO: other types + _dynamicContentBuilders[templateContentType] = () => null; + } - return _dynamicContentBuilders[templateContentType](); - } + return _dynamicContentBuilders[templateContentType](); + } - protected virtual bool NeedsDynamicContent - { - get + protected virtual bool NeedsDynamicContent { - return false; + get + { + return false; + } } - } - private DynamicContentHolder Holder { get; set; } + private DynamicContentHolder Holder { get; set; } - protected override async Task OnAfterRenderAsync(bool firstRender) { - if (firstRender) + protected override async Task OnAfterRenderAsync(bool firstRender) { - MarkContentDirty(); - EnsureReady(); + if (firstRender) + { + MarkContentDirty(); + EnsureReady(); + } } - } - //protected override void OnParametersSet() - //{ - // Console.WriteLine("on parameters set"); - //} - // protected override bool ShouldRender() - // { - // return false; - // } + //protected override void OnParametersSet() + //{ + // Console.WriteLine("on parameters set"); + //} + // protected override bool ShouldRender() + // { + // return false; + // } - public async Task EnsureReady() { - if (!IgBlazor.IsRuntimeValid(_shouldReevaluateRuntime)) { - return; - } + public async Task EnsureReady() + { + if (!IgBlazor.IsRuntimeValid(_shouldReevaluateRuntime)) + { + return; + } - //Console.WriteLine("ensuring ready: " + this.GetType().Name); - while (!this._ready) { - bool ready = await JsRuntime.InvokeAsync("igCheckReady", new object[] { _containerId }); - //Console.WriteLine(ready + " -> " + this.GetType().Name); - if (ready) + //Console.WriteLine("ensuring ready: " + this.GetType().Name); + while (!this._ready) { - await JsRuntime.InvokeVoidAsync("igWaitForLoaded"); - OnReady(); - break; + bool ready = await JsRuntime.InvokeAsync("igCheckReady", new object[] { _containerId }); + //Console.WriteLine(ready + " -> " + this.GetType().Name); + if (ready) + { + await JsRuntime.InvokeVoidAsync("igWaitForLoaded"); + OnReady(); + break; + } + await Task.Delay(100); } - await Task.Delay(100); } - } - - internal void OnReady() { - this._ready = true; - QueueUpdate(); - } - - protected internal void MarkPropDirty(string propertyName) { - _isDirty[propertyName] = true; - _hasDirty = true; - _serializeDirty = true; - //Console.WriteLine("dirty: " + propertyName); - MarkContentDirty(); - } + internal void OnReady() + { + this._ready = true; - private bool _isContentDirty = false; - private void MarkContentDirty() { - if (!_isContentDirty) { - //Console.WriteLine("sending message"); - _isContentDirty = true; - SendDescriptionMessage(); + QueueUpdate(); } - } - private void SendDescriptionMessage() { - if (disposedValue) + protected internal void MarkPropDirty(string propertyName) { - return; + _isDirty[propertyName] = true; + _hasDirty = true; + _serializeDirty = true; + //Console.WriteLine("dirty: " + propertyName); + MarkContentDirty(); } - RendererMessage m = new RendererMessage(); - m.Type = ("description"); - _messageQueue.AddLast(m); - QueueUpdate(); - } - internal void OnPropertyPropagatedOut(string name, string propertyName) - { - var camelName = propertyName.Substring(0, 1).ToLower() + propertyName.Substring(1); - SendImmediateDeltaDescription((n, p) => n == name && p == camelName); - } - - private void SendImmediateDeltaDescription(SerializationFilter filter) - { - using(var stream = new MemoryStream()) + private bool _isContentDirty = false; + private void MarkContentDirty() { - using (Utf8JsonWriter uw = new Utf8JsonWriter(stream)) + if (!_isContentDirty) { - SerializationContext c = new SerializationContext(uw, filter); - Serialize(c); - - RendererMessage m = new RendererMessage(); - m.Type = "descriptionDelta"; - m.SetData("skipApply", "true"); - - uw.Flush(); - var desc = Encoding.UTF8.GetString(stream.ToArray()); - m.SetData("description", desc); - - SendMessageImmediate(m); + //Console.WriteLine("sending message"); + _isContentDirty = true; + SendDescriptionMessage(); } } - } - - protected bool IsPropDirty(String propertyName) { - if (_isDirty.ContainsKey(propertyName)) { - return _isDirty[propertyName]; - } - - return false; - } - internal void ChildDirty(object child) { - _serializeDirty = true; - MarkContentDirty(); - } - - internal virtual void SerializeCore(RendererSerializer ser) { - ser.AddStringProp("name", "mainControl"); - } - - protected String _cachedSerializedContent = ""; - - public virtual string Type - { - get + private void SendDescriptionMessage() { - var typeName = (this.GetType().Name.Replace("View", "View")); - if (typeName.StartsWith("Igb")) + if (disposedValue) { - typeName = typeName.Substring(3); + return; } - return typeName; + RendererMessage m = new RendererMessage(); + m.Type = ("description"); + _messageQueue.AddLast(m); + QueueUpdate(); } - } - public void Serialize(SerializationContext context, string propertyName = null) { - RendererSerializer ser = new RendererSerializer(context, this, Name); - ser.Type = Type; - ser.Start(propertyName); - SerializeCore(ser); - ser.End(); - } + internal void OnPropertyPropagatedOut(string name, string propertyName) + { + var camelName = propertyName.Substring(0, 1).ToLower() + propertyName.Substring(1); + SendImmediateDeltaDescription((n, p) => n == name && p == camelName); + } - public string Serialize() - { - if (_serializeDirty) { - using(var stream = new MemoryStream()) + private void SendImmediateDeltaDescription(SerializationFilter filter) + { + using (var stream = new MemoryStream()) { using (Utf8JsonWriter uw = new Utf8JsonWriter(stream)) { - SerializationContext c = new SerializationContext(uw, null); - //RendererSerializer ser = new RendererSerializer(uw); - + SerializationContext c = new SerializationContext(uw, filter); Serialize(c); + + RendererMessage m = new RendererMessage(); + m.Type = "descriptionDelta"; + m.SetData("skipApply", "true"); + uw.Flush(); - _cachedSerializedContent = Encoding.UTF8.GetString(stream.ToArray()); + var desc = Encoding.UTF8.GetString(stream.ToArray()); + m.SetData("description", desc); + + SendMessageImmediate(m); } } - _serializeDirty = false; } - return _cachedSerializedContent; - } - - //private Dictionary _methodSemaphores = new Dictionary(); - private Dictionary _methodReturns = new Dictionary(); - private Object _semLock = new Object(); - - static long _invokeId = 0; - protected async Task InvokeMethod(string methodName, object[] arguments, string[] types, ElementReference[] nativeElements = null) { - return await InvokeMethodHelper(null, methodName, arguments, types, nativeElements); - } - - protected object InvokeMethodSync(string methodName, object[] arguments, string[] types, ElementReference[] nativeElements = null) { - return InvokeMethodHelperSync(null, methodName, arguments, types, nativeElements); - } - private JsonSerializerOptions _serializerOptions = null; - private JsonSerializerOptions SerializerOptions - { - get + protected bool IsPropDirty(String propertyName) { - if (_serializerOptions == null) + if (_isDirty.ContainsKey(propertyName)) { - var def = IgBlazor.Settings.JsonSerializerOptions; - var options = new JsonSerializerOptions(); - options.MaxDepth = def.MaxDepth; - _serializerOptions = options; + return _isDirty[propertyName]; } - return _serializerOptions; - } - } - internal object InvokeMethodHelperSync(string target, string methodName, object[] arguments, string[] types, ElementReference[] nativeElements) { - if (!_ready) { - throw new InvalidOperationException("cannot invoke method until main component is ready."); + return false; } - if (JsInProcessRuntime == null) + + internal void ChildDirty(object child) { - throw new InvalidOperationException("cannot synchronously invoke a method without IJSInProcessRuntime"); - } - RendererMessage m = new RendererMessage(); - m.Type = ("invokeMethod"); - string[] args = new string[arguments.Length]; - string[] typeStrings = new string[arguments.Length]; - long invokeId = _invokeId++; - for (int i = 0; i < arguments.Length; i++) { - args[i] = GetStringArg(arguments[i], types[i]); - typeStrings[i] = "\"" + types[i] + "\""; - } - m.SetData("isSync", "true"); - m.SetData("methodName", "\"" + methodName + "\""); - if (target != null) { - m.SetData("target", "\"" + target + "\""); + _serializeDirty = true; + MarkContentDirty(); } - m.SetData("invokeId", ((long)invokeId).ToString()); - m.SetData("arguments", "[" + String.Join(", ", args) + "]"); - m.SetData("types", "[" + String.Join(", ", typeStrings) + "]"); - m.NativeElements = nativeElements; - var ret = SendMessageSyncImmediate(m); - if (ret is JsonElement && ((JsonElement)ret).ValueKind == JsonValueKind.String) + internal virtual void SerializeCore(RendererSerializer ser) { - var str = ((JsonElement)ret).GetString(); - var retDict = JsonSerializer.Deserialize>(str, SerializerOptions); + ser.AddStringProp("name", "mainControl"); + } - if (retDict.ContainsKey("retType") && - retDict["retType"] is JsonElement && - ((JsonElement)retDict["retType"]).GetString() == "promise") + protected String _cachedSerializedContent = ""; + + public virtual string Type + { + get { - throw new Exception($"Invocation of method \"{methodName}\" returned a promise. Please use the async version of the method to get the value."); + var typeName = (this.GetType().Name.Replace("View", "View")); + if (typeName.StartsWith("Igb")) + { + typeName = typeName.Substring(3); + } + return typeName; } - - ret = retDict; } - //Console.WriteLine("got return"); - //Console.WriteLine(ret); - return ret; - - } - - - Dictionary> _methodTasks = new Dictionary>(); - internal async Task InvokeMethodHelper(string target, string methodName, object[] arguments, string[] types, ElementReference[] nativeElements) { - if (!_ready) { - throw new InvalidOperationException("cannot invoke method until main component is ready."); - } - RendererMessage m = new RendererMessage(); - m.Type = ("invokeMethod"); - string[] args = new string[arguments.Length]; - string[] typeStrings = new string[arguments.Length]; - long invokeId = _invokeId++; - for (int i = 0; i < arguments.Length; i++) { - args[i] = GetStringArg(arguments[i], types[i]); - typeStrings[i] = "\"" + types[i] + "\""; - } - m.SetData("methodName", "\"" + methodName + "\""); - if (target != null) { - m.SetData("target", "\"" + target + "\""); + public void Serialize(SerializationContext context, string propertyName = null) + { + RendererSerializer ser = new RendererSerializer(context, this, Name); + ser.Type = Type; + ser.Start(propertyName); + SerializeCore(ser); + ser.End(); } - m.SetData("invokeId", ((long)invokeId).ToString()); - m.SetData("arguments", "[" + String.Join(", ", args) + "]"); - m.SetData("types", "[" + String.Join(", ", typeStrings) + "]"); - m.NativeElements = nativeElements; - var ret = await SendMessageImmediate(m); - - TaskCompletionSource tcs = new TaskCompletionSource(); - _methodTasks.Add(invokeId, tcs); - if (ret is JsonElement && ((JsonElement)ret).ValueKind == JsonValueKind.String) + public string Serialize() { - var str = ((JsonElement)ret).GetString(); - var retDict = JsonSerializer.Deserialize>(str, SerializerOptions); - ret = retDict; - - if (retDict.ContainsKey("retType") && - retDict["retType"] is JsonElement && - ((JsonElement)retDict["retType"]).GetString() == "promise") + if (_serializeDirty) { - // did we already get a value returned for this method invoke before we could start up a task? - if (_methodReturns.ContainsKey(invokeId)) + using (var stream = new MemoryStream()) { - tcs.SetResult(_methodReturns[invokeId]); + using (Utf8JsonWriter uw = new Utf8JsonWriter(stream)) + { + SerializationContext c = new SerializationContext(uw, null); + //RendererSerializer ser = new RendererSerializer(uw); + + Serialize(c); + uw.Flush(); + _cachedSerializedContent = Encoding.UTF8.GetString(stream.ToArray()); + } } + _serializeDirty = false; } - else - { - tcs.SetResult(ret); - } + return _cachedSerializedContent; } - var result = await tcs.Task; - - _methodTasks.Remove(invokeId); - _methodReturns.Remove(invokeId); - return result; - } + //private Dictionary _methodSemaphores = new Dictionary(); + private Dictionary _methodReturns = new Dictionary(); + private Object _semLock = new Object(); - private string GetStringArg(object argument, string type) { - if (argument == null) { - return null; + static long _invokeId = 0; + protected async Task InvokeMethod(string methodName, object[] arguments, string[] types, ElementReference[] nativeElements = null) + { + return await InvokeMethodHelper(null, methodName, arguments, types, nativeElements); } - if (type == "Number" && argument is double && - double.IsNaN((double)argument)) + + protected object InvokeMethodSync(string methodName, object[] arguments, string[] types, ElementReference[] nativeElements = null) { - return null; + return InvokeMethodHelperSync(null, methodName, arguments, types, nativeElements); } - if (type == "Date") + + private JsonSerializerOptions _serializerOptions = null; + private JsonSerializerOptions SerializerOptions { - if (argument is DateTime) + get { - argument = DateToString((DateTime)argument); + if (_serializerOptions == null) + { + var def = IgBlazor.Settings.JsonSerializerOptions; + var options = new JsonSerializerOptions(); + options.MaxDepth = def.MaxDepth; + _serializerOptions = options; + } + return _serializerOptions; } - return "\"" + argument.ToString() + "\""; } - if (type == "NumberArray") + + internal object InvokeMethodHelperSync(string target, string methodName, object[] arguments, string[] types, ElementReference[] nativeElements) { - var str = "["; - if (argument is int[]) + if (!_ready) { - var values = (int[])argument; - for (int i = 0; i < values.Length; i++) - { - if (i > 0) - { - str += ","; - } - str += values[i].ToString(); - } + throw new InvalidOperationException("cannot invoke method until main component is ready."); } - if (argument is double[]) + if (JsInProcessRuntime == null) { - var values = (double[])argument; - for (int i = 0; i < values.Length; i++) - { - if (i > 0) - { - str += ","; - } - str += values[i].ToString(); - } + throw new InvalidOperationException("cannot synchronously invoke a method without IJSInProcessRuntime"); } - str += "]"; - return str; - } - if (type == "StringArray") - { - var str = "["; - var values = (string[])argument; - for (int i = 0; i < values.Length; i++) + RendererMessage m = new RendererMessage(); + m.Type = ("invokeMethod"); + string[] args = new string[arguments.Length]; + string[] typeStrings = new string[arguments.Length]; + long invokeId = _invokeId++; + for (int i = 0; i < arguments.Length; i++) { - if (i > 0) - { - str += ","; - } - str += "\"" + values[i].ToString() + "\""; + args[i] = GetStringArg(arguments[i], types[i]); + typeStrings[i] = "\"" + types[i] + "\""; } - str += "]"; - return str; - } - if (type == "DateArray") - { - var str = "["; - var values = (DateTime[])argument; - for (int i = 0; i < values.Length; i++) + m.SetData("isSync", "true"); + m.SetData("methodName", "\"" + methodName + "\""); + if (target != null) { - if (i > 0) - { - str += ","; - } - str += "\"" + DateToString((DateTime)values[i]) + "\""; + m.SetData("target", "\"" + target + "\""); } - str += "]"; - return str; - } - if (type == "BoolArray") - { - var str = "["; - var values = (bool[])argument; - for (int i = 0; i < values.Length; i++) + m.SetData("invokeId", ((long)invokeId).ToString()); + m.SetData("arguments", "[" + String.Join(", ", args) + "]"); + m.SetData("types", "[" + String.Join(", ", typeStrings) + "]"); + m.NativeElements = nativeElements; + var ret = SendMessageSyncImmediate(m); + + if (ret is JsonElement && ((JsonElement)ret).ValueKind == JsonValueKind.String) { - if (i > 0) + var str = ((JsonElement)ret).GetString(); + var retDict = JsonSerializer.Deserialize>(str, SerializerOptions); + + if (retDict.ContainsKey("retType") && + retDict["retType"] is JsonElement && + ((JsonElement)retDict["retType"]).GetString() == "promise") { - str += ","; + throw new Exception($"Invocation of method \"{methodName}\" returned a promise. Please use the async version of the method to get the value."); } - str += values[i].ToString().ToLower(); + + ret = retDict; } - str += "]"; - return str; + //Console.WriteLine("got return"); + //Console.WriteLine(ret); + return ret; + } - - return argument.ToString(); - } - internal void OnRefChanged(string propertyName, object oldValue, object newValue, bool isScript, bool isElement, Action refChanged) { - _isDirtyRef[propertyName] = true; - _isDirty[propertyName] = true; - _hasDirty = true; - _serializeDirty = true; - string refId = _containerId + "/" + propertyName; + Dictionary> _methodTasks = new Dictionary>(); - if (newValue is LocalJson) - { - newValue = ((LocalJson)newValue).ToRef(); - } - if (newValue is RemoteJson) + internal async Task InvokeMethodHelper(string target, string methodName, object[] arguments, string[] types, ElementReference[] nativeElements) { - newValue = ((RemoteJson)newValue).ToRef(); - } + if (!_ready) + { + throw new InvalidOperationException("cannot invoke method until main component is ready."); + } + RendererMessage m = new RendererMessage(); + m.Type = ("invokeMethod"); + string[] args = new string[arguments.Length]; + string[] typeStrings = new string[arguments.Length]; + long invokeId = _invokeId++; + for (int i = 0; i < arguments.Length; i++) + { + args[i] = GetStringArg(arguments[i], types[i]); + typeStrings[i] = "\"" + types[i] + "\""; + } + m.SetData("methodName", "\"" + methodName + "\""); + if (target != null) + { + m.SetData("target", "\"" + target + "\""); + } + m.SetData("invokeId", ((long)invokeId).ToString()); + m.SetData("arguments", "[" + String.Join(", ", args) + "]"); + m.SetData("types", "[" + String.Join(", ", typeStrings) + "]"); + m.NativeElements = nativeElements; + var ret = await SendMessageImmediate(m); - // Check if the incoming object has BlazorPlainObjectAttribute - if (newValue != null) - { - var valueType = newValue.GetType(); - // Use IsDefined for better performance and only check if it implements JsonSerializable - if (newValue is JsonSerializable && Attribute.IsDefined(valueType, typeof(BlazorPlainObjectAttribute), true)) + TaskCompletionSource tcs = new TaskCompletionSource(); + _methodTasks.Add(invokeId, tcs); + + if (ret is JsonElement && ((JsonElement)ret).ValueKind == JsonValueKind.String) { - try + var str = ((JsonElement)ret).GetString(); + var retDict = JsonSerializer.Deserialize>(str, SerializerOptions); + ret = retDict; + + if (retDict.ContainsKey("retType") && + retDict["retType"] is JsonElement && + ((JsonElement)retDict["retType"]).GetString() == "promise") { - using (var stream = new System.IO.MemoryStream()) - using (var writer = new System.Text.Json.Utf8JsonWriter(stream)) + // did we already get a value returned for this method invoke before we could start up a task? + if (_methodReturns.ContainsKey(invokeId)) { - var context = new SerializationContext(writer, null); - ((JsonSerializable)newValue).Serialize(context, null); - writer.Flush(); - var json = System.Text.Encoding.UTF8.GetString(stream.ToArray()); - - // Ensure we always send syntactically valid JSON, even if nothing was written - if (string.IsNullOrWhiteSpace(json)) - { - json = "null"; - } - - // Use LocalJson to ensure proper escaping - newValue = new LocalJson(json).ToRef(); - isScript = true; + tcs.SetResult(_methodReturns[invokeId]); } } - catch (Exception ex) + else { - throw new InvalidOperationException( - $"Failed to serialize BlazorPlainObject of type {valueType.Name} for property '{propertyName}': {ex.Message}", - ex); + tcs.SetResult(ret); } } + var result = await tcs.Task; + + _methodTasks.Remove(invokeId); + _methodReturns.Remove(invokeId); + + return result; } - - if (!isElement && !isScript) + private string GetStringArg(object argument, string type) { - if (newValue is BaseRendererControl || newValue is BaseRendererElement) + if (argument == null) { - isElement = true; + return null; } - } - - if (newValue is string && ((string)newValue).StartsWith("json:::")) { - isScript = true; - } - if (newValue is string && ((string)newValue).StartsWith("localJson:::")) { - isScript = true; - } - - if (!isScript) { - if (isElement) + if (type == "Number" && argument is double && + double.IsNaN((double)argument)) { - if (newValue == null) + return null; + } + if (type == "Date") + { + if (argument is DateTime) { - refId = null; + argument = DateToString((DateTime)argument); } - else + return "\"" + argument.ToString() + "\""; + } + if (type == "NumberArray") + { + var str = "["; + if (argument is int[]) { - if (oldValue is BaseRendererElement) + var values = (int[])argument; + for (int i = 0; i < values.Length; i++) { - ((BaseRendererElement)oldValue).Parent = null; + if (i > 0) + { + str += ","; + } + str += values[i].ToString(); } - if (newValue is BaseRendererElement) - { - refId = _containerId + "/" + ((BaseRendererElement)newValue).Name; - ((BaseRendererElement)newValue).Parent = this; - } - else + } + if (argument is double[]) + { + var values = (double[])argument; + for (int i = 0; i < values.Length; i++) { - if (!((BaseRendererControl)newValue).disposedValue) + if (i > 0) { - refId = ((BaseRendererControl)newValue)._containerId; - newValue = "containerId:::" + refId; - OnRefChanged(refId, "\"" + newValue + "\""); + str += ","; } + str += values[i].ToString(); } } + str += "]"; + return str; } - else + if (type == "StringArray") { - refId = _dataSourceManager.OnRefChanged(propertyName, newValue); + var str = "["; + var values = (string[])argument; + for (int i = 0; i < values.Length; i++) + { + if (i > 0) + { + str += ","; + } + str += "\"" + values[i].ToString() + "\""; + } + str += "]"; + return str; } - } else { - var str = newValue.ToString(); - - if (str.StartsWith("event:::") || str.StartsWith("nativeEvent:::") || str.StartsWith("json:::") || str.StartsWith("localJson:::") || str.StartsWith("template:::")) + if (type == "DateArray") { - OnRefChanged(refId, "\"" + newValue.ToString() + "\""); + var str = "["; + var values = (DateTime[])argument; + for (int i = 0; i < values.Length; i++) + { + if (i > 0) + { + str += ","; + } + str += "\"" + DateToString((DateTime)values[i]) + "\""; + } + str += "]"; + return str; } - else + if (type == "BoolArray") { - OnRefChanged(refId, "\"script:::" + newValue.ToString() + "\""); + var str = "["; + var values = (bool[])argument; + for (int i = 0; i < values.Length; i++) + { + if (i > 0) + { + str += ","; + } + str += values[i].ToString().ToLower(); + } + str += "]"; + return str; } - } - refChanged(refId, oldValue, newValue); - } - internal string DateToString(DateTime val) - { - return val.ToString("o"); + return argument.ToString(); } - /// - /// Prevents data change notifications from be propagated to the component. - /// - /// The datasource that is being changed. - public void SuspendNotifications(object dataSource) - { - _dataSourceManager.SuspendNotifications(dataSource); - } - /// - /// Resumes data change notifications. - /// - /// The datasource that is being changed. - public void ResumeNotifications(object dataSource, bool notify = true) - { - _dataSourceManager.ResumeNotifications(dataSource, notify); - } + internal void OnRefChanged(string propertyName, object oldValue, object newValue, bool isScript, bool isElement, Action refChanged) + { + _isDirtyRef[propertyName] = true; + _isDirty[propertyName] = true; + _hasDirty = true; + _serializeDirty = true; + string refId = _containerId + "/" + propertyName; - public void NotifyInsertItem(object dataSource, int index, object refItem) { - if (!_dataSourceManager.HasRefId(dataSource)) { - return; - } - string refName = _dataSourceManager.GetRefId(dataSource); - if (refName == null) { - return; - } - _dataSourceManager.NotifyInsertItem(refName, index, refItem); - } + if (newValue is LocalJson) + { + newValue = ((LocalJson)newValue).ToRef(); + } + if (newValue is RemoteJson) + { + newValue = ((RemoteJson)newValue).ToRef(); + } - public void NotifyRemoveItem(object dataSource, int index, object oldItem) { - if (!_dataSourceManager.HasRefId(dataSource)) { - return; - } - string refName = _dataSourceManager.GetRefId(dataSource); - if (refName == null) { - return; - } - _dataSourceManager.NotifyRemoveItem(refName, index, oldItem); - } + // Check if the incoming object has BlazorPlainObjectAttribute + if (newValue != null) + { + var valueType = newValue.GetType(); + // Use IsDefined for better performance and only check if it implements JsonSerializable + if (newValue is JsonSerializable && Attribute.IsDefined(valueType, typeof(BlazorPlainObjectAttribute), true)) + { + try + { + using (var stream = new System.IO.MemoryStream()) + using (var writer = new System.Text.Json.Utf8JsonWriter(stream)) + { + var context = new SerializationContext(writer, null); + ((JsonSerializable)newValue).Serialize(context, null); + writer.Flush(); + var json = System.Text.Encoding.UTF8.GetString(stream.ToArray()); - public void NotifyClearItems(object dataSource) { - if (!_dataSourceManager.HasRefId(dataSource)) { - return; - } - string refName = _dataSourceManager.GetRefId(dataSource); - if (refName == null) { - return; - } - _dataSourceManager.NotifyClearItems(refName); - } + // Ensure we always send syntactically valid JSON, even if nothing was written + if (string.IsNullOrWhiteSpace(json)) + { + json = "null"; + } - public void NotifySetItem(object dataSource, int index, object oldItem, object newItem) { - if (!_dataSourceManager.HasRefId(dataSource)) { - return; - } - string refName = _dataSourceManager.GetRefId(dataSource); - if (refName == null) { - return; - } - _dataSourceManager.NotifySetItem(refName, index, oldItem, newItem); - } + // Use LocalJson to ensure proper escaping + newValue = new LocalJson(json).ToRef(); + isScript = true; + } + } + catch (Exception ex) + { + throw new InvalidOperationException( + $"Failed to serialize BlazorPlainObject of type {valueType.Name} for property '{propertyName}': {ex.Message}", + ex); + } + } + } - public void NotifyUpdateItem(object dataSource, int index, object refItem, bool syncDataOnly = false) { - if (!_dataSourceManager.HasRefId(dataSource)) { - return; - } - string refName = _dataSourceManager.GetRefId(dataSource); - if (refName == null) { - return; - } - _dataSourceManager.NotifyUpdateItem(refName, index, refItem, syncDataOnly); - } + if (!isElement && !isScript) + { + if (newValue is BaseRendererControl || newValue is BaseRendererElement) + { + isElement = true; + } + } - public void OnRefChanged(string refName, object refValue) { - RendererMessage m = new RendererMessage(); - m.Type = ("refChanged"); - m.SetData("refName", "\"" + refName + "\""); - if (refValue is IJSDataSource) { - var ds = (IJSDataSource)refValue; - var dataIntents = ds == null ? null : ds.GetDataIntentsAsJson(); - if (dataIntents != null) + if (newValue is string && ((string)newValue).StartsWith("json:::")) + { + isScript = true; + } + if (newValue is string && ((string)newValue).StartsWith("localJson:::")) { - m.SetData("dataIntents", dataIntents); + isScript = true; } - if (ds.DataSourceType == JSDataSourceType.Json) + + if (!isScript) { - if (!ds.IsSent) + if (isElement) { - ds.IsSent = true; - m.SetData("refValue", refValue == null ? "null" : ((JsonDataSource)refValue).ToJson()); - m.SetData("dateCache", refValue == null ? "null" : ((JsonDataSource)refValue).GetDateCacheAsJson()); + if (newValue == null) + { + refId = null; + } + else + { + if (oldValue is BaseRendererElement) + { + ((BaseRendererElement)oldValue).Parent = null; + } + if (newValue is BaseRendererElement) + { + refId = _containerId + "/" + ((BaseRendererElement)newValue).Name; + ((BaseRendererElement)newValue).Parent = this; + } + else + { + if (!((BaseRendererControl)newValue).disposedValue) + { + refId = ((BaseRendererControl)newValue)._containerId; + newValue = "containerId:::" + refId; + OnRefChanged(refId, "\"" + newValue + "\""); + } + } + } } else { - return; + refId = _dataSourceManager.OnRefChanged(propertyName, newValue); } } else { - var uds = (UnmarshalledDataSource)refValue; - uds.SendCreate(_containerId, refName, dataIntents); + var str = newValue.ToString(); - return; + if (str.StartsWith("event:::") || str.StartsWith("nativeEvent:::") || str.StartsWith("json:::") || str.StartsWith("localJson:::") || str.StartsWith("template:::")) + { + OnRefChanged(refId, "\"" + newValue.ToString() + "\""); + } + else + { + OnRefChanged(refId, "\"script:::" + newValue.ToString() + "\""); + } } - } else { - m.SetData("refValue", refValue == null ? "null" : refValue.ToString()); + refChanged(refId, oldValue, newValue); } - SendMessage(m); - } - void RefSink.OnRefNotifyInsertItem(IJSDataSource dataSource, string refName, int index, object refItem) { - if (dataSource.DataSourceType == JSDataSourceType.Json) + internal string DateToString(DateTime val) { - RendererMessage m = new RendererMessage(); - m.Type = ("refNotifyInsertItem"); - m.SetData("refName", "\"" + refName + "\""); - m.SetData("index", index.ToString()); - m.SetData("newItem", refItem == null ? "null" : ((JsonDataSourceItem)refItem).ToJson()); + return val.ToString("o"); + } - if (!((JsonDataSource)dataSource).DateCacheReady) - { - m.SetData("dateCache", ((JsonDataSource)dataSource).GetDateCacheAsJson()); - } - //Console.WriteLine("sending insert message"); - SendMessage(m); + /// + /// Prevents data change notifications from be propagated to the component. + /// + /// The datasource that is being changed. + public void SuspendNotifications(object dataSource) + { + _dataSourceManager.SuspendNotifications(dataSource); } - else + /// + /// Resumes data change notifications. + /// + /// The datasource that is being changed. + public void ResumeNotifications(object dataSource, bool notify = true) { - var uds = (UnmarshalledDataSource)dataSource; - uds.SendInsert(_containerId, refName, index); + _dataSourceManager.ResumeNotifications(dataSource, notify); } - } - void RefSink.OnRefNotifyRemoveItem(IJSDataSource dataSource, string refName, int index, object oldItem) { - if (dataSource.DataSourceType == JSDataSourceType.Json) + public void NotifyInsertItem(object dataSource, int index, object refItem) { - RendererMessage m = new RendererMessage(); - m.Type = ("refNotifyRemoveItem"); - m.SetData("refName", "\"" + refName + "\""); - m.SetData("index", index.ToString()); - m.SetData("oldItem", oldItem == null ? "null" : ((JsonDataSourceItem)oldItem).ToJson()); - if (!((JsonDataSource)dataSource).DateCacheReady) + if (!_dataSourceManager.HasRefId(dataSource)) { - m.SetData("dateCache", ((JsonDataSource)dataSource).GetDateCacheAsJson()); + return; } - SendMessage(m); - } - else - { - var uds = (UnmarshalledDataSource)dataSource; - uds.SendRemove(_containerId, refName, index); + string refName = _dataSourceManager.GetRefId(dataSource); + if (refName == null) + { + return; + } + _dataSourceManager.NotifyInsertItem(refName, index, refItem); } - } - void RefSink.OnRefNotifyClearItems(IJSDataSource dataSource, string refName, object refValue) { - if (dataSource.DataSourceType == JSDataSourceType.Json) + public void NotifyRemoveItem(object dataSource, int index, object oldItem) { - RendererMessage m = new RendererMessage(); - m.Type = ("refClearItems"); - m.SetData("refName", "\"" + refName + "\""); - m.SetData("refValue", refValue == null ? "null" : ((JsonDataSource)refValue).ToJson()); - if (!((JsonDataSource)dataSource).DateCacheReady) + if (!_dataSourceManager.HasRefId(dataSource)) { - m.SetData("dateCache", ((JsonDataSource)dataSource).GetDateCacheAsJson()); + return; } - SendMessage(m); + string refName = _dataSourceManager.GetRefId(dataSource); + if (refName == null) + { + return; + } + _dataSourceManager.NotifyRemoveItem(refName, index, oldItem); } - else + + public void NotifyClearItems(object dataSource) { - var uds = (UnmarshalledDataSource)dataSource; - uds.SendClear(_containerId, refName); + if (!_dataSourceManager.HasRefId(dataSource)) + { + return; + } + string refName = _dataSourceManager.GetRefId(dataSource); + if (refName == null) + { + return; + } + _dataSourceManager.NotifyClearItems(refName); } - } - void RefSink.OnRefNotifySetItem(IJSDataSource dataSource, string refName, int index, object oldItem, object newItem) { - if (dataSource.DataSourceType == JSDataSourceType.Json) + public void NotifySetItem(object dataSource, int index, object oldItem, object newItem) { - RendererMessage m = new RendererMessage(); - m.Type = ("refNotifySetItem"); - m.SetData("refName", "\"" + refName + "\""); - m.SetData("index", index.ToString()); - m.SetData("oldItem", oldItem == null ? "null" : ((JsonDataSourceItem)oldItem).ToJson()); - m.SetData("newItem", oldItem == null ? "null" : ((JsonDataSourceItem)newItem).ToJson()); - if (!((JsonDataSource)dataSource).DateCacheReady) + if (!_dataSourceManager.HasRefId(dataSource)) + { + return; + } + string refName = _dataSourceManager.GetRefId(dataSource); + if (refName == null) { - m.SetData("dateCache", ((JsonDataSource)dataSource).GetDateCacheAsJson()); + return; } - SendMessage(m); + _dataSourceManager.NotifySetItem(refName, index, oldItem, newItem); } - else + + public void NotifyUpdateItem(object dataSource, int index, object refItem, bool syncDataOnly = false) { - var uds = (UnmarshalledDataSource)dataSource; - uds.SendUpdate(_containerId, refName, index, false); + if (!_dataSourceManager.HasRefId(dataSource)) + { + return; + } + string refName = _dataSourceManager.GetRefId(dataSource); + if (refName == null) + { + return; + } + _dataSourceManager.NotifyUpdateItem(refName, index, refItem, syncDataOnly); } - } - void RefSink.OnRefNotifyUpdateItem(IJSDataSource dataSource, string refName, int index, object refItem, bool syncDataOnly) { - if (dataSource.DataSourceType == JSDataSourceType.Json) + public void OnRefChanged(string refName, object refValue) { RendererMessage m = new RendererMessage(); - m.Type = ("refNotifyUpdateItem"); + m.Type = ("refChanged"); m.SetData("refName", "\"" + refName + "\""); - m.SetData("index", index.ToString()); - m.SetData("item", refItem == null ? "null" : ((JsonDataSourceItem)refItem).ToJson()); - m.SetData("syncDataOnly", syncDataOnly ? "true" : "false"); - if (!((JsonDataSource)dataSource).DateCacheReady) + if (refValue is IJSDataSource) + { + var ds = (IJSDataSource)refValue; + var dataIntents = ds == null ? null : ds.GetDataIntentsAsJson(); + if (dataIntents != null) + { + m.SetData("dataIntents", dataIntents); + } + if (ds.DataSourceType == JSDataSourceType.Json) + { + if (!ds.IsSent) + { + ds.IsSent = true; + m.SetData("refValue", refValue == null ? "null" : ((JsonDataSource)refValue).ToJson()); + m.SetData("dateCache", refValue == null ? "null" : ((JsonDataSource)refValue).GetDateCacheAsJson()); + } + else + { + return; + } + } + else + { + var uds = (UnmarshalledDataSource)refValue; + uds.SendCreate(_containerId, refName, dataIntents); + + return; + } + } + else { - m.SetData("dateCache", ((JsonDataSource)dataSource).GetDateCacheAsJson()); + m.SetData("refValue", refValue == null ? "null" : refValue.ToString()); } SendMessage(m); } - else + + void RefSink.OnRefNotifyInsertItem(IJSDataSource dataSource, string refName, int index, object refItem) { - var uds = (UnmarshalledDataSource)dataSource; - uds.SendUpdate(_containerId, refName, index, syncDataOnly); + if (dataSource.DataSourceType == JSDataSourceType.Json) + { + RendererMessage m = new RendererMessage(); + m.Type = ("refNotifyInsertItem"); + m.SetData("refName", "\"" + refName + "\""); + m.SetData("index", index.ToString()); + m.SetData("newItem", refItem == null ? "null" : ((JsonDataSourceItem)refItem).ToJson()); + + if (!((JsonDataSource)dataSource).DateCacheReady) + { + m.SetData("dateCache", ((JsonDataSource)dataSource).GetDateCacheAsJson()); + } + //Console.WriteLine("sending insert message"); + SendMessage(m); + } + else + { + var uds = (UnmarshalledDataSource)dataSource; + uds.SendInsert(_containerId, refName, index); + } } - } - private void SendMessage(RendererMessage m) { - if (disposedValue) + void RefSink.OnRefNotifyRemoveItem(IJSDataSource dataSource, string refName, int index, object oldItem) { - return; + if (dataSource.DataSourceType == JSDataSourceType.Json) + { + RendererMessage m = new RendererMessage(); + m.Type = ("refNotifyRemoveItem"); + m.SetData("refName", "\"" + refName + "\""); + m.SetData("index", index.ToString()); + m.SetData("oldItem", oldItem == null ? "null" : ((JsonDataSourceItem)oldItem).ToJson()); + if (!((JsonDataSource)dataSource).DateCacheReady) + { + m.SetData("dateCache", ((JsonDataSource)dataSource).GetDateCacheAsJson()); + } + SendMessage(m); + } + else + { + var uds = (UnmarshalledDataSource)dataSource; + uds.SendRemove(_containerId, refName, index); + } } - //Console.WriteLine("sending message"); - _messageQueue.AddLast(m); - QueueUpdate(); - } - private async Task SendMessageImmediate(RendererMessage m) { - if (disposedValue) + void RefSink.OnRefNotifyClearItems(IJSDataSource dataSource, string refName, object refValue) { - return null; + if (dataSource.DataSourceType == JSDataSourceType.Json) + { + RendererMessage m = new RendererMessage(); + m.Type = ("refClearItems"); + m.SetData("refName", "\"" + refName + "\""); + m.SetData("refValue", refValue == null ? "null" : ((JsonDataSource)refValue).ToJson()); + if (!((JsonDataSource)dataSource).DateCacheReady) + { + m.SetData("dateCache", ((JsonDataSource)dataSource).GetDateCacheAsJson()); + } + SendMessage(m); + } + else + { + var uds = (UnmarshalledDataSource)dataSource; + uds.SendClear(_containerId, refName); + } } - Update(); - return await SendJsonImmediate(m); - } - - private object SendMessageSyncImmediate(RendererMessage m) { - if (disposedValue) + void RefSink.OnRefNotifySetItem(IJSDataSource dataSource, string refName, int index, object oldItem, object newItem) { - return null; + if (dataSource.DataSourceType == JSDataSourceType.Json) + { + RendererMessage m = new RendererMessage(); + m.Type = ("refNotifySetItem"); + m.SetData("refName", "\"" + refName + "\""); + m.SetData("index", index.ToString()); + m.SetData("oldItem", oldItem == null ? "null" : ((JsonDataSourceItem)oldItem).ToJson()); + m.SetData("newItem", oldItem == null ? "null" : ((JsonDataSourceItem)newItem).ToJson()); + if (!((JsonDataSource)dataSource).DateCacheReady) + { + m.SetData("dateCache", ((JsonDataSource)dataSource).GetDateCacheAsJson()); + } + SendMessage(m); + } + else + { + var uds = (UnmarshalledDataSource)dataSource; + uds.SendUpdate(_containerId, refName, index, false); + } } - UpdateSync(); - return SendJsonImmediateSync(m); - } - private void QueueUpdate() { - if (!_updateQueued && _ready) { - _updateQueued = true; - Task.Delay(0).ContinueWith((t) => InvokeAsync(Update)); + void RefSink.OnRefNotifyUpdateItem(IJSDataSource dataSource, string refName, int index, object refItem, bool syncDataOnly) + { + if (dataSource.DataSourceType == JSDataSourceType.Json) + { + RendererMessage m = new RendererMessage(); + m.Type = ("refNotifyUpdateItem"); + m.SetData("refName", "\"" + refName + "\""); + m.SetData("index", index.ToString()); + m.SetData("item", refItem == null ? "null" : ((JsonDataSourceItem)refItem).ToJson()); + m.SetData("syncDataOnly", syncDataOnly ? "true" : "false"); + if (!((JsonDataSource)dataSource).DateCacheReady) + { + m.SetData("dateCache", ((JsonDataSource)dataSource).GetDateCacheAsJson()); + } + SendMessage(m); + } + else + { + var uds = (UnmarshalledDataSource)dataSource; + uds.SendUpdate(_containerId, refName, index, syncDataOnly); + } } - } - private void Update() { - this._updateQueued = false; - - if (!_ready) { - return; + private void SendMessage(RendererMessage m) + { + if (disposedValue) + { + return; + } + //Console.WriteLine("sending message"); + _messageQueue.AddLast(m); + QueueUpdate(); } - //Console.WriteLine("updateing: " + this.GetType().Name + " " + _messageQueue.Count); - while (_messageQueue.Count > 0) { - RendererMessage m = _messageQueue.First.Value; - _messageQueue.RemoveFirst(); - ProcessMessage(m); - } - } + private async Task SendMessageImmediate(RendererMessage m) + { + if (disposedValue) + { + return null; + } - private void UpdateSync() { - this._updateQueued = false; + Update(); + return await SendJsonImmediate(m); + } - if (!_ready) { - return; + private object SendMessageSyncImmediate(RendererMessage m) + { + if (disposedValue) + { + return null; + } + UpdateSync(); + return SendJsonImmediateSync(m); } - while (_messageQueue.Count > 0) { - RendererMessage m = _messageQueue.First.Value; - _messageQueue.RemoveFirst(); - ProcessMessageSync(m); + private void QueueUpdate() + { + if (!_updateQueued && _ready) + { + _updateQueued = true; + Task.Delay(0).ContinueWith((t) => InvokeAsync(Update)); + } } - } - private string _description = "description"; - private bool disposedValue; + private void Update() + { + this._updateQueued = false; - private void ProcessMessage(RendererMessage m) { - if (m.Type == _description) { - if (UseDirectRender) + if (!_ready) { - _isContentDirty = false; return; } - //Console.WriteLine("is description: " + this.GetType().Name); - string ser = this.Serialize(); - //Console.WriteLine("ser"); - //Console.WriteLine(ser); - m.SetData("description", ser); - _isContentDirty = false; + + //Console.WriteLine("updateing: " + this.GetType().Name + " " + _messageQueue.Count); + while (_messageQueue.Count > 0) + { + RendererMessage m = _messageQueue.First.Value; + _messageQueue.RemoveFirst(); + ProcessMessage(m); + } } - else if (m.Type == "refChanged") + + private void UpdateSync() { - m.SetData("eventBehavior", "\"" + ResolveEventBehavior().ToString().ToLower() + "\""); - } - string json = m.ToJson(); - //Console.WriteLine("message"); - //Console.WriteLine("json: " + json); - SendJson(json, m.NativeElements); - } + this._updateQueued = false; - private void ProcessMessageSync(RendererMessage m) { - if (m.Type == _description) { - if (UseDirectRender) + if (!_ready) { - _isContentDirty = false; return; } - string ser = this.Serialize(); - m.SetData("description", ser); - _isContentDirty = false; - } - else if (m.Type == "refChanged") - { - m.SetData("eventBehavior", "\"" + ResolveEventBehavior().ToString().ToLower() + "\""); - } - string json = m.ToJson(); - SendJsonSync(json, m.NativeElements); - } - private async Task SendJsonImmediate(RendererMessage m) { - if (IgBlazor == null ||!IgBlazor.IsRuntimeValid(_shouldReevaluateRuntime)) { - return null; + while (_messageQueue.Count > 0) + { + RendererMessage m = _messageQueue.First.Value; + _messageQueue.RemoveFirst(); + ProcessMessageSync(m); + } } - if (m.Type == _description) { - if (UseDirectRender) + private string _description = "description"; + private bool disposedValue; + + private void ProcessMessage(RendererMessage m) + { + if (m.Type == _description) { - _isContentDirty = false; - return null; + if (UseDirectRender) + { + _isContentDirty = false; + return; + } + //Console.WriteLine("is description: " + this.GetType().Name); + string ser = this.Serialize(); + //Console.WriteLine("ser"); + //Console.WriteLine(ser); + m.SetData("description", ser); + _isContentDirty = false; + } + else if (m.Type == "refChanged") + { + m.SetData("eventBehavior", "\"" + ResolveEventBehavior().ToString().ToLower() + "\""); } - string ser = this.Serialize(); - m.SetData("description", ser); - _isContentDirty = false; + string json = m.ToJson(); + //Console.WriteLine("message"); + //Console.WriteLine("json: " + json); + SendJson(json, m.NativeElements); } - - string json = m.ToJson(); - if (m.NativeElements != null) + private void ProcessMessageSync(RendererMessage m) { - return await JsRuntime.InvokeAsync("igSendMessage", - new object[] { this._containerId, json, - GetObjectRef(), m.NativeElements }); + if (m.Type == _description) + { + if (UseDirectRender) + { + _isContentDirty = false; + return; + } + string ser = this.Serialize(); + m.SetData("description", ser); + _isContentDirty = false; + } + else if (m.Type == "refChanged") + { + m.SetData("eventBehavior", "\"" + ResolveEventBehavior().ToString().ToLower() + "\""); + } + string json = m.ToJson(); + SendJsonSync(json, m.NativeElements); } - else + + private async Task SendJsonImmediate(RendererMessage m) { + if (IgBlazor == null || !IgBlazor.IsRuntimeValid(_shouldReevaluateRuntime)) + { + return null; + } + + if (m.Type == _description) + { + if (UseDirectRender) + { + _isContentDirty = false; + return null; + } + string ser = this.Serialize(); + m.SetData("description", ser); + _isContentDirty = false; + } + + string json = m.ToJson(); + + if (m.NativeElements != null) + { + return await JsRuntime.InvokeAsync("igSendMessage", + new object[] { this._containerId, json, + GetObjectRef(), m.NativeElements }); + } + else + { //json = "window.sendMessage(`" + this._id + "`, `" + json + "`)"; - return await JsRuntime.InvokeAsync("igSendMessage", - new object[] { this._containerId, json, + return await JsRuntime.InvokeAsync("igSendMessage", + new object[] { this._containerId, json, GetObjectRef() }); + } } - } - - private object SendJsonImmediateSync(RendererMessage m) { - if (m.Type == _description) { - string ser = this.Serialize(); - m.SetData("description", ser); - _isContentDirty = false; - } - - string json = m.ToJson(); - ElementReference[] nativeElements = m.NativeElements; - if (nativeElements != null) + private object SendJsonImmediateSync(RendererMessage m) { -//json = "window.sendMessage(`" + this._id + "`, `" + json + "`)"; - return this.JsInProcessRuntime.Invoke("igSendMessage", new object[] { this._containerId, json, + if (m.Type == _description) + { + string ser = this.Serialize(); + m.SetData("description", ser); + _isContentDirty = false; + } + + string json = m.ToJson(); + ElementReference[] nativeElements = m.NativeElements; + + if (nativeElements != null) + { + //json = "window.sendMessage(`" + this._id + "`, `" + json + "`)"; + return this.JsInProcessRuntime.Invoke("igSendMessage", new object[] { this._containerId, json, GetObjectRef(), nativeElements }); - } - else - { - //json = "window.sendMessage(`" + this._id + "`, `" + json + "`)"; - return this.JsInProcessRuntime.Invoke("igSendMessage", new object[] { this._containerId, json, + } + else + { + //json = "window.sendMessage(`" + this._id + "`, `" + json + "`)"; + return this.JsInProcessRuntime.Invoke("igSendMessage", new object[] { this._containerId, json, GetObjectRef()}); + } } - } - private void SendJson(string json, ElementReference[] nativeElements) { - //json = "window.sendMessage(`" + this._containerId + "`, `" + json + "`)"; - //Console.WriteLine(json); - if (!IgBlazor.IsRuntimeValid(_shouldReevaluateRuntime)) { - return; - } - - if (nativeElements != null) - { - JsRuntime.InvokeAsync("igSendMessage", - new object[] { this._containerId, json, - GetObjectRef(), nativeElements }); - } - else + private void SendJson(string json, ElementReference[] nativeElements) { - JsRuntime.InvokeAsync("igSendMessage", - new object[] { this._containerId, json, + //json = "window.sendMessage(`" + this._containerId + "`, `" + json + "`)"; + //Console.WriteLine(json); + if (!IgBlazor.IsRuntimeValid(_shouldReevaluateRuntime)) + { + return; + } + + if (nativeElements != null) + { + JsRuntime.InvokeAsync("igSendMessage", + new object[] { this._containerId, json, + GetObjectRef(), nativeElements }); + } + else + { + JsRuntime.InvokeAsync("igSendMessage", + new object[] { this._containerId, json, GetObjectRef() }); + } } - } - internal void AttachChild(BaseRendererElement child) { - if (child == null) + internal void AttachChild(BaseRendererElement child) { - return; + if (child == null) + { + return; + } + child.Parent = this; } - child.Parent = this; - } - internal void AttachChild(BaseCollection child) { - if (child == null) + internal void AttachChild(BaseCollection child) { - return; - } - child.Parent = this; + if (child == null) + { + return; + } + child.Parent = this; - if (child != null) - { - for (var i = 0; i < child.Count; i++) + if (child != null) { - var subChild = child[i]; - if (subChild is BaseRendererElement) + for (var i = 0; i < child.Count; i++) { - AttachChild((BaseRendererElement)(object)subChild); + var subChild = child[i]; + if (subChild is BaseRendererElement) + { + AttachChild((BaseRendererElement)(object)subChild); + } } } } - } - internal void DetachChild(BaseRendererElement child) { - if (child == null) - { - return; - } - if (child.Parent == this) + internal void DetachChild(BaseRendererElement child) { - child.Parent = null; + if (child == null) + { + return; + } + if (child.Parent == this) + { + child.Parent = null; + } } - } - internal void DetachChild(BaseCollection child) { - if (child == null) - { - return; - } - if (child.Parent == this) + internal void DetachChild(BaseCollection child) { - child.Parent = null; + if (child == null) + { + return; + } + if (child.Parent == this) + { + child.Parent = null; + } } - } - - private void SendJsonSync(string json, ElementReference[] nativeElements) { + private void SendJsonSync(string json, ElementReference[] nativeElements) + { //json = "window.sendMessage(`" + this._id + "`, `" + json + "`)"; - if (nativeElements != null) - { - JsInProcessRuntime.Invoke("igSendMessage", - new object[] { + if (nativeElements != null) + { + JsInProcessRuntime.Invoke("igSendMessage", + new object[] { this._containerId, json, GetObjectRef(), nativeElements }); - } - else - { - JsInProcessRuntime.Invoke("igSendMessage", - new object[] { + } + else + { + JsInProcessRuntime.Invoke("igSendMessage", + new object[] { this._containerId, json, GetObjectRef() }); + } } - } - - internal object ReturnToPrimitive(object returnValue) - { - return ConvertReturnValue(returnValue, true); - } - internal T[] DowncastArray(object val) - { - if (val == null) + internal object ReturnToPrimitive(object returnValue) { - return null; + return ConvertReturnValue(returnValue, true); } - if (val is T[]) + internal T[] DowncastArray(object val) { - return (T[])val; - } + if (val == null) + { + return null; + } - if (val is object[]) - { - var objArr = (object[])val; - var ret = new T[objArr.Length]; - for (var i = 0; i < objArr.Length; i++) + if (val is T[]) { - ret[i] = (T)objArr[i]; + return (T[])val; } - return ret; - } + if (val is object[]) + { + var objArr = (object[])val; + var ret = new T[objArr.Length]; + for (var i = 0; i < objArr.Length; i++) + { + ret[i] = (T)objArr[i]; + } - return (T[])val; - } + return ret; + } - internal object ConvertReturnValue(object returnValue, bool transformArrays = false, string typeGuess = null, bool acceptsNullIfMarshalDoesNotExist = false) { - try { - //Console.WriteLine(returnValue.GetType().ToString()); - if (returnValue is String || returnValue is Dictionary || returnValue is JsonElement) { - Dictionary obj; - if (returnValue is String) - { - obj = JsonSerializer.Deserialize>((string)returnValue, SerializerOptions); - } - else if (returnValue is JsonElement) - { - var test = returnValue.ToString(); - //Console.WriteLine("is ele"); - obj = new Dictionary(); - var j = ((JsonElement)(returnValue)); - // if (j.ValueKind == JsonValueKind.String) - // { - // var str = j.ToString(); - // //Console.WriteLine(j.ToString()); - // JsonDocument document = JsonDocument.Parse(str); - // if (document.RootElement.ValueKind == JsonValueKind.Object) - // { - // obj = JsonSerializer.Deserialize>((string)j.GetString()); - // } - // else - // { - // return str; - // } - // } else - if (j.ValueKind == JsonValueKind.String) { - returnValue = j.GetString(); + return (T[])val; + } + + internal object ConvertReturnValue(object returnValue, bool transformArrays = false, string typeGuess = null, bool acceptsNullIfMarshalDoesNotExist = false) + { + try + { + //Console.WriteLine(returnValue.GetType().ToString()); + if (returnValue is String || returnValue is Dictionary || returnValue is JsonElement) + { + Dictionary obj; + if (returnValue is String) + { + obj = JsonSerializer.Deserialize>((string)returnValue, SerializerOptions); } - else if (j.ValueKind == JsonValueKind.Number) { - returnValue = j.GetDouble(); - } else if (j.ValueKind == JsonValueKind.Array) { - var str = j.ToString(); - //Console.WriteLine(j.ToString()); - JsonDocument document = JsonDocument.Parse(str); - if (document.RootElement.ValueKind == JsonValueKind.Array) + else if (returnValue is JsonElement) + { + var test = returnValue.ToString(); + //Console.WriteLine("is ele"); + obj = new Dictionary(); + var j = ((JsonElement)(returnValue)); + // if (j.ValueKind == JsonValueKind.String) + // { + // var str = j.ToString(); + // //Console.WriteLine(j.ToString()); + // JsonDocument document = JsonDocument.Parse(str); + // if (document.RootElement.ValueKind == JsonValueKind.Object) + // { + // obj = JsonSerializer.Deserialize>((string)j.GetString()); + // } + // else + // { + // return str; + // } + // } else + if (j.ValueKind == JsonValueKind.String) { - returnValue = JsonSerializer.Deserialize[]>((string)j.ToString(), SerializerOptions); + returnValue = j.GetString(); } - else + else if (j.ValueKind == JsonValueKind.Number) { - return str; - } - } else if (j.ValueKind == JsonValueKind.Object) { - //var str = j.ToString(); - //Console.WriteLine(j.ToString()); - obj = JsonSerializer.Deserialize>((string)j.ToString(), SerializerOptions); - } - } - else - { - obj = (Dictionary)returnValue; - } - if (obj.ContainsKey("refType")) { - String refType = ((JsonElement)obj["refType"]).ToString(); - if ("uuid".Equals(refType)) { - String id = ((JsonElement)obj["id"]).ToString(); - if (id.Contains("/")) { - returnValue = _dataSourceManager.FindItem(id); - } else { - Guid uuid = Guid.Parse(id); - returnValue = _dataSourceManager.FindItem(uuid); + returnValue = j.GetDouble(); } - } else { - String name = ((JsonElement)obj["id"]).ToString(); - returnValue = FindByName(name); - } - } else if (obj.ContainsKey("retType")) { - String retType = ((JsonElement)obj["retType"]).ToString(); - if ("number".Equals(retType)) { - if (obj["value"] == null || - ((JsonElement)obj["value"]).ValueKind == JsonValueKind.Null) + else if (j.ValueKind == JsonValueKind.Array) { - returnValue = double.NaN; + var str = j.ToString(); + //Console.WriteLine(j.ToString()); + JsonDocument document = JsonDocument.Parse(str); + if (document.RootElement.ValueKind == JsonValueKind.Array) + { + returnValue = JsonSerializer.Deserialize[]>((string)j.ToString(), SerializerOptions); + } + else + { + return str; + } } - else + else if (j.ValueKind == JsonValueKind.Object) { - returnValue = (Object) double.Parse(((JsonElement)obj["value"]).ToString()); + //var str = j.ToString(); + //Console.WriteLine(j.ToString()); + obj = JsonSerializer.Deserialize>((string)j.ToString(), SerializerOptions); } - } else if ("string".Equals(retType)) { - returnValue = (Object) ((JsonElement)obj["value"]).ToString(); - } else if ("boolean".Equals(retType)) { - returnValue = (Object) bool.Parse(((JsonElement)obj["value"]).ToString()); - } else if ("date".Equals(retType)) { - returnValue = (Object) ReturnToDate(((JsonElement)obj["value"]).ToString(), false); - } else if ("undefined".Equals(retType)) { - returnValue = null; - } else if ("Array".Equals(retType)) { - var arr = ((JsonElement)obj["value"]); - if (transformArrays && arr.ValueKind == JsonValueKind.Array) + } + else + { + obj = (Dictionary)returnValue; + } + if (obj.ContainsKey("refType")) + { + String refType = ((JsonElement)obj["refType"]).ToString(); + if ("uuid".Equals(refType)) { - object[] ret = new object[arr.GetArrayLength()]; - for (var i = 0; i < arr.GetArrayLength(); i++) + String id = ((JsonElement)obj["id"]).ToString(); + if (id.Contains("/")) { - var item = arr[i]; - var cItem = ConvertReturnValue(item); - ret[i] = cItem; + returnValue = _dataSourceManager.FindItem(id); } - return ret; - } - //Console.WriteLine(arr.GetArrayLength()); - returnValue = arr.ToString(); - } else if ("localJson".Equals(retType)) { - var v = ((JsonElement)obj["value"]); - return v; - } else if ("object".Equals(retType)) { - - if (obj.ContainsKey("type")) { - var type = obj["type"].ToString(); - if (String.IsNullOrEmpty(type)) { - if (typeGuess != null) { - type = typeGuess; - } + else + { + Guid uuid = Guid.Parse(id); + returnValue = _dataSourceManager.FindItem(uuid); } + } + else + { + String name = ((JsonElement)obj["id"]).ToString(); + returnValue = FindByName(name); + } + } + else if (obj.ContainsKey("retType")) + { + String retType = ((JsonElement)obj["retType"]).ToString(); + if ("number".Equals(retType)) + { if (obj["value"] == null || ((JsonElement)obj["value"]).ValueKind == JsonValueKind.Null) { - return null; + returnValue = double.NaN; } - - object o = null; - if (type != null) + else + { + returnValue = (Object)double.Parse(((JsonElement)obj["value"]).ToString()); + } + } + else if ("string".Equals(retType)) + { + returnValue = (Object)((JsonElement)obj["value"]).ToString(); + } + else if ("boolean".Equals(retType)) + { + returnValue = (Object)bool.Parse(((JsonElement)obj["value"]).ToString()); + } + else if ("date".Equals(retType)) + { + returnValue = (Object)ReturnToDate(((JsonElement)obj["value"]).ToString(), false); + } + else if ("undefined".Equals(retType)) + { + returnValue = null; + } + else if ("Array".Equals(retType)) + { + var arr = ((JsonElement)obj["value"]); + if (transformArrays && arr.ValueKind == JsonValueKind.Array) { - o = MarshalByValueFactory.CreateInstance(type); + object[] ret = new object[arr.GetArrayLength()]; + for (var i = 0; i < arr.GetArrayLength(); i++) + { + var item = arr[i]; + var cItem = ConvertReturnValue(item); + ret[i] = cItem; + } + return ret; } - if (o != null) + //Console.WriteLine(arr.GetArrayLength()); + returnValue = arr.ToString(); + } + else if ("localJson".Equals(retType)) + { + var v = ((JsonElement)obj["value"]); + return v; + } + else if ("object".Equals(retType)) + { + + if (obj.ContainsKey("type")) { - if (o is BaseRendererElement) + var type = obj["type"].ToString(); + if (String.IsNullOrEmpty(type)) + { + if (typeGuess != null) + { + type = typeGuess; + } + } + if (obj["value"] == null || + ((JsonElement)obj["value"]).ValueKind == JsonValueKind.Null) + { + return null; + } + + object o = null; + if (type != null) + { + o = MarshalByValueFactory.CreateInstance(type); + } + if (o != null) { - ((BaseRendererElement)o).TempParent = this; - var v = ((JsonElement)obj["value"]); - var str = v.ToString(); - //Console.WriteLine(str); - var ev = JsonSerializer.Deserialize>(str, SerializerOptions); - ((BaseRendererElement)o).FromEventJson(this, ev); - returnValue = o; + if (o is BaseRendererElement) + { + ((BaseRendererElement)o).TempParent = this; + var v = ((JsonElement)obj["value"]); + var str = v.ToString(); + //Console.WriteLine(str); + var ev = JsonSerializer.Deserialize>(str, SerializerOptions); + ((BaseRendererElement)o).FromEventJson(this, ev); + returnValue = o; + } + // else if (o is BaseRendererControl) + // { + // var ev = JsonSerializer.Deserialize>(((JsonElement)obj["value"]).GetString()); + // ((BaseRendererControl)o).FromEventJson(this, ev); + // } + else + { + returnValue = ((JsonElement)obj["value"]).ToString(); + } } - // else if (o is BaseRendererControl) - // { - // var ev = JsonSerializer.Deserialize>(((JsonElement)obj["value"]).GetString()); - // ((BaseRendererControl)o).FromEventJson(this, ev); - // } else { - returnValue = ((JsonElement)obj["value"]).ToString(); + if (acceptsNullIfMarshalDoesNotExist) + { + return null; + } + var ret = obj["value"].ToString(); + returnValue = JsonSerializer.Deserialize>(ret, SerializerOptions); } } else { - if (acceptsNullIfMarshalDoesNotExist) - { - return null; - } - var ret = obj["value"].ToString(); - returnValue = JsonSerializer.Deserialize>(ret, SerializerOptions); + returnValue = ((JsonElement)obj["value"]).ToString(); } - } else { - returnValue = ((JsonElement)obj["value"]).ToString(); } } } } - } catch (Exception e) { - Console.WriteLine(e.ToString()); + catch (Exception e) + { + Console.WriteLine(e.ToString()); + } + + return returnValue; } - return returnValue; - } + public void OnInvokeReturn(long invokeId, Object returnValue) + { + //lock (_semLock) { + // if (returnValue instanceof String) { + // returnValue = convertReturnValue(returnValue); + // } - public void OnInvokeReturn(long invokeId, Object returnValue) { - //lock (_semLock) { - // if (returnValue instanceof String) { - // returnValue = convertReturnValue(returnValue); - // } - - // _methodReturns.Add(invokeId, returnValue); - // if (_methodSemaphores.containsKey(invokeId)) { - // Semaphore s = _methodSemaphores.get(invokeId); - // s.release(); - // } - //} + // _methodReturns.Add(invokeId, returnValue); + // if (_methodSemaphores.containsKey(invokeId)) { + // Semaphore s = _methodSemaphores.get(invokeId); + // s.release(); + // } + //} - - object result = returnValue; - if (returnValue is JsonElement && ((JsonElement)returnValue).ValueKind == JsonValueKind.String) - { - var str = ((JsonElement)returnValue).GetString(); - result = JsonSerializer.Deserialize>(str, SerializerOptions); - - } - InvokeAsync(() => - { - if (_methodTasks.ContainsKey(invokeId)) + object result = returnValue; + if (returnValue is JsonElement && ((JsonElement)returnValue).ValueKind == JsonValueKind.String) { - _methodTasks[invokeId].SetResult(result); + var str = ((JsonElement)returnValue).GetString(); + result = JsonSerializer.Deserialize>(str, SerializerOptions); + } - else + InvokeAsync(() => { - _methodReturns.Add(invokeId, result); - } - }); - } - - internal T ReturnToObject(object val) { - return ReturnToObject(val, null); - } + if (_methodTasks.ContainsKey(invokeId)) + { + _methodTasks[invokeId].SetResult(result); + } + else + { + _methodReturns.Add(invokeId, result); + } + }); + } - internal T ReturnToObject(object val, string? typeGuess) { - if (val == null) { - return default(T); + internal T ReturnToObject(object val) + { + return ReturnToObject(val, null); } - val = ConvertReturnValue(val, false, typeGuess); - return (T)val; - } + internal T ReturnToObject(object val, string? typeGuess) + { + if (val == null) + { + return default(T); + } + val = ConvertReturnValue(val, false, typeGuess); - public virtual object FindByName(string name) { - if ("mainControl".Equals(name)) { - return this; + return (T)val; } - return null; - } - - private object GetObjectById(long objId) { - //TODO: this - return null; - } + public virtual object FindByName(string name) + { + if ("mainControl".Equals(name)) + { + return this; + } - internal int ReturnToInt(object val) { - if (val == null) { - return 0; - } - val = ConvertReturnValue(val); - if (val is String) { - return int.Parse((String)val); - } else if (val is IConvertible) { - return ((IConvertible)val).ToInt32(CultureInfo.InvariantCulture); - } else { - return int.Parse(val.ToString()); + return null; } - } - internal double ReturnToDouble(object val) { - if (val == null) { - return 0; - } - //Console.WriteLine("converting return"); - val = ConvertReturnValue(val); - if (val == null) { - return double.NaN; - } - //Console.WriteLine(val); - if (val is String) { - return double.Parse((String)val); - } else if (val is IConvertible) { - //Console.WriteLine(val); - return ((IConvertible)val).ToDouble(CultureInfo.InvariantCulture); - } else { - //Console.WriteLine(val); - return Double.Parse(val.ToString()); + private object GetObjectById(long objId) + { + //TODO: this + return null; } - } - internal long ReturnToLong(object val) { - if (val == null) { - return 0; - } - //Console.WriteLine("converting return"); - val = ConvertReturnValue(val); - if (val == null) { - return Int64.MinValue; - } - //Console.WriteLine(val); - if (val is String) { - return (long)double.Parse((String)val); - } else if (val is IConvertible) { - //Console.WriteLine(val); - return ((IConvertible)val).ToInt64(CultureInfo.InvariantCulture); - } else { - //Console.WriteLine(val); - return (long)Double.Parse(val.ToString()); - } - } - - internal DateTime[] ReturnToDateArray(object val) { - if (val == null) { - return null; - } - val = ConvertReturnValue(val); - if (val == null) { - return null; - } - try { - var arr = JsonSerializer.Deserialize((string)val.ToString(), SerializerOptions); - DateTime[] ret = new DateTime[arr.Length]; - for (int i = 0; i < arr.Length; i++) + internal int ReturnToInt(object val) + { + if (val == null) { - Object ele = arr[i]; - ele = ReturnToDate(ele); - ret[i] = (DateTime)ele; + return 0; + } + val = ConvertReturnValue(val); + if (val is String) + { + return int.Parse((String)val); + } + else if (val is IConvertible) + { + return ((IConvertible)val).ToInt32(CultureInfo.InvariantCulture); + } + else + { + return int.Parse(val.ToString()); } - return ret; - } catch (Exception e) { - return null; } - } - internal DateTime ReturnToDate(object val, bool tryConvertValue = true) { - if (val == null) { - return DateTime.MinValue; - } - //Console.WriteLine("converting return"); - if (tryConvertValue) + internal double ReturnToDouble(object val) { + if (val == null) + { + return 0; + } + //Console.WriteLine("converting return"); val = ConvertReturnValue(val); - } - if (val == null) { - return DateTime.MinValue; - } - //Console.WriteLine(val); - if (val is String) { - switch (RoundTripDateConversion) + if (val == null) { - case RoundTripDateConversion.UTC: - return DateTime.Parse((String)val.ToString(), CultureInfo.InvariantCulture, DateTimeStyles.RoundtripKind); - case RoundTripDateConversion.Auto: - case RoundTripDateConversion.Local: - default: - return DateTime.Parse((String)val.ToString(), CultureInfo.InvariantCulture, DateTimeStyles.RoundtripKind).ToLocalTime(); + return double.NaN; } - } else if (val is IConvertible) { - //Console.WriteLine(val); - return ((IConvertible)val).ToDateTime(CultureInfo.InvariantCulture); - } else { //Console.WriteLine(val); - switch (RoundTripDateConversion) + if (val is String) { - case RoundTripDateConversion.UTC: - return DateTime.Parse((String)val.ToString(), CultureInfo.InvariantCulture, DateTimeStyles.RoundtripKind); - case RoundTripDateConversion.Auto: - case RoundTripDateConversion.Local: - default: - return DateTime.Parse((String)val.ToString(), CultureInfo.InvariantCulture, DateTimeStyles.RoundtripKind).ToLocalTime(); + return double.Parse((String)val); } - } - } - - internal bool ReturnToBoolean(object val) { - if (val == null) { - return false; - } - val = ConvertReturnValue(val); - if (val is bool) { - return (bool)val; - } else if (val is Dictionary) { - return true; - } else { - return Boolean.Parse(val.ToString()); - } - } - - internal string ComponentToJson(object val, int index) { - if (val is BaseRendererControl || val is BaseRendererElement) - { - string refId; - if (val is BaseRendererElement) + else if (val is IConvertible) { - //TODO: this should be the parent component's _Container id.... but maybe we don't need elements here. - refId = _containerId + "/" + ((BaseRendererElement)val).Name; - //((BaseRendererElement)val).Parent = this; + //Console.WriteLine(val); + return ((IConvertible)val).ToDouble(CultureInfo.InvariantCulture); } else { - refId = ((BaseRendererControl)val)._containerId; - val = "containerId:::" + refId; - //OnRefChanged(refId, "\"" + val + "\""); + //Console.WriteLine(val); + return Double.Parse(val.ToString()); } - return "\"" + val + "\""; } - if (val is ElementReference) - { - return "\"elementIndex:::" + index + "\""; - } - return null; - } - internal String BooleanToString(bool val) { - return ((bool)val).ToString().ToLower(); - } - - internal string ObjectToParam(object val) { - using (MemoryStream ms = new MemoryStream()) + internal long ReturnToLong(object val) { - using (Utf8JsonWriter w = new Utf8JsonWriter(ms)) + if (val == null) + { + return 0; + } + //Console.WriteLine("converting return"); + val = ConvertReturnValue(val); + if (val == null) { - SerializationContext c = new SerializationContext(w, null); - ObjectToParam(c, val); - w.Flush(); - return System.Text.Encoding.UTF8.GetString(ms.ToArray()); + return Int64.MinValue; + } + //Console.WriteLine(val); + if (val is String) + { + return (long)double.Parse((String)val); + } + else if (val is IConvertible) + { + //Console.WriteLine(val); + return ((IConvertible)val).ToInt64(CultureInfo.InvariantCulture); + } + else + { + //Console.WriteLine(val); + return (long)Double.Parse(val.ToString()); } } - } - internal string ObjectToParam(object val, Type type) - { - using (MemoryStream ms = new MemoryStream()) + internal DateTime[] ReturnToDateArray(object val) { - using (Utf8JsonWriter w = new Utf8JsonWriter(ms)) + if (val == null) + { + return null; + } + val = ConvertReturnValue(val); + if (val == null) + { + return null; + } + try + { + var arr = JsonSerializer.Deserialize((string)val.ToString(), SerializerOptions); + DateTime[] ret = new DateTime[arr.Length]; + for (int i = 0; i < arr.Length; i++) + { + Object ele = arr[i]; + ele = ReturnToDate(ele); + ret[i] = (DateTime)ele; + } + return ret; + } + catch (Exception e) { - SerializationContext c = new SerializationContext(w, null); - ObjectToParam(c, type, val); - w.Flush(); - return System.Text.Encoding.UTF8.GetString(ms.ToArray()); + return null; } } - } - internal void ObjectToParam(SerializationContext context, object val) { - if (val == null) + internal DateTime ReturnToDate(object val, bool tryConvertValue = true) { - context.Writer.WriteNullValue(); - return; + if (val == null) + { + return DateTime.MinValue; + } + //Console.WriteLine("converting return"); + if (tryConvertValue) + { + val = ConvertReturnValue(val); + } + if (val == null) + { + return DateTime.MinValue; + } + //Console.WriteLine(val); + if (val is String) + { + switch (RoundTripDateConversion) + { + case RoundTripDateConversion.UTC: + return DateTime.Parse((String)val.ToString(), CultureInfo.InvariantCulture, DateTimeStyles.RoundtripKind); + case RoundTripDateConversion.Auto: + case RoundTripDateConversion.Local: + default: + return DateTime.Parse((String)val.ToString(), CultureInfo.InvariantCulture, DateTimeStyles.RoundtripKind).ToLocalTime(); + } + } + else if (val is IConvertible) + { + //Console.WriteLine(val); + return ((IConvertible)val).ToDateTime(CultureInfo.InvariantCulture); + } + else + { + //Console.WriteLine(val); + switch (RoundTripDateConversion) + { + case RoundTripDateConversion.UTC: + return DateTime.Parse((String)val.ToString(), CultureInfo.InvariantCulture, DateTimeStyles.RoundtripKind); + case RoundTripDateConversion.Auto: + case RoundTripDateConversion.Local: + default: + return DateTime.Parse((String)val.ToString(), CultureInfo.InvariantCulture, DateTimeStyles.RoundtripKind).ToLocalTime(); + } + } } - var w = context.Writer; - Guid id = _dataSourceManager.FindItemId(val); - - var typeName = ""; - if (val is JsonSerializable) + internal bool ReturnToBoolean(object val) { - - if (val is BaseRendererControl) + if (val == null) { - typeName = ((BaseRendererControl)val).Type; + return false; } - else if (val is BaseRendererElement) + val = ConvertReturnValue(val); + if (val is bool) { - typeName = ((BaseRendererElement)val).Type; + return (bool)val; + } + else if (val is Dictionary) + { + return true; } else { - typeName = val.GetType().Name; + return Boolean.Parse(val.ToString()); } } - if (id != Guid.Empty) { - w.WriteStartObject(); - w.WriteString("refType", "uuid"); - w.WriteString("id", id.ToString()); - w.WriteEndObject(); - } - else if (val is JsonSerializable && MarshalByValueFactory.MustMarshalByValue(typeName)) - { - ((JsonSerializable)(val)).Serialize(context); - } - else if (val is BaseRendererElement) { - w.WriteStartObject(); - w.WriteString("refType", "name"); - w.WriteString("id", ((BaseRendererElement) val).Name); - w.WriteEndObject(); - } - else if (val is BaseRendererControl) { - w.WriteStartObject(); - w.WriteString("refType", "name"); - w.WriteString("id", ((BaseRendererControl) val).Name); - w.WriteEndObject(); - } - else if (val is double) - { - w.WriteNumberValue((double)val); - } - else if (val is int) - { - w.WriteNumberValue((int)val); - } - else if (val is long) - { - w.WriteNumberValue((long)val); - } - else if (val is short) - { - w.WriteNumberValue((long)val); - } - else if (val is bool) + internal string ComponentToJson(object val, int index) { - w.WriteBooleanValue((bool)val); + if (val is BaseRendererControl || val is BaseRendererElement) + { + string refId; + if (val is BaseRendererElement) + { + //TODO: this should be the parent component's _Container id.... but maybe we don't need elements here. + refId = _containerId + "/" + ((BaseRendererElement)val).Name; + //((BaseRendererElement)val).Parent = this; + } + else + { + refId = ((BaseRendererControl)val)._containerId; + val = "containerId:::" + refId; + //OnRefChanged(refId, "\"" + val + "\""); + } + return "\"" + val + "\""; + } + if (val is ElementReference) + { + return "\"elementIndex:::" + index + "\""; + } + return null; } - else if (val is DateTime) + + internal String BooleanToString(bool val) { - w.WriteStringValue(((DateTime)val).ToString("o")); + return ((bool)val).ToString().ToLower(); } - else + + internal string ObjectToParam(object val) { - w.WriteStringValue(val.ToString()); + using (MemoryStream ms = new MemoryStream()) + { + using (Utf8JsonWriter w = new Utf8JsonWriter(ms)) + { + SerializationContext c = new SerializationContext(w, null); + ObjectToParam(c, val); + w.Flush(); + return System.Text.Encoding.UTF8.GetString(ms.ToArray()); + } + } } - } - internal void ObjectToParam(SerializationContext c, string propertyName, object val) { - var w = c.Writer; - if (val == null) + + internal string ObjectToParam(object val, Type type) { - w.WriteNull(propertyName); - return; + using (MemoryStream ms = new MemoryStream()) + { + using (Utf8JsonWriter w = new Utf8JsonWriter(ms)) + { + SerializationContext c = new SerializationContext(w, null); + ObjectToParam(c, type, val); + w.Flush(); + return System.Text.Encoding.UTF8.GetString(ms.ToArray()); + } + } } - Guid id = _dataSourceManager.FindItemId(val); - string typeName = ""; - if (val is JsonSerializable) + internal void ObjectToParam(SerializationContext context, object val) { - - if (val is BaseRendererControl) + if (val == null) { - typeName = ((BaseRendererControl)val).Type; + context.Writer.WriteNullValue(); + return; + } + var w = context.Writer; + Guid id = _dataSourceManager.FindItemId(val); + + var typeName = ""; + + if (val is JsonSerializable) + { + + if (val is BaseRendererControl) + { + typeName = ((BaseRendererControl)val).Type; + } + else if (val is BaseRendererElement) + { + typeName = ((BaseRendererElement)val).Type; + } + else + { + typeName = val.GetType().Name; + } + } + + if (id != Guid.Empty) + { + w.WriteStartObject(); + w.WriteString("refType", "uuid"); + w.WriteString("id", id.ToString()); + w.WriteEndObject(); + } + else if (val is JsonSerializable && MarshalByValueFactory.MustMarshalByValue(typeName)) + { + ((JsonSerializable)(val)).Serialize(context); } else if (val is BaseRendererElement) { - typeName = ((BaseRendererElement)val).Type; + w.WriteStartObject(); + w.WriteString("refType", "name"); + w.WriteString("id", ((BaseRendererElement)val).Name); + w.WriteEndObject(); + } + else if (val is BaseRendererControl) + { + w.WriteStartObject(); + w.WriteString("refType", "name"); + w.WriteString("id", ((BaseRendererControl)val).Name); + w.WriteEndObject(); + } + else if (val is double) + { + w.WriteNumberValue((double)val); + } + else if (val is int) + { + w.WriteNumberValue((int)val); + } + else if (val is long) + { + w.WriteNumberValue((long)val); + } + else if (val is short) + { + w.WriteNumberValue((long)val); + } + else if (val is bool) + { + w.WriteBooleanValue((bool)val); + } + else if (val is DateTime) + { + w.WriteStringValue(((DateTime)val).ToString("o")); } else { - typeName = val.GetType().Name; + w.WriteStringValue(val.ToString()); } } - - if (id != Guid.Empty) { - w.WriteStartObject(propertyName); - w.WriteString("refType", "uuid"); - w.WriteString("id", id.ToString()); - w.WriteEndObject(); - } - else if (val is JsonSerializable && MarshalByValueFactory.MustMarshalByValue(typeName)) - { - ((JsonSerializable)(val)).Serialize(c); - } - else if (val is BaseRendererElement) { - w.WriteStartObject(propertyName); - w.WriteString("refType", "name"); - w.WriteString("id", ((BaseRendererElement) val).Name); - w.WriteEndObject(); - } - else if (val is BaseRendererControl) { - w.WriteStartObject(propertyName); - w.WriteString("refType", "name"); - w.WriteString("id", ((BaseRendererControl) val).Name); - w.WriteEndObject(); - } - else if (val is double) - { - w.WriteNumber(propertyName, (double)val); - } - else if (val is int) - { - w.WriteNumber(propertyName, (int)val); - } - else if (val is long) - { - w.WriteNumber(propertyName, (long)val); - } - else if (val is short) - { - w.WriteNumber(propertyName, (long)val); - } - else if (val is bool) - { - w.WriteBoolean(propertyName, (bool)val); - } - else if (val is DateTime) - { - w.WriteString(propertyName, ((DateTime)val).ToString("o")); - } - else - { - w.WriteString(propertyName, val.ToString()); - } - } - internal void ObjectToParam(SerializationContext c, Type type, object val) - { - if (type.IsEnum) + internal void ObjectToParam(SerializationContext c, string propertyName, object val) { + var w = c.Writer; if (val == null) { - ObjectToParam(c, val); + w.WriteNull(propertyName); return; } + Guid id = _dataSourceManager.FindItemId(val); - if (Utils.TryGetWCEnumName(type, val.ToString(), out var wcName)) + string typeName = ""; + if (val is JsonSerializable) { - c.Writer.WriteStringValue(wcName); - return; + + if (val is BaseRendererControl) + { + typeName = ((BaseRendererControl)val).Type; + } + else if (val is BaseRendererElement) + { + typeName = ((BaseRendererElement)val).Type; + } + else + { + typeName = val.GetType().Name; + } } - if (UseCamelEnumValues) + if (id != Guid.Empty) + { + w.WriteStartObject(propertyName); + w.WriteString("refType", "uuid"); + w.WriteString("id", id.ToString()); + w.WriteEndObject(); + } + else if (val is JsonSerializable && MarshalByValueFactory.MustMarshalByValue(typeName)) + { + ((JsonSerializable)(val)).Serialize(c); + } + else if (val is BaseRendererElement) + { + w.WriteStartObject(propertyName); + w.WriteString("refType", "name"); + w.WriteString("id", ((BaseRendererElement)val).Name); + w.WriteEndObject(); + } + else if (val is BaseRendererControl) + { + w.WriteStartObject(propertyName); + w.WriteString("refType", "name"); + w.WriteString("id", ((BaseRendererControl)val).Name); + w.WriteEndObject(); + } + else if (val is double) + { + w.WriteNumber(propertyName, (double)val); + } + else if (val is int) + { + w.WriteNumber(propertyName, (int)val); + } + else if (val is long) + { + w.WriteNumber(propertyName, (long)val); + } + else if (val is short) + { + w.WriteNumber(propertyName, (long)val); + } + else if (val is bool) { - c.Writer.WriteStringValue(Camelize(val.ToString())); + w.WriteBoolean(propertyName, (bool)val); + } + else if (val is DateTime) + { + w.WriteString(propertyName, ((DateTime)val).ToString("o")); } else { - c.Writer.WriteStringValue(val.ToString()); + w.WriteString(propertyName, val.ToString()); } - return; } - ObjectToParam(c, val); - } + internal void ObjectToParam(SerializationContext c, Type type, object val) + { + if (type.IsEnum) + { + if (val == null) + { + ObjectToParam(c, val); + return; + } - internal string ReturnToString(object val) { - if (val == null) { - return null; - } - val = ConvertReturnValue(val); + if (Utils.TryGetWCEnumName(type, val.ToString(), out var wcName)) + { + c.Writer.WriteStringValue(wcName); + return; + } - if (val == null) { - return null; + if (UseCamelEnumValues) + { + c.Writer.WriteStringValue(Camelize(val.ToString())); + } + else + { + c.Writer.WriteStringValue(val.ToString()); + } + return; + } + ObjectToParam(c, val); } - return val.ToString(); - } - - internal string StringToString(object val) { - return val == null ? null : JsonSerializer.Serialize(val.ToString(), SerializerOptions); - //return val == null ? null : val.ToString(); - } - protected virtual bool UseCamelEnumValues - { - get + internal string ReturnToString(object val) { - return true; - } - } + if (val == null) + { + return null; + } + val = ConvertReturnValue(val); - protected string Camelize(string value) - { - if (value == null || value.Length == 0) { - return value; + if (val == null) + { + return null; + } + return val.ToString(); } - return value.Substring(0, 1).ToLower() + value.Substring(1); - } - protected string ToPascal(string value) - { - if (value == null || value.Length == 0) { - return value; + internal string StringToString(object val) + { + return val == null ? null : JsonSerializer.Serialize(val.ToString(), SerializerOptions); + //return val == null ? null : val.ToString(); } - return value.Substring(0, 1).ToUpper() + value.Substring(1); - } - internal string EnumToString(T val) where T: struct { - if (UseCamelEnumValues) + protected virtual bool UseCamelEnumValues { - return Camelize(val.ToString()); + get + { + return true; + } } - return val.ToString(); - } - - internal T StringToEnum(Object val) where T: struct { - if (val == null) + protected string Camelize(string value) { - return default(T); + if (value == null || value.Length == 0) + { + return value; + } + return value.Substring(0, 1).ToLower() + value.Substring(1); } - val = ConvertReturnValue(val); - if (val == null) { - return default(T); + + protected string ToPascal(string value) + { + if (value == null || value.Length == 0) + { + return value; + } + return value.Substring(0, 1).ToUpper() + value.Substring(1); } - var str = val.ToString(); - T ret; - if (Enum.TryParse(str, out ret)) { - return ret; + + internal string EnumToString(T val) where T : struct + { + if (UseCamelEnumValues) + { + return Camelize(val.ToString()); + } + + return val.ToString(); } - return default(T); - } - internal string ObjectArrayToParam(object[] arr) { - if (arr == null) + internal T StringToEnum(Object val) where T : struct { - return null; + if (val == null) + { + return default(T); + } + val = ConvertReturnValue(val); + if (val == null) + { + return default(T); + } + var str = val.ToString(); + T ret; + if (Enum.TryParse(str, out ret)) + { + return ret; + } + return default(T); } - using (MemoryStream ms = new MemoryStream()) + + internal string ObjectArrayToParam(object[] arr) { - using (Utf8JsonWriter w = new Utf8JsonWriter(ms)) + if (arr == null) { - SerializationContext c = new SerializationContext(w, null); - w.WriteStartArray(); - for (int i = 0; i < arr.Length; i++) { - var val = arr[i]; - ObjectToParam(c, val); + return null; + } + using (MemoryStream ms = new MemoryStream()) + { + using (Utf8JsonWriter w = new Utf8JsonWriter(ms)) + { + SerializationContext c = new SerializationContext(w, null); + w.WriteStartArray(); + for (int i = 0; i < arr.Length; i++) + { + var val = arr[i]; + ObjectToParam(c, val); + } + w.WriteEndArray(); + w.Flush(); + return System.Text.Encoding.UTF8.GetString(ms.ToArray()); } - w.WriteEndArray(); - w.Flush(); - return System.Text.Encoding.UTF8.GetString(ms.ToArray()); + } + // object jarr = new JSONArray(); + // try { + // for (int i = 0; i < arr.length; i++) { + // jarr.put(i, arr[i]); + // } + // } catch (Exception e) { + // return null; + // } + // return jarr.toString(); + // try + // { + // return JsonSerializer.Serialize(arr); + // } + // catch (Exception e) + // { + // return null; + // } + } + + internal string StringArrayToString(string[] arr) + { + // object jarr = new JSONArray(); + // try { + // for (int i = 0; i < arr.length; i++) { + // jarr.put(i, arr[i]); + // } + // } catch (Exception e) { + // return null; + // } + // return jarr.toString(); + try + { + return JsonSerializer.Serialize(arr, SerializerOptions); + } + catch (Exception e) + { + return null; } } - // object jarr = new JSONArray(); - // try { - // for (int i = 0; i < arr.length; i++) { - // jarr.put(i, arr[i]); - // } - // } catch (Exception e) { - // return null; - // } - // return jarr.toString(); - // try - // { - // return JsonSerializer.Serialize(arr); - // } - // catch (Exception e) - // { - // return null; - // } - } - internal string StringArrayToString(string[] arr) { - // object jarr = new JSONArray(); - // try { - // for (int i = 0; i < arr.length; i++) { - // jarr.put(i, arr[i]); - // } - // } catch (Exception e) { - // return null; - // } - // return jarr.toString(); - try + internal string IntArrayToString(int[] arr) { - return JsonSerializer.Serialize(arr, SerializerOptions); + // object jarr = new JSONArray(); + // try { + // for (int i = 0; i < arr.length; i++) { + // jarr.put(i, arr[i]); + // } + // } catch (Exception e) { + // return null; + // } + // return jarr.toString(); + try + { + return JsonSerializer.Serialize(arr, SerializerOptions); + } + catch (Exception e) + { + return null; + } } - catch (Exception e) + + internal string DoubleArrayToString(double[] arr) { - return null; + // object jarr = new JSONArray(); + // try { + // for (int i = 0; i < arr.length; i++) { + // jarr.put(i, arr[i]); + // } + // } catch (Exception e) { + // return null; + // } + // return jarr.toString(); + try + { + return JsonSerializer.Serialize(arr, SerializerOptions); + } + catch (Exception e) + { + return null; + } } - } - internal string IntArrayToString(int[] arr) { - // object jarr = new JSONArray(); - // try { - // for (int i = 0; i < arr.length; i++) { - // jarr.put(i, arr[i]); - // } - // } catch (Exception e) { - // return null; - // } - // return jarr.toString(); - try + internal object[] ReturnToObjectArray(object val) { - return JsonSerializer.Serialize(arr, SerializerOptions); + if (val == null) + { + return null; + } + val = ConvertReturnValue(val); + if (val == null) + { + return null; + } + try + { + var arr = JsonSerializer.Deserialize((string)val.ToString(), SerializerOptions); + Object[] ret = new Object[arr.Length]; + for (int i = 0; i < arr.Length; i++) + { + Object ele = arr[i]; + ele = ConvertReturnValue(ele); + ret[i] = ele; + } + return ret; + } + catch (Exception e) + { + return null; + } } - catch (Exception e) + + internal T[] ReturnToObjectArray(object val) { - return null; + return ReturnToObjectArray(val, null); } - } - internal string DoubleArrayToString(double[] arr) { - // object jarr = new JSONArray(); - // try { - // for (int i = 0; i < arr.length; i++) { - // jarr.put(i, arr[i]); - // } - // } catch (Exception e) { - // return null; - // } - // return jarr.toString(); - try + internal T[] ReturnToObjectArray(object val, string typeGuess) { - return JsonSerializer.Serialize(arr, SerializerOptions); + if (val == null) + { + return null; + } + val = ConvertReturnValue(val); + try + { + var arr = JsonSerializer.Deserialize[]>((string)val.ToString(), SerializerOptions); + T[] ret = new T[arr.Length]; + for (int i = 0; i < arr.Length; i++) + { + Object ele = arr[i]; + //Console.WriteLine("converting obj"); + //Console.WriteLine(ele); + ele = ConvertReturnValue(ele, false, typeGuess); + ret[i] = (T)ele; + } + return ret; + } + catch (Exception e) + { + return null; + } } - catch (Exception e) + + internal string[] ReturnToStringArray(object val) { - return null; + if (val == null) + { + return null; + } + val = ConvertReturnValue(val); + if (val == null) + { + return null; + } + try + { + var valStr = val.ToString(); + var arr = JsonSerializer.Deserialize((string)valStr, SerializerOptions); + string[] ret = new string[arr.Length]; + for (int i = 0; i < arr.Length; i++) + { + string ele = arr[i] != null ? arr[i].ToString() : null; + ret[i] = ele; + } + return ret; + } + catch (Exception e) + { + return null; + } } - } - internal object[] ReturnToObjectArray(object val) { - if (val == null) { - return null; - } - val = ConvertReturnValue(val); - if (val == null) { - return null; - } - try { - var arr = JsonSerializer.Deserialize((string)val.ToString(), SerializerOptions); - Object[] ret = new Object[arr.Length]; - for (int i = 0; i < arr.Length; i++) + internal double[] ReturnToDoubleArray(object val) + { + if (val == null) { - Object ele = arr[i]; - ele = ConvertReturnValue(ele); - ret[i] = ele; + return null; + } + val = ConvertReturnValue(val); + try + { + var arr = JsonSerializer.Deserialize((string)val.ToString(), SerializerOptions); + double[] ret = new double[arr.Length]; + for (int i = 0; i < arr.Length; i++) + { + double ele = arr[i] != null ? Convert.ToDouble(arr[i]) : double.NaN; + ret[i] = ele; + } + return ret; + } + catch (Exception e) + { + return null; } - return ret; - } catch (Exception e) { - return null; } - } - internal T[] ReturnToObjectArray(object val) { - return ReturnToObjectArray(val, null); - } - - internal T[] ReturnToObjectArray(object val, string typeGuess) { - if (val == null) { - return null; - } - val = ConvertReturnValue(val); - try { - var arr = JsonSerializer.Deserialize[]>((string)val.ToString(), SerializerOptions); - T[] ret = new T[arr.Length]; - for (int i = 0; i < arr.Length; i++) + internal int[] ReturnToIntArray(object val) + { + if (val == null) + { + return null; + } + val = ConvertReturnValue(val); + try { - Object ele = arr[i]; - //Console.WriteLine("converting obj"); - //Console.WriteLine(ele); - ele = ConvertReturnValue(ele,false, typeGuess); - ret[i] = (T)ele; + var arr = JsonSerializer.Deserialize((string)val.ToString(), SerializerOptions); + int[] ret = new int[arr.Length]; + for (int i = 0; i < arr.Length; i++) + { + int ele = arr[i] != null ? Convert.ToInt32(arr[i]) : int.MinValue; + ret[i] = ele; + } + return ret; + } + catch (Exception e) + { + return null; } - return ret; - } catch (Exception e) { - return null; } - } - internal string[] ReturnToStringArray(object val) { - if (val == null) { - return null; - } - val = ConvertReturnValue(val); - if (val == null) { - return null; - } - try { - var valStr = val.ToString(); - var arr = JsonSerializer.Deserialize((string)valStr, SerializerOptions); - string[] ret = new string[arr.Length]; - for (int i = 0; i < arr.Length; i++) + internal string Name + { + get { - string ele = arr[i] != null ? arr[i].ToString() : null; - ret[i] = ele; + return "mainControl"; } - return ret; - } catch (Exception e) { - return null; } - } - internal double[] ReturnToDoubleArray(object val) { - if (val == null) { - return null; - } - val = ConvertReturnValue(val); - try { - var arr = JsonSerializer.Deserialize((string)val.ToString(), SerializerOptions); - double[] ret = new double[arr.Length]; - for (int i = 0; i < arr.Length; i++) + protected internal void OnElementNameChanged(BaseRendererElement element, string oldName, string newName) + { + List toRename = new List(); + foreach (var key in _handlers.Keys) { - double ele = arr[i] != null ? Convert.ToDouble(arr[i]) : double.NaN; - ret[i] = ele; + if (key.Contains("/")) + { + var parts = key.Split('/'); + if (parts[0] == oldName) + { + toRename.Add(key); + } + } } - return ret; - } catch (Exception e) { - return null; - } - } - internal int[] ReturnToIntArray(object val) { - if (val == null) { - return null; - } - val = ConvertReturnValue(val); - try { - var arr = JsonSerializer.Deserialize((string)val.ToString(), SerializerOptions); - int[] ret = new int[arr.Length]; - for (int i = 0; i < arr.Length; i++) + foreach (var key in toRename) { - int ele = arr[i] != null ? Convert.ToInt32(arr[i]) : int.MinValue; - ret[i] = ele; + var handler = _handlers[key]; + _handlers.Remove(key); + var parts = key.Split('/'); + var newKey = newName + "/" + parts[1]; + _handlers[newKey] = handler; } - return ret; - } catch (Exception e) { - return null; } - } - internal string Name - { - get + internal void SetHandler(string name, string propertyName, EventCallback? handler, Action onArgs = null) where T : BaseRendererElement, new() { - return "mainControl"; + if (!handler.HasValue) + { + //Console.WriteLine("clearing handler: " + name + "/" + propertyName); + _handlers.Remove(name + "/" + propertyName); + return; + } + Action inner = (sender, args) => + { + T a = new T(); + BaseRendererElement ele = (BaseRendererElement)a; + ele.Parent = this; + ele.FromEventJson(this, (Dictionary)args); + //Console.WriteLine("invoking async"); + if (onArgs != null) + { + onArgs(a); + } + var task = handler?.InvokeAsync(a); + if (task.Exception != null) + { + throw task.Exception; + } + ele.ToEventJson(this, (Dictionary)args); + ele.Parent = (null); + }; + + //Console.WriteLine("setting handler: " + name + "/" + propertyName); + _handlers[name + "/" + propertyName] = inner; } - } - protected internal void OnElementNameChanged(BaseRendererElement element, string oldName, string newName) - { - List toRename = new List(); - foreach (var key in _handlers.Keys) + internal void SetHandlerSimple(string name, string propertyName, EventCallback? handler, Func getReturn, Action onArgs = null) { - if (key.Contains("/")) + if (!handler.HasValue) { - var parts = key.Split('/'); - if (parts[0] == oldName) + //Console.WriteLine("clearing handler: " + name + "/" + propertyName); + _handlers.Remove(name + "/" + propertyName); + return; + } + Action inner = (sender, args) => + { + T a = getReturn(args); + //Console.WriteLine("invoking async"); + if (onArgs != null) { - toRename.Add(key); + onArgs(a); } - } - } + var task = handler?.InvokeAsync(a); + if (task.Exception != null) + { + throw task.Exception; + } + }; - foreach (var key in toRename) - { - var handler = _handlers[key]; - _handlers.Remove(key); - var parts = key.Split('/'); - var newKey = newName + "/" + parts[1]; - _handlers[newKey] = handler; + //Console.WriteLine("setting handler: " + name + "/" + propertyName); + _handlers[name + "/" + propertyName] = inner; } - } - - internal void SetHandler(string name, string propertyName, EventCallback? handler, Action onArgs = null) where T: BaseRendererElement, new() { - if (!handler.HasValue) - { - //Console.WriteLine("clearing handler: " + name + "/" + propertyName); - _handlers.Remove(name + "/" + propertyName); - return; - } - Action inner = (sender, args) => { - T a = new T(); - BaseRendererElement ele = (BaseRendererElement)a; - ele.Parent = this; - ele.FromEventJson(this, (Dictionary)args); - //Console.WriteLine("invoking async"); - if (onArgs != null) - { - onArgs(a); - } - var task = handler?.InvokeAsync(a); - if (task.Exception != null) - { - throw task.Exception; - } - ele.ToEventJson(this, (Dictionary)args); - ele.Parent = (null); - }; - - //Console.WriteLine("setting handler: " + name + "/" + propertyName); - _handlers[name + "/" + propertyName] = inner; - } - internal void SetHandlerSimple(string name, string propertyName, EventCallback? handler, Func getReturn, Action onArgs = null) { - if (!handler.HasValue) + internal void SetActionHandler(string name, string propertyName, Action handler, Action onArgs = null) where T : BaseRendererElement, new() { - //Console.WriteLine("clearing handler: " + name + "/" + propertyName); - _handlers.Remove(name + "/" + propertyName); - return; - } - Action inner = (sender, args) => { - T a = getReturn(args); - //Console.WriteLine("invoking async"); - if (onArgs != null) - { - onArgs(a); - } - var task = handler?.InvokeAsync(a); - if (task.Exception != null) + if (handler == null) { - throw task.Exception; + //Console.WriteLine("clearing handler: " + name + "/" + propertyName); + _handlers.Remove(name + "/" + propertyName); + return; } - }; - - //Console.WriteLine("setting handler: " + name + "/" + propertyName); - _handlers[name + "/" + propertyName] = inner; - } - + Action inner = (sender, args) => + { + T a = new T(); + BaseRendererElement ele = (BaseRendererElement)a; + ele.Parent = this; + ele.FromEventJson(this, (Dictionary)args); + //Console.WriteLine("invoking async"); + if (onArgs != null) + { + onArgs(a); + } + handler(a); + ele.ToEventJson(this, (Dictionary)args); + ele.Parent = (null); + }; - internal void SetActionHandler(string name, string propertyName, Action handler, Action onArgs = null) where T: BaseRendererElement, new() { - if (handler == null) - { - //Console.WriteLine("clearing handler: " + name + "/" + propertyName); - _handlers.Remove(name + "/" + propertyName); - return; - } - Action inner = (sender, args) => { - T a = new T(); - BaseRendererElement ele = (BaseRendererElement)a; - ele.Parent = this; - ele.FromEventJson(this, (Dictionary)args); - //Console.WriteLine("invoking async"); - if (onArgs != null) - { - onArgs(a); - } - handler(a); - ele.ToEventJson(this, (Dictionary)args); - ele.Parent = (null); - }; - - //Console.WriteLine("setting handler: " + name + "/" + propertyName); - _handlers[name + "/" + propertyName] = inner; - } + //Console.WriteLine("setting handler: " + name + "/" + propertyName); + _handlers[name + "/" + propertyName] = inner; + } - internal void SetActionHandlerSimple(string name, string propertyName, Action handler, Func getReturn, Action onArgs = null) { - if (handler == null) + internal void SetActionHandlerSimple(string name, string propertyName, Action handler, Func getReturn, Action onArgs = null) { - //Console.WriteLine("clearing handler: " + name + "/" + propertyName); - _handlers.Remove(name + "/" + propertyName); - return; - } - Action inner = (sender, args) => { - T a = getReturn(args); - - //Console.WriteLine("invoking async"); - if (onArgs != null) + if (handler == null) { - onArgs(a); + //Console.WriteLine("clearing handler: " + name + "/" + propertyName); + _handlers.Remove(name + "/" + propertyName); + return; } - handler(a); - }; - - //Console.WriteLine("setting handler: " + name + "/" + propertyName); - _handlers[name + "/" + propertyName] = inner; - } - - internal void OnRaiseEvent(string name, string propertyName, string args) { - //Console.WriteLine("handler time: " + Name + ", " + GetHashCode().ToString() + ", " + this.GetType().Name); - //Console.WriteLine("getting handler: " + name + "/" + propertyName); - //Console.WriteLine("_handlers: " + _handlers.Count); - if (_handlers.ContainsKey(name + "/" + propertyName)) { - //Console.WriteLine("got handler"); - bool usedTempParent = false; - Object senderObj = null; - try { - var obj = JsonSerializer.Deserialize>((string)args.ToString(), SerializerOptions); - //Console.WriteLine(args.ToString()); + Action inner = (sender, args) => + { + T a = getReturn(args); - object sender = obj["sender"]; - if (sender is JsonElement && ((JsonElement)sender).ValueKind == JsonValueKind.String) + //Console.WriteLine("invoking async"); + if (onArgs != null) { - sender = JsonSerializer.Deserialize>(((JsonElement)sender).GetString(), SerializerOptions); + onArgs(a); } + handler(a); + }; + + //Console.WriteLine("setting handler: " + name + "/" + propertyName); + _handlers[name + "/" + propertyName] = inner; + } - senderObj = ConvertReturnValue(sender); - if (senderObj is BaseRendererElement) + internal void OnRaiseEvent(string name, string propertyName, string args) + { + //Console.WriteLine("handler time: " + Name + ", " + GetHashCode().ToString() + ", " + this.GetType().Name); + //Console.WriteLine("getting handler: " + name + "/" + propertyName); + //Console.WriteLine("_handlers: " + _handlers.Count); + if (_handlers.ContainsKey(name + "/" + propertyName)) + { + //Console.WriteLine("got handler"); + bool usedTempParent = false; + Object senderObj = null; + try { - var ele = (BaseRendererElement)senderObj; - if (ele.Parent == null) + var obj = JsonSerializer.Deserialize>((string)args.ToString(), SerializerOptions); + //Console.WriteLine(args.ToString()); + + object sender = obj["sender"]; + if (sender is JsonElement && ((JsonElement)sender).ValueKind == JsonValueKind.String) { - ele.TempParent = this; + sender = JsonSerializer.Deserialize>(((JsonElement)sender).GetString(), SerializerOptions); } - } - var argsString = obj["args"] != null ? obj["args"].ToString() : null; - object val = null; - - if (argsString != null) - { - var doc = JsonDocument.Parse(argsString); - //Console.WriteLine(argsString); - //Console.WriteLine("here:"); - //Console.WriteLine(doc.RootElement.ValueKind.ToString()); - if (doc.RootElement.ValueKind == JsonValueKind.Object) + senderObj = ConvertReturnValue(sender); + if (senderObj is BaseRendererElement) { - var dict = JsonSerializer.Deserialize>((string)argsString, SerializerOptions); - val = dict; + var ele = (BaseRendererElement)senderObj; + if (ele.Parent == null) + { + ele.TempParent = this; + } + } - // Avoid double unwrapping primitive value types. This primarily only applies to events with primitive types for event args which - // there are not many of. - bool needsConversion = true; - if (dict.ContainsKey("retType")) + var argsString = obj["args"] != null ? obj["args"].ToString() : null; + object val = null; + + if (argsString != null) + { + var doc = JsonDocument.Parse(argsString); + //Console.WriteLine(argsString); + //Console.WriteLine("here:"); + //Console.WriteLine(doc.RootElement.ValueKind.ToString()); + if (doc.RootElement.ValueKind == JsonValueKind.Object) { - var retType = ((JsonElement)dict["retType"]).ToString(); - if ("string".Equals(retType) || - "number".Equals(retType) || - "boolean".Equals(retType) || - "date".Equals(retType)) + var dict = JsonSerializer.Deserialize>((string)argsString, SerializerOptions); + val = dict; + + // Avoid double unwrapping primitive value types. This primarily only applies to events with primitive types for event args which + // there are not many of. + bool needsConversion = true; + if (dict.ContainsKey("retType")) { - needsConversion = false; + var retType = ((JsonElement)dict["retType"]).ToString(); + if ("string".Equals(retType) || + "number".Equals(retType) || + "boolean".Equals(retType) || + "date".Equals(retType)) + { + needsConversion = false; + } } - } - if (needsConversion) - val = ConvertReturnValue(val); - } - else - { - val = JsonSerializer.Deserialize((string)argsString, SerializerOptions); + if (needsConversion) + val = ConvertReturnValue(val); + } + else + { + val = JsonSerializer.Deserialize((string)argsString, SerializerOptions); + } } + //Console.WriteLine("calling handler"); + _handlers[name + "/" + propertyName](senderObj, val); } - //Console.WriteLine("calling handler"); - _handlers[name + "/" + propertyName](senderObj, val); - } catch (Exception e) { - Console.WriteLine(e.ToString()); - } finally { - if (senderObj is BaseRendererElement) + catch (Exception e) { - var ele = (BaseRendererElement)senderObj; - if (ele.Parent == null) + Console.WriteLine(e.ToString()); + } + finally + { + if (senderObj is BaseRendererElement) { - ele.TempParent = null; + var ele = (BaseRendererElement)senderObj; + if (ele.Parent == null) + { + ele.TempParent = null; + } } } } } - } - private bool _shouldReevaluateRuntime = false; - protected virtual void Dispose(bool disposing) - { - if (!disposedValue) + private bool _shouldReevaluateRuntime = false; + protected virtual void Dispose(bool disposing) { - _shouldReevaluateRuntime = true; - SendCleanupMessage(); - _shouldReevaluateRuntime = false; - - if (disposing && _objRef != null) + if (!disposedValue) { - _objRef.Dispose(); - } + _shouldReevaluateRuntime = true; + SendCleanupMessage(); + _shouldReevaluateRuntime = false; - disposedValue = true; + if (disposing && _objRef != null) + { + _objRef.Dispose(); + } + + disposedValue = true; + } } - } - internal void RefreshDynamicContent() - { - if (Holder != null) + internal void RefreshDynamicContent() { - Holder.Refresh(); + if (Holder != null) + { + Holder.Refresh(); + } } - } - - private void SendCleanupMessage() - { - RendererMessage m = new RendererMessage(); - m.Type = ("cleanup"); - - _messageQueue.Clear(); - var ret = SendMessageImmediate(m); - } - public async Task SetResourceStringAsync(string grouping, string id, string value) - { - if (!IgBlazor.IsRuntimeValid(_shouldReevaluateRuntime)) { - return null; - } - return await JsRuntime.InvokeAsync("igSetResourceString", new object[] { "set", grouping, id, value }); - } + private void SendCleanupMessage() + { + RendererMessage m = new RendererMessage(); + m.Type = ("cleanup"); - public async Task SetResourceStringAsync(string grouping, string json) - { - if (!IgBlazor.IsRuntimeValid(_shouldReevaluateRuntime)) { - return null; + _messageQueue.Clear(); + var ret = SendMessageImmediate(m); } - return await JsRuntime.InvokeAsync("igSetResourceString", new object[] { "register", grouping, "", json }); - } - protected void SetPropertyValue(object item, System.Reflection.PropertyInfo property, JsonElement jsonElement) - { - System.Type type = Nullable.GetUnderlyingType(property.PropertyType); - if (type == null) - { - type = property.PropertyType; - } - switch (System.Type.GetTypeCode(type)) - { - case TypeCode.Byte: property.SetValue(item, jsonElement.GetByte()); break; - case TypeCode.SByte: property.SetValue(item, jsonElement.GetSByte()); break; - case TypeCode.UInt16: property.SetValue(item, jsonElement.GetUInt16()); break; - case TypeCode.UInt32: property.SetValue(item, jsonElement.GetUInt32()); break; - case TypeCode.UInt64: property.SetValue(item, jsonElement.GetUInt64()); break; - case TypeCode.Int16: property.SetValue(item, jsonElement.GetInt16()); break; - case TypeCode.Int32: property.SetValue(item, jsonElement.GetInt32()); break; - case TypeCode.Int64: property.SetValue(item, jsonElement.GetInt64()); break; - case TypeCode.Decimal: property.SetValue(item, jsonElement.GetDecimal()); break; - case TypeCode.Double: property.SetValue(item, jsonElement.GetDouble()); break; - case TypeCode.Single: property.SetValue(item, jsonElement.GetSingle()); break; - case TypeCode.String: property.SetValue(item, jsonElement.GetString()); break; - case TypeCode.Boolean: property.SetValue(item, jsonElement.GetBoolean()); break; - case TypeCode.DateTime: property.SetValue(item, ReturnToDate(jsonElement.ToString())); break; - } - } - protected void SetPropertyValue(object item, System.Reflection.PropertyInfo property, object value) - { - System.Type type = Nullable.GetUnderlyingType(property.PropertyType); - if (type == null) + public async Task SetResourceStringAsync(string grouping, string id, string value) { - type = property.PropertyType; + if (!IgBlazor.IsRuntimeValid(_shouldReevaluateRuntime)) + { + return null; + } + return await JsRuntime.InvokeAsync("igSetResourceString", new object[] { "set", grouping, id, value }); } - else + + public async Task SetResourceStringAsync(string grouping, string json) { - if (value == null) + if (!IgBlazor.IsRuntimeValid(_shouldReevaluateRuntime)) + { + return null; + } + return await JsRuntime.InvokeAsync("igSetResourceString", new object[] { "register", grouping, "", json }); + } + + protected void SetPropertyValue(object item, System.Reflection.PropertyInfo property, JsonElement jsonElement) + { + System.Type type = Nullable.GetUnderlyingType(property.PropertyType); + if (type == null) + { + type = property.PropertyType; + } + switch (System.Type.GetTypeCode(type)) + { + case TypeCode.Byte: + property.SetValue(item, jsonElement.GetByte()); + break; + case TypeCode.SByte: + property.SetValue(item, jsonElement.GetSByte()); + break; + case TypeCode.UInt16: + property.SetValue(item, jsonElement.GetUInt16()); + break; + case TypeCode.UInt32: + property.SetValue(item, jsonElement.GetUInt32()); + break; + case TypeCode.UInt64: + property.SetValue(item, jsonElement.GetUInt64()); + break; + case TypeCode.Int16: + property.SetValue(item, jsonElement.GetInt16()); + break; + case TypeCode.Int32: + property.SetValue(item, jsonElement.GetInt32()); + break; + case TypeCode.Int64: + property.SetValue(item, jsonElement.GetInt64()); + break; + case TypeCode.Decimal: + property.SetValue(item, jsonElement.GetDecimal()); + break; + case TypeCode.Double: + property.SetValue(item, jsonElement.GetDouble()); + break; + case TypeCode.Single: + property.SetValue(item, jsonElement.GetSingle()); + break; + case TypeCode.String: + property.SetValue(item, jsonElement.GetString()); + break; + case TypeCode.Boolean: + property.SetValue(item, jsonElement.GetBoolean()); + break; + case TypeCode.DateTime: + property.SetValue(item, ReturnToDate(jsonElement.ToString())); + break; + } + } + protected void SetPropertyValue(object item, System.Reflection.PropertyInfo property, object value) + { + System.Type type = Nullable.GetUnderlyingType(property.PropertyType); + if (type == null) + { + type = property.PropertyType; + } + else + { + if (value == null) + { + property.SetValue(item, null); + return; + } + } + if (type.IsArray) { - property.SetValue(item, null); + var src = (Array)value; + var dest = Array.CreateInstance(type.GetElementType(), src.Length); + Array.Copy(src, dest, src.Length); + property.SetValue(item, dest); return; } + + switch (System.Type.GetTypeCode(type)) + { + case TypeCode.Byte: + property.SetValue(item, Convert.ToByte(value)); + break; + case TypeCode.SByte: + property.SetValue(item, Convert.ToSByte(value)); + break; + case TypeCode.UInt16: + property.SetValue(item, Convert.ToUInt16(value)); + break; + case TypeCode.UInt32: + property.SetValue(item, Convert.ToUInt32(value)); + break; + case TypeCode.UInt64: + property.SetValue(item, Convert.ToUInt64(value)); + break; + case TypeCode.Int16: + property.SetValue(item, Convert.ToInt16(value)); + break; + case TypeCode.Int32: + property.SetValue(item, Convert.ToInt32(value)); + break; + case TypeCode.Int64: + property.SetValue(item, Convert.ToInt64(value)); + break; + case TypeCode.Decimal: + property.SetValue(item, Convert.ToDecimal(value)); + break; + case TypeCode.Double: + property.SetValue(item, Convert.ToDouble(value)); + break; + case TypeCode.Single: + property.SetValue(item, Convert.ToSingle(value)); + break; + case TypeCode.String: + property.SetValue(item, Convert.ToString(value)); + break; + case TypeCode.Boolean: + property.SetValue(item, Convert.ToBoolean(value)); + break; + case TypeCode.DateTime: + property.SetValue(item, Convert.ToDateTime(value)); + break; + case TypeCode.Object: + property.SetValue(item, value); + break; + } + } + + /** + * Workaround for comparing EventCallbacks correctly. It has been fixed only in .net 9 sadly. See: https://github.com/dotnet/aspnetcore/issues/53361 + * Basically access the Delegate and Receiver property that is not public for each callback and evaluate them manually. + */ + public static bool CompareEventCallbacks(T left, T right, ref Dictionary> eventFieldsDictionary) + { + if (left.Equals(null) || right.Equals(null)) + { + return false; + } + if (left.GetHashCode() == right.GetHashCode() || left.Equals(right)) + { + return true; + } + + Dictionary eventFields; + Type leftType = left.GetType(); + if (!eventFieldsDictionary.TryGetValue(leftType, out eventFields)) + { + eventFields = new Dictionary { + { "Delegate", leftType.GetField("Delegate", BindingFlags.NonPublic | BindingFlags.Instance) }, + { "Receiver", leftType.GetField("Receiver", BindingFlags.NonPublic | BindingFlags.Instance) } + }; + eventFieldsDictionary.Add(leftType, eventFields); + } + + Delegate leftDelegate = (Delegate)(eventFields["Delegate"].GetValue(left)); + Delegate rightDelegate = (Delegate)(eventFields["Delegate"].GetValue(right)); + IHandleEvent leftHandle = (IHandleEvent)(eventFields["Receiver"].GetValue(left)); + IHandleEvent rightHandle = (IHandleEvent)(eventFields["Receiver"].GetValue(right)); + return leftDelegate.Equals(rightDelegate) && leftHandle.Equals(rightHandle); } - if (type.IsArray) + + ~BaseRendererControl() { - var src = (Array)value; - var dest = Array.CreateInstance(type.GetElementType(), src.Length); - Array.Copy(src, dest, src.Length); - property.SetValue(item, dest); - return; + Dispose(disposing: false); } - switch (System.Type.GetTypeCode(type)) + public void Dispose() { - case TypeCode.Byte: property.SetValue(item, Convert.ToByte(value)); break; - case TypeCode.SByte: property.SetValue(item, Convert.ToSByte(value)); break; - case TypeCode.UInt16: property.SetValue(item, Convert.ToUInt16(value)); break; - case TypeCode.UInt32: property.SetValue(item, Convert.ToUInt32(value)); break; - case TypeCode.UInt64: property.SetValue(item, Convert.ToUInt64(value)); break; - case TypeCode.Int16: property.SetValue(item, Convert.ToInt16(value)); break; - case TypeCode.Int32: property.SetValue(item, Convert.ToInt32(value)); break; - case TypeCode.Int64: property.SetValue(item, Convert.ToInt64(value)); break; - case TypeCode.Decimal: property.SetValue(item, Convert.ToDecimal(value)); break; - case TypeCode.Double: property.SetValue(item, Convert.ToDouble(value)); break; - case TypeCode.Single: property.SetValue(item, Convert.ToSingle(value)); break; - case TypeCode.String: property.SetValue(item, Convert.ToString(value)); break; - case TypeCode.Boolean: property.SetValue(item, Convert.ToBoolean(value)); break; - case TypeCode.DateTime: property.SetValue(item, Convert.ToDateTime(value)); break; - case TypeCode.Object: property.SetValue(item, value); break; + Dispose(disposing: true); + GC.SuppressFinalize(this); } } - /** - * Workaround for comparing EventCallbacks correctly. It has been fixed only in .net 9 sadly. See: https://github.com/dotnet/aspnetcore/issues/53361 - * Basically access the Delegate and Receiver property that is not public for each callback and evaluate them manually. - */ - public static bool CompareEventCallbacks(T left, T right, ref Dictionary> eventFieldsDictionary) + // + // Summary: + // This mirrors the options for System.Text.Json.JsonSerializer that we allow for customization for the component serialization. + public class IgniteUIJsonSerializerOptions { - if (left.Equals(null) || right.Equals(null)) - { - return false; - } - if (left.GetHashCode() == right.GetHashCode() || left.Equals(right)) + public IgniteUIJsonSerializerOptions() { - return true; + MaxDepth = 32; } - Dictionary eventFields; - Type leftType = left.GetType(); - if (!eventFieldsDictionary.TryGetValue(leftType, out eventFields)) + public IgniteUIJsonSerializerOptions(int maxDepth) { - eventFields = new Dictionary { - { "Delegate", leftType.GetField("Delegate", BindingFlags.NonPublic | BindingFlags.Instance) }, - { "Receiver", leftType.GetField("Receiver", BindingFlags.NonPublic | BindingFlags.Instance) } - }; - eventFieldsDictionary.Add(leftType, eventFields); + MaxDepth = maxDepth; } - Delegate leftDelegate = (Delegate)(eventFields["Delegate"].GetValue(left)); - Delegate rightDelegate = (Delegate)(eventFields["Delegate"].GetValue(right)); - IHandleEvent leftHandle = (IHandleEvent)(eventFields["Receiver"].GetValue(left)); - IHandleEvent rightHandle = (IHandleEvent)(eventFields["Receiver"].GetValue(right)); - return leftDelegate.Equals(rightDelegate) && leftHandle.Equals(rightHandle); - } - - ~BaseRendererControl() - { - Dispose(disposing: false); - } - - public void Dispose() - { - Dispose(disposing: true); - GC.SuppressFinalize(this); - } -} + public int MaxDepth { get; private set; } -// -// Summary: -// This mirrors the options for System.Text.Json.JsonSerializer that we allow for customization for the component serialization. -public class IgniteUIJsonSerializerOptions -{ - public IgniteUIJsonSerializerOptions() - { - MaxDepth = 32; + public IgniteUIJsonSerializerOptions(IgniteUIJsonSerializerOptions options) + { + MaxDepth = options.MaxDepth; + } } - public IgniteUIJsonSerializerOptions(int maxDepth) + public interface IIgniteUIBlazorSettings { - MaxDepth = maxDepth; + bool ForceJsonDataMarshalling { get; } + IgniteUIJsonSerializerOptions JsonSerializerOptions { get; } + ReadOnlyCollection ModulesToLoad { get; } } - public int MaxDepth { get; private set; } - - public IgniteUIJsonSerializerOptions(IgniteUIJsonSerializerOptions options) + public class IgniteUIBlazorSettings + : IIgniteUIBlazorSettings { - MaxDepth = options.MaxDepth; - } -} + public bool ForceJsonDataMarshalling { get; private set; } + public IgniteUIJsonSerializerOptions JsonSerializerOptions { get; private set; } + public ReadOnlyCollection ModulesToLoad { get; private set; } -public interface IIgniteUIBlazorSettings -{ - bool ForceJsonDataMarshalling { get; } - IgniteUIJsonSerializerOptions JsonSerializerOptions { get; } - ReadOnlyCollection ModulesToLoad { get; } -} - -public class IgniteUIBlazorSettings - : IIgniteUIBlazorSettings -{ - public bool ForceJsonDataMarshalling { get; private set; } - public IgniteUIJsonSerializerOptions JsonSerializerOptions { get; private set; } - public ReadOnlyCollection ModulesToLoad { get; private set; } + public IgniteUIBlazorSettings() + { + ForceJsonDataMarshalling = false; + JsonSerializerOptions = new IgniteUIJsonSerializerOptions(); + ModulesToLoad = null; + } - public IgniteUIBlazorSettings() - { - ForceJsonDataMarshalling = false; - JsonSerializerOptions = new IgniteUIJsonSerializerOptions(); - ModulesToLoad = null; - } + public static IgniteUIBlazorSettings Create() + { + return new IgniteUIBlazorSettings(); + } - public static IgniteUIBlazorSettings Create() - { - return new IgniteUIBlazorSettings(); - } + public IgniteUIBlazorSettings ShouldForceJsonDataMarshalling() + { + var newSettings = new IgniteUIBlazorSettings(this); + newSettings.ForceJsonDataMarshalling = true; + return newSettings; + } - public IgniteUIBlazorSettings ShouldForceJsonDataMarshalling() - { - var newSettings = new IgniteUIBlazorSettings(this); - newSettings.ForceJsonDataMarshalling = true; - return newSettings; - } + public IgniteUIBlazorSettings WithForceJsonDataMarshalling(bool forceJsonDataMarshalling) + { + var newSettings = new IgniteUIBlazorSettings(this); + newSettings.ForceJsonDataMarshalling = forceJsonDataMarshalling; + return newSettings; + } - public IgniteUIBlazorSettings WithForceJsonDataMarshalling(bool forceJsonDataMarshalling) - { - var newSettings = new IgniteUIBlazorSettings(this); - newSettings.ForceJsonDataMarshalling = forceJsonDataMarshalling; - return newSettings; - } + public IgniteUIBlazorSettings WithJsonSerializerOptions(IgniteUIJsonSerializerOptions options) + { + var newSettings = new IgniteUIBlazorSettings(this); + newSettings.JsonSerializerOptions = new IgniteUIJsonSerializerOptions(options); + return newSettings; + } - public IgniteUIBlazorSettings WithJsonSerializerOptions(IgniteUIJsonSerializerOptions options) - { - var newSettings = new IgniteUIBlazorSettings(this); - newSettings.JsonSerializerOptions = new IgniteUIJsonSerializerOptions(options); - return newSettings; - } + public IgniteUIBlazorSettings WithModulesToLoad(ReadOnlyCollection modulesToLoad) + { + var newSettings = new IgniteUIBlazorSettings(this); + newSettings.ModulesToLoad = modulesToLoad; + return newSettings; + } - public IgniteUIBlazorSettings WithModulesToLoad(ReadOnlyCollection modulesToLoad) - { - var newSettings = new IgniteUIBlazorSettings(this); - newSettings.ModulesToLoad = modulesToLoad; - return newSettings; + internal IgniteUIBlazorSettings(IIgniteUIBlazorSettings settings) + { + ForceJsonDataMarshalling = settings.ForceJsonDataMarshalling; + JsonSerializerOptions = new IgniteUIJsonSerializerOptions(settings.JsonSerializerOptions); + ModulesToLoad = settings.ModulesToLoad; + } } - internal IgniteUIBlazorSettings(IIgniteUIBlazorSettings settings) + public interface IIgniteUIBlazor { - ForceJsonDataMarshalling = settings.ForceJsonDataMarshalling; - JsonSerializerOptions = new IgniteUIJsonSerializerOptions(settings.JsonSerializerOptions); - ModulesToLoad = settings.ModulesToLoad; + IJSRuntime JsRuntime { get; } + IIgniteUIBlazorSettings Settings { get; } + WebCallback WebCallback { get; } + void RequestLoad(string moduleName); + bool IsLoadRequested(string moduleName); + void MarkIsLoadRequested(string moduleName); + bool IsRuntimeValid(bool reevaluate = false); } -} - -public interface IIgniteUIBlazor { - IJSRuntime JsRuntime { get; } - IIgniteUIBlazorSettings Settings { get; } - WebCallback WebCallback { get; } - void RequestLoad(string moduleName); - bool IsLoadRequested(string moduleName); - void MarkIsLoadRequested(string moduleName); - bool IsRuntimeValid(bool reevaluate = false); -} -public class IgniteUIBlazor: IIgniteUIBlazor { - private bool _isRuntimeValid = false; - private bool _isRuntimeChecked = false; - private bool _isRemoteRuntime = false; - private System.Reflection.PropertyInfo _remoteRuntimeProp; - - public IgniteUIBlazor(IJSRuntime runtime, IIgniteUIBlazorSettings settings) + public class IgniteUIBlazor : IIgniteUIBlazor { - JsRuntime = runtime; - Settings = settings; - WebCallback = new WebCallback(); + private bool _isRuntimeValid = false; + private bool _isRuntimeChecked = false; + private bool _isRemoteRuntime = false; + private System.Reflection.PropertyInfo _remoteRuntimeProp; - if (IsRuntimeValid()) + public IgniteUIBlazor(IJSRuntime runtime, IIgniteUIBlazorSettings settings) { - if (Settings != null) + JsRuntime = runtime; + Settings = settings; + WebCallback = new WebCallback(); + + if (IsRuntimeValid()) { - if (Settings.ModulesToLoad != null) + if (Settings != null) { - foreach (var type in Settings.ModulesToLoad) + if (Settings.ModulesToLoad != null) { - var meth = type.GetMethod("Register", System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.Static); - if (meth != null) + foreach (var type in Settings.ModulesToLoad) { - var parms = meth.GetParameters(); - if (parms.Length == 1 && typeof(IIgniteUIBlazor).IsAssignableFrom(parms[0].ParameterType)) + var meth = type.GetMethod("Register", System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.Static); + if (meth != null) { - meth.Invoke(null, new object[] { this }); + var parms = meth.GetParameters(); + if (parms.Length == 1 && typeof(IIgniteUIBlazor).IsAssignableFrom(parms[0].ParameterType)) + { + meth.Invoke(null, new object[] { this }); + } } } } } } } - } - public IgniteUIBlazor(IJSRuntime runtime) - { - JsRuntime = runtime; - Settings = new IgniteUIBlazorSettings(); - WebCallback = new WebCallback(); - } + public IgniteUIBlazor(IJSRuntime runtime) + { + JsRuntime = runtime; + Settings = new IgniteUIBlazorSettings(); + WebCallback = new WebCallback(); + } - public IJSRuntime JsRuntime { get; private set; } - public IIgniteUIBlazorSettings Settings { get; private set; } - public WebCallback WebCallback { get; private set; } + public IJSRuntime JsRuntime { get; private set; } + public IIgniteUIBlazorSettings Settings { get; private set; } + public WebCallback WebCallback { get; private set; } - private ConcurrentDictionary _loadedCache = new ConcurrentDictionary(); - public void RequestLoad(string moduleName) - { - if (!IsRuntimeValid() || _loadedCache.ContainsKey(moduleName)) + private ConcurrentDictionary _loadedCache = new ConcurrentDictionary(); + public void RequestLoad(string moduleName) { - return; + if (!IsRuntimeValid() || _loadedCache.ContainsKey(moduleName)) + { + return; + } + _loadedCache.AddOrUpdate(moduleName, true, (name, oldValue) => true); + JsRuntime.InvokeAsync("igRequestLoad", moduleName); } - _loadedCache.AddOrUpdate(moduleName, true, (name, oldValue) => true); - JsRuntime.InvokeAsync("igRequestLoad", moduleName); - } - public bool IsLoadRequested(string moduleName) - { - if (_loadedCache.ContainsKey(moduleName)) + public bool IsLoadRequested(string moduleName) { - return true; + if (_loadedCache.ContainsKey(moduleName)) + { + return true; + } + return false; } - return false; - } - public void MarkIsLoadRequested(string moduleName) - { - if (!IsRuntimeValid() || _loadedCache.ContainsKey(moduleName)) + public void MarkIsLoadRequested(string moduleName) { - return; + if (!IsRuntimeValid() || _loadedCache.ContainsKey(moduleName)) + { + return; + } + _loadedCache.AddOrUpdate(moduleName, true, (name, oldValue) => true); } - _loadedCache.AddOrUpdate(moduleName, true, (name, oldValue) => true); - } - public bool IsRuntimeValid(bool reevaluate = false) - { - if (JsRuntime == null) - return false; - - if (!_isRuntimeChecked) + public bool IsRuntimeValid(bool reevaluate = false) { - var t = JsRuntime.GetType(); - _remoteRuntimeProp = t.GetProperty("IsInitialized"); - if (t.Name == "UnsupportedJavaScriptRuntime") - { - _isRuntimeValid = false; - } - else if (_remoteRuntimeProp != null) + if (JsRuntime == null) + return false; + + if (!_isRuntimeChecked) { - _isRuntimeValid = (bool)_remoteRuntimeProp.GetValue(JsRuntime); - _isRemoteRuntime = true; + var t = JsRuntime.GetType(); + _remoteRuntimeProp = t.GetProperty("IsInitialized"); + if (t.Name == "UnsupportedJavaScriptRuntime") + { + _isRuntimeValid = false; + } + else if (_remoteRuntimeProp != null) + { + _isRuntimeValid = (bool)_remoteRuntimeProp.GetValue(JsRuntime); + _isRemoteRuntime = true; + } + else + { + _isRuntimeValid = true; + } + + _isRuntimeChecked = true; } else { - _isRuntimeValid = true; - } - - _isRuntimeChecked = true; - } - else - { - if (reevaluate && _isRemoteRuntime) - { - _isRuntimeValid = (bool)_remoteRuntimeProp.GetValue(JsRuntime); + if (reevaluate && _isRemoteRuntime) + { + _isRuntimeValid = (bool)_remoteRuntimeProp.GetValue(JsRuntime); + } } + return _isRuntimeValid; } - return _isRuntimeValid; } -} -public class SequenceInfo -{ - private ReadOnlyCollection _attributeKeys = null; - public ReadOnlyCollection AttributeKeys + public class SequenceInfo { - get + private ReadOnlyCollection _attributeKeys = null; + public ReadOnlyCollection AttributeKeys { - if (_attributeKeys == null || - _dirty) + get { - _dirty = false; - _attributeKeys = new ReadOnlyCollection(_keysList); + if (_attributeKeys == null || + _dirty) + { + _dirty = false; + _attributeKeys = new ReadOnlyCollection(_keysList); + } + return _attributeKeys; } - return _attributeKeys; } - } - public int MaxSequence { get { return _currSequence; } } + public int MaxSequence { get { return _currSequence; } } - private Dictionary SequenceMap { get; set; } - private int _currSequence = 0; - private bool _dirty = true; - - internal SequenceInfo(int startSequence) - { - _currSequence = startSequence; - SequenceMap = new Dictionary(); - } + private Dictionary SequenceMap { get; set; } + private int _currSequence = 0; + private bool _dirty = true; - internal string TransformKey(string attributeKey) - { - if (_transforms.ContainsKey(attributeKey)) + internal SequenceInfo(int startSequence) { - return _transforms[attributeKey]; + _currSequence = startSequence; + SequenceMap = new Dictionary(); } - return attributeKey; - } - internal bool IsTransformedEnum(string attributeKey) - { - if (_enumTransforms.ContainsKey(attributeKey)) + internal string TransformKey(string attributeKey) { - return true; + if (_transforms.ContainsKey(attributeKey)) + { + return _transforms[attributeKey]; + } + return attributeKey; } - return false; - } - internal string TransformEnumValue(string attributeKey, string fieldName) - { - if (_enumTransforms.ContainsKey(attributeKey)) + internal bool IsTransformedEnum(string attributeKey) { - var d = _enumTransforms[attributeKey]; - if (d.ContainsKey(fieldName.ToLower())) { - return d[fieldName.ToLower()]; + if (_enumTransforms.ContainsKey(attributeKey)) + { + return true; } + return false; } - return fieldName; - } - internal void AddSequence(string attributeKey, string wcName = null, Dictionary wcEnumTransform = null) - { - if (!_keysSet.Contains(attributeKey)) + internal string TransformEnumValue(string attributeKey, string fieldName) { - _dirty = true; - _keysSet.Add(attributeKey); - SequenceMap.Add(attributeKey, _currSequence); - _currSequence++; - _keysList.Add(attributeKey); - - if (wcName != null) + if (_enumTransforms.ContainsKey(attributeKey)) { - _transforms[attributeKey] = wcName; + var d = _enumTransforms[attributeKey]; + if (d.ContainsKey(fieldName.ToLower())) + { + return d[fieldName.ToLower()]; + } } - if (wcEnumTransform != null) + return fieldName; + } + + internal void AddSequence(string attributeKey, string wcName = null, Dictionary wcEnumTransform = null) + { + if (!_keysSet.Contains(attributeKey)) { - _enumTransforms[attributeKey] = wcEnumTransform; + _dirty = true; + _keysSet.Add(attributeKey); + SequenceMap.Add(attributeKey, _currSequence); + _currSequence++; + _keysList.Add(attributeKey); + + if (wcName != null) + { + _transforms[attributeKey] = wcName; + } + if (wcEnumTransform != null) + { + _enumTransforms[attributeKey] = wcEnumTransform; + } } } - } - private List _keysList = new List(); - private HashSet _keysSet = new HashSet(); + private List _keysList = new List(); + private HashSet _keysSet = new HashSet(); - private Dictionary _transforms = new Dictionary(); - private Dictionary> _enumTransforms = new Dictionary>(); + private Dictionary _transforms = new Dictionary(); + private Dictionary> _enumTransforms = new Dictionary>(); - public int GetSequence(string key) - { - if (_keysSet.Contains(key)) + public int GetSequence(string key) { - return SequenceMap[key]; + if (_keysSet.Contains(key)) + { + return SequenceMap[key]; + } + return -1; } - return -1; } -} -public class ModuleLoader -{ - public static void Load(IIgniteUIBlazor runtime, string moduleName) + public class ModuleLoader { - runtime.RequestLoad(moduleName); - //runtime.JsRuntime.InvokeAsync("igRequestLoad", moduleName); - } + public static void Load(IIgniteUIBlazor runtime, string moduleName) + { + runtime.RequestLoad(moduleName); + //runtime.JsRuntime.InvokeAsync("igRequestLoad", moduleName); + } - public static void MarkIsLoadRequested(IIgniteUIBlazor runtime, string moduleName) { - runtime.MarkIsLoadRequested(moduleName); - } + public static void MarkIsLoadRequested(IIgniteUIBlazor runtime, string moduleName) + { + runtime.MarkIsLoadRequested(moduleName); + } - public static bool IsLoadRequested(IIgniteUIBlazor runtime, string moduleName) - { - return runtime.IsLoadRequested(moduleName); + public static bool IsLoadRequested(IIgniteUIBlazor runtime, string moduleName) + { + return runtime.IsLoadRequested(moduleName); + } } -} /// /// Enum defining different round trip date conversions. /// @@ -3410,4 +3699,4 @@ public enum RoundTripDateConversion Local } -} \ No newline at end of file +} diff --git a/src/componentsBase/BaseRendererElement.cs b/src/componentsBase/BaseRendererElement.cs index 0bc2a488..79ce09c1 100644 --- a/src/componentsBase/BaseRendererElement.cs +++ b/src/componentsBase/BaseRendererElement.cs @@ -1,15 +1,11 @@ -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System; -using System.Threading.Tasks; +using System.Reflection; using Microsoft.AspNetCore.Components; using Microsoft.AspNetCore.Components.Rendering; -using System.Reflection; namespace IgniteUI.Blazor.Controls { - public partial class BaseRendererElement : ComponentBase, JsonSerializable + public partial class BaseRendererElement : ComponentBase, JsonSerializable { // public BaseRendererElement() // { @@ -31,7 +27,7 @@ protected IIgniteUIBlazor IgBlazor // { // this.JsInProcessRuntime = (IJSInProcessRuntime)_igBlazor; // } - + EnsureModulesLoaded(); } } @@ -56,7 +52,8 @@ public bool IsComponentRooted } } - internal void AttachChild(BaseRendererElement child) { + internal void AttachChild(BaseRendererElement child) + { if (child == null) { return; @@ -73,7 +70,8 @@ internal void AttachChild(BaseRendererElement child) { } } } - internal void DetachChild(BaseRendererElement child) { + internal void DetachChild(BaseRendererElement child) + { if (child == null) { return; @@ -83,7 +81,6 @@ internal void DetachChild(BaseRendererElement child) { child.Parent = null; } } - protected virtual string ParentTypeName { @@ -103,7 +100,7 @@ protected virtual bool UseDirectRender [Parameter] public RenderFragment ChildContent { get; set; } - protected virtual bool SupportsVisualChildren + protected virtual bool SupportsVisualChildren { get { @@ -113,14 +110,14 @@ protected virtual bool SupportsVisualChildren protected override void BuildRenderTree(RenderTreeBuilder builder) { - if (ParentTypeName != null) + if (ParentTypeName != null) { - if (!SupportsVisualChildren) + if (!SupportsVisualChildren) { builder.OpenComponent>(0); builder.AddAttribute(1, "Value", this); builder.AddAttribute(2, "Name", ParentTypeName); - builder.AddAttribute(3, "ChildContent", (RenderFragment)delegate(RenderTreeBuilder builder2) + builder.AddAttribute(3, "ChildContent", (RenderFragment)delegate (RenderTreeBuilder builder2) { builder2.AddMarkupContent(4, "\r\n "); builder2.AddContent(5, ChildContent); @@ -142,7 +139,7 @@ protected override void BuildRenderTree(RenderTreeBuilder builder) builder.OpenComponent>(10); builder.AddAttribute(1, "Value", this); builder.AddAttribute(2, "Name", ParentTypeName); - builder.AddAttribute(3, "ChildContent", (RenderFragment)delegate(RenderTreeBuilder builder2) + builder.AddAttribute(3, "ChildContent", (RenderFragment)delegate (RenderTreeBuilder builder2) { builder2.AddMarkupContent(4, "\r\n "); builder2.OpenElement(5, "igc-portal-entrance"); @@ -172,15 +169,15 @@ protected override void BuildRenderTree(RenderTreeBuilder builder) protected Dictionary> eventCallbacksCache = new Dictionary>(); [Parameter] - public string Name + public string Name { - set + set { var oldName = _name; _name = value; OnElementNameChanged(this, oldName, _name); } - get + get { return _name; } @@ -190,16 +187,25 @@ protected void OnElementNameChanged(BaseRendererElement element, string oldName, { if (CurrParent != null) { - if (CurrParent is BaseRendererElement) { + if (CurrParent is BaseRendererElement) + { ((BaseRendererElement)CurrParent).OnElementNameChanged(element, oldName, newName); - } else { + } + else + { ((BaseRendererControl)CurrParent).OnElementNameChanged(element, oldName, newName); } - } else { - _deferredNameChanges.Add(() => { - if (CurrParent is BaseRendererElement) { + } + else + { + _deferredNameChanges.Add(() => + { + if (CurrParent is BaseRendererElement) + { ((BaseRendererElement)CurrParent).OnElementNameChanged(element, oldName, newName); - } else { + } + else + { ((BaseRendererControl)CurrParent).OnElementNameChanged(element, oldName, newName); } }); @@ -221,8 +227,8 @@ internal object TempParent private Object _parent = null; - - private class RefChange { + private class RefChange + { public String propertyName; public Object oldValue; public Object newValue; @@ -234,7 +240,8 @@ private class RefChange { private List _queuedTemplateUpdates = new List(); private List _deferredNameChanges = new List(); - private void QueueRefChange(String propertyName, Object oldValue, Object newValue, bool isScript, bool isElement, Action refChanged) { + private void QueueRefChange(String propertyName, Object oldValue, Object newValue, bool isScript, bool isElement, Action refChanged) + { RefChange c = new RefChange(); c.propertyName = propertyName; c.oldValue = oldValue; @@ -245,8 +252,10 @@ private void QueueRefChange(String propertyName, Object oldValue, Object newValu _queuedChanges.AddLast(c); } - private void FlushRefs() { - while (_queuedChanges.Count > 0) { + private void FlushRefs() + { + while (_queuedChanges.Count > 0) + { RefChange c = _queuedChanges.First.Value; _queuedChanges.RemoveFirst(); OnRefChanged(c.propertyName, c.oldValue, c.newValue, c.isScript, c.isElement, c.refChanged); @@ -259,16 +268,17 @@ public object Parent { return _parent; } - internal set + internal set { - Object oldParent = _parent; + Object oldParent = _parent; _parent = value; _serializeDirty = true; - if (_parent != null) { + if (_parent != null) + { FlushRefs(); - if (_deferredHandlers.Count > 0) + if (_deferredHandlers.Count > 0) { - foreach(var handler in _deferredHandlers) + foreach (var handler in _deferredHandlers) { handler(); } @@ -276,7 +286,7 @@ internal set } if (_deferredNameChanges.Count > 0) { - foreach(var handler in _deferredNameChanges) + foreach (var handler in _deferredNameChanges) { handler(); } @@ -284,7 +294,7 @@ internal set } if (_queuedTemplateUpdates.Count > 0) { - foreach(var template in _queuedTemplateUpdates) + foreach (var template in _queuedTemplateUpdates) { template(); } @@ -294,16 +304,21 @@ internal set } } - void ChildDirty(object child) { + void ChildDirty(object child) + { _serializeDirty = true; if (_suppressParentNotify) { return; } - if (_parent != null) { - if (_parent is BaseRendererControl) { + if (_parent != null) + { + if (_parent is BaseRendererControl) + { ((BaseRendererControl)_parent).ChildDirty(this); - } else { + } + else + { ((BaseRendererElement)_parent).ChildDirty(this); } } @@ -317,67 +332,91 @@ protected virtual string MethodTarget } } - protected async Task InvokeMethod(string methodName, object[] arguments, string[] types, ElementReference[] nativeElements = null) { + protected async Task InvokeMethod(string methodName, object[] arguments, string[] types, ElementReference[] nativeElements = null) + { return await InvokeMethodHelper(MethodTarget, methodName, arguments, types, nativeElements); } - protected object InvokeMethodSync(string methodName, object[] arguments, string[] types, ElementReference[] nativeElements = null) { + protected object InvokeMethodSync(string methodName, object[] arguments, string[] types, ElementReference[] nativeElements = null) + { return InvokeMethodHelperSync(MethodTarget, methodName, arguments, types, nativeElements); } - protected async Task InvokeMethodHelper(string target, string methodName, object[] arguments, string[] types, ElementReference[] nativeElements) { - if (CurrParent == null) { + protected async Task InvokeMethodHelper(string target, string methodName, object[] arguments, string[] types, ElementReference[] nativeElements) + { + if (CurrParent == null) + { throw new InvalidOperationException("cannot invoke method if not attached to parent."); } - if (CurrParent is BaseRendererElement) { + if (CurrParent is BaseRendererElement) + { return await ((BaseRendererElement)CurrParent).InvokeMethodHelper(target, methodName, arguments, types, nativeElements); - } else { + } + else + { return await ((BaseRendererControl)CurrParent).InvokeMethodHelper(target, methodName, arguments, types, nativeElements); } } - protected object InvokeMethodHelperSync(string target, string methodName, object[] arguments, string[] types, ElementReference[] nativeElements) { - if (CurrParent == null) { + protected object InvokeMethodHelperSync(string target, string methodName, object[] arguments, string[] types, ElementReference[] nativeElements) + { + if (CurrParent == null) + { throw new InvalidOperationException("cannot invoke method if not attached to parent."); } - if (CurrParent is BaseRendererElement) { + if (CurrParent is BaseRendererElement) + { return ((BaseRendererElement)CurrParent).InvokeMethodHelperSync(target, methodName, arguments, types, nativeElements); - } else { + } + else + { return ((BaseRendererControl)CurrParent).InvokeMethodHelperSync(target, methodName, arguments, types, nativeElements); } } internal void OnPropertyPropagatedOut(string name, string propertyName) { - if (CurrParent == null) { + if (CurrParent == null) + { throw new InvalidOperationException("cannot invoke method if not attached to parent."); } - if (CurrParent is BaseRendererElement) { + if (CurrParent is BaseRendererElement) + { ((BaseRendererElement)CurrParent).OnPropertyPropagatedOut(name, propertyName); - } else { + } + else + { ((BaseRendererControl)CurrParent).OnPropertyPropagatedOut(name, propertyName); } } internal void UpdateTemplate(string contentType, object template, Type type) { - Action templateUpdate = () => { - if (_parent is BaseRendererControl) { + Action templateUpdate = () => + { + if (_parent is BaseRendererControl) + { ((BaseRendererControl)_parent).ChildDirty(this); ((BaseRendererControl)_parent).UpdateTemplate(contentType, template, type); - } else { + } + else + { ((BaseRendererElement)_parent).ChildDirty(this); ((BaseRendererElement)_parent).UpdateTemplate(contentType, template, type); } }; - if (_parent != null) { + if (_parent != null) + { templateUpdate(); - } else { + } + else + { _queuedTemplateUpdates.Add(templateUpdate); } } - internal void OnRefChanged(string propertyName, object oldValue, object newValue, bool isScript, bool isElement, Action refChanged) { + internal void OnRefChanged(string propertyName, object oldValue, object newValue, bool isScript, bool isElement, Action refChanged) + { _isDirtyRef[propertyName] = true; _isDirty[propertyName] = true; _hasDirty = true; @@ -386,15 +425,21 @@ internal void OnRefChanged(string propertyName, object oldValue, object newValue { return; } - if (_parent != null) { - if (_parent is BaseRendererControl) { + if (_parent != null) + { + if (_parent is BaseRendererControl) + { ((BaseRendererControl)_parent).ChildDirty(this); ((BaseRendererControl)_parent).OnRefChanged(_name + "/" + propertyName, oldValue, newValue, isScript, isElement, refChanged); - } else { + } + else + { ((BaseRendererElement)_parent).ChildDirty(this); ((BaseRendererElement)_parent).OnRefChanged(_name + "/" + propertyName, oldValue, newValue, isScript, isElement, refChanged); } - } else { + } + else + { QueueRefChange(propertyName, oldValue, newValue, isScript, isElement, refChanged); } } @@ -412,7 +457,8 @@ internal bool SuppressParentNotify } } - internal void MarkPropDirty(String propertyName) { + internal void MarkPropDirty(String propertyName) + { _isDirty[propertyName] = true; _hasDirty = true; _serializeDirty = true; @@ -420,17 +466,23 @@ internal void MarkPropDirty(String propertyName) { { return; } - if (_parent != null) { - if (_parent is BaseRendererControl) { + if (_parent != null) + { + if (_parent is BaseRendererControl) + { ((BaseRendererControl)_parent).ChildDirty(this); - } else { + } + else + { ((BaseRendererElement)_parent).ChildDirty(this); } } } - protected bool IsPropDirty(string propertyName) { - if (_isDirty.ContainsKey(propertyName)) { + protected bool IsPropDirty(string propertyName) + { + if (_isDirty.ContainsKey(propertyName)) + { return _isDirty[propertyName]; } @@ -452,10 +504,11 @@ internal bool MustSerializeByValue } } - - internal virtual void SerializeCore(RendererSerializer ser) { + internal virtual void SerializeCore(RendererSerializer ser) + { ser.AddStringProp("name", _name); - if (MustSerializeByValue) { + if (MustSerializeByValue) + { ser.AddBooleanProp("___byValue", true); } } @@ -466,7 +519,7 @@ public virtual string Type { get { - var typeName = (this.GetType().Name.Replace("View", "View")); + var typeName = (this.GetType().Name.Replace("View", "View")); if (typeName.StartsWith("Igb")) { typeName = typeName.Substring(3); @@ -484,14 +537,16 @@ public void Serialize(SerializationContext context, string propertyName = null) ser.End(); } - public string Serialize() { - if (_serializeDirty) { - using(var stream = new System.IO.MemoryStream()) + public string Serialize() + { + if (_serializeDirty) + { + using (var stream = new System.IO.MemoryStream()) { System.Text.Json.Utf8JsonWriter uw = new System.Text.Json.Utf8JsonWriter(stream); SerializationContext c = new SerializationContext(uw, null); //RendererSerializer ser = new RendererSerializer(uw); - + Serialize(c); uw.Flush(); _cachedSerializedContent = System.Text.Encoding.UTF8.GetString(stream.ToArray()); @@ -501,8 +556,10 @@ public string Serialize() { return _cachedSerializedContent; } - protected void EnsureValid() { - if (_parent == null && _tempParent == null) { + protected void EnsureValid() + { + if (_parent == null && _tempParent == null) + { throw new InvalidOperationException("must be attached to parent to do this."); } } @@ -517,251 +574,358 @@ protected object CurrParent } return _tempParent; } - } + } - internal T ReturnToObject(Object val) { + internal T ReturnToObject(Object val) + { return ReturnToObject(val, null); } - internal T ReturnToObject(Object val, string? typeGuess) { + internal T ReturnToObject(Object val, string? typeGuess) + { EnsureValid(); - if (CurrParent is BaseRendererElement) { - return ((BaseRendererElement) CurrParent).ReturnToObject(val, typeGuess); - } else { - return ((BaseRendererControl) CurrParent).ReturnToObject(val, typeGuess); + if (CurrParent is BaseRendererElement) + { + return ((BaseRendererElement)CurrParent).ReturnToObject(val, typeGuess); + } + else + { + return ((BaseRendererControl)CurrParent).ReturnToObject(val, typeGuess); } } - internal int ReturnToInt(Object val) { + internal int ReturnToInt(Object val) + { EnsureValid(); - if (CurrParent is BaseRendererElement) { - return ((BaseRendererElement) CurrParent).ReturnToInt(val); - } else { - return ((BaseRendererControl) CurrParent).ReturnToInt(val); + if (CurrParent is BaseRendererElement) + { + return ((BaseRendererElement)CurrParent).ReturnToInt(val); + } + else + { + return ((BaseRendererControl)CurrParent).ReturnToInt(val); } } - internal double ReturnToDouble(Object val) { + internal double ReturnToDouble(Object val) + { EnsureValid(); - if (CurrParent is BaseRendererElement) { - return ((BaseRendererElement) CurrParent).ReturnToDouble(val); - } else { - return ((BaseRendererControl) CurrParent).ReturnToDouble(val); + if (CurrParent is BaseRendererElement) + { + return ((BaseRendererElement)CurrParent).ReturnToDouble(val); + } + else + { + return ((BaseRendererControl)CurrParent).ReturnToDouble(val); } } - internal long ReturnToLong(Object val) { + internal long ReturnToLong(Object val) + { EnsureValid(); - if (CurrParent is BaseRendererElement) { - return ((BaseRendererElement) CurrParent).ReturnToLong(val); - } else { - return ((BaseRendererControl) CurrParent).ReturnToLong(val); + if (CurrParent is BaseRendererElement) + { + return ((BaseRendererElement)CurrParent).ReturnToLong(val); + } + else + { + return ((BaseRendererControl)CurrParent).ReturnToLong(val); } } - internal DateTime ReturnToDate(Object val) { + internal DateTime ReturnToDate(Object val) + { EnsureValid(); - if (CurrParent is BaseRendererElement) { - return ((BaseRendererElement) CurrParent).ReturnToDate(val); - } else { - return ((BaseRendererControl) CurrParent).ReturnToDate(val); + if (CurrParent is BaseRendererElement) + { + return ((BaseRendererElement)CurrParent).ReturnToDate(val); + } + else + { + return ((BaseRendererControl)CurrParent).ReturnToDate(val); } } - internal String ComponentToJson(object val, int index) { + internal String ComponentToJson(object val, int index) + { EnsureValid(); - if (CurrParent is BaseRendererElement) { - return ((BaseRendererElement) CurrParent).ComponentToJson(val, index); - } else { - return ((BaseRendererControl) CurrParent).ComponentToJson(val, index); + if (CurrParent is BaseRendererElement) + { + return ((BaseRendererElement)CurrParent).ComponentToJson(val, index); + } + else + { + return ((BaseRendererControl)CurrParent).ComponentToJson(val, index); } } - internal string DateToString(DateTime val) { + internal string DateToString(DateTime val) + { EnsureValid(); - if (CurrParent is BaseRendererElement) { - return ((BaseRendererElement) CurrParent).DateToString(val); - } else { - return ((BaseRendererControl) CurrParent).DateToString(val); + if (CurrParent is BaseRendererElement) + { + return ((BaseRendererElement)CurrParent).DateToString(val); + } + else + { + return ((BaseRendererControl)CurrParent).DateToString(val); } } - internal string BooleanToString(bool val) { + internal string BooleanToString(bool val) + { EnsureValid(); - if (CurrParent is BaseRendererElement) { - return ((BaseRendererElement) CurrParent).BooleanToString(val); - } else { - return ((BaseRendererControl) CurrParent).BooleanToString(val); + if (CurrParent is BaseRendererElement) + { + return ((BaseRendererElement)CurrParent).BooleanToString(val); + } + else + { + return ((BaseRendererControl)CurrParent).BooleanToString(val); } } - internal string EnumToString(T val) where T: struct { + internal string EnumToString(T val) where T : struct + { EnsureValid(); - if (CurrParent is BaseRendererElement) { - return ((BaseRendererElement) CurrParent).EnumToString(val); - } else { - return ((BaseRendererControl) CurrParent).EnumToString(val); + if (CurrParent is BaseRendererElement) + { + return ((BaseRendererElement)CurrParent).EnumToString(val); + } + else + { + return ((BaseRendererControl)CurrParent).EnumToString(val); } } - internal T StringToEnum(Object val) where T: struct { + internal T StringToEnum(Object val) where T : struct + { EnsureValid(); - if (CurrParent is BaseRendererElement) { - return ((BaseRendererElement) CurrParent).StringToEnum(val); - } else { - return ((BaseRendererControl) CurrParent).StringToEnum(val); + if (CurrParent is BaseRendererElement) + { + return ((BaseRendererElement)CurrParent).StringToEnum(val); + } + else + { + return ((BaseRendererControl)CurrParent).StringToEnum(val); } } - internal string ObjectArrayToParam(object[] arr) { - EnsureValid(); - if (CurrParent is BaseRendererElement) { - return ((BaseRendererElement) CurrParent).ObjectArrayToParam(arr); - } else { - return ((BaseRendererControl) CurrParent).ObjectArrayToParam(arr); + internal string ObjectArrayToParam(object[] arr) + { + EnsureValid(); + if (CurrParent is BaseRendererElement) + { + return ((BaseRendererElement)CurrParent).ObjectArrayToParam(arr); + } + else + { + return ((BaseRendererControl)CurrParent).ObjectArrayToParam(arr); + } } - } - internal object[] ReturnToObjectArray(Object val) { - EnsureValid(); - if (CurrParent is BaseRendererElement) { - return ((BaseRendererElement) CurrParent).ReturnToObjectArray(val); - } else { - return ((BaseRendererControl) CurrParent).ReturnToObjectArray(val); + internal object[] ReturnToObjectArray(Object val) + { + EnsureValid(); + if (CurrParent is BaseRendererElement) + { + return ((BaseRendererElement)CurrParent).ReturnToObjectArray(val); + } + else + { + return ((BaseRendererControl)CurrParent).ReturnToObjectArray(val); + } } - } - internal T[] ReturnToObjectArray(Object val) { - return ReturnToObjectArray(val, null); - } - internal T[] ReturnToObjectArray(Object val, string typeGuess) { - EnsureValid(); - if (CurrParent is BaseRendererElement) { - return ((BaseRendererElement) CurrParent).ReturnToObjectArray(val, typeGuess); - } else { - return ((BaseRendererControl) CurrParent).ReturnToObjectArray(val, typeGuess); + internal T[] ReturnToObjectArray(Object val) + { + return ReturnToObjectArray(val, null); + } + internal T[] ReturnToObjectArray(Object val, string typeGuess) + { + EnsureValid(); + if (CurrParent is BaseRendererElement) + { + return ((BaseRendererElement)CurrParent).ReturnToObjectArray(val, typeGuess); + } + else + { + return ((BaseRendererControl)CurrParent).ReturnToObjectArray(val, typeGuess); + } } - } - internal string[] ReturnToStringArray(Object val) { - EnsureValid(); - if (CurrParent is BaseRendererElement) { - return ((BaseRendererElement) CurrParent).ReturnToStringArray(val); - } else { - return ((BaseRendererControl) CurrParent).ReturnToStringArray(val); + internal string[] ReturnToStringArray(Object val) + { + EnsureValid(); + if (CurrParent is BaseRendererElement) + { + return ((BaseRendererElement)CurrParent).ReturnToStringArray(val); + } + else + { + return ((BaseRendererControl)CurrParent).ReturnToStringArray(val); + } } - } - internal int[] ReturnToIntArray(Object val) { - EnsureValid(); - if (CurrParent is BaseRendererElement) { - return ((BaseRendererElement) CurrParent).ReturnToIntArray(val); - } else { - return ((BaseRendererControl) CurrParent).ReturnToIntArray(val); + internal int[] ReturnToIntArray(Object val) + { + EnsureValid(); + if (CurrParent is BaseRendererElement) + { + return ((BaseRendererElement)CurrParent).ReturnToIntArray(val); + } + else + { + return ((BaseRendererControl)CurrParent).ReturnToIntArray(val); + } } - } - internal double[] ReturnToDoubleArray(Object val) { - EnsureValid(); - if (CurrParent is BaseRendererElement) { - return ((BaseRendererElement) CurrParent).ReturnToDoubleArray(val); - } else { - return ((BaseRendererControl) CurrParent).ReturnToDoubleArray(val); + internal double[] ReturnToDoubleArray(Object val) + { + EnsureValid(); + if (CurrParent is BaseRendererElement) + { + return ((BaseRendererElement)CurrParent).ReturnToDoubleArray(val); + } + else + { + return ((BaseRendererControl)CurrParent).ReturnToDoubleArray(val); + } } - } - internal string ObjectToParam(object val) { + internal string ObjectToParam(object val) + { EnsureValid(); - if (CurrParent is BaseRendererElement) { - return ((BaseRendererElement) CurrParent).ObjectToParam(val); - } else { - return ((BaseRendererControl) CurrParent).ObjectToParam(val); + if (CurrParent is BaseRendererElement) + { + return ((BaseRendererElement)CurrParent).ObjectToParam(val); + } + else + { + return ((BaseRendererControl)CurrParent).ObjectToParam(val); } } - internal string ObjectToParam(object val, Type type) { + internal string ObjectToParam(object val, Type type) + { EnsureValid(); - if (CurrParent is BaseRendererElement) { - return ((BaseRendererElement) CurrParent).ObjectToParam(val, type); - } else { - return ((BaseRendererControl) CurrParent).ObjectToParam(val, type); + if (CurrParent is BaseRendererElement) + { + return ((BaseRendererElement)CurrParent).ObjectToParam(val, type); + } + else + { + return ((BaseRendererControl)CurrParent).ObjectToParam(val, type); } } - internal void ObjectToParam(SerializationContext c, string propertyName, object val) { + internal void ObjectToParam(SerializationContext c, string propertyName, object val) + { EnsureValid(); - if (CurrParent is BaseRendererElement) { - ((BaseRendererElement) CurrParent).ObjectToParam(c, propertyName, val); - } else { - ((BaseRendererControl) CurrParent).ObjectToParam(c, propertyName, val); + if (CurrParent is BaseRendererElement) + { + ((BaseRendererElement)CurrParent).ObjectToParam(c, propertyName, val); + } + else + { + ((BaseRendererControl)CurrParent).ObjectToParam(c, propertyName, val); } } - internal void ObjectToParam(SerializationContext c, object val) { + internal void ObjectToParam(SerializationContext c, object val) + { EnsureValid(); - if (CurrParent is BaseRendererElement) { - ((BaseRendererElement) CurrParent).ObjectToParam(c, val); - } else { - ((BaseRendererControl) CurrParent).ObjectToParam(c, val); + if (CurrParent is BaseRendererElement) + { + ((BaseRendererElement)CurrParent).ObjectToParam(c, val); + } + else + { + ((BaseRendererControl)CurrParent).ObjectToParam(c, val); } } - internal string ReturnToString(object val) { + internal string ReturnToString(object val) + { EnsureValid(); - if (CurrParent is BaseRendererElement) { - return ((BaseRendererElement) CurrParent).ReturnToString(val); - } else { - return ((BaseRendererControl) CurrParent).ReturnToString(val); + if (CurrParent is BaseRendererElement) + { + return ((BaseRendererElement)CurrParent).ReturnToString(val); + } + else + { + return ((BaseRendererControl)CurrParent).ReturnToString(val); } } - internal bool ReturnToBoolean(object val) { + internal bool ReturnToBoolean(object val) + { EnsureValid(); - if (CurrParent is BaseRendererElement) { - return ((BaseRendererElement) CurrParent).ReturnToBoolean(val); - } else { - return ((BaseRendererControl) CurrParent).ReturnToBoolean(val); + if (CurrParent is BaseRendererElement) + { + return ((BaseRendererElement)CurrParent).ReturnToBoolean(val); + } + else + { + return ((BaseRendererControl)CurrParent).ReturnToBoolean(val); } } - internal object ConvertReturnValue(object val, string typeGuess = null, bool acceptsNullIfMarshalDoesNotExist = false) { + internal object ConvertReturnValue(object val, string typeGuess = null, bool acceptsNullIfMarshalDoesNotExist = false) + { EnsureValid(); - if (CurrParent is BaseRendererElement) { - return ((BaseRendererElement) CurrParent).ConvertReturnValue(val, typeGuess, acceptsNullIfMarshalDoesNotExist); - } else { - return ((BaseRendererControl) CurrParent).ConvertReturnValue(val, false, typeGuess, acceptsNullIfMarshalDoesNotExist); + if (CurrParent is BaseRendererElement) + { + return ((BaseRendererElement)CurrParent).ConvertReturnValue(val, typeGuess, acceptsNullIfMarshalDoesNotExist); + } + else + { + return ((BaseRendererControl)CurrParent).ConvertReturnValue(val, false, typeGuess, acceptsNullIfMarshalDoesNotExist); } } - internal object ReturnToPrimitive(object val) { + internal object ReturnToPrimitive(object val) + { EnsureValid(); - if (CurrParent is BaseRendererElement) { - return ((BaseRendererElement) CurrParent).ReturnToPrimitive(val); - } else { - return ((BaseRendererControl) CurrParent).ReturnToPrimitive(val); + if (CurrParent is BaseRendererElement) + { + return ((BaseRendererElement)CurrParent).ReturnToPrimitive(val); + } + else + { + return ((BaseRendererControl)CurrParent).ReturnToPrimitive(val); } } - internal T[] DowncastArray(object val) { + internal T[] DowncastArray(object val) + { EnsureValid(); - if (CurrParent is BaseRendererElement) { - return ((BaseRendererElement) CurrParent).DowncastArray(val); - } else { - return ((BaseRendererControl) CurrParent).DowncastArray(val); + if (CurrParent is BaseRendererElement) + { + return ((BaseRendererElement)CurrParent).DowncastArray(val); + } + else + { + return ((BaseRendererControl)CurrParent).DowncastArray(val); } } private List _deferredHandlers = new List(); - internal void SetHandler(string name, string propertyName, EventCallback? handler, Action onArgs = null) where T: BaseRendererElement, new() { - Action add = () => { - if (CurrParent is BaseRendererElement) { - ((BaseRendererElement) CurrParent).SetHandler(name, propertyName, handler, onArgs); - } else { - ((BaseRendererControl) CurrParent).SetHandler(name, propertyName, handler, onArgs); + internal void SetHandler(string name, string propertyName, EventCallback? handler, Action onArgs = null) where T : BaseRendererElement, new() + { + Action add = () => + { + if (CurrParent is BaseRendererElement) + { + ((BaseRendererElement)CurrParent).SetHandler(name, propertyName, handler, onArgs); + } + else + { + ((BaseRendererControl)CurrParent).SetHandler(name, propertyName, handler, onArgs); } }; - + if (_parent == null) { _deferredHandlers.Add(add); @@ -770,15 +934,20 @@ internal T[] DowncastArray(object val) { add(); } - internal void SetHandlerSimple(string name, string propertyName, EventCallback? handler, Func getReturn, Action onArgs = null) { - Action add = () => { - if (CurrParent is BaseRendererElement) { - ((BaseRendererElement) CurrParent).SetHandlerSimple(name, propertyName, handler, getReturn, onArgs); - } else { - ((BaseRendererControl) CurrParent).SetHandlerSimple(name, propertyName, handler, getReturn, onArgs); + internal void SetHandlerSimple(string name, string propertyName, EventCallback? handler, Func getReturn, Action onArgs = null) + { + Action add = () => + { + if (CurrParent is BaseRendererElement) + { + ((BaseRendererElement)CurrParent).SetHandlerSimple(name, propertyName, handler, getReturn, onArgs); + } + else + { + ((BaseRendererControl)CurrParent).SetHandlerSimple(name, propertyName, handler, getReturn, onArgs); } }; - + if (_parent == null) { _deferredHandlers.Add(add); @@ -787,108 +956,145 @@ internal void SetHandlerSimple(string name, string propertyName, EventCallbac add(); } - internal void SetActionHandler(string name, string propertyName, Action handler, Action onArgs = null) where T: BaseRendererElement, new() { - Action add = () => { - if (CurrParent is BaseRendererElement) { - ((BaseRendererElement) CurrParent).SetActionHandler(name, propertyName, handler, onArgs); - } else { - ((BaseRendererControl) CurrParent).SetActionHandler(name, propertyName, handler, onArgs); + internal void SetActionHandler(string name, string propertyName, Action handler, Action onArgs = null) where T : BaseRendererElement, new() + { + Action add = () => + { + if (CurrParent is BaseRendererElement) + { + ((BaseRendererElement)CurrParent).SetActionHandler(name, propertyName, handler, onArgs); + } + else + { + ((BaseRendererControl)CurrParent).SetActionHandler(name, propertyName, handler, onArgs); } }; - + if (_parent == null) { _deferredHandlers.Add(add); return; } add(); - + } - internal void SetActionHandlerSimple(string name, string propertyName, Action handler, Func getReturn, Action onArgs = null) { - Action add = () => { - if (CurrParent is BaseRendererElement) { - ((BaseRendererElement) CurrParent).SetActionHandlerSimple(name, propertyName, handler, getReturn, onArgs); - } else { - ((BaseRendererControl) CurrParent).SetActionHandlerSimple(name, propertyName, handler, getReturn, onArgs); + internal void SetActionHandlerSimple(string name, string propertyName, Action handler, Func getReturn, Action onArgs = null) + { + Action add = () => + { + if (CurrParent is BaseRendererElement) + { + ((BaseRendererElement)CurrParent).SetActionHandlerSimple(name, propertyName, handler, getReturn, onArgs); + } + else + { + ((BaseRendererControl)CurrParent).SetActionHandlerSimple(name, propertyName, handler, getReturn, onArgs); } }; - + if (_parent == null) { _deferredHandlers.Add(add); return; } - add(); + add(); } - internal string StringToString(object val) { + internal string StringToString(object val) + { EnsureValid(); - if (CurrParent is BaseRendererElement) { - return ((BaseRendererElement) CurrParent).StringToString(val); - } else { - return ((BaseRendererControl) CurrParent).StringToString(val); + if (CurrParent is BaseRendererElement) + { + return ((BaseRendererElement)CurrParent).StringToString(val); + } + else + { + return ((BaseRendererControl)CurrParent).StringToString(val); } } - internal string StringArrayToString(string[] val) { + internal string StringArrayToString(string[] val) + { EnsureValid(); - if (CurrParent is BaseRendererElement) { - return ((BaseRendererElement) CurrParent).StringArrayToString(val); - } else { - return ((BaseRendererControl) CurrParent).StringArrayToString(val); + if (CurrParent is BaseRendererElement) + { + return ((BaseRendererElement)CurrParent).StringArrayToString(val); + } + else + { + return ((BaseRendererControl)CurrParent).StringArrayToString(val); } } - internal string IntArrayToString(int[] val) { + internal string IntArrayToString(int[] val) + { EnsureValid(); - if (CurrParent is BaseRendererElement) { - return ((BaseRendererElement) CurrParent).IntArrayToString(val); - } else { - return ((BaseRendererControl) CurrParent).IntArrayToString(val); + if (CurrParent is BaseRendererElement) + { + return ((BaseRendererElement)CurrParent).IntArrayToString(val); + } + else + { + return ((BaseRendererControl)CurrParent).IntArrayToString(val); } } - internal string DoubleArrayToString(double[] val) { + internal string DoubleArrayToString(double[] val) + { EnsureValid(); - if (CurrParent is BaseRendererElement) { - return ((BaseRendererElement) CurrParent).DoubleArrayToString(val); - } else { - return ((BaseRendererControl) CurrParent).DoubleArrayToString(val); + if (CurrParent is BaseRendererElement) + { + return ((BaseRendererElement)CurrParent).DoubleArrayToString(val); + } + else + { + return ((BaseRendererControl)CurrParent).DoubleArrayToString(val); } } - - protected internal virtual void FromEventJson(BaseRendererControl control, Dictionary args) { + protected internal virtual void FromEventJson(BaseRendererControl control, Dictionary args) + { } - protected internal virtual void ToEventJson(BaseRendererControl control, Dictionary args) { + protected internal virtual void ToEventJson(BaseRendererControl control, Dictionary args) + { } public virtual object FindByName(string name) - { - - return null; - } + { - protected async Task SetResourceStringAsync(string grouping, string id, string value) { - if (CurrParent == null) { + return null; + } + + protected async Task SetResourceStringAsync(string grouping, string id, string value) + { + if (CurrParent == null) + { throw new InvalidOperationException("cannot set resource strings if not attached to parent."); } - if (CurrParent is BaseRendererElement) { + if (CurrParent is BaseRendererElement) + { return await ((BaseRendererElement)CurrParent).SetResourceStringAsync(grouping, id, value); - } else { + } + else + { return await ((BaseRendererControl)CurrParent).SetResourceStringAsync(grouping, id, value); } } - protected async Task SetResourceStringAsync(string grouping, string json) { - if (CurrParent == null) { + protected async Task SetResourceStringAsync(string grouping, string json) + { + if (CurrParent == null) + { throw new InvalidOperationException("cannot set resource strings if not attached to parent."); } - if (CurrParent is BaseRendererElement) { + if (CurrParent is BaseRendererElement) + { return await ((BaseRendererElement)CurrParent).SetResourceStringAsync(grouping, json); - } else { + } + else + { return await ((BaseRendererControl)CurrParent).SetResourceStringAsync(grouping, json); } } @@ -903,4 +1109,4 @@ protected static bool CompareEventCallbacks(T left, T right, ref Dictionary - where T: class - where J: class { - private IList _queryItems; - private IList _manualItems = new List(); - - private IList _allList; - private IList _target; - private IList _query; - private Func _toTarget; - private Action _onItemAdded; - private Action _onItemRemoved; - - - - private bool _hasShiftedOnceAlready; - - public CollectionAdapter(IList query, IList target, IList allList, Func toTarget, Action onItemAdded, Action onItemRemoved, Func collisionChecker = null) { - if (collisionChecker != null) { - this._collisionChecker = collisionChecker; - } - this._query = query; - this._target = target; - this._toTarget = toTarget; - this._allList = allList; + internal class CollectionAdapter + where T : class + where J : class + { + private IList _queryItems; + private IList _manualItems = new List(); + + private IList _allList; + private IList _target; + private IList _query; + private Func _toTarget; + private Action _onItemAdded; + private Action _onItemRemoved; + + private bool _hasShiftedOnceAlready; + + public CollectionAdapter(IList query, IList target, IList allList, Func toTarget, Action onItemAdded, Action onItemRemoved, Func collisionChecker = null) + { + if (collisionChecker != null) + { + this._collisionChecker = collisionChecker; + } + this._query = query; + this._target = target; + this._toTarget = toTarget; + this._allList = allList; - this._onItemAdded = onItemAdded; - this._onItemRemoved = onItemRemoved; + this._onItemAdded = onItemAdded; + this._onItemRemoved = onItemRemoved; - this.SyncItems(); + this.SyncItems(); - if (this._query is INotifyCollectionChanged) { - ((INotifyCollectionChanged)this._query).CollectionChanged += (s, o) => this.OnQueryChanged(); + if (this._query is INotifyCollectionChanged) + { + ((INotifyCollectionChanged)this._query).CollectionChanged += (s, o) => this.OnQueryChanged(); + } } - } - private Func _collisionChecker = null; + private Func _collisionChecker = null; - public Func CollisionChecker { - get { - return this._collisionChecker; - } - set { - this._collisionChecker = value; + public Func CollisionChecker + { + get + { + return this._collisionChecker; + } + set + { + this._collisionChecker = value; + } } - } - - // private void UpdateQuery(q: any) { - // this._query = q; - // if (this._query.changes) { - // this._query.changes.subscribe((v) => this.onQueryChanged(v)); - // } - // this.notifyContentChanged(); - // } - - public void SubcribeToManual(INotifyCollectionChanged manual) - { - manual.CollectionChanged += this.OnManualChanged; - } - public void UnsubcribeToManual(INotifyCollectionChanged manual) - { - manual.CollectionChanged -= this.OnManualChanged; - } - - public void UpdateAllList(IList allList) - { - _allList = allList; - } - public void UpdateTarget(IList target) - { - _target = target; - } - private void OnManualChanged(object sender, NotifyCollectionChangedEventArgs args) - { - switch (args.Action) { - case NotifyCollectionChangedAction.Add: - this.InsertManualItem(args.NewStartingIndex, (T)args.NewItems[0]); - break; - case NotifyCollectionChangedAction.Remove: - this.RemoveManualItemAt(args.OldStartingIndex); - break; - case NotifyCollectionChangedAction.Replace: - this.RemoveManualItemAt(args.OldStartingIndex); - this.InsertManualItem(args.NewStartingIndex, (T)args.NewItems[0]); - break; - case NotifyCollectionChangedAction.Reset: - this.ClearManualItems(); - break; + // private void UpdateQuery(q: any) { + // this._query = q; + // if (this._query.changes) { + // this._query.changes.subscribe((v) => this.onQueryChanged(v)); + // } + // this.notifyContentChanged(); + // } + + public void SubcribeToManual(INotifyCollectionChanged manual) + { + manual.CollectionChanged += this.OnManualChanged; + } + public void UnsubcribeToManual(INotifyCollectionChanged manual) + { + manual.CollectionChanged -= this.OnManualChanged; } - } + public void UpdateAllList(IList allList) + { + _allList = allList; + } + public void UpdateTarget(IList target) + { + _target = target; + } - public void ShiftContentToManual(IList manualCollection, Action onMoving) - { - T item = default(T); + private void OnManualChanged(object sender, NotifyCollectionChangedEventArgs args) + { + switch (args.Action) + { + case NotifyCollectionChangedAction.Add: + this.InsertManualItem(args.NewStartingIndex, (T)args.NewItems[0]); + break; + case NotifyCollectionChangedAction.Remove: + this.RemoveManualItemAt(args.OldStartingIndex); + break; + case NotifyCollectionChangedAction.Replace: + this.RemoveManualItemAt(args.OldStartingIndex); + this.InsertManualItem(args.NewStartingIndex, (T)args.NewItems[0]); + break; + case NotifyCollectionChangedAction.Reset: + this.ClearManualItems(); + break; + } + } - var manualSet = new HashSet(); - if (this.CollisionChecker != null) { - for (var i = 0; i < this._manualItems.Count; i++) { - item = this._manualItems[i]; - if (item != null) { - var key = this.CollisionChecker(item); - if (key != null) { - if (!manualSet.Contains(key)) { - manualSet.Add(key); + public void ShiftContentToManual(IList manualCollection, Action onMoving) + { + T item = default(T); + + var manualSet = new HashSet(); + if (this.CollisionChecker != null) + { + for (var i = 0; i < this._manualItems.Count; i++) + { + item = this._manualItems[i]; + if (item != null) + { + var key = this.CollisionChecker(item); + if (key != null) + { + if (!manualSet.Contains(key)) + { + manualSet.Add(key); + } } } } } - } - var mapWasEmpty = manualSet.Count == 0; - for (var i = 0; i < this._query.Count; i++) { - item = this._query[i]; + var mapWasEmpty = manualSet.Count == 0; + for (var i = 0; i < this._query.Count; i++) + { + item = this._query[i]; - if (!this._hasShiftedOnceAlready) { - this._manualItems.Insert(i, item); - manualCollection.Insert(i, item); - onMoving(item); - } else { - var key = this.CollisionChecker(item); - if (key == null) { + if (!this._hasShiftedOnceAlready) + { this._manualItems.Insert(i, item); manualCollection.Insert(i, item); onMoving(item); - } else { - if (!manualSet.Contains(key)) { - this._manualItems.Insert(manualCollection.Count, item); - manualCollection.Insert(manualCollection.Count, item); + } + else + { + var key = this.CollisionChecker(item); + if (key == null) + { + this._manualItems.Insert(i, item); + manualCollection.Insert(i, item); onMoving(item); } + else + { + if (!manualSet.Contains(key)) + { + this._manualItems.Insert(manualCollection.Count, item); + manualCollection.Insert(manualCollection.Count, item); + onMoving(item); + } + } } } + this.SyncItems(); + + this._hasShiftedOnceAlready = true; } - this.SyncItems(); - this._hasShiftedOnceAlready = true; - } + private List actualContent = new List(); - private List actualContent = new List(); + private void SyncItems() + { + Dictionary targetMap = new Dictionary(); + Dictionary queryMap = new Dictionary(); + Dictionary manualMap = new Dictionary(); - private void SyncItems() { - Dictionary targetMap = new Dictionary(); - Dictionary queryMap = new Dictionary(); - Dictionary manualMap = new Dictionary(); + T item = default(T); + for (var i = 0; i < this._allList.Count; i++) + { + item = this._allList[i]; + targetMap[item] = true; + } - T item = default(T); - for (var i = 0; i < this._allList.Count; i++) { - item = this._allList[i]; - targetMap[item] = true; - } - - var queryArray = new List(this._query); - this.actualContent = queryArray; - - if (this.CollisionChecker != null) { - - var manualKeySet = new HashSet(); - for (var i = 0; i < this._manualItems.Count; i++) { - item = this._manualItems[i]; - if (item != null) { - var key = this.CollisionChecker(item); - if (key != null) { - if (!manualKeySet.Contains(key)) { - manualKeySet.Add(key); + var queryArray = new List(this._query); + this.actualContent = queryArray; + + if (this.CollisionChecker != null) + { + + var manualKeySet = new HashSet(); + for (var i = 0; i < this._manualItems.Count; i++) + { + item = this._manualItems[i]; + if (item != null) + { + var key = this.CollisionChecker(item); + if (key != null) + { + if (!manualKeySet.Contains(key)) + { + manualKeySet.Add(key); + } } } } - } - for (var i = this._query.Count - 1; i >= 0; i--) { - item = queryArray[i]; - if (item == null) { - queryArray.RemoveAt(i); - } - else { - var key = this.CollisionChecker(item); - if (key != null && (manualKeySet.Contains(key) || this._removedManualKeys.Contains(key))) { + for (var i = this._query.Count - 1; i >= 0; i--) + { + item = queryArray[i]; + if (item == null) + { queryArray.RemoveAt(i); } + else + { + var key = this.CollisionChecker(item); + if (key != null && (manualKeySet.Contains(key) || this._removedManualKeys.Contains(key))) + { + queryArray.RemoveAt(i); + } + } } } - } - - for (var i = 0; i < queryArray.Count; i++) { - item = queryArray[i]; - queryMap[item] = true; - } - for (var i = 0; i < this._manualItems.Count; i++) { - item = this._manualItems[i]; - manualMap[item] = true; - } - - for (var i = this._allList.Count - 1; i >= 0; i--) { - item = this._allList[i]; - if (!queryMap.ContainsKey(item) && !manualMap.ContainsKey(item)) { - this._allList.RemoveAt(i); - this._target.RemoveAt(i); - this._onItemRemoved(item); + for (var i = 0; i < queryArray.Count; i++) + { + item = queryArray[i]; + queryMap[item] = true; + } + for (var i = 0; i < this._manualItems.Count; i++) + { + item = this._manualItems[i]; + manualMap[item] = true; } - } - int ind = 0; - int ins = 0; - T insItem = default(T); - int maxLen = queryArray.Count + this._manualItems.Count; - while (ind < maxLen) { - if (ind < queryArray.Count) { - insItem = queryArray[ind]; - } else if ((ind - queryArray.Count) < this._manualItems.Count) { - insItem = this._manualItems[ind - queryArray.Count]; - } else { - break; + for (var i = this._allList.Count - 1; i >= 0; i--) + { + item = this._allList[i]; + if (!queryMap.ContainsKey(item) && !manualMap.ContainsKey(item)) + { + this._allList.RemoveAt(i); + this._target.RemoveAt(i); + this._onItemRemoved(item); + } } - if (ins < this._allList.Count) { - item = this._allList[ins]; - if (item == insItem) { - ins++; - ind++; - } else { - this._allList.Insert(ins, insItem); - this._target.Insert(ins, this._toTarget(insItem)); + + int ind = 0; + int ins = 0; + T insItem = default(T); + int maxLen = queryArray.Count + this._manualItems.Count; + while (ind < maxLen) + { + if (ind < queryArray.Count) + { + insItem = queryArray[ind]; + } + else if ((ind - queryArray.Count) < this._manualItems.Count) + { + insItem = this._manualItems[ind - queryArray.Count]; + } + else + { + break; + } + if (ins < this._allList.Count) + { + item = this._allList[ins]; + if (item == insItem) + { + ins++; + ind++; + } + else + { + this._allList.Insert(ins, insItem); + this._target.Insert(ins, this._toTarget(insItem)); + this._onItemAdded(insItem); + ind++; + ins++; + } + } + else + { + this._allList.Add(insItem); + this._target.Add(this._toTarget(insItem)); this._onItemAdded(insItem); ind++; ins++; } - } else { - this._allList.Add(insItem); - this._target.Add(this._toTarget(insItem)); - this._onItemAdded(insItem); - ind++; - ins++; } } - } - public void NotifyContentChanged() { - this.OnQueryChanged(); - } + public void NotifyContentChanged() + { + this.OnQueryChanged(); + } - private void OnQueryChanged() { - this.SyncItems(); - } + private void OnQueryChanged() + { + this.SyncItems(); + } - public void AddManualItem(T item) { - if (this.CollisionChecker != null) { - var key = this.CollisionChecker(item); - if (key != null) { - if (this._removedManualKeys.Contains(key)) { - this._removedManualKeys.Remove(key); + public void AddManualItem(T item) + { + if (this.CollisionChecker != null) + { + var key = this.CollisionChecker(item); + if (key != null) + { + if (this._removedManualKeys.Contains(key)) + { + this._removedManualKeys.Remove(key); + } } } + this._manualItems.Add(item); + this.SyncItems(); } - this._manualItems.Add(item); - this.SyncItems(); - } - private HashSet _removedManualKeys = new HashSet(); - public bool RemoveManualItem(T item) - { - var ind = this._manualItems.IndexOf(item); - if (ind >= 0) { - if (this.CollisionChecker != null) { - var key = this.CollisionChecker(item); - if (key != null) { - if (!this._removedManualKeys.Contains(key)) { - this._removedManualKeys.Add(key); + private HashSet _removedManualKeys = new HashSet(); + public bool RemoveManualItem(T item) + { + var ind = this._manualItems.IndexOf(item); + if (ind >= 0) + { + if (this.CollisionChecker != null) + { + var key = this.CollisionChecker(item); + if (key != null) + { + if (!this._removedManualKeys.Contains(key)) + { + this._removedManualKeys.Add(key); + } } } - } - this._manualItems.RemoveAt(ind); - this.SyncItems(); + this._manualItems.RemoveAt(ind); + this.SyncItems(); - return true; + return true; + } + return false; } - return false; - } - public void RemoveManualItemAt(int index) { - if (index < this._manualItems.Count) { - var item = this._manualItems[index]; - if (this.CollisionChecker != null) { - var key = this.CollisionChecker(item); - if (key != null) { - if (!this._removedManualKeys.Contains(key)) { - this._removedManualKeys.Add(key); + public void RemoveManualItemAt(int index) + { + if (index < this._manualItems.Count) + { + var item = this._manualItems[index]; + if (this.CollisionChecker != null) + { + var key = this.CollisionChecker(item); + if (key != null) + { + if (!this._removedManualKeys.Contains(key)) + { + this._removedManualKeys.Add(key); + } } } } + this._manualItems.RemoveAt(index); + this.SyncItems(); } - this._manualItems.RemoveAt(index); - this.SyncItems(); - } - public void ClearManualItems() { - if (this.CollisionChecker != null) { - this._removedManualKeys.Clear(); + public void ClearManualItems() + { + if (this.CollisionChecker != null) + { + this._removedManualKeys.Clear(); + } + this._manualItems.Clear(); + this.SyncItems(); } - this._manualItems.Clear(); - this.SyncItems(); - } - public void InsertManualItem(int index, T item) { - if (this.CollisionChecker != null) { - var key = this.CollisionChecker(item); - if (key != null) { - if (this._removedManualKeys.Contains(key)) { - this._removedManualKeys.Remove(key); + public void InsertManualItem(int index, T item) + { + if (this.CollisionChecker != null) + { + var key = this.CollisionChecker(item); + if (key != null) + { + if (this._removedManualKeys.Contains(key)) + { + this._removedManualKeys.Remove(key); + } } } + this._manualItems.Insert(index, item); + this.SyncItems(); } - this._manualItems.Insert(index, item); - this.SyncItems(); } -} -} \ No newline at end of file +} diff --git a/src/componentsBase/DataAdapters.cs b/src/componentsBase/DataAdapters.cs index d4b56066..4b9196f8 100644 --- a/src/componentsBase/DataAdapters.cs +++ b/src/componentsBase/DataAdapters.cs @@ -1,8 +1,3 @@ -using Microsoft.AspNetCore.Components; -using Microsoft.AspNetCore.Components.Web; -using System; -using System.Threading.Tasks; - namespace IgniteUI.Blazor.Controls { public class LocalJson @@ -18,7 +13,7 @@ public static LocalJson From(string json) } private string _json; - public string Json { get { return _json; }} + public string Json { get { return _json; } } internal string ToRef() { @@ -44,11 +39,11 @@ public static RemoteJson From(string uri) } private string _uri; - public string Uri { get { return _uri; }} + public string Uri { get { return _uri; } } internal string ToRef() { return "json:::" + Uri; } } -} \ No newline at end of file +} diff --git a/src/componentsBase/DataIntents.cs b/src/componentsBase/DataIntents.cs index d29ec0af..6ffba670 100644 --- a/src/componentsBase/DataIntents.cs +++ b/src/componentsBase/DataIntents.cs @@ -1,27 +1,20 @@ -using System; -using System.Collections.Generic; -using System.Collections; -using System.Reflection; -using System.Linq; - namespace IgniteUI.Blazor.Controls { - public interface IDataIntentAttribute - { - string Intent { get; } - } + { + string Intent { get; } + } [AttributeUsage(AttributeTargets.Field | AttributeTargets.Property, AllowMultiple = true)] - public class DataIntentAttribute - : Attribute, IDataIntentAttribute - { - public DataIntentAttribute(string intent) - { - Intent = intent; - } + public class DataIntentAttribute + : Attribute, IDataIntentAttribute + { + public DataIntentAttribute(string intent) + { + Intent = intent; + } - public string Intent { get; private set; } - } -} \ No newline at end of file + public string Intent { get; private set; } + } +} diff --git a/src/componentsBase/DataSourceManager.cs b/src/componentsBase/DataSourceManager.cs index aa20df32..6e4e42dc 100644 --- a/src/componentsBase/DataSourceManager.cs +++ b/src/componentsBase/DataSourceManager.cs @@ -1,10 +1,9 @@ -using System; -using System.Collections.Generic; - -namespace IgniteUI.Blazor.Controls +namespace IgniteUI.Blazor.Controls { - internal class DataSourceManager { - public DataSourceManager(RefSink sink, RuntimeHelper helper) { + internal class DataSourceManager + { + public DataSourceManager(RefSink sink, RuntimeHelper helper) + { // ChunkAmount = -1; // ChunkSlicingWait = -1; _helper = helper; @@ -23,11 +22,13 @@ public DataSourceManager(RefSink sink, RuntimeHelper helper) { private Dictionary _idLookup = new Dictionary(); private Dictionary _suspensionLookup = new Dictionary(); - public object FindItem(Guid id) + public object FindItem(Guid id) { foreach (var data in - _dataSources.Values) { - if (data.HasId(id)) { + _dataSources.Values) + { + if (data.HasId(id)) + { return data.LookupOriginal(id); } } @@ -35,8 +36,10 @@ public object FindItem(Guid id) } public object FindItem(string id) { - foreach (var data in _dataSources.Values) { - if (data.HasId(id)) { + foreach (var data in _dataSources.Values) + { + if (data.HasId(id)) + { return data.LookupOriginal(id); } } @@ -57,40 +60,47 @@ public object FindItem(string id) public Guid FindItemId(object item) { foreach (var data in - _dataSources.Values) { - if (data != null && data.HasOriginal(item)) { + _dataSources.Values) + { + if (data != null && data.HasOriginal(item)) + { return data.IdFromOriginal(item); } } return Guid.Empty; } - public string OnRefChanged(string path, object data) + public string OnRefChanged(string path, object data) { string id = null; - if (_refs.ContainsKey(path)) { + if (_refs.ContainsKey(path)) + { object obj = _refs[path]; string oldId = GetRefId(obj); id = oldId; if (data == null || - obj != data) { + obj != data) + { DecrementRef(oldId); - if (!_refCount.ContainsKey(oldId)) { + if (!_refCount.ContainsKey(oldId)) + { _refs.Remove(path); } } } - if (data != null) { + if (data != null) + { string newId = GetRefId(data); id = newId; _refs[path] = data; _refsById[id] = data; IncrementRef(id); - if (!_dataSources.ContainsKey(id)) { + if (!_dataSources.ContainsKey(id)) + { if (_helper.IsInproc && !_helper.IsForcedJsonDataMarshalling) { //Console.WriteLine("unmarshalled datasource"); @@ -106,7 +116,6 @@ public string OnRefChanged(string path, object data) _refSink.OnRefChanged(id, _dataSources[id]); } - if (data == null) { id = null; @@ -116,31 +125,41 @@ public string OnRefChanged(string path, object data) private Dictionary _refCount = new Dictionary(); - private void IncrementRef(string id) { + private void IncrementRef(string id) + { int refCount = 0; - if (_refCount.ContainsKey(id)) { + if (_refCount.ContainsKey(id)) + { refCount = _refCount[id]; } refCount++; _refCount[id] = refCount; } - void DecrementRef(string id) { + void DecrementRef(string id) + { int refCount = 0; - if (_refCount.ContainsKey(id)) { + if (_refCount.ContainsKey(id)) + { refCount = _refCount[id]; } refCount--; - if (refCount > 0) { + if (refCount > 0) + { _refCount[id] = refCount; } - else { + else + { _refCount.Remove(id); - if (_dataSources.ContainsKey(id)) { + if (_dataSources.ContainsKey(id)) + { Object data = _dataSources[id]; - if (data != null && _idLookup.ContainsKey(data)) { + if (data != null && _idLookup.ContainsKey(data)) + { _idLookup.Remove(data); - } else if (_refsById.ContainsKey(id) && _idLookup.ContainsKey(_refsById[id])) { + } + else if (_refsById.ContainsKey(id) && _idLookup.ContainsKey(_refsById[id])) + { _idLookup.Remove(_refsById[id]); } _dataSources.Remove(id); @@ -152,12 +171,14 @@ void DecrementRef(string id) { public void NotifyInsertItem(string refName, int index, object refItem) { - if (_suspensionLookup.ContainsKey(refName) && _suspensionLookup[refName]) { + if (_suspensionLookup.ContainsKey(refName) && _suspensionLookup[refName]) + { return; } //Console.WriteLine("notifying insert item"); - if (_refsById.ContainsKey(refName)) { + if (_refsById.ContainsKey(refName)) + { //Console.WriteLine("found by id"); object data = _refsById[refName]; IJSDataSource dataSource = _dataSources[refName]; @@ -165,24 +186,30 @@ public void NotifyInsertItem(string refName, int index, object refItem) _refSink.OnRefNotifyInsertItem(dataSource, refName, index, newItem); } } - public void NotifyRemoveItem(String refName, int index, Object oldItem) { - if (_suspensionLookup.ContainsKey(refName) && _suspensionLookup[refName]) { + public void NotifyRemoveItem(String refName, int index, Object oldItem) + { + if (_suspensionLookup.ContainsKey(refName) && _suspensionLookup[refName]) + { return; } - if (_refsById.ContainsKey(refName)) { + if (_refsById.ContainsKey(refName)) + { Object data = _refsById[refName]; IJSDataSource dataSource = _dataSources[refName]; IJSDataSourceItem oldItemJson = dataSource.NotifyRemoveItem(data, index, oldItem); _refSink.OnRefNotifyRemoveItem(dataSource, refName, index, oldItemJson); } } - public void NotifyClearItems(string refName) { - if (_suspensionLookup.ContainsKey(refName) && _suspensionLookup[refName]) { + public void NotifyClearItems(string refName) + { + if (_suspensionLookup.ContainsKey(refName) && _suspensionLookup[refName]) + { return; } - if (_refsById.ContainsKey(refName)) { + if (_refsById.ContainsKey(refName)) + { Object data = _refsById[refName]; IJSDataSource dataSource = _dataSources[refName]; dataSource.NotifyClearItems(data); @@ -191,10 +218,12 @@ public void NotifyClearItems(string refName) { } public void NotifySetItem(string refName, int index, object oldItem, object newItem) { - if (_suspensionLookup.ContainsKey(refName) && _suspensionLookup[refName]) { + if (_suspensionLookup.ContainsKey(refName) && _suspensionLookup[refName]) + { return; } - if (_refsById.ContainsKey(refName)) { + if (_refsById.ContainsKey(refName)) + { object data = _refsById[refName]; IJSDataSource dataSource = _dataSources[refName]; IJSDataSourceItem oldItemJson = dataSource.DataSourceType == JSDataSourceType.Json ? ((JsonDataSource)dataSource)[index] : null; @@ -204,10 +233,12 @@ public void NotifySetItem(string refName, int index, object oldItem, object newI } public void NotifyUpdateItem(string refName, int index, object refItem, bool syncDataOnly) { - if (_suspensionLookup.ContainsKey(refName) && _suspensionLookup[refName]) { + if (_suspensionLookup.ContainsKey(refName) && _suspensionLookup[refName]) + { return; } - if (_refsById.ContainsKey(refName)) { + if (_refsById.ContainsKey(refName)) + { object data = _refsById[refName]; IJSDataSource dataSource = _dataSources[refName]; IJSDataSourceItem newItemJson = dataSource.NotifyUpdateItem(data, index, refItem); @@ -215,15 +246,19 @@ public void NotifyUpdateItem(string refName, int index, object refItem, bool syn } } - public bool HasRefId(object dataSource) { - if (_idLookup.ContainsKey(dataSource)) { + public bool HasRefId(object dataSource) + { + if (_idLookup.ContainsKey(dataSource)) + { return true; } return false; } - public string GetRefId(object dataSource) { - if (_idLookup.ContainsKey(dataSource)) { + public string GetRefId(object dataSource) + { + if (_idLookup.ContainsKey(dataSource)) + { return _idLookup[dataSource]; } Guid id = Guid.NewGuid(); @@ -235,7 +270,8 @@ public string GetRefId(object dataSource) { public void SuspendNotifications(object dataSource) { - if (!HasRefId(dataSource)) { + if (!HasRefId(dataSource)) + { return; } var refName = GetRefId(dataSource); @@ -244,11 +280,13 @@ public void SuspendNotifications(object dataSource) public void ResumeNotifications(object dataSource, bool notify = true) { - if (!HasRefId(dataSource)) { + if (!HasRefId(dataSource)) + { return; } var refName = GetRefId(dataSource); - if (_suspensionLookup.ContainsKey(refName)) { + if (_suspensionLookup.ContainsKey(refName)) + { _suspensionLookup[refName] = false; if (notify) NotifyClearItems(refName); @@ -290,4 +328,4 @@ public void Log() Console.WriteLine(""); } } -} \ No newline at end of file +} diff --git a/src/componentsBase/DynamicContentHolder.cs b/src/componentsBase/DynamicContentHolder.cs index 023af9d6..d858d082 100644 --- a/src/componentsBase/DynamicContentHolder.cs +++ b/src/componentsBase/DynamicContentHolder.cs @@ -1,14 +1,10 @@ using Microsoft.AspNetCore.Components; using Microsoft.AspNetCore.Components.Rendering; -using System.Collections.Generic; -using System; -using System.Threading.Tasks; -using System.Threading; namespace IgniteUI.Blazor.Controls { - public class DynamicContentHolder: ComponentBase + public class DynamicContentHolder : ComponentBase { protected LinkedList DynamicContentInfo { @@ -87,7 +83,7 @@ protected override void BuildRenderTree(RenderTreeBuilder __builder) __builder.AddMarkupContent(10, "\r\n "); __builder.OpenComponent(11, item.ControlType); __builder.SetKey(item.RefName); - __builder.AddComponentReferenceCapture(12, delegate(object __value) + __builder.AddComponentReferenceCapture(12, delegate (object __value) { OnDynamicChildRef(item.RefName, __value); }); @@ -104,7 +100,6 @@ protected override void BuildRenderTree(RenderTreeBuilder __builder) } } - public abstract class DynamicContentInfo { public Type ControlType { get; set; } @@ -123,8 +118,8 @@ public string RefDivName } private object _component = null; - public object Component - { + public object Component + { get { return _component; @@ -134,14 +129,14 @@ public object Component var oldValue = _component; _component = value; OnComponentChanged(oldValue, _component); - } + } } public BaseRendererControl Owner { get; internal set; } protected virtual void OnComponentChanged(object oldValue, object component) { - + } public virtual void UpdateTemplate(object template) @@ -193,7 +188,7 @@ public Task GetInstanceAsync() TaskCompletionSource tcs = new TaskCompletionSource(); object component = null; List> toSignal = null; - + lock (_lock) { component = Component; @@ -274,14 +269,15 @@ protected override void OnComponentChanged(object oldValue, object component) OnContextChanged((T)Context, (T)Context); } } - + private void OnContextChanged(T oldValue, T newValue) { if (Component is IgbTemplateContent) { var template = (IgbTemplateContent)Component; - if (_hasPopulatedContext) { + if (_hasPopulatedContext) + { template.Context = (T)Context; } template.Template = Template; @@ -300,4 +296,4 @@ public override void UpdateContext(object context) } } -} \ No newline at end of file +} diff --git a/src/componentsBase/IgbComponentRendererContainer.cs b/src/componentsBase/IgbComponentRendererContainer.cs index adfc1c3a..55049339 100644 --- a/src/componentsBase/IgbComponentRendererContainer.cs +++ b/src/componentsBase/IgbComponentRendererContainer.cs @@ -1,19 +1,19 @@ -using System; using Microsoft.AspNetCore.Components; using Microsoft.AspNetCore.Components.Rendering; namespace IgniteUI.Blazor.Controls { - public class IgbComponentRendererContainer: ComponentBase + public class IgbComponentRendererContainer : ComponentBase { private Type _componentType; [Parameter] - public Type ComponentType { + public Type ComponentType + { get { return _componentType; - } + } set { var oldValue = _componentType; @@ -22,7 +22,7 @@ public Type ComponentType { { StateHasChanged(); } - } + } } private object _rootComponent = null; @@ -36,7 +36,7 @@ public object RootComponent { var oldValue = _rootComponent; _rootComponent = value; - if (oldValue != _rootComponent) + if (oldValue != _rootComponent) { OnRootComponentChanged(oldValue, _rootComponent); } @@ -57,7 +57,7 @@ protected override void BuildRenderTree(RenderTreeBuilder builder) if (ComponentType != null) { builder.OpenComponent(0, ComponentType); - builder.AddComponentReferenceCapture(1, delegate(object value) + builder.AddComponentReferenceCapture(1, delegate (object value) { RootComponent = value; }); @@ -71,7 +71,7 @@ protected override void BuildRenderTree(RenderTreeBuilder builder) public event ComponentRendererComponentChangedEventHandler ComponentChanged; } - + public delegate void ComponentRendererComponentChangedEventHandler(object sender, ComponentRendererComponentChangedEventArgs args); public class ComponentRendererComponentChangedEventArgs @@ -80,4 +80,4 @@ public class ComponentRendererComponentChangedEventArgs public object NewComponent { get; internal set; } } -} \ No newline at end of file +} diff --git a/src/componentsBase/InfragisticsBlazorExtensions.cs b/src/componentsBase/InfragisticsBlazorExtensions.cs index 7b87c2ed..671bdb57 100644 --- a/src/componentsBase/InfragisticsBlazorExtensions.cs +++ b/src/componentsBase/InfragisticsBlazorExtensions.cs @@ -1,26 +1,25 @@ -using System; -using IgniteUI.Blazor.Controls; -using System.Collections.Generic; using System.Collections.ObjectModel; +using IgniteUI.Blazor.Controls; namespace Microsoft.Extensions.DependencyInjection { - public static class InfragisticsBlazorExtensions + public static class InfragisticsBlazorExtensions { public static Microsoft.Extensions.DependencyInjection.IServiceCollection AddIgniteUIBlazor(this Microsoft.Extensions.DependencyInjection.IServiceCollection collection, params Type[] modulesToLoad) { var s = collection.AddScoped( - typeof(IIgniteUIBlazorSettings), - (sp) => { + typeof(IIgniteUIBlazorSettings), + (sp) => + { var bs = new IgniteUIBlazorSettings(); bs = bs.WithModulesToLoad(modulesToLoad != null && modulesToLoad.Length > 0 ? new ReadOnlyCollection(modulesToLoad) : null); return bs; }); return s.AddScoped( - typeof(IIgniteUIBlazor), + typeof(IIgniteUIBlazor), typeof(IgniteUIBlazor)); } @@ -29,17 +28,18 @@ public static Microsoft.Extensions.DependencyInjection.IServiceCollection AddIgn params Type[] modulesToLoad) { var s = collection.AddScoped( - typeof(IIgniteUIBlazorSettings), - (sp) => { + typeof(IIgniteUIBlazorSettings), + (sp) => + { var bs = new IgniteUIBlazorSettings(settings); bs = bs.WithModulesToLoad(modulesToLoad != null && modulesToLoad.Length > 0 ? new ReadOnlyCollection(modulesToLoad) : null); return bs; }); return s.AddScoped( - typeof(IIgniteUIBlazor), + typeof(IIgniteUIBlazor), typeof(IgniteUIBlazor)); - } + } } - -} \ No newline at end of file + +} diff --git a/src/componentsBase/JsonDataSource.cs b/src/componentsBase/JsonDataSource.cs index 6f225861..36641103 100644 --- a/src/componentsBase/JsonDataSource.cs +++ b/src/componentsBase/JsonDataSource.cs @@ -1,5 +1,3 @@ -using System; -using System.Collections.Generic; using System.Collections; using System.Collections.Specialized; @@ -26,7 +24,7 @@ internal interface IJSDataSource IJSDataSourceItem NotifyInsertItem(object data, int index, Object item); IJSDataSourceItem NotifyRemoveItem(object data, int index, object oldItem); void NotifyClearItems(Object data); - IJSDataSourceItem NotifySetItem(Object data, int index, Object oldItem, Object newItem) ; + IJSDataSourceItem NotifySetItem(Object data, int index, Object oldItem, Object newItem); IJSDataSourceItem NotifyUpdateItem(object data, int index, object item); void InsertItemWithId(string id, int index, Object item); } @@ -38,18 +36,18 @@ internal enum JSDataSourceType } internal class JsonDataSource - : IJSDataSource + : IJSDataSource + { + public bool SuppressModifications { get; set; } + public JSDataSourceType DataSourceType { - public bool SuppressModifications { get; set; } - public JSDataSourceType DataSourceType + get { - get - { - return JSDataSourceType.Json; - } + return JSDataSourceType.Json; } + } - public bool IsSent { get; set; } + public bool IsSent { get; set; } private object _originalData; public string GetDataIntentsAsJson() @@ -74,17 +72,23 @@ public string GetDataIntentsAsJson() public bool DateCacheReady { get { return _dateCacheReady; } } - public static IJSDataSource CreateWithSchema(Object data, JSDataSourceSchema schema, DataSourceManager manager, string parentId) + public static IJSDataSource CreateWithSchema(Object data, JSDataSourceSchema schema, DataSourceManager manager, string parentId) { - if (data == null) { + if (data == null) + { return null; } - - if (data.GetType().IsArray) { + + if (data.GetType().IsArray) + { return JsonDataSource.CreateFromArray((Object[])data, schema, manager, parentId); - } else if (data is IList) { + } + else if (data is IList) + { return JsonDataSource.CreateFromIList((IList)data, schema, manager, parentId); - } else if (data is IEnumerable) { + } + else if (data is IEnumerable) + { return JsonDataSource.CreateFromIEnumerable((IEnumerable)data, schema, manager, parentId); } return null; @@ -106,77 +110,82 @@ private void OnCollectionChanged(object sender, NotifyCollectionChangedEventArgs { return; } - + switch (e.Action) { case NotifyCollectionChangedAction.Add: { - if (e.NewItems != null) - { - for (var i = 0; i < e.NewItems.Count; i++) - { - var item = e.NewItems[i]; + if (e.NewItems != null) + { + for (var i = 0; i < e.NewItems.Count; i++) + { + var item = e.NewItems[i]; var refName = _manager.GetRefId(_originalData); - if (refName == null) { + if (refName == null) + { return; } - _manager.NotifyInsertItem(refName , e.NewStartingIndex + i, item); - } - } - break; + _manager.NotifyInsertItem(refName, e.NewStartingIndex + i, item); + } + } + break; } - case NotifyCollectionChangedAction.Remove: + case NotifyCollectionChangedAction.Remove: { - if (e.OldItems != null) - { - for (var i = 0; i < e.OldItems.Count; i++) - { - var item = e.OldItems[i]; + if (e.OldItems != null) + { + for (var i = 0; i < e.OldItems.Count; i++) + { + var item = e.OldItems[i]; var refName = _manager.GetRefId(_originalData); - if (refName == null) { + if (refName == null) + { return; } - _manager.NotifyRemoveItem(refName, e.OldStartingIndex, item); - } - } - break; + _manager.NotifyRemoveItem(refName, e.OldStartingIndex, item); + } + } + break; } - case NotifyCollectionChangedAction.Replace: + case NotifyCollectionChangedAction.Replace: { - if (e.OldItems != null) - { - for (var i = 0; i < e.OldItems.Count; i++) - { - var item = e.OldItems[i]; + if (e.OldItems != null) + { + for (var i = 0; i < e.OldItems.Count; i++) + { + var item = e.OldItems[i]; var refName = _manager.GetRefId(_originalData); - if (refName == null) { + if (refName == null) + { return; } - _manager.NotifyRemoveItem(refName, e.OldStartingIndex, item); - } - } - if (e.NewItems != null) - { - for (var i = 0; i < e.NewItems.Count; i++) - { - var item = e.NewItems[i]; + _manager.NotifyRemoveItem(refName, e.OldStartingIndex, item); + } + } + if (e.NewItems != null) + { + for (var i = 0; i < e.NewItems.Count; i++) + { + var item = e.NewItems[i]; var refName = _manager.GetRefId(_originalData); - if (refName == null) { + if (refName == null) + { return; } - _manager.NotifyInsertItem(refName , e.NewStartingIndex + i, item); - } - } - break; + _manager.NotifyInsertItem(refName, e.NewStartingIndex + i, item); + } + } + break; } - case NotifyCollectionChangedAction.Reset: + case NotifyCollectionChangedAction.Reset: { var refName = _manager.GetRefId(_originalData); - if (refName == null) { + if (refName == null) + { return; } - _manager.NotifyClearItems(refName); - break; + _manager.NotifyClearItems(refName); + break; } } } @@ -208,9 +217,10 @@ public bool HasId(string id) } } - public IJSDataSourceItem LookupById(Guid id) + public IJSDataSourceItem LookupById(Guid id) { - if (_uuidToItem.ContainsKey(id)) { + if (_uuidToItem.ContainsKey(id)) + { return _uuidToItem[id]; } return null; @@ -244,7 +254,7 @@ public object LookupOriginal(string id) } } - public bool HasOriginal(object item) + public bool HasOriginal(object item) { return _originalToItem.ContainsKey(item); } @@ -259,61 +269,73 @@ public Guid IdFromOriginal(object item) return itm.Id; } - public IJSDataSourceItem FromOriginal(object item) { - if (_originalToItem.ContainsKey(item)) { + public IJSDataSourceItem FromOriginal(object item) + { + if (_originalToItem.ContainsKey(item)) + { return _originalToItem[item]; } return null; } - public Object ToOriginal(IJSDataSourceItem item) { + public Object ToOriginal(IJSDataSourceItem item) + { if (item == null) { return null; } - if (_itemToOriginal.ContainsKey(item)) { + if (_itemToOriginal.ContainsKey(item)) + { return _itemToOriginal[item]; } return null; } - public static IJSDataSource Create(Object data, DataSourceManager manager) { - if (data == null) { + public static IJSDataSource Create(Object data, DataSourceManager manager) + { + if (data == null) + { return null; } - if (data.GetType().IsArray) { + if (data.GetType().IsArray) + { return JsonDataSource.CreateFromArray((Object[])data, null, manager, null); - } else if (data is IList) { + } + else if (data is IList) + { return JsonDataSource.CreateFromIList((IList)data, null, manager, null); - } else if (data is IEnumerable) { + } + else if (data is IEnumerable) + { return JsonDataSource.CreateFromIEnumerable((IEnumerable)data, null, manager, null); } return null; } - private static IJSDataSource CreateFromIEnumerable(IEnumerable data, JSDataSourceSchema schema, DataSourceManager manager, string parentId) + private static IJSDataSource CreateFromIEnumerable(IEnumerable data, JSDataSourceSchema schema, DataSourceManager manager, string parentId) { JsonDataSource newData = new JsonDataSource(); newData._manager = manager; newData._parentSchema = schema; newData._parentId = parentId; - foreach (var item in data) { + foreach (var item in data) + { newData.Add(item); } newData.Listen(data); return newData; } - private static IJSDataSource CreateFromIList(IList data, JSDataSourceSchema schema, DataSourceManager manager, string parentId) + private static IJSDataSource CreateFromIList(IList data, JSDataSourceSchema schema, DataSourceManager manager, string parentId) { //Console.WriteLine("test json"); //DateTime testTime = DateTime.Now; //var ser = System.Text.Json.JsonSerializer.Serialize(data); - + //Console.WriteLine("end test json:" + (DateTime.Now - testTime).TotalMilliseconds); //Console.WriteLine("begin create from list"); DateTime startTime = DateTime.Now; @@ -322,7 +344,8 @@ private static IJSDataSource CreateFromIList(IList data, JSDataSourceSchema sche newData._parentSchema = schema; newData._parentId = parentId; var count = data.Count; - for (int i = 0; i < count; i++) { + for (int i = 0; i < count; i++) + { newData.Add(data[i]); } newData.Listen(data); @@ -330,13 +353,14 @@ private static IJSDataSource CreateFromIList(IList data, JSDataSourceSchema sche return newData; } - private static IJSDataSource CreateFromArray(object[] data, JSDataSourceSchema schema, DataSourceManager manager, string parentId) + private static IJSDataSource CreateFromArray(object[] data, JSDataSourceSchema schema, DataSourceManager manager, string parentId) { JsonDataSource newData = new JsonDataSource(); newData._parentSchema = schema; newData._manager = manager; newData._parentId = parentId; - for (int i = 0; i < data.Length; i++) { + for (int i = 0; i < data.Length; i++) + { newData.Add(data[i]); } newData.Listen(data); @@ -345,7 +369,8 @@ private static IJSDataSource CreateFromArray(object[] data, JSDataSourceSchema s private JSDataSourceSchema _schema = null; - private void Add(object item) { + private void Add(object item) + { if (_schema == null) { EnsureSchema(item); @@ -387,34 +412,41 @@ private void Add(object item) { } } - private void OnAddItem(IJSDataSourceItem itemJson, Object item) { + private void OnAddItem(IJSDataSourceItem itemJson, Object item) + { _uuidToItem[itemJson.Id] = itemJson; - if (item != null) { + if (item != null) + { _originalToItem[item] = itemJson; _itemToOriginal[itemJson] = item; } } - private void EnsureSchema(object item) - { - if (item != null && _schema == null) { + private void EnsureSchema(object item) + { + if (item != null && _schema == null) + { //Console.WriteLine("begin esnure schema"); DateTime startTime = DateTime.Now; - if (_parentSchema != null) { - if (_parentSchema.ItemSchema != null) { + if (_parentSchema != null) + { + if (_parentSchema.ItemSchema != null) + { _schema = _parentSchema.ItemSchema; } } _schema = JsonDataSourceItem.ExtractSchema(item); - if (_parentSchema != null && _parentSchema.ItemSchema == null) { + if (_parentSchema != null && _parentSchema.ItemSchema == null) + { _parentSchema.ItemSchema = _schema; } //Console.WriteLine("end ensure schema: " + (DateTime.Now - startTime).TotalMilliseconds); } } - public IJSDataSourceItem NotifyInsertItem(object data, int index, Object item) { + public IJSDataSourceItem NotifyInsertItem(object data, int index, Object item) + { EnsureSchema(item); IJSDataSourceItem itemJson = JsonDataSourceItem.Create(item, _schema, _manager); OnAddItem(itemJson, item); @@ -422,7 +454,8 @@ public IJSDataSourceItem NotifyInsertItem(object data, int index, Object item) { return itemJson; } - public IJSDataSourceItem NotifyRemoveItem(object data, int index, object oldItem) { + public IJSDataSourceItem NotifyRemoveItem(object data, int index, object oldItem) + { EnsureSchema(oldItem); IJSDataSourceItem itemJson = _data[index]; OnRemove(itemJson, oldItem); @@ -430,50 +463,64 @@ public IJSDataSourceItem NotifyRemoveItem(object data, int index, object oldItem return itemJson; } - private void OnRemove(IJSDataSourceItem itemJson, object item) + private void OnRemove(IJSDataSourceItem itemJson, object item) { - if (_uuidToItem.ContainsKey(itemJson.Id)) { + if (_uuidToItem.ContainsKey(itemJson.Id)) + { _uuidToItem.Remove(itemJson.Id); } - if (_itemToOriginal.ContainsKey(itemJson)) { + if (_itemToOriginal.ContainsKey(itemJson)) + { Object original = _itemToOriginal[itemJson]; - if (_originalToItem.ContainsKey(original)) { + if (_originalToItem.ContainsKey(original)) + { _originalToItem.Remove(original); } _itemToOriginal.Remove(itemJson); } if (item != null && - _originalToItem.ContainsKey(item)) { + _originalToItem.ContainsKey(item)) + { _itemToOriginal.Remove((IJSDataSourceItem)item); } } - public void NotifyClearItems(Object data) { - for (int i = 0; i < _data.Count; i++) { + public void NotifyClearItems(Object data) + { + for (int i = 0; i < _data.Count; i++) + { IJSDataSourceItem item = _data[i]; OnRemove(item, null); } _data.Clear(); _schema = null; - if (data.GetType().IsArray) { + if (data.GetType().IsArray) + { object[] dataArr = (object[])data; - for (int i = 0; i < dataArr.Length; i++) { + for (int i = 0; i < dataArr.Length; i++) + { Add(dataArr[i]); } - } else if (data is IList) { + } + else if (data is IList) + { IList dataList = (IList)data; - for (int i = 0; i < dataList.Count; i++) { + for (int i = 0; i < dataList.Count; i++) + { Add(dataList[i]); } - } else if (data is IEnumerable) { + } + else if (data is IEnumerable) + { IEnumerable dataIter = (IEnumerable)data; - foreach (object item in dataIter) { + foreach (object item in dataIter) + { Add(item); } } } - public IJSDataSourceItem NotifySetItem(Object data, int index, Object oldItem, Object newItem) + public IJSDataSourceItem NotifySetItem(Object data, int index, Object oldItem, Object newItem) { EnsureSchema(newItem); IJSDataSourceItem itemJson = JsonDataSourceItem.Create(newItem, _schema, _manager); @@ -486,10 +533,10 @@ public IJSDataSourceItem NotifySetItem(Object data, int index, Object oldItem, O public IJSDataSourceItem this[int i] { get { return _data[i]; } - + } - - public IJSDataSourceItem NotifyUpdateItem(object data, int index, object item) + + public IJSDataSourceItem NotifyUpdateItem(object data, int index, object item) { EnsureSchema(item); JsonDataSourceItem itemJson = null; @@ -556,21 +603,23 @@ public string ToJson() //Console.WriteLine("begin to json"); DateTime startTime = DateTime.Now; String ret; - using (System.IO.MemoryStream ms = new System.IO.MemoryStream()) { + using (System.IO.MemoryStream ms = new System.IO.MemoryStream()) + { using (System.Text.Json.Utf8JsonWriter uw = new System.Text.Json.Utf8JsonWriter(ms)) { - //RendererSerializer ser = new RendererSerializer(uw); - - ToJson(uw); - uw.Flush(); - ret = System.Text.Encoding.UTF8.GetString(ms.ToArray()); + //RendererSerializer ser = new RendererSerializer(uw); + + ToJson(uw); + uw.Flush(); + ret = System.Text.Encoding.UTF8.GetString(ms.ToArray()); } } //Console.WriteLine("end to json: " + (DateTime.Now - startTime).TotalMilliseconds); return ret; } - public void ToJson(System.Text.Json.Utf8JsonWriter writer, System.Text.Json.JsonEncodedText? propertyName = null) { + public void ToJson(System.Text.Json.Utf8JsonWriter writer, System.Text.Json.JsonEncodedText? propertyName = null) + { //Console.WriteLine("begin to json"); DateTime startTime = DateTime.Now; //String[] items = new String[_data.Count]; @@ -583,13 +632,17 @@ public void ToJson(System.Text.Json.Utf8JsonWriter writer, System.Text.Json.Json { writer.WriteStartArray(); } - for (int i = 0; i < _data.Count; i++) { + for (int i = 0; i < _data.Count; i++) + { JsonDataSourceItem item = (JsonDataSourceItem)_data[i]; //String ser = "null"; - if (!item.IsNull) { + if (!item.IsNull) + { item.ToJson(writer); //ser = item.ToJson(); - } else { + } + else + { writer.WriteNullValue(); } //items[i] = ser; @@ -609,4 +662,4 @@ public void InsertItemWithId(string id, int index, Object item) _data.Insert(index, itemJson); } } -} \ No newline at end of file +} diff --git a/src/componentsBase/JsonDataSourceItem.cs b/src/componentsBase/JsonDataSourceItem.cs index 50597d85..2895feef 100644 --- a/src/componentsBase/JsonDataSourceItem.cs +++ b/src/componentsBase/JsonDataSourceItem.cs @@ -1,15 +1,11 @@ -using System; -using System.Collections.Generic; using System.Collections; -using System.Reflection; -using System.Globalization; namespace IgniteUI.Blazor.Controls { internal class JsonDataSourceItem - : IJSDataSourceItem - { + : IJSDataSourceItem + { private Guid _id; private bool _isNull = false; private bool _isDataSource = true; @@ -18,7 +14,7 @@ internal class JsonDataSourceItem private Dictionary _values = new Dictionary(); private Dictionary _valueTypes = new Dictionary(); - public bool IsNull + public bool IsNull { get { @@ -26,14 +22,16 @@ public bool IsNull } } - public JsonDataSourceItem() { + public JsonDataSourceItem() + { _id = Guid.NewGuid(); } - public JsonDataSourceItem(Guid id) { + public JsonDataSourceItem(Guid id) + { _id = id; } - public Guid Id + public Guid Id { get { @@ -62,65 +60,75 @@ public object GetValue(string key) return null; } - public static JSDataSourceSchema ExtractSchema(object item) { - if (item == null) { - return null; + public static JSDataSourceSchema ExtractSchema(object item) + { + if (item == null) + { + return null; } Type c = item.GetType(); - if (c.IsArray) { + if (c.IsArray) + { JSDataSourceSchema s = new JSDataSourceSchema(); s.IsDataSource = true; s.Commit(); return s; } - else if (item is IList) { + else if (item is IList) + { JSDataSourceSchema s = new JSDataSourceSchema(); s.IsDataSource = true; s.Commit(); return s; } - else if (item is Dictionary) { + else if (item is Dictionary) + { return JSDataSourceSchema.CreateFromDictionary((IDictionary)item); } - else if (item is IEnumerable && !(item is string)) { + else if (item is IEnumerable && !(item is string)) + { JSDataSourceSchema s = new JSDataSourceSchema(); s.IsDataSource = true; s.Commit(); return s; } - if (c.IsPrimitive || c == typeof(string)) { + if (c.IsPrimitive || c == typeof(string)) + { JSDataSourceSchema s = new JSDataSourceSchema(); s.IsPrimitive = true; s.PrimitiveType = s.ResolveSchemaType(c); s.Commit(); return s; } - return JSDataSourceSchema.Create(c); } - public static JsonDataSourceItem Create(object item, JSDataSourceSchema schema, DataSourceManager manager) { + public static JsonDataSourceItem Create(object item, JSDataSourceSchema schema, DataSourceManager manager) + { JsonDataSourceItem newItem = new JsonDataSourceItem(); newItem.Read(item, schema, manager); return newItem; } - public static JsonDataSourceItem Create(object item, JSDataSourceSchema schema, DataSourceManager manager, JsonDataSourceItem parentItem) { + public static JsonDataSourceItem Create(object item, JSDataSourceSchema schema, DataSourceManager manager, JsonDataSourceItem parentItem) + { JsonDataSourceItem newItem = new JsonDataSourceItem(); newItem._parentId = parentItem.ParentId != null ? parentItem.ParentId + "/" + parentItem.Id.ToString() : parentItem.Id.ToString(); newItem.Read(item, schema, manager); return newItem; } - public static JsonDataSourceItem Create(object item, JSDataSourceSchema schema, DataSourceManager manager, string parentId) { + public static JsonDataSourceItem Create(object item, JSDataSourceSchema schema, DataSourceManager manager, string parentId) + { JsonDataSourceItem newItem = new JsonDataSourceItem(); newItem._parentId = parentId; newItem.Read(item, schema, manager); return newItem; } - public static JsonDataSourceItem CreateWithId(object item, Guid id, JSDataSourceSchema schema, DataSourceManager manager) { + public static JsonDataSourceItem CreateWithId(object item, Guid id, JSDataSourceSchema schema, DataSourceManager manager) + { JsonDataSourceItem newItem = new JsonDataSourceItem(id); newItem.Read(item, schema, manager); return newItem; @@ -132,23 +140,28 @@ public void Refresh(object item, JSDataSourceSchema schema, DataSourceManager ma } private JSDataSourceSchema _schema = null; - private void Read(Object item, JSDataSourceSchema schema, DataSourceManager manager) { - if (schema == null || item == null) { + private void Read(Object item, JSDataSourceSchema schema, DataSourceManager manager) + { + if (schema == null || item == null) + { _isNull = true; return; } _schema = schema; - if (_schema.IsDataSource) { + if (_schema.IsDataSource) + { //Console.WriteLine("in read"); IJSDataSource source = JsonDataSource.CreateWithSchema(item, _schema, manager, _parentId); _source = source; return; } - if (schema.IsPrimitive) { + if (schema.IsPrimitive) + { _values["value"] = item; _valueTypes["value"] = schema.PrimitiveType; } - for (int i = 0; i < schema.PropertyNames.Length; i++) { + for (int i = 0; i < schema.PropertyNames.Length; i++) + { String name = schema.PropertyNames[i]; Func propGetter = schema.PropertyGetters[i]; JSDataSourceSchemaType type = schema.PropertyTypes[i]; @@ -157,7 +170,8 @@ private void Read(Object item, JSDataSourceSchema schema, DataSourceManager mana _values[name] = val; _valueTypes[name] = type; } - for (int i = 0; i < schema.Fields.Length; i++) { + for (int i = 0; i < schema.Fields.Length; i++) + { String name = schema.Fields[i].Name; Func fieldGetter = schema.FieldGetters[i]; JSDataSourceSchemaType type = schema.FieldTypes[i]; @@ -168,19 +182,20 @@ private void Read(Object item, JSDataSourceSchema schema, DataSourceManager mana } } - public string ToJson() + public string ToJson() { - using (System.IO.MemoryStream ms = new System.IO.MemoryStream()) { + using (System.IO.MemoryStream ms = new System.IO.MemoryStream()) + { using (System.Text.Json.Utf8JsonWriter uw = new System.Text.Json.Utf8JsonWriter(ms)) { - //RendererSerializer ser = new RendererSerializer(uw); - - ToJson(uw); - uw.Flush(); - return System.Text.Encoding.UTF8.GetString(ms.ToArray()); + //RendererSerializer ser = new RendererSerializer(uw); + + ToJson(uw); + uw.Flush(); + return System.Text.Encoding.UTF8.GetString(ms.ToArray()); } } - + } public void GetDateCacheAsJson(System.Text.Json.Utf8JsonWriter writer, string parentKey = null) @@ -234,23 +249,26 @@ public void GetDateCacheAsJson(JSDataSourceSchema schema, System.Text.Json.Utf8J } } - public void ToJson(System.Text.Json.Utf8JsonWriter writer) + public void ToJson(System.Text.Json.Utf8JsonWriter writer) { - if (_isNull) { + if (_isNull) + { writer.WriteNullValue(); return; } - if (_source != null) { + if (_source != null) + { ((JsonDataSource)_source).ToJson(writer); return; } - if (_schema.IsPrimitive) { + if (_schema.IsPrimitive) + { ValueToJson("value", new System.Text.Json.JsonEncodedText(), writer); - return; + return; } writer.WriteStartObject(); - + var propertyNames = _schema.PropertyNames; var jsonPropertyNames = _schema.JsonPropertyNames; var len = propertyNames.Length; @@ -271,19 +289,21 @@ public void ToJson(System.Text.Json.Utf8JsonWriter writer) writer.WriteEndObject(); } - public void ToJson(System.Text.Json.Utf8JsonWriter writer, System.Text.Json.JsonEncodedText propertyName) + public void ToJson(System.Text.Json.Utf8JsonWriter writer, System.Text.Json.JsonEncodedText propertyName) { - if (_isNull) { + if (_isNull) + { writer.WriteNull(propertyName); return; } - if (_source != null) { + if (_source != null) + { ((JsonDataSource)_source).ToJson(writer, propertyName); return; } writer.WriteStartObject(propertyName); - + var propertyNames = _schema.PropertyNames; var jsonPropertyNames = _schema.JsonPropertyNames; var len = propertyNames.Length; @@ -297,7 +317,8 @@ public void ToJson(System.Text.Json.Utf8JsonWriter writer, System.Text.Json.Json writer.WriteEndObject(); } - private void ValueToJson(String key, System.Text.Json.JsonEncodedText prop, System.Text.Json.Utf8JsonWriter writer) { + private void ValueToJson(String key, System.Text.Json.JsonEncodedText prop, System.Text.Json.Utf8JsonWriter writer) + { Object value = _values[key]; if (value == null) { @@ -314,10 +335,11 @@ private void ValueToJson(String key, System.Text.Json.JsonEncodedText prop, Syst JSDataSourceSchemaType type = _valueTypes[key]; - switch (type) { + switch (type) + { case JSDataSourceSchemaType.IntValue: case JSDataSourceSchemaType.NullableIntValue: - if (prop.Equals(default)) + if (prop.Equals(default)) { // in case we have no prop because the value is not an object but a primitive type writer.WriteNumberValue((int)value); @@ -325,52 +347,56 @@ private void ValueToJson(String key, System.Text.Json.JsonEncodedText prop, Syst } if (value == null) { - writer.WriteNull(prop); break; + writer.WriteNull(prop); + break; } writer.WriteNumber(prop, (int)value); break; case JSDataSourceSchemaType.ByteValue: case JSDataSourceSchemaType.NullableByteValue: - if (prop.Equals(default)) + if (prop.Equals(default)) { writer.WriteNumberValue((byte)value); break; } if (value == null) { - writer.WriteNull(prop); break; + writer.WriteNull(prop); + break; } writer.WriteNumber(prop, (byte)value); break; case JSDataSourceSchemaType.LongValue: case JSDataSourceSchemaType.NullableLongValue: - if (prop.Equals(default)) + if (prop.Equals(default)) { writer.WriteNumberValue((long)value); break; } if (value == null) { - writer.WriteNull(prop); break; + writer.WriteNull(prop); + break; } writer.WriteNumber(prop, (long)value); break; case JSDataSourceSchemaType.ShortValue: case JSDataSourceSchemaType.NullableShortValue: - if (prop.Equals(default)) + if (prop.Equals(default)) { writer.WriteNumberValue((short)value); break; } if (value == null) { - writer.WriteNull(prop); break; + writer.WriteNull(prop); + break; } writer.WriteNumber(prop, (short)value); break; case JSDataSourceSchemaType.SingleValue: case JSDataSourceSchemaType.NullableSingleValue: - if (prop.Equals(default)) + if (prop.Equals(default)) { writer.WriteNumberValue((float)value); break; @@ -384,20 +410,21 @@ private void ValueToJson(String key, System.Text.Json.JsonEncodedText prop, Syst break; case JSDataSourceSchemaType.DecimalValue: case JSDataSourceSchemaType.NullableDecimalValue: - if (prop.Equals(default)) + if (prop.Equals(default)) { writer.WriteNumberValue((decimal)value); break; } if (value == null) { - writer.WriteNull(prop); break; + writer.WriteNull(prop); + break; } writer.WriteNumber(prop, (decimal)value); break; case JSDataSourceSchemaType.DoubleValue: case JSDataSourceSchemaType.NullableDoubleValue: - if (prop.Equals(default)) + if (prop.Equals(default)) { writer.WriteNumberValue((double)value); break; @@ -411,19 +438,20 @@ private void ValueToJson(String key, System.Text.Json.JsonEncodedText prop, Syst break; case JSDataSourceSchemaType.BooleanValue: case JSDataSourceSchemaType.NullableBooleanValue: - if (prop.Equals(default)) + if (prop.Equals(default)) { writer.WriteBooleanValue((bool)value); break; } if (value == null) { - writer.WriteNull(prop); break; + writer.WriteNull(prop); + break; } writer.WriteBoolean(prop, (bool)value); break; case JSDataSourceSchemaType.StringValue: - if (prop.Equals(default)) + if (prop.Equals(default)) { writer.WriteStringValue((string)value); break; @@ -441,7 +469,7 @@ private void ValueToJson(String key, System.Text.Json.JsonEncodedText prop, Syst break; case JSDataSourceSchemaType.DateTimeValue: case JSDataSourceSchemaType.NullableDateTimeValue: - if (_schema == null) + if (_schema == null) { writer.WriteNull(prop); break; @@ -454,7 +482,7 @@ private void ValueToJson(String key, System.Text.Json.JsonEncodedText prop, Syst writer.WriteNull(prop); break; } - ((JsonDataSourceItem) value).ToJson(writer, prop); + ((JsonDataSourceItem)value).ToJson(writer, prop); break; default: writer.WriteNull(key); @@ -462,10 +490,10 @@ private void ValueToJson(String key, System.Text.Json.JsonEncodedText prop, Syst } } - - public String ToIdJson() { + public String ToIdJson() + { return "{ \"refType\": \"uuid\", \"id\": \"" + _id.ToString() + "\" }"; } } -} \ No newline at end of file +} diff --git a/src/componentsBase/JsonDataSourceSchema.cs b/src/componentsBase/JsonDataSourceSchema.cs index 105c2f14..da24de5f 100644 --- a/src/componentsBase/JsonDataSourceSchema.cs +++ b/src/componentsBase/JsonDataSourceSchema.cs @@ -1,13 +1,11 @@ -using System; -using System.Collections.Generic; using System.Collections; using System.Reflection; -using System.Linq; namespace IgniteUI.Blazor.Controls { - internal class JSDataSourceSchema { + internal class JSDataSourceSchema + { public bool IsDataSource = false; public bool IsDictionary = false; @@ -92,7 +90,7 @@ private void WriteDataIntentsAsJson(string propertyName, System.Text.Json.Utf8Js uw.WriteStartObject(); } - //Console.WriteLine("emitting json"); + //Console.WriteLine("emitting json"); if (IsDataSource) { //Console.WriteLine("is data source"); @@ -120,7 +118,7 @@ private void WriteDataIntentsAsJson(string propertyName, System.Text.Json.Utf8Js { var currProp = PropertyNames[i]; var intents = PropertyDataIntents[i]; - + if (_subSchemas.ContainsKey(currProp)) { if (_subSchemas[currProp].HasDataIntents()) @@ -153,12 +151,11 @@ private void WriteDataIntentsAsJson(string propertyName, System.Text.Json.Utf8Js } } - for (var i = 0; i < Fields.Length; i++) { var currProp = FieldNames[i]; var intents = FieldDataIntents[i]; - + if (_subSchemas.ContainsKey(currProp)) { if (_subSchemas[currProp].HasDataIntents()) @@ -186,7 +183,7 @@ private void WriteDataIntentsAsJson(string propertyName, System.Text.Json.Utf8Js uw.WriteStringValue(val); } uw.WriteEndArray(); - // uw.WriteEndObject(); + // uw.WriteEndObject(); } } } @@ -250,7 +247,8 @@ private static void GetFieldsFromType(Type type, List fields) } } - public static JSDataSourceSchema CreateFromDictionary(IDictionary item) { + public static JSDataSourceSchema CreateFromDictionary(IDictionary item) + { JSDataSourceSchema s = new JSDataSourceSchema(); s.IsDictionary = true; List names = new List(); @@ -268,7 +266,6 @@ public static JSDataSourceSchema CreateFromDictionary(IDictionary item) { names.Add((string)key); s._buildingPropertiesDataIntents.Add(null); - Type ret = item[key].GetType(); types.Add(ret); @@ -279,7 +276,7 @@ public static JSDataSourceSchema CreateFromDictionary(IDictionary item) { s._buildingPropertiesTypes.Add(type); } } - + s.Properties = s._buildingProperties.ToArray(); s.PropertyTypes = s._buildingPropertiesTypes.ToArray(); s.PropertyDataIntents = s._buildingPropertiesDataIntents.ToArray(); @@ -288,31 +285,35 @@ public static JSDataSourceSchema CreateFromDictionary(IDictionary item) { s.TypedPropertyGetters = new Delegate[names.Count]; var itemProp = item.GetType().GetProperty("Item"); - - for (int i = 0; i < names.Count; i++) { + + for (int i = 0; i < names.Count; i++) + { var key = names[i]; s.PropertyGetters[i] = (o) => ((IDictionary)o)[key]; } - for (int i = 0; i < names.Count; i++) { + for (int i = 0; i < names.Count; i++) + { var key = names[i]; s.TypedPropertyGetters[i] = s.GetTypedDictionaryValueGetter(item.GetType(), types[i], itemProp, key); } s.JsonPropertyNames = new System.Text.Json.JsonEncodedText[names.Count]; - for (int i = 0; i < names.Count; i++) { + for (int i = 0; i < names.Count; i++) + { s.JsonPropertyNames[i] = System.Text.Json.JsonEncodedText.Encode(names[i]); } s.Fields = s._buildingFields.ToArray(); s.FieldTypes = s._buildingFieldsTypes.ToArray(); s.FieldDataIntents = s._buildingFieldsDataIntents.ToArray(); - s.FieldNames = new string[] {}; + s.FieldNames = new string[] { }; s.FieldGetters = new Func[s.FieldNames.Length]; s.TypedFieldGetters = new Delegate[s.FieldNames.Length]; - + return s; } - public static JSDataSourceSchema Create(Type c) { + public static JSDataSourceSchema Create(Type c) + { JSDataSourceSchema s = new JSDataSourceSchema(); // RS TFS272017 - We need to grab the property infos from the base types if they exist @@ -325,13 +326,16 @@ public static JSDataSourceSchema Create(Type c) { List fields = new List(); GetFieldsFromType(c, fields); - for (int i = 0; i < properties.Count; i++) { + for (int i = 0; i < properties.Count; i++) + { var curr = properties[i]; - if (curr.DeclaringType == typeof(Object) || curr.GetIndexParameters().Length > 0) { + if (curr.DeclaringType == typeof(Object) || curr.GetIndexParameters().Length > 0) + { continue; } - - if (curr.GetMethod != null && curr.GetMethod.IsPublic) { + + if (curr.GetMethod != null && curr.GetMethod.IsPublic) + { if (!curr.GetMethod.IsStatic) { s.AddProperty(curr); @@ -339,12 +343,15 @@ public static JSDataSourceSchema Create(Type c) { } } - for (int i = 0; i < fields.Count; i++) { + for (int i = 0; i < fields.Count; i++) + { FieldInfo curr = fields[i]; - if (curr.DeclaringType == typeof(Object)) { + if (curr.DeclaringType == typeof(Object)) + { continue; } - if (curr.IsPublic && !curr.IsSpecialName && !curr.IsStatic) { + if (curr.IsPublic && !curr.IsSpecialName && !curr.IsStatic) + { s.AddField(curr); } } @@ -352,28 +359,36 @@ public static JSDataSourceSchema Create(Type c) { return s; } - public object ResolveValue(String name, Object item, Func propGetter, JsonDataSourceItem jsonItem, JSDataSourceSchemaType type, DataSourceManager manager) { + public object ResolveValue(String name, Object item, Func propGetter, JsonDataSourceItem jsonItem, JSDataSourceSchemaType type, DataSourceManager manager) + { if (item == null) { return null; } - try { - object value = propGetter(item); - if (type == JSDataSourceSchemaType.ObjectValue) { + try + { + object value = propGetter(item); + if (type == JSDataSourceSchemaType.ObjectValue) + { return GetSubObject(name, value, jsonItem, manager); } return value; - } catch (Exception e) { + } + catch (Exception e) + { return null; } } - private object GetSubObject(String name, Object value, JsonDataSourceItem rootItem, DataSourceManager manager) { + private object GetSubObject(String name, Object value, JsonDataSourceItem rootItem, DataSourceManager manager) + { bool checkedArray = _checkedArray.ContainsKey(name); - if (!checkedArray && value != null) { + if (!checkedArray && value != null) + { _checkedArray[name] = true; - if (value.GetType().IsArray || value is IEnumerable || value is IList) { + if (value.GetType().IsArray || value is IEnumerable || value is IList) + { _subSchemas[name] = BuildSubObjectSchema(value); if (NotifyModified != null) @@ -382,8 +397,10 @@ private object GetSubObject(String name, Object value, JsonDataSourceItem rootIt } } } - if (!_subSchemas.ContainsKey(name)) { - if (value == null) { + if (!_subSchemas.ContainsKey(name)) + { + if (value == null) + { return JsonDataSourceItem.Create(value, null, manager, rootItem); } _subSchemas[name] = JsonDataSourceItem.ExtractSchema(value); @@ -394,7 +411,7 @@ private object GetSubObject(String name, Object value, JsonDataSourceItem rootIt } JSDataSourceSchema subSchema = _subSchemas[name]; - return JsonDataSourceItem.Create(value, subSchema, manager, rootItem); + return JsonDataSourceItem.Create(value, subSchema, manager, rootItem); } public JSDataSourceSchema BuildSubObjectSchema(object subObject) @@ -442,36 +459,42 @@ public JSDataSourceSchema BuildSubObjectSchema(object subObject) return schema; } - public object ResolveFieldValue(String name, Object item, Func fieldGetter, JsonDataSourceItem rootItem, JSDataSourceSchemaType type, DataSourceManager manager) { - try { + public object ResolveFieldValue(String name, Object item, Func fieldGetter, JsonDataSourceItem rootItem, JSDataSourceSchemaType type, DataSourceManager manager) + { + try + { object value = fieldGetter(item); - if (type == JSDataSourceSchemaType.ObjectValue) { + if (type == JSDataSourceSchemaType.ObjectValue) + { return GetSubObject(name, value, rootItem, manager); } return value; - } catch (Exception e) { + } + catch (Exception e) + { return null; } } - public String RenderDate(object value) + public String RenderDate(object value) { - if (value is DateTime) { + if (value is DateTime) + { return "@d:" + ((DateTime)value).ToString("o"); } - + return "null"; } private JSDataSourceSchema _itemSchema = null; - public JSDataSourceSchema ItemSchema + public JSDataSourceSchema ItemSchema { - get + get { return _itemSchema; } - set + set { _itemSchema = value; } @@ -523,7 +546,7 @@ public void SetSubSchema(string propertyName, JSDataSourceSchema schema) _subSchemas[propertyName] = schema; } - public JSDataSourceSchemaType ResolveSchemaType(Type type) + public JSDataSourceSchemaType ResolveSchemaType(Type type) { if (type == typeof(double)) { @@ -545,10 +568,12 @@ public JSDataSourceSchemaType ResolveSchemaType(Type type) { return JSDataSourceSchemaType.ShortValue; } - if (type == typeof(byte)) { + if (type == typeof(byte)) + { return JSDataSourceSchemaType.ByteValue; } - if (type == typeof(decimal)) { + if (type == typeof(decimal)) + { return JSDataSourceSchemaType.DecimalValue; } if (type == typeof(long)) @@ -641,7 +666,7 @@ public JSDataSourceSchemaType ResolveSchemaType(Type type) return JSDataSourceSchemaType.ObjectValue; } - public void AddProperty(PropertyInfo prop) + public void AddProperty(PropertyInfo prop) { _buildingProperties.Add(prop); @@ -660,7 +685,7 @@ public void AddProperty(PropertyInfo prop) dataIntents.Add((IDataIntentAttribute)attr); } } - } + } _buildingPropertiesDataIntents.Add(dataIntents == null ? null : dataIntents.ToArray()); Type ret = prop.PropertyType; @@ -672,7 +697,7 @@ public void AddProperty(PropertyInfo prop) _buildingPropertiesTypes.Add(type); } - public void AddField(FieldInfo curr) + public void AddField(FieldInfo curr) { _buildingFields.Add(curr); Type ret = curr.FieldType; @@ -693,7 +718,7 @@ public void AddField(FieldInfo curr) dataIntents.Add((IDataIntentAttribute)attr); } } - } + } _buildingFieldsDataIntents.Add(dataIntents == null ? null : dataIntents.ToArray()); //if (type == JsonDataSourceSchemaType.OBJECT_VALUE) { // _subSchemas.put(curr.getName(), create(ret)); @@ -831,24 +856,29 @@ private Delegate GetTypedFieldValueGetter(Type type, FieldInfo fieldInfo) } } - public void Commit() { + public void Commit() + { Properties = _buildingProperties.ToArray(); PropertyTypes = _buildingPropertiesTypes.ToArray(); PropertyDataIntents = _buildingPropertiesDataIntents.ToArray(); PropertyNames = new String[_buildingProperties.Count]; PropertyGetters = new Func[_buildingProperties.Count]; TypedPropertyGetters = new Delegate[_buildingProperties.Count]; - for (int i = 0; i < _buildingProperties.Count; i++) { + for (int i = 0; i < _buildingProperties.Count; i++) + { PropertyNames[i] = _buildingProperties[i].Name; } - for (int i = 0; i < _buildingProperties.Count; i++) { + for (int i = 0; i < _buildingProperties.Count; i++) + { PropertyGetters[i] = GetPropertyValueGetter(_buildingProperties[i].DeclaringType, _buildingProperties[i]); } - for (int i = 0; i < _buildingProperties.Count; i++) { + for (int i = 0; i < _buildingProperties.Count; i++) + { TypedPropertyGetters[i] = GetTypedPropertyValueGetter(_buildingProperties[i].DeclaringType, _buildingProperties[i]); } JsonPropertyNames = new System.Text.Json.JsonEncodedText[_buildingProperties.Count]; - for (int i = 0; i < _buildingProperties.Count; i++) { + for (int i = 0; i < _buildingProperties.Count; i++) + { JsonPropertyNames[i] = System.Text.Json.JsonEncodedText.Encode(_buildingProperties[i].Name); } @@ -858,17 +888,21 @@ public void Commit() { FieldDataIntents = _buildingFieldsDataIntents.ToArray(); FieldGetters = new Func[_buildingFields.Count]; TypedFieldGetters = new Func[_buildingFields.Count]; - for (int i = 0; i < _buildingFields.Count; i++) { + for (int i = 0; i < _buildingFields.Count; i++) + { FieldNames[i] = _buildingFields[i].Name; } - for (int i = 0; i < _buildingFields.Count; i++) { + for (int i = 0; i < _buildingFields.Count; i++) + { FieldGetters[i] = GetFieldValueGetter(_buildingFields[i].DeclaringType, _buildingFields[i]); } - for (int i = 0; i < _buildingFields.Count; i++) { + for (int i = 0; i < _buildingFields.Count; i++) + { TypedFieldGetters[i] = GetTypedFieldValueGetter(_buildingFields[i].DeclaringType, _buildingFields[i]); } JsonFieldNames = new System.Text.Json.JsonEncodedText[_buildingFields.Count]; - for (int i = 0; i < _buildingFields.Count; i++) { + for (int i = 0; i < _buildingFields.Count; i++) + { JsonFieldNames[i] = System.Text.Json.JsonEncodedText.Encode(_buildingFields[i].Name); } @@ -879,7 +913,8 @@ public void Commit() { } } - internal enum JSDataSourceSchemaType { + internal enum JSDataSourceSchemaType + { DoubleValue, IntValue, LongValue, @@ -916,4 +951,4 @@ internal enum JSDataSourceSchemaType { ShortArrayValue, SingleArrayValue } -} \ No newline at end of file +} diff --git a/src/componentsBase/JsonSerializable.cs b/src/componentsBase/JsonSerializable.cs index f37de562..4e041a7f 100644 --- a/src/componentsBase/JsonSerializable.cs +++ b/src/componentsBase/JsonSerializable.cs @@ -1,5 +1,3 @@ -using System; - namespace IgniteUI.Blazor.Controls { public delegate bool SerializationFilter(string name, string property); @@ -8,7 +6,7 @@ public class SerializationContext { public System.Text.Json.Utf8JsonWriter Writer { get; set; } public SerializationFilter Filter { get; set; } - + public SerializationContext(System.Text.Json.Utf8JsonWriter writer, SerializationFilter filter) { Writer = writer; @@ -16,7 +14,8 @@ public SerializationContext(System.Text.Json.Utf8JsonWriter writer, Serializatio } } - public interface JsonSerializable { + public interface JsonSerializable + { void Serialize(SerializationContext writer, string propertyName = null); } diff --git a/src/componentsBase/MarshalByValueFactory.cs b/src/componentsBase/MarshalByValueFactory.cs index 33286b04..7f6a54aa 100644 --- a/src/componentsBase/MarshalByValueFactory.cs +++ b/src/componentsBase/MarshalByValueFactory.cs @@ -1,8 +1,3 @@ -using Microsoft.AspNetCore.Components; -using Microsoft.AspNetCore.Components.Web; -using System; -using System.Threading.Tasks; - namespace IgniteUI.Blazor.Controls { public class MarshalByValueFactory @@ -11,133 +6,133 @@ internal static bool MustMarshalByValue(string typeName) { switch (typeName) { -//@@MustMarshalByValue -case "CalendarDate": - return true; -case "CalendarFormatOptions": - return true; -case "FocusOptions": - return true; -case "FormatSpecifier": - return true; -case "NumberFormatSpecifier": - return true; -case "ActiveStepChangedEventArgs": -case "WebActiveStepChangedEventArgs": - return true; -case "ActiveStepChangedEventArgsDetail": -case "WebActiveStepChangedEventArgsDetail": - return true; -case "ActiveStepChangingEventArgs": -case "WebActiveStepChangingEventArgs": - return true; -case "ActiveStepChangingEventArgsDetail": -case "WebActiveStepChangingEventArgsDetail": - return true; -case "ChatDraftMessage": -case "WebChatDraftMessage": - return true; -case "ChatMessage": -case "WebChatMessage": - return true; -case "ChatMessageAttachment": -case "WebChatMessageAttachment": - return true; -case "ChatMessageAttachmentEventArgs": -case "WebChatMessageAttachmentEventArgs": - return true; -case "ChatMessageEventArgs": -case "WebChatMessageEventArgs": - return true; -case "ChatMessageReaction": -case "WebChatMessageReaction": - return true; -case "ChatMessageReactionEventArgs": -case "WebChatMessageReactionEventArgs": - return true; -case "CheckboxChangeEventArgs": -case "WebCheckboxChangeEventArgs": - return true; -case "CheckboxChangeEventArgsDetail": -case "WebCheckboxChangeEventArgsDetail": - return true; -case "ComboChangeEventArgs": -case "WebComboChangeEventArgs": - return true; -case "ComboChangeEventArgsDetail": -case "WebComboChangeEventArgsDetail": - return true; -case "ComponentBoolValueChangedEventArgs": -case "WebComponentBoolValueChangedEventArgs": - return true; -case "ComponentDateValueChangedEventArgs": -case "WebComponentDateValueChangedEventArgs": - return true; -case "ComponentValueChangedEventArgs": -case "WebComponentValueChangedEventArgs": - return true; -case "DateRangeValueDetail": -case "WebDateRangeValueDetail": - return true; -case "DateRangeValueEventArgs": -case "WebDateRangeValueEventArgs": - return true; -case "DropdownItemComponentEventArgs": -case "WebDropdownItemComponentEventArgs": - return true; -case "ExpansionPanelComponentEventArgs": -case "WebExpansionPanelComponentEventArgs": - return true; -case "HighlightNavigation": -case "WebHighlightNavigation": - return true; -case "IconMeta": -case "WebIconMeta": - return true; -case "NumberEventArgs": -case "WebNumberEventArgs": - return true; -case "RadioChangeEventArgs": -case "WebRadioChangeEventArgs": - return true; -case "RadioChangeEventArgsDetail": -case "WebRadioChangeEventArgsDetail": - return true; -case "RangeSliderValue": -case "WebRangeSliderValue": - return true; -case "SelectItemComponentEventArgs": -case "WebSelectItemComponentEventArgs": - return true; -case "SplitterResizeEventArgs": -case "WebSplitterResizeEventArgs": - return true; -case "SplitterResizeEventArgsDetail": -case "WebSplitterResizeEventArgsDetail": - return true; -case "TabComponentEventArgs": -case "WebTabComponentEventArgs": - return true; -case "TileChangeStateEventArgs": -case "WebTileChangeStateEventArgs": - return true; -case "TileChangeStateEventArgsDetail": -case "WebTileChangeStateEventArgsDetail": - return true; -case "TileComponentEventArgs": -case "WebTileComponentEventArgs": - return true; -case "TreeItemComponentEventArgs": -case "WebTreeItemComponentEventArgs": - return true; -case "TreeSelectionEventArgs": -case "WebTreeSelectionEventArgs": - return true; -case "TreeSelectionEventArgsDetail": -case "WebTreeSelectionEventArgsDetail": - return true; + //@@MustMarshalByValue + case "CalendarDate": + return true; + case "CalendarFormatOptions": + return true; + case "FocusOptions": + return true; + case "FormatSpecifier": + return true; + case "NumberFormatSpecifier": + return true; + case "ActiveStepChangedEventArgs": + case "WebActiveStepChangedEventArgs": + return true; + case "ActiveStepChangedEventArgsDetail": + case "WebActiveStepChangedEventArgsDetail": + return true; + case "ActiveStepChangingEventArgs": + case "WebActiveStepChangingEventArgs": + return true; + case "ActiveStepChangingEventArgsDetail": + case "WebActiveStepChangingEventArgsDetail": + return true; + case "ChatDraftMessage": + case "WebChatDraftMessage": + return true; + case "ChatMessage": + case "WebChatMessage": + return true; + case "ChatMessageAttachment": + case "WebChatMessageAttachment": + return true; + case "ChatMessageAttachmentEventArgs": + case "WebChatMessageAttachmentEventArgs": + return true; + case "ChatMessageEventArgs": + case "WebChatMessageEventArgs": + return true; + case "ChatMessageReaction": + case "WebChatMessageReaction": + return true; + case "ChatMessageReactionEventArgs": + case "WebChatMessageReactionEventArgs": + return true; + case "CheckboxChangeEventArgs": + case "WebCheckboxChangeEventArgs": + return true; + case "CheckboxChangeEventArgsDetail": + case "WebCheckboxChangeEventArgsDetail": + return true; + case "ComboChangeEventArgs": + case "WebComboChangeEventArgs": + return true; + case "ComboChangeEventArgsDetail": + case "WebComboChangeEventArgsDetail": + return true; + case "ComponentBoolValueChangedEventArgs": + case "WebComponentBoolValueChangedEventArgs": + return true; + case "ComponentDateValueChangedEventArgs": + case "WebComponentDateValueChangedEventArgs": + return true; + case "ComponentValueChangedEventArgs": + case "WebComponentValueChangedEventArgs": + return true; + case "DateRangeValueDetail": + case "WebDateRangeValueDetail": + return true; + case "DateRangeValueEventArgs": + case "WebDateRangeValueEventArgs": + return true; + case "DropdownItemComponentEventArgs": + case "WebDropdownItemComponentEventArgs": + return true; + case "ExpansionPanelComponentEventArgs": + case "WebExpansionPanelComponentEventArgs": + return true; + case "HighlightNavigation": + case "WebHighlightNavigation": + return true; + case "IconMeta": + case "WebIconMeta": + return true; + case "NumberEventArgs": + case "WebNumberEventArgs": + return true; + case "RadioChangeEventArgs": + case "WebRadioChangeEventArgs": + return true; + case "RadioChangeEventArgsDetail": + case "WebRadioChangeEventArgsDetail": + return true; + case "RangeSliderValue": + case "WebRangeSliderValue": + return true; + case "SelectItemComponentEventArgs": + case "WebSelectItemComponentEventArgs": + return true; + case "SplitterResizeEventArgs": + case "WebSplitterResizeEventArgs": + return true; + case "SplitterResizeEventArgsDetail": + case "WebSplitterResizeEventArgsDetail": + return true; + case "TabComponentEventArgs": + case "WebTabComponentEventArgs": + return true; + case "TileChangeStateEventArgs": + case "WebTileChangeStateEventArgs": + return true; + case "TileChangeStateEventArgsDetail": + case "WebTileChangeStateEventArgsDetail": + return true; + case "TileComponentEventArgs": + case "WebTileComponentEventArgs": + return true; + case "TreeItemComponentEventArgs": + case "WebTreeItemComponentEventArgs": + return true; + case "TreeSelectionEventArgs": + case "WebTreeSelectionEventArgs": + return true; + case "TreeSelectionEventArgsDetail": + case "WebTreeSelectionEventArgsDetail": + return true; -//@@MustMarshalByValueEnd + //@@MustMarshalByValueEnd } return false; } @@ -146,179 +141,179 @@ internal static object CreateInstance(string typeName) { switch (typeName) { -//@@MarshalByValue -case "CalendarDate": - return new IgbCalendarDate(); - break; -case "CalendarFormatOptions": - return new IgbCalendarFormatOptions(); - break; -case "FocusOptions": - return new IgbFocusOptions(); - break; -case "FormatSpecifier": - return new IgbFormatSpecifier(); - break; -case "NumberFormatSpecifier": - return new IgbNumberFormatSpecifier(); - break; -case "ActiveStepChangedEventArgs": - case "WebActiveStepChangedEventArgs": - return new IgbActiveStepChangedEventArgs(); - break; -case "ActiveStepChangedEventArgsDetail": - case "WebActiveStepChangedEventArgsDetail": - return new IgbActiveStepChangedEventArgsDetail(); - break; -case "ActiveStepChangingEventArgs": - case "WebActiveStepChangingEventArgs": - return new IgbActiveStepChangingEventArgs(); - break; -case "ActiveStepChangingEventArgsDetail": - case "WebActiveStepChangingEventArgsDetail": - return new IgbActiveStepChangingEventArgsDetail(); - break; -case "ChatDraftMessage": - case "WebChatDraftMessage": - return new IgbChatDraftMessage(); - break; -case "ChatMessage": - case "WebChatMessage": - return new IgbChatMessage(); - break; -case "ChatMessageAttachment": - case "WebChatMessageAttachment": - return new IgbChatMessageAttachment(); - break; -case "ChatMessageAttachmentEventArgs": - case "WebChatMessageAttachmentEventArgs": - return new IgbChatMessageAttachmentEventArgs(); - break; -case "ChatMessageEventArgs": - case "WebChatMessageEventArgs": - return new IgbChatMessageEventArgs(); - break; -case "ChatMessageReaction": - case "WebChatMessageReaction": - return new IgbChatMessageReaction(); - break; -case "ChatMessageReactionEventArgs": - case "WebChatMessageReactionEventArgs": - return new IgbChatMessageReactionEventArgs(); - break; -case "CheckboxChangeEventArgs": - case "WebCheckboxChangeEventArgs": - return new IgbCheckboxChangeEventArgs(); - break; -case "CheckboxChangeEventArgsDetail": - case "WebCheckboxChangeEventArgsDetail": - return new IgbCheckboxChangeEventArgsDetail(); - break; -case "ComboChangeEventArgs": - case "WebComboChangeEventArgs": - return new IgbComboChangeEventArgs(); - break; -case "ComboChangeEventArgsDetail": - case "WebComboChangeEventArgsDetail": - return new IgbComboChangeEventArgsDetail(); - break; -case "ComponentBoolValueChangedEventArgs": - case "WebComponentBoolValueChangedEventArgs": - return new IgbComponentBoolValueChangedEventArgs(); - break; -case "ComponentDateValueChangedEventArgs": - case "WebComponentDateValueChangedEventArgs": - return new IgbComponentDateValueChangedEventArgs(); - break; -case "ComponentValueChangedEventArgs": - case "WebComponentValueChangedEventArgs": - return new IgbComponentValueChangedEventArgs(); - break; -case "DateRangeValueDetail": - case "WebDateRangeValueDetail": - return new IgbDateRangeValueDetail(); - break; -case "DateRangeValueEventArgs": - case "WebDateRangeValueEventArgs": - return new IgbDateRangeValueEventArgs(); - break; -case "DropdownItemComponentEventArgs": - case "WebDropdownItemComponentEventArgs": - return new IgbDropdownItemComponentEventArgs(); - break; -case "ExpansionPanelComponentEventArgs": - case "WebExpansionPanelComponentEventArgs": - return new IgbExpansionPanelComponentEventArgs(); - break; -case "HighlightNavigation": - case "WebHighlightNavigation": - return new IgbHighlightNavigation(); - break; -case "IconMeta": - case "WebIconMeta": - return new IgbIconMeta(); - break; -case "NumberEventArgs": - case "WebNumberEventArgs": - return new IgbNumberEventArgs(); - break; -case "RadioChangeEventArgs": - case "WebRadioChangeEventArgs": - return new IgbRadioChangeEventArgs(); - break; -case "RadioChangeEventArgsDetail": - case "WebRadioChangeEventArgsDetail": - return new IgbRadioChangeEventArgsDetail(); - break; -case "RangeSliderValue": - case "WebRangeSliderValue": - return new IgbRangeSliderValue(); - break; -case "SelectItemComponentEventArgs": - case "WebSelectItemComponentEventArgs": - return new IgbSelectItemComponentEventArgs(); - break; -case "SplitterResizeEventArgs": - case "WebSplitterResizeEventArgs": - return new IgbSplitterResizeEventArgs(); - break; -case "SplitterResizeEventArgsDetail": - case "WebSplitterResizeEventArgsDetail": - return new IgbSplitterResizeEventArgsDetail(); - break; -case "TabComponentEventArgs": - case "WebTabComponentEventArgs": - return new IgbTabComponentEventArgs(); - break; -case "TileChangeStateEventArgs": - case "WebTileChangeStateEventArgs": - return new IgbTileChangeStateEventArgs(); - break; -case "TileChangeStateEventArgsDetail": - case "WebTileChangeStateEventArgsDetail": - return new IgbTileChangeStateEventArgsDetail(); - break; -case "TileComponentEventArgs": - case "WebTileComponentEventArgs": - return new IgbTileComponentEventArgs(); - break; -case "TreeItemComponentEventArgs": - case "WebTreeItemComponentEventArgs": - return new IgbTreeItemComponentEventArgs(); - break; -case "TreeSelectionEventArgs": - case "WebTreeSelectionEventArgs": - return new IgbTreeSelectionEventArgs(); - break; -case "TreeSelectionEventArgsDetail": - case "WebTreeSelectionEventArgsDetail": - return new IgbTreeSelectionEventArgsDetail(); - break; + //@@MarshalByValue + case "CalendarDate": + return new IgbCalendarDate(); + break; + case "CalendarFormatOptions": + return new IgbCalendarFormatOptions(); + break; + case "FocusOptions": + return new IgbFocusOptions(); + break; + case "FormatSpecifier": + return new IgbFormatSpecifier(); + break; + case "NumberFormatSpecifier": + return new IgbNumberFormatSpecifier(); + break; + case "ActiveStepChangedEventArgs": + case "WebActiveStepChangedEventArgs": + return new IgbActiveStepChangedEventArgs(); + break; + case "ActiveStepChangedEventArgsDetail": + case "WebActiveStepChangedEventArgsDetail": + return new IgbActiveStepChangedEventArgsDetail(); + break; + case "ActiveStepChangingEventArgs": + case "WebActiveStepChangingEventArgs": + return new IgbActiveStepChangingEventArgs(); + break; + case "ActiveStepChangingEventArgsDetail": + case "WebActiveStepChangingEventArgsDetail": + return new IgbActiveStepChangingEventArgsDetail(); + break; + case "ChatDraftMessage": + case "WebChatDraftMessage": + return new IgbChatDraftMessage(); + break; + case "ChatMessage": + case "WebChatMessage": + return new IgbChatMessage(); + break; + case "ChatMessageAttachment": + case "WebChatMessageAttachment": + return new IgbChatMessageAttachment(); + break; + case "ChatMessageAttachmentEventArgs": + case "WebChatMessageAttachmentEventArgs": + return new IgbChatMessageAttachmentEventArgs(); + break; + case "ChatMessageEventArgs": + case "WebChatMessageEventArgs": + return new IgbChatMessageEventArgs(); + break; + case "ChatMessageReaction": + case "WebChatMessageReaction": + return new IgbChatMessageReaction(); + break; + case "ChatMessageReactionEventArgs": + case "WebChatMessageReactionEventArgs": + return new IgbChatMessageReactionEventArgs(); + break; + case "CheckboxChangeEventArgs": + case "WebCheckboxChangeEventArgs": + return new IgbCheckboxChangeEventArgs(); + break; + case "CheckboxChangeEventArgsDetail": + case "WebCheckboxChangeEventArgsDetail": + return new IgbCheckboxChangeEventArgsDetail(); + break; + case "ComboChangeEventArgs": + case "WebComboChangeEventArgs": + return new IgbComboChangeEventArgs(); + break; + case "ComboChangeEventArgsDetail": + case "WebComboChangeEventArgsDetail": + return new IgbComboChangeEventArgsDetail(); + break; + case "ComponentBoolValueChangedEventArgs": + case "WebComponentBoolValueChangedEventArgs": + return new IgbComponentBoolValueChangedEventArgs(); + break; + case "ComponentDateValueChangedEventArgs": + case "WebComponentDateValueChangedEventArgs": + return new IgbComponentDateValueChangedEventArgs(); + break; + case "ComponentValueChangedEventArgs": + case "WebComponentValueChangedEventArgs": + return new IgbComponentValueChangedEventArgs(); + break; + case "DateRangeValueDetail": + case "WebDateRangeValueDetail": + return new IgbDateRangeValueDetail(); + break; + case "DateRangeValueEventArgs": + case "WebDateRangeValueEventArgs": + return new IgbDateRangeValueEventArgs(); + break; + case "DropdownItemComponentEventArgs": + case "WebDropdownItemComponentEventArgs": + return new IgbDropdownItemComponentEventArgs(); + break; + case "ExpansionPanelComponentEventArgs": + case "WebExpansionPanelComponentEventArgs": + return new IgbExpansionPanelComponentEventArgs(); + break; + case "HighlightNavigation": + case "WebHighlightNavigation": + return new IgbHighlightNavigation(); + break; + case "IconMeta": + case "WebIconMeta": + return new IgbIconMeta(); + break; + case "NumberEventArgs": + case "WebNumberEventArgs": + return new IgbNumberEventArgs(); + break; + case "RadioChangeEventArgs": + case "WebRadioChangeEventArgs": + return new IgbRadioChangeEventArgs(); + break; + case "RadioChangeEventArgsDetail": + case "WebRadioChangeEventArgsDetail": + return new IgbRadioChangeEventArgsDetail(); + break; + case "RangeSliderValue": + case "WebRangeSliderValue": + return new IgbRangeSliderValue(); + break; + case "SelectItemComponentEventArgs": + case "WebSelectItemComponentEventArgs": + return new IgbSelectItemComponentEventArgs(); + break; + case "SplitterResizeEventArgs": + case "WebSplitterResizeEventArgs": + return new IgbSplitterResizeEventArgs(); + break; + case "SplitterResizeEventArgsDetail": + case "WebSplitterResizeEventArgsDetail": + return new IgbSplitterResizeEventArgsDetail(); + break; + case "TabComponentEventArgs": + case "WebTabComponentEventArgs": + return new IgbTabComponentEventArgs(); + break; + case "TileChangeStateEventArgs": + case "WebTileChangeStateEventArgs": + return new IgbTileChangeStateEventArgs(); + break; + case "TileChangeStateEventArgsDetail": + case "WebTileChangeStateEventArgsDetail": + return new IgbTileChangeStateEventArgsDetail(); + break; + case "TileComponentEventArgs": + case "WebTileComponentEventArgs": + return new IgbTileComponentEventArgs(); + break; + case "TreeItemComponentEventArgs": + case "WebTreeItemComponentEventArgs": + return new IgbTreeItemComponentEventArgs(); + break; + case "TreeSelectionEventArgs": + case "WebTreeSelectionEventArgs": + return new IgbTreeSelectionEventArgs(); + break; + case "TreeSelectionEventArgsDetail": + case "WebTreeSelectionEventArgsDetail": + return new IgbTreeSelectionEventArgsDetail(); + break; -//@@MarshalByValueEnd + //@@MarshalByValueEnd } return null; } } -} \ No newline at end of file +} diff --git a/src/componentsBase/RefSink.cs b/src/componentsBase/RefSink.cs index 0686b0f2..9fd674d2 100644 --- a/src/componentsBase/RefSink.cs +++ b/src/componentsBase/RefSink.cs @@ -1,9 +1,8 @@ -using System; - namespace IgniteUI.Blazor.Controls { - internal interface RefSink { + internal interface RefSink + { void OnRefChanged(String refName, Object refValue); void OnRefNotifyInsertItem(IJSDataSource dataSource, String refName, int index, Object refItem); void OnRefNotifyRemoveItem(IJSDataSource dataSource, String refName, int index, Object oldItem); @@ -11,4 +10,4 @@ internal interface RefSink { void OnRefNotifySetItem(IJSDataSource dataSource, String refName, int index, Object oldItem, Object newItem); void OnRefNotifyUpdateItem(IJSDataSource dataSource, String refName, int index, Object refItem, bool syncDataOnly); } -} \ No newline at end of file +} diff --git a/src/componentsBase/RendererMessage.cs b/src/componentsBase/RendererMessage.cs index 1e9dc74a..06297815 100644 --- a/src/componentsBase/RendererMessage.cs +++ b/src/componentsBase/RendererMessage.cs @@ -1,5 +1,3 @@ -using System; -using System.Collections.Generic; using Microsoft.AspNetCore.Components; namespace IgniteUI.Blazor.Controls @@ -8,7 +6,7 @@ internal class RendererMessage { private Dictionary _data = new Dictionary(); private String _type = null; - public string Type + public string Type { get { @@ -19,17 +17,18 @@ public string Type _type = value; } } - public void SetData(string key, string data) + public void SetData(string key, string data) { _data[key] = data; } - public string ToJson() + public string ToJson() { List props = new List(); props.Add("\"type\": \"" + _type + "\""); - foreach (string key in _data.Keys) { + foreach (string key in _data.Keys) + { props.Add("\"" + key + "\": " + _data[key]); } diff --git a/src/componentsBase/RendererSerializer.cs b/src/componentsBase/RendererSerializer.cs index 37f379f7..62d907b3 100644 --- a/src/componentsBase/RendererSerializer.cs +++ b/src/componentsBase/RendererSerializer.cs @@ -1,17 +1,13 @@ -using System; -using System.Collections.Generic; -using System.Globalization; using System.Collections; +using System.Globalization; using System.Text.RegularExpressions; - -using System.Text.Json; using Microsoft.AspNetCore.Components; -using System.Linq; -namespace IgniteUI.Blazor.Controls +namespace IgniteUI.Blazor.Controls { - internal partial class RendererSerializer { + internal partial class RendererSerializer + { public RendererSerializer(SerializationContext context, ComponentBase component, string name) { _name = name; @@ -39,7 +35,8 @@ public string Type } } - public void AddBooleanProp(string propertyName, bool value) { + public void AddBooleanProp(string propertyName, bool value) + { if (_context.Filter != null) { if (!_context.Filter(_name, propertyName)) @@ -51,7 +48,8 @@ public void AddBooleanProp(string propertyName, bool value) { //_properties.Add("\"" + propertyName + "\"" + ": " + value.ToString(CultureInfo.InvariantCulture).ToLower()); } - public void AddStringProp(string propertyName, string value) { + public void AddStringProp(string propertyName, string value) + { if (_context.Filter != null) { if (propertyName != "name" && propertyName != "type") @@ -121,7 +119,8 @@ public void AddPrimitiveProp(object val) } } - public void AddPrimitiveProp(string propertyName, object val) { + public void AddPrimitiveProp(string propertyName, object val) + { if (_context.Filter != null) { if (!_context.Filter(_name, propertyName)) @@ -140,7 +139,7 @@ public void AddPrimitiveProp(string propertyName, object val) { AddPrimitiveProp(subVal); } _context.Writer.WriteEndArray(); - } + } else if (val is double) { _context.Writer.WriteNumber(propertyName, (double)val); @@ -183,14 +182,17 @@ public void AddPrimitiveProp(string propertyName, object val) { } } - public void AddArrayProp(string propertyName, object values) { + public void AddArrayProp(string propertyName, object values) + { bool containsSub = false; var valuesArray = values as object[]; if (values != null) { - for (int i = 0; i < valuesArray.Length; i++) { + for (int i = 0; i < valuesArray.Length; i++) + { object val = valuesArray[i]; - if (val is BaseRendererControl || val is BaseRendererElement) { + if (val is BaseRendererControl || val is BaseRendererElement) + { containsSub = true; break; } @@ -208,22 +210,28 @@ public void AddArrayProp(string propertyName, object values) { context = new SerializationContext(_context.Writer, null); } } - if (values == null) { + if (values == null) + { //_properties.Add("\"" + propertyName + "\"" + ": null"); context.Writer.WriteNull(propertyName); return; } //string[] strValues = new string[values.Length]; context.Writer.WriteStartArray(propertyName); - for (int i = 0; i < valuesArray.Length; i++) { + for (int i = 0; i < valuesArray.Length; i++) + { object val = valuesArray[i]; - if (val is String) { + if (val is String) + { context.Writer.WriteStringValue((string)val); //strValues[i] = "\"" + (string)val + "\""; - } else if (val is JsonSerializable) { + } + else if (val is JsonSerializable) + { ((JsonSerializable)val).Serialize(context); } - else { + else + { if (val is double) { context.Writer.WriteNumberValue((double)val); @@ -271,14 +279,15 @@ public void AddArrayProp(string propertyName, object values) { protected string Camelize(string value) { - if (value == null || value.Length == 0) { + if (value == null || value.Length == 0) + { return value; } return value.Substring(0, 1).ToLower() + value.Substring(1); } - - public void AddEnumProp(string propertyName, Enum value) { + public void AddEnumProp(string propertyName, Enum value) + { if (_context.Filter != null) { if (!_context.Filter(_name, propertyName)) @@ -304,7 +313,8 @@ public void AddEnumProp(string propertyName, Enum value) { // return TextUtils.join("", parts); // } - public void AddNumberProp(String propertyName, Object value) { + public void AddNumberProp(String propertyName, Object value) + { if (_context.Filter != null) { if (!_context.Filter(_name, propertyName)) @@ -335,7 +345,8 @@ public void AddNumberProp(String propertyName, Object value) { //_properties.Add("\"" + propertyName + "\"" + ": " + Convert.ToString(value, CultureInfo.InvariantCulture)); } - public void AddDateTimeProp(String propertyName, DateTime? value) { + public void AddDateTimeProp(String propertyName, DateTime? value) + { if (_context.Filter != null) { if (!_context.Filter(_name, propertyName)) @@ -359,15 +370,18 @@ public void Start(string propertyName = null) } } - public void End() { + public void End() + { _context.Writer.WriteString("type", Type); _context.Writer.WriteEndObject(); } - public void AddSerializableProp(String propertyName, JsonSerializable value) { + public void AddSerializableProp(String propertyName, JsonSerializable value) + { var context = _context; - - if (value == null) { + + if (value == null) + { if (_context.Filter != null) { @@ -379,7 +393,7 @@ public void AddSerializableProp(String propertyName, JsonSerializable value) { { context = new SerializationContext(_context.Writer, null); } - } + } context.Writer.WriteNull(propertyName); //_properties.Add("\"" + propertyName + "\"" + ": null"); return; @@ -394,12 +408,13 @@ public void AddSerializableProp(String propertyName, JsonSerializable value) { { context = new SerializationContext(_context.Writer, null); } - } + } value.Serialize(context, propertyName); //_properties.Add("\"" + propertyName + "\"" + ": " + value.Serialize()); } - public void AddStringArrayProp(String propertyName, string[] values) { + public void AddStringArrayProp(String propertyName, string[] values) + { if (_context.Filter != null) { if (!_context.Filter(_name, propertyName)) @@ -408,7 +423,8 @@ public void AddStringArrayProp(String propertyName, string[] values) { } } - if (values == null) { + if (values == null) + { _context.Writer.WriteNull(propertyName); //_properties.Add("\"" + propertyName + "\"" + ": null"); return; @@ -416,16 +432,18 @@ public void AddStringArrayProp(String propertyName, string[] values) { //Console.WriteLine("parsing brush array"); var v = values; //v = v.Trim(); - + var parts = values; - for (var i = 0; i < parts.Length; i++) { + for (var i = 0; i < parts.Length; i++) + { parts[i] = parts[i].Trim(); //Console.WriteLine("brush part: " + parts[i]); } _context.Writer.WriteStartArray(propertyName); //string[] strValues = new string[parts.Length]; - for (int i = 0; i < parts.Length; i++) { + for (int i = 0; i < parts.Length; i++) + { string val = parts[i]; _context.Writer.WriteStringValue(val); //strValues[i] = "\"" + val + "\""; @@ -437,7 +455,8 @@ public void AddStringArrayProp(String propertyName, string[] values) { // _properties.Add("\"" + propertyName + "\"" + ": [" + arrayParts + " ]"); } - public void AddDateArrayProp(String propertyName, DateTime[] values) { + public void AddDateArrayProp(String propertyName, DateTime[] values) + { if (_context.Filter != null) { if (!_context.Filter(_name, propertyName)) @@ -446,7 +465,8 @@ public void AddDateArrayProp(String propertyName, DateTime[] values) { } } - if (values == null) { + if (values == null) + { _context.Writer.WriteNull(propertyName); //_properties.Add("\"" + propertyName + "\"" + ": null"); return; @@ -454,7 +474,7 @@ public void AddDateArrayProp(String propertyName, DateTime[] values) { //Console.WriteLine("parsing brush array"); var v = values; //v = v.Trim(); - + var parts = values; // for (var i = 0; i < parts.Length; i++) { // parts[i] = parts[i].Trim(); @@ -467,7 +487,6 @@ public void AddDateArrayProp(String propertyName, DateTime[] values) { // needed because of refactoring in the wc calendar // PR: https://github.com/IgniteUI/igniteui-webcomponents/pull/1200 - _context.Writer.WriteStartArray(propertyName); for (int i = 0; i < parts.Length; i++) { @@ -482,7 +501,8 @@ public void AddDateArrayProp(String propertyName, DateTime[] values) { } private Regex _colorSplitRegex = new Regex("[\\s,]+(?![^(]*\\))"); - public void AddStringArrayProp(String propertyName, string values) { + public void AddStringArrayProp(String propertyName, string values) + { if (_context.Filter != null) { if (!_context.Filter(_name, propertyName)) @@ -491,7 +511,8 @@ public void AddStringArrayProp(String propertyName, string values) { } } - if (values == null) { + if (values == null) + { _context.Writer.WriteNull(propertyName); //_properties.Add("\"" + propertyName + "\"" + ": null"); return; @@ -499,16 +520,18 @@ public void AddStringArrayProp(String propertyName, string values) { //Console.WriteLine("parsing brush array"); var v = values; v = v.Trim(); - + var parts = _colorSplitRegex.Split(v); - for (var i = 0; i < parts.Length; i++) { + for (var i = 0; i < parts.Length; i++) + { parts[i] = parts[i].Trim(); //Console.WriteLine("brush part: " + parts[i]); } _context.Writer.WriteStartArray(propertyName); //string[] strValues = new string[parts.Length]; - for (int i = 0; i < parts.Length; i++) { + for (int i = 0; i < parts.Length; i++) + { string val = parts[i]; _context.Writer.WriteStringValue(val); //strValues[i] = "\"" + val + "\""; @@ -520,7 +543,8 @@ public void AddStringArrayProp(String propertyName, string values) { // _properties.Add("\"" + propertyName + "\"" + ": [" + arrayParts + " ]"); } - public void AddEnumArrayProp(String propertyName, object values) { + public void AddEnumArrayProp(String propertyName, object values) + { if (_context.Filter != null) { if (!_context.Filter(_name, propertyName)) @@ -529,7 +553,8 @@ public void AddEnumArrayProp(String propertyName, object values) { } } - if (values == null) { + if (values == null) + { _context.Writer.WriteNull(propertyName); return; //_properties.Add("\"" + propertyName + "\"" + ": null"); @@ -537,7 +562,8 @@ public void AddEnumArrayProp(String propertyName, object values) { IList vals = (IList)(object)values; //string[] strValues = new string[vals.Count]; _context.Writer.WriteStartArray(propertyName); - for (int i = 0; i < vals.Count; i++) { + for (int i = 0; i < vals.Count; i++) + { Enum val = (Enum)vals[i]; _context.Writer.WriteStringValue(Camelize(val.ToString())); //strValues[i] = "\"" + val.ToString() + "\""; @@ -546,7 +572,8 @@ public void AddEnumArrayProp(String propertyName, object values) { //_properties.Add("\"" + propertyName + "\"" + ": [" + string.Join(", ", strValues) + " ]"); } - public void AddIntArrayProp(String propertyName, int[] values) { + public void AddIntArrayProp(String propertyName, int[] values) + { if (_context.Filter != null) { if (!_context.Filter(_name, propertyName)) @@ -555,14 +582,16 @@ public void AddIntArrayProp(String propertyName, int[] values) { } } - if (values == null) { + if (values == null) + { _context.Writer.WriteNull(propertyName); //_properties.Add("\"" + propertyName + "\"" + ": null"); return; } //string[] strValues = new string[values.Length]; _context.Writer.WriteStartArray(propertyName); - for (int i = 0; i < values.Length; i++) { + for (int i = 0; i < values.Length; i++) + { int val = values[i]; //strValues[i] = val.ToString(CultureInfo.InvariantCulture); _context.Writer.WriteNumberValue(val); @@ -571,7 +600,8 @@ public void AddIntArrayProp(String propertyName, int[] values) { //_properties.Add("\"" + propertyName + "\"" + ": [" + string.Join(", ", strValues) + " ]"); } - public void AddDoubleArrayProp(string propertyName, double[] numbers) { + public void AddDoubleArrayProp(string propertyName, double[] numbers) + { if (_context.Filter != null) { if (!_context.Filter(_name, propertyName)) @@ -580,7 +610,8 @@ public void AddDoubleArrayProp(string propertyName, double[] numbers) { } } - if (numbers == null) { + if (numbers == null) + { _context.Writer.WriteNull(propertyName); //_properties.Add("\"" + propertyName + "\"" + ": null"); return; @@ -588,7 +619,8 @@ public void AddDoubleArrayProp(string propertyName, double[] numbers) { //List items = new List(); _context.Writer.WriteStartArray(propertyName); - for (int i = 0; i < numbers.Length; i++) { + for (int i = 0; i < numbers.Length; i++) + { //string c = numbers[i].ToString(CultureInfo.InvariantCulture); //items.Add(c); _context.Writer.WriteNumberValue(numbers[i]); @@ -597,8 +629,10 @@ public void AddDoubleArrayProp(string propertyName, double[] numbers) { //_properties.Add("\"" + propertyName + "\": " + "[" + string.Join(", ", items) + "]"); } - public void AddSerializableArrayProp(string propertyName, T[] array) where T: JsonSerializable { - if (array == null) { + public void AddSerializableArrayProp(string propertyName, T[] array) where T : JsonSerializable + { + if (array == null) + { if (_context.Filter != null) { if (!_context.Filter(_name, propertyName)) @@ -612,7 +646,6 @@ public void AddSerializableArrayProp(string propertyName, T[] array) where T: return; } - var context = _context; if (_context.Filter != null) { @@ -623,7 +656,8 @@ public void AddSerializableArrayProp(string propertyName, T[] array) where T: } //List items = new List(); context.Writer.WriteStartArray(propertyName); - for (int i = 0; i < array.Length; i++) { + for (int i = 0; i < array.Length; i++) + { //string c = numbers[i].ToString(CultureInfo.InvariantCulture); //items.Add(c); var item = (JsonSerializable)array[i]; @@ -640,7 +674,8 @@ public void AddSerializableArrayProp(string propertyName, T[] array) where T: //_properties.Add("\"" + propertyName + "\"" + ": " + coll.Serialize()); } - public void AddCollectionProp(string propertyName, BaseCollection coll) { + public void AddCollectionProp(string propertyName, BaseCollection coll) + { var context = _context; if (_context.Filter != null) { diff --git a/src/componentsBase/RuntimeHelper.cs b/src/componentsBase/RuntimeHelper.cs index 4a882399..b685dc57 100644 --- a/src/componentsBase/RuntimeHelper.cs +++ b/src/componentsBase/RuntimeHelper.cs @@ -1,10 +1,7 @@ -using Microsoft.JSInterop; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Linq.Expressions; using System.Diagnostics.CodeAnalysis; +using System.Linq.Expressions; using System.Runtime.CompilerServices; +using Microsoft.JSInterop; namespace IgniteUI.Blazor.Controls { @@ -57,9 +54,9 @@ public RuntimeHelper(IJSRuntime runtime, IIgniteUIBlazor igBlazor) if (target != null) { //Console.WriteLine("found target"); - var meth = target.MakeGenericMethod(new Type[] { - typeof(string), - typeof(int), + var meth = target.MakeGenericMethod(new Type[] { + typeof(string), + typeof(int), typeof(UnmarshalledColumn[]), typeof(string) }); @@ -74,7 +71,7 @@ public RuntimeHelper(IJSRuntime runtime, IIgniteUIBlazor igBlazor) var call = Expression.Call(wsRuntime, meth, methodNameParam, refNameParam, indexParam, columnsParam); - _callSendUnmarshalledColumnMessage = + _callSendUnmarshalledColumnMessage = (Func)Expression.Lambda( call, jsRuntimeParam, methodNameParam, refNameParam, indexParam, columnsParam).Compile(); } @@ -84,9 +81,9 @@ public RuntimeHelper(IJSRuntime runtime, IIgniteUIBlazor igBlazor) if (target != null) { //Console.WriteLine("found target"); - var meth = target.MakeGenericMethod(new Type[] { - typeof(string), - typeof(string), + var meth = target.MakeGenericMethod(new Type[] { + typeof(string), + typeof(string), typeof(string) }); @@ -94,12 +91,12 @@ public RuntimeHelper(IJSRuntime runtime, IIgniteUIBlazor igBlazor) var methodNameParam = Expression.Parameter(typeof(string), "methodName"); var refNameParam = Expression.Parameter(typeof(string), "refName"); var dataIntentParam = Expression.Parameter(typeof(string), "index"); - + var wsRuntime = Expression.Convert(jsRuntimeParam, inprocRuntime.GetType()); var call = Expression.Call(wsRuntime, meth, methodNameParam, refNameParam, dataIntentParam); - _callSendUnmarshalledColumnDataIntentMessage = + _callSendUnmarshalledColumnDataIntentMessage = (Func)Expression.Lambda( call, jsRuntimeParam, methodNameParam, refNameParam, dataIntentParam).Compile(); } @@ -148,6 +145,6 @@ public string SendUnmarshalledColumnDataIntentsMessage(string methodName, string } public bool IsInproc { get; private set; } - public bool IsForcedJsonDataMarshalling { get { return _igBlazor.Settings.ForceJsonDataMarshalling; } } + public bool IsForcedJsonDataMarshalling { get { return _igBlazor.Settings.ForceJsonDataMarshalling; } } } -} \ No newline at end of file +} diff --git a/src/componentsBase/UnmarshalledDataSource.cs b/src/componentsBase/UnmarshalledDataSource.cs index fb42c517..9c6d4bd4 100644 --- a/src/componentsBase/UnmarshalledDataSource.cs +++ b/src/componentsBase/UnmarshalledDataSource.cs @@ -1,5 +1,3 @@ -using System; -using System.Collections.Generic; using System.Collections; using System.Collections.Specialized; using System.Runtime.InteropServices; @@ -20,7 +18,7 @@ public UnmarshalledColumnData() SubSchema = null; } - public string PropertyPath { get; set;} + public string PropertyPath { get; set; } public JSDataSourceSchemaType Type { get; set; } public int[] IntValues { get; set; } public long[] LongValues { get; set; } @@ -46,7 +44,7 @@ public UnmarshalledColumnData() public Delegate Getter { get; internal set; } } - [StructLayout(LayoutKind.Explicit, Size=56)] + [StructLayout(LayoutKind.Explicit, Size = 56)] internal struct UnmarshalledColumn { [FieldOffset(0)] @@ -74,17 +72,17 @@ internal struct UnmarshalledColumn } internal class UnmarshalledDataSource - : IJSDataSource + : IJSDataSource + { + public bool SuppressModifications { get; set; } + public JSDataSourceType DataSourceType { - public bool SuppressModifications { get; set; } - public JSDataSourceType DataSourceType + get { - get - { - return JSDataSourceType.Unmarshalled; - } + return JSDataSourceType.Unmarshalled; } - public bool IsSent { get; set; } + } + public bool IsSent { get; set; } private object _originalData; private Dictionary _uuidToOriginal = new Dictionary(); @@ -103,7 +101,7 @@ public JSDataSourceType DataSourceType private int _size = 0; private int _capacity = 0; - internal int Capacity + internal int Capacity { get { @@ -122,7 +120,8 @@ internal int Capacity public UnmarshalledDataSource() { - _idGetter = (o) => { + _idGetter = (o) => + { if (o == null) { return Guid.Empty; @@ -156,7 +155,7 @@ private UnmarshalledColumnData[] AdjustCapacity(string parentPath, UnmarshalledC if (columns == null) { columns = new UnmarshalledColumnData[2]; - columns[0] = CreateColumn(parentPath, "___self", schema, JSDataSourceSchemaType.ObjectValue, + columns[0] = CreateColumn(parentPath, "___self", schema, JSDataSourceSchemaType.ObjectValue, (Func)((o) => o), (o) => o, false); //columns[0].IsSubDataSource = true; } @@ -171,7 +170,7 @@ private UnmarshalledColumnData[] AdjustCapacity(string parentPath, UnmarshalledC { extraCols = 0; } - columns = new UnmarshalledColumnData[schema.PropertyNames.Length + schema.FieldNames.Length + extraCols]; + columns = new UnmarshalledColumnData[schema.PropertyNames.Length + schema.FieldNames.Length + extraCols]; for (var k = 0; k < columns.Length; k++) { columns[k] = null; @@ -195,7 +194,8 @@ private UnmarshalledColumnData[] AdjustCapacity(string parentPath, UnmarshalledC } if (String.IsNullOrEmpty(parentPath)) { - Func idGetter = (o) => { + Func idGetter = (o) => + { if (o == null) { return Guid.Empty; @@ -213,7 +213,8 @@ private UnmarshalledColumnData[] AdjustCapacity(string parentPath, UnmarshalledC return id; } }; - Func untypedIdGetter = (o) => { + Func untypedIdGetter = (o) => + { return idGetter(o); }; if (columns[columns.Length - 1] == null) @@ -234,523 +235,523 @@ private UnmarshalledColumnData CreateColumn(string parentPath, string propertyNa { parentPath += "."; } - var newColumn = new UnmarshalledColumnData(); - newColumn.Getter = valueGetter; + var newColumn = new UnmarshalledColumnData(); + newColumn.Getter = valueGetter; - - newColumn.PropertyName = propertyName; - newColumn.PropertyPath = parentPath + propertyName; - newColumn.Type = type; - if (newColumn.Type == JSDataSourceSchemaType.ObjectValue) + newColumn.PropertyName = propertyName; + newColumn.PropertyPath = parentPath + propertyName; + newColumn.Type = type; + if (newColumn.Type == JSDataSourceSchemaType.ObjectValue) + { + var subSchema = schema.GetSubSchema(propertyName); + if (subSchema == null) { - var subSchema = schema.GetSubSchema(propertyName); - if (subSchema == null) - { - //Console.WriteLine("create column subschema is null: " + propertyName); - } else { - newColumn.IsSubDataSource = subSchema.IsDataSource; - newColumn.SubSchema = subSchema; - } + //Console.WriteLine("create column subschema is null: " + propertyName); } - - - var col = new UnmarshalledColumn(); - col.Type = type; - col.PropertyPath = parentPath + propertyName; - col.IsSubDataSource = newColumn.IsSubDataSource ? 1 : 0; - newColumn.Column = col; - - Func idGetter = null; - Func doubleGetter = null; - Func singleGetter = null; - Func boolGetter = null; - Func byteGetter = null; - Func decimalGetter = null; - Func shortGetter = null; - Func longGetter = null; - Func stringGetter = null; - Func dateTimeGetter = null; - Func objectGetter = null; - - Func floatingPointGetter = null; - Func integerGetter = null; - - Func nullableShortGetter = null; - Func nullableIntegerGetter = null; - Func nullableLongGetter = null; - Func nullableSingleGetter = null; - Func nullableDoubleGetter = null; - Func nullableDecimalGetter = null; - Func nullableBoolGetter = null; - Func nullableByteGetter = null; - Func nullableDateTimeGetter = null; - Func nullableFloatingPointGetter = null; - - - switch (newColumn.Type) + else { - case JSDataSourceSchemaType.DoubleValue: - doubleGetter = (Func)valueGetter; - floatingPointGetter = doubleGetter; - break; - case JSDataSourceSchemaType.SingleValue: - singleGetter = (Func)valueGetter; - floatingPointGetter = (o) => (double)singleGetter(o); - break; - case JSDataSourceSchemaType.BooleanValue: - boolGetter = (Func)valueGetter; - integerGetter = (o) => boolGetter(o) ? 1 : 0; - break; - case JSDataSourceSchemaType.ByteValue: - byteGetter = (Func)valueGetter; - integerGetter = (o) => (int)byteGetter(o); - break; - case JSDataSourceSchemaType.DecimalValue: - decimalGetter = (Func)valueGetter; - floatingPointGetter = (o) => (double)decimalGetter(o); - break; - case JSDataSourceSchemaType.IntValue: - integerGetter = (Func)valueGetter; - break; - case JSDataSourceSchemaType.ShortValue: - shortGetter = (Func)valueGetter; - integerGetter = (o) => (int)shortGetter(o); - break; - case JSDataSourceSchemaType.LongValue: - longGetter = (Func)valueGetter; - break; - case JSDataSourceSchemaType.StringValue: - if (isIDColumn) + newColumn.IsSubDataSource = subSchema.IsDataSource; + newColumn.SubSchema = subSchema; + } + } + + var col = new UnmarshalledColumn(); + col.Type = type; + col.PropertyPath = parentPath + propertyName; + col.IsSubDataSource = newColumn.IsSubDataSource ? 1 : 0; + newColumn.Column = col; + + Func idGetter = null; + Func doubleGetter = null; + Func singleGetter = null; + Func boolGetter = null; + Func byteGetter = null; + Func decimalGetter = null; + Func shortGetter = null; + Func longGetter = null; + Func stringGetter = null; + Func dateTimeGetter = null; + Func objectGetter = null; + + Func floatingPointGetter = null; + Func integerGetter = null; + + Func nullableShortGetter = null; + Func nullableIntegerGetter = null; + Func nullableLongGetter = null; + Func nullableSingleGetter = null; + Func nullableDoubleGetter = null; + Func nullableDecimalGetter = null; + Func nullableBoolGetter = null; + Func nullableByteGetter = null; + Func nullableDateTimeGetter = null; + Func nullableFloatingPointGetter = null; + + switch (newColumn.Type) + { + case JSDataSourceSchemaType.DoubleValue: + doubleGetter = (Func)valueGetter; + floatingPointGetter = doubleGetter; + break; + case JSDataSourceSchemaType.SingleValue: + singleGetter = (Func)valueGetter; + floatingPointGetter = (o) => (double)singleGetter(o); + break; + case JSDataSourceSchemaType.BooleanValue: + boolGetter = (Func)valueGetter; + integerGetter = (o) => boolGetter(o) ? 1 : 0; + break; + case JSDataSourceSchemaType.ByteValue: + byteGetter = (Func)valueGetter; + integerGetter = (o) => (int)byteGetter(o); + break; + case JSDataSourceSchemaType.DecimalValue: + decimalGetter = (Func)valueGetter; + floatingPointGetter = (o) => (double)decimalGetter(o); + break; + case JSDataSourceSchemaType.IntValue: + integerGetter = (Func)valueGetter; + break; + case JSDataSourceSchemaType.ShortValue: + shortGetter = (Func)valueGetter; + integerGetter = (o) => (int)shortGetter(o); + break; + case JSDataSourceSchemaType.LongValue: + longGetter = (Func)valueGetter; + break; + case JSDataSourceSchemaType.StringValue: + if (isIDColumn) + { + idGetter = (Func)valueGetter; + stringGetter = (o) => idGetter(o).ToString(); + } + else + { + stringGetter = (Func)valueGetter; + } + break; + case JSDataSourceSchemaType.CalendarValue: + case JSDataSourceSchemaType.DateTimeValue: + if (typeof(Func).IsAssignableFrom(valueGetter.GetType())) + { + dateTimeGetter = (Func)valueGetter; + stringGetter = (o) => ((DateTime)dateTimeGetter(o)).ToString("o"); + } + else + { + dateTimeGetter = (o) => (DateTime)untypedGetter(o); + stringGetter = (o) => ((DateTime)dateTimeGetter(o)).ToString("o"); + } + break; + case JSDataSourceSchemaType.ObjectValue: + objectGetter = untypedGetter; + break; + + case JSDataSourceSchemaType.DoubleArrayValue: + case JSDataSourceSchemaType.IntArrayValue: + case JSDataSourceSchemaType.LongArrayValue: + case JSDataSourceSchemaType.StringArrayValue: + case JSDataSourceSchemaType.CalendarArrayValue: + case JSDataSourceSchemaType.DateTimeArrayValue: + case JSDataSourceSchemaType.BooleanArrayValue: + case JSDataSourceSchemaType.DecimalArrayValue: + case JSDataSourceSchemaType.ByteArrayValue: + case JSDataSourceSchemaType.ShortArrayValue: + case JSDataSourceSchemaType.SingleArrayValue: + objectGetter = untypedGetter; + break; + + case JSDataSourceSchemaType.NullableDoubleValue: + nullableDoubleGetter = (Func)valueGetter; + nullableFloatingPointGetter = nullableDoubleGetter; + break; + case JSDataSourceSchemaType.NullableSingleValue: + nullableSingleGetter = (Func)valueGetter; + nullableFloatingPointGetter = (o) => (double?)nullableSingleGetter(o); + break; + case JSDataSourceSchemaType.NullableBooleanValue: + nullableBoolGetter = (Func)valueGetter; + nullableIntegerGetter = (o) => + { + var val = nullableBoolGetter(o); + int? t = 1; + int? f = 0; + return val == null ? null : (val == true) ? t : f; + }; + break; + case JSDataSourceSchemaType.NullableByteValue: + nullableByteGetter = (Func)valueGetter; + nullableIntegerGetter = (o) => (int?)nullableByteGetter(o); + break; + case JSDataSourceSchemaType.NullableDecimalValue: + nullableDecimalGetter = (Func)valueGetter; + nullableFloatingPointGetter = (o) => (double?)nullableDecimalGetter(o); + break; + case JSDataSourceSchemaType.NullableIntValue: + nullableIntegerGetter = (Func)valueGetter; + break; + case JSDataSourceSchemaType.NullableShortValue: + nullableShortGetter = (Func)valueGetter; + nullableIntegerGetter = (o) => (int?)nullableShortGetter(o); + break; + case JSDataSourceSchemaType.NullableLongValue: + nullableLongGetter = (Func)valueGetter; + break; + case JSDataSourceSchemaType.NullableCalendarValue: + case JSDataSourceSchemaType.NullableDateTimeValue: + if (typeof(Func).IsAssignableFrom(valueGetter.GetType())) + { + nullableDateTimeGetter = (Func)valueGetter; + stringGetter = (o) => { - idGetter = (Func)valueGetter; - stringGetter = (o) => idGetter(o).ToString(); - } - else + var val = nullableDateTimeGetter(o); + return val == null ? null : val.Value.ToString("o"); + }; + } + else + { + nullableDateTimeGetter = (o) => (DateTime?)untypedGetter(o); + stringGetter = (o) => { - stringGetter = (Func)valueGetter; + var val = nullableDateTimeGetter(o); + return val == null ? null : val.Value.ToString("o"); + }; + } + break; + } + + Action insert = null; + switch (newColumn.Type) + { + case JSDataSourceSchemaType.DoubleValue: + case JSDataSourceSchemaType.SingleValue: + case JSDataSourceSchemaType.DecimalValue: + insert = (size, column, index, item) => + { + double floatVal = double.NaN; + if (item != null) + { + if (!schema.IsPrimitive) + { + floatVal = floatingPointGetter(item); + } + else + { + floatVal = Convert.ToDouble(item); + } } - break; - case JSDataSourceSchemaType.CalendarValue: - case JSDataSourceSchemaType.DateTimeValue: - if (typeof(Func).IsAssignableFrom(valueGetter.GetType())) + if (index == size) { - dateTimeGetter = (Func)valueGetter; - stringGetter = (o) => ((DateTime)dateTimeGetter(o)).ToString("o"); + column.DoubleValues[index] = floatVal; } else { - dateTimeGetter = (o) => (DateTime)untypedGetter(o); - stringGetter = (o) => ((DateTime)dateTimeGetter(o)).ToString("o"); - } - break; - case JSDataSourceSchemaType.ObjectValue: - objectGetter = untypedGetter; - break; - - case JSDataSourceSchemaType.DoubleArrayValue: - case JSDataSourceSchemaType.IntArrayValue: - case JSDataSourceSchemaType.LongArrayValue: - case JSDataSourceSchemaType.StringArrayValue: - case JSDataSourceSchemaType.CalendarArrayValue: - case JSDataSourceSchemaType.DateTimeArrayValue: - case JSDataSourceSchemaType.BooleanArrayValue: - case JSDataSourceSchemaType.DecimalArrayValue: - case JSDataSourceSchemaType.ByteArrayValue: - case JSDataSourceSchemaType.ShortArrayValue: - case JSDataSourceSchemaType.SingleArrayValue: - objectGetter = untypedGetter; - break; - - case JSDataSourceSchemaType.NullableDoubleValue: - nullableDoubleGetter = (Func)valueGetter; - nullableFloatingPointGetter = nullableDoubleGetter; - break; - case JSDataSourceSchemaType.NullableSingleValue: - nullableSingleGetter = (Func)valueGetter; - nullableFloatingPointGetter = (o) => (double?)nullableSingleGetter(o); - break; - case JSDataSourceSchemaType.NullableBooleanValue: - nullableBoolGetter = (Func)valueGetter; - nullableIntegerGetter = (o) => + //Console.WriteLine("shouldn't be here"); + Array.Copy(column.DoubleValues, index, column.DoubleValues, index + 1, size - index); + column.DoubleValues[index] = floatVal; + } + }; + break; + case JSDataSourceSchemaType.NullableDoubleValue: + case JSDataSourceSchemaType.NullableSingleValue: + case JSDataSourceSchemaType.NullableDecimalValue: + insert = (size, column, index, item) => + { + double? floatVal = null; + if (item != null) { - var val = nullableBoolGetter(o); - int? t = 1; - int? f = 0; - return val == null ? null : (val == true) ? t : f; - }; - break; - case JSDataSourceSchemaType.NullableByteValue: - nullableByteGetter = (Func)valueGetter; - nullableIntegerGetter = (o) => (int?)nullableByteGetter(o); - break; - case JSDataSourceSchemaType.NullableDecimalValue: - nullableDecimalGetter = (Func)valueGetter; - nullableFloatingPointGetter = (o) => (double?)nullableDecimalGetter(o); - break; - case JSDataSourceSchemaType.NullableIntValue: - nullableIntegerGetter = (Func)valueGetter; - break; - case JSDataSourceSchemaType.NullableShortValue: - nullableShortGetter = (Func)valueGetter; - nullableIntegerGetter = (o) => (int?)nullableShortGetter(o); - break; - case JSDataSourceSchemaType.NullableLongValue: - nullableLongGetter = (Func)valueGetter; - break; - case JSDataSourceSchemaType.NullableCalendarValue: - case JSDataSourceSchemaType.NullableDateTimeValue: - if (typeof(Func).IsAssignableFrom(valueGetter.GetType())) + floatVal = nullableFloatingPointGetter(item); + } + if (index == size) { - nullableDateTimeGetter = (Func)valueGetter; - stringGetter = (o) => - { - var val = nullableDateTimeGetter(o); - return val == null ? null : val.Value.ToString("o"); - }; + column.DoubleValues[index] = floatVal != null ? floatVal.Value : double.NaN; + column.NullValues[index] = floatVal == null; } else { - nullableDateTimeGetter = (o) => (DateTime?)untypedGetter(o); - stringGetter = (o) => - { - var val = nullableDateTimeGetter(o); - return val == null ? null : val.Value.ToString("o"); - }; + //Console.WriteLine("shouldn't be here"); + Array.Copy(column.DoubleValues, index, column.DoubleValues, index + 1, size - index); + Array.Copy(column.NullValues, index, column.NullValues, index + 1, size - index); + column.DoubleValues[index] = floatVal != null ? floatVal.Value : double.NaN; + column.NullValues[index] = floatVal == null; } - break; - } - - Action insert = null; - switch (newColumn.Type) - { - case JSDataSourceSchemaType.DoubleValue: - case JSDataSourceSchemaType.SingleValue: - case JSDataSourceSchemaType.DecimalValue: - insert = (size, column, index, item) => + }; + break; + case JSDataSourceSchemaType.BooleanValue: + case JSDataSourceSchemaType.ByteValue: + case JSDataSourceSchemaType.IntValue: + case JSDataSourceSchemaType.ShortValue: + insert = (size, column, index, item) => + { + int intVal = int.MinValue; + if (item != null) { - double floatVal = double.NaN; - if (item != null) + if (!schema.IsPrimitive) { - if (!schema.IsPrimitive) - { - floatVal = floatingPointGetter(item); - } else - { - floatVal = Convert.ToDouble(item); - } + intVal = integerGetter(item); } - if (index == size) - { - column.DoubleValues[index] = floatVal; - } - else - { - //Console.WriteLine("shouldn't be here"); - Array.Copy(column.DoubleValues, index, column.DoubleValues, index + 1, size - index); - column.DoubleValues[index] = floatVal; - } - }; - break; - case JSDataSourceSchemaType.NullableDoubleValue: - case JSDataSourceSchemaType.NullableSingleValue: - case JSDataSourceSchemaType.NullableDecimalValue: - insert = (size, column, index, item) => - { - double? floatVal = null; - if (item != null) + else { - floatVal = nullableFloatingPointGetter(item); + intVal = Convert.ToInt32(item); } - if (index == size) + } + if (index == size) + { + column.IntValues[index] = intVal; + } + else + { + //Console.WriteLine("shouldn't be here"); + Array.Copy(column.IntValues, index, column.IntValues, index + 1, size - index); + column.IntValues[index] = intVal; + } + }; + break; + case JSDataSourceSchemaType.NullableBooleanValue: + case JSDataSourceSchemaType.NullableByteValue: + case JSDataSourceSchemaType.NullableIntValue: + case JSDataSourceSchemaType.NullableShortValue: + insert = (size, column, index, item) => + { + int? intVal = null; + if (item != null) + { + intVal = nullableIntegerGetter(item); + } + if (index == size) + { + column.IntValues[index] = intVal != null ? intVal.Value : int.MinValue; + column.NullValues[index] = intVal == null; + } + else + { + //Console.WriteLine("shouldn't be here"); + Array.Copy(column.IntValues, index, column.IntValues, index + 1, size - index); + Array.Copy(column.NullValues, index, column.NullValues, index + 1, size - index); + column.IntValues[index] = intVal != null ? intVal.Value : int.MinValue; + column.NullValues[index] = intVal == null; + } + }; + break; + case JSDataSourceSchemaType.LongValue: + insert = (size, column, index, item) => + { + long longVal = long.MinValue; + if (item != null) + { + if (!schema.IsPrimitive) { - column.DoubleValues[index] = floatVal != null ? floatVal.Value : double.NaN; - column.NullValues[index] = floatVal == null; + longVal = longGetter(item); } else { - //Console.WriteLine("shouldn't be here"); - Array.Copy(column.DoubleValues, index, column.DoubleValues, index + 1, size - index); - Array.Copy(column.NullValues, index, column.NullValues, index + 1, size - index); - column.DoubleValues[index] = floatVal != null ? floatVal.Value : double.NaN; - column.NullValues[index] = floatVal == null; + longVal = (long)item; } - }; - break; - case JSDataSourceSchemaType.BooleanValue: - case JSDataSourceSchemaType.ByteValue: - case JSDataSourceSchemaType.IntValue: - case JSDataSourceSchemaType.ShortValue: - insert = (size, column, index, item) => + } + if (index == size) + { + column.LongValues[index] = longVal; + } + else + { + //Console.WriteLine("shouldn't be here"); + Array.Copy(column.LongValues, index, column.LongValues, index + 1, size - index); + column.LongValues[index] = longVal; + } + }; + break; + case JSDataSourceSchemaType.NullableLongValue: + insert = (size, column, index, item) => + { + long? longVal = null; + if (item != null) + { + longVal = nullableLongGetter(item); + } + if (index == size) + { + column.LongValues[index] = longVal != null ? longVal.Value : long.MinValue; + column.NullValues[index] = longVal == null; + } + else + { + //Console.WriteLine("shouldn't be here"); + Array.Copy(column.LongValues, index, column.LongValues, index + 1, size - index); + Array.Copy(column.NullValues, index, column.NullValues, index + 1, size - index); + column.LongValues[index] = longVal != null ? longVal.Value : long.MinValue; + column.NullValues[index] = longVal == null; + } + }; + break; + case JSDataSourceSchemaType.StringValue: + case JSDataSourceSchemaType.CalendarValue: + case JSDataSourceSchemaType.DateTimeValue: + insert = (size, column, index, item) => + { + string stringVal = null; + Guid idVal = Guid.Empty; + if (item != null) { - int intVal = int.MinValue; - if (item != null) + if (column.IsIDColumn) { - if (!schema.IsPrimitive) + idVal = idGetter(item); + stringVal = _parentId != null ? _parentId + "/" + idVal.ToString() : idVal.ToString(); + } + else if (!schema.IsPrimitive) + { + try { - intVal = integerGetter(item); + stringVal = stringGetter(item); } - else + catch { - intVal = Convert.ToInt32(item); + stringVal = null; } } - if (index == size) - { - column.IntValues[index] = intVal; - } - else + else { - //Console.WriteLine("shouldn't be here"); - Array.Copy(column.IntValues, index, column.IntValues, index + 1, size - index); - column.IntValues[index] = intVal; + stringVal = item.ToString(); } - }; - break; - case JSDataSourceSchemaType.NullableBooleanValue: - case JSDataSourceSchemaType.NullableByteValue: - case JSDataSourceSchemaType.NullableIntValue: - case JSDataSourceSchemaType.NullableShortValue: - insert = (size, column, index, item) => + } + if (index == size) { - int? intVal = null; - if (item != null) + if (column.StringValues == null) { - intVal = nullableIntegerGetter(item); + //Console.WriteLine("stringvalues null: " + column.PropertyName); } + column.StringValues[index] = stringVal; + } + else + { + //Console.WriteLine("shouldn't be here"); + Array.Copy(column.StringValues, index, column.StringValues, index + 1, size - index); + column.StringValues[index] = stringVal; + } + + if (column.IsIDColumn) + { if (index == size) { - column.IntValues[index] = intVal != null ? intVal.Value : int.MinValue; - column.NullValues[index] = intVal == null; + if (column.IDValues == null) + { + //Console.WriteLine("stringvalues null: " + column.PropertyName); + } + column.IDValues[index] = idVal; } else { //Console.WriteLine("shouldn't be here"); - Array.Copy(column.IntValues, index, column.IntValues, index + 1, size - index); - Array.Copy(column.NullValues, index, column.NullValues, index + 1, size - index); - column.IntValues[index] = intVal != null ? intVal.Value : int.MinValue; - column.NullValues[index] = intVal == null; + Array.Copy(column.IDValues, index, column.IDValues, index + 1, size - index); + column.IDValues[index] = idVal; } - }; - break; - case JSDataSourceSchemaType.LongValue: - insert = (size, column, index, item) => + } + }; + break; + case JSDataSourceSchemaType.NullableCalendarValue: + case JSDataSourceSchemaType.NullableDateTimeValue: + insert = (size, column, index, item) => + { + string stringVal = null; + if (item != null) { - long longVal = long.MinValue; - if (item != null) + try { - if (!schema.IsPrimitive) - { - longVal = longGetter(item); - } - else - { - longVal = (long)item; - } + stringVal = stringGetter(item); } - if (index == size) - { - column.LongValues[index] = longVal; - } - else + catch { - //Console.WriteLine("shouldn't be here"); - Array.Copy(column.LongValues, index, column.LongValues, index + 1, size - index); - column.LongValues[index] = longVal; + stringVal = null; } - }; - break; - case JSDataSourceSchemaType.NullableLongValue: - insert = (size, column, index, item) => + } + if (index == size) { - long? longVal = null; - if (item != null) + if (column.StringValues == null) { - longVal = nullableLongGetter(item); + //Console.WriteLine("stringvalues null: " + column.PropertyName); } - if (index == size) - { - column.LongValues[index] = longVal != null ? longVal.Value : long.MinValue; - column.NullValues[index] = longVal == null; - } - else - { - //Console.WriteLine("shouldn't be here"); - Array.Copy(column.LongValues, index, column.LongValues, index + 1, size - index); - Array.Copy(column.NullValues, index, column.NullValues, index + 1, size - index); - column.LongValues[index] = longVal != null ? longVal.Value : long.MinValue; - column.NullValues[index] = longVal == null; - } - }; - break; - case JSDataSourceSchemaType.StringValue: - case JSDataSourceSchemaType.CalendarValue: - case JSDataSourceSchemaType.DateTimeValue: - insert = (size, column, index, item) => + column.StringValues[index] = stringVal; + } + else + { + //Console.WriteLine("shouldn't be here"); + Array.Copy(column.StringValues, index, column.StringValues, index + 1, size - index); + column.StringValues[index] = stringVal; + } + }; + break; + case JSDataSourceSchemaType.ObjectValue: + insert = (size, column, index, item) => + { + //Console.WriteLine("shouldn't be here"); + object objVal = null; + if (item != null) + { + objVal = objectGetter(item); + } + if (objVal != null && column.SubColumns == null) { - string stringVal = null; - Guid idVal = Guid.Empty; - if (item != null) + var subSchema = schema.GetSubSchema(column.PropertyName); + if (subSchema == null) { - if (column.IsIDColumn) - { - idVal = idGetter(item); - stringVal = _parentId != null ? _parentId + "/" + idVal.ToString() : idVal.ToString(); - } - else if (!schema.IsPrimitive) - { - try - { - stringVal = stringGetter(item); - } - catch - { - stringVal = null; - } - } - else - { - stringVal = item.ToString(); - } + subSchema = ExtractSchema(objVal); + schema.SetSubSchema(column.PropertyName, subSchema); + column.SubSchema = subSchema; } - if (index == size) - { - if (column.StringValues == null) - { - //Console.WriteLine("stringvalues null: " + column.PropertyName); - } - column.StringValues[index] = stringVal; - } - else + if (subSchema.IsDataSource && !column.IsSubDataSource) { - //Console.WriteLine("shouldn't be here"); - Array.Copy(column.StringValues, index, column.StringValues, index + 1, size - index); - column.StringValues[index] = stringVal; + column.IsSubDataSource = true; + var c = column.Column; + c.IsSubDataSource = column.IsSubDataSource ? 1 : 0; + column.Column = c; + column = AdjustColumnCapacity(parentPath, column, schema, column.PropertyName, valueGetter, untypedGetter, column.IsIDColumn, column.Type, Capacity, Capacity); } - - if (column.IsIDColumn) + else { - if (index == size) - { - if (column.IDValues == null) - { - //Console.WriteLine("stringvalues null: " + column.PropertyName); - } - column.IDValues[index] = idVal; - } - else - { - //Console.WriteLine("shouldn't be here"); - Array.Copy(column.IDValues, index, column.IDValues, index + 1, size - index); - column.IDValues[index] = idVal; - } + column.SubColumns = AdjustCapacity(column.PropertyPath, column.SubColumns, subSchema, Capacity, Capacity); } - }; - break; - case JSDataSourceSchemaType.NullableCalendarValue: - case JSDataSourceSchemaType.NullableDateTimeValue: - insert = (size, column, index, item) => + } + + if (column.IsSubDataSource) { - string stringVal = null; - if (item != null) + UnmarshalledColumn[] cols = null; + if (objVal != null) { - try - { - stringVal = stringGetter(item); - } - catch + var id = _idGetter(item); + var parentId = _parentId != null ? _parentId + "/" + id.ToString() : id.ToString(); + + var sub = (UnmarshalledDataSource)UnmarshalledDataSource.CreateWithSchema(objVal, parentId, column.SubSchema, _manager, _helper); + cols = sub.GetColumns(""); + + if (!_subDataSources.ContainsKey(id)) { - stringVal = null; + _subDataSources[id] = new Dictionary(); } + _subDataSources[id].Add(column.PropertyName, sub); } if (index == size) { - if (column.StringValues == null) - { - //Console.WriteLine("stringvalues null: " + column.PropertyName); - } - column.StringValues[index] = stringVal; + column.SubDataSourceValues[index] = cols; } else { //Console.WriteLine("shouldn't be here"); - Array.Copy(column.StringValues, index, column.StringValues, index + 1, size - index); - column.StringValues[index] = stringVal; + Array.Copy(column.SubDataSourceValues, index, column.SubDataSourceValues, index + 1, size - index); + column.SubDataSourceValues[index] = cols; } - }; - break; - case JSDataSourceSchemaType.ObjectValue: - insert = (size, column, index, item) => + } + else { - //Console.WriteLine("shouldn't be here"); - object objVal = null; - if (item != null) - { - objVal = objectGetter(item); - } - if (objVal != null && column.SubColumns == null) - { - var subSchema = schema.GetSubSchema(column.PropertyName); - if (subSchema == null) - { - subSchema = ExtractSchema(objVal); - schema.SetSubSchema(column.PropertyName, subSchema); - column.SubSchema = subSchema; - } - if (subSchema.IsDataSource && !column.IsSubDataSource) - { - column.IsSubDataSource = true; - var c = column.Column; - c.IsSubDataSource = column.IsSubDataSource ? 1 : 0; - column.Column = c; - column = AdjustColumnCapacity(parentPath, column, schema, column.PropertyName, valueGetter, untypedGetter, column.IsIDColumn, column.Type, Capacity, Capacity); - } - else - { - column.SubColumns = AdjustCapacity(column.PropertyPath, column.SubColumns, subSchema, Capacity, Capacity); - } - } - - if (column.IsSubDataSource) - { - UnmarshalledColumn[] cols = null; - if (objVal != null) - { - var id = _idGetter(item); - var parentId = _parentId != null ? _parentId + "/" + id.ToString() : id.ToString(); - - var sub = (UnmarshalledDataSource)UnmarshalledDataSource.CreateWithSchema(objVal, parentId, column.SubSchema, _manager, _helper); - cols = sub.GetColumns(""); - - if (!_subDataSources.ContainsKey(id)) - { - _subDataSources[id] = new Dictionary(); - } - _subDataSources[id].Add(column.PropertyName, sub); - } - if (index == size) - { - column.SubDataSourceValues[index] = cols; - } - else - { - //Console.WriteLine("shouldn't be here"); - Array.Copy(column.SubDataSourceValues, index, column.SubDataSourceValues, index + 1, size - index); - column.SubDataSourceValues[index] = cols; - } - } - else + if (column.SubColumns != null) { - if (column.SubColumns != null) + for (var i = 0; i < column.SubColumns.Length; i++) { - for (var i = 0; i < column.SubColumns.Length; i++) - { - var subColumn = column.SubColumns[i]; - subColumn.Insert(size, subColumn, index, objVal); - } + var subColumn = column.SubColumns[i]; + subColumn.Insert(size, subColumn, index, objVal); } } - }; - break; + } + }; + break; case JSDataSourceSchemaType.DoubleArrayValue: case JSDataSourceSchemaType.IntArrayValue: case JSDataSourceSchemaType.LongArrayValue: @@ -775,7 +776,6 @@ private UnmarshalledColumnData CreateColumn(string parentPath, string propertyNa if (subSchema == null) { subSchema = ExtractSchema(objVal); - schema.SetSubSchema(column.PropertyName, subSchema); column.SubSchema = subSchema; @@ -889,620 +889,620 @@ private UnmarshalledColumnData CreateColumn(string parentPath, string propertyNa } }; break; - } + } Action update = null; - switch (newColumn.Type) - { - case JSDataSourceSchemaType.DoubleValue: - case JSDataSourceSchemaType.SingleValue: - case JSDataSourceSchemaType.DecimalValue: - update = (size, column, index, oldItem, newItem) => + switch (newColumn.Type) + { + case JSDataSourceSchemaType.DoubleValue: + case JSDataSourceSchemaType.SingleValue: + case JSDataSourceSchemaType.DecimalValue: + update = (size, column, index, oldItem, newItem) => + { + double floatVal = double.NaN; + if (newItem != null) { - double floatVal = double.NaN; - if (newItem != null) - { - floatVal = floatingPointGetter(newItem); - } - column.DoubleValues[index] = floatVal; - }; - break; - case JSDataSourceSchemaType.NullableDoubleValue: - case JSDataSourceSchemaType.NullableSingleValue: - case JSDataSourceSchemaType.NullableDecimalValue: - update = (size, column, index, oldItem, newItem) => + floatVal = floatingPointGetter(newItem); + } + column.DoubleValues[index] = floatVal; + }; + break; + case JSDataSourceSchemaType.NullableDoubleValue: + case JSDataSourceSchemaType.NullableSingleValue: + case JSDataSourceSchemaType.NullableDecimalValue: + update = (size, column, index, oldItem, newItem) => + { + double? floatVal = null; + if (newItem != null) { - double? floatVal = null; - if (newItem != null) - { - floatVal = nullableFloatingPointGetter(newItem); - } - column.DoubleValues[index] = floatVal != null ? floatVal.Value : double.NaN; - column.NullValues[index] = floatVal == null; - }; - break; - case JSDataSourceSchemaType.BooleanValue: - case JSDataSourceSchemaType.ByteValue: - case JSDataSourceSchemaType.IntValue: - case JSDataSourceSchemaType.ShortValue: - update = (size, column, index, oldItem, newItem) => + floatVal = nullableFloatingPointGetter(newItem); + } + column.DoubleValues[index] = floatVal != null ? floatVal.Value : double.NaN; + column.NullValues[index] = floatVal == null; + }; + break; + case JSDataSourceSchemaType.BooleanValue: + case JSDataSourceSchemaType.ByteValue: + case JSDataSourceSchemaType.IntValue: + case JSDataSourceSchemaType.ShortValue: + update = (size, column, index, oldItem, newItem) => + { + int intVal = int.MinValue; + if (newItem != null) { - int intVal = int.MinValue; - if (newItem != null) - { - intVal = integerGetter(newItem); - } - column.IntValues[index] = intVal; - }; - break; - case JSDataSourceSchemaType.NullableBooleanValue: - case JSDataSourceSchemaType.NullableByteValue: - case JSDataSourceSchemaType.NullableIntValue: - case JSDataSourceSchemaType.NullableShortValue: - update = (size, column, index, oldItem, newItem) => + intVal = integerGetter(newItem); + } + column.IntValues[index] = intVal; + }; + break; + case JSDataSourceSchemaType.NullableBooleanValue: + case JSDataSourceSchemaType.NullableByteValue: + case JSDataSourceSchemaType.NullableIntValue: + case JSDataSourceSchemaType.NullableShortValue: + update = (size, column, index, oldItem, newItem) => + { + int? intVal = null; + if (newItem != null) { - int? intVal = null; - if (newItem != null) - { - intVal = nullableIntegerGetter(newItem); - } - column.IntValues[index] = intVal != null ? intVal.Value : int.MinValue; - column.NullValues[index] = intVal == null; - }; - break; - case JSDataSourceSchemaType.LongValue: - update = (size, column, index, oldItem, newItem) => + intVal = nullableIntegerGetter(newItem); + } + column.IntValues[index] = intVal != null ? intVal.Value : int.MinValue; + column.NullValues[index] = intVal == null; + }; + break; + case JSDataSourceSchemaType.LongValue: + update = (size, column, index, oldItem, newItem) => + { + long longVal = long.MinValue; + if (newItem != null) { - long longVal = long.MinValue; - if (newItem != null) - { - longVal = longGetter(newItem); - } - column.LongValues[index] = longVal; - }; - break; - case JSDataSourceSchemaType.NullableLongValue: - update = (size, column, index, oldItem, newItem) => + longVal = longGetter(newItem); + } + column.LongValues[index] = longVal; + }; + break; + case JSDataSourceSchemaType.NullableLongValue: + update = (size, column, index, oldItem, newItem) => + { + long? longVal = null; + if (newItem != null) { - long? longVal = null; - if (newItem != null) - { - longVal = nullableLongGetter(newItem); - } - column.LongValues[index] = longVal != null ? longVal.Value : long.MinValue; - column.NullValues[index] = longVal == null; - }; - break; - case JSDataSourceSchemaType.StringValue: - case JSDataSourceSchemaType.CalendarValue: - case JSDataSourceSchemaType.DateTimeValue: - update = (size, column, index, oldItem, newItem) => + longVal = nullableLongGetter(newItem); + } + column.LongValues[index] = longVal != null ? longVal.Value : long.MinValue; + column.NullValues[index] = longVal == null; + }; + break; + case JSDataSourceSchemaType.StringValue: + case JSDataSourceSchemaType.CalendarValue: + case JSDataSourceSchemaType.DateTimeValue: + update = (size, column, index, oldItem, newItem) => + { + string stringVal = null; + Guid idVal = Guid.Empty; + if (column.IsIDColumn && oldItem != newItem) + { + var oldId = column.IDValues[index]; + OnRemoveId(oldId); + } + if (newItem != null) { - string stringVal = null; - Guid idVal = Guid.Empty; - if (column.IsIDColumn && oldItem != newItem) - { - var oldId = column.IDValues[index]; - OnRemoveId(oldId); - } - if (newItem != null) - { - if (column.IsIDColumn) - { - idVal = idGetter(newItem); - stringVal = idVal.ToString(); - } - else - { - stringVal = stringGetter(newItem); - } - } - - column.StringValues[index] = stringVal; if (column.IsIDColumn) { - column.IDValues[index] = idVal; + idVal = idGetter(newItem); + stringVal = idVal.ToString(); } - }; - break; - case JSDataSourceSchemaType.NullableCalendarValue: - case JSDataSourceSchemaType.NullableDateTimeValue: - update = (size, column, index, oldItem, newItem) => - { - string stringVal = null; - if (newItem != null) + else { stringVal = stringGetter(newItem); } - column.StringValues[index] = stringVal; - }; - break; - case JSDataSourceSchemaType.ObjectValue: - update = (size, column, index, oldItem, newItem) => + } + + column.StringValues[index] = stringVal; + if (column.IsIDColumn) { - object objVal = null; - if (newItem != null) - { - objVal = objectGetter(newItem); - } + column.IDValues[index] = idVal; + } + }; + break; + case JSDataSourceSchemaType.NullableCalendarValue: + case JSDataSourceSchemaType.NullableDateTimeValue: + update = (size, column, index, oldItem, newItem) => + { + string stringVal = null; + if (newItem != null) + { + stringVal = stringGetter(newItem); + } + column.StringValues[index] = stringVal; + }; + break; + case JSDataSourceSchemaType.ObjectValue: + update = (size, column, index, oldItem, newItem) => + { + object objVal = null; + if (newItem != null) + { + objVal = objectGetter(newItem); + } - object oldObjVal = null; - if (oldItem != null) + object oldObjVal = null; + if (oldItem != null) + { + oldObjVal = objectGetter(oldItem); + } + + if (objVal != null && column.SubColumns == null) + { + var subSchema = schema.GetSubSchema(column.PropertyName); + if (subSchema == null) { - oldObjVal = objectGetter(oldItem); + subSchema = ExtractSchema(objVal); + schema.SetSubSchema(column.PropertyName, subSchema); + column.SubSchema = subSchema; } - - if (objVal != null && column.SubColumns == null) + if (subSchema.IsDataSource && !column.IsSubDataSource) { - var subSchema = schema.GetSubSchema(column.PropertyName); - if (subSchema == null) - { - subSchema = ExtractSchema(objVal); - schema.SetSubSchema(column.PropertyName, subSchema); - column.SubSchema = subSchema; - } - if (subSchema.IsDataSource && !column.IsSubDataSource) - { - column.IsSubDataSource = true; - var c = column.Column; - c.IsSubDataSource = column.IsSubDataSource ? 1 : 0; - column.Column = c; - column = AdjustColumnCapacity(parentPath, column, schema, column.PropertyName, valueGetter, untypedGetter, false, column.Type, Capacity, Capacity); - } - - column.SubColumns = AdjustCapacity(column.PropertyPath, column.SubColumns, subSchema, Capacity, Capacity); + column.IsSubDataSource = true; + var c = column.Column; + c.IsSubDataSource = column.IsSubDataSource ? 1 : 0; + column.Column = c; + column = AdjustColumnCapacity(parentPath, column, schema, column.PropertyName, valueGetter, untypedGetter, false, column.Type, Capacity, Capacity); } - if (column.IsSubDataSource) + column.SubColumns = AdjustCapacity(column.PropertyPath, column.SubColumns, subSchema, Capacity, Capacity); + } + + if (column.IsSubDataSource) + { + UnmarshalledColumn[] cols = null; + if (objVal != null) { - UnmarshalledColumn[] cols = null; - if (objVal != null) - { - var sub = (UnmarshalledDataSource)UnmarshalledDataSource.CreateWithSchema(objVal, column.SubSchema, _manager, _helper); - cols = sub.GetColumns(""); - } - column.SubDataSourceValues[index] = cols; + var sub = (UnmarshalledDataSource)UnmarshalledDataSource.CreateWithSchema(objVal, column.SubSchema, _manager, _helper); + cols = sub.GetColumns(""); } - else + column.SubDataSourceValues[index] = cols; + } + else + { + if (column.SubColumns != null) { - if (column.SubColumns != null) + for (var i = 0; i < column.SubColumns.Length; i++) { - for (var i = 0; i < column.SubColumns.Length; i++) - { - var subColumn = column.SubColumns[i]; - subColumn.Update(size, subColumn, index, oldObjVal, objVal); - } + var subColumn = column.SubColumns[i]; + subColumn.Update(size, subColumn, index, oldObjVal, objVal); } } - }; - break; - case JSDataSourceSchemaType.DoubleArrayValue: - case JSDataSourceSchemaType.IntArrayValue: - case JSDataSourceSchemaType.LongArrayValue: - case JSDataSourceSchemaType.StringArrayValue: - case JSDataSourceSchemaType.CalendarArrayValue: - case JSDataSourceSchemaType.DateTimeArrayValue: - case JSDataSourceSchemaType.BooleanArrayValue: - case JSDataSourceSchemaType.DecimalArrayValue: - case JSDataSourceSchemaType.ByteArrayValue: - case JSDataSourceSchemaType.ShortArrayValue: - case JSDataSourceSchemaType.SingleArrayValue: - update = (size, column, index, oldItem, newItem) => - { - object objVal = null; - if (newItem != null) - { - objVal = objectGetter(newItem); - } + } + }; + break; + case JSDataSourceSchemaType.DoubleArrayValue: + case JSDataSourceSchemaType.IntArrayValue: + case JSDataSourceSchemaType.LongArrayValue: + case JSDataSourceSchemaType.StringArrayValue: + case JSDataSourceSchemaType.CalendarArrayValue: + case JSDataSourceSchemaType.DateTimeArrayValue: + case JSDataSourceSchemaType.BooleanArrayValue: + case JSDataSourceSchemaType.DecimalArrayValue: + case JSDataSourceSchemaType.ByteArrayValue: + case JSDataSourceSchemaType.ShortArrayValue: + case JSDataSourceSchemaType.SingleArrayValue: + update = (size, column, index, oldItem, newItem) => + { + object objVal = null; + if (newItem != null) + { + objVal = objectGetter(newItem); + } - object oldObjVal = null; - if (oldItem != null) - { - oldObjVal = objectGetter(oldItem); - } + object oldObjVal = null; + if (oldItem != null) + { + oldObjVal = objectGetter(oldItem); + } - if (column.IsSubDataSource) + if (column.IsSubDataSource) + { + UnmarshalledColumn[] cols = null; + if (objVal != null) { - UnmarshalledColumn[] cols = null; - if (objVal != null) + var sub = (UnmarshalledDataSource)UnmarshalledDataSource.CreateWithSchema(objVal, column.SubSchema, _manager, _helper); + var subcols = sub.GetColumns(""); + + UnmarshalledColumn primcol = new UnmarshalledColumn(); + primcol.ActualCount = subcols[0].ActualCount; + primcol.DataSourceID = subcols[0].DataSourceID; + primcol.PropertyPath = "___primitiveVal"; + primcol.Type = GetArrayType(newColumn.Type); + int i = 0; + switch (newColumn.Type) { - var sub = (UnmarshalledDataSource)UnmarshalledDataSource.CreateWithSchema(objVal, column.SubSchema, _manager, _helper); - var subcols = sub.GetColumns(""); - - UnmarshalledColumn primcol = new UnmarshalledColumn(); - primcol.ActualCount = subcols[0].ActualCount; - primcol.DataSourceID = subcols[0].DataSourceID; - primcol.PropertyPath = "___primitiveVal"; - primcol.Type = GetArrayType(newColumn.Type); - int i = 0; - switch (newColumn.Type) - { - case JSDataSourceSchemaType.StringArrayValue: - primcol.StringValues = new string[primcol.ActualCount]; - foreach (var v in (objVal as IEnumerable)) - { - primcol.StringValues[i] = (string)v; - i++; - } - break; - case JSDataSourceSchemaType.DateTimeArrayValue: - case JSDataSourceSchemaType.CalendarArrayValue: - primcol.StringValues = new string[primcol.ActualCount]; - foreach (var v in (objVal as IEnumerable)) - { - primcol.StringValues[i] = ((DateTime)v).ToString("o"); - i++; - } - break; - case JSDataSourceSchemaType.BooleanArrayValue: - case JSDataSourceSchemaType.ByteArrayValue: - case JSDataSourceSchemaType.IntArrayValue: - case JSDataSourceSchemaType.ShortArrayValue: - primcol.IntValues = new int[primcol.ActualCount]; - foreach (var v in (objVal as IEnumerable)) - { - primcol.IntValues[i] = Convert.ToInt32(v); - i++; - } - break; - case JSDataSourceSchemaType.DoubleArrayValue: - case JSDataSourceSchemaType.SingleArrayValue: - case JSDataSourceSchemaType.DecimalArrayValue: - primcol.DoubleValues = new double[primcol.ActualCount]; - foreach (var v in (objVal as IEnumerable)) - { - primcol.DoubleValues[i] = Convert.ToDouble(v); - i++; - } - break; - case JSDataSourceSchemaType.LongArrayValue: - primcol.LongValues = new long[primcol.ActualCount]; - foreach (var v in (objVal as IEnumerable)) - { - primcol.LongValues[i] = Convert.ToInt64(v); - i++; - } - break; - } - - cols = new UnmarshalledColumn[subcols.Length + 1]; - for (i = 0; i < subcols.Length; i++) - { - cols[i] = subcols[i]; - } - cols[subcols.Length] = primcol; + case JSDataSourceSchemaType.StringArrayValue: + primcol.StringValues = new string[primcol.ActualCount]; + foreach (var v in (objVal as IEnumerable)) + { + primcol.StringValues[i] = (string)v; + i++; + } + break; + case JSDataSourceSchemaType.DateTimeArrayValue: + case JSDataSourceSchemaType.CalendarArrayValue: + primcol.StringValues = new string[primcol.ActualCount]; + foreach (var v in (objVal as IEnumerable)) + { + primcol.StringValues[i] = ((DateTime)v).ToString("o"); + i++; + } + break; + case JSDataSourceSchemaType.BooleanArrayValue: + case JSDataSourceSchemaType.ByteArrayValue: + case JSDataSourceSchemaType.IntArrayValue: + case JSDataSourceSchemaType.ShortArrayValue: + primcol.IntValues = new int[primcol.ActualCount]; + foreach (var v in (objVal as IEnumerable)) + { + primcol.IntValues[i] = Convert.ToInt32(v); + i++; + } + break; + case JSDataSourceSchemaType.DoubleArrayValue: + case JSDataSourceSchemaType.SingleArrayValue: + case JSDataSourceSchemaType.DecimalArrayValue: + primcol.DoubleValues = new double[primcol.ActualCount]; + foreach (var v in (objVal as IEnumerable)) + { + primcol.DoubleValues[i] = Convert.ToDouble(v); + i++; + } + break; + case JSDataSourceSchemaType.LongArrayValue: + primcol.LongValues = new long[primcol.ActualCount]; + foreach (var v in (objVal as IEnumerable)) + { + primcol.LongValues[i] = Convert.ToInt64(v); + i++; + } + break; } - column.SubDataSourceValues[index] = cols; + cols = new UnmarshalledColumn[subcols.Length + 1]; + for (i = 0; i < subcols.Length; i++) + { + cols[i] = subcols[i]; + } + cols[subcols.Length] = primcol; } - else + + column.SubDataSourceValues[index] = cols; + } + else + { + if (column.SubColumns != null) { - if (column.SubColumns != null) + for (var i = 0; i < column.SubColumns.Length; i++) { - for (var i = 0; i < column.SubColumns.Length; i++) - { - var subColumn = column.SubColumns[i]; - subColumn.Update(size, subColumn, index, oldItem, newItem); - } + var subColumn = column.SubColumns[i]; + subColumn.Update(size, subColumn, index, oldItem, newItem); } } - }; - break; + } + }; + break; } Action remove = null; - switch (newColumn.Type) - { - case JSDataSourceSchemaType.DoubleValue: - case JSDataSourceSchemaType.SingleValue: - case JSDataSourceSchemaType.DecimalValue: - remove = (size, column, index) => + switch (newColumn.Type) + { + case JSDataSourceSchemaType.DoubleValue: + case JSDataSourceSchemaType.SingleValue: + case JSDataSourceSchemaType.DecimalValue: + remove = (size, column, index) => + { + if (index == (size - 1)) { - if (index == (size - 1)) - { - column.DoubleValues[index] = double.NaN; - } - else - { - Array.Copy(column.DoubleValues, index + 1, column.DoubleValues, index, (size - 1) - index); - column.DoubleValues[size - 1] = double.NaN; - } - }; - break; - case JSDataSourceSchemaType.NullableDoubleValue: - case JSDataSourceSchemaType.NullableSingleValue: - case JSDataSourceSchemaType.NullableDecimalValue: - remove = (size, column, index) => + column.DoubleValues[index] = double.NaN; + } + else { - if (index == (size - 1)) - { - column.DoubleValues[index] = double.NaN; - column.NullValues[index] = false; - } - else - { - Array.Copy(column.DoubleValues, index + 1, column.DoubleValues, index, (size - 1) - index); - Array.Copy(column.NullValues, index + 1, column.NullValues, index, (size - 1) - index); - column.DoubleValues[size - 1] = double.NaN; - column.NullValues[size - 1] = false; - } - }; - break; - case JSDataSourceSchemaType.BooleanValue: - case JSDataSourceSchemaType.ByteValue: - case JSDataSourceSchemaType.IntValue: - case JSDataSourceSchemaType.ShortValue: - remove = (size, column, index) => + Array.Copy(column.DoubleValues, index + 1, column.DoubleValues, index, (size - 1) - index); + column.DoubleValues[size - 1] = double.NaN; + } + }; + break; + case JSDataSourceSchemaType.NullableDoubleValue: + case JSDataSourceSchemaType.NullableSingleValue: + case JSDataSourceSchemaType.NullableDecimalValue: + remove = (size, column, index) => + { + if (index == (size - 1)) { - if (index == (size - 1)) - { - column.IntValues[index] = 0; - } - else - { - Array.Copy(column.IntValues, index + 1, column.IntValues, index, (size - 1) - index); - column.IntValues[size - 1] = 0; - } - }; - break; - case JSDataSourceSchemaType.NullableBooleanValue: - case JSDataSourceSchemaType.NullableByteValue: - case JSDataSourceSchemaType.NullableIntValue: - case JSDataSourceSchemaType.NullableShortValue: - remove = (size, column, index) => + column.DoubleValues[index] = double.NaN; + column.NullValues[index] = false; + } + else { - if (index == (size - 1)) - { - column.IntValues[index] = 0; - column.NullValues[index] = false; - } - else - { - Array.Copy(column.IntValues, index + 1, column.IntValues, index, (size - 1) - index); - Array.Copy(column.NullValues, index + 1, column.NullValues, index, (size - 1) - index); - column.IntValues[size - 1] = 0; - column.NullValues[size - 1] = false; - } - }; - break; - case JSDataSourceSchemaType.LongValue: - remove = (size, column, index) => + Array.Copy(column.DoubleValues, index + 1, column.DoubleValues, index, (size - 1) - index); + Array.Copy(column.NullValues, index + 1, column.NullValues, index, (size - 1) - index); + column.DoubleValues[size - 1] = double.NaN; + column.NullValues[size - 1] = false; + } + }; + break; + case JSDataSourceSchemaType.BooleanValue: + case JSDataSourceSchemaType.ByteValue: + case JSDataSourceSchemaType.IntValue: + case JSDataSourceSchemaType.ShortValue: + remove = (size, column, index) => + { + if (index == (size - 1)) { - if (index == (size - 1)) - { - column.LongValues[index] = 0; - } - else - { - Array.Copy(column.LongValues, index + 1, column.LongValues, index, (size - 1) - index); - column.LongValues[size - 1] = 0; - } - }; - break; - case JSDataSourceSchemaType.NullableLongValue: - remove = (size, column, index) => + column.IntValues[index] = 0; + } + else + { + Array.Copy(column.IntValues, index + 1, column.IntValues, index, (size - 1) - index); + column.IntValues[size - 1] = 0; + } + }; + break; + case JSDataSourceSchemaType.NullableBooleanValue: + case JSDataSourceSchemaType.NullableByteValue: + case JSDataSourceSchemaType.NullableIntValue: + case JSDataSourceSchemaType.NullableShortValue: + remove = (size, column, index) => + { + if (index == (size - 1)) + { + column.IntValues[index] = 0; + column.NullValues[index] = false; + } + else + { + Array.Copy(column.IntValues, index + 1, column.IntValues, index, (size - 1) - index); + Array.Copy(column.NullValues, index + 1, column.NullValues, index, (size - 1) - index); + column.IntValues[size - 1] = 0; + column.NullValues[size - 1] = false; + } + }; + break; + case JSDataSourceSchemaType.LongValue: + remove = (size, column, index) => + { + if (index == (size - 1)) + { + column.LongValues[index] = 0; + } + else + { + Array.Copy(column.LongValues, index + 1, column.LongValues, index, (size - 1) - index); + column.LongValues[size - 1] = 0; + } + }; + break; + case JSDataSourceSchemaType.NullableLongValue: + remove = (size, column, index) => + { + if (index == (size - 1)) + { + column.LongValues[index] = 0; + column.NullValues[index] = false; + } + else + { + Array.Copy(column.LongValues, index + 1, column.LongValues, index, (size - 1) - index); + Array.Copy(column.NullValues, index + 1, column.NullValues, index, (size - 1) - index); + column.LongValues[size - 1] = 0; + column.NullValues[size - 1] = false; + } + }; + break; + case JSDataSourceSchemaType.StringValue: + case JSDataSourceSchemaType.CalendarValue: + case JSDataSourceSchemaType.DateTimeValue: + remove = (size, column, index) => + { + if (column.IsIDColumn) + { + var oldId = column.IDValues[index]; + OnRemoveId(oldId); + } + + if (index == (size - 1)) + { + column.StringValues[index] = null; + } + else + { + Array.Copy(column.StringValues, index + 1, column.StringValues, index, (size - 1) - index); + column.StringValues[size - 1] = null; + } + if (column.IsIDColumn) { if (index == (size - 1)) { - column.LongValues[index] = 0; - column.NullValues[index] = false; + column.IDValues[index] = Guid.Empty; } else { - Array.Copy(column.LongValues, index + 1, column.LongValues, index, (size - 1) - index); - Array.Copy(column.NullValues, index + 1, column.NullValues, index, (size - 1) - index); - column.LongValues[size - 1] = 0; - column.NullValues[size - 1] = false; + Array.Copy(column.IDValues, index + 1, column.IDValues, index, (size - 1) - index); + column.IDValues[size - 1] = Guid.Empty; } - }; - break; - case JSDataSourceSchemaType.StringValue: - case JSDataSourceSchemaType.CalendarValue: - case JSDataSourceSchemaType.DateTimeValue: - remove = (size, column, index) => + } + }; + break; + case JSDataSourceSchemaType.NullableCalendarValue: + case JSDataSourceSchemaType.NullableDateTimeValue: + remove = (size, column, index) => + { + if (index == (size - 1)) { - if (column.IsIDColumn) - { - var oldId = column.IDValues[index]; - OnRemoveId(oldId); - } - - if (index == (size - 1)) - { - column.StringValues[index] = null; - } - else - { - Array.Copy(column.StringValues, index + 1, column.StringValues, index, (size - 1) - index); - column.StringValues[size - 1] = null; - } - if (column.IsIDColumn) - { - if (index == (size - 1)) - { - column.IDValues[index] = Guid.Empty; - } - else - { - Array.Copy(column.IDValues, index + 1, column.IDValues, index, (size - 1) - index); - column.IDValues[size - 1] = Guid.Empty; - } - } - }; - break; - case JSDataSourceSchemaType.NullableCalendarValue: - case JSDataSourceSchemaType.NullableDateTimeValue: - remove = (size, column, index) => + column.StringValues[index] = null; + } + else + { + Array.Copy(column.StringValues, index + 1, column.StringValues, index, (size - 1) - index); + column.StringValues[size - 1] = null; + } + }; + break; + case JSDataSourceSchemaType.ObjectValue: + case JSDataSourceSchemaType.DoubleArrayValue: + case JSDataSourceSchemaType.IntArrayValue: + case JSDataSourceSchemaType.LongArrayValue: + case JSDataSourceSchemaType.StringArrayValue: + case JSDataSourceSchemaType.CalendarArrayValue: + case JSDataSourceSchemaType.DateTimeArrayValue: + case JSDataSourceSchemaType.BooleanArrayValue: + case JSDataSourceSchemaType.DecimalArrayValue: + case JSDataSourceSchemaType.ByteArrayValue: + case JSDataSourceSchemaType.ShortArrayValue: + case JSDataSourceSchemaType.SingleArrayValue: + remove = (size, column, index) => + { + if (column.IsSubDataSource) { if (index == (size - 1)) { - column.StringValues[index] = null; + column.SubDataSourceValues[index] = null; } else { - Array.Copy(column.StringValues, index + 1, column.StringValues, index, (size - 1) - index); - column.StringValues[size - 1] = null; - } - }; - break; - case JSDataSourceSchemaType.ObjectValue: - case JSDataSourceSchemaType.DoubleArrayValue: - case JSDataSourceSchemaType.IntArrayValue: - case JSDataSourceSchemaType.LongArrayValue: - case JSDataSourceSchemaType.StringArrayValue: - case JSDataSourceSchemaType.CalendarArrayValue: - case JSDataSourceSchemaType.DateTimeArrayValue: - case JSDataSourceSchemaType.BooleanArrayValue: - case JSDataSourceSchemaType.DecimalArrayValue: - case JSDataSourceSchemaType.ByteArrayValue: - case JSDataSourceSchemaType.ShortArrayValue: - case JSDataSourceSchemaType.SingleArrayValue: - remove = (size, column, index) => - { - if (column.IsSubDataSource) - { - if (index == (size - 1)) - { - column.SubDataSourceValues[index] = null; - } - else - { - Array.Copy(column.SubDataSourceValues, index + 1, column.SubDataSourceValues, index, (size - 1) - index); - column.SubDataSourceValues[size - 1] = null; - } + Array.Copy(column.SubDataSourceValues, index + 1, column.SubDataSourceValues, index, (size - 1) - index); + column.SubDataSourceValues[size - 1] = null; } - else + } + else + { + if (column.SubColumns != null) { - if (column.SubColumns != null) + for (var i = 0; i < column.SubColumns.Length; i++) { - for (var i = 0; i < column.SubColumns.Length; i++) - { - var subColumn = column.SubColumns[i]; - subColumn.Remove(size, subColumn, index); - } + var subColumn = column.SubColumns[i]; + subColumn.Remove(size, subColumn, index); } } - }; - break; - } + } + }; + break; + } - Action clear = null; - switch (newColumn.Type) - { - case JSDataSourceSchemaType.DoubleValue: - case JSDataSourceSchemaType.SingleValue: - case JSDataSourceSchemaType.DecimalValue: - clear = (size, column) => - { - Array.Clear(column.DoubleValues, 0, size); - }; - break; - case JSDataSourceSchemaType.NullableDoubleValue: - case JSDataSourceSchemaType.NullableSingleValue: - case JSDataSourceSchemaType.NullableDecimalValue: - clear = (size, column) => - { - Array.Clear(column.DoubleValues, 0, size); - Array.Clear(column.NullValues, 0, size); - }; - break; - case JSDataSourceSchemaType.BooleanValue: - case JSDataSourceSchemaType.ByteValue: - case JSDataSourceSchemaType.IntValue: - case JSDataSourceSchemaType.ShortValue: - clear = (size, column) => - { - Array.Clear(column.IntValues, 0, size); - }; - break; - case JSDataSourceSchemaType.NullableBooleanValue: - case JSDataSourceSchemaType.NullableByteValue: - case JSDataSourceSchemaType.NullableIntValue: - case JSDataSourceSchemaType.NullableShortValue: - clear = (size, column) => - { - Array.Clear(column.IntValues, 0, size); - Array.Clear(column.NullValues, 0, size); - }; - break; - case JSDataSourceSchemaType.LongValue: - clear = (size, column) => - { - Array.Clear(column.LongValues, 0, size); - }; - break; - case JSDataSourceSchemaType.NullableLongValue: - clear = (size, column) => - { - Array.Clear(column.LongValues, 0, size); - Array.Clear(column.NullValues, 0, size); - }; - break; - case JSDataSourceSchemaType.StringValue: - case JSDataSourceSchemaType.CalendarValue: - case JSDataSourceSchemaType.DateTimeValue: - clear = (size, column) => + Action clear = null; + switch (newColumn.Type) + { + case JSDataSourceSchemaType.DoubleValue: + case JSDataSourceSchemaType.SingleValue: + case JSDataSourceSchemaType.DecimalValue: + clear = (size, column) => + { + Array.Clear(column.DoubleValues, 0, size); + }; + break; + case JSDataSourceSchemaType.NullableDoubleValue: + case JSDataSourceSchemaType.NullableSingleValue: + case JSDataSourceSchemaType.NullableDecimalValue: + clear = (size, column) => + { + Array.Clear(column.DoubleValues, 0, size); + Array.Clear(column.NullValues, 0, size); + }; + break; + case JSDataSourceSchemaType.BooleanValue: + case JSDataSourceSchemaType.ByteValue: + case JSDataSourceSchemaType.IntValue: + case JSDataSourceSchemaType.ShortValue: + clear = (size, column) => + { + Array.Clear(column.IntValues, 0, size); + }; + break; + case JSDataSourceSchemaType.NullableBooleanValue: + case JSDataSourceSchemaType.NullableByteValue: + case JSDataSourceSchemaType.NullableIntValue: + case JSDataSourceSchemaType.NullableShortValue: + clear = (size, column) => + { + Array.Clear(column.IntValues, 0, size); + Array.Clear(column.NullValues, 0, size); + }; + break; + case JSDataSourceSchemaType.LongValue: + clear = (size, column) => + { + Array.Clear(column.LongValues, 0, size); + }; + break; + case JSDataSourceSchemaType.NullableLongValue: + clear = (size, column) => + { + Array.Clear(column.LongValues, 0, size); + Array.Clear(column.NullValues, 0, size); + }; + break; + case JSDataSourceSchemaType.StringValue: + case JSDataSourceSchemaType.CalendarValue: + case JSDataSourceSchemaType.DateTimeValue: + clear = (size, column) => + { + if (column.IsIDColumn) { - if (column.IsIDColumn) + for (var i = 0; i < size; i++) { - for (var i = 0; i < size; i++) - { - OnRemoveId(column.IDValues[i]); - } + OnRemoveId(column.IDValues[i]); } + } - Array.Clear(column.StringValues, 0, size); - if (column.IsIDColumn) - { - Array.Clear(column.IDValues, 0, size); - } - }; - break; - case JSDataSourceSchemaType.NullableCalendarValue: - case JSDataSourceSchemaType.NullableDateTimeValue: - clear = (size, column) => + Array.Clear(column.StringValues, 0, size); + if (column.IsIDColumn) { - Array.Clear(column.StringValues, 0, size); - }; - break; - case JSDataSourceSchemaType.ObjectValue: - case JSDataSourceSchemaType.DoubleArrayValue: - case JSDataSourceSchemaType.IntArrayValue: - case JSDataSourceSchemaType.LongArrayValue: - case JSDataSourceSchemaType.StringArrayValue: - case JSDataSourceSchemaType.CalendarArrayValue: - case JSDataSourceSchemaType.DateTimeArrayValue: - case JSDataSourceSchemaType.BooleanArrayValue: - case JSDataSourceSchemaType.DecimalArrayValue: - case JSDataSourceSchemaType.ByteArrayValue: - case JSDataSourceSchemaType.ShortArrayValue: - case JSDataSourceSchemaType.SingleArrayValue: - clear = (size, column) => - { - if (column.IsSubDataSource) - { - Array.Clear(column.SubDataSourceValues, 0, size); - } - else + Array.Clear(column.IDValues, 0, size); + } + }; + break; + case JSDataSourceSchemaType.NullableCalendarValue: + case JSDataSourceSchemaType.NullableDateTimeValue: + clear = (size, column) => + { + Array.Clear(column.StringValues, 0, size); + }; + break; + case JSDataSourceSchemaType.ObjectValue: + case JSDataSourceSchemaType.DoubleArrayValue: + case JSDataSourceSchemaType.IntArrayValue: + case JSDataSourceSchemaType.LongArrayValue: + case JSDataSourceSchemaType.StringArrayValue: + case JSDataSourceSchemaType.CalendarArrayValue: + case JSDataSourceSchemaType.DateTimeArrayValue: + case JSDataSourceSchemaType.BooleanArrayValue: + case JSDataSourceSchemaType.DecimalArrayValue: + case JSDataSourceSchemaType.ByteArrayValue: + case JSDataSourceSchemaType.ShortArrayValue: + case JSDataSourceSchemaType.SingleArrayValue: + clear = (size, column) => + { + if (column.IsSubDataSource) + { + Array.Clear(column.SubDataSourceValues, 0, size); + } + else + { + if (column.SubColumns != null) { - if (column.SubColumns != null) + for (var i = 0; i < column.SubColumns.Length; i++) { - for (var i = 0; i < column.SubColumns.Length; i++) - { - var subColumn = column.SubColumns[i]; - subColumn.Clear(size, subColumn); - } + var subColumn = column.SubColumns[i]; + subColumn.Clear(size, subColumn); } } - }; - break; - } + } + }; + break; + } newColumn.Insert = insert; newColumn.Update = update; newColumn.Remove = remove; newColumn.Clear = clear; - + return newColumn; } @@ -1562,7 +1562,7 @@ private void GetColumns(string refName, UnmarshalledColumnData[] columns, List 0) { if (_columns != null) @@ -2503,45 +2542,53 @@ public void NotifyClearItems(Object data) { _size = 0; _schema = null; _columns = null; - if (data.GetType().IsArray) { + if (data.GetType().IsArray) + { object[] dataArr = (object[])data; - for (int i = 0; i < dataArr.Length; i++) { + for (int i = 0; i < dataArr.Length; i++) + { Add(dataArr[i]); } - } else if (data is IList) { + } + else if (data is IList) + { IList dataList = (IList)data; - for (int i = 0; i < dataList.Count; i++) { + for (int i = 0; i < dataList.Count; i++) + { Add(dataList[i]); } - } else if (data is IEnumerable) { + } + else if (data is IEnumerable) + { IEnumerable dataIter = (IEnumerable)data; - foreach (object item in dataIter) { + foreach (object item in dataIter) + { Add(item); } } } - public IJSDataSourceItem NotifySetItem(Object data, int index, Object oldItem, Object newItem) + public IJSDataSourceItem NotifySetItem(Object data, int index, Object oldItem, Object newItem) { EnsureSchema(newItem); if (_schema == null) { return null; } - + UpdateItemAt(oldItem, newItem, index, _schema, _columns); return null; } - - public IJSDataSourceItem NotifyUpdateItem(object data, int index, object item) + + public IJSDataSourceItem NotifyUpdateItem(object data, int index, object item) { EnsureSchema(item); if (_schema == null) { return null; } - + UpdateItemAt(item, item, index, _schema, _columns); return null; @@ -2571,4 +2618,4 @@ public void InsertItemWithId(string id, int index, Object item) } } -} \ No newline at end of file +} diff --git a/src/componentsBase/UnmarshalledDataSourceItem.cs b/src/componentsBase/UnmarshalledDataSourceItem.cs index f1c48a57..881eb676 100644 --- a/src/componentsBase/UnmarshalledDataSourceItem.cs +++ b/src/componentsBase/UnmarshalledDataSourceItem.cs @@ -11,7 +11,7 @@ // { // private Guid _id; // private bool _isNull = false; - + // public bool IsNull // { // get @@ -61,4 +61,4 @@ // } // } -// } \ No newline at end of file +// } diff --git a/src/componentsBase/Utils.cs b/src/componentsBase/Utils.cs index ed5aad69..f89241bb 100644 --- a/src/componentsBase/Utils.cs +++ b/src/componentsBase/Utils.cs @@ -1,5 +1,3 @@ -using System; - namespace IgniteUI.Blazor.Controls { internal static class Utils @@ -30,4 +28,4 @@ internal static bool TryGetWCEnumName(Type enumType, string enumMemberName, out return false; } } -} \ No newline at end of file +} diff --git a/src/componentsBase/WCAttributeNameAttribute.cs b/src/componentsBase/WCAttributeNameAttribute.cs index 12aad416..ab14f4fd 100644 --- a/src/componentsBase/WCAttributeNameAttribute.cs +++ b/src/componentsBase/WCAttributeNameAttribute.cs @@ -1,18 +1,16 @@ -using System; - namespace IgniteUI.Blazor.Controls { - public class WCAttributeNameAttribute: Attribute + public class WCAttributeNameAttribute : Attribute { public WCAttributeNameAttribute(string alternateName) { Name = alternateName; } - + public string Name { get; private set; } } -} \ No newline at end of file +} diff --git a/src/componentsBase/WCEnumName.cs b/src/componentsBase/WCEnumName.cs index fb547b4e..90faa1ab 100644 --- a/src/componentsBase/WCEnumName.cs +++ b/src/componentsBase/WCEnumName.cs @@ -1,5 +1,3 @@ -using System; - namespace IgniteUI.Blazor.Controls { public class WCEnumNameAttribute @@ -9,11 +7,11 @@ public WCEnumNameAttribute(string alternateName) { Name = alternateName; } - + public string Name { get; private set; } } -} \ No newline at end of file +} diff --git a/src/componentsBase/WCWidgetMemberNameAttribute.cs b/src/componentsBase/WCWidgetMemberNameAttribute.cs index 19d9e644..867f93e9 100644 --- a/src/componentsBase/WCWidgetMemberNameAttribute.cs +++ b/src/componentsBase/WCWidgetMemberNameAttribute.cs @@ -1,5 +1,3 @@ -using System; - namespace IgniteUI.Blazor.Controls { public class WCWidgetMemberNameAttribute @@ -9,11 +7,11 @@ public WCWidgetMemberNameAttribute(string alternateName) { Name = alternateName; } - + public string Name { get; private set; } } -} \ No newline at end of file +} diff --git a/src/componentsBase/WebInputs/Accordion.cs b/src/componentsBase/WebInputs/Accordion.cs index c985db09..a184c927 100644 --- a/src/componentsBase/WebInputs/Accordion.cs +++ b/src/componentsBase/WebInputs/Accordion.cs @@ -1,6 +1,4 @@ using Microsoft.AspNetCore.Components; -using System.Threading.Tasks; -using System; namespace IgniteUI.Blazor.Controls { @@ -42,7 +40,7 @@ partial void FindByNameAccordion(string name, ref object item) } } - public partial class IgbExpansionPanel: IDisposable + public partial class IgbExpansionPanel : IDisposable { [CascadingParameter(Name = "AccordionParent")] protected BaseRendererControl AccordionParent diff --git a/src/componentsBase/WebInputs/Chat.cs b/src/componentsBase/WebInputs/Chat.cs index b22cd98c..fa8309ee 100644 --- a/src/componentsBase/WebInputs/Chat.cs +++ b/src/componentsBase/WebInputs/Chat.cs @@ -1,5 +1,3 @@ -using System.Threading.Tasks; - namespace IgniteUI.Blazor.Controls { /// @@ -19,7 +17,6 @@ partial void OnOptionsChanging(ref IgbChatOptions? newValue) newValue.DisableInputAttachments = true; } - public IgbChatDraftMessage GetCurrentDraftMessage() { var iv = InvokeMethodSync("p:DraftMessage", new object[] { }, new string[] { }); diff --git a/src/componentsBase/WebInputs/DateTimeInput.cs b/src/componentsBase/WebInputs/DateTimeInput.cs index 8175d91d..548124aa 100644 --- a/src/componentsBase/WebInputs/DateTimeInput.cs +++ b/src/componentsBase/WebInputs/DateTimeInput.cs @@ -1,11 +1,4 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using System.Text.Json; -using System.Threading.Tasks; -using Microsoft.AspNetCore.Components; - -namespace IgniteUI.Blazor.Controls +namespace IgniteUI.Blazor.Controls { public partial class IgbDateTimeInput { diff --git a/src/componentsBase/WebInputs/Dropdown.cs b/src/componentsBase/WebInputs/Dropdown.cs index 07a60696..9aa79c1b 100644 --- a/src/componentsBase/WebInputs/Dropdown.cs +++ b/src/componentsBase/WebInputs/Dropdown.cs @@ -1,43 +1,39 @@ - -using System; -using System.Threading.Tasks; using Microsoft.AspNetCore.Components; namespace IgniteUI.Blazor.Controls { -public partial class IgbDropdown -{ - /// - /// Shows the dropdown. - /// - public async Task ShowAsync(Object target_) - { - //Console.WriteLine(ComponentToJson(target_)); - await InvokeMethod("show", new object[] { ComponentToJson(target_, 0) }, new string[] { "Component" }, - target_ is ElementReference ? new ElementReference[] { (ElementReference)target_ } : null); - } - public void Show(Object target_) - { - InvokeMethodSync("show", new object[] { ComponentToJson(target_, 0) }, new string[] { "Component" }, - target_ is ElementReference ? new ElementReference[] { (ElementReference)target_ } : null); - } - /// - /// Toggles the open state of the dropdown. - /// - public async Task ToggleAsync(Object target_) - { - await InvokeMethod("toggle", new object[] { ComponentToJson(target_, 0) }, new string[] { "Component" }, - target_ is ElementReference ? new ElementReference[] { (ElementReference)target_ } : null); - } - public void Toggle(Object target_) - { - InvokeMethodSync("show", new object[] { ComponentToJson(target_, 0) }, new string[] { "Component" }, - target_ is ElementReference ? new ElementReference[] { (ElementReference)target_ } : null); - } - + public partial class IgbDropdown + { + /// + /// Shows the dropdown. + /// + public async Task ShowAsync(Object target_) + { + //Console.WriteLine(ComponentToJson(target_)); + await InvokeMethod("show", new object[] { ComponentToJson(target_, 0) }, new string[] { "Component" }, + target_ is ElementReference ? new ElementReference[] { (ElementReference)target_ } : null); + } + public void Show(Object target_) + { + InvokeMethodSync("show", new object[] { ComponentToJson(target_, 0) }, new string[] { "Component" }, + target_ is ElementReference ? new ElementReference[] { (ElementReference)target_ } : null); + } + /// + /// Toggles the open state of the dropdown. + /// + public async Task ToggleAsync(Object target_) + { + await InvokeMethod("toggle", new object[] { ComponentToJson(target_, 0) }, new string[] { "Component" }, + target_ is ElementReference ? new ElementReference[] { (ElementReference)target_ } : null); + } + public void Toggle(Object target_) + { + InvokeMethodSync("show", new object[] { ComponentToJson(target_, 0) }, new string[] { "Component" }, + target_ is ElementReference ? new ElementReference[] { (ElementReference)target_ } : null); + } - protected override string ParentTypeName + protected override string ParentTypeName { get { @@ -45,17 +41,16 @@ protected override string ParentTypeName } } - - private IgbDropdownItemCollection _contentItems = null; - + public IgbDropdownItemCollection ContentItems { - - get + + get { - if (this._contentItems == null) { - this._contentItems = new IgbDropdownItemCollection(this, "Items"); + if (this._contentItems == null) + { + this._contentItems = new IgbDropdownItemCollection(this, "Items"); } return this._contentItems; } @@ -63,14 +58,15 @@ public IgbDropdownItemCollection ContentItems partial void FindByNameDropdown(string name, ref object item) { - foreach (var it in ContentItems) + foreach (var it in ContentItems) { - if (it.Name == name || it.ContainerId == name) { + if (it.Name == name || it.ContainerId == name) + { item = it; return; } } } -} + } -} \ No newline at end of file +} diff --git a/src/componentsBase/WebInputs/DropdownItem.cs b/src/componentsBase/WebInputs/DropdownItem.cs index 8a806e35..66ddbcf6 100644 --- a/src/componentsBase/WebInputs/DropdownItem.cs +++ b/src/componentsBase/WebInputs/DropdownItem.cs @@ -1,13 +1,10 @@ using Microsoft.AspNetCore.Components; -using Microsoft.AspNetCore.Components.Web; -using System; -using System.Threading.Tasks; namespace IgniteUI.Blazor.Controls { - public partial class IgbDropdownItem: IDisposable + public partial class IgbDropdownItem : IDisposable { - [CascadingParameter(Name="DropdownParent")] + [CascadingParameter(Name = "DropdownParent")] protected BaseRendererControl DropdownParent { get; set; @@ -31,4 +28,4 @@ protected override async Task OnInitializedAsync() } } } -} \ No newline at end of file +} diff --git a/src/componentsBase/WebInputs/Input.cs b/src/componentsBase/WebInputs/Input.cs index aa3d4a2e..8d9609a1 100644 --- a/src/componentsBase/WebInputs/Input.cs +++ b/src/componentsBase/WebInputs/Input.cs @@ -1,10 +1,5 @@ -using System; using Microsoft.AspNetCore.Components; -using Microsoft.AspNetCore.Components.Rendering; -using System.Threading.Tasks; -using System.Collections.Generic; using Microsoft.Extensions.Logging; -using System.Linq; namespace IgniteUI.Blazor.Controls { @@ -20,7 +15,8 @@ private void EnsureInputOcurredHandled() { if (EventCallback.Empty.Equals(this.InputOcurred)) { - this.InputOcurred = new EventCallback(null, (Action)((e) => { })); this._inputOcurred = null; + this.InputOcurred = new EventCallback(null, (Action)((e) => { })); + this._inputOcurred = null; } } diff --git a/src/componentsBase/WebInputs/Rating.cs b/src/componentsBase/WebInputs/Rating.cs index b1ec6e0b..c6880803 100644 --- a/src/componentsBase/WebInputs/Rating.cs +++ b/src/componentsBase/WebInputs/Rating.cs @@ -1,8 +1,3 @@ - -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; using Microsoft.AspNetCore.Components; using Microsoft.Extensions.Logging; diff --git a/src/componentsBase/WebInputs/SelectItem.cs b/src/componentsBase/WebInputs/SelectItem.cs index 90847f62..7801f422 100644 --- a/src/componentsBase/WebInputs/SelectItem.cs +++ b/src/componentsBase/WebInputs/SelectItem.cs @@ -1,5 +1,3 @@ -using System; -using System.Threading.Tasks; using Microsoft.AspNetCore.Components; namespace IgniteUI.Blazor.Controls diff --git a/src/componentsBase/WebInputs/Tab.cs b/src/componentsBase/WebInputs/Tab.cs index 0b89b49f..ddc1e993 100644 --- a/src/componentsBase/WebInputs/Tab.cs +++ b/src/componentsBase/WebInputs/Tab.cs @@ -1,7 +1,4 @@ using Microsoft.AspNetCore.Components; -using System; -using System.Collections.Generic; -using System.Text; namespace IgniteUI.Blazor.Controls { diff --git a/src/componentsBase/WebInputs/Tabs.cs b/src/componentsBase/WebInputs/Tabs.cs index 7a285e5a..b528d9e7 100644 --- a/src/componentsBase/WebInputs/Tabs.cs +++ b/src/componentsBase/WebInputs/Tabs.cs @@ -1,23 +1,21 @@ -using IgniteUI.Blazor.Controls; -using Microsoft.AspNetCore.Components; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; +using Microsoft.AspNetCore.Components; namespace IgniteUI.Blazor.Controls { public partial class IgbTabs : BaseRendererControl { - partial void OnCreatedIgbTabs() { + partial void OnCreatedIgbTabs() + { EnsureChangeHandled(); } - partial void OnHandlingChange(IgbTabComponentEventArgs args) { + partial void OnHandlingChange(IgbTabComponentEventArgs args) + { var selectedTab = args.Detail; // add check in case something triggers event without args. - if (selectedTab == null) { + if (selectedTab == null) + { return; } @@ -27,7 +25,8 @@ partial void OnHandlingChange(IgbTabComponentEventArgs args) { { item.Selected = true; } - else { + else + { item.Selected = false; } @@ -41,7 +40,7 @@ partial void OnHandlingChange(IgbTabComponentEventArgs args) { } } } - + } internal void EnsureChangeHandled() diff --git a/src/componentsBase/WebInputs/Tile.cs b/src/componentsBase/WebInputs/Tile.cs index e39839e4..cc2d70fb 100644 --- a/src/componentsBase/WebInputs/Tile.cs +++ b/src/componentsBase/WebInputs/Tile.cs @@ -1,10 +1,8 @@ -using System; -using System.Threading.Tasks; using Microsoft.AspNetCore.Components; namespace IgniteUI.Blazor.Controls { - public partial class IgbTile: IDisposable + public partial class IgbTile : IDisposable { [CascadingParameter(Name = "TileManagerParent")] protected BaseRendererControl TileManagerParent diff --git a/src/componentsBase/WebInputs/Tree.cs b/src/componentsBase/WebInputs/Tree.cs index 7cde1aae..d87e6ecb 100644 --- a/src/componentsBase/WebInputs/Tree.cs +++ b/src/componentsBase/WebInputs/Tree.cs @@ -10,17 +10,16 @@ protected override string ParentTypeName } } - - private IgbTreeItemCollection _contentItems = null; - + public IgbTreeItemCollection ContentItems { - - get + + get { - if (this._contentItems == null) { - this._contentItems = new IgbTreeItemCollection(this, "Items"); + if (this._contentItems == null) + { + this._contentItems = new IgbTreeItemCollection(this, "Items"); } return this._contentItems; } @@ -28,13 +27,14 @@ public IgbTreeItemCollection ContentItems partial void FindByNameTree(string name, ref object item) { - foreach (var it in ContentItems) + foreach (var it in ContentItems) { - if (it.Name == name || it.ContainerId == name) { + if (it.Name == name || it.ContainerId == name) + { item = it; return; } } } } -} \ No newline at end of file +} diff --git a/src/componentsBase/WebInputs/TreeItem.cs b/src/componentsBase/WebInputs/TreeItem.cs index aa71d365..aac76954 100644 --- a/src/componentsBase/WebInputs/TreeItem.cs +++ b/src/componentsBase/WebInputs/TreeItem.cs @@ -1,13 +1,10 @@ using Microsoft.AspNetCore.Components; -using Microsoft.AspNetCore.Components.Web; -using System; -using System.Threading.Tasks; namespace IgniteUI.Blazor.Controls { - public partial class IgbTreeItem: IDisposable + public partial class IgbTreeItem : IDisposable { - [CascadingParameter(Name="TreeParent")] + [CascadingParameter(Name = "TreeParent")] protected BaseRendererControl TreeParent { get; set; @@ -31,4 +28,4 @@ protected override async Task OnInitializedAsync() } } } -} \ No newline at end of file +} diff --git a/src/componentsBase/WebViewCallback.cs b/src/componentsBase/WebViewCallback.cs index 2b5b64c8..4daad923 100644 --- a/src/componentsBase/WebViewCallback.cs +++ b/src/componentsBase/WebViewCallback.cs @@ -1,8 +1,3 @@ -using System; -using System.Collections.Generic; -using System.Globalization; -using Microsoft.AspNetCore.Components; -using Microsoft.AspNetCore.Components.Web; using Microsoft.JSInterop; namespace IgniteUI.Blazor.Controls @@ -26,7 +21,7 @@ public class WebCallback // _instance = value; // } //} - + public bool IsReady { get @@ -38,7 +33,8 @@ public bool IsReady private bool _isReady; [JSInvokable] - public void OnReady() { + public void OnReady() + { _isReady = true; ForControls((c) => c.OnReady()); } @@ -50,9 +46,12 @@ private void ForControls(Action act) { var control = _controlsMap[controlKey]; BaseRendererControl target; - if (control.TryGetTarget(out target)) { + if (control.TryGetTarget(out target)) + { target.OnReady(); - } else { + } + else + { if (toRemove == null) { toRemove = new List(); @@ -106,7 +105,8 @@ public void OnInvokeReturn(string containerId, long invokeId, object returnValue } [JSInvokable] - public void OnRaiseEvent(string containerId, string name, string propertyName, string args) { + public void OnRaiseEvent(string containerId, string name, string propertyName, string args) + { var control = GetControl(containerId); //Console.WriteLine("raising event"); if (control != null) @@ -117,7 +117,8 @@ public void OnRaiseEvent(string containerId, string name, string propertyName, s } [JSInvokable] - public void AdjustDynamicContent(string containerId, string contentType, string templateId, string contentId, string actionType, string args) { + public void AdjustDynamicContent(string containerId, string contentType, string templateId, string contentId, string actionType, string args) + { var control = GetControl(containerId); //Console.WriteLine("raising event"); if (control != null) @@ -128,7 +129,8 @@ public void AdjustDynamicContent(string containerId, string contentType, string } [JSInvokable] - public void AdjustDynamicContentBatch(string containerId, string batch) { + public void AdjustDynamicContentBatch(string containerId, string batch) + { var control = GetControl(containerId); if (control != null) { diff --git a/src/src/Loader.ts b/src/src/Loader.ts index 2a3870e0..1b7833eb 100644 --- a/src/src/Loader.ts +++ b/src/src/Loader.ts @@ -8,1801 +8,1757 @@ import { TypeRegistrar } from 'igniteui-core/type'; import { Localization } from 'igniteui-core/Localization'; export interface LoadedModules { - readonly componentModule: { register: () => void }; - readonly metadataModule: { register: (cx: TypeDescriptionContext) => void } + readonly componentModule: { register: () => void }; + readonly metadataModule: { register: (cx: TypeDescriptionContext) => void }; } - + export class Loader { - private static _instance: Loader = null; - public static get instance(): Loader { - if (Loader._instance == null) { - Loader._instance = new Loader(); - } - return Loader._instance; - } - - public constructor() { - + private static _instance: Loader = null; + public static get instance(): Loader { + if (Loader._instance == null) { + Loader._instance = new Loader(); } + return Loader._instance; + } - public registerResource(key: string, value: any) { - Localization.register(key, value); - } + public constructor() {} - public setResourceString(grouping: string, id: string, value: string) { - if (!id || id === "") { - let strings = JSON.parse(value); - if (Localization.isRegistered(grouping)) { - let keys = Object.keys(strings); - for (let i = 0; i < keys.length; i++) { - Localization.setString(grouping, keys[i], strings[keys[i]]); - } - } else { - Localization.register(grouping, strings); - } - } else { - Localization.setString(grouping, id, value); + public registerResource(key: string, value: any) { + Localization.register(key, value); + } + + public setResourceString(grouping: string, id: string, value: string) { + if (!id || id === '') { + let strings = JSON.parse(value); + if (Localization.isRegistered(grouping)) { + let keys = Object.keys(strings); + for (let i = 0; i < keys.length; i++) { + Localization.setString(grouping, keys[i], strings[keys[i]]); } + } else { + Localization.register(grouping, strings); + } + } else { + Localization.setString(grouping, id, value); } - - private _moduleSet: Set = new Set(); - private _loadingSet: Set = new Set(); - public async request(module: string, cr: ComponentRenderer) { - if (this._moduleSet.has(module) || - this._loadingSet.has(module)) { - return; - } - - if (this.loadingPromise == null) { - this.loadingPromise = new Promise((resolve, reject) => { - this.loadingPromiseResolve = resolve; - this.loadingPromiseReject = reject; - }); - } - this._loadingSet.add(module); - switch (module) { - case "TemplateContainerModuleModule": - let { IgcTemplateContainerModule } = await import('igniteui-core/igc-template-container-module'); - let { TemplateContainerDescriptionModule } = await import('igniteui-core/TemplateContainerDescriptionModule'); - this._loadingSet.delete(module); - ModuleManager.register( - IgcTemplateContainerModule - ); - TemplateContainerDescriptionModule.register(cr.context); - this.checkDone(); - break; - - //@@ModuleLoading - - case "WebAccordionModule": - { - let { IgcAccordionComponent } = await import('igniteui-webcomponents'); - let { WebAccordionDescriptionModule } = await import('igniteui-core/WebAccordionDescriptionModule'); - - this._loadingSet.delete(module); - - IgcAccordionComponent.register(); - TypeRegistrar.registerCons('IgcAccordionComponent', IgcAccordionComponent); - - WebAccordionDescriptionModule.register(cr.context); - this.checkDone(); - break; - } - - case "WebAvatarModule": - { - let { IgcAvatarComponent } = await import('igniteui-webcomponents'); - let { WebAvatarDescriptionModule } = await import('igniteui-core/WebAvatarDescriptionModule'); + } - this._loadingSet.delete(module); - - IgcAvatarComponent.register(); - TypeRegistrar.registerCons('IgcAvatarComponent', IgcAvatarComponent); + private _moduleSet: Set = new Set(); + private _loadingSet: Set = new Set(); + public async request(module: string, cr: ComponentRenderer) { + if (this._moduleSet.has(module) || this._loadingSet.has(module)) { + return; + } - WebAvatarDescriptionModule.register(cr.context); - this.checkDone(); - break; - } - - case "WebBadgeModule": - { - let { IgcBadgeComponent } = await import('igniteui-webcomponents'); - let { WebBadgeDescriptionModule } = await import('igniteui-core/WebBadgeDescriptionModule'); + if (this.loadingPromise == null) { + this.loadingPromise = new Promise((resolve, reject) => { + this.loadingPromiseResolve = resolve; + this.loadingPromiseReject = reject; + }); + } + this._loadingSet.add(module); + switch (module) { + case 'TemplateContainerModuleModule': + let { IgcTemplateContainerModule } = await import('igniteui-core/igc-template-container-module'); + let { TemplateContainerDescriptionModule } = await import('igniteui-core/TemplateContainerDescriptionModule'); + this._loadingSet.delete(module); + ModuleManager.register(IgcTemplateContainerModule); + TemplateContainerDescriptionModule.register(cr.context); + this.checkDone(); + break; - this._loadingSet.delete(module); + //@@ModuleLoading - IgcBadgeComponent.register(); - TypeRegistrar.registerCons('IgcBadgeComponent', IgcBadgeComponent); + case 'WebAccordionModule': { + let { IgcAccordionComponent } = await import('igniteui-webcomponents'); + let { WebAccordionDescriptionModule } = await import('igniteui-core/WebAccordionDescriptionModule'); - WebBadgeDescriptionModule.register(cr.context); - this.checkDone(); - break; - } - - case "WebBannerModule": - { - let { IgcBannerComponent } = await import('igniteui-webcomponents'); - let { WebBannerDescriptionModule } = await import('igniteui-core/WebBannerDescriptionModule'); + this._loadingSet.delete(module); - this._loadingSet.delete(module); + IgcAccordionComponent.register(); + TypeRegistrar.registerCons('IgcAccordionComponent', IgcAccordionComponent); - IgcBannerComponent.register(); - TypeRegistrar.registerCons('IgcBannerComponent', IgcBannerComponent); + WebAccordionDescriptionModule.register(cr.context); + this.checkDone(); + break; + } - WebBannerDescriptionModule.register(cr.context); - this.checkDone(); - break; - } - - case "WebButtonGroupModule": - { - let { IgcButtonGroupComponent } = await import('igniteui-webcomponents'); - let { WebButtonGroupDescriptionModule } = await import('igniteui-core/WebButtonGroupDescriptionModule'); + case 'WebAvatarModule': { + let { IgcAvatarComponent } = await import('igniteui-webcomponents'); + let { WebAvatarDescriptionModule } = await import('igniteui-core/WebAvatarDescriptionModule'); - this._loadingSet.delete(module); + this._loadingSet.delete(module); - IgcButtonGroupComponent.register(); - TypeRegistrar.registerCons('IgcButtonGroupComponent', IgcButtonGroupComponent); + IgcAvatarComponent.register(); + TypeRegistrar.registerCons('IgcAvatarComponent', IgcAvatarComponent); - WebButtonGroupDescriptionModule.register(cr.context); - this.checkDone(); - break; - } - - case "WebButtonModule": - { - let { IgcButtonComponent } = await import('igniteui-webcomponents'); - let { WebButtonDescriptionModule } = await import('igniteui-core/WebButtonDescriptionModule'); + WebAvatarDescriptionModule.register(cr.context); + this.checkDone(); + break; + } - this._loadingSet.delete(module); + case 'WebBadgeModule': { + let { IgcBadgeComponent } = await import('igniteui-webcomponents'); + let { WebBadgeDescriptionModule } = await import('igniteui-core/WebBadgeDescriptionModule'); - IgcButtonComponent.register(); - TypeRegistrar.registerCons('IgcButtonComponent', IgcButtonComponent); + this._loadingSet.delete(module); - WebButtonDescriptionModule.register(cr.context); - this.checkDone(); - break; - } - - case "WebCalendarModule": - { - let { IgcCalendarComponent } = await import('igniteui-webcomponents'); - let { WebCalendarDescriptionModule } = await import('igniteui-core/WebCalendarDescriptionModule'); + IgcBadgeComponent.register(); + TypeRegistrar.registerCons('IgcBadgeComponent', IgcBadgeComponent); - this._loadingSet.delete(module); + WebBadgeDescriptionModule.register(cr.context); + this.checkDone(); + break; + } - IgcCalendarComponent.register(); - TypeRegistrar.registerCons('IgcCalendarComponent', IgcCalendarComponent); + case 'WebBannerModule': { + let { IgcBannerComponent } = await import('igniteui-webcomponents'); + let { WebBannerDescriptionModule } = await import('igniteui-core/WebBannerDescriptionModule'); - WebCalendarDescriptionModule.register(cr.context); - this.checkDone(); - break; - } - - case "WebCardActionsModule": - { - let { IgcCardActionsComponent } = await import('igniteui-webcomponents'); - let { WebCardActionsDescriptionModule } = await import('igniteui-core/WebCardActionsDescriptionModule'); + this._loadingSet.delete(module); - this._loadingSet.delete(module); + IgcBannerComponent.register(); + TypeRegistrar.registerCons('IgcBannerComponent', IgcBannerComponent); - IgcCardActionsComponent.register(); - TypeRegistrar.registerCons('IgcCardActionsComponent', IgcCardActionsComponent); + WebBannerDescriptionModule.register(cr.context); + this.checkDone(); + break; + } - WebCardActionsDescriptionModule.register(cr.context); - this.checkDone(); - break; - } - - case "WebCardContentModule": - { - let { IgcCardContentComponent } = await import('igniteui-webcomponents'); - let { WebCardContentDescriptionModule } = await import('igniteui-core/WebCardContentDescriptionModule'); + case 'WebButtonGroupModule': { + let { IgcButtonGroupComponent } = await import('igniteui-webcomponents'); + let { WebButtonGroupDescriptionModule } = await import('igniteui-core/WebButtonGroupDescriptionModule'); - this._loadingSet.delete(module); + this._loadingSet.delete(module); - IgcCardContentComponent.register(); - TypeRegistrar.registerCons('IgcCardContentComponent', IgcCardContentComponent); + IgcButtonGroupComponent.register(); + TypeRegistrar.registerCons('IgcButtonGroupComponent', IgcButtonGroupComponent); - WebCardContentDescriptionModule.register(cr.context); - this.checkDone(); - break; - } - - case "WebCardHeaderModule": - { - let { IgcCardHeaderComponent } = await import('igniteui-webcomponents'); - let { WebCardHeaderDescriptionModule } = await import('igniteui-core/WebCardHeaderDescriptionModule'); + WebButtonGroupDescriptionModule.register(cr.context); + this.checkDone(); + break; + } - this._loadingSet.delete(module); + case 'WebButtonModule': { + let { IgcButtonComponent } = await import('igniteui-webcomponents'); + let { WebButtonDescriptionModule } = await import('igniteui-core/WebButtonDescriptionModule'); - IgcCardHeaderComponent.register(); - TypeRegistrar.registerCons('IgcCardHeaderComponent', IgcCardHeaderComponent); + this._loadingSet.delete(module); - WebCardHeaderDescriptionModule.register(cr.context); - this.checkDone(); - break; - } - - case "WebCardMediaModule": - { - let { IgcCardMediaComponent } = await import('igniteui-webcomponents'); - let { WebCardMediaDescriptionModule } = await import('igniteui-core/WebCardMediaDescriptionModule'); + IgcButtonComponent.register(); + TypeRegistrar.registerCons('IgcButtonComponent', IgcButtonComponent); - this._loadingSet.delete(module); + WebButtonDescriptionModule.register(cr.context); + this.checkDone(); + break; + } - IgcCardMediaComponent.register(); - TypeRegistrar.registerCons('IgcCardMediaComponent', IgcCardMediaComponent); + case 'WebCalendarModule': { + let { IgcCalendarComponent } = await import('igniteui-webcomponents'); + let { WebCalendarDescriptionModule } = await import('igniteui-core/WebCalendarDescriptionModule'); - WebCardMediaDescriptionModule.register(cr.context); - this.checkDone(); - break; - } - - case "WebCardModule": - { - let { IgcCardComponent } = await import('igniteui-webcomponents'); - let { WebCardDescriptionModule } = await import('igniteui-core/WebCardDescriptionModule'); + this._loadingSet.delete(module); - this._loadingSet.delete(module); + IgcCalendarComponent.register(); + TypeRegistrar.registerCons('IgcCalendarComponent', IgcCalendarComponent); - IgcCardComponent.register(); - TypeRegistrar.registerCons('IgcCardComponent', IgcCardComponent); + WebCalendarDescriptionModule.register(cr.context); + this.checkDone(); + break; + } - WebCardDescriptionModule.register(cr.context); - this.checkDone(); - break; - } - - case "WebCarouselIndicatorModule": - { - let { IgcCarouselIndicatorComponent } = await import('igniteui-webcomponents'); - let { WebCarouselIndicatorDescriptionModule } = await import('igniteui-core/WebCarouselIndicatorDescriptionModule'); + case 'WebCardActionsModule': { + let { IgcCardActionsComponent } = await import('igniteui-webcomponents'); + let { WebCardActionsDescriptionModule } = await import('igniteui-core/WebCardActionsDescriptionModule'); - this._loadingSet.delete(module); + this._loadingSet.delete(module); - IgcCarouselIndicatorComponent.register(); - TypeRegistrar.registerCons('IgcCarouselIndicatorComponent', IgcCarouselIndicatorComponent); + IgcCardActionsComponent.register(); + TypeRegistrar.registerCons('IgcCardActionsComponent', IgcCardActionsComponent); - WebCarouselIndicatorDescriptionModule.register(cr.context); - this.checkDone(); - break; - } - - case "WebCarouselModule": - { - let { IgcCarouselComponent } = await import('igniteui-webcomponents'); - let { WebCarouselDescriptionModule } = await import('igniteui-core/WebCarouselDescriptionModule'); + WebCardActionsDescriptionModule.register(cr.context); + this.checkDone(); + break; + } - this._loadingSet.delete(module); + case 'WebCardContentModule': { + let { IgcCardContentComponent } = await import('igniteui-webcomponents'); + let { WebCardContentDescriptionModule } = await import('igniteui-core/WebCardContentDescriptionModule'); - IgcCarouselComponent.register(); - TypeRegistrar.registerCons('IgcCarouselComponent', IgcCarouselComponent); + this._loadingSet.delete(module); - WebCarouselDescriptionModule.register(cr.context); - this.checkDone(); - break; - } - - case "WebCarouselSlideModule": - { - let { IgcCarouselSlideComponent } = await import('igniteui-webcomponents'); - let { WebCarouselSlideDescriptionModule } = await import('igniteui-core/WebCarouselSlideDescriptionModule'); + IgcCardContentComponent.register(); + TypeRegistrar.registerCons('IgcCardContentComponent', IgcCardContentComponent); - this._loadingSet.delete(module); + WebCardContentDescriptionModule.register(cr.context); + this.checkDone(); + break; + } - IgcCarouselSlideComponent.register(); - TypeRegistrar.registerCons('IgcCarouselSlideComponent', IgcCarouselSlideComponent); + case 'WebCardHeaderModule': { + let { IgcCardHeaderComponent } = await import('igniteui-webcomponents'); + let { WebCardHeaderDescriptionModule } = await import('igniteui-core/WebCardHeaderDescriptionModule'); - WebCarouselSlideDescriptionModule.register(cr.context); - this.checkDone(); - break; - } - - case "WebChatModule": - { - let { IgcChatComponent } = await import('igniteui-webcomponents'); - let { WebChatDescriptionModule } = await import('igniteui-core/WebChatDescriptionModule'); + this._loadingSet.delete(module); - this._loadingSet.delete(module); + IgcCardHeaderComponent.register(); + TypeRegistrar.registerCons('IgcCardHeaderComponent', IgcCardHeaderComponent); - IgcChatComponent.register(); - TypeRegistrar.registerCons('IgcChatComponent', IgcChatComponent); + WebCardHeaderDescriptionModule.register(cr.context); + this.checkDone(); + break; + } - WebChatDescriptionModule.register(cr.context); - this.checkDone(); - break; - } - - case "WebCheckboxModule": - { - let { IgcCheckboxComponent } = await import('igniteui-webcomponents'); - let { WebCheckboxDescriptionModule } = await import('igniteui-core/WebCheckboxDescriptionModule'); + case 'WebCardMediaModule': { + let { IgcCardMediaComponent } = await import('igniteui-webcomponents'); + let { WebCardMediaDescriptionModule } = await import('igniteui-core/WebCardMediaDescriptionModule'); - this._loadingSet.delete(module); + this._loadingSet.delete(module); - IgcCheckboxComponent.register(); - TypeRegistrar.registerCons('IgcCheckboxComponent', IgcCheckboxComponent); + IgcCardMediaComponent.register(); + TypeRegistrar.registerCons('IgcCardMediaComponent', IgcCardMediaComponent); - WebCheckboxDescriptionModule.register(cr.context); - this.checkDone(); - break; - } - - case "WebChipModule": - { - let { IgcChipComponent } = await import('igniteui-webcomponents'); - let { WebChipDescriptionModule } = await import('igniteui-core/WebChipDescriptionModule'); + WebCardMediaDescriptionModule.register(cr.context); + this.checkDone(); + break; + } - this._loadingSet.delete(module); + case 'WebCardModule': { + let { IgcCardComponent } = await import('igniteui-webcomponents'); + let { WebCardDescriptionModule } = await import('igniteui-core/WebCardDescriptionModule'); - IgcChipComponent.register(); - TypeRegistrar.registerCons('IgcChipComponent', IgcChipComponent); + this._loadingSet.delete(module); - WebChipDescriptionModule.register(cr.context); - this.checkDone(); - break; - } - - case "WebCircularGradientModule": - { - let { IgcCircularGradientComponent } = await import('igniteui-webcomponents'); - let { WebCircularGradientDescriptionModule } = await import('igniteui-core/WebCircularGradientDescriptionModule'); + IgcCardComponent.register(); + TypeRegistrar.registerCons('IgcCardComponent', IgcCardComponent); - this._loadingSet.delete(module); + WebCardDescriptionModule.register(cr.context); + this.checkDone(); + break; + } - IgcCircularGradientComponent.register(); - TypeRegistrar.registerCons('IgcCircularGradientComponent', IgcCircularGradientComponent); + case 'WebCarouselIndicatorModule': { + let { IgcCarouselIndicatorComponent } = await import('igniteui-webcomponents'); + let { WebCarouselIndicatorDescriptionModule } = + await import('igniteui-core/WebCarouselIndicatorDescriptionModule'); - WebCircularGradientDescriptionModule.register(cr.context); - this.checkDone(); - break; - } - - case "WebCircularProgressModule": - { - let { IgcCircularProgressComponent } = await import('igniteui-webcomponents'); - let { WebCircularProgressDescriptionModule } = await import('igniteui-core/WebCircularProgressDescriptionModule'); + this._loadingSet.delete(module); - this._loadingSet.delete(module); + IgcCarouselIndicatorComponent.register(); + TypeRegistrar.registerCons('IgcCarouselIndicatorComponent', IgcCarouselIndicatorComponent); - IgcCircularProgressComponent.register(); - TypeRegistrar.registerCons('IgcCircularProgressComponent', IgcCircularProgressComponent); + WebCarouselIndicatorDescriptionModule.register(cr.context); + this.checkDone(); + break; + } - WebCircularProgressDescriptionModule.register(cr.context); - this.checkDone(); - break; - } - - case "WebComboModule": - { - let { IgcComboComponent } = await import('igniteui-webcomponents'); - let { WebComboDescriptionModule } = await import('igniteui-core/WebComboDescriptionModule'); + case 'WebCarouselModule': { + let { IgcCarouselComponent } = await import('igniteui-webcomponents'); + let { WebCarouselDescriptionModule } = await import('igniteui-core/WebCarouselDescriptionModule'); - this._loadingSet.delete(module); + this._loadingSet.delete(module); - IgcComboComponent.register(); - TypeRegistrar.registerCons('IgcComboComponent', IgcComboComponent); + IgcCarouselComponent.register(); + TypeRegistrar.registerCons('IgcCarouselComponent', IgcCarouselComponent); - WebComboDescriptionModule.register(cr.context); - this.checkDone(); - break; - } - - case "WebDatePickerModule": - { - let { IgcDatePickerComponent } = await import('igniteui-webcomponents'); - let { WebDatePickerDescriptionModule } = await import('igniteui-core/WebDatePickerDescriptionModule'); + WebCarouselDescriptionModule.register(cr.context); + this.checkDone(); + break; + } - this._loadingSet.delete(module); + case 'WebCarouselSlideModule': { + let { IgcCarouselSlideComponent } = await import('igniteui-webcomponents'); + let { WebCarouselSlideDescriptionModule } = await import('igniteui-core/WebCarouselSlideDescriptionModule'); - IgcDatePickerComponent.register(); - TypeRegistrar.registerCons('IgcDatePickerComponent', IgcDatePickerComponent); + this._loadingSet.delete(module); - WebDatePickerDescriptionModule.register(cr.context); - this.checkDone(); - break; - } - - case "WebDateRangePickerModule": - { - let { IgcDateRangePickerComponent } = await import('igniteui-webcomponents'); - let { WebDateRangePickerDescriptionModule } = await import('igniteui-core/WebDateRangePickerDescriptionModule'); + IgcCarouselSlideComponent.register(); + TypeRegistrar.registerCons('IgcCarouselSlideComponent', IgcCarouselSlideComponent); - this._loadingSet.delete(module); + WebCarouselSlideDescriptionModule.register(cr.context); + this.checkDone(); + break; + } - IgcDateRangePickerComponent.register(); - TypeRegistrar.registerCons('IgcDateRangePickerComponent', IgcDateRangePickerComponent); + case 'WebChatModule': { + let { IgcChatComponent } = await import('igniteui-webcomponents'); + let { WebChatDescriptionModule } = await import('igniteui-core/WebChatDescriptionModule'); - WebDateRangePickerDescriptionModule.register(cr.context); - this.checkDone(); - break; - } - - case "WebDateTimeInputModule": - { - let { IgcDateTimeInputComponent } = await import('igniteui-webcomponents'); - let { WebDateTimeInputDescriptionModule } = await import('igniteui-core/WebDateTimeInputDescriptionModule'); + this._loadingSet.delete(module); - this._loadingSet.delete(module); + IgcChatComponent.register(); + TypeRegistrar.registerCons('IgcChatComponent', IgcChatComponent); - IgcDateTimeInputComponent.register(); - TypeRegistrar.registerCons('IgcDateTimeInputComponent', IgcDateTimeInputComponent); + WebChatDescriptionModule.register(cr.context); + this.checkDone(); + break; + } - WebDateTimeInputDescriptionModule.register(cr.context); - this.checkDone(); - break; - } - - case "WebDialogModule": - { - let { IgcDialogComponent } = await import('igniteui-webcomponents'); - let { WebDialogDescriptionModule } = await import('igniteui-core/WebDialogDescriptionModule'); + case 'WebCheckboxModule': { + let { IgcCheckboxComponent } = await import('igniteui-webcomponents'); + let { WebCheckboxDescriptionModule } = await import('igniteui-core/WebCheckboxDescriptionModule'); - this._loadingSet.delete(module); + this._loadingSet.delete(module); - IgcDialogComponent.register(); - TypeRegistrar.registerCons('IgcDialogComponent', IgcDialogComponent); + IgcCheckboxComponent.register(); + TypeRegistrar.registerCons('IgcCheckboxComponent', IgcCheckboxComponent); - WebDialogDescriptionModule.register(cr.context); - this.checkDone(); - break; - } - - case "WebDividerModule": - { - let { IgcDividerComponent } = await import('igniteui-webcomponents'); - let { WebDividerDescriptionModule } = await import('igniteui-core/WebDividerDescriptionModule'); + WebCheckboxDescriptionModule.register(cr.context); + this.checkDone(); + break; + } - this._loadingSet.delete(module); + case 'WebChipModule': { + let { IgcChipComponent } = await import('igniteui-webcomponents'); + let { WebChipDescriptionModule } = await import('igniteui-core/WebChipDescriptionModule'); - IgcDividerComponent.register(); - TypeRegistrar.registerCons('IgcDividerComponent', IgcDividerComponent); + this._loadingSet.delete(module); - WebDividerDescriptionModule.register(cr.context); - this.checkDone(); - break; - } - - case "WebDropdownGroupModule": - { - let { IgcDropdownGroupComponent } = await import('igniteui-webcomponents'); - let { WebDropdownGroupDescriptionModule } = await import('igniteui-core/WebDropdownGroupDescriptionModule'); + IgcChipComponent.register(); + TypeRegistrar.registerCons('IgcChipComponent', IgcChipComponent); - this._loadingSet.delete(module); + WebChipDescriptionModule.register(cr.context); + this.checkDone(); + break; + } - IgcDropdownGroupComponent.register(); - TypeRegistrar.registerCons('IgcDropdownGroupComponent', IgcDropdownGroupComponent); + case 'WebCircularGradientModule': { + let { IgcCircularGradientComponent } = await import('igniteui-webcomponents'); + let { WebCircularGradientDescriptionModule } = + await import('igniteui-core/WebCircularGradientDescriptionModule'); - WebDropdownGroupDescriptionModule.register(cr.context); - this.checkDone(); - break; - } - - case "WebDropdownHeaderModule": - { - let { IgcDropdownHeaderComponent } = await import('igniteui-webcomponents'); - let { WebDropdownHeaderDescriptionModule } = await import('igniteui-core/WebDropdownHeaderDescriptionModule'); + this._loadingSet.delete(module); - this._loadingSet.delete(module); + IgcCircularGradientComponent.register(); + TypeRegistrar.registerCons('IgcCircularGradientComponent', IgcCircularGradientComponent); - IgcDropdownHeaderComponent.register(); - TypeRegistrar.registerCons('IgcDropdownHeaderComponent', IgcDropdownHeaderComponent); + WebCircularGradientDescriptionModule.register(cr.context); + this.checkDone(); + break; + } - WebDropdownHeaderDescriptionModule.register(cr.context); - this.checkDone(); - break; - } - - case "WebDropdownItemModule": - { - let { IgcDropdownItemComponent } = await import('igniteui-webcomponents'); - let { WebDropdownItemDescriptionModule } = await import('igniteui-core/WebDropdownItemDescriptionModule'); + case 'WebCircularProgressModule': { + let { IgcCircularProgressComponent } = await import('igniteui-webcomponents'); + let { WebCircularProgressDescriptionModule } = + await import('igniteui-core/WebCircularProgressDescriptionModule'); - this._loadingSet.delete(module); + this._loadingSet.delete(module); - IgcDropdownItemComponent.register(); - TypeRegistrar.registerCons('IgcDropdownItemComponent', IgcDropdownItemComponent); + IgcCircularProgressComponent.register(); + TypeRegistrar.registerCons('IgcCircularProgressComponent', IgcCircularProgressComponent); - WebDropdownItemDescriptionModule.register(cr.context); - this.checkDone(); - break; - } - - case "WebDropdownModule": - { - let { IgcDropdownComponent } = await import('igniteui-webcomponents'); - let { WebDropdownDescriptionModule } = await import('igniteui-core/WebDropdownDescriptionModule'); + WebCircularProgressDescriptionModule.register(cr.context); + this.checkDone(); + break; + } - this._loadingSet.delete(module); + case 'WebComboModule': { + let { IgcComboComponent } = await import('igniteui-webcomponents'); + let { WebComboDescriptionModule } = await import('igniteui-core/WebComboDescriptionModule'); - IgcDropdownComponent.register(); - TypeRegistrar.registerCons('IgcDropdownComponent', IgcDropdownComponent); + this._loadingSet.delete(module); - WebDropdownDescriptionModule.register(cr.context); - this.checkDone(); - break; - } - - case "WebExpansionPanelModule": - { - let { IgcExpansionPanelComponent } = await import('igniteui-webcomponents'); - let { WebExpansionPanelDescriptionModule } = await import('igniteui-core/WebExpansionPanelDescriptionModule'); + IgcComboComponent.register(); + TypeRegistrar.registerCons('IgcComboComponent', IgcComboComponent); - this._loadingSet.delete(module); + WebComboDescriptionModule.register(cr.context); + this.checkDone(); + break; + } - IgcExpansionPanelComponent.register(); - TypeRegistrar.registerCons('IgcExpansionPanelComponent', IgcExpansionPanelComponent); + case 'WebDatePickerModule': { + let { IgcDatePickerComponent } = await import('igniteui-webcomponents'); + let { WebDatePickerDescriptionModule } = await import('igniteui-core/WebDatePickerDescriptionModule'); - WebExpansionPanelDescriptionModule.register(cr.context); - this.checkDone(); - break; - } - - case "FormatSpecifierModule": - let { IgcFormatSpecifierModule } = await import('igniteui-core/igc-format-specifier-module'); - let { FormatSpecifierDescriptionModule } = await import('igniteui-core/FormatSpecifierDescriptionModule'); this._loadingSet.delete(module); - ModuleManager.register( - IgcFormatSpecifierModule - ); - FormatSpecifierDescriptionModule.register(cr.context); - this.checkDone(); - break; - - case "WebHighlightModule": - { - let { IgcHighlightComponent } = await import('igniteui-webcomponents'); - let { WebHighlightDescriptionModule } = await import('igniteui-core/WebHighlightDescriptionModule'); - this._loadingSet.delete(module); + IgcDatePickerComponent.register(); + TypeRegistrar.registerCons('IgcDatePickerComponent', IgcDatePickerComponent); - IgcHighlightComponent.register(); - TypeRegistrar.registerCons('IgcHighlightComponent', IgcHighlightComponent); + WebDatePickerDescriptionModule.register(cr.context); + this.checkDone(); + break; + } - WebHighlightDescriptionModule.register(cr.context); - this.checkDone(); - break; - } - - case "WebIconButtonModule": - { - let { IgcIconButtonComponent } = await import('igniteui-webcomponents'); - let { WebIconButtonDescriptionModule } = await import('igniteui-core/WebIconButtonDescriptionModule'); + case 'WebDateRangePickerModule': { + let { IgcDateRangePickerComponent } = await import('igniteui-webcomponents'); + let { WebDateRangePickerDescriptionModule } = await import('igniteui-core/WebDateRangePickerDescriptionModule'); - this._loadingSet.delete(module); + this._loadingSet.delete(module); - IgcIconButtonComponent.register(); - TypeRegistrar.registerCons('IgcIconButtonComponent', IgcIconButtonComponent); + IgcDateRangePickerComponent.register(); + TypeRegistrar.registerCons('IgcDateRangePickerComponent', IgcDateRangePickerComponent); - WebIconButtonDescriptionModule.register(cr.context); - this.checkDone(); - break; - } - - case "WebIconModule": - { - let { IgcIconComponent } = await import('igniteui-webcomponents'); - let { WebIconDescriptionModule } = await import('igniteui-core/WebIconDescriptionModule'); + WebDateRangePickerDescriptionModule.register(cr.context); + this.checkDone(); + break; + } - this._loadingSet.delete(module); + case 'WebDateTimeInputModule': { + let { IgcDateTimeInputComponent } = await import('igniteui-webcomponents'); + let { WebDateTimeInputDescriptionModule } = await import('igniteui-core/WebDateTimeInputDescriptionModule'); - IgcIconComponent.register(); - TypeRegistrar.registerCons('IgcIconComponent', IgcIconComponent); + this._loadingSet.delete(module); - WebIconDescriptionModule.register(cr.context); - this.checkDone(); - break; - } - - case "WebInputModule": - { - let { IgcInputComponent } = await import('igniteui-webcomponents'); - let { WebInputDescriptionModule } = await import('igniteui-core/WebInputDescriptionModule'); + IgcDateTimeInputComponent.register(); + TypeRegistrar.registerCons('IgcDateTimeInputComponent', IgcDateTimeInputComponent); - this._loadingSet.delete(module); + WebDateTimeInputDescriptionModule.register(cr.context); + this.checkDone(); + break; + } - IgcInputComponent.register(); - TypeRegistrar.registerCons('IgcInputComponent', IgcInputComponent); + case 'WebDialogModule': { + let { IgcDialogComponent } = await import('igniteui-webcomponents'); + let { WebDialogDescriptionModule } = await import('igniteui-core/WebDialogDescriptionModule'); - WebInputDescriptionModule.register(cr.context); - this.checkDone(); - break; - } - - case "WebLinearProgressModule": - { - let { IgcLinearProgressComponent } = await import('igniteui-webcomponents'); - let { WebLinearProgressDescriptionModule } = await import('igniteui-core/WebLinearProgressDescriptionModule'); + this._loadingSet.delete(module); - this._loadingSet.delete(module); + IgcDialogComponent.register(); + TypeRegistrar.registerCons('IgcDialogComponent', IgcDialogComponent); - IgcLinearProgressComponent.register(); - TypeRegistrar.registerCons('IgcLinearProgressComponent', IgcLinearProgressComponent); + WebDialogDescriptionModule.register(cr.context); + this.checkDone(); + break; + } - WebLinearProgressDescriptionModule.register(cr.context); - this.checkDone(); - break; - } - - case "WebListHeaderModule": - { - let { IgcListHeaderComponent } = await import('igniteui-webcomponents'); - let { WebListHeaderDescriptionModule } = await import('igniteui-core/WebListHeaderDescriptionModule'); + case 'WebDividerModule': { + let { IgcDividerComponent } = await import('igniteui-webcomponents'); + let { WebDividerDescriptionModule } = await import('igniteui-core/WebDividerDescriptionModule'); - this._loadingSet.delete(module); + this._loadingSet.delete(module); - IgcListHeaderComponent.register(); - TypeRegistrar.registerCons('IgcListHeaderComponent', IgcListHeaderComponent); + IgcDividerComponent.register(); + TypeRegistrar.registerCons('IgcDividerComponent', IgcDividerComponent); - WebListHeaderDescriptionModule.register(cr.context); - this.checkDone(); - break; - } - - case "WebListItemModule": - { - let { IgcListItemComponent } = await import('igniteui-webcomponents'); - let { WebListItemDescriptionModule } = await import('igniteui-core/WebListItemDescriptionModule'); + WebDividerDescriptionModule.register(cr.context); + this.checkDone(); + break; + } - this._loadingSet.delete(module); + case 'WebDropdownGroupModule': { + let { IgcDropdownGroupComponent } = await import('igniteui-webcomponents'); + let { WebDropdownGroupDescriptionModule } = await import('igniteui-core/WebDropdownGroupDescriptionModule'); - IgcListItemComponent.register(); - TypeRegistrar.registerCons('IgcListItemComponent', IgcListItemComponent); + this._loadingSet.delete(module); - WebListItemDescriptionModule.register(cr.context); - this.checkDone(); - break; - } - - case "WebListModule": - { - let { IgcListComponent } = await import('igniteui-webcomponents'); - let { WebListDescriptionModule } = await import('igniteui-core/WebListDescriptionModule'); + IgcDropdownGroupComponent.register(); + TypeRegistrar.registerCons('IgcDropdownGroupComponent', IgcDropdownGroupComponent); - this._loadingSet.delete(module); + WebDropdownGroupDescriptionModule.register(cr.context); + this.checkDone(); + break; + } - IgcListComponent.register(); - TypeRegistrar.registerCons('IgcListComponent', IgcListComponent); + case 'WebDropdownHeaderModule': { + let { IgcDropdownHeaderComponent } = await import('igniteui-webcomponents'); + let { WebDropdownHeaderDescriptionModule } = await import('igniteui-core/WebDropdownHeaderDescriptionModule'); - WebListDescriptionModule.register(cr.context); - this.checkDone(); - break; - } - - case "WebMaskInputModule": - { - let { IgcMaskInputComponent } = await import('igniteui-webcomponents'); - let { WebMaskInputDescriptionModule } = await import('igniteui-core/WebMaskInputDescriptionModule'); + this._loadingSet.delete(module); - this._loadingSet.delete(module); + IgcDropdownHeaderComponent.register(); + TypeRegistrar.registerCons('IgcDropdownHeaderComponent', IgcDropdownHeaderComponent); - IgcMaskInputComponent.register(); - TypeRegistrar.registerCons('IgcMaskInputComponent', IgcMaskInputComponent); + WebDropdownHeaderDescriptionModule.register(cr.context); + this.checkDone(); + break; + } - WebMaskInputDescriptionModule.register(cr.context); - this.checkDone(); - break; - } - - case "WebNavDrawerHeaderItemModule": - { - let { IgcNavDrawerHeaderItemComponent } = await import('igniteui-webcomponents'); - let { WebNavDrawerHeaderItemDescriptionModule } = await import('igniteui-core/WebNavDrawerHeaderItemDescriptionModule'); + case 'WebDropdownItemModule': { + let { IgcDropdownItemComponent } = await import('igniteui-webcomponents'); + let { WebDropdownItemDescriptionModule } = await import('igniteui-core/WebDropdownItemDescriptionModule'); - this._loadingSet.delete(module); + this._loadingSet.delete(module); - IgcNavDrawerHeaderItemComponent.register(); - TypeRegistrar.registerCons('IgcNavDrawerHeaderItemComponent', IgcNavDrawerHeaderItemComponent); + IgcDropdownItemComponent.register(); + TypeRegistrar.registerCons('IgcDropdownItemComponent', IgcDropdownItemComponent); - WebNavDrawerHeaderItemDescriptionModule.register(cr.context); - this.checkDone(); - break; - } - - case "WebNavDrawerItemModule": - { - let { IgcNavDrawerItemComponent } = await import('igniteui-webcomponents'); - let { WebNavDrawerItemDescriptionModule } = await import('igniteui-core/WebNavDrawerItemDescriptionModule'); + WebDropdownItemDescriptionModule.register(cr.context); + this.checkDone(); + break; + } - this._loadingSet.delete(module); + case 'WebDropdownModule': { + let { IgcDropdownComponent } = await import('igniteui-webcomponents'); + let { WebDropdownDescriptionModule } = await import('igniteui-core/WebDropdownDescriptionModule'); - IgcNavDrawerItemComponent.register(); - TypeRegistrar.registerCons('IgcNavDrawerItemComponent', IgcNavDrawerItemComponent); + this._loadingSet.delete(module); - WebNavDrawerItemDescriptionModule.register(cr.context); - this.checkDone(); - break; - } - - case "WebNavDrawerModule": - { - let { IgcNavDrawerComponent } = await import('igniteui-webcomponents'); - let { WebNavDrawerDescriptionModule } = await import('igniteui-core/WebNavDrawerDescriptionModule'); + IgcDropdownComponent.register(); + TypeRegistrar.registerCons('IgcDropdownComponent', IgcDropdownComponent); - this._loadingSet.delete(module); + WebDropdownDescriptionModule.register(cr.context); + this.checkDone(); + break; + } - IgcNavDrawerComponent.register(); - TypeRegistrar.registerCons('IgcNavDrawerComponent', IgcNavDrawerComponent); + case 'WebExpansionPanelModule': { + let { IgcExpansionPanelComponent } = await import('igniteui-webcomponents'); + let { WebExpansionPanelDescriptionModule } = await import('igniteui-core/WebExpansionPanelDescriptionModule'); - WebNavDrawerDescriptionModule.register(cr.context); - this.checkDone(); - break; - } - - case "WebNavbarModule": - { - let { IgcNavbarComponent } = await import('igniteui-webcomponents'); - let { WebNavbarDescriptionModule } = await import('igniteui-core/WebNavbarDescriptionModule'); + this._loadingSet.delete(module); - this._loadingSet.delete(module); + IgcExpansionPanelComponent.register(); + TypeRegistrar.registerCons('IgcExpansionPanelComponent', IgcExpansionPanelComponent); - IgcNavbarComponent.register(); - TypeRegistrar.registerCons('IgcNavbarComponent', IgcNavbarComponent); + WebExpansionPanelDescriptionModule.register(cr.context); + this.checkDone(); + break; + } - WebNavbarDescriptionModule.register(cr.context); - this.checkDone(); - break; - } - - case "NumberFormatSpecifierModule": - let { IgcNumberFormatSpecifierModule } = await import('igniteui-core/igc-number-format-specifier-module'); - let { NumberFormatSpecifierDescriptionModule } = await import('igniteui-core/NumberFormatSpecifierDescriptionModule'); + case 'FormatSpecifierModule': + let { IgcFormatSpecifierModule } = await import('igniteui-core/igc-format-specifier-module'); + let { FormatSpecifierDescriptionModule } = await import('igniteui-core/FormatSpecifierDescriptionModule'); this._loadingSet.delete(module); - ModuleManager.register( - IgcNumberFormatSpecifierModule - ); - NumberFormatSpecifierDescriptionModule.register(cr.context); + ModuleManager.register(IgcFormatSpecifierModule); + FormatSpecifierDescriptionModule.register(cr.context); this.checkDone(); break; - - case "WebRadioGroupModule": - { - let { IgcRadioGroupComponent } = await import('igniteui-webcomponents'); - let { WebRadioGroupDescriptionModule } = await import('igniteui-core/WebRadioGroupDescriptionModule'); - this._loadingSet.delete(module); + case 'WebHighlightModule': { + let { IgcHighlightComponent } = await import('igniteui-webcomponents'); + let { WebHighlightDescriptionModule } = await import('igniteui-core/WebHighlightDescriptionModule'); - IgcRadioGroupComponent.register(); - TypeRegistrar.registerCons('IgcRadioGroupComponent', IgcRadioGroupComponent); + this._loadingSet.delete(module); - WebRadioGroupDescriptionModule.register(cr.context); - this.checkDone(); - break; - } - - case "WebRadioModule": - { - let { IgcRadioComponent } = await import('igniteui-webcomponents'); - let { WebRadioDescriptionModule } = await import('igniteui-core/WebRadioDescriptionModule'); + IgcHighlightComponent.register(); + TypeRegistrar.registerCons('IgcHighlightComponent', IgcHighlightComponent); - this._loadingSet.delete(module); + WebHighlightDescriptionModule.register(cr.context); + this.checkDone(); + break; + } - IgcRadioComponent.register(); - TypeRegistrar.registerCons('IgcRadioComponent', IgcRadioComponent); + case 'WebIconButtonModule': { + let { IgcIconButtonComponent } = await import('igniteui-webcomponents'); + let { WebIconButtonDescriptionModule } = await import('igniteui-core/WebIconButtonDescriptionModule'); - WebRadioDescriptionModule.register(cr.context); - this.checkDone(); - break; - } - - case "WebRangeSliderModule": - { - let { IgcRangeSliderComponent } = await import('igniteui-webcomponents'); - let { WebRangeSliderDescriptionModule } = await import('igniteui-core/WebRangeSliderDescriptionModule'); + this._loadingSet.delete(module); - this._loadingSet.delete(module); + IgcIconButtonComponent.register(); + TypeRegistrar.registerCons('IgcIconButtonComponent', IgcIconButtonComponent); - IgcRangeSliderComponent.register(); - TypeRegistrar.registerCons('IgcRangeSliderComponent', IgcRangeSliderComponent); + WebIconButtonDescriptionModule.register(cr.context); + this.checkDone(); + break; + } - WebRangeSliderDescriptionModule.register(cr.context); - this.checkDone(); - break; - } - - case "WebRatingModule": - { - let { IgcRatingComponent } = await import('igniteui-webcomponents'); - let { WebRatingDescriptionModule } = await import('igniteui-core/WebRatingDescriptionModule'); + case 'WebIconModule': { + let { IgcIconComponent } = await import('igniteui-webcomponents'); + let { WebIconDescriptionModule } = await import('igniteui-core/WebIconDescriptionModule'); - this._loadingSet.delete(module); + this._loadingSet.delete(module); - IgcRatingComponent.register(); - TypeRegistrar.registerCons('IgcRatingComponent', IgcRatingComponent); + IgcIconComponent.register(); + TypeRegistrar.registerCons('IgcIconComponent', IgcIconComponent); - WebRatingDescriptionModule.register(cr.context); - this.checkDone(); - break; - } - - case "WebRatingSymbolModule": - { - let { IgcRatingSymbolComponent } = await import('igniteui-webcomponents'); - let { WebRatingSymbolDescriptionModule } = await import('igniteui-core/WebRatingSymbolDescriptionModule'); + WebIconDescriptionModule.register(cr.context); + this.checkDone(); + break; + } - this._loadingSet.delete(module); + case 'WebInputModule': { + let { IgcInputComponent } = await import('igniteui-webcomponents'); + let { WebInputDescriptionModule } = await import('igniteui-core/WebInputDescriptionModule'); - IgcRatingSymbolComponent.register(); - TypeRegistrar.registerCons('IgcRatingSymbolComponent', IgcRatingSymbolComponent); + this._loadingSet.delete(module); - WebRatingSymbolDescriptionModule.register(cr.context); - this.checkDone(); - break; - } - - case "WebRippleModule": - { - let { IgcRippleComponent } = await import('igniteui-webcomponents'); - let { WebRippleDescriptionModule } = await import('igniteui-core/WebRippleDescriptionModule'); + IgcInputComponent.register(); + TypeRegistrar.registerCons('IgcInputComponent', IgcInputComponent); - this._loadingSet.delete(module); + WebInputDescriptionModule.register(cr.context); + this.checkDone(); + break; + } - IgcRippleComponent.register(); - TypeRegistrar.registerCons('IgcRippleComponent', IgcRippleComponent); + case 'WebLinearProgressModule': { + let { IgcLinearProgressComponent } = await import('igniteui-webcomponents'); + let { WebLinearProgressDescriptionModule } = await import('igniteui-core/WebLinearProgressDescriptionModule'); - WebRippleDescriptionModule.register(cr.context); - this.checkDone(); - break; - } - - case "WebSelectGroupModule": - { - let { IgcSelectGroupComponent } = await import('igniteui-webcomponents'); - let { WebSelectGroupDescriptionModule } = await import('igniteui-core/WebSelectGroupDescriptionModule'); + this._loadingSet.delete(module); - this._loadingSet.delete(module); + IgcLinearProgressComponent.register(); + TypeRegistrar.registerCons('IgcLinearProgressComponent', IgcLinearProgressComponent); - IgcSelectGroupComponent.register(); - TypeRegistrar.registerCons('IgcSelectGroupComponent', IgcSelectGroupComponent); + WebLinearProgressDescriptionModule.register(cr.context); + this.checkDone(); + break; + } - WebSelectGroupDescriptionModule.register(cr.context); - this.checkDone(); - break; - } - - case "WebSelectHeaderModule": - { - let { IgcSelectHeaderComponent } = await import('igniteui-webcomponents'); - let { WebSelectHeaderDescriptionModule } = await import('igniteui-core/WebSelectHeaderDescriptionModule'); + case 'WebListHeaderModule': { + let { IgcListHeaderComponent } = await import('igniteui-webcomponents'); + let { WebListHeaderDescriptionModule } = await import('igniteui-core/WebListHeaderDescriptionModule'); - this._loadingSet.delete(module); + this._loadingSet.delete(module); - IgcSelectHeaderComponent.register(); - TypeRegistrar.registerCons('IgcSelectHeaderComponent', IgcSelectHeaderComponent); + IgcListHeaderComponent.register(); + TypeRegistrar.registerCons('IgcListHeaderComponent', IgcListHeaderComponent); - WebSelectHeaderDescriptionModule.register(cr.context); - this.checkDone(); - break; - } - - case "WebSelectItemModule": - { - let { IgcSelectItemComponent } = await import('igniteui-webcomponents'); - let { WebSelectItemDescriptionModule } = await import('igniteui-core/WebSelectItemDescriptionModule'); + WebListHeaderDescriptionModule.register(cr.context); + this.checkDone(); + break; + } - this._loadingSet.delete(module); + case 'WebListItemModule': { + let { IgcListItemComponent } = await import('igniteui-webcomponents'); + let { WebListItemDescriptionModule } = await import('igniteui-core/WebListItemDescriptionModule'); - IgcSelectItemComponent.register(); - TypeRegistrar.registerCons('IgcSelectItemComponent', IgcSelectItemComponent); + this._loadingSet.delete(module); - WebSelectItemDescriptionModule.register(cr.context); - this.checkDone(); - break; - } - - case "WebSelectModule": - { - let { IgcSelectComponent } = await import('igniteui-webcomponents'); - let { WebSelectDescriptionModule } = await import('igniteui-core/WebSelectDescriptionModule'); + IgcListItemComponent.register(); + TypeRegistrar.registerCons('IgcListItemComponent', IgcListItemComponent); - this._loadingSet.delete(module); + WebListItemDescriptionModule.register(cr.context); + this.checkDone(); + break; + } - IgcSelectComponent.register(); - TypeRegistrar.registerCons('IgcSelectComponent', IgcSelectComponent); + case 'WebListModule': { + let { IgcListComponent } = await import('igniteui-webcomponents'); + let { WebListDescriptionModule } = await import('igniteui-core/WebListDescriptionModule'); - WebSelectDescriptionModule.register(cr.context); - this.checkDone(); - break; - } - - case "WebSliderLabelModule": - { - let { IgcSliderLabelComponent } = await import('igniteui-webcomponents'); - let { WebSliderLabelDescriptionModule } = await import('igniteui-core/WebSliderLabelDescriptionModule'); + this._loadingSet.delete(module); - this._loadingSet.delete(module); + IgcListComponent.register(); + TypeRegistrar.registerCons('IgcListComponent', IgcListComponent); - IgcSliderLabelComponent.register(); - TypeRegistrar.registerCons('IgcSliderLabelComponent', IgcSliderLabelComponent); + WebListDescriptionModule.register(cr.context); + this.checkDone(); + break; + } - WebSliderLabelDescriptionModule.register(cr.context); - this.checkDone(); - break; - } - - case "WebSliderModule": - { - let { IgcSliderComponent } = await import('igniteui-webcomponents'); - let { WebSliderDescriptionModule } = await import('igniteui-core/WebSliderDescriptionModule'); + case 'WebMaskInputModule': { + let { IgcMaskInputComponent } = await import('igniteui-webcomponents'); + let { WebMaskInputDescriptionModule } = await import('igniteui-core/WebMaskInputDescriptionModule'); - this._loadingSet.delete(module); + this._loadingSet.delete(module); - IgcSliderComponent.register(); - TypeRegistrar.registerCons('IgcSliderComponent', IgcSliderComponent); + IgcMaskInputComponent.register(); + TypeRegistrar.registerCons('IgcMaskInputComponent', IgcMaskInputComponent); - WebSliderDescriptionModule.register(cr.context); - this.checkDone(); - break; - } - - case "WebSnackbarModule": - { - let { IgcSnackbarComponent } = await import('igniteui-webcomponents'); - let { WebSnackbarDescriptionModule } = await import('igniteui-core/WebSnackbarDescriptionModule'); + WebMaskInputDescriptionModule.register(cr.context); + this.checkDone(); + break; + } - this._loadingSet.delete(module); + case 'WebNavDrawerHeaderItemModule': { + let { IgcNavDrawerHeaderItemComponent } = await import('igniteui-webcomponents'); + let { WebNavDrawerHeaderItemDescriptionModule } = + await import('igniteui-core/WebNavDrawerHeaderItemDescriptionModule'); - IgcSnackbarComponent.register(); - TypeRegistrar.registerCons('IgcSnackbarComponent', IgcSnackbarComponent); + this._loadingSet.delete(module); - WebSnackbarDescriptionModule.register(cr.context); - this.checkDone(); - break; - } - - case "WebSplitterModule": - { - let { IgcSplitterComponent } = await import('igniteui-webcomponents'); - let { WebSplitterDescriptionModule } = await import('igniteui-core/WebSplitterDescriptionModule'); + IgcNavDrawerHeaderItemComponent.register(); + TypeRegistrar.registerCons('IgcNavDrawerHeaderItemComponent', IgcNavDrawerHeaderItemComponent); - this._loadingSet.delete(module); + WebNavDrawerHeaderItemDescriptionModule.register(cr.context); + this.checkDone(); + break; + } - IgcSplitterComponent.register(); - TypeRegistrar.registerCons('IgcSplitterComponent', IgcSplitterComponent); + case 'WebNavDrawerItemModule': { + let { IgcNavDrawerItemComponent } = await import('igniteui-webcomponents'); + let { WebNavDrawerItemDescriptionModule } = await import('igniteui-core/WebNavDrawerItemDescriptionModule'); - WebSplitterDescriptionModule.register(cr.context); - this.checkDone(); - break; - } - - case "WebStepModule": - { - let { IgcStepComponent } = await import('igniteui-webcomponents'); - let { WebStepDescriptionModule } = await import('igniteui-core/WebStepDescriptionModule'); + this._loadingSet.delete(module); - this._loadingSet.delete(module); + IgcNavDrawerItemComponent.register(); + TypeRegistrar.registerCons('IgcNavDrawerItemComponent', IgcNavDrawerItemComponent); - IgcStepComponent.register(); - TypeRegistrar.registerCons('IgcStepComponent', IgcStepComponent); + WebNavDrawerItemDescriptionModule.register(cr.context); + this.checkDone(); + break; + } - WebStepDescriptionModule.register(cr.context); - this.checkDone(); - break; - } - - case "WebStepperModule": - { - let { IgcStepperComponent } = await import('igniteui-webcomponents'); - let { WebStepperDescriptionModule } = await import('igniteui-core/WebStepperDescriptionModule'); + case 'WebNavDrawerModule': { + let { IgcNavDrawerComponent } = await import('igniteui-webcomponents'); + let { WebNavDrawerDescriptionModule } = await import('igniteui-core/WebNavDrawerDescriptionModule'); - this._loadingSet.delete(module); + this._loadingSet.delete(module); - IgcStepperComponent.register(); - TypeRegistrar.registerCons('IgcStepperComponent', IgcStepperComponent); + IgcNavDrawerComponent.register(); + TypeRegistrar.registerCons('IgcNavDrawerComponent', IgcNavDrawerComponent); - WebStepperDescriptionModule.register(cr.context); - this.checkDone(); - break; - } - - case "WebSwitchModule": - { - let { IgcSwitchComponent } = await import('igniteui-webcomponents'); - let { WebSwitchDescriptionModule } = await import('igniteui-core/WebSwitchDescriptionModule'); + WebNavDrawerDescriptionModule.register(cr.context); + this.checkDone(); + break; + } - this._loadingSet.delete(module); + case 'WebNavbarModule': { + let { IgcNavbarComponent } = await import('igniteui-webcomponents'); + let { WebNavbarDescriptionModule } = await import('igniteui-core/WebNavbarDescriptionModule'); - IgcSwitchComponent.register(); - TypeRegistrar.registerCons('IgcSwitchComponent', IgcSwitchComponent); + this._loadingSet.delete(module); - WebSwitchDescriptionModule.register(cr.context); - this.checkDone(); - break; - } - - case "WebTabModule": - { - let { IgcTabComponent } = await import('igniteui-webcomponents'); - let { WebTabDescriptionModule } = await import('igniteui-core/WebTabDescriptionModule'); + IgcNavbarComponent.register(); + TypeRegistrar.registerCons('IgcNavbarComponent', IgcNavbarComponent); - this._loadingSet.delete(module); + WebNavbarDescriptionModule.register(cr.context); + this.checkDone(); + break; + } - IgcTabComponent.register(); - TypeRegistrar.registerCons('IgcTabComponent', IgcTabComponent); + case 'NumberFormatSpecifierModule': + let { IgcNumberFormatSpecifierModule } = await import('igniteui-core/igc-number-format-specifier-module'); + let { NumberFormatSpecifierDescriptionModule } = + await import('igniteui-core/NumberFormatSpecifierDescriptionModule'); + this._loadingSet.delete(module); + ModuleManager.register(IgcNumberFormatSpecifierModule); + NumberFormatSpecifierDescriptionModule.register(cr.context); + this.checkDone(); + break; - WebTabDescriptionModule.register(cr.context); - this.checkDone(); - break; - } - - case "WebTabsModule": - { - let { IgcTabsComponent } = await import('igniteui-webcomponents'); - let { WebTabsDescriptionModule } = await import('igniteui-core/WebTabsDescriptionModule'); + case 'WebRadioGroupModule': { + let { IgcRadioGroupComponent } = await import('igniteui-webcomponents'); + let { WebRadioGroupDescriptionModule } = await import('igniteui-core/WebRadioGroupDescriptionModule'); - this._loadingSet.delete(module); + this._loadingSet.delete(module); - IgcTabsComponent.register(); - TypeRegistrar.registerCons('IgcTabsComponent', IgcTabsComponent); + IgcRadioGroupComponent.register(); + TypeRegistrar.registerCons('IgcRadioGroupComponent', IgcRadioGroupComponent); - WebTabsDescriptionModule.register(cr.context); - this.checkDone(); - break; - } - - case "WebTextareaModule": - { - let { IgcTextareaComponent } = await import('igniteui-webcomponents'); - let { WebTextareaDescriptionModule } = await import('igniteui-core/WebTextareaDescriptionModule'); + WebRadioGroupDescriptionModule.register(cr.context); + this.checkDone(); + break; + } - this._loadingSet.delete(module); + case 'WebRadioModule': { + let { IgcRadioComponent } = await import('igniteui-webcomponents'); + let { WebRadioDescriptionModule } = await import('igniteui-core/WebRadioDescriptionModule'); - IgcTextareaComponent.register(); - TypeRegistrar.registerCons('IgcTextareaComponent', IgcTextareaComponent); + this._loadingSet.delete(module); - WebTextareaDescriptionModule.register(cr.context); - this.checkDone(); - break; - } - - case "WebThemeProviderModule": - { - let { IgcThemeProviderComponent } = await import('igniteui-webcomponents'); - let { WebThemeProviderDescriptionModule } = await import('igniteui-core/WebThemeProviderDescriptionModule'); + IgcRadioComponent.register(); + TypeRegistrar.registerCons('IgcRadioComponent', IgcRadioComponent); - this._loadingSet.delete(module); + WebRadioDescriptionModule.register(cr.context); + this.checkDone(); + break; + } - IgcThemeProviderComponent.register(); - TypeRegistrar.registerCons('IgcThemeProviderComponent', IgcThemeProviderComponent); + case 'WebRangeSliderModule': { + let { IgcRangeSliderComponent } = await import('igniteui-webcomponents'); + let { WebRangeSliderDescriptionModule } = await import('igniteui-core/WebRangeSliderDescriptionModule'); - WebThemeProviderDescriptionModule.register(cr.context); - this.checkDone(); - break; - } - - case "WebTileManagerModule": - { - let { IgcTileManagerComponent } = await import('igniteui-webcomponents'); - let { WebTileManagerDescriptionModule } = await import('igniteui-core/WebTileManagerDescriptionModule'); + this._loadingSet.delete(module); - this._loadingSet.delete(module); + IgcRangeSliderComponent.register(); + TypeRegistrar.registerCons('IgcRangeSliderComponent', IgcRangeSliderComponent); - IgcTileManagerComponent.register(); - TypeRegistrar.registerCons('IgcTileManagerComponent', IgcTileManagerComponent); + WebRangeSliderDescriptionModule.register(cr.context); + this.checkDone(); + break; + } - WebTileManagerDescriptionModule.register(cr.context); - this.checkDone(); - break; - } - - case "WebTileModule": - { - let { IgcTileComponent } = await import('igniteui-webcomponents'); - let { WebTileDescriptionModule } = await import('igniteui-core/WebTileDescriptionModule'); + case 'WebRatingModule': { + let { IgcRatingComponent } = await import('igniteui-webcomponents'); + let { WebRatingDescriptionModule } = await import('igniteui-core/WebRatingDescriptionModule'); - this._loadingSet.delete(module); + this._loadingSet.delete(module); - IgcTileComponent.register(); - TypeRegistrar.registerCons('IgcTileComponent', IgcTileComponent); + IgcRatingComponent.register(); + TypeRegistrar.registerCons('IgcRatingComponent', IgcRatingComponent); - WebTileDescriptionModule.register(cr.context); - this.checkDone(); - break; - } - - case "WebToastModule": - { - let { IgcToastComponent } = await import('igniteui-webcomponents'); - let { WebToastDescriptionModule } = await import('igniteui-core/WebToastDescriptionModule'); + WebRatingDescriptionModule.register(cr.context); + this.checkDone(); + break; + } - this._loadingSet.delete(module); + case 'WebRatingSymbolModule': { + let { IgcRatingSymbolComponent } = await import('igniteui-webcomponents'); + let { WebRatingSymbolDescriptionModule } = await import('igniteui-core/WebRatingSymbolDescriptionModule'); - IgcToastComponent.register(); - TypeRegistrar.registerCons('IgcToastComponent', IgcToastComponent); + this._loadingSet.delete(module); - WebToastDescriptionModule.register(cr.context); - this.checkDone(); - break; - } - - case "WebToggleButtonModule": - { - let { IgcToggleButtonComponent } = await import('igniteui-webcomponents'); - let { WebToggleButtonDescriptionModule } = await import('igniteui-core/WebToggleButtonDescriptionModule'); + IgcRatingSymbolComponent.register(); + TypeRegistrar.registerCons('IgcRatingSymbolComponent', IgcRatingSymbolComponent); - this._loadingSet.delete(module); + WebRatingSymbolDescriptionModule.register(cr.context); + this.checkDone(); + break; + } - IgcToggleButtonComponent.register(); - TypeRegistrar.registerCons('IgcToggleButtonComponent', IgcToggleButtonComponent); + case 'WebRippleModule': { + let { IgcRippleComponent } = await import('igniteui-webcomponents'); + let { WebRippleDescriptionModule } = await import('igniteui-core/WebRippleDescriptionModule'); - WebToggleButtonDescriptionModule.register(cr.context); - this.checkDone(); - break; - } - - case "WebTooltipModule": - { - let { IgcTooltipComponent } = await import('igniteui-webcomponents'); - let { WebTooltipDescriptionModule } = await import('igniteui-core/WebTooltipDescriptionModule'); + this._loadingSet.delete(module); - this._loadingSet.delete(module); + IgcRippleComponent.register(); + TypeRegistrar.registerCons('IgcRippleComponent', IgcRippleComponent); - IgcTooltipComponent.register(); - TypeRegistrar.registerCons('IgcTooltipComponent', IgcTooltipComponent); + WebRippleDescriptionModule.register(cr.context); + this.checkDone(); + break; + } - WebTooltipDescriptionModule.register(cr.context); - this.checkDone(); - break; - } - - case "WebTreeItemModule": - { - let { IgcTreeItemComponent } = await import('igniteui-webcomponents'); - let { WebTreeItemDescriptionModule } = await import('igniteui-core/WebTreeItemDescriptionModule'); + case 'WebSelectGroupModule': { + let { IgcSelectGroupComponent } = await import('igniteui-webcomponents'); + let { WebSelectGroupDescriptionModule } = await import('igniteui-core/WebSelectGroupDescriptionModule'); - this._loadingSet.delete(module); + this._loadingSet.delete(module); - IgcTreeItemComponent.register(); - TypeRegistrar.registerCons('IgcTreeItemComponent', IgcTreeItemComponent); + IgcSelectGroupComponent.register(); + TypeRegistrar.registerCons('IgcSelectGroupComponent', IgcSelectGroupComponent); - WebTreeItemDescriptionModule.register(cr.context); - this.checkDone(); - break; - } - - case "WebTreeModule": - { - let { IgcTreeComponent } = await import('igniteui-webcomponents'); - let { WebTreeDescriptionModule } = await import('igniteui-core/WebTreeDescriptionModule'); + WebSelectGroupDescriptionModule.register(cr.context); + this.checkDone(); + break; + } - this._loadingSet.delete(module); + case 'WebSelectHeaderModule': { + let { IgcSelectHeaderComponent } = await import('igniteui-webcomponents'); + let { WebSelectHeaderDescriptionModule } = await import('igniteui-core/WebSelectHeaderDescriptionModule'); - IgcTreeComponent.register(); - TypeRegistrar.registerCons('IgcTreeComponent', IgcTreeComponent); + this._loadingSet.delete(module); - WebTreeDescriptionModule.register(cr.context); - this.checkDone(); - break; - } - -//@@ModuleLoadingEnd + IgcSelectHeaderComponent.register(); + TypeRegistrar.registerCons('IgcSelectHeaderComponent', IgcSelectHeaderComponent); + + WebSelectHeaderDescriptionModule.register(cr.context); + this.checkDone(); + break; } - } - private static marshalIdByValueOnceSet: Map = new Map(); - public static marshalIdByValueOnce(id: string, event: string) { - if (!Loader.marshalIdByValueOnceSet.has(id)) { - Loader.marshalIdByValueOnceSet.set(id, event); - } - } + case 'WebSelectItemModule': { + let { IgcSelectItemComponent } = await import('igniteui-webcomponents'); + let { WebSelectItemDescriptionModule } = await import('igniteui-core/WebSelectItemDescriptionModule'); - public static isMarshalIdByValueOnce(id: string): boolean { - return Loader.marshalIdByValueOnceSet.has(id); - } + this._loadingSet.delete(module); - public static clearMarshalIdByValueOnceByEvent(event: string) { - if (event) { - Loader.marshalIdByValueOnceSet.forEach((v, k, m) => { - if (v === event) { - Loader.marshalIdByValueOnceSet.delete(k); - } - }); - return; - } - Loader.marshalIdByValueOnceSet.clear(); - } + IgcSelectItemComponent.register(); + TypeRegistrar.registerCons('IgcSelectItemComponent', IgcSelectItemComponent); - private static marshalByValueSet: Set = null; - public static isMarshalByValue(val: any) { - if (val == null || val == undefined) { - return false; - } - // if (val.___mustPassByValue) { - // return true; - // } + WebSelectItemDescriptionModule.register(cr.context); + this.checkDone(); + break; + } - if (val._implementation && val._implementation.___mustPassByValue) { - return true; - } + case 'WebSelectModule': { + let { IgcSelectComponent } = await import('igniteui-webcomponents'); + let { WebSelectDescriptionModule } = await import('igniteui-core/WebSelectDescriptionModule'); - var name: string = null; + this._loadingSet.delete(module); - if (val.$type) { - name = val.$type.name; - } - - if (val._implementation && val._implementation.$type) { - //sometimes we seem to slap a $type tag on a public type, and it blocks - //traversal to the implementation name here. - name = val._implementation.$type.name; - } + IgcSelectComponent.register(); + TypeRegistrar.registerCons('IgcSelectComponent', IgcSelectComponent); - if (!name) { - return false; - } + WebSelectDescriptionModule.register(cr.context); + this.checkDone(); + break; + } - if (Loader.marshalByValueSet == null) { - Loader.marshalByValueSet = new Set(); -//@@MarshalByValue -Loader.marshalByValueSet.add('CalendarDate'); -Loader.marshalByValueSet.add('CalendarFormatOptions'); -Loader.marshalByValueSet.add('FocusOptions'); -Loader.marshalByValueSet.add('FormatSpecifier'); -Loader.marshalByValueSet.add('NumberFormatSpecifier'); -Loader.marshalByValueSet.add('ActiveStepChangedEventArgs'); -Loader.marshalByValueSet.add('WebActiveStepChangedEventArgs'); -Loader.marshalByValueSet.add('ActiveStepChangedEventArgsDetail'); -Loader.marshalByValueSet.add('WebActiveStepChangedEventArgsDetail'); -Loader.marshalByValueSet.add('ActiveStepChangingEventArgs'); -Loader.marshalByValueSet.add('WebActiveStepChangingEventArgs'); -Loader.marshalByValueSet.add('ActiveStepChangingEventArgsDetail'); -Loader.marshalByValueSet.add('WebActiveStepChangingEventArgsDetail'); -Loader.marshalByValueSet.add('ChatDraftMessage'); -Loader.marshalByValueSet.add('WebChatDraftMessage'); -Loader.marshalByValueSet.add('ChatMessage'); -Loader.marshalByValueSet.add('WebChatMessage'); -Loader.marshalByValueSet.add('ChatMessageAttachment'); -Loader.marshalByValueSet.add('WebChatMessageAttachment'); -Loader.marshalByValueSet.add('ChatMessageAttachmentEventArgs'); -Loader.marshalByValueSet.add('WebChatMessageAttachmentEventArgs'); -Loader.marshalByValueSet.add('ChatMessageEventArgs'); -Loader.marshalByValueSet.add('WebChatMessageEventArgs'); -Loader.marshalByValueSet.add('ChatMessageReaction'); -Loader.marshalByValueSet.add('WebChatMessageReaction'); -Loader.marshalByValueSet.add('ChatMessageReactionEventArgs'); -Loader.marshalByValueSet.add('WebChatMessageReactionEventArgs'); -Loader.marshalByValueSet.add('CheckboxChangeEventArgs'); -Loader.marshalByValueSet.add('WebCheckboxChangeEventArgs'); -Loader.marshalByValueSet.add('CheckboxChangeEventArgsDetail'); -Loader.marshalByValueSet.add('WebCheckboxChangeEventArgsDetail'); -Loader.marshalByValueSet.add('ComboChangeEventArgs'); -Loader.marshalByValueSet.add('WebComboChangeEventArgs'); -Loader.marshalByValueSet.add('ComboChangeEventArgsDetail'); -Loader.marshalByValueSet.add('WebComboChangeEventArgsDetail'); -Loader.marshalByValueSet.add('ComponentBoolValueChangedEventArgs'); -Loader.marshalByValueSet.add('WebComponentBoolValueChangedEventArgs'); -Loader.marshalByValueSet.add('ComponentDateValueChangedEventArgs'); -Loader.marshalByValueSet.add('WebComponentDateValueChangedEventArgs'); -Loader.marshalByValueSet.add('ComponentValueChangedEventArgs'); -Loader.marshalByValueSet.add('WebComponentValueChangedEventArgs'); -Loader.marshalByValueSet.add('DateRangeValueDetail'); -Loader.marshalByValueSet.add('WebDateRangeValueDetail'); -Loader.marshalByValueSet.add('DateRangeValueEventArgs'); -Loader.marshalByValueSet.add('WebDateRangeValueEventArgs'); -Loader.marshalByValueSet.add('DropdownItemComponentEventArgs'); -Loader.marshalByValueSet.add('WebDropdownItemComponentEventArgs'); -Loader.marshalByValueSet.add('ExpansionPanelComponentEventArgs'); -Loader.marshalByValueSet.add('WebExpansionPanelComponentEventArgs'); -Loader.marshalByValueSet.add('HighlightNavigation'); -Loader.marshalByValueSet.add('WebHighlightNavigation'); -Loader.marshalByValueSet.add('IconMeta'); -Loader.marshalByValueSet.add('WebIconMeta'); -Loader.marshalByValueSet.add('NumberEventArgs'); -Loader.marshalByValueSet.add('WebNumberEventArgs'); -Loader.marshalByValueSet.add('RadioChangeEventArgs'); -Loader.marshalByValueSet.add('WebRadioChangeEventArgs'); -Loader.marshalByValueSet.add('RadioChangeEventArgsDetail'); -Loader.marshalByValueSet.add('WebRadioChangeEventArgsDetail'); -Loader.marshalByValueSet.add('RangeSliderValue'); -Loader.marshalByValueSet.add('WebRangeSliderValue'); -Loader.marshalByValueSet.add('SelectItemComponentEventArgs'); -Loader.marshalByValueSet.add('WebSelectItemComponentEventArgs'); -Loader.marshalByValueSet.add('SplitterResizeEventArgs'); -Loader.marshalByValueSet.add('WebSplitterResizeEventArgs'); -Loader.marshalByValueSet.add('SplitterResizeEventArgsDetail'); -Loader.marshalByValueSet.add('WebSplitterResizeEventArgsDetail'); -Loader.marshalByValueSet.add('TabComponentEventArgs'); -Loader.marshalByValueSet.add('WebTabComponentEventArgs'); -Loader.marshalByValueSet.add('TileChangeStateEventArgs'); -Loader.marshalByValueSet.add('WebTileChangeStateEventArgs'); -Loader.marshalByValueSet.add('TileChangeStateEventArgsDetail'); -Loader.marshalByValueSet.add('WebTileChangeStateEventArgsDetail'); -Loader.marshalByValueSet.add('TileComponentEventArgs'); -Loader.marshalByValueSet.add('WebTileComponentEventArgs'); -Loader.marshalByValueSet.add('TreeItemComponentEventArgs'); -Loader.marshalByValueSet.add('WebTreeItemComponentEventArgs'); -Loader.marshalByValueSet.add('TreeSelectionEventArgs'); -Loader.marshalByValueSet.add('WebTreeSelectionEventArgs'); -Loader.marshalByValueSet.add('TreeSelectionEventArgsDetail'); -Loader.marshalByValueSet.add('WebTreeSelectionEventArgsDetail'); - -//@@MarshalByValueEnd - } + case 'WebSliderLabelModule': { + let { IgcSliderLabelComponent } = await import('igniteui-webcomponents'); + let { WebSliderLabelDescriptionModule } = await import('igniteui-core/WebSliderLabelDescriptionModule'); + + this._loadingSet.delete(module); + + IgcSliderLabelComponent.register(); + TypeRegistrar.registerCons('IgcSliderLabelComponent', IgcSliderLabelComponent); + + WebSliderLabelDescriptionModule.register(cr.context); + this.checkDone(); + break; + } + + case 'WebSliderModule': { + let { IgcSliderComponent } = await import('igniteui-webcomponents'); + let { WebSliderDescriptionModule } = await import('igniteui-core/WebSliderDescriptionModule'); + + this._loadingSet.delete(module); + + IgcSliderComponent.register(); + TypeRegistrar.registerCons('IgcSliderComponent', IgcSliderComponent); + + WebSliderDescriptionModule.register(cr.context); + this.checkDone(); + break; + } + + case 'WebSnackbarModule': { + let { IgcSnackbarComponent } = await import('igniteui-webcomponents'); + let { WebSnackbarDescriptionModule } = await import('igniteui-core/WebSnackbarDescriptionModule'); + + this._loadingSet.delete(module); + + IgcSnackbarComponent.register(); + TypeRegistrar.registerCons('IgcSnackbarComponent', IgcSnackbarComponent); + + WebSnackbarDescriptionModule.register(cr.context); + this.checkDone(); + break; + } + + case 'WebSplitterModule': { + let { IgcSplitterComponent } = await import('igniteui-webcomponents'); + let { WebSplitterDescriptionModule } = await import('igniteui-core/WebSplitterDescriptionModule'); + + this._loadingSet.delete(module); + + IgcSplitterComponent.register(); + TypeRegistrar.registerCons('IgcSplitterComponent', IgcSplitterComponent); + + WebSplitterDescriptionModule.register(cr.context); + this.checkDone(); + break; + } + + case 'WebStepModule': { + let { IgcStepComponent } = await import('igniteui-webcomponents'); + let { WebStepDescriptionModule } = await import('igniteui-core/WebStepDescriptionModule'); + + this._loadingSet.delete(module); + + IgcStepComponent.register(); + TypeRegistrar.registerCons('IgcStepComponent', IgcStepComponent); + + WebStepDescriptionModule.register(cr.context); + this.checkDone(); + break; + } + + case 'WebStepperModule': { + let { IgcStepperComponent } = await import('igniteui-webcomponents'); + let { WebStepperDescriptionModule } = await import('igniteui-core/WebStepperDescriptionModule'); + + this._loadingSet.delete(module); + + IgcStepperComponent.register(); + TypeRegistrar.registerCons('IgcStepperComponent', IgcStepperComponent); + + WebStepperDescriptionModule.register(cr.context); + this.checkDone(); + break; + } + + case 'WebSwitchModule': { + let { IgcSwitchComponent } = await import('igniteui-webcomponents'); + let { WebSwitchDescriptionModule } = await import('igniteui-core/WebSwitchDescriptionModule'); + + this._loadingSet.delete(module); + + IgcSwitchComponent.register(); + TypeRegistrar.registerCons('IgcSwitchComponent', IgcSwitchComponent); + + WebSwitchDescriptionModule.register(cr.context); + this.checkDone(); + break; + } + + case 'WebTabModule': { + let { IgcTabComponent } = await import('igniteui-webcomponents'); + let { WebTabDescriptionModule } = await import('igniteui-core/WebTabDescriptionModule'); + + this._loadingSet.delete(module); + + IgcTabComponent.register(); + TypeRegistrar.registerCons('IgcTabComponent', IgcTabComponent); + + WebTabDescriptionModule.register(cr.context); + this.checkDone(); + break; + } + + case 'WebTabsModule': { + let { IgcTabsComponent } = await import('igniteui-webcomponents'); + let { WebTabsDescriptionModule } = await import('igniteui-core/WebTabsDescriptionModule'); + + this._loadingSet.delete(module); + + IgcTabsComponent.register(); + TypeRegistrar.registerCons('IgcTabsComponent', IgcTabsComponent); + + WebTabsDescriptionModule.register(cr.context); + this.checkDone(); + break; + } + + case 'WebTextareaModule': { + let { IgcTextareaComponent } = await import('igniteui-webcomponents'); + let { WebTextareaDescriptionModule } = await import('igniteui-core/WebTextareaDescriptionModule'); + + this._loadingSet.delete(module); + + IgcTextareaComponent.register(); + TypeRegistrar.registerCons('IgcTextareaComponent', IgcTextareaComponent); + + WebTextareaDescriptionModule.register(cr.context); + this.checkDone(); + break; + } + + case 'WebThemeProviderModule': { + let { IgcThemeProviderComponent } = await import('igniteui-webcomponents'); + let { WebThemeProviderDescriptionModule } = await import('igniteui-core/WebThemeProviderDescriptionModule'); + + this._loadingSet.delete(module); + + IgcThemeProviderComponent.register(); + TypeRegistrar.registerCons('IgcThemeProviderComponent', IgcThemeProviderComponent); + + WebThemeProviderDescriptionModule.register(cr.context); + this.checkDone(); + break; + } + + case 'WebTileManagerModule': { + let { IgcTileManagerComponent } = await import('igniteui-webcomponents'); + let { WebTileManagerDescriptionModule } = await import('igniteui-core/WebTileManagerDescriptionModule'); + + this._loadingSet.delete(module); + + IgcTileManagerComponent.register(); + TypeRegistrar.registerCons('IgcTileManagerComponent', IgcTileManagerComponent); + + WebTileManagerDescriptionModule.register(cr.context); + this.checkDone(); + break; + } + + case 'WebTileModule': { + let { IgcTileComponent } = await import('igniteui-webcomponents'); + let { WebTileDescriptionModule } = await import('igniteui-core/WebTileDescriptionModule'); + + this._loadingSet.delete(module); + + IgcTileComponent.register(); + TypeRegistrar.registerCons('IgcTileComponent', IgcTileComponent); + + WebTileDescriptionModule.register(cr.context); + this.checkDone(); + break; + } + + case 'WebToastModule': { + let { IgcToastComponent } = await import('igniteui-webcomponents'); + let { WebToastDescriptionModule } = await import('igniteui-core/WebToastDescriptionModule'); + + this._loadingSet.delete(module); + + IgcToastComponent.register(); + TypeRegistrar.registerCons('IgcToastComponent', IgcToastComponent); + + WebToastDescriptionModule.register(cr.context); + this.checkDone(); + break; + } - return Loader.marshalByValueSet.has(name); + case 'WebToggleButtonModule': { + let { IgcToggleButtonComponent } = await import('igniteui-webcomponents'); + let { WebToggleButtonDescriptionModule } = await import('igniteui-core/WebToggleButtonDescriptionModule'); + + this._loadingSet.delete(module); + + IgcToggleButtonComponent.register(); + TypeRegistrar.registerCons('IgcToggleButtonComponent', IgcToggleButtonComponent); + + WebToggleButtonDescriptionModule.register(cr.context); + this.checkDone(); + break; + } + + case 'WebTooltipModule': { + let { IgcTooltipComponent } = await import('igniteui-webcomponents'); + let { WebTooltipDescriptionModule } = await import('igniteui-core/WebTooltipDescriptionModule'); + + this._loadingSet.delete(module); + + IgcTooltipComponent.register(); + TypeRegistrar.registerCons('IgcTooltipComponent', IgcTooltipComponent); + + WebTooltipDescriptionModule.register(cr.context); + this.checkDone(); + break; + } + + case 'WebTreeItemModule': { + let { IgcTreeItemComponent } = await import('igniteui-webcomponents'); + let { WebTreeItemDescriptionModule } = await import('igniteui-core/WebTreeItemDescriptionModule'); + + this._loadingSet.delete(module); + + IgcTreeItemComponent.register(); + TypeRegistrar.registerCons('IgcTreeItemComponent', IgcTreeItemComponent); + + WebTreeItemDescriptionModule.register(cr.context); + this.checkDone(); + break; + } + + case 'WebTreeModule': { + let { IgcTreeComponent } = await import('igniteui-webcomponents'); + let { WebTreeDescriptionModule } = await import('igniteui-core/WebTreeDescriptionModule'); + + this._loadingSet.delete(module); + + IgcTreeComponent.register(); + TypeRegistrar.registerCons('IgcTreeComponent', IgcTreeComponent); + + WebTreeDescriptionModule.register(cr.context); + this.checkDone(); + break; + } + + //@@ModuleLoadingEnd } + } - private static getContainerIgIdAttribute(container: HTMLElement) { - const igKey = container.getAttribute(Loader.DATA_IG_ID_ATTRIBUTE); - if (!igKey) { - return null; - } - if (igKey.trim().length === 0) { - return null; + private static marshalIdByValueOnceSet: Map = new Map(); + public static marshalIdByValueOnce(id: string, event: string) { + if (!Loader.marshalIdByValueOnceSet.has(id)) { + Loader.marshalIdByValueOnceSet.set(id, event); + } + } + + public static isMarshalIdByValueOnce(id: string): boolean { + return Loader.marshalIdByValueOnceSet.has(id); + } + + public static clearMarshalIdByValueOnceByEvent(event: string) { + if (event) { + Loader.marshalIdByValueOnceSet.forEach((v, k, m) => { + if (v === event) { + Loader.marshalIdByValueOnceSet.delete(k); } - return igKey; + }); + return; } + Loader.marshalIdByValueOnceSet.clear(); + } - private static hasContainerIgIdAttribute(container: any) { - return container && container.hasAttribute && container.hasAttribute(Loader.DATA_IG_ID_ATTRIBUTE); + private static marshalByValueSet: Set = null; + public static isMarshalByValue(val: any) { + if (val == null || val == undefined) { + return false; } + // if (val.___mustPassByValue) { + // return true; + // } - private static DATA_IG_ID_ATTRIBUTE: string = "data-ig-id"; + if (val._implementation && val._implementation.___mustPassByValue) { + return true; + } + + var name: string = null; - public static hasId(obj: any) { - return obj.id || - obj.name || - (obj.tagName && Loader.hasContainerIgIdAttribute(obj)); + if (val.$type) { + name = val.$type.name; } - public static getId(obj: any) { - if (obj.name) { - return obj.name; - } - if (obj.tagName && Loader.hasContainerIgIdAttribute) { - return Loader.getContainerIgIdAttribute(obj); - } - if (obj.id) { - return obj.id; - } - return Loader.getContainerIgIdAttribute(obj); + if (val._implementation && val._implementation.$type) { + //sometimes we seem to slap a $type tag on a public type, and it blocks + //traversal to the implementation name here. + name = val._implementation.$type.name; } - public static transformReturn(retVal: any, root: any, owner: any, key: string) { - if (typeof(retVal) != "object") { - if (key && owner[key] && owner[key] instanceof Date) { - // TFS 273070 - Browsers don't seem to like older dates and will use weird timezone offsets for them. These dates - // are timezone dependent, for example in North American timezones dates before November 1883 will have weird offsets - // where as the UK has a cutoff date at 1847. That is a really hard problem to solve and most people don't seem to - // be using old dates so for now we will just check if the date is a min date and then return the appropriate ISO string - // for it so .NET can parse it correctly. - var minDate = dateMinValue(); - if (owner[key].getTime() === minDate.getTime()) { - function formatTens(num: number): string { - return num < 10 ? "0" + num.toString() : num.toString(); - } - function formatThousands(num: number): string { - if (num < 10) { return "000" + num; } - if (num < 100) { return "00" + num; } - if (num < 1000) { return "0" + num; } - return num.toString(); - } - retVal = - formatThousands(minDate.getFullYear()) + "-" + - formatTens(minDate.getMonth() + 1) + "-" + - formatTens(minDate.getDate()) + "T00:00:00.000"; - } - retVal = { - __bounce: true, - retType: "date", - value: retVal - }; - } - return retVal; - } + if (!name) { + return false; + } - var name = ""; - if (retVal && retVal._implementation) { - if (retVal._implementation.$type) { - name = retVal._implementation.$type.name; - } - } else if (retVal && retVal.$type) { - name = retVal.$type.name; - } + if (Loader.marshalByValueSet == null) { + Loader.marshalByValueSet = new Set(); + //@@MarshalByValue + Loader.marshalByValueSet.add('CalendarDate'); + Loader.marshalByValueSet.add('CalendarFormatOptions'); + Loader.marshalByValueSet.add('FocusOptions'); + Loader.marshalByValueSet.add('FormatSpecifier'); + Loader.marshalByValueSet.add('NumberFormatSpecifier'); + Loader.marshalByValueSet.add('ActiveStepChangedEventArgs'); + Loader.marshalByValueSet.add('WebActiveStepChangedEventArgs'); + Loader.marshalByValueSet.add('ActiveStepChangedEventArgsDetail'); + Loader.marshalByValueSet.add('WebActiveStepChangedEventArgsDetail'); + Loader.marshalByValueSet.add('ActiveStepChangingEventArgs'); + Loader.marshalByValueSet.add('WebActiveStepChangingEventArgs'); + Loader.marshalByValueSet.add('ActiveStepChangingEventArgsDetail'); + Loader.marshalByValueSet.add('WebActiveStepChangingEventArgsDetail'); + Loader.marshalByValueSet.add('ChatDraftMessage'); + Loader.marshalByValueSet.add('WebChatDraftMessage'); + Loader.marshalByValueSet.add('ChatMessage'); + Loader.marshalByValueSet.add('WebChatMessage'); + Loader.marshalByValueSet.add('ChatMessageAttachment'); + Loader.marshalByValueSet.add('WebChatMessageAttachment'); + Loader.marshalByValueSet.add('ChatMessageAttachmentEventArgs'); + Loader.marshalByValueSet.add('WebChatMessageAttachmentEventArgs'); + Loader.marshalByValueSet.add('ChatMessageEventArgs'); + Loader.marshalByValueSet.add('WebChatMessageEventArgs'); + Loader.marshalByValueSet.add('ChatMessageReaction'); + Loader.marshalByValueSet.add('WebChatMessageReaction'); + Loader.marshalByValueSet.add('ChatMessageReactionEventArgs'); + Loader.marshalByValueSet.add('WebChatMessageReactionEventArgs'); + Loader.marshalByValueSet.add('CheckboxChangeEventArgs'); + Loader.marshalByValueSet.add('WebCheckboxChangeEventArgs'); + Loader.marshalByValueSet.add('CheckboxChangeEventArgsDetail'); + Loader.marshalByValueSet.add('WebCheckboxChangeEventArgsDetail'); + Loader.marshalByValueSet.add('ComboChangeEventArgs'); + Loader.marshalByValueSet.add('WebComboChangeEventArgs'); + Loader.marshalByValueSet.add('ComboChangeEventArgsDetail'); + Loader.marshalByValueSet.add('WebComboChangeEventArgsDetail'); + Loader.marshalByValueSet.add('ComponentBoolValueChangedEventArgs'); + Loader.marshalByValueSet.add('WebComponentBoolValueChangedEventArgs'); + Loader.marshalByValueSet.add('ComponentDateValueChangedEventArgs'); + Loader.marshalByValueSet.add('WebComponentDateValueChangedEventArgs'); + Loader.marshalByValueSet.add('ComponentValueChangedEventArgs'); + Loader.marshalByValueSet.add('WebComponentValueChangedEventArgs'); + Loader.marshalByValueSet.add('DateRangeValueDetail'); + Loader.marshalByValueSet.add('WebDateRangeValueDetail'); + Loader.marshalByValueSet.add('DateRangeValueEventArgs'); + Loader.marshalByValueSet.add('WebDateRangeValueEventArgs'); + Loader.marshalByValueSet.add('DropdownItemComponentEventArgs'); + Loader.marshalByValueSet.add('WebDropdownItemComponentEventArgs'); + Loader.marshalByValueSet.add('ExpansionPanelComponentEventArgs'); + Loader.marshalByValueSet.add('WebExpansionPanelComponentEventArgs'); + Loader.marshalByValueSet.add('HighlightNavigation'); + Loader.marshalByValueSet.add('WebHighlightNavigation'); + Loader.marshalByValueSet.add('IconMeta'); + Loader.marshalByValueSet.add('WebIconMeta'); + Loader.marshalByValueSet.add('NumberEventArgs'); + Loader.marshalByValueSet.add('WebNumberEventArgs'); + Loader.marshalByValueSet.add('RadioChangeEventArgs'); + Loader.marshalByValueSet.add('WebRadioChangeEventArgs'); + Loader.marshalByValueSet.add('RadioChangeEventArgsDetail'); + Loader.marshalByValueSet.add('WebRadioChangeEventArgsDetail'); + Loader.marshalByValueSet.add('RangeSliderValue'); + Loader.marshalByValueSet.add('WebRangeSliderValue'); + Loader.marshalByValueSet.add('SelectItemComponentEventArgs'); + Loader.marshalByValueSet.add('WebSelectItemComponentEventArgs'); + Loader.marshalByValueSet.add('SplitterResizeEventArgs'); + Loader.marshalByValueSet.add('WebSplitterResizeEventArgs'); + Loader.marshalByValueSet.add('SplitterResizeEventArgsDetail'); + Loader.marshalByValueSet.add('WebSplitterResizeEventArgsDetail'); + Loader.marshalByValueSet.add('TabComponentEventArgs'); + Loader.marshalByValueSet.add('WebTabComponentEventArgs'); + Loader.marshalByValueSet.add('TileChangeStateEventArgs'); + Loader.marshalByValueSet.add('WebTileChangeStateEventArgs'); + Loader.marshalByValueSet.add('TileChangeStateEventArgsDetail'); + Loader.marshalByValueSet.add('WebTileChangeStateEventArgsDetail'); + Loader.marshalByValueSet.add('TileComponentEventArgs'); + Loader.marshalByValueSet.add('WebTileComponentEventArgs'); + Loader.marshalByValueSet.add('TreeItemComponentEventArgs'); + Loader.marshalByValueSet.add('WebTreeItemComponentEventArgs'); + Loader.marshalByValueSet.add('TreeSelectionEventArgs'); + Loader.marshalByValueSet.add('WebTreeSelectionEventArgs'); + Loader.marshalByValueSet.add('TreeSelectionEventArgsDetail'); + Loader.marshalByValueSet.add('WebTreeSelectionEventArgsDetail'); + + //@@MarshalByValueEnd + } - if (retVal && retVal.___type) { - name = retVal.___type; - } + return Loader.marshalByValueSet.has(name); + } - if (retVal && retVal.createImplementation) { - name = retVal.createImplementation()?.$type?.name; - } + private static getContainerIgIdAttribute(container: HTMLElement) { + const igKey = container.getAttribute(Loader.DATA_IG_ID_ATTRIBUTE); + if (!igKey) { + return null; + } + if (igKey.trim().length === 0) { + return null; + } + return igKey; + } - if (retVal instanceof FormData) { - let keys = []; - let values = []; - retVal.forEach(function(value, key){ - keys.push(key ? key : null); - values.push(value); - }); - - retVal = { - __bounce: true, - retType: "object", - type: "FormData", - value: { - __bounce: true, - ___cloned: true, - keys: keys, - values: values - } - } - return retVal; - } + private static hasContainerIgIdAttribute(container: any) { + return container && container.hasAttribute && container.hasAttribute(Loader.DATA_IG_ID_ATTRIBUTE); + } - var hasName = Loader.hasName(retVal, root); - var mustPassByValue = false; - if (retVal && retVal._implementation && retVal._implementation.___mustPassByValue) { - mustPassByValue = true; - } - - if (Loader.isMarshalByValue(retVal) && (!hasName || mustPassByValue)) { - - // Mainly added for autogen'd columns in the grid but other elements may need this later. When columns are autogen'd they are - // marked as mustPassByValue so Blazor can get a copy of it. However this should only be done once so I've added - // a mustPassByValueOnce flag which will flip mustPassByValue to false. This should make the object pass by reference - // subsequent times when it needs to be marshalled across. - if (retVal._implementation && retVal._implementation.___mustPassByValueOnce) { - if (retVal._implementation.___mustPassByValue) { - retVal._implementation.___mustPassByValue = false; - } - } + private static DATA_IG_ID_ATTRIBUTE: string = 'data-ig-id'; + + public static hasId(obj: any) { + return obj.id || obj.name || (obj.tagName && Loader.hasContainerIgIdAttribute(obj)); + } - retVal = { - __bounce: true, - retType: Array.isArray(retVal) ? "Array" : typeof(retVal), - type: name, - value: retVal + public static getId(obj: any) { + if (obj.name) { + return obj.name; + } + if (obj.tagName && Loader.hasContainerIgIdAttribute) { + return Loader.getContainerIgIdAttribute(obj); + } + if (obj.id) { + return obj.id; + } + return Loader.getContainerIgIdAttribute(obj); + } + + public static transformReturn(retVal: any, root: any, owner: any, key: string) { + if (typeof retVal != 'object') { + if (key && owner[key] && owner[key] instanceof Date) { + // TFS 273070 - Browsers don't seem to like older dates and will use weird timezone offsets for them. These dates + // are timezone dependent, for example in North American timezones dates before November 1883 will have weird offsets + // where as the UK has a cutoff date at 1847. That is a really hard problem to solve and most people don't seem to + // be using old dates so for now we will just check if the date is a min date and then return the appropriate ISO string + // for it so .NET can parse it correctly. + var minDate = dateMinValue(); + if (owner[key].getTime() === minDate.getTime()) { + function formatTens(num: number): string { + return num < 10 ? '0' + num.toString() : num.toString(); + } + function formatThousands(num: number): string { + if (num < 10) { + return '000' + num; } - } else { - if (retVal && retVal.___id && !Loader.isMarshalIdByValueOnce(retVal.___id)) { - retVal = { refType: "uuid", id: retVal.___id }; - } else if (hasName) { - retVal = { refType: "name", id: Loader.getName(retVal, root) }; - } else if (retVal && retVal.___localJson) { - retVal = { __bounce: true, retType: "localJson", value: retVal }; - } else { - retVal = { - __bounce: true, - retType: Array.isArray(retVal) ? "Array" : typeof(retVal), - type: name, - value: retVal - } + if (num < 100) { + return '00' + num; } - } - return retVal; + if (num < 1000) { + return '0' + num; + } + return num.toString(); + } + retVal = + formatThousands(minDate.getFullYear()) + + '-' + + formatTens(minDate.getMonth() + 1) + + '-' + + formatTens(minDate.getDate()) + + 'T00:00:00.000'; + } + retVal = { + __bounce: true, + retType: 'date', + value: retVal, + }; + } + return retVal; } - private static isRoot(value: any, root: any) { - if (value === root) { - return true; - } - if (value.i && - value.i.nativeElement) { - var nat = value.i.nativeElement; - if (nat.___wcElement) { - nat = nat.___wcElement; - } - if (nat == root) { - return true; - } - } - return false; + var name = ''; + if (retVal && retVal._implementation) { + if (retVal._implementation.$type) { + name = retVal._implementation.$type.name; + } + } else if (retVal && retVal.$type) { + name = retVal.$type.name; } - private static getName(value: any, root: any) { - if (!value) { - return null; - } - if (value && (value._styling || value._implementation) && value.name) { - return value.name; - } - if (Loader.isRoot(value, root)) { - return "mainControl"; - } - if (value && !value._implementation && (Loader.hasId(value)) && value.tagName && value.tagName.toLowerCase().indexOf("igc-") == 0) { - return Loader.getId(value); - } - if (value && value.i && value.i.nativeElement) { - var nat = value.i.nativeElement; - if (nat.___wcElement) { - nat = nat.___wcElement; - } - return Loader.getName(nat,root); - } - return null; + if (retVal && retVal.___type) { + name = retVal.___type; } - private static hasName(value: any, root: any) { - if (!value) { - return false; - } - var hasName = false; - if (value && (value._styling || value._implementation) && value.name) { - hasName = true; - return hasName; - } - if (Loader.isRoot(value, root)) { - hasName = true; - } - if (value && !value._implementation && (Loader.hasId(value)) && value.tagName && value.tagName.toLowerCase().indexOf("igc-") == 0) { - hasName = true; - } - if (value && value.i && value.i.nativeElement) { - var nat = value.i.nativeElement; - if (nat.___wcElement) { - nat = nat.___wcElement; - } - return Loader.hasName(nat, root); - } - return hasName; + if (retVal && retVal.createImplementation) { + name = retVal.createImplementation()?.$type?.name; } - - private static getClone(value: any, root: any, seen: Map) { - if (seen.has(value)) { - return seen.get(value); - } + if (retVal instanceof FormData) { + let keys = []; + let values = []; + retVal.forEach(function (value, key) { + keys.push(key ? key : null); + values.push(value); + }); + + retVal = { + __bounce: true, + retType: 'object', + type: 'FormData', + value: { + __bounce: true, + ___cloned: true, + keys: keys, + values: values, + }, + }; + return retVal; + } - var isCollection = false; - if (value && !value.___cloned && value.count !== undefined && typeof (value.count) !== 'function' && value.item) { - isCollection = true; - let retArr = []; - for (let j = 0; j < value.count; j++) { - retArr.push(Loader.getClone(value.item(j), root, seen)); - } - value = retArr; - return value; - } + var hasName = Loader.hasName(retVal, root); + var mustPassByValue = false; + if (retVal && retVal._implementation && retVal._implementation.___mustPassByValue) { + mustPassByValue = true; + } - if (value instanceof FormData) { - return value; + if (Loader.isMarshalByValue(retVal) && (!hasName || mustPassByValue)) { + // Mainly added for autogen'd columns in the grid but other elements may need this later. When columns are autogen'd they are + // marked as mustPassByValue so Blazor can get a copy of it. However this should only be done once so I've added + // a mustPassByValueOnce flag which will flip mustPassByValue to false. This should make the object pass by reference + // subsequent times when it needs to be marshalled across. + if (retVal._implementation && retVal._implementation.___mustPassByValueOnce) { + if (retVal._implementation.___mustPassByValue) { + retVal._implementation.___mustPassByValue = false; } + } - var hasName = Loader.hasName(value, root); - var mustPassByValue = false; - var neverPassByValue = false; - if (value && value._implementation && value._implementation.___mustPassByValue) { - mustPassByValue = true; - } - if (value && value._implementation && value._implementation.___neverPassByValue) { - neverPassByValue = true; - } + retVal = { + __bounce: true, + retType: Array.isArray(retVal) ? 'Array' : typeof retVal, + type: name, + value: retVal, + }; + } else { + if (retVal && retVal.___id && !Loader.isMarshalIdByValueOnce(retVal.___id)) { + retVal = { refType: 'uuid', id: retVal.___id }; + } else if (hasName) { + retVal = { refType: 'name', id: Loader.getName(retVal, root) }; + } else if (retVal && retVal.___localJson) { + retVal = { __bounce: true, retType: 'localJson', value: retVal }; + } else { + retVal = { + __bounce: true, + retType: Array.isArray(retVal) ? 'Array' : typeof retVal, + type: name, + value: retVal, + }; + } + } + return retVal; + } - if (!Array.isArray(value) && - value != null && value != undefined && - typeof(value) == "object" && !Loader.isRoot(value, root) && (!hasName || mustPassByValue) && !value.___cloned) { + private static isRoot(value: any, root: any) { + if (value === root) { + return true; + } + if (value.i && value.i.nativeElement) { + var nat = value.i.nativeElement; + if (nat.___wcElement) { + nat = nat.___wcElement; + } + if (nat == root) { + return true; + } + } + return false; + } - if (!hasName && neverPassByValue) { - return null; - } - //console.log(value); - - if (value instanceof Date) { - return value; - } + private static getName(value: any, root: any) { + if (!value) { + return null; + } + if (value && (value._styling || value._implementation) && value.name) { + return value.name; + } + if (Loader.isRoot(value, root)) { + return 'mainControl'; + } + if ( + value && + !value._implementation && + Loader.hasId(value) && + value.tagName && + value.tagName.toLowerCase().indexOf('igc-') == 0 + ) { + return Loader.getId(value); + } + if (value && value.i && value.i.nativeElement) { + var nat = value.i.nativeElement; + if (nat.___wcElement) { + nat = nat.___wcElement; + } + return Loader.getName(nat, root); + } + return null; + } - var inVal = value; - value = {}; - value.___cloned = true; - seen.set(inVal, value); - - if (inVal.$type && inVal.$type.name == "Point") { - value.x = inVal.x; - value.y = inVal.y; - } else if (!inVal.$type && !inVal._implementation && - inVal.x !== undefined && - inVal.y !== undefined) { - value.___type = "Point"; - value.x = inVal.x; - value.y = inVal.y; - } else if (inVal.$type && inVal.$type.name == "Rect") { - value.left = inVal.left; - value.top = inVal.top; - value.width = inVal.width; - value.height = inVal.height; - } else if (!inVal.$type && !inVal._implementation && - inVal.left !== undefined && - inVal.top !== undefined && - inVal.width !== undefined && - inVal.height !== undefined) { - value.___type = "Rect"; - value.left = inVal.left; - value.top = inVal.top; - value.width = inVal.width; - value.height = inVal.height; - } else if (inVal.$type && inVal.$type.name == "Size") { - value.width = inVal.width; - value.height = inVal.height; - } else if (!inVal.$type && !inVal._implementation && - inVal.width !== undefined && - inVal.height !== undefined) { - value.___type = "Size"; - value.width = inVal.width; - value.height = inVal.height; - } else if (inVal.___localJson) { - for (var copyKey of Object.keys(inVal)) { - value[copyKey] = inVal[copyKey]; - } - } else { - // looping through prototype props - let seenProps = new Set(); - for (var copyKey of getAllPropertyNames(inVal)) { - if (copyKey == "$type" || copyKey == "_implementation" || copyKey == "constructor" || copyKey == "seriesInternal" || - copyKey == "prototype" || copyKey == "__proto__" || copyKey == "externalObject" || copyKey == "i") { - continue; - } - seenProps.add(copyKey); - if (typeof(inVal[copyKey] == "object")) { - value[copyKey] = Loader.getClone(inVal[copyKey], root, seen); - } else { - value[copyKey] = inVal[copyKey]; - } - } + private static hasName(value: any, root: any) { + if (!value) { + return false; + } + var hasName = false; + if (value && (value._styling || value._implementation) && value.name) { + hasName = true; + return hasName; + } + if (Loader.isRoot(value, root)) { + hasName = true; + } + if ( + value && + !value._implementation && + Loader.hasId(value) && + value.tagName && + value.tagName.toLowerCase().indexOf('igc-') == 0 + ) { + hasName = true; + } + if (value && value.i && value.i.nativeElement) { + var nat = value.i.nativeElement; + if (nat.___wcElement) { + nat = nat.___wcElement; + } + return Loader.hasName(nat, root); + } + return hasName; + } - // looping through local props - if (!inVal.$type && !inVal._implementation) { - // don't need to come in here for X# types since those will have been cloned above - for (var copyKey of Object.keys(inVal)) { - if (copyKey == "$type" || copyKey == "_implementation" || copyKey == "constructor" || - copyKey == "prototype" || copyKey == "__proto__" || copyKey == "externalObject" || copyKey == "i") { - continue; - } - // ignore keys we copied previously. - if (!seenProps.has(copyKey)) { - if (typeof(inVal[copyKey] == "object")) { - if (document && inVal[copyKey] === document) { - value[copyKey] = null; - } else { - value[copyKey] = Loader.getClone(inVal[copyKey], root, seen); - } - } else { - value[copyKey] = inVal[copyKey]; - } - } - } - } - } - if (inVal.type) { - value.type = inVal.type; - } - if (inVal.$type) { - value.$type = inVal.$type; - } - if (inVal.__bounce) { - value.__bounce = inVal.__bounce; - } - if (inVal.value) { - if (typeof(inVal[copyKey] == "object")) { - value.value = Loader.getClone(inVal.value, root, seen); - } else { - value.value = inVal.value; - } - } - if (inVal.retType) { - value.retType = inVal.retType; - } - if (inVal.refType) { - value.refType = inVal.refType; - } - if (inVal.id) { - value.id = inVal.id; - } else { - if (Loader.hasId(inVal)) { - value.id = Loader.getId(inVal); - } - } - if (inVal._implementation) { - value._implementation = inVal._implementation; - } - // if (inVal.constructor) { - // value.constructor = inVal.constructor; - // } - if (inVal.___id) { - value.___id = inVal.___id; - } - } + private static getClone(value: any, root: any, seen: Map) { + if (seen.has(value)) { + return seen.get(value); + } - return value; + var isCollection = false; + if (value && !value.___cloned && value.count !== undefined && typeof value.count !== 'function' && value.item) { + isCollection = true; + let retArr = []; + for (let j = 0; j < value.count; j++) { + retArr.push(Loader.getClone(value.item(j), root, seen)); + } + value = retArr; + return value; } - private static replacerFunc(key: string, value: any, owner: any, root: any, seen: Map) { - var ignoreSet: Set = null; + if (value instanceof FormData) { + return value; + } - var isCollection = false; + var hasName = Loader.hasName(value, root); + var mustPassByValue = false; + var neverPassByValue = false; + if (value && value._implementation && value._implementation.___mustPassByValue) { + mustPassByValue = true; + } + if (value && value._implementation && value._implementation.___neverPassByValue) { + neverPassByValue = true; + } - if (key == "__bounce") { - return undefined; - } - if (key == "_implementation") { - return undefined; - } - if (key.indexOf("_") == 0 || key.indexOf("$") == 0) { - if (key != "___id") { - return undefined; - } - } + if ( + !Array.isArray(value) && + value != null && + value != undefined && + typeof value == 'object' && + !Loader.isRoot(value, root) && + (!hasName || mustPassByValue) && + !value.___cloned + ) { + if (!hasName && neverPassByValue) { + return null; + } + //console.log(value); + + if (value instanceof Date) { + return value; + } - if (owner) { - let c = undefined; - if (owner.$type) { - c = owner.$type.InstanceConstructor; - } else if (owner._implementation && owner._implementation.$type) { - c = owner._implementation.$type.InstanceConstructor; + var inVal = value; + value = {}; + value.___cloned = true; + seen.set(inVal, value); + + if (inVal.$type && inVal.$type.name == 'Point') { + value.x = inVal.x; + value.y = inVal.y; + } else if (!inVal.$type && !inVal._implementation && inVal.x !== undefined && inVal.y !== undefined) { + value.___type = 'Point'; + value.x = inVal.x; + value.y = inVal.y; + } else if (inVal.$type && inVal.$type.name == 'Rect') { + value.left = inVal.left; + value.top = inVal.top; + value.width = inVal.width; + value.height = inVal.height; + } else if ( + !inVal.$type && + !inVal._implementation && + inVal.left !== undefined && + inVal.top !== undefined && + inVal.width !== undefined && + inVal.height !== undefined + ) { + value.___type = 'Rect'; + value.left = inVal.left; + value.top = inVal.top; + value.width = inVal.width; + value.height = inVal.height; + } else if (inVal.$type && inVal.$type.name == 'Size') { + value.width = inVal.width; + value.height = inVal.height; + } else if (!inVal.$type && !inVal._implementation && inVal.width !== undefined && inVal.height !== undefined) { + value.___type = 'Size'; + value.width = inVal.width; + value.height = inVal.height; + } else if (inVal.___localJson) { + for (var copyKey of Object.keys(inVal)) { + value[copyKey] = inVal[copyKey]; + } + } else { + // looping through prototype props + let seenProps = new Set(); + for (var copyKey of getAllPropertyNames(inVal)) { + if ( + copyKey == '$type' || + copyKey == '_implementation' || + copyKey == 'constructor' || + copyKey == 'seriesInternal' || + copyKey == 'prototype' || + copyKey == '__proto__' || + copyKey == 'externalObject' || + copyKey == 'i' + ) { + continue; + } + seenProps.add(copyKey); + if (typeof (inVal[copyKey] == 'object')) { + value[copyKey] = Loader.getClone(inVal[copyKey], root, seen); + } else { + value[copyKey] = inVal[copyKey]; + } + } + + // looping through local props + if (!inVal.$type && !inVal._implementation) { + // don't need to come in here for X# types since those will have been cloned above + for (var copyKey of Object.keys(inVal)) { + if ( + copyKey == '$type' || + copyKey == '_implementation' || + copyKey == 'constructor' || + copyKey == 'prototype' || + copyKey == '__proto__' || + copyKey == 'externalObject' || + copyKey == 'i' + ) { + continue; } - if (c && (c as any).__marshalByValueIgnore) { - if (c && (c as any).__marshalByValueIgnoreSet) { - ignoreSet = (c as any).__marshalByValueIgnoreSet; + // ignore keys we copied previously. + if (!seenProps.has(copyKey)) { + if (typeof (inVal[copyKey] == 'object')) { + if (document && inVal[copyKey] === document) { + value[copyKey] = null; } else { - ignoreSet = new Set(); - for (var i = 0; i < (c as any).__marshalByValueIgnore.length; i++) { - ignoreSet.add((c as any).__marshalByValueIgnore[i]); - } - (c as any).__marshalByValueIgnoreSet = ignoreSet; + value[copyKey] = Loader.getClone(inVal[copyKey], root, seen); } + } else { + value[copyKey] = inVal[copyKey]; + } } + } } - - if (ignoreSet && ignoreSet.has(key)) { - return undefined; + } + if (inVal.type) { + value.type = inVal.type; + } + if (inVal.$type) { + value.$type = inVal.$type; + } + if (inVal.__bounce) { + value.__bounce = inVal.__bounce; + } + if (inVal.value) { + if (typeof (inVal[copyKey] == 'object')) { + value.value = Loader.getClone(inVal.value, root, seen); + } else { + value.value = inVal.value; } - - if (value && !value.___cloned && value.count && typeof (value.count) !== 'function' && value.item) { - isCollection = true; - let retArr = []; - for (let j = 0; j < value.count; j++) { - retArr.push(Loader.getClone(value.item(j), root, seen)); - } - value = retArr; + } + if (inVal.retType) { + value.retType = inVal.retType; + } + if (inVal.refType) { + value.refType = inVal.refType; + } + if (inVal.id) { + value.id = inVal.id; + } else { + if (Loader.hasId(inVal)) { + value.id = Loader.getId(inVal); } + } + if (inVal._implementation) { + value._implementation = inVal._implementation; + } + // if (inVal.constructor) { + // value.constructor = inVal.constructor; + // } + if (inVal.___id) { + value.___id = inVal.___id; + } + } - if (!isCollection) { - value = Loader.getClone(value, root, seen); - } - - var bounce = owner && owner.__bounce && owner.__bounce == true; + return value; + } - + private static replacerFunc(key: string, value: any, owner: any, root: any, seen: Map) { + var ignoreSet: Set = null; - if (bounce && key == "value") { - return value; - } + var isCollection = false; - return this.transformReturn(value, root, owner, key); + if (key == '__bounce') { + return undefined; + } + if (key == '_implementation') { + return undefined; + } + if (key.indexOf('_') == 0 || key.indexOf('$') == 0) { + if (key != '___id') { + return undefined; + } } - - public static stringify(val: any, root: any) { - var self = this; - var seen = new Map(); - function doReplace(key, value) { - return self.replacerFunc(key, value, this, root, seen); + if (owner) { + let c = undefined; + if (owner.$type) { + c = owner.$type.InstanceConstructor; + } else if (owner._implementation && owner._implementation.$type) { + c = owner._implementation.$type.InstanceConstructor; + } + if (c && (c as any).__marshalByValueIgnore) { + if (c && (c as any).__marshalByValueIgnoreSet) { + ignoreSet = (c as any).__marshalByValueIgnoreSet; + } else { + ignoreSet = new Set(); + for (var i = 0; i < (c as any).__marshalByValueIgnore.length; i++) { + ignoreSet.add((c as any).__marshalByValueIgnore[i]); + } + (c as any).__marshalByValueIgnoreSet = ignoreSet; } + } + } - return JSON.stringify(val, doReplace); + if (ignoreSet && ignoreSet.has(key)) { + return undefined; } - - public loadingPromise: Promise = null; - private loadingPromiseResolve: () => void = null; - private loadingPromiseReject: () => void = null; - - private checkDone() { - if (!this.isLoading) { - if (this.loadingPromise) { - this.loadingPromiseResolve(); - this.loadingPromise = null; - this.loadingPromiseResolve = null; - this.loadingPromiseReject = null; - } + + if (value && !value.___cloned && value.count && typeof value.count !== 'function' && value.item) { + isCollection = true; + let retArr = []; + for (let j = 0; j < value.count; j++) { + retArr.push(Loader.getClone(value.item(j), root, seen)); } + value = retArr; } - - public has(module: string) { - return this._moduleSet.has(module); + + if (!isCollection) { + value = Loader.getClone(value, root, seen); } - - public get isLoading(): boolean { - return this._loadingSet.size > 0; + + var bounce = owner && owner.__bounce && owner.__bounce == true; + + if (bounce && key == 'value') { + return value; } - } \ No newline at end of file + + return this.transformReturn(value, root, owner, key); + } + + public static stringify(val: any, root: any) { + var self = this; + var seen = new Map(); + function doReplace(key, value) { + return self.replacerFunc(key, value, this, root, seen); + } + + return JSON.stringify(val, doReplace); + } + + public loadingPromise: Promise = null; + private loadingPromiseResolve: () => void = null; + private loadingPromiseReject: () => void = null; + + private checkDone() { + if (!this.isLoading) { + if (this.loadingPromise) { + this.loadingPromiseResolve(); + this.loadingPromise = null; + this.loadingPromiseResolve = null; + this.loadingPromiseReject = null; + } + } + } + + public has(module: string) { + return this._moduleSet.has(module); + } + + public get isLoading(): boolean { + return this._loadingSet.size > 0; + } +} diff --git a/src/src/index.ts b/src/src/index.ts index 47bfefea..4d70ec9a 100644 --- a/src/src/index.ts +++ b/src/src/index.ts @@ -12,25 +12,25 @@ import { refValues, itemMaps } from './refs-state'; IgcPortalModule.register(); (window as any).igTemplating = { - html: html -} + html: html, +}; -let cr = new ComponentRenderer() +let cr = new ComponentRenderer(); ComponentRenderer.defaultInstance = cr; (cr.adapter as any).isBlazorRenderer = true; -const DATA_IG_ID_ATTRIBUTE = "data-ig-id"; +const DATA_IG_ID_ATTRIBUTE = 'data-ig-id'; let containers: Map = new Map(); let containersDirect: Map = new Map(); let containersPendingRefs: Map void)[]> = new Map void)[]>(); let containersPendingDataRefs: Map void)[]> = new Map void)[]>(); function getContainer(id: string): HTMLElement { let cont = containers.get(id); - if (!cont) { - return null; - } + if (!cont) { + return null; + } if (!containersDirect.has(id)) { - if (cont.tagName.toUpperCase() == "IGC-COMPONENT-RENDERER-CONTAINER") { + if (cont.tagName.toUpperCase() == 'IGC-COMPONENT-RENDERER-CONTAINER') { containersDirect.set(id, false); } else { containersDirect.set(id, true); @@ -48,26 +48,25 @@ function getContainerByIgIdAttribute(id) { cr.addNamespaceLookupListener(getContainerId); cr.shouldNamespaceSystemRefValues = true; - -cr.addPropertyUpdatingListener("options", (p, t, v) => { +cr.addPropertyUpdatingListener('options', (p, t, v) => { /* hack to prevent igc-chat from automatically storing new messages in its internal collection - * which causes problems with the sync between Blazor and the web component. - */ - if (t.tagName === "IGC-CHAT") { + * which causes problems with the sync between Blazor and the web component. + */ + if (t.tagName === 'IGC-CHAT') { if (t.addEventListener) { let chat = t as any; if (!chat.___igcMessageCreatedPreventDefaultHandler) { chat.___igcMessageCreatedPreventDefaultHandler = (e: Event) => { e.preventDefault(); }; - chat.addEventListener("igcMessageCreated", chat.___igcMessageCreatedPreventDefaultHandler); + chat.addEventListener('igcMessageCreated', chat.___igcMessageCreatedPreventDefaultHandler); } } } }); cr.addReferenceLookupListener((container, refType, value) => { - if (refType == "uuid") { + if (refType == 'uuid') { var retVal = null; itemMaps.forEach((v, k, map) => { if (v.has(value)) { @@ -98,9 +97,9 @@ let isSyncMethodInvoke: boolean = false; var isDotNet = true; async function callDotNet(webCallback, methodName: string, ...args: any[]): Promise { - if (isDotNet) { - return await webCallback.invokeMethodAsync(methodName, currentContainerName, ...args); - } + if (isDotNet) { + return await webCallback.invokeMethodAsync(methodName, currentContainerName, ...args); + } } (window as any).igWaitForLoaded = async function waitForLoaded() { @@ -115,12 +114,17 @@ async function callDotNet(webCallback, methodName: string, ...args: any[]): Prom Loader.instance.request(module, cr); }; -(window as any).igSetResourceString = function setResourceString(type: string, grouping: string, id: string, value: string) { +(window as any).igSetResourceString = function setResourceString( + type: string, + grouping: string, + id: string, + value: string, +) { switch (type) { - case "set": + case 'set': Loader.instance.setResourceString(grouping, id, value); break; - case "register": + case 'register': Loader.instance.registerResource(grouping, JSON.parse(value)); break; } @@ -139,7 +143,7 @@ function isContainerDirectRender(): boolean { function getMainTarget() { let cont = currentContainer(); - + if (!containersDirect.get(currentContainerName)) { return cont.children[0]; } else { @@ -161,7 +165,7 @@ function copyProperties(target: any, source: any) { function findByName(node: any, name: string) { let root = node; - if (name == "mainControl") { + if (name == 'mainControl') { return root; } @@ -217,7 +221,7 @@ function findByName(node: any, name: string) { return null; } -let convertReturnValue = function(retVal: any): any { +let convertReturnValue = function (retVal: any): any { // if (Loader.isMarshalByValue(retVal)) { // retVal = Loader.stringify(retVal); // } else { @@ -234,41 +238,41 @@ let convertReturnValue = function(retVal: any): any { // } // retVal = JSON.stringify(retVal); // } - // } - - if (typeof(retVal) == "number") { - return JSON.stringify({ retType: "number", value: retVal}); - } else if (typeof(retVal) == "string") { - return JSON.stringify({ retType: "string", value: retVal}); - } else if (typeof(retVal) == "boolean") { - return JSON.stringify({ retType: "boolean", value: retVal}); + // } + + if (typeof retVal == 'number') { + return JSON.stringify({ retType: 'number', value: retVal }); + } else if (typeof retVal == 'string') { + return JSON.stringify({ retType: 'string', value: retVal }); + } else if (typeof retVal == 'boolean') { + return JSON.stringify({ retType: 'boolean', value: retVal }); } else if (retVal instanceof Date) { if (retVal.getTime() === dateMinValue().getTime()) { - retVal = "0001-01-01T00:00:00.000Z"; + retVal = '0001-01-01T00:00:00.000Z'; } - return JSON.stringify({ retType: "date", value: retVal}); - } + return JSON.stringify({ retType: 'date', value: retVal }); + } if (retVal == null) { - return JSON.stringify({ retType: "object", type: "", value: null}); + return JSON.stringify({ retType: 'object', type: '', value: null }); } return Loader.stringify(retVal, getMainTarget()); }; -let toReturn = function(retVal: any): any { - if (typeof(retVal) == "number") { - return { retType: "number", value: retVal}; - } else if (typeof(retVal) == "string") { - return { retType: "string", value: retVal}; - } else if (typeof(retVal) == "boolean") { - return { retType: "boolean", value: retVal}; +let toReturn = function (retVal: any): any { + if (typeof retVal == 'number') { + return { retType: 'number', value: retVal }; + } else if (typeof retVal == 'string') { + return { retType: 'string', value: retVal }; + } else if (typeof retVal == 'boolean') { + return { retType: 'boolean', value: retVal }; } else if (retVal instanceof Date) { - return { retType: "date", value: retVal}; + return { retType: 'date', value: retVal }; } if (retVal == null) { - return { retType: "object", type: "", value: null}; + return { retType: 'object', type: '', value: null }; } return JSON.parse(Loader.stringify(retVal, getMainTarget())); @@ -281,15 +285,15 @@ function toSimpleArgs(args: CustomEvent) { class SimpleCustomEvent { detail: any = {}; - }; - + } + let newArgs = new SimpleCustomEvent(); //HACK: we need to fix the stringify to include non prototypal keys. But I'm not doing that right now. - if (typeof(args.detail) == "object" && args.detail !== null && !args.detail.tagName) { + if (typeof args.detail == 'object' && args.detail !== null && !args.detail.tagName) { args.detail.___cloned = true; } - newArgs.detail = typeof(args.detail) == "object" ? toReturn(args.detail) : args.detail; + newArgs.detail = typeof args.detail == 'object' ? toReturn(args.detail) : args.detail; return newArgs; } @@ -298,9 +302,9 @@ function markupCustomArgs(origArgs, args) { if (origArgs instanceof CustomEvent) { if (origArgs.target && origArgs.target instanceof HTMLElement) { let ele = origArgs.target as HTMLElement; - if (ele.tagName.toLowerCase() == "igc-combo") { - if (origArgs.type == "igcChange") { - args.detail.type = "WebComboChangeEventArgsDetail" + if (ele.tagName.toLowerCase() == 'igc-combo') { + if (origArgs.type == 'igcChange') { + args.detail.type = 'WebComboChangeEventArgsDetail'; } } } @@ -311,7 +315,7 @@ function flattenArgs(args, forceSimple?) { if (args === null || args === undefined) { return null; } - if (!(typeof(args) == "object")) { + if (!(typeof args == 'object')) { args = toReturn(args); return args; } @@ -338,23 +342,23 @@ function flattenArgs(args, forceSimple?) { function expandDateColumns(item: any, source: any, itemIndex: number = 0, startIndex: number = 0) { if (Array.isArray(item)) { - if (source.__dateColumnsCache) { - let cache = source.__dateColumnsCache.columns[itemIndex]; - (item as any).__dateColumnsCache = {}; - (item as any).__dateColumnsCache.columns = cache; - } - - for (let i = 0; i < item.length; i++) { - expandDateColumns(item[i], item); - } - return; + if (source.__dateColumnsCache) { + let cache = source.__dateColumnsCache.columns[itemIndex]; + (item as any).__dateColumnsCache = {}; + (item as any).__dateColumnsCache.columns = cache; + } + + for (let i = 0; i < item.length; i++) { + expandDateColumns(item[i], item); + } + return; } if (source.__dateColumnsCache) { - for (let i = startIndex; i < source.__dateColumnsCache.columns.length; i++) { - let propPath = source.__dateColumnsCache.columns[i]; - expandDateColumn(item, propPath); - } + for (let i = startIndex; i < source.__dateColumnsCache.columns.length; i++) { + let propPath = source.__dateColumnsCache.columns[i]; + expandDateColumn(item, propPath); + } } } @@ -364,13 +368,13 @@ function expandDateColumn(item: any, path: string) { expandDateColumn(item[i], path); } } else { - if (path.includes(".")) { - let propName = path.split(".")[0]; - if (propName.includes("[]")) { - let arr = item[propName.replace("[]", "")]; - expandDateColumn(arr, path.replace(`${propName}.`, "")); + if (path.includes('.')) { + let propName = path.split('.')[0]; + if (propName.includes('[]')) { + let arr = item[propName.replace('[]', '')]; + expandDateColumn(arr, path.replace(`${propName}.`, '')); } else { - expandDateColumn(item[propName], path.replace(`${propName}.`, "")); + expandDateColumn(item[propName], path.replace(`${propName}.`, '')); } } else { if (item[path]) { @@ -382,7 +386,15 @@ function expandDateColumn(item: any, path: string) { let dynamicContentBatch: any[] = []; let dynamicContentBatchPending = false; -var adjustDynamicContent = function (containerId: string, contentType: string, templateId: string, contentId: string, actionType: string, webCallback, args: any) { +var adjustDynamicContent = function ( + containerId: string, + contentType: string, + templateId: string, + contentId: string, + actionType: string, + webCallback, + args: any, +) { updateContainer(containerId); dynamicContentBatch.push({ containerId: containerId, @@ -390,20 +402,20 @@ var adjustDynamicContent = function (containerId: string, contentType: string, t templateId: templateId, contentId: contentId, actionType: actionType, - args: flattenArgs(args) + args: flattenArgs(args), }); if (dynamicContentBatchPending) { return; } dynamicContentBatchPending = true; - + window.setTimeout(() => { dynamicContentBatchPending = false; var arg = JSON.stringify(dynamicContentBatch); dynamicContentBatch.length = 0; currentContainerName = containerId; - callDotNet(webCallback, "AdjustDynamicContentBatch", arg); + callDotNet(webCallback, 'AdjustDynamicContentBatch', arg); }, 0); }; @@ -422,14 +434,14 @@ function getContainerIgIdAttribute(container: HTMLElement) { } function raiseEventImpl(propertyName: string, sender: any, args: any, containerName: any, webCallback) { - let name: string = "mainControl"; + let name: string = 'mainControl'; let cont = sender; if (!args && (sender instanceof CustomEvent || sender instanceof UIEvent)) { - args = sender; - updateContainer(containerName); - sender = getMainTarget(); - cont = getContainerByIgIdAttribute(containerName); + args = sender; + updateContainer(containerName); + sender = getMainTarget(); + cont = getContainerByIgIdAttribute(containerName); } let isWrapper = !(sender instanceof HTMLElement) && sender.i && sender.i.nativeElement; @@ -470,32 +482,44 @@ function raiseEventImpl(propertyName: string, sender: any, args: any, containerN } else { outerArgs = flattenArgs(args, args instanceof UIEvent); } - + Loader.clearMarshalIdByValueOnceByEvent(propertyName); - try - { - (window as any).raisingEvent = true; + try { + (window as any).raisingEvent = true; - callDotNet(webCallback, "OnRaiseEvent", name, propertyName, JSON.stringify({ sender: sender, args: outerArgs })); - if ((window as any).webViewCallback) { - ((window as any).webViewCallback).onRaiseEvent(name, propertyName, JSON.stringify({ sender: sender, args: outerArgs })); - } - if ((window as any).webkit && (window as any).webkit.messageHandlers && (window as any).webkit.messageHandlers.raiseEvent) { - (window as any).webkit.messageHandlers.raiseEvent.postMessage({ name: name, propertyName: propertyName, sender: sender, args: outerArgs }); - } - } finally { - (window as any).raisingEvent = false; + callDotNet(webCallback, 'OnRaiseEvent', name, propertyName, JSON.stringify({ sender: sender, args: outerArgs })); + if ((window as any).webViewCallback) { + (window as any).webViewCallback.onRaiseEvent( + name, + propertyName, + JSON.stringify({ sender: sender, args: outerArgs }), + ); + } + if ( + (window as any).webkit && + (window as any).webkit.messageHandlers && + (window as any).webkit.messageHandlers.raiseEvent + ) { + (window as any).webkit.messageHandlers.raiseEvent.postMessage({ + name: name, + propertyName: propertyName, + sender: sender, + args: outerArgs, + }); + } + } finally { + (window as any).raisingEvent = false; } } var raiseEvent = function (propertyName: string, sender: any, args: any, containerName: any, webCallback) { - let resolvedBehavior = "queued"; + let resolvedBehavior = 'queued'; if (eventBehaviors.has(containerName)) { resolvedBehavior = eventBehaviors.get(containerName); } - - if (isSyncMethodInvoke || resolvedBehavior === "queued") { + + if (isSyncMethodInvoke || resolvedBehavior === 'queued') { window.setTimeout(() => { raiseEventImpl(propertyName, sender, args, containerName, webCallback); }, 0); @@ -504,7 +528,10 @@ var raiseEvent = function (propertyName: string, sender: any, args: any, contain } }; -let igScripts: Map = new Map(); +let igScripts: Map = new Map< + string, + { shouldCall: boolean; func: Function } +>(); (window as any).igRegisterScript = function (scriptId: string, script: Function, shouldCall: boolean = true) { igScripts.set(scriptId, { shouldCall: shouldCall, func: script }); }; @@ -515,10 +542,10 @@ let igScripts: Map = new Map 0 && refValue[0][key]) { - processDataIntentsHelper(refValue[0][key], dataIntents[key].subIntents); - } + if (refValue.length > 0 && refValue[0][key]) { + processDataIntentsHelper(refValue[0][key], dataIntents[key].subIntents); + } } else { intent[key] = dataIntents[key]; } @@ -623,8 +650,8 @@ function ensureExternalObject(target: any) { } if (target && target._implementation) { - // we are already an external type. - return target; + // we are already an external type. + return target; } if (!target || !target.tagName) { @@ -632,34 +659,34 @@ function ensureExternalObject(target: any) { } let typeNameWithoutComponent = fromSpinal(target.tagName.toLowerCase()); - let typeName = typeNameWithoutComponent + "Component"; - + let typeName = typeNameWithoutComponent + 'Component'; + if (TypeRegistrar.isRegistered(typeName)) { - let ret = TypeRegistrar.create(typeName); - target.externlObject = ret; - if (ret.setNativeElement) { - ret.setNativeElement(target); - } - if (ret.provideImplementation) { - ret.provideImplementation(target); - } else { - ret._implementation = target; - } - return ret; + let ret = TypeRegistrar.create(typeName); + target.externlObject = ret; + if (ret.setNativeElement) { + ret.setNativeElement(target); + } + if (ret.provideImplementation) { + ret.provideImplementation(target); + } else { + ret._implementation = target; + } + return ret; } typeName = typeNameWithoutComponent; - + if (TypeRegistrar.isRegistered(typeName)) { - let ret = TypeRegistrar.create(typeName); - target.externlObject = ret; - if (ret.setNativeElement) { - ret.setNativeElement(target); - } - if (ret.provideImplementation) { - ret.provideImplementation(target); - } - return ret; + let ret = TypeRegistrar.create(typeName); + target.externlObject = ret; + if (ret.setNativeElement) { + ret.setNativeElement(target); + } + if (ret.provideImplementation) { + ret.provideImplementation(target); + } + return ret; } return target; @@ -677,11 +704,11 @@ function updateAngularElement(element: any) { (window as any).igSendMessage = function (containerId: string, json: string, webCallback: any, nativeElements: any[]) { updateContainer(containerId); let m = JSON.parse(json); - + switch (m.type) { - case "description": + case 'description': let desc = m.description; - let ms = { descriptions: {"root": desc } }; + let ms = { descriptions: { root: desc } }; cr.loadJson(JSON.stringify(ms), (c) => currentContainer()); if (cr.hasErrors()) { let errors = cr.getErrors(); @@ -699,7 +726,7 @@ function updateAngularElement(element: any) { } } break; - case "cleanup": + case 'cleanup': var container = currentContainer(); if (container != null) { if (isContainerDirectRender()) { @@ -739,339 +766,335 @@ function updateAngularElement(element: any) { } } break; - case "descriptionDelta": - let descDelta = m.description; - let skipApply = m.skipApply; - let msDelta = { descriptions: {"root": descDelta } }; + case 'descriptionDelta': + let descDelta = m.description; + let skipApply = m.skipApply; + let msDelta = { descriptions: { root: descDelta } }; - cr.loadJsonDelta(JSON.stringify(msDelta), (c) => currentContainer(), skipApply); - if (cr.hasErrors()) { - let errors = cr.getErrors(); - cr.clearErrors(); - for (let ei = 0; ei < errors.length; ei++) { - let error = errors[ei]; - console.error(error); - } + cr.loadJsonDelta(JSON.stringify(msDelta), (c) => currentContainer(), skipApply); + if (cr.hasErrors()) { + let errors = cr.getErrors(); + cr.clearErrors(); + for (let ei = 0; ei < errors.length; ei++) { + let error = errors[ei]; + console.error(error); } + } - if (containersPendingRefs.has(containerId)) { - let arr = containersPendingRefs.get(containerId); - containersPendingRefs.delete(containerId); - for (let j = 0; j < arr.length; j++) { - arr[j](); - } + if (containersPendingRefs.has(containerId)) { + let arr = containersPendingRefs.get(containerId); + containersPendingRefs.delete(containerId); + for (let j = 0; j < arr.length; j++) { + arr[j](); } - break; - case "refChanged": + } + break; + case 'refChanged': { let refName = m.refName; const originalRefVal = m.refValue; let refValue = m.refValue; - - if (typeof(refValue) == "string" && - refValue.indexOf("json:::") == 0) { - refValue = refValue.substring("json:::".length); - - fetch(refValue).then((d) => { - d.json().then(dj => { - refValue = dj; - cr.provideRefValue(currentContainer(), refName, refValue); - refValues.set(refName, refValue); - for (let i = 0; i < refValue.length; i++) { - refValue[i].___localJson = true; - } - }); - }) - } else { - if (typeof(refValue) == "string" && - refValue.indexOf("containerId:::") == 0) { - refValue = refValue.substring("containerId:::".length); - if (containers.has(refValue) && containers.get(refValue).children.length > 0) { - refValue = containers.get(refValue).children[0]; - } else { - if (!containersPendingRefs.has(refValue)) { - containersPendingRefs.set(refValue, []); - } - let arr = containersPendingRefs.get(refValue); - let cc = currentContainer(); - arr.push(() => { - refValue = containers.get(refValue).children[0]; - cr.provideRefValue(cc, refName, refValue); - refValues.set(refName, refValue); - }); - return; - } - } - if (typeof(refValue) == "string" && - refValue.indexOf("literalJson:::") == 0) { - refValue = refValue.substring("literalJson:::".length); - refValue = JSON.parse(refValue); - } - if (typeof(refValue) == "string" && - refValue.indexOf("localJson:::") == 0) { - refValue = refValue.substring("localJson:::".length); - refValue = JSON.parse(refValue); + if (typeof refValue == 'string' && refValue.indexOf('json:::') == 0) { + refValue = refValue.substring('json:::'.length); + + fetch(refValue).then((d) => { + d.json().then((dj) => { + refValue = dj; + cr.provideRefValue(currentContainer(), refName, refValue); + refValues.set(refName, refValue); for (let i = 0; i < refValue.length; i++) { refValue[i].___localJson = true; } - } - if (typeof(refValue) == "string" && - refValue.indexOf("script:::") == 0) { - refValue = refValue.substring("script:::".length); - let scriptRef = refValue; - if (!igScripts.has(refValue)) { - return; - } - var f = igScripts.get(refValue); - if (f.shouldCall && typeof(f.func) == "function") { - refValue = f.func(); - } else { - refValue = f.func; - } - if (refValue && - typeof(refValue) == "function") { - (refValue as any).___fromScript = true; - (refValue as any).___fromScriptId = scriptRef; - - if (getMainTarget() != null && - isContainerDirectRender()) { - // attached and raises client-side event for direct render components - let target = getMainTarget(); - let isNativeEvent = originalRefVal.indexOf("nativeEvent:::") == 0; - const refs = refName.split("/"); - let actualEvent = refs[refs.length - 1]; - if (actualEvent.endsWith("Ocurred")) { - actualEvent = actualEvent.replace("Ocurred", ""); - } - if (actualEvent.toLowerCase() == "selectionchanged") { - actualEvent = "Selection"; - } - let directEvent = isNativeEvent ? actualEvent.toLowerCase() : "igc" + actualEvent; - if (directEvents.has(refName)) { - target.removeEventListener(directEvent, directEvents.get(refName)[1]) - } - target.addEventListener(directEvent, refValue); - directEvents.set(refName, [directEvent, refValue]); - } + }); + }); + } else { + if (typeof refValue == 'string' && refValue.indexOf('containerId:::') == 0) { + refValue = refValue.substring('containerId:::'.length); + if (containers.has(refValue) && containers.get(refValue).children.length > 0) { + refValue = containers.get(refValue).children[0]; + } else { + if (!containersPendingRefs.has(refValue)) { + containersPendingRefs.set(refValue, []); } + let arr = containersPendingRefs.get(refValue); + let cc = currentContainer(); + arr.push(() => { + refValue = containers.get(refValue).children[0]; + cr.provideRefValue(cc, refName, refValue); + refValues.set(refName, refValue); + }); + return; + } } - if ( - refValue == null && - getMainTarget() != null && - isContainerDirectRender()) { - if (directEvents.has(refName)) { - let target = getMainTarget(); - target.removeEventListener(directEvents.get(refName)[0], directEvents.get(refName)[1]); - directEvents.delete(refName); + if (typeof refValue == 'string' && refValue.indexOf('literalJson:::') == 0) { + refValue = refValue.substring('literalJson:::'.length); + refValue = JSON.parse(refValue); + } + if (typeof refValue == 'string' && refValue.indexOf('localJson:::') == 0) { + refValue = refValue.substring('localJson:::'.length); + refValue = JSON.parse(refValue); + + for (let i = 0; i < refValue.length; i++) { + refValue[i].___localJson = true; } + } + if (typeof refValue == 'string' && refValue.indexOf('script:::') == 0) { + refValue = refValue.substring('script:::'.length); + let scriptRef = refValue; + if (!igScripts.has(refValue)) { + return; + } + var f = igScripts.get(refValue); + if (f.shouldCall && typeof f.func == 'function') { + refValue = f.func(); + } else { + refValue = f.func; } + if (refValue && typeof refValue == 'function') { + (refValue as any).___fromScript = true; + (refValue as any).___fromScriptId = scriptRef; - if (typeof(refValue) == "string" && - (refValue.indexOf("event:::") == 0 || - refValue.indexOf("nativeEvent:::") == 0)) { - let isNativeEvent = refValue.indexOf("nativeEvent:::") == 0; - refValue = isNativeEvent ? - refValue.substring("nativeEvent:::".length): - refValue.substring("event:::".length); - var eventName = refValue; - if (getMainTarget() != null && - isContainerDirectRender()) { - // attached and raises server-side event for direct render components + if (getMainTarget() != null && isContainerDirectRender()) { + // attached and raises client-side event for direct render components let target = getMainTarget(); - refValue = function (args) { - raiseEvent(eventName, target, isNativeEvent ? null : args, containerId, webCallback); + let isNativeEvent = originalRefVal.indexOf('nativeEvent:::') == 0; + const refs = refName.split('/'); + let actualEvent = refs[refs.length - 1]; + if (actualEvent.endsWith('Ocurred')) { + actualEvent = actualEvent.replace('Ocurred', ''); } - } else { - let target = getMainTarget(); - refValue = function (sender, args) { - raiseEvent(eventName, sender, isNativeEvent ? null : args, containerId, webCallback); + if (actualEvent.toLowerCase() == 'selectionchanged') { + actualEvent = 'Selection'; } - } - - if (getMainTarget() != null && - isContainerDirectRender()) { - let actualEvent = eventName; - if (eventName.endsWith("Ocurred")) { - actualEvent = actualEvent.replace("Ocurred", ""); - //TODO: this must come from metadata. - } - if (eventName.toLowerCase() == "selectionchanged") { - actualEvent = "Selection"; - } - let directEvent = isNativeEvent ? actualEvent.toLowerCase() : "igc" + actualEvent; - let target = getMainTarget(); - - // 28717 - .net8 exposed a bug we had where if you assign a handler in Blazor and then assign a different - // handler we don't clean up the first handler. Our Blazor API doesn't allow multiple event handlers attached - // to a single event so we need to cleanup the previous handler if exists. + let directEvent = isNativeEvent ? actualEvent.toLowerCase() : 'igc' + actualEvent; if (directEvents.has(refName)) { - target.removeEventListener(directEvent, directEvents.get(refName)[1]) + target.removeEventListener(directEvent, directEvents.get(refName)[1]); } - target.addEventListener(directEvent, refValue); directEvents.set(refName, [directEvent, refValue]); } - if (m.eventBehavior) { - eventBehaviors.set(containerId, m.eventBehavior); - } + } + } + if (refValue == null && getMainTarget() != null && isContainerDirectRender()) { + if (directEvents.has(refName)) { + let target = getMainTarget(); + target.removeEventListener(directEvents.get(refName)[0], directEvents.get(refName)[1]); + directEvents.delete(refName); + } } - if (typeof(refValue) == "string" && - refValue.indexOf("template:::") == 0) { - refValue = refValue.substring("template:::".length); - if (refValues.has(refName) && refValues.get(refName).__templateId == refValue) { - refValue = refValues.get(refName); - } else { - var currTemplate = null; - var templateId = refValue; - refValue = function (context) { - if (currTemplate.___container.__disposed) { - return noChange; + if ( + typeof refValue == 'string' && + (refValue.indexOf('event:::') == 0 || refValue.indexOf('nativeEvent:::') == 0) + ) { + let isNativeEvent = refValue.indexOf('nativeEvent:::') == 0; + refValue = isNativeEvent + ? refValue.substring('nativeEvent:::'.length) + : refValue.substring('event:::'.length); + var eventName = refValue; + if (getMainTarget() != null && isContainerDirectRender()) { + // attached and raises server-side event for direct render components + let target = getMainTarget(); + refValue = function (args) { + raiseEvent(eventName, target, isNativeEvent ? null : args, containerId, webCallback); + }; + } else { + let target = getMainTarget(); + refValue = function (sender, args) { + raiseEvent(eventName, sender, isNativeEvent ? null : args, containerId, webCallback); + }; + } + + if (getMainTarget() != null && isContainerDirectRender()) { + let actualEvent = eventName; + if (eventName.endsWith('Ocurred')) { + actualEvent = actualEvent.replace('Ocurred', ''); + //TODO: this must come from metadata. + } + if (eventName.toLowerCase() == 'selectionchanged') { + actualEvent = 'Selection'; + } + let directEvent = isNativeEvent ? actualEvent.toLowerCase() : 'igc' + actualEvent; + let target = getMainTarget(); + + // 28717 - .net8 exposed a bug we had where if you assign a handler in Blazor and then assign a different + // handler we don't clean up the first handler. Our Blazor API doesn't allow multiple event handlers attached + // to a single event so we need to cleanup the previous handler if exists. + if (directEvents.has(refName)) { + target.removeEventListener(directEvent, directEvents.get(refName)[1]); + } + + target.addEventListener(directEvent, refValue); + directEvents.set(refName, [directEvent, refValue]); + } + if (m.eventBehavior) { + eventBehaviors.set(containerId, m.eventBehavior); + } + } + if (typeof refValue == 'string' && refValue.indexOf('template:::') == 0) { + refValue = refValue.substring('template:::'.length); + if (refValues.has(refName) && refValues.get(refName).__templateId == refValue) { + refValue = refValues.get(refName); + } else { + var currTemplate = null; + var templateId = refValue; + refValue = function (context) { + if (currTemplate.___container.__disposed) { + return noChange; + } + if (!context) { + return html`
`; + } + let contentId = context.___contentId; + if ( + context.___immediate || + (context.i && context.i.___immediate) || + (context.i && context.i.nativeElement && context.i.nativeElement.___immediate) + ) { + let innerContext = context; + if (!contentId && context.i && context.i.___contentId) { + contentId = context.i.___contentId; + innerContext = context.i; } - if (!context) { - return html`
`; + if (!contentId && context.i && context.i.nativeElement && context.i.nativeElement.___contentId) { + contentId = context.i.nativeElement.___contentId; + innerContext = context.i.nativeElement; } - let contentId = context.___contentId; - if (context.___immediate || - (context.i && context.i.___immediate) || - (context.i && context.i.nativeElement && context.i.nativeElement.___immediate)) { - let innerContext = context; - if (!contentId && context.i && context.i.___contentId) { - contentId = context.i.___contentId; - innerContext = context.i; - } - if (!contentId && context.i && context.i.nativeElement && context.i.nativeElement.___contentId) { - contentId = context.i.nativeElement.___contentId; - innerContext = context.i.nativeElement; - } - var template = currTemplate; - if (!template.___currentContextMap) { - template.___currentContextMap = new Map(); - } - let currentContext: any = null; - if (template.___currentContextMap.has(contentId)) { - currentContext = template.___currentContextMap.get(contentId); + var template = currTemplate; + if (!template.___currentContextMap) { + template.___currentContextMap = new Map(); + } + let currentContext: any = null; + if (template.___currentContextMap.has(contentId)) { + currentContext = template.___currentContextMap.get(contentId); + } + const hasImplicit = Object.getPrototypeOf(context).hasOwnProperty('implicit'); + if (hasImplicit || currentContext !== innerContext) { + template.___currentContextMap.set(contentId, innerContext); + adjustDynamicContent( + template.___containerId, + 'TemplateContent', + template.___templateId, + contentId, + 'Update', + webCallback, + context, + ); + } + if (innerContext.___root) { + let root = innerContext.___root; + if (!root.___host) { + var host = root.querySelector('#' + 'host-' + contentId); + if (host) { + root.___host = host; + template.___checkHost(template, root, root.___host); } - const hasImplicit = Object.getPrototypeOf(context).hasOwnProperty('implicit'); - if (hasImplicit || currentContext !== innerContext) { - template.___currentContextMap.set(contentId, innerContext); - adjustDynamicContent(template.___containerId, - "TemplateContent", - template.___templateId, - contentId, - "Update", - webCallback, - context); + } else { + if (root.___host) { + template.___checkHost(template, root, root.___host); } - if (innerContext.___root) { - let root = innerContext.___root; - if (!root.___host) { - var host = root.querySelector("#" + 'host-' + contentId); - if (host) { - root.___host = host; - template.___checkHost(template, root, root.___host); - } - } else { - if (root.___host) { - template.___checkHost(template, root, root.___host); - } + } + } + } + return html`
`; + }; + currTemplate = refValue; + refValue.___isBridged = true; + refValue.___templateId = templateId; + refValue.___containerId = currentContainerName; + refValue.___container = currentContainer(); + refValue.___onTemplateInit = (template, templateContent) => { + let mut = createMutationObserver((list) => { + for (var mutation of list) { + if (mutation.type == 'childList') { + var host = templateContent.querySelector('#' + 'host-' + templateContent._id); + templateContent.___host = host; + if (template.___checkHost(template, templateContent, templateContent.___host)) { + mut.disconnect(); + mut = null; + if (mut2) { + mut2.disconnect(); + mut2 = null; } } + break; + } } - return html`
-
`; - }; - currTemplate = refValue; - refValue.___isBridged = true; - refValue.___templateId = templateId; - refValue.___containerId = currentContainerName; - refValue.___container = currentContainer(); - refValue.___onTemplateInit = (template, templateContent) => { - let mut = createMutationObserver((list) => { - for (var mutation of list) { - if (mutation.type == 'childList') { - var host = templateContent.querySelector("#" + 'host-' + templateContent._id); - templateContent.___host = host; - if (template.___checkHost(template, templateContent, templateContent.___host)) { - mut.disconnect(); - mut = null; - if (mut2) { - mut2.disconnect(); - mut2 = null; - } - } - break; - } - } - }); - mut.observe(templateContent, { - childList: true - }); - var dynCont = template.___container.parentElement.querySelector(".ig-dynamic-content-holder"); - let mut2 = createMutationObserver((list) => { - for (var mutation of list) { - if (mutation.type == 'childList') { - var host = templateContent.querySelector("#" + 'host-' + templateContent._id); - templateContent.___host = host; - if (template.___checkHost(template, templateContent, templateContent.___host)) { - mut2.disconnect(); - mut2 = null; - if (mut) { - mut.disconnect(); - mut = null; - } - } - break; - } - } - }); - mut2.observe(dynCont, { - childList: true - }); - adjustDynamicContent(template.___containerId, - "TemplateContent", - template.___templateId, - templateContent._id, - "Add", - webCallback, - null); - }; - refValue.___onTemplateTeardown = (template, templateContent) => { - adjustDynamicContent(template.___containerId, - "TemplateContent", - template.___templateId, - templateContent._id, - "Remove", - webCallback, - null); - }; - refValue.___checkHost = (template, templateContent, host) => { - var content = document.getElementById(templateContent._id); - if (content && host) { - if (content.parentElement != host) { - if (host.id.replace("host-", "") != content.id) { - console.log("error!"); + }); + mut.observe(templateContent, { + childList: true, + }); + var dynCont = template.___container.parentElement.querySelector('.ig-dynamic-content-holder'); + let mut2 = createMutationObserver((list) => { + for (var mutation of list) { + if (mutation.type == 'childList') { + var host = templateContent.querySelector('#' + 'host-' + templateContent._id); + templateContent.___host = host; + if (template.___checkHost(template, templateContent, templateContent.___host)) { + mut2.disconnect(); + mut2 = null; + if (mut) { + mut.disconnect(); + mut = null; + } } - host.appendChild(content); - return true; + break; } } - return false; - } - refValue.___onTemplateContextChanged = (template, templateContent, context) => { - if (templateContent.___host) { - template.___checkHost(template, templateContent, templateContent.___host); + }); + mut2.observe(dynCont, { + childList: true, + }); + adjustDynamicContent( + template.___containerId, + 'TemplateContent', + template.___templateId, + templateContent._id, + 'Add', + webCallback, + null, + ); + }; + refValue.___onTemplateTeardown = (template, templateContent) => { + adjustDynamicContent( + template.___containerId, + 'TemplateContent', + template.___templateId, + templateContent._id, + 'Remove', + webCallback, + null, + ); + }; + refValue.___checkHost = (template, templateContent, host) => { + var content = document.getElementById(templateContent._id); + if (content && host) { + if (content.parentElement != host) { + if (host.id.replace('host-', '') != content.id) { + console.log('error!'); + } + host.appendChild(content); + return true; } - adjustDynamicContent(template.___containerId, - "TemplateContent", - template.___templateId, - templateContent._id, - "Update", - webCallback, - context); - }; + } + return false; + }; + refValue.___onTemplateContextChanged = (template, templateContent, context) => { + if (templateContent.___host) { + template.___checkHost(template, templateContent, templateContent.___host); + } + adjustDynamicContent( + template.___containerId, + 'TemplateContent', + template.___templateId, + templateContent._id, + 'Update', + webCallback, + context, + ); + }; } } if (Array.isArray(refValue)) { @@ -1082,7 +1105,7 @@ function updateAngularElement(element: any) { (refValue as any).__dateColumnsCache = {}; (refValue as any).__dateColumnsCache.columns = m.dateCache; } - + for (let i = 0; i < refValue.length; i++) { let item = refValue[i]; expandDateColumns(item, refValue, i); @@ -1094,7 +1117,7 @@ function updateAngularElement(element: any) { if (m.dataIntents) { refDataIntents.set(refName, m.dataIntents); - processDataIntents(refName, refValue); + processDataIntents(refName, refValue); } cr.provideRefValue(currentContainer(), refName, refValue); @@ -1102,11 +1125,8 @@ function updateAngularElement(element: any) { } } break; - case "invokeMethod": - { - try - { - + case 'invokeMethod': { + try { let methodName = m.methodName; let target = m.target; let invokeId = m.invokeId; @@ -1115,58 +1135,56 @@ function updateAngularElement(element: any) { for (let i = 0; i < args.length; i++) { let t = types[i]; - if (t == "Date") { + if (t == 'Date') { args[i] = new Date(args[i]); } - if (t == "DateArray") { + if (t == 'DateArray') { let dates = []; for (let j = 0; j < args[i].length; j++) { dates.push(new Date(args[i][j])); } args[i] = dates; } - if (t == "Number") { + if (t == 'Number') { if (args[i] == null) { args[i] = NaN; } } - if (t == "NumberArray") { + if (t == 'NumberArray') { for (let j = 0; j < args[i].length; j++) { if (args[i][j] == null) { args[i][j] = NaN; } } } - if (t == "Json") { + if (t == 'Json') { let currArr = args[i]; if (Array.isArray(currArr) && currArr.length > 0 && currArr[0].___byValue) { for (let x = 0; x < currArr.length; x++) { - currArr[x] = cr.createObjectFromJson(JSON.stringify(currArr[x]), currentContainer()); + currArr[x] = cr.createObjectFromJson(JSON.stringify(currArr[x]), currentContainer()); } - } - else if (args[i] && args[i].___byValue) { - - args[i] = cr.createObjectFromJson(JSON.stringify(args[i]), currentContainer()); + } else if (args[i] && args[i].___byValue) { + args[i] = cr.createObjectFromJson(JSON.stringify(args[i]), currentContainer()); - if (!args[i].i) { - args[i].i = args[i]; - } + if (!args[i].i) { + args[i].i = args[i]; + } } else if (args[i] && args[i].refType) { - if (args[i].refType == "uuid") { + if (args[i].refType == 'uuid') { itemMaps.forEach((value: any, key: string) => { if (value.has(args[i].id)) { args[i] = value.get(args[i].id); } - }) - } else if (args[i].refType == "name") { + }); + } else if (args[i].refType == 'name') { args[i] = findByName(getMainTarget(), args[i].id); } } } - if (t == "Component") { + if (t == 'Component') { if (args[i] != null) { - if (args[i].indexOf("containerId:::") == 0) { - args[i] = args[i].substring("containerId:::".length); + if (args[i].indexOf('containerId:::') == 0) { + args[i] = args[i].substring('containerId:::'.length); if (containers.has(args[i])) { if (containersDirect.has(args[i])) { args[i] = containers.get(args[i]); @@ -1177,11 +1195,11 @@ function updateAngularElement(element: any) { var ele = getContainerByIgIdAttribute(args[i]); if (ele) { args[i] = ele; - } + } } } else { - if (args[i].indexOf("elementIndex:::") == 0) { - args[i] = args[i].substring("elementIndex:::".length); + if (args[i].indexOf('elementIndex:::') == 0) { + args[i] = args[i].substring('elementIndex:::'.length); args[i] = parseInt(args[i]); args[i] = nativeElements[i]; } @@ -1199,28 +1217,28 @@ function updateAngularElement(element: any) { child = ensureExternalObject(child); var isPropGet = false; - if (methodName.indexOf("p:") == 0) { + if (methodName.indexOf('p:') == 0) { isPropGet = true; methodName = methodName.substring(2); - methodName = methodName.substr(0, 1).toLowerCase() + (methodName).substring(1); + methodName = methodName.substr(0, 1).toLowerCase() + methodName.substring(1); } if (!hasProp(child, methodName)) { - if (methodName.endsWith("Component")) { - methodName = methodName.substr(0, methodName.length - "Component".length); - } else if (methodName.startsWith("perform")) { + if (methodName.endsWith('Component')) { + methodName = methodName.substr(0, methodName.length - 'Component'.length); + } else if (methodName.startsWith('perform')) { methodName = methodName.substr(7); } if (!hasProp(child, methodName)) { let error = "error: target doesn't have prop: " + methodName; - console.error(error) + console.error(error); return error; } } if (isPropGet) { - retVal = child[methodName]; + retVal = child[methodName]; } else { if (child[methodName]) { if (m.isSync) { @@ -1229,42 +1247,53 @@ function updateAngularElement(element: any) { retVal = child[methodName].apply(child, args); isSyncMethodInvoke = false; } - } + } if (Object.prototype.toString.call(retVal) === '[object Promise]') { - (retVal as any).then((value) => { - window.setTimeout(() => { - //reset container id, because this is async and something else might have send a message in the meantime - updateContainer(containerId); - callDotNet(webCallback, "OnInvokeReturn", invokeId, convertReturnValue(value)); - }, 0); - }); - return JSON.stringify({ retType: "promise" }); + (retVal as any).then((value) => { + window.setTimeout(() => { + //reset container id, because this is async and something else might have send a message in the meantime + updateContainer(containerId); + callDotNet(webCallback, 'OnInvokeReturn', invokeId, convertReturnValue(value)); + }, 0); + }); + return JSON.stringify({ retType: 'promise' }); } retVal = convertReturnValue(retVal); //callDotNet("OnInvokeReturn", invokeId, retVal); if ((window as any).webViewCallback) { - ((window as any).webViewCallback).onInvokeReturn(invokeId, retVal); + (window as any).webViewCallback.onInvokeReturn(invokeId, retVal); } - if ((window as any).webkit && (window as any).webkit.messageHandlers && (window as any).webkit.messageHandlers.onInvokeReturn) { + if ( + (window as any).webkit && + (window as any).webkit.messageHandlers && + (window as any).webkit.messageHandlers.onInvokeReturn + ) { (window as any).webkit.messageHandlers.onInvokeReturn.postMessage({ invokeId: invokeId, retVal: retVal }); } - return retVal; - } catch (error) { - console.error(error); + return retVal; + } catch (error) { + console.error(error); - //callDotNet("OnInvokeReturn", m.invokeId, "error: " + error); - if ((window as any).webViewCallback) { - ((window as any).webViewCallback).onInvokeReturn(m.invokeId, "error: " + error); - } - if ((window as any).webkit && (window as any).webkit.messageHandlers && (window as any).webkit.messageHandlers.onInvokeReturn) { - (window as any).webkit.messageHandlers.onInvokeReturn.postMessage({ invokeId: m.invokeId, retVal: "error: " + error }); - } - return "error: " + error; + //callDotNet("OnInvokeReturn", m.invokeId, "error: " + error); + if ((window as any).webViewCallback) { + (window as any).webViewCallback.onInvokeReturn(m.invokeId, 'error: ' + error); + } + if ( + (window as any).webkit && + (window as any).webkit.messageHandlers && + (window as any).webkit.messageHandlers.onInvokeReturn + ) { + (window as any).webkit.messageHandlers.onInvokeReturn.postMessage({ + invokeId: m.invokeId, + retVal: 'error: ' + error, + }); } + return 'error: ' + error; } - case "refNotifyInsertItem": + } + case 'refNotifyInsertItem': { let refName = m.refName; let index: number = m.index; @@ -1286,7 +1315,7 @@ function updateAngularElement(element: any) { } } if (child.notifyInsertItem) { - if (child.tagName && child.tagName == "IGC-DATA-GRID") { + if (child.tagName && child.tagName == 'IGC-DATA-GRID') { child.notifyInsertItem(index, newItem); } else { child.notifyInsertItem(refValue, index, newItem); @@ -1296,148 +1325,148 @@ function updateAngularElement(element: any) { } } break; - case "refNotifyRemoveItem": - { - let refName = m.refName; - let index: number = m.index; - - let refValue: any[] = refValues.get(refName); - let oldItem = refValue[index]; - refValue.splice(index, 1); - let child: any = getMainTarget(); - if (itemMaps.has(refName)) { - let map = itemMaps.get(refName); - if (oldItem.___id) { - map.delete(oldItem.___id); - } + case 'refNotifyRemoveItem': + { + let refName = m.refName; + let index: number = m.index; + + let refValue: any[] = refValues.get(refName); + let oldItem = refValue[index]; + refValue.splice(index, 1); + let child: any = getMainTarget(); + if (itemMaps.has(refName)) { + let map = itemMaps.get(refName); + if (oldItem.___id) { + map.delete(oldItem.___id); } - if (child.notifyRemoveItem) { - if (child.tagName && child.tagName == "IGC-DATA-GRID") { - child.notifyRemoveItem(index, oldItem); - } else { - child.notifyRemoveItem(refValue, index, oldItem); - } + } + if (child.notifyRemoveItem) { + if (child.tagName && child.tagName == 'IGC-DATA-GRID') { + child.notifyRemoveItem(index, oldItem); } else { - updateAngularElement(child); + child.notifyRemoveItem(refValue, index, oldItem); } + } else { + updateAngularElement(child); } - break; - case "refClearItems": - { - let refName = m.refName; - let index: number = m.index; - let newItem = m.newItem; - let newRefValue = m.refValue; - - let refValue: any[] = refValues.get(refName); - if (itemMaps.has(refName)) { - let map = itemMaps.get(refName); - for (let i = 0; i < refValue.length; i++) { - let child = refValue[i]; - if (child.___id) { - map.delete(child.___id); - } + } + break; + case 'refClearItems': + { + let refName = m.refName; + let index: number = m.index; + let newItem = m.newItem; + let newRefValue = m.refValue; + + let refValue: any[] = refValues.get(refName); + if (itemMaps.has(refName)) { + let map = itemMaps.get(refName); + for (let i = 0; i < refValue.length; i++) { + let child = refValue[i]; + if (child.___id) { + map.delete(child.___id); } } - refValue.length = 0; + } + refValue.length = 0; - if (m.dateCache && !(refValue as any).__dateColumnsCache) { - (refValue as any).__dateColumnsCache = {}; - (refValue as any).__dateColumnsCache.columns = m.dateCache; - } + if (m.dateCache && !(refValue as any).__dateColumnsCache) { + (refValue as any).__dateColumnsCache = {}; + (refValue as any).__dateColumnsCache.columns = m.dateCache; + } - for (let i = 0; i < newRefValue.length; i++) { - refValue[i] = newRefValue[i]; - expandDateColumns(newRefValue[i], refValue); - if (itemMaps.has(refName)) { - let map = itemMaps.get(refName); - if (refValue[i].___id) { - map.set(refValue[i].___id, refValue[i]); - } + for (let i = 0; i < newRefValue.length; i++) { + refValue[i] = newRefValue[i]; + expandDateColumns(newRefValue[i], refValue); + if (itemMaps.has(refName)) { + let map = itemMaps.get(refName); + if (refValue[i].___id) { + map.set(refValue[i].___id, refValue[i]); } } - let child: any = getMainTarget(); - if (child.notifyClearItems) { - if (child.tagName && child.tagName == "IGC-DATA-GRID") { - child.notifyClearItems(); - } else { - child.notifyClearItems(refValue); - } + } + let child: any = getMainTarget(); + if (child.notifyClearItems) { + if (child.tagName && child.tagName == 'IGC-DATA-GRID') { + child.notifyClearItems(); } else { - updateAngularElement(child); + child.notifyClearItems(refValue); } + } else { + updateAngularElement(child); } - break; - case "refNotifySetItem": - { - let refName = m.refName; - let index: number = m.index; - let oldItem = m.oldItem; - if (itemMaps.has(refName)) { - let map = itemMaps.get(refName); - if (oldItem.___id) { - map.delete(oldItem.___id); - } + } + break; + case 'refNotifySetItem': + { + let refName = m.refName; + let index: number = m.index; + let oldItem = m.oldItem; + if (itemMaps.has(refName)) { + let map = itemMaps.get(refName); + if (oldItem.___id) { + map.delete(oldItem.___id); } - let newItem = m.newItem; - let refValue: any[] = refValues.get(refName); + } + let newItem = m.newItem; + let refValue: any[] = refValues.get(refName); - if (m.dateCache && !(refValue as any).__dateColumnsCache) { - (refValue as any).__dateColumnsCache = {}; - (refValue as any).__dateColumnsCache.columns = m.dateCache; - } + if (m.dateCache && !(refValue as any).__dateColumnsCache) { + (refValue as any).__dateColumnsCache = {}; + (refValue as any).__dateColumnsCache.columns = m.dateCache; + } - expandDateColumns(newItem, refValue); - refValue[index] = newItem; - let child: any = getMainTarget(); - if (itemMaps.has(refName)) { - let map = itemMaps.get(refName); - if (child.___id) { - map.set(child.___id, child); - } + expandDateColumns(newItem, refValue); + refValue[index] = newItem; + let child: any = getMainTarget(); + if (itemMaps.has(refName)) { + let map = itemMaps.get(refName); + if (child.___id) { + map.set(child.___id, child); } - if (child.notifySetItem) { - if (child.tagName && child.tagName == "IGC-DATA-GRID") { - child.notifySetItem(index, oldItem, newItem); - } else { - child.notifySetItem(refValue, index, oldItem, newItem); - } + } + if (child.notifySetItem) { + if (child.tagName && child.tagName == 'IGC-DATA-GRID') { + child.notifySetItem(index, oldItem, newItem); } else { - updateAngularElement(child); + child.notifySetItem(refValue, index, oldItem, newItem); } + } else { + updateAngularElement(child); } - break; - case "refNotifyUpdateItem": - { - let refName = m.refName; - let index: number = m.index; - let syncDataonly = m.syncDataonly; - - let newItem = m.item; - - let refValue: any[] = refValues.get(refName); - let oldItem = refValue[index]; - - if (m.dateCache && !(refValue as any).__dateColumnsCache) { - (refValue as any).__dateColumnsCache = {}; - (refValue as any).__dateColumnsCache.columns = m.dateCache; - } + } + break; + case 'refNotifyUpdateItem': + { + let refName = m.refName; + let index: number = m.index; + let syncDataonly = m.syncDataonly; - expandDateColumns(newItem, refValue); - copyProperties(oldItem, newItem); - - let child: any = getMainTarget(); - if (child.notifySetItem && !syncDataonly) { - if (child.tagName && child.tagName == "IGC-DATA-GRID") { - child.notifySetItem(index, oldItem, oldItem); - } else { - child.notifySetItem(refValue, index, oldItem, oldItem); - } + let newItem = m.item; + + let refValue: any[] = refValues.get(refName); + let oldItem = refValue[index]; + + if (m.dateCache && !(refValue as any).__dateColumnsCache) { + (refValue as any).__dateColumnsCache = {}; + (refValue as any).__dateColumnsCache.columns = m.dateCache; + } + + expandDateColumns(newItem, refValue); + copyProperties(oldItem, newItem); + + let child: any = getMainTarget(); + if (child.notifySetItem && !syncDataonly) { + if (child.tagName && child.tagName == 'IGC-DATA-GRID') { + child.notifySetItem(index, oldItem, oldItem); } else { - updateAngularElement(child); + child.notifySetItem(refValue, index, oldItem, oldItem); } + } else { + updateAngularElement(child); } - break; + } + break; } }; @@ -1462,7 +1491,7 @@ enum UnmarshalledColumnType { ByteValue, ShortValue, SingleValue, - + NullableDoubleValue, NullableIntValue, NullableLongValue, @@ -1484,7 +1513,7 @@ enum UnmarshalledColumnType { DecimalArrayValue, ByteArrayValue, ShortArrayValue, - SingleArrayValue + SingleArrayValue, } class UnmarshalledColumn { @@ -1493,10 +1522,10 @@ class UnmarshalledColumn { this.dataSourceId = Blazor.platform.readStringField(ref, 8); this.type = Blazor.platform.readInt32Field(ref, 16); this.propertyPath = Blazor.platform.readStringField(ref, 24); - var propertyPathParts = this.propertyPath.split("."); + var propertyPathParts = this.propertyPath.split('.'); this.propertyPathParts = propertyPathParts; this.propertyName = propertyPathParts[propertyPathParts.length - 1]; - if (this.propertyName == "___self") { + if (this.propertyName == '___self') { this.isSelf = true; } this.isSubDataSource = Blazor.platform.readInt32Field(ref, 32) != 0; @@ -1504,32 +1533,34 @@ class UnmarshalledColumn { var arrStart = Blazor.platform.readObjectField(ref, 40); var nullArrayStart = null; - if (this.type > UnmarshalledColumnType.SingleValue && - this.type !== UnmarshalledColumnType.StringValue && - this.type !== UnmarshalledColumnType.DateTimeValue && - this.type !== UnmarshalledColumnType.CalendarValue) { + if ( + this.type > UnmarshalledColumnType.SingleValue && + this.type !== UnmarshalledColumnType.StringValue && + this.type !== UnmarshalledColumnType.DateTimeValue && + this.type !== UnmarshalledColumnType.CalendarValue + ) { nullArrayStart = Blazor.platform.readObjectField(ref, 48); } switch (this.type) { case UnmarshalledColumnType.DoubleValue: - case UnmarshalledColumnType.SingleValue: + case UnmarshalledColumnType.SingleValue: case UnmarshalledColumnType.DecimalValue: if (!this.numberValues) { this.numberValues = new Array(this.actualCount); } for (var i = 0; i < this.actualCount; i++) { var ele = Blazor.platform.getArrayEntryPtr(arrStart, i, 8); - this.numberValues[i] = getValueActual(ele, "double"); + this.numberValues[i] = getValueActual(ele, 'double'); } - if (this.propertyName === "___primitiveValueCollection") { + if (this.propertyName === '___primitiveValueCollection') { // item is the array of primitive values this.setValue = (item, index) => { item.push(...this.numberValues); }; } else { - this.setValue = (item, index) => this.getTarget(item)[this.propertyName] = this.numberValues[index]; - } + this.setValue = (item, index) => (this.getTarget(item)[this.propertyName] = this.numberValues[index]); + } break; case UnmarshalledColumnType.BooleanValue: if (!this.booleanValues) { @@ -1544,17 +1575,17 @@ class UnmarshalledColumn { this.booleanValues[i] = false; } } - if (this.propertyName === "___primitiveValueCollection") { + if (this.propertyName === '___primitiveValueCollection') { // item is the array of primitive values this.setValue = (item, index) => { item.push(...this.booleanValues); }; } else { - this.setValue = (item, index) => this.getTarget(item)[this.propertyName] = this.booleanValues[index]; - } - break; - case UnmarshalledColumnType.ByteValue: - case UnmarshalledColumnType.IntValue: + this.setValue = (item, index) => (this.getTarget(item)[this.propertyName] = this.booleanValues[index]); + } + break; + case UnmarshalledColumnType.ByteValue: + case UnmarshalledColumnType.IntValue: case UnmarshalledColumnType.ShortValue: if (!this.numberValues) { this.numberValues = new Array(this.actualCount); @@ -1563,34 +1594,34 @@ class UnmarshalledColumn { var ele = Blazor.platform.getArrayEntryPtr(arrStart, i, 4); this.numberValues[i] = Blazor.platform.readInt32Field(ele, 0); } - if (this.propertyName === "___primitiveValueCollection") { + if (this.propertyName === '___primitiveValueCollection') { // item is the array of primitive values this.setValue = (item, index) => { item.push(...this.numberValues); }; } else { - this.setValue = (item, index) => this.getTarget(item)[this.propertyName] = this.numberValues[index]; - } - break; - case UnmarshalledColumnType.LongValue: + this.setValue = (item, index) => (this.getTarget(item)[this.propertyName] = this.numberValues[index]); + } + break; + case UnmarshalledColumnType.LongValue: if (!this.numberValues) { this.numberValues = new Array(this.actualCount); } for (var i = 0; i < this.actualCount; i++) { var ele = Blazor.platform.getArrayEntryPtr(arrStart, i, 8); //this.numberValues[i] = Blazor.platform.readInt64Field(ele, 0); - this.numberValues[i] = getValueActual(ele, "i64"); + this.numberValues[i] = getValueActual(ele, 'i64'); } - if (this.propertyName === "___primitiveValueCollection") { + if (this.propertyName === '___primitiveValueCollection') { // item is the array of primitive values this.setValue = (item, index) => { item.push(...this.numberValues); }; } else { - this.setValue = (item, index) => this.getTarget(item)[this.propertyName] = this.numberValues[index]; - } + this.setValue = (item, index) => (this.getTarget(item)[this.propertyName] = this.numberValues[index]); + } break; - case UnmarshalledColumnType.StringValue: + case UnmarshalledColumnType.StringValue: if (!this.stringValues) { this.stringValues = new Array(this.actualCount); } @@ -1598,14 +1629,14 @@ class UnmarshalledColumn { var ele = Blazor.platform.getArrayEntryPtr(arrStart, i, 4); this.stringValues[i] = Blazor.platform.readStringField(ele, 0); } - if (this.propertyName === "___primitiveValueCollection") { + if (this.propertyName === '___primitiveValueCollection') { // item is the array of primitive values this.setValue = (item, index) => { item.push(...this.stringValues); }; } else { - this.setValue = (item, index) => this.getTarget(item)[this.propertyName] = this.stringValues[index]; - } + this.setValue = (item, index) => (this.getTarget(item)[this.propertyName] = this.stringValues[index]); + } break; case UnmarshalledColumnType.CalendarValue: case UnmarshalledColumnType.DateTimeValue: @@ -1622,37 +1653,37 @@ class UnmarshalledColumn { this.dateValues[i] = new Date(stringValue); } } - if (this.propertyName === "___primitiveValueCollection") { + if (this.propertyName === '___primitiveValueCollection') { // item is the array of primitive values this.setValue = (item, index) => { item.push(...this.dateValues); }; } else { - this.setValue = (item, index) => this.getTarget(item)[this.propertyName] = this.dateValues[index]; - } + this.setValue = (item, index) => (this.getTarget(item)[this.propertyName] = this.dateValues[index]); + } break; case UnmarshalledColumnType.ObjectValue: - if (this.isSubDataSource) { - if (!this.subDataSourceValues) { - this.subDataSourceValues = new Array(this.actualCount); - } - for (var i = 0; i < this.actualCount; i++) { - var ele = Blazor.platform.getArrayEntryPtr(arrStart, i, 4); - this.subDataSourceValues[i] = null; - var ele = Blazor.platform.readObjectField(ele, 0); - var subDataSourceColumns = getUnmarshalledColumns(ele); - if (subDataSourceColumns) { - this.subDataSourceValues[i] = createOrUpdateUnmarshalledDataSource(null, null, subDataSourceColumns); - } + if (this.isSubDataSource) { + if (!this.subDataSourceValues) { + this.subDataSourceValues = new Array(this.actualCount); + } + for (var i = 0; i < this.actualCount; i++) { + var ele = Blazor.platform.getArrayEntryPtr(arrStart, i, 4); + this.subDataSourceValues[i] = null; + var ele = Blazor.platform.readObjectField(ele, 0); + var subDataSourceColumns = getUnmarshalledColumns(ele); + if (subDataSourceColumns) { + this.subDataSourceValues[i] = createOrUpdateUnmarshalledDataSource(null, null, subDataSourceColumns); } + } - this.setValue = (item, index) => { - if (!this.isSelf) { - this.getTarget(item)[this.propertyName] = this.subDataSourceValues[index]; - } + this.setValue = (item, index) => { + if (!this.isSelf) { + this.getTarget(item)[this.propertyName] = this.subDataSourceValues[index]; } - } - break; + }; + } + break; case UnmarshalledColumnType.BooleanArrayValue: case UnmarshalledColumnType.ByteArrayValue: case UnmarshalledColumnType.CalendarArrayValue: @@ -1664,54 +1695,58 @@ class UnmarshalledColumn { case UnmarshalledColumnType.ShortArrayValue: case UnmarshalledColumnType.SingleArrayValue: case UnmarshalledColumnType.StringArrayValue: - if (this.isSubDataSource) { - if (!this.subDataSourceValues) { - this.subDataSourceValues = new Array(this.actualCount); - } - for (var i = 0; i < this.actualCount; i++) { - var ele = Blazor.platform.getArrayEntryPtr(arrStart, i, 4); - this.subDataSourceValues[i] = null; - var ele = Blazor.platform.readObjectField(ele, 0); - var subDataSourceColumns = getUnmarshalledColumns(ele); - if (subDataSourceColumns) { - for (var j = 0; j < subDataSourceColumns.length; j++) { - if (subDataSourceColumns[j].propertyPath === "___primitiveVal") { - let vals = []; - for (var k = 0; k < subDataSourceColumns[j].actualCount; k++) { - switch (this.type) { - case UnmarshalledColumnType.BooleanArrayValue: - vals.push(subDataSourceColumns[j].booleanValues[k]); break; - case UnmarshalledColumnType.ByteArrayValue: - case UnmarshalledColumnType.IntArrayValue: - case UnmarshalledColumnType.ShortArrayValue: - case UnmarshalledColumnType.DoubleArrayValue: - case UnmarshalledColumnType.SingleArrayValue: - case UnmarshalledColumnType.DecimalArrayValue: - case UnmarshalledColumnType.LongArrayValue: - vals.push(subDataSourceColumns[j].numberValues[k]); break; - case UnmarshalledColumnType.StringArrayValue: - vals.push(subDataSourceColumns[j].stringValues[k]); break; - case UnmarshalledColumnType.DateTimeArrayValue: - case UnmarshalledColumnType.CalendarArrayValue: - vals.push(subDataSourceColumns[j].dateValues[k]); break; - } + if (this.isSubDataSource) { + if (!this.subDataSourceValues) { + this.subDataSourceValues = new Array(this.actualCount); + } + for (var i = 0; i < this.actualCount; i++) { + var ele = Blazor.platform.getArrayEntryPtr(arrStart, i, 4); + this.subDataSourceValues[i] = null; + var ele = Blazor.platform.readObjectField(ele, 0); + var subDataSourceColumns = getUnmarshalledColumns(ele); + if (subDataSourceColumns) { + for (var j = 0; j < subDataSourceColumns.length; j++) { + if (subDataSourceColumns[j].propertyPath === '___primitiveVal') { + let vals = []; + for (var k = 0; k < subDataSourceColumns[j].actualCount; k++) { + switch (this.type) { + case UnmarshalledColumnType.BooleanArrayValue: + vals.push(subDataSourceColumns[j].booleanValues[k]); + break; + case UnmarshalledColumnType.ByteArrayValue: + case UnmarshalledColumnType.IntArrayValue: + case UnmarshalledColumnType.ShortArrayValue: + case UnmarshalledColumnType.DoubleArrayValue: + case UnmarshalledColumnType.SingleArrayValue: + case UnmarshalledColumnType.DecimalArrayValue: + case UnmarshalledColumnType.LongArrayValue: + vals.push(subDataSourceColumns[j].numberValues[k]); + break; + case UnmarshalledColumnType.StringArrayValue: + vals.push(subDataSourceColumns[j].stringValues[k]); + break; + case UnmarshalledColumnType.DateTimeArrayValue: + case UnmarshalledColumnType.CalendarArrayValue: + vals.push(subDataSourceColumns[j].dateValues[k]); + break; } - this.subDataSourceValues[i] = vals; } + this.subDataSourceValues[i] = vals; } } } + } - this.setValue = (item, index) => { - if (!this.isSelf) { - this.getTarget(item)[this.propertyName] = this.subDataSourceValues[index]; - } + this.setValue = (item, index) => { + if (!this.isSelf) { + this.getTarget(item)[this.propertyName] = this.subDataSourceValues[index]; } - } - break; - + }; + } + break; + case UnmarshalledColumnType.NullableDoubleValue: - case UnmarshalledColumnType.NullableSingleValue: + case UnmarshalledColumnType.NullableSingleValue: case UnmarshalledColumnType.NullableDecimalValue: if (!this.numberValues) { this.numberValues = new Array(this.actualCount); @@ -1721,12 +1756,13 @@ class UnmarshalledColumn { } for (var i = 0; i < this.actualCount; i++) { var ele = Blazor.platform.getArrayEntryPtr(arrStart, i, 8); - this.numberValues[i] = getValueActual(ele, "double"); + this.numberValues[i] = getValueActual(ele, 'double'); var nullEle = Blazor.platform.getArrayEntryPtr(nullArrayStart, i, 1); - this.nullValues[i] = getValueActual(nullEle, "i8"); + this.nullValues[i] = getValueActual(nullEle, 'i8'); } - this.setValue = (item, index) => this.getTarget(item)[this.propertyName] = !this.nullValues[index] ? this.numberValues[index] : null; + this.setValue = (item, index) => + (this.getTarget(item)[this.propertyName] = !this.nullValues[index] ? this.numberValues[index] : null); break; case UnmarshalledColumnType.NullableBooleanValue: if (!this.booleanValues) { @@ -1745,12 +1781,13 @@ class UnmarshalledColumn { } var nullEle = Blazor.platform.getArrayEntryPtr(nullArrayStart, i, 1); - this.nullValues[i] = getValueActual(nullEle, "i8"); + this.nullValues[i] = getValueActual(nullEle, 'i8'); } - this.setValue = (item, index) => this.getTarget(item)[this.propertyName] = !this.nullValues[index] ? this.booleanValues[index] : null; + this.setValue = (item, index) => + (this.getTarget(item)[this.propertyName] = !this.nullValues[index] ? this.booleanValues[index] : null); break; - case UnmarshalledColumnType.NullableByteValue: - case UnmarshalledColumnType.NullableIntValue: + case UnmarshalledColumnType.NullableByteValue: + case UnmarshalledColumnType.NullableIntValue: case UnmarshalledColumnType.NullableShortValue: if (!this.numberValues) { this.numberValues = new Array(this.actualCount); @@ -1763,11 +1800,12 @@ class UnmarshalledColumn { this.numberValues[i] = Blazor.platform.readInt32Field(ele, 0); var nullEle = Blazor.platform.getArrayEntryPtr(nullArrayStart, i, 1); - this.nullValues[i] = getValueActual(nullEle, "i8"); + this.nullValues[i] = getValueActual(nullEle, 'i8'); } - this.setValue = (item, index) => this.getTarget(item)[this.propertyName] = !this.nullValues[index] ? this.numberValues[index] : null; + this.setValue = (item, index) => + (this.getTarget(item)[this.propertyName] = !this.nullValues[index] ? this.numberValues[index] : null); break; - case UnmarshalledColumnType.NullableLongValue: + case UnmarshalledColumnType.NullableLongValue: if (!this.numberValues) { this.numberValues = new Array(this.actualCount); } @@ -1777,12 +1815,13 @@ class UnmarshalledColumn { for (var i = 0; i < this.actualCount; i++) { var ele = Blazor.platform.getArrayEntryPtr(arrStart, i, 8); //this.numberValues[i] = Blazor.platform.readInt64Field(ele, 0); - this.numberValues[i] = getValueActual(ele, "i64"); + this.numberValues[i] = getValueActual(ele, 'i64'); var nullEle = Blazor.platform.getArrayEntryPtr(nullArrayStart, i, 1); - this.nullValues[i] = getValueActual(nullEle, "i8"); - } - this.setValue = (item, index) => this.getTarget(item)[this.propertyName] = !this.nullValues[index] ? this.numberValues[index] : null; + this.nullValues[i] = getValueActual(nullEle, 'i8'); + } + this.setValue = (item, index) => + (this.getTarget(item)[this.propertyName] = !this.nullValues[index] ? this.numberValues[index] : null); break; } } @@ -1826,10 +1865,10 @@ class UnmarshalledColumnItem { this.dataSourceId = Blazor.platform.readStringField(ref, 8); this.type = Blazor.platform.readInt32Field(ref, 16); this.propertyPath = Blazor.platform.readStringField(ref, 24); - var propertyPathParts = this.propertyPath.split("."); + var propertyPathParts = this.propertyPath.split('.'); this.propertyPathParts = propertyPathParts; this.propertyName = propertyPathParts[propertyPathParts.length - 1]; - if (this.propertyName == "___self") { + if (this.propertyName == '___self') { this.isSelf = true; } this.isSubDataSource = Blazor.platform.readInt32Field(ref, 32) != 0; @@ -1838,29 +1877,31 @@ class UnmarshalledColumnItem { var arrStart = Blazor.platform.readObjectField(ref, 40); var nullArrayStart = null; - if (this.type > UnmarshalledColumnType.SingleValue && - this.type !== UnmarshalledColumnType.StringValue && - this.type !== UnmarshalledColumnType.DateTimeValue && - this.type !== UnmarshalledColumnType.CalendarValue) { + if ( + this.type > UnmarshalledColumnType.SingleValue && + this.type !== UnmarshalledColumnType.StringValue && + this.type !== UnmarshalledColumnType.DateTimeValue && + this.type !== UnmarshalledColumnType.CalendarValue + ) { nullArrayStart = Blazor.platform.readObjectField(ref, 48); } switch (this.type) { case UnmarshalledColumnType.DoubleValue: - case UnmarshalledColumnType.SingleValue: + case UnmarshalledColumnType.SingleValue: case UnmarshalledColumnType.DecimalValue: var ele = Blazor.platform.getArrayEntryPtr(arrStart, index, 8); - this.numberValue = getValueActual(ele, "double"); - this.setValue = (item) => this.getTarget(item)[this.propertyName] = this.numberValue; + this.numberValue = getValueActual(ele, 'double'); + this.setValue = (item) => (this.getTarget(item)[this.propertyName] = this.numberValue); break; case UnmarshalledColumnType.NullableDoubleValue: - case UnmarshalledColumnType.NullableSingleValue: + case UnmarshalledColumnType.NullableSingleValue: case UnmarshalledColumnType.NullableDecimalValue: var ele = Blazor.platform.getArrayEntryPtr(arrStart, index, 8); - this.numberValue = getValueActual(ele, "double"); + this.numberValue = getValueActual(ele, 'double'); var nullEle = Blazor.platform.getArrayEntryPtr(nullArrayStart, index, 1); - this.nullValue = getValueActual(nullEle, "i8"); - this.setValue = (item) => this.getTarget(item)[this.propertyName] = !this.nullValue ? this.numberValue : null; + this.nullValue = getValueActual(nullEle, 'i8'); + this.setValue = (item) => (this.getTarget(item)[this.propertyName] = !this.nullValue ? this.numberValue : null); break; case UnmarshalledColumnType.BooleanValue: var ele = Blazor.platform.getArrayEntryPtr(arrStart, index, 4); @@ -1870,7 +1911,7 @@ class UnmarshalledColumnItem { } else { this.booleanValue = false; } - this.setValue = (item) => this.getTarget(item)[this.propertyName] = this.booleanValue; + this.setValue = (item) => (this.getTarget(item)[this.propertyName] = this.booleanValue); break; case UnmarshalledColumnType.NullableBooleanValue: var ele = Blazor.platform.getArrayEntryPtr(arrStart, index, 4); @@ -1881,44 +1922,45 @@ class UnmarshalledColumnItem { this.booleanValue = false; } var nullEle = Blazor.platform.getArrayEntryPtr(nullArrayStart, index, 1); - this.nullValue = getValueActual(nullEle, "i8"); - this.setValue = (item) => this.getTarget(item)[this.propertyName] = !this.nullValue ? this.booleanValue : null; + this.nullValue = getValueActual(nullEle, 'i8'); + this.setValue = (item) => + (this.getTarget(item)[this.propertyName] = !this.nullValue ? this.booleanValue : null); break; - case UnmarshalledColumnType.ByteValue: - case UnmarshalledColumnType.IntValue: + case UnmarshalledColumnType.ByteValue: + case UnmarshalledColumnType.IntValue: case UnmarshalledColumnType.ShortValue: var ele = Blazor.platform.getArrayEntryPtr(arrStart, index, 4); this.numberValue = Blazor.platform.readInt32Field(ele, 0); - this.setValue = (item) => this.getTarget(item)[this.propertyName] = this.numberValue; + this.setValue = (item) => (this.getTarget(item)[this.propertyName] = this.numberValue); break; - case UnmarshalledColumnType.NullableByteValue: - case UnmarshalledColumnType.NullableIntValue: + case UnmarshalledColumnType.NullableByteValue: + case UnmarshalledColumnType.NullableIntValue: case UnmarshalledColumnType.NullableShortValue: var ele = Blazor.platform.getArrayEntryPtr(arrStart, index, 4); this.numberValue = Blazor.platform.readInt32Field(ele, 0); var nullEle = Blazor.platform.getArrayEntryPtr(nullArrayStart, index, 1); - this.nullValue = getValueActual(nullEle, "i8"); - this.setValue = (item) => this.getTarget(item)[this.propertyName] = !this.nullValue ? this.numberValue : null; - break; - case UnmarshalledColumnType.LongValue: + this.nullValue = getValueActual(nullEle, 'i8'); + this.setValue = (item) => (this.getTarget(item)[this.propertyName] = !this.nullValue ? this.numberValue : null); + break; + case UnmarshalledColumnType.LongValue: var ele = Blazor.platform.getArrayEntryPtr(arrStart, index, 8); //this.numberValue = Blazor.platform.readInt64Field(ele, 0); - this.numberValue = getValueActual(ele, "i64"); - this.setValue = (item) => this.getTarget(item)[this.propertyName] = this.numberValue; + this.numberValue = getValueActual(ele, 'i64'); + this.setValue = (item) => (this.getTarget(item)[this.propertyName] = this.numberValue); break; - case UnmarshalledColumnType.LongValue: + case UnmarshalledColumnType.LongValue: var ele = Blazor.platform.getArrayEntryPtr(arrStart, index, 8); //this.numberValue = Blazor.platform.readInt64Field(ele, 0); - this.numberValue = getValueActual(ele, "i64"); + this.numberValue = getValueActual(ele, 'i64'); var nullEle = Blazor.platform.getArrayEntryPtr(nullArrayStart, index, 1); - this.nullValue = getValueActual(nullEle, "i8"); - this.setValue = (item) => this.getTarget(item)[this.propertyName] = !this.nullValue ? this.numberValue : null; - break; - case UnmarshalledColumnType.StringValue: + this.nullValue = getValueActual(nullEle, 'i8'); + this.setValue = (item) => (this.getTarget(item)[this.propertyName] = !this.nullValue ? this.numberValue : null); + break; + case UnmarshalledColumnType.StringValue: var ele = Blazor.platform.getArrayEntryPtr(arrStart, index, 4); this.stringValue = Blazor.platform.readStringField(ele, 0); - this.setValue = (item) => this.getTarget(item)[this.propertyName] = this.stringValue; - break; + this.setValue = (item) => (this.getTarget(item)[this.propertyName] = this.stringValue); + break; case UnmarshalledColumnType.CalendarValue: case UnmarshalledColumnType.DateTimeValue: case UnmarshalledColumnType.NullableCalendarValue: @@ -1928,8 +1970,8 @@ class UnmarshalledColumnItem { var stringValue = Blazor.platform.readStringField(ele, 0); if (stringValue) { this.dateValue = new Date(stringValue); - } - this.setValue = (item) => this.getTarget(item)[this.propertyName] = this.dateValue; + } + this.setValue = (item) => (this.getTarget(item)[this.propertyName] = this.dateValue); break; case UnmarshalledColumnType.ObjectValue: if (this.isSubDataSource) { @@ -1939,9 +1981,9 @@ class UnmarshalledColumnItem { this.subDataSource = createOrUpdateUnmarshalledDataSource(null, this.subDataSource, subDataSourceColumns); this.setValue = (item) => { if (!this.isSelf) { - this.getTarget(item)[this.propertyName] = this.subDataSource; + this.getTarget(item)[this.propertyName] = this.subDataSource; } - } + }; } break; } @@ -1982,8 +2024,6 @@ class UnmarshalledColumnItem { setValue: (item: any) => void = null; } - - function getUnmarshalledColumns(columns: any): UnmarshalledColumn[] { if (!columns) { return null; @@ -1992,7 +2032,7 @@ function getUnmarshalledColumns(columns: any): UnmarshalledColumn[] { var arrLen = getArrayLengthActual(columns); let ret: UnmarshalledColumn[] = []; for (var i = 0; i < arrLen; i++) { - var ptr = Blazor.platform.getArrayEntryPtr(arrStart, i, 56); + var ptr = Blazor.platform.getArrayEntryPtr(arrStart, i, 56); ret.push(new UnmarshalledColumn(ptr)); } return ret; @@ -2005,7 +2045,7 @@ function getUnmarshalledColumnItems(columns: any, index: number): UnmarshalledCo var arrLen = getArrayLengthActual(columns); let ret: UnmarshalledColumnItem[] = []; for (var i = 0; i < arrLen; i++) { - var ptr = Blazor.platform.getArrayEntryPtr(arrStart, i, 56); + var ptr = Blazor.platform.getArrayEntryPtr(arrStart, i, 56); ret.push(new UnmarshalledColumnItem(ptr, index)); } return ret; @@ -2038,16 +2078,16 @@ function createOrUpdateUnmarshalledDataSource(refName: string, data: any[], colu if (columns) { for (var i = 0; i < columns.length; i++) { - if (columns[i].propertyName == "___id") { + if (columns[i].propertyName == '___id') { idColumn = columns[i]; } - if (columns[i].propertyName == "___self") { + if (columns[i].propertyName == '___self') { selfColumn = columns[i]; } - if (columns[i].propertyName == "___primitiveVal") { + if (columns[i].propertyName == '___primitiveVal') { primColumn = columns[i]; } - if (columns[i].propertyName == "___primitiveValueCollection") { + if (columns[i].propertyName == '___primitiveValueCollection') { primitiveCollectionValueColumn = columns[i]; } } @@ -2078,7 +2118,7 @@ function createOrUpdateUnmarshalledDataSource(refName: string, data: any[], colu if (selfColumn) { target = selfColumn.subDataSourceValues[i]; } else { - target = { }; + target = {}; } itemMap.set(currId, target); } @@ -2103,8 +2143,7 @@ function createOrUpdateUnmarshalledDataSource(refName: string, data: any[], colu if (oldData) { for (var i = 0; i < oldData.length; i++) { - if (oldData[i].___id && - !newMap.has(oldData[i].___id)) { + if (oldData[i].___id && !newMap.has(oldData[i].___id)) { itemMap.delete(oldData[i].___id); } } @@ -2133,10 +2172,10 @@ function createOrUpdateUnmarshalledItem(refName: string, item: any, columns: Unm var idColumn: UnmarshalledColumnItem = null; var selfColumn: UnmarshalledColumnItem = null; for (var i = 0; i < columns.length; i++) { - if (columns[i].propertyName == "___id") { + if (columns[i].propertyName == '___id') { idColumn = columns[i]; } - if (columns[i].propertyName == "___self") { + if (columns[i].propertyName == '___self') { selfColumn = columns[i]; } } @@ -2153,7 +2192,6 @@ function createOrUpdateUnmarshalledItem(refName: string, item: any, columns: Unm itemMap.set(item.___id, item); } - for (var j = 0; j < columns.length; j++) { var currCol = columns[j]; if (!currCol.setValue) { @@ -2166,13 +2204,13 @@ function createOrUpdateUnmarshalledItem(refName: string, item: any, columns: Unm function getValueNinePlus(ptr, type) { switch (type) { - case "double": + case 'double': return Blazor.runtime.getHeapF64(ptr); - case "i64": + case 'i64': return Blazor.runtime.getHeapI52(ptr); - case "i32": + case 'i32': return Blazor.runtime.getHeapI32(ptr); - case "i8": + case 'i8': return Blazor.runtime.getHeapI8(ptr); } } @@ -2183,7 +2221,7 @@ function getArrayDataPtr(value: any): any { return value + 12; } -(window as any).igUnmarshalledDataSourceCreate = function(refName: string, index: number, columns: any) { +(window as any).igUnmarshalledDataSourceCreate = function (refName: string, index: number, columns: any) { if ((window as any).getValue) { getValueActual = (window as any).getValue; } @@ -2195,7 +2233,6 @@ function getArrayDataPtr(value: any): any { } if (!getValueActual && (window as any).Module !== undefined) { getValueActual = Module.getValue; - } if (!getValueActual) { getValueActual = getValueNinePlus; @@ -2207,17 +2244,16 @@ function getArrayDataPtr(value: any): any { } if (!getArrayLengthActual) { getArrayLengthActual = (arr: any) => { - return getValueActual(getArrayDataPtr(arr), "i32"); - } + return getValueActual(getArrayDataPtr(arr), 'i32'); + }; } - if (isDotnetNinePlus) - columns = Blazor.runtime.getHeapU32(columns); + if (isDotnetNinePlus) columns = Blazor.runtime.getHeapU32(columns); if (!isDotnetNinePlus) { refName = BINDING.conv_string(refName); } - var ind = refName.indexOf(":"); + var ind = refName.indexOf(':'); var containerId = refName.substr(0, ind); updateContainer(containerId); var refName = refName.substr(ind + 1); @@ -2246,7 +2282,7 @@ function getArrayDataPtr(value: any): any { let arr = containersPendingDataRefs.get(containerId); arr.push(() => { let cc = getContainer(containerId); - cr.provideRefValue(cc, refName, null); + cr.provideRefValue(cc, refName, null); }); } return; @@ -2265,18 +2301,18 @@ function getArrayDataPtr(value: any): any { let arr = containersPendingDataRefs.get(containerId); arr.push(() => { let cc = getContainer(containerId); - cr.provideRefValue(cc, refName, data); + cr.provideRefValue(cc, refName, data); }); } refValues.set(refName, data); }; -(window as any).igUnmarshalledDataSourceCreateDataIntents = function(refName: string, intents: string) { +(window as any).igUnmarshalledDataSourceCreateDataIntents = function (refName: string, intents: string) { if (!isDotnetNinePlus) { refName = BINDING.conv_string(refName); intents = BINDING.conv_string(intents); } - var ind = refName.indexOf(":"); + var ind = refName.indexOf(':'); var containerId = refName.substr(0, ind); updateContainer(containerId); var refName = refName.substr(ind + 1); @@ -2289,17 +2325,16 @@ function getArrayDataPtr(value: any): any { refDataIntents.set(refName, dataIntents); }; -(window as any).igUnmarshalledDataSourceInsert = function(refName: string, index: number, columns: any) { +(window as any).igUnmarshalledDataSourceInsert = function (refName: string, index: number, columns: any) { if (!isDotnetNinePlus) { refName = BINDING.conv_string(refName); } - var ind = refName.indexOf(":"); + var ind = refName.indexOf(':'); var containerId = refName.substr(0, ind); updateContainer(containerId); var refName = refName.substr(ind + 1); - if (isDotnetNinePlus) - columns = Blazor.runtime.getHeapU32(columns); + if (isDotnetNinePlus) columns = Blazor.runtime.getHeapU32(columns); var colItems = getUnmarshalledColumnItems(columns, index); var item = createOrUpdateUnmarshalledItem(refName, null, colItems); @@ -2313,7 +2348,7 @@ function getArrayDataPtr(value: any): any { if (child) { isSyncMethodInvoke = true; if (child.notifyInsertItem) { - if (child.tagName && child.tagName == "IGC-DATA-GRID") { + if (child.tagName && child.tagName == 'IGC-DATA-GRID') { child.notifyInsertItem(index, item); } else { child.notifyInsertItem(refValue, index, item); @@ -2326,21 +2361,20 @@ function getArrayDataPtr(value: any): any { } } }; -(window as any).igUnmarshalledDataSourceUpdate = function(refName: string, index: number, columns: any) { +(window as any).igUnmarshalledDataSourceUpdate = function (refName: string, index: number, columns: any) { if (!isDotnetNinePlus) { refName = BINDING.conv_string(refName); } - var ind = refName.indexOf(":"); + var ind = refName.indexOf(':'); var containerId = refName.substr(0, ind); updateContainer(containerId); var refName = refName.substr(ind + 1); - ind = refName.indexOf(":"); + ind = refName.indexOf(':'); var n = refName.substr(0, ind); - var syncDataOnly = refName.substr(ind + 1) == "true"; + var syncDataOnly = refName.substr(ind + 1) == 'true'; refName = n; - if (isDotnetNinePlus) - columns = Blazor.runtime.getHeapU32(columns); + if (isDotnetNinePlus) columns = Blazor.runtime.getHeapU32(columns); var colItems = getUnmarshalledColumnItems(columns, index); @@ -2355,7 +2389,7 @@ function getArrayDataPtr(value: any): any { let child: any = getMainTarget(); isSyncMethodInvoke = true; if (child.notifySetItem && !syncDataOnly) { - if (child.tagName && child.tagName == "IGC-DATA-GRID") { + if (child.tagName && child.tagName == 'IGC-DATA-GRID') { child.notifySetItem(index, oldVal, currVal); } else { child.notifySetItem(refValue, index, oldVal, currVal); @@ -2367,19 +2401,18 @@ function getArrayDataPtr(value: any): any { } } }; -(window as any).igUnmarshalledDataSourceRemove = function(refName: string, index: number, columns: any) { +(window as any).igUnmarshalledDataSourceRemove = function (refName: string, index: number, columns: any) { if (!isDotnetNinePlus) { refName = BINDING.conv_string(refName); } - if (isDotnetNinePlus) - columns = Blazor.runtime.getHeapU32(columns); + if (isDotnetNinePlus) columns = Blazor.runtime.getHeapU32(columns); - var ind = refName.indexOf(":"); + var ind = refName.indexOf(':'); var containerId = refName.substr(0, ind); updateContainer(containerId); var refName = refName.substr(ind + 1); - + if (refValues.has(refName)) { var refValue: any[] = refValues.get(refName); @@ -2390,7 +2423,7 @@ function getArrayDataPtr(value: any): any { let child: any = getMainTarget(); isSyncMethodInvoke = true; if (child.notifyRemoveItem) { - if (child.tagName && child.tagName == "IGC-DATA-GRID") { + if (child.tagName && child.tagName == 'IGC-DATA-GRID') { child.notifyRemoveItem(index, oldVAl); } else { child.notifyRemoveItem(refValue, index, oldVAl); @@ -2402,21 +2435,19 @@ function getArrayDataPtr(value: any): any { } } }; -(window as any).igUnmarshalledDataSourceClear = function(refName: string, index: number, columns: any) { +(window as any).igUnmarshalledDataSourceClear = function (refName: string, index: number, columns: any) { if (!isDotnetNinePlus) { refName = BINDING.conv_string(refName); } - var ind = refName.indexOf(":"); + var ind = refName.indexOf(':'); var containerId = refName.substr(0, ind); updateContainer(containerId); var refName = refName.substr(ind + 1); - if (isDotnetNinePlus) - columns = Blazor.runtime.getHeapU32(columns); + if (isDotnetNinePlus) columns = Blazor.runtime.getHeapU32(columns); var cols = getUnmarshalledColumns(columns); - if (refValues.has(refName)) { var refValue: any[] = refValues.get(refName); @@ -2426,7 +2457,7 @@ function getArrayDataPtr(value: any): any { let child: any = getMainTarget(); isSyncMethodInvoke = true; if (child.notifyClearItems) { - if (child.tagName && child.tagName == "IGC-DATA-GRID") { + if (child.tagName && child.tagName == 'IGC-DATA-GRID') { child.notifyClearItems(); } else { child.notifyClearItems(refValue); @@ -2439,11 +2470,14 @@ function getArrayDataPtr(value: any): any { } }; - //callDotNet("OnReady"); if ((window as any).webViewCallback) { - ((window as any).webViewCallback).onReady(); + (window as any).webViewCallback.onReady(); +} +if ( + (window as any).webkit && + (window as any).webkit.messageHandlers && + (window as any).webkit.messageHandlers.onReady +) { + (window as any).webkit.messageHandlers.onReady.postMessage({}); } -if ((window as any).webkit && (window as any).webkit.messageHandlers && (window as any).webkit.messageHandlers.onReady) { - (window as any).webkit.messageHandlers.onReady.postMessage({ }); -} \ No newline at end of file diff --git a/src/src/public_path.ts b/src/src/public_path.ts index 27daaec0..4c245722 100644 --- a/src/src/public_path.ts +++ b/src/src/public_path.ts @@ -1,3 +1,3 @@ -declare var __webpack_public_path__:string; +declare var __webpack_public_path__: string; __webpack_public_path__ = (window as any).igPublicPath || '_content/IgniteUI.Blazor/'; diff --git a/src/src/refs-state.ts b/src/src/refs-state.ts index da859eda..aadb0c33 100644 --- a/src/src/refs-state.ts +++ b/src/src/refs-state.ts @@ -1,2 +1,2 @@ export const refValues: Map = new Map(); -export const itemMaps: Map> = new Map>(); \ No newline at end of file +export const itemMaps: Map> = new Map>(); diff --git a/stories/Program.cs b/stories/Program.cs index b33f5eb3..b8abf369 100644 --- a/stories/Program.cs +++ b/stories/Program.cs @@ -1,5 +1,4 @@ using BlazingStory.Components; -using Microsoft.Extensions.DependencyInjection.Extensions; using IgniteUI.Blazor.Stories.Components.Pages; var builder = WebApplication.CreateBuilder(args); diff --git a/stories/Properties/launchSettings.json b/stories/Properties/launchSettings.json index d11ddb94..ce6a6890 100644 --- a/stories/Properties/launchSettings.json +++ b/stories/Properties/launchSettings.json @@ -19,4 +19,4 @@ } } } -} \ No newline at end of file +} diff --git a/stories/wwwroot/css/blazor-ui.css b/stories/wwwroot/css/blazor-ui.css index 7fbd8a8a..15619b61 100644 --- a/stories/wwwroot/css/blazor-ui.css +++ b/stories/wwwroot/css/blazor-ui.css @@ -1,89 +1,92 @@ #blazor-error-ui { - background: #ffffe0; - bottom: 0; - box-shadow: 0 -1px 2px rgba(0, 0, 0, .2); - display: none; - left: 0; - padding: .6rem 1.25rem .7rem 1.25rem; - position: fixed; - right: 0; - z-index: 1000 + background: #ffffe0; + bottom: 0; + box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2); + display: none; + left: 0; + padding: 0.6rem 1.25rem 0.7rem 1.25rem; + position: fixed; + right: 0; + z-index: 1000; } #blazor-error-ui .dismiss { - cursor: pointer; - position: absolute; - right: .75rem; - top: .5rem + cursor: pointer; + position: absolute; + right: 0.75rem; + top: 0.5rem; } .blazor-error-boundary { - background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121; - padding: 1rem 1rem 1rem 3.7rem; - color: white; + background: + url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) + no-repeat 1rem/1.8rem, + #b32121; + padding: 1rem 1rem 1rem 3.7rem; + color: white; } .blazor-error-boundary::after { - content: "An error has occurred." + content: 'An error has occurred.'; } .loading-progress { - position: fixed; - inset: 0; - background: #f6f9fc; + position: fixed; + inset: 0; + background: #f6f9fc; } .loading-progress svg { - position: relative; - display: block; - width: 8rem; - height: 8rem; - margin: 20vh auto 1rem auto; + position: relative; + display: block; + width: 8rem; + height: 8rem; + margin: 20vh auto 1rem auto; } .loading-progress svg circle { - fill: none; - stroke: #e0e0e0; - stroke-width: 0.6rem; - transform-origin: 50% 50%; - transform: rotate(-90deg); + fill: none; + stroke: #e0e0e0; + stroke-width: 0.6rem; + transform-origin: 50% 50%; + transform: rotate(-90deg); } .loading-progress svg circle:last-child { - stroke: #542fd4; - stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%; - transition: stroke-dasharray 0.05s ease-in-out; + stroke: #542fd4; + stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%; + transition: stroke-dasharray 0.05s ease-in-out; } .loading-progress img { - position: absolute; - width: 44px; - height: 44px; - margin: auto; - inset: calc(20vh + 3.2rem - 22px) 0 auto 0; + position: absolute; + width: 44px; + height: 44px; + margin: auto; + inset: calc(20vh + 3.2rem - 22px) 0 auto 0; } .loading-progress .text { - position: absolute; - text-align: center; - font-weight: bold; - inset: calc(20vh + 4.8rem) 0 auto 0.2rem; + position: absolute; + text-align: center; + font-weight: bold; + inset: calc(20vh + 4.8rem) 0 auto 0.2rem; } .loading-progress .text:after { - content: var(--blazor-load-percentage-text, "Loading"); + content: var(--blazor-load-percentage-text, 'Loading'); } @media (prefers-color-scheme: dark) { - .loading-progress { - background-color: #222425; - } + .loading-progress { + background-color: #222425; + } - .loading-progress svg circle { - stroke: #393a3b; - } + .loading-progress svg circle { + stroke: #393a3b; + } - .loading-progress .text { - color: #c9cdcf; - } -} \ No newline at end of file + .loading-progress .text { + color: #c9cdcf; + } +} diff --git a/stories/wwwroot/index.html b/stories/wwwroot/index.html index 5edef283..7476f715 100644 --- a/stories/wwwroot/index.html +++ b/stories/wwwroot/index.html @@ -1,7 +1,6 @@ - + - - + Ignite UI for Blazor - Stories @@ -9,21 +8,20 @@ - + - +
-
Loading...
+
Loading...
- An unhandled error has occurred. - Reload - 🗙 + An unhandled error has occurred. + Reload + 🗙
- - + diff --git a/stories/wwwroot/js/Chat.stories.js b/stories/wwwroot/js/Chat.stories.js index eff57c25..8fc9e8ac 100644 --- a/stories/wwwroot/js/Chat.stories.js +++ b/stories/wwwroot/js/Chat.stories.js @@ -1,45 +1,63 @@ // collocated Chat.stories.razor.js with a component doesn't auto-load /*export*/ function registerChatTemplates(params) { const html = window.igTemplating.html; - window.igRegisterScript("ChatStoryMessageHeaderScript", (ctx) => { - if (ctx?.message?.sender === "user") { - return html``; - } - - return html` -
- - Support Agent -
- `; - }, false); - - window.igRegisterScript("ChatStoryMessageActionsScript", (ctx) => { - if (ctx?.message?.sender === "user" || !ctx?.message?.text) { - return html``; - } - - return html` - { - /* invoke mark as helpful */ - }} - > 👍 - `; - }, false); - - window.igRegisterScript("ChatStoryInputActionsStartScript", () => { - return html`🎙️`; - }, false); - - window.igRegisterScript("ChatStorySuggestionPrefixScript", () => { - return html`💬`; - }, false); + window.igRegisterScript( + 'ChatStoryMessageHeaderScript', + (ctx) => { + if (ctx?.message?.sender === 'user') { + return html``; + } + + return html` +
+ + Support Agent +
+ `; + }, + false, + ); + + window.igRegisterScript( + 'ChatStoryMessageActionsScript', + (ctx) => { + if (ctx?.message?.sender === 'user' || !ctx?.message?.text) { + return html``; + } + + return html` + { + /* invoke mark as helpful */ + }} + > + 👍 + + `; + }, + false, + ); + + window.igRegisterScript( + 'ChatStoryInputActionsStartScript', + () => { + return html`🎙️`; + }, + false, + ); + + window.igRegisterScript( + 'ChatStorySuggestionPrefixScript', + () => { + return html`💬`; + }, + false, + ); } -registerChatTemplates(); \ No newline at end of file +registerChatTemplates(); diff --git a/stories/wwwroot/js/stories.js b/stories/wwwroot/js/stories.js index 408b8ad1..aed2185e 100644 --- a/stories/wwwroot/js/stories.js +++ b/stories/wwwroot/js/stories.js @@ -1 +1 @@ -import './Chat.stories.js'; \ No newline at end of file +import './Chat.stories.js'; diff --git a/tests/IgniteUI.Blazor.Lite.IntegrationTests/ComponentTest.cs b/tests/IgniteUI.Blazor.Lite.IntegrationTests/ComponentTest.cs index 653b8420..81b1fd21 100644 --- a/tests/IgniteUI.Blazor.Lite.IntegrationTests/ComponentTest.cs +++ b/tests/IgniteUI.Blazor.Lite.IntegrationTests/ComponentTest.cs @@ -1,10 +1,6 @@ -using Microsoft.Playwright.NUnit; +using IgniteUI.Blazor.Lite.IntegrationTests.Infrastructure; using Microsoft.Playwright; -using System.Text.RegularExpressions; -using Microsoft.AspNetCore.Mvc.RazorPages; using NUnit.Framework.Internal; -using System.Text; -using IgniteUI.Blazor.Lite.IntegrationTests.Infrastructure; namespace IgniteUI.Blazor.Lite.IntegrationTests { @@ -42,4 +38,4 @@ await Page.WaitForConsoleMessageAsync(new PageWaitForConsoleMessageOptions Assert.That(error.Length == 0, "There were errors : " + string.Join(", \n", error)); } } -} \ No newline at end of file +} diff --git a/tests/IgniteUI.Blazor.Lite.IntegrationTests/GlobalUsings.cs b/tests/IgniteUI.Blazor.Lite.IntegrationTests/GlobalUsings.cs index cefced49..32445676 100644 --- a/tests/IgniteUI.Blazor.Lite.IntegrationTests/GlobalUsings.cs +++ b/tests/IgniteUI.Blazor.Lite.IntegrationTests/GlobalUsings.cs @@ -1 +1 @@ -global using NUnit.Framework; \ No newline at end of file +global using NUnit.Framework; diff --git a/tests/IgniteUI.Blazor.Lite.IntegrationTests/Infrastructure/BlazorApplicationFactory.cs b/tests/IgniteUI.Blazor.Lite.IntegrationTests/Infrastructure/BlazorApplicationFactory.cs index 0a7a3415..561aef64 100644 --- a/tests/IgniteUI.Blazor.Lite.IntegrationTests/Infrastructure/BlazorApplicationFactory.cs +++ b/tests/IgniteUI.Blazor.Lite.IntegrationTests/Infrastructure/BlazorApplicationFactory.cs @@ -1,14 +1,9 @@ -using Microsoft.AspNetCore.Hosting.Server.Features; +using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.Hosting.Server; -using Microsoft.AspNetCore.Hosting; +using Microsoft.AspNetCore.Hosting.Server.Features; using Microsoft.AspNetCore.Mvc.Testing; -using Microsoft.Extensions.Hosting; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Hosting; namespace IgniteUI.Blazor.Lite.IntegrationTests.Infrastructure { @@ -92,7 +87,7 @@ private void EnsureServer() { Console.WriteLine(e.Message); } - + } } diff --git a/tests/IgniteUI.Blazor.Lite.IntegrationTests/Infrastructure/BlazorPageTest.cs b/tests/IgniteUI.Blazor.Lite.IntegrationTests/Infrastructure/BlazorPageTest.cs index 863b9aec..7832d2ae 100644 --- a/tests/IgniteUI.Blazor.Lite.IntegrationTests/Infrastructure/BlazorPageTest.cs +++ b/tests/IgniteUI.Blazor.Lite.IntegrationTests/Infrastructure/BlazorPageTest.cs @@ -1,11 +1,6 @@ using Microsoft.AspNetCore.Hosting; -using Microsoft.Playwright.NUnit; using Microsoft.Playwright; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; +using Microsoft.Playwright.NUnit; namespace IgniteUI.Blazor.Lite.IntegrationTests.Infrastructure { @@ -55,7 +50,8 @@ public async Task HostTearDown() // Navigate to about:blank to ensure any SignalR // connections are dropped. //await Page.GotoAsync("about:blank"); - if (Context != null) { + if (Context != null) + { await Context.DisposeAsync().ConfigureAwait(false); } await currentHost.DisposeAsync().ConfigureAwait(false); diff --git a/tests/IgniteUI.Blazor.Lite.IntegrationTests/TestUtil.cs b/tests/IgniteUI.Blazor.Lite.IntegrationTests/TestUtil.cs index 2dbb0dec..54777555 100644 --- a/tests/IgniteUI.Blazor.Lite.IntegrationTests/TestUtil.cs +++ b/tests/IgniteUI.Blazor.Lite.IntegrationTests/TestUtil.cs @@ -1,10 +1,5 @@ -using IgniteUI.Blazor.Controls; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Reflection; -using System.Text; -using System.Threading.Tasks; +using System.Reflection; +using IgniteUI.Blazor.Controls; namespace IgniteUI.Blazor.Lite.IntegrationTests { @@ -21,7 +16,8 @@ public static List GetComponentsForTesting() p.IsSubclassOf(typeof(BaseRendererControl)) && !p.Name.Contains("Base") ).ToList(); - foreach ( var c in classes) { + foreach (var c in classes) + { try { var instance = Activator.CreateInstance(c); @@ -35,7 +31,6 @@ public static List GetComponentsForTesting() { } } - return result.Where(x => !excluded.Contains(x)).ToList(); } diff --git a/tests/IgniteUI.Blazor.Lite.TestBed/Components/Common/CustomTypes.cs b/tests/IgniteUI.Blazor.Lite.TestBed/Components/Common/CustomTypes.cs index 33a0f74c..c46e2af4 100644 --- a/tests/IgniteUI.Blazor.Lite.TestBed/Components/Common/CustomTypes.cs +++ b/tests/IgniteUI.Blazor.Lite.TestBed/Components/Common/CustomTypes.cs @@ -28,7 +28,7 @@ public static readonly Dictionary PredefinedTypes StopTypingDelay = 2000, AdoptRootStyles = true, Renderers = new IgbChatRenderers() - + } }, }; diff --git a/tests/IgniteUI.Blazor.Lite.TestBed/Components/Common/Helper.cs b/tests/IgniteUI.Blazor.Lite.TestBed/Components/Common/Helper.cs index 96343ca1..6ca1ef2a 100644 --- a/tests/IgniteUI.Blazor.Lite.TestBed/Components/Common/Helper.cs +++ b/tests/IgniteUI.Blazor.Lite.TestBed/Components/Common/Helper.cs @@ -1,9 +1,7 @@ -using Newtonsoft.Json.Serialization; +using System.Reflection; using Newtonsoft.Json; -using System.Reflection; using Newtonsoft.Json.Converters; -using System.Linq; -using Newtonsoft.Json.Linq; +using Newtonsoft.Json.Serialization; namespace IgniteUI.Blazor.Lite.TestBed.Components.Common { diff --git a/tests/IgniteUI.Blazor.Lite.TestBed/Components/Common/NwindData.cs b/tests/IgniteUI.Blazor.Lite.TestBed/Components/Common/NwindData.cs index 7836bd4c..2d8721d4 100644 --- a/tests/IgniteUI.Blazor.Lite.TestBed/Components/Common/NwindData.cs +++ b/tests/IgniteUI.Blazor.Lite.TestBed/Components/Common/NwindData.cs @@ -1,5 +1,3 @@ -using System; -using System.Collections.Generic; public class NwindDataItem { public string? ProductName { get; set; } = string.Empty; diff --git a/tests/IgniteUI.Blazor.Lite.TestBed/Components/Common/ReflectionUtils.cs b/tests/IgniteUI.Blazor.Lite.TestBed/Components/Common/ReflectionUtils.cs index f5839c0d..ac72bbe9 100644 --- a/tests/IgniteUI.Blazor.Lite.TestBed/Components/Common/ReflectionUtils.cs +++ b/tests/IgniteUI.Blazor.Lite.TestBed/Components/Common/ReflectionUtils.cs @@ -1,7 +1,7 @@ -using IgniteUI.Blazor.Controls; -using Microsoft.AspNetCore.Components; -using System.Data; +using System.Data; using System.Reflection; +using IgniteUI.Blazor.Controls; +using Microsoft.AspNetCore.Components; namespace IgniteUI.Blazor.Lite.TestBed.Components.Common { @@ -32,7 +32,7 @@ public static List GetValidMethods(Type componentType) { MethodInfo[] methodInfos = componentType.GetMethods(BindingFlags.Public | BindingFlags.Instance | System.Reflection.BindingFlags.DeclaredOnly).Where(m => !m.IsSpecialName).ToArray(); var validMethods = methodInfos - // only async in this env. + // only async in this env. .Where(x => x.Name.EndsWith("Async")) // this is not user settable but exist in all classes. .Where(x => x.Name != "SetNativeElementAsync" && x.Name != "SetParametersAsync") @@ -43,7 +43,7 @@ public static List GetValidMethods(Type componentType) return validMethods.ToList(); } - public static string GetActualPropertyName(PropertyInfo propertyInfo) + public static string GetActualPropertyName(PropertyInfo propertyInfo) { var customNameAttr = propertyInfo.GetCustomAttributes(true).FirstOrDefault(x => x.GetType().Name == "WCWidgetMemberNameAttribute"); // extract actual name from attribute @@ -169,8 +169,6 @@ private static RenderFragment CreateTypedRenderFragment(T value) }; } - - public static string Camelize(string? value) { if (string.IsNullOrEmpty(value)) diff --git a/tests/IgniteUI.Blazor.Lite.TestBed/Components/Common/TestUtil.cs b/tests/IgniteUI.Blazor.Lite.TestBed/Components/Common/TestUtil.cs index 2d46726a..8354d022 100644 --- a/tests/IgniteUI.Blazor.Lite.TestBed/Components/Common/TestUtil.cs +++ b/tests/IgniteUI.Blazor.Lite.TestBed/Components/Common/TestUtil.cs @@ -1,18 +1,20 @@ -using Newtonsoft.Json.Linq; -using Newtonsoft.Json; -using System.Reflection; +using System.Reflection; using IgniteUI.Blazor.Controls; +using Newtonsoft.Json; +using Newtonsoft.Json.Linq; namespace IgniteUI.Blazor.Lite.TestBed.Components.Common { public static class TestUtil { - public static bool PropertyValuesAreEqual(object? serverValue, string? clientValue, PropertyInfo prop) { + public static bool PropertyValuesAreEqual(object? serverValue, string? clientValue, PropertyInfo prop) + { string serverString = serverValue is Enum ? EnumActualValue(serverValue) : JsonConvert.SerializeObject(serverValue, new JsonSerializerSettings() - { ContractResolver = new IgnorePropertiesResolver(ReflectionUtils.IgnoredProps().ToArray()), NullValueHandling = NullValueHandling.Ignore }); - if (serverString == clientValue) { + { ContractResolver = new IgnorePropertiesResolver(ReflectionUtils.IgnoredProps().ToArray()), NullValueHandling = NullValueHandling.Ignore }); + if (serverString == clientValue) + { return true; } if (clientValue == null) @@ -45,15 +47,18 @@ public static bool PropertyValuesAreEqual(object? serverValue, string? clientVal clientValue = string.Join(",", clientArray); } - if (prop.PropertyType == typeof(IgbDateRangeDescriptor[])) { + if (prop.PropertyType == typeof(IgbDateRangeDescriptor[])) + { var serverDateRangeArray = serverValue as IgbDateRangeDescriptor[]; var clientDateArray = JsonConvert.DeserializeObject(clientValue); - if (serverDateRangeArray == null || clientDateArray == null || serverDateRangeArray.Length != clientDateArray.Length) { + if (serverDateRangeArray == null || clientDateArray == null || serverDateRangeArray.Length != clientDateArray.Length) + { return false; } for (int i = 0; i < serverDateRangeArray.Length; i++) { - if (serverDateRangeArray[i].Type != clientDateArray[i].Type) { + if (serverDateRangeArray[i].Type != clientDateArray[i].Type) + { return false; } @@ -91,7 +96,8 @@ public static bool PropertyValuesAreEqual(object? serverValue, string? clientVal return true; } - public static string EnumActualValue(object serverValue) { + public static string EnumActualValue(object serverValue) + { var enumName = serverValue.ToString(); if (string.IsNullOrEmpty(enumName)) { @@ -105,7 +111,8 @@ public static string EnumActualValue(object serverValue) { var attrValue = customNameAttr.GetType().GetProperty("Name")?.GetValue(customNameAttr)?.ToString(); return attrValue ?? enumName.ToLowerInvariant(); } - else { + else + { return enumName.ToLowerInvariant(); } diff --git a/tests/IgniteUI.Blazor.Lite.TestBed/Components/Layout/MainLayout.razor.css b/tests/IgniteUI.Blazor.Lite.TestBed/Components/Layout/MainLayout.razor.css index df8c10ff..21a8d246 100644 --- a/tests/IgniteUI.Blazor.Lite.TestBed/Components/Layout/MainLayout.razor.css +++ b/tests/IgniteUI.Blazor.Lite.TestBed/Components/Layout/MainLayout.razor.css @@ -1,18 +1,18 @@ #blazor-error-ui { - background: lightyellow; - bottom: 0; - box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2); - display: none; - left: 0; - padding: 0.6rem 1.25rem 0.7rem 1.25rem; - position: fixed; - width: 100%; - z-index: 1000; + background: lightyellow; + bottom: 0; + box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2); + display: none; + left: 0; + padding: 0.6rem 1.25rem 0.7rem 1.25rem; + position: fixed; + width: 100%; + z-index: 1000; } - #blazor-error-ui .dismiss { - cursor: pointer; - position: absolute; - right: 0.75rem; - top: 0.5rem; - } +#blazor-error-ui .dismiss { + cursor: pointer; + position: absolute; + right: 0.75rem; + top: 0.5rem; +} diff --git a/tests/IgniteUI.Blazor.Lite.TestBed/Program.cs b/tests/IgniteUI.Blazor.Lite.TestBed/Program.cs index f8401040..a3a377cc 100644 --- a/tests/IgniteUI.Blazor.Lite.TestBed/Program.cs +++ b/tests/IgniteUI.Blazor.Lite.TestBed/Program.cs @@ -1,6 +1,5 @@ using IgniteUI.Blazor.Lite.TestBed.Components; - public class Program { public static void Main(string[] args) diff --git a/tests/IgniteUI.Blazor.Lite.TestBed/Properties/launchSettings.json b/tests/IgniteUI.Blazor.Lite.TestBed/Properties/launchSettings.json index 887746b4..4b2d68ba 100644 --- a/tests/IgniteUI.Blazor.Lite.TestBed/Properties/launchSettings.json +++ b/tests/IgniteUI.Blazor.Lite.TestBed/Properties/launchSettings.json @@ -1,29 +1,29 @@ { "$schema": "http://json.schemastore.org/launchsettings.json", - "iisSettings": { - "windowsAuthentication": false, - "anonymousAuthentication": true, - "iisExpress": { - "applicationUrl": "http://localhost:32422", - "sslPort": 0 + "iisSettings": { + "windowsAuthentication": false, + "anonymousAuthentication": true, + "iisExpress": { + "applicationUrl": "http://localhost:32422", + "sslPort": 0 + } + }, + "profiles": { + "http": { + "commandName": "Project", + "dotnetRunMessages": true, + "launchBrowser": true, + "applicationUrl": "http://localhost:5249", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" } }, - "profiles": { - "http": { - "commandName": "Project", - "dotnetRunMessages": true, - "launchBrowser": true, - "applicationUrl": "http://localhost:5249", - "environmentVariables": { - "ASPNETCORE_ENVIRONMENT": "Development" - } - }, - "IIS Express": { - "commandName": "IISExpress", - "launchBrowser": true, - "environmentVariables": { - "ASPNETCORE_ENVIRONMENT": "Development" - } + "IIS Express": { + "commandName": "IISExpress", + "launchBrowser": true, + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" } } } +} diff --git a/tests/IgniteUI.Blazor.Lite.TestBed/appsettings.Development.json b/tests/IgniteUI.Blazor.Lite.TestBed/appsettings.Development.json index 460858d6..770d3e93 100644 --- a/tests/IgniteUI.Blazor.Lite.TestBed/appsettings.Development.json +++ b/tests/IgniteUI.Blazor.Lite.TestBed/appsettings.Development.json @@ -4,7 +4,6 @@ "LogLevel": { "Default": "Information", "Microsoft.AspNetCore": "Warning" - } } } diff --git a/tests/IgniteUI.Blazor.Lite.TestBed/componentsConfig.json b/tests/IgniteUI.Blazor.Lite.TestBed/componentsConfig.json index ccbfe5c3..e720cfd4 100644 --- a/tests/IgniteUI.Blazor.Lite.TestBed/componentsConfig.json +++ b/tests/IgniteUI.Blazor.Lite.TestBed/componentsConfig.json @@ -12,9 +12,7 @@ ] }, "IgbDatePicker": { - "ExcludedProps": [ - "ResourceStrings" - ], + "ExcludedProps": ["ResourceStrings"], "DependantMethods": [ // BUG 35182 "ReportValidityAsync", @@ -115,7 +113,7 @@ "ExcludedProps": [ // circular ref "Parent", - // this should not be settable, seems to be related to an the internal component state. + // this should not be settable, seems to be related to an the internal component state. "Level" ] }, @@ -156,7 +154,7 @@ "FocusAsync" ], "ExcludedEvents": [ - // no such client event. + // no such client event. "SelectedChanged" ] }, @@ -168,47 +166,47 @@ }, "IgbMaskInput": { "ExcludedEvents": [ - // no such client event. + // no such client event. "ValueChanging" ] }, "IgbInput": { - "ExcludedProps": [ - // Temporary exclude since these are string, but should be numbers. - "Min", - "Max" - ], - "DependantMethods": [ - // Depends on the input beign numeric. - "StepUpAsync", - "StepDownAsync" - ], - "ExcludedEvents": [ - // no such client event. - "ValueChanging" - ] - }, - "IgbRangeSlider": { - "ExcludedProps": [ - // BUG 35189 - "ValueFormatOptions" - ] - }, - "IgbStepper": { - "ExcludedProps": [ - // This is a collection of nested IgbStep components, it should probably be only a getter. - "Steps" - ], - "DependantMethods": [ - // Depends on having at least one child step, otherwise throws error. - "NextAsync", - "PrevAsync" - ] - }, - "IgbSelectGroup": { - "ExcludedProps": [ - // This is a collection of nested IgbSelectItem components, it should probably be only a getter. - "Items" - ] - } - } \ No newline at end of file + "ExcludedProps": [ + // Temporary exclude since these are string, but should be numbers. + "Min", + "Max" + ], + "DependantMethods": [ + // Depends on the input beign numeric. + "StepUpAsync", + "StepDownAsync" + ], + "ExcludedEvents": [ + // no such client event. + "ValueChanging" + ] + }, + "IgbRangeSlider": { + "ExcludedProps": [ + // BUG 35189 + "ValueFormatOptions" + ] + }, + "IgbStepper": { + "ExcludedProps": [ + // This is a collection of nested IgbStep components, it should probably be only a getter. + "Steps" + ], + "DependantMethods": [ + // Depends on having at least one child step, otherwise throws error. + "NextAsync", + "PrevAsync" + ] + }, + "IgbSelectGroup": { + "ExcludedProps": [ + // This is a collection of nested IgbSelectItem components, it should probably be only a getter. + "Items" + ] + } +} diff --git a/tests/IgniteUI.Blazor.Lite.TestBed/wwwroot/app.css b/tests/IgniteUI.Blazor.Lite.TestBed/wwwroot/app.css index e398853b..411283fe 100644 --- a/tests/IgniteUI.Blazor.Lite.TestBed/wwwroot/app.css +++ b/tests/IgniteUI.Blazor.Lite.TestBed/wwwroot/app.css @@ -1,29 +1,32 @@ h1:focus { - outline: none; + outline: none; } -.valid.modified:not([type=checkbox]) { - outline: 1px solid #26b050; +.valid.modified:not([type='checkbox']) { + outline: 1px solid #26b050; } .invalid { - outline: 1px solid #e50000; + outline: 1px solid #e50000; } .validation-message { - color: #e50000; + color: #e50000; } .blazor-error-boundary { - background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121; - padding: 1rem 1rem 1rem 3.7rem; - color: white; + background: + url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) + no-repeat 1rem/1.8rem, + #b32121; + padding: 1rem 1rem 1rem 3.7rem; + color: white; } - .blazor-error-boundary::after { - content: "An error has occurred." - } +.blazor-error-boundary::after { + content: 'An error has occurred.'; +} .darker-border-checkbox.form-check-input { - border-color: #929292; + border-color: #929292; } diff --git a/tests/IgniteUI.Blazor.Lite.TestBed/wwwroot/app.js b/tests/IgniteUI.Blazor.Lite.TestBed/wwwroot/app.js index 0d2df25e..4de9f342 100644 --- a/tests/IgniteUI.Blazor.Lite.TestBed/wwwroot/app.js +++ b/tests/IgniteUI.Blazor.Lite.TestBed/wwwroot/app.js @@ -1,126 +1,143 @@ //function that invokes the server-side render of a component by name async function renderComponent(componentName) { - - var res = await DotNet.invokeMethodAsync('IgniteUI.Blazor.Lite.TestBed', 'SetComponentType', componentName); - console.log("Task completed successfully: " + res); + var res = await DotNet.invokeMethodAsync('IgniteUI.Blazor.Lite.TestBed', 'SetComponentType', componentName); + console.log('Task completed successfully: ' + res); } function onAfterRender() { - console.log("App Loaded."); + console.log('App Loaded.'); } async function setSelector(componentSelector) { - window.targetName = componentSelector; + window.targetName = componentSelector; } async function getErrors() { - var res = await DotNet.invokeMethodAsync('IgniteUI.Blazor.Lite.TestBed', 'GetErrors'); - return res; + var res = await DotNet.invokeMethodAsync('IgniteUI.Blazor.Lite.TestBed', 'GetErrors'); + return res; } // dispatch a spy function spyOnMethod(methodName) { - console.log("Spy on: " + methodName) - var container = document.getElementById("container"); - var target = container.querySelectorAll(window.targetName)[0]; - var spy = Spy(target, methodName); - window.SpyAgent = spy; - + console.log('Spy on: ' + methodName); + var container = document.getElementById('container'); + var target = container.querySelectorAll(window.targetName)[0]; + var spy = Spy(target, methodName); + window.SpyAgent = spy; } // check on spy to get what was called on target. async function checkOnSpy(methodName) { - var args = window.SpyAgent.args; - var result = window.SpyAgent.result[0]; - if (Object.prototype.toString.call(result) === '[object Promise]') { - result = await result; - } - var info = { methodName: methodName, args: args, result: result }; - console.log("Verify method info: ",info); - return JSON.stringify(result); + var args = window.SpyAgent.args; + var result = window.SpyAgent.result[0]; + if (Object.prototype.toString.call(result) === '[object Promise]') { + result = await result; + } + var info = { methodName: methodName, args: args, result: result }; + console.log('Verify method info: ', info); + return JSON.stringify(result); } function stringifyObject(object) { - var cacheSet = new Set(); - var result = JSON.stringify(object, function (key, value) { - if (key && key.startsWith("$") || key.startsWith("_") || key == "name" || key == "externalObject" || key == "level" || value === null) { - // skip internal and nulls - return; - } - if (typeof value === 'object' && value !== null) { - if (cacheSet.has(value)) { - // Circular reference found, discard key - return; - } - cacheSet.add(value); - } - return value; - }); - cacheSet = null; - return result; + var cacheSet = new Set(); + var result = JSON.stringify(object, function (key, value) { + if ( + (key && key.startsWith('$')) || + key.startsWith('_') || + key == 'name' || + key == 'externalObject' || + key == 'level' || + value === null + ) { + // skip internal and nulls + return; + } + if (typeof value === 'object' && value !== null) { + if (cacheSet.has(value)) { + // Circular reference found, discard key + return; + } + cacheSet.add(value); + } + return value; + }); + cacheSet = null; + return result; } function checkServerTemplate(propName) { - var container = document.getElementById("container"); - var target = container.querySelectorAll(window.targetName)[0]; - var tmpl = target[propName]; - console.log("Checking server template: " + propName); - return tmpl?.___templateId !== null; + var container = document.getElementById('container'); + var target = container.querySelectorAll(window.targetName)[0]; + var tmpl = target[propName]; + console.log('Checking server template: ' + propName); + return tmpl?.___templateId !== null; } function checkClientTemplate(propName) { - var container = document.getElementById("container"); - var target = container.querySelectorAll(window.targetName)[0]; - var tmpl = target[propName]; - console.log("Checking client template: " + propName); - return tmpl?.name === "TmplHandler"; + var container = document.getElementById('container'); + var target = container.querySelectorAll(window.targetName)[0]; + var tmpl = target[propName]; + console.log('Checking client template: ' + propName); + return tmpl?.name === 'TmplHandler'; } function checkProp(propName) { - var container = document.getElementById("container"); - // TODO - probably need more complex logic to get target here - var target = container.querySelectorAll(window.targetName)[0]; - console.log("Checking prop: " + propName); - var val = stringifyObject(target[propName]); - console.log(val); - return val; + var container = document.getElementById('container'); + // TODO - probably need more complex logic to get target here + var target = container.querySelectorAll(window.targetName)[0]; + console.log('Checking prop: ' + propName); + var val = stringifyObject(target[propName]); + console.log(val); + return val; } function triggerEvent(eventName, arg) { - var container = document.getElementById("container"); - var target = container.querySelectorAll(window.targetName)[0]; - console.log("Trigger event: " + eventName); - target.dispatchEvent(new CustomEvent(eventName, Object.assign({ - bubbles: true, - cancelable: false, - composed: true, - detail: arg || {}, - }, {}))); + var container = document.getElementById('container'); + var target = container.querySelectorAll(window.targetName)[0]; + console.log('Trigger event: ' + eventName); + target.dispatchEvent( + new CustomEvent( + eventName, + Object.assign( + { + bubbles: true, + cancelable: false, + composed: true, + detail: arg || {}, + }, + {}, + ), + ), + ); } // this spies on function calls, to know when a method was called. function Spy(obj, method) { - let spy = { - args: [], - result: [] - }; + let spy = { + args: [], + result: [], + }; - let original = obj[method]; - obj[method] = function () { - let args = [].slice.apply(arguments); - spy.count++; - spy.args.push(args); - let res = original.apply(obj, args); - spy.result.push(res); - return res; - }; + let original = obj[method]; + obj[method] = function () { + let args = [].slice.apply(arguments); + spy.count++; + spy.args.push(args); + let res = original.apply(obj, args); + spy.result.push(res); + return res; + }; - return Object.freeze(spy); + return Object.freeze(spy); } function generateClientTmpl(name) { - igRegisterScript(name, function TmplHandler(ctx) { - var html = window.igTemplating.html; - return html`
Template
`; - }, false); -} \ No newline at end of file + igRegisterScript( + name, + function TmplHandler(ctx) { + var html = window.igTemplating.html; + return html`
Template
`; + }, + false, + ); +} diff --git a/tests/IgniteUI.Blazor.Tests/BlazorComponentTestBase.cs b/tests/IgniteUI.Blazor.Tests/BlazorComponentTestBase.cs index 71344ca0..eefadad4 100644 --- a/tests/IgniteUI.Blazor.Tests/BlazorComponentTestBase.cs +++ b/tests/IgniteUI.Blazor.Tests/BlazorComponentTestBase.cs @@ -1,8 +1,8 @@ using Bunit; +using IgniteUI.Blazor.Controls; using Microsoft.Extensions.DependencyInjection; using Microsoft.JSInterop; using Moq; -using IgniteUI.Blazor.Controls; namespace IgniteUI.Blazor.Tests; diff --git a/tests/IgniteUI.Blazor.Tests/ButtonTests.cs b/tests/IgniteUI.Blazor.Tests/ButtonTests.cs index 8161df5b..ecc75b10 100644 --- a/tests/IgniteUI.Blazor.Tests/ButtonTests.cs +++ b/tests/IgniteUI.Blazor.Tests/ButtonTests.cs @@ -1,5 +1,4 @@ using Bunit; -using Microsoft.AspNetCore.Components; using IgniteUI.Blazor.Controls; namespace IgniteUI.Blazor.Tests; diff --git a/tests/IgniteUI.Blazor.Tests/CalendarTests.cs b/tests/IgniteUI.Blazor.Tests/CalendarTests.cs index fb254103..fa562174 100644 --- a/tests/IgniteUI.Blazor.Tests/CalendarTests.cs +++ b/tests/IgniteUI.Blazor.Tests/CalendarTests.cs @@ -1,4 +1,3 @@ -using Bunit; using IgniteUI.Blazor.Controls; namespace IgniteUI.Blazor.Tests; diff --git a/tests/IgniteUI.Blazor.Tests/ComboTests.cs b/tests/IgniteUI.Blazor.Tests/ComboTests.cs index 6cf6ea37..abb46ae3 100644 --- a/tests/IgniteUI.Blazor.Tests/ComboTests.cs +++ b/tests/IgniteUI.Blazor.Tests/ComboTests.cs @@ -1,4 +1,3 @@ -using Bunit; using IgniteUI.Blazor.Controls; namespace IgniteUI.Blazor.Tests; diff --git a/tests/IgniteUI.Blazor.Tests/DatePickerTests.cs b/tests/IgniteUI.Blazor.Tests/DatePickerTests.cs index 1c4c0b75..f82bc8e6 100644 --- a/tests/IgniteUI.Blazor.Tests/DatePickerTests.cs +++ b/tests/IgniteUI.Blazor.Tests/DatePickerTests.cs @@ -1,4 +1,3 @@ -using Bunit; using IgniteUI.Blazor.Controls; namespace IgniteUI.Blazor.Tests; diff --git a/tests/IgniteUI.Blazor.Tests/PropertySerializationTests.cs b/tests/IgniteUI.Blazor.Tests/PropertySerializationTests.cs index 974c7548..19dc3fff 100644 --- a/tests/IgniteUI.Blazor.Tests/PropertySerializationTests.cs +++ b/tests/IgniteUI.Blazor.Tests/PropertySerializationTests.cs @@ -1,4 +1,3 @@ -using Bunit; using IgniteUI.Blazor.Controls; namespace IgniteUI.Blazor.Tests; diff --git a/webpack.config.js b/webpack.config.js index f0006020..34e9398f 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -3,7 +3,7 @@ const path = require('path'); const HtmlWebpackPlugin = require('html-webpack-plugin'); const nodeEnv = process.env.NODE_ENV || 'development'; const isProd = nodeEnv === 'production'; -const TsconfigPathsPlugin = require("tsconfig-paths-webpack-plugin"); +const TsconfigPathsPlugin = require('tsconfig-paths-webpack-plugin'); const CopyWebpackPlugin = require('copy-webpack-plugin'); const glob = require('glob'); @@ -84,20 +84,20 @@ export async function afterServerStarted(blazor) { const plugins = [ new webpack.DefinePlugin({ 'process.env': { - NODE_ENV: JSON.stringify(nodeEnv) - } + NODE_ENV: JSON.stringify(nodeEnv), + }, }), new webpack.LoaderOptionsPlugin({ options: { tslint: { emitErrors: true, - failOnHint: true - } - } + failOnHint: true, + }, + }, }), new HtmlWebpackPlugin({ - templateContent: function (params) { - return `var currScript = document.currentScript; + templateContent: function (params) { + return `var currScript = document.currentScript; var entryScript = document.createElement("script"); entryScript.async = false; if (currScript.src.indexOf("?bustv2=") >= 0 || window.__igLibraryLoad) { @@ -117,9 +117,9 @@ if (currScript.src.indexOf("?bustv2=") >= 0 || window.__igLibraryLoad) { document.write(entryScript.outerHTML); } `; - }, - filename: path.join(__dirname, './src/wwwroot/app.bootstrap.js'), - inject: false, + }, + filename: path.join(__dirname, './src/wwwroot/app.bootstrap.js'), + inject: false, }), new HtmlWebpackPlugin({ templateContent: function (params) { @@ -141,63 +141,67 @@ if (currScript.src.indexOf("?bustv2=") >= 0 || window.__igLibraryLoad) { }, filename: path.join(__dirname, './src/wwwroot/app.bundle.js'), inject: false, -}), -new HtmlWebpackPlugin({ - templateContent: function (params) { - return bootFileContent; - }, - filename: path.join(__dirname, './src/wwwroot/IgniteUI.Blazor.Lite.lib.module.js'), - inject: false, -}) + }), + new HtmlWebpackPlugin({ + templateContent: function (params) { + return bootFileContent; + }, + filename: path.join(__dirname, './src/wwwroot/IgniteUI.Blazor.Lite.lib.module.js'), + inject: false, + }), ]; var config = { devtool: isProd ? 'hidden-source-map' : 'source-map', context: path.resolve('./src/src'), entry: { - app: ['./index.ts', ...glob.sync('./index.*.part.ts', { cwd: path.resolve('./src/src')})] + app: ['./index.ts', ...glob.sync('./index.*.part.ts', { cwd: path.resolve('./src/src') })], }, output: { path: path.resolve('./src/wwwroot'), filename: '[name].[contenthash].bundle.js', globalObject: 'this', - library: "InfragisticsBlazor" + library: 'InfragisticsBlazor', }, - module: { - rules: [ - { - oneOf: [ - { - enforce: 'pre', - test: /\.worker\.ts$/, - exclude: [/\/node_modules\//], - use: [{ - loader: 'worker-loader', - options: { filename: 'heatWorker.js' } - }, - 'ts-loader', 'source-map-loader'] - }, - { - enforce: 'pre', - test: /\.tsx?$/, - exclude: [/\/node_modules\//], - use: ['ts-loader', 'source-map-loader'] - }] - }, - { test: /\.html$/, loader: 'html-loader' }, - { test: /\.css$/, use: ['style-loader', 'css-loader'] } - ].filter(Boolean) + module: { + rules: [ + { + oneOf: [ + { + enforce: 'pre', + test: /\.worker\.ts$/, + exclude: [/\/node_modules\//], + use: [ + { + loader: 'worker-loader', + options: { filename: 'heatWorker.js' }, + }, + 'ts-loader', + 'source-map-loader', + ], + }, + { + enforce: 'pre', + test: /\.tsx?$/, + exclude: [/\/node_modules\//], + use: ['ts-loader', 'source-map-loader'], + }, + ], + }, + { test: /\.html$/, loader: 'html-loader' }, + { test: /\.css$/, use: ['style-loader', 'css-loader'] }, + ].filter(Boolean), }, resolve: { extensions: ['.ts', '.js'], - plugins: [new TsconfigPathsPlugin({ extensions: [".ts", ".tsx", ".js"], configFile: "./tsconfig.json" })] + plugins: [new TsconfigPathsPlugin({ extensions: ['.ts', '.tsx', '.js'], configFile: './tsconfig.json' })], }, plugins: plugins, devServer: { contentBase: path.join(__dirname, 'dist/'), compress: true, port: 3000, - hot: true + hot: true, }, // optimization: { // splitChunks: { @@ -297,10 +301,10 @@ var config = { test: /(igniteui-webgrids)/, name: 'igniteui-webgrids', chunks: 'async', - } - } - } - } + }, + }, + }, + }, }; module.exports = config;