jobdone-shared-files 0.0.1-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. package/ProjectManagement/projectNavbar.vue +168 -0
  2. package/README.md +27 -0
  3. package/common/directives/collapse.js +13 -0
  4. package/common/format.js +13 -0
  5. package/index.js +15 -0
  6. package/package.json +18 -0
  7. package/paginate.vue +139 -0
  8. package/style/css/vue-loading-overlay/index.css +40 -0
  9. package/style/scss/Bootstrap/_functions.scss +302 -0
  10. package/style/scss/Bootstrap/_mixins.scss +42 -0
  11. package/style/scss/Bootstrap/mixins/_alert.scss +18 -0
  12. package/style/scss/Bootstrap/mixins/_backdrop.scss +14 -0
  13. package/style/scss/Bootstrap/mixins/_banner.scss +7 -0
  14. package/style/scss/Bootstrap/mixins/_border-radius.scss +78 -0
  15. package/style/scss/Bootstrap/mixins/_box-shadow.scss +18 -0
  16. package/style/scss/Bootstrap/mixins/_breakpoints.scss +127 -0
  17. package/style/scss/Bootstrap/mixins/_buttons.scss +70 -0
  18. package/style/scss/Bootstrap/mixins/_caret.scss +69 -0
  19. package/style/scss/Bootstrap/mixins/_clearfix.scss +9 -0
  20. package/style/scss/Bootstrap/mixins/_color-mode.scss +21 -0
  21. package/style/scss/Bootstrap/mixins/_color-scheme.scss +7 -0
  22. package/style/scss/Bootstrap/mixins/_container.scss +11 -0
  23. package/style/scss/Bootstrap/mixins/_deprecate.scss +10 -0
  24. package/style/scss/Bootstrap/mixins/_forms.scss +153 -0
  25. package/style/scss/Bootstrap/mixins/_gradients.scss +47 -0
  26. package/style/scss/Bootstrap/mixins/_grid.scss +151 -0
  27. package/style/scss/Bootstrap/mixins/_image.scss +16 -0
  28. package/style/scss/Bootstrap/mixins/_list-group.scss +27 -0
  29. package/style/scss/Bootstrap/mixins/_lists.scss +7 -0
  30. package/style/scss/Bootstrap/mixins/_pagination.scss +10 -0
  31. package/style/scss/Bootstrap/mixins/_reset-text.scss +17 -0
  32. package/style/scss/Bootstrap/mixins/_resize.scss +6 -0
  33. package/style/scss/Bootstrap/mixins/_table-variants.scss +24 -0
  34. package/style/scss/Bootstrap/mixins/_text-truncate.scss +8 -0
  35. package/style/scss/Bootstrap/mixins/_transition.scss +26 -0
  36. package/style/scss/Bootstrap/mixins/_utilities.scss +97 -0
  37. package/style/scss/Bootstrap/mixins/_visually-hidden.scss +29 -0
  38. package/style/scss/Bootstrap/vendor/_rfs.scss +354 -0
  39. package/style/scss/Settings/_Mixins.scss +228 -0
  40. package/style/scss/Settings/_basic-import.scss +5 -0
  41. package/style/scss/Settings/_bs-variables-dark.scss +70 -0
  42. package/style/scss/Settings/_bs-variables.scss +1703 -0
  43. package/style/scss/Settings/_color-mode.scss +123 -0
  44. package/style/scss/Settings/_custom-variables.scss +7 -0
  45. package/tagEditor.vue +264 -0
  46. package/tree.vue +62 -0
  47. package/treeItem.vue +367 -0
  48. package/vueLoadingOverlay.vue +77 -0
@@ -0,0 +1,123 @@
1
+ $auto-dark-mode: false;
2
+
3
+ $grays-light-mode: (
4
+ "000": $white,
5
+ "100": $gray-100,
6
+ "200": $gray-200,
7
+ "300": $gray-300,
8
+ "400": $gray-400,
9
+ "500": $gray-500,
10
+ "600": $gray-600,
11
+ "700": $gray-700,
12
+ "800": $gray-800,
13
+ "900": $gray-900,
14
+ "1000": $black,
15
+ ) !default;
16
+
17
+ $grays-dark-mode: (
18
+ "000": darken($gray-900, 5%),
19
+ "100": $gray-900,
20
+ "200": $gray-800,
21
+ "300": $gray-700,
22
+ "400": $gray-600,
23
+ "500": $gray-500,
24
+ "600": $gray-400,
25
+ "700": $gray-300,
26
+ "800": $gray-200,
27
+ "900": $gray-100,
28
+ "1000": $white,
29
+ ) !default;
30
+
31
+
32
+ :root{
33
+ @each $color, $value in $grays-light-mode {
34
+ --gray-#{$color}: #{$value};
35
+ }
36
+ }
37
+
38
+ // class --------------------------------------------
39
+ @each $color, $value in $grays-light-mode {
40
+ .bg-gray-#{$color}{
41
+ background-color: var(--gray-#{$color});
42
+ }
43
+ .text-gray-#{$color}{
44
+ color: var(--gray-#{$color});
45
+ }
46
+ }
47
+ // class --------------------------------------------
48
+
49
+
50
+ // dark setting --------------------------------------------
51
+ @if $auto-dark-mode {
52
+ @media (prefers-color-scheme: dark) {
53
+ :root{
54
+ @each $color, $value in $grays-dark-mode {
55
+ --gray-#{$color}: #{$value};
56
+ }
57
+
58
+ // copy from bootstrap (5.3.0-alpha1)
59
+
60
+ // scss-docs-start root-dark-mode-vars
61
+ --bs-body-color: #{$body-color-dark};
62
+ --bs-body-color-rgb: #{to-rgb($body-color-dark)};
63
+ --bs-body-bg: #{$body-bg-dark};
64
+ --bs-body-bg-rgb: #{to-rgb($body-bg-dark)};
65
+
66
+ --bs-emphasis-color: #{$body-emphasis-color-dark};
67
+ --bs-emphasis-color-rgb: #{to-rgb($body-emphasis-color-dark)};
68
+
69
+ --bs-secondary-color: #{$body-secondary-color-dark};
70
+ --bs-secondary-color-rgb: #{to-rgb($body-secondary-color-dark)};
71
+ --bs-secondary-bg: #{$body-secondary-bg-dark};
72
+ --bs-secondary-bg-rgb: #{to-rgb($body-secondary-bg-dark)};
73
+
74
+ --bs-tertiary-color: #{$body-tertiary-color-dark};
75
+ --bs-tertiary-color-rgb: #{to-rgb($body-tertiary-color-dark)};
76
+ --bs-tertiary-bg: #{$body-tertiary-bg-dark};
77
+ --bs-tertiary-bg-rgb: #{to-rgb($body-tertiary-bg-dark)};
78
+
79
+ --bs-emphasis-color: #{$emphasis-color-dark};
80
+
81
+ --bs-primary-text: #{$primary-text-dark};
82
+ --bs-secondary-text: #{$secondary-text-dark};
83
+ --bs-success-text: #{$success-text-dark};
84
+ --bs-info-text: #{$info-text-dark};
85
+ --bs-warning-text: #{$warning-text-dark};
86
+ --bs-danger-text: #{$danger-text-dark};
87
+ --bs-light-text: #{$light-text-dark};
88
+ --bs-dark-text: #{$dark-text-dark};
89
+
90
+ --bs-primary-bg-subtle: #{$primary-bg-subtle-dark};
91
+ --bs-secondary-bg-subtle: #{$secondary-bg-subtle-dark};
92
+ --bs-success-bg-subtle: #{$success-bg-subtle-dark};
93
+ --bs-info-bg-subtle: #{$info-bg-subtle-dark};
94
+ --bs-warning-bg-subtle: #{$warning-bg-subtle-dark};
95
+ --bs-danger-bg-subtle: #{$danger-bg-subtle-dark};
96
+ --bs-light-bg-subtle: #{$light-bg-subtle-dark};
97
+ --bs-dark-bg-subtle: #{$dark-bg-subtle-dark};
98
+
99
+ --bs-primary-border-subtle: #{$primary-border-subtle-dark};
100
+ --bs-secondary-border-subtle: #{$secondary-border-subtle-dark};
101
+ --bs-success-border-subtle: #{$success-border-subtle-dark};
102
+ --bs-info-border-subtle: #{$info-border-subtle-dark};
103
+ --bs-warning-border-subtle: #{$warning-border-subtle-dark};
104
+ --bs-danger-border-subtle: #{$danger-border-subtle-dark};
105
+ --bs-light-border-subtle: #{$light-border-subtle-dark};
106
+ --bs-dark-border-subtle: #{$dark-border-subtle-dark};
107
+
108
+ --bs-heading-color: #{$headings-color-dark};
109
+
110
+ --bs-link-color: #{$link-color-dark};
111
+ --bs-link-hover-color: #{$link-hover-color-dark};
112
+ --bs-link-color-rgb: #{to-rgb($link-color-dark)};
113
+ --bs-link-hover-color-rgb: #{to-rgb($link-hover-color-dark)};
114
+
115
+ --bs-code-color: #{$code-color-dark};
116
+
117
+ --bs-border-color: #{$border-color-dark};
118
+ --bs-border-color-translucent: #{$border-color-translucent-dark};
119
+ // scss-docs-end root-dark-mode-vars
120
+ }
121
+ }
122
+ }
123
+ // dark setting --------------------------------------------
@@ -0,0 +1,7 @@
1
+ $gradient-blue: linear-gradient(295deg, #4483E0 13.42%, #C6DDFF 95.81%);
2
+ $gradient-blue-light: linear-gradient(295deg, rgba(#4483E0, .1) 13.42%, rgba(#C6DDFF, .1) 95.81%);
3
+
4
+ $primary-bg-light: rgba(var(--bs-link-color-rgb), .07);
5
+ $primary-sub-highlight: rgba(var(--bs-link-color-rgb), .5);
6
+
7
+ $zindex-max: 2000 !default;
package/tagEditor.vue ADDED
@@ -0,0 +1,264 @@
1
+ <template>
2
+ <div class="tag-editor" v-if="tagAry">
3
+ <div class="main-cont">
4
+ <div class="form-control form-control-sm" :class="disabled ? 'is-disabled' : ''">
5
+ <template v-if="tagAry.length">
6
+ <div class="badge rounded-pill" :class="disabled ? 'badge-outline-gray ' : 'badge-outline-purple'"
7
+ v-for="(tag, index) in tagAry" :key="index" :title="tag">
8
+ <div class="tag-text">{{ tag }}</div>
9
+ <div class="remove-btn-box" v-if="!disabled">
10
+ <button type="button" class="remove-btn" @click="removeTag(index)"><span
11
+ class="material-icons">close</span>
12
+ </button>
13
+ </div>
14
+ </div>
15
+ </template>
16
+ <input v-if="!disabled" class="new-tag-input" list="datalistOptions" type="text" :placeholder="placeholder"
17
+ v-model.trim="newTag" @keydown.enter="addTag" @keyup="keyupFunction">
18
+ <datalist id="datalistOptions" v-if="autoCompleteShow">
19
+ <option :value="opt" v-for="(opt, idx) in autoCompleteOption" :key="idx">{{ opt }}</option>
20
+ </datalist>
21
+ </div>
22
+ </div>
23
+ <div class="helper-text-box" v-if="!disabled">
24
+ <small class="helper-text">在輸入框中輸入文字後,按下鍵盤的"Enter"鍵,即可增加標籤。(標籤僅接受中文、英文、數字、下底線)</small>
25
+ </div>
26
+ </div>
27
+ </template>
28
+ <script>
29
+ // enum Data & Functions
30
+ // import { } from '../common/enum.js'
31
+
32
+ // vue & bootstrap
33
+ import { ref, reactive, onMounted, computed } from 'vue'
34
+ // import { } from 'bootstrap';
35
+
36
+ // plugins
37
+ // import { v4 as uuidv4 } from 'uuid';
38
+ // import { useVuelidate } from '@vuelidate/core'
39
+ // import { required } from '@vuelidate/validators'
40
+ // import { SwalSuccess, SwalConfirmDelete } from '../common/sweetalert.js';
41
+
42
+ // vue components
43
+ // import Loading from "./vueLoadingOverlay.vue";
44
+
45
+ export default {
46
+ props: {
47
+ defaultTagList: {
48
+ type: Array,
49
+ default: () => []
50
+ },
51
+ placeholder: {
52
+ type: String,
53
+ default: '請在此處輸入標籤文字'
54
+ },
55
+ autoComplete: {
56
+ type: Boolean,
57
+ default: true
58
+ },
59
+ autoCompleteOption: {
60
+ type: Array,
61
+ default: () => []
62
+ },
63
+ disabled: {
64
+ type: Boolean,
65
+ default: false
66
+ }
67
+ },
68
+ setup(props, { emit }) {
69
+ // 基本資料
70
+ const tagAry = reactive([])
71
+ const newTag = ref('')
72
+
73
+ const autoCompleteShow = computed(() => {
74
+ let show = props.autoComplete
75
+ if (!newTag.value || props.autoCompleteOption.length < 1) {
76
+ show = false
77
+ }
78
+ return show
79
+ })
80
+ // 輸入時 AutoComplete
81
+ var autoCompleteTimer
82
+ function updateAutoCompleteOption() {
83
+ clearTimeout(autoCompleteTimer);
84
+ if (newTag.value) {
85
+ autoCompleteTimer = setTimeout(() => {
86
+ emit('update-auto-complete-option', newTag.value);
87
+ }, 500);
88
+ }
89
+ }
90
+
91
+ // 刷新預設選中內容
92
+ function getDefaultTag(updateData = []) {
93
+ tagAry.splice(0, tagAry.length, ...updateData)
94
+ }
95
+ function keyupFunction() {
96
+ if (props.autoCompleteOption) {
97
+ updateAutoCompleteOption()
98
+ }
99
+ newTag.value = newTag.value.replace(/[^\a-\z\A-\Z0-9\u4E00-\u9FA5]/g, '_')
100
+ }
101
+
102
+ // 重複標籤禁止新增
103
+ var isDuplicate = computed(() => {
104
+ return newTag.value ? !!tagAry.find(tag => tag == newTag.value) : false
105
+ })
106
+
107
+ // 增加Tag
108
+ function addTag() {
109
+ if (newTag.value && !isDuplicate.value) {
110
+ tagAry.push(newTag.value)
111
+ }
112
+ newTag.value = ''
113
+ }
114
+ // 移除Tag
115
+ function removeTag(index) {
116
+ tagAry.splice(index, 1)
117
+ }
118
+ function reset() {
119
+ tagAry.splice(0, tagAry.length)
120
+ newTag.value = ''
121
+ }
122
+
123
+ onMounted(() => {
124
+ getDefaultTag(props.defaultTagList)
125
+ })
126
+ return {
127
+ tagAry,
128
+ newTag,
129
+ addTag,
130
+ removeTag,
131
+ updateAutoCompleteOption,
132
+ autoCompleteTimer,
133
+ autoCompleteShow,
134
+ reset,
135
+ keyupFunction,
136
+ isDuplicate,
137
+ getDefaultTag
138
+ }
139
+ }
140
+ }
141
+ </script>
142
+
143
+ <style lang="scss" scoped>
144
+ .tag-editor {
145
+ background: var(--bs-gray-100);
146
+ border-radius: var(--bs-border-radius);
147
+ padding: .5rem;
148
+
149
+ .helper-text-box {
150
+ text-align: start;
151
+
152
+ .helper-text {
153
+ font-size: 0.75rem;
154
+ color: var(--bs-gray-500);
155
+ }
156
+ }
157
+
158
+ .main-cont {
159
+ position: relative;
160
+
161
+ .auto-complete-box {
162
+ all: unset;
163
+ display: none;
164
+ visibility: hidden;
165
+ position: absolute;
166
+ width: 90%;
167
+ overflow: hidden;
168
+
169
+ &.show {
170
+ visibility: visible;
171
+ display: block;
172
+ position: absolute;
173
+ top: calc(100% + 0.25rem);
174
+ background: #fff;
175
+ border: 1px solid var(--bs-gray-300);
176
+ border-radius: var(--bs-border-radius);
177
+ box-shadow: var(--bs-box-shadow);
178
+ }
179
+
180
+ .opt-item {
181
+ padding: 0.5rem;
182
+ cursor: pointer;
183
+ overflow: hidden;
184
+ text-overflow: ellipsis;
185
+
186
+ &:not(:last-child) {
187
+ border-bottom: 1px solid var(--bs-gray-300);
188
+ }
189
+ }
190
+ }
191
+ }
192
+
193
+ .form-control {
194
+ display: flex;
195
+ align-items: center;
196
+ flex-wrap: wrap;
197
+ padding: .5rem .5rem .25rem .5rem;
198
+
199
+ &.is-disabled:hover {
200
+ cursor: not-allowed;
201
+ }
202
+ }
203
+
204
+ .new-tag-input {
205
+ all: unset;
206
+ flex-grow: 1;
207
+ margin-bottom: .25rem;
208
+ background: var(--bs-gray-100);
209
+ padding: .25rem .75rem;
210
+ border-radius: 99px;
211
+ border: 1px solid rgba(#000, 0);
212
+ }
213
+
214
+ .badge.rounded-pill {
215
+ margin: 0 .25rem .25rem 0;
216
+ display: inline-flex;
217
+ align-items: stretch;
218
+ overflow: hidden;
219
+
220
+ .tag-text {
221
+ margin: auto;
222
+ overflow: hidden;
223
+ text-overflow: ellipsis;
224
+ }
225
+
226
+ .remove-btn-box {
227
+ display: flex;
228
+ align-items: stretch;
229
+
230
+ &::before {
231
+ display: block;
232
+ content: ' ';
233
+ height: 100%;
234
+ border-left: 1px solid var(--bs-gray-300);
235
+ margin: 0 0.25rem;
236
+ }
237
+ }
238
+
239
+ .remove-btn {
240
+ all: unset;
241
+ display: flex;
242
+ align-items: center;
243
+ justify-content: center;
244
+
245
+ .material-icons {
246
+ font-size: 16px;
247
+ line-height: 16px;
248
+ color: var(--bs-purple);
249
+ opacity: .5;
250
+ transition: .3s;
251
+ }
252
+
253
+ &:hover {
254
+ cursor: pointer;
255
+
256
+ .material-icons {
257
+ opacity: 1;
258
+ }
259
+ }
260
+ }
261
+ }
262
+
263
+ }
264
+ </style>
package/tree.vue ADDED
@@ -0,0 +1,62 @@
1
+ <template>
2
+ <tree-item v-for="(item, index) in items" :key="item.id" :item="item" :index="index" :click-item="clickItem" :active-id="activeId" :tree-item-class="treeItemClass">
3
+ <template v-slot:icon>
4
+ <slot name="icon"></slot>
5
+ </template>
6
+ </tree-item>
7
+ </template>
8
+
9
+ <script>
10
+ import { ref, computed } from 'vue';
11
+ import TreeItem from './treeItem.vue';
12
+ export default {
13
+ props: {
14
+ items: {
15
+ type: Array,
16
+ default: function () {
17
+ return [];
18
+ }
19
+ },
20
+ clickItem: {
21
+ type: Function
22
+ },
23
+ size: {
24
+ type: String,
25
+ default:""
26
+ },
27
+ bgColor: {
28
+ type: String,
29
+ default:""
30
+ }
31
+ },
32
+ components: {
33
+ TreeItem
34
+ },
35
+ setup(props, { emit }) {
36
+ const activeId = ref("");
37
+ const clickItem = (item) => {
38
+ activeId.value = item.id;
39
+ props.clickItem(item);
40
+ };
41
+ const treeItemClass = computed(() => {
42
+ var classList = [];
43
+ if (props.size == 'sm') {
44
+ classList.push('tree-item-sm');
45
+ }
46
+ if (props.bgColor == 'white') {
47
+ classList.push('tree-item-in-white');
48
+ }
49
+ return classList;
50
+ });
51
+
52
+ return {
53
+ treeItemClass: treeItemClass,
54
+ activeId: activeId,
55
+ clickItem: clickItem
56
+ };
57
+ }
58
+ }
59
+ </script>
60
+ <style>
61
+
62
+ </style>