nubomed-ui 1.0.3 → 1.0.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (144) hide show
  1. package/{nubomed-ui/nubomed-ui.es.js → nubomed-ui.es.js} +547 -581
  2. package/{nubomed-ui/nubomed-ui.umd.js → nubomed-ui.umd.js} +1 -1
  3. package/package.json +7 -18
  4. package/.env.bi +0 -13
  5. package/.env.terminal +0 -13
  6. package/.vscode/extensions.json +0 -3
  7. package/README.md +0 -17
  8. package/index.html +0 -13
  9. package/src/App.vue +0 -31
  10. package/src/bi-demos/Header.vue +0 -29
  11. package/src/bi-demos/Table.vue +0 -69
  12. package/src/bi-demos/index.vue +0 -132
  13. package/src/bi-packages/components/Box/images/corner-error.png +0 -0
  14. package/src/bi-packages/components/Box/images/corner-warning.png +0 -0
  15. package/src/bi-packages/components/Box/images/corner.png +0 -0
  16. package/src/bi-packages/components/Box/index.scss +0 -86
  17. package/src/bi-packages/components/Box/index.vue +0 -53
  18. package/src/bi-packages/components/Carousel/CarouselItem.vue +0 -0
  19. package/src/bi-packages/components/Carousel/index.vue +0 -0
  20. package/src/bi-packages/components/Header/images/left-bg.png +0 -0
  21. package/src/bi-packages/components/Header/images/logo.png +0 -0
  22. package/src/bi-packages/components/Header/images/right-bg.png +0 -0
  23. package/src/bi-packages/components/Header/index.scss +0 -50
  24. package/src/bi-packages/components/Header/index.vue +0 -54
  25. package/src/bi-packages/components/Table/TableColgroup.vue +0 -43
  26. package/src/bi-packages/components/Table/index copy.vue +0 -107
  27. package/src/bi-packages/components/Table/index.scss +0 -118
  28. package/src/bi-packages/components/Table/index.vue +0 -108
  29. package/src/bi-packages/components/TableColumn/index.scss +0 -7
  30. package/src/bi-packages/components/TableColumn/index.vue +0 -60
  31. package/src/bi-packages/fonts/OPPOSans-B.ttf +0 -0
  32. package/src/bi-packages/fonts/OPPOSans-M.ttf +0 -0
  33. package/src/bi-packages/fonts/font.scss +0 -11
  34. package/src/bi-packages/iconfont-svg/demo.css +0 -539
  35. package/src/bi-packages/iconfont-svg/demo_index.html +0 -4811
  36. package/src/bi-packages/iconfont-svg/iconfont.css +0 -819
  37. package/src/bi-packages/iconfont-svg/iconfont.js +0 -1
  38. package/src/bi-packages/iconfont-svg/iconfont.json +0 -1416
  39. package/src/bi-packages/iconfont-svg/iconfont.ttf +0 -0
  40. package/src/bi-packages/iconfont-svg/iconfont.woff +0 -0
  41. package/src/bi-packages/iconfont-svg/iconfont.woff2 +0 -0
  42. package/src/bi-packages/index.js +0 -34
  43. package/src/bi-packages/styles/mixin.scss +0 -12
  44. package/src/bi-packages/styles/var.scss +0 -11
  45. package/src/demos/ActionBar.vue +0 -59
  46. package/src/demos/Badge.vue +0 -28
  47. package/src/demos/Button copy.vue +0 -302
  48. package/src/demos/Button.vue +0 -116
  49. package/src/demos/ButtonGroup.vue +0 -40
  50. package/src/demos/Check.vue +0 -29
  51. package/src/demos/Dialog.vue +0 -255
  52. package/src/demos/Empty.vue +0 -38
  53. package/src/demos/FooterMenu.vue +0 -49
  54. package/src/demos/Header.vue +0 -71
  55. package/src/demos/Icons.vue +0 -314
  56. package/src/demos/Input.vue +0 -87
  57. package/src/demos/InputKeyboard.vue +0 -30
  58. package/src/demos/InputNumber.vue +0 -34
  59. package/src/demos/LeftMenu.vue +0 -128
  60. package/src/demos/Menus.vue +0 -106
  61. package/src/demos/OpenCabinetBall.vue +0 -37
  62. package/src/demos/Statusbar.vue +0 -146
  63. package/src/demos/Steps.vue +0 -45
  64. package/src/demos/Tost.vue +0 -35
  65. package/src/demos/button/button.md +0 -19
  66. package/src/demos/data/terList.json +0 -145
  67. package/src/demos/images/cabinets/H3000-D.png +0 -0
  68. package/src/demos/images/cabinets/H3000-R.png +0 -0
  69. package/src/demos/images/cabinets/H3000-Rh.png +0 -0
  70. package/src/demos/images/cabinets/H3000-Rh2.png +0 -0
  71. package/src/demos/images/cabinets/H3010-R.png +0 -0
  72. package/src/demos/index.vue +0 -348
  73. package/src/docs/icons/Icon.vue +0 -72
  74. package/src/docs/icons/icon.md +0 -21
  75. package/src/docs/index.html +0 -15
  76. package/src/docs/index.vue +0 -301
  77. package/src/main.js +0 -23
  78. package/src/packages/components/ActionBar/images/error.png +0 -0
  79. package/src/packages/components/ActionBar/images/loading.gif +0 -0
  80. package/src/packages/components/ActionBar/images/success.png +0 -0
  81. package/src/packages/components/ActionBar/images/warning.png +0 -0
  82. package/src/packages/components/ActionBar/images/warning_yellow.png +0 -0
  83. package/src/packages/components/ActionBar/index.scss +0 -81
  84. package/src/packages/components/ActionBar/index.vue +0 -100
  85. package/src/packages/components/Badge/index.scss +0 -50
  86. package/src/packages/components/Badge/index.vue +0 -75
  87. package/src/packages/components/Button/index.scss +0 -241
  88. package/src/packages/components/Button/index.vue +0 -111
  89. package/src/packages/components/ButtonGroup/index.scss +0 -54
  90. package/src/packages/components/ButtonGroup/index.vue +0 -75
  91. package/src/packages/components/Check/Cate.vue +0 -138
  92. package/src/packages/components/Check/index.scss +0 -47
  93. package/src/packages/components/Check/index.vue +0 -105
  94. package/src/packages/components/Dialog/images/error.png +0 -0
  95. package/src/packages/components/Dialog/images/success.png +0 -0
  96. package/src/packages/components/Dialog/images/warning-red.png +0 -0
  97. package/src/packages/components/Dialog/images/warning-yellow.png +0 -0
  98. package/src/packages/components/Dialog/index.scss +0 -154
  99. package/src/packages/components/Dialog/index.vue +0 -305
  100. package/src/packages/components/Empty/images/empty-abnormal.png +0 -0
  101. package/src/packages/components/Empty/images/empty-data.png +0 -0
  102. package/src/packages/components/Empty/images/empty-search.png +0 -0
  103. package/src/packages/components/Empty/index.vue +0 -68
  104. package/src/packages/components/Form/FormItem.vue +0 -73
  105. package/src/packages/components/Form/index.vue +0 -76
  106. package/src/packages/components/Icon/index.vue +0 -30
  107. package/src/packages/components/Input/index.scss +0 -184
  108. package/src/packages/components/Input/index.vue +0 -189
  109. package/src/packages/components/InputKeyboard/index.scss +0 -63
  110. package/src/packages/components/InputKeyboard/index.vue +0 -117
  111. package/src/packages/components/InputNumber/index.scss +0 -103
  112. package/src/packages/components/InputNumber/index.vue +0 -160
  113. package/src/packages/components/Menu/index.scss +0 -559
  114. package/src/packages/components/Menu/index.vue +0 -211
  115. package/src/packages/components/OpenCabinetBall/CabinetStatus.vue +0 -94
  116. package/src/packages/components/OpenCabinetBall/index.scss +0 -204
  117. package/src/packages/components/OpenCabinetBall/index.vue +0 -113
  118. package/src/packages/components/Statusbar/CabinetList.vue +0 -125
  119. package/src/packages/components/Statusbar/CabinetListStatus.vue +0 -75
  120. package/src/packages/components/Statusbar/CabinetListTempHum.vue +0 -108
  121. package/src/packages/components/Statusbar/index.scss +0 -205
  122. package/src/packages/components/Statusbar/index.vue +0 -83
  123. package/src/packages/components/Steps/index.scss +0 -104
  124. package/src/packages/components/Steps/index.vue +0 -66
  125. package/src/packages/components/SvgIcon/index.vue +0 -41
  126. package/src/packages/components/Toast/index.vue +0 -72
  127. package/src/packages/fonts/OPPOSans-B.ttf +0 -0
  128. package/src/packages/fonts/OPPOSans-M.ttf +0 -0
  129. package/src/packages/fonts/font.scss +0 -11
  130. package/src/packages/iconfont-svg/demo.css +0 -539
  131. package/src/packages/iconfont-svg/demo_index.html +0 -4811
  132. package/src/packages/iconfont-svg/iconfont.css +0 -819
  133. package/src/packages/iconfont-svg/iconfont.js +0 -1
  134. package/src/packages/iconfont-svg/iconfont.json +0 -1416
  135. package/src/packages/iconfont-svg/iconfont.ttf +0 -0
  136. package/src/packages/iconfont-svg/iconfont.woff +0 -0
  137. package/src/packages/iconfont-svg/iconfont.woff2 +0 -0
  138. package/src/packages/index.js +0 -64
  139. package/src/packages/styles/var.scss +0 -24
  140. package/src/utils/create.js +0 -48
  141. package/src/utils/index.js +0 -13
  142. package/src/utils/validate.js +0 -3
  143. package/vite.config.js +0 -47
  144. /package/{nubomed-ui/style.css → style.css} +0 -0
@@ -1,117 +0,0 @@
1
- <!--
2
- * @Author: chenghuan.dong
3
- * @Date: 2023-06-27 16:57:58
4
- * @LastEditors: chenghuan.dong
5
- * @LastEditTime: 2023-07-25 18:44:57
6
- * @Description: 按钮
7
- -->
8
- <template>
9
- <div class="nb-input-keyboard">
10
- <div class="nb-input-keyboard__input">
11
- <nb-input size="small" v-model="inputValue" placeholder="请输入首字母" />
12
- <nb-button type="primary" :disabled="buttonDisabled" @click="handleSearch">搜索</nb-button>
13
- </div>
14
- <div class="nb-input-keyboard__keyboard">
15
- <div v-for="(item, index) in list" :key="index">
16
- <span
17
- v-for="item2 in item"
18
- :key="item2"
19
- :style="type === 0 && ['123', '回删'].includes(item2) ? 'flex: 2' : ''"
20
- @click="handleClick(item2)"
21
- >{{ item2 }}</span
22
- >
23
- </div>
24
- </div>
25
- </div>
26
- </template>
27
- <script setup>
28
- import { ref, computed, onMounted, nextTick } from 'vue'
29
- import { createNamespace } from '../../../utils/create.js'
30
-
31
- const [name, bem] = createNamespace('input-keyboard')
32
-
33
- // 定义名称
34
- defineOptions({
35
- name: 'NbInputKeyboard'
36
- })
37
-
38
- // 定义props
39
- const props = defineProps({})
40
-
41
- // 定义emits
42
- const emits = defineEmits(['search'])
43
-
44
- const letters = [
45
- ['A', 'B', 'C', 'D', 'E'],
46
- ['F', 'G', 'H', 'I', 'J'],
47
- ['K', 'L', 'M', 'N', 'O'],
48
- ['P', 'Q', 'R', 'S', 'T'],
49
- ['U', 'V', 'W', 'X', 'Y'],
50
- ['123', 'Z', '回删']
51
- ]
52
-
53
- const numbers = [
54
- [1, 2, 3],
55
- [4, 5, 6],
56
- [7, 8, 9],
57
- ['abc', 0, '回删']
58
- ]
59
-
60
- let currentInput = null
61
- const inputValue = ref('')
62
- const type = ref(0) // 模式:0-字母,1-数字
63
-
64
- // 当前展示的键盘
65
- const list = computed(() => {
66
- return type.value === 0 ? letters : numbers
67
- })
68
-
69
- // 搜索按钮是否禁用
70
- const buttonDisabled = computed(() => {
71
- if (inputValue.value) {
72
- return false
73
- } else {
74
- return true
75
- }
76
- })
77
-
78
- onMounted(() => {
79
- nextTick(() => {
80
- currentInput = document.querySelector('.nb-input__inner')
81
- })
82
- })
83
-
84
- // 点击键盘
85
- const handleClick = (key) => {
86
- const len = currentInput.selectionStart
87
- const value = currentInput.value
88
- if (key === '123') {
89
- // 字母切换成数字
90
- type.value = 1
91
- } else if (key === 'abc') {
92
- // 数字切换成字母
93
- type.value = 0
94
- } else if (key === '回删') {
95
- // 回删
96
- currentInput.value = value.substring(0, len - 1) + value.substring(len, value.length)
97
- currentInput.setSelectionRange(len - 1, len - 1)
98
- currentInput.focus()
99
- inputValue.value = currentInput.value
100
- } else {
101
- // 字母或数字
102
- currentInput.value = value.substring(0, len) + key + value.substring(len, value.length)
103
- currentInput.setSelectionRange(len + 1, len + 1)
104
- currentInput.focus()
105
- inputValue.value = currentInput.value
106
- }
107
- }
108
-
109
- // 点击搜索
110
- const handleSearch = () => {
111
- emits('search', inputValue.value)
112
- }
113
- </script>
114
-
115
- <style lang="scss">
116
- @import './index.scss';
117
- </style>
@@ -1,103 +0,0 @@
1
- :root {
2
- --nb-input-number-width: 180px;
3
- --nb-input-number-height: 48px;
4
- --nb-input-number-font-size: 36px;
5
- --nb-input-number-icon-size: 32px;
6
- }
7
-
8
- .nb-input-number {
9
- display: inline-flex;
10
- align-items: center;
11
- line-height: 1;
12
- box-sizing: border-box;
13
- outline: none;
14
- transition: 0.1s;
15
- overflow: hidden;
16
- font-family: inherit;
17
- font-weight: normal;
18
- vertical-align: middle;
19
- caret-color: var(--nb-theme-color);
20
- width: var(--nb-input-number-width);
21
- height: var(--nb-input-number-height);
22
- line-height: var(--nb-input-number-height);
23
- padding: 0;
24
- &:focus {
25
- outline: none;
26
- }
27
- .nb-input-number__inner {
28
- width: 100%;
29
- height: 100%;
30
- flex-grow: 1;
31
- -webkit-appearance: none;
32
- color: var(--nb-input-number-color);
33
- font-size: inherit;
34
- padding: 0;
35
- outline: none;
36
- border: none;
37
- border: 1px solid var(--nb-input-border-color);
38
- background: none;
39
- box-sizing: border-box;
40
- line-height: var(--nb-input-number-height);
41
- font-size: var(--nb-input-number-font-size);
42
- text-align: center;
43
- &::placeholder {
44
- color: var(--nb-input-number-placeholder-text-color);
45
- font-weight: 400;
46
- font-family: inherit;
47
- font-size: inherit;
48
- }
49
- }
50
- .nb-input-number__minus,
51
- .nb-input-number__plus {
52
- min-width: var(--nb-input-number-height);
53
- width: var(--nb-input-number-height);
54
- height: 100%;
55
- display: flex;
56
- align-items: center;
57
- justify-content: center;
58
- border: 1px solid var(--nb-input-border-color);
59
- box-sizing: border-box;
60
- cursor: pointer;
61
- .svg-icon {
62
- color: #8b8ea0;
63
- width: 32px;
64
- height: 32px;
65
- }
66
- &--disabled {
67
- cursor: not-allowed;
68
- .svg-icon {
69
- color: #cad0e0;
70
- }
71
- }
72
- }
73
- .nb-input-number__minus {
74
- border-right: none;
75
- border-top-left-radius: var(--nb-input-border-radius);
76
- border-bottom-left-radius: var(--nb-input-border-radius);
77
- }
78
- .nb-input-number__plus {
79
- border-left: none;
80
- border-top-right-radius: var(--nb-input-border-radius);
81
- border-bottom-right-radius: var(--nb-input-border-radius);
82
- }
83
-
84
- &--focus {
85
- .nb-input-number__inner {
86
- border: 2px solid var(--nb-theme-color);
87
- }
88
- }
89
- &--error {
90
- .nb-input-number__inner {
91
- border: 2px solid var(--nb-abnormal-color);
92
- }
93
- }
94
- &--disabled {
95
- cursor: not-allowed;
96
- background: var(--nb-input-number-disabled-background);
97
- box-shadow: var(--nb-input-number-disabled-box-shadow);
98
- border: 1px solid var(--nb-input-number-disabled-border-color);
99
- &.nb-input-number.nb-input-number--disabled {
100
- color: var(--nb-input-number-disabled-color);
101
- }
102
- }
103
- }
@@ -1,160 +0,0 @@
1
- <!--
2
- * @Author: chenghuan.dong
3
- * @Date: 2023-06-27 16:57:58
4
- * @LastEditors: chenghuan.dong
5
- * @LastEditTime: 2023-06-30 22:00:08
6
- * @Description: 数字器
7
- -->
8
- <template>
9
- <div :class="wrapClass">
10
- <div :class="minusClass" @click.stop="handleStep(-step)">
11
- <svg-icon icon="minus" />
12
- </div>
13
- <input
14
- ref="input"
15
- v-model="inputValue"
16
- :class="[bem('inner')]"
17
- :style="color ? `color: ${color}` : ''"
18
- @input="handleInput"
19
- @focus="handleFocus"
20
- @blur="handleBlur"
21
- />
22
- <div class="plus" :class="plusClass" @click.stop="handleStep(step)">
23
- <svg-icon icon="plus" />
24
- </div>
25
- </div>
26
- </template>
27
- <script setup>
28
- import { ref, computed } from 'vue'
29
- import { createNamespace } from '../../../utils/create.js'
30
- import { isNumber } from '../../../utils/validate.js'
31
-
32
- const [name, bem] = createNamespace('input-number')
33
-
34
- // 定义名称
35
- defineOptions({
36
- name: 'NbInputNumber'
37
- })
38
-
39
- // 定义props
40
- const props = defineProps({
41
- // 定义Props
42
- // 值
43
- modelValue: {
44
- type: [String, Number, Object],
45
- default: ''
46
- },
47
- // 输入框占位文本
48
- placeholder: {
49
- type: String
50
- },
51
- // 原生 readonly 属性,是否只读
52
- readonly: {
53
- type: Boolean,
54
- default: false
55
- },
56
- // 是否为禁用状态
57
- disabled: {
58
- type: Boolean,
59
- default: false
60
- },
61
- // 类型
62
- type: {
63
- type: String,
64
- default: ''
65
- },
66
- step: {
67
- type: Number,
68
- default: 1
69
- },
70
- min: {
71
- type: Number
72
- },
73
- max: {
74
- type: Number
75
- },
76
- // 数字颜色
77
- color: {
78
- type: String,
79
- default: ''
80
- }
81
- })
82
-
83
- // 定义emits
84
- const emits = defineEmits(['input', 'change', 'focus', 'blur', 'clear'])
85
-
86
- const hovering = ref(false)
87
- const focused = ref(false)
88
- const valueIsNumber = ref(true) // 输入值是否是数字
89
-
90
- // 输入框值
91
- const inputValue = computed({
92
- get: () => props.modelValue,
93
- set: (value) => {
94
- emits('update:modelValue', Number(value))
95
- }
96
- })
97
-
98
- // 样式
99
- const wrapClass = computed(() => {
100
- return bem([
101
- props.type,
102
- {
103
- disabled: props.disabled,
104
- focus: focused.value,
105
- error: !valueIsNumber.value
106
- }
107
- ])
108
- })
109
-
110
- // 减号样式
111
- const minusClass = computed(() => {
112
- return bem('minus', {
113
- disabled: !valueIsNumber.value || (props.min !== undefined && Number(inputValue.value) <= props.min)
114
- })
115
- })
116
-
117
- // 加号样式
118
- const plusClass = computed(() => {
119
- return bem('plus', {
120
- disabled: !valueIsNumber.value || (props.max !== undefined && Number(inputValue.value) >= props.max)
121
- })
122
- })
123
-
124
- // 输入框
125
- const handleFocus = () => {
126
- focused.value = true
127
- emits('focus')
128
- }
129
-
130
- const handleBlur = () => {
131
- focused.value = false
132
- emits('blur')
133
- }
134
-
135
- const handleInput = () => {
136
- // 校验是否是数字
137
- valueIsNumber.value = isNumber(inputValue.value)
138
- // 非数字,显示异常
139
- emits('input', Number(inputValue.value))
140
- }
141
-
142
- // 加减
143
- const handleStep = (step) => {
144
- if (!valueIsNumber.value) {
145
- return
146
- }
147
- const value = Number(inputValue.value) + Number(step)
148
- if (props.min !== undefined && step < 0 && value < props.min) {
149
- return
150
- }
151
- if (props.max !== undefined && step > 0 && value > props.max) {
152
- return
153
- }
154
- emits('update:modelValue', value)
155
- }
156
- </script>
157
-
158
- <style lang="scss">
159
- @import './index.scss';
160
- </style>