diff --git a/docs/.vitepress/components/Prop.vue b/docs/.vitepress/components/Prop.vue index c5ef75718..bd6791386 100644 --- a/docs/.vitepress/components/Prop.vue +++ b/docs/.vitepress/components/Prop.vue @@ -19,6 +19,7 @@ p + .code-prop { } .code-prop { margin-top: 10px; + font-weight: inherit !important; .shiki { margin: 0; diff --git a/docs/.vitepress/theme/style.scss b/docs/.vitepress/theme/style.scss index 80498f043..08bf56031 100644 --- a/docs/.vitepress/theme/style.scss +++ b/docs/.vitepress/theme/style.scss @@ -76,9 +76,9 @@ } // Since we force all code backgrounds to dark, -// we need to set an explicit base text color +// we need to set an explicit base text color in light mode // so that unhighlighted code blocks are readable. #356 -.vp-doc div[class*="language-"] code { +html:not(.dark) .vp-doc div[class*="language-"] code { color: var(--vp-c-bg) } diff --git a/docs/stacks/vue/coalesce-vue-vuetify/components/c-loader-status.md b/docs/stacks/vue/coalesce-vue-vuetify/components/c-loader-status.md index a07a818ed..a74598762 100644 --- a/docs/stacks/vue/coalesce-vue-vuetify/components/c-loader-status.md +++ b/docs/stacks/vue/coalesce-vue-vuetify/components/c-loader-status.md @@ -12,9 +12,6 @@ It is highly recommended that all [API Callers](/stacks/vue/layers/api-clients.m Progress is indicated with a [Vuetify](https://vuetifyjs.com/) [v-progress-linear](https://vuetifyjs.com/en/components/progress-linear) component, and errors are displayed in a [v-alert](https://vuetifyjs.com/en/components/alerts/). [Transitions](https://vuetifyjs.com/en/styles/transitions/) are applied to smoothly fade between the different states the the caller can be in. -::: tip Note -This component uses the legacy term "loader" to refer to [API Callers](/stacks/vue/layers/api-clients.md#api-callers). A new ``c-caller-status`` component may be coming in the future with a few usability improvements - if that happens, `c-loader-status` will be preserved for backwards compatibility. -::: ## Examples @@ -37,16 +34,15 @@ Wrap contents of a details/edit page: Use ``c-loader-status`` to render a progress bar and any error messages, but don't use it to control content: ``` vue-html - + ``` Wrap a save/submit button: ``` vue-html - + + ``` @@ -54,10 +50,10 @@ Hides the table before the first load has completed, or if loading the list enco ``` vue-html ... @@ -67,19 +63,43 @@ Hides the table before the first load has completed, or if loading the list enco ## Props - + -A dictionary object with entries mapping zero or more flags to one or more [API Callers](/stacks/vue/layers/api-clients.md#api-callers). Multiple entries of flags/caller pairs may be specified in the dictionary to give different behavior to different API callers. - -The available flags are as follows. All flags default to `true`, and may be prefixed with ``no-`` to set the flag to ``false`` instead of ``true``. Multiple flags may be specified at once by delimiting them with spaces. +
+ +This prop has multiple options that support simple or complex usage scenarios: + +#### Flags Per Component +A single instance, or array of [API Callers](/stacks/vue/layers/api-clients.md#api-callers), whose status will be represented by the component. The [flags](#flags) for these objects will be determined from the component-level [flag props](#flags-props). + +``` vue-html + +``` + +#### Flags Per Caller +A more advanced usage allows passing different flags for different callers. Provide a dictionary object with entries mapping zero or more [flags](#flags) to one or more [API Callers](/stacks/vue/layers/api-clients.md#api-callers). Multiple entries of flags/caller pairs may be specified in the dictionary to give different behavior to different API callers. These flags are layered on top of the base [flag props](#flags-props). + +``` vue-html + +``` + +
+
-|
Flag
| Description | -| - | - | -| `loading-content` | Controls whether the default slot is rendered while any API caller is loading (i.e. when `caller.isLoading === true`). | -| `error-content` | Controls whether the default slot is rendered while any API Caller is in an error state (i.e. when `caller.wasSuccessful === false`). | -| `initial-content` | Controls whether the default slot is rendered while any API Caller has yet to receive a response for the first time (i.e. when `caller.wasSuccessful === null`). | -| `initial-progress` | Controls whether the progress indicator is shown when an API Caller is loading for the very first time (i.e. when `caller.wasSuccessful === null`). | -| `secondary-progress` | Controls whether the progress indicator is shown when an API Caller is loading any time after its first invocation (i.e. when `caller.wasSuccessful !== null`). | @@ -89,6 +109,29 @@ Specify if space should be reserved for the progress indicator. If set to false, Specifies the height in pixels of the [v-progress-linear](https://vuetifyjs.com/en/components/progress-linear) used to indicate progress. + + +Component level [flags](#flags) options that control behavior when the simple form of `loaders` (single instance or array) is used, as well as provide baseline defaults that can be overridden by the advanced form of `loaders` (object map) . + +## Flags + +The available flags are as follows, all of which default to `true`. In the object literal syntax for `loaders`, the `no-` prefix may be omitted to set the flag to `true`. + +|
Flag
| Description | +| - | - | +| `no-loading-content` | Controls whether the default slot is rendered while any API caller is loading (i.e. when `caller.isLoading === true`). | +| `no-error-content` | Controls whether the default slot is rendered while any API Caller is in an error state (i.e. when `caller.wasSuccessful === false`). | +| `no-initial-content` | Controls whether the default slot is rendered while any API Caller has yet to receive a response for the first time (i.e. when `caller.wasSuccessful === null`). | +| `no-progress` | Master toggle for whether the progress indicator is shown in any scenario. | +| `no-initial-progress` | Controls whether the progress indicator is shown when an API Caller is loading for the very first time (i.e. when `caller.wasSuccessful === null`). | +| `no-secondary-progress` | Controls whether the progress indicator is shown when an API Caller is loading any time after its first invocation (i.e. when `caller.wasSuccessful !== null`). | + ## Slots ``default`` - Accepts the content whose visibility is controlled by the state of the supplied [API Callers](/stacks/vue/layers/api-clients.md#api-callers). It will be shown or hidden according to the flags defined for each caller. diff --git a/docs/stacks/vue/coalesce-vue-vuetify/components/c-table.md b/docs/stacks/vue/coalesce-vue-vuetify/components/c-table.md index eb7286673..e00fbbce3 100644 --- a/docs/stacks/vue/coalesce-vue-vuetify/components/c-table.md +++ b/docs/stacks/vue/coalesce-vue-vuetify/components/c-table.md @@ -2,7 +2,7 @@ -A table component for displaying the contents of a [ListViewModel](/stacks/vue/layers/viewmodels.md). Also supports modifying the list's [sort parameters](/modeling/model-components/data-sources.md#standard-parameters\) by clicking on column headers. Pairs well with a [c-list-pagination](/stacks/vue/coalesce-vue-vuetify/components/c-list-pagination.md). +A table component for displaying the contents of a [ListViewModel](/stacks/vue/layers/viewmodels.md). Also supports modifying the list's [sort parameters](/modeling/model-components/data-sources.md#standard-parameters) by clicking on column headers. Pairs well with a [c-list-pagination](/stacks/vue/coalesce-vue-vuetify/components/c-list-pagination.md). diff --git a/src/coalesce-vue-vuetify2/src/components/display/c-loader-status.vue b/src/coalesce-vue-vuetify2/src/components/display/c-loader-status.vue index 6924fb117..1660e4123 100644 --- a/src/coalesce-vue-vuetify2/src/components/display/c-loader-status.vue +++ b/src/coalesce-vue-vuetify2/src/components/display/c-loader-status.vue @@ -54,20 +54,39 @@ + +