Skip to content

Commit

Permalink
update props
Browse files Browse the repository at this point in the history
  • Loading branch information
indirectlylit committed Feb 16, 2021
1 parent 48365fe commit f2fa1a6
Show file tree
Hide file tree
Showing 20 changed files with 50 additions and 49 deletions.
3 changes: 3 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ esLintConfig.rules['vue/attribute-hyphenation'] = 0;
// This rule conflicts with Nuxt page naming
esLintConfig.rules['kolibri/vue-filename-and-component-name-match'] = 0;

// This rule is currently disabled in kolibri-tools/.eslintrc
esLintConfig.rules['vue/require-default-prop'] = 1;

// max-len rules are unhelpful for documentation
esLintConfig.rules['max-len'] = 0;
esLintConfig.rules['vue/max-len'] = 0;
Expand Down
8 changes: 7 additions & 1 deletion docs/common/DocsExternalLink.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,16 @@
export default {
name: 'DocsExternalLink',
props: {
/**
* If provided, set the link text. Can also pass a slot.
*/
text: {
type: String,
required: false,
default: null,
},
/**
* Link URL
*/
href: {
type: String,
required: true,
Expand Down
8 changes: 4 additions & 4 deletions docs/common/DocsGithubLink.vue
Original file line number Diff line number Diff line change
Expand Up @@ -41,29 +41,29 @@
*/
text: {
type: String,
required: false,
default: null,
},
/**
* If provided, set the link URL
*/
href: {
type: String,
required: false,
default: null,
},
/**
* If provided, create a link to a PR in the design-system repo
*/
pull: {
type: [String, Number],
required: false,
default: null,
validator,
},
/**
* If provided, create a link to an issue in the design-system repo
*/
issue: {
type: [String, Number],
required: false,
default: null,
validator,
},
},
Expand Down
2 changes: 1 addition & 1 deletion docs/common/DocsInternalLink.vue
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
},
text: {
type: String,
required: false,
default: null,
},
code: {
type: Boolean,
Expand Down
2 changes: 1 addition & 1 deletion docs/common/DocsPageSection.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
props: {
title: {
type: String,
required: false,
default: null,
},
anchor: {
type: String,
Expand Down
2 changes: 1 addition & 1 deletion docs/common/DocsPageTemplate/Header.vue
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
},
title: {
type: String,
required: false,
required: true,
},
},
data() {
Expand Down
2 changes: 1 addition & 1 deletion lib/KCheckbox.vue
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
*/
label: {
type: String,
required: false,
default: null,
},
/**
* Whether or not to show the label
Expand Down
2 changes: 0 additions & 2 deletions lib/KDropdownMenu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@
*/
appearance: {
type: String,
required: false,
default: 'raised-button',
validator,
},
Expand All @@ -76,7 +75,6 @@
*/
disabled: {
type: Boolean,
required: false,
default: false,
},
/**
Expand Down
2 changes: 1 addition & 1 deletion lib/KIcon/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
*/
color: {
type: String,
required: false,
default: null,
},
/**
* @private
Expand Down
9 changes: 4 additions & 5 deletions lib/KLabeledIcon.vue
Original file line number Diff line number Diff line change
Expand Up @@ -39,27 +39,26 @@
// An icon that will be prepended to the label. Uses the same icon names as the `KIcon` component
icon: {
type: String,
required: false,
default: null,
},
// An icon that will be appended to the label. Uses the same icon names as the `KIcon` component
iconAfter: {
type: String,
required: false,
default: null,
},
// If provided, determines the color of the label and any icons that are provided
color: {
type: String,
required: false,
default: null,
},
// If provided, will place this text in the default slot
label: {
type: String,
required: false,
default: null,
},
// If provided, will limit label width to this value
maxWidth: {
type: String,
required: false,
default: '100%',
},
},
Expand Down
8 changes: 4 additions & 4 deletions lib/KModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -115,18 +115,18 @@
required: true,
},
/**
* The text of the submit button
* If provided, text of the submit button
*/
submitText: {
type: String,
required: false,
default: null,
},
/**
* The text of the cancel button
* If provided, text of the cancel button
*/
cancelText: {
type: String,
required: false,
default: null,
},
/**
* Disable the submit button
Expand Down
6 changes: 3 additions & 3 deletions lib/KRadioButton.vue
Original file line number Diff line number Diff line change
Expand Up @@ -72,14 +72,14 @@
*/
label: {
type: String,
required: false,
required: true,
},
/**
* Description for label
* If provided, description underneath label
*/
description: {
type: String,
required: false,
default: null,
},
/**
* Value that is currently assigned via v-model
Expand Down
13 changes: 6 additions & 7 deletions lib/KTextbox/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
*/
invalidText: {
type: String,
required: false,
default: null,
},
/**
* Show the `invalidText` even if the user has not focused or change the input.
Expand All @@ -83,7 +83,6 @@
showInvalidText: {
type: Boolean,
default: false,
required: false,
},
/**
* Whether or not to autofocus
Expand All @@ -97,21 +96,21 @@
*/
maxlength: {
type: Number,
required: false,
default: null,
},
/**
* HTML5 autocomplete attribute (`off`, `on`, `name`, `username`, `current-password`, etc)
*/
autocomplete: {
type: String,
required: false,
default: null,
},
/**
* HTML5 autocapitalize attribute. Used for touch-input enabled UI (`off`, `on`, `words`, etc)
*/
autocapitalize: {
type: String,
required: false,
default: null,
},
/**
* HTML5 type of input (text, password, number, etc.)
Expand All @@ -125,14 +124,14 @@
*/
min: {
type: Number,
required: false,
default: null,
},
/**
* Maximum value, used when type is 'number'
*/
max: {
type: Number,
required: false,
default: null,
},
/**
* Display as text area.
Expand Down
4 changes: 2 additions & 2 deletions lib/buttons-and-links/KButton.vue
Original file line number Diff line number Diff line change
Expand Up @@ -96,14 +96,14 @@
*/
icon: {
type: String,
required: false,
default: null,
},
/**
* If provided, appends an KIcon to the text in the button.
*/
iconAfter: {
type: String,
required: false,
default: null,
},
},
computed: {
Expand Down
4 changes: 2 additions & 2 deletions lib/buttons-and-links/KExternalLink.vue
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@
* Specifies that the file is meant to be downloaded, not displayed in a separate tab.
*/
download: {
type: String,
required: false,
type: Boolean,
default: false,
},
/**
* If provided, opens link in new tab and displays a "pop out" icon
Expand Down
3 changes: 0 additions & 3 deletions lib/buttons-and-links/KIconButton.vue
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
appearance: {
type: String,
default: 'flat-button',
required: false,
},
icon: {
type: String,
Expand All @@ -52,7 +51,6 @@
buttonType: {
type: String,
default: 'button',
required: false,
},
size: {
type: String,
Expand All @@ -63,7 +61,6 @@
},
tooltip: {
type: String,
required: false,
default: null,
},
},
Expand Down
9 changes: 4 additions & 5 deletions lib/buttons-and-links/KRouterLink.vue
Original file line number Diff line number Diff line change
Expand Up @@ -57,28 +57,27 @@
*/
icon: {
type: String,
required: false,
default: null,
},
/**
* If provided, calls window.history.replaceState() so navigation will not leave history record
* Use window.history.replaceState() so navigation will not leave history record
*/
replace: {
type: Boolean,
required: false,
default: false,
},
/**
* If provided, shows a KIcon after the text
*/
iconAfter: {
type: String,
required: false,
default: null,
},
/**
* Set a max width for content
*/
maxWidth: {
type: String,
required: false,
default: '100%',
},
},
Expand Down
6 changes: 3 additions & 3 deletions lib/grids/KFixedGrid.vue
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
*/
gutter: {
type: [Number, String],
required: false,
default: null,
validator: validateGutter,
},
/**
Expand All @@ -72,7 +72,7 @@
return parseInt(this.numCols);
},
actualGutterSize() {
if (this.gutter !== undefined) {
if (this.gutter !== null) {
return this.gutter;
}
return this.windowGutter;
Expand Down Expand Up @@ -102,7 +102,7 @@
});
Object.defineProperty(gridMetrics, 'direction', {
enumerable: true,
get: () => (this.$el ? getComputedStyle(this.$el).direction : undefined),
get: () => (this.$el ? getComputedStyle(this.$el).direction : null),
});
Object.defineProperty(gridMetrics, 'debug', {
enumerable: true,
Expand Down
4 changes: 2 additions & 2 deletions lib/grids/KFixedGridItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
*/
span: {
type: [Number, String],
required: false,
default: null,
validator: validateSpan,
},
/**
Expand All @@ -45,7 +45,7 @@
inject: ['gridMetrics'], // provided by the parent grid component
computed: {
computedSpan() {
if (this.span === undefined) {
if (this.span === null) {
return this.gridMetrics.numCols;
}
return parseInt(this.span);
Expand Down
2 changes: 1 addition & 1 deletion lib/grids/KGrid.vue
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
*/
gutter: {
type: [Number, String],
required: false,
default: null,
validator: validateGutter,
},
/**
Expand Down

0 comments on commit f2fa1a6

Please sign in to comment.