Skip to content

Commit

Permalink
fix(input): textarea style
Browse files Browse the repository at this point in the history
  • Loading branch information
koory1st committed Nov 14, 2023
1 parent cedc927 commit c9e4ebc
Show file tree
Hide file tree
Showing 14 changed files with 23 additions and 67 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"homepage": "https://koory1st.github.io/svelement-ui/",
"scripts": {
"build": "pnpm -r build",
"dev-docs": "pnpm --filter=docs run dev",
"dev": "pnpm --filter=docs run dev",
"fix": "concurrently \"prettier --plugin-search-dir . --write .\" \"eslint --fix .\"",
"lint": "concurrently \"prettier -c --plugin-search-dir . .\" \"eslint .\"",
"check": "pnpm -r --filter=\"./packages/**\" run check && pnpm lint",
Expand Down
3 changes: 1 addition & 2 deletions packages/input/src/lib/input.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -275,11 +275,10 @@
}
function resizeTextarea() {
console.log('%c ---> autosize: ', 'color:#F0F;', autosize);
if (!textAreaRef) {
return '';
}
if (type !== 'textarea' || !textAreaRef.value) {
if (type !== 'textarea') {
return '';
}
Expand Down
3 changes: 1 addition & 2 deletions packages/util-array-2-class-string/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@
"main": "dist/index.js",
"types": "dist/index.d.ts",
"scripts": {
"check": "tsc",
"build": "vite build && tsc",
"build": "vite build",
"clean": "rimraf dist"
},
"devDependencies": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/** @format */

import { ArgumentError } from '@svelement-ui/util-errors';

/**
* array2string
*
Expand All @@ -14,9 +15,7 @@ import { ArgumentError } from '@svelement-ui/util-errors';
*
* @param arrayInput
*/
export default function array2string(
arrayInput: (string | string[] | [string, boolean])[],
): string | null {
export default function array2string(arrayInput) {
if (!arrayInput || arrayInput.length === 0) {
return null;
}
Expand Down
2 changes: 1 addition & 1 deletion packages/util-array-2-class-string/vite.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { resolve } from 'path';
export default defineConfig({
build: {
lib: {
entry: resolve(__dirname, 'src/index.ts'),
entry: resolve(__dirname, 'src/index.js'),
name: 'index',
fileName: 'index',
},
Expand Down
3 changes: 1 addition & 2 deletions packages/util-array-2-style-string/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@
"main": "dist/index.js",
"types": "dist/index.d.ts",
"scripts": {
"check": "tsc",
"build": "vite build && tsc",
"build": "vite build",
"clean": "rimraf dist"
},
"publishConfig": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,7 @@ const noPxStyleList = ['z-index'];
*
* @param input
*/
export default function array2StyleString(
input: (
| string
| string[]
| [string, number]
| [string, null]
| [string, undefined]
| [string, string, boolean]
| [string, number, boolean]
| [string, []]
)[],
): string | null {
export default function array2StyleString(input) {
if (!input || input.length === 0) {
return null;
}
Expand Down
2 changes: 1 addition & 1 deletion packages/util-array-2-style-string/vite.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { resolve } from 'path';
export default defineConfig({
build: {
lib: {
entry: resolve(__dirname, 'src/index.ts'),
entry: resolve(__dirname, 'src/index.js'),
name: 'index',
fileName: 'index',
},
Expand Down
3 changes: 1 addition & 2 deletions packages/util-checkbox/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@
"main": "dist/index.js",
"types": "dist/index.d.ts",
"scripts": {
"check": "tsc",
"build": "vite build && tsc",
"build": "vite build",
"clean": "rimraf dist"
},
"publishConfig": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { SvelPropValidateError } from '@svelement-ui/util-errors';

/**
* getDisabled
*
Expand All @@ -11,14 +12,7 @@ import { SvelPropValidateError } from '@svelement-ui/util-errors';
* @param min
* @param innerChecked
*/
export function getDisabled(
disabledProp: boolean,
groupFlg: boolean,
group: Array<string | number | boolean>,
maxInput: string | number | null,
minInput: string | number | null,
innerChecked: boolean,
): boolean {
export function getDisabled(disabledProp, groupFlg, group, maxInput, minInput, innerChecked) {
if (!groupFlg) {
return disabledProp;
}
Expand All @@ -36,11 +30,7 @@ export function getDisabled(
return disabledProp;
}

export function getInnerCheckedValue(
isGroup: boolean,
checkedValue: string | number | boolean | null | undefined,
label: string | number | boolean | null | undefined,
): boolean | string | number | null {
export function getInnerCheckedValue(isGroup, checkedValue, label) {
// not in group
if (!isGroup) {
if (checkedValue !== null && checkedValue !== undefined) {
Expand All @@ -60,11 +50,7 @@ export function getInnerCheckedValue(
return null;
}

export function getValueByInnerChecked(
innerChecked: boolean,
innerCheckedValue: boolean | string | number | null,
uncheckedValue: string | number | boolean | null | undefined,
): boolean | string | number {
export function getValueByInnerChecked(innerChecked, innerCheckedValue, uncheckedValue) {
if (innerChecked) {
if (innerCheckedValue === null) {
return true;
Expand All @@ -78,10 +64,7 @@ export function getValueByInnerChecked(
}
}

export function validateCheckedValue(
checkedValue: string | number | boolean | null | undefined,
uncheckedValue: string | number | boolean | null | undefined,
) {
export function validateCheckedValue(checkedValue, uncheckedValue) {
if (checkedValue === null) {
return;
}
Expand All @@ -100,12 +83,7 @@ export function validateCheckedValue(
}
}

export function getGroupByInnerChecked(
isGroup: boolean,
innerChecked: boolean,
group: Array<string | number | boolean>,
innerCheckedValue: boolean | string | number | null,
): Array<string | number | boolean> {
export function getGroupByInnerChecked(isGroup, innerChecked, group, innerCheckedValue) {
if (!isGroup) {
return group;
}
Expand All @@ -124,12 +102,7 @@ export function getGroupByInnerChecked(
return Array.from(groupSet);
}

export function getInnerCheckedByValue(
isGroup: boolean,
value: boolean | string | number,
group: Array<string | number | boolean>,
innerCheckedValue: boolean | string | number | null,
): boolean {
export function getInnerCheckedByValue(isGroup, value, group, innerCheckedValue) {
if (innerCheckedValue === null) {
return Boolean(value);
}
Expand All @@ -142,7 +115,7 @@ export function getInnerCheckedByValue(
}
}

export function boolNull(value: boolean | null): boolean | null {
export function boolNull(value) {
if (value) {
return true;
}
Expand Down
2 changes: 1 addition & 1 deletion packages/util-checkbox/vite.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { resolve } from 'path';
export default defineConfig({
build: {
lib: {
entry: resolve(__dirname, 'src/index.ts'),
entry: resolve(__dirname, 'src/index.js'),
name: 'index',
fileName: 'index',
},
Expand Down
3 changes: 1 addition & 2 deletions packages/util-errors/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@
}
},
"scripts": {
"check": "tsc",
"build": "vite build && tsc",
"build": "vite build",
"clean": "rimraf dist"
},
"publishConfig": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
export class ArgumentError extends Error {
constructor(message: string) {
constructor(message) {
super(message);
this.name = 'ArgumentError';
}
}

export class SvelPropValidateError extends Error {
constructor(message: string) {
constructor(message) {
super(message);
this.name = 'SvelPropValidateError';
}
Expand Down
2 changes: 1 addition & 1 deletion packages/util-errors/vite.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { resolve } from 'path';
export default defineConfig({
build: {
lib: {
entry: resolve(__dirname, 'src/index.ts'),
entry: resolve(__dirname, 'src/index.js'),
name: 'index',
fileName: 'index',
},
Expand Down

0 comments on commit c9e4ebc

Please sign in to comment.