From 556b8d55946aaef25294ae710b3f04ccc197cb38 Mon Sep 17 00:00:00 2001 From: Sagi Date: Fri, 30 Sep 2022 09:28:03 +0800 Subject: [PATCH 01/13] feature: implement tabs props --- .../ui-vue/components/tabs/src/tabs.props.ts | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/packages/ui-vue/components/tabs/src/tabs.props.ts b/packages/ui-vue/components/tabs/src/tabs.props.ts index e69de29bb2d..2830d5080d6 100644 --- a/packages/ui-vue/components/tabs/src/tabs.props.ts +++ b/packages/ui-vue/components/tabs/src/tabs.props.ts @@ -0,0 +1,24 @@ +import { ExtractPropTypes, PropType } from 'vue'; + +export type TabType = 'fill' | 'pills' | 'default'; +export type TabPosition = 'left' | 'right' | 'top' | 'bottom'; + +export const tabsProps = { + tabTab: { type: String as PropType, default: 'default' }, + autoTitleWidth: { type: Boolean, default: false }, + titleLength: { type: Number, default: 7 }, + position: { type: String as PropType, default: 'top' }, + showDropDwon: { type: Boolean, default: false }, + showTooltips: { type: Boolean, default: false }, + scrollStep: { type: Number, default: 1 }, + autoResize: { type: Boolean, default: false }, + closeable: { type: Boolean, default: false }, + selectedTab: { type: String, default: '' }, + width: { type: Number }, + height: { type: Number }, + searchBoxVisible: { type: Boolean, default: true }, + titleWidth: { type: Number, default: 0 }, + customClass: { type: String, default: '' }, +}; + +export type TabsProps = ExtractPropTypes; -- Gitee From 1aea7f3057803390f9964682b79bfc92e6f6c669 Mon Sep 17 00:00:00 2001 From: Sagi Date: Fri, 30 Sep 2022 14:05:39 +0800 Subject: [PATCH 02/13] feature: implement tabs render template --- commitlint.config.js | 210 +++++++++--------- .../components/tabs/src/tabs.component.html | 97 ++++++++ .../components/tabs/src/tabs.component.tsx | 131 +++++++++++ 3 files changed, 334 insertions(+), 104 deletions(-) create mode 100644 packages/ui-vue/components/tabs/src/tabs.component.html diff --git a/commitlint.config.js b/commitlint.config.js index b2388de1e27..f810e4704b1 100644 --- a/commitlint.config.js +++ b/commitlint.config.js @@ -1,110 +1,112 @@ const types = ['config', 'feature', 'fix', 'docs', 'style', 'refactor', 'performance', 'test', 'build', 'release', 'chore', 'revert']; module.exports = { - parserPreset: { parserOpts: { headerPattern: /^(\w*)(?:\((.*)\))?!?: (.*)$/ } }, - extends: ['@commitlint/config-conventional'], - rules: { - 'type-empty': [2, 'never'], - 'type-enum': [2, 'always', types], - 'scope-case': [0, 'always'], - 'subject-empty': [2, 'never'], - 'subject-case': [0, 'never'], - 'header-max-length': [2, 'always', 88], - }, - prompt: { - questions: { - type: { - description: "Select the type of change that you're committing", - enum: { - config: { - description: 'Changes that affect the tools, such as eslint, npm, vscode.', - title: 'Config', - emoji: '🛠', - }, - feature: { - description: 'A new feature', - title: 'Features', - emoji: '✨', - }, - fix: { - description: 'A bug fix', - title: 'Bug Fixes', - emoji: '🐛', - }, - docs: { - description: 'Documentation only changes', - title: 'Documentation', - emoji: '📚', - }, - style: { - description: 'Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)', - title: 'Styles', - emoji: '💎', - }, - refactor: { - description: 'A code change that neither fixes a bug nor adds a feature', - title: 'Code Refactoring', - emoji: '📦', - }, - performance: { - description: 'A code change that improves performance', - title: 'Performance Improvements', - emoji: '🚀', - }, - test: { - description: 'Adding missing tests or correcting existing tests', - title: 'Tests', - emoji: '🚨', - }, - build: { - description: 'Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm)', - title: 'Builds', - emoji: '🛠', - }, - ci: { - description: 'Changes to our CI configuration files and scripts (example scopes: Travis, Circle, BrowserStack, SauceLabs)', - title: 'Continuous Integrations', - emoji: '⚙️', - }, - chore: { - description: "Other changes that don't modify src or test files", - title: 'Chores', - emoji: '♻️', - }, - revert: { - description: 'Reverts a previous commit', - title: 'Reverts', - emoji: '🗑', - }, + parserPreset: { parserOpts: { headerPattern: /^(\w*)(?:\((.*)\))?!?: (.*)$/ } }, + extends: ['@commitlint/config-conventional'], + rules: { + 'type-empty': [2, 'never'], + 'type-enum': [2, 'always', types], + 'scope-case': [0, 'always'], + 'subject-empty': [2, 'never'], + 'subject-case': [0, 'never'], + 'header-max-length': [2, 'always', 88], + }, + prompt: { + questions: { + type: { + description: "Select the type of change that you're committing", + enum: { + config: { + description: 'Changes that affect the tools, such as eslint, npm, vscode.', + title: 'Config', + emoji: '🛠', + }, + feature: { + description: 'A new feature', + title: 'Features', + emoji: '✨', + }, + fix: { + description: 'A bug fix', + title: 'Bug Fixes', + emoji: '🐛', + }, + docs: { + description: 'Documentation only changes', + title: 'Documentation', + emoji: '📚', + }, + style: { + description: + 'Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)', + title: 'Styles', + emoji: '💎', + }, + refactor: { + description: 'A code change that neither fixes a bug nor adds a feature', + title: 'Code Refactoring', + emoji: '📦', + }, + performance: { + description: 'A code change that improves performance', + title: 'Performance Improvements', + emoji: '🚀', + }, + test: { + description: 'Adding missing tests or correcting existing tests', + title: 'Tests', + emoji: '🚨', + }, + build: { + description: 'Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm)', + title: 'Builds', + emoji: '🛠', + }, + ci: { + description: + 'Changes to our CI configuration files and scripts (example scopes: Travis, Circle, BrowserStack, SauceLabs)', + title: 'Continuous Integrations', + emoji: '⚙️', + }, + chore: { + description: "Other changes that don't modify src or test files", + title: 'Chores', + emoji: '♻️', + }, + revert: { + description: 'Reverts a previous commit', + title: 'Reverts', + emoji: '🗑', + }, + }, + }, + scope: { + description: 'What is the scope of this change (e.g. component or file name)', + }, + subject: { + description: 'Write a short, imperative tense description of the change', + }, + body: { + description: 'Provide a longer description of the change', + }, + isBreaking: { + description: 'Are there any breaking changes?', + }, + breakingBody: { + description: 'A BREAKING CHANGE commit requires a body. Please enter a longer description of the commit itself', + }, + breaking: { + description: 'Describe the breaking changes', + }, + isIssueAffected: { + description: 'Does this change affect any open issues?', + }, + issuesBody: { + description: 'If issues are closed, the commit requires a body. Please enter a longer description of the commit itself', + }, + issues: { + description: 'Add issue references (e.g. "fix #123", "re #123".)', + }, }, - }, - scope: { - description: 'What is the scope of this change (e.g. component or file name)', - }, - subject: { - description: 'Write a short, imperative tense description of the change', - }, - body: { - description: 'Provide a longer description of the change', - }, - isBreaking: { - description: 'Are there any breaking changes?', - }, - breakingBody: { - description: 'A BREAKING CHANGE commit requires a body. Please enter a longer description of the commit itself', - }, - breaking: { - description: 'Describe the breaking changes', - }, - isIssueAffected: { - description: 'Does this change affect any open issues?', - }, - issuesBody: { - description: 'If issues are closed, the commit requires a body. Please enter a longer description of the commit itself', - }, - issues: { - description: 'Add issue references (e.g. "fix #123", "re #123".)', - }, }, - } }; diff --git a/packages/ui-vue/components/tabs/src/tabs.component.html b/packages/ui-vue/components/tabs/src/tabs.component.html new file mode 100644 index 00000000000..7cc230032d1 --- /dev/null +++ b/packages/ui-vue/components/tabs/src/tabs.component.html @@ -0,0 +1,97 @@ +
+
+ + +
+ + + +
+
+
+
+ + + +
+
+ + +
+
+ +
+
+
+ + + +
+
+ \ No newline at end of file diff --git a/packages/ui-vue/components/tabs/src/tabs.component.tsx b/packages/ui-vue/components/tabs/src/tabs.component.tsx index e69de29bb2d..49211be324d 100644 --- a/packages/ui-vue/components/tabs/src/tabs.component.tsx +++ b/packages/ui-vue/components/tabs/src/tabs.component.tsx @@ -0,0 +1,131 @@ +import { computed, defineComponent, ref, SetupContext } from 'vue'; +import { TabsProps, tabsProps } from './tabs.props'; + +export default defineComponent({ + name: 'FTabs', + props: tabsProps, + emits: [], + setup(props: TabsProps, context: SetupContext) { + const hideButtons = ref(false); + + const hideDropDown = ref(false); + + const hasInHeadClass = computed(() => { + return false; + }); + + const fill = ref(''); + + const tabType = ref(''); + + const position = ref(props.position); + + const tabs = ref([]); + + const shouldShowNavFill = computed(() => { + fill.value || tabType.value === 'fill'; + }); + + const shouldShowNavPills = computed(() => {}); + + const tabsHeaderClass = computed(() => ({ + 'farris-tabs-header': true, + 'farris-tabs-inHead': hasInHeadClass.value, + 'farris-tabs-inContent': !hasInHeadClass.value, + 'farris-tabs-nav-fill': shouldShowNavFill.value, + 'farris-tabs-nav-pills': shouldShowNavPills.value, + })); + + const tabsTitleStyle = computed(() => ({ + width: hasInHeadClass.value ? (props.titleWidth ? `${props.titleWidth}%` : '') : '', + })); + + const tabsTitleButtonClass = computed(() => ({ + btn: true, + 'sc-nav-btn': true, + 'px-1': true, + 'sc-nav-lr': true, + 'd-none': hideButtons.value, + })); + + const tabParentClass = computed(() => ({ + spacer: true, + 'f-utils-fill': true, + 'spacer-sides': !hideButtons.value && hideDropDown.value, + 'spacer-sides-dropdown': !hideButtons.value && !hideDropDown.value, + })); + + const tabContainerClass = computed(() => ({ + nav: true, + 'farris-nav-tabs': true, + 'flex-nowrap': true, + 'nav-fill': fill.value || tabType.value === 'fill', + 'nav-pills': tabType.value === 'pills', + 'flex-row': position.value === 'top' || position.value === 'bottom', + 'flex-column': position.value === 'left' || position.value === 'right', + })); + + function getTabClass(tab: any) { + return { + 'nav-item': true, + 'd-none': !tab.show, + 'f-state-active': tab.id === activeId, + 'f-state-disable': tab.disabled, + }; + } + + function getTabStyle(tab: any) { + return { width: `${tab.tabWidth}px` }; + } + + function getTabNavLinkClass(tab: any) { + return { + 'nav-link': true, + 'tabs-text-truncate': true, + active: tab.id === activeId, + disabled: tab.disabled, + }; + } + + function selectTabByIndex($event: Event, targetTabId: string) {} + + function getTabTextClass(tab: any) { + return { + 'st-tab-text': true, + 'farris-title-auto': props.autoTitleWidth, + 'farris-title-text-custom': tab.titleOverflow, + }; + } + + return () => { + return ( + <> +
+
+ +
+ +
+
+
+ {context.slots.default && context.slots.default()} + + ); + }; + }, +}); -- Gitee From c44ddb6159d2d6e975e1b76ca87e0a5266e43cd2 Mon Sep 17 00:00:00 2001 From: Sagi Date: Fri, 30 Sep 2022 14:08:10 +0800 Subject: [PATCH 03/13] feature: add tab page component --- .../src/components/tab-page.component.tsx | 0 .../tabs/src/components/tab-page.props.ts | 0 .../components/tabs/src/tabs.component.html | 97 ------------------- 3 files changed, 97 deletions(-) create mode 100644 packages/ui-vue/components/tabs/src/components/tab-page.component.tsx create mode 100644 packages/ui-vue/components/tabs/src/components/tab-page.props.ts delete mode 100644 packages/ui-vue/components/tabs/src/tabs.component.html diff --git a/packages/ui-vue/components/tabs/src/components/tab-page.component.tsx b/packages/ui-vue/components/tabs/src/components/tab-page.component.tsx new file mode 100644 index 00000000000..e69de29bb2d diff --git a/packages/ui-vue/components/tabs/src/components/tab-page.props.ts b/packages/ui-vue/components/tabs/src/components/tab-page.props.ts new file mode 100644 index 00000000000..e69de29bb2d diff --git a/packages/ui-vue/components/tabs/src/tabs.component.html b/packages/ui-vue/components/tabs/src/tabs.component.html deleted file mode 100644 index 7cc230032d1..00000000000 --- a/packages/ui-vue/components/tabs/src/tabs.component.html +++ /dev/null @@ -1,97 +0,0 @@ -
-
- - -
- - - -
-
-
-
- - - -
-
- - -
-
- -
-
-
- - - -
-
- \ No newline at end of file -- Gitee From ba863b2c91a60240c2f9f137708a4847f96e53e1 Mon Sep 17 00:00:00 2001 From: Sagi Date: Fri, 30 Sep 2022 14:23:50 +0800 Subject: [PATCH 04/13] feature: implement tab page props and remove trailing comma --- .prettierrc | 2 +- .../tabs/src/components/tab-page.props.ts | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/.prettierrc b/.prettierrc index 093c8536ed2..b387dad3396 100644 --- a/.prettierrc +++ b/.prettierrc @@ -5,7 +5,7 @@ "printWidth": 140, "semi": true, "useTabs": false, - "trailingComma": "es5", + "trailingComma": "none", "singleQuote": true, "tabWidth": 4, "endOfLine": "auto", diff --git a/packages/ui-vue/components/tabs/src/components/tab-page.props.ts b/packages/ui-vue/components/tabs/src/components/tab-page.props.ts index e69de29bb2d..5d62783060f 100644 --- a/packages/ui-vue/components/tabs/src/components/tab-page.props.ts +++ b/packages/ui-vue/components/tabs/src/components/tab-page.props.ts @@ -0,0 +1,13 @@ +import { ExtractPropTypes } from 'vue'; + +export const tabPageProps = { + tabWidth: { type: Number, default: -1 }, + id: { type: String, default: '' }, + customTitleClass: { type: String, default: '' }, + titleOverflow: { type: Boolean, default: false }, + title: { type: String, default: '' }, + selected: { type: Boolean, default: false }, + disabled: { type: Boolean, default: false }, + removeable: { type: Boolean, default: false } +}; +export type TabPageProps = ExtractPropTypes; -- Gitee From 5b8165bb387bf1aac81825b39a5f4ecdd300724e Mon Sep 17 00:00:00 2001 From: Sagi Date: Fri, 30 Sep 2022 15:02:45 +0800 Subject: [PATCH 05/13] chore: config install according component --- packages/ui-vue/components/according/index.ts | 13 ++++++ .../ui-vue/components/button-edit/index.ts | 6 +-- .../src/components/tab-page.component.tsx | 13 ++++++ packages/ui-vue/package.json | 2 +- .../ui-vue/src/components/hello-world.vue | 44 +++++++++---------- 5 files changed, 51 insertions(+), 27 deletions(-) diff --git a/packages/ui-vue/components/according/index.ts b/packages/ui-vue/components/according/index.ts index e69de29bb2d..a7099a8dc5a 100644 --- a/packages/ui-vue/components/according/index.ts +++ b/packages/ui-vue/components/according/index.ts @@ -0,0 +1,13 @@ +import type { App } from 'vue'; +import According from './src/according.component'; +import AccordingItem from './src/components/according-item.component'; + +export * from './src/according.props'; +export * from './src/components/according-item.props'; + +export default { + install(app: App): void { + app.component(According.name, According); + app.component(AccordingItem.name, AccordingItem); + } +}; diff --git a/packages/ui-vue/components/button-edit/index.ts b/packages/ui-vue/components/button-edit/index.ts index 2fe97129b41..c665405466e 100644 --- a/packages/ui-vue/components/button-edit/index.ts +++ b/packages/ui-vue/components/button-edit/index.ts @@ -6,7 +6,7 @@ export * from './src/button-edit.props'; export { ButtonEdit }; export default { - install(app: App): void { - app.component(ButtonEdit.name, ButtonEdit); - }, + install(app: App): void { + app.component(ButtonEdit.name, ButtonEdit); + } }; diff --git a/packages/ui-vue/components/tabs/src/components/tab-page.component.tsx b/packages/ui-vue/components/tabs/src/components/tab-page.component.tsx index e69de29bb2d..10a7f95d583 100644 --- a/packages/ui-vue/components/tabs/src/components/tab-page.component.tsx +++ b/packages/ui-vue/components/tabs/src/components/tab-page.component.tsx @@ -0,0 +1,13 @@ +import { defineComponent, SetupContext } from 'vue'; +import { TabPageProps, tabPageProps } from './tab-page.props'; + +export default defineComponent({ + name: 'FTabPage', + props: tabPageProps, + emits: [], + setup(props: TabPageProps, context: SetupContext) { + return () => { + return context.slots.default && context.slots.default(); + }; + } +}); diff --git a/packages/ui-vue/package.json b/packages/ui-vue/package.json index a53c30b9710..6995797ef28 100644 --- a/packages/ui-vue/package.json +++ b/packages/ui-vue/package.json @@ -1,7 +1,7 @@ { "name": "@farris/ui-vue", "private": true, - "version": "0.0.0", + "version": "0.0.1", "scripts": { "dev": "vite", "build": "vue-tsc --noEmit && vite build", diff --git a/packages/ui-vue/src/components/hello-world.vue b/packages/ui-vue/src/components/hello-world.vue index 5230910336b..3ec527ec6c4 100644 --- a/packages/ui-vue/src/components/hello-world.vue +++ b/packages/ui-vue/src/components/hello-world.vue @@ -1,38 +1,36 @@ -- Gitee From 1a831cf5aa768c61c3fc79ad9e3ae83a9637cd11 Mon Sep 17 00:00:00 2001 From: Sagi Date: Fri, 30 Sep 2022 15:05:29 +0800 Subject: [PATCH 06/13] chore: export according component and install avatar component --- packages/ui-vue/components/according/index.ts | 2 + packages/ui-vue/components/avatar/index.ts | 12 + .../components/avatar/src/avatar.component.ts | 308 ------------------ 3 files changed, 14 insertions(+), 308 deletions(-) delete mode 100644 packages/ui-vue/components/avatar/src/avatar.component.ts diff --git a/packages/ui-vue/components/according/index.ts b/packages/ui-vue/components/according/index.ts index a7099a8dc5a..2f855cba208 100644 --- a/packages/ui-vue/components/according/index.ts +++ b/packages/ui-vue/components/according/index.ts @@ -5,6 +5,8 @@ import AccordingItem from './src/components/according-item.component'; export * from './src/according.props'; export * from './src/components/according-item.props'; +export { According, AccordingItem }; + export default { install(app: App): void { app.component(According.name, According); diff --git a/packages/ui-vue/components/avatar/index.ts b/packages/ui-vue/components/avatar/index.ts index e69de29bb2d..7b6019b1559 100644 --- a/packages/ui-vue/components/avatar/index.ts +++ b/packages/ui-vue/components/avatar/index.ts @@ -0,0 +1,12 @@ +import type { App } from 'vue'; +import Avatar from './src/avatar.component'; + +export * from './src/avatar.props'; + +export { Avatar }; + +export default { + install(app: App): void { + app.component(Avatar.name, Avatar); + } +}; diff --git a/packages/ui-vue/components/avatar/src/avatar.component.ts b/packages/ui-vue/components/avatar/src/avatar.component.ts deleted file mode 100644 index 2bc6655fa36..00000000000 --- a/packages/ui-vue/components/avatar/src/avatar.component.ts +++ /dev/null @@ -1,308 +0,0 @@ -import { Component, OnInit, ViewChildren, ElementRef, Input, Output, EventEmitter, HostListener, ViewChild, forwardRef } from '@angular/core'; -import { Observable, Subject } from 'rxjs'; -import { NotifyService } from '@farris/ui-notify'; -import { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms'; -import { LocaleService } from '@farris/ui-locale'; - -export interface upImageFile { - size: number; - name: string; - type: string; - lastModified?: string; - lastModifiedDate?: Date; - state?: string; - base64?: string; -} - -@Component({ - selector: 'farris-avatar', - templateUrl: './avatar.component.html', - styleUrls: ['./avatar.component.scss'], - providers: [ - { - provide: NG_VALUE_ACCESSOR, - useExisting: forwardRef(() => AvatarComponent), - multi: true - } - ] -}) -export class AvatarComponent implements ControlValueAccessor, OnInit { - private defaultImgSrc = 'data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEAZABkAAD/2wBDAAwICQoJBwwKCQoNDAwOER0TERAQESMZGxUdKiUsKyklKCguNEI4LjE/MigoOk46P0RHSktKLTdRV1FIVkJJSkf/2wBDAQwNDREPESITEyJHMCgwR0dHR0dHR0dHR0dHR0dHR0dHR0dHR0dHR0dHR0dHR0dHR0dHR0dHR0dHR0dHR0dHR0f/wAARCAEsASwDASIAAhEBAxEB/8QAGgABAQEBAQEBAAAAAAAAAAAAAAECAwQFB//EADMQAQEAAQEECAQGAgMBAAAAAAABAhEDITFBBBRRUmFxgaESkcHwEyIysdHhM3IjQvE0/8QAFQEBAQAAAAAAAAAAAAAAAAAAAAH/xAAXEQEBAQ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5b/rfoD00vARAQqAhfvcVNfL3A1WMqDSxmVQVNr/iz4/pv7LDOXLDLGcbNPDeDxTh6DtOjZaafFju816tlf+2Puo4Dv1bPvY+51bLvY+5RwHfq2Xex9zquXex9yjgO/Vcu9j7nVc+9j7lHAd+q597H3Oq597H3BwHfqufex9zqufex9yjgO/Vc+9j7nVc+9j7lHAd+q597H3Oq597H3KOA79Vz72PudVz72PuUcB36rl3sfc6rn3sfco4DvejZd7H3OrZd7H3KOA79Wy72PudWz72PuDg7dG/y3/W/Q6tl3sfdvY7K7PO25S6yzSdoOqWlEBmhaBamt+6J6AnmqaqDQy0CxYyoNCKC6m/VAGhPJdQBOSgKi6+QGu41QBRAF1LUABbUABNdAVOYUC0tE13gIWloCcTXeloFQLQTmffMtT74gixOa6gqysrzBVSVQVdWdQGpRNV1BV10SUlBYIvIF1E1Ne0F5iAKIAohaCmqWgBaapqC2ohqC6pqWoC2paa70tAqCACACa+F+RanyAWJ/a8vkAuqT6fVf7AVOz0X+AXVYh2egNSifx9T+wVWefyX+PqCyrqn807PQFEn0+p/YKH9H37gAc/kC6onL0P5BRP6OV8vqC2of2l/gAOSAuqan9J/AKmon9AUtL9PqnP1oCWl5ehfv5gh635nP1qWg//Z' - private errorImgSrc = 'data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAASABIAAD/4QBARXhpZgAATU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAAqACAAQAAAABAAAAZKADAAQAAAABAAAAZAAAAAD/7QA4UGhvdG9zaG9wIDMuMAA4QklNBAQAAAAAAAA4QklNBCUAAAAAABDUHYzZjwCyBOmACZjs+EJ+/8AAEQgAZABkAwEiAAIRAQMRAf/EAB8AAAEFAQEBAQEBAAAAAAAAAAABAgMEBQYHCAkKC//EALUQAAIBAwMCBAMFBQQEAAABfQECAwAEEQUSITFBBhNRYQcicRQygZGhCCNCscEVUtHwJDNicoIJChYXGBkaJSYnKCkqNDU2Nzg5OkNERUZHSElKU1RVVldYWVpjZGVmZ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V/swooooAKKKKACiiigAooooAKKKKACiiigAooooA/9k='; - public imgSrc; - // public fileBinary: string; - @ViewChild('file') file: ElementRef; - // @Input() cover = ''; - tReadOnly: boolean = false; - @Input() - set readonly(value: boolean) { - if (value !== this.tReadOnly) { - let localeTitle = this.localeService.getValue('avatar.imgtitle'); - this.imgtitle = value ? '' : (this.imgTitle ? this.imgTitle : localeTitle); - this.tReadOnly = value; - } - - }; - get readonly(): boolean { - return this.tReadOnly; - } - // @Input() type; - @Input() size: number = 1; - @Input() imgTitle: string; - @Input() avatarWidth: number = 100; - @Input() avatarHeight: number = 100; - @Input() imgShape: string = 'circle'; - imgtitle: string = '点击修改'; - // @Input() isBase64:boolean = true; - @Output('imgChange') imgChange = new EventEmitter(); - - _type; - @Input() - set type(val) { - if (val && val.length) { - let types = val; - if (typeof val === 'string') { - types = val.split(','); - } - if (types && types.length) { - this.currentImgType = []; - types.forEach(t => { - if ((typeof t == 'string') && t.constructor == String) { - let tImgtype = 'image/' + t; - if (t === 'jpg') { - let jpgType = 'image/jpeg'; - this.currentImgType.push(jpgType); - } - this.currentImgType.push(tImgtype); - } - }); - if (this.currentImgType.length > 0) { - this.imgType = this.currentImgType.join(',') - } - } - } - } - get type() { - return this._type; - } - _cover; - @Input() - set cover(val) { - if (val) { - this._cover = val; - this.imgsrcInit(this.cover); - } - else { - this.imgSrc = this.defaultImgSrc; - } - } - get cover() { - return this._cover; - } - - private onChangeCallback: Function = () => { } - private onTouchedCallback: Function = () => { } - //是否加载中 - loadingImg: boolean; - imgType = 'image/*'; - imgFileObj: upImageFile; - currentImgType = ['image/image', 'image/webp', 'image/png', 'image/svg', 'image/gif', 'image/jpg', 'image/jpeg', 'image/bmp']; - constructor(private notifyService: NotifyService, public localeService: LocaleService) { - this.notifyService.config.position = 'top-center'; - } - - ngOnInit() { - // if(this.cover){ - // this.imgsrcInit(this.cover); - // } - // else{ - // this.imgSrc = this.defaultImgSrc; - // } - if (this.readonly) { - this.imgtitle = ''; - } - else if (this.imgTitle) { - this.imgtitle = this.imgTitle; - } - else { - this.imgtitle = this.localeService.getValue('avatar.imgtitle'); - } - } - /*判断cover数据格式,做出修改赋值给imgSrc - */ - imgsrcInit(val) { - let isImg = this.isSrc(val); - if (isImg) { - this.imgSrc = val; - } - else { - let isFullBase64 = this.isBaseSrc(val); - if (isFullBase64) { - this.imgSrc = val - } - else { - this.imgSrc = this.addBase64(val); - } - } - } - - @HostListener('click') - onClick(): void { - if (this.readonly) { - return; - } - (this.file.nativeElement as HTMLInputElement).click(); - } - - getfiledata(event) { - if (this.readonly) { - return; - } - const filetarget = event.target as HTMLInputElement; - let getfile = filetarget.files; - if (!getfile[0]) { - return; - } - let fileType = getfile[0].type; - const isLtSize = getfile[0].size / 1024 / 1024 < this.size; - if (this.currentImgType.indexOf(fileType) < 0) { - let typeerrorText = this.localeService.getValue('avatar.typeError'); - this.notifyService.error({ - type: 'error', - title: '', - msg: typeerrorText - }); - filetarget.value = ''; - // this.notifyService.error('上传图片类型不正确'); - return; - } - - if (!isLtSize) { - let sizeerrorText = this.localeService.getValue('avatar.sizeError'); - let errormes: string = sizeerrorText + this.size + "M!"; - this.notifyService.error({ - type: 'error', - title: '', - msg: errormes - }); - filetarget.value = ''; - // this.notifyService.error(`上传图片不能大于${this.size}M!`); - return; - } - this.transformFile(getfile[0]); - filetarget.value = ''; - } - - public getImgFileObj() { - return this.imgFileObj; - } - - transformFile(getfile: any) { - // const subject = new Subject(); - this.imgFileObj = { - size: getfile.size, - name: getfile.name, - type: getfile.type, - lastModified: getfile.lastModified, - lastModifiedDate: getfile.lastModifiedDate - } - this.do(getfile).subscribe(res => { - this.loadingImg = false; - if (res['state'] === 'done') { - this.imgSrc = res['result']; - - //this.onChangeCallback(this.imgSrc); - this.onChangeCallback(this.removeBase64(this.imgSrc)); - this.onTouchedCallback(); - } - else if (res['state'] === 'error') { - let uploaderrorText = this.localeService.getValue('avatar.uploadError'); - this.notifyService.error({ - type: 'error', - title: '', - msg: uploaderrorText - }) - // this.notifyService.error('图片上传失败,请重试!'); - } - this.imgFileObj.state = res['state']; - this.imgFileObj.base64 = res['result']; - this.imgChange.emit(this.imgFileObj); - }); - } - - read(file: File): Observable { - return Observable.create(observer => { - const reader = new FileReader(); - reader.readAsDataURL(file); - //this.loadingImg = true; - // reader.onloadstart=function(){} - reader.onload = () => { - //console.log(reader.result); - observer.next({ state: 'done', 'result': reader.result }); - observer.complete(); - }; - reader.onerror = function () { - observer.next({ state: 'error', 'result': reader.result }); - observer.complete(); - } - }); - } - do(file: any): Observable { - return this.read(file as File); - } - - writeValue(val: any): void { - if (val && val.length) { - // if(this.isBase64){ - // this.imgSrc = this.addBase64(val); - // } - // else{ - // this.imgSrc = val; - // } - this.imgsrcInit(val); - } - else if (this.cover) { - this.imgsrcInit(this.cover); - } - else { - this.imgSrc = this.defaultImgSrc; - } - } - registerOnChange(fn: any): void { - this.onChangeCallback = fn; - } - registerOnTouched(fn: any): void { - this.onTouchedCallback = fn; - } - // setDisabledState?(isDisabled: boolean): void { - // this.disabled = isDisabled; - // } - - addBase64(val) { - if (!val) return; - return 'data:image/jpeg;base64,' + val; - } - - removeBase64(val) { - if (!val) return; - let img_arr = val.split(','); - if (img_arr.length) { - return img_arr[1]; - } - - } - //判断是否是图片路径 - isSrc(url) { - return (url.match(/\.(jpeg|jpg|gif|png|svg|bmp|webp)$/) != null) - } - //判断是否是完成base64 - isBaseSrc(url) { - return (url.indexOf('data:image/') > -1 ? true : false) - } - - errorSrc() { - this.imgSrc = this.errorImgSrc; - this.imgtitle = this.localeService.getValue('avatar.loadError'); - } - -} -- Gitee From f1467f8470165ba79622f7835b7aa1af3f48312e Mon Sep 17 00:00:00 2001 From: Sagi Date: Fri, 30 Sep 2022 15:08:34 +0800 Subject: [PATCH 07/13] chore: export and install notify component and toast component --- packages/ui-vue/components/notify/index.ts | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/packages/ui-vue/components/notify/index.ts b/packages/ui-vue/components/notify/index.ts index e69de29bb2d..db2226d5eac 100644 --- a/packages/ui-vue/components/notify/index.ts +++ b/packages/ui-vue/components/notify/index.ts @@ -0,0 +1,15 @@ +import type { App } from 'vue'; +import Notify from './src/notify.component'; +import Toast from './src/components/toast.component'; + +export * from './src/notify.props'; +export * from './src/components/toast.props'; + +export { Notify, Toast }; + +export default { + install(app: App): void { + app.component(Notify.name, Notify); + app.component(Toast.name, Toast); + } +}; -- Gitee From b50d76541f19b41cda6090ae4acc475185b0be32 Mon Sep 17 00:00:00 2001 From: Sagi Date: Fri, 30 Sep 2022 15:10:50 +0800 Subject: [PATCH 08/13] chore: export and install popover component --- packages/ui-vue/components/popover/index.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/packages/ui-vue/components/popover/index.ts b/packages/ui-vue/components/popover/index.ts index 8b137891791..a0bb080753a 100644 --- a/packages/ui-vue/components/popover/index.ts +++ b/packages/ui-vue/components/popover/index.ts @@ -1 +1,12 @@ +import type { App } from 'vue'; +import Popover from './src/popover.component'; +export * from './src/popover.props'; + +export { Popover }; + +export default { + install(app: App): void { + app.component(Popover.name, Popover); + } +}; -- Gitee From da81bacb3e8efd001bc0d5a263d64cb3ff8d7bb1 Mon Sep 17 00:00:00 2001 From: Sagi Date: Fri, 30 Sep 2022 15:12:31 +0800 Subject: [PATCH 09/13] chore: export and install section --- packages/ui-vue/components/section/index.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/packages/ui-vue/components/section/index.ts b/packages/ui-vue/components/section/index.ts index e69de29bb2d..d9a3982bc80 100644 --- a/packages/ui-vue/components/section/index.ts +++ b/packages/ui-vue/components/section/index.ts @@ -0,0 +1,11 @@ +import type { App } from 'vue'; +import Section from './src/section.component'; + +export * from './src/section.props'; +export { Section }; + +export default { + install(app: App): void { + app.component(Section.name, Section); + } +}; -- Gitee From b0add5a0a8f6767a936243258b3d4acf215b377c Mon Sep 17 00:00:00 2001 From: Sagi Date: Fri, 30 Sep 2022 15:15:04 +0800 Subject: [PATCH 10/13] chore: export and install switch component --- packages/ui-vue/components/switch/index.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/packages/ui-vue/components/switch/index.ts b/packages/ui-vue/components/switch/index.ts index e69de29bb2d..6005024ce14 100644 --- a/packages/ui-vue/components/switch/index.ts +++ b/packages/ui-vue/components/switch/index.ts @@ -0,0 +1,10 @@ +import type { App } from 'vue'; +import Switch from './src/switch.component'; + +export * from './src/switch.props'; + +export default { + install(app: App): void { + app.component(Switch.name, Switch); + } +}; -- Gitee From f50b1afb68eca25cdf0fad37b409ebfbfa7e0c35 Mon Sep 17 00:00:00 2001 From: Sagi Date: Fri, 30 Sep 2022 15:18:15 +0800 Subject: [PATCH 11/13] chore: export and install tabs and tab page --- packages/ui-vue/components/tabs/index.ts | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/packages/ui-vue/components/tabs/index.ts b/packages/ui-vue/components/tabs/index.ts index e69de29bb2d..5e26eb651be 100644 --- a/packages/ui-vue/components/tabs/index.ts +++ b/packages/ui-vue/components/tabs/index.ts @@ -0,0 +1,15 @@ +import type { App } from 'vue'; +import Tabs from './src/tabs.component'; +import TabPage from './src/components/tab-page.component'; + +export * from './src/tabs.props'; +export * from './src/components/tab-page.props'; + +export { Tabs, TabPage }; + +export default { + install(app: App): void { + app.component(Tabs.name, Tabs); + app.component(TabPage.name, TabPage); + } +}; -- Gitee From 0ad5b7ae300a269b50aa07609a9c2542aa19cb12 Mon Sep 17 00:00:00 2001 From: Sagi Date: Fri, 30 Sep 2022 15:21:47 +0800 Subject: [PATCH 12/13] chore: export and install text component --- packages/ui-vue/components/text/index.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/packages/ui-vue/components/text/index.ts b/packages/ui-vue/components/text/index.ts index e69de29bb2d..932cffcfcaa 100644 --- a/packages/ui-vue/components/text/index.ts +++ b/packages/ui-vue/components/text/index.ts @@ -0,0 +1,11 @@ +import type { App } from 'vue'; +import Text from './src/text.component'; + +export * from './src/text.props'; +export { Text }; + +export default { + install(app: App): void { + app.component(Text.name, Text); + } +}; -- Gitee From 867b33bb8e9fbbe7b9cd161b2109eb3126564e8d Mon Sep 17 00:00:00 2001 From: Sagi Date: Fri, 30 Sep 2022 15:24:19 +0800 Subject: [PATCH 13/13] chore: export and install tooltip --- packages/ui-vue/components/tooltip/index.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/packages/ui-vue/components/tooltip/index.ts b/packages/ui-vue/components/tooltip/index.ts index e69de29bb2d..ced280da740 100644 --- a/packages/ui-vue/components/tooltip/index.ts +++ b/packages/ui-vue/components/tooltip/index.ts @@ -0,0 +1,12 @@ +import type { App } from 'vue'; +import Tooltip from './src/tooltip.component'; + +export * from './src/tooltip.props'; + +export { Tooltip }; + +export default { + install(app: App): void { + app.component(Tooltip.name, Tooltip); + } +}; -- Gitee